# v2 git bundle
f3c57c7e4745d5410578f040e06abe1c97b70e08 refs/heads/bundle
f3c57c7e4745d5410578f040e06abe1c97b70e08 HEAD

PACK     lx̽m0ESsa$!A
oPA>>9; 'W E)eGt O6YqO;˨bSsq%gKG$C .yS?qr6Kjllgmʌ
,kG򴷂܎>短b/S
x Ttree e1371a2c4bb947c848ec30f90f43834d9b6560fb
author Brett S <stribbs@stribbs.com> 1785981639 +1000
committer Brett S <stribbs@stribbs.com> 1785981639 +1000

first commit
}4'x31 TOo].shރ:ygUuKSRKZk.  +H^x) 100644 settings.json  CGR%;I+'x+ {
    "svn.ignoreMissingSvnWarning": true
}6Hۯx 0100644 eslint.config.mjs ڈOh~*|Em100644 lesson1.js (Isɳ,]u440000 node_modules zGc^KwDmA100644 package-lock.json G	҄Aֳ'Hm4100644 package.json <^m'/ H\_s<Qi\x;ϸqBĪP =x-import js from "@eslint/js";
import globals from "globals";
import pluginVue from "eslint-plugin-vue";
import json from "@eslint/json";
import markdown from "@eslint/markdown";
import css from "@eslint/css";
import { defineConfig } from "eslint/config";

export default defineConfig([
  { files: ["**/*.{js,mjs,cjs,vue}"], plugins: { js }, extends: ["js/recommended"], languageOptions: { globals: globals.node } },
  pluginVue.configs["flat/essential"],
  { files: ["**/*.json"], plugins: { json }, language: "json/json", extends: ["json/recommended"] },
  { files: ["**/*.jsonc"], plugins: { json }, language: "json/jsonc", extends: ["json/recommended"] },
  { files: ["**/*.json5"], plugins: { json }, language: "json/json5", extends: ["json/recommended"] },
  { files: ["**/*.md"], plugins: { markdown }, language: "markdown/commonmark", extends: ["markdown/recommended"] },
  { files: ["**/*.css"], plugins: { css }, language: "css/css", extends: ["css/recommended"] },
]);
KxO console.log("Hello, World!");
console.log("This is my first Node.js program.");8m)x   {
  "name": "node-course",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "devDependencies": {
        "@eslint/css": "^1.4.0",
        "@eslint/js": "^10.0.1",
        "@eslint/json": "^2.0.1",
        "@eslint/markdown": "^8.0.3",
        "eslint": "^10.8.0",
        "eslint-plugin-vue": "^10.10.0",
        "globals": "^17.9.0"
      }
    },
    "node_modules/@eslint-community/eslint-utils": {
      "version": "4.10.1",
      "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.10.1.tgz",
      "integrity": "sha512-cuadcxVFE8sDK6iWJbs8Sn0av2Nrh2QSGQhVlBW9AaAHqHwjWsZHT8LJ4hFGPh7ASBV2deFdM7H/DPjulmh8rg==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "eslint-visitor-keys": "^3.4.3"
      },
      "engines": {
        "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
      },
      "funding": {
        "url": "https://opencollective.com/eslint"
      },
      "peerDependencies": {
        "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"
      }
    },
    "node_modules/@eslint-community/eslint-utils/node_modules/eslint-visitor-keys": {
      "version": "3.4.3",
      "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.3.tgz",
      "integrity": "sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==",
      "dev": true,
      "license": "Apache-2.0",
      "engines": {
        "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
      },
      "funding": {
        "url": "https://opencollective.com/eslint"
      }
    },
    "node_modules/@eslint-community/regexpp": {
      "version": "4.12.2",
      "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.12.2.tgz",
      "integrity": "sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==",
      "dev": true,
      "license": "MIT",
      "engines": {
        "node": "^12.0.0 || ^14.0.0 || >=16.0.0"
      }
    },
    "node_modules/@eslint/config-array": {
      "version": "0.23.5",
      "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.23.5.tgz",
      "integrity": "sha512-Y3kKLvC1dvTOT+oGlqNQ1XLqK6D1HU2YXPc52NmAlJZbMMWDzGYXMiPRJ8TYD39muD/OTjlZmNJ4ib7dvSrMBA==",
      "dev": true,
      "license": "Apache-2.0",
      "dependencies": {
        "@eslint/object-schema": "^3.0.5",
        "debug": "^4.3.1",
        "minimatch": "^10.2.4"
      },
      "engines": {
        "node": "^20.19.0 || ^22.13.0 || >=24"
      }
    },
    "node_modules/@eslint/config-helpers": {
      "version": "0.7.0",
      "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.7.0.tgz",
      "integrity": "sha512-DObd/KKUsU+FaFv4PLxSRenpXfQWmPXXP3pPZ6/K1PCrMu2vQpMDMuQe/BqYeoLcz8ro0bVDF1RxOJgfVEdhUw==",
      "dev": true,
      "license": "Apache-2.0",
      "dependencies": {
        "@eslint/core": "^1.2.1"
      },
      "engines": {
        "node": "^20.19.0 || ^22.13.0 || >=24"
      }
    },
    "node_modules/@eslint/core": {
      "version": "1.2.1",
      "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.2.1.tgz",
      "integrity": "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==",
      "dev": true,
      "license": "Apache-2.0",
      "dependencies": {
        "@types/json-schema": "^7.0.15"
      },
      "engines": {
        "node": "^20.19.0 || ^22.13.0 || >=24"
      }
    },
    "node_modules/@eslint/css": {
      "version": "1.4.0",
      "resolved": "https://registry.npmjs.org/@eslint/css/-/css-1.4.0.tgz",
      "integrity": "sha512-OnRNKgnbX+tufPuZc2kOJS+v1iIARvfJHRNEAVwN77DBpojl+rGjEP8NKTL6pEZ7BR+HtwIuSSdrymEFlANGxg==",
      "dev": true,
      "license": "Apache-2.0",
      "dependencies": {
        "@eslint/core": "^1.2.1",
        "@eslint/css-tree": "^4.0.4",
        "@eslint/plugin-kit": "^0.7.2"
      },
      "engines": {
        "node": "^20.19.0 || ^22.13.0 || >=24"
      }
    },
    "node_modules/@eslint/css-tree": {
      "version": "4.0.5",
      "resolved": "https://registry.npmjs.org/@eslint/css-tree/-/css-tree-4.0.5.tgz",
      "integrity": "sha512-iPmijIAq4hlIJB86PYmY/fcZORHtjphSqICDbwuw32A/JmkhZQ/K/6TjHE03zqf3n5yABpVcbRAMG8Mi9ojy8g==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "mdn-data": "2.29.0",
        "source-map-js": "^1.2.1"
      },
      "engines": {
        "node": "^20.19.0 || ^22.13.0 || >=24"
      }
    },
    "node_modules/@eslint/js": {
      "version": "10.0.1",
      "resolved": "https://registry.npmjs.org/@eslint/js/-/js-10.0.1.tgz",
      "integrity": "sha512-zeR9k5pd4gxjZ0abRoIaxdc7I3nDktoXZk2qOv9gCNWx3mVwEn32VRhyLaRsDiJjTs0xq/T8mfPtyuXu7GWBcA==",
      "dev": true,
      "license": "MIT",
      "engines": {
        "node": "^20.19.0 || ^22.13.0 || >=24"
      },
      "funding": {
        "url": "https://eslint.org/donate"
      },
      "peerDependencies": {
        "eslint": "^10.0.0"
      },
      "peerDependenciesMeta": {
        "eslint": {
          "optional": true
        }
      }
    },
    "node_modules/@eslint/json": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/@eslint/json/-/json-2.0.1.tgz",
      "integrity": "sha512-Thz2j92ceUF3Bq/0TuWb3MWn3Z+Cwc8k5ptF0fakl2D4Mp8mSx07Xr1aQM4R5NoihzarWUdxfOmQ8DesGy4jOg==",
      "dev": true,
      "license": "Apache-2.0",
      "dependencies": {
        "@eslint/core": "^1.2.1",
        "@eslint/plugin-kit": "^0.7.2",
        "@humanwhocodes/momoa": "^3.3.10",
        "natural-compare": "^1.4.0"
      },
      "engines": {
        "node": "^20.19.0 || ^22.13.0 || >=24"
      }
    },
    "node_modules/@eslint/markdown": {
      "version": "8.0.3",
      "resolved": "https://registry.npmjs.org/@eslint/markdown/-/markdown-8.0.3.tgz",
      "integrity": "sha512-rBTSSShrq7e4O+PWfeE4azH4/CWPNrC+VGxBXiW00o3vYVJnznsZiDayj3KC9JztIMVRZxZHn2nrDIUau/4j7A==",
      "dev": true,
      "license": "MIT",
      "workspaces": [
        "examples/*"
      ],
      "dependencies": {
        "@eslint/core": "^1.2.1",
        "@eslint/plugin-kit": "^0.7.2",
        "github-slugger": "^2.0.0",
        "mdast-util-from-markdown": "^2.0.2",
        "mdast-util-frontmatter": "^2.0.1",
        "mdast-util-gfm": "^3.1.0",
        "mdast-util-math": "^3.0.0",
        "micromark-extension-frontmatter": "^2.0.0",
        "micromark-extension-gfm": "^3.0.0",
        "micromark-extension-math": "^3.1.0",
        "micromark-util-normalize-identifier": "^2.0.1"
      },
      "engines": {
        "node": "^20.19.0 || ^22.13.0 || >=24"
      }
    },
    "node_modules/@eslint/object-schema": {
      "version": "3.0.5",
      "resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-3.0.5.tgz",
      "integrity": "sha512-vqTaUEgxzm+YDSdElad6PiRoX4t8VGDjCtt05zn4nU810UIx/uNEV7/lZJ6KwFThKZOzOxzXy48da+No7HZaMw==",
      "dev": true,
      "license": "Apache-2.0",
      "engines": {
        "node": "^20.19.0 || ^22.13.0 || >=24"
      }
    },
    "node_modules/@eslint/plugin-kit": {
      "version": "0.7.2",
      "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.7.2.tgz",
      "integrity": "sha512-+CNAzxglkrpNf/kKywqQfk74QjtceuOE7Qm+AF8miRvPF/wmmK5+OJOgVh3AVTT3RP2mH3+FOaxlE5v72owk0A==",
      "dev": true,
      "license": "Apache-2.0",
      "dependencies": {
        "@eslint/core": "^1.2.1",
        "levn": "^0.4.1"
      },
      "engines": {
        "node": "^20.19.0 || ^22.13.0 || >=24"
      }
    },
    "node_modules/@humanfs/core": {
      "version": "0.19.2",
      "resolved": "https://registry.npmjs.org/@humanfs/core/-/core-0.19.2.tgz",
      "integrity": "sha512-UhXNm+CFMWcbChXywFwkmhqjs3PRCmcSa/hfBgLIb7oQ5HNb1wS0icWsGtSAUNgefHeI+eBrA8I1fxmbHsGdvA==",
      "dev": true,
      "license": "Apache-2.0",
      "dependencies": {
        "@humanfs/types": "^0.15.0"
      },
      "engines": {
        "node": ">=18.18.0"
      }
    },
    "node_modules/@humanfs/node": {
      "version": "0.16.8",
      "resolved": "https://registry.npmjs.org/@humanfs/node/-/node-0.16.8.tgz",
      "integrity": "sha512-gE1eQNZ3R++kTzFUpdGlpmy8kDZD/MLyHqDwqjkVQI0JMdI1D51sy1H958PNXYkM2rAac7e5/CnIKZrHtPh3BQ==",
      "dev": true,
      "license": "Apache-2.0",
      "dependencies": {
        "@humanfs/core": "^0.19.2",
        "@humanfs/types": "^0.15.0",
        "@humanwhocodes/retry": "^0.4.0"
      },
      "engines": {
        "node": ">=18.18.0"
      }
    },
    "node_modules/@humanfs/types": {
      "version": "0.15.0",
      "resolved": "https://registry.npmjs.org/@humanfs/types/-/types-0.15.0.tgz",
      "integrity": "sha512-ZZ1w0aoQkwuUuC7Yf+7sdeaNfqQiiLcSRbfI08oAxqLtpXQr9AIVX7Ay7HLDuiLYAaFPu8oBYNq/QIi9URHJ3Q==",
      "dev": true,
      "license": "Apache-2.0",
      "engines": {
        "node": ">=18.18.0"
      }
    },
    "node_modules/@humanwhocodes/module-importer": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz",
      "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==",
      "dev": true,
      "license": "Apache-2.0",
      "engines": {
        "node": ">=12.22"
      },
      "funding": {
        "type": "github",
        "url": "https://github.com/sponsors/nzakas"
      }
    },
    "node_modules/@humanwhocodes/momoa": {
      "version": "3.3.10",
      "resolved": "https://registry.npmjs.org/@humanwhocodes/momoa/-/momoa-3.3.10.tgz",
      "integrity": "sha512-KWiFQpSAqEIyrTXko3hFNLeQvSK8zXlJQzhhxsyVn58WFRYXST99b3Nqnu+ttOtjds2Pl2grUHGpe2NzhPynuQ==",
      "dev": true,
      "license": "Apache-2.0",
      "engines": {
        "node": ">=18"
      }
    },
    "node_modules/@humanwhocodes/retry": {
      "version": "0.4.3",
      "resolved": "https://registry.npmjs.org/@humanwhocodes/retry/-/retry-0.4.3.tgz",
      "integrity": "sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==",
      "dev": true,
      "license": "Apache-2.0",
      "engines": {
        "node": ">=18.18"
      },
      "funding": {
        "type": "github",
        "url": "https://github.com/sponsors/nzakas"
      }
    },
    "node_modules/@types/debug": {
      "version": "4.1.13",
      "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.13.tgz",
      "integrity": "sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@types/ms": "*"
      }
    },
    "node_modules/@types/esrecurse": {
      "version": "4.3.1",
      "resolved": "https://registry.npmjs.org/@types/esrecurse/-/esrecurse-4.3.1.tgz",
      "integrity": "sha512-xJBAbDifo5hpffDBuHl0Y8ywswbiAp/Wi7Y/GtAgSlZyIABppyurxVueOPE8LUQOxdlgi6Zqce7uoEpqNTeiUw==",
      "dev": true,
      "license": "MIT"
    },
    "node_modules/@types/estree": {
      "version": "1.0.9",
      "resolved": "https://registry.npmjs.org/@types/estree/-/estree-1.0.9.tgz",
      "integrity": "sha512-GhdPgy1el4/ImP05X05Uw4cw2/M93BCUmnEvWZNStlCzEKME4Fkk+YpoA5OiHNQmoS7Cafb8Xa3Pya8m1Qrzeg==",
      "dev": true,
      "license": "MIT"
    },
    "node_modules/@types/hast": {
      "version": "3.0.5",
      "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.5.tgz",
      "integrity": "sha512-rp/ezSWaD1m44dPKICGhiskI13nVr7qTloFwDa/IYkhhf5nzwP+zIQcIJh3WIFSBOy/H1PzB40jPjMDksN4F+g==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@types/unist": "*"
      }
    },
    "node_modules/@types/json-schema": {
      "version": "7.0.15",
      "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
      "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
      "dev": true,
      "license": "MIT"
    },
    "node_modules/@types/katex": {
      "version": "0.16.8",
      "resolved": "https://registry.npmjs.org/@types/katex/-/katex-0.16.8.tgz",
      "integrity": "sha512-trgaNyfU+Xh2Tc+ABIb44a5AYUpicB3uwirOioeOkNPPbmgRNtcWyDeeFRzjPZENO9Vq8gvVqfhaaXWLlevVwg==",
      "dev": true,
      "license": "MIT"
    },
    "node_modules/@types/mdast": {
      "version": "4.0.4",
      "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz",
      "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@types/unist": "*"
      }
    },
    "node_modules/@types/ms": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/@types/ms/-/ms-2.1.0.tgz",
      "integrity": "sha512-GsCCIZDE/p3i96vtEqx+7dBUGXrc7zeSK3wwPHIaRThS+9OhWIXRqzs4d6k1SVU8g91DrNRWxWUGhp5KXQb2VA==",
      "dev": true,
      "license": "MIT"
    },
    "node_modules/@types/unist": {
      "version": "3.0.3",
      "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz",
      "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==",
      "dev": true,
      "license": "MIT"
    },
    "node_modules/acorn": {
      "version": "8.18.0",
      "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.18.0.tgz",
      "integrity": "sha512-lGq+9yr1/GuAWaVYIHRjvvySG5/4VfKIvC8EWxStPdcDh/Ka7FG3twP6v4d5BkravUilhIAsG4Qj83t02LWUPQ==",
      "dev": true,
      "license": "MIT",
      "bin": {
        "acorn": "bin/acorn"
      },
      "engines": {
        "node": ">=0.4.0"
      }
    },
    "node_modules/acorn-jsx": {
      "version": "5.3.2",
      "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz",
      "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==",
      "dev": true,
      "license": "MIT",
      "peerDependencies": {
        "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
      }
    },
    "node_modules/ajv": {
      "version": "6.15.0",
      "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.15.0.tgz",
      "integrity": "sha512-fgFx7Hfoq60ytK2c7DhnF8jIvzYgOMxfugjLOSMHjLIPgenqa7S7oaagATUq99mV6IYvN2tRmC0wnTYX6iPbMw==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "fast-deep-equal": "^3.1.1",
        "fast-json-stable-stringify": "^2.0.0",
        "json-schema-traverse": "^0.4.1",
        "uri-js": "^4.2.2"
      },
      "funding": {
        "type": "github",
        "url": "https://github.com/sponsors/epoberezkin"
      }
    },
    "node_modules/balanced-match": {
      "version": "4.0.4",
      "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz",
      "integrity": "sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA==",
      "dev": true,
      "license": "MIT",
      "engines": {
        "node": "18 || 20 || >=22"
      }
    },
    "node_modules/boolbase": {
      "version": "1.0.0",
      "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz",
      "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==",
      "dev": true,
      "license": "ISC"
    },
    "node_modules/brace-expansion": {
      "version": "5.0.9",
      "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-5.0.9.tgz",
      "integrity": "sha512-ScQ4IuvIEF1TMlP7Zt+vjJ//9zlPb2SDcxWxM3bk8s6t6GGdJ7KO1dCcTidOPJKePW30LE/2cT7wCyPho9/Wxg==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "balanced-match": "^4.0.2"
      },
      "engines": {
        "node": "20 || >=22"
      }
    },
    "node_modules/ccount": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/ccount/-/ccount-2.0.1.tgz",
      "integrity": "sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg==",
      "dev": true,
      "license": "MIT",
      "funding": {
        "type": "github",
        "url": "https://github.com/sponsors/wooorm"
      }
    },
    "node_modules/character-entities": {
      "version": "2.0.2",
      "resolved": "https://registry.npmjs.org/character-entities/-/character-entities-2.0.2.tgz",
      "integrity": "sha512-shx7oQ0Awen/BRIdkjkvz54PnEEI/EjwXDSIZp86/KKdbafHh1Df/RYGBhn4hbe2+uKC9FnT5UCEdyPz3ai9hQ==",
      "dev": true,
      "license": "MIT",
      "funding": {
        "type": "github",
        "url": "https://github.com/sponsors/wooorm"
      }
    },
    "node_modules/commander": {
      "version": "8.3.0",
      "resolved": "https://registry.npmjs.org/commander/-/commander-8.3.0.tgz",
      "integrity": "sha512-OkTL9umf+He2DZkUq8f8J9of7yL6RJKI24dVITBmNfZBmri9zYZQrKkuXiKhyfPSu8tUhnVBB1iKXevvnlR4Ww==",
      "dev": true,
      "license": "MIT",
      "engines": {
        "node": ">= 12"
      }
    },
    "node_modules/cross-spawn": {
      "version": "7.0.6",
      "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
      "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "path-key": "^3.1.0",
        "shebang-command": "^2.0.0",
        "which": "^2.0.1"
      },
      "engines": {
        "node": ">= 8"
      }
    },
    "node_modules/cssesc": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz",
      "integrity": "sha512-/Tb/JcjK111nNScGob5MNtsntNM1aCNUDipB/TkwZFhyDrrE47SOx/18wF2bbjgc3ZzCSKW1T5nt5EbFoAz/Vg==",
      "dev": true,
      "license": "MIT",
      "bin": {
        "cssesc": "bin/cssesc"
      },
      "engines": {
        "node": ">=4"
      }
    },
    "node_modules/debug": {
      "version": "4.4.3",
      "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz",
      "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "ms": "^2.1.3"
      },
      "engines": {
        "node": ">=6.0"
      },
      "peerDependenciesMeta": {
        "supports-color": {
          "optional": true
        }
      }
    },
    "node_modules/decode-named-character-reference": {
      "version": "1.3.0",
      "resolved": "https://registry.npmjs.org/decode-named-character-reference/-/decode-named-character-reference-1.3.0.tgz",
      "integrity": "sha512-GtpQYB283KrPp6nRw50q3U9/VfOutZOe103qlN7BPP6Ad27xYnOIWv4lPzo8HCAL+mMZofJ9KEy30fq6MfaK6Q==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "character-entities": "^2.0.0"
      },
      "funding": {
        "type": "github",
        "url": "https://github.com/sponsors/wooorm"
      }
    },
    "node_modules/deep-is": {
      "version": "0.1.4",
      "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz",
      "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==",
      "dev": true,
      "license": "MIT"
    },
    "node_modules/dequal": {
      "version": "2.0.3",
      "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz",
      "integrity": "sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==",
      "dev": true,
      "license": "MIT",
      "engines": {
        "node": ">=6"
      }
    },
    "node_modules/devlop": {
      "version": "1.1.0",
      "resolved": "https://registry.npmjs.org/devlop/-/devlop-1.1.0.tgz",
      "integrity": "sha512-RWmIqhcFf1lRYBvNmr7qTNuyCt/7/ns2jbpp1+PalgE/rDQcBT0fioSMUpJ93irlUhC5hrg4cYqe6U+0ImW0rA==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "dequal": "^2.0.0"
      },
      "funding": {
        "type": "github",
        "url": "https://github.com/sponsors/wooorm"
      }
    },
    "node_modules/escape-string-regexp": {
      "version": "4.0.0",
      "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz",
      "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==",
      "dev": true,
      "license": "MIT",
      "engines": {
        "node": ">=10"
      },
      "funding": {
        "url": "https://github.com/sponsors/sindresorhus"
      }
    },
    "node_modules/eslint": {
      "version": "10.8.0",
      "resolved": "https://registry.npmjs.org/eslint/-/eslint-10.8.0.tgz",
      "integrity": "sha512-nuKKvN+oIBO0koN7Tm7dlkmnkc21mtt0QJLwAKzjLq14y6lRTdVG36MZHJ8eQHwdJMwZbQNMlPOYedMq/oVJvQ==",
      "dev": true,
      "license": "MIT",
      "workspaces": [
        "packages/*"
      ],
      "dependencies": {
        "@eslint-community/eslint-utils": "^4.8.0",
        "@eslint-community/regexpp": "^4.12.2",
        "@eslint/config-array": "^0.23.5",
        "@eslint/config-helpers": "^0.7.0",
        "@eslint/core": "^1.2.1",
        "@eslint/plugin-kit": "^0.7.2",
        "@humanfs/node": "^0.16.6",
        "@humanwhocodes/module-importer": "^1.0.1",
        "@humanwhocodes/retry": "^0.4.2",
        "@types/estree": "^1.0.6",
        "ajv": "^6.14.0",
        "cross-spawn": "^7.0.6",
        "debug": "^4.3.2",
        "escape-string-regexp": "^4.0.0",
        "eslint-scope": "^9.1.2",
        "eslint-visitor-keys": "^5.0.1",
        "espree": "^11.2.0",
        "esquery": "^1.7.0",
        "esutils": "^2.0.2",
        "fast-deep-equal": "^3.1.3",
        "file-entry-cache": "^8.0.0",
        "find-up": "^5.0.0",
        "glob-parent": "^6.0.2",
        "ignore": "^5.2.0",
        "imurmurhash": "^0.1.4",
        "is-glob": "^4.0.0",
        "json-stable-stringify-without-jsonify": "^1.0.1",
        "minimatch": "^10.2.5",
        "natural-compare": "^1.4.0",
        "optionator": "^0.9.3"
      },
      "bin": {
        "eslint": "bin/eslint.js"
      },
      "engines": {
        "node": "^20.19.0 || ^22.13.0 || >=24"
      },
      "funding": {
        "url": "https://eslint.org/donate"
      },
      "peerDependencies": {
        "jiti": "*"
      },
      "peerDependenciesMeta": {
        "jiti": {
          "optional": true
        }
      }
    },
    "node_modules/eslint-plugin-vue": {
      "version": "10.10.0",
      "resolved": "https://registry.npmjs.org/eslint-plugin-vue/-/eslint-plugin-vue-10.10.0.tgz",
      "integrity": "sha512-dL9x9rBHqqNcByWiLOHK6L0SB97V82/NC0cZRn9cXPjM7pCuWlpQQP9bFH4vjBv80ej1ZpzAkuD8zWH1o9bZbA==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@eslint-community/eslint-utils": "^4.9.1",
        "natural-compare": "^1.4.0",
        "nth-check": "^2.1.1",
        "postcss-selector-parser": "^7.1.4",
        "semver": "^7.8.5",
        "xml-name-validator": "^5.0.0"
      },
      "engines": {
        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
      },
      "peerDependencies": {
        "@stylistic/eslint-plugin": "^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0",
        "@typescript-eslint/parser": "^7.0.0 || ^8.0.0",
        "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
        "vue-eslint-parser": "^10.3.0"
      },
      "peerDependenciesMeta": {
        "@stylistic/eslint-plugin": {
          "optional": true
        },
        "@typescript-eslint/parser": {
          "optional": true
        }
      }
    },
    "node_modules/eslint-scope": {
      "version": "9.1.2",
      "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-9.1.2.tgz",
      "integrity": "sha512-xS90H51cKw0jltxmvmHy2Iai1LIqrfbw57b79w/J7MfvDfkIkFZ+kj6zC3BjtUwh150HsSSdxXZcsuv72miDFQ==",
      "dev": true,
      "license": "BSD-2-Clause",
      "dependencies": {
        "@types/esrecurse": "^4.3.1",
        "@types/estree": "^1.0.8",
        "esrecurse": "^4.3.0",
        "estraverse": "^5.2.0"
      },
      "engines": {
        "node": "^20.19.0 || ^22.13.0 || >=24"
      },
      "funding": {
        "url": "https://opencollective.com/eslint"
      }
    },
    "node_modules/eslint-visitor-keys": {
      "version": "5.0.1",
      "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz",
      "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==",
      "dev": true,
      "license": "Apache-2.0",
      "engines": {
        "node": "^20.19.0 || ^22.13.0 || >=24"
      },
      "funding": {
        "url": "https://opencollective.com/eslint"
      }
    },
    "node_modules/espree": {
      "version": "11.2.0",
      "resolved": "https://registry.npmjs.org/espree/-/espree-11.2.0.tgz",
      "integrity": "sha512-7p3DrVEIopW1B1avAGLuCSh1jubc01H2JHc8B4qqGblmg5gI9yumBgACjWo4JlIc04ufug4xJ3SQI8HkS/Rgzw==",
      "dev": true,
      "license": "BSD-2-Clause",
      "dependencies": {
        "acorn": "^8.16.0",
        "acorn-jsx": "^5.3.2",
        "eslint-visitor-keys": "^5.0.1"
      },
      "engines": {
        "node": "^20.19.0 || ^22.13.0 || >=24"
      },
      "funding": {
        "url": "https://opencollective.com/eslint"
      }
    },
    "node_modules/esquery": {
      "version": "1.7.0",
      "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.7.0.tgz",
      "integrity": "sha512-Ap6G0WQwcU/LHsvLwON1fAQX9Zp0A2Y6Y/cJBl9r/JbW90Zyg4/zbG6zzKa2OTALELarYHmKu0GhpM5EO+7T0g==",
      "dev": true,
      "license": "BSD-3-Clause",
      "dependencies": {
        "estraverse": "^5.1.0"
      },
      "engines": {
        "node": ">=0.10"
      }
    },
    "node_modules/esrecurse": {
      "version": "4.3.0",
      "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
      "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
      "dev": true,
      "license": "BSD-2-Clause",
      "dependencies": {
        "estraverse": "^5.2.0"
      },
      "engines": {
        "node": ">=4.0"
      }
    },
    "node_modules/estraverse": {
      "version": "5.3.0",
      "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
      "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
      "dev": true,
      "license": "BSD-2-Clause",
      "engines": {
        "node": ">=4.0"
      }
    },
    "node_modules/esutils": {
      "version": "2.0.3",
      "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz",
      "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==",
      "dev": true,
      "license": "BSD-2-Clause",
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/fast-deep-equal": {
      "version": "3.1.3",
      "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz",
      "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",
      "dev": true,
      "license": "MIT"
    },
    "node_modules/fast-json-stable-stringify": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz",
      "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",
      "dev": true,
      "license": "MIT"
    },
    "node_modules/fast-levenshtein": {
      "version": "2.0.6",
      "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz",
      "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==",
      "dev": true,
      "license": "MIT"
    },
    "node_modules/fault": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/fault/-/fault-2.0.1.tgz",
      "integrity": "sha512-WtySTkS4OKev5JtpHXnib4Gxiurzh5NCGvWrFaZ34m6JehfTUhKZvn9njTfw48t6JumVQOmrKqpmGcdwxnhqBQ==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "format": "^0.2.0"
      },
      "funding": {
        "type": "github",
        "url": "https://github.com/sponsors/wooorm"
      }
    },
    "node_modules/file-entry-cache": {
      "version": "8.0.0",
      "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz",
      "integrity": "sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "flat-cache": "^4.0.0"
      },
      "engines": {
        "node": ">=16.0.0"
      }
    },
    "node_modules/find-up": {
      "version": "5.0.0",
      "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz",
      "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "locate-path": "^6.0.0",
        "path-exists": "^4.0.0"
      },
      "engines": {
        "node": ">=10"
      },
      "funding": {
        "url": "https://github.com/sponsors/sindresorhus"
      }
    },
    "node_modules/flat-cache": {
      "version": "4.0.1",
      "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-4.0.1.tgz",
      "integrity": "sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "flatted": "^3.2.9",
        "keyv": "^4.5.4"
      },
      "engines": {
        "node": ">=16"
      }
    },
    "node_modules/flatted": {
      "version": "3.4.4",
      "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.4.4.tgz",
      "integrity": "sha512-5+ybhBZANEJxaH3X5evAFatUxLfEHSr7n6kYJ+1Qd0mUqr4eu9gIf6GDbWHf8RJijHrjjO8G+la14SlL2SeS1Q==",
      "dev": true,
      "license": "ISC"
    },
    "node_modules/format": {
      "version": "0.2.2",
      "resolved": "https://registry.npmjs.org/format/-/format-0.2.2.tgz",
      "integrity": "sha512-wzsgA6WOq+09wrU1tsJ09udeR/YZRaeArL9e1wPbFg3GG2yDnC2ldKpxs4xunpFF9DgqCqOIra3bc1HWrJ37Ww==",
      "dev": true,
      "engines": {
        "node": ">=0.4.x"
      }
    },
    "node_modules/github-slugger": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/github-slugger/-/github-slugger-2.0.0.tgz",
      "integrity": "sha512-IaOQ9puYtjrkq7Y0Ygl9KDZnrf/aiUJYUpVf89y8kyaxbRG7Y1SrX/jaumrv81vc61+kiMempujsM3Yw7w5qcw==",
      "dev": true,
      "license": "ISC"
    },
    "node_modules/glob-parent": {
      "version": "6.0.2",
      "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz",
      "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==",
      "dev": true,
      "license": "ISC",
      "dependencies": {
        "is-glob": "^4.0.3"
      },
      "engines": {
        "node": ">=10.13.0"
      }
    },
    "node_modules/globals": {
      "version": "17.9.0",
      "resolved": "https://registry.npmjs.org/globals/-/globals-17.9.0.tgz",
      "integrity": "sha512-m/MvAW61QVU5VDNF1Vj8axt016h8w7L5TU1e9zlab7XIttAT2YAlCwl75K1fOqvMM9apmD7lbCIRhpfkhmxhCg==",
      "dev": true,
      "license": "MIT",
      "engines": {
        "node": ">=18"
      },
      "funding": {
        "url": "https://github.com/sponsors/sindresorhus"
      }
    },
    "node_modules/ignore": {
      "version": "5.3.2",
      "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz",
      "integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==",
      "dev": true,
      "license": "MIT",
      "engines": {
        "node": ">= 4"
      }
    },
    "node_modules/imurmurhash": {
      "version": "0.1.4",
      "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz",
      "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==",
      "dev": true,
      "license": "MIT",
      "engines": {
        "node": ">=0.8.19"
      }
    },
    "node_modules/is-extglob": {
      "version": "2.1.1",
      "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz",
      "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
      "dev": true,
      "license": "MIT",
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/is-glob": {
      "version": "4.0.3",
      "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz",
      "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "is-extglob": "^2.1.1"
      },
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/isexe": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz",
      "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==",
      "dev": true,
      "license": "ISC"
    },
    "node_modules/json-buffer": {
      "version": "3.0.1",
      "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz",
      "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==",
      "dev": true,
      "license": "MIT"
    },
    "node_modules/json-schema-traverse": {
      "version": "0.4.1",
      "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz",
      "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",
      "dev": true,
      "license": "MIT"
    },
    "node_modules/json-stable-stringify-without-jsonify": {
      "version": "1.0.1",
      "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz",
      "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==",
      "dev": true,
      "license": "MIT"
    },
    "node_modules/katex": {
      "version": "0.16.47",
      "resolved": "https://registry.npmjs.org/katex/-/katex-0.16.47.tgz",
      "integrity": "sha512-Eeo8Ys1doU1z+x8AZsPpQu+p/QcZBI5PeOo7QGQdy2x2m0MU/hYagBbGOmXwr5KVbEfVuWv9LpnQWeehogurjg==",
      "dev": true,
      "funding": [
        "https://opencollective.com/katex",
        "https://github.com/sponsors/katex"
      ],
      "license": "MIT",
      "dependencies": {
        "commander": "^8.3.0"
      },
      "bin": {
        "katex": "cli.js"
      }
    },
    "node_modules/keyv": {
      "version": "4.5.4",
      "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.5.4.tgz",
      "integrity": "sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "json-buffer": "3.0.1"
      }
    },
    "node_modules/levn": {
      "version": "0.4.1",
      "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz",
      "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "prelude-ls": "^1.2.1",
        "type-check": "~0.4.0"
      },
      "engines": {
        "node": ">= 0.8.0"
      }
    },
    "node_modules/locate-path": {
      "version": "6.0.0",
      "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz",
      "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "p-locate": "^5.0.0"
      },
      "engines": {
        "node": ">=10"
      },
      "funding": {
        "url": "https://github.com/sponsors/sindresorhus"
      }
    },
    "node_modules/longest-streak": {
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/longest-streak/-/longest-streak-3.1.0.tgz",
      "integrity": "sha512-9Ri+o0JYgehTaVBBDoMqIl8GXtbWg711O3srftcHhZ0dqnETqLaoIK0x17fUw9rFSlK/0NlsKe0Ahhyl5pXE2g==",
      "dev": true,
      "license": "MIT",
      "funding": {
        "type": "github",
        "url": "https://github.com/sponsors/wooorm"
      }
    },
    "node_modules/markdown-table": {
      "version": "3.0.4",
      "resolved": "https://registry.npmjs.org/markdown-table/-/markdown-table-3.0.4.tgz",
      "integrity": "sha512-wiYz4+JrLyb/DqW2hkFJxP7Vd7JuTDm77fvbM8VfEQdmSMqcImWeeRbHwZjBjIFki/VaMK2BhFi7oUUZeM5bqw==",
      "dev": true,
      "license": "MIT",
      "funding": {
        "type": "github",
        "url": "https://github.com/sponsors/wooorm"
      }
    },
    "node_modules/mdast-util-find-and-replace": {
      "version": "3.0.2",
      "resolved": "https://registry.npmjs.org/mdast-util-find-and-replace/-/mdast-util-find-and-replace-3.0.2.tgz",
      "integrity": "sha512-Tmd1Vg/m3Xz43afeNxDIhWRtFZgM2VLyaf4vSTYwudTyeuTneoL3qtWMA5jeLyz/O1vDJmmV4QuScFCA2tBPwg==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@types/mdast": "^4.0.0",
        "escape-string-regexp": "^5.0.0",
        "unist-util-is": "^6.0.0",
        "unist-util-visit-parents": "^6.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/mdast-util-find-and-replace/node_modules/escape-string-regexp": {
      "version": "5.0.0",
      "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",
      "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==",
      "dev": true,
      "license": "MIT",
      "engines": {
        "node": ">=12"
      },
      "funding": {
        "url": "https://github.com/sponsors/sindresorhus"
      }
    },
    "node_modules/mdast-util-from-markdown": {
      "version": "2.0.3",
      "resolved": "https://registry.npmjs.org/mdast-util-from-markdown/-/mdast-util-from-markdown-2.0.3.tgz",
      "integrity": "sha512-W4mAWTvSlKvf8L6J+VN9yLSqQ9AOAAvHuoDAmPkz4dHf553m5gVj2ejadHJhoJmcmxEnOv6Pa8XJhpxE93kb8Q==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@types/mdast": "^4.0.0",
        "@types/unist": "^3.0.0",
        "decode-named-character-reference": "^1.0.0",
        "devlop": "^1.0.0",
        "mdast-util-to-string": "^4.0.0",
        "micromark": "^4.0.0",
        "micromark-util-decode-numeric-character-reference": "^2.0.0",
        "micromark-util-decode-string": "^2.0.0",
        "micromark-util-normalize-identifier": "^2.0.0",
        "micromark-util-symbol": "^2.0.0",
        "micromark-util-types": "^2.0.0",
        "unist-util-stringify-position": "^4.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/mdast-util-frontmatter": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/mdast-util-frontmatter/-/mdast-util-frontmatter-2.0.1.tgz",
      "integrity": "sha512-LRqI9+wdgC25P0URIJY9vwocIzCcksduHQ9OF2joxQoyTNVduwLAFUzjoopuRJbJAReaKrNQKAZKL3uCMugWJA==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@types/mdast": "^4.0.0",
        "devlop": "^1.0.0",
        "escape-string-regexp": "^5.0.0",
        "mdast-util-from-markdown": "^2.0.0",
        "mdast-util-to-markdown": "^2.0.0",
        "micromark-extension-frontmatter": "^2.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/mdast-util-frontmatter/node_modules/escape-string-regexp": {
      "version": "5.0.0",
      "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz",
      "integrity": "sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw==",
      "dev": true,
      "license": "MIT",
      "engines": {
        "node": ">=12"
      },
      "funding": {
        "url": "https://github.com/sponsors/sindresorhus"
      }
    },
    "node_modules/mdast-util-gfm": {
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/mdast-util-gfm/-/mdast-util-gfm-3.1.0.tgz",
      "integrity": "sha512-0ulfdQOM3ysHhCJ1p06l0b0VKlhU0wuQs3thxZQagjcjPrlFRqY215uZGHHJan9GEAXd9MbfPjFJz+qMkVR6zQ==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "mdast-util-from-markdown": "^2.0.0",
        "mdast-util-gfm-autolink-literal": "^2.0.0",
        "mdast-util-gfm-footnote": "^2.0.0",
        "mdast-util-gfm-strikethrough": "^2.0.0",
        "mdast-util-gfm-table": "^2.0.0",
        "mdast-util-gfm-task-list-item": "^2.0.0",
        "mdast-util-to-markdown": "^2.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/mdast-util-gfm-autolink-literal": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-2.0.1.tgz",
      "integrity": "sha512-5HVP2MKaP6L+G6YaxPNjuL0BPrq9orG3TsrZ9YXbA3vDw/ACI4MEsnoDpn6ZNm7GnZgtAcONJyPhOP8tNJQavQ==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@types/mdast": "^4.0.0",
        "ccount": "^2.0.0",
        "devlop": "^1.0.0",
        "mdast-util-find-and-replace": "^3.0.0",
        "micromark-util-character": "^2.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/mdast-util-gfm-footnote": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-2.1.0.tgz",
      "integrity": "sha512-sqpDWlsHn7Ac9GNZQMeUzPQSMzR6Wv0WKRNvQRg0KqHh02fpTz69Qc1QSseNX29bhz1ROIyNyxExfawVKTm1GQ==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@types/mdast": "^4.0.0",
        "devlop": "^1.1.0",
        "mdast-util-from-markdown": "^2.0.0",
        "mdast-util-to-markdown": "^2.0.0",
        "micromark-util-normalize-identifier": "^2.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/mdast-util-gfm-strikethrough": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-2.0.0.tgz",
      "integrity": "sha512-mKKb915TF+OC5ptj5bJ7WFRPdYtuHv0yTRxK2tJvi+BDqbkiG7h7u/9SI89nRAYcmap2xHQL9D+QG/6wSrTtXg==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@types/mdast": "^4.0.0",
        "mdast-util-from-markdown": "^2.0.0",
        "mdast-util-to-markdown": "^2.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/mdast-util-gfm-table": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/mdast-util-gfm-table/-/mdast-util-gfm-table-2.0.0.tgz",
      "integrity": "sha512-78UEvebzz/rJIxLvE7ZtDd/vIQ0RHv+3Mh5DR96p7cS7HsBhYIICDBCu8csTNWNO6tBWfqXPWekRuj2FNOGOZg==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@types/mdast": "^4.0.0",
        "devlop": "^1.0.0",
        "markdown-table": "^3.0.0",
        "mdast-util-from-markdown": "^2.0.0",
        "mdast-util-to-markdown": "^2.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/mdast-util-gfm-task-list-item": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-2.0.0.tgz",
      "integrity": "sha512-IrtvNvjxC1o06taBAVJznEnkiHxLFTzgonUdy8hzFVeDun0uTjxxrRGVaNFqkU1wJR3RBPEfsxmU6jDWPofrTQ==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@types/mdast": "^4.0.0",
        "devlop": "^1.0.0",
        "mdast-util-from-markdown": "^2.0.0",
        "mdast-util-to-markdown": "^2.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/mdast-util-math": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/mdast-util-math/-/mdast-util-math-3.0.0.tgz",
      "integrity": "sha512-Tl9GBNeG/AhJnQM221bJR2HPvLOSnLE/T9cJI9tlc6zwQk2nPk/4f0cHkOdEixQPC/j8UtKDdITswvLAy1OZ1w==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@types/hast": "^3.0.0",
        "@types/mdast": "^4.0.0",
        "devlop": "^1.0.0",
        "longest-streak": "^3.0.0",
        "mdast-util-from-markdown": "^2.0.0",
        "mdast-util-to-markdown": "^2.1.0",
        "unist-util-remove-position": "^5.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/mdast-util-phrasing": {
      "version": "4.1.0",
      "resolved": "https://registry.npmjs.org/mdast-util-phrasing/-/mdast-util-phrasing-4.1.0.tgz",
      "integrity": "sha512-TqICwyvJJpBwvGAMZjj4J2n0X8QWp21b9l0o7eXyVJ25YNWYbJDVIyD1bZXE6WtV6RmKJVYmQAKWa0zWOABz2w==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@types/mdast": "^4.0.0",
        "unist-util-is": "^6.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/mdast-util-to-markdown": {
      "version": "2.1.2",
      "resolved": "https://registry.npmjs.org/mdast-util-to-markdown/-/mdast-util-to-markdown-2.1.2.tgz",
      "integrity": "sha512-xj68wMTvGXVOKonmog6LwyJKrYXZPvlwabaryTjLh9LuvovB/KAH+kvi8Gjj+7rJjsFi23nkUxRQv1KqSroMqA==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@types/mdast": "^4.0.0",
        "@types/unist": "^3.0.0",
        "longest-streak": "^3.0.0",
        "mdast-util-phrasing": "^4.0.0",
        "mdast-util-to-string": "^4.0.0",
        "micromark-util-classify-character": "^2.0.0",
        "micromark-util-decode-string": "^2.0.0",
        "unist-util-visit": "^5.0.0",
        "zwitch": "^2.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/mdast-util-to-string": {
      "version": "4.0.0",
      "resolved": "https://registry.npmjs.org/mdast-util-to-string/-/mdast-util-to-string-4.0.0.tgz",
      "integrity": "sha512-0H44vDimn51F0YwvxSJSm0eCDOJTRlmN0R1yBh4HLj9wiV1Dn0QoXGbvFAWj2hSItVTlCmBF1hqKlIyUBVFLPg==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@types/mdast": "^4.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/mdn-data": {
      "version": "2.29.0",
      "resolved": "https://registry.npmjs.org/mdn-data/-/mdn-data-2.29.0.tgz",
      "integrity": "sha512-pVxQFCcaYUEAH853+v7yoI/qzhxXSq1bTb9obMYGYAN1c3Hen+XDCEvr296XhstrwlSTNgOR7mCSD4JPjbJe5A==",
      "dev": true,
      "license": "CC0-1.0"
    },
    "node_modules/micromark": {
      "version": "4.0.2",
      "resolved": "https://registry.npmjs.org/micromark/-/micromark-4.0.2.tgz",
      "integrity": "sha512-zpe98Q6kvavpCr1NPVSCMebCKfD7CA2NqZ+rykeNhONIJBpc1tFKt9hucLGwha3jNTNI8lHpctWJWoimVF4PfA==",
      "dev": true,
      "funding": [
        {
          "type": "GitHub Sponsors",
          "url": "https://github.com/sponsors/unifiedjs"
        },
        {
          "type": "OpenCollective",
          "url": "https://opencollective.com/unified"
        }
      ],
      "license": "MIT",
      "dependencies": {
        "@types/debug": "^4.0.0",
        "debug": "^4.0.0",
        "decode-named-character-reference": "^1.0.0",
        "devlop": "^1.0.0",
        "micromark-core-commonmark": "^2.0.0",
        "micromark-factory-space": "^2.0.0",
        "micromark-util-character": "^2.0.0",
        "micromark-util-chunked": "^2.0.0",
        "micromark-util-combine-extensions": "^2.0.0",
        "micromark-util-decode-numeric-character-reference": "^2.0.0",
        "micromark-util-encode": "^2.0.0",
        "micromark-util-normalize-identifier": "^2.0.0",
        "micromark-util-resolve-all": "^2.0.0",
        "micromark-util-sanitize-uri": "^2.0.0",
        "micromark-util-subtokenize": "^2.0.0",
        "micromark-util-symbol": "^2.0.0",
        "micromark-util-types": "^2.0.0"
      }
    },
    "node_modules/micromark-core-commonmark": {
      "version": "2.0.3",
      "resolved": "https://registry.npmjs.org/micromark-core-commonmark/-/micromark-core-commonmark-2.0.3.tgz",
      "integrity": "sha512-RDBrHEMSxVFLg6xvnXmb1Ayr2WzLAWjeSATAoxwKYJV94TeNavgoIdA0a9ytzDSVzBy2YKFK+emCPOEibLeCrg==",
      "dev": true,
      "funding": [
        {
          "type": "GitHub Sponsors",
          "url": "https://github.com/sponsors/unifiedjs"
        },
        {
          "type": "OpenCollective",
          "url": "https://opencollective.com/unified"
        }
      ],
      "license": "MIT",
      "dependencies": {
        "decode-named-character-reference": "^1.0.0",
        "devlop": "^1.0.0",
        "micromark-factory-destination": "^2.0.0",
        "micromark-factory-label": "^2.0.0",
        "micromark-factory-space": "^2.0.0",
        "micromark-factory-title": "^2.0.0",
        "micromark-factory-whitespace": "^2.0.0",
        "micromark-util-character": "^2.0.0",
        "micromark-util-chunked": "^2.0.0",
        "micromark-util-classify-character": "^2.0.0",
        "micromark-util-html-tag-name": "^2.0.0",
        "micromark-util-normalize-identifier": "^2.0.0",
        "micromark-util-resolve-all": "^2.0.0",
        "micromark-util-subtokenize": "^2.0.0",
        "micromark-util-symbol": "^2.0.0",
        "micromark-util-types": "^2.0.0"
      }
    },
    "node_modules/micromark-extension-frontmatter": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/micromark-extension-frontmatter/-/micromark-extension-frontmatter-2.0.0.tgz",
      "integrity": "sha512-C4AkuM3dA58cgZha7zVnuVxBhDsbttIMiytjgsM2XbHAB2faRVaHRle40558FBN+DJcrLNCoqG5mlrpdU4cRtg==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "fault": "^2.0.0",
        "micromark-util-character": "^2.0.0",
        "micromark-util-symbol": "^2.0.0",
        "micromark-util-types": "^2.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/micromark-extension-gfm": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/micromark-extension-gfm/-/micromark-extension-gfm-3.0.0.tgz",
      "integrity": "sha512-vsKArQsicm7t0z2GugkCKtZehqUm31oeGBV/KVSorWSy8ZlNAv7ytjFhvaryUiCUJYqs+NoE6AFhpQvBTM6Q4w==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "micromark-extension-gfm-autolink-literal": "^2.0.0",
        "micromark-extension-gfm-footnote": "^2.0.0",
        "micromark-extension-gfm-strikethrough": "^2.0.0",
        "micromark-extension-gfm-table": "^2.0.0",
        "micromark-extension-gfm-tagfilter": "^2.0.0",
        "micromark-extension-gfm-task-list-item": "^2.0.0",
        "micromark-util-combine-extensions": "^2.0.0",
        "micromark-util-types": "^2.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/micromark-extension-gfm-autolink-literal": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-2.1.0.tgz",
      "integrity": "sha512-oOg7knzhicgQ3t4QCjCWgTmfNhvQbDDnJeVu9v81r7NltNCVmhPy1fJRX27pISafdjL+SVc4d3l48Gb6pbRypw==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "micromark-util-character": "^2.0.0",
        "micromark-util-sanitize-uri": "^2.0.0",
        "micromark-util-symbol": "^2.0.0",
        "micromark-util-types": "^2.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/micromark-extension-gfm-footnote": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-2.1.0.tgz",
      "integrity": "sha512-/yPhxI1ntnDNsiHtzLKYnE3vf9JZ6cAisqVDauhp4CEHxlb4uoOTxOCJ+9s51bIB8U1N1FJ1RXOKTIlD5B/gqw==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "devlop": "^1.0.0",
        "micromark-core-commonmark": "^2.0.0",
        "micromark-factory-space": "^2.0.0",
        "micromark-util-character": "^2.0.0",
        "micromark-util-normalize-identifier": "^2.0.0",
        "micromark-util-sanitize-uri": "^2.0.0",
        "micromark-util-symbol": "^2.0.0",
        "micromark-util-types": "^2.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/micromark-extension-gfm-strikethrough": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-2.1.0.tgz",
      "integrity": "sha512-ADVjpOOkjz1hhkZLlBiYA9cR2Anf8F4HqZUO6e5eDcPQd0Txw5fxLzzxnEkSkfnD0wziSGiv7sYhk/ktvbf1uw==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "devlop": "^1.0.0",
        "micromark-util-chunked": "^2.0.0",
        "micromark-util-classify-character": "^2.0.0",
        "micromark-util-resolve-all": "^2.0.0",
        "micromark-util-symbol": "^2.0.0",
        "micromark-util-types": "^2.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/micromark-extension-gfm-table": {
      "version": "2.1.1",
      "resolved": "https://registry.npmjs.org/micromark-extension-gfm-table/-/micromark-extension-gfm-table-2.1.1.tgz",
      "integrity": "sha512-t2OU/dXXioARrC6yWfJ4hqB7rct14e8f7m0cbI5hUmDyyIlwv5vEtooptH8INkbLzOatzKuVbQmAYcbWoyz6Dg==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "devlop": "^1.0.0",
        "micromark-factory-space": "^2.0.0",
        "micromark-util-character": "^2.0.0",
        "micromark-util-symbol": "^2.0.0",
        "micromark-util-types": "^2.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/micromark-extension-gfm-tagfilter": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-2.0.0.tgz",
      "integrity": "sha512-xHlTOmuCSotIA8TW1mDIM6X2O1SiX5P9IuDtqGonFhEK0qgRI4yeC6vMxEV2dgyr2TiD+2PQ10o+cOhdVAcwfg==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "micromark-util-types": "^2.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/micromark-extension-gfm-task-list-item": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-2.1.0.tgz",
      "integrity": "sha512-qIBZhqxqI6fjLDYFTBIa4eivDMnP+OZqsNwmQ3xNLE4Cxwc+zfQEfbs6tzAo2Hjq+bh6q5F+Z8/cksrLFYWQQw==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "devlop": "^1.0.0",
        "micromark-factory-space": "^2.0.0",
        "micromark-util-character": "^2.0.0",
        "micromark-util-symbol": "^2.0.0",
        "micromark-util-types": "^2.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/micromark-extension-math": {
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/micromark-extension-math/-/micromark-extension-math-3.1.0.tgz",
      "integrity": "sha512-lvEqd+fHjATVs+2v/8kg9i5Q0AP2k85H0WUOwpIVvUML8BapsMvh1XAogmQjOCsLpoKRCVQqEkQBB3NhVBcsOg==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@types/katex": "^0.16.0",
        "devlop": "^1.0.0",
        "katex": "^0.16.0",
        "micromark-factory-space": "^2.0.0",
        "micromark-util-character": "^2.0.0",
        "micromark-util-symbol": "^2.0.0",
        "micromark-util-types": "^2.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/micromark-factory-destination": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/micromark-factory-destination/-/micromark-factory-destination-2.0.1.tgz",
      "integrity": "sha512-Xe6rDdJlkmbFRExpTOmRj9N3MaWmbAgdpSrBQvCFqhezUn4AHqJHbaEnfbVYYiexVSs//tqOdY/DxhjdCiJnIA==",
      "dev": true,
      "funding": [
        {
          "type": "GitHub Sponsors",
          "url": "https://github.com/sponsors/unifiedjs"
        },
        {
          "type": "OpenCollective",
          "url": "https://opencollective.com/unified"
        }
      ],
      "license": "MIT",
      "dependencies": {
        "micromark-util-character": "^2.0.0",
        "micromark-util-symbol": "^2.0.0",
        "micromark-util-types": "^2.0.0"
      }
    },
    "node_modules/micromark-factory-label": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/micromark-factory-label/-/micromark-factory-label-2.0.1.tgz",
      "integrity": "sha512-VFMekyQExqIW7xIChcXn4ok29YE3rnuyveW3wZQWWqF4Nv9Wk5rgJ99KzPvHjkmPXF93FXIbBp6YdW3t71/7Vg==",
      "dev": true,
      "funding": [
        {
          "type": "GitHub Sponsors",
          "url": "https://github.com/sponsors/unifiedjs"
        },
        {
          "type": "OpenCollective",
          "url": "https://opencollective.com/unified"
        }
      ],
      "license": "MIT",
      "dependencies": {
        "devlop": "^1.0.0",
        "micromark-util-character": "^2.0.0",
        "micromark-util-symbol": "^2.0.0",
        "micromark-util-types": "^2.0.0"
      }
    },
    "node_modules/micromark-factory-space": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/micromark-factory-space/-/micromark-factory-space-2.0.1.tgz",
      "integrity": "sha512-zRkxjtBxxLd2Sc0d+fbnEunsTj46SWXgXciZmHq0kDYGnck/ZSGj9/wULTV95uoeYiK5hRXP2mJ98Uo4cq/LQg==",
      "dev": true,
      "funding": [
        {
          "type": "GitHub Sponsors",
          "url": "https://github.com/sponsors/unifiedjs"
        },
        {
          "type": "OpenCollective",
          "url": "https://opencollective.com/unified"
        }
      ],
      "license": "MIT",
      "dependencies": {
        "micromark-util-character": "^2.0.0",
        "micromark-util-types": "^2.0.0"
      }
    },
    "node_modules/micromark-factory-title": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/micromark-factory-title/-/micromark-factory-title-2.0.1.tgz",
      "integrity": "sha512-5bZ+3CjhAd9eChYTHsjy6TGxpOFSKgKKJPJxr293jTbfry2KDoWkhBb6TcPVB4NmzaPhMs1Frm9AZH7OD4Cjzw==",
      "dev": true,
      "funding": [
        {
          "type": "GitHub Sponsors",
          "url": "https://github.com/sponsors/unifiedjs"
        },
        {
          "type": "OpenCollective",
          "url": "https://opencollective.com/unified"
        }
      ],
      "license": "MIT",
      "dependencies": {
        "micromark-factory-space": "^2.0.0",
        "micromark-util-character": "^2.0.0",
        "micromark-util-symbol": "^2.0.0",
        "micromark-util-types": "^2.0.0"
      }
    },
    "node_modules/micromark-factory-whitespace": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/micromark-factory-whitespace/-/micromark-factory-whitespace-2.0.1.tgz",
      "integrity": "sha512-Ob0nuZ3PKt/n0hORHyvoD9uZhr+Za8sFoP+OnMcnWK5lngSzALgQYKMr9RJVOWLqQYuyn6ulqGWSXdwf6F80lQ==",
      "dev": true,
      "funding": [
        {
          "type": "GitHub Sponsors",
          "url": "https://github.com/sponsors/unifiedjs"
        },
        {
          "type": "OpenCollective",
          "url": "https://opencollective.com/unified"
        }
      ],
      "license": "MIT",
      "dependencies": {
        "micromark-factory-space": "^2.0.0",
        "micromark-util-character": "^2.0.0",
        "micromark-util-symbol": "^2.0.0",
        "micromark-util-types": "^2.0.0"
      }
    },
    "node_modules/micromark-util-character": {
      "version": "2.1.1",
      "resolved": "https://registry.npmjs.org/micromark-util-character/-/micromark-util-character-2.1.1.tgz",
      "integrity": "sha512-wv8tdUTJ3thSFFFJKtpYKOYiGP2+v96Hvk4Tu8KpCAsTMs6yi+nVmGh1syvSCsaxz45J6Jbw+9DD6g97+NV67Q==",
      "dev": true,
      "funding": [
        {
          "type": "GitHub Sponsors",
          "url": "https://github.com/sponsors/unifiedjs"
        },
        {
          "type": "OpenCollective",
          "url": "https://opencollective.com/unified"
        }
      ],
      "license": "MIT",
      "dependencies": {
        "micromark-util-symbol": "^2.0.0",
        "micromark-util-types": "^2.0.0"
      }
    },
    "node_modules/micromark-util-chunked": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/micromark-util-chunked/-/micromark-util-chunked-2.0.1.tgz",
      "integrity": "sha512-QUNFEOPELfmvv+4xiNg2sRYeS/P84pTW0TCgP5zc9FpXetHY0ab7SxKyAQCNCc1eK0459uoLI1y5oO5Vc1dbhA==",
      "dev": true,
      "funding": [
        {
          "type": "GitHub Sponsors",
          "url": "https://github.com/sponsors/unifiedjs"
        },
        {
          "type": "OpenCollective",
          "url": "https://opencollective.com/unified"
        }
      ],
      "license": "MIT",
      "dependencies": {
        "micromark-util-symbol": "^2.0.0"
      }
    },
    "node_modules/micromark-util-classify-character": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/micromark-util-classify-character/-/micromark-util-classify-character-2.0.1.tgz",
      "integrity": "sha512-K0kHzM6afW/MbeWYWLjoHQv1sgg2Q9EccHEDzSkxiP/EaagNzCm7T/WMKZ3rjMbvIpvBiZgwR3dKMygtA4mG1Q==",
      "dev": true,
      "funding": [
        {
          "type": "GitHub Sponsors",
          "url": "https://github.com/sponsors/unifiedjs"
        },
        {
          "type": "OpenCollective",
          "url": "https://opencollective.com/unified"
        }
      ],
      "license": "MIT",
      "dependencies": {
        "micromark-util-character": "^2.0.0",
        "micromark-util-symbol": "^2.0.0",
        "micromark-util-types": "^2.0.0"
      }
    },
    "node_modules/micromark-util-combine-extensions": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/micromark-util-combine-extensions/-/micromark-util-combine-extensions-2.0.1.tgz",
      "integrity": "sha512-OnAnH8Ujmy59JcyZw8JSbK9cGpdVY44NKgSM7E9Eh7DiLS2E9RNQf0dONaGDzEG9yjEl5hcqeIsj4hfRkLH/Bg==",
      "dev": true,
      "funding": [
        {
          "type": "GitHub Sponsors",
          "url": "https://github.com/sponsors/unifiedjs"
        },
        {
          "type": "OpenCollective",
          "url": "https://opencollective.com/unified"
        }
      ],
      "license": "MIT",
      "dependencies": {
        "micromark-util-chunked": "^2.0.0",
        "micromark-util-types": "^2.0.0"
      }
    },
    "node_modules/micromark-util-decode-numeric-character-reference": {
      "version": "2.0.2",
      "resolved": "https://registry.npmjs.org/micromark-util-decode-numeric-character-reference/-/micromark-util-decode-numeric-character-reference-2.0.2.tgz",
      "integrity": "sha512-ccUbYk6CwVdkmCQMyr64dXz42EfHGkPQlBj5p7YVGzq8I7CtjXZJrubAYezf7Rp+bjPseiROqe7G6foFd+lEuw==",
      "dev": true,
      "funding": [
        {
          "type": "GitHub Sponsors",
          "url": "https://github.com/sponsors/unifiedjs"
        },
        {
          "type": "OpenCollective",
          "url": "https://opencollective.com/unified"
        }
      ],
      "license": "MIT",
      "dependencies": {
        "micromark-util-symbol": "^2.0.0"
      }
    },
    "node_modules/micromark-util-decode-string": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/micromark-util-decode-string/-/micromark-util-decode-string-2.0.1.tgz",
      "integrity": "sha512-nDV/77Fj6eH1ynwscYTOsbK7rR//Uj0bZXBwJZRfaLEJ1iGBR6kIfNmlNqaqJf649EP0F3NWNdeJi03elllNUQ==",
      "dev": true,
      "funding": [
        {
          "type": "GitHub Sponsors",
          "url": "https://github.com/sponsors/unifiedjs"
        },
        {
          "type": "OpenCollective",
          "url": "https://opencollective.com/unified"
        }
      ],
      "license": "MIT",
      "dependencies": {
        "decode-named-character-reference": "^1.0.0",
        "micromark-util-character": "^2.0.0",
        "micromark-util-decode-numeric-character-referencIe": "^2.0.0",
        "micromark-util-symbol": "^2.0.0"
      }
    },
    "node_modules/micromark-util-encode": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/micromark-util-encode/-/micromark-util-encode-2.0.1.tgz",
      "integrity": "sha512-c3cVx2y4KqUnwopcO9b/SCdo2O67LwJJ/UyqGfbigahfegL9myoEFoDYZgkT7f36T0bLrM9hZTAaAyH+PCAXjw==",
      "dev": true,
      "funding": [
        {
          "type": "GitHub Sponsors",
          "url": "https://github.com/sponsors/unifiedjs"
        },
        {
          "type": "OpenCollective",
          "url": "https://opencollective.com/unified"
        }
      ],
      "license": "MIT"
    },
    "node_modules/micromark-util-html-tag-name": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/micromark-util-html-tag-name/-/micromark-util-html-tag-name-2.0.1.tgz",
      "integrity": "sha512-2cNEiYDhCWKI+Gs9T0Tiysk136SnR13hhO8yW6BGNyhOC4qYFnwF1nKfD3HFAIXA5c45RrIG1ub11GiXeYd1xA==",
      "dev": true,
      "funding": [
        {
          "type": "GitHub Sponsors",
          "url": "https://github.com/sponsors/unifiedjs"
        },
        {
          "type": "OpenCollective",
          "url": "https://opencollective.com/unified"
        }
      ],
      "license": "MIT"
    },
    "node_modules/micromark-util-normalize-identifier": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/micromark-util-normalize-identifier/-/micromark-util-normalize-identifier-2.0.1.tgz",
      "integrity": "sha512-sxPqmo70LyARJs0w2UclACPUUEqltCkJ6PhKdMIDuJ3gSf/Q+/GIe3WKl0Ijb/GyH9lOpUkRAO2wp0GVkLvS9Q==",
      "dev": true,
      "funding": [
        {
          "type": "GitHub Sponsors",
          "url": "https://github.com/sponsors/unifiedjs"
        },
        {
          "type": "OpenCollective",
          "url": "https://opencollective.com/unified"
        }
      ],
      "license": "MIT",
      "dependencies": {
        "micromark-util-symbol": "^2.0.0"
      }
    },
    "node_modules/micromark-util-resolve-all": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/micromark-util-resolve-all/-/micromark-util-resolve-all-2.0.1.tgz",
      "integrity": "sha512-VdQyxFWFT2/FGJgwQnJYbe1jjQoNTS4RjglmSjTUlpUMa95Htx9NHeYW4rGDJzbjvCsl9eLjMQwGeElsqmzcHg==",
      "dev": true,
      "funding": [
        {
          "type": "GitHub Sponsors",
          "url": "https://github.com/sponsors/unifiedjs"
        },
        {
          "type": "OpenCollective",
          "url": "https://opencollective.com/unified"
        }
      ],
      "license": "MIT",
      "dependencies": {
        "micromark-util-types": "^2.0.0"
      }
    },
    "node_modules/micromark-util-sanitize-uri": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/micromark-util-sanitize-uri/-/micromark-util-sanitize-uri-2.0.1.tgz",
      "integrity": "sha512-9N9IomZ/YuGGZZmQec1MbgxtlgougxTodVwDzzEouPKo3qFWvymFHWcnDi2vzV1ff6kas9ucW+o3yzJK9YB1AQ==",
      "dev": true,
      "funding": [
        {
          "type": "GitHub Sponsors",
          "url": "https://github.com/sponsors/unifiedjs"
        },
        {
          "type": "OpenCollective",
          "url": "https://opencollective.com/unified"
        }
      ],
      "license": "MIT",
      "dependencies": {
        "micromark-util-character": "^2.0.0",
        "micromark-util-encode": "^2.0.0",
        "micromark-util-symbol": "^2.0.0"
      }
    },
    "node_modules/micromark-util-subtokenize": {
      "version": "2.1.0",
      "resolved": "https://registry.npmjs.org/micromark-util-subtokenize/-/micromark-util-subtokenize-2.1.0.tgz",
      "integrity": "sha512-XQLu552iSctvnEcgXw6+Sx75GflAPNED1qx7eBJ+wydBb2KCbRZe+NwvIEEMM83uml1+2WSXpBAcp9IUCgCYWA==",
      "dev": true,
      "funding": [
        {
          "type": "GitHub Sponsors",
          "url": "https://github.com/sponsors/unifiedjs"
        },
        {
          "type": "OpenCollective",
          "url": "https://opencollective.com/unified"
        }
      ],
      "license": "MIT",
      "dependencies": {
        "devlop": "^1.0.0",
        "micromark-util-chunked": "^2.0.0",
        "micromark-util-symbol": "^2.0.0",
        "micromark-util-types": "^2.0.0"
      }
    },
    "node_modules/micromark-util-symbol": {
      "version": "2.0.1",
      "resolved": "https://registry.npmjs.org/micromark-util-symbol/-/micromark-util-symbol-2.0.1.tgz",
      "integrity": "sha512-vs5t8Apaud9N28kgCrRUdEed4UJ+wWNvicHLPxCa9ENlYuAY31M0ETy5y1vA33YoNPDFTghEbnh6efaE8h4x0Q==",
      "dev": true,
      "funding": [
        {
          "type": "GitHub Sponsors",
          "url": "https://github.com/sponsors/unifiedjs"
        },
        {
          "type": "OpenCollective",
          "url": "https://opencollective.com/unified"
        }
      ],
      "license": "MIT"
    },
    "node_modules/micromark-util-types": {
      "version": "2.0.2",
      "resolved": "https://registry.npmjs.org/micromark-util-types/-/micromark-util-types-2.0.2.tgz",
      "integrity": "sha512-Yw0ECSpJoViF1qTU4DC6NwtC4aWGt1EkzaQB8KPPyCRR8z9TWeV0HbEFGTO+ZY1wB22zmxnJqhPyTpOVCpeHTA==",
      "dev": true,
      "funding": [
        {
          "type": "GitHub Sponsors",
          "url": "https://github.com/sponsors/unifiedjs"
        },
        {
          "type": "OpenCollective",
          "url": "https://opencollective.com/unified"
        }
      ],
      "license": "MIT"
    },
    "node_modules/minimatch": {
      "version": "10.2.6",
      "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-10.2.6.tgz",
      "integrity": "sha512-vpLQEs+VLCr1nU0BXS07maYoFwlDAH0gngQuuttxIwutDFEMHq2blX+8vpgxDdK3J1PwjCJiep77OitTZ4Ll1A==",
      "dev": true,
      "license": "BlueOak-1.0.0",
      "dependencies": {
        "brace-expansion": "^5.0.8"
      },
      "engines": {
        "node": "18 || 20 || >=22"
      },
      "funding": {
        "url": "https://github.com/sponsors/isaacs"
      }
    },
    "node_modules/ms": {
      "version": "2.1.3",
      "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz",
      "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==",
      "dev": true,
      "license": "MIT"
    },
    "node_modules/natural-compare": {
      "version": "1.4.0",
      "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz",
      "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==",
      "dev": true,
      "license": "MIT"
    },
    "node_modules/nth-check": {
      "version": "2.1.1",
      "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz",
      "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==",
      "dev": true,
      "license": "BSD-2-Clause",
      "dependencies": {
        "boolbase": "^1.0.0"
      },
      "funding": {
        "url": "https://github.com/fb55/nth-check?sponsor=1"
      }
    },
    "node_modules/optionator": {
      "version": "0.9.4",
      "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.4.tgz",
      "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "deep-is": "^0.1.3",
        "fast-levenshtein": "^2.0.6",
        "levn": "^0.4.1",
        "prelude-ls": "^1.2.1",
        "type-check": "^0.4.0",
        "word-wrap": "^1.2.5"
      },
      "engines": {
        "node": ">= 0.8.0"
      }
    },
    "node_modules/p-limit": {
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz",
      "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "yocto-queue": "^0.1.0"
      },
      "engines": {
        "node": ">=10"
      },
      "funding": {
        "url": "https://github.com/sponsors/sindresorhus"
      }
    },
    "node_modules/p-locate": {
      "version": "5.0.0",
      "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz",
      "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "p-limit": "^3.0.2"
      },
      "engines": {
        "node": ">=10"
      },
      "funding": {
        "url": "https://github.com/sponsors/sindresorhus"
      }
    },
    "node_modules/path-exists": {
      "version": "4.0.0",
      "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz",
      "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==",
      "dev": true,
      "license": "MIT",
      "engines": {
        "node": ">=8"
      }
    },
    "node_modules/path-key": {
      "version": "3.1.1",
      "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz",
      "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==",
      "dev": true,
      "license": "MIT",
      "engines": {
        "node": ">=8"
      }
    },
    "node_modules/postcss-selector-parser": {
      "version": "7.1.4",
      "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-7.1.4.tgz",
      "integrity": "sha512-HeP7D2wyhkR+XaK6v4W8oRF62Dsz4flyuczALJp61GckGm42u1saSSJ/0auvcBqxs3jMRFEcPK34At/0JBKdOg==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "cssesc": "^3.0.0",
        "util-deprecate": "^1.0.2"
      },
      "engines": {
        "node": ">=4"
      }
    },
    "node_modules/prelude-ls": {
      "version": "1.2.1",
      "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz",
      "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==",
      "dev": true,
      "license": "MIT",
      "engines": {
        "node": ">= 0.8.0"
      }
    },
    "node_modules/punycode": {
      "version": "2.3.1",
      "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz",
      "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==",
      "dev": true,
      "license": "MIT",
      "engines": {
        "node": ">=6"
      }
    },
    "node_modules/semver": {
      "version": "7.8.5",
      "resolved": "https://registry.npmjs.org/semver/-/semver-7.8.5.tgz",
      "integrity": "sha512-Y7/KDsb8LjooZpwaqGyulO6DQlksgCncchHGk+sZIY4SBvUocMBEFH5Ur1fI4dV+Jvl0w6cjvucaIi40puRioA==",
      "dev": true,
      "license": "ISC",
      "bin": {
        "semver": "bin/semver.js"
      },
      "engines": {
        "node": ">=10"
      }
    },
    "node_modules/shebang-command": {
      "version": "2.0.0",
      "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz",
      "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "shebang-regex": "^3.0.0"
      },
      "engines": {
        "node": ">=8"
      }
    },
    "node_modules/shebang-regex": {
      "version": "3.0.0",
      "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz",
      "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==",
      "dev": true,
      "license": "MIT",
      "engines": {
        "node": ">=8"
      }
    },
    "node_modules/source-map-js": {
      "version": "1.2.1",
      "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz",
      "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==",
      "dev": true,
      "license": "BSD-3-Clause",
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/type-check": {
      "version": "0.4.0",
      "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",
      "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "prelude-ls": "^1.2.1"
      },
      "engines": {
        "node": ">= 0.8.0"
      }
    },
    "node_modules/unist-util-is": {
      "version": "6.0.1",
      "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-6.0.1.tgz",
      "integrity": "sha512-LsiILbtBETkDz8I9p1dQ0uyRUWuaQzd/cuEeS1hoRSyW5E5XGmTzlwY1OrNzzakGowI9Dr/I8HVaw4hTtnxy8g==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@types/unist": "^3.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/unist-util-remove-position": {
      "version": "5.0.0",
      "resolved": "https://registry.npmjs.org/unist-util-remove-position/-/unist-util-remove-position-5.0.0.tgz",
      "integrity": "sha512-Hp5Kh3wLxv0PHj9m2yZhhLt58KzPtEYKQQ4yxfYFEO7EvHwzyDYnduhHnY1mDxoqr7VUwVuHXk9RXKIiYS1N8Q==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@types/unist": "^3.0.0",
        "unist-util-visit": "^5.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/unist-util-stringify-position": {
      "version": "4.0.0",
      "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-4.0.0.tgz",
      "integrity": "sha512-0ASV06AAoKCDkS2+xw5RXJywruurpbC4JZSm7nr7MOt1ojAzvyyaO+UxZf18j8FCF6kmzCZKcAgN/yu2gm2XgQ==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@types/unist": "^3.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/unist-util-visit": {
      "version": "5.1.0",
      "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-5.1.0.tgz",
      "integrity": "sha512-m+vIdyeCOpdr/QeQCu2EzxX/ohgS8KbnPDgFni4dQsfSCtpz8UqDyY5GjRru8PDKuYn7Fq19j1CQ+nJSsGKOzg==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@types/unist": "^3.0.0",
        "unist-util-is": "^6.0.0",
        "unist-util-visit-parents": "^6.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/unist-util-visit-parents": {
      "version": "6.0.2",
      "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-6.0.2.tgz",
      "integrity": "sha512-goh1s1TBrqSqukSc8wrjwWhL0hiJxgA8m4kFxGlQ+8FYQ3C/m11FcTs4YYem7V664AhHVvgoQLk890Ssdsr2IQ==",
      "dev": true,
      "license": "MIT",
      "dependencies": {
        "@types/unist": "^3.0.0",
        "unist-util-is": "^6.0.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/unified"
      }
    },
    "node_modules/uri-js": {
      "version": "4.4.1",
      "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz",
      "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==",
      "dev": true,
      "license": "BSD-2-Clause",
      "dependencies": {
        "punycode": "^2.1.0"
      }
    },
    "node_modules/util-deprecate": {
      "version": "1.0.2",
      "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
      "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==",
      "dev": true,
      "license": "MIT"
    },
    "node_modules/vue-eslint-parser": {
      "version": "10.4.1",
      "resolved": "https://registry.npmjs.org/vue-eslint-parser/-/vue-eslint-parser-10.4.1.tgz",
      "integrity": "sha512-Gk6gRDj0n/fkRa3C3l0bBheoBckUq/Rs0F/TvMWIS6nzzx67amAViMe9CkNgsP2tXyQONvGiHQESHwFtZ3aYDA==",
      "dev": true,
      "license": "MIT",
      "peer": true,
      "dependencies": {
        "debug": "^4.4.0",
        "eslint-scope": "^8.2.0 || ^9.0.0",
        "eslint-visitor-keys": "^4.2.0 || ^5.0.0",
        "espree": "^10.3.0 || ^11.0.0",
        "esquery": "^1.6.0",
        "semver": "^7.6.3"
      },
      "engines": {
        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
      },
      "funding": {
        "url": "https://github.com/sponsors/mysticatea"
      },
      "peerDependencies": {
        "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0"
      }
    },
    "node_modules/which": {
      "version": "2.0.2",
      "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz",
      "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==",
      "dev": true,
      "license": "ISC",
      "dependencies": {
        "isexe": "^2.0.0"
      },
      "bin": {
        "node-which": "bin/node-which"
      },
      "engines": {
        "node": ">= 8"
      }
    },
    "node_modules/word-wrap": {
      "version": "1.2.5",
      "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz",
      "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==",
      "dev": true,
      "license": "MIT",
      "engines": {
        "node": ">=0.10.0"
      }
    },
    "node_modules/xml-name-validator": {
      "version": "5.0.0",
      "resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-5.0.0.tgz",
      "integrity": "sha512-EvGK8EJ3DhaHfbRlETOWAS5pO9MZITeauHKJyb8wyajUfQUenkIg2MvLDTZ4T/TgIcm3HU0TFBgWWboAZ30UHg==",
      "dev": true,
      "license": "Apache-2.0",
      "engines": {
        "node": ">=18"
      }
    },
    "node_modules/yocto-queue": {
      "version": "0.1.0",
      "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz",
      "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==",
      "dev": true,
      "license": "MIT",
      "engines": {
        "node": ">=10"
      },
      "funding": {
        "url": "https://github.com/sponsors/sindresorhus"
      }
    },
    "node_modules/zwitch": {
      "version": "2.0.4",
      "resolved": "https://registry.npmjs.org/zwitch/-/zwitch-2.0.4.tgz",
      "integrity": "sha512-bXE4cR/kVZhKZX/RjPEflHaKVhUVl85noU3v6b8apfQEc1x4A+zBxjZ4lN8LqGd6WZ3dl98pY4o717VFmoPp+A==",
      "dev": true,
      "license": "MIT",
      "funding": {
        "type": "github",
        "url": "https://github.com/sponsors/wooorm"
      }
    }
  }
}
Ex {
  "devDependencies": {
    "@eslint/css": "^1.4.0",
    "@eslint/js": "^10.0.1",
    "@eslint/json": "^2.0.1",
    "@eslint/markdown": "^8.0.3",
    "eslint": "^10.8.0",
    "eslint-plugin-vue": "^10.10.0",
    "globals": "^17.9.0"
  }
}
=֨xH 40000 .vscode GCxEª,n?G40000 node-course aw|Mz]T=ISv>ZXxw40000 .bin L/?{pzYAA100644 .package-lock.json B-/@)zA40000 @eslint-community M톯8ߠq40000 @eslint k])w"940000 @humanfs jfKֵYzɴNV40000 @humanwhocodes R9K􂂧FQnop40000 @types !o{GH@jd85c40000 acorn-jsx rS55*E :o֨G40000 acorn cE=l/N2J40000 ajv fN	8%OB40000 balanced-match A	ꮀɫ9a]<Fn40000 boolbase ֶ_8GE40000 brace-expansion %cV0jΎ݁40000 ccount zhIY`40000 character-entities s#"7$پ(g40000 commander |veL_}͢c40000 cross-spawn utޫiiHUը40000 cssesc sJ3g7.VBNUA^40000 debug 6Mgʴ[猽840000 decode-named-character-reference F#ȍiߘ40000 deep-is 4Zξ4B<40000 dequal +p^Igl\]i40000 devlop ,X{&ęwt40000 escape-string-regexp ÁH|(n_l[40000 eslint-plugin-vue u[˕c6eIj"(40000 eslint-scope Y=$bߝdV40000 eslint-visitor-keys 6?)()|]40000 eslint q AcyK_q0#B|}40000 espree mZnwX+DL?P.40000 esquery <c:)>Sđ_40000 esrecurse ;E[!B]'弽40000 estraverse swe#Xeu-ΎPQ40000 esutils 80Wc93>Z840000 fast-deep-equal /FfPR\[}UAk40000 fast-json-stable-stringify &le!WT˿5>"40000 fast-levenshtein рI*JV40000 fault >v^`egX.˚40000 file-entry-cache Dh*%40000 find-up '_}( ZSg}.40000 flat-cache M%3htA40000 flatted f``K]^rgCib40000 format 3|̱(jM+
40000 github-slugger ȩZS:XLJ40000 glob-parent u!\D]?40000 globals /F8εE <440000 ignore +Ks9͙40000 imurmurhash CO]`A,SRK40000 is-extglob ɼp''G\hU"~40000 is-glob n{Qg5jq'40000 isexe +^3FHXؽ40000 json-buffer HvNY.l40000 json-schema-traverse >^E|}pMQK840000 json-stable-stringify-without-jsonify ODZ!p40000 katex ى0[n5t &j40000 keyv YrՑh+Gp|D40000 levn ?m$"T<梹e40000 locate-path {̻;g:|3Mw40000 longest-streak wS8Ocb8{40000 markdown-table 
zwPq@IIf40000 mdast-util-find-and-replace "XLخ\2:FX40000 mdast-util-from-markdown U~/sXE~],kMf40000 mdast-util-frontmatter Gq 5vj4M}?z#40000 mdast-util-gfm-autolink-literal CxV?VziA640000 mdast-util-gfm-footnote 9ǧHloM_e40000 mdast-util-gfm-strikethrough M$AU$p%z40000 mdast-util-gfm-table Jڷ I3j
Ǳ40000 mdast-util-gfm-task-list-item 7l9RHkCr40000 mdast-util-gfm DZx ЗK"S
	40000 mdast-util-math ĕ=/mif/7gh40000 mdast-util-phrasing  7\x$40000 mdast-util-to-markdown J3$Io1[k|D40000 mdast-util-to-string 
J51  *#40000 mdn-data ۂ9w0Mo40000 micromark-core-commonmark GcD7FM	Q$k40000 micromark-extension-frontmatter MHz 0=rG&	40000 micromark-extension-gfm-autolink-literal jzkhaa>pG40000 micromark-extension-gfm-footnote EH\١x^,*40000 micromark-extension-gfm-strikethrough H;,r:w40000 micromark-extension-gfm-table .x.gHp40000 micromark-extension-gfm-tagfilter IDfR7D+㽖p40000 micromark-extension-gfm-task-list-item n[-D)19`40000 micromark-extension-gfm Pp}{a_CH40000 micromark-extension-math N`W0mrDI40000 micromark-factory-destination )جS<lJ340000 micromark-factory-label }!aLKPaQ~40000 micromark-factory-space 0.YkW>\CIK;40000 micromark-factory-title ;f4S4ǕRS40000 micromark-factory-whitespace ndG[rN;BF罒40000 micromark-util-character W&X_ӀvK40000 micromark-util-chunked -=[raR_*ڿ40000 micromark-util-classify-character @nBF'40000 micromark-util-combine-extensions Oc ,֩~H40000 micromark-util-decode-numeric-character-reference jqkmBcw6c40000 micromark-util-decode-string zd8܍-Mv[40000 micromark-util-encode 7(-G/3}G'40000 micromark-util-html-tag-name Ld'V$-5^r40000 micromark-util-normalize-identifier }Kqb40000 micromark-util-resolve-all +-W:]ϳ، 40000 micromark-util-sanitize-uri j/.muE
#40000 micromark-util-subtokenize q[@Ҳ40000 micromark-util-symbol 1WO|^40000 micromark-util-types UE(8d4sW40000 micromark J1h,`T^jy40000 minimatch lB	0L`}r=40000 ms boݑO<;F@40000 natural-compare \aplt 1a40000 nth-check XyD\%\"40000 optionator wcwIu1dR_m>?40000 p-limit A(I;)DiYss40000 p-locate U^s>urf40000 path-exists ]{0ǥ̈cʒg40000 path-key ;G;7(]t40000 postcss-selector-parser wemegM9SH-40000 prelude-ls d\(x`DB O40000 punycode ڣGYg(ܿRz40000 semver Ru!"hM40000 shebang-command f^/\=z9dF5(l40000 shebang-regex 'eZBg*|+@A40000 source-map-js 2rvnG$B
40000 type-check > iq".}Tv40000 unist-util-is a|"N7|i40000 unist-util-remove-position k/Jiw40000 unist-util-stringify-position 2nb4xIasЛ40000 unist-util-visit-parents XgtXt?m*ݩ`040000 unist-util-visit s37"5::40000 uri-js v=֐5Ab40000 util-deprecate >lm~m2u	_40000 vue-eslint-parser Dshz.<ԟ@NO40000 which X.QL|BYe,40000 word-wrap ++{M(hԁv40000 xml-name-validator Ј2x3{#40000 yocto-queue La(@rud]췬040000 zwitch El:W2&]'l$,2)xe100644 acorn gcJ,LU4Ţa100644 acorn.cmd 2MUO`(Q[0100644 acorn.ps1 om;'_44100644 cssesc ]i;[-}.100644 cssesc.cmd `+M!>:yԊbB+7100644 cssesc.ps1 H
ac EMn	 F100644 eslint P[ bT91xܿ100644 eslint.cmd )İ o`
e100644 eslint.ps1 [I\ XD)0  !n100644 katex ^YlQaF100644 katex.cmd \V,y?IJ,100644 katex.ps1 ʻ.mRVhP"100644 node-which ޠ]Iٲ->100644 node-which.cmd 8؎ffn/h%/H100644 node-which.ps1 ϰD5yl!^-7100644 semver 2y<@(JTvY100644 semver.cmd ("7100644 semver.ps1 1GH((f]Q)/Tpplq/x{#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")

case `uname` in
    *CYGWIN*|*MINGW*|*MSYS*)
        if command -v cygpath > /dev/null 2>&1; then
            basedir=`cygpath -w "$basedir"`
        fi
    ;;
esac

if [ -x "$basedir/node" ]; then
  exec "$basedir/node"  "$basedir/../acorn/bin/acorn" "$@"
else 
  exec node  "$basedir/../acorn/bin/acorn" "$@"
fi
	kx4@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0

IF EXIST "%dp0%\node.exe" (
  SET "_prog=%dp0%\node.exe"
) ELSE (
  SET "_prog=node"
  SET PATHEXT=%PATHEXT:;.JS;=;%
)

endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%"  "%dp0%\..\semver\bin\semver.js" %*
\XAx acorn\bin\acorn" %*
e0x#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent

$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
  # Fix case when both the Windows and Linux builds of Node
  # are installed in the same directory
  $exe=".exe"
}
$ret=0
if (Test-Path "$basedir/node$exe") {
  # Support pipeline input
  if ($MyInvocation.ExpectingInput) {
    $input | & "$basedir/node$exe"  "$basedir/../katex/cli.js" $args
  } else {
    & "$basedir/node$exe"  "$basedir/../katex/cli.js" $args
  }
  $ret=$LASTEXITCODE
} else {
  # Support pipeline input
  if ($MyInvocation.ExpectingInput) {
    $input | & "node$exe"  "$basedir/../katex/cli.js" $args
  } else {
    & "node$exe"  "$basedir/../katex/cli.js" $args
  }
  $ret=$LASTEXITCODE
}
exit $ret
vGx_ acorn/bin/acorn!acorn/bin/acornacorn/bin/acorn2acorn/bin/acorn"#Fx#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")

case `uname` in
    *CYGWIN*|*MINGW*|*MSYS*)
        if command -v cygpath > /dev/null 2>&1; then
            basedir=`cygpath -w "$basedir"`
        fi
    ;;
esac

if [ -x "$basedir/node" ]; then
  exec "$basedir/node"  "$basedir/../cssesc/bin/cssesc" "$@"
else 
  exec node  "$basedir/../cssesc/bin/cssesc" "$@"
fi
xmxx cssesc\bin\cssesc" %*
.	9xg cssesc/bin/cssesc!cssesc/bin/cssesccssesc/bin/cssesc2cssesc/bin/cssesc"ʠ&޵xz#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")

case `uname` in
    *CYGWIN*|*MINGW*|*MSYS*)
        if command -v cygpath > /dev/null 2>&1; then
            basedir=`cygpath -w "$basedir"`
        fi
    ;;
esac

if [ -x "$basedir/node" ]; then
  exec "$basedir/node"  "$basedir/../eslint/bin/eslint.js" "$@"
else 
  exec node  "$basedir/../eslint/bin/eslint.js" "$@"
fi
ox,@ECHO off
GOTO start
:find_dp0
SET dp0=%~dp0
EXIT /b
:start
SETLOCAL
CALL :find_dp0

IF EXIST "%dp0%\node.exe" (
  SET "_prog=%dp0%\node.exe"
) ELSE (
  SET "_prog=node"
  SET PATHEXT=%PATHEXT:;.JS;=;%
)

endLocal & goto #_undefined_# 2>NUL || title %COMSPEC% & "%_prog%"  "%dp0%\..\katex\cli.js" %*
U}9x! eslint\bin\eslint.js" %*

*xg eslint/bin/eslint>eslint/bin/eslinteslint/bin/eslinteslint/bin/eslint%"'[xu#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")

case `uname` in
    *CYGWIN*|*MINGW*|*MSYS*)
        if command -v cygpath > /dev/null 2>&1; then
            basedir=`cygpath -w "$basedir"`
        fi
    ;;
esac

if [ -x "$basedir/node" ]; then
  exec "$basedir/node"  "$basedir/../katex/cli.js" "$@"
else 
  exec node  "$basedir/../katex/cli.js" "$@"
fi
{ixz#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")

case `uname` in
    *CYGWIN*|*MINGW*|*MSYS*)
        if command -v cygpath > /dev/null 2>&1; then
            basedir=`cygpath -w "$basedir"`
        fi
    ;;
esac

if [ -x "$basedir/node" ]; then
  exec "$basedir/node"  "$basedir/../which/bin/node-which" "$@"
else 
  exec node  "$basedir/../which/bin/node-which" "$@"
fi
go x! which\bin\node-which" %*

dxs which/bin/node-which!which/bin/node-whichwhich/bin/node-which2which/bin/node-which"*xz#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")

case `uname` in
    *CYGWIN*|*MINGW*|*MSYS*)
        if command -v cygpath > /dev/null 2>&1; then
            basedir=`cygpath -w "$basedir"`
        fi
    ;;
esac

if [ -x "$basedir/node" ]; then
  exec "$basedir/node"  "$basedir/../semver/bin/semver.js" "$@"
else 
  exec node  "$basedir/../semver/bin/semver.js" "$@"
fi
pxxg semver/bin/semver>semver/bin/semversemver/bin/semversemver/bin/semver%'six Ց\-NH	ixI 40000 eslint-utils }5ucϿx6#40000 regexpp f81FyRTx~100644 LICENSE >,6BsB 100644 README.md %yTɺ
 eʻQ,[<`K100644 index.d.mts Ʉt'7";?C{_100644 index.d.ts Ʉt'7";?C{_100644 index.js `霳u&S100644 index.js.map <SW{q@}f100644 index.mjs z.'vk@Ҁ100644 index.mjs.map Mi{DF@Y9m40000 node_modules @GŰ*DY100644 package.json mWvkS'bƚNݖYDxBThe MIT License (MIT)

Copyright (c) 2015-2017 Evgeny Poberezkin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

WZ(Ox7 .MIT License

Copyright (c) 2018 Toru Nagashima@rixk# @eslint-community/eslint-utils

[![npm version](https://img.shields.io/npm/v/@eslint-community/eslint-utils.svg)](https://www.npmjs.com/package/@eslint-community/eslint-utils)
[![Downloads/month](https://img.shields.io/npm/dm/@eslint-community/eslint-utils.svg)](http://www.npmtrends.com/@eslint-community/eslint-utils)
[![Build Status](https://github.com/eslint-community/eslint-utils/workflows/CI/badge.svg)](https://github.com/eslint-community/eslint-utils/actions)
[![Coverage Status](https://codecov.io/gh/eslint-community/eslint-utils/branch/main/graph/badge.svg)](https://codecov.io/gh/eslint-community/eslint-utils)

## 🏁 Goal

This package provides utility functions and classes for make ESLint custom rules.

For examples:

-   [`getStaticValue`](https://eslint-community.github.io/eslint-utils/api/ast-utils.html#getstaticvalue) evaluates static value on AST.
-   [`ReferenceTracker`](https://eslint-community.github.io/eslint-utils/api/scope-utils.html#referencetracker-class) checks the members of modules/globals as handling assignments and destructuring.

## 📖 Usage

See [documentation](https://eslint-community.github.io/eslint-utils).

## 📰 Changelog

See [releases](https://github.com/eslint-community/eslint-utils/releases).

## ❤️ Contributing

Welcome contributing!

Please use GitHub's Issues/PRs.

### Development Tools

-   `npm run test-coverage` runs tests and measures coverage.
-   `npm run clean` removes the coverage result of `npm run test-coverage` command.
-   `npm run coverage` shows the coverage result of the last `npm run test-coverage` command.
-   `npm run lint` runs ESLint.
-   `npm run watch` runs tests on each file change.
gxh&import * as eslint from 'eslint';
import { Rule, AST } from 'eslint';
import * as estree from 'estree';

declare const READ: unique symbol;
declare const CALL: unique symbol;
declare const CONSTRUCT: unique symbol;
declare const ESM: unique symbol;
declare class ReferenceTracker {
    constructor(globalScope: Scope$2, options?: {
        mode?: "legacy" | "strict" | undefined;
        globalObjectNames?: string[] | undefined;
    } | undefined);
    private variableStack;
    private globalScope;
    private mode;
    private globalObjectNames;
    iterateGlobalReferences<T>(traceMap: TraceMap$2<T>): IterableIterator<TrackedReferences$2<T>>;
    iterateCjsReferences<T_1>(traceMap: TraceMap$2<T_1>): IterableIterator<TrackedReferences$2<T_1>>;
    iterateEsmReferences<T_2>(traceMap: TraceMap$2<T_2>): IterableIterator<TrackedReferences$2<T_2>>;
    iteratePropertyReferences<T_3>(node: Expression, traceMap: TraceMap$2<T_3>): IterableIterator<TrackedReferences$2<T_3>>;
    private _iterateVariableReferences;
    private _iteratePropertyReferences;
    private _iterateLhsReferences;
    private _iterateImportReferences;
}
declare namespace ReferenceTracker {
    export { READ };
    export { CALL };
    export { CONSTRUCT };
    export { ESM };
}
type Scope$2 = eslint.Scope.Scope;
type Expression = estree.Expression;
type TraceMap$2<T> = TraceMap$1<T>;
type TrackedReferences$2<T> = TrackedReferences$1<T>;

type StaticValue$2 = StaticValueProvided$1 | StaticValueOptional$1;
type StaticValueProvided$1 = {
    optional?: undefined;
    value: unknown;
};
type StaticValueOptional$1 = {
    optional?: true;
    value: undefined;
};
type ReferenceTrackerOptions$1 = {
    globalObjectNames?: string[];
    mode?: "legacy" | "strict";
};
type TraceMap$1<T = unknown> = {
    [i: string]: TraceMapObject<T>;
};
type TraceMapObject<T> = {
    [i: string]: TraceMapObject<T>;
    [CALL]?: T;
    [CONSTRUCT]?: T;
    [READ]?: T;
    [ESM]?: boolean;
};
type TrackedReferences$1<T> = {
    info: T;
    node: Rule.Node;
    path: string[];
    type: typeof CALL | typeof CONSTRUCT | typeof READ;
};
type HasSideEffectOptions$1 = {
    considerGetters?: boolean;
    considerImplicitTypeConversion?: boolean;
};
type PunctuatorToken<Value extends string> = AST.Token & {
    type: "Punctuator";
    value: Value;
};
type ArrowToken$1 = PunctuatorToken<"=>">;
type CommaToken$1 = PunctuatorToken<",">;
type SemicolonToken$1 = PunctuatorToken<";">;
type ColonToken$1 = PunctuatorToken<":">;
type OpeningParenToken$1 = PunctuatorToken<"(">;
type ClosingParenToken$1 = PunctuatorToken<")">;
type OpeningBracketToken$1 = PunctuatorToken<"[">;
type ClosingBracketToken$1 = PunctuatorToken<"]">;
type OpeningBraceToken$1 = PunctuatorToken<"{">;
type ClosingBraceToken$1 = PunctuatorToken<"}">;

declare function findVariable(initialScope: Scope$1, nameOrNode: string | Identifier): Variable | null;
type Scope$1 = eslint.Scope.Scope;
type Variable = eslint.Scope.Variable;
type Identifier = estree.Identifier;

declare function getFunctionHeadLocation(node: FunctionNode$1, sourceCode: SourceCode$2): SourceLocation | null;
type SourceCode$2 = eslint.SourceCode;
type FunctionNode$1 = estree.Function;
type SourceLocation = estree.SourceLocation;

declare function getFunctionNameWithKind(node: FunctionNode, sourceCode?: eslint.SourceCode | undefined): string;
type FunctionNode = estree.Function;

declare function getInnermostScope(initialScope: Scope, node: Node$4): Scope;
type Scope = eslint.Scope.Scope;
type Node$4 = estree.Node;

declare function getPropertyName(node: MemberExpression | MethodDefinition | Property | PropertyDefinition, initialScope?: eslint.Scope.Scope | undefined): string | null | undefined;
type MemberExpression = estree.MemberExpression;
type MethodDefinition = estree.MethodDefinition;
type Property = estree.Property;
type PropertyDefinition = estree.PropertyDefinition;

declare function getStaticValue(node: Node$3, initialScope?: eslint.Scope.Scope | null | undefined): StaticValue$1 | null;
type StaticValue$1 = StaticValue$2;
type Node$3 = estree.Node;

declare function getStringIfConstant(node: Node$2, initialScope?: eslint.Scope.Scope | null | undefined): string | null;
type Node$2 = estree.Node;

declare function hasSideEffect(node: Node$1, sourceCode: SourceCode$1, options?: HasSideEffectOptions$1 | undefined): boolean;
type Node$1 = estree.Node;
type SourceCode$1 = eslint.SourceCode;

declare function isArrowToken(token: CommentOrToken): token is ArrowToken$1;
declare function isCommaToken(token: CommentOrToken): token is CommaToken$1;
declare function isSemicolonToken(token: CommentOrToken): token is SemicolonToken$1;
declare function isColonToken(token: CommentOrToken): token is ColonToken$1;
declare function isOpeningParenToken(token: CommentOrToken): token is OpeningParenToken$1;
declare function isClosingParenToken(token: CommentOrToken): token is ClosingParenToken$1;
declare function isOpeningBracketToken(token: CommentOrToken): token is OpeningBracketToken$1;
declare function isClosingBracketToken(token: CommentOrToken): token is ClosingBracketToken$1;
declare function isOpeningBraceToken(token: CommentOrToken): token is OpeningBraceToken$1;
declare function isClosingBraceToken(token: CommentOrToken): token is ClosingBraceToken$1;
declare function isCommentToken(token: CommentOrToken): token is estree.Comment;
declare function isNotArrowToken(arg0: CommentOrToken): boolean;
declare function isNotCommaToken(arg0: CommentOrToken): boolean;
declare function isNotSemicolonToken(arg0: CommentOrToken): boolean;
declare function isNotColonToken(arg0: CommentOrToken): boolean;
declare function isNotOpeningParenToken(arg0: CommentOrToken): boolean;
declare function isNotClosingParenToken(arg0: CommentOrToken): boolean;
declare function isNotOpeningBracketToken(arg0: CommentOrToken): boolean;
declare function isNotClosingBracketToken(arg0: CommentOrToken): boolean;
declare function isNotOpeningBraceToken(arg0: CommentOrToken): boolean;
declare function isNotClosingBraceToken(arg0: CommentOrToken): boolean;
declare function isNotCommentToken(arg0: CommentOrToken): boolean;
type Token = eslint.AST.Token;
type Comment = estree.Comment;
type CommentOrToken = Comment | Token;

declare function isParenthesized(timesOrNode: Node | number, nodeOrSourceCode: Node | SourceCode, optionalSourceCode?: eslint.SourceCode | undefined): boolean;
type Node = estree.Node;
type SourceCode = eslint.SourceCode;

declare class PatternMatcher {
    constructor(pattern: RegExp, options?: {
        escaped?: boolean | undefined;
    } | undefined);
    execAll(str: string): IterableIterator<RegExpExecArray>;
    test(str: string): boolean;
    [Symbol.replace](str: string, replacer: string | ((...strs: string[]) => string)): string;
}

declare namespace _default {
    export { CALL };
    export { CONSTRUCT };
    export { ESM };
    export { findVariable };
    export { getFunctionHeadLocation };
    export { getFunctionNameWithKind };
    export { getInnermostScope };
    export { getPropertyName };
    export { getStaticValue };
    export { getStringIfConstant };
    export { hasSideEffect };
    export { isArrowToken };
    export { isClosingBraceToken };
    export { isClosingBracketToken };
    export { isClosingParenToken };
    export { isColonToken };
    export { isCommaToken };
    export { isCommentToken };
    export { isNotArrowToken };
    export { isNotClosingBraceToken };
    export { isNotClosingBracketToken };
    export { isNotClosingParenToken };
    export { isNotColonToken };
    export { isNotCommaToken };
    export { isNotCommentToken };
    export { isNotOpeningBraceToken };
    export { isNotOpeningBracketToken };
    export { isNotOpeningParenToken };
    export { isNotSemicolonToken };
    export { isOpeningBraceToken };
    export { isOpeningBracketToken };
    export { isOpeningParenToken };
    export { isParenthesized };
    export { isSemicolonToken };
    export { PatternMatcher };
    export { READ };
    export { ReferenceTracker };
}

type StaticValue = StaticValue$2;
type StaticValueOptional = StaticValueOptional$1;
type StaticValueProvided = StaticValueProvided$1;
type ReferenceTrackerOptions = ReferenceTrackerOptions$1;
type TraceMap<T> = TraceMap$1<T>;
type TrackedReferences<T> = TrackedReferences$1<T>;
type HasSideEffectOptions = HasSideEffectOptions$1;
type ArrowToken = ArrowToken$1;
type CommaToken = CommaToken$1;
type SemicolonToken = SemicolonToken$1;
type ColonToken = ColonToken$1;
type OpeningParenToken = OpeningParenToken$1;
type ClosingParenToken = ClosingParenToken$1;
type OpeningBracketToken = OpeningBracketToken$1;
type ClosingBracketToken = ClosingBracketToken$1;
type OpeningBraceToken = OpeningBraceToken$1;
type ClosingBraceToken = ClosingBraceToken$1;

export { ArrowToken, CALL, CONSTRUCT, ClosingBraceToken, ClosingBracketToken, ClosingParenToken, ColonToken, CommaToken, ESM, HasSideEffectOptions, OpeningBraceToken, OpeningBracketToken, OpeningParenToken, PatternMatcher, READ, ReferenceTracker, ReferenceTrackerOptions, SemicolonToken, StaticValue, StaticValueOptional, StaticValueProvided, TraceMap, TrackedReferences, _default as default, findVariable, getFunctionHeadLocation, getFunctionNameWithKind, getInnermostScope, getPropertyName, getStaticValue, getStringIfConstant, hasSideEffect, isArrowToken, isClosingBraceToken, isClosingBracketToken, isClosingParenToken, isColonToken, isCommaToken, isCommentToken, isNotArrowToken, isNotClosingBraceToken, isNotClosingBracketToken, isNotClosingParenToken, isNotColonToken, isNotCommaToken, isNotCommentToken, isNotOpeningBraceToken, isNotOpeningBracketToken, isNotOpeningParenToken, isNotSemicolonToken, isOpeningBraceToken, isOpeningBracketToken, isOpeningParenToken, isParenthesized, isSemicolonToken };
m+x   'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var eslintVisitorKeys = require('eslint-visitor-keys');

/** @typedef {import("eslint").Scope.Scope} Scope */
/** @typedef {import("estree").Node} Node */

/**
 * Get the innermost scope which contains a given location.
 * @param {Scope} initialScope The initial scope to search.
 * @param {Node} node The location to search.
 * @returns {Scope} The innermost scope.
 */
function getInnermostScope(initialScope, node) {
    const location = /** @type {[number, number]} */ (node.range)[0];

    let scope = initialScope;
    let found = false;
    do {
        found = false;
        for (const childScope of scope.childScopes) {
            const range = /** @type {[number, number]} */ (
                childScope.block.range
            );

            if (range[0] <= location && location < range[1]) {
                scope = childScope;
                found = true;
                break
            }
        }
    } while (found)

    return scope
}

/** @typedef {import("eslint").Scope.Scope} Scope */
/** @typedef {import("eslint").Scope.Variable} Variable */
/** @typedef {import("estree").Identifier} Identifier */

/**
 * Find the variable of a given name.
 * @param {Scope} initialScope The scope to start finding.
 * @param {string|Identifier} nameOrNode The variable name to find. If this is a Node object then it should be an Identifier node.
 * @returns {Variable|null} The found variable or null.
 */
function findVariable(initialScope, nameOrNode) {
    let name = "";
    /** @type {Scope|null} */
    let scope = initialScope;

    if (typeof nameOrNode === "string") {
        name = nameOrNode;
    } else {
        name = nameOrNode.name;
        scope = getInnermostScope(scope, nameOrNode);
    }

    while (scope != null) {
        const variable = scope.set.get(name);
        if (variable != null) {
            return variable
        }
        scope = scope.upper;
    }

    return null
}

/** @typedef {import("eslint").AST.Token} Token */
/** @typedef {import("estree").Comment} Comment */
/** @typedef {import("./types.mjs").ArrowToken} ArrowToken */
/** @typedef {import("./types.mjs").CommaToken} CommaToken */
/** @typedef {import("./types.mjs").SemicolonToken} SemicolonToken */
/** @typedef {import("./types.mjs").ColonToken} ColonToken */
/** @typedef {import("./types.mjs").OpeningParenToken} OpeningParenToken */
/** @typedef {import("./types.mjs").ClosingParenToken} ClosingParenToken */
/** @typedef {import("./types.mjs").OpeningBracketToken} OpeningBracketToken */
/** @typedef {import("./types.mjs").ClosingBracketToken} ClosingBracketToken */
/** @typedef {import("./types.mjs").OpeningBraceToken} OpeningBraceToken */
/** @typedef {import("./types.mjs").ClosingBraceToken} ClosingBraceToken */
/**
 * @template {string} Value
 * @typedef {import("./types.mjs").PunctuatorToken<Value>} PunctuatorToken
 */

/** @typedef {Comment | Token} CommentOrToken */

/**
 * Creates the negate function of the given function.
 * @param {function(CommentOrToken):boolean} f - The function to negate.
 * @returns {function(CommentOrToken):boolean} Negated function.
 */
function negate(f) {
    return (token) => !f(token)
}

/**
 * Checks if the given token is a PunctuatorToken with the given value
 * @template {string} Value
 * @param {CommentOrToken} token - The token to check.
 * @param {Value} value - The value to check.
 * @returns {token is PunctuatorToken<Value>} `true` if the token is a PunctuatorToken with the given value.
 */
function isPunctuatorTokenWithValue(token, value) {
    return token.type === "Punctuator" && token.value === value
}

/**
 * Checks if the given token is an arrow token or not.
 * @param {CommentOrToken} token - The token to check.
 * @returns {token is ArrowToken} `true` if the token is an arrow token.
 */
function isArrowToken(token) {
    return isPunctuatorTokenWithValue(token, "=>")
}

/**
 * Checks if the given token is a comma token or not.
 * @param {CommentOrToken} token - The token to check.
 * @returns {token is CommaToken} `true` if the token is a comma token.
 */
function isCommaToken(token) {
    return isPunctuatorTokenWithValue(token, ",")
}

/**
 * Checks if the given token is a semicolon token or not.
 * @param {CommentOrToken} token - The token to check.
 * @returns {token is SemicolonToken} `true` if the token is a semicolon token.
 */
function isSemicolonToken(token) {
    return isPunctuatorTokenWithValue(token, ";")
}

/**
 * Checks if the given token is a colon token or not.
 * @param {CommentOrToken} token - The token to check.
 * @returns {token is ColonToken} `true` if the token is a colon token.
 */
function isColonToken(token) {
    return isPunctuatorTokenWithValue(token, ":")
}

/**
 * Checks if the given token is an opening parenthesis token or not.
 * @param {CommentOrToken} token - The token to check.
 * @returns {token is OpeningParenToken} `true` if the token is an opening parenthesis token.
 */
function isOpeningParenToken(token) {
    return isPunctuatorTokenWithValue(token, "(")
}

/**
 * Checks if the given token is a closing parenthesis token or not.
 * @param {CommentOrToken} token - The token to check.
 * @returns {token is ClosingParenToken} `true` if the token is a closing parenthesis token.
 */
function isClosingParenToken(token) {
    return isPunctuatorTokenWithValue(token, ")")
}

/**
 * Checks if the given token is an opening square bracket token or not.
 * @param {CommentOrToken} token - The token to check.
 * @returns {token is OpeningBracketToken} `true` if the token is an opening square bracket token.
 */
function isOpeningBracketToken(token) {
    return isPunctuatorTokenWithValue(token, "[")
}

/**
 * Checks if the given token is a closing square bracket token or not.
 * @param {CommentOrToken} token - The token to check.
 * @returns {token is ClosingBracketToken} `true` if the token is a closing square bracket token.
 */
function isClosingBracketToken(token) {
    return isPunctuatorTokenWithValue(token, "]")
}

/**
 * Checks if the given token is an opening brace token or not.
 * @param {CommentOrToken} token - The token to check.
 * @returns {token is OpeningBraceToken} `true` if the token is an opening brace token.
 */
function isOpeningBraceToken(token) {
    return isPunctuatorTokenWithValue(token, "{")
}

/**
 * Checks if the given token is a closing brace token or not.
 * @param {CommentOrToken} token - The token to check.
 * @returns {token is ClosingBraceToken} `true` if the token is a closing brace token.
 */
function isClosingBraceToken(token) {
    return isPunctuatorTokenWithValue(token, "}")
}

/**
 * Checks if the given token is a comment token or not.
 * @param {CommentOrToken} token - The token to check.
 * @returns {token is Comment} `true` if the token is a comment token.
 */
function isCommentToken(token) {
    return ["Block", "Line", "Shebang"].includes(token.type)
}

const isNotArrowToken = negate(isArrowToken);
const isNotCommaToken = negate(isCommaToken);
const isNotSemicolonToken = negate(isSemicolonToken);
const isNotColonToken = negate(isColonToken);
const isNotOpeningParenToken = negate(isOpeningParenToken);
const isNotClosingParenToken = negate(isClosingParenToken);
const isNotOpeningBracketToken = negate(isOpeningBracketToken);
const isNotClosingBracketToken = negate(isClosingBracketToken);
const isNotOpeningBraceToken = negate(isOpeningBraceToken);
const isNotClosingBraceToken = negate(isClosingBraceToken);
const isNotCommentToken = negate(isCommentToken);

/** @typedef {import("eslint").Rule.Node} RuleNode */
/** @typedef {import("eslint").SourceCode} SourceCode */
/** @typedef {import("eslint").AST.Token} Token */
/** @typedef {import("estree").Function} FunctionNode */
/** @typedef {import("estree").FunctionDeclaration} FunctionDeclaration */
/** @typedef {import("estree").FunctionExpression} FunctionExpression */
/** @typedef {import("estree").SourceLocation} SourceLocation */
/** @typedef {import("estree").Position} Position */

/**
 * Get the `(` token of the given function node.
 * @param {FunctionExpression | FunctionDeclaration} node - The function node to get.
 * @param {SourceCode} sourceCode - The source code object to get tokens.
 * @returns {Token} `(` token.
 */
function getOpeningParenOfParams(node, sourceCode) {
    return node.id
        ? /** @type {Token} */ (
              sourceCode.getTokenAfter(node.id, isOpeningParenToken)
          )
        : /** @type {Token} */ (
              sourceCode.getFirstToken(node, isOpeningParenToken)
          )
}

/**
 * Get the location of the given function node for reporting.
 * @param {FunctionNode} node - The function node to get.
 * @param {SourceCode} sourceCode - The source code object to get tokens.
 * @returns {SourceLocation|null} The location of the function node for reporting.
 */
function getFunctionHeadLocation(node, sourceCode) {
    const parent = /** @type {RuleNode} */ (node).parent;

    /** @type {Position|null} */
    let start = null;
    /** @type {Position|null} */
    let end = null;

    if (node.type === "ArrowFunctionExpression") {
        const arrowToken = /** @type {Token} */ (
            sourceCode.getTokenBefore(node.body, isArrowToken)
        );

        start = arrowToken.loc.start;
        end = arrowToken.loc.end;
    } else if (
        parent &&
        (parent.type === "Property" ||
            parent.type === "MethodDefinition" ||
            parent.type === "PropertyDefinition")
    ) {
        start = /** @type {SourceLocation} */ (parent.loc).start;
        end = getOpeningParenOfParams(node, sourceCode).loc.start;
    } else {
        start = /** @type {SourceLocation} */ (node.loc).start;
        end = getOpeningParenOfParams(node, sourceCode).loc.start;
    }

    return {
        start: { ...start },
        end: { ...end },
    }
}

/* globals self, window */
/** @typedef {import("./types.mjs").StaticValue} StaticValue */
/** @typedef {import("eslint").Scope.Scope} Scope */
/** @typedef {import("eslint").Scope.Variable} Variable */
/** @typedef {import("estree").Node} Node */
/** @typedef {import("@typescript-eslint/types").TSESTree.Node} TSESTreeNode */
/** @typedef {import("@typescript-eslint/types").TSESTree.AST_NODE_TYPES} TSESTreeNodeTypes */
/** @typedef {import("@typescript-eslint/types").TSESTree.MemberExpression} MemberExpression */
/** @typedef {import("@typescript-eslint/types").TSESTree.Property} Property */
/** @typedef {import("@typescript-eslint/types").TSESTree.RegExpLiteral} RegExpLiteral */
/** @typedef {import("@typescript-eslint/types").TSESTree.BigIntLiteral} BigIntLiteral */
/** @typedef {import("@typescript-eslint/types").TSESTree.Literal} Literal */

const globalObject =
    typeof globalThis !== "undefined"
        ? globalThis
        : // @ts-ignore
        typeof self !== "undefined"
        ? // @ts-ignore
          self
        : // @ts-ignore
        typeof window !== "undefined"
        ? // @ts-ignore
          window
        : typeof global !== "undefined"
        ? global
        : {};

const builtinNames = Object.freeze(
    new Set([
        "Array",
        "ArrayBuffer",
        "BigInt",
        "BigInt64Array",
        "BigUint64Array",
        "Boolean",
        "DataView",
        "Date",
        "decodeURI",
        "decodeURIComponent",
        "encodeURI",
        "encodeURIComponent",
        "escape",
        "Float32Array",
        "Float64Array",
        "Function",
        "Infinity",
        "Int16Array",
        "Int32Array",
        "Int8Array",
        "isFinite",
        "isNaN",
        "isPrototypeOf",
        "JSON",
        "Map",
        "Math",
        "NaN",
        "Number",
        "Object",
        "parseFloat",
        "parseInt",
        "Promise",
        "Proxy",
        "Reflect",
        "RegExp",
        "Set",
        "String",
        "Symbol",
        "Uint16Array",
        "Uint32Array",
        "Uint8Array",
        "Uint8ClampedArray",
        "undefined",
        "unescape",
        "WeakMap",
        "WeakSet",
    ]),
);
const callAllowed = new Set(
    [
        Array.isArray,
        Array.of,
        Array.prototype.at,
        Array.prototype.concat,
        Array.prototype.entries,
        Array.prototype.every,
        Array.prototype.filter,
        Array.prototype.find,
        Array.prototype.findIndex,
        Array.prototype.flat,
        Array.prototype.includes,
        Array.prototype.indexOf,
        Array.prototype.join,
        Array.prototype.keys,
        Array.prototype.lastIndexOf,
        Array.prototype.slice,
        Array.prototype.some,
        Array.prototype.toString,
        Array.prototype.values,
        typeof BigInt === "function" ? BigInt : undefined,
        Boolean,
        Date,
        Date.parse,
        decodeURI,
        decodeURIComponent,
        encodeURI,
        encodeURIComponent,
        escape,
        isFinite,
        isNaN,
        // @ts-ignore
        isPrototypeOf,
        Map,
        Map.prototype.entries,
        Map.prototype.get,
        Map.prototype.has,
        Map.prototype.keys,
        Map.prototype.values,
        .../** @type {(keyof typeof Math)[]} */ (
            Object.getOwnPropertyNames(Math)
        )
            .filter((k) => k !== "random")
            .map((k) => Math[k])
            .filter((f) => typeof f === "function"),
        Number,
        Number.isFinite,
        Number.isNaN,
        Number.parseFloat,
        Number.parseInt,
        Number.prototype.toExponential,
        Number.prototype.toFixed,
        Number.prototype.toPrecision,
        Number.prototype.toString,
        Object,
        Object.entries,
        Object.is,
        Object.isExtensible,
        Object.isFrozen,
        Object.isSealed,
        Object.keys,
        Object.values,
        parseFloat,
        parseInt,
        RegExp,
        Set,
        Set.prototype.entries,
        Set.prototype.has,
        Set.prototype.keys,
        Set.prototype.values,
        String,
        String.fromCharCode,
        String.fromCodePoint,
        String.raw,
        String.prototype.at,
        String.prototype.charAt,
        String.prototype.charCodeAt,
        String.prototype.codePointAt,
        String.prototype.concat,
        String.prototype.endsWith,
        String.prototype.includes,
        String.prototype.indexOf,
        String.prototype.lastIndexOf,
        String.prototype.normalize,
        String.prototype.padEnd,
        String.prototype.padStart,
        String.prototype.slice,
        String.prototype.startsWith,
        String.prototype.substr,
        String.prototype.substring,
        String.prototype.toLowerCase,
        String.prototype.toString,
        String.prototype.toUpperCase,
        String.prototype.trim,
        String.prototype.trimEnd,
        String.prototype.trimLeft,
        String.prototype.trimRight,
        String.prototype.trimStart,
        Symbol.for,
        Symbol.keyFor,
        unescape,
    ].filter((f) => typeof f === "function"),
);
const callPassThrough = new Set([
    Object.freeze,
    Object.preventExtensions,
    Object.seal,
]);

/** @type {ReadonlyArray<readonly [Function, ReadonlySet<string>]>} */
const getterAllowed = [
    [Map, new Set(["size"])],
    [
        RegExp,
        new Set([
            "dotAll",
            "flags",
            "global",
            "hasIndices",
            "ignoreCase",
            "multiline",
            "source",
            "sticky",
            "unicode",
        ]),
    ],
    [Set, new Set(["size"])],
];

/**
 * Get the property descriptor.
 * @param {object} object The object to get.
 * @param {string|number|symbol} name The property name to get.
 */
function getPropertyDescriptor(object, name) {
    let x = object;
    while ((typeof x === "object" || typeof x === "function") && x !== null) {
        const d = Object.getOwnPropertyDescriptor(x, name);
        if (d) {
            return d
        }
        x = Object.getPrototypeOf(x);
    }
    return null
}

/**
 * Check if a property is getter or not.
 * @param {object} object The object to check.
 * @param {string|number|symbol} name The property name to check.
 */
function isGetter(object, name) {
    const d = getPropertyDescriptor(object, name);
    return d != null && d.get != null
}

/**
 * Get the element values of a given node list.
 * @param {(Node|TSESTreeNode|null)[]} nodeList The node list to get values.
 * @param {Scope|undefined|null} initialScope The initial scope to find variables.
 * @returns {any[]|null} The value list if all nodes are constant. Otherwise, null.
 */
function getElementValues(nodeList, initialScope) {
    const valueList = [];

    for (let i = 0; i < nodeList.length; ++i) {
        const elementNode = nodeList[i];

        if (elementNode == null) {
            valueList.length = i + 1;
        } else if (elementNode.type === "SpreadElement") {
            const argument = getStaticValueR(elementNode.argument, initialScope);
            if (argument == null) {
                return null
            }
            valueList.push(.../** @type {Iterable<any>} */ (argument.value));
        } else {
            const element = getStaticValueR(elementNode, initialScope);
            if (element == null) {
                return null
            }
            valueList.push(element.value);
        }
    }

    return valueList
}

/**
 * Checks if a variable is a built-in global.
 * @param {Variable|null} variable The variable to check.
 * @returns {variable is Variable & {defs:[]}}
 */
function isBuiltinGlobal(variable) {
    return (
        variable != null &&
        variable.defs.length === 0 &&
        builtinNames.has(variable.name) &&
        variable.name in globalObject
    )
}

/**
 * Checks if a variable can be considered as a constant.
 * @param {Variable} variable
 * @returns {variable is Variable & {defs: [import("eslint").Scope.Definition & { type: "Variable" }]}} True if the variable can be considered as a constant.
 */
function canBeConsideredConst(variable) {
    if (variable.defs.length !== 1) {
        return false
    }
    const def = variable.defs[0];
    return Boolean(
        def.parent &&
            def.type === "Variable" &&
            (def.parent.kind === "const" || isEffectivelyConst(variable)),
    )
}

/**
 * Returns whether the given variable is never written to after initialization.
 * @param {Variable} variable
 * @returns {boolean}
 */
function isEffectivelyConst(variable) {
    const refs = variable.references;

    const inits = refs.filter((r) => r.init).length;
    const reads = refs.filter((r) => r.isReadOnly()).length;
    if (inits === 1 && reads + inits === refs.length) {
        // there is only one init and all other references only read
        return true
    }
    return false
}

/**
 * Checks if a variable has mutation in its property.
 * @param {Variable} variable The variable to check.
 * @param {Scope|null} initialScope The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.
 * @returns {boolean} True if the variable has mutation in its property.
 */
function hasMutationInProperty(variable, initialScope) {
    for (const ref of variable.references) {
        let node = /** @type {TSESTreeNode} */ (ref.identifier);
        while (node && node.parent && node.parent.type === "MemberExpression") {
            node = node.parent;
        }
        if (!node || !node.parent) {
            continue
        }
        if (
            (node.parent.type === "AssignmentExpression" &&
                node.parent.left === node) ||
            (node.parent.type === "UpdateExpression" &&
                node.parent.argument === node)
        ) {
            // This is a mutation.
            return true
        }
        if (
            node.parent.type === "CallExpression" &&
            node.parent.callee === node &&
            node.type === "MemberExpression"
        ) {
            const methodName = getStaticPropertyNameValue(node, initialScope);
            if (isNameOfMutationArrayMethod(methodName)) {
                // This is a mutation.
                return true
            }
        }
    }
    return false

    /**
     * Checks if a method name is one of the mutation array methods.
     * @param {StaticValue|null} methodName The method name to check.
     * @returns {boolean} True if the method name is a mutation array method.
     */
    function isNameOfMutationArrayMethod(methodName) {
        if (methodName == null || methodName.value == null) {
            return false
        }
        const name = methodName.value;
        return (
            name === "copyWithin" ||
            name === "fill" ||
            name === "pop" ||
            name === "push" ||
            name === "reverse" ||
            name === "shift" ||
            name === "sort" ||
            name === "splice" ||
            name === "unshift"
        )
    }
}

/**
 * @template {TSESTreeNodeTypes} T
 * @callback VisitorCallback
 * @param {TSESTreeNode & { type: T }} node
 * @param {Scope|undefined|null} initialScope
 * @returns {StaticValue | null}
 */
/**
 * @typedef { { [K in TSESTreeNodeTypes]?: VisitorCallback<K> } } Operations
 */
/**
 * @type {Operations}
 */
const operations = Object.freeze({
    ArrayExpression(node, initialScope) {
        const elements = getElementValues(node.elements, initialScope);
        return elements != null ? { value: elements } : null
    },

    AssignmentExpression(node, initialScope) {
        if (node.operator === "=") {
            return getStaticValueR(node.right, initialScope)
        }
        return null
    },

    //eslint-disable-next-line complexity
    BinaryExpression(node, initialScope) {
        if (node.operator === "in" || node.operator === "instanceof") {
            // Not supported.
            return null
        }

        const left = getStaticValueR(node.left, initialScope);
        const right = getStaticValueR(node.right, initialScope);
        if (left != null && right != null) {
            switch (node.operator) {
                case "==":
                    return { value: left.value == right.value } //eslint-disable-line eqeqeq
                case "!=":
                    return { value: left.value != right.value } //eslint-disable-line eqeqeq
                case "===":
                    return { value: left.value === right.value }
                case "!==":
                    return { value: left.value !== right.value }
                case "<":
                    return {
                        value:
                            /** @type {any} */ (left.value) <
                            /** @type {any} */ (right.value),
                    }
                case "<=":
                    return {
                        value:
                            /** @type {any} */ (left.value) <=
                            /** @type {any} */ (right.value),
                    }
                case ">":
                    return {
                        value:
                            /** @type {any} */ (left.value) >
                            /** @type {any} */ (right.value),
                    }
                case ">=":
                    return {
                        value:
                            /** @type {any} */ (left.value) >=
                            /** @type {any} */ (right.value),
                    }
                case "<<":
                    return {
                        value:
                            /** @type {any} */ (left.value) <<
                            /** @type {any} */ (right.value),
                    }
                case ">>":
                    return {
                        value:
                            /** @type {any} */ (left.value) >>
                            /** @type {any} */ (right.value),
                    }
                case ">>>":
                    return {
                        value:
                            /** @type {any} */ (left.value) >>>
                            /** @type {any} */ (right.value),
                    }
                case "+":
                    return {
                        value:
                            /** @type {any} */ (left.value) +
                            /** @type {any} */ (right.value),
                    }
                case "-":
                    return {
                        value:
                            /** @type {any} */ (left.value) -
                            /** @type {any} */ (right.value),
                    }
                case "*":
                    return {
                        value:
                            /** @type {any} */ (left.value) *
                            /** @type {any} */ (right.value),
                    }
                case "/":
                    return {
                        value:
                            /** @type {any} */ (left.value) /
                            /** @type {any} */ (right.value),
                    }
                case "%":
                    return {
                        value:
                            /** @type {any} */ (left.value) %
                            /** @type {any} */ (right.value),
                    }
                case "**":
                    return {
                        value:
                            /** @type {any} */ (left.value) **
                            /** @type {any} */ (right.value),
                    }
                case "|":
                    return {
                        value:
                            /** @type {any} */ (left.value) |
                            /** @type {any} */ (right.value),
                    }
                case "^":
                    return {
                        value:
                            /** @type {any} */ (left.value) ^
                            /** @type {any} */ (right.value),
                    }
                case "&":
                    return {
                        value:
                            /** @type {any} */ (left.value) &
                            /** @type {any} */ (right.value),
                    }

                // no default
            }
        }

        return null
    },

    CallExpression(node, initialScope) {
        const calleeNode = node.callee;
        const args = getElementValues(node.arguments, initialScope);

        if (args != null) {
            if (calleeNode.type === "MemberExpression") {
                if (calleeNode.property.type === "PrivateIdentifier") {
                    return null
                }
                const object = getStaticValueR(calleeNode.object, initialScope);
                if (object != null) {
                    if (
                        object.value == null &&
                        (object.optional || node.optional)
                    ) {
                        return { value: undefined, optional: true }
                    }
                    const property = getStaticPropertyNameValue(
                        calleeNode,
                        initialScope,
                    );

                    if (property != null) {
                        const receiver =
                            /** @type {Record<PropertyKey, (...args: any[]) => any>} */ (
                                object.value
                            );
                        const methodName = /** @type {PropertyKey} */ (
                            property.value
                        );
                        if (callAllowed.has(receiver[methodName])) {
                            return {
                                value: receiver[methodName](...args),
                            }
                        }
                        if (callPassThrough.has(receiver[methodName])) {
                            return { value: args[0] }
                        }
                    }
                }
            } else {
                const callee = getStaticValueR(calleeNode, initialScope);
                if (callee != null) {
                    if (callee.value == null && node.optional) {
                        return { value: undefined, optional: true }
                    }
                    const func = /** @type {(...args: any[]) => any} */ (
                        callee.value
                    );
                    if (callAllowed.has(func)) {
                        return { value: func(...args) }
                    }
                    if (callPassThrough.has(func)) {
                        return { value: args[0] }
                    }
                }
            }
        }

        return null
    },

    ConditionalExpression(node, initialScope) {
        const test = getStaticValueR(node.test, initialScope);
        if (test != null) {
            return test.value
                ? getStaticValueR(node.consequent, initialScope)
                : getStaticValueR(node.alternate, initialScope)
        }
        return null
    },

    ExpressionStatement(node, initialScope) {
        return getStaticValueR(node.expression, initialScope)
    },

    Identifier(node, initialScope) {
        if (initialScope != null) {
            const variable = findVariable(initialScope, node);

            if (variable != null) {
                // Built-in globals.
                if (isBuiltinGlobal(variable)) {
                    return { value: globalObject[variable.name] }
                }

                // Constants.
                if (canBeConsideredConst(variable)) {
                    const def = variable.defs[0];
                    if (
                        // TODO(mysticatea): don't support destructuring here.
                        def.node.id.type === "Identifier"
                    ) {
                        const init = getStaticValueR(
                            def.node.init,
                            initialScope,
                        );
                        if (
                            init &&
                            typeof init.value === "object" &&
                            init.value !== null
                        ) {
                            if (hasMutationInProperty(variable, initialScope)) {
                                // This variable has mutation in its property.
                                return null
                            }
                        }
                        return init
                    }
                }
            }
        }
        return null
    },

    Literal(node) {
        const literal =
            /** @type {Partial<Literal> & Partial<RegExpLiteral> & Partial<BigIntLiteral>} */ (
                node
            );
        //istanbul ignore if : this is implementation-specific behavior.
        if (
            (literal.regex != null || literal.bigint != null) &&
            literal.value == null
        ) {
            // It was a RegExp/BigInt literal, but Node.js didn't support it.
            return null
        }
        return { value: literal.value }
    },

    LogicalExpression(node, initialScope) {
        const left = getStaticValueR(node.left, initialScope);
        if (left != null) {
            if (
                (node.operator === "||" && Boolean(left.value) === true) ||
                (node.operator === "&&" && Boolean(left.value) === false) ||
                (node.operator === "??" && left.value != null)
            ) {
                return left
            }

            const right = getStaticValueR(node.right, initialScope);
            if (right != null) {
                return right
            }
        }

        return null
    },

    MemberExpression(node, initialScope) {
        if (node.property.type === "PrivateIdentifier") {
            return null
        }
        const object = getStaticValueR(node.object, initialScope);
        if (object != null) {
            if (object.value == null && (object.optional || node.optional)) {
                return { value: undefined, optional: true }
            }
            const property = getStaticPropertyNameValue(node, initialScope);

            if (property != null) {
                if (
                    !isGetter(
                        /** @type {object} */ (object.value),
                        /** @type {PropertyKey} */ (property.value),
                    )
                ) {
                    return {
                        value: /** @type {Record<PropertyKey, unknown>} */ (
                            object.value
                        )[/** @type {PropertyKey} */ (property.value)],
                    }
                }

                for (const [classFn, allowed] of getterAllowed) {
                    if (
                        object.value instanceof classFn &&
                        allowed.has(/** @type {string} */ (property.value))
                    ) {
                        return {
                            value: /** @type {Record<PropertyKey, unknown>} */ (
                                object.value
                            )[/** @type {PropertyKey} */ (property.value)],
                        }
                    }
                }
            }
        }
        return null
    },

    ChainExpression(node, initialScope) {
        const expression = getStaticValueR(node.expression, initialScope);
        if (expression != null) {
            return { value: expression.value }
        }
        return null
    },

    NewExpression(node, initialScope) {
        const callee = getStaticValueR(node.callee, initialScope);
        const args = getElementValues(node.arguments, initialScope);

        if (callee != null && args != null) {
            const Func = /** @type {new (...args: any[]) => any} */ (
                callee.value
            );
            if (callAllowed.has(Func)) {
                return { value: new Func(...args) }
            }
        }

        return null
    },

    ObjectExpression(node, initialScope) {
        /** @type {Record<PropertyKey, unknown>} */
        const object = {};

        for (const propertyNode of node.properties) {
            if (propertyNode.type === "Property") {
                if (propertyNode.kind !== "init") {
                    return null
                }
                const key = getStaticPropertyNameValue(
                    propertyNode,
                    initialScope,
                );
                const value = getStaticValueR(propertyNode.value, initialScope);
                if (key == null || value == null) {
                    return null
                }
                object[/** @type {PropertyKey} */ (key.value)] = value.value;
            } else if (
                propertyNode.type === "SpreadElement" ||
                // @ts-expect-error -- Backward compatibility
                propertyNode.type === "ExperimentalSpreadProperty"
            ) {
                const argument = getStaticValueR(
                    propertyNode.argument,
                    initialScope,
                );
                if (argument == null) {
                    return null
                }
                Object.assign(object, argument.value);
            } else {
                return null
            }
        }

        return { value: object }
    },

    SequenceExpression(node, initialScope) {
        const last = node.expressions[node.expressions.length - 1];
        return getStaticValueR(last, initialScope)
    },

    TaggedTemplateExpression(node, initialScope) {
        const tag = getStaticValueR(node.tag, initialScope);
        const expressions = getElementValues(
            node.quasi.expressions,
            initialScope,
        );

        if (tag != null && expressions != null) {
            const func = /** @type {(...args: any[]) => any} */ (tag.value);
            /** @type {any[] & { raw?: string[] }} */
            const strings = node.quasi.quasis.map((q) => q.value.cooked);
            strings.raw = node.quasi.quasis.map((q) => q.value.raw);

            if (func === String.raw) {
                return { value: func(strings, ...expressions) }
            }
        }

        return null
    },

    TemplateLiteral(node, initialScope) {
        const expressions = getElementValues(node.expressions, initialScope);
        if (expressions != null) {
            let value = node.quasis[0].value.cooked;
            for (let i = 0; i < expressions.length; ++i) {
                value += expressions[i];
                value += /** @type {string} */ (node.quasis[i + 1].value.cooked);
            }
            return { value }
        }
        return null
    },

    UnaryExpression(node, initialScope) {
        if (node.operator === "delete") {
            // Not supported.
            return null
        }
        if (node.operator === "void") {
            return { value: undefined }
        }

        const arg = getStaticValueR(node.argument, initialScope);
        if (arg != null) {
            switch (node.operator) {
                case "-":
                    return { value: -(/** @type {any} */ (arg.value)) }
                case "+":
                    return { value: +(/** @type {any} */ (arg.value)) } //eslint-disable-line no-implicit-coercion
                case "!":
                    return { value: !arg.value }
                case "~":
                    return { value: ~(/** @type {any} */ (arg.value)) }
                case "typeof":
                    return { value: typeof arg.value }

                // no default
            }
        }

        return null
    },
    TSAsExpression(node, initialScope) {
        return getStaticValueR(node.expression, initialScope)
    },
    TSSatisfiesExpression(node, initialScope) {
        return getStaticValueR(node.expression, initialScope)
    },
    TSTypeAssertion(node, initialScope) {
        return getStaticValueR(node.expression, initialScope)
    },
    TSNonNullExpression(node, initialScope) {
        return getStaticValueR(node.expression, initialScope)
    },
    TSInstantiationExpression(node, initialScope) {
        return getStaticValueR(node.expression, initialScope)
    },
});

/**
 * Get the value of a given node if it's a static value.
 * @param {Node|TSESTreeNode|null|undefined} node The node to get.
 * @param {Scope|undefined|null} initialScope The scope to start finding variable.
 * @returns {StaticValue|null} The static value of the node, or `null`.
 */
function getStaticValueR(node, initialScope) {
    if (node != null && Object.hasOwnProperty.call(operations, node.type)) {
        return /** @type {VisitorCallback<any>} */ (operations[node.type])(
            /** @type {TSESTreeNode} */ (node),
            initialScope,
        )
    }
    return null
}

/**
 * Get the static value of property name from a MemberExpression node or a Property node.
 * @param {MemberExpression|Property} node The node to get.
 * @param {Scope|null} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.
 * @returns {StaticValue|null} The static value of the property name of the node, or `null`.
 */
function getStaticPropertyNameValue(node, initialScope) {
    const nameNode = node.type === "Property" ? node.key : node.property;

    if (node.computed) {
        return getStaticValueR(nameNode, initialScope)
    }

    if (nameNode.type === "Identifier") {
        return { value: nameNode.name }
    }

    if (nameNode.type === "Literal") {
        if (/** @type {Partial<BigIntLiteral>} */ (nameNode).bigint) {
            return { value: /** @type {BigIntLiteral} */ (nameNode).bigint }
        }
        return { value: String(nameNode.value) }
    }

    return null
}

/**
 * Get the value of a given node if it's a static value.
 * @param {Node} node The node to get.
 * @param {Scope|null} [initialScope] The scope to start finding variable. Optional. If this scope was given, this tries to resolve identifier references which are in the given node as much as possible.
 * @returns {StaticValue | null} The static value of the node, or `null`.
 */
function getStaticValue(node, initialScope = null) {
    try {
        return getStaticValueR(node, initialScope)
    } catch (_error) {
        return null
    }
}

/** @typedef {import("eslint").Scope.Scope} Scope */
/** @typedef {import("estree").Node} Node */
/** @typedef {import("estree").RegExpLiteral} RegExpLiteral */
/** @typedef {import("estree").BigIntLiteral} BigIntLiteral */
/** @typedef {import("estree").SimpleLiteral} SimpleLiteral */

/**
 * Get the value of a given node if it's a literal or a template literal.
 * @param {Node} node The node to get.
 * @param {Scope|null} [initialScope] The scope to start finding variable. Optional. If the node is an Identifier node and this scope was given, this checks the variable of the identifier, and returns the value of it if the variable is a constant.
 * @returns {string|null} The value of the node, or `null`.
 */
function getStringIfConstant(node, initialScope = null) {
    // Handle the literals that the platform doesn't support natively.
    if (node && node.type === "Literal" && node.value === null) {
        const literal =
            /** @type {Partial<SimpleLiteral> & Partial<RegExpLiteral> & Partial<BigIntLiteral>} */ (
                node
            );
        if (literal.regex) {
            return `/${literal.regex.pattern}/${literal.regex.flags}`
        }
        if (literal.bigint) {
            return literal.bigint
        }
    }

    const evaluated = getStaticValue(node, initialScope);

    if (evaluated) {
        // `String(Symbol.prototype)` throws error
        try {
            return String(evaluated.value)
        } catch {
            // No op
        }
    }

    return null
}

/** @typedef {import("eslint").Scope.Scope} Scope */
/** @typedef {import("estree").MemberExpression} MemberExpression */
/** @typedef {import("estree").MethodDefinition} MethodDefinition */
/** @typedef {import("estree").Property} Property */
/** @typedef {import("estree").PropertyDefinition} PropertyDefinition */
/** @typedef {import("estree").Identifier} Identifier */

/**
 * Get the property name from a MemberExpression node or a Property node.
 * @param {MemberExpression | MethodDefinition | Property | PropertyDefinition} node The node to get.
 * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.
 * @returns {string|null|undefined} The property name of the node.
 */
function getPropertyName(node, initialScope) {
    switch (node.type) {
        case "MemberExpression":
            if (node.computed) {
                return getStringIfConstant(node.property, initialScope)
            }
            if (node.property.type === "PrivateIdentifier") {
                return null
            }
            return /** @type {Partial<Identifier>} */ (node.property).name

        case "Property":
        case "MethodDefinition":
        case "PropertyDefinition":
            if (node.computed) {
                return getStringIfConstant(node.key, initialScope)
            }
            if (node.key.type === "Literal") {
                return String(node.key.value)
            }
            if (node.key.type === "PrivateIdentifier") {
                return null
            }
            return /** @type {Partial<Identifier>} */ (node.key).name
    }

    return null
}

/** @typedef {import("eslint").Rule.Node} RuleNode */
/** @typedef {import("eslint").SourceCode} SourceCode */
/** @typedef {import("estree").Function} FunctionNode */
/** @typedef {import("estree").FunctionDeclaration} FunctionDeclaration */
/** @typedef {import("estree").FunctionExpression} FunctionExpression */
/** @typedef {import("estree").Identifier} Identifier */

/**
 * Get the name and kind of the given function node.
 * @param {FunctionNode} node - The function node to get.
 * @param {SourceCode} [sourceCode] The source code object to get the code of computed property keys.
 * @returns {string} The name and kind of the function node.
 */
// eslint-disable-next-line complexity
function getFunctionNameWithKind(node, sourceCode) {
    const parent = /** @type {RuleNode} */ (node).parent;

    if (!parent) {
        return ""
    }

    const tokens = [];
    const isObjectMethod = parent.type === "Property" && parent.value === node;
    const isClassMethod =
        parent.type === "MethodDefinition" && parent.value === node;
    const isClassFieldMethod =
        parent.type === "PropertyDefinition" && parent.value === node;

    // Modifiers.
    if (isClassMethod || isClassFieldMethod) {
        if (parent.static) {
            tokens.push("static");
        }
        if (parent.key.type === "PrivateIdentifier") {
            tokens.push("private");
        }
    }
    if (node.async) {
        tokens.push("async");
    }
    if (node.generator) {
        tokens.push("generator");
    }

    // Kinds.
    if (isObjectMethod || isClassMethod) {
        if (parent.kind === "constructor") {
            return "constructor"
        }
        if (parent.kind === "get") {
            tokens.push("getter");
        } else if (parent.kind === "set") {
            tokens.push("setter");
        } else {
            tokens.push("method");
        }
    } else if (isClassFieldMethod) {
        tokens.push("method");
    } else {
        if (node.type === "ArrowFunctionExpression") {
            tokens.push("arrow");
        }
        tokens.push("function");
    }

    // Names.
    if (isObjectMethod || isClassMethod || isClassFieldMethod) {
        if (parent.key.type === "PrivateIdentifier") {
            tokens.push(`#${parent.key.name}`);
        } else {
            const name = getPropertyName(parent);
            if (name) {
                tokens.push(`'${name}'`);
            } else if (sourceCode) {
                const keyText = sourceCode.getText(parent.key);
                if (!keyText.includes("\n")) {
                    tokens.push(`[${keyText}]`);
                }
            }
        }
    } else if (hasId(node)) {
        tokens.push(`'${node.id.name}'`);
    } else if (
        parent.type === "VariableDeclarator" &&
        parent.id &&
        parent.id.type === "Identifier"
    ) {
        tokens.push(`'${parent.id.name}'`);
    } else if (
        (parent.type === "AssignmentExpression" ||
            parent.type === "AssignmentPattern") &&
        parent.left &&
        parent.left.type === "Identifier"
    ) {
        tokens.push(`'${parent.left.name}'`);
    } else if (
        parent.type === "ExportDefaultDeclaration" &&
        parent.declaration === node
    ) {
        tokens.push("'default'");
    }

    return tokens.join(" ")
}

/**
 * @param {FunctionNode} node
 * @returns {node is FunctionDeclaration | FunctionExpression & { id: Identifier }}
 */
function hasId(node) {
    return Boolean(
        /** @type {Partial<FunctionDeclaration | FunctionExpression>} */ (node)
            .id,
    )
}

/** @typedef {import("estree").Node} Node */
/** @typedef {import("eslint").SourceCode} SourceCode */
/** @typedef {import("./types.mjs").HasSideEffectOptions} HasSideEffectOptions */
/** @typedef {import("estree").BinaryExpression} BinaryExpression */
/** @typedef {import("estree").MemberExpression} MemberExpression */
/** @typedef {import("estree").MethodDefinition} MethodDefinition */
/** @typedef {import("estree").Property} Property */
/** @typedef {import("estree").PropertyDefinition} PropertyDefinition */
/** @typedef {import("estree").UnaryExpression} UnaryExpression */

const typeConversionBinaryOps = Object.freeze(
    new Set([
        "==",
        "!=",
        "<",
        "<=",
        ">",
        ">=",
        "<<",
        ">>",
        ">>>",
        "+",
        "-",
        "*",
        "/",
        "%",
        "|",
        "^",
        "&",
        "in",
    ]),
);
const typeConversionUnaryOps = Object.freeze(new Set(["-", "+", "!", "~"]));

/**
 * Check whether the given value is an ASTNode or not.
 * @param {any} x The value to check.
 * @returns {x is Node} `true` if the value is an ASTNode.
 */
function isNode(x) {
    return x !== null && typeof x === "object" && typeof x.type === "string"
}

const visitor = Object.freeze(
    Object.assign(Object.create(null), {
        /**
         * @param {Node} node
         * @param {HasSideEffectOptions} options
         * @param {Record<string, string[]>} visitorKeys
         */
        $visit(node, options, visitorKeys) {
            const { type } = node;

            if (typeof (/** @type {any} */ (this)[type]) === "function") {
                return /** @type {any} */ (this)[type](
                    node,
                    options,
                    visitorKeys,
                )
            }

            return this.$visitChildren(node, options, visitorKeys)
        },

        /**
         * @param {Node} node
         * @param {HasSideEffectOptions} options
         * @param {Record<string, string[]>} visitorKeys
         */
        $visitChildren(node, options, visitorKeys) {
            const { type } = node;

            for (const key of /** @type {(keyof Node)[]} */ (
                visitorKeys[type] || eslintVisitorKeys.getKeys(node)
            )) {
                const value = node[key];

                if (Array.isArray(value)) {
                    for (const element of value) {
                        if (
                            isNode(element) &&
                            this.$visit(element, options, visitorKeys)
                        ) {
                            return true
                        }
                    }
                } else if (
                    isNode(value) &&
                    this.$visit(value, options, visitorKeys)
                ) {
                    return true
                }
            }

            return false
        },

        ArrowFunctionExpression() {
            return false
        },
        AssignmentExpression() {
            return true
        },
        AwaitExpression() {
            return true
        },
        /**
         * @param {BinaryExpression} node
         * @param {HasSideEffectOptions} options
         * @param {Record<string, string[]>} visitorKeys
         */
        BinaryExpression(node, options, visitorKeys) {
            if (
                options.considerImplicitTypeConversion &&
                typeConversionBinaryOps.has(node.operator) &&
                (node.left.type !== "Literal" || node.right.type !== "Literal")
            ) {
                return true
            }
            return this.$visitChildren(node, options, visitorKeys)
        },
        CallExpression() {
            return true
        },
        FunctionExpression() {
            return false
        },
        ImportExpression() {
            return true
        },
        /**
         * @param {MemberExpression} node
         * @param {HasSideEffectOptions} options
         * @param {Record<string, string[]>} visitorKeys
         */
        MemberExpression(node, options, visitorKeys) {
            if (options.considerGetters) {
                return true
            }
            if (
                options.considerImplicitTypeConversion &&
                node.computed &&
                node.property.type !== "Literal"
            ) {
                return true
            }
            return this.$visitChildren(node, options, visitorKeys)
        },
        /**
         * @param {MethodDefinition} node
         * @param {HasSideEffectOptions} options
         * @param {Record<string, string[]>} visitorKeys
         */
        MethodDefinition(node, options, visitorKeys) {
            if (
                options.considerImplicitTypeConversion &&
                node.computed &&
                node.key.type !== "Literal"
            ) {
                return true
            }
            return this.$visitChildren(node, options, visitorKeys)
        },
        NewExpression() {
            return true
        },
        /**
         * @param {Property} node
         * @param {HasSideEffectOptions} options
         * @param {Record<string, string[]>} visitorKeys
         */
        Property(node, options, visitorKeys) {
            if (
                options.considerImplicitTypeConversion &&
                node.computed &&
                node.key.type !== "Literal"
            ) {
                return true
            }
            return this.$visitChildren(node, options, visitorKeys)
        },
        /**
         * @param {PropertyDefinition} node
         * @param {HasSideEffectOptions} options
         * @param {Record<string, string[]>} visitorKeys
         */
        PropertyDefinition(node, options, visitorKeys) {
            if (
                options.considerImplicitTypeConversion &&
                node.computed &&
                node.key.type !== "Literal"
            ) {
                return true
            }
            return this.$visitChildren(node, options, visitorKeys)
        },
        /**
         * @param {UnaryExpression} node
         * @param {HasSideEffectOptions} options
         * @param {Record<string, string[]>} visitorKeys
         */
        UnaryExpression(node, options, visitorKeys) {
            if (node.operator === "delete") {
                return true
            }
            if (
                options.considerImplicitTypeConversion &&
                typeConversionUnaryOps.has(node.operator) &&
                node.argument.type !== "Literal"
            ) {
                return true
            }
            return this.$visitChildren(node, options, visitorKeys)
        },
        UpdateExpression() {
            return true
        },
        YieldExpression() {
            return true
        },
    }),
);

/**
 * Check whether a given node has any side effect or not.
 * @param {Node} node The node to get.
 * @param {SourceCode} sourceCode The source code object.
 * @param {HasSideEffectOptions} [options] The option object.
 * @returns {boolean} `true` if the node has a certain side effect.
 */
function hasSideEffect(node, sourceCode, options = {}) {
    const { considerGetters = false, considerImplicitTypeConversion = false } =
        options;
    return visitor.$visit(
        node,
        { considerGetters, considerImplicitTypeConversion },
        sourceCode.visitorKeys || eslintVisitorKeys.KEYS,
    )
}

/** @typedef {import("estree").Node} Node */
/** @typedef {import("@typescript-eslint/types").TSESTree.NewExpression} TSNewExpression */
/** @typedef {import("@typescript-eslint/types").TSESTree.CallExpression} TSCallExpression */
/** @typedef {import("eslint").SourceCode} SourceCode */
/** @typedef {import("eslint").AST.Token} Token */
/** @typedef {import("eslint").Rule.Node} RuleNode */

/**
 * Get the left parenthesis of the parent node syntax if it exists.
 * E.g., `if (a) {}` then the `(`.
 * @param {Node} node The AST node to check.
 * @param {SourceCode} sourceCode The source code object to get tokens.
 * @returns {Token|null} The left parenthesis of the parent node syntax
 */
// eslint-disable-next-line complexity
function getParentSyntaxParen(node, sourceCode) {
    const parent = /** @type {RuleNode} */ (node).parent;

    if (!parent) {
        return null
    }

    switch (parent.type) {
        case "CallExpression":
        case "NewExpression":
            if (parent.arguments.length === 1 && parent.arguments[0] === node) {
                return sourceCode.getTokenAfter(
                    // @ts-expect-error https://github.com/typescript-eslint/typescript-eslint/pull/5384
                    parent.typeArguments ||
                        /** @type {RuleNode} */ (
                            /** @type {unknown} */ (
                                /** @type {TSNewExpression | TSCallExpression} */ (
                                    parent
                                ).typeParameters
                            )
                        ) ||
                        parent.callee,
                    isOpeningParenToken,
                )
            }
            return null

        case "DoWhileStatement":
            if (parent.test === node) {
                return sourceCode.getTokenAfter(
                    parent.body,
                    isOpeningParenToken,
                )
            }
            return null

        case "IfStatement":
        case "WhileStatement":
            if (parent.test === node) {
                return sourceCode.getFirstToken(parent, 1)
            }
            return null

        case "ImportExpression":
            if (parent.source === node) {
                return sourceCode.getFirstToken(parent, 1)
            }
            return null

        case "SwitchStatement":
            if (parent.discriminant === node) {
                return sourceCode.getFirstToken(parent, 1)
            }
            return null

        case "WithStatement":
            if (parent.object === node) {
                return sourceCode.getFirstToken(parent, 1)
            }
            return null

        default:
            return null
    }
}

/**
 * Check whether a given node is parenthesized or not.
 * @param {number} times The number of parantheses.
 * @param {Node} node The AST node to check.
 * @param {SourceCode} sourceCode The source code object to get tokens.
 * @returns {boolean} `true` if the node is parenthesized the given times.
 */
/**
 * Check whether a given node is parenthesized or not.
 * @param {Node} node The AST node to check.
 * @param {SourceCode} sourceCode The source code object to get tokens.
 * @returns {boolean} `true` if the node is parenthesized.
 */
/**
 * Check whether a given node is parenthesized or not.
 * @param {Node|number} timesOrNode The first parameter.
 * @param {Node|SourceCode} nodeOrSourceCode The second parameter.
 * @param {SourceCode} [optionalSourceCode] The third parameter.
 * @returns {boolean} `true` if the node is parenthesized.
 */
function isParenthesized(
    timesOrNode,
    nodeOrSourceCode,
    optionalSourceCode,
) {
    /** @type {number} */
    let times,
        /** @type {RuleNode} */
        node,
        /** @type {SourceCode} */
        sourceCode,
        maybeLeftParen,
        maybeRightParen;
    if (typeof timesOrNode === "number") {
        times = timesOrNode | 0;
        node = /** @type {RuleNode} */ (nodeOrSourceCode);
        sourceCode = /** @type {SourceCode} */ (optionalSourceCode);
        if (!(times >= 1)) {
            throw new TypeError("'times' should be a positive integer.")
        }
    } else {
        times = 1;
        node = /** @type {RuleNode} */ (timesOrNode);
        sourceCode = /** @type {SourceCode} */ (nodeOrSourceCode);
    }

    if (
        node == null ||
        // `Program` can't be parenthesized
        node.parent == null ||
        // `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}`
        (node.parent.type === "CatchClause" && node.parent.param === node)
    ) {
        return false
    }

    maybeLeftParen = maybeRightParen = node;
    do {
        maybeLeftParen = sourceCode.getTokenBefore(maybeLeftParen);
        maybeRightParen = sourceCode.getTokenAfter(maybeRightParen);
    } while (
        maybeLeftParen != null &&
        maybeRightParen != null &&
        isOpeningParenToken(maybeLeftParen) &&
        isClosingParenToken(maybeRightParen) &&
        // Avoid false positive such as `if (a) {}`
        maybeLeftParen !== getParentSyntaxParen(node, sourceCode) &&
        --times > 0
    )

    return times === 0
}

/**
 * @author Toru Nagashima <https://github.com/mysticatea>
 * See LICENSE file in root directory for full license.
 */

const placeholder = /\$(?:[$&`']|[1-9][0-9]?)/gu;

/** @type {WeakMap<PatternMatcher, {pattern:RegExp,escaped:boolean}>} */
const internal = new WeakMap();

/**
 * Check whether a given character is escaped or not.
 * @param {string} str The string to check.
 * @param {number} index The location of the character to check.
 * @returns {boolean} `true` if the character is escaped.
 */
function isEscaped(str, index) {
    let escaped = false;
    for (let i = index - 1; i >= 0 && str.charCodeAt(i) === 0x5c; --i) {
        escaped = !escaped;
    }
    return escaped
}

/**
 * Replace a given string by a given matcher.
 * @param {PatternMatcher} matcher The pattern matcher.
 * @param {string} str The string to be replaced.
 * @param {string} replacement The new substring to replace each matched part.
 * @returns {string} The replaced string.
 */
function replaceS(matcher, str, replacement) {
    const chunks = [];
    let index = 0;

    /**
     * @param {string} key The placeholder.
     * @param {RegExpExecArray} match The matched information.
     * @returns {string} The replaced string.
     */
    function replacer(key, match) {
        switch (key) {
            case "$$":
                return "$"
            case "$&":
                return match[0]
            case "$`":
                return str.slice(0, match.index)
            case "$'":
                return str.slice(match.index + match[0].length)
            default: {
                const i = key.slice(1);
                if (i in match) {
                    return match[/** @type {any} */ (i)]
                }
                return key
            }
        }
    }

    for (const match of matcher.execAll(str)) {
        chunks.push(str.slice(index, match.index));
        chunks.push(
            replacement.replace(placeholder, (key) => replacer(key, match)),
        );
        index = match.index + match[0].length;
    }
    chunks.push(str.slice(index));

    return chunks.join("")
}

/**
 * Replace a given string by a given matcher.
 * @param {PatternMatcher} matcher The pattern matcher.
 * @param {string} str The string to be replaced.
 * @param {(substring: string, ...args: any[]) => string} replace The function to replace each matched part.
 * @returns {string} The replaced string.
 */
function replaceF(matcher, str, replace) {
    const chunks = [];
    let index = 0;

    for (const match of matcher.execAll(str)) {
        chunks.push(str.slice(index, match.index));
        chunks.push(
            String(
                replace(
                    .../** @type {[string, ...string[]]} */ (
                        /** @type {string[]} */ (match)
                    ),
                    match.index,
                    match.input,
                ),
            ),
        );
        index = match.index + match[0].length;
    }
    chunks.push(str.slice(index));

    return chunks.join("")
}

/**
 * The class to find patterns as considering escape sequences.
 */
class PatternMatcher {
    /**
     * Initialize this matcher.
     * @param {RegExp} pattern The pattern to match.
     * @param {{escaped?:boolean}} [options] The options.
     */
    constructor(pattern, options = {}) {
        const { escaped = false } = options;
        if (!(pattern instanceof RegExp)) {
            throw new TypeError("'pattern' should be a RegExp instance.")
        }
        if (!pattern.flags.includes("g")) {
            throw new Error("'pattern' should contains 'g' flag.")
        }

        internal.set(this, {
            pattern: new RegExp(pattern.source, pattern.flags),
            escaped: Boolean(escaped),
        });
    }

    /**
     * Find the pattern in a given string.
     * @param {string} str The string to find.
     * @returns {IterableIterator<RegExpExecArray>} The iterator which iterate the matched information.
     */
    *execAll(str) {
        const { pattern, escaped } =
            /** @type {{pattern:RegExp,escaped:boolean}} */ (internal.get(this));
        let match = null;
        let lastIndex = 0;

        pattern.lastIndex = 0;
        while ((match = pattern.exec(str)) != null) {
            if (escaped || !isEscaped(str, match.index)) {
                lastIndex = pattern.lastIndex;
                yield match;
                pattern.lastIndex = lastIndex;
            }
        }
    }

    /**
     * Check whether the pattern is found in a given string.
     * @param {string} str The string to check.
     * @returns {boolean} `true` if the pattern was found in the string.
     */
    test(str) {
        const it = this.execAll(str);
        const ret = it.next();
        return !ret.done
    }

    /**
     * Replace a given string.
     * @param {string} str The string to be replaced.
     * @param {(string|((...strs:string[])=>string))} replacer The string or function to replace. This is the same as the 2nd argument of `String.protYotype.replace`.
     * @returns {string} The replaced string.
     */
    [Symbol.replace](str, replacer) {
        return typeof replacer === "function"
            ? replaceF(this, String(str), replacer)
            : replaceS(this, String(str), String(replacer))
    }
}

/** @typedef {import("eslint").Scope.Scope} Scope */
/** @typedef {import("eslint").Scope.Variable} Variable */
/** @typedef {import("eslint").Rule.Node} RuleNode */
/** @typedef {import("estree").Node} Node */
/** @typedef {import("estree").Expression} Expression */
/** @typedef {import("estree").Pattern} Pattern */
/** @typedef {import("estree").Identifier} Identifier */
/** @typedef {import("estree").SimpleCallExpression} CallExpression */
/** @typedef {import("estree").Program} Program */
/** @typedef {import("estree").ImportDeclaration} ImportDeclaration */
/** @typedef {import("estree").ExportAllDeclaration} ExportAllDeclaration */
/** @typedef {import("estree").ExportDefaultDeclaration} ExportDefaultDeclaration */
/** @typedef {import("estree").ExportNamedDeclaration} ExportNamedDeclaration */
/** @typedef {import("estree").ImportSpecifier} ImportSpecifier */
/** @typedef {import("estree").ImportDefaultSpecifier} ImportDefaultSpecifier */
/** @typedef {import("estree").ImportNamespaceSpecifier} ImportNamespaceSpecifier */
/** @typedef {import("estree").ExportSpecifier} ExportSpecifier */
/** @typedef {import("estree").Property} Property */
/** @typedef {import("estree").AssignmentProperty} AssignmentProperty */
/** @typedef {import("estree").Literal} Literal */
/** @typedef {import("@typescript-eslint/types").TSESTree.Node} TSESTreeNode */
/** @typedef {import("./types.mjs").ReferenceTrackerOptions} ReferenceTrackerOptions */
/**
 * @template T
 * @typedef {import("./types.mjs").TraceMap<T>} TraceMap
 */
/**
 * @template T
 * @typedef {import("./types.mjs").TraceMapObject<T>} TraceMapObject
 */
/**
 * @template T
 * @typedef {import("./types.mjs").TrackedReferences<T>} TrackedReferences
 */

const IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u;

/**
 * Check whether a given node is an import node or not.
 * @param {Node} node
 * @returns {node is ImportDeclaration|ExportAllDeclaration|ExportNamedDeclaration&{source: Literal}} `true` if the node is an import node.
 */
function isHasSource(node) {
    return (
        IMPORT_TYPE.test(node.type) &&
        /** @type {ImportDeclaration|ExportAllDeclaration|ExportNamedDeclaration} */ (
            node
        ).source != null
    )
}
const has =
    /** @type {<T>(traceMap: TraceMap<unknown>, v: T) => v is (string extends T ? string : T)} */ (
        Function.call.bind(Object.hasOwnProperty)
    );

const READ = Symbol("read");
const CALL = Symbol("call");
const CONSTRUCT = Symbol("construct");
const ESM = Symbol("esm");

const requireCall = { require: { [CALL]: true } };

/**
 * Check whether a given variable is modified or not.
 * @param {Variable|undefined} variable The variable to check.
 * @returns {boolean} `true` if the variable is modified.
 */
function isModifiedGlobal(variable) {
    return (
        variable == null ||
        variable.defs.length !== 0 ||
        variable.references.some((r) => r.isWrite())
    )
}

/**
 * Check if the value of a given node is passed through to the parent syntax as-is.
 * For example, `a` and `b` in (`a || b` and `c ? a : b`) are passed through.
 * @param {Node} node A node to check.
 * @returns {node is RuleNode & {parent: Expression}} `true` if the node is passed through.
 */
function isPassThrough(node) {
    const parent = /** @type {TSESTreeNode} */ (node).parent;

    if (parent) {
        switch (parent.type) {
            case "ConditionalExpression":
                return parent.consequent === node || parent.alternate === node
            case "LogicalExpression":
                return true
            case "SequenceExpression":
                return (
                    parent.expressions[parent.expressions.length - 1] === node
                )
            case "ChainExpression":
                return true
            case "TSAsExpression":
            case "TSSatisfiesExpression":
            case "TSTypeAssertion":
            case "TSNonNullExpression":
            case "TSInstantiationExpression":
                return true

            default:
                return false
        }
    }
    return false
}

/**
 * The reference tracker.
 */
class ReferenceTracker {
    /**
     * Initialize this tracker.
     * @param {Scope} globalScope The global scope.
     * @param {object} [options] The options.
     * @param {"legacy"|"strict"} [options.mode="strict"] The mode to determine the ImportDeclaration's behavior for CJS modules.
     * @param {string[]} [options.globalObjectNames=["global","globalThis","self","window"]] The variable names for Global Object.
     */
    constructor(globalScope, options = {}) {
        const {
            mode = "strict",
            globalObjectNames = ["global", "globalThis", "self", "window"],
        } = options;
        /** @private @type {Variable[]} */
        this.variableStack = [];
        /** @private */
        this.globalScope = globalScope;
        /** @private */
        this.mode = mode;
        /** @private */
        this.globalObjectNames = globalObjectNames.slice(0);
    }

    /**
     * Iterate the references of global variables.
     * @template T
     * @param {TraceMap<T>} traceMap The trace map.
     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.
     */
    *iterateGlobalReferences(traceMap) {
        for (const key of Object.keys(traceMap)) {
            const nextTraceMap = traceMap[key];
            const path = [key];
            const variable = this.globalScope.set.get(key);

            if (isModifiedGlobal(variable)) {
                continue
            }

            yield* this._iterateVariableReferences(
                /** @type {Variable} */ (variable),
                path,
                nextTraceMap,
                true,
            );
        }

        for (const key of this.globalObjectNames) {
            /** @type {string[]} */
            const path = [];
            const variable = this.globalScope.set.get(key);

            if (isModifiedGlobal(variable)) {
                continue
            }

            yield* this._iterateVariableReferences(
                /** @type {Variable} */ (variable),
                path,
                traceMap,
                false,
            );
        }
    }

    /**
     * Iterate the references of CommonJS modules.
     * @template T
     * @param {TraceMap<T>} traceMap The trace map.
     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.
     */
    *iterateCjsReferences(traceMap) {
        for (const { node } of this.iterateGlobalReferences(requireCall)) {
            const key = getStringIfConstant(
                /** @type {CallExpression} */ (node).arguments[0],
            );
            if (key == null || !has(traceMap, key)) {
                continue
            }

            const nextTraceMap = traceMap[key];
            const path = [key];

            if (nextTraceMap[READ]) {
                yield {
                    node,
                    path,
                    type: READ,
                    info: nextTraceMap[READ],
                };
            }
            yield* this._iteratePropertyReferences(
                /** @type {CallExpression} */ (node),
                path,
                nextTraceMap,
            );
        }
    }

    /**
     * Iterate the references of ES modules.
     * @template T
     * @param {TraceMap<T>} traceMap The trace map.
     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.
     */
    *iterateEsmReferences(traceMap) {
        const programNode = /** @type {Program} */ (this.globalScope.block);

        for (const node of programNode.body) {
            if (!isHasSource(node)) {
                continue
            }
            const moduleId = /** @type {string} */ (node.source.value);

            if (!has(traceMap, moduleId)) {
                continue
            }
            const nextTraceMap = traceMap[moduleId];
            const path = [moduleId];

            if (nextTraceMap[READ]) {
                yield {
                    // eslint-disable-next-line object-shorthand -- apply type
                    node: /** @type {RuleNode} */ (node),
                    path,
                    type: READ,
                    info: nextTraceMap[READ],
                };
            }

            if (node.type === "ExportAllDeclaration") {
                for (const key of Object.keys(nextTraceMap)) {
                    const exportTraceMap = nextTraceMap[key];
                    if (exportTraceMap[READ]) {
                        yield {
                            // eslint-disable-next-line object-shorthand -- apply type
                            node: /** @type {RuleNode} */ (node),
                            path: path.concat(key),
                            type: READ,
                            info: exportTraceMap[READ],
                        };
                    }
                }
            } else {
                for (const specifier of node.specifiers) {
                    const esm = has(nextTraceMap, ESM);
                    const it = this._iterateImportReferences(
                        specifier,
                        path,
                        esm
                            ? nextTraceMap
                            : this.mode === "legacy"
                            ? { default: nextTraceMap, ...nextTraceMap }
                            : { default: nextTraceMap },
                    );

                    if (esm) {
                        yield* it;
                    } else {
                        for (const report of it) {
                            report.path = report.path.filter(exceptDefault);
                            if (
                                report.path.length >= 2 ||
                                report.type !== READ
                            ) {
                                yield report;
                            }
                        }
                    }
                }
            }
        }
    }

    /**
     * Iterate the property references for a given expression AST node.
     * @template T
     * @param {Expression} node The expression AST node to iterate property references.
     * @param {TraceMap<T>} traceMap The trace map.
     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate property references.
     */
    *iteratePropertyReferences(node, traceMap) {
        yield* this._iteratePropertyReferences(node, [], traceMap);
    }

    /**
     * Iterate the references for a given variable.
     * @private
     * @template T
     * @param {Variable} variable The variable to iterate that references.
     * @param {string[]} path The current path.
     * @param {TraceMapObject<T>} traceMap The trace map.
     * @param {boolean} shouldReport = The flag to report those references.
     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.
     */
    *_iterateVariableReferences(variable, path, traceMap, shouldReport) {
        if (this.variableStack.includes(variable)) {
            return
        }
        this.variableStack.push(variable);
        try {
            for (const reference of variable.references) {
                if (!reference.isRead()) {
                    continue
                }
                const node = /** @type {RuleNode & Identifier} */ (
                    reference.identifier
                );

                if (shouldReport && traceMap[READ]) {
                    yield { node, path, type: READ, info: traceMap[READ] };
                }
                yield* this._iteratePropertyReferences(node, path, traceMap);
            }
        } finally {
            this.variableStack.pop();
        }
    }

    /**
     * Iterate the references for a given AST node.
     * @private
     * @template T
     * @param {Expression} rootNode The AST node to iterate references.
     * @param {string[]} path The current path.
     * @param {TraceMapObject<T>} traceMap The trace map.
     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.
     */
    //eslint-disable-next-line complexity
    *_iteratePropertyReferences(rootNode, path, traceMap) {
        let node = rootNode;
        while (isPassThrough(node)) {
            node = node.parent;
        }

        const parent = /** @type {RuleNode} */ (node).parent;
        if (!parent) {
            return
        }
        if (parent.type === "MemberExpression") {
            if (parent.object === node) {
                const key = getPropertyName(parent);
                if (key == null || !has(traceMap, key)) {
                    return
                }

                path = path.concat(key); //eslint-disable-line no-param-reassign
                const nextTraceMap = traceMap[key];
                if (nextTraceMap[READ]) {
                    yield {
                        node: parent,
                        path,
                        type: READ,
                        info: nextTraceMap[READ],
                    };
                }
                yield* this._iteratePropertyReferences(
                    parent,
                    path,
                    nextTraceMap,
                );
            }
            return
        }
        if (parent.type === "CallExpression") {
            if (parent.callee === node && traceMap[CALL]) {
                yield { node: parent, path, type: CALL, info: traceMap[CALL] };
            }
            return
        }
        if (parent.type === "NewExpression") {
            if (parent.callee === node && traceMap[CONSTRUCT]) {
                yield {
                    node: parent,
                    path,
                    type: CONSTRUCT,
                    info: traceMap[CONSTRUCT],
                };
            }
            return
        }
        if (parent.type === "AssignmentExpression") {
            if (parent.right === node) {
                yield* this._iterateLhsReferences(parent.left, path, traceMap);
                yield* this._iteratePropertyReferences(parent, path, traceMap);
            }
            return
        }
        if (parent.type === "AssignmentPattern") {
            if (parent.right === node) {
                yield* this._iterateLhsReferences(parent.left, path, traceMap);
            }
            return
        }
        if (parent.type === "VariableDeclarator") {
            if (parent.init === node) {
                yield* this._iterateLhsReferences(parent.id, path, traceMap);
            }
        }
    }

    /**
     * Iterate the references for a given Pattern node.
     * @private
     * @template T
     * @param {Pattern} patternNode The Pattern node to iterate references.
     * @param {string[]} path The current path.
     * @param {TraceMapObject<T>} traceMap The trace map.
     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.
     */
    *_iterateLhsReferences(patternNode, path, traceMap) {
        if (patternNode.type === "Identifier") {
            const variable = findVariable(this.globalScope, patternNode);
            if (variable != null) {
                yield* this._iterateVariableReferences(
                    variable,
                    path,
                    traceMap,
                    false,
                );
            }
            return
        }
        if (patternNode.type === "ObjectPattern") {
            for (const property of patternNode.properties) {
                const key = getPropertyName(
                    /** @type {AssignmentProperty} */ (property),
                );

                if (key == null || !has(traceMap, key)) {
                    continue
                }

                const nextPath = path.concat(key);
                const nextTraceMap = traceMap[key];
                if (nextTraceMap[READ]) {
                    yield {
                        node: /** @type {RuleNode} */ (property),
                        path: nextPath,
                        type: READ,
                        info: nextTraceMap[READ],
                    };
                }
                yield* this._iterateLhsReferences(
                    /** @type {AssignmentProperty} */ (property).value,
                    nextPath,
                    nextTraceMap,
                );
            }
            return
        }
        if (patternNode.type === "AssignmentPattern") {
            yield* this._iterateLhsReferences(patternNode.left, path, traceMap);
        }
    }

    /**
     * Iterate the references for a given ModuleSpecifier node.
     * @private
     * @template T
     * @param {ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier} specifierNode The ModuleSpecifier node to iterate references.
     * @param {string[]} path The current path.
     * @param {TraceMapObject<T>} traceMap The trace map.
     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.
     */
    *_iterateImportReferences(specifierNode, path, traceMap) {
        const type = specifierNode.type;

        if (type === "ImportSpecifier" || type === "ImportDefaultSpecifier") {
            const key =
                type === "ImportDefaultSpecifier"
                    ? "default"
                    : specifierNode.imported.type === "Identifier"
                    ? specifierNode.imported.name
                    : specifierNode.imported.value;
            if (!has(traceMap, key)) {
                return
            }

            path = path.concat(key); //eslint-disable-line no-param-reassign
            const nextTraceMap = traceMap[key];
            if (nextTraceMap[READ]) {
                yield {
                    node: /** @type {RuleNode} */ (specifierNode),
                    path,
                    type: READ,
                    info: nextTraceMap[READ],
                };
            }
            yield* this._iterateVariableReferences(
                /** @type {Variable} */ (
                    findVariable(this.globalScope, specifierNode.local)
                ),
                path,
                nextTraceMap,
                false,
            );

            return
        }

        if (type === "ImportNamespaceSpecifier") {
            yield* this._iterateVariableReferences(
                /** @type {Variable} */ (
                    findVariable(this.globalScope, specifierNode.local)
                ),
                path,
                traceMap,
                false,
            );
            return
        }

        if (type === "ExportSpecifier") {
            const key =
                specifierNode.local.type === "Identifier"
                    ? specifierNode.local.name
                    : specifierNode.local.value;
            if (!has(traceMap, key)) {
                return
            }

            path = path.concat(key); //eslint-disable-line no-param-reassign
            const nextTraceMap = traceMap[key];
            if (nextTraceMap[READ]) {
                yield {
                    node: /** @type {RuleNode} */ (specifierNode),
                    path,
                    type: READ,
                    info: nextTraceMap[READ],
                };
            }
        }
    }
}

ReferenceTracker.READ = READ;
ReferenceTracker.CALL = CALL;
ReferenceTracker.CONSTRUCT = CONSTRUCT;
ReferenceTracker.ESM = ESM;

/**
 * This is a predicate function for Array#filter.
 * @param {string} name A name part.
 * @param {number} index The index of the name.
 * @returns {boolean} `false` if it's default.
 */
function exceptDefault(name, index) {
    return !(index === 1 && name === "default")
}

/** @typedef {import("./types.mjs").StaticValue} StaticValue */

var index = {
    CALL,
    CONSTRUCT,
    ESM,
    findVariable,
    getFunctionHeadLocation,
    getFunctionNameWithKind,
    getInnermostScope,
    getPropertyName,
    getStaticValue,
    getStringIfConstant,
    hasSideEffect,
    isArrowToken,
    isClosingBraceToken,
    isClosingBracketToken,
    isClosingParenToken,
    isColonToken,
    isCommaToken,
    isCommentToken,
    isNotArrowToken,
    isNotClosingBraceToken,
    isNotClosingBracketToken,
    isNotClosingParenToken,
    isNotColonToken,
    isNotCommaToken,
    isNotCommentToken,
    isNotOpeningBraceToken,
    isNotOpeningBracketToken,
    isNotOpeningParenToken,
    isNotSemicolonToken,
    isOpeningBraceToken,
    isOpeningBracketToken,
    isOpeningParenToken,
    isParenthesized,
    isSemicolonToken,
    PatternMatcher,
    READ,
    ReferenceTracker,
};

exports.CALL = CALL;
exports.CONSTRUCT = CONSTRUCT;
exports.ESM = ESM;
exports.PatternMatcher = PatternMatcher;
exports.READ = READ;
exports.ReferenceTracker = ReferenceTracker;
exports["default"] = index;
exports.findVariable = findVariable;
exports.getFunctionHeadLocation = getFunctionHeadLocation;
exports.getFunctionNameWithKind = getFunctionNameWithKind;
exports.getInnermostScope = getInnermostScope;
exports.getPropertyName = getPropertyName;
exports.getStaticValue = getStaticValue;
exports.getStringIfConstant = getStringIfConstant;
exports.hasSideEffect = hasSideEffect;
exports.isArrowToken = isArrowToken;
exports.isClosingBraceToken = isClosingBraceToken;
exports.isClosingBracketToken = isClosingBracketToken;
exports.isClosingParenToken = isClosingParenToken;
exports.isColonToken = isColonToken;
exports.isCommaToken = isCommaToken;
exports.isCommentToken = isCommentToken;
exports.isNotArrowToken = isNotArrowToken;
exports.isNotClosingBraceToken = isNotClosingBraceToken;
exports.isNotClosingBracketToken = isNotClosingBracketToken;
exports.isNotClosingParenToken = isNotClosingParenToken;
exports.isNotColonToken = isNotColonToken;
exports.isNotCommaToken = isNotCommaToken;
exports.isNotCommentToken = isNotCommentToken;
exports.isNotOpeningBraceToken = isNotOpeningBraceToken;
exports.isNotOpeningBracketToken = isNotOpeningBracketToken;
exports.isNotOpeningParenToken = isNotOpeningParenToken;
exports.isNotSemicolonToken = isNotSemicolonToken;
exports.isOpeningBraceToken = isOpeningBraceToken;
exports.isOpeningBracketToken = isOpeningBracketToken;
exports.isOpeningParenToken = isOpeningParenToken;
exports.isParenthesized = isParenthesized;
exports.isSemicolonToken = isSemicolonToken;
//# sourceMappingURL=index.js.map
l,oJx   {"version":3,"file":"index.js","sources":["src/get-innermost-scope.mjs","src/find-variable.mjs","src/token-predicate.mjs","src/get-function-head-location.mjs","src/get-static-value.mjs","src/get-string-if-constant.mjs","src/get-property-name.mjs","src/get-function-name-with-kind.mjs","src/has-side-effect.mjs","src/is-parenthesized.mjs","src/pattern-matcher.mjs","src/reference-tracker.mjs","src/index.mjs"],"sourcesContent":["/** @typedef {import(\"eslint\").Scope.Scope} Scope */\n/** @typedef {import(\"estree\").Node} Node */\n\n/**\n * Get the innermost scope which contains a given location.\n * @param {Scope} initialScope The initial scope to search.\n * @param {Node} node The location to search.\n * @returns {Scope} The innermost scope.\n */\nexport function getInnermostScope(initialScope, node) {\n    const location = /** @type {[number, number]} */ (node.range)[0]\n\n    let scope = initialScope\n    let found = false\n    do {\n        found = false\n        for (const childScope of scope.childScopes) {\n            const range = /** @type {[number, number]} */ (\n                childScope.block.range\n            )\n\n            if (range[0] <= location && location < range[1]) {\n                scope = childScope\n                found = true\n                break\n            }\n        }\n    } while (found)\n\n    return scope\n}\n","import { getInnermostScope } from \"./get-innermost-scope.mjs\"\n/** @typedef {import(\"eslint\").Scope.Scope} Scope */\n/** @typedef {import(\"eslint\").Scope.Variable} Variable */\n/** @typedef {import(\"estree\").Identifier} Identifier */\n\n/**\n * Find the variable of a given name.\n * @param {Scope} initialScope The scope to start finding.\n * @param {string|Identifier} nameOrNode The variable name to find. If this is a Node object then it should be an Identifier node.\n * @returns {Variable|null} The found variable or null.\n */\nexport function findVariable(initialScope, nameOrNode) {\n    let name = \"\"\n    /** @type {Scope|null} */\n    let scope = initialScope\n\n    if (typeof nameOrNode === \"string\") {\n        name = nameOrNode\n    } else {\n        name = nameOrNode.name\n        scope = getInnermostScope(scope, nameOrNode)\n    }\n\n    while (scope != null) {\n        const variable = scope.set.get(name)\n        if (variable != null) {\n            return variable\n        }\n        scope = scope.upper\n    }\n\n    return null\n}\n","/** @typedef {import(\"eslint\").AST.Token} Token */\n/** @typedef {import(\"estree\").Comment} Comment */\n/** @typedef {import(\"./types.mjs\").ArrowToken} ArrowToken */\n/** @typedef {import(\"./types.mjs\").CommaToken} CommaToken */\n/** @typedef {import(\"./types.mjs\").SemicolonToken} SemicolonToken */\n/** @typedef {import(\"./types.mjs\").ColonToken} ColonToken */\n/** @typedef {import(\"./types.mjs\").OpeningParenToken} OpeningParenToken */\n/** @typedef {import(\"./types.mjs\").ClosingParenToken} ClosingParenToken */\n/** @typedef {import(\"./types.mjs\").OpeningBracketToken} OpeningBracketToken */\n/** @typedef {import(\"./types.mjs\").ClosingBracketToken} ClosingBracketToken */\n/** @typedef {import(\"./types.mjs\").OpeningBraceToken} OpeningBraceToken */\n/** @typedef {import(\"./types.mjs\").ClosingBraceToken} ClosingBraceToken */\n/**\n * @template {string} Value\n * @typedef {import(\"./types.mjs\").PunctuatorToken<Value>} PunctuatorToken\n */\n\n/** @typedef {Comment | Token} CommentOrToken */\n\n/**\n * Creates the negate function of the given function.\n * @param {function(CommentOrToken):boolean} f - The function to negate.\n * @returns {function(CommentOrToken):boolean} Negated function.\n */\nfunction negate(f) {\n    return (token) => !f(token)\n}\n\n/**\n * Checks if the given token is a PunctuatorToken with the given value\n * @template {string} Value\n * @param {CommentOrToken} token - The token to check.\n * @param {Value} value - The value to check.\n * @returns {token is PunctuatorToken<Value>} `true` if the token is a PunctuatorToken with the given value.\n */\nfunction isPunctuatorTokenWithValue(token, value) {\n    return token.type === \"Punctuator\" && token.value === value\n}\n\n/**\n * Checks if the given token is an arrow token or not.\n * @param {CommentOrToken} token - The token to check.\n * @returns {token is ArrowToken} `true` if the token is an arrow token.\n */\nexport function isArrowToken(token) {\n    return isPunctuatorTokenWithValue(token, \"=>\")\n}\n\n/**\n * Checks if the given token is a comma token or not.\n * @param {CommentOrToken} token - The token to check.\n * @returns {token is CommaToken} `true` if the token is a comma token.\n */\nexport function isCommaToken(token) {\n    return isPunctuatorTokenWithValue(token, \",\")\n}\n\n/**\n * Checks if the given token is a semicolon token or not.\n * @param {CommentOrToken} token - The token to check.\n * @returns {token is SemicolonToken} `true` if the token is a semicolon token.\n */\nexport function isSemicolonToken(token) {\n    return isPunctuatorTokenWithValue(token, \";\")\n}\n\n/**\n * Checks if the given token is a colon token or not.\n * @param {CommentOrToken} token - The token to check.\n * @returns {token is ColonToken} `true` if the token is a colon token.\n */\nexport function isColonToken(token) {\n    return isPunctuatorTokenWithValue(token, \":\")\n}\n\n/**\n * Checks if the given token is an opening parenthesis token or not.\n * @param {CommentOrToken} token - The token to check.\n * @returns {token is OpeningParenToken} `true` if the token is an opening parenthesis token.\n */\nexport function isOpeningParenToken(token) {\n    return isPunctuatorTokenWithValue(token, \"(\")\n}\n\n/**\n * Checks if the given token is a closing parenthesis token or not.\n * @param {CommentOrToken} token - The token to check.\n * @returns {token is ClosingParenToken} `true` if the token is a closing parenthesis token.\n */\nexport function isClosingParenToken(token) {\n    return isPunctuatorTokenWithValue(token, \")\")\n}\n\n/**\n * Checks if the given token is an opening square bracket token or not.\n * @param {CommentOrToken} token - The token to check.\n * @returns {token is OpeningBracketToken} `true` if the token is an opening square bracket token.\n */\nexport function isOpeningBracketToken(token) {\n    return isPunctuatorTokenWithValue(token, \"[\")\n}\n\n/**\n * Checks if the given token is a closing square bracket token or not.\n * @param {CommentOrToken} token - The token to check.\n * @returns {token is ClosingBracketToken} `true` if the token is a closing square bracket token.\n */\nexport function isClosingBracketToken(token) {\n    return isPunctuatorTokenWithValue(token, \"]\")\n}\n\n/**\n * Checks if the given token is an opening brace token or not.\n * @param {CommentOrToken} token - The token to check.\n * @returns {token is OpeningBraceToken} `true` if the token is an opening brace token.\n */\nexport function isOpeningBraceToken(token) {\n    return isPunctuatorTokenWithValue(token, \"{\")\n}\n\n/**\n * Checks if the given token is a closing brace token or not.\n * @param {CommentOrToken} token - The token to check.\n * @returns {token is ClosingBraceToken} `true` if the token is a closing brace token.\n */\nexport function isClosingBraceToken(token) {\n    return isPunctuatorTokenWithValue(token, \"}\")\n}\n\n/**\n * Checks if the given token is a comment token or not.\n * @param {CommentOrToken} token - The token to check.\n * @returns {token is Comment} `true` if the token is a comment token.\n */\nexport function isCommentToken(token) {\n    return [\"Block\", \"Line\", \"Shebang\"].includes(token.type)\n}\n\nexport const isNotArrowToken = negate(isArrowToken)\nexport const isNotCommaToken = negate(isCommaToken)\nexport const isNotSemicolonToken = negate(isSemicolonToken)\nexport const isNotColonToken = negate(isColonToken)\nexport const isNotOpeningParenToken = negate(isOpeningParenToken)\nexport const isNotClosingParenToken = negate(isClosingParenToken)\nexport const isNotOpeningBracketToken = negate(isOpeningBracketToken)\nexport const isNotClosingBracketToken = negate(isClosingBracketToken)\nexport const isNotOpeningBraceToken = negate(isOpeningBraceToken)\nexport const isNotClosingBraceToken = negate(isClosingBraceToken)\nexport const isNotCommentToken = negate(isCommentToken)\n","import { isArrowToken, isOpeningParenToken } from \"./token-predicate.mjs\"\n/** @typedef {import(\"eslint\").Rule.Node} RuleNode */\n/** @typedef {import(\"eslint\").SourceCode} SourceCode */\n/** @typedef {import(\"eslint\").AST.Token} Token */\n/** @typedef {import(\"estree\").Function} FunctionNode */\n/** @typedef {import(\"estree\").FunctionDeclaration} FunctionDeclaration */\n/** @typedef {import(\"estree\").FunctionExpression} FunctionExpression */\n/** @typedef {import(\"estree\").SourceLocation} SourceLocation */\n/** @typedef {import(\"estree\").Position} Position */\n\n/**\n * Get the `(` token of the given function node.\n * @param {FunctionExpression | FunctionDeclaration} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {Token} `(` token.\n */\nfunction getOpeningParenOfParams(node, sourceCode) {\n    return node.id\n        ? /** @type {Token} */ (\n              sourceCode.getTokenAfter(node.id, isOpeningParenToken)\n          )\n        : /** @type {Token} */ (\n              sourceCode.getFirstToken(node, isOpeningParenToken)\n          )\n}\n\n/**\n * Get the location of the given function node for reporting.\n * @param {FunctionNode} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {SourceLocation|null} The location of the function node for reporting.\n */\nexport function getFunctionHeadLocation(node, sourceCode) {\n    const parent = /** @type {RuleNode} */ (node).parent\n\n    /** @type {Position|null} */\n    let start = null\n    /** @type {Position|null} */\n    let end = null\n\n    if (node.type === \"ArrowFunctionExpression\") {\n        const arrowToken = /** @type {Token} */ (\n            sourceCode.getTokenBefore(node.body, isArrowToken)\n        )\n\n        start = arrowToken.loc.start\n        end = arrowToken.loc.end\n    } else if (\n        parent &&\n        (parent.type === \"Property\" ||\n            parent.type === \"MethodDefinition\" ||\n            parent.type === \"PropertyDefinition\")\n    ) {\n        start = /** @type {SourceLocation} */ (parent.loc).start\n        end = getOpeningParenOfParams(node, sourceCode).loc.start\n    } else {\n        start = /** @type {SourceLocation} */ (node.loc).start\n        end = getOpeningParenOfParams(node, sourceCode).loc.start\n    }\n\n    return {\n        start: { ...start },\n        end: { ...end },\n    }\n}\n","/* globals self, window */\n\nimport { findVariable } from \"./find-variable.mjs\"\n/** @typedef {import(\"./types.mjs\").StaticValue} StaticValue */\n/** @typedef {import(\"eslint\").Scope.Scope} Scope */\n/** @typedef {import(\"eslint\").Scope.Variable} Variable */\n/** @typedef {import(\"estree\").Node} Node */\n/** @typedef {import(\"@typescript-eslint/types\").TSESTree.Node} TSESTreeNode */\n/** @typedef {import(\"@typescript-eslint/types\").TSESTree.AST_NODE_TYPES} TSESTreeNodeTypes */\n/** @typedef {import(\"@typescript-eslint/types\").TSESTree.MemberExpression} MemberExpression */\n/** @typedef {import(\"@typescript-eslint/types\").TSESTree.Property} Property */\n/** @typedef {import(\"@typescript-eslint/types\").TSESTree.RegExpLiteral} RegExpLiteral */\n/** @typedef {import(\"@typescript-eslint/types\").TSESTree.BigIntLiteral} BigIntLiteral */\n/** @typedef {import(\"@typescript-eslint/types\").TSESTree.Literal} Literal */\n\nconst globalObject =\n    typeof globalThis !== \"undefined\"\n        ? globalThis\n        : // @ts-ignore\n        typeof self !== \"undefined\"\n        ? // @ts-ignore\n          self\n        : // @ts-ignore\n        typeof window !== \"undefined\"\n        ? // @ts-ignore\n          window\n        : typeof global !== \"undefined\"\n        ? global\n        : {}\n\nconst builtinNames = Object.freeze(\n    new Set([\n        \"Array\",\n        \"ArrayBuffer\",\n        \"BigInt\",\n        \"BigInt64Array\",\n        \"BigUint64Array\",\n        \"Boolean\",\n        \"DataView\",\n        \"Date\",\n        \"decodeURI\",\n        \"decodeURIComponent\",\n        \"encodeURI\",\n        \"encodeURIComponent\",\n        \"escape\",\n        \"Float32Array\",\n        \"Float64Array\",\n        \"Function\",\n        \"Infinity\",\n        \"Int16Array\",\n        \"Int32Array\",\n        \"Int8Array\",\n        \"isFinite\",\n        \"isNaN\",\n        \"isPrototypeOf\",\n        \"JSON\",\n        \"Map\",\n        \"Math\",\n        \"NaN\",\n        \"Number\",\n        \"Object\",\n        \"parseFloat\",\n        \"parseInt\",\n        \"Promise\",\n        \"Proxy\",\n        \"Reflect\",\n        \"RegExp\",\n        \"Set\",\n        \"String\",\n        \"Symbol\",\n        \"Uint16Array\",\n        \"Uint32Array\",\n        \"Uint8Array\",\n        \"Uint8ClampedArray\",\n        \"undefined\",\n        \"unescape\",\n        \"WeakMap\",\n        \"WeakSet\",\n    ]),\n)\nconst callAllowed = new Set(\n    [\n        Array.isArray,\n        Array.of,\n        Array.prototype.at,\n        Array.prototype.concat,\n        Array.prototype.entries,\n        Array.prototype.every,\n        Array.prototype.filter,\n        Array.prototype.find,\n        Array.prototype.findIndex,\n        Array.prototype.flat,\n        Array.prototype.includes,\n        Array.prototype.indexOf,\n        Array.prototype.join,\n        Array.prototype.keys,\n        Array.prototype.lastIndexOf,\n        Array.prototype.slice,\n        Array.prototype.some,\n        Array.prototype.toString,\n        Array.prototype.values,\n        typeof BigInt === \"function\" ? BigInt : undefined,\n        Boolean,\n        Date,\n        Date.parse,\n        decodeURI,\n        decodeURIComponent,\n        encodeURI,\n        encodeURIComponent,\n        escape,\n        isFinite,\n        isNaN,\n        // @ts-ignore\n        isPrototypeOf,\n        Map,\n        Map.prototype.entries,\n        Map.prototype.get,\n        Map.prototype.has,\n        Map.prototype.keys,\n        Map.prototype.values,\n        .../** @type {(keyof typeof Math)[]} */ (\n            Object.getOwnPropertyNames(Math)\n        )\n            .filter((k) => k !== \"random\")\n            .map((k) => Math[k])\n            .filter((f) => typeof f === \"function\"),\n        Number,\n        Number.isFinite,\n        Number.isNaN,\n        Number.parseFloat,\n        Number.parseInt,\n        Number.prototype.toExponential,\n        Number.prototype.toFixed,\n        Number.prototype.toPrecision,\n        Number.prototype.toString,\n        Object,\n        Object.entries,\n        Object.is,\n        Object.isExtensible,\n        Object.isFrozen,\n        Object.isSealed,\n        Object.keys,\n        Object.values,\n        parseFloat,\n        parseInt,\n        RegExp,\n        Set,\n        Set.prototype.entries,\n        Set.prototype.has,\n        Set.prototype.keys,\n        Set.prototype.values,\n        String,\n        String.fromCharCode,\n        String.fromCodePoint,\n        String.raw,\n        String.prototype.at,\n        String.prototype.charAt,\n        String.prototype.charCodeAt,\n        String.prototype.codePointAt,\n        String.prototype.concat,\n        String.prototype.endsWith,\n        String.prototype.includes,\n        String.prototype.indexOf,\n        String.prototype.lastIndexOf,\n        String.prototype.normalize,\n        String.prototype.padEnd,\n        String.prototype.padStart,\n        String.prototype.slice,\n        String.prototype.startsWith,\n        String.prototype.substr,\n        String.prototype.substring,\n        String.prototype.toLowerCase,\n        String.prototype.toString,\n        String.prototype.toUpperCase,\n        String.prototype.trim,\n        String.prototype.trimEnd,\n        String.prototype.trimLeft,\n        String.prototype.trimRight,\n        String.prototype.trimStart,\n        Symbol.for,\n        Symbol.keyFor,\n        unescape,\n    ].filter((f) => typeof f === \"function\"),\n)\nconst callPassThrough = new Set([\n    Object.freeze,\n    Object.preventExtensions,\n    Object.seal,\n])\n\n/** @type {ReadonlyArray<readonly [Function, ReadonlySet<string>]>} */\nconst getterAllowed = [\n    [Map, new Set([\"size\"])],\n    [\n        RegExp,\n        new Set([\n            \"dotAll\",\n            \"flags\",\n            \"global\",\n            \"hasIndices\",\n            \"ignoreCase\",\n            \"multiline\",\n            \"source\",\n            \"sticky\",\n            \"unicode\",\n        ]),\n    ],\n    [Set, new Set([\"size\"])],\n]\n\n/**\n * Get the property descriptor.\n * @param {object} object The object to get.\n * @param {string|number|symbol} name The property name to get.\n */\nfunction getPropertyDescriptor(object, name) {\n    let x = object\n    while ((typeof x === \"object\" || typeof x === \"function\") && x !== null) {\n        const d = Object.getOwnPropertyDescriptor(x, name)\n        if (d) {\n            return d\n        }\n        x = Object.getPrototypeOf(x)\n    }\n    return null\n}\n\n/**\n * Check if a property is getter or not.\n * @param {object} object The object to check.\n * @param {string|number|symbol} name The property name to check.\n */\nfunction isGetter(object, name) {\n    const d = getPropertyDescriptor(object, name)\n    return d != null && d.get != null\n}\n\n/**\n * Get the element values of a given node list.\n * @param {(Node|TSESTreeNode|null)[]} nodeList The node list to get values.\n * @param {Scope|undefined|null} initialScope The initial scope to find variables.\n * @returns {any[]|null} The value list if all nodes are constant. Otherwise, null.\n */\nfunction getElementValues(nodeList, initialScope) {\n    const valueList = []\n\n    for (let i = 0; i < nodeList.length; ++i) {\n        const elementNode = nodeList[i]\n\n        if (elementNode == null) {\n            valueList.length = i + 1\n        } else if (elementNode.type === \"SpreadElement\") {\n            const argument = getStaticValueR(elementNode.argument, initialScope)\n            if (argument == null) {\n                return null\n            }\n            valueList.push(.../** @type {Iterable<any>} */ (argument.value))\n        } else {\n            const element = getStaticValueR(elementNode, initialScope)\n            if (element == null) {\n                return null\n            }\n            valueList.push(element.value)\n        }\n    }\n\n    return valueList\n}\n\n/**\n * Checks if a variable is a built-in global.\n * @param {Variable|null} variable The variable to check.\n * @returns {variable is Variable & {defs:[]}}\n */\nfunction isBuiltinGlobal(variable) {\n    return (\n        variable != null &&\n        variable.defs.length === 0 &&\n        builtinNames.has(variable.name) &&\n        variable.name in globalObject\n    )\n}\n\n/**\n * Checks if a variable can be considered as a constant.\n * @param {Variable} variable\n * @returns {variable is Variable & {defs: [import(\"eslint\").Scope.Definition & { type: \"Variable\" }]}} True if the variable can be considered as a constant.\n */\nfunction canBeConsideredConst(variable) {\n    if (variable.defs.length !== 1) {\n        return false\n    }\n    const def = variable.defs[0]\n    return Boolean(\n        def.parent &&\n            def.type === \"Variable\" &&\n            (def.parent.kind === \"const\" || isEffectivelyConst(variable)),\n    )\n}\n\n/**\n * Returns whether the given variable is never written to after initialization.\n * @param {Variable} variable\n * @returns {boolean}\n */\nfunction isEffectivelyConst(variable) {\n    const refs = variable.references\n\n    const inits = refs.filter((r) => r.init).length\n    const reads = refs.filter((r) => r.isReadOnly()).length\n    if (inits === 1 && reads + inits === refs.length) {\n        // there is only one init and all other references only read\n        return true\n    }\n    return false\n}\n\n/**\n * Checks if a variable has mutation in its property.\n * @param {Variable} variable The variable to check.\n * @param {Scope|null} initialScope The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.\n * @returns {boolean} True if the variable has mutation in its property.\n */\nfunction hasMutationInProperty(variable, initialScope) {\n    for (const ref of variable.references) {\n        let node = /** @type {TSESTreeNode} */ (ref.identifier)\n        while (node && node.parent && node.parent.type === \"MemberExpression\") {\n            node = node.parent\n        }\n        if (!node || !node.parent) {\n            continue\n        }\n        if (\n            (node.parent.type === \"AssignmentExpression\" &&\n                node.parent.left === node) ||\n            (node.parent.type === \"UpdateExpression\" &&\n                node.parent.argument === node)\n        ) {\n            // This is a mutation.\n            return true\n        }\n        if (\n            node.parent.type === \"CallExpression\" &&\n            node.parent.callee === node &&\n            node.type === \"MemberExpression\"\n        ) {\n            const methodName = getStaticPropertyNameValue(node, initialScope)\n            if (isNameOfMutationArrayMethod(methodName)) {\n                // This is a mutation.\n                return true\n            }\n        }\n    }\n    return false\n\n    /**\n     * Checks if a method name is one of the mutation array methods.\n     * @param {StaticValue|null} methodName The method name to check.\n     * @returns {boolean} True if the method name is a mutation array method.\n     */\n    function isNameOfMutationArrayMethod(methodName) {\n        if (methodName == null || methodName.value == null) {\n            return false\n        }\n        const name = methodName.value\n        return (\n            name === \"copyWithin\" ||\n            name === \"fill\" ||\n            name === \"pop\" ||\n            name === \"push\" ||\n            name === \"reverse\" ||\n            name === \"shift\" ||\n            name === \"sort\" ||\n            name === \"splice\" ||\n            name === \"unshift\"\n        )\n    }\n}\n\n/**\n * @template {TSESTreeNodeTypes} T\n * @callback VisitorCallback\n * @param {TSESTreeNode & { type: T }} node\n * @param {Scope|undefined|null} initialScope\n * @returns {StaticValue | null}\n */\n/**\n * @typedef { { [K in TSESTreeNodeTypes]?: VisitorCallback<K> } } Operations\n */\n/**\n * @type {Operations}\n */\nconst operations = Object.freeze({\n    ArrayExpression(node, initialScope) {\n        const elements = getElementValues(node.elements, initialScope)\n        return elements != null ? { value: elements } : null\n    },\n\n    AssignmentExpression(node, initialScope) {\n        if (node.operator === \"=\") {\n            return getStaticValueR(node.right, initialScope)\n        }\n        return null\n    },\n\n    //eslint-disable-next-line complexity\n    BinaryExpression(node, initialScope) {\n        if (node.operator === \"in\" || node.operator === \"instanceof\") {\n            // Not supported.\n            return null\n        }\n\n        const left = getStaticValueR(node.left, initialScope)\n        const right = getStaticValueR(node.right, initialScope)\n        if (left != null && right != null) {\n            switch (node.operator) {\n                case \"==\":\n                    return { value: left.value == right.value } //eslint-disable-line eqeqeq\n                case \"!=\":\n                    return { value: left.value != right.value } //eslint-disable-line eqeqeq\n                case \"===\":\n                    return { value: left.value === right.value }\n                case \"!==\":\n                    return { value: left.value !== right.value }\n                case \"<\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) <\n                            /** @type {any} */ (right.value),\n                    }\n                case \"<=\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) <=\n                            /** @type {any} */ (right.value),\n                    }\n                case \">\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) >\n                            /** @type {any} */ (right.value),\n                    }\n                case \">=\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) >=\n                            /** @type {any} */ (right.value),\n                    }\n                case \"<<\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) <<\n                            /** @type {any} */ (right.value),\n                    }\n                case \">>\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) >>\n                            /** @type {any} */ (right.value),\n                    }\n                case \">>>\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) >>>\n                            /** @type {any} */ (right.value),\n                    }\n                case \"+\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) +\n                            /** @type {any} */ (right.value),\n                    }\n                case \"-\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) -\n                            /** @type {any} */ (right.value),\n                    }\n                case \"*\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) *\n                            /** @type {any} */ (right.value),\n                    }\n                case \"/\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) /\n                            /** @type {any} */ (right.value),\n                    }\n                case \"%\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) %\n                            /** @type {any} */ (right.value),\n                    }\n                case \"**\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) **\n                            /** @type {any} */ (right.value),\n                    }\n                case \"|\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) |\n                            /** @type {any} */ (right.value),\n                    }\n                case \"^\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) ^\n                            /** @type {any} */ (right.value),\n                    }\n                case \"&\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) &\n                            /** @type {any} */ (right.value),\n                    }\n\n                // no default\n            }\n        }\n\n        return null\n    },\n\n    CallExpression(node, initialScope) {\n        const calleeNode = node.callee\n        const args = getElementValues(node.arguments, initialScope)\n\n        if (args != null) {\n            if (calleeNode.type === \"MemberExpression\") {\n                if (calleeNode.property.type === \"PrivateIdentifier\") {\n                    return null\n                }\n                const object = getStaticValueR(calleeNode.object, initialScope)\n                if (object != null) {\n                    if (\n                        object.value == null &&\n                        (object.optional || node.optional)\n                    ) {\n                        return { value: undefined, optional: true }\n                    }\n                    const property = getStaticPropertyNameValue(\n                        calleeNode,\n                        initialScope,\n                    )\n\n                    if (property != null) {\n                        const receiver =\n                            /** @type {Record<PropertyKey, (...args: any[]) => any>} */ (\n                                object.value\n                            )\n                        const methodName = /** @type {PropertyKey} */ (\n                            property.value\n                        )\n                        if (callAllowed.has(receiver[methodName])) {\n                            return {\n                                value: receiver[methodName](...args),\n                            }\n                        }\n                        if (callPassThrough.has(receiver[methodName])) {\n                            return { value: args[0] }\n                        }\n                    }\n                }\n            } else {\n                const callee = getStaticValueR(calleeNode, initialScope)\n                if (callee != null) {\n                    if (callee.value == null && node.optional) {\n                        return { value: undefined, optional: true }\n                    }\n                    const func = /** @type {(...args: any[]) => any} */ (\n                        callee.value\n                    )\n                    if (callAllowed.has(func)) {\n                        return { value: func(...args) }\n                    }\n                    if (callPassThrough.has(func)) {\n                        return { value: args[0] }\n                    }\n                }\n            }\n        }\n\n        return null\n    },\n\n    ConditionalExpression(node, initialScope) {\n        const test = getStaticValueR(node.test, initialScope)\n        if (test != null) {\n            return test.value\n                ? getStaticValueR(node.consequent, initialScope)\n                : getStaticValueR(node.alternate, initialScope)\n        }\n        return null\n    },\n\n    ExpressionStatement(node, initialScope) {\n        return getStaticValueR(node.expression, initialScope)\n    },\n\n    Identifier(node, initialScope) {\n        if (initialScope != null) {\n            const variable = findVariable(initialScope, node)\n\n            if (variable != null) {\n                // Built-in globals.\n                if (isBuiltinGlobal(variable)) {\n                    return { value: globalObject[variable.name] }\n                }\n\n                // Constants.\n                if (canBeConsideredConst(variable)) {\n                    const def = variable.defs[0]\n                    if (\n                        // TODO(mysticatea): don't support destructuring here.\n                        def.node.id.type === \"Identifier\"\n                    ) {\n                        const init = getStaticValueR(\n                            def.node.init,\n                            initialScope,\n                        )\n                        if (\n                            init &&\n                            typeof init.value === \"object\" &&\n                            init.value !== null\n                        ) {\n                            if (hasMutationInProperty(variable, initialScope)) {\n                                // This variable has mutation in its property.\n                                return null\n                            }\n                        }\n                        return init\n                    }\n                }\n            }\n        }\n        return null\n    },\n\n    Literal(node) {\n        const literal =\n            /** @type {Partial<Literal> & Partial<RegExpLiteral> & Partial<BigIntLiteral>} */ (\n                node\n            )\n        //istanbul ignore if : this is implementation-specific behavior.\n        if (\n            (literal.regex != null || literal.bigint != null) &&\n            literal.value == null\n        ) {\n            // It was a RegExp/BigInt literal, but Node.js didn't support it.\n            return null\n        }\n        return { value: literal.value }\n    },\n\n    LogicalExpression(node, initialScope) {\n        const left = getStaticValueR(node.left, initialScope)\n        if (left != null) {\n            if (\n                (node.operator === \"||\" && Boolean(left.value) === true) ||\n                (node.operator === \"&&\" && Boolean(left.value) === false) ||\n                (node.operator === \"??\" && left.value != null)\n            ) {\n                return left\n            }\n\n            const right = getStaticValueR(node.right, initialScope)\n            if (right != null) {\n                return right\n            }\n        }\n\n        return null\n    },\n\n    MemberExpression(node, initialScope) {\n        if (node.property.type === \"PrivateIdentifier\") {\n            return null\n        }\n        const object = getStaticValueR(node.object, initialScope)\n        if (object != null) {\n            if (object.value == null && (object.optional || node.optional)) {\n                return { value: undefined, optional: true }\n            }\n            const property = getStaticPropertyNameValue(node, initialScope)\n\n            if (property != null) {\n                if (\n                    !isGetter(\n                        /** @type {object} */ (object.value),\n                        /** @type {PropertyKey} */ (property.value),\n                    )\n                ) {\n                    return {\n                        value: /** @type {Record<PropertyKey, unknown>} */ (\n                            object.value\n                        )[/** @type {PropertyKey} */ (property.value)],\n                    }\n                }\n\n                for (const [classFn, allowed] of getterAllowed) {\n                    if (\n                        object.value instanceof classFn &&\n                        allowed.has(/** @type {string} */ (property.value))\n                    ) {\n                        return {\n                            value: /** @type {Record<PropertyKey, unknown>} */ (\n                                object.value\n                            )[/** @type {PropertyKey} */ (property.value)],\n                        }\n                    }\n                }\n            }\n        }\n        return null\n    },\n\n    ChainExpression(node, initialScope) {\n        const expression = getStaticValueR(node.expression, initialScope)\n        if (expression != null) {\n            return { value: expression.value }\n        }\n        return null\n    },\n\n    NewExpression(node, initialScope) {\n        const callee = getStaticValueR(node.callee, initialScope)\n        const args = getElementValues(node.arguments, initialScope)\n\n        if (callee != null && args != null) {\n            const Func = /** @type {new (...args: any[]) => any} */ (\n                callee.value\n            )\n            if (callAllowed.has(Func)) {\n                return { value: new Func(...args) }\n            }\n        }\n\n        return null\n    },\n\n    ObjectExpression(node, initialScope) {\n        /** @type {Record<PropertyKey, unknown>} */\n        const object = {}\n\n        for (const propertyNode of node.properties) {\n            if (propertyNode.type === \"Property\") {\n                if (propertyNode.kind !== \"init\") {\n                    return null\n                }\n                const key = getStaticPropertyNameValue(\n                    propertyNode,\n                    initialScope,\n                )\n                const value = getStaticValueR(propertyNode.value, initialScope)\n                if (key == null || value == null) {\n                    return null\n                }\n                object[/** @type {PropertyKey} */ (key.value)] = value.value\n            } else if (\n                propertyNode.type === \"SpreadElement\" ||\n                // @ts-expect-error -- Backward compatibility\n                propertyNode.type === \"ExperimentalSpreadProperty\"\n            ) {\n                const argument = getStaticValueR(\n                    propertyNode.argument,\n                    initialScope,\n                )\n                if (argument == null) {\n                    return null\n                }\n                Object.assign(object, argument.value)\n            } else {\n                return null\n            }\n        }\n\n        return { value: object }\n    },\n\n    SequenceExpression(node, initialScope) {\n        const last = node.expressions[node.expressions.length - 1]\n        return getStaticValueR(last, initialScope)\n    },\n\n    TaggedTemplateExpression(node, initialScope) {\n        const tag = getStaticValueR(node.tag, initialScope)\n        const expressions = getElementValues(\n            node.quasi.expressions,\n            initialScope,\n        )\n\n        if (tag != null && expressions != null) {\n            const func = /** @type {(...args: any[]) => any} */ (tag.value)\n            /** @type {any[] & { raw?: string[] }} */\n            const strings = node.quasi.quasis.map((q) => q.value.cooked)\n            strings.raw = node.quasi.quasis.map((q) => q.value.raw)\n\n            if (func === String.raw) {\n                return { value: func(strings, ...expressions) }\n            }\n        }\n\n        return null\n    },\n\n    TemplateLiteral(node, initialScope) {\n        const expressions = getElementValues(node.expressions, initialScope)\n        if (expressions != null) {\n            let value = node.quasis[0].value.cooked\n            for (let i = 0; i < expressions.length; ++i) {\n                value += expressions[i]\n                value += /** @type {string} */ (node.quasis[i + 1].value.cooked)\n            }\n            return { value }\n        }\n        return null\n    },\n\n    UnaryExpression(node, initialScope) {\n        if (node.operator === \"delete\") {\n            // Not supported.\n            return null\n        }\n        if (node.operator === \"void\") {\n            return { value: undefined }\n        }\n\n        const arg = getStaticValueR(node.argument, initialScope)\n        if (arg != null) {\n            switch (node.operator) {\n                case \"-\":\n                    return { value: -(/** @type {any} */ (arg.value)) }\n                case \"+\":\n                    return { value: +(/** @type {any} */ (arg.value)) } //eslint-disable-line no-implicit-coercion\n                case \"!\":\n                    return { value: !arg.value }\n                case \"~\":\n                    return { value: ~(/** @type {any} */ (arg.value)) }\n                case \"typeof\":\n                    return { value: typeof arg.value }\n\n                // no default\n            }\n        }\n\n        return null\n    },\n    TSAsExpression(node, initialScope) {\n        return getStaticValueR(node.expression, initialScope)\n    },\n    TSSatisfiesExpression(node, initialScope) {\n        return getStaticValueR(node.expression, initialScope)\n    },\n    TSTypeAssertion(node, initialScope) {\n        return getStaticValueR(node.expression, initialScope)\n    },\n    TSNonNullExpression(node, initialScope) {\n        return getStaticValueR(node.expression, initialScope)\n    },\n    TSInstantiationExpression(node, initialScope) {\n        return getStaticValueR(node.expression, initialScope)\n    },\n})\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node|TSESTreeNode|null|undefined} node The node to get.\n * @param {Scope|undefined|null} initialScope The scope to start finding variable.\n * @returns {StaticValue|null} The static value of the node, or `null`.\n */\nfunction getStaticValueR(node, initialScope) {\n    if (node != null && Object.hasOwnProperty.call(operations, node.type)) {\n        return /** @type {VisitorCallback<any>} */ (operations[node.type])(\n            /** @type {TSESTreeNode} */ (node),\n            initialScope,\n        )\n    }\n    return null\n}\n\n/**\n * Get the static value of property name from a MemberExpression node or a Property node.\n * @param {MemberExpression|Property} node The node to get.\n * @param {Scope|null} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.\n * @returns {StaticValue|null} The static value of the property name of the node, or `null`.\n */\nfunction getStaticPropertyNameValue(node, initialScope) {\n    const nameNode = node.type === \"Property\" ? node.key : node.property\n\n    if (node.computed) {\n        return getStaticValueR(nameNode, initialScope)\n    }\n\n    if (nameNode.type === \"Identifier\") {\n        return { value: nameNode.name }\n    }\n\n    if (nameNode.type === \"Literal\") {\n        if (/** @type {Partial<BigIntLiteral>} */ (nameNode).bigint) {\n            return { value: /** @type {BigIntLiteral} */ (nameNode).bigint }\n        }\n        return { value: String(nameNode.value) }\n    }\n\n    return null\n}\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node} node The node to get.\n * @param {Scope|null} [initialScope] The scope to start finding variable. Optional. If this scope was given, this tries to resolve identifier references which are in the given node as much as possible.\n * @returns {StaticValue | null} The static value of the node, or `null`.\n */\nexport function getStaticValue(node, initialScope = null) {\n    try {\n        return getStaticValueR(node, initialScope)\n    } catch (_error) {\n        return null\n    }\n}\n","import { getStaticValue } from \"./get-static-value.mjs\"\n/** @typedef {import(\"eslint\").Scope.Scope} Scope */\n/** @typedef {import(\"estree\").Node} Node */\n/** @typedef {import(\"estree\").RegExpLiteral} RegExpLiteral */\n/** @typedef {import(\"estree\").BigIntLiteral} BigIntLiteral */\n/** @typedef {import(\"estree\").SimpleLiteral} SimpleLiteral */\n\n/**\n * Get the value of a given node if it's a literal or a template literal.\n * @param {Node} node The node to get.\n * @param {Scope|null} [initialScope] The scope to start finding variable. Optional. If the node is an Identifier node and this scope was given, this checks the variable of the identifier, and returns the value of it if the variable is a constant.\n * @returns {string|null} The value of the node, or `null`.\n */\nexport function getStringIfConstant(node, initialScope = null) {\n    // Handle the literals that the platform doesn't support natively.\n    if (node && node.type === \"Literal\" && node.value === null) {\n        const literal =\n            /** @type {Partial<SimpleLiteral> & Partial<RegExpLiteral> & Partial<BigIntLiteral>} */ (\n                node\n            )\n        if (literal.regex) {\n            return `/${literal.regex.pattern}/${literal.regex.flags}`\n        }\n        if (literal.bigint) {\n            return literal.bigint\n        }\n    }\n\n    const evaluated = getStaticValue(node, initialScope)\n\n    if (evaluated) {\n        // `String(Symbol.prototype)` throws error\n        try {\n            return String(evaluated.value)\n        } catch {\n            // No op\n        }\n    }\n\n    return null\n}\n","import { getStringIfConstant } from \"./get-string-if-constant.mjs\"\n/** @typedef {import(\"eslint\").Scope.Scope} Scope */\n/** @typedef {import(\"estree\").MemberExpression} MemberExpression */\n/** @typedef {import(\"estree\").MethodDefinition} MethodDefinition */\n/** @typedef {import(\"estree\").Property} Property */\n/** @typedef {import(\"estree\").PropertyDefinition} PropertyDefinition */\n/** @typedef {import(\"estree\").Identifier} Identifier */\n\n/**\n * Get the property name from a MemberExpression node or a Property node.\n * @param {MemberExpression | MethodDefinition | Property | PropertyDefinition} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.\n * @returns {string|null|undefined} The property name of the node.\n */\nexport function getPropertyName(node, initialScope) {\n    switch (node.type) {\n        case \"MemberExpression\":\n            if (node.computed) {\n                return getStringIfConstant(node.property, initialScope)\n            }\n            if (node.property.type === \"PrivateIdentifier\") {\n                return null\n            }\n            return /** @type {Partial<Identifier>} */ (node.property).name\n\n        case \"Property\":\n        case \"MethodDefinition\":\n        case \"PropertyDefinition\":\n            if (node.computed) {\n                return getStringIfConstant(node.key, initialScope)\n            }\n            if (node.key.type === \"Literal\") {\n                return String(node.key.value)\n            }\n            if (node.key.type === \"PrivateIdentifier\") {\n                return null\n            }\n            return /** @type {Partial<Identifier>} */ (node.key).name\n\n        default:\n            break\n    }\n\n    return null\n}\n","import { getPropertyName } from \"./get-property-name.mjs\"\n/** @typedef {import(\"eslint\").Rule.Node} RuleNode */\n/** @typedef {import(\"eslint\").SourceCode} SourceCode */\n/** @typedef {import(\"estree\").Function} FunctionNode */\n/** @typedef {import(\"estree\").FunctionDeclaration} FunctionDeclaration */\n/** @typedef {import(\"estree\").FunctionExpression} FunctionExpression */\n/** @typedef {import(\"estree\").Identifier} Identifier */\n\n/**\n * Get the name and kind of the given function node.\n * @param {FunctionNode} node - The function node to get.\n * @param {SourceCode} [sourceCode] The source code object to get the code of computed property keys.\n * @returns {string} The name and kind of the function node.\n */\n// eslint-disable-next-line complexity\nexport function getFunctionNameWithKind(node, sourceCode) {\n    const parent = /** @type {RuleNode} */ (node).parent\n\n    if (!parent) {\n        return \"\"\n    }\n\n    const tokens = []\n    const isObjectMethod = parent.type === \"Property\" && parent.value === node\n    const isClassMethod =\n        parent.type === \"MethodDefinition\" && parent.value === node\n    const isClassFieldMethod =\n        parent.type === \"PropertyDefinition\" && parent.value === node\n\n    // Modifiers.\n    if (isClassMethod || isClassFieldMethod) {\n        if (parent.static) {\n            tokens.push(\"static\")\n        }\n        if (parent.key.type === \"PrivateIdentifier\") {\n            tokens.push(\"private\")\n        }\n    }\n    if (node.async) {\n        tokens.push(\"async\")\n    }\n    if (node.generator) {\n        tokens.push(\"generator\")\n    }\n\n    // Kinds.\n    if (isObjectMethod || isClassMethod) {\n        if (parent.kind === \"constructor\") {\n            return \"constructor\"\n        }\n        if (parent.kind === \"get\") {\n            tokens.push(\"getter\")\n        } else if (parent.kind === \"set\") {\n            tokens.push(\"setter\")\n        } else {\n            tokens.push(\"method\")\n        }\n    } else if (isClassFieldMethod) {\n        tokens.push(\"method\")\n    } else {\n        if (node.type === \"ArrowFunctionExpression\") {\n            tokens.push(\"arrow\")\n        }\n        tokens.push(\"function\")\n    }\n\n    // Names.\n    if (isObjectMethod || isClassMethod || isClassFieldMethod) {\n        if (parent.key.type === \"PrivateIdentifier\") {\n            tokens.push(`#${parent.key.name}`)\n        } else {\n            const name = getPropertyName(parent)\n            if (name) {\n                tokens.push(`'${name}'`)\n            } else if (sourceCode) {\n                const keyText = sourceCode.getText(parent.key)\n                if (!keyText.includes(\"\\n\")) {\n                    tokens.push(`[${keyText}]`)\n                }\n            }\n        }\n    } else if (hasId(node)) {\n        tokens.push(`'${node.id.name}'`)\n    } else if (\n        parent.type === \"VariableDeclarator\" &&\n        parent.id &&\n        parent.id.type === \"Identifier\"\n    ) {\n        tokens.push(`'${parent.id.name}'`)\n    } else if (\n        (parent.type === \"AssignmentExpression\" ||\n            parent.type === \"AssignmentPattern\") &&\n        parent.left &&\n        parent.left.type === \"Identifier\"\n    ) {\n        tokens.push(`'${parent.left.name}'`)\n    } else if (\n        parent.type === \"ExportDefaultDeclaration\" &&\n        parent.declaration === node\n    ) {\n        tokens.push(\"'default'\")\n    }\n\n    return tokens.join(\" \")\n}\n\n/**\n * @param {FunctionNode} node\n * @returns {node is FunctionDeclaration | FunctionExpression & { id: Identifier }}\n */\nfunction hasId(node) {\n    return Boolean(\n        /** @type {Partial<FunctionDeclaration | FunctionExpression>} */ (node)\n            .id,\n    )\n}\n","import { getKeys, KEYS } from \"eslint-visitor-keys\"\n/** @typedef {import(\"estree\").Node} Node */\n/** @typedef {import(\"eslint\").SourceCode} SourceCode */\n/** @typedef {import(\"./types.mjs\").HasSideEffectOptions} HasSideEffectOptions */\n/** @typedef {import(\"estree\").BinaryExpression} BinaryExpression */\n/** @typedef {import(\"estree\").MemberExpression} MemberExpression */\n/** @typedef {import(\"estree\").MethodDefinition} MethodDefinition */\n/** @typedef {import(\"estree\").Property} Property */\n/** @typedef {import(\"estree\").PropertyDefinition} PropertyDefinition */\n/** @typedef {import(\"estree\").UnaryExpression} UnaryExpression */\n\nconst typeConversionBinaryOps = Object.freeze(\n    new Set([\n        \"==\",\n        \"!=\",\n        \"<\",\n        \"<=\",\n        \">\",\n        \">=\",\n        \"<<\",\n        \">>\",\n        \">>>\",\n        \"+\",\n        \"-\",\n        \"*\",\n        \"/\",\n        \"%\",\n        \"|\",\n        \"^\",\n        \"&\",\n        \"in\",\n    ]),\n)\nconst typeConversionUnaryOps = Object.freeze(new Set([\"-\", \"+\", \"!\", \"~\"]))\n\n/**\n * Check whether the given value is an ASTNode or not.\n * @param {any} x The value to check.\n * @returns {x is Node} `true` if the value is an ASTNode.\n */\nfunction isNode(x) {\n    return x !== null && typeof x === \"object\" && typeof x.type === \"string\"\n}\n\nconst visitor = Object.freeze(\n    Object.assign(Object.create(null), {\n        /**\n         * @param {Node} node\n         * @param {HasSideEffectOptions} options\n         * @param {Record<string, string[]>} visitorKeys\n         */\n        $visit(node, options, visitorKeys) {\n            const { type } = node\n\n            if (typeof (/** @type {any} */ (this)[type]) === \"function\") {\n                return /** @type {any} */ (this)[type](\n                    node,\n                    options,\n                    visitorKeys,\n                )\n            }\n\n            return this.$visitChildren(node, options, visitorKeys)\n        },\n\n        /**\n         * @param {Node} node\n         * @param {HasSideEffectOptions} options\n         * @param {Record<string, string[]>} visitorKeys\n         */\n        $visitChildren(node, options, visitorKeys) {\n            const { type } = node\n\n            for (const key of /** @type {(keyof Node)[]} */ (\n                visitorKeys[type] || getKeys(node)\n            )) {\n                const value = node[key]\n\n                if (Array.isArray(value)) {\n                    for (const element of value) {\n                        if (\n                            isNode(element) &&\n                            this.$visit(element, options, visitorKeys)\n                        ) {\n                            return true\n                        }\n                    }\n                } else if (\n                    isNode(value) &&\n                    this.$visit(value, options, visitorKeys)\n                ) {\n                    return true\n                }\n            }\n\n            return false\n        },\n\n        ArrowFunctionExpression() {\n            return false\n        },\n        AssignmentExpression() {\n            return true\n        },\n        AwaitExpression() {\n            return true\n        },\n        /**\n         * @param {BinaryExpression} node\n         * @param {HasSideEffectOptions} options\n         * @param {Record<string, string[]>} visitorKeys\n         */\n        BinaryExpression(node, options, visitorKeys) {\n            if (\n                options.considerImplicitTypeConversion &&\n                typeConversionBinaryOps.has(node.operator) &&\n                (node.left.type !== \"Literal\" || node.right.type !== \"Literal\")\n            ) {\n                return true\n            }\n            return this.$visitChildren(node, options, visitorKeys)\n        },\n        CallExpression() {\n            return true\n        },\n        FunctionExpression() {\n            return false\n        },\n        ImportExpression() {\n            return true\n        },\n        /**\n         * @param {MemberExpression} node\n         * @param {HasSideEffectOptions} options\n         * @param {Record<string, string[]>} visitorKeys\n         */\n        MemberExpression(node, options, visitorKeys) {\n            if (options.considerGetters) {\n                return true\n            }\n            if (\n                options.considerImplicitTypeConversion &&\n                node.computed &&\n                node.property.type !== \"Literal\"\n            ) {\n                return true\n            }\n            return this.$visitChildren(node, options, visitorKeys)\n        },\n        /**\n         * @param {MethodDefinition} node\n         * @param {HasSideEffectOptions} options\n         * @param {Record<string, string[]>} visitorKeys\n         */\n        MethodDefinition(node, options, visitorKeys) {\n            if (\n                options.considerImplicitTypeConversion &&\n                node.computed &&\n                node.key.type !== \"Literal\"\n            ) {\n                return true\n            }\n            return this.$visitChildren(node, options, visitorKeys)\n        },\n        NewExpression() {\n            return true\n        },\n        /**\n         * @param {Property} node\n         * @param {HasSideEffectOptions} options\n         * @param {Record<string, string[]>} visitorKeys\n         */\n        Property(node, options, visitorKeys) {\n            if (\n                options.considerImplicitTypeConversion &&\n                node.computed &&\n                node.key.type !== \"Literal\"\n            ) {\n                return true\n            }\n            return this.$visitChildren(node, options, visitorKeys)\n        },\n        /**\n         * @param {PropertyDefinition} node\n         * @param {HasSideEffectOptions} options\n         * @param {Record<string, string[]>} visitorKeys\n         */\n        PropertyDefinition(node, options, visitorKeys) {\n            if (\n                options.considerImplicitTypeConversion &&\n                node.computed &&\n                node.key.type !== \"Literal\"\n            ) {\n                return true\n            }\n            return this.$visitChildren(node, options, visitorKeys)\n        },\n        /**\n         * @param {UnaryExpression} node\n         * @param {HasSideEffectOptions} options\n         * @param {Record<string, string[]>} visitorKeys\n         */\n        UnaryExpression(node, options, visitorKeys) {\n            if (node.operator === \"delete\") {\n                return true\n            }\n            if (\n                options.considerImplicitTypeConversion &&\n                typeConversionUnaryOps.has(node.operator) &&\n                node.argument.type !== \"Literal\"\n            ) {\n                return true\n            }\n            return this.$visitChildren(node, options, visitorKeys)\n        },\n        UpdateExpression() {\n            return true\n        },\n        YieldExpression() {\n            return true\n        },\n    }),\n)\n\n/**\n * Check whether a given node has any side effect or not.\n * @param {Node} node The node to get.\n * @param {SourceCode} sourceCode The source code object.\n * @param {HasSideEffectOptions} [options] The option object.\n * @returns {boolean} `true` if the node has a certain side effect.\n */\nexport function hasSideEffect(node, sourceCode, options = {}) {\n    const { considerGetters = false, considerImplicitTypeConversion = false } =\n        options\n    return visitor.$visit(\n        node,\n        { considerGetters, considerImplicitTypeConversion },\n        sourceCode.visitorKeys || KEYS,\n    )\n}\n","import { isClosingParenToken, isOpeningParenToken } from \"./token-predicate.mjs\"\n/** @typedef {import(\"estree\").Node} Node */\n/** @typedef {import(\"@typescript-eslint/types\").TSESTree.NewExpression} TSNewExpression */\n/** @typedef {import(\"@typescript-eslint/types\").TSESTree.CallExpression} TSCallExpression */\n/** @typedef {import(\"eslint\").SourceCode} SourceCode */\n/** @typedef {import(\"eslint\").AST.Token} Token */\n/** @typedef {import(\"eslint\").Rule.Node} RuleNode */\n\n/**\n * Get the left parenthesis of the parent node syntax if it exists.\n * E.g., `if (a) {}` then the `(`.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {Token|null} The left parenthesis of the parent node syntax\n */\n// eslint-disable-next-line complexity\nfunction getParentSyntaxParen(node, sourceCode) {\n    const parent = /** @type {RuleNode} */ (node).parent\n\n    if (!parent) {\n        return null\n    }\n\n    switch (parent.type) {\n        case \"CallExpression\":\n        case \"NewExpression\":\n            if (parent.arguments.length === 1 && parent.arguments[0] === node) {\n                return sourceCode.getTokenAfter(\n                    // @ts-expect-error https://github.com/typescript-eslint/typescript-eslint/pull/5384\n                    parent.typeArguments ||\n                        /** @type {RuleNode} */ (\n                            /** @type {unknown} */ (\n                                /** @type {TSNewExpression | TSCallExpression} */ (\n                                    parent\n                                ).typeParameters\n                            )\n                        ) ||\n                        parent.callee,\n                    isOpeningParenToken,\n                )\n            }\n            return null\n\n        case \"DoWhileStatement\":\n            if (parent.test === node) {\n                return sourceCode.getTokenAfter(\n                    parent.body,\n                    isOpeningParenToken,\n                )\n            }\n            return null\n\n        case \"IfStatement\":\n        case \"WhileStatement\":\n            if (parent.test === node) {\n                return sourceCode.getFirstToken(parent, 1)\n            }\n            return null\n\n        case \"ImportExpression\":\n            if (parent.source === node) {\n                return sourceCode.getFirstToken(parent, 1)\n            }\n            return null\n\n        case \"SwitchStatement\":\n            if (parent.discriminant === node) {\n                return sourceCode.getFirstToken(parent, 1)\n            }\n            return null\n\n        case \"WithStatement\":\n            if (parent.object === node) {\n                return sourceCode.getFirstToken(parent, 1)\n            }\n            return null\n\n        default:\n            return null\n    }\n}\n\n/**\n * Check whether a given node is parenthesized or not.\n * @param {number} times The number of parantheses.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized the given times.\n */\n/**\n * Check whether a given node is parenthesized or not.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized.\n */\n/**\n * Check whether a given node is parenthesized or not.\n * @param {Node|number} timesOrNode The first parameter.\n * @param {Node|SourceCode} nodeOrSourceCode The second parameter.\n * @param {SourceCode} [optionalSourceCode] The third parameter.\n * @returns {boolean} `true` if the node is parenthesized.\n */\nexport function isParenthesized(\n    timesOrNode,\n    nodeOrSourceCode,\n    optionalSourceCode,\n) {\n    /** @type {number} */\n    let times,\n        /** @type {RuleNode} */\n        node,\n        /** @type {SourceCode} */\n        sourceCode,\n        maybeLeftParen,\n        maybeRightParen\n    if (typeof timesOrNode === \"number\") {\n        times = timesOrNode | 0\n        node = /** @type {RuleNode} */ (nodeOrSourceCode)\n        sourceCode = /** @type {SourceCode} */ (optionalSourceCode)\n        if (!(times >= 1)) {\n            throw new TypeError(\"'times' should be a positive integer.\")\n        }\n    } else {\n        times = 1\n        node = /** @type {RuleNode} */ (timesOrNode)\n        sourceCode = /** @type {SourceCode} */ (nodeOrSourceCode)\n    }\n\n    if (\n        node == null ||\n        // `Program` can't be parenthesized\n        node.parent == null ||\n        // `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}`\n        (node.parent.type === \"CatchClause\" && node.parent.param === node)\n    ) {\n        return false\n    }\n\n    maybeLeftParen = maybeRightParen = node\n    do {\n        maybeLeftParen = sourceCode.getTokenBefore(maybeLeftParen)\n        maybeRightParen = sourceCode.getTokenAfter(maybeRightParen)\n    } while (\n        maybeLeftParen != null &&\n        maybeRightParen != null &&\n        isOpeningParenToken(maybeLeftParen) &&\n        isClosingParenToken(maybeRightParen) &&\n        // Avoid false positive such as `if (a) {}`\n        maybeLeftParen !== getParentSyntaxParen(node, sourceCode) &&\n        --times > 0\n    )\n\n    return times === 0\n}\n","/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * See LICENSE file in root directory for full license.\n */\n\nconst placeholder = /\\$(?:[$&`']|[1-9][0-9]?)/gu\n\n/** @type {WeakMap<PatternMatcher, {pattern:RegExp,escaped:boolean}>} */\nconst internal = new WeakMap()\n\n/**\n * Check whether a given character is escaped or not.\n * @param {string} str The string to check.\n * @param {number} index The location of the character to check.\n * @returns {boolean} `true` if the character is escaped.\n */\nfunction isEscaped(str, index) {\n    let escaped = false\n    for (let i = index - 1; i >= 0 && str.charCodeAt(i) === 0x5c; --i) {\n        escaped = !escaped\n    }\n    return escaped\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {string} replacement The new substring to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceS(matcher, str, replacement) {\n    const chunks = []\n    let index = 0\n\n    /**\n     * @param {string} key The placeholder.\n     * @param {RegExpExecArray} match The matched information.\n     * @returns {string} The replaced string.\n     */\n    function replacer(key, match) {\n        switch (key) {\n            case \"$$\":\n                return \"$\"\n            case \"$&\":\n                return match[0]\n            case \"$`\":\n                return str.slice(0, match.index)\n            case \"$'\":\n                return str.slice(match.index + match[0].length)\n            default: {\n                const i = key.slice(1)\n                if (i in match) {\n                    return match   [/** @type {any} */ (i)]\n                }\n                return key\n            }\n        }\n    }\n\n    for (const match of matcher.execAll(str)) {\n        chunks.push(str.slice(index, match.index))\n        chunks.push(\n            replacement.replace(placeholder, (key) => replacer(key, match)),\n        )\n        index = match.index + match[0].length\n    }\n    chunks.push(str.slice(index))\n\n    return chunks.join(\"\")\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {(substring: string, ...args: any[]) => string} replace The function to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceF(matcher, str, replace) {\n    const chunks = []\n    let index = 0\n\n    for (const match of matcher.execAll(str)) {\n        chunks.push(str.slice(index, match.index))\n        chunks.push(\n            String(\n                replace(\n                    .../** @type {[string, ...string[]]} */ (\n                        /** @type {string[]} */ (match)\n                    ),\n                    match.index,\n                    match.input,\n                ),\n            ),\n        )\n        index = match.index + match[0].length\n    }\n    chunks.push(str.slice(index))\n\n    return chunks.join(\"\")\n}\n\n/**\n * The class to find patterns as considering escape sequences.\n */\nexport class PatternMatcher {\n    /**\n     * Initialize this matcher.\n     * @param {RegExp} pattern The pattern to match.\n     * @param {{escaped?:boolean}} [options] The options.\n     */\n    constructor(pattern, options = {}) {\n        const { escaped = false } = options\n        if (!(pattern instanceof RegExp)) {\n            throw new TypeError(\"'pattern' should be a RegExp instance.\")\n        }\n        if (!pattern.flags.includes(\"g\")) {\n            throw new Error(\"'pattern' should contains 'g' flag.\")\n        }\n\n        internal.set(this, {\n            pattern: new RegExp(pattern.source, pattern.flags),\n            escaped: Boolean(escaped),\n        })\n    }\n\n    /**\n     * Find the pattern in a given string.\n     * @param {string} str The string to find.\n     * @returns {IterableIterator<RegExpExecArray>} The iterator which iterate the matched information.\n     */\n    *execAll(str) {\n        const { pattern, escaped } =\n            /** @type {{pattern:RegExp,escaped:boolean}} */ (internal.get(this))\n        let match = null\n        let lastIndex = 0\n\n        pattern.lastIndex = 0\n        while ((match = pattern.exec(str)) != null) {\n            if (escaped || !isEscaped(str, match.index)) {\n                lastIndex = pattern.lastIndex\n                yield match\n                pattern.lastIndex = lastIndex\n            }\n        }\n    }\n\n    /**\n     * Check whether the pattern is found in a given string.\n     * @param {string} str The string to check.\n     * @returns {boolean} `true` if the pattern was found in the string.\n     */\n    test(str) {\n        const it = this.execAll(str)\n        const ret = it.next()\n        return !ret.done\n    }\n\n    /**\n     * Replace a given string.\n     * @param {string} str The string to be replaced.\n     * @param {(string|((...strs:string[])=>string))} replacer The string or function to replace. This is the same as the 2nd argument of `String.prototype.replace`.\n     * @returns {string} The replaced string.\n     */\n    [Symbol.replace](str, replacer) {\n        return typeof replacer === \"function\"\n            ? replaceF(this, String(str), replacer)\n            : replaceS(this, String(str), String(replacer))\n    }\n}\n","import { findVariable } from \"./find-variable.mjs\"\nimport { getPropertyName } from \"./get-property-name.mjs\"\nimport { getStringIfConstant } from \"./get-string-if-constant.mjs\"\n/** @typedef {import(\"eslint\").Scope.Scope} Scope */\n/** @typedef {import(\"eslint\").Scope.Variable} Variable */\n/** @typedef {import(\"eslint\").Rule.Node} RuleNode */\n/** @typedef {import(\"estree\").Node} Node */\n/** @typedef {import(\"estree\").Expression} Expression */\n/** @typedef {import(\"estree\").Pattern} Pattern */\n/** @typedef {import(\"estree\").Identifier} Identifier */\n/** @typedef {import(\"estree\").SimpleCallExpression} CallExpression */\n/** @typedef {import(\"estree\").Program} Program */\n/** @typedef {import(\"estree\").ImportDeclaration} ImportDeclaration */\n/** @typedef {import(\"estree\").ExportAllDeclaration} ExportAllDeclaration */\n/** @typedef {import(\"estree\").ExportDefaultDeclaration} ExportDefaultDeclaration */\n/** @typedef {import(\"estree\").ExportNamedDeclaration} ExportNamedDeclaration */\n/** @typedef {import(\"estree\").ImportSpecifier} ImportSpecifier */\n/** @typedef {import(\"estree\").ImportDefaultSpecifier} ImportDefaultSpecifier */\n/** @typedef {import(\"estree\").ImportNamespaceSpecifier} ImportNamespaceSpecifier */\n/** @typedef {import(\"estree\").ExportSpecifier} ExportSpecifier */\n/** @typedef {import(\"estree\").Property} Property */\n/** @typedef {import(\"estree\").AssignmentProperty} AssignmentProperty */\n/** @typedef {import(\"estree\").Literal} Literal */\n/** @typedef {import(\"@typescript-eslint/types\").TSESTree.Node} TSESTreeNode */\n/** @typedef {import(\"./types.mjs\").ReferenceTrackerOptions} ReferenceTrackerOptions */\n/**\n * @template T\n * @typedef {import(\"./types.mjs\").TraceMap<T>} TraceMap\n */\n/**\n * @template T\n * @typedef {import(\"./types.mjs\").TraceMapObject<T>} TraceMapObject\n */\n/**\n * @template T\n * @typedef {import(\"./types.mjs\").TrackedReferences<T>} TrackedReferences\n */\n\nconst IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u\n\n/**\n * Check whether a given node is an import node or not.\n * @param {Node} node\n * @returns {node is ImportDeclaration|ExportAllDeclaration|ExportNamedDeclaration&{source: Literal}} `true` if the node is an import node.\n */\nfunction isHasSource(node) {\n    return (\n        IMPORT_TYPE.test(node.type) &&\n        /** @type {ImportDeclaration|ExportAllDeclaration|ExportNamedDeclaration} */ (\n            node\n        ).source != null\n    )\n}\nconst has =\n    /** @type {<T>(traceMap: TraceMap<unknown>, v: T) => v is (string extends T ? string : T)} */ (\n        Function.call.bind(Object.hasOwnProperty)\n    )\n\nexport const READ = Symbol(\"read\")\nexport const CALL = Symbol(\"call\")\nexport const CONSTRUCT = Symbol(\"construct\")\nexport const ESM = Symbol(\"esm\")\n\nconst requireCall = { require: { [CALL]: true } }\n\n/**\n * Check whether a given variable is modified or not.\n * @param {Variable|undefined} variable The variable to check.\n * @returns {boolean} `true` if the variable is modified.\n */\nfunction isModifiedGlobal(variable) {\n    return (\n        variable == null ||\n        variable.defs.length !== 0 ||\n        variable.references.some((r) => r.isWrite())\n    )\n}\n\n/**\n * Check if the value of a given node is passed through to the parent syntax as-is.\n * For example, `a` and `b` in (`a || b` and `c ? a : b`) are passed through.\n * @param {Node} node A node to check.\n * @returns {node is RuleNode & {parent: Expression}} `true` if the node is passed through.\n */\nfunction isPassThrough(node) {\n    const parent = /** @type {TSESTreeNode} */ (node).parent\n\n    if (parent) {\n        switch (parent.type) {\n            case \"ConditionalExpression\":\n                return parent.consequent === node || parent.alternate === node\n            case \"LogicalExpression\":\n                return true\n            case \"SequenceExpression\":\n                return (\n                    parent.expressions[parent.expressions.length - 1] === node\n                )\n            case \"ChainExpression\":\n                return true\n            case \"TSAsExpression\":\n            case \"TSSatisfiesExpression\":\n            case \"TSTypeAssertion\":\n            case \"TSNonNullExpression\":\n            case \"TSInstantiationExpression\":\n                return true\n\n            default:\n                return false\n        }\n    }\n    return false\n}\n\n/**\n * The reference tracker.\n */\nexport class ReferenceTracker {\n    /**\n     * Initialize this tracker.\n     * @param {Scope} globalScope The global scope.\n     * @param {object} [options] The options.\n     * @param {\"legacy\"|\"strict\"} [options.mode=\"strict\"] The mode to determine the ImportDeclaration's behavior for CJS modules.\n     * @param {string[]} [options.globalObjectNames=[\"global\",\"globalThis\",\"self\",\"window\"]] The variable names for Global Object.\n     */\n    constructor(globalScope, options = {}) {\n        const {\n            mode = \"strict\",\n            globalObjectNames = [\"global\", \"globalThis\", \"self\", \"window\"],\n        } = options\n        /** @private @type {Variable[]} */\n        this.variableStack = []\n        /** @private */\n        this.globalScope = globalScope\n        /** @private */\n        this.mode = mode\n        /** @private */\n        this.globalObjectNames = globalObjectNames.slice(0)\n    }\n\n    /**\n     * Iterate the references of global variables.\n     * @template T\n     * @param {TraceMap<T>} traceMap The trace map.\n     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.\n     */\n    *iterateGlobalReferences(traceMap) {\n        for (const key of Object.keys(traceMap)) {\n            const nextTraceMap = traceMap[key]\n            const path = [key]\n            const variable = this.globalScope.set.get(key)\n\n            if (isModifiedGlobal(variable)) {\n                continue\n            }\n\n            yield* this._iterateVariableReferences(\n                /** @type {Variable} */ (variable),\n                path,\n                nextTraceMap,\n                true,\n            )\n        }\n\n        for (const key of this.globalObjectNames) {\n            /** @type {string[]} */\n            const path = []\n            const variable = this.globalScope.set.get(key)\n\n            if (isModifiedGlobal(variable)) {\n                continue\n            }\n\n            yield* this._iterateVariableReferences(\n                /** @type {Variable} */ (variable),\n                path,\n                traceMap,\n                false,\n            )\n        }\n    }\n\n    /**\n     * Iterate the references of CommonJS modules.\n     * @template T\n     * @param {TraceMap<T>} traceMap The trace map.\n     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.\n     */\n    *iterateCjsReferences(traceMap) {\n        for (const { node } of this.iterateGlobalReferences(requireCall)) {\n            const key = getStringIfConstant(\n                /** @type {CallExpression} */ (node).arguments[0],\n            )\n            if (key == null || !has(traceMap, key)) {\n                continue\n            }\n\n            const nextTraceMap = traceMap[key]\n            const path = [key]\n\n            if (nextTraceMap[READ]) {\n                yield {\n                    node,\n                    path,\n                    type: READ,\n                    info: nextTraceMap[READ],\n                }\n            }\n            yield* this._iteratePropertyReferences(\n                /** @type {CallExpression} */ (node),\n                path,\n                nextTraceMap,\n            )\n        }\n    }\n\n    /**\n     * Iterate the references of ES modules.\n     * @template T\n     * @param {TraceMap<T>} traceMap The trace map.\n     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.\n     */\n    *iterateEsmReferences(traceMap) {\n        const programNode = /** @type {Program} */ (this.globalScope.block)\n\n        for (const node of programNode.body) {\n            if (!isHasSource(node)) {\n                continue\n            }\n            const moduleId = /** @type {string} */ (node.source.value)\n\n            if (!has(traceMap, moduleId)) {\n                continue\n            }\n            const nextTraceMap = traceMap[moduleId]\n            const path = [moduleId]\n\n            if (nextTraceMap[READ]) {\n                yield {\n                    // eslint-disable-next-line object-shorthand -- apply type\n                    node: /** @type {RuleNode} */ (node),\n                    path,\n                    type: READ,\n                    info: nextTraceMap[READ],\n                }\n            }\n\n            if (node.type === \"ExportAllDeclaration\") {\n                for (const key of Object.keys(nextTraceMap)) {\n                    const exportTraceMap = nextTraceMap[key]\n                    if (exportTraceMap[READ]) {\n                        yield {\n                            // eslint-disable-next-line object-shorthand -- apply type\n                            node: /** @type {RuleNode} */ (node),\n                            path: path.concat(key),\n                            type: READ,\n                            info: exportTraceMap[READ],\n                        }\n                    }\n                }\n            } else {\n                for (const specifier of node.specifiers) {\n                    const esm = has(nextTraceMap, ESM)\n                    const it = this._iterateImportReferences(\n                        specifier,\n                        path,\n                        esm\n                            ? nextTraceMap\n                            : this.mode === \"legacy\"\n                            ? { default: nextTraceMap, ...nextTraceMap }\n                            : { default: nextTraceMap },\n                    )\n\n                    if (esm) {\n                        yield* it\n                    } else {\n                        for (const report of it) {\n                            report.path = report.path.filter(exceptDefault)\n                            if (\n                                report.path.length >= 2 ||\n                                report.type !== READ\n                            ) {\n                                yield report\n                            }\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    /**\n     * Iterate the property references for a given expression AST node.\n     * @template T\n     * @param {Expression} node The expression AST node to iterate property references.\n     * @param {TraceMap<T>} traceMap The trace map.\n     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate property references.\n     */\n    *iteratePropertyReferences(node, traceMap) {\n        yield* this._iteratePropertyReferences(node, [], traceMap)\n    }\n\n    /**\n     * Iterate the references for a given variable.\n     * @private\n     * @template T\n     * @param {Variable} variable The variable to iterate that references.\n     * @param {string[]} path The current path.\n     * @param {TraceMapObject<T>} traceMap The trace map.\n     * @param {boolean} shouldReport = The flag to report those references.\n     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.\n     */\n    *_iterateVariableReferences(variable, path, traceMap, shouldReport) {\n        if (this.variableStack.includes(variable)) {\n            return\n        }\n        this.variableStack.push(variable)\n        try {\n            for (const reference of variable.references) {\n                if (!reference.isRead()) {\n                    continue\n                }\n                const node = /** @type {RuleNode & Identifier} */ (\n                    reference.identifier\n                )\n\n                if (shouldReport && traceMap[READ]) {\n                    yield { node, path, type: READ, info: traceMap[READ] }\n                }\n                yield* this._iteratePropertyReferences(node, path, traceMap)\n            }\n        } finally {\n            this.variableStack.pop()\n        }\n    }\n\n    /**\n     * Iterate the references for a given AST node.\n     * @private\n     * @template T\n     * @param {Expression} rootNode The AST node to iterate references.\n     * @param {string[]} path The current path.\n     * @param {TraceMapObject<T>} traceMap The trace map.\n     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.\n     */\n    //eslint-disable-next-line complexity\n    *_iteratePropertyReferences(rootNode, path, traceMap) {\n        let node = rootNode\n        while (isPassThrough(node)) {\n            node = node.parent\n        }\n\n        const parent = /** @type {RuleNode} */ (node).parent\n        if (!parent) {\n            return\n        }\n        if (parent.type === \"MemberExpression\") {\n            if (parent.object === node) {\n                const key = getPropertyName(parent)\n                if (key == null || !has(traceMap, key)) {\n                    return\n                }\n\n                path = path.concat(key) //eslint-disable-line no-param-reassign\n                const nextTraceMap = traceMap[key]\n                if (nextTraceMap[READ]) {\n                    yield {\n                        node: parent,\n                        path,\n                        type: READ,\n                        info: nextTraceMap[READ],\n                    }\n                }\n                yield* this._iteratePropertyReferences(\n                    parent,\n                    path,\n                    nextTraceMap,\n                )\n            }\n            return\n        }\n        if (parent.type === \"CallExpression\") {\n            if (parent.callee === node && traceMap[CALL]) {\n                yield { node: parent, path, type: CALL, info: traceMap[CALL] }\n            }\n            return\n        }\n        if (parent.type === \"NewExpression\") {\n            if (parent.callee === node && traceMap[CONSTRUCT]) {\n                yield {\n                    node: parent,\n                    path,\n                    type: CONSTRUCT,\n                    info: traceMap[CONSTRUCT],\n                }\n            }\n            return\n        }\n        if (parent.type === \"AssignmentExpression\") {\n            if (parent.right === node) {\n                yield* this._iterateLhsReferences(parent.left, path, traceMap)\n                yield* this._iteratePropertyReferences(parent, path, traceMap)\n            }\n            return\n        }\n        if (parent.type === \"AssignmentPattern\") {\n            if (parent.right === node) {\n                yield* this._iterateLhsReferences(parent.left, path, traceMap)\n            }\n            return\n        }\n        if (parent.type === \"VariableDeclarator\") {\n            if (parent.init === node) {\n                yield* this._iterateLhsReferences(parent.id, path, traceMap)\n            }\n        }\n    }\n\n    /**\n     * Iterate the references for a given Pattern node.\n     * @private\n     * @template T\n     * @param {Pattern} patternNode The Pattern node to iterate references.\n     * @param {string[]} path The current path.\n     * @param {TraceMapObject<T>} traceMap The trace map.\n     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.\n     */\n    *_iterateLhsReferences(patternNode, path, traceMap) {\n        if (patternNode.type === \"Identifier\") {\n            const variable = findVariable(this.globalScope, patternNode)\n            if (variable != null) {\n                yield* this._iterateVariableReferences(\n                    variable,\n                    path,\n                    traceMap,\n                    false,\n                )\n            }\n            return\n        }\n        if (patternNode.type === \"ObjectPattern\") {\n            for (const property of patternNode.properties) {\n                const key = getPropertyName(\n                    /** @type {AssignmentProperty} */ (property),\n                )\n\n                if (key == null || !has(traceMap, key)) {\n                    continue\n                }\n\n                const nextPath = path.concat(key)\n                const nextTraceMap = traceMap[key]\n                if (nextTraceMap[READ]) {\n                    yield {\n                        node: /** @type {RuleNode} */ (property),\n                        path: nextPath,\n                        type: READ,\n                        info: nextTraceMap[READ],\n                    }\n                }\n                yield* this._iterateLhsReferences(\n                    /** @type {AssignmentProperty} */ (property).value,\n                    nextPath,\n                    nextTraceMap,\n                )\n            }\n            return\n        }\n        if (patternNode.type === \"AssignmentPattern\") {\n            yield* this._iterateLhsReferences(patternNode.left, path, traceMap)\n        }\n    }\n\n    /**\n     * Iterate the references for a given ModuleSpecifier node.\n     * @private\n     * @template T\n     * @param {ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier} specifierNode The ModuleSpecifier node to iterate references.\n     * @param {string[]} path The current path.\n     * @param {TraceMapObject<T>} traceMap The trace map.\n     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.\n     */\n    *_iterateImportReferences(specifierNode, path, traceMap) {\n        const type = specifierNode.type\n\n        if (type === \"ImportSpecifier\" || type === \"ImportDefaultSpecifier\") {\n            const key =\n                type === \"ImportDefaultSpecifier\"\n                    ? \"default\"\n                    : specifierNode.imported.type === \"Identifier\"\n                    ? specifierNode.imported.name\n                    : specifierNode.imported.value\n            if (!has(traceMap, key)) {\n                return\n            }\n\n            path = path.concat(key) //eslint-disable-line no-param-reassign\n            const nextTraceMap = traceMap[key]\n            if (nextTraceMap[READ]) {\n                yield {\n                    node: /** @type {RuleNode} */ (specifierNode),\n                    path,\n                    type: READ,\n                    info: nextTraceMap[READ],\n                }\n            }\n            yield* this._iterateVariableReferences(\n                /** @type {Variable} */ (\n                    findVariable(this.globalScope, specifierNode.local)\n                ),\n                path,\n                nextTraceMap,\n                false,\n            )\n\n            return\n        }\n\n        if (type === \"ImportNamespaceSpecifier\") {\n            yield* this._iterateVariableReferences(\n                /** @type {Variable} */ (\n                    findVariable(this.globalScope, specifierNode.local)\n                ),\n                path,\n                traceMap,\n                false,\n            )\n            return\n        }\n\n        if (type === \"ExportSpecifier\") {\n            const key =\n                specifierNode.local.type === \"Identifier\"\n                    ? specifierNode.local.name\n                    : specifierNode.local.value\n            if (!has(traceMap, key)) {\n                return\n            }\n\n            path = path.concat(key) //eslint-disable-line no-param-reassign\n            const nextTraceMap = traceMap[key]\n            if (nextTraceMap[READ]) {\n                yield {\n                    node: /** @type {RuleNode} */ (specifierNode),\n                    path,\n                    type: READ,\n                    info: nextTraceMap[READ],\n                }\n            }\n        }\n    }\n}\n\nReferenceTracker.READ = READ\nReferenceTracker.CALL = CALL\nReferenceTracker.CONSTRUCT = CONSTRUCT\nReferenceTracker.ESM = ESM\n\n/**\n * This is a predicate function for Array#filter.\n * @param {string} name A name part.\n * @param {number} index The index of the name.\n * @returns {boolean} `false` if it's default.\n */\nfunction exceptDefault(name, index) {\n    return !(index === 1 && name === \"default\")\n}\n","/** @typedef {import(\"./types.mjs\").StaticValue} StaticValue */\n/** @typedef {import(\"./types.mjs\").StaticValueOptional} StaticValueOptional */\n/** @typedef {import(\"./types.mjs\").StaticValueProvided} StaticValueProvided */\n/** @typedef {import(\"./types.mjs\").ReferenceTrackerOptions} ReferenceTrackerOptions */\n/**\n * @template T\n * @typedef {import(\"./types.mjs\").TraceMap<T>} TraceMap\n */\n/**\n * @template T\n * @typedef {import(\"./types.mjs\").TrackedReferences<T>} TrackedReferences\n */\n/** @typedef {import(\"./types.mjs\").HasSideEffectOptions} HasSideEffectOptions */\n/** @typedef {import(\"./types.mjs\").ArrowToken} ArrowToken */\n/** @typedef {import(\"./types.mjs\").CommaToken} CommaToken */\n/** @typedef {import(\"./types.mjs\").SemicolonToken} SemicolonToken */\n/** @typedef {import(\"./types.mjs\").ColonToken} ColonToken */\n/** @typedef {import(\"./types.mjs\").OpeningParenToken} OpeningParenToken */\n/** @typedef {import(\"./types.mjs\").ClosingParenToken} ClosingParenToken */\n/** @typedef {import(\"./types.mjs\").OpeningBracketToken} OpeningBracketToken */\n/** @typedef {import(\"./types.mjs\").ClosingBracketToken} ClosingBracketToken */\n/** @typedef {import(\"./types.mjs\").OpeningBraceToken} OpeningBraceToken */\n/** @typedef {import(\"./types.mjs\").ClosingBraceToken} ClosingBraceToken */\n\nimport { findVariable } from \"./find-variable.mjs\"\nimport { getFunctionHeadLocation } from \"./get-function-head-location.mjs\"\nimport { getFunctionNameWithKind } from \"./get-function-name-with-kind.mjs\"\nimport { getInnermostScope } from \"./get-innermost-scope.mjs\"\nimport { getPropertyName } from \"./get-property-name.mjs\"\nimport { getStaticValue } from \"./get-static-value.mjs\"\nimport { getStringIfConstant } from \"./get-string-if-constant.mjs\"\nimport { hasSideEffect } from \"./has-side-effect.mjs\"\nimport { isParenthesized } from \"./is-parenthesized.mjs\"\nimport { PatternMatcher } from \"./pattern-matcher.mjs\"\nimport {\n    CALL,\n    CONSTRUCT,\n    ESM,\n    READ,\n    ReferenceTracker,\n} from \"./reference-tracker.mjs\"\nimport {\n    isArrowToken,\n    isClosingBraceToken,\n    isClosingBracketToken,\n    isClosingParenToken,\n    isColonToken,\n    isCommaToken,\n    isCommentToken,\n    isNotArrowToken,\n    isNotClosingBraceToken,\n    isNotClosingBracketToken,\n    isNotClosingParenToken,\n    isNotColonToken,\n    isNotCommaToken,\n    isNotCommentToken,\n    isNotOpeningBraceToken,\n    isNotOpeningBracketToken,\n    isNotOpeningParenToken,\n    isNotSemicolonToken,\n    isOpeningBraceToken,\n    isOpeningBracketToken,\n    isOpeningParenToken,\n    isSemicolonToken,\n} from \"./token-predicate.mjs\"\n\nexport default {\n    CALL,\n    CONSTRUCT,\n    ESM,\n    findVariable,\n    getFunctionHeadLocation,\n    getFunctionNameWithKind,\n    getInnermostScope,\n    getPropertyName,\n    getStaticValue,\n    getStringIfConstant,\n    hasSideEffect,\n    isArrowToken,\n    isClosingBraceToken,\n    isClosingBracketToken,\n    isClosingParenToken,\n    isColonToken,\n    isCommaToken,\n    isCommentToken,\n    isNotArrowToken,\n    isNotClosingBraceToken,\n    isNotClosingBracketToken,\n    isNotClosingParenToken,\n    isNotColonToken,\n    isNotCommaToken,\n    isNotCommentToken,\n    isNotOpeningBraceToken,\n    isNotOpeningBracketToken,\n    isNotOpeningParenToken,\n    isNotSemicolonToken,\n    isOpeningBraceToken,\n    isOpeningBracketToken,\n    isOpeningParenToken,\n    isParenthesized,\n    isSemicolonToken,\n    PatternMatcher,\n    READ,\n    ReferenceTracker,\n}\nexport {\n    CALL,\n    CONSTRUCT,\n    ESM,\n    findVariable,\n    getFunctionHeadLocation,\n    getFunctionNameWithKind,\n    getInnermostScope,\n    getPropertyName,\n    getStaticValue,\n    getStringIfConstant,\n    hasSideEffect,\n    isArrowToken,\n    isClosingBraceToken,\n    isClosingBracketToken,\n    isClosingParenToken,\n    isColonToken,\n    isCommaToken,\n    isCommentToken,\n    isNotArrowToken,\n    isNotClosingBraceToken,\n    isNotClosingBracketToken,\n    isNotClosingParenToken,\n    isNotColonToken,\n    isNotCommaToken,\n    isNotCommentToken,\n    isNotOpeningBraceToken,\n    isNotOpeningBracketToken,\n    isNotOpeningParenToken,\n    isNotSemicolonToken,\n    isOpeningBraceToken,\n    isOpeningBracketToken,\n    isOpeningParenToken,\n    isParenthesized,\n    isSemicolonToken,\n    PatternMatcher,\n    READ,\n    ReferenceTracker,\n}\n"],"names":["getKeys","KEYS"],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,IAAI,iBAAiB;AACrB,IAAI,sBAAsB;AAC1B,IAAI,wBAAwB;AAC5B,IAAI,sBAAsB;AAC1B,IAAI,mBAAmB;AACvB,IAAI,mBAAmB;AACvB,IAAI,qBAAqB;AACzB,IAAI,mBAAmB;AACvB,IAAI,eAAe;AACnB,IAAI,gBAAgB;AACpB,IAAI,cAAc;AAClB,IAAI,IAAI;AACR,IAAI,gBAAgB;AACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}*x   import { getKeys, KEYS } from 'eslint-visitor-keys';

/** @typedef {import("eslint").Scope.Scope} Scope */
/** @typedef {import("estree").Node} Node */

/**
 * Get the innermost scope which contains a given location.
 * @param {Scope} initialScope The initial scope to search.
 * @param {Node} node The location to search.
 * @returns {Scope} The innermost scope.
 */
function getInnermostScope(initialScope, node) {
    const location = /** @type {[number, number]} */ (node.range)[0];

    let scope = initialScope;
    let found = false;
    do {
        found = false;
        for (const childScope of scope.childScopes) {
            const range = /** @type {[number, number]} */ (
                childScope.block.range
            );

            if (range[0] <= location && location < range[1]) {
                scope = childScope;
                found = true;
                break
            }
        }
    } while (found)

    return scope
}

/** @typedef {import("eslint").Scope.Scope} Scope */
/** @typedef {import("eslint").Scope.Variable} Variable */
/** @typedef {import("estree").Identifier} Identifier */

/**
 * Find the variable of a given name.
 * @param {Scope} initialScope The scope to start finding.
 * @param {string|Identifier} nameOrNode The variable name to find. If this is a Node object then it should be an Identifier node.
 * @returns {Variable|null} The found variable or null.
 */
function findVariable(initialScope, nameOrNode) {
    let name = "";
    /** @type {Scope|null} */
    let scope = initialScope;

    if (typeof nameOrNode === "string") {
        name = nameOrNode;
    } else {
        name = nameOrNode.name;
        scope = getInnermostScope(scope, nameOrNode);
    }

    while (scope != null) {
        const variable = scope.set.get(name);
        if (variable != null) {
            return variable
        }
        scope = scope.upper;
    }

    return null
}

/** @typedef {import("eslint").AST.Token} Token */
/** @typedef {import("estree").Comment} Comment */
/** @typedef {import("./types.mjs").ArrowToken} ArrowToken */
/** @typedef {import("./types.mjs").CommaToken} CommaToken */
/** @typedef {import("./types.mjs").SemicolonToken} SemicolonToken */
/** @typedef {import("./types.mjs").ColonToken} ColonToken */
/** @typedef {import("./types.mjs").OpeningParenToken} OpeningParenToken */
/** @typedef {import("./types.mjs").ClosingParenToken} ClosingParenToken */
/** @typedef {import("./types.mjs").OpeningBracketToken} OpeningBracketToken */
/** @typedef {import("./types.mjs").ClosingBracketToken} ClosingBracketToken */
/** @typedef {import("./types.mjs").OpeningBraceToken} OpeningBraceToken */
/** @typedef {import("./types.mjs").ClosingBraceToken} ClosingBraceToken */
/**
 * @template {string} Value
 * @typedef {import("./types.mjs").PunctuatorToken<Value>} PunctuatorToken
 */

/** @typedef {Comment | Token} CommentOrToken */

/**
 * Creates the negate function of the given function.
 * @param {function(CommentOrToken):boolean} f - The function to negate.
 * @returns {function(CommentOrToken):boolean} Negated function.
 */
function negate(f) {
    return (token) => !f(token)
}

/**
 * Checks if the given token is a PunctuatorToken with the given value
 * @template {string} Value
 * @param {CommentOrToken} token - The token to check.
 * @param {Value} value - The value to check.
 * @returns {token is PunctuatorToken<Value>} `true` if the token is a PunctuatorToken with the given value.
 */
function isPunctuatorTokenWithValue(token, value) {
    return token.type === "Punctuator" && token.value === value
}

/**
 * Checks if the given token is an arrow token or not.
 * @param {CommentOrToken} token - The token to check.
 * @returns {token is ArrowToken} `true` if the token is an arrow token.
 */
function isArrowToken(token) {
    return isPunctuatorTokenWithValue(token, "=>")
}

/**
 * Checks if the given token is a comma token or not.
 * @param {CommentOrToken} token - The token to check.
 * @returns {token is CommaToken} `true` if the token is a comma token.
 */
function isCommaToken(token) {
    return isPunctuatorTokenWithValue(token, ",")
}

/**
 * Checks if the given token is a semicolon token or not.
 * @param {CommentOrToken} token - The token to check.
 * @returns {token is SemicolonToken} `true` if the token is a semicolon token.
 */
function isSemicolonToken(token) {
    return isPunctuatorTokenWithValue(token, ";")
}

/**
 * Checks if the given token is a colon token or not.
 * @param {CommentOrToken} token - The token to check.
 * @returns {token is ColonToken} `true` if the token is a colon token.
 */
function isColonToken(token) {
    return isPunctuatorTokenWithValue(token, ":")
}

/**
 * Checks if the given token is an opening parenthesis token or not.
 * @param {CommentOrToken} token - The token to check.
 * @returns {token is OpeningParenToken} `true` if the token is an opening parenthesis token.
 */
function isOpeningParenToken(token) {
    return isPunctuatorTokenWithValue(token, "(")
}

/**
 * Checks if the given token is a closing parenthesis token or not.
 * @param {CommentOrToken} token - The token to check.
 * @returns {token is ClosingParenToken} `true` if the token is a closing parenthesis token.
 */
function isClosingParenToken(token) {
    return isPunctuatorTokenWithValue(token, ")")
}

/**
 * Checks if the given token is an opening square bracket token or not.
 * @param {CommentOrToken} token - The token to check.
 * @returns {token is OpeningBracketToken} `true` if the token is an opening square bracket token.
 */
function isOpeningBracketToken(token) {
    return isPunctuatorTokenWithValue(token, "[")
}

/**
 * Checks if the given token is a closing square bracket token or not.
 * @param {CommentOrToken} token - The token to check.
 * @returns {token is ClosingBracketToken} `true` if the token is a closing square bracket token.
 */
function isClosingBracketToken(token) {
    return isPunctuatorTokenWithValue(token, "]")
}

/**
 * Checks if the given token is an opening brace token or not.
 * @param {CommentOrToken} token - The token to check.
 * @returns {token is OpeningBraceToken} `true` if the token is an opening brace token.
 */
function isOpeningBraceToken(token) {
    return isPunctuatorTokenWithValue(token, "{")
}

/**
 * Checks if the given token is a closing brace token or not.
 * @param {CommentOrToken} token - The token to check.
 * @returns {token is ClosingBraceToken} `true` if the token is a closing brace token.
 */
function isClosingBraceToken(token) {
    return isPunctuatorTokenWithValue(token, "}")
}

/**
 * Checks if the given token is a comment token or not.
 * @param {CommentOrToken} token - The token to check.
 * @returns {token is Comment} `true` if the token is a comment token.
 */
function isCommentToken(token) {
    return ["Block", "Line", "Shebang"].includes(token.type)
}

const isNotArrowToken = negate(isArrowToken);
const isNotCommaToken = negate(isCommaToken);
const isNotSemicolonToken = negate(isSemicolonToken);
const isNotColonToken = negate(isColonToken);
const isNotOpeningParenToken = negate(isOpeningParenToken);
const isNotClosingParenToken = negate(isClosingParenToken);
const isNotOpeningBracketToken = negate(isOpeningBracketToken);
const isNotClosingBracketToken = negate(isClosingBracketToken);
const isNotOpeningBraceToken = negate(isOpeningBraceToken);
const isNotClosingBraceToken = negate(isClosingBraceToken);
const isNotCommentToken = negate(isCommentToken);

/** @typedef {import("eslint").Rule.Node} RuleNode */
/** @typedef {import("eslint").SourceCode} SourceCode */
/** @typedef {import("eslint").AST.Token} Token */
/** @typedef {import("estree").Function} FunctionNode */
/** @typedef {import("estree").FunctionDeclaration} FunctionDeclaration */
/** @typedef {import("estree").FunctionExpression} FunctionExpression */
/** @typedef {import("estree").SourceLocation} SourceLocation */
/** @typedef {import("estree").Position} Position */

/**
 * Get the `(` token of the given function node.
 * @param {FunctionExpression | FunctionDeclaration} node - The function node to get.
 * @param {SourceCode} sourceCode - The source code object to get tokens.
 * @returns {Token} `(` token.
 */
function getOpeningParenOfParams(node, sourceCode) {
    return node.id
        ? /** @type {Token} */ (
              sourceCode.getTokenAfter(node.id, isOpeningParenToken)
          )
        : /** @type {Token} */ (
              sourceCode.getFirstToken(node, isOpeningParenToken)
          )
}

/**
 * Get the location of the given function node for reporting.
 * @param {FunctionNode} node - The function node to get.
 * @param {SourceCode} sourceCode - The source code object to get tokens.
 * @returns {SourceLocation|null} The location of the function node for reporting.
 */
function getFunctionHeadLocation(node, sourceCode) {
    const parent = /** @type {RuleNode} */ (node).parent;

    /** @type {Position|null} */
    let start = null;
    /** @type {Position|null} */
    let end = null;

    if (node.type === "ArrowFunctionExpression") {
        const arrowToken = /** @type {Token} */ (
            sourceCode.getTokenBefore(node.body, isArrowToken)
        );

        start = arrowToken.loc.start;
        end = arrowToken.loc.end;
    } else if (
        parent &&
        (parent.type === "Property" ||
            parent.type === "MethodDefinition" ||
            parent.type === "PropertyDefinition")
    ) {
        start = /** @type {SourceLocation} */ (parent.loc).start;
        end = getOpeningParenOfParams(node, sourceCode).loc.start;
    } else {
        start = /** @type {SourceLocation} */ (node.loc).start;
        end = getOpeningParenOfParams(node, sourceCode).loc.start;
    }

    return {
        start: { ...start },
        end: { ...end },
    }
}

/* globals self, window */
/** @typedef {import("./types.mjs").StaticValue} StaticValue */
/** @typedef {import("eslint").Scope.Scope} Scope */
/** @typedef {import("eslint").Scope.Variable} Variable */
/** @typedef {import("estree").Node} Node */
/** @typedef {import("@typescript-eslint/types").TSESTree.Node} TSESTreeNode */
/** @typedef {import("@typescript-eslint/types").TSESTree.AST_NODE_TYPES} TSESTreeNodeTypes */
/** @typedef {import("@typescript-eslint/types").TSESTree.MemberExpression} MemberExpression */
/** @typedef {import("@typescript-eslint/types").TSESTree.Property} Property */
/** @typedef {import("@typescript-eslint/types").TSESTree.RegExpLiteral} RegExpLiteral */
/** @typedef {import("@typescript-eslint/types").TSESTree.BigIntLiteral} BigIntLiteral */
/** @typedef {import("@typescript-eslint/types").TSESTree.Literal} Literal */

const globalObject =
    typeof globalThis !== "undefined"
        ? globalThis
        : // @ts-ignore
        typeof self !== "undefined"
        ? // @ts-ignore
          self
        : // @ts-ignore
        typeof window !== "undefined"
        ? // @ts-ignore
          window
        : typeof global !== "undefined"
        ? global
        : {};

const builtinNames = Object.freeze(
    new Set([
        "Array",
        "ArrayBuffer",
        "BigInt",
        "BigInt64Array",
        "BigUint64Array",
        "Boolean",
        "DataView",
        "Date",
        "decodeURI",
        "decodeURIComponent",
        "encodeURI",
        "encodeURIComponent",
        "escape",
        "Float32Array",
        "Float64Array",
        "Function",
        "Infinity",
        "Int16Array",
        "Int32Array",
        "Int8Array",
        "isFinite",
        "isNaN",
        "isPrototypeOf",
        "JSON",
        "Map",
        "Math",
        "NaN",
        "Number",
        "Object",
        "parseFloat",
        "parseInt",
        "Promise",
        "Proxy",
        "Reflect",
        "RegExp",
        "Set",
        "String",
        "Symbol",
        "Uint16Array",
        "Uint32Array",
        "Uint8Array",
        "Uint8ClampedArray",
        "undefined",
        "unescape",
        "WeakMap",
        "WeakSet",
    ]),
);
const callAllowed = new Set(
    [
        Array.isArray,
        Array.of,
        Array.prototype.at,
        Array.prototype.concat,
        Array.prototype.entries,
        Array.prototype.every,
        Array.prototype.filter,
        Array.prototype.find,
        Array.prototype.findIndex,
        Array.prototype.flat,
        Array.prototype.includes,
        Array.prototype.indexOf,
        Array.prototype.join,
        Array.prototype.keys,
        Array.prototype.lastIndexOf,
        Array.prototype.slice,
        Array.prototype.some,
        Array.prototype.toString,
        Array.prototype.values,
        typeof BigInt === "function" ? BigInt : undefined,
        Boolean,
        Date,
        Date.parse,
        decodeURI,
        decodeURIComponent,
        encodeURI,
        encodeURIComponent,
        escape,
        isFinite,
        isNaN,
        // @ts-ignore
        isPrototypeOf,
        Map,
        Map.prototype.entries,
        Map.prototype.get,
        Map.prototype.has,
        Map.prototype.keys,
        Map.prototype.values,
        .../** @type {(keyof typeof Math)[]} */ (
            Object.getOwnPropertyNames(Math)
        )
            .filter((k) => k !== "random")
            .map((k) => Math[k])
            .filter((f) => typeof f === "function"),
        Number,
        Number.isFinite,
        Number.isNaN,
        Number.parseFloat,
        Number.parseInt,
        Number.prototype.toExponential,
        Number.prototype.toFixed,
        Number.prototype.toPrecision,
        Number.prototype.toString,
        Object,
        Object.entries,
        Object.is,
        Object.isExtensible,
        Object.isFrozen,
        Object.isSealed,
        Object.keys,
        Object.values,
        parseFloat,
        parseInt,
        RegExp,
        Set,
        Set.prototype.entries,
        Set.prototype.has,
        Set.prototype.keys,
        Set.prototype.values,
        String,
        String.fromCharCode,
        String.fromCodePoint,
        String.raw,
        String.prototype.at,
        String.prototype.charAt,
        String.prototype.charCodeAt,
        String.prototype.codePointAt,
        String.prototype.concat,
        String.prototype.endsWith,
        String.prototype.includes,
        String.prototype.indexOf,
        String.prototype.lastIndexOf,
        String.prototype.normalize,
        String.prototype.padEnd,
        String.prototype.padStart,
        String.prototype.slice,
        String.prototype.startsWith,
        String.prototype.substr,
        String.prototype.substring,
        String.prototype.toLowerCase,
        String.prototype.toString,
        String.prototype.toUpperCase,
        String.prototype.trim,
        String.prototype.trimEnd,
        String.prototype.trimLeft,
        String.prototype.trimRight,
        String.prototype.trimStart,
        Symbol.for,
        Symbol.keyFor,
        unescape,
    ].filter((f) => typeof f === "function"),
);
const callPassThrough = new Set([
    Object.freeze,
    Object.preventExtensions,
    Object.seal,
]);

/** @type {ReadonlyArray<readonly [Function, ReadonlySet<string>]>} */
const getterAllowed = [
    [Map, new Set(["size"])],
    [
        RegExp,
        new Set([
            "dotAll",
            "flags",
            "global",
            "hasIndices",
            "ignoreCase",
            "multiline",
            "source",
            "sticky",
            "unicode",
        ]),
    ],
    [Set, new Set(["size"])],
];

/**
 * Get the property descriptor.
 * @param {object} object The object to get.
 * @param {string|number|symbol} name The property name to get.
 */
function getPropertyDescriptor(object, name) {
    let x = object;
    while ((typeof x === "object" || typeof x === "function") && x !== null) {
        const d = Object.getOwnPropertyDescriptor(x, name);
        if (d) {
            return d
        }
        x = Object.getPrototypeOf(x);
    }
    return null
}

/**
 * Check if a property is getter or not.
 * @param {object} object The object to check.
 * @param {string|number|symbol} name The property name to check.
 */
function isGetter(object, name) {
    const d = getPropertyDescriptor(object, name);
    return d != null && d.get != null
}

/**
 * Get the element values of a given node list.
 * @param {(Node|TSESTreeNode|null)[]} nodeList The node list to get values.
 * @param {Scope|undefined|null} initialScope The initial scope to find variables.
 * @returns {any[]|null} The value list if all nodes are constant. Otherwise, null.
 */
function getElementValues(nodeList, initialScope) {
    const valueList = [];

    for (let i = 0; i < nodeList.length; ++i) {
        const elementNode = nodeList[i];

        if (elementNode == null) {
            valueList.length = i + 1;
        } else if (elementNode.type === "SpreadElement") {
            const argument = getStaticValueR(elementNode.argument, initialScope);
            if (argument == null) {
                return null
            }
            valueList.push(.../** @type {Iterable<any>} */ (argument.value));
        } else {
            const element = getStaticValueR(elementNode, initialScope);
            if (element == null) {
                return null
            }
            valueList.push(element.value);
        }
    }

    return valueList
}

/**
 * Checks if a variable is a built-in global.
 * @param {Variable|null} variable The variable to check.
 * @returns {variable is Variable & {defs:[]}}
 */
function isBuiltinGlobal(variable) {
    return (
        variable != null &&
        variable.defs.length === 0 &&
        builtinNames.has(variable.name) &&
        variable.name in globalObject
    )
}

/**
 * Checks if a variable can be considered as a constant.
 * @param {Variable} variable
 * @returns {variable is Variable & {defs: [import("eslint").Scope.Definition & { type: "Variable" }]}} True if the variable can be considered as a constant.
 */
function canBeConsideredConst(variable) {
    if (variable.defs.length !== 1) {
        return false
    }
    const def = variable.defs[0];
    return Boolean(
        def.parent &&
            def.type === "Variable" &&
            (def.parent.kind === "const" || isEffectivelyConst(variable)),
    )
}

/**
 * Returns whether the given variable is never written to after initialization.
 * @param {Variable} variable
 * @returns {boolean}
 */
function isEffectivelyConst(variable) {
    const refs = variable.references;

    const inits = refs.filter((r) => r.init).length;
    const reads = refs.filter((r) => r.isReadOnly()).length;
    if (inits === 1 && reads + inits === refs.length) {
        // there is only one init and all other references only read
        return true
    }
    return false
}

/**
 * Checks if a variable has mutation in its property.
 * @param {Variable} variable The variable to check.
 * @param {Scope|null} initialScope The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.
 * @returns {boolean} True if the variable has mutation in its property.
 */
function hasMutationInProperty(variable, initialScope) {
    for (const ref of variable.references) {
        let node = /** @type {TSESTreeNode} */ (ref.identifier);
        while (node && node.parent && node.parent.type === "MemberExpression") {
            node = node.parent;
        }
        if (!node || !node.parent) {
            continue
        }
        if (
            (node.parent.type === "AssignmentExpression" &&
                node.parent.left === node) ||
            (node.parent.type === "UpdateExpression" &&
                node.parent.argument === node)
        ) {
            // This is a mutation.
            return true
        }
        if (
            node.parent.type === "CallExpression" &&
            node.parent.callee === node &&
            node.type === "MemberExpression"
        ) {
            const methodName = getStaticPropertyNameValue(node, initialScope);
            if (isNameOfMutationArrayMethod(methodName)) {
                // This is a mutation.
                return true
            }
        }
    }
    return false

    /**
     * Checks if a method name is one of the mutation array methods.
     * @param {StaticValue|null} methodName The method name to check.
     * @returns {boolean} True if the method name is a mutation array method.
     */
    function isNameOfMutationArrayMethod(methodName) {
        if (methodName == null || methodName.value == null) {
            return false
        }
        const name = methodName.value;
        return (
            name === "copyWithin" ||
            name === "fill" ||
            name === "pop" ||
            name === "push" ||
            name === "reverse" ||
            name === "shift" ||
            name === "sort" ||
            name === "splice" ||
            name === "unshift"
        )
    }
}

/**
 * @template {TSESTreeNodeTypes} T
 * @callback VisitorCallback
 * @param {TSESTreeNode & { type: T }} node
 * @param {Scope|undefined|null} initialScope
 * @returns {StaticValue | null}
 */
/**
 * @typedef { { [K in TSESTreeNodeTypes]?: VisitorCallback<K> } } Operations
 */
/**
 * @type {Operations}
 */
const operations = Object.freeze({
    ArrayExpression(node, initialScope) {
        const elements = getElementValues(node.elements, initialScope);
        return elements != null ? { value: elements } : null
    },

    AssignmentExpression(node, initialScope) {
        if (node.operator === "=") {
            return getStaticValueR(node.right, initialScope)
        }
        return null
    },

    //eslint-disable-next-line complexity
    BinaryExpression(node, initialScope) {
        if (node.operator === "in" || node.operator === "instanceof") {
            // Not supported.
            return null
        }

        const left = getStaticValueR(node.left, initialScope);
        const right = getStaticValueR(node.right, initialScope);
        if (left != null && right != null) {
            switch (node.operator) {
                case "==":
                    return { value: left.value == right.value } //eslint-disable-line eqeqeq
                case "!=":
                    return { value: left.value != right.value } //eslint-disable-line eqeqeq
                case "===":
                    return { value: left.value === right.value }
                case "!==":
                    return { value: left.value !== right.value }
                case "<":
                    return {
                        value:
                            /** @type {any} */ (left.value) <
                            /** @type {any} */ (right.value),
                    }
                case "<=":
                    return {
                        value:
                            /** @type {any} */ (left.value) <=
                            /** @type {any} */ (right.value),
                    }
                case ">":
                    return {
                        value:
                            /** @type {any} */ (left.value) >
                            /** @type {any} */ (right.value),
                    }
                case ">=":
                    return {
                        value:
                            /** @type {any} */ (left.value) >=
                            /** @type {any} */ (right.value),
                    }
                case "<<":
                    return {
                        value:
                            /** @type {any} */ (left.value) <<
                            /** @type {any} */ (right.value),
                    }
                case ">>":
                    return {
                        value:
                            /** @type {any} */ (left.value) >>
                            /** @type {any} */ (right.value),
                    }
                case ">>>":
                    return {
                        value:
                            /** @type {any} */ (left.value) >>>
                            /** @type {any} */ (right.value),
                    }
                case "+":
                    return {
                        value:
                            /** @type {any} */ (left.value) +
                            /** @type {any} */ (right.value),
                    }
                case "-":
                    return {
                        value:
                            /** @type {any} */ (left.value) -
                            /** @type {any} */ (right.value),
                    }
                case "*":
                    return {
                        value:
                            /** @type {any} */ (left.value) *
                            /** @type {any} */ (right.value),
                    }
                case "/":
                    return {
                        value:
                            /** @type {any} */ (left.value) /
                            /** @type {any} */ (right.value),
                    }
                case "%":
                    return {
                        value:
                            /** @type {any} */ (left.value) %
                            /** @type {any} */ (right.value),
                    }
                case "**":
                    return {
                        value:
                            /** @type {any} */ (left.value) **
                            /** @type {any} */ (right.value),
                    }
                case "|":
                    return {
                        value:
                            /** @type {any} */ (left.value) |
                            /** @type {any} */ (right.value),
                    }
                case "^":
                    return {
                        value:
                            /** @type {any} */ (left.value) ^
                            /** @type {any} */ (right.value),
                    }
                case "&":
                    return {
                        value:
                            /** @type {any} */ (left.value) &
                            /** @type {any} */ (right.value),
                    }

                // no default
            }
        }

        return null
    },

    CallExpression(node, initialScope) {
        const calleeNode = node.callee;
        const args = getElementValues(node.arguments, initialScope);

        if (args != null) {
            if (calleeNode.type === "MemberExpression") {
                if (calleeNode.property.type === "PrivateIdentifier") {
                    return null
                }
                const object = getStaticValueR(calleeNode.object, initialScope);
                if (object != null) {
                    if (
                        object.value == null &&
                        (object.optional || node.optional)
                    ) {
                        return { value: undefined, optional: true }
                    }
                    const property = getStaticPropertyNameValue(
                        calleeNode,
                        initialScope,
                    );

                    if (property != null) {
                        const receiver =
                            /** @type {Record<PropertyKey, (...args: any[]) => any>} */ (
                                object.value
                            );
                        const methodName = /** @type {PropertyKey} */ (
                            property.value
                        );
                        if (callAllowed.has(receiver[methodName])) {
                            return {
                                value: receiver[methodName](...args),
                            }
                        }
                        if (callPassThrough.has(receiver[methodName])) {
                            return { value: args[0] }
                        }
                    }
                }
            } else {
                const callee = getStaticValueR(calleeNode, initialScope);
                if (callee != null) {
                    if (callee.value == null && node.optional) {
                        return { value: undefined, optional: true }
                    }
                    const func = /** @type {(...args: any[]) => any} */ (
                        callee.value
                    );
                    if (callAllowed.has(func)) {
                        return { value: func(...args) }
                    }
                    if (callPassThrough.has(func)) {
                        return { value: args[0] }
                    }
                }
            }
        }

        return null
    },

    ConditionalExpression(node, initialScope) {
        const test = getStaticValueR(node.test, initialScope);
        if (test != null) {
            return test.value
                ? getStaticValueR(node.consequent, initialScope)
                : getStaticValueR(node.alternate, initialScope)
        }
        return null
    },

    ExpressionStatement(node, initialScope) {
        return getStaticValueR(node.expression, initialScope)
    },

    Identifier(node, initialScope) {
        if (initialScope != null) {
            const variable = findVariable(initialScope, node);

            if (variable != null) {
                // Built-in globals.
                if (isBuiltinGlobal(variable)) {
                    return { value: globalObject[variable.name] }
                }

                // Constants.
                if (canBeConsideredConst(variable)) {
                    const def = variable.defs[0];
                    if (
                        // TODO(mysticatea): don't support destructuring here.
                        def.node.id.type === "Identifier"
                    ) {
                        const init = getStaticValueR(
                            def.node.init,
                            initialScope,
                        );
                        if (
                            init &&
                            typeof init.value === "object" &&
                            init.value !== null
                        ) {
                            if (hasMutationInProperty(variable, initialScope)) {
                                // This variable has mutation in its property.
                                return null
                            }
                        }
                        return init
                    }
                }
            }
        }
        return null
    },

    Literal(node) {
        const literal =
            /** @type {Partial<Literal> & Partial<RegExpLiteral> & Partial<BigIntLiteral>} */ (
                node
            );
        //istanbul ignore if : this is implementation-specific behavior.
        if (
            (literal.regex != null || literal.bigint != null) &&
            literal.value == null
        ) {
            // It was a RegExp/BigInt literal, but Node.js didn't support it.
            return null
        }
        return { value: literal.value }
    },

    LogicalExpression(node, initialScope) {
        const left = getStaticValueR(node.left, initialScope);
        if (left != null) {
            if (
                (node.operator === "||" && Boolean(left.value) === true) ||
                (node.operator === "&&" && Boolean(left.value) === false) ||
                (node.operator === "??" && left.value != null)
            ) {
                return left
            }

            const right = getStaticValueR(node.right, initialScope);
            if (right != null) {
                return right
            }
        }

        return null
    },

    MemberExpression(node, initialScope) {
        if (node.property.type === "PrivateIdentifier") {
            return null
        }
        const object = getStaticValueR(node.object, initialScope);
        if (object != null) {
            if (object.value == null && (object.optional || node.optional)) {
                return { value: undefined, optional: true }
            }
            const property = getStaticPropertyNameValue(node, initialScope);

            if (property != null) {
                if (
                    !isGetter(
                        /** @type {object} */ (object.value),
                        /** @type {PropertyKey} */ (property.value),
                    )
                ) {
                    return {
                        value: /** @type {Record<PropertyKey, unknown>} */ (
                            object.value
                        )[/** @type {PropertyKey} */ (property.value)],
                    }
                }

                for (const [classFn, allowed] of getterAllowed) {
                    if (
                        object.value instanceof classFn &&
                        allowed.has(/** @type {string} */ (property.value))
                    ) {
                        return {
                            value: /** @type {Record<PropertyKey, unknown>} */ (
                                object.value
                            )[/** @type {PropertyKey} */ (property.value)],
                        }
                    }
                }
            }
        }
        return null
    },

    ChainExpression(node, initialScope) {
        const expression = getStaticValueR(node.expression, initialScope);
        if (expression != null) {
            return { value: expression.value }
        }
        return null
    },

    NewExpression(node, initialScope) {
        const callee = getStaticValueR(node.callee, initialScope);
        const args = getElementValues(node.arguments, initialScope);

        if (callee != null && args != null) {
            const Func = /** @type {new (...args: any[]) => any} */ (
                callee.value
            );
            if (callAllowed.has(Func)) {
                return { value: new Func(...args) }
            }
        }

        return null
    },

    ObjectExpression(node, initialScope) {
        /** @type {Record<PropertyKey, unknown>} */
        const object = {};

        for (const propertyNode of node.properties) {
            if (propertyNode.type === "Property") {
                if (propertyNode.kind !== "init") {
                    return null
                }
                const key = getStaticPropertyNameValue(
                    propertyNode,
                    initialScope,
                );
                const value = getStaticValueR(propertyNode.value, initialScope);
                if (key == null || value == null) {
                    return null
                }
                object[/** @type {PropertyKey} */ (key.value)] = value.value;
            } else if (
                propertyNode.type === "SpreadElement" ||
                // @ts-expect-error -- Backward compatibility
                propertyNode.type === "ExperimentalSpreadProperty"
            ) {
                const argument = getStaticValueR(
                    propertyNode.argument,
                    initialScope,
                );
                if (argument == null) {
                    return null
                }
                Object.assign(object, argument.value);
            } else {
                return null
            }
        }

        return { value: object }
    },

    SequenceExpression(node, initialScope) {
        const last = node.expressions[node.expressions.length - 1];
        return getStaticValueR(last, initialScope)
    },

    TaggedTemplateExpression(node, initialScope) {
        const tag = getStaticValueR(node.tag, initialScope);
        const expressions = getElementValues(
            node.quasi.expressions,
            initialScope,
        );

        if (tag != null && expressions != null) {
            const func = /** @type {(...args: any[]) => any} */ (tag.value);
            /** @type {any[] & { raw?: string[] }} */
            const strings = node.quasi.quasis.map((q) => q.value.cooked);
            strings.raw = node.quasi.quasis.map((q) => q.value.raw);

            if (func === String.raw) {
                return { value: func(strings, ...expressions) }
            }
        }

        return null
    },

    TemplateLiteral(node, initialScope) {
        const expressions = getElementValues(node.expressions, initialScope);
        if (expressions != null) {
            let value = node.quasis[0].value.cooked;
            for (let i = 0; i < expressions.length; ++i) {
                value += expressions[i];
                value += /** @type {string} */ (node.quasis[i + 1].value.cooked);
            }
            return { value }
        }
        return null
    },

    UnaryExpression(node, initialScope) {
        if (node.operator === "delete") {
            // Not supported.
            return null
        }
        if (node.operator === "void") {
            return { value: undefined }
        }

        const arg = getStaticValueR(node.argument, initialScope);
        if (arg != null) {
            switch (node.operator) {
                case "-":
                    return { value: -(/** @type {any} */ (arg.value)) }
                case "+":
                    return { value: +(/** @type {any} */ (arg.value)) } //eslint-disable-line no-implicit-coercion
                case "!":
                    return { value: !arg.value }
                case "~":
                    return { value: ~(/** @type {any} */ (arg.value)) }
                case "typeof":
                    return { value: typeof arg.value }

                // no default
            }
        }

        return null
    },
    TSAsExpression(node, initialScope) {
        return getStaticValueR(node.expression, initialScope)
    },
    TSSatisfiesExpression(node, initialScope) {
        return getStaticValueR(node.expression, initialScope)
    },
    TSTypeAssertion(node, initialScope) {
        return getStaticValueR(node.expression, initialScope)
    },
    TSNonNullExpression(node, initialScope) {
        return getStaticValueR(node.expression, initialScope)
    },
    TSInstantiationExpression(node, initialScope) {
        return getStaticValueR(node.expression, initialScope)
    },
});

/**
 * Get the value of a given node if it's a static value.
 * @param {Node|TSESTreeNode|null|undefined} node The node to get.
 * @param {Scope|undefined|null} initialScope The scope to start finding variable.
 * @returns {StaticValue|null} The static value of the node, or `null`.
 */
function getStaticValueR(node, initialScope) {
    if (node != null && Object.hasOwnProperty.call(operations, node.type)) {
        return /** @type {VisitorCallback<any>} */ (operations[node.type])(
            /** @type {TSESTreeNode} */ (node),
            initialScope,
        )
    }
    return null
}

/**
 * Get the static value of property name from a MemberExpression node or a Property node.
 * @param {MemberExpression|Property} node The node to get.
 * @param {Scope|null} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.
 * @returns {StaticValue|null} The static value of the property name of the node, or `null`.
 */
function getStaticPropertyNameValue(node, initialScope) {
    const nameNode = node.type === "Property" ? node.key : node.property;

    if (node.computed) {
        return getStaticValueR(nameNode, initialScope)
    }

    if (nameNode.type === "Identifier") {
        return { value: nameNode.name }
    }

    if (nameNode.type === "Literal") {
        if (/** @type {Partial<BigIntLiteral>} */ (nameNode).bigint) {
            return { value: /** @type {BigIntLiteral} */ (nameNode).bigint }
        }
        return { value: String(nameNode.value) }
    }

    return null
}

/**
 * Get the value of a given node if it's a static value.
 * @param {Node} node The node to get.
 * @param {Scope|null} [initialScope] The scope to start finding variable. Optional. If this scope was given, this tries to resolve identifier references which are in the given node as much as possible.
 * @returns {StaticValue | null} The static value of the node, or `null`.
 */
function getStaticValue(node, initialScope = null) {
    try {
        return getStaticValueR(node, initialScope)
    } catch (_error) {
        return null
    }
}

/** @typedef {import("eslint").Scope.Scope} Scope */
/** @typedef {import("estree").Node} Node */
/** @typedef {import("estree").RegExpLiteral} RegExpLiteral */
/** @typedef {import("estree").BigIntLiteral} BigIntLiteral */
/** @typedef {import("estree").SimpleLiteral} SimpleLiteral */

/**
 * Get the value of a given node if it's a literal or a template literal.
 * @param {Node} node The node to get.
 * @param {Scope|null} [initialScope] The scope to start finding variable. Optional. If the node is an Identifier node and this scope was given, this checks the variable of the identifier, and returns the value of it if the variable is a constant.
 * @returns {string|null} The value of the node, or `null`.
 */
function getStringIfConstant(node, initialScope = null) {
    // Handle the literals that the platform doesn't support natively.
    if (node && node.type === "Literal" && node.value === null) {
        const literal =
            /** @type {Partial<SimpleLiteral> & Partial<RegExpLiteral> & Partial<BigIntLiteral>} */ (
                node
            );
        if (literal.regex) {
            return `/${literal.regex.pattern}/${literal.regex.flags}`
        }
        if (literal.bigint) {
            return literal.bigint
        }
    }

    const evaluated = getStaticValue(node, initialScope);

    if (evaluated) {
        // `String(Symbol.prototype)` throws error
        try {
            return String(evaluated.value)
        } catch {
            // No op
        }
    }

    return null
}

/** @typedef {import("eslint").Scope.Scope} Scope */
/** @typedef {import("estree").MemberExpression} MemberExpression */
/** @typedef {import("estree").MethodDefinition} MethodDefinition */
/** @typedef {import("estree").Property} Property */
/** @typedef {import("estree").PropertyDefinition} PropertyDefinition */
/** @typedef {import("estree").Identifier} Identifier */

/**
 * Get the property name from a MemberExpression node or a Property node.
 * @param {MemberExpression | MethodDefinition | Property | PropertyDefinition} node The node to get.
 * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.
 * @returns {string|null|undefined} The property name of the node.
 */
function getPropertyName(node, initialScope) {
    switch (node.type) {
        case "MemberExpression":
            if (node.computed) {
                return getStringIfConstant(node.property, initialScope)
            }
            if (node.property.type === "PrivateIdentifier") {
                return null
            }
            return /** @type {Partial<Identifier>} */ (node.property).name

        case "Property":
        case "MethodDefinition":
        case "PropertyDefinition":
            if (node.computed) {
                return getStringIfConstant(node.key, initialScope)
            }
            if (node.key.type === "Literal") {
                return String(node.key.value)
            }
            if (node.key.type === "PrivateIdentifier") {
                return null
            }
            return /** @type {Partial<Identifier>} */ (node.key).name
    }

    return null
}

/** @typedef {import("eslint").Rule.Node} RuleNode */
/** @typedef {import("eslint").SourceCode} SourceCode */
/** @typedef {import("estree").Function} FunctionNode */
/** @typedef {import("estree").FunctionDeclaration} FunctionDeclaration */
/** @typedef {import("estree").FunctionExpression} FunctionExpression */
/** @typedef {import("estree").Identifier} Identifier */

/**
 * Get the name and kind of the given function node.
 * @param {FunctionNode} node - The function node to get.
 * @param {SourceCode} [sourceCode] The source code object to get the code of computed property keys.
 * @returns {string} The name and kind of the function node.
 */
// eslint-disable-next-line complexity
function getFunctionNameWithKind(node, sourceCode) {
    const parent = /** @type {RuleNode} */ (node).parent;

    if (!parent) {
        return ""
    }

    const tokens = [];
    const isObjectMethod = parent.type === "Property" && parent.value === node;
    const isClassMethod =
        parent.type === "MethodDefinition" && parent.value === node;
    const isClassFieldMethod =
        parent.type === "PropertyDefinition" && parent.value === node;

    // Modifiers.
    if (isClassMethod || isClassFieldMethod) {
        if (parent.static) {
            tokens.push("static");
        }
        if (parent.key.type === "PrivateIdentifier") {
            tokens.push("private");
        }
    }
    if (node.async) {
        tokens.push("async");
    }
    if (node.generator) {
        tokens.push("generator");
    }

    // Kinds.
    if (isObjectMethod || isClassMethod) {
        if (parent.kind === "constructor") {
            return "constructor"
        }
        if (parent.kind === "get") {
            tokens.push("getter");
        } else if (parent.kind === "set") {
            tokens.push("setter");
        } else {
            tokens.push("method");
        }
    } else if (isClassFieldMethod) {
        tokens.push("method");
    } else {
        if (node.type === "ArrowFunctionExpression") {
            tokens.push("arrow");
        }
        tokens.push("function");
    }

    // Names.
    if (isObjectMethod || isClassMethod || isClassFieldMethod) {
        if (parent.key.type === "PrivateIdentifier") {
            tokens.push(`#${parent.key.name}`);
        } else {
            const name = getPropertyName(parent);
            if (name) {
                tokens.push(`'${name}'`);
            } else if (sourceCode) {
                const keyText = sourceCode.getText(parent.key);
                if (!keyText.includes("\n")) {
                    tokens.push(`[${keyText}]`);
                }
            }
        }
    } else if (hasId(node)) {
        tokens.push(`'${node.id.name}'`);
    } else if (
        parent.type === "VariableDeclarator" &&
        parent.id &&
        parent.id.type === "Identifier"
    ) {
        tokens.push(`'${parent.id.name}'`);
    } else if (
        (parent.type === "AssignmentExpression" ||
            parent.type === "AssignmentPattern") &&
        parent.left &&
        parent.left.type === "Identifier"
    ) {
        tokens.push(`'${parent.left.name}'`);
    } else if (
        parent.type === "ExportDefaultDeclaration" &&
        parent.declaration === node
    ) {
        tokens.push("'default'");
    }

    return tokens.join(" ")
}

/**
 * @param {FunctionNode} node
 * @returns {node is FunctionDeclaration | FunctionExpression & { id: Identifier }}
 */
function hasId(node) {
    return Boolean(
        /** @type {Partial<FunctionDeclaration | FunctionExpression>} */ (node)
            .id,
    )
}

/** @typedef {import("estree").Node} Node */
/** @typedef {import("eslint").SourceCode} SourceCode */
/** @typedef {import("./types.mjs").HasSideEffectOptions} HasSideEffectOptions */
/** @typedef {import("estree").BinaryExpression} BinaryExpression */
/** @typedef {import("estree").MemberExpression} MemberExpression */
/** @typedef {import("estree").MethodDefinition} MethodDefinition */
/** @typedef {import("estree").Property} Property */
/** @typedef {import("estree").PropertyDefinition} PropertyDefinition */
/** @typedef {import("estree").UnaryExpression} UnaryExpression */

const typeConversionBinaryOps = Object.freeze(
    new Set([
        "==",
        "!=",
        "<",
        "<=",
        ">",
        ">=",
        "<<",
        ">>",
        ">>>",
        "+",
        "-",
        "*",
        "/",
        "%",
        "|",
        "^",
        "&",
        "in",
    ]),
);
const typeConversionUnaryOps = Object.freeze(new Set(["-", "+", "!", "~"]));

/**
 * Check whether the given value is an ASTNode or not.
 * @param {any} x The value to check.
 * @returns {x is Node} `true` if the value is an ASTNode.
 */
function isNode(x) {
    return x !== null && typeof x === "object" && typeof x.type === "string"
}

const visitor = Object.freeze(
    Object.assign(Object.create(null), {
        /**
         * @param {Node} node
         * @param {HasSideEffectOptions} options
         * @param {Record<string, string[]>} visitorKeys
         */
        $visit(node, options, visitorKeys) {
            const { type } = node;

            if (typeof (/** @type {any} */ (this)[type]) === "function") {
                return /** @type {any} */ (this)[type](
                    node,
                    options,
                    visitorKeys,
                )
            }

            return this.$visitChildren(node, options, visitorKeys)
        },

        /**
         * @param {Node} node
         * @param {HasSideEffectOptions} options
         * @param {Record<string, string[]>} visitorKeys
         */
        $visitChildren(node, options, visitorKeys) {
            const { type } = node;

            for (const key of /** @type {(keyof Node)[]} */ (
                visitorKeys[type] || getKeys(node)
            )) {
                const value = node[key];

                if (Array.isArray(value)) {
                    for (const element of value) {
                        if (
                            isNode(element) &&
                            this.$visit(element, options, visitorKeys)
                        ) {
                            return true
                        }
                    }
                } else if (
                    isNode(value) &&
                    this.$visit(value, options, visitorKeys)
                ) {
                    return true
                }
            }

            return false
        },

        ArrowFunctionExpression() {
            return false
        },
        AssignmentExpression() {
            return true
        },
        AwaitExpression() {
            return true
        },
        /**
         * @param {BinaryExpression} node
         * @param {HasSideEffectOptions} options
         * @param {Record<string, string[]>} visitorKeys
         */
        BinaryExpression(node, options, visitorKeys) {
            if (
                options.considerImplicitTypeConversion &&
                typeConversionBinaryOps.has(node.operator) &&
                (node.left.type !== "Literal" || node.right.type !== "Literal")
            ) {
                return true
            }
            return this.$visitChildren(node, options, visitorKeys)
        },
        CallExpression() {
            return true
        },
        FunctionExpression() {
            return false
        },
        ImportExpression() {
            return true
        },
        /**
         * @param {MemberExpression} node
         * @param {HasSideEffectOptions} options
         * @param {Record<string, string[]>} visitorKeys
         */
        MemberExpression(node, options, visitorKeys) {
            if (options.considerGetters) {
                return true
            }
            if (
                options.considerImplicitTypeConversion &&
                node.computed &&
                node.property.type !== "Literal"
            ) {
                return true
            }
            return this.$visitChildren(node, options, visitorKeys)
        },
        /**
         * @param {MethodDefinition} node
         * @param {HasSideEffectOptions} options
         * @param {Record<string, string[]>} visitorKeys
         */
        MethodDefinition(node, options, visitorKeys) {
            if (
                options.considerImplicitTypeConversion &&
                node.computed &&
                node.key.type !== "Literal"
            ) {
                return true
            }
            return this.$visitChildren(node, options, visitorKeys)
        },
        NewExpression() {
            return true
        },
        /**
         * @param {Property} node
         * @param {HasSideEffectOptions} options
         * @param {Record<string, string[]>} visitorKeys
         */
        Property(node, options, visitorKeys) {
            if (
                options.considerImplicitTypeConversion &&
                node.computed &&
                node.key.type !== "Literal"
            ) {
                return true
            }
            return this.$visitChildren(node, options, visitorKeys)
        },
        /**
         * @param {PropertyDefinition} node
         * @param {HasSideEffectOptions} options
         * @param {Record<string, string[]>} visitorKeys
         */
        PropertyDefinition(node, options, visitorKeys) {
            if (
                options.considerImplicitTypeConversion &&
                node.computed &&
                node.key.type !== "Literal"
            ) {
                return true
            }
            return this.$visitChildren(node, options, visitorKeys)
        },
        /**
         * @param {UnaryExpression} node
         * @param {HasSideEffectOptions} options
         * @param {Record<string, string[]>} visitorKeys
         */
        UnaryExpression(node, options, visitorKeys) {
            if (node.operator === "delete") {
                return true
            }
            if (
                options.considerImplicitTypeConversion &&
                typeConversionUnaryOps.has(node.operator) &&
                node.argument.type !== "Literal"
            ) {
                return true
            }
            return this.$visitChildren(node, options, visitorKeys)
        },
        UpdateExpression() {
            return true
        },
        YieldExpression() {
            return true
        },
    }),
);

/**
 * Check whether a given node has any side effect or not.
 * @param {Node} node The node to get.
 * @param {SourceCode} sourceCode The source code object.
 * @param {HasSideEffectOptions} [options] The option object.
 * @returns {boolean} `true` if the node has a certain side effect.
 */
function hasSideEffect(node, sourceCode, options = {}) {
    const { considerGetters = false, considerImplicitTypeConversion = false } =
        options;
    return visitor.$visit(
        node,
        { considerGetters, considerImplicitTypeConversion },
        sourceCode.visitorKeys || KEYS,
    )
}

/** @typedef {import("estree").Node} Node */
/** @typedef {import("@typescript-eslint/types").TSESTree.NewExpression} TSNewExpression */
/** @typedef {import("@typescript-eslint/types").TSESTree.CallExpression} TSCallExpression */
/** @typedef {import("eslint").SourceCode} SourceCode */
/** @typedef {import("eslint").AST.Token} Token */
/** @typedef {import("eslint").Rule.Node} RuleNode */

/**
 * Get the left parenthesis of the parent node syntax if it exists.
 * E.g., `if (a) {}` then the `(`.
 * @param {Node} node The AST node to check.
 * @param {SourceCode} sourceCode The source code object to get tokens.
 * @returns {Token|null} The left parenthesis of the parent node syntax
 */
// eslint-disable-next-line complexity
function getParentSyntaxParen(node, sourceCode) {
    const parent = /** @type {RuleNode} */ (node).parent;

    if (!parent) {
        return null
    }

    switch (parent.type) {
        case "CallExpression":
        case "NewExpression":
            if (parent.arguments.length === 1 && parent.arguments[0] === node) {
                return sourceCode.getTokenAfter(
                    // @ts-expect-error https://github.com/typescript-eslint/typescript-eslint/pull/5384
                    parent.typeArguments ||
                        /** @type {RuleNode} */ (
                            /** @type {unknown} */ (
                                /** @type {TSNewExpression | TSCallExpression} */ (
                                    parent
                                ).typeParameters
                            )
                        ) ||
                        parent.callee,
                    isOpeningParenToken,
                )
            }
            return null

        case "DoWhileStatement":
            if (parent.test === node) {
                return sourceCode.getTokenAfter(
                    parent.body,
                    isOpeningParenToken,
                )
            }
            return null

        case "IfStatement":
        case "WhileStatement":
            if (parent.test === node) {
                return sourceCode.getFirstToken(parent, 1)
            }
            return null

        case "ImportExpression":
            if (parent.source === node) {
                return sourceCode.getFirstToken(parent, 1)
            }
            return null

        case "SwitchStatement":
            if (parent.discriminant === node) {
                return sourceCode.getFirstToken(parent, 1)
            }
            return null

        case "WithStatement":
            if (parent.object === node) {
                return sourceCode.getFirstToken(parent, 1)
            }
            return null

        default:
            return null
    }
}

/**
 * Check whether a given node is parenthesized or not.
 * @param {number} times The number of parantheses.
 * @param {Node} node The AST node to check.
 * @param {SourceCode} sourceCode The source code object to get tokens.
 * @returns {boolean} `true` if the node is parenthesized the given times.
 */
/**
 * Check whether a given node is parenthesized or not.
 * @param {Node} node The AST node to check.
 * @param {SourceCode} sourceCode The source code object to get tokens.
 * @returns {boolean} `true` if the node is parenthesized.
 */
/**
 * Check whether a given node is parenthesized or not.
 * @param {Node|number} timesOrNode The first parameter.
 * @param {Node|SourceCode} nodeOrSourceCode The second parameter.
 * @param {SourceCode} [optionalSourceCode] The third parameter.
 * @returns {boolean} `true` if the node is parenthesized.
 */
function isParenthesized(
    timesOrNode,
    nodeOrSourceCode,
    optionalSourceCode,
) {
    /** @type {number} */
    let times,
        /** @type {RuleNode} */
        node,
        /** @type {SourceCode} */
        sourceCode,
        maybeLeftParen,
        maybeRightParen;
    if (typeof timesOrNode === "number") {
        times = timesOrNode | 0;
        node = /** @type {RuleNode} */ (nodeOrSourceCode);
        sourceCode = /** @type {SourceCode} */ (optionalSourceCode);
        if (!(times >= 1)) {
            throw new TypeError("'times' should be a positive integer.")
        }
    } else {
        times = 1;
        node = /** @type {RuleNode} */ (timesOrNode);
        sourceCode = /** @type {SourceCode} */ (nodeOrSourceCode);
    }

    if (
        node == null ||
        // `Program` can't be parenthesized
        node.parent == null ||
        // `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}`
        (node.parent.type === "CatchClause" && node.parent.param === node)
    ) {
        return false
    }

    maybeLeftParen = maybeRightParen = node;
    do {
        maybeLeftParen = sourceCode.getTokenBefore(maybeLeftParen);
        maybeRightParen = sourceCode.getTokenAfter(maybeRightParen);
    } while (
        maybeLeftParen != null &&
        maybeRightParen != null &&
        isOpeningParenToken(maybeLeftParen) &&
        isClosingParenToken(maybeRightParen) &&
        // Avoid false positive such as `if (a) {}`
        maybeLeftParen !== getParentSyntaxParen(node, sourceCode) &&
        --times > 0
    )

    return times === 0
}

/**
 * @author Toru Nagashima <https://github.com/mysticatea>
 * See LICENSE file in root directory for full license.
 */

const placeholder = /\$(?:[$&`']|[1-9][0-9]?)/gu;

/** @type {WeakMap<PatternMatcher, {pattern:RegExp,escaped:boolean}>} */
const internal = new WeakMap();

/**
 * Check whether a given character is escaped or not.
 * @param {string} str The string to check.
 * @param {number} index The location of the character to check.
 * @returns {boolean} `true` if the character is escaped.
 */
function isEscaped(str, index) {
    let escaped = false;
    for (let i = index - 1; i >= 0 && str.charCodeAt(i) === 0x5c; --i) {
        escaped = !escaped;
    }
    return escaped
}

/**
 * Replace a given string by a given matcher.
 * @param {PatternMatcher} matcher The pattern matcher.
 * @param {string} str The string to be replaced.
 * @param {string} replacement The new substring to replace each matched part.
 * @returns {string} The replaced string.
 */
function replaceS(matcher, str, replacement) {
    const chunks = [];
    let index = 0;

    /**
     * @param {string} key The placeholder.
     * @param {RegExpExecArray} match The matched information.
     * @returns {string} The replaced string.
     */
    function replacer(key, match) {
        switch (key) {
            case "$$":
                return "$"
            case "$&":
                return match[0]
            case "$`":
                return str.slice(0, match.index)
            case "$'":
                return str.slice(match.index + match[0].length)
            default: {
                const i = key.slice(1);
                if (i in match) {
                    return match[/** @type {any} */ (i)]
                }
                return key
            }
        }
    }

    for (const match of matcher.execAll(str)) {
        chunks.push(str.slice(index, match.index));
        chunks.push(
            replacement.replace(placeholder, (key) => replacer(key, match)),
        );
        index = match.index + match[0].length;
    }
    chunks.push(str.slice(index));

    return chunks.join("")
}

/**
 * Replace a given string by a given matcher.
 * @param {PatternMatcher} matcher The pattern matcher.
 * @param {string} str The string to be replaced.
 * @param {(substring: string, ...args: any[]) => string} replace The function to replace each matched part.
 * @returns {string} The replaced string.
 */
function replaceF(matcher, str, replace) {
    const chunks = [];
    let index = 0;

    for (const match of matcher.execAll(str)) {
        chunks.push(str.slice(index, match.index));
        chunks.push(
            String(
                replace(
                    .../** @type {[string, ...string[]]} */ (
                        /** @type {string[]} */ (match)
                    ),
                    match.index,
                    match.input,
                ),
            ),
        );
        index = match.index + match[0].length;
    }
    chunks.push(str.slice(index));

    return chunks.join("")
}

/**
 * The class to find patterns as considering escape sequences.
 */
class PatternMatcher {
    /**
     * Initialize this matcher.
     * @param {RegExp} pattern The pattern to match.
     * @param {{escaped?:boolean}} [options] The options.
     */
    constructor(pattern, options = {}) {
        const { escaped = false } = options;
        if (!(pattern instanceof RegExp)) {
            throw new TypeError("'pattern' should be a RegExp instance.")
        }
        if (!pattern.flags.includes("g")) {
            throw new Error("'pattern' should contains 'g' flag.")
        }

        internal.set(this, {
            pattern: new RegExp(pattern.source, pattern.flags),
            escaped: Boolean(escaped),
        });
    }

    /**
     * Find the pattern in a given string.
     * @param {string} str The string to find.
     * @returns {IterableIterator<RegExpExecArray>} The iterator which iterate the matched information.
     */
    *execAll(str) {
        const { pattern, escaped } =
            /** @type {{pattern:RegExp,escaped:boolean}} */ (internal.get(this));
        let match = null;
        let lastIndex = 0;

        pattern.lastIndex = 0;
        while ((match = pattern.exec(str)) != null) {
            if (escaped || !isEscaped(str, match.index)) {
                lastIndex = pattern.lastIndex;
                yield match;
                pattern.lastIndex = lastIndex;
            }
        }
    }

    /**
     * Check whether the pattern is found in a given string.
     * @param {string} str The string to check.
     * @returns {boolean} `true` if the pattern was found in the string.
     */
    test(str) {
        const it = this.execAll(str);
        const ret = it.next();
        return !ret.done
    }

    /**
     * Replace a given string.
     * @param {string} str The string to be replaced.
     * @param {(string|((...strs:string[])=>string))} replacer The string or function to replace. This is the same as the 2nd argument of `String.prototype.replace`.
     * @returns {string} The replaced string.
     */
    [Symbol.replace](str, replacer) {
        reTJturn typeof replacer === "function"
            ? replaceF(this, String(str), replacer)
            : replaceS(this, String(str), String(replacer))
    }
}

/** @typedef {import("eslint").Scope.Scope} Scope */
/** @typedef {import("eslint").Scope.Variable} Variable */
/** @typedef {import("eslint").Rule.Node} RuleNode */
/** @typedef {import("estree").Node} Node */
/** @typedef {import("estree").Expression} Expression */
/** @typedef {import("estree").Pattern} Pattern */
/** @typedef {import("estree").Identifier} Identifier */
/** @typedef {import("estree").SimpleCallExpression} CallExpression */
/** @typedef {import("estree").Program} Program */
/** @typedef {import("estree").ImportDeclaration} ImportDeclaration */
/** @typedef {import("estree").ExportAllDeclaration} ExportAllDeclaration */
/** @typedef {import("estree").ExportDefaultDeclaration} ExportDefaultDeclaration */
/** @typedef {import("estree").ExportNamedDeclaration} ExportNamedDeclaration */
/** @typedef {import("estree").ImportSpecifier} ImportSpecifier */
/** @typedef {import("estree").ImportDefaultSpecifier} ImportDefaultSpecifier */
/** @typedef {import("estree").ImportNamespaceSpecifier} ImportNamespaceSpecifier */
/** @typedef {import("estree").ExportSpecifier} ExportSpecifier */
/** @typedef {import("estree").Property} Property */
/** @typedef {import("estree").AssignmentProperty} AssignmentProperty */
/** @typedef {import("estree").Literal} Literal */
/** @typedef {import("@typescript-eslint/types").TSESTree.Node} TSESTreeNode */
/** @typedef {import("./types.mjs").ReferenceTrackerOptions} ReferenceTrackerOptions */
/**
 * @template T
 * @typedef {import("./types.mjs").TraceMap<T>} TraceMap
 */
/**
 * @template T
 * @typedef {import("./types.mjs").TraceMapObject<T>} TraceMapObject
 */
/**
 * @template T
 * @typedef {import("./types.mjs").TrackedReferences<T>} TrackedReferences
 */

const IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u;

/**
 * Check whether a given node is an import node or not.
 * @param {Node} node
 * @returns {node is ImportDeclaration|ExportAllDeclaration|ExportNamedDeclaration&{source: Literal}} `true` if the node is an import node.
 */
function isHasSource(node) {
    return (
        IMPORT_TYPE.test(node.type) &&
        /** @type {ImportDeclaration|ExportAllDeclaration|ExportNamedDeclaration} */ (
            node
        ).source != null
    )
}
const has =
    /** @type {<T>(traceMap: TraceMap<unknown>, v: T) => v is (string extends T ? string : T)} */ (
        Function.call.bind(Object.hasOwnProperty)
    );

const READ = Symbol("read");
const CALL = Symbol("call");
const CONSTRUCT = Symbol("construct");
const ESM = Symbol("esm");

const requireCall = { require: { [CALL]: true } };

/**
 * Check whether a given variable is modified or not.
 * @param {Variable|undefined} variable The variable to check.
 * @returns {boolean} `true` if the variable is modified.
 */
function isModifiedGlobal(variable) {
    return (
        variable == null ||
        variable.defs.length !== 0 ||
        variable.references.some((r) => r.isWrite())
    )
}

/**
 * Check if the value of a given node is passed through to the parent syntax as-is.
 * For example, `a` and `b` in (`a || b` and `c ? a : b`) are passed through.
 * @param {Node} node A node to check.
 * @returns {node is RuleNode & {parent: Expression}} `true` if the node is passed through.
 */
function isPassThrough(node) {
    const parent = /** @type {TSESTreeNode} */ (node).parent;

    if (parent) {
        switch (parent.type) {
            case "ConditionalExpression":
                return parent.consequent === node || parent.alternate === node
            case "LogicalExpression":
                return true
            case "SequenceExpression":
                return (
                    parent.expressions[parent.expressions.length - 1] === node
                )
            case "ChainExpression":
                return true
            case "TSAsExpression":
            case "TSSatisfiesExpression":
            case "TSTypeAssertion":
            case "TSNonNullExpression":
            case "TSInstantiationExpression":
                return true

            default:
                return false
        }
    }
    return false
}

/**
 * The reference tracker.
 */
class ReferenceTracker {
    /**
     * Initialize this tracker.
     * @param {Scope} globalScope The global scope.
     * @param {object} [options] The options.
     * @param {"legacy"|"strict"} [options.mode="strict"] The mode to determine the ImportDeclaration's behavior for CJS modules.
     * @param {string[]} [options.globalObjectNames=["global","globalThis","self","window"]] The variable names for Global Object.
     */
    constructor(globalScope, options = {}) {
        const {
            mode = "strict",
            globalObjectNames = ["global", "globalThis", "self", "window"],
        } = options;
        /** @private @type {Variable[]} */
        this.variableStack = [];
        /** @private */
        this.globalScope = globalScope;
        /** @private */
        this.mode = mode;
        /** @private */
        this.globalObjectNames = globalObjectNames.slice(0);
    }

    /**
     * Iterate the references of global variables.
     * @template T
     * @param {TraceMap<T>} traceMap The trace map.
     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.
     */
    *iterateGlobalReferences(traceMap) {
        for (const key of Object.keys(traceMap)) {
            const nextTraceMap = traceMap[key];
            const path = [key];
            const variable = this.globalScope.set.get(key);

            if (isModifiedGlobal(variable)) {
                continue
            }

            yield* this._iterateVariableReferences(
                /** @type {Variable} */ (variable),
                path,
                nextTraceMap,
                true,
            );
        }

        for (const key of this.globalObjectNames) {
            /** @type {string[]} */
            const path = [];
            const variable = this.globalScope.set.get(key);

            if (isModifiedGlobal(variable)) {
                continue
            }

            yield* this._iterateVariableReferences(
                /** @type {Variable} */ (variable),
                path,
                traceMap,
                false,
            );
        }
    }

    /**
     * Iterate the references of CommonJS modules.
     * @template T
     * @param {TraceMap<T>} traceMap The trace map.
     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.
     */
    *iterateCjsReferences(traceMap) {
        for (const { node } of this.iterateGlobalReferences(requireCall)) {
            const key = getStringIfConstant(
                /** @type {CallExpression} */ (node).arguments[0],
            );
            if (key == null || !has(traceMap, key)) {
                continue
            }

            const nextTraceMap = traceMap[key];
            const path = [key];

            if (nextTraceMap[READ]) {
                yield {
                    node,
                    path,
                    type: READ,
                    info: nextTraceMap[READ],
                };
            }
            yield* this._iteratePropertyReferences(
                /** @type {CallExpression} */ (node),
                path,
                nextTraceMap,
            );
        }
    }

    /**
     * Iterate the references of ES modules.
     * @template T
     * @param {TraceMap<T>} traceMap The trace map.
     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.
     */
    *iterateEsmReferences(traceMap) {
        const programNode = /** @type {Program} */ (this.globalScope.block);

        for (const node of programNode.body) {
            if (!isHasSource(node)) {
                continue
            }
            const moduleId = /** @type {string} */ (node.source.value);

            if (!has(traceMap, moduleId)) {
                continue
            }
            const nextTraceMap = traceMap[moduleId];
            const path = [moduleId];

            if (nextTraceMap[READ]) {
                yield {
                    // eslint-disable-next-line object-shorthand -- apply type
                    node: /** @type {RuleNode} */ (node),
                    path,
                    type: READ,
                    info: nextTraceMap[READ],
                };
            }

            if (node.type === "ExportAllDeclaration") {
                for (const key of Object.keys(nextTraceMap)) {
                    const exportTraceMap = nextTraceMap[key];
                    if (exportTraceMap[READ]) {
                        yield {
                            // eslint-disable-next-line object-shorthand -- apply type
                            node: /** @type {RuleNode} */ (node),
                            path: path.concat(key),
                            type: READ,
                            info: exportTraceMap[READ],
                        };
                    }
                }
            } else {
                for (const specifier of node.specifiers) {
                    const esm = has(nextTraceMap, ESM);
                    const it = this._iterateImportReferences(
                        specifier,
                        path,
                        esm
                            ? nextTraceMap
                            : this.mode === "legacy"
                            ? { default: nextTraceMap, ...nextTraceMap }
                            : { default: nextTraceMap },
                    );

                    if (esm) {
                        yield* it;
                    } else {
                        for (const report of it) {
                            report.path = report.path.filter(exceptDefault);
                            if (
                                report.path.length >= 2 ||
                                report.type !== READ
                            ) {
                                yield report;
                            }
                        }
                    }
                }
            }
        }
    }

    /**
     * Iterate the property references for a given expression AST node.
     * @template T
     * @param {Expression} node The expression AST node to iterate property references.
     * @param {TraceMap<T>} traceMap The trace map.
     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate property references.
     */
    *iteratePropertyReferences(node, traceMap) {
        yield* this._iteratePropertyReferences(node, [], traceMap);
    }

    /**
     * Iterate the references for a given variable.
     * @private
     * @template T
     * @param {Variable} variable The variable to iterate that references.
     * @param {string[]} path The current path.
     * @param {TraceMapObject<T>} traceMap The trace map.
     * @param {boolean} shouldReport = The flag to report those references.
     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.
     */
    *_iterateVariableReferences(variable, path, traceMap, shouldReport) {
        if (this.variableStack.includes(variable)) {
            return
        }
        this.variableStack.push(variable);
        try {
            for (const reference of variable.references) {
                if (!reference.isRead()) {
                    continue
                }
                const node = /** @type {RuleNode & Identifier} */ (
                    reference.identifier
                );

                if (shouldReport && traceMap[READ]) {
                    yield { node, path, type: READ, info: traceMap[READ] };
                }
                yield* this._iteratePropertyReferences(node, path, traceMap);
            }
        } finally {
            this.variableStack.pop();
        }
    }

    /**
     * Iterate the references for a given AST node.
     * @private
     * @template T
     * @param {Expression} rootNode The AST node to iterate references.
     * @param {string[]} path The current path.
     * @param {TraceMapObject<T>} traceMap The trace map.
     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.
     */
    //eslint-disable-next-line complexity
    *_iteratePropertyReferences(rootNode, path, traceMap) {
        let node = rootNode;
        while (isPassThrough(node)) {
            node = node.parent;
        }

        const parent = /** @type {RuleNode} */ (node).parent;
        if (!parent) {
            return
        }
        if (parent.type === "MemberExpression") {
            if (parent.object === node) {
                const key = getPropertyName(parent);
                if (key == null || !has(traceMap, key)) {
                    return
                }

                path = path.concat(key); //eslint-disable-line no-param-reassign
                const nextTraceMap = traceMap[key];
                if (nextTraceMap[READ]) {
                    yield {
                        node: parent,
                        path,
                        type: READ,
                        info: nextTraceMap[READ],
                    };
                }
                yield* this._iteratePropertyReferences(
                    parent,
                    path,
                    nextTraceMap,
                );
            }
            return
        }
        if (parent.type === "CallExpression") {
            if (parent.callee === node && traceMap[CALL]) {
                yield { node: parent, path, type: CALL, info: traceMap[CALL] };
            }
            return
        }
        if (parent.type === "NewExpression") {
            if (parent.callee === node && traceMap[CONSTRUCT]) {
                yield {
                    node: parent,
                    path,
                    type: CONSTRUCT,
                    info: traceMap[CONSTRUCT],
                };
            }
            return
        }
        if (parent.type === "AssignmentExpression") {
            if (parent.right === node) {
                yield* this._iterateLhsReferences(parent.left, path, traceMap);
                yield* this._iteratePropertyReferences(parent, path, traceMap);
            }
            return
        }
        if (parent.type === "AssignmentPattern") {
            if (parent.right === node) {
                yield* this._iterateLhsReferences(parent.left, path, traceMap);
            }
            return
        }
        if (parent.type === "VariableDeclarator") {
            if (parent.init === node) {
                yield* this._iterateLhsReferences(parent.id, path, traceMap);
            }
        }
    }

    /**
     * Iterate the references for a given Pattern node.
     * @private
     * @template T
     * @param {Pattern} patternNode The Pattern node to iterate references.
     * @param {string[]} path The current path.
     * @param {TraceMapObject<T>} traceMap The trace map.
     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.
     */
    *_iterateLhsReferences(patternNode, path, traceMap) {
        if (patternNode.type === "Identifier") {
            const variable = findVariable(this.globalScope, patternNode);
            if (variable != null) {
                yield* this._iterateVariableReferences(
                    variable,
                    path,
                    traceMap,
                    false,
                );
            }
            return
        }
        if (patternNode.type === "ObjectPattern") {
            for (const property of patternNode.properties) {
                const key = getPropertyName(
                    /** @type {AssignmentProperty} */ (property),
                );

                if (key == null || !has(traceMap, key)) {
                    continue
                }

                const nextPath = path.concat(key);
                const nextTraceMap = traceMap[key];
                if (nextTraceMap[READ]) {
                    yield {
                        node: /** @type {RuleNode} */ (property),
                        path: nextPath,
                        type: READ,
                        info: nextTraceMap[READ],
                    };
                }
                yield* this._iterateLhsReferences(
                    /** @type {AssignmentProperty} */ (property).value,
                    nextPath,
                    nextTraceMap,
                );
            }
            return
        }
        if (patternNode.type === "AssignmentPattern") {
            yield* this._iterateLhsReferences(patternNode.left, path, traceMap);
        }
    }

    /**
     * Iterate the references for a given ModuleSpecifier node.
     * @private
     * @template T
     * @param {ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier} specifierNode The ModuleSpecifier node to iterate references.
     * @param {string[]} path The current path.
     * @param {TraceMapObject<T>} traceMap The trace map.
     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.
     */
    *_iterateImportReferences(specifierNode, path, traceMap) {
        const type = specifierNode.type;

        if (type === "ImportSpecifier" || type === "ImportDefaultSpecifier") {
            const key =
                type === "ImportDefaultSpecifier"
                    ? "default"
                    : specifierNode.imported.type === "Identifier"
                    ? specifierNode.imported.name
                    : specifierNode.imported.value;
            if (!has(traceMap, key)) {
                return
            }

            path = path.concat(key); //eslint-disable-line no-param-reassign
            const nextTraceMap = traceMap[key];
            if (nextTraceMap[READ]) {
                yield {
                    node: /** @type {RuleNode} */ (specifierNode),
                    path,
                    type: READ,
                    info: nextTraceMap[READ],
                };
            }
            yield* this._iterateVariableReferences(
                /** @type {Variable} */ (
                    findVariable(this.globalScope, specifierNode.local)
                ),
                path,
                nextTraceMap,
                false,
            );

            return
        }

        if (type === "ImportNamespaceSpecifier") {
            yield* this._iterateVariableReferences(
                /** @type {Variable} */ (
                    findVariable(this.globalScope, specifierNode.local)
                ),
                path,
                traceMap,
                false,
            );
            return
        }

        if (type === "ExportSpecifier") {
            const key =
                specifierNode.local.type === "Identifier"
                    ? specifierNode.local.name
                    : specifierNode.local.value;
            if (!has(traceMap, key)) {
                return
            }

            path = path.concat(key); //eslint-disable-line no-param-reassign
            const nextTraceMap = traceMap[key];
            if (nextTraceMap[READ]) {
                yield {
                    node: /** @type {RuleNode} */ (specifierNode),
                    path,
                    type: READ,
                    info: nextTraceMap[READ],
                };
            }
        }
    }
}

ReferenceTracker.READ = READ;
ReferenceTracker.CALL = CALL;
ReferenceTracker.CONSTRUCT = CONSTRUCT;
ReferenceTracker.ESM = ESM;

/**
 * This is a predicate function for Array#filter.
 * @param {string} name A name part.
 * @param {number} index The index of the name.
 * @returns {boolean} `false` if it's default.
 */
function exceptDefault(name, index) {
    return !(index === 1 && name === "default")
}

/** @typedef {import("./types.mjs").StaticValue} StaticValue */

var index = {
    CALL,
    CONSTRUCT,
    ESM,
    findVariable,
    getFunctionHeadLocation,
    getFunctionNameWithKind,
    getInnermostScope,
    getPropertyName,
    getStaticValue,
    getStringIfConstant,
    hasSideEffect,
    isArrowToken,
    isClosingBraceToken,
    isClosingBracketToken,
    isClosingParenToken,
    isColonToken,
    isCommaToken,
    isCommentToken,
    isNotArrowToken,
    isNotClosingBraceToken,
    isNotClosingBracketToken,
    isNotClosingParenToken,
    isNotColonToken,
    isNotCommaToken,
    isNotCommentToken,
    isNotOpeningBraceToken,
    isNotOpeningBracketToken,
    isNotOpeningParenToken,
    isNotSemicolonToken,
    isOpeningBraceToken,
    isOpeningBracketToken,
    isOpeningParenToken,
    isParenthesized,
    isSemicolonToken,
    PatternMatcher,
    READ,
    ReferenceTracker,
};

export { CALL, CONSTRUCT, ESM, PatternMatcher, READ, ReferenceTracker, index as default, findVariable, getFunctionHeadLocation, getFunctionNameWithKind, getInnermostScope, getPropertyName, getStaticValue, getStringIfConstant, hasSideEffect, isArrowToken, isClosingBraceToken, isClosingBracketToken, isClosingParenToken, isColonToken, isCommaToken, isCommentToken, isNotArrowToken, isNotClosingBraceToken, isNotClosingBracketToken, isNotClosingParenToken, isNotColonToken, isNotCommaToken, isNotCommentToken, isNotOpeningBraceToken, isNotOpeningBracketToken, isNotOpeningParenToken, isNotSemicolonToken, isOpeningBraceToken, isOpeningBracketToken, isOpeningParenToken, isParenthesized, isSemicolonToken };
//# sourceMappingURL=index.mjs.map
ښ˛Jx   {"version":3,"file":"index.mjs","sources":["src/get-innermost-scope.mjs","src/find-variable.mjs","src/token-predicate.mjs","src/get-function-head-location.mjs","src/get-static-value.mjs","src/get-string-if-constant.mjs","src/get-property-name.mjs","src/get-function-name-with-kind.mjs","src/has-side-effect.mjs","src/is-parenthesized.mjs","src/pattern-matcher.mjs","src/reference-tracker.mjs","src/index.mjs"],"sourcesContent":["/** @typedef {import(\"eslint\").Scope.Scope} Scope */\n/** @typedef {import(\"estree\").Node} Node */\n\n/**\n * Get the innermost scope which contains a given location.\n * @param {Scope} initialScope The initial scope to search.\n * @param {Node} node The location to search.\n * @returns {Scope} The innermost scope.\n */\nexport function getInnermostScope(initialScope, node) {\n    const location = /** @type {[number, number]} */ (node.range)[0]\n\n    let scope = initialScope\n    let found = false\n    do {\n        found = false\n        for (const childScope of scope.childScopes) {\n            const range = /** @type {[number, number]} */ (\n                childScope.block.range\n            )\n\n            if (range[0] <= location && location < range[1]) {\n                scope = childScope\n                found = true\n                break\n            }\n        }\n    } while (found)\n\n    return scope\n}\n","import { getInnermostScope } from \"./get-innermost-scope.mjs\"\n/** @typedef {import(\"eslint\").Scope.Scope} Scope */\n/** @typedef {import(\"eslint\").Scope.Variable} Variable */\n/** @typedef {import(\"estree\").Identifier} Identifier */\n\n/**\n * Find the variable of a given name.\n * @param {Scope} initialScope The scope to start finding.\n * @param {string|Identifier} nameOrNode The variable name to find. If this is a Node object then it should be an Identifier node.\n * @returns {Variable|null} The found variable or null.\n */\nexport function findVariable(initialScope, nameOrNode) {\n    let name = \"\"\n    /** @type {Scope|null} */\n    let scope = initialScope\n\n    if (typeof nameOrNode === \"string\") {\n        name = nameOrNode\n    } else {\n        name = nameOrNode.name\n        scope = getInnermostScope(scope, nameOrNode)\n    }\n\n    while (scope != null) {\n        const variable = scope.set.get(name)\n        if (variable != null) {\n            return variable\n        }\n        scope = scope.upper\n    }\n\n    return null\n}\n","/** @typedef {import(\"eslint\").AST.Token} Token */\n/** @typedef {import(\"estree\").Comment} Comment */\n/** @typedef {import(\"./types.mjs\").ArrowToken} ArrowToken */\n/** @typedef {import(\"./types.mjs\").CommaToken} CommaToken */\n/** @typedef {import(\"./types.mjs\").SemicolonToken} SemicolonToken */\n/** @typedef {import(\"./types.mjs\").ColonToken} ColonToken */\n/** @typedef {import(\"./types.mjs\").OpeningParenToken} OpeningParenToken */\n/** @typedef {import(\"./types.mjs\").ClosingParenToken} ClosingParenToken */\n/** @typedef {import(\"./types.mjs\").OpeningBracketToken} OpeningBracketToken */\n/** @typedef {import(\"./types.mjs\").ClosingBracketToken} ClosingBracketToken */\n/** @typedef {import(\"./types.mjs\").OpeningBraceToken} OpeningBraceToken */\n/** @typedef {import(\"./types.mjs\").ClosingBraceToken} ClosingBraceToken */\n/**\n * @template {string} Value\n * @typedef {import(\"./types.mjs\").PunctuatorToken<Value>} PunctuatorToken\n */\n\n/** @typedef {Comment | Token} CommentOrToken */\n\n/**\n * Creates the negate function of the given function.\n * @param {function(CommentOrToken):boolean} f - The function to negate.\n * @returns {function(CommentOrToken):boolean} Negated function.\n */\nfunction negate(f) {\n    return (token) => !f(token)\n}\n\n/**\n * Checks if the given token is a PunctuatorToken with the given value\n * @template {string} Value\n * @param {CommentOrToken} token - The token to check.\n * @param {Value} value - The value to check.\n * @returns {token is PunctuatorToken<Value>} `true` if the token is a PunctuatorToken with the given value.\n */\nfunction isPunctuatorTokenWithValue(token, value) {\n    return token.type === \"Punctuator\" && token.value === value\n}\n\n/**\n * Checks if the given token is an arrow token or not.\n * @param {CommentOrToken} token - The token to check.\n * @returns {token is ArrowToken} `true` if the token is an arrow token.\n */\nexport function isArrowToken(token) {\n    return isPunctuatorTokenWithValue(token, \"=>\")\n}\n\n/**\n * Checks if the given token is a comma token or not.\n * @param {CommentOrToken} token - The token to check.\n * @returns {token is CommaToken} `true` if the token is a comma token.\n */\nexport function isCommaToken(token) {\n    return isPunctuatorTokenWithValue(token, \",\")\n}\n\n/**\n * Checks if the given token is a semicolon token or not.\n * @param {CommentOrToken} token - The token to check.\n * @returns {token is SemicolonToken} `true` if the token is a semicolon token.\n */\nexport function isSemicolonToken(token) {\n    return isPunctuatorTokenWithValue(token, \";\")\n}\n\n/**\n * Checks if the given token is a colon token or not.\n * @param {CommentOrToken} token - The token to check.\n * @returns {token is ColonToken} `true` if the token is a colon token.\n */\nexport function isColonToken(token) {\n    return isPunctuatorTokenWithValue(token, \":\")\n}\n\n/**\n * Checks if the given token is an opening parenthesis token or not.\n * @param {CommentOrToken} token - The token to check.\n * @returns {token is OpeningParenToken} `true` if the token is an opening parenthesis token.\n */\nexport function isOpeningParenToken(token) {\n    return isPunctuatorTokenWithValue(token, \"(\")\n}\n\n/**\n * Checks if the given token is a closing parenthesis token or not.\n * @param {CommentOrToken} token - The token to check.\n * @returns {token is ClosingParenToken} `true` if the token is a closing parenthesis token.\n */\nexport function isClosingParenToken(token) {\n    return isPunctuatorTokenWithValue(token, \")\")\n}\n\n/**\n * Checks if the given token is an opening square bracket token or not.\n * @param {CommentOrToken} token - The token to check.\n * @returns {token is OpeningBracketToken} `true` if the token is an opening square bracket token.\n */\nexport function isOpeningBracketToken(token) {\n    return isPunctuatorTokenWithValue(token, \"[\")\n}\n\n/**\n * Checks if the given token is a closing square bracket token or not.\n * @param {CommentOrToken} token - The token to check.\n * @returns {token is ClosingBracketToken} `true` if the token is a closing square bracket token.\n */\nexport function isClosingBracketToken(token) {\n    return isPunctuatorTokenWithValue(token, \"]\")\n}\n\n/**\n * Checks if the given token is an opening brace token or not.\n * @param {CommentOrToken} token - The token to check.\n * @returns {token is OpeningBraceToken} `true` if the token is an opening brace token.\n */\nexport function isOpeningBraceToken(token) {\n    return isPunctuatorTokenWithValue(token, \"{\")\n}\n\n/**\n * Checks if the given token is a closing brace token or not.\n * @param {CommentOrToken} token - The token to check.\n * @returns {token is ClosingBraceToken} `true` if the token is a closing brace token.\n */\nexport function isClosingBraceToken(token) {\n    return isPunctuatorTokenWithValue(token, \"}\")\n}\n\n/**\n * Checks if the given token is a comment token or not.\n * @param {CommentOrToken} token - The token to check.\n * @returns {token is Comment} `true` if the token is a comment token.\n */\nexport function isCommentToken(token) {\n    return [\"Block\", \"Line\", \"Shebang\"].includes(token.type)\n}\n\nexport const isNotArrowToken = negate(isArrowToken)\nexport const isNotCommaToken = negate(isCommaToken)\nexport const isNotSemicolonToken = negate(isSemicolonToken)\nexport const isNotColonToken = negate(isColonToken)\nexport const isNotOpeningParenToken = negate(isOpeningParenToken)\nexport const isNotClosingParenToken = negate(isClosingParenToken)\nexport const isNotOpeningBracketToken = negate(isOpeningBracketToken)\nexport const isNotClosingBracketToken = negate(isClosingBracketToken)\nexport const isNotOpeningBraceToken = negate(isOpeningBraceToken)\nexport const isNotClosingBraceToken = negate(isClosingBraceToken)\nexport const isNotCommentToken = negate(isCommentToken)\n","import { isArrowToken, isOpeningParenToken } from \"./token-predicate.mjs\"\n/** @typedef {import(\"eslint\").Rule.Node} RuleNode */\n/** @typedef {import(\"eslint\").SourceCode} SourceCode */\n/** @typedef {import(\"eslint\").AST.Token} Token */\n/** @typedef {import(\"estree\").Function} FunctionNode */\n/** @typedef {import(\"estree\").FunctionDeclaration} FunctionDeclaration */\n/** @typedef {import(\"estree\").FunctionExpression} FunctionExpression */\n/** @typedef {import(\"estree\").SourceLocation} SourceLocation */\n/** @typedef {import(\"estree\").Position} Position */\n\n/**\n * Get the `(` token of the given function node.\n * @param {FunctionExpression | FunctionDeclaration} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {Token} `(` token.\n */\nfunction getOpeningParenOfParams(node, sourceCode) {\n    return node.id\n        ? /** @type {Token} */ (\n              sourceCode.getTokenAfter(node.id, isOpeningParenToken)\n          )\n        : /** @type {Token} */ (\n              sourceCode.getFirstToken(node, isOpeningParenToken)\n          )\n}\n\n/**\n * Get the location of the given function node for reporting.\n * @param {FunctionNode} node - The function node to get.\n * @param {SourceCode} sourceCode - The source code object to get tokens.\n * @returns {SourceLocation|null} The location of the function node for reporting.\n */\nexport function getFunctionHeadLocation(node, sourceCode) {\n    const parent = /** @type {RuleNode} */ (node).parent\n\n    /** @type {Position|null} */\n    let start = null\n    /** @type {Position|null} */\n    let end = null\n\n    if (node.type === \"ArrowFunctionExpression\") {\n        const arrowToken = /** @type {Token} */ (\n            sourceCode.getTokenBefore(node.body, isArrowToken)\n        )\n\n        start = arrowToken.loc.start\n        end = arrowToken.loc.end\n    } else if (\n        parent &&\n        (parent.type === \"Property\" ||\n            parent.type === \"MethodDefinition\" ||\n            parent.type === \"PropertyDefinition\")\n    ) {\n        start = /** @type {SourceLocation} */ (parent.loc).start\n        end = getOpeningParenOfParams(node, sourceCode).loc.start\n    } else {\n        start = /** @type {SourceLocation} */ (node.loc).start\n        end = getOpeningParenOfParams(node, sourceCode).loc.start\n    }\n\n    return {\n        start: { ...start },\n        end: { ...end },\n    }\n}\n","/* globals self, window */\n\nimport { findVariable } from \"./find-variable.mjs\"\n/** @typedef {import(\"./types.mjs\").StaticValue} StaticValue */\n/** @typedef {import(\"eslint\").Scope.Scope} Scope */\n/** @typedef {import(\"eslint\").Scope.Variable} Variable */\n/** @typedef {import(\"estree\").Node} Node */\n/** @typedef {import(\"@typescript-eslint/types\").TSESTree.Node} TSESTreeNode */\n/** @typedef {import(\"@typescript-eslint/types\").TSESTree.AST_NODE_TYPES} TSESTreeNodeTypes */\n/** @typedef {import(\"@typescript-eslint/types\").TSESTree.MemberExpression} MemberExpression */\n/** @typedef {import(\"@typescript-eslint/types\").TSESTree.Property} Property */\n/** @typedef {import(\"@typescript-eslint/types\").TSESTree.RegExpLiteral} RegExpLiteral */\n/** @typedef {import(\"@typescript-eslint/types\").TSESTree.BigIntLiteral} BigIntLiteral */\n/** @typedef {import(\"@typescript-eslint/types\").TSESTree.Literal} Literal */\n\nconst globalObject =\n    typeof globalThis !== \"undefined\"\n        ? globalThis\n        : // @ts-ignore\n        typeof self !== \"undefined\"\n        ? // @ts-ignore\n          self\n        : // @ts-ignore\n        typeof window !== \"undefined\"\n        ? // @ts-ignore\n          window\n        : typeof global !== \"undefined\"\n        ? global\n        : {}\n\nconst builtinNames = Object.freeze(\n    new Set([\n        \"Array\",\n        \"ArrayBuffer\",\n        \"BigInt\",\n        \"BigInt64Array\",\n        \"BigUint64Array\",\n        \"Boolean\",\n        \"DataView\",\n        \"Date\",\n        \"decodeURI\",\n        \"decodeURIComponent\",\n        \"encodeURI\",\n        \"encodeURIComponent\",\n        \"escape\",\n        \"Float32Array\",\n        \"Float64Array\",\n        \"Function\",\n        \"Infinity\",\n        \"Int16Array\",\n        \"Int32Array\",\n        \"Int8Array\",\n        \"isFinite\",\n        \"isNaN\",\n        \"isPrototypeOf\",\n        \"JSON\",\n        \"Map\",\n        \"Math\",\n        \"NaN\",\n        \"Number\",\n        \"Object\",\n        \"parseFloat\",\n        \"parseInt\",\n        \"Promise\",\n        \"Proxy\",\n        \"Reflect\",\n        \"RegExp\",\n        \"Set\",\n        \"String\",\n        \"Symbol\",\n        \"Uint16Array\",\n        \"Uint32Array\",\n        \"Uint8Array\",\n        \"Uint8ClampedArray\",\n        \"undefined\",\n        \"unescape\",\n        \"WeakMap\",\n        \"WeakSet\",\n    ]),\n)\nconst callAllowed = new Set(\n    [\n        Array.isArray,\n        Array.of,\n        Array.prototype.at,\n        Array.prototype.concat,\n        Array.prototype.entries,\n        Array.prototype.every,\n        Array.prototype.filter,\n        Array.prototype.find,\n        Array.prototype.findIndex,\n        Array.prototype.flat,\n        Array.prototype.includes,\n        Array.prototype.indexOf,\n        Array.prototype.join,\n        Array.prototype.keys,\n        Array.prototype.lastIndexOf,\n        Array.prototype.slice,\n        Array.prototype.some,\n        Array.prototype.toString,\n        Array.prototype.values,\n        typeof BigInt === \"function\" ? BigInt : undefined,\n        Boolean,\n        Date,\n        Date.parse,\n        decodeURI,\n        decodeURIComponent,\n        encodeURI,\n        encodeURIComponent,\n        escape,\n        isFinite,\n        isNaN,\n        // @ts-ignore\n        isPrototypeOf,\n        Map,\n        Map.prototype.entries,\n        Map.prototype.get,\n        Map.prototype.has,\n        Map.prototype.keys,\n        Map.prototype.values,\n        .../** @type {(keyof typeof Math)[]} */ (\n            Object.getOwnPropertyNames(Math)\n        )\n            .filter((k) => k !== \"random\")\n            .map((k) => Math[k])\n            .filter((f) => typeof f === \"function\"),\n        Number,\n        Number.isFinite,\n        Number.isNaN,\n        Number.parseFloat,\n        Number.parseInt,\n        Number.prototype.toExponential,\n        Number.prototype.toFixed,\n        Number.prototype.toPrecision,\n        Number.prototype.toString,\n        Object,\n        Object.entries,\n        Object.is,\n        Object.isExtensible,\n        Object.isFrozen,\n        Object.isSealed,\n        Object.keys,\n        Object.values,\n        parseFloat,\n        parseInt,\n        RegExp,\n        Set,\n        Set.prototype.entries,\n        Set.prototype.has,\n        Set.prototype.keys,\n        Set.prototype.values,\n        String,\n        String.fromCharCode,\n        String.fromCodePoint,\n        String.raw,\n        String.prototype.at,\n        String.prototype.charAt,\n        String.prototype.charCodeAt,\n        String.prototype.codePointAt,\n        String.prototype.concat,\n        String.prototype.endsWith,\n        String.prototype.includes,\n        String.prototype.indexOf,\n        String.prototype.lastIndexOf,\n        String.prototype.normalize,\n        String.prototype.padEnd,\n        String.prototype.padStart,\n        String.prototype.slice,\n        String.prototype.startsWith,\n        String.prototype.substr,\n        String.prototype.substring,\n        String.prototype.toLowerCase,\n        String.prototype.toString,\n        String.prototype.toUpperCase,\n        String.prototype.trim,\n        String.prototype.trimEnd,\n        String.prototype.trimLeft,\n        String.prototype.trimRight,\n        String.prototype.trimStart,\n        Symbol.for,\n        Symbol.keyFor,\n        unescape,\n    ].filter((f) => typeof f === \"function\"),\n)\nconst callPassThrough = new Set([\n    Object.freeze,\n    Object.preventExtensions,\n    Object.seal,\n])\n\n/** @type {ReadonlyArray<readonly [Function, ReadonlySet<string>]>} */\nconst getterAllowed = [\n    [Map, new Set([\"size\"])],\n    [\n        RegExp,\n        new Set([\n            \"dotAll\",\n            \"flags\",\n            \"global\",\n            \"hasIndices\",\n            \"ignoreCase\",\n            \"multiline\",\n            \"source\",\n            \"sticky\",\n            \"unicode\",\n        ]),\n    ],\n    [Set, new Set([\"size\"])],\n]\n\n/**\n * Get the property descriptor.\n * @param {object} object The object to get.\n * @param {string|number|symbol} name The property name to get.\n */\nfunction getPropertyDescriptor(object, name) {\n    let x = object\n    while ((typeof x === \"object\" || typeof x === \"function\") && x !== null) {\n        const d = Object.getOwnPropertyDescriptor(x, name)\n        if (d) {\n            return d\n        }\n        x = Object.getPrototypeOf(x)\n    }\n    return null\n}\n\n/**\n * Check if a property is getter or not.\n * @param {object} object The object to check.\n * @param {string|number|symbol} name The property name to check.\n */\nfunction isGetter(object, name) {\n    const d = getPropertyDescriptor(object, name)\n    return d != null && d.get != null\n}\n\n/**\n * Get the element values of a given node list.\n * @param {(Node|TSESTreeNode|null)[]} nodeList The node list to get values.\n * @param {Scope|undefined|null} initialScope The initial scope to find variables.\n * @returns {any[]|null} The value list if all nodes are constant. Otherwise, null.\n */\nfunction getElementValues(nodeList, initialScope) {\n    const valueList = []\n\n    for (let i = 0; i < nodeList.length; ++i) {\n        const elementNode = nodeList[i]\n\n        if (elementNode == null) {\n            valueList.length = i + 1\n        } else if (elementNode.type === \"SpreadElement\") {\n            const argument = getStaticValueR(elementNode.argument, initialScope)\n            if (argument == null) {\n                return null\n            }\n            valueList.push(.../** @type {Iterable<any>} */ (argument.value))\n        } else {\n            const element = getStaticValueR(elementNode, initialScope)\n            if (element == null) {\n                return null\n            }\n            valueList.push(element.value)\n        }\n    }\n\n    return valueList\n}\n\n/**\n * Checks if a variable is a built-in global.\n * @param {Variable|null} variable The variable to check.\n * @returns {variable is Variable & {defs:[]}}\n */\nfunction isBuiltinGlobal(variable) {\n    return (\n        variable != null &&\n        variable.defs.length === 0 &&\n        builtinNames.has(variable.name) &&\n        variable.name in globalObject\n    )\n}\n\n/**\n * Checks if a variable can be considered as a constant.\n * @param {Variable} variable\n * @returns {variable is Variable & {defs: [import(\"eslint\").Scope.Definition & { type: \"Variable\" }]}} True if the variable can be considered as a constant.\n */\nfunction canBeConsideredConst(variable) {\n    if (variable.defs.length !== 1) {\n        return false\n    }\n    const def = variable.defs[0]\n    return Boolean(\n        def.parent &&\n            def.type === \"Variable\" &&\n            (def.parent.kind === \"const\" || isEffectivelyConst(variable)),\n    )\n}\n\n/**\n * Returns whether the given variable is never written to after initialization.\n * @param {Variable} variable\n * @returns {boolean}\n */\nfunction isEffectivelyConst(variable) {\n    const refs = variable.references\n\n    const inits = refs.filter((r) => r.init).length\n    const reads = refs.filter((r) => r.isReadOnly()).length\n    if (inits === 1 && reads + inits === refs.length) {\n        // there is only one init and all other references only read\n        return true\n    }\n    return false\n}\n\n/**\n * Checks if a variable has mutation in its property.\n * @param {Variable} variable The variable to check.\n * @param {Scope|null} initialScope The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.\n * @returns {boolean} True if the variable has mutation in its property.\n */\nfunction hasMutationInProperty(variable, initialScope) {\n    for (const ref of variable.references) {\n        let node = /** @type {TSESTreeNode} */ (ref.identifier)\n        while (node && node.parent && node.parent.type === \"MemberExpression\") {\n            node = node.parent\n        }\n        if (!node || !node.parent) {\n            continue\n        }\n        if (\n            (node.parent.type === \"AssignmentExpression\" &&\n                node.parent.left === node) ||\n            (node.parent.type === \"UpdateExpression\" &&\n                node.parent.argument === node)\n        ) {\n            // This is a mutation.\n            return true\n        }\n        if (\n            node.parent.type === \"CallExpression\" &&\n            node.parent.callee === node &&\n            node.type === \"MemberExpression\"\n        ) {\n            const methodName = getStaticPropertyNameValue(node, initialScope)\n            if (isNameOfMutationArrayMethod(methodName)) {\n                // This is a mutation.\n                return true\n            }\n        }\n    }\n    return false\n\n    /**\n     * Checks if a method name is one of the mutation array methods.\n     * @param {StaticValue|null} methodName The method name to check.\n     * @returns {boolean} True if the method name is a mutation array method.\n     */\n    function isNameOfMutationArrayMethod(methodName) {\n        if (methodName == null || methodName.value == null) {\n            return false\n        }\n        const name = methodName.value\n        return (\n            name === \"copyWithin\" ||\n            name === \"fill\" ||\n            name === \"pop\" ||\n            name === \"push\" ||\n            name === \"reverse\" ||\n            name === \"shift\" ||\n            name === \"sort\" ||\n            name === \"splice\" ||\n            name === \"unshift\"\n        )\n    }\n}\n\n/**\n * @template {TSESTreeNodeTypes} T\n * @callback VisitorCallback\n * @param {TSESTreeNode & { type: T }} node\n * @param {Scope|undefined|null} initialScope\n * @returns {StaticValue | null}\n */\n/**\n * @typedef { { [K in TSESTreeNodeTypes]?: VisitorCallback<K> } } Operations\n */\n/**\n * @type {Operations}\n */\nconst operations = Object.freeze({\n    ArrayExpression(node, initialScope) {\n        const elements = getElementValues(node.elements, initialScope)\n        return elements != null ? { value: elements } : null\n    },\n\n    AssignmentExpression(node, initialScope) {\n        if (node.operator === \"=\") {\n            return getStaticValueR(node.right, initialScope)\n        }\n        return null\n    },\n\n    //eslint-disable-next-line complexity\n    BinaryExpression(node, initialScope) {\n        if (node.operator === \"in\" || node.operator === \"instanceof\") {\n            // Not supported.\n            return null\n        }\n\n        const left = getStaticValueR(node.left, initialScope)\n        const right = getStaticValueR(node.right, initialScope)\n        if (left != null && right != null) {\n            switch (node.operator) {\n                case \"==\":\n                    return { value: left.value == right.value } //eslint-disable-line eqeqeq\n                case \"!=\":\n                    return { value: left.value != right.value } //eslint-disable-line eqeqeq\n                case \"===\":\n                    return { value: left.value === right.value }\n                case \"!==\":\n                    return { value: left.value !== right.value }\n                case \"<\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) <\n                            /** @type {any} */ (right.value),\n                    }\n                case \"<=\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) <=\n                            /** @type {any} */ (right.value),\n                    }\n                case \">\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) >\n                            /** @type {any} */ (right.value),\n                    }\n                case \">=\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) >=\n                            /** @type {any} */ (right.value),\n                    }\n                case \"<<\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) <<\n                            /** @type {any} */ (right.value),\n                    }\n                case \">>\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) >>\n                            /** @type {any} */ (right.value),\n                    }\n                case \">>>\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) >>>\n                            /** @type {any} */ (right.value),\n                    }\n                case \"+\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) +\n                            /** @type {any} */ (right.value),\n                    }\n                case \"-\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) -\n                            /** @type {any} */ (right.value),\n                    }\n                case \"*\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) *\n                            /** @type {any} */ (right.value),\n                    }\n                case \"/\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) /\n                            /** @type {any} */ (right.value),\n                    }\n                case \"%\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) %\n                            /** @type {any} */ (right.value),\n                    }\n                case \"**\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) **\n                            /** @type {any} */ (right.value),\n                    }\n                case \"|\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) |\n                            /** @type {any} */ (right.value),\n                    }\n                case \"^\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) ^\n                            /** @type {any} */ (right.value),\n                    }\n                case \"&\":\n                    return {\n                        value:\n                            /** @type {any} */ (left.value) &\n                            /** @type {any} */ (right.value),\n                    }\n\n                // no default\n            }\n        }\n\n        return null\n    },\n\n    CallExpression(node, initialScope) {\n        const calleeNode = node.callee\n        const args = getElementValues(node.arguments, initialScope)\n\n        if (args != null) {\n            if (calleeNode.type === \"MemberExpression\") {\n                if (calleeNode.property.type === \"PrivateIdentifier\") {\n                    return null\n                }\n                const object = getStaticValueR(calleeNode.object, initialScope)\n                if (object != null) {\n                    if (\n                        object.value == null &&\n                        (object.optional || node.optional)\n                    ) {\n                        return { value: undefined, optional: true }\n                    }\n                    const property = getStaticPropertyNameValue(\n                        calleeNode,\n                        initialScope,\n                    )\n\n                    if (property != null) {\n                        const receiver =\n                            /** @type {Record<PropertyKey, (...args: any[]) => any>} */ (\n                                object.value\n                            )\n                        const methodName = /** @type {PropertyKey} */ (\n                            property.value\n                        )\n                        if (callAllowed.has(receiver[methodName])) {\n                            return {\n                                value: receiver[methodName](...args),\n                            }\n                        }\n                        if (callPassThrough.has(receiver[methodName])) {\n                            return { value: args[0] }\n                        }\n                    }\n                }\n            } else {\n                const callee = getStaticValueR(calleeNode, initialScope)\n                if (callee != null) {\n                    if (callee.value == null && node.optional) {\n                        return { value: undefined, optional: true }\n                    }\n                    const func = /** @type {(...args: any[]) => any} */ (\n                        callee.value\n                    )\n                    if (callAllowed.has(func)) {\n                        return { value: func(...args) }\n                    }\n                    if (callPassThrough.has(func)) {\n                        return { value: args[0] }\n                    }\n                }\n            }\n        }\n\n        return null\n    },\n\n    ConditionalExpression(node, initialScope) {\n        const test = getStaticValueR(node.test, initialScope)\n        if (test != null) {\n            return test.value\n                ? getStaticValueR(node.consequent, initialScope)\n                : getStaticValueR(node.alternate, initialScope)\n        }\n        return null\n    },\n\n    ExpressionStatement(node, initialScope) {\n        return getStaticValueR(node.expression, initialScope)\n    },\n\n    Identifier(node, initialScope) {\n        if (initialScope != null) {\n            const variable = findVariable(initialScope, node)\n\n            if (variable != null) {\n                // Built-in globals.\n                if (isBuiltinGlobal(variable)) {\n                    return { value: globalObject[variable.name] }\n                }\n\n                // Constants.\n                if (canBeConsideredConst(variable)) {\n                    const def = variable.defs[0]\n                    if (\n                        // TODO(mysticatea): don't support destructuring here.\n                        def.node.id.type === \"Identifier\"\n                    ) {\n                        const init = getStaticValueR(\n                            def.node.init,\n                            initialScope,\n                        )\n                        if (\n                            init &&\n                            typeof init.value === \"object\" &&\n                            init.value !== null\n                        ) {\n                            if (hasMutationInProperty(variable, initialScope)) {\n                                // This variable has mutation in its property.\n                                return null\n                            }\n                        }\n                        return init\n                    }\n                }\n            }\n        }\n        return null\n    },\n\n    Literal(node) {\n        const literal =\n            /** @type {Partial<Literal> & Partial<RegExpLiteral> & Partial<BigIntLiteral>} */ (\n                node\n            )\n        //istanbul ignore if : this is implementation-specific behavior.\n        if (\n            (literal.regex != null || literal.bigint != null) &&\n            literal.value == null\n        ) {\n            // It was a RegExp/BigInt literal, but Node.js didn't support it.\n            return null\n        }\n        return { value: literal.value }\n    },\n\n    LogicalExpression(node, initialScope) {\n        const left = getStaticValueR(node.left, initialScope)\n        if (left != null) {\n            if (\n                (node.operator === \"||\" && Boolean(left.value) === true) ||\n                (node.operator === \"&&\" && Boolean(left.value) === false) ||\n                (node.operator === \"??\" && left.value != null)\n            ) {\n                return left\n            }\n\n            const right = getStaticValueR(node.right, initialScope)\n            if (right != null) {\n                return right\n            }\n        }\n\n        return null\n    },\n\n    MemberExpression(node, initialScope) {\n        if (node.property.type === \"PrivateIdentifier\") {\n            return null\n        }\n        const object = getStaticValueR(node.object, initialScope)\n        if (object != null) {\n            if (object.value == null && (object.optional || node.optional)) {\n                return { value: undefined, optional: true }\n            }\n            const property = getStaticPropertyNameValue(node, initialScope)\n\n            if (property != null) {\n                if (\n                    !isGetter(\n                        /** @type {object} */ (object.value),\n                        /** @type {PropertyKey} */ (property.value),\n                    )\n                ) {\n                    return {\n                        value: /** @type {Record<PropertyKey, unknown>} */ (\n                            object.value\n                        )[/** @type {PropertyKey} */ (property.value)],\n                    }\n                }\n\n                for (const [classFn, allowed] of getterAllowed) {\n                    if (\n                        object.value instanceof classFn &&\n                        allowed.has(/** @type {string} */ (property.value))\n                    ) {\n                        return {\n                            value: /** @type {Record<PropertyKey, unknown>} */ (\n                                object.value\n                            )[/** @type {PropertyKey} */ (property.value)],\n                        }\n                    }\n                }\n            }\n        }\n        return null\n    },\n\n    ChainExpression(node, initialScope) {\n        const expression = getStaticValueR(node.expression, initialScope)\n        if (expression != null) {\n            return { value: expression.value }\n        }\n        return null\n    },\n\n    NewExpression(node, initialScope) {\n        const callee = getStaticValueR(node.callee, initialScope)\n        const args = getElementValues(node.arguments, initialScope)\n\n        if (callee != null && args != null) {\n            const Func = /** @type {new (...args: any[]) => any} */ (\n                callee.value\n            )\n            if (callAllowed.has(Func)) {\n                return { value: new Func(...args) }\n            }\n        }\n\n        return null\n    },\n\n    ObjectExpression(node, initialScope) {\n        /** @type {Record<PropertyKey, unknown>} */\n        const object = {}\n\n        for (const propertyNode of node.properties) {\n            if (propertyNode.type === \"Property\") {\n                if (propertyNode.kind !== \"init\") {\n                    return null\n                }\n                const key = getStaticPropertyNameValue(\n                    propertyNode,\n                    initialScope,\n                )\n                const value = getStaticValueR(propertyNode.value, initialScope)\n                if (key == null || value == null) {\n                    return null\n                }\n                object[/** @type {PropertyKey} */ (key.value)] = value.value\n            } else if (\n                propertyNode.type === \"SpreadElement\" ||\n                // @ts-expect-error -- Backward compatibility\n                propertyNode.type === \"ExperimentalSpreadProperty\"\n            ) {\n                const argument = getStaticValueR(\n                    propertyNode.argument,\n                    initialScope,\n                )\n                if (argument == null) {\n                    return null\n                }\n                Object.assign(object, argument.value)\n            } else {\n                return null\n            }\n        }\n\n        return { value: object }\n    },\n\n    SequenceExpression(node, initialScope) {\n        const last = node.expressions[node.expressions.length - 1]\n        return getStaticValueR(last, initialScope)\n    },\n\n    TaggedTemplateExpression(node, initialScope) {\n        const tag = getStaticValueR(node.tag, initialScope)\n        const expressions = getElementValues(\n            node.quasi.expressions,\n            initialScope,\n        )\n\n        if (tag != null && expressions != null) {\n            const func = /** @type {(...args: any[]) => any} */ (tag.value)\n            /** @type {any[] & { raw?: string[] }} */\n            const strings = node.quasi.quasis.map((q) => q.value.cooked)\n            strings.raw = node.quasi.quasis.map((q) => q.value.raw)\n\n            if (func === String.raw) {\n                return { value: func(strings, ...expressions) }\n            }\n        }\n\n        return null\n    },\n\n    TemplateLiteral(node, initialScope) {\n        const expressions = getElementValues(node.expressions, initialScope)\n        if (expressions != null) {\n            let value = node.quasis[0].value.cooked\n            for (let i = 0; i < expressions.length; ++i) {\n                value += expressions[i]\n                value += /** @type {string} */ (node.quasis[i + 1].value.cooked)\n            }\n            return { value }\n        }\n        return null\n    },\n\n    UnaryExpression(node, initialScope) {\n        if (node.operator === \"delete\") {\n            // Not supported.\n            return null\n        }\n        if (node.operator === \"void\") {\n            return { value: undefined }\n        }\n\n        const arg = getStaticValueR(node.argument, initialScope)\n        if (arg != null) {\n            switch (node.operator) {\n                case \"-\":\n                    return { value: -(/** @type {any} */ (arg.value)) }\n                case \"+\":\n                    return { value: +(/** @type {any} */ (arg.value)) } //eslint-disable-line no-implicit-coercion\n                case \"!\":\n                    return { value: !arg.value }\n                case \"~\":\n                    return { value: ~(/** @type {any} */ (arg.value)) }\n                case \"typeof\":\n                    return { value: typeof arg.value }\n\n                // no default\n            }\n        }\n\n        return null\n    },\n    TSAsExpression(node, initialScope) {\n        return getStaticValueR(node.expression, initialScope)\n    },\n    TSSatisfiesExpression(node, initialScope) {\n        return getStaticValueR(node.expression, initialScope)\n    },\n    TSTypeAssertion(node, initialScope) {\n        return getStaticValueR(node.expression, initialScope)\n    },\n    TSNonNullExpression(node, initialScope) {\n        return getStaticValueR(node.expression, initialScope)\n    },\n    TSInstantiationExpression(node, initialScope) {\n        return getStaticValueR(node.expression, initialScope)\n    },\n})\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node|TSESTreeNode|null|undefined} node The node to get.\n * @param {Scope|undefined|null} initialScope The scope to start finding variable.\n * @returns {StaticValue|null} The static value of the node, or `null`.\n */\nfunction getStaticValueR(node, initialScope) {\n    if (node != null && Object.hasOwnProperty.call(operations, node.type)) {\n        return /** @type {VisitorCallback<any>} */ (operations[node.type])(\n            /** @type {TSESTreeNode} */ (node),\n            initialScope,\n        )\n    }\n    return null\n}\n\n/**\n * Get the static value of property name from a MemberExpression node or a Property node.\n * @param {MemberExpression|Property} node The node to get.\n * @param {Scope|null} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.\n * @returns {StaticValue|null} The static value of the property name of the node, or `null`.\n */\nfunction getStaticPropertyNameValue(node, initialScope) {\n    const nameNode = node.type === \"Property\" ? node.key : node.property\n\n    if (node.computed) {\n        return getStaticValueR(nameNode, initialScope)\n    }\n\n    if (nameNode.type === \"Identifier\") {\n        return { value: nameNode.name }\n    }\n\n    if (nameNode.type === \"Literal\") {\n        if (/** @type {Partial<BigIntLiteral>} */ (nameNode).bigint) {\n            return { value: /** @type {BigIntLiteral} */ (nameNode).bigint }\n        }\n        return { value: String(nameNode.value) }\n    }\n\n    return null\n}\n\n/**\n * Get the value of a given node if it's a static value.\n * @param {Node} node The node to get.\n * @param {Scope|null} [initialScope] The scope to start finding variable. Optional. If this scope was given, this tries to resolve identifier references which are in the given node as much as possible.\n * @returns {StaticValue | null} The static value of the node, or `null`.\n */\nexport function getStaticValue(node, initialScope = null) {\n    try {\n        return getStaticValueR(node, initialScope)\n    } catch (_error) {\n        return null\n    }\n}\n","import { getStaticValue } from \"./get-static-value.mjs\"\n/** @typedef {import(\"eslint\").Scope.Scope} Scope */\n/** @typedef {import(\"estree\").Node} Node */\n/** @typedef {import(\"estree\").RegExpLiteral} RegExpLiteral */\n/** @typedef {import(\"estree\").BigIntLiteral} BigIntLiteral */\n/** @typedef {import(\"estree\").SimpleLiteral} SimpleLiteral */\n\n/**\n * Get the value of a given node if it's a literal or a template literal.\n * @param {Node} node The node to get.\n * @param {Scope|null} [initialScope] The scope to start finding variable. Optional. If the node is an Identifier node and this scope was given, this checks the variable of the identifier, and returns the value of it if the variable is a constant.\n * @returns {string|null} The value of the node, or `null`.\n */\nexport function getStringIfConstant(node, initialScope = null) {\n    // Handle the literals that the platform doesn't support natively.\n    if (node && node.type === \"Literal\" && node.value === null) {\n        const literal =\n            /** @type {Partial<SimpleLiteral> & Partial<RegExpLiteral> & Partial<BigIntLiteral>} */ (\n                node\n            )\n        if (literal.regex) {\n            return `/${literal.regex.pattern}/${literal.regex.flags}`\n        }\n        if (literal.bigint) {\n            return literal.bigint\n        }\n    }\n\n    const evaluated = getStaticValue(node, initialScope)\n\n    if (evaluated) {\n        // `String(Symbol.prototype)` throws error\n        try {\n            return String(evaluated.value)\n        } catch {\n            // No op\n        }\n    }\n\n    return null\n}\n","import { getStringIfConstant } from \"./get-string-if-constant.mjs\"\n/** @typedef {import(\"eslint\").Scope.Scope} Scope */\n/** @typedef {import(\"estree\").MemberExpression} MemberExpression */\n/** @typedef {import(\"estree\").MethodDefinition} MethodDefinition */\n/** @typedef {import(\"estree\").Property} Property */\n/** @typedef {import(\"estree\").PropertyDefinition} PropertyDefinition */\n/** @typedef {import(\"estree\").Identifier} Identifier */\n\n/**\n * Get the property name from a MemberExpression node or a Property node.\n * @param {MemberExpression | MethodDefinition | Property | PropertyDefinition} node The node to get.\n * @param {Scope} [initialScope] The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.\n * @returns {string|null|undefined} The property name of the node.\n */\nexport function getPropertyName(node, initialScope) {\n    switch (node.type) {\n        case \"MemberExpression\":\n            if (node.computed) {\n                return getStringIfConstant(node.property, initialScope)\n            }\n            if (node.property.type === \"PrivateIdentifier\") {\n                return null\n            }\n            return /** @type {Partial<Identifier>} */ (node.property).name\n\n        case \"Property\":\n        case \"MethodDefinition\":\n        case \"PropertyDefinition\":\n            if (node.computed) {\n                return getStringIfConstant(node.key, initialScope)\n            }\n            if (node.key.type === \"Literal\") {\n                return String(node.key.value)\n            }\n            if (node.key.type === \"PrivateIdentifier\") {\n                return null\n            }\n            return /** @type {Partial<Identifier>} */ (node.key).name\n\n        default:\n            break\n    }\n\n    return null\n}\n","import { getPropertyName } from \"./get-property-name.mjs\"\n/** @typedef {import(\"eslint\").Rule.Node} RuleNode */\n/** @typedef {import(\"eslint\").SourceCode} SourceCode */\n/** @typedef {import(\"estree\").Function} FunctionNode */\n/** @typedef {import(\"estree\").FunctionDeclaration} FunctionDeclaration */\n/** @typedef {import(\"estree\").FunctionExpression} FunctionExpression */\n/** @typedef {import(\"estree\").Identifier} Identifier */\n\n/**\n * Get the name and kind of the given function node.\n * @param {FunctionNode} node - The function node to get.\n * @param {SourceCode} [sourceCode] The source code object to get the code of computed property keys.\n * @returns {string} The name and kind of the function node.\n */\n// eslint-disable-next-line complexity\nexport function getFunctionNameWithKind(node, sourceCode) {\n    const parent = /** @type {RuleNode} */ (node).parent\n\n    if (!parent) {\n        return \"\"\n    }\n\n    const tokens = []\n    const isObjectMethod = parent.type === \"Property\" && parent.value === node\n    const isClassMethod =\n        parent.type === \"MethodDefinition\" && parent.value === node\n    const isClassFieldMethod =\n        parent.type === \"PropertyDefinition\" && parent.value === node\n\n    // Modifiers.\n    if (isClassMethod || isClassFieldMethod) {\n        if (parent.static) {\n            tokens.push(\"static\")\n        }\n        if (parent.key.type === \"PrivateIdentifier\") {\n            tokens.push(\"private\")\n        }\n    }\n    if (node.async) {\n        tokens.push(\"async\")\n    }\n    if (node.generator) {\n        tokens.push(\"generator\")\n    }\n\n    // Kinds.\n    if (isObjectMethod || isClassMethod) {\n        if (parent.kind === \"constructor\") {\n            return \"constructor\"\n        }\n        if (parent.kind === \"get\") {\n            tokens.push(\"getter\")\n        } else if (parent.kind === \"set\") {\n            tokens.push(\"setter\")\n        } else {\n            tokens.push(\"method\")\n        }\n    } else if (isClassFieldMethod) {\n        tokens.push(\"method\")\n    } else {\n        if (node.type === \"ArrowFunctionExpression\") {\n            tokens.push(\"arrow\")\n        }\n        tokens.push(\"function\")\n    }\n\n    // Names.\n    if (isObjectMethod || isClassMethod || isClassFieldMethod) {\n        if (parent.key.type === \"PrivateIdentifier\") {\n            tokens.push(`#${parent.key.name}`)\n        } else {\n            const name = getPropertyName(parent)\n            if (name) {\n                tokens.push(`'${name}'`)\n            } else if (sourceCode) {\n                const keyText = sourceCode.getText(parent.key)\n                if (!keyText.includes(\"\\n\")) {\n                    tokens.push(`[${keyText}]`)\n                }\n            }\n        }\n    } else if (hasId(node)) {\n        tokens.push(`'${node.id.name}'`)\n    } else if (\n        parent.type === \"VariableDeclarator\" &&\n        parent.id &&\n        parent.id.type === \"Identifier\"\n    ) {\n        tokens.push(`'${parent.id.name}'`)\n    } else if (\n        (parent.type === \"AssignmentExpression\" ||\n            parent.type === \"AssignmentPattern\") &&\n        parent.left &&\n        parent.left.type === \"Identifier\"\n    ) {\n        tokens.push(`'${parent.left.name}'`)\n    } else if (\n        parent.type === \"ExportDefaultDeclaration\" &&\n        parent.declaration === node\n    ) {\n        tokens.push(\"'default'\")\n    }\n\n    return tokens.join(\" \")\n}\n\n/**\n * @param {FunctionNode} node\n * @returns {node is FunctionDeclaration | FunctionExpression & { id: Identifier }}\n */\nfunction hasId(node) {\n    return Boolean(\n        /** @type {Partial<FunctionDeclaration | FunctionExpression>} */ (node)\n            .id,\n    )\n}\n","import { getKeys, KEYS } from \"eslint-visitor-keys\"\n/** @typedef {import(\"estree\").Node} Node */\n/** @typedef {import(\"eslint\").SourceCode} SourceCode */\n/** @typedef {import(\"./types.mjs\").HasSideEffectOptions} HasSideEffectOptions */\n/** @typedef {import(\"estree\").BinaryExpression} BinaryExpression */\n/** @typedef {import(\"estree\").MemberExpression} MemberExpression */\n/** @typedef {import(\"estree\").MethodDefinition} MethodDefinition */\n/** @typedef {import(\"estree\").Property} Property */\n/** @typedef {import(\"estree\").PropertyDefinition} PropertyDefinition */\n/** @typedef {import(\"estree\").UnaryExpression} UnaryExpression */\n\nconst typeConversionBinaryOps = Object.freeze(\n    new Set([\n        \"==\",\n        \"!=\",\n        \"<\",\n        \"<=\",\n        \">\",\n        \">=\",\n        \"<<\",\n        \">>\",\n        \">>>\",\n        \"+\",\n        \"-\",\n        \"*\",\n        \"/\",\n        \"%\",\n        \"|\",\n        \"^\",\n        \"&\",\n        \"in\",\n    ]),\n)\nconst typeConversionUnaryOps = Object.freeze(new Set([\"-\", \"+\", \"!\", \"~\"]))\n\n/**\n * Check whether the given value is an ASTNode or not.\n * @param {any} x The value to check.\n * @returns {x is Node} `true` if the value is an ASTNode.\n */\nfunction isNode(x) {\n    return x !== null && typeof x === \"object\" && typeof x.type === \"string\"\n}\n\nconst visitor = Object.freeze(\n    Object.assign(Object.create(null), {\n        /**\n         * @param {Node} node\n         * @param {HasSideEffectOptions} options\n         * @param {Record<string, string[]>} visitorKeys\n         */\n        $visit(node, options, visitorKeys) {\n            const { type } = node\n\n            if (typeof (/** @type {any} */ (this)[type]) === \"function\") {\n                return /** @type {any} */ (this)[type](\n                    node,\n                    options,\n                    visitorKeys,\n                )\n            }\n\n            return this.$visitChildren(node, options, visitorKeys)\n        },\n\n        /**\n         * @param {Node} node\n         * @param {HasSideEffectOptions} options\n         * @param {Record<string, string[]>} visitorKeys\n         */\n        $visitChildren(node, options, visitorKeys) {\n            const { type } = node\n\n            for (const key of /** @type {(keyof Node)[]} */ (\n                visitorKeys[type] || getKeys(node)\n            )) {\n                const value = node[key]\n\n                if (Array.isArray(value)) {\n                    for (const element of value) {\n                        if (\n                            isNode(element) &&\n                            this.$visit(element, options, visitorKeys)\n                        ) {\n                            return true\n                        }\n                    }\n                } else if (\n                    isNode(value) &&\n                    this.$visit(value, options, visitorKeys)\n                ) {\n                    return true\n                }\n            }\n\n            return false\n        },\n\n        ArrowFunctionExpression() {\n            return false\n        },\n        AssignmentExpression() {\n            return true\n        },\n        AwaitExpression() {\n            return true\n        },\n        /**\n         * @param {BinaryExpression} node\n         * @param {HasSideEffectOptions} options\n         * @param {Record<string, string[]>} visitorKeys\n         */\n        BinaryExpression(node, options, visitorKeys) {\n            if (\n                options.considerImplicitTypeConversion &&\n                typeConversionBinaryOps.has(node.operator) &&\n                (node.left.type !== \"Literal\" || node.right.type !== \"Literal\")\n            ) {\n                return true\n            }\n            return this.$visitChildren(node, options, visitorKeys)\n        },\n        CallExpression() {\n            return true\n        },\n        FunctionExpression() {\n            return false\n        },\n        ImportExpression() {\n            return true\n        },\n        /**\n         * @param {MemberExpression} node\n         * @param {HasSideEffectOptions} options\n         * @param {Record<string, string[]>} visitorKeys\n         */\n        MemberExpression(node, options, visitorKeys) {\n            if (options.considerGetters) {\n                return true\n            }\n            if (\n                options.considerImplicitTypeConversion &&\n                node.computed &&\n                node.property.type !== \"Literal\"\n            ) {\n                return true\n            }\n            return this.$visitChildren(node, options, visitorKeys)\n        },\n        /**\n         * @param {MethodDefinition} node\n         * @param {HasSideEffectOptions} options\n         * @param {Record<string, string[]>} visitorKeys\n         */\n        MethodDefinition(node, options, visitorKeys) {\n            if (\n                options.considerImplicitTypeConversion &&\n                node.computed &&\n                node.key.type !== \"Literal\"\n            ) {\n                return true\n            }\n            return this.$visitChildren(node, options, visitorKeys)\n        },\n        NewExpression() {\n            return true\n        },\n        /**\n         * @param {Property} node\n         * @param {HasSideEffectOptions} options\n         * @param {Record<string, string[]>} visitorKeys\n         */\n        Property(node, options, visitorKeys) {\n            if (\n                options.considerImplicitTypeConversion &&\n                node.computed &&\n                node.key.type !== \"Literal\"\n            ) {\n                return true\n            }\n            return this.$visitChildren(node, options, visitorKeys)\n        },\n        /**\n         * @param {PropertyDefinition} node\n         * @param {HasSideEffectOptions} options\n         * @param {Record<string, string[]>} visitorKeys\n         */\n        PropertyDefinition(node, options, visitorKeys) {\n            if (\n                options.considerImplicitTypeConversion &&\n                node.computed &&\n                node.key.type !== \"Literal\"\n            ) {\n                return true\n            }\n            return this.$visitChildren(node, options, visitorKeys)\n        },\n        /**\n         * @param {UnaryExpression} node\n         * @param {HasSideEffectOptions} options\n         * @param {Record<string, string[]>} visitorKeys\n         */\n        UnaryExpression(node, options, visitorKeys) {\n            if (node.operator === \"delete\") {\n                return true\n            }\n            if (\n                options.considerImplicitTypeConversion &&\n                typeConversionUnaryOps.has(node.operator) &&\n                node.argument.type !== \"Literal\"\n            ) {\n                return true\n            }\n            return this.$visitChildren(node, options, visitorKeys)\n        },\n        UpdateExpression() {\n            return true\n        },\n        YieldExpression() {\n            return true\n        },\n    }),\n)\n\n/**\n * Check whether a given node has any side effect or not.\n * @param {Node} node The node to get.\n * @param {SourceCode} sourceCode The source code object.\n * @param {HasSideEffectOptions} [options] The option object.\n * @returns {boolean} `true` if the node has a certain side effect.\n */\nexport function hasSideEffect(node, sourceCode, options = {}) {\n    const { considerGetters = false, considerImplicitTypeConversion = false } =\n        options\n    return visitor.$visit(\n        node,\n        { considerGetters, considerImplicitTypeConversion },\n        sourceCode.visitorKeys || KEYS,\n    )\n}\n","import { isClosingParenToken, isOpeningParenToken } from \"./token-predicate.mjs\"\n/** @typedef {import(\"estree\").Node} Node */\n/** @typedef {import(\"@typescript-eslint/types\").TSESTree.NewExpression} TSNewExpression */\n/** @typedef {import(\"@typescript-eslint/types\").TSESTree.CallExpression} TSCallExpression */\n/** @typedef {import(\"eslint\").SourceCode} SourceCode */\n/** @typedef {import(\"eslint\").AST.Token} Token */\n/** @typedef {import(\"eslint\").Rule.Node} RuleNode */\n\n/**\n * Get the left parenthesis of the parent node syntax if it exists.\n * E.g., `if (a) {}` then the `(`.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {Token|null} The left parenthesis of the parent node syntax\n */\n// eslint-disable-next-line complexity\nfunction getParentSyntaxParen(node, sourceCode) {\n    const parent = /** @type {RuleNode} */ (node).parent\n\n    if (!parent) {\n        return null\n    }\n\n    switch (parent.type) {\n        case \"CallExpression\":\n        case \"NewExpression\":\n            if (parent.arguments.length === 1 && parent.arguments[0] === node) {\n                return sourceCode.getTokenAfter(\n                    // @ts-expect-error https://github.com/typescript-eslint/typescript-eslint/pull/5384\n                    parent.typeArguments ||\n                        /** @type {RuleNode} */ (\n                            /** @type {unknown} */ (\n                                /** @type {TSNewExpression | TSCallExpression} */ (\n                                    parent\n                                ).typeParameters\n                            )\n                        ) ||\n                        parent.callee,\n                    isOpeningParenToken,\n                )\n            }\n            return null\n\n        case \"DoWhileStatement\":\n            if (parent.test === node) {\n                return sourceCode.getTokenAfter(\n                    parent.body,\n                    isOpeningParenToken,\n                )\n            }\n            return null\n\n        case \"IfStatement\":\n        case \"WhileStatement\":\n            if (parent.test === node) {\n                return sourceCode.getFirstToken(parent, 1)\n            }\n            return null\n\n        case \"ImportExpression\":\n            if (parent.source === node) {\n                return sourceCode.getFirstToken(parent, 1)\n            }\n            return null\n\n        case \"SwitchStatement\":\n            if (parent.discriminant === node) {\n                return sourceCode.getFirstToken(parent, 1)\n            }\n            return null\n\n        case \"WithStatement\":\n            if (parent.object === node) {\n                return sourceCode.getFirstToken(parent, 1)\n            }\n            return null\n\n        default:\n            return null\n    }\n}\n\n/**\n * Check whether a given node is parenthesized or not.\n * @param {number} times The number of parantheses.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized the given times.\n */\n/**\n * Check whether a given node is parenthesized or not.\n * @param {Node} node The AST node to check.\n * @param {SourceCode} sourceCode The source code object to get tokens.\n * @returns {boolean} `true` if the node is parenthesized.\n */\n/**\n * Check whether a given node is parenthesized or not.\n * @param {Node|number} timesOrNode The first parameter.\n * @param {Node|SourceCode} nodeOrSourceCode The second parameter.\n * @param {SourceCode} [optionalSourceCode] The third parameter.\n * @returns {boolean} `true` if the node is parenthesized.\n */\nexport function isParenthesized(\n    timesOrNode,\n    nodeOrSourceCode,\n    optionalSourceCode,\n) {\n    /** @type {number} */\n    let times,\n        /** @type {RuleNode} */\n        node,\n        /** @type {SourceCode} */\n        sourceCode,\n        maybeLeftParen,\n        maybeRightParen\n    if (typeof timesOrNode === \"number\") {\n        times = timesOrNode | 0\n        node = /** @type {RuleNode} */ (nodeOrSourceCode)\n        sourceCode = /** @type {SourceCode} */ (optionalSourceCode)\n        if (!(times >= 1)) {\n            throw new TypeError(\"'times' should be a positive integer.\")\n        }\n    } else {\n        times = 1\n        node = /** @type {RuleNode} */ (timesOrNode)\n        sourceCode = /** @type {SourceCode} */ (nodeOrSourceCode)\n    }\n\n    if (\n        node == null ||\n        // `Program` can't be parenthesized\n        node.parent == null ||\n        // `CatchClause.param` can't be parenthesized, example `try {} catch (error) {}`\n        (node.parent.type === \"CatchClause\" && node.parent.param === node)\n    ) {\n        return false\n    }\n\n    maybeLeftParen = maybeRightParen = node\n    do {\n        maybeLeftParen = sourceCode.getTokenBefore(maybeLeftParen)\n        maybeRightParen = sourceCode.getTokenAfter(maybeRightParen)\n    } while (\n        maybeLeftParen != null &&\n        maybeRightParen != null &&\n        isOpeningParenToken(maybeLeftParen) &&\n        isClosingParenToken(maybeRightParen) &&\n        // Avoid false positive such as `if (a) {}`\n        maybeLeftParen !== getParentSyntaxParen(node, sourceCode) &&\n        --times > 0\n    )\n\n    return times === 0\n}\n","/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * See LICENSE file in root directory for full license.\n */\n\nconst placeholder = /\\$(?:[$&`']|[1-9][0-9]?)/gu\n\n/** @type {WeakMap<PatternMatcher, {pattern:RegExp,escaped:boolean}>} */\nconst internal = new WeakMap()\n\n/**\n * Check whether a given character is escaped or not.\n * @param {string} str The string to check.\n * @param {number} index The location of the character to check.\n * @returns {boolean} `true` if the character is escaped.\n */\nfunction isEscaped(str, index) {\n    let escaped = false\n    for (let i = index - 1; i >= 0 && str.charCodeAt(i) === 0x5c; --i) {\n        escaped = !escaped\n    }\n    return escaped\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {string} replacement The new substring to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceS(matcher, str, replacement) {\n    const chunks = []\n    let index = 0\n\n    /**\n     * @param {string} key The placeholder.\n     * @param {RegExpExecArray} match The matched information.\n     * @returns {string} The replaced string.\n     */\n    function replacer(key, match) {\n        switch (key) {\n            case \"$$\":\n                return \"$\"\n            case \"$&\":\n                return match[0]\n            case \"$`\":\n                return str.slice(0, match.index)\n            case \"$'\":\n                return str.slice(match.index + match[0].length)\n            default: {\n                const i = key.slice(1)\n                if (i in match) {\n                    return matc   h[/** @type {any} */ (i)]\n                }\n                return key\n            }\n        }\n    }\n\n    for (const match of matcher.execAll(str)) {\n        chunks.push(str.slice(index, match.index))\n        chunks.push(\n            replacement.replace(placeholder, (key) => replacer(key, match)),\n        )\n        index = match.index + match[0].length\n    }\n    chunks.push(str.slice(index))\n\n    return chunks.join(\"\")\n}\n\n/**\n * Replace a given string by a given matcher.\n * @param {PatternMatcher} matcher The pattern matcher.\n * @param {string} str The string to be replaced.\n * @param {(substring: string, ...args: any[]) => string} replace The function to replace each matched part.\n * @returns {string} The replaced string.\n */\nfunction replaceF(matcher, str, replace) {\n    const chunks = []\n    let index = 0\n\n    for (const match of matcher.execAll(str)) {\n        chunks.push(str.slice(index, match.index))\n        chunks.push(\n            String(\n                replace(\n                    .../** @type {[string, ...string[]]} */ (\n                        /** @type {string[]} */ (match)\n                    ),\n                    match.index,\n                    match.input,\n                ),\n            ),\n        )\n        index = match.index + match[0].length\n    }\n    chunks.push(str.slice(index))\n\n    return chunks.join(\"\")\n}\n\n/**\n * The class to find patterns as considering escape sequences.\n */\nexport class PatternMatcher {\n    /**\n     * Initialize this matcher.\n     * @param {RegExp} pattern The pattern to match.\n     * @param {{escaped?:boolean}} [options] The options.\n     */\n    constructor(pattern, options = {}) {\n        const { escaped = false } = options\n        if (!(pattern instanceof RegExp)) {\n            throw new TypeError(\"'pattern' should be a RegExp instance.\")\n        }\n        if (!pattern.flags.includes(\"g\")) {\n            throw new Error(\"'pattern' should contains 'g' flag.\")\n        }\n\n        internal.set(this, {\n            pattern: new RegExp(pattern.source, pattern.flags),\n            escaped: Boolean(escaped),\n        })\n    }\n\n    /**\n     * Find the pattern in a given string.\n     * @param {string} str The string to find.\n     * @returns {IterableIterator<RegExpExecArray>} The iterator which iterate the matched information.\n     */\n    *execAll(str) {\n        const { pattern, escaped } =\n            /** @type {{pattern:RegExp,escaped:boolean}} */ (internal.get(this))\n        let match = null\n        let lastIndex = 0\n\n        pattern.lastIndex = 0\n        while ((match = pattern.exec(str)) != null) {\n            if (escaped || !isEscaped(str, match.index)) {\n                lastIndex = pattern.lastIndex\n                yield match\n                pattern.lastIndex = lastIndex\n            }\n        }\n    }\n\n    /**\n     * Check whether the pattern is found in a given string.\n     * @param {string} str The string to check.\n     * @returns {boolean} `true` if the pattern was found in the string.\n     */\n    test(str) {\n        const it = this.execAll(str)\n        const ret = it.next()\n        return !ret.done\n    }\n\n    /**\n     * Replace a given string.\n     * @param {string} str The string to be replaced.\n     * @param {(string|((...strs:string[])=>string))} replacer The string or function to replace. This is the same as the 2nd argument of `String.prototype.replace`.\n     * @returns {string} The replaced string.\n     */\n    [Symbol.replace](str, replacer) {\n        return typeof replacer === \"function\"\n            ? replaceF(this, String(str), replacer)\n            : replaceS(this, String(str), String(replacer))\n    }\n}\n","import { findVariable } from \"./find-variable.mjs\"\nimport { getPropertyName } from \"./get-property-name.mjs\"\nimport { getStringIfConstant } from \"./get-string-if-constant.mjs\"\n/** @typedef {import(\"eslint\").Scope.Scope} Scope */\n/** @typedef {import(\"eslint\").Scope.Variable} Variable */\n/** @typedef {import(\"eslint\").Rule.Node} RuleNode */\n/** @typedef {import(\"estree\").Node} Node */\n/** @typedef {import(\"estree\").Expression} Expression */\n/** @typedef {import(\"estree\").Pattern} Pattern */\n/** @typedef {import(\"estree\").Identifier} Identifier */\n/** @typedef {import(\"estree\").SimpleCallExpression} CallExpression */\n/** @typedef {import(\"estree\").Program} Program */\n/** @typedef {import(\"estree\").ImportDeclaration} ImportDeclaration */\n/** @typedef {import(\"estree\").ExportAllDeclaration} ExportAllDeclaration */\n/** @typedef {import(\"estree\").ExportDefaultDeclaration} ExportDefaultDeclaration */\n/** @typedef {import(\"estree\").ExportNamedDeclaration} ExportNamedDeclaration */\n/** @typedef {import(\"estree\").ImportSpecifier} ImportSpecifier */\n/** @typedef {import(\"estree\").ImportDefaultSpecifier} ImportDefaultSpecifier */\n/** @typedef {import(\"estree\").ImportNamespaceSpecifier} ImportNamespaceSpecifier */\n/** @typedef {import(\"estree\").ExportSpecifier} ExportSpecifier */\n/** @typedef {import(\"estree\").Property} Property */\n/** @typedef {import(\"estree\").AssignmentProperty} AssignmentProperty */\n/** @typedef {import(\"estree\").Literal} Literal */\n/** @typedef {import(\"@typescript-eslint/types\").TSESTree.Node} TSESTreeNode */\n/** @typedef {import(\"./types.mjs\").ReferenceTrackerOptions} ReferenceTrackerOptions */\n/**\n * @template T\n * @typedef {import(\"./types.mjs\").TraceMap<T>} TraceMap\n */\n/**\n * @template T\n * @typedef {import(\"./types.mjs\").TraceMapObject<T>} TraceMapObject\n */\n/**\n * @template T\n * @typedef {import(\"./types.mjs\").TrackedReferences<T>} TrackedReferences\n */\n\nconst IMPORT_TYPE = /^(?:Import|Export(?:All|Default|Named))Declaration$/u\n\n/**\n * Check whether a given node is an import node or not.\n * @param {Node} node\n * @returns {node is ImportDeclaration|ExportAllDeclaration|ExportNamedDeclaration&{source: Literal}} `true` if the node is an import node.\n */\nfunction isHasSource(node) {\n    return (\n        IMPORT_TYPE.test(node.type) &&\n        /** @type {ImportDeclaration|ExportAllDeclaration|ExportNamedDeclaration} */ (\n            node\n        ).source != null\n    )\n}\nconst has =\n    /** @type {<T>(traceMap: TraceMap<unknown>, v: T) => v is (string extends T ? string : T)} */ (\n        Function.call.bind(Object.hasOwnProperty)\n    )\n\nexport const READ = Symbol(\"read\")\nexport const CALL = Symbol(\"call\")\nexport const CONSTRUCT = Symbol(\"construct\")\nexport const ESM = Symbol(\"esm\")\n\nconst requireCall = { require: { [CALL]: true } }\n\n/**\n * Check whether a given variable is modified or not.\n * @param {Variable|undefined} variable The variable to check.\n * @returns {boolean} `true` if the variable is modified.\n */\nfunction isModifiedGlobal(variable) {\n    return (\n        variable == null ||\n        variable.defs.length !== 0 ||\n        variable.references.some((r) => r.isWrite())\n    )\n}\n\n/**\n * Check if the value of a given node is passed through to the parent syntax as-is.\n * For example, `a` and `b` in (`a || b` and `c ? a : b`) are passed through.\n * @param {Node} node A node to check.\n * @returns {node is RuleNode & {parent: Expression}} `true` if the node is passed through.\n */\nfunction isPassThrough(node) {\n    const parent = /** @type {TSESTreeNode} */ (node).parent\n\n    if (parent) {\n        switch (parent.type) {\n            case \"ConditionalExpression\":\n                return parent.consequent === node || parent.alternate === node\n            case \"LogicalExpression\":\n                return true\n            case \"SequenceExpression\":\n                return (\n                    parent.expressions[parent.expressions.length - 1] === node\n                )\n            case \"ChainExpression\":\n                return true\n            case \"TSAsExpression\":\n            case \"TSSatisfiesExpression\":\n            case \"TSTypeAssertion\":\n            case \"TSNonNullExpression\":\n            case \"TSInstantiationExpression\":\n                return true\n\n            default:\n                return false\n        }\n    }\n    return false\n}\n\n/**\n * The reference tracker.\n */\nexport class ReferenceTracker {\n    /**\n     * Initialize this tracker.\n     * @param {Scope} globalScope The global scope.\n     * @param {object} [options] The options.\n     * @param {\"legacy\"|\"strict\"} [options.mode=\"strict\"] The mode to determine the ImportDeclaration's behavior for CJS modules.\n     * @param {string[]} [options.globalObjectNames=[\"global\",\"globalThis\",\"self\",\"window\"]] The variable names for Global Object.\n     */\n    constructor(globalScope, options = {}) {\n        const {\n            mode = \"strict\",\n            globalObjectNames = [\"global\", \"globalThis\", \"self\", \"window\"],\n        } = options\n        /** @private @type {Variable[]} */\n        this.variableStack = []\n        /** @private */\n        this.globalScope = globalScope\n        /** @private */\n        this.mode = mode\n        /** @private */\n        this.globalObjectNames = globalObjectNames.slice(0)\n    }\n\n    /**\n     * Iterate the references of global variables.\n     * @template T\n     * @param {TraceMap<T>} traceMap The trace map.\n     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.\n     */\n    *iterateGlobalReferences(traceMap) {\n        for (const key of Object.keys(traceMap)) {\n            const nextTraceMap = traceMap[key]\n            const path = [key]\n            const variable = this.globalScope.set.get(key)\n\n            if (isModifiedGlobal(variable)) {\n                continue\n            }\n\n            yield* this._iterateVariableReferences(\n                /** @type {Variable} */ (variable),\n                path,\n                nextTraceMap,\n                true,\n            )\n        }\n\n        for (const key of this.globalObjectNames) {\n            /** @type {string[]} */\n            const path = []\n            const variable = this.globalScope.set.get(key)\n\n            if (isModifiedGlobal(variable)) {\n                continue\n            }\n\n            yield* this._iterateVariableReferences(\n                /** @type {Variable} */ (variable),\n                path,\n                traceMap,\n                false,\n            )\n        }\n    }\n\n    /**\n     * Iterate the references of CommonJS modules.\n     * @template T\n     * @param {TraceMap<T>} traceMap The trace map.\n     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.\n     */\n    *iterateCjsReferences(traceMap) {\n        for (const { node } of this.iterateGlobalReferences(requireCall)) {\n            const key = getStringIfConstant(\n                /** @type {CallExpression} */ (node).arguments[0],\n            )\n            if (key == null || !has(traceMap, key)) {\n                continue\n            }\n\n            const nextTraceMap = traceMap[key]\n            const path = [key]\n\n            if (nextTraceMap[READ]) {\n                yield {\n                    node,\n                    path,\n                    type: READ,\n                    info: nextTraceMap[READ],\n                }\n            }\n            yield* this._iteratePropertyReferences(\n                /** @type {CallExpression} */ (node),\n                path,\n                nextTraceMap,\n            )\n        }\n    }\n\n    /**\n     * Iterate the references of ES modules.\n     * @template T\n     * @param {TraceMap<T>} traceMap The trace map.\n     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.\n     */\n    *iterateEsmReferences(traceMap) {\n        const programNode = /** @type {Program} */ (this.globalScope.block)\n\n        for (const node of programNode.body) {\n            if (!isHasSource(node)) {\n                continue\n            }\n            const moduleId = /** @type {string} */ (node.source.value)\n\n            if (!has(traceMap, moduleId)) {\n                continue\n            }\n            const nextTraceMap = traceMap[moduleId]\n            const path = [moduleId]\n\n            if (nextTraceMap[READ]) {\n                yield {\n                    // eslint-disable-next-line object-shorthand -- apply type\n                    node: /** @type {RuleNode} */ (node),\n                    path,\n                    type: READ,\n                    info: nextTraceMap[READ],\n                }\n            }\n\n            if (node.type === \"ExportAllDeclaration\") {\n                for (const key of Object.keys(nextTraceMap)) {\n                    const exportTraceMap = nextTraceMap[key]\n                    if (exportTraceMap[READ]) {\n                        yield {\n                            // eslint-disable-next-line object-shorthand -- apply type\n                            node: /** @type {RuleNode} */ (node),\n                            path: path.concat(key),\n                            type: READ,\n                            info: exportTraceMap[READ],\n                        }\n                    }\n                }\n            } else {\n                for (const specifier of node.specifiers) {\n                    const esm = has(nextTraceMap, ESM)\n                    const it = this._iterateImportReferences(\n                        specifier,\n                        path,\n                        esm\n                            ? nextTraceMap\n                            : this.mode === \"legacy\"\n                            ? { default: nextTraceMap, ...nextTraceMap }\n                            : { default: nextTraceMap },\n                    )\n\n                    if (esm) {\n                        yield* it\n                    } else {\n                        for (const report of it) {\n                            report.path = report.path.filter(exceptDefault)\n                            if (\n                                report.path.length >= 2 ||\n                                report.type !== READ\n                            ) {\n                                yield report\n                            }\n                        }\n                    }\n                }\n            }\n        }\n    }\n\n    /**\n     * Iterate the property references for a given expression AST node.\n     * @template T\n     * @param {Expression} node The expression AST node to iterate property references.\n     * @param {TraceMap<T>} traceMap The trace map.\n     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate property references.\n     */\n    *iteratePropertyReferences(node, traceMap) {\n        yield* this._iteratePropertyReferences(node, [], traceMap)\n    }\n\n    /**\n     * Iterate the references for a given variable.\n     * @private\n     * @template T\n     * @param {Variable} variable The variable to iterate that references.\n     * @param {string[]} path The current path.\n     * @param {TraceMapObject<T>} traceMap The trace map.\n     * @param {boolean} shouldReport = The flag to report those references.\n     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.\n     */\n    *_iterateVariableReferences(variable, path, traceMap, shouldReport) {\n        if (this.variableStack.includes(variable)) {\n            return\n        }\n        this.variableStack.push(variable)\n        try {\n            for (const reference of variable.references) {\n                if (!reference.isRead()) {\n                    continue\n                }\n                const node = /** @type {RuleNode & Identifier} */ (\n                    reference.identifier\n                )\n\n                if (shouldReport && traceMap[READ]) {\n                    yield { node, path, type: READ, info: traceMap[READ] }\n                }\n                yield* this._iteratePropertyReferences(node, path, traceMap)\n            }\n        } finally {\n            this.variableStack.pop()\n        }\n    }\n\n    /**\n     * Iterate the references for a given AST node.\n     * @private\n     * @template T\n     * @param {Expression} rootNode The AST node to iterate references.\n     * @param {string[]} path The current path.\n     * @param {TraceMapObject<T>} traceMap The trace map.\n     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.\n     */\n    //eslint-disable-next-line complexity\n    *_iteratePropertyReferences(rootNode, path, traceMap) {\n        let node = rootNode\n        while (isPassThrough(node)) {\n            node = node.parent\n        }\n\n        const parent = /** @type {RuleNode} */ (node).parent\n        if (!parent) {\n            return\n        }\n        if (parent.type === \"MemberExpression\") {\n            if (parent.object === node) {\n                const key = getPropertyName(parent)\n                if (key == null || !has(traceMap, key)) {\n                    return\n                }\n\n                path = path.concat(key) //eslint-disable-line no-param-reassign\n                const nextTraceMap = traceMap[key]\n                if (nextTraceMap[READ]) {\n                    yield {\n                        node: parent,\n                        path,\n                        type: READ,\n                        info: nextTraceMap[READ],\n                    }\n                }\n                yield* this._iteratePropertyReferences(\n                    parent,\n                    path,\n                    nextTraceMap,\n                )\n            }\n            return\n        }\n        if (parent.type === \"CallExpression\") {\n            if (parent.callee === node && traceMap[CALL]) {\n                yield { node: parent, path, type: CALL, info: traceMap[CALL] }\n            }\n            return\n        }\n        if (parent.type === \"NewExpression\") {\n            if (parent.callee === node && traceMap[CONSTRUCT]) {\n                yield {\n                    node: parent,\n                    path,\n                    type: CONSTRUCT,\n                    info: traceMap[CONSTRUCT],\n                }\n            }\n            return\n        }\n        if (parent.type === \"AssignmentExpression\") {\n            if (parent.right === node) {\n                yield* this._iterateLhsReferences(parent.left, path, traceMap)\n                yield* this._iteratePropertyReferences(parent, path, traceMap)\n            }\n            return\n        }\n        if (parent.type === \"AssignmentPattern\") {\n            if (parent.right === node) {\n                yield* this._iterateLhsReferences(parent.left, path, traceMap)\n            }\n            return\n        }\n        if (parent.type === \"VariableDeclarator\") {\n            if (parent.init === node) {\n                yield* this._iterateLhsReferences(parent.id, path, traceMap)\n            }\n        }\n    }\n\n    /**\n     * Iterate the references for a given Pattern node.\n     * @private\n     * @template T\n     * @param {Pattern} patternNode The Pattern node to iterate references.\n     * @param {string[]} path The current path.\n     * @param {TraceMapObject<T>} traceMap The trace map.\n     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.\n     */\n    *_iterateLhsReferences(patternNode, path, traceMap) {\n        if (patternNode.type === \"Identifier\") {\n            const variable = findVariable(this.globalScope, patternNode)\n            if (variable != null) {\n                yield* this._iterateVariableReferences(\n                    variable,\n                    path,\n                    traceMap,\n                    false,\n                )\n            }\n            return\n        }\n        if (patternNode.type === \"ObjectPattern\") {\n            for (const property of patternNode.properties) {\n                const key = getPropertyName(\n                    /** @type {AssignmentProperty} */ (property),\n                )\n\n                if (key == null || !has(traceMap, key)) {\n                    continue\n                }\n\n                const nextPath = path.concat(key)\n                const nextTraceMap = traceMap[key]\n                if (nextTraceMap[READ]) {\n                    yield {\n                        node: /** @type {RuleNode} */ (property),\n                        path: nextPath,\n                        type: READ,\n                        info: nextTraceMap[READ],\n                    }\n                }\n                yield* this._iterateLhsReferences(\n                    /** @type {AssignmentProperty} */ (property).value,\n                    nextPath,\n                    nextTraceMap,\n                )\n            }\n            return\n        }\n        if (patternNode.type === \"AssignmentPattern\") {\n            yield* this._iterateLhsReferences(patternNode.left, path, traceMap)\n        }\n    }\n\n    /**\n     * Iterate the references for a given ModuleSpecifier node.\n     * @private\n     * @template T\n     * @param {ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier} specifierNode The ModuleSpecifier node to iterate references.\n     * @param {string[]} path The current path.\n     * @param {TraceMapObject<T>} traceMap The trace map.\n     * @returns {IterableIterator<TrackedReferences<T>>} The iterator to iterate references.\n     */\n    *_iterateImportReferences(specifierNode, path, traceMap) {\n        const type = specifierNode.type\n\n        if (type === \"ImportSpecifier\" || type === \"ImportDefaultSpecifier\") {\n            const key =\n                type === \"ImportDefaultSpecifier\"\n                    ? \"default\"\n                    : specifierNode.imported.type === \"Identifier\"\n                    ? specifierNode.imported.name\n                    : specifierNode.imported.value\n            if (!has(traceMap, key)) {\n                return\n            }\n\n            path = path.concat(key) //eslint-disable-line no-param-reassign\n            const nextTraceMap = traceMap[key]\n            if (nextTraceMap[READ]) {\n                yield {\n                    node: /** @type {RuleNode} */ (specifierNode),\n                    path,\n                    type: READ,\n                    info: nextTraceMap[READ],\n                }\n            }\n            yield* this._iterateVariableReferences(\n                /** @type {Variable} */ (\n                    findVariable(this.globalScope, specifierNode.local)\n                ),\n                path,\n                nextTraceMap,\n                false,\n            )\n\n            return\n        }\n\n        if (type === \"ImportNamespaceSpecifier\") {\n            yield* this._iterateVariableReferences(\n                /** @type {Variable} */ (\n                    findVariable(this.globalScope, specifierNode.local)\n                ),\n                path,\n                traceMap,\n                false,\n            )\n            return\n        }\n\n        if (type === \"ExportSpecifier\") {\n            const key =\n                specifierNode.local.type === \"Identifier\"\n                    ? specifierNode.local.name\n                    : specifierNode.local.value\n            if (!has(traceMap, key)) {\n                return\n            }\n\n            path = path.concat(key) //eslint-disable-line no-param-reassign\n            const nextTraceMap = traceMap[key]\n            if (nextTraceMap[READ]) {\n                yield {\n                    node: /** @type {RuleNode} */ (specifierNode),\n                    path,\n                    type: READ,\n                    info: nextTraceMap[READ],\n                }\n            }\n        }\n    }\n}\n\nReferenceTracker.READ = READ\nReferenceTracker.CALL = CALL\nReferenceTracker.CONSTRUCT = CONSTRUCT\nReferenceTracker.ESM = ESM\n\n/**\n * This is a predicate function for Array#filter.\n * @param {string} name A name part.\n * @param {number} index The index of the name.\n * @returns {boolean} `false` if it's default.\n */\nfunction exceptDefault(name, index) {\n    return !(index === 1 && name === \"default\")\n}\n","/** @typedef {import(\"./types.mjs\").StaticValue} StaticValue */\n/** @typedef {import(\"./types.mjs\").StaticValueOptional} StaticValueOptional */\n/** @typedef {import(\"./types.mjs\").StaticValueProvided} StaticValueProvided */\n/** @typedef {import(\"./types.mjs\").ReferenceTrackerOptions} ReferenceTrackerOptions */\n/**\n * @template T\n * @typedef {import(\"./types.mjs\").TraceMap<T>} TraceMap\n */\n/**\n * @template T\n * @typedef {import(\"./types.mjs\").TrackedReferences<T>} TrackedReferences\n */\n/** @typedef {import(\"./types.mjs\").HasSideEffectOptions} HasSideEffectOptions */\n/** @typedef {import(\"./types.mjs\").ArrowToken} ArrowToken */\n/** @typedef {import(\"./types.mjs\").CommaToken} CommaToken */\n/** @typedef {import(\"./types.mjs\").SemicolonToken} SemicolonToken */\n/** @typedef {import(\"./types.mjs\").ColonToken} ColonToken */\n/** @typedef {import(\"./types.mjs\").OpeningParenToken} OpeningParenToken */\n/** @typedef {import(\"./types.mjs\").ClosingParenToken} ClosingParenToken */\n/** @typedef {import(\"./types.mjs\").OpeningBracketToken} OpeningBracketToken */\n/** @typedef {import(\"./types.mjs\").ClosingBracketToken} ClosingBracketToken */\n/** @typedef {import(\"./types.mjs\").OpeningBraceToken} OpeningBraceToken */\n/** @typedef {import(\"./types.mjs\").ClosingBraceToken} ClosingBraceToken */\n\nimport { findVariable } from \"./find-variable.mjs\"\nimport { getFunctionHeadLocation } from \"./get-function-head-location.mjs\"\nimport { getFunctionNameWithKind } from \"./get-function-name-with-kind.mjs\"\nimport { getInnermostScope } from \"./get-innermost-scope.mjs\"\nimport { getPropertyName } from \"./get-property-name.mjs\"\nimport { getStaticValue } from \"./get-static-value.mjs\"\nimport { getStringIfConstant } from \"./get-string-if-constant.mjs\"\nimport { hasSideEffect } from \"./has-side-effect.mjs\"\nimport { isParenthesized } from \"./is-parenthesized.mjs\"\nimport { PatternMatcher } from \"./pattern-matcher.mjs\"\nimport {\n    CALL,\n    CONSTRUCT,\n    ESM,\n    READ,\n    ReferenceTracker,\n} from \"./reference-tracker.mjs\"\nimport {\n    isArrowToken,\n    isClosingBraceToken,\n    isClosingBracketToken,\n    isClosingParenToken,\n    isColonToken,\n    isCommaToken,\n    isCommentToken,\n    isNotArrowToken,\n    isNotClosingBraceToken,\n    isNotClosingBracketToken,\n    isNotClosingParenToken,\n    isNotColonToken,\n    isNotCommaToken,\n    isNotCommentToken,\n    isNotOpeningBraceToken,\n    isNotOpeningBracketToken,\n    isNotOpeningParenToken,\n    isNotSemicolonToken,\n    isOpeningBraceToken,\n    isOpeningBracketToken,\n    isOpeningParenToken,\n    isSemicolonToken,\n} from \"./token-predicate.mjs\"\n\nexport default {\n    CALL,\n    CONSTRUCT,\n    ESM,\n    findVariable,\n    getFunctionHeadLocation,\n    getFunctionNameWithKind,\n    getInnermostScope,\n    getPropertyName,\n    getStaticValue,\n    getStringIfConstant,\n    hasSideEffect,\n    isArrowToken,\n    isClosingBraceToken,\n    isClosingBracketToken,\n    isClosingParenToken,\n    isColonToken,\n    isCommaToken,\n    isCommentToken,\n    isNotArrowToken,\n    isNotClosingBraceToken,\n    isNotClosingBracketToken,\n    isNotClosingParenToken,\n    isNotColonToken,\n    isNotCommaToken,\n    isNotCommentToken,\n    isNotOpeningBraceToken,\n    isNotOpeningBracketToken,\n    isNotOpeningParenToken,\n    isNotSemicolonToken,\n    isOpeningBraceToken,\n    isOpeningBracketToken,\n    isOpeningParenToken,\n    isParenthesized,\n    isSemicolonToken,\n    PatternMatcher,\n    READ,\n    ReferenceTracker,\n}\nexport {\n    CALL,\n    CONSTRUCT,\n    ESM,\n    findVariable,\n    getFunctionHeadLocation,\n    getFunctionNameWithKind,\n    getInnermostScope,\n    getPropertyName,\n    getStaticValue,\n    getStringIfConstant,\n    hasSideEffect,\n    isArrowToken,\n    isClosingBraceToken,\n    isClosingBracketToken,\n    isClosingParenToken,\n    isColonToken,\n    isCommaToken,\n    isCommentToken,\n    isNotArrowToken,\n    isNotClosingBraceToken,\n    isNotClosingBracketToken,\n    isNotClosingParenToken,\n    isNotColonToken,\n    isNotCommaToken,\n    isNotCommentToken,\n    isNotOpeningBraceToken,\n    isNotOpeningBracketToken,\n    isNotOpeningParenToken,\n    isNotSemicolonToken,\n    isOpeningBraceToken,\n    isOpeningBracketToken,\n    isOpeningParenToken,\n    isParenthesized,\n    isSemicolonToken,\n    PatternMatcher,\n    READ,\n    ReferenceTracker,\n}\n"],"names":[],"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AiB;AACrB,IAAI,sBAAsB;AAC1B,IAAI,wBAAwB;AAC5B,IAAI,sBAAsB;AAC1B,IAAI,mBAAmB;AACvB,IAAI,mBAAmB;AACvB,IAAI,qBAAqB;AACzB,IAAI,mBAAmB;AACvB,IAAI,eAAe;AACnB,IAAI,gBAAgB;AACpB,IAAI,cAAc;AAClB,IAAI,IAAI;AACR,IAAI,gBAAgB;AACpB;;;;"}or_x. 40000 eslint-visitor-keys +źERC!m&~tl٭
x R100644 LICENSE U8ٽcKyd-5צB*100644 README.md ʸ23GkG40000 dist y_4<IZF~e*40000 lib NI)-g#&*/]ub100644 package.json  e T/"?xI,                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "{}"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright contributors

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
'冾xn# eslint-visitor-keys

[![npm version](https://img.shields.io/npm/v/eslint-visitor-keys.svg)](https://www.npmjs.com/package/eslint-visitor-keys)
[![Downloads/month](https://img.shields.io/npm/dm/eslint-visitor-keys.svg)](http://www.npmtrends.com/eslint-visitor-keys)
[![Build Status](https://github.com/eslint/js/workflows/CI/badge.svg)](https://github.com/eslint/js/actions)

Constants and utilities about visitor keys to traverse AST.

## 💿 Installation

Use [npm] to install.

```bash
$ npm install eslint-visitor-keys
```

### Requirements

- [Node.js] `^20.19.0`, `^22.13.0`, or `>=24`

## 📖 Usage

To use in an ESM file:

```js
import * as evk from "eslint-visitor-keys";
```

To use in a CommonJS file:

```js
const evk = require("eslint-visitor-keys");
```

### evk.KEYS

> type: `{ [type: string]: string[] | undefined }`

Visitor keys. This keys are frozen.

This is an object. Keys are the type of [ESTree] nodes. Their values are an array of property names which have child nodes.

For example:

```
console.log(evk.KEYS.AssignmentExpression) // → ["left", "right"]
```

### evk.getKeys(node)

> type: `(node: object) => string[]`

Get the visitor keys of a given AST node.

This is similar to `Object.keys(node)` of ES Standard, but some keys are excluded: `parent`, `leadingComments`, `trailingComments`, and names which start with `_`.

This will be used to traverse unknown nodes.

For example:

```js
const node = {
	type: "AssignmentExpression",
	left: { type: "Identifier", name: "foo" },
	right: { type: "Literal", value: 0 },
};
console.log(evk.getKeys(node)); // → ["type", "left", "right"]
```

### evk.unionWith(additionalKeys)

> type: `(additionalKeys: object) => { [type: string]: string[] | undefined }`

Make the union set with `evk.KEYS` and the given keys.

- The order of keys is, `additionalKeys` is at first, then `evk.KEYS` is concatenated after that.
- It removes duplicated keys as keeping the first one.

For example:

```js
console.log(
	evk.unionWith({
		MethodDefinition: ["decorators"],
	}),
); // → { ..., MethodDefinition: ["decorators", "key", "value"], ... }
```

## 📰 Change log

See [GitHub releases](https://github.com/eslint/js/releases).

## 🍻 Contributing

Welcome. See [ESLint contribution guidelines](https://eslint.org/docs/developer-guide/contributing/).

### Development commands

- `npm test` runs tests and measures code coverage.
- `npm run lint` checks source codes with ESLint.
- `npm run test:open-coverage` opens the code coverage report of the previous test with your default browser.

[npm]: https://www.npmjs.com/
[Node.js]: https://nodejs.org/
[ESTree]: https://github.com/estree/estree

<!-- NOTE: This section is autogenerated. Do not manually edit.-->
<!--sponsorsstart-->

## Sponsors

The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
to get your logo on our READMEs and [website](https://eslint.org/sponsors).

<h3>Platinum Sponsors</h3>
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a></p><h3>Gold Sponsors</h3>
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a></p><h3>Silver Sponsors</h3>
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/d472863/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/2d6c3b6/logo.png" alt="Liftoff" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" height="32"></a> <a href="https://www.crawljobs.com/"><img src="https://images.opencollective.com/crawljobs-poland/fa43a17/logo.png" alt="CrawlJobs" height="32"></a> <a href="https://depot.dev"><img src="https://images.opencollective.com/depot/39125a1/logo.png" alt="Depot" height="32"></a> <a href="https://www.n-ix.com/"><img src="https://images.opencollective.com/n-ix-ltd/575a7a5/logo.png" alt="N-iX Ltd" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="TestMu AI Open Source Office (Formerly LambdaTest)" height="32"></a></p>
<h3>Technology Sponsors</h3>
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
<!--sponsorsend-->
1k|x .6eslint-visitor-key75eslint-visitor-keym$12.22.0`, `^14.17.0`, or `>=16.0.0`
QYR&    type: "AssignmentExpression",
    +    $
}5evk.unionWith({
    ]
}))eslint-visitor-keyz
i:jH٫x D100644 eslint-visitor-keys.cjs  H4^G5rߖmթ100644 eslint-visitor-keys.d.cts {_cϙ~iØc4}100644 index.d.ts FzA»3mR100644 visitor-keys.d.ts WR5LlLex4'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

/**
 * @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
 */

/**
 * @type {VisitorKeys}
 */
const KEYS = {
    ArrayExpression: [
        "elements"
    ],
    ArrayPattern: [
        "elements"
    ],
    ArrowFunctionExpression: [
        "params",
        "body"
    ],
    AssignmentExpression: [
        "left",
        "right"
    ],
    AssignmentPattern: [
        "left",
        "right"
    ],
    AwaitExpression: [
        "argument"
    ],
    BinaryExpression: [
        "left",
        "right"
    ],
    BlockStatement: [
        "body"
    ],
    BreakStatement: [
        "label"
    ],
    CallExpression: [
        "callee",
        "arguments"
    ],
    CatchClause: [
        "param",
        "body"
    ],
    ChainExpression: [
        "expression"
    ],
    ClassBody: [
        "body"
    ],
    ClassDeclaration: [
        "id",
        "superClass",
        "body"
    ],
    ClassExpression: [
        "id",
        "superClass",
        "body"
    ],
    ConditionalExpression: [
        "test",
        "consequent",
        "alternate"
    ],
    ContinueStatement: [
        "label"
    ],
    DebuggerStatement: [],
    DoWhileStatement: [
        "body",
        "test"
    ],
    EmptyStatement: [],
    ExperimentalRestProperty: [
        "argument"
    ],
    ExperimentalSpreadProperty: [
        "argument"
    ],
    ExportAllDeclaration: [
        "exported",
        "source"
    ],
    ExportDefaultDeclaration: [
        "declaration"
    ],
    ExportNamedDeclaration: [
        "declaration",
        "specifiers",
        "source"
    ],
    ExportSpecifier: [
        "exported",
        "local"
    ],
    ExpressionStatement: [
        "expression"
    ],
    ForInStatement: [
        "left",
        "right",
        "body"
    ],
    ForOfStatement: [
        "left",
        "right",
        "body"
    ],
    ForStatement: [
        "init",
        "test",
        "update",
        "body"
    ],
    FunctionDeclaration: [
        "id",
        "params",
        "body"
    ],
    FunctionExpression: [
        "id",
        "params",
        "body"
    ],
    Identifier: [],
    IfStatement: [
        "test",
        "consequent",
        "alternate"
    ],
    ImportDeclaration: [
        "specifiers",
        "source"
    ],
    ImportDefaultSpecifier: [
        "local"
    ],
    ImportExpression: [
        "source"
    ],
    ImportNamespaceSpecifier: [
        "local"
    ],
    ImportSpecifier: [
        "imported",
        "local"
    ],
    JSXAttribute: [
        "name",
        "value"
    ],
    JSXClosingElement: [
        "name"
    ],
    JSXClosingFragment: [],
    JSXElement: [
        "openingElement",
        "children",
        "closingElement"
    ],
    JSXEmptyExpression: [],
    JSXExpressionContainer: [
        "expression"
    ],
    JSXFragment: [
        "openingFragment",
        "children",
        "closingFragment"
    ],
    JSXIdentifier: [],
    JSXMemberExpression: [
        "object",
        "property"
    ],
    JSXNamespacedName: [
        "namespace",
        "name"
    ],
    JSXOpeningElement: [
        "name",
        "attributes"
    ],
    JSXOpeningFragment: [],
    JSXSpreadAttribute: [
        "argument"
    ],
    JSXSpreadChild: [
        "expression"
    ],
    JSXText: [],
    LabeledStatement: [
        "label",
        "body"
    ],
    Literal: [],
    LogicalExpression: [
        "left",
        "right"
    ],
    MemberExpression: [
        "object",
        "property"
    ],
    MetaProperty: [
        "meta",
        "property"
    ],
    MethodDefinition: [
        "key",
        "value"
    ],
    NewExpression: [
        "callee",
        "arguments"
    ],
    ObjectExpression: [
        "properties"
    ],
    ObjectPattern: [
        "properties"
    ],
    PrivateIdentifier: [],
    Program: [
        "body"
    ],
    Property: [
        "key",
        "value"
    ],
    PropertyDefinition: [
        "key",
        "value"
    ],
    RestElement: [
        "argument"
    ],
    ReturnStatement: [
        "argument"
    ],
    SequenceExpression: [
        "expressions"
    ],
    SpreadElement: [
        "argument"
    ],
    StaticBlock: [
        "body"
    ],
    Super: [],
    SwitchCase: [
        "test",
        "consequent"
    ],
    SwitchStatement: [
        "discriminant",
        "cases"
    ],
    TaggedTemplateExpression: [
        "tag",
        "quasi"
    ],
    TemplateElement: [],
    TemplateLiteral: [
        "quasis",
        "expressions"
    ],
    ThisExpression: [],
    ThrowStatement: [
        "argument"
    ],
    TryStatement: [
        "block",
        "handler",
        "finalizer"
    ],
    UnaryExpression: [
        "argument"
    ],
    UpdateExpression: [
        "argument"
    ],
    VariableDeclaration: [
        "declarations"
    ],
    VariableDeclarator: [
        "id",
        "init"
    ],
    WhileStatement: [
        "test",
        "body"
    ],
    WithStatement: [
        "object",
        "body"
    ],
    YieldExpression: [
        "argument"
    ]
};

// Types.
const NODE_TYPES = Object.keys(KEYS);

// Freeze the keys.
for (const type of NODE_TYPES) {
    Object.freeze(KEYS[type]);
}
Object.freeze(KEYS);

/**
 * @author Toru Nagashima <https://github.com/mysticatea>
 * See LICENSE file in root directory for full license.
 */

/**
 * @typedef {import('./visitor-keys.js').VisitorKeys} VisitorKeys
 */

// List to ignore keys.
const KEY_BLACKLIST = new Set([
    "parent",
    "leadingComments",
    "trailingComments"
]);

/**
 * Check whether a given key should be used or not.
 * @param {string} key The key to check.
 * @returns {boolean} `true` if the key should be used.
 */
function filterKey(key) {
    return !KEY_BLACKLIST.has(key) && key[0] !== "_";
}

/**
 * Get visitor keys of a given node.
 * @param {object} node The AST node to get keys.
 * @returns {readonly string[]} Visitor keys of the node.
 */
function getKeys(node) {
    return Object.keys(node).filter(filterKey);
}

// Disable valid-jsdoc rule because it reports syntax error on the type of @returns.
// eslint-disable-next-line valid-jsdoc
/**
 * Make the union set with `KEYS` and given keys.
 * @param {VisitorKeys} additionalKeys The additional keys.
 * @returns {VisitorKeys} The union set.
 */
function unionWith(additionalKeys) {
    const retv = /** @type {{
        [type: string]: ReadonlyArray<string>
    }} */ (Object.assign({}, KEYS));

    for (const type of Object.keys(additionalKeys)) {
        if (Object.prototype.hasOwnProperty.call(retv, type)) {
            const keys = new Set(additionalKeys[type]);

            for (const key of retv[type]) {
                keys.add(key);
            }

            retv[type] = Object.freeze(Array.from(keys));
        } else {
            retv[type] = Object.freeze(Array.from(additionalKeys[type]));
        }
    }

    return Object.freeze(retv);
}

exports.KEYS = KEYS;
exports.getKeys = getKeys;
exports.unionWith = unionWith;
fF0xtype VisitorKeys$1 = {
    readonly [type: string]: ReadonlyArray<string>;
};
/**
 * @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
 */
/**
 * @type {VisitorKeys}
 */
declare const KEYS: VisitorKeys$1;

/**
 * Get visitor keys of a given node.
 * @param {Object} node The AST node to get keys.
 * @returns {readonly string[]} Visitor keys of the node.
 */
declare function getKeys(node: Object): readonly string[];
/**
 * Make the union set with `KEYS` and given keys.
 * @param {VisitorKeys} additionalKeys The additional keys.
 * @returns {VisitorKeys} The union set.
 */
declare function unionWith(additionalKeys: VisitorKeys): VisitorKeys;

type VisitorKeys = VisitorKeys$1;

export { KEYS, getKeys, unionWith };
export type { VisitorKeys };
	6x8 4readonly string[]Ioo3VisitorKeysNW|%xT/**
 * Get visitor keys of a given node.
 * @param {object} node The AST node to get keys.
 * @returns {readonly string[]} Visitor keys of the node.
 */
export function getKeys(node: object): readonly string[];
/**
 * Make the union set with `KEYS` and given keys.
 * @param {VisitorKeys} additionalKeys The additional keys.
 * @returns {VisitorKeys} The union set.
 */
export function unionWith(additionalKeys: VisitorKeys): VisitorKeys;
export { KEYS };
export type VisitorKeys = import('./visitor-keys.js').VisitorKeys;
import KEYS from "./visitor-keys.js";
//# sourceMappingURL=index.d.ts.mapa/x'export default KEYS;
export type VisitorKeys = {
    readonly [type: string]: ReadonlyArray<string>;
};
/**
 * @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
 */
/**
 * @type {VisitorKeys}
 */
declare const KEYS: VisitorKeys;
//# sourceMappingURL=visitor-keys.d.ts.mape4x Nreadonly string[]cČ
ïxO 100644 index.js 6"mc-UIoW5100644 visitor-keys.js $M)V(L!mx!/**
 * @author Toru Nagashima <https://github.com/mysticatea>
 * See LICENSE file in root directory for full license.
 */
import KEYS from "./visitor-keys.js";

/**
 * @typedef {import('./visitor-keys.js').VisitorKeys} VisitorKeys
 */

// List to ignore keys.
const KEY_BLACKLIST = new Set([
    "parent",
    "leadingComments",
    "trailingComments"
]);

/**
 * Check whether a given key should be used or not.
 * @param {string} key The key to check.
 * @returns {boolean} `true` if the key should be used.
 */
function filterKey(key) {
    return !KEY_BLACKLIST.has(key) && key[0] !== "_";
}

/**
 * Get visitor keys of a given node.
 * @param {object} node The AST node to get keys.
 * @returns {readonly string[]} Visitor keys of the node.
 */
export function getKeys(node) {
    return Object.keys(node).filter(filterKey);
}

// Disable valid-jsdoc rule because it reports syntax error on the type of @returns.
// eslint-disable-next-line valid-jsdoc
/**
 * Make the union set with `KEYS` and given keys.
 * @param {VisitorKeys} additionalKeys The additional keys.
 * @returns {VisitorKeys} The union set.
 */
export function unionWith(additionalKeys) {
    const retv = /** @type {{
        [type: string]: ReadonlyArray<string>
    }} */ (Object.assign({}, KEYS));

    for (const type of Object.keys(additionalKeys)) {
        if (Object.prototype.hasOwnProperty.call(retv, type)) {
            const keys = new Set(additionalKeys[type]);

            for (const key of retv[type]) {
                keys.add(key);
            }

            retv[type] = Object.freeze(Array.from(keys));
        } else {
            retv[type] = Object.freeze(Array.from(additionalKeys[type]));
        }
    }

    return Object.freeze(retv);
}

export { KEYS };
4йxV/**
 * @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
 */

/**
 * @type {VisitorKeys}
 */
const KEYS = {
    ArrayExpression: [
        "elements"
    ],
    ArrayPattern: [
        "elements"
    ],
    ArrowFunctionExpression: [
        "params",
        "body"
    ],
    AssignmentExpression: [
        "left",
        "right"
    ],
    AssignmentPattern: [
        "left",
        "right"
    ],
    AwaitExpression: [
        "argument"
    ],
    BinaryExpression: [
        "left",
        "right"
    ],
    BlockStatement: [
        "body"
    ],
    BreakStatement: [
        "label"
    ],
    CallExpression: [
        "callee",
        "arguments"
    ],
    CatchClause: [
        "param",
        "body"
    ],
    ChainExpression: [
        "expression"
    ],
    ClassBody: [
        "body"
    ],
    ClassDeclaration: [
        "id",
        "superClass",
        "body"
    ],
    ClassExpression: [
        "id",
        "superClass",
        "body"
    ],
    ConditionalExpression: [
        "test",
        "consequent",
        "alternate"
    ],
    ContinueStatement: [
        "label"
    ],
    DebuggerStatement: [],
    DoWhileStatement: [
        "body",
        "test"
    ],
    EmptyStatement: [],
    ExperimentalRestProperty: [
        "argument"
    ],
    ExperimentalSpreadProperty: [
        "argument"
    ],
    ExportAllDeclaration: [
        "exported",
        "source"
    ],
    ExportDefaultDeclaration: [
        "declaration"
    ],
    ExportNamedDeclaration: [
        "declaration",
        "specifiers",
        "source"
    ],
    ExportSpecifier: [
        "exported",
        "local"
    ],
    ExpressionStatement: [
        "expression"
    ],
    ForInStatement: [
        "left",
        "right",
        "body"
    ],
    ForOfStatement: [
        "left",
        "right",
        "body"
    ],
    ForStatement: [
        "init",
        "test",
        "update",
        "body"
    ],
    FunctionDeclaration: [
        "id",
        "params",
        "body"
    ],
    FunctionExpression: [
        "id",
        "params",
        "body"
    ],
    Identifier: [],
    IfStatement: [
        "test",
        "consequent",
        "alternate"
    ],
    ImportDeclaration: [
        "specifiers",
        "source"
    ],
    ImportDefaultSpecifier: [
        "local"
    ],
    ImportExpression: [
        "source"
    ],
    ImportNamespaceSpecifier: [
        "local"
    ],
    ImportSpecifier: [
        "imported",
        "local"
    ],
    JSXAttribute: [
        "name",
        "value"
    ],
    JSXClosingElement: [
        "name"
    ],
    JSXClosingFragment: [],
    JSXElement: [
        "openingElement",
        "children",
        "closingElement"
    ],
    JSXEmptyExpression: [],
    JSXExpressionContainer: [
        "expression"
    ],
    JSXFragment: [
        "openingFragment",
        "children",
        "closingFragment"
    ],
    JSXIdentifier: [],
    JSXMemberExpression: [
        "object",
        "property"
    ],
    JSXNamespacedName: [
        "namespace",
        "name"
    ],
    JSXOpeningElement: [
        "name",
        "attributes"
    ],
    JSXOpeningFragment: [],
    JSXSpreadAttribute: [
        "argument"
    ],
    JSXSpreadChild: [
        "expression"
    ],
    JSXText: [],
    LabeledStatement: [
        "label",
        "body"
    ],
    Literal: [],
    LogicalExpression: [
        "left",
        "right"
    ],
    MemberExpression: [
        "object",
        "property"
    ],
    MetaProperty: [
        "meta",
        "property"
    ],
    MethodDefinition: [
        "key",
        "value"
    ],
    NewExpression: [
        "callee",
        "arguments"
    ],
    ObjectExpression: [
        "properties"
    ],
    ObjectPattern: [
        "properties"
    ],
    PrivateIdentifier: [],
    Program: [
        "body"
    ],
    Property: [
        "key",
        "value"
    ],
    PropertyDefinition: [
        "key",
        "value"
    ],
    RestElement: [
        "argument"
    ],
    ReturnStatement: [
        "argument"
    ],
    SequenceExpression: [
        "expressions"
    ],
    SpreadElement: [
        "argument"
    ],
    StaticBlock: [
        "body"
    ],
    Super: [],
    SwitchCase: [
        "test",
        "consequent"
    ],
    SwitchStatement: [
        "discriminant",
        "cases"
    ],
    TaggedTemplateExpression: [
        "tag",
        "quasi"
    ],
    TemplateElement: [],
    TemplateLiteral: [
        "quasis",
        "expressions"
    ],
    ThisExpression: [],
    ThrowStatement: [
        "argument"
    ],
    TryStatement: [
        "block",
        "handler",
        "finalizer"
    ],
    UnaryExpression: [
        "argument"
    ],
    UpdateExpression: [
        "argument"
    ],
    VariableDeclaration: [
        "declarations"
    ],
    VariableDeclarator: [
        "id",
        "init"
    ],
    WhileStatement: [
        "test",
        "body"
    ],
    WithStatement: [
        "object",
        "body"
    ],
    YieldExpression: [
        "argument"
    ]
};

// Types.
const NODE_TYPES = Object.keys(KEYS);

// Freeze the keys.
for (const type of NODE_TYPES) {
    Object.freeze(KEYS[type]);
}
Object.freeze(KEYS);

export default KEYS;
̾ixj	{
  "name": "eslint-visitor-keys",
  "version": "3.4.3",
  "description": "Constants and utilities about visitor keys to traverse AST.",
  "type": "module",
  "main": "dist/eslint-visitor-keys.cjs",
  "types": "./dist/index.d.ts",
  "exports": {
    ".": [
      {
        "import": "./lib/index.js",
        "require": "./dist/eslint-visitor-keys.cjs"
      },
      "./dist/eslint-visitor-keys.cjs"
    ],
    "./package.json": "./package.json"
  },
  "files": [
    "dist/index.d.ts",
    "dist/visitor-keys.d.ts",
    "dist/eslint-visitor-keys.cjs",
    "dist/eslint-visitor-keys.d.cts",
    "lib"
  ],
  "engines": {
    "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
  },
  "devDependencies": {
    "@types/estree": "^0.0.51",
    "@types/estree-jsx": "^0.0.1",
    "@typescript-eslint/parser": "^5.14.0",
    "c8": "^7.11.0",
    "chai": "^4.3.6",
    "eslint": "^7.29.0",
    "eslint-config-eslint": "^7.0.0",
    "eslint-plugin-jsdoc": "^35.4.0",
    "eslint-plugin-node": "^11.1.0",
    "eslint-release": "^3.2.0",
    "esquery": "^1.4.0",
    "json-diff": "^0.7.3",
    "mocha": "^9.2.1",
    "opener": "^1.5.2",
    "rollup": "^2.70.0",
    "rollup-plugin-dts": "^4.2.3",
    "tsd": "^0.19.1",
    "typescript": "^4.6.2"
  },
  "scripts": {
    "build": "npm run build:cjs && npm run build:types",
    "build:cjs": "rollup -c",
    "build:debug": "npm run build:cjs -- -m && npm run build:types",
    "build:keys": "node tools/build-keys-from-ts",
    "build:types": "tsc",
    "lint": "eslint .",
    "prepare": "npm run build",
    "release:generate:latest": "eslint-generate-release",
    "release:generate:alpha": "eslint-generate-prerelease alpha",
    "release:generate:beta": "eslint-generate-prerelease beta",
    "release:generate:rc": "eslint-generate-prerelease rc",
    "release:publish": "eslint-publish-release",
    "test": "mocha tests/lib/**/*.cjs && c8 mocha tests/lib/**/*.js && npm run test:types",
    "test:open-coverage": "c8 report --reporter lcov && opener coverage/lcov-report/index.html",
    "test:types": "tsd"
  },
  "repository": "eslint/eslint-visitor-keys",
  "funding": "https://opencollective.com/eslint",
  "keywords": [],
  "author": "Toru Nagashima (https://github.com/mysticatea)",
  "license": "Apache-2.0",
  "bugs": {
    "url": "https://github.com/eslint/eslint-visitor-keys/issues"
  },
  "homepage": "https://github.com/eslint/eslint-visitor-keys#readme"
}
@x@{
    "name": "@eslint-community/eslint-utils",
    "version": "4.10.1",
    "description": "Utilities for ESLint plugins.",
    "keywords": [
        "eslint"
    ],
    "homepage": "https://github.com/eslint-community/eslint-utils#readme",
    "bugs": {
        "url": "https://github.com/eslint-community/eslint-utils/issues"
    },
    "repository": {
        "type": "git",
        "url": "https://github.com/eslint-community/eslint-utils"
    },
    "license": "MIT",
    "author": "Toru Nagashima",
    "sideEffects": false,
    "exports": {
        ".": {
            "import": "./index.mjs",
            "require": "./index.js"
        },
        "./package.json": "./package.json"
    },
    "main": "index",
    "module": "index.mjs",
    "files": [
        "index.*"
    ],
    "scripts": {
        "prebuild": "npm run -s clean",
        "build": "npm run build:dts && npm run build:rollup",
        "build:dts": "tsc -p tsconfig.build.json",
        "build:rollup": "rollup -c",
        "clean": "rimraf .nyc_output coverage index.* dist",
        "coverage": "opener ./coverage/lcov-report/index.html",
        "docs:build": "vitepress build docs",
        "docs:watch": "vitepress dev docs",
        "format": "npm run -s format:prettier -- --write",
        "format:prettier": "prettier .",
        "format:check": "npm run -s format:prettier -- --check",
        "lint:eslint": "eslint .",
        "lint:format": "npm run -s format:check",
        "lint:installed-check": "installed-check -v -i installed-check -i npm-run-all2 -i knip -i rollup-plugin-dts",
        "lint:knip": "knip",
        "lint": "run-p lint:*",
        "test-coverage": "c8 mocha --reporter dot \"test/*.mjs\"",
        "test": "mocha --reporter dot \"test/*.mjs\"",
        "preversion": "npm run test-coverage && npm run -s build",
        "postversion": "git push && git push --tags",
        "prewatch": "npm run -s clean",
        "watch": "warun \"{src,test}/**/*.mjs\" -- npm run -s test:mocha"
    },
    "dependencies": {
        "eslint-visitor-keys": "^3.4.3"
    },
    "devDependencies": {
        "@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
        "@types/eslint": "^9.6.1",
        "@types/estree": "^1.0.8",
        "@types/node": "^20.19.43",
        "@typescript-eslint/parser": "^5.62.0",
        "@typescript-eslint/types": "^5.62.0",
        "c8": "^8.0.1",
        "dot-prop": "^7.2.0",
        "eslint": "^8.57.1",
        "eslint-config-prettier": "^10.1.8",
        "eslint-plugin-n": "^15.7.0",
        "eslint-plugin-prettier": "^4.2.5",
        "globals": "^13.24.0",
        "installed-check": "^8.0.1",
        "knip": "^5.80.2",
        "mocha": "^9.2.2",
        "npm-run-all2": "^6.2.6",
        "opener": "^1.5.2",
        "prettier": "2.8.8",
        "rimraf": "^3.0.2",
        "rollup": "^2.79.2",
        "rollup-plugin-dts": "^4.2.3",
        "rollup-plugin-sourcemaps": "^0.6.3",
        "semver": "^7.7.3",
        "typescript": "^4.9.5",
        "vitepress": "^1.6.4",
        "warun": "^1.0.0"
    },
    "peerDependencies": {
        "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"
    },
    "engines": {
        "node": "^12.22.0 || ^14.17.0 || >=16.0.0"
    },
    "funding": "https://opencollective.com/eslint"
}
uӅ2x0100644 LICENSE >,6BsB 100644 README.md (Qbm?,|4100644 index.d.ts VWڲ	AY6100644 index.js ٹm)%O&JE{100644 index.js.map 
Mk~MF>!)K100644 index.mjs zt"Ijl˘J100644 index.mjs.map eϊT-Ye<QINN100644 package.json ˍWCɉ<w஡)UNy{x# @eslint-community/regexpp

[![npm version](https://img.shields.io/npm/v/@eslint-community/regexpp.svg)](https://www.npmjs.com/package/@eslint-community/regexpp)
[![Downloads/month](https://img.shields.io/npm/dm/@eslint-community/regexpp.svg)](http://www.npmtrends.com/@eslint-community/regexpp)
[![Build Status](https://github.com/eslint-community/regexpp/workflows/CI/badge.svg)](https://github.com/eslint-community/regexpp/actions)
[![codecov](https://codecov.io/gh/eslint-community/regexpp/branch/main/graph/badge.svg)](https://codecov.io/gh/eslint-community/regexpp)

A regular expression parser for ECMAScript.

## 💿 Installation

```bash
$ npm install @eslint-community/regexpp
```

- require Node@^12.0.0 || ^14.0.0 || >=16.0.0.

## 📖 Usage

```ts
import {
    AST,
    RegExpParser,
    RegExpValidator,
    RegExpVisitor,
    parseRegExpLiteral,
    validateRegExpLiteral,
    visitRegExpAST
} from "@eslint-community/regexpp"
```

### parseRegExpLiteral(source, options?)

Parse a given regular expression literal then make AST object.

This is equivalent to `new RegExpParser(options).parseLiteral(source)`.

- **Parameters:**
    - `source` (`string | RegExp`) The source code to parse.
    - `options?` ([`RegExpParser.Options`]) The options to parse.
- **Return:**
    - The AST of the regular expression.

### validateRegExpLiteral(source, options?)

Validate a given regular expression literal.

This is equivalent to `new RegExpValidator(options).validateLiteral(source)`.

- **Parameters:**
    - `source` (`string`) The source code to validate.
    - `options?` ([`RegExpValidator.Options`]) The options to validate.

### visitRegExpAST(ast, handlers)

Visit each node of a given AST.

This is equivalent to `new RegExpVisitor(handlers).visit(ast)`.

- **Parameters:**
    - `ast` ([`AST.Node`]) The AST to visit.
    - `handlers` ([`RegExpVisitor.Handlers`]) The callbacks.

### RegExpParser

#### new RegExpParser(options?)

- **Parameters:**
    - `options?` ([`RegExpParser.Options`]) The options to parse.

#### parser.parseLiteral(source, start?, end?)

Parse a regular expression literal.

- **Parameters:**
    - `source` (`string`) The source code to parse. E.g. `"/abc/g"`.
    - `start?` (`number`) The start index in the source code. Default is `0`.
    - `end?` (`number`) The end index in the source code. Default is `source.length`.
- **Return:**
    - The AST of the regular expression.

#### parser.parsePattern(source, start?, end?, flags?)

Parse a regular expression pattern.

- **Parameters:**
    - `source` (`string`) The source code to parse. E.g. `"abc"`.
    - `start?` (`number`) The start index in the source code. Default is `0`.
    - `end?` (`number`) The end index in the source code. Default is `source.length`.
    - `flags?` (`{ unicode?: boolean, unicodeSets?: boolean }`) The flags to enable Unicode mode, and Unicode Set mode.
- **Return:**
    - The AST of the regular expression pattern.

#### parser.parseFlags(source, start?, end?)

Parse a regular expression flags.

- **Parameters:**
    - `source` (`string`) The source code to parse. E.g. `"gim"`.
    - `start?` (`number`) The start index in the source code. Default is `0`.
    - `end?` (`number`) The end index in the source code. Default is `source.length`.
- **Return:**
    - The AST of the regular expression flags.

### RegExpValidator

#### new RegExpValidator(options)

- **Parameters:**
    - `options` ([`RegExpValidator.Options`]) The options to validate.

#### validator.validateLiteral(source, start, end)

Validate a regular expression literal.

- **Parameters:**
    - `source` (`string`) The source code to validate.
    - `start?` (`number`) The start index in the source code. Default is `0`.
    - `end?` (`number`) The end index in the source code. Default is `source.length`.

#### validator.validatePattern(source, start, end, flags)

Validate a regular expression pattern.

- **Parameters:**
    - `source` (`string`) The source code to validate.
    - `start?` (`number`) The start index in the source code. Default is `0`.
    - `end?` (`number`) The end index in the source code. Default is `source.length`.
    - `flags?` (`{ unicode?: boolean, unicodeSets?: boolean }`) The flags to enable Unicode mode, and Unicode Set mode.

#### validator.validateFlags(source, start, end)

Validate a regular expression flags.

- **Parameters:**
    - `source` (`string`) The source code to validate.
    - `start?` (`number`) The start index in the source code. Default is `0`.
    - `end?` (`number`) The end index in the source code. Default is `source.length`.

### RegExpVisitor

#### new RegExpVisitor(handlers)

- **Parameters:**
    - `handlers` ([`RegExpVisitor.Handlers`]) The callbacks.

#### visitor.visit(ast)

Validate a regular expression literal.

- **Parameters:**
    - `ast` ([`AST.Node`]) The AST to visit.

## 📰 Changelog

- [GitHub Releases](https://github.com/eslint-community/regexpp/releases)

## 🍻 Contributing

Welcome contributing!

Please use GitHub's Issues/PRs.

### Development Tools

- `npm test` runs tests and measures coverage.
- `npm run build` compiles TypeScript source code to `index.js`, `index.js.map`, and `index.d.ts`.
- `npm run clean` removes the temporary files which are created by `npm test` and `npm run build`.
- `npm run lint` runs ESLint.
- `npm run update:test` updates test fixtures.
- `npm run update:ids` updates `src/unicode/ids.ts`.
- `npm run watch` runs tests with `--watch` option.

[`AST.Node`]: src/ast.ts#L4
[`RegExpParser.Options`]: src/parser.ts#L743
[`RegExpValidator.Options`]: src/validator.ts#L220
[`RegExpVisitor.Handlers`]: src/visitor.ts#L291
"wxPl// Generated by dts-bundle v0.7.3

declare module "@eslint-community/regexpp" {
  import * as AST from "@eslint-community/regexpp/ast";
  import { RegExpParser } from "@eslint-community/regexpp/parser";
  import { RegExpValidator } from "@eslint-community/regexpp/validator";
  import { RegExpVisitor } from "@eslint-community/regexpp/visitor";
  export { RegExpSyntaxError } from "@eslint-community/regexpp/regexp-syntax-error";
  export { AST, RegExpParser, RegExpValidator };
  /**
   * Parse a given regular expression literal then make AST object.
   * @param source The source code to parse.
   * @param options The options to parse.
   * @returns The AST of the regular expression.
   */
  export function parseRegExpLiteral(
    source: RegExp | string,
    options?: RegExpParser.Options
  ): AST.RegExpLiteral;
  /**
   * Validate a given regular expression literal.
   * @param source The source code to validate.
   * @param options The options to validate.
   */
  export function validateRegExpLiteral(
    source: string,
    options?: RegExpValidator.Options
  ): void;
  export function visitRegExpAST(
    node: AST.Node,
    handlers: RegExpVisitor.Handlers
  ): void;
}

declare module "@eslint-community/regexpp/ast" {
  /**
   * The type which includes all nodes.
   */
  export type Node = BranchNode | LeafNode;
  /**
   * The type which includes all branch nodes.
   */
  export type BranchNode =
    | Alternative
    | CapturingGroup
    | CharacterClass
    | CharacterClassRange
    | ClassIntersection
    | ClassStringDisjunction
    | ClassSubtraction
    | ExpressionCharacterClass
    | Group
    | LookaroundAssertion
    | Modifiers
    | Pattern
    | Quantifier
    | RegExpLiteral
    | StringAlternative;
  /**
   * The type which includes all leaf nodes.
   */
  export type LeafNode =
    | Backreference
    | BoundaryAssertion
    | Character
    | CharacterSet
    | Flags
    | ModifierFlags;
  /**
   * The type which includes all atom nodes.
   */
  export type Element = Assertion | QuantifiableElement | Quantifier;
  /**
   * The type which includes all atom nodes that Quantifier node can have as children.
   */
  export type QuantifiableElement =
    | Backreference
    | CapturingGroup
    | Character
    | CharacterClass
    | CharacterSet
    | ExpressionCharacterClass
    | Group
    | LookaheadAssertion;
  /**
   * The type which includes all character class atom nodes.
   */
  export type CharacterClassElement =
    | ClassRangesCharacterClassElement
    | UnicodeSetsCharacterClassElement;
  export type ClassRangesCharacterClassElement =
    | Character
    | CharacterClassRange
    | CharacterUnicodePropertyCharacterSet
    | EscapeCharacterSet;
  export type UnicodeSetsCharacterClassElement =
    | Character
    | CharacterClassRange
    | ClassStringDisjunction
    | EscapeCharacterSet
    | ExpressionCharacterClass
    | UnicodePropertyCharacterSet
    | UnicodeSetsCharacterClass;
  /**
   * The type which defines common properties for all node types.
   */
  export interface NodeBase {
    /** The node type. */
    type: Node["type"];
    /** The parent node. */
    parent: Node["parent"];
    /** The 0-based index that this node starts. */
    start: number;
    /** The 0-based index that this node ends. */
    end: number;
    /** The raw text of this node. */
    raw: string;
  }
  /**
   * The root node.
   */
  export interface RegExpLiteral extends NodeBase {
    type: "RegExpLiteral";
    parent: null;
    pattern: Pattern;
    flags: Flags;
  }
  /**
   * The pattern.
   */
  export interface Pattern extends NodeBase {
    type: "Pattern";
    parent: RegExpLiteral | null;
    alternatives: Alternative[];
  }
  /**
   * The alternative.
   * E.g. `a|b`
   */
  export interface Alternative extends NodeBase {
    type: "Alternative";
    parent: CapturingGroup | Group | LookaroundAssertion | Pattern;
    elements: Element[];
  }
  /**
   * The uncapturing group.
   * E.g. `(?:ab)`
   */
  export interface Group extends NodeBase {
    type: "Group";
    parent: Alternative | Quantifier;
    modifiers: Modifiers | null;
    alternatives: Alternative[];
  }
  /**
   * The capturing group.
   * E.g. `(ab)`, `(?<name>ab)`
   */
  export interface CapturingGroup extends NodeBase {
    type: "CapturingGroup";
    parent: Alternative | Quantifier;
    name: string | null;
    alternatives: Alternative[];
    references: Backreference[];
  }
  /**
   * The lookaround assertion.
   */
  export type LookaroundAssertion = LookaheadAssertion | LookbehindAssertion;
  /**
   * The lookahead assertion.
   * E.g. `(?=ab)`, `(?!ab)`
   */
  export interface LookaheadAssertion extends NodeBase {
    type: "Assertion";
    parent: Alternative | Quantifier;
    kind: "lookahead";
    negate: boolean;
    alternatives: Alternative[];
  }
  /**
   * The lookbehind assertion.
   * E.g. `(?<=ab)`, `(?<!ab)`
   */
  export interface LookbehindAssertion extends NodeBase {
    type: "Assertion";
    parent: Alternative;
    kind: "lookbehind";
    negate: boolean;
    alternatives: Alternative[];
  }
  /**
   * The quantifier.
   * E.g. `a?`, `a*`, `a+`, `a{1,2}`, `a??`, `a*?`, `a+?`, `a{1,2}?`
   */
  export interface Quantifier extends NodeBase {
    type: "Quantifier";
    parent: Alternative;
    min: number;
    max: number;
    greedy: boolean;
    element: QuantifiableElement;
  }
  /**
   * The character class.
   * E.g. `[ab]`, `[^ab]`
   */
  export type CharacterClass =
    | ClassRangesCharacterClass
    | UnicodeSetsCharacterClass;
  interface BaseCharacterClass extends NodeBase {
    type: "CharacterClass";
    parent:
      | Alternative
      | ClassIntersection
      | ClassSubtraction
      | Quantifier
      | UnicodeSetsCharacterClass;
    unicodeSets: boolean;
    negate: boolean;
    elements: CharacterClassElement[];
  }
  /**
   * The character class used in legacy (neither `u` nor `v` flag) and Unicode mode (`u` flag).
   *
   * This character class is guaranteed to **not** contain strings.
   *
   * In Unicode sets mode (`v` flag), {@link UnicodeSetsCharacterClass} is used.
   */
  export interface ClassRangesCharacterClass extends BaseCharacterClass {
    parent: Alternative | Quantifier;
    unicodeSets: false;
    elements: ClassRangesCharacterClassElement[];
  }
  /**
   * The character class used in Unicode sets mode (`v` flag).
   *
   * This character class may contain strings.
   */
  export interface UnicodeSetsCharacterClass extends BaseCharacterClass {
    parent:
      | Alternative
      | ClassIntersection
      | ClassSubtraction
      | Quantifier
      | UnicodeSetsCharacterClass;
    unicodeSets: true;
    elements: UnicodeSetsCharacterClassElement[];
  }
  /**
   * The character class.
   * E.g. `[a-b]`
   */
  export interface CharacterClassRange extends NodeBase {
    type: "CharacterClassRange";
    parent: CharacterClass;
    min: Character;
    max: Character;
  }
  /**
   * The assertion.
   */
  export type Assertion = BoundaryAssertion | LookaroundAssertion;
  /**
   * The boundary assertion.
   */
  export type BoundaryAssertion = EdgeAssertion | WordBoundaryAssertion;
  /**
   * The edge boundary assertion.
   * E.g. `^`, `$`
   */
  export interface EdgeAssertion extends NodeBase {
    type: "Assertion";
    parent: Alternative | Quantifier;
    kind: "end" | "start";
  }
  /**
   * The word bondary assertion.
   * E.g. `\b`, `\B`
   */
  export interface WordBoundaryAssertion extends NodeBase {
    type: "Assertion";
    parent: Alternative | Quantifier;
    kind: "word";
    negate: boolean;
  }
  /**
   * The character set.
   */
  export type CharacterSet =
    | AnyCharacterSet
    | EscapeCharacterSet
    | UnicodePropertyCharacterSet;
  /**
   * The dot.
   * E.g. `.`
   */
  export interface AnyCharacterSet extends NodeBase {
    type: "CharacterSet";
    parent: Alternative | Quantifier;
    kind: "any";
  }
  /**
   * The character class escape.
   * E.g. `\d`, `\s`, `\w`, `\D`, `\S`, `\W`
   */
  export interface EscapeCharacterSet extends NodeBase {
    type: "CharacterSet";
    parent:
      | Alternative
      | CharacterClass
      | ClassIntersection
      | ClassSubtraction
      | Quantifier;
    kind: "digit" | "space" | "word";
    negate: boolean;
  }
  /**
   * The unicode property escape.
   * E.g. `\p{ASCII}`, `\P{ASCII}`, `\p{Script=Hiragana}`
   */
  export type UnicodePropertyCharacterSet =
    | CharacterUnicodePropertyCharacterSet
    | StringsUnicodePropertyCharacterSet;
  interface BaseUnicodePropertyCharacterSet extends NodeBase {
    type: "CharacterSet";
    parent:
      | Alternative
      | CharacterClass
      | ClassIntersection
      | ClassSubtraction
      | Quantifier;
    kind: "property";
    strings: boolean;
    key: string;
    value: string | null;
    negate: boolean;
  }
  export interface CharacterUnicodePropertyCharacterSet
    extends BaseUnicodePropertyCharacterSet {
    strings: false;
    value: string | null;
    negate: boolean;
  }
  /** StringsUnicodePropertyCharacterSet is Unicode property escape with property of strings. */
  export interface StringsUnicodePropertyCharacterSet
    extends BaseUnicodePropertyCharacterSet {
    parent:
      | Alternative
      | ClassIntersection
      | ClassSubtraction
      | Quantifier
      | UnicodeSetsCharacterClass;
    strings: true;
    value: null;
    negate: false;
  }
  /**
   * The expression character class.
   * E.g. `[a--b]`, `[a&&b]`,`[^a--b]`, `[^a&&b]`
   */
  export interface ExpressionCharacterClass extends NodeBase {
    type: "ExpressionCharacterClass";
    parent:
      | Alternative
      | ClassIntersection
      | ClassSubtraction
      | Quantifier
      | UnicodeSetsCharacterClass;
    negate: boolean;
    expression: ClassIntersection | ClassSubtraction;
  }
  export type ClassSetOperand =
    | Character
    | ClassStringDisjunction
    | EscapeCharacterSet
    | ExpressionCharacterClass
    | UnicodePropertyCharacterSet
    | UnicodeSetsCharacterClass;
  /**
   * The character class intersection.
   * E.g. `a&&b`
   */
  export interface ClassIntersection extends NodeBase {
    type: "ClassIntersection";
    parent: ClassIntersection | ExpressionCharacterClass;
    left: ClassIntersection | ClassSetOperand;
    right: ClassSetOperand;
  }
  /**
   * The character class subtraction.
   * E.g. `a--b`
   */
  export interface ClassSubtraction extends NodeBase {
    type: "ClassSubtraction";
    parent: ClassSubtraction | ExpressionCharacterClass;
    left: ClassSetOperand | ClassSubtraction;
    right: ClassSetOperand;
  }
  /**
   * The character class string disjunction.
   * E.g. `\q{a|b}`
   */
  export interface ClassStringDisjunction extends NodeBase {
    type: "ClassStringDisjunction";
    parent: ClassIntersection | ClassSubtraction | UnicodeSetsCharacterClass;
    alternatives: StringAlternative[];
  }
  /** StringAlternative is only used for `\q{alt}`({@link ClassStringDisjunction}). */
  export interface StringAlternative extends NodeBase {
    type: "StringAlternative";
    parent: ClassStringDisjunction;
    elements: Character[];
  }
  /**
   * The character.
   * This includes escape sequences which mean a character.
   * E.g. `a`, `あ`, `✿`, `\x65`, `\u0065`, `\u{65}`, `\/`
   */
  export interface Character extends NodeBase {
    type: "Character";
    parent:
      | Alternative
      | CharacterClass
      | CharacterClassRange
      | ClassIntersection
      | ClassSubtraction
      | Quantifier
      | StringAlternative;
    value: number;
  }
  /**
   * The backreference.
   * E.g. `\1`, `\k<name>`
   */
  export type Backreference = AmbiguousBackreference | UnambiguousBackreference;
  interface BaseBackreference extends NodeBase {
    type: "Backreference";
    parent: Alternative | Quantifier;
    ref: number | string;
    ambiguous: boolean;
    resolved: CapturingGroup | CapturingGroup[];
  }
  export interface AmbiguousBackreference extends BaseBackreference {
    ref: string;
    ambiguous: true;
    resolved: CapturingGroup[];
  }
  export interface UnambiguousBackreference extends BaseBackreference {
    ambiguous: false;
    resolved: CapturingGroup;
  }
  /**
   * The modifiers.
   */
  export interface Modifiers extends NodeBase {
    type: "Modifiers";
    parent: Group;
    /**
     * The add modifier flags.
     */
    add: ModifierFlags;
    /**
     * The remove modifier flags.
     *
     * `null` means no remove modifier flags. e.g. `(?ims:x)`
     * The reason for `null` is that there is no position where the remove modifier flags appears. Must be behind the minus mark.
     */
    remove: ModifierFlags | null;
  }
  /**
   * The modifier flags.
   */
  export interface ModifierFlags extends NodeBase {
    type: "ModifierFlags";
    parent: Modifiers;
    dotAll: boolean;
    ignoreCase: boolean;
    multiline: boolean;
  }
  /**
   * The flags.
   */
  export interface Flags extends NodeBase {
    type: "Flags";
    parent: RegExpLiteral | null;
    dotAll: boolean;
    global: boolean;
    hasIndices: boolean;
    ignoreCase: boolean;
    multiline: boolean;
    sticky: boolean;
    unicode: boolean;
    unicodeSets: boolean;
  }
  export {};
}

declare module "@eslint-community/regexpp/parser" {
  import type {
    Flags,
    RegExpLiteral,
    Pattern,
  } from "@eslint-community/regexpp/ast";
  import type { EcmaVersion } from "@eslint-community/regexpp/ecma-versions";
  export namespace RegExpParser {
    /**
     * The options for RegExpParser construction.
     */
    interface Options {
      /**
       * The flag to disable Annex B syntax. Default is `false`.
       */
      strict?: boolean;
      /**
       * ECMAScript version. Default is `2025`.
       * - `2015` added `u` and `y` flags.
       * - `2018` added `s` flag, Named Capturing Group, Lookbehind Assertion,
       *   and Unicode Property Escape.
       * - `2019`, `2020`, and `2021` added more valid Unicode Property Escapes.
       * - `2022` added `d` flag.
       * - `2023` added more valid Unicode Property Escapes.
       * - `2024` added `v` flag.
       * - `2025` added duplicate named capturing groups, modifiers.
       */
      ecmaVersion?: EcmaVersion;
    }
  }
  export class RegExpParser {
    /**
     * Initialize this parser.
     * @param options The options of parser.
     */
    constructor(options?: RegExpParser.Options);
    /**
     * Parse a regular expression literal. E.g. "/abc/g"
     * @param source The source code to parse.
     * @param start The start index in the source code.
     * @param end The end index in the source code.
     * @returns The AST of the given regular expression.
     */
    parseLiteral(source: string, start?: number, end?: number): RegExpLiteral;
    /**
     * Parse a regular expression flags. E.g. "gim"
     * @param source The source code to parse.
     * @param start The start index in the source code.
     * @param end The end index in the source code.
     * @returns The AST of the given flags.
     */
    parseFlags(source: string, start?: number, end?: number): Flags;
    /**
     * Parse a regular expression pattern. E.g. "abc"
     * @param source The source code to parse.
     * @param start The start index in the source code.
     * @param end The end index in the source code.
     * @param flags The flags.
     * @returns The AST of the given pattern.
     */
    parsePattern(
      source: string,
      start?: number,
      end?: number,
      flags?: {
        unicode?: boolean;
        unicodeSets?: boolean;
      }
    ): Pattern;
    /**
     * @deprecated Backward compatibility
     * Use object `flags` instead of boolean `uFlag`.
     *
     * @param source The source code to parse.
     * @param start The start index in the source code.
     * @param end The end index in the source code.
     * @param uFlag The flag to set unicode mode.
     * @returns The AST of the given pattern.
     */
    parsePattern(
      source: string,
      start?: number,
      end?: number,
      uFlag?: boolean
    ): Pattern;
  }
}

declare module "@eslint-community/regexpp/validator" {
  import type { EcmaVersion } from "@eslint-community/regexpp/ecma-versions";
  export type RegExpValidatorSourceContext = {
    readonly source: string;
    readonly start: number;
    readonly end: number;
    readonly kind: "flags" | "literal" | "pattern";
  };
  export namespace RegExpValidator {
    /**
     * The options for RegExpValidator construction.
     */
    interface Options {
      /**
       * The flag to disable Annex B syntax. Default is `false`.
       */
      strict?: boolean;
      /**
       * ECMAScript version. Default is `2025`.
       * - `2015` added `u` and `y` flags.
       * - `2018` added `s` flag, Named Capturing Group, Lookbehind Assertion,
       *   and Unicode Property Escape.
       * - `2019`, `2020`, and `2021` added more valid Unicode Property Escapes.
       * - `2022` added `d` flag.
       * - `2023` added more valid Unicode Property Escapes.
       * - `2024` added `v` flag.
       * - `2025` added duplicate named capturing groups, modifiers.
       */
      ecmaVersion?: EcmaVersion;
      /**
       * A function that is called when the validator entered a RegExp literal.
       * @param start The 0-based index of the first character.
       */
      onLiteralEnter?: (start: number) => void;
      /**
       * A function that is called when the validator left a RegExp literal.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       */
      onLiteralLeave?: (start: number, end: number) => void;
      /**
       * A function that is called when the validator found flags.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param flags.global `g` flag.
       * @param flags.ignoreCase `i` flag.
       * @param flags.multiline `m` flag.
       * @param flags.unicode `u` flag.
       * @param flags.sticky `y` flag.
       * @param flags.dotAll `s` flag.
       * @param flags.hasIndices `d` flag.
       * @param flags.unicodeSets `v` flag.
       */
      onRegExpFlags?: (
        start: number,
        end: number,
        flags: {
          global: boolean;
          ignoreCase: boolean;
          multiline: boolean;
          unicode: boolean;
          sticky: boolean;
          dotAll: boolean;
          hasIndices: boolean;
          unicodeSets: boolean;
        }
      ) => void;
      /**
       * A function that is called when the validator found flags.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param global `g` flag.
       * @param ignoreCase `i` flag.
       * @param multiline `m` flag.
       * @param unicode `u` flag.
       * @param sticky `y` flag.
       * @param dotAll `s` flag.
       * @param hasIndices `d` flag.
       *
       * @deprecated Use `onRegExpFlags` instead.
       */
      onFlags?: (
        start: number,
        end: number,
        global: boolean,
        ignoreCase: boolean,
        multiline: boolean,
        unicode: boolean,
        sticky: boolean,
        dotAll: boolean,
        hasIndices: boolean
      ) => void;
      /**
       * A function that is called when the validator entered a pattern.
       * @param start The 0-based index of the first character.
       */
      onPatternEnter?: (start: number) => void;
      /**
       * A function that is called when the validator left a pattern.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       */
      onPatternLeave?: (start: number, end: number) => void;
      /**
       * A function that is called when the validator entered a disjunction.
       * @param start The 0-based index of the first character.
       */
      onDisjunctionEnter?: (start: number) => void;
      /**
       * A function that is called when the validator left a disjunction.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       */
      onDisjunctionLeave?: (start: number, end: number) => void;
      /**
       * A function that is called when the validator entered an alternative.
       * @param start The 0-based index of the first character.
       * @param index The 0-based index of alternatives in a disjunction.
       */
      onAlternativeEnter?: (start: number, index: number) => void;
      /**
       * A function that is called when the validator left an alternative.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param index The 0-based index of alternatives in a disjunction.
       */
      onAlternativeLeave?: (start: number, end: number, index: number) => void;
      /**
       * A function that is called when the validator entered an uncapturing group.
       * @param start The 0-based index of the first character.
       */
      onGroupEnter?: (start: number) => void;
      /**
       * A function that is called when the validator left an uncapturing group.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       */
      onGroupLeave?: (start: number, end: number) => void;
      /**
       * A function that is called when the validator entered a modifiers.
       * @param start The 0-based index of the first character.
       */
      onModifiersEnter?: (start: number) => void;
      /**
       * A function that is called when the validator left a modifiers.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       */
      onModifiersLeave?: (start: number, end: number) => void;
      /**
       * A function that is called when the validator found an add modifiers.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param flags flags.
       * @param flags.ignoreCase `i` flag.
       * @param flags.multiline `m` flag.
       * @param flags.dotAll `s` flag.
       */
      onAddModifiers?: (
        start: number,
        end: number,
        flags: {
          ignoreCase: boolean;
          multiline: boolean;
          dotAll: boolean;
        }
      ) => void;
      /**
       * A function that is called when the validator found a remove modifiers.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param flags flags.
       * @param flags.ignoreCase `i` flag.
       * @param flags.multiline `m` flag.
       * @param flags.dotAll `s` flag.
       */
      onRemoveModifiers?: (
        start: number,
        end: number,
        flags: {
          ignoreCase: boolean;
          multiline: boolean;
          dotAll: boolean;
        }
      ) => void;
      /**
       * A function that is called when the validator entered a capturing group.
       * @param start The 0-based index of the first character.
       * @param name The group name.
       */
      onCapturingGroupEnter?: (start: number, name: string | null) => void;
      /**
       * A function that is called when the validator left a capturing group.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param name The group name.
       */
      onCapturingGroupLeave?: (
        start: number,
        end: number,
        name: string | null
      ) => void;
      /**
       * A function that is called when the validator found a quantifier.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param min The minimum number of repeating.
       * @param max The maximum number of repeating.
       * @param greedy The flag to choose the longest matching.
       */
      onQuantifier?: (
        start: number,
        end: number,
        min: number,
        max: number,
        greedy: boolean
      ) => void;
      /**
       * A function that is called when the validator entered a lookahead/lookbehind assertion.
       * @param start The 0-based index of the first character.
       * @param kind The kind of the assertion.
       * @param negate The flag which represents that the assertion is negative.
       */
      onLookaroundAssertionEnter?: (
        start: number,
        kind: "lookahead" | "lookbehind",
        negate: boolean
      ) => void;
      /**
       * A function that is called when the validator left a lookahead/lookbehind assertion.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param kind The kind of the assertion.
       * @param negate The flag which represents that the assertion is negative.
       */
      onLookaroundAssertionLeave?: (
        start: number,
        end: number,
        kind: "lookahead" | "lookbehind",
        negate: boolean
      ) => void;
      /**
       * A function that is called when the validator found an edge boundary assertion.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param kind The kind of the assertion.
       */
      onEdgeAssertion?: (
        start: number,
        end: number,
        kind: "end" | "start"
      ) => void;
      /**
       * A function that is called when the validator found a word boundary assertion.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param kind The kind of the assertion.
       * @param negate The flag which represents that the assertion is negative.
       */
      onWordBoundaryAssertion?: (
        start: number,
        end: number,
        kind: "word",
        negate: boolean
      ) => void;
      /**
       * A function that is called when the validator found a dot.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param kind The kind of the character set.
       */
      onAnyCharacterSet?: (start: number, end: number, kind: "any") => void;
      /**
       * A function that is called when the validator found a character set escape.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param kind The kind of the character set.
       * @param negate The flag which represents that the character set is negative.
       */
      onEscapeCharacterSet?: (
        start: number,
        end: number,
        kind: "digit" | "space" | "word",
        negate: boolean
      ) => void;
      /**
       * A function that is called when the validator found a Unicode proerty escape.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param kind The kind of the character set.
       * @param key The property name.
       * @param value The property value.
       * @param negate The flag which represents that the character set is negative.
       * @param strings If true, the given property is property of strings.
       */
      onUnicodePropertyCharacterSet?: (
        start: number,
        end: number,
        kind: "property",
        key: string,
        value: string | null,
        negate: boolean,
        strings: boolean
      ) => void;
      /**
       * A function that is called when the validator found a character.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param value The code point of the character.
       */
      onCharacter?: (start: number, end: number, value: number) => void;
      /**
       * A function that is called when the validator found a backreference.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param ref The key of the referred capturing group.
       */
      onBackreference?: (
        start: number,
        end: number,
        ref: number | string
      ) => void;
      /**
       * A function that is called when the validator entered a character class.
       * @param start The 0-based index of the first character.
       * @param negate The flag which represents that the character class is negative.
       * @param unicodeSets `true` if unicodeSets mode.
       */
      onCharacterClassEnter?: (
        start: number,
        negate: boolean,
        unicodeSets: boolean
      ) => void;
      /**
       * A function that is called when the validator left a character class.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param negate The flag which represents that the character class is negative.
       */
      onCharacterClassLeave?: (
        start: number,
        end: number,
        negate: boolean
      ) => void;
      /**
       * A function that is called when the validator found a character class range.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param min The minimum code point of the range.
       * @param max The maximum code point of the range.
       */
      onCharacterClassRange?: (
        start: number,
        end: number,
        min: number,
        max: number
      ) => void;
      /**
       * A function that is called when the validator found a class intersection.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       */
      onClassIntersection?: (start: number, end: number) => void;
      /**
       * A function that is called when the validator found a class subtraction.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       */
      onClassSubtraction?: (start: number, end: number) => void;
      /**
       * A function that is called when the validator entered a class string disjunction.
       * @param start The 0-based index of the first character.
       */
      onClassStringDisjunctionEnter?: (start: number) => void;
      /**
       * A function that is called when the validator left a class string disjunction.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       */
      onClassStringDisjunctionLeave?: (start: number, end: number) => void;
      /**
       * A function that is called when the validator entered a string alternative.
       * @param start The 0-based index of the first character.
       * @param index The 0-based index of alternatives in a disjunction.
       */
      onStringAlternativeEnter?: (start: number, index: number) => void;
      /**
       * A function that is called when the validator left a string alternative.
       * @param start The 0-based index of the first character.
       * @param end The next 0-based index of the last character.
       * @param index The 0-based index of alternatives in a disjunction.
       */
      onStringAlternativeLeave?: (
        start: number,
        end: number,
        index: number
      ) => void;
    }
  }
  /**
   * The regular expression validator.
   */
  export class RegExpValidator {
    /**
     * Initialize this validator.
     * @param options The options of validator.
     */
    constructor(options?: RegExpValidator.Options);
    /**
     * Validate a regular expression literal. E.g. "/abc/g"
     * @param source The source code to validate.
     * @param start The start index in the source code.
     * @param end The end index in the source code.
     */
    validateLiteral(source: string, start?: number, end?: number): void;
    /**
     * Validate a regular expression flags. E.g. "gim"
     * @param source The source code to validate.
     * @param start The start index in the source code.
     * @param end The end index in the source code.
     */
    validateFlags(source: string, start?: number, end?: number): void;
    /**
     * Validate a regular expression pattern. E.g. "abc"
     * @param source The source code to validate.
     * @param start The start index in the source code.
     * @param end The end index in the source code.
     * @param flags The flags.
     */
    validatePattern(
      source: string,
      start?: number,
      end?: number,
      flags?: {
        unicode?: boolean;
        unicodeSets?: boolean;
      }
    ): void;
    /**
     * @deprecated Backward compatibility
     * Use object `flags` instead of boolean `uFlag`.
     * @param source The source code to validate.
     * @param start The start index in the source code.
     * @param end The end index in the source code.
     * @param uFlag The flag to set unicode mode.
     */
    validatePattern(
      source: string,
      start?: number,
      end?: number,
      uFlag?: boolean
    ): void;
  }
}

declare module "@eslint-community/regexpp/visitor" {
  import type {
    Alternative,
    Assertion,
    Backreference,
    CapturingGroup,
    Character,
    CharacterClass,
    CharacterClassRange,
    CharacterSet,
    ClassIntersection,
    ClassStringDisjunction,
    ClassSubtraction,
    ExpressionCharacterClass,
    Flags,
    Group,
    ModifierFlags,
    Modifiers,
    Node,
    Pattern,
    Quantifier,
    RegExpLiteral,
    StringAlternative,
  } from "@eslint-community/regexpp/ast";
  /**
   * The visitor to walk on AST.
   */
  export class RegExpVisitor {
    /**
     * Initialize this visitor.
     * @param handlers Callbacks for each node.
     */
    constructor(handlers: RegExpVisitor.Handlers);
    /**
     * Visit a given node and descendant nodes.
     * @param node The root node to visit tree.
     */
    visit(node: Node): void;
  }
  export namespace RegExpVisitor {
    interface Handlers {
      onAlternativeEnter?: (node: Alternative) => void;
      onAlternativeLeave?: (node: Alternative) => void;
      onAssertionEnter?: (node: Assertion) => void;
      onAssertionLeave?: (node: Assertion) => void;
      onBackreferenceEnter?: (node: Backreference) => void;
      onBackreferenceLeave?: (node: Backreference) => void;
      onCapturingGroupEnter?: (node: CapturingGroup) => void;
      onCapturingGroupLeave?: (node: CapturingGroup) => void;
      onCharacterEnter?: (node: Character) => void;
      onCharacterLeave?: (node: Character) => void;
      onCharacterClassEnter?: (node: CharacterClass) => void;
      onCharacterClassLeave?: (node: CharacterClass) => void;
      onCharacterClassRangeEnter?: (node: CharacterClassRange) => void;
      onCharacterClassRangeLeave?: (node: CharacterClassRange) => void;
      onCharacterSetEnter?: (node: CharacterSet) => void;
      onCharacterSetLeave?: (node: CharacterSet) => void;
      onClassIntersectionEnter?: (node: ClassIntersection) => void;
      onClassIntersectionLeave?: (node: ClassIntersection) => void;
      onClassStringDisjunctionEnter?: (node: ClassStringDisjunction) => void;
      onClassStringDisjunctionLeave?: (node: ClassStringDisjunction) => void;
      onClassSubtractionEnter?: (node: ClassSubtraction) => void;
      onClassSubtractionLeave?: (node: ClassSubtraction) => void;
      onExpressionCharacterClassEnter?: (
        node: ExpressionCharacterClass
      ) => void;
      onExpressionCharacterClassLeave?: (
        node: ExpressionCharacterClass
      ) => void;
      onFlagsEnter?: (node: Flags) => void;
      onFlagsLeave?: (node: Flags) => void;
      onGroupEnter?: (node: Group) => void;
      onGroupLeave?: (node: Group) => void;
      onModifierFlagsEnter?: (node: ModifierFlags) => void;
      onModifierFlagsLeave?: (node: ModifierFlags) => void;
      onModifiersEnter?: (node: Modifiers) => void;
      onModifiersLeave?: (node: Modifiers) => void;
      onPatternEnter?: (node: Pattern) => void;
      onPatternLeave?: (node: Pattern) => void;
      onQuantifierEnter?: (node: Quantifier) => void;
      onQuantifierLeave?: (node: Quantifier) => void;
      onRegExpLiteralEnter?: (node: RegExpLiteral) => void;
      onRegExpLiteralLeave?: (node: RegExpLiteral) => void;
      onStringAlternativeEnter?: (node: StringAlternative) => void;
      onStringAlternativeLeave?: (node: StringAlternative) => void;
    }
  }
}

declare module "@eslint-community/regexpp/regexp-syntax-error" {
  import type { RegExpValidatorSourceContext } from "@eslint-community/regexpp/validator";
  export class RegExpSyntaxError extends SyntaxError {
    index: number;
    constructor(message: string, index: number);
  }
  export function newRegExpSyntaxError(
    srcCtx: RegExpValidatorSourceContext,
    flags: {
      unicode: boolean;
      unicodeSets: boolean;
    },
    index: number,
    message: string
  ): RegExpSyntaxError;
}

declare module "@eslint-community/regexpp/ecma-versions" {
  export type EcmaVersion =
    | 5
    | 2015
    | 2016
    | 2017
    | 2018
    | 2019
    | 2020
    | 2021
    | 2022
    | 2023
    | 2024
    | 2025;
  export const latestEcmaVersion = 2025;
}
k5x   'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var ast = /*#__PURE__*/Object.freeze({
    __proto__: null
});

const latestEcmaVersion = 2025;

let largeIdStartRanges = undefined;
let largeIdContinueRanges = undefined;
function isIdStart(cp) {
    if (cp < 0x41)
        return false;
    if (cp < 0x5b)
        return true;
    if (cp < 0x61)
        return false;
    if (cp < 0x7b)
        return true;
    return isLargeIdStart(cp);
}
function isIdContinue(cp) {
    if (cp < 0x30)
        return false;
    if (cp < 0x3a)
        return true;
    if (cp < 0x41)
        return false;
    if (cp < 0x5b)
        return true;
    if (cp === 0x5f)
        return true;
    if (cp < 0x61)
        return false;
    if (cp < 0x7b)
        return true;
    return isLargeIdStart(cp) || isLargeIdContinue(cp);
}
function isLargeIdStart(cp) {
    return isInRange(cp, largeIdStartRanges !== null && largeIdStartRanges !== void 0 ? largeIdStartRanges : (largeIdStartRanges = initLargeIdStartRanges()));
}
function isLargeIdContinue(cp) {
    return isInRange(cp, largeIdContinueRanges !== null && largeIdContinueRanges !== void 0 ? largeIdContinueRanges : (largeIdContinueRanges = initLargeIdContinueRanges()));
}
function initLargeIdStartRanges() {
    return restoreRanges("4q 0 b 0 5 0 6 m 2 u 2 cp 5 b f 4 8 0 2 0 3m 4 2 1 3 3 2 0 7 0 2 2 2 0 2 j 2 2a 2 3u 9 4l 2 11 3 0 7 14 20 q 5 3 1a 16 10 1 2 2q 2 0 g 1 8 1 b 2 3 0 h 0 2 t u 2g c 0 p w a 1 5 0 6 l 5 0 a 0 4 0 o o 8 a 6 n 2 6 h 15 1n 1h 4 0 j 0 8 9 g f 5 7 3 1 3 l 2 6 2 0 4 3 4 0 h 0 e 1 2 2 f 1 b 0 9 5 5 1 3 l 2 6 2 1 2 1 2 1 w 3 2 0 k 2 h 8 2 2 2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p 2 3 a 8 2 d 5 3 5 3 5 a 6 2 6 2 16 2 d 7 36 u 8mb d m 5 1c 6it a5 3 2x 13 6 d 4 6 0 2 9 2 c 2 4 2 0 2 1 2 1 2 2z y a2 j 1r 3 1h 15 b 39 4 2 3q 11 p 7 p c 2g 4 5 3 5 3 5 3 2 10 b 2 p 2 i 2 1 2 e 3 d z 3e 1y 1g 7g s 4 1c 1c v e t 6 11 b t 3 z 5 7 2 4 17 4d j z 5 z 5 13 9 1f d a 2 e 2 6 2 1 2 a 2 e 2 6 2 1 4 1f d 8m a l b 7 p 5 2 15 2 8 1y 5 3 0 2 17 2 1 4 0 3 m b m a u 1u i 2 1 b l b p 7 p 13 1j 7 1 1t 0 g 3 2 2 2 s 17 s 4 s 10 7 2 r s 1h b l b i e h 33 20 1k 1e e 1e e z 13 r a m 6z 15 7 1 h 5 1l s b 0 9 l 17 h 1b k s m d 1g 1m 1 3 0 e 18 x o r z u 0 3 0 9 y 4 0 d 1b f 3 m 0 2 0 10 h 2 o k 1 1s 6 2 0 2 3 2 e 2 9 8 1a 13 7 3 1 3 l 2 6 2 1 2 4 4 0 j 0 d 4 v 9 2 0 3 0 2 11 2 0 q 0 2 0 19 1g j 3 l 2 v 1b l 1 2 0 55 1a 16 3 11 1b l 0 1o 16 e 0 20 q 12 6 56 17 39 1r w 7 3 0 3 7 2 1 2 n g 0 2 0 2n 7 3 12 h 0 2 0 t 0 b 13 8 0 m 0 c 19 k 0 j 20 5k w w 8 2 10 i 0 1e t 35 6 2 1 2 11 m 0 q 5 2 1 2 v f 0 o 17 79 i g 0 2 c 2 x 3h 0 28 pl 2v 32 i 5f 219 2o g tr i 5 q 32y 6 g6 5a2 t 1cz fs 8 u i 26 i t j 1b h 3 w k 6 i c1 18 5w 1r x o 3 o 19 22 6 0 1v c 1t 1 2 0 f 4 a 5p1 16 v 2q 36 6pq 3 2 6 2 1 2 82 g 0 u 2 3 0 f 3 9 az 1s5 2y 6 c 4 8 8 9 4mf 2c 2 1y 2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6 32 6 6 9 3o7 9 gvt3 6n");
}
function isInRange(cp, ranges) {
    let l = 0, r = (ranges.length / 2) | 0, i = 0, min = 0, max = 0;
    while (l < r) {
        i = ((l + r) / 2) | 0;
        min = ranges[2 * i];
        max = ranges[2 * i + 1];
        if (cp < min) {
            r = i;
        }
        else if (cp > max) {
            l = i + 1;
        }
        else {
            return true;
        }
    }
    return false;
}
function restoreRanges(data) {
    let last = 0;
    return data.split(" ").map((s) => (last += parseInt(s, 36) | 0));
}

class DataSet {
    constructor(raw2018, raw2019, raw2020, raw2021, raw2022, raw2023, raw2024, raw2025, raw2026) {
        this._raw2018 = raw2018;
        this._raw2019 = raw2019;
        this._raw2020 = raw2020;
        this._raw2021 = raw2021;
        this._raw2022 = raw2022;
        this._raw2023 = raw2023;
        this._raw2024 = raw2024;
        this._raw2025 = raw2025;
        this._raw2026 = raw2026;
    }
    get es2018() {
        var _a;
        return ((_a = this._set2018) !== null && _a !== void 0 ? _a : (this._set2018 = new Set(this._raw2018.split(" "))));
    }
    get es2019() {
        var _a;
        return ((_a = this._set2019) !== null && _a !== void 0 ? _a : (this._set2019 = new Set(this._raw2019.split(" "))));
    }
    get es2020() {
        var _a;
        return ((_a = this._set2020) !== null && _a !== void 0 ? _a : (this._set2020 = new Set(this._raw2020.split(" "))));
    }
    get es2021() {
        var _a;
        return ((_a = this._set2021) !== null && _a !== void 0 ? _a : (this._set2021 = new Set(this._raw2021.split(" "))));
    }
    get es2022() {
        var _a;
        return ((_a = this._set2022) !== null && _a !== void 0 ? _a : (this._set2022 = new Set(this._raw2022.split(" "))));
    }
    get es2023() {
        var _a;
        return ((_a = this._set2023) !== null && _a !== void 0 ? _a : (this._set2023 = new Set(this._raw2023.split(" "))));
    }
    get es2024() {
        var _a;
        return ((_a = this._set2024) !== null && _a !== void 0 ? _a : (this._set2024 = new Set(this._raw2024.split(" "))));
    }
    get es2025() {
        var _a;
        return ((_a = this._set2025) !== null && _a !== void 0 ? _a : (this._set2025 = new Set(this._raw2025.split(" "))));
    }
    get es2026() {
        var _a;
        return ((_a = this._set2026) !== null && _a !== void 0 ? _a : (this._set2026 = new Set(this._raw2026.split(" "))));
    }
}
const gcNameSet = new Set(["General_Category", "gc"]);
const scNameSet = new Set(["Script", "Script_Extensions", "sc", "scx"]);
const gcValueSets = new DataSet("C Cased_Letter Cc Cf Close_Punctuation Cn Co Combining_Mark Connector_Punctuation Control Cs Currency_Symbol Dash_Punctuation Decimal_Number Enclosing_Mark Final_Punctuation Format Initial_Punctuation L LC Letter Letter_Number Line_Separator Ll Lm Lo Lowercase_Letter Lt Lu M Mark Math_Symbol Mc Me Mn Modifier_Letter Modifier_Symbol N Nd Nl No Nonspacing_Mark Number Open_Punctuation Other Other_Letter Other_Number Other_Punctuation Other_Symbol P Paragraph_Separator Pc Pd Pe Pf Pi Po Private_Use Ps Punctuation S Sc Separator Sk Sm So Space_Separator Spacing_Mark Surrogate Symbol Titlecase_Letter Unassigned Uppercase_Letter Z Zl Zp Zs cntrl digit punct", "", "", "", "", "", "", "", "");
const scValueSets = new DataSet("Adlam Adlm Aghb Ahom Anatolian_Hieroglyphs Arab Arabic Armenian Armi Armn Avestan Avst Bali Balinese Bamu Bamum Bass Bassa_Vah Batak Batk Beng Bengali Bhaiksuki Bhks Bopo Bopomofo Brah Brahmi Brai Braille Bugi Buginese Buhd Buhid Cakm Canadian_Aboriginal Cans Cari Carian Caucasian_Albanian Chakma Cham Cher Cherokee Common Copt Coptic Cprt Cuneiform Cypriot Cyrillic Cyrl Deseret Deva Devanagari Dsrt Dupl Duployan Egyp Egyptian_Hieroglyphs Elba Elbasan Ethi Ethiopic Geor Georgian Glag Glagolitic Gonm Goth Gothic Gran Grantha Greek Grek Gujarati Gujr Gurmukhi Guru Han Hang Hangul Hani Hano Hanunoo Hatr Hatran Hebr Hebrew Hira Hiragana Hluw Hmng Hung Imperial_Aramaic Inherited Inscriptional_Pahlavi Inscriptional_Parthian Ital Java Javanese Kaithi Kali Kana Kannada Katakana Kayah_Li Khar Kharoshthi Khmer Khmr Khoj Khojki Khudawadi Knda Kthi Lana Lao Laoo Latin Latn Lepc Lepcha Limb Limbu Lina Linb Linear_A Linear_B Lisu Lyci Lycian Lydi Lydian Mahajani Mahj Malayalam Mand Mandaic Mani Manichaean Marc Marchen Masaram_Gondi Meetei_Mayek Mend Mende_Kikakui Merc Mero Meroitic_Cursive Meroitic_Hieroglyphs Miao Mlym Modi Mong Mongolian Mro Mroo Mtei Mult Multani Myanmar Mymr Nabataean Narb Nbat New_Tai_Lue Newa Nko Nkoo Nshu Nushu Ogam Ogham Ol_Chiki Olck Old_Hungarian Old_Italic Old_North_Arabian Old_Permic Old_Persian Old_South_Arabian Old_Turkic Oriya Orkh Orya Osage Osge Osma Osmanya Pahawh_Hmong Palm Palmyrene Pau_Cin_Hau Pauc Perm Phag Phags_Pa Phli Phlp Phnx Phoenician Plrd Prti Psalter_Pahlavi Qaac Qaai Rejang Rjng Runic Runr Samaritan Samr Sarb Saur Saurashtra Sgnw Sharada Shavian Shaw Shrd Sidd Siddham SignWriting Sind Sinh Sinhala Sora Sora_Sompeng Soyo Soyombo Sund Sundanese Sylo Syloti_Nagri Syrc Syriac Tagalog Tagb Tagbanwa Tai_Le Tai_Tham Tai_Viet Takr Takri Tale Talu Tamil Taml Tang Tangut Tavt Telu Telugu Tfng Tglg Thaa Thaana Thai Tibetan Tibt Tifinagh Tirh Tirhuta Ugar Ugaritic Vai Vaii Wara Warang_Citi Xpeo Xsux Yi Yiii Zanabazar_Square Zanb Zinh Zyyy", "Dogr Dogra Gong Gunjala_Gondi Hanifi_Rohingya Maka Makasar Medefaidrin Medf Old_Sogdian Rohg Sogd Sogdian Sogo", "Elym Elymaic Hmnp Nand Nandinagari Nyiakeng_Puachue_Hmong Wancho Wcho", "Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", "Cpmn Cypro_Minoan Old_Uyghur Ougr Tangsa Tnsa Toto Vith Vithkuqi", "Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz", "", "", "");
const binPropertySets = new DataSet("AHex ASCII ASCII_Hex_Digit Alpha Alphabetic Any Assigned Bidi_C Bidi_Control Bidi_M Bidi_Mirrored CI CWCF CWCM CWKCF CWL CWT CWU Case_Ignorable Cased Changes_When_Casefolded Changes_When_Casemapped Changes_When_Lowercased Changes_When_NFKC_Casefolded Changes_When_Titlecased Changes_When_Uppercased DI Dash Default_Ignorable_Code_Point Dep Deprecated Dia Diacritic Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Ext Extender Gr_Base Gr_Ext Grapheme_Base Grapheme_Extend Hex Hex_Digit IDC IDS IDSB IDST IDS_Binary_Operator IDS_Trinary_Operator ID_Continue ID_Start Ideo Ideographic Join_C Join_Control LOE Logical_Order_Exception Lower Lowercase Math NChar Noncharacter_Code_Point Pat_Syn Pat_WS Pattern_Syntax Pattern_White_Space QMark Quotation_Mark RI Radical Regional_Indicator SD STerm Sentence_Terminal Soft_Dotted Term Terminal_Punctuation UIdeo Unified_Ideograph Upper Uppercase VS Variation_Selector White_Space XIDC XIDS XID_Continue XID_Start space", "Extended_Pictographic", "", "EBase EComp EMod EPres ExtPict", "", "", "", "", "");
const binPropertyOfStringsSets = new DataSet("", "", "", "", "", "", "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji RGI_Emoji_Flag_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence", "", "");
function isValidUnicodeProperty(version, name, value) {
    if (gcNameSet.has(name)) {
        return version >= 2018 && gcValueSets.es2018.has(value);
    }
    if (scNameSet.has(name)) {
        return ((version >= 2018 && scValueSets.es2018.has(value)) ||
            (version >= 2019 && scValueSets.es2019.has(value)) ||
            (version >= 2020 && scValueSets.es2020.has(value)) ||
            (version >= 2021 && scValueSets.es2021.has(value)) ||
            (version >= 2022 && scValueSets.es2022.has(value)) ||
            (version >= 2023 && scValueSets.es2023.has(value)));
    }
    return false;
}
function isValidLoneUnicodeProperty(version, value) {
    return ((version >= 2018 && binPropertySets.es2018.has(value)) ||
        (version >= 2019 && binPropertySets.es2019.has(value)) ||
        (version >= 2021 && binPropertySets.es2021.has(value)));
}
function isValidLoneUnicodePropertyOfString(version, value) {
    return version >= 2024 && binPropertyOfStringsSets.es2024.has(value);
}

const BACKSPACE = 0x08;
const CHARACTER_TABULATION = 0x09;
const LINE_FEED = 0x0a;
const LINE_TABULATION = 0x0b;
const FORM_FEED = 0x0c;
const CARRIAGE_RETURN = 0x0d;
const EXCLAMATION_MARK = 0x21;
const NUMBER_SIGN = 0x23;
const DOLLAR_SIGN = 0x24;
const PERCENT_SIGN = 0x25;
const AMPERSAND = 0x26;
const LEFT_PARENTHESIS = 0x28;
const RIGHT_PARENTHESIS = 0x29;
const ASTERISK = 0x2a;
const PLUS_SIGN = 0x2b;
const COMMA = 0x2c;
const HYPHEN_MINUS = 0x2d;
const FULL_STOP = 0x2e;
const SOLIDUS = 0x2f;
const DIGIT_ZERO = 0x30;
const DIGIT_ONE = 0x31;
const DIGIT_SEVEN = 0x37;
const DIGIT_NINE = 0x39;
const COLON = 0x3a;
const SEMICOLON = 0x3b;
const LESS_THAN_SIGN = 0x3c;
const EQUALS_SIGN = 0x3d;
const GREATER_THAN_SIGN = 0x3e;
const QUESTION_MARK = 0x3f;
const COMMERCIAL_AT = 0x40;
const LATIN_CAPITAL_LETTER_A = 0x41;
const LATIN_CAPITAL_LETTER_B = 0x42;
const LATIN_CAPITAL_LETTER_D = 0x44;
const LATIN_CAPITAL_LETTER_F = 0x46;
const LATIN_CAPITAL_LETTER_P = 0x50;
const LATIN_CAPITAL_LETTER_S = 0x53;
const LATIN_CAPITAL_LETTER_W = 0x57;
const LATIN_CAPITAL_LETTER_Z = 0x5a;
const LOW_LINE = 0x5f;
const LATIN_SMALL_LETTER_A = 0x61;
const LATIN_SMALL_LETTER_B = 0x62;
const LATIN_SMALL_LETTER_C = 0x63;
const LATIN_SMALL_LETTER_D = 0x64;
const LATIN_SMALL_LETTER_F = 0x66;
const LATIN_SMALL_LETTER_G = 0x67;
const LATIN_SMALL_LETTER_I = 0x69;
const LATIN_SMALL_LETTER_K = 0x6b;
const LATIN_SMALL_LETTER_M = 0x6d;
const LATIN_SMALL_LETTER_N = 0x6e;
const LATIN_SMALL_LETTER_P = 0x70;
const LATIN_SMALL_LETTER_Q = 0x71;
const LATIN_SMALL_LETTER_R = 0x72;
const LATIN_SMALL_LETTER_S = 0x73;
const LATIN_SMALL_LETTER_T = 0x74;
const LATIN_SMALL_LETTER_U = 0x75;
const LATIN_SMALL_LETTER_V = 0x76;
const LATIN_SMALL_LETTER_W = 0x77;
const LATIN_SMALL_LETTER_X = 0x78;
const LATIN_SMALL_LETTER_Y = 0x79;
const LATIN_SMALL_LETTER_Z = 0x7a;
const LEFT_SQUARE_BRACKET = 0x5b;
const REVERSE_SOLIDUS = 0x5c;
const RIGHT_SQUARE_BRACKET = 0x5d;
const CIRCUMFLEX_ACCENT = 0x5e;
const GRAVE_ACCENT = 0x60;
const LEFT_CURLY_BRACKET = 0x7b;
const VERTICAL_LINE = 0x7c;
const RIGHT_CURLY_BRACKET = 0x7d;
const TILDE = 0x7e;
const ZERO_WIDTH_NON_JOINER = 0x200c;
const ZERO_WIDTH_JOINER = 0x200d;
const LINE_SEPARATOR = 0x2028;
const PARAGRAPH_SEPARATOR = 0x2029;
const MIN_CODE_POINT = 0x00;
const MAX_CODE_POINT = 0x10ffff;
function isLatinLetter(code) {
    return ((code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_Z) ||
        (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_Z));
}
function isDecimalDigit(code) {
    return code >= DIGIT_ZERO && code <= DIGIT_NINE;
}
function isOctalDigit(code) {
    return code >= DIGIT_ZERO && code <= DIGIT_SEVEN;
}
function isHexDigit(code) {
    return ((code >= DIGIT_ZERO && code <= DIGIT_NINE) ||
        (code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_F) ||
        (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_F));
}
function isLineTerminator(code) {
    return (code === LINE_FEED ||
        code === CARRIAGE_RETURN ||
        code === LINE_SEPARATOR ||
        code === PARAGRAPH_SEPARATOR);
}
function isValidUnicode(code) {
    return code >= MIN_CODE_POINT && code <= MAX_CODE_POINT;
}
function digitToInt(code) {
    if (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_F) {
        return code - LATIN_SMALL_LETTER_A + 10;
    }
    if (code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_F) {
        return code - LATIN_CAPITAL_LETTER_A + 10;
    }
    return code - DIGIT_ZERO;
}
function isLeadSurrogate(code) {
    return code >= 0xd800 && code <= 0xdbff;
}
function isTrailSurrogate(code) {
    return code >= 0xdc00 && code <= 0xdfff;
}
function combineSurrogatePair(lead, trail) {
    return (lead - 0xd800) * 0x400 + (trail - 0xdc00) + 0x10000;
}

class GroupSpecifiersAsES2018 {
    constructor() {
        this.groupName = new Set();
    }
    clear() {
        this.groupName.clear();
    }
    isEmpty() {
        return !this.groupName.size;
    }
    hasInPattern(name) {
        return this.groupName.has(name);
    }
    hasInScope(name) {
        return this.hasInPattern(name);
    }
    addToScope(name) {
        this.groupName.add(name);
    }
    enterDisjunction() {
    }
    enterAlternative() {
    }
    leaveDisjunction() {
    }
}
class BranchID {
    constructor(parent, base) {
        this.parent = parent;
        this.base = base !== null && base !== void 0 ? base : this;
    }
    separatedFrom(other) {
        var _a, _b;
        if (this.base === other.base && this !== other) {
            return true;
        }
        if (other.parent && this.separatedFrom(other.parent)) {
            return true;
        }
        return (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.separatedFrom(other)) !== null && _b !== void 0 ? _b : false;
    }
    child() {
        return new BranchID(this, null);
    }
    sibling() {
        return new BranchID(this.parent, this.base);
    }
}
class GroupSpecifiersAsES2025 {
    constructor() {
        this.branchID = new BranchID(null, null);
        this.groupNames = new Map();
    }
    clear() {
        this.branchID = new BranchID(null, null);
        this.groupNames.clear();
    }
    isEmpty() {
        return !this.groupNames.size;
    }
    enterDisjunction() {
        this.branchID = this.branchID.child();
    }
    enterAlternative(index) {
        if (index === 0) {
            return;
        }
        this.branchID = this.branchID.sibling();
    }
    leaveDisjunction() {
        this.branchID = this.branchID.parent;
    }
    hasInPattern(name) {
        return this.groupNames.has(name);
    }
    hasInScope(name) {
        const branches = this.groupNames.get(name);
        if (!branches) {
            return false;
        }
        for (const branch of branches) {
            if (!branch.separatedFrom(this.branchID)) {
                return true;
            }
        }
        return false;
    }
    addToScope(name) {
        const branches = this.groupNames.get(name);
        if (branches) {
            branches.push(this.branchID);
            return;
        }
        this.groupNames.set(name, [this.branchID]);
    }
}

const legacyImpl = {
    at(s, end, i) {
        return i < end ? s.charCodeAt(i) : -1;
    },
    width(c) {
        return 1;
    },
};
const unicodeImpl = {
    at(s, end, i) {
        return i < end ? s.codePointAt(i) : -1;
    },
    width(c) {
        return c > 0xffff ? 2 : 1;
    },
};
class Reader {
    constructor() {
        this._impl = legacyImpl;
        this._s = "";
        this._i = 0;
        this._end = 0;
        this._cp1 = -1;
        this._w1 = 1;
        this._cp2 = -1;
        this._w2 = 1;
        this._cp3 = -1;
        this._w3 = 1;
        this._cp4 = -1;
    }
    get source() {
        return this._s;
    }
    get index() {
        return this._i;
    }
    get currentCodePoint() {
        return this._cp1;
    }
    get nextCodePoint() {
        return this._cp2;
    }
    get nextCodePoint2() {
        return this._cp3;
    }
    get nextCodePoint3() {
        return this._cp4;
    }
    reset(source, start, end, uFlag) {
        this._impl = uFlag ? unicodeImpl : legacyImpl;
        this._s = source;
        this._end = end;
        this.rewind(start);
    }
    rewind(index) {
        const impl = this._impl;
        this._i = index;
        this._cp1 = impl.at(this._s, this._end, index);
        this._w1 = impl.width(this._cp1);
        this._cp2 = impl.at(this._s, this._end, index + this._w1);
        this._w2 = impl.width(this._cp2);
        this._cp3 = impl.at(this._s, this._end, index + this._w1 + this._w2);
        this._w3 = impl.width(this._cp3);
        this._cp4 = impl.at(this._s, this._end, index + this._w1 + this._w2 + this._w3);
    }
    advance() {
        if (this._cp1 !== -1) {
            const impl = this._impl;
            this._i += this._w1;
            this._cp1 = this._cp2;
            this._w1 = this._w2;
            this._cp2 = this._cp3;
            this._w2 = impl.width(this._cp2);
            this._cp3 = this._cp4;
            this._w3 = impl.width(this._cp3);
            this._cp4 = impl.at(this._s, this._end, this._i + this._w1 + this._w2 + this._w3);
        }
    }
    eat(cp) {
        if (this._cp1 === cp) {
            this.advance();
            return true;
        }
        return false;
    }
    eat2(cp1, cp2) {
        if (this._cp1 === cp1 && this._cp2 === cp2) {
            this.advance();
            this.advance();
            return true;
        }
        return false;
    }
    eat3(cp1, cp2, cp3) {
        if (this._cp1 === cp1 && this._cp2 === cp2 && this._cp3 === cp3) {
            this.advance();
            this.advance();
            this.advance();
            return true;
        }
        return false;
    }
}

class RegExpSyntaxError extends SyntaxError {
    constructor(message, index) {
        super(message);
        this.index = index;
    }
}
function newRegExpSyntaxError(srcCtx, flags, index, message) {
    let source = "";
    if (srcCtx.kind === "literal") {
        const literal = srcCtx.source.slice(srcCtx.start, srcCtx.end);
        if (literal) {
            source = `: ${literal}`;
        }
    }
    else if (srcCtx.kind === "pattern") {
        const pattern = srcCtx.source.slice(srcCtx.start, srcCtx.end);
        const flagsText = `${flags.unicode ? "u" : ""}${flags.unicodeSets ? "v" : ""}`;
        source = `: /${pattern}/${flagsText}`;
    }
    return new RegExpSyntaxError(`Invalid regular expression${source}: ${message}`, index);
}

const SYNTAX_CHARACTER = new Set([
    CIRCUMFLEX_ACCENT,
    DOLLAR_SIGN,
    REVERSE_SOLIDUS,
    FULL_STOP,
    ASTERISK,
    PLUS_SIGN,
    QUESTION_MARK,
    LEFT_PARENTHESIS,
    RIGHT_PARENTHESIS,
    LEFT_SQUARE_BRACKET,
    RIGHT_SQUARE_BRACKET,
    LEFT_CURLY_BRACKET,
    RIGHT_CURLY_BRACKET,
    VERTICAL_LINE,
]);
const CLASS_SET_RESERVED_DOUBLE_PUNCTUATOR_CHARACTER = new Set([
    AMPERSAND,
    EXCLAMATION_MARK,
    NUMBER_SIGN,
    DOLLAR_SIGN,
    PERCENT_SIGN,
    ASTERISK,
    PLUS_SIGN,
    COMMA,
    FULL_STOP,
    COLON,
    SEMICOLON,
    LESS_THAN_SIGN,
    EQUALS_SIGN,
    GREATER_THAN_SIGN,
    QUESTION_MARK,
    COMMERCIAL_AT,
    CIRCUMFLEX_ACCENT,
    GRAVE_ACCENT,
    TILDE,
]);
const CLASS_SET_SYNTAX_CHARACTER = new Set([
    LEFT_PARENTHESIS,
    RIGHT_PARENTHESIS,
    LEFT_SQUARE_BRACKET,
    RIGHT_SQUARE_BRACKET,
    LEFT_CURLY_BRACKET,
    RIGHT_CURLY_BRACKET,
    SOLIDUS,
    HYPHEN_MINUS,
    REVERSE_SOLIDUS,
    VERTICAL_LINE,
]);
const CLASS_SET_RESERVED_PUNCTUATOR = new Set([
    AMPERSAND,
    HYPHEN_MINUS,
    EXCLAMATION_MARK,
    NUMBER_SIGN,
    PERCENT_SIGN,
    COMMA,
    COLON,
    SEMICOLON,
    LESS_THAN_SIGN,
    EQUALS_SIGN,
    GREATER_THAN_SIGN,
    COMMERCIAL_AT,
    GRAVE_ACCENT,
    TILDE,
]);
const FLAG_PROP_TO_CODEPOINT = {
    global: LATIN_SMALL_LETTER_G,
    ignoreCase: LATIN_SMALL_LETTER_I,
    multiline: LATIN_SMALL_LETTER_M,
    unicode: LATIN_SMALL_LETTER_U,
    sticky: LATIN_SMALL_LETTER_Y,
    dotAll: LATIN_SMALL_LETTER_S,
    hasIndices: LATIN_SMALL_LETTER_D,
    unicodeSets: LATIN_SMALL_LETTER_V,
};
const FLAG_CODEPOINT_TO_PROP = Object.fromEntries(Object.entries(FLAG_PROP_TO_CODEPOINT).map(([k, v]) => [v, k]));
function isSyntaxCharacter(cp) {
    return SYNTAX_CHARACTER.has(cp);
}
function isClassSetReservedDoublePunctuatorCharacter(cp) {
    return CLASS_SET_RESERVED_DOUBLE_PUNCTUATOR_CHARACTER.has(cp);
}
function isClassSetSyntaxCharacter(cp) {
    return CLASS_SET_SYNTAX_CHARACTER.has(cp);
}
function isClassSetReservedPunctuator(cp) {
    return CLASS_SET_RESERVED_PUNCTUATOR.has(cp);
}
function isIdentifierStartChar(cp) {
    return isIdStart(cp) || cp === DOLLAR_SIGN || cp === LOW_LINE;
}
function isIdentifierPartChar(cp) {
    return (isIdContinue(cp) ||
        cp === DOLLAR_SIGN ||
        cp === ZERO_WIDTH_NON_JOINER ||
        cp === ZERO_WIDTH_JOINER);
}
function isUnicodePropertyNameCharacter(cp) {
    return isLatinLetter(cp) || cp === LOW_LINE;
}
function isUnicodePropertyValueCharacter(cp) {
    return isUnicodePropertyNameCharacter(cp) || isDecimalDigit(cp);
}
function isRegularExpressionModifier(ch) {
    return (ch === LATIN_SMALL_LETTER_I ||
        ch === LATIN_SMALL_LETTER_M ||
        ch === LATIN_SMALL_LETTER_S);
}
class RegExpValidator {
    constructor(options) {
        this._reader = new Reader();
        this._unicodeMode = false;
        this._unicodeSetsMode = false;
        this._nFlag = false;
        this._lastIntValue = 0;
        this._lastRange = {
            min: 0,
            max: Number.POSITIVE_INFINITY,
        };
        this._lastStrValue = "";
        this._lastAssertionIsQuantifiable = false;
        this._numCapturingParens = 0;
        this._backreferenceNames = new Set();
        this._srcCtx = null;
        this._options = options !== null && options !== void 0 ? options : {};
        this._groupSpecifiers =
            this.ecmaVersion >= 2025
                ? new GroupSpecifiersAsES2025()
                : new GroupSpecifiersAsES2018();
    }
    validateLiteral(source, start = 0, end = source.length) {
        this._srcCtx = { source, start, end, kind: "literal" };
        this._unicodeSetsMode = this._unicodeMode = this._nFlag = false;
        this.reset(source, start, end);
        this.onLiteralEnter(start);
        if (this.eat(SOLIDUS) && this.eatRegExpBody() && this.eat(SOLIDUS)) {
            const flagStart = this.index;
            const unicode = source.includes("u", flagStart);
            const unicodeSets = source.includes("v", flagStart);
            this.validateFlagsInternal(source, flagStart, end);
            this.validatePatternInternal(source, start + 1, flagStart - 1, {
                unicode,
                unicodeSets,
            });
        }
        else if (start >= end) {
            this.raise("Empty");
        }
        else {
            const c = String.fromCodePoint(this.currentCodePoint);
            this.raise(`Unexpected character '${c}'`);
        }
        this.onLiteralLeave(start, end);
    }
    validateFlags(source, start = 0, end = source.length) {
        this._srcCtx = { source, start, end, kind: "flags" };
        this.validateFlagsInternal(source, start, end);
    }
    validatePattern(source, start = 0, end = source.length, uFlagOrFlags = undefined) {
        this._srcCtx = { source, start, end, kind: "pattern" };
        this.validatePatternInternal(source, start, end, uFlagOrFlags);
    }
    validatePatternInternal(source, start = 0, end = source.length, uFlagOrFlags = undefined) {
        const mode = this._parseFlagsOptionToMode(uFlagOrFlags, end);
        this._unicodeMode = mode.unicodeMode;
        this._nFlag = mode.nFlag;
        this._unicodeSetsMode = mode.unicodeSetsMode;
        this.reset(source, start, end);
        this.consumePattern();
        if (!this._nFlag &&
            this.ecmaVersion >= 2018 &&
            !this._groupSpecifiers.isEmpty()) {
            this._nFlag = true;
            this.rewind(start);
            this.consumePattern();
        }
    }
    validateFlagsInternal(source, start, end) {
        const flags = this.parseFlags(source, start, end);
        this.onRegExpFlags(start, end, flags);
    }
    _parseFlagsOptionToMode(uFlagOrFlags, sourceEnd) {
        let unicode = false;
        let unicodeSets = false;
        if (uFlagOrFlags && this.ecmaVersion >= 2015) {
            if (typeof uFlagOrFlags === "object") {
                unicode = Boolean(uFlagOrFlags.unicode);
                if (this.ecmaVersion >= 2024) {
                    unicodeSets = Boolean(uFlagOrFlags.unicodeSets);
                }
            }
            else {
                unicode = uFlagOrFlags;
            }
        }
        if (unicode && unicodeSets) {
            this.raise("Invalid regular expression flags", {
                index: sourceEnd + 1,
                unicode,
                unicodeSets,
            });
        }
        const unicodeMode = unicode || unicodeSets;
        const nFlag = (unicode && this.ecmaVersion >= 2018) ||
            unicodeSets ||
            Boolean(this._options.strict && this.ecmaVersion >= 2023);
        const unicodeSetsMode = unicodeSets;
        return { unicodeMode, nFlag, unicodeSetsMode };
    }
    get strict() {
        return Boolean(this._options.strict) || this._unicodeMode;
    }
    get ecmaVersion() {
        var _a;
        return (_a = this._options.ecmaVersion) !== null && _a !== void 0 ? _a : latestEcmaVersion;
    }
    onLiteralEnter(start) {
        if (this._options.onLiteralEnter) {
            this._options.onLiteralEnter(start);
        }
    }
    onLiteralLeave(start, end) {
        if (this._options.onLiteralLeave) {
            this._options.onLiteralLeave(start, end);
        }
    }
    onRegExpFlags(start, end, flags) {
        if (this._options.onRegExpFlags) {
            this._options.onRegExpFlags(start, end, flags);
        }
        if (this._options.onFlags) {
            this._options.onFlags(start, end, flags.global, flags.ignoreCase, flags.multiline, flags.unicode, flags.sticky, flags.dotAll, flags.hasIndices);
        }
    }
    onPatternEnter(start) {
        if (this._options.onPatternEnter) {
            this._options.onPatternEnter(start);
        }
    }
    onPatternLeave(start, end) {
        if (this._options.onPatternLeave) {
            this._options.onPatternLeave(start, end);
        }
    }
    onDisjunctionEnter(start) {
        if (this._options.onDisjunctionEnter) {
            this._options.onDisjunctionEnter(start);
        }
    }
    onDisjunctionLeave(start, end) {
        if (this._options.onDisjunctionLeave) {
            this._options.onDisjunctionLeave(start, end);
        }
    }
    onAlternativeEnter(start, index) {
        if (this._options.onAlternativeEnter) {
            this._options.onAlternativeEnter(start, index);
        }
    }
    onAlternativeLeave(start, end, index) {
        if (this._options.onAlternativeLeave) {
            this._options.onAlternativeLeave(start, end, index);
        }
    }
    onGroupEnter(start) {
        if (this._options.onGroupEnter) {
            this._options.onGroupEnter(start);
        }
    }
    onGroupLeave(start, end) {
        if (this._options.onGroupLeave) {
            this._options.onGroupLeave(start, end);
        }
    }
    onModifiersEnter(start) {
        if (this._options.onModifiersEnter) {
            this._options.onModifiersEnter(start);
        }
    }
    onModifiersLeave(start, end) {
        if (this._options.onModifiersLeave) {
            this._options.onModifiersLeave(start, end);
        }
    }
    onAddModifiers(start, end, flags) {
        if (this._options.onAddModifiers) {
            this._options.onAddModifiers(start, end, flags);
        }
    }
    onRemoveModifiers(start, end, flags) {
        if (this._options.onRemoveModifiers) {
            this._options.onRemoveModifiers(start, end, flags);
        }
    }
    onCapturingGroupEnter(start, name) {
        if (this._options.onCapturingGroupEnter) {
            this._options.onCapturingGroupEnter(start, name);
        }
    }
    onCapturingGroupLeave(start, end, name) {
        if (this._options.onCapturingGroupLeave) {
            this._options.onCapturingGroupLeave(start, end, name);
        }
    }
    onQuantifier(start, end, min, max, greedy) {
        if (this._options.onQuantifier) {
            this._options.onQuantifier(start, end, min, max, greedy);
        }
    }
    onLookaroundAssertionEnter(start, kind, negate) {
        if (this._options.onLookaroundAssertionEnter) {
            this._options.onLookaroundAssertionEnter(start, kind, negate);
        }
    }
    onLookaroundAssertionLeave(start, end, kind, negate) {
        if (this._options.onLookaroundAssertionLeave) {
            this._options.onLookaroundAssertionLeave(start, end, kind, negate);
        }
    }
    onEdgeAssertion(start, end, kind) {
        if (this._options.onEdgeAssertion) {
            this._options.onEdgeAssertion(start, end, kind);
        }
    }
    onWordBoundaryAssertion(start, end, kind, negate) {
        if (this._options.onWordBoundaryAssertion) {
            this._options.onWordBoundaryAssertion(start, end, kind, negate);
        }
    }
    onAnyCharacterSet(start, end, kind) {
        if (this._options.onAnyCharacterSet) {
            this._options.onAnyCharacterSet(start, end, kind);
        }
    }
    onEscapeCharacterSet(start, end, kind, negate) {
        if (this._options.onEscapeCharacterSet) {
            this._options.onEscapeCharacterSet(start, end, kind, negate);
        }
    }
    onUnicodePropertyCharacterSet(start, end, kind, key, value, negate, strings) {
        if (this._options.onUnicodePropertyCharacterSet) {
            this._options.onUnicodePropertyCharacterSet(start, end, kind, key, value, negate, strings);
        }
    }
    onCharacter(start, end, value) {
        if (this._options.onCharacter) {
            this._options.onCharacter(start, end, value);
        }
    }
    onBackreference(start, end, ref) {
        if (this._options.onBackreference) {
            this._options.onBackreference(start, end, ref);
        }
    }
    onCharacterClassEnter(start, negate, unicodeSets) {
        if (this._options.onCharacterClassEnter) {
            this._options.onCharacterClassEnter(start, negate, unicodeSets);
        }
    }
    onCharacterClassLeave(start, end, negate) {
        if (this._options.onCharacterClassLeave) {
            this._options.onCharacterClassLeave(start, end, negate);
        }
    }
    onCharacterClassRange(start, end, min, max) {
        if (this._options.onCharacterClassRange) {
            this._options.onCharacterClassRange(start, end, min, max);
        }
    }
    onClassIntersection(start, end) {
        if (this._options.onClassIntersection) {
            this._options.onClassIntersection(start, end);
        }
    }
    onClassSubtraction(start, end) {
        if (this._options.onClassSubtraction) {
            this._options.onClassSubtraction(start, end);
        }
    }
    onClassStringDisjunctionEnter(start) {
        if (this._options.onClassStringDisjunctionEnter) {
            this._options.onClassStringDisjunctionEnter(start);
        }
    }
    onClassStringDisjunctionLeave(start, end) {
        if (this._options.onClassStringDisjunctionLeave) {
            this._options.onClassStringDisjunctionLeave(start, end);
        }
    }
    onStringAlternativeEnter(start, index) {
        if (this._options.onStringAlternativeEnter) {
            this._options.onStringAlternativeEnter(start, index);
        }
    }
    onStringAlternativeLeave(start, end, index) {
        if (this._options.onStringAlternativeLeave) {
            this._options.onStringAlternativeLeave(start, end, index);
        }
    }
    get index() {
        return this._reader.index;
    }
    get currentCodePoint() {
        return this._reader.currentCodePoint;
    }
    get nextCodePoint() {
        return this._reader.nextCodePoint;
    }
    get nextCodePoint2() {
        return this._reader.nextCodePoint2;
    }
    get nextCodePoint3() {
        return this._reader.nextCodePoint3;
    }
    reset(source, start, end) {
        this._reader.reset(source, start, end, this._unicodeMode);
    }
    rewind(index) {
        this._reader.rewind(index);
    }
    advance() {
        this._reader.advance();
    }
    eat(cp) {
        return this._reader.eat(cp);
    }
    eat2(cp1, cp2) {
        return this._reader.eat2(cp1, cp2);
    }
    eat3(cp1, cp2, cp3) {
        return this._reader.eat3(cp1, cp2, cp3);
    }
    raise(message, context) {
        var _a, _b, _c;
        throw newRegExpSyntaxError(this._srcCtx, {
            unicode: (_a = context === null || context === void 0 ? void 0 : context.unicode) !== null && _a !== void 0 ? _a : (this._unicodeMode && !this._unicodeSetsMode),
            unicodeSets: (_b = context === null || context === void 0 ? void 0 : context.unicodeSets) !== null && _b !== void 0 ? _b : this._unicodeSetsMode,
        }, (_c = context === null || context === void 0 ? void 0 : context.index) !== null && _c !== void 0 ? _c : this.index, message);
    }
    eatRegExpBody() {
        const start = this.index;
        let inClass = false;
        let escaped = false;
        for (;;) {
            const cp = this.currentCodePoint;
            if (cp === -1 || isLineTerminator(cp)) {
                const kind = inClass ? "character class" : "regular expression";
                this.raise(`Unterminated ${kind}`);
            }
            if (escaped) {
                escaped = false;
            }
            else if (cp === REVERSE_SOLIDUS) {
                escaped = true;
            }
            else if (cp === LEFT_SQUARE_BRACKET) {
                inClass = true;
            }
            else if (cp === RIGHT_SQUARE_BRACKET) {
                inClass = false;
            }
            else if ((cp === SOLIDUS && !inClass) ||
                (cp === ASTERISK && this.index === start)) {
                break;
            }
            this.advance();
        }
        return this.index !== start;
    }
    consumePattern() {
        const start = this.index;
        this._numCapturingParens = this.countCapturingParens();
        this._groupSpecifiers.clear();
        this._backreferenceNames.clear();
        this.onPatternEnter(start);
        this.consumeDisjunction();
        const cp = this.currentCodePoint;
        if (this.currentCodePoint !== -1) {
            if (cp === RIGHT_PARENTHESIS) {
                this.raise("Unmatched ')'");
            }
            if (cp === REVERSE_SOLIDUS) {
                this.raise("\\ at end of pattern");
            }
            if (cp === RIGHT_SQUARE_BRACKET || cp === RIGHT_CURLY_BRACKET) {
                this.raise("Lone quantifier brackets");
            }
            const c = String.fromCodePoint(cp);
            this.raise(`Unexpected character '${c}'`);
        }
        for (const name of this._backreferenceNames) {
            if (!this._groupSpecifiers.hasInPattern(name)) {
                this.raise("Invalid named capture referenced");
            }
        }
        this.onPatternLeave(start, this.index);
    }
    countCapturingParens() {
        const start = this.index;
        let inClass = false;
        let escaped = false;
        let count = 0;
        let cp = 0;
        while ((cp = this.currentCodePoint) !== -1) {
            if (escaped) {
                escaped = false;
            }
            else if (cp === REVERSE_SOLIDUS) {
                escaped = true;
            }
            else if (cp === LEFT_SQUARE_BRACKET) {
                inClass = true;
            }
            else if (cp === RIGHT_SQUARE_BRACKET) {
                inClass = false;
            }
            else if (cp === LEFT_PARENTHESIS &&
                !inClass &&
                (this.nextCodePoint !== QUESTION_MARK ||
                    (this.nextCodePoint2 === LESS_THAN_SIGN &&
                        this.nextCodePoint3 !== EQUALS_SIGN &&
                        this.nextCodePoint3 !== EXCLAMATION_MARK))) {
                count += 1;
            }
            this.advance();
        }
        this.rewind(start);
        return count;
    }
    consumeDisjunction() {
        const start = this.index;
        let i = 0;
        this._groupSpecifiers.enterDisjunction();
        this.onDisjunctionEnter(start);
        do {
            this.consumeAlternative(i++);
        } while (this.eat(VERTICAL_LINE));
        if (this.consumeQuantifier(true)) {
            this.raise("Nothing to repeat");
        }
        if (this.eat(LEFT_CURLY_BRACKET)) {
            this.raise("Lone quantifier brackets");
        }
        this.onDisjunctionLeave(start, this.index);
        this._groupSpecifiers.leaveDisjunction();
    }
    consumeAlternative(i) {
        const start = this.index;
        this._groupSpecifiers.enterAlternative(i);
        this.onAlternativeEnter(start, i);
        while (this.currentCodePoint !== -1 && this.consumeTerm()) {
        }
        this.onAlternativeLeave(start, this.index, i);
    }
    consumeTerm() {
        if (this._unicodeMode || this.strict) {
            return (this.consumeAssertion() ||
                (this.consumeAtom() && this.consumeOptionalQuantifier()));
        }
        return ((this.consumeAssertion() &&
            (!this._lastAssertionIsQuantifiable ||
                this.consumeOptionalQuantifier())) ||
            (this.consumeExtendedAtom() && this.consumeOptionalQuantifier()));
    }
    consumeOptionalQuantifier() {
        this.consumeQuantifier();
        return true;
    }
    consumeAssertion() {
        const start = this.index;
        this._lastAssertionIsQuantifiable = false;
        if (this.eat(CIRCUMFLEX_ACCENT)) {
            this.onEdgeAssertion(start, this.index, "start");
            return true;
        }
        if (this.eat(DOLLAR_SIGN)) {
            this.onEdgeAssertion(start, this.index, "end");
            return true;
        }
        if (this.eat2(REVERSE_SOLIDUS, LATIN_CAPITAL_LETTER_B)) {
            this.onWordBoundaryAssertion(start, this.index, "word", true);
            return true;
        }
        if (this.eat2(REVERSE_SOLIDUS, LATIN_SMALL_LETTER_B)) {
            this.onWordBoundaryAssertion(start, this.index, "word", false);
            return true;
        }
        if (this.eat2(LEFT_PARENTHESIS, QUESTION_MARK)) {
            const lookbehind = this.ecmaVersion >= 2018 && this.eat(LESS_THAN_SIGN);
            let negate = false;
            if (this.eat(EQUALS_SIGN) ||
                (negate = this.eat(EXCLAMATION_MARK))) {
                const kind = lookbehind ? "lookbehind" : "lookahead";
                this.onLookaroundAssertionEnter(start, kind, negate);
                this.consumeDisjunction();
                if (!this.eat(RIGHT_PARENTHESIS)) {
                    this.raise("Unterminated group");
                }
                this._lastAssertionIsQuantifiable = !lookbehind && !this.strict;
                this.onLookaroundAssertionLeave(start, this.index, kind, negate);
                return true;
            }
            this.rewind(start);
        }
        return false;
    }
    consumeQuantifier(noConsume = false) {
        const start = this.index;
        let min = 0;
        let max = 0;
        let greedy = false;
        if (this.eat(ASTERISK)) {
            min = 0;
            max = Number.POSITIVE_INFINITY;
        }
        else if (this.eat(PLUS_SIGN)) {
            min = 1;
            max = Number.POSITIVE_INFINITY;
        }
        else if (this.eat(QUESTION_MARK)) {
            min = 0;
            max = 1;
        }
        else if (this.eatBracedQuantifier(noConsume)) {
            ({ min, max } = this._lastRange);
        }
        else {
            return false;
        }
        greedy = !this.eat(QUESTION_MARK);
        if (!noConsume) {
            this.onQuantifier(start, this.index, min, max, greedy);
        }
        return true;
    }
    eatBracedQuantifier(noError) {
        const start = this.index;
        if (this.eat(LEFT_CURLY_BRACKET)) {
            if (this.eatDecimalDigits()) {
                const min = this._lastIntValue;
                let max = min;
                if (this.eat(COMMA)) {
                    max = this.eatDecimalDigits()
                        ? this._lastIntValue
                        : Number.POSITIVE_INFINITY;
                }
                if (this.eat(RIGHT_CURLY_BRACKET)) {
                    if (!noError && max < min) {
                        this.raise("numbers out of order in {} quantifier");
                    }
                    this._lastRange = { min, max };
                    return true;
                }
            }
            if (!noError && (this._unicodeMode || this.strict)) {
                this.raise("Incomplete quantifier");
            }
            this.rewind(start);
        }
        return false;
    }
    consumeAtom() {
        return (this.consumePatternCharacter() ||
            this.consumeDot() ||
            this.consumeReverseSolidusAtomEscape() ||
            Boolean(this.consumeCharacterClass()) ||
            this.consumeCapturingGroup() ||
            this.consumeUncapturingGroup());
    }
    consumeDot() {
        if (this.eat(FULL_STOP)) {
            this.onAnyCharacterSet(this.index - 1, this.index, "any");
            return true;
        }
        return false;
    }
    consumeReverseSolidusAtomEscape() {
        const start = this.index;
        if (this.eat(REVERSE_SOLIDUS)) {
            if (this.consumeAtomEscape()) {
                return true;
            }
            this.rewind(start);
        }
        return false;
    }
    consumeUncapturingGroup() {
        const start = this.index;
        if (this.eat2(LEFT_PARENTHESIS, QUESTION_MARK)) {
            this.onGroupEnter(start);
            if (this.ecmaVersion >= 2025) {
                this.consumeModifiers();
            }
            if (!this.eat(COLON)) {
                this.rewind(start + 1);
                this.raise("Invalid group");
            }
            this.consumeDisjunction();
            if (!this.eat(RIGHT_PARENTHESIS)) {
                this.raise("Unterminated group");
            }
            this.onGroupLeave(start, this.index);
            return true;
        }
        return false;
    }
    consumeModifiers() {
        const start = this.index;
        const hasAddModifiers = this.eatModifiers();
        const addModifiersEnd = this.index;
        const hasHyphen = this.eat(HYPHEN_MINUS);
        if (!hasAddModifiers && !hasHyphen) {
            return false;
        }
        this.onModifiersEnter(start);
        const addModifiers = this.parseModifiers(start, addModifiersEnd);
        this.onAddModifiers(start, addModifiersEnd, addModifiers);
        if (hasHyphen) {
            const modifiersStart = this.index;
            if (!this.eatModifiers() &&
                !hasAddModifiers &&
                this.currentCodePoint === COLON) {
                this.raise("Invalid empty flags");
            }
            const modifiers = this.parseModifiers(modifiersStart, this.index);
            for (const [flagName] of Object.entries(modifiers).filter(([, enable]) => enable)) {
                if (addModifiers[flagName]) {
                    this.raise(`Duplicated flag '${String.fromCodePoint(FLAG_PROP_TO_CODEPOINT[flagName])}'`);
                }
            }
            this.onRemoveModifiers(modifiersStart, this.index, modifiers);
        }
        this.onModifiersLeave(start, this.index);
        return true;
    }
    consumeCapturingGroup() {
        const start = this.index;
        if (this.eat(LEFT_PARENTHESIS)) {
            let name = null;
            if (this.ecmaVersion >= 2018) {
                if (this.consumeGroupSpecifier()) {
                    name = this._lastStrValue;
                }
                else if (this.currentCodePoint === QUESTION_MARK) {
                    this.rewind(start);
                    return false;
                }
            }
            else if (this.currentCodePoint === QUESTION_MARK) {
                this.rewind(start);
                return false;
            }
            this.onCapturingGroupEnter(start, name);
            this.consumeDisjunction();
            if (!this.eat(RIGHT_PARENTHESIS)) {
                this.raise("Unterminated group");
            }
            this.onCapturingGroupLeave(start, this.index, name);
            return true;
        }
        return false;
    }
    consumeExtendedAtom() {
        return (this.consumeDot() ||
            this.consumeReverseSolidusAtomEscape() ||
            this.consumeReverseSolidusFollowedByC() ||
            Boolean(this.consumeCharacterClass()) ||
            this.consumeCapturingGroup() ||
            this.consumeUncapturingGroup() ||
            this.consumeInvalidBracedQuantifier() ||
            this.consumeExtendedPatternCharacter());
    }
    consumeReverseSolidusFollowedByC() {
        const start = this.index;
        if (this.currentCodePoint === REVERSE_SOLIDUS &&
            this.nextCodePoint === LATIN_SMALL_LETTER_C) {
            this._lastIntValue = this.currentCodePoint;
            this.advance();
            this.onCharacter(start, this.index, REVERSE_SOLIDUS);
            return true;
        }
        return false;
    }
    consumeInvalidBracedQuantifier() {
        if (this.eatBracedQuantifier(true)) {
            this.raise("Nothing to repeat");
        }
        return false;
    }
    consumePatternCharacter() {
        const start = this.index;
        const cp = this.currentCodePoint;
        if (cp !== -1 && !isSyntaxCharacter(cp)) {
            this.advance();
            this.onCharacter(start, this.index, cp);
            return true;
        }
        return false;
    }
    consumeExtendedPatternCharacter() {
        const start = this.index;
        const cp = this.currentCodePoint;
        if (cp !== -1 &&
            cp !== CIRCUMFLEX_ACCENT &&
            cp !== DOLLAR_SIGN &&
            cp !== REVERSE_SOLIDUS &&
            cp !== FULL_STOP &&
            cp !== ASTERISK &&
            cp !== PLUS_SIGN &&
            cp !== QUESTION_MARK &&
            cp !== LEFT_PARENTHESIS &&
            cp !== RIGHT_PARENTHESIS &&
            cp !== LEFT_SQUARE_BRACKET &&
            cp !== VERTICAL_LINE) {
            this.advance();
            this.onCharacter(start, this.index, cp);
            return true;
        }
        return false;
    }
    consumeGroupSpecifier() {
        const start = this.index;
        if (this.eat(QUESTION_MARK)) {
            if (this.eatGroupName()) {
                if (!this._groupSpecifiers.hasInScope(this._lastStrValue)) {
                    this._groupSpecifiers.addToScope(this._lastStrValue);
                    return true;
                }
                this.raise("Duplicate capture group name");
            }
            this.rewind(start);
        }
        return false;
    }
    consumeAtomEscape() {
        if (this.consumeBackreference() ||
            this.consumeCharacterClassEscape() ||
            this.consumeCharacterEscape() ||
            (this._nFlag && this.consumeKGroupName())) {
            return true;
        }
        if (this.strict || this._unicodeMode) {
            this.raise("Invalid escape");
        }
        return false;
    }
    consumeBackreference() {
        const start = this.index;
        if (this.eatDecimalEscape()) {
            const n = this._lastIntValue;
            if (n <= this._numCapturingParens) {
                this.onBackreference(start - 1, this.index, n);
                return true;
            }
            if (this.strict || this._unicodeMode) {
                this.raise("Invalid escape");
            }
            this.rewind(start);
        }
        return false;
    }
    consumeCharacterClassEscape() {
        var _a;
        const start = this.index;
        if (this.eat(LATIN_SMALL_LETTER_D)) {
            this._lastIntValue = -1;
            this.onEscapeCharacterSet(start - 1, this.index, "digit", false);
            return {};
        }
        if (this.eat(LATIN_CAPITAL_LETTER_D)) {
            this._lastIntValue = -1;
            this.onEscapeCharacterSet(start - 1, this.index, "digit", true);
            return {};
        }
        if (this.eat(LATIN_SMALL_LETTER_S)) {
            this._lastIntValue = -1;
            this.onEscapeCharacterSet(start - 1, this.index, "space", false);
            return {};
        }
        if (this.eat(LATIN_CAPITAL_LETTER_S)) {
            this._lastIntValue = -1;
            this.onEscapeCharacterSet(start - 1, this.index, "space", true);
            return {};
        }
        if (this.eat(LATIN_SMALL_LETTER_W)) {
            this._lastIntValue = -1;
            this.onEscapeCharacterSet(start - 1, this.index, "word", false);
            return {};
        }
        if (this.eat(LATIN_CAPITAL_LETTER_W)) {
            this._lastIntValue = -1;
            this.onEscapeCharacterSet(start - 1, this.index, "word", true);
            return {};
        }
        let negate = false;
        if (this._unicodeMode &&
            this.ecmaVersion >= 2018 &&
            (this.eat(LATIN_SMALL_LETTER_P) ||
                (negate = this.eat(LATIN_CAPITAL_LETTER_P)))) {
            this._lastIntValue = -1;
            let result = null;
            if (this.eat(LEFT_CURLY_BRACKET) &&
                (result = this.eatUnicodePropertyValueExpression()) &&
                this.eat(RIGHT_CURLY_BRACKET)) {
                if (negate && result.strings) {
                    this.raise("Invalid property name");
                }
                this.onUnicodePropertyCharacterSet(start - 1, this.index, "property", result.key, result.value, negate, (_a = result.strings) !== null && _a !== void 0 ? _a : false);
                return { mayContainStrings: result.strings };
            }
            this.raise("Invalid property name");
        }
        return null;
    }
    consumeCharacterEscape() {
        const start = this.index;
        if (this.eatControlEscape() ||
            this.eatCControlLetter() ||
            this.eatZero() ||
            this.eatHexEscapeSequence() ||
            this.eatRegExpUnicodeEscapeSequence() ||
            (!this.strict &&
                !this._unicodeMode &&
                this.eatLegacyOctalEscapeSequence()) ||
            this.eatIdentityEscape()) {
            this.onCharacter(start - 1, this.index, this._lastIntValue);
            return true;
        }
        return false;
    }
    consumeKGroupName() {
        const start = this.index;
        if (this.eat(LATIN_SMALL_LETTER_K)) {
            if (this.eatGroupName()) {
                const groupName = this._lastStrValue;
                this._backreferenceNames.add(groupName);
                this.onBackreference(start - 1, this.index, groupName);
                return true;
            }
            this.raise("Invalid named reference");
        }
        return false;
    }
    consumeCharacterClass() {
        const start = this.index;
        if (this.eat(LEFT_SQUARE_BRACKET)) {
            const negate = this.eat(CIRCUMFLEX_ACCENT);
            this.onCharacterClassEnter(start, negate, this._unicodeSetsMode);
            const result = this.consumeClassContents();
            if (!this.eat(RIGHT_SQUARE_BRACKET)) {
                if (this.currentCodePoint === -1) {
                    this.raise("Unterminated character class");
                }
                this.raise("Invalid character in character class");
            }
            if (negate && result.mayContainStrings) {
                this.raise("Negated character class may contain strings");
            }
            this.onCharacterClassLeave(start, this.index, negate);
            return result;
        }
        return null;
    }
    consumeClassContents() {
        if (this._unicodeSetsMode) {
            if (this.currentCodePoint === RIGHT_SQUARE_BRACKET) {
                return {};
            }
            const result = this.consumeClassSetExpression();
            return result;
        }
        const strict = this.strict || this._unicodeMode;
        for (;;) {
            const rangeStart = this.index;
            if (!this.consumeClassAtom()) {
                break;
            }
            const min = this._lastIntValue;
            if (!this.eat(HYPHEN_MINUS)) {
                continue;
            }
            this.onCharacter(this.index - 1, this.index, HYPHEN_MINUS);
            if (!this.consumeClassAtom()) {
                break;
            }
            const max = this._lastIntValue;
            if (min === -1 || max === -1) {
                if (strict) {
                    this.raise("Invalid character class");
                }
                continue;
            }
            if (min > max) {
                this.raise("Range out of order in character class");
            }
            this.onCharacterClassRange(rangeStart, this.index, min, max);
        }
        return {};
    }
    consumeClassAtom() {
        const start = this.index;
        const cp = this.currentCodePoint;
        if (cp !== -1 &&
            cp !== REVERSE_SOLIDUS &&
            cp !== RIGHT_SQUARE_BRACKET) {
            this.advance();
            this._lastIntValue = cp;
            this.onCharacter(start, this.index, this._lastIntValue);
            return true;
        }
        if (this.eat(REVERSE_SOLIDUS)) {
            if (this.consumeClassEscape()) {
                return true;
            }
            if (!this.strict &&
                this.currentCodePoint === LATIN_SMALL_LETTER_C) {
                this._lastIntValue = REVERSE_SOLIDUS;
                this.onCharacter(start, this.index, this._lastIntValue);
                return true;
            }
            if (this.strict || this._unicodeMode) {
                this.raise("Invalid escape");
            }
            this.rewind(start);
        }
        return false;
    }
    consumeClassEscape() {
        const start = this.index;
        if (this.eat(LATIN_SMALL_LETTER_B)) {
            this._lastIntValue = BACKSPACE;
            this.onCharacter(start - 1, this.index, this._lastIntValue);
            return true;
        }
        if (this._unicodeMode && this.eat(HYPHEN_MINUS)) {
            this._lastIntValue = HYPHEN_MINUS;
            this.onCharacter(start - 1, this.index, this._lastIntValue);
            return true;
        }
        let cp = 0;
        if (!this.strict &&
            !this._unicodeMode &&
            this.currentCodePoint === LATIN_SMALL_LETTER_C &&
            (isDecimalDigit((cp = this.nextCodePoint)) || cp === LOW_LINE)) {
            this.advance();
            this.advance();
            this._lastIntValue = cp % 0x20;
            this.onCharacter(start - 1, this.index, this._lastIntValue);
            return true;
        }
        return (Boolean(this.consumeCharacterClassEscape()) ||
            this.consumeCharacterEscape());
    }
    consumeClassSetExpression() {
        const start = this.index;
        let mayContainStrings = false;
        let result = null;
        if (this.consumeClassSetCharacter()) {
            if (this.consumeClassSetRangeFromOperator(start)) {
                this.consumeClassUnionRight({});
                return {};
            }
            mayContainStrings = false;
        }
        else if ((result = this.consumeClassSetOperand())) {
            mayContainStrings = result.mayContainStrings;
        }
        else {
            const cp = this.currentCodePoint;
            if (cp === REVERSE_SOLIDUS) {
                this.advance();
                this.raise("Invalid escape");
            }
            if (cp === this.nextCodePoint &&
                isClassSetReservedDoublePunctuatorCharacter(cp)) {
                this.raise("Invalid set operation in character class");
            }
            this.raise("Invalid character in character class");
        }
        if (this.eat2(AMPERSAND, AMPERSAND)) {
            while (this.currentCodePoint !== AMPERSAND &&
                (result = this.consumeClassSetOperand())) {
                this.onClassIntersection(start, this.index);
                if (!result.mayContainStrings) {
                    mayContainStrings = false;
                }
                if (this.eat2(AMPERSAND, AMPERSAND)) {
                    continue;
                }
                return { mayContainStrings };
            }
            this.raise("Invalid character in character class");
        }
        if (this.eat2(HYPHEN_MINUS, HYPHEN_MINUS)) {
            while (this.consumeClassSetOperand()) {
                this.onClassSubtraction(start, this.index);
                if (this.eat2(HYPHEN_MINUS, HYPHEN_MINUS)) {
                    continue;
                }
                return { mayContainStrings };
            }
            this.raise("Invalid character in character class");
        }
        return this.consumeClassUnionRight({ mayContainStrings });
    }
    consumeClassUnionRight(leftResult) {
        let mayContainStrings = leftResult.mayContainStrings;
        for (;;) {
            const start = this.index;
            if (this.consumeClassSetCharacter()) {
                this.consumeClassSetRangeFromOperator(start);
                continue;
            }
            const result = this.consumeClassSetOperand();
            if (result) {
                if (result.mayContainStrings) {
                    mayContainStrings = true;
                }
                continue;
            }
            break;
        }
        return { mayContainStrings };
    }
    consumeClassSetRangeFromOperator(start) {
        const currentStart = this.index;
        const min = this._lastIntValue;
        if (this.eat(HYPHEN_MINUS)) {
            if (this.consumeClassSetCharacter()) {
                const max = this._lastIntValue;
                if (min === -1 || max === -1) {
                    this.raise("Invalid character class");
                }
                if (min > max) {
                    this.raise("Range out of order in character class");
                }
                this.onCharacterClassRange(start, this.index, min, max);
                return true;
            }
            this.rewind(currentStart);
        }
        return false;
    }
    consumeClassSetOperand() {
        let result = null;
        if ((result = this.consumeNestedClass())) {
            return result;
        }
        if ((result = this.consumeClassStringDisjunction())) {
            return result;
        }
        if (this.consumeClassSetCharacter()) {
            return {};
        }
        return null;
    }
    consumeNestedClass() {
        const start = this.index;
        if (this.eat(LEFT_SQUARE_BRACKET)) {
            const negate = this.eat(CIRCUMFLEX_ACCENT);
            this.onCharacterClassEnter(start, negate, true);
            const result = this.consumeClassContents();
            if (!this.eat(RIGHT_SQUARE_BRACKET)) {
                this.raise("Unterminated character class");
            }
            if (negate && result.mayContainStrings) {
                this.raise("Negated character class may contain strings");
            }
            this.onCharacterClassLeave(start, this.index, negate);
            return result;
        }
        if (this.eat(REVERSE_SOLIDUS)) {
            const result = this.consumeCharacterClassEscape();
            if (result) {
                return result;
            }
            this.rewind(start);
        }
        return null;
    }
    consumeClassStringDisjunction() {
        const start = this.index;
        if (this.eat3(REVERSE_SOLIDUS, LATIN_SMALL_LETTER_Q, LEFT_CURLY_BRACKET)) {
            this.onClassSvStringDisjunctionEnter(start);
            let i = 0;
            let mayContainStrings = false;
            do {
                if (this.consumeClassString(i++).mayContainStrings) {
                    mayContainStrings = true;
                }
            } while (this.eat(VERTICAL_LINE));
            if (this.eat(RIGHT_CURLY_BRACKET)) {
                this.onClassStringDisjunctionLeave(start, this.index);
                return { mayContainStrings };
            }
            this.raise("Unterminated class string disjunction");
        }
        return null;
    }
    consumeClassString(i) {
        const start = this.index;
        let count = 0;
        this.onStringAlternativeEnter(start, i);
        while (this.currentCodePoint !== -1 &&
            this.consumeClassSetCharacter()) {
            count++;
        }
        this.onStringAlternativeLeave(start, this.index, i);
        return { mayContainStrings: count !== 1 };
    }
    consumeClassSetCharacter() {
        const start = this.index;
        const cp = this.currentCodePoint;
        if (cp !== this.nextCodePoint ||
            !isClassSetReservedDoublePunctuatorCharacter(cp)) {
            if (cp !== -1 && !isClassSetSyntaxCharacter(cp)) {
                this._lastIntValue = cp;
                this.advance();
                this.onCharacter(start, this.index, this._lastIntValue);
                return true;
            }
        }
        if (this.eat(REVERSE_SOLIDUS)) {
            if (this.consumeCharacterEscape()) {
                return true;
            }
            if (isClassSetReservedPunctuator(this.currentCodePoint)) {
                this._lastIntValue = this.currentCodePoint;
                this.advance();
                this.onCharacter(start, this.index, this._lastIntValue);
                return true;
            }
            if (this.eat(LATIN_SMALL_LETTER_B)) {
                this._lastIntValue = BACKSPACE;
                this.onCharacter(start, this.index, this._lastIntValue);
                return true;
            }
            this.rewind(start);
        }
        return false;
    }
    eatGroupName() {
        if (this.eat(LESS_THAN_SIGN)) {
            if (this.eatRegExpIdentifierName() && this.eat(GREATER_THAN_SIGN)) {
                return true;
            }
            this.raise("Invalid capture group name");
        }
        return false;
    }
    eatRegExpIdentifierName() {
        if (this.eatRegExpIdentifierStart()) {
            this._lastStrValue = String.fromCodePoint(this._lastIntValue);
            while (this.eatRegExpIdentifierPart()) {
                this._lastStrValue += String.fromCodePoint(this._lastIntValue);
            }
            return true;
        }
        return false;
    }
    eatRegExpIdentifierStart() {
        const start = this.index;
        const forceUFlag = !this._unicodeMode && this.ecmaVersion >= 2020;
        let cp = this.currentCodePoint;
        this.advance();
        if (cp === REVERSE_SOLIDUS &&
            this.eatRegExpUnicodeEscapeSequence(forceUFlag)) {
            cp = this._lastIntValue;
        }
        else if (forceUFlag &&
            isLeadSurrogate(cp) &&
            isTrailSurrogate(this.currentCodePoint)) {
            cp = combineSurrogatePair(cp, this.currentCodePoint);
            this.advance();
        }
        if (isIdentifierStartChar(cp)) {
            this._lastIntValue = cp;
            return true;
        }
        if (this.index !== start) {
            this.rewind(start);
        }
        return false;
    }
    eatRegExpIdentifierPart() {
        const start = this.index;
        const forceUFlag = !this._unicodeMode && this.ecmaVersion >= 2020;
        let cp = this.currentCodePoint;
        this.advance();
        if (cp === REVERSE_SOLIDUS &&
            this.eatRegExpUnicodeEscapeSequence(forceUFlag)) {
            cp = this._lastIntValue;
        }
        else if (forceUFlag &&
            isLeadSurrogate(cp) &&
            isTrailSurrogate(this.currentCodePoint)) {
            cp = combineSurrogatePair(cp, this.currentCodePoint);
            this.advance();
        }
        if (isIdentifierPartChar(cp)) {
            this._lastIntValue = cp;
            return true;
        }
        if (this.index !== start) {
            this.rewind(start);
        }
        return false;
    }
    eatCControlLetter() {
        const start = this.index;
        if (this.eat(LATIN_SMALL_LETTER_C)) {
            if (this.eatControlLetter()) {
                return true;
            }
            this.rewind(start);
        }
        return false;
    }
    eatZero() {
        if (this.currentCodePoint === DIGIT_ZERO &&
            !isDecimalDigit(this.nextCodePoint)) {
            this._lastIntValue = 0;
            this.advance();
            return true;
        }
        return false;
    }
    eatControlEscape() {
        if (this.eat(LATIN_SMALL_LETTER_F)) {
            this._lastIntValue = FORM_FEED;
            return true;
        }
        if (this.eat(LATIN_SMALL_LETTER_N)) {
            this._lastIntValue = LINE_FEED;
            return true;
        }
        if (this.eat(LATIN_SMALL_LETTER_R)) {
            this._lastIntValue = CARRIAGE_RETURN;
            return true;
        }
        if (this.eat(LATIN_SMALL_LETTER_T)) {
            this._lastIntValue = CHARACTER_TABULATION;
            return true;
        }
        if (this.eat(LATIN_SMALL_LETTER_V)) {
            this._lastIntValue = LINE_TABULATION;
            return true;
        }
        return false;
    }
    eatControlLetter() {
        const cp = this.currentCodePoint;
        if (isLatinLetter(cp)) {
            this.advance();
            this._lastIntValue = cp % 0x20;
            return true;
        }
        return false;
    }
    eatRegExpUnicodeEscapeSequence(forceUFlag = false) {
        const start = this.index;
        const uFlag = forceUFlag || this._unicodeMode;
        if (this.eat(LATIN_SMALL_LETTER_U)) {
            if ((uFlag && this.eatRegExpUnicodeSurrogatePairEscape()) ||
                this.eatFixedHexDigits(4) ||
                (uFlag && this.eatRegExpUnicodeCodePointEscape())) {
                return true;
            }
            if (this.strict || uFlag) {
                this.raise("Invalid unicode escape");
            }
            this.rewind(start);
        }
        return false;
    }
    eatRegExpUnicodeSurrogatePairEscape() {
        const start = this.index;
        if (this.eatFixedHexDigits(4)) {
            const lead = this._lastIntValue;
            if (isLeadSurrogate(lead) &&
                this.eat(REVERSE_SOLIDUS) &&
                this.eat(LATIN_SMALL_LETTER_U) &&
                this.eatFixedHexDigits(4)) {
                const trail = this._lastIntValue;
                if (isTrailSurrogate(trail)) {
                    this._lastIntValue = combineSurrogatePair(lead, trail);
                    return true;
                }
            }
            this.rewind(start);
        }
        return false;
    }
    eatRegExpUnicodeCodePointEscape() {
        const start = this.index;
        if (this.eat(LEFT_CURLY_BRACKET) &&
            this.eatHexDigits() &&
            this.eat(RIGHT_CURLY_BRACKET) &&
            isValidUnicode(this._lastIntValue)) {
            return true;
        }
        this.rewind(start);
        return false;
    }
    eatIdentityEscape() {
        const cp = this.currentCodePoint;
        if (this.isValidIdentityEscape(cp)) {
            this._lastIntValue = cp;
            this.advance();
            return true;
        }
        return false;
    }
    isValidIdentityEscape(cp) {
        if (cp === -1) {
            return false;
        }
        if (this._unicodeMode) {
            return isSyntaxCharacter(cp) || cp === SOLIDUS;
        }
        if (this.strict) {
            return !isIdContinue(cp);
        }
        if (this._nFlag) {
            return !(cp === LATIN_SMALL_LETTER_C || cp === LATIN_SMALL_LETTER_K);
        }
        return cp !== LATIN_SMALL_LETTER_C;
    }
    eatDecimalEscape() {
        this._lastIntValue = 0;
        let cp = this.currentCodePoint;
        if (cp >= DIGIT_ONE && cp <= DIGIT_NINE) {
            do {
                this._lastIntValue = 10 * this._lastIntValue + (cp - DIGIT_ZERO);
                this.advance();
            } while ((cp = this.currentCodePoint) >= DIGIT_ZERO &&
                cp <= DIGIT_NINE);
            return true;
        }
        return false;
    }
    eatUnicodePropertyValueExpression() {
        const start = this.index;
        if (this.eatUnicodePropertyName() && this.eat(EQUALS_SIGN)) {
            const key = this._lastStrValue;
            if (this.eatUnicodePropertyValue()) {
                const value = this._lastStrValue;
                if (isValidUnicodeProperty(this.ecmaVersion, key, value)) {
                    return {
                        key,
                        value: value || null,
                    };
                }
                this.raise("Invalid property name");
            }
        }
        this.rewind(start);
        if (this.eatLoneUnicodePropertyNameOrValue()) {
            const nameOrValue = this._lastStrValue;
            if (isValidUnicodeProperty(this.ecmaVersion, "General_Category", nameOrValue)) {
                return {
                    key: "General_Category",
                    value: nameOrValue || null,
                };
            }
            if (isValidLoneUnicodeProperty(this.ecmaVersion, nameOrValue)) {
                return {
                    key: nameOrValue,
                    value: null,
                };
            }
            if (this._unicodeSetsMode &&
                isValidLoneUnicodePropertyOfString(this.ecmaVersion, nameOrValue)) {
                return {
                    key: nameOrValue,
                    value: null,
                    strings: true,
                };
            }
            this.raise("Invalid property name");
        }
        return null;
    }
    eatUnicodePropertyName() {
        this._lastStrValue = "";
        while (isUnicodePropertyNameCharacter(this.currentCodePoint)) {
            this._lastStrValue += String.fromCodePoint(this.currentCodePoint);
            this.advance();
        }
        return this._lastStrValue !== "";
    }
    eatUnicodePropertyValue() {
        this._lastStrValue = "";
        while (isUnicodePropertyValueCharacter(this.currentCodePoint)) {
            this._lastStrValue += String.fromCodePoint(this.currentCodePoint);
            this.advance();
        }
        return this._lastStrValue !== "";
    }
    eatLoneUnicodePropertyNameOrValue() {
        return this.eatUnicodePropertyValue();
    }
    eatHexEscapeSequence() {
        const start = this.index;
        if (this.eat(LATIN_SMALL_LETTER_X)) {
            if (this.eatFixedHexDigits(2)) {
                return true;
            }
            if (this._unicodeMode || this.strict) {
                this.raise("Invalid escape");
            }
            this.rewind(start);
        }
        return false;
    }
    eatDecimalDigits() {
        const start = this.index;
        this._lastIntValue = 0;
        while (isDecimalDigit(this.currentCodePoint)) {
            this._lastIntValue =
                10 * this._lastIntValue + digitToInt(this.currentCodePoint);
            this.advance();
        }
        return this.index !== start;
    }
    eatHexDigits() {
        const start = this.index;
        this._lastIntValue = 0;
        while (isHexDigit(this.currentCodePoint)) {
            this._lastIntValue =
                16 * this._lastIntValue + digitToInt(this.currentCodePoint);
            this.advance();
        }
        return this.index !== start;
    }
    eatLegacyOctalEscapeSequence() {
        if (this.eatOctalDigit()) {
            const n1 = this._lastIntValue;
            if (this.eatOctalDigit()) {
                const n2 = this._lastIntValue;
                if (n1 <= 3 && this.eatOctalDigit()) {
                    this._lastIntValue = n1 * 64 + n2 * 8 + this._lastIntValue;
                }
                else {
                    this._lastIntValue = n1 * 8 + n2;
                }
            }
            else {
                this._lastIntValue = n1;
            }
            return true;
        }
        return false;
    }
    eatOctalDigit() {
        const cp = this.currentCodePoint;
        if (isOctalDigit(cp)) {
            this.advance();
            this._lastIntValue = cp - DIGIT_ZERO;
            return true;
        }
        this._lastIntValue = 0;
        return false;
    }
    eatFixedHexDigits(length) {
        const start = this.index;
        this._lastIntValue = 0;
        for (let i = 0; i < length; ++i) {
            const cp = this.currentCodePoint;
            if (!isHexDigit(cp)) {
                this.rewind(start);
                return false;
            }
            this._lastIntValue = 16 * this._lastIntValue + digitToInt(cp);
            this.advance();
        }
        return true;
    }
    eatModifiers() {
        let ate = false;
        while (isRegularExpressionModifier(this.currentCodePoint)) {
            this.advance();
            ate = true;
        }
        return ate;
    }
    parseModifiers(start, end) {
        const { ignoreCase, multiline, dotAll } = this.parseFlags(this._reader.source, start, end);
        return { ignoreCase, multiline, dotAll };
    }
    parseFlags(source, start, end) {
        const flags = {
            global: false,
            ignoreCase: false,
            multiline: false,
            unicode: false,
            sticky: false,
            dotAll: false,
            hasIndices: false,
            unicodeSets: false,
        };
        const validFlags = new Set();
        validFlags.add(LATIN_SMALL_LETTER_G);
        validFlags.add(LATIN_SMALL_LETTER_I);
        validFlags.add(LATIN_SMALL_LETTER_M);
        if (this.ecmaVersion >= 2015) {
            validFlags.add(LATIN_SMALL_LETTER_U);
            validFlags.add(LATIN_SMALL_LETTER_Y);
            if (this.ecmaVersion >= 2018) {
                validFlags.add(LATIN_SMALL_LETTER_S);
                if (this.ecmaVersion >= 2022) {
                    validFlags.add(LATIN_SMALL_LETTER_D);
                    if (this.ecmaVersion >= 2024) {
                        validFlags.add(LATIN_SMALL_LETTER_V);
                    }
                }
            }
        }
        for (let i = start; i < end; ++i) {
            const flag = source.charCodeAt(i);
            if (validFlags.has(flag)) {
                const prop = FLAG_CODEPOINT_TO_PROP[flag];
                if (flags[prop]) {
                    this.raise(`Duplicated flag '${source[i]}'`, {
                        index: start,
                    });
                }
                flags[prop] = true;
            }
            else {
                this.raise(`Invalid flag '${source[i]}'`, { index: start });
            }
        }
        return flags;
    }
}

const DUMMY_PATTERN = {};
const DUMMY_FLAGS = {};
const DUMMY_CAPTURING_GROUP = {};
function isClassSetOperand(node) {
    return (node.type === "Character" ||
        node.type === "CharacterSet" ||
        node.type === "CharacterClass" ||
        node.type === "ExpressionCharacterClass" ||
        node.type === "ClassStringDisjunction");
}
class RegExpParserState {
    constructor(options) {
        var _a;
        this._node = DUMMY_PATTERN;
        this._expressionBufferMap = new Map();
        this._flags = DUMMY_FLAGS;
        this._backreferences = [];
        this._capturingGroups = [];
        this.source = "";
        this.strict = Boolean(options === null || options === void 0 ? void 0 : options.strict);
        this.ecmaVersion = (_a = options === null || options === void 0 ? void 0 : options.ecmaVersion) !== null && _a !== void 0 ? _a : latestEcmaVersion;
    }
    get pattern() {
        if (this._node.type !== "Pattern") {
            throw new Error("UnknownError");
        }
        return this._node;
    }
    get flags() {
        if (this._flags.type !== "Flags") {
            throw new Error("UnknownError");
        }
        return this._flags;
    }
    onRegExpFlags(start, end, { global, ignoreCase, multiline, unicode, sticky, dotAll, hasIndices, unicodeSets, }) {
        this._flags = {
            type: "Flags",
            parent: null,
            start,
            end,
            raw: this.source.slice(start, end),
            global,
            ignoreCase,
            multiline,
            unicode,
            sticky,
            dotAll,
            hasIndices,
            unicodeSets,
        };
    }
    onPatternEnter(start) {
        this._node = {
            type: "Pattern",
            parent: null,
            start,
            end: start,
            raw: "",
            alternatives: [],
        };
        this._backreferences.length = 0;
        this._capturingGroups.length = 0;
    }
    onPatternLeave(start, end) {
        this._node.end = end;
        this._node.raw = this.source.slice(start, end);
        for (const reference of this._backreferences) {
            const ref = reference.ref;
            const groups = typeof ref === "number"
                ? [this._capturingGroups[ref - 1]]
                : this._capturingGroups.filter((g) => g.name === ref);
            if (groups.length === 1) {
                const group = groups[0];
                reference.ambiguous = false;
                reference.resolved = group;
            }
            else {
                reference.ambiguous = true;
                reference.resolved = groups;
            }
            for (const group of groups) {
                group.references.push(reference);
            }
        }
    }
    onAlternativeEnter(start) {
        const parent = this._node;
        if (parent.type !== "Assertion" &&
            parent.type !== "CapturingGroup" &&
            parent.type !== "Group" &&
            parent.type !== "Pattern") {
            throw new Error("UnknownError");
        }
        this._node = {
            type: "Alternative",
            parent,
            start,
            end: start,
            raw: "",
            elements: [],
        };
        parent.alternatives.push(this._node);
    }
    onAlternativeLeave(start, end) {
        const node = this._node;
        if (node.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        node.end = end;
        node.raw = this.source.slice(start, end);
        this._node = node.parent;
    }
    onGroupEnter(start) {
        const parent = this._node;
        if (parent.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        const group = {
            type: "Group",
            parent,
            start,
            end: start,
            raw: "",
            modifiers: null,
            alternatives: [],
        };
        this._node = group;
        parent.elements.push(this._node);
    }
    onGroupLeave(start, end) {
        const node = this._node;
        if (node.type !== "Group" || node.parent.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        node.end = end;
        node.raw = this.source.slice(start, end);
        this._node = node.parent;
    }
    onModifiersEnter(start) {
        const parent = this._node;
        if (parent.type !== "Group") {
            throw new Error("UnknownError");
        }
        this._node = {
            type: "Modifiers",
            parent,
            start,
            end: start,
            raw: "",
            add: null,
            remove: null,
        };
        parent.modifiers = this._node;
    }
    onModifiersLeave(start, end) {
        const node = this._node;
        if (node.type !== "Modifiers" || node.parent.type !== "Group") {
            throw new Error("UnknownError");
        }
        node.end = end;
        node.raw = this.source.slice(start, end);
        this._node = node.parent;
    }
    onAddModifiers(start, end, { ignoreCase, multiline, dotAll, }) {
        const parent = this._node;
        if (parent.type !== "Modifiers") {
            throw new Error("UnknownError");
        }
        parent.add = {
            type: "ModifierFlags",
            parent,
            start,
            end,
            raw: this.source.slice(start, end),
            ignoreCase,
            multiline,
            dotAll,
        };
    }
    onRemoveModifiers(start, end, { ignoreCase, multiline, dotAll, }) {
        const parent = this._node;
        if (parent.type !== "Modifiers") {
            throw new Error("UnknownError");
        }
        parent.remove = {
            type: "ModifierFlags",
            parent,
            start,
            end,
            raw: this.source.slice(start, end),
            ignoreCase,
            multiline,
            dotAll,
        };
    }
    onCapturingGroupEnter(start, name) {
        const parent = this._node;
        if (parent.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        this._node = {
            type: "CapturingGroup",
            parent,
            start,
            end: start,
            raw: "",
            name,
            alternatives: [],
            references: [],
        };
        parent.elements.push(this._node);
        this._capturingGroups.push(this._node);
    }
    onCapturingGroupLeave(start, end) {
        const node = this._node;
        if (node.type !== "CapturingGroup" ||
            node.parent.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        node.end = end;
        node.raw = this.source.slice(start, end);
        this._node = node.parent;
    }
    onQuantifier(start, end, min, max, greedy) {
        const parent = this._node;
        if (parent.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        const element = parent.elements.pop();
        if (element == null ||
            element.type === "Quantifier" ||
            (element.type === "Assertion" && element.kind !== "lookahead")) {
            throw new Error("UnknownError");
        }
        const node = {
            type: "Quantifier",
            parent,
            start: element.start,
            end,
            raw: this.source.slice(element.start, end),
            min,
            max,
            greedy,
            element,
        };
        parent.elements.push(node);
        element.parent = node;
    }
    onLookaroundAssertionEnter(start, kind, negate) {
        const parent = this._node;
        if (parent.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        const node = (this._node = {
            type: "Assertion",
            parent,
            start,
            end: start,
            raw: "",
            kind,
            negate,
            alternatives: [],
        });
        parent.elements.push(node);
    }
    onLookaroundAssertionLeave(start, end) {
        const node = this._node;
        if (node.type !== "Assertion" || node.parent.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        node.end = end;
        node.raw = this.source.slice(start, end);
        this._node = node.parent;
    }
    onEdgeAssertion(start, end, kind) {
        const parent = this._node;
        if (parent.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        parent.elements.push({
            type: "Assertion",
            parent,
            start,
            end,
            raw: this.source.slice(start, end),
            kind,
        });
    }
    onWordBoundaryAssertion(start, end, kind, negate) {
        const parent = this._node;
        if (parent.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        parent.elements.push({
            type: "Assertion",
            parent,
            start,
            end,
            raw: this.source.slice(start, end),
            kind,
            negate,
        });
    }
    onAnyCharacterSet(start, end, kind) {
        const parent = this._node;
        if (parent.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        parent.elements.push({
            type: "CharacterSet",
            parent,
            start,
            end,
            raw: this.source.slice(start, end),
            kind,
        });
    }
    onEscapeCharacterSet(start, end, kind, negate) {
        const parent = this._node;
        if (parent.type !== "Alternative" && parent.type !== "CharacterClass") {
            throw new Error("UnknownError");
        }
        parent.elements.push({
            type: "CharacterSet",
            parent,
            start,
            end,
            raw: this.source.slice(start, end),
            kind,
            negate,
        });
    }
    onUnicodePropertyCharacterSet(start, end, kind, key, value, negate, strings) {
        const parent = this._node;
        if (parent.type !== "Alternative" && parent.type !== "CharacterClass") {
            throw new Error("UnknownError");
        }
        const base = {
            type: "CharacterSet",
            parent: null,
            start,
            end,
            raw: this.source.slice(start, end),
            kind,
            strings: null,
            key,
        };
        if (strings) {
            if ((parent.type === "CharacterClass" && !parent.unicodeSets) ||
                negate ||
                value !== null) {
                throw new Error("UnknownError");
            }
            parent.elements.push(Object.assign(Object.assign({}, base), { parent, strings, value, negate }));
        }
        else {
            parent.elements.push(Object.assign(Object.assign({}, base), { parent, strings, value, negate }));
        }
    }
    onCharacter(start, end, value) {
        const parent = this._node;
        if (parent.type !== "Alternative" &&
            parent.type !== "CharacterClass" &&
            parent.type !== "StringAlternative") {
            throw new Error("UnknownError");
        }
        parent.elements.push({
            type: "Character",
            parent,
            start,
            end,
            raw: this.source.slice(start, end),
            value,
        });
    }
    onBackreference(start, end, ref) {
        const parent = this._node;
        if (parent.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        const node = {
            type: "Backreference",
            parent,
            start,
            end,
            raw: this.source.slice(start, end),
            ref,
            ambiguous: false,
            resolved: DUMMY_CAPTURING_GROUP,
        };
        parent.elements.push(node);
        this._backreferences.push(node);
    }
    onCharacterClassEnter(start, negate, unicodeSets) {
        const parent = this._node;
        const base = {
            type: "CharacterClass",
            parent,
            start,
            end: start,
            raw: "",
            unicodeSets,
            negate,
            elements: [],
        };
        if (parent.type === "Alternative") {
            const node = Object.assign(Object.assign({}, base), { parent });
            this._node = node;
            parent.elements.push(node);
        }
        else if (parent.type === "CharacterClass" &&
            parent.unicodeSets &&
            unicodeSets) {
            const node = Object.assign(Object.assign({}, base), { parent,
                unicodeSets });
            this._node = node;
            parent.elements.push(node);
        }
        else {
            throw new Error("UnknownError");
        }
    }
    onCharacterClassLeave(start, end) {
        const node = this._node;
        if (node.type !== "CharacterClass" ||
            (node.parent.type !== "Alternative" &&
                node.parent.type !== "CharacterClass")) {
            throw new Error("UnknownError");
        }
        const parent = node.parent;
        node.end = end;
        node.raw = this.source.slice(start, end);
        this._node = parent;
        const expression = this._expressionBufferMap.get(node);
        if (!expression) {
            return;
        }
        if (node.elements.length > 0) {
            throw new Error("UnknownError");
        }
        this._expressionBufferMap.delete(node);
        const newNode = {
            type: "ExpressionCharacterClass",
            parent,
            start: node.start,
            end: node.end,
            raw: node.raw,
            negate: node.negate,
            expression,
        };
        expression.parent = newNode;
        if (node !== parent.elements.pop()) {
            throw new Error("UnknownError");
        }
        parent.elements.push(newNode);
    }
    onCharacterClassRange(start, end) {
        const parent = this._node;
        if (parent.type !== "CharacterClass") {
            throw new Error("UnknownError");
        }
        const elements = parent.elements;
        const max = elements.pop();
        if (!max || max.type !== "Character") {
            throw new Error("UnknownError");
        }
        if (!parent.unicodeSets) {
            const hyphen = elements.pop();
            if (!hyphen ||
                hyphen.type !== "Character" ||
                hyphen.value !== HYPHEN_MINUS) {
                throw new Error("UnknownError");
            }
        }
        const min = elements.pop();
        if (!min || min.type !== "Character") {
            throw new Error("UnknownError");
        }
        const node = {
            type: "CharacterClassRange",
            parent,
            start,
            end,
            raw: this.source.slice(start, end),
            min,
            max,
        };
        min.parent = node;
        max.parent = node;
        elements.push(node);
    }
    onClassIntersection(start, end) {
        var _a;
        const parent = this._node;
        if (parent.type !== "CharacterClass" || !parent.unicodeSets) {
            throw new Error("UnknownError");
        }
        const right = parent.elements.pop();
        const left = (_a = this._expressionBufferMap.get(parent)) !== null && _a !== void 0 ? _a : parent.elements.pop();
        if (!left ||
            !right ||
            left.type === "ClassSubtraction" ||
            (left.type !== "ClassIntersection" && !isClassSetOperand(left)) ||
            !isClassSetOperand(right)) {
            throw new Error("UnknownError");
        }
        const node = {
            type: "ClassIntersection",
            parent: parent,
            start,
            end,
            raw: this.source.slice(start, end),
            left,
            right,
        };
        left.parent = node;
        right.parent = node;
        this._expressionBufferMap.set(parent, node);
    }
    onClassSubtraction(start, end) {
        var _a;
        const parent = this._node;
        if (parent.type !== "CharacterClass" || !parent.unicodeSets) {
            throw new Error("UnknownError");
        }
        const right = parent.elements.pop();
        const left = (_a = this._expressionBufferMap.get(parent)) !== null && _a !== void 0 ? _a : parent.elements.pop();
        if (!left ||
            !right ||
            left.type === "ClassIntersection" ||
            (left.type !== "ClassSubtraction" && !isClassSetOperand(left)) ||
            !isClassSetOperand(right)) {
            throw new Error("UnknownError");
        }
        const node = {
            type: "ClassSubtraction",
            parent: parent,
            start,
            end,
            raw: this.source.slice(start, end),
            left,
            right,
        };
        left.parent = node;
        right.parent = node;
        this._expressionBufferMap.set(parent, node);
    }
    onClassStringDisjunctionEnter(start) {
        const parent = this._node;
        if (parent.type !== "CharacterClass" || !parent.unicodeSets) {
            throw new Error("UnknownError");
        }
        this._node = {
            type: "ClassStringDisjunction",
            parent,
            start,
            end: start,
            raw: "",
            alternatives: [],
        };
        parent.elements.push(this._node);
    }
    onClassStringDisjunctionLeave(start, end) {
        const node = this._node;
        if (node.type !== "ClassStringDisjunction" ||
            node.parent.type !== "CharacterClass") {
            throw new Error("UnknownError");
        }
        node.end = end;
        node.raw = this.source.slice(start, end);
        this._node = node.parent;
    }
    onStringAlternativeEnter(start) {
        const parent = this._node;
        if (parent.type !== "ClassStringDisjunction") {
            throw new Error("UnknownError");
        }
        this._node = {
            type: "StringAlternative",
            parent,
            start,
            end: start,
            raw: "",
            elements: [],
        };
        parent.alternatives.push(this._node);
    }
    onStringAlternativeLeave(start, end) {
        const node = this._node;
        if (node.type !== "StringAlternative") {
            throw new Error("UnknownError");
        }
        node.end = end;
        node.raw = this.source.slice(start, end);
        this._node = node.parent;
    }
}
class RegExpParser {
    constructor(options) {
        this._state = new RegExpParserState(options);
        this._validator = new RegExpValidator(this._state);
    }
    parseLiteral(source, start = 0, end = source.length) {
        this._state.source = source;
        this._validator.validateLiteral(source, start, end);
        const pattern = this._state.pattern;
        const flags = this._state.flags;
        const literal = {
            type: "RegExpLiteral",
            parent: null,
            start,
            end,
            raw: source,
            pattern,
            flags,
        };
        pattern.parent = literal;
        flags.parent = literal;
        return literal;
    }
    parseFlags(source, start = 0, end = source.length) {
        this._state.source = source;
        this._validator.validateFlags(source, start, end);
        return this._state.flags;
    }
    parsePattern(source, start = 0, end = source.length, uFlagOrFlags = undefined) {
        this._state.source = source;
        this._validator.validatePattern(source, start, end, uFlagOrFlags);
        return this._state.pattern;
    }
}

class RegExpVisitor {
    constructor(handlers) {
        this._handlers = handlers;
    }
    visit(node) {
        switch (node.type) {
            case "Alternative":
                this.visitAlternative(node);
                break;
            case "Assertion":
                this.visitAssertion(node);
                break;
            case "Backreference":
                this.visitBackreference(node);
                break;
            case "CapturingGroup":
                this.visitCapturingGroup(node);
                break;
            case "Character":
                this.visitCharacter(node);
                break;
            case "CharacterClass":
                this.visitCharacterClass(node);
                break;
            case "CharacterClassRange":
                this.visitCharacterClassRange(node);
                break;
            case "CharacterSet":
                this.visitCharacterSet(node);
                break;
            case "ClassIntersection":
                this.visitClassIntersection(node);
                break;
            case "ClassStringDisjunction":
                this.visitClassStringDisjunction(node);
                break;
            case "ClassSubtraction":
                this.visitClassSubtraction(node);
                break;
            case "ExpressionCharacterClass":
                this.visitExpressionCharacterClass(node);
                break;
            case "Flags":
                this.visitFlags(node);
                break;
            case "Group":
                this.visitGroup(node);
                break;
            case "Modifiers":
                this.visitModifiers(node);
                break;
            case "ModifierFlags":
                this.visitModifierFlags(node);
                break;
            case "Pattern":
                this.visitPattern(node);
                break;
            case "Quantifier":
                this.visitQuantifier(node);
                break;
            case "RegExpLiteral":
                this.visitRegExpLiteral(node);
                break;
            case "StringAlternative":
                this.visitStringAlternative(node);
                break;
            default:
                throw new Error(`Unknown type: ${node.type}`);
        }
    }
    visitAlternative(node) {
        if (this._handlers.onAlternativeEnter) {
            this._handlers.onAlternativeEnter(node);
        }
        node.elements.forEach(this.visit, this);
        if (this._handlers.onAlternativeLeave) {
            this._handlers.onAlternativeLeave(node);
        }
    }
    visitAssertion(node) {
        if (this._handlers.onAssertionEnter) {
            this._handlers.onAssertionEnter(node);
        }
        if (node.kind === "lookahead" || node.kind === "lookbehind") {
            node.alternatives.forEach(this.visit, this);
        }
        if (this._handlers.onAssertionLeave) {
            this._handlers.onAssertionLeave(node);
        }
    }
    visitBackreference(node) {
        if (this._handlers.onBackreferenceEnter) {
            this._handlers.onBackreferenceEnter(node);
        }
        if (this._handlers.onBackreferenceLeave) {
            this._handlers.onBackreferenceLeave(node);
        }
    }
    visitCapturingGroup(node) {
        if (this._handlers.onCapturingGroupEnter) {
            this._handlers.onCapturingGroupEnter(node);
        }
        node.alternatives.forEach(this.visit, this);
        if (this._handlers.onCapturingGroupLeave) {
            this._handlers.onCapturingGroupLeave(node);
        }
    }
    visitCharacter(node) {
        if (this._handlers.onCharacterEnter) {
            this._handlers.onCharacterEnter(node);
        }
        if (this._handlers.onCharacterLeave) {
            this._handlers.onCharacterLeave(node);
        }
    }
    visitCharacterClass(node) {
        if (this._handlers.onCharacterClassEnter) {
            this._handlers.onCharacterClassEnter(node);
        }
        node.elements.forEach(this.visit, this);
        if (this._handlers.onCharacterClassLeave) {
            this._handlers.onCharacterClassLeave(node);
        }
    }
    visitCharacterClassRange(node) {
        if (this._handlers.onCharacterClassRangeEnter) {
            this._handlers.onCharacterClassRangeEnter(node);
        }
        this.visitCharacter(node.min);
        this.visitCharacter(node.max);
        if (this._handlers.onCharacterClassRangeLeave) {
            this._handlers.onCharacterClassRangeLeave(node);
        }
    }
    visitCharacterSet(node) {
        if (this._handlers.onCharacterSetEnter) {
            this._handlers.onCharacterSetEnter(node);
        }
        if (this._handlers.onCharacterSetLeave) {
            this._handlers.onCharacterSetLeave(node);
        }
    }
    visitClassIntersection(node) {
        if (this._handlers.onClassIntersectionEnter) {
            this._handlers.onClassIntersectionEnter(node);
        }
        this.visit(node.left);
        this.visit(node.right);
        if (this._handlers.onClassIntersectionLeave) {
            this._handlers.onClassIntersectionLeave(node);
        }
    }
    visitClassStringDisjunction(node) {
        if (this._handlers.onClassStringDisjunctionEnter) {
            this._handlers.onClassStringDisjunctionEnter(node);
        }
        node.alternatives.forEach(this.visit, this);
        if (this._handlers.onClassStringDisjunctionLeave) {
            this._handlers.onClassStringDisjunctionLeave(node);
        }
    }
    visitClassSubtraction(node) {
        if (this._handlers.onClassSubtractionEnter) {
            this._handlers.onClassSubtractionEnter(node);
        }
        this.visit(node.left);
        this.visit(node.right);
        if (this._handlers.onClassSubtractionLeave) {
            this._handlers.onClassSubtractionLeave(node);
        }
    }
    visitExpressionCharacterClass(node) {
        if (this._handlers.onExpressionCharacterClassEnter) {
            this._handlers.onExpressionCharacterClassEnter(node);
        }
        this.visit(node.expression);
        if (this._handlers.onExpressionCharacterClassLeave) {
            this._handlers.onExpressionCharacterClassLeave(node);
        }
    }
    visitFlags(node) {
        if (this._handlers.onFlagsEnter) {
            this._handlers.onFlagsEnter(node);
        }
        if (this._handlers.onFlagsLeave) {
            this._handlers.onFlagsLeave(node);
        }
    }
    visitGroup(node) {
        if (this._handlers.onGroupEnter) {
            this._handlers.onGroupEnter(node);
        }
        if (node.modifiers) {
            this.visit(node.modifiers);
        }
        node.alternatives.forEach(this.visit, this);
        if (this._handlers.onGroupLeave) {
            this._handlers.onGroupLeave(node);
        }
    }
    visitModifiers(node) {
        if (this._handlers.onModifiersEnter) {
            this._handlers.onModifiersEnter(node);
        }
        if (node.add) {
            this.visit(node.add);
        }
        if (node.remove) {
            this.visit(node.remove);
        }
        if (this._handlers.onModifiersLeave) {
            this._handlers.onModifiersLeave(node);
        }
    }
    visitModifierFlags(node) {
        if (this._handlers.onModifierFlagsEnter) {
            this._handlers.onModifierFlagsEnter(node);
        }
        if (this._handlers.onModifierFlagsLeave) {
            this._handlers.onModifierFlagsLeave(node);
        }
    }
    visitPattern(node) {
        if (this._handlers.onPatternEnter) {
            this._handlers.onPatternEnter(node);
        }
        node.alternatives.forEach(this.visit, this);
        if (this._handlers.onPatternLeave) {
            this._handlers.onPatternLeave(node);
        }
    }
    visitQuantifier(node) {
        if (this._handlers.onQuantifierEnter) {
            this._handlers.onQuantifierEnter(node);
        }
        this.visit(node.element);
        if (this._handlers.onQuantifierLeave) {
            this._handlers.onQuantifierLeave(node);
        }
    }
    visitRegExpLiteral(node) {
        if (this._handlers.onRegExpLiteralEnter) {
            this._handlers.onRegExpLiteralEnter(node);
        }
        this.visitPattern(node.pattern);
        this.visitFlags(node.flags);
        if (this._handlers.onRegExpLiteralLeave) {
            this._handlers.onRegExpLiteralLeave(node);
        }
    }
    visitStringAlternative(node) {
        if (this._handlers.onStringAlternativeEnter) {
            this._handlers.onStringAlternativeEnter(node);
        }
        node.elements.forEach(this.visit, this);
        if (this._handlers.onStringAlternativeLeave) {
            this._handlers.onStringAlternativeLeave(node);
        }
    }
}

function parseRegExpLiteral(source, options) {
    return new RegExpParser(options).parseLiteral(String(source));
}
function validateRegExpLiteral(source, options) {
    new RegExpValidator(options).validateLiteral(source);
}
function visitRegExpAST(node, handlers) {
    new RegExpVisitor(handlers).visit(node);
}

exports.AST = ast;
exports.RegExpParser = RegExpParser;
exports.RegExpSyntaxError = RegExpSyntaxError;
exports.RegExpValidator = RegExpValidator;
exports.parseRegExpLiteral = parseRegExpLiteral;
exports.validateRegExpLiteral = validateRegExpLiteral;
exports.visitRegExpAST = visitRegExpAST;
//# sourceMappingURL=index.js.map
 
ĺ2x   {"version":3,"file":"index.js.map","sources":[".temp/src/ecma-versions.ts",".temp/unicode/src/unicode/ids.ts",".temp/unicode/src/unicode/properties.ts",".temp/unicode/src/unicode/index.ts",".temp/src/group-specifiers.ts",".temp/src/reader.ts",".temp/src/regexp-syntax-error.ts",".temp/src/validator.ts",".temp/src/parser.ts",".temp/src/visitor.ts",".temp/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":";;;;;;;;AAaO,MAAM,iBAAiB,GAAG,IAAI;;ACTrC,IAAI,kBAAkB,GAAyB,SAAS,CAAA;AACxD,IAAI,qBAAqB,GAAyB,SAAS,CAAA;A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;AAEO,IAAA,sBAAsB,CAAC,IAAuB,EAAA;AAClD,QAAA,IAAI,IAAI,CAAC,SAAS,CAAC,wBAAwB,EAAE;AACzC,YAAA,IAAI,CAAC,SAAS,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAA;AAChD,SAAA;QACD,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;AACvC,QAAA,IAAI,IAAI,CAAC,SAAS,CAAC,wBAAwB,EAAE;AACzC,YAAA,IAAI,CAAC,SAAS,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAA;AAChD,SAAA;KACJ;AACJ;;ACpTe,SAAA,kBAAkB,CAC9B,MAAuB,EACvB,OAA8B,EAAA;AAE9B,IAAA,OAAO,IAAI,YAAY,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAA;AACjE,CAAC;AAOe,SAAA,qBAAqB,CACjC,MAAc,EACd,OAAiC,EAAA;IAEjC,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAAA;AACxD,CAAC;AAEe,SAAA,cAAc,CAC1B,IAAc,EACd,QAAgC,EAAA;IAEhC,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;AAC3C;;;;;;;;;;"}c,5x   var ast = /*#__PURE__*/Object.freeze({
    __proto__: null
});

const latestEcmaVersion = 2025;

let largeIdStartRanges = undefined;
let largeIdContinueRanges = undefined;
function isIdStart(cp) {
    if (cp < 0x41)
        return false;
    if (cp < 0x5b)
        return true;
    if (cp < 0x61)
        return false;
    if (cp < 0x7b)
        return true;
    return isLargeIdStart(cp);
}
function isIdContinue(cp) {
    if (cp < 0x30)
        return false;
    if (cp < 0x3a)
        return true;
    if (cp < 0x41)
        return false;
    if (cp < 0x5b)
        return true;
    if (cp === 0x5f)
        return true;
    if (cp < 0x61)
        return false;
    if (cp < 0x7b)
        return true;
    return isLargeIdStart(cp) || isLargeIdContinue(cp);
}
function isLargeIdStart(cp) {
    return isInRange(cp, largeIdStartRanges !== null && largeIdStartRanges !== void 0 ? largeIdStartRanges : (largeIdStartRanges = initLargeIdStartRanges()));
}
function isLargeIdContinue(cp) {
    return isInRange(cp, largeIdContinueRanges !== null && largeIdContinueRanges !== void 0 ? largeIdContinueRanges : (largeIdContinueRanges = initLargeIdContinueRanges()));
}
function initLargeIdStartRanges() {
    return restoreRanges("4q 0 b 0 5 0 6 m 2 u 2 cp 5 b f 4 8 0 2 0 3m 4 2 1 3 3 2 0 7 0 2 2 2 0 2 j 2 2a 2 3u 9 4l 2 11 3 0 7 14 20 q 5 3 1a 16 10 1 2 2q 2 0 g 1 8 1 b 2 3 0 h 0 2 t u 2g c 0 p w a 1 5 0 6 l 5 0 a 0 4 0 o o 8 a 6 n 2 6 h 15 1n 1h 4 0 j 0 8 9 g f 5 7 3 1 3 l 2 6 2 0 4 3 4 0 h 0 e 1 2 2 f 1 b 0 9 5 5 1 3 l 2 6 2 1 2 1 2 1 w 3 2 0 k 2 h 8 2 2 2 l 2 6 2 1 2 4 4 0 j 0 g 1 o 0 c 7 3 1 3 l 2 6 2 1 2 4 4 0 v 1 2 2 g 0 i 0 2 5 4 2 2 3 4 1 2 0 2 1 4 1 4 2 4 b n 0 1h 7 2 2 2 m 2 f 4 0 r 2 2 1 3 1 v 0 5 7 2 2 2 m 2 9 2 4 4 0 v 2 2 1 g 1 i 8 2 2 2 14 3 0 h 0 6 2 9 2 p 5 6 h 4 n 2 8 2 0 3 6 1n 1b 2 1 d 6 1n 1 2 0 2 4 2 n 2 0 2 9 2 1 a 0 3 4 2 0 m 3 x 0 1s 7 2 z s 4 38 16 l 0 h 5 5 3 4 0 4 1 8 2 5 c d 0 i 11 2 0 6 0 3 16 2 98 2 3 3 6 2 0 2 3 3 14 2 3 3 w 2 3 3 6 2 0 2 3 3 e 2 1k 2 3 3 1u 12 f h 2d 3 5 4 h7 3 g 2 p 6 22 4 a 8 h e i f h f c 2 2 g 1f 10 0 5 0 1w 2g 8 14 2 0 6 1x b u 1e t 3 4 c 17 5 p 1j m a 1g 2b 0 2m 1a i 7 1j t e 1 b 17 r z 16 2 b z 3 a 6 16 3 2 16 3 2 5 2 1 4 0 6 5b 1t 7p 3 5 3 11 3 5 3 7 2 0 2 0 2 0 2 u 3 1g 2 6 2 0 4 2 2 6 4 3 3 5 5 c 6 2 2 6 39 0 e 0 h c 2u 0 5 0 3 9 2 0 3 5 7 0 2 0 2 0 2 f 3 3 6 4 5 0 i 14 22g 6c 7 3 4 1 d 11 2 0 6 0 3 1j 8 0 h m a 6 2 6 2 6 2 6 2 6 2 6 2 6 2 6 fb 2 q 8 8 4 3 4 5 2d 5 4 2 2h 2 3 6 16 2 2l i v 1d f e9 533 1t h3g 1w 19 3 7g 4 f b 1 l 1a h u 3 27 14 8 3 2u 3 29 l g 2 2 2 3 2 m u 1f f 1d 1r 5 4 0 2 1 c r b m q s 8 1a t 0 h 4 2 9 b 4 2 14 o 2 2 7 l m 4 0 4 1d 2 0 4 1 3 4 3 0 2 0 p 2 3 a 8 2 d 5 3 5 3 5 a 6 2 6 2 16 2 d 7 36 u 8mb d m 5 1c 6it a5 3 2x 13 6 d 4 6 0 2 9 2 c 2 4 2 0 2 1 2 1 2 2z y a2 j 1r 3 1h 15 b 39 4 2 3q 11 p 7 p c 2g 4 5 3 5 3 5 3 2 10 b 2 p 2 i 2 1 2 e 3 d z 3e 1y 1g 7g s 4 1c 1c v e t 6 11 b t 3 z 5 7 2 4 17 4d j z 5 z 5 13 9 1f d a 2 e 2 6 2 1 2 a 2 e 2 6 2 1 4 1f d 8m a l b 7 p 5 2 15 2 8 1y 5 3 0 2 17 2 1 4 0 3 m b m a u 1u i 2 1 b l b p 7 p 13 1j 7 1 1t 0 g 3 2 2 2 s 17 s 4 s 10 7 2 r s 1h b l b i e h 33 20 1k 1e e 1e e z 13 r a m 6z 15 7 1 h 5 1l s b 0 9 l 17 h 1b k s m d 1g 1m 1 3 0 e 18 x o r z u 0 3 0 9 y 4 0 d 1b f 3 m 0 2 0 10 h 2 o k 1 1s 6 2 0 2 3 2 e 2 9 8 1a 13 7 3 1 3 l 2 6 2 1 2 4 4 0 j 0 d 4 v 9 2 0 3 0 2 11 2 0 q 0 2 0 19 1g j 3 l 2 v 1b l 1 2 0 55 1a 16 3 11 1b l 0 1o 16 e 0 20 q 12 6 56 17 39 1r w 7 3 0 3 7 2 1 2 n g 0 2 0 2n 7 3 12 h 0 2 0 t 0 b 13 8 0 m 0 c 19 k 0 j 20 5k w w 8 2 10 i 0 1e t 35 6 2 1 2 11 m 0 q 5 2 1 2 v f 0 o 17 79 i g 0 2 c 2 x 3h 0 28 pl 2v 32 i 5f 219 2o g tr i 5 q 32y 6 g6 5a2 t 1cz fs 8 u i 26 i t j 1b h 3 w k 6 i c1 18 5w 1r x o 3 o 19 22 6 0 1v c 1t 1 2 0 f 4 a 5p1 16 v 2q 36 6pq 3 2 6 2 1 2 82 g 0 u 2 3 0 f 3 9 az 1s5 2y 6 c 4 8 8 9 4mf 2c 2 1y 2 1 3 0 3 1 3 3 2 b 2 0 2 6 2 1s 2 3 3 7 2 6 2 r 2 3 2 4 2 0 4 6 2 9f 3 o 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 u 2 o 2 7 1f9 u 7 5 7a 1p 43 18 b 6 h 0 8y t j 17 dh r 6d t 3 0 5s u 2 2 2 1 2 6 3 4 a 1 69 6 2 3 2 1 2 e 2 5g 1o 1v 8 0 xh 3 2 q 2 1 2 0 3 0 2 9 2 3 2 0 2 0 7 0 5 0 2 0 2 0 2 2 2 1 2 0 3 0 2 0 2 0 2 0 2 0 2 1 2 0 3 3 2 6 2 3 2 3 2 0 2 9 2 g 6 2 2 4 2 g 3et wyn x 3dp 3 4gd 3 5rk g h9 1wj f1 15v 3t6 6 6jt");
}
function initLargeIdContinueRanges() {
    return restoreRanges("53 0 g9 33 o 0 70 4 7e 18 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a a 8 0 1a 9 7 2 11 d 2 9 6 1 19 0 d 2 1d d 9 3 2 b 2b b 7 0 3 0 4e b 6 9 7 3 1k 1 2 6 3 1 3 2 a 0 b 1 3 6 4 4 1w 8 2 0 3 0 2 3 2 4 2 0 f 1 2b h a 9 5 0 2a j d 9 5y 6 3 8 s 1 2b g g 9 2a c 9 9 7 j 1m e 5 9 6r e 4m 9 1z 5 2 1 3 3 2 0 2 1 d 9 3c 6 3 6 4 0 t 9 15 6 2 3 9 0 a a 1b f 5j 7 3t 9 1i 7 2 7 h 9 1l l 2 d 3f 5 4 0 2 1 2 6 2 0 9 9 1d 4 2 1 2 4 9 9 1j 9 7e 3 a 1 2 0 1d 6 4 4 e a 44m 0 7 e 8uh r 1t3 9 2f 9 13 4 1o 6 q 9 ev 9 d2 0 2 1i 8 3 2a 0 c 1 f58 1 382 9 ef 19 3 m f3 4 4 5 9 7 3 6 v 3 45 2 13e 1d e9 1i 5 1d 9 0 f 0 n 4 2 e 11t 6 2 g 3 6 2 1 2 4 2t 0 4h 6 a 9 9x 0 1q d dv d 6t 1 2 9 6h 0 3 0 8 1 6 0 d7 6 32 6 6 9 3o7 9 gvt3 6n");
}
function isInRange(cp, ranges) {
    let l = 0, r = (ranges.length / 2) | 0, i = 0, min = 0, max = 0;
    while (l < r) {
        i = ((l + r) / 2) | 0;
        min = ranges[2 * i];
        max = ranges[2 * i + 1];
        if (cp < min) {
            r = i;
        }
        else if (cp > max) {
            l = i + 1;
        }
        else {
            return true;
        }
    }
    return false;
}
function restoreRanges(data) {
    let last = 0;
    return data.split(" ").map((s) => (last += parseInt(s, 36) | 0));
}

class DataSet {
    constructor(raw2018, raw2019, raw2020, raw2021, raw2022, raw2023, raw2024, raw2025, raw2026) {
        this._raw2018 = raw2018;
        this._raw2019 = raw2019;
        this._raw2020 = raw2020;
        this._raw2021 = raw2021;
        this._raw2022 = raw2022;
        this._raw2023 = raw2023;
        this._raw2024 = raw2024;
        this._raw2025 = raw2025;
        this._raw2026 = raw2026;
    }
    get es2018() {
        var _a;
        return ((_a = this._set2018) !== null && _a !== void 0 ? _a : (this._set2018 = new Set(this._raw2018.split(" "))));
    }
    get es2019() {
        var _a;
        return ((_a = this._set2019) !== null && _a !== void 0 ? _a : (this._set2019 = new Set(this._raw2019.split(" "))));
    }
    get es2020() {
        var _a;
        return ((_a = this._set2020) !== null && _a !== void 0 ? _a : (this._set2020 = new Set(this._raw2020.split(" "))));
    }
    get es2021() {
        var _a;
        return ((_a = this._set2021) !== null && _a !== void 0 ? _a : (this._set2021 = new Set(this._raw2021.split(" "))));
    }
    get es2022() {
        var _a;
        return ((_a = this._set2022) !== null && _a !== void 0 ? _a : (this._set2022 = new Set(this._raw2022.split(" "))));
    }
    get es2023() {
        var _a;
        return ((_a = this._set2023) !== null && _a !== void 0 ? _a : (this._set2023 = new Set(this._raw2023.split(" "))));
    }
    get es2024() {
        var _a;
        return ((_a = this._set2024) !== null && _a !== void 0 ? _a : (this._set2024 = new Set(this._raw2024.split(" "))));
    }
    get es2025() {
        var _a;
        return ((_a = this._set2025) !== null && _a !== void 0 ? _a : (this._set2025 = new Set(this._raw2025.split(" "))));
    }
    get es2026() {
        var _a;
        return ((_a = this._set2026) !== null && _a !== void 0 ? _a : (this._set2026 = new Set(this._raw2026.split(" "))));
    }
}
const gcNameSet = new Set(["General_Category", "gc"]);
const scNameSet = new Set(["Script", "Script_Extensions", "sc", "scx"]);
const gcValueSets = new DataSet("C Cased_Letter Cc Cf Close_Punctuation Cn Co Combining_Mark Connector_Punctuation Control Cs Currency_Symbol Dash_Punctuation Decimal_Number Enclosing_Mark Final_Punctuation Format Initial_Punctuation L LC Letter Letter_Number Line_Separator Ll Lm Lo Lowercase_Letter Lt Lu M Mark Math_Symbol Mc Me Mn Modifier_Letter Modifier_Symbol N Nd Nl No Nonspacing_Mark Number Open_Punctuation Other Other_Letter Other_Number Other_Punctuation Other_Symbol P Paragraph_Separator Pc Pd Pe Pf Pi Po Private_Use Ps Punctuation S Sc Separator Sk Sm So Space_Separator Spacing_Mark Surrogate Symbol Titlecase_Letter Unassigned Uppercase_Letter Z Zl Zp Zs cntrl digit punct", "", "", "", "", "", "", "", "");
const scValueSets = new DataSet("Adlam Adlm Aghb Ahom Anatolian_Hieroglyphs Arab Arabic Armenian Armi Armn Avestan Avst Bali Balinese Bamu Bamum Bass Bassa_Vah Batak Batk Beng Bengali Bhaiksuki Bhks Bopo Bopomofo Brah Brahmi Brai Braille Bugi Buginese Buhd Buhid Cakm Canadian_Aboriginal Cans Cari Carian Caucasian_Albanian Chakma Cham Cher Cherokee Common Copt Coptic Cprt Cuneiform Cypriot Cyrillic Cyrl Deseret Deva Devanagari Dsrt Dupl Duployan Egyp Egyptian_Hieroglyphs Elba Elbasan Ethi Ethiopic Geor Georgian Glag Glagolitic Gonm Goth Gothic Gran Grantha Greek Grek Gujarati Gujr Gurmukhi Guru Han Hang Hangul Hani Hano Hanunoo Hatr Hatran Hebr Hebrew Hira Hiragana Hluw Hmng Hung Imperial_Aramaic Inherited Inscriptional_Pahlavi Inscriptional_Parthian Ital Java Javanese Kaithi Kali Kana Kannada Katakana Kayah_Li Khar Kharoshthi Khmer Khmr Khoj Khojki Khudawadi Knda Kthi Lana Lao Laoo Latin Latn Lepc Lepcha Limb Limbu Lina Linb Linear_A Linear_B Lisu Lyci Lycian Lydi Lydian Mahajani Mahj Malayalam Mand Mandaic Mani Manichaean Marc Marchen Masaram_Gondi Meetei_Mayek Mend Mende_Kikakui Merc Mero Meroitic_Cursive Meroitic_Hieroglyphs Miao Mlym Modi Mong Mongolian Mro Mroo Mtei Mult Multani Myanmar Mymr Nabataean Narb Nbat New_Tai_Lue Newa Nko Nkoo Nshu Nushu Ogam Ogham Ol_Chiki Olck Old_Hungarian Old_Italic Old_North_Arabian Old_Permic Old_Persian Old_South_Arabian Old_Turkic Oriya Orkh Orya Osage Osge Osma Osmanya Pahawh_Hmong Palm Palmyrene Pau_Cin_Hau Pauc Perm Phag Phags_Pa Phli Phlp Phnx Phoenician Plrd Prti Psalter_Pahlavi Qaac Qaai Rejang Rjng Runic Runr Samaritan Samr Sarb Saur Saurashtra Sgnw Sharada Shavian Shaw Shrd Sidd Siddham SignWriting Sind Sinh Sinhala Sora Sora_Sompeng Soyo Soyombo Sund Sundanese Sylo Syloti_Nagri Syrc Syriac Tagalog Tagb Tagbanwa Tai_Le Tai_Tham Tai_Viet Takr Takri Tale Talu Tamil Taml Tang Tangut Tavt Telu Telugu Tfng Tglg Thaa Thaana Thai Tibetan Tibt Tifinagh Tirh Tirhuta Ugar Ugaritic Vai Vaii Wara Warang_Citi Xpeo Xsux Yi Yiii Zanabazar_Square Zanb Zinh Zyyy", "Dogr Dogra Gong Gunjala_Gondi Hanifi_Rohingya Maka Makasar Medefaidrin Medf Old_Sogdian Rohg Sogd Sogdian Sogo", "Elym Elymaic Hmnp Nand Nandinagari Nyiakeng_Puachue_Hmong Wancho Wcho", "Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi", "Cpmn Cypro_Minoan Old_Uyghur Ougr Tangsa Tnsa Toto Vith Vithkuqi", "Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz", "", "", "");
const binPropertySets = new DataSet("AHex ASCII ASCII_Hex_Digit Alpha Alphabetic Any Assigned Bidi_C Bidi_Control Bidi_M Bidi_Mirrored CI CWCF CWCM CWKCF CWL CWT CWU Case_Ignorable Cased Changes_When_Casefolded Changes_When_Casemapped Changes_When_Lowercased Changes_When_NFKC_Casefolded Changes_When_Titlecased Changes_When_Uppercased DI Dash Default_Ignorable_Code_Point Dep Deprecated Dia Diacritic Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Ext Extender Gr_Base Gr_Ext Grapheme_Base Grapheme_Extend Hex Hex_Digit IDC IDS IDSB IDST IDS_Binary_Operator IDS_Trinary_Operator ID_Continue ID_Start Ideo Ideographic Join_C Join_Control LOE Logical_Order_Exception Lower Lowercase Math NChar Noncharacter_Code_Point Pat_Syn Pat_WS Pattern_Syntax Pattern_White_Space QMark Quotation_Mark RI Radical Regional_Indicator SD STerm Sentence_Terminal Soft_Dotted Term Terminal_Punctuation UIdeo Unified_Ideograph Upper Uppercase VS Variation_Selector White_Space XIDC XIDS XID_Continue XID_Start space", "Extended_Pictographic", "", "EBase EComp EMod EPres ExtPict", "", "", "", "", "");
const binPropertyOfStringsSets = new DataSet("", "", "", "", "", "", "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji RGI_Emoji_Flag_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence", "", "");
function isValidUnicodeProperty(version, name, value) {
    if (gcNameSet.has(name)) {
        return version >= 2018 && gcValueSets.es2018.has(value);
    }
    if (scNameSet.has(name)) {
        return ((version >= 2018 && scValueSets.es2018.has(value)) ||
            (version >= 2019 && scValueSets.es2019.has(value)) ||
            (version >= 2020 && scValueSets.es2020.has(value)) ||
            (version >= 2021 && scValueSets.es2021.has(value)) ||
            (version >= 2022 && scValueSets.es2022.has(value)) ||
            (version >= 2023 && scValueSets.es2023.has(value)));
    }
    return false;
}
function isValidLoneUnicodeProperty(version, value) {
    return ((version >= 2018 && binPropertySets.es2018.has(value)) ||
        (version >= 2019 && binPropertySets.es2019.has(value)) ||
        (version >= 2021 && binPropertySets.es2021.has(value)));
}
function isValidLoneUnicodePropertyOfString(version, value) {
    return version >= 2024 && binPropertyOfStringsSets.es2024.has(value);
}

const BACKSPACE = 0x08;
const CHARACTER_TABULATION = 0x09;
const LINE_FEED = 0x0a;
const LINE_TABULATION = 0x0b;
const FORM_FEED = 0x0c;
const CARRIAGE_RETURN = 0x0d;
const EXCLAMATION_MARK = 0x21;
const NUMBER_SIGN = 0x23;
const DOLLAR_SIGN = 0x24;
const PERCENT_SIGN = 0x25;
const AMPERSAND = 0x26;
const LEFT_PARENTHESIS = 0x28;
const RIGHT_PARENTHESIS = 0x29;
const ASTERISK = 0x2a;
const PLUS_SIGN = 0x2b;
const COMMA = 0x2c;
const HYPHEN_MINUS = 0x2d;
const FULL_STOP = 0x2e;
const SOLIDUS = 0x2f;
const DIGIT_ZERO = 0x30;
const DIGIT_ONE = 0x31;
const DIGIT_SEVEN = 0x37;
const DIGIT_NINE = 0x39;
const COLON = 0x3a;
const SEMICOLON = 0x3b;
const LESS_THAN_SIGN = 0x3c;
const EQUALS_SIGN = 0x3d;
const GREATER_THAN_SIGN = 0x3e;
const QUESTION_MARK = 0x3f;
const COMMERCIAL_AT = 0x40;
const LATIN_CAPITAL_LETTER_A = 0x41;
const LATIN_CAPITAL_LETTER_B = 0x42;
const LATIN_CAPITAL_LETTER_D = 0x44;
const LATIN_CAPITAL_LETTER_F = 0x46;
const LATIN_CAPITAL_LETTER_P = 0x50;
const LATIN_CAPITAL_LETTER_S = 0x53;
const LATIN_CAPITAL_LETTER_W = 0x57;
const LATIN_CAPITAL_LETTER_Z = 0x5a;
const LOW_LINE = 0x5f;
const LATIN_SMALL_LETTER_A = 0x61;
const LATIN_SMALL_LETTER_B = 0x62;
const LATIN_SMALL_LETTER_C = 0x63;
const LATIN_SMALL_LETTER_D = 0x64;
const LATIN_SMALL_LETTER_F = 0x66;
const LATIN_SMALL_LETTER_G = 0x67;
const LATIN_SMALL_LETTER_I = 0x69;
const LATIN_SMALL_LETTER_K = 0x6b;
const LATIN_SMALL_LETTER_M = 0x6d;
const LATIN_SMALL_LETTER_N = 0x6e;
const LATIN_SMALL_LETTER_P = 0x70;
const LATIN_SMALL_LETTER_Q = 0x71;
const LATIN_SMALL_LETTER_R = 0x72;
const LATIN_SMALL_LETTER_S = 0x73;
const LATIN_SMALL_LETTER_T = 0x74;
const LATIN_SMALL_LETTER_U = 0x75;
const LATIN_SMALL_LETTER_V = 0x76;
const LATIN_SMALL_LETTER_W = 0x77;
const LATIN_SMALL_LETTER_X = 0x78;
const LATIN_SMALL_LETTER_Y = 0x79;
const LATIN_SMALL_LETTER_Z = 0x7a;
const LEFT_SQUARE_BRACKET = 0x5b;
const REVERSE_SOLIDUS = 0x5c;
const RIGHT_SQUARE_BRACKET = 0x5d;
const CIRCUMFLEX_ACCENT = 0x5e;
const GRAVE_ACCENT = 0x60;
const LEFT_CURLY_BRACKET = 0x7b;
const VERTICAL_LINE = 0x7c;
const RIGHT_CURLY_BRACKET = 0x7d;
const TILDE = 0x7e;
const ZERO_WIDTH_NON_JOINER = 0x200c;
const ZERO_WIDTH_JOINER = 0x200d;
const LINE_SEPARATOR = 0x2028;
const PARAGRAPH_SEPARATOR = 0x2029;
const MIN_CODE_POINT = 0x00;
const MAX_CODE_POINT = 0x10ffff;
function isLatinLetter(code) {
    return ((code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_Z) ||
        (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_Z));
}
function isDecimalDigit(code) {
    return code >= DIGIT_ZERO && code <= DIGIT_NINE;
}
function isOctalDigit(code) {
    return code >= DIGIT_ZERO && code <= DIGIT_SEVEN;
}
function isHexDigit(code) {
    return ((code >= DIGIT_ZERO && code <= DIGIT_NINE) ||
        (code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_F) ||
        (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_F));
}
function isLineTerminator(code) {
    return (code === LINE_FEED ||
        code === CARRIAGE_RETURN ||
        code === LINE_SEPARATOR ||
        code === PARAGRAPH_SEPARATOR);
}
function isValidUnicode(code) {
    return code >= MIN_CODE_POINT && code <= MAX_CODE_POINT;
}
function digitToInt(code) {
    if (code >= LATIN_SMALL_LETTER_A && code <= LATIN_SMALL_LETTER_F) {
        return code - LATIN_SMALL_LETTER_A + 10;
    }
    if (code >= LATIN_CAPITAL_LETTER_A && code <= LATIN_CAPITAL_LETTER_F) {
        return code - LATIN_CAPITAL_LETTER_A + 10;
    }
    return code - DIGIT_ZERO;
}
function isLeadSurrogate(code) {
    return code >= 0xd800 && code <= 0xdbff;
}
function isTrailSurrogate(code) {
    return code >= 0xdc00 && code <= 0xdfff;
}
function combineSurrogatePair(lead, trail) {
    return (lead - 0xd800) * 0x400 + (trail - 0xdc00) + 0x10000;
}

class GroupSpecifiersAsES2018 {
    constructor() {
        this.groupName = new Set();
    }
    clear() {
        this.groupName.clear();
    }
    isEmpty() {
        return !this.groupName.size;
    }
    hasInPattern(name) {
        return this.groupName.has(name);
    }
    hasInScope(name) {
        return this.hasInPattern(name);
    }
    addToScope(name) {
        this.groupName.add(name);
    }
    enterDisjunction() {
    }
    enterAlternative() {
    }
    leaveDisjunction() {
    }
}
class BranchID {
    constructor(parent, base) {
        this.parent = parent;
        this.base = base !== null && base !== void 0 ? base : this;
    }
    separatedFrom(other) {
        var _a, _b;
        if (this.base === other.base && this !== other) {
            return true;
        }
        if (other.parent && this.separatedFrom(other.parent)) {
            return true;
        }
        return (_b = (_a = this.parent) === null || _a === void 0 ? void 0 : _a.separatedFrom(other)) !== null && _b !== void 0 ? _b : false;
    }
    child() {
        return new BranchID(this, null);
    }
    sibling() {
        return new BranchID(this.parent, this.base);
    }
}
class GroupSpecifiersAsES2025 {
    constructor() {
        this.branchID = new BranchID(null, null);
        this.groupNames = new Map();
    }
    clear() {
        this.branchID = new BranchID(null, null);
        this.groupNames.clear();
    }
    isEmpty() {
        return !this.groupNames.size;
    }
    enterDisjunction() {
        this.branchID = this.branchID.child();
    }
    enterAlternative(index) {
        if (index === 0) {
            return;
        }
        this.branchID = this.branchID.sibling();
    }
    leaveDisjunction() {
        this.branchID = this.branchID.parent;
    }
    hasInPattern(name) {
        return this.groupNames.has(name);
    }
    hasInScope(name) {
        const branches = this.groupNames.get(name);
        if (!branches) {
            return false;
        }
        for (const branch of branches) {
            if (!branch.separatedFrom(this.branchID)) {
                return true;
            }
        }
        return false;
    }
    addToScope(name) {
        const branches = this.groupNames.get(name);
        if (branches) {
            branches.push(this.branchID);
            return;
        }
        this.groupNames.set(name, [this.branchID]);
    }
}

const legacyImpl = {
    at(s, end, i) {
        return i < end ? s.charCodeAt(i) : -1;
    },
    width(c) {
        return 1;
    },
};
const unicodeImpl = {
    at(s, end, i) {
        return i < end ? s.codePointAt(i) : -1;
    },
    width(c) {
        return c > 0xffff ? 2 : 1;
    },
};
class Reader {
    constructor() {
        this._impl = legacyImpl;
        this._s = "";
        this._i = 0;
        this._end = 0;
        this._cp1 = -1;
        this._w1 = 1;
        this._cp2 = -1;
        this._w2 = 1;
        this._cp3 = -1;
        this._w3 = 1;
        this._cp4 = -1;
    }
    get source() {
        return this._s;
    }
    get index() {
        return this._i;
    }
    get currentCodePoint() {
        return this._cp1;
    }
    get nextCodePoint() {
        return this._cp2;
    }
    get nextCodePoint2() {
        return this._cp3;
    }
    get nextCodePoint3() {
        return this._cp4;
    }
    reset(source, start, end, uFlag) {
        this._impl = uFlag ? unicodeImpl : legacyImpl;
        this._s = source;
        this._end = end;
        this.rewind(start);
    }
    rewind(index) {
        const impl = this._impl;
        this._i = index;
        this._cp1 = impl.at(this._s, this._end, index);
        this._w1 = impl.width(this._cp1);
        this._cp2 = impl.at(this._s, this._end, index + this._w1);
        this._w2 = impl.width(this._cp2);
        this._cp3 = impl.at(this._s, this._end, index + this._w1 + this._w2);
        this._w3 = impl.width(this._cp3);
        this._cp4 = impl.at(this._s, this._end, index + this._w1 + this._w2 + this._w3);
    }
    advance() {
        if (this._cp1 !== -1) {
            const impl = this._impl;
            this._i += this._w1;
            this._cp1 = this._cp2;
            this._w1 = this._w2;
            this._cp2 = this._cp3;
            this._w2 = impl.width(this._cp2);
            this._cp3 = this._cp4;
            this._w3 = impl.width(this._cp3);
            this._cp4 = impl.at(this._s, this._end, this._i + this._w1 + this._w2 + this._w3);
        }
    }
    eat(cp) {
        if (this._cp1 === cp) {
            this.advance();
            return true;
        }
        return false;
    }
    eat2(cp1, cp2) {
        if (this._cp1 === cp1 && this._cp2 === cp2) {
            this.advance();
            this.advance();
            return true;
        }
        return false;
    }
    eat3(cp1, cp2, cp3) {
        if (this._cp1 === cp1 && this._cp2 === cp2 && this._cp3 === cp3) {
            this.advance();
            this.advance();
            this.advance();
            return true;
        }
        return false;
    }
}

class RegExpSyntaxError extends SyntaxError {
    constructor(message, index) {
        super(message);
        this.index = index;
    }
}
function newRegExpSyntaxError(srcCtx, flags, index, message) {
    let source = "";
    if (srcCtx.kind === "literal") {
        const literal = srcCtx.source.slice(srcCtx.start, srcCtx.end);
        if (literal) {
            source = `: ${literal}`;
        }
    }
    else if (srcCtx.kind === "pattern") {
        const pattern = srcCtx.source.slice(srcCtx.start, srcCtx.end);
        const flagsText = `${flags.unicode ? "u" : ""}${flags.unicodeSets ? "v" : ""}`;
        source = `: /${pattern}/${flagsText}`;
    }
    return new RegExpSyntaxError(`Invalid regular expression${source}: ${message}`, index);
}

const SYNTAX_CHARACTER = new Set([
    CIRCUMFLEX_ACCENT,
    DOLLAR_SIGN,
    REVERSE_SOLIDUS,
    FULL_STOP,
    ASTERISK,
    PLUS_SIGN,
    QUESTION_MARK,
    LEFT_PARENTHESIS,
    RIGHT_PARENTHESIS,
    LEFT_SQUARE_BRACKET,
    RIGHT_SQUARE_BRACKET,
    LEFT_CURLY_BRACKET,
    RIGHT_CURLY_BRACKET,
    VERTICAL_LINE,
]);
const CLASS_SET_RESERVED_DOUBLE_PUNCTUATOR_CHARACTER = new Set([
    AMPERSAND,
    EXCLAMATION_MARK,
    NUMBER_SIGN,
    DOLLAR_SIGN,
    PERCENT_SIGN,
    ASTERISK,
    PLUS_SIGN,
    COMMA,
    FULL_STOP,
    COLON,
    SEMICOLON,
    LESS_THAN_SIGN,
    EQUALS_SIGN,
    GREATER_THAN_SIGN,
    QUESTION_MARK,
    COMMERCIAL_AT,
    CIRCUMFLEX_ACCENT,
    GRAVE_ACCENT,
    TILDE,
]);
const CLASS_SET_SYNTAX_CHARACTER = new Set([
    LEFT_PARENTHESIS,
    RIGHT_PARENTHESIS,
    LEFT_SQUARE_BRACKET,
    RIGHT_SQUARE_BRACKET,
    LEFT_CURLY_BRACKET,
    RIGHT_CURLY_BRACKET,
    SOLIDUS,
    HYPHEN_MINUS,
    REVERSE_SOLIDUS,
    VERTICAL_LINE,
]);
const CLASS_SET_RESERVED_PUNCTUATOR = new Set([
    AMPERSAND,
    HYPHEN_MINUS,
    EXCLAMATION_MARK,
    NUMBER_SIGN,
    PERCENT_SIGN,
    COMMA,
    COLON,
    SEMICOLON,
    LESS_THAN_SIGN,
    EQUALS_SIGN,
    GREATER_THAN_SIGN,
    COMMERCIAL_AT,
    GRAVE_ACCENT,
    TILDE,
]);
const FLAG_PROP_TO_CODEPOINT = {
    global: LATIN_SMALL_LETTER_G,
    ignoreCase: LATIN_SMALL_LETTER_I,
    multiline: LATIN_SMALL_LETTER_M,
    unicode: LATIN_SMALL_LETTER_U,
    sticky: LATIN_SMALL_LETTER_Y,
    dotAll: LATIN_SMALL_LETTER_S,
    hasIndices: LATIN_SMALL_LETTER_D,
    unicodeSets: LATIN_SMALL_LETTER_V,
};
const FLAG_CODEPOINT_TO_PROP = Object.fromEntries(Object.entries(FLAG_PROP_TO_CODEPOINT).map(([k, v]) => [v, k]));
function isSyntaxCharacter(cp) {
    return SYNTAX_CHARACTER.has(cp);
}
function isClassSetReservedDoublePunctuatorCharacter(cp) {
    return CLASS_SET_RESERVED_DOUBLE_PUNCTUATOR_CHARACTER.has(cp);
}
function isClassSetSyntaxCharacter(cp) {
    return CLASS_SET_SYNTAX_CHARACTER.has(cp);
}
function isClassSetReservedPunctuator(cp) {
    return CLASS_SET_RESERVED_PUNCTUATOR.has(cp);
}
function isIdentifierStartChar(cp) {
    return isIdStart(cp) || cp === DOLLAR_SIGN || cp === LOW_LINE;
}
function isIdentifierPartChar(cp) {
    return (isIdContinue(cp) ||
        cp === DOLLAR_SIGN ||
        cp === ZERO_WIDTH_NON_JOINER ||
        cp === ZERO_WIDTH_JOINER);
}
function isUnicodePropertyNameCharacter(cp) {
    return isLatinLetter(cp) || cp === LOW_LINE;
}
function isUnicodePropertyValueCharacter(cp) {
    return isUnicodePropertyNameCharacter(cp) || isDecimalDigit(cp);
}
function isRegularExpressionModifier(ch) {
    return (ch === LATIN_SMALL_LETTER_I ||
        ch === LATIN_SMALL_LETTER_M ||
        ch === LATIN_SMALL_LETTER_S);
}
class RegExpValidator {
    constructor(options) {
        this._reader = new Reader();
        this._unicodeMode = false;
        this._unicodeSetsMode = false;
        this._nFlag = false;
        this._lastIntValue = 0;
        this._lastRange = {
            min: 0,
            max: Number.POSITIVE_INFINITY,
        };
        this._lastStrValue = "";
        this._lastAssertionIsQuantifiable = false;
        this._numCapturingParens = 0;
        this._backreferenceNames = new Set();
        this._srcCtx = null;
        this._options = options !== null && options !== void 0 ? options : {};
        this._groupSpecifiers =
            this.ecmaVersion >= 2025
                ? new GroupSpecifiersAsES2025()
                : new GroupSpecifiersAsES2018();
    }
    validateLiteral(source, start = 0, end = source.length) {
        this._srcCtx = { source, start, end, kind: "literal" };
        this._unicodeSetsMode = this._unicodeMode = this._nFlag = false;
        this.reset(source, start, end);
        this.onLiteralEnter(start);
        if (this.eat(SOLIDUS) && this.eatRegExpBody() && this.eat(SOLIDUS)) {
            const flagStart = this.index;
            const unicode = source.includes("u", flagStart);
            const unicodeSets = source.includes("v", flagStart);
            this.validateFlagsInternal(source, flagStart, end);
            this.validatePatternInternal(source, start + 1, flagStart - 1, {
                unicode,
                unicodeSets,
            });
        }
        else if (start >= end) {
            this.raise("Empty");
        }
        else {
            const c = String.fromCodePoint(this.currentCodePoint);
            this.raise(`Unexpected character '${c}'`);
        }
        this.onLiteralLeave(start, end);
    }
    validateFlags(source, start = 0, end = source.length) {
        this._srcCtx = { source, start, end, kind: "flags" };
        this.validateFlagsInternal(source, start, end);
    }
    validatePattern(source, start = 0, end = source.length, uFlagOrFlags = undefined) {
        this._srcCtx = { source, start, end, kind: "pattern" };
        this.validatePatternInternal(source, start, end, uFlagOrFlags);
    }
    validatePatternInternal(source, start = 0, end = source.length, uFlagOrFlags = undefined) {
        const mode = this._parseFlagsOptionToMode(uFlagOrFlags, end);
        this._unicodeMode = mode.unicodeMode;
        this._nFlag = mode.nFlag;
        this._unicodeSetsMode = mode.unicodeSetsMode;
        this.reset(source, start, end);
        this.consumePattern();
        if (!this._nFlag &&
            this.ecmaVersion >= 2018 &&
            !this._groupSpecifiers.isEmpty()) {
            this._nFlag = true;
            this.rewind(start);
            this.consumePattern();
        }
    }
    validateFlagsInternal(source, start, end) {
        const flags = this.parseFlags(source, start, end);
        this.onRegExpFlags(start, end, flags);
    }
    _parseFlagsOptionToMode(uFlagOrFlags, sourceEnd) {
        let unicode = false;
        let unicodeSets = false;
        if (uFlagOrFlags && this.ecmaVersion >= 2015) {
            if (typeof uFlagOrFlags === "object") {
                unicode = Boolean(uFlagOrFlags.unicode);
                if (this.ecmaVersion >= 2024) {
                    unicodeSets = Boolean(uFlagOrFlags.unicodeSets);
                }
            }
            else {
                unicode = uFlagOrFlags;
            }
        }
        if (unicode && unicodeSets) {
            this.raise("Invalid regular expression flags", {
                index: sourceEnd + 1,
                unicode,
                unicodeSets,
            });
        }
        const unicodeMode = unicode || unicodeSets;
        const nFlag = (unicode && this.ecmaVersion >= 2018) ||
            unicodeSets ||
            Boolean(this._options.strict && this.ecmaVersion >= 2023);
        const unicodeSetsMode = unicodeSets;
        return { unicodeMode, nFlag, unicodeSetsMode };
    }
    get strict() {
        return Boolean(this._options.strict) || this._unicodeMode;
    }
    get ecmaVersion() {
        var _a;
        return (_a = this._options.ecmaVersion) !== null && _a !== void 0 ? _a : latestEcmaVersion;
    }
    onLiteralEnter(start) {
        if (this._options.onLiteralEnter) {
            this._options.onLiteralEnter(start);
        }
    }
    onLiteralLeave(start, end) {
        if (this._options.onLiteralLeave) {
            this._options.onLiteralLeave(start, end);
        }
    }
    onRegExpFlags(start, end, flags) {
        if (this._options.onRegExpFlags) {
            this._options.onRegExpFlags(start, end, flags);
        }
        if (this._options.onFlags) {
            this._options.onFlags(start, end, flags.global, flags.ignoreCase, flags.multiline, flags.unicode, flags.sticky, flags.dotAll, flags.hasIndices);
        }
    }
    onPatternEnter(start) {
        if (this._options.onPatternEnter) {
            this._options.onPatternEnter(start);
        }
    }
    onPatternLeave(start, end) {
        if (this._options.onPatternLeave) {
            this._options.onPatternLeave(start, end);
        }
    }
    onDisjunctionEnter(start) {
        if (this._options.onDisjunctionEnter) {
            this._options.onDisjunctionEnter(start);
        }
    }
    onDisjunctionLeave(start, end) {
        if (this._options.onDisjunctionLeave) {
            this._options.onDisjunctionLeave(start, end);
        }
    }
    onAlternativeEnter(start, index) {
        if (this._options.onAlternativeEnter) {
            this._options.onAlternativeEnter(start, index);
        }
    }
    onAlternativeLeave(start, end, index) {
        if (this._options.onAlternativeLeave) {
            this._options.onAlternativeLeave(start, end, index);
        }
    }
    onGroupEnter(start) {
        if (this._options.onGroupEnter) {
            this._options.onGroupEnter(start);
        }
    }
    onGroupLeave(start, end) {
        if (this._options.onGroupLeave) {
            this._options.onGroupLeave(start, end);
        }
    }
    onModifiersEnter(start) {
        if (this._options.onModifiersEnter) {
            this._options.onModifiersEnter(start);
        }
    }
    onModifiersLeave(start, end) {
        if (this._options.onModifiersLeave) {
            this._options.onModifiersLeave(start, end);
        }
    }
    onAddModifiers(start, end, flags) {
        if (this._options.onAddModifiers) {
            this._options.onAddModifiers(start, end, flags);
        }
    }
    onRemoveModifiers(start, end, flags) {
        if (this._options.onRemoveModifiers) {
            this._options.onRemoveModifiers(start, end, flags);
        }
    }
    onCapturingGroupEnter(start, name) {
        if (this._options.onCapturingGroupEnter) {
            this._options.onCapturingGroupEnter(start, name);
        }
    }
    onCapturingGroupLeave(start, end, name) {
        if (this._options.onCapturingGroupLeave) {
            this._options.onCapturingGroupLeave(start, end, name);
        }
    }
    onQuantifier(start, end, min, max, greedy) {
        if (this._options.onQuantifier) {
            this._options.onQuantifier(start, end, min, max, greedy);
        }
    }
    onLookaroundAssertionEnter(start, kind, negate) {
        if (this._options.onLookaroundAssertionEnter) {
            this._options.onLookaroundAssertionEnter(start, kind, negate);
        }
    }
    onLookaroundAssertionLeave(start, end, kind, negate) {
        if (this._options.onLookaroundAssertionLeave) {
            this._options.onLookaroundAssertionLeave(start, end, kind, negate);
        }
    }
    onEdgeAssertion(start, end, kind) {
        if (this._options.onEdgeAssertion) {
            this._options.onEdgeAssertion(start, end, kind);
        }
    }
    onWordBoundaryAssertion(start, end, kind, negate) {
        if (this._options.onWordBoundaryAssertion) {
            this._options.onWordBoundaryAssertion(start, end, kind, negate);
        }
    }
    onAnyCharacterSet(start, end, kind) {
        if (this._options.onAnyCharacterSet) {
            this._options.onAnyCharacterSet(start, end, kind);
        }
    }
    onEscapeCharacterSet(start, end, kind, negate) {
        if (this._options.onEscapeCharacterSet) {
            this._options.onEscapeCharacterSet(start, end, kind, negate);
        }
    }
    onUnicodePropertyCharacterSet(start, end, kind, key, value, negate, strings) {
        if (this._options.onUnicodePropertyCharacterSet) {
            this._options.onUnicodePropertyCharacterSet(start, end, kind, key, value, negate, strings);
        }
    }
    onCharacter(start, end, value) {
        if (this._options.onCharacter) {
            this._options.onCharacter(start, end, value);
        }
    }
    onBackreference(start, end, ref) {
        if (this._options.onBackreference) {
            this._options.onBackreference(start, end, ref);
        }
    }
    onCharacterClassEnter(start, negate, unicodeSets) {
        if (this._options.onCharacterClassEnter) {
            this._options.onCharacterClassEnter(start, negate, unicodeSets);
        }
    }
    onCharacterClassLeave(start, end, negate) {
        if (this._options.onCharacterClassLeave) {
            this._options.onCharacterClassLeave(start, end, negate);
        }
    }
    onCharacterClassRange(start, end, min, max) {
        if (this._options.onCharacterClassRange) {
            this._options.onCharacterClassRange(start, end, min, max);
        }
    }
    onClassIntersection(start, end) {
        if (this._options.onClassIntersection) {
            this._options.onClassIntersection(start, end);
        }
    }
    onClassSubtraction(start, end) {
        if (this._options.onClassSubtraction) {
            this._options.onClassSubtraction(start, end);
        }
    }
    onClassStringDisjunctionEnter(start) {
        if (this._options.onClassStringDisjunctionEnter) {
            this._options.onClassStringDisjunctionEnter(start);
        }
    }
    onClassStringDisjunctionLeave(start, end) {
        if (this._options.onClassStringDisjunctionLeave) {
            this._options.onClassStringDisjunctionLeave(start, end);
        }
    }
    onStringAlternativeEnter(start, index) {
        if (this._options.onStringAlternativeEnter) {
            this._options.onStringAlternativeEnter(start, index);
        }
    }
    onStringAlternativeLeave(start, end, index) {
        if (this._options.onStringAlternativeLeave) {
            this._options.onStringAlternativeLeave(start, end, index);
        }
    }
    get index() {
        return this._reader.index;
    }
    get currentCodePoint() {
        return this._reader.currentCodePoint;
    }
    get nextCodePoint() {
        return this._reader.nextCodePoint;
    }
    get nextCodePoint2() {
        return this._reader.nextCodePoint2;
    }
    get nextCodePoint3() {
        return this._reader.nextCodePoint3;
    }
    reset(source, start, end) {
        this._reader.reset(source, start, end, this._unicodeMode);
    }
    rewind(index) {
        this._reader.rewind(index);
    }
    advance() {
        this._reader.advance();
    }
    eat(cp) {
        return this._reader.eat(cp);
    }
    eat2(cp1, cp2) {
        return this._reader.eat2(cp1, cp2);
    }
    eat3(cp1, cp2, cp3) {
        return this._reader.eat3(cp1, cp2, cp3);
    }
    raise(message, context) {
        var _a, _b, _c;
        throw newRegExpSyntaxError(this._srcCtx, {
            unicode: (_a = context === null || context === void 0 ? void 0 : context.unicode) !== null && _a !== void 0 ? _a : (this._unicodeMode && !this._unicodeSetsMode),
            unicodeSets: (_b = context === null || context === void 0 ? void 0 : context.unicodeSets) !== null && _b !== void 0 ? _b : this._unicodeSetsMode,
        }, (_c = context === null || context === void 0 ? void 0 : context.index) !== null && _c !== void 0 ? _c : this.index, message);
    }
    eatRegExpBody() {
        const start = this.index;
        let inClass = false;
        let escaped = false;
        for (;;) {
            const cp = this.currentCodePoint;
            if (cp === -1 || isLineTerminator(cp)) {
                const kind = inClass ? "character class" : "regular expression";
                this.raise(`Unterminated ${kind}`);
            }
            if (escaped) {
                escaped = false;
            }
            else if (cp === REVERSE_SOLIDUS) {
                escaped = true;
            }
            else if (cp === LEFT_SQUARE_BRACKET) {
                inClass = true;
            }
            else if (cp === RIGHT_SQUARE_BRACKET) {
                inClass = false;
            }
            else if ((cp === SOLIDUS && !inClass) ||
                (cp === ASTERISK && this.index === start)) {
                break;
            }
            this.advance();
        }
        return this.index !== start;
    }
    consumePattern() {
        const start = this.index;
        this._numCapturingParens = this.countCapturingParens();
        this._groupSpecifiers.clear();
        this._backreferenceNames.clear();
        this.onPatternEnter(start);
        this.consumeDisjunction();
        const cp = this.currentCodePoint;
        if (this.currentCodePoint !== -1) {
            if (cp === RIGHT_PARENTHESIS) {
                this.raise("Unmatched ')'");
            }
            if (cp === REVERSE_SOLIDUS) {
                this.raise("\\ at end of pattern");
            }
            if (cp === RIGHT_SQUARE_BRACKET || cp === RIGHT_CURLY_BRACKET) {
                this.raise("Lone quantifier brackets");
            }
            const c = String.fromCodePoint(cp);
            this.raise(`Unexpected character '${c}'`);
        }
        for (const name of this._backreferenceNames) {
            if (!this._groupSpecifiers.hasInPattern(name)) {
                this.raise("Invalid named capture referenced");
            }
        }
        this.onPatternLeave(start, this.index);
    }
    countCapturingParens() {
        const start = this.index;
        let inClass = false;
        let escaped = false;
        let count = 0;
        let cp = 0;
        while ((cp = this.currentCodePoint) !== -1) {
            if (escaped) {
                escaped = false;
            }
            else if (cp === REVERSE_SOLIDUS) {
                escaped = true;
            }
            else if (cp === LEFT_SQUARE_BRACKET) {
                inClass = true;
            }
            else if (cp === RIGHT_SQUARE_BRACKET) {
                inClass = false;
            }
            else if (cp === LEFT_PARENTHESIS &&
                !inClass &&
                (this.nextCodePoint !== QUESTION_MARK ||
                    (this.nextCodePoint2 === LESS_THAN_SIGN &&
                        this.nextCodePoint3 !== EQUALS_SIGN &&
                        this.nextCodePoint3 !== EXCLAMATION_MARK))) {
                count += 1;
            }
            this.advance();
        }
        this.rewind(start);
        return count;
    }
    consumeDisjunction() {
        const start = this.index;
        let i = 0;
        this._groupSpecifiers.enterDisjunction();
        this.onDisjunctionEnter(start);
        do {
            this.consumeAlternative(i++);
        } while (this.eat(VERTICAL_LINE));
        if (this.consumeQuantifier(true)) {
            this.raise("Nothing to repeat");
        }
        if (this.eat(LEFT_CURLY_BRACKET)) {
            this.raise("Lone quantifier brackets");
        }
        this.onDisjunctionLeave(start, this.index);
        this._groupSpecifiers.leaveDisjunction();
    }
    consumeAlternative(i) {
        const start = this.index;
        this._groupSpecifiers.enterAlternative(i);
        this.onAlternativeEnter(start, i);
        while (this.currentCodePoint !== -1 && this.consumeTerm()) {
        }
        this.onAlternativeLeave(start, this.index, i);
    }
    consumeTerm() {
        if (this._unicodeMode || this.strict) {
            return (this.consumeAssertion() ||
                (this.consumeAtom() && this.consumeOptionalQuantifier()));
        }
        return ((this.consumeAssertion() &&
            (!this._lastAssertionIsQuantifiable ||
                this.consumeOptionalQuantifier())) ||
            (this.consumeExtendedAtom() && this.consumeOptionalQuantifier()));
    }
    consumeOptionalQuantifier() {
        this.consumeQuantifier();
        return true;
    }
    consumeAssertion() {
        const start = this.index;
        this._lastAssertionIsQuantifiable = false;
        if (this.eat(CIRCUMFLEX_ACCENT)) {
            this.onEdgeAssertion(start, this.index, "start");
            return true;
        }
        if (this.eat(DOLLAR_SIGN)) {
            this.onEdgeAssertion(start, this.index, "end");
            return true;
        }
        if (this.eat2(REVERSE_SOLIDUS, LATIN_CAPITAL_LETTER_B)) {
            this.onWordBoundaryAssertion(start, this.index, "word", true);
            return true;
        }
        if (this.eat2(REVERSE_SOLIDUS, LATIN_SMALL_LETTER_B)) {
            this.onWordBoundaryAssertion(start, this.index, "word", false);
            return true;
        }
        if (this.eat2(LEFT_PARENTHESIS, QUESTION_MARK)) {
            const lookbehind = this.ecmaVersion >= 2018 && this.eat(LESS_THAN_SIGN);
            let negate = false;
            if (this.eat(EQUALS_SIGN) ||
                (negate = this.eat(EXCLAMATION_MARK))) {
                const kind = lookbehind ? "lookbehind" : "lookahead";
                this.onLookaroundAssertionEnter(start, kind, negate);
                this.consumeDisjunction();
                if (!this.eat(RIGHT_PARENTHESIS)) {
                    this.raise("Unterminated group");
                }
                this._lastAssertionIsQuantifiable = !lookbehind && !this.strict;
                this.onLookaroundAssertionLeave(start, this.index, kind, negate);
                return true;
            }
            this.rewind(start);
        }
        return false;
    }
    consumeQuantifier(noConsume = false) {
        const start = this.index;
        let min = 0;
        let max = 0;
        let greedy = false;
        if (this.eat(ASTERISK)) {
            min = 0;
            max = Number.POSITIVE_INFINITY;
        }
        else if (this.eat(PLUS_SIGN)) {
            min = 1;
            max = Number.POSITIVE_INFINITY;
        }
        else if (this.eat(QUESTION_MARK)) {
            min = 0;
            max = 1;
        }
        else if (this.eatBracedQuantifier(noConsume)) {
            ({ min, max } = this._lastRange);
        }
        else {
            return false;
        }
        greedy = !this.eat(QUESTION_MARK);
        if (!noConsume) {
            this.onQuantifier(start, this.index, min, max, greedy);
        }
        return true;
    }
    eatBracedQuantifier(noError) {
        const start = this.index;
        if (this.eat(LEFT_CURLY_BRACKET)) {
            if (this.eatDecimalDigits()) {
                const min = this._lastIntValue;
                let max = min;
                if (this.eat(COMMA)) {
                    max = this.eatDecimalDigits()
                        ? this._lastIntValue
                        : Number.POSITIVE_INFINITY;
                }
                if (this.eat(RIGHT_CURLY_BRACKET)) {
                    if (!noError && max < min) {
                        this.raise("numbers out of order in {} quantifier");
                    }
                    this._lastRange = { min, max };
                    return true;
                }
            }
            if (!noError && (this._unicodeMode || this.strict)) {
                this.raise("Incomplete quantifier");
            }
            this.rewind(start);
        }
        return false;
    }
    consumeAtom() {
        return (this.consumePatternCharacter() ||
            this.consumeDot() ||
            this.consumeReverseSolidusAtomEscape() ||
            Boolean(this.consumeCharacterClass()) ||
            this.consumeCapturingGroup() ||
            this.consumeUncapturingGroup());
    }
    consumeDot() {
        if (this.eat(FULL_STOP)) {
            this.onAnyCharacterSet(this.index - 1, this.index, "any");
            return true;
        }
        return false;
    }
    consumeReverseSolidusAtomEscape() {
        const start = this.index;
        if (this.eat(REVERSE_SOLIDUS)) {
            if (this.consumeAtomEscape()) {
                return true;
            }
            this.rewind(start);
        }
        return false;
    }
    consumeUncapturingGroup() {
        const start = this.index;
        if (this.eat2(LEFT_PARENTHESIS, QUESTION_MARK)) {
            this.onGroupEnter(start);
            if (this.ecmaVersion >= 2025) {
                this.consumeModifiers();
            }
            if (!this.eat(COLON)) {
                this.rewind(start + 1);
                this.raise("Invalid group");
            }
            this.consumeDisjunction();
            if (!this.eat(RIGHT_PARENTHESIS)) {
                this.raise("Unterminated group");
            }
            this.onGroupLeave(start, this.index);
            return true;
        }
        return false;
    }
    consumeModifiers() {
        const start = this.index;
        const hasAddModifiers = this.eatModifiers();
        const addModifiersEnd = this.index;
        const hasHyphen = this.eat(HYPHEN_MINUS);
        if (!hasAddModifiers && !hasHyphen) {
            return false;
        }
        this.onModifiersEnter(start);
        const addModifiers = this.parseModifiers(start, addModifiersEnd);
        this.onAddModifiers(start, addModifiersEnd, addModifiers);
        if (hasHyphen) {
            const modifiersStart = this.index;
            if (!this.eatModifiers() &&
                !hasAddModifiers &&
                this.currentCodePoint === COLON) {
                this.raise("Invalid empty flags");
            }
            const modifiers = this.parseModifiers(modifiersStart, this.index);
            for (const [flagName] of Object.entries(modifiers).filter(([, enable]) => enable)) {
                if (addModifiers[flagName]) {
                    this.raise(`Duplicated flag '${String.fromCodePoint(FLAG_PROP_TO_CODEPOINT[flagName])}'`);
                }
            }
            this.onRemoveModifiers(modifiersStart, this.index, modifiers);
        }
        this.onModifiersLeave(start, this.index);
        return true;
    }
    consumeCapturingGroup() {
        const start = this.index;
        if (this.eat(LEFT_PARENTHESIS)) {
            let name = null;
            if (this.ecmaVersion >= 2018) {
                if (this.consumeGroupSpecifier()) {
                    name = this._lastStrValue;
                }
                else if (this.currentCodePoint === QUESTION_MARK) {
                    this.rewind(start);
                    return false;
                }
            }
            else if (this.currentCodePoint === QUESTION_MARK) {
                this.rewind(start);
                return false;
            }
            this.onCapturingGroupEnter(start, name);
            this.consumeDisjunction();
            if (!this.eat(RIGHT_PARENTHESIS)) {
                this.raise("Unterminated group");
            }
            this.onCapturingGroupLeave(start, this.index, name);
            return true;
        }
        return false;
    }
    consumeExtendedAtom() {
        return (this.consumeDot() ||
            this.consumeReverseSolidusAtomEscape() ||
            this.consumeReverseSolidusFollowedByC() ||
            Boolean(this.consumeCharacterClass()) ||
            this.consumeCapturingGroup() ||
            this.consumeUncapturingGroup() ||
            this.consumeInvalidBracedQuantifier() ||
            this.consumeExtendedPatternCharacter());
    }
    consumeReverseSolidusFollowedByC() {
        const start = this.index;
        if (this.currentCodePoint === REVERSE_SOLIDUS &&
            this.nextCodePoint === LATIN_SMALL_LETTER_C) {
            this._lastIntValue = this.currentCodePoint;
            this.advance();
            this.onCharacter(start, this.index, REVERSE_SOLIDUS);
            return true;
        }
        return false;
    }
    consumeInvalidBracedQuantifier() {
        if (this.eatBracedQuantifier(true)) {
            this.raise("Nothing to repeat");
        }
        return false;
    }
    consumePatternCharacter() {
        const start = this.index;
        const cp = this.currentCodePoint;
        if (cp !== -1 && !isSyntaxCharacter(cp)) {
            this.advance();
            this.onCharacter(start, this.index, cp);
            return true;
        }
        return false;
    }
    consumeExtendedPatternCharacter() {
        const start = this.index;
        const cp = this.currentCodePoint;
        if (cp !== -1 &&
            cp !== CIRCUMFLEX_ACCENT &&
            cp !== DOLLAR_SIGN &&
            cp !== REVERSE_SOLIDUS &&
            cp !== FULL_STOP &&
            cp !== ASTERISK &&
            cp !== PLUS_SIGN &&
            cp !== QUESTION_MARK &&
            cp !== LEFT_PARENTHESIS &&
            cp !== RIGHT_PARENTHESIS &&
            cp !== LEFT_SQUARE_BRACKET &&
            cp !== VERTICAL_LINE) {
            this.advance();
            this.onCharacter(start, this.index, cp);
            return true;
        }
        return false;
    }
    consumeGroupSpecifier() {
        const start = this.index;
        if (this.eat(QUESTION_MARK)) {
            if (this.eatGroupName()) {
                if (!this._groupSpecifiers.hasInScope(this._lastStrValue)) {
                    this._groupSpecifiers.addToScope(this._lastStrValue);
                    return true;
                }
                this.raise("Duplicate capture group name");
            }
            this.rewind(start);
        }
        return false;
    }
    consumeAtomEscape() {
        if (this.consumeBackreference() ||
            this.consumeCharacterClassEscape() ||
            this.consumeCharacterEscape() ||
            (this._nFlag && this.consumeKGroupName())) {
            return true;
        }
        if (this.strict || this._unicodeMode) {
            this.raise("Invalid escape");
        }
        return false;
    }
    consumeBackreference() {
        const start = this.index;
        if (this.eatDecimalEscape()) {
            const n = this._lastIntValue;
            if (n <= this._numCapturingParens) {
                this.onBackreference(start - 1, this.index, n);
                return true;
            }
            if (this.strict || this._unicodeMode) {
                this.raise("Invalid escape");
            }
            this.rewind(start);
        }
        return false;
    }
    consumeCharacterClassEscape() {
        var _a;
        const start = this.index;
        if (this.eat(LATIN_SMALL_LETTER_D)) {
            this._lastIntValue = -1;
            this.onEscapeCharacterSet(start - 1, this.index, "digit", false);
            return {};
        }
        if (this.eat(LATIN_CAPITAL_LETTER_D)) {
            this._lastIntValue = -1;
            this.onEscapeCharacterSet(start - 1, this.index, "digit", true);
            return {};
        }
        if (this.eat(LATIN_SMALL_LETTER_S)) {
            this._lastIntValue = -1;
            this.onEscapeCharacterSet(start - 1, this.index, "space", false);
            return {};
        }
        if (this.eat(LATIN_CAPITAL_LETTER_S)) {
            this._lastIntValue = -1;
            this.onEscapeCharacterSet(start - 1, this.index, "space", true);
            return {};
        }
        if (this.eat(LATIN_SMALL_LETTER_W)) {
            this._lastIntValue = -1;
            this.onEscapeCharacterSet(start - 1, this.index, "word", false);
            return {};
        }
        if (this.eat(LATIN_CAPITAL_LETTER_W)) {
            this._lastIntValue = -1;
            this.onEscapeCharacterSet(start - 1, this.index, "word", true);
            return {};
        }
        let negate = false;
        if (this._unicodeMode &&
            this.ecmaVersion >= 2018 &&
            (this.eat(LATIN_SMALL_LETTER_P) ||
                (negate = this.eat(LATIN_CAPITAL_LETTER_P)))) {
            this._lastIntValue = -1;
            let result = null;
            if (this.eat(LEFT_CURLY_BRACKET) &&
                (result = this.eatUnicodePropertyValueExpression()) &&
                this.eat(RIGHT_CURLY_BRACKET)) {
                if (negate && result.strings) {
                    this.raise("Invalid property name");
                }
                this.onUnicodePropertyCharacterSet(start - 1, this.index, "property", result.key, result.value, negate, (_a = result.strings) !== null && _a !== void 0 ? _a : false);
                return { mayContainStrings: result.strings };
            }
            this.raise("Invalid property name");
        }
        return null;
    }
    consumeCharacterEscape() {
        const start = this.index;
        if (this.eatControlEscape() ||
            this.eatCControlLetter() ||
            this.eatZero() ||
            this.eatHexEscapeSequence() ||
            this.eatRegExpUnicodeEscapeSequence() ||
            (!this.strict &&
                !this._unicodeMode &&
                this.eatLegacyOctalEscapeSequence()) ||
            this.eatIdentityEscape()) {
            this.onCharacter(start - 1, this.index, this._lastIntValue);
            return true;
        }
        return false;
    }
    consumeKGroupName() {
        const start = this.index;
        if (this.eat(LATIN_SMALL_LETTER_K)) {
            if (this.eatGroupName()) {
                const groupName = this._lastStrValue;
                this._backreferenceNames.add(groupName);
                this.onBackreference(start - 1, this.index, groupName);
                return true;
            }
            this.raise("Invalid named reference");
        }
        return false;
    }
    consumeCharacterClass() {
        const start = this.index;
        if (this.eat(LEFT_SQUARE_BRACKET)) {
            const negate = this.eat(CIRCUMFLEX_ACCENT);
            this.onCharacterClassEnter(start, negate, this._unicodeSetsMode);
            const result = this.consumeClassContents();
            if (!this.eat(RIGHT_SQUARE_BRACKET)) {
                if (this.currentCodePoint === -1) {
                    this.raise("Unterminated character class");
                }
                this.raise("Invalid character in character class");
            }
            if (negate && result.mayContainStrings) {
                this.raise("Negated character class may contain strings");
            }
            this.onCharacterClassLeave(start, this.index, negate);
            return result;
        }
        return null;
    }
    consumeClassContents() {
        if (this._unicodeSetsMode) {
            if (this.currentCodePoint === RIGHT_SQUARE_BRACKET) {
                return {};
            }
            const result = this.consumeClassSetExpression();
            return result;
        }
        const strict = this.strict || this._unicodeMode;
        for (;;) {
            const rangeStart = this.index;
            if (!this.consumeClassAtom()) {
                break;
            }
            const min = this._lastIntValue;
            if (!this.eat(HYPHEN_MINUS)) {
                continue;
            }
            this.onCharacter(this.index - 1, this.index, HYPHEN_MINUS);
            if (!this.consumeClassAtom()) {
                break;
            }
            const max = this._lastIntValue;
            if (min === -1 || max === -1) {
                if (strict) {
                    this.raise("Invalid character class");
                }
                continue;
            }
            if (min > max) {
                this.raise("Range out of order in character class");
            }
            this.onCharacterClassRange(rangeStart, this.index, min, max);
        }
        return {};
    }
    consumeClassAtom() {
        const start = this.index;
        const cp = this.currentCodePoint;
        if (cp !== -1 &&
            cp !== REVERSE_SOLIDUS &&
            cp !== RIGHT_SQUARE_BRACKET) {
            this.advance();
            this._lastIntValue = cp;
            this.onCharacter(start, this.index, this._lastIntValue);
            return true;
        }
        if (this.eat(REVERSE_SOLIDUS)) {
            if (this.consumeClassEscape()) {
                return true;
            }
            if (!this.strict &&
                this.currentCodePoint === LATIN_SMALL_LETTER_C) {
                this._lastIntValue = REVERSE_SOLIDUS;
                this.onCharacter(start, this.index, this._lastIntValue);
                return true;
            }
            if (this.strict || this._unicodeMode) {
                this.raise("Invalid escape");
            }
            this.rewind(start);
        }
        return false;
    }
    consumeClassEscape() {
        const start = this.index;
        if (this.eat(LATIN_SMALL_LETTER_B)) {
            this._lastIntValue = BACKSPACE;
            this.onCharacter(start - 1, this.index, this._lastIntValue);
            return true;
        }
        if (this._unicodeMode && this.eat(HYPHEN_MINUS)) {
            this._lastIntValue = HYPHEN_MINUS;
            this.onCharacter(start - 1, this.index, this._lastIntValue);
            return true;
        }
        let cp = 0;
        if (!this.strict &&
            !this._unicodeMode &&
            this.currentCodePoint === LATIN_SMALL_LETTER_C &&
            (isDecimalDigit((cp = this.nextCodePoint)) || cp === LOW_LINE)) {
            this.advance();
            this.advance();
            this._lastIntValue = cp % 0x20;
            this.onCharacter(start - 1, this.index, this._lastIntValue);
            return true;
        }
        return (Boolean(this.consumeCharacterClassEscape()) ||
            this.consumeCharacterEscape());
    }
    consumeClassSetExpression() {
        const start = this.index;
        let mayContainStrings = false;
        let result = null;
        if (this.consumeClassSetCharacter()) {
            if (this.consumeClassSetRangeFromOperator(start)) {
                this.consumeClassUnionRight({});
                return {};
            }
            mayContainStrings = false;
        }
        else if ((result = this.consumeClassSetOperand())) {
            mayContainStrings = result.mayContainStrings;
        }
        else {
            const cp = this.currentCodePoint;
            if (cp === REVERSE_SOLIDUS) {
                this.advance();
                this.raise("Invalid escape");
            }
            if (cp === this.nextCodePoint &&
                isClassSetReservedDoublePunctuatorCharacter(cp)) {
                this.raise("Invalid set operation in character class");
            }
            this.raise("Invalid character in character class");
        }
        if (this.eat2(AMPERSAND, AMPERSAND)) {
            while (this.currentCodePoint !== AMPERSAND &&
                (result = this.consumeClassSetOperand())) {
                this.onClassIntersection(start, this.index);
                if (!result.mayContainStrings) {
                    mayContainStrings = false;
                }
                if (this.eat2(AMPERSAND, AMPERSAND)) {
                    continue;
                }
                return { mayContainStrings };
            }
            this.raise("Invalid character in character class");
        }
        if (this.eat2(HYPHEN_MINUS, HYPHEN_MINUS)) {
            while (this.consumeClassSetOperand()) {
                this.onClassSubtraction(start, this.index);
                if (this.eat2(HYPHEN_MINUS, HYPHEN_MINUS)) {
                    continue;
                }
                return { mayContainStrings };
            }
            this.raise("Invalid character in character class");
        }
        return this.consumeClassUnionRight({ mayContainStrings });
    }
    consumeClassUnionRight(leftResult) {
        let mayContainStrings = leftResult.mayContainStrings;
        for (;;) {
            const start = this.index;
            if (this.consumeClassSetCharacter()) {
                this.consumeClassSetRangeFromOperator(start);
                continue;
            }
            const result = this.consumeClassSetOperand();
            if (result) {
                if (result.mayContainStrings) {
                    mayContainStrings = true;
                }
                continue;
            }
            break;
        }
        return { mayContainStrings };
    }
    consumeClassSetRangeFromOperator(start) {
        const currentStart = this.index;
        const min = this._lastIntValue;
        if (this.eat(HYPHEN_MINUS)) {
            if (this.consumeClassSetCharacter()) {
                const max = this._lastIntValue;
                if (min === -1 || max === -1) {
                    this.raise("Invalid character class");
                }
                if (min > max) {
                    this.raise("Range out of order in character class");
                }
                this.onCharacterClassRange(start, this.index, min, max);
                return true;
            }
            this.rewind(currentStart);
        }
        return false;
    }
    consumeClassSetOperand() {
        let result = null;
        if ((result = this.consumeNestedClass())) {
            return result;
        }
        if ((result = this.consumeClassStringDisjunction())) {
            return result;
        }
        if (this.consumeClassSetCharacter()) {
            return {};
        }
        return null;
    }
    consumeNestedClass() {
        const start = this.index;
        if (this.eat(LEFT_SQUARE_BRACKET)) {
            const negate = this.eat(CIRCUMFLEX_ACCENT);
            this.onCharacterClassEnter(start, negate, true);
            const result = this.consumeClassContents();
            if (!this.eat(RIGHT_SQUARE_BRACKET)) {
                this.raise("Unterminated character class");
            }
            if (negate && result.mayContainStrings) {
                this.raise("Negated character class may contain strings");
            }
            this.onCharacterClassLeave(start, this.index, negate);
            return result;
        }
        if (this.eat(REVERSE_SOLIDUS)) {
            const result = this.consumeCharacterClassEscape();
            if (result) {
                return result;
            }
            this.rewind(start);
        }
        return null;
    }
    consumeClassStringDisjunction() {
        const start = this.index;
        if (this.eat3(REVERSE_SOLIDUS, LATIN_SMALL_LETTER_Q, LEFT_CURLY_BRACKET)) {
            this.onClassStringDisjunctionEnter(start);
            let i = 0;
            let mayContaincTStrings = false;
            do {
                if (this.consumeClassString(i++).mayContainStrings) {
                    mayContainStrings = true;
                }
            } while (this.eat(VERTICAL_LINE));
            if (this.eat(RIGHT_CURLY_BRACKET)) {
                this.onClassStringDisjunctionLeave(start, this.index);
                return { mayContainStrings };
            }
            this.raise("Unterminated class string disjunction");
        }
        return null;
    }
    consumeClassString(i) {
        const start = this.index;
        let count = 0;
        this.onStringAlternativeEnter(start, i);
        while (this.currentCodePoint !== -1 &&
            this.consumeClassSetCharacter()) {
            count++;
        }
        this.onStringAlternativeLeave(start, this.index, i);
        return { mayContainStrings: count !== 1 };
    }
    consumeClassSetCharacter() {
        const start = this.index;
        const cp = this.currentCodePoint;
        if (cp !== this.nextCodePoint ||
            !isClassSetReservedDoublePunctuatorCharacter(cp)) {
            if (cp !== -1 && !isClassSetSyntaxCharacter(cp)) {
                this._lastIntValue = cp;
                this.advance();
                this.onCharacter(start, this.index, this._lastIntValue);
                return true;
            }
        }
        if (this.eat(REVERSE_SOLIDUS)) {
            if (this.consumeCharacterEscape()) {
                return true;
            }
            if (isClassSetReservedPunctuator(this.currentCodePoint)) {
                this._lastIntValue = this.currentCodePoint;
                this.advance();
                this.onCharacter(start, this.index, this._lastIntValue);
                return true;
            }
            if (this.eat(LATIN_SMALL_LETTER_B)) {
                this._lastIntValue = BACKSPACE;
                this.onCharacter(start, this.index, this._lastIntValue);
                return true;
            }
            this.rewind(start);
        }
        return false;
    }
    eatGroupName() {
        if (this.eat(LESS_THAN_SIGN)) {
            if (this.eatRegExpIdentifierName() && this.eat(GREATER_THAN_SIGN)) {
                return true;
            }
            this.raise("Invalid capture group name");
        }
        return false;
    }
    eatRegExpIdentifierName() {
        if (this.eatRegExpIdentifierStart()) {
            this._lastStrValue = String.fromCodePoint(this._lastIntValue);
            while (this.eatRegExpIdentifierPart()) {
                this._lastStrValue += String.fromCodePoint(this._lastIntValue);
            }
            return true;
        }
        return false;
    }
    eatRegExpIdentifierStart() {
        const start = this.index;
        const forceUFlag = !this._unicodeMode && this.ecmaVersion >= 2020;
        let cp = this.currentCodePoint;
        this.advance();
        if (cp === REVERSE_SOLIDUS &&
            this.eatRegExpUnicodeEscapeSequence(forceUFlag)) {
            cp = this._lastIntValue;
        }
        else if (forceUFlag &&
            isLeadSurrogate(cp) &&
            isTrailSurrogate(this.currentCodePoint)) {
            cp = combineSurrogatePair(cp, this.currentCodePoint);
            this.advance();
        }
        if (isIdentifierStartChar(cp)) {
            this._lastIntValue = cp;
            return true;
        }
        if (this.index !== start) {
            this.rewind(start);
        }
        return false;
    }
    eatRegExpIdentifierPart() {
        const start = this.index;
        const forceUFlag = !this._unicodeMode && this.ecmaVersion >= 2020;
        let cp = this.currentCodePoint;
        this.advance();
        if (cp === REVERSE_SOLIDUS &&
            this.eatRegExpUnicodeEscapeSequence(forceUFlag)) {
            cp = this._lastIntValue;
        }
        else if (forceUFlag &&
            isLeadSurrogate(cp) &&
            isTrailSurrogate(this.currentCodePoint)) {
            cp = combineSurrogatePair(cp, this.currentCodePoint);
            this.advance();
        }
        if (isIdentifierPartChar(cp)) {
            this._lastIntValue = cp;
            return true;
        }
        if (this.index !== start) {
            this.rewind(start);
        }
        return false;
    }
    eatCControlLetter() {
        const start = this.index;
        if (this.eat(LATIN_SMALL_LETTER_C)) {
            if (this.eatControlLetter()) {
                return true;
            }
            this.rewind(start);
        }
        return false;
    }
    eatZero() {
        if (this.currentCodePoint === DIGIT_ZERO &&
            !isDecimalDigit(this.nextCodePoint)) {
            this._lastIntValue = 0;
            this.advance();
            return true;
        }
        return false;
    }
    eatControlEscape() {
        if (this.eat(LATIN_SMALL_LETTER_F)) {
            this._lastIntValue = FORM_FEED;
            return true;
        }
        if (this.eat(LATIN_SMALL_LETTER_N)) {
            this._lastIntValue = LINE_FEED;
            return true;
        }
        if (this.eat(LATIN_SMALL_LETTER_R)) {
            this._lastIntValue = CARRIAGE_RETURN;
            return true;
        }
        if (this.eat(LATIN_SMALL_LETTER_T)) {
            this._lastIntValue = CHARACTER_TABULATION;
            return true;
        }
        if (this.eat(LATIN_SMALL_LETTER_V)) {
            this._lastIntValue = LINE_TABULATION;
            return true;
        }
        return false;
    }
    eatControlLetter() {
        const cp = this.currentCodePoint;
        if (isLatinLetter(cp)) {
            this.advance();
            this._lastIntValue = cp % 0x20;
            return true;
        }
        return false;
    }
    eatRegExpUnicodeEscapeSequence(forceUFlag = false) {
        const start = this.index;
        const uFlag = forceUFlag || this._unicodeMode;
        if (this.eat(LATIN_SMALL_LETTER_U)) {
            if ((uFlag && this.eatRegExpUnicodeSurrogatePairEscape()) ||
                this.eatFixedHexDigits(4) ||
                (uFlag && this.eatRegExpUnicodeCodePointEscape())) {
                return true;
            }
            if (this.strict || uFlag) {
                this.raise("Invalid unicode escape");
            }
            this.rewind(start);
        }
        return false;
    }
    eatRegExpUnicodeSurrogatePairEscape() {
        const start = this.index;
        if (this.eatFixedHexDigits(4)) {
            const lead = this._lastIntValue;
            if (isLeadSurrogate(lead) &&
                this.eat(REVERSE_SOLIDUS) &&
                this.eat(LATIN_SMALL_LETTER_U) &&
                this.eatFixedHexDigits(4)) {
                const trail = this._lastIntValue;
                if (isTrailSurrogate(trail)) {
                    this._lastIntValue = combineSurrogatePair(lead, trail);
                    return true;
                }
            }
            this.rewind(start);
        }
        return false;
    }
    eatRegExpUnicodeCodePointEscape() {
        const start = this.index;
        if (this.eat(LEFT_CURLY_BRACKET) &&
            this.eatHexDigits() &&
            this.eat(RIGHT_CURLY_BRACKET) &&
            isValidUnicode(this._lastIntValue)) {
            return true;
        }
        this.rewind(start);
        return false;
    }
    eatIdentityEscape() {
        const cp = this.currentCodePoint;
        if (this.isValidIdentityEscape(cp)) {
            this._lastIntValue = cp;
            this.advance();
            return true;
        }
        return false;
    }
    isValidIdentityEscape(cp) {
        if (cp === -1) {
            return false;
        }
        if (this._unicodeMode) {
            return isSyntaxCharacter(cp) || cp === SOLIDUS;
        }
        if (this.strict) {
            return !isIdContinue(cp);
        }
        if (this._nFlag) {
            return !(cp === LATIN_SMALL_LETTER_C || cp === LATIN_SMALL_LETTER_K);
        }
        return cp !== LATIN_SMALL_LETTER_C;
    }
    eatDecimalEscape() {
        this._lastIntValue = 0;
        let cp = this.currentCodePoint;
        if (cp >= DIGIT_ONE && cp <= DIGIT_NINE) {
            do {
                this._lastIntValue = 10 * this._lastIntValue + (cp - DIGIT_ZERO);
                this.advance();
            } while ((cp = this.currentCodePoint) >= DIGIT_ZERO &&
                cp <= DIGIT_NINE);
            return true;
        }
        return false;
    }
    eatUnicodePropertyValueExpression() {
        const start = this.index;
        if (this.eatUnicodePropertyName() && this.eat(EQUALS_SIGN)) {
            const key = this._lastStrValue;
            if (this.eatUnicodePropertyValue()) {
                const value = this._lastStrValue;
                if (isValidUnicodeProperty(this.ecmaVersion, key, value)) {
                    return {
                        key,
                        value: value || null,
                    };
                }
                this.raise("Invalid property name");
            }
        }
        this.rewind(start);
        if (this.eatLoneUnicodePropertyNameOrValue()) {
            const nameOrValue = this._lastStrValue;
            if (isValidUnicodeProperty(this.ecmaVersion, "General_Category", nameOrValue)) {
                return {
                    key: "General_Category",
                    value: nameOrValue || null,
                };
            }
            if (isValidLoneUnicodeProperty(this.ecmaVersion, nameOrValue)) {
                return {
                    key: nameOrValue,
                    value: null,
                };
            }
            if (this._unicodeSetsMode &&
                isValidLoneUnicodePropertyOfString(this.ecmaVersion, nameOrValue)) {
                return {
                    key: nameOrValue,
                    value: null,
                    strings: true,
                };
            }
            this.raise("Invalid property name");
        }
        return null;
    }
    eatUnicodePropertyName() {
        this._lastStrValue = "";
        while (isUnicodePropertyNameCharacter(this.currentCodePoint)) {
            this._lastStrValue += String.fromCodePoint(this.currentCodePoint);
            this.advance();
        }
        return this._lastStrValue !== "";
    }
    eatUnicodePropertyValue() {
        this._lastStrValue = "";
        while (isUnicodePropertyValueCharacter(this.currentCodePoint)) {
            this._lastStrValue += String.fromCodePoint(this.currentCodePoint);
            this.advance();
        }
        return this._lastStrValue !== "";
    }
    eatLoneUnicodePropertyNameOrValue() {
        return this.eatUnicodePropertyValue();
    }
    eatHexEscapeSequence() {
        const start = this.index;
        if (this.eat(LATIN_SMALL_LETTER_X)) {
            if (this.eatFixedHexDigits(2)) {
                return true;
            }
            if (this._unicodeMode || this.strict) {
                this.raise("Invalid escape");
            }
            this.rewind(start);
        }
        return false;
    }
    eatDecimalDigits() {
        const start = this.index;
        this._lastIntValue = 0;
        while (isDecimalDigit(this.currentCodePoint)) {
            this._lastIntValue =
                10 * this._lastIntValue + digitToInt(this.currentCodePoint);
            this.advance();
        }
        return this.index !== start;
    }
    eatHexDigits() {
        const start = this.index;
        this._lastIntValue = 0;
        while (isHexDigit(this.currentCodePoint)) {
            this._lastIntValue =
                16 * this._lastIntValue + digitToInt(this.currentCodePoint);
            this.advance();
        }
        return this.index !== start;
    }
    eatLegacyOctalEscapeSequence() {
        if (this.eatOctalDigit()) {
            const n1 = this._lastIntValue;
            if (this.eatOctalDigit()) {
                const n2 = this._lastIntValue;
                if (n1 <= 3 && this.eatOctalDigit()) {
                    this._lastIntValue = n1 * 64 + n2 * 8 + this._lastIntValue;
                }
                else {
                    this._lastIntValue = n1 * 8 + n2;
                }
            }
            else {
                this._lastIntValue = n1;
            }
            return true;
        }
        return false;
    }
    eatOctalDigit() {
        const cp = this.currentCodePoint;
        if (isOctalDigit(cp)) {
            this.advance();
            this._lastIntValue = cp - DIGIT_ZERO;
            return true;
        }
        this._lastIntValue = 0;
        return false;
    }
    eatFixedHexDigits(length) {
        const start = this.index;
        this._lastIntValue = 0;
        for (let i = 0; i < length; ++i) {
            const cp = this.currentCodePoint;
            if (!isHexDigit(cp)) {
                this.rewind(start);
                return false;
            }
            this._lastIntValue = 16 * this._lastIntValue + digitToInt(cp);
            this.advance();
        }
        return true;
    }
    eatModifiers() {
        let ate = false;
        while (isRegularExpressionModifier(this.currentCodePoint)) {
            this.advance();
            ate = true;
        }
        return ate;
    }
    parseModifiers(start, end) {
        const { ignoreCase, multiline, dotAll } = this.parseFlags(this._reader.source, start, end);
        return { ignoreCase, multiline, dotAll };
    }
    parseFlags(source, start, end) {
        const flags = {
            global: false,
            ignoreCase: false,
            multiline: false,
            unicode: false,
            sticky: false,
            dotAll: false,
            hasIndices: false,
            unicodeSets: false,
        };
        const validFlags = new Set();
        validFlags.add(LATIN_SMALL_LETTER_G);
        validFlags.add(LATIN_SMALL_LETTER_I);
        validFlags.add(LATIN_SMALL_LETTER_M);
        if (this.ecmaVersion >= 2015) {
            validFlags.add(LATIN_SMALL_LETTER_U);
            validFlags.add(LATIN_SMALL_LETTER_Y);
            if (this.ecmaVersion >= 2018) {
                validFlags.add(LATIN_SMALL_LETTER_S);
                if (this.ecmaVersion >= 2022) {
                    validFlags.add(LATIN_SMALL_LETTER_D);
                    if (this.ecmaVersion >= 2024) {
                        validFlags.add(LATIN_SMALL_LETTER_V);
                    }
                }
            }
        }
        for (let i = start; i < end; ++i) {
            const flag = source.charCodeAt(i);
            if (validFlags.has(flag)) {
                const prop = FLAG_CODEPOINT_TO_PROP[flag];
                if (flags[prop]) {
                    this.raise(`Duplicated flag '${source[i]}'`, {
                        index: start,
                    });
                }
                flags[prop] = true;
            }
            else {
                this.raise(`Invalid flag '${source[i]}'`, { index: start });
            }
        }
        return flags;
    }
}

const DUMMY_PATTERN = {};
const DUMMY_FLAGS = {};
const DUMMY_CAPTURING_GROUP = {};
function isClassSetOperand(node) {
    return (node.type === "Character" ||
        node.type === "CharacterSet" ||
        node.type === "CharacterClass" ||
        node.type === "ExpressionCharacterClass" ||
        node.type === "ClassStringDisjunction");
}
class RegExpParserState {
    constructor(options) {
        var _a;
        this._node = DUMMY_PATTERN;
        this._expressionBufferMap = new Map();
        this._flags = DUMMY_FLAGS;
        this._backreferences = [];
        this._capturingGroups = [];
        this.source = "";
        this.strict = Boolean(options === null || options === void 0 ? void 0 : options.strict);
        this.ecmaVersion = (_a = options === null || options === void 0 ? void 0 : options.ecmaVersion) !== null && _a !== void 0 ? _a : latestEcmaVersion;
    }
    get pattern() {
        if (this._node.type !== "Pattern") {
            throw new Error("UnknownError");
        }
        return this._node;
    }
    get flags() {
        if (this._flags.type !== "Flags") {
            throw new Error("UnknownError");
        }
        return this._flags;
    }
    onRegExpFlags(start, end, { global, ignoreCase, multiline, unicode, sticky, dotAll, hasIndices, unicodeSets, }) {
        this._flags = {
            type: "Flags",
            parent: null,
            start,
            end,
            raw: this.source.slice(start, end),
            global,
            ignoreCase,
            multiline,
            unicode,
            sticky,
            dotAll,
            hasIndices,
            unicodeSets,
        };
    }
    onPatternEnter(start) {
        this._node = {
            type: "Pattern",
            parent: null,
            start,
            end: start,
            raw: "",
            alternatives: [],
        };
        this._backreferences.length = 0;
        this._capturingGroups.length = 0;
    }
    onPatternLeave(start, end) {
        this._node.end = end;
        this._node.raw = this.source.slice(start, end);
        for (const reference of this._backreferences) {
            const ref = reference.ref;
            const groups = typeof ref === "number"
                ? [this._capturingGroups[ref - 1]]
                : this._capturingGroups.filter((g) => g.name === ref);
            if (groups.length === 1) {
                const group = groups[0];
                reference.ambiguous = false;
                reference.resolved = group;
            }
            else {
                reference.ambiguous = true;
                reference.resolved = groups;
            }
            for (const group of groups) {
                group.references.push(reference);
            }
        }
    }
    onAlternativeEnter(start) {
        const parent = this._node;
        if (parent.type !== "Assertion" &&
            parent.type !== "CapturingGroup" &&
            parent.type !== "Group" &&
            parent.type !== "Pattern") {
            throw new Error("UnknownError");
        }
        this._node = {
            type: "Alternative",
            parent,
            start,
            end: start,
            raw: "",
            elements: [],
        };
        parent.alternatives.push(this._node);
    }
    onAlternativeLeave(start, end) {
        const node = this._node;
        if (node.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        node.end = end;
        node.raw = this.source.slice(start, end);
        this._node = node.parent;
    }
    onGroupEnter(start) {
        const parent = this._node;
        if (parent.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        const group = {
            type: "Group",
            parent,
            start,
            end: start,
            raw: "",
            modifiers: null,
            alternatives: [],
        };
        this._node = group;
        parent.elements.push(this._node);
    }
    onGroupLeave(start, end) {
        const node = this._node;
        if (node.type !== "Group" || node.parent.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        node.end = end;
        node.raw = this.source.slice(start, end);
        this._node = node.parent;
    }
    onModifiersEnter(start) {
        const parent = this._node;
        if (parent.type !== "Group") {
            throw new Error("UnknownError");
        }
        this._node = {
            type: "Modifiers",
            parent,
            start,
            end: start,
            raw: "",
            add: null,
            remove: null,
        };
        parent.modifiers = this._node;
    }
    onModifiersLeave(start, end) {
        const node = this._node;
        if (node.type !== "Modifiers" || node.parent.type !== "Group") {
            throw new Error("UnknownError");
        }
        node.end = end;
        node.raw = this.source.slice(start, end);
        this._node = node.parent;
    }
    onAddModifiers(start, end, { ignoreCase, multiline, dotAll, }) {
        const parent = this._node;
        if (parent.type !== "Modifiers") {
            throw new Error("UnknownError");
        }
        parent.add = {
            type: "ModifierFlags",
            parent,
            start,
            end,
            raw: this.source.slice(start, end),
            ignoreCase,
            multiline,
            dotAll,
        };
    }
    onRemoveModifiers(start, end, { ignoreCase, multiline, dotAll, }) {
        const parent = this._node;
        if (parent.type !== "Modifiers") {
            throw new Error("UnknownError");
        }
        parent.remove = {
            type: "ModifierFlags",
            parent,
            start,
            end,
            raw: this.source.slice(start, end),
            ignoreCase,
            multiline,
            dotAll,
        };
    }
    onCapturingGroupEnter(start, name) {
        const parent = this._node;
        if (parent.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        this._node = {
            type: "CapturingGroup",
            parent,
            start,
            end: start,
            raw: "",
            name,
            alternatives: [],
            references: [],
        };
        parent.elements.push(this._node);
        this._capturingGroups.push(this._node);
    }
    onCapturingGroupLeave(start, end) {
        const node = this._node;
        if (node.type !== "CapturingGroup" ||
            node.parent.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        node.end = end;
        node.raw = this.source.slice(start, end);
        this._node = node.parent;
    }
    onQuantifier(start, end, min, max, greedy) {
        const parent = this._node;
        if (parent.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        const element = parent.elements.pop();
        if (element == null ||
            element.type === "Quantifier" ||
            (element.type === "Assertion" && element.kind !== "lookahead")) {
            throw new Error("UnknownError");
        }
        const node = {
            type: "Quantifier",
            parent,
            start: element.start,
            end,
            raw: this.source.slice(element.start, end),
            min,
            max,
            greedy,
            element,
        };
        parent.elements.push(node);
        element.parent = node;
    }
    onLookaroundAssertionEnter(start, kind, negate) {
        const parent = this._node;
        if (parent.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        const node = (this._node = {
            type: "Assertion",
            parent,
            start,
            end: start,
            raw: "",
            kind,
            negate,
            alternatives: [],
        });
        parent.elements.push(node);
    }
    onLookaroundAssertionLeave(start, end) {
        const node = this._node;
        if (node.type !== "Assertion" || node.parent.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        node.end = end;
        node.raw = this.source.slice(start, end);
        this._node = node.parent;
    }
    onEdgeAssertion(start, end, kind) {
        const parent = this._node;
        if (parent.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        parent.elements.push({
            type: "Assertion",
            parent,
            start,
            end,
            raw: this.source.slice(start, end),
            kind,
        });
    }
    onWordBoundaryAssertion(start, end, kind, negate) {
        const parent = this._node;
        if (parent.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        parent.elements.push({
            type: "Assertion",
            parent,
            start,
            end,
            raw: this.source.slice(start, end),
            kind,
            negate,
        });
    }
    onAnyCharacterSet(start, end, kind) {
        const parent = this._node;
        if (parent.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        parent.elements.push({
            type: "CharacterSet",
            parent,
            start,
            end,
            raw: this.source.slice(start, end),
            kind,
        });
    }
    onEscapeCharacterSet(start, end, kind, negate) {
        const parent = this._node;
        if (parent.type !== "Alternative" && parent.type !== "CharacterClass") {
            throw new Error("UnknownError");
        }
        parent.elements.push({
            type: "CharacterSet",
            parent,
            start,
            end,
            raw: this.source.slice(start, end),
            kind,
            negate,
        });
    }
    onUnicodePropertyCharacterSet(start, end, kind, key, value, negate, strings) {
        const parent = this._node;
        if (parent.type !== "Alternative" && parent.type !== "CharacterClass") {
            throw new Error("UnknownError");
        }
        const base = {
            type: "CharacterSet",
            parent: null,
            start,
            end,
            raw: this.source.slice(start, end),
            kind,
            strings: null,
            key,
        };
        if (strings) {
            if ((parent.type === "CharacterClass" && !parent.unicodeSets) ||
                negate ||
                value !== null) {
                throw new Error("UnknownError");
            }
            parent.elements.push(Object.assign(Object.assign({}, base), { parent, strings, value, negate }));
        }
        else {
            parent.elements.push(Object.assign(Object.assign({}, base), { parent, strings, value, negate }));
        }
    }
    onCharacter(start, end, value) {
        const parent = this._node;
        if (parent.type !== "Alternative" &&
            parent.type !== "CharacterClass" &&
            parent.type !== "StringAlternative") {
            throw new Error("UnknownError");
        }
        parent.elements.push({
            type: "Character",
            parent,
            start,
            end,
            raw: this.source.slice(start, end),
            value,
        });
    }
    onBackreference(start, end, ref) {
        const parent = this._node;
        if (parent.type !== "Alternative") {
            throw new Error("UnknownError");
        }
        const node = {
            type: "Backreference",
            parent,
            start,
            end,
            raw: this.source.slice(start, end),
            ref,
            ambiguous: false,
            resolved: DUMMY_CAPTURING_GROUP,
        };
        parent.elements.push(node);
        this._backreferences.push(node);
    }
    onCharacterClassEnter(start, negate, unicodeSets) {
        const parent = this._node;
        const base = {
            type: "CharacterClass",
            parent,
            start,
            end: start,
            raw: "",
            unicodeSets,
            negate,
            elements: [],
        };
        if (parent.type === "Alternative") {
            const node = Object.assign(Object.assign({}, base), { parent });
            this._node = node;
            parent.elements.push(node);
        }
        else if (parent.type === "CharacterClass" &&
            parent.unicodeSets &&
            unicodeSets) {
            const node = Object.assign(Object.assign({}, base), { parent,
                unicodeSets });
            this._node = node;
            parent.elements.push(node);
        }
        else {
            throw new Error("UnknownError");
        }
    }
    onCharacterClassLeave(start, end) {
        const node = this._node;
        if (node.type !== "CharacterClass" ||
            (node.parent.type !== "Alternative" &&
                node.parent.type !== "CharacterClass")) {
            throw new Error("UnknownError");
        }
        const parent = node.parent;
        node.end = end;
        node.raw = this.source.slice(start, end);
        this._node = parent;
        const expression = this._expressionBufferMap.get(node);
        if (!expression) {
            return;
        }
        if (node.elements.length > 0) {
            throw new Error("UnknownError");
        }
        this._expressionBufferMap.delete(node);
        const newNode = {
            type: "ExpressionCharacterClass",
            parent,
            start: node.start,
            end: node.end,
            raw: node.raw,
            negate: node.negate,
            expression,
        };
        expression.parent = newNode;
        if (node !== parent.elements.pop()) {
            throw new Error("UnknownError");
        }
        parent.elements.push(newNode);
    }
    onCharacterClassRange(start, end) {
        const parent = this._node;
        if (parent.type !== "CharacterClass") {
            throw new Error("UnknownError");
        }
        const elements = parent.elements;
        const max = elements.pop();
        if (!max || max.type !== "Character") {
            throw new Error("UnknownError");
        }
        if (!parent.unicodeSets) {
            const hyphen = elements.pop();
            if (!hyphen ||
                hyphen.type !== "Character" ||
                hyphen.value !== HYPHEN_MINUS) {
                throw new Error("UnknownError");
            }
        }
        const min = elements.pop();
        if (!min || min.type !== "Character") {
            throw new Error("UnknownError");
        }
        const node = {
            type: "CharacterClassRange",
            parent,
            start,
            end,
            raw: this.source.slice(start, end),
            min,
            max,
        };
        min.parent = node;
        max.parent = node;
        elements.push(node);
    }
    onClassIntersection(start, end) {
        var _a;
        const parent = this._node;
        if (parent.type !== "CharacterClass" || !parent.unicodeSets) {
            throw new Error("UnknownError");
        }
        const right = parent.elements.pop();
        const left = (_a = this._expressionBufferMap.get(parent)) !== null && _a !== void 0 ? _a : parent.elements.pop();
        if (!left ||
            !right ||
            left.type === "ClassSubtraction" ||
            (left.type !== "ClassIntersection" && !isClassSetOperand(left)) ||
            !isClassSetOperand(right)) {
            throw new Error("UnknownError");
        }
        const node = {
            type: "ClassIntersection",
            parent: parent,
            start,
            end,
            raw: this.source.slice(start, end),
            left,
            right,
        };
        left.parent = node;
        right.parent = node;
        this._expressionBufferMap.set(parent, node);
    }
    onClassSubtraction(start, end) {
        var _a;
        const parent = this._node;
        if (parent.type !== "CharacterClass" || !parent.unicodeSets) {
            throw new Error("UnknownError");
        }
        const right = parent.elements.pop();
        const left = (_a = this._expressionBufferMap.get(parent)) !== null && _a !== void 0 ? _a : parent.elements.pop();
        if (!left ||
            !right ||
            left.type === "ClassIntersection" ||
            (left.type !== "ClassSubtraction" && !isClassSetOperand(left)) ||
            !isClassSetOperand(right)) {
            throw new Error("UnknownError");
        }
        const node = {
            type: "ClassSubtraction",
            parent: parent,
            start,
            end,
            raw: this.source.slice(start, end),
            left,
            right,
        };
        left.parent = node;
        right.parent = node;
        this._expressionBufferMap.set(parent, node);
    }
    onClassStringDisjunctionEnter(start) {
        const parent = this._node;
        if (parent.type !== "CharacterClass" || !parent.unicodeSets) {
            throw new Error("UnknownError");
        }
        this._node = {
            type: "ClassStringDisjunction",
            parent,
            start,
            end: start,
            raw: "",
            alternatives: [],
        };
        parent.elements.push(this._node);
    }
    onClassStringDisjunctionLeave(start, end) {
        const node = this._node;
        if (node.type !== "ClassStringDisjunction" ||
            node.parent.type !== "CharacterClass") {
            throw new Error("UnknownError");
        }
        node.end = end;
        node.raw = this.source.slice(start, end);
        this._node = node.parent;
    }
    onStringAlternativeEnter(start) {
        const parent = this._node;
        if (parent.type !== "ClassStringDisjunction") {
            throw new Error("UnknownError");
        }
        this._node = {
            type: "StringAlternative",
            parent,
            start,
            end: start,
            raw: "",
            elements: [],
        };
        parent.alternatives.push(this._node);
    }
    onStringAlternativeLeave(start, end) {
        const node = this._node;
        if (node.type !== "StringAlternative") {
            throw new Error("UnknownError");
        }
        node.end = end;
        node.raw = this.source.slice(start, end);
        this._node = node.parent;
    }
}
class RegExpParser {
    constructor(options) {
        this._state = new RegExpParserState(options);
        this._validator = new RegExpValidator(this._state);
    }
    parseLiteral(source, start = 0, end = source.length) {
        this._state.source = source;
        this._validator.validateLiteral(source, start, end);
        const pattern = this._state.pattern;
        const flags = this._state.flags;
        const literal = {
            type: "RegExpLiteral",
            parent: null,
            start,
            end,
            raw: source,
            pattern,
            flags,
        };
        pattern.parent = literal;
        flags.parent = literal;
        return literal;
    }
    parseFlags(source, start = 0, end = source.length) {
        this._state.source = source;
        this._validator.validateFlags(source, start, end);
        return this._state.flags;
    }
    parsePattern(source, start = 0, end = source.length, uFlagOrFlags = undefined) {
        this._state.source = source;
        this._validator.validatePattern(source, start, end, uFlagOrFlags);
        return this._state.pattern;
    }
}

class RegExpVisitor {
    constructor(handlers) {
        this._handlers = handlers;
    }
    visit(node) {
        switch (node.type) {
            case "Alternative":
                this.visitAlternative(node);
                break;
            case "Assertion":
                this.visitAssertion(node);
                break;
            case "Backreference":
                this.visitBackreference(node);
                break;
            case "CapturingGroup":
                this.visitCapturingGroup(node);
                break;
            case "Character":
                this.visitCharacter(node);
                break;
            case "CharacterClass":
                this.visitCharacterClass(node);
                break;
            case "CharacterClassRange":
                this.visitCharacterClassRange(node);
                break;
            case "CharacterSet":
                this.visitCharacterSet(node);
                break;
            case "ClassIntersection":
                this.visitClassIntersection(node);
                break;
            case "ClassStringDisjunction":
                this.visitClassStringDisjunction(node);
                break;
            case "ClassSubtraction":
                this.visitClassSubtraction(node);
                break;
            case "ExpressionCharacterClass":
                this.visitExpressionCharacterClass(node);
                break;
            case "Flags":
                this.visitFlags(node);
                break;
            case "Group":
                this.visitGroup(node);
                break;
            case "Modifiers":
                this.visitModifiers(node);
                break;
            case "ModifierFlags":
                this.visitModifierFlags(node);
                break;
            case "Pattern":
                this.visitPattern(node);
                break;
            case "Quantifier":
                this.visitQuantifier(node);
                break;
            case "RegExpLiteral":
                this.visitRegExpLiteral(node);
                break;
            case "StringAlternative":
                this.visitStringAlternative(node);
                break;
            default:
                throw new Error(`Unknown type: ${node.type}`);
        }
    }
    visitAlternative(node) {
        if (this._handlers.onAlternativeEnter) {
            this._handlers.onAlternativeEnter(node);
        }
        node.elements.forEach(this.visit, this);
        if (this._handlers.onAlternativeLeave) {
            this._handlers.onAlternativeLeave(node);
        }
    }
    visitAssertion(node) {
        if (this._handlers.onAssertionEnter) {
            this._handlers.onAssertionEnter(node);
        }
        if (node.kind === "lookahead" || node.kind === "lookbehind") {
            node.alternatives.forEach(this.visit, this);
        }
        if (this._handlers.onAssertionLeave) {
            this._handlers.onAssertionLeave(node);
        }
    }
    visitBackreference(node) {
        if (this._handlers.onBackreferenceEnter) {
            this._handlers.onBackreferenceEnter(node);
        }
        if (this._handlers.onBackreferenceLeave) {
            this._handlers.onBackreferenceLeave(node);
        }
    }
    visitCapturingGroup(node) {
        if (this._handlers.onCapturingGroupEnter) {
            this._handlers.onCapturingGroupEnter(node);
        }
        node.alternatives.forEach(this.visit, this);
        if (this._handlers.onCapturingGroupLeave) {
            this._handlers.onCapturingGroupLeave(node);
        }
    }
    visitCharacter(node) {
        if (this._handlers.onCharacterEnter) {
            this._handlers.onCharacterEnter(node);
        }
        if (this._handlers.onCharacterLeave) {
            this._handlers.onCharacterLeave(node);
        }
    }
    visitCharacterClass(node) {
        if (this._handlers.onCharacterClassEnter) {
            this._handlers.onCharacterClassEnter(node);
        }
        node.elements.forEach(this.visit, this);
        if (this._handlers.onCharacterClassLeave) {
            this._handlers.onCharacterClassLeave(node);
        }
    }
    visitCharacterClassRange(node) {
        if (this._handlers.onCharacterClassRangeEnter) {
            this._handlers.onCharacterClassRangeEnter(node);
        }
        this.visitCharacter(node.min);
        this.visitCharacter(node.max);
        if (this._handlers.onCharacterClassRangeLeave) {
            this._handlers.onCharacterClassRangeLeave(node);
        }
    }
    visitCharacterSet(node) {
        if (this._handlers.onCharacterSetEnter) {
            this._handlers.onCharacterSetEnter(node);
        }
        if (this._handlers.onCharacterSetLeave) {
            this._handlers.onCharacterSetLeave(node);
        }
    }
    visitClassIntersection(node) {
        if (this._handlers.onClassIntersectionEnter) {
            this._handlers.onClassIntersectionEnter(node);
        }
        this.visit(node.left);
        this.visit(node.right);
        if (this._handlers.onClassIntersectionLeave) {
            this._handlers.onClassIntersectionLeave(node);
        }
    }
    visitClassStringDisjunction(node) {
        if (this._handlers.onClassStringDisjunctionEnter) {
            this._handlers.onClassStringDisjunctionEnter(node);
        }
        node.alternatives.forEach(this.visit, this);
        if (this._handlers.onClassStringDisjunctionLeave) {
            this._handlers.onClassStringDisjunctionLeave(node);
        }
    }
    visitClassSubtraction(node) {
        if (this._handlers.onClassSubtractionEnter) {
            this._handlers.onClassSubtractionEnter(node);
        }
        this.visit(node.left);
        this.visit(node.right);
        if (this._handlers.onClassSubtractionLeave) {
            this._handlers.onClassSubtractionLeave(node);
        }
    }
    visitExpressionCharacterClass(node) {
        if (this._handlers.onExpressionCharacterClassEnter) {
            this._handlers.onExpressionCharacterClassEnter(node);
        }
        this.visit(node.expression);
        if (this._handlers.onExpressionCharacterClassLeave) {
            this._handlers.onExpressionCharacterClassLeave(node);
        }
    }
    visitFlags(node) {
        if (this._handlers.onFlagsEnter) {
            this._handlers.onFlagsEnter(node);
        }
        if (this._handlers.onFlagsLeave) {
            this._handlers.onFlagsLeave(node);
        }
    }
    visitGroup(node) {
        if (this._handlers.onGroupEnter) {
            this._handlers.onGroupEnter(node);
        }
        if (node.modifiers) {
            this.visit(node.modifiers);
        }
        node.alternatives.forEach(this.visit, this);
        if (this._handlers.onGroupLeave) {
            this._handlers.onGroupLeave(node);
        }
    }
    visitModifiers(node) {
        if (this._handlers.onModifiersEnter) {
            this._handlers.onModifiersEnter(node);
        }
        if (node.add) {
            this.visit(node.add);
        }
        if (node.remove) {
            this.visit(node.remove);
        }
        if (this._handlers.onModifiersLeave) {
            this._handlers.onModifiersLeave(node);
        }
    }
    visitModifierFlags(node) {
        if (this._handlers.onModifierFlagsEnter) {
            this._handlers.onModifierFlagsEnter(node);
        }
        if (this._handlers.onModifierFlagsLeave) {
            this._handlers.onModifierFlagsLeave(node);
        }
    }
    visitPattern(node) {
        if (this._handlers.onPatternEnter) {
            this._handlers.onPatternEnter(node);
        }
        node.alternatives.forEach(this.visit, this);
        if (this._handlers.onPatternLeave) {
            this._handlers.onPatternLeave(node);
        }
    }
    visitQuantifier(node) {
        if (this._handlers.onQuantifierEnter) {
            this._handlers.onQuantifierEnter(node);
        }
        this.visit(node.element);
        if (this._handlers.onQuantifierLeave) {
            this._handlers.onQuantifierLeave(node);
        }
    }
    visitRegExpLiteral(node) {
        if (this._handlers.onRegExpLiteralEnter) {
            this._handlers.onRegExpLiteralEnter(node);
        }
        this.visitPattern(node.pattern);
        this.visitFlags(node.flags);
        if (this._handlers.onRegExpLiteralLeave) {
            this._handlers.onRegExpLiteralLeave(node);
        }
    }
    visitStringAlternative(node) {
        if (this._handlers.onStringAlternativeEnter) {
            this._handlers.onStringAlternativeEnter(node);
        }
        node.elements.forEach(this.visit, this);
        if (this._handlers.onStringAlternativeLeave) {
            this._handlers.onStringAlternativeLeave(node);
        }
    }
}

function parseRegExpLiteral(source, options) {
    return new RegExpParser(options).parseLiteral(String(source));
}
function validateRegExpLiteral(source, options) {
    new RegExpValidator(options).validateLiteral(source);
}
function visitRegExpAST(node, handlers) {
    new RegExpVisitor(handlers).visit(node);
}

export { ast as AST, RegExpParser, RegExpSyntaxError, RegExpValidator, parseRegExpLiteral, validateRegExpLiteral, visitRegExpAST };
//# sourceMappingURL=index.mjs.map
=2x   {"version":3,"file":"index.mjs.map","sources":[".temp/src/ecma-versions.ts",".temp/unicode/src/unicode/ids.ts",".temp/unicode/src/unicode/properties.ts",".temp/unicode/src/unicode/index.ts",".temp/src/group-specifiers.ts",".temp/src/reader.ts",".temp/src/regexp-syntax-error.ts",".temp/src/validator.ts",".temp/src/parser.ts",".temp/src/visitor.ts",".temp/src/index.ts"],"sourcesContent":[null,null,null,null,null,null,null,null,null,null,null],"names":[],"mappings":";;;;AAaO,MAAM,iBAAiB,GAAG,IAAI;;ACTrC,IAAI,kBAAkB,GAAyB,SAAS,CAAA;AACxD,IAAI,qBAAqB,GAAyB,SAAS,CAAA;AAErD,SAAU,SAAS,CAAC,EAAU,EAAA;IAChC,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,IAAI,CAAA;IAC1B,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,IAAI,CAAA;AAC1B,IAAA,OAAO,cAAc,CAAC,EAAE,CAAC,CAAA;AAC7B,CAAC;AAEK,SAAU,YAAY,CAAC,EAAU,EAAA;IACnC,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,IAAI,CAAA;IAC1B,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,KAAK,CAAA;IAC3B,IAAI,EAAE,GAAG,IAAI;AAAE,QAAA,OAAO,IAAI,CAAA;IAC1B,IAAI,EA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jC,IAAI,eAAe,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,CAAA;AACxD,CAAC;AAEe,SAAA,cAAc,CAC1B,IAAc,EACd,QAAgC,EAAA;IAEhC,IAAI,aAAa,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;AAC3C;;;;"},Kx
 {
  "name": "@eslint-community/regexpp",
  "version": "4.12.2",
  "description": "Regular expression parser for ECMAScript.",
  "keywords": [
    "regexp",
    "regular",
    "expression",
    "parser",
    "validator",
    "ast",
    "abstract",
    "syntax",
    "tree",
    "ecmascript",
    "es2015",
    "es2016",
    "es2017",
    "es2018",
    "es2019",
    "es2020",
    "es2021",
    "annexB"
  ],
  "homepage": "https://github.com/eslint-community/regexpp#readme",
  "bugs": {
    "url": "https://github.com/eslint-community/regexpp/issues"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/eslint-community/regexpp"
  },
  "license": "MIT",
  "author": "Toru Nagashima",
  "exports": {
    ".": {
      "types": "./index.d.ts",
      "import": "./index.mjs",
      "default": "./index.js"
    },
    "./package.json": "./package.json"
  },
  "main": "index",
  "files": [
    "index.*"
  ],
  "scripts": {
    "prebuild": "npm run -s clean",
    "build": "run-s build:*",
    "build:tsc": "tsc --module es2015",
    "build:rollup": "rollup -c",
    "build:dts": "npm run -s build:tsc -- --removeComments false && dts-bundle --name @eslint-community/regexpp --main .temp/index.d.ts --out ../index.d.ts && prettier --write index.d.ts",
    "clean": "rimraf .temp index.*",
    "lint": "eslint . --ext .ts",
    "test": "nyc _mocha \"test/*.ts\" --reporter dot --timeout 10000",
    "debug": "mocha --require ts-node/register/transpile-only \"test/*.ts\" --reporter dot --timeout 10000",
    "update:test": "ts-node scripts/update-fixtures.ts",
    "update:unicode": "run-s update:unicode:*",
    "update:unicode:ids": "ts-node scripts/update-unicode-ids.ts",
    "update:unicode:props": "ts-node scripts/update-unicode-properties.ts",
    "update:test262:extract": "ts-node -T scripts/extract-test262.ts",
    "preversion": "npm test && npm run -s build",
    "postversion": "git push && git push --tags",
    "prewatch": "npm run -s clean",
    "watch": "_mocha \"test/*.ts\" --require ts-node/register --reporter dot --timeout 10000 --watch-extensions ts --watch --growl"
  },
  "dependencies": {},
  "devDependencies": {
    "@eslint-community/eslint-plugin-mysticatea": "^15.5.1",
    "@rollup/plugin-node-resolve": "^14.1.0",
    "@types/eslint": "^8.44.3",
    "@types/jsdom": "^16.2.15",
    "@types/mocha": "^9.1.1",
    "@types/node": "^12.20.55",
    "dts-bundle": "^0.7.3",
    "eslint": "^8.50.0",
    "js-tokens": "^8.0.2",
    "jsdom": "^19.0.0",
    "mocha": "^9.2.2",
    "npm-run-all2": "^6.2.2",
    "nyc": "^14.1.1",
    "rimraf": "^3.0.2",
    "rollup": "^2.79.1",
    "rollup-plugin-sourcemaps": "^0.6.3",
    "ts-node": "^10.9.1",
    "typescript": "~5.0.2"
  },
  "engines": {
    "node": "^12.0.0 || ^14.0.0 || >=16.0.0"
  }
}
T*+x\40000 config-array ah&WS40000 config-helpers RH`ҌgM"40000 core lxXG~40000 css-tree IvXm,C qS?k40000 css 5}$c	i,340000 js M5M]&˝@f40000 json j+"ciHf7ޜ40000 markdown 
E!2{qG40000 object-schema |`d)׺n40000 plugin-kit ?Sj`SuZOpx p100644 LICENSE &랟+Kfݩo\d100644 README.md mr4qGu&"&40000 dist `QGјr;쉈s100644 package.json .SU"z#P8 x],                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS

   APPENDIX: How to apply the Apache License to your work.

      To apply the Apache License to your work, attach the following
      boilerplate notice, with the fields enclosed by brackets "[]"
      replaced with your own identifying information. (Don't include
      the brackets!)  The text should be enclosed in the appropriate
      comment syntax for the file format. We also recommend that a
      file or class name and description of purpose be included on the
      same "printed page" as the copyright notice for easier
      identification within third-party archives.

   Copyright [yyyy] [name of copyright owner]

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       http://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.
~\fxBc# Config Array

## Description

A config array is a way of managing configurations that are based on glob pattern matching of filenames. Each config array contains the information needed to determine the correct configuration for any file based on the filename.

**Note:** This is a generic package that can be used outside of ESLint. It contains no ESLint-specific functionality.

## Installation

For Node.js and compatible runtimes:

```shell
npm install @eslint/config-array
# or
yarn add @eslint/config-array
# or
pnpm install @eslint/config-array
# or
bun add @eslint/config-array
```

For Deno:

```shell
deno add @eslint/config-array
```

## Background

The basic idea is that all configuration, including overrides, can be represented by a single array where each item in the array is a config object. Config objects appearing later in the array override config objects appearing earlier in the array. You can calculate a config for a given file by traversing all config objects in the array to find the ones that match the filename. Matching is done by specifying glob patterns in `files` and `ignores` properties on each config object. Here's an example:

```js
export default [
	// match all JSON files
	{
		name: "JSON Handler",
		files: ["**/*.json"],
		handler: jsonHandler,
	},

	// match only package.json
	{
		name: "package.json Handler",
		files: ["package.json"],
		handler: packageJsonHandler,
	},
];
```

In this example, there are two config objects: the first matches all JSON files in all directories and the second matches just `package.json` in the base path directory (all the globs are evaluated as relative to a base path that can be specified). When you retrieve a configuration for `foo.json`, only the first config object matches so `handler` is equal to `jsonHandler`; when you retrieve a configuration for `package.json`, `handler` is equal to `packageJsonHandler` (because both config objects match, the second one wins).

## Usage

First, import the `ConfigArray` constructor:

```js
import { ConfigArray } from "@eslint/config-array";

// or using CommonJS

const { ConfigArray } = require("@eslint/config-array");
```

When you create a new instance of `ConfigArray`, you must pass in two arguments: an array of configs and an options object. The array of configs is most likely read in from a configuration file, so here's a typical example:

```js
import path from "node:path";
import { pathToFileURL } from "node:url";
import { ConfigArray } from "@eslint/config-array";

const configFilename = path.resolve(process.cwd(), "my.config.js");
const { default: rawConfigs } = await import(pathToFileURL(configFilename));

const configs = new ConfigArray(rawConfigs, {
	// the path to match filenames from
	basePath: process.cwd(),

	// additional items in each config
	schema: mySchema,
});
```

This example reads in an object or array from `my.config.js` and passes it into the `ConfigArray` constructor as the first argument. The second argument is an object specifying the `basePath` (the directory in which `my.config.js` is found) and a `schema` to define the additional properties of a config object beyond `files`, `ignores`, `basePath`, and `name`.

### Specifying a Schema

The `schema` option is required for you to use additional properties in config objects. The schema is an object that follows the format of an [`ObjectSchema`](https://npmjs.com/package/@eslint/object-schema). The schema specifies both validation and merge rules that the `ConfigArray` instance needs to combine configs when there are multiple matches. Here's an example:

```js
const configFilename = path.resolve(process.cwd(), "my.config.js");
const { default: rawConfigs } = await import(pathToFileURL(configFilename));

const mySchema = {
	// define the handler key in configs
	handler: {
		required: true,
		merge(a, b) {
			return b ?? a;
		},
		validate(value) {
			if (typeof value !== "function") {
				throw new TypeError("Function expected.");
			}
		},
	},
};

const configs = new ConfigArray(rawConfigs, {
	// the path to match filenames from
	basePath: process.cwd(),

	// additional item schemas in each config
	schema: mySchema,

	// additional config types supported (default: [])
	extraConfigTypes: ["array", "function"],
});
```

### Config Arrays

Config arrays can be multidimensional, so it's possible for a config array to contain another config array when `extraConfigTypes` contains `"array"`, such as:

```js
export default [
	// JS config
	{
		files: ["**/*.js"],
		handler: jsHandler,
	},

	// JSON configs
	[
		// match all JSON files
		{
			name: "JSON Handler",
			files: ["**/*.json"],
			handler: jsonHandler,
		},

		// match only package.json
		{
			name: "package.json Handler",
			files: ["package.json"],
			handler: packageJsonHandler,
		},
	],

	// filename must match function
	{
		files: [filePath => filePath.endsWith(".md")],
		handler: markdownHandler,
	},

	// filename must match all patterns in subarray
	{
		files: [["*.test.*", "*.js"]],
		handler: jsTestHandler,
	},

	// filename must not match patterns beginning with !
	{
		name: "Non-JS files",
		files: ["!*.js"],
		settings: {
			js: false,
		},
	},

	// specific settings for files inside `src` directory
	{
		name: "Source files",
		basePath: "src",
		files: ["**/*"],
		settings: {
			source: true,
		},
	},
];
```

In this example, the array contains both config objects and a config array. When a config array is normalized (see details below), it is flattened so only config objects remain. However, the order of evaluation remains the same.

If the `files` array contains a function, then that function is called with the path of the file as it was passed in. The function is expected to return `true` if there is a match and `false` if not. (The `ignores` array can also contain functions.)

If the `files` array contains an item that is an array of strings and functions, then all patterns must match in order for the config to match. In the preceding examples, both `*.test.*` and `*.js` must match in order for the config object to be used.

If a pattern in the files array begins with `!` then it excludes that pattern. In the preceding example, any filename that doesn't end with `.js` will automatically get a `settings.js` property set to `false`.

You can also specify an `ignores` key that will force files matching those patterns to not be included. If the `ignores` key is in a config object without any other keys, then those ignores will always be applied; otherwise those ignores act as exclusions. Here's an example:

```js
export default [
	// Always ignored
	{
		ignores: ["**/.git/**", "**/node_modules/**"],
	},

	// .eslintrc.js file is ignored only when .js file matches
	{
		files: ["**/*.js"],
		ignores: [".eslintrc.js"],
		handler: jsHandler,
	},
];
```

You can use negated patterns in `ignores` to exclude a file that was already ignored, such as:

```js
export default [
	// Ignore all JSON files except tsconfig.json
	{
		files: ["**/*"],
		ignores: ["**/*.json", "!tsconfig.json"],
	},
];
```

### Config Functions

Config arrays can also include config functions when `extraConfigTypes` contains `"function"`. A config function accepts a single parameter, `context` (defined by you), and must return either a config object or a config array (it cannot return another function). Config functions allow end users to execute code in the creation of appropriate config objects. Here's an example:

```js
export default [
	// JS config
	{
		files: ["**/*.js"],
		handler: jsHandler,
	},

	// JSON configs
	function (context) {
		return [
			// match all JSON files
			{
				name: context.name + " JSON Handler",
				files: ["**/*.json"],
				handler: jsonHandler,
			},

			// match only package.json
			{
				name: context.name + " package.json Handler",
				files: ["package.json"],
				handler: packageJsonHandler,
			},
		];
	},
];
```

When a config array is normalized, each function is executed and replaced in the config array with the return value.

**Note:** Config functions can also be async.

### Normalizing Config Arrays

Once a config array has been created and loaded with all of the raw config data, it must be normalized before it can be used. The normalization process goes through and flattens the config array as well as executing all config functions to get their final values.

To normalize a config array, call the `normalize()` method and pass in a context object:

```js
await configs.normalize({
	name: "MyApp",
});
```

The `normalize()` method returns a promise, so be sure to use the `await` operator. The config array instance is normalized in-place, so you don't need to create a new variable.

If you want to disallow async config functions, you can call `normalizeSync()` instead. This method is completely synchronous and does not require using the `await` operator as it does not return a promise:

```js
configs.normalizeSync({
	name: "MyApp",
});
```

**Important:** Once a `ConfigArray` is normalized, it cannot be changed further. You can, however, create a new `ConfigArray` and pass in the normalized instance to create an unnormalized copy.

### Getting Config for a File

To get the config for a file, use the `getConfig()` method on a normalized config array and pass in the filename to get a config for:

```js
// pass in filename
const fileConfig = configs.getConfig(
	path.resolve(process.cwd(), "package.json"),
);
```

The config array always returns an object, even if there are no configs matching the given filename. You can then inspect the returned config object to determine how to proceed.

A few things to keep in mind:

- If a filename is not an absolute path, it will be resolved relative to the base path directory.
- The returned config object never has `files`, `ignores`, `basePath`, or `name` properties; the only properties on the object will be the other configuration options specified.
- The config array caches configs, so subsequent calls to `getConfig()` with the same filename will return in a fast lookup rather than another calculation.
- A config will only be generated if the filename matches an entry in a `files` key. A config will not be generated without matching a `files` key (configs without a `files` key are only applied when another config with a `files` key is applied; configs without `files` are never applied on their own). Any config with a `files` key entry that is `*` or ends with `/**` or `/*` will only be applied if another entry in the same `files` key matches or another config matches.

## Determining Ignored Paths

You can determine if a file is ignored by using the `isFileIgnored()` method and passing in the path of any file, as in this example:

```js
const ignored = configs.isFileIgnored("/foo/bar/baz.txt");
```

A file is considered ignored if any of the following is true:

- **Its parent directory is ignored.** For example, if `foo` is in `ignores`, then `foo/a.js` is considered ignored.
- **It has an ancestor directory that is ignored.** For example, if `foo` is in `ignores`, then `foo/baz/a.js` is considered ignored.
- **It matches an ignored file pattern.** For example, if `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored.
- **If it matches an entry in `files` and also in `ignores`.** For example, if `**/*.js` is in `files` and `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored.
- **The file is outside the `basePath`.** If the `basePath` is `/usr/me`, then `/foo/a.js` is considered ignored.

For directories, use the `isDirectoryIgnored()` method and pass in the path of any directory, as in this example:

```js
const ignored = configs.isDirectoryIgnored("/foo/bar/");
```

A directory is considered ignored if any of the following is true:

- **Its parent directory is ignored.** For example, if `foo` is in `ignores`, then `foo/baz` is considered ignored.
- **It has an ancestor directory that is ignored.** For example, if `foo` is in `ignores`, then `foo/bar/baz/a.js` is considered ignored.
- **It matches an ignored file pattern.** For example, if `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored.
- **If it matches an entry in `files` and also in `ignores`.** For example, if `**/*.js` is in `files` and `**/a.js` is in `ignores`, then `foo/a.js` and `foo/baz/a.js` are considered ignored.
- **The file is outside the `basePath`.** If the `basePath` is `/usr/me`, then `/foo/a.js` is considered ignored.

**Important:** A pattern such as `foo/**` means that `foo` and `foo/` are _not_ ignored whereas `foo/bar` is ignored. If you want to ignore `foo` and all of its subdirectories, use the pattern `foo` or `foo/` in `ignores`.

## Caching Mechanisms

Each `ConfigArray` aggressively caches configuration objects to avoid unnecessary work. This caching occurs in two ways:

1. **File-based Caching.** For each filename that is passed into a method, the resulting config is cached against that filename so you're always guaranteed to get the same object returned from `getConfig()` whenever you pass the same filename in.
2. **Index-based Caching.** Whenever a config is calculated, the config elements that were used to create the config are also cached. So if a given filename matches elements 1, 5, and 7, the resulting config is cached with a key of `1,5,7`. That way, if another file is passed that matches the same config elements, the result is already known and doesn't have to be recalculated. That means two files that match all the same elements will return the same config from `getConfig()`.

## Acknowledgements

The design of this project was influenced by feedback on the ESLint RFC, and incorporates ideas from:

- Teddy Katz (@not-an-aardvark)
- Toru Nagashima (@mysticatea)
- Kai Cataldo (@kaicataldo)

## License

Apache 2.0

<!-- NOTE: This section is autogenerated. Do not manually edit.-->
<!--sponsorsstart-->

## Sponsors

The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
to get your logo on our READMEs and [website](https://eslint.org/sponsors).

<h3>Platinum Sponsors</h3>
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a></p><h3>Gold Sponsors</h3>
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a></p><h3>Silver Sponsors</h3>
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/d472863/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/2d6c3b6/logo.png" alt="Liftoff" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" height="32"></a> <a href="https://www.crawljobs.com/"><img src="https://images.opencollective.com/crawljobs-poland/fa43a17/logo.png" alt="CrawlJobs" height="32"></a> <a href="#"><img src="https://images.opencollective.com/aeriusventilations-org/avatar.png" alt="aeriusventilation's Org" height="32"></a> <a href="https://depot.dev"><img src="https://images.opencollective.com/depot/39125a1/logo.png" alt="Depot" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="TestMu AI Open Source Office (Formerly LambdaTest)" height="32"></a></p>
<h3>Technology Sponsors</h3>
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
<!--sponsorsend-->
;_x< 40000 cjs X-)?	B 40000 esm !kG¸xǍ>p%}q	x j100644 index.cjs 4ۼ`[ 3M100644 index.d.cts nƇa8](nRy}u40000 std__path uf=&g9bKj100644 types.cts T!y-%q!.(𹸫z#;ֽxS'use strict';

var posixPath = require('./std__path/posix.cjs');
var windowsPath = require('./std__path/windows.cjs');
var minimatch = require('minimatch');
var createDebug = require('debug');
var objectSchema = require('@eslint/object-schema');

function _interopNamespaceDefault(e) {
	var n = Object.create(null);
	if (e) {
		Object.keys(e).forEach(function (k) {
			if (k !== 'default') {
				var d = Object.getOwnPropertyDescriptor(e, k);
				Object.defineProperty(n, k, d.get ? d : {
					enumerable: true,
					get: function () { return e[k]; }
				});
			}
		});
	}
	n.default = e;
	return Object.freeze(n);
}

var posixPath__namespace = /*#__PURE__*/_interopNamespaceDefault(posixPath);
var windowsPath__namespace = /*#__PURE__*/_interopNamespaceDefault(windowsPath);

/**
 * @fileoverview ConfigSchema
 * @author Nicholas C. Zakas
 */

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @import * as $eslintobjectschema from "@eslint/object-schema"; */
/** @typedef {$eslintobjectschema.PropertyDefinition} PropertyDefinition */
/** @typedef {$eslintobjectschema.ObjectDefinition} ObjectDefinition */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * A strategy that does nothing.
 * @type {PropertyDefinition}
 */
const NOOP_STRATEGY = {
	required: false,
	merge() {
		return undefined;
	},
	validate() {},
};

//------------------------------------------------------------------------------
// Exports
//------------------------------------------------------------------------------

/**
 * The base schema that every ConfigArray uses.
 * @type {ObjectDefinition}
 */
const baseSchema = Object.freeze({
	name: {
		required: false,
		merge() {
			return undefined;
		},
		validate(value) {
			if (typeof value !== "string") {
				throw new TypeError("Property must be a string.");
			}
		},
	},
	basePath: NOOP_STRATEGY,
	files: NOOP_STRATEGY,
	ignores: NOOP_STRATEGY,
});

/**
 * @fileoverview ConfigSchema
 * @author Nicholas C. Zakas
 */

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------


//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Asserts that a given value is an array.
 * @param {*} value The value to check.
 * @returns {void}
 * @throws {TypeError} When the value is not an array.
 */
function assertIsArray(value) {
	if (!Array.isArray(value)) {
		throw new TypeError("Expected value to be an array.");
	}
}

/**
 * Asserts that a given value is an array containing only strings and functions.
 * @param {*} value The value to check.
 * @returns {void}
 * @throws {TypeError} When the value is not an array of strings and functions.
 */
function assertIsArrayOfStringsAndFunctions(value) {
	assertIsArray(value);

	if (
		value.some(
			item => typeof item !== "string" && typeof item !== "function",
		)
	) {
		throw new TypeError(
			"Expected array to only contain strings and functions.",
		);
	}
}

/**
 * Asserts that a given value is a non-empty array.
 * @param {*} value The value to check.
 * @returns {void}
 * @throws {TypeError} When the value is not an array or an empty array.
 */
function assertIsNonEmptyArray(value) {
	if (!Array.isArray(value) || value.length === 0) {
		throw new TypeError("Expected value to be a non-empty array.");
	}
}

//------------------------------------------------------------------------------
// Exports
//------------------------------------------------------------------------------

/**
 * The schema for `files` and `ignores` that every ConfigArray uses.
 * @type {ObjectDefinition}
 */
const filesAndIgnoresSchema = Object.freeze({
	basePath: {
		required: false,
		merge() {
			return undefined;
		},
		validate(value) {
			if (typeof value !== "string") {
				throw new TypeError("Expected value to be a string.");
			}
		},
	},
	files: {
		required: false,
		merge() {
			return undefined;
		},
		validate(value) {
			// first check if it's an array
			assertIsNonEmptyArray(value);

			// then check each member
			value.forEach(item => {
				if (Array.isArray(item)) {
					assertIsArrayOfStringsAndFunctions(item);
				} else if (
					typeof item !== "string" &&
					typeof item !== "function"
				) {
					throw new TypeError(
						"Items must be a string, a function, or an array of strings and functions.",
					);
				}
			});
		},
	},
	ignores: {
		required: false,
		merge() {
			return undefined;
		},
		validate: assertIsArrayOfStringsAndFunctions,
	},
});

/**
 * @fileoverview ConfigArray
 * @author Nicholas C. Zakas
 */


//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @import * as $typests from "./types.ts"; */
/** @typedef {$typests.ConfigObject} ConfigObject */
/** @typedef {$typests.FileMatcher} FileMatcher */
/** @typedef {$typests.FilesMatcher} FilesMatcher */
/** @typedef {$typests.ExtraConfigType} ExtraConfigType */
/** @import * as $minimatch from "minimatch"; */
/** @typedef {$minimatch.MinimatchOptions} MinimatchOptions */
/** @import * as PathImpl from "@jsr/std__path" */

/*
 * This is a bit of a hack to make TypeScript happy with the Rollup-created
 * CommonJS file. Rollup doesn't do object destructuring for imported files
 * and instead imports the default via `require()`. This messes up type checking
 * for `ObjectSchema`. To work around that, we just import the type manually
 * and give it a different name to use in the JSDoc comments.
 */
/** @typedef {ObjectSchema} ObjectSchemaInstance */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const debug = createDebug("@eslint/config-array");

/**
 * A cache for minimatch instances.
 * @type {Map<string, Minimatch>}
 */
const minimatchCache = new Map();

/**
 * A cache for negated minimatch instances.
 * @type {Map<string, Minimatch>}
 */
const negatedMinimatchCache = new Map();

/**
 * Options to use with minimatch.
 * @type {MinimatchOptions}
 */
const MINIMATCH_OPTIONS = {
	// matchBase: true,
	dot: true,
};

/**
 * The types of config objects that are supported.
 * @type {Set<ExtraConfigType>}
 */
const CONFIG_TYPES = new Set(["array", "function"]);

/**
 * Fields that are considered metadata and not part of the config object.
 * @type {Set<string>}
 */
const META_FIELDS = new Set(["name", "basePath"]);

/**
 * A schema containing just files and ignores for early validation.
 * @type {ObjectSchemaInstance}
 */
const FILES_AND_IGNORES_SCHEMA = new objectSchema.ObjectSchema(filesAndIgnoresSchema);

// Precomputed constant objects returned by `ConfigArray.getConfigWithStatus`.

const CONFIG_WITH_STATUS_EXTERNAL = Object.freeze({ status: "external" });
const CONFIG_WITH_STATUS_IGNORED = Object.freeze({ status: "ignored" });
const CONFIG_WITH_STATUS_UNCONFIGURED = Object.freeze({
	status: "unconfigured",
});

// Match two leading dots followed by a slash or the end of input.
const EXTERNAL_PATH_REGEX = /^\.\.(?:\/|$)/u;

/**
 * Wrapper error for config validation errors that adds a name to the front of the
 * error message.
 */
class ConfigError extends Error {
	/**
	 * Creates a new instance.
	 * @param {string} name The config object name causing the error.
	 * @param {number} index The index of the config object in the array.
	 * @param {Object} options The options for the error.
	 * @param {Error} [options.cause] The error that caused this error.
	 * @param {string} [options.message] The message to use for the error.
	 */
	constructor(name, index, { cause, message }) {
		const finalMessage = message || cause.message;

		super(`Config ${name}: ${finalMessage}`, { cause });

		// copy over custom properties that aren't represented
		if (cause) {
			for (const key of Object.keys(cause)) {
				if (!(key in this)) {
					this[key] = cause[key];
				}
			}
		}

		/**
		 * The name of the error.
		 * @type {string}
		 * @readonly
		 */
		this.name = "ConfigError";

		/**
		 * The index of the config object in the array.
		 * @type {number}
		 * @readonly
		 */
		this.index = index;
	}
}

/**
 * Gets the name of a config object.
 * @param {ConfigObject} config The config object to get the name of.
 * @returns {string} The name of the config object.
 */
function getConfigName(config) {
	if (config && typeof config.name === "string" && config.name) {
		return `"${config.name}"`;
	}

	return "(unnamed)";
}

/**
 * Rethrows a config error with additional information about the config object.
 * @param {ConfigObject} config The config object to get the name of.
 * @param {number} index The index of the config object in the array.
 * @param {Error} error The error to rethrow.
 * @throws {ConfigError} When the error is rethrown for a config.
 */
function rethrowConfigError(config, index, error) {
	const configName = getConfigName(config);
	throw new ConfigError(configName, index, { cause: error });
}

/**
 * Shorthand for checking if a value is a string.
 * @param {any} value The value to check.
 * @returns {value is string} True if a string, false if not.
 */
function isString(value) {
	return typeof value === "string";
}

/**
 * Creates a function that asserts that the config is valid
 * during normalization. This checks that the config is not nullish
 * and that files and ignores keys  of a config object are valid as per base schema.
 * @param {Object} config The config object to check.
 * @param {number} index The index of the config object in the array.
 * @returns {void}
 * @throws {ConfigError} If the files and ignores keys of a config object are not valid.
 */
function assertValidBaseConfig(config, index) {
	if (config === null) {
		throw new ConfigError(getConfigName(config), index, {
			message: "Unexpected null config.",
		});
	}

	if (config === undefined) {
		throw new ConfigError(getConfigName(config), index, {
			message: "Unexpected undefined config.",
		});
	}

	if (typeof config !== "object") {
		throw new ConfigError(getConfigName(config), index, {
			message: "Unexpected non-object config.",
		});
	}

	const validateConfig = {};

	if ("basePath" in config) {
		validateConfig.basePath = config.basePath;
	}

	if ("files" in config) {
		validateConfig.files = config.files;
	}

	if ("ignores" in config) {
		validateConfig.ignores = config.ignores;
	}

	try {
		FILES_AND_IGNORES_SCHEMA.validate(validateConfig);
	} catch (validationError) {
		rethrowConfigError(config, index, validationError);
	}
}

/**
 * Wrapper around minimatch that caches minimatch patterns for
 * faster matching speed over multiple file path evaluations.
 * @param {string} filepath The file path to match.
 * @param {string} pattern The glob pattern to match against.
 * @param {MinimatchOptions} options The minimatch options to use.
 * @returns {boolean} True if the file path matches, false if not.
 */
function doMatch(filepath, pattern, options = {}) {
	let cache = minimatchCache;

	if (options.flipNegate) {
		cache = negatedMinimatchCache;
	}

	let matcher = cache.get(pattern);

	if (!matcher) {
		matcher = new minimatch.Minimatch(
			pattern,
			Object.assign({}, MINIMATCH_OPTIONS, options),
		);
		cache.set(pattern, matcher);
	}

	return matcher.match(filepath);
}

/**
 * Normalizes a pattern by removing the leading "./" if present.
 * @param {FileMatcher} pattern The pattern to normalize.
 * @returns {FileMatcher} The normalized pattern.
 */
function normalizePattern(pattern) {
	if (isString(pattern)) {
		if (pattern.startsWith("./")) {
			return pattern.slice(2);
		}

		if (pattern.startsWith("!./")) {
			return `!${pattern.slice(3)}`;
		}
	}

	return pattern;
}

/**
 * Checks if a given pattern requires normalization.
 * @param {any} pattern The pattern to check.
 * @returns {boolean} True if the pattern needs normalization, false otherwise.
 *
 */
function needsPatternNormalization(pattern) {
	return (
		isString(pattern) &&
		(pattern.startsWith("./") || pattern.startsWith("!./"))
	);
}

/**
 * Normalizes `files` and `ignores` patterns in a config by removing "./" prefixes.
 * @param {Object} config The config object to normalize patterns in.
 * @param {string} namespacedBasePath The namespaced base path of the directory to which config base path is relative.
 * @param {PathImpl} path Path-handling implementation.
 * @returns {Object} The normalized config object.
 */
function normalizeConfigPatterns(config, namespacedBasePath, path) {
	if (!config) {
		return config;
	}

	const hasBasePath = typeof config.basePath === "string";

	let needsNormalization = false;

	if (hasBasePath) {
		needsNormalization = true;
	}

	if (!needsNormalization && Array.isArray(config.files)) {
		needsNormalization = config.files.some(pattern => {
			if (Array.isArray(pattern)) {
				return pattern.some(needsPatternNormalization);
			}
			return needsPatternNormalization(pattern);
		});
	}

	if (!needsNormalization && Array.isArray(config.ignores)) {
		needsNormalization = config.ignores.some(needsPatternNormalization);
	}

	if (!needsNormalization) {
		return config;
	}

	const newConfig = { ...config };

	if (hasBasePath) {
		if (path.isAbsolute(config.basePath)) {
			newConfig.basePath = path.toNamespacedPath(config.basePath);
		} else {
			newConfig.basePath = path.resolve(
				namespacedBasePath,
				config.basePath,
			);
		}
	}

	if (Array.isArray(newConfig.files)) {
		newConfig.files = newConfig.files.map(pattern => {
			if (Array.isArray(pattern)) {
				return pattern.map(normalizePattern);
			}
			return normalizePattern(pattern);
		});
	}

	if (Array.isArray(newConfig.ignores)) {
		newConfig.ignores = newConfig.ignores.map(normalizePattern);
	}

	return newConfig;
}

/**
 * Normalizes a `ConfigArray` by flattening it and executing any functions
 * that are found inside.
 * @param {Array} items The items in a `ConfigArray`.
 * @param {Object} context The context object to pass into any function
 *      found.
 * @param {ReadonlyArray<ExtraConfigType>} extraConfigTypes The config types to check.
 * @param {string} namespacedBasePath The namespaced base path of the directory to which config base paths are relative.
 * @param {PathImpl} path Path-handling implementation.
 * @returns {Promise<Array>} A flattened array containing only config objects.
 * @throws {TypeError} When a config function returns a function.
 */
async function normalize(
	items,
	context,
	extraConfigTypes,
	namespacedBasePath,
	path,
) {
	const allowFunctions = extraConfigTypes.includes("function");
	const allowArrays = extraConfigTypes.includes("array");

	async function* flatTraverse(array) {
		for (let item of array) {
			if (typeof item === "function") {
				if (!allowFunctions) {
					throw new TypeError("Unexpected function.");
				}

				item = item(context);
				if (item.then) {
					item = await item;
				}
			}

			if (Array.isArray(item)) {
				if (!allowArrays) {
					throw new TypeError("Unexpected array.");
				}
				yield* flatTraverse(item);
			} else if (typeof item === "function") {
				throw new TypeError(
					"A config function can only return an object or array.",
				);
			} else {
				yield item;
			}
		}
	}

	/*
	 * Async iterables cannot be used with the spread operator, so we need to manually
	 * create the array to return.
	 */
	const asyncIterable = flatTraverse(items);
	const configs = [];

	for await (const config of asyncIterable) {
		configs.push(normalizeConfigPatterns(config, namespacedBasePath, path));
	}

	return configs;
}

/**
 * Normalizes a `ConfigArray` by flattening it and executing any functions
 * that are found inside.
 * @param {Array} items The items in a `ConfigArray`.
 * @param {Object} context The context object to pass into any function
 *      found.
 * @param {ReadonlyArray<ExtraConfigType>} extraConfigTypes The config types to check.
 * @param {string} namespacedBasePath The namespaced base path of the directory to which config base paths are relative.
 * @param {PathImpl} path Path-handling implementation
 * @returns {Array} A flattened array containing only config objects.
 * @throws {TypeError} When a config function returns a function.
 */
function normalizeSync(
	items,
	context,
	extraConfigTypes,
	namespacedBasePath,
	path,
) {
	const allowFunctions = extraConfigTypes.includes("function");
	const allowArrays = extraConfigTypes.includes("array");

	function* flatTraverse(array) {
		for (let item of array) {
			if (typeof item === "function") {
				if (!allowFunctions) {
					throw new TypeError("Unexpected function.");
				}

				item = item(context);
				if (item.then) {
					throw new TypeError(
						"Async config functions are not supported.",
					);
				}
			}

			if (Array.isArray(item)) {
				if (!allowArrays) {
					throw new TypeError("Unexpected array.");
				}

				yield* flatTraverse(item);
			} else if (typeof item === "function") {
				throw new TypeError(
					"A config function can only return an object or array.",
				);
			} else {
				yield item;
			}
		}
	}

	const configs = [];

	for (const config of flatTraverse(items)) {
		configs.push(normalizeConfigPatterns(config, namespacedBasePath, path));
	}

	return configs;
}

/**
 * Converts a given path to a relative path with all separator characters replaced by forward slashes (`"/"`).
 * @param {string} fileOrDirPath The unprocessed path to convert.
 * @param {string} namespacedBasePath The namespaced base path of the directory to which the calculated path shall be relative.
 * @param {PathImpl} path Path-handling implementations.
 * @returns {string} A relative path with all separator characters replaced by forward slashes.
 */
function toRelativePath(fileOrDirPath, namespacedBasePath, path) {
	const fullPath = path.resolve(namespacedBasePath, fileOrDirPath);
	const namespacedFullPath = path.toNamespacedPath(fullPath);
	const relativePath = path.relative(namespacedBasePath, namespacedFullPath);
	return relativePath.replaceAll(path.SEPARATOR, "/");
}

/**
 * Determines if a given file path should be ignored based on the given
 * matcher.
 * @param {Array<{ basePath?: string, ignores: FileMatcher[] }>} configs Configuration objects containing `ignores`.
 * @param {string} filePath The unprocessed file path to check.
 * @param {string} relativeFilePath The path of the file to check relative to the base path,
 * 		using forward slash (`"/"`) as a separator.
 * @param {Object} [basePathData] Additional data needed to recalculate paths for configuration objects
 *  	that have `basePath` property.
 * @param {string} [basePathData.basePath] Namespaced path to which `relativeFilePath` is relative.
 * @param {PathImpl} [basePathData.path] Path-handling implementation.
 * @returns {boolean} True if the path should be ignored and false if not.
 */
function shouldIgnorePath(
	configs,
	filePath,
	relativeFilePath,
	{ basePath, path } = {},
) {
	let shouldIgnore = false;

	for (const config of configs) {
		let relativeFilePathToCheck = relativeFilePath;
		if (config.basePath) {
			relativeFilePathToCheck = toRelativePath(
				path.resolve(basePath, relativeFilePath),
				config.basePath,
				path,
			);

			if (
				relativeFilePathToCheck === "" ||
				EXTERNAL_PATH_REGEX.test(relativeFilePathToCheck)
			) {
				continue;
			}

			if (relativeFilePath.endsWith("/")) {
				relativeFilePathToCheck += "/";
			}
		}
		shouldIgnore = config.ignores.reduce((ignored, matcher) => {
			if (!ignored) {
				if (typeof matcher === "function") {
					return matcher(filePath);
				}

				// don't check negated patterns because we're not ignored yet
				if (!matcher.startsWith("!")) {
					return doMatch(relativeFilePathToCheck, matcher);
				}

				// otherwise we're still not ignored
				return false;
			}

			// only need to check negated patterns because we're ignored
			if (typeof matcher === "string" && matcher.startsWith("!")) {
				return !doMatch(relativeFilePathToCheck, matcher, {
					flipNegate: true,
				});
			}

			return ignored;
		}, shouldIgnore);
	}

	return shouldIgnore;
}

/**
 * Determines if a given file path is matched by a config. If the config
 * has no `files` field, then it matches; otherwise, if a `files` field
 * is present then we match the globs in `files` and exclude any globs in
 * `ignores`.
 * @param {string} filePath The unprocessed file path to check.
 * @param {string} relativeFilePath The path of the file to check relative to the base path,
 * 		using forward slash (`"/"`) as a separator.
 * @param {ConfigObject & { files: FilesMatcher[] }} config The config object to check.
 * @returns {boolean} True if the file path is matched by the config,
 *      false if not.
 */
function pathMatches(filePath, relativeFilePath, config) {
	// match both strings and functions
	function match(pattern) {
		if (isString(pattern)) {
			return doMatch(relativeFilePath, pattern);
		}

		if (typeof pattern === "function") {
			return pattern(filePath);
		}

		throw new TypeError(`Unexpected matcher type ${pattern}.`);
	}

	// check for all matches to config.files
	let filePathMatchesPattern = config.files.some(pattern => {
		if (Array.isArray(pattern)) {
			return pattern.every(match);
		}

		return match(pattern);
	});

	/*
	 * If the file path matches the config.files patterns, then check to see
	 * if there are any files to ignore.
	 */
	if (filePathMatchesPattern && config.ignores) {
		/*
		 * Pass config object without `basePath`, because `relativeFilePath` is already
		 * calculated as relative to it.
		 */
		filePathMatchesPattern = !shouldIgnorePath(
			[{ ignores: config.ignores }],
			filePath,
			relativeFilePath,
		);
	}

	return filePathMatchesPattern;
}

/**
 * Ensures that a ConfigArray has been normalized.
 * @param {ConfigArray} configArray The ConfigArray to check.
 * @returns {void}
 * @throws {Error} When the `ConfigArray` is not normalized.
 */
function assertNormalized(configArray) {
	// TODO: Throw more verbose error
	if (!configArray.isNormalized()) {
		throw new Error(
			"ConfigArray must be normalized to perform this operation.",
		);
	}
}

/**
 * Ensures that config types are valid.
 * @param {ReadonlyArray<ExtraConfigType>} extraConfigTypes The config types to check.
 * @returns {void}
 * @throws {TypeError} When the config types array is invalid.
 */
function assertExtraConfigTypes(extraConfigTypes) {
	if (!Array.isArray(extraConfigTypes)) {
		throw new TypeError("extraConfigTypes must be an array.");
	}

	if (extraConfigTypes.length > 2) {
		throw new TypeError("extraConfigTypes must contain at most two items.");
	}

	for (const configType of extraConfigTypes) {
		if (!CONFIG_TYPES.has(configType)) {
			throw new TypeError(
				`Unexpected config type "${configType}" in extraConfigTypes. Expected one of: "array", "function".`,
			);
		}
	}
}

/**
 * Returns path-handling implementations for Unix or Windows, depending on a given absolute path.
 * @param {string} fileOrDirPath The absolute path to check.
 * @returns {PathImpl} Path-handling implementations for the specified path.
 * @throws {Error} An error is thrown if the specified argument is not an absolute path.
 */
function getPathImpl(fileOrDirPath) {
	// Posix absolute paths always start with a slash.
	if (fileOrDirPath.startsWith("/")) {
		return posixPath__namespace;
	}

	// Windows absolute paths start with a letter followed by a colon and at least one backslash,
	// or with two backslashes in the case of UNC paths.
	// Forward slashed are automatically normalized to backslashes.
	if (/^(?:[A-Za-z]:[/\\]|[/\\]{2})/u.test(fileOrDirPath)) {
		return windowsPath__namespace;
	}

	throw new Error(
		`Expected an absolute path but received "${fileOrDirPath}"`,
	);
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

const ConfigArraySymbol = {
	isNormalized: Symbol("isNormalized"),
	configCache: Symbol("configCache"),
	schema: Symbol("schema"),
	finalizeConfig: Symbol("finalizeConfig"),
	preprocessConfig: Symbol("preprocessConfig"),
};

// used to store calculate data for faster lookup
const dataCache = new WeakMap();

/**
 * Represents an array of config objects and provides method for working with
 * those config objects.
 */
class ConfigArray extends Array {
	/**
	 * The namespaced path of the config file directory.
	 * @type {string}
	 */
	#namespacedBasePath;

	/**
	 * Path-handling implementations.
	 * @type {PathImpl}
	 */
	#path;

	/**
	 * Creates a new instance of ConfigArray.
	 * @param {Iterable|Function|Object} configs An iterable yielding config
	 *      objects, or a config function, or a config object.
	 * @param {Object} options The options for the ConfigArray.
	 * @param {string} [options.basePath="/"] The absolute path of the config file directory.
	 * 		Defaults to `"/"`.
	 * @param {boolean} [options.normalized=false] Flag indicating if the
	 *      configs have already been normalized.
	 * @param {ObjectDefinition} [options.schema] The additional schema
	 *      definitions to use for the ConfigArray schema.
	 * @param {ReadonlyArray<ExtraConfigType>} [options.extraConfigTypes] List of config types supported.
	 * @throws {TypeError} When the `basePath` is not a non-empty string,
	 */
	constructor(
		configs,
		{
			basePath = "/",
			normalized = false,
			schema: customSchema,
			extraConfigTypes = [],
		} = {},
	) {
		super();

		/**
		 * Tracks if the array has been normalized.
		 * @property isNormalized
		 * @type {boolean}
		 * @private
		 */
		this[ConfigArraySymbol.isNormalized] = normalized;

		/**
		 * The schema used for validating and merging configs.
		 * @property schema
		 * @type {ObjectSchemaInstance}
		 * @private
		 */
		this[ConfigArraySymbol.schema] = new objectSchema.ObjectSchema(
			Object.assign({}, customSchema, baseSchema),
		);

		if (!isString(basePath) || !basePath) {
			throw new TypeError("basePath must be a non-empty string");
		}

		/**
		 * The path of the config file that this array was loaded from.
		 * This is used to calculate filename matches.
		 * @property basePath
		 * @type {string}
		 */
		this.basePath = basePath;

		assertExtraConfigTypes(extraConfigTypes);

		/**
		 * The supported config types.
		 * @type {ReadonlyArray<ExtraConfigType>}
		 */
		this.extraConfigTypes = [...extraConfigTypes];
		Object.freeze(this.extraConfigTypes);

		/**
		 * A cache to store calculated configs for faster repeat lookup.
		 * @property configCache
		 * @type {Map<string, Object>}
		 * @private
		 */
		this[ConfigArraySymbol.configCache] = new Map();

		// init cache
		dataCache.set(this, {
			explicitMatches: new Map(),
			directoryMatches: new Map(),
			files: undefined,
			ignores: undefined,
		});

		// load the configs into this array
		if (Array.isArray(configs)) {
			this.push(...configs);
		} else {
			this.push(configs);
		}

		// select path-handling implementations depending on the base path
		this.#path = getPathImpl(basePath);

		// On Windows, `path.relative()` returns an absolute path when given two paths on different drives.
		// The namespaced base path is useful to make sure that calculated relative paths are always relative.
		// On Unix, it is identical to the base path.
		this.#namespacedBasePath = this.#path.toNamespacedPath(basePath);
	}

	/**
	 * Prevent normal array methods from creating a new `ConfigArray` instance.
	 * This is to ensure that methods such as `slice()` won't try to create a
	 * new instance of `ConfigArray` behind the scenes as doing so may throw
	 * an error due to the different constructor signature.
	 * @type {ArrayConstructor} The `Array` constructor.
	 */
	static get [Symbol.species]() {
		return Array;
	}

	/**
	 * Returns the `files` globs from every config object in the array.
	 * This can be used to determine which files will be matched by a
	 * config array or to use as a glob pattern when no patterns are provided
	 * for a command line interface.
	 * @returns {Array<FilesMatcher>} An array of matchers.
	 */
	get files() {
		assertNormalized(this);

		// if this data has been cached, retrieve it
		const cache = dataCache.get(this);

		if (cache.files) {
			return cache.files;
		}

		// otherwise calculate it

		const result = [];

		for (const config of this) {
			if (config.files) {
				config.files.forEach(filePattern => {
					result.push(filePattern);
				});
			}
		}

		// store result
		cache.files = result;
		dataCache.set(this, cache);

		return result;
	}

	/**
	 * Returns ignore matchers that should always be ignored regardless of
	 * the matching `files` fields in any configs. This is necessary to mimic
	 * the behavior of things like .gitignore and .eslintignore, allowing a
	 * globbing operation to be faster.
	 * @returns {Array<{ basePath?: string, name?: string, ignores: FileMatcher[] }>} An array of config objects representing global ignores.
	 */
	get ignores() {
		assertNormalized(this);

		// if this data has been cached, retrieve it
		const cache = dataCache.get(this);

		if (cache.ignores) {
			return cache.ignores;
		}

		// otherwise calculate it

		const result = [];

		for (const config of this) {
			/*
			 * We only count ignores if there are no other keys in the object.
			 * In this case, it acts like a globally ignored pattern. If there
			 * are additional keys, then ignores act like exclusions.
			 */
			if (
				config.ignores &&
				Object.keys(config).filter(key => !META_FIELDS.has(key))
					.length === 1
			) {
				result.push(config);
			}
		}

		// store result
		cache.ignores = result;
		dataCache.set(this, cache);

		return result;
	}

	/**
	 * Indicates if the config array has been normalized.
	 * @returns {boolean} True if the config array is normalized, false if not.
	 */
	isNormalized() {
		return this[ConfigArraySymbol.isNormalized];
	}

	/**
	 * Normalizes a config array by flattening embedded arrays and executing
	 * config functions.
	 * @param {Object} [context] The context object for config functions.
	 * @returns {Promise<ConfigArray>} The current ConfigArray instance.
	 */
	async normalize(context = {}) {
		if (!this.isNormalized()) {
			const normalizedConfigs = await normalize(
				this,
				context,
				this.extraConfigTypes,
				this.#namespacedBasePath,
				this.#path,
			);
			this.length = 0;
			this.push(
				...normalizedConfigs.map(
					this[ConfigArraySymbol.preprocessConfig].bind(this),
				),
			);
			this.forEach(assertValidBaseConfig);
			this[ConfigArraySymbol.isNormalized] = true;

			// prevent further changes
			Object.freeze(this);
		}

		return this;
	}

	/**
	 * Normalizes a config array by flattening embedded arrays and executing
	 * config functions.
	 * @param {Object} [context] The context object for config functions.
	 * @returns {ConfigArray} The current ConfigArray instance.
	 */
	normalizeSync(context = {}) {
		if (!this.isNormalized()) {
			const normalizedConfigs = normalizeSync(
				this,
				context,
				this.extraConfigTypes,
				this.#namespacedBasePath,
				this.#path,
			);
			this.length = 0;
			this.push(
				...normalizedConfigs.map(
					this[ConfigArraySymbol.preprocessConfig].bind(this),
				),
			);
			this.forEach(assertValidBaseConfig);
			this[ConfigArraySymbol.isNormalized] = true;

			// prevent further changes
			Object.freeze(this);
		}

		return this;
	}

	/* eslint-disable class-methods-use-this -- Desired as instance methods */

	/**
	 * Finalizes the state of a config before being cached and returned by
	 * `getConfig()`. Does nothing by default but is provided to be
	 * overridden by subclasses as necessary.
	 * @param {Object} config The config to finalize.
	 * @returns {Object} The finalized config.
	 */
	// Cast key to `never` to prevent TypeScript from adding the signature `[x: symbol]: (config: any) => any` to the type of the class.
	[/** @type {never} */ (ConfigArraySymbol.finalizeConfig)](config) {
		return config;
	}

	/**
	 * Preprocesses a config during the normalization process. This is the
	 * method to override if you want to convert an array item before it is
	 * validated for the first time. For example, if you want to replace a
	 * string with an object, this is the method to override.
	 * @param {Object} config The config to preprocess.
	 * @returns {Object} The config to use in place of the argument.
	 */
	// Cast key to `never` to prevent TypeScript from adding the signature `[x: symbol]: (config: any) => any` to the type of the class.
	[/** @type {never} */ (ConfigArraySymbol.preprocessConfig)](config) {
		return config;
	}

	/* eslint-enable class-methods-use-this -- Desired as instance methods */

	/**
	 * Returns the config object for a given file path and a status that can be used to determine why a file has no config.
	 * @param {string} filePath The path of a file to get a config for.
	 * @returns {{ config?: Object, status: "ignored"|"external"|"unconfigured"|"matched" }}
	 * An object with an optional property `config` and property `status`.
	 * `config` is the config object for the specified file as returned by {@linkcode ConfigArray.getConfig},
	 * `status` a is one of the constants returned by {@linkcode ConfigArray.getConfigStatus}.
	 */
	getConfigWithStatus(filePath) {
		assertNormalized(this);

		const cache = this[ConfigArraySymbol.configCache];

		// first check the cache for a filename match to avoid duplicate work
		if (cache.has(filePath)) {
			return cache.get(filePath);
		}

		// check to see if the file is outside the base path

		const relativeToBaseFilePath = toRelativePath(
			filePath,
			this.#namespacedBasePath,
			this.#path,
		);

		if (EXTERNAL_PATH_REGEX.test(relativeToBaseFilePath)) {
			debug(`No config for file ${filePath} outside of base path`);

			// cache and return result
			cache.set(filePath, CONFIG_WITH_STATUS_EXTERNAL);
			return CONFIG_WITH_STATUS_EXTERNAL;
		}

		// next check to see if the file should be ignored

		// check if this should be ignored due to its directory
		if (this.isDirectoryIgnored(this.#path.dirname(filePath))) {
			debug(`Ignoring ${filePath} based on directory pattern`);

			// cache and return result
			cache.set(filePath, CONFIG_WITH_STATUS_IGNORED);
			return CONFIG_WITH_STATUS_IGNORED;
		}

		if (
			shouldIgnorePath(this.ignores, filePath, relativeToBaseFilePath, {
				basePath: this.#namespacedBasePath,
				path: this.#path,
			})
		) {
			debug(`Ignoring ${filePath} based on file pattern`);

			// cache and return result
			cache.set(filePath, CONFIG_WITH_STATUS_IGNORED);
			return CONFIG_WITH_STATUS_IGNORED;
		}

		// filePath isn't automatically ignored, so try to construct config

		const matchingConfigIndices = [];
		let matchFound = false;
		const universalPattern = /^\*$|^!|\/\*{1,2}$/u;

		this.forEach((config, index) => {
			const relativeFilePath = config.basePath
				? toRelativePath(
						this.#path.resolve(this.#namespacedBasePath, filePath),
						config.basePath,
						this.#path,
					)
				: relativeToBaseFilePath;

			if (config.basePath && EXTERNAL_PATH_REGEX.test(relativeFilePath)) {
				debug(
					`Skipped config found for ${filePath} (based on config's base path: ${config.basePath}`,
				);
				return;
			}

			if (!config.files) {
				if (!config.ignores) {
					debug(`Universal config found for ${filePath}`);
					matchingConfigIndices.push(index);
					return;
				}

				if (
					Object.keys(config).filter(key => !META_FIELDS.has(key))
						.length === 1
				) {
					debug(
						`Skipped config found for ${filePath} (global ignores)`,
					);
					return;
				}

				/*
				 * Pass config object without `basePath`, because `relativeFilePath` is already
				 * calculated as relative to it.
				 */
				if (
					shouldIgnorePath(
						[{ ignores: config.ignores }],
						filePath,
						relativeFilePath,
					)
				) {
					debug(
						`Skipped config found for ${filePath} (based on ignores: ${config.ignores})`,
					);
					return;
				}

				debug(
					`Matching config found for ${filePath} (based on ignores: ${config.ignores})`,
				);
				matchingConfigIndices.push(index);
				return;
			}

			/*
			 * If a config has a files pattern * or patterns ending in /** or /*,
			 * and the filePath only matches those patterns, then the config is only
			 * applied if there is another config where the filePath matches
			 * a file with a specific extensions such as *.js.
			 */

			const nonUniversalFiles = [];
			const universalFiles = config.files.filter(element => {
				if (Array.isArray(element)) {
					/*
					 * filePath matches an element that is an array only if it matches
					 * all patterns in it (AND operation). Therefore, if there is at least
					 * one non-universal pattern in the array, and filePath matches the array,
					 * then we know for sure that filePath matches at least one non-universal
					 * pattern, so we can consider the entire array to be non-universal.
					 * In other words, all patterns in the array need to be universal
					 * for it to be considered universal.
					 */
					if (
						element.every(pattern => universalPattern.test(pattern))
					) {
						return true;
					}

					nonUniversalFiles.push(element);
					return false;
				}

				// element is a string

				if (universalPattern.test(element)) {
					return true;
				}

				nonUniversalFiles.push(element);
				return false;
			});

			// universal patterns were found so we need to check the config twice
			if (universalFiles.length) {
				debug("Universal files patterns found. Checking carefully.");

				// check that the config matches without the non-universal files first
				if (
					nonUniversalFiles.length &&
					pathMatches(filePath, relativeFilePath, {
						files: nonUniversalFiles,
						ignores: config.ignores,
					})
				) {
					debug(`Matching config found for ${filePath}`);
					matchingConfigIndices.push(index);
					matchFound = true;
					return;
				}

				// if there wasn't a match then check if it matches with universal files
				if (
					universalFiles.length &&
					pathMatches(filePath, relativeFilePath, {
						files: universalFiles,
						ignores: config.ignores,
					})
				) {
					debug(`Matching config found for ${filePath}`);
					matchingConfigIndices.push(index);
					return;
				}

				// if we make here, then there was no match
				return;
			}

			// the normal case
			if (pathMatches(filePath, relativeFilePath, config)) {
				debug(`Matching config found for ${filePath}`);
				matchingConfigIndices.push(index);
				matchFound = true;
			}
		});

		// if matching both files and ignores, there will be no config to create
		if (!matchFound) {
			debug(`No matching configs found for ${filePath}`);

			// cache and return result
			cache.set(filePath, CONFIG_WITH_STATUS_UNCONFIGURED);
			return CONFIG_WITH_STATUS_UNCONFIGURED;
		}

		// check to see if there is a config cached by indices
		const indicesKey = matchingConfigIndices.toString();
		let configWithStatus = cache.get(indicesKey);

		if (configWithStatus) {
			// also store for filename for faster lookup next time
			cache.set(filePath, configWithStatus);

			return configWithStatus;
		}

		// otherwise construct the config

		// eslint-disable-next-line array-callback-return, consistent-return -- rethrowConfigError always throws an error
		let finalConfig = matchingConfigIndices.reduce((result, index) => {
			try {
				return this[ConfigArraySymbol.schema].merge(
					result,
					this[index],
				);
			} catch (validationError) {
				rethrowConfigError(this[index], index, validationError);
			}
		}, {});

		finalConfig = this[ConfigArraySymbol.finalizeConfig](finalConfig);

		configWithStatus = Object.freeze({
			config: finalConfig,
			status: "matched",
		});
		cache.set(filePath, configWithStatus);
		cache.set(indicesKey, configWithStatus);

		return configWithStatus;
	}

	/**
	 * Returns the config object for a given file path.
	 * @param {string} filePath The path of a file to get a config for.
	 * @returns {Object|undefined} The config object for this file or `undefined`.
	 */
	getConfig(filePath) {
		return this.getConfigWithStatus(filePath).config;
	}

	/**
	 * Determines whether a file has a config or why it doesn't.
	 * @param {string} filePath The path of the file to check.
	 * @returns {"ignored"|"external"|"unconfigured"|"matched"} One of the following values:
	 * * `"ignored"`: the file is ignored
	 * * `"external"`: the file is outside the base path
	 * * `"unconfigured"`: the file is not matched by any config
	 * * `"matched"`: the file has a matching config
	 */
	getConfigStatus(filePath) {
		return this.getConfigWithStatus(filePath).status;
	}

	/**
	 * Determines if the given filepath is ignored based on the configs.
	 * @param {string} filePath The path of a file to check.
	 * @returns {boolean} True if the path is ignored, false if not.
	 * @deprecated Use `isFileIgnored` instead.
	 */
	isIgnored(filePath) {
		return this.isFileIgnored(filePath);
	}

	/**
	 * Determines if the given filepath is ignored based on the configs.
	 * @param {string} filePath The path of a file to check.
	 * @returns {boolean} True if the path is ignored, false if not.
	 */
	isFileIgnored(filePath) {
		return this.getConfigStatus(filePath) === "ignored";
	}

	/**
	 * Determines if the given directory is ignored based on the configs.
	 * This checks only default `ignores` that don't have `files` in the
	 * same config. A pattern such as `/foo` be considered to ignore the directory
	 * while a pattern such as `/foo/**` is not considered to ignore the
	 * directory because it is matching files.
	 * @param {string} directoryPath The path of a directory to check.
	 * @returns {boolean} True if the directory is ignored, false if not. Will
	 * 		return true for any directory that is not inside of `basePath`.
	 * @throws {Error} When the `ConfigArray` is not normalized.
	 */
	isDirectoryIgnored(directoryPath) {
		assertNormalized(this);

		const relativeDirectoryPath = toRelativePath(
			directoryPath,
			this.#namespacedBasePath,
			this.#path,
		);

		// basePath directory can never be ignored
		if (relativeDirectoryPath === "") {
			return false;
		}

		if (EXTERNAL_PATH_REGEX.test(relativeDirectoryPath)) {
			return true;
		}

		// first check the cache
		const cache = dataCache.get(this).directoryMatches;

		if (cache.has(relativeDirectoryPath)) {
			return cache.get(relativeDirectoryPath);
		}

		const directoryParts = relativeDirectoryPath.split("/");
		let relativeDirectoryToCheck = "";
		let result;

		/*
		 * In order to get the correct gitignore-style ignores, where an
		 * ignored parent directory cannot have any descendants unignored,
		 * we need to check every directory starting at the parent all
		 * the way down to the actual requested directory.
		 *
		 * We aggressively cache all of this info to make sure we don't
		 * have to recalculate everything for every call.
		 */
		do {
			relativeDirectoryToCheck += `${directoryParts.shift()}/`;

			result = shouldIgnorePath(
				this.ignores,
				this.#path.join(this.basePath, relativeDirectoryToCheck),
				relativeDirectoryToCheck,
				{
					basePath: this.#namespacedBasePath,
					path: this.#path,
				},
			);

			cache.set(relativeDirectoryToCheck, result);
		} while (!result && directoryParts.length);

		// also cache the result for the requested path
		cache.set(relativeDirectoryPath, result);

		return result;
	}
}

Object.defineProperty(exports, "ObjectSchema", {
	enumerable: true,
	get: function () { return objectSchema.ObjectSchema; }
});
exports.ConfigArray = ConfigArray;
exports.ConfigArraySymbol = ConfigArraySymbol;
}彻xBexport { ObjectSchema } from "@eslint/object-schema";
export type PropertyDefinition = $eslintobjectschema.PropertyDefinition;
export type ObjectDefinition = $eslintobjectschema.ObjectDefinition;
export type ConfigObject = $typests.ConfigObject;
export type FileMatcher = $typests.FileMatcher;
export type FilesMatcher = $typests.FilesMatcher;
export type ExtraConfigType = $typests.ExtraConfigType;
export type MinimatchOptions = $minimatch.MinimatchOptions;
export type ObjectSchemaInstance = ObjectSchema;
/**
 * Represents an array of config objects and provides method for working with
 * those config objects.
 */
export class ConfigArray extends Array<any> {
    /**
     * Creates a new instance of ConfigArray.
     * @param {Iterable|Function|Object} configs An iterable yielding config
     *      objects, or a config function, or a config object.
     * @param {Object} options The options for the ConfigArray.
     * @param {string} [options.basePath="/"] The absolute path of the config file directory.
     * 		Defaults to `"/"`.
     * @param {boolean} [options.normalized=false] Flag indicating if the
     *      configs have already been normalized.
     * @param {ObjectDefinition} [options.schema] The additional schema
     *      definitions to use for the ConfigArray schema.
     * @param {ReadonlyArray<ExtraConfigType>} [options.extraConfigTypes] List of config types supported.
     * @throws {TypeError} When the `basePath` is not a non-empty string,
     */
    constructor(configs: Iterable<any> | Function | any, { basePath, normalized, schema: customSchema, extraConfigTypes, }?: {
        basePath?: string;
        normalized?: boolean;
        schema?: ObjectDefinition;
        extraConfigTypes?: ReadonlyArray<ExtraConfigType>;
    });
    /**
     * The path of the config file that this array was loaded from.
     * This is used to calculate filename matches.
     * @property basePath
     * @type {string}
     */
    basePath: string;
    /**
     * The supported config types.
     * @type {ReadonlyArray<ExtraConfigType>}
     */
    extraConfigTypes: ReadonlyArray<ExtraConfigType>;
    /**
     * Returns the `files` globs from every config object in the array.
     * This can be used to determine which files will be matched by a
     * config array or to use as a glob pattern when no patterns are provided
     * for a command line interface.
     * @returns {Array<FilesMatcher>} An array of matchers.
     */
    get files(): Array<FilesMatcher>;
    /**
     * Returns ignore matchers that should always be ignored regardless of
     * the matching `files` fields in any configs. This is necessary to mimic
     * the behavior of things like .gitignore and .eslintignore, allowing a
     * globbing operation to be faster.
     * @returns {Array<{ basePath?: string, name?: string, ignores: FileMatcher[] }>} An array of config objects representing global ignores.
     */
    get ignores(): Array<{
        basePath?: string;
        name?: string;
        ignores: FileMatcher[];
    }>;
    /**
     * Indicates if the config array has been normalized.
     * @returns {boolean} True if the config array is normalized, false if not.
     */
    isNormalized(): boolean;
    /**
     * Normalizes a config array by flattening embedded arrays and executing
     * config functions.
     * @param {Object} [context] The context object for config functions.
     * @returns {Promise<ConfigArray>} The current ConfigArray instance.
     */
    normalize(context?: any): Promise<ConfigArray>;
    /**
     * Normalizes a config array by flattening embedded arrays and executing
     * config functions.
     * @param {Object} [context] The context object for config functions.
     * @returns {ConfigArray} The current ConfigArray instance.
     */
    normalizeSync(context?: any): ConfigArray;
    /**
     * Returns the config object for a given file path and a status that can be used to determine why a file has no config.
     * @param {string} filePath The path of a file to get a config for.
     * @returns {{ config?: Object, status: "ignored"|"external"|"unconfigured"|"matched" }}
     * An object with an optional property `config` and property `status`.
     * `config` is the config object for the specified file as returned by {@linkcode ConfigArray.getConfig},
     * `status` a is one of the constants returned by {@linkcode ConfigArray.getConfigStatus}.
     */
    getConfigWithStatus(filePath: string): {
        config?: any;
        status: "ignored" | "external" | "unconfigured" | "matched";
    };
    /**
     * Returns the config object for a given file path.
     * @param {string} filePath The path of a file to get a config for.
     * @returns {Object|undefined} The config object for this file or `undefined`.
     */
    getConfig(filePath: string): any | undefined;
    /**
     * Determines whether a file has a config or why it doesn't.
     * @param {string} filePath The path of the file to check.
     * @returns {"ignored"|"external"|"unconfigured"|"matched"} One of the following values:
     * * `"ignored"`: the file is ignored
     * * `"external"`: the file is outside the base path
     * * `"unconfigured"`: the file is not matched by any config
     * * `"matched"`: the file has a matching config
     */
    getConfigStatus(filePath: string): "ignored" | "external" | "unconfigured" | "matched";
    /**
     * Determines if the given filepath is ignored based on the configs.
     * @param {string} filePath The path of a file to check.
     * @returns {boolean} True if the path is ignored, false if not.
     * @deprecated Use `isFileIgnored` instead.
     */
    isIgnored(filePath: string): boolean;
    /**
     * Determines if the given filepath is ignored based on the configs.
     * @param {string} filePath The path of a file to check.
     * @returns {boolean} True if the path is ignored, false if not.
     */
    isFileIgnored(filePath: string): boolean;
    /**
     * Determines if the given directory is ignored based on the configs.
     * This checks only default `ignores` that don't have `files` in the
     * same config. A pattern such as `/foo` be considered to ignore the directory
     * while a pattern such as `/foo/**` is not considered to ignore the
     * directory because it is matching files.
     * @param {string} directoryPath The path of a directory to check.
     * @returns {boolean} True if the directory is ignored, false if not. Will
     * 		return true for any directory that is not inside of `basePath`.
     * @throws {Error} When the `ConfigArray` is not normalized.
     */
    isDirectoryIgnored(directoryPath: string): boolean;
    #private;
}
export namespace ConfigArraySymbol {
    let isNormalized: symbol;
    let configCache: symbol;
    let schema: symbol;
    let finalizeConfig: symbol;
    let preprocessConfig: symbol;
}
import type * as $eslintobjectschema from "@eslint/object-schema";
import type * as $typests from "./types.cts";
import type * as $minimatch from "minimatch";
import { ObjectSchema } from '@eslint/object-schema';
tb3IxL 100644 posix.cjs >2.
IFEaz100644 windows.cjs @[3՟;\xօx:	xק(X// @ts-nocheck
'use strict';

// Copyright 2018-2025 the Deno authors. MIT license.
// Copyright the Browserify authors. MIT License.
function assertPath(path) {
  if (typeof path !== "string") {
    throw new TypeError(`Path must be a string, received "${JSON.stringify(path)}"`);
  }
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function stripSuffix(name, suffix) {
  if (suffix.length >= name.length) {
    return name;
  }
  const lenDiff = name.length - suffix.length;
  for(let i = suffix.length - 1; i >= 0; --i){
    if (name.charCodeAt(lenDiff + i) !== suffix.charCodeAt(i)) {
      return name;
    }
  }
  return name.slice(0, -suffix.length);
}
function lastPathSegment(path, isSep, start = 0) {
  let matchedNonSeparator = false;
  let end = path.length;
  for(let i = path.length - 1; i >= start; --i){
    if (isSep(path.charCodeAt(i))) {
      if (matchedNonSeparator) {
        start = i + 1;
        break;
      }
    } else if (!matchedNonSeparator) {
      matchedNonSeparator = true;
      end = i + 1;
    }
  }
  return path.slice(start, end);
}
function assertArgs$1(path, suffix) {
  assertPath(path);
  if (path.length === 0) return path;
  if (typeof suffix !== "string") {
    throw new TypeError(`Suffix must be a string, received "${JSON.stringify(suffix)}"`);
  }
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function assertArg$3(url) {
  url = url instanceof URL ? url : new URL(url);
  if (url.protocol !== "file:") {
    throw new TypeError(`URL must be a file URL: received "${url.protocol}"`);
  }
  return url;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Converts a file URL to a path string.
 *
 * @example Usage
 * ```ts
 * import { fromFileUrl } from "@std/path/posix/from-file-url";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(fromFileUrl(new URL("file:///home/foo")), "/home/foo");
 * ```
 *
 * @param url The file URL to convert.
 * @returns The path string.
 */ function fromFileUrl(url) {
  url = assertArg$3(url);
  return decodeURIComponent(url.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"));
}

// Copyright 2018-2025 the Deno authors. MIT license.
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
// This module is browser compatible.
function stripTrailingSeparators(segment, isSep) {
  if (segment.length <= 1) {
    return segment;
  }
  let end = segment.length;
  for(let i = segment.length - 1; i > 0; i--){
    if (isSep(segment.charCodeAt(i))) {
      end = i;
    } else {
      break;
    }
  }
  return segment.slice(0, end);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
// This module is browser compatible.
// Alphabet chars.
// Non-alphabetic chars.
const CHAR_DOT = 46; /* . */ 
const CHAR_FORWARD_SLASH = 47; /* / */

// Copyright 2018-2025 the Deno authors. MIT license.
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
// This module is browser compatible.
function isPosixPathSeparator(code) {
  return code === CHAR_FORWARD_SLASH;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Return the last portion of a `path`.
 * Trailing directory separators are ignored, and optional suffix is removed.
 *
 * @example Usage
 * ```ts
 * import { basename } from "@std/path/posix/basename";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(basename("/home/user/Documents/"), "Documents");
 * assertEquals(basename("/home/user/Documents/image.png"), "image.png");
 * assertEquals(basename("/home/user/Documents/image.png", ".png"), "image");
 * assertEquals(basename(new URL("file:///home/user/Documents/image.png")), "image.png");
 * assertEquals(basename(new URL("file:///home/user/Documents/image.png"), ".png"), "image");
 * ```
 *
 * @example Working with URLs
 *
 * Note: This function doesn't automatically strip hash and query parts from
 * URLs. If your URL contains a hash or query, remove them before passing the
 * URL to the function. This can be done by passing the URL to `new URL(url)`,
 * and setting the `hash` and `search` properties to empty strings.
 *
 * ```ts
 * import { basename } from "@std/path/posix/basename";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(basename("https://deno.land/std/path/mod.ts"), "mod.ts");
 * assertEquals(basename("https://deno.land/std/path/mod.ts", ".ts"), "mod");
 * assertEquals(basename("https://deno.land/std/path/mod.ts?a=b"), "mod.ts?a=b");
 * assertEquals(basename("https://deno.land/std/path/mod.ts#header"), "mod.ts#header");
 * ```
 *
 * @param path The path to extract the name from.
 * @param suffix The suffix to remove from extracted name.
 * @returns The extracted name.
 */ function basename(path, suffix = "") {
  if (path instanceof URL) {
    path = fromFileUrl(path);
  }
  assertArgs$1(path, suffix);
  const lastSegment = lastPathSegment(path, isPosixPathSeparator);
  const strippedSegment = stripTrailingSeparators(lastSegment, isPosixPathSeparator);
  return suffix ? stripSuffix(strippedSegment, suffix) : strippedSegment;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * The character used to separate entries in the PATH environment variable.
 */ const DELIMITER = ":";
/**
 * The character used to separate components of a file path.
 */ const SEPARATOR = "/";
/**
 * A regular expression that matches one or more path separators.
 */ const SEPARATOR_PATTERN = /\/+/;

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function assertArg$2(path) {
  assertPath(path);
  if (path.length === 0) return ".";
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Return the directory path of a `path`.
 *
 * @example Usage
 * ```ts
 * import { dirname } from "@std/path/posix/dirname";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(dirname("/home/user/Documents/"), "/home/user");
 * assertEquals(dirname("/home/user/Documents/image.png"), "/home/user/Documents");
 * assertEquals(dirname("https://deno.land/std/path/mod.ts"), "https://deno.land/std/path");
 * assertEquals(dirname(new URL("file:///home/user/Documents/image.png")), "/home/user/Documents");
 * ```
 *
 * @example Working with URLs
 *
 * ```ts
 * import { dirname } from "@std/path/posix/dirname";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(dirname("https://deno.land/std/path/mod.ts"), "https://deno.land/std/path");
 * assertEquals(dirname("https://deno.land/std/path/mod.ts?a=b"), "https://deno.land/std/path");
 * assertEquals(dirname("https://deno.land/std/path/mod.ts#header"), "https://deno.land/std/path");
 * ```
 *
 * @param path The path to get the directory from.
 * @returns The directory path.
 */ function dirname(path) {
  if (path instanceof URL) {
    path = fromFileUrl(path);
  }
  assertArg$2(path);
  let end = -1;
  let matchedNonSeparator = false;
  for(let i = path.length - 1; i >= 1; --i){
    if (isPosixPathSeparator(path.charCodeAt(i))) {
      if (matchedNonSeparator) {
        end = i;
        break;
      }
    } else {
      matchedNonSeparator = true;
    }
  }
  // No matches. Fallback based on provided path:
  //
  // - leading slashes paths
  //     "/foo" => "/"
  //     "///foo" => "/"
  // - no slash path
  //     "foo" => "."
  if (end === -1) {
    return isPosixPathSeparator(path.charCodeAt(0)) ? "/" : ".";
  }
  return stripTrailingSeparators(path.slice(0, end), isPosixPathSeparator);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Return the extension of the `path` with leading period.
 *
 * @example Usage
 * ```ts
 * import { extname } from "@std/path/posix/extname";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(extname("/home/user/Documents/file.ts"), ".ts");
 * assertEquals(extname("/home/user/Documents/"), "");
 * assertEquals(extname("/home/user/Documents/image.png"), ".png");
 * assertEquals(extname(new URL("file:///home/user/Documents/file.ts")), ".ts");
 * assertEquals(extname(new URL("file:///home/user/Documents/file.ts?a=b")), ".ts");
 * assertEquals(extname(new URL("file:///home/user/Documents/file.ts#header")), ".ts");
 * ```
 *
 * @example Working with URLs
 *
 * Note: This function doesn't automatically strip hash and query parts from
 * URLs. If your URL contains a hash or query, remove them before passing the
 * URL to the function. This can be done by passing the URL to `new URL(url)`,
 * and setting the `hash` and `search` properties to empty strings.
 *
 * ```ts
 * import { extname } from "@std/path/posix/extname";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(extname("https://deno.land/std/path/mod.ts"), ".ts");
 * assertEquals(extname("https://deno.land/std/path/mod.ts?a=b"), ".ts?a=b");
 * assertEquals(extname("https://deno.land/std/path/mod.ts#header"), ".ts#header");
 * ```
 *
 * @param path The path to get the extension from.
 * @returns The extension (ex. for `file.ts` returns `.ts`).
 */ function extname(path) {
  if (path instanceof URL) {
    path = fromFileUrl(path);
  }
  assertPath(path);
  let startDot = -1;
  let startPart = 0;
  let end = -1;
  let matchedSlash = true;
  // Track the state of characters (if any) we see before our first dot and
  // after any path separator we find
  let preDotState = 0;
  for(let i = path.length - 1; i >= 0; --i){
    const code = path.charCodeAt(i);
    if (isPosixPathSeparator(code)) {
      // If we reached a path separator that was not part of a set of path
      // separators at the end of the string, stop now
      if (!matchedSlash) {
        startPart = i + 1;
        break;
      }
      continue;
    }
    if (end === -1) {
      // We saw the first non-path separator, mark this as the end of our
      // extension
      matchedSlash = false;
      end = i + 1;
    }
    if (code === CHAR_DOT) {
      // If this is our first dot, mark it as the start of our extension
      if (startDot === -1) startDot = i;
      else if (preDotState !== 1) preDotState = 1;
    } else if (startDot !== -1) {
      // We saw a non-dot and non-path separator before our dot, so we should
      // have a good chance at having a non-empty extension
      preDotState = -1;
    }
  }
  if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
  preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
  preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
    return "";
  }
  return path.slice(startDot, end);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function _format(sep, pathObject) {
  const dir = pathObject.dir || pathObject.root;
  const base = pathObject.base || (pathObject.name ?? "") + (pathObject.ext ?? "");
  if (!dir) return base;
  if (base === sep) return dir;
  if (dir === pathObject.root) return dir + base;
  return dir + sep + base;
}
function assertArg$1(pathObject) {
  if (pathObject === null || typeof pathObject !== "object") {
    throw new TypeError(`The "pathObject" argument must be of type Object, received type "${typeof pathObject}"`);
  }
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Generate a path from `ParsedPath` object.
 *
 * @example Usage
 * ```ts
 * import { format } from "@std/path/posix/format";
 * import { assertEquals } from "@std/assert";
 *
 * const path = format({
 *   root: "/",
 *   dir: "/path/dir",
 *   base: "file.txt",
 *   ext: ".txt",
 *   name: "file"
 * });
 * assertEquals(path, "/path/dir/file.txt");
 * ```
 *
 * @param pathObject The path object to format.
 * @returns The formatted path.
 */ function format(pathObject) {
  assertArg$1(pathObject);
  return _format("/", pathObject);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Verifies whether provided path is absolute.
 *
 * @example Usage
 * ```ts
 * import { isAbsolute } from "@std/path/posix/is-absolute";
 * import { assert, assertFalse } from "@std/assert";
 *
 * assert(isAbsolute("/home/user/Documents/"));
 * assertFalse(isAbsolute("home/user/Documents/"));
 * ```
 *
 * @param path The path to verify.
 * @returns Whether the path is absolute.
 */ function isAbsolute(path) {
  assertPath(path);
  return path.length > 0 && isPosixPathSeparator(path.charCodeAt(0));
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function assertArg(path) {
  assertPath(path);
  if (path.length === 0) return ".";
}

// Copyright 2018-2025 the Deno authors. MIT license.
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
// This module is browser compatible.
// Resolves . and .. elements in a path with directory names
function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
  let res = "";
  let lastSegmentLength = 0;
  let lastSlash = -1;
  let dots = 0;
  let code;
  for(let i = 0; i <= path.length; ++i){
    if (i < path.length) code = path.charCodeAt(i);
    else if (isPathSeparator(code)) break;
    else code = CHAR_FORWARD_SLASH;
    if (isPathSeparator(code)) {
      if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) {
        if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) {
          if (res.length > 2) {
            const lastSlashIndex = res.lastIndexOf(separator);
            if (lastSlashIndex === -1) {
              res = "";
              lastSegmentLength = 0;
            } else {
              res = res.slice(0, lastSlashIndex);
              lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);
            }
            lastSlash = i;
            dots = 0;
            continue;
          } else if (res.length === 2 || res.length === 1) {
            res = "";
            lastSegmentLength = 0;
            lastSlash = i;
            dots = 0;
            continue;
          }
        }
        if (allowAboveRoot) {
          if (res.length > 0) res += `${separator}..`;
          else res = "..";
          lastSegmentLength = 2;
        }
      } else {
        if (res.length > 0) res += separator + path.slice(lastSlash + 1, i);
        else res = path.slice(lastSlash + 1, i);
        lastSegmentLength = i - lastSlash - 1;
      }
      lastSlash = i;
      dots = 0;
    } else if (code === CHAR_DOT && dots !== -1) {
      ++dots;
    } else {
      dots = -1;
    }
  }
  return res;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Normalize the `path`, resolving `'..'` and `'.'` segments.
 * Note that resolving these segments does not necessarily mean that all will be eliminated.
 * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
 *
 * @example Usage
 * ```ts
 * import { normalize } from "@std/path/posix/normalize";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(normalize("/foo/bar//baz/asdf/quux/.."), "/foo/bar/baz/asdf");
 * assertEquals(normalize(new URL("file:///foo/bar//baz/asdf/quux/..")), "/foo/bar/baz/asdf/");
 * ```
 *
 * @example Working with URLs
 *
 * Note: This function will remove the double slashes from a URL's scheme.
 * Hence, do not pass a full URL to this function. Instead, pass the pathname of
 * the URL.
 *
 * ```ts
 * import { normalize } from "@std/path/posix/normalize";
 * import { assertEquals } from "@std/assert";
 *
 * const url = new URL("https://deno.land");
 * url.pathname = normalize("//std//assert//.//mod.ts");
 * assertEquals(url.href, "https://deno.land/std/assert/mod.ts");
 *
 * url.pathname = normalize("std/assert/../async/retry.ts");
 * assertEquals(url.href, "https://deno.land/std/async/retry.ts");
 * ```
 *
 * @param path The path to normalize.
 * @returns The normalized path.
 */ function normalize(path) {
  if (path instanceof URL) {
    path = fromFileUrl(path);
  }
  assertArg(path);
  const isAbsolute = isPosixPathSeparator(path.charCodeAt(0));
  const trailingSeparator = isPosixPathSeparator(path.charCodeAt(path.length - 1));
  // Normalize the path
  path = normalizeString(path, !isAbsolute, "/", isPosixPathSeparator);
  if (path.length === 0 && !isAbsolute) path = ".";
  if (path.length > 0 && trailingSeparator) path += "/";
  if (isAbsolute) return `/${path}`;
  return path;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Join all given a sequence of `paths`,then normalizes the resulting path.
 *
 * @example Usage
 * ```ts
 * import { join } from "@std/path/posix/join";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(join("/foo", "bar", "baz/asdf", "quux", ".."), "/foo/bar/baz/asdf");
 * assertEquals(join(new URL("file:///foo"), "bar", "baz/asdf", "quux", ".."), "/foo/bar/baz/asdf");
 * ```
 *
 * @example Working with URLs
 * ```ts
 * import { join } from "@std/path/posix/join";
 * import { assertEquals } from "@std/assert";
 *
 * const url = new URL("https://deno.land");
 * url.pathname = join("std", "path", "mod.ts");
 * assertEquals(url.href, "https://deno.land/std/path/mod.ts");
 *
 * url.pathname = join("//std", "path/", "/mod.ts");
 * assertEquals(url.href, "https://deno.land/std/path/mod.ts");
 * ```
 *
 * @param path The path to join. This can be string or file URL.
 * @param paths The paths to join.
 * @returns The joined path.
 */ function join(path, ...paths) {
  if (path === undefined) return ".";
  if (path instanceof URL) {
    path = fromFileUrl(path);
  }
  paths = path ? [
    path,
    ...paths
  ] : paths;
  paths.forEach((path)=>assertPath(path));
  const joined = paths.filter((path)=>path.length > 0).join("/");
  return joined === "" ? "." : normalize(joined);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Return a `ParsedPath` object of the `path`.
 *
 * @example Usage
 * ```ts
 * import { parse } from "@std/path/posix/parse";
 * import { assertEquals } from "@std/assert";
 *
 * const path = parse("/home/user/file.txt");
 * assertEquals(path, {
 *   root: "/",
 *   dir: "/home/user",
 *   base: "file.txt",
 *   ext: ".txt",
 *   name: "file"
 * });
 * ```
 *
 * @param path The path to parse.
 * @returns The parsed path object.
 */ function parse(path) {
  assertPath(path);
  const ret = {
    root: "",
    dir: "",
    base: "",
    ext: "",
    name: ""
  };
  if (path.length === 0) return ret;
  const isAbsolute = isPosixPathSeparator(path.charCodeAt(0));
  let start;
  if (isAbsolute) {
    ret.root = "/";
    start = 1;
  } else {
    start = 0;
  }
  let startDot = -1;
  let startPart = 0;
  let end = -1;
  let matchedSlash = true;
  let i = path.length - 1;
  // Track the state of characters (if any) we see before our first dot and
  // after any path separator we find
  let preDotState = 0;
  // Get non-dir info
  for(; i >= start; --i){
    const code = path.charCodeAt(i);
    if (isPosixPathSeparator(code)) {
      // If we reached a path separator that was not part of a set of path
      // separators at the end of the string, stop now
      if (!matchedSlash) {
        startPart = i + 1;
        break;
      }
      continue;
    }
    if (end === -1) {
      // We saw the first non-path separator, mark this as the end of our
      // extension
      matchedSlash = false;
      end = i + 1;
    }
    if (code === CHAR_DOT) {
      // If this is our first dot, mark it as the start of our extension
      if (startDot === -1) startDot = i;
      else if (preDotState !== 1) preDotState = 1;
    } else if (startDot !== -1) {
      // We saw a non-dot and non-path separator before our dot, so we should
      // have a good chance at having a non-empty extension
      preDotState = -1;
    }
  }
  if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
  preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
  preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
    if (end !== -1) {
      if (startPart === 0 && isAbsolute) {
        ret.base = ret.name = path.slice(1, end);
      } else {
        ret.base = ret.name = path.slice(startPart, end);
      }
    }
    // Fallback to '/' in case there is no basename
    ret.base = ret.base || "/";
  } else {
    if (startPart === 0 && isAbsolute) {
      ret.name = path.slice(1, startDot);
      ret.base = path.slice(1, end);
    } else {
      ret.name = path.slice(startPart, startDot);
      ret.base = path.slice(startPart, end);
    }
    ret.ext = path.slice(startDot, end);
  }
  if (startPart > 0) {
    ret.dir = stripTrailingSeparators(path.slice(0, startPart - 1), isPosixPathSeparator);
  } else if (isAbsolute) ret.dir = "/";
  return ret;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Resolves path segments into a `path`.
 *
 * @example Usage
 * ```ts
 * import { resolve } from "@std/path/posix/resolve";
 * import { assertEquals } from "@std/assert";
 *
 * const path = resolve("/foo", "bar", "baz/asdf", "quux", "..");
 * assertEquals(path, "/foo/bar/baz/asdf");
 * ```
 *
 * @param pathSegments The path segments to resolve.
 * @returns The resolved path.
 */ function resolve(...pathSegments) {
  let resolvedPath = "";
  let resolvedAbsolute = false;
  for(let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--){
    let path;
    if (i >= 0) path = pathSegments[i];
    else {
      // deno-lint-ignore no-explicit-any
      const { Deno } = globalThis;
      if (typeof Deno?.cwd !== "function") {
        throw new TypeError("Resolved a relative path without a current working directory (CWD)");
      }
      path = Deno.cwd();
    }
    assertPath(path);
    // Skip empty entries
    if (path.length === 0) {
      continue;
    }
    resolvedPath = `${path}/${resolvedPath}`;
    resolvedAbsolute = isPosixPathSeparator(path.charCodeAt(0));
  }
  // At this point the path should be resolved to a full absolute path, but
  // handle relative paths to be safe (might happen when Deno.cwd() fails)
  // Normalize the path
  resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, "/", isPosixPathSeparator);
  if (resolvedAbsolute) {
    if (resolvedPath.length > 0) return `/${resolvedPath}`;
    else return "/";
  } else if (resolvedPath.length > 0) return resolvedPath;
  else return ".";
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function assertArgs(from, to) {
  assertPath(from);
  assertPath(to);
  if (from === to) return "";
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Return the relative path from `from` to `to` based on current working directory.
 *
 * If `from` and `to` are the same, return an empty string.
 *
 * @example Usage
 * ```ts
 * import { relative } from "@std/path/posix/relative";
 * import { assertEquals } from "@std/assert";
 *
 * const path = relative("/data/orandea/test/aaa", "/data/orandea/impl/bbb");
 * assertEquals(path, "../../impl/bbb");
 * ```
 *
 * @param from The path to start from.
 * @param to The path to reach.
 * @returns The relative path.
 */ function relative(from, to) {
  assertArgs(from, to);
  from = resolve(from);
  to = resolve(to);
  if (from === to) return "";
  // Trim any leading backslashes
  let fromStart = 1;
  const fromEnd = from.length;
  for(; fromStart < fromEnd; ++fromStart){
    if (!isPosixPathSeparator(from.charCodeAt(fromStart))) break;
  }
  const fromLen = fromEnd - fromStart;
  // Trim any leading backslashes
  let toStart = 1;
  const toEnd = to.length;
  for(; toStart < toEnd; ++toStart){
    if (!isPosixPathSeparator(to.charCodeAt(toStart))) break;
  }
  const toLen = toEnd - toStart;
  // Compare paths to find the longest common path from root
  const length = fromLen < toLen ? fromLen : toLen;
  let lastCommonSep = -1;
  let i = 0;
  for(; i <= length; ++i){
    if (i === length) {
      if (toLen > length) {
        if (isPosixPathSeparator(to.charCodeAt(toStart + i))) {
          // We get here if `from` is the exact base path for `to`.
          // For example: from='/foo/bar'; to='/foo/bar/baz'
          return to.slice(toStart + i + 1);
        } else if (i === 0) {
          // We get here if `from` is the root
          // For example: from='/'; to='/foo'
          return to.slice(toStart + i);
        }
      } else if (fromLen > length) {
        if (isPosixPathSeparator(from.charCodeAt(fromStart + i))) {
          // We get here if `to` is the exact base path for `from`.
          // For example: from='/foo/bar/baz'; to='/foo/bar'
          lastCommonSep = i;
        } else if (i === 0) {
          // We get here if `to` is the root.
          // For example: from='/foo'; to='/'
          lastCommonSep = 0;
        }
      }
      break;
    }
    const fromCode = from.charCodeAt(fromStart + i);
    const toCode = to.charCodeAt(toStart + i);
    if (fromCode !== toCode) break;
    else if (isPosixPathSeparator(fromCode)) lastCommonSep = i;
  }
  let out = "";
  // Generate the relative path based on the path difference between `to`
  // and `from`
  for(i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i){
    if (i === fromEnd || isPosixPathSeparator(from.charCodeAt(i))) {
      if (out.length === 0) out += "..";
      else out += "/..";
    }
  }
  // Lastly, append the rest of the destination (`to`) path that comes after
  // the common path parts
  if (out.length > 0) return out + to.slice(toStart + lastCommonSep);
  else {
    toStart += lastCommonSep;
    if (isPosixPathSeparator(to.charCodeAt(toStart))) ++toStart;
    return to.slice(toStart);
  }
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
const WHITESPACE_ENCODINGS = {
  "\u0009": "%09",
  "\u000A": "%0A",
  "\u000B": "%0B",
  "\u000C": "%0C",
  "\u000D": "%0D",
  "\u0020": "%20"
};
function encodeWhitespace(string) {
  return string.replaceAll(/[\s]/g, (c)=>{
    return WHITESPACE_ENCODINGS[c] ?? c;
  });
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Converts a path string to a file URL.
 *
 * @example Usage
 * ```ts
 * import { toFileUrl } from "@std/path/posix/to-file-url";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(toFileUrl("/home/foo"), new URL("file:///home/foo"));
 * assertEquals(toFileUrl("/home/foo bar"), new URL("file:///home/foo%20bar"));
 * ```
 *
 * @param path The path to convert.
 * @returns The file URL.
 */ function toFileUrl(path) {
  if (!isAbsolute(path)) {
    throw new TypeError(`Path must be absolute: received "${path}"`);
  }
  const url = new URL("file:///");
  url.pathname = encodeWhitespace(path.replace(/%/g, "%25").replace(/\\/g, "%5C"));
  return url;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Converts a path to a namespaced path. This function returns the path as is on posix.
 *
 * @example Usage
 * ```ts
 * import { toNamespacedPath } from "@std/path/posix/to-namespaced-path";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(toNamespacedPath("/home/foo"), "/home/foo");
 * ```
 *
 * @param path The path.
 * @returns The namespaced path.
 */ function toNamespacedPath(path) {
  // Non-op on posix systems
  return path;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function common$1(paths, sep) {
  const [first = "", ...remaining] = paths;
  const parts = first.split(sep);
  let endOfPrefix = parts.length;
  let append = "";
  for (const path of remaining){
    const compare = path.split(sep);
    if (compare.length <= endOfPrefix) {
      endOfPrefix = compare.length;
      append = "";
    }
    for(let i = 0; i < endOfPrefix; i++){
      if (compare[i] !== parts[i]) {
        endOfPrefix = i;
        append = i === 0 ? "" : sep;
        break;
      }
    }
  }
  return parts.slice(0, endOfPrefix).join(sep) + append;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/** Determines the common path from a set of paths for POSIX systems.
 *
 * @example Usage
 * ```ts
 * import { common } from "@std/path/posix/common";
 * import { assertEquals } from "@std/assert";
 *
 * const path = common([
 *   "./deno/std/path/mod.ts",
 *   "./deno/std/fs/mod.ts",
 * ]);
 * assertEquals(path, "./deno/std/");
 * ```
 *
 * @param paths The paths to compare.
 * @returns The common path.
 */ function common(paths) {
  return common$1(paths, SEPARATOR);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Options for {@linkcode globToRegExp}, {@linkcode joinGlobs},
 * {@linkcode normalizeGlob} and {@linkcode expandGlob}.
 */ const REG_EXP_ESCAPE_CHARS = [
  "!",
  "$",
  "(",
  ")",
  "*",
  "+",
  ".",
  "=",
  "?",
  "[",
  "\\",
  "^",
  "{",
  "|"
];
const RANGE_ESCAPE_CHARS = [
  "-",
  "\\",
  "]"
];
function _globToRegExp(c, glob, { extended = true, globstar: globstarOption = true, // os = osType,
caseInsensitive = false } = {}) {
  if (glob === "") {
    return /(?!)/;
  }
  // Remove trailing separators.
  let newLength = glob.length;
  for(; newLength > 1 && c.seps.includes(glob[newLength - 1]); newLength--);
  glob = glob.slice(0, newLength);
  let regExpString = "";
  // Terminates correctly. Trust that `j` is incremented every iteration.
  for(let j = 0; j < glob.length;){
    let segment = "";
    const groupStack = [];
    let inRange = false;
    let inEscape = false;
    let endsWithSep = false;
    let i = j;
    // Terminates with `i` at the non-inclusive end of the current segment.
    for(; i < glob.length && !(c.seps.includes(glob[i]) && groupStack.length === 0); i++){
      if (inEscape) {
        inEscape = false;
        const escapeChars = inRange ? RANGE_ESCAPE_CHARS : REG_EXP_ESCAPE_CHARS;
        segment += escapeChars.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
        continue;
      }
      if (glob[i] === c.escapePrefix) {
        inEscape = true;
        continue;
      }
      if (glob[i] === "[") {
        if (!inRange) {
          inRange = true;
          segment += "[";
          if (glob[i + 1] === "!") {
            i++;
            segment += "^";
          } else if (glob[i + 1] === "^") {
            i++;
            segment += "\\^";
          }
          continue;
        } else if (glob[i + 1] === ":") {
          let k = i + 1;
          let value = "";
          while(glob[k + 1] !== undefined && glob[k + 1] !== ":"){
            value += glob[k + 1];
            k++;
          }
          if (glob[k + 1] === ":" && glob[k + 2] === "]") {
            i = k + 2;
            if (value === "alnum") segment += "\\dA-Za-z";
            else if (value === "alpha") segment += "A-Za-z";
            else if (value === "ascii") segment += "\x00-\x7F";
            else if (value === "blank") segment += "\t ";
            else if (value === "cntrl") segment += "\x00-\x1F\x7F";
            else if (value === "digit") segment += "\\d";
            else if (value === "graph") segment += "\x21-\x7E";
            else if (value === "lower") segment += "a-z";
            else if (value === "print") segment += "\x20-\x7E";
            else if (value === "punct") {
              segment += "!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_‘{|}~";
            } else if (value === "space") segment += "\\s\v";
            else if (value === "upper") segment += "A-Z";
            else if (value === "word") segment += "\\w";
            else if (value === "xdigit") segment += "\\dA-Fa-f";
            continue;
          }
        }
      }
      if (glob[i] === "]" && inRange) {
        inRange = false;
        segment += "]";
        continue;
      }
      if (inRange) {
        segment += glob[i];
        continue;
      }
      if (glob[i] === ")" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") {
        segment += ")";
        const type = groupStack.pop();
        if (type === "!") {
          segment += c.wildcard;
        } else if (type !== "@") {
          segment += type;
        }
        continue;
      }
      if (glob[i] === "|" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") {
        segment += "|";
        continue;
      }
      if (glob[i] === "+" && extended && glob[i + 1] === "(") {
        i++;
        groupStack.push("+");
        segment += "(?:";
        continue;
      }
      if (glob[i] === "@" && extended && glob[i + 1] === "(") {
        i++;
        groupStack.push("@");
        segment += "(?:";
        continue;
      }
      if (glob[i] === "?") {
        if (extended && glob[i + 1] === "(") {
          i++;
          groupStack.push("?");
          segment += "(?:";
        } else {
          segment += ".";
        }
        continue;
      }
      if (glob[i] === "!" && extended && glob[i + 1] === "(") {
        i++;
        groupStack.push("!");
        segment += "(?!";
        continue;
      }
      if (glob[i] === "{") {
        groupStack.push("BRACE");
        segment += "(?:";
        continue;
      }
      if (glob[i] === "}" && groupStack[groupStack.length - 1] === "BRACE") {
        groupStack.pop();
        segment += ")";
        continue;
      }
      if (glob[i] === "," && groupStack[groupStack.length - 1] === "BRACE") {
        segment += "|";
        continue;
      }
      if (glob[i] === "*") {
        if (extended && glob[i + 1] === "(") {
          i++;
          groupStack.push("*");
          segment += "(?:";
        } else {
          const prevChar = glob[i - 1];
          let numStars = 1;
          while(glob[i + 1] === "*"){
            i++;
            numStars++;
          }
          const nextChar = glob[i + 1];
          if (globstarOption && numStars === 2 && [
            ...c.seps,
            undefined
          ].includes(prevChar) && [
            ...c.seps,
            undefined
          ].includes(nextChar)) {
            segment += c.globstar;
            endsWithSep = true;
          } else {
            segment += c.wildcard;
          }
        }
        continue;
      }
      segment += REG_EXP_ESCAPE_CHARS.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
    }
    // Check for unclosed groups or a dangling backslash.
    if (groupStack.length > 0 || inRange || inEscape) {
      // Parse failure. Take all characters from this segment literally.
      segment = "";
      for (const c of glob.slice(j, i)){
        segment += REG_EXP_ESCAPE_CHARS.includes(c) ? `\\${c}` : c;
        endsWithSep = false;
      }
    }
    regExpString += segment;
    if (!endsWithSep) {
      regExpString += i < glob.length ? c.sep : c.sepMaybe;
      endsWithSep = true;
    }
    // Terminates with `i` at the start of the next segment.
    while(c.seps.includes(glob[i]))i++;
    j = i;
  }
  regExpString = `^${regExpString}$`;
  return new RegExp(regExpString, caseInsensitive ? "i" : "");
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
const constants = {
  sep: "/+",
  sepMaybe: "/*",
  seps: [
    "/"
  ],
  globstar: "(?:[^/]*(?:/|$)+)*",
  wildcard: "[^/]*",
  escapePrefix: "\\"
};
/** Convert a glob string to a regular expression.
 *
 * Tries to match bash glob expansion as closely as possible.
 *
 * Basic glob syntax:
 * - `*` - Matches everything without leaving the path segment.
 * - `?` - Matches any single character.
 * - `{foo,bar}` - Matches `foo` or `bar`.
 * - `[abcd]` - Matches `a`, `b`, `c` or `d`.
 * - `[a-d]` - Matches `a`, `b`, `c` or `d`.
 * - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`.
 * - `[[:<class>:]]` - Matches any character belonging to `<class>`.
 *     - `[[:alnum:]]` - Matches any digit or letter.
 *     - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`.
 *     - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes
 *       for a complete list of supported character classes.
 * - `\` - Escapes the next character for an `os` other than `"windows"`.
 * - \` - Escapes the next character for `os` set to `"windows"`.
 * - `/` - Path separator.
 * - `\` - Additional path separator only for `os` set to `"windows"`.
 *
 * Extended syntax:
 * - Requires `{ extended: true }`.
 * - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`.
 * - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same.
 * - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`.
 * - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`.
 * - `!(foo|bar)` - Matches anything other than `{foo,bar}`.
 * - See https://www.linuxjournal.com/content/bash-extended-globbing.
 *
 * Globstar syntax:
 * - Requires `{ globstar: true }`.
 * - `**` - Matches any number of any path segments.
 *     - Must comprise its entire path segment in the provided glob.
 * - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
 *
 * Note the following properties:
 * - The generated `RegExp` is anchored at both start and end.
 * - Repeating and trailing separators are tolerated. Trailing separators in the
 *   provided glob have no meaning and are discarded.
 * - Absolute globs will only match absolute paths, etc.
 * - Empty globs will match nothing.
 * - Any special glob syntax must be contained to one path segment. For example,
 *   `?(foo|bar/baz)` is invalid. The separator will take precedence and the
 *   first segment ends with an unclosed group.
 * - If a path segment ends with unclosed groups or a dangling escape prefix, a
 *   parse error has occurred. Every character for that segment is taken
 *   literally in this event.
 *
 * Limitations:
 * - A negative group like `!(foo|bar)` will wrongly be converted to a negative
 *   look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly
 *   fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively,
 *   `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if
 *   the group occurs not nested at the end of the segment.
 *
 * @example Usage
 * ```ts
 * import { globToRegExp } from "@std/path/posix/glob-to-regexp";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(globToRegExp("*.js"), /^[^/]*\.js\/*$/);
 * ```
 *
 * @param glob Glob string to convert.
 * @param options Conversion options.
 * @returns The regular expression equivalent to the glob.
 */ function globToRegExp(glob, options = {}) {
  return _globToRegExp(constants, glob, options);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Test whether the given string is a glob.
 *
 * @example Usage
 * ```ts
 * import { isGlob } from "@std/path/is-glob";
 * import { assert } from "@std/assert";
 *
 * assert(!isGlob("foo/bar/../baz"));
 * assert(isGlob("foo/*ar/../baz"));
 * ```
 *
 * @param str String to test.
 * @returns `true` if the given string is a glob, otherwise `false`
 */ function isGlob(str) {
  const chars = {
    "{": "}",
    "(": ")",
    "[": "]"
  };
  const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^[\\\]]+\]|\{[^{\\}]+\}|\(\?[:!=][^\\)]+\)|\([^(|]+\|[^\\)]+\)|@\([^)]+\))/;
  if (str === "") {
    return false;
  }
  let match;
  while(match = regex.exec(str)){
    if (match[2]) return true;
    let idx = match.index + match[0].length;
    // if an open bracket/brace/paren is escaped,
    // set the index to the next closing character
    const open = match[1];
    const close = open ? chars[open] : null;
    if (open && close) {
      const n = str.indexOf(close, idx);
      if (n !== -1) {
        idx = n + 1;
      }
    }
    str = str.slice(idx);
  }
  return false;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Like normalize(), but doesn't collapse "**\/.." when `globstar` is true.
 *
 * @example Usage
 * ```ts
 * import { normalizeGlob } from "@std/path/posix/normalize-glob";
 * import { assertEquals } from "@std/assert";
 *
 * const path = normalizeGlob("foo/bar/../*", { globstar: true });
 * assertEquals(path, "foo/*");
 * ```
 *
 * @param glob The glob to normalize.
 * @param options The options to use.
 * @returns The normalized path.
 */ function normalizeGlob(glob, options = {}) {
  const { globstar = false } = options;
  if (glob.match(/\0/g)) {
    throw new Error(`Glob contains invalid characters: "${glob}"`);
  }
  if (!globstar) {
    return normalize(glob);
  }
  const s = SEPARATOR_PATTERN.source;
  const badParentPattern = new RegExp(`(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`, "g");
  return normalize(glob.replace(badParentPattern, "\0")).replace(/\0/g, "..");
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Like join(), but doesn't collapse "**\/.." when `globstar` is true.
 *
 * @example Usage
 * ```ts
 * import { joinGlobs } from "@std/path/posix/join-globs";
 * import { assertEquals } from "@std/assert";
 *
 * const path = joinGlobs(["foo", "bar", "**"], { globstar: true });
 * assertEquals(path, "foo/bar/**");
 * ```
 *
 * @param globs The globs to join.
 * @param options The options to use.
 * @returns The joined path.
 */ function joinGlobs(globs, options = {}) {
  const { globstar = false } = options;
  if (!globstar || globs.length === 0) {
    return join(...globs);
  }
  let joined;
  for (const glob of globs){
    const path = glob;
    if (path.length > 0) {
      if (!joined) joined = path;
      else joined += `${SEPARATOR}${path}`;
    }
  }
  if (!joined) return ".";
  return normalizeGlob(joined, {
    globstar
  });
}

exports.DELIMITER = DELIMITER;
exports.SEPARATOR = SEPARATOR;
exports.SEPARATOR_PATTERN = SEPARATOR_PATTERN;
exports.basename = basename;
exports.common = common;
exports.dirname = dirname;
exports.extname = extname;
exports.format = format;
exports.fromFileUrl = fromFileUrl;
exports.globToRegExp = globToRegExp;
exports.isAbsolute = isAbsolute;
exports.isGlob = isGlob;
exports.join = join;
exports.joinGlobs = joinGlobs;
exports.normalize = normalize;
exports.normalizeGlob = normalizeGlob;
exports.parse = parse;
exports.relative = relative;
exports.resolve = resolve;
exports.toFileUrl = toFileUrl;
exports.toNamespacedPath = toNamespacedPath;
2Jx+// @ts-nocheck
'use strict';

// Copyright 2018-2025 the Deno authors. MIT license.
// Copyright the Browserify authors. MIT License.
function assertPath(path) {
  if (typeof path !== "string") {
    throw new TypeError(`Path must be a string, received "${JSON.stringify(path)}"`);
  }
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function stripSuffix(name, suffix) {
  if (suffix.length >= name.length) {
    return name;
  }
  const lenDiff = name.length - suffix.length;
  for(let i = suffix.length - 1; i >= 0; --i){
    if (name.charCodeAt(lenDiff + i) !== suffix.charCodeAt(i)) {
      return name;
    }
  }
  return name.slice(0, -suffix.length);
}
function lastPathSegment(path, isSep, start = 0) {
  let matchedNonSeparator = false;
  let end = path.length;
  for(let i = path.length - 1; i >= start; --i){
    if (isSep(path.charCodeAt(i))) {
      if (matchedNonSeparator) {
        start = i + 1;
        break;
      }
    } else if (!matchedNonSeparator) {
      matchedNonSeparator = true;
      end = i + 1;
    }
  }
  return path.slice(start, end);
}
function assertArgs$1(path, suffix) {
  assertPath(path);
  if (path.length === 0) return path;
  if (typeof suffix !== "string") {
    throw new TypeError(`Suffix must be a string, received "${JSON.stringify(suffix)}"`);
  }
}

// Copyright 2018-2025 the Deno authors. MIT license.
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
// This module is browser compatible.
// Alphabet chars.
const CHAR_UPPERCASE_A = 65; /* A */ 
const CHAR_LOWERCASE_A = 97; /* a */ 
const CHAR_UPPERCASE_Z = 90; /* Z */ 
const CHAR_LOWERCASE_Z = 122; /* z */ 
// Non-alphabetic chars.
const CHAR_DOT = 46; /* . */ 
const CHAR_FORWARD_SLASH = 47; /* / */ 
const CHAR_BACKWARD_SLASH = 92; /* \ */ 
const CHAR_COLON = 58; /* : */ 
const CHAR_QUESTION_MARK = 63; /* ? */

// Copyright 2018-2025 the Deno authors. MIT license.
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
// This module is browser compatible.
function stripTrailingSeparators(segment, isSep) {
  if (segment.length <= 1) {
    return segment;
  }
  let end = segment.length;
  for(let i = segment.length - 1; i > 0; i--){
    if (isSep(segment.charCodeAt(i))) {
      end = i;
    } else {
      break;
    }
  }
  return segment.slice(0, end);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
// This module is browser compatible.
function isPosixPathSeparator(code) {
  return code === CHAR_FORWARD_SLASH;
}
function isPathSeparator(code) {
  return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
}
function isWindowsDeviceRoot(code) {
  return code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z || code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function assertArg$3(url) {
  url = url instanceof URL ? url : new URL(url);
  if (url.protocol !== "file:") {
    throw new TypeError(`URL must be a file URL: received "${url.protocol}"`);
  }
  return url;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Converts a file URL to a path string.
 *
 * @example Usage
 * ```ts
 * import { fromFileUrl } from "@std/path/windows/from-file-url";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(fromFileUrl("file:///home/foo"), "\\home\\foo");
 * assertEquals(fromFileUrl("file:///C:/Users/foo"), "C:\\Users\\foo");
 * assertEquals(fromFileUrl("file://localhost/home/foo"), "\\home\\foo");
 * ```
 *
 * @param url The file URL to convert.
 * @returns The path string.
 */ function fromFileUrl(url) {
  url = assertArg$3(url);
  let path = decodeURIComponent(url.pathname.replace(/\//g, "\\").replace(/%(?![0-9A-Fa-f]{2})/g, "%25")).replace(/^\\*([A-Za-z]:)(\\|$)/, "$1\\");
  if (url.hostname !== "") {
    // Note: The `URL` implementation guarantees that the drive letter and
    // hostname are mutually exclusive. Otherwise it would not have been valid
    // to append the hostname and path like this.
    path = `\\\\${url.hostname}${path}`;
  }
  return path;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Return the last portion of a `path`.
 * Trailing directory separators are ignored, and optional suffix is removed.
 *
 * @example Usage
 * ```ts
 * import { basename } from "@std/path/windows/basename";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(basename("C:\\user\\Documents\\"), "Documents");
 * assertEquals(basename("C:\\user\\Documents\\image.png"), "image.png");
 * assertEquals(basename("C:\\user\\Documents\\image.png", ".png"), "image");
 * assertEquals(basename(new URL("file:///C:/user/Documents/image.png")), "image.png");
 * assertEquals(basename(new URL("file:///C:/user/Documents/image.png"), ".png"), "image");
 * ```
 *
 * @param path The path to extract the name from.
 * @param suffix The suffix to remove from extracted name.
 * @returns The extracted name.
 */ function basename(path, suffix = "") {
  if (path instanceof URL) {
    path = fromFileUrl(path);
  }
  assertArgs$1(path, suffix);
  // Check for a drive letter prefix so as not to mistake the following
  // path separator as an extra separator at the end of the path that can be
  // disregarded
  let start = 0;
  if (path.length >= 2) {
    const drive = path.charCodeAt(0);
    if (isWindowsDeviceRoot(drive)) {
      if (path.charCodeAt(1) === CHAR_COLON) start = 2;
    }
  }
  const lastSegment = lastPathSegment(path, isPathSeparator, start);
  const strippedSegment = stripTrailingSeparators(lastSegment, isPathSeparator);
  return suffix ? stripSuffix(strippedSegment, suffix) : strippedSegment;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * The character used to separate entries in the PATH environment variable.
 */ const DELIMITER = ";";
/**
 * The character used to separate components of a file path.
 */ const SEPARATOR = "\\";
/**
 * A regular expression that matches one or more path separators.
 */ const SEPARATOR_PATTERN = /[\\/]+/;

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function assertArg$2(path) {
  assertPath(path);
  if (path.length === 0) return ".";
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Return the directory path of a `path`.
 *
 * @example Usage
 * ```ts
 * import { dirname } from "@std/path/windows/dirname";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(dirname("C:\\foo\\bar\\baz.ext"), "C:\\foo\\bar");
 * assertEquals(dirname(new URL("file:///C:/foo/bar/baz.ext")), "C:\\foo\\bar");
 * ```
 *
 * @param path The path to get the directory from.
 * @returns The directory path.
 */ function dirname(path) {
  if (path instanceof URL) {
    path = fromFileUrl(path);
  }
  assertArg$2(path);
  const len = path.length;
  let rootEnd = -1;
  let end = -1;
  let matchedSlash = true;
  let offset = 0;
  const code = path.charCodeAt(0);
  // Try to match a root
  if (len > 1) {
    if (isPathSeparator(code)) {
      // Possible UNC root
      rootEnd = offset = 1;
      if (isPathSeparator(path.charCodeAt(1))) {
        // Matched double path separator at beginning
        let j = 2;
        let last = j;
        // Match 1 or more non-path separators
        for(; j < len; ++j){
          if (isPathSeparator(path.charCodeAt(j))) break;
        }
        if (j < len && j !== last) {
          // Matched!
          last = j;
          // Match 1 or more path separators
          for(; j < len; ++j){
            if (!isPathSeparator(path.charCodeAt(j))) break;
          }
          if (j < len && j !== last) {
            // Matched!
            last = j;
            // Match 1 or more non-path separators
            for(; j < len; ++j){
              if (isPathSeparator(path.charCodeAt(j))) break;
            }
            if (j === len) {
              // We matched a UNC root only
              return path;
            }
            if (j !== last) {
              // We matched a UNC root with leftovers
              // Offset by 1 to include the separator after the UNC root to
              // treat it as a "normal root" on top of a (UNC) root
              rootEnd = offset = j + 1;
            }
          }
        }
      }
    } else if (isWindowsDeviceRoot(code)) {
      // Possible device root
      if (path.charCodeAt(1) === CHAR_COLON) {
        rootEnd = offset = 2;
        if (len > 2) {
          if (isPathSeparator(path.charCodeAt(2))) rootEnd = offset = 3;
        }
      }
    }
  } else if (isPathSeparator(code)) {
    // `path` contains just a path separator, exit early to avoid
    // unnecessary work
    return path;
  }
  for(let i = len - 1; i >= offset; --i){
    if (isPathSeparator(path.charCodeAt(i))) {
      if (!matchedSlash) {
        end = i;
        break;
      }
    } else {
      // We saw the first non-path separator
      matchedSlash = false;
    }
  }
  if (end === -1) {
    if (rootEnd === -1) return ".";
    else end = rootEnd;
  }
  return stripTrailingSeparators(path.slice(0, end), isPosixPathSeparator);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Return the extension of the `path` with leading period.
 *
 * @example Usage
 * ```ts
 * import { extname } from "@std/path/windows/extname";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(extname("file.ts"), ".ts");
 * assertEquals(extname(new URL("file:///C:/foo/bar/baz.ext")), ".ext");
 * ```
 *
 * @param path The path to get the extension from.
 * @returns The extension of the `path`.
 */ function extname(path) {
  if (path instanceof URL) {
    path = fromFileUrl(path);
  }
  assertPath(path);
  let start = 0;
  let startDot = -1;
  let startPart = 0;
  let end = -1;
  let matchedSlash = true;
  // Track the state of characters (if any) we see before our first dot and
  // after any path separator we find
  let preDotState = 0;
  // Check for a drive letter prefix so as not to mistake the following
  // path separator as an extra separator at the end of the path that can be
  // disregarded
  if (path.length >= 2 && path.charCodeAt(1) === CHAR_COLON && isWindowsDeviceRoot(path.charCodeAt(0))) {
    start = startPart = 2;
  }
  for(let i = path.length - 1; i >= start; --i){
    const code = path.charCodeAt(i);
    if (isPathSeparator(code)) {
      // If we reached a path separator that was not part of a set of path
      // separators at the end of the string, stop now
      if (!matchedSlash) {
        startPart = i + 1;
        break;
      }
      continue;
    }
    if (end === -1) {
      // We saw the first non-path separator, mark this as the end of our
      // extension
      matchedSlash = false;
      end = i + 1;
    }
    if (code === CHAR_DOT) {
      // If this is our first dot, mark it as the start of our extension
      if (startDot === -1) startDot = i;
      else if (preDotState !== 1) preDotState = 1;
    } else if (startDot !== -1) {
      // We saw a non-dot and non-path separator before our dot, so we should
      // have a good chance at having a non-empty extension
      preDotState = -1;
    }
  }
  if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
  preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
  preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
    return "";
  }
  return path.slice(startDot, end);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function _format(sep, pathObject) {
  const dir = pathObject.dir || pathObject.root;
  const base = pathObject.base || (pathObject.name ?? "") + (pathObject.ext ?? "");
  if (!dir) return base;
  if (base === sep) return dir;
  if (dir === pathObject.root) return dir + base;
  return dir + sep + base;
}
function assertArg$1(pathObject) {
  if (pathObject === null || typeof pathObject !== "object") {
    throw new TypeError(`The "pathObject" argument must be of type Object, received type "${typeof pathObject}"`);
  }
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Generate a path from `ParsedPath` object.
 *
 * @example Usage
 * ```ts
 * import { format } from "@std/path/windows/format";
 * import { assertEquals } from "@std/assert";
 *
 * const path = format({
 *   root: "C:\\",
 *   dir: "C:\\path\\dir",
 *   base: "file.txt",
 *   ext: ".txt",
 *   name: "file"
 * });
 * assertEquals(path, "C:\\path\\dir\\file.txt");
 * ```
 *
 * @param pathObject The path object to format.
 * @returns The formatted path.
 */ function format(pathObject) {
  assertArg$1(pathObject);
  return _format("\\", pathObject);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Verifies whether provided path is absolute.
 *
 * @example Usage
 * ```ts
 * import { isAbsolute } from "@std/path/windows/is-absolute";
 * import { assert, assertFalse } from "@std/assert";
 *
 * assert(isAbsolute("C:\\foo\\bar"));
 * assertFalse(isAbsolute("..\\baz"));
 * ```
 *
 * @param path The path to verify.
 * @returns `true` if the path is absolute, `false` otherwise.
 */ function isAbsolute(path) {
  assertPath(path);
  const len = path.length;
  if (len === 0) return false;
  const code = path.charCodeAt(0);
  if (isPathSeparator(code)) {
    return true;
  } else if (isWindowsDeviceRoot(code)) {
    // Possible device root
    if (len > 2 && path.charCodeAt(1) === CHAR_COLON) {
      if (isPathSeparator(path.charCodeAt(2))) return true;
    }
  }
  return false;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function assertArg(path) {
  assertPath(path);
  if (path.length === 0) return ".";
}

// Copyright 2018-2025 the Deno authors. MIT license.
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
// This module is browser compatible.
// Resolves . and .. elements in a path with directory names
function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
  let res = "";
  let lastSegmentLength = 0;
  let lastSlash = -1;
  let dots = 0;
  let code;
  for(let i = 0; i <= path.length; ++i){
    if (i < path.length) code = path.charCodeAt(i);
    else if (isPathSeparator(code)) break;
    else code = CHAR_FORWARD_SLASH;
    if (isPathSeparator(code)) {
      if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) {
        if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) {
          if (res.length > 2) {
            const lastSlashIndex = res.lastIndexOf(separator);
            if (lastSlashIndex === -1) {
              res = "";
              lastSegmentLength = 0;
            } else {
              res = res.slice(0, lastSlashIndex);
              lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);
            }
            lastSlash = i;
            dots = 0;
            continue;
          } else if (res.length === 2 || res.length === 1) {
            res = "";
            lastSegmentLength = 0;
            lastSlash = i;
            dots = 0;
            continue;
          }
        }
        if (allowAboveRoot) {
          if (res.length > 0) res += `${separator}..`;
          else res = "..";
          lastSegmentLength = 2;
        }
      } else {
        if (res.length > 0) res += separator + path.slice(lastSlash + 1, i);
        else res = path.slice(lastSlash + 1, i);
        lastSegmentLength = i - lastSlash - 1;
      }
      lastSlash = i;
      dots = 0;
    } else if (code === CHAR_DOT && dots !== -1) {
      ++dots;
    } else {
      dots = -1;
    }
  }
  return res;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Normalize the `path`, resolving `'..'` and `'.'` segments.
 * Note that resolving these segments does not necessarily mean that all will be eliminated.
 * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
 *
 * @example Usage
 * ```ts
 * import { normalize } from "@std/path/windows/normalize";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(normalize("C:\\foo\\..\\bar"), "C:\\bar");
 * assertEquals(normalize(new URL("file:///C:/foo/../bar")), "C:\\bar");
 * ```
 *
 * @param path The path to normalize
 * @returns The normalized path
 */ function normalize(path) {
  if (path instanceof URL) {
    path = fromFileUrl(path);
  }
  assertArg(path);
  const len = path.length;
  let rootEnd = 0;
  let device;
  let isAbsolute = false;
  const code = path.charCodeAt(0);
  // Try to match a root
  if (len > 1) {
    if (isPathSeparator(code)) {
      // Possible UNC root
      // If we started with a separator, we know we at least have an absolute
      // path of some kind (UNC or otherwise)
      isAbsolute = true;
      if (isPathSeparator(path.charCodeAt(1))) {
        // Matched double path separator at beginning
        let j = 2;
        let last = j;
        // Match 1 or more non-path separators
        for(; j < len; ++j){
          if (isPathSeparator(path.charCodeAt(j))) break;
        }
        if (j < len && j !== last) {
          const firstPart = path.slice(last, j);
          // Matched!
          last = j;
          // Match 1 or more path separators
          for(; j < len; ++j){
            if (!isPathSeparator(path.charCodeAt(j))) break;
          }
          if (j < len && j !== last) {
            // Matched!
            last = j;
            // Match 1 or more non-path separators
            for(; j < len; ++j){
              if (isPathSeparator(path.charCodeAt(j))) break;
            }
            if (j === len) {
              // We matched a UNC root only
              // Return the normalized version of the UNC root since there
              // is nothing left to process
              return `\\\\${firstPart}\\${path.slice(last)}\\`;
            } else if (j !== last) {
              // We matched a UNC root with leftovers
              device = `\\\\${firstPart}\\${path.slice(last, j)}`;
              rootEnd = j;
            }
          }
        }
      } else {
        rootEnd = 1;
      }
    } else if (isWindowsDeviceRoot(code)) {
      // Possible device root
      if (path.charCodeAt(1) === CHAR_COLON) {
        device = path.slice(0, 2);
        rootEnd = 2;
        if (len > 2) {
          if (isPathSeparator(path.charCodeAt(2))) {
            // Treat separator following drive name as an absolute path
            // indicator
            isAbsolute = true;
            rootEnd = 3;
          }
        }
      }
    }
  } else if (isPathSeparator(code)) {
    // `path` contains just a path separator, exit early to avoid unnecessary
    // work
    return "\\";
  }
  let tail;
  if (rootEnd < len) {
    tail = normalizeString(path.slice(rootEnd), !isAbsolute, "\\", isPathSeparator);
  } else {
    tail = "";
  }
  if (tail.length === 0 && !isAbsolute) tail = ".";
  if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) {
    tail += "\\";
  }
  if (device === undefined) {
    if (isAbsolute) {
      if (tail.length > 0) return `\\${tail}`;
      else return "\\";
    }
    return tail;
  } else if (isAbsolute) {
    if (tail.length > 0) return `${device}\\${tail}`;
    else return `${device}\\`;
  }
  return device + tail;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Join all given a sequence of `paths`,then normalizes the resulting path.
 *
 * @example Usage
 * ```ts
 * import { join } from "@std/path/windows/join";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(join("C:\\foo", "bar", "baz\\.."), "C:\\foo\\bar");
 * assertEquals(join(new URL("file:///C:/foo"), "bar", "baz\\.."), "C:\\foo\\bar");
 * ```
 *
 * @param path The path to join. This can be string or file URL.
 * @param paths The paths to join.
 * @returns The joined path.
 */ function join(path, ...paths) {
  if (path instanceof URL) {
    path = fromFileUrl(path);
  }
  paths = path ? [
    path,
    ...paths
  ] : paths;
  paths.forEach((path)=>assertPath(path));
  paths = paths.filter((path)=>path.length > 0);
  if (paths.length === 0) return ".";
  // Make sure that the joined path doesn't start with two slashes, because
  // normalize() will mistake it for an UNC path then.
  //
  // This step is skipped when it is very clear that the user actually
  // intended to point at an UNC path. This is assumed when the first
  // non-empty string arguments starts with exactly two slashes followed by
  // at least one more non-slash character.
  //
  // Note that for normalize() to treat a path as an UNC path it needs to
  // have at least 2 components, so we don't filter for that here.
  // This means that the user can use join to construct UNC paths from
  // a server name and a share name; for example:
  //   path.join('//server', 'share') -> '\\\\server\\share\\'
  let needsReplace = true;
  let slashCount = 0;
  const firstPart = paths[0];
  if (isPathSeparator(firstPart.charCodeAt(0))) {
    ++slashCount;
    const firstLen = firstPart.length;
    if (firstLen > 1) {
      if (isPathSeparator(firstPart.charCodeAt(1))) {
        ++slashCount;
        if (firstLen > 2) {
          if (isPathSeparator(firstPart.charCodeAt(2))) ++slashCount;
          else {
            // We matched a UNC path in the first part
            needsReplace = false;
          }
        }
      }
    }
  }
  let joined = paths.join("\\");
  if (needsReplace) {
    // Find any more consecutive slashes we need to replace
    for(; slashCount < joined.length; ++slashCount){
      if (!isPathSeparator(joined.charCodeAt(slashCount))) break;
    }
    // Replace the slashes if needed
    if (slashCount >= 2) joined = `\\${joined.slice(slashCount)}`;
  }
  return normalize(joined);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Return a `ParsedPath` object of the `path`.
 *
 * @example Usage
 * ```ts
 * import { parse } from "@std/path/windows/parse";
 * import { assertEquals } from "@std/assert";
 *
 * const parsed = parse("C:\\foo\\bar\\baz.ext");
 * assertEquals(parsed, {
 *   root: "C:\\",
 *   dir: "C:\\foo\\bar",
 *   base: "baz.ext",
 *   ext: ".ext",
 *   name: "baz",
 * });
 * ```
 *
 * @param path The path to parse.
 * @returns The `ParsedPath` object.
 */ function parse(path) {
  assertPath(path);
  const ret = {
    root: "",
    dir: "",
    base: "",
    ext: "",
    name: ""
  };
  const len = path.length;
  if (len === 0) return ret;
  let rootEnd = 0;
  let code = path.charCodeAt(0);
  // Try to match a root
  if (len > 1) {
    if (isPathSeparator(code)) {
      // Possible UNC root
      rootEnd = 1;
      if (isPathSeparator(path.charCodeAt(1))) {
        // Matched double path separator at beginning
        let j = 2;
        let last = j;
        // Match 1 or more non-path separators
        for(; j < len; ++j){
          if (isPathSeparator(path.charCodeAt(j))) break;
        }
        if (j < len && j !== last) {
          // Matched!
          last = j;
          // Match 1 or more path separators
          for(; j < len; ++j){
            if (!isPathSeparator(path.charCodeAt(j))) break;
          }
          if (j < len && j !== last) {
            // Matched!
            last = j;
            // Match 1 or more non-path separators
            for(; j < len; ++j){
              if (isPathSeparator(path.charCodeAt(j))) break;
            }
            if (j === len) {
              // We matched a UNC root only
              rootEnd = j;
            } else if (j !== last) {
              // We matched a UNC root with leftovers
              rootEnd = j + 1;
            }
          }
        }
      }
    } else if (isWindowsDeviceRoot(code)) {
      // Possible device root
      if (path.charCodeAt(1) === CHAR_COLON) {
        rootEnd = 2;
        if (len > 2) {
          if (isPathSeparator(path.charCodeAt(2))) {
            if (len === 3) {
              // `path` contains just a drive root, exit early to avoid
              // unnecessary work
              ret.root = ret.dir = path;
              ret.base = "\\";
              return ret;
            }
            rootEnd = 3;
          }
        } else {
          // `path` contains just a relative drive root, exit early to avoid
          // unnecessary work
          ret.root = ret.dir = path;
          return ret;
        }
      }
    }
  } else if (isPathSeparator(code)) {
    // `path` contains just a path separator, exit early to avoid
    // unnecessary work
    ret.root = ret.dir = path;
    ret.base = "\\";
    return ret;
  }
  if (rootEnd > 0) ret.root = path.slice(0, rootEnd);
  let startDot = -1;
  let startPart = rootEnd;
  let end = -1;
  let matchedSlash = true;
  let i = path.length - 1;
  // Track the state of characters (if any) we see before our first dot and
  // after any path separator we find
  let preDotState = 0;
  // Get non-dir info
  for(; i >= rootEnd; --i){
    code = path.charCodeAt(i);
    if (isPathSeparator(code)) {
      // If we reached a path separator that was not part of a set of path
      // separators at the end of the string, stop now
      if (!matchedSlash) {
        startPart = i + 1;
        break;
      }
      continue;
    }
    if (end === -1) {
      // We saw the first non-path separator, mark this as the end of our
      // extension
      matchedSlash = false;
      end = i + 1;
    }
    if (code === CHAR_DOT) {
      // If this is our first dot, mark it as the start of our extension
      if (startDot === -1) startDot = i;
      else if (preDotState !== 1) preDotState = 1;
    } else if (startDot !== -1) {
      // We saw a non-dot and non-path separator before our dot, so we should
      // have a good chance at having a non-empty extension
      preDotState = -1;
    }
  }
  if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
  preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
  preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
    if (end !== -1) {
      ret.base = ret.name = path.slice(startPart, end);
    }
  } else {
    ret.name = path.slice(startPart, startDot);
    ret.base = path.slice(startPart, end);
    ret.ext = path.slice(startDot, end);
  }
  // Fallback to '\' in case there is no basename
  ret.base = ret.base || "\\";
  // If the directory is the root, use the entire root as the `dir` including
  // the trailing slash if any (`C:\abc` -> `C:\`). Otherwise, strip out the
  // trailing slash (`C:\abc\def` -> `C:\abc`).
  if (startPart > 0 && startPart !== rootEnd) {
    ret.dir = path.slice(0, startPart - 1);
  } else ret.dir = ret.root;
  return ret;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Resolves path segments into a `path`.
 *
 * @example Usage
 * ```ts
 * import { resolve } from "@std/path/windows/resolve";
 * import { assertEquals } from "@std/assert";
 *
 * const resolved = resolve("C:\\foo\\bar", "..\\baz");
 * assertEquals(resolved, "C:\\foo\\baz");
 * ```
 *
 * @param pathSegments The path segments to process to path
 * @returns The resolved path
 */ function resolve(...pathSegments) {
  let resolvedDevice = "";
  let resolvedTail = "";
  let resolvedAbsolute = false;
  for(let i = pathSegments.length - 1; i >= -1; i--){
    let path;
    // deno-lint-ignore no-explicit-any
    const { Deno } = globalThis;
    if (i >= 0) {
      path = pathSegments[i];
    } else if (!resolvedDevice) {
      if (typeof Deno?.cwd !== "function") {
        throw new TypeError("Resolved a drive-letter-less path without a current working directory (CWD)");
      }
      path = Deno.cwd();
    } else {
      if (typeof Deno?.env?.get !== "function" || typeof Deno?.cwd !== "function") {
        throw new TypeError("Resolved a relative path without a current working directory (CWD)");
      }
      path = Deno.cwd();
      // Verify that a cwd was found and that it actually points
      // to our drive. If not, default to the drive's root.
      if (path === undefined || path.slice(0, 3).toLowerCase() !== `${resolvedDevice.toLowerCase()}\\`) {
        path = `${resolvedDevice}\\`;
      }
    }
    assertPath(path);
    const len = path.length;
    // Skip empty entries
    if (len === 0) continue;
    let rootEnd = 0;
    let device = "";
    let isAbsolute = false;
    const code = path.charCodeAt(0);
    // Try to match a root
    if (len > 1) {
      if (isPathSeparator(code)) {
        // Possible UNC root
        // If we started with a separator, we know we at least have an
        // absolute path of some kind (UNC or otherwise)
        isAbsolute = true;
        if (isPathSeparator(path.charCodeAt(1))) {
          // Matched double path separator at beginning
          let j = 2;
          let last = j;
          // Match 1 or more non-path separators
          for(; j < len; ++j){
            if (isPathSeparator(path.charCodeAt(j))) break;
          }
          if (j < len && j !== last) {
            const firstPart = path.slice(last, j);
            // Matched!
            last = j;
            // Match 1 or more path separators
            for(; j < len; ++j){
              if (!isPathSeparator(path.charCodeAt(j))) break;
            }
            if (j < len && j !== last) {
              // Matched!
              last = j;
              // Match 1 or more non-path separators
              for(; j < len; ++j){
                if (isPathSeparator(path.charCodeAt(j))) break;
              }
              if (j === len) {
                // We matched a UNC root only
                device = `\\\\${firstPart}\\${path.slice(last)}`;
                rootEnd = j;
              } else if (j !== last) {
                // We matched a UNC root with leftovers
                device = `\\\\${firstPart}\\${path.slice(last, j)}`;
                rootEnd = j;
              }
            }
          }
        } else {
          rootEnd = 1;
        }
      } else if (isWindowsDeviceRoot(code)) {
        // Possible device root
        if (path.charCodeAt(1) === CHAR_COLON) {
          device = path.slice(0, 2);
          rootEnd = 2;
          if (len > 2) {
            if (isPathSeparator(path.charCodeAt(2))) {
              // Treat separator following drive name as an absolute path
              // indicator
              isAbsolute = true;
              rootEnd = 3;
            }
          }
        }
      }
    } else if (isPathSeparator(code)) {
      // `path` contains just a path separator
      rootEnd = 1;
      isAbsolute = true;
    }
    if (device.length > 0 && resolvedDevice.length > 0 && device.toLowerCase() !== resolvedDevice.toLowerCase()) {
      continue;
    }
    if (resolvedDevice.length === 0 && device.length > 0) {
      resolvedDevice = device;
    }
    if (!resolvedAbsolute) {
      resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`;
      resolvedAbsolute = isAbsolute;
    }
    if (resolvedAbsolute && resolvedDevice.length > 0) break;
  }
  // At this point the path should be resolved to a full absolute path,
  // but handle relative paths to be safe (might happen when Deno.cwd()
  // fails)
  // Normalize the tail path
  resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, "\\", isPathSeparator);
  return resolvedDevice + (resolvedAbsolute ? "\\" : "") + resolvedTail || ".";
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function assertArgs(from, to) {
  assertPath(from);
  assertPath(to);
  if (from === to) return "";
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Return the relative path from `from` to `to` based on current working directory.
 *
 * An example in windows, for instance:
 *  from = 'C:\\orandea\\test\\aaa'
 *  to = 'C:\\orandea\\impl\\bbb'
 * The output of the function should be: '..\\..\\impl\\bbb'
 *
 * @example Usage
 * ```ts
 * import { relative } from "@std/path/windows/relative";
 * import { assertEquals } from "@std/assert";
 *
 * const relativePath = relative("C:\\foobar\\test\\aaa", "C:\\foobar\\impl\\bbb");
 * assertEquals(relativePath, "..\\..\\impl\\bbb");
 * ```
 *
 * @param from The path from which to calculate the relative path
 * @param to The path to which to calculate the relative path
 * @returns The relative path from `from` to `to`
 */ function relative(from, to) {
  assertArgs(from, to);
  const fromOrig = resolve(from);
  const toOrig = resolve(to);
  if (fromOrig === toOrig) return "";
  from = fromOrig.toLowerCase();
  to = toOrig.toLowerCase();
  if (from === to) return "";
  // Trim any leading backslashes
  let fromStart = 0;
  let fromEnd = from.length;
  for(; fromStart < fromEnd; ++fromStart){
    if (from.charCodeAt(fromStart) !== CHAR_BACKWARD_SLASH) break;
  }
  // Trim trailing backslashes (applicable to UNC paths only)
  for(; fromEnd - 1 > fromStart; --fromEnd){
    if (from.charCodeAt(fromEnd - 1) !== CHAR_BACKWARD_SLASH) break;
  }
  const fromLen = fromEnd - fromStart;
  // Trim any leading backslashes
  let toStart = 0;
  let toEnd = to.length;
  for(; toStart < toEnd; ++toStart){
    if (to.charCodeAt(toStart) !== CHAR_BACKWARD_SLASH) break;
  }
  // Trim trailing backslashes (applicable to UNC paths only)
  for(; toEnd - 1 > toStart; --toEnd){
    if (to.charCodeAt(toEnd - 1) !== CHAR_BACKWARD_SLASH) break;
  }
  const toLen = toEnd - toStart;
  // Compare paths to find the longest common path from root
  const length = fromLen < toLen ? fromLen : toLen;
  let lastCommonSep = -1;
  let i = 0;
  for(; i <= length; ++i){
    if (i === length) {
      if (toLen > length) {
        if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) {
          // We get here if `from` is the exact base path for `to`.
          // For example: from='C:\\foo\\bar'; to='C:\\foo\\bar\\baz'
          return toOrig.slice(toStart + i + 1);
        } else if (i === 2) {
          // We get here if `from` is the device root.
          // For example: from='C:\\'; to='C:\\foo'
          return toOrig.slice(toStart + i);
        }
      }
      if (fromLen > length) {
        if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) {
          // We get here if `to` is the exact base path for `from`.
          // For example: from='C:\\foo\\bar'; to='C:\\foo'
          lastCommonSep = i;
        } else if (i === 2) {
          // We get here if `to` is the device root.
          // For example: from='C:\\foo\\bar'; to='C:\\'
          lastCommonSep = 3;
        }
      }
      break;
    }
    const fromCode = from.charCodeAt(fromStart + i);
    const toCode = to.charCodeAt(toStart + i);
    if (fromCode !== toCode) break;
    else if (fromCode === CHAR_BACKWARD_SLASH) lastCommonSep = i;
  }
  // We found a mismatch before the first common path separator was seen, so
  // return the original `to`.
  if (i !== length && lastCommonSep === -1) {
    return toOrig;
  }
  let out = "";
  if (lastCommonSep === -1) lastCommonSep = 0;
  // Generate the relative path based on the path difference between `to` and
  // `from`
  for(i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i){
    if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) {
      if (out.length === 0) out += "..";
      else out += "\\..";
    }
  }
  // Lastly, append the rest of the destination (`to`) path that comes after
  // the common path parts
  if (out.length > 0) {
    return out + toOrig.slice(toStart + lastCommonSep, toEnd);
  } else {
    toStart += lastCommonSep;
    if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) ++toStart;
    return toOrig.slice(toStart, toEnd);
  }
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
const WHITESPACE_ENCODINGS = {
  "\u0009": "%09",
  "\u000A": "%0A",
  "\u000B": "%0B",
  "\u000C": "%0C",
  "\u000D": "%0D",
  "\u0020": "%20"
};
function encodeWhitespace(string) {
  return string.replaceAll(/[\s]/g, (c)=>{
    return WHITESPACE_ENCODINGS[c] ?? c;
  });
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Converts a path string to a file URL.
 *
 * @example Usage
 * ```ts
 * import { toFileUrl } from "@std/path/windows/to-file-url";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(toFileUrl("\\home\\foo"), new URL("file:///home/foo"));
 * assertEquals(toFileUrl("C:\\Users\\foo"), new URL("file:///C:/Users/foo"));
 * assertEquals(toFileUrl("\\\\127.0.0.1\\home\\foo"), new URL("file://127.0.0.1/home/foo"));
 * ```
 * @param path The path to convert.
 * @returns The file URL.
 */ function toFileUrl(path) {
  if (!isAbsolute(path)) {
    throw new TypeError(`Path must be absolute: received "${path}"`);
  }
  const [, hostname, pathname] = path.match(/^(?:[/\\]{2}([^/\\]+)(?=[/\\](?:[^/\\]|$)))?(.*)/);
  const url = new URL("file:///");
  url.pathname = encodeWhitespace(pathname.replace(/%/g, "%25"));
  if (hostname !== undefined && hostname !== "localhost") {
    url.hostname = hostname;
    if (!url.hostname) {
      throw new TypeError(`Invalid hostname: "${url.hostname}"`);
    }
  }
  return url;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Resolves path to a namespace path
 *
 * @example Usage
 * ```ts
 * import { toNamespacedPath } from "@std/path/windows/to-namespaced-path";
 * import { assertEquals } from "@std/assert";
 *
 * const namespaced = toNamespacedPath("C:\\foo\\bar");
 * assertEquals(namespaced, "\\\\?\\C:\\foo\\bar");
 * ```
 *
 * @param path The path to resolve to namespaced path
 * @returns The resolved namespaced path
 */ function toNamespacedPath(path) {
  // Note: this will *probably* throw somewhere.
  if (typeof path !== "string") return path;
  if (path.length === 0) return "";
  const resolvedPath = resolve(path);
  if (resolvedPath.length >= 3) {
    if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) {
      // Possible UNC root
      if (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) {
        const code = resolvedPath.charCodeAt(2);
        if (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) {
          // Matched non-long UNC root, convert the path to a long UNC path
          return `\\\\?\\UNC\\${resolvedPath.slice(2)}`;
        }
      }
    } else if (isWindowsDeviceRoot(resolvedPath.charCodeAt(0))) {
      // Possible device root
      if (resolvedPath.charCodeAt(1) === CHAR_COLON && resolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH) {
        // Matched device root, convert the path to a long UNC path
        return `\\\\?\\${resolvedPath}`;
      }
    }
  }
  return path;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function common$1(paths, sep) {
  const [first = "", ...remaining] = paths;
  const parts = first.split(sep);
  let endOfPrefix = parts.length;
  let append = "";
  for (const path of remaining){
    const compare = path.split(sep);
    if (compare.length <= endOfPrefix) {
      endOfPrefix = compare.length;
      append = "";
    }
    for(let i = 0; i < endOfPrefix; i++){
      if (compare[i] !== parts[i]) {
        endOfPrefix = i;
        append = i === 0 ? "" : sep;
        break;
      }
    }
  }
  return parts.slice(0, endOfPrefix).join(sep) + append;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Determines the common path from a set of paths for Windows systems.
 *
 * @example Usage
 * ```ts
 * import { common } from "@std/path/windows/common";
 * import { assertEquals } from "@std/assert";
 *
 * const path = common([
 *   "C:\\foo\\bar",
 *   "C:\\foo\\baz",
 * ]);
 * assertEquals(path, "C:\\foo\\");
 * ```
 *
 * @param paths The paths to compare.
 * @returns The common path.
 */ function common(paths) {
  return common$1(paths, SEPARATOR);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Options for {@linkcode globToRegExp}, {@linkcode joinGlobs},
 * {@linkcode normalizeGlob} and {@linkcode expandGlob}.
 */ const REG_EXP_ESCAPE_CHARS = [
  "!",
  "$",
  "(",
  ")",
  "*",
  "+",
  ".",
  "=",
  "?",
  "[",
  "\\",
  "^",
  "{",
  "|"
];
const RANGE_ESCAPE_CHARS = [
  "-",
  "\\",
  "]"
];
function _globToRegExp(c, glob, { extended = true, globstar: globstarOption = true, // os = osType,
caseInsensitive = false } = {}) {
  if (glob === "") {
    return /(?!)/;
  }
  // Remove trailing separators.
  let newLength = glob.length;
  for(; newLength > 1 && c.seps.includes(glob[newLength - 1]); newLength--);
  glob = glob.slice(0, newLength);
  let regExpString = "";
  // Terminates correctly. Trust that `j` is incremented every iteration.
  for(let j = 0; j < glob.length;){
    let segment = "";
    const groupStack = [];
    let inRange = false;
    let inEscape = false;
    let endsWithSep = false;
    let i = j;
    // Terminates with `i` at the non-inclusive end of the current segment.
    for(; i < glob.length && !(c.seps.includes(glob[i]) && groupStack.length === 0); i++){
      if (inEscape) {
        inEscape = false;
        const escapeChars = inRange ? RANGE_ESCAPE_CHARS : REG_EXP_ESCAPE_CHARS;
        segment += escapeChars.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
        continue;
      }
      if (glob[i] === c.escapePrefix) {
        inEscape = true;
        continue;
      }
      if (glob[i] === "[") {
        if (!inRange) {
          inRange = true;
          segment += "[";
          if (glob[i + 1] === "!") {
            i++;
            segment += "^";
          } else if (glob[i + 1] === "^") {
            i++;
            segment += "\\^";
          }
          continue;
        } else if (glob[i + 1] === ":") {
          let k = i + 1;
          let value = "";
          while(glob[k + 1] !== undefined && glob[k + 1] !== ":"){
            value += glob[k + 1];
            k++;
          }
          if (glob[k + 1] === ":" && glob[k + 2] === "]") {
            i = k + 2;
            if (value === "alnum") segment += "\\dA-Za-z";
            else if (value === "alpha") segment += "A-Za-z";
            else if (value === "ascii") segment += "\x00-\x7F";
            else if (value === "blank") segment += "\t ";
            else if (value === "cntrl") segment += "\x00-\x1F\x7F";
            else if (value === "digit") segment += "\\d";
            else if (value === "graph") segment += "\x21-\x7E";
            else if (value === "lower") segment += "a-z";
            else if (value === "print") segment += "\x20-\x7E";
            else if (value === "punct") {
              segment += "!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_‘{|}~";
            } else if (value === "space") segment += "\\s\v";
            else if (value === "upper") segment += "A-Z";
            else if (value === "word") segment += "\\w";
            else if (value === "xdigit") segment += "\\dA-Fa-f";
            continue;
          }
        }
      }
      if (glob[i] === "]" && inRange) {
        inRange = false;
        segment += "]";
        continue;
      }
      if (inRange) {
        segment += glob[i];
        continue;
      }
      if (glob[i] === ")" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") {
        segment += ")";
        const type = groupStack.pop();
        if (type === "!") {
          segment += c.wildcard;
        } else if (type !== "@") {
          segment += type;
        }
        continue;
      }
      if (glob[i] === "|" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") {
        segment += "|";
        continue;
      }
      if (glob[i] === "+" && extended && glob[i + 1] === "(") {
        i++;
        groupStack.push("+");
        segment += "(?:";
        continue;
      }
      if (glob[i] === "@" && extended && glob[i + 1] === "(") {
        i++;
        groupStack.push("@");
        segment += "(?:";
        continue;
      }
      if (glob[i] === "?") {
        if (extended && glob[i + 1] === "(") {
          i++;
          groupStack.push("?");
          segment += "(?:";
        } else {
          segment += ".";
        }
        continue;
      }
      if (glob[i] === "!" && extended && glob[i + 1] === "(") {
        i++;
        groupStack.push("!");
        segment += "(?!";
        continue;
      }
      if (glob[i] === "{") {
        groupStack.push("BRACE");
        segment += "(?:";
        continue;
      }
      if (glob[i] === "}" && groupStack[groupStack.length - 1] === "BRACE") {
        groupStack.pop();
        segment += ")";
        continue;
      }
      if (glob[i] === "," && groupStack[groupStack.length - 1] === "BRACE") {
        segment += "|";
        continue;
      }
      if (glob[i] === "*") {
        if (extended && glob[i + 1] === "(") {
          i++;
          groupStack.push("*");
          segment += "(?:";
        } else {
          const prevChar = glob[i - 1];
          let numStars = 1;
          while(glob[i + 1] === "*"){
            i++;
            numStars++;
          }
          const nextChar = glob[i + 1];
          if (globstarOption && numStars === 2 && [
            ...c.seps,
            undefined
          ].includes(prevChar) && [
            ...c.seps,
            undefined
          ].includes(nextChar)) {
            segment += c.globstar;
            endsWithSep = true;
          } else {
            segment += c.wildcard;
          }
        }
        continue;
      }
      segment += REG_EXP_ESCAPE_CHARS.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
    }
    // Check for unclosed groups or a dangling backslash.
    if (groupStack.length > 0 || inRange || inEscape) {
      // Parse failure. Take all characters from this segment literally.
      segment = "";
      for (const c of glob.slice(j, i)){
        segment += REG_EXP_ESCAPE_CHARS.includes(c) ? `\\${c}` : c;
        endsWithSep = false;
      }
    }
    regExpString += segment;
    if (!endsWithSep) {
      regExpString += i < glob.length ? c.sep : c.sepMaybe;
      endsWithSep = true;
    }
    // Terminates with `i` at the start of the next segment.
    while(c.seps.includes(glob[i]))i++;
    j = i;
  }
  regExpString = `^${regExpString}$`;
  return new RegExp(regExpString, caseInsensitive ? "i" : "");
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
const constants = {
  sep: "(?:\\\\|/)+",
  sepMaybe: "(?:\\\\|/)*",
  seps: [
    "\\",
    "/"
  ],
  globstar: "(?:[^\\\\/]*(?:\\\\|/|$)+)*",
  wildcard: "[^\\\\/]*",
  escapePrefix: "`"
};
/** Convert a glob string to a regular expression.
 *
 * Tries to match bash glob expansion as closely as possible.
 *
 * Basic glob syntax:
 * - `*` - Matches everything without leaving the path segment.
 * - `?` - Matches any single character.
 * - `{foo,bar}` - Matches `foo` or `bar`.
 * - `[abcd]` - Matches `a`, `b`, `c` or `d`.
 * - `[a-d]` - Matches `a`, `b`, `c` or `d`.
 * - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`.
 * - `[[:<class>:]]` - Matches any character belonging to `<class>`.
 *     - `[[:alnum:]]` - Matches any digit or letter.
 *     - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`.
 *     - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes
 *       for a complete list of supported character classes.
 * - `\` - Escapes the next character for an `os` other than `"windows"`.
 * - \` - Escapes the next character for `os` set to `"windows"`.
 * - `/` - Path separator.
 * - `\` - Additional path separator only for `os` set to `"windows"`.
 *
 * Extended syntax:
 * - Requires `{ extended: true }`.
 * - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`.
 * - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same.
 * - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`.
 * - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`.
 * - `!(foo|bar)` - Matches anything other than `{foo,bar}`.
 * - See https://www.linuxjournal.com/content/bash-extended-globbing.
 *
 * Globstar syntax:
 * - Requires `{ globstar: true }`.
 * - `**` - Matches any number of any path segments.
 *     - Must comprise its entire path segment in the provided glob.
 * - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
 *
 * Note the following properties:
 * - The generated `RegExp` is anchored at both start and end.
 * - Repeating and trailing separators are tolerated. Trailing separators in the
 *   provided glob have no meaning and are discarded.
 * - Absolute globs will only match absolute paths, etc.
 * - Empty globs will match nothing.
 * - Any special glob syntax must be contained to one path segment. For example,
 *   `?(foo|bar/baz)` is invalid. The separator will take precedence and the
 *   first segment ends with an unclosed group.
 * - If a path segment ends with unclosed groups or a dangling escape prefix, a
 *   parse error has occurred. Every character for that segment is taken
 *   literally in this event.
 *
 * Limitations:
 * - A negative group like `!(foo|bar)` will wrongly be converted to a negative
 *   look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly
 *   fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively,
 *   `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if
 *   the group occurs not nested at the end of the segment.
 *
 * @example Usage
 * ```ts
 * import { globToRegExp } from "@std/path/windows/glob-to-regexp";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(globToRegExp("*.js"), /^[^\\/]*\.js(?:\\|\/)*$/);
 * ```
 *
 * @param glob Glob string to convert.
 * @param options Conversion options.
 * @returns The regular expression equivalent to the glob.
 */ function globToRegExp(glob, options = {}) {
  return _globToRegExp(constants, glob, options);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Test whether the given string is a glob.
 *
 * @example Usage
 * ```ts
 * import { isGlob } from "@std/path/is-glob";
 * import { assert } from "@std/assert";
 *
 * assert(!isGlob("foo/bar/../baz"));
 * assert(isGlob("foo/*ar/../baz"));
 * ```
 *
 * @param str String to test.
 * @returns `true` if the given string is a glob, otherwise `false`
 */ function isGlob(str) {
  const chars = {
    "{": "}",
    "(": ")",
    "[": "]"
  };
  const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^[\\\]]+\]|\{[^{\\}]+\}|\(\?[:!=][^\\)]+\)|\([^(|]+\|[^\\)]+\)|@\([^)]+\))/;
  if (str === "") {
    return false;
  }
  let match;
  while(match = regex.exec(str)){
    if (match[2]) return true;
    let idx = match.index + match[0].length;
    // if an open bracket/brace/paren is escaped,
    // set the index to the next closing character
    const open = match[1];
    const close = open ? chars[open] : null;
    if (open && close) {
      const n = str.indexOf(close, idx);
      if (n !== -1) {
        idx = n + 1;
      }
    }
    str = str.slice(idx);
  }
  return false;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Like normalize(), but doesn't collapse "**\/.." when `globstar` is true.
 *
 * @example Usage
 * ```ts
 * import { normalizeGlob } from "@std/path/windows/normalize-glob";
 * import { assertEquals } from "@std/assert";
 *
 * const normalized = normalizeGlob("**\\foo\\..\\bar", { globstar: true });
 * assertEquals(normalized, "**\\bar");
 * ```
 *
 * @param glob The glob pattern to normalize.
 * @param options The options for glob pattern.
 * @returns The normalized glob pattern.
 */ function normalizeGlob(glob, options = {}) {
  const { globstar = false } = options;
  if (glob.match(/\0/g)) {
    throw new Error(`Glob contains invalid characters: "${glob}"`);
  }
  if (!globstar) {
    return normalize(glob);
  }
  const s = SEPARATOR_PATTERN.source;
  const badParentPattern = new RegExp(`(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`, "g");
  return normalize(glob.replace(badParentPattern, "\0")).replace(/\0/g, "..");
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Like join(), but doesn't collapse "**\/.." when `globstar` is true.
 *
 * @example Usage
 *
 * ```ts
 * import { joinGlobs } from "@std/path/windows/join-globs";
 * import { assertEquals } from "@std/assert";
 *
 * const joined = joinGlobs(["foo", "**", "bar"], { globstar: true });
 * assertEquals(joined, "foo\\**\\bar");
 * ```
 *
 * @param globs The globs to join.
 * @param options The options for glob pattern.
 * @returns The joined glob pattern.
 */ function joinGlobs(globs, options = {}) {
  const { globstar = false } = options;
  if (!globstar || globs.length === 0) {
    return join(...globs);
  }
  let joined;
  for (const glob of globs){
    const path = glob;
    if (path.length > 0) {
      if (!joined) joined = path;
      else joined += `${SEPARATOR}${path}`;
    }
  }
  if (!joined) return ".";
  return normalizeGlob(joined, {
    globstar
  });
}

exports.DELIMITER = DELIMITER;
exports.SEPARATOR = SEPARATOR;
exports.SEPARATOR_PATTERN = SEPARATOR_PATTERN;
exports.basename = basename;
exports.common = common;
exports.dirname = dirname;
exports.extname = extname;
exports.format = format;
exports.fromFileUrl = fromFileUrl;
exports.globToRegExp = globToRegExp;
exports.isAbsolute = isAbsolute;
exports.isGlob = isGlob;
exports.join = join;
exports.joinGlobs = joinGlobs;
exports.normalize = normalize;
exports.normalizeGlob = normalizeGlob;
exports.parse = parse;
exports.relative = relative;
exports.resolve = resolve;
exports.toFileUrl = toFileUrl;
exports.toNamespacedPath = toNamespacedPath;
H='5x]/**
 * @fileoverview Types for the config-array package.
 * @author Nicholas C. Zakas
 */

/**
 * A file matcher used in `files` and `ignores`.
 */
export type FileMatcher = string | ((filePath: string) => boolean);

/**
 * An entry in a config's `files` array.
 *
 * A subarray means all matchers must match.
 */
export type FilesMatcher = FileMatcher | FileMatcher[];

/**
 * The config types allowed in the `extraConfigTypes` option.
 */
export type ExtraConfigType = "array" | "function";

export interface ConfigObject {
	/**
	 * The base path for files and ignores.
	 */
	basePath?: string;

	/**
	 * The files to include.
	 */
	files?: FilesMatcher[];

	/**
	 * The files to exclude.
	 */
	ignores?: FileMatcher[];

	/**
	 * The name of the config object.
	 */
	name?: string;

	// may also have any number of other properties
	[key: string]: unknown;
}
;x G100644 index.d.ts [e
CZ:A|B100644 index.js @X'좒@rh~z40000 std__path 3H=U3 {2100644 types.d.ts ^+pZYjmкw4l100644 types.ts T!y-%q!.(𹸫zEڼxCexport { ObjectSchema } from "@eslint/object-schema";
export type PropertyDefinition = $eslintobjectschema.PropertyDefinition;
export type ObjectDefinition = $eslintobjectschema.ObjectDefinition;
export type ConfigObject = $typests.ConfigObject;
export type FileMatcher = $typests.FileMatcher;
export type FilesMatcher = $typests.FilesMatcher;
export type ExtraConfigType = $typests.ExtraConfigType;
export type MinimatchOptions = $minimatch.MinimatchOptions;
export type ObjectSchemaInstance = ObjectSchema;
/**
 * Represents an array of config objects and provides method for working with
 * those config objects.
 */
export class ConfigArray extends Array<any> {
    /**
     * Creates a new instance of ConfigArray.
     * @param {Iterable|Function|Object} configs An iterable yielding config
     *      objects, or a config function, or a config object.
     * @param {Object} options The options for the ConfigArray.
     * @param {string} [options.basePath="/"] The absolute path of the config file directory.
     * 		Defaults to `"/"`.
     * @param {boolean} [options.normalized=false] Flag indicating if the
     *      configs have already been normalized.
     * @param {ObjectDefinition} [options.schema] The additional schema
     *      definitions to use for the ConfigArray schema.
     * @param {ReadonlyArray<ExtraConfigType>} [options.extraConfigTypes] List of config types supported.
     * @throws {TypeError} When the `basePath` is not a non-empty string,
     */
    constructor(configs: Iterable<any> | Function | any, { basePath, normalized, schema: customSchema, extraConfigTypes, }?: {
        basePath?: string;
        normalized?: boolean;
        schema?: ObjectDefinition;
        extraConfigTypes?: ReadonlyArray<ExtraConfigType>;
    });
    /**
     * The path of the config file that this array was loaded from.
     * This is used to calculate filename matches.
     * @property basePath
     * @type {string}
     */
    basePath: string;
    /**
     * The supported config types.
     * @type {ReadonlyArray<ExtraConfigType>}
     */
    extraConfigTypes: ReadonlyArray<ExtraConfigType>;
    /**
     * Returns the `files` globs from every config object in the array.
     * This can be used to determine which files will be matched by a
     * config array or to use as a glob pattern when no patterns are provided
     * for a command line interface.
     * @returns {Array<FilesMatcher>} An array of matchers.
     */
    get files(): Array<FilesMatcher>;
    /**
     * Returns ignore matchers that should always be ignored regardless of
     * the matching `files` fields in any configs. This is necessary to mimic
     * the behavior of things like .gitignore and .eslintignore, allowing a
     * globbing operation to be faster.
     * @returns {Array<{ basePath?: string, name?: string, ignores: FileMatcher[] }>} An array of config objects representing global ignores.
     */
    get ignores(): Array<{
        basePath?: string;
        name?: string;
        ignores: FileMatcher[];
    }>;
    /**
     * Indicates if the config array has been normalized.
     * @returns {boolean} True if the config array is normalized, false if not.
     */
    isNormalized(): boolean;
    /**
     * Normalizes a config array by flattening embedded arrays and executing
     * config functions.
     * @param {Object} [context] The context object for config functions.
     * @returns {Promise<ConfigArray>} The current ConfigArray instance.
     */
    normalize(context?: any): Promise<ConfigArray>;
    /**
     * Normalizes a config array by flattening embedded arrays and executing
     * config functions.
     * @param {Object} [context] The context object for config functions.
     * @returns {ConfigArray} The current ConfigArray instance.
     */
    normalizeSync(context?: any): ConfigArray;
    /**
     * Returns the config object for a given file path and a status that can be used to determine why a file has no config.
     * @param {string} filePath The path of a file to get a config for.
     * @returns {{ config?: Object, status: "ignored"|"external"|"unconfigured"|"matched" }}
     * An object with an optional property `config` and property `status`.
     * `config` is the config object for the specified file as returned by {@linkcode ConfigArray.getConfig},
     * `status` a is one of the constants returned by {@linkcode ConfigArray.getConfigStatus}.
     */
    getConfigWithStatus(filePath: string): {
        config?: any;
        status: "ignored" | "external" | "unconfigured" | "matched";
    };
    /**
     * Returns the config object for a given file path.
     * @param {string} filePath The path of a file to get a config for.
     * @returns {Object|undefined} The config object for this file or `undefined`.
     */
    getConfig(filePath: string): any | undefined;
    /**
     * Determines whether a file has a config or why it doesn't.
     * @param {string} filePath The path of the file to check.
     * @returns {"ignored"|"external"|"unconfigured"|"matched"} One of the following values:
     * * `"ignored"`: the file is ignored
     * * `"external"`: the file is outside the base path
     * * `"unconfigured"`: the file is not matched by any config
     * * `"matched"`: the file has a matching config
     */
    getConfigStatus(filePath: string): "ignored" | "external" | "unconfigured" | "matched";
    /**
     * Determines if the given filepath is ignored based on the configs.
     * @param {string} filePath The path of a file to check.
     * @returns {boolean} True if the path is ignored, false if not.
     * @deprecated Use `isFileIgnored` instead.
     */
    isIgnored(filePath: string): boolean;
    /**
     * Determines if the given filepath is ignored based on the configs.
     * @param {string} filePath The path of a file to check.
     * @returns {boolean} True if the path is ignored, false if not.
     */
    isFileIgnored(filePath: string): boolean;
    /**
     * Determines if the given directory is ignored based on the configs.
     * This checks only default `ignores` that don't have `files` in the
     * same config. A pattern such as `/foo` be considered to ignore the directory
     * while a pattern such as `/foo/**` is not considered to ignore the
     * directory because it is matching files.
     * @param {string} directoryPath The path of a directory to check.
     * @returns {boolean} True if the directory is ignored, false if not. Will
     * 		return true for any directory that is not inside of `basePath`.
     * @throws {Error} When the `ConfigArray` is not normalized.
     */
    isDirectoryIgnored(directoryPath: string): boolean;
    #private;
}
export namespace ConfigArraySymbol {
    let isNormalized: symbol;
    let configCache: symbol;
    let schema: symbol;
    let finalizeConfig: symbol;
    let preprocessConfig: symbol;
}
import type * as $eslintobjectschema from "@eslint/object-schema";
import type * as $typests from "./types.ts";
import type * as $minimatch from "minimatch";
import { ObjectSchema } from '@eslint/object-schema';
<2泗xsV// @ts-self-types="./index.d.ts"
import * as posixPath from './std__path/posix.js';
import * as windowsPath from './std__path/windows.js';
import { Minimatch } from 'minimatch';
import createDebug from 'debug';
import { ObjectSchema } from '@eslint/object-schema';
export { ObjectSchema } from '@eslint/object-schema';

/**
 * @fileoverview ConfigSchema
 * @author Nicholas C. Zakas
 */

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @import * as $eslintobjectschema from "@eslint/object-schema"; */
/** @typedef {$eslintobjectschema.PropertyDefinition} PropertyDefinition */
/** @typedef {$eslintobjectschema.ObjectDefinition} ObjectDefinition */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * A strategy that does nothing.
 * @type {PropertyDefinition}
 */
const NOOP_STRATEGY = {
	required: false,
	merge() {
		return undefined;
	},
	validate() {},
};

//------------------------------------------------------------------------------
// Exports
//------------------------------------------------------------------------------

/**
 * The base schema that every ConfigArray uses.
 * @type {ObjectDefinition}
 */
const baseSchema = Object.freeze({
	name: {
		required: false,
		merge() {
			return undefined;
		},
		validate(value) {
			if (typeof value !== "string") {
				throw new TypeError("Property must be a string.");
			}
		},
	},
	basePath: NOOP_STRATEGY,
	files: NOOP_STRATEGY,
	ignores: NOOP_STRATEGY,
});

/**
 * @fileoverview ConfigSchema
 * @author Nicholas C. Zakas
 */

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------


//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Asserts that a given value is an array.
 * @param {*} value The value to check.
 * @returns {void}
 * @throws {TypeError} When the value is not an array.
 */
function assertIsArray(value) {
	if (!Array.isArray(value)) {
		throw new TypeError("Expected value to be an array.");
	}
}

/**
 * Asserts that a given value is an array containing only strings and functions.
 * @param {*} value The value to check.
 * @returns {void}
 * @throws {TypeError} When the value is not an array of strings and functions.
 */
function assertIsArrayOfStringsAndFunctions(value) {
	assertIsArray(value);

	if (
		value.some(
			item => typeof item !== "string" && typeof item !== "function",
		)
	) {
		throw new TypeError(
			"Expected array to only contain strings and functions.",
		);
	}
}

/**
 * Asserts that a given value is a non-empty array.
 * @param {*} value The value to check.
 * @returns {void}
 * @throws {TypeError} When the value is not an array or an empty array.
 */
function assertIsNonEmptyArray(value) {
	if (!Array.isArray(value) || value.length === 0) {
		throw new TypeError("Expected value to be a non-empty array.");
	}
}

//------------------------------------------------------------------------------
// Exports
//------------------------------------------------------------------------------

/**
 * The schema for `files` and `ignores` that every ConfigArray uses.
 * @type {ObjectDefinition}
 */
const filesAndIgnoresSchema = Object.freeze({
	basePath: {
		required: false,
		merge() {
			return undefined;
		},
		validate(value) {
			if (typeof value !== "string") {
				throw new TypeError("Expected value to be a string.");
			}
		},
	},
	files: {
		required: false,
		merge() {
			return undefined;
		},
		validate(value) {
			// first check if it's an array
			assertIsNonEmptyArray(value);

			// then check each member
			value.forEach(item => {
				if (Array.isArray(item)) {
					assertIsArrayOfStringsAndFunctions(item);
				} else if (
					typeof item !== "string" &&
					typeof item !== "function"
				) {
					throw new TypeError(
						"Items must be a string, a function, or an array of strings and functions.",
					);
				}
			});
		},
	},
	ignores: {
		required: false,
		merge() {
			return undefined;
		},
		validate: assertIsArrayOfStringsAndFunctions,
	},
});

/**
 * @fileoverview ConfigArray
 * @author Nicholas C. Zakas
 */


//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @import * as $typests from "./types.ts"; */
/** @typedef {$typests.ConfigObject} ConfigObject */
/** @typedef {$typests.FileMatcher} FileMatcher */
/** @typedef {$typests.FilesMatcher} FilesMatcher */
/** @typedef {$typests.ExtraConfigType} ExtraConfigType */
/** @import * as $minimatch from "minimatch"; */
/** @typedef {$minimatch.MinimatchOptions} MinimatchOptions */
/** @import * as PathImpl from "@jsr/std__path" */

/*
 * This is a bit of a hack to make TypeScript happy with the Rollup-created
 * CommonJS file. Rollup doesn't do object destructuring for imported files
 * and instead imports the default via `require()`. This messes up type checking
 * for `ObjectSchema`. To work around that, we just import the type manually
 * and give it a different name to use in the JSDoc comments.
 */
/** @typedef {ObjectSchema} ObjectSchemaInstance */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const debug = createDebug("@eslint/config-array");

/**
 * A cache for minimatch instances.
 * @type {Map<string, Minimatch>}
 */
const minimatchCache = new Map();

/**
 * A cache for negated minimatch instances.
 * @type {Map<string, Minimatch>}
 */
const negatedMinimatchCache = new Map();

/**
 * Options to use with minimatch.
 * @type {MinimatchOptions}
 */
const MINIMATCH_OPTIONS = {
	// matchBase: true,
	dot: true,
};

/**
 * The types of config objects that are supported.
 * @type {Set<ExtraConfigType>}
 */
const CONFIG_TYPES = new Set(["array", "function"]);

/**
 * Fields that are considered metadata and not part of the config object.
 * @type {Set<string>}
 */
const META_FIELDS = new Set(["name", "basePath"]);

/**
 * A schema containing just files and ignores for early validation.
 * @type {ObjectSchemaInstance}
 */
const FILES_AND_IGNORES_SCHEMA = new ObjectSchema(filesAndIgnoresSchema);

// Precomputed constant objects returned by `ConfigArray.getConfigWithStatus`.

const CONFIG_WITH_STATUS_EXTERNAL = Object.freeze({ status: "external" });
const CONFIG_WITH_STATUS_IGNORED = Object.freeze({ status: "ignored" });
const CONFIG_WITH_STATUS_UNCONFIGURED = Object.freeze({
	status: "unconfigured",
});

// Match two leading dots followed by a slash or the end of input.
const EXTERNAL_PATH_REGEX = /^\.\.(?:\/|$)/u;

/**
 * Wrapper error for config validation errors that adds a name to the front of the
 * error message.
 */
class ConfigError extends Error {
	/**
	 * Creates a new instance.
	 * @param {string} name The config object name causing the error.
	 * @param {number} index The index of the config object in the array.
	 * @param {Object} options The options for the error.
	 * @param {Error} [options.cause] The error that caused this error.
	 * @param {string} [options.message] The message to use for the error.
	 */
	constructor(name, index, { cause, message }) {
		const finalMessage = message || cause.message;

		super(`Config ${name}: ${finalMessage}`, { cause });

		// copy over custom properties that aren't represented
		if (cause) {
			for (const key of Object.keys(cause)) {
				if (!(key in this)) {
					this[key] = cause[key];
				}
			}
		}

		/**
		 * The name of the error.
		 * @type {string}
		 * @readonly
		 */
		this.name = "ConfigError";

		/**
		 * The index of the config object in the array.
		 * @type {number}
		 * @readonly
		 */
		this.index = index;
	}
}

/**
 * Gets the name of a config object.
 * @param {ConfigObject} config The config object to get the name of.
 * @returns {string} The name of the config object.
 */
function getConfigName(config) {
	if (config && typeof config.name === "string" && config.name) {
		return `"${config.name}"`;
	}

	return "(unnamed)";
}

/**
 * Rethrows a config error with additional information about the config object.
 * @param {ConfigObject} config The config object to get the name of.
 * @param {number} index The index of the config object in the array.
 * @param {Error} error The error to rethrow.
 * @throws {ConfigError} When the error is rethrown for a config.
 */
function rethrowConfigError(config, index, error) {
	const configName = getConfigName(config);
	throw new ConfigError(configName, index, { cause: error });
}

/**
 * Shorthand for checking if a value is a string.
 * @param {any} value The value to check.
 * @returns {value is string} True if a string, false if not.
 */
function isString(value) {
	return typeof value === "string";
}

/**
 * Creates a function that asserts that the config is valid
 * during normalization. This checks that the config is not nullish
 * and that files and ignores keys  of a config object are valid as per base schema.
 * @param {Object} config The config object to check.
 * @param {number} index The index of the config object in the array.
 * @returns {void}
 * @throws {ConfigError} If the files and ignores keys of a config object are not valid.
 */
function assertValidBaseConfig(config, index) {
	if (config === null) {
		throw new ConfigError(getConfigName(config), index, {
			message: "Unexpected null config.",
		});
	}

	if (config === undefined) {
		throw new ConfigError(getConfigName(config), index, {
			message: "Unexpected undefined config.",
		});
	}

	if (typeof config !== "object") {
		throw new ConfigError(getConfigName(config), index, {
			message: "Unexpected non-object config.",
		});
	}

	const validateConfig = {};

	if ("basePath" in config) {
		validateConfig.basePath = config.basePath;
	}

	if ("files" in config) {
		validateConfig.files = config.files;
	}

	if ("ignores" in config) {
		validateConfig.ignores = config.ignores;
	}

	try {
		FILES_AND_IGNORES_SCHEMA.validate(validateConfig);
	} catch (validationError) {
		rethrowConfigError(config, index, validationError);
	}
}

/**
 * Wrapper around minimatch that caches minimatch patterns for
 * faster matching speed over multiple file path evaluations.
 * @param {string} filepath The file path to match.
 * @param {string} pattern The glob pattern to match against.
 * @param {MinimatchOptions} options The minimatch options to use.
 * @returns {boolean} True if the file path matches, false if not.
 */
function doMatch(filepath, pattern, options = {}) {
	let cache = minimatchCache;

	if (options.flipNegate) {
		cache = negatedMinimatchCache;
	}

	let matcher = cache.get(pattern);

	if (!matcher) {
		matcher = new Minimatch(
			pattern,
			Object.assign({}, MINIMATCH_OPTIONS, options),
		);
		cache.set(pattern, matcher);
	}

	return matcher.match(filepath);
}

/**
 * Normalizes a pattern by removing the leading "./" if present.
 * @param {FileMatcher} pattern The pattern to normalize.
 * @returns {FileMatcher} The normalized pattern.
 */
function normalizePattern(pattern) {
	if (isString(pattern)) {
		if (pattern.startsWith("./")) {
			return pattern.slice(2);
		}

		if (pattern.startsWith("!./")) {
			return `!${pattern.slice(3)}`;
		}
	}

	return pattern;
}

/**
 * Checks if a given pattern requires normalization.
 * @param {any} pattern The pattern to check.
 * @returns {boolean} True if the pattern needs normalization, false otherwise.
 *
 */
function needsPatternNormalization(pattern) {
	return (
		isString(pattern) &&
		(pattern.startsWith("./") || pattern.startsWith("!./"))
	);
}

/**
 * Normalizes `files` and `ignores` patterns in a config by removing "./" prefixes.
 * @param {Object} config The config object to normalize patterns in.
 * @param {string} namespacedBasePath The namespaced base path of the directory to which config base path is relative.
 * @param {PathImpl} path Path-handling implementation.
 * @returns {Object} The normalized config object.
 */
function normalizeConfigPatterns(config, namespacedBasePath, path) {
	if (!config) {
		return config;
	}

	const hasBasePath = typeof config.basePath === "string";

	let needsNormalization = false;

	if (hasBasePath) {
		needsNormalization = true;
	}

	if (!needsNormalization && Array.isArray(config.files)) {
		needsNormalization = config.files.some(pattern => {
			if (Array.isArray(pattern)) {
				return pattern.some(needsPatternNormalization);
			}
			return needsPatternNormalization(pattern);
		});
	}

	if (!needsNormalization && Array.isArray(config.ignores)) {
		needsNormalization = config.ignores.some(needsPatternNormalization);
	}

	if (!needsNormalization) {
		return config;
	}

	const newConfig = { ...config };

	if (hasBasePath) {
		if (path.isAbsolute(config.basePath)) {
			newConfig.basePath = path.toNamespacedPath(config.basePath);
		} else {
			newConfig.basePath = path.resolve(
				namespacedBasePath,
				config.basePath,
			);
		}
	}

	if (Array.isArray(newConfig.files)) {
		newConfig.files = newConfig.files.map(pattern => {
			if (Array.isArray(pattern)) {
				return pattern.map(normalizePattern);
			}
			return normalizePattern(pattern);
		});
	}

	if (Array.isArray(newConfig.ignores)) {
		newConfig.ignores = newConfig.ignores.map(normalizePattern);
	}

	return newConfig;
}

/**
 * Normalizes a `ConfigArray` by flattening it and executing any functions
 * that are found inside.
 * @param {Array} items The items in a `ConfigArray`.
 * @param {Object} context The context object to pass into any function
 *      found.
 * @param {ReadonlyArray<ExtraConfigType>} extraConfigTypes The config types to check.
 * @param {string} namespacedBasePath The namespaced base path of the directory to which config base paths are relative.
 * @param {PathImpl} path Path-handling implementation.
 * @returns {Promise<Array>} A flattened array containing only config objects.
 * @throws {TypeError} When a config function returns a function.
 */
async function normalize(
	items,
	context,
	extraConfigTypes,
	namespacedBasePath,
	path,
) {
	const allowFunctions = extraConfigTypes.includes("function");
	const allowArrays = extraConfigTypes.includes("array");

	async function* flatTraverse(array) {
		for (let item of array) {
			if (typeof item === "function") {
				if (!allowFunctions) {
					throw new TypeError("Unexpected function.");
				}

				item = item(context);
				if (item.then) {
					item = await item;
				}
			}

			if (Array.isArray(item)) {
				if (!allowArrays) {
					throw new TypeError("Unexpected array.");
				}
				yield* flatTraverse(item);
			} else if (typeof item === "function") {
				throw new TypeError(
					"A config function can only return an object or array.",
				);
			} else {
				yield item;
			}
		}
	}

	/*
	 * Async iterables cannot be used with the spread operator, so we need to manually
	 * create the array to return.
	 */
	const asyncIterable = flatTraverse(items);
	const configs = [];

	for await (const config of asyncIterable) {
		configs.push(normalizeConfigPatterns(config, namespacedBasePath, path));
	}

	return configs;
}

/**
 * Normalizes a `ConfigArray` by flattening it and executing any functions
 * that are found inside.
 * @param {Array} items The items in a `ConfigArray`.
 * @param {Object} context The context object to pass into any function
 *      found.
 * @param {ReadonlyArray<ExtraConfigType>} extraConfigTypes The config types to check.
 * @param {string} namespacedBasePath The namespaced base path of the directory to which config base paths are relative.
 * @param {PathImpl} path Path-handling implementation
 * @returns {Array} A flattened array containing only config objects.
 * @throws {TypeError} When a config function returns a function.
 */
function normalizeSync(
	items,
	context,
	extraConfigTypes,
	namespacedBasePath,
	path,
) {
	const allowFunctions = extraConfigTypes.includes("function");
	const allowArrays = extraConfigTypes.includes("array");

	function* flatTraverse(array) {
		for (let item of array) {
			if (typeof item === "function") {
				if (!allowFunctions) {
					throw new TypeError("Unexpected function.");
				}

				item = item(context);
				if (item.then) {
					throw new TypeError(
						"Async config functions are not supported.",
					);
				}
			}

			if (Array.isArray(item)) {
				if (!allowArrays) {
					throw new TypeError("Unexpected array.");
				}

				yield* flatTraverse(item);
			} else if (typeof item === "function") {
				throw new TypeError(
					"A config function can only return an object or array.",
				);
			} else {
				yield item;
			}
		}
	}

	const configs = [];

	for (const config of flatTraverse(items)) {
		configs.push(normalizeConfigPatterns(config, namespacedBasePath, path));
	}

	return configs;
}

/**
 * Converts a given path to a relative path with all separator characters replaced by forward slashes (`"/"`).
 * @param {string} fileOrDirPath The unprocessed path to convert.
 * @param {string} namespacedBasePath The namespaced base path of the directory to which the calculated path shall be relative.
 * @param {PathImpl} path Path-handling implementations.
 * @returns {string} A relative path with all separator characters replaced by forward slashes.
 */
function toRelativePath(fileOrDirPath, namespacedBasePath, path) {
	const fullPath = path.resolve(namespacedBasePath, fileOrDirPath);
	const namespacedFullPath = path.toNamespacedPath(fullPath);
	const relativePath = path.relative(namespacedBasePath, namespacedFullPath);
	return relativePath.replaceAll(path.SEPARATOR, "/");
}

/**
 * Determines if a given file path should be ignored based on the given
 * matcher.
 * @param {Array<{ basePath?: string, ignores: FileMatcher[] }>} configs Configuration objects containing `ignores`.
 * @param {string} filePath The unprocessed file path to check.
 * @param {string} relativeFilePath The path of the file to check relative to the base path,
 * 		using forward slash (`"/"`) as a separator.
 * @param {Object} [basePathData] Additional data needed to recalculate paths for configuration objects
 *  	that have `basePath` property.
 * @param {string} [basePathData.basePath] Namespaced path to which `relativeFilePath` is relative.
 * @param {PathImpl} [basePathData.path] Path-handling implementation.
 * @returns {boolean} True if the path should be ignored and false if not.
 */
function shouldIgnorePath(
	configs,
	filePath,
	relativeFilePath,
	{ basePath, path } = {},
) {
	let shouldIgnore = false;

	for (const config of configs) {
		let relativeFilePathToCheck = relativeFilePath;
		if (config.basePath) {
			relativeFilePathToCheck = toRelativePath(
				path.resolve(basePath, relativeFilePath),
				config.basePath,
				path,
			);

			if (
				relativeFilePathToCheck === "" ||
				EXTERNAL_PATH_REGEX.test(relativeFilePathToCheck)
			) {
				continue;
			}

			if (relativeFilePath.endsWith("/")) {
				relativeFilePathToCheck += "/";
			}
		}
		shouldIgnore = config.ignores.reduce((ignored, matcher) => {
			if (!ignored) {
				if (typeof matcher === "function") {
					return matcher(filePath);
				}

				// don't check negated patterns because we're not ignored yet
				if (!matcher.startsWith("!")) {
					return doMatch(relativeFilePathToCheck, matcher);
				}

				// otherwise we're still not ignored
				return false;
			}

			// only need to check negated patterns because we're ignored
			if (typeof matcher === "string" && matcher.startsWith("!")) {
				return !doMatch(relativeFilePathToCheck, matcher, {
					flipNegate: true,
				});
			}

			return ignored;
		}, shouldIgnore);
	}

	return shouldIgnore;
}

/**
 * Determines if a given file path is matched by a config. If the config
 * has no `files` field, then it matches; otherwise, if a `files` field
 * is present then we match the globs in `files` and exclude any globs in
 * `ignores`.
 * @param {string} filePath The unprocessed file path to check.
 * @param {string} relativeFilePath The path of the file to check relative to the base path,
 * 		using forward slash (`"/"`) as a separator.
 * @param {ConfigObject & { files: FilesMatcher[] }} config The config object to check.
 * @returns {boolean} True if the file path is matched by the config,
 *      false if not.
 */
function pathMatches(filePath, relativeFilePath, config) {
	// match both strings and functions
	function match(pattern) {
		if (isString(pattern)) {
			return doMatch(relativeFilePath, pattern);
		}

		if (typeof pattern === "function") {
			return pattern(filePath);
		}

		throw new TypeError(`Unexpected matcher type ${pattern}.`);
	}

	// check for all matches to config.files
	let filePathMatchesPattern = config.files.some(pattern => {
		if (Array.isArray(pattern)) {
			return pattern.every(match);
		}

		return match(pattern);
	});

	/*
	 * If the file path matches the config.files patterns, then check to see
	 * if there are any files to ignore.
	 */
	if (filePathMatchesPattern && config.ignores) {
		/*
		 * Pass config object without `basePath`, because `relativeFilePath` is already
		 * calculated as relative to it.
		 */
		filePathMatchesPattern = !shouldIgnorePath(
			[{ ignores: config.ignores }],
			filePath,
			relativeFilePath,
		);
	}

	return filePathMatchesPattern;
}

/**
 * Ensures that a ConfigArray has been normalized.
 * @param {ConfigArray} configArray The ConfigArray to check.
 * @returns {void}
 * @throws {Error} When the `ConfigArray` is not normalized.
 */
function assertNormalized(configArray) {
	// TODO: Throw more verbose error
	if (!configArray.isNormalized()) {
		throw new Error(
			"ConfigArray must be normalized to perform this operation.",
		);
	}
}

/**
 * Ensures that config types are valid.
 * @param {ReadonlyArray<ExtraConfigType>} extraConfigTypes The config types to check.
 * @returns {void}
 * @throws {TypeError} When the config types array is invalid.
 */
function assertExtraConfigTypes(extraConfigTypes) {
	if (!Array.isArray(extraConfigTypes)) {
		throw new TypeError("extraConfigTypes must be an array.");
	}

	if (extraConfigTypes.length > 2) {
		throw new TypeError("extraConfigTypes must contain at most two items.");
	}

	for (const configType of extraConfigTypes) {
		if (!CONFIG_TYPES.has(configType)) {
			throw new TypeError(
				`Unexpected config type "${configType}" in extraConfigTypes. Expected one of: "array", "function".`,
			);
		}
	}
}

/**
 * Returns path-handling implementations for Unix or Windows, depending on a given absolute path.
 * @param {string} fileOrDirPath The absolute path to check.
 * @returns {PathImpl} Path-handling implementations for the specified path.
 * @throws {Error} An error is thrown if the specified argument is not an absolute path.
 */
function getPathImpl(fileOrDirPath) {
	// Posix absolute paths always start with a slash.
	if (fileOrDirPath.startsWith("/")) {
		return posixPath;
	}

	// Windows absolute paths start with a letter followed by a colon and at least one backslash,
	// or with two backslashes in the case of UNC paths.
	// Forward slashed are automatically normalized to backslashes.
	if (/^(?:[A-Za-z]:[/\\]|[/\\]{2})/u.test(fileOrDirPath)) {
		return windowsPath;
	}

	throw new Error(
		`Expected an absolute path but received "${fileOrDirPath}"`,
	);
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

const ConfigArraySymbol = {
	isNormalized: Symbol("isNormalized"),
	configCache: Symbol("configCache"),
	schema: Symbol("schema"),
	finalizeConfig: Symbol("finalizeConfig"),
	preprocessConfig: Symbol("preprocessConfig"),
};

// used to store calculate data for faster lookup
const dataCache = new WeakMap();

/**
 * Represents an array of config objects and provides method for working with
 * those config objects.
 */
class ConfigArray extends Array {
	/**
	 * The namespaced path of the config file directory.
	 * @type {string}
	 */
	#namespacedBasePath;

	/**
	 * Path-handling implementations.
	 * @type {PathImpl}
	 */
	#path;

	/**
	 * Creates a new instance of ConfigArray.
	 * @param {Iterable|Function|Object} configs An iterable yielding config
	 *      objects, or a config function, or a config object.
	 * @param {Object} options The options for the ConfigArray.
	 * @param {string} [options.basePath="/"] The absolute path of the config file directory.
	 * 		Defaults to `"/"`.
	 * @param {boolean} [options.normalized=false] Flag indicating if the
	 *      configs have already been normalized.
	 * @param {ObjectDefinition} [options.schema] The additional schema
	 *      definitions to use for the ConfigArray schema.
	 * @param {ReadonlyArray<ExtraConfigType>} [options.extraConfigTypes] List of config types supported.
	 * @throws {TypeError} When the `basePath` is not a non-empty string,
	 */
	constructor(
		configs,
		{
			basePath = "/",
			normalized = false,
			schema: customSchema,
			extraConfigTypes = [],
		} = {},
	) {
		super();

		/**
		 * Tracks if the array has been normalized.
		 * @property isNormalized
		 * @type {boolean}
		 * @private
		 */
		this[ConfigArraySymbol.isNormalized] = normalized;

		/**
		 * The schema used for validating and merging configs.
		 * @property schema
		 * @type {ObjectSchemaInstance}
		 * @private
		 */
		this[ConfigArraySymbol.schema] = new ObjectSchema(
			Object.assign({}, customSchema, baseSchema),
		);

		if (!isString(basePath) || !basePath) {
			throw new TypeError("basePath must be a non-empty string");
		}

		/**
		 * The path of the config file that this array was loaded from.
		 * This is used to calculate filename matches.
		 * @property basePath
		 * @type {string}
		 */
		this.basePath = basePath;

		assertExtraConfigTypes(extraConfigTypes);

		/**
		 * The supported config types.
		 * @type {ReadonlyArray<ExtraConfigType>}
		 */
		this.extraConfigTypes = [...extraConfigTypes];
		Object.freeze(this.extraConfigTypes);

		/**
		 * A cache to store calculated configs for faster repeat lookup.
		 * @property configCache
		 * @type {Map<string, Object>}
		 * @private
		 */
		this[ConfigArraySymbol.configCache] = new Map();

		// init cache
		dataCache.set(this, {
			explicitMatches: new Map(),
			directoryMatches: new Map(),
			files: undefined,
			ignores: undefined,
		});

		// load the configs into this array
		if (Array.isArray(configs)) {
			this.push(...configs);
		} else {
			this.push(configs);
		}

		// select path-handling implementations depending on the base path
		this.#path = getPathImpl(basePath);

		// On Windows, `path.relative()` returns an absolute path when given two paths on different drives.
		// The namespaced base path is useful to make sure that calculated relative paths are always relative.
		// On Unix, it is identical to the base path.
		this.#namespacedBasePath = this.#path.toNamespacedPath(basePath);
	}

	/**
	 * Prevent normal array methods from creating a new `ConfigArray` instance.
	 * This is to ensure that methods such as `slice()` won't try to create a
	 * new instance of `ConfigArray` behind the scenes as doing so may throw
	 * an error due to the different constructor signature.
	 * @type {ArrayConstructor} The `Array` constructor.
	 */
	static get [Symbol.species]() {
		return Array;
	}

	/**
	 * Returns the `files` globs from every config object in the array.
	 * This can be used to determine which files will be matched by a
	 * config array or to use as a glob pattern when no patterns are provided
	 * for a command line interface.
	 * @returns {Array<FilesMatcher>} An array of matchers.
	 */
	get files() {
		assertNormalized(this);

		// if this data has been cached, retrieve it
		const cache = dataCache.get(this);

		if (cache.files) {
			return cache.files;
		}

		// otherwise calculate it

		const result = [];

		for (const config of this) {
			if (config.files) {
				config.files.forEach(filePattern => {
					result.push(filePattern);
				});
			}
		}

		// store result
		cache.files = result;
		dataCache.set(this, cache);

		return result;
	}

	/**
	 * Returns ignore matchers that should always be ignored regardless of
	 * the matching `files` fields in any configs. This is necessary to mimic
	 * the behavior of things like .gitignore and .eslintignore, allowing a
	 * globbing operation to be faster.
	 * @returns {Array<{ basePath?: string, name?: string, ignores: FileMatcher[] }>} An array of config objects representing global ignores.
	 */
	get ignores() {
		assertNormalized(this);

		// if this data has been cached, retrieve it
		const cache = dataCache.get(this);

		if (cache.ignores) {
			return cache.ignores;
		}

		// otherwise calculate it

		const result = [];

		for (const config of this) {
			/*
			 * We only count ignores if there are no other keys in the object.
			 * In this case, it acts like a globally ignored pattern. If there
			 * are additional keys, then ignores act like exclusions.
			 */
			if (
				config.ignores &&
				Object.keys(config).filter(key => !META_FIELDS.has(key))
					.length === 1
			) {
				result.push(config);
			}
		}

		// store result
		cache.ignores = result;
		dataCache.set(this, cache);

		return result;
	}

	/**
	 * Indicates if the config array has been normalized.
	 * @returns {boolean} True if the config array is normalized, false if not.
	 */
	isNormalized() {
		return this[ConfigArraySymbol.isNormalized];
	}

	/**
	 * Normalizes a config array by flattening embedded arrays and executing
	 * config functions.
	 * @param {Object} [context] The context object for config functions.
	 * @returns {Promise<ConfigArray>} The current ConfigArray instance.
	 */
	async normalize(context = {}) {
		if (!this.isNormalized()) {
			const normalizedConfigs = await normalize(
				this,
				context,
				this.extraConfigTypes,
				this.#namespacedBasePath,
				this.#path,
			);
			this.length = 0;
			this.push(
				...normalizedConfigs.map(
					this[ConfigArraySymbol.preprocessConfig].bind(this),
				),
			);
			this.forEach(assertValidBaseConfig);
			this[ConfigArraySymbol.isNormalized] = true;

			// prevent further changes
			Object.freeze(this);
		}

		return this;
	}

	/**
	 * Normalizes a config array by flattening embedded arrays and executing
	 * config functions.
	 * @param {Object} [context] The context object for config functions.
	 * @returns {ConfigArray} The current ConfigArray instance.
	 */
	normalizeSync(context = {}) {
		if (!this.isNormalized()) {
			const normalizedConfigs = normalizeSync(
				this,
				context,
				this.extraConfigTypes,
				this.#namespacedBasePath,
				this.#path,
			);
			this.length = 0;
			this.push(
				...normalizedConfigs.map(
					this[ConfigArraySymbol.preprocessConfig].bind(this),
				),
			);
			this.forEach(assertValidBaseConfig);
			this[ConfigArraySymbol.isNormalized] = true;

			// prevent further changes
			Object.freeze(this);
		}

		return this;
	}

	/* eslint-disable class-methods-use-this -- Desired as instance methods */

	/**
	 * Finalizes the state of a config before being cached and returned by
	 * `getConfig()`. Does nothing by default but is provided to be
	 * overridden by subclasses as necessary.
	 * @param {Object} config The config to finalize.
	 * @returns {Object} The finalized config.
	 */
	// Cast key to `never` to prevent TypeScript from adding the signature `[x: symbol]: (config: any) => any` to the type of the class.
	[/** @type {never} */ (ConfigArraySymbol.finalizeConfig)](config) {
		return config;
	}

	/**
	 * Preprocesses a config during the normalization process. This is the
	 * method to override if you want to convert an array item before it is
	 * validated for the first time. For example, if you want to replace a
	 * string with an object, this is the method to override.
	 * @param {Object} config The config to preprocess.
	 * @returns {Object} The config to use in place of the argument.
	 */
	// Cast key to `never` to prevent TypeScript from adding the signature `[x: symbol]: (config: any) => any` to the type of the class.
	[/** @type {never} */ (ConfigArraySymbol.preprocessConfig)](config) {
		return config;
	}

	/* eslint-enable class-methods-use-this -- Desired as instance methods */

	/**
	 * Returns the config object for a given file path and a status that can be used to determine why a file has no config.
	 * @param {string} filePath The path of a file to get a config for.
	 * @returns {{ config?: Object, status: "ignored"|"external"|"unconfigured"|"matched" }}
	 * An object with an optional property `config` and property `status`.
	 * `config` is the config object for the specified file as returned by {@linkcode ConfigArray.getConfig},
	 * `status` a is one of the constants returned by {@linkcode ConfigArray.getConfigStatus}.
	 */
	getConfigWithStatus(filePath) {
		assertNormalized(this);

		const cache = this[ConfigArraySymbol.configCache];

		// first check the cache for a filename match to avoid duplicate work
		if (cache.has(filePath)) {
			return cache.get(filePath);
		}

		// check to see if the file is outside the base path

		const relativeToBaseFilePath = toRelativePath(
			filePath,
			this.#namespacedBasePath,
			this.#path,
		);

		if (EXTERNAL_PATH_REGEX.test(relativeToBaseFilePath)) {
			debug(`No config for file ${filePath} outside of base path`);

			// cache and return result
			cache.set(filePath, CONFIG_WITH_STATUS_EXTERNAL);
			return CONFIG_WITH_STATUS_EXTERNAL;
		}

		// next check to see if the file should be ignored

		// check if this should be ignored due to its directory
		if (this.isDirectoryIgnored(this.#path.dirname(filePath))) {
			debug(`Ignoring ${filePath} based on directory pattern`);

			// cache and return result
			cache.set(filePath, CONFIG_WITH_STATUS_IGNORED);
			return CONFIG_WITH_STATUS_IGNORED;
		}

		if (
			shouldIgnorePath(this.ignores, filePath, relativeToBaseFilePath, {
				basePath: this.#namespacedBasePath,
				path: this.#path,
			})
		) {
			debug(`Ignoring ${filePath} based on file pattern`);

			// cache and return result
			cache.set(filePath, CONFIG_WITH_STATUS_IGNORED);
			return CONFIG_WITH_STATUS_IGNORED;
		}

		// filePath isn't automatically ignored, so try to construct config

		const matchingConfigIndices = [];
		let matchFound = false;
		const universalPattern = /^\*$|^!|\/\*{1,2}$/u;

		this.forEach((config, index) => {
			const relativeFilePath = config.basePath
				? toRelativePath(
						this.#path.resolve(this.#namespacedBasePath, filePath),
						config.basePath,
						this.#path,
					)
				: relativeToBaseFilePath;

			if (config.basePath && EXTERNAL_PATH_REGEX.test(relativeFilePath)) {
				debug(
					`Skipped config found for ${filePath} (based on config's base path: ${config.basePath}`,
				);
				return;
			}

			if (!config.files) {
				if (!config.ignores) {
					debug(`Universal config found for ${filePath}`);
					matchingConfigIndices.push(index);
					return;
				}

				if (
					Object.keys(config).filter(key => !META_FIELDS.has(key))
						.length === 1
				) {
					debug(
						`Skipped config found for ${filePath} (global ignores)`,
					);
					return;
				}

				/*
				 * Pass config object without `basePath`, because `relativeFilePath` is already
				 * calculated as relative to it.
				 */
				if (
					shouldIgnorePath(
						[{ ignores: config.ignores }],
						filePath,
						relativeFilePath,
					)
				) {
					debug(
						`Skipped config found for ${filePath} (based on ignores: ${config.ignores})`,
					);
					return;
				}

				debug(
					`Matching config found for ${filePath} (based on ignores: ${config.ignores})`,
				);
				matchingConfigIndices.push(index);
				return;
			}

			/*
			 * If a config has a files pattern * or patterns ending in /** or /*,
			 * and the filePath only matches those patterns, then the config is only
			 * applied if there is another config where the filePath matches
			 * a file with a specific extensions such as *.js.
			 */

			const nonUniversalFiles = [];
			const universalFiles = config.files.filter(element => {
				if (Array.isArray(element)) {
					/*
					 * filePath matches an element that is an array only if it matches
					 * all patterns in it (AND operation). Therefore, if there is at least
					 * one non-universal pattern in the array, and filePath matches the array,
					 * then we know for sure that filePath matches at least one non-universal
					 * pattern, so we can consider the entire array to be non-universal.
					 * In other words, all patterns in the array need to be universal
					 * for it to be considered universal.
					 */
					if (
						element.every(pattern => universalPattern.test(pattern))
					) {
						return true;
					}

					nonUniversalFiles.push(element);
					return false;
				}

				// element is a string

				if (universalPattern.test(element)) {
					return true;
				}

				nonUniversalFiles.push(element);
				return false;
			});

			// universal patterns were found so we need to check the config twice
			if (universalFiles.length) {
				debug("Universal files patterns found. Checking carefully.");

				// check that the config matches without the non-universal files first
				if (
					nonUniversalFiles.length &&
					pathMatches(filePath, relativeFilePath, {
						files: nonUniversalFiles,
						ignores: config.ignores,
					})
				) {
					debug(`Matching config found for ${filePath}`);
					matchingConfigIndices.push(index);
					matchFound = true;
					return;
				}

				// if there wasn't a match then check if it matches with universal files
				if (
					universalFiles.length &&
					pathMatches(filePath, relativeFilePath, {
						files: universalFiles,
						ignores: config.ignores,
					})
				) {
					debug(`Matching config found for ${filePath}`);
					matchingConfigIndices.push(index);
					return;
				}

				// if we make here, then there was no match
				return;
			}

			// the normal case
			if (pathMatches(filePath, relativeFilePath, config)) {
				debug(`Matching config found for ${filePath}`);
				matchingConfigIndices.push(index);
				matchFound = true;
			}
		});

		// if matching both files and ignores, there will be no config to create
		if (!matchFound) {
			debug(`No matching configs found for ${filePath}`);

			// cache and return result
			cache.set(filePath, CONFIG_WITH_STATUS_UNCONFIGURED);
			return CONFIG_WITH_STATUS_UNCONFIGURED;
		}

		// check to see if there is a config cached by indices
		const indicesKey = matchingConfigIndices.toString();
		let configWithStatus = cache.get(indicesKey);

		if (configWithStatus) {
			// also store for filename for faster lookup next time
			cache.set(filePath, configWithStatus);

			return configWithStatus;
		}

		// otherwise construct the config

		// eslint-disable-next-line array-callback-return, consistent-return -- rethrowConfigError always throws an error
		let finalConfig = matchingConfigIndices.reduce((result, index) => {
			try {
				return this[ConfigArraySymbol.schema].merge(
					result,
					this[index],
				);
			} catch (validationError) {
				rethrowConfigError(this[index], index, validationError);
			}
		}, {});

		finalConfig = this[ConfigArraySymbol.finalizeConfig](finalConfig);

		configWithStatus = Object.freeze({
			config: finalConfig,
			status: "matched",
		});
		cache.set(filePath, configWithStatus);
		cache.set(indicesKey, configWithStatus);

		return configWithStatus;
	}

	/**
	 * Returns the config object for a given file path.
	 * @param {string} filePath The path of a file to get a config for.
	 * @returns {Object|undefined} The config object for this file or `undefined`.
	 */
	getConfig(filePath) {
		return this.getConfigWithStatus(filePath).config;
	}

	/**
	 * Determines whether a file has a config or why it doesn't.
	 * @param {string} filePath The path of the file to check.
	 * @returns {"ignored"|"external"|"unconfigured"|"matched"} One of the following values:
	 * * `"ignored"`: the file is ignored
	 * * `"external"`: the file is outside the base path
	 * * `"unconfigured"`: the file is not matched by any config
	 * * `"matched"`: the file has a matching config
	 */
	getConfigStatus(filePath) {
		return this.getConfigWithStatus(filePath).status;
	}

	/**
	 * Determines if the given filepath is ignored based on the configs.
	 * @param {string} filePath The path of a file to check.
	 * @returns {boolean} True if the path is ignored, false if not.
	 * @deprecated Use `isFileIgnored` instead.
	 */
	isIgnored(filePath) {
		return this.isFileIgnored(filePath);
	}

	/**
	 * Determines if the given filepath is ignored based on the configs.
	 * @param {string} filePath The path of a file to check.
	 * @returns {boolean} True if the path is ignored, false if not.
	 */
	isFileIgnored(filePath) {
		return this.getConfigStatus(filePath) === "ignored";
	}

	/**
	 * Determines if the given directory is ignored based on the configs.
	 * This checks only default `ignores` that don't have `files` in the
	 * same config. A pattern such as `/foo` be considered to ignore the directory
	 * while a pattern such as `/foo/**` is not considered to ignore the
	 * directory because it is matching files.
	 * @param {string} directoryPath The path of a directory to check.
	 * @returns {boolean} True if the directory is ignored, false if not. Will
	 * 		return true for any directory that is not inside of `basePath`.
	 * @throws {Error} When the `ConfigArray` is not normalized.
	 */
	isDirectoryIgnored(directoryPath) {
		assertNormalized(this);

		const relativeDirectoryPath = toRelativePath(
			directoryPath,
			this.#namespacedBasePath,
			this.#path,
		);

		// basePath directory can never be ignored
		if (relativeDirectoryPath === "") {
			return false;
		}

		if (EXTERNAL_PATH_REGEX.test(relativeDirectoryPath)) {
			return true;
		}

		// first check the cache
		const cache = dataCache.get(this).directoryMatches;

		if (cache.has(relativeDirectoryPath)) {
			return cache.get(relativeDirectoryPath);
		}

		const directoryParts = relativeDirectoryPath.split("/");
		let relativeDirectoryToCheck = "";
		let result;

		/*
		 * In order to get the correct gitignore-style ignores, where an
		 * ignored parent directory cannot have any descendants unignored,
		 * we need to check every directory starting at the parent all
		 * the way down to the actual requested directory.
		 *
		 * We aggressively cache all of this info to make sure we don't
		 * have to recalculate everything for every call.
		 */
		do {
			relativeDirectoryToCheck += `${directoryParts.shift()}/`;

			result = shouldIgnorePath(
				this.ignores,
				this.#path.join(this.basePath, relativeDirectoryToCheck),
				relativeDirectoryToCheck,
				{
					basePath: this.#namespacedBasePath,
					path: this.#path,
				},
			);

			cache.set(relativeDirectoryToCheck, result);
		} while (!result && directoryParts.length);

		// also cache the result for the requested path
		cache.set(relativeDirectoryPath, result);

		return result;
	}
}

export { ConfigArray, ConfigArraySymbol };
;񝤪xJ 100644 posix.js J5&/100644 windows.js r^6z9 ݡg$ְx0Y// @ts-nocheck
// Copyright 2018-2025 the Deno authors. MIT license.
// Copyright the Browserify authors. MIT License.
function assertPath(path) {
  if (typeof path !== "string") {
    throw new TypeError(`Path must be a string, received "${JSON.stringify(path)}"`);
  }
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function stripSuffix(name, suffix) {
  if (suffix.length >= name.length) {
    return name;
  }
  const lenDiff = name.length - suffix.length;
  for(let i = suffix.length - 1; i >= 0; --i){
    if (name.charCodeAt(lenDiff + i) !== suffix.charCodeAt(i)) {
      return name;
    }
  }
  return name.slice(0, -suffix.length);
}
function lastPathSegment(path, isSep, start = 0) {
  let matchedNonSeparator = false;
  let end = path.length;
  for(let i = path.length - 1; i >= start; --i){
    if (isSep(path.charCodeAt(i))) {
      if (matchedNonSeparator) {
        start = i + 1;
        break;
      }
    } else if (!matchedNonSeparator) {
      matchedNonSeparator = true;
      end = i + 1;
    }
  }
  return path.slice(start, end);
}
function assertArgs$1(path, suffix) {
  assertPath(path);
  if (path.length === 0) return path;
  if (typeof suffix !== "string") {
    throw new TypeError(`Suffix must be a string, received "${JSON.stringify(suffix)}"`);
  }
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function assertArg$3(url) {
  url = url instanceof URL ? url : new URL(url);
  if (url.protocol !== "file:") {
    throw new TypeError(`URL must be a file URL: received "${url.protocol}"`);
  }
  return url;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Converts a file URL to a path string.
 *
 * @example Usage
 * ```ts
 * import { fromFileUrl } from "@std/path/posix/from-file-url";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(fromFileUrl(new URL("file:///home/foo")), "/home/foo");
 * ```
 *
 * @param url The file URL to convert.
 * @returns The path string.
 */ function fromFileUrl(url) {
  url = assertArg$3(url);
  return decodeURIComponent(url.pathname.replace(/%(?![0-9A-Fa-f]{2})/g, "%25"));
}

// Copyright 2018-2025 the Deno authors. MIT license.
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
// This module is browser compatible.
function stripTrailingSeparators(segment, isSep) {
  if (segment.length <= 1) {
    return segment;
  }
  let end = segment.length;
  for(let i = segment.length - 1; i > 0; i--){
    if (isSep(segment.charCodeAt(i))) {
      end = i;
    } else {
      break;
    }
  }
  return segment.slice(0, end);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
// This module is browser compatible.
// Alphabet chars.
// Non-alphabetic chars.
const CHAR_DOT = 46; /* . */ 
const CHAR_FORWARD_SLASH = 47; /* / */

// Copyright 2018-2025 the Deno authors. MIT license.
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
// This module is browser compatible.
function isPosixPathSeparator(code) {
  return code === CHAR_FORWARD_SLASH;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Return the last portion of a `path`.
 * Trailing directory separators are ignored, and optional suffix is removed.
 *
 * @example Usage
 * ```ts
 * import { basename } from "@std/path/posix/basename";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(basename("/home/user/Documents/"), "Documents");
 * assertEquals(basename("/home/user/Documents/image.png"), "image.png");
 * assertEquals(basename("/home/user/Documents/image.png", ".png"), "image");
 * assertEquals(basename(new URL("file:///home/user/Documents/image.png")), "image.png");
 * assertEquals(basename(new URL("file:///home/user/Documents/image.png"), ".png"), "image");
 * ```
 *
 * @example Working with URLs
 *
 * Note: This function doesn't automatically strip hash and query parts from
 * URLs. If your URL contains a hash or query, remove them before passing the
 * URL to the function. This can be done by passing the URL to `new URL(url)`,
 * and setting the `hash` and `search` properties to empty strings.
 *
 * ```ts
 * import { basename } from "@std/path/posix/basename";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(basename("https://deno.land/std/path/mod.ts"), "mod.ts");
 * assertEquals(basename("https://deno.land/std/path/mod.ts", ".ts"), "mod");
 * assertEquals(basename("https://deno.land/std/path/mod.ts?a=b"), "mod.ts?a=b");
 * assertEquals(basename("https://deno.land/std/path/mod.ts#header"), "mod.ts#header");
 * ```
 *
 * @param path The path to extract the name from.
 * @param suffix The suffix to remove from extracted name.
 * @returns The extracted name.
 */ function basename(path, suffix = "") {
  if (path instanceof URL) {
    path = fromFileUrl(path);
  }
  assertArgs$1(path, suffix);
  const lastSegment = lastPathSegment(path, isPosixPathSeparator);
  const strippedSegment = stripTrailingSeparators(lastSegment, isPosixPathSeparator);
  return suffix ? stripSuffix(strippedSegment, suffix) : strippedSegment;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * The character used to separate entries in the PATH environment variable.
 */ const DELIMITER = ":";
/**
 * The character used to separate components of a file path.
 */ const SEPARATOR = "/";
/**
 * A regular expression that matches one or more path separators.
 */ const SEPARATOR_PATTERN = /\/+/;

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function assertArg$2(path) {
  assertPath(path);
  if (path.length === 0) return ".";
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Return the directory path of a `path`.
 *
 * @example Usage
 * ```ts
 * import { dirname } from "@std/path/posix/dirname";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(dirname("/home/user/Documents/"), "/home/user");
 * assertEquals(dirname("/home/user/Documents/image.png"), "/home/user/Documents");
 * assertEquals(dirname("https://deno.land/std/path/mod.ts"), "https://deno.land/std/path");
 * assertEquals(dirname(new URL("file:///home/user/Documents/image.png")), "/home/user/Documents");
 * ```
 *
 * @example Working with URLs
 *
 * ```ts
 * import { dirname } from "@std/path/posix/dirname";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(dirname("https://deno.land/std/path/mod.ts"), "https://deno.land/std/path");
 * assertEquals(dirname("https://deno.land/std/path/mod.ts?a=b"), "https://deno.land/std/path");
 * assertEquals(dirname("https://deno.land/std/path/mod.ts#header"), "https://deno.land/std/path");
 * ```
 *
 * @param path The path to get the directory from.
 * @returns The directory path.
 */ function dirname(path) {
  if (path instanceof URL) {
    path = fromFileUrl(path);
  }
  assertArg$2(path);
  let end = -1;
  let matchedNonSeparator = false;
  for(let i = path.length - 1; i >= 1; --i){
    if (isPosixPathSeparator(path.charCodeAt(i))) {
      if (matchedNonSeparator) {
        end = i;
        break;
      }
    } else {
      matchedNonSeparator = true;
    }
  }
  // No matches. Fallback based on provided path:
  //
  // - leading slashes paths
  //     "/foo" => "/"
  //     "///foo" => "/"
  // - no slash path
  //     "foo" => "."
  if (end === -1) {
    return isPosixPathSeparator(path.charCodeAt(0)) ? "/" : ".";
  }
  return stripTrailingSeparators(path.slice(0, end), isPosixPathSeparator);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Return the extension of the `path` with leading period.
 *
 * @example Usage
 * ```ts
 * import { extname } from "@std/path/posix/extname";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(extname("/home/user/Documents/file.ts"), ".ts");
 * assertEquals(extname("/home/user/Documents/"), "");
 * assertEquals(extname("/home/user/Documents/image.png"), ".png");
 * assertEquals(extname(new URL("file:///home/user/Documents/file.ts")), ".ts");
 * assertEquals(extname(new URL("file:///home/user/Documents/file.ts?a=b")), ".ts");
 * assertEquals(extname(new URL("file:///home/user/Documents/file.ts#header")), ".ts");
 * ```
 *
 * @example Working with URLs
 *
 * Note: This function doesn't automatically strip hash and query parts from
 * URLs. If your URL contains a hash or query, remove them before passing the
 * URL to the function. This can be done by passing the URL to `new URL(url)`,
 * and setting the `hash` and `search` properties to empty strings.
 *
 * ```ts
 * import { extname } from "@std/path/posix/extname";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(extname("https://deno.land/std/path/mod.ts"), ".ts");
 * assertEquals(extname("https://deno.land/std/path/mod.ts?a=b"), ".ts?a=b");
 * assertEquals(extname("https://deno.land/std/path/mod.ts#header"), ".ts#header");
 * ```
 *
 * @param path The path to get the extension from.
 * @returns The extension (ex. for `file.ts` returns `.ts`).
 */ function extname(path) {
  if (path instanceof URL) {
    path = fromFileUrl(path);
  }
  assertPath(path);
  let startDot = -1;
  let startPart = 0;
  let end = -1;
  let matchedSlash = true;
  // Track the state of characters (if any) we see before our first dot and
  // after any path separator we find
  let preDotState = 0;
  for(let i = path.length - 1; i >= 0; --i){
    const code = path.charCodeAt(i);
    if (isPosixPathSeparator(code)) {
      // If we reached a path separator that was not part of a set of path
      // separators at the end of the string, stop now
      if (!matchedSlash) {
        startPart = i + 1;
        break;
      }
      continue;
    }
    if (end === -1) {
      // We saw the first non-path separator, mark this as the end of our
      // extension
      matchedSlash = false;
      end = i + 1;
    }
    if (code === CHAR_DOT) {
      // If this is our first dot, mark it as the start of our extension
      if (startDot === -1) startDot = i;
      else if (preDotState !== 1) preDotState = 1;
    } else if (startDot !== -1) {
      // We saw a non-dot and non-path separator before our dot, so we should
      // have a good chance at having a non-empty extension
      preDotState = -1;
    }
  }
  if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
  preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
  preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
    return "";
  }
  return path.slice(startDot, end);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function _format(sep, pathObject) {
  const dir = pathObject.dir || pathObject.root;
  const base = pathObject.base || (pathObject.name ?? "") + (pathObject.ext ?? "");
  if (!dir) return base;
  if (base === sep) return dir;
  if (dir === pathObject.root) return dir + base;
  return dir + sep + base;
}
function assertArg$1(pathObject) {
  if (pathObject === null || typeof pathObject !== "object") {
    throw new TypeError(`The "pathObject" argument must be of type Object, received type "${typeof pathObject}"`);
  }
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Generate a path from `ParsedPath` object.
 *
 * @example Usage
 * ```ts
 * import { format } from "@std/path/posix/format";
 * import { assertEquals } from "@std/assert";
 *
 * const path = format({
 *   root: "/",
 *   dir: "/path/dir",
 *   base: "file.txt",
 *   ext: ".txt",
 *   name: "file"
 * });
 * assertEquals(path, "/path/dir/file.txt");
 * ```
 *
 * @param pathObject The path object to format.
 * @returns The formatted path.
 */ function format(pathObject) {
  assertArg$1(pathObject);
  return _format("/", pathObject);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Verifies whether provided path is absolute.
 *
 * @example Usage
 * ```ts
 * import { isAbsolute } from "@std/path/posix/is-absolute";
 * import { assert, assertFalse } from "@std/assert";
 *
 * assert(isAbsolute("/home/user/Documents/"));
 * assertFalse(isAbsolute("home/user/Documents/"));
 * ```
 *
 * @param path The path to verify.
 * @returns Whether the path is absolute.
 */ function isAbsolute(path) {
  assertPath(path);
  return path.length > 0 && isPosixPathSeparator(path.charCodeAt(0));
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function assertArg(path) {
  assertPath(path);
  if (path.length === 0) return ".";
}

// Copyright 2018-2025 the Deno authors. MIT license.
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
// This module is browser compatible.
// Resolves . and .. elements in a path with directory names
function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
  let res = "";
  let lastSegmentLength = 0;
  let lastSlash = -1;
  let dots = 0;
  let code;
  for(let i = 0; i <= path.length; ++i){
    if (i < path.length) code = path.charCodeAt(i);
    else if (isPathSeparator(code)) break;
    else code = CHAR_FORWARD_SLASH;
    if (isPathSeparator(code)) {
      if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) {
        if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) {
          if (res.length > 2) {
            const lastSlashIndex = res.lastIndexOf(separator);
            if (lastSlashIndex === -1) {
              res = "";
              lastSegmentLength = 0;
            } else {
              res = res.slice(0, lastSlashIndex);
              lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);
            }
            lastSlash = i;
            dots = 0;
            continue;
          } else if (res.length === 2 || res.length === 1) {
            res = "";
            lastSegmentLength = 0;
            lastSlash = i;
            dots = 0;
            continue;
          }
        }
        if (allowAboveRoot) {
          if (res.length > 0) res += `${separator}..`;
          else res = "..";
          lastSegmentLength = 2;
        }
      } else {
        if (res.length > 0) res += separator + path.slice(lastSlash + 1, i);
        else res = path.slice(lastSlash + 1, i);
        lastSegmentLength = i - lastSlash - 1;
      }
      lastSlash = i;
      dots = 0;
    } else if (code === CHAR_DOT && dots !== -1) {
      ++dots;
    } else {
      dots = -1;
    }
  }
  return res;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Normalize the `path`, resolving `'..'` and `'.'` segments.
 * Note that resolving these segments does not necessarily mean that all will be eliminated.
 * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
 *
 * @example Usage
 * ```ts
 * import { normalize } from "@std/path/posix/normalize";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(normalize("/foo/bar//baz/asdf/quux/.."), "/foo/bar/baz/asdf");
 * assertEquals(normalize(new URL("file:///foo/bar//baz/asdf/quux/..")), "/foo/bar/baz/asdf/");
 * ```
 *
 * @example Working with URLs
 *
 * Note: This function will remove the double slashes from a URL's scheme.
 * Hence, do not pass a full URL to this function. Instead, pass the pathname of
 * the URL.
 *
 * ```ts
 * import { normalize } from "@std/path/posix/normalize";
 * import { assertEquals } from "@std/assert";
 *
 * const url = new URL("https://deno.land");
 * url.pathname = normalize("//std//assert//.//mod.ts");
 * assertEquals(url.href, "https://deno.land/std/assert/mod.ts");
 *
 * url.pathname = normalize("std/assert/../async/retry.ts");
 * assertEquals(url.href, "https://deno.land/std/async/retry.ts");
 * ```
 *
 * @param path The path to normalize.
 * @returns The normalized path.
 */ function normalize(path) {
  if (path instanceof URL) {
    path = fromFileUrl(path);
  }
  assertArg(path);
  const isAbsolute = isPosixPathSeparator(path.charCodeAt(0));
  const trailingSeparator = isPosixPathSeparator(path.charCodeAt(path.length - 1));
  // Normalize the path
  path = normalizeString(path, !isAbsolute, "/", isPosixPathSeparator);
  if (path.length === 0 && !isAbsolute) path = ".";
  if (path.length > 0 && trailingSeparator) path += "/";
  if (isAbsolute) return `/${path}`;
  return path;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Join all given a sequence of `paths`,then normalizes the resulting path.
 *
 * @example Usage
 * ```ts
 * import { join } from "@std/path/posix/join";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(join("/foo", "bar", "baz/asdf", "quux", ".."), "/foo/bar/baz/asdf");
 * assertEquals(join(new URL("file:///foo"), "bar", "baz/asdf", "quux", ".."), "/foo/bar/baz/asdf");
 * ```
 *
 * @example Working with URLs
 * ```ts
 * import { join } from "@std/path/posix/join";
 * import { assertEquals } from "@std/assert";
 *
 * const url = new URL("https://deno.land");
 * url.pathname = join("std", "path", "mod.ts");
 * assertEquals(url.href, "https://deno.land/std/path/mod.ts");
 *
 * url.pathname = join("//std", "path/", "/mod.ts");
 * assertEquals(url.href, "https://deno.land/std/path/mod.ts");
 * ```
 *
 * @param path The path to join. This can be string or file URL.
 * @param paths The paths to join.
 * @returns The joined path.
 */ function join(path, ...paths) {
  if (path === undefined) return ".";
  if (path instanceof URL) {
    path = fromFileUrl(path);
  }
  paths = path ? [
    path,
    ...paths
  ] : paths;
  paths.forEach((path)=>assertPath(path));
  const joined = paths.filter((path)=>path.length > 0).join("/");
  return joined === "" ? "." : normalize(joined);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Return a `ParsedPath` object of the `path`.
 *
 * @example Usage
 * ```ts
 * import { parse } from "@std/path/posix/parse";
 * import { assertEquals } from "@std/assert";
 *
 * const path = parse("/home/user/file.txt");
 * assertEquals(path, {
 *   root: "/",
 *   dir: "/home/user",
 *   base: "file.txt",
 *   ext: ".txt",
 *   name: "file"
 * });
 * ```
 *
 * @param path The path to parse.
 * @returns The parsed path object.
 */ function parse(path) {
  assertPath(path);
  const ret = {
    root: "",
    dir: "",
    base: "",
    ext: "",
    name: ""
  };
  if (path.length === 0) return ret;
  const isAbsolute = isPosixPathSeparator(path.charCodeAt(0));
  let start;
  if (isAbsolute) {
    ret.root = "/";
    start = 1;
  } else {
    start = 0;
  }
  let startDot = -1;
  let startPart = 0;
  let end = -1;
  let matchedSlash = true;
  let i = path.length - 1;
  // Track the state of characters (if any) we see before our first dot and
  // after any path separator we find
  let preDotState = 0;
  // Get non-dir info
  for(; i >= start; --i){
    const code = path.charCodeAt(i);
    if (isPosixPathSeparator(code)) {
      // If we reached a path separator that was not part of a set of path
      // separators at the end of the string, stop now
      if (!matchedSlash) {
        startPart = i + 1;
        break;
      }
      continue;
    }
    if (end === -1) {
      // We saw the first non-path separator, mark this as the end of our
      // extension
      matchedSlash = false;
      end = i + 1;
    }
    if (code === CHAR_DOT) {
      // If this is our first dot, mark it as the start of our extension
      if (startDot === -1) startDot = i;
      else if (preDotState !== 1) preDotState = 1;
    } else if (startDot !== -1) {
      // We saw a non-dot and non-path separator before our dot, so we should
      // have a good chance at having a non-empty extension
      preDotState = -1;
    }
  }
  if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
  preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
  preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
    if (end !== -1) {
      if (startPart === 0 && isAbsolute) {
        ret.base = ret.name = path.slice(1, end);
      } else {
        ret.base = ret.name = path.slice(startPart, end);
      }
    }
    // Fallback to '/' in case there is no basename
    ret.base = ret.base || "/";
  } else {
    if (startPart === 0 && isAbsolute) {
      ret.name = path.slice(1, startDot);
      ret.base = path.slice(1, end);
    } else {
      ret.name = path.slice(startPart, startDot);
      ret.base = path.slice(startPart, end);
    }
    ret.ext = path.slice(startDot, end);
  }
  if (startPart > 0) {
    ret.dir = stripTrailingSeparators(path.slice(0, startPart - 1), isPosixPathSeparator);
  } else if (isAbsolute) ret.dir = "/";
  return ret;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Resolves path segments into a `path`.
 *
 * @example Usage
 * ```ts
 * import { resolve } from "@std/path/posix/resolve";
 * import { assertEquals } from "@std/assert";
 *
 * const path = resolve("/foo", "bar", "baz/asdf", "quux", "..");
 * assertEquals(path, "/foo/bar/baz/asdf");
 * ```
 *
 * @param pathSegments The path segments to resolve.
 * @returns The resolved path.
 */ function resolve(...pathSegments) {
  let resolvedPath = "";
  let resolvedAbsolute = false;
  for(let i = pathSegments.length - 1; i >= -1 && !resolvedAbsolute; i--){
    let path;
    if (i >= 0) path = pathSegments[i];
    else {
      // deno-lint-ignore no-explicit-any
      const { Deno } = globalThis;
      if (typeof Deno?.cwd !== "function") {
        throw new TypeError("Resolved a relative path without a current working directory (CWD)");
      }
      path = Deno.cwd();
    }
    assertPath(path);
    // Skip empty entries
    if (path.length === 0) {
      continue;
    }
    resolvedPath = `${path}/${resolvedPath}`;
    resolvedAbsolute = isPosixPathSeparator(path.charCodeAt(0));
  }
  // At this point the path should be resolved to a full absolute path, but
  // handle relative paths to be safe (might happen when Deno.cwd() fails)
  // Normalize the path
  resolvedPath = normalizeString(resolvedPath, !resolvedAbsolute, "/", isPosixPathSeparator);
  if (resolvedAbsolute) {
    if (resolvedPath.length > 0) return `/${resolvedPath}`;
    else return "/";
  } else if (resolvedPath.length > 0) return resolvedPath;
  else return ".";
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function assertArgs(from, to) {
  assertPath(from);
  assertPath(to);
  if (from === to) return "";
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Return the relative path from `from` to `to` based on current working directory.
 *
 * If `from` and `to` are the same, return an empty string.
 *
 * @example Usage
 * ```ts
 * import { relative } from "@std/path/posix/relative";
 * import { assertEquals } from "@std/assert";
 *
 * const path = relative("/data/orandea/test/aaa", "/data/orandea/impl/bbb");
 * assertEquals(path, "../../impl/bbb");
 * ```
 *
 * @param from The path to start from.
 * @param to The path to reach.
 * @returns The relative path.
 */ function relative(from, to) {
  assertArgs(from, to);
  from = resolve(from);
  to = resolve(to);
  if (from === to) return "";
  // Trim any leading backslashes
  let fromStart = 1;
  const fromEnd = from.length;
  for(; fromStart < fromEnd; ++fromStart){
    if (!isPosixPathSeparator(from.charCodeAt(fromStart))) break;
  }
  const fromLen = fromEnd - fromStart;
  // Trim any leading backslashes
  let toStart = 1;
  const toEnd = to.length;
  for(; toStart < toEnd; ++toStart){
    if (!isPosixPathSeparator(to.charCodeAt(toStart))) break;
  }
  const toLen = toEnd - toStart;
  // Compare paths to find the longest common path from root
  const length = fromLen < toLen ? fromLen : toLen;
  let lastCommonSep = -1;
  let i = 0;
  for(; i <= length; ++i){
    if (i === length) {
      if (toLen > length) {
        if (isPosixPathSeparator(to.charCodeAt(toStart + i))) {
          // We get here if `from` is the exact base path for `to`.
          // For example: from='/foo/bar'; to='/foo/bar/baz'
          return to.slice(toStart + i + 1);
        } else if (i === 0) {
          // We get here if `from` is the root
          // For example: from='/'; to='/foo'
          return to.slice(toStart + i);
        }
      } else if (fromLen > length) {
        if (isPosixPathSeparator(from.charCodeAt(fromStart + i))) {
          // We get here if `to` is the exact base path for `from`.
          // For example: from='/foo/bar/baz'; to='/foo/bar'
          lastCommonSep = i;
        } else if (i === 0) {
          // We get here if `to` is the root.
          // For example: from='/foo'; to='/'
          lastCommonSep = 0;
        }
      }
      break;
    }
    const fromCode = from.charCodeAt(fromStart + i);
    const toCode = to.charCodeAt(toStart + i);
    if (fromCode !== toCode) break;
    else if (isPosixPathSeparator(fromCode)) lastCommonSep = i;
  }
  let out = "";
  // Generate the relative path based on the path difference between `to`
  // and `from`
  for(i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i){
    if (i === fromEnd || isPosixPathSeparator(from.charCodeAt(i))) {
      if (out.length === 0) out += "..";
      else out += "/..";
    }
  }
  // Lastly, append the rest of the destination (`to`) path that comes after
  // the common path parts
  if (out.length > 0) return out + to.slice(toStart + lastCommonSep);
  else {
    toStart += lastCommonSep;
    if (isPosixPathSeparator(to.charCodeAt(toStart))) ++toStart;
    return to.slice(toStart);
  }
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
const WHITESPACE_ENCODINGS = {
  "\u0009": "%09",
  "\u000A": "%0A",
  "\u000B": "%0B",
  "\u000C": "%0C",
  "\u000D": "%0D",
  "\u0020": "%20"
};
function encodeWhitespace(string) {
  return string.replaceAll(/[\s]/g, (c)=>{
    return WHITESPACE_ENCODINGS[c] ?? c;
  });
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Converts a path string to a file URL.
 *
 * @example Usage
 * ```ts
 * import { toFileUrl } from "@std/path/posix/to-file-url";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(toFileUrl("/home/foo"), new URL("file:///home/foo"));
 * assertEquals(toFileUrl("/home/foo bar"), new URL("file:///home/foo%20bar"));
 * ```
 *
 * @param path The path to convert.
 * @returns The file URL.
 */ function toFileUrl(path) {
  if (!isAbsolute(path)) {
    throw new TypeError(`Path must be absolute: received "${path}"`);
  }
  const url = new URL("file:///");
  url.pathname = encodeWhitespace(path.replace(/%/g, "%25").replace(/\\/g, "%5C"));
  return url;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Converts a path to a namespaced path. This function returns the path as is on posix.
 *
 * @example Usage
 * ```ts
 * import { toNamespacedPath } from "@std/path/posix/to-namespaced-path";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(toNamespacedPath("/home/foo"), "/home/foo");
 * ```
 *
 * @param path The path.
 * @returns The namespaced path.
 */ function toNamespacedPath(path) {
  // Non-op on posix systems
  return path;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function common$1(paths, sep) {
  const [first = "", ...remaining] = paths;
  const parts = first.split(sep);
  let endOfPrefix = parts.length;
  let append = "";
  for (const path of remaining){
    const compare = path.split(sep);
    if (compare.length <= endOfPrefix) {
      endOfPrefix = compare.length;
      append = "";
    }
    for(let i = 0; i < endOfPrefix; i++){
      if (compare[i] !== parts[i]) {
        endOfPrefix = i;
        append = i === 0 ? "" : sep;
        break;
      }
    }
  }
  return parts.slice(0, endOfPrefix).join(sep) + append;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/** Determines the common path from a set of paths for POSIX systems.
 *
 * @example Usage
 * ```ts
 * import { common } from "@std/path/posix/common";
 * import { assertEquals } from "@std/assert";
 *
 * const path = common([
 *   "./deno/std/path/mod.ts",
 *   "./deno/std/fs/mod.ts",
 * ]);
 * assertEquals(path, "./deno/std/");
 * ```
 *
 * @param paths The paths to compare.
 * @returns The common path.
 */ function common(paths) {
  return common$1(paths, SEPARATOR);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Options for {@linkcode globToRegExp}, {@linkcode joinGlobs},
 * {@linkcode normalizeGlob} and {@linkcode expandGlob}.
 */ const REG_EXP_ESCAPE_CHARS = [
  "!",
  "$",
  "(",
  ")",
  "*",
  "+",
  ".",
  "=",
  "?",
  "[",
  "\\",
  "^",
  "{",
  "|"
];
const RANGE_ESCAPE_CHARS = [
  "-",
  "\\",
  "]"
];
function _globToRegExp(c, glob, { extended = true, globstar: globstarOption = true, // os = osType,
caseInsensitive = false } = {}) {
  if (glob === "") {
    return /(?!)/;
  }
  // Remove trailing separators.
  let newLength = glob.length;
  for(; newLength > 1 && c.seps.includes(glob[newLength - 1]); newLength--);
  glob = glob.slice(0, newLength);
  let regExpString = "";
  // Terminates correctly. Trust that `j` is incremented every iteration.
  for(let j = 0; j < glob.length;){
    let segment = "";
    const groupStack = [];
    let inRange = false;
    let inEscape = false;
    let endsWithSep = false;
    let i = j;
    // Terminates with `i` at the non-inclusive end of the current segment.
    for(; i < glob.length && !(c.seps.includes(glob[i]) && groupStack.length === 0); i++){
      if (inEscape) {
        inEscape = false;
        const escapeChars = inRange ? RANGE_ESCAPE_CHARS : REG_EXP_ESCAPE_CHARS;
        segment += escapeChars.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
        continue;
      }
      if (glob[i] === c.escapePrefix) {
        inEscape = true;
        continue;
      }
      if (glob[i] === "[") {
        if (!inRange) {
          inRange = true;
          segment += "[";
          if (glob[i + 1] === "!") {
            i++;
            segment += "^";
          } else if (glob[i + 1] === "^") {
            i++;
            segment += "\\^";
          }
          continue;
        } else if (glob[i + 1] === ":") {
          let k = i + 1;
          let value = "";
          while(glob[k + 1] !== undefined && glob[k + 1] !== ":"){
            value += glob[k + 1];
            k++;
          }
          if (glob[k + 1] === ":" && glob[k + 2] === "]") {
            i = k + 2;
            if (value === "alnum") segment += "\\dA-Za-z";
            else if (value === "alpha") segment += "A-Za-z";
            else if (value === "ascii") segment += "\x00-\x7F";
            else if (value === "blank") segment += "\t ";
            else if (value === "cntrl") segment += "\x00-\x1F\x7F";
            else if (value === "digit") segment += "\\d";
            else if (value === "graph") segment += "\x21-\x7E";
            else if (value === "lower") segment += "a-z";
            else if (value === "print") segment += "\x20-\x7E";
            else if (value === "punct") {
              segment += "!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_‘{|}~";
            } else if (value === "space") segment += "\\s\v";
            else if (value === "upper") segment += "A-Z";
            else if (value === "word") segment += "\\w";
            else if (value === "xdigit") segment += "\\dA-Fa-f";
            continue;
          }
        }
      }
      if (glob[i] === "]" && inRange) {
        inRange = false;
        segment += "]";
        continue;
      }
      if (inRange) {
        segment += glob[i];
        continue;
      }
      if (glob[i] === ")" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") {
        segment += ")";
        const type = groupStack.pop();
        if (type === "!") {
          segment += c.wildcard;
        } else if (type !== "@") {
          segment += type;
        }
        continue;
      }
      if (glob[i] === "|" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") {
        segment += "|";
        continue;
      }
      if (glob[i] === "+" && extended && glob[i + 1] === "(") {
        i++;
        groupStack.push("+");
        segment += "(?:";
        continue;
      }
      if (glob[i] === "@" && extended && glob[i + 1] === "(") {
        i++;
        groupStack.push("@");
        segment += "(?:";
        continue;
      }
      if (glob[i] === "?") {
        if (extended && glob[i + 1] === "(") {
          i++;
          groupStack.push("?");
          segment += "(?:";
        } else {
          segment += ".";
        }
        continue;
      }
      if (glob[i] === "!" && extended && glob[i + 1] === "(") {
        i++;
        groupStack.push("!");
        segment += "(?!";
        continue;
      }
      if (glob[i] === "{") {
        groupStack.push("BRACE");
        segment += "(?:";
        continue;
      }
      if (glob[i] === "}" && groupStack[groupStack.length - 1] === "BRACE") {
        groupStack.pop();
        segment += ")";
        continue;
      }
      if (glob[i] === "," && groupStack[groupStack.length - 1] === "BRACE") {
        segment += "|";
        continue;
      }
      if (glob[i] === "*") {
        if (extended && glob[i + 1] === "(") {
          i++;
          groupStack.push("*");
          segment += "(?:";
        } else {
          const prevChar = glob[i - 1];
          let numStars = 1;
          while(glob[i + 1] === "*"){
            i++;
            numStars++;
          }
          const nextChar = glob[i + 1];
          if (globstarOption && numStars === 2 && [
            ...c.seps,
            undefined
          ].includes(prevChar) && [
            ...c.seps,
            undefined
          ].includes(nextChar)) {
            segment += c.globstar;
            endsWithSep = true;
          } else {
            segment += c.wildcard;
          }
        }
        continue;
      }
      segment += REG_EXP_ESCAPE_CHARS.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
    }
    // Check for unclosed groups or a dangling backslash.
    if (groupStack.length > 0 || inRange || inEscape) {
      // Parse failure. Take all characters from this segment literally.
      segment = "";
      for (const c of glob.slice(j, i)){
        segment += REG_EXP_ESCAPE_CHARS.includes(c) ? `\\${c}` : c;
        endsWithSep = false;
      }
    }
    regExpString += segment;
    if (!endsWithSep) {
      regExpString += i < glob.length ? c.sep : c.sepMaybe;
      endsWithSep = true;
    }
    // Terminates with `i` at the start of the next segment.
    while(c.seps.includes(glob[i]))i++;
    j = i;
  }
  regExpString = `^${regExpString}$`;
  return new RegExp(regExpString, caseInsensitive ? "i" : "");
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
const constants = {
  sep: "/+",
  sepMaybe: "/*",
  seps: [
    "/"
  ],
  globstar: "(?:[^/]*(?:/|$)+)*",
  wildcard: "[^/]*",
  escapePrefix: "\\"
};
/** Convert a glob string to a regular expression.
 *
 * Tries to match bash glob expansion as closely as possible.
 *
 * Basic glob syntax:
 * - `*` - Matches everything without leaving the path segment.
 * - `?` - Matches any single character.
 * - `{foo,bar}` - Matches `foo` or `bar`.
 * - `[abcd]` - Matches `a`, `b`, `c` or `d`.
 * - `[a-d]` - Matches `a`, `b`, `c` or `d`.
 * - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`.
 * - `[[:<class>:]]` - Matches any character belonging to `<class>`.
 *     - `[[:alnum:]]` - Matches any digit or letter.
 *     - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`.
 *     - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes
 *       for a complete list of supported character classes.
 * - `\` - Escapes the next character for an `os` other than `"windows"`.
 * - \` - Escapes the next character for `os` set to `"windows"`.
 * - `/` - Path separator.
 * - `\` - Additional path separator only for `os` set to `"windows"`.
 *
 * Extended syntax:
 * - Requires `{ extended: true }`.
 * - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`.
 * - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same.
 * - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`.
 * - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`.
 * - `!(foo|bar)` - Matches anything other than `{foo,bar}`.
 * - See https://www.linuxjournal.com/content/bash-extended-globbing.
 *
 * Globstar syntax:
 * - Requires `{ globstar: true }`.
 * - `**` - Matches any number of any path segments.
 *     - Must comprise its entire path segment in the provided glob.
 * - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
 *
 * Note the following properties:
 * - The generated `RegExp` is anchored at both start and end.
 * - Repeating and trailing separators are tolerated. Trailing separators in the
 *   provided glob have no meaning and are discarded.
 * - Absolute globs will only match absolute paths, etc.
 * - Empty globs will match nothing.
 * - Any special glob syntax must be contained to one path segment. For example,
 *   `?(foo|bar/baz)` is invalid. The separator will take precedence and the
 *   first segment ends with an unclosed group.
 * - If a path segment ends with unclosed groups or a dangling escape prefix, a
 *   parse error has occurred. Every character for that segment is taken
 *   literally in this event.
 *
 * Limitations:
 * - A negative group like `!(foo|bar)` will wrongly be converted to a negative
 *   look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly
 *   fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively,
 *   `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if
 *   the group occurs not nested at the end of the segment.
 *
 * @example Usage
 * ```ts
 * import { globToRegExp } from "@std/path/posix/glob-to-regexp";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(globToRegExp("*.js"), /^[^/]*\.js\/*$/);
 * ```
 *
 * @param glob Glob string to convert.
 * @param options Conversion options.
 * @returns The regular expression equivalent to the glob.
 */ function globToRegExp(glob, options = {}) {
  return _globToRegExp(constants, glob, options);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Test whether the given string is a glob.
 *
 * @example Usage
 * ```ts
 * import { isGlob } from "@std/path/is-glob";
 * import { assert } from "@std/assert";
 *
 * assert(!isGlob("foo/bar/../baz"));
 * assert(isGlob("foo/*ar/../baz"));
 * ```
 *
 * @param str String to test.
 * @returns `true` if the given string is a glob, otherwise `false`
 */ function isGlob(str) {
  const chars = {
    "{": "}",
    "(": ")",
    "[": "]"
  };
  const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^[\\\]]+\]|\{[^{\\}]+\}|\(\?[:!=][^\\)]+\)|\([^(|]+\|[^\\)]+\)|@\([^)]+\))/;
  if (str === "") {
    return false;
  }
  let match;
  while(match = regex.exec(str)){
    if (match[2]) return true;
    let idx = match.index + match[0].length;
    // if an open bracket/brace/paren is escaped,
    // set the index to the next closing character
    const open = match[1];
    const close = open ? chars[open] : null;
    if (open && close) {
      const n = str.indexOf(close, idx);
      if (n !== -1) {
        idx = n + 1;
      }
    }
    str = str.slice(idx);
  }
  return false;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Like normalize(), but doesn't collapse "**\/.." when `globstar` is true.
 *
 * @example Usage
 * ```ts
 * import { normalizeGlob } from "@std/path/posix/normalize-glob";
 * import { assertEquals } from "@std/assert";
 *
 * const path = normalizeGlob("foo/bar/../*", { globstar: true });
 * assertEquals(path, "foo/*");
 * ```
 *
 * @param glob The glob to normalize.
 * @param options The options to use.
 * @returns The normalized path.
 */ function normalizeGlob(glob, options = {}) {
  const { globstar = false } = options;
  if (glob.match(/\0/g)) {
    throw new Error(`Glob contains invalid characters: "${glob}"`);
  }
  if (!globstar) {
    return normalize(glob);
  }
  const s = SEPARATOR_PATTERN.source;
  const badParentPattern = new RegExp(`(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`, "g");
  return normalize(glob.replace(badParentPattern, "\0")).replace(/\0/g, "..");
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Like join(), but doesn't collapse "**\/.." when `globstar` is true.
 *
 * @example Usage
 * ```ts
 * import { joinGlobs } from "@std/path/posix/join-globs";
 * import { assertEquals } from "@std/assert";
 *
 * const path = joinGlobs(["foo", "bar", "**"], { globstar: true });
 * assertEquals(path, "foo/bar/**");
 * ```
 *
 * @param globs The globs to join.
 * @param options The options to use.
 * @returns The joined path.
 */ function joinGlobs(globs, options = {}) {
  const { globstar = false } = options;
  if (!globstar || globs.length === 0) {
    return join(...globs);
  }
  let joined;
  for (const glob of globs){
    const path = glob;
    if (path.length > 0) {
      if (!joined) joined = path;
      else joined += `${SEPARATOR}${path}`;
    }
  }
  if (!joined) return ".";
  return normalizeGlob(joined, {
    globstar
  });
}

export { DELIMITER, SEPARATOR, SEPARATOR_PATTERN, basename, common, dirname, extname, format, fromFileUrl, globToRegExp, isAbsolute, isGlob, join, joinGlobs, normalize, normalizeGlob, parse, relative, resolve, toFileUrl, toNamespacedPath };
aJPxMӲ,// @ts-nocheck
// Copyright 2018-2025 the Deno authors. MIT license.
// Copyright the Browserify authors. MIT License.
function assertPath(path) {
  if (typeof path !== "string") {
    throw new TypeError(`Path must be a string, received "${JSON.stringify(path)}"`);
  }
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function stripSuffix(name, suffix) {
  if (suffix.length >= name.length) {
    return name;
  }
  const lenDiff = name.length - suffix.length;
  for(let i = suffix.length - 1; i >= 0; --i){
    if (name.charCodeAt(lenDiff + i) !== suffix.charCodeAt(i)) {
      return name;
    }
  }
  return name.slice(0, -suffix.length);
}
function lastPathSegment(path, isSep, start = 0) {
  let matchedNonSeparator = false;
  let end = path.length;
  for(let i = path.length - 1; i >= start; --i){
    if (isSep(path.charCodeAt(i))) {
      if (matchedNonSeparator) {
        start = i + 1;
        break;
      }
    } else if (!matchedNonSeparator) {
      matchedNonSeparator = true;
      end = i + 1;
    }
  }
  return path.slice(start, end);
}
function assertArgs$1(path, suffix) {
  assertPath(path);
  if (path.length === 0) return path;
  if (typeof suffix !== "string") {
    throw new TypeError(`Suffix must be a string, received "${JSON.stringify(suffix)}"`);
  }
}

// Copyright 2018-2025 the Deno authors. MIT license.
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
// This module is browser compatible.
// Alphabet chars.
const CHAR_UPPERCASE_A = 65; /* A */ 
const CHAR_LOWERCASE_A = 97; /* a */ 
const CHAR_UPPERCASE_Z = 90; /* Z */ 
const CHAR_LOWERCASE_Z = 122; /* z */ 
// Non-alphabetic chars.
const CHAR_DOT = 46; /* . */ 
const CHAR_FORWARD_SLASH = 47; /* / */ 
const CHAR_BACKWARD_SLASH = 92; /* \ */ 
const CHAR_COLON = 58; /* : */ 
const CHAR_QUESTION_MARK = 63; /* ? */

// Copyright 2018-2025 the Deno authors. MIT license.
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
// This module is browser compatible.
function stripTrailingSeparators(segment, isSep) {
  if (segment.length <= 1) {
    return segment;
  }
  let end = segment.length;
  for(let i = segment.length - 1; i > 0; i--){
    if (isSep(segment.charCodeAt(i))) {
      end = i;
    } else {
      break;
    }
  }
  return segment.slice(0, end);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
// This module is browser compatible.
function isPosixPathSeparator(code) {
  return code === CHAR_FORWARD_SLASH;
}
function isPathSeparator(code) {
  return code === CHAR_FORWARD_SLASH || code === CHAR_BACKWARD_SLASH;
}
function isWindowsDeviceRoot(code) {
  return code >= CHAR_LOWERCASE_A && code <= CHAR_LOWERCASE_Z || code >= CHAR_UPPERCASE_A && code <= CHAR_UPPERCASE_Z;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function assertArg$3(url) {
  url = url instanceof URL ? url : new URL(url);
  if (url.protocol !== "file:") {
    throw new TypeError(`URL must be a file URL: received "${url.protocol}"`);
  }
  return url;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Converts a file URL to a path string.
 *
 * @example Usage
 * ```ts
 * import { fromFileUrl } from "@std/path/windows/from-file-url";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(fromFileUrl("file:///home/foo"), "\\home\\foo");
 * assertEquals(fromFileUrl("file:///C:/Users/foo"), "C:\\Users\\foo");
 * assertEquals(fromFileUrl("file://localhost/home/foo"), "\\home\\foo");
 * ```
 *
 * @param url The file URL to convert.
 * @returns The path string.
 */ function fromFileUrl(url) {
  url = assertArg$3(url);
  let path = decodeURIComponent(url.pathname.replace(/\//g, "\\").replace(/%(?![0-9A-Fa-f]{2})/g, "%25")).replace(/^\\*([A-Za-z]:)(\\|$)/, "$1\\");
  if (url.hostname !== "") {
    // Note: The `URL` implementation guarantees that the drive letter and
    // hostname are mutually exclusive. Otherwise it would not have been valid
    // to append the hostname and path like this.
    path = `\\\\${url.hostname}${path}`;
  }
  return path;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Return the last portion of a `path`.
 * Trailing directory separators are ignored, and optional suffix is removed.
 *
 * @example Usage
 * ```ts
 * import { basename } from "@std/path/windows/basename";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(basename("C:\\user\\Documents\\"), "Documents");
 * assertEquals(basename("C:\\user\\Documents\\image.png"), "image.png");
 * assertEquals(basename("C:\\user\\Documents\\image.png", ".png"), "image");
 * assertEquals(basename(new URL("file:///C:/user/Documents/image.png")), "image.png");
 * assertEquals(basename(new URL("file:///C:/user/Documents/image.png"), ".png"), "image");
 * ```
 *
 * @param path The path to extract the name from.
 * @param suffix The suffix to remove from extracted name.
 * @returns The extracted name.
 */ function basename(path, suffix = "") {
  if (path instanceof URL) {
    path = fromFileUrl(path);
  }
  assertArgs$1(path, suffix);
  // Check for a drive letter prefix so as not to mistake the following
  // path separator as an extra separator at the end of the path that can be
  // disregarded
  let start = 0;
  if (path.length >= 2) {
    const drive = path.charCodeAt(0);
    if (isWindowsDeviceRoot(drive)) {
      if (path.charCodeAt(1) === CHAR_COLON) start = 2;
    }
  }
  const lastSegment = lastPathSegment(path, isPathSeparator, start);
  const strippedSegment = stripTrailingSeparators(lastSegment, isPathSeparator);
  return suffix ? stripSuffix(strippedSegment, suffix) : strippedSegment;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * The character used to separate entries in the PATH environment variable.
 */ const DELIMITER = ";";
/**
 * The character used to separate components of a file path.
 */ const SEPARATOR = "\\";
/**
 * A regular expression that matches one or more path separators.
 */ const SEPARATOR_PATTERN = /[\\/]+/;

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function assertArg$2(path) {
  assertPath(path);
  if (path.length === 0) return ".";
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Return the directory path of a `path`.
 *
 * @example Usage
 * ```ts
 * import { dirname } from "@std/path/windows/dirname";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(dirname("C:\\foo\\bar\\baz.ext"), "C:\\foo\\bar");
 * assertEquals(dirname(new URL("file:///C:/foo/bar/baz.ext")), "C:\\foo\\bar");
 * ```
 *
 * @param path The path to get the directory from.
 * @returns The directory path.
 */ function dirname(path) {
  if (path instanceof URL) {
    path = fromFileUrl(path);
  }
  assertArg$2(path);
  const len = path.length;
  let rootEnd = -1;
  let end = -1;
  let matchedSlash = true;
  let offset = 0;
  const code = path.charCodeAt(0);
  // Try to match a root
  if (len > 1) {
    if (isPathSeparator(code)) {
      // Possible UNC root
      rootEnd = offset = 1;
      if (isPathSeparator(path.charCodeAt(1))) {
        // Matched double path separator at beginning
        let j = 2;
        let last = j;
        // Match 1 or more non-path separators
        for(; j < len; ++j){
          if (isPathSeparator(path.charCodeAt(j))) break;
        }
        if (j < len && j !== last) {
          // Matched!
          last = j;
          // Match 1 or more path separators
          for(; j < len; ++j){
            if (!isPathSeparator(path.charCodeAt(j))) break;
          }
          if (j < len && j !== last) {
            // Matched!
            last = j;
            // Match 1 or more non-path separators
            for(; j < len; ++j){
              if (isPathSeparator(path.charCodeAt(j))) break;
            }
            if (j === len) {
              // We matched a UNC root only
              return path;
            }
            if (j !== last) {
              // We matched a UNC root with leftovers
              // Offset by 1 to include the separator after the UNC root to
              // treat it as a "normal root" on top of a (UNC) root
              rootEnd = offset = j + 1;
            }
          }
        }
      }
    } else if (isWindowsDeviceRoot(code)) {
      // Possible device root
      if (path.charCodeAt(1) === CHAR_COLON) {
        rootEnd = offset = 2;
        if (len > 2) {
          if (isPathSeparator(path.charCodeAt(2))) rootEnd = offset = 3;
        }
      }
    }
  } else if (isPathSeparator(code)) {
    // `path` contains just a path separator, exit early to avoid
    // unnecessary work
    return path;
  }
  for(let i = len - 1; i >= offset; --i){
    if (isPathSeparator(path.charCodeAt(i))) {
      if (!matchedSlash) {
        end = i;
        break;
      }
    } else {
      // We saw the first non-path separator
      matchedSlash = false;
    }
  }
  if (end === -1) {
    if (rootEnd === -1) return ".";
    else end = rootEnd;
  }
  return stripTrailingSeparators(path.slice(0, end), isPosixPathSeparator);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Return the extension of the `path` with leading period.
 *
 * @example Usage
 * ```ts
 * import { extname } from "@std/path/windows/extname";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(extname("file.ts"), ".ts");
 * assertEquals(extname(new URL("file:///C:/foo/bar/baz.ext")), ".ext");
 * ```
 *
 * @param path The path to get the extension from.
 * @returns The extension of the `path`.
 */ function extname(path) {
  if (path instanceof URL) {
    path = fromFileUrl(path);
  }
  assertPath(path);
  let start = 0;
  let startDot = -1;
  let startPart = 0;
  let end = -1;
  let matchedSlash = true;
  // Track the state of characters (if any) we see before our first dot and
  // after any path separator we find
  let preDotState = 0;
  // Check for a drive letter prefix so as not to mistake the following
  // path separator as an extra separator at the end of the path that can be
  // disregarded
  if (path.length >= 2 && path.charCodeAt(1) === CHAR_COLON && isWindowsDeviceRoot(path.charCodeAt(0))) {
    start = startPart = 2;
  }
  for(let i = path.length - 1; i >= start; --i){
    const code = path.charCodeAt(i);
    if (isPathSeparator(code)) {
      // If we reached a path separator that was not part of a set of path
      // separators at the end of the string, stop now
      if (!matchedSlash) {
        startPart = i + 1;
        break;
      }
      continue;
    }
    if (end === -1) {
      // We saw the first non-path separator, mark this as the end of our
      // extension
      matchedSlash = false;
      end = i + 1;
    }
    if (code === CHAR_DOT) {
      // If this is our first dot, mark it as the start of our extension
      if (startDot === -1) startDot = i;
      else if (preDotState !== 1) preDotState = 1;
    } else if (startDot !== -1) {
      // We saw a non-dot and non-path separator before our dot, so we should
      // have a good chance at having a non-empty extension
      preDotState = -1;
    }
  }
  if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
  preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
  preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
    return "";
  }
  return path.slice(startDot, end);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function _format(sep, pathObject) {
  const dir = pathObject.dir || pathObject.root;
  const base = pathObject.base || (pathObject.name ?? "") + (pathObject.ext ?? "");
  if (!dir) return base;
  if (base === sep) return dir;
  if (dir === pathObject.root) return dir + base;
  return dir + sep + base;
}
function assertArg$1(pathObject) {
  if (pathObject === null || typeof pathObject !== "object") {
    throw new TypeError(`The "pathObject" argument must be of type Object, received type "${typeof pathObject}"`);
  }
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Generate a path from `ParsedPath` object.
 *
 * @example Usage
 * ```ts
 * import { format } from "@std/path/windows/format";
 * import { assertEquals } from "@std/assert";
 *
 * const path = format({
 *   root: "C:\\",
 *   dir: "C:\\path\\dir",
 *   base: "file.txt",
 *   ext: ".txt",
 *   name: "file"
 * });
 * assertEquals(path, "C:\\path\\dir\\file.txt");
 * ```
 *
 * @param pathObject The path object to format.
 * @returns The formatted path.
 */ function format(pathObject) {
  assertArg$1(pathObject);
  return _format("\\", pathObject);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Verifies whether provided path is absolute.
 *
 * @example Usage
 * ```ts
 * import { isAbsolute } from "@std/path/windows/is-absolute";
 * import { assert, assertFalse } from "@std/assert";
 *
 * assert(isAbsolute("C:\\foo\\bar"));
 * assertFalse(isAbsolute("..\\baz"));
 * ```
 *
 * @param path The path to verify.
 * @returns `true` if the path is absolute, `false` otherwise.
 */ function isAbsolute(path) {
  assertPath(path);
  const len = path.length;
  if (len === 0) return false;
  const code = path.charCodeAt(0);
  if (isPathSeparator(code)) {
    return true;
  } else if (isWindowsDeviceRoot(code)) {
    // Possible device root
    if (len > 2 && path.charCodeAt(1) === CHAR_COLON) {
      if (isPathSeparator(path.charCodeAt(2))) return true;
    }
  }
  return false;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function assertArg(path) {
  assertPath(path);
  if (path.length === 0) return ".";
}

// Copyright 2018-2025 the Deno authors. MIT license.
// Copyright the Browserify authors. MIT License.
// Ported from https://github.com/browserify/path-browserify/
// This module is browser compatible.
// Resolves . and .. elements in a path with directory names
function normalizeString(path, allowAboveRoot, separator, isPathSeparator) {
  let res = "";
  let lastSegmentLength = 0;
  let lastSlash = -1;
  let dots = 0;
  let code;
  for(let i = 0; i <= path.length; ++i){
    if (i < path.length) code = path.charCodeAt(i);
    else if (isPathSeparator(code)) break;
    else code = CHAR_FORWARD_SLASH;
    if (isPathSeparator(code)) {
      if (lastSlash === i - 1 || dots === 1) ; else if (lastSlash !== i - 1 && dots === 2) {
        if (res.length < 2 || lastSegmentLength !== 2 || res.charCodeAt(res.length - 1) !== CHAR_DOT || res.charCodeAt(res.length - 2) !== CHAR_DOT) {
          if (res.length > 2) {
            const lastSlashIndex = res.lastIndexOf(separator);
            if (lastSlashIndex === -1) {
              res = "";
              lastSegmentLength = 0;
            } else {
              res = res.slice(0, lastSlashIndex);
              lastSegmentLength = res.length - 1 - res.lastIndexOf(separator);
            }
            lastSlash = i;
            dots = 0;
            continue;
          } else if (res.length === 2 || res.length === 1) {
            res = "";
            lastSegmentLength = 0;
            lastSlash = i;
            dots = 0;
            continue;
          }
        }
        if (allowAboveRoot) {
          if (res.length > 0) res += `${separator}..`;
          else res = "..";
          lastSegmentLength = 2;
        }
      } else {
        if (res.length > 0) res += separator + path.slice(lastSlash + 1, i);
        else res = path.slice(lastSlash + 1, i);
        lastSegmentLength = i - lastSlash - 1;
      }
      lastSlash = i;
      dots = 0;
    } else if (code === CHAR_DOT && dots !== -1) {
      ++dots;
    } else {
      dots = -1;
    }
  }
  return res;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Normalize the `path`, resolving `'..'` and `'.'` segments.
 * Note that resolving these segments does not necessarily mean that all will be eliminated.
 * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`.
 *
 * @example Usage
 * ```ts
 * import { normalize } from "@std/path/windows/normalize";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(normalize("C:\\foo\\..\\bar"), "C:\\bar");
 * assertEquals(normalize(new URL("file:///C:/foo/../bar")), "C:\\bar");
 * ```
 *
 * @param path The path to normalize
 * @returns The normalized path
 */ function normalize(path) {
  if (path instanceof URL) {
    path = fromFileUrl(path);
  }
  assertArg(path);
  const len = path.length;
  let rootEnd = 0;
  let device;
  let isAbsolute = false;
  const code = path.charCodeAt(0);
  // Try to match a root
  if (len > 1) {
    if (isPathSeparator(code)) {
      // Possible UNC root
      // If we started with a separator, we know we at least have an absolute
      // path of some kind (UNC or otherwise)
      isAbsolute = true;
      if (isPathSeparator(path.charCodeAt(1))) {
        // Matched double path separator at beginning
        let j = 2;
        let last = j;
        // Match 1 or more non-path separators
        for(; j < len; ++j){
          if (isPathSeparator(path.charCodeAt(j))) break;
        }
        if (j < len && j !== last) {
          const firstPart = path.slice(last, j);
          // Matched!
          last = j;
          // Match 1 or more path separators
          for(; j < len; ++j){
            if (!isPathSeparator(path.charCodeAt(j))) break;
          }
          if (j < len && j !== last) {
            // Matched!
            last = j;
            // Match 1 or more non-path separators
            for(; j < len; ++j){
              if (isPathSeparator(path.charCodeAt(j))) break;
            }
            if (j === len) {
              // We matched a UNC root only
              // Return the normalized version of the UNC root since there
              // is nothing left to process
              return `\\\\${firstPart}\\${path.slice(last)}\\`;
            } else if (j !== last) {
              // We matched a UNC root with leftovers
              device = `\\\\${firstPart}\\${path.slice(last, j)}`;
              rootEnd = j;
            }
          }
        }
      } else {
        rootEnd = 1;
      }
    } else if (isWindowsDeviceRoot(code)) {
      // Possible device root
      if (path.charCodeAt(1) === CHAR_COLON) {
        device = path.slice(0, 2);
        rootEnd = 2;
        if (len > 2) {
          if (isPathSeparator(path.charCodeAt(2))) {
            // Treat separator following drive name as an absolute path
            // indicator
            isAbsolute = true;
            rootEnd = 3;
          }
        }
      }
    }
  } else if (isPathSeparator(code)) {
    // `path` contains just a path separator, exit early to avoid unnecessary
    // work
    return "\\";
  }
  let tail;
  if (rootEnd < len) {
    tail = normalizeString(path.slice(rootEnd), !isAbsolute, "\\", isPathSeparator);
  } else {
    tail = "";
  }
  if (tail.length === 0 && !isAbsolute) tail = ".";
  if (tail.length > 0 && isPathSeparator(path.charCodeAt(len - 1))) {
    tail += "\\";
  }
  if (device === undefined) {
    if (isAbsolute) {
      if (tail.length > 0) return `\\${tail}`;
      else return "\\";
    }
    return tail;
  } else if (isAbsolute) {
    if (tail.length > 0) return `${device}\\${tail}`;
    else return `${device}\\`;
  }
  return device + tail;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Join all given a sequence of `paths`,then normalizes the resulting path.
 *
 * @example Usage
 * ```ts
 * import { join } from "@std/path/windows/join";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(join("C:\\foo", "bar", "baz\\.."), "C:\\foo\\bar");
 * assertEquals(join(new URL("file:///C:/foo"), "bar", "baz\\.."), "C:\\foo\\bar");
 * ```
 *
 * @param path The path to join. This can be string or file URL.
 * @param paths The paths to join.
 * @returns The joined path.
 */ function join(path, ...paths) {
  if (path instanceof URL) {
    path = fromFileUrl(path);
  }
  paths = path ? [
    path,
    ...paths
  ] : paths;
  paths.forEach((path)=>assertPath(path));
  paths = paths.filter((path)=>path.length > 0);
  if (paths.length === 0) return ".";
  // Make sure that the joined path doesn't start with two slashes, because
  // normalize() will mistake it for an UNC path then.
  //
  // This step is skipped when it is very clear that the user actually
  // intended to point at an UNC path. This is assumed when the first
  // non-empty string arguments starts with exactly two slashes followed by
  // at least one more non-slash character.
  //
  // Note that for normalize() to treat a path as an UNC path it needs to
  // have at least 2 components, so we don't filter for that here.
  // This means that the user can use join to construct UNC paths from
  // a server name and a share name; for example:
  //   path.join('//server', 'share') -> '\\\\server\\share\\'
  let needsReplace = true;
  let slashCount = 0;
  const firstPart = paths[0];
  if (isPathSeparator(firstPart.charCodeAt(0))) {
    ++slashCount;
    const firstLen = firstPart.length;
    if (firstLen > 1) {
      if (isPathSeparator(firstPart.charCodeAt(1))) {
        ++slashCount;
        if (firstLen > 2) {
          if (isPathSeparator(firstPart.charCodeAt(2))) ++slashCount;
          else {
            // We matched a UNC path in the first part
            needsReplace = false;
          }
        }
      }
    }
  }
  let joined = paths.join("\\");
  if (needsReplace) {
    // Find any more consecutive slashes we need to replace
    for(; slashCount < joined.length; ++slashCount){
      if (!isPathSeparator(joined.charCodeAt(slashCount))) break;
    }
    // Replace the slashes if needed
    if (slashCount >= 2) joined = `\\${joined.slice(slashCount)}`;
  }
  return normalize(joined);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Return a `ParsedPath` object of the `path`.
 *
 * @example Usage
 * ```ts
 * import { parse } from "@std/path/windows/parse";
 * import { assertEquals } from "@std/assert";
 *
 * const parsed = parse("C:\\foo\\bar\\baz.ext");
 * assertEquals(parsed, {
 *   root: "C:\\",
 *   dir: "C:\\foo\\bar",
 *   base: "baz.ext",
 *   ext: ".ext",
 *   name: "baz",
 * });
 * ```
 *
 * @param path The path to parse.
 * @returns The `ParsedPath` object.
 */ function parse(path) {
  assertPath(path);
  const ret = {
    root: "",
    dir: "",
    base: "",
    ext: "",
    name: ""
  };
  const len = path.length;
  if (len === 0) return ret;
  let rootEnd = 0;
  let code = path.charCodeAt(0);
  // Try to match a root
  if (len > 1) {
    if (isPathSeparator(code)) {
      // Possible UNC root
      rootEnd = 1;
      if (isPathSeparator(path.charCodeAt(1))) {
        // Matched double path separator at beginning
        let j = 2;
        let last = j;
        // Match 1 or more non-path separators
        for(; j < len; ++j){
          if (isPathSeparator(path.charCodeAt(j))) break;
        }
        if (j < len && j !== last) {
          // Matched!
          last = j;
          // Match 1 or more path separators
          for(; j < len; ++j){
            if (!isPathSeparator(path.charCodeAt(j))) break;
          }
          if (j < len && j !== last) {
            // Matched!
            last = j;
            // Match 1 or more non-path separators
            for(; j < len; ++j){
              if (isPathSeparator(path.charCodeAt(j))) break;
            }
            if (j === len) {
              // We matched a UNC root only
              rootEnd = j;
            } else if (j !== last) {
              // We matched a UNC root with leftovers
              rootEnd = j + 1;
            }
          }
        }
      }
    } else if (isWindowsDeviceRoot(code)) {
      // Possible device root
      if (path.charCodeAt(1) === CHAR_COLON) {
        rootEnd = 2;
        if (len > 2) {
          if (isPathSeparator(path.charCodeAt(2))) {
            if (len === 3) {
              // `path` contains just a drive root, exit early to avoid
              // unnecessary work
              ret.root = ret.dir = path;
              ret.base = "\\";
              return ret;
            }
            rootEnd = 3;
          }
        } else {
          // `path` contains just a relative drive root, exit early to avoid
          // unnecessary work
          ret.root = ret.dir = path;
          return ret;
        }
      }
    }
  } else if (isPathSeparator(code)) {
    // `path` contains just a path separator, exit early to avoid
    // unnecessary work
    ret.root = ret.dir = path;
    ret.base = "\\";
    return ret;
  }
  if (rootEnd > 0) ret.root = path.slice(0, rootEnd);
  let startDot = -1;
  let startPart = rootEnd;
  let end = -1;
  let matchedSlash = true;
  let i = path.length - 1;
  // Track the state of characters (if any) we see before our first dot and
  // after any path separator we find
  let preDotState = 0;
  // Get non-dir info
  for(; i >= rootEnd; --i){
    code = path.charCodeAt(i);
    if (isPathSeparator(code)) {
      // If we reached a path separator that was not part of a set of path
      // separators at the end of the string, stop now
      if (!matchedSlash) {
        startPart = i + 1;
        break;
      }
      continue;
    }
    if (end === -1) {
      // We saw the first non-path separator, mark this as the end of our
      // extension
      matchedSlash = false;
      end = i + 1;
    }
    if (code === CHAR_DOT) {
      // If this is our first dot, mark it as the start of our extension
      if (startDot === -1) startDot = i;
      else if (preDotState !== 1) preDotState = 1;
    } else if (startDot !== -1) {
      // We saw a non-dot and non-path separator before our dot, so we should
      // have a good chance at having a non-empty extension
      preDotState = -1;
    }
  }
  if (startDot === -1 || end === -1 || // We saw a non-dot character immediately before the dot
  preDotState === 0 || // The (right-most) trimmed path component is exactly '..'
  preDotState === 1 && startDot === end - 1 && startDot === startPart + 1) {
    if (end !== -1) {
      ret.base = ret.name = path.slice(startPart, end);
    }
  } else {
    ret.name = path.slice(startPart, startDot);
    ret.base = path.slice(startPart, end);
    ret.ext = path.slice(startDot, end);
  }
  // Fallback to '\' in case there is no basename
  ret.base = ret.base || "\\";
  // If the directory is the root, use the entire root as the `dir` including
  // the trailing slash if any (`C:\abc` -> `C:\`). Otherwise, strip out the
  // trailing slash (`C:\abc\def` -> `C:\abc`).
  if (startPart > 0 && startPart !== rootEnd) {
    ret.dir = path.slice(0, startPart - 1);
  } else ret.dir = ret.root;
  return ret;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Resolves path segments into a `path`.
 *
 * @example Usage
 * ```ts
 * import { resolve } from "@std/path/windows/resolve";
 * import { assertEquals } from "@std/assert";
 *
 * const resolved = resolve("C:\\foo\\bar", "..\\baz");
 * assertEquals(resolved, "C:\\foo\\baz");
 * ```
 *
 * @param pathSegments The path segments to process to path
 * @returns The resolved path
 */ function resolve(...pathSegments) {
  let resolvedDevice = "";
  let resolvedTail = "";
  let resolvedAbsolute = false;
  for(let i = pathSegments.length - 1; i >= -1; i--){
    let path;
    // deno-lint-ignore no-explicit-any
    const { Deno } = globalThis;
    if (i >= 0) {
      path = pathSegments[i];
    } else if (!resolvedDevice) {
      if (typeof Deno?.cwd !== "function") {
        throw new TypeError("Resolved a drive-letter-less path without a current working directory (CWD)");
      }
      path = Deno.cwd();
    } else {
      if (typeof Deno?.env?.get !== "function" || typeof Deno?.cwd !== "function") {
        throw new TypeError("Resolved a relative path without a current working directory (CWD)");
      }
      path = Deno.cwd();
      // Verify that a cwd was found and that it actually points
      // to our drive. If not, default to the drive's root.
      if (path === undefined || path.slice(0, 3).toLowerCase() !== `${resolvedDevice.toLowerCase()}\\`) {
        path = `${resolvedDevice}\\`;
      }
    }
    assertPath(path);
    const len = path.length;
    // Skip empty entries
    if (len === 0) continue;
    let rootEnd = 0;
    let device = "";
    let isAbsolute = false;
    const code = path.charCodeAt(0);
    // Try to match a root
    if (len > 1) {
      if (isPathSeparator(code)) {
        // Possible UNC root
        // If we started with a separator, we know we at least have an
        // absolute path of some kind (UNC or otherwise)
        isAbsolute = true;
        if (isPathSeparator(path.charCodeAt(1))) {
          // Matched double path separator at beginning
          let j = 2;
          let last = j;
          // Match 1 or more non-path separators
          for(; j < len; ++j){
            if (isPathSeparator(path.charCodeAt(j))) break;
          }
          if (j < len && j !== last) {
            const firstPart = path.slice(last, j);
            // Matched!
            last = j;
            // Match 1 or more path separators
            for(; j < len; ++j){
              if (!isPathSeparator(path.charCodeAt(j))) break;
            }
            if (j < len && j !== last) {
              // Matched!
              last = j;
              // Match 1 or more non-path separators
              for(; j < len; ++j){
                if (isPathSeparator(path.charCodeAt(j))) break;
              }
              if (j === len) {
                // We matched a UNC root only
                device = `\\\\${firstPart}\\${path.slice(last)}`;
                rootEnd = j;
              } else if (j !== last) {
                // We matched a UNC root with leftovers
                device = `\\\\${firstPart}\\${path.slice(last, j)}`;
                rootEnd = j;
              }
            }
          }
        } else {
          rootEnd = 1;
        }
      } else if (isWindowsDeviceRoot(code)) {
        // Possible device root
        if (path.charCodeAt(1) === CHAR_COLON) {
          device = path.slice(0, 2);
          rootEnd = 2;
          if (len > 2) {
            if (isPathSeparator(path.charCodeAt(2))) {
              // Treat separator following drive name as an absolute path
              // indicator
              isAbsolute = true;
              rootEnd = 3;
            }
          }
        }
      }
    } else if (isPathSeparator(code)) {
      // `path` contains just a path separator
      rootEnd = 1;
      isAbsolute = true;
    }
    if (device.length > 0 && resolvedDevice.length > 0 && device.toLowerCase() !== resolvedDevice.toLowerCase()) {
      continue;
    }
    if (resolvedDevice.length === 0 && device.length > 0) {
      resolvedDevice = device;
    }
    if (!resolvedAbsolute) {
      resolvedTail = `${path.slice(rootEnd)}\\${resolvedTail}`;
      resolvedAbsolute = isAbsolute;
    }
    if (resolvedAbsolute && resolvedDevice.length > 0) break;
  }
  // At this point the path should be resolved to a full absolute path,
  // but handle relative paths to be safe (might happen when Deno.cwd()
  // fails)
  // Normalize the tail path
  resolvedTail = normalizeString(resolvedTail, !resolvedAbsolute, "\\", isPathSeparator);
  return resolvedDevice + (resolvedAbsolute ? "\\" : "") + resolvedTail || ".";
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function assertArgs(from, to) {
  assertPath(from);
  assertPath(to);
  if (from === to) return "";
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Return the relative path from `from` to `to` based on current working directory.
 *
 * An example in windows, for instance:
 *  from = 'C:\\orandea\\test\\aaa'
 *  to = 'C:\\orandea\\impl\\bbb'
 * The output of the function should be: '..\\..\\impl\\bbb'
 *
 * @example Usage
 * ```ts
 * import { relative } from "@std/path/windows/relative";
 * import { assertEquals } from "@std/assert";
 *
 * const relativePath = relative("C:\\foobar\\test\\aaa", "C:\\foobar\\impl\\bbb");
 * assertEquals(relativePath, "..\\..\\impl\\bbb");
 * ```
 *
 * @param from The path from which to calculate the relative path
 * @param to The path to which to calculate the relative path
 * @returns The relative path from `from` to `to`
 */ function relative(from, to) {
  assertArgs(from, to);
  const fromOrig = resolve(from);
  const toOrig = resolve(to);
  if (fromOrig === toOrig) return "";
  from = fromOrig.toLowerCase();
  to = toOrig.toLowerCase();
  if (from === to) return "";
  // Trim any leading backslashes
  let fromStart = 0;
  let fromEnd = from.length;
  for(; fromStart < fromEnd; ++fromStart){
    if (from.charCodeAt(fromStart) !== CHAR_BACKWARD_SLASH) break;
  }
  // Trim trailing backslashes (applicable to UNC paths only)
  for(; fromEnd - 1 > fromStart; --fromEnd){
    if (from.charCodeAt(fromEnd - 1) !== CHAR_BACKWARD_SLASH) break;
  }
  const fromLen = fromEnd - fromStart;
  // Trim any leading backslashes
  let toStart = 0;
  let toEnd = to.length;
  for(; toStart < toEnd; ++toStart){
    if (to.charCodeAt(toStart) !== CHAR_BACKWARD_SLASH) break;
  }
  // Trim trailing backslashes (applicable to UNC paths only)
  for(; toEnd - 1 > toStart; --toEnd){
    if (to.charCodeAt(toEnd - 1) !== CHAR_BACKWARD_SLASH) break;
  }
  const toLen = toEnd - toStart;
  // Compare paths to find the longest common path from root
  const length = fromLen < toLen ? fromLen : toLen;
  let lastCommonSep = -1;
  let i = 0;
  for(; i <= length; ++i){
    if (i === length) {
      if (toLen > length) {
        if (to.charCodeAt(toStart + i) === CHAR_BACKWARD_SLASH) {
          // We get here if `from` is the exact base path for `to`.
          // For example: from='C:\\foo\\bar'; to='C:\\foo\\bar\\baz'
          return toOrig.slice(toStart + i + 1);
        } else if (i === 2) {
          // We get here if `from` is the device root.
          // For example: from='C:\\'; to='C:\\foo'
          return toOrig.slice(toStart + i);
        }
      }
      if (fromLen > length) {
        if (from.charCodeAt(fromStart + i) === CHAR_BACKWARD_SLASH) {
          // We get here if `to` is the exact base path for `from`.
          // For example: from='C:\\foo\\bar'; to='C:\\foo'
          lastCommonSep = i;
        } else if (i === 2) {
          // We get here if `to` is the device root.
          // For example: from='C:\\foo\\bar'; to='C:\\'
          lastCommonSep = 3;
        }
      }
      break;
    }
    const fromCode = from.charCodeAt(fromStart + i);
    const toCode = to.charCodeAt(toStart + i);
    if (fromCode !== toCode) break;
    else if (fromCode === CHAR_BACKWARD_SLASH) lastCommonSep = i;
  }
  // We found a mismatch before the first common path separator was seen, so
  // return the original `to`.
  if (i !== length && lastCommonSep === -1) {
    return toOrig;
  }
  let out = "";
  if (lastCommonSep === -1) lastCommonSep = 0;
  // Generate the relative path based on the path difference between `to` and
  // `from`
  for(i = fromStart + lastCommonSep + 1; i <= fromEnd; ++i){
    if (i === fromEnd || from.charCodeAt(i) === CHAR_BACKWARD_SLASH) {
      if (out.length === 0) out += "..";
      else out += "\\..";
    }
  }
  // Lastly, append the rest of the destination (`to`) path that comes after
  // the common path parts
  if (out.length > 0) {
    return out + toOrig.slice(toStart + lastCommonSep, toEnd);
  } else {
    toStart += lastCommonSep;
    if (toOrig.charCodeAt(toStart) === CHAR_BACKWARD_SLASH) ++toStart;
    return toOrig.slice(toStart, toEnd);
  }
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
const WHITESPACE_ENCODINGS = {
  "\u0009": "%09",
  "\u000A": "%0A",
  "\u000B": "%0B",
  "\u000C": "%0C",
  "\u000D": "%0D",
  "\u0020": "%20"
};
function encodeWhitespace(string) {
  return string.replaceAll(/[\s]/g, (c)=>{
    return WHITESPACE_ENCODINGS[c] ?? c;
  });
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Converts a path string to a file URL.
 *
 * @example Usage
 * ```ts
 * import { toFileUrl } from "@std/path/windows/to-file-url";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(toFileUrl("\\home\\foo"), new URL("file:///home/foo"));
 * assertEquals(toFileUrl("C:\\Users\\foo"), new URL("file:///C:/Users/foo"));
 * assertEquals(toFileUrl("\\\\127.0.0.1\\home\\foo"), new URL("file://127.0.0.1/home/foo"));
 * ```
 * @param path The path to convert.
 * @returns The file URL.
 */ function toFileUrl(path) {
  if (!isAbsolute(path)) {
    throw new TypeError(`Path must be absolute: received "${path}"`);
  }
  const [, hostname, pathname] = path.match(/^(?:[/\\]{2}([^/\\]+)(?=[/\\](?:[^/\\]|$)))?(.*)/);
  const url = new URL("file:///");
  url.pathname = encodeWhitespace(pathname.replace(/%/g, "%25"));
  if (hostname !== undefined && hostname !== "localhost") {
    url.hostname = hostname;
    if (!url.hostname) {
      throw new TypeError(`Invalid hostname: "${url.hostname}"`);
    }
  }
  return url;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Resolves path to a namespace path
 *
 * @example Usage
 * ```ts
 * import { toNamespacedPath } from "@std/path/windows/to-namespaced-path";
 * import { assertEquals } from "@std/assert";
 *
 * const namespaced = toNamespacedPath("C:\\foo\\bar");
 * assertEquals(namespaced, "\\\\?\\C:\\foo\\bar");
 * ```
 *
 * @param path The path to resolve to namespaced path
 * @returns The resolved namespaced path
 */ function toNamespacedPath(path) {
  // Note: this will *probably* throw somewhere.
  if (typeof path !== "string") return path;
  if (path.length === 0) return "";
  const resolvedPath = resolve(path);
  if (resolvedPath.length >= 3) {
    if (resolvedPath.charCodeAt(0) === CHAR_BACKWARD_SLASH) {
      // Possible UNC root
      if (resolvedPath.charCodeAt(1) === CHAR_BACKWARD_SLASH) {
        const code = resolvedPath.charCodeAt(2);
        if (code !== CHAR_QUESTION_MARK && code !== CHAR_DOT) {
          // Matched non-long UNC root, convert the path to a long UNC path
          return `\\\\?\\UNC\\${resolvedPath.slice(2)}`;
        }
      }
    } else if (isWindowsDeviceRoot(resolvedPath.charCodeAt(0))) {
      // Possible device root
      if (resolvedPath.charCodeAt(1) === CHAR_COLON && resolvedPath.charCodeAt(2) === CHAR_BACKWARD_SLASH) {
        // Matched device root, convert the path to a long UNC path
        return `\\\\?\\${resolvedPath}`;
      }
    }
  }
  return path;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
function common$1(paths, sep) {
  const [first = "", ...remaining] = paths;
  const parts = first.split(sep);
  let endOfPrefix = parts.length;
  let append = "";
  for (const path of remaining){
    const compare = path.split(sep);
    if (compare.length <= endOfPrefix) {
      endOfPrefix = compare.length;
      append = "";
    }
    for(let i = 0; i < endOfPrefix; i++){
      if (compare[i] !== parts[i]) {
        endOfPrefix = i;
        append = i === 0 ? "" : sep;
        break;
      }
    }
  }
  return parts.slice(0, endOfPrefix).join(sep) + append;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Determines the common path from a set of paths for Windows systems.
 *
 * @example Usage
 * ```ts
 * import { common } from "@std/path/windows/common";
 * import { assertEquals } from "@std/assert";
 *
 * const path = common([
 *   "C:\\foo\\bar",
 *   "C:\\foo\\baz",
 * ]);
 * assertEquals(path, "C:\\foo\\");
 * ```
 *
 * @param paths The paths to compare.
 * @returns The common path.
 */ function common(paths) {
  return common$1(paths, SEPARATOR);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Options for {@linkcode globToRegExp}, {@linkcode joinGlobs},
 * {@linkcode normalizeGlob} and {@linkcode expandGlob}.
 */ const REG_EXP_ESCAPE_CHARS = [
  "!",
  "$",
  "(",
  ")",
  "*",
  "+",
  ".",
  "=",
  "?",
  "[",
  "\\",
  "^",
  "{",
  "|"
];
const RANGE_ESCAPE_CHARS = [
  "-",
  "\\",
  "]"
];
function _globToRegExp(c, glob, { extended = true, globstar: globstarOption = true, // os = osType,
caseInsensitive = false } = {}) {
  if (glob === "") {
    return /(?!)/;
  }
  // Remove trailing separators.
  let newLength = glob.length;
  for(; newLength > 1 && c.seps.includes(glob[newLength - 1]); newLength--);
  glob = glob.slice(0, newLength);
  let regExpString = "";
  // Terminates correctly. Trust that `j` is incremented every iteration.
  for(let j = 0; j < glob.length;){
    let segment = "";
    const groupStack = [];
    let inRange = false;
    let inEscape = false;
    let endsWithSep = false;
    let i = j;
    // Terminates with `i` at the non-inclusive end of the current segment.
    for(; i < glob.length && !(c.seps.includes(glob[i]) && groupStack.length === 0); i++){
      if (inEscape) {
        inEscape = false;
        const escapeChars = inRange ? RANGE_ESCAPE_CHARS : REG_EXP_ESCAPE_CHARS;
        segment += escapeChars.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
        continue;
      }
      if (glob[i] === c.escapePrefix) {
        inEscape = true;
        continue;
      }
      if (glob[i] === "[") {
        if (!inRange) {
          inRange = true;
          segment += "[";
          if (glob[i + 1] === "!") {
            i++;
            segment += "^";
          } else if (glob[i + 1] === "^") {
            i++;
            segment += "\\^";
          }
          continue;
        } else if (glob[i + 1] === ":") {
          let k = i + 1;
          let value = "";
          while(glob[k + 1] !== undefined && glob[k + 1] !== ":"){
            value += glob[k + 1];
            k++;
          }
          if (glob[k + 1] === ":" && glob[k + 2] === "]") {
            i = k + 2;
            if (value === "alnum") segment += "\\dA-Za-z";
            else if (value === "alpha") segment += "A-Za-z";
            else if (value === "ascii") segment += "\x00-\x7F";
            else if (value === "blank") segment += "\t ";
            else if (value === "cntrl") segment += "\x00-\x1F\x7F";
            else if (value === "digit") segment += "\\d";
            else if (value === "graph") segment += "\x21-\x7E";
            else if (value === "lower") segment += "a-z";
            else if (value === "print") segment += "\x20-\x7E";
            else if (value === "punct") {
              segment += "!\"#$%&'()*+,\\-./:;<=>?@[\\\\\\]^_‘{|}~";
            } else if (value === "space") segment += "\\s\v";
            else if (value === "upper") segment += "A-Z";
            else if (value === "word") segment += "\\w";
            else if (value === "xdigit") segment += "\\dA-Fa-f";
            continue;
          }
        }
      }
      if (glob[i] === "]" && inRange) {
        inRange = false;
        segment += "]";
        continue;
      }
      if (inRange) {
        segment += glob[i];
        continue;
      }
      if (glob[i] === ")" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") {
        segment += ")";
        const type = groupStack.pop();
        if (type === "!") {
          segment += c.wildcard;
        } else if (type !== "@") {
          segment += type;
        }
        continue;
      }
      if (glob[i] === "|" && groupStack.length > 0 && groupStack[groupStack.length - 1] !== "BRACE") {
        segment += "|";
        continue;
      }
      if (glob[i] === "+" && extended && glob[i + 1] === "(") {
        i++;
        groupStack.push("+");
        segment += "(?:";
        continue;
      }
      if (glob[i] === "@" && extended && glob[i + 1] === "(") {
        i++;
        groupStack.push("@");
        segment += "(?:";
        continue;
      }
      if (glob[i] === "?") {
        if (extended && glob[i + 1] === "(") {
          i++;
          groupStack.push("?");
          segment += "(?:";
        } else {
          segment += ".";
        }
        continue;
      }
      if (glob[i] === "!" && extended && glob[i + 1] === "(") {
        i++;
        groupStack.push("!");
        segment += "(?!";
        continue;
      }
      if (glob[i] === "{") {
        groupStack.push("BRACE");
        segment += "(?:";
        continue;
      }
      if (glob[i] === "}" && groupStack[groupStack.length - 1] === "BRACE") {
        groupStack.pop();
        segment += ")";
        continue;
      }
      if (glob[i] === "," && groupStack[groupStack.length - 1] === "BRACE") {
        segment += "|";
        continue;
      }
      if (glob[i] === "*") {
        if (extended && glob[i + 1] === "(") {
          i++;
          groupStack.push("*");
          segment += "(?:";
        } else {
          const prevChar = glob[i - 1];
          let numStars = 1;
          while(glob[i + 1] === "*"){
            i++;
            numStars++;
          }
          const nextChar = glob[i + 1];
          if (globstarOption && numStars === 2 && [
            ...c.seps,
            undefined
          ].includes(prevChar) && [
            ...c.seps,
            undefined
          ].includes(nextChar)) {
            segment += c.globstar;
            endsWithSep = true;
          } else {
            segment += c.wildcard;
          }
        }
        continue;
      }
      segment += REG_EXP_ESCAPE_CHARS.includes(glob[i]) ? `\\${glob[i]}` : glob[i];
    }
    // Check for unclosed groups or a dangling backslash.
    if (groupStack.length > 0 || inRange || inEscape) {
      // Parse failure. Take all characters from this segment literally.
      segment = "";
      for (const c of glob.slice(j, i)){
        segment += REG_EXP_ESCAPE_CHARS.includes(c) ? `\\${c}` : c;
        endsWithSep = false;
      }
    }
    regExpString += segment;
    if (!endsWithSep) {
      regExpString += i < glob.length ? c.sep : c.sepMaybe;
      endsWithSep = true;
    }
    // Terminates with `i` at the start of the next segment.
    while(c.seps.includes(glob[i]))i++;
    j = i;
  }
  regExpString = `^${regExpString}$`;
  return new RegExp(regExpString, caseInsensitive ? "i" : "");
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
const constants = {
  sep: "(?:\\\\|/)+",
  sepMaybe: "(?:\\\\|/)*",
  seps: [
    "\\",
    "/"
  ],
  globstar: "(?:[^\\\\/]*(?:\\\\|/|$)+)*",
  wildcard: "[^\\\\/]*",
  escapePrefix: "`"
};
/** Convert a glob string to a regular expression.
 *
 * Tries to match bash glob expansion as closely as possible.
 *
 * Basic glob syntax:
 * - `*` - Matches everything without leaving the path segment.
 * - `?` - Matches any single character.
 * - `{foo,bar}` - Matches `foo` or `bar`.
 * - `[abcd]` - Matches `a`, `b`, `c` or `d`.
 * - `[a-d]` - Matches `a`, `b`, `c` or `d`.
 * - `[!abcd]` - Matches any single character besides `a`, `b`, `c` or `d`.
 * - `[[:<class>:]]` - Matches any character belonging to `<class>`.
 *     - `[[:alnum:]]` - Matches any digit or letter.
 *     - `[[:digit:]abc]` - Matches any digit, `a`, `b` or `c`.
 *     - See https://facelessuser.github.io/wcmatch/glob/#posix-character-classes
 *       for a complete list of supported character classes.
 * - `\` - Escapes the next character for an `os` other than `"windows"`.
 * - \` - Escapes the next character for `os` set to `"windows"`.
 * - `/` - Path separator.
 * - `\` - Additional path separator only for `os` set to `"windows"`.
 *
 * Extended syntax:
 * - Requires `{ extended: true }`.
 * - `?(foo|bar)` - Matches 0 or 1 instance of `{foo,bar}`.
 * - `@(foo|bar)` - Matches 1 instance of `{foo,bar}`. They behave the same.
 * - `*(foo|bar)` - Matches _n_ instances of `{foo,bar}`.
 * - `+(foo|bar)` - Matches _n > 0_ instances of `{foo,bar}`.
 * - `!(foo|bar)` - Matches anything other than `{foo,bar}`.
 * - See https://www.linuxjournal.com/content/bash-extended-globbing.
 *
 * Globstar syntax:
 * - Requires `{ globstar: true }`.
 * - `**` - Matches any number of any path segments.
 *     - Must comprise its entire path segment in the provided glob.
 * - See https://www.linuxjournal.com/content/globstar-new-bash-globbing-option.
 *
 * Note the following properties:
 * - The generated `RegExp` is anchored at both start and end.
 * - Repeating and trailing separators are tolerated. Trailing separators in the
 *   provided glob have no meaning and are discarded.
 * - Absolute globs will only match absolute paths, etc.
 * - Empty globs will match nothing.
 * - Any special glob syntax must be contained to one path segment. For example,
 *   `?(foo|bar/baz)` is invalid. The separator will take precedence and the
 *   first segment ends with an unclosed group.
 * - If a path segment ends with unclosed groups or a dangling escape prefix, a
 *   parse error has occurred. Every character for that segment is taken
 *   literally in this event.
 *
 * Limitations:
 * - A negative group like `!(foo|bar)` will wrongly be converted to a negative
 *   look-ahead followed by a wildcard. This means that `!(foo).js` will wrongly
 *   fail to match `foobar.js`, even though `foobar` is not `foo`. Effectively,
 *   `!(foo|bar)` is treated like `!(@(foo|bar)*)`. This will work correctly if
 *   the group occurs not nested at the end of the segment.
 *
 * @example Usage
 * ```ts
 * import { globToRegExp } from "@std/path/windows/glob-to-regexp";
 * import { assertEquals } from "@std/assert";
 *
 * assertEquals(globToRegExp("*.js"), /^[^\\/]*\.js(?:\\|\/)*$/);
 * ```
 *
 * @param glob Glob string to convert.
 * @param options Conversion options.
 * @returns The regular expression equivalent to the glob.
 */ function globToRegExp(glob, options = {}) {
  return _globToRegExp(constants, glob, options);
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Test whether the given string is a glob.
 *
 * @example Usage
 * ```ts
 * import { isGlob } from "@std/path/is-glob";
 * import { assert } from "@std/assert";
 *
 * assert(!isGlob("foo/bar/../baz"));
 * assert(isGlob("foo/*ar/../baz"));
 * ```
 *
 * @param str String to test.
 * @returns `true` if the given string is a glob, otherwise `false`
 */ function isGlob(str) {
  const chars = {
    "{": "}",
    "(": ")",
    "[": "]"
  };
  const regex = /\\(.)|(^!|\*|\?|[\].+)]\?|\[[^[\\\]]+\]|\{[^{\\}]+\}|\(\?[:!=][^\\)]+\)|\([^(|]+\|[^\\)]+\)|@\([^)]+\))/;
  if (str === "") {
    return false;
  }
  let match;
  while(match = regex.exec(str)){
    if (match[2]) return true;
    let idx = match.index + match[0].length;
    // if an open bracket/brace/paren is escaped,
    // set the index to the next closing character
    const open = match[1];
    const close = open ? chars[open] : null;
    if (open && close) {
      const n = str.indexOf(close, idx);
      if (n !== -1) {
        idx = n + 1;
      }
    }
    str = str.slice(idx);
  }
  return false;
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Like normalize(), but doesn't collapse "**\/.." when `globstar` is true.
 *
 * @example Usage
 * ```ts
 * import { normalizeGlob } from "@std/path/windows/normalize-glob";
 * import { assertEquals } from "@std/assert";
 *
 * const normalized = normalizeGlob("**\\foo\\..\\bar", { globstar: true });
 * assertEquals(normalized, "**\\bar");
 * ```
 *
 * @param glob The glob pattern to normalize.
 * @param options The options for glob pattern.
 * @returns The normalized glob pattern.
 */ function normalizeGlob(glob, options = {}) {
  const { globstar = false } = options;
  if (glob.match(/\0/g)) {
    throw new Error(`Glob contains invalid characters: "${glob}"`);
  }
  if (!globstar) {
    return normalize(glob);
  }
  const s = SEPARATOR_PATTERN.source;
  const badParentPattern = new RegExp(`(?<=(${s}|^)\\*\\*${s})\\.\\.(?=${s}|$)`, "g");
  return normalize(glob.replace(badParentPattern, "\0")).replace(/\0/g, "..");
}

// Copyright 2018-2025 the Deno authors. MIT license.
// This module is browser compatible.
/**
 * Like join(), but doesn't collapse "**\/.." when `globstar` is true.
 *
 * @example Usage
 *
 * ```ts
 * import { joinGlobs } from "@std/path/windows/join-globs";
 * import { assertEquals } from "@std/assert";
 *
 * const joined = joinGlobs(["foo", "**", "bar"], { globstar: true });
 * assertEquals(joined, "foo\\**\\bar");
 * ```
 *
 * @param globs The globs to join.
 * @param options The options for glob pattern.
 * @returns The joined glob pattern.
 */ function joinGlobs(globs, options = {}) {
  const { globstar = false } = options;
  if (!globstar || globs.length === 0) {
    return join(...globs);
  }
  let joined;
  for (const glob of globs){
    const path = glob;
    if (path.length > 0) {
      if (!joined) joined = path;
      else joined += `${SEPARATOR}${path}`;
    }
  }
  if (!joined) return ".";
  return normalizeGlob(joined, {
    globstar
  });
}

export { DELIMITER, SEPARATOR, SEPARATOR_PATTERN, basename, common, dirname, extname, format, fromFileUrl, globToRegExp, isAbsolute, isGlob, join, joinGlobs, normalize, normalizeGlob, parse, relative, resolve, toFileUrl, toNamespacedPath };
5xW/**
 * @fileoverview Types for the config-array package.
 * @author Nicholas C. Zakas
 */
/**
 * A file matcher used in `files` and `ignores`.
 */
export type FileMatcher = string | ((filePath: string) => boolean);
/**
 * An entry in a config's `files` array.
 *
 * A subarray means all matchers must match.
 */
export type FilesMatcher = FileMatcher | FileMatcher[];
/**
 * The config types allowed in the `extraConfigTypes` option.
 */
export type ExtraConfigType = "array" | "function";
export interface ConfigObject {
    /**
     * The base path for files and ignores.
     */
    basePath?: string;
    /**
     * The files to include.
     */
    files?: FilesMatcher[];
    /**
     * The files to exclude.
     */
    ignores?: FileMatcher[];
    /**
     * The name of the config object.
     */
    name?: string;
    [key: string]: unknown;
}
	}x*{
  "name": "@eslint/config-array",
  "version": "0.23.5",
  "description": "General purpose glob-based configuration matching.",
  "author": "Nicholas C. Zakas",
  "type": "module",
  "main": "dist/esm/index.js",
  "types": "dist/esm/index.d.ts",
  "exports": {
    "require": {
      "types": "./dist/cjs/index.d.cts",
      "default": "./dist/cjs/index.cjs"
    },
    "import": {
      "types": "./dist/esm/index.d.ts",
      "default": "./dist/esm/index.js"
    }
  },
  "files": [
    "dist"
  ],
  "publishConfig": {
    "access": "public"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/eslint/rewrite.git",
    "directory": "packages/config-array"
  },
  "bugs": {
    "url": "https://github.com/eslint/rewrite/issues"
  },
  "homepage": "https://github.com/eslint/rewrite/tree/main/packages/config-array#readme",
  "scripts": {
    "build:dedupe-types": "node ../../tools/dedupe-types.js dist/cjs/index.cjs dist/esm/index.js",
    "build:cts": "node ../../tools/build-cts.js dist/esm/index.d.ts dist/cjs/index.d.cts",
    "build:std__path": "rollup -c rollup.std__path-config.js && node fix-std__path-imports",
    "build": "rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json && npm run build:cts && npm run build:std__path",
    "lint:types": "attw --pack",
    "pretest": "npm run build",
    "test": "npm run test:types && npm run test:unit",
    "test:coverage": "npm run build && c8 npm run test:unit",
    "test:jsr": "npx -y jsr@latest publish --dry-run",
    "test:types": "tsc -p tests/types/tsconfig.json",
    "test:unit": "mocha \"tests/**/*.test.js\""
  },
  "keywords": [
    "configuration",
    "configarray",
    "config file"
  ],
  "license": "Apache-2.0",
  "dependencies": {
    "@eslint/object-schema": "^3.0.5",
    "debug": "^4.3.1",
    "minimatch": "^10.2.4"
  },
  "devDependencies": {
    "@jsr/std__path": "^1.0.4",
    "rollup-plugin-copy": "^3.5.0"
  },
  "engines": {
    "node": "^20.19.0 || ^22.13.0 || >=24"
  }
}
bax p100644 LICENSE &랟+Kfݩo\d100644 README.md F`x@51_q	졲40000 dist %D B*L ^'100644 package.json 
1.pzdo6ɡL8^xI# @eslint/config-helpers

## Description

Helper utilities for creating ESLint configuration.

## Installation

For Node.js and compatible runtimes:

```shell
npm install @eslint/config-helpers
# or
yarn add @eslint/config-helpers
# or
pnpm install @eslint/config-helpers
# or
bun add @eslint/config-helpers
```

For Deno:

```shell
deno add @eslint/config-helpers
```

## Usage

### `defineConfig()`

The `defineConfig()` function allows you to specify an ESLint configuration with full type checking and additional capabilities, such as `extends`. Here's an example:

```js
// eslint.config.js
import { defineConfig } from "@eslint/config-helpers";
import js from "@eslint/js";

export default defineConfig([
	{
		files: ["src/**/*.js"],
		plugins: { js },
		extends: ["js/recommended"],
		rules: {
			"no-var": "error",
			"prefer-const": "error",
		},
	},
	{
		files: ["test/**/*.js"],
		rules: {
			"no-console": "off",
		},
	},
]);
```

### `globalIgnores()`

The `globalIgnores()` function allows you to specify patterns for files and directories that should be globally ignored by ESLint. This is useful for excluding files that you don't want to lint, such as build directories or third-party libraries. Here's an example:

```js
// eslint.config.js
import { defineConfig, globalIgnores } from "@eslint/config-helpers";

export default defineConfig([
	{
		files: ["src/**/*.js"],
		rules: {
			"no-var": "error",
			"prefer-const": "error",
		},
	},
	globalIgnores(["node_modules/", "dist/", "coverage/"]),
]);
```

### `includeIgnoreFile()`

The `includeIgnoreFile()` function reads a file with gitignore-style patterns (such as a `.gitignore`) and returns a config object with the patterns converted to a global ignores object. Pass the absolute path to the ignore file as the first argument:

```js
// eslint.config.js

import { defineConfig, includeIgnoreFile } from "@eslint/config-helpers";
import path from "node:path";

const ignorePath = path.join(import.meta.dirname, ".gitignore");

export default defineConfig([
	includeIgnoreFile(ignorePath, {
		gitignoreResolution: true,
	}),
	// ...
]);
```

#### Options

The second argument is an optional options object:

- **`gitignoreResolution`** (`boolean`): Controls how ignore patterns are interpreted.
    - `false` (default) — patterns are resolved relative to the location of the configuration file.
    - `true` — patterns are resolved relative to the location of the ignore file, matching the behavior of `.gitignore` files.
- **`name`** (`string`): A custom name for the resulting config object.

For backwards compatibility with `includeIgnoreFile()` from `@eslint/compat`, passing a string instead of an object as the second argument is treated as equivalent to providing a value for `name`.

#### Multiple files

You can also pass an array of absolute paths to include multiple ignore files at once. In this case an array of config objects is returned:

```js
// eslint.config.js

import { defineConfig, includeIgnoreFile } from "@eslint/config-helpers";
import path from "node:path";

export default defineConfig([
	includeIgnoreFile(
		[
			path.join(import.meta.dirname, ".gitignore"),
			path.join(import.meta.dirname, "packages/lib/.gitignore"),
		],
		{ gitignoreResolution: true },
	),
	// ...
]);
```

## License

Apache 2.0

<!-- NOTE: This section is autogenerated. Do not manually edit.-->
<!--sponsorsstart-->

## Sponsors

The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
to get your logo on our READMEs and [website](https://eslint.org/sponsors).

<h3>Platinum Sponsors</h3>
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a></p><h3>Gold Sponsors</h3>
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a> <a href="https://www.coderabbit.ai/?utm_source=cr_org&utm_medium=github"><img src="https://avatars.githubusercontent.com/u/132028505" alt="CodeRabbit" height="96"></a></p><h3>Silver Sponsors</h3>
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/d472863/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/2d6c3b6/logo.png" alt="Liftoff" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" height="32"></a> <a href="https://syntax.fm"><img src="https://github.com/syntaxfm.png" alt="Syntax" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://citadel-ai.com"><img src="https://avatars.githubusercontent.com/u/75781367" alt="Citadel AI" height="32"></a></p>
<h3>Technology Sponsors</h3>
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
<!--sponsorsend-->
Ft3x< 40000 cjs ̤XY=ր>Y40000 esm xw.\b-H.Pk/Zxq 100644 index.cjs 6Cħ!Q0wN100644 index.d.cts 'r6if100644 types.cts /zwT}
ʼrcȵF/x^t'use strict';

var fs = require('node:fs');
var path = require('node:path');

/**
 * @fileoverview defineConfig helper
 * @author Nicholas C. Zakas
 */

//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------

/** @import * as $eslintcore from "@eslint/core"; */
/** @typedef {$eslintcore.ConfigObject} ConfigObject */
/** @typedef {$eslintcore.LegacyConfigObject} LegacyConfig */
/** @typedef {$eslintcore.Plugin} Plugin */
/** @typedef {$eslintcore.RuleConfig} RuleConfig */
/** @import * as $typests from "./types.ts"; */
/** @typedef {$typests.Config} Config */
/** @typedef {$typests.ExtendsElement} ExtendsElement */
/** @typedef {$typests.ExtensionConfigObject} ExtensionConfigObject */
/** @typedef {$typests.SimpleExtendsElement} SimpleExtendsElement */
/** @typedef {$typests.ConfigWithExtends} ConfigWithExtends */
/** @typedef {$typests.InfiniteArray<ConfigObject>} InfiniteConfigArray */
/** @typedef {$typests.ConfigWithExtendsArray} ConfigWithExtendsArray */

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

const eslintrcKeys = [
	"env",
	"extends",
	"globals",
	"ignorePatterns",
	"noInlineConfig",
	"overrides",
	"parser",
	"parserOptions",
	"reportUnusedDisableDirectives",
	"root",
];

const allowedGlobalIgnoreKeys = new Set(["basePath", "ignores", "name"]);

/**
 * Gets the name of a config object.
 * @param {ConfigObject} config The config object.
 * @param {string} indexPath The index path of the config object.
 * @return {string} The name of the config object.
 */
function getConfigName(config, indexPath) {
	if (config.name) {
		return config.name;
	}

	return `UserConfig${indexPath}`;
}

/**
 * Gets the name of an extension.
 * @param {SimpleExtendsElement} extension The extension.
 * @param {string} indexPath The index of the extension.
 * @return {string} The name of the extension.
 */
function getExtensionName(extension, indexPath) {
	if (typeof extension === "string") {
		return extension;
	}

	if (extension.name) {
		return extension.name;
	}

	return `ExtendedConfig${indexPath}`;
}

/**
 * Determines if a config object is a legacy config.
 * @param {ConfigObject|LegacyConfig} config The config object to check.
 * @return {config is LegacyConfig} `true` if the config object is a legacy config.
 */
function isLegacyConfig(config) {
	// eslintrc's plugins must be an array; while flat config's must be an object.
	if (Array.isArray(config.plugins)) {
		return true;
	}

	for (const key of eslintrcKeys) {
		if (key in config) {
			return true;
		}
	}

	return false;
}

/**
 * Determines if a config object is a global ignores config.
 * @param {ConfigObject} config The config object to check.
 * @return {boolean} `true` if the config object is a global ignores config.
 */
function isGlobalIgnores(config) {
	return Object.keys(config).every(key => allowedGlobalIgnoreKeys.has(key));
}

/**
 * Parses a plugin member ID (rule, processor, etc.) and returns
 * the namespace and member name.
 * @param {string} id The ID to parse.
 * @returns {{namespace:string, name:string}} The namespace and member name.
 */
function getPluginMember(id) {
	const firstSlashIndex = id.indexOf("/");

	if (firstSlashIndex === -1) {
		return { namespace: "", name: id };
	}

	let namespace = id.slice(0, firstSlashIndex);

	/*
	 * Special cases:
	 * 1. The namespace is `@`, that means it's referring to the
	 *    core plugin so `@` is the full namespace.
	 * 2. The namespace starts with `@`, that means it's referring to
	 *    an npm scoped package. That means the namespace is the scope
	 *    and the package name (i.e., `@eslint/core`).
	 */
	if (namespace[0] === "@" && namespace !== "@") {
		const secondSlashIndex = id.indexOf("/", firstSlashIndex + 1);
		if (secondSlashIndex !== -1) {
			namespace = id.slice(0, secondSlashIndex);
			return { namespace, name: id.slice(secondSlashIndex + 1) };
		}
	}

	const name = id.slice(firstSlashIndex + 1);

	return { namespace, name };
}

/**
 * Normalizes the plugin config by replacing the namespace with the plugin namespace.
 * @param {string} userNamespace The namespace of the plugin.
 * @param {Plugin} plugin The plugin config object.
 * @param {ConfigObject} config The config object to normalize.
 * @return {ConfigObject} The normalized config object.
 */
function normalizePluginConfig(userNamespace, plugin, config) {
	const pluginNamespace = plugin.meta?.namespace;

	// don't do anything if the plugin doesn't have a namespace or rules
	if (
		!pluginNamespace ||
		pluginNamespace === userNamespace ||
		(!config.rules && !config.processor && !config.language)
	) {
		return config;
	}

	const result = { ...config };

	// update the rules
	if (result.rules) {
		const ruleIds = Object.keys(result.rules);

		/** @type {Record<string,RuleConfig|undefined>} */
		const newRules = {};

		for (let i = 0; i < ruleIds.length; i++) {
			const ruleId = ruleIds[i];
			const { namespace: ruleNamespace, name: ruleName } =
				getPluginMember(ruleId);

			if (ruleNamespace === pluginNamespace) {
				newRules[`${userNamespace}/${ruleName}`] = result.rules[ruleId];
			} else {
				newRules[ruleId] = result.rules[ruleId];
			}
		}

		result.rules = newRules;
	}

	// update the processor

	if (typeof result.processor === "string") {
		const { namespace: processorNamespace, name: processorName } =
			getPluginMember(result.processor);

		if (processorNamespace) {
			if (processorNamespace === pluginNamespace) {
				result.processor = `${userNamespace}/${processorName}`;
			}
		}
	}

	// update the language
	if (typeof result.language === "string") {
		const { namespace: languageNamespace, name: languageName } =
			getPluginMember(result.language);

		if (languageNamespace === pluginNamespace) {
			result.language = `${userNamespace}/${languageName}`;
		}
	}

	return result;
}

/**
 * Deeply normalizes a plugin config, traversing recursively into an arrays.
 * @param {string} userPluginNamespace The namespace of the plugin.
 * @param {Plugin} plugin The plugin object.
 * @param {ConfigObject|LegacyConfig|(ConfigObject|LegacyConfig)[]} pluginConfig The plugin config to normalize.
 * @param {string} pluginConfigName The name of the plugin config.
 * @return {InfiniteConfigArray} The normalized plugin config.
 * @throws {TypeError} If the plugin config is a legacy config.
 */
function deepNormalizePluginConfig(
	userPluginNamespace,
	plugin,
	pluginConfig,
	pluginConfigName,
) {
	// if it's an array then it's definitely a new config
	if (Array.isArray(pluginConfig)) {
		return pluginConfig.map(pluginSubConfig =>
			deepNormalizePluginConfig(
				userPluginNamespace,
				plugin,
				pluginSubConfig,
				pluginConfigName,
			),
		);
	}

	// if it's a legacy config, throw an error
	if (isLegacyConfig(pluginConfig)) {
		throw new TypeError(
			`Plugin config "${pluginConfigName}" is an eslintrc config and cannot be used in this context.`,
		);
	}

	return normalizePluginConfig(userPluginNamespace, plugin, pluginConfig);
}

/**
 * Finds a plugin config by name in the given config.
 * @param {ConfigObject} config The config object.
 * @param {string} pluginConfigName The name of the plugin config.
 * @return {InfiniteConfigArray} The plugin config.
 * @throws {TypeError} If the plugin config is not found or is a legacy config.
 */
function findPluginConfig(config, pluginConfigName) {
	const { namespace: userPluginNamespace, name: configName } =
		getPluginMember(pluginConfigName);
	const plugin = config.plugins?.[userPluginNamespace];

	if (!plugin) {
		throw new TypeError(`Plugin "${userPluginNamespace}" not found.`);
	}

	const directConfig = plugin.configs?.[configName];

	// Prefer direct config, but fall back to flat config if available
	if (directConfig) {
		// Arrays are always flat configs, and non-legacy configs can be used directly
		if (Array.isArray(directConfig) || !isLegacyConfig(directConfig)) {
			return deepNormalizePluginConfig(
				userPluginNamespace,
				plugin,
				directConfig,
				pluginConfigName,
			);
		}
	}

	// If it's a legacy config, or the config does not exist => look for the flat version
	const flatConfig = plugin.configs?.[`flat/${configName}`];
	if (
		flatConfig &&
		(Array.isArray(flatConfig) || !isLegacyConfig(flatConfig))
	) {
		return deepNormalizePluginConfig(
			userPluginNamespace,
			plugin,
			flatConfig,
			pluginConfigName,
		);
	}

	// If we get here, then the config was either not found or is a legacy config
	const message =
		directConfig || flatConfig
			? `Plugin config "${configName}" in plugin "${userPluginNamespace}" is an eslintrc config and cannot be used in this context.`
			: `Plugin config "${configName}" not found in plugin "${userPluginNamespace}".`;
	throw new TypeError(message);
}

/**
 * Flattens an array while keeping track of the index path.
 * @param {any[]} configList The array to traverse.
 * @param {string} indexPath The index path of the value in a multidimensional array.
 * @return {IterableIterator<{indexPath:string, value:any}>} The flattened list of values.
 */
function* flatTraverse(configList, indexPath = "") {
	for (let i = 0; i < configList.length; i++) {
		const newIndexPath = indexPath ? `${indexPath}[${i}]` : `[${i}]`;

		// if it's an array then traverse it as well
		if (Array.isArray(configList[i])) {
			yield* flatTraverse(configList[i], newIndexPath);
			continue;
		}

		yield { indexPath: newIndexPath, value: configList[i] };
	}
}

/**
 * Extends a list of config files by creating every combination of base and extension files.
 * @param {(string|string[])[]} [baseFiles] The base files.
 * @param {(string|string[])[]} [extensionFiles] The extension files.
 * @return {(string|string[])[]} The extended files.
 */
function extendConfigFiles(baseFiles = [], extensionFiles = []) {
	if (!extensionFiles.length) {
		return baseFiles.concat();
	}

	if (!baseFiles.length) {
		return extensionFiles.concat();
	}

	/** @type {(string|string[])[]} */
	const result = [];

	for (const baseFile of baseFiles) {
		for (const extensionFile of extensionFiles) {
			/*
			 * Each entry can be a string or array of strings. The end result
			 * needs to be an array of strings, so we need to be sure to include
			 * all of the items when there's an array.
			 */

			const entry = [];

			if (Array.isArray(baseFile)) {
				entry.push(...baseFile);
			} else {
				entry.push(baseFile);
			}

			if (Array.isArray(extensionFile)) {
				entry.push(...extensionFile);
			} else {
				entry.push(extensionFile);
			}

			result.push(entry);
		}
	}

	return result;
}

/**
 * Extends a config object with another config object.
 * @param {ConfigObject} baseConfig The base config object.
 * @param {string} baseConfigName The name of the base config object.
 * @param {ConfigObject} extension The extension config object.
 * @param {string} extensionName The index of the extension config object.
 * @return {ConfigObject} The extended config object.
 */
function extendConfig(baseConfig, baseConfigName, extension, extensionName) {
	const result = { ...extension };

	// for global ignores there is no further work to be done, we just keep everything
	if (!isGlobalIgnores(extension)) {
		// for files we need to create every combination of base and extension files
		if (baseConfig.files) {
			result.files = extendConfigFiles(baseConfig.files, extension.files);
		}

		// for ignores we just concatenation the extension ignores onto the base ignores
		if (baseConfig.ignores) {
			result.ignores = baseConfig.ignores.concat(extension.ignores ?? []);
		}
	}

	result.name = `${baseConfigName} > ${extensionName}`;

	if (baseConfig.basePath) {
		result.basePath = baseConfig.basePath;
	}

	return result;
}

/**
 * Processes a list of extends elements.
 * @param {ConfigWithExtends} config The config object.
 * @param {WeakMap<ConfigObject, string>} configNames The map of config objects to their names.
 * @return {ConfigObject[]} The flattened list of config objects.
 * @throws {TypeError} If the `extends` property is not an array or if nested `extends` is found.
 */
function processExtends(config, configNames) {
	if (!config.extends) {
		return [config];
	}

	if (!Array.isArray(config.extends)) {
		throw new TypeError("The `extends` property must be an array.");
	}

	const {
		/** @type {ConfigObject[]} */
		extends: extendsList,

		/** @type {ConfigObject} */
		...configObject
	} = config;

	const extensionNames = new WeakMap();

	// replace strings with the actual configs
	const objectExtends = extendsList.map(extendsElement => {
		if (typeof extendsElement === "string") {
			const pluginConfig = findPluginConfig(config, extendsElement);

			// assign names
			if (Array.isArray(pluginConfig)) {
				pluginConfig.forEach((pluginConfigElement, index) => {
					extensionNames.set(
						pluginConfigElement,
						`${extendsElement}[${index}]`,
					);
				});
			} else {
				extensionNames.set(pluginConfig, extendsElement);
			}

			return pluginConfig;
		}

		return /** @type {ConfigObject} */ (extendsElement);
	});

	const result = [];

	for (const { indexPath, value: extendsElement } of flatTraverse(
		objectExtends,
	)) {
		const extension = /** @type {ConfigObject} */ (extendsElement);

		if ("basePath" in extension) {
			throw new TypeError("'basePath' in `extends` is not allowed.");
		}

		if ("extends" in extension) {
			throw new TypeError("Nested 'extends' is not allowed.");
		}

		const baseConfigName = /** @type {string} */ (configNames.get(config));
		const extensionName =
			extensionNames.get(extendsElement) ??
			getExtensionName(extendsElement, indexPath);

		result.push(
			extendConfig(
				configObject,
				baseConfigName,
				extension,
				extensionName,
			),
		);
	}

	/*
	 * If the base config object has only `ignores` and `extends`, then
	 * removing `extends` turns it into a global ignores, which is not what
	 * we want. So we need to check if the base config object is a global ignores
	 * and if so, we don't add it to the array.
	 *
	 * (The other option would be to add a `files` entry, but that would result
	 * in a config that didn't actually do anything because there are no
	 * other keys in the config.)
	 */
	if (!isGlobalIgnores(configObject)) {
		result.push(configObject);
	}

	return result.flat();
}

/**
 * Processes a list of config objects and arrays.
 * @param {ConfigWithExtends[]} configList The list of config objects and arrays.
 * @param {WeakMap<ConfigObject, string>} configNames The map of config objects to their names.
 * @return {ConfigObject[]} The flattened list of config objects.
 */
function processConfigList(configList, configNames) {
	return configList.flatMap(config => processExtends(config, configNames));
}

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * Helper function to define a config array.
 * @param {ConfigWithExtendsArray} args The arguments to the function.
 * @returns {ConfigObject[]} The config array.
 * @throws {TypeError} If no arguments are provided or if an argument is not an object.
 */
function defineConfig(...args) {
	const configNames = new WeakMap();
	const configs = [];

	if (args.length === 0) {
		throw new TypeError("Expected one or more arguments.");
	}

	// first flatten the list of configs and get the names
	for (const { indexPath, value } of flatTraverse(args)) {
		if (typeof value !== "object" || value === null) {
			throw new TypeError(
				`Expected an object but received ${String(value)}.`,
			);
		}

		const config = /** @type {ConfigWithExtends} */ (value);

		// save config name for easy reference later
		configNames.set(config, getConfigName(config, indexPath));
		configs.push(config);
	}

	return processConfigList(configs, configNames);
}

/**
 * @fileoverview Global ignores helper function.
 * @author Nicholas C. Zakas
 */

//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------


//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

let globalIgnoreCount = 0;

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * Creates a global ignores config with the given patterns.
 * @param {string[]} ignorePatterns The ignore patterns.
 * @param {string} [name] The name of the global ignores config.
 * @returns {ConfigObject} The global ignores config.
 * @throws {TypeError} If ignorePatterns is not an array or if it is empty.
 */
function globalIgnores(ignorePatterns, name) {
	if (!Array.isArray(ignorePatterns)) {
		throw new TypeError("ignorePatterns must be an array");
	}

	if (ignorePatterns.length === 0) {
		throw new TypeError("ignorePatterns must contain at least one pattern");
	}

	const id = globalIgnoreCount++;

	return {
		name: name || `globalIgnores ${id}`,
		ignores: ignorePatterns,
	};
}

/**
 * @fileoverview Ignore file utilities for the config-helpers package.
 * This file was forked from the source code for the compat package.
 *
 * @author Nicholas C. Zakas
 * @author Kirk Waiblinger
 */


//-----------------------------------------------------------------------------
// Types
//-----------------------------------------------------------------------------


/**
 * @typedef {object} IncludeIgnoreFileOptionsObject
 * @property {boolean} [gitignoreResolution] Whether to interpret the contents of an ignore file relative to the config file or the ignore file.
 * - gitignoreResolution: false (default): Interprets ignore patterns relative to the config file
 * - gitignoreResolution: true: Interprets the ignore patterns in a file relative to the ignore file
 * @property {string} [name] The name to give the output config object(s).
 */

/**
 * Options for `includeIgnoreFile()`. May be provided as an object or, for
 * legacy compatibility with `@eslint/compat`, as a string which is treated as
 * the `name` option.
 * @typedef {IncludeIgnoreFileOptionsObject | string} IncludeIgnoreFileOptions
 */

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * Converts an ESLint ignore pattern to a minimatch pattern.
 * @param {string} pattern The .eslintignore or .gitignore pattern to convert.
 * @returns {string} The converted pattern.
 */
function convertIgnorePatternToMinimatch(pattern) {
	const isNegated = pattern.startsWith("!");
	const negatedPrefix = isNegated ? "!" : "";
	const patternToTest = (isNegated ? pattern.slice(1) : pattern).trimEnd();

	// special cases
	if (["", "**", "/**", "**/"].includes(patternToTest)) {
		return `${negatedPrefix}${patternToTest}`;
	}

	const firstIndexOfSlash = patternToTest.indexOf("/");

	const matchEverywherePrefix =
		firstIndexOfSlash < 0 || firstIndexOfSlash === patternToTest.length - 1
			? "**/"
			: "";

	const patternWithoutLeadingSlash =
		firstIndexOfSlash === 0 ? patternToTest.slice(1) : patternToTest;

	/*
	 * Escape `{` and `(` because in gitignore patterns they are just
	 * literal characters without any specific syntactic meaning,
	 * while in minimatch patterns they can form brace expansion or extglob syntax.
	 *
	 * For example, gitignore pattern `src/{a,b}.js` ignores file `src/{a,b}.js`.
	 * But, the same minimatch pattern `src/{a,b}.js` ignores files `src/a.js` and `src/b.js`.
	 * Minimatch pattern `src/\{a,b}.js` is equivalent to gitignore pattern `src/{a,b}.js`.
	 */
	const escapedPatternWithoutLeadingSlash =
		patternWithoutLeadingSlash.replaceAll(
			// eslint-disable-next-line regexp/no-empty-lookarounds-assertion -- False positive
			/(?=((?:\\.|[^{(])*))\1([{(])/guy,
			"$1\\$2",
		);

	const matchInsideSuffix = patternToTest.endsWith("/**") ? "/*" : "";

	return `${negatedPrefix}${matchEverywherePrefix}${escapedPatternWithoutLeadingSlash}${matchInsideSuffix}`;
}

/**
 * @param {string} ignoreFilePath
 * @returns {string[]}
 */
function ignoreFilePathToPatterns(ignoreFilePath) {
	const ignoreFile = fs.readFileSync(ignoreFilePath, "utf8");
	const lines = ignoreFile.split(/\r?\n/u);

	return lines
		.map(line => line.trim())
		.filter(line => line && !line.startsWith("#"))
		.map(convertIgnorePatternToMinimatch);
}

/**
 * Helper to parse and validate the options to `includeIgnoreFile()`
 *
 * @param {string | { gitignoreResolution?: unknown, name?: unknown } | undefined} options
 * @returns {{ gitignoreResolution: boolean, name: string }}
 */
function parseOptions(options) {
	// legacy compatibility with @eslint/compat's `includeIgnoreFile`
	if (typeof options === "string") {
		return { gitignoreResolution: false, name: options };
	}

	const optionsObject = options ?? {};
	if (typeof optionsObject !== "object" || Array.isArray(optionsObject)) {
		throw new TypeError(
			"The options argument to `includeIgnoreFile()` should be an object or a string.",
		);
	}

	const gitignoreResolution = optionsObject.gitignoreResolution ?? false;
	if (typeof gitignoreResolution !== "boolean") {
		throw new TypeError(
			"The `gitignoreResolution` option must be specified a boolean or omitted",
		);
	}

	const name = optionsObject.name ?? `Imported .gitignore patterns`;
	if (typeof name !== "string") {
		throw new TypeError(
			"The `name` option must be specified as a string or omitted.",
		);
	}

	return { gitignoreResolution, name };
}

/**
 * @overload
 *
 * Reads ignore files and returns objects with the ignore patterns.
 *
 * @param {string[]} ignoreFilePathArg The paths of ignore files to include.
 * @param {IncludeIgnoreFileOptions} [options]
 * @returns {ConfigObject[]}
 */

/**
 * @overload
 *
 * Reads an ignore file and returns an object with the ignore patterns.
 *
 * @param {string} ignoreFilePathArg The path of the ignore file to include.
 * @param {IncludeIgnoreFileOptions} [options]
 * @returns {ConfigObject}
 */

/**
 * @overload
 *
 * Reads an ignore file(s) and returns an object(s) with the ignore patterns.
 *
 * @param {string[] | string} ignoreFilePathArg The path(s) of the ignore file(s) to include.
 * @param {IncludeIgnoreFileOptions} [options]
 * @returns {ConfigObject[] | ConfigObject}
 */

/**
 * Reads an ignore file(s) and returns an object(s) with the ignore patterns.
 *
 * @param {string[] | string} ignoreFilePathArg The path(s) of the ignore file(s) to include.
 * @param {IncludeIgnoreFileOptions} [options]
 * @returns {ConfigObject[] | ConfigObject}
 */
function includeIgnoreFile(ignoreFilePathArg, options) {
	const returnSingleObject = !Array.isArray(ignoreFilePathArg);
	const ignoreFilePaths = Array.isArray(ignoreFilePathArg)
		? ignoreFilePathArg
		: [ignoreFilePathArg];
	for (const ignorePath of ignoreFilePaths) {
		if (typeof ignorePath !== "string") {
			throw new TypeError(
				"The first argument to `includeIgnoreFile()` should be a string or array of strings",
			);
		}
		if (!path.isAbsolute(ignorePath)) {
			throw new Error(
				`The ignore file location must be an absolute path. Received ${ignorePath}`,
			);
		}
	}

	const { gitignoreResolution, name } = parseOptions(options);

	if (returnSingleObject) {
		return {
			name,
			ignores: ignoreFilePathToPatterns(ignoreFilePathArg),
			...(gitignoreResolution
				? { basePath: path.dirname(ignoreFilePathArg) }
				: {}),
		};
	}

	return ignoreFilePaths.map((ignoreFilePath, i) => ({
		name: `${name} (${i})`,
		ignores: ignoreFilePathToPatterns(ignoreFilePath),
		...(gitignoreResolution
			? { basePath: path.dirname(ignoreFilePath) }
			: {}),
	}));
}

exports.convertIgnorePatternToMinimatch = convertIgnorePatternToMinimatch;
exports.defineConfig = defineConfig;
exports.globalIgnores = globalIgnores;
exports.includeIgnoreFile = includeIgnoreFile;
\ưx export type IncludeIgnoreFileOptionsObject = {
    /**
     * Whether to interpret the contents of an ignore file relative to the config file or the ignore file.
     * - gitignoreResolution: false (default): Interprets ignore patterns relative to the config file
     * - gitignoreResolution: true: Interprets the ignore patterns in a file relative to the ignore file
     */
    gitignoreResolution?: boolean;
    /**
     * The name to give the output config object(s).
     */
    name?: string;
};
/**
 * Options for `includeIgnoreFile()`. May be provided as an object or, for
 * legacy compatibility with `@eslint/compat`, as a string which is treated as
 * the `name` option.
 */
export type IncludeIgnoreFileOptions = IncludeIgnoreFileOptionsObject | string;
export type ConfigObject = $eslintcore.ConfigObject;
export type LegacyConfig = $eslintcore.LegacyConfigObject;
export type Plugin = $eslintcore.Plugin;
export type RuleConfig = $eslintcore.RuleConfig;
export type Config = $typests.Config;
export type ExtendsElement = $typests.ExtendsElement;
export type ExtensionConfigObject = $typests.ExtensionConfigObject;
export type SimpleExtendsElement = $typests.SimpleExtendsElement;
export type ConfigWithExtends = $typests.ConfigWithExtends;
export type InfiniteConfigArray = $typests.InfiniteArray<ConfigObject>;
export type ConfigWithExtendsArray = $typests.ConfigWithExtendsArray;
/**
 * @fileoverview Ignore file utilities for the config-helpers package.
 * This file was forked from the source code for the compat package.
 *
 * @author Nicholas C. Zakas
 * @author Kirk Waiblinger
 */
/**
 * @typedef {object} IncludeIgnoreFileOptionsObject
 * @property {boolean} [gitignoreResolution] Whether to interpret the contents of an ignore file relative to the config file or the ignore file.
 * - gitignoreResolution: false (default): Interprets ignore patterns relative to the config file
 * - gitignoreResolution: true: Interprets the ignore patterns in a file relative to the ignore file
 * @property {string} [name] The name to give the output config object(s).
 */
/**
 * Options for `includeIgnoreFile()`. May be provided as an object or, for
 * legacy compatibility with `@eslint/compat`, as a string which is treated as
 * the `name` option.
 * @typedef {IncludeIgnoreFileOptionsObject | string} IncludeIgnoreFileOptions
 */
/**
 * Converts an ESLint ignore pattern to a minimatch pattern.
 * @param {string} pattern The .eslintignore or .gitignore pattern to convert.
 * @returns {string} The converted pattern.
 */
export function convertIgnorePatternToMinimatch(pattern: string): string;
/**
 * Helper function to define a config array.
 * @param {ConfigWithExtendsArray} args The arguments to the function.
 * @returns {ConfigObject[]} The config array.
 * @throws {TypeError} If no arguments are provided or if an argument is not an object.
 */
export function defineConfig(...args: ConfigWithExtendsArray): ConfigObject[];
/**
 * Creates a global ignores config with the given patterns.
 * @param {string[]} ignorePatterns The ignore patterns.
 * @param {string} [name] The name of the global ignores config.
 * @returns {ConfigObject} The global ignores config.
 * @throws {TypeError} If ignorePatterns is not an array or if it is empty.
 */
export function globalIgnores(ignorePatterns: string[], name?: string): ConfigObject;
/**
 * @overload
 *
 * Reads ignore files and returns objects with the ignore patterns.
 *
 * @param {string[]} ignoreFilePathArg The paths of ignore files to include.
 * @param {IncludeIgnoreFileOptions} [options]
 * @returns {ConfigObject[]}
 */
export function includeIgnoreFile(ignoreFilePathArg: string[], options?: IncludeIgnoreFileOptions): ConfigObject[];
/**
 * @overload
 *
 * Reads an ignore file and returns an object with the ignore patterns.
 *
 * @param {string} ignoreFilePathArg The path of the ignore file to include.
 * @param {IncludeIgnoreFileOptions} [options]
 * @returns {ConfigObject}
 */
export function includeIgnoreFile(ignoreFilePathArg: string, options?: IncludeIgnoreFileOptions): ConfigObject;
/**
 * @overload
 *
 * Reads an ignore file(s) and returns an object(s) with the ignore patterns.
 *
 * @param {string[] | string} ignoreFilePathArg The path(s) of the ignore file(s) to include.
 * @param {IncludeIgnoreFileOptions} [options]
 * @returns {ConfigObject[] | ConfigObject}
 */
export function includeIgnoreFile(ignoreFilePathArg: string[] | string, options?: IncludeIgnoreFileOptions): ConfigObject[] | ConfigObject;
import type * as $eslintcore from "@eslint/core";
import type * as $typests from "./types.cts";
DWcBx*/**
 * @fileoverview Types for this package.
 */

import type { ConfigObject } from "@eslint/core";

/** @deprecated Use `ConfigObject` instead. */
export type Config = ConfigObject;

/**
 * Infinite array type.
 */
export type InfiniteArray<T> = T | InfiniteArray<T>[];

/**
 * A config object that may appear inside of `extends`.
 * `basePath` and nested `extends` are not allowed on extension config objects.
 */
export type ExtensionConfigObject = Omit<ConfigObject, "basePath"> & {
	extends?: never;
};

/**
 * The type of array element in the `extends` property after flattening.
 */
export type SimpleExtendsElement = string | ExtensionConfigObject;

/**
 * The type of array element in the `extends` property before flattening.
 */
export type ExtendsElement =
	SimpleExtendsElement | InfiniteArray<ExtensionConfigObject>;

/**
 * Config with extends. Valid only inside of `defineConfig()`.
 */
export interface ConfigWithExtends extends ConfigObject {
	extends?: ExtendsElement[];
}

export type ConfigWithExtendsArray = InfiniteArray<ConfigWithExtends>[];
co3	x k100644 index.d.ts nx^h..16100644 index.js +WCޤ*	X^cKV\100644 types.d.ts [G6(9EiNۡ_100644 types.ts /zwT}
ʼrc{::x export type IncludeIgnoreFileOptionsObject = {
    /**
     * Whether to interpret the contents of an ignore file relative to the config file or the ignore file.
     * - gitignoreResolution: false (default): Interprets ignore patterns relative to the config file
     * - gitignoreResolution: true: Interprets the ignore patterns in a file relative to the ignore file
     */
    gitignoreResolution?: boolean;
    /**
     * The name to give the output config object(s).
     */
    name?: string;
};
/**
 * Options for `includeIgnoreFile()`. May be provided as an object or, for
 * legacy compatibility with `@eslint/compat`, as a string which is treated as
 * the `name` option.
 */
export type IncludeIgnoreFileOptions = IncludeIgnoreFileOptionsObject | string;
export type ConfigObject = $eslintcore.ConfigObject;
export type LegacyConfig = $eslintcore.LegacyConfigObject;
export type Plugin = $eslintcore.Plugin;
export type RuleConfig = $eslintcore.RuleConfig;
export type Config = $typests.Config;
export type ExtendsElement = $typests.ExtendsElement;
export type ExtensionConfigObject = $typests.ExtensionConfigObject;
export type SimpleExtendsElement = $typests.SimpleExtendsElement;
export type ConfigWithExtends = $typests.ConfigWithExtends;
export type InfiniteConfigArray = $typests.InfiniteArray<ConfigObject>;
export type ConfigWithExtendsArray = $typests.ConfigWithExtendsArray;
/**
 * @fileoverview Ignore file utilities for the config-helpers package.
 * This file was forked from the source code for the compat package.
 *
 * @author Nicholas C. Zakas
 * @author Kirk Waiblinger
 */
/**
 * @typedef {object} IncludeIgnoreFileOptionsObject
 * @property {boolean} [gitignoreResolution] Whether to interpret the contents of an ignore file relative to the config file or the ignore file.
 * - gitignoreResolution: false (default): Interprets ignore patterns relative to the config file
 * - gitignoreResolution: true: Interprets the ignore patterns in a file relative to the ignore file
 * @property {string} [name] The name to give the output config object(s).
 */
/**
 * Options for `includeIgnoreFile()`. May be provided as an object or, for
 * legacy compatibility with `@eslint/compat`, as a string which is treated as
 * the `name` option.
 * @typedef {IncludeIgnoreFileOptionsObject | string} IncludeIgnoreFileOptions
 */
/**
 * Converts an ESLint ignore pattern to a minimatch pattern.
 * @param {string} pattern The .eslintignore or .gitignore pattern to convert.
 * @returns {string} The converted pattern.
 */
export function convertIgnorePatternToMinimatch(pattern: string): string;
/**
 * Helper function to define a config array.
 * @param {ConfigWithExtendsArray} args The arguments to the function.
 * @returns {ConfigObject[]} The config array.
 * @throws {TypeError} If no arguments are provided or if an argument is not an object.
 */
export function defineConfig(...args: ConfigWithExtendsArray): ConfigObject[];
/**
 * Creates a global ignores config with the given patterns.
 * @param {string[]} ignorePatterns The ignore patterns.
 * @param {string} [name] The name of the global ignores config.
 * @returns {ConfigObject} The global ignores config.
 * @throws {TypeError} If ignorePatterns is not an array or if it is empty.
 */
export function globalIgnores(ignorePatterns: string[], name?: string): ConfigObject;
/**
 * @overload
 *
 * Reads ignore files and returns objects with the ignore patterns.
 *
 * @param {string[]} ignoreFilePathArg The paths of ignore files to include.
 * @param {IncludeIgnoreFileOptions} [options]
 * @returns {ConfigObject[]}
 */
export function includeIgnoreFile(ignoreFilePathArg: string[], options?: IncludeIgnoreFileOptions): ConfigObject[];
/**
 * @overload
 *
 * Reads an ignore file and returns an object with the ignore patterns.
 *
 * @param {string} ignoreFilePathArg The path of the ignore file to include.
 * @param {IncludeIgnoreFileOptions} [options]
 * @returns {ConfigObject}
 */
export function includeIgnoreFile(ignoreFilePathArg: string, options?: IncludeIgnoreFileOptions): ConfigObject;
/**
 * @overload
 *
 * Reads an ignore file(s) and returns an object(s) with the ignore patterns.
 *
 * @param {string[] | string} ignoreFilePathArg The path(s) of the ignore file(s) to include.
 * @param {IncludeIgnoreFileOptions} [options]
 * @returns {ConfigObject[] | ConfigObject}
 */
export function includeIgnoreFile(ignoreFilePathArg: string[] | string, options?: IncludeIgnoreFileOptions): ConfigObject[] | ConfigObject;
import type * as $eslintcore from "@eslint/core";
import type * as $typests from "./types.ts";
W x-^ҡ// @ts-self-types="./index.d.ts"
import fs from 'node:fs';
import path from 'node:path';

/**
 * @fileoverview defineConfig helper
 * @author Nicholas C. Zakas
 */

//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------

/** @import * as $eslintcore from "@eslint/core"; */
/** @typedef {$eslintcore.ConfigObject} ConfigObject */
/** @typedef {$eslintcore.LegacyConfigObject} LegacyConfig */
/** @typedef {$eslintcore.Plugin} Plugin */
/** @typedef {$eslintcore.RuleConfig} RuleConfig */
/** @import * as $typests from "./types.ts"; */
/** @typedef {$typests.Config} Config */
/** @typedef {$typests.ExtendsElement} ExtendsElement */
/** @typedef {$typests.ExtensionConfigObject} ExtensionConfigObject */
/** @typedef {$typests.SimpleExtendsElement} SimpleExtendsElement */
/** @typedef {$typests.ConfigWithExtends} ConfigWithExtends */
/** @typedef {$typests.InfiniteArray<ConfigObject>} InfiniteConfigArray */
/** @typedef {$typests.ConfigWithExtendsArray} ConfigWithExtendsArray */

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

const eslintrcKeys = [
	"env",
	"extends",
	"globals",
	"ignorePatterns",
	"noInlineConfig",
	"overrides",
	"parser",
	"parserOptions",
	"reportUnusedDisableDirectives",
	"root",
];

const allowedGlobalIgnoreKeys = new Set(["basePath", "ignores", "name"]);

/**
 * Gets the name of a config object.
 * @param {ConfigObject} config The config object.
 * @param {string} indexPath The index path of the config object.
 * @return {string} The name of the config object.
 */
function getConfigName(config, indexPath) {
	if (config.name) {
		return config.name;
	}

	return `UserConfig${indexPath}`;
}

/**
 * Gets the name of an extension.
 * @param {SimpleExtendsElement} extension The extension.
 * @param {string} indexPath The index of the extension.
 * @return {string} The name of the extension.
 */
function getExtensionName(extension, indexPath) {
	if (typeof extension === "string") {
		return extension;
	}

	if (extension.name) {
		return extension.name;
	}

	return `ExtendedConfig${indexPath}`;
}

/**
 * Determines if a config object is a legacy config.
 * @param {ConfigObject|LegacyConfig} config The config object to check.
 * @return {config is LegacyConfig} `true` if the config object is a legacy config.
 */
function isLegacyConfig(config) {
	// eslintrc's plugins must be an array; while flat config's must be an object.
	if (Array.isArray(config.plugins)) {
		return true;
	}

	for (const key of eslintrcKeys) {
		if (key in config) {
			return true;
		}
	}

	return false;
}

/**
 * Determines if a config object is a global ignores config.
 * @param {ConfigObject} config The config object to check.
 * @return {boolean} `true` if the config object is a global ignores config.
 */
function isGlobalIgnores(config) {
	return Object.keys(config).every(key => allowedGlobalIgnoreKeys.has(key));
}

/**
 * Parses a plugin member ID (rule, processor, etc.) and returns
 * the namespace and member name.
 * @param {string} id The ID to parse.
 * @returns {{namespace:string, name:string}} The namespace and member name.
 */
function getPluginMember(id) {
	const firstSlashIndex = id.indexOf("/");

	if (firstSlashIndex === -1) {
		return { namespace: "", name: id };
	}

	let namespace = id.slice(0, firstSlashIndex);

	/*
	 * Special cases:
	 * 1. The namespace is `@`, that means it's referring to the
	 *    core plugin so `@` is the full namespace.
	 * 2. The namespace starts with `@`, that means it's referring to
	 *    an npm scoped package. That means the namespace is the scope
	 *    and the package name (i.e., `@eslint/core`).
	 */
	if (namespace[0] === "@" && namespace !== "@") {
		const secondSlashIndex = id.indexOf("/", firstSlashIndex + 1);
		if (secondSlashIndex !== -1) {
			namespace = id.slice(0, secondSlashIndex);
			return { namespace, name: id.slice(secondSlashIndex + 1) };
		}
	}

	const name = id.slice(firstSlashIndex + 1);

	return { namespace, name };
}

/**
 * Normalizes the plugin config by replacing the namespace with the plugin namespace.
 * @param {string} userNamespace The namespace of the plugin.
 * @param {Plugin} plugin The plugin config object.
 * @param {ConfigObject} config The config object to normalize.
 * @return {ConfigObject} The normalized config object.
 */
function normalizePluginConfig(userNamespace, plugin, config) {
	const pluginNamespace = plugin.meta?.namespace;

	// don't do anything if the plugin doesn't have a namespace or rules
	if (
		!pluginNamespace ||
		pluginNamespace === userNamespace ||
		(!config.rules && !config.processor && !config.language)
	) {
		return config;
	}

	const result = { ...config };

	// update the rules
	if (result.rules) {
		const ruleIds = Object.keys(result.rules);

		/** @type {Record<string,RuleConfig|undefined>} */
		const newRules = {};

		for (let i = 0; i < ruleIds.length; i++) {
			const ruleId = ruleIds[i];
			const { namespace: ruleNamespace, name: ruleName } =
				getPluginMember(ruleId);

			if (ruleNamespace === pluginNamespace) {
				newRules[`${userNamespace}/${ruleName}`] = result.rules[ruleId];
			} else {
				newRules[ruleId] = result.rules[ruleId];
			}
		}

		result.rules = newRules;
	}

	// update the processor

	if (typeof result.processor === "string") {
		const { namespace: processorNamespace, name: processorName } =
			getPluginMember(result.processor);

		if (processorNamespace) {
			if (processorNamespace === pluginNamespace) {
				result.processor = `${userNamespace}/${processorName}`;
			}
		}
	}

	// update the language
	if (typeof result.language === "string") {
		const { namespace: languageNamespace, name: languageName } =
			getPluginMember(result.language);

		if (languageNamespace === pluginNamespace) {
			result.language = `${userNamespace}/${languageName}`;
		}
	}

	return result;
}

/**
 * Deeply normalizes a plugin config, traversing recursively into an arrays.
 * @param {string} userPluginNamespace The namespace of the plugin.
 * @param {Plugin} plugin The plugin object.
 * @param {ConfigObject|LegacyConfig|(ConfigObject|LegacyConfig)[]} pluginConfig The plugin config to normalize.
 * @param {string} pluginConfigName The name of the plugin config.
 * @return {InfiniteConfigArray} The normalized plugin config.
 * @throws {TypeError} If the plugin config is a legacy config.
 */
function deepNormalizePluginConfig(
	userPluginNamespace,
	plugin,
	pluginConfig,
	pluginConfigName,
) {
	// if it's an array then it's definitely a new config
	if (Array.isArray(pluginConfig)) {
		return pluginConfig.map(pluginSubConfig =>
			deepNormalizePluginConfig(
				userPluginNamespace,
				plugin,
				pluginSubConfig,
				pluginConfigName,
			),
		);
	}

	// if it's a legacy config, throw an error
	if (isLegacyConfig(pluginConfig)) {
		throw new TypeError(
			`Plugin config "${pluginConfigName}" is an eslintrc config and cannot be used in this context.`,
		);
	}

	return normalizePluginConfig(userPluginNamespace, plugin, pluginConfig);
}

/**
 * Finds a plugin config by name in the given config.
 * @param {ConfigObject} config The config object.
 * @param {string} pluginConfigName The name of the plugin config.
 * @return {InfiniteConfigArray} The plugin config.
 * @throws {TypeError} If the plugin config is not found or is a legacy config.
 */
function findPluginConfig(config, pluginConfigName) {
	const { namespace: userPluginNamespace, name: configName } =
		getPluginMember(pluginConfigName);
	const plugin = config.plugins?.[userPluginNamespace];

	if (!plugin) {
		throw new TypeError(`Plugin "${userPluginNamespace}" not found.`);
	}

	const directConfig = plugin.configs?.[configName];

	// Prefer direct config, but fall back to flat config if available
	if (directConfig) {
		// Arrays are always flat configs, and non-legacy configs can be used directly
		if (Array.isArray(directConfig) || !isLegacyConfig(directConfig)) {
			return deepNormalizePluginConfig(
				userPluginNamespace,
				plugin,
				directConfig,
				pluginConfigName,
			);
		}
	}

	// If it's a legacy config, or the config does not exist => look for the flat version
	const flatConfig = plugin.configs?.[`flat/${configName}`];
	if (
		flatConfig &&
		(Array.isArray(flatConfig) || !isLegacyConfig(flatConfig))
	) {
		return deepNormalizePluginConfig(
			userPluginNamespace,
			plugin,
			flatConfig,
			pluginConfigName,
		);
	}

	// If we get here, then the config was either not found or is a legacy config
	const message =
		directConfig || flatConfig
			? `Plugin config "${configName}" in plugin "${userPluginNamespace}" is an eslintrc config and cannot be used in this context.`
			: `Plugin config "${configName}" not found in plugin "${userPluginNamespace}".`;
	throw new TypeError(message);
}

/**
 * Flattens an array while keeping track of the index path.
 * @param {any[]} configList The array to traverse.
 * @param {string} indexPath The index path of the value in a multidimensional array.
 * @return {IterableIterator<{indexPath:string, value:any}>} The flattened list of values.
 */
function* flatTraverse(configList, indexPath = "") {
	for (let i = 0; i < configList.length; i++) {
		const newIndexPath = indexPath ? `${indexPath}[${i}]` : `[${i}]`;

		// if it's an array then traverse it as well
		if (Array.isArray(configList[i])) {
			yield* flatTraverse(configList[i], newIndexPath);
			continue;
		}

		yield { indexPath: newIndexPath, value: configList[i] };
	}
}

/**
 * Extends a list of config files by creating every combination of base and extension files.
 * @param {(string|string[])[]} [baseFiles] The base files.
 * @param {(string|string[])[]} [extensionFiles] The extension files.
 * @return {(string|string[])[]} The extended files.
 */
function extendConfigFiles(baseFiles = [], extensionFiles = []) {
	if (!extensionFiles.length) {
		return baseFiles.concat();
	}

	if (!baseFiles.length) {
		return extensionFiles.concat();
	}

	/** @type {(string|string[])[]} */
	const result = [];

	for (const baseFile of baseFiles) {
		for (const extensionFile of extensionFiles) {
			/*
			 * Each entry can be a string or array of strings. The end result
			 * needs to be an array of strings, so we need to be sure to include
			 * all of the items when there's an array.
			 */

			const entry = [];

			if (Array.isArray(baseFile)) {
				entry.push(...baseFile);
			} else {
				entry.push(baseFile);
			}

			if (Array.isArray(extensionFile)) {
				entry.push(...extensionFile);
			} else {
				entry.push(extensionFile);
			}

			result.push(entry);
		}
	}

	return result;
}

/**
 * Extends a config object with another config object.
 * @param {ConfigObject} baseConfig The base config object.
 * @param {string} baseConfigName The name of the base config object.
 * @param {ConfigObject} extension The extension config object.
 * @param {string} extensionName The index of the extension config object.
 * @return {ConfigObject} The extended config object.
 */
function extendConfig(baseConfig, baseConfigName, extension, extensionName) {
	const result = { ...extension };

	// for global ignores there is no further work to be done, we just keep everything
	if (!isGlobalIgnores(extension)) {
		// for files we need to create every combination of base and extension files
		if (baseConfig.files) {
			result.files = extendConfigFiles(baseConfig.files, extension.files);
		}

		// for ignores we just concatenation the extension ignores onto the base ignores
		if (baseConfig.ignores) {
			result.ignores = baseConfig.ignores.concat(extension.ignores ?? []);
		}
	}

	result.name = `${baseConfigName} > ${extensionName}`;

	if (baseConfig.basePath) {
		result.basePath = baseConfig.basePath;
	}

	return result;
}

/**
 * Processes a list of extends elements.
 * @param {ConfigWithExtends} config The config object.
 * @param {WeakMap<ConfigObject, string>} configNames The map of config objects to their names.
 * @return {ConfigObject[]} The flattened list of config objects.
 * @throws {TypeError} If the `extends` property is not an array or if nested `extends` is found.
 */
function processExtends(config, configNames) {
	if (!config.extends) {
		return [config];
	}

	if (!Array.isArray(config.extends)) {
		throw new TypeError("The `extends` property must be an array.");
	}

	const {
		/** @type {ConfigObject[]} */
		extends: extendsList,

		/** @type {ConfigObject} */
		...configObject
	} = config;

	const extensionNames = new WeakMap();

	// replace strings with the actual configs
	const objectExtends = extendsList.map(extendsElement => {
		if (typeof extendsElement === "string") {
			const pluginConfig = findPluginConfig(config, extendsElement);

			// assign names
			if (Array.isArray(pluginConfig)) {
				pluginConfig.forEach((pluginConfigElement, index) => {
					extensionNames.set(
						pluginConfigElement,
						`${extendsElement}[${index}]`,
					);
				});
			} else {
				extensionNames.set(pluginConfig, extendsElement);
			}

			return pluginConfig;
		}

		return /** @type {ConfigObject} */ (extendsElement);
	});

	const result = [];

	for (const { indexPath, value: extendsElement } of flatTraverse(
		objectExtends,
	)) {
		const extension = /** @type {ConfigObject} */ (extendsElement);

		if ("basePath" in extension) {
			throw new TypeError("'basePath' in `extends` is not allowed.");
		}

		if ("extends" in extension) {
			throw new TypeError("Nested 'extends' is not allowed.");
		}

		const baseConfigName = /** @type {string} */ (configNames.get(config));
		const extensionName =
			extensionNames.get(extendsElement) ??
			getExtensionName(extendsElement, indexPath);

		result.push(
			extendConfig(
				configObject,
				baseConfigName,
				extension,
				extensionName,
			),
		);
	}

	/*
	 * If the base config object has only `ignores` and `extends`, then
	 * removing `extends` turns it into a global ignores, which is not what
	 * we want. So we need to check if the base config object is a global ignores
	 * and if so, we don't add it to the array.
	 *
	 * (The other option would be to add a `files` entry, but that would result
	 * in a config that didn't actually do anything because there are no
	 * other keys in the config.)
	 */
	if (!isGlobalIgnores(configObject)) {
		result.push(configObject);
	}

	return result.flat();
}

/**
 * Processes a list of config objects and arrays.
 * @param {ConfigWithExtends[]} configList The list of config objects and arrays.
 * @param {WeakMap<ConfigObject, string>} configNames The map of config objects to their names.
 * @return {ConfigObject[]} The flattened list of config objects.
 */
function processConfigList(configList, configNames) {
	return configList.flatMap(config => processExtends(config, configNames));
}

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * Helper function to define a config array.
 * @param {ConfigWithExtendsArray} args The arguments to the function.
 * @returns {ConfigObject[]} The config array.
 * @throws {TypeError} If no arguments are provided or if an argument is not an object.
 */
function defineConfig(...args) {
	const configNames = new WeakMap();
	const configs = [];

	if (args.length === 0) {
		throw new TypeError("Expected one or more arguments.");
	}

	// first flatten the list of configs and get the names
	for (const { indexPath, value } of flatTraverse(args)) {
		if (typeof value !== "object" || value === null) {
			throw new TypeError(
				`Expected an object but received ${String(value)}.`,
			);
		}

		const config = /** @type {ConfigWithExtends} */ (value);

		// save config name for easy reference later
		configNames.set(config, getConfigName(config, indexPath));
		configs.push(config);
	}

	return processConfigList(configs, configNames);
}

/**
 * @fileoverview Global ignores helper function.
 * @author Nicholas C. Zakas
 */

//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------


//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

let globalIgnoreCount = 0;

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * Creates a global ignores config with the given patterns.
 * @param {string[]} ignorePatterns The ignore patterns.
 * @param {string} [name] The name of the global ignores config.
 * @returns {ConfigObject} The global ignores config.
 * @throws {TypeError} If ignorePatterns is not an array or if it is empty.
 */
function globalIgnores(ignorePatterns, name) {
	if (!Array.isArray(ignorePatterns)) {
		throw new TypeError("ignorePatterns must be an array");
	}

	if (ignorePatterns.length === 0) {
		throw new TypeError("ignorePatterns must contain at least one pattern");
	}

	const id = globalIgnoreCount++;

	return {
		name: name || `globalIgnores ${id}`,
		ignores: ignorePatterns,
	};
}

/**
 * @fileoverview Ignore file utilities for the config-helpers package.
 * This file was forked from the source code for the compat package.
 *
 * @author Nicholas C. Zakas
 * @author Kirk Waiblinger
 */


//-----------------------------------------------------------------------------
// Types
//-----------------------------------------------------------------------------


/**
 * @typedef {object} IncludeIgnoreFileOptionsObject
 * @property {boolean} [gitignoreResolution] Whether to interpret the contents of an ignore file relative to the config file or the ignore file.
 * - gitignoreResolution: false (default): Interprets ignore patterns relative to the config file
 * - gitignoreResolution: true: Interprets the ignore patterns in a file relative to the ignore file
 * @property {string} [name] The name to give the output config object(s).
 */

/**
 * Options for `includeIgnoreFile()`. May be provided as an object or, for
 * legacy compatibility with `@eslint/compat`, as a string which is treated as
 * the `name` option.
 * @typedef {IncludeIgnoreFileOptionsObject | string} IncludeIgnoreFileOptions
 */

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * Converts an ESLint ignore pattern to a minimatch pattern.
 * @param {string} pattern The .eslintignore or .gitignore pattern to convert.
 * @returns {string} The converted pattern.
 */
function convertIgnorePatternToMinimatch(pattern) {
	const isNegated = pattern.startsWith("!");
	const negatedPrefix = isNegated ? "!" : "";
	const patternToTest = (isNegated ? pattern.slice(1) : pattern).trimEnd();

	// special cases
	if (["", "**", "/**", "**/"].includes(patternToTest)) {
		return `${negatedPrefix}${patternToTest}`;
	}

	const firstIndexOfSlash = patternToTest.indexOf("/");

	const matchEverywherePrefix =
		firstIndexOfSlash < 0 || firstIndexOfSlash === patternToTest.length - 1
			? "**/"
			: "";

	const patternWithoutLeadingSlash =
		firstIndexOfSlash === 0 ? patternToTest.slice(1) : patternToTest;

	/*
	 * Escape `{` and `(` because in gitignore patterns they are just
	 * literal characters without any specific syntactic meaning,
	 * while in minimatch patterns they can form brace expansion or extglob syntax.
	 *
	 * For example, gitignore pattern `src/{a,b}.js` ignores file `src/{a,b}.js`.
	 * But, the same minimatch pattern `src/{a,b}.js` ignores files `src/a.js` and `src/b.js`.
	 * Minimatch pattern `src/\{a,b}.js` is equivalent to gitignore pattern `src/{a,b}.js`.
	 */
	const escapedPatternWithoutLeadingSlash =
		patternWithoutLeadingSlash.replaceAll(
			// eslint-disable-next-line regexp/no-empty-lookarounds-assertion -- False positive
			/(?=((?:\\.|[^{(])*))\1([{(])/guy,
			"$1\\$2",
		);

	const matchInsideSuffix = patternToTest.endsWith("/**") ? "/*" : "";

	return `${negatedPrefix}${matchEverywherePrefix}${escapedPatternWithoutLeadingSlash}${matchInsideSuffix}`;
}

/**
 * @param {string} ignoreFilePath
 * @returns {string[]}
 */
function ignoreFilePathToPatterns(ignoreFilePath) {
	const ignoreFile = fs.readFileSync(ignoreFilePath, "utf8");
	const lines = ignoreFile.split(/\r?\n/u);

	return lines
		.map(line => line.trim())
		.filter(line => line && !line.startsWith("#"))
		.map(convertIgnorePatternToMinimatch);
}

/**
 * Helper to parse and validate the options to `includeIgnoreFile()`
 *
 * @param {string | { gitignoreResolution?: unknown, name?: unknown } | undefined} options
 * @returns {{ gitignoreResolution: boolean, name: string }}
 */
function parseOptions(options) {
	// legacy compatibility with @eslint/compat's `includeIgnoreFile`
	if (typeof options === "string") {
		return { gitignoreResolution: false, name: options };
	}

	const optionsObject = options ?? {};
	if (typeof optionsObject !== "object" || Array.isArray(optionsObject)) {
		throw new TypeError(
			"The options argument to `includeIgnoreFile()` should be an object or a string.",
		);
	}

	const gitignoreResolution = optionsObject.gitignoreResolution ?? false;
	if (typeof gitignoreResolution !== "boolean") {
		throw new TypeError(
			"The `gitignoreResolution` option must be specified a boolean or omitted",
		);
	}

	const name = optionsObject.name ?? `Imported .gitignore patterns`;
	if (typeof name !== "string") {
		throw new TypeError(
			"The `name` option must be specified as a string or omitted.",
		);
	}

	return { gitignoreResolution, name };
}

/**
 * @overload
 *
 * Reads ignore files and returns objects with the ignore patterns.
 *
 * @param {string[]} ignoreFilePathArg The paths of ignore files to include.
 * @param {IncludeIgnoreFileOptions} [options]
 * @returns {ConfigObject[]}
 */

/**
 * @overload
 *
 * Reads an ignore file and returns an object with the ignore patterns.
 *
 * @param {string} ignoreFilePathArg The path of the ignore file to include.
 * @param {IncludeIgnoreFileOptions} [options]
 * @returns {ConfigObject}
 */

/**
 * @overload
 *
 * Reads an ignore file(s) and returns an object(s) with the ignore patterns.
 *
 * @param {string[] | string} ignoreFilePathArg The path(s) of the ignore file(s) to include.
 * @param {IncludeIgnoreFileOptions} [options]
 * @returns {ConfigObject[] | ConfigObject}
 */

/**
 * Reads an ignore file(s) and returns an object(s) with the ignore patterns.
 *
 * @param {string[] | string} ignoreFilePathArg The path(s) of the ignore file(s) to include.
 * @param {IncludeIgnoreFileOptions} [options]
 * @returns {ConfigObject[] | ConfigObject}
 */
function includeIgnoreFile(ignoreFilePathArg, options) {
	const returnSingleObject = !Array.isArray(ignoreFilePathArg);
	const ignoreFilePaths = Array.isArray(ignoreFilePathArg)
		? ignoreFilePathArg
		: [ignoreFilePathArg];
	for (const ignorePath of ignoreFilePaths) {
		if (typeof ignorePath !== "string") {
			throw new TypeError(
				"The first argument to `includeIgnoreFile()` should be a string or array of strings",
			);
		}
		if (!path.isAbsolute(ignorePath)) {
			throw new Error(
				`The ignore file location must be an absolute path. Received ${ignorePath}`,
			);
		}
	}

	const { gitignoreResolution, name } = parseOptions(options);

	if (returnSingleObject) {
		return {
			name,
			ignores: ignoreFilePathToPatterns(ignoreFilePathArg),
			...(gitignoreResolution
				? { basePath: path.dirname(ignoreFilePathArg) }
				: {}),
		};
	}

	return ignoreFilePaths.map((ignoreFilePath, i) => ({
		name: `${name} (${i})`,
		ignores: ignoreFilePathToPatterns(ignoreFilePath),
		...(gitignoreResolution
			? { basePath: path.dirname(ignoreFilePath) }
			: {}),
	}));
}

export { convertIgnorePatternToMinimatch, defineConfig, globalIgnores, includeIgnoreFile };
)a-Bx'/**
 * @fileoverview Types for this package.
 */
import type { ConfigObject } from "@eslint/core";
/** @deprecated Use `ConfigObject` instead. */
export type Config = ConfigObject;
/**
 * Infinite array type.
 */
export type InfiniteArray<T> = T | InfiniteArray<T>[];
/**
 * A config object that may appear inside of `extends`.
 * `basePath` and nested `extends` are not allowed on extension config objects.
 */
export type ExtensionConfigObject = Omit<ConfigObject, "basePath"> & {
    extends?: never;
};
/**
 * The type of array element in the `extends` property after flattening.
 */
export type SimpleExtendsElement = string | ExtensionConfigObject;
/**
 * The type of array element in the `extends` property before flattening.
 */
export type ExtendsElement = SimpleExtendsElement | InfiniteArray<ExtensionConfigObject>;
/**
 * Config with extends. Valid only inside of `defineConfig()`.
 */
export interface ConfigWithExtends extends ConfigObject {
    extends?: ExtendsElement[];
}
export type ConfigWithExtendsArray = InfiniteArray<ConfigWithExtends>[];
o޶qx{
  "name": "@eslint/config-helpers",
  "version": "0.7.0",
  "description": "Helper utilities for creating ESLint configuration",
  "type": "module",
  "main": "dist/esm/index.js",
  "types": "dist/esm/index.d.ts",
  "exports": {
    "require": {
      "types": "./dist/cjs/index.d.cts",
      "default": "./dist/cjs/index.cjs"
    },
    "import": {
      "types": "./dist/esm/index.d.ts",
      "default": "./dist/esm/index.js"
    }
  },
  "files": [
    "dist"
  ],
  "publishConfig": {
    "access": "public"
  },
  "directories": {
    "test": "tests"
  },
  "scripts": {
    "build:dedupe-types": "node ../../tools/dedupe-types.js dist/cjs/index.cjs dist/esm/index.js",
    "build:cts": "node ../../tools/build-cts.js dist/esm/index.d.ts dist/cjs/index.d.cts",
    "build": "rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json && npm run build:cts",
    "lint:types": "attw --pack",
    "pretest": "npm run build",
    "test": "npm run test:types && npm run test:unit",
    "test:coverage": "c8 npm run test:unit",
    "test:jsr": "npx -y jsr@latest publish --dry-run",
    "test:pnpm": "cd tests/pnpm && pnpm install && pnpm exec tsc",
    "test:types": "tsc -p tests/types/tsconfig.json",
    "test:unit": "mocha \"tests/**/*.test.js\""
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/eslint/rewrite.git",
    "directory": "packages/config-helpers"
  },
  "keywords": [
    "eslint"
  ],
  "license": "Apache-2.0",
  "bugs": {
    "url": "https://github.com/eslint/rewrite/issues"
  },
  "homepage": "https://github.com/eslint/rewrite/tree/main/packages/config-helpers#readme",
  "dependencies": {
    "@eslint/core": "^1.2.1"
  },
  "devDependencies": {
    "rollup-plugin-copy": "^3.5.0"
  },
  "engines": {
    "node": "^20.19.0 || ^22.13.0 || >=24"
  }
}
(Xx p100644 LICENSE &랟+Kfݩo\d100644 README.md  5i)|K68L-E 40000 dist *OBB4K:q"100644 package.json %8+-)B'5xU# ESLint Core

## Overview

This package is the future home of the rewritten, runtime-agnostic ESLint core.

Right now, it exports the core types necessary to implement language plugins.

## License

Apache 2.0

<!-- NOTE: This section is autogenerated. Do not manually edit.-->
<!--sponsorsstart-->

## Sponsors

The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
to get your logo on our READMEs and [website](https://eslint.org/sponsors).

<h3>Platinum Sponsors</h3>
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a></p><h3>Gold Sponsors</h3>
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a></p><h3>Silver Sponsors</h3>
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/d472863/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/2d6c3b6/logo.png" alt="Liftoff" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" height="32"></a> <a href="https://www.crawljobs.com/"><img src="https://images.opencollective.com/crawljobs-poland/fa43a17/logo.png" alt="CrawlJobs" height="32"></a> <a href="#"><img src="https://images.opencollective.com/aeriusventilations-org/avatar.png" alt="aeriusventilation's Org" height="32"></a> <a href="https://depot.dev"><img src="https://images.opencollective.com/depot/39125a1/logo.png" alt="Depot" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="TestMu AI Open Source Office (Formerly LambdaTest)" height="32"></a></p>
<h3>Technology Sponsors</h3>
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
<!--sponsorsend-->
_άx< 40000 cjs |ѲQD,٘40000 esm 5FqQ7 0}x' 100644 types.d.cts grnڜmkZxnk/**
 * @fileoverview Shared types for ESLint Core.
 */
import type { JSONSchema4 } from "json-schema";
/**
 * Represents an error inside of a file.
 */
export interface FileError {
    message: string;
    line: number;
    column: number;
    endLine?: number;
    endColumn?: number;
}
/**
 * Represents a problem found in a file.
 */
export interface FileProblem {
    ruleId: string | null;
    message: string;
    loc: SourceLocation;
}
/**
 * Represents the start and end coordinates of a node inside the source.
 */
export interface SourceLocation {
    start: Position;
    end: Position;
}
/**
 * Represents the start and end coordinates of a node inside the source with an offset.
 */
export interface SourceLocationWithOffset {
    start: PositionWithOffset;
    end: PositionWithOffset;
}
/**
 * Represents a location coordinate inside the source. ESLint-style formats
 * have just `line` and `column` while others may have `offset` as well.
 */
export interface Position {
    line: number;
    column: number;
}
/**
 * Represents a location coordinate inside the source with an offset.
 */
export interface PositionWithOffset extends Position {
    offset: number;
}
/**
 * Represents a range of characters in the source.
 */
export type SourceRange = [number, number];
/**
 * What the rule is responsible for finding:
 * - `problem` means the rule has noticed a potential error.
 * - `suggestion` means the rule suggests an alternate or better approach.
 * - `layout` means the rule is looking at spacing, indentation, etc.
 */
export type RuleType = "problem" | "suggestion" | "layout";
/**
 * The type of fix the rule can provide:
 * - `code` means the rule can fix syntax.
 * - `whitespace` means the rule can fix spacing and indentation.
 */
export type RuleFixType = "code" | "whitespace";
/**
 * An object containing visitor information for a rule. Each method is either the
 * name of a node type or a selector, or is a method that will be called at specific
 * times during the traversal.
 */
export type RuleVisitor = Record<string, ((...args: any[]) => void) | undefined>;
/**
 * Rule meta information used for documentation.
 */
export interface RulesMetaDocs {
    /**
     * A short description of the rule.
     */
    description?: string | undefined;
    /**
     * The URL to the documentation for the rule.
     */
    url?: string | undefined;
    /**
     * Indicates if the rule is generally recommended for all users.
     *
     * Note - this will always be a boolean for core rules, but may be used in any way by plugins.
     */
    recommended?: unknown;
    /**
     * Indicates if the rule is frozen (no longer accepting feature requests).
     */
    frozen?: boolean | undefined;
    /**
     * The dialects of the languages that the rule is intended to lint.
     * @example
     * ["JavaScript", "TypeScript"]
     */
    dialects?: string[] | undefined;
}
/**
 * Meta information about a rule.
 */
export interface RulesMeta<MessageIds extends string = string, RuleOptions = unknown[], ExtRuleDocs = unknown> {
    /**
     * Properties that are used when documenting the rule.
     */
    docs?: (RulesMetaDocs & ExtRuleDocs) | undefined;
    /**
     * The type of rule.
     */
    type?: RuleType | undefined;
    /**
     * The schema for the rule options. Required if the rule has options.
     */
    schema?: JSONSchema4 | JSONSchema4[] | false | undefined;
    /**
     * Any default options to be recursively merged on top of any user-provided options.
     */
    defaultOptions?: RuleOptions;
    /**
     * The messages that the rule can report.
     */
    messages?: Record<MessageIds, string>;
    /**
     * Indicates whether the rule has been deprecated or provides additional metadata about the deprecation. Omit if not deprecated.
     */
    deprecated?: boolean | DeprecatedInfo | undefined;
    /**
     * @deprecated Use deprecated.replacedBy instead.
     * The name of the rule(s) this rule was replaced by, if it was deprecated.
     */
    replacedBy?: readonly string[] | undefined;
    /**
     * Indicates if the rule is fixable, and if so, what type of fix it provides.
     */
    fixable?: RuleFixType | undefined;
    /**
     * Indicates if the rule may provide suggestions.
     */
    hasSuggestions?: boolean | undefined;
    /**
     * The language the rule is intended to lint.
     * @deprecated Use `languages` instead.
     */
    language?: string;
    /**
     * The dialects of `language` that the rule is intended to lint.
     * @deprecated Use `docs.dialects` instead.
     */
    dialects?: string[];
    /**
     * Languages supported by this rule in the format `"plugin/language"`.
     * Use `"*"` for any language or `"plugin/*"` for any language from a specific plugin.
     * @example
     * ["js/js", "markdown/gfm", "json/jsonc", "css/css"]
     */
    languages?: string[] | undefined;
}
/**
 * Provides additional metadata about a deprecation.
 */
export interface DeprecatedInfo {
    /**
     * General message presented to the user, e.g. for the key rule why the rule
     * is deprecated or for info how to replace the rule.
     */
    message?: string;
    /**
     * URL to more information about this deprecation in general.
     */
    url?: string;
    /**
     * An empty array explicitly states that there is no replacement.
     */
    replacedBy?: ReplacedByInfo[];
    /**
     * The package version since when the rule is deprecated (should use full
     * semver without a leading "v").
     */
    deprecatedSince?: string;
    /**
     * The estimated version when the rule is removed (probably the next major
     * version). null means the rule is "frozen" (will be available but will not
     * be changed).
     */
    availableUntil?: string | null;
}
/**
 * Provides metadata about a replacement
 */
export interface ReplacedByInfo {
    /**
     * General message presented to the user, e.g. how to replace the rule
     */
    message?: string;
    /**
     * URL to more information about this replacement in general
     */
    url?: string;
    /**
     * Name should be "eslint" if the replacement is an ESLint core rule. Omit
     * the property if the replacement is in the same plugin.
     */
    plugin?: ExternalSpecifier;
    /**
     * Name and documentation of the replacement rule
     */
    rule?: ExternalSpecifier;
}
/**
 * Specifies the name and url of an external resource. At least one property
 * should be set.
 */
export interface ExternalSpecifier {
    /**
     * Name of the referenced plugin / rule.
     */
    name?: string;
    /**
     * URL pointing to documentation for the plugin / rule.
     */
    url?: string;
}
/**
 * Generic type for `RuleContext`.
 */
export interface RuleContextTypeOptions {
    LangOptions: LanguageOptions;
    Code: SourceCode;
    RuleOptions: unknown[];
    Node: unknown;
    MessageIds: string;
}
/**
 * Represents the context object that is passed to a rule. This object contains
 * information about the current state of the linting process and is the rule's
 * view into the outside world.
 */
export interface RuleContext<Options extends RuleContextTypeOptions = RuleContextTypeOptions> {
    /**
     * The current working directory for the session.
     */
    cwd: string;
    /**
     * The filename of the file being linted.
     */
    filename: string;
    /**
     * The physical filename of the file being linted.
     */
    physicalFilename: string;
    /**
     * The source code object that the rule is running on.
     */
    sourceCode: Options["Code"];
    /**
     * Shared settings for the configuration.
     */
    settings: SettingsConfig;
    /**
     * The language options for the configuration.
     */
    languageOptions: Options["LangOptions"];
    /**
     * The rule ID.
     */
    id: string;
    /**
     * The rule's configured options.
     */
    options: Options["RuleOptions"];
    /**
     * The report function that the rule should use to report problems.
     * @param violation The violation to report.
     */
    report(violation: ViolationReport<Options["Node"], Options["MessageIds"]>): void;
}
/**
 * Manager of text edits for a rule fix.
 */
export interface RuleTextEditor<EditableSyntaxElement = unknown> {
    /**
     * Inserts text after the specified node or token.
     * @param syntaxElement The node or token to insert after.
     * @param text The edit to insert after the node or token.
     */
    insertTextAfter(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit;
    /**
     * Inserts text after the specified range.
     * @param range The range to insert after.
     * @param text The edit to insert after the range.
     */
    insertTextAfterRange(range: SourceRange, text: string): RuleTextEdit;
    /**
     * Inserts text before the specified node or token.
     * @param syntaxElement A syntax element with location information to insert before.
     * @param text The edit to insert before the node or token.
     */
    insertTextBefore(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit;
    /**
     * Inserts text before the specified range.
     * @param range The range to insert before.
     * @param text The edit to insert before the range.
     */
    insertTextBeforeRange(range: SourceRange, text: string): RuleTextEdit;
    /**
     * Removes the specified node or token.
     * @param syntaxElement A syntax element with location information to remove.
     * @returns The edit to remove the node or token.
     */
    remove(syntaxElement: EditableSyntaxElement): RuleTextEdit;
    /**
     * Removes the specified range.
     * @param range The range to remove.
     * @returns The edit to remove the range.
     */
    removeRange(range: SourceRange): RuleTextEdit;
    /**
     * Replaces the specified node or token with the given text.
     * @param syntaxElement A syntax element with location information to replace.
     * @param text The text to replace the node or token with.
     * @returns The edit to replace the node or token.
     */
    replaceText(syntaxElement: EditableSyntaxElement, text: string): RuleTextEdit;
    /**
     * Replaces the specified range with the given text.
     * @param range The range to replace.
     * @param text The text to replace the range with.
     * @returns The edit to replace the range.
     */
    replaceTextRange(range: SourceRange, text: string): RuleTextEdit;
}
/**
 * Represents a fix for a rule violation implemented as a text edit.
 */
export interface RuleTextEdit {
    /**
     * The range to replace.
     */
    range: SourceRange;
    /**
     * The text to insert.
     */
    text: string;
}
/**
 * Fixes a violation.
 * @param fixer The text editor to apply the fix.
 * @returns The fix(es) for the violation.
 */
export type RuleFixer = (fixer: RuleTextEditor) => RuleTextEdit | Iterable<RuleTextEdit> | null;
/**
 * Data that can be used to fill placeholders in error messages.
 */
export type MessagePlaceholderData = Record<string, string | number | boolean | bigint | null | undefined>;
export interface ViolationReportBase<MessageIds extends string = string> {
    /**
     * The data to insert into the message.
     */
    data?: MessagePlaceholderData | undefined;
    /**
     * The fix to be applied for the violation.
     */
    fix?: RuleFixer | null | undefined;
    /**
     * An array of suggested fixes for the problem. These fixes may change the
     * behavior of the code, so they are not applied automatically.
     */
    suggest?: SuggestedEdit<MessageIds>[] | null | undefined;
}
export type ViolationMessage<MessageIds extends string = string> = {
    message: string;
} | {
    messageId: MessageIds;
};
export type ViolationLocation<Node> = {
    loc: SourceLocation | Position;
} | {
    node: Node;
};
export type ViolationReport<Node = unknown, MessageIds extends string = string> = ViolationReportBase<MessageIds> & ViolationMessage<MessageIds> & ViolationLocation<Node>;
export interface SuggestedEditBase {
    /**
     * The data to insert into the message.
     */
    data?: MessagePlaceholderData | undefined;
    /**
     * The fix to be applied for the suggestion.
     */
    fix: RuleFixer;
}
export type SuggestionMessage<MessageIds extends string = string> = {
    desc: string;
} | {
    messageId: MessageIds;
};
/**
 * A suggested edit for a rule violation.
 */
export type SuggestedEdit<MessageIds extends string = string> = SuggestedEditBase & SuggestionMessage<MessageIds>;
/**
 * The normalized version of a lint suggestion.
 */
export interface LintSuggestion {
    /** A short description. */
    desc: string;
    /** Fix result info. */
    fix: RuleTextEdit;
    /** Id referencing a message for the description. */
    messageId?: string | undefined;
}
/**
 * The normalized version of a lint violation message.
 */
export interface LintMessage {
    /** The 1-based column number. */
    column: number;
    /** The 1-based line number. */
    line: number;
    /** The 1-based column number of the end location. */
    endColumn?: number | undefined;
    /** The 1-based line number of the end location. */
    endLine?: number | undefined;
    /** The ID of the rule which makes this message. */
    ruleId: string | null;
    /** The reported message. */
    message: string;
    /** The ID of the message in the rule's meta. */
    messageId?: string | undefined;
    /** If `true` then this is a fatal error. */
    fatal?: true | undefined;
    /** The severity of this message. */
    severity: Exclude<SeverityLevel, 0>;
    /** Information for autofix. */
    fix?: RuleTextEdit | undefined;
    /** Information for suggestions. */
    suggestions?: LintSuggestion[] | undefined;
}
/**
 * Generic options for the `RuleDefinition` type.
 */
export interface RuleDefinitionTypeOptions {
    LangOptions: LanguageOptions;
    Code: SourceCode;
    RuleOptions: unknown[];
    Visitor: RuleVisitor;
    Node: unknown;
    MessageIds: string;
    ExtRuleDocs: unknown;
}
/**
 * The definition of an ESLint rule.
 */
export interface RuleDefinition<Options extends RuleDefinitionTypeOptions = RuleDefinitionTypeOptions> {
    /**
     * The meta information for the rule.
     */
    meta?: RulesMeta<Options["MessageIds"], Options["RuleOptions"], Options["ExtRuleDocs"]>;
    /**
     * Creates the visitor that ESLint uses to apply the rule during traversal.
     * @param context The rule context.
     * @returns The rule visitor.
     */
    create(context: RuleContext<{
        LangOptions: Options["LangOptions"];
        Code: Options["Code"];
        RuleOptions: Options["RuleOptions"];
        Node: Options["Node"];
        MessageIds: Options["MessageIds"];
    }>): Options["Visitor"];
}
/**
 * Defaults for non-language-related `RuleDefinition` options.
 * @deprecated Use the same type from `@eslint/plugin-kit` instead.
 */
export interface CustomRuleTypeDefinitions {
    RuleOptions: unknown[];
    MessageIds: string;
    ExtRuleDocs: Record<string, unknown>;
}
/**
 * A helper type to define language specific specializations of the `RuleDefinition` type.
 * @deprecated Use the same type from `@eslint/plugin-kit` instead.
 *
 * @example
 * ```ts
 * type YourRuleDefinition<
 * 	Options extends Partial<CustomRuleTypeDefinitions> = {},
 * > = CustomRuleDefinitionType<
 * 	{
 * 		LangOptions: YourLanguageOptions;
 * 		Code: YourSourceCode;
 * 		Visitor: YourRuleVisitor;
 * 		Node: YourNode;
 * 	},
 * 	Options
 * >;
 * ```
 */
export type CustomRuleDefinitionType<LanguageSpecificOptions extends Omit<RuleDefinitionTypeOptions, keyof CustomRuleTypeDefinitions>, Options extends Partial<CustomRuleTypeDefinitions>> = RuleDefinition<LanguageSpecificOptions & Required<Options & Omit<CustomRuleTypeDefinitions, keyof Options>>>;
/**
 * The human readable severity level used in a configuration.
 */
export type SeverityName = "off" | "warn" | "error";
/**
 * The numeric severity level for a rule.
 *
 * - `0` means off.
 * - `1` means warn.
 * - `2` means error.
 */
export type SeverityLevel = 0 | 1 | 2;
/**
 * The severity of a rule in a configuration.
 */
export type Severity = SeverityName | SeverityLevel;
/**
 * Represents the metadata for an object, such as a plugin or processor.
 */
export interface ObjectMetaProperties {
    /** @deprecated Use `meta.name` instead. */
    name?: string | undefined;
    /** @deprecated Use `meta.version` instead. */
    version?: string | undefined;
    meta?: {
        name?: string | undefined;
        version?: string | undefined;
    };
}
/**
 * Represents the configuration options for the core linter.
 */
export interface LinterOptionsConfig {
    /**
     * Indicates whether or not inline configuration is evaluated.
     */
    noInlineConfig?: boolean;
    /**
     * Indicates what to do when an unused disable directive is found.
     */
    reportUnusedDisableDirectives?: boolean | Severity;
    /**
     * A severity value indicating if and how unused inline configs should be
     * tracked and reported.
     */
    reportUnusedInlineConfigs?: Severity;
}
/**
 * The configuration for a rule.
 */
export type RuleConfig<RuleOptions extends unknown[] = unknown[]> = Severity | [Severity, ...Partial<RuleOptions>];
/**
 * A collection of rules and their configurations.
 */
export interface RulesConfig {
    [key: string]: RuleConfig;
}
/**
 * A collection of settings.
 */
export interface SettingsConfig {
    [key: string]: unknown;
}
/**
 * The configuration for a set of files.
 */
export interface ConfigObject<Rules extends RulesConfig = RulesConfig> {
    /**
     * A string to identify the configuration object. Used in error messages and
     * inspection tools.
     */
    name?: string;
    /**
     * Path to the directory where the configuration object should apply.
     * `files` and `ignores` patterns in the configuration object are
     * interpreted as relative to this path.
     */
    basePath?: string;
    /**
     * An array of glob patterns indicating the files that the configuration
     * object should apply to. If not specified, the configuration object applies
     * to all files
     */
    files?: (string | string[])[];
    /**
     * An array of glob patterns indicating the files that the configuration
     * object should not apply to. If not specified, the configuration object
     * applies to all files matched by files
     */
    ignores?: string[];
    /**
     * The name of the language used for linting. This is used to determine the
     * parser and other language-specific settings.
     * @since 9.7.0
     */
    language?: string;
    /**
     * An object containing settings related to how the language is configured for
     * linting.
     */
    languageOptions?: LanguageOptions;
    /**
     * An object containing settings related to the linting process
     */
    linterOptions?: LinterOptionsConfig;
    /**
     * Either an object containing preprocess() and postprocess() methods or a
     * string indicating the name of a processor inside of a plugin
     * (i.e., "pluginName/processorName").
     */
    processor?: string | Processor;
    /**
     * An object containing a name-value mapping of plugin names to plugin objects.
     * When files is specified, these plugins are only available to the matching files.
     */
    plugins?: Record<string, Plugin>;
    /**
     * An object containing the configured rules. When files or ignores are specified,
     * these rule configurations are only available to the matching files.
     */
    rules?: Partial<Rules>;
    /**
     * An object containing name-value pairs of information that should be
     * available to all rules.
     */
    settings?: SettingsConfig;
}
/** @deprecated Only supported in legacy eslintrc config format. */
export type GlobalAccess = boolean | "off" | "readable" | "readonly" | "writable" | "writeable";
/** @deprecated Only supported in legacy eslintrc config format. */
export interface GlobalsConfig {
    [name: string]: GlobalAccess;
}
/**
 * The ECMAScript version of the code being linted.
 * @deprecated Only supported in legacy eslintrc config format.
 */
export type EcmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | 2026 | "latest";
/**
 * The type of JavaScript source code.
 * @deprecated Only supported in legacy eslintrc config format.
 */
export type JavaScriptSourceType = "script" | "module" | "commonjs";
/**
 * Parser options.
 * @deprecated Only supported in legacy eslintrc config format.
 * @see [Specifying Parser Options](https://eslint.org/docs/latest/use/configure/language-options#specifying-parser-options)
 */
export interface JavaScriptParserOptionsConfig {
    /**
     * Allow the use of reserved words as identifiers (if `ecmaVersion` is 3).
     *
     * @default false
     */
    allowReserved?: boolean | undefined;
    /**
     * Accepts any valid ECMAScript version number or `'latest'`:
     *
     * - A version: es3, es5, es6, es7, es8, es9, es10, es11, es12, es13, es14, ..., or
     * - A year: es2015, es2016, es2017, es2018, es2019, es2020, es2021, es2022, es2023, ..., or
     * - `'latest'`
     *
     * When it's a version or a year, the value must be a number - so do not include the `es` prefix.
     *
     * Specifies the version of ECMAScript syntax you want to use. This is used by the parser to determine how to perform scope analysis, and it affects the default
     *
     * @default 5
     */
    ecmaVersion?: EcmaVersion | undefined;
    /**
     * The type of JavaScript source code. Possible values are "script" for
     * traditional script files, "module" for ECMAScript modules (ESM), and
     * "commonjs" for CommonJS files.
     *
     * @default 'script'
     *
     * @see https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options
     */
    sourceType?: JavaScriptSourceType | undefined;
    /**
     * An object indicating which additional language features you'd like to use.
     *
     * @see https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options
     */
    ecmaFeatures?: {
        globalReturn?: boolean | undefined;
        impliedStrict?: boolean | undefined;
        jsx?: boolean | undefined;
        [key: string]: any;
    } | undefined;
    [key: string]: any;
}
/** @deprecated Only supported in legacy eslintrc config format. */
export interface EnvironmentConfig {
    /** The definition of global variables. */
    globals?: GlobalsConfig | undefined;
    /** The parser options that will be enabled under this environment. */
    parserOptions?: JavaScriptParserOptionsConfig | undefined;
}
/**
 * A configuration object that may have a `rules` block.
 */
export interface HasRules<Rules extends RulesConfig = RulesConfig> {
    rules?: Partial<Rules> | undefined;
}
/**
 * ESLint legacy configuration.
 *
 * @see [ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/)
 */
export interface BaseConfig<Rules extends RulesConfig = RulesConfig, OverrideRules extends RulesConfig = Rules> extends HasRules<Rules> {
    $schema?: string | undefined;
    /**
     * An environment provides predefined global variables.
     *
     * @see [Environments](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-environments)
     */
    env?: {
        [name: string]: boolean;
    } | undefined;
    /**
     * Extending configuration files.
     *
     * @see [Extends](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#extending-configuration-files)
     */
    extends?: string | string[] | undefined;
    /**
     * Specifying globals.
     *
     * @see [Globals](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-globals)
     */
    globals?: GlobalsConfig | undefined;
    /**
     * Disable processing of inline comments.
     *
     * @see [Disabling Inline Comments](https://eslint.org/docs/latest/use/configure/rules-deprecated#disabling-inline-comments)
     */
    noInlineConfig?: boolean | undefined;
    /**
     * Overrides can be used to use a differing configuration for matching sub-directories and files.
     *
     * @see [How do overrides work](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#how-do-overrides-work)
     */
    overrides?: ConfigOverride<OverrideRules>[] | undefined;
    /**
     * Parser.
     *
     * @see [Working with Custom Parsers](https://eslint.org/docs/latest/extend/custom-parsers)
     * @see [Specifying Parser](https://eslint.org/docs/latest/use/configure/parser-deprecated)
     */
    parser?: string | undefined;
    /**
     * Parser options.
     *
     * @see [Working with Custom Parsers](https://eslint.org/docs/latest/extend/custom-parsers)
     * @see [Specifying Parser Options](https://eslint.org/docs/latest/use/configure/language-options-deprecated#specifying-parser-options)
     */
    parserOptions?: JavaScriptParserOptionsConfig | undefined;
    /**
     * Which third-party plugins define additional rules, environments, configs, etc. for ESLint to use.
     *
     * @see [Configuring Plugins](https://eslint.org/docs/latest/use/configure/plugins-deprecated#configure-plugins)
     */
    plugins?: string[] | undefined;
    /**
     * Specifying processor.
     *
     * @see [processor](https://eslint.org/docs/latest/use/configure/plugins-deprecated#specify-a-processor)
     */
    processor?: string | undefined;
    /**
     * Report unused eslint-disable comments as warning.
     *
     * @see [Report unused eslint-disable comments](https://eslint.org/docs/latest/use/configure/rules-deprecated#report-unused-eslint-disable-comments)
     */
    reportUnusedDisableDirectives?: boolean | undefined;
    /**
     * Settings.
     *
     * @see [Settings](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#adding-shared-settings)
     */
    settings?: SettingsConfig | undefined;
}
/**
 * The overwrites that apply more differing configuration to specific files or directories.
 */
export interface ConfigOverride<Rules extends RulesConfig = RulesConfig> extends BaseConfig<Rules> {
    /**
     * The glob patterns for excluded files.
     */
    excludedFiles?: string | string[] | undefined;
    /**
     * The glob patterns for target files.
     */
    files: string | string[];
}
/**
 * ESLint legacy configuration.
 *
 * @see [ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/)
 */
export interface LegacyConfigObject<Rules extends RulesConfig = RulesConfig, OverrideRules extends RulesConfig = Rules> extends BaseConfig<Rules, OverrideRules> {
    /**
     * Tell ESLint to ignore specific files and directories.
     *
     * @see [Ignore Patterns](https://eslint.org/docs/latest/use/configure/ignore-deprecated#ignorepatterns-in-config-files)
     */
    ignorePatterns?: string | string[] | undefined;
    /**
     * @see [Using Configuration Files](https://eslint.org/docs/latest/use/configure/configuration-files-deprecated#using-configuration-files)
     */
    root?: boolean | undefined;
}
/**
 * File information passed to a processor.
 */
export interface ProcessorFile {
    text: string;
    filename: string;
}
/**
 * A processor is an object that can preprocess and postprocess files.
 */
export interface Processor<T extends string | ProcessorFile = string | ProcessorFile> extends ObjectMetaProperties {
    /** If `true` then it means the processor supports autofix. */
    supportsAutofix?: boolean | undefined;
    /** The function to extract code blocks. */
    preprocess?(text: string, filename: string): T[];
    /** The function to merge messages. */
    postprocess?(messages: LintMessage[][], filename: string): LintMessage[];
}
export interface Plugin extends ObjectMetaProperties {
    meta?: ObjectMetaProperties["meta"] & {
        namespace?: string | undefined;
    };
    configs?: Record<string, LegacyConfigObject | ConfigObject | ConfigObject[]> | undefined;
    environments?: Record<string, EnvironmentConfig> | undefined;
    languages?: Record<string, Language> | undefined;
    processors?: Record<string, Processor> | undefined;
    rules?: Record<string, RuleDefinition> | undefined;
}
/**
 * Generic options for the `Language` type.
 */
export interface LanguageTypeOptions {
    LangOptions: LanguageOptions;
    Code: SourceCode;
    RootNode: unknown;
    Node: unknown;
}
/**
 * Represents a plugin language.
 */
export interface Language<Options extends LanguageTypeOptions = {
    LangOptions: LanguageOptions;
    Code: SourceCode;
    RootNode: unknown;
    Node: unknown;
}> {
    /**
     * Indicates how ESLint should read the file.
     */
    fileType: "text";
    /**
     * First line number returned from the parser (text mode only).
     */
    lineStart: 0 | 1;
    /**
     * First column number returned from the parser (text mode only).
     */
    columnStart: 0 | 1;
    /**
     * The property to read the node type from. Used in selector querying.
     */
    nodeTypeKey: string;
    /**
     * The traversal path that tools should take when evaluating the AST
     */
    visitorKeys?: Record<string, string[]>;
    /**
     * Default language options. User-defined options are merged with this object.
     */
    defaultLanguageOptions?: Options["LangOptions"];
    /**
     * Validates languageOptions for this language.
     */
    validateLanguageOptions(languageOptions: Options["LangOptions"]): void;
    /**
     * Normalizes languageOptions for this language.
     */
    normalizeLanguageOptions?(languageOptions: Options["LangOptions"]): Options["LangOptions"];
    /**
     * Helper for esquery that allows languages to match nodes against
     * class. esquery currently has classes like `function` that will
     * match all the various function nodes. This method allows languages
     * to implement similar shorthands.
     */
    matchesSelectorClass?(className: string, node: Options["Node"], ancestry: Options["Node"][]): boolean;
    /**
     * Parses the given file input into its component parts. This file should not
     * throws errors for parsing errors but rather should return any parsing
     * errors as parse of the ParseResult object.
     */
    parse(file: File, context: LanguageContext<Options["LangOptions"]>): ParseResult<Options["RootNode"]>;
    /**
     * Creates SourceCode object that ESLint uses to work with a file.
     */
    createSourceCode(file: File, input: OkParseResult<Options["RootNode"]>, context: LanguageContext<Options["LangOptions"]>): Options["Code"];
}
/**
 * Plugin-defined options for the language.
 */
export type LanguageOptions = Record<string, unknown>;
/**
 * The context object that is passed to the language plugin methods.
 */
export interface LanguageContext<LangOptions = LanguageOptions> {
    languageOptions: LangOptions;
}
/**
 * Represents a file read by ESLint.
 */
export interface File {
    /**
     * The path that ESLint uses for this file. May be a virtual path
     * if it was returned by a processor.
     */
    path: string;
    /**
     * The path to the file on disk. This always maps directly to a file
     * regardless of whether it was returned from a processor.
     */
    physicalPath: string;
    /**
     * Indicates if the original source contained a byte-order marker.
     * ESLint strips the BOM from the `body`, but this info is needed
     * to correctly apply autofixing.
     */
    bom: boolean;
    /**
     * The body of the file to parse.
     */
    body: string | Uint8Array;
}
/**
 * Represents the successful result of parsing a file.
 */
export interface OkParseResult<RootNode = unknown> {
    /**
     * Indicates if the parse was successful. If true, the parse was successful
     * and ESLint should continue on to create a SourceCode object and run rules;
     * if false, ESLint should just report the error(s) without doing anything
     * else.
     */
    ok: true;
    /**
     * The abstract syntax tree created by the parser. (only when ok: true)
     */
    ast: RootNode;
    /**
     * Any additional data that the parser wants to provide.
     */
    [key: string]: any;
}
/**
 * Represents the unsuccessful result of parsing a file.
 */
export interface NotOkParseResult {
    /**
     * Indicates if the parse was successful. If true, the parse was successful
     * and ESLint should continue on to create a SourceCode object and run rules;
     * if false, ESLint should just report the error(s) without doing anything
     * else.
     */
    ok: false;
    /**
     * Any parsing errors, whether fatal or not. (only when ok: false)
     */
    errors: FileError[];
    /**
     * Any additional data that the parser wants to provide.
     */
    [key: string]: any;
}
export type ParseResult<RootNode = unknown> = OkParseResult<RootNode> | NotOkParseResult;
/**
 * Represents inline configuration found in the source code.
 */
interface InlineConfigElement {
    /**
     * The location of the inline config element.
     */
    loc: SourceLocation;
    /**
     * The interpreted configuration from the inline config element.
     */
    config: {
        rules: RulesConfig;
    };
}
/**
 * Generic options for the `SourceCodeBase` type.
 */
export interface SourceCodeBaseTypeOptions {
    LangOptions: LanguageOptions;
    RootNode: unknown;
    SyntaxElementWithLoc: unknown;
    ConfigNode: unknown;
}
/**
 * Represents the basic interface for a source code object.
 */
interface SourceCodeBase<Options extends SourceCodeBaseTypeOptions = {
    LangOptions: LanguageOptions;
    RootNode: unknown;
    SyntaxElementWithLoc: unknown;
    ConfigNode: unknown;
}> {
    /**
     * Root of the AST.
     */
    ast: Options["RootNode"];
    /**
     * The traversal path that tools should take when evaluating the AST.
     * When present, this overrides the `visitorKeys` on the language for
     * just this source code object.
     */
    visitorKeys?: Record<string, string[]>;
    /**
     * Retrieves the equivalent of `loc` for a given node or token.
     * @param syntaxElement The node or token to get the location for.
     * @returns The location of the node or token.
     */
    getLoc(syntaxElement: Options["SyntaxElementWithLoc"]): SourceLocation;
    /**
     * Retrieves the equivalent of `range` for a given node or token.
     * @param syntaxElement The node or token to get the range for.
     * @returns The range of the node or token.
     */
    getRange(syntaxElement: Options["SyntaxElementWithLoc"]): SourceRange;
    /**
     * Traversal of AST.
     */
    traverse(): Iterable<TraversalStep>;
    /**
     * Applies language options passed in from the ESLint core.
     */
    applyLanguageOptions?(languageOptions: Options["LangOptions"]): void;
    /**
     * Return all of the inline areas where ESLint should be disabled/enabled
     * along with any problems found in evaluating the directives.
     */
    getDisableDirectives?(): {
        directives: Directive[];
        problems: FileProblem[];
    };
    /**
     * Returns an array of all inline configuration nodes found in the
     * source code.
     */
    getInlineConfigNodes?(): Options["ConfigNode"][];
    /**
     * Applies configuration found inside of the source code. This method is only
     * called when ESLint is running with inline configuration allowed.
     */
    applyInlineConfig?(): {
        configs: InlineConfigElement[];
        problems: FileProblem[];
    };
    /**
     * Called by ESLint core to indicate that it has finished providing
     * information. We now add in all the missing variables and ensure that
     * state-changing methods cannot be called by rules.
     * @returns {void}
     */
    finalize?(): void;
}
/**
 * Represents the source of a text file being linted.
 */
export interface TextSourceCode<Options extends SourceCodeBaseTypeOptions = {
    LangOptions: LanguageOptions;
    RootNode: unknown;
    SyntaxElementWithLoc: unknown;
    ConfigNode: unknown;
}> extends SourceCodeBase<Options> {
    /**
     * The body of the file that you'd like rule developers to access.
     */
    text: string;
}
/**
 * Represents the source of a binary file being linted.
 */
export interface BinarySourceCode<Options extends SourceCodeBaseTypeOptions = {
    LangOptions: LanguageOptions;
    RootNode: unknown;
    SyntaxElementWithLoc: unknown;
    ConfigNode: unknown;
}> extends SourceCodeBase<Options> {
    /**
     * The body of the file that you'd like rule developers to access.
     */
    body: Uint8Array;
}
export type SourceCode<Options extends SourceCodeBaseTypeOptions = {
    LangOptions: LanguageOptions;
    RootNode: unknown;
    SyntaxElementWithLoc: unknown;
    ConfigNode: unknown;
}> = TextSourceCode<Options> | BinarySourceCode<Options>;
/**
 * Represents a traversal step visiting the AST.
 */
export interface VisitTraversalStep {
    kind: 1;
    target: unknown;
    phase: 1 | 2;
    args: unknown[];
}
/**
 * Represents a traversal step calling a function.
 */
export interface CallTraversalStep {
    kind: 2;
    target: string;
    phase?: string;
    args: unknown[];
}
export type TraversalStep = VisitTraversalStep | CallTraversalStep;
/**
 * The type of disable directive. This determines how ESLint will disable rules.
 */
export type DirectiveType = "disable" | "enable" | "disable-line" | "disable-next-line";
/**
 * Represents a disable directive.
 */
export interface Directive {
    /**
     * The type of directive.
     */
    type: DirectiveType;
    /**
     * The node of the directive. May be in the AST or a comment/token.
     */
    node: unknown;
    /**
     * The value of the directive.
     */
    value: string;
    /**
     * The justification for the directive.
     */
    justification?: string;
}
export {};
[95?x& 100644 types.d.ts grnڜmkNPx{
  "name": "@eslint/core",
  "version": "1.2.1",
  "description": "Runtime-agnostic core of ESLint",
  "type": "module",
  "types": "./dist/esm/types.d.ts",
  "exports": {
    "types": {
      "import": "./dist/esm/types.d.ts",
      "require": "./dist/cjs/types.d.cts"
    }
  },
  "files": [
    "dist"
  ],
  "publishConfig": {
    "access": "public"
  },
  "scripts": {
    "build:cts": "node -e \"fs.cpSync('dist/esm/types.d.ts', 'dist/cjs/types.d.cts')\"",
    "build": "tsc && npm run build:cts",
    "lint:types": "attw --pack",
    "pretest": "npm run build",
    "test": "npm run test:types",
    "test:jsr": "npx -y jsr@latest publish --dry-run",
    "test:types": "tsc -p tests/types/tsconfig.json"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/eslint/rewrite.git",
    "directory": "packages/core"
  },
  "keywords": [
    "eslint",
    "core"
  ],
  "author": "Nicholas C. Zakas",
  "license": "Apache-2.0",
  "bugs": {
    "url": "https://github.com/eslint/rewrite/issues"
  },
  "homepage": "https://github.com/eslint/rewrite/tree/main/packages/core#readme",
  "dependencies": {
    "@types/json-schema": "^7.0.15"
  },
  "devDependencies": {
    "json-schema": "^0.4.0"
  },
  "engines": {
    "node": "^20.19.0 || ^22.13.0 || >=24"
  }
}
Q}Wx 100644 LICENSE Jbݮ@U6B?КN_100644 README.md &n`NSDVy40000 cjs R5faٌ"^40000 data +eG0'6{7<n?40000 dist )}'9$TJ40000 lib ٗ>%*l	̔100644 package.json H~ޖ86#uHW]YFxoCopyright (C) 2016-2026 by Roman Dvornov
Copyright OpenJS Foundation and other contributors, <www.openjsf.org>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
lѵx+<img align="right" width="111" height="111" alt="CSSTree logo" src="assets/csstree-logo-rounded.svg" />

# CSSTree (ESLint Fork)

CSSTree is a tool set for CSS: [fast](https://github.com/postcss/benchmark) detailed parser (CSS → AST), walker (AST traversal), generator (AST → CSS) and lexer (validation and matching) based on specs and browser implementations. The main goal is to be efficient and W3C spec compliant, with focus on CSS analyzing and source-to-source transforming tasks.

## Features

- **Detailed parsing with an adjustable level of detail**

  By default CSSTree parses CSS as detailed as possible, i.e. each single logical part is representing with its own AST node (see [AST format](docs/ast.md) for all possible node types). The parsing detail level can be changed through [parser options](docs/parsing.md#parsesource-options), for example, you can disable parsing of selectors or declaration values for component parts.

- **Tolerant to errors by design**

  Parser behaves as [spec says](https://www.w3.org/TR/css-syntax-3/#error-handling): "When errors occur in CSS, the parser attempts to recover gracefully, throwing away only the minimum amount of content before returning to parsing as normal". The only thing the parser departs from the specification is that it doesn't throw away bad content, but wraps it in a special node type (`Raw`) that allows processing it later.

- **Fast and efficient**

  CSSTree is created with focus on performance and effective memory consumption. Therefore it's [one of the fastest CSS parsers](https://github.com/postcss/benchmark) at the moment.

- **Syntax validation**

  The built-in lexer can test CSS against syntaxes defined by W3C. CSSTree uses [mdn/data](https://github.com/mdn/data/) as a basis for lexer's dictionaries and extends it with vendor specific and legacy syntaxes. Lexer can only check the declaration values and at-rules currently, but this feature will be extended to other parts of the CSS in the future.

## Projects using CSSTree

- [Svelte](https://github.com/sveltejs/svelte) – Cybernetically enhanced web apps
- [SVGO](https://github.com/svg/svgo) – Node.js tool for optimizing SVG files
- [CSSO](https://github.com/css/csso) – CSS minifier with structural optimizations
- [NativeScript](https://github.com/NativeScript/NativeScript) – NativeScript empowers you to access native APIs from JavaScript directly
- [react-native-svg](https://github.com/react-native-svg/react-native-svg) – SVG library for React Native, React Native Web, and plain React web projects
- [penthouse](https://github.com/pocketjoso/penthouse) – Critical Path CSS Generator
- [Bit](https://github.com/teambit/bit) – Bit is the platform for collaborating on components
- and more...

## Documentation

- [AST format](docs/ast.md)
- [Parsing CSS → AST](docs/parsing.md)
  - [parse(source[, options])](docs/parsing.md#parsesource-options)
- [Serialization AST → CSS](docs/generate.md)
  - [generate(ast[, options])](docs/generate.md#generateast-options)
- [AST traversal](docs/traversal.md)
  - [walk(ast, options)](docs/traversal.md#walkast-options)
  - [find(ast, fn)](docs/traversal.md#findast-fn)
  - [findLast(ast, fn)](docs/traversal.md#findlastast-fn)
  - [findAll(ast, fn)](docs/traversal.md#findallast-fn)
- [Util functions](docs/utils.md)
  - Value encoding & decoding
    - [property(name)](docs/utils.md#propertyname)
    - [keyword(name)](docs/utils.md#keywordname)
    - [ident](docs/utils.md#ident)
    - [string](docs/utils.md#string)
    - [url](docs/utils.md#url)
  - [List class](docs/list.md)
  - AST transforming
    - [clone(ast)](docs/utils.md#cloneast)
    - [fromPlainObject(object)](docs/utils.md#fromplainobjectobject)
    - [toPlainObject(ast)](docs/utils.md#toplainobjectast)
- [Value Definition Syntax](docs/definition-syntax.md)
  - [parse(source)](docs/definition-syntax.md#parsesource)
  - [walk(node, options, context)](docs/definition-syntax.md#walknode-options-context)
  - [generate(node, options)](docs/definition-syntax.md#generatenode-options)
  - [AST format](docs/definition-syntax.md#ast-format)

## Tools

* [AST Explorer](https://astexplorer.net/#/gist/244e2fb4da940df52bf0f4b94277db44/e79aff44611020b22cfd9708f3a99ce09b7d67a8) – explore CSSTree AST format with zero setup
* [CSS syntax reference](https://csstree.github.io/docs/syntax.html)
* [CSS syntax validator](https://csstree.github.io/docs/validator.html)

## Related projects

* [csstree-validator](https://github.com/csstree/validator) – NPM package to validate CSS
* [stylelint-csstree-validator](https://github.com/csstree/stylelint-validator) – plugin for stylelint to validate CSS
* [Grunt plugin](https://github.com/sergejmueller/grunt-csstree-validator)
* [Gulp plugin](https://github.com/csstree/gulp-csstree)
* [Sublime plugin](https://github.com/csstree/SublimeLinter-contrib-csstree)
* [VS Code plugin](https://github.com/csstree/vscode-plugin)
* [Atom plugin](https://github.com/csstree/atom-plugin)

## Usage

Install with npm:

```
npm install @eslint/css-tree
```

Basic usage:

```js
import * as csstree from '@eslint/css-tree';

// parse CSS to AST
const ast = csstree.parse('.example { world: "!" }');

// traverse AST and modify it
csstree.walk(ast, (node) => {
    if (node.type === 'ClassSelector' && node.name === 'example') {
        node.name = 'hello';
    }
});

// generate CSS from AST
console.log(csstree.generate(ast));
// .hello{world:"!"}
```

Syntax matching:

```js
// parse CSS to AST as a declaration value
const ast = csstree.parse('red 1px solid', { context: 'value' });

// match to syntax of `border` property
const matchResult = csstree.lexer.matchProperty('border', ast);

// check first value node is a <color>
console.log(matchResult.isType(ast.children.first, 'color'));
// true

// get a type list matched to a node
console.log(matchResult.getTrace(ast.children.first));
// [ { type: 'Property', name: 'border' },
//   { type: 'Type', name: 'color' },
//   { type: 'Type', name: 'named-color' },
//   { type: 'Keyword', name: 'red' } ]
```

### Exports

Is it possible to import just a needed part of library like a parser or a walker. That's might useful for loading time or bundle size optimisations.

```js
import * as tokenizer from '@eslint/css-tree/tokenizer';
import * as parser from '@eslint/css-tree/parser';
import * as walker from '@eslint/css-tree/walker';
import * as lexer from '@eslint/css-tree/lexer';
import * as definitionSyntax from '@eslint/css-tree/definition-syntax';
import * as data from '@eslint/css-tree/definition-syntax-data';
import * as dataPatch from '@eslint/css-tree/definition-syntax-data-patch';
import * as utils from '@eslint/css-tree/utils';
```

### Using in a browser

Bundles are available for use in a browser:

- `dist/csstree.js` – minified IIFE with `csstree` as global
```html
<script src="node_modules/@eslint/css-tree/dist/csstree.js"></script>
<script>
  csstree.parse('.example { color: green }');
</script>
```

- `dist/csstree.esm.js` – minified ES module
```html
<script type="module">
  import { parse } from 'node_modules/@eslint/css-tree/dist/csstree.esm.js'
  parse('.example { color: green }');
</script>
```

One of CDN services like `unpkg` or `jsDelivr` can be used. By default (for short path) a ESM version is exposing. For IIFE version a full path to a bundle should be specified:

```html
<!-- ESM -->
<script type="module">
  import * as csstree from 'https://cdn.jsdelivr.net/npm/@eslint/css-tree';
  import * as csstree from 'https://unpkg.com/@eslint/css-tree';
</script>

<!-- IIFE with an export to global -->
<script src="https://cdn.jsdelivr.net/npm/@eslint/css-tree/dist/csstree.js"></script>
<script src="https://unpkg.com/@eslint/css-tree/dist/csstree.js"></script>
```

## Top level API

![API map](https://cdn.rawgit.com/eslint/csstree/aaf327e/docs/api-map.svg)

## License

MIT

## Branch Setup and Development

* `main` - the default branch for new development in the fork repo
* `upstream` - kept in sync with `csstree/csstree`

When merging in changes from `csstree/csstree`, sync `upstream` in the GitHub UI (if possible). Then send a pull request to `main` to work through any merge conflicts.

<!-- NOTE: This section is autogenerated. Do not manually edit.-->
<!--sponsorsstart-->

## Sponsors

The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
to get your logo on our READMEs and [website](https://eslint.org/sponsors).

<h3>Platinum Sponsors</h3>
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a></p><h3>Gold Sponsors</h3>
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a> <a href="https://www.coderabbit.ai/?utm_source=cr_org&utm_medium=github"><img src="https://avatars.githubusercontent.com/u/132028505" alt="CodeRabbit" height="96"></a></p><h3>Silver Sponsors</h3>
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/d472863/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/2d6c3b6/logo.png" alt="Liftoff" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" height="32"></a> <a href="https://syntax.fm"><img src="https://github.com/syntaxfm.png" alt="Syntax" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://citadel-ai.com"><img src="https://avatars.githubusercontent.com/u/75781367" alt="Citadel AI" height="32"></a></p>
<h3>Technology Sponsors</h3>
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
<!--sponsorsend-->
:x*40000 convertor Յ6)K|崼f100644 data-patch.cjs L$DF}L1Ɂ100644 data.cjs %ƣ/O88yE숒40000 definition-syntax ڥ1#"B540000 generator }OGd100644 index.cjs axwC0a40000 lexer ̎?eîeCS40000 parser ɍ[3k40000 syntax F>? \;40000 tokenizer ME=YQz40000 utils 7$e+"100644 version.cjs {"<,n ѷ40000 walker #wN%%VYr:ȎxK 100644 create.cjs UUOym{S:͇F100644 index.cjs fT'Xޢq+ޠ:uw3x8'use strict';

const List = require('../utils/List.cjs');

function createConvertor(walk) {
    return {
        fromPlainObject(ast) {
            walk(ast, {
                enter(node) {
                    if (node.children && node.children instanceof List.List === false) {
                        node.children = new List.List().fromArray(node.children);
                    }
                }
            });

            return ast;
        },
        toPlainObject(ast) {
            walk(ast, {
                leave(node) {
                    if (node.children && node.children instanceof List.List) {
                        node.children = node.children.toArray();
                    }
                }
            });

            return ast;
        }
    };
}

exports.createConvertor = createConvertor;
׸x O'use strict';

const create = require('./create.cjs');
const index$1 = require('../walker/index.cjs');

const index = create.createConvertor(index$1);

module.exports = index;
[;Bxo 'use strict';

const patch = require('../data/patch.json');

const patch$1 = patch;

module.exports = patch$1;
s$'xC'use strict';

const dataPatch = require('./data-patch.cjs');

const mdnAtrules = require('mdn-data/css/at-rules.json');
const mdnProperties = require('mdn-data/css/properties.json');
const mdnSyntaxes = require('mdn-data/css/syntaxes.json');

const hasOwn = Object.hasOwn || ((object, property) => Object.prototype.hasOwnProperty.call(object, property));
const extendSyntax = /^\s*\|\s*/;

function preprocessAtrules(dict) {
    const result = Object.create(null);

    for (const [atruleName, atrule] of Object.entries(dict)) {
        let descriptors = null;

        if (atrule.descriptors) {
            descriptors = Object.create(null);

            for (const [name, descriptor] of Object.entries(atrule.descriptors)) {
                descriptors[name] = descriptor.syntax;
            }
        }

        result[atruleName.substr(1)] = {
            prelude: atrule.syntax.trim().replace(/\{(.|\s)+\}/, '').match(/^@\S+\s+([^;\{]*)/)[1].trim() || null,
            descriptors
        };
    }

    return result;
}

function patchDictionary(dict, patchDict) {
    const result = Object.create(null);

    // copy all syntaxes for an original dict
    for (const [key, value] of Object.entries(dict)) {
        if (value) {
            result[key] = value.syntax || value;
        }
    }

    // apply a patch
    for (const key of Object.keys(patchDict)) {
        if (hasOwn(dict, key)) {
            if (patchDict[key].syntax) {
                result[key] = extendSyntax.test(patchDict[key].syntax)
                    ? result[key] + ' ' + patchDict[key].syntax.trim()
                    : patchDict[key].syntax;
            } else {
                delete result[key];
            }
        } else {
            if (patchDict[key].syntax) {
                result[key] = patchDict[key].syntax.replace(extendSyntax, '');
            }
        }
    }

    return result;
}

function preprocessPatchAtrulesDescritors(declarations) {
    const result = {};

    for (const [key, value] of Object.entries(declarations || {})) {
        result[key] = typeof value === 'string'
            ? { syntax: value }
            : value;
    }

    return result;
}

function patchAtrules(dict, patchDict) {
    const result = {};

    // copy all syntaxes for an original dict
    for (const key in dict) {
        if (patchDict[key] === null) {
            continue;
        }

        const atrulePatch = patchDict[key] || {};

        result[key] = {
            prelude: key in patchDict && 'prelude' in atrulePatch
                ? atrulePatch.prelude
                : dict[key].prelude || null,
            descriptors: patchDictionary(
                dict[key].descriptors || {},
                preprocessPatchAtrulesDescritors(atrulePatch.descriptors)
            )
        };
    }

    // apply a patch
    for (const [key, atrulePatch] of Object.entries(patchDict)) {
        if (atrulePatch && !hasOwn(dict, key)) {
            result[key] = {
                prelude: atrulePatch.prelude || null,
                descriptors: atrulePatch.descriptors
                    ? patchDictionary({}, preprocessPatchAtrulesDescritors(atrulePatch.descriptors))
                    : null
            };
        }
    }

    return result;
}

const definitions = {
    types: patchDictionary(mdnSyntaxes, dataPatch.types),
    atrules: patchAtrules(preprocessAtrules(mdnAtrules), dataPatch.atrules),
    properties: patchDictionary(mdnProperties, dataPatch.properties)
};

module.exports = definitions;
8%6x 100644 SyntaxError.cjs N|)dMJ/100644 generate.cjs 
z;ߍ8l*100644 index.cjs 
P\wûC|F100644 parse.cjs x Z&rO100644 scanner.cjs 6B4Ѣ100644 walk.cjs W(M%2(P7<I\x('use strict';

const createCustomError = require('../utils/create-custom-error.cjs');

function SyntaxError(message, input, offset) {
    return Object.assign(createCustomError.createCustomError('SyntaxError', message), {
        input,
        offset,
        rawMessage: message,
        message: message + '\n' +
            '  ' + input + '\n' +
            '--' + new Array((offset || input.length) + 1).join('-') + '^'
    });
}

exports.SyntaxError = SyntaxError;
ɑ(x~'use strict';

function noop(value) {
    return value;
}

function generateMultiplier(multiplier) {
    const { min, max, comma } = multiplier;

    if (min === 0 && max === 0) {
        return comma ? '#?' : '*';
    }

    if (min === 0 && max === 1) {
        return '?';
    }

    if (min === 1 && max === 0) {
        return comma ? '#' : '+';
    }

    if (min === 1 && max === 1) {
        return '';
    }

    return (
        (comma ? '#' : '') +
        (min === max
            ? '{' + min + '}'
            : '{' + min + ',' + (max !== 0 ? max : '') + '}'
        )
    );
}

function generateTypeOpts(node) {
    switch (node.type) {
        case 'Range':
            return (
                ' [' +
                (node.min === null ? '-∞' : node.min) +
                ',' +
                (node.max === null ? '∞' : node.max) +
                ']'
            );

        default:
            throw new Error('Unknown node type `' + node.type + '`');
    }
}

function generateSequence(node, decorate, forceBraces, compact) {
    const combinator = node.combinator === ' ' || compact ? node.combinator : ' ' + node.combinator + ' ';
    const result = node.terms
        .map(term => internalGenerate(term, decorate, forceBraces, compact))
        .join(combinator);

    if (node.explicit || forceBraces) {
        return (compact || result[0] === ',' ? '[' : '[ ') + result + (compact ? ']' : ' ]');
    }

    return result;
}

function internalGenerate(node, decorate, forceBraces, compact) {
    let result;

    switch (node.type) {
        case 'Group':
            result =
                generateSequence(node, decorate, forceBraces, compact) +
                (node.disallowEmpty ? '!' : '');
            break;

        case 'Multiplier':
            // return since node is a composition
            return (
                internalGenerate(node.term, decorate, forceBraces, compact) +
                decorate(generateMultiplier(node), node)
            );

        case 'Boolean':
            result = '<boolean-expr[' + internalGenerate(node.term, decorate, forceBraces, compact) + ']>';
            break;

        case 'Type':
            result = '<' + node.name + (node.opts ? decorate(generateTypeOpts(node.opts), node.opts) : '') + '>';
            break;

        case 'Property':
            result = '<\'' + node.name + '\'>';
            break;

        case 'Keyword':
            result = node.name;
            break;

        case 'AtKeyword':
            result = '@' + node.name;
            break;

        case 'Function':
            result = node.name + '(';
            break;

        case 'String':
        case 'Token':
            result = node.value;
            break;

        case 'Comma':
            result = ',';
            break;

        default:
            throw new Error('Unknown node type `' + node.type + '`');
    }

    return decorate(result, node);
}

function generate(node, options) {
    let decorate = noop;
    let forceBraces = false;
    let compact = false;

    if (typeof options === 'function') {
        decorate = options;
    } else if (options) {
        forceBraces = Boolean(options.forceBraces);
        compact = Boolean(options.compact);
        if (typeof options.decorate === 'function') {
            decorate = options.decorate;
        }
    }

    return internalGenerate(node, decorate, forceBraces, compact);
}

exports.generate = generate;
xF'use strict';

const SyntaxError = require('./SyntaxError.cjs');
const generate = require('./generate.cjs');
const parse = require('./parse.cjs');
const walk = require('./walk.cjs');



exports.SyntaxError = SyntaxError.SyntaxError;
exports.generate = generate.generate;
exports.parse = parse.parse;
exports.walk = walk.walk;
qx:O'use strict';

const scanner = require('./scanner.cjs');

const TAB = 9;
const N = 10;
const F = 12;
const R = 13;
const SPACE = 32;
const EXCLAMATIONMARK = 33;    // !
const NUMBERSIGN = 35;         // #
const AMPERSAND = 38;          // &
const APOSTROPHE = 39;         // '
const LEFTPARENTHESIS = 40;    // (
const RIGHTPARENTHESIS = 41;   // )
const ASTERISK = 42;           // *
const PLUSSIGN = 43;           // +
const COMMA = 44;              // ,
const HYPERMINUS = 45;         // -
const LESSTHANSIGN = 60;       // <
const GREATERTHANSIGN = 62;    // >
const QUESTIONMARK = 63;       // ?
const COMMERCIALAT = 64;       // @
const LEFTSQUAREBRACKET = 91;  // [
const RIGHTSQUAREBRACKET = 93; // ]
const LEFTCURLYBRACKET = 123;  // {
const VERTICALLINE = 124;      // |
const RIGHTCURLYBRACKET = 125; // }
const INFINITY = 8734;         // ∞
const COMBINATOR_PRECEDENCE = {
    ' ': 1,
    '&&': 2,
    '||': 3,
    '|': 4
};

function readMultiplierRange(scanner) {
    let min = null;
    let max = null;

    scanner.eat(LEFTCURLYBRACKET);
    scanner.skipWs();

    min = scanner.scanNumber(scanner);
    scanner.skipWs();

    if (scanner.charCode() === COMMA) {
        scanner.pos++;
        scanner.skipWs();

        if (scanner.charCode() !== RIGHTCURLYBRACKET) {
            max = scanner.scanNumber(scanner);
            scanner.skipWs();
        }
    } else {
        max = min;
    }

    scanner.eat(RIGHTCURLYBRACKET);

    return {
        min: Number(min),
        max: max ? Number(max) : 0
    };
}

function readMultiplier(scanner) {
    let range = null;
    let comma = false;

    switch (scanner.charCode()) {
        case ASTERISK:
            scanner.pos++;

            range = {
                min: 0,
                max: 0
            };

            break;

        case PLUSSIGN:
            scanner.pos++;

            range = {
                min: 1,
                max: 0
            };

            break;

        case QUESTIONMARK:
            scanner.pos++;

            range = {
                min: 0,
                max: 1
            };

            break;

        case NUMBERSIGN:
            scanner.pos++;

            comma = true;

            if (scanner.charCode() === LEFTCURLYBRACKET) {
                range = readMultiplierRange(scanner);
            } else if (scanner.charCode() === QUESTIONMARK) {
                // https://www.w3.org/TR/css-values-4/#component-multipliers
                // > the # and ? multipliers may be stacked as #?
                // In this case just treat "#?" as a single multiplier
                // { min: 0, max: 0, comma: true }
                scanner.pos++;
                range = {
                    min: 0,
                    max: 0
                };
            } else {
                range = {
                    min: 1,
                    max: 0
                };
            }

            break;

        case LEFTCURLYBRACKET:
            range = readMultiplierRange(scanner);
            break;

        default:
            return null;
    }

    return {
        type: 'Multiplier',
        comma,
        min: range.min,
        max: range.max,
        term: null
    };
}

function maybeMultiplied(scanner, node) {
    const multiplier = readMultiplier(scanner);

    if (multiplier !== null) {
        multiplier.term = node;

        // https://www.w3.org/TR/css-values-4/#component-multipliers
        // > The + and # multipliers may be stacked as +#;
        // Represent "+#" as nested multipliers:
        // { ...<multiplier #>,
        //   term: {
        //     ...<multipler +>,
        //     term: node
        //   }
        // }
        if (scanner.charCode() === NUMBERSIGN &&
            scanner.charCodeAt(scanner.pos - 1) === PLUSSIGN) {
            return maybeMultiplied(scanner, multiplier);
        }

        // https://www.w3.org/TR/css-values-4/#component-multipliers
        // > the # and ? multipliers, {A} and ? multipliers, and {A,B} and ? multipliers
        // > may be stacked as #?, {A}?, and {A,B}?, respectively
        // Represent "{}?" as nested multipliers as well as "+#".
        // The "#?" case is already handled above, in maybeMultiplied()
        if (scanner.charCode() === QUESTIONMARK &&
            scanner.charCodeAt(scanner.pos - 1) === RIGHTCURLYBRACKET) {
            return maybeMultiplied(scanner, multiplier);
        }

        return multiplier;
    }

    return node;
}

function maybeToken(scanner) {
    const ch = scanner.peek();

    if (ch === '') {
        return null;
    }

    return maybeMultiplied(scanner, {
        type: 'Token',
        value: ch
    });
}

function readProperty(scanner) {
    let name;

    scanner.eat(LESSTHANSIGN);
    scanner.eat(APOSTROPHE);

    name = scanner.scanWord();

    scanner.eat(APOSTROPHE);
    scanner.eat(GREATERTHANSIGN);

    return maybeMultiplied(scanner, {
        type: 'Property',
        name
    });
}

// https://drafts.csswg.org/css-values-3/#numeric-ranges
// 4.1. Range Restrictions and Range Definition Notation
//
// Range restrictions can be annotated in the numeric type notation using CSS bracketed
// range notation—[min,max]—within the angle brackets, after the identifying keyword,
// indicating a closed range between (and including) min and max.
// For example, <integer [0, 10]> indicates an integer between 0 and 10, inclusive.
function readTypeRange(scanner) {
    // use null for Infinity to make AST format JSON serializable/deserializable
    let min = null; // -Infinity
    let max = null; // Infinity
    let sign = 1;

    scanner.eat(LEFTSQUAREBRACKET);

    if (scanner.charCode() === HYPERMINUS) {
        scanner.peek();
        sign = -1;
    }

    if (sign == -1 && scanner.charCode() === INFINITY) {
        scanner.peek();
    } else {
        min = sign * Number(scanner.scanNumber(scanner));

        if (scanner.isNameCharCode()) {
            min += scanner.scanWord();
        }
    }

    scanner.skipWs();
    scanner.eat(COMMA);
    scanner.skipWs();

    if (scanner.charCode() === INFINITY) {
        scanner.peek();
    } else {
        sign = 1;

        if (scanner.charCode() === HYPERMINUS) {
            scanner.peek();
            sign = -1;
        }

        max = sign * Number(scanner.scanNumber(scanner));

        if (scanner.isNameCharCode()) {
            max += scanner.scanWord();
        }
    }

    scanner.eat(RIGHTSQUAREBRACKET);

    return {
        type: 'Range',
        min,
        max
    };
}

function readType(scanner) {
    let name;
    let opts = null;

    scanner.eat(LESSTHANSIGN);
    name = scanner.scanWord();

    // https://drafts.csswg.org/css-values-5/#boolean
    if (name === 'boolean-expr') {
        scanner.eat(LEFTSQUAREBRACKET);

        const implicitGroup = readImplicitGroup(scanner, RIGHTSQUAREBRACKET);

        scanner.eat(RIGHTSQUAREBRACKET);
        scanner.eat(GREATERTHANSIGN);

        return maybeMultiplied(scanner, {
            type: 'Boolean',
            term: implicitGroup.terms.length === 1
                ? implicitGroup.terms[0]
                : implicitGroup
        });
    }

    if (scanner.charCode() === LEFTPARENTHESIS &&
        scanner.nextCharCode() === RIGHTPARENTHESIS) {
        scanner.pos += 2;
        name += '()';
    }

    if (scanner.charCodeAt(scanner.findWsEnd(scanner.pos)) === LEFTSQUAREBRACKET) {
        scanner.skipWs();
        opts = readTypeRange(scanner);
    }

    scanner.eat(GREATERTHANSIGN);

    return maybeMultiplied(scanner, {
        type: 'Type',
        name,
        opts
    });
}

function readKeywordOrFunction(scanner) {
    const name = scanner.scanWord();

    if (scanner.charCode() === LEFTPARENTHESIS) {
        scanner.pos++;

        return {
            type: 'Function',
            name
        };
    }

    return maybeMultiplied(scanner, {
        type: 'Keyword',
        name
    });
}

function regroupTerms(terms, combinators) {
    function createGroup(terms, combinator) {
        return {
            type: 'Group',
            terms,
            combinator,
            disallowEmpty: false,
            explicit: false
        };
    }

    let combinator;

    combinators = Object.keys(combinators)
        .sort((a, b) => COMBINATOR_PRECEDENCE[a] - COMBINATOR_PRECEDENCE[b]);

    while (combinators.length > 0) {
        combinator = combinators.shift();

        let i = 0;
        let subgroupStart = 0;

        for (; i < terms.length; i++) {
            const term = terms[i];

            if (term.type === 'Combinator') {
                if (term.value === combinator) {
                    if (subgroupStart === -1) {
                        subgroupStart = i - 1;
                    }
                    terms.splice(i, 1);
                    i--;
                } else {
                    if (subgroupStart !== -1 && i - subgroupStart > 1) {
                        terms.splice(
                            subgroupStart,
                            i - subgroupStart,
                            createGroup(terms.slice(subgroupStart, i), combinator)
                        );
                        i = subgroupStart + 1;
                    }
                    subgroupStart = -1;
                }
            }
        }

        if (subgroupStart !== -1 && combinators.length) {
            terms.splice(
                subgroupStart,
                i - subgroupStart,
                createGroup(terms.slice(subgroupStart, i), combinator)
            );
        }
    }

    return combinator;
}

function readImplicitGroup(scanner, stopCharCode = -1) {
    const combinators = Object.create(null);
    const terms = [];
    let prevToken = null;
    let prevTokenPos = scanner.pos;
    let prevTokenIsFunction = false;

    while (scanner.charCode() !== stopCharCode) {
        let token = prevTokenIsFunction
            ? readImplicitGroup(scanner, RIGHTPARENTHESIS)
            : peek(scanner);

        if (!token) {
            break;
        }

        if (token.type === 'Spaces') {
            continue;
        }

        if (prevTokenIsFunction) {
            if (token.terms.length === 0) {
                prevTokenIsFunction = false;
                continue;
            }

            if (token.combinator === ' ') {
                while (token.terms.length > 1) {
                    combinators[' '] = true;  // a b
                    terms.push({
                        type: 'Combinator',
                        value: ' '
                    }, token.terms.shift());
                }

                token = token.terms[0];
            }
        }

        if (token.type === 'Combinator') {
            // check for combinator in group beginning and double combinator sequence
            if (prevToken === null || prevToken.type === 'Combinator') {
                scanner.pos = prevTokenPos;
                scanner.error('Unexpected combinator');
            }

            combinators[token.value] = true;
        } else if (prevToken !== null && prevToken.type !== 'Combinator') {
            combinators[' '] = true;  // a b
            terms.push({
                type: 'Combinator',
                value: ' '
            });
        }

        terms.push(token);
        prevToken = token;
        prevTokenPos = scanner.pos;
        prevTokenIsFunction = token.type === 'Function';
    }

    // check for combinator in group ending
    if (prevToken !== null && prevToken.type === 'Combinator') {
        scanner.pos -= prevTokenPos;
        scanner.error('Unexpected combinator');
    }

    return {
        type: 'Group',
        terms,
        combinator: regroupTerms(terms, combinators) || ' ',
        disallowEmpty: false,
        explicit: false
    };
}

function readGroup(scanner) {
    let result;

    scanner.eat(LEFTSQUAREBRACKET);
    result = readImplicitGroup(scanner, RIGHTSQUAREBRACKET);
    scanner.eat(RIGHTSQUAREBRACKET);

    result.explicit = true;

    if (scanner.charCode() === EXCLAMATIONMARK) {
        scanner.pos++;
        result.disallowEmpty = true;
    }

    return result;
}

function peek(scanner) {
    let code = scanner.charCode();

    switch (code) {
        case RIGHTSQUAREBRACKET:
            // don't eat, stop scan a group
            break;

        case LEFTSQUAREBRACKET:
            return maybeMultiplied(scanner, readGroup(scanner));

        case LESSTHANSIGN:
            return scanner.nextCharCode() === APOSTROPHE
                ? readProperty(scanner)
                : readType(scanner);

        case VERTICALLINE:
            return {
                type: 'Combinator',
                value: scanner.substringToPos(
                    scanner.pos + (scanner.nextCharCode() === VERTICALLINE ? 2 : 1)
                )
            };

        case AMPERSAND:
            scanner.pos++;
            scanner.eat(AMPERSAND);

            return {
                type: 'Combinator',
                value: '&&'
            };

        case COMMA:
            scanner.pos++;
            return {
                type: 'Comma'
            };

        case APOSTROPHE:
            return maybeMultiplied(scanner, {
                type: 'String',
                value: scanner.scanString()
            });

        case SPACE:
        case TAB:
        case N:
        case R:
        case F:
            return {
                type: 'Spaces',
                value: scanner.scanSpaces()
            };

        case COMMERCIALAT:
            code = scanner.nextCharCode();

            if (scanner.isNameCharCode(code)) {
                scanner.pos++;
                return {
                    type: 'AtKeyword',
                    name: scanner.scanWord()
                };
            }

            return maybeToken(scanner);

        case ASTERISK:
        case PLUSSIGN:
        case QUESTIONMARK:
        case NUMBERSIGN:
        case EXCLAMATIONMARK:
            // prohibited tokens (used as a multiplier start)
            break;

        case LEFTCURLYBRACKET:
            // LEFTCURLYBRACKET is allowed since mdn/data uses it w/o quoting
            // check next char isn't a number, because it's likely a disjoined multiplier
            code = scanner.nextCharCode();

            if (code < 48 || code > 57) {
                return maybeToken(scanner);
            }

            break;

        default:
            if (scanner.isNameCharCode(code)) {
                return readKeywordOrFunction(scanner);
            }

            return maybeToken(scanner);
    }
}

function parse(source) {
    const scanner$1 = new scanner.Scanner(source);
    const result = readImplicitGroup(scanner$1);

    if (scanner$1.pos !== source.length) {
        scanner$1.error('Unexpected input');
    }

    // reduce redundant groups with single group term
    if (result.terms.length === 1 && result.terms[0].type === 'Group') {
        return result.terms[0];
    }

    return result;
}

exports.parse = parse;
/»x
t'use strict';

const SyntaxError = require('./SyntaxError.cjs');

const TAB = 9;
const N = 10;
const F = 12;
const R = 13;
const SPACE = 32;
const NAME_CHAR = new Uint8Array(128).map((_, idx) =>
    /[a-zA-Z0-9\-]/.test(String.fromCharCode(idx)) ? 1 : 0
);

class Scanner {
    constructor(str) {
        this.str = str;
        this.pos = 0;
    }

    charCodeAt(pos) {
        return pos < this.str.length ? this.str.charCodeAt(pos) : 0;
    }
    charCode() {
        return this.charCodeAt(this.pos);
    }
    isNameCharCode(code = this.charCode()) {
        return code < 128 && NAME_CHAR[code] === 1;
    }
    nextCharCode() {
        return this.charCodeAt(this.pos + 1);
    }
    nextNonWsCode(pos) {
        return this.charCodeAt(this.findWsEnd(pos));
    }
    skipWs() {
        this.pos = this.findWsEnd(this.pos);
    }
    findWsEnd(pos) {
        for (; pos < this.str.length; pos++) {
            const code = this.str.charCodeAt(pos);
            if (code !== R && code !== N && code !== F && code !== SPACE && code !== TAB) {
                break;
            }
        }

        return pos;
    }
    substringToPos(end) {
        return this.str.substring(this.pos, this.pos = end);
    }
    eat(code) {
        if (this.charCode() !== code) {
            this.error('Expect `' + String.fromCharCode(code) + '`');
        }

        this.pos++;
    }
    peek() {
        return this.pos < this.str.length ? this.str.charAt(this.pos++) : '';
    }
    error(message) {
        throw new SyntaxError.SyntaxError(message, this.str, this.pos);
    }

    scanSpaces() {
        return this.substringToPos(this.findWsEnd(this.pos));
    }
    scanWord() {
        let end = this.pos;

        for (; end < this.str.length; end++) {
            const code = this.str.charCodeAt(end);
            if (code >= 128 || NAME_CHAR[code] === 0) {
                break;
            }
        }

        if (this.pos === end) {
            this.error('Expect a keyword');
        }

        return this.substringToPos(end);
    }
    scanNumber() {
        let end = this.pos;

        for (; end < this.str.length; end++) {
            const code = this.str.charCodeAt(end);

            if (code < 48 || code > 57) {
                break;
            }
        }

        if (this.pos === end) {
            this.error('Expect a number');
        }

        return this.substringToPos(end);
    }
    scanString() {
        const end = this.str.indexOf('\'', this.pos + 1);

        if (end === -1) {
            this.pos = this.str.length;
            this.error('Expect an apostrophe');
        }

        return this.substringToPos(end + 1);
    }
}

exports.Scanner = Scanner;
] Px	'use strict';

const noop = function() {};

function ensureFunction(value) {
    return typeof value === 'function' ? value : noop;
}

function walk(node, options, context) {
    function walk(node) {
        enter.call(context, node);

        switch (node.type) {
            case 'Group':
                node.terms.forEach(walk);
                break;

            case 'Multiplier':
            case 'Boolean':
                walk(node.term);
                break;

            case 'Type':
            case 'Property':
            case 'Keyword':
            case 'AtKeyword':
            case 'Function':
            case 'String':
            case 'Token':
            case 'Comma':
                break;

            default:
                throw new Error('Unknown type: ' + node.type);
        }

        leave.call(context, node);
    }

    let enter = noop;
    let leave = noop;

    if (typeof options === 'function') {
        enter = options;
    } else if (options) {
        enter = ensureFunction(options.enter);
        leave = ensureFunction(options.leave);
    }

    if (enter === noop && leave === noop) {
        throw new Error('Neither `enter` nor `leave` walker handler is set or both aren\'t a function');
    }

    walk(node);
}

exports.walk = walk;
g֠
x _100644 create.cjs ḥrGE$.~100644 index.cjs \4{H*o100644 sourceMap.cjs []萞W,~AJ100644 token-before.cjs es~PzSGp<yH)rGBxf'use strict';

const getTokenizer = require('../utils/get-tokenizer.cjs');
const sourceMap = require('./sourceMap.cjs');
const tokenBefore = require('./token-before.cjs');
const types = require('../tokenizer/types.cjs');

const REVERSESOLIDUS = 0x005c; // U+005C REVERSE SOLIDUS (\)

function processChildren(node, delimeter) {
    if (typeof delimeter === 'function') {
        let prev = null;

        node.children.forEach(node => {
            if (prev !== null) {
                delimeter.call(this, prev);
            }

            this.node(node);
            prev = node;
        });

        return;
    }

    node.children.forEach(this.node, this);
}

function createGenerator(config) {
    const types$1 = new Map();

    for (let [name, item] of Object.entries(config.node)) {
        const fn = item.generate || item;

        if (typeof fn === 'function') {
            types$1.set(name, item.generate || item);
        }
    }

    return function(node, options) {
        let buffer = '';
        let prevCode = 0;
        let handlers = {
            node(node) {
                if (types$1.has(node.type)) {
                    types$1.get(node.type).call(publicApi, node);
                } else {
                    throw new Error('Unknown node type: ' + node.type);
                }
            },
            tokenBefore: tokenBefore.safe,
            token(type, value, suppressAutoWhiteSpace) {
                prevCode = this.tokenBefore(prevCode, type, value);

                if (!suppressAutoWhiteSpace && prevCode & 1) {
                    this.emit(' ', types.WhiteSpace, true);
                }

                this.emit(value, type, false);

                if (type === types.Delim && value.charCodeAt(0) === REVERSESOLIDUS) {
                    this.emit('\n', types.WhiteSpace, true);
                }
            },
            emit(value) {
                buffer += value;
            },
            result() {
                return buffer;
            }
        };

        if (options) {
            if (typeof options.decorator === 'function') {
                handlers = options.decorator(handlers);
            }

            if (options.sourceMap) {
                handlers = sourceMap.generateSourceMap(handlers);
            }

            if (options.mode in tokenBefore) {
                handlers.tokenBefore = tokenBefore[options.mode];
            }
        }

        const publicApi = {
            node: (node) => handlers.node(node),
            children: processChildren,
            token: (type, value) => handlers.token(type, value),
            tokenize: function (chunk) {
                const tokenize = getTokenizer.getTokenizer(config);

                return tokenize(chunk, (type, start, end) => {
                    handlers.token(
                        type,
                        chunk.slice(start, end),
                        start !== 0 // suppress auto whitespace for internal value tokens
                    );
                });
            }
        };

        handlers.node(node);

        return handlers.result();
    };
}

exports.createGenerator = createGenerator;
;$gkx @'use strict';

const create = require('./create.cjs');
const generator = require('../syntax/config/generator.cjs');

const index = create.createGenerator(generator);

module.exports = index;
<BPx~
'use strict';

const sourceMapGenerator_js = require('source-map-js/lib/source-map-generator.js');

const trackNodes = new Set(['Atrule', 'Selector', 'Declaration']);

function generateSourceMap(handlers) {
    const map = new sourceMapGenerator_js.SourceMapGenerator();
    const generated = {
        line: 1,
        column: 0
    };
    const original = {
        line: 0, // should be zero to add first mapping
        column: 0
    };
    const activatedGenerated = {
        line: 1,
        column: 0
    };
    const activatedMapping = {
        generated: activatedGenerated
    };
    let line = 1;
    let column = 0;
    let sourceMappingActive = false;

    const origHandlersNode = handlers.node;
    handlers.node = function(node) {
        if (node.loc && node.loc.start && trackNodes.has(node.type)) {
            const nodeLine = node.loc.start.line;
            const nodeColumn = node.loc.start.column - 1;

            if (original.line !== nodeLine ||
                original.column !== nodeColumn) {
                original.line = nodeLine;
                original.column = nodeColumn;

                generated.line = line;
                generated.column = column;

                if (sourceMappingActive) {
                    sourceMappingActive = false;
                    if (generated.line !== activatedGenerated.line ||
                        generated.column !== activatedGenerated.column) {
                        map.addMapping(activatedMapping);
                    }
                }

                sourceMappingActive = true;
                map.addMapping({
                    source: node.loc.source,
                    original,
                    generated
                });
            }
        }

        origHandlersNode.call(this, node);

        if (sourceMappingActive && trackNodes.has(node.type)) {
            activatedGenerated.line = line;
            activatedGenerated.column = column;
        }
    };

    const origHandlersEmit = handlers.emit;
    handlers.emit = function(value, type, auto) {
        for (let i = 0; i < value.length; i++) {
            if (value.charCodeAt(i) === 10) { // \n
                line++;
                column = 0;
            } else {
                column++;
            }
        }

        origHandlersEmit(value, type, auto);
    };

    const origHandlersResult = handlers.result;
    handlers.result = function() {
        if (sourceMappingActive) {
            map.addMapping(activatedMapping);
        }

        return {
            css: origHandlersResult(),
            map
        };
    };

    return handlers;
}

exports.generateSourceMap = generateSourceMap;
ǲ@x'use strict';

const types = require('../tokenizer/types.cjs');

const PLUSSIGN = 0x002B;    // U+002B PLUS SIGN (+)
const HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)

// code:
// 0xxxxxxx x0000000 - char code (0x80 for non-ASCII) or delim value
// 00000000 0xxxxxx0 - token type (0 for delim, 1 for token)
// 00000000 0000000x - reserved for carriage emit flag (0 for no space, 1 for space)
const code = (type, value) => {
    if (type === types.Delim) {
        type = value;
    }

    if (typeof type === 'string') {
        type = Math.min(type.charCodeAt(0), 0x80) << 6; // replace non-ASCII with 0x80
    }

    return type << 1;
};

// https://www.w3.org/TR/css-syntax-3/#serialization
// The only requirement for serialization is that it must "round-trip" with parsing,
// that is, parsing the stylesheet must produce the same data structures as parsing,
// serializing, and parsing again, except for consecutive <whitespace-token>s,
// which may be collapsed into a single token.

const specPairs = [
    [types.Ident, types.Ident],
    [types.Ident, types.Function],
    [types.Ident, types.Url],
    [types.Ident, types.BadUrl],
    [types.Ident, '-'],
    [types.Ident, types.Number],
    [types.Ident, types.Percentage],
    [types.Ident, types.Dimension],
    [types.Ident, types.CDC],
    [types.Ident, types.LeftParenthesis],

    [types.AtKeyword, types.Ident],
    [types.AtKeyword, types.Function],
    [types.AtKeyword, types.Url],
    [types.AtKeyword, types.BadUrl],
    [types.AtKeyword, '-'],
    [types.AtKeyword, types.Number],
    [types.AtKeyword, types.Percentage],
    [types.AtKeyword, types.Dimension],
    [types.AtKeyword, types.CDC],

    [types.Hash, types.Ident],
    [types.Hash, types.Function],
    [types.Hash, types.Url],
    [types.Hash, types.BadUrl],
    [types.Hash, '-'],
    [types.Hash, types.Number],
    [types.Hash, types.Percentage],
    [types.Hash, types.Dimension],
    [types.Hash, types.CDC],

    [types.Dimension, types.Ident],
    [types.Dimension, types.Function],
    [types.Dimension, types.Url],
    [types.Dimension, types.BadUrl],
    [types.Dimension, '-'],
    [types.Dimension, types.Number],
    [types.Dimension, types.Percentage],
    [types.Dimension, types.Dimension],
    [types.Dimension, types.CDC],

    ['#', types.Ident],
    ['#', types.Function],
    ['#', types.Url],
    ['#', types.BadUrl],
    ['#', '-'],
    ['#', types.Number],
    ['#', types.Percentage],
    ['#', types.Dimension],
    ['#', types.CDC], // https://github.com/w3c/csswg-drafts/pull/6874

    ['-', types.Ident],
    ['-', types.Function],
    ['-', types.Url],
    ['-', types.BadUrl],
    ['-', '-'],
    ['-', types.Number],
    ['-', types.Percentage],
    ['-', types.Dimension],
    ['-', types.CDC], // https://github.com/w3c/csswg-drafts/pull/6874

    [types.Number, types.Ident],
    [types.Number, types.Function],
    [types.Number, types.Url],
    [types.Number, types.BadUrl],
    [types.Number, types.Number],
    [types.Number, types.Percentage],
    [types.Number, types.Dimension],
    [types.Number, '%'],
    [types.Number, types.CDC], // https://github.com/w3c/csswg-drafts/pull/6874

    ['@', types.Ident],
    ['@', types.Function],
    ['@', types.Url],
    ['@', types.BadUrl],
    ['@', '-'],
    ['@', types.CDC], // https://github.com/w3c/csswg-drafts/pull/6874

    ['.', types.Number],
    ['.', types.Percentage],
    ['.', types.Dimension],

    ['+', types.Number],
    ['+', types.Percentage],
    ['+', types.Dimension],

    ['/', '*']
];
// validate with scripts/generate-safe
const safePairs = specPairs.concat([
    [types.Ident, types.Hash],

    [types.Dimension, types.Hash],

    [types.Hash, types.Hash],

    [types.AtKeyword, types.LeftParenthesis],
    [types.AtKeyword, types.String],
    [types.AtKeyword, types.Colon],

    [types.Percentage, types.Percentage],
    [types.Percentage, types.Dimension],
    [types.Percentage, types.Function],
    [types.Percentage, '-'],

    [types.RightParenthesis, types.Ident],
    [types.RightParenthesis, types.Function],
    [types.RightParenthesis, types.Percentage],
    [types.RightParenthesis, types.Dimension],
    [types.RightParenthesis, types.Hash],
    [types.RightParenthesis, '-']
]);

function createMap(pairs) {
    const isWhiteSpaceRequired = new Set(
        pairs.map(([prev, next]) => (code(prev) << 16 | code(next)))
    );

    return function(prevCode, type, value) {
        const nextCode = code(type, value);
        const nextCharCode = value.charCodeAt(0);
        const emitWs =
            (nextCharCode === HYPHENMINUS &&
                type !== types.Ident &&
                type !== types.Function &&
                type !== types.CDC) ||
            (nextCharCode === PLUSSIGN)
                ? isWhiteSpaceRequired.has((prevCode & 0xFFFE) << 16 | nextCharCode << 7)
                : isWhiteSpaceRequired.has((prevCode & 0xFFFE) << 16 | nextCode);

        return nextCode | emitWs;
    };
}

const spec = createMap(specPairs);
const safe = createMap(safePairs);

exports.safe = safe;
exports.spec = spec;
53ھsx>'use strict';

const index$1 = require('./syntax/index.cjs');
const version = require('./version.cjs');
const create = require('./syntax/create.cjs');
const List = require('./utils/List.cjs');
const Lexer = require('./lexer/Lexer.cjs');
const index = require('./definition-syntax/index.cjs');
const clone = require('./utils/clone.cjs');
const names$1 = require('./utils/names.cjs');
const ident = require('./utils/ident.cjs');
const string = require('./utils/string.cjs');
const url = require('./utils/url.cjs');
const types = require('./tokenizer/types.cjs');
const names = require('./tokenizer/names.cjs');
const TokenStream = require('./tokenizer/TokenStream.cjs');
const OffsetToLocation = require('./tokenizer/OffsetToLocation.cjs');

const {
    tokenize,
    parse,
    generate,
    lexer,
    createLexer,

    walk,
    find,
    findLast,
    findAll,

    toPlainObject,
    fromPlainObject,

    fork
} = index$1;

exports.version = version.version;
exports.createSyntax = create;
exports.List = List.List;
exports.Lexer = Lexer.Lexer;
exports.definitionSyntax = index;
exports.clone = clone.clone;
exports.isCustomProperty = names$1.isCustomProperty;
exports.keyword = names$1.keyword;
exports.property = names$1.property;
exports.vendorPrefix = names$1.vendorPrefix;
exports.ident = ident;
exports.string = string;
exports.url = url;
exports.tokenTypes = types;
exports.tokenNames = names;
exports.TokenStream = TokenStream.TokenStream;
exports.OffsetToLocation = OffsetToLocation.OffsetToLocation;
exports.createLexer = createLexer;
exports.find = find;
exports.findAll = findAll;
exports.findLast = findLast;
exports.fork = fork;
exports.fromPlainObject = fromPlainObject;
exports.generate = generate;
exports.lexer = lexer;
exports.parse = parse;
exports.toPlainObject = toPlainObject;
exports.tokenize = tokenize;
exports.walk = walk;
#x9100644 Lexer.cjs apgG,F!100644 error.cjs %.\og>Ӟ`.E100644 generic-an-plus-b.cjs ߺ>-X&Qլє\v100644 generic-const.cjs aW%mn-\f100644 generic-urange.cjs {$ kL)y100644 generic.cjs #`6cOz$-K100644 index.cjs .63hcf.100644 match-graph.cjs uੈrLsW&100644 match.cjs c}6ap@x
b100644 prepare-tokens.cjs 		+xKl|A100644 search.cjs +âފr&o/100644 structure.cjs G; t9h^)100644 trace.cjs u?&Nxt|0
v&100644 units.cjs {y՜:K~,ܫxD''use strict';

const error = require('./error.cjs');
const names = require('../utils/names.cjs');
const genericConst = require('./generic-const.cjs');
const generic = require('./generic.cjs');
const units = require('./units.cjs');
const prepareTokens = require('./prepare-tokens.cjs');
const matchGraph = require('./match-graph.cjs');
const match = require('./match.cjs');
const trace = require('./trace.cjs');
const search = require('./search.cjs');
const structure = require('./structure.cjs');
const parse = require('../definition-syntax/parse.cjs');
const generate = require('../definition-syntax/generate.cjs');
const walk = require('../definition-syntax/walk.cjs');

function dumpMapSyntax(map, compact, syntaxAsAst) {
    const result = {};

    for (const name in map) {
        if (map[name].syntax) {
            result[name] = syntaxAsAst
                ? map[name].syntax
                : generate.generate(map[name].syntax, { compact });
        }
    }

    return result;
}

function dumpAtruleMapSyntax(map, compact, syntaxAsAst) {
    const result = {};

    for (const [name, atrule] of Object.entries(map)) {
        result[name] = {
            prelude: atrule.prelude && (
                syntaxAsAst
                    ? atrule.prelude.syntax
                    : generate.generate(atrule.prelude.syntax, { compact })
            ),
            descriptors: atrule.descriptors && dumpMapSyntax(atrule.descriptors, compact, syntaxAsAst)
        };
    }

    return result;
}

function valueHasVar(tokens) {
    for (let i = 0; i < tokens.length; i++) {
        if (tokens[i].value.toLowerCase() === 'var(') {
            return true;
        }
    }

    return false;
}

function syntaxHasTopLevelCommaMultiplier(syntax) {
    const singleTerm = syntax.terms[0];

    return (
        syntax.explicit === false &&
        syntax.terms.length === 1 &&
        singleTerm.type === 'Multiplier' &&
        singleTerm.comma === true
    );
}

function valueHasEnv(tokens) {
    for (let i = 0; i < tokens.length; i++) {
        if (tokens[i].value.toLowerCase() === 'env(') {
            return true;
        }
    }

    return false;
}

function buildMatchResult(matched, error, iterations) {
    return {
        matched,
        iterations,
        error,
        ...trace
    };
}

function matchSyntax(lexer, syntax, value, useCssWideKeywords) {
    const tokens = prepareTokens(value, lexer.syntax);
    let result;

    if (valueHasVar(tokens)) {
        return buildMatchResult(null, new Error('Matching for a tree with var() is not supported'));
    }

    if (valueHasEnv(tokens)) {
        return buildMatchResult(null, new Error('Matching for a tree with env() is not supported'));
    }

    if (useCssWideKeywords) {
        result = match.matchAsTree(tokens, lexer.cssWideKeywordsSyntax, lexer);
    }

    if (!useCssWideKeywords || !result.match) {
        result = match.matchAsTree(tokens, syntax.match, lexer);
        if (!result.match) {
            return buildMatchResult(
                null,
                new error.SyntaxMatchError(result.reason, syntax.syntax, value, result),
                result.iterations
            );
        }
    }

    return buildMatchResult(result.match, null, result.iterations);
}

class Lexer {
    constructor(config, syntax, structure$1) {
        this.cssWideKeywords = genericConst.cssWideKeywords;
        this.syntax = syntax;
        this.generic = false;
        this.units = { ...units };
        this.atrules = Object.create(null);
        this.properties = Object.create(null);
        this.types = Object.create(null);
        this.structure = structure$1 || structure.getStructureFromConfig(config);

        if (config) {
            if (config.cssWideKeywords) {
                this.cssWideKeywords = config.cssWideKeywords;
            }

            if (config.units) {
                for (const group of Object.keys(units)) {
                    if (Array.isArray(config.units[group])) {
                        this.units[group] = config.units[group];
                    }
                }
            }

            if (config.types) {
                for (const [name, type] of Object.entries(config.types)) {
                    this.addType_(name, type);
                }
            }

            if (config.generic) {
                this.generic = true;
                for (const [name, value] of Object.entries(generic.createGenericTypes(this.units))) {
                    this.addType_(name, value);
                }
            }

            if (config.atrules) {
                for (const [name, atrule] of Object.entries(config.atrules)) {
                    this.addAtrule_(name, atrule);
                }
            }

            if (config.properties) {
                for (const [name, property] of Object.entries(config.properties)) {
                    this.addProperty_(name, property);
                }
            }
        }

        this.cssWideKeywordsSyntax = matchGraph.buildMatchGraph(this.cssWideKeywords.join(' |  '));
    }

    checkStructure(ast) {
        function collectWarning(node, message) {
            warns.push({ node, message });
        }

        const structure = this.structure;
        const warns = [];

        this.syntax.walk(ast, function(node) {
            if (structure.hasOwnProperty(node.type)) {
                structure[node.type].check(node, collectWarning);
            } else {
                collectWarning(node, 'Unknown node type `' + node.type + '`');
            }
        });

        return warns.length ? warns : false;
    }

    createDescriptor(syntax, type, name, parent = null) {
        const ref = {
            type,
            name
        };
        const descriptor = {
            type,
            name,
            parent,
            serializable: typeof syntax === 'string' || (syntax && typeof syntax.type === 'string'),
            syntax: null,
            match: null,
            matchRef: null // used for properties when a syntax referenced as <'property'> in other syntax definitions
        };

        if (typeof syntax === 'function') {
            descriptor.match = matchGraph.buildMatchGraph(syntax, ref);
        } else {
            if (typeof syntax === 'string') {
                // lazy parsing on first access
                Object.defineProperty(descriptor, 'syntax', {
                    get() {
                        Object.defineProperty(descriptor, 'syntax', {
                            value: parse.parse(syntax)
                        });

                        return descriptor.syntax;
                    }
                });
            } else {
                descriptor.syntax = syntax;
            }

            // lazy graph build on first access
            Object.defineProperty(descriptor, 'match', {
                get() {
                    Object.defineProperty(descriptor, 'match', {
                        value: matchGraph.buildMatchGraph(descriptor.syntax, ref)
                    });

                    return descriptor.match;
                }
            });

            if (type === 'Property') {
                Object.defineProperty(descriptor, 'matchRef', {
                    get() {
                        const syntax = descriptor.syntax;
                        const value = syntaxHasTopLevelCommaMultiplier(syntax)
                            ? matchGraph.buildMatchGraph({
                                ...syntax,
                                terms: [syntax.terms[0].term]
                            }, ref)
                            : null;

                        Object.defineProperty(descriptor, 'matchRef', {
                            value
                        });

                        return value;
                    }
                });
            }
        }

        return descriptor;
    }
    addAtrule_(name, syntax) {
        if (!syntax) {
            return;
        }

        this.atrules[name] = {
            type: 'Atrule',
            name: name,
            prelude: syntax.prelude ? this.createDescriptor(syntax.prelude, 'AtrulePrelude', name) : null,
            descriptors: syntax.descriptors
                ? Object.keys(syntax.descriptors).reduce(
                    (map, descName) => {
                        map[descName] = this.createDescriptor(syntax.descriptors[descName], 'AtruleDescriptor', descName, name);
                        return map;
                    },
                    Object.create(null)
                )
                : null
        };
    }
    addProperty_(name, syntax) {
        if (!syntax) {
            return;
        }

        this.properties[name] = this.createDescriptor(syntax, 'Property', name);
    }
    addType_(name, syntax) {
        if (!syntax) {
            return;
        }

        this.types[name] = this.createDescriptor(syntax, 'Type', name);
    }

    checkAtruleName(atruleName) {
        if (!this.getAtrule(atruleName)) {
            return new error.SyntaxReferenceError('Unknown at-rule', '@' + atruleName);
        }
    }
    checkAtrulePrelude(atruleName, prelude) {
        const error = this.checkAtruleName(atruleName);

        if (error) {
            return error;
        }

        const atrule = this.getAtrule(atruleName);

        if (!atrule.prelude && prelude) {
            return new SyntaxError('At-rule `@' + atruleName + '` should not contain a prelude');
        }

        if (atrule.prelude && !prelude) {
            if (!matchSyntax(this, atrule.prelude, '', false).matched) {
                return new SyntaxError('At-rule `@' + atruleName + '` should contain a prelude');
            }
        }
    }
    checkAtruleDescriptorName(atruleName, descriptorName) {
        const error$1 = this.checkAtruleName(atruleName);

        if (error$1) {
            return error$1;
        }

        const atrule = this.getAtrule(atruleName);
        const descriptor = names.keyword(descriptorName);

        if (!atrule.descriptors) {
            return new SyntaxError('At-rule `@' + atruleName + '` has no known descriptors');
        }

        if (!atrule.descriptors[descriptor.name] &&
            !atrule.descriptors[descriptor.basename]) {
            return new error.SyntaxReferenceError('Unknown at-rule descriptor', descriptorName);
        }
    }
    checkPropertyName(propertyName) {
        if (!this.getProperty(propertyName)) {
            return new error.SyntaxReferenceError('Unknown property', propertyName);
        }
    }

    matchAtrulePrelude(atruleName, prelude) {
        const error = this.checkAtrulePrelude(atruleName, prelude);

        if (error) {
            return buildMatchResult(null, error);
        }

        const atrule = this.getAtrule(atruleName);

        if (!atrule.prelude) {
            return buildMatchResult(null, null);
        }

        return matchSyntax(this, atrule.prelude, prelude || '', false);
    }
    matchAtruleDescriptor(atruleName, descriptorName, value) {
        const error = this.checkAtruleDescriptorName(atruleName, descriptorName);

        if (error) {
            return buildMatchResult(null, error);
        }

        const atrule = this.getAtrule(atruleName);
        const descriptor = names.keyword(descriptorName);

        return matchSyntax(this, atrule.descriptors[descriptor.name] || atrule.descriptors[descriptor.basename], value, false);
    }
    matchDeclaration(node) {
        if (node.type !== 'Declaration') {
            return buildMatchResult(null, new Error('Not a Declaration node'));
        }

        return this.matchProperty(node.property, node.value);
    }
    matchProperty(propertyName, value) {
        if (
            !this.getProperty(propertyName) &&
            names.property(propertyName).custom
        ) {
            return buildMatchResult(null, new Error('Lexer matching doesn\'t applicable for custom properties'));
        }

        const error = this.checkPropertyName(propertyName);

        if (error) {
            return buildMatchResult(null, error);
        }

        return matchSyntax(this, this.getProperty(propertyName), value, true);
    }
    matchType(typeName, value) {
        const typeSyntax = this.getType(typeName);

        if (!typeSyntax) {
            return buildMatchResult(null, new error.SyntaxReferenceError('Unknown type', typeName));
        }

        return matchSyntax(this, typeSyntax, value, false);
    }
    match(syntax, value) {
        if (typeof syntax !== 'string' && (!syntax || !syntax.type)) {
            return buildMatchResult(null, new error.SyntaxReferenceError('Bad syntax'));
        }

        if (typeof syntax === 'string' || !syntax.match) {
            syntax = this.createDescriptor(syntax, 'Type', 'anonymous');
        }

        return matchSyntax(this, syntax, value, false);
    }

    findValueFragments(propertyName, value, type, name) {
        return search.matchFragments(this, value, this.matchProperty(propertyName, value), type, name);
    }
    findDeclarationValueFragments(declaration, type, name) {
        return search.matchFragments(this, declaration.value, this.matchDeclaration(declaration), type, name);
    }
    findAllFragments(ast, type, name) {
        const result = [];

        this.syntax.walk(ast, {
            visit: 'Declaration',
            enter: (declaration) => {
                result.push.apply(result, this.findDeclarationValueFragments(declaration, type, name));
            }
        });

        return result;
    }

    getAtrule(atruleName, fallbackBasename = true) {
        const atrule = names.keyword(atruleName);
        const atruleEntry = atrule.vendor && fallbackBasename
            ? this.atrules[atrule.name] || this.atrules[atrule.basename]
            : this.atrules[atrule.name];

        return atruleEntry || null;
    }
    getAtrulePrelude(atruleName, fallbackBasename = true) {
        const atrule = this.getAtrule(atruleName, fallbackBasename);

        return atrule && atrule.prelude || null;
    }
    getAtruleDescriptor(atruleName, name) {
        const atrule = this.getAtrule(atruleName);
        const descriptor = names.keyword(name);
        const descriptorEntry = atrule && atrule.descriptors
            ? atrule.descriptors[descriptor.name] || atrule.descriptors[descriptor.basename]
            : null;

        return descriptorEntry || null;
    }
    getProperty(propertyName, fallbackBasename = true) {
        const property = names.property(propertyName);
        const propertyEntry = property.vendor && fallbackBasename
            ? this.properties[property.name] || this.properties[property.basename]
            : this.properties[property.name];

        return propertyEntry || null;
    }
    getType(name) {
        return hasOwnProperty.call(this.types, name) ? this.types[name] : null;
    }

    validate() {
        function syntaxRef(name, isType) {
            return isType ? `<${name}>` : `<'${name}'>`;
        }

        function validate(syntax, name, broken, descriptor) {
            if (broken.has(name)) {
                return broken.get(name);
            }

            broken.set(name, false);
            if (descriptor.syntax !== null) {
                walk.walk(descriptor.syntax, function(node) {
                    if (node.type !== 'Type' && node.type !== 'Property') {
                        return;
                    }

                    const map = node.type === 'Type' ? syntax.types : syntax.properties;
                    const brokenMap = node.type === 'Type' ? brokenTypes : brokenProperties;

                    if (!hasOwnProperty.call(map, node.name)) {
                        errors.push(`${syntaxRef(name, broken === brokenTypes)} used missed syntax definition ${syntaxRef(node.name, node.type === 'Type')}`);
                        broken.set(name, true);
                    } else if (validate(syntax, node.name, brokenMap, map[node.name])) {
                        errors.push(`${syntaxRef(name, broken === brokenTypes)} used broken syntax definition ${syntaxRef(node.name, node.type === 'Type')}`);
                        broken.set(name, true);
                    }
                }, this);
            }
        }

        const errors = [];
        let brokenTypes = new Map();
        let brokenProperties = new Map();

        for (const key in this.types) {
            validate(this, key, brokenTypes, this.types[key]);
        }

        for (const key in this.properties) {
            validate(this, key, brokenProperties, this.properties[key]);
        }

        const brokenTypesArray = [...brokenTypes.keys()].filter(name => brokenTypes.get(name));
        const brokenPropertiesArray = [...brokenProperties.keys()].filter(name => brokenProperties.get(name));

        if (brokenTypesArray.length || brokenPropertiesArray.length) {
            return {
                errors,
                types: brokenTypesArray,
                properties: brokenPropertiesArray
            };
        }

        return null;
    }
    dump(syntaxAsAst, pretty) {
        return {
            generic: this.generic,
            cssWideKeywords: this.cssWideKeywords,
            units: this.units,
            types: dumpMapSyntax(this.types, !pretty, syntaxAsAst),
            properties: dumpMapSyntax(this.properties, !pretty, syntaxAsAst),
            atrules: dumpAtruleMapSyntax(this.atrules, !pretty, syntaxAsAst)
        };
    }
    toString() {
        return JSON.stringify(this.dump());
    }
}

exports.Lexer = Lexer;
lc?xc'use strict';

const createCustomError = require('../utils/create-custom-error.cjs');
const generate = require('../definition-syntax/generate.cjs');

const defaultLoc = { offset: 0, line: 1, column: 1 };

function locateMismatch(matchResult, node) {
    const tokens = matchResult.tokens;
    const longestMatch = matchResult.longestMatch;
    const mismatchNode = longestMatch < tokens.length ? tokens[longestMatch].node || null : null;
    const badNode = mismatchNode !== node ? mismatchNode : null;
    let mismatchOffset = 0;
    let mismatchLength = 0;
    let entries = 0;
    let css = '';
    let start;
    let end;

    for (let i = 0; i < tokens.length; i++) {
        const token = tokens[i].value;

        if (i === longestMatch) {
            mismatchLength = token.length;
            mismatchOffset = css.length;
        }

        if (badNode !== null && tokens[i].node === badNode) {
            if (i <= longestMatch) {
                entries++;
            } else {
                entries = 0;
            }
        }

        css += token;
    }

    if (longestMatch === tokens.length || entries > 1) { // last
        start = fromLoc(badNode || node, 'end') || buildLoc(defaultLoc, css);
        end = buildLoc(start);
    } else {
        start = fromLoc(badNode, 'start') ||
            buildLoc(fromLoc(node, 'start') || defaultLoc, css.slice(0, mismatchOffset));
        end = fromLoc(badNode, 'end') ||
            buildLoc(start, css.substr(mismatchOffset, mismatchLength));
    }

    return {
        css,
        mismatchOffset,
        mismatchLength,
        start,
        end
    };
}

function fromLoc(node, point) {
    const value = node && node.loc && node.loc[point];

    if (value) {
        return 'line' in value ? buildLoc(value) : value;
    }

    return null;
}

function buildLoc({ offset, line, column }, extra) {
    const loc = {
        offset,
        line,
        column
    };

    if (extra) {
        const lines = extra.split(/\n|\r\n?|\f/);

        loc.offset += extra.length;
        loc.line += lines.length - 1;
        loc.column = lines.length === 1 ? loc.column + extra.length : lines.pop().length + 1;
    }

    return loc;
}

const SyntaxReferenceError = function(type, referenceName) {
    const error = createCustomError.createCustomError(
        'SyntaxReferenceError',
        type + (referenceName ? ' `' + referenceName + '`' : '')
    );

    error.reference = referenceName;

    return error;
};

const SyntaxMatchError = function(message, syntax, node, matchResult) {
    const error = createCustomError.createCustomError('SyntaxMatchError', message);
    const {
        css,
        mismatchOffset,
        mismatchLength,
        start,
        end
    } = locateMismatch(matchResult, node);

    error.rawMessage = message;
    error.syntax = syntax ? generate.generate(syntax) : '<generic>';
    error.css = css;
    error.mismatchOffset = mismatchOffset;
    error.mismatchLength = mismatchLength;
    error.message = message + '\n' +
        '  syntax: ' + error.syntax + '\n' +
        '   value: ' + (css || '<empty string>') + '\n' +
        '  --------' + new Array(error.mismatchOffset + 1).join('-') + '^';

    Object.assign(error, start);
    error.loc = {
        source: (node && node.loc && node.loc.source) || '<unknown>',
        start,
        end
    };

    return error;
};

exports.SyntaxMatchError = SyntaxMatchError;
exports.SyntaxReferenceError = SyntaxReferenceError;
,!:xF'use strict';

const charCodeDefinitions = require('../tokenizer/char-code-definitions.cjs');
const types = require('../tokenizer/types.cjs');
const utils = require('../tokenizer/utils.cjs');

const PLUSSIGN = 0x002B;    // U+002B PLUS SIGN (+)
const HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)
const N = 0x006E;           // U+006E LATIN SMALL LETTER N (n)
const DISALLOW_SIGN = true;
const ALLOW_SIGN = false;

function isDelim(token, code) {
    return token !== null && token.type === types.Delim && token.value.charCodeAt(0) === code;
}

function skipSC(token, offset, getNextToken) {
    while (token !== null && (token.type === types.WhiteSpace || token.type === types.Comment)) {
        token = getNextToken(++offset);
    }

    return offset;
}

function checkInteger(token, valueOffset, disallowSign, offset) {
    if (!token) {
        return 0;
    }

    const code = token.value.charCodeAt(valueOffset);

    if (code === PLUSSIGN || code === HYPHENMINUS) {
        if (disallowSign) {
            // Number sign is not allowed
            return 0;
        }
        valueOffset++;
    }

    for (; valueOffset < token.value.length; valueOffset++) {
        if (!charCodeDefinitions.isDigit(token.value.charCodeAt(valueOffset))) {
            // Integer is expected
            return 0;
        }
    }

    return offset + 1;
}

// ... <signed-integer>
// ... ['+' | '-'] <signless-integer>
function consumeB(token, offset_, getNextToken) {
    let sign = false;
    let offset = skipSC(token, offset_, getNextToken);

    token = getNextToken(offset);

    if (token === null) {
        return offset_;
    }

    if (token.type !== types.Number) {
        if (isDelim(token, PLUSSIGN) || isDelim(token, HYPHENMINUS)) {
            sign = true;
            offset = skipSC(getNextToken(++offset), offset, getNextToken);
            token = getNextToken(offset);

            if (token === null || token.type !== types.Number) {
                return 0;
            }
        } else {
            return offset_;
        }
    }

    if (!sign) {
        const code = token.value.charCodeAt(0);
        if (code !== PLUSSIGN && code !== HYPHENMINUS) {
            // Number sign is expected
            return 0;
        }
    }

    return checkInteger(token, sign ? 0 : 1, sign, offset);
}

// An+B microsyntax https://www.w3.org/TR/css-syntax-3/#anb
function anPlusB(token, getNextToken) {
    /* eslint-disable brace-style*/
    let offset = 0;

    if (!token) {
        return 0;
    }

    // <integer>
    if (token.type === types.Number) {
        return checkInteger(token, 0, ALLOW_SIGN, offset); // b
    }

    // -n
    // -n <signed-integer>
    // -n ['+' | '-'] <signless-integer>
    // -n- <signless-integer>
    // <dashndashdigit-ident>
    else if (token.type === types.Ident && token.value.charCodeAt(0) === HYPHENMINUS) {
        // expect 1st char is N
        if (!utils.cmpChar(token.value, 1, N)) {
            return 0;
        }

        switch (token.value.length) {
            // -n
            // -n <signed-integer>
            // -n ['+' | '-'] <signless-integer>
            case 2:
                return consumeB(getNextToken(++offset), offset, getNextToken);

            // -n- <signless-integer>
            case 3:
                if (token.value.charCodeAt(2) !== HYPHENMINUS) {
                    return 0;
                }

                offset = skipSC(getNextToken(++offset), offset, getNextToken);
                token = getNextToken(offset);

                return checkInteger(token, 0, DISALLOW_SIGN, offset);

            // <dashndashdigit-ident>
            default:
                if (token.value.charCodeAt(2) !== HYPHENMINUS) {
                    return 0;
                }

                return checkInteger(token, 3, DISALLOW_SIGN, offset);
        }
    }

    // '+'? n
    // '+'? n <signed-integer>
    // '+'? n ['+' | '-'] <signless-integer>
    // '+'? n- <signless-integer>
    // '+'? <ndashdigit-ident>
    else if (token.type === types.Ident || (isDelim(token, PLUSSIGN) && getNextToken(offset + 1).type === types.Ident)) {
        // just ignore a plus
        if (token.type !== types.Ident) {
            token = getNextToken(++offset);
        }

        if (token === null || !utils.cmpChar(token.value, 0, N)) {
            return 0;
        }

        switch (token.value.length) {
            // '+'? n
            // '+'? n <signed-integer>
            // '+'? n ['+' | '-'] <signless-integer>
            case 1:
                return consumeB(getNextToken(++offset), offset, getNextToken);

            // '+'? n- <signless-integer>
            case 2:
                if (token.value.charCodeAt(1) !== HYPHENMINUS) {
                    return 0;
                }

                offset = skipSC(getNextToken(++offset), offset, getNextToken);
                token = getNextToken(offset);

                return checkInteger(token, 0, DISALLOW_SIGN, offset);

            // '+'? <ndashdigit-ident>
            default:
                if (token.value.charCodeAt(1) !== HYPHENMINUS) {
                    return 0;
                }

                return checkInteger(token, 2, DISALLOW_SIGN, offset);
        }
    }

    // <ndashdigit-dimension>
    // <ndash-dimension> <signless-integer>
    // <n-dimension>
    // <n-dimension> <signed-integer>
    // <n-dimension> ['+' | '-'] <signless-integer>
    else if (token.type === types.Dimension) {
        let code = token.value.charCodeAt(0);
        let sign = code === PLUSSIGN || code === HYPHENMINUS ? 1 : 0;
        let i = sign;

        for (; i < token.value.length; i++) {
            if (!charCodeDefinitions.isDigit(token.value.charCodeAt(i))) {
                break;
            }
        }

        if (i === sign) {
            // Integer is expected
            return 0;
        }

        if (!utils.cmpChar(token.value, i, N)) {
            return 0;
        }

        // <n-dimension>
        // <n-dimension> <signed-integer>
        // <n-dimension> ['+' | '-'] <signless-integer>
        if (i + 1 === token.value.length) {
            return consumeB(getNextToken(++offset), offset, getNextToken);
        } else {
            if (token.value.charCodeAt(i + 1) !== HYPHENMINUS) {
                return 0;
            }

            // <ndash-dimension> <signless-integer>
            if (i + 2 === token.value.length) {
                offset = skipSC(getNextToken(++offset), offset, getNextToken);
                token = getNextToken(offset);

                return checkInteger(token, 0, DISALLOW_SIGN, offset);
            }
            // <ndashdigit-dimension>
            else {
                return checkInteger(token, i + 2, DISALLOW_SIGN, offset);
            }
        }
    }

    return 0;
}

module.exports = anPlusB;
0hGx 0'use strict';

// https://drafts.csswg.org/css-cascade-5/
const cssWideKeywords = [
    'initial',
    'inherit',
    'unset',
    'revert',
    'revert-layer'
];

exports.cssWideKeywords = cssWideKeywords;
Bxe'use strict';

const charCodeDefinitions = require('../tokenizer/char-code-definitions.cjs');
const types = require('../tokenizer/types.cjs');
const utils = require('../tokenizer/utils.cjs');

const PLUSSIGN = 0x002B;     // U+002B PLUS SIGN (+)
const HYPHENMINUS = 0x002D;  // U+002D HYPHEN-MINUS (-)
const QUESTIONMARK = 0x003F; // U+003F QUESTION MARK (?)
const U = 0x0075;            // U+0075 LATIN SMALL LETTER U (u)

function isDelim(token, code) {
    return token !== null && token.type === types.Delim && token.value.charCodeAt(0) === code;
}

function startsWith(token, code) {
    return token.value.charCodeAt(0) === code;
}

function hexSequence(token, offset, allowDash) {
    let hexlen = 0;

    for (let pos = offset; pos < token.value.length; pos++) {
        const code = token.value.charCodeAt(pos);

        if (code === HYPHENMINUS && allowDash && hexlen !== 0) {
            hexSequence(token, offset + hexlen + 1, false);
            return 6; // dissallow following question marks
        }

        if (!charCodeDefinitions.isHexDigit(code)) {
            return 0; // not a hex digit
        }

        if (++hexlen > 6) {
            return 0; // too many hex digits
        }    }

    return hexlen;
}

function withQuestionMarkSequence(consumed, length, getNextToken) {
    if (!consumed) {
        return 0; // nothing consumed
    }

    while (isDelim(getNextToken(length), QUESTIONMARK)) {
        if (++consumed > 6) {
            return 0; // too many question marks
        }

        length++;
    }

    return length;
}

// https://drafts.csswg.org/css-syntax/#urange
// Informally, the <urange> production has three forms:
// U+0001
//      Defines a range consisting of a single code point, in this case the code point "1".
// U+0001-00ff
//      Defines a range of codepoints between the first and the second value, in this case
//      the range between "1" and "ff" (255 in decimal) inclusive.
// U+00??
//      Defines a range of codepoints where the "?" characters range over all hex digits,
//      in this case defining the same as the value U+0000-00ff.
// In each form, a maximum of 6 digits is allowed for each hexadecimal number (if you treat "?" as a hexadecimal digit).
//
// <urange> =
//   u '+' <ident-token> '?'* |
//   u <dimension-token> '?'* |
//   u <number-token> '?'* |
//   u <number-token> <dimension-token> |
//   u <number-token> <number-token> |
//   u '+' '?'+
function urange(token, getNextToken) {
    let length = 0;

    // should start with `u` or `U`
    if (token === null || token.type !== types.Ident || !utils.cmpChar(token.value, 0, U)) {
        return 0;
    }

    token = getNextToken(++length);
    if (token === null) {
        return 0;
    }

    // u '+' <ident-token> '?'*
    // u '+' '?'+
    if (isDelim(token, PLUSSIGN)) {
        token = getNextToken(++length);
        if (token === null) {
            return 0;
        }

        if (token.type === types.Ident) {
            // u '+' <ident-token> '?'*
            return withQuestionMarkSequence(hexSequence(token, 0, true), ++length, getNextToken);
        }

        if (isDelim(token, QUESTIONMARK)) {
            // u '+' '?'+
            return withQuestionMarkSequence(1, ++length, getNextToken);
        }

        // Hex digit or question mark is expected
        return 0;
    }

    // u <number-token> '?'*
    // u <number-token> <dimension-token>
    // u <number-token> <number-token>
    if (token.type === types.Number) {
        const consumedHexLength = hexSequence(token, 1, true);
        if (consumedHexLength === 0) {
            return 0;
        }

        token = getNextToken(++length);
        if (token === null) {
            // u <number-token> <eof>
            return length;
        }

        if (token.type === types.Dimension || token.type === types.Number) {
            // u <number-token> <dimension-token>
            // u <number-token> <number-token>
            if (!startsWith(token, HYPHENMINUS) || !hexSequence(token, 1, false)) {
                return 0;
            }

            return length + 1;
        }

        // u <number-token> '?'*
        return withQuestionMarkSequence(consumedHexLength, length, getNextToken);
    }

    // u <dimension-token> '?'*
    if (token.type === types.Dimension) {
        return withQuestionMarkSequence(hexSequence(token, 1, true), ++length, getNextToken);
    }

    return 0;
}

module.exports = urange;
6!
x\R'use strict';

const genericConst = require('./generic-const.cjs');
const genericAnPlusB = require('./generic-an-plus-b.cjs');
const genericUrange = require('./generic-urange.cjs');
const charCodeDefinitions = require('../tokenizer/char-code-definitions.cjs');
const types = require('../tokenizer/types.cjs');
const utils = require('../tokenizer/utils.cjs');

// CSS mathematical functions categorized by return type behavior
// See: https://www.w3.org/TR/css-values-4/#math

// Calculation functions that return different types depending on input
const calcFunctionNames = [
    'calc(',
    '-moz-calc(',
    '-webkit-calc('
];

// Comparison functions that return different types depending on input
const comparisonFunctionNames = [
    'min(',
    'max(',
    'clamp('
];

// Functions that return a stepped value, i.e. a value that is rounded to the nearest step
const steppedValueFunctionNames = [
    'round(',
    'mod(',
    'rem('
];

// Trigonometrical functions that return a <number>
const trigNumberFunctionNames = [
    'sin(',
    'cos(',
    'tan('
];

// Trigonometrical functions that return a <angle>
const trigAngleFunctionNames = [
    'asin(',
    'acos(',
    'atan(',
    'atan2('
];

// Other functions that return a <number>
const otherNumberFunctionNames = [
    'pow(',
    'sqrt(',
    'log(',
    'exp(',
    'sign('
];

// Exponential functions that return a <number> or <dimension> or <percentage>
const expNumberDimensionPercentageFunctionNames = [
    'hypot('
];

// Return the same type as the input
const signFunctionNames = [
    'abs('
];

const numberFunctionNames = [
    ...calcFunctionNames,
    ...comparisonFunctionNames,
    ...steppedValueFunctionNames,
    ...trigNumberFunctionNames,
    ...otherNumberFunctionNames,
    ...expNumberDimensionPercentageFunctionNames,
    ...signFunctionNames
];

const percentageFunctionNames = [
    ...calcFunctionNames,
    ...comparisonFunctionNames,
    ...steppedValueFunctionNames,
    ...expNumberDimensionPercentageFunctionNames,
    ...signFunctionNames
];

const dimensionFunctionNames = [
    ...calcFunctionNames,
    ...comparisonFunctionNames,
    ...steppedValueFunctionNames,
    ...trigAngleFunctionNames,
    ...expNumberDimensionPercentageFunctionNames,
    ...signFunctionNames
];

const balancePair = new Map([
    [types.Function, types.RightParenthesis],
    [types.LeftParenthesis, types.RightParenthesis],
    [types.LeftSquareBracket, types.RightSquareBracket],
    [types.LeftCurlyBracket, types.RightCurlyBracket]
]);

// safe char code getter
function charCodeAt(str, index) {
    return index < str.length ? str.charCodeAt(index) : 0;
}

function eqStr(actual, expected) {
    return utils.cmpStr(actual, 0, actual.length, expected);
}

function eqStrAny(actual, expected) {
    for (let i = 0; i < expected.length; i++) {
        if (eqStr(actual, expected[i])) {
            return true;
        }
    }

    return false;
}

// IE postfix hack, i.e. 123\0 or 123px\9
function isPostfixIeHack(str, offset) {
    if (offset !== str.length - 2) {
        return false;
    }

    return (
        charCodeAt(str, offset) === 0x005C &&  // U+005C REVERSE SOLIDUS (\)
        charCodeDefinitions.isDigit(charCodeAt(str, offset + 1))
    );
}

function outOfRange(opts, value, numEnd) {
    if (opts && opts.type === 'Range') {
        const num = Number(
            numEnd !== undefined && numEnd !== value.length
                ? value.substr(0, numEnd)
                : value
        );

        if (isNaN(num)) {
            return true;
        }

        // FIXME: when opts.min is a string it's a dimension, skip a range validation
        // for now since it requires a type covertation which is not implmented yet
        if (opts.min !== null && num < opts.min && typeof opts.min !== 'string') {
            return true;
        }

        // FIXME: when opts.max is a string it's a dimension, skip a range validation
        // for now since it requires a type covertation which is not implmented yet
        if (opts.max !== null && num > opts.max && typeof opts.max !== 'string') {
            return true;
        }
    }

    return false;
}

function consumeFunction(token, getNextToken) {
    let balanceCloseType = 0;
    let balanceStash = [];
    let length = 0;

    // balanced token consuming
    scan:
    do {
        switch (token.type) {
            case types.RightCurlyBracket:
            case types.RightParenthesis:
            case types.RightSquareBracket:
                if (token.type !== balanceCloseType) {
                    break scan;
                }

                balanceCloseType = balanceStash.pop();

                if (balanceStash.length === 0) {
                    length++;
                    break scan;
                }

                break;

            case types.Function:
            case types.LeftParenthesis:
            case types.LeftSquareBracket:
            case types.LeftCurlyBracket:
                balanceStash.push(balanceCloseType);
                balanceCloseType = balancePair.get(token.type);
                break;
        }

        length++;
    } while (token = getNextToken(length));

    return length;
}


// TODO: implement
// can be used wherever <length>, <frequency>, <angle>, <time>, <percentage>, <number>, or <integer> values are allowed
// https://drafts.csswg.org/css-values/#calc-notation
function math(next, functionNames) {
    return function(token, getNextToken, opts) {
        if (token === null) {
            return 0;
        }

        if (token.type === types.Function && eqStrAny(token.value, functionNames)) {
            return consumeFunction(token, getNextToken);
        }

        return next(token, getNextToken, opts);
    };
}

function tokenType(expectedTokenType) {
    return function(token) {
        if (token === null || token.type !== expectedTokenType) {
            return 0;
        }

        return 1;
    };
}

// =========================
// Complex types
//

// https://drafts.csswg.org/css-values-4/#custom-idents
// 4.2. Author-defined Identifiers: the <custom-ident> type
// Some properties accept arbitrary author-defined identifiers as a component value.
// This generic data type is denoted by <custom-ident>, and represents any valid CSS identifier
// that would not be misinterpreted as a pre-defined keyword in that property’s value definition.
//
// See also: https://developer.mozilla.org/en-US/docs/Web/CSS/custom-ident
function customIdent(token) {
    if (token === null || token.type !== types.Ident) {
        return 0;
    }

    const name = token.value.toLowerCase();

    // The CSS-wide keywords are not valid <custom-ident>s
    if (eqStrAny(name, genericConst.cssWideKeywords)) {
        return 0;
    }

    // The default keyword is reserved and is also not a valid <custom-ident>
    if (eqStr(name, 'default')) {
        return 0;
    }

    // TODO: ignore property specific keywords (as described https://developer.mozilla.org/en-US/docs/Web/CSS/custom-ident)
    // Specifications using <custom-ident> must specify clearly what other keywords
    // are excluded from <custom-ident>, if any—for example by saying that any pre-defined keywords
    // in that property’s value definition are excluded. Excluded keywords are excluded
    // in all ASCII case permutations.

    return 1;
}

// https://drafts.csswg.org/css-values-4/#dashed-idents
// The <dashed-ident> production is a <custom-ident>, with all the case-sensitivity that implies,
// with the additional restriction that it must start with two dashes (U+002D HYPHEN-MINUS).
function dashedIdent(token) {
    if (token === null || token.type !== types.Ident) {
        return 0;
    }

    // ... must start with two dashes (U+002D HYPHEN-MINUS)
    if (charCodeAt(token.value, 0) !== 0x002D || charCodeAt(token.value, 1) !== 0x002D) {
        return 0;
    }

    return 1;
}

// https://drafts.csswg.org/css-variables/#typedef-custom-property-name
// A custom property is any property whose name starts with two dashes (U+002D HYPHEN-MINUS), like --foo.
// The <custom-property-name> production corresponds to this: it’s defined as any <dashed-ident>
// (a valid identifier that starts with two dashes), except -- itself, which is reserved for future use by CSS.
function customPropertyName(token) {
    // ... it’s defined as any <dashed-ident>
    if (!dashedIdent(token)) {
        return 0;
    }

    // ... except -- itself, which is reserved for future use by CSS
    if (token.value === '--') {
        return 0;
    }

    return 1;
}

// https://drafts.csswg.org/css-color-4/#hex-notation
// The syntax of a <hex-color> is a <hash-token> token whose value consists of 3, 4, 6, or 8 hexadecimal digits.
// In other words, a hex color is written as a hash character, "#", followed by some number of digits 0-9 or
// letters a-f (the case of the letters doesn’t matter - #00ff00 is identical to #00FF00).
function hexColor(token) {
    if (token === null || token.type !== types.Hash) {
        return 0;
    }

    const length = token.value.length;

    // valid values (length): #rgb (4), #rgba (5), #rrggbb (7), #rrggbbaa (9)
    if (length !== 4 && length !== 5 && length !== 7 && length !== 9) {
        return 0;
    }

    for (let i = 1; i < length; i++) {
        if (!charCodeDefinitions.isHexDigit(charCodeAt(token.value, i))) {
            return 0;
        }
    }

    return 1;
}

function idSelector(token) {
    if (token === null || token.type !== types.Hash) {
        return 0;
    }

    if (!charCodeDefinitions.isIdentifierStart(charCodeAt(token.value, 1), charCodeAt(token.value, 2), charCodeAt(token.value, 3))) {
        return 0;
    }

    return 1;
}

// https://drafts.csswg.org/css-syntax/#any-value
// It represents the entirety of what a valid declaration can have as its value.
function declarationValue(token, getNextToken) {
    if (!token) {
        return 0;
    }

    let balanceCloseType = 0;
    let balanceStash = [];
    let length = 0;

    // The <declaration-value> production matches any sequence of one or more tokens,
    // so long as the sequence does not contain ...
    scan:
    do {
        switch (token.type) {
            // ... <bad-string-token>, <bad-url-token>,
            case types.BadString:
            case types.BadUrl:
                break scan;

            // ... unmatched <)-token>, <]-token>, or <}-token>,
            case types.RightCurlyBracket:
            case types.RightParenthesis:
            case types.RightSquareBracket:
                if (token.type !== balanceCloseType) {
                    break scan;
                }

                balanceCloseType = balanceStash.pop();
                break;

            // ... or top-level <semicolon-token> tokens
            case types.Semicolon:
                if (balanceCloseType === 0) {
                    break scan;
                }

                break;

            // ... or <delim-token> tokens with a value of "!"
            case types.Delim:
                if (balanceCloseType === 0 && token.value === '!') {
                    break scan;
                }

                break;

            case types.Function:
            case types.LeftParenthesis:
            case types.LeftSquareBracket:
            case types.LeftCurlyBracket:
                balanceStash.push(balanceCloseType);
                balanceCloseType = balancePair.get(token.type);
                break;
        }

        length++;
    } while (token = getNextToken(length));

    return length;
}

// https://drafts.csswg.org/css-syntax/#any-value
// The <any-value> production is identical to <declaration-value>, but also
// allows top-level <semicolon-token> tokens and <delim-token> tokens
// with a value of "!". It represents the entirety of what valid CSS can be in any context.
function anyValue(token, getNextToken) {
    if (!token) {
        return 0;
    }

    let balanceCloseType = 0;
    let balanceStash = [];
    let length = 0;

    // The <any-value> production matches any sequence of one or more tokens,
    // so long as the sequence ...
    scan:
    do {
        switch (token.type) {
            // ... does not contain <bad-string-token>, <bad-url-token>,
            case types.BadString:
            case types.BadUrl:
                break scan;

            // ... unmatched <)-token>, <]-token>, or <}-token>,
            case types.RightCurlyBracket:
            case types.RightParenthesis:
            case types.RightSquareBracket:
                if (token.type !== balanceCloseType) {
                    break scan;
                }

                balanceCloseType = balanceStash.pop();
                break;

            case types.Function:
            case types.LeftParenthesis:
            case types.LeftSquareBracket:
            case types.LeftCurlyBracket:
                balanceStash.push(balanceCloseType);
                balanceCloseType = balancePair.get(token.type);
                break;
        }

        length++;
    } while (token = getNextToken(length));

    return length;
}

// =========================
// Dimensions
//

function dimension(type) {
    if (type) {
        type = new Set(type);
    }

    return function(token, getNextToken, opts) {
        if (token === null || token.type !== types.Dimension) {
            return 0;
        }

        const numberEnd = utils.consumeNumber(token.value, 0);

        // check unit
        if (type !== null) {
            // check for IE postfix hack, i.e. 123px\0 or 123px\9
            const reverseSolidusOffset = token.value.indexOf('\\', numberEnd);
            const unit = reverseSolidusOffset === -1 || !isPostfixIeHack(token.value, reverseSolidusOffset)
                ? token.value.substr(numberEnd)
                : token.value.substring(numberEnd, reverseSolidusOffset);

            if (type.has(unit.toLowerCase()) === false) {
                return 0;
            }
        }

        // check range if specified
        if (outOfRange(opts, token.value, numberEnd)) {
            return 0;
        }

        return 1;
    };
}

// =========================
// Percentage
//

// §5.5. Percentages: the <percentage> type
// https://drafts.csswg.org/css-values-4/#percentages
function percentage(token, getNextToken, opts) {
    // ... corresponds to the <percentage-token> production
    if (token === null || token.type !== types.Percentage) {
        return 0;
    }

    // check range if specified
    if (outOfRange(opts, token.value, token.value.length - 1)) {
        return 0;
    }

    return 1;
}

// =========================
// Numeric
//

// https://drafts.csswg.org/css-values-4/#numbers
// The value <zero> represents a literal number with the value 0. Expressions that merely
// evaluate to a <number> with the value 0 (for example, calc(0)) do not match <zero>;
// only literal <number-token>s do.
function zero(next) {
    if (typeof next !== 'function') {
        next = function() {
            return 0;
        };
    }

    return function(token, getNextToken, opts) {
        if (token !== null && token.type === types.Number) {
            if (Number(token.value) === 0) {
                return 1;
            }
        }

        return next(token, getNextToken, opts);
    };
}

// § 5.3. Real Numbers: the <number> type
// https://drafts.csswg.org/css-values-4/#numbers
// Number values are denoted by <number>, and represent real numbers, possibly with a fractional component.
// ... It corresponds to the <number-token> production
function number(token, getNextToken, opts) {
    if (token === null) {
        return 0;
    }

    const numberEnd = utils.consumeNumber(token.value, 0);
    const isNumber = numberEnd === token.value.length;
    if (!isNumber && !isPostfixIeHack(token.value, numberEnd)) {
        return 0;
    }

    // check range if specified
    if (outOfRange(opts, token.value, numberEnd)) {
        return 0;
    }

    return 1;
}

// §5.2. Integers: the <integer> type
// https://drafts.csswg.org/css-values-4/#integers
function integer(token, getNextToken, opts) {
    // ... corresponds to a subset of the <number-token> production
    if (token === null || token.type !== types.Number) {
        return 0;
    }

    // The first digit of an integer may be immediately preceded by `-` or `+` to indicate the integer’s sign.
    let i = charCodeAt(token.value, 0) === 0x002B ||       // U+002B PLUS SIGN (+)
            charCodeAt(token.value, 0) === 0x002D ? 1 : 0; // U+002D HYPHEN-MINUS (-)

    // When written literally, an integer is one or more decimal digits 0 through 9 ...
    for (; i < token.value.length; i++) {
        if (!charCodeDefinitions.isDigit(charCodeAt(token.value, i))) {
            return 0;
        }
    }

    // check range if specified
    if (outOfRange(opts, token.value, i)) {
        return 0;
    }

    return 1;
}

// token types
const tokenTypes = {
    'ident-token': tokenType(types.Ident),
    'function-token': tokenType(types.Function),
    'at-keyword-token': tokenType(types.AtKeyword),
    'hash-token': tokenType(types.Hash),
    'string-token': tokenType(types.String),
    'bad-string-token': tokenType(types.BadString),
    'url-token': tokenType(types.Url),
    'bad-url-token': tokenType(types.BadUrl),
    'delim-token': tokenType(types.Delim),
    'number-token': tokenType(types.Number),
    'percentage-token': tokenType(types.Percentage),
    'dimension-token': tokenType(types.Dimension),
    'whitespace-token': tokenType(types.WhiteSpace),
    'CDO-token': tokenType(types.CDO),
    'CDC-token': tokenType(types.CDC),
    'colon-token': tokenType(types.Colon),
    'semicolon-token': tokenType(types.Semicolon),
    'comma-token': tokenType(types.Comma),
    '[-token': tokenType(types.LeftSquareBracket),
    ']-token': tokenType(types.RightSquareBracket),
    '(-token': tokenType(types.LeftParenthesis),
    ')-token': tokenType(types.RightParenthesis),
    '{-token': tokenType(types.LeftCurlyBracket),
    '}-token': tokenType(types.RightCurlyBracket)
};

// token production types
const productionTypes = {
    // token type aliases
    'string': tokenType(types.String),
    'ident': tokenType(types.Ident),

    // percentage
    'percentage': math(percentage, percentageFunctionNames),

    // numeric
    'zero': zero(),
    'number': math(number, numberFunctionNames),
    'integer': math(integer, numberFunctionNames),

    // complex types
    'custom-ident': customIdent,
    'dashed-ident': dashedIdent,
    'custom-property-name': customPropertyName,
    'hex-color': hexColor,
    'id-selector': idSelector, // element( <id-selector> )
    'an-plus-b': genericAnPlusB,
    'urange': genericUrange,
    'declaration-value': declarationValue,
    'any-value': anyValue
};

const unitGroups = [
    'length',
    'angle',
    'time',
    'frequency',
    'resolution',
    'flex',
    'decibel',
    'semitones'
];

// dimensions types depend on units set
function createDemensionTypes(units) {
    const {
        angle,
        decibel,
        frequency,
        flex,
        length,
        resolution,
        semitones,
        time
    } = units || {};

    return {
        'dimension': math(dimension(null), dimensionFunctionNames),
        'angle': math(dimension(angle), dimensionFunctionNames),
        'decibel': math(dimension(decibel), dimensionFunctionNames),
        'frequency': math(dimension(frequency), dimensionFunctionNames),
        'flex': math(dimension(flex), dimensionFunctionNames),
        'length': math(zero(dimension(length)), dimensionFunctionNames),
        'resolution': math(dimension(resolution), dimensionFunctionNames),
        'semitones': math(dimension(semitones), dimensionFunctionNames),
        'time': math(dimension(time), dimensionFunctionNames)
    };
}

// The <attr-unit> production matches any identifier that is an ASCII case-insensitive
// match for the name of a CSS dimension unit, such as px, or the <delim-token> %.
function createAttrUnit(units) {
    const unitSet = new Set();

    for (const group of unitGroups) {
        if (Array.isArray(units[group])) {
            for (const unit of units[group]) {
                unitSet.add(unit.toLowerCase());
            }
        }
    }

    return function attrUnit(token) {
        if (token === null) {
            return 0;
        }

        if (token.type === types.Delim && token.value === '%') {
            return 1;
        }

        if (token.type === types.Ident && unitSet.has(token.value.toLowerCase())) {
            return 1;
        }

        return 0;
    };
}

function createGenericTypes(units) {
    return {
        ...tokenTypes,
        ...productionTypes,
        ...createDemensionTypes(units),
        'attr-unit': createAttrUnit(units)
    };
}

exports.createDemensionTypes = createDemensionTypes;
exports.createGenericTypes = createGenericTypes;
exports.productionTypes = productionTypes;
exports.tokenTypes = tokenTypes;
exports.unitGroups = unitGroups;
tjxU 'use strict';

const Lexer = require('./Lexer.cjs');



exports.Lexer = Lexer.Lexer;
exK<'use strict';

const parse = require('../definition-syntax/parse.cjs');

const MATCH = { type: 'Match' };
const MISMATCH = { type: 'Mismatch' };
const DISALLOW_EMPTY = { type: 'DisallowEmpty' };

const LEFTPARENTHESIS = 40;  // (
const RIGHTPARENTHESIS = 41; // )

function createCondition(match, thenBranch, elseBranch) {
    // reduce node count
    if (thenBranch === MATCH && elseBranch === MISMATCH) {
        return match;
    }

    if (match === MATCH && thenBranch === MATCH && elseBranch === MATCH) {
        return match;
    }

    if (match.type === 'If' && match.else === MISMATCH && thenBranch === MATCH) {
        thenBranch = match.then;
        match = match.match;
    }

    return {
        type: 'If',
        match,
        then: thenBranch,
        else: elseBranch
    };
}

function isFunctionType(name) {
    return (
        name.length > 2 &&
        name.charCodeAt(name.length - 2) === LEFTPARENTHESIS &&
        name.charCodeAt(name.length - 1) === RIGHTPARENTHESIS
    );
}

function isEnumCapatible(term) {
    return (
        term.type === 'Keyword' ||
        term.type === 'AtKeyword' ||
        term.type === 'Function' ||
        term.type === 'Type' && isFunctionType(term.name)
    );
}

function groupNode(terms, combinator = ' ', explicit = false) {
    return {
        type: 'Group',
        terms,
        combinator,
        disallowEmpty: false,
        explicit
    };
}

function replaceTypeInGraph(node, replacements, visited = new Set()) {
    if (!visited.has(node)) {
        visited.add(node);

        switch (node.type) {
            case 'If':
                node.match = replaceTypeInGraph(node.match, replacements, visited);
                node.then = replaceTypeInGraph(node.then, replacements, visited);
                node.else = replaceTypeInGraph(node.else, replacements, visited);
                break;

            case 'Type':
                return replacements[node.name] || node;
        }
    }

    return node;
}

function buildGroupMatchGraph(combinator, terms, atLeastOneTermMatched) {
    switch (combinator) {
        case ' ': {
            // Juxtaposing components means that all of them must occur, in the given order.
            //
            // a b c
            // =
            // match a
            //   then match b
            //     then match c
            //       then MATCH
            //       else MISMATCH
            //     else MISMATCH
            //   else MISMATCH
            let result = MATCH;

            for (let i = terms.length - 1; i >= 0; i--) {
                const term = terms[i];

                result = createCondition(
                    term,
                    result,
                    MISMATCH
                );
            }
            return result;
        }

        case '|': {
            // A bar (|) separates two or more alternatives: exactly one of them must occur.
            //
            // a | b | c
            // =
            // match a
            //   then MATCH
            //   else match b
            //     then MATCH
            //     else match c
            //       then MATCH
            //       else MISMATCH

            let result = MISMATCH;
            let map = null;

            for (let i = terms.length - 1; i >= 0; i--) {
                let term = terms[i];

                // reduce sequence of keywords into a Enum
                if (isEnumCapatible(term)) {
                    if (map === null && i > 0 && isEnumCapatible(terms[i - 1])) {
                        map = Object.create(null);
                        result = createCondition(
                            {
                                type: 'Enum',
                                map
                            },
                            MATCH,
                            result
                        );
                    }

                    if (map !== null) {
                        const key = (isFunctionType(term.name) ? term.name.slice(0, -1) : term.name).toLowerCase();
                        if (key in map === false) {
                            map[key] = term;
                            continue;
                        }
                    }
                }

                map = null;

                // create a new conditonal node
                result = createCondition(
                    term,
                    MATCH,
                    result
                );
            }
            return result;
        }

        case '&&': {
            // A double ampersand (&&) separates two or more components,
            // all of which must occur, in any order.

            // Use MatchOnce for groups with a large number of terms,
            // since &&-groups produces at least N!-node trees
            if (terms.length > 5) {
                return {
                    type: 'MatchOnce',
                    terms,
                    all: true
                };
            }

            // Use a combination tree for groups with small number of terms
            //
            // a && b && c
            // =
            // match a
            //   then [b && c]
            //   else match b
            //     then [a && c]
            //     else match c
            //       then [a && b]
            //       else MISMATCH
            //
            // a && b
            // =
            // match a
            //   then match b
            //     then MATCH
            //     else MISMATCH
            //   else match b
            //     then match a
            //       then MATCH
            //       else MISMATCH
            //     else MISMATCH
            let result = MISMATCH;

            for (let i = terms.length - 1; i >= 0; i--) {
                const term = terms[i];
                let thenClause;

                if (terms.length > 1) {
                    thenClause = buildGroupMatchGraph(
                        combinator,
                        terms.filter(function(newGroupTerm) {
                            return newGroupTerm !== term;
                        }),
                        false
                    );
                } else {
                    thenClause = MATCH;
                }

                result = createCondition(
                    term,
                    thenClause,
                    result
                );
            }
            return result;
        }

        case '||': {
            // A double bar (||) separates two or more options:
            // one or more of them must occur, in any order.

            // Use MatchOnce for groups with a large number of terms,
            // since ||-groups produces at least N!-node trees
            if (terms.length > 5) {
                return {
                    type: 'MatchOnce',
                    terms,
                    all: false
                };
            }

            // Use a combination tree for groups with small number of terms
            //
            // a || b || c
            // =
            // match a
            //   then [b || c]
            //   else match b
            //     then [a || c]
            //     else match c
            //       then [a || b]
            //       else MISMATCH
            //
            // a || b
            // =
            // match a
            //   then match b
            //     then MATCH
            //     else MATCH
            //   else match b
            //     then match a
            //       then MATCH
            //       else MATCH
            //     else MISMATCH
            let result = atLeastOneTermMatched ? MATCH : MISMATCH;

            for (let i = terms.length - 1; i >= 0; i--) {
                const term = terms[i];
                let thenClause;

                if (terms.length > 1) {
                    thenClause = buildGroupMatchGraph(
                        combinator,
                        terms.filter(function(newGroupTerm) {
                            return newGroupTerm !== term;
                        }),
                        true
                    );
                } else {
                    thenClause = MATCH;
                }

                result = createCondition(
                    term,
                    thenClause,
                    result
                );
            }
            return result;
        }
    }
}

function buildMultiplierMatchGraph(node) {
    let result = MATCH;
    let matchTerm = buildMatchGraphInternal(node.term);

    if (node.max === 0) {
        // disable repeating of empty match to prevent infinite loop
        matchTerm = createCondition(
            matchTerm,
            DISALLOW_EMPTY,
            MISMATCH
        );

        // an occurrence count is not limited, make a cycle;
        // to collect more terms on each following matching mismatch
        result = createCondition(
            matchTerm,
            null, // will be a loop
            MISMATCH
        );

        result.then = createCondition(
            MATCH,
            MATCH,
            result // make a loop
        );

        if (node.comma) {
            result.then.else = createCondition(
                { type: 'Comma', syntax: node },
                result,
                MISMATCH
            );
        }
    } else {
        // create a match node chain for [min .. max] interval with optional matches
        for (let i = node.min || 1; i <= node.max; i++) {
            if (node.comma && result !== MATCH) {
                result = createCondition(
                    { type: 'Comma', syntax: node },
                    result,
                    MISMATCH
                );
            }

            result = createCondition(
                matchTerm,
                createCondition(
                    MATCH,
                    MATCH,
                    result
                ),
                MISMATCH
            );
        }
    }

    if (node.min === 0) {
        // allow zero match
        result = createCondition(
            MATCH,
            MATCH,
            result
        );
    } else {
        // create a match node chain to collect [0 ... min - 1] required matches
        for (let i = 0; i < node.min - 1; i++) {
            if (node.comma && result !== MATCH) {
                result = createCondition(
                    { type: 'Comma', syntax: node },
                    result,
                    MISMATCH
                );
            }

            result = createCondition(
                matchTerm,
                result,
                MISMATCH
            );
        }
    }

    return result;
}

function buildMatchGraphInternal(node) {
    if (typeof node === 'function') {
        return {
            type: 'Generic',
            fn: node
        };
    }

    switch (node.type) {
        case 'Group': {
            let result = buildGroupMatchGraph(
                node.combinator,
                node.terms.map(buildMatchGraphInternal),
                false
            );

            if (node.disallowEmpty) {
                result = createCondition(
                    result,
                    DISALLOW_EMPTY,
                    MISMATCH
                );
            }

            return result;
        }

        case 'Multiplier':
            return buildMultiplierMatchGraph(node);

        // https://drafts.csswg.org/css-values-5/#boolean
        case 'Boolean': {
            const term = buildMatchGraphInternal(node.term);
            // <boolean-expr[ <test> ]> = not <boolean-expr-group> | <boolean-expr-group> [ [ and <boolean-expr-group> ]* | [ or <boolean-expr-group> ]* ]
            const matchNode = buildMatchGraphInternal(groupNode([
                groupNode([
                    { type: 'Keyword', name: 'not' },
                    { type: 'Type', name: '!boolean-group' }
                ]),
                groupNode([
                    { type: 'Type', name: '!boolean-group' },
                    groupNode([
                        { type: 'Multiplier', comma: false, min: 0, max: 0, term: groupNode([
                            { type: 'Keyword', name: 'and' },
                            { type: 'Type', name: '!boolean-group' }
                        ]) },
                        { type: 'Multiplier', comma: false, min: 0, max: 0, term: groupNode([
                            { type: 'Keyword', name: 'or' },
                            { type: 'Type', name: '!boolean-group' }
                        ]) }
                    ], '|')
                ])
            ], '|'));
            // <boolean-expr-group> = <test> | ( <boolean-expr[ <test> ]> ) | <general-enclosed>
            const booleanGroup = buildMatchGraphInternal(
                groupNode([
                    { type: 'Type', name: '!term' },
                    groupNode([
                        { type: 'Token', value: '(' },
                        { type: 'Type', name: '!self' },
                        { type: 'Token', value: ')' }
                    ]),
                    { type: 'Type', name: 'general-enclosed' }
                ], '|')
            );

            replaceTypeInGraph(booleanGroup, { '!term': term, '!self': matchNode });
            replaceTypeInGraph(matchNode, { '!boolean-group': booleanGroup });

            return matchNode;
        }

        case 'Type':
        case 'Property':
            return {
                type: node.type,
                name: node.name,
                syntax: node
            };

        case 'Keyword':
            return {
                type: node.type,
                name: node.name.toLowerCase(),
                syntax: node
            };

        case 'AtKeyword':
            return {
                type: node.type,
                name: '@' + node.name.toLowerCase(),
                syntax: node
            };

        case 'Function':
            return {
                type: node.type,
                name: node.name.toLowerCase() + '(',
                syntax: node
            };

        case 'String':
            // convert a one char length String to a Token
            if (node.value.length === 3) {
                return {
                    type: 'Token',
                    value: node.value.charAt(1),
                    syntax: node
                };
            }

            // otherwise use it as is
            return {
                type: node.type,
                value: node.value.substr(1, node.value.length - 2).replace(/\\'/g, '\''),
                syntax: node
            };

        case 'Token':
            return {
                type: node.type,
                value: node.value,
                syntax: node
            };

        case 'Comma':
            return {
                type: node.type,
                syntax: node
            };

        default:
            throw new Error('Unknown node type:', node.type);
    }
}

function buildMatchGraph(syntaxTree, ref) {
    if (typeof syntaxTree === 'string') {
        syntaxTree = parse.parse(syntaxTree);
    }

    return {
        type: 'MatchGraph',
        match: buildMatchGraphInternal(syntaxTree),
        syntax: ref || null,
        source: syntaxTree
    };
}

exports.DISALLOW_EMPTY = DISALLOW_EMPTY;
exports.MATCH = MATCH;
exports.MISMATCH = MISMATCH;
exports.buildMatchGraph = buildMatchGraph;
jE2	xNM'use strict';

const matchGraph = require('./match-graph.cjs');
const types = require('../tokenizer/types.cjs');

const { hasOwnProperty } = Object.prototype;
const STUB = 0;
const TOKEN = 1;
const OPEN_SYNTAX = 2;
const CLOSE_SYNTAX = 3;

const EXIT_REASON_MATCH = 'Match';
const EXIT_REASON_MISMATCH = 'Mismatch';
const EXIT_REASON_ITERATION_LIMIT = 'Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)';

const ITERATION_LIMIT = 150000;

function reverseList(list) {
    let prev = null;
    let next = null;
    let item = list;

    while (item !== null) {
        next = item.prev;
        item.prev = prev;
        prev = item;
        item = next;
    }

    return prev;
}

function areStringsEqualCaseInsensitive(testStr, referenceStr) {
    if (testStr.length !== referenceStr.length) {
        return false;
    }

    for (let i = 0; i < testStr.length; i++) {
        const referenceCode = referenceStr.charCodeAt(i);
        let testCode = testStr.charCodeAt(i);

        // testCode.toLowerCase() for U+0041 LATIN CAPITAL LETTER A (A) .. U+005A LATIN CAPITAL LETTER Z (Z).
        if (testCode >= 0x0041 && testCode <= 0x005A) {
            testCode = testCode | 32;
        }

        if (testCode !== referenceCode) {
            return false;
        }
    }

    return true;
}

function isContextEdgeDelim(token) {
    if (token.type !== types.Delim) {
        return false;
    }

    // Fix matching for unicode-range: U+30??, U+FF00-FF9F
    // Probably we need to check out previous match instead
    return token.value !== '?';
}

function isCommaContextStart(token) {
    if (token === null) {
        return true;
    }

    return (
        token.type === types.Comma ||
        token.type === types.Function ||
        token.type === types.LeftParenthesis ||
        token.type === types.LeftSquareBracket ||
        token.type === types.LeftCurlyBracket ||
        isContextEdgeDelim(token)
    );
}

function isCommaContextEnd(token) {
    if (token === null) {
        return true;
    }

    return (
        token.type === types.RightParenthesis ||
        token.type === types.RightSquareBracket ||
        token.type === types.RightCurlyBracket ||
        (token.type === types.Delim && token.value === '/')
    );
}

function internalMatch(tokens, state, syntaxes) {
    function moveToNextToken() {
        do {
            tokenIndex++;
            token = tokenIndex < tokens.length ? tokens[tokenIndex] : null;
        } while (token !== null && (token.type === types.WhiteSpace || token.type === types.Comment));
    }

    function getNextToken(offset) {
        const nextIndex = tokenIndex + offset;

        return nextIndex < tokens.length ? tokens[nextIndex] : null;
    }

    function stateSnapshotFromSyntax(nextState, prev) {
        return {
            nextState,
            matchStack,
            syntaxStack,
            thenStack,
            tokenIndex,
            prev
        };
    }

    function pushThenStack(nextState) {
        thenStack = {
            nextState,
            matchStack,
            syntaxStack,
            prev: thenStack
        };
    }

    function pushElseStack(nextState) {
        elseStack = stateSnapshotFromSyntax(nextState, elseStack);
    }

    function addTokenToMatch() {
        matchStack = {
            type: TOKEN,
            syntax: state.syntax,
            token,
            prev: matchStack
        };

        moveToNextToken();
        syntaxStash = null;

        if (tokenIndex > longestMatch) {
            longestMatch = tokenIndex;
        }
    }

    function openSyntax() {
        syntaxStack = {
            syntax: state.syntax,
            opts: state.syntax.opts || (syntaxStack !== null && syntaxStack.opts) || null,
            prev: syntaxStack
        };

        matchStack = {
            type: OPEN_SYNTAX,
            syntax: state.syntax,
            token: matchStack.token,
            prev: matchStack
        };
    }

    function closeSyntax() {
        if (matchStack.type === OPEN_SYNTAX) {
            matchStack = matchStack.prev;
        } else {
            matchStack = {
                type: CLOSE_SYNTAX,
                syntax: syntaxStack.syntax,
                token: matchStack.token,
                prev: matchStack
            };
        }

        syntaxStack = syntaxStack.prev;
    }

    let syntaxStack = null;
    let thenStack = null;
    let elseStack = null;

    // null – stashing allowed, nothing stashed
    // false – stashing disabled, nothing stashed
    // anithing else – fail stashable syntaxes, some syntax stashed
    let syntaxStash = null;

    let iterationCount = 0; // count iterations and prevent infinite loop
    let exitReason = null;

    let token = null;
    let tokenIndex = -1;
    let longestMatch = 0;
    let matchStack = {
        type: STUB,
        syntax: null,
        token: null,
        prev: null
    };

    moveToNextToken();

    while (exitReason === null && ++iterationCount < ITERATION_LIMIT) {
        // function mapList(list, fn) {
        //     const result = [];
        //     while (list) {
        //         result.unshift(fn(list));
        //         list = list.prev;
        //     }
        //     return result;
        // }
        // console.log('--\n',
        //     '#' + iterationCount,
        //     require('util').inspect({
        //         match: mapList(matchStack, x => x.type === TOKEN ? x.token && x.token.value : x.syntax ? ({ [OPEN_SYNTAX]: '<', [CLOSE_SYNTAX]: '</' }[x.type] || x.type) + '!' + x.syntax.name : null),
        //         token: token && token.value,
        //         tokenIndex,
        //         syntax: syntax.type + (syntax.id ? ' #' + syntax.id : '')
        //     }, { depth: null })
        // );
        switch (state.type) {
            case 'Match':
                if (thenStack === null) {
                    // turn to MISMATCH when some tokens left unmatched
                    if (token !== null) {
                        // doesn't mismatch if just one token left and it's an IE hack
                        if (tokenIndex !== tokens.length - 1 || (token.value !== '\\0' && token.value !== '\\9')) {
                            state = matchGraph.MISMATCH;
                            break;
                        }
                    }

                    // break the main loop, return a result - MATCH
                    exitReason = EXIT_REASON_MATCH;
                    break;
                }

                // go to next syntax (`then` branch)
                state = thenStack.nextState;

                // check match is not empty
                if (state === matchGraph.DISALLOW_EMPTY) {
                    if (thenStack.matchStack === matchStack) {
                        state = matchGraph.MISMATCH;
                        break;
                    } else {
                        state = matchGraph.MATCH;
                    }
                }

                // close syntax if needed
                while (thenStack.syntaxStack !== syntaxStack) {
                    closeSyntax();
                }

                // pop stack
                thenStack = thenStack.prev;
                break;

            case 'Mismatch':
                // when some syntax is stashed
                if (syntaxStash !== null && syntaxStash !== false) {
                    // there is no else branches or a branch reduce match stack
                    if (elseStack === null || tokenIndex > elseStack.tokenIndex) {
                        // restore state from the stash
                        elseStack = syntaxStash;
                        syntaxStash = false; // disable stashing
                    }
                } else if (elseStack === null) {
                    // no else branches -> break the main loop
                    // return a result - MISMATCH
                    exitReason = EXIT_REASON_MISMATCH;
                    break;
                }

                // go to next syntax (`else` branch)
                state = elseStack.nextState;

                // restore all the rest stack states
                thenStack = elseStack.thenStack;
                syntaxStack = elseStack.syntaxStack;
                matchStack = elseStack.matchStack;
                tokenIndex = elseStack.tokenIndex;
                token = tokenIndex < tokens.length ? tokens[tokenIndex] : null;

                // pop stack
                elseStack = elseStack.prev;
                break;

            case 'MatchGraph':
                state = state.match;
                break;

            case 'If':
                // IMPORTANT: else stack push must go first,
                // since it stores the state of thenStack before changes
                if (state.else !== matchGraph.MISMATCH) {
                    pushElseStack(state.else);
                }

                if (state.then !== matchGraph.MATCH) {
                    pushThenStack(state.then);
                }

                state = state.match;
                break;

            case 'MatchOnce':
                state = {
                    type: 'MatchOnceBuffer',
                    syntax: state,
                    index: 0,
                    mask: 0
                };
                break;

            case 'MatchOnceBuffer': {
                const terms = state.syntax.terms;

                if (state.index === terms.length) {
                    // no matches at all or it's required all terms to be matched
                    if (state.mask === 0 || state.syntax.all) {
                        state = matchGraph.MISMATCH;
                        break;
                    }

                    // a partial match is ok
                    state = matchGraph.MATCH;
                    break;
                }

                // all terms are matched
                if (state.mask === (1 << terms.length) - 1) {
                    state = matchGraph.MATCH;
                    break;
                }

                for (; state.index < terms.length; state.index++) {
                    const matchFlag = 1 << state.index;

                    if ((state.mask & matchFlag) === 0) {
                        // IMPORTANT: else stack push must go first,
                        // since it stores the state of thenStack before changes
                        pushElseStack(state);
                        pushThenStack({
                            type: 'AddMatchOnce',
                            syntax: state.syntax,
                            mask: state.mask | matchFlag
                        });

                        // match
                        state = terms[state.index++];
                        break;
                    }
                }
                break;
            }

            case 'AddMatchOnce':
                state = {
                    type: 'MatchOnceBuffer',
                    syntax: state.syntax,
                    index: 0,
                    mask: state.mask
                };
                break;

            case 'Enum':
                if (token !== null) {
                    let name = token.value.toLowerCase();

                    // drop \0 and \9 hack from keyword name
                    if (name.indexOf('\\') !== -1) {
                        name = name.replace(/\\[09].*$/, '');
                    }

                    if (hasOwnProperty.call(state.map, name)) {
                        state = state.map[name];
                        break;
                    }
                }

                state = matchGraph.MISMATCH;
                break;

            case 'Generic': {
                const opts = syntaxStack !== null ? syntaxStack.opts : null;
                const lastTokenIndex = tokenIndex + Math.floor(state.fn(token, getNextToken, opts));

                if (!isNaN(lastTokenIndex) && lastTokenIndex > tokenIndex) {
                    while (tokenIndex < lastTokenIndex) {
                        addTokenToMatch();
                    }

                    state = matchGraph.MATCH;
                } else {
                    state = matchGraph.MISMATCH;
                }

                break;
            }

            case 'Type':
            case 'Property': {
                const syntaxDict = state.type === 'Type' ? 'types' : 'properties';
                const dictSyntax = hasOwnProperty.call(syntaxes, syntaxDict) ? syntaxes[syntaxDict][state.name] : null;

                if (!dictSyntax || !dictSyntax.match) {
                    throw new Error(
                        'Bad syntax reference: ' +
                        (state.type === 'Type'
                            ? '<' + state.name + '>'
                            : '<\'' + state.name + '\'>')
                    );
                }

                // stash a syntax for types with low priority
                if (syntaxStash !== false && token !== null && state.type === 'Type') {
                    const lowPriorityMatching =
                        // https://drafts.csswg.org/css-values-4/#custom-idents
                        // When parsing positionally-ambiguous keywords in a property value, a <custom-ident> production
                        // can only claim the keyword if no other unfulfilled production can claim it.
                        (state.name === 'custom-ident' && token.type === types.Ident) ||

                        // https://drafts.csswg.org/css-values-4/#lengths
                        // ... if a `0` could be parsed as either a <number> or a <length> in a property (such as line-height),
                        // it must parse as a <number>
                        (state.name === 'length' && token.value === '0');

                    if (lowPriorityMatching) {
                        if (syntaxStash === null) {
                            syntaxStash = stateSnapshotFromSyntax(state, elseStack);
                        }

                        state = matchGraph.MISMATCH;
                        break;
                    }
                }

                openSyntax();
                state = dictSyntax.matchRef || dictSyntax.match;
                break;
            }

            case 'Keyword': {
                const name = state.name;

                if (token !== null) {
                    let keywordName = token.value;

                    // drop \0 and \9 hack from keyword name
                    if (keywordName.indexOf('\\') !== -1) {
                        keywordName = keywordName.replace(/\\[09].*$/, '');
                    }

                    if (areStringsEqualCaseInsensitive(keywordName, name)) {
                        addTokenToMatch();
                        state = matchGraph.MATCH;
                        break;
                    }
                }

                state = matchGraph.MISMATCH;
                break;
            }

            case 'AtKeyword':
            case 'Function':
                if (token !== null && areStringsEqualCaseInsensitive(token.value, state.name)) {
                    addTokenToMatch();
                    state = matchGraph.MATCH;
                    break;
                }

                state = matchGraph.MISMATCH;
                break;

            case 'Token':
                if (token !== null && token.value === state.value) {
                    addTokenToMatch();
                    state = matchGraph.MATCH;
                    break;
                }

                state = matchGraph.MISMATCH;
                break;

            case 'Comma':
                if (token !== null && token.type === types.Comma) {
                    if (isCommaContextStart(matchStack.token)) {
                        state = matchGraph.MISMATCH;
                    } else {
                        addTokenToMatch();
                        state = isCommaContextEnd(token) ? matchGraph.MISMATCH : matchGraph.MATCH;
                    }
                } else {
                    state = isCommaContextStart(matchStack.token) || isCommaContextEnd(token) ? matchGraph.MATCH : matchGraph.MISMATCH;
                }

                break;

            case 'String':
                let string = '';
                let lastTokenIndex = tokenIndex;

                for (; lastTokenIndex < tokens.length && string.length < state.value.length; lastTokenIndex++) {
                    string += tokens[lastTokenIndex].value;
                }

                if (areStringsEqualCaseInsensitive(string, state.value)) {
                    while (tokenIndex < lastTokenIndex) {
                        addTokenToMatch();
                    }

                    state = matchGraph.MATCH;
                } else {
                    state = matchGraph.MISMATCH;
                }

                break;

            default:
                throw new Error('Unknown node type: ' + state.type);
        }
    }

    switch (exitReason) {
        case null:
            console.warn('[csstree-match] BREAK after ' + ITERATION_LIMIT + ' iterations');
            exitReason = EXIT_REASON_ITERATION_LIMIT;
            matchStack = null;
            break;

        case EXIT_REASON_MATCH:
            while (syntaxStack !== null) {
                closeSyntax();
            }
            break;

        default:
            matchStack = null;
    }

    return {
        tokens,
        reason: exitReason,
        iterations: iterationCount,
        match: matchStack,
        longestMatch
    };
}

function matchAsList(tokens, matchGraph, syntaxes) {
    const matchResult = internalMatch(tokens, matchGraph, syntaxes || {});

    if (matchResult.match !== null) {
        let item = reverseList(matchResult.match).prev;

        matchResult.match = [];

        while (item !== null) {
            switch (item.type) {
                case OPEN_SYNTAX:
                case CLOSE_SYNTAX:
                    matchResult.match.push({
                        type: item.type,
                        syntax: item.syntax
                    });
                    break;

                default:
                    matchResult.match.push({
                        token: item.token.value,
                        node: item.token.node
                    });
                    break;
            }

            item = item.prev;
        }
    }

    return matchResult;
}

function matchAsTree(tokens, matchGraph, syntaxes) {
    const matchResult = internalMatch(tokens, matchGraph, syntaxes || {});

    if (matchResult.match === null) {
        return matchResult;
    }

    let item = matchResult.match;
    let host = matchResult.match = {
        syntax: matchGraph.syntax || null,
        match: []
    };
    const hostStack = [host];

    // revert a list and start with 2nd item since 1st is a stub item
    item = reverseList(item).prev;

    // build a tree
    while (item !== null) {
        switch (item.type) {
            case OPEN_SYNTAX:
                host.match.push(host = {
                    syntax: item.syntax,
                    match: []
                });
                hostStack.push(host);
                break;

            case CLOSE_SYNTAX:
                hostStack.pop();
                host = hostStack[hostStack.length - 1];
                break;

            default:
                host.match.push({
                    syntax: item.syntax || null,
                    token: item.token.value,
                    node: item.token.node
                });
        }

        item = item.prev;
    }

    return matchResult;
}

exports.matchAsList = matchAsList;
exports.matchAsTree = matchAsTree;
TLx:'use strict';

const getTokenizer = require('../utils/get-tokenizer.cjs');

const astToTokens = {
    decorator(handlers) {
        const tokens = [];
        let curNode = null;

        return {
            ...handlers,
            node(node) {
                const tmp = curNode;
                curNode = node;
                handlers.node.call(this, node);
                curNode = tmp;
            },
            emit(value, type, auto) {
                tokens.push({
                    type,
                    value,
                    node: auto ? null : curNode
                });
            },
            result() {
                return tokens;
            }
        };
    }
};

function stringToTokens(str, syntax) {
    const tokens = [];
    const tokenize = getTokenizer.getTokenizer(syntax);

    tokenize(str, (type, start, end) =>
        tokens.push({
            type,
            value: str.slice(start, end),
            node: null
        })
    );

    return tokens;
}

function prepareTokens(value, syntax) {
    if (typeof value === 'string') {
        return stringToTokens(value, syntax);
    }

    return syntax.generate(value, astToTokens);
}

module.exports = prepareTokens;
kO6fxg'use strict';

const List = require('../utils/List.cjs');

function getFirstMatchNode(matchNode) {
    if ('node' in matchNode) {
        return matchNode.node;
    }

    return getFirstMatchNode(matchNode.match[0]);
}

function getLastMatchNode(matchNode) {
    if ('node' in matchNode) {
        return matchNode.node;
    }

    return getLastMatchNode(matchNode.match[matchNode.match.length - 1]);
}

function matchFragments(lexer, ast, match, type, name) {
    function findFragments(matchNode) {
        if (matchNode.syntax !== null &&
            matchNode.syntax.type === type &&
            matchNode.syntax.name === name) {
            const start = getFirstMatchNode(matchNode);
            const end = getLastMatchNode(matchNode);

            lexer.syntax.walk(ast, function(node, item, list) {
                if (node === start) {
                    const nodes = new List.List();

                    do {
                        nodes.appendData(item.data);

                        if (item.data === end) {
                            break;
                        }

                        item = item.next;
                    } while (item !== null);

                    fragments.push({
                        parent: list,
                        nodes
                    });
                }
            });
        }

        if (Array.isArray(matchNode.match)) {
            matchNode.match.forEach(findFragments);
        }
    }

    const fragments = [];

    if (match.matched !== null) {
        findFragments(match.matched);
    }

    return fragments;
}

exports.matchFragments = matchFragments;
O0x2'use strict';

const List = require('../utils/List.cjs');

const { hasOwnProperty } = Object.prototype;

function isValidNumber(value) {
    // Number.isInteger(value) && value >= 0
    return (
        typeof value === 'number' &&
        isFinite(value) &&
        Math.floor(value) === value &&
        value >= 0
    );
}

function isValidLocation(loc) {
    return (
        Boolean(loc) &&
        isValidNumber(loc.offset) &&
        isValidNumber(loc.line) &&
        isValidNumber(loc.column)
    );
}

function createNodeStructureChecker(type, fields) {
    return function checkNode(node, warn) {
        if (!node || node.constructor !== Object) {
            return warn(node, 'Type of node should be an Object');
        }

        for (let key in node) {
            let valid = true;

            if (hasOwnProperty.call(node, key) === false) {
                continue;
            }

            if (key === 'type') {
                if (node.type !== type) {
                    warn(node, 'Wrong node type `' + node.type + '`, expected `' + type + '`');
                }
            } else if (key === 'loc') {
                if (node.loc === null) {
                    continue;
                } else if (node.loc && node.loc.constructor === Object) {
                    if (typeof node.loc.source !== 'string') {
                        key += '.source';
                    } else if (!isValidLocation(node.loc.start)) {
                        key += '.start';
                    } else if (!isValidLocation(node.loc.end)) {
                        key += '.end';
                    } else {
                        continue;
                    }
                }

                valid = false;
            } else if (fields.hasOwnProperty(key)) {
                valid = false;

                for (let i = 0; !valid && i < fields[key].length; i++) {
                    const fieldType = fields[key][i];

                    switch (fieldType) {
                        case String:
                            valid = typeof node[key] === 'string';
                            break;

                        case Boolean:
                            valid = typeof node[key] === 'boolean';
                            break;

                        case null:
                            valid = node[key] === null;
                            break;

                        default:
                            if (typeof fieldType === 'string') {
                                valid = node[key] && node[key].type === fieldType;
                            } else if (Array.isArray(fieldType)) {
                                valid = node[key] instanceof List.List;
                            }
                    }
                }
            } else {
                warn(node, 'Unknown field `' + key + '` for ' + type + ' node type');
            }

            if (!valid) {
                warn(node, 'Bad value for `' + type + '.' + key + '`');
            }
        }

        for (const key in fields) {
            if (hasOwnProperty.call(fields, key) &&
                hasOwnProperty.call(node, key) === false) {
                warn(node, 'Field `' + type + '.' + key + '` is missed');
            }
        }
    };
}

function genTypesList(fieldTypes, path) {
    const docsTypes = [];

    for (let i = 0; i < fieldTypes.length; i++) {
        const fieldType = fieldTypes[i];
        if (fieldType === String || fieldType === Boolean) {
            docsTypes.push(fieldType.name.toLowerCase());
        } else if (fieldType === null) {
            docsTypes.push('null');
        } else if (typeof fieldType === 'string') {
            docsTypes.push(fieldType);
        } else if (Array.isArray(fieldType)) {
            docsTypes.push('List<' + (genTypesList(fieldType, path) || 'any') + '>'); // TODO: use type enum
        } else {
            throw new Error('Wrong value `' + fieldType + '` in `' + path + '` structure definition');
        }
    }

    return docsTypes.join(' | ');
}

function processStructure(name, nodeType) {
    const structure = nodeType.structure;
    const fields = {
        type: String,
        loc: true
    };
    const docs = {
        type: '"' + name + '"'
    };

    for (const key in structure) {
        if (hasOwnProperty.call(structure, key) === false) {
            continue;
        }

        const fieldTypes = fields[key] = Array.isArray(structure[key])
            ? structure[key].slice()
            : [structure[key]];

        docs[key] = genTypesList(fieldTypes, name + '.' + key);
    }

    return {
        docs,
        check: createNodeStructureChecker(name, fields)
    };
}

function getStructureFromConfig(config) {
    const structure = {};

    if (config.node) {
        for (const name in config.node) {
            if (hasOwnProperty.call(config.node, name)) {
                const nodeType = config.node[name];

                if (nodeType.structure) {
                    structure[name] = processStructure(name, nodeType);
                } else {
                    throw new Error('Missed `structure` field in `' + name + '` node type definition');
                }
            }
        }
    }

    return structure;
}

exports.getStructureFromConfig = getStructureFromConfig;
=mx/'use strict';

function getTrace(node) {
    function shouldPutToTrace(syntax) {
        if (syntax === null) {
            return false;
        }

        return (
            syntax.type === 'Type' ||
            syntax.type === 'Property' ||
            syntax.type === 'Keyword'
        );
    }

    function hasMatch(matchNode) {
        if (Array.isArray(matchNode.match)) {
            // use for-loop for better perfomance
            for (let i = 0; i < matchNode.match.length; i++) {
                if (hasMatch(matchNode.match[i])) {
                    if (shouldPutToTrace(matchNode.syntax)) {
                        result.unshift(matchNode.syntax);
                    }

                    return true;
                }
            }
        } else if (matchNode.node === node) {
            result = shouldPutToTrace(matchNode.syntax)
                ? [matchNode.syntax]
                : [];

            return true;
        }

        return false;
    }

    let result = null;

    if (this.matched !== null) {
        hasMatch(this.matched);
    }

    return result;
}

function isType(node, type) {
    return testNode(this, node, match => match.type === 'Type' && match.name === type);
}

function isProperty(node, property) {
    return testNode(this, node, match => match.type === 'Property' && match.name === property);
}

function isKeyword(node) {
    return testNode(this, node, match => match.type === 'Keyword');
}

function testNode(match, node, fn) {
    const trace = getTrace.call(match, node);

    if (trace === null) {
        return false;
    }

    return trace.some(fn);
}

exports.getTrace = getTrace;
exports.isKeyword = isKeyword;
exports.isProperty = isProperty;
exports.isType = isType;
R3kxO'use strict';

const length = [
    // absolute length units https://www.w3.org/TR/css-values-3/#lengths
    'cm', 'mm', 'q', 'in', 'pt', 'pc', 'px',
    // font-relative length units https://drafts.csswg.org/css-values-4/#font-relative-lengths
    'em', 'rem',
    'ex', 'rex',
    'cap', 'rcap',
    'ch', 'rch',
    'ic', 'ric',
    'lh', 'rlh',
    // viewport-percentage lengths https://drafts.csswg.org/css-values-4/#viewport-relative-lengths
    'vw', 'svw', 'lvw', 'dvw',
    'vh', 'svh', 'lvh', 'dvh',
    'vi', 'svi', 'lvi', 'dvi',
    'vb', 'svb', 'lvb', 'dvb',
    'vmin', 'svmin', 'lvmin', 'dvmin',
    'vmax', 'svmax', 'lvmax', 'dvmax',
    // container relative lengths https://drafts.csswg.org/css-contain-3/#container-lengths
    'cqw', 'cqh', 'cqi', 'cqb', 'cqmin', 'cqmax'
];
const angle = ['deg', 'grad', 'rad', 'turn'];    // https://www.w3.org/TR/css-values-3/#angles
const time = ['s', 'ms'];                        // https://www.w3.org/TR/css-values-3/#time
const frequency = ['hz', 'khz'];                 // https://www.w3.org/TR/css-values-3/#frequency
const resolution = ['dpi', 'dpcm', 'dppx', 'x']; // https://www.w3.org/TR/css-values-3/#resolution
const flex = ['fr'];                             // https://drafts.csswg.org/css-grid/#fr-unit
const decibel = ['db'];                          // https://www.w3.org/TR/css3-speech/#mixing-props-voice-volume
const semitones = ['st'];                        // https://www.w3.org/TR/css3-speech/#voice-props-voice-pitch

exports.angle = angle;
exports.decibel = decibel;
exports.flex = flex;
exports.frequency = frequency;
exports.length = length;
exports.resolution = resolution;
exports.semitones = semitones;
exports.time = time;
dyx 3100644 SyntaxError.cjs M9B 5e Ax%100644 create.cjs 印:{Yn]%100644 index.cjs PÃ6ˆ	(~100644 parse-selector.cjs !ze.100644 sequence.cjs қy7-""jP~x1
'use strict';

const createCustomError = require('../utils/create-custom-error.cjs');

const MAX_LINE_LENGTH = 100;
const OFFSET_CORRECTION = 60;
const TAB_REPLACEMENT = '    ';

function sourceFragment({ source, line, column, baseLine, baseColumn }, extraLines) {
    function processLines(start, end) {
        return lines
            .slice(start, end)
            .map((line, idx) =>
                String(start + idx + 1).padStart(maxNumLength) + ' |' + line
            ).join('\n');
    }

    const prelines = '\n'.repeat(Math.max(baseLine - 1, 0));
    const precolumns = ' '.repeat(Math.max(baseColumn - 1, 0));
    const lines = (prelines + precolumns + source).split(/\r\n?|\n|\f/);
    const startLine = Math.max(1, line - extraLines) - 1;
    const endLine = Math.min(line + extraLines, lines.length + 1);
    const maxNumLength = Math.max(4, String(endLine).length) + 1;
    let cutLeft = 0;

    // column correction according to replaced tab before column
    column += (TAB_REPLACEMENT.length - 1) * (lines[line - 1].substr(0, column - 1).match(/\t/g) || []).length;

    if (column > MAX_LINE_LENGTH) {
        cutLeft = column - OFFSET_CORRECTION + 3;
        column = OFFSET_CORRECTION - 2;
    }

    for (let i = startLine; i <= endLine; i++) {
        if (i >= 0 && i < lines.length) {
            lines[i] = lines[i].replace(/\t/g, TAB_REPLACEMENT);
            lines[i] =
                (cutLeft > 0 && lines[i].length > cutLeft ? '\u2026' : '') +
                lines[i].substr(cutLeft, MAX_LINE_LENGTH - 2) +
                (lines[i].length > cutLeft + MAX_LINE_LENGTH - 1 ? '\u2026' : '');
        }
    }

    return [
        processLines(startLine, line),
        new Array(column + maxNumLength + 2).join('-') + '^',
        processLines(line, endLine)
    ].filter(Boolean)
        .join('\n')
        .replace(/^(\s+\d+\s+\|\n)+/, '')
        .replace(/\n(\s+\d+\s+\|)+$/, '');
}

function SyntaxError(message, source, offset, line, column, baseLine = 1, baseColumn = 1) {
    const error = Object.assign(createCustomError.createCustomError('SyntaxError', message), {
        source,
        offset,
        line,
        column,
        sourceFragment(extraLines) {
            return sourceFragment({ source, line, column, baseLine, baseColumn }, isNaN(extraLines) ? 0 : extraLines);
        },
        get formattedMessage() {
            return (
                `Parse error: ${message}\n` +
                sourceFragment({ source, line, column, baseLine, baseColumn }, 2)
            );
        }
    });

    return error;
}

exports.SyntaxError = SyntaxError;
3nx2g'use strict';

const List = require('../utils/List.cjs');
const SyntaxError = require('./SyntaxError.cjs');
const sequence = require('./sequence.cjs');
const getTokenizer = require('../utils/get-tokenizer.cjs');
const OffsetToLocation = require('../tokenizer/OffsetToLocation.cjs');
const TokenStream = require('../tokenizer/TokenStream.cjs');
const utils = require('../tokenizer/utils.cjs');
const types = require('../tokenizer/types.cjs');
const names = require('../tokenizer/names.cjs');

const NOOP = () => {};
const EXCLAMATIONMARK = 0x0021;  // U+0021 EXCLAMATION MARK (!)
const NUMBERSIGN = 0x0023;       // U+0023 NUMBER SIGN (#)
const SEMICOLON = 0x003B;        // U+003B SEMICOLON (;)
const LEFTCURLYBRACKET = 0x007B; // U+007B LEFT CURLY BRACKET ({)
const NULL = 0;

const arrayMethods = {
    createList() {
        return [];
    },
    createSingleNodeList(node) {
        return [node];
    },
    getFirstListNode(list) {
        return list && list[0] || null;
    },
    getLastListNode(list) {
        return list && list.length > 0 ? list[list.length - 1] : null;
    }
};

const listMethods = {
    createList() {
        return new List.List();
    },
    createSingleNodeList(node) {
        return new List.List().appendData(node);
    },
    getFirstListNode(list) {
        return list && list.first;
    },
    getLastListNode(list) {
        return list && list.last;
    }
};

function createParseContext(name) {
    return function() {
        return this[name]();
    };
}

function fetchParseValues(dict) {
    const result = Object.create(null);

    for (const name of Object.keys(dict)) {
        const item = dict[name];
        const fn = item.parse || item;

        if (fn) {
            result[name] = fn;
        }
    }

    return result;
}

function processConfig(config) {
    const parseConfig = {
        context: Object.create(null),
        features: Object.assign(Object.create(null), config.features),
        scope: Object.assign(Object.create(null), config.scope),
        atrule: fetchParseValues(config.atrule),
        pseudo: fetchParseValues(config.pseudo),
        node: fetchParseValues(config.node),
        tokenize: getTokenizer.getTokenizer(config)
    };

    for (const [name, context] of Object.entries(config.parseContext)) {
        switch (typeof context) {
            case 'function':
                parseConfig.context[name] = context;
                break;

            case 'string':
                parseConfig.context[name] = createParseContext(context);
                break;
        }
    }

    return {
        config: parseConfig,
        ...parseConfig,
        ...parseConfig.node
    };
}

function createParser(config) {
    let source = '';
    let filename = '<unknown>';
    let needPositions = false;
    let onParseError = NOOP;
    let onParseErrorThrow = false;

    const locationMap = new OffsetToLocation.OffsetToLocation();
    const parser = Object.assign(new TokenStream.TokenStream(), processConfig(config || {}), {
        parseAtrulePrelude: true,
        parseRulePrelude: true,
        parseValue: true,
        parseCustomProperty: false,

        readSequence: sequence.readSequence,

        consumeUntilBalanceEnd: () => 0,
        consumeUntilLeftCurlyBracket(code) {
            return code === LEFTCURLYBRACKET ? 1 : 0;
        },
        consumeUntilLeftCurlyBracketOrSemicolon(code) {
            return code === LEFTCURLYBRACKET || code === SEMICOLON ? 1 : 0;
        },
        consumeUntilExclamationMarkOrSemicolon(code) {
            return code === EXCLAMATIONMARK || code === SEMICOLON ? 1 : 0;
        },
        consumeUntilSemicolonIncluded(code) {
            return code === SEMICOLON ? 2 : 0;
        },

        createList: NOOP,
        createSingleNodeList: NOOP,
        getFirstListNode: NOOP,
        getLastListNode: NOOP,

        parseWithFallback(consumer, fallback) {
            const startIndex = this.tokenIndex;

            try {
                return consumer.call(this);
            } catch (e) {
                if (onParseErrorThrow) {
                    throw e;
                }

                this.skip(startIndex - this.tokenIndex);
                const fallbackNode = fallback.call(this);

                onParseErrorThrow = true;
                onParseError(e, fallbackNode);
                onParseErrorThrow = false;

                return fallbackNode;
            }
        },

        lookupNonWSType(offset) {
            let type;

            do {
                type = this.lookupType(offset++);
                if (type !== types.WhiteSpace && type !== types.Comment) {
                    return type;
                }
            } while (type !== NULL);

            return NULL;
        },

        charCodeAt(offset) {
            return offset >= 0 && offset < source.length ? source.charCodeAt(offset) : 0;
        },
        substring(offsetStart, offsetEnd) {
            return source.substring(offsetStart, offsetEnd);
        },
        substrToCursor(start) {
            return this.source.substring(start, this.tokenStart);
        },

        cmpChar(offset, charCode) {
            return utils.cmpChar(source, offset, charCode);
        },
        cmpStr(offsetStart, offsetEnd, str) {
            return utils.cmpStr(source, offsetStart, offsetEnd, str);
        },

        consume(tokenType) {
            const start = this.tokenStart;

            this.eat(tokenType);

            return this.substrToCursor(start);
        },
        consumeFunctionName() {
            const name = source.substring(this.tokenStart, this.tokenEnd - 1);

            this.eat(types.Function);

            return name;
        },
        consumeNumber(type) {
            const number = source.substring(this.tokenStart, utils.consumeNumber(source, this.tokenStart));

            this.eat(type);

            return number;
        },

        eat(tokenType) {
            if (this.tokenType !== tokenType) {
                const tokenName = names[tokenType].slice(0, -6).replace(/-/g, ' ').replace(/^./, m => m.toUpperCase());
                let message = `${/[[\](){}]/.test(tokenName) ? `"${tokenName}"` : tokenName} is expected`;
                let offset = this.tokenStart;

                // tweak message and offset
                switch (tokenType) {
                    case types.Ident:
                        // when identifier is expected but there is a function or url
                        if (this.tokenType === types.Function || this.tokenType === types.Url) {
                            offset = this.tokenEnd - 1;
                            message = 'Identifier is expected but function found';
                        } else {
                            message = 'Identifier is expected';
                        }
                        break;

                    case types.Hash:
                        if (this.isDelim(NUMBERSIGN)) {
                            this.next();
                            offset++;
                            message = 'Name is expected';
                        }
                        break;

                    case types.Percentage:
                        if (this.tokenType === types.Number) {
                            offset = this.tokenEnd;
                            message = 'Percent sign is expected';
                        }
                        break;
                }

                this.error(message, offset);
            }

            this.next();
        },
        eatIdent(name) {
            if (this.tokenType !== types.Ident || this.lookupValue(0, name) === false) {
                this.error(`Identifier "${name}" is expected`);
            }

            this.next();
        },
        eatDelim(code) {
            if (!this.isDelim(code)) {
                this.error(`Delim "${String.fromCharCode(code)}" is expected`);
            }

            this.next();
        },

        getLocation(start, end) {
            if (needPositions) {
                return locationMap.getLocationRange(
                    start,
                    end,
                    filename
                );
            }

            return null;
        },
        getLocationFromList(list) {
            if (needPositions) {
                const head = this.getFirstListNode(list);
                const tail = this.getLastListNode(list);
                return locationMap.getLocationRange(
                    head !== null ? head.loc.start.offset - locationMap.startOffset : this.tokenStart,
                    tail !== null ? tail.loc.end.offset - locationMap.startOffset : this.tokenStart,
                    filename
                );
            }

            return null;
        },

        error(message, offset) {
            const location = typeof offset !== 'undefined' && offset < source.length
                ? locationMap.getLocation(offset)
                : this.eof
                    ? locationMap.getLocation(utils.findWhiteSpaceStart(source, source.length - 1))
                    : locationMap.getLocation(this.tokenStart);

            throw new SyntaxError.SyntaxError(
                message || 'Unexpected input',
                source,
                location.offset,
                location.line,
                location.column,
                locationMap.startLine,
                locationMap.startColumn
            );
        }
    });
    const createTokenIterateAPI = () => ({
        filename,
        source,
        tokenCount: parser.tokenCount,

        getTokenType: (index) =>
            parser.getTokenType(index),
        getTokenTypeName: (index) =>
            names[parser.getTokenType(index)],
        getTokenStart: (index) =>
            parser.getTokenStart(index),
        getTokenEnd: (index) =>
            parser.getTokenEnd(index),
        getTokenValue: (index) =>
            parser.source.substring(parser.getTokenStart(index), parser.getTokenEnd(index)),

        substring: (start, end) =>
            parser.source.substring(start, end),

        balance: parser.balance.subarray(0, parser.tokenCount + 1),
        isBlockOpenerTokenType: parser.isBlockOpenerTokenType,
        isBlockCloserTokenType: parser.isBlockCloserTokenType,
        getBlockTokenPairIndex: (index) =>
            parser.getBlockTokenPairIndex(index),

        getLocation: (offset) =>
            locationMap.getLocation(offset, filename),
        getRangeLocation: (start, end) =>
            locationMap.getLocationRange(start, end, filename)
    });

    const parse = function(source_, options) {
        source = source_;
        options = options || {};

        parser.setSource(source, parser.tokenize);
        locationMap.setSource(
            source,
            options.offset,
            options.line,
            options.column
        );

        filename = options.filename || '<unknown>';
        needPositions = Boolean(options.positions);
        onParseError = typeof options.onParseError === 'function' ? options.onParseError : NOOP;
        onParseErrorThrow = false;

        parser.parseAtrulePrelude = 'parseAtrulePrelude' in options ? Boolean(options.parseAtrulePrelude) : true;
        parser.parseRulePrelude = 'parseRulePrelude' in options ? Boolean(options.parseRulePrelude) : true;
        parser.parseValue = 'parseValue' in options ? Boolean(options.parseValue) : true;
        parser.parseCustomProperty = 'parseCustomProperty' in options ? Boolean(options.parseCustomProperty) : false;

        const { context = 'default', list = true, onComment, onToken } = options;

        if (context in parser.context === false) {
            throw new Error('Unknown context `' + context + '`');
        }

        Object.assign(parser, list ? listMethods : arrayMethods);

        if (Array.isArray(onToken)) {
            parser.forEachToken((type, start, end) => {
                onToken.push({ type, start, end });
            });
        } else if (typeof onToken === 'function') {
            parser.forEachToken(onToken.bind(createTokenIterateAPI()));
        }

        if (typeof onComment === 'function') {
            parser.forEachToken((type, start, end) => {
                if (type === types.Comment) {
                    const loc = parser.getLocation(start, end);
                    const value = utils.cmpStr(source, end - 2, end, '*/')
                        ? source.slice(start + 2, end - 2)
                        : source.slice(start + 2, end);

                    onComment(value, loc);
                }
            });
        }

        const ast = parser.context[context].call(parser, options);

        if (!parser.eof) {
            parser.error();
        }

        return ast;
    };

    return Object.assign(parse, {
        SyntaxError: SyntaxError.SyntaxError,
        config: parser.config
    });
}

exports.createParser = createParser;
tԳx L'use strict';

const create = require('./create.cjs');
const parser = require('../syntax/config/parser.cjs');

const index = create.createParser(parser);

module.exports = index;
p =hx #'use strict';

const create = require('./create.cjs');
const parserSelector = require('../syntax/config/parser-selector.cjs');

const parseSelector = create.createParser(parserSelector);

module.exports = parseSelector;
.tN @x'use strict';

const types = require('../tokenizer/types.cjs');

function readSequence(recognizer) {
    const children = this.createList();
    let space = false;
    const context = {
        recognizer
    };

    while (!this.eof) {
        switch (this.tokenType) {
            case types.Comment:
                this.next();
                continue;

            case types.WhiteSpace:
                space = true;
                this.next();
                continue;
        }

        let child = recognizer.getNode.call(this, context);

        if (child === undefined) {
            break;
        }

        if (space) {
            if (recognizer.onWhiteSpace) {
                recognizer.onWhiteSpace.call(this, child, children, context);
            }
            space = false;
        }

        children.push(child);
    }

    if (space && recognizer.onWhiteSpace) {
        recognizer.onWhiteSpace.call(this, null, children, context);
    }

    return children;
}

exports.readSequence = readSequence;
$x40000 atrule 5/<JJc>,p40000 config dUR|л@3#100644 create.cjs ׺tg*
p40000 function C܅CꈝILkk100644 index.cjs $IW{B,٨40000 node ZnæO'D}*>S40000 pseudo L/0߭ͭؐ(40000 scope K#|@!1io^qOIp{xU100644 container.cjs tR	Ua]\^o100644 font-face.cjs dnq&jI100644 import.cjs 	s!t1]pV,100644 index.cjs ?!ft鸚2<100644 layer.cjs kC:'EeAvuBl100644 media.cjs >!(z|un!B 100644 nest.cjs \g ҋ4$100644 page.cjs dp+?Bg100644 scope.cjs %"{Yrdg100644 starting-style.cjs ۫wي7aBl100644 supports.cjs =IqIpqX߹oy8x'use strict';

const types = require('../../tokenizer/types.cjs');

// https://drafts.csswg.org/css-contain-3/#container-rule
// The keywords `none`, `and`, `not`, and `or` are excluded from the <custom-ident> above.
const nonContainerNameKeywords = new Set(['none', 'and', 'not', 'or']);

const container = {
    parse: {
        prelude() {
            const children = this.createList();

            if (this.tokenType === types.Ident) {
                const name = this.substring(this.tokenStart, this.tokenEnd);

                if (!nonContainerNameKeywords.has(name.toLowerCase())) {
                    children.push(this.Identifier());
                }
            }

            children.push(this.Condition('container'));

            return children;
        },
        block(nested = false) {
            return this.Block(nested);
        }
    }
};

module.exports = container;
G

x S'use strict';

const fontFace = {
    parse: {
        prelude: null,
        block() {
            return this.Block(true);
        }
    }
};

module.exports = fontFace;
]0<x}
'use strict';

const types = require('../../tokenizer/types.cjs');

function parseWithFallback(parse, fallback) {
    return this.parseWithFallback(
        () => {
            try {
                return parse.call(this);
            } finally {
                this.skipSC();
                if (this.lookupNonWSType(0) !== types.RightParenthesis) {
                    this.error();
                }
            }
        },
        fallback || (() => this.Raw(null, true))
    );
}

const parseFunctions = {
    layer() {
        this.skipSC();

        const children = this.createList();
        const node = parseWithFallback.call(this, this.Layer);

        if (node.type !== 'Raw' || node.value !== '') {
            children.push(node);
        }

        return children;
    },
    supports() {
        this.skipSC();

        const children = this.createList();
        const node = parseWithFallback.call(
            this,
            this.Declaration,
            () => parseWithFallback.call(this, () => this.Condition('supports'))
        );

        if (node.type !== 'Raw' || node.value !== '') {
            children.push(node);
        }

        return children;
    }
};

const importAtrule = {
    parse: {
        prelude() {
            const children = this.createList();

            switch (this.tokenType) {
                case types.String:
                    children.push(this.String());
                    break;

                case types.Url:
                case types.Function:
                    children.push(this.Url());
                    break;

                default:
                    this.error('String or url() is expected');
            }

            this.skipSC();

            if (this.tokenType === types.Ident &&
                this.cmpStr(this.tokenStart, this.tokenEnd, 'layer')) {
                children.push(this.Identifier());
            } else if (
                this.tokenType === types.Function &&
                this.cmpStr(this.tokenStart, this.tokenEnd, 'layer(')
            ) {
                children.push(this.Function(null, parseFunctions));
            }

            this.skipSC();

            if (this.tokenType === types.Function &&
                this.cmpStr(this.tokenStart, this.tokenEnd, 'supports(')) {
                children.push(this.Function(null, parseFunctions));
            }

            if (this.lookupNonWSType(0) === types.Ident ||
                this.lookupNonWSType(0) === types.LeftParenthesis) {
                children.push(this.MediaQueryList());
            }

            return children;
        },
        block: null
    }
};

module.exports = importAtrule;
b.(xz'use strict';

const container = require('./container.cjs');
const fontFace = require('./font-face.cjs');
const _import = require('./import.cjs');
const layer = require('./layer.cjs');
const media = require('./media.cjs');
const nest = require('./nest.cjs');
const page = require('./page.cjs');
const scope = require('./scope.cjs');
const startingStyle = require('./starting-style.cjs');
const supports = require('./supports.cjs');

const atrule = {
    container,
    'font-face': fontFace,
    import: _import,
    layer,
    media,
    nest,
    page,
    scope,
    'starting-style': startingStyle,
    supports
};

module.exports = atrule;
{HxU'use strict';

const layer = {
    parse: {
        prelude() {
            return this.createSingleNodeList(
                this.LayerList()
            );
        },
        block(nested = false, { allowNestedRules = false } = {}) {
            return this.Block(nested, { allowNestedRules });
        }
    }
};

module.exports = layer;
Kj`xZ'use strict';

const media = {
    parse: {
        prelude() {
            return this.createSingleNodeList(
                this.MediaQueryList()
            );
        },
        block(nested = false, { allowNestedRules = false } = {}) {
            return this.Block(nested, { allowNestedRules });
        }
    }
};

module.exports = media;
TbLx'use strict';

const nest = {
    parse: {
        prelude() {
            return this.createSingleNodeList(
                this.SelectorList()
            );
        },
        block() {
            return this.Block(true);
        }
    }
};

module.exports = nest;
.Gx'use strict';

const page = {
    parse: {
        prelude() {
            return this.createSingleNodeList(
                this.SelectorList()
            );
        },
        block() {
            return this.Block(true);
        }
    }
};

module.exports = page;
Fx'use strict';

const scope = {
    parse: {
        prelude() {
            return this.createSingleNodeList(
                this.Scope()
            );
        },
        block(nested = false) {
            return this.Block(nested);
        }
    }
};

module.exports = scope;
DJɶx 9'use strict';

const startingStyle = {
    parse: {
        prelude: null,
        block(nested = false) {
            return this.Block(nested);
        }
    }
};

module.exports = startingStyle;
:x,'use strict';

const supports = {
    parse: {
        prelude() {
            return this.createSingleNodeList(
                this.Condition('supports')
            );
        },
        block(nested = false) {
            return this.Block(nested);
        }
    }
};

module.exports = supports;
HKS@x 100644 generator.cjs Ew/Dp:ޕ100644 lexer.cjs &,kl=4&100644 mix.cjs ,=۷2+@^0F100644 parser-selector.cjs h;Y#4i'`xt100644 parser.cjs R޿qi^4>
y100644 walker.cjs H.Q$J*q^	x l'use strict';

const indexGenerate = require('../node/index-generate.cjs');

const config = {
    node: indexGenerate
};

module.exports = config;
a.1Mx>'use strict';

const genericConst = require('../../lexer/generic-const.cjs');
const data = require('../../data.cjs');
const index = require('../node/index.cjs');

const lexerConfig = {
    generic: true,
    cssWideKeywords: genericConst.cssWideKeywords,
    ...data,
    node: index
};

module.exports = lexerConfig;
ehfx'use strict';

function appendOrSet(a, b) {
    if (typeof b === 'string' && /^\s*\|/.test(b)) {
        return typeof a === 'string'
            ? a + b
            : b.replace(/^\s*\|\s*/, '');
    }

    return b || null;
}

function extractProps(obj, props) {
    const result = Object.create(null);

    for (const prop of Object.keys(obj)) {
        if (props.includes(prop)) {
            result[prop] = obj[prop];
        }
    }

    return result;
}

function mergeDicts(base, ext, fields) {
    const result = { ...base };

    for (const [key, props] of Object.entries(ext)) {
        result[key] = {
            ...result[key],
            ...fields ? extractProps(props, fields) : props
        };
    }

    return result;
}

function mix(dest, src) {
    const result = { ...dest };

    for (const [prop, value] of Object.entries(src)) {
        switch (prop) {
            case 'generic':
                result[prop] = Boolean(value);
                break;

            case 'cssWideKeywords':
                result[prop] = dest[prop]
                    ? [...dest[prop], ...value]
                    : value || [];
                break;

            case 'units':
                result[prop] = { ...dest[prop] };
                for (const [name, patch] of Object.entries(value)) {
                    result[prop][name] = Array.isArray(patch) ? patch : [];
                }
                break;

            case 'atrules':
                result[prop] = { ...dest[prop] };

                for (const [name, atrule] of Object.entries(value)) {
                    const exists = result[prop][name] || {};
                    const current = result[prop][name] = {
                        prelude: exists.prelude || null,
                        descriptors: {
                            ...exists.descriptors
                        }
                    };

                    if (!atrule) {
                        continue;
                    }

                    current.prelude = atrule.prelude
                        ? appendOrSet(current.prelude, atrule.prelude)
                        : current.prelude || null;

                    for (const [descriptorName, descriptorValue] of Object.entries(atrule.descriptors || {})) {
                        current.descriptors[descriptorName] = descriptorValue
                            ? appendOrSet(current.descriptors[descriptorName], descriptorValue)
                            : null;
                    }

                    if (!Object.keys(current.descriptors).length) {
                        current.descriptors = null;
                    }
                }
                break;

            case 'types':
            case 'properties':
                result[prop] = { ...dest[prop] };
                for (const [name, syntax] of Object.entries(value)) {
                    result[prop][name] = appendOrSet(result[prop][name], syntax);
                }
                break;

            case 'parseContext':
                result[prop] = {
                    ...dest[prop],
                    ...value
                };
                break;

            case 'scope':
            case 'features':
                result[prop] = mergeDicts(dest[prop], value);
                break;

            case 'atrule':
            case 'pseudo':
                result[prop] = mergeDicts(dest[prop], value, ['parse']);
                break;

            case 'node':
                result[prop] = mergeDicts(dest[prop], value, ['name', 'structure', 'parse', 'generate', 'walkContext']);
                break;

            case 'tokenize':
                if (typeof value === 'function') {
                    result[prop] = value;
                }
                break;
        }
    }

    return result;
}

module.exports = mix;
{i^x6'use strict';

const index = require('../pseudo/index.cjs');
const indexParseSelector = require('../node/index-parse-selector.cjs');
const selector = require('../scope/selector.cjs');

const config = {
    parseContext: {
        default: 'SelectorList',
        selectorList: 'SelectorList',
        selector: 'Selector'
    },
    scope: { Selector: selector },
    atrule: {},
    pseudo: index,
    node: indexParseSelector
};

module.exports = config;
ΓSx='use strict';

const index = require('../scope/index.cjs');
const index$1 = require('../atrule/index.cjs');
const index$2 = require('../pseudo/index.cjs');
const indexParse = require('../node/index-parse.cjs');
const index$3 = require('../../tokenizer/index.cjs');

const config = {
    parseContext: {
        default: 'StyleSheet',
        stylesheet: 'StyleSheet',
        atrule: 'Atrule',
        atrulePrelude(options) {
            return this.AtrulePrelude(options.atrule ? String(options.atrule) : null);
        },
        mediaQueryList: 'MediaQueryList',
        mediaQuery: 'MediaQuery',
        condition(options) {
            return this.Condition(options.kind);
        },
        rule: 'Rule',
        selectorList: 'SelectorList',
        selector: 'Selector',
        block() {
            return this.Block(true);
        },
        declarationList: 'DeclarationList',
        declaration: 'Declaration',
        value: 'Value'
    },
    features: {
        supports: {
            selector() {
                return this.Selector();
            }
        },
        container: {
            style() {
                return this.Declaration();
            }
        }
    },
    scope: index,
    atrule: index$1,
    pseudo: index$2,
    node: indexParse,
    tokenize: index$3.tokenize
};

module.exports = config;
+Άxz 'use strict';

const index = require('../node/index.cjs');

const config = {
    node: index
};

module.exports = config;
E'lx1'use strict';

const create = require('../parser/create.cjs');
const create$2 = require('../generator/create.cjs');
const create$3 = require('../convertor/create.cjs');
const create$1 = require('../walker/create.cjs');
const Lexer = require('../lexer/Lexer.cjs');
const mix = require('./config/mix.cjs');
const getTokenizer = require('../utils/get-tokenizer.cjs');

function createSyntax(config) {
    const parse = create.createParser(config);
    const walk = create$1.createWalker(config);
    const generate = create$2.createGenerator(config);
    const { fromPlainObject, toPlainObject } = create$3.createConvertor(walk);

    const syntax = {
        lexer: null,
        createLexer: config => new Lexer.Lexer(config, syntax, syntax.lexer.structure),

        tokenize: getTokenizer.getTokenizer(config),
        parse,
        generate,

        walk,
        find: walk.find,
        findLast: walk.findLast,
        findAll: walk.findAll,

        fromPlainObject,
        toPlainObject,

        fork(extension) {
            const base = mix({}, config); // copy of config

            return createSyntax(
                typeof extension === 'function'
                    ? extension(base) // TODO: remove Object.assign as second parameter
                    : mix(base, extension)
            );
        }
    };

    syntax.lexer = new Lexer.Lexer({
        generic: config.generic,
        cssWideKeywords: config.cssWideKeywords,
        units: config.units,
        types: config.types,
        atrules: config.atrules,
        properties: config.properties,
        node: config.node
    }, syntax);

    return syntax;
}
const createSyntax$1 = config => createSyntax(mix({}, config));

module.exports = createSyntax$1;
6xM 100644 expression.cjs Zg=jR_;#$y|100644 var.cjs IJ	!DGx 6'use strict';

// legacy IE function
// expression( <any-value> )
function expressionFn() {
    return this.createSingleNodeList(
        this.Raw(null, false)
    );
}

module.exports = expressionFn;
AHxp'use strict';

const types = require('../../tokenizer/types.cjs');

// var( <ident> , <value>? )
function varFn() {
    const children = this.createList();

    this.skipSC();

    // NOTE: Don't check more than a first argument is an ident, rest checks are for lexer
    children.push(this.Identifier());

    this.skipSC();

    if (this.tokenType === types.Comma) {
        children.push(this.Operator());

        const startIndex = this.tokenIndex;
        const value = this.parseCustomProperty
            ? this.Value(null)
            : this.Raw(this.consumeUntilExclamationMarkOrSemicolon, false);

        if (value.type === 'Value' && value.children.isEmpty) {
            for (let offset = startIndex - this.tokenIndex; offset <= 0; offset++) {
                if (this.lookupType(offset) === types.WhiteSpace) {
                    value.children.appendData({
                        type: 'WhiteSpace',
                        loc: null,
                        value: ' '
                    });
                    break;
                }
            }
        }

        children.push(value);
    }

    return children;
}

module.exports = varFn;
Lx$'use strict';

const create = require('./create.cjs');
const lexer = require('./config/lexer.cjs');
const parser = require('./config/parser.cjs');
const walker = require('./config/walker.cjs');

const syntax = create({
    ...lexer,
    ...parser,
    ...walker
});

module.exports = syntax;
i_%x_100644 AnPlusB.cjs Yz1wI/xK100644 Atrule.cjs Ou5{B2ϓ100644 AtrulePrelude.cjs gYSHghY]100644 AttributeSelector.cjs u}N86AI`^-100644 Block.cjs xR0(r?-100644 Brackets.cjs cnՊ~o6qAi100644 CDC.cjs Ab>O:et8z100644 CDO.cjs 2W.RaPL4LY100644 ClassSelector.cjs ="h{	b100644 Combinator.cjs $'=_EdIcj]100644 Comment.cjs >ȼXjd_7100644 Condition.cjs j.
)F\
ddR!100644 Declaration.cjs |;uƯ%R2100644 DeclarationList.cjs yz@ݱOG
e100644 Dimension.cjs "q)*5=	#100644 Feature.cjs P6|WYԸ0M׭100644 FeatureFunction.cjs x^e<f(@100644 FeatureRange.cjs s$ w\q100644 Function.cjs ~Jg$. ~100644 GeneralEnclosed.cjs *D- 9w):hS100644 Hash.cjs _7S#mb=100644 IdSelector.cjs &E%֡Þ'oٰ100644 Identifier.cjs (ό 8E9@ɓ|i100644 Layer.cjs HgCDbqv)2100644 LayerList.cjs Tָ=$) exW)
100644 MediaQuery.cjs wnzu4+_ `Vz100644 MediaQueryList.cjs 8ww*zHNt_ң100644 NestingSelector.cjs PIv100644 Nth.cjs pXjFk=uC100644 Number.cjs YMxZ;	bf100644 Operator.cjs ť|)hZ@M$100644 Parentheses.cjs |gbOHĕX6100644 Percentage.cjs 8^@CYyʗQdǮb100644 PseudoClassSelector.cjs >*m64100644 PseudoElementSelector.cjs (?a\,100644 Ratio.cjs i}e Z100644 Raw.cjs [NXBsKvZ.q0100644 Rule.cjs 'Vj!NDsc"100644 Scope.cjs  D+9V#i100644 Selector.cjs 6UOfNJei)100644 SelectorList.cjs ~	x:As改̾100644 String.cjs x2oOJחg100644 StyleSheet.cjs nHXV|Q^"100644 SupportsDeclaration.cjs P]smy2\h1"r100644 TypeSelector.cjs 
b^޿yLzE100644 UnicodeRange.cjs U%ؗ<3ވv100644 Url.cjs j9EwBd{100644 Value.cjs "粕=ŷs=Vc6!100644 WhiteSpace.cjs P&g_Ͱ'{\100644 index-generate.cjs A	^$w%Ij100644 index-parse-selector.cjs y[J؆fMA1100644 index-parse.cjs p[ZRui	100644 index.cjs WE٬P,uB١FhMm˵xj'use strict';

const types = require('../../tokenizer/types.cjs');
const charCodeDefinitions = require('../../tokenizer/char-code-definitions.cjs');

const PLUSSIGN = 0x002B;    // U+002B PLUS SIGN (+)
const HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)
const N = 0x006E;           // U+006E LATIN SMALL LETTER N (n)
const DISALLOW_SIGN = true;
const ALLOW_SIGN = false;

function checkInteger(offset, disallowSign) {
    let pos = this.tokenStart + offset;
    const code = this.charCodeAt(pos);

    if (code === PLUSSIGN || code === HYPHENMINUS) {
        if (disallowSign) {
            this.error('Number sign is not allowed');
        }
        pos++;
    }

    for (; pos < this.tokenEnd; pos++) {
        if (!charCodeDefinitions.isDigit(this.charCodeAt(pos))) {
            this.error('Integer is expected', pos);
        }
    }
}

function checkTokenIsInteger(disallowSign) {
    return checkInteger.call(this, 0, disallowSign);
}

function expectCharCode(offset, code) {
    if (!this.cmpChar(this.tokenStart + offset, code)) {
        let msg = '';

        switch (code) {
            case N:
                msg = 'N is expected';
                break;
            case HYPHENMINUS:
                msg = 'HyphenMinus is expected';
                break;
        }

        this.error(msg, this.tokenStart + offset);
    }
}

// ... <signed-integer>
// ... ['+' | '-'] <signless-integer>
function consumeB() {
    let offset = 0;
    let sign = 0;
    let type = this.tokenType;

    while (type === types.WhiteSpace || type === types.Comment) {
        type = this.lookupType(++offset);
    }

    if (type !== types.Number) {
        if (this.isDelim(PLUSSIGN, offset) ||
            this.isDelim(HYPHENMINUS, offset)) {
            sign = this.isDelim(PLUSSIGN, offset) ? PLUSSIGN : HYPHENMINUS;

            do {
                type = this.lookupType(++offset);
            } while (type === types.WhiteSpace || type === types.Comment);

            if (type !== types.Number) {
                this.skip(offset);
                checkTokenIsInteger.call(this, DISALLOW_SIGN);
            }
        } else {
            return null;
        }
    }

    if (offset > 0) {
        this.skip(offset);
    }

    if (sign === 0) {
        type = this.charCodeAt(this.tokenStart);
        if (type !== PLUSSIGN && type !== HYPHENMINUS) {
            this.error('Number sign is expected');
        }
    }

    checkTokenIsInteger.call(this, sign !== 0);
    return sign === HYPHENMINUS ? '-' + this.consume(types.Number) : this.consume(types.Number);
}

// An+B microsyntax https://www.w3.org/TR/css-syntax-3/#anb
const name = 'AnPlusB';
const structure = {
    a: [String, null],
    b: [String, null]
};

function parse() {
    /* eslint-disable brace-style*/
    const start = this.tokenStart;
    let a = null;
    let b = null;

    // <integer>
    if (this.tokenType === types.Number) {
        checkTokenIsInteger.call(this, ALLOW_SIGN);
        b = this.consume(types.Number);
    }

    // -n
    // -n <signed-integer>
    // -n ['+' | '-'] <signless-integer>
    // -n- <signless-integer>
    // <dashndashdigit-ident>
    else if (this.tokenType === types.Ident && this.cmpChar(this.tokenStart, HYPHENMINUS)) {
        a = '-1';

        expectCharCode.call(this, 1, N);

        switch (this.tokenEnd - this.tokenStart) {
            // -n
            // -n <signed-integer>
            // -n ['+' | '-'] <signless-integer>
            case 2:
                this.next();
                b = consumeB.call(this);
                break;

            // -n- <signless-integer>
            case 3:
                expectCharCode.call(this, 2, HYPHENMINUS);

                this.next();
                this.skipSC();

                checkTokenIsInteger.call(this, DISALLOW_SIGN);

                b = '-' + this.consume(types.Number);
                break;

            // <dashndashdigit-ident>
            default:
                expectCharCode.call(this, 2, HYPHENMINUS);
                checkInteger.call(this, 3, DISALLOW_SIGN);
                this.next();

                b = this.substrToCursor(start + 2);
        }
    }

    // '+'? n
    // '+'? n <signed-integer>
    // '+'? n ['+' | '-'] <signless-integer>
    // '+'? n- <signless-integer>
    // '+'? <ndashdigit-ident>
    else if (this.tokenType === types.Ident || (this.isDelim(PLUSSIGN) && this.lookupType(1) === types.Ident)) {
        let sign = 0;
        a = '1';

        // just ignore a plus
        if (this.isDelim(PLUSSIGN)) {
            sign = 1;
            this.next();
        }

        expectCharCode.call(this, 0, N);

        switch (this.tokenEnd - this.tokenStart) {
            // '+'? n
            // '+'? n <signed-integer>
            // '+'? n ['+' | '-'] <signless-integer>
            case 1:
                this.next();
                b = consumeB.call(this);
                break;

            // '+'? n- <signless-integer>
            case 2:
                expectCharCode.call(this, 1, HYPHENMINUS);

                this.next();
                this.skipSC();

                checkTokenIsInteger.call(this, DISALLOW_SIGN);

                b = '-' + this.consume(types.Number);
                break;

            // '+'? <ndashdigit-ident>
            default:
                expectCharCode.call(this, 1, HYPHENMINUS);
                checkInteger.call(this, 2, DISALLOW_SIGN);
                this.next();

                b = this.substrToCursor(start + sign + 1);
        }
    }

    // <ndashdigit-dimension>
    // <ndash-dimension> <signless-integer>
    // <n-dimension>
    // <n-dimension> <signed-integer>
    // <n-dimension> ['+' | '-'] <signless-integer>
    else if (this.tokenType === types.Dimension) {
        const code = this.charCodeAt(this.tokenStart);
        const sign = code === PLUSSIGN || code === HYPHENMINUS;
        let i = this.tokenStart + sign;

        for (; i < this.tokenEnd; i++) {
            if (!charCodeDefinitions.isDigit(this.charCodeAt(i))) {
                break;
            }
        }

        if (i === this.tokenStart + sign) {
            this.error('Integer is expected', this.tokenStart + sign);
        }

        expectCharCode.call(this, i - this.tokenStart, N);
        a = this.substring(start, i);

        // <n-dimension>
        // <n-dimension> <signed-integer>
        // <n-dimension> ['+' | '-'] <signless-integer>
        if (i + 1 === this.tokenEnd) {
            this.next();
            b = consumeB.call(this);
        } else {
            expectCharCode.call(this, i - this.tokenStart + 1, HYPHENMINUS);

            // <ndash-dimension> <signless-integer>
            if (i + 2 === this.tokenEnd) {
                this.next();
                this.skipSC();
                checkTokenIsInteger.call(this, DISALLOW_SIGN);
                b = '-' + this.consume(types.Number);
            }
            // <ndashdigit-dimension>
            else {
                checkInteger.call(this, i - this.tokenStart + 2, DISALLOW_SIGN);
                this.next();
                b = this.substrToCursor(i + 1);
            }
        }
    } else {
        this.error();
    }

    if (a !== null && a.charCodeAt(0) === PLUSSIGN) {
        a = a.substr(1);
    }

    if (b !== null && b.charCodeAt(0) === PLUSSIGN) {
        b = b.substr(1);
    }

    return {
        type: 'AnPlusB',
        loc: this.getLocation(start, this.tokenStart),
        a,
        b
    };
}

function generate(node) {
    if (node.a) {
        const a =
            node.a === '+1' && 'n' ||
            node.a ===  '1' && 'n' ||
            node.a === '-1' && '-n' ||
            node.a + 'n';

        if (node.b) {
            const b = node.b[0] === '-' || node.b[0] === '+'
                ? node.b
                : '+' + node.b;
            this.tokenize(a + b);
        } else {
            this.tokenize(a);
        }
    } else {
        this.tokenize(node.b);
    }
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
sx2
'use strict';

const types = require('../../tokenizer/types.cjs');

function consumeRaw() {
    return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon, true);
}

function isDeclarationBlockAtrule() {
    for (let offset = 1, type; type = this.lookupType(offset); offset++) {
        if (type === types.RightCurlyBracket) {
            return true;
        }

        if (type === types.LeftCurlyBracket ||
            type === types.AtKeyword) {
            return false;
        }
    }

    return false;
}


const name = 'Atrule';
const walkContext = 'atrule';
const structure = {
    name: String,
    prelude: ['AtrulePrelude', 'Raw', null],
    block: ['Block', null]
};

function parse(isDeclaration = false, { allowNestedRules = false } = {}) {
    const start = this.tokenStart;
    let name;
    let nameLowerCase;
    let prelude = null;
    let block = null;

    this.eat(types.AtKeyword);

    name = this.substrToCursor(start + 1);
    nameLowerCase = name.toLowerCase();
    this.skipSC();

    // parse prelude
    if (this.eof === false &&
        this.tokenType !== types.LeftCurlyBracket &&
        this.tokenType !== types.Semicolon) {
        if (this.parseAtrulePrelude) {
            prelude = this.parseWithFallback(this.AtrulePrelude.bind(this, name, isDeclaration), consumeRaw);
        } else {
            prelude = consumeRaw.call(this, this.tokenIndex);
        }

        this.skipSC();
    }

    switch (this.tokenType) {
        case types.Semicolon:
            this.next();
            break;

        case types.LeftCurlyBracket:
            if (hasOwnProperty.call(this.atrule, nameLowerCase) &&
                typeof this.atrule[nameLowerCase].block === 'function') {
                block = this.atrule[nameLowerCase].block.call(this, isDeclaration, { allowNestedRules });
            } else {
                // TODO: should consume block content as Raw?
                block = this.Block(isDeclaration || isDeclarationBlockAtrule.call(this), { allowNestedRules });
            }

            break;
    }

    return {
        type: 'Atrule',
        loc: this.getLocation(start, this.tokenStart),
        name,
        prelude,
        block
    };
}

function generate(node) {
    this.token(types.AtKeyword, '@' + node.name);

    if (node.prelude !== null) {
        this.node(node.prelude);
    }

    if (node.block) {
        this.node(node.block);
    } else {
        this.token(types.Semicolon, ';');
    }
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
exports.walkContext = walkContext;
<Gxu'use strict';

const types = require('../../tokenizer/types.cjs');

const name = 'AtrulePrelude';
const walkContext = 'atrulePrelude';
const structure = {
    children: [[]]
};

function parse(name) {
    let children = null;

    if (name !== null) {
        name = name.toLowerCase();
    }

    this.skipSC();

    if (hasOwnProperty.call(this.atrule, name) &&
        typeof this.atrule[name].prelude === 'function') {
        // custom consumer
        children = this.atrule[name].prelude.call(this);
    } else {
        // default consumer
        children = this.readSequence(this.scope.AtrulePrelude);
    }

    this.skipSC();

    if (this.eof !== true &&
        this.tokenType !== types.LeftCurlyBracket &&
        this.tokenType !== types.Semicolon) {
        this.error('Semicolon or block is expected');
    }

    return {
        type: 'AtrulePrelude',
        loc: this.getLocationFromList(children),
        children
    };
}

function generate(node) {
    this.children(node);
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
exports.walkContext = walkContext;
hx6'use strict';

const types = require('../../tokenizer/types.cjs');

const DOLLARSIGN = 0x0024;       // U+0024 DOLLAR SIGN ($)
const ASTERISK = 0x002A;         // U+002A ASTERISK (*)
const EQUALSSIGN = 0x003D;       // U+003D EQUALS SIGN (=)
const CIRCUMFLEXACCENT = 0x005E; // U+005E (^)
const VERTICALLINE = 0x007C;     // U+007C VERTICAL LINE (|)
const TILDE = 0x007E;            // U+007E TILDE (~)

function getAttributeName() {
    if (this.eof) {
        this.error('Unexpected end of input');
    }

    const start = this.tokenStart;
    let expectIdent = false;

    if (this.isDelim(ASTERISK)) {
        expectIdent = true;
        this.next();
    } else if (!this.isDelim(VERTICALLINE)) {
        this.eat(types.Ident);
    }

    if (this.isDelim(VERTICALLINE)) {
        if (this.charCodeAt(this.tokenStart + 1) !== EQUALSSIGN) {
            this.next();
            this.eat(types.Ident);
        } else if (expectIdent) {
            this.error('Identifier is expected', this.tokenEnd);
        }
    } else if (expectIdent) {
        this.error('Vertical line is expected');
    }

    return {
        type: 'Identifier',
        loc: this.getLocation(start, this.tokenStart),
        name: this.substrToCursor(start)
    };
}

function getOperator() {
    const start = this.tokenStart;
    const code = this.charCodeAt(start);

    if (code !== EQUALSSIGN &&        // =
        code !== TILDE &&             // ~=
        code !== CIRCUMFLEXACCENT &&  // ^=
        code !== DOLLARSIGN &&        // $=
        code !== ASTERISK &&          // *=
        code !== VERTICALLINE         // |=
    ) {
        this.error('Attribute selector (=, ~=, ^=, $=, *=, |=) is expected');
    }

    this.next();

    if (code !== EQUALSSIGN) {
        if (!this.isDelim(EQUALSSIGN)) {
            this.error('Equal sign is expected');
        }

        this.next();
    }

    return this.substrToCursor(start);
}

// '[' <wq-name> ']'
// '[' <wq-name> <attr-matcher> [ <string-token> | <ident-token> ] <attr-modifier>? ']'
const name = 'AttributeSelector';
const structure = {
    name: 'Identifier',
    matcher: [String, null],
    value: ['String', 'Identifier', null],
    flags: [String, null]
};

function parse() {
    const start = this.tokenStart;
    let name;
    let matcher = null;
    let value = null;
    let flags = null;

    this.eat(types.LeftSquareBracket);
    this.skipSC();

    name = getAttributeName.call(this);
    this.skipSC();

    if (this.tokenType !== types.RightSquareBracket) {
        // avoid case `[name i]`
        if (this.tokenType !== types.Ident) {
            matcher = getOperator.call(this);

            this.skipSC();

            value = this.tokenType === types.String
                ? this.String()
                : this.Identifier();

            this.skipSC();
        }

        // attribute flags
        if (this.tokenType === types.Ident) {
            flags = this.consume(types.Ident);

            this.skipSC();
        }
    }

    this.eat(types.RightSquareBracket);

    return {
        type: 'AttributeSelector',
        loc: this.getLocation(start, this.tokenStart),
        name,
        matcher,
        value,
        flags
    };
}

function generate(node) {
    this.token(types.Delim, '[');
    this.node(node.name);

    if (node.matcher !== null) {
        this.tokenize(node.matcher);
        this.node(node.value);
    }

    if (node.flags !== null) {
        this.token(types.Ident, node.flags);
    }

    this.token(types.Delim, ']');
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
<	/xl'use strict';

const types = require('../../tokenizer/types.cjs');

const AMPERSAND = 0x0026;       // U+0026 AMPERSAND (&)
const DOT = 0x002E;             // U+002E FULL STOP (.)
const STAR = 0x002A;            // U+002A ASTERISK (*);
const PLUSSIGN = 0x002B;        // U+002B PLUS SIGN (+)
const GREATERTHANSIGN = 0x003E; // U+003E GREATER-THAN SIGN (>)
const TILDE = 0x007E;           // U+007E TILDE (~)

const selectorStarts = new Set([
    AMPERSAND,
    DOT,
    STAR,
    PLUSSIGN,
    GREATERTHANSIGN,
    TILDE
]);

function consumeRaw() {
    return this.Raw(null, true);
}
function consumeRule() {
    return this.parseWithFallback(this.Rule, consumeRaw);
}
function consumeRawDeclaration() {
    return this.Raw(this.consumeUntilSemicolonIncluded, true);
}
function consumeDeclaration() {
    if (this.tokenType === types.Semicolon) {
        return consumeRawDeclaration.call(this, this.tokenIndex);
    }

    const node = this.parseWithFallback(this.Declaration, consumeRawDeclaration);

    if (this.tokenType === types.Semicolon) {
        this.next();
    }

    return node;
}

function isElementSelectorStart() {
    if (this.tokenType !== types.Ident) {
        return false;
    }

    const nextTokenType = this.lookupTypeNonSC(1);

    // If next token is not colon, semicolon, or right curly bracket, it's likely a selector
    if (nextTokenType !== types.Colon && nextTokenType !== types.Semicolon && nextTokenType !== types.RightCurlyBracket) {
        return true;
    }

    // If next token is colon, we need to look further ahead to distinguish
    // between property declarations (p: value) and pseudo-class selectors (p:hover)
    if (nextTokenType === types.Colon) {
        // Look for the token after the colon (skipping whitespace)
        const tokenAfterColon = this.lookupTypeNonSC(2);

        // If it's an identifier (like 'hover', 'first-of-type') or function (like 'nth-child()', 'not()'),
        // this could be a pseudo-class
        if (tokenAfterColon === types.Ident || tokenAfterColon === types.Function) {
            // Look further ahead to see if there's a left curly bracket
            // which would indicate this is a selector with a block
            let offset = 3;
            let tokenType;

            // Skip whitespace and look for either a left curly bracket or other tokens
            while (offset <= 15) { // Increased limit to handle function pseudo-classes
                tokenType = this.lookupType(offset);

                if (tokenType === types.LeftCurlyBracket) {
                    // Found opening brace, this is definitely a selector
                    return true;
                } else if (tokenType === types.Semicolon || tokenType === types.RightCurlyBracket) {
                    // Found semicolon or closing brace before opening brace, likely a property
                    return false;
                } else if (tokenType === types.WhiteSpace || tokenType === types.Comment) {
                    // Skip whitespace and comments
                    offset++;
                    continue;
                } else {
                    // Other tokens might indicate more complex selectors, continue looking
                    offset++;
                }
            }
        }

        // If we can't determine conclusively, default to property behavior
        return false;
    }

    return false;
}

function isSelectorStart() {
    // Check for Delim tokens that might be selector starts
    if (this.tokenType === types.Delim && selectorStarts.has(this.source.charCodeAt(this.tokenStart))) {
        const code = this.source.charCodeAt(this.tokenStart);

        // Special case: browser hack prefixes (*, +, &) followed immediately by an ident
        // (no whitespace) are declarations, not selectors. Examples: *zoom: 1; +width: 100px; &prop: value;
        if (code === STAR || code === PLUSSIGN || code === AMPERSAND) {
            const nextToken = this.lookupType(1);
            const nextTokenNonSC = this.lookupTypeNonSC(1);

            // If next token is Ident and there's no whitespace between, it's a declaration
            if (nextToken === types.Ident && nextTokenNonSC === types.Ident) {
                return false;
            }
        }
        return true;
    }

    // Hash can be either a Hash token (#id selector) or Delim(#) + Ident (browser hack)
    // When it's a Hash token, it's a selector. When it's Delim, check if followed by Ident without whitespace
    if (this.tokenType === types.Hash) {
        return true;
    }

    return this.tokenType === types.LeftSquareBracket ||
        this.tokenType === types.Colon || isElementSelectorStart.call(this);
}

const name = 'Block';
const walkContext = 'block';
const structure = {
    children: [[
        'Atrule',
        'Rule',
        'Declaration'
    ]]
};

function parse(isStyleBlock, { allowNestedRules = false } = {}) {
    const start = this.tokenStart;
    let children = this.createList();

    this.eat(types.LeftCurlyBracket);

    scan:
    while (!this.eof) {
        switch (this.tokenType) {
            case types.RightCurlyBracket:
                break scan;

            case types.WhiteSpace:
            case types.Comment:
                this.next();
                break;

            case types.AtKeyword:
                children.push(this.parseWithFallback(this.Atrule.bind(this, isStyleBlock, { allowNestedRules }), consumeRaw));
                break;

            default:
                if (isStyleBlock) {

                    if (allowNestedRules && isSelectorStart.call(this)) {
                        children.push(consumeRule.call(this));
                    } else {
                        children.push(consumeDeclaration.call(this));
                    }

                } else {
                    children.push(consumeRule.call(this));
                }
        }
    }

    if (!this.eof) {
        this.eat(types.RightCurlyBracket);
    }

    return {
        type: 'Block',
        loc: this.getLocation(start, this.tokenStart),
        children
    };
}

function generate(node) {
    this.token(types.LeftCurlyBracket, '{');
    this.children(node, prev => {
        if (prev.type === 'Declaration') {
            this.token(types.Semicolon, ';');
        }
    });
    this.token(types.RightCurlyBracket, '}');
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
exports.walkContext = walkContext;
wΚ°/x'use strict';

const types = require('../../tokenizer/types.cjs');

const name = 'Brackets';
const structure = {
    children: [[]]
};

function parse(readSequence, recognizer) {
    const start = this.tokenStart;
    let children = null;

    this.eat(types.LeftSquareBracket);

    children = readSequence.call(this, recognizer);

    if (!this.eof) {
        this.eat(types.RightSquareBracket);
    }

    return {
        type: 'Brackets',
        loc: this.getLocation(start, this.tokenStart),
        children
    };
}

function generate(node) {
    this.token(types.Delim, '[');
    this.children(node);
    this.token(types.Delim, ']');
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
x3'use strict';

const types = require('../../tokenizer/types.cjs');

const name = 'CDC';
const structure = {};

function parse() {
    const start = this.tokenStart;

    this.eat(types.CDC); // -->

    return {
        type: 'CDC',
        loc: this.getLocation(start, this.tokenStart)
    };
}

function generate() {
    this.token(types.CDC, '-->');
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
*4Ծx1'use strict';

const types = require('../../tokenizer/types.cjs');

const name = 'CDO';
const structure = {};

function parse() {
    const start = this.tokenStart;

    this.eat(types.CDO); // <!--

    return {
        type: 'CDO',
        loc: this.getLocation(start, this.tokenStart)
    };
}

function generate() {
    this.token(types.CDO, '<!--');
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
1Bkx@'use strict';

const types = require('../../tokenizer/types.cjs');

const name = 'PseudoElementSelector';
const walkContext = 'function';
const structure = {
    name: String,
    children: [['Raw'], null]
};

// :: [ <ident> | <function-token> <any-value>? ) ]
function parse() {
    const start = this.tokenStart;
    let children = null;
    let name;
    let nameLowerCase;

    this.eat(types.Colon);
    this.eat(types.Colon);

    if (this.tokenType === types.Function) {
        name = this.consumeFunctionName();
        nameLowerCase = name.toLowerCase();

        if (this.lookupNonWSType(0) == types.RightParenthesis) {
            children = this.createList();
        } else if (hasOwnProperty.call(this.pseudo, nameLowerCase)) {
            this.skipSC();
            children = this.pseudo[nameLowerCase].call(this);
            this.skipSC();
        } else {
            children = this.createList();
            children.push(
                this.Raw(null, false)
            );
        }

        this.eat(types.RightParenthesis);
    } else {
        name = this.consume(types.Ident);
    }

    return {
        type: 'PseudoElementSelector',
        loc: this.getLocation(start, this.tokenStart),
        name,
        children
    };
}

function generate(node) {
    this.token(types.Colon, ':');
    this.token(types.Colon, ':');

    if (node.children === null) {
        this.token(types.Ident, node.name);
    } else {
        this.token(types.Function, node.name + '(');
        this.children(node);
        this.token(types.RightParenthesis, ')');
    }
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
exports.walkContext = walkContext;
2LxJTFULLSTOP = 0x002E; // U+002E FULL STOP (.)

// '.' ident
const name = 'ClassSelector'4
};

function parse() {
    this.eatDelim(FULLSTOP);XClass)Lthis.tokenStart - 1, this.tokenEnd),
        name: this.consume(types.Ident):Delim, '.');
s(1k=PFYxi'use strict';

const types = require('../../tokenizer/types.cjs');

const PLUSSIGN = 0x002B;        // U+002B PLUS SIGN (+)
const SOLIDUS = 0x002F;         // U+002F SOLIDUS (/)
const GREATERTHANSIGN = 0x003E; // U+003E GREATER-THAN SIGN (>)
const TILDE = 0x007E;           // U+007E TILDE (~)

const name = 'Combinator';
const structure = {
    name: String
};

// + | > | ~ | /deep/
function parse() {
    const start = this.tokenStart;
    let name;

    switch (this.tokenType) {
        case types.WhiteSpace:
            name = ' ';
            break;

        case types.Delim:
            switch (this.charCodeAt(this.tokenStart)) {
                case GREATERTHANSIGN:
                case PLUSSIGN:
                case TILDE:
                    this.next();
                    break;

                case SOLIDUS:
                    this.next();
                    this.eatIdent('deep');
                    this.eatDelim(SOLIDUS);
                    break;

                default:
                    this.error('Combinator is expected');
            }

            name = this.substrToCursor(start);
            break;
    }

    return {
        type: 'Combinator',
        loc: this.getLocation(start, this.tokenStart),
        name
    };
}

function generate(node) {
    this.tokenize(node.name);
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
gf}϶5xV'use strict';

const types = require('../../tokenizer/types.cjs');

const ASTERISK = 0x002A;        // U+002A ASTERISK (*)
const SOLIDUS = 0x002F;         // U+002F SOLIDUS (/)


const name = 'Comment';
const structure = {
    value: String
};

function parse() {
    const start = this.tokenStart;
    let end = this.tokenEnd;

    this.eat(types.Comment);

    if ((end - start + 2) >= 2 &&
        this.charCodeAt(end - 2) === ASTERISK &&
        this.charCodeAt(end - 1) === SOLIDUS) {
        end -= 2;
    }

    return {
        type: 'Comment',
        loc: this.getLocation(start, this.tokenStart),
        value: this.substring(start + 2, end)
    };
}

function generate(node) {
    this.token(types.Comment, '/*' + node.value + '*/');
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
0xc'use strict';

const types = require('../../tokenizer/types.cjs');

const likelyFeatureToken = new Set([types.Colon, types.RightParenthesis, types.EOF]);

const name = 'Condition';
const structure = {
    kind: String,
    children: [[
        'Identifier',
        'Feature',
        'FeatureFunction',
        'FeatureRange',
        'SupportsDeclaration'
    ]]
};

function featureOrRange(kind) {
    if (this.lookupTypeNonSC(1) === types.Ident &&
        likelyFeatureToken.has(this.lookupTypeNonSC(2))) {
        return this.Feature(kind);
    }

    return this.FeatureRange(kind);
}

const parentheses = {
    media: featureOrRange,
    container: featureOrRange,
    supports() {
        return this.SupportsDeclaration();
    }
};

function parse(kind = 'media') {
    const children = this.createList();

    scan: while (!this.eof) {
        switch (this.tokenType) {
            case types.Comment:
            case types.WhiteSpace:
                this.next();
                continue;

            case types.Ident:
                children.push(this.Identifier());
                break;

            case types.LeftParenthesis: {
                let term = this.parseWithFallback(
                    () => parentheses[kind].call(this, kind),
                    () => null
                );

                if (!term) {
                    term = this.parseWithFallback(
                        () => {
                            this.eat(types.LeftParenthesis);
                            const res = this.Condition(kind);
                            this.eat(types.RightParenthesis);
                            return res;
                        },
                        () => {
                            return this.GeneralEnclosed(kind);
                        }
                    );
                }

                children.push(term);
                break;
            }

            case types.Function: {
                let term = this.parseWithFallback(
                    () => this.FeatureFunction(kind),
                    () => null
                );

                if (!term) {
                    term = this.GeneralEnclosed(kind);
                }

                children.push(term);
                break;
            }

            default:
                break scan;
        }
    }

    if (children.isEmpty) {
        this.error('Condition is expected');
    }

    return {
        type: 'Condition',
        loc: this.getLocationFromList(children),
        kind,
        children
    };
}

function generate(node) {
    node.children.forEach(child => {
        if (child.type === 'Condition') {
            this.token(types.LeftParenthesis, '(');
            this.node(child);
            this.token(types.RightParenthesis, ')');
        } else {
            this.node(child);
        }
    });
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
xK'use strict';

const names = require('../../utils/names.cjs');
const types = require('../../tokenizer/types.cjs');

const EXCLAMATIONMARK = 0x0021; // U+0021 EXCLAMATION MARK (!)
const NUMBERSIGN = 0x0023;      // U+0023 NUMBER SIGN (#)
const DOLLARSIGN = 0x0024;      // U+0024 DOLLAR SIGN ($)
const AMPERSAND = 0x0026;       // U+0026 AMPERSAND (&)
const ASTERISK = 0x002A;        // U+002A ASTERISK (*)
const PLUSSIGN = 0x002B;        // U+002B PLUS SIGN (+)
const SOLIDUS = 0x002F;         // U+002F SOLIDUS (/)

function consumeValueRaw() {
    return this.Raw(this.consumeUntilExclamationMarkOrSemicolon, true);
}

function consumeCustomPropertyRaw() {
    return this.Raw(this.consumeUntilExclamationMarkOrSemicolon, false);
}

function consumeValue() {
    const startValueToken = this.tokenIndex;
    const value = this.Value();

    if (value.type !== 'Raw' &&
        this.eof === false &&
        this.tokenType !== types.Semicolon &&
        this.isDelim(EXCLAMATIONMARK) === false &&
        this.isBalanceEdge(startValueToken) === false) {
        this.error();
    }

    return value;
}

const name = 'Declaration';
const walkContext = 'declaration';
const structure = {
    important: [Boolean, String],
    property: String,
    value: ['Value', 'Raw']
};

function parse() {
    const start = this.tokenStart;
    const startToken = this.tokenIndex;
    const property = readProperty.call(this);
    const customProperty = names.isCustomProperty(property);
    const parseValue = customProperty ? this.parseCustomProperty : this.parseValue;
    const consumeRaw = customProperty ? consumeCustomPropertyRaw : consumeValueRaw;
    let important = false;
    let value;

    this.skipSC();
    this.eat(types.Colon);

    const valueStart = this.tokenIndex;

    if (!customProperty) {
        this.skipSC();
    }

    if (parseValue) {
        value = this.parseWithFallback(consumeValue, consumeRaw);
    } else {
        value = consumeRaw.call(this, this.tokenIndex);
    }

    if (customProperty && value.type === 'Value' && value.children.isEmpty) {
        for (let offset = valueStart - this.tokenIndex; offset <= 0; offset++) {
            if (this.lookupType(offset) === types.WhiteSpace) {
                value.children.appendData({
                    type: 'WhiteSpace',
                    loc: null,
                    value: ' '
                });
                break;
            }
        }
    }

    if (this.isDelim(EXCLAMATIONMARK)) {
        important = getImportant.call(this);
        this.skipSC();
    }

    // Do not include semicolon to range per spec
    // https://drafts.csswg.org/css-syntax/#declaration-diagram

    if (this.eof === false &&
        this.tokenType !== types.Semicolon &&
        this.isBalanceEdge(startToken) === false) {
        this.error();
    }

    return {
        type: 'Declaration',
        loc: this.getLocation(start, this.tokenStart),
        important,
        property,
        value
    };
}

function generate(node) {
    this.token(types.Ident, node.property);
    this.token(types.Colon, ':');
    this.node(node.value);

    if (node.important) {
        this.token(types.Delim, '!');
        this.token(types.Ident, node.important === true ? 'important' : node.important);
    }
}

function readProperty() {
    const start = this.tokenStart;

    // hacks
    if (this.tokenType === types.Delim) {
        switch (this.charCodeAt(this.tokenStart)) {
            case ASTERISK:
            case DOLLARSIGN:
            case PLUSSIGN:
            case NUMBERSIGN:
            case AMPERSAND:
                this.next();
                break;

            // TODO: not sure we should support this hack
            case SOLIDUS:
                this.next();
                if (this.isDelim(SOLIDUS)) {
                    this.next();
                }
                break;
        }
    }

    if (this.tokenType === types.Hash) {
        this.eat(types.Hash);
    } else {
        this.eat(types.Ident);
    }

    return this.substrToCursor(start);
}

// ! ws* important
function getImportant() {
    this.eat(types.Delim);
    this.skipSC();

    const important = this.consume(types.Ident);

    // store original value in case it differ from `important`
    // for better original source restoring and hacks like `!ie` support
    return important === 'important' ? true : important;
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
exports.walkContext = walkContext;
	Hճx'use strict';

const types = require('../../tokenizer/types.cjs');

const AMPERSAND = 0x0026;       // U+0026 AMPERSAND (&)
const DOT = 0x002E;             // U+002E FULL STOP (.)
const STAR = 0x002A;            // U+002A ASTERISK (*);
const PLUSSIGN = 0x002B;        // U+002B PLUS SIGN (+)
const GREATERTHANSIGN = 0x003E; // U+003E GREATER-THAN SIGN (>)
const TILDE = 0x007E;           // U+007E TILDE (~)

const selectorStarts = new Set([
    AMPERSAND,
    DOT,
    STAR,
    PLUSSIGN,
    GREATERTHANSIGN,
    TILDE
]);

function consumeRaw() {
    return this.Raw(this.consumeUntilSemicolonIncluded, true);
}

function isElementSelectorStart() {
    if (this.tokenType !== types.Ident) {
        return false;
    }

    const nextTokenType = this.lookupTypeNonSC(1);

    // If next token is a left curly bracket, it's definitely a selector (e.g., "div { ... }")
    if (nextTokenType === types.LeftCurlyBracket) {
        return true;
    }

    // If next token is semicolon, comma, or closing brace, it's definitely a declaration
    if (nextTokenType === types.Semicolon || nextTokenType === types.Comma || nextTokenType === types.RightCurlyBracket) {
        return false;
    }

    // Special handling for colon case - could be pseudo-class/pseudo-element or property
    if (nextTokenType === types.Colon) {
        // Look ahead further to see what follows the colon
        const afterColonType = this.lookupTypeNonSC(2);

        // If after colon there's an identifier (pseudo-class/pseudo-element name),
        // check what comes after that
        if (afterColonType === types.Ident) {
            const afterPseudoType = this.lookupTypeNonSC(3);
            // If it's followed by {, it's definitely a selector (e.g., "div:hover { ... }")
            if (afterPseudoType === types.LeftCurlyBracket) {
                return true;
            }
            // Otherwise, it's a property (e.g., "transition: opacity 1s")
            return false;
        }
        // If after colon there's not an identifier, it's a property
        return false;
    }

    // For other token types (dimensions, numbers, strings, etc.), assume it's a declaration
    // This handles cases like multi-value properties
    return false;
}

function isSelectorStart() {
    return this.tokenType === types.Delim && selectorStarts.has(this.source.charCodeAt(this.tokenStart)) ||
        this.tokenType === types.Hash || this.tokenType === types.LeftSquareBracket ||
        this.tokenType === types.Colon || isElementSelectorStart.call(this);
}

const name = 'DeclarationList';
const structure = {
    children: [[
        'Declaration',
        'Atrule',
        'Rule'
    ]]
};

function parse() {
    const children = this.createList();

    while (!this.eof) {
        switch (this.tokenType) {
            case types.WhiteSpace:
            case types.Comment:
            case types.Semicolon:
                this.next();
                break;

            case types.AtKeyword:
                children.push(this.parseWithFallback(this.Atrule.bind(this, true), consumeRaw));
                break;

            default:
                if (isSelectorStart.call(this))  {
                    children.push(this.parseWithFallback(this.Rule, consumeRaw));
                } else {
                    children.push(this.parseWithFallback(this.Declaration, consumeRaw));
                }
        }
    }

    return {
        type: 'DeclarationList',
        loc: this.getLocationFromList(children),
        children
    };
}

function generate(node) {
    this.children(node, prev => {
        if (prev.type === 'Declaration') {
            this.token(types.Semicolon, ';');
        }
    });
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
wF(x}'use strict';

const types = require('../../tokenizer/types.cjs');

const name = 'Dimension';
const structure = {
    value: String,
    unit: String
};

function parse() {
    const start = this.tokenStart;
    const value = this.consumeNumber(types.Dimension);

    return {
        type: 'Dimension',
        loc: this.getLocation(start, this.tokenStart),
        value,
        unit: this.substring(start + value.length, this.tokenStart)
    };
}

function generate(node) {
    this.token(types.Dimension, node.value + node.unit);
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
	x6	'use strict';

const types = require('../../tokenizer/types.cjs');

const SOLIDUS = 0x002F;  // U+002F SOLIDUS (/)

const name = 'Feature';
const structure = {
    kind: String,
    name: String,
    value: ['Identifier', 'Number', 'Dimension', 'Ratio', 'Function', null]
};

function parse(kind) {
    const start = this.tokenStart;
    let name;
    let value = null;

    this.eat(types.LeftParenthesis);
    this.skipSC();

    name = this.consume(types.Ident);
    this.skipSC();

    if (this.tokenType !== types.RightParenthesis) {
        this.eat(types.Colon);
        this.skipSC();

        switch (this.tokenType) {
            case types.Number:
                if (this.lookupNonWSType(1) === types.Delim) {
                    value = this.Ratio();
                } else {
                    value = this.Number();
                }

                break;

            case types.Dimension:
                value = this.Dimension();
                break;

            case types.Ident:
                value = this.Identifier();
                break;

            case types.Function:
                value = this.parseWithFallback(
                    () => {
                        const res = this.Function(this.readSequence, this.scope.Value);

                        this.skipSC();

                        if (this.isDelim(SOLIDUS)) {
                            this.error();
                        }

                        return res;
                    },
                    () => {
                        return this.Ratio();
                    }
                );
                break;

            default:
                this.error('Number, dimension, ratio or identifier is expected');
        }

        this.skipSC();
    }

    if (!this.eof) {
        this.eat(types.RightParenthesis);
    }

    return {
        type: 'Feature',
        loc: this.getLocation(start, this.tokenStart),
        kind,
        name,
        value
    };
}

function generate(node) {
    this.token(types.LeftParenthesis, '(');
    this.token(types.Ident, node.name);

    if (node.value !== null) {
        this.token(types.Colon, ':');
        this.node(node.value);
    }

    this.token(types.RightParenthesis, ')');
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
{j{Sbx''use strict';

const types = require('../../tokenizer/types.cjs');

const name = 'FeatureFunction';
const structure = {
    kind: String,
    feature: String,
    value: ['Declaration', 'Selector']
};

function getFeatureParser(kind, name) {
    const featuresOfKind = this.features[kind] || {};
    const parser = featuresOfKind[name];

    if (typeof parser !== 'function') {
        this.error(`Unknown feature ${name}()`);
    }

    return parser;
}

function parse(kind = 'unknown') {
    const start = this.tokenStart;
    const functionName = this.consumeFunctionName();
    const valueParser = getFeatureParser.call(this, kind, functionName.toLowerCase());

    this.skipSC();

    const value = this.parseWithFallback(
        () => {
            const startValueToken = this.tokenIndex;
            const value = valueParser.call(this);

            if (this.eof === false &&
                this.isBalanceEdge(startValueToken) === false) {
                this.error();
            }

            return value;
        },
        () => this.Raw(null, false)
    );

    if (!this.eof) {
        this.eat(types.RightParenthesis);
    }

    return {
        type: 'FeatureFunction',
        loc: this.getLocation(start, this.tokenStart),
        kind,
        feature: functionName,
        value
    };
}

function generate(node) {
    this.token(types.Function, node.feature + '(');
    this.node(node.value);
    this.token(types.RightParenthesis, ')');
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
x'use strict';

const types = require('../../tokenizer/types.cjs');

const SOLIDUS = 0x002F;         // U+002F SOLIDUS (/)
const LESSTHANSIGN = 0x003C;    // U+003C LESS-THAN SIGN (<)
const EQUALSSIGN = 0x003D;      // U+003D EQUALS SIGN (=)
const GREATERTHANSIGN = 0x003E; // U+003E GREATER-THAN SIGN (>)

const name = 'FeatureRange';
const structure = {
    kind: String,
    left: ['Identifier', 'Number', 'Dimension', 'Ratio', 'Function'],
    leftComparison: String,
    middle: ['Identifier', 'Number', 'Dimension', 'Ratio', 'Function'],
    rightComparison: [String, null],
    right: ['Identifier', 'Number', 'Dimension', 'Ratio', 'Function', null]
};

function readTerm() {
    this.skipSC();

    switch (this.tokenType) {
        case types.Number:
            if (this.isDelim(SOLIDUS, this.lookupOffsetNonSC(1))) {
                return this.Ratio();
            } else {
                return this.Number();
            }

        case types.Dimension:
            return this.Dimension();

        case types.Ident:
            return this.Identifier();

        case types.Function:
            return this.parseWithFallback(
                () => {
                    const res = this.Function(this.readSequence, this.scope.Value);

                    this.skipSC();

                    if (this.isDelim(SOLIDUS)) {
                        this.error();
                    }

                    return res;
                },
                () => {
                    return this.Ratio();
                }
            );

        default:
            this.error('Number, dimension, ratio or identifier is expected');
    }
}

function readComparison(expectColon) {
    this.skipSC();

    if (this.isDelim(LESSTHANSIGN) ||
        this.isDelim(GREATERTHANSIGN)) {
        const value = this.source[this.tokenStart];

        this.next();

        if (this.isDelim(EQUALSSIGN)) {
            this.next();
            return value + '=';
        }

        return value;
    }

    if (this.isDelim(EQUALSSIGN)) {
        return '=';
    }

    this.error(`Expected ${expectColon ? '":", ' : ''}"<", ">", "=" or ")"`);
}

function parse(kind = 'unknown') {
    const start = this.tokenStart;

    this.skipSC();
    this.eat(types.LeftParenthesis);

    const left = readTerm.call(this);
    const leftComparison = readComparison.call(this, left.type === 'Identifier');
    const middle = readTerm.call(this);
    let rightComparison = null;
    let right = null;

    if (this.lookupNonWSType(0) !== types.RightParenthesis) {
        rightComparison = readComparison.call(this);
        right = readTerm.call(this);
    }

    this.skipSC();
    this.eat(types.RightParenthesis);

    return {
        type: 'FeatureRange',
        loc: this.getLocation(start, this.tokenStart),
        kind,
        left,
        leftComparison,
        middle,
        rightComparison,
        right
    };
}

function generate(node) {
    this.token(types.LeftParenthesis, '(');
    this.node(node.left);
    this.tokenize(node.leftComparison);
    this.node(node.middle);

    if (node.right) {
        this.tokenize(node.rightComparison);
        this.node(node.right);
    }

    this.token(types.RightParenthesis, ')');
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
ǿBx&'use strict';

const types = require('../../tokenizer/types.cjs');

const name = 'Function';
const walkContext = 'function';
const structure = {
    name: String,
    children: [[]]
};

// <function-token> <sequence> )
function parse(readSequence, recognizer) {
    const start = this.tokenStart;
    const name = this.consumeFunctionName();
    const nameLowerCase = name.toLowerCase();
    let children;

    children = recognizer.hasOwnProperty(nameLowerCase)
        ? recognizer[nameLowerCase].call(this, recognizer)
        : readSequence.call(this, recognizer);

    if (!this.eof) {
        this.eat(types.RightParenthesis);
    }

    return {
        type: 'Function',
        loc: this.getLocation(start, this.tokenStart),
        name,
        children
    };
}

function generate(node) {
    this.token(types.Function, node.name + '(');
    this.children(node);
    this.token(types.RightParenthesis, ')');
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
exports.walkContext = walkContext;
.[7`x'use strict';

const types = require('../../tokenizer/types.cjs');

const name = 'GeneralEnclosed';
const structure = {
    kind: String,
    function: [String, null],
    children: [[]]
};

// <function-token> <any-value> )
// ( <any-value> )
function parse(kind) {
    const start = this.tokenStart;
    let functionName = null;

    if (this.tokenType === types.Function) {
        functionName = this.consumeFunctionName();
    } else {
        this.eat(types.LeftParenthesis);
    }

    const children = this.parseWithFallback(
        () => {
            const startValueToken = this.tokenIndex;
            const children = this.readSequence(this.scope.Value);

            if (this.eof === false &&
                this.isBalanceEdge(startValueToken) === false) {
                this.error();
            }

            return children;
        },
        () => this.createSingleNodeList(
            this.Raw(null, false)
        )
    );

    if (!this.eof) {
        this.eat(types.RightParenthesis);
    }

    return {
        type: 'GeneralEnclosed',
        loc: this.getLocation(start, this.tokenStart),
        kind,
        function: functionName,
        children
    };
}

function generate(node) {
    if (node.function) {
        this.token(types.Function, node.function + '(');
    } else {
        this.token(types.LeftParenthesis, '(');
    }

    this.children(node);
    this.token(types.RightParenthesis, ')');
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
yһ$xK'use strict';

const types = require('../../tokenizer/types.cjs');

// '#' ident
const xxx = 'XXX';
const name = 'Hash';
const structure = {
    value: String
};
function parse() {
    const start = this.tokenStart;

    this.eat(types.Hash);

    return {
        type: 'Hash',
        loc: this.getLocation(start, this.tokenStart),
        value: this.substrToCursor(start + 1)
    };
}
function generate(node) {
    this.token(types.Hash, '#' + node.value);
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
exports.xxx = xxx;
Uwܿ4xO'use strict';

const types = require('../../tokenizer/types.cjs');

const name = 'IdSelector';
const structure = {
    name: String
};

function parse() {
    const start = this.tokenStart;

    // TODO: check value is an ident
    this.eat(types.Hash);

    return {
        type: 'IdSelector',
        loc: this.getLocation(start, this.tokenStart),
        name: this.substrToCursor(start + 1)
    };
}

function generate(node) {
    // Using Delim instead of Hash is a hack to avoid for a whitespace between ident and id-selector
    // in safe mode (e.g. "a#id"), because IE11 doesn't allow a sequence <ident-token> <hash-token>
    // without a whitespace in values (e.g. "1px solid#000")
    this.token(types.Delim, '#' + node.name);
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
	|cx'use strict';

const types = require('../../tokenizer/types.cjs');

const name = 'Identifier';
const structure = {
    name: String
};

function parse() {
    return {
        type: 'Identifier',
        loc: this.getLocation(this.tokenStart, this.tokenEnd),
        name: this.consume(types.Ident)
    };
}

function generate(node) {
    this.token(types.Ident, node.name);
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
ۿ*xP'use strict';

const types = require('../../tokenizer/types.cjs');

const FULLSTOP = 0x002E; // U+002E FULL STOP (.)

const name = 'Layer';
const structure = {
    name: String
};

function parse() {
    let tokenStart = this.tokenStart;
    let name = this.consume(types.Ident);

    while (this.isDelim(FULLSTOP)) {
        this.eat(types.Delim);
        name += '.' + this.consume(types.Ident);
    }

    return {
        type: 'Layer',
        loc: this.getLocation(tokenStart, this.tokenStart),
        name
    };
}

function generate(node) {
    this.tokenize(node.name);
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
2x*'use strict';

const types = require('../../tokenizer/types.cjs');

const name = 'SelectorList';
const walkContext = 'selector';
const structure = {
    children: [[
        'Selector',
        'Raw'
    ]]
};

function parse() {
    const children = this.createList();

    while (!this.eof) {
        children.push(this.Selector());

        if (this.tokenType === types.Comma) {
            this.next();
            continue;
        }

        break;
    }

    return {
        type: 'SelectorList',
        loc: this.getLocationFromList(children),
        children
    };
}

function generate(node) {
    this.children(node, () => this.token(types.Comma, ','));
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
exports.walkContext = walkContext;
7x <R	LayerList~1LayerMthis.skipSC
80Layer());

        if (this.lookupTypeNonSC(0) !lSbreak;
        }

        this.skipSC();
        this.next();
        this.skipSC()%Layel8x
'use strict';

const types = require('../../tokenizer/types.cjs');

const name = 'MediaQuery';
const structure = {
    modifier: [String, null],
    mediaType: [String, null],
    condition: ['Condition', null]
};

function parse() {
    const start = this.tokenStart;
    let modifier = null;
    let mediaType = null;
    let condition = null;

    this.skipSC();

    if (this.tokenType === types.Ident && this.lookupTypeNonSC(1) !== types.LeftParenthesis) {
        // [ not | only ]? <media-type>
        const ident = this.consume(types.Ident);
        const identLowerCase = ident.toLowerCase();

        if (identLowerCase === 'not' || identLowerCase === 'only') {
            this.skipSC();
            modifier = identLowerCase;
            mediaType = this.consume(types.Ident);
        } else {
            mediaType = ident;
        }

        switch (this.lookupTypeNonSC(0)) {
            case types.Ident: {
                // and <media-condition-without-or>
                this.skipSC();
                this.eatIdent('and');
                condition = this.Condition('media');
                break;
            }

            case types.LeftCurlyBracket:
            case types.Semicolon:
            case types.Comma:
            case types.EOF:
                break;

            default:
                this.error('Identifier or parenthesis is expected');
        }
    } else {
        switch (this.tokenType) {
            case types.Ident:
            case types.LeftParenthesis:
            case types.Function: {
                // <media-condition>
                condition = this.Condition('media');
                break;
            }

            case types.LeftCurlyBracket:
            case types.Semicolon:
            case types.EOF:
                break;

            default:
                this.error('Identifier or parenthesis is expected');
        }
    }

    return {
        type: 'MediaQuery',
        loc: this.getLocation(start, this.tokenStart),
        modifier,
        mediaType,
        condition
    };
}

function generate(node) {
    if (node.mediaType) {
        if (node.modifier) {
            this.token(types.Ident, node.modifier);
        }

        this.token(types.Ident, node.mediaType);

        if (node.condition) {
            this.token(types.Ident, 'and');
            this.node(node.condition);
        }
    } else if (node.condition) {
        this.node(node.condition);
    }
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
%L-x!'use strict';

const types = require('../../tokenizer/types.cjs');

const name = 'MediaQueryList';
const structure = {
    children: [[
        'MediaQuery'
    ]]
};

function parse() {
    const children = this.createList();

    this.skipSC();

    while (!this.eof) {
        children.push(this.MediaQuery());

        if (this.tokenType !== types.Comma) {
            break;
        }

        this.next();
    }

    return {
        type: 'MediaQueryList',
        loc: this.getLocationFromList(children),
        children
    };
}

function generate(node) {
    this.children(node, () => this.token(types.Comma, ','));
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
.x	x gJHAMPERSAND = 0x0026;       // U+0026 AMPERSAND (&)

const name = 'Nesting
:
    this.eatDelim(AMPERSAND);JNesting@!&o*ѳAx'use strict';

const types = require('../../tokenizer/types.cjs');

const name = 'Nth';
const structure = {
    nth: ['AnPlusB', 'Identifier'],
    selector: ['SelectorList', null]
};

function parse() {
    this.skipSC();

    const start = this.tokenStart;
    let end = start;
    let selector = null;
    let nth;

    if (this.lookupValue(0, 'odd') || this.lookupValue(0, 'even')) {
        nth = this.Identifier();
    } else {
        nth = this.AnPlusB();
    }

    end = this.tokenStart;
    this.skipSC();

    if (this.lookupValue(0, 'of')) {
        this.next();

        selector = this.SelectorList();
        end = this.tokenStart;
    }

    return {
        type: 'Nth',
        loc: this.getLocation(start, end),
        nth,
        selector
    };
}

function generate(node) {
    this.node(node.nth);
    if (node.selector !== null) {
        this.token(types.Ident, 'of');
        this.node(node.selector);
    }
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
~9;x 'use strict';

const types = require('../../tokenizer/types.cjs');

const name = 'Number';
const structure = {
    value: String
};

function parse() {
    return {
        type: 'Number',
        loc: this.getLocation(this.tokenStart, this.tokenEnd),
        value: this.consume(types.Number)
    };
}

function generate(node) {
    this.token(types.Number, node.value);
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
Ыx	'use strict';

// '/' | '*' | ',' | ':' | '+' | '-'
const name = 'Operator';
const structure = {
    value: String
};

function parse() {
    const start = this.tokenStart;

    this.next();

    return {
        type: 'Operator',
        loc: this.getLocation(start, this.tokenStart),
        value: this.substrToCursor(start)
    };
}

function generate(node) {
    this.tokenize(node.value);
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
ӟj0x'use strict';

const types = require('../../tokenizer/types.cjs');

const name = 'Parentheses';
const structure = {
    children: [[]]
};

function parse(readSequence, recognizer) {
    const start = this.tokenStart;
    let children = null;

    this.eat(types.LeftParenthesis);

    children = readSequence.call(this, recognizer);

    if (!this.eof) {
        this.eat(types.RightParenthesis);
    }

    return {
        type: 'Parentheses',
        loc: this.getLocation(start, this.tokenStart),
        children
    };
}

function generate(node) {
    this.token(types.LeftParenthesis, '(');
    this.children(node);
    this.token(types.RightParenthesis, ')');
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
>%ûx'use strict';

const types = require('../../tokenizer/types.cjs');

const name = 'Percentage';
const structure = {
    value: String
};

function parse() {
    return {
        type: 'Percentage',
        loc: this.getLocation(this.tokenStart, this.tokenEnd),
        value: this.consumeNumber(types.Percentage)
    };
}

function generate(node) {
    this.token(types.Percentage, node.value + '%');
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
Tpx& XClass_w׿ClassLs@x'use strict';

const types = require('../../tokenizer/types.cjs');

const SOLIDUS = 0x002F;  // U+002F SOLIDUS (/)

// Media Queries Level 3 defines terms of <ratio> as a positive (not zero or negative)
// integers (see https://drafts.csswg.org/mediaqueries-3/#values)
// However, Media Queries Level 4 removes any definition of values
// (see https://drafts.csswg.org/mediaqueries-4/#values) and refers to
// CSS Values and Units for detail. In CSS Values and Units Level 4 a <ratio>
// definition was added (see https://drafts.csswg.org/css-values-4/#ratios) which
// defines ratio as "<number [0,∞]> [ / <number [0,∞]> ]?" and based on it
// any constrains on terms were removed. Parser also doesn't test numbers
// in any way to make possible for linting and fixing them by the tools using CSSTree.
// An additional syntax examination may be applied by a lexer.
function consumeTerm() {
    this.skipSC();

    switch (this.tokenType) {
        case types.Number:
            return this.Number();

        case types.Function:
            return this.Function(this.readSequence, this.scope.Value);

        default:
            this.error('Number of function is expected');
    }
}

const name = 'Ratio';
const structure = {
    left: ['Number', 'Function'],
    right: ['Number', 'Function', null]
};

// <number [0,∞]> [ / <number [0,∞]> ]?
function parse() {
    const start = this.tokenStart;
    const left = consumeTerm.call(this);
    let right = null;

    this.skipSC();
    if (this.isDelim(SOLIDUS)) {
        this.eatDelim(SOLIDUS);
        right = consumeTerm.call(this);
    }

    return {
        type: 'Ratio',
        loc: this.getLocation(start, this.tokenStart),
        left,
        right
    };
}

function generate(node) {
    this.node(node.left);
    this.token(types.Delim, '/');
    if (node.right) {
        this.node(node.right);
    } else {
        this.node(types.Number, 1);
    }
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
hGxw'use strict';

const types = require('../../tokenizer/types.cjs');

function getOffsetExcludeWS() {
    if (this.tokenIndex > 0) {
        if (this.lookupType(-1) === types.WhiteSpace) {
            return this.tokenIndex > 1
                ? this.getTokenStart(this.tokenIndex - 1)
                : this.firstCharOffset;
        }
    }

    return this.tokenStart;
}

const name = 'Raw';
const structure = {
    value: String
};

function parse(consumeUntil, excludeWhiteSpace) {
    const startOffset = this.getTokenStart(this.tokenIndex);
    let endOffset;

    this.skipUntilBalanced(this.tokenIndex, consumeUntil || this.consumeUntilBalanceEnd);

    if (excludeWhiteSpace && this.tokenStart > startOffset) {
        endOffset = getOffsetExcludeWS.call(this);
    } else {
        endOffset = this.tokenStart;
    }

    return {
        type: 'Raw',
        loc: this.getLocation(startOffset, endOffset),
        value: this.substring(startOffset, endOffset)
    };
}

function generate(node) {
    this.tokenize(node.value);
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
#oNx'use strict';

const types = require('../../tokenizer/types.cjs');

function consumeRaw() {
    return this.Raw(this.consumeUntilLeftCurlyBracket, true);
}

function consumePrelude() {
    const prelude = this.SelectorList();

    if (prelude.type !== 'Raw' &&
        this.eof === false &&
        this.tokenType !== types.LeftCurlyBracket) {
        this.error();
    }

    return prelude;
}

const name = 'Rule';
const walkContext = 'rule';
const structure = {
    prelude: ['SelectorList', 'Raw'],
    block: ['Block']
};

function parse() {
    const startToken = this.tokenIndex;
    const startOffset = this.tokenStart;
    let prelude;
    let block;

    if (this.parseRulePrelude) {
        prelude = this.parseWithFallback(consumePrelude, consumeRaw);
    } else {
        prelude = consumeRaw.call(this, startToken);
    }

    block = this.Block(true, { allowNestedRules: true });

    return {
        type: 'Rule',
        loc: this.getLocation(startOffset, this.tokenStart),
        prelude,
        block
    };
}
function generate(node) {
    this.node(node.prelude);
    this.node(node.block);
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
exports.walkContext = walkContext;
˔)dxK'use strict';

const types = require('../../tokenizer/types.cjs');

const name = 'Scope';
const structure = {
    root: ['SelectorList', 'Raw', null],
    limit: ['SelectorList', 'Raw', null]
};

function parse() {
    let root = null;
    let limit = null;

    this.skipSC();

    const startOffset = this.tokenStart;
    if (this.tokenType === types.LeftParenthesis) {
        this.next();
        this.skipSC();
        root = this.parseWithFallback(
            this.SelectorList,
            () => this.Raw(false, true)
        );
        this.skipSC();
        this.eat(types.RightParenthesis);
    }

    if (this.lookupNonWSType(0) === types.Ident) {
        this.skipSC();
        this.eatIdent('to');
        this.skipSC();
        this.eat(types.LeftParenthesis);
        this.skipSC();
        limit = this.parseWithFallback(
            this.SelectorList,
            () => this.Raw(false, true)
        );
        this.skipSC();
        this.eat(types.RightParenthesis);
    }

    return {
        type: 'Scope',
        loc: this.getLocation(startOffset, this.tokenStart),
        root,
        limit
    };
}

function generate(node) {
    if (node.root) {
        this.token(types.LeftParenthesis, '(');
        this.node(node.root);
        this.token(types.RightParenthesis, ')');
    }

    if (node.limit) {
        this.token(types.Ident, 'to');
        this.token(types.LeftParenthesis, '(');
        this.node(node.limit);
        this.token(types.RightParenthesis, ')');
    }
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
z/x'use strict';

const name = 'Selector';
const structure = {
    children: [[
        'TypeSelector',
        'IdSelector',
        'ClassSelector',
        'AttributeSelector',
        'PseudoClassSelector',
        'PseudoElementSelector',
        'Combinator'
    ]]
};

function parse() {
    const children = this.readSequence(this.scope.Selector);

    // nothing were consumed
    if (this.getFirstListNode(children) === null) {
        this.error('Selector is expected');
    }

    return {
        type: 'Selector',
        loc: this.getLocationFromList(children),
        children
    };
}

function generate(node) {
    this.children(node);
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
ܓJ"x/'use strict';

const string = require('../../utils/string.cjs');
const types = require('../../tokenizer/types.cjs');

const name = 'String';
const structure = {
    value: String
};

function parse() {
    return {
        type: 'String',
        loc: this.getLocation(this.tokenStart, this.tokenEnd),
        value: string.decode(this.consume(types.String))
    };
}

function generate(node) {
    this.token(types.String, string.encode(node.value));
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
{}x"'use strict';

const types = require('../../tokenizer/types.cjs');

const EXCLAMATIONMARK = 0x0021; // U+0021 EXCLAMATION MARK (!)

function consumeRaw() {
    return this.Raw(null, false);
}

const name = 'StyleSheet';
const walkContext = 'stylesheet';
const structure = {
    children: [[
        'Comment',
        'CDO',
        'CDC',
        'Atrule',
        'Rule',
        'Raw'
    ]]
};

function parse() {
    const start = this.tokenStart;
    const children = this.createList();
    let child;

    while (!this.eof) {
        switch (this.tokenType) {
            case types.WhiteSpace:
                this.next();
                continue;

            case types.Comment:
                // ignore comments except exclamation comments (i.e. /*! .. */) on top level
                if (this.charCodeAt(this.tokenStart + 2) !== EXCLAMATIONMARK) {
                    this.next();
                    continue;
                }

                child = this.Comment();
                break;

            case types.CDO: // <!--
                child = this.CDO();
                break;

            case types.CDC: // -->
                child = this.CDC();
                break;

            // CSS Syntax Module Level 3
            // §2.2 Error handling
            // At the "top level" of a stylesheet, an <at-keyword-token> starts an at-rule.
            case types.AtKeyword:
                child = this.parseWithFallback(this.Atrule, consumeRaw);
                break;

            // Anything else starts a qualified rule ...
            default:
                child = this.parseWithFallback(this.Rule, consumeRaw);
        }

        children.push(child);
    }

    return {
        type: 'StyleSheet',
        loc: this.getLocation(start, this.tokenStart),
        children
    };
}

function generate(node) {
    this.children(node);
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
exports.walkContext = walkContext;
@e/"7xRSupportsDeclarav.declaration: 'Declaration'
};

function parse('c
    this.eat(types.LeftParenthesis);
    this.skipSC();

    const declaration = this.Declaration(6fSupportsDeclaraF
declaratio;7LeftParenthesis, '(');
    this.node(node.declaration); 1^ɲpx'use strict';

const types = require('../../tokenizer/types.cjs');

const ASTERISK = 0x002A;     // U+002A ASTERISK (*)
const VERTICALLINE = 0x007C; // U+007C VERTICAL LINE (|)

function eatIdentifierOrAsterisk() {
    if (this.tokenType !== types.Ident &&
        this.isDelim(ASTERISK) === false) {
        this.error('Identifier or asterisk is expected');
    }

    // Check if asterisk is followed immediately by an ident (no whitespace)
    // This is invalid in selectors (e.g., "*foo" should error, "* foo" or "*:hover" is ok)
    if (this.isDelim(ASTERISK)) {
        const currentTokenEnd = this.tokenStart + 1; // asterisk is 1 char
        this.next();

        // If next token is an ident and starts immediately after asterisk, it's an error
        if (this.tokenType === types.Ident && this.tokenStart === currentTokenEnd) {
            this.error('Whitespace is required between universal selector and type selector');
        }

        return;
    }

    this.next();
}

const name = 'TypeSelector';
const structure = {
    name: String
};

// ident
// ident|ident
// ident|*
// *
// *|ident
// *|*
// |ident
// |*
function parse() {
    const start = this.tokenStart;

    if (this.isDelim(VERTICALLINE)) {
        this.next();
        eatIdentifierOrAsterisk.call(this);
    } else {
        eatIdentifierOrAsterisk.call(this);

        if (this.isDelim(VERTICALLINE)) {
            this.next();
            eatIdentifierOrAsterisk.call(this);
        }
    }

    return {
        type: 'TypeSelector',
        loc: this.getLocation(start, this.tokenStart),
        name: this.substrToCursor(start)
    };
}

function generate(node) {
    this.tokenize(node.name);
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
('rxG'use strict';

const types = require('../../tokenizer/types.cjs');
const charCodeDefinitions = require('../../tokenizer/char-code-definitions.cjs');

const PLUSSIGN = 0x002B;     // U+002B PLUS SIGN (+)
const HYPHENMINUS = 0x002D;  // U+002D HYPHEN-MINUS (-)
const QUESTIONMARK = 0x003F; // U+003F QUESTION MARK (?)

function eatHexSequence(offset, allowDash) {
    let len = 0;

    for (let pos = this.tokenStart + offset; pos < this.tokenEnd; pos++) {
        const code = this.charCodeAt(pos);

        if (code === HYPHENMINUS && allowDash && len !== 0) {
            eatHexSequence.call(this, offset + len + 1, false);
            return -1;
        }

        if (!charCodeDefinitions.isHexDigit(code)) {
            this.error(
                allowDash && len !== 0
                    ? 'Hyphen minus' + (len < 6 ? ' or hex digit' : '') + ' is expected'
                    : (len < 6 ? 'Hex digit is expected' : 'Unexpected input'),
                pos
            );
        }

        if (++len > 6) {
            this.error('Too many hex digits', pos);
        }    }

    this.next();
    return len;
}

function eatQuestionMarkSequence(max) {
    let count = 0;

    while (this.isDelim(QUESTIONMARK)) {
        if (++count > max) {
            this.error('Too many question marks');
        }

        this.next();
    }
}

function startsWith(code) {
    if (this.charCodeAt(this.tokenStart) !== code) {
        this.error((code === PLUSSIGN ? 'Plus sign' : 'Hyphen minus') + ' is expected');
    }
}

// https://drafts.csswg.org/css-syntax/#urange
// Informally, the <urange> production has three forms:
// U+0001
//      Defines a range consisting of a single code point, in this case the code point "1".
// U+0001-00ff
//      Defines a range of codepoints between the first and the second value, in this case
//      the range between "1" and "ff" (255 in decimal) inclusive.
// U+00??
//      Defines a range of codepoints where the "?" characters range over all hex digits,
//      in this case defining the same as the value U+0000-00ff.
// In each form, a maximum of 6 digits is allowed for each hexadecimal number (if you treat "?" as a hexadecimal digit).
//
// <urange> =
//   u '+' <ident-token> '?'* |
//   u <dimension-token> '?'* |
//   u <number-token> '?'* |
//   u <number-token> <dimension-token> |
//   u <number-token> <number-token> |
//   u '+' '?'+
function scanUnicodeRange() {
    let hexLength = 0;

    switch (this.tokenType) {
        case types.Number:
            // u <number-token> '?'*
            // u <number-token> <dimension-token>
            // u <number-token> <number-token>
            hexLength = eatHexSequence.call(this, 1, true);

            if (this.isDelim(QUESTIONMARK)) {
                eatQuestionMarkSequence.call(this, 6 - hexLength);
                break;
            }

            if (this.tokenType === types.Dimension ||
                this.tokenType === types.Number) {
                startsWith.call(this, HYPHENMINUS);
                eatHexSequence.call(this, 1, false);
                break;
            }

            break;

        case types.Dimension:
            // u <dimension-token> '?'*
            hexLength = eatHexSequence.call(this, 1, true);

            if (hexLength > 0) {
                eatQuestionMarkSequence.call(this, 6 - hexLength);
            }

            break;

        default:
            // u '+' <ident-token> '?'*
            // u '+' '?'+
            this.eatDelim(PLUSSIGN);

            if (this.tokenType === types.Ident) {
                hexLength = eatHexSequence.call(this, 0, true);
                if (hexLength > 0) {
                    eatQuestionMarkSequence.call(this, 6 - hexLength);
                }
                break;
            }

            if (this.isDelim(QUESTIONMARK)) {
                this.next();
                eatQuestionMarkSequence.call(this, 5);
                break;
            }

            this.error('Hex digit or question mark is expected');
    }
}

const name = 'UnicodeRange';
const structure = {
    value: String
};

function parse() {
    const start = this.tokenStart;

    // U or u
    this.eatIdent('u');
    scanUnicodeRange.call(this);

    return {
        type: 'UnicodeRange',
        loc: this.getLocation(start, this.tokenStart),
        value: this.substrToCursor(start)
    };
}

function generate(node) {
    this.tokenize(node.value);
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
Px	'use strict';

const url = require('../../utils/url.cjs');
const string = require('../../utils/string.cjs');
const types = require('../../tokenizer/types.cjs');

const name = 'Url';
const structure = {
    value: String
};

// <url-token> | <function-token> <string> )
function parse() {
    const start = this.tokenStart;
    let value;

    switch (this.tokenType) {
        case types.Url:
            value = url.decode(this.consume(types.Url));
            break;

        case types.Function:
            if (!this.cmpStr(this.tokenStart, this.tokenEnd, 'url(')) {
                this.error('Function name must be `url`');
            }

            this.eat(types.Function);
            this.skipSC();
            value = string.decode(this.consume(types.String));
            this.skipSC();
            if (!this.eof) {
                this.eat(types.RightParenthesis);
            }
            break;

        default:
            this.error('Url or Function is expected');
    }

    return {
        type: 'Url',
        loc: this.getLocation(start, this.tokenStart),
        value
    };
}

function generate(node) {
    this.token(types.Url, url.encode(node.value));
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
zx*'use strict';

const name = 'Value';
const structure = {
    children: [[]]
};

function parse() {
    const start = this.tokenStart;
    const children = this.readSequence(this.scope.Value);

    return {
        type: 'Value',
        loc: this.getLocation(start, this.tokenStart),
        children
    };
}

function generate(node) {
    this.children(node);
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
34(x{'use strict';

const types = require('../../tokenizer/types.cjs');

const SPACE = Object.freeze({
    type: 'WhiteSpace',
    loc: null,
    value: ' '
});

const name = 'WhiteSpace';
const structure = {
    value: String
};

function parse() {
    this.eat(types.WhiteSpace);
    return SPACE;

    // return {
    //     type: 'WhiteSpace',
    //     loc: this.getLocation(this.tokenStart, this.tokenEnd),
    //     value: this.consume(WHITESPACE)
    // };
}

function generate(node) {
    this.token(types.WhiteSpace, node.value);
}

exports.generate = generate;
exports.name = name;
exports.parse = parse;
exports.structure = structure;
<dx#'use strict';

const AnPlusB = require('./AnPlusB.cjs');
const Atrule = require('./Atrule.cjs');
const AtrulePrelude = require('./AtrulePrelude.cjs');
const AttributeSelector = require('./AttributeSelector.cjs');
const Block = require('./Block.cjs');
const Brackets = require('./Brackets.cjs');
const CDC = require('./CDC.cjs');
const CDO = require('./CDO.cjs');
const ClassSelector = require('./ClassSelector.cjs');
const Combinator = require('./Combinator.cjs');
const Comment = require('./Comment.cjs');
const Condition = require('./Condition.cjs');
const Declaration = require('./Declaration.cjs');
const DeclarationList = require('./DeclarationList.cjs');
const Dimension = require('./Dimension.cjs');
const Feature = require('./Feature.cjs');
const FeatureFunction = require('./FeatureFunction.cjs');
const FeatureRange = require('./FeatureRange.cjs');
const Function = require('./Function.cjs');
const GeneralEnclosed = require('./GeneralEnclosed.cjs');
const Hash = require('./Hash.cjs');
const Identifier = require('./Identifier.cjs');
const IdSelector = require('./IdSelector.cjs');
const Layer = require('./Layer.cjs');
const LayerList = require('./LayerList.cjs');
const MediaQuery = require('./MediaQuery.cjs');
const MediaQueryList = require('./MediaQueryList.cjs');
const NestingSelector = require('./NestingSelector.cjs');
const Nth = require('./Nth.cjs');
const Number = require('./Number.cjs');
const Operator = require('./Operator.cjs');
const Parentheses = require('./Parentheses.cjs');
const Percentage = require('./Percentage.cjs');
const PseudoClassSelector = require('./PseudoClassSelector.cjs');
const PseudoElementSelector = require('./PseudoElementSelector.cjs');
const Ratio = require('./Ratio.cjs');
const Raw = require('./Raw.cjs');
const Rule = require('./Rule.cjs');
const Scope = require('./Scope.cjs');
const Selector = require('./Selector.cjs');
const SelectorList = require('./SelectorList.cjs');
const String = require('./String.cjs');
const StyleSheet = require('./StyleSheet.cjs');
const SupportsDeclaration = require('./SupportsDeclaration.cjs');
const TypeSelector = require('./TypeSelector.cjs');
const UnicodeRange = require('./UnicodeRange.cjs');
const Url = require('./Url.cjs');
const Value = require('./Value.cjs');
const WhiteSpace = require('./WhiteSpace.cjs');



exports.AnPlusB = AnPlusB.generate;
exports.Atrule = Atrule.generate;
exports.AtrulePrelude = AtrulePrelude.generate;
exports.AttributeSelector = AttributeSelector.generate;
exports.Block = Block.generate;
exports.Brackets = Brackets.generate;
exports.CDC = CDC.generate;
exports.CDO = CDO.generate;
exports.ClassSelector = ClassSelector.generate;
exports.Combinator = Combinator.generate;
exports.Comment = Comment.generate;
exports.Condition = Condition.generate;
exports.Declaration = Declaration.generate;
exports.DeclarationList = DeclarationList.generate;
exports.Dimension = Dimension.generate;
exports.Feature = Feature.generate;
exports.FeatureFunction = FeatureFunction.generate;
exports.FeatureRange = FeatureRange.generate;
exports.Function = Function.generate;
exports.GeneralEnclosed = GeneralEnclosed.generate;
exports.Hash = Hash.generate;
exports.Identifier = Identifier.generate;
exports.IdSelector = IdSelector.generate;
exports.Layer = Layer.generate;
exports.LayerList = LayerList.generate;
exports.MediaQuery = MediaQuery.generate;
exports.MediaQueryList = MediaQueryList.generate;
exports.NestingSelector = NestingSelector.generate;
exports.Nth = Nth.generate;
exports.Number = Number.generate;
exports.Operator = Operator.generate;
exports.Parentheses = Parentheses.generate;
exports.Percentage = Percentage.generate;
exports.PseudoClassSelector = PseudoClassSelector.generate;
exports.PseudoElementSelector = PseudoElementSelector.generate;
exports.Ratio = Ratio.generate;
exports.Raw = Raw.generate;
exports.Rule = Rule.generate;
exports.Scope = Scope.generate;
exports.Selector = Selector.generate;
exports.SelectorList = SelectorList.generate;
exports.String = String.generate;
exports.StyleSheet = StyleSheet.generate;
exports.SupportsDeclaration = SupportsDeclaration.generate;
exports.TypeSelector = TypeSelector.generate;
exports.UnicodeRange = UnicodeRange.generate;
exports.Url = Url.generate;
exports.Value = Value.generate;
exports.WhiteSpace = WhiteSpace.generate;
ax'use strict';

const AnPlusB = require('./AnPlusB.cjs');
const AttributeSelector = require('./AttributeSelector.cjs');
const ClassSelector = require('./ClassSelector.cjs');
const Combinator = require('./Combinator.cjs');
const Identifier = require('./Identifier.cjs');
const IdSelector = require('./IdSelector.cjs');
const NestingSelector = require('./NestingSelector.cjs');
const Nth = require('./Nth.cjs');
const Operator = require('./Operator.cjs');
const Percentage = require('./Percentage.cjs');
const PseudoClassSelector = require('./PseudoClassSelector.cjs');
const PseudoElementSelector = require('./PseudoElementSelector.cjs');
const Raw = require('./Raw.cjs');
const Selector = require('./Selector.cjs');
const SelectorList = require('./SelectorList.cjs');
const String = require('./String.cjs');
const TypeSelector = require('./TypeSelector.cjs');



exports.AnPlusB = AnPlusB.parse;
exports.AttributeSelector = AttributeSelector.parse;
exports.ClassSelector = ClassSelector.parse;
exports.Combinator = Combinator.parse;
exports.Identifier = Identifier.parse;
exports.IdSelector = IdSelector.parse;
exports.NestingSelector = NestingSelector.parse;
exports.Nth = Nth.parse;
exports.Operator = Operator.parse;
exports.Percentage = Percentage.parse;
exports.PseudoClassSelector = PseudoClassSelector.parse;
exports.PseudoElementSelector = PseudoElementSelector.parse;
exports.Raw = Raw.parse;
exports.Selector = Selector.parse;
exports.SelectorList = SelectorList.parse;
exports.String = String.parse;
exports.TypeSelector = TypeSelector.parse;
I'¹xI'use strict';

const AnPlusB = require('./AnPlusB.cjs');
const Atrule = require('./Atrule.cjs');
const AtrulePrelude = require('./AtrulePrelude.cjs');
const AttributeSelector = require('./AttributeSelector.cjs');
const Block = require('./Block.cjs');
const Brackets = require('./Brackets.cjs');
const CDC = require('./CDC.cjs');
const CDO = require('./CDO.cjs');
const ClassSelector = require('./ClassSelector.cjs');
const Combinator = require('./Combinator.cjs');
const Comment = require('./Comment.cjs');
const Condition = require('./Condition.cjs');
const Declaration = require('./Declaration.cjs');
const DeclarationList = require('./DeclarationList.cjs');
const Dimension = require('./Dimension.cjs');
const Feature = require('./Feature.cjs');
const FeatureFunction = require('./FeatureFunction.cjs');
const FeatureRange = require('./FeatureRange.cjs');
const Function = require('./Function.cjs');
const GeneralEnclosed = require('./GeneralEnclosed.cjs');
const Hash = require('./Hash.cjs');
const Identifier = require('./Identifier.cjs');
const IdSelector = require('./IdSelector.cjs');
const Layer = require('./Layer.cjs');
const LayerList = require('./LayerList.cjs');
const MediaQuery = require('./MediaQuery.cjs');
const MediaQueryList = require('./MediaQueryList.cjs');
const NestingSelector = require('./NestingSelector.cjs');
const Nth = require('./Nth.cjs');
const Number = require('./Number.cjs');
const Operator = require('./Operator.cjs');
const Parentheses = require('./Parentheses.cjs');
const Percentage = require('./Percentage.cjs');
const PseudoClassSelector = require('./PseudoClassSelector.cjs');
const PseudoElementSelector = require('./PseudoElementSelector.cjs');
const Ratio = require('./Ratio.cjs');
const Raw = require('./Raw.cjs');
const Rule = require('./Rule.cjs');
const Scope = require('./Scope.cjs');
const Selector = require('./Selector.cjs');
const SelectorList = require('./SelectorList.cjs');
const String = require('./String.cjs');
const StyleSheet = require('./StyleSheet.cjs');
const SupportsDeclaration = require('./SupportsDeclaration.cjs');
const TypeSelector = require('./TypeSelector.cjs');
const UnicodeRange = require('./UnicodeRange.cjs');
const Url = require('./Url.cjs');
const Value = require('./Value.cjs');
const WhiteSpace = require('./WhiteSpace.cjs');



exports.AnPlusB = AnPlusB.parse;
exports.Atrule = Atrule.parse;
exports.AtrulePrelude = AtrulePrelude.parse;
exports.AttributeSelector = AttributeSelector.parse;
exports.Block = Block.parse;
exports.Brackets = Brackets.parse;
exports.CDC = CDC.parse;
exports.CDO = CDO.parse;
exports.ClassSelector = ClassSelector.parse;
exports.Combinator = Combinator.parse;
exports.Comment = Comment.parse;
exports.Condition = Condition.parse;
exports.Declaration = Declaration.parse;
exports.DeclarationList = DeclarationList.parse;
exports.Dimension = Dimension.parse;
exports.Feature = Feature.parse;
exports.FeatureFunction = FeatureFunction.parse;
exports.FeatureRange = FeatureRange.parse;
exports.Function = Function.parse;
exports.GeneralEnclosed = GeneralEnclosed.parse;
exports.Hash = Hash.parse;
exports.Identifier = Identifier.parse;
exports.IdSelector = IdSelector.parse;
exports.Layer = Layer.parse;
exports.LayerList = LayerList.parse;
exports.MediaQuery = MediaQuery.parse;
exports.MediaQueryList = MediaQueryList.parse;
exports.NestingSelector = NestingSelector.parse;
exports.Nth = Nth.parse;
exports.Number = Number.parse;
exports.Operator = Operator.parse;
exports.Parentheses = Parentheses.parse;
exports.Percentage = Percentage.parse;
exports.PseudoClassSelector = PseudoClassSelector.parse;
exports.PseudoElementSelector = PseudoElementSelector.parse;
exports.Ratio = Ratio.parse;
exports.Raw = Raw.parse;
exports.Rule = Rule.parse;
exports.Scope = Scope.parse;
exports.Selector = Selector.parse;
exports.SelectorList = SelectorList.parse;
exports.String = String.parse;
exports.StyleSheet = StyleSheet.parse;
exports.SupportsDeclaration = SupportsDeclaration.parse;
exports.TypeSelector = TypeSelector.parse;
exports.UnicodeRange = UnicodeRange.parse;
exports.Url = Url.parse;
exports.Value = Value.parse;
exports.WhiteSpace = WhiteSpace.parse;
$x+'use strict';

const AnPlusB = require('./AnPlusB.cjs');
const Atrule = require('./Atrule.cjs');
const AtrulePrelude = require('./AtrulePrelude.cjs');
const AttributeSelector = require('./AttributeSelector.cjs');
const Block = require('./Block.cjs');
const Brackets = require('./Brackets.cjs');
const CDC = require('./CDC.cjs');
const CDO = require('./CDO.cjs');
const ClassSelector = require('./ClassSelector.cjs');
const Combinator = require('./Combinator.cjs');
const Comment = require('./Comment.cjs');
const Condition = require('./Condition.cjs');
const Declaration = require('./Declaration.cjs');
const DeclarationList = require('./DeclarationList.cjs');
const Dimension = require('./Dimension.cjs');
const Feature = require('./Feature.cjs');
const FeatureFunction = require('./FeatureFunction.cjs');
const FeatureRange = require('./FeatureRange.cjs');
const Function = require('./Function.cjs');
const GeneralEnclosed = require('./GeneralEnclosed.cjs');
const Hash = require('./Hash.cjs');
const Identifier = require('./Identifier.cjs');
const IdSelector = require('./IdSelector.cjs');
const Layer = require('./Layer.cjs');
const LayerList = require('./LayerList.cjs');
const MediaQuery = require('./MediaQuery.cjs');
const MediaQueryList = require('./MediaQueryList.cjs');
const NestingSelector = require('./NestingSelector.cjs');
const Nth = require('./Nth.cjs');
const Number$1 = require('./Number.cjs');
const Operator = require('./Operator.cjs');
const Parentheses = require('./Parentheses.cjs');
const Percentage = require('./Percentage.cjs');
const PseudoClassSelector = require('./PseudoClassSelector.cjs');
const PseudoElementSelector = require('./PseudoElementSelector.cjs');
const Ratio = require('./Ratio.cjs');
const Raw = require('./Raw.cjs');
const Rule = require('./Rule.cjs');
const Scope = require('./Scope.cjs');
const Selector = require('./Selector.cjs');
const SelectorList = require('./SelectorList.cjs');
const String$1 = require('./String.cjs');
const StyleSheet = require('./StyleSheet.cjs');
const SupportsDeclaration = require('./SupportsDeclaration.cjs');
const TypeSelector = require('./TypeSelector.cjs');
const UnicodeRange = require('./UnicodeRange.cjs');
const Url = require('./Url.cjs');
const Value = require('./Value.cjs');
const WhiteSpace = require('./WhiteSpace.cjs');



exports.AnPlusB = AnPlusB;
exports.Atrule = Atrule;
exports.AtrulePrelude = AtrulePrelude;
exports.AttributeSelector = AttributeSelector;
exports.Block = Block;
exports.Brackets = Brackets;
exports.CDC = CDC;
exports.CDO = CDO;
exports.ClassSelector = ClassSelector;
exports.Combinator = Combinator;
exports.Comment = Comment;
exports.Condition = Condition;
exports.Declaration = Declaration;
exports.DeclarationList = DeclarationList;
exports.Dimension = Dimension;
exports.Feature = Feature;
exports.FeatureFunction = FeatureFunction;
exports.FeatureRange = FeatureRange;
exports.Function = Function;
exports.GeneralEnclosed = GeneralEnclosed;
exports.Hash = Hash;
exports.Identifier = Identifier;
exports.IdSelector = IdSelector;
exports.Layer = Layer;
exports.LayerList = LayerList;
exports.MediaQuery = MediaQuery;
exports.MediaQueryList = MediaQueryList;
exports.NestingSelector = NestingSelector;
exports.Nth = Nth;
exports.Number = Number$1;
exports.Operator = Operator;
exports.Parentheses = Parentheses;
exports.Percentage = Percentage;
exports.PseudoClassSelector = PseudoClassSelector;
exports.PseudoElementSelector = PseudoElementSelector;
exports.Ratio = Ratio;
exports.Raw = Raw;
exports.Rule = Rule;
exports.Scope = Scope;
exports.Selector = Selector;
exports.SelectorList = SelectorList;
exports.String = String$1;
exports.StyleSheet = StyleSheet;
exports.SupportsDeclaration = SupportsDeclaration;
exports.TypeSelector = TypeSelector;
exports.UnicodeRange = UnicodeRange;
exports.Url = Url;
exports.Value = Value;
exports.WhiteSpace = WhiteSpace;
KxI 100644 index.cjs 7k./S5()100644 lang.cjs kpA_̫N[Cx0'use strict';

const lang = require('./lang.cjs');

const selectorList = {
    parse() {
        return this.createSingleNodeList(
            this.SelectorList()
        );
    }
};

const selector = {
    parse() {
        return this.createSingleNodeList(
            this.Selector()
        );
    }
};

const identList = {
    parse() {
        return this.createSingleNodeList(
            this.Identifier()
        );
    }
};

const langList = {
    parse: lang.parseLanguageRangeList
};

const nth = {
    parse() {
        return this.createSingleNodeList(
            this.Nth()
        );
    }
};

const pseudo = {
    'dir': identList,
    'has': selectorList,
    'lang': langList,
    'matches': selectorList,
    'is': selectorList,
    '-moz-any': selectorList,
    '-webkit-any': selectorList,
    'where': selectorList,
    'not': selectorList,
    'nth-child': nth,
    'nth-last-child': nth,
    'nth-last-of-type': nth,
    'nth-of-type': nth,
    'slotted': selector,
    'host': selector,
    'host-context': selector
};

module.exports = pseudo;
,y<3x4'use strict';

const types = require('../../tokenizer/types.cjs');

function parseLanguageRangeList() {
    const children = this.createList();

    this.skipSC();

    loop: while (!this.eof) {
        switch (this.tokenType) {
            case types.Ident:
                children.push(this.Identifier());
                break;

            case types.String:
                children.push(this.String());
                break;

            case types.Comma:
                children.push(this.Operator());
                break;

            case types.RightParenthesis:
                break loop;

            default:
                this.error('Identifier, string or comma is expected');
        }

        this.skipSC();
    }

    return children;
}

exports.parseLanguageRangeList = parseLanguageRangeList;
xr<x 9100644 atrulePrelude.cjs eTGl	69$Oʫ;100644 default.cjs Cဎ߲!Z	SN100644 index.cjs x9l%݇y0b100644 selector.cjs kZ3
c/{100644 value.cjs 
!![rF/N½x r'use strict';

const _default = require('./default.cjs');

const atrulePrelude = {
    getNode: _default
};

module.exports = atrulePrelude;
/x5'use strict';

const types = require('../../tokenizer/types.cjs');

const NUMBERSIGN = 0x0023;  // U+0023 NUMBER SIGN (#)
const ASTERISK = 0x002A;    // U+002A ASTERISK (*)
const PLUSSIGN = 0x002B;    // U+002B PLUS SIGN (+)
const HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)
const SOLIDUS = 0x002F;     // U+002F SOLIDUS (/)
const U = 0x0075;           // U+0075 LATIN SMALL LETTER U (u)

function defaultRecognizer(context) {
    switch (this.tokenType) {
        case types.Hash:
            return this.Hash();

        case types.Comma:
            return this.Operator();

        case types.LeftParenthesis:
            return this.Parentheses(this.readSequence, context.recognizer);

        case types.LeftSquareBracket:
            return this.Brackets(this.readSequence, context.recognizer);

        case types.String:
            return this.String();

        case types.Dimension:
            return this.Dimension();

        case types.Percentage:
            return this.Percentage();

        case types.Number:
            return this.Number();

        case types.Function:
            return this.cmpStr(this.tokenStart, this.tokenEnd, 'url(')
                ? this.Url()
                : this.Function(this.readSequence, context.recognizer);

        case types.Url:
            return this.Url();

        case types.Ident:
            // check for unicode range, it should start with u+ or U+
            if (this.cmpChar(this.tokenStart, U) &&
                this.cmpChar(this.tokenStart + 1, PLUSSIGN)) {
                return this.UnicodeRange();
            } else {
                return this.Identifier();
            }

        case types.Delim: {
            const code = this.charCodeAt(this.tokenStart);

            if (code === SOLIDUS ||
                code === ASTERISK ||
                code === PLUSSIGN ||
                code === HYPHENMINUS) {
                return this.Operator(); // TODO: replace with Delim
            }

            // TODO: produce a node with Delim node type

            if (code === NUMBERSIGN) {
                this.error('Hex or identifier is expected', this.tokenStart + 1);
            }

            break;
        }
    }
}

module.exports = defaultRecognizer;
okx 
'use strict';

const atrulePrelude = require('./atrulePrelude.cjs');
const selector = require('./selector.cjs');
const value = require('./value.cjs');



exports.AtrulePrelude = atrulePrelude;
exports.Selector = selector;
exports.Value = value;
U1x	'use strict';

const types = require('../../tokenizer/types.cjs');

const NUMBERSIGN = 0x0023;      // U+0023 NUMBER SIGN (#)
const AMPERSAND = 0x0026;       // U+0026 AMPERSAND (&)
const ASTERISK = 0x002A;        // U+002A ASTERISK (*)
const PLUSSIGN = 0x002B;        // U+002B PLUS SIGN (+)
const SOLIDUS = 0x002F;         // U+002F SOLIDUS (/)
const FULLSTOP = 0x002E;        // U+002E FULL STOP (.)
const GREATERTHANSIGN = 0x003E; // U+003E GREATER-THAN SIGN (>)
const VERTICALLINE = 0x007C;    // U+007C VERTICAL LINE (|)
const TILDE = 0x007E;           // U+007E TILDE (~)

function onWhiteSpace(next, children) {
    if (children.last !== null && children.last.type !== 'Combinator' &&
        next !== null && next.type !== 'Combinator') {
        children.push({  // FIXME: this.Combinator() should be used instead
            type: 'Combinator',
            loc: null,
            name: ' '
        });
    }
}

function getNode() {
    switch (this.tokenType) {
        case types.LeftSquareBracket:
            return this.AttributeSelector();

        case types.Hash:
            return this.IdSelector();

        case types.Colon:
            if (this.lookupType(1) === types.Colon) {
                return this.PseudoElementSelector();
            } else {
                return this.PseudoClassSelector();
            }

        case types.Ident:
            return this.TypeSelector();

        case types.Number:
        case types.Percentage:
            return this.Percentage();

        case types.Dimension:
            // throws when .123ident
            if (this.charCodeAt(this.tokenStart) === FULLSTOP) {
                this.error('Identifier is expected', this.tokenStart + 1);
            }
            break;

        case types.Delim: {
            const code = this.charCodeAt(this.tokenStart);

            switch (code) {
                case PLUSSIGN:
                case GREATERTHANSIGN:
                case TILDE:
                case SOLIDUS:  // /deep/
                    return this.Combinator();

                case FULLSTOP:
                    return this.ClassSelector();

                case ASTERISK:
                case VERTICALLINE:
                    return this.TypeSelector();

                case NUMBERSIGN:
                    return this.IdSelector();

                case AMPERSAND:
                    return this.NestingSelector();
            }

            break;
        }
    }
}
const Selector = {
    onWhiteSpace,
    getNode
};

module.exports = Selector;
Ŝ-x&'use strict';

const _default = require('./default.cjs');
const expression = require('../function/expression.cjs');
const _var = require('../function/var.cjs');

function isPlusMinusOperator(node) {
    return (
        node !== null &&
        node.type === 'Operator' &&
        (node.value[node.value.length - 1] === '-' || node.value[node.value.length - 1] === '+')
    );
}

const value = {
    getNode: _default,
    onWhiteSpace(next, children) {
        if (isPlusMinusOperator(next)) {
            next.value = ' ' + next.value;
        }
        if (isPlusMinusOperator(children.last)) {
            children.last.value += ' ';
        }
    },
    'expression': expression,
    'var': _var
};

module.exports = value;
$-xP100644 OffsetToLocation.cjs Yf_W100644 TokenStream.cjs *"A֫7Z<Wh`U100644 adopt-buffer.cjs l	b:9}SvO6100644 char-code-definitions.cjs Ե^+"n$a100644 index.cjs >ZUb4u:|q100644 names.cjs i QOe8w$100644 types.cjs 	Oג ҿq100644 utils.cjs y8ɸ6Mۢ& !wx
'use strict';

const adoptBuffer = require('./adopt-buffer.cjs');
const charCodeDefinitions = require('./char-code-definitions.cjs');

const N = 10;
const F = 12;
const R = 13;

function computeLinesAndColumns(host) {
    const source = host.source;
    const sourceLength = source.length;
    const startOffset = source.length > 0 ? charCodeDefinitions.isBOM(source.charCodeAt(0)) : 0;
    const lines = adoptBuffer.adoptBuffer(host.lines, sourceLength);
    const columns = adoptBuffer.adoptBuffer(host.columns, sourceLength);
    let line = host.startLine;
    let column = host.startColumn;

    for (let i = startOffset; i < sourceLength; i++) {
        const code = source.charCodeAt(i);

        lines[i] = line;
        columns[i] = column++;

        if (code === N || code === R || code === F) {
            if (code === R && i + 1 < sourceLength && source.charCodeAt(i + 1) === N) {
                i++;
                lines[i] = line;
                columns[i] = column;
            }

            line++;
            column = 1;
        }
    }

    lines[sourceLength] = line;
    columns[sourceLength] = column;

    host.lines = lines;
    host.columns = columns;
    host.computed = true;
}

class OffsetToLocation {
    constructor(source, startOffset, startLine, startColumn) {
        this.setSource(source, startOffset, startLine, startColumn);
        this.lines = null;
        this.columns = null;
    }
    setSource(source = '', startOffset = 0, startLine = 1, startColumn = 1) {
        this.source = source;
        this.startOffset = startOffset;
        this.startLine = startLine;
        this.startColumn = startColumn;
        this.computed = false;
    }
    getLocation(offset, filename) {
        if (!this.computed) {
            computeLinesAndColumns(this);
        }

        return {
            source: filename,
            offset: this.startOffset + offset,
            line: this.lines[offset],
            column: this.columns[offset]
        };
    }
    getLocationRange(start, end, filename) {
        if (!this.computed) {
            computeLinesAndColumns(this);
        }

        return {
            source: filename,
            start: {
                offset: this.startOffset + start,
                line: this.lines[start],
                column: this.columns[start]
            },
            end: {
                offset: this.startOffset + end,
                line: this.lines[end],
                column: this.columns[end]
            }
        };
    }
}

exports.OffsetToLocation = OffsetToLocation;
xp,'use strict';

const adoptBuffer = require('./adopt-buffer.cjs');
const utils = require('./utils.cjs');
const names = require('./names.cjs');
const types = require('./types.cjs');

const OFFSET_MASK = 0x00FFFFFF;
const TYPE_SHIFT = 24;
const BLOCK_OPEN_TOKEN = 1;
const BLOCK_CLOSE_TOKEN = 2;
const balancePair = new Uint8Array(32); // 32b of memory ought to be enough for anyone (any number of tokens)
balancePair[types.Function] = types.RightParenthesis;
balancePair[types.LeftParenthesis] = types.RightParenthesis;
balancePair[types.LeftSquareBracket] = types.RightSquareBracket;
balancePair[types.LeftCurlyBracket] = types.RightCurlyBracket;

const blockTokens = new Uint8Array(32);
blockTokens[types.Function] = BLOCK_OPEN_TOKEN;
blockTokens[types.LeftParenthesis] = BLOCK_OPEN_TOKEN;
blockTokens[types.LeftSquareBracket] = BLOCK_OPEN_TOKEN;
blockTokens[types.LeftCurlyBracket] = BLOCK_OPEN_TOKEN;
blockTokens[types.RightParenthesis] = BLOCK_CLOSE_TOKEN;
blockTokens[types.RightSquareBracket] = BLOCK_CLOSE_TOKEN;
blockTokens[types.RightCurlyBracket] = BLOCK_CLOSE_TOKEN;

function boundIndex(index, min, max) {
    return index < min ? min : index > max ? max : index;
}

class TokenStream {
    constructor(source, tokenize) {
        this.setSource(source, tokenize);
    }
    reset() {
        this.eof = false;
        this.tokenIndex = -1;
        this.tokenType = 0;
        this.tokenStart = this.firstCharOffset;
        this.tokenEnd = this.firstCharOffset;
    }
    setSource(source = '', tokenize = () => {}) {
        source = String(source || '');

        const sourceLength = source.length;
        const offsetAndType = adoptBuffer.adoptBuffer(this.offsetAndType, source.length + 1); // +1 because of eof-token
        const balance = adoptBuffer.adoptBuffer(this.balance, source.length + 1);
        let tokenCount = 0;
        let firstCharOffset = -1;
        let balanceCloseType = 0;
        let balanceStart = source.length;

        // capture buffers
        this.offsetAndType = null;
        this.balance = null;
        balance.fill(0);

        tokenize(source, (type, start, end) => {
            const index = tokenCount++;

            // type & offset
            offsetAndType[index] = (type << TYPE_SHIFT) | end;

            if (firstCharOffset === -1) {
                firstCharOffset = start;
            }

            // balance
            balance[index] = balanceStart;

            if (type === balanceCloseType) {
                const prevBalanceStart = balance[balanceStart];

                // set reference to balance end for a block opener
                balance[balanceStart] = index;

                // pop state
                balanceStart = prevBalanceStart;
                balanceCloseType = balancePair[offsetAndType[prevBalanceStart] >> TYPE_SHIFT];
            } else if (this.isBlockOpenerTokenType(type)) { // check for FunctionToken, <(-token>, <[-token> and <{-token>
                // push state
                balanceStart = index;
                balanceCloseType = balancePair[type];
            }
        });

        // finalize buffers
        offsetAndType[tokenCount] = (types.EOF << TYPE_SHIFT) | sourceLength; // <EOF-token>
        balance[tokenCount] = tokenCount; // prevents false positive balance match with any token

        // reverse references from balance start to end
        // tokens
        //   token:   a ( [ b c ] d e ) {
        //   index:   0 1 2 3 4 5 6 7 8 9
        // before
        //   balance: 0 8 5 2 2 2 1 1 1 0
        //            - > > < < < < < < -
        // after
        //   balance: 9 8 5 5 5 2 8 8 1 9
        //            > > > > > < > > < >
        for (let i = 0; i < tokenCount; i++) {
            const balanceStart = balance[i];

            if (balanceStart <= i) {
                const balanceEnd = balance[balanceStart];

                if (balanceEnd !== i) {
                    balance[i] = balanceEnd;
                }
            } else if (balanceStart > tokenCount) {
                balance[i] = tokenCount;
            }
        }

        // balance[0] = tokenCount;

        this.source = source;
        this.firstCharOffset = firstCharOffset === -1 ? 0 : firstCharOffset;
        this.tokenCount = tokenCount;
        this.offsetAndType = offsetAndType;
        this.balance = balance;

        this.reset();
        this.next();
    }

    lookupType(offset) {
        offset += this.tokenIndex;

        if (offset < this.tokenCount) {
            return this.offsetAndType[offset] >> TYPE_SHIFT;
        }

        return types.EOF;
    }
    lookupTypeNonSC(idx) {
        for (let offset = this.tokenIndex; offset < this.tokenCount; offset++) {
            const tokenType = this.offsetAndType[offset] >> TYPE_SHIFT;

            if (tokenType !== types.WhiteSpace && tokenType !== types.Comment) {
                if (idx-- === 0) {
                    return tokenType;
                }
            }
        }

        return types.EOF;
    }
    lookupOffset(offset) {
        offset += this.tokenIndex;

        if (offset < this.tokenCount) {
            return this.offsetAndType[offset - 1] & OFFSET_MASK;
        }

        return this.source.length;
    }
    lookupOffsetNonSC(idx) {
        for (let offset = this.tokenIndex; offset < this.tokenCount; offset++) {
            const tokenType = this.offsetAndType[offset] >> TYPE_SHIFT;

            if (tokenType !== types.WhiteSpace && tokenType !== types.Comment) {
                if (idx-- === 0) {
                    return offset - this.tokenIndex;
                }
            }
        }

        return types.EOF;
    }
    lookupValue(offset, referenceStr) {
        offset += this.tokenIndex;

        if (offset < this.tokenCount) {
            return utils.cmpStr(
                this.source,
                this.offsetAndType[offset - 1] & OFFSET_MASK,
                this.offsetAndType[offset] & OFFSET_MASK,
                referenceStr
            );
        }

        return false;
    }
    getTokenStart(tokenIndex) {
        if (tokenIndex === this.tokenIndex) {
            return this.tokenStart;
        }

        if (tokenIndex > 0) {
            return tokenIndex < this.tokenCount
                ? this.offsetAndType[tokenIndex - 1] & OFFSET_MASK
                : this.offsetAndType[this.tokenCount] & OFFSET_MASK;
        }

        return this.firstCharOffset;
    }
    getTokenEnd(tokenIndex) {
        if (tokenIndex === this.tokenIndex) {
            return this.tokenEnd;
        }

        return this.offsetAndType[boundIndex(tokenIndex, 0, this.tokenCount)] & OFFSET_MASK;
    }
    getTokenType(tokenIndex) {
        if (tokenIndex === this.tokenIndex) {
            return this.tokenType;
        }

        return this.offsetAndType[boundIndex(tokenIndex, 0, this.tokenCount)] >> TYPE_SHIFT;
    }
    substrToCursor(start) {
        return this.source.substring(start, this.tokenStart);
    }

    isBlockOpenerTokenType(tokenType) {
        return blockTokens[tokenType] === BLOCK_OPEN_TOKEN;
    }
    isBlockCloserTokenType(tokenType) {
        return blockTokens[tokenType] === BLOCK_CLOSE_TOKEN;
    }
    getBlockTokenPairIndex(tokenIndex) {
        const type = this.getTokenType(tokenIndex);

        if (blockTokens[type] === 1) {
            // block open token
            const pairIndex = this.balance[tokenIndex];
            const closeType = this.getTokenType(pairIndex);

            return balancePair[type] === closeType ? pairIndex : -1;
        } else if (blockTokens[type] === 2) {
            // block close token
            const pairIndex = this.balance[tokenIndex];
            const openType = this.getTokenType(pairIndex);

            return balancePair[openType] === type ? pairIndex : -1;
        }

        return -1;
    }
    isBalanceEdge(tokenIndex) {
        return this.balance[this.tokenIndex] < tokenIndex;
    }

    isDelim(code, offset) {
        if (offset) {
            return (
                this.lookupType(offset) === types.Delim &&
                this.source.charCodeAt(this.lookupOffset(offset)) === code
            );
        }

        return (
            this.tokenType === types.Delim &&
            this.source.charCodeAt(this.tokenStart) === code
        );
    }

    skip(tokenCount) {
        let next = this.tokenIndex + tokenCount;

        if (next < this.tokenCount) {
            this.tokenIndex = next;
            this.tokenStart = this.offsetAndType[next - 1] & OFFSET_MASK;
            next = this.offsetAndType[next];
            this.tokenType = next >> TYPE_SHIFT;
            this.tokenEnd = next & OFFSET_MASK;
        } else {
            this.tokenIndex = this.tokenCount;
            this.next();
        }
    }
    next() {
        let next = this.tokenIndex + 1;

        if (next < this.tokenCount) {
            this.tokenIndex = next;
            this.tokenStart = this.tokenEnd;
            next = this.offsetAndType[next];
            this.tokenType = next >> TYPE_SHIFT;
            this.tokenEnd = next & OFFSET_MASK;
        } else {
            this.eof = true;
            this.tokenIndex = this.tokenCount;
            this.tokenType = types.EOF;
            this.tokenStart = this.tokenEnd = this.source.length;
        }
    }
    skipSC() {
        while (this.tokenType === types.WhiteSpace || this.tokenType === types.Comment) {
            this.next();
        }
    }
    skipUntilBalanced(startToken, stopConsume) {
        let cursor = startToken;
        let balanceEnd = 0;
        let offset = 0;

        loop:
        for (; cursor < this.tokenCount; cursor++) {
            balanceEnd = this.balance[cursor];

            // stop scanning on balance edge that points to offset before start token
            if (balanceEnd < startToken) {
                break loop;
            }

            offset = cursor > 0 ? this.offsetAndType[cursor - 1] & OFFSET_MASK : this.firstCharOffset;

            // check stop condition
            switch (stopConsume(this.source.charCodeAt(offset))) {
                case 1: // just stop
                    break loop;

                case 2: // stop & included
                    cursor++;
                    break loop;

                default:
                    // fast forward to the end of balanced block for an open block tokens
                    if (this.isBlockOpenerTokenType(this.offsetAndType[cursor] >> TYPE_SHIFT)) {
                        cursor = balanceEnd;
                    }
            }
        }

        this.skip(cursor - this.tokenIndex);
    }

    forEachToken(fn) {
        for (let i = 0, offset = this.firstCharOffset; i < this.tokenCount; i++) {
            const start = offset;
            const item = this.offsetAndType[i];
            const end = item & OFFSET_MASK;
            const type = item >> TYPE_SHIFT;

            offset = end;

            fn(type, start, end, i);
        }
    }
    dump() {
        const tokens = new Array(this.tokenCount);

        this.forEachToken((type, start, end, index) => {
            tokens[index] = {
                idx: index,
                type: names[type],
                chunk: this.source.substring(start, end),
                balance: this.balance[index]
            };
        });

        return tokens;
    }
}

exports.TokenStream = TokenStream;
'Bx'use strict';

const MIN_SIZE = 16 * 1024;

function adoptBuffer(buffer = null, size) {
    if (buffer === null || buffer.length < size) {
        return new Uint32Array(Math.max(size + 1024, MIN_SIZE));
    }

    return buffer;
}

exports.adoptBuffer = adoptBuffer;
MRx'use strict';

const EOF = 0;

// https://drafts.csswg.org/css-syntax-3/
// § 4.2. Definitions

// digit
// A code point between U+0030 DIGIT ZERO (0) and U+0039 DIGIT NINE (9).
function isDigit(code) {
    return code >= 0x0030 && code <= 0x0039;
}

// hex digit
// A digit, or a code point between U+0041 LATIN CAPITAL LETTER A (A) and U+0046 LATIN CAPITAL LETTER F (F),
// or a code point between U+0061 LATIN SMALL LETTER A (a) and U+0066 LATIN SMALL LETTER F (f).
function isHexDigit(code) {
    return (
        isDigit(code) || // 0 .. 9
        (code >= 0x0041 && code <= 0x0046) || // A .. F
        (code >= 0x0061 && code <= 0x0066)    // a .. f
    );
}

// uppercase letter
// A code point between U+0041 LATIN CAPITAL LETTER A (A) and U+005A LATIN CAPITAL LETTER Z (Z).
function isUppercaseLetter(code) {
    return code >= 0x0041 && code <= 0x005A;
}

// lowercase letter
// A code point between U+0061 LATIN SMALL LETTER A (a) and U+007A LATIN SMALL LETTER Z (z).
function isLowercaseLetter(code) {
    return code >= 0x0061 && code <= 0x007A;
}

// letter
// An uppercase letter or a lowercase letter.
function isLetter(code) {
    return isUppercaseLetter(code) || isLowercaseLetter(code);
}

// non-ASCII code point
// A code point with a value equal to or greater than U+0080 <control>.
//
// 2024-09-02: The latest spec narrows the range for non-ASCII characters (see https://github.com/csstree/csstree/issues/188).
// However, all modern browsers support a wider range, and strictly following the latest spec could result
// in some CSS being parsed incorrectly, even though it works in the browser. Therefore, this function adheres
// to the previous, broader definition of non-ASCII characters.
function isNonAscii(code) {
    return code >= 0x0080;
}

// name-start code point
// A letter, a non-ASCII code point, or U+005F LOW LINE (_).
function isNameStart(code) {
    return isLetter(code) || isNonAscii(code) || code === 0x005F;
}

// name code point
// A name-start code point, a digit, or U+002D HYPHEN-MINUS (-).
function isName(code) {
    return isNameStart(code) || isDigit(code) || code === 0x002D;
}

// non-printable code point
// A code point between U+0000 NULL and U+0008 BACKSPACE, or U+000B LINE TABULATION,
// or a code point between U+000E SHIFT OUT and U+001F INFORMATION SEPARATOR ONE, or U+007F DELETE.
function isNonPrintable(code) {
    return (
        (code >= 0x0000 && code <= 0x0008) ||
        (code === 0x000B) ||
        (code >= 0x000E && code <= 0x001F) ||
        (code === 0x007F)
    );
}

// newline
// U+000A LINE FEED. Note that U+000D CARRIAGE RETURN and U+000C FORM FEED are not included in this definition,
// as they are converted to U+000A LINE FEED during preprocessing.
// TODO: we doesn't do a preprocessing, so check a code point for U+000D CARRIAGE RETURN and U+000C FORM FEED
function isNewline(code) {
    return code === 0x000A || code === 0x000D || code === 0x000C;
}

// whitespace
// A newline, U+0009 CHARACTER TABULATION, or U+0020 SPACE.
function isWhiteSpace(code) {
    return isNewline(code) || code === 0x0020 || code === 0x0009;
}

// § 4.3.8. Check if two code points are a valid escape
function isValidEscape(first, second) {
    // If the first code point is not U+005C REVERSE SOLIDUS (\), return false.
    if (first !== 0x005C) {
        return false;
    }

    // Otherwise, if the second code point is a newline or EOF, return false.
    if (isNewline(second) || second === EOF) {
        return false;
    }

    // Otherwise, return true.
    return true;
}

// § 4.3.9. Check if three code points would start an identifier
function isIdentifierStart(first, second, third) {
    // Look at the first code point:

    // U+002D HYPHEN-MINUS
    if (first === 0x002D) {
        // If the second code point is a name-start code point or a U+002D HYPHEN-MINUS,
        // or the second and third code points are a valid escape, return true. Otherwise, return false.
        return (
            isNameStart(second) ||
            second === 0x002D ||
            isValidEscape(second, third)
        );
    }

    // name-start code point
    if (isNameStart(first)) {
        // Return true.
        return true;
    }

    // U+005C REVERSE SOLIDUS (\)
    if (first === 0x005C) {
        // If the first and second code points are a valid escape, return true. Otherwise, return false.
        return isValidEscape(first, second);
    }

    // anything else
    // Return false.
    return false;
}

// § 4.3.10. Check if three code points would start a number
function isNumberStart(first, second, third) {
    // Look at the first code point:

    // U+002B PLUS SIGN (+)
    // U+002D HYPHEN-MINUS (-)
    if (first === 0x002B || first === 0x002D) {
        // If the second code point is a digit, return true.
        if (isDigit(second)) {
            return 2;
        }

        // Otherwise, if the second code point is a U+002E FULL STOP (.)
        // and the third code point is a digit, return true.
        // Otherwise, return false.
        return second === 0x002E && isDigit(third) ? 3 : 0;
    }

    // U+002E FULL STOP (.)
    if (first === 0x002E) {
        // If the second code point is a digit, return true. Otherwise, return false.
        return isDigit(second) ? 2 : 0;
    }

    // digit
    if (isDigit(first)) {
        // Return true.
        return 1;
    }

    // anything else
    // Return false.
    return 0;
}

//
// Misc
//

// detect BOM (https://en.wikipedia.org/wiki/Byte_order_mark)
function isBOM(code) {
    // UTF-16BE
    if (code === 0xFEFF) {
        return 1;
    }

    // UTF-16LE
    if (code === 0xFFFE) {
        return 1;
    }

    return 0;
}

// Fast code category
// Only ASCII code points has a special meaning, that's why we define a maps for 0..127 codes only
const CATEGORY = new Array(0x80);
const EofCategory = 0x80;
const WhiteSpaceCategory = 0x82;
const DigitCategory = 0x83;
const NameStartCategory = 0x84;
const NonPrintableCategory = 0x85;

for (let i = 0; i < CATEGORY.length; i++) {
    CATEGORY[i] =
        isWhiteSpace(i) && WhiteSpaceCategory ||
        isDigit(i) && DigitCategory ||
        isNameStart(i) && NameStartCategory ||
        isNonPrintable(i) && NonPrintableCategory ||
        i || EofCategory;
}

function charCodeCategory(code) {
    return code < 0x80 ? CATEGORY[code] : NameStartCategory;
}

exports.DigitCategory = DigitCategory;
exports.EofCategory = EofCategory;
exports.NameStartCategory = NameStartCategory;
exports.NonPrintableCategory = NonPrintableCategory;
exports.WhiteSpaceCategory = WhiteSpaceCategory;
exports.charCodeCategory = charCodeCategory;
exports.isBOM = isBOM;
exports.isDigit = isDigit;
exports.isHexDigit = isHexDigit;
exports.isIdentifierStart = isIdentifierStart;
exports.isLetter = isLetter;
exports.isLowercaseLetter = isLowercaseLetter;
exports.isName = isName;
exports.isNameStart = isNameStart;
exports.isNewline = isNewline;
exports.isNonAscii = isNonAscii;
exports.isNonPrintable = isNonPrintable;
exports.isNumberStart = isNumberStart;
exports.isUppercaseLetter = isUppercaseLetter;
exports.isValidEscape = isValidEscape;
exports.isWhiteSpace = isWhiteSpace;
8+x\Y'use strict';

const types = require('./types.cjs');
const charCodeDefinitions = require('./char-code-definitions.cjs');
const utils = require('./utils.cjs');
const names = require('./names.cjs');
const OffsetToLocation = require('./OffsetToLocation.cjs');
const TokenStream = require('./TokenStream.cjs');

function tokenize(source, onToken) {
    function getCharCode(offset) {
        return offset < sourceLength ? source.charCodeAt(offset) : 0;
    }

    // § 4.3.3. Consume a numeric token
    function consumeNumericToken() {
        // Consume a number and let number be the result.
        offset = utils.consumeNumber(source, offset);

        // If the next 3 input code points would start an identifier, then:
        if (charCodeDefinitions.isIdentifierStart(getCharCode(offset), getCharCode(offset + 1), getCharCode(offset + 2))) {
            // Create a <dimension-token> with the same value and type flag as number, and a unit set initially to the empty string.
            // Consume a name. Set the <dimension-token>’s unit to the returned value.
            // Return the <dimension-token>.
            type = types.Dimension;
            offset = utils.consumeName(source, offset);
            return;
        }

        // Otherwise, if the next input code point is U+0025 PERCENTAGE SIGN (%), consume it.
        if (getCharCode(offset) === 0x0025) {
            // Create a <percentage-token> with the same value as number, and return it.
            type = types.Percentage;
            offset++;
            return;
        }

        // Otherwise, create a <number-token> with the same value and type flag as number, and return it.
        type = types.Number;
    }

    // § 4.3.4. Consume an ident-like token
    function consumeIdentLikeToken() {
        const nameStartOffset = offset;

        // Consume a name, and let string be the result.
        offset = utils.consumeName(source, offset);

        // If string’s value is an ASCII case-insensitive match for "url",
        // and the next input code point is U+0028 LEFT PARENTHESIS ((), consume it.
        if (utils.cmpStr(source, nameStartOffset, offset, 'url') && getCharCode(offset) === 0x0028) {
            // While the next two input code points are whitespace, consume the next input code point.
            offset = utils.findWhiteSpaceEnd(source, offset + 1);

            // If the next one or two input code points are U+0022 QUOTATION MARK ("), U+0027 APOSTROPHE ('),
            // or whitespace followed by U+0022 QUOTATION MARK (") or U+0027 APOSTROPHE ('),
            // then create a <function-token> with its value set to string and return it.
            if (getCharCode(offset) === 0x0022 ||
                getCharCode(offset) === 0x0027) {
                type = types.Function;
                offset = nameStartOffset + 4;
                return;
            }

            // Otherwise, consume a url token, and return it.
            consumeUrlToken();
            return;
        }

        // Otherwise, if the next input code point is U+0028 LEFT PARENTHESIS ((), consume it.
        // Create a <function-token> with its value set to string and return it.
        if (getCharCode(offset) === 0x0028) {
            type = types.Function;
            offset++;
            return;
        }

        // Otherwise, create an <ident-token> with its value set to string and return it.
        type = types.Ident;
    }

    // § 4.3.5. Consume a string token
    function consumeStringToken(endingCodePoint) {
        // This algorithm may be called with an ending code point, which denotes the code point
        // that ends the string. If an ending code point is not specified,
        // the current input code point is used.
        if (!endingCodePoint) {
            endingCodePoint = getCharCode(offset++);
        }

        // Initially create a <string-token> with its value set to the empty string.
        type = types.String;

        // Repeatedly consume the next input code point from the stream:
        for (; offset < source.length; offset++) {
            const code = source.charCodeAt(offset);

            switch (charCodeDefinitions.charCodeCategory(code)) {
                // ending code point
                case endingCodePoint:
                    // Return the <string-token>.
                    offset++;
                    return;

                    // EOF
                    // case EofCategory:
                    // This is a parse error. Return the <string-token>.
                    // return;

                // newline
                case charCodeDefinitions.WhiteSpaceCategory:
                    if (charCodeDefinitions.isNewline(code)) {
                        // This is a parse error. Reconsume the current input code point,
                        // create a <bad-string-token>, and return it.
                        offset += utils.getNewlineLength(source, offset, code);
                        type = types.BadString;
                        return;
                    }
                    break;

                // U+005C REVERSE SOLIDUS (\)
                case 0x005C:
                    // If the next input code point is EOF, do nothing.
                    if (offset === source.length - 1) {
                        break;
                    }

                    const nextCode = getCharCode(offset + 1);

                    // Otherwise, if the next input code point is a newline, consume it.
                    if (charCodeDefinitions.isNewline(nextCode)) {
                        offset += utils.getNewlineLength(source, offset + 1, nextCode);
                    } else if (charCodeDefinitions.isValidEscape(code, nextCode)) {
                        // Otherwise, (the stream starts with a valid escape) consume
                        // an escaped code point and append the returned code point to
                        // the <string-token>’s value.
                        offset = utils.consumeEscaped(source, offset) - 1;
                    }
                    break;

                // anything else
                // Append the current input code point to the <string-token>’s value.
            }
        }
    }

    // § 4.3.6. Consume a url token
    // Note: This algorithm assumes that the initial "url(" has already been consumed.
    // This algorithm also assumes that it’s being called to consume an "unquoted" value, like url(foo).
    // A quoted value, like url("foo"), is parsed as a <function-token>. Consume an ident-like token
    // automatically handles this distinction; this algorithm shouldn’t be called directly otherwise.
    function consumeUrlToken() {
        // Initially create a <url-token> with its value set to the empty string.
        type = types.Url;

        // Consume as much whitespace as possible.
        offset = utils.findWhiteSpaceEnd(source, offset);

        // Repeatedly consume the next input code point from the stream:
        for (; offset < source.length; offset++) {
            const code = source.charCodeAt(offset);

            switch (charCodeDefinitions.charCodeCategory(code)) {
                // U+0029 RIGHT PARENTHESIS ())
                case 0x0029:
                    // Return the <url-token>.
                    offset++;
                    return;

                    // EOF
                    // case EofCategory:
                    // This is a parse error. Return the <url-token>.
                    // return;

                // whitespace
                case charCodeDefinitions.WhiteSpaceCategory:
                    // Consume as much whitespace as possible.
                    offset = utils.findWhiteSpaceEnd(source, offset);

                    // If the next input code point is U+0029 RIGHT PARENTHESIS ()) or EOF,
                    // consume it and return the <url-token>
                    // (if EOF was encountered, this is a parse error);
                    if (getCharCode(offset) === 0x0029 || offset >= source.length) {
                        if (offset < source.length) {
                            offset++;
                        }
                        return;
                    }

                    // otherwise, consume the remnants of a bad url, create a <bad-url-token>,
                    // and return it.
                    offset = utils.consumeBadUrlRemnants(source, offset);
                    type = types.BadUrl;
                    return;

                // U+0022 QUOTATION MARK (")
                // U+0027 APOSTROPHE (')
                // U+0028 LEFT PARENTHESIS (()
                // non-printable code point
                case 0x0022:
                case 0x0027:
                case 0x0028:
                case charCodeDefinitions.NonPrintableCategory:
                    // This is a parse error. Consume the remnants of a bad url,
                    // create a <bad-url-token>, and return it.
                    offset = utils.consumeBadUrlRemnants(source, offset);
                    type = types.BadUrl;
                    return;

                // U+005C REVERSE SOLIDUS (\)
                case 0x005C:
                    // If the stream starts with a valid escape, consume an escaped code point and
                    // append the returned code point to the <url-token>’s value.
                    if (charCodeDefinitions.isValidEscape(code, getCharCode(offset + 1))) {
                        offset = utils.consumeEscaped(source, offset) - 1;
                        break;
                    }

                    // Otherwise, this is a parse error. Consume the remnants of a bad url,
                    // create a <bad-url-token>, and return it.
                    offset = utils.consumeBadUrlRemnants(source, offset);
                    type = types.BadUrl;
                    return;

                // anything else
                // Append the current input code point to the <url-token>’s value.
            }
        }
    }

    // ensure source is a string
    source = String(source || '');

    const sourceLength = source.length;
    let start = charCodeDefinitions.isBOM(getCharCode(0));
    let offset = start;
    let type;

    // https://drafts.csswg.org/css-syntax-3/#consume-token
    // § 4.3.1. Consume a token
    while (offset < sourceLength) {
        const code = source.charCodeAt(offset);

        switch (charCodeDefinitions.charCodeCategory(code)) {
            // whitespace
            case charCodeDefinitions.WhiteSpaceCategory:
                // Consume as much whitespace as possible. Return a <whitespace-token>.
                type = types.WhiteSpace;
                offset = utils.findWhiteSpaceEnd(source, offset + 1);
                break;

            // U+0022 QUOTATION MARK (")
            case 0x0022:
                // Consume a string token and return it.
                consumeStringToken();
                break;

            // U+0023 NUMBER SIGN (#)
            case 0x0023:
                // If the next input code point is a name code point or the next two input code points are a valid escape, then:
                if (charCodeDefinitions.isName(getCharCode(offset + 1)) || charCodeDefinitions.isValidEscape(getCharCode(offset + 1), getCharCode(offset + 2))) {
                    // Create a <hash-token>.
                    type = types.Hash;

                    // If the next 3 input code points would start an identifier, set the <hash-token>’s type flag to "id".
                    // if (isIdentifierStart(getCharCode(offset + 1), getCharCode(offset + 2), getCharCode(offset + 3))) {
                    //     // TODO: set id flag
                    // }

                    // Consume a name, and set the <hash-token>’s value to the returned string.
                    offset = utils.consumeName(source, offset + 1);

                    // Return the <hash-token>.
                } else {
                    // Otherwise, return a <delim-token> with its value set to the current input code point.
                    type = types.Delim;
                    offset++;
                }

                break;

            // U+0027 APOSTROPHE (')
            case 0x0027:
                // Consume a string token and return it.
                consumeStringToken();
                break;

            // U+0028 LEFT PARENTHESIS (()
            case 0x0028:
                // Return a <(-token>.
                type = types.LeftParenthesis;
                offset++;
                break;

            // U+0029 RIGHT PARENTHESIS ())
            case 0x0029:
                // Return a <)-token>.
                type = types.RightParenthesis;
                offset++;
                break;

            // U+002B PLUS SIGN (+)
            case 0x002B:
                // If the input stream starts with a number, ...
                if (charCodeDefinitions.isNumberStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
                    // ... reconsume the current input code point, consume a numeric token, and return it.
                    consumeNumericToken();
                } else {
                    // Otherwise, return a <delim-token> with its value set to the current input code point.
                    type = types.Delim;
                    offset++;
                }
                break;

            // U+002C COMMA (,)
            case 0x002C:
                // Return a <comma-token>.
                type = types.Comma;
                offset++;
                break;

            // U+002D HYPHEN-MINUS (-)
            case 0x002D:
                // If the input stream starts with a number, reconsume the current input code point, consume a numeric token, and return it.
                if (charCodeDefinitions.isNumberStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
                    consumeNumericToken();
                } else {
                    // Otherwise, if the next 2 input code points are U+002D HYPHEN-MINUS U+003E GREATER-THAN SIGN (->), consume them and return a <CDC-token>.
                    if (getCharCode(offset + 1) === 0x002D &&
                        getCharCode(offset + 2) === 0x003E) {
                        type = types.CDC;
                        offset = offset + 3;
                    } else {
                        // Otherwise, if the input stream starts with an identifier, ...
                        if (charCodeDefinitions.isIdentifierStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
                            // ... reconsume the current input code point, consume an ident-like token, and return it.
                            consumeIdentLikeToken();
                        } else {
                            // Otherwise, return a <delim-token> with its value set to the current input code point.
                            type = types.Delim;
                            offset++;
                        }
                    }
                }
                break;

            // U+002E FULL STOP (.)
            case 0x002E:
                // If the input stream starts with a number, ...
                if (charCodeDefinitions.isNumberStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
                    // ... reconsume the current input code point, consume a numeric token, and return it.
                    consumeNumericToken();
                } else {
                    // Otherwise, return a <delim-token> with its value set to the current input code point.
                    type = types.Delim;
                    offset++;
                }

                break;

            // U+002F SOLIDUS (/)
            case 0x002F:
                // If the next two input code point are U+002F SOLIDUS (/) followed by a U+002A ASTERISK (*),
                if (getCharCode(offset + 1) === 0x002A) {
                    // ... consume them and all following code points up to and including the first U+002A ASTERISK (*)
                    // followed by a U+002F SOLIDUS (/), or up to an EOF code point.
                    type = types.Comment;
                    offset = source.indexOf('*/', offset + 2);
                    offset = offset === -1 ? source.length : offset + 2;
                } else {
                    type = types.Delim;
                    offset++;
                }
                break;

            // U+003A COLON (:)
            case 0x003A:
                // Return a <colon-token>.
                type = types.Colon;
                offset++;
                break;

            // U+003B SEMICOLON (;)
            case 0x003B:
                // Return a <semicolon-token>.
                type = types.Semicolon;
                offset++;
                break;

            // U+003C LESS-THAN SIGN (<)
            case 0x003C:
                // If the next 3 input code points are U+0021 EXCLAMATION MARK U+002D HYPHEN-MINUS U+002D HYPHEN-MINUS (!--), ...
                if (getCharCode(offset + 1) === 0x0021 &&
                    getCharCode(offset + 2) === 0x002D &&
                    getCharCode(offset + 3) === 0x002D) {
                    // ... consume them and return a <CDO-token>.
                    type = types.CDO;
                    offset = offset + 4;
                } else {
                    // Otherwise, return a <delim-token> with its value set to the current input code point.
                    type = types.Delim;
                    offset++;
                }

                break;

            // U+0040 COMMERCIAL AT (@)
            case 0x0040:
                // If the next 3 input code points would start an identifier, ...
                if (charCodeDefinitions.isIdentifierStart(getCharCode(offset + 1), getCharCode(offset + 2), getCharCode(offset + 3))) {
                    // ... consume a name, create an <at-keyword-token> with its value set to the returned value, and return it.
                    type = types.AtKeyword;
                    offset = utils.consumeName(source, offset + 1);
                } else {
                    // Otherwise, return a <delim-token> with its value set to the current input code point.
                    type = types.Delim;
                    offset++;
                }

                break;

            // U+005B LEFT SQUARE BRACKET ([)
            case 0x005B:
                // Return a <[-token>.
                type = types.LeftSquareBracket;
                offset++;
                break;

            // U+005C REVERSE SOLIDUS (\)
            case 0x005C:
                // If the input stream starts with a valid escape, ...
                if (charCodeDefinitions.isValidEscape(code, getCharCode(offset + 1))) {
                    // ... reconsume the current input code point, consume an ident-like token, and return it.
                    consumeIdentLikeToken();
                } else {
                    // Otherwise, this is a parse error. Return a <delim-token> with its value set to the current input code point.
                    type = types.Delim;
                    offset++;
                }
                break;

            // U+005D RIGHT SQUARE BRACKET (])
            case 0x005D:
                // Return a <]-token>.
                type = types.RightSquareBracket;
                offset++;
                break;

            // U+007B LEFT CURLY BRACKET ({)
            case 0x007B:
                // Return a <{-token>.
                type = types.LeftCurlyBracket;
                offset++;
                break;

            // U+007D RIGHT CURLY BRACKET (})
            case 0x007D:
                // Return a <}-token>.
                type = types.RightCurlyBracket;
                offset++;
                break;

            // digit
            case charCodeDefinitions.DigitCategory:
                // Reconsume the current input code point, consume a numeric token, and return it.
                consumeNumericToken();
                break;

            // name-start code point
            case charCodeDefinitions.NameStartCategory:
                // Reconsume the current input code point, consume an ident-like token, and return it.
                consumeIdentLikeToken();
                break;

                // EOF
                // case EofCategory:
                // Return an <EOF-token>.
                // break;

            // anything else
            default:
                // Return a <delim-token> with its value set to the current input code point.
                type = types.Delim;
                offset++;
        }

        // put token to stream
        onToken(type, start, start = offset);
    }
}

exports.AtKeyword = types.AtKeyword;
exports.BadString = types.BadString;
exports.BadUrl = types.BadUrl;
exports.CDC = types.CDC;
exports.CDO = types.CDO;
exports.Colon = types.Colon;
exports.Comma = types.Comma;
exports.Comment = types.Comment;
exports.Delim = types.Delim;
exports.Dimension = types.Dimension;
exports.EOF = types.EOF;
exports.Function = types.Function;
exports.Hash = types.Hash;
exports.Ident = types.Ident;
exports.LeftCurlyBracket = types.LeftCurlyBracket;
exports.LeftParenthesis = types.LeftParenthesis;
exports.LeftSquareBracket = types.LeftSquareBracket;
exports.Number = types.Number;
exports.Percentage = types.Percentage;
exports.RightCurlyBracket = types.RightCurlyBracket;
exports.RightParenthesis = types.RightParenthesis;
exports.RightSquareBracket = types.RightSquareBracket;
exports.Semicolon = types.Semicolon;
exports.String = types.String;
exports.Url = types.Url;
exports.WhiteSpace = types.WhiteSpace;
exports.tokenTypes = types;
exports.DigitCategory = charCodeDefinitions.DigitCategory;
exports.EofCategory = charCodeDefinitions.EofCategory;
exports.NameStartCategory = charCodeDefinitions.NameStartCategory;
exports.NonPrintableCategory = charCodeDefinitions.NonPrintableCategory;
exports.WhiteSpaceCategory = charCodeDefinitions.WhiteSpaceCategory;
exports.charCodeCategory = charCodeDefinitions.charCodeCategory;
exports.isBOM = charCodeDefinitions.isBOM;
exports.isDigit = charCodeDefinitions.isDigit;
exports.isHexDigit = charCodeDefinitions.isHexDigit;
exports.isIdentifierStart = charCodeDefinitions.isIdentifierStart;
exports.isLetter = charCodeDefinitions.isLetter;
exports.isLowercaseLetter = charCodeDefinitions.isLowercaseLetter;
exports.isName = charCodeDefinitions.isName;
exports.isNameStart = charCodeDefinitions.isNameStart;
exports.isNewline = charCodeDefinitions.isNewline;
exports.isNonAscii = charCodeDefinitions.isNonAscii;
exports.isNonPrintable = charCodeDefinitions.isNonPrintable;
exports.isNumberStart = charCodeDefinitions.isNumberStart;
exports.isUppercaseLetter = charCodeDefinitions.isUppercaseLetter;
exports.isValidEscape = charCodeDefinitions.isValidEscape;
exports.isWhiteSpace = charCodeDefinitions.isWhiteSpace;
exports.cmpChar = utils.cmpChar;
exports.cmpStr = utils.cmpStr;
exports.consumeBadUrlRemnants = utils.consumeBadUrlRemnants;
exports.consumeEscaped = utils.consumeEscaped;
exports.consumeName = utils.consumeName;
exports.consumeNumber = utils.consumeNumber;
exports.decodeEscaped = utils.decodeEscaped;
exports.findDecimalNumberEnd = utils.findDecimalNumberEnd;
exports.findWhiteSpaceEnd = utils.findWhiteSpaceEnd;
exports.findWhiteSpaceStart = utils.findWhiteSpaceStart;
exports.getNewlineLength = utils.getNewlineLength;
exports.tokenNames = names;
exports.OffsetToLocation = OffsetToLocation.OffsetToLocation;
exports.TokenStream = TokenStream.TokenStream;
exports.tokenize = tokenize;
,#-#x6'use strict';

const tokenNames = [
    'EOF-token',
    'ident-token',
    'function-token',
    'at-keyword-token',
    'hash-token',
    'string-token',
    'bad-string-token',
    'url-token',
    'bad-url-token',
    'delim-token',
    'number-token',
    'percentage-token',
    'dimension-token',
    'whitespace-token',
    'CDO-token',
    'CDC-token',
    'colon-token',
    'semicolon-token',
    'comma-token',
    '[-token',
    ']-token',
    '(-token',
    ')-token',
    '{-token',
    '}-token',
    'comment-token'
];

module.exports = tokenNames;
zx:'use strict';

// CSS Syntax Module Level 3
// https://www.w3.org/TR/css-syntax-3/
const EOF = 0;                 // <EOF-token>
const Ident = 1;               // <ident-token>
const Function = 2;            // <function-token>
const AtKeyword = 3;           // <at-keyword-token>
const Hash = 4;                // <hash-token>
const String = 5;              // <string-token>
const BadString = 6;           // <bad-string-token>
const Url = 7;                 // <url-token>
const BadUrl = 8;              // <bad-url-token>
const Delim = 9;               // <delim-token>
const Number = 10;             // <number-token>
const Percentage = 11;         // <percentage-token>
const Dimension = 12;          // <dimension-token>
const WhiteSpace = 13;         // <whitespace-token>
const CDO = 14;                // <CDO-token>
const CDC = 15;                // <CDC-token>
const Colon = 16;              // <colon-token>     :
const Semicolon = 17;          // <semicolon-token> ;
const Comma = 18;              // <comma-token>     ,
const LeftSquareBracket = 19;  // <[-token>
const RightSquareBracket = 20; // <]-token>
const LeftParenthesis = 21;    // <(-token>
const RightParenthesis = 22;   // <)-token>
const LeftCurlyBracket = 23;   // <{-token>
const RightCurlyBracket = 24;  // <}-token>
const Comment = 25;

exports.AtKeyword = AtKeyword;
exports.BadString = BadString;
exports.BadUrl = BadUrl;
exports.CDC = CDC;
exports.CDO = CDO;
exports.Colon = Colon;
exports.Comma = Comma;
exports.Comment = Comment;
exports.Delim = Delim;
exports.Dimension = Dimension;
exports.EOF = EOF;
exports.Function = Function;
exports.Hash = Hash;
exports.Ident = Ident;
exports.LeftCurlyBracket = LeftCurlyBracket;
exports.LeftParenthesis = LeftParenthesis;
exports.LeftSquareBracket = LeftSquareBracket;
exports.Number = Number;
exports.Percentage = Percentage;
exports.RightCurlyBracket = RightCurlyBracket;
exports.RightParenthesis = RightParenthesis;
exports.RightSquareBracket = RightSquareBracket;
exports.Semicolon = Semicolon;
exports.String = String;
exports.Url = Url;
exports.WhiteSpace = WhiteSpace;
Cx 	'use strict';

const charCodeDefinitions = require('./char-code-definitions.cjs');

function getCharCode(source, offset) {
    return offset < source.length ? source.charCodeAt(offset) : 0;
}

function getNewlineLength(source, offset, code) {
    if (code === 13 /* \r */ && getCharCode(source, offset + 1) === 10 /* \n */) {
        return 2;
    }

    return 1;
}

function cmpChar(testStr, offset, referenceCode) {
    let code = testStr.charCodeAt(offset);

    // code.toLowerCase() for A..Z
    if (charCodeDefinitions.isUppercaseLetter(code)) {
        code = code | 32;
    }

    return code === referenceCode;
}

function cmpStr(testStr, start, end, referenceStr) {
    if (end - start !== referenceStr.length) {
        return false;
    }

    if (start < 0 || end > testStr.length) {
        return false;
    }

    for (let i = start; i < end; i++) {
        const referenceCode = referenceStr.charCodeAt(i - start);
        let testCode = testStr.charCodeAt(i);

        // testCode.toLowerCase() for A..Z
        if (charCodeDefinitions.isUppercaseLetter(testCode)) {
            testCode = testCode | 32;
        }

        if (testCode !== referenceCode) {
            return false;
        }
    }

    return true;
}

function findWhiteSpaceStart(source, offset) {
    for (; offset >= 0; offset--) {
        if (!charCodeDefinitions.isWhiteSpace(source.charCodeAt(offset))) {
            break;
        }
    }

    return offset + 1;
}

function findWhiteSpaceEnd(source, offset) {
    for (; offset < source.length; offset++) {
        if (!charCodeDefinitions.isWhiteSpace(source.charCodeAt(offset))) {
            break;
        }
    }

    return offset;
}

function findDecimalNumberEnd(source, offset) {
    for (; offset < source.length; offset++) {
        if (!charCodeDefinitions.isDigit(source.charCodeAt(offset))) {
            break;
        }
    }

    return offset;
}

// § 4.3.7. Consume an escaped code point
function consumeEscaped(source, offset) {
    // It assumes that the U+005C REVERSE SOLIDUS (\) has already been consumed and
    // that the next input code point has already been verified to be part of a valid escape.
    offset += 2;

    // hex digit
    if (charCodeDefinitions.isHexDigit(getCharCode(source, offset - 1))) {
        // Consume as many hex digits as possible, but no more than 5.
        // Note that this means 1-6 hex digits have been consumed in total.
        for (const maxOffset = Math.min(source.length, offset + 5); offset < maxOffset; offset++) {
            if (!charCodeDefinitions.isHexDigit(getCharCode(source, offset))) {
                break;
            }
        }

        // If the next input code point is whitespace, consume it as well.
        const code = getCharCode(source, offset);
        if (charCodeDefinitions.isWhiteSpace(code)) {
            offset += getNewlineLength(source, offset, code);
        }
    }

    return offset;
}

// §4.3.11. Consume a name
// Note: This algorithm does not do the verification of the first few code points that are necessary
// to ensure the returned code points would constitute an <ident-token>. If that is the intended use,
// ensure that the stream starts with an identifier before calling this algorithm.
function consumeName(source, offset) {
    // Let result initially be an empty string.
    // Repeatedly consume the next input code point from the stream:
    for (; offset < source.length; offset++) {
        const code = source.charCodeAt(offset);

        // name code point
        if (charCodeDefinitions.isName(code)) {
            // Append the code point to result.
            continue;
        }

        // the stream starts with a valid escape
        if (charCodeDefinitions.isValidEscape(code, getCharCode(source, offset + 1))) {
            // Consume an escaped code point. Append the returned code point to result.
            offset = consumeEscaped(source, offset) - 1;
            continue;
        }

        // anything else
        // Reconsume the current input code point. Return result.
        break;
    }

    return offset;
}

// §4.3.12. Consume a number
function consumeNumber(source, offset) {
    let code = source.charCodeAt(offset);

    // 2. If the next input code point is U+002B PLUS SIGN (+) or U+002D HYPHEN-MINUS (-),
    // consume it and append it to repr.
    if (code === 0x002B || code === 0x002D) {
        code = source.charCodeAt(offset += 1);
    }

    // 3. While the next input code point is a digit, consume it and append it to repr.
    if (charCodeDefinitions.isDigit(code)) {
        offset = findDecimalNumberEnd(source, offset + 1);
        code = source.charCodeAt(offset);
    }

    // 4. If the next 2 input code points are U+002E FULL STOP (.) followed by a digit, then:
    if (code === 0x002E && charCodeDefinitions.isDigit(source.charCodeAt(offset + 1))) {
        // 4.1 Consume them.
        // 4.2 Append them to repr.
        offset += 2;

        // 4.3 Set type to "number".
        // TODO

        // 4.4 While the next input code point is a digit, consume it and append it to repr.

        offset = findDecimalNumberEnd(source, offset);
    }

    // 5. If the next 2 or 3 input code points are U+0045 LATIN CAPITAL LETTER E (E)
    // or U+0065 LATIN SMALL LETTER E (e), ... , followed by a digit, then:
    if (cmpChar(source, offset, 101 /* e */)) {
        let sign = 0;
        code = source.charCodeAt(offset + 1);

        // ... optionally followed by U+002D HYPHEN-MINUS (-) or U+002B PLUS SIGN (+) ...
        if (code === 0x002D || code === 0x002B) {
            sign = 1;
            code = source.charCodeAt(offset + 2);
        }

        // ... followed by a digit
        if (charCodeDefinitions.isDigit(code)) {
            // 5.1 Consume them.
            // 5.2 Append them to repr.

            // 5.3 Set type to "number".
            // TODO

            // 5.4 While the next input code point is a digit, consume it and append it to repr.
            offset = findDecimalNumberEnd(source, offset + 1 + sign + 1);
        }
    }

    return offset;
}

// § 4.3.14. Consume the remnants of a bad url
// ... its sole use is to consume enough of the input stream to reach a recovery point
// where normal tokenizing can resume.
function consumeBadUrlRemnants(source, offset) {
    // Repeatedly consume the next input code point from the stream:
    for (; offset < source.length; offset++) {
        const code = source.charCodeAt(offset);

        // U+0029 RIGHT PARENTHESIS ())
        // EOF
        if (code === 0x0029) {
            // Return.
            offset++;
            break;
        }

        if (charCodeDefinitions.isValidEscape(code, getCharCode(source, offset + 1))) {
            // Consume an escaped code point.
            // Note: This allows an escaped right parenthesis ("\)") to be encountered
            // without ending the <bad-url-token>. This is otherwise identical to
            // the "anything else" clause.
            offset = consumeEscaped(source, offset);
        }
    }

    return offset;
}

// § 4.3.7. Consume an escaped code point
// Note: This algorithm assumes that escaped is valid without leading U+005C REVERSE SOLIDUS (\)
function decodeEscaped(escaped) {
    // Single char escaped that's not a hex digit
    if (escaped.length === 1 && !charCodeDefinitions.isHexDigit(escaped.charCodeAt(0))) {
        return escaped[0];
    }

    // Interpret the hex digits as a hexadecimal number.
    let code = parseInt(escaped, 16);

    if (
        (code === 0) ||                       // If this number is zero,
        (code >= 0xD800 && code <= 0xDFFF) || // or is for a surrogate,
        (code > 0x10FFFF)                     // or is greater than the maximum allowed code point
    ) {
        // ... return U+FFFD REPLACEMENT CHARACTER
        code = 0xFFFD;
    }

    // Otherwise, return the code point with that value.
    return String.fromCodePoint(code);
}

exports.cmpChar = cmpChar;
exports.cmpStr = cmpStr;
exports.consumeBadUrlRemnants = consumeBadUrlRemnants;
exports.consumeEscaped = consumeEscaped;
exports.consumeName = consumeName;
exports.consumeNumber = consumeNumber;
exports.decodeEscaped = decodeEscaped;
exports.findDecimalNumberEnd = findDecimalNumberEnd;
exports.findWhiteSpaceEnd = findWhiteSpaceEnd;
exports.findWhiteSpaceStart = findWhiteSpaceStart;
exports.getNewlineLength = getNewlineLength;
+סxa100644 List.cjs %a*{k;100644 clone.cjs Avoi'100644 create-custom-error.cjs 5p[+c^=)94100644 get-tokenizer.cjs ]qhcNȐ~WYH100644 ident.cjs p.`z6N100644 index.cjs ͮbSPIl
i100644 names.cjs <qX( O+100644 string.cjs $<P`%100644 url.cjs ' b&'\LmEix2'use strict';

//
//                              list
//                            ┌──────┐
//             ┌──────────────┼─head │
//             │              │ tail─┼──────────────┐
//             │              └──────┘              │
//             ▼                                    ▼
//            item        item        item        item
//          ┌──────┐    ┌──────┐    ┌──────┐    ┌──────┐
//  null ◀──┼─prev │◀───┼─prev │◀───┼─prev │◀───┼─prev │
//          │ next─┼───▶│ next─┼───▶│ next─┼───▶│ next─┼──▶ null
//          ├──────┤    ├──────┤    ├──────┤    ├──────┤
//          │ data │    │ data │    │ data │    │ data │
//          └──────┘    └──────┘    └──────┘    └──────┘
//

let releasedCursors = null;

class List {
    static createItem(data) {
        return {
            prev: null,
            next: null,
            data
        };
    }

    constructor() {
        this.head = null;
        this.tail = null;
        this.cursor = null;
    }
    createItem(data) {
        return List.createItem(data);
    }

    // cursor helpers
    allocateCursor(prev, next) {
        let cursor;

        if (releasedCursors !== null) {
            cursor = releasedCursors;
            releasedCursors = releasedCursors.cursor;
            cursor.prev = prev;
            cursor.next = next;
            cursor.cursor = this.cursor;
        } else {
            cursor = {
                prev,
                next,
                cursor: this.cursor
            };
        }

        this.cursor = cursor;

        return cursor;
    }
    releaseCursor() {
        const { cursor } = this;

        this.cursor = cursor.cursor;
        cursor.prev = null;
        cursor.next = null;
        cursor.cursor = releasedCursors;
        releasedCursors = cursor;
    }
    updateCursors(prevOld, prevNew, nextOld, nextNew) {
        let { cursor } = this;

        while (cursor !== null) {
            if (cursor.prev === prevOld) {
                cursor.prev = prevNew;
            }

            if (cursor.next === nextOld) {
                cursor.next = nextNew;
            }

            cursor = cursor.cursor;
        }
    }
    *[Symbol.iterator]() {
        for (let cursor = this.head; cursor !== null; cursor = cursor.next) {
            yield cursor.data;
        }
    }

    // getters
    get size() {
        let size = 0;

        for (let cursor = this.head; cursor !== null; cursor = cursor.next) {
            size++;
        }

        return size;
    }
    get isEmpty() {
        return this.head === null;
    }
    get first() {
        return this.head && this.head.data;
    }
    get last() {
        return this.tail && this.tail.data;
    }

    // convertors
    fromArray(array) {
        let cursor = null;
        this.head = null;

        for (let data of array) {
            const item = List.createItem(data);

            if (cursor !== null) {
                cursor.next = item;
            } else {
                this.head = item;
            }

            item.prev = cursor;
            cursor = item;
        }

        this.tail = cursor;
        return this;
    }
    toArray() {
        return [...this];
    }
    toJSON() {
        return [...this];
    }

    // array-like methods
    forEach(fn, thisArg = this) {
        // push cursor
        const cursor = this.allocateCursor(null, this.head);

        while (cursor.next !== null) {
            const item = cursor.next;
            cursor.next = item.next;
            fn.call(thisArg, item.data, item, this);
        }

        // pop cursor
        this.releaseCursor();
    }
    forEachRight(fn, thisArg = this) {
        // push cursor
        const cursor = this.allocateCursor(this.tail, null);

        while (cursor.prev !== null) {
            const item = cursor.prev;
            cursor.prev = item.prev;
            fn.call(thisArg, item.data, item, this);
        }

        // pop cursor
        this.releaseCursor();
    }
    reduce(fn, initialValue, thisArg = this) {
        // push cursor
        let cursor = this.allocateCursor(null, this.head);
        let acc = initialValue;
        let item;

        while (cursor.next !== null) {
            item = cursor.next;
            cursor.next = item.next;

            acc = fn.call(thisArg, acc, item.data, item, this);
        }

        // pop cursor
        this.releaseCursor();

        return acc;
    }
    reduceRight(fn, initialValue, thisArg = this) {
        // push cursor
        let cursor = this.allocateCursor(this.tail, null);
        let acc = initialValue;
        let item;

        while (cursor.prev !== null) {
            item = cursor.prev;
            cursor.prev = item.prev;

            acc = fn.call(thisArg, acc, item.data, item, this);
        }

        // pop cursor
        this.releaseCursor();

        return acc;
    }
    some(fn, thisArg = this) {
        for (let cursor = this.head; cursor !== null; cursor = cursor.next) {
            if (fn.call(thisArg, cursor.data, cursor, this)) {
                return true;
            }
        }

        return false;
    }
    map(fn, thisArg = this) {
        const result = new List();

        for (let cursor = this.head; cursor !== null; cursor = cursor.next) {
            result.appendData(fn.call(thisArg, cursor.data, cursor, this));
        }

        return result;
    }
    filter(fn, thisArg = this) {
        const result = new List();

        for (let cursor = this.head; cursor !== null; cursor = cursor.next) {
            if (fn.call(thisArg, cursor.data, cursor, this)) {
                result.appendData(cursor.data);
            }
        }

        return result;
    }

    nextUntil(start, fn, thisArg = this) {
        if (start === null) {
            return;
        }

        // push cursor
        const cursor = this.allocateCursor(null, start);

        while (cursor.next !== null) {
            const item = cursor.next;
            cursor.next = item.next;
            if (fn.call(thisArg, item.data, item, this)) {
                break;
            }
        }

        // pop cursor
        this.releaseCursor();
    }
    prevUntil(start, fn, thisArg = this) {
        if (start === null) {
            return;
        }

        // push cursor
        const cursor = this.allocateCursor(start, null);

        while (cursor.prev !== null) {
            const item = cursor.prev;
            cursor.prev = item.prev;
            if (fn.call(thisArg, item.data, item, this)) {
                break;
            }
        }

        // pop cursor
        this.releaseCursor();
    }

    // mutation
    clear() {
        this.head = null;
        this.tail = null;
    }
    copy() {
        const result = new List();

        for (let data of this) {
            result.appendData(data);
        }

        return result;
    }
    prepend(item) {
        //      head
        //    ^
        // item
        this.updateCursors(null, item, this.head, item);

        // insert to the beginning of the list
        if (this.head !== null) {
            // new item <- first item
            this.head.prev = item;
            // new item -> first item
            item.next = this.head;
        } else {
            // if list has no head, then it also has no tail
            // in this case tail points to the new item
            this.tail = item;
        }

        // head always points to new item
        this.head = item;
        return this;
    }
    prependData(data) {
        return this.prepend(List.createItem(data));
    }
    append(item) {
        return this.insert(item);
    }
    appendData(data) {
        return this.insert(List.createItem(data));
    }
    insert(item, before = null) {
        if (before !== null) {
            // prev   before
            //      ^
            //     item
            this.updateCursors(before.prev, item, before, item);

            if (before.prev === null) {
                // insert to the beginning of list
                if (this.head !== before) {
                    throw new Error('before doesn\'t belong to list');
                }
                // since head points to before therefore list doesn't empty
                // no need to check tail
                this.head = item;
                before.prev = item;
                item.next = before;
                this.updateCursors(null, item);
            } else {
                // insert between two items
                before.prev.next = item;
                item.prev = before.prev;
                before.prev = item;
                item.next = before;
            }
        } else {
            // tail
            //      ^
            //      item
            this.updateCursors(this.tail, item, null, item);

            // insert to the ending of the list
            if (this.tail !== null) {
                // last item -> new item
                this.tail.next = item;
                // last item <- new item
                item.prev = this.tail;
            } else {
                // if list has no tail, then it also has no head
                // in this case head points to new item
                this.head = item;
            }

            // tail always points to new item
            this.tail = item;
        }

        return this;
    }
    insertData(data, before) {
        return this.insert(List.createItem(data), before);
    }
    remove(item) {
        //      item
        //       ^
        // prev     next
        this.updateCursors(item, item.prev, item, item.next);

        if (item.prev !== null) {
            item.prev.next = item.next;
        } else {
            if (this.head !== item) {
                throw new Error('item doesn\'t belong to list');
            }

            this.head = item.next;
        }

        if (item.next !== null) {
            item.next.prev = item.prev;
        } else {
            if (this.tail !== item) {
                throw new Error('item doesn\'t belong to list');
            }

            this.tail = item.prev;
        }

        item.prev = null;
        item.next = null;

        return item;
    }
    push(data) {
        this.insert(List.createItem(data));
    }
    pop() {
        return this.tail !== null ? this.remove(this.tail) : null;
    }
    unshift(data) {
        this.prepend(List.createItem(data));
    }
    shift() {
        return this.head !== null ? this.remove(this.head) : null;
    }
    prependList(list) {
        return this.insertList(list, this.head);
    }
    appendList(list) {
        return this.insertList(list);
    }
    insertList(list, before) {
        // ignore empty lists
        if (list.head === null) {
            return this;
        }

        if (before !== undefined && before !== null) {
            this.updateCursors(before.prev, list.tail, before, list.head);

            // insert in the middle of dist list
            if (before.prev !== null) {
                // before.prev <-> list.head
                before.prev.next = list.head;
                list.head.prev = before.prev;
            } else {
                this.head = list.head;
            }

            before.prev = list.tail;
            list.tail.next = before;
        } else {
            this.updateCursors(this.tail, list.tail, null, list.head);

            // insert to end of the list
            if (this.tail !== null) {
                // if destination list has a tail, then it also has a head,
                // but head doesn't change
                // dest tail -> source head
                this.tail.next = list.head;
                // dest tail <- source head
                list.head.prev = this.tail;
            } else {
                // if list has no a tail, then it also has no a head
                // in this case points head to new item
                this.head = list.head;
            }

            // tail always start point to new item
            this.tail = list.tail;
        }

        list.head = null;
        list.tail = null;
        return this;
    }
    replace(oldItem, newItemOrList) {
        if ('head' in newItemOrList) {
            this.insertList(newItemOrList, oldItem);
        } else {
            this.insert(newItemOrList, oldItem);
        }

        this.remove(oldItem);
    }
}

exports.List = List;
«}'x'use strict';

const List = require('./List.cjs');

function clone(node) {
    const result = {};

    for (const key of Object.keys(node)) {
        let value = node[key];

        if (value) {
            if (Array.isArray(value) || value instanceof List.List) {
                value = value.map(clone);
            } else if (value.constructor === Object) {
                value = clone(value);
            }
        }

        result[key] = value;
    }

    return result;
}

exports.clone = clone;
a!x'use strict';

function createCustomError(name, message) {
    // use Object.create(), because some VMs prevent setting line/column otherwise
    // (iOS Safari 10 even throws an exception)
    const error = Object.create(SyntaxError.prototype);
    const errorStack = new Error();

    return Object.assign(error, {
        name,
        message,
        get stack() {
            return (errorStack.stack || '').replace(/^(.+\n){1,3}/, `${name}: ${message}\n`);
        }
    });
}

exports.createCustomError = createCustomError;
t!x'use strict';

const index = require('../tokenizer/index.cjs');

const FUNCTION_TYPE = 'function';

/**
 * Gets the tokenizer function from the configuration object or returns the default tokenizer
 *
 * @param config Configuration object
 * @returns Corresponding tokenizer function
 */
function getTokenizer(config) {
    if (config && typeof config.tokenize === FUNCTION_TYPE) {
        return config.tokenize;
    }

    // Fallback to the default tokenizer
    return index.tokenize;
}

exports.getTokenizer = getTokenizer;
ޠ>x<'use strict';

const charCodeDefinitions = require('../tokenizer/char-code-definitions.cjs');
const utils = require('../tokenizer/utils.cjs');

const REVERSE_SOLIDUS = 0x005c; // U+005C REVERSE SOLIDUS (\)

function decode(str) {
    const end = str.length - 1;
    let decoded = '';

    for (let i = 0; i < str.length; i++) {
        let code = str.charCodeAt(i);

        if (code === REVERSE_SOLIDUS) {
            // special case at the ending
            if (i === end) {
                // if the next input code point is EOF, do nothing
                break;
            }

            code = str.charCodeAt(++i);

            // consume escaped
            if (charCodeDefinitions.isValidEscape(REVERSE_SOLIDUS, code)) {
                const escapeStart = i - 1;
                const escapeEnd = utils.consumeEscaped(str, escapeStart);

                i = escapeEnd - 1;
                decoded += utils.decodeEscaped(str.substring(escapeStart + 1, escapeEnd));
            } else {
                // \r\n
                if (code === 0x000d && str.charCodeAt(i + 1) === 0x000a) {
                    i++;
                }
            }
        } else {
            decoded += str[i];
        }
    }

    return decoded;
}

// https://drafts.csswg.org/cssom/#serialize-an-identifier
// § 2.1. Common Serializing Idioms
function encode(str) {
    let encoded = '';

    // If the character is the first character and is a "-" (U+002D),
    // and there is no second character, then the escaped character.
    // Note: That's means a single dash string "-" return as escaped dash,
    // so move the condition out of the main loop
    if (str.length === 1 && str.charCodeAt(0) === 0x002D) {
        return '\\-';
    }

    // To serialize an identifier means to create a string represented
    // by the concatenation of, for each character of the identifier:
    for (let i = 0; i < str.length; i++) {
        const code = str.charCodeAt(i);

        // If the character is NULL (U+0000), then the REPLACEMENT CHARACTER (U+FFFD).
        if (code === 0x0000) {
            encoded += '\uFFFD';
            continue;
        }

        if (
            // If the character is in the range [\1-\1f] (U+0001 to U+001F) or is U+007F ...
            // Note: Do not compare with 0x0001 since 0x0000 is precessed before
            code <= 0x001F || code === 0x007F ||
            // [or] ... is in the range [0-9] (U+0030 to U+0039),
            (code >= 0x0030 && code <= 0x0039 && (
                // If the character is the first character ...
                i === 0 ||
                // If the character is the second character ... and the first character is a "-" (U+002D)
                i === 1 && str.charCodeAt(0) === 0x002D
            ))
        ) {
            // ... then the character escaped as code point.
            encoded += '\\' + code.toString(16) + ' ';
            continue;
        }

        // If the character is not handled by one of the above rules and is greater
        // than or equal to U+0080, is "-" (U+002D) or "_" (U+005F), or is in one
        // of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to U+005A),
        // or \[a-z] (U+0061 to U+007A), then the character itself.
        if (charCodeDefinitions.isName(code)) {
            encoded += str.charAt(i);
        } else {
            // Otherwise, the escaped character.
            encoded += '\\' + str.charAt(i);
        }
    }

    return encoded;
}

exports.decode = decode;
exports.encode = encode;
1# x'use strict';

const clone = require('./clone.cjs');
const ident = require('./ident.cjs');
const List = require('./List.cjs');
const names = require('./names.cjs');
const string = require('./string.cjs');
const url = require('./url.cjs');



exports.clone = clone.clone;
exports.ident = ident;
exports.List = List.List;
exports.isCustomProperty = names.isCustomProperty;
exports.keyword = names.keyword;
exports.property = names.property;
exports.vendorPrefix = names.vendorPrefix;
exports.string = string;
exports.url = url;
*x'use strict';

const keywords = new Map();
const properties = new Map();
const HYPHENMINUS = 45; // '-'.charCodeAt()

const keyword = getKeywordDescriptor;
const property = getPropertyDescriptor;
const vendorPrefix = getVendorPrefix;
function isCustomProperty(str, offset) {
    offset = offset || 0;

    return str.length - offset >= 2 &&
           str.charCodeAt(offset) === HYPHENMINUS &&
           str.charCodeAt(offset + 1) === HYPHENMINUS;
}

function getVendorPrefix(str, offset) {
    offset = offset || 0;

    // verdor prefix should be at least 3 chars length
    if (str.length - offset >= 3) {
        // vendor prefix starts with hyper minus following non-hyper minus
        if (str.charCodeAt(offset) === HYPHENMINUS &&
            str.charCodeAt(offset + 1) !== HYPHENMINUS) {
            // vendor prefix should contain a hyper minus at the ending
            const secondDashIndex = str.indexOf('-', offset + 2);

            if (secondDashIndex !== -1) {
                return str.substring(offset, secondDashIndex + 1);
            }
        }
    }

    return '';
}

function getKeywordDescriptor(keyword) {
    if (keywords.has(keyword)) {
        return keywords.get(keyword);
    }

    const name = keyword.toLowerCase();
    let descriptor = keywords.get(name);

    if (descriptor === undefined) {
        const custom = isCustomProperty(name, 0);
        const vendor = !custom ? getVendorPrefix(name, 0) : '';
        descriptor = Object.freeze({
            basename: name.substr(vendor.length),
            name,
            prefix: vendor,
            vendor,
            custom
        });
    }

    keywords.set(keyword, descriptor);

    return descriptor;
}

function getPropertyDescriptor(property) {
    if (properties.has(property)) {
        return properties.get(property);
    }

    let name = property;
    let hack = property[0];

    if (hack === '/') {
        hack = property[1] === '/' ? '//' : '/';
    } else if (hack !== '_' &&
               hack !== '*' &&
               hack !== '$' &&
               hack !== '#' &&
               hack !== '+' &&
               hack !== '&') {
        hack = '';
    }

    const custom = isCustomProperty(name, hack.length);

    // re-use result when possible (the same as for lower case)
    if (!custom) {
        name = name.toLowerCase();
        if (properties.has(name)) {
            const descriptor = properties.get(name);
            properties.set(property, descriptor);
            return descriptor;
        }
    }

    const vendor = !custom ? getVendorPrefix(name, hack.length) : '';
    const prefix = name.substr(0, hack.length + vendor.length);
    const descriptor = Object.freeze({
        basename: name.substr(prefix.length),
        name: name.substr(hack.length),
        hack,
        vendor,
        prefix,
        custom
    });

    properties.set(property, descriptor);

    return descriptor;
}

exports.isCustomProperty = isCustomProperty;
exports.keyword = keyword;
exports.property = property;
exports.vendorPrefix = vendorPrefix;
f7_x#'use strict';

const charCodeDefinitions = require('../tokenizer/char-code-definitions.cjs');
const utils = require('../tokenizer/utils.cjs');

const REVERSE_SOLIDUS = 0x005c; // U+005C REVERSE SOLIDUS (\)
const QUOTATION_MARK = 0x0022;  // "
const APOSTROPHE = 0x0027;      // '

function decode(str) {
    const len = str.length;
    const firstChar = str.charCodeAt(0);
    const start = firstChar === QUOTATION_MARK || firstChar === APOSTROPHE ? 1 : 0;
    const end = start === 1 && len > 1 && str.charCodeAt(len - 1) === firstChar ? len - 2 : len - 1;
    let decoded = '';

    for (let i = start; i <= end; i++) {
        let code = str.charCodeAt(i);

        if (code === REVERSE_SOLIDUS) {
            // special case at the ending
            if (i === end) {
                // if the next input code point is EOF, do nothing
                // otherwise include last quote as escaped
                if (i !== len - 1) {
                    decoded = str.substr(i + 1);
                }
                break;
            }

            code = str.charCodeAt(++i);

            // consume escaped
            if (charCodeDefinitions.isValidEscape(REVERSE_SOLIDUS, code)) {
                const escapeStart = i - 1;
                const escapeEnd = utils.consumeEscaped(str, escapeStart);

                i = escapeEnd - 1;
                decoded += utils.decodeEscaped(str.substring(escapeStart + 1, escapeEnd));
            } else {
                // \r\n
                if (code === 0x000d && str.charCodeAt(i + 1) === 0x000a) {
                    i++;
                }
            }
        } else {
            decoded += str[i];
        }
    }

    return decoded;
}

// https://drafts.csswg.org/cssom/#serialize-a-string
// § 2.1. Common Serializing Idioms
function encode(str, apostrophe) {
    const quote = apostrophe ? '\'' : '"';
    const quoteCode = apostrophe ? APOSTROPHE : QUOTATION_MARK;
    let encoded = '';
    let wsBeforeHexIsNeeded = false;

    for (let i = 0; i < str.length; i++) {
        const code = str.charCodeAt(i);

        // If the character is NULL (U+0000), then the REPLACEMENT CHARACTER (U+FFFD).
        if (code === 0x0000) {
            encoded += '\uFFFD';
            continue;
        }

        // If the character is in the range [\1-\1f] (U+0001 to U+001F) or is U+007F,
        // the character escaped as code point.
        // Note: Do not compare with 0x0001 since 0x0000 is precessed before
        if (code <= 0x001f || code === 0x007F) {
            encoded += '\\' + code.toString(16);
            wsBeforeHexIsNeeded = true;
            continue;
        }

        // If the character is '"' (U+0022) or "\" (U+005C), the escaped character.
        if (code === quoteCode || code === REVERSE_SOLIDUS) {
            encoded += '\\' + str.charAt(i);
            wsBeforeHexIsNeeded = false;
        } else {
            if (wsBeforeHexIsNeeded && (charCodeDefinitions.isHexDigit(code) || charCodeDefinitions.isWhiteSpace(code))) {
                encoded += ' ';
            }

            // Otherwise, the character itself.
            encoded += str.charAt(i);
            wsBeforeHexIsNeeded = false;
        }
    }

    return quote + encoded + quote;
}

exports.decode = decode;
exports.encode = encode;
N^̷x''use strict';

const charCodeDefinitions = require('../tokenizer/char-code-definitions.cjs');
const utils = require('../tokenizer/utils.cjs');

const SPACE = 0x0020;            // U+0020 SPACE
const REVERSE_SOLIDUS = 0x005c;  // U+005C REVERSE SOLIDUS (\)
const QUOTATION_MARK = 0x0022;   // "
const APOSTROPHE = 0x0027;       // '
const LEFTPARENTHESIS = 0x0028;  // U+0028 LEFT PARENTHESIS (()
const RIGHTPARENTHESIS = 0x0029; // U+0029 RIGHT PARENTHESIS ())

function decode(str) {
    const len = str.length;
    let start = 4; // length of "url("
    let end = str.charCodeAt(len - 1) === RIGHTPARENTHESIS ? len - 2 : len - 1;
    let decoded = '';

    while (start < end && charCodeDefinitions.isWhiteSpace(str.charCodeAt(start))) {
        start++;
    }

    while (start < end && charCodeDefinitions.isWhiteSpace(str.charCodeAt(end))) {
        end--;
    }

    for (let i = start; i <= end; i++) {
        let code = str.charCodeAt(i);

        if (code === REVERSE_SOLIDUS) {
            // special case at the ending
            if (i === end) {
                // if the next input code point is EOF, do nothing
                // otherwise include last left parenthesis as escaped
                if (i !== len - 1) {
                    decoded = str.substr(i + 1);
                }
                break;
            }

            code = str.charCodeAt(++i);

            // consume escaped
            if (charCodeDefinitions.isValidEscape(REVERSE_SOLIDUS, code)) {
                const escapeStart = i - 1;
                const escapeEnd = utils.consumeEscaped(str, escapeStart);

                i = escapeEnd - 1;
                decoded += utils.decodeEscaped(str.substring(escapeStart + 1, escapeEnd));
            } else {
                // \r\n
                if (code === 0x000d && str.charCodeAt(i + 1) === 0x000a) {
                    i++;
                }
            }
        } else {
            decoded += str[i];
        }
    }

    return decoded;
}

function encode(str) {
    let encoded = '';
    let wsBeforeHexIsNeeded = false;

    for (let i = 0; i < str.length; i++) {
        const code = str.charCodeAt(i);

        // If the character is NULL (U+0000), then the REPLACEMENT CHARACTER (U+FFFD).
        if (code === 0x0000) {
            encoded += '\uFFFD';
            continue;
        }

        // If the character is in the range [\1-\1f] (U+0001 to U+001F) or is U+007F,
        // the character escaped as code point.
        // Note: Do not compare with 0x0001 since 0x0000 is precessed before
        if (code <= 0x001f || code === 0x007F) {
            encoded += '\\' + code.toString(16);
            wsBeforeHexIsNeeded = true;
            continue;
        }

        if (code === SPACE ||
            code === REVERSE_SOLIDUS ||
            code === QUOTATION_MARK ||
            code === APOSTROPHE ||
            code === LEFTPARENTHESIS ||
            code === RIGHTPARENTHESIS) {
            encoded += '\\' + str.charAt(i);
            wsBeforeHexIsNeeded = false;
        } else {
            if (wsBeforeHexIsNeeded && charCodeDefinitions.isHexDigit(code)) {
                encoded += ' ';
            }

            encoded += str.charAt(i);
            wsBeforeHexIsNeeded = false;
        }
    }

    return 'url(' + encoded + ')';
}

exports.decode = decode;
exports.encode = encode;
Rx[ 'use strict';

const { version } = require('../package.json');

exports.version = version;
xK 100644 create.cjs 989Yyf&pf3cE100644 index.cjs #=I\V3nxo'use strict';

const { hasOwnProperty } = Object.prototype;
const noop = function() {};

function ensureFunction(value) {
    return typeof value === 'function' ? value : noop;
}

function invokeForType(fn, type) {
    return function(node, item, list) {
        if (node.type === type) {
            fn.call(this, node, item, list);
        }
    };
}

function getWalkersFromStructure(name, nodeType) {
    const structure = nodeType.structure;
    const walkers = [];

    for (const key in structure) {
        if (hasOwnProperty.call(structure, key) === false) {
            continue;
        }

        let fieldTypes = structure[key];
        const walker = {
            name: key,
            type: false,
            nullable: false
        };

        if (!Array.isArray(fieldTypes)) {
            fieldTypes = [fieldTypes];
        }

        for (const fieldType of fieldTypes) {
            if (fieldType === null) {
                walker.nullable = true;
            } else if (typeof fieldType === 'string') {
                walker.type = 'node';
            } else if (Array.isArray(fieldType)) {
                walker.type = 'list';
            }
        }

        if (walker.type) {
            walkers.push(walker);
        }
    }

    if (walkers.length) {
        return {
            context: nodeType.walkContext,
            fields: walkers
        };
    }

    return null;
}

function getTypesFromConfig(config) {
    const types = {};

    for (const name in config.node) {
        if (hasOwnProperty.call(config.node, name)) {
            const nodeType = config.node[name];

            if (!nodeType.structure) {
                throw new Error('Missed `structure` field in `' + name + '` node type definition');
            }

            types[name] = getWalkersFromStructure(name, nodeType);
        }
    }

    return types;
}

function createTypeIterator(config, reverse) {
    const fields = config.fields.slice();
    const contextName = config.context;
    const useContext = typeof contextName === 'string';

    if (reverse) {
        fields.reverse();
    }

    return function(node, context, walk, walkReducer) {
        let prevContextValue;

        if (useContext) {
            prevContextValue = context[contextName];
            context[contextName] = node;
        }

        for (const field of fields) {
            const ref = node[field.name];

            if (!field.nullable || ref) {
                if (field.type === 'list') {
                    const breakWalk = reverse
                        ? ref.reduceRight(walkReducer, false)
                        : ref.reduce(walkReducer, false);

                    if (breakWalk) {
                        return true;
                    }
                } else if (walk(ref)) {
                    return true;
                }
            }
        }

        if (useContext) {
            context[contextName] = prevContextValue;
        }
    };
}

function createFastTraveralMap({
    StyleSheet,
    Atrule,
    Rule,
    Block,
    DeclarationList
}) {
    return {
        Atrule: {
            StyleSheet,
            Atrule,
            Rule,
            Block
        },
        Rule: {
            StyleSheet,
            Atrule,
            Rule,
            Block
        },
        Declaration: {
            StyleSheet,
            Atrule,
            Rule,
            Block,
            DeclarationList
        }
    };
}

function createWalker(config) {
    const types = getTypesFromConfig(config);
    const iteratorsNatural = {};
    const iteratorsReverse = {};
    const breakWalk = Symbol('break-walk');
    const skipNode = Symbol('skip-node');

    for (const name in types) {
        if (hasOwnProperty.call(types, name) && types[name] !== null) {
            iteratorsNatural[name] = createTypeIterator(types[name], false);
            iteratorsReverse[name] = createTypeIterator(types[name], true);
        }
    }

    const fastTraversalIteratorsNatural = createFastTraveralMap(iteratorsNatural);
    const fastTraversalIteratorsReverse = createFastTraveralMap(iteratorsReverse);

    const walk = function(root, options) {
        function walkNode(node, item, list) {
            const enterRet = enter.call(context, node, item, list);

            if (enterRet === breakWalk) {
                return true;
            }

            if (enterRet === skipNode) {
                return false;
            }

            if (iterators.hasOwnProperty(node.type)) {
                if (iterators[node.type](node, context, walkNode, walkReducer)) {
                    return true;
                }
            }

            if (leave.call(context, node, item, list) === breakWalk) {
                return true;
            }

            return false;
        }

        let enter = noop;
        let leave = noop;
        let iterators = iteratorsNatural;
        let walkReducer = (ret, data, item, list) => ret || walkNode(data, item, list);
        const context = {
            break: breakWalk,
            skip: skipNode,

            root,
            stylesheet: null,
            atrule: null,
            atrulePrelude: null,
            rule: null,
            selector: null,
            block: null,
            declaration: null,
            function: null
        };

        if (typeof options === 'function') {
            enter = options;
        } else if (options) {
            enter = ensureFunction(options.enter);
            leave = ensureFunction(options.leave);

            if (options.reverse) {
                iterators = iteratorsReverse;
            }

            if (options.visit) {
                if (fastTraversalIteratorsNatural.hasOwnProperty(options.visit)) {
                    iterators = options.reverse
                        ? fastTraversalIteratorsReverse[options.visit]
                        : fastTraversalIteratorsNatural[options.visit];
                } else if (!types.hasOwnProperty(options.visit)) {
                    throw new Error('Bad value `' + options.visit + '` for `visit` option (should be: ' + Object.keys(types).sort().join(', ') + ')');
                }

                enter = invokeForType(enter, options.visit);
                leave = invokeForType(leave, options.visit);
            }
        }

        if (enter === noop && leave === noop) {
            throw new Error('Neither `enter` nor `leave` walker handler is set or both aren\'t a function');
        }

        walkNode(root);
    };

    walk.break = breakWalk;
    walk.skip = skipNode;

    walk.find = function(ast, fn) {
        let found = null;

        walk(ast, function(node, item, list) {
            if (fn.call(this, node, item, list)) {
                found = node;
                return breakWalk;
            }
        });

        return found;
    };

    walk.findLast = function(ast, fn) {
        let found = null;

        walk(ast, {
            reverse: true,
            enter(node, item, list) {
                if (fn.call(this, node, item, list)) {
                    found = node;
                    return breakWalk;
                }
            }
        });

        return found;
    };

    walk.findAll = function(ast, fn) {
        const found = [];

        walk(ast, function(node, item, list) {
            if (fn.call(this, node, item, list)) {
                found.push(node);
            }
        });

        return found;
    };

    return walk;
}

exports.createWalker = createWalker;
qEx F'use strict';

const create = require('./create.cjs');
const walker$1 = require('../syntax/config/walker.cjs');

const walker = create.createWalker(walker$1);

module.exports = walker;
>Ҧx& 100644 patch.json WJy8z ۗ^EsaxW2{
    "atrules": {
        "charset": {
            "prelude": "<string>"
        },
        "container": {
            "prelude": "[ <container-name> ]? <container-condition>"
        },
        "font-face": {
            "descriptors": {
                "unicode-range": {
                    "comment": "replaces <unicode-range>, an old production name",
                    "syntax": "<urange>#"
                }
            }
        },
        "font-features-values": {
            "comment": "The features values syntax is defined in https://www.w3.org/TR/css-fonts-4/#at-ruledef-font-feature-values",
            "prelude": "[<string> | <custom-ident>]+",
            "descriptors": {
                "font-display": "auto | block | swap | fallback | optional"
            }
        },
        "scope": {
            "prelude": "[ ( <scope-start> ) ]? [ to ( <scope-end> ) ]?"
        },
        "position-try": {
            "comment": "The list of descriptors: https://developer.mozilla.org/en-US/docs/Web/CSS/@position-try",
            "descriptors": {
                "top": "<'top'>",
                "left": "<'left'>",
                "bottom": "<'bottom'>",
                "right": "<'right'>",
                "inset-block-start": "<'inset-block-start'>",
                "inset-block-end": "<'inset-block-end'>",
                "inset-inline-start": "<'inset-inline-start'>",
                "inset-inline-end": "<'inset-inline-end'>",
                "inset-block": "<'inset-block'>",
                "inset-inline": "<'inset-inline'>",
                "inset": "<'inset'>",
                "margin-top": "<'margin-top'>",
                "margin-left": "<'margin-left'>",
                "margin-bottom": "<'margin-bottom'>",
                "margin-right": "<'margin-right'>",
                "margin-block-start": "<'margin-block-start'>",
                "margin-block-end": "<'margin-block-end'>",
                "margin-inline-start": "<'margin-inline-start'>",
                "margin-inline-end": "<'margin-inline-end'>",
                "margin": "<'margin'>",
                "margin-block": "<'margin-block'>",
                "margin-inline": "<'margin-inline'>",
                "width": "<'width'>",
                "height": "<'height'>",
                "min-width": "<'min-width'>",
                "min-height": "<'min-height'>",
                "max-width": "<'max-width'>",
                "max-height": "<'max-height'>",
                "block-size": "<'block-size'>",
                "inline-size": "<'inline-size'>",
                "min-block-size": "<'min-block-size'>",
                "min-inline-size": "<'min-inline-size'>",
                "max-block-size": "<'max-block-size'>",
                "max-inline-size": "<'max-inline-size'>",
                "align-self": "<'align-self'> | anchor-center",
                "justify-self": "<'justify-self'> | anchor-center"
            }
        }
    },
    "properties": {
        "-moz-background-clip": {
            "comment": "deprecated syntax in old Firefox, https://developer.mozilla.org/en/docs/Web/CSS/background-clip",
            "syntax": "padding | border"
        },
        "-moz-border-radius-bottomleft": {
            "comment": "https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-left-radius",
            "syntax": "<'border-bottom-left-radius'>"
        },
        "-moz-border-radius-bottomright": {
            "comment": "https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-right-radius",
            "syntax": "<'border-bottom-right-radius'>"
        },
        "-moz-border-radius-topleft": {
            "comment": "https://developer.mozilla.org/en-US/docs/Web/CSS/border-top-left-radius",
            "syntax": "<'border-top-left-radius'>"
        },
        "-moz-border-radius-topright": {
            "comment": "https://developer.mozilla.org/en-US/docs/Web/CSS/border-bottom-right-radius",
            "syntax": "<'border-bottom-right-radius'>"
        },
        "-moz-control-character-visibility": {
            "comment": "firefox specific keywords, https://bugzilla.mozilla.org/show_bug.cgi?id=947588",
            "syntax": "visible | hidden"
        },
        "-moz-osx-font-smoothing": {
            "comment": "misssed old syntax https://developer.mozilla.org/en-US/docs/Web/CSS/font-smooth",
            "syntax": "auto | grayscale"
        },
        "-moz-user-select": {
            "comment": "https://developer.mozilla.org/en-US/docs/Web/CSS/user-select",
            "syntax": "none | text | all | -moz-none"
        },
        "-ms-flex-align": {
            "comment": "misssed old syntax implemented in IE, https://www.w3.org/TR/2012/WD-css3-flexbox-20120322/#flex-align",
            "syntax": "start | end | center | baseline | stretch"
        },
        "-ms-flex-item-align": {
            "comment": "misssed old syntax implemented in IE, https://www.w3.org/TR/2012/WD-css3-flexbox-20120322/#flex-align",
            "syntax": "auto | start | end | center | baseline | stretch"
        },
        "-ms-flex-line-pack": {
            "comment": "misssed old syntax implemented in IE, https://www.w3.org/TR/2012/WD-css3-flexbox-20120322/#flex-line-pack",
            "syntax": "start | end | center | justify | distribute | stretch"
        },
        "-ms-flex-negative": {
            "comment": "misssed old syntax implemented in IE; TODO: find references for comfirmation",
            "syntax": "<'flex-shrink'>"
        },
        "-ms-flex-pack": {
            "comment": "misssed old syntax implemented in IE, https://www.w3.org/TR/2012/WD-css3-flexbox-20120322/#flex-pack",
            "syntax": "start | end | center | justify | distribute"
        },
        "-ms-flex-order": {
            "comment": "misssed old syntax implemented in IE; https://msdn.microsoft.com/en-us/library/jj127303(v=vs.85).aspx",
            "syntax": "<integer>"
        },
        "-ms-flex-positive": {
            "comment": "misssed old syntax implemented in IE; TODO: find references for comfirmation",
            "syntax": "<'flex-grow'>"
        },
        "-ms-flex-preferred-size": {
            "comment": "misssed old syntax implemented in IE; TODO: find references for comfirmation",
            "syntax": "<'flex-basis'>"
        },
        "-ms-interpolation-mode": {
            "comment": "https://msdn.microsoft.com/en-us/library/ff521095(v=vs.85).aspx",
            "syntax": "nearest-neighbor | bicubic"
        },
        "-ms-grid-column-align": {
            "comment": "add this property first since it uses as fallback for flexbox, https://msdn.microsoft.com/en-us/library/windows/apps/hh466338.aspx",
            "syntax": "start | end | center | stretch"
        },
        "-ms-grid-row-align": {
            "comment": "add this property first since it uses as fallback for flexbox, https://msdn.microsoft.com/en-us/library/windows/apps/hh466348.aspx",
            "syntax": "start | end | center | stretch"
        },
        "-ms-hyphenate-limit-last": {
            "comment": "misssed old syntax implemented in IE; https://www.w3.org/TR/css-text-4/#hyphenate-line-limits",
            "syntax": "none | always | column | page | spread"
        },
        "-webkit-appearance": {
            "comment": "webkit specific keywords",
            "references": [
                "http://css-infos.net/property/-webkit-appearance"
            ],
            "syntax": "none | button | button-bevel | caps-lock-indicator | caret | checkbox | default-button | inner-spin-button | listbox | listitem | media-controls-background | media-controls-fullscreen-background | media-current-time-display | media-enter-fullscreen-button | media-exit-fullscreen-button | media-fullscreen-button | media-mute-button | media-overlay-play-button | media-play-button | media-seek-back-button | media-seek-forward-button | media-slider | media-sliderthumb | media-time-remaining-display | media-toggle-closed-captions-button | media-volume-slider | media-volume-slider-container | media-volume-sliderthumb | menulist | menulist-button | menulist-text | menulist-textfield | meter | progress-bar | progress-bar-value | push-button | radio | scrollbarbutton-down | scrollbarbutton-left | scrollbarbutton-right | scrollbarbutton-up | scrollbargripper-horizontal | scrollbargripper-vertical | scrollbarthumb-horizontal | scrollbarthumb-vertical | scrollbartrack-horizontal | scrollbartrack-vertical | searchfield | searchfield-cancel-button | searchfield-decoration | searchfield-results-button | searchfield-results-decoration | slider-horizontal | slider-vertical | sliderthumb-horizontal | sliderthumb-vertical | square-button | textarea | textfield | -apple-pay-button"
        },
        "-webkit-background-clip": {
            "comment": "https://developer.mozilla.org/en/docs/Web/CSS/background-clip",
            "syntax": "[ <visual-box> | border | padding | content | text ]#"
        },
        "-webkit-column-break-after": {
            "comment": "added, http://help.dottoro.com/lcrthhhv.php",
            "syntax": "always | auto | avoid"
        },
        "-webkit-column-break-before": {
            "comment": "added, http://help.dottoro.com/lcxquvkf.php",
            "syntax": "always | auto | avoid"
        },
        "-webkit-column-break-inside": {
            "comment": "added, http://help.dottoro.com/lclhnthl.php",
            "syntax": "always | auto | avoid"
        },
        "-webkit-font-smoothing": {
            "comment": "https://developer.mozilla.org/en-US/docs/Web/CSS/font-smooth",
            "syntax": "auto | none | antialiased | subpixel-antialiased"
        },
        "-webkit-mask-box-image": {
            "comment": "missed; https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-mask-box-image",
            "syntax": "[ <url> | <gradient> | none ] [ <length-percentage>{4} <-webkit-mask-box-repeat>{2} ]?"
        },
        "-webkit-print-color-adjust": {
            "comment": "missed",
            "references": [
                "https://developer.mozilla.org/en/docs/Web/CSS/-webkit-print-color-adjust"
            ],
            "syntax": "economy | exact"
        },
        "-webkit-text-security": {
            "comment": "missed; http://help.dottoro.com/lcbkewgt.php",
            "syntax": "none | circle | disc | square"
        },
        "-webkit-user-drag": {
            "comment": "missed; http://help.dottoro.com/lcbixvwm.php",
            "syntax": "none | element | auto"
        },
        "-webkit-user-select": {
            "comment": "auto is supported by old webkit, https://developer.mozilla.org/en-US/docs/Web/CSS/user-select",
            "syntax": "auto | none | text | all"
        },
        "alignment-baseline": {
            "comment": "added SVG property",
            "references": [
                "https://www.w3.org/TR/SVG/text.html#AlignmentBaselineProperty"
            ],
            "syntax": "auto | baseline | before-edge | text-before-edge | middle | central | after-edge | text-after-edge | ideographic | alphabetic | hanging | mathematical"
        },
        "baseline-shift": {
            "comment": "added SVG property",
            "references": [
                "https://www.w3.org/TR/SVG/text.html#BaselineShiftProperty"
            ],
            "syntax": "baseline | sub | super | <svg-length>"
        },
        "behavior": {
            "comment": "added old IE property https://msdn.microsoft.com/en-us/library/ms530723(v=vs.85).aspx",
            "syntax": "<url>+"
        },
        "container-type": {
            "comment": "https://www.w3.org/TR/css-contain-3/#propdef-container-type",
            "syntax": "normal || [ size | inline-size ]"
        },
        "cue": {
            "comment": "https://www.w3.org/TR/css3-speech/#property-index",
            "syntax": "<'cue-before'> <'cue-after'>?"
        },
        "cue-after": {
            "comment": "https://www.w3.org/TR/css3-speech/#property-index",
            "syntax": "<url> <decibel>? | none"
        },
        "cue-before": {
            "comment": "https://www.w3.org/TR/css3-speech/#property-index",
            "syntax": "<url> <decibel>? | none"
        },
        "cursor": {
            "comment": "added legacy keywords: hand, -webkit-grab. -webkit-grabbing, -webkit-zoom-in, -webkit-zoom-out, -moz-grab, -moz-grabbing, -moz-zoom-in, -moz-zoom-out",
            "references": [
                "https://www.sitepoint.com/css3-cursor-styles/"
            ],
            "syntax": "[ [ <url> [ <x> <y> ]? , ]* [ auto | default | none | context-menu | help | pointer | progress | wait | cell | crosshair | text | vertical-text | alias | copy | move | no-drop | not-allowed | e-resize | n-resize | ne-resize | nw-resize | s-resize | se-resize | sw-resize | w-resize | ew-resize | ns-resize | nesw-resize | nwse-resize | col-resize | row-resize | all-scroll | zoom-in | zoom-out | grab | grabbing | hand | -webkit-grab | -webkit-grabbing | -webkit-zoom-in | -webkit-zoom-out | -moz-grab | -moz-grabbing | -moz-zoom-in | -moz-zoom-out ] ]"
        },
        "display": {
            "comment": "extended with -ms-flexbox",
            "syntax": "| <-non-standard-display>"
        },
        "position": {
            "comment": "extended with -webkit-sticky",
            "syntax": "| -webkit-sticky"
        },
        "dominant-baseline": {
            "comment": "added SVG property",
            "references": [
                "https://www.w3.org/TR/SVG/text.html#DominantBaselineProperty"
            ],
            "syntax": "auto | use-script | no-change | reset-size | ideographic | alphabetic | hanging | mathematical | central | middle | text-after-edge | text-before-edge"
        },
        "image-rendering": {
            "comment": "extended with <-non-standard-image-rendering>, added SVG keywords optimizeSpeed and optimizeQuality",
            "references": [
                "https://developer.mozilla.org/en/docs/Web/CSS/image-rendering",
                "https://www.w3.org/TR/SVG/painting.html#ImageRenderingProperty"
            ],
            "syntax": "| optimizeSpeed | optimizeQuality | <-non-standard-image-rendering>"
        },
        "fill-opacity": {
            "comment": "added SVG property",
            "references": [
                "https://developer.mozilla.org/en-US/docs/Web/CSS/fill-opacity",
                "https://www.w3.org/TR/SVG/painting.html#FillProperty"
            ],
            "syntax": "<number-zero-one> | <percentage>"
        },
        "filter": {
            "comment": "extend with IE legacy syntaxes",
            "syntax": "| <-ms-filter-function-list>"
        },
        "font": {
            "comment": "align with font-4, fix <'font-family'>#, add non standard fonts",
            "references": [
                "https://drafts.csswg.org/css-fonts-4/#font-prop",
                "https://github.com/w3c/csswg-drafts/pull/10832",
                "https://webkit.org/blog/3709/using-the-system-font-in-web-content/"
            ],
            "syntax": "[ [ <'font-style'> || <font-variant-css2> || <'font-weight'> || <font-width-css3> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'># ] | <system-family-name> | <-non-standard-font>"
        },
        "glyph-orientation-horizontal": {
            "comment": "added SVG property",
            "references": [
                "https://www.w3.org/TR/SVG/text.html#GlyphOrientationHorizontalProperty"
            ],
            "syntax": "<angle>"
        },
        "glyph-orientation-vertical": {
            "comment": "added SVG property",
            "references": [
                "https://www.w3.org/TR/SVG/text.html#GlyphOrientationVerticalProperty"
            ],
            "syntax": "<angle>"
        },
        "kerning": {
            "comment": "added SVG property",
            "references": [
                "https://www.w3.org/TR/SVG/text.html#KerningProperty"
            ],
            "syntax": "auto | <svg-length>"
        },
        "letter-spacing": {
            "comment": "fix syntax <length> -> <length-percentage>",
            "references": [
                "https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/letter-spacing"
            ],
            "syntax": "normal | <length-percentage>"
        },
        "max-width": {
            "comment": "extend by non-standard size keywords https://developer.mozilla.org/en-US/docs/Web/CSS/width",
            "syntax": "| stretch | <-non-standard-size>"
        },
        "max-height": {
            "comment": "extend by non-standard size keywords https://developer.mozilla.org/en-US/docs/Web/CSS/width",
            "syntax": "| stretch | <-non-standard-size>"
        },
        "width": {
            "references": [
                "https://developer.mozilla.org/en-US/docs/Web/CSS/width",
                "https://github.com/csstree/stylelint-validator/issues/29"
            ],
            "syntax": "| stretch | <-non-standard-size>"
        },
        "height": {
            "syntax": "| stretch | <-non-standard-size>"
        },
        "min-width": {
            "comment": "extend by non-standard width keywords https://developer.mozilla.org/en-US/docs/Web/CSS/width",
            "syntax": "| stretch | <-non-standard-size>"
        },
        "min-height": {
            "syntax": "| stretch | <-non-standard-size>"
        },
        "overflow": {
            "comment": "extend by vendor keywords https://developer.mozilla.org/en-US/docs/Web/CSS/overflow",
            "syntax": "| <-non-standard-overflow>"
        },
        "overflow-x": {
            "comment": "extend by vendor keywords https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-x",
            "syntax": "| <-non-standard-overflow>"
        },
        "overflow-y": {
            "comment": "extend by vendor keywords https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-y",
            "syntax": "| <-non-standard-overflow>"
        },
        "overflow-block": {
            "comment": "extend by vendor keywords https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-y",
            "syntax": "| <-non-standard-overflow>"
        },
        "overflow-inline": {
            "comment": "extend by vendor keywords https://developer.mozilla.org/en-US/docs/Web/CSS/overflow-x",
            "syntax": "| <-non-standard-overflow>"
        },
        "pause": {
            "comment": "https://www.w3.org/TR/css3-speech/#property-index",
            "syntax": "<'pause-before'> <'pause-after'>?"
        },
        "pause-after": {
            "comment": "https://www.w3.org/TR/css3-speech/#property-index",
            "syntax": "<time> | none | x-weak | weak | medium | strong | x-strong"
        },
        "pause-before": {
            "comment": "https://www.w3.org/TR/css3-speech/#property-index",
            "syntax": "<time> | none | x-weak | weak | medium | strong | x-strong"
        },
        "position-try-options": {
            "comment": "https://developer.mozilla.org/en-US/docs/Web/CSS/position-try-fallbacks",
            "syntax": "<'position-try-fallbacks'>"
        },
        "rest": {
            "comment": "https://www.w3.org/TR/css3-speech/#property-index",
            "syntax": "<'rest-before'> <'rest-after'>?"
        },
        "rest-after": {
            "comment": "https://www.w3.org/TR/css3-speech/#property-index",
            "syntax": "<time> | none | x-weak | weak | medium | strong | x-strong"
        },
        "rest-before": {
            "comment": "https://www.w3.org/TR/css3-speech/#property-index",
            "syntax": "<time> | none | x-weak | weak | medium | strong | x-strong"
        },
        "speak": {
            "comment": "https://www.w3.org/TR/css3-speech/#property-index",
            "syntax": "auto | never | always"
        },
        "stroke-dasharray": {
            "comment": "added SVG property; a list of comma and/or white space separated <length>s and <percentage>s",
            "references": [
                "https://www.w3.org/TR/SVG/painting.html#StrokeProperties"
            ],
            "syntax": "none | [ <svg-length>+ ]#"
        },
        "stroke-dashoffset": {
            "comment": "added SVG property",
            "references": [
                "https://www.w3.org/TR/SVG/painting.html#StrokeProperties"
            ],
            "syntax": "<svg-length>"
        },
        "stroke-linejoin": {
            "comment": "added SVG property",
            "references": [
                "https://www.w3.org/TR/SVG/painting.html#StrokeProperties"
            ],
            "syntax": "miter | round | bevel"
        },
        "stroke-miterlimit": {
            "comment": "added SVG property (<miterlimit> = <number-one-or-greater>) ",
            "references": [
                "https://www.w3.org/TR/SVG/painting.html#StrokeProperties"
            ],
            "syntax": "<number-one-or-greater>"
        },
        "stroke-width": {
            "comment": "added SVG property",
            "references": [
                "https://www.w3.org/TR/SVG/painting.html#StrokeProperties"
            ],
            "syntax": "<svg-length>"
        },
        "unicode-bidi": {
            "comment": "added prefixed keywords https://developer.mozilla.org/en-US/docs/Web/CSS/unicode-bidi",
            "syntax": "| -moz-isolate | -moz-isolate-override | -moz-plaintext | -webkit-isolate | -webkit-isolate-override | -webkit-plaintext"
        },
        "voice-balance": {
            "comment": "https://www.w3.org/TR/css3-speech/#property-index",
            "syntax": "<number> | left | center | right | leftwards | rightwards"
        },
        "voice-duration": {
            "comment": "https://www.w3.org/TR/css3-speech/#property-index",
            "syntax": "auto | <time>"
        },
        "voice-family": {
            "comment": "<name> -> <family-name>, https://www.w3.org/TR/css3-speech/#property-index",
            "syntax": "[ [ <family-name> | <generic-voice> ] , ]* [ <family-name> | <generic-voice> ] | preserve"
        },
        "voice-pitch": {
            "comment": "https://www.w3.org/TR/css3-speech/#property-index",
            "syntax": "<frequency> && absolute | [ [ x-low | low | medium | high | x-high ] || [ <frequency> | <semitones> | <percentage> ] ]"
        },
        "voice-range": {
            "comment": "https://www.w3.org/TR/css3-speech/#property-index",
            "syntax": "<frequency> && absolute | [ [ x-low | low | medium | high | x-high ] || [ <frequency> | <semitones> | <percentage> ] ]"
        },
        "voice-rate": {
            "comment": "https://www.w3.org/TR/css3-speech/#property-index",
            "syntax": "[ normal | x-slow | slow | medium | fast | x-fast ] || <percentage>"
        },
        "voice-stress": {
            "comment": "https://www.w3.org/TR/css3-speech/#property-index",
            "syntax": "normal | strong | moderate | none | reduced"
        },
        "voice-volume": {
            "comment": "https://www.w3.org/TR/css3-speech/#property-index",
            "syntax": "silent | [ [ x-soft | soft | medium | loud | x-loud ] || <decibel> ]"
        },
        "writing-mode": {
            "comment": "extend with SVG keywords",
            "syntax": "| <svg-writing-mode>"
        },
        "white-space-trim": {
            "syntax": "none | discard-before || discard-after || discard-inner",
            "comment": "missed, https://www.w3.org/TR/css-text-4/#white-space-trim"
        }
    },
    "types": {
        "-legacy-gradient": {
            "comment": "added collection of legacy gradient syntaxes",
            "syntax": "<-webkit-gradient()> | <-legacy-linear-gradient> | <-legacy-repeating-linear-gradient> | <-legacy-radial-gradient> | <-legacy-repeating-radial-gradient>"
        },
        "-legacy-linear-gradient": {
            "comment": "like standard syntax but w/o `to` keyword https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient",
            "syntax": "-moz-linear-gradient( <-legacy-linear-gradient-arguments> ) | -webkit-linear-gradient( <-legacy-linear-gradient-arguments> ) | -o-linear-gradient( <-legacy-linear-gradient-arguments> )"
        },
        "-legacy-repeating-linear-gradient": {
            "comment": "like standard syntax but w/o `to` keyword https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient",
            "syntax": "-moz-repeating-linear-gradient( <-legacy-linear-gradient-arguments> ) | -webkit-repeating-linear-gradient( <-legacy-linear-gradient-arguments> ) | -o-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )"
        },
        "-legacy-linear-gradient-arguments": {
            "comment": "like standard syntax but w/o `to` keyword https://developer.mozilla.org/en-US/docs/Web/CSS/linear-gradient",
            "syntax": "[ <angle> | <side-or-corner> ]? , <color-stop-list>"
        },
        "-legacy-radial-gradient": {
            "comment": "deprecated syntax that implemented by some browsers https://www.w3.org/TR/2011/WD-css3-images-20110908/#radial-gradients",
            "syntax": "-moz-radial-gradient( <-legacy-radial-gradient-arguments> ) | -webkit-radial-gradient( <-legacy-radial-gradient-arguments> ) | -o-radial-gradient( <-legacy-radial-gradient-arguments> )"
        },
        "-legacy-repeating-radial-gradient": {
            "comment": "deprecated syntax that implemented by some browsers https://www.w3.org/TR/2011/WD-css3-images-20110908/#radial-gradients",
            "syntax": "-moz-repeating-radial-gradient( <-legacy-radial-gradient-arguments> ) | -webkit-repeating-radial-gradient( <-legacy-radial-gradient-arguments> ) | -o-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )"
        },
        "-legacy-radial-gradient-arguments": {
            "comment": "deprecated syntax that implemented by some browsers https://www.w3.org/TR/2011/WD-css3-images-20110908/#radial-gradients",
            "syntax": "[ <position> , ]? [ [ [ <-legacy-radial-gradient-shape> || <-legacy-radial-gradient-size> ] | [ <length> | <percentage> ]{2} ] , ]? <color-stop-list>"
        },
        "-legacy-radial-gradient-size": {
            "comment": "before a standard it contains 2 extra keywords (`contain` and `cover`) https://www.w3.org/TR/2011/WD-css3-images-20110908/#ltsize",
            "syntax": "closest-side | closest-corner | farthest-side | farthest-corner | contain | cover"
        },
        "-legacy-radial-gradient-shape": {
            "comment": "define to double sure it doesn't extends in future https://www.w3.org/TR/2011/WD-css3-images-20110908/#ltshape",
            "syntax": "circle | ellipse"
        },
        "-non-standard-font": {
            "comment": "non standard fonts",
            "references": [
                "https://webkit.org/blog/3709/using-the-system-font-in-web-content/"
            ],
            "syntax": "-apple-system-body | -apple-system-headline | -apple-system-subheadline | -apple-system-caption1 | -apple-system-caption2 | -apple-system-footnote | -apple-system-short-body | -apple-system-short-headline | -apple-system-short-subheadline | -apple-system-short-caption1 | -apple-system-short-footnote | -apple-system-tall-body"
        },
        "-non-standard-color": {
            "comment": "non standard colors",
            "references": [
                "http://cssdot.ru/%D0%A1%D0%BF%D1%80%D0%B0%D0%B2%D0%BE%D1%87%D0%BD%D0%B8%D0%BA_CSS/color-i305.html",
                "https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#Mozilla_Color_Preference_Extensions"
            ],
            "syntax": "-moz-ButtonDefault | -moz-ButtonHoverFace | -moz-ButtonHoverText | -moz-CellHighlight | -moz-CellHighlightText | -moz-Combobox | -moz-ComboboxText | -moz-Dialog | -moz-DialogText | -moz-dragtargetzone | -moz-EvenTreeRow | -moz-Field | -moz-FieldText | -moz-html-CellHighlight | -moz-html-CellHighlightText | -moz-mac-accentdarkestshadow | -moz-mac-accentdarkshadow | -moz-mac-accentface | -moz-mac-accentlightesthighlight | -moz-mac-accentlightshadow | -moz-mac-accentregularhighlight | -moz-mac-accentregularshadow | -moz-mac-chrome-active | -moz-mac-chrome-inactive | -moz-mac-focusring | -moz-mac-menuselect | -moz-mac-menushadow | -moz-mac-menutextselect | -moz-MenuHover | -moz-MenuHoverText | -moz-MenuBarText | -moz-MenuBarHoverText | -moz-nativehyperlinktext | -moz-OddTreeRow | -moz-win-communicationstext | -moz-win-mediatext | -moz-activehyperlinktext | -moz-default-background-color | -moz-default-color | -moz-hyperlinktext | -moz-visitedhyperlinktext | -webkit-activelink | -webkit-focus-ring-color | -webkit-link | -webkit-text"
        },
        "-non-standard-image-rendering": {
            "comment": "non-standard keywords http://phrogz.net/tmp/canvas_image_zoom.html",
            "syntax": "optimize-contrast | -moz-crisp-edges | -o-crisp-edges | -webkit-optimize-contrast"
        },
        "-non-standard-overflow": {
            "comment": "non-standard keywords https://developer.mozilla.org/en-US/docs/Web/CSS/overflow",
            "syntax": "overlay | -moz-scrollbars-none | -moz-scrollbars-horizontal | -moz-scrollbars-vertical | -moz-hidden-unscrollable"
        },
        "-non-standard-size": {
            "comment": "non-standard keywords https://developer.mozilla.org/en-US/docs/Web/CSS/width",
            "syntax": "intrinsic | min-intrinsic | -webkit-fill-available | -webkit-fit-content | -webkit-min-content | -webkit-max-content  | -moz-available | -moz-fit-content | -moz-min-content | -moz-max-content"
        },
        "-webkit-gradient()": {
            "comment": "first Apple proposal gradient syntax https://webkit.org/blog/175/introducing-css-gradients/ - TODO: simplify when after match algorithm improvement ( [, point, radius | , point] -> [, radius]? , point )",
            "syntax": "-webkit-gradient( <-webkit-gradient-type>, <-webkit-gradient-point> [, <-webkit-gradient-point> | , <-webkit-gradient-radius>, <-webkit-gradient-point> ] [, <-webkit-gradient-radius>]? [, <-webkit-gradient-color-stop>]* )"
        },
        "-webkit-gradient-color-stop": {
            "comment": "first Apple proposal gradient syntax https://webkit.org/blog/175/introducing-css-gradients/",
            "syntax": "from( <color> ) | color-stop( [ <number-zero-one> | <percentage> ] , <color> ) | to( <color> )"
        },
        "-webkit-gradient-point": {
            "comment": "first Apple proposal gradient syntax https://webkit.org/blog/175/introducing-css-gradients/",
            "syntax": "[ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]"
        },
        "-webkit-gradient-radius": {
            "comment": "first Apple proposal gradient syntax https://webkit.org/blog/175/introducing-css-gradients/",
            "syntax": "<length> | <percentage>"
        },
        "-webkit-gradient-type": {
            "comment": "first Apple proposal gradient syntax https://webkit.org/blog/175/introducing-css-gradients/",
            "syntax": "linear | radial"
        },
        "-webkit-mask-box-repeat": {
            "comment": "missed; https://developer.mozilla.org/en-US/docs/Web/CSS/-webkit-mask-box-image",
            "syntax": "repeat | stretch | round"
        },
        "-ms-filter-function-list": {
            "comment": "https://developer.mozilla.org/en-US/docs/Web/CSS/-ms-filter",
            "syntax": "<-ms-filter-function>+"
        },
        "-ms-filter-function": {
            "comment": "https://developer.mozilla.org/en-US/docs/Web/CSS/-ms-filter",
            "syntax": "<-ms-filter-function-progid> | <-ms-filter-function-legacy>"
        },
        "-ms-filter-function-progid": {
            "comment": "https://developer.mozilla.org/en-US/docs/Web/CSS/-ms-filter",
            "syntax": "'progid:' [ <ident-token> '.' ]* [ <ident-token> | <function-token> <any-value>? ) ]"
        },
        "-ms-filter-function-legacy": {
            "comment": "https://developer.mozilla.org/en-US/docs/Web/CSS/-ms-filter",
            "syntax": "<ident-token> | <function-token> <any-value>? )"
        },
        "age": {
            "comment": "https://www.w3.org/TR/css3-speech/#voice-family",
            "syntax": "child | young | old"
        },
        "attr-name": {
            "syntax": "<wq-name>"
        },
        "attr-fallback": {
            "syntax": "<any-value>"
        },
        "attr-unit": {
            "syntax": "'%' | cm | mm | q | in | pt | pc | px | em | rem | ex | rex | cap | rcap | ch | rch | ic | ric | lh | rlh | vw | svw | lvw | dvw | vh | svh | lvh | dvh | vi | svi | lvi | dvi | vb | svb | lvb | dvb | vmin | svmin | lvmin | dvmin | vmax | svmax | lvmax | dvmax | cqw | cqh | cqi | cqb | cqmin | cqmax | deg | grad | rad | turn | s | ms | hz | khz | dpi | dpcm | dppx | x | fr | db | st"
        },
        "autospace": {
            "syntax": "no-autospace | [ ideograph-alpha || ideograph-numeric || punctuation ] || [ insert | replace ]"
        },
        "bottom": {
            "comment": "missed; not sure we should add it, but no others except `shape` is using it so it's ok for now; https://drafts.fxtf.org/css-masking-1/#funcdef-clip-rect",
            "syntax": "<length> | auto"
        },
        "content-list": {
            "comment": "added attr(), see https://github.com/csstree/csstree/issues/201",
            "syntax": "[ <string> | contents | <image> | <counter> | <quote> | <target> | <leader()> | <attr()> ]+"
        },
        "container-condition": {
            "comment": "missed, https://drafts.csswg.org/css-contain-3/#container-rule",
            "syntax": "not <query-in-parens> | <query-in-parens> [ [ and <query-in-parens> ]* | [ or <query-in-parens> ]* ]"
        },
        "coord-box": {
            "syntax": "content-box | padding-box | border-box | fill-box | stroke-box | view-box"
        },
        "cubic-bezier-easing-function": {
            "comment": "missed, https://drafts.csswg.org/css-easing-1/#cubic-bezier-easing-function",
            "syntax": "ease | ease-in | ease-out | ease-in-out | cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )"
        },
        "element()": {
            "comment": "https://drafts.csswg.org/css-gcpm/#element-syntax & https://drafts.csswg.org/css-images-4/#element-notation",
            "syntax": "element( <custom-ident> , [ first | start | last | first-except ]? ) | element( <id-selector> )"
        },
        "generic-voice": {
            "comment": "https://www.w3.org/TR/css3-speech/#voice-family",
            "syntax": "[ <age>? <gender> <integer>? ]"
        },
        "gender": {
            "comment": "https://www.w3.org/TR/css3-speech/#voice-family",
            "syntax": "male | female | neutral"
        },
        "general-enclosed": {
            "comment": "remove ident-token, optional any-value, brackets (see https://drafts.csswg.org/mediaqueries-5/#typedef-general-enclosed)",
            "syntax": "[ <function-token> <any-value>? ) ] | [ ( <any-value>? ) ]"
        },
        "generic-family": {
            "comment": "new definition on font-4, https://drafts.csswg.org/css-fonts-4/#typedef-generic-family",
            "syntax": "<generic-script-specific>| <generic-complete> | <generic-incomplete> | <-non-standard-generic-family>"
        },
        "generic-script-specific": {
            "syntax": "generic(kai) | generic(fangsong) | generic(nastaliq)"
        },
        "-non-standard-generic-family": {
            "syntax": "-apple-system | BlinkMacSystemFont",
            "references": [
                "https://css-tricks.com/snippets/css/system-font-stack/",
                "https://webkit.org/blog/3709/using-the-system-font-in-web-content/"
            ]
        },
        "gradient": {
            "comment": "added legacy syntaxes support",
            "syntax": "| <-legacy-gradient>"
        },
        "intrinsic-size-keyword": {
            "comment": "Missing from mdn-data. 4.3. Intrinsic Size Keywords https://www.w3.org/TR/css-sizing-4/#intrinsic-size-keywords",
            "syntax": "min-content | max-content | fit-content"
        },
        "left": {
            "comment": "missed; not sure we should add it, but no others except `shape` is using it so it's ok for now; https://drafts.fxtf.org/css-masking-1/#funcdef-clip-rect",
            "syntax": "<length> | auto"
        },
        "color": {
            "comment": "css-color-5, added non standard color names",
            "syntax": "<color-base> | currentColor | <system-color> | <device-cmyk()>  | <light-dark()> | <-non-standard-color>"
        },
        "device-cmyk()": {
            "syntax": "<legacy-device-cmyk-syntax> | <modern-device-cmyk-syntax>"
        },
        "legacy-device-cmyk-syntax": {
            "syntax": "device-cmyk( <number>#{4} )"
        },
        "modern-device-cmyk-syntax": {
            "syntax": "device-cmyk( <cmyk-component>{4} [ / [ <alpha-value> | none ] ]? )"
        },
        "cmyk-component": {
            "syntax": "<number> | <percentage> | none"
        },
        "color-function": {
            "syntax": "<rgb()> | <rgba()> | <hsl()> | <hsla()> | <hwb()> | <lab()> | <lch()> | <oklab()> | <oklch()> | <alpha()> | <color()>"
        },
        "color-mix()": {
            "syntax": "color-mix( <color-interpolation-method> , [ <color> && <percentage [0,100]>? ]#{2} )"
        },
        "color-space": {
            "syntax": "<rectangular-color-space> | <polar-color-space> | <custom-color-space>"
        },
        "paint": {
            "comment": "used by SVG https://www.w3.org/TR/SVG/painting.html#SpecifyingPaint",
            "syntax": "none | <color> | <url> [ none | <color> ]? | context-fill | context-stroke"
        },
        "right": {
            "comment": "missed; not sure we should add it, but no others except `shape` is using it so it's ok for now; https://drafts.fxtf.org/css-masking-1/#funcdef-clip-rect",
            "syntax": "<length> | auto"
        },
        "shape": {
            "comment": "missed spaces in function body and add backwards compatible syntax",
            "syntax": "rect( <top>, <right>, <bottom>, <left> ) | rect( <top> <right> <bottom> <left> )"
        },
        "scope-start": {
            "syntax": "<forgiving-selector-list>"
        },
        "scope-end": {
            "syntax": "<forgiving-selector-list>"
        },
        "forgiving-selector-list": {
            "syntax": "<complex-real-selector-list>"
        },
        "forgiving-relative-selector-list": {
            "syntax": "<relative-real-selector-list>"
        },
        "complex-real-selector-list": {
            "syntax": "<complex-real-selector>#"
        },
        "simple-selector-list": {
            "syntax": "<simple-selector>#"
        },
        "relative-real-selector-list": {
            "syntax": "<relative-real-selector>#"
        },
        "complex-selector": {
            "syntax": "<complex-selector-unit> [ <combinator>? <complex-selector-unit> ]*"
        },
        "complex-selector-unit": {
            "syntax": "[ <compound-selector>? <pseudo-compound-selector>* ]!"
        },
        "complex-real-selector": {
            "syntax": "<compound-selector> [ <combinator>? <compound-selector> ]*"
        },
        "relative-real-selector": {
            "syntax": "<combinator>? <complex-real-selector>"
        },
        "compound-selector": {
            "syntax": "[ <type-selector>? <subclass-selector>* ]!"
        },
        "pseudo-compound-selector": {
            "syntax": " <pseudo-element-selector> <pseudo-class-selector>*"
        },
        "simple-selector": {
            "syntax": "<type-selector> | <subclass-selector>"
        },
        "combinator": {
            "syntax": "'>' | '+' | '~' | [ '|' '|' ]"
        },
        "pseudo-element-selector": {
            "syntax": "':' <pseudo-class-selector> | <legacy-pseudo-element-selector>"
        },
        "legacy-pseudo-element-selector": {
            "syntax": " ':' [before | after | first-line | first-letter]"
        },
        "svg-length": {
            "comment": "All coordinates and lengths in SVG can be specified with or without a unit identifier",
            "references": [
                "https://www.w3.org/TR/SVG11/coords.html#Units"
            ],
            "syntax": "<percentage> | <length> | <number>"
        },
        "svg-writing-mode": {
            "comment": "SVG specific keywords (deprecated for CSS)",
            "references": [
                "https://developer.mozilla.org/en/docs/Web/CSS/writing-mode",
                "https://www.w3.org/TR/SVG/text.html#WritingModeProperty"
            ],
            "syntax": "lr-tb | rl-tb | tb-rl | lr | rl | tb"
        },
        "top": {
            "comment": "missed; not sure we should add it, but no others except `shape` is using it so it's ok for now; https://drafts.fxtf.org/css-masking-1/#funcdef-clip-rect",
            "syntax": "<length> | auto"
        },
        "x": {
            "comment": "missed; not sure we should add it, but no others except `cursor` is using it so it's ok for now; https://drafts.csswg.org/css-ui-3/#cursor",
            "syntax": "<number>"
        },
        "y": {
            "comment": "missed; not sure we should add it, but no others except `cursor` is using so it's ok for now; https://drafts.csswg.org/css-ui-3/#cursor",
            "syntax": "<number>"
        },
        "declaration": {
            "comment": "missed, restored by https://drafts.csswg.org/css-syntax",
            "syntax": "<ident-token> : <declaration-value>? [ '!' important ]?"
        },
        "declaration-list": {
            "comment": "missed, restored by https://drafts.csswg.org/css-syntax",
            "syntax": "[ <declaration>? ';' ]* <declaration>?"
        },
        "url": {
            "comment": "https://drafts.csswg.org/css-values-4/#urls",
            "syntax": "url( <string> <url-modifier>* ) | <url-token>"
        },
        "url-modifier": {
            "comment": "https://drafts.csswg.org/css-values-4/#typedef-url-modifier",
            "syntax": "<ident> | <function-token> <any-value> )"
        },
        "number-zero-one": {
            "syntax": "<number [0,1]>"
        },
        "number-one-or-greater": {
            "syntax": "<number [1,∞]>"
        },
        "color()": {
            "syntax": "color( <colorspace-params> [ / [ <alpha-value> | none ] ]? )"
        },
        "rgb-component": {
            "syntax": "r | g | b | alpha"
        },
        "legacy-rgb-syntax": {
            "syntax": "rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? ) | rgb( [ <number> | <percentage> | none ]{3} [ / [ <alpha-value> | none ] ]? )"
        },
        "modern-rgb-syntax": {
            "syntax": "rgb( from <color> [ <number> | <percentage> | <rgb-component> ]{3} [ / [ <alpha-value> | <rgb-component> ] ]? )"
        },
        "rgb()": {
            "syntax": "<legacy-rgb-syntax> | <modern-rgb-syntax>"
        },
        "legacy-rgba-syntax": {
            "syntax": "rgba( <percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? ) | rgba( [ <number> | <percentage> | none ]{3} [ / [ <alpha-value> | none ] ]? )"
        },
        "modern-rgba-syntax": {
            "syntax": "rgba( from <color> [ <number> | <percentage> | <rgb-component> ]{3} [ / [ <alpha-value> | <rgb-component> ] ]? )"
        },
        "rgba()": {
            "syntax": "<legacy-rgba-syntax> | <modern-rgba-syntax>"
        },
        "hsl-component": {
            "syntax": "h | s | l | alpha"
        },
        "legacy-hsl-syntax": {
            "syntax": "hsl( <hue>, <percentage>, <percentage>, <alpha-value>? ) | hsl( [ <hue> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )"
        },
        "modern-hsl-syntax": {
            "syntax": "hsl( from <color> [ <hue> | <percentage> | <number> | <hsl-component> | none ] [ <percentage> | <number> | <hsl-component> | none ] [ <percentage> | <number> | <hsl-component> | none ] [ / [ <alpha-value> | <hsl-component> | none ] ]? )"
        },
        "hsl()": {
            "syntax": "<legacy-hsl-syntax> | <modern-hsl-syntax>"
        },
        "legacy-hsla-syntax": {
            "syntax": "hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ) | hsla( [ <hue> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )"
        },
        "modern-hsla-syntax": {
            "syntax": "hsla( from <color> [ <hue> | <percentage> | <number> | <hsl-component> | none ] [ <percentage> | <number> | <hsl-component> | none ] [ <percentage> | <number> | <hsl-component> | none ] [ / [ <alpha-value> | <hsl-component> | none ] ]? )"
        },
        "hsla()": {
            "syntax": "<legacy-hsla-syntax> | <modern-hsla-syntax>"
        },
        "hwb-component": {
            "syntax": "h | w | b"
        },
        "legacy-hwb-syntax": {
            "syntax": "hwb( [ <hue> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )"
        },
        "modern-hwb-syntax": {
            "syntax": "hwb( from <color> [ <hue> | <percentage> | <number> | <hwb-component> | none ] [ <percentage> | <number> | <hwb-component> | none ] [ <percentage> | <number> | <hwb-component> | none ] [ / [ <alpha-value> | <hwb-component> | none ] ]? )"
        },
        "hwb()": {
            "syntax": "<legacy-hwb-syntax> | <modern-hwb-syntax>"
        },
        "lab-component": {
            "syntax": "l | a | b | alpha"
        },
        "legacy-lab-syntax": {
            "syntax": "lab( [<percentage> | <number> | none] [ <percentage> | <number> | none] [ <percentage> | <number> | none] [ / [<alpha-value> | none] ]? )"
        },
        "modern-lab-syntax": {
            "syntax": "lab( from <color> [ <number> | <percentage> | <lab-component> ]{3} [ / [ <alpha-value> | <lab-component> ] ]? )"
        },
        "lab()": {
            "syntax": "<legacy-lab-syntax> | <modern-lab-syntax>"
        },
        "legacy-oklab-syntax": {
            "syntax": "oklab( [ <percentage> | <number> | none] [ <percentage> | <number> | none] [ <percentage> | <number> | none] [ / [<alpha-value> | none] ]? )"
        },
        "modern-oklab-syntax": {
            "syntax": "oklab( from <color> [ <number> | <percentage> | <lab-component> ]{3} [ / [ <alpha-value> | <lab-component> ] ]? )"
        },
        "oklab()": {
            "syntax": "<legacy-oklab-syntax> | <modern-oklab-syntax>"
        },
        "lch-component": {
            "syntax": "l | c | h | alpha"
        },
        "legacy-lch-syntax": {
            "syntax": "lch( [<percentage> | <number> | none] [ <percentage> | <number> | none] [ <hue> | none] [ / [<alpha-value> | none] ]? )"
        },
        "modern-lch-syntax": {
            "syntax": "lch( from <color> [ <number> | <percentage> | <lch-component> ]{3} [ / [ <alpha-value> | <lch-component> ] ]? )"
        },
        "lch()": {
            "syntax": "<legacy-lch-syntax> | <modern-lch-syntax>"
        },
        "legacy-oklch-syntax": {
            "syntax": "oklch( [<percentage> | <number> | none] [ <percentage> | <number> | none] [ <hue> | none] [ / [<alpha-value> | none] ]? )"
        },
        "modern-oklch-syntax": {
            "syntax": "oklch( from <color> [ <number> | <percentage> | <lch-component> ]{3} [ / [ <alpha-value> | <lch-component> ] ]? )"
        },
        "oklch()": {
            "syntax": "<legacy-oklch-syntax> | <modern-oklch-syntax>"
        },
        "alpha()": {
            "syntax": "alpha( [ from <color> ] [ / [ <alpha-value> | none ] ]? )"
        },
        "colorspace-params": {
            "syntax": "[ <predefined-rgb-params> | <xyz-params>]"
        },
        "xyz-params": {
            "syntax": "<xyz-space> [ <number> | <percentage> | none ]{3}"
        },
        "xyz-space": {
            "syntax": "xyz | xyz-d50 | xyz-d65"
        },
        "query-in-parens": {
            "comment": "missed, https://drafts.csswg.org/css-contain-3/#container-rule",
            "syntax": "( <container-condition> ) | ( <size-feature> ) | style( <style-query> ) | <general-enclosed>"
        },
        "size-feature": {
            "comment": "missed, https://drafts.csswg.org/css-contain-3/#typedef-size-feature",
            "syntax": "<mf-plain> | <mf-boolean> | <mf-range>"
        },
        "style-query": {
            "comment": "missed, https://drafts.csswg.org/css-contain-3/#container-rule",
            "syntax": "<style-condition> | <style-feature>"
        },
        "style-condition": {
            "comment": "missed, https://drafts.csswg.org/css-contain-3/#container-rule",
            "syntax": "not <style-in-parens> | <style-in-parens> [ [ and <style-in-parens> ]* | [ or <style-in-parens> ]* ]"
        },
        "style-in-parens": {
            "comment": "missed, https://drafts.csswg.org/css-contain-3/#container-rule",
            "syntax": "( <style-condition> ) | ( <style-feature> ) | <general-enclosed>"
        },
        "-non-standard-display": {
            "syntax": "-ms-inline-flexbox | -ms-grid | -ms-inline-grid | -webkit-flex | -webkit-inline-flex | -webkit-box | -webkit-inline-box | -moz-inline-stack | -moz-box | -moz-inline-box"
        },
        "inset-area": {
            "syntax": "[ [ left | center | right | span-left | span-right | x-start | x-end | span-x-start | span-x-end | x-self-start | x-self-end | span-x-self-start | span-x-self-end | span-all ] || [ top | center | bottom | span-top | span-bottom | y-start | y-end | span-y-start | span-y-end | y-self-start | y-self-end | span-y-self-start | span-y-self-end | span-all ] | [ block-start | center | block-end | span-block-start | span-block-end | span-all ] || [ inline-start | center | inline-end | span-inline-start | span-inline-end | span-all ] | [ self-block-start | self-block-end | span-self-block-start | span-self-block-end | span-all ] || [ self-inline-start | self-inline-end | span-self-inline-start | span-self-inline-end | span-all ] | [ start | center | end | span-start | span-end | span-all ]{1,2} | [ self-start | center | self-end | span-self-start | span-self-end | span-all ]{1,2} ]",
            "comment": "initial name for <position-area> before renamed",
            "references": [
                "https://www.w3.org/TR/css-anchor-position-1/#inset-area"
            ]
        },
        "position-area": {
            "syntax": "[ [ left | center | right | span-left | span-right | x-start | x-end | span-x-start | span-x-end | x-self-start | x-self-end | span-x-self-start | span-x-self-end | span-all ] || [ top | center | bottom | span-top | span-bottom | y-start | y-end | span-y-start | span-y-end | y-self-start | y-self-end | span-y-self-start | span-y-self-end | span-all ] | [ block-start | center | block-end | span-block-start | span-block-end | span-all ] || [ inline-start | center | inline-end | span-inline-start | span-inline-end | span-all ] | [ self-block-start | center | self-block-end | span-self-block-start | span-self-block-end | span-all ] || [ self-inline-start | center | self-inline-end | span-self-inline-start | span-self-inline-end | span-all ] | [ start | center | end | span-start | span-end | span-all ]{1,2} | [ self-start | center | self-end | span-self-start | span-self-end | span-all ]{1,2} ]",
            "comment": "replaced <inset-area>",
            "references": [
                "https://drafts.csswg.org/css-anchor-position-1/#typedef-position-area"
            ]
        },
        "syntax": {
            "syntax": "'*' | <syntax-component> [ <syntax-combinator> <syntax-component> ]* | <syntax-string>"
        },
        "syntax-component": {
            "syntax": "<syntax-single-component> <syntax-multiplier>? | '<' transform-list '>'"
        },
        "syntax-single-component": {
            "syntax": "'<' <syntax-type-name> '>' | <ident>"
        },
        "syntax-type-name": {
            "syntax": "angle | color | custom-ident | image | integer | length | length-percentage | number | percentage | resolution | string | time | url | transform-function"
        },
        "syntax-combinator": {
            "syntax": "'|'"
        },
        "syntax-multiplier": {
            "syntax": "'#' | '+'"
        },
        "syntax-string": {
            "syntax": "<string>"
        }
    }
}
'ݠx 100644 csstree.esm.js B0O'F`n%100644 csstree.js j6
*\&~t>XY?100644 data.cjs J,^-rd^uVE100644 data.js Bqp@h2100644 version.cjs t=kWFo100644 version.js q/ZGmAK3kXex   var Vs=Object.create;var ur=Object.defineProperty;var Qs=Object.getOwnPropertyDescriptor;var Xs=Object.getOwnPropertyNames;var $s=Object.getPrototypeOf,Zs=Object.prototype.hasOwnProperty;var Be=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),f=(e,t)=>{for(var r in t)ur(e,r,{get:t[r],enumerable:!0})},Js=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Xs(t))!Zs.call(e,o)&&o!==r&&ur(e,o,{get:()=>t[o],enumerable:!(n=Qs(t,o))||n.enumerable});return e};var el=(e,t,r)=>(r=e!=null?Vs($s(e)):{},Js(t||!e||!e.__esModule?ur(r,"default",{value:e,enumerable:!0}):r,e));var Pi=Be(kr=>{var Ii="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");kr.encode=function(e){if(0<=e&&e<Ii.length)return Ii[e];throw new TypeError("Must be between 0 and 63: "+e)};kr.decode=function(e){var t=65,r=90,n=97,o=122,i=48,a=57,c=43,u=47,s=26,l=52;return t<=e&&e<=r?e-t:n<=e&&e<=o?e-n+s:i<=e&&e<=a?e-i+l:e==c?62:e==u?63:-1}});var Ri=Be(vr=>{var Ni=Pi(),wr=5,Di=1<<wr,Oi=Di-1,Fi=Di;function dl(e){return e<0?(-e<<1)+1:(e<<1)+0}function fl(e){var t=(e&1)===1,r=e>>1;return t?-r:r}vr.encode=function(t){var r="",n,o=dl(t);do n=o&Oi,o>>>=wr,o>0&&(n|=Fi),r+=Ni.encode(n);while(o>0);return r};vr.decode=function(t,r,n){var o=t.length,i=0,a=0,c,u;do{if(r>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(u=Ni.decode(t.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));c=!!(u&Fi),u&=Oi,i=i+(u<<a),a+=wr}while(c);n.value=fl(i),n.rest=r}});var _t=Be(q=>{function gl(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}q.getArg=gl;var Mi=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,bl=/^data:.+\,.+$/;function pt(e){var t=e.match(Mi);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}q.urlParse=pt;function Ke(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}q.urlGenerate=Ke;var yl=32;function xl(e){var t=[];return function(r){for(var n=0;n<t.length;n++)if(t[n].input===r){var o=t[0];return t[0]=t[n],t[n]=o,t[0].result}var i=e(r);return t.unshift({input:r,result:i}),t.length>yl&&t.pop(),i}}var Sr=xl(function(t){var r=t,n=pt(t);if(n){if(!n.path)return t;r=n.path}for(var o=q.isAbsolute(r),i=[],a=0,c=0;;)if(a=c,c=r.indexOf("/",a),c===-1){i.push(r.slice(a));break}else for(i.push(r.slice(a,c));c<r.length&&r[c]==="/";)c++;for(var u,s=0,c=i.length-1;c>=0;c--)u=i[c],u==="."?i.splice(c,1):u===".."?s++:s>0&&(u===""?(i.splice(c+1,s),s=0):(i.splice(c,2),s--));return r=i.join("/"),r===""&&(r=o?"/":"."),n?(n.path=r,Ke(n)):r});q.normalize=Sr;function Bi(e,t){e===""&&(e="."),t===""&&(t=".");var r=pt(t),n=pt(e);if(n&&(e=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),Ke(r);if(r||t.match(bl))return t;if(n&&!n.host&&!n.path)return n.host=t,Ke(n);var o=t.charAt(0)==="/"?t:Sr(e.replace(/\/+$/,"")+"/"+t);return n?(n.path=o,Ke(n)):o}q.join=Bi;q.isAbsolute=function(e){return e.charAt(0)==="/"||Mi.test(e)};function kl(e,t){e===""&&(e="."),e=e.replace(/\/$/,"");for(var r=0;t.indexOf(e+"/")!==0;){var n=e.lastIndexOf("/");if(n<0||(e=e.slice(0,n),e.match(/^([^\/]+:\/)?\/*$/)))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)}q.relative=kl;var _i=(function(){var e=Object.create(null);return!("__proto__"in e)})();function Wi(e){return e}function wl(e){return qi(e)?"$"+e:e}q.toSetString=_i?Wi:wl;function vl(e){return qi(e)?e.slice(1):e}q.fromSetString=_i?Wi:vl;function qi(e){if(!e)return!1;var t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var r=t-10;r>=0;r--)if(e.charCodeAt(r)!==36)return!1;return!0}function Sl(e,t,r){var n=ke(e.source,t.source);return n!==0||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0||r)||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=e.generatedLine-t.generatedLine,n!==0)?n:ke(e.name,t.name)}q.compareByOriginalPositions=Sl;function Cl(e,t,r){var n;return n=e.originalLine-t.originalLine,n!==0||(n=e.originalColumn-t.originalColumn,n!==0||r)||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=e.generatedLine-t.generatedLine,n!==0)?n:ke(e.name,t.name)}q.compareByOriginalPositionsNoSource=Cl;function Tl(e,t,r){var n=e.generatedLine-t.generatedLine;return n!==0||(n=e.generatedColumn-t.generatedColumn,n!==0||r)||(n=ke(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:ke(e.name,t.name)}q.compareByGeneratedPositionsDeflated=Tl;function Ll(e,t,r){var n=e.generatedColumn-t.generatedColumn;return n!==0||r||(n=ke(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:ke(e.name,t.name)}q.compareByGeneratedPositionsDeflatedNoLine=Ll;function ke(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function Al(e,t){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=ke(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:ke(e.name,t.name)}q.compareByGeneratedPositionsInflated=Al;function El(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}q.parseSourceMapInput=El;function zl(e,t,r){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),r){var n=pt(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var o=n.path.lastIndexOf("/");o>=0&&(n.path=n.path.substring(0,o+1))}t=Bi(Ke(n),t)}return Sr(t)}q.computeSourceURL=zl});var Ui=Be(ji=>{var Cr=_t(),Tr=Object.prototype.hasOwnProperty,Oe=typeof Map<"u";function we(){this._array=[],this._set=Oe?new Map:Object.create(null)}we.fromArray=function(t,r){for(var n=new we,o=0,i=t.length;o<i;o++)n.add(t[o],r);return n};we.prototype.size=function(){return Oe?this._set.size:Object.getOwnPropertyNames(this._set).length};we.prototype.add=function(t,r){var n=Oe?t:Cr.toSetString(t),o=Oe?this.has(t):Tr.call(this._set,n),i=this._array.length;(!o||r)&&this._array.push(t),o||(Oe?this._set.set(t,i):this._set[n]=i)};we.prototype.has=function(t){if(Oe)return this._set.has(t);var r=Cr.toSetString(t);return Tr.call(this._set,r)};we.prototype.indexOf=function(t){if(Oe){var r=this._set.get(t);if(r>=0)return r}else{var n=Cr.toSetString(t);if(Tr.call(this._set,n))return this._set[n]}throw new Error('"'+t+'" is not in the set.')};we.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)};we.prototype.toArray=function(){return this._array.slice()};ji.ArraySet=we});var Yi=Be(Gi=>{var Hi=_t();function Il(e,t){var r=e.generatedLine,n=t.generatedLine,o=e.generatedColumn,i=t.generatedColumn;return n>r||n==r&&i>=o||Hi.compareByGeneratedPositionsInflated(e,t)<=0}function Wt(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Wt.prototype.unsortedForEach=function(t,r){this._array.forEach(t,r)};Wt.prototype.add=function(t){Il(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))};Wt.prototype.toArray=function(){return this._sorted||(this._array.sort(Hi.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};Gi.MappingList=Wt});var Vi=Be(Ki=>{var ht=Ri(),B=_t(),qt=Ui().ArraySet,Pl=Yi().MappingList;function ie(e){e||(e={}),this._file=B.getArg(e,"file",null),this._sourceRoot=B.getArg(e,"sourceRoot",null),this._skipValidation=B.getArg(e,"skipValidation",!1),this._ignoreInvalidMapping=B.getArg(e,"ignoreInvalidMapping",!1),this._sources=new qt,this._names=new qt,this._mappings=new Pl,this._sourcesContents=null}ie.prototype._version=3;ie.fromSourceMap=function(t,r){var n=t.sourceRoot,o=new ie(Object.assign(r||{},{file:t.file,sourceRoot:n}));return t.eachMapping(function(i){var a={generated:{line:i.generatedLine,column:i.generatedColumn}};i.source!=null&&(a.source=i.source,n!=null&&(a.source=B.relative(n,a.source)),a.original={line:i.originalLine,column:i.originalColumn},i.name!=null&&(a.name=i.name)),o.addMapping(a)}),t.sources.forEach(function(i){var a=i;n!==null&&(a=B.relative(n,i)),o._sources.has(a)||o._sources.add(a);var c=t.sourceContentFor(i);c!=null&&o.setSourceContent(i,c)}),o};ie.prototype.addMapping=function(t){var r=B.getArg(t,"generated"),n=B.getArg(t,"original",null),o=B.getArg(t,"source",null),i=B.getArg(t,"name",null);!this._skipValidation&&this._validateMapping(r,n,o,i)===!1||(o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:o,name:i}))};ie.prototype.setSourceContent=function(t,r){var n=t;this._sourceRoot!=null&&(n=B.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[B.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[B.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};ie.prototype.applySourceMap=function(t,r,n){var o=r;if(r==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=t.file}var i=this._sourceRoot;i!=null&&(o=B.relative(i,o));var a=new qt,c=new qt;this._mappings.unsortedForEach(function(u){if(u.source===o&&u.originalLine!=null){var s=t.originalPositionFor({line:u.originalLine,column:u.originalColumn});s.source!=null&&(u.source=s.source,n!=null&&(u.source=B.join(n,u.source)),i!=null&&(u.source=B.relative(i,u.source)),u.originalLine=s.line,u.originalColumn=s.column,s.name!=null&&(u.name=s.name))}var l=u.source;l!=null&&!a.has(l)&&a.add(l);var p=u.name;p!=null&&!c.has(p)&&c.add(p)},this),this._sources=a,this._names=c,t.sources.forEach(function(u){var s=t.sourceContentFor(u);s!=null&&(n!=null&&(u=B.join(n,u)),i!=null&&(u=B.relative(i,u)),this.setSourceContent(u,s))},this)};ie.prototype._validateMapping=function(t,r,n,o){if(r&&typeof r.line!="number"&&typeof r.column!="number"){var i="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(i),!1;throw new Error(i)}if(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!r&&!n&&!o)){if(t&&"line"in t&&"column"in t&&r&&"line"in r&&"column"in r&&t.line>0&&t.column>=0&&r.line>0&&r.column>=0&&n)return;var i="Invalid mapping: "+JSON.stringify({generated:t,source:n,original:r,name:o});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(i),!1;throw new Error(i)}};ie.prototype._serializeMappings=function(){for(var t=0,r=1,n=0,o=0,i=0,a=0,c="",u,s,l,p,h=this._mappings.toArray(),d=0,b=h.length;d<b;d++){if(s=h[d],u="",s.generatedLine!==r)for(t=0;s.generatedLine!==r;)u+=";",r++;else if(d>0){if(!B.compareByGeneratedPositionsInflated(s,h[d-1]))continue;u+=","}u+=ht.encode(s.generatedColumn-t),t=s.generatedColumn,s.source!=null&&(p=this._sources.indexOf(s.source),u+=ht.encode(p-a),a=p,u+=ht.encode(s.originalLine-1-o),o=s.originalLine-1,u+=ht.encode(s.originalColumn-n),n=s.originalColumn,s.name!=null&&(l=this._names.indexOf(s.name),u+=ht.encode(l-i),i=l)),c+=u}return c};ie.prototype._generateSourcesContent=function(t,r){return t.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=B.relative(r,n));var o=B.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)};ie.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t};ie.prototype.toString=function(){return JSON.stringify(this.toJSON())};Ki.SourceMapGenerator=ie});var _e=null,V=class e{static createItem(t){return{prev:null,next:null,data:t}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return e.createItem(t)}allocateCursor(t,r){let n;return _e!==null?(n=_e,_e=_e.cursor,n.prev=t,n.next=r,n.cursor=this.cursor):n={prev:t,next:r,cursor:this.cursor},this.cursor=n,n}releaseCursor(){let{cursor:t}=this;this.cursor=t.cursor,t.prev=null,t.next=null,t.cursor=_e,_e=t}updateCursors(t,r,n,o){let{cursor:i}=this;for(;i!==null;)i.prev===t&&(i.prev=r),i.next===n&&(i.next=o),i=i.cursor}*[Symbol.iterator](){for(let t=this.head;t!==null;t=t.next)yield t.data}get size(){let t=0;for(let r=this.head;r!==null;r=r.next)t++;return t}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(t){let r=null;this.head=null;for(let n of t){let o=e.createItem(n);r!==null?r.next=o:this.head=o,o.prev=r,r=o}return this.tail=r,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(t,r=this){let n=this.allocateCursor(null,this.head);for(;n.next!==null;){let o=n.next;n.next=o.next,t.call(r,o.data,o,this)}this.releaseCursor()}forEachRight(t,r=this){let n=this.allocateCursor(this.tail,null);for(;n.prev!==null;){let o=n.prev;n.prev=o.prev,t.call(r,o.data,o,this)}this.releaseCursor()}reduce(t,r,n=this){let o=this.allocateCursor(null,this.head),i=r,a;for(;o.next!==null;)a=o.next,o.next=a.next,i=t.call(n,i,a.data,a,this);return this.releaseCursor(),i}reduceRight(t,r,n=this){let o=this.allocateCursor(this.tail,null),i=r,a;for(;o.prev!==null;)a=o.prev,o.prev=a.prev,i=t.call(n,i,a.data,a,this);return this.releaseCursor(),i}some(t,r=this){for(let n=this.head;n!==null;n=n.next)if(t.call(r,n.data,n,this))return!0;return!1}map(t,r=this){let n=new e;for(let o=this.head;o!==null;o=o.next)n.appendData(t.call(r,o.data,o,this));return n}filter(t,r=this){let n=new e;for(let o=this.head;o!==null;o=o.next)t.call(r,o.data,o,this)&&n.appendData(o.data);return n}nextUntil(t,r,n=this){if(t===null)return;let o=this.allocateCursor(null,t);for(;o.next!==null;){let i=o.next;if(o.next=i.next,r.call(n,i.data,i,this))break}this.releaseCursor()}prevUntil(t,r,n=this){if(t===null)return;let o=this.allocateCursor(t,null);for(;o.prev!==null;){let i=o.prev;if(o.prev=i.prev,r.call(n,i.data,i,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){let t=new e;for(let r of this)t.appendData(r);return t}prepend(t){return this.updateCursors(null,t,this.head,t),this.head!==null?(this.head.prev=t,t.next=this.head):this.tail=t,this.head=t,this}prependData(t){return this.prepend(e.createItem(t))}append(t){return this.insert(t)}appendData(t){return this.insert(e.createItem(t))}insert(t,r=null){if(r!==null)if(this.updateCursors(r.prev,t,r,t),r.prev===null){if(this.head!==r)throw new Error("before doesn't belong to list");this.head=t,r.prev=t,t.next=r,this.updateCursors(null,t)}else r.prev.next=t,t.prev=r.prev,r.prev=t,t.next=r;else this.updateCursors(this.tail,t,null,t),this.tail!==null?(this.tail.next=t,t.prev=this.tail):this.head=t,this.tail=t;return this}insertData(t,r){return this.insert(e.createItem(t),r)}remove(t){if(this.updateCursors(t,t.prev,t,t.next),t.prev!==null)t.prev.next=t.next;else{if(this.head!==t)throw new Error("item doesn't belong to list");this.head=t.next}if(t.next!==null)t.next.prev=t.prev;else{if(this.tail!==t)throw new Error("item doesn't belong to list");this.tail=t.prev}return t.prev=null,t.next=null,t}push(t){this.insert(e.createItem(t))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(t){this.prepend(e.createItem(t))}shift(){return this.head!==null?this.remove(this.head):null}prependList(t){return this.insertList(t,this.head)}appendList(t){return this.insertList(t)}insertList(t,r){return t.head===null?this:(r!=null?(this.updateCursors(r.prev,t.tail,r,t.head),r.prev!==null?(r.prev.next=t.head,t.head.prev=r.prev):this.head=t.head,r.prev=t.tail,t.tail.next=r):(this.updateCursors(this.tail,t.tail,null,t.head),this.tail!==null?(this.tail.next=t.head,t.head.prev=this.tail):this.head=t.head,this.tail=t.tail),t.head=null,t.tail=null,this)}replace(t,r){"head"in r?this.insertList(r,t):this.insert(r,t),this.remove(t)}};function Ie(e,t){let r=Object.create(SyntaxError.prototype),n=new Error;return Object.assign(r,{name:e,message:t,get stack(){return(n.stack||"").replace(/^(.+\n){1,3}/,`${e}: ${t}
`)}})}var pr=100,yi=60,xi="    ";function ki({source:e,line:t,column:r,baseLine:n,baseColumn:o},i){function a(b,G){return s.slice(b,G).map((J,v)=>String(b+v+1).padStart(h)+" |"+J).join(`
`)}let c=`
`.repeat(Math.max(n-1,0)),u=" ".repeat(Math.max(o-1,0)),s=(c+u+e).split(/\r\n?|\n|\f/),l=Math.max(1,t-i)-1,p=Math.min(t+i,s.length+1),h=Math.max(4,String(p).length)+1,d=0;r+=(xi.length-1)*(s[t-1].substr(0,r-1).match(/\t/g)||[]).length,r>pr&&(d=r-yi+3,r=yi-2);for(let b=l;b<=p;b++)b>=0&&b<s.length&&(s[b]=s[b].replace(/\t/g,xi),s[b]=(d>0&&s[b].length>d?"\u2026":"")+s[b].substr(d,pr-2)+(s[b].length>d+pr-1?"\u2026":""));return[a(l,t),new Array(r+h+2).join("-")+"^",a(t,p)].filter(Boolean).join(`
`).replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function hr(e,t,r,n,o,i=1,a=1){return Object.assign(Ie("SyntaxError",e),{source:t,offset:r,line:n,column:o,sourceFragment(u){return ki({source:t,line:n,column:o,baseLine:i,baseColumn:a},isNaN(u)?0:u)},get formattedMessage(){return`Parse error: ${e}
`+ki({source:t,line:n,column:o,baseLine:i,baseColumn:a},2)}})}var mr={};f(mr,{AtKeyword:()=>O,BadString:()=>We,BadUrl:()=>Q,CDC:()=>X,CDO:()=>Pe,Colon:()=>N,Comma:()=>U,Comment:()=>F,Delim:()=>k,Dimension:()=>w,EOF:()=>be,Function:()=>x,Hash:()=>T,Ident:()=>m,LeftCurlyBracket:()=>D,LeftParenthesis:()=>S,LeftSquareBracket:()=>H,Number:()=>g,Percentage:()=>I,RightCurlyBracket:()=>W,RightParenthesis:()=>y,RightSquareBracket:()=>ee,Semicolon:()=>R,String:()=>ne,Url:()=>_,WhiteSpace:()=>L});var be=0,m=1,x=2,O=3,T=4,ne=5,We=6,_=7,Q=8,k=9,g=10,I=11,w=12,L=13,Pe=14,X=15,N=16,R=17,U=18,H=19,ee=20,S=21,y=22,D=23,W=24,F=25;function M(e){return e>=48&&e<=57}function te(e){return M(e)||e>=65&&e<=70||e>=97&&e<=102}function It(e){return e>=65&&e<=90}function tl(e){return e>=97&&e<=122}function rl(e){return It(e)||tl(e)}function nl(e){return e>=128}function zt(e){return rl(e)||nl(e)||e===95}function qe(e){return zt(e)||M(e)||e===45}function ol(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function ot(e){return e===10||e===13||e===12}function me(e){return ot(e)||e===32||e===9}function $(e,t){return!(e!==92||ot(t)||t===0)}function je(e,t,r){return e===45?zt(t)||t===45||$(t,r):zt(e)?!0:e===92?$(e,t):!1}function Pt(e,t,r){return e===43||e===45?M(t)?2:t===46&&M(r)?3:0:e===46?M(t)?2:0:M(e)?1:0}function Nt(e){return e===65279||e===65534?1:0}var dr=new Array(128),il=128,it=130,fr=131,Dt=132,gr=133;for(let e=0;e<dr.length;e++)dr[e]=me(e)&&it||M(e)&&fr||zt(e)&&Dt||ol(e)&&gr||e||il;function Ot(e){return e<128?dr[e]:Dt}function Ue(e,t){return t<e.length?e.charCodeAt(t):0}function Ft(e,t,r){return r===13&&Ue(e,t+1)===10?2:1}function ye(e,t,r){let n=e.charCodeAt(t);return It(n)&&(n=n|32),n===r}function xe(e,t,r,n){if(r-t!==n.length||t<0||r>e.length)return!1;for(let o=t;o<r;o++){let i=n.charCodeAt(o-t),a=e.charCodeAt(o);if(It(a)&&(a=a|32),a!==i)return!1}return!0}function wi(e,t){for(;t>=0&&me(e.charCodeAt(t));t--);return t+1}function at(e,t){for(;t<e.length&&me(e.charCodeAt(t));t++);return t}function br(e,t){for(;t<e.length&&M(e.charCodeAt(t));t++);return t}function le(e,t){if(t+=2,te(Ue(e,t-1))){for(let n=Math.min(e.length,t+5);t<n&&te(Ue(e,t));t++);let r=Ue(e,t);me(r)&&(t+=Ft(e,t,r))}return t}function st(e,t){for(;t<e.length;t++){let r=e.charCodeAt(t);if(!qe(r)){if($(r,Ue(e,t+1))){t=le(e,t)-1;continue}break}}return t}function Ne(e,t){let r=e.charCodeAt(t);if((r===43||r===45)&&(r=e.charCodeAt(t+=1)),M(r)&&(t=br(e,t+1),r=e.charCodeAt(t)),r===46&&M(e.charCodeAt(t+1))&&(t+=2,t=br(e,t)),ye(e,t,101)){let n=0;r=e.charCodeAt(t+1),(r===45||r===43)&&(n=1,r=e.charCodeAt(t+2)),M(r)&&(t=br(e,t+1+n+1))}return t}function Rt(e,t){for(;t<e.length;t++){let r=e.charCodeAt(t);if(r===41){t++;break}$(r,Ue(e,t+1))&&(t=le(e,t))}return t}function He(e){if(e.length===1&&!te(e.charCodeAt(0)))return e[0];let t=parseInt(e,16);return(t===0||t>=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}var De=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token","comment-token"];function Ge(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,16384)):e}var vi=10,al=12,Si=13;function Ci(e){let t=e.source,r=t.length,n=t.length>0?Nt(t.charCodeAt(0)):0,o=Ge(e.lines,r),i=Ge(e.columns,r),a=e.startLine,c=e.startColumn;for(let u=n;u<r;u++){let s=t.charCodeAt(u);o[u]=a,i[u]=c++,(s===vi||s===Si||s===al)&&(s===Si&&u+1<r&&t.charCodeAt(u+1)===vi&&(u++,o[u]=a,i[u]=c),a++,c=1)}o[r]=a,i[r]=c,e.lines=o,e.columns=i,e.computed=!0}var lt=class{constructor(t,r,n,o){this.setSource(t,r,n,o),this.lines=null,this.columns=null}setSource(t="",r=0,n=1,o=1){this.source=t,this.startOffset=r,this.startLine=n,this.startColumn=o,this.computed=!1}getLocation(t,r){return this.computed||Ci(this),{source:r,offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}getLocationRange(t,r,n){return this.computed||Ci(this),{source:n,start:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]},end:{offset:this.startOffset+r,line:this.lines[r],column:this.columns[r]}}}};var ce=16777215,ue=24,ut=1,Mt=2,Te=new Uint8Array(32);Te[2]=22;Te[21]=22;Te[19]=20;Te[23]=24;var pe=new Uint8Array(32);pe[2]=ut;pe[21]=ut;pe[19]=ut;pe[23]=ut;pe[22]=Mt;pe[20]=Mt;pe[24]=Mt;function Ti(e,t,r){return e<t?t:e>r?r:e}var ct=class{constructor(t,r){this.setSource(t,r)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(t="",r=()=>{}){t=String(t||"");let n=t.length,o=Ge(this.offsetAndType,t.length+1),i=Ge(this.balance,t.length+1),a=0,c=-1,u=0,s=t.length;this.offsetAndType=null,this.balance=null,i.fill(0),r(t,(l,p,h)=>{let d=a++;if(o[d]=l<<ue|h,c===-1&&(c=p),i[d]=s,l===u){let b=i[s];i[s]=d,s=b,u=Te[o[b]>>ue]}else this.isBlockOpenerTokenType(l)&&(s=d,u=Te[l])}),o[a]=0<<ue|n,i[a]=a;for(let l=0;l<a;l++){let p=i[l];if(p<=l){let h=i[p];h!==l&&(i[l]=h)}else p>a&&(i[l]=a)}this.source=t,this.firstCharOffset=c===-1?0:c,this.tokenCount=a,this.offsetAndType=o,this.balance=i,this.reset(),this.next()}lookupType(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t]>>ue:0}lookupTypeNonSC(t){for(let r=this.tokenIndex;r<this.tokenCount;r++){let n=this.offsetAndType[r]>>ue;if(n!==13&&n!==25&&t--===0)return n}return 0}lookupOffset(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t-1]&ce:this.source.length}lookupOffsetNonSC(t){for(let r=this.tokenIndex;r<this.tokenCount;r++){let n=this.offsetAndType[r]>>ue;if(n!==13&&n!==25&&t--===0)return r-this.tokenIndex}return 0}lookupValue(t,r){return t+=this.tokenIndex,t<this.tokenCount?xe(this.source,this.offsetAndType[t-1]&ce,this.offsetAndType[t]&ce,r):!1}getTokenStart(t){return t===this.tokenIndex?this.tokenStart:t>0?t<this.tokenCount?this.offsetAndType[t-1]&ce:this.offsetAndType[this.tokenCount]&ce:this.firstCharOffset}getTokenEnd(t){return t===this.tokenIndex?this.tokenEnd:this.offsetAndType[Ti(t,0,this.tokenCount)]&ce}getTokenType(t){return t===this.tokenIndex?this.tokenType:this.offsetAndType[Ti(t,0,this.tokenCount)]>>ue}substrToCursor(t){return this.source.substring(t,this.tokenStart)}isBlockOpenerTokenType(t){return pe[t]===ut}isBlockCloserTokenType(t){return pe[t]===Mt}getBlockTokenPairIndex(t){let r=this.getTokenType(t);if(pe[r]===1){let n=this.balance[t],o=this.getTokenType(n);return Te[r]===o?n:-1}else if(pe[r]===2){let n=this.balance[t],o=this.getTokenType(n);return Te[o]===r?n:-1}return-1}isBalanceEdge(t){return this.balance[this.tokenIndex]<t}isDelim(t,r){return r?this.lookupType(r)===9&&this.source.charCodeAt(this.lookupOffset(r))===t:this.tokenType===9&&this.source.charCodeAt(this.tokenStart)===t}skip(t){let r=this.tokenIndex+t;r<this.tokenCount?(this.tokenIndex=r,this.tokenStart=this.offsetAndType[r-1]&ce,r=this.offsetAndType[r],this.tokenType=r>>ue,this.tokenEnd=r&ce):(this.tokenIndex=this.tokenCount,this.next())}next(){let t=this.tokenIndex+1;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.tokenEnd,t=this.offsetAndType[t],this.tokenType=t>>ue,this.tokenEnd=t&ce):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=0,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===13||this.tokenType===25;)this.next()}skipUntilBalanced(t,r){let n=t,o=0,i=0;e:for(;n<this.tokenCount;n++){if(o=this.balance[n],o<t)break e;switch(i=n>0?this.offsetAndType[n-1]&ce:this.firstCharOffset,r(this.source.charCodeAt(i))){case 1:break e;case 2:n++;break e;default:this.isBlockOpenerTokenType(this.offsetAndType[n]>>ue)&&(n=o)}}this.skip(n-this.tokenIndex)}forEachToken(t){for(let r=0,n=this.firstCharOffset;r<this.tokenCount;r++){let o=n,i=this.offsetAndType[r],a=i&ce,c=i>>ue;n=a,t(c,o,a,r)}}dump(){let t=new Array(this.tokenCount);return this.forEachToken((r,n,o,i)=>{t[i]={idx:i,type:De[r],chunk:this.source.substring(n,o),balance:this.balance[i]}}),t}};function Bt(e,t){function r(p){return p<c?e.charCodeAt(p):0}function n(){if(s=Ne(e,s),je(r(s),r(s+1),r(s+2))){l=12,s=st(e,s);return}if(r(s)===37){l=11,s++;return}l=10}function o(){let p=s;if(s=st(e,s),xe(e,p,s,"url")&&r(s)===40){if(s=at(e,s+1),r(s)===34||r(s)===39){l=2,s=p+4;return}a();return}if(r(s)===40){l=2,s++;return}l=1}function i(p){for(p||(p=r(s++)),l=5;s<e.length;s++){let h=e.charCodeAt(s);switch(Ot(h)){case p:s++;return;case it:if(ot(h)){s+=Ft(e,s,h),l=6;return}break;case 92:if(s===e.length-1)break;let d=r(s+1);ot(d)?s+=Ft(e,s+1,d):$(h,d)&&(s=le(e,s)-1);break}}}function a(){for(l=7,s=at(e,s);s<e.length;s++){let p=e.charCodeAt(s);switch(Ot(p)){case 41:s++;return;case it:if(s=at(e,s),r(s)===41||s>=e.length){s<e.length&&s++;return}s=Rt(e,s),l=8;return;case 34:case 39:case 40:case gr:s=Rt(e,s),l=8;return;case 92:if($(p,r(s+1))){s=le(e,s)-1;break}s=Rt(e,s),l=8;return}}}e=String(e||"");let c=e.length,u=Nt(r(0)),s=u,l;for(;s<c;){let p=e.charCodeAt(s);switch(Ot(p)){case it:l=13,s=at(e,s+1);break;case 34:i();break;case 35:qe(r(s+1))||$(r(s+1),r(s+2))?(l=4,s=st(e,s+1)):(l=9,s++);break;case 39:i();break;case 40:l=21,s++;break;case 41:l=22,s++;break;case 43:Pt(p,r(s+1),r(s+2))?n():(l=9,s++);break;case 44:l=18,s++;break;case 45:Pt(p,r(s+1),r(s+2))?n():r(s+1)===45&&r(s+2)===62?(l=15,s=s+3):je(p,r(s+1),r(s+2))?o():(l=9,s++);break;case 46:Pt(p,r(s+1),r(s+2))?n():(l=9,s++);break;case 47:r(s+1)===42?(l=25,s=e.indexOf("*/",s+2),s=s===-1?e.length:s+2):(l=9,s++);break;case 58:l=16,s++;break;case 59:l=17,s++;break;case 60:r(s+1)===33&&r(s+2)===45&&r(s+3)===45?(l=14,s=s+4):(l=9,s++);break;case 64:je(r(s+1),r(s+2),r(s+3))?(l=3,s=st(e,s+1)):(l=9,s++);break;case 91:l=19,s++;break;case 92:$(p,r(s+1))?o():(l=9,s++);break;case 93:l=20,s++;break;case 123:l=23,s++;break;case 125:l=24,s++;break;case fr:n();break;case Dt:o();break;default:l=9,s++}t(l,u,u=s)}}function Li(e){let t=this.createList(),r=!1,n={recognizer:e};for(;!this.eof;){switch(this.tokenType){case 25:this.next();continue;case 13:r=!0,this.next();continue}let o=e.getNode.call(this,n);if(o===void 0)break;r&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,o,t,n),r=!1),t.push(o)}return r&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,t,n),t}var sl="function";function Le(e){return e&&typeof e.tokenize===sl?e.tokenize:Bt}var Ye=()=>{},ll=33,cl=35,yr=59,Ai=123,Ei=0,ul={createList(){return[]},createSingleNodeList(e){return[e]},getFirstListNode(e){return e&&e[0]||null},getLastListNode(e){return e&&e.length>0?e[e.length-1]:null}},pl={createList(){return new V},createSingleNodeList(e){return new V().appendData(e)},getFirstListNode(e){return e&&e.first},getLastListNode(e){return e&&e.last}};function hl(e){return function(){return this[e]()}}function xr(e){let t=Object.create(null);for(let r of Object.keys(e)){let n=e[r],o=n.parse||n;o&&(t[r]=o)}return t}function ml(e){let t={context:Object.create(null),features:Object.assign(Object.create(null),e.features),scope:Object.assign(Object.create(null),e.scope),atrule:xr(e.atrule),pseudo:xr(e.pseudo),node:xr(e.node),tokenize:Le(e)};for(let[r,n]of Object.entries(e.parseContext))switch(typeof n){case"function":t.context[r]=n;break;case"string":t.context[r]=hl(n);break}return{config:t,...t,...t.node}}function zi(e){let t="",r="<unknown>",n=!1,o=Ye,i=!1,a=new lt,c=Object.assign(new ct,ml(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:Li,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(l){return l===Ai?1:0},consumeUntilLeftCurlyBracketOrSemicolon(l){return l===Ai||l===yr?1:0},consumeUntilExclamationMarkOrSemicolon(l){return l===ll||l===yr?1:0},consumeUntilSemicolonIncluded(l){return l===yr?2:0},createList:Ye,createSingleNodeList:Ye,getFirstListNode:Ye,getLastListNode:Ye,parseWithFallback(l,p){let h=this.tokenIndex;try{return l.call(this)}catch(d){if(i)throw d;this.skip(h-this.tokenIndex);let b=p.call(this);return i=!0,o(d,b),i=!1,b}},lookupNonWSType(l){let p;do if(p=this.lookupType(l++),p!==13&&p!==25)return p;while(p!==Ei);return Ei},charCodeAt(l){return l>=0&&l<t.length?t.charCodeAt(l):0},substring(l,p){return t.substring(l,p)},substrToCursor(l){return this.source.substring(l,this.tokenStart)},cmpChar(l,p){return ye(t,l,p)},cmpStr(l,p,h){return xe(t,l,p,h)},consume(l){let p=this.tokenStart;return this.eat(l),this.substrToCursor(p)},consumeFunctionName(){let l=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(2),l},consumeNumber(l){let p=t.substring(this.tokenStart,Ne(t,this.tokenStart));return this.eat(l),p},eat(l){if(this.tokenType!==l){let p=De[l].slice(0,-6).replace(/-/g," ").replace(/^./,b=>b.toUpperCase()),h=`${/[[\](){}]/.test(p)?`"${p}"`:p} is expected`,d=this.tokenStart;switch(l){case 1:this.tokenType===2||this.tokenType===7?(d=this.tokenEnd-1,h="Identifier is expected but function found"):h="Identifier is expected";break;case 4:this.isDelim(cl)&&(this.next(),d++,h="Name is expected");break;case 11:this.tokenType===10&&(d=this.tokenEnd,h="Percent sign is expected");break}this.error(h,d)}this.next()},eatIdent(l){(this.tokenType!==1||this.lookupValue(0,l)===!1)&&this.error(`Identifier "${l}" is expected`),this.next()},eatDelim(l){this.isDelim(l)||this.error(`Delim "${String.fromCharCode(l)}" is expected`),this.next()},getLocation(l,p){return n?a.getLocationRange(l,p,r):null},getLocationFromList(l){if(n){let p=this.getFirstListNode(l),h=this.getLastListNode(l);return a.getLocationRange(p!==null?p.loc.start.offset-a.startOffset:this.tokenStart,h!==null?h.loc.end.offset-a.startOffset:this.tokenStart,r)}return null},error(l,p){let h=typeof p<"u"&&p<t.length?a.getLocation(p):this.eof?a.getLocation(wi(t,t.length-1)):a.getLocation(this.tokenStart);throw new hr(l||"Unexpected input",t,h.offset,h.line,h.column,a.startLine,a.startColumn)}}),u=()=>({filename:r,source:t,tokenCount:c.tokenCount,getTokenType:l=>c.getTokenType(l),getTokenTypeName:l=>De[c.getTokenType(l)],getTokenStart:l=>c.getTokenStart(l),getTokenEnd:l=>c.getTokenEnd(l),getTokenValue:l=>c.source.substring(c.getTokenStart(l),c.getTokenEnd(l)),substring:(l,p)=>c.source.substring(l,p),balance:c.balance.subarray(0,c.tokenCount+1),isBlockOpenerTokenType:c.isBlockOpenerTokenType,isBlockCloserTokenType:c.isBlockCloserTokenType,getBlockTokenPairIndex:l=>c.getBlockTokenPairIndex(l),getLocation:l=>a.getLocation(l,r),getRangeLocation:(l,p)=>a.getLocationRange(l,p,r)});return Object.assign(function(l,p){t=l,p=p||{},c.setSource(t,c.tokenize),a.setSource(t,p.offset,p.line,p.column),r=p.filename||"<unknown>",n=!!p.positions,o=typeof p.onParseError=="function"?p.onParseError:Ye,i=!1,c.parseAtrulePrelude="parseAtrulePrelude"in p?!!p.parseAtrulePrelude:!0,c.parseRulePrelude="parseRulePrelude"in p?!!p.parseRulePrelude:!0,c.parseValue="parseValue"in p?!!p.parseValue:!0,c.parseCustomProperty="parseCustomProperty"in p?!!p.parseCustomProperty:!1;let{context:h="default",list:d=!0,onComment:b,onToken:G}=p;if(!(h in c.context))throw new Error("Unknown context `"+h+"`");Object.assign(c,d?pl:ul),Array.isArray(G)?c.forEachToken((v,E,Y)=>{G.push({type:v,start:E,end:Y})}):typeof G=="function"&&c.forEachToken(G.bind(u())),typeof b=="function"&&c.forEachToken((v,E,Y)=>{if(v===25){let z=c.getLocation(E,Y),re=xe(t,Y-2,Y,"*/")?t.slice(E+2,Y-2):t.slice(E+2,Y);b(re,z)}});let J=c.context[h].call(c,p);return c.eof||c.error(),J},{SyntaxError:hr,config:c.config})}var Xi=el(Vi(),1),Qi=new Set(["Atrule","Selector","Declaration"]);function $i(e){let t=new Xi.SourceMapGenerator,r={line:1,column:0},n={line:0,column:0},o={line:1,column:0},i={generated:o},a=1,c=0,u=!1,s=e.node;e.node=function(h){if(h.loc&&h.loc.start&&Qi.has(h.type)){let d=h.loc.start.line,b=h.loc.start.column-1;(n.line!==d||n.column!==b)&&(n.line=d,n.column=b,r.line=a,r.column=c,u&&(u=!1,(r.line!==o.line||r.column!==o.column)&&t.addMapping(i)),u=!0,t.addMapping({source:h.loc.source,original:n,generated:r}))}s.call(this,h),u&&Qi.has(h.type)&&(o.line=a,o.column=c)};let l=e.emit;e.emit=function(h,d,b){for(let G=0;G<h.length;G++)h.charCodeAt(G)===10?(a++,c=0):c++;l(h,d,b)};let p=e.result;return e.result=function(){return u&&t.addMapping(i),{css:p(),map:t}},e}var jt={};f(jt,{safe:()=>Ar,spec:()=>Fl});var Nl=43,Dl=45,Lr=(e,t)=>(e===9&&(e=t),typeof e=="string"&&(e=Math.min(e.charCodeAt(0),128)<<6),e<<1),Zi=[[1,1],[1,2],[1,7],[1,8],[1,"-"],[1,10],[1,11],[1,12],[1,15],[1,21],[3,1],[3,2],[3,7],[3,8],[3,"-"],[3,10],[3,11],[3,12],[3,15],[4,1],[4,2],[4,7],[4,8],[4,"-"],[4,10],[4,11],[4,12],[4,15],[12,1],[12,2],[12,7],[12,8],[12,"-"],[12,10],[12,11],[12,12],[12,15],["#",1],["#",2],["#",7],["#",8],["#","-"],["#",10],["#",11],["#",12],["#",15],["-",1],["-",2],["-",7],["-",8],["-","-"],["-",10],["-",11],["-",12],["-",15],[10,1],[10,2],[10,7],[10,8],[10,10],[10,11],[10,12],[10,"%"],[10,15],["@",1],["@",2],["@",7],["@",8],["@","-"],["@",15],[".",10],[".",11],[".",12],["+",10],["+",11],["+",12],["/","*"]],Ol=Zi.concat([[1,4],[12,4],[4,4],[3,21],[3,5],[3,16],[11,11],[11,12],[11,2],[11,"-"],[22,1],[22,2],[22,11],[22,12],[22,4],[22,"-"]]);function Ji(e){let t=new Set(e.map(([r,n])=>Lr(r)<<16|Lr(n)));return function(r,n,o){let i=Lr(n,o),a=o.charCodeAt(0),c=a===Dl&&n!==1&&n!==2&&n!==15||a===Nl?t.has((r&65534)<<16|a<<7):t.has((r&65534)<<16|i);return i|c}}var Fl=Ji(Zi),Ar=Ji(Ol);var Rl=92;function Ml(e,t){if(typeof t=="function"){let r=null;e.children.forEach(n=>{r!==null&&t.call(this,r),this.node(n),r=n});return}e.children.forEach(this.node,this)}function ea(e){let t=new Map;for(let[r,n]of Object.entries(e.node))typeof(n.generate||n)=="function"&&t.set(r,n.generate||n);return function(r,n){let o="",i=0,a={node(u){if(t.has(u.type))t.get(u.type).call(c,u);else throw new Error("Unknown node type: "+u.type)},tokenBefore:Ar,token(u,s,l){i=this.tokenBefore(i,u,s),!l&&i&1&&this.emit(" ",13,!0),this.emit(s,u,!1),u===9&&s.charCodeAt(0)===Rl&&this.emit(`
`,13,!0)},emit(u){o+=u},result(){return o}};n&&(typeof n.decorator=="function"&&(a=n.decorator(a)),n.sourceMap&&(a=$i(a)),n.mode in jt&&(a.tokenBefore=jt[n.mode]));let c={node:u=>a.node(u),children:Ml,token:(u,s)=>a.token(u,s),tokenize:function(u){return Le(e)(u,(l,p,h)=>{a.token(l,u.slice(p,h),p!==0)})}};return a.node(r),a.result()}}function ta(e){return{fromPlainObject(t){return e(t,{enter(r){r.children&&!(r.children instanceof V)&&(r.children=new V().fromArray(r.children))}}),t},toPlainObject(t){return e(t,{leave(r){r.children&&r.children instanceof V&&(r.children=r.children.toArray())}}),t}}}var{hasOwnProperty:Er}=Object.prototype,mt=function(){};function ra(e){return typeof e=="function"?e:mt}function na(e,t){return function(r,n,o){r.type===t&&e.call(this,r,n,o)}}function Bl(e,t){let r=t.structure,n=[];for(let o in r){if(Er.call(r,o)===!1)continue;let i=r[o],a={name:o,type:!1,nullable:!1};Array.isArray(i)||(i=[i]);for(let c of i)c===null?a.nullable=!0:typeof c=="string"?a.type="node":Array.isArray(c)&&(a.type="list");a.type&&n.push(a)}return n.length?{context:t.walkContext,fields:n}:null}function _l(e){let t={};for(let r in e.node)if(Er.call(e.node,r)){let n=e.node[r];if(!n.structure)throw new Error("Missed `structure` field in `"+r+"` node type definition");t[r]=Bl(r,n)}return t}function oa(e,t){let r=e.fields.slice(),n=e.context,o=typeof n=="string";return t&&r.reverse(),function(i,a,c,u){let s;o&&(s=a[n],a[n]=i);for(let l of r){let p=i[l.name];if(!l.nullable||p){if(l.type==="list"){if(t?p.reduceRight(u,!1):p.reduce(u,!1))return!0}else if(c(p))return!0}}o&&(a[n]=s)}}function ia({StyleSheet:e,Atrule:t,Rule:r,Block:n,DeclarationList:o}){return{Atrule:{StyleSheet:e,Atrule:t,Rule:r,Block:n},Rule:{StyleSheet:e,Atrule:t,Rule:r,Block:n},Declaration:{StyleSheet:e,Atrule:t,Rule:r,Block:n,DeclarationList:o}}}function aa(e){let t=_l(e),r={},n={},o=Symbol("break-walk"),i=Symbol("skip-node");for(let s in t)Er.call(t,s)&&t[s]!==null&&(r[s]=oa(t[s],!1),n[s]=oa(t[s],!0));let a=ia(r),c=ia(n),u=function(s,l){function p(v,E,Y){let z=h.call(J,v,E,Y);return z===o?!0:z===i?!1:!!(b.hasOwnProperty(v.type)&&b[v.type](v,J,p,G)||d.call(J,v,E,Y)===o)}let h=mt,d=mt,b=r,G=(v,E,Y,z)=>v||p(E,Y,z),J={break:o,skip:i,root:s,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof l=="function")h=l;else if(l&&(h=ra(l.enter),d=ra(l.leave),l.reverse&&(b=n),l.visit)){if(a.hasOwnProperty(l.visit))b=l.reverse?c[l.visit]:a[l.visit];else if(!t.hasOwnProperty(l.visit))throw new Error("Bad value `"+l.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(", ")+")");h=na(h,l.visit),d=na(d,l.visit)}if(h===mt&&d===mt)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");p(s)};return u.break=o,u.skip=i,u.find=function(s,l){let p=null;return u(s,function(h,d,b){if(l.call(this,h,d,b))return p=h,o}),p},u.findLast=function(s,l){let p=null;return u(s,{reverse:!0,enter(h,d,b){if(l.call(this,h,d,b))return p=h,o}}),p},u.findAll=function(s,l){let p=[];return u(s,function(h,d,b){l.call(this,h,d,b)&&p.push(h)}),p},u}function Wl(e){return e}function ql(e){let{min:t,max:r,comma:n}=e;return t===0&&r===0?n?"#?":"*":t===0&&r===1?"?":t===1&&r===0?n?"#":"+":t===1&&r===1?"":(n?"#":"")+(t===r?"{"+t+"}":"{"+t+","+(r!==0?r:"")+"}")}function jl(e){if(e.type==="Range")return" ["+(e.min===null?"-\u221E":e.min)+","+(e.max===null?"\u221E":e.max)+"]";throw new Error("Unknown node type `"+e.type+"`")}function Ul(e,t,r,n){let o=e.combinator===" "||n?e.combinator:" "+e.combinator+" ",i=e.terms.map(a=>Ut(a,t,r,n)).join(o);return e.explicit||r?(n||i[0]===","?"[":"[ ")+i+(n?"]":" ]"):i}function Ut(e,t,r,n){let o;switch(e.type){case"Group":o=Ul(e,t,r,n)+(e.disallowEmpty?"!":"");break;case"Multiplier":return Ut(e.term,t,r,n)+t(ql(e),e);case"Boolean":o="<boolean-expr["+Ut(e.term,t,r,n)+"]>";break;case"Type":o="<"+e.name+(e.opts?t(jl(e.opts),e.opts):"")+">";break;case"Property":o="<'"+e.name+"'>";break;case"Keyword":o=e.name;break;case"AtKeyword":o="@"+e.name;break;case"Function":o=e.name+"(";break;case"String":case"Token":o=e.value;break;case"Comma":o=",";break;default:throw new Error("Unknown node type `"+e.type+"`")}return t(o,e)}function Fe(e,t){let r=Wl,n=!1,o=!1;return typeof t=="function"?r=t:t&&(n=!!t.forceBraces,o=!!t.compact,typeof t.decorate=="function"&&(r=t.decorate)),Ut(e,r,n,o)}var sa={offset:0,line:1,column:1};function Hl(e,t){let r=e.tokens,n=e.longestMatch,o=n<r.length&&r[n].node||null,i=o!==t?o:null,a=0,c=0,u=0,s="",l,p;for(let h=0;h<r.length;h++){let d=r[h].value;h===n&&(c=d.length,a=s.length),i!==null&&r[h].node===i&&(h<=n?u++:u=0),s+=d}return n===r.length||u>1?(l=Ht(i||t,"end")||dt(sa,s),p=dt(l)):(l=Ht(i,"start")||dt(Ht(t,"start")||sa,s.slice(0,a)),p=Ht(i,"end")||dt(l,s.substr(a,c))),{css:s,mismatchOffset:a,mismatchLength:c,start:l,end:p}}function Ht(e,t){let r=e&&e.loc&&e.loc[t];return r?"line"in r?dt(r):r:null}function dt({offset:e,line:t,column:r},n){let o={offset:e,line:t,column:r};if(n){let i=n.split(/\n|\r\n?|\f/);o.offset+=n.length,o.line+=i.length-1,o.column=i.length===1?o.column+n.length:i.pop().length+1}return o}var Ve=function(e,t){let r=Ie("SyntaxReferenceError",e+(t?" `"+t+"`":""));return r.reference=t,r},la=function(e,t,r,n){let o=Ie("SyntaxMatchError",e),{css:i,mismatchOffset:a,mismatchLength:c,start:u,end:s}=Hl(n,r);return o.rawMessage=e,o.syntax=t?Fe(t):"<generic>",o.css=i,o.mismatchOffset=a,o.mismatchLength=c,o.message=e+`
  syntax: `+o.syntax+`
   value: `+(i||"<empty string>")+`
  --------`+new Array(o.mismatchOffset+1).join("-")+"^",Object.assign(o,u),o.loc={source:r&&r.loc&&r.loc.source||"<unknown>",start:u,end:s},o};var Gt=new Map,Qe=new Map,Yt=45,ft=Gl,zr=Yl,Nf=Ir;function Kt(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===Yt&&e.charCodeAt(t+1)===Yt}function Ir(e,t){if(t=t||0,e.length-t>=3&&e.charCodeAt(t)===Yt&&e.charCodeAt(t+1)!==Yt){let r=e.indexOf("-",t+2);if(r!==-1)return e.substring(t,r+1)}return""}function Gl(e){if(Gt.has(e))return Gt.get(e);let t=e.toLowerCase(),r=Gt.get(t);if(r===void 0){let n=Kt(t,0),o=n?"":Ir(t,0);r=Object.freeze({basename:t.substr(o.length),name:t,prefix:o,vendor:o,custom:n})}return Gt.set(e,r),r}function Yl(e){if(Qe.has(e))return Qe.get(e);let t=e,r=e[0];r==="/"?r=e[1]==="/"?"//":"/":r!=="_"&&r!=="*"&&r!=="$"&&r!=="#"&&r!=="+"&&r!=="&"&&(r="");let n=Kt(t,r.length);if(!n&&(t=t.toLowerCase(),Qe.has(t))){let c=Qe.get(t);return Qe.set(e,c),c}let o=n?"":Ir(t,r.length),i=t.substr(0,r.length+o.length),a=Object.freeze({basename:t.substr(i.length),name:t.substr(r.length),hack:r,vendor:o,prefix:i,custom:n});return Qe.set(e,a),a}var Xe=["initial","inherit","unset","revert","revert-layer"];var bt=43,de=45,Pr=110,$e=!0,Vl=!1;function Dr(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function gt(e,t,r){for(;e!==null&&(e.type===13||e.type===25);)e=r(++t);return t}function Ae(e,t,r,n){if(!e)return 0;let o=e.value.charCodeAt(t);if(o===bt||o===de){if(r)return 0;t++}for(;t<e.value.length;t++)if(!M(e.value.charCodeAt(t)))return 0;return n+1}function Nr(e,t,r){let n=!1,o=gt(e,t,r);if(e=r(o),e===null)return t;if(e.type!==10)if(Dr(e,bt)||Dr(e,de)){if(n=!0,o=gt(r(++o),o,r),e=r(o),e===null||e.type!==10)return 0}else return t;if(!n){let i=e.value.charCodeAt(0);if(i!==bt&&i!==de)return 0}return Ae(e,n?0:1,n,o)}function Or(e,t){let r=0;if(!e)return 0;if(e.type===10)return Ae(e,0,Vl,r);if(e.type===1&&e.value.charCodeAt(0)===de){if(!ye(e.value,1,Pr))return 0;switch(e.value.length){case 2:return Nr(t(++r),r,t);case 3:return e.value.charCodeAt(2)!==de?0:(r=gt(t(++r),r,t),e=t(r),Ae(e,0,$e,r));default:return e.value.charCodeAt(2)!==de?0:Ae(e,3,$e,r)}}else if(e.type===1||Dr(e,bt)&&t(r+1).type===1){if(e.type!==1&&(e=t(++r)),e===null||!ye(e.value,0,Pr))return 0;switch(e.value.length){case 1:return Nr(t(++r),r,t);case 2:return e.value.charCodeAt(1)!==de?0:(r=gt(t(++r),r,t),e=t(r),Ae(e,0,$e,r));default:return e.value.charCodeAt(1)!==de?0:Ae(e,2,$e,r)}}else if(e.type===12){let n=e.value.charCodeAt(0),o=n===bt||n===de?1:0,i=o;for(;i<e.value.length&&M(e.value.charCodeAt(i));i++);return i===o||!ye(e.value,i,Pr)?0:i+1===e.value.length?Nr(t(++r),r,t):e.value.charCodeAt(i+1)!==de?0:i+2===e.value.length?(r=gt(t(++r),r,t),e=t(r),Ae(e,0,$e,r)):Ae(e,i+2,$e,r)}return 0}var Ql=43,ca=45,ua=63,Xl=117;function Fr(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function $l(e,t){return e.value.charCodeAt(0)===t}function yt(e,t,r){let n=0;for(let o=t;o<e.value.length;o++){let i=e.value.charCodeAt(o);if(i===ca&&r&&n!==0)return yt(e,t+n+1,!1),6;if(!te(i)||++n>6)return 0}return n}function Vt(e,t,r){if(!e)return 0;for(;Fr(r(t),ua);){if(++e>6)return 0;t++}return t}function Rr(e,t){let r=0;if(e===null||e.type!==1||!ye(e.value,0,Xl)||(e=t(++r),e===null))return 0;if(Fr(e,Ql))return e=t(++r),e===null?0:e.type===1?Vt(yt(e,0,!0),++r,t):Fr(e,ua)?Vt(1,++r,t):0;if(e.type===10){let n=yt(e,1,!0);return n===0?0:(e=t(++r),e===null?r:e.type===12||e.type===10?!$l(e,ca)||!yt(e,1,!1)?0:r+1:Vt(n,r,t))}return e.type===12?Vt(yt(e,1,!0),++r,t):0}var Mr=["calc(","-moz-calc(","-webkit-calc("],Br=["min(","max(","clamp("],_r=["round(","mod(","rem("],Zl=["sin(","cos(","tan("],Jl=["asin(","acos(","atan(","atan2("],ec=["pow(","sqrt(","log(","exp(","sign("],Wr=["hypot("],qr=["abs("],pa=[...Mr,...Br,..._r,...Zl,...ec,...Wr,...qr],tc=[...Mr,...Br,..._r,...Wr,...qr],ve=[...Mr,...Br,..._r,...Jl,...Wr,...qr],jr=new Map([[2,22],[21,22],[19,20],[23,24]]);function he(e,t){return t<e.length?e.charCodeAt(t):0}function ha(e,t){return xe(e,0,e.length,t)}function ma(e,t){for(let r=0;r<t.length;r++)if(ha(e,t[r]))return!0;return!1}function da(e,t){return t!==e.length-2?!1:he(e,t)===92&&M(he(e,t+1))}function Qt(e,t,r){if(e&&e.type==="Range"){let n=Number(r!==void 0&&r!==t.length?t.substr(0,r):t);if(isNaN(n)||e.min!==null&&n<e.min&&typeof e.min!="string"||e.max!==null&&n>e.max&&typeof e.max!="string")return!0}return!1}function rc(e,t){let r=0,n=[],o=0;e:do{switch(e.type){case 24:case 22:case 20:if(e.type!==r)break e;if(r=n.pop(),n.length===0){o++;break e}break;case 2:case 21:case 19:case 23:n.push(r),r=jr.get(e.type);break}o++}while(e=t(o));return o}function ae(e,t){return function(r,n,o){return r===null?0:r.type===2&&ma(r.value,t)?rc(r,n):e(r,n,o)}}function P(e){return function(t){return t===null||t.type!==e?0:1}}function nc(e){if(e===null||e.type!==1)return 0;let t=e.value.toLowerCase();return ma(t,Xe)||ha(t,"default")?0:1}function fa(e){return e===null||e.type!==1||he(e.value,0)!==45||he(e.value,1)!==45?0:1}function oc(e){return!fa(e)||e.value==="--"?0:1}function ic(e){if(e===null||e.type!==4)return 0;let t=e.value.length;if(t!==4&&t!==5&&t!==7&&t!==9)return 0;for(let r=1;r<t;r++)if(!te(he(e.value,r)))return 0;return 1}function ac(e){return e===null||e.type!==4||!je(he(e.value,1),he(e.value,2),he(e.value,3))?0:1}function sc(e,t){if(!e)return 0;let r=0,n=[],o=0;e:do{switch(e.type){case 6:case 8:break e;case 24:case 22:case 20:if(e.type!==r)break e;r=n.pop();break;case 17:if(r===0)break e;break;case 9:if(r===0&&e.value==="!")break e;break;case 2:case 21:case 19:case 23:n.push(r),r=jr.get(e.type);break}o++}while(e=t(o));return o}function lc(e,t){if(!e)return 0;let r=0,n=[],o=0;e:do{switch(e.type){case 6:case 8:break e;case 24:case 22:case 20:if(e.type!==r)break e;r=n.pop();break;case 2:case 21:case 19:case 23:n.push(r),r=jr.get(e.type);break}o++}while(e=t(o));return o}function Se(e){return e&&(e=new Set(e)),function(t,r,n){if(t===null||t.type!==12)return 0;let o=Ne(t.value,0);if(e!==null){let i=t.value.indexOf("\\",o),a=i===-1||!da(t.value,i)?t.value.substr(o):t.value.substring(o,i);if(e.has(a.toLowerCase())===!1)return 0}return Qt(n,t.value,o)?0:1}}function cc(e,t,r){return e===null||e.type!==11||Qt(r,e.value,e.value.length-1)?0:1}function ga(e){return typeof e!="function"&&(e=function(){return 0}),function(t,r,n){return t!==null&&t.type===10&&Number(t.value)===0?1:e(t,r,n)}}function uc(e,t,r){if(e===null)return 0;let n=Ne(e.value,0);return!(n===e.value.length)&&!da(e.value,n)||Qt(r,e.value,n)?0:1}function pc(e,t,r){if(e===null||e.type!==10)return 0;let n=he(e.value,0)===43||he(e.value,0)===45?1:0;for(;n<e.value.length;n++)if(!M(he(e.value,n)))return 0;return Qt(r,e.value,n)?0:1}var hc={"ident-token":P(1),"function-token":P(2),"at-keyword-token":P(3),"hash-token":P(4),"string-token":P(5),"bad-string-token":P(6),"url-token":P(7),"bad-url-token":P(8),"delim-token":P(9),"number-token":P(10),"percentage-token":P(11),"dimension-token":P(12),"whitespace-token":P(13),"CDO-token":P(14),"CDC-token":P(15),"colon-token":P(16),"semicolon-token":P(17),"comma-token":P(18),"[-token":P(19),"]-token":P(20),"(-token":P(21),")-token":P(22),"{-token":P(23),"}-token":P(24)},mc={string:P(5),ident:P(1),percentage:ae(cc,tc),zero:ga(),number:ae(uc,pa),integer:ae(pc,pa),"custom-ident":nc,"dashed-ident":fa,"custom-property-name":oc,"hex-color":ic,"id-selector":ac,"an-plus-b":Or,urange:Rr,"declaration-value":sc,"any-value":lc},dc=["length","angle","time","frequency","resolution","flex","decibel","semitones"];function fc(e){let{angle:t,decibel:r,frequency:n,flex:o,length:i,resolution:a,semitones:c,time:u}=e||{};return{dimension:ae(Se(null),ve),angle:ae(Se(t),ve),decibel:ae(Se(r),ve),frequency:ae(Se(n),ve),flex:ae(Se(o),ve),length:ae(ga(Se(i)),ve),resolution:ae(Se(a),ve),semitones:ae(Se(c),ve),time:ae(Se(u),ve)}}function gc(e){let t=new Set;for(let r of dc)if(Array.isArray(e[r]))for(let n of e[r])t.add(n.toLowerCase());return function(n){return n===null?0:n.type===9&&n.value==="%"||n.type===1&&t.has(n.value.toLowerCase())?1:0}}function ba(e){return{...hc,...mc,...fc(e),"attr-unit":gc(e)}}var Xt={};f(Xt,{angle:()=>yc,decibel:()=>Sc,flex:()=>vc,frequency:()=>kc,length:()=>bc,resolution:()=>wc,semitones:()=>Cc,time:()=>xc});var bc=["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],yc=["deg","grad","rad","turn"],xc=["s","ms"],kc=["hz","khz"],wc=["dpi","dpcm","dppx","x"],vc=["fr"],Sc=["db"],Cc=["st"];var Ia={};f(Ia,{SyntaxError:()=>$t,generate:()=>Fe,parse:()=>Je,walk:()=>nr});function $t(e,t,r){return Object.assign(Ie("SyntaxError",e),{input:t,offset:r,rawMessage:e,message:e+`
  `+t+`
--`+new Array((r||t.length)+1).join("-")+"^"})}var Tc=9,Lc=10,Ac=12,Ec=13,zc=32,ya=new Uint8Array(128).map((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0),Zt=class{constructor(t){this.str=t,this.pos=0}charCodeAt(t){return t<this.str.length?this.str.charCodeAt(t):0}charCode(){return this.charCodeAt(this.pos)}isNameCharCode(t=this.charCode()){return t<128&&ya[t]===1}nextCharCode(){return this.charCodeAt(this.pos+1)}nextNonWsCode(t){return this.charCodeAt(this.findWsEnd(t))}skipWs(){this.pos=this.findWsEnd(this.pos)}findWsEnd(t){for(;t<this.str.length;t++){let r=this.str.charCodeAt(t);if(r!==Ec&&r!==Lc&&r!==Ac&&r!==zc&&r!==Tc)break}return t}substringToPos(t){return this.str.substring(this.pos,this.pos=t)}eat(t){this.charCode()!==t&&this.error("Expect `"+String.fromCharCode(t)+"`"),this.pos++}peek(){return this.pos<this.str.length?this.str.charAt(this.pos++):""}error(t){throw new $t(t,this.str,this.pos)}scanSpaces(){return this.substringToPos(this.findWsEnd(this.pos))}scanWord(){let t=this.pos;for(;t<this.str.length;t++){let r=this.str.charCodeAt(t);if(r>=128||ya[r]===0)break}return this.pos===t&&this.error("Expect a keyword"),this.substringToPos(t)}scanNumber(){let t=this.pos;for(;t<this.str.length;t++){let r=this.str.charCodeAt(t);if(r<48||r>57)break}return this.pos===t&&this.error("Expect a number"),this.substringToPos(t)}scanString(){let t=this.str.indexOf("'",this.pos+1);return t===-1&&(this.pos=this.str.length,this.error("Expect an apostrophe")),this.substringToPos(t+1)}};var Ic=9,Pc=10,Nc=12,Dc=13,Oc=32,Ta=33,Yr=35,xa=38,Jt=39,La=40,Aa=41,Ea=42,Kr=43,Vr=44,ka=45,Qr=60,Hr=62,er=63,Fc=64,xt=91,Ze=93,tr=123,wa=124,Gr=125,va=8734,Sa={" ":1,"&&":2,"||":3,"|":4};function Ca(e){let t=null,r=null;return e.eat(tr),e.skipWs(),t=e.scanNumber(e),e.skipWs(),e.charCode()===Vr?(e.pos++,e.skipWs(),e.charCode()!==Gr&&(r=e.scanNumber(e),e.skipWs())):r=t,e.eat(Gr),{min:Number(t),max:r?Number(r):0}}function Rc(e){let t=null,r=!1;switch(e.charCode()){case Ea:e.pos++,t={min:0,max:0};break;case Kr:e.pos++,t={min:1,max:0};break;case er:e.pos++,t={min:0,max:1};break;case Yr:e.pos++,r=!0,e.charCode()===tr?t=Ca(e):e.charCode()===er?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case tr:t=Ca(e);break;default:return null}return{type:"Multiplier",comma:r,min:t.min,max:t.max,term:null}}function Ce(e,t){let r=Rc(e);return r!==null?(r.term=t,e.charCode()===Yr&&e.charCodeAt(e.pos-1)===Kr||e.charCode()===er&&e.charCodeAt(e.pos-1)===Gr?Ce(e,r):r):t}function Ur(e){let t=e.peek();return t===""?null:Ce(e,{type:"Token",value:t})}function Mc(e){let t;return e.eat(Qr),e.eat(Jt),t=e.scanWord(),e.eat(Jt),e.eat(Hr),Ce(e,{type:"Property",name:t})}function Bc(e){let t=null,r=null,n=1;return e.eat(xt),e.charCode()===ka&&(e.peek(),n=-1),n==-1&&e.charCode()===va?e.peek():(t=n*Number(e.scanNumber(e)),e.isNameCharCode()&&(t+=e.scanWord())),e.skipWs(),e.eat(Vr),e.skipWs(),e.charCode()===va?e.peek():(n=1,e.charCode()===ka&&(e.peek(),n=-1),r=n*Number(e.scanNumber(e)),e.isNameCharCode()&&(r+=e.scanWord())),e.eat(Ze),{type:"Range",min:t,max:r}}function _c(e){let t,r=null;if(e.eat(Qr),t=e.scanWord(),t==="boolean-expr"){e.eat(xt);let n=rr(e,Ze);return e.eat(Ze),e.eat(Hr),Ce(e,{type:"Boolean",term:n.terms.length===1?n.terms[0]:n})}return e.charCode()===La&&e.nextCharCode()===Aa&&(e.pos+=2,t+="()"),e.charCodeAt(e.findWsEnd(e.pos))===xt&&(e.skipWs(),r=Bc(e)),e.eat(Hr),Ce(e,{type:"Type",name:t,opts:r})}function Wc(e){let t=e.scanWord();return e.charCode()===La?(e.pos++,{type:"Function",name:t}):Ce(e,{type:"Keyword",name:t})}function qc(e,t){function r(o,i){return{type:"Group",terms:o,combinator:i,disallowEmpty:!1,explicit:!1}}let n;for(t=Object.keys(t).sort((o,i)=>Sa[o]-Sa[i]);t.length>0;){n=t.shift();let o=0,i=0;for(;o<e.length;o++){let a=e[o];a.type==="Combinator"&&(a.value===n?(i===-1&&(i=o-1),e.splice(o,1),o--):(i!==-1&&o-i>1&&(e.splice(i,o-i,r(e.slice(i,o),n)),o=i+1),i=-1))}i!==-1&&t.length&&e.splice(i,o-i,r(e.slice(i,o),n))}return n}function rr(e,t=-1){let r=Object.create(null),n=[],o=null,i=e.pos,a=!1;for(;e.charCode()!==t;){let c=a?rr(e,Aa):Uc(e);if(!c)break;if(c.type!=="Spaces"){if(a){if(c.terms.length===0){a=!1;continue}if(c.combinator===" "){for(;c.terms.length>1;)r[" "]=!0,n.push({type:"Combinator",value:" "},c.terms.shift());c=c.terms[0]}}c.type==="Combinator"?((o===null||o.type==="Combinator")&&(e.pos=i,e.error("Unexpected combinator")),r[c.value]=!0):o!==null&&o.type!=="Combinator"&&(r[" "]=!0,n.push({type:"Combinator",value:" "})),n.push(c),o=c,i=e.pos,a=c.type==="Function"}}return o!==null&&o.type==="Combinator"&&(e.pos-=i,e.error("Unexpected combinator")),{type:"Group",terms:n,combinator:qc(n,r)||" ",disallowEmpty:!1,explicit:!1}}function jc(e){let t;return e.eat(xt),t=rr(e,Ze),e.eat(Ze),t.explicit=!0,e.charCode()===Ta&&(e.pos++,t.disallowEmpty=!0),t}function Uc(e){let t=e.charCode();switch(t){case Ze:break;case xt:return Ce(e,jc(e));case Qr:return e.nextCharCode()===Jt?Mc(e):_c(e);case wa:return{type:"Combinator",value:e.substringToPos(e.pos+(e.nextCharCode()===wa?2:1))};case xa:return e.pos++,e.eat(xa),{type:"Combinator",value:"&&"};case Vr:return e.pos++,{type:"Comma"};case Jt:return Ce(e,{type:"String",value:e.scanString()});case Oc:case Ic:case Pc:case Dc:case Nc:return{type:"Spaces",value:e.scanSpaces()};case Fc:return t=e.nextCharCode(),e.isNameCharCode(t)?(e.pos++,{type:"AtKeyword",name:e.scanWord()}):Ur(e);case Ea:case Kr:case er:case Yr:case Ta:break;case tr:if(t=e.nextCharCode(),t<48||t>57)return Ur(e);break;default:return e.isNameCharCode(t)?Wc(e):Ur(e)}}function Je(e){let t=new Zt(e),r=rr(t);return t.pos!==e.length&&t.error("Unexpected input"),r.terms.length===1&&r.terms[0].type==="Group"?r.terms[0]:r}var kt=function(){};function za(e){return typeof e=="function"?e:kt}function nr(e,t,r){function n(a){switch(o.call(r,a),a.type){case"Group":a.terms.forEach(n);break;case"Multiplier":case"Boolean":n(a.term);break;case"Type":case"Property":case"Keyword":case"AtKeyword":case"Function":case"String":case"Token":case"Comma":break;default:throw new Error("Unknown type: "+a.type)}i.call(r,a)}let o=kt,i=kt;if(typeof t=="function"?o=t:t&&(o=za(t.enter),i=za(t.leave)),o===kt&&i===kt)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");n(e,r)}var Hc={decorator(e){let t=[],r=null;return{...e,node(n){let o=r;r=n,e.node.call(this,n),r=o},emit(n,o,i){t.push({type:o,value:n,node:i?null:r})},result(){return t}}}};function Gc(e,t){let r=[];return Le(t)(e,(o,i,a)=>r.push({type:o,value:e.slice(i,a),node:null})),r}function Pa(e,t){return typeof e=="string"?Gc(e,t):t.generate(e,Hc)}var C={type:"Match"},A={type:"Mismatch"},or={type:"DisallowEmpty"},Yc=40,Kc=41;function Z(e,t,r){return t===C&&r===A||e===C&&t===C&&r===C?e:(e.type==="If"&&e.else===A&&t===C&&(t=e.then,e=e.match),{type:"If",match:e,then:t,else:r})}function Da(e){return e.length>2&&e.charCodeAt(e.length-2)===Yc&&e.charCodeAt(e.length-1)===Kc}function Na(e){return e.type==="Keyword"||e.type==="AtKeyword"||e.type==="Function"||e.type==="Type"&&Da(e.name)}function Ee(e,t=" ",r=!1){return{type:"Group",terms:e,combinator:t,disallowEmpty:!1,explicit:r}}function wt(e,t,r=new Set){if(!r.has(e))switch(r.add(e),e.type){case"If":e.match=wt(e.match,t,r),e.then=wt(e.then,t,r),e.else=wt(e.else,t,r);break;case"Type":return t[e.name]||e}return e}function Xr(e,t,r){switch(e){case" ":{let n=C;for(let o=t.length-1;o>=0;o--){let i=t[o];n=Z(i,n,A)}return n}case"|":{let n=A,o=null;for(let i=t.length-1;i>=0;i--){let a=t[i];if(Na(a)&&(o===null&&i>0&&Na(t[i-1])&&(o=Object.create(null),n=Z({type:"Enum",map:o},C,n)),o!==null)){let c=(Da(a.name)?a.name.slice(0,-1):a.name).toLowerCase();if(!(c in o)){o[c]=a;continue}}o=null,n=Z(a,C,n)}return n}case"&&":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!0};let n=A;for(let o=t.length-1;o>=0;o--){let i=t[o],a;t.length>1?a=Xr(e,t.filter(function(c){return c!==i}),!1):a=C,n=Z(i,a,n)}return n}case"||":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};let n=r?C:A;for(let o=t.length-1;o>=0;o--){let i=t[o],a;t.length>1?a=Xr(e,t.filter(function(c){return c!==i}),!0):a=C,n=Z(i,a,n)}return n}}}function Vc(e){let t=C,r=et(e.term);if(e.max===0)r=Z(r,or,A),t=Z(r,null,A),t.then=Z(C,C,t),e.comma&&(t.then.else=Z({type:"Comma",syntax:e},t,A));else for(let n=e.min||1;n<=e.max;n++)e.comma&&t!==C&&(t=Z({type:"Comma",syntax:e},t,A)),t=Z(r,Z(C,C,t),A);if(e.min===0)t=Z(C,C,t);else for(let n=0;n<e.min-1;n++)e.comma&&t!==C&&(t=Z({type:"Comma",syntax:e},t,A)),t=Z(r,t,A);return t}function et(e){if(typeof e=="function")return{type:"Generic",fn:e};switch(e.type){case"Group":{let t=Xr(e.combinator,e.terms.map(et),!1);return e.disallowEmpty&&(t=Z(t,or,A)),t}case"Multiplier":return Vc(e);case"Boolean":{let t=et(e.term),r=et(Ee([Ee([{type:"Keyword",name:"not"},{type:"Type",name:"!boolean-group"}]),Ee([{type:"Type",name:"!boolean-group"},Ee([{type:"Multiplier",comma:!1,min:0,max:0,term:Ee([{type:"Keyword",name:"and"},{type:"Type",name:"!boolean-group"}])},{type:"Multiplier",comma:!1,min:0,max:0,term:Ee([{type:"Keyword",name:"or"},{type:"Type",name:"!boolean-group"}])}],"|")])],"|")),n=et(Ee([{type:"Type",name:"!term"},Ee([{type:"Token",value:"("},{type:"Type",name:"!self"},{type:"Token",value:")"}]),{type:"Type",name:"general-enclosed"}],"|"));return wt(n,{"!term":t,"!self":r}),wt(r,{"!boolean-group":n}),r}case"Type":case"Property":return{type:e.type,name:e.name,syntax:e};case"Keyword":return{type:e.type,name:e.name.toLowerCase(),syntax:e};case"AtKeyword":return{type:e.type,name:"@"+e.name.toLowerCase(),syntax:e};case"Function":return{type:e.type,name:e.name.toLowerCase()+"(",syntax:e};case"String":return e.value.length===3?{type:"Token",value:e.value.charAt(1),syntax:e}:{type:e.type,value:e.value.substr(1,e.value.length-2).replace(/\\'/g,"'"),syntax:e};case"Token":return{type:e.type,value:e.value,syntax:e};case"Comma":return{type:e.type,syntax:e};default:throw new Error("Unknown node type:",e.type)}}function vt(e,t){return typeof e=="string"&&(e=Je(e)),{type:"MatchGraph",match:et(e),syntax:t||null,source:e}}var{hasOwnProperty:Oa}=Object.prototype,Qc=0,Xc=1,Zr=2,_a=3,Fa="Match",$c="Mismatch",Zc="Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)",Ra=15e4,Jc=0;function eu(e){let t=null,r=null,n=e;for(;n!==null;)r=n.prev,n.prev=t,t=n,n=r;return t}function $r(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let n=t.charCodeAt(r),o=e.charCodeAt(r);if(o>=65&&o<=90&&(o=o|32),o!==n)return!1}return!0}function tu(e){return e.type!==9?!1:e.value!=="?"}function Ma(e){return e===null?!0:e.type===18||e.type===2||e.type===21||e.type===19||e.type===23||tu(e)}function Ba(e){return e===null?!0:e.type===22||e.type===20||e.type===24||e.type===9&&e.value==="/"}function ru(e,t,r){function n(){do E++,v=E<e.length?e[E]:null;while(v!==null&&(v.type===13||v.type===25))}function o(re){let ge=E+re;return ge<e.length?e[ge]:null}function i(re,ge){return{nextState:re,matchStack:z,syntaxStack:p,thenStack:h,tokenIndex:E,prev:ge}}function a(re){h={nextState:re,matchStack:z,syntaxStack:p,prev:h}}function c(re){d=i(re,d)}function u(){z={type:Xc,syntax:t.syntax,token:v,prev:z},n(),b=null,E>Y&&(Y=E)}function s(){p={syntax:t.syntax,opts:t.syntax.opts||p!==null&&p.opts||null,prev:p},z={type:Zr,syntax:t.syntax,token:z.token,prev:z}}function l(){z.type===Zr?z=z.prev:z={type:_a,syntax:p.syntax,token:z.token,prev:z},p=p.prev}let p=null,h=null,d=null,b=null,G=0,J=null,v=null,E=-1,Y=0,z={type:Qc,syntax:null,token:null,prev:null};for(n();J===null&&++G<Ra;)switch(t.type){case"Match":if(h===null){if(v!==null&&(E!==e.length-1||v.value!=="\\0"&&v.value!=="\\9")){t=A;break}J=Fa;break}if(t=h.nextState,t===or)if(h.matchStack===z){t=A;break}else t=C;for(;h.syntaxStack!==p;)l();h=h.prev;break;case"Mismatch":if(b!==null&&b!==!1)(d===null||E>d.tokenIndex)&&(d=b,b=!1);else if(d===null){J=$c;break}t=d.nextState,h=d.thenStack,p=d.syntaxStack,z=d.matchStack,E=d.tokenIndex,v=E<e.length?e[E]:null,d=d.prev;break;case"MatchGraph":t=t.match;break;case"If":t.else!==A&&c(t.else),t.then!==C&&a(t.then),t=t.match;break;case"MatchOnce":t={type:"MatchOnceBuffer",syntax:t,index:0,mask:0};break;case"MatchOnceBuffer":{let j=t.syntax.terms;if(t.index===j.length){if(t.mask===0||t.syntax.all){t=A;break}t=C;break}if(t.mask===(1<<j.length)-1){t=C;break}for(;t.index<j.length;t.index++){let K=1<<t.index;if((t.mask&K)===0){c(t),a({type:"AddMatchOnce",syntax:t.syntax,mask:t.mask|K}),t=j[t.index++];break}}break}case"AddMatchOnce":t={type:"MatchOnceBuffer",syntax:t.syntax,index:0,mask:t.mask};break;case"Enum":if(v!==null){let j=v.value.toLowerCase();if(j.indexOf("\\")!==-1&&(j=j.replace(/\\[09].*$/,"")),Oa.call(t.map,j)){t=t.map[j];break}}t=A;break;case"Generic":{let j=p!==null?p.opts:null,K=E+Math.floor(t.fn(v,o,j));if(!isNaN(K)&&K>E){for(;E<K;)u();t=C}else t=A;break}case"Type":case"Property":{let j=t.type==="Type"?"types":"properties",K=Oa.call(r,j)?r[j][t.name]:null;if(!K||!K.match)throw new Error("Bad syntax reference: "+(t.type==="Type"?"<"+t.name+">":"<'"+t.name+"'>"));if(b!==!1&&v!==null&&t.type==="Type"&&(t.name==="custom-ident"&&v.type===1||t.name==="length"&&v.value==="0")){b===null&&(b=i(t,d)),t=A;break}s(),t=K.matchRef||K.match;break}case"Keyword":{let j=t.name;if(v!==null){let K=v.value;if(K.indexOf("\\")!==-1&&(K=K.replace(/\\[09].*$/,"")),$r(K,j)){u(),t=C;break}}t=A;break}case"AtKeyword":case"Function":if(v!==null&&$r(v.value,t.name)){u(),t=C;break}t=A;break;case"Token":if(v!==null&&v.value===t.value){u(),t=C;break}t=A;break;case"Comma":v!==null&&v.type===18?Ma(z.token)?t=A:(u(),t=Ba(v)?A:C):t=Ma(z.token)||Ba(v)?C:A;break;case"String":let re="",ge=E;for(;ge<e.length&&re.length<t.value.length;ge++)re+=e[ge].value;if($r(re,t.value)){for(;E<ge;)u();t=C}else t=A;break;default:throw new Error("Unknown node type: "+t.type)}switch(Jc+=G,J){case null:console.warn("[csstree-match] BREAK after "+Ra+" iterations"),J=Zc,z=null;break;case Fa:for(;p!==null;)l();break;default:z=null}return{tokens:e,reason:J,iterations:G,match:z,longestMatch:Y}}function Jr(e,t,r){let n=ru(e,t,r||{});if(n.match===null)return n;let o=n.match,i=n.match={syntax:t.syntax||null,match:[]},a=[i];for(o=eu(o).prev;o!==null;){switch(o.type){case Zr:i.match.push(i={syntax:o.syntax,match:[]}),a.push(i);break;case _a:a.pop(),i=a[a.length-1];break;default:i.match.push({syntax:o.syntax||null,token:o.token.value,node:o.token.node})}o=o.prev}return n}var tn={};f(tn,{getTrace:()=>Wa,isKeyword:()=>iu,isProperty:()=>ou,isType:()=>nu});function Wa(e){function t(o){return o===null?!1:o.type==="Type"||o.type==="Property"||o.type==="Keyword"}function r(o){if(Array.isArray(o.match)){for(let i=0;i<o.match.length;i++)if(r(o.match[i]))return t(o.syntax)&&n.unshift(o.syntax),!0}else if(o.node===e)return n=t(o.syntax)?[o.syntax]:[],!0;return!1}let n=null;return this.matched!==null&&r(this.matched),n}function nu(e,t){return en(this,e,r=>r.type==="Type"&&r.name===t)}function ou(e,t){return en(this,e,r=>r.type==="Property"&&r.name===t)}function iu(e){return en(this,e,t=>t.type==="Keyword")}function en(e,t,r){let n=Wa.call(e,t);return n===null?!1:n.some(r)}function qa(e){return"node"in e?e.node:qa(e.match[0])}function ja(e){return"node"in e?e.node:ja(e.match[e.match.length-1])}function rn(e,t,r,n,o){function i(c){if(c.syntax!==null&&c.syntax.type===n&&c.syntax.name===o){let u=qa(c),s=ja(c);e.syntax.walk(t,function(l,p,h){if(l   ===u){let d=new V;do{if(d.appendData(p.data),p.data===s)break;p=p.next}while(p!==null);a.push({parent:h,nodes:d})}})}Array.isArray(c.match)&&c.match.forEach(i)}let a=[];return r.matched!==null&&i(r.matched),a}var{hasOwnProperty:St}=Object.prototype;function nn(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&e>=0}function Ua(e){return!!e&&nn(e.offset)&&nn(e.line)&&nn(e.column)}function au(e,t){return function(n,o){if(!n||n.constructor!==Object)return o(n,"Type of node should be an Object");for(let i in n){let a=!0;if(St.call(n,i)!==!1){if(i==="type")n.type!==e&&o(n,"Wrong node type `"+n.type+"`, expected `"+e+"`");else if(i==="loc"){if(n.loc===null)continue;if(n.loc&&n.loc.constructor===Object)if(typeof n.loc.source!="string")i+=".source";else if(!Ua(n.loc.start))i+=".start";else if(!Ua(n.loc.end))i+=".end";else continue;a=!1}else if(t.hasOwnProperty(i)){a=!1;for(let c=0;!a&&c<t[i].length;c++){let u=t[i][c];switch(u){case String:a=typeof n[i]=="string";break;case Boolean:a=typeof n[i]=="boolean";break;case null:a=n[i]===null;break;default:typeof u=="string"?a=n[i]&&n[i].type===u:Array.isArray(u)&&(a=n[i]instanceof V)}}}else o(n,"Unknown field `"+i+"` for "+e+" node type");a||o(n,"Bad value for `"+e+"."+i+"`")}}for(let i in t)St.call(t,i)&&St.call(n,i)===!1&&o(n,"Field `"+e+"."+i+"` is missed")}}function Ha(e,t){let r=[];for(let n=0;n<e.length;n++){let o=e[n];if(o===String||o===Boolean)r.push(o.name.toLowerCase());else if(o===null)r.push("null");else if(typeof o=="string")r.push(o);else if(Array.isArray(o))r.push("List<"+(Ha(o,t)||"any")+">");else throw new Error("Wrong value `"+o+"` in `"+t+"` structure definition")}return r.join(" | ")}function su(e,t){let r=t.structure,n={type:String,loc:!0},o={type:'"'+e+'"'};for(let i in r){if(St.call(r,i)===!1)continue;let a=n[i]=Array.isArray(r[i])?r[i].slice():[r[i]];o[i]=Ha(a,e+"."+i)}return{docs:o,check:au(e,n)}}function Ga(e){let t={};if(e.node){for(let r in e.node)if(St.call(e.node,r)){let n=e.node[r];if(n.structure)t[r]=su(r,n);else throw new Error("Missed `structure` field in `"+r+"` node type definition")}}return t}function on(e,t,r){let n={};for(let o in e)e[o].syntax&&(n[o]=r?e[o].syntax:Fe(e[o].syntax,{compact:t}));return n}function lu(e,t,r){let n={};for(let[o,i]of Object.entries(e))n[o]={prelude:i.prelude&&(r?i.prelude.syntax:Fe(i.prelude.syntax,{compact:t})),descriptors:i.descriptors&&on(i.descriptors,t,r)};return n}function cu(e){for(let t=0;t<e.length;t++)if(e[t].value.toLowerCase()==="var(")return!0;return!1}function uu(e){let t=e.terms[0];return e.explicit===!1&&e.terms.length===1&&t.type==="Multiplier"&&t.comma===!0}function pu(e){for(let t=0;t<e.length;t++)if(e[t].value.toLowerCase()==="env(")return!0;return!1}function se(e,t,r){return{matched:e,iterations:r,error:t,...tn}}function tt(e,t,r,n){let o=Pa(r,e.syntax),i;return cu(o)?se(null,new Error("Matching for a tree with var() is not supported")):pu(o)?se(null,new Error("Matching for a tree with env() is not supported")):(n&&(i=Jr(o,e.cssWideKeywordsSyntax,e)),(!n||!i.match)&&(i=Jr(o,t.match,e),!i.match)?se(null,new la(i.reason,t.syntax,r,i),i.iterations):se(i.match,null,i.iterations))}var rt=class{constructor(t,r,n){if(this.cssWideKeywords=Xe,this.syntax=r,this.generic=!1,this.units={...Xt},this.atrules=Object.create(null),this.properties=Object.create(null),this.types=Object.create(null),this.structure=n||Ga(t),t){if(t.cssWideKeywords&&(this.cssWideKeywords=t.cssWideKeywords),t.units)for(let o of Object.keys(Xt))Array.isArray(t.units[o])&&(this.units[o]=t.units[o]);if(t.types)for(let[o,i]of Object.entries(t.types))this.addType_(o,i);if(t.generic){this.generic=!0;for(let[o,i]of Object.entries(ba(this.units)))this.addType_(o,i)}if(t.atrules)for(let[o,i]of Object.entries(t.atrules))this.addAtrule_(o,i);if(t.properties)for(let[o,i]of Object.entries(t.properties))this.addProperty_(o,i)}this.cssWideKeywordsSyntax=vt(this.cssWideKeywords.join(" |  "))}checkStructure(t){function r(i,a){o.push({node:i,message:a})}let n=this.structure,o=[];return this.syntax.walk(t,function(i){n.hasOwnProperty(i.type)?n[i.type].check(i,r):r(i,"Unknown node type `"+i.type+"`")}),o.length?o:!1}createDescriptor(t,r,n,o=null){let i={type:r,name:n},a={type:r,name:n,parent:o,serializable:typeof t=="string"||t&&typeof t.type=="string",syntax:null,match:null,matchRef:null};return typeof t=="function"?a.match=vt(t,i):(typeof t=="string"?Object.defineProperty(a,"syntax",{get(){return Object.defineProperty(a,"syntax",{value:Je(t)}),a.syntax}}):a.syntax=t,Object.defineProperty(a,"match",{get(){return Object.defineProperty(a,"match",{value:vt(a.syntax,i)}),a.match}}),r==="Property"&&Object.defineProperty(a,"matchRef",{get(){let c=a.syntax,u=uu(c)?vt({...c,terms:[c.terms[0].term]},i):null;return Object.defineProperty(a,"matchRef",{value:u}),u}})),a}addAtrule_(t,r){r&&(this.atrules[t]={type:"Atrule",name:t,prelude:r.prelude?this.createDescriptor(r.prelude,"AtrulePrelude",t):null,descriptors:r.descriptors?Object.keys(r.descriptors).reduce((n,o)=>(n[o]=this.createDescriptor(r.descriptors[o],"AtruleDescriptor",o,t),n),Object.create(null)):null})}addProperty_(t,r){r&&(this.properties[t]=this.createDescriptor(r,"Property",t))}addType_(t,r){r&&(this.types[t]=this.createDescriptor(r,"Type",t))}checkAtruleName(t){if(!this.getAtrule(t))return new Ve("Unknown at-rule","@"+t)}checkAtrulePrelude(t,r){let n=this.checkAtruleName(t);if(n)return n;let o=this.getAtrule(t);if(!o.prelude&&r)return new SyntaxError("At-rule `@"+t+"` should not contain a prelude");if(o.prelude&&!r&&!tt(this,o.prelude,"",!1).matched)return new SyntaxError("At-rule `@"+t+"` should contain a prelude")}checkAtruleDescriptorName(t,r){let n=this.checkAtruleName(t);if(n)return n;let o=this.getAtrule(t),i=ft(r);if(!o.descriptors)return new SyntaxError("At-rule `@"+t+"` has no known descriptors");if(!o.descriptors[i.name]&&!o.descriptors[i.basename])return new Ve("Unknown at-rule descriptor",r)}checkPropertyName(t){if(!this.getProperty(t))return new Ve("Unknown property",t)}matchAtrulePrelude(t,r){let n=this.checkAtrulePrelude(t,r);if(n)return se(null,n);let o=this.getAtrule(t);return o.prelude?tt(this,o.prelude,r||"",!1):se(null,null)}matchAtruleDescriptor(t,r,n){let o=this.checkAtruleDescriptorName(t,r);if(o)return se(null,o);let i=this.getAtrule(t),a=ft(r);return tt(this,i.descriptors[a.name]||i.descriptors[a.basename],n,!1)}matchDeclaration(t){return t.type!=="Declaration"?se(null,new Error("Not a Declaration node")):this.matchProperty(t.property,t.value)}matchProperty(t,r){if(!this.getProperty(t)&&zr(t).custom)return se(null,new Error("Lexer matching doesn't applicable for custom properties"));let n=this.checkPropertyName(t);return n?se(null,n):tt(this,this.getProperty(t),r,!0)}matchType(t,r){let n=this.getType(t);return n?tt(this,n,r,!1):se(null,new Ve("Unknown type",t))}match(t,r){return typeof t!="string"&&(!t||!t.type)?se(null,new Ve("Bad syntax")):((typeof t=="string"||!t.match)&&(t=this.createDescriptor(t,"Type","anonymous")),tt(this,t,r,!1))}findValueFragments(t,r,n,o){return rn(this,r,this.matchProperty(t,r),n,o)}findDeclarationValueFragments(t,r,n){return rn(this,t.value,this.matchDeclaration(t),r,n)}findAllFragments(t,r,n){let o=[];return this.syntax.walk(t,{visit:"Declaration",enter:i=>{o.push.apply(o,this.findDeclarationValueFragments(i,r,n))}}),o}getAtrule(t,r=!0){let n=ft(t);return(n.vendor&&r?this.atrules[n.name]||this.atrules[n.basename]:this.atrules[n.name])||null}getAtrulePrelude(t,r=!0){let n=this.getAtrule(t,r);return n&&n.prelude||null}getAtruleDescriptor(t,r){let n=this.getAtrule(t),o=ft(r);return(n&&n.descriptors?n.descriptors[o.name]||n.descriptors[o.basename]:null)||null}getProperty(t,r=!0){let n=zr(t);return(n.vendor&&r?this.properties[n.name]||this.properties[n.basename]:this.properties[n.name])||null}getType(t){return hasOwnProperty.call(this.types,t)?this.types[t]:null}validate(){function t(u,s){return s?`<${u}>`:`<'${u}'>`}function r(u,s,l,p){if(l.has(s))return l.get(s);l.set(s,!1),p.syntax!==null&&nr(p.syntax,function(h){if(h.type!=="Type"&&h.type!=="Property")return;let d=h.type==="Type"?u.types:u.properties,b=h.type==="Type"?o:i;hasOwnProperty.call(d,h.name)?r(u,h.name,b,d[h.name])&&(n.push(`${t(s,l===o)} used broken syntax definition ${t(h.name,h.type==="Type")}`),l.set(s,!0)):(n.push(`${t(s,l===o)} used missed syntax definition ${t(h.name,h.type==="Type")}`),l.set(s,!0))},this)}let n=[],o=new Map,i=new Map;for(let u in this.types)r(this,u,o,this.types[u]);for(let u in this.properties)r(this,u,i,this.properties[u]);let a=[...o.keys()].filter(u=>o.get(u)),c=[...i.keys()].filter(u=>i.get(u));return a.length||c.length?{errors:n,types:a,properties:c}:null}dump(t,r){return{generic:this.generic,cssWideKeywords:this.cssWideKeywords,units:this.units,types:on(this.types,!r,t),properties:on(this.properties,!r,t),atrules:lu(this.atrules,!r,t)}}toString(){return JSON.stringify(this.dump())}};function an(e,t){return typeof t=="string"&&/^\s*\|/.test(t)?typeof e=="string"?e+t:t.replace(/^\s*\|\s*/,""):t||null}function hu(e,t){let r=Object.create(null);for(let n of Object.keys(e))t.includes(n)&&(r[n]=e[n]);return r}function sn(e,t,r){let n={...e};for(let[o,i]of Object.entries(t))n[o]={...n[o],...r?hu(i,r):i};return n}function Ct(e,t){let r={...e};for(let[n,o]of Object.entries(t))switch(n){case"generic":r[n]=!!o;break;case"cssWideKeywords":r[n]=e[n]?[...e[n],...o]:o||[];break;case"units":r[n]={...e[n]};for(let[i,a]of Object.entries(o))r[n][i]=Array.isArray(a)?a:[];break;case"atrules":r[n]={...e[n]};for(let[i,a]of Object.entries(o)){let c=r[n][i]||{},u=r[n][i]={prelude:c.prelude||null,descriptors:{...c.descriptors}};if(a){u.prelude=a.prelude?an(u.prelude,a.prelude):u.prelude||null;for(let[s,l]of Object.entries(a.descriptors||{}))u.descriptors[s]=l?an(u.descriptors[s],l):null;Object.keys(u.descriptors).length||(u.descriptors=null)}}break;case"types":case"properties":r[n]={...e[n]};for(let[i,a]of Object.entries(o))r[n][i]=an(r[n][i],a);break;case"parseContext":r[n]={...e[n],...o};break;case"scope":case"features":r[n]=sn(e[n],o);break;case"atrule":case"pseudo":r[n]=sn(e[n],o,["parse"]);break;case"node":r[n]=sn(e[n],o,["name","structure","parse","generate","walkContext"]);break;case"tokenize":typeof o=="function"&&(r[n]=o);break}return r}function Ya(e){let t=zi(e),r=aa(e),n=ea(e),{fromPlainObject:o,toPlainObject:i}=ta(r),a={lexer:null,createLexer:c=>new rt(c,a,a.lexer.structure),tokenize:Le(e),parse:t,generate:n,walk:r,find:r.find,findLast:r.findLast,findAll:r.findAll,fromPlainObject:o,toPlainObject:i,fork(c){let u=Ct({},e);return Ya(typeof c=="function"?c(u):Ct(u,c))}};return a.lexer=new rt({generic:e.generic,cssWideKeywords:e.cssWideKeywords,units:e.units,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},a),a}var ln=e=>Ya(Ct({},e));var Ka={generic:!0,cssWideKeywords:["initial","inherit","unset","revert","revert-layer"],units:{angle:["deg","grad","rad","turn"],decibel:["db"],flex:["fr"],frequency:["hz","khz"],length:["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],resolution:["dpi","dpcm","dppx","x"],semitones:["st"],time:["s","ms"]},types:{"abs()":"abs( <calc-sum> )","absolute-size":"xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large","acos()":"acos( <calc-sum> )","alpha-value":"<number>|<percentage>","an+b":"odd|even|<integer>|<n-dimension>|'+'? \u2020 n|-n|<ndashdigit-dimension>|'+'? \u2020 <ndashdigit-ident>|<dashndashdigit-ident>|<n-dimension> <signed-integer>|'+'? \u2020 n <signed-integer>|-n <signed-integer>|<ndash-dimension> <signless-integer>|'+'? \u2020 n- <signless-integer>|-n- <signless-integer>|<n-dimension> ['+'|'-'] <signless-integer>|'+'? \u2020 n ['+'|'-'] <signless-integer>|-n ['+'|'-'] <signless-integer>","anchor()":"anchor( <anchor-name>?&&<anchor-side> , <length-percentage>? )","anchor-name":"<dashed-ident>","anchor-side":"inside|outside|top|left|right|bottom|start|end|self-start|self-end|<percentage>|center","anchor-size":"width|height|block|inline|self-block|self-inline","anchor-size()":"anchor-size( [<anchor-name>||<anchor-size>]? , <length-percentage>? )","angle-percentage":"<angle>|<percentage>","angular-color-hint":"<angle-percentage>|<zero>","angular-color-stop":"<color> <color-stop-angle>?","angular-color-stop-list":"<angular-color-stop> , [<angular-color-hint>? , <angular-color-stop>]#?","animateable-feature":"scroll-position|contents|<custom-ident>","animation-action":"none|play|play-once|play-forwards|play-backwards|pause|reset|replay","asin()":"asin( <calc-sum> )","atan()":"atan( <calc-sum> )","atan2()":"atan2( <calc-sum> , <calc-sum> )",attachment:"scroll|fixed|local","attr()":"attr( <attr-name> <attr-type>? , <declaration-value>? )","attr-matcher":"['~'|'|'|'^'|'$'|'*']? '='","attr-modifier":"i|s","attr-type":"type( <syntax> )|raw-string|number|<attr-unit>","attribute-selector":"'[' <wq-name> ']'|'[' <wq-name> <attr-matcher> [<string-token>|<ident-token>] <attr-modifier>? ']'","auto-repeat":"repeat( [auto-fill|auto-fit] , [<line-names>? <fixed-size>]+ <line-names>? )","auto-track-list":"[<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>? <auto-repeat> [<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>?",axis:"block|inline|x|y","baseline-position":"[first|last]? baseline","basic-shape":"<inset()>|<xywh()>|<rect()>|<circle()>|<ellipse()>|<polygon()>|<path()>|shape( )","basic-shape-rect":"<inset()>|<rect()>|<xywh()>","bg-clip":"<visual-box>|border-area|text","bg-image":"<image>|none","bg-layer":"<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<visual-box>||<visual-box>","bg-position":"[[left|center|right|top|bottom|<length-percentage>]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]|[center|[left|right] <length-percentage>?]&&[center|[top|bottom] <length-percentage>?]]","bg-size":"[<length-percentage [0,\u221E]>|auto]{1,2}|cover|contain","blend-mode":"normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity","blur()":"blur( <length>? )","brightness()":"brightness( [<number>|<percentage>]? )","calc()":"calc( <calc-sum> )","calc-constant":"e|pi|infinity|-infinity|NaN","calc-product":"<calc-value> ['*' <calc-value>|'/' <number>]*","calc-size()":"calc-size( <calc-size-basis> , <calc-sum> )","calc-size-basis":"<intrinsic-size-keyword>|<calc-size()>|any|<calc-sum>","calc-sum":"<calc-product> [['+'|'-'] <calc-product>]*","calc-value":"<number>|<dimension>|<percentage>|<calc-constant>|( <calc-sum> )","cf-final-image":"<image>|<color>","cf-mixing-image":"<percentage>?&&<image>","circle()":"circle( <radial-size>? [at <position>]? )","clamp()":"clamp( <calc-sum>#{3} )","class-selector":"'.' <ident-token>","clip-source":"<url>",color:"<color-base>|currentColor|<system-color>|<device-cmyk()>|<light-dark()>|<-non-standard-color>","color()":"color( <colorspace-params> [/ [<alpha-value>|none]]? )","color-base":"<hex-color>|<color-function>|<named-color>|<color-mix()>|transparent","color-function":"<rgb()>|<rgba()>|<hsl()>|<hsla()>|<hwb()>|<lab()>|<lch()>|<oklab()>|<oklch()>|<alpha()>|<color()>","color-interpolation-method":"in [<rectangular-color-space>|<polar-color-space> <hue-interpolation-method>?|<custom-color-space>]","color-mix()":"color-mix( <color-interpolation-method> , [<color>&&<percentage [0,100]>?]#{2} )","color-stop":"<color-stop-length>|<color-stop-angle>","color-stop-angle":"[<angle-percentage>|<zero>]{1,2}","color-stop-length":"<length-percentage>{1,2}","color-stop-list":"<linear-color-stop> , [<linear-color-hint>? , <linear-color-stop>]#?","colorspace-params":"[<predefined-rgb-params>|<xyz-params>]",combinator:"'>'|'+'|'~'|['|' '|']","common-lig-values":"[common-ligatures|no-common-ligatures]","compat-auto":"searchfield|textarea|checkbox|radio|menulist|listbox|meter|progress-bar|button","compat-special":"textfield|menulist-button","complex-selector":"<complex-selector-unit> [<combinator>? <complex-selector-unit>]*","complex-selector-list":"<complex-selector>#","composite-style":"clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor","compositing-operator":"add|subtract|intersect|exclude","compound-selector":"[<type-selector>? <subclass-selector>*]!","compound-selector-list":"<compound-selector>#","conic-gradient()":"conic-gradient( [<conic-gradient-syntax>] )","conic-gradient-syntax":"[[[from [<angle>|<zero>]]? [at <position>]?]||<color-interpolation-method>]? , <angular-color-stop-list>","container-condition":"not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]","container-name":"<custom-ident>","container-query":"not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]","content-distribution":"space-between|space-around|space-evenly|stretch","content-list":"[<string>|contents|<image>|<counter>|<quote>|<target>|<leader()>|<attr()>]+","content-position":"center|start|end|flex-start|flex-end","content-replacement":"<image>","contextual-alt-values":"[contextual|no-contextual]","contrast()":"contrast( [<number>|<percentage>]? )","coord-box":"content-box|padding-box|border-box|fill-box|stroke-box|view-box","corner-shape-value":"round|scoop|bevel|notch|square|squircle|<superellipse()>","cos()":"cos( <calc-sum> )",counter:"<counter()>|<counters()>","counter()":"counter( <counter-name> , <counter-style>? )","counter-name":"<custom-ident>","counter-style":"<counter-style-name>|symbols( )","counter-style-name":"<custom-ident>","counters()":"counters( <counter-name> , <string> , <counter-style>? )","cross-fade()":"cross-fade( <cf-mixing-image> , <cf-final-image>? )","cubic-bezier()":"cubic-bezier( [<number [0,1]> , <number>]#{2} )","cubic-bezier-easing-function":"ease|ease-in|ease-out|ease-in-out|cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )","cursor-predefined":"auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing","custom-color-space":"<dashed-ident>","custom-params":"<dashed-ident> [<number>|<percentage>|none]+",dasharray:"[[<length-percentage>|<number>]+]#","dashndashdigit-ident":"<ident-token>","deprecated-system-color":"ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonHighlight|ButtonShadow|CaptionText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText","discretionary-lig-values":"[discretionary-ligatures|no-discretionary-ligatures]","display-box":"contents|none","display-inside":"flow|flow-root|table|flex|grid|ruby","display-internal":"table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container","display-legacy":"inline-block|inline-list-item|inline-table|inline-flex|inline-grid","display-listitem":"<display-outside>?&&[flow|flow-root]?&&list-item","display-outside":"block|inline|run-in","drop-shadow()":"drop-shadow( [<color>?&&<length>{2,3}] )","dynamic-range-limit-mix()":"dynamic-range-limit-mix( [<'dynamic-range-limit'>&&<percentage [0,100]>]#{2,} )","easing-function":"<linear-easing-function>|<cubic-bezier-easing-function>|<step-easing-function>","east-asian-variant-values":"[jis78|jis83|jis90|jis04|simplified|traditional]","east-asian-width-values":"[full-width|proportional-width]","element()":"element( <custom-ident> , [first|start|last|first-except]? )|element( <id-selector> )","ellipse()":"ellipse( <radial-size>? [at <position>]? )","env()":"env( <custom-ident> , <declaration-value>? )","exp()":"exp( <calc-sum> )","explicit-track-list":"[<line-names>? <track-size>]+ <line-names>?","family-name":"<string>|<custom-ident>+","feature-tag-value":"<string> [<integer>|on|off]?","feature-type":"@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation","feature-value-block":"<feature-type> '{' <feature-value-declaration-list> '}'","feature-value-block-list":"<feature-value-block>+","feature-value-declaration":"<custom-ident> : <integer>+ ;","feature-value-declaration-list":"<feature-value-declaration>","feature-value-name":"<custom-ident>","filter-function":"<blur()>|<brightness()>|<contrast()>|<drop-shadow()>|<grayscale()>|<hue-rotate()>|<invert()>|<opacity()>|<saturate()>|<sepia()>","filter-value-list":"[<filter-function>|<url>]+","final-bg-layer":"<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<visual-box>||<visual-box>||<'background-color'>","fit-content()":"fit-content( <length-percentage [0,\u221E]> )","fixed-breadth":"<length-percentage>","fixed-repeat":"repeat( [<integer [1,\u221E]>] , [<line-names>? <fixed-size>]+ <line-names>? )","fixed-size":"<fixed-breadth>|minmax( <fixed-breadth> , <track-breadth> )|minmax( <inflexible-breadth> , <fixed-breadth> )","font-stretch-absolute":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|<percentage>","font-variant-css2":"normal|small-caps","font-weight-absolute":"normal|bold|<number [1,1000]>","font-width-css3":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded","form-control-identifier":"select","frequency-percentage":"<frequency>|<percentage>","generic-complete":"serif|sans-serif|system-ui|cursive|fantasy|math|monospace","general-enclosed":"[<function-token> <any-value>? )]|[( <any-value>? )]","generic-family":"<generic-script-specific>|<generic-complete>|<generic-incomplete>|<-non-standard-generic-family>","generic-incomplete":"ui-serif|ui-sans-serif|ui-monospace|ui-rounded","geometry-box":"<shape-box>|fill-box|stroke-box|view-box",gradient:"<linear-gradient()>|<repeating-linear-gradient()>|<radial-gradient()>|<repeating-radial-gradient()>|<conic-gradient()>|<repeating-conic-gradient()>|<-legacy-gradient>","grayscale()":"grayscale( [<number>|<percentage>]? )","grid-line":"auto|<custom-ident>|[<integer>&&<custom-ident>?]|[span&&[<integer>||<custom-ident>]]","historical-lig-values":"[historical-ligatures|no-historical-ligatures]","hsl()":"<legacy-hsl-syntax>|<modern-hsl-syntax>","hsla()":"<legacy-hsla-syntax>|<modern-hsla-syntax>",hue:"<number>|<angle>","hue-interpolation-method":"[shorter|longer|increasing|decreasing] hue","hue-rotate()":"hue-rotate( [<angle>|<zero>]? )","hwb()":"<legacy-hwb-syntax>|<modern-hwb-syntax>","hypot()":"hypot( <calc-sum># )",image:"<url>|<image()>|<image-set()>|<element()>|<paint()>|<cross-fade()>|<gradient>","image()":"image( <image-tags>? [<image-src>? , <color>?]! )","image-set()":"image-set( <image-set-option># )","image-set-option":"[<image>|<string>] [<resolution>||type( <string> )]","image-src":"<url>|<string>","image-tags":"ltr|rtl","inflexible-breadth":"<length-percentage>|min-content|max-content|auto","inset()":"inset( <length-percentage>{1,4} [round <'border-radius'>]? )","invert()":"invert( [<number>|<percentage>]? )","keyframe-block":"<keyframe-selector># { <declaration-list> }","keyframe-selector":"from|to|<percentage [0,100]>|<timeline-range-name> <percentage>","keyframes-name":"<custom-ident>|<string>","lab()":"<legacy-lab-syntax>|<modern-lab-syntax>","layer()":"layer( <layer-name> )","layer-name":"<ident> ['.' <ident>]*","lch()":"<legacy-lch-syntax>|<modern-lch-syntax>","leader()":"leader( <leader-type> )","leader-type":"dotted|solid|space|<string>","length-percentage":"<length>|<percentage>","light-dark()":"light-dark( <color> , <color> )","line-name-list":"[<line-names>|<name-repeat>]+","line-names":"'[' <custom-ident>* ']'","line-style":"none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset","line-width":"<length>|thin|medium|thick","linear()":"linear( [<number>&&<percentage>{0,2}]# )","linear-color-hint":"<length-percentage>","linear-color-stop":"<color> <color-stop-length>?","linear-easing-function":"linear|<linear()>","linear-gradient()":"linear-gradient( [<linear-gradient-syntax>] )","linear-gradient-syntax":"[[<angle>|<zero>|to <side-or-corner>]||<color-interpolation-method>]? , <color-stop-list>","log()":"log( <calc-sum> , <calc-sum>? )","mask-layer":"<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||<geometry-box>||[<geometry-box>|no-clip]||<compositing-operator>||<masking-mode>","mask-position":"[<length-percentage>|left|center|right] [<length-percentage>|top|center|bottom]?","mask-reference":"none|<image>|<mask-source>","mask-source":"<url>","masking-mode":"alpha|luminance|match-source","matrix()":"matrix( <number>#{6} )","matrix3d()":"matrix3d( <number>#{16} )","max()":"max( <calc-sum># )","media-and":"<media-in-parens> [and <media-in-parens>]+","media-condition":"<media-not>|<media-and>|<media-or>|<media-in-parens>","media-condition-without-or":"<media-not>|<media-and>|<media-in-parens>","media-feature":"( [<mf-plain>|<mf-boolean>|<mf-range>] )","media-in-parens":"( <media-condition> )|<media-feature>|<general-enclosed>","media-not":"not <media-in-parens>","media-or":"<media-in-parens> [or <media-in-parens>]+","media-query":"<media-condition>|[not|only]? <media-type> [and <media-condition-without-or>]?","media-query-list":"<media-query>#","media-type":"<ident>","mf-boolean":"<mf-name>","mf-name":"<ident>","mf-plain":"<mf-name> : <mf-value>","mf-range":"<mf-name> ['<'|'>']? '='? <mf-value>|<mf-value> ['<'|'>']? '='? <mf-name>|<mf-value> '<' '='? <mf-name> '<' '='? <mf-value>|<mf-value> '>' '='? <mf-name> '>' '='? <mf-value>","mf-value":"<number>|<dimension>|<ident>|<ratio>","min()":"min( <calc-sum># )","minmax()":"minmax( [<length-percentage>|min-content|max-content|auto] , [<length-percentage>|<flex>|min-content|max-content|auto] )","mod()":"mod( <calc-sum> , <calc-sum> )","n-dimension":"<dimension-token>","name-repeat":"repeat( [<integer [1,\u221E]>|auto-fill] , <line-names>+ )","named-color":"aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen","namespace-prefix":"<ident>","ndash-dimension":"<dimension-token>","ndashdigit-dimension":"<dimension-token>","ndashdigit-ident":"<ident-token>","ns-prefix":"[<ident-token>|'*']? '|'","number-percentage":"<number>|<percentage>","numeric-figure-values":"[lining-nums|oldstyle-nums]","numeric-fraction-values":"[diagonal-fractions|stacked-fractions]","numeric-spacing-values":"[proportional-nums|tabular-nums]","offset-path":"<ray()>|<url>|<basic-shape>","oklab()":"<legacy-oklab-syntax>|<modern-oklab-syntax>","oklch()":"<legacy-oklch-syntax>|<modern-oklch-syntax>","opacity()":"opacity( [<number>|<percentage>]? )","opacity-value":"<number>|<percentage>","outline-line-style":"none|dotted|dashed|solid|double|groove|ridge|inset|outset","outline-radius":"<length>|<percentage>","overflow-position":"unsafe|safe","page-body":"<declaration>? [; <page-body>]?|<page-margin-box> <page-body>","page-margin-box":"<page-margin-box-type> '{' <declaration-list> '}'","page-margin-box-type":"@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom","page-selector":"<pseudo-page>+|<ident> <pseudo-page>*","page-selector-list":"[<page-selector>#]?","page-size":"A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger",paint:"none|<color>|<url> [none|<color>]?|context-fill|context-stroke","paint()":"paint( <ident> , <declaration-value>? )","paint-box":"<visual-box>|fill-box|stroke-box","palette-identifier":"<dashed-ident>","palette-mix()":"palette-mix( <color-interpolation-method> , [[normal|light|dark|<palette-identifier>|<palette-mix()>]&&<percentage [0,100]>?]#{2} )","path()":"path( <'fill-rule'>? , <string> )","perspective()":"perspective( [<length [0,\u221E]>|none] )","polar-color-space":"hsl|hwb|lch|oklch","polygon()":"polygon( <'fill-rule'>? , [<length-percentage> <length-percentage>]# )",position:"[[left|center|right]||[top|center|bottom]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]?|[[left|right] <length-percentage>]&&[[top|bottom] <length-percentage>]]","position-area":"[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|center|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|center|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]","pow()":"pow( <calc-sum> , <calc-sum> )","predefined-rgb":"srgb|srgb-linear|display-p3|display-p3-linear|a98-rgb|prophoto-rgb|rec2020","predefined-rgb-params":"<predefined-rgb> [<number>|<percentage>|none]{3}","pseudo-class-selector":"':' <ident-token>|':' <function-token> <any-value> ')'","pseudo-element-selector":"':' <pseudo-class-selector>|<legacy-pseudo-element-selector>","pseudo-page":": [left|right|first|blank]","query-in-parens":"( <container-condition> )|( <size-feature> )|style( <style-query> )|<general-enclosed>",quote:"open-quote|close-quote|no-open-quote|no-close-quote","radial-extent":"closest-corner|closest-side|farthest-corner|farthest-side","radial-gradient()":"radial-gradient( [<radial-gradient-syntax>] )","radial-gradient-syntax":"[[[<radial-shape>||<radial-size>]? [at <position>]?]||<color-interpolation-method>]? , <color-stop-list>","radial-shape":"circle|ellipse","radial-size":"<radial-extent>|<length [0,\u221E]>|<length-percentage [0,\u221E]>{2}",ratio:"<number [0,\u221E]> [/ <number [0,\u221E]>]?","ray()":"ray( <angle>&&<ray-size>?&&contain?&&[at <position>]? )","ray-size":"closest-side|closest-corner|farthest-side|farthest-corner|sides","rect()":"rect( [<length-percentage>|auto]{4} [round <'border-radius'>]? )","rectangular-color-space":"srgb|srgb-linear|display-p3|display-p3-linear|a98-rgb|prophoto-rgb|rec2020|lab|oklab|xyz|xyz-d50|xyz-d65","relative-selector":"<combinator>? <complex-selector>","relative-selector-list":"<relative-selector>#","relative-size":"larger|smaller","rem()":"rem( <calc-sum> , <calc-sum> )","repeat-style":"repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}","repeating-conic-gradient()":"repeating-conic-gradient( [<conic-gradient-syntax>] )","repeating-linear-gradient()":"repeating-linear-gradient( [<linear-gradient-syntax>] )","repeating-radial-gradient()":"repeating-radial-gradient( [<radial-gradient-syntax>] )","reversed-counter-name":"reversed( <counter-name> )","rgb()":"<legacy-rgb-syntax>|<modern-rgb-syntax>","rgba()":"<legacy-rgba-syntax>|<modern-rgba-syntax>","rotate()":"rotate( [<angle>|<zero>] )","rotate3d()":"rotate3d( <number> , <number> , <number> , [<angle>|<zero>] )","rotateX()":"rotateX( [<angle>|<zero>] )","rotateY()":"rotateY( [<angle>|<zero>] )","rotateZ()":"rotateZ( [<angle>|<zero>] )","round()":"round( <rounding-strategy>? , <calc-sum> , <calc-sum> )","rounding-strategy":"nearest|up|down|to-zero","saturate()":"saturate( [<number>|<percentage>]? )","scale()":"scale( [<number>|<percentage>]#{1,2} )","scale3d()":"scale3d( [<number>|<percentage>]#{3} )","scaleX()":"scaleX( [<number>|<percentage>] )","scaleY()":"scaleY( [<number>|<percentage>] )","scaleZ()":"scaleZ( [<number>|<percentage>] )","scope-end":"<forgiving-selector-list>","scope-start":"<forgiving-selector-list>","scroll()":"scroll( [<scroller>||<axis>]? )",scroller:"root|nearest|self","scroll-state-feature":"<media-query-list>","scroll-state-in-parens":"( <scroll-state-query> )|( <scroll-state-feature> )|<general-enclosed>","scroll-state-query":"not <scroll-state-in-parens>|<scroll-state-in-parens> [[and <scroll-state-in-parens>]*|[or <scroll-state-in-parens>]*]|<scroll-state-feature>","selector-list":"<complex-selector-list>","self-position":"center|start|end|self-start|self-end|flex-start|flex-end","sepia()":"sepia( [<number>|<percentage>]? )",shadow:"inset?&&<length>{2,4}&&<color>?","shadow-t":"[<length>{2,3}&&<color>?]",shape:"rect( <top> , <right> , <bottom> , <left> )|rect( <top> <right> <bottom> <left> )","shape-box":"<visual-box>|margin-box","side-or-corner":"[left|right]||[top|bottom]","sign()":"sign( <calc-sum> )","signed-integer":"<number-token>","signless-integer":"<number-token>","sin()":"sin( <calc-sum> )","single-animation":"<'animation-duration'>||<easing-function>||<'animation-delay'>||<single-animation-iteration-count>||<single-animation-direction>||<single-animation-fill-mode>||<single-animation-play-state>||[none|<keyframes-name>]||<single-animation-timeline>","single-animation-composition":"replace|add|accumulate","single-animation-direction":"normal|reverse|alternate|alternate-reverse","single-animation-fill-mode":"none|forwards|backwards|both","single-animation-iteration-count":"infinite|<number>","single-animation-play-state":"running|paused","single-animation-timeline":"auto|none|<dashed-ident>|<scroll()>|<view()>","single-transition":"[none|<single-transition-property>]||<time>||<easing-function>||<time>||<transition-behavior-value>","single-transition-property":"all|<custom-ident>",size:"closest-side|farthest-side|closest-corner|farthest-corner|<length>|<length-percentage>{2}","size-feature":"<mf-plain>|<mf-boolean>|<mf-range>","skew()":"skew( [<angle>|<zero>] , [<angle>|<zero>]? )","skewX()":"skewX( [<angle>|<zero>] )","skewY()":"skewY( [<angle>|<zero>] )","sqrt()":"sqrt( <calc-sum> )","step-position":"jump-start|jump-end|jump-none|jump-both|start|end","step-easing-function":"step-start|step-end|<steps()>","steps()":"steps( <integer> , <step-position>? )","style-feature":"<declaration>","style-in-parens":"( <style-condition> )|( <style-feature> )|<general-enclosed>","style-query":"<style-condition>|<style-feature>","subclass-selector":"<id-selector>|<class-selector>|<attribute-selector>|<pseudo-class-selector>","superellipse()":"superellipse( [<number>|infinity|-infinity] )","supports-condition":"not <supports-in-parens>|<supports-in-parens> [and <supports-in-parens>]*|<supports-in-parens> [or <supports-in-parens>]*","supports-decl":"( <declaration> )","supports-feature":"<supports-decl>|<supports-selector-fn>","supports-in-parens":"( <supports-condition> )|<supports-feature>|<general-enclosed>","supports-selector-fn":"selector( <complex-selector> )",symbol:"<string>|<image>|<custom-ident>","symbols()":"symbols( <symbols-type>? [<string>|<image>]+ )","symbols-type":"cyclic|numeric|alphabetic|symbolic|fixed","system-color":"AccentColor|AccentColorText|ActiveText|ButtonBorder|ButtonFace|ButtonText|Canvas|CanvasText|Field|FieldText|GrayText|Highlight|HighlightText|LinkText|Mark|MarkText|SelectedItem|SelectedItemText|VisitedText","system-family-name":"caption|icon|menu|message-box|small-caption|status-bar","tan()":"tan( <calc-sum> )",target:"<target-counter()>|<target-counters()>|<target-text()>","target-counter()":"target-counter( [<string>|<url>] , <custom-ident> , <counter-style>? )","target-counters()":"target-counters( [<string>|<url>] , <custom-ident> , <string> , <counter-style>? )","target-text()":"target-text( [<string>|<url>] , [content|before|after|first-letter]? )","text-edge":"[text|cap|ex|ideographic|ideographic-ink] [text|alphabetic|ideographic|ideographic-ink]?","time-percentage":"<time>|<percentage>","timeline-range-name":"cover|contain|entry|exit|entry-crossing|exit-crossing","track-breadth":"<length-percentage>|<flex>|min-content|max-content|auto","track-list":"[<line-names>? [<track-size>|<track-repeat>]]+ <line-names>?","track-repeat":"repeat( [<integer [1,\u221E]>] , [<line-names>? <track-size>]+ <line-names>? )","track-size":"<track-breadth>|minmax( <inflexible-breadth> , <track-breadth> )|fit-content( <length-percentage> )","transform-function":"<matrix()>|<translate()>|<translateX()>|<translateY()>|<scale()>|<scaleX()>|<scaleY()>|<rotate()>|<skew()>|<skewX()>|<skewY()>|<matrix3d()>|<translate3d()>|<translateZ()>|<scale3d()>|<scaleZ()>|<rotate3d()>|<rotateX()>|<rotateY()>|<rotateZ()>|<perspective()>","transform-list":"<transform-function>+","transition-behavior-value":"normal|allow-discrete","translate()":"translate( <length-percentage> , <length-percentage>? )","translate3d()":"translate3d( <length-percentage> , <length-percentage> , <length> )","translateX()":"translateX( <length-percentage> )","translateY()":"translateY( <length-percentage> )","translateZ()":"translateZ( <length> )","try-size":"most-width|most-height|most-block-size|most-inline-size","try-tactic":"flip-block||flip-inline||flip-start","type-or-unit":"string|color|url|integer|number|length|angle|time|frequency|cap|ch|em|ex|ic|lh|rlh|rem|vb|vi|vw|vh|vmin|vmax|mm|Q|cm|in|pt|pc|px|deg|grad|rad|turn|ms|s|Hz|kHz|%","type-selector":"<wq-name>|<ns-prefix>? '*'","var()":"var( <custom-property-name> , <declaration-value>? )","view()":"view( [<axis>||<'view-timeline-inset'>]? )","viewport-length":"auto|<length-percentage>","visual-box":"content-box|padding-box|border-box","wq-name":"<ns-prefix>? <ident-token>","xywh()":"xywh( <length-percentage>{2} <length-percentage [0,\u221E]>{2} [round <'border-radius'>]? )",xyz:"xyz|xyz-d50|xyz-d65","xyz-params":"<xyz-space> [<number>|<percentage>|none]{3}","-legacy-gradient":"<-webkit-gradient()>|<-legacy-linear-gradient>|<-legacy-repeating-linear-gradient>|<-legacy-radial-gradient>|<-legacy-repeating-radial-gradient>","-legacy-linear-gradient":"-moz-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-repeating-linear-gradient":"-moz-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-linear-gradient-arguments":"[<angle>|<side-or-corner>]? , <color-stop-list>","-legacy-radial-gradient":"-moz-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-repeating-radial-gradient":"-moz-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-radial-gradient-arguments":"[<position> ,]? [[[<-legacy-radial-gradient-shape>||<-legacy-radial-gradient-size>]|[<length>|<percentage>]{2}] ,]? <color-stop-list>","-legacy-radial-gradient-size":"closest-side|closest-corner|farthest-side|farthest-corner|contain|cover","-legacy-radial-gradient-shape":"circle|ellipse","-non-standard-font":"-apple-system-body|-apple-system-headline|-apple-system-subheadline|-apple-system-caption1|-apple-system-caption2|-apple-system-footnote|-apple-system-short-body|-apple-system-short-headline|-apple-system-short-subheadline|-apple-system-short-caption1|-apple-system-short-footnote|-apple-system-tall-body","-non-standard-color":"-moz-ButtonDefault|-moz-ButtonHoverFace|-moz-ButtonHoverText|-moz-CellHighlight|-moz-CellHighlightText|-moz-Combobox|-moz-ComboboxText|-moz-Dialog|-moz-DialogText|-moz-dragtargetzone|-moz-EvenTreeRow|-moz-Field|-moz-FieldText|-moz-html-CellHighlight|-moz-html-CellHighlightText|-moz-mac-accentdarkestshadow|-moz-mac-accentdarkshadow|-moz-mac-accentface|-moz-mac-accentlightesthighlight|-moz-mac-accentlightshadow|-moz-mac-accentregularhighlight|-moz-mac-accentregularshadow|-moz-mac-chrome-active|-moz-mac-chrome-inactive|-moz-mac-focusring|-moz-mac-menuselect|-moz-mac-menushadow|-moz-mac-menutextselect|-moz-MenuHover|-moz-MenuHoverText|-moz-MenuBarText|-moz-MenuBarHoverText|-moz-nativehyperlinktext|-moz-OddTreeRow|-moz-win-communicationstext|-moz-win-mediatext|-moz-activehyperlinktext|-moz-default-background-color|-moz-default-color|-moz-hyperlinktext|-moz-visitedhyperlinktext|-webkit-activelink|-webkit-focus-ring-color|-webkit-link|-webkit-text","-non-standard-image-rendering":"optimize-contrast|-moz-crisp-edges|-o-crisp-edges|-webkit-optimize-contrast","-non-standard-overflow":"overlay|-moz-scrollbars-none|-moz-scrollbars-horizontal|-moz-scrollbars-vertical|-moz-hidden-unscrollable","-non-standard-size":"intrinsic|min-intrinsic|-webkit-fill-available|-webkit-fit-content|-webkit-min-content|-webkit-max-content|-moz-available|-moz-fit-content|-moz-min-content|-moz-max-content","-webkit-gradient()":"-webkit-gradient( <-webkit-gradient-type> , <-webkit-gradient-point> [, <-webkit-gradient-point>|, <-webkit-gradient-radius> , <-webkit-gradient-point>] [, <-webkit-gradient-radius>]? [, <-webkit-gradient-color-stop>]* )","-webkit-gradient-color-stop":"from( <color> )|color-stop( [<number-zero-one>|<percentage>] , <color> )|to( <color> )","-webkit-gradient-point":"[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]","-webkit-gradient-radius":"<length>|<percentage>","-webkit-gradient-type":"linear|radial","-webkit-mask-box-repeat":"repeat|stretch|round","-ms-filter-function-list":"<-ms-filter-function>+","-ms-filter-function":"<-ms-filter-function-progid>|<-ms-filter-function-legacy>","-ms-filter-function-progid":"'progid:' [<ident-token> '.']* [<ident-token>|<function-token> <any-value>? )]","-ms-filter-function-legacy":"<ident-token>|<function-token> <any-value>? )",age:"child|young|old","attr-name":"<wq-name>","attr-fallback":"<any-value>",autospace:"no-autospace|[ideograph-alpha||ideograph-numeric||punctuation]||[insert|replace]",bottom:"<length>|auto","generic-voice":"[<age>? <gender> <integer>?]",gender:"male|female|neutral","generic-script-specific":"generic( kai )|generic( fangsong )|generic( nastaliq )","-non-standard-generic-family":"-apple-system|BlinkMacSystemFont","intrinsic-size-keyword":"min-content|max-content|fit-content",left:"<length>|auto","device-cmyk()":"<legacy-device-cmyk-syntax>|<modern-device-cmyk-syntax>","legacy-device-cmyk-syntax":"device-cmyk( <number>#{4} )","modern-device-cmyk-syntax":"device-cmyk( <cmyk-component>{4} [/ [<alpha-value>|none]]? )","cmyk-component":"<number>|<percentage>|none","color-space":"<rectangular-color-space>|<polar-color-space>|<custom-color-space>",right:"<length>|auto","forgiving-selector-list":"<complex-real-selector-list>","forgiving-relative-selector-list":"<relative-real-selector-list>","complex-real-selector-list":"<complex-real-selector>#","simple-selector-list":"<simple-selector>#","relative-real-selector-list":"<relative-real-selector>#","complex-selector-unit":"[<compound-selector>? <pseudo-compound-selector>*]!","complex-real-selector":"<compound-selector> [<combinator>? <compound-selector>]*","relative-real-selector":"<combinator>? <complex-real-selector>","pseudo-compound-selector":"<pseudo-element-selector> <pseudo-class-selector>*","simple-selector":"<type-selector>|<subclass-selector>","legacy-pseudo-element-selector":"':' [before|after|first-line|first-letter]","svg-length":"<percentage>|<length>|<number>","svg-writing-mode":"lr-tb|rl-tb|tb-rl|lr|rl|tb",top:"<length>|auto",x:"<number>",y:"<number>",declaration:"<ident-token> : <declaration-value>? ['!' important]?","declaration-list":"[<declaration>? ';']* <declaration>?",url:"url( <string> <url-modifier>* )|<url-token>","url-modifier":"<ident>|<function-token> <any-value> )","number-zero-one":"<number [0,1]>","number-one-or-greater":"<number [1,\u221E]>","rgb-component":"r|g|b|alpha","legacy-rgb-syntax":"rgb( <percentage>#{3} , <alpha-value>? )|rgb( <number>#{3} , <alpha-value>? )|rgb( [<number>|<percentage>|none]{3} [/ [<alpha-value>|none]]? )","modern-rgb-syntax":"rgb( from <color> [<number>|<percentage>|<rgb-component>]{3} [/ [<alpha-value>|<rgb-component>]]? )","legacy-rgba-syntax":"rgba( <percentage>#{3} , <alpha-value>? )|rgba( <number>#{3} , <alpha-value>? )|rgba( [<number>|<percentage>|none]{3} [/ [<alpha-value>|none]]? )","modern-rgba-syntax":"rgba( from <color> [<number>|<percentage>|<rgb-component>]{3} [/ [<alpha-value>|<rgb-component>]]? )","hsl-component":"h|s|l|alpha","legacy-hsl-syntax":"hsl( <hue> , <percentage> , <percentage> , <alpha-value>? )|hsl( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","modern-hsl-syntax":"hsl( from <color> [<hue>|<percentage>|<number>|<hsl-component>|none] [<percentage>|<number>|<hsl-component>|none] [<percentage>|<number>|<hsl-component>|none] [/ [<alpha-value>|<hsl-component>|none]]? )","legacy-hsla-syntax":"hsla( <hue> , <percentage> , <percentage> , <alpha-value>? )|hsla( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","modern-hsla-syntax":"hsla( from <color> [<hue>|<percentage>|<number>|<hsl-component>|none] [<percentage>|<number>|<hsl-component>|none] [<percentage>|<number>|<hsl-component>|none] [/ [<alpha-value>|<hsl-component>|none]]? )","hwb-component":"h|w|b","legacy-hwb-syntax":"hwb( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","modern-hwb-syntax":"hwb( from <color> [<hue>|<percentage>|<number>|<hwb-component>|none] [<percentage>|<number>|<hwb-component>|none] [<percentage>|<number>|<hwb-component>|none] [/ [<alpha-value>|<hwb-component>|none]]? )","lab-component":"l|a|b|alpha","legacy-lab-syntax":"lab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","modern-lab-syntax":"lab( from <color> [<number>|<percentage>|<lab-component>]{3} [/ [<alpha-value>|<lab-component>]]? )","legacy-oklab-syntax":"oklab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","modern-oklab-syntax":"oklab( from <color> [<number>|<percentage>|<lab-component>]{3} [/ [<alpha-value>|<lab-component>]]? )","lch-component":"l|c|h|alpha","legacy-lch-syntax":"lch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )","modern-lch-syntax":"lch( from <color> [<number>|<percentage>|<lch-component>]{3} [/ [<alpha-value>|<lch-component>]]? )","legacy-oklch-syntax":"oklch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )","modern-oklch-syntax":"oklch( from <color> [<number>|<percentage>|<lch-component>]{3} [/ [<alpha-value>|<lch-component>]]? )","alpha()":"alpha( [from <color>] [/ [<alpha-value>|none]]? )","xyz-space":"xyz|xyz-d50|xyz-d65","style-condition":"not <style-in-parens>|<style-in-parens> [[and <style-in-parens>]*|[or <style-in-parens>]*]","-non-standard-display":"-ms-inline-flexbox|-ms-grid|-ms-inline-grid|-webkit-flex|-webkit-inline-flex|-webkit-box|-webkit-inline-box|-moz-inline-stack|-moz-box|-moz-inline-box","inset-area":"[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]",syntax:"'*'|<syntax-component> [<syntax-combinator> <syntax-component>]*|<syntax-string>","syntax-component":"<syntax-single-component> <syntax-multiplier>?|'<' transform-list '>'","syntax-single-component":"'<' <syntax-type-name> '>'|<ident>","syntax-type-name":"angle|color|custom-ident|image|integer|length|length-percentage|number|percentage|resolution|string|time|url|transform-function","syntax-combinator":"'|'","syntax-multiplier":"'#'|'+'","syntax-string":"<string>"},properties:{"--*":"<declaration-value>","-ms-accelerator":"false|true","-ms-block-progression":"tb|rl|bt|lr","-ms-content-zoom-chaining":"none|chained","-ms-content-zoom-limit":"<'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'>","-ms-content-zoom-limit-max":"<percentage>","-ms-content-zoom-limit-min":"<percentage>","-ms-content-zoom-snap":"<'-ms-content-zoom-snap-type'>||<'-ms-content-zoom-snap-points'>","-ms-content-zoom-snap-points":"snapInterval( <percentage> , <percentage> )|snapList( <percentage># )","-ms-content-zoom-snap-type":"none|proximity|mandatory","-ms-content-zooming":"none|zoom","-ms-filter":"<string>","-ms-flow-from":"[none|<custom-ident>]#","-ms-flow-into":"[none|<custom-ident>]#","-ms-grid-columns":"none|<track-list>|<auto-track-list>","-ms-grid-rows":"none|<track-list>|<auto-track-list>","-ms-high-contrast-adjust":"auto|none","-ms-hyphenate-limit-chars":"auto|<integer>{1,3}","-ms-hyphenate-limit-lines":"no-limit|<integer>","-ms-hyphenate-limit-zone":"<percentage>|<length>","-ms-ime-align":"auto|after","-ms-overflow-style":"auto|none|scrollbar|-ms-autohiding-scrollbar","-ms-scroll-chaining":"chained|none","-ms-scroll-limit":"<'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'>","-ms-scroll-limit-x-max":"auto|<length>","-ms-scroll-limit-x-min":"<length>","-ms-scroll-limit-y-max":"auto|<length>","-ms-scroll-limit-y-min":"<length>","-ms-scroll-rails":"none|railed","-ms-scroll-snap-points-x":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-points-y":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-type":"none|proximity|mandatory","-ms-scroll-snap-x":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-x'>","-ms-scroll-snap-y":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-y'>","-ms-scroll-translation":"none|vertical-to-horizontal","-ms-scrollbar-3dlight-color":"<color>","-ms-scrollbar-arrow-color":"<color>","-ms-scrollbar-base-color":"<color>","-ms-scrollbar-darkshadow-color":"<color>","-ms-scrollbar-face-color":"<color>","-ms-scrollbar-highlight-color":"<color>","-ms-scrollbar-shadow-color":"<color>","-ms-scrollbar-track-color":"<color>","-ms-text-autospace":"none|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space","-ms-touch-select":"grippers|none","-ms-user-select":"none|element|text","-ms-wrap-flow":"auto|both|start|end|maximum|clear","-ms-wrap-margin":"<length>","-ms-wrap-through":"wrap|none","-moz-appearance":"none|button|button-arrow-down|button-arrow-next|button-arrow-previous|button-arrow-up|button-bevel|button-focus|caret|checkbox|checkbox-container|checkbox-label|checkmenuitem|dualbutton|groupbox|listbox|listitem|menuarrow|menubar|menucheckbox|menuimage|menuitem|menuitemtext|menulist|menulist-button|menulist-text|menulist-textfield|menupopup|menuradio|menuseparator|meterbar|meterchunk|progressbar|progressbar-vertical|progresschunk|progresschunk-vertical|radio|radio-container|radio-label|radiomenuitem|range|range-thumb|resizer|resizerpanel|scale-horizontal|scalethumbend|scalethumb-horizontal|scalethumbstart|scalethumbtick|scalethumb-vertical|scale-vertical|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|separator|sheet|spinner|spinner-downbutton|spinner-textfield|spinner-upbutton|splitter|statusbar|statusbarpanel|tab|tabpanel|tabpanels|tab-scroll-arrow-back|tab-scroll-arrow-forward|textfield|textfield-multiline|toolbar|toolbarbutton|toolbarbutton-dropdown|toolbargripper|toolbox|tooltip|treeheader|treeheadercell|treeheadersortarrow|treeitem|treeline|treetwisty|treetwistyopen|treeview|-moz-mac-unified-toolbar|-moz-win-borderless-glass|-moz-win-browsertabbar-toolbox|-moz-win-communicationstext|-moz-win-communications-toolbox|-moz-win-exclude-glass|-moz-win-glass|-moz-win-mediatext|-moz-win-media-toolbox|-moz-window-button-box|-moz-window-button-box-maximized|-moz-window-button-close|-moz-window-button-maximize|-moz-window-button-minimize|-moz-window-button-restore|-moz-window-frame-bottom|-moz-window-frame-left|-moz-window-frame-right|-moz-window-titlebar|-moz-window-titlebar-maximized","-moz-binding":"<url>|none","-moz-border-bottom-colors":"<color>+|none","-moz-border-left-colors":"<color>+|none","-moz-border-right-colors":"<color>+|none","-moz-border-top-colors":"<color>+|none","-moz-context-properties":"none|[fill|fill-opacity|stroke|stroke-opacity]#","-moz-float-edge":"border-box|content-box|margin-box|padding-box","-moz-force-broken-image-icon":"0|1","-moz-orient":"inline|block|horizontal|vertical","-moz-outline-radius":"<outline-radius>{1,4} [/ <outline-radius>{1,4}]?","-moz-outline-radius-bottomleft":"<outline-radius>","-moz-outline-radius-bottomright":"<outline-radius>","-moz-outline-radius-topleft":"<outline-radius>","-moz-outline-radius-topright":"<outline-radius>","-moz-stack-sizing":"ignore|stretch-to-fit","-moz-text-blink":"none|blink","-moz-user-focus":"ignore|normal|select-after|select-before|select-menu|select-same|select-all|none","-moz-user-input":"auto|none|enabled|disabled","-moz-user-modify":"read-only|read-write|write-only","-moz-window-dragging":"drag|no-drag","-moz-window-shadow":"default|menu|tooltip|sheet|none","-webkit-appearance":"none|button|button-bevel|caps-lock-indicator|caret|checkbox|default-button|inner-spin-button|listbox|listitem|media-controls-background|media-controls-fullscreen-background|media-current-time-display|media-enter-fullscreen-button|media-exit-fullscreen-button|media-fullscreen-button|media-mute-button|media-overlay-play-button|media-play-button|media-seek-back-button|media-seek-forward-button|media-slider|media-sliderthumb|media-time-remaining-display|media-toggle-closed-captions-button|media-volume-slider|media-volume-slider-container|media-volume-sliderthumb|menulist|menulist-button|menulist-text|menulist-textfield|meter|progress-bar|progress-bar-value|push-button|radio|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbargripper-horizontal|scrollbargripper-vertical|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|searchfield-cancel-button|searchfield-decoration|searchfield-results-button|searchfield-results-decoration|slider-horizontal|slider-vertical|sliderthumb-horizontal|sliderthumb-vertical|square-button|textarea|textfield|-apple-pay-button","-webkit-border-after":"<'border-top'>","-webkit-border-after-color":"<'border-top-color'>","-webkit-border-after-style":"<'border-top-style'>","-webkit-border-after-width":"<'border-top-width'>","-webkit-border-before":"<'border-top'>","-webkit-border-before-color":"<'border-top-color'>","-webkit-border-before-style":"<'border-top-style'>","-webkit-border-before-width":"<'border-top-width'>","-webkit-border-end":"<'border-top'>","-webkit-border-end-color":"<'border-top-color'>","-webkit-border-end-style":"<'border-top-style'>","-webkit-border-end-width":"<'border-top-width'>","-webkit-border-start":"<'border-top'>","-webkit-border-start-color":"<'border-top-color'>","-webkit-border-start-style":"<'border-top-style'>","-webkit-border-start-width":"<'border-top-width'>","-webkit-box-reflect":"[above|below|right|left]? <length>? <image>?","-webkit-line-clamp":"none|<integer>","-webkit-mask":"[<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||[<visual-box>|border|padding|content|text]||[<visual-box>|border|padding|content]]#","-webkit-mask-attachment":"<attachment>#","-webkit-mask-clip":"[<coord-box>|no-clip|border|padding|content|text]#","-webkit-mask-composite":"<composite-style>#","-webkit-mask-image":"<mask-reference>#","-webkit-mask-origin":"[<coord-box>|border|padding|content]#","-webkit-mask-position":"<position>#","-webkit-mask-position-x":"[<length-percentage>|left|center|right]#","-webkit-mask-position-y":"[<length-percentage>|top|center|bottom]#","-webkit-mask-repeat":"<repeat-style>#","-webkit-mask-repeat-x":"repeat|no-repeat|space|round","-webkit-mask-repeat-y":"repeat|no-repeat|space|round","-webkit-mask-size":"<bg-size>#","-webkit-overflow-scrolling":"auto|touch","-webkit-tap-highlight-color":"<color>","-webkit-text-fill-color":"<color>","-webkit-text-stroke":"<length>||<color>","-webkit-text-stroke-color":"<color>","-webkit-text-stroke-width":"<length>","-webkit-touch-callout":"default|none","-webkit-user-modify":"read-only|read-write|read-write-plaintext-only","-webkit-user-select":"auto|none|text|all","accent-color":"auto|<color>","align-content":"normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>","align-items":"normal|stretch|<baseline-position>|[<overflow-position>? <self-position>]|anchor-center","align-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? <self-position>|anchor-center","align-tracks":"[normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>]#","alignment-baseline":"auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical",all:"initial|inherit|unset|revert|revert-layer","anchor-name":"none|<dashed-ident>#","anchor-scope":"none|all|<dashed-ident>#",animation:"<single-animation>#","animation-composition":"<single-animation-composition>#","animation-delay":"<time>#","animation-direction":"<single-animation-direction>#","animation-duration":"[auto|<time [0s,\u221E]>]#","animation-fill-mode":"<single-animation-fill-mode>#","animation-iteration-count":"<single-animation-iteration-count>#","animation-name":"[none|<keyframes-name>]#","animation-play-state":"<single-animation-play-state>#","animation-range":"[<'animation-range-start'> <'animation-range-end'>?]#","animation-range-end":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","animation-range-start":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","animation-timeline":"<single-animation-timeline>#","animation-timing-function":"<easing-function>#","animation-trigger":"[none|[<dashed-ident> <animation-action>+]+]#",appearance:"none|auto|<compat-auto>|<compat-special>","aspect-ratio":"auto||<ratio>","backdrop-filter":"none|<filter-value-list>","backface-visibility":"visible|hidden",background:"<bg-layer>#? , <final-bg-layer>","background-attachment":"<attachment>#","background-blend-mode":"<blend-mode>#","background-clip":"<bg-clip>#","background-color":"<color>","background-image":"<bg-image>#","background-origin":"<visual-box>#","background-position":"<bg-position>#","background-position-x":"[center|[[left|right|x-start|x-end]? <length-percentage>?]!]#","background-position-y":"[center|[[top|bottom|y-start|y-end]? <length-percentage>?]!]#","background-repeat":"<repeat-style>#","background-size":"<bg-size>#","baseline-shift":"baseline|sub|super|<svg-length>","baseline-source":"auto|first|last","block-size":"<'width'>",border:"<line-width>||<line-style>||<color>","border-block":"<'border-top'>","border-block-color":"<'border-top-color'>{1,2}","border-block-end":"<'border-top'>","border-block-end-color":"<'border-top-color'>","border-block-end-style":"<'border-top-style'>","border-block-end-width":"<'border-top-width'>","border-block-start":"<'border-top'>","border-block-start-color":"<'border-top-color'>","border-block-start-style":"<'border-top-style'>","border-block-start-width":"<'border-top-width'>","border-block-style":"<'border-top-style'>{1,2}","border-block-width":"<'border-top-width'>{1,2}","border-bottom":"<line-width>||<line-style>||<color>","border-bottom-color":"<'border-top-color'>","border-bottom-left-radius":"<length-percentage [0,\u221E]>{1,2}","border-bottom-right-radius":"<length-percentage [0,\u221E]>{1,2}","border-bottom-style":"<line-style>","border-bottom-width":"<line-width>","border-collapse":"separate|collapse","border-color":"<color>{1,4}","border-end-end-radius":"<'border-top-left-radius'>","border-end-start-radius":"<'border-top-left-radius'>","border-image":"<'border-image-source'>||<'border-image-slice'> [/ <'border-image-width'>|/ <'border-image-width'>? / <'border-image-outset'>]?||<'border-image-repeat'>","border-image-outset":"[<length [0,\u221E]>|<number [0,\u221E]>]{1,4}","border-image-repeat":"[stretch|repeat|round|space]{1,2}","border-image-slice":"[<number [0,\u221E]>|<percentage [0,\u221E]>]{1,4}&&fill?","border-image-source":"none|<image>","border-image-width":"[<length-percentage [0,\u221E]>|<number [0,\u221E]>|auto]{1,4}","border-inline":"<'border-top'>","border-inline-color":"<'border-top-color'>{1,2}","border-inline-end":"<'border-top'>","border-inline-end-color":"<'border-top-color'>","border-inline-end-style":"<'border-top-style'>","border-inline-end-width":"<'border-top-width'>","border-inline-start":"<'border-top'>","border-inline-start-color":"<'border-top-color'>","border-inline-start-style":"<'border-top-style'>","border-inline-start-width":"<'border-top-width'>","border-inline-style":"<'border-top-style'>{1,2}","border-inline-width":"<'border-top-width'>{1,2}","border-left":"<line-width>||<line-style>||<color>","border-left-color":"<color>","border-left-style":"<line-style>","border-left-width":"<line-width>","border-radius":"<length-percentage [0,\u221E]>{1,4} [/ <length-percentage [0,\u221E]>{1,4}]?","border-right":"<line-width>||<line-style>||<color>","border-right-color":"<color>","border-right-style":"<line-style>","border-right-width":"<line-width>","border-shape":"none|[<basic-shape> <geometry-box>?]{1,2}","border-spacing":"<length>{1,2}","border-start-end-radius":"<'border-top-left-radius'>","border-start-start-radius":"<'border-top-left-radius'>","border-style":"<line-style>{1,4}","border-top":"<line-width>||<line-style>||<color>","border-top-color":"<color>","border-top-left-radius":"<length-percentage [0,\u221E]>{1,2}","border-top-right-radius":"<length-percentage [0,\u221E]>{1,2}","border-top-style":"<line-style>","border-top-width":"<line-width>","border-width":"<line-width>{1,4}",bottom:"auto|<length-percentage>|<anchor()>|<anchor-size()>","box-align":"start|center|end|baseline|stretch","box-decoration-break":"slice|clone","box-direction":"normal|reverse|inherit","box-flex":"<number>","box-flex-group":"<integer>","box-lines":"single|multiple","box-ordinal-group":"<integer>","box-orient":"horizontal|vertical|inline-axis|block-axis|inherit","box-pack":"start|center|end|justify","box-shadow":"none|<shadow>#","box-sizing":"content-box|border-box","break-after":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-before":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-inside":"auto|avoid|avoid-page|avoid-column|avoid-region","caption-side":"top|bottom",caret:"<'caret-color'>||<'caret-animation'>||<'caret-shape'>","caret-animation":"auto|manual","caret-color":"auto|<color>","caret-shape":"auto|bar|block|underscore",clear:"none|left|right|both|inline-start|inline-end",clip:"<shape>|auto","clip-path":"<clip-source>|[<basic-shape>||<geometry-box>]|none","clip-rule":"nonzero|ev   enodd",color:"<color>","color-interpolation-filters":"auto|sRGB|linearRGB","color-scheme":"normal|[light|dark|<custom-ident>]+&&only?","column-count":"<integer>|auto","column-fill":"auto|balance","column-gap":"normal|<length-percentage>","column-height":"auto|<length [0,\u221E]>","column-rule":"<'column-rule-width'>||<'column-rule-style'>||<'column-rule-color'>","column-rule-color":"<color>","column-rule-style":"<line-style>","column-rule-width":"<line-width>","column-span":"none|all","column-width":"auto|<length [0,\u221E]>","column-wrap":"auto|nowrap|wrap",columns:"[<'column-width'>||<'column-count'>] [/ <'column-height'>]?",contain:"none|strict|content|[[size||inline-size]||layout||style||paint]","contain-intrinsic-block-size":"auto? [none|<length>]","contain-intrinsic-height":"auto? [none|<length>]","contain-intrinsic-inline-size":"auto? [none|<length>]","contain-intrinsic-size":"[auto? [none|<length>]]{1,2}","contain-intrinsic-width":"auto? [none|<length>]",container:"<'container-name'> [/ <'container-type'>]?","container-name":"none|<custom-ident>+","container-type":"normal||[size|inline-size]",content:"normal|none|[<content-replacement>|<content-list>] [/ [<string>|<counter>|<attr()>]+]?","content-visibility":"visible|auto|hidden","corner-block-end-shape":"<corner-shape-value>{1,2}","corner-block-start-shape":"<corner-shape-value>{1,2}","corner-bottom-shape":"<corner-shape-value>{1,2}","corner-bottom-left-shape":"<corner-shape-value>","corner-bottom-right-shape":"<corner-shape-value>","corner-end-end-shape":"<corner-shape-value>","corner-end-start-shape":"<corner-shape-value>","corner-inline-end-shape":"<corner-shape-value>{1,2}","corner-inline-start-shape":"<corner-shape-value>{1,2}","corner-left-shape":"<corner-shape-value>{1,2}","corner-right-shape":"<corner-shape-value>{1,2}","corner-shape":"<corner-shape-value>{1,4}","corner-start-start-shape":"<corner-shape-value>","corner-start-end-shape":"<corner-shape-value>","corner-top-shape":"<corner-shape-value>{1,2}","corner-top-left-shape":"<corner-shape-value>","corner-top-right-shape":"<corner-shape-value>","counter-increment":"[<counter-name> <integer>?]+|none","counter-reset":"[<counter-name> <integer>?|<reversed-counter-name> <integer>?]+|none","counter-set":"[<counter-name> <integer>?]+|none",cursor:"[[<url> [<x> <y>]? ,]* [auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing|hand|-webkit-grab|-webkit-grabbing|-webkit-zoom-in|-webkit-zoom-out|-moz-grab|-moz-grabbing|-moz-zoom-in|-moz-zoom-out]]",cx:"<length>|<percentage>",cy:"<length>|<percentage>",d:"none|path( <string> )",direction:"ltr|rtl",display:"[<display-outside>||<display-inside>]|<display-listitem>|<display-internal>|<display-box>|<display-legacy>|<-non-standard-display>","dominant-baseline":"auto|use-script|no-change|reset-size|ideographic|alphabetic|hanging|mathematical|central|middle|text-after-edge|text-before-edge","dynamic-range-limit":"standard|no-limit|constrained|<dynamic-range-limit-mix()>","empty-cells":"show|hide","field-sizing":"content|fixed",fill:"<paint>","fill-opacity":"<number-zero-one>|<percentage>","fill-rule":"nonzero|evenodd",filter:"none|<filter-value-list>|<-ms-filter-function-list>",flex:"none|[<'flex-grow'> <'flex-shrink'>?||<'flex-basis'>]","flex-basis":"content|<'width'>","flex-direction":"row|row-reverse|column|column-reverse","flex-flow":"<'flex-direction'>||<'flex-wrap'>","flex-grow":"<number>","flex-shrink":"<number>","flex-wrap":"nowrap|wrap|wrap-reverse",float:"left|right|none|inline-start|inline-end","flood-color":"<color>","flood-opacity":"<'opacity'>",font:"[[<'font-style'>||<font-variant-css2>||<'font-weight'>||<font-width-css3>]? <'font-size'> [/ <'line-height'>]? <'font-family'>#]|<system-family-name>|<-non-standard-font>","font-family":"[<family-name>|<generic-family>]#","font-feature-settings":"normal|<feature-tag-value>#","font-kerning":"auto|normal|none","font-language-override":"normal|<string>","font-optical-sizing":"auto|none","font-palette":"normal|light|dark|<palette-identifier>|<palette-mix()>","font-size":"<absolute-size>|<relative-size>|<length-percentage [0,\u221E]>|math","font-size-adjust":"none|[ex-height|cap-height|ch-width|ic-width|ic-height]? [from-font|<number>]","font-smooth":"auto|never|always|<absolute-size>|<length>","font-stretch":"<font-stretch-absolute>","font-style":"normal|italic|oblique <angle>?","font-synthesis":"none|[weight||style||small-caps||position]","font-synthesis-position":"auto|none","font-synthesis-small-caps":"auto|none","font-synthesis-style":"auto|none","font-synthesis-weight":"auto|none","font-variant":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-alternates":"normal|[stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )]","font-variant-caps":"normal|small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps","font-variant-east-asian":"normal|[<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-emoji":"normal|text|emoji|unicode","font-variant-ligatures":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>]","font-variant-numeric":"normal|[<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero]","font-variant-position":"normal|sub|super","font-variation-settings":"normal|[<string> <number>]#","font-weight":"<font-weight-absolute>|bolder|lighter","font-width":"normal|<percentage [0,\u221E]>|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded","forced-color-adjust":"auto|none|preserve-parent-color","frame-sizing":"auto|content-width|content-height|content-block-size|content-inline-size",gap:"<'row-gap'> <'column-gap'>?",grid:"<'grid-template'>|<'grid-template-rows'> / [auto-flow&&dense?] <'grid-auto-columns'>?|[auto-flow&&dense?] <'grid-auto-rows'>? / <'grid-template-columns'>","grid-area":"<grid-line> [/ <grid-line>]{0,3}","grid-auto-columns":"<track-size>+","grid-auto-flow":"[row|column]||dense","grid-auto-rows":"<track-size>+","grid-column":"<grid-line> [/ <grid-line>]?","grid-column-end":"<grid-line>","grid-column-gap":"<length-percentage>","grid-column-start":"<grid-line>","grid-gap":"<'grid-row-gap'> <'grid-column-gap'>?","grid-row":"<grid-line> [/ <grid-line>]?","grid-row-end":"<grid-line>","grid-row-gap":"<length-percentage>","grid-row-start":"<grid-line>","grid-template":"none|[<'grid-template-rows'> / <'grid-template-columns'>]|[<line-names>? <string> <track-size>? <line-names>?]+ [/ <explicit-track-list>]?","grid-template-areas":"none|<string>+","grid-template-columns":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","grid-template-rows":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","hanging-punctuation":"none|[first||[force-end|allow-end]||last]",height:"auto|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","hyphenate-character":"auto|<string>","hyphenate-limit-chars":"[auto|<integer>]{1,3}",hyphens:"none|manual|auto","image-orientation":"from-image|<angle>|[<angle>? flip]","image-rendering":"auto|crisp-edges|pixelated|smooth|optimizeSpeed|optimizeQuality|<-non-standard-image-rendering>","image-resolution":"[from-image||<resolution>]&&snap?","ime-mode":"auto|normal|active|inactive|disabled","initial-letter":"normal|[<number> <integer>?]","initial-letter-align":"[auto|alphabetic|hanging|ideographic]","inline-size":"<'width'>",inset:"<'top'>{1,4}","inset-block":"<'top'>{1,2}","inset-block-end":"<'top'>","inset-block-start":"<'top'>","inset-inline":"<'top'>{1,2}","inset-inline-end":"<'top'>","inset-inline-start":"<'top'>","interpolate-size":"numeric-only|allow-keywords",isolation:"auto|isolate",interactivity:"auto|inert","interest-delay":"<'interest-delay-start'>{1,2}","interest-delay-end":"normal|<time>","interest-delay-start":"normal|<time>","justify-content":"normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]","justify-items":"normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|legacy|legacy&&[left|right|center]|anchor-center","justify-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|anchor-center","justify-tracks":"[normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]]#",left:"auto|<length-percentage>|<anchor()>|<anchor-size()>","letter-spacing":"normal|<length-percentage>","lighting-color":"<color>","line-break":"auto|loose|normal|strict|anywhere","line-clamp":"none|<integer>","line-height":"normal|<number>|<length>|<percentage>","line-height-step":"<length>","list-style":"<'list-style-type'>||<'list-style-position'>||<'list-style-image'>","list-style-image":"<image>|none","list-style-position":"inside|outside","list-style-type":"<counter-style>|<string>|none",margin:"<'margin-top'>{1,4}","margin-block":"<'margin-top'>{1,2}","margin-block-end":"<'margin-top'>","margin-block-start":"<'margin-top'>","margin-bottom":"<length-percentage>|auto|<anchor-size()>","margin-inline":"<'margin-top'>{1,2}","margin-inline-end":"<'margin-top'>","margin-inline-start":"<'margin-top'>","margin-left":"<length-percentage>|auto|<anchor-size()>","margin-right":"<length-percentage>|auto|<anchor-size()>","margin-top":"<length-percentage>|auto|<anchor-size()>","margin-trim":"none|in-flow|all",marker:"none|<url>","marker-end":"none|<url>","marker-mid":"none|<url>","marker-start":"none|<url>",mask:"<mask-layer>#","mask-border":"<'mask-border-source'>||<'mask-border-slice'> [/ <'mask-border-width'>? [/ <'mask-border-outset'>]?]?||<'mask-border-repeat'>||<'mask-border-mode'>","mask-border-mode":"luminance|alpha","mask-border-outset":"[<length>|<number>]{1,4}","mask-border-repeat":"[stretch|repeat|round|space]{1,2}","mask-border-slice":"<number-percentage>{1,4} fill?","mask-border-source":"none|<image>","mask-border-width":"[<length-percentage>|<number>|auto]{1,4}","mask-clip":"[<coord-box>|no-clip]#","mask-composite":"<compositing-operator>#","mask-image":"<mask-reference>#","mask-mode":"<masking-mode>#","mask-origin":"<coord-box>#","mask-position":"<position>#","mask-repeat":"<repeat-style>#","mask-size":"<bg-size>#","mask-type":"luminance|alpha","masonry-auto-flow":"[pack|next]||[definite-first|ordered]","math-depth":"auto-add|add( <integer> )|<integer>","math-shift":"normal|compact","math-style":"normal|compact","max-block-size":"<'max-width'>","max-height":"none|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","max-inline-size":"<'max-width'>","max-lines":"none|<integer>","max-width":"none|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","min-block-size":"<'min-width'>","min-height":"auto|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","min-inline-size":"<'min-width'>","min-width":"auto|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","mix-blend-mode":"<blend-mode>|plus-darker|plus-lighter","object-fit":"fill|contain|cover|none|scale-down","object-position":"<position>","object-view-box":"none|<basic-shape-rect>",offset:"[<'offset-position'>? [<'offset-path'> [<'offset-distance'>||<'offset-rotate'>]?]?]! [/ <'offset-anchor'>]?","offset-anchor":"auto|<position>","offset-distance":"<length-percentage>","offset-path":"none|<offset-path>||<coord-box>","offset-position":"normal|auto|<position>","offset-rotate":"[auto|reverse]||<angle>",opacity:"<opacity-value>",order:"<integer>",orphans:"<integer>",outline:"<'outline-width'>||<'outline-style'>||<'outline-color'>","outline-color":"auto|<color>","outline-offset":"<length>","outline-style":"auto|<outline-line-style>","outline-width":"<line-width>",overflow:"[visible|hidden|clip|scroll|auto]{1,2}|<-non-standard-overflow>","overflow-anchor":"auto|none","overflow-block":"visible|hidden|clip|scroll|auto|<-non-standard-overflow>","overflow-clip-box":"padding-box|content-box","overflow-clip-margin":"<visual-box>||<length [0,\u221E]>","overflow-inline":"visible|hidden|clip|scroll|auto|<-non-standard-overflow>","overflow-wrap":"normal|break-word|anywhere","overflow-x":"visible|hidden|clip|scroll|auto|<-non-standard-overflow>","overflow-y":"visible|hidden|clip|scroll|auto|<-non-standard-overflow>",overlay:"none|auto","overscroll-behavior":"[contain|none|auto]{1,2}","overscroll-behavior-block":"contain|none|auto","overscroll-behavior-inline":"contain|none|auto","overscroll-behavior-x":"contain|none|auto","overscroll-behavior-y":"contain|none|auto",padding:"<'padding-top'>{1,4}","padding-block":"<'padding-top'>{1,2}","padding-block-end":"<'padding-top'>","padding-block-start":"<'padding-top'>","padding-bottom":"<length-percentage [0,\u221E]>","padding-inline":"<'padding-top'>{1,2}","padding-inline-end":"<'padding-top'>","padding-inline-start":"<'padding-top'>","padding-left":"<length-percentage [0,\u221E]>","padding-right":"<length-percentage [0,\u221E]>","padding-top":"<length-percentage [0,\u221E]>",page:"auto|<custom-ident>","page-break-after":"auto|always|avoid|left|right|recto|verso","page-break-before":"auto|always|avoid|left|right|recto|verso","page-break-inside":"auto|avoid","paint-order":"normal|[fill||stroke||markers]",perspective:"none|<length>","perspective-origin":"<position>","place-content":"<'align-content'> <'justify-content'>?","place-items":"<'align-items'> <'justify-items'>?","place-self":"<'align-self'> <'justify-self'>?","pointer-events":"auto|none|visiblePainted|visibleFill|visibleStroke|visible|painted|fill|stroke|all|inherit",position:"static|relative|absolute|sticky|fixed|-webkit-sticky","position-anchor":"normal|auto|none|<anchor-name>|match-parent","position-area":"none|<position-area>","position-try":"<'position-try-order'>? <'position-try-fallbacks'>","position-try-fallbacks":"none|[[<dashed-ident>||<try-tactic>]|<'position-area'>]#","position-try-order":"normal|<try-size>","position-visibility":"always|[anchors-valid||anchors-visible||no-overflow]","print-color-adjust":"economy|exact",quotes:"none|auto|[<string> <string>]+",r:"<length>|<percentage>","reading-flow":"normal|source-order|flex-visual|flex-flow|grid-rows|grid-columns|grid-order","reading-order":"<integer>",resize:"none|both|horizontal|vertical|block|inline",right:"auto|<length-percentage>|<anchor()>|<anchor-size()>",rotate:"none|<angle>|[x|y|z|<number>{3}]&&<angle>","row-gap":"normal|<length-percentage>","ruby-align":"start|center|space-between|space-around","ruby-merge":"separate|collapse|auto","ruby-overhang":"auto|none","ruby-position":"[alternate||[over|under]]|inter-character",rx:"<length-percentage>|auto",ry:"<length-percentage>|auto",scale:"none|[<number>|<percentage>]{1,3}","scroll-behavior":"auto|smooth","scroll-initial-target":"none|nearest","scroll-margin":"<length>{1,4}","scroll-margin-block":"<length>{1,2}","scroll-margin-block-end":"<length>","scroll-margin-block-start":"<length>","scroll-margin-bottom":"<length>","scroll-margin-inline":"<length>{1,2}","scroll-margin-inline-end":"<length>","scroll-margin-inline-start":"<length>","scroll-margin-left":"<length>","scroll-margin-right":"<length>","scroll-margin-top":"<length>","scroll-marker-group":"none|before|after","scroll-padding":"[auto|<length-percentage>]{1,4}","scroll-padding-block":"[auto|<length-percentage>]{1,2}","scroll-padding-block-end":"auto|<length-percentage>","scroll-padding-block-start":"auto|<length-percentage>","scroll-padding-bottom":"auto|<length-percentage>","scroll-padding-inline":"[auto|<length-percentage>]{1,2}","scroll-padding-inline-end":"auto|<length-percentage>","scroll-padding-inline-start":"auto|<length-percentage>","scroll-padding-left":"auto|<length-percentage>","scroll-padding-right":"auto|<length-percentage>","scroll-padding-top":"auto|<length-percentage>","scroll-snap-align":"[none|start|end|center]{1,2}","scroll-snap-coordinate":"none|<position>#","scroll-snap-destination":"<position>","scroll-snap-points-x":"none|repeat( <length-percentage> )","scroll-snap-points-y":"none|repeat( <length-percentage> )","scroll-snap-stop":"normal|always","scroll-snap-type":"none|[x|y|block|inline|both] [mandatory|proximity]?","scroll-snap-type-x":"none|mandatory|proximity","scroll-snap-type-y":"none|mandatory|proximity","scroll-target-group":"none|auto","scroll-timeline":"[<'scroll-timeline-name'> <'scroll-timeline-axis'>?]#","scroll-timeline-axis":"[block|inline|x|y]#","scroll-timeline-name":"[none|<dashed-ident>]#","scrollbar-color":"auto|<color>{2}","scrollbar-gutter":"auto|stable&&both-edges?","scrollbar-width":"auto|thin|none","shape-image-threshold":"<opacity-value>","shape-margin":"<length-percentage>","shape-outside":"none|[<shape-box>||<basic-shape>]|<image>","shape-rendering":"auto|optimizeSpeed|crispEdges|geometricPrecision","speak-as":"normal|spell-out||digits||[literal-punctuation|no-punctuation]","stop-color":"<'color'>","stop-opacity":"<'opacity'>",stroke:"<paint>","stroke-color":"<color>","stroke-dasharray":"none|[<svg-length>+]#","stroke-dashoffset":"<svg-length>","stroke-linecap":"butt|round|square","stroke-linejoin":"miter|round|bevel","stroke-miterlimit":"<number-one-or-greater>","stroke-opacity":"<'opacity'>","stroke-width":"<svg-length>","tab-size":"<integer>|<length>","table-layout":"auto|fixed","text-align":"start|end|left|right|center|justify|match-parent","text-align-last":"auto|start|end|left|right|center|justify","text-anchor":"start|middle|end","text-autospace":"normal|<autospace>|auto","text-box":"normal|<'text-box-trim'>||<'text-box-edge'>","text-box-edge":"auto|<text-edge>","text-box-trim":"none|trim-start|trim-end|trim-both","text-combine-upright":"none|all|[digits <integer>?]","text-decoration":"<'text-decoration-line'>||<'text-decoration-style'>||<'text-decoration-color'>||<'text-decoration-thickness'>","text-decoration-color":"<color>","text-decoration-inset":"<length>{1,2}|auto","text-decoration-line":"none|[underline||overline||line-through||blink]|spelling-error|grammar-error","text-decoration-skip":"none|[objects||[spaces|[leading-spaces||trailing-spaces]]||edges||box-decoration]","text-decoration-skip-ink":"auto|all|none","text-decoration-style":"solid|double|dotted|dashed|wavy","text-decoration-thickness":"auto|from-font|<length>|<percentage>","text-emphasis":"<'text-emphasis-style'>||<'text-emphasis-color'>","text-emphasis-color":"<color>","text-emphasis-position":"auto|[over|under]&&[right|left]?","text-emphasis-style":"none|[[filled|open]||[dot|circle|double-circle|triangle|sesame]]|<string>","text-indent":"<length-percentage>&&hanging?&&each-line?","text-justify":"auto|inter-character|inter-word|none","text-orientation":"mixed|upright|sideways","text-overflow":"[clip|ellipsis|<string>]{1,2}","text-rendering":"auto|optimizeSpeed|optimizeLegibility|geometricPrecision","text-shadow":"none|<shadow-t>#","text-size-adjust":"none|auto|<percentage>","text-spacing-trim":"space-all|normal|space-first|trim-start","text-transform":"none|[capitalize|uppercase|lowercase]||full-width||full-size-kana|math-auto","text-underline-offset":"auto|<length>|<percentage>","text-underline-position":"auto|from-font|[under||[left|right]]","text-wrap":"<'text-wrap-mode'>||<'text-wrap-style'>","text-wrap-mode":"wrap|nowrap","text-wrap-style":"auto|balance|stable|pretty","timeline-scope":"none|<dashed-ident>#","timeline-trigger":"none|[<'timeline-trigger-name'> <'timeline-trigger-source'> <'timeline-trigger-activation-range'> ['/' <'timeline-trigger-active-range'>]?]#","timeline-trigger-activation-range":"[<'timeline-trigger-activation-range-start'> <'timeline-trigger-activation-range-end'>?]#","timeline-trigger-activation-range-end":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-activation-range-start":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-active-range":"[<'timeline-trigger-active-range-start'> <'timeline-trigger-active-range-end'>?]#","timeline-trigger-active-range-end":"[auto|normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-active-range-start":"[auto|normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-name":"none|<dashed-ident>#","timeline-trigger-source":"<single-animation-timeline>#",top:"auto|<length-percentage>|<anchor()>|<anchor-size()>","touch-action":"auto|none|[[pan-x|pan-left|pan-right]||[pan-y|pan-up|pan-down]||pinch-zoom]|manipulation",transform:"none|<transform-list>","transform-box":"content-box|border-box|fill-box|stroke-box|view-box","transform-origin":"[<length-percentage>|left|center|right|top|bottom]|[[<length-percentage>|left|center|right]&&[<length-percentage>|top|center|bottom]] <length>?","transform-style":"flat|preserve-3d",transition:"<single-transition>#","transition-behavior":"<transition-behavior-value>#","transition-delay":"<time>#","transition-duration":"<time>#","transition-property":"none|<single-transition-property>#","transition-timing-function":"<easing-function>#",translate:"none|<length-percentage> [<length-percentage> <length>?]?","trigger-scope":"none|all|<dashed-ident>#","unicode-bidi":"normal|embed|isolate|bidi-override|isolate-override|plaintext|-moz-isolate|-moz-isolate-override|-moz-plaintext|-webkit-isolate|-webkit-isolate-override|-webkit-plaintext","user-select":"auto|text|none|all","vector-effect":"none|non-scaling-stroke|non-scaling-size|non-rotation|fixed-position","vertical-align":"baseline|sub|super|text-top|text-bottom|middle|top|bottom|<percentage>|<length>","view-timeline":"[<'view-timeline-name'> [<'view-timeline-axis'>||<'view-timeline-inset'>]?]#","view-timeline-axis":"[block|inline|x|y]#","view-timeline-inset":"[[auto|<length-percentage>]{1,2}]#","view-timeline-name":"[none|<dashed-ident>]#","view-transition-class":"none|<custom-ident>+","view-transition-name":"none|<custom-ident>|match-element","view-transition-scope":"none|all",visibility:"visible|hidden|collapse","white-space":"normal|pre|pre-wrap|pre-line|<'white-space-collapse'>||<'text-wrap-mode'>","white-space-collapse":"collapse|preserve|preserve-breaks|preserve-spaces|break-spaces",widows:"<integer>",width:"auto|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","will-change":"auto|<animateable-feature>#","word-break":"normal|break-all|keep-all|break-word|auto-phrase","word-spacing":"normal|<length>","word-wrap":"normal|break-word","writing-mode":"horizontal-tb|vertical-rl|vertical-lr|sideways-rl|sideways-lr|<svg-writing-mode>",x:"<length>|<percentage>",y:"<length>|<percentage>","z-index":"auto|<integer>",zoom:"normal|reset|<number [0,\u221E]>||<percentage [0,\u221E]>","-moz-background-clip":"padding|border","-moz-border-radius-bottomleft":"<'border-bottom-left-radius'>","-moz-border-radius-bottomright":"<'border-bottom-right-radius'>","-moz-border-radius-topleft":"<'border-top-left-radius'>","-moz-border-radius-topright":"<'border-bottom-right-radius'>","-moz-control-character-visibility":"visible|hidden","-moz-osx-font-smoothing":"auto|grayscale","-moz-user-select":"none|text|all|-moz-none","-ms-flex-align":"start|end|center|baseline|stretch","-ms-flex-item-align":"auto|start|end|center|baseline|stretch","-ms-flex-line-pack":"start|end|center|justify|distribute|stretch","-ms-flex-negative":"<'flex-shrink'>","-ms-flex-pack":"start|end|center|justify|distribute","-ms-flex-order":"<integer>","-ms-flex-positive":"<'flex-grow'>","-ms-flex-preferred-size":"<'flex-basis'>","-ms-interpolation-mode":"nearest-neighbor|bicubic","-ms-grid-column-align":"start|end|center|stretch","-ms-grid-row-align":"start|end|center|stretch","-ms-hyphenate-limit-last":"none|always|column|page|spread","-webkit-background-clip":"[<visual-box>|border|padding|content|text]#","-webkit-column-break-after":"always|auto|avoid","-webkit-column-break-before":"always|auto|avoid","-webkit-column-break-inside":"always|auto|avoid","-webkit-font-smoothing":"auto|none|antialiased|subpixel-antialiased","-webkit-mask-box-image":"[<url>|<gradient>|none] [<length-percentage>{4} <-webkit-mask-box-repeat>{2}]?","-webkit-print-color-adjust":"economy|exact","-webkit-text-security":"none|circle|disc|square","-webkit-user-drag":"none|element|auto",behavior:"<url>+",cue:"<'cue-before'> <'cue-after'>?","cue-after":"<url> <decibel>?|none","cue-before":"<url> <decibel>?|none","glyph-orientation-horizontal":"<angle>","glyph-orientation-vertical":"<angle>",kerning:"auto|<svg-length>",pause:"<'pause-before'> <'pause-after'>?","pause-after":"<time>|none|x-weak|weak|medium|strong|x-strong","pause-before":"<time>|none|x-weak|weak|medium|strong|x-strong","position-try-options":"<'position-try-fallbacks'>",rest:"<'rest-before'> <'rest-after'>?","rest-after":"<time>|none|x-weak|weak|medium|strong|x-strong","rest-before":"<time>|none|x-weak|weak|medium|strong|x-strong",speak:"auto|never|always","voice-balance":"<number>|left|center|right|leftwards|rightwards","voice-duration":"auto|<time>","voice-family":"[[<family-name>|<generic-voice>] ,]* [<family-name>|<generic-voice>]|preserve","voice-pitch":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-range":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-rate":"[normal|x-slow|slow|medium|fast|x-fast]||<percentage>","voice-stress":"normal|strong|moderate|none|reduced","voice-volume":"silent|[[x-soft|soft|medium|loud|x-loud]||<decibel>]","white-space-trim":"none|discard-before||discard-after||discard-inner"},atrules:{charset:{prelude:"<string>",descriptors:null},"counter-style":{prelude:"<counter-style-name>",descriptors:{"additive-symbols":"[<integer [0,\u221E]>&&<symbol>]#",fallback:"<counter-style-name>",negative:"<symbol> <symbol>?",pad:"<integer [0,\u221E]>&&<symbol>",prefix:"<symbol>",range:"[[<integer>|infinite]{2}]#|auto","speak-as":"auto|bullets|numbers|words|spell-out|<counter-style-name>",suffix:"<symbol>",symbols:"<symbol>+",system:"cyclic|numeric|alphabetic|symbolic|additive|[fixed <integer>?]|[extends <counter-style-name>]"}},container:{prelude:"[<container-name>]? <container-condition>",descriptors:null},document:{prelude:"[<url>|url-prefix( <string> )|domain( <string> )|media-document( <string> )|regexp( <string> )]#",descriptors:null},"font-face":{prelude:null,descriptors:{"ascent-override":"normal|<percentage>","descent-override":"normal|<percentage>","font-display":"auto|block|swap|fallback|optional","font-family":"<family-name>","font-feature-settings":"normal|<feature-tag-value>#","font-stretch":"<font-stretch-absolute>{1,2}","font-style":"normal|italic|oblique <angle>{0,2}","font-variation-settings":"normal|[<string> <number>]#","font-weight":"<font-weight-absolute>{1,2}","line-gap-override":"normal|<percentage>","size-adjust":"<percentage>",src:"[<url> [format( <string># )]?|local( <family-name> )]#","unicode-range":"<urange>#"}},"font-feature-values":{prelude:"<family-name>#",descriptors:null},"font-palette-values":{prelude:"<dashed-ident>",descriptors:{"base-palette":"light|dark|<integer [0,\u221E]>","font-family":"<family-name>#","override-colors":"[<integer [0,\u221E]> <color>]#"}},import:{prelude:"[<string>|<url>] [layer|layer( <layer-name> )]? [supports( [<supports-condition>|<declaration>] )]? <media-query-list>?",descriptors:null},keyframes:{prelude:"<keyframes-name>",descriptors:null},layer:{prelude:"[<layer-name>#|<layer-name>?]",descriptors:null},media:{prelude:"<media-query-list>",descriptors:null},namespace:{prelude:"<namespace-prefix>? [<string>|<url>]",descriptors:null},page:{prelude:"<page-selector-list>",descriptors:{bleed:"auto|<length>",marks:"none|[crop||cross]","page-orientation":"upright|rotate-left|rotate-right",size:"<length [0,\u221E]>{1,2}|auto|[<page-size>||[portrait|landscape]]"}},"position-try":{prelude:"<dashed-ident>",descriptors:{top:"<'top'>",left:"<'left'>",bottom:"<'bottom'>",right:"<'right'>","inset-block-start":"<'inset-block-start'>","inset-block-end":"<'inset-block-end'>","inset-inline-start":"<'inset-inline-start'>","inset-inline-end":"<'inset-inline-end'>","inset-block":"<'inset-block'>","inset-inline":"<'inset-inline'>",inset:"<'inset'>","margin-top":"<'margin-top'>","margin-left":"<'margin-left'>","margin-bottom":"<'margin-bottom'>","margin-right":"<'margin-right'>","margin-block-start":"<'margin-block-start'>","margin-block-end":"<'margin-block-end'>","margin-inline-start":"<'margin-inline-start'>","margin-inline-end":"<'margin-inline-end'>",margin:"<'margin'>","margin-block":"<'margin-block'>","margin-inline":"<'margin-inline'>",width:"<'width'>",height:"<'height'>","min-width":"<'min-width'>","min-height":"<'min-height'>","max-width":"<'max-width'>","max-height":"<'max-height'>","block-size":"<'block-size'>","inline-size":"<'inline-size'>","min-block-size":"<'min-block-size'>","min-inline-size":"<'min-inline-size'>","max-block-size":"<'max-block-size'>","max-inline-size":"<'max-inline-size'>","align-self":"<'align-self'>|anchor-center","justify-self":"<'justify-self'>|anchor-center"}},property:{prelude:"<custom-property-name>",descriptors:{inherits:"true|false","initial-value":"<declaration-value>?",syntax:"<string>"}},scope:{prelude:"[( <scope-start> )]? [to ( <scope-end> )]?",descriptors:null},"starting-style":{prelude:null,descriptors:null},supports:{prelude:"<supports-condition>",descriptors:null},"view-transition":{prelude:null,descriptors:{navigation:"auto|none",types:"none|<custom-ident>+"}},"font-features-values":{prelude:"[<string>|<custom-ident>]+",descriptors:{"font-display":"auto|block|swap|fallback|optional"}}}};var At={};f(At,{AnPlusB:()=>pn,Atrule:()=>mn,AtrulePrelude:()=>fn,AttributeSelector:()=>yn,Block:()=>kn,Brackets:()=>vn,CDC:()=>Cn,CDO:()=>Ln,ClassSelector:()=>En,Combinator:()=>In,Comment:()=>Nn,Condition:()=>On,Declaration:()=>Rn,DeclarationList:()=>_n,Dimension:()=>qn,Feature:()=>Un,FeatureFunction:()=>Gn,FeatureRange:()=>Vn,Function:()=>Xn,GeneralEnclosed:()=>Zn,Hash:()=>eo,IdSelector:()=>oo,Identifier:()=>ro,Layer:()=>ao,LayerList:()=>lo,MediaQuery:()=>uo,MediaQueryList:()=>ho,NestingSelector:()=>fo,Nth:()=>bo,Number:()=>xo,Operator:()=>wo,Parentheses:()=>So,Percentage:()=>To,PseudoClassSelector:()=>Ao,PseudoElementSelector:()=>zo,Ratio:()=>Po,Raw:()=>Do,Rule:()=>Fo,Scope:()=>Mo,Selector:()=>_o,SelectorList:()=>qo,String:()=>Yo,StyleSheet:()=>Vo,SupportsDeclaration:()=>Xo,TypeSelector:()=>Jo,UnicodeRange:()=>ri,Url:()=>li,Value:()=>ui,WhiteSpace:()=>hi});var pn={};f(pn,{generate:()=>gu,name:()=>du,parse:()=>un,structure:()=>fu});var fe=43,oe=45,ir=110,Re=!0,mu=!1;function ar(e,t){let r=this.tokenStart+e,n=this.charCodeAt(r);for((n===fe||n===oe)&&(t&&this.error("Number sign is not allowed"),r++);r<this.tokenEnd;r++)M(this.charCodeAt(r))||this.error("Integer is expected",r)}function nt(e){return ar.call(this,0,e)}function ze(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let r="";switch(t){case ir:r="N is expected";break;case oe:r="HyphenMinus is expected";break}this.error(r,this.tokenStart+e)}}function cn(){let e=0,t=0,r=this.tokenType;for(;r===13||r===25;)r=this.lookupType(++e);if(r!==10)if(this.isDelim(fe,e)||this.isDelim(oe,e)){t=this.isDelim(fe,e)?fe:oe;do r=this.lookupType(++e);while(r===13||r===25);r!==10&&(this.skip(e),nt.call(this,Re))}else return null;return e>0&&this.skip(e),t===0&&(r=this.charCodeAt(this.tokenStart),r!==fe&&r!==oe&&this.error("Number sign is expected")),nt.call(this,t!==0),t===oe?"-"+this.consume(10):this.consume(10)}var du="AnPlusB",fu={a:[String,null],b:[String,null]};function un(){let e=this.tokenStart,t=null,r=null;if(this.tokenType===10)nt.call(this,mu),r=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,oe))switch(t="-1",ze.call(this,1,ir),this.tokenEnd-this.tokenStart){case 2:this.next(),r=cn.call(this);break;case 3:ze.call(this,2,oe),this.next(),this.skipSC(),nt.call(this,Re),r="-"+this.consume(10);break;default:ze.call(this,2,oe),ar.call(this,3,Re),this.next(),r=this.substrToCursor(e+2)}else if(this.tokenType===1||this.isDelim(fe)&&this.lookupType(1)===1){let n=0;switch(t="1",this.isDelim(fe)&&(n=1,this.next()),ze.call(this,0,ir),this.tokenEnd-this.tokenStart){case 1:this.next(),r=cn.call(this);break;case 2:ze.call(this,1,oe),this.next(),this.skipSC(),nt.call(this,Re),r="-"+this.consume(10);break;default:ze.call(this,1,oe),ar.call(this,2,Re),this.next(),r=this.substrToCursor(e+n+1)}}else if(this.tokenType===12){let n=this.charCodeAt(this.tokenStart),o=n===fe||n===oe,i=this.tokenStart+o;for(;i<this.tokenEnd&&M(this.charCodeAt(i));i++);i===this.tokenStart+o&&this.error("Integer is expected",this.tokenStart+o),ze.call(this,i-this.tokenStart,ir),t=this.substring(e,i),i+1===this.tokenEnd?(this.next(),r=cn.call(this)):(ze.call(this,i-this.tokenStart+1,oe),i+2===this.tokenEnd?(this.next(),this.skipSC(),nt.call(this,Re),r="-"+this.consume(10)):(ar.call(this,i-this.tokenStart+2,Re),this.next(),r=this.substrToCursor(i+1)))}else this.error();return t!==null&&t.charCodeAt(0)===fe&&(t=t.substr(1)),r!==null&&r.charCodeAt(0)===fe&&(r=r.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:r}}function gu(e){if(e.a){let t=e.a==="+1"&&"n"||e.a==="1"&&"n"||e.a==="-1"&&"-n"||e.a+"n";if(e.b){let r=e.b[0]==="-"||e.b[0]==="+"?e.b:"+"+e.b;this.tokenize(t+r)}else this.tokenize(t)}else this.tokenize(e.b)}var mn={};f(mn,{generate:()=>wu,name:()=>yu,parse:()=>hn,structure:()=>ku,walkContext:()=>xu});function Va(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function bu(){for(let e=1,t;t=this.lookupType(e);e++){if(t===24)return!0;if(t===23||t===3)return!1}return!1}var yu="Atrule",xu="atrule",ku={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function hn(e=!1,{allowNestedRules:t=!1}={}){let r=this.tokenStart,n,o,i=null,a=null;switch(this.eat(3),n=this.substrToCursor(r+1),o=n.toLowerCase(),this.skipSC(),this.eof===!1&&this.tokenType!==23&&this.tokenType!==17&&(this.parseAtrulePrelude?i=this.parseWithFallback(this.AtrulePrelude.bind(this,n,e),Va):i=Va.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case 17:this.next();break;case 23:hasOwnProperty.call(this.atrule,o)&&typeof this.atrule[o].block=="function"?a=this.atrule[o].block.call(this,e,{allowNestedRules:t}):a=this.Block(e||bu.call(this),{allowNestedRules:t});break}return{type:"Atrule",loc:this.getLocation(r,this.tokenStart),name:n,prelude:i,block:a}}function wu(e){this.token(3,"@"+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(17,";")}var fn={};f(fn,{generate:()=>Tu,name:()=>vu,parse:()=>dn,structure:()=>Cu,walkContext:()=>Su});var vu="AtrulePrelude",Su="atrulePrelude",Cu={children:[[]]};function dn(e){let t=null;return e!==null&&(e=e.toLowerCase()),this.skipSC(),hasOwnProperty.call(this.atrule,e)&&typeof this.atrule[e].prelude=="function"?t=this.atrule[e].prelude.call(this):t=this.readSequence(this.scope.AtrulePrelude),this.skipSC(),this.eof!==!0&&this.tokenType!==23&&this.tokenType!==17&&this.error("Semicolon or block is expected"),{type:"AtrulePrelude",loc:this.getLocationFromList(t),children:t}}function Tu(e){this.children(e)}var yn={};f(yn,{generate:()=>Du,name:()=>Pu,parse:()=>bn,structure:()=>Nu});var Lu=36,Qa=42,sr=61,Au=94,gn=124,Eu=126;function zu(){this.eof&&this.error("Unexpected end of input");let e=this.tokenStart,t=!1;return this.isDelim(Qa)?(t=!0,this.next()):this.isDelim(gn)||this.eat(1),this.isDelim(gn)?this.charCodeAt(this.tokenStart+1)!==sr?(this.next(),this.eat(1)):t&&this.error("Identifier is expected",this.tokenEnd):t&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function Iu(){let e=this.tokenStart,t=this.charCodeAt(e);return t!==sr&&t!==Eu&&t!==Au&&t!==Lu&&t!==Qa&&t!==gn&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==sr&&(this.isDelim(sr)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}var Pu="AttributeSelector",Nu={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function bn(){let e=this.tokenStart,t,r=null,n=null,o=null;return this.eat(19),this.skipSC(),t=zu.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(r=Iu.call(this),this.skipSC(),n=this.tokenType===5?this.String():this.Identifier(),this.skipSC()),this.tokenType===1&&(o=this.consume(1),this.skipSC())),this.eat(20),{type:"AttributeSelector",loc:this.getLocation(e,this.tokenStart),name:t,matcher:r,value:n,flags:o}}function Du(e){this.token(9,"["),this.node(e.name),e.matcher!==null&&(this.tokenize(e.matcher),this.node(e.value)),e.flags!==null&&this.token(1,e.flags),this.token(9,"]")}var kn={};f(kn,{generate:()=>Hu,name:()=>qu,parse:()=>xn,structure:()=>Uu,walkContext:()=>ju});var Za=38,Ou=46,Ja=42,es=43,Fu=62,Ru=126,Mu=new Set([Za,Ou,Ja,es,Fu,Ru]);function ts(){return this.Raw(null,!0)}function Xa(){return this.parseWithFallback(this.Rule,ts)}function $a(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function Bu(){if(this.tokenType===17)return $a.call(this,this.tokenIndex);let e=this.parseWithFallback(this.Declaration,$a);return this.tokenType===17&&this.next(),e}function _u(){if(this.tokenType!==1)return!1;let e=this.lookupTypeNonSC(1);if(e!==16&&e!==17&&e!==24)return!0;if(e===16){let t=this.lookupTypeNonSC(2);if(t===1||t===2){let r=3,n;for(;r<=15;){if(n=this.lookupType(r),n===23)return!0;if(n===17||n===24)return!1;if(n===13||n===25){r++;continue}else r++}}return!1}return!1}function Wu(){if(this.tokenType===9&&Mu.has(this.source.charCodeAt(this.tokenStart))){let e=this.source.charCodeAt(this.tokenStart);if(e===Ja||e===es||e===Za){let t=this.lookupType(1),r=this.lookupTypeNonSC(1);if(t===1&&r===1)return!1}return!0}return this.tokenType===4?!0:this.tokenType===19||this.tokenType===16||_u.call(this)}var qu="Block",ju="block",Uu={children:[["Atrule","Rule","Declaration"]]};function xn(e,{allowNestedRules:t=!1}={}){let r=this.tokenStart,n=this.createList();this.eat(23);e:for(;!this.eof;)switch(this.tokenType){case 24:break e;case 13:case 25:this.next();break;case 3:n.push(this.parseWithFallback(this.Atrule.bind(this,e,{allowNestedRules:t}),ts));break;default:e?t&&Wu.call(this)?n.push(Xa.call(this)):n.push(Bu.call(this)):n.push(Xa.call(this))}return this.eof||this.eat(24),{type:"Block",loc:this.getLocation(r,this.tokenStart),children:n}}function Hu(e){this.token(23,"{"),this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")}),this.token(24,"}")}var vn={};f(vn,{generate:()=>Ku,name:()=>Gu,parse:()=>wn,structure:()=>Yu});var Gu="Brackets",Yu={children:[[]]};function wn(e,t){let r=this.tokenStart,n=null;return this.eat(19),n=e.call(this,t),this.eof||this.eat(20),{type:"Brackets",loc:this.getLocation(r,this.tokenStart),children:n}}function Ku(e){this.token(9,"["),this.children(e),this.token(9,"]")}var Cn={};f(Cn,{generate:()=>Xu,name:()=>Vu,parse:()=>Sn,structure:()=>Qu});var Vu="CDC",Qu={};function Sn(){let e=this.tokenStart;return this.eat(15),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function Xu(){this.token(15,"-->")}var Ln={};f(Ln,{generate:()=>Ju,name:()=>$u,parse:()=>Tn,structure:()=>Zu});var $u="CDO",Zu={};function Tn(){let e=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function Ju(){this.token(14,"<!--")}var En={};f(En,{generate:()=>np,name:()=>tp,parse:()=>An,structure:()=>rp});var ep=46,tp="ClassSelector",rp={name:String};function An(){return this.eatDelim(ep),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function np(e){this.token(9,"."),this.token(1,e.name)}var In={};f(In,{generate:()=>cp,name:()=>sp,parse:()=>zn,structure:()=>lp});var op=43,rs=47,ip=62,ap=126,sp="Combinator",lp={name:String};function zn(){let e=this.tokenStart,t;switch(this.tokenType){case 13:t=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case ip:case op:case ap:this.next();break;case rs:this.next(),this.eatIdent("deep"),this.eatDelim(rs);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e);break}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function cp(e){this.tokenize(e.name)}var Nn={};f(Nn,{generate:()=>dp,name:()=>hp,parse:()=>Pn,structure:()=>mp});var up=42,pp=47,hp="Comment",mp={value:String};function Pn(){let e=this.tokenStart,t=this.tokenEnd;return this.eat(25),t-e+2>=2&&this.charCodeAt(t-2)===up&&this.charCodeAt(t-1)===pp&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function dp(e){this.token(25,"/*"+e.value+"*/")}var On={};f(On,{generate:()=>xp,name:()=>gp,parse:()=>Dn,structure:()=>bp});var fp=new Set([16,22,0]),gp="Condition",bp={kind:String,children:[["Identifier","Feature","FeatureFunction","FeatureRange","SupportsDeclaration"]]};function ns(e){return this.lookupTypeNonSC(1)===1&&fp.has(this.lookupTypeNonSC(2))?this.Feature(e):this.FeatureRange(e)}var yp={media:ns,container:ns,supports(){return this.SupportsDeclaration()}};function Dn(e="media"){let t=this.createList();e:for(;!this.eof;)switch(this.tokenType){case 25:case 13:this.next();continue;case 1:t.push(this.Identifier());break;case 21:{let r=this.parseWithFallback(()=>yp[e].call(this,e),()=>null);r||(r=this.parseWithFallback(()=>{this.eat(21);let n=this.Condition(e);return this.eat(22),n},()=>this.GeneralEnclosed(e))),t.push(r);break}case 2:{let r=this.parseWithFallback(()=>this.FeatureFunction(e),()=>null);r||(r=this.GeneralEnclosed(e)),t.push(r);break}default:break e}return t.isEmpty&&this.error("Condition is expected"),{type:"Condition",loc:this.getLocationFromList(t),kind:e,children:t}}function xp(e){e.children.forEach(t=>{t.type==="Condition"?(this.token(21,"("),this.node(t),this.token(22,")")):this.node(t)})}var Rn={};f(Rn,{generate:()=>Pp,name:()=>Ep,parse:()=>Fn,structure:()=>Ip,walkContext:()=>zp});var is=33,kp=35,wp=36,vp=38,Sp=42,Cp=43,os=47;function Tp(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function Lp(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function Ap(){let e=this.tokenIndex,t=this.Value();return t.type!=="Raw"&&this.eof===!1&&this.tokenType!==17&&this.isDelim(is)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}var Ep="Declaration",zp="declaration",Ip={important:[Boolean,String],property:String,value:["Value","Raw"]};function Fn(){let e=this.tokenStart,t=this.tokenIndex,r=Np.call(this),n=Kt(r),o=n?this.parseCustomProperty:this.parseValue,i=n?Lp:Tp,a=!1,c;this.skipSC(),this.eat(16);let u=this.tokenIndex;if(n||this.skipSC(),o?c=this.parseWithFallback(Ap,i):c=i.call(this,this.tokenIndex),n&&c.type==="Value"&&c.children.isEmpty){for(let s=u-this.tokenIndex;s<=0;s++)if(this.lookupType(s)===13){c.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}return this.isDelim(is)&&(a=Dp.call(this),this.skipSC()),this.eof===!1&&this.tokenType!==17&&this.isBalanceEdge(t)===!1&&this.error(),{type:"Declaration",loc:this.getLocation(e,this.tokenStart),important:a,property:r,value:c}}function Pp(e){this.token(1,e.property),this.token(16,":"),this.node(e.value),e.important&&(this.token(9,"!"),this.token(1,e.important===!0?"important":e.important))}function Np(){let e=this.tokenStart;if(this.tokenType===9)switch(this.charCodeAt(this.tokenStart)){case Sp:case wp:case Cp:case kp:case vp:this.next();break;case os:this.next(),this.isDelim(os)&&this.next();break}return this.tokenType===4?this.eat(4):this.eat(1),this.substrToCursor(e)}function Dp(){this.eat(9),this.skipSC();let e=this.consume(1);return e==="important"?!0:e}var _n={};f(_n,{generate:()=>Gp,name:()=>Up,parse:()=>Bn,structure:()=>Hp});var Op=38,Fp=46,Rp=42,Mp=43,Bp=62,_p=126,Wp=new Set([Op,Fp,Rp,Mp,Bp,_p]);function Mn(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function qp(){if(this.tokenType!==1)return!1;let e=this.lookupTypeNonSC(1);return e===23?!0:e===17||e===18||e===24?!1:e===16&&this.lookupTypeNonSC(2)===1?this.lookupTypeNonSC(3)===23:!1}function jp(){return this.tokenType===9&&Wp.has(this.source.charCodeAt(this.tokenStart))||this.tokenType===4||this.tokenType===19||this.tokenType===16||qp.call(this)}var Up="DeclarationList",Hp={children:[["Declaration","Atrule","Rule"]]};function Bn(){let e=this.createList();for(;!this.eof;)switch(this.tokenType){case 13:case 25:case 17:this.next();break;case 3:e.push(this.parseWithFallback(this.Atrule.bind(this,!0),Mn));break;default:jp.call(this)?e.push(this.parseWithFallback(this.Rule,Mn)):e.push(this.parseWithFallback(this.Declaration,Mn))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function Gp(e){this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")})}var qn={};f(qn,{generate:()=>Vp,name:()=>Yp,parse:()=>Wn,structure:()=>Kp});var Yp="Dimension",Kp={value:String,unit:String};function Wn(){let e=this.tokenStart,t=this.consumeNumber(12);return{type:"Dimension",loc:this.getLocation(e,this.tokenStart),value:t,unit:this.substring(e+t.length,this.tokenStart)}}function Vp(e){this.token(12,e.value+e.unit)}var Un={};f(Un,{generate:()=>Zp,name:()=>Xp,parse:()=>jn,structure:()=>$p});var Qp=47,Xp="Feature",$p={kind:String,name:String,value:["Identifier","Number","Dimension","Ratio","Function",null]};function jn(e){let t=this.tokenStart,r,n=null;if(this.eat(21),this.skipSC(),r=this.consume(1),this.skipSC(),this.tokenType!==22){switch(this.eat(16),this.skipSC(),this.tokenType){case 10:this.lookupNonWSType(1)===9?n=this.Ratio():n=this.Number();break;case 12:n=this.Dimension();break;case 1:n=this.Identifier();break;case 2:n=this.parseWithFallback(()=>{let o=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(Qp)&&this.error(),o},()=>this.Ratio());break;default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}return this.eof||this.eat(22),{type:"Feature",loc:this.getLocation(t,this.tokenStart),kind:e,name:r,value:n}}function Zp(e){this.token(21,"("),this.token(1,e.name),e.value!==null&&(this.token(16,":"),this.node(e.value)),this.token(22,")")}var Gn={};f(Gn,{generate:()=>rh,name:()=>Jp,parse:()=>Hn,structure:()=>eh});var Jp="FeatureFunction",eh={kind:String,feature:String,value:["Declaration","Selector"]};function th(e,t){let n=(this.features[e]||{})[t];return typeof n!="function"&&this.error(`Unknown feature ${t}()`),n}function Hn(e="unknown"){let t=this.tokenStart,r=this.consumeFunctionName(),n=th.call(this,e,r.toLowerCase());this.skipSC();let o=this.parseWithFallback(()=>{let i=this.tokenIndex,a=n.call(this);return this.eof===!1&&this.isBalanceEdge(i)===!1&&this.error(),a},()=>this.Raw(null,!1));return this.eof||this.eat(22),{type:"FeatureFunction",loc:this.getLocation(t,this.tokenStart),kind:e,feature:r,value:o}}function rh(e){this.token(2,e.feature+"("),this.node(e.value),this.token(22,")")}var Vn={};f(Vn,{generate:()=>sh,name:()=>ih,parse:()=>Kn,structure:()=>ah});var as=47,nh=60,ss=61,oh=62,ih="FeatureRange",ah={kind:String,left:["Identifier","Number","Dimension","Ratio","Function"],leftComparison:String,middle:["Identifier","Number","Dimension","Ratio","Function"],rightComparison:[String,null],right:["Identifier","Number","Dimension","Ratio","Function",null]};function Yn(){switch(this.skipSC(),this.tokenType){case 10:return this.isDelim(as,this.lookupOffsetNonSC(1))?this.Ratio():this.Number();case 12:return this.Dimension();case 1:return this.Identifier();case 2:return this.parseWithFallback(()=>{let e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(as)&&this.error(),e},()=>this.Ratio());default:this.error("Number, dimension, ratio or identifier is expected")}}function ls(e){if(this.skipSC(),this.isDelim(nh)||this.isDelim(oh)){let t=this.source[this.tokenStart];return this.next(),this.isDelim(ss)?(this.next(),t+"="):t}if(this.isDelim(ss))return"=";this.error(`Expected ${e?'":", ':""}"<", ">", "=" or ")"`)}function Kn(e="unknown"){let t=this.tokenStart;this.skipSC(),this.eat(21);let r=Yn.call(this),n=ls.call(this,r.type==="Identifier"),o=Yn.call(this),i=null,a=null;return this.lookupNonWSType(0)!==22&&(i=ls.call(this),a=Yn.call(this)),this.skipSC(),this.eat(22),{type:"FeatureRange",loc:this.getLocation(t,this.tokenStart),kind:e,left:r,leftComparison:n,middle:o,rightComparison:i,right:a}}function sh(e){this.token(21,"("),this.node(e.left),this.tokenize(e.leftComparison),this.node(e.middle),e.right&&(this.tokenize(e.rightComparison),this.node(e.right)),this.token(22,")")}var Xn={};f(Xn,{generate:()=>ph,name:()=>lh,parse:()=>Qn,structure:()=>uh,walkContext:()=>ch});var lh="Function",ch="function",uh={name:String,children:[[]]};function Qn(e,t){let r=this.tokenStart,n=this.consumeFunctionName(),o=n.toLowerCase(),i;return i=t.hasOwnProperty(o)?t[o].call(this,t):e.call(this,t),this.eof||this.eat(22),{type:"Function",loc:this.getLocation(r,this.tokenStart),name:n,children:i}}function ph(e){this.token(2,e.name+"("),this.children(e),this.token(22,")")}var Zn={};f(Zn,{generate:()=>dh,name:()=>hh,parse:()=>$n,structure:()=>mh});var hh="GeneralEnclosed",mh={kind:String,function:[String,null],children:[[]]};function $n(e){let t=this.tokenStart,r=null;this.tokenType===2?r=this.consumeFunctionName():this.eat(21);let n=this.parseWithFallback(()=>{let o=this.tokenIndex,i=this.readSequence(this.scope.Value);return this.eof===!1&&this.isBalanceEdge(o)===!1&&this.error(),i},()=>this.createSingleNodeList(this.Raw(null,!1)));return this.eof||this.eat(22),{type:"GeneralEnclosed",loc:this.getLocation(t,this.tokenStart),kind:e,function:r,children:n}}function dh(e){e.function?this.token(2,e.function+"("):this.token(21,"("),this.children(e),this.token(22,")")}var eo={};f(eo,{generate:()=>yh,name:()=>gh,parse:()=>Jn,structure:()=>bh,xxx:()=>fh});var fh="XXX",gh="Hash",bh={value:String};function Jn(){let e=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function yh(e){this.token(4,"#"+e.value)}var ro={};f(ro,{generate:()=>wh,name:()=>xh,parse:()=>to,structure:()=>kh});var xh="Identifier",kh={name:String};function to(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function wh(e){this.token(1,e.name)}var oo={};f(oo,{generate:()=>Ch,name:()=>vh,parse:()=>no,structure:()=>Sh});var vh="IdSelector",Sh={name:String};function no(){let e=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function Ch(e){this.token(9,"#"+e.name)}var ao={};f(ao,{generate:()=>Eh,name:()=>Lh,parse:()=>io,structure:()=>Ah});var Th=46,Lh="Layer",Ah={name:String};function io(){let e=this.tokenStart,t=this.consume(1);for(;this.isDelim(Th);)this.eat(9),t+="."+this.consume(1);return{type:"Layer",loc:this.getLocation(e,this.tokenStart),name:t}}function Eh(e){this.tokenize(e.name)}var lo={};f(lo,{generate:()=>Ph,name:()=>zh,parse:()=>so,structure:()=>Ih});var zh="LayerList",Ih={children:[["Layer"]]};function so(){let e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.Layer()),this.lookupTypeNonSC(0)===18);)this.skipSC(),this.next(),this.skipSC();return{type:"LayerList",loc:this.getLocationFromList(e),children:e}}function Ph(e){this.children(e,()=>this.token(18,","))}var uo={};f(uo,{generate:()=>Oh,name:()=>Nh,parse:()=>co,structure:()=>Dh});var Nh="MediaQuery",Dh={modifier:[String,null],mediaType:[String,null],condition:["Condition",null]};function co(){let e=this.tokenStart,t=null,r=null,n=null;if(this.skipSC(),this.tokenType===1&&this.lookupTypeNonSC(1)!==21){let o=this.consume(1),i=o.toLowerCase();switch(i==="not"||i==="only"?(this.skipSC(),t=i,r=this.consume(1)):r=o,this.lookupTypeNonSC(0)){case 1:{this.skipSC(),this.eatIdent("and"),n=this.Condition("media");break}case 23:case 17:case 18:case 0:break;default:this.error("Identifier or parenthesis is expected")}}else switch(this.tokenType){case 1:case 21:case 2:{n=this.Condition("media");break}case 23:case 17:case 0:break;default:this.error("Identifier or parenthesis is expected")}return{type:"MediaQuery",loc:this.getLocation(e,this.tokenStart),modifier:t,mediaType:r,condition:n}}function Oh(e){e.mediaType?(e.modifier&&this.token(1,e.modifier),this.token(1,e.mediaType),e.condition&&(this.token(1,"and"),this.node(e.condition))):e.condition&&this.node(e.condition)}var ho={};f(ho,{generate:()=>Mh,name:()=>Fh,parse:()=>po,structure:()=>Rh});var Fh="MediaQueryList",Rh={children:[["MediaQuery"]]};function po(){let e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.MediaQuery()),this.tokenType===18);)this.next();return{type:"MediaQueryList",loc:this.getLocationFromList(e),children:e}}function Mh(e){this.children(e,()=>this.token(18,","))}var fo={};f(fo,{generate:()=>qh,name:()=>_h,parse:()=>mo,structure:()=>Wh});var Bh=38,_h="NestingSelector",Wh={};function mo(){let e=this.tokenStart;return this.eatDelim(Bh),{type:"NestingSelector",loc:this.getLocation(e,this.tokenStart)}}function qh(){this.token(9,"&")}var bo={};f(bo,{generate:()=>Hh,name:()=>jh,parse:()=>go,structure:()=>Uh});var jh="Nth",Uh={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function go(){this.skipSC();let e=this.tokenStart,t=e,r=null,n;return this.lookupValue(0,"odd")||this.lookupValue(0,"even")?n=this.Identifier():n=this.AnPlusB(),t=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),r=this.SelectorList(),t=this.tokenStart),{type:"Nth",loc:this.getLocation(e,t),nth:n,selector:r}}function Hh(e){this.node(e.nth),e.selector!==null&&(this.token(1,"of"),this.node(e.selector))}var xo={};f(xo,{generate:()=>Kh,name:()=>Gh,parse:()=>yo,structure:()=>Yh});var Gh="Number",Yh={value:String};function yo(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(10)}}function Kh(e){this.token(10,e.value)}var wo={};f(wo,{generate:()=>Xh,name:()=>Vh,parse:()=>ko,structure:()=>Qh});var Vh="Operator",Qh={value:String};function ko(){let e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function Xh(e){this.tokenize(e.value)}var So={};f(So,{generate:()=>Jh,name:()=>$h,parse:()=>vo,structure:()=>Zh});var $h="Parentheses",Zh={children:[[]]};function vo(e,t){let r=this.tokenStart,n=null;return this.eat(21),n=e.call(this,t),this.eof||this.eat(22),{type:"Parentheses",loc:this.getLocation(r,this.tokenStart),children:n}}function Jh(e){this.token(21,"("),this.children(e),this.token(22,")")}var To={};f(To,{generate:()=>rm,name:()=>em,parse:()=>Co,structure:()=>tm});var em="Percentage",tm={value:String};function Co(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function rm(e){this.token(11,e.value+"%")}var Ao={};f(Ao,{generate:()=>am,name:()=>nm,parse:()=>Lo,structure:()=>im,walkContext:()=>om});var nm="PseudoClassSelector",om="function",im={name:String,children:[["Raw"],null]};function Lo(){let e=this.tokenStart,t=null,r,n;return this.eat(16),this.tokenType===2?(r=this.consumeFunctionName(),n=r.toLowerCase(),this.lookupNonWSType(0)==22?t=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),t=this.pseudo[n].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(22)):r=this.consume(1),{type:"PseudoClassSelector",loc:this.getLocation(e,this.tokenStart),name:r,children:t}}function am(e){this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var zo={};f(zo,{generate:()=>um,name:()=>sm,parse:()=>Eo,structure:()=>cm,walkContext:()=>lm});var sm="PseudoElementSelector",lm="function",cm={name:String,children:[["Raw"],null]};function Eo(){let e=this.tokenStart,t=null,r,n;return this.eat(16),this.eat(16),this.tokenType===2?(r=this.consumeFunctionName(),n=r.toLowerCase(),this.lookupNonWSType(0)==22?t=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),t=this.pseudo[n].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(22)):r=this.consume(1),{type:"PseudoElementSelector",loc:this.getLocation(e,this.tokenStart),name:r,children:t}}function um(e){this.token(16,":"),this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var Po={};f(Po,{generate:()=>mm,name:()=>pm,parse:()=>Io,structure:()=>hm});var cs=47;function us(){switch(this.skipSC(),this.tokenType){case 10:return this.Number();case 2:return this.Function(this.readSequence,this.scope.Value);default:this.error("Number of function is expected")}}var pm="Ratio",hm={left:["Number","Function"],right:["Number","Function",null]};function Io(){let e=this.tokenStart,t=us.call(this),r=null;return this.skipSC(),this.isDelim(cs)&&(this.eatDelim(cs),r=us.call(this)),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:r}}function mm(e){this.node(e.left),this.token(9,"/"),e.right?this.node(e.right):this.node(10,1)}var Do={};f(Do,{generate:()=>bm,name:()=>fm,parse:()=>No,structure:()=>gm});function dm(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}var fm="Raw",gm={value:String};function No(e,t){let r=this.getTokenStart(this.tokenIndex),n;return this.skipUntilBalanced(this.tokenIndex,e||this.consumeUntilBalanceEnd),t&&this.tokenStart>r?n=dm.call(this):n=this.tokenStart,{type:"Raw",loc:this.getLocation(r,n),value:this.substring(r,n)}}function bm(e){this.tokenize(e.value)}var Fo={};f(Fo,{generate:()=>vm,name:()=>xm,parse:()=>Oo,structure:()=>wm,walkContext:()=>km});function ps(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function ym(){let e=this.SelectorList();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==23&&this.error(),e}var xm="Rule",km="rule",wm={prelude:["SelectorList","Raw"],block:["Block"]};function Oo(){let e=this.tokenIndex,t=this.tokenStart,r,n;return this.parseRulePrelude?r=this.parseWithFallback(ym,ps):r=ps.call(this,e),n=this.Block(!0,{allowNestedRules:!0}),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:r,block:n}}function vm(e){this.node(e.prelude),this.node(e.block)}var Mo={};f(Mo,{generate:()=>Tm,name:()=>Sm,parse:()=>Ro,structure:()=>Cm});var Sm="Scope",Cm={root:["SelectorList","Raw",null],limit:["SelectorList","Raw",null]};function Ro(){let e=null,t=null;this.skipSC();let r=this.tokenStart;return this.tokenType===21&&(this.next(),this.skipSC(),e=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(22)),this.lookupNonWSType(0)===1&&(this.skipSC(),this.eatIdent("to"),this.skipSC(),this.eat(21),this.skipSC(),t=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(22)),{type:"Scope",loc:this.getLocation(r,this.tokenStart),root:e,limit:t}}function Tm(e){e.root&&(this.token(21,"("),this.node(e.root),this.token(22,")")),e.limit&&(this.token(1,"to"),this.token(21,"("),this.node(e.limit),this.token(22,")"))}var _o={};f(_o,{generate:()=>Em,name:()=>Lm,parse:()=>Bo,structure:()=>Am});var Lm="Selector",Am={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator"]]};function Bo(){let e=this.readSequence(this.scope.Selector);return this.getFirstListNode(e)===null&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(e),children:e}}function Em(e){this.children(e)}var qo={};f(qo,{generate:()=>Nm,name:()=>zm,parse:()=>Wo,structure:()=>Pm,walkContext:()=>Im});var zm="SelectorList",Im="selector",Pm={children:[["Selector","Raw"]]};function Wo(){let e=this.createList();for(;!this.eof;){if(e.push(this.Selector()),this.tokenType===18){this.next();continue}break}return{type:"SelectorList",loc:this.getLocationFromList(e),children:e}}function Nm(e){this.children(e,()=>this.token(18,","))}var Yo={};f(Yo,{generate:()=>Fm,name:()=>Dm,parse:()=>Go,structure:()=>Om});var Ho={};f(Ho,{decode:()=>Tt,encode:()=>Uo});var jo=92,hs=34,ms=39;function Tt(e){let t=e.length,r=e.charCodeAt(0),n=r===hs||r===ms?1:0,o=n===1&&t>1&&e.charCodeAt(t-1)===r?t-2:t-1,i="";for(let a=n;a<=o;a++){let c=e.charCodeAt(a);if(c===jo){if(a===o){a!==t-1&&(i=e.substr(a+1));break}if(c=e.charCodeAt(++a),$(jo,c)){let u=a-1,s=le(e,u);a=s-1,i+=He(e.substring(u+1,s))}else c===13&&e.charCodeAt(a+1)===10&&a++}else i+=e[a]}return i}function Uo(e,t){let r=t?"'":'"',n=t?ms:hs,o="",i=!1;for(let a=0;a<e.length;a++){let c=e.charCodeAt(a);if(c===0){o+="\uFFFD";continue}if(c<=31||c===127){o+="\\"+c.toString(16),i=!0;continue}c===n||c===jo?(o+="\\"+e.charAt(a),i=!1):(i&&(te(c)||me(c))&&(o+=" "),o+=e.charAt(a),i=!1)}return r+o+r}var Dm="String",Om={value:String};function Go(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:Tt(this.consume(5))}}function Fm(e){this.token(5,Uo(e.value))}var Vo={};f(Vo,{generate:()=>Wm,name:()=>Mm,parse:()=>Ko,structure:()=>_m,walkContext:()=>Bm});var Rm=33;function ds(){return this.Raw(null,!1)}var Mm="StyleSheet",Bm="stylesheet",_m={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function Ko(){let e=this.tokenStart,t=this.createList(),r;for(;!this.eof;){switch(this.tokenType){case 13:this.next();continue;case 25:if(this.charCodeAt(this.tokenStart+2)!==Rm){this.next();continue}r=this.Comment();break;case 14:r=this.CDO();break;case 15:r=this.CDC();break;case 3:r=this.parseWithFallback(this.Atrule,ds);break;default:r=this.parseWithFallback(this.Rule,ds)}t.push(r)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function Wm(e){this.children(e)}var Xo={};f(Xo,{generate:()=>Um,name:()=>qm,parse:()=>Qo,structure:()=>jm});var qm="SupportsDeclaration",jm={declaration:"Declaration"};function Qo(){let e=this.tokenStart;this.eat(21),this.skipSC();let t=this.Declaration();return this.eof||this.eat(22),{type:"SupportsDeclaration",loc:this.getLocation(e,this.tokenStart),declaration:t}}function Um(e){this.token(21,"("),this.node(e.declaration),this.token(22,")")}var Jo={};f(Jo,{generate:()=>Ym,name:()=>Hm,parse:()=>Zo,structure:()=>Gm});var fs=42,gs=124;function $o(){if(this.tokenType!==1&&this.isDelim(fs)===!1&&this.error("Identifier or asterisk is expected"),this.isDelim(fs)){let e=this.tokenStart+1;this.next(),this.tokenType===1&&this.tokenStart===e&&this.error("Whitespace is required between universal selector and type selector");return}this.next()}var Hm="TypeSelector",Gm={name:String};function Zo(){let e=this.tokenStart;return this.isDelim(gs)?(this.next(),$o.call(this)):($o.call(this),this.isDelim(gs)&&(this.next(),$o.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function Ym(e){this.tokenize(e.name)}var ri={};f(ri,{generate:()=>$m,name:()=>Qm,parse:()=>ti,structure:()=>Xm});var bs=43,ys=45,ei=63;function Lt(e,t){let r=0;for(let n=this.tokenStart+e;n<this.tokenEnd;n++){let o=this.charCodeAt(n);if(o===ys&&t&&r!==0)return Lt.call(this,e+r+1,!1),-1;te(o)||this.error(t&&r!==0?"Hyphen minus"+(r<6?" or hex digit":"")+" is expected":r<6?"Hex digit is expected":"Unexpected input",n),++r>6&&this.error("Too many hex digits",n)}return this.next(),r}function lr(e){let t=0;for(;this.isDelim(ei);)++t>e&&this.error("Too many question marks"),this.next()}function Km(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===bs?"Plus sign":"Hyphen minus")+" is expected")}function Vm(){let e=0;switch(this.tokenType){case 10:if(e=Lt.call(this,1,!0),this.isDelim(ei)){lr.call(this,6-e);break}if(this.tokenType===12||this.tokenType===10){Km.call(this,ys),Lt.call(this,1,!1);break}break;case 12:e=Lt.call(this,1,!0),e>0&&lr.call(this,6-e);break;default:if(this.eatDelim(bs),this.tokenType===1){e=Lt.call(this,0,!0),e>0&&lr.call(this,6-e);break}if(this.isDelim(ei)){this.next(),lr.call(this,5);break}this.error("Hex digit or question mark is expected")}}var Qm="UnicodeRange",Xm={value:String};function ti(){let e=this.tok8*enStart;return this.eatIdent("u"),Vm.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function $m(e){this.tokenize(e.value)}var li={};f(li,{generate:()=>od,name:()=>rd,parse:()=>si,structure:()=>nd});var ai={};f(ai,{decode:()=>oi,encode:()=>ii});var Zm=32,ni=92,Jm=34,ed=39,td=40,xs=41;function oi(e){let t=e.length,r=4,n=e.charCodeAt(t-1)===xs?t-2:t-1,o="";for(;r<n&&me(e.charCodeAt(r));)r++;for(;r<n&&me(e.charCodeAt(n));)n--;for(let i=r;i<=n;i++){let a=e.charCodeAt(i);if(a===ni){if(i===n){i!==t-1&&(o=e.substr(i+1));break}if(a=e.charCodeAt(++i),$(ni,a)){let c=i-1,u=le(e,c);i=u-1,o+=He(e.substring(c+1,u))}else a===13&&e.charCodeAt(i+1)===10&&i++}else o+=e[i]}return o}function ii(e){let t="",r=!1;for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);if(o===0){t+="\uFFFD";continue}if(o<=31||o===127){t+="\\"+o.toString(16),r=!0;continue}o===Zm||o===ni||o===Jm||o===ed||o===td||o===xs?(t+="\\"+e.charAt(n),r=!1):(r&&te(o)&&(t+=" "),t+=e.charAt(n),r=!1)}return"url("+t+")"}var rd="Url",nd={value:String};function si(){let e=this.tokenStart,t;switch(this.tokenType){case 7:t=oi(this.consume(7));break;case 2:this.cmpStr(this.tokenStart,this.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(2),this.skipSC(),t=Tt(this.consume(5)),this.skipSC(),this.eof||this.eat(22);break;default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(e,this.tokenStart),value:t}}function od(e){this.token(7,ii(e.value))}var ui={};f(ui,{generate:()=>sd,name:()=>id,parse:()=>ci,structure:()=>ad});var id="Value",ad={children:[[]]};function ci(){let e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function sd(e){this.children(e)}var hi={};f(hi,{generate:()=>pd,name:()=>cd,parse:()=>pi,structure:()=>ud});var ld=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),cd="WhiteSpace",ud={value:String};function pi(){return this.eat(13),ld}function pd(e){this.token(13,e.value)}var ks={generic:!0,cssWideKeywords:Xe,...Ka,node:At};var mi={};f(mi,{AtrulePrelude:()=>vs,Selector:()=>Cs,Value:()=>Es});var hd=35,md=42,ws=43,dd=45,fd=47,gd=117;function Et(e){switch(this.tokenType){case 4:return this.Hash();case 18:return this.Operator();case 21:return this.Parentheses(this.readSequence,e.recognizer);case 19:return this.Brackets(this.readSequence,e.recognizer);case 5:return this.String();case 12:return this.Dimension();case 11:return this.Percentage();case 10:return this.Number();case 2:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,e.recognizer);case 7:return this.Url();case 1:return this.cmpChar(this.tokenStart,gd)&&this.cmpChar(this.tokenStart+1,ws)?this.UnicodeRange():this.Identifier();case 9:{let t=this.charCodeAt(this.tokenStart);if(t===fd||t===md||t===ws||t===dd)return this.Operator();t===hd&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}var vs={getNode:Et};var bd=35,yd=38,xd=42,kd=43,wd=47,Ss=46,vd=62,Sd=124,Cd=126;function Td(e,t){t.last!==null&&t.last.type!=="Combinator"&&e!==null&&e.type!=="Combinator"&&t.push({type:"Combinator",loc:null,name:" "})}function Ld(){switch(this.tokenType){case 19:return this.AttributeSelector();case 4:return this.IdSelector();case 16:return this.lookupType(1)===16?this.PseudoElementSelector():this.PseudoClassSelector();case 1:return this.TypeSelector();case 10:case 11:return this.Percentage();case 12:this.charCodeAt(this.tokenStart)===Ss&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:{switch(this.charCodeAt(this.tokenStart)){case kd:case vd:case Cd:case wd:return this.Combinator();case Ss:return this.ClassSelector();case xd:case Sd:return this.TypeSelector();case bd:return this.IdSelector();case yd:return this.NestingSelector()}break}}}var Cs={onWhiteSpace:Td,getNode:Ld};function Ts(){return this.createSingleNodeList(this.Raw(null,!1))}function Ls(){let e=this.createList();if(this.skipSC(),e.push(this.Identifier()),this.skipSC(),this.tokenType===18){e.push(this.Operator());let t=this.tokenIndex,r=this.parseCustomProperty?this.Value(null):this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1);if(r.type==="Value"&&r.children.isEmpty){for(let n=t-this.tokenIndex;n<=0;n++)if(this.lookupType(n)===13){r.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}e.push(r)}return e}function As(e){return e!==null&&e.type==="Operator"&&(e.value[e.value.length-1]==="-"||e.value[e.value.length-1]==="+")}var Es={getNode:Et,onWhiteSpace(e,t){As(e)&&(e.value=" "+e.value),As(t.last)&&(t.last.value+=" ")},expression:Ts,var:Ls};var Ad=new Set(["none","and","not","or"]),zs={parse:{prelude(){let e=this.createList();if(this.tokenType===1){let t=this.substring(this.tokenStart,this.tokenEnd);Ad.has(t.toLowerCase())||e.push(this.Identifier())}return e.push(this.Condition("container")),e},block(e=!1){return this.Block(e)}}};var Is={parse:{prelude:null,block(){return this.Block(!0)}}};function di(e,t){return this.parseWithFallback(()=>{try{return e.call(this)}finally{this.skipSC(),this.lookupNonWSType(0)!==22&&this.error()}},t||(()=>this.Raw(null,!0)))}var Ps={layer(){this.skipSC();let e=this.createList(),t=di.call(this,this.Layer);return(t.type!=="Raw"||t.value!=="")&&e.push(t),e},supports(){this.skipSC();let e=this.createList(),t=di.call(this,this.Declaration,()=>di.call(this,()=>this.Condition("supports")));return(t.type!=="Raw"||t.value!=="")&&e.push(t),e}},Ns={parse:{prelude(){let e=this.createList();switch(this.tokenType){case 5:e.push(this.String());break;case 7:case 2:e.push(this.Url());break;default:this.error("String or url() is expected")}return this.skipSC(),this.tokenType===1&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer")?e.push(this.Identifier()):this.tokenType===2&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer(")&&e.push(this.Function(null,Ps)),this.skipSC(),this.tokenType===2&&this.cmpStr(this.tokenStart,this.tokenEnd,"supports(")&&e.push(this.Function(null,Ps)),(this.lookupNonWSType(0)===1||this.lookupNonWSType(0)===21)&&e.push(this.MediaQueryList()),e},block:null}};var Ds={parse:{prelude(){return this.createSingleNodeList(this.LayerList())},block(e=!1,{allowNestedRules:t=!1}={}){return this.Block(e,{allowNestedRules:t})}}};var Os={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(e=!1,{allowNestedRules:t=!1}={}){return this.Block(e,{allowNestedRules:t})}}};var Fs={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}};var Rs={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}};var Ms={parse:{prelude(){return this.createSingleNodeList(this.Scope())},block(e=!1){return this.Block(e)}}};var Bs={parse:{prelude:null,block(e=!1){return this.Block(e)}}};var _s={parse:{prelude(){return this.createSingleNodeList(this.Condition("supports"))},block(e=!1){return this.Block(e)}}};var Ws={container:zs,"font-face":Is,import:Ns,layer:Ds,media:Os,nest:Fs,page:Rs,scope:Ms,"starting-style":Bs,supports:_s};function qs(){let e=this.createList();this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case 1:e.push(this.Identifier());break;case 5:e.push(this.String());break;case 18:e.push(this.Operator());break;case 22:break e;default:this.error("Identifier, string or comma is expected")}this.skipSC()}return e}var Me={parse(){return this.createSingleNodeList(this.SelectorList())}},fi={parse(){return this.createSingleNodeList(this.Selector())}},Ed={parse(){return this.createSingleNodeList(this.Identifier())}},zd={parse:qs},cr={parse(){return this.createSingleNodeList(this.Nth())}},js={dir:Ed,has:Me,lang:zd,matches:Me,is:Me,"-moz-any":Me,"-webkit-any":Me,where:Me,not:Me,"nth-child":cr,"nth-last-child":cr,"nth-last-of-type":cr,"nth-of-type":cr,slotted:fi,host:fi,"host-context":fi};var gi={};f(gi,{AnPlusB:()=>un,Atrule:()=>hn,AtrulePrelude:()=>dn,AttributeSelector:()=>bn,Block:()=>xn,Brackets:()=>wn,CDC:()=>Sn,CDO:()=>Tn,ClassSelector:()=>An,Combinator:()=>zn,Comment:()=>Pn,Condition:()=>Dn,Declaration:()=>Fn,DeclarationList:()=>Bn,Dimension:()=>Wn,Feature:()=>jn,FeatureFunction:()=>Hn,FeatureRange:()=>Kn,Function:()=>Qn,GeneralEnclosed:()=>$n,Hash:()=>Jn,IdSelector:()=>no,Identifier:()=>to,Layer:()=>io,LayerList:()=>so,MediaQuery:()=>co,MediaQueryList:()=>po,NestingSelector:()=>mo,Nth:()=>go,Number:()=>yo,Operator:()=>ko,Parentheses:()=>vo,Percentage:()=>Co,PseudoClassSelector:()=>Lo,PseudoElementSelector:()=>Eo,Ratio:()=>Io,Raw:()=>No,Rule:()=>Oo,Scope:()=>Ro,Selector:()=>Bo,SelectorList:()=>Wo,String:()=>Go,StyleSheet:()=>Ko,SupportsDeclaration:()=>Qo,TypeSelector:()=>Zo,UnicodeRange:()=>ti,Url:()=>si,Value:()=>ci,WhiteSpace:()=>pi});var Us={parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude(e){return this.AtrulePrelude(e.atrule?String(e.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",condition(e){return this.Condition(e.kind)},rule:"Rule",selectorList:"SelectorList",selector:"Selector",block(){return this.Block(!0)},declarationList:"DeclarationList",declaration:"Declaration",value:"Value"},features:{supports:{selector(){return this.Selector()}},container:{style(){return this.Declaration()}}},scope:mi,atrule:Ws,pseudo:js,node:gi,tokenize:Bt};var Hs={node:At};var Gs=ln({...ks,...Us,...Hs});var Ay="4.0.5";function bi(e){let t={};for(let r of Object.keys(e)){let n=e[r];n&&(Array.isArray(n)||n instanceof V?n=n.map(bi):n.constructor===Object&&(n=bi(n))),t[r]=n}return t}var Ks={};f(Ks,{decode:()=>Id,encode:()=>Pd});var Ys=92;function Id(e){let t=e.length-1,r="";for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);if(o===Ys){if(n===t)break;if(o=e.charCodeAt(++n),$(Ys,o)){let i=n-1,a=le(e,i);n=a-1,r+=He(e.substring(i+1,a))}else o===13&&e.charCodeAt(n+1)===10&&n++}else r+=e[n]}return r}function Pd(e){let t="";if(e.length===1&&e.charCodeAt(0)===45)return"\\-";for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n===0){t+="\uFFFD";continue}if(n<=31||n===127||n>=48&&n<=57&&(r===0||r===1&&e.charCodeAt(0)===45)){t+="\\"+n.toString(16)+" ";continue}qe(n)?t+=e.charAt(r):t+="\\"+e.charAt(r)}return t}var{tokenize:Dy,parse:Oy,generate:Fy,lexer:Ry,createLexer:My,walk:By,find:_y,findLast:Wy,findAll:qy,toPlainObject:jy,fromPlainObject:Uy,fork:Hy}=Gs;export{rt as Lexer,V as List,lt as OffsetToLocation,ct as TokenStream,bi as clone,My as createLexer,ln as createSyntax,Ia as definitionSyntax,_y as find,qy as findAll,Wy as findLast,Hy as fork,Uy as fromPlainObject,Fy as generate,Ks as ident,Kt as isCustomProperty,ft as keyword,Ry as lexer,Oy as parse,zr as property,Ho as string,jy as toPlainObject,De as tokenNames,mr as tokenTypes,Dy as tokenize,ai as url,Nf as vendorPrefix,Ay as version,By as walk};
<Gex   var csstree=(()=>{var Qs=Object.create;var It=Object.defineProperty;var Xs=Object.getOwnPropertyDescriptor;var $s=Object.getOwnPropertyNames;var Zs=Object.getPrototypeOf,Js=Object.prototype.hasOwnProperty;var _e=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),f=(e,t)=>{for(var r in t)It(e,r,{get:t[r],enumerable:!0})},ki=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of $s(t))!Js.call(e,o)&&o!==r&&It(e,o,{get:()=>t[o],enumerable:!(n=Xs(t,o))||n.enumerable});return e};var el=(e,t,r)=>(r=e!=null?Qs(Zs(e)):{},ki(t||!e||!e.__esModule?It(r,"default",{value:e,enumerable:!0}):r,e)),tl=e=>ki(It({},"__esModule",{value:!0}),e);var Oi=_e(Tr=>{var Di="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");Tr.encode=function(e){if(0<=e&&e<Di.length)return Di[e];throw new TypeError("Must be between 0 and 63: "+e)};Tr.decode=function(e){var t=65,r=90,n=97,o=122,i=48,a=57,c=43,u=47,s=26,l=52;return t<=e&&e<=r?e-t:n<=e&&e<=o?e-n+s:i<=e&&e<=a?e-i+l:e==c?62:e==u?63:-1}});var _i=_e(Ar=>{var Fi=Oi(),Lr=5,Ri=1<<Lr,Mi=Ri-1,Bi=Ri;function fl(e){return e<0?(-e<<1)+1:(e<<1)+0}function gl(e){var t=(e&1)===1,r=e>>1;return t?-r:r}Ar.encode=function(t){var r="",n,o=fl(t);do n=o&Mi,o>>>=Lr,o>0&&(n|=Bi),r+=Fi.encode(n);while(o>0);return r};Ar.decode=function(t,r,n){var o=t.length,i=0,a=0,c,u;do{if(r>=o)throw new Error("Expected more digits in base 64 VLQ value.");if(u=Fi.decode(t.charCodeAt(r++)),u===-1)throw new Error("Invalid base64 digit: "+t.charAt(r-1));c=!!(u&Bi),u&=Mi,i=i+(u<<a),a+=Lr}while(c);n.value=gl(i),n.rest=r}});var jt=_e(q=>{function bl(e,t,r){if(t in e)return e[t];if(arguments.length===3)return r;throw new Error('"'+t+'" is a required argument.')}q.getArg=bl;var Wi=/^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/,yl=/^data:.+\,.+$/;function ht(e){var t=e.match(Wi);return t?{scheme:t[1],auth:t[2],host:t[3],port:t[4],path:t[5]}:null}q.urlParse=ht;function Xe(e){var t="";return e.scheme&&(t+=e.scheme+":"),t+="//",e.auth&&(t+=e.auth+"@"),e.host&&(t+=e.host),e.port&&(t+=":"+e.port),e.path&&(t+=e.path),t}q.urlGenerate=Xe;var xl=32;function kl(e){var t=[];return function(r){for(var n=0;n<t.length;n++)if(t[n].input===r){var o=t[0];return t[0]=t[n],t[n]=o,t[0].result}var i=e(r);return t.unshift({input:r,result:i}),t.length>xl&&t.pop(),i}}var Er=kl(function(t){var r=t,n=ht(t);if(n){if(!n.path)return t;r=n.path}for(var o=q.isAbsolute(r),i=[],a=0,c=0;;)if(a=c,c=r.indexOf("/",a),c===-1){i.push(r.slice(a));break}else for(i.push(r.slice(a,c));c<r.length&&r[c]==="/";)c++;for(var u,s=0,c=i.length-1;c>=0;c--)u=i[c],u==="."?i.splice(c,1):u===".."?s++:s>0&&(u===""?(i.splice(c+1,s),s=0):(i.splice(c,2),s--));return r=i.join("/"),r===""&&(r=o?"/":"."),n?(n.path=r,Xe(n)):r});q.normalize=Er;function qi(e,t){e===""&&(e="."),t===""&&(t=".");var r=ht(t),n=ht(e);if(n&&(e=n.path||"/"),r&&!r.scheme)return n&&(r.scheme=n.scheme),Xe(r);if(r||t.match(yl))return t;if(n&&!n.host&&!n.path)return n.host=t,Xe(n);var o=t.charAt(0)==="/"?t:Er(e.replace(/\/+$/,"")+"/"+t);return n?(n.path=o,Xe(n)):o}q.join=qi;q.isAbsolute=function(e){return e.charAt(0)==="/"||Wi.test(e)};function wl(e,t){e===""&&(e="."),e=e.replace(/\/$/,"");for(var r=0;t.indexOf(e+"/")!==0;){var n=e.lastIndexOf("/");if(n<0||(e=e.slice(0,n),e.match(/^([^\/]+:\/)?\/*$/)))return t;++r}return Array(r+1).join("../")+t.substr(e.length+1)}q.relative=wl;var ji=(function(){var e=Object.create(null);return!("__proto__"in e)})();function Ui(e){return e}function vl(e){return Hi(e)?"$"+e:e}q.toSetString=ji?Ui:vl;function Sl(e){return Hi(e)?e.slice(1):e}q.fromSetString=ji?Ui:Sl;function Hi(e){if(!e)return!1;var t=e.length;if(t<9||e.charCodeAt(t-1)!==95||e.charCodeAt(t-2)!==95||e.charCodeAt(t-3)!==111||e.charCodeAt(t-4)!==116||e.charCodeAt(t-5)!==111||e.charCodeAt(t-6)!==114||e.charCodeAt(t-7)!==112||e.charCodeAt(t-8)!==95||e.charCodeAt(t-9)!==95)return!1;for(var r=t-10;r>=0;r--)if(e.charCodeAt(r)!==36)return!1;return!0}function Cl(e,t,r){var n=ke(e.source,t.source);return n!==0||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0||r)||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=e.generatedLine-t.generatedLine,n!==0)?n:ke(e.name,t.name)}q.compareByOriginalPositions=Cl;function Tl(e,t,r){var n;return n=e.originalLine-t.originalLine,n!==0||(n=e.originalColumn-t.originalColumn,n!==0||r)||(n=e.generatedColumn-t.generatedColumn,n!==0)||(n=e.generatedLine-t.generatedLine,n!==0)?n:ke(e.name,t.name)}q.compareByOriginalPositionsNoSource=Tl;function Ll(e,t,r){var n=e.generatedLine-t.generatedLine;return n!==0||(n=e.generatedColumn-t.generatedColumn,n!==0||r)||(n=ke(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:ke(e.name,t.name)}q.compareByGeneratedPositionsDeflated=Ll;function Al(e,t,r){var n=e.generatedColumn-t.generatedColumn;return n!==0||r||(n=ke(e.source,t.source),n!==0)||(n=e.originalLine-t.originalLine,n!==0)||(n=e.originalColumn-t.originalColumn,n!==0)?n:ke(e.name,t.name)}q.compareByGeneratedPositionsDeflatedNoLine=Al;function ke(e,t){return e===t?0:e===null?1:t===null?-1:e>t?1:-1}function El(e,t){var r=e.generatedLine-t.generatedLine;return r!==0||(r=e.generatedColumn-t.generatedColumn,r!==0)||(r=ke(e.source,t.source),r!==0)||(r=e.originalLine-t.originalLine,r!==0)||(r=e.originalColumn-t.originalColumn,r!==0)?r:ke(e.name,t.name)}q.compareByGeneratedPositionsInflated=El;function zl(e){return JSON.parse(e.replace(/^\)]}'[^\n]*\n/,""))}q.parseSourceMapInput=zl;function Il(e,t,r){if(t=t||"",e&&(e[e.length-1]!=="/"&&t[0]!=="/"&&(e+="/"),t=e+t),r){var n=ht(r);if(!n)throw new Error("sourceMapURL could not be parsed");if(n.path){var o=n.path.lastIndexOf("/");o>=0&&(n.path=n.path.substring(0,o+1))}t=qi(Xe(n),t)}return Er(t)}q.computeSourceURL=Il});var Yi=_e(Gi=>{var zr=jt(),Ir=Object.prototype.hasOwnProperty,Oe=typeof Map<"u";function we(){this._array=[],this._set=Oe?new Map:Object.create(null)}we.fromArray=function(t,r){for(var n=new we,o=0,i=t.length;o<i;o++)n.add(t[o],r);return n};we.prototype.size=function(){return Oe?this._set.size:Object.getOwnPropertyNames(this._set).length};we.prototype.add=function(t,r){var n=Oe?t:zr.toSetString(t),o=Oe?this.has(t):Ir.call(this._set,n),i=this._array.length;(!o||r)&&this._array.push(t),o||(Oe?this._set.set(t,i):this._set[n]=i)};we.prototype.has=function(t){if(Oe)return this._set.has(t);var r=zr.toSetString(t);return Ir.call(this._set,r)};we.prototype.indexOf=function(t){if(Oe){var r=this._set.get(t);if(r>=0)return r}else{var n=zr.toSetString(t);if(Ir.call(this._set,n))return this._set[n]}throw new Error('"'+t+'" is not in the set.')};we.prototype.at=function(t){if(t>=0&&t<this._array.length)return this._array[t];throw new Error("No element indexed by "+t)};we.prototype.toArray=function(){return this._array.slice()};Gi.ArraySet=we});var Qi=_e(Vi=>{var Ki=jt();function Pl(e,t){var r=e.generatedLine,n=t.generatedLine,o=e.generatedColumn,i=t.generatedColumn;return n>r||n==r&&i>=o||Ki.compareByGeneratedPositionsInflated(e,t)<=0}function Ut(){this._array=[],this._sorted=!0,this._last={generatedLine:-1,generatedColumn:0}}Ut.prototype.unsortedForEach=function(t,r){this._array.forEach(t,r)};Ut.prototype.add=function(t){Pl(this._last,t)?(this._last=t,this._array.push(t)):(this._sorted=!1,this._array.push(t))};Ut.prototype.toArray=function(){return this._sorted||(this._array.sort(Ki.compareByGeneratedPositionsInflated),this._sorted=!0),this._array};Vi.MappingList=Ut});var $i=_e(Xi=>{var mt=_i(),B=jt(),Ht=Yi().ArraySet,Nl=Qi().MappingList;function ie(e){e||(e={}),this._file=B.getArg(e,"file",null),this._sourceRoot=B.getArg(e,"sourceRoot",null),this._skipValidation=B.getArg(e,"skipValidation",!1),this._ignoreInvalidMapping=B.getArg(e,"ignoreInvalidMapping",!1),this._sources=new Ht,this._names=new Ht,this._mappings=new Nl,this._sourcesContents=null}ie.prototype._version=3;ie.fromSourceMap=function(t,r){var n=t.sourceRoot,o=new ie(Object.assign(r||{},{file:t.file,sourceRoot:n}));return t.eachMapping(function(i){var a={generated:{line:i.generatedLine,column:i.generatedColumn}};i.source!=null&&(a.source=i.source,n!=null&&(a.source=B.relative(n,a.source)),a.original={line:i.originalLine,column:i.originalColumn},i.name!=null&&(a.name=i.name)),o.addMapping(a)}),t.sources.forEach(function(i){var a=i;n!==null&&(a=B.relative(n,i)),o._sources.has(a)||o._sources.add(a);var c=t.sourceContentFor(i);c!=null&&o.setSourceContent(i,c)}),o};ie.prototype.addMapping=function(t){var r=B.getArg(t,"generated"),n=B.getArg(t,"original",null),o=B.getArg(t,"source",null),i=B.getArg(t,"name",null);!this._skipValidation&&this._validateMapping(r,n,o,i)===!1||(o!=null&&(o=String(o),this._sources.has(o)||this._sources.add(o)),i!=null&&(i=String(i),this._names.has(i)||this._names.add(i)),this._mappings.add({generatedLine:r.line,generatedColumn:r.column,originalLine:n!=null&&n.line,originalColumn:n!=null&&n.column,source:o,name:i}))};ie.prototype.setSourceContent=function(t,r){var n=t;this._sourceRoot!=null&&(n=B.relative(this._sourceRoot,n)),r!=null?(this._sourcesContents||(this._sourcesContents=Object.create(null)),this._sourcesContents[B.toSetString(n)]=r):this._sourcesContents&&(delete this._sourcesContents[B.toSetString(n)],Object.keys(this._sourcesContents).length===0&&(this._sourcesContents=null))};ie.prototype.applySourceMap=function(t,r,n){var o=r;if(r==null){if(t.file==null)throw new Error(`SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, or the source map's "file" property. Both were omitted.`);o=t.file}var i=this._sourceRoot;i!=null&&(o=B.relative(i,o));var a=new Ht,c=new Ht;this._mappings.unsortedForEach(function(u){if(u.source===o&&u.originalLine!=null){var s=t.originalPositionFor({line:u.originalLine,column:u.originalColumn});s.source!=null&&(u.source=s.source,n!=null&&(u.source=B.join(n,u.source)),i!=null&&(u.source=B.relative(i,u.source)),u.originalLine=s.line,u.originalColumn=s.column,s.name!=null&&(u.name=s.name))}var l=u.source;l!=null&&!a.has(l)&&a.add(l);var p=u.name;p!=null&&!c.has(p)&&c.add(p)},this),this._sources=a,this._names=c,t.sources.forEach(function(u){var s=t.sourceContentFor(u);s!=null&&(n!=null&&(u=B.join(n,u)),i!=null&&(u=B.relative(i,u)),this.setSourceContent(u,s))},this)};ie.prototype._validateMapping=function(t,r,n,o){if(r&&typeof r.line!="number"&&typeof r.column!="number"){var i="original.line and original.column are not numbers -- you probably meant to omit the original mapping entirely and only map the generated position. If so, pass null for the original mapping instead of an object with empty or null values.";if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(i),!1;throw new Error(i)}if(!(t&&"line"in t&&"column"in t&&t.line>0&&t.column>=0&&!r&&!n&&!o)){if(t&&"line"in t&&"column"in t&&r&&"line"in r&&"column"in r&&t.line>0&&t.column>=0&&r.line>0&&r.column>=0&&n)return;var i="Invalid mapping: "+JSON.stringify({generated:t,source:n,original:r,name:o});if(this._ignoreInvalidMapping)return typeof console<"u"&&console.warn&&console.warn(i),!1;throw new Error(i)}};ie.prototype._serializeMappings=function(){for(var t=0,r=1,n=0,o=0,i=0,a=0,c="",u,s,l,p,h=this._mappings.toArray(),d=0,b=h.length;d<b;d++){if(s=h[d],u="",s.generatedLine!==r)for(t=0;s.generatedLine!==r;)u+=";",r++;else if(d>0){if(!B.compareByGeneratedPositionsInflated(s,h[d-1]))continue;u+=","}u+=mt.encode(s.generatedColumn-t),t=s.generatedColumn,s.source!=null&&(p=this._sources.indexOf(s.source),u+=mt.encode(p-a),a=p,u+=mt.encode(s.originalLine-1-o),o=s.originalLine-1,u+=mt.encode(s.originalColumn-n),n=s.originalColumn,s.name!=null&&(l=this._names.indexOf(s.name),u+=mt.encode(l-i),i=l)),c+=u}return c};ie.prototype._generateSourcesContent=function(t,r){return t.map(function(n){if(!this._sourcesContents)return null;r!=null&&(n=B.relative(r,n));var o=B.toSetString(n);return Object.prototype.hasOwnProperty.call(this._sourcesContents,o)?this._sourcesContents[o]:null},this)};ie.prototype.toJSON=function(){var t={version:this._version,sources:this._sources.toArray(),names:this._names.toArray(),mappings:this._serializeMappings()};return this._file!=null&&(t.file=this._file),this._sourceRoot!=null&&(t.sourceRoot=this._sourceRoot),this._sourcesContents&&(t.sourcesContent=this._generateSourcesContent(t.sources,t.sourceRoot)),t};ie.prototype.toString=function(){return JSON.stringify(this.toJSON())};Xi.SourceMapGenerator=ie});var Kd={};f(Kd,{Lexer:()=>Re,List:()=>U,OffsetToLocation:()=>Ke,TokenStream:()=>Ve,clone:()=>gr,createLexer:()=>_d,createSyntax:()=>lr,definitionSyntax:()=>en,find:()=>qd,findAll:()=>Ud,findLast:()=>jd,fork:()=>Yd,fromPlainObject:()=>Gd,generate:()=>Md,ident:()=>xi,isCustomProperty:()=>gt,keyword:()=>Je,lexer:()=>Bd,parse:()=>Rd,property:()=>Xt,string:()=>hr,toPlainObject:()=>Hd,tokenNames:()=>Te,tokenTypes:()=>Pt,tokenize:()=>Fd,url:()=>dr,vendorPrefix:()=>Yl,version:()=>Nd,walk:()=>Wd});var We=null,U=class e{static createItem(t){return{prev:null,next:null,data:t}}constructor(){this.head=null,this.tail=null,this.cursor=null}createItem(t){return e.createItem(t)}allocateCursor(t,r){let n;return We!==null?(n=We,We=We.cursor,n.prev=t,n.next=r,n.cursor=this.cursor):n={prev:t,next:r,cursor:this.cursor},this.cursor=n,n}releaseCursor(){let{cursor:t}=this;this.cursor=t.cursor,t.prev=null,t.next=null,t.cursor=We,We=t}updateCursors(t,r,n,o){let{cursor:i}=this;for(;i!==null;)i.prev===t&&(i.prev=r),i.next===n&&(i.next=o),i=i.cursor}*[Symbol.iterator](){for(let t=this.head;t!==null;t=t.next)yield t.data}get size(){let t=0;for(let r=this.head;r!==null;r=r.next)t++;return t}get isEmpty(){return this.head===null}get first(){return this.head&&this.head.data}get last(){return this.tail&&this.tail.data}fromArray(t){let r=null;this.head=null;for(let n of t){let o=e.createItem(n);r!==null?r.next=o:this.head=o,o.prev=r,r=o}return this.tail=r,this}toArray(){return[...this]}toJSON(){return[...this]}forEach(t,r=this){let n=this.allocateCursor(null,this.head);for(;n.next!==null;){let o=n.next;n.next=o.next,t.call(r,o.data,o,this)}this.releaseCursor()}forEachRight(t,r=this){let n=this.allocateCursor(this.tail,null);for(;n.prev!==null;){let o=n.prev;n.prev=o.prev,t.call(r,o.data,o,this)}this.releaseCursor()}reduce(t,r,n=this){let o=this.allocateCursor(null,this.head),i=r,a;for(;o.next!==null;)a=o.next,o.next=a.next,i=t.call(n,i,a.data,a,this);return this.releaseCursor(),i}reduceRight(t,r,n=this){let o=this.allocateCursor(this.tail,null),i=r,a;for(;o.prev!==null;)a=o.prev,o.prev=a.prev,i=t.call(n,i,a.data,a,this);return this.releaseCursor(),i}some(t,r=this){for(let n=this.head;n!==null;n=n.next)if(t.call(r,n.data,n,this))return!0;return!1}map(t,r=this){let n=new e;for(let o=this.head;o!==null;o=o.next)n.appendData(t.call(r,o.data,o,this));return n}filter(t,r=this){let n=new e;for(let o=this.head;o!==null;o=o.next)t.call(r,o.data,o,this)&&n.appendData(o.data);return n}nextUntil(t,r,n=this){if(t===null)return;let o=this.allocateCursor(null,t);for(;o.next!==null;){let i=o.next;if(o.next=i.next,r.call(n,i.data,i,this))break}this.releaseCursor()}prevUntil(t,r,n=this){if(t===null)return;let o=this.allocateCursor(t,null);for(;o.prev!==null;){let i=o.prev;if(o.prev=i.prev,r.call(n,i.data,i,this))break}this.releaseCursor()}clear(){this.head=null,this.tail=null}copy(){let t=new e;for(let r of this)t.appendData(r);return t}prepend(t){return this.updateCursors(null,t,this.head,t),this.head!==null?(this.head.prev=t,t.next=this.head):this.tail=t,this.head=t,this}prependData(t){return this.prepend(e.createItem(t))}append(t){return this.insert(t)}appendData(t){return this.insert(e.createItem(t))}insert(t,r=null){if(r!==null)if(this.updateCursors(r.prev,t,r,t),r.prev===null){if(this.head!==r)throw new Error("before doesn't belong to list");this.head=t,r.prev=t,t.next=r,this.updateCursors(null,t)}else r.prev.next=t,t.prev=r.prev,r.prev=t,t.next=r;else this.updateCursors(this.tail,t,null,t),this.tail!==null?(this.tail.next=t,t.prev=this.tail):this.head=t,this.tail=t;return this}insertData(t,r){return this.insert(e.createItem(t),r)}remove(t){if(this.updateCursors(t,t.prev,t,t.next),t.prev!==null)t.prev.next=t.next;else{if(this.head!==t)throw new Error("item doesn't belong to list");this.head=t.next}if(t.next!==null)t.next.prev=t.prev;else{if(this.tail!==t)throw new Error("item doesn't belong to list");this.tail=t.prev}return t.prev=null,t.next=null,t}push(t){this.insert(e.createItem(t))}pop(){return this.tail!==null?this.remove(this.tail):null}unshift(t){this.prepend(e.createItem(t))}shift(){return this.head!==null?this.remove(this.head):null}prependList(t){return this.insertList(t,this.head)}appendList(t){return this.insertList(t)}insertList(t,r){return t.head===null?this:(r!=null?(this.updateCursors(r.prev,t.tail,r,t.head),r.prev!==null?(r.prev.next=t.head,t.head.prev=r.prev):this.head=t.head,r.prev=t.tail,t.tail.next=r):(this.updateCursors(this.tail,t.tail,null,t.head),this.tail!==null?(this.tail.next=t.head,t.head.prev=this.tail):this.head=t.head,this.tail=t.tail),t.head=null,t.tail=null,this)}replace(t,r){"head"in r?this.insertList(r,t):this.insert(r,t),this.remove(t)}};function Pe(e,t){let r=Object.create(SyntaxError.prototype),n=new Error;return Object.assign(r,{name:e,message:t,get stack(){return(n.stack||"").replace(/^(.+\n){1,3}/,`${e}: ${t}
`)}})}var br=100,wi=60,vi="    ";function Si({source:e,line:t,column:r,baseLine:n,baseColumn:o},i){function a(b,Y){return s.slice(b,Y).map((J,v)=>String(b+v+1).padStart(h)+" |"+J).join(`
`)}let c=`
`.repeat(Math.max(n-1,0)),u=" ".repeat(Math.max(o-1,0)),s=(c+u+e).split(/\r\n?|\n|\f/),l=Math.max(1,t-i)-1,p=Math.min(t+i,s.length+1),h=Math.max(4,String(p).length)+1,d=0;r+=(vi.length-1)*(s[t-1].substr(0,r-1).match(/\t/g)||[]).length,r>br&&(d=r-wi+3,r=wi-2);for(let b=l;b<=p;b++)b>=0&&b<s.length&&(s[b]=s[b].replace(/\t/g,vi),s[b]=(d>0&&s[b].length>d?"\u2026":"")+s[b].substr(d,br-2)+(s[b].length>d+br-1?"\u2026":""));return[a(l,t),new Array(r+h+2).join("-")+"^",a(t,p)].filter(Boolean).join(`
`).replace(/^(\s+\d+\s+\|\n)+/,"").replace(/\n(\s+\d+\s+\|)+$/,"")}function yr(e,t,r,n,o,i=1,a=1){return Object.assign(Pe("SyntaxError",e),{source:t,offset:r,line:n,column:o,sourceFragment(u){return Si({source:t,line:n,column:o,baseLine:i,baseColumn:a},isNaN(u)?0:u)},get formattedMessage(){return`Parse error: ${e}
`+Si({source:t,line:n,column:o,baseLine:i,baseColumn:a},2)}})}var Pt={};f(Pt,{AtKeyword:()=>O,BadString:()=>qe,BadUrl:()=>Q,CDC:()=>X,CDO:()=>Ne,Colon:()=>N,Comma:()=>H,Comment:()=>F,Delim:()=>k,Dimension:()=>w,EOF:()=>be,Function:()=>x,Hash:()=>T,Ident:()=>m,LeftCurlyBracket:()=>D,LeftParenthesis:()=>S,LeftSquareBracket:()=>G,Number:()=>g,Percentage:()=>I,RightCurlyBracket:()=>W,RightParenthesis:()=>y,RightSquareBracket:()=>ee,Semicolon:()=>R,String:()=>ne,Url:()=>_,WhiteSpace:()=>L});var be=0,m=1,x=2,O=3,T=4,ne=5,qe=6,_=7,Q=8,k=9,g=10,I=11,w=12,L=13,Ne=14,X=15,N=16,R=17,H=18,G=19,ee=20,S=21,y=22,D=23,W=24,F=25;function M(e){return e>=48&&e<=57}function te(e){return M(e)||e>=65&&e<=70||e>=97&&e<=102}function Dt(e){return e>=65&&e<=90}function rl(e){return e>=97&&e<=122}function nl(e){return Dt(e)||rl(e)}function ol(e){return e>=128}function Nt(e){return nl(e)||ol(e)||e===95}function je(e){return Nt(e)||M(e)||e===45}function il(e){return e>=0&&e<=8||e===11||e>=14&&e<=31||e===127}function st(e){return e===10||e===13||e===12}function me(e){return st(e)||e===32||e===9}function $(e,t){return!(e!==92||st(t)||t===0)}function Ue(e,t,r){return e===45?Nt(t)||t===45||$(t,r):Nt(e)?!0:e===92?$(e,t):!1}function Ot(e,t,r){return e===43||e===45?M(t)?2:t===46&&M(r)?3:0:e===46?M(t)?2:0:M(e)?1:0}function Ft(e){return e===65279||e===65534?1:0}var xr=new Array(128),al=128,lt=130,kr=131,Rt=132,wr=133;for(let e=0;e<xr.length;e++)xr[e]=me(e)&&lt||M(e)&&kr||Nt(e)&&Rt||il(e)&&wr||e||al;function Mt(e){return e<128?xr[e]:Rt}function He(e,t){return t<e.length?e.charCodeAt(t):0}function Bt(e,t,r){return r===13&&He(e,t+1)===10?2:1}function ye(e,t,r){let n=e.charCodeAt(t);return Dt(n)&&(n=n|32),n===r}function xe(e,t,r,n){if(r-t!==n.length||t<0||r>e.length)return!1;for(let o=t;o<r;o++){let i=n.charCodeAt(o-t),a=e.charCodeAt(o);if(Dt(a)&&(a=a|32),a!==i)return!1}return!0}function Ci(e,t){for(;t>=0&&me(e.charCodeAt(t));t--);return t+1}function ct(e,t){for(;t<e.length&&me(e.charCodeAt(t));t++);return t}function vr(e,t){for(;t<e.length&&M(e.charCodeAt(t));t++);return t}function le(e,t){if(t+=2,te(He(e,t-1))){for(let n=Math.min(e.length,t+5);t<n&&te(He(e,t));t++);let r=He(e,t);me(r)&&(t+=Bt(e,t,r))}return t}function ut(e,t){for(;t<e.length;t++){let r=e.charCodeAt(t);if(!je(r)){if($(r,He(e,t+1))){t=le(e,t)-1;continue}break}}return t}function De(e,t){let r=e.charCodeAt(t);if((r===43||r===45)&&(r=e.charCodeAt(t+=1)),M(r)&&(t=vr(e,t+1),r=e.charCodeAt(t)),r===46&&M(e.charCodeAt(t+1))&&(t+=2,t=vr(e,t)),ye(e,t,101)){let n=0;r=e.charCodeAt(t+1),(r===45||r===43)&&(n=1,r=e.charCodeAt(t+2)),M(r)&&(t=vr(e,t+1+n+1))}return t}function _t(e,t){for(;t<e.length;t++){let r=e.charCodeAt(t);if(r===41){t++;break}$(r,He(e,t+1))&&(t=le(e,t))}return t}function Ge(e){if(e.length===1&&!te(e.charCodeAt(0)))return e[0];let t=parseInt(e,16);return(t===0||t>=55296&&t<=57343||t>1114111)&&(t=65533),String.fromCodePoint(t)}var Te=["EOF-token","ident-token","function-token","at-keyword-token","hash-token","string-token","bad-string-token","url-token","bad-url-token","delim-token","number-token","percentage-token","dimension-token","whitespace-token","CDO-token","CDC-token","colon-token","semicolon-token","comma-token","[-token","]-token","(-token",")-token","{-token","}-token","comment-token"];function Ye(e=null,t){return e===null||e.length<t?new Uint32Array(Math.max(t+1024,16384)):e}var Ti=10,sl=12,Li=13;function Ai(e){let t=e.source,r=t.length,n=t.length>0?Ft(t.charCodeAt(0)):0,o=Ye(e.lines,r),i=Ye(e.columns,r),a=e.startLine,c=e.startColumn;for(let u=n;u<r;u++){let s=t.charCodeAt(u);o[u]=a,i[u]=c++,(s===Ti||s===Li||s===sl)&&(s===Li&&u+1<r&&t.charCodeAt(u+1)===Ti&&(u++,o[u]=a,i[u]=c),a++,c=1)}o[r]=a,i[r]=c,e.lines=o,e.columns=i,e.computed=!0}var Ke=class{constructor(t,r,n,o){this.setSource(t,r,n,o),this.lines=null,this.columns=null}setSource(t="",r=0,n=1,o=1){this.source=t,this.startOffset=r,this.startLine=n,this.startColumn=o,this.computed=!1}getLocation(t,r){return this.computed||Ai(this),{source:r,offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]}}getLocationRange(t,r,n){return this.computed||Ai(this),{source:n,start:{offset:this.startOffset+t,line:this.lines[t],column:this.columns[t]},end:{offset:this.startOffset+r,line:this.lines[r],column:this.columns[r]}}}};var ce=16777215,ue=24,pt=1,Wt=2,Le=new Uint8Array(32);Le[2]=22;Le[21]=22;Le[19]=20;Le[23]=24;var pe=new Uint8Array(32);pe[2]=pt;pe[21]=pt;pe[19]=pt;pe[23]=pt;pe[22]=Wt;pe[20]=Wt;pe[24]=Wt;function Ei(e,t,r){return e<t?t:e>r?r:e}var Ve=class{constructor(t,r){this.setSource(t,r)}reset(){this.eof=!1,this.tokenIndex=-1,this.tokenType=0,this.tokenStart=this.firstCharOffset,this.tokenEnd=this.firstCharOffset}setSource(t="",r=()=>{}){t=String(t||"");let n=t.length,o=Ye(this.offsetAndType,t.length+1),i=Ye(this.balance,t.length+1),a=0,c=-1,u=0,s=t.length;this.offsetAndType=null,this.balance=null,i.fill(0),r(t,(l,p,h)=>{let d=a++;if(o[d]=l<<ue|h,c===-1&&(c=p),i[d]=s,l===u){let b=i[s];i[s]=d,s=b,u=Le[o[b]>>ue]}else this.isBlockOpenerTokenType(l)&&(s=d,u=Le[l])}),o[a]=0<<ue|n,i[a]=a;for(let l=0;l<a;l++){let p=i[l];if(p<=l){let h=i[p];h!==l&&(i[l]=h)}else p>a&&(i[l]=a)}this.source=t,this.firstCharOffset=c===-1?0:c,this.tokenCount=a,this.offsetAndType=o,this.balance=i,this.reset(),this.next()}lookupType(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t]>>ue:0}lookupTypeNonSC(t){for(let r=this.tokenIndex;r<this.tokenCount;r++){let n=this.offsetAndType[r]>>ue;if(n!==13&&n!==25&&t--===0)return n}return 0}lookupOffset(t){return t+=this.tokenIndex,t<this.tokenCount?this.offsetAndType[t-1]&ce:this.source.length}lookupOffsetNonSC(t){for(let r=this.tokenIndex;r<this.tokenCount;r++){let n=this.offsetAndType[r]>>ue;if(n!==13&&n!==25&&t--===0)return r-this.tokenIndex}return 0}lookupValue(t,r){return t+=this.tokenIndex,t<this.tokenCount?xe(this.source,this.offsetAndType[t-1]&ce,this.offsetAndType[t]&ce,r):!1}getTokenStart(t){return t===this.tokenIndex?this.tokenStart:t>0?t<this.tokenCount?this.offsetAndType[t-1]&ce:this.offsetAndType[this.tokenCount]&ce:this.firstCharOffset}getTokenEnd(t){return t===this.tokenIndex?this.tokenEnd:this.offsetAndType[Ei(t,0,this.tokenCount)]&ce}getTokenType(t){return t===this.tokenIndex?this.tokenType:this.offsetAndType[Ei(t,0,this.tokenCount)]>>ue}substrToCursor(t){return this.source.substring(t,this.tokenStart)}isBlockOpenerTokenType(t){return pe[t]===pt}isBlockCloserTokenType(t){return pe[t]===Wt}getBlockTokenPairIndex(t){let r=this.getTokenType(t);if(pe[r]===1){let n=this.balance[t],o=this.getTokenType(n);return Le[r]===o?n:-1}else if(pe[r]===2){let n=this.balance[t],o=this.getTokenType(n);return Le[o]===r?n:-1}return-1}isBalanceEdge(t){return this.balance[this.tokenIndex]<t}isDelim(t,r){return r?this.lookupType(r)===9&&this.source.charCodeAt(this.lookupOffset(r))===t:this.tokenType===9&&this.source.charCodeAt(this.tokenStart)===t}skip(t){let r=this.tokenIndex+t;r<this.tokenCount?(this.tokenIndex=r,this.tokenStart=this.offsetAndType[r-1]&ce,r=this.offsetAndType[r],this.tokenType=r>>ue,this.tokenEnd=r&ce):(this.tokenIndex=this.tokenCount,this.next())}next(){let t=this.tokenIndex+1;t<this.tokenCount?(this.tokenIndex=t,this.tokenStart=this.tokenEnd,t=this.offsetAndType[t],this.tokenType=t>>ue,this.tokenEnd=t&ce):(this.eof=!0,this.tokenIndex=this.tokenCount,this.tokenType=0,this.tokenStart=this.tokenEnd=this.source.length)}skipSC(){for(;this.tokenType===13||this.tokenType===25;)this.next()}skipUntilBalanced(t,r){let n=t,o=0,i=0;e:for(;n<this.tokenCount;n++){if(o=this.balance[n],o<t)break e;switch(i=n>0?this.offsetAndType[n-1]&ce:this.firstCharOffset,r(this.source.charCodeAt(i))){case 1:break e;case 2:n++;break e;default:this.isBlockOpenerTokenType(this.offsetAndType[n]>>ue)&&(n=o)}}this.skip(n-this.tokenIndex)}forEachToken(t){for(let r=0,n=this.firstCharOffset;r<this.tokenCount;r++){let o=n,i=this.offsetAndType[r],a=i&ce,c=i>>ue;n=a,t(c,o,a,r)}}dump(){let t=new Array(this.tokenCount);return this.forEachToken((r,n,o,i)=>{t[i]={idx:i,type:Te[r],chunk:this.source.substring(n,o),balance:this.balance[i]}}),t}};function qt(e,t){function r(p){return p<c?e.charCodeAt(p):0}function n(){if(s=De(e,s),Ue(r(s),r(s+1),r(s+2))){l=12,s=ut(e,s);return}if(r(s)===37){l=11,s++;return}l=10}function o(){let p=s;if(s=ut(e,s),xe(e,p,s,"url")&&r(s)===40){if(s=ct(e,s+1),r(s)===34||r(s)===39){l=2,s=p+4;return}a();return}if(r(s)===40){l=2,s++;return}l=1}function i(p){for(p||(p=r(s++)),l=5;s<e.length;s++){let h=e.charCodeAt(s);switch(Mt(h)){case p:s++;return;case lt:if(st(h)){s+=Bt(e,s,h),l=6;return}break;case 92:if(s===e.length-1)break;let d=r(s+1);st(d)?s+=Bt(e,s+1,d):$(h,d)&&(s=le(e,s)-1);break}}}function a(){for(l=7,s=ct(e,s);s<e.length;s++){let p=e.charCodeAt(s);switch(Mt(p)){case 41:s++;return;case lt:if(s=ct(e,s),r(s)===41||s>=e.length){s<e.length&&s++;return}s=_t(e,s),l=8;return;case 34:case 39:case 40:case wr:s=_t(e,s),l=8;return;case 92:if($(p,r(s+1))){s=le(e,s)-1;break}s=_t(e,s),l=8;return}}}e=String(e||"");let c=e.length,u=Ft(r(0)),s=u,l;for(;s<c;){let p=e.charCodeAt(s);switch(Mt(p)){case lt:l=13,s=ct(e,s+1);break;case 34:i();break;case 35:je(r(s+1))||$(r(s+1),r(s+2))?(l=4,s=ut(e,s+1)):(l=9,s++);break;case 39:i();break;case 40:l=21,s++;break;case 41:l=22,s++;break;case 43:Ot(p,r(s+1),r(s+2))?n():(l=9,s++);break;case 44:l=18,s++;break;case 45:Ot(p,r(s+1),r(s+2))?n():r(s+1)===45&&r(s+2)===62?(l=15,s=s+3):Ue(p,r(s+1),r(s+2))?o():(l=9,s++);break;case 46:Ot(p,r(s+1),r(s+2))?n():(l=9,s++);break;case 47:r(s+1)===42?(l=25,s=e.indexOf("*/",s+2),s=s===-1?e.length:s+2):(l=9,s++);break;case 58:l=16,s++;break;case 59:l=17,s++;break;case 60:r(s+1)===33&&r(s+2)===45&&r(s+3)===45?(l=14,s=s+4):(l=9,s++);break;case 64:Ue(r(s+1),r(s+2),r(s+3))?(l=3,s=ut(e,s+1)):(l=9,s++);break;case 91:l=19,s++;break;case 92:$(p,r(s+1))?o():(l=9,s++);break;case 93:l=20,s++;break;case 123:l=23,s++;break;case 125:l=24,s++;break;case kr:n();break;case Rt:o();break;default:l=9,s++}t(l,u,u=s)}}function zi(e){let t=this.createList(),r=!1,n={recognizer:e};for(;!this.eof;){switch(this.tokenType){case 25:this.next();continue;case 13:r=!0,this.next();continue}let o=e.getNode.call(this,n);if(o===void 0)break;r&&(e.onWhiteSpace&&e.onWhiteSpace.call(this,o,t,n),r=!1),t.push(o)}return r&&e.onWhiteSpace&&e.onWhiteSpace.call(this,null,t,n),t}var ll="function";function Ae(e){return e&&typeof e.tokenize===ll?e.tokenize:qt}var Qe=()=>{},cl=33,ul=35,Sr=59,Ii=123,Pi=0,pl={createList(){return[]},createSingleNodeList(e){return[e]},getFirstListNode(e){return e&&e[0]||null},getLastListNode(e){return e&&e.length>0?e[e.length-1]:null}},hl={createList(){return new U},createSingleNodeList(e){return new U().appendData(e)},getFirstListNode(e){return e&&e.first},getLastListNode(e){return e&&e.last}};function ml(e){return function(){return this[e]()}}function Cr(e){let t=Object.create(null);for(let r of Object.keys(e)){let n=e[r],o=n.parse||n;o&&(t[r]=o)}return t}function dl(e){let t={context:Object.create(null),features:Object.assign(Object.create(null),e.features),scope:Object.assign(Object.create(null),e.scope),atrule:Cr(e.atrule),pseudo:Cr(e.pseudo),node:Cr(e.node),tokenize:Ae(e)};for(let[r,n]of Object.entries(e.parseContext))switch(typeof n){case"function":t.context[r]=n;break;case"string":t.context[r]=ml(n);break}return{config:t,...t,...t.node}}function Ni(e){let t="",r="<unknown>",n=!1,o=Qe,i=!1,a=new Ke,c=Object.assign(new Ve,dl(e||{}),{parseAtrulePrelude:!0,parseRulePrelude:!0,parseValue:!0,parseCustomProperty:!1,readSequence:zi,consumeUntilBalanceEnd:()=>0,consumeUntilLeftCurlyBracket(l){return l===Ii?1:0},consumeUntilLeftCurlyBracketOrSemicolon(l){return l===Ii||l===Sr?1:0},consumeUntilExclamationMarkOrSemicolon(l){return l===cl||l===Sr?1:0},consumeUntilSemicolonIncluded(l){return l===Sr?2:0},createList:Qe,createSingleNodeList:Qe,getFirstListNode:Qe,getLastListNode:Qe,parseWithFallback(l,p){let h=this.tokenIndex;try{return l.call(this)}catch(d){if(i)throw d;this.skip(h-this.tokenIndex);let b=p.call(this);return i=!0,o(d,b),i=!1,b}},lookupNonWSType(l){let p;do if(p=this.lookupType(l++),p!==13&&p!==25)return p;while(p!==Pi);return Pi},charCodeAt(l){return l>=0&&l<t.length?t.charCodeAt(l):0},substring(l,p){return t.substring(l,p)},substrToCursor(l){return this.source.substring(l,this.tokenStart)},cmpChar(l,p){return ye(t,l,p)},cmpStr(l,p,h){return xe(t,l,p,h)},consume(l){let p=this.tokenStart;return this.eat(l),this.substrToCursor(p)},consumeFunctionName(){let l=t.substring(this.tokenStart,this.tokenEnd-1);return this.eat(2),l},consumeNumber(l){let p=t.substring(this.tokenStart,De(t,this.tokenStart));return this.eat(l),p},eat(l){if(this.tokenType!==l){let p=Te[l].slice(0,-6).replace(/-/g," ").replace(/^./,b=>b.toUpperCase()),h=`${/[[\](){}]/.test(p)?`"${p}"`:p} is expected`,d=this.tokenStart;switch(l){case 1:this.tokenType===2||this.tokenType===7?(d=this.tokenEnd-1,h="Identifier is expected but function found"):h="Identifier is expected";break;case 4:this.isDelim(ul)&&(this.next(),d++,h="Name is expected");break;case 11:this.tokenType===10&&(d=this.tokenEnd,h="Percent sign is expected");break}this.error(h,d)}this.next()},eatIdent(l){(this.tokenType!==1||this.lookupValue(0,l)===!1)&&this.error(`Identifier "${l}" is expected`),this.next()},eatDelim(l){this.isDelim(l)||this.error(`Delim "${String.fromCharCode(l)}" is expected`),this.next()},getLocation(l,p){return n?a.getLocationRange(l,p,r):null},getLocationFromList(l){if(n){let p=this.getFirstListNode(l),h=this.getLastListNode(l);return a.getLocationRange(p!==null?p.loc.start.offset-a.startOffset:this.tokenStart,h!==null?h.loc.end.offset-a.startOffset:this.tokenStart,r)}return null},error(l,p){let h=typeof p<"u"&&p<t.length?a.getLocation(p):this.eof?a.getLocation(Ci(t,t.length-1)):a.getLocation(this.tokenStart);throw new yr(l||"Unexpected input",t,h.offset,h.line,h.column,a.startLine,a.startColumn)}}),u=()=>({filename:r,source:t,tokenCount:c.tokenCount,getTokenType:l=>c.getTokenType(l),getTokenTypeName:l=>Te[c.getTokenType(l)],getTokenStart:l=>c.getTokenStart(l),getTokenEnd:l=>c.getTokenEnd(l),getTokenValue:l=>c.source.substring(c.getTokenStart(l),c.getTokenEnd(l)),substring:(l,p)=>c.source.substring(l,p),balance:c.balance.subarray(0,c.tokenCount+1),isBlockOpenerTokenType:c.isBlockOpenerTokenType,isBlockCloserTokenType:c.isBlockCloserTokenType,getBlockTokenPairIndex:l=>c.getBlockTokenPairIndex(l),getLocation:l=>a.getLocation(l,r),getRangeLocation:(l,p)=>a.getLocationRange(l,p,r)});return Object.assign(function(l,p){t=l,p=p||{},c.setSource(t,c.tokenize),a.setSource(t,p.offset,p.line,p.column),r=p.filename||"<unknown>",n=!!p.positions,o=typeof p.onParseError=="function"?p.onParseError:Qe,i=!1,c.parseAtrulePrelude="parseAtrulePrelude"in p?!!p.parseAtrulePrelude:!0,c.parseRulePrelude="parseRulePrelude"in p?!!p.parseRulePrelude:!0,c.parseValue="parseValue"in p?!!p.parseValue:!0,c.parseCustomProperty="parseCustomProperty"in p?!!p.parseCustomProperty:!1;let{context:h="default",list:d=!0,onComment:b,onToken:Y}=p;if(!(h in c.context))throw new Error("Unknown context `"+h+"`");Object.assign(c,d?hl:pl),Array.isArray(Y)?c.forEachToken((v,E,K)=>{Y.push({type:v,start:E,end:K})}):typeof Y=="function"&&c.forEachToken(Y.bind(u())),typeof b=="function"&&c.forEachToken((v,E,K)=>{if(v===25){let z=c.getLocation(E,K),re=xe(t,K-2,K,"*/")?t.slice(E+2,K-2):t.slice(E+2,K);b(re,z)}});let J=c.context[h].call(c,p);return c.eof||c.error(),J},{SyntaxError:yr,config:c.config})}var Ji=el($i(),1),Zi=new Set(["Atrule","Selector","Declaration"]);function ea(e){let t=new Ji.SourceMapGenerator,r={line:1,column:0},n={line:0,column:0},o={line:1,column:0},i={generated:o},a=1,c=0,u=!1,s=e.node;e.node=function(h){if(h.loc&&h.loc.start&&Zi.has(h.type)){let d=h.loc.start.line,b=h.loc.start.column-1;(n.line!==d||n.column!==b)&&(n.line=d,n.column=b,r.line=a,r.column=c,u&&(u=!1,(r.line!==o.line||r.column!==o.column)&&t.addMapping(i)),u=!0,t.addMapping({source:h.loc.source,original:n,generated:r}))}s.call(this,h),u&&Zi.has(h.type)&&(o.line=a,o.column=c)};let l=e.emit;e.emit=function(h,d,b){for(let Y=0;Y<h.length;Y++)h.charCodeAt(Y)===10?(a++,c=0):c++;l(h,d,b)};let p=e.result;return e.result=function(){return u&&t.addMapping(i),{css:p(),map:t}},e}var Gt={};f(Gt,{safe:()=>Nr,spec:()=>Rl});var Dl=43,Ol=45,Pr=(e,t)=>(e===9&&(e=t),typeof e=="string"&&(e=Math.min(e.charCodeAt(0),128)<<6),e<<1),ta=[[1,1],[1,2],[1,7],[1,8],[1,"-"],[1,10],[1,11],[1,12],[1,15],[1,21],[3,1],[3,2],[3,7],[3,8],[3,"-"],[3,10],[3,11],[3,12],[3,15],[4,1],[4,2],[4,7],[4,8],[4,"-"],[4,10],[4,11],[4,12],[4,15],[12,1],[12,2],[12,7],[12,8],[12,"-"],[12,10],[12,11],[12,12],[12,15],["#",1],["#",2],["#",7],["#",8],["#","-"],["#",10],["#",11],["#",12],["#",15],["-",1],["-",2],["-",7],["-",8],["-","-"],["-",10],["-",11],["-",12],["-",15],[10,1],[10,2],[10,7],[10,8],[10,10],[10,11],[10,12],[10,"%"],[10,15],["@",1],["@",2],["@",7],["@",8],["@","-"],["@",15],[".",10],[".",11],[".",12],["+",10],["+",11],["+",12],["/","*"]],Fl=ta.concat([[1,4],[12,4],[4,4],[3,21],[3,5],[3,16],[11,11],[11,12],[11,2],[11,"-"],[22,1],[22,2],[22,11],[22,12],[22,4],[22,"-"]]);function ra(e){let t=new Set(e.map(([r,n])=>Pr(r)<<16|Pr(n)));return function(r,n,o){let i=Pr(n,o),a=o.charCodeAt(0),c=a===Ol&&n!==1&&n!==2&&n!==15||a===Dl?t.has((r&65534)<<16|a<<7):t.has((r&65534)<<16|i);return i|c}}var Rl=ra(ta),Nr=ra(Fl);var Ml=92;function Bl(e,t){if(typeof t=="function"){let r=null;e.children.forEach(n=>{r!==null&&t.call(this,r),this.node(n),r=n});return}e.children.forEach(this.node,this)}function na(e){let t=new Map;for(let[r,n]of Object.entries(e.node))typeof(n.generate||n)=="function"&&t.set(r,n.generate||n);return function(r,n){let o="",i=0,a={node(u){if(t.has(u.type))t.get(u.type).call(c,u);else throw new Error("Unknown node type: "+u.type)},tokenBefore:Nr,token(u,s,l){i=this.tokenBefore(i,u,s),!l&&i&1&&this.emit(" ",13,!0),this.emit(s,u,!1),u===9&&s.charCodeAt(0)===Ml&&this.emit(`
`,13,!0)},emit(u){o+=u},result(){return o}};n&&(typeof n.decorator=="function"&&(a=n.decorator(a)),n.sourceMap&&(a=ea(a)),n.mode in Gt&&(a.tokenBefore=Gt[n.mode]));let c={node:u=>a.node(u),children:Bl,token:(u,s)=>a.token(u,s),tokenize:function(u){return Ae(e)(u,(l,p,h)=>{a.token(l,u.slice(p,h),p!==0)})}};return a.node(r),a.result()}}function oa(e){return{fromPlainObject(t){return e(t,{enter(r){r.children&&!(r.children instanceof U)&&(r.children=new U().fromArray(r.children))}}),t},toPlainObject(t){return e(t,{leave(r){r.children&&r.children instanceof U&&(r.children=r.children.toArray())}}),t}}}var{hasOwnProperty:Dr}=Object.prototype,dt=function(){};function ia(e){return typeof e=="function"?e:dt}function aa(e,t){return function(r,n,o){r.type===t&&e.call(this,r,n,o)}}function _l(e,t){let r=t.structure,n=[];for(let o in r){if(Dr.call(r,o)===!1)continue;let i=r[o],a={name:o,type:!1,nullable:!1};Array.isArray(i)||(i=[i]);for(let c of i)c===null?a.nullable=!0:typeof c=="string"?a.type="node":Array.isArray(c)&&(a.type="list");a.type&&n.push(a)}return n.length?{context:t.walkContext,fields:n}:null}function Wl(e){let t={};for(let r in e.node)if(Dr.call(e.node,r)){let n=e.node[r];if(!n.structure)throw new Error("Missed `structure` field in `"+r+"` node type definition");t[r]=_l(r,n)}return t}function sa(e,t){let r=e.fields.slice(),n=e.context,o=typeof n=="string";return t&&r.reverse(),function(i,a,c,u){let s;o&&(s=a[n],a[n]=i);for(let l of r){let p=i[l.name];if(!l.nullable||p){if(l.type==="list"){if(t?p.reduceRight(u,!1):p.reduce(u,!1))return!0}else if(c(p))return!0}}o&&(a[n]=s)}}function la({StyleSheet:e,Atrule:t,Rule:r,Block:n,DeclarationList:o}){return{Atrule:{StyleSheet:e,Atrule:t,Rule:r,Block:n},Rule:{StyleSheet:e,Atrule:t,Rule:r,Block:n},Declaration:{StyleSheet:e,Atrule:t,Rule:r,Block:n,DeclarationList:o}}}function ca(e){let t=Wl(e),r={},n={},o=Symbol("break-walk"),i=Symbol("skip-node");for(let s in t)Dr.call(t,s)&&t[s]!==null&&(r[s]=sa(t[s],!1),n[s]=sa(t[s],!0));let a=la(r),c=la(n),u=function(s,l){function p(v,E,K){let z=h.call(J,v,E,K);return z===o?!0:z===i?!1:!!(b.hasOwnProperty(v.type)&&b[v.type](v,J,p,Y)||d.call(J,v,E,K)===o)}let h=dt,d=dt,b=r,Y=(v,E,K,z)=>v||p(E,K,z),J={break:o,skip:i,root:s,stylesheet:null,atrule:null,atrulePrelude:null,rule:null,selector:null,block:null,declaration:null,function:null};if(typeof l=="function")h=l;else if(l&&(h=ia(l.enter),d=ia(l.leave),l.reverse&&(b=n),l.visit)){if(a.hasOwnProperty(l.visit))b=l.reverse?c[l.visit]:a[l.visit];else if(!t.hasOwnProperty(l.visit))throw new Error("Bad value `"+l.visit+"` for `visit` option (should be: "+Object.keys(t).sort().join(", ")+")");h=aa(h,l.visit),d=aa(d,l.visit)}if(h===dt&&d===dt)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");p(s)};return u.break=o,u.skip=i,u.find=function(s,l){let p=null;return u(s,function(h,d,b){if(l.call(this,h,d,b))return p=h,o}),p},u.findLast=function(s,l){let p=null;return u(s,{reverse:!0,enter(h,d,b){if(l.call(this,h,d,b))return p=h,o}}),p},u.findAll=function(s,l){let p=[];return u(s,function(h,d,b){l.call(this,h,d,b)&&p.push(h)}),p},u}function ql(e){return e}function jl(e){let{min:t,max:r,comma:n}=e;return t===0&&r===0?n?"#?":"*":t===0&&r===1?"?":t===1&&r===0?n?"#":"+":t===1&&r===1?"":(n?"#":"")+(t===r?"{"+t+"}":"{"+t+","+(r!==0?r:"")+"}")}function Ul(e){if(e.type==="Range")return" ["+(e.min===null?"-\u221E":e.min)+","+(e.max===null?"\u221E":e.max)+"]";throw new Error("Unknown node type `"+e.type+"`")}function Hl(e,t,r,n){let o=e.combinator===" "||n?e.combinator:" "+e.combinator+" ",i=e.terms.map(a=>Yt(a,t,r,n)).join(o);return e.explicit||r?(n||i[0]===","?"[":"[ ")+i+(n?"]":" ]"):i}function Yt(e,t,r,n){let o;switch(e.type){case"Group":o=Hl(e,t,r,n)+(e.disallowEmpty?"!":"");break;case"Multiplier":return Yt(e.term,t,r,n)+t(jl(e),e);case"Boolean":o="<boolean-expr["+Yt(e.term,t,r,n)+"]>";break;case"Type":o="<"+e.name+(e.opts?t(Ul(e.opts),e.opts):"")+">";break;case"Property":o="<'"+e.name+"'>";break;case"Keyword":o=e.name;break;case"AtKeyword":o="@"+e.name;break;case"Function":o=e.name+"(";break;case"String":case"Token":o=e.value;break;case"Comma":o=",";break;default:throw new Error("Unknown node type `"+e.type+"`")}return t(o,e)}function Fe(e,t){let r=ql,n=!1,o=!1;return typeof t=="function"?r=t:t&&(n=!!t.forceBraces,o=!!t.compact,typeof t.decorate=="function"&&(r=t.decorate)),Yt(e,r,n,o)}var ua={offset:0,line:1,column:1};function Gl(e,t){let r=e.tokens,n=e.longestMatch,o=n<r.length&&r[n].node||null,i=o!==t?o:null,a=0,c=0,u=0,s="",l,p;for(let h=0;h<r.length;h++){let d=r[h].value;h===n&&(c=d.length,a=s.length),i!==null&&r[h].node===i&&(h<=n?u++:u=0),s+=d}return n===r.length||u>1?(l=Kt(i||t,"end")||ft(ua,s),p=ft(l)):(l=Kt(i,"start")||ft(Kt(t,"start")||ua,s.slice(0,a)),p=Kt(i,"end")||ft(l,s.substr(a,c))),{css:s,mismatchOffset:a,mismatchLength:c,start:l,end:p}}function Kt(e,t){let r=e&&e.loc&&e.loc[t];return r?"line"in r?ft(r):r:null}function ft({offset:e,line:t,column:r},n){let o={offset:e,line:t,column:r};if(n){let i=n.split(/\n|\r\n?|\f/);o.offset+=n.length,o.line+=i.length-1,o.column=i.length===1?o.column+n.length:i.pop().length+1}return o}var $e=function(e,t){let r=Pe("SyntaxReferenceError",e+(t?" `"+t+"`":""));return r.reference=t,r},pa=function(e,t,r,n){let o=Pe("SyntaxMatchError",e),{css:i,mismatchOffset:a,mismatchLength:c,start:u,end:s}=Gl(n,r);return o.rawMessage=e,o.syntax=t?Fe(t):"<generic>",o.css=i,o.mismatchOffset=a,o.mismatchLength=c,o.message=e+`
  syntax: `+o.syntax+`
   value: `+(i||"<empty string>")+`
  --------`+new Array(o.mismatchOffset+1).join("-")+"^",Object.assign(o,u),o.loc={source:r&&r.loc&&r.loc.source||"<unknown>",start:u,end:s},o};var Vt=new Map,Ze=new Map,Qt=45,Je=Kl,Xt=Vl,Yl=Or;function gt(e,t){return t=t||0,e.length-t>=2&&e.charCodeAt(t)===Qt&&e.charCodeAt(t+1)===Qt}function Or(e,t){if(t=t||0,e.length-t>=3&&e.charCodeAt(t)===Qt&&e.charCodeAt(t+1)!==Qt){let r=e.indexOf("-",t+2);if(r!==-1)return e.substring(t,r+1)}return""}function Kl(e){if(Vt.has(e))return Vt.get(e);let t=e.toLowerCase(),r=Vt.get(t);if(r===void 0){let n=gt(t,0),o=n?"":Or(t,0);r=Object.freeze({basename:t.substr(o.length),name:t,prefix:o,vendor:o,custom:n})}return Vt.set(e,r),r}function Vl(e){if(Ze.has(e))return Ze.get(e);let t=e,r=e[0];r==="/"?r=e[1]==="/"?"//":"/":r!=="_"&&r!=="*"&&r!=="$"&&r!=="#"&&r!=="+"&&r!=="&"&&(r="");let n=gt(t,r.length);if(!n&&(t=t.toLowerCase(),Ze.has(t))){let c=Ze.get(t);return Ze.set(e,c),c}let o=n?"":Or(t,r.length),i=t.substr(0,r.length+o.length),a=Object.freeze({basename:t.substr(i.length),name:t.substr(r.length),hack:r,vendor:o,prefix:i,custom:n});return Ze.set(e,a),a}var et=["initial","inherit","unset","revert","revert-layer"];var yt=43,de=45,Fr=110,tt=!0,Xl=!1;function Mr(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function bt(e,t,r){for(;e!==null&&(e.type===13||e.type===25);)e=r(++t);return t}function Ee(e,t,r,n){if(!e)return 0;let o=e.value.charCodeAt(t);if(o===yt||o===de){if(r)return 0;t++}for(;t<e.value.length;t++)if(!M(e.value.charCodeAt(t)))return 0;return n+1}function Rr(e,t,r){let n=!1,o=bt(e,t,r);if(e=r(o),e===null)return t;if(e.type!==10)if(Mr(e,yt)||Mr(e,de)){if(n=!0,o=bt(r(++o),o,r),e=r(o),e===null||e.type!==10)return 0}else return t;if(!n){let i=e.value.charCodeAt(0);if(i!==yt&&i!==de)return 0}return Ee(e,n?0:1,n,o)}function Br(e,t){let r=0;if(!e)return 0;if(e.type===10)return Ee(e,0,Xl,r);if(e.type===1&&e.value.charCodeAt(0)===de){if(!ye(e.value,1,Fr))return 0;switch(e.value.length){case 2:return Rr(t(++r),r,t);case 3:return e.value.charCodeAt(2)!==de?0:(r=bt(t(++r),r,t),e=t(r),Ee(e,0,tt,r));default:return e.value.charCodeAt(2)!==de?0:Ee(e,3,tt,r)}}else if(e.type===1||Mr(e,yt)&&t(r+1).type===1){if(e.type!==1&&(e=t(++r)),e===null||!ye(e.value,0,Fr))return 0;switch(e.value.length){case 1:return Rr(t(++r),r,t);case 2:return e.value.charCodeAt(1)!==de?0:(r=bt(t(++r),r,t),e=t(r),Ee(e,0,tt,r));default:return e.value.charCodeAt(1)!==de?0:Ee(e,2,tt,r)}}else if(e.type===12){let n=e.value.charCodeAt(0),o=n===yt||n===de?1:0,i=o;for(;i<e.value.length&&M(e.value.charCodeAt(i));i++);return i===o||!ye(e.value,i,Fr)?0:i+1===e.value.length?Rr(t(++r),r,t):e.value.charCodeAt(i+1)!==de?0:i+2===e.value.length?(r=bt(t(++r),r,t),e=t(r),Ee(e,0,tt,r)):Ee(e,i+2,tt,r)}return 0}var $l=43,ha=45,ma=63,Zl=117;function _r(e,t){return e!==null&&e.type===9&&e.value.charCodeAt(0)===t}function Jl(e,t){return e.value.charCodeAt(0)===t}function xt(e,t,r){let n=0;for(let o=t;o<e.value.length;o++){let i=e.value.charCodeAt(o);if(i===ha&&r&&n!==0)return xt(e,t+n+1,!1),6;if(!te(i)||++n>6)return 0}return n}function $t(e,t,r){if(!e)return 0;for(;_r(r(t),ma);){if(++e>6)return 0;t++}return t}function Wr(e,t){let r=0;if(e===null||e.type!==1||!ye(e.value,0,Zl)||(e=t(++r),e===null))return 0;if(_r(e,$l))return e=t(++r),e===null?0:e.type===1?$t(xt(e,0,!0),++r,t):_r(e,ma)?$t(1,++r,t):0;if(e.type===10){let n=xt(e,1,!0);return n===0?0:(e=t(++r),e===null?r:e.type===12||e.type===10?!Jl(e,ha)||!xt(e,1,!1)?0:r+1:$t(n,r,t))}return e.type===12?$t(xt(e,1,!0),++r,t):0}var qr=["calc(","-moz-calc(","-webkit-calc("],jr=["min(","max(","clamp("],Ur=["round(","mod(","rem("],ec=["sin(","cos(","tan("],tc=["asin(","acos(","atan(","atan2("],rc=["pow(","sqrt(","log(","exp(","sign("],Hr=["hypot("],Gr=["abs("],da=[...qr,...jr,...Ur,...ec,...rc,...Hr,...Gr],nc=[...qr,...jr,...Ur,...Hr,...Gr],ve=[...qr,...jr,...Ur,...tc,...Hr,...Gr],Yr=new Map([[2,22],[21,22],[19,20],[23,24]]);function he(e,t){return t<e.length?e.charCodeAt(t):0}function fa(e,t){return xe(e,0,e.length,t)}function ga(e,t){for(let r=0;r<t.length;r++)if(fa(e,t[r]))return!0;return!1}function ba(e,t){return t!==e.length-2?!1:he(e,t)===92&&M(he(e,t+1))}function Zt(e,t,r){if(e&&e.type==="Range"){let n=Number(r!==void 0&&r!==t.length?t.substr(0,r):t);if(isNaN(n)||e.min!==null&&n<e.min&&typeof e.min!="string"||e.max!==null&&n>e.max&&typeof e.max!="string")return!0}return!1}function oc(e,t){let r=0,n=[],o=0;e:do{switch(e.type){case 24:case 22:case 20:if(e.type!==r)break e;if(r=n.pop(),n.length===0){o++;break e}break;case 2:case 21:case 19:case 23:n.push(r),r=Yr.get(e.type);break}o++}while(e=t(o));return o}function ae(e,t){return function(r,n,o){return r===null?0:r.type===2&&ga(r.value,t)?oc(r,n):e(r,n,o)}}function P(e){return function(t){return t===null||t.type!==e?0:1}}function ic(e){if(e===null||e.type!==1)return 0;let t=e.value.toLowerCase();return ga(t,et)||fa(t,"default")?0:1}function ya(e){return e===null||e.type!==1||he(e.value,0)!==45||he(e.value,1)!==45?0:1}function ac(e){return!ya(e)||e.value==="--"?0:1}function sc(e){if(e===null||e.type!==4)return 0;let t=e.value.length;if(t!==4&&t!==5&&t!==7&&t!==9)return 0;for(let r=1;r<t;r++)if(!te(he(e.value,r)))return 0;return 1}function lc(e){return e===null||e.type!==4||!Ue(he(e.value,1),he(e.value,2),he(e.value,3))?0:1}function cc(e,t){if(!e)return 0;let r=0,n=[],o=0;e:do{switch(e.type){case 6:case 8:break e;case 24:case 22:case 20:if(e.type!==r)break e;r=n.pop();break;case 17:if(r===0)break e;break;case 9:if(r===0&&e.value==="!")break e;break;case 2:case 21:case 19:case 23:n.push(r),r=Yr.get(e.type);break}o++}while(e=t(o));return o}function uc(e,t){if(!e)return 0;let r=0,n=[],o=0;e:do{switch(e.type){case 6:case 8:break e;case 24:case 22:case 20:if(e.type!==r)break e;r=n.pop();break;case 2:case 21:case 19:case 23:n.push(r),r=Yr.get(e.type);break}o++}while(e=t(o));return o}function Se(e){return e&&(e=new Set(e)),function(t,r,n){if(t===null||t.type!==12)return 0;let o=De(t.value,0);if(e!==null){let i=t.value.indexOf("\\",o),a=i===-1||!ba(t.value,i)?t.value.substr(o):t.value.substring(o,i);if(e.has(a.toLowerCase())===!1)return 0}return Zt(n,t.value,o)?0:1}}function pc(e,t,r){return e===null||e.type!==11||Zt(r,e.value,e.value.length-1)?0:1}function xa(e){return typeof e!="function"&&(e=function(){return 0}),function(t,r,n){return t!==null&&t.type===10&&Number(t.value)===0?1:e(t,r,n)}}function hc(e,t,r){if(e===null)return 0;let n=De(e.value,0);return!(n===e.value.length)&&!ba(e.value,n)||Zt(r,e.value,n)?0:1}function mc(e,t,r){if(e===null||e.type!==10)return 0;let n=he(e.value,0)===43||he(e.value,0)===45?1:0;for(;n<e.value.length;n++)if(!M(he(e.value,n)))return 0;return Zt(r,e.value,n)?0:1}var dc={"ident-token":P(1),"function-token":P(2),"at-keyword-token":P(3),"hash-token":P(4),"string-token":P(5),"bad-string-token":P(6),"url-token":P(7),"bad-url-token":P(8),"delim-token":P(9),"number-token":P(10),"percentage-token":P(11),"dimension-token":P(12),"whitespace-token":P(13),"CDO-token":P(14),"CDC-token":P(15),"colon-token":P(16),"semicolon-token":P(17),"comma-token":P(18),"[-token":P(19),"]-token":P(20),"(-token":P(21),")-token":P(22),"{-token":P(23),"}-token":P(24)},fc={string:P(5),ident:P(1),percentage:ae(pc,nc),zero:xa(),number:ae(hc,da),integer:ae(mc,da),"custom-ident":ic,"dashed-ident":ya,"custom-property-name":ac,"hex-color":sc,"id-selector":lc,"an-plus-b":Br,urange:Wr,"declaration-value":cc,"any-value":uc},gc=["length","angle","time","frequency","resolution","flex","decibel","semitones"];function bc(e){let{angle:t,decibel:r,frequency:n,flex:o,length:i,resolution:a,semitones:c,time:u}=e||{};return{dimension:ae(Se(null),ve),angle:ae(Se(t),ve),decibel:ae(Se(r),ve),frequency:ae(Se(n),ve),flex:ae(Se(o),ve),length:ae(xa(Se(i)),ve),resolution:ae(Se(a),ve),semitones:ae(Se(c),ve),time:ae(Se(u),ve)}}function yc(e){let t=new Set;for(let r of gc)if(Array.isArray(e[r]))for(let n of e[r])t.add(n.toLowerCase());return function(n){return n===null?0:n.type===9&&n.value==="%"||n.type===1&&t.has(n.value.toLowerCase())?1:0}}function ka(e){return{...dc,...fc,...bc(e),"attr-unit":yc(e)}}var Jt={};f(Jt,{angle:()=>kc,decibel:()=>Tc,flex:()=>Cc,frequency:()=>vc,length:()=>xc,resolution:()=>Sc,semitones:()=>Lc,time:()=>wc});var xc=["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],kc=["deg","grad","rad","turn"],wc=["s","ms"],vc=["hz","khz"],Sc=["dpi","dpcm","dppx","x"],Cc=["fr"],Tc=["db"],Lc=["st"];var en={};f(en,{SyntaxError:()=>er,generate:()=>Fe,parse:()=>nt,walk:()=>ar});function er(e,t,r){return Object.assign(Pe("SyntaxError",e),{input:t,offset:r,rawMessage:e,message:e+`
  `+t+`
--`+new Array((r||t.length)+1).join("-")+"^"})}var Ac=9,Ec=10,zc=12,Ic=13,Pc=32,wa=new Uint8Array(128).map((e,t)=>/[a-zA-Z0-9\-]/.test(String.fromCharCode(t))?1:0),tr=class{constructor(t){this.str=t,this.pos=0}charCodeAt(t){return t<this.str.length?this.str.charCodeAt(t):0}charCode(){return this.charCodeAt(this.pos)}isNameCharCode(t=this.charCode()){return t<128&&wa[t]===1}nextCharCode(){return this.charCodeAt(this.pos+1)}nextNonWsCode(t){return this.charCodeAt(this.findWsEnd(t))}skipWs(){this.pos=this.findWsEnd(this.pos)}findWsEnd(t){for(;t<this.str.length;t++){let r=this.str.charCodeAt(t);if(r!==Ic&&r!==Ec&&r!==zc&&r!==Pc&&r!==Ac)break}return t}substringToPos(t){return this.str.substring(this.pos,this.pos=t)}eat(t){this.charCode()!==t&&this.error("Expect `"+String.fromCharCode(t)+"`"),this.pos++}peek(){return this.pos<this.str.length?this.str.charAt(this.pos++):""}error(t){throw new er(t,this.str,this.pos)}scanSpaces(){return this.substringToPos(this.findWsEnd(this.pos))}scanWord(){let t=this.pos;for(;t<this.str.length;t++){let r=this.str.charCodeAt(t);if(r>=128||wa[r]===0)break}return this.pos===t&&this.error("Expect a keyword"),this.substringToPos(t)}scanNumber(){let t=this.pos;for(;t<this.str.length;t++){let r=this.str.charCodeAt(t);if(r<48||r>57)break}return this.pos===t&&this.error("Expect a number"),this.substringToPos(t)}scanString(){let t=this.str.indexOf("'",this.pos+1);return t===-1&&(this.pos=this.str.length,this.error("Expect an apostrophe")),this.substringToPos(t+1)}};var Nc=9,Dc=10,Oc=12,Fc=13,Rc=32,Ea=33,Xr=35,va=38,rr=39,za=40,Ia=41,Pa=42,$r=43,Zr=44,Sa=45,Jr=60,Vr=62,nr=63,Mc=64,kt=91,rt=93,or=123,Ca=124,Qr=125,Ta=8734,La={" ":1,"&&":2,"||":3,"|":4};function Aa(e){let t=null,r=null;return e.eat(or),e.skipWs(),t=e.scanNumber(e),e.skipWs(),e.charCode()===Zr?(e.pos++,e.skipWs(),e.charCode()!==Qr&&(r=e.scanNumber(e),e.skipWs())):r=t,e.eat(Qr),{min:Number(t),max:r?Number(r):0}}function Bc(e){let t=null,r=!1;switch(e.charCode()){case Pa:e.pos++,t={min:0,max:0};break;case $r:e.pos++,t={min:1,max:0};break;case nr:e.pos++,t={min:0,max:1};break;case Xr:e.pos++,r=!0,e.charCode()===or?t=Aa(e):e.charCode()===nr?(e.pos++,t={min:0,max:0}):t={min:1,max:0};break;case or:t=Aa(e);break;default:return null}return{type:"Multiplier",comma:r,min:t.min,max:t.max,term:null}}function Ce(e,t){let r=Bc(e);return r!==null?(r.term=t,e.charCode()===Xr&&e.charCodeAt(e.pos-1)===$r||e.charCode()===nr&&e.charCodeAt(e.pos-1)===Qr?Ce(e,r):r):t}function Kr(e){let t=e.peek();return t===""?null:Ce(e,{type:"Token",value:t})}function _c(e){let t;return e.eat(Jr),e.eat(rr),t=e.scanWord(),e.eat(rr),e.eat(Vr),Ce(e,{type:"Property",name:t})}function Wc(e){let t=null,r=null,n=1;return e.eat(kt),e.charCode()===Sa&&(e.peek(),n=-1),n==-1&&e.charCode()===Ta?e.peek():(t=n*Number(e.scanNumber(e)),e.isNameCharCode()&&(t+=e.scanWord())),e.skipWs(),e.eat(Zr),e.skipWs(),e.charCode()===Ta?e.peek():(n=1,e.charCode()===Sa&&(e.peek(),n=-1),r=n*Number(e.scanNumber(e)),e.isNameCharCode()&&(r+=e.scanWord())),e.eat(rt),{type:"Range",min:t,max:r}}function qc(e){let t,r=null;if(e.eat(Jr),t=e.scanWord(),t==="boolean-expr"){e.eat(kt);let n=ir(e,rt);return e.eat(rt),e.eat(Vr),Ce(e,{type:"Boolean",term:n.terms.length===1?n.terms[0]:n})}return e.charCode()===za&&e.nextCharCode()===Ia&&(e.pos+=2,t+="()"),e.charCodeAt(e.findWsEnd(e.pos))===kt&&(e.skipWs(),r=Wc(e)),e.eat(Vr),Ce(e,{type:"Type",name:t,opts:r})}function jc(e){let t=e.scanWord();return e.charCode()===za?(e.pos++,{type:"Function",name:t}):Ce(e,{type:"Keyword",name:t})}function Uc(e,t){function r(o,i){return{type:"Group",terms:o,combinator:i,disallowEmpty:!1,explicit:!1}}let n;for(t=Object.keys(t).sort((o,i)=>La[o]-La[i]);t.length>0;){n=t.shift();let o=0,i=0;for(;o<e.length;o++){let a=e[o];a.type==="Combinator"&&(a.value===n?(i===-1&&(i=o-1),e.splice(o,1),o--):(i!==-1&&o-i>1&&(e.splice(i,o-i,r(e.slice(i,o),n)),o=i+1),i=-1))}i!==-1&&t.length&&e.splice(i,o-i,r(e.slice(i,o),n))}return n}function ir(e,t=-1){let r=Object.create(null),n=[],o=null,i=e.pos,a=!1;for(;e.charCode()!==t;){let c=a?ir(e,Ia):Gc(e);if(!c)break;if(c.type!=="Spaces"){if(a){if(c.terms.length===0){a=!1;continue}if(c.combinator===" "){for(;c.terms.length>1;)r[" "]=!0,n.push({type:"Combinator",value:" "},c.terms.shift());c=c.terms[0]}}c.type==="Combinator"?((o===null||o.type==="Combinator")&&(e.pos=i,e.error("Unexpected combinator")),r[c.value]=!0):o!==null&&o.type!=="Combinator"&&(r[" "]=!0,n.push({type:"Combinator",value:" "})),n.push(c),o=c,i=e.pos,a=c.type==="Function"}}return o!==null&&o.type==="Combinator"&&(e.pos-=i,e.error("Unexpected combinator")),{type:"Group",terms:n,combinator:Uc(n,r)||" ",disallowEmpty:!1,explicit:!1}}function Hc(e){let t;return e.eat(kt),t=ir(e,rt),e.eat(rt),t.explicit=!0,e.charCode()===Ea&&(e.pos++,t.disallowEmpty=!0),t}function Gc(e){let t=e.charCode();switch(t){case rt:break;case kt:return Ce(e,Hc(e));case Jr:return e.nextCharCode()===rr?_c(e):qc(e);case Ca:return{type:"Combinator",value:e.substringToPos(e.pos+(e.nextCharCode()===Ca?2:1))};case va:return e.pos++,e.eat(va),{type:"Combinator",value:"&&"};case Zr:return e.pos++,{type:"Comma"};case rr:return Ce(e,{type:"String",value:e.scanString()});case Rc:case Nc:case Dc:case Fc:case Oc:return{type:"Spaces",value:e.scanSpaces()};case Mc:return t=e.nextCharCode(),e.isNameCharCode(t)?(e.pos++,{type:"AtKeyword",name:e.scanWord()}):Kr(e);case Pa:case $r:case nr:case Xr:case Ea:break;case or:if(t=e.nextCharCode(),t<48||t>57)return Kr(e);break;default:return e.isNameCharCode(t)?jc(e):Kr(e)}}function nt(e){let t=new tr(e),r=ir(t);return t.pos!==e.length&&t.error("Unexpected input"),r.terms.length===1&&r.terms[0].type==="Group"?r.terms[0]:r}var wt=function(){};function Na(e){return typeof e=="function"?e:wt}function ar(e,t,r){function n(a){switch(o.call(r,a),a.type){case"Group":a.terms.forEach(n);break;case"Multiplier":case"Boolean":n(a.term);break;case"Type":case"Property":case"Keyword":case"AtKeyword":case"Function":case"String":case"Token":case"Comma":break;default:throw new Error("Unknown type: "+a.type)}i.call(r,a)}let o=wt,i=wt;if(typeof t=="function"?o=t:t&&(o=Na(t.enter),i=Na(t.leave)),o===wt&&i===wt)throw new Error("Neither `enter` nor `leave` walker handler is set or both aren't a function");n(e,r)}var Yc={decorator(e){let t=[],r=null;return{...e,node(n){let o=r;r=n,e.node.call(this,n),r=o},emit(n,o,i){t.push({type:o,value:n,node:i?null:r})},result(){return t}}}};function Kc(e,t){let r=[];return Ae(t)(e,(o,i,a)=>r.push({type:o,value:e.slice(i,a),node:null})),r}function Da(e,t){return typeof e=="string"?Kc(e,t):t.generate(e,Yc)}var C={type:"Match"},A={type:"Mismatch"},sr={type:"DisallowEmpty"},Vc=40,Qc=41;function Z(e,t,r){return t===C&&r===A||e===C&&t===C&&r===C?e:(e.type==="If"&&e.else===A&&t===C&&(t=e.then,e=e.match),{type:"If",match:e,then:t,else:r})}function Fa(e){return e.length>2&&e.charCodeAt(e.length-2)===Vc&&e.charCodeAt(e.length-1)===Qc}function Oa(e){return e.type==="Keyword"||e.type==="AtKeyword"||e.type==="Function"||e.type==="Type"&&Fa(e.name)}function ze(e,t=" ",r=!1){return{type:"Group",terms:e,combinator:t,disallowEmpty:!1,explicit:r}}function vt(e,t,r=new Set){if(!r.has(e))switch(r.add(e),e.type){case"If":e.match=vt(e.match,t,r),e.then=vt(e.then,t,r),e.else=vt(e.else,t,r);break;case"Type":return t[e.name]||e}return e}function tn(e,t,r){switch(e){case" ":{let n=C;for(let o=t.length-1;o>=0;o--){let i=t[o];n=Z(i,n,A)}return n}case"|":{let n=A,o=null;for(let i=t.length-1;i>=0;i--){let a=t[i];if(Oa(a)&&(o===null&&i>0&&Oa(t[i-1])&&(o=Object.create(null),n=Z({type:"Enum",map:o},C,n)),o!==null)){let c=(Fa(a.name)?a.name.slice(0,-1):a.name).toLowerCase();if(!(c in o)){o[c]=a;continue}}o=null,n=Z(a,C,n)}return n}case"&&":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!0};let n=A;for(let o=t.length-1;o>=0;o--){let i=t[o],a;t.length>1?a=tn(e,t.filter(function(c){return c!==i}),!1):a=C,n=Z(i,a,n)}return n}case"||":{if(t.length>5)return{type:"MatchOnce",terms:t,all:!1};let n=r?C:A;for(let o=t.length-1;o>=0;o--){let i=t[o],a;t.length>1?a=tn(e,t.filter(function(c){return c!==i}),!0):a=C,n=Z(i,a,n)}return n}}}function Xc(e){let t=C,r=ot(e.term);if(e.max===0)r=Z(r,sr,A),t=Z(r,null,A),t.then=Z(C,C,t),e.comma&&(t.then.else=Z({type:"Comma",syntax:e},t,A));else for(let n=e.min||1;n<=e.max;n++)e.comma&&t!==C&&(t=Z({type:"Comma",syntax:e},t,A)),t=Z(r,Z(C,C,t),A);if(e.min===0)t=Z(C,C,t);else for(let n=0;n<e.min-1;n++)e.comma&&t!==C&&(t=Z({type:"Comma",syntax:e},t,A)),t=Z(r,t,A);return t}function ot(e){if(typeof e=="function")return{type:"Generic",fn:e};switch(e.type){case"Group":{let t=tn(e.combinator,e.terms.map(ot),!1);return e.disallowEmpty&&(t=Z(t,sr,A)),t}case"Multiplier":return Xc(e);case"Boolean":{let t=ot(e.term),r=ot(ze([ze([{type:"Keyword",name:"not"},{type:"Type",name:"!boolean-group"}]),ze([{type:"Type",name:"!boolean-group"},ze([{type:"Multiplier",comma:!1,min:0,max:0,term:ze([{type:"Keyword",name:"and"},{type:"Type",name:"!boolean-group"}])},{type:"Multiplier",comma:!1,min:0,max:0,term:ze([{type:"Keyword",name:"or"},{type:"Type",name:"!boolean-group"}])}],"|")])],"|")),n=ot(ze([{type:"Type",name:"!term"},ze([{type:"Token",value:"("},{type:"Type",name:"!self"},{type:"Token",value:")"}]),{type:"Type",name:"general-enclosed"}],"|"));return vt(n,{"!term":t,"!self":r}),vt(r,{"!boolean-group":n}),r}case"Type":case"Property":return{type:e.type,name:e.name,syntax:e};case"Keyword":return{type:e.type,name:e.name.toLowerCase(),syntax:e};case"AtKeyword":return{type:e.type,name:"@"+e.name.toLowerCase(),syntax:e};case"Function":return{type:e.type,name:e.name.toLowerCase()+"(",syntax:e};case"String":return e.value.length===3?{type:"Token",value:e.value.charAt(1),syntax:e}:{type:e.type,value:e.value.substr(1,e.value.length-2).replace(/\\'/g,"'"),syntax:e};case"Token":return{type:e.type,value:e.value,syntax:e};case"Comma":return{type:e.type,syntax:e};default:throw new Error("Unknown node type:",e.type)}}function St(e,t){return typeof e=="string"&&(e=nt(e)),{type:"MatchGraph",match:ot(e),syntax:t||null,source:e}}var{hasOwnProperty:Ra}=Object.prototype,$c=0,Zc=1,nn=2,qa=3,Ma="Match",Jc="Mismatch",eu="Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)",Ba=15e4,tu=0;function ru(e){let t=null,r=null,n=e;for(;n!==null;)r=n.prev,n.prev=t,t=n,n=r;return t}function rn(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++){let n=t.charCodeAt(r),o=e.charCodeAt(r);if(o>=65&&o<=90&&(o=o|32),o!==n)return!1}return!0}function nu(e){return e.type!==9?!1:e.value!=="?"}function _a(e){return e===null?!0:e.type===18||e.type===2||e.type===21||e.type===19||e.type===23||nu(e)}function Wa(e){return e===null?!0:e.type===22||e.type===20||e.type===24||e.type===9&&e.value==="/"}function ou(e,t,r){function n(){do E++,v=E<e.length?e[E]:null;while(v!==null&&(v.type===13||v.type===25))}function o(re){let ge=E+re;return ge<e.length?e[ge]:null}function i(re,ge){return{nextState:re,matchStack:z,syntaxStack:p,thenStack:h,tokenIndex:E,prev:ge}}function a(re){h={nextState:re,matchStack:z,syntaxStack:p,prev:h}}function c(re){d=i(re,d)}function u(){z={type:Zc,syntax:t.syntax,token:v,prev:z},n(),b=null,E>K&&(K=E)}function s(){p={syntax:t.syntax,opts:t.syntax.opts||p!==null&&p.opts||null,prev:p},z={type:nn,syntax:t.syntax,token:z.token,prev:z}}function l(){z.type===nn?z=z.prev:z={type:qa,syntax:p.syntax,token:z.token,prev:z},p=p.prev}let p=null,h=null,d=null,b=null,Y=0,J=null,v=null,E=-1,K=0,z={type:$c,syntax:null,token:null,prev:null};for(n();J===null&&++Y<Ba;)switch(t.type){case"Match":if(h===null){if(v!==null&&(E!==e.length-1||v.value!=="\\0"&&v.value!=="\\9")){t=A;break}J=Ma;break}if(t=h.nextState,t===sr)if(h.matchStack===z){t=A;break}else t=C;for(;h.syntaxStack!==p;)l();h=h.prev;break;case"Mismatch":if(b!==null&&b!==!1)(d===null||E>d.tokenIndex)&&(d=b,b=!1);else if(d===null){J=Jc;break}t=d.nextState,h=d.thenStack,p=d.syntaxStack,z=d.matchStack,E=d.tokenIndex,v=E<e.length?e[E]:null,d=d.prev;break;case"MatchGraph":t=t.match;break;case"If":t.else!==A&&c(t.else),t.then!==C&&a(t.then),t=t.match;break;case"MatchOnce":t={type:"MatchOnceBuffer",syntax:t,index:0,mask:0};break;case"MatchOnceBuffer":{let j=t.syntax.terms;if(t.index===j.length){if(t.mask===0||t.syntax.all){t=A;break}t=C;break}if(t.mask===(1<<j.length)-1){t=C;break}for(;t.index<j.length;t.index++){let V=1<<t.index;if((t.mask&V)===0){c(t),a({type:"AddMatchOnce",syntax:t.syntax,mask:t.mask|V}),t=j[t.index++];break}}break}case"AddMatchOnce":t={type:"MatchOnceBuffer",syntax:t.syntax,index:0,mask:t.mask};break;case"Enum":if(v!==null){let j=v.value.toLowerCase();if(j.indexOf("\\")!==-1&&(j=j.replace(/\\[09].*$/,"")),Ra.call(t.map,j)){t=t.map[j];break}}t=A;break;case"Generic":{let j=p!==null?p.opts:null,V=E+Math.floor(t.fn(v,o,j));if(!isNaN(V)&&V>E){for(;E<V;)u();t=C}else t=A;break}case"Type":case"Property":{let j=t.type==="Type"?"types":"properties",V=Ra.call(r,j)?r[j][t.name]:null;if(!V||!V.match)throw new Error("Bad syntax reference: "+(t.type==="Type"?"<"+t.name+">":"<'"+t.name+"'>"));if(b!==!1&&v!==null&&t.type==="Type"&&(t.name==="custom-ident"&&v.type===1||t.name==="length"&&v.value==="0")){b===null&&(b=i(t,d)),t=A;break}s(),t=V.matchRef||V.match;break}case"Keyword":{let j=t.name;if(v!==null){let V=v.value;if(V.indexOf("\\")!==-1&&(V=V.replace(/\\[09].*$/,"")),rn(V,j)){u(),t=C;break}}t=A;break}case"AtKeyword":case"Function":if(v!==null&&rn(v.value,t.name)){u(),t=C;break}t=A;break;case"Token":if(v!==null&&v.value===t.value){u(),t=C;break}t=A;break;case"Comma":v!==null&&v.type===18?_a(z.token)?t=A:(u(),t=Wa(v)?A:C):t=_a(z.token)||Wa(v)?C:A;break;case"String":let re="",ge=E;for(;ge<e.length&&re.length<t.value.length;ge++)re+=e[ge].value;if(rn(re,t.value)){for(;E<ge;)u();t=C}else t=A;break;default:throw new Error("Unknown node type: "+t.type)}switch(tu+=Y,J){case null:console.warn("[csstree-match] BREAK after "+Ba+" iterations"),J=eu,z=null;break;case Ma:for(;p!==null;)l();break;default:z=null}return{tokens:e,reason:J,iterations:Y,match:z,longestMatch:K}}function on(e,t,r){let n=ou(e,t,r||{});if(n.match===null)return n;let o=n.match,i=n.match={syntax:t.syntax||null,match:[]},a=[i];for(o=ru(o).prev;o!==null;){switch(o.type){case nn:i.match.push(i={syntax:o.syntax,match:[]}),a.push(i);break;case qa:a.pop(),i=a[a.length-1];break;default:i.match.push({syntax:o.syntax||null,token:o.token.value,node:o.token.node})}o=o.prev}return n}var sn={};f(sn,{getTrace:()=>ja,isKeyword:()=>su,isProperty:()=>au,isType:()=>iu});function ja(e){function t(o){return o===null?!1:o.type==="Type"||o.type==="Property"||o.type==="Keyword"}function r(o){if(Array.isArray(o.match)){for(let i=0;i<o.match.length;i++)if(r(o.match[i]))return t(o.syntax)&&n.unshift(o.syntax),!0}else if(o.node===e)return n=t(o.syntax)?[o.syntax]:[],!0;return!1}let n=null;return this.matched!==n   ull&&r(this.matched),n}function iu(e,t){return an(this,e,r=>r.type==="Type"&&r.name===t)}function au(e,t){return an(this,e,r=>r.type==="Property"&&r.name===t)}function su(e){return an(this,e,t=>t.type==="Keyword")}function an(e,t,r){let n=ja.call(e,t);return n===null?!1:n.some(r)}function Ua(e){return"node"in e?e.node:Ua(e.match[0])}function Ha(e){return"node"in e?e.node:Ha(e.match[e.match.length-1])}function ln(e,t,r,n,o){function i(c){if(c.syntax!==null&&c.syntax.type===n&&c.syntax.name===o){let u=Ua(c),s=Ha(c);e.syntax.walk(t,function(l,p,h){if(l===u){let d=new U;do{if(d.appendData(p.data),p.data===s)break;p=p.next}while(p!==null);a.push({parent:h,nodes:d})}})}Array.isArray(c.match)&&c.match.forEach(i)}let a=[];return r.matched!==null&&i(r.matched),a}var{hasOwnProperty:Ct}=Object.prototype;function cn(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e&&e>=0}function Ga(e){return!!e&&cn(e.offset)&&cn(e.line)&&cn(e.column)}function lu(e,t){return function(n,o){if(!n||n.constructor!==Object)return o(n,"Type of node should be an Object");for(let i in n){let a=!0;if(Ct.call(n,i)!==!1){if(i==="type")n.type!==e&&o(n,"Wrong node type `"+n.type+"`, expected `"+e+"`");else if(i==="loc"){if(n.loc===null)continue;if(n.loc&&n.loc.constructor===Object)if(typeof n.loc.source!="string")i+=".source";else if(!Ga(n.loc.start))i+=".start";else if(!Ga(n.loc.end))i+=".end";else continue;a=!1}else if(t.hasOwnProperty(i)){a=!1;for(let c=0;!a&&c<t[i].length;c++){let u=t[i][c];switch(u){case String:a=typeof n[i]=="string";break;case Boolean:a=typeof n[i]=="boolean";break;case null:a=n[i]===null;break;default:typeof u=="string"?a=n[i]&&n[i].type===u:Array.isArray(u)&&(a=n[i]instanceof U)}}}else o(n,"Unknown field `"+i+"` for "+e+" node type");a||o(n,"Bad value for `"+e+"."+i+"`")}}for(let i in t)Ct.call(t,i)&&Ct.call(n,i)===!1&&o(n,"Field `"+e+"."+i+"` is missed")}}function Ya(e,t){let r=[];for(let n=0;n<e.length;n++){let o=e[n];if(o===String||o===Boolean)r.push(o.name.toLowerCase());else if(o===null)r.push("null");else if(typeof o=="string")r.push(o);else if(Array.isArray(o))r.push("List<"+(Ya(o,t)||"any")+">");else throw new Error("Wrong value `"+o+"` in `"+t+"` structure definition")}return r.join(" | ")}function cu(e,t){let r=t.structure,n={type:String,loc:!0},o={type:'"'+e+'"'};for(let i in r){if(Ct.call(r,i)===!1)continue;let a=n[i]=Array.isArray(r[i])?r[i].slice():[r[i]];o[i]=Ya(a,e+"."+i)}return{docs:o,check:lu(e,n)}}function Ka(e){let t={};if(e.node){for(let r in e.node)if(Ct.call(e.node,r)){let n=e.node[r];if(n.structure)t[r]=cu(r,n);else throw new Error("Missed `structure` field in `"+r+"` node type definition")}}return t}function un(e,t,r){let n={};for(let o in e)e[o].syntax&&(n[o]=r?e[o].syntax:Fe(e[o].syntax,{compact:t}));return n}function uu(e,t,r){let n={};for(let[o,i]of Object.entries(e))n[o]={prelude:i.prelude&&(r?i.prelude.syntax:Fe(i.prelude.syntax,{compact:t})),descriptors:i.descriptors&&un(i.descriptors,t,r)};return n}function pu(e){for(let t=0;t<e.length;t++)if(e[t].value.toLowerCase()==="var(")return!0;return!1}function hu(e){let t=e.terms[0];return e.explicit===!1&&e.terms.length===1&&t.type==="Multiplier"&&t.comma===!0}function mu(e){for(let t=0;t<e.length;t++)if(e[t].value.toLowerCase()==="env(")return!0;return!1}function se(e,t,r){return{matched:e,iterations:r,error:t,...sn}}function it(e,t,r,n){let o=Da(r,e.syntax),i;return pu(o)?se(null,new Error("Matching for a tree with var() is not supported")):mu(o)?se(null,new Error("Matching for a tree with env() is not supported")):(n&&(i=on(o,e.cssWideKeywordsSyntax,e)),(!n||!i.match)&&(i=on(o,t.match,e),!i.match)?se(null,new pa(i.reason,t.syntax,r,i),i.iterations):se(i.match,null,i.iterations))}var Re=class{constructor(t,r,n){if(this.cssWideKeywords=et,this.syntax=r,this.generic=!1,this.units={...Jt},this.atrules=Object.create(null),this.properties=Object.create(null),this.types=Object.create(null),this.structure=n||Ka(t),t){if(t.cssWideKeywords&&(this.cssWideKeywords=t.cssWideKeywords),t.units)for(let o of Object.keys(Jt))Array.isArray(t.units[o])&&(this.units[o]=t.units[o]);if(t.types)for(let[o,i]of Object.entries(t.types))this.addType_(o,i);if(t.generic){this.generic=!0;for(let[o,i]of Object.entries(ka(this.units)))this.addType_(o,i)}if(t.atrules)for(let[o,i]of Object.entries(t.atrules))this.addAtrule_(o,i);if(t.properties)for(let[o,i]of Object.entries(t.properties))this.addProperty_(o,i)}this.cssWideKeywordsSyntax=St(this.cssWideKeywords.join(" |  "))}checkStructure(t){function r(i,a){o.push({node:i,message:a})}let n=this.structure,o=[];return this.syntax.walk(t,function(i){n.hasOwnProperty(i.type)?n[i.type].check(i,r):r(i,"Unknown node type `"+i.type+"`")}),o.length?o:!1}createDescriptor(t,r,n,o=null){let i={type:r,name:n},a={type:r,name:n,parent:o,serializable:typeof t=="string"||t&&typeof t.type=="string",syntax:null,match:null,matchRef:null};return typeof t=="function"?a.match=St(t,i):(typeof t=="string"?Object.defineProperty(a,"syntax",{get(){return Object.defineProperty(a,"syntax",{value:nt(t)}),a.syntax}}):a.syntax=t,Object.defineProperty(a,"match",{get(){return Object.defineProperty(a,"match",{value:St(a.syntax,i)}),a.match}}),r==="Property"&&Object.defineProperty(a,"matchRef",{get(){let c=a.syntax,u=hu(c)?St({...c,terms:[c.terms[0].term]},i):null;return Object.defineProperty(a,"matchRef",{value:u}),u}})),a}addAtrule_(t,r){r&&(this.atrules[t]={type:"Atrule",name:t,prelude:r.prelude?this.createDescriptor(r.prelude,"AtrulePrelude",t):null,descriptors:r.descriptors?Object.keys(r.descriptors).reduce((n,o)=>(n[o]=this.createDescriptor(r.descriptors[o],"AtruleDescriptor",o,t),n),Object.create(null)):null})}addProperty_(t,r){r&&(this.properties[t]=this.createDescriptor(r,"Property",t))}addType_(t,r){r&&(this.types[t]=this.createDescriptor(r,"Type",t))}checkAtruleName(t){if(!this.getAtrule(t))return new $e("Unknown at-rule","@"+t)}checkAtrulePrelude(t,r){let n=this.checkAtruleName(t);if(n)return n;let o=this.getAtrule(t);if(!o.prelude&&r)return new SyntaxError("At-rule `@"+t+"` should not contain a prelude");if(o.prelude&&!r&&!it(this,o.prelude,"",!1).matched)return new SyntaxError("At-rule `@"+t+"` should contain a prelude")}checkAtruleDescriptorName(t,r){let n=this.checkAtruleName(t);if(n)return n;let o=this.getAtrule(t),i=Je(r);if(!o.descriptors)return new SyntaxError("At-rule `@"+t+"` has no known descriptors");if(!o.descriptors[i.name]&&!o.descriptors[i.basename])return new $e("Unknown at-rule descriptor",r)}checkPropertyName(t){if(!this.getProperty(t))return new $e("Unknown property",t)}matchAtrulePrelude(t,r){let n=this.checkAtrulePrelude(t,r);if(n)return se(null,n);let o=this.getAtrule(t);return o.prelude?it(this,o.prelude,r||"",!1):se(null,null)}matchAtruleDescriptor(t,r,n){let o=this.checkAtruleDescriptorName(t,r);if(o)return se(null,o);let i=this.getAtrule(t),a=Je(r);return it(this,i.descriptors[a.name]||i.descriptors[a.basename],n,!1)}matchDeclaration(t){return t.type!=="Declaration"?se(null,new Error("Not a Declaration node")):this.matchProperty(t.property,t.value)}matchProperty(t,r){if(!this.getProperty(t)&&Xt(t).custom)return se(null,new Error("Lexer matching doesn't applicable for custom properties"));let n=this.checkPropertyName(t);return n?se(null,n):it(this,this.getProperty(t),r,!0)}matchType(t,r){let n=this.getType(t);return n?it(this,n,r,!1):se(null,new $e("Unknown type",t))}match(t,r){return typeof t!="string"&&(!t||!t.type)?se(null,new $e("Bad syntax")):((typeof t=="string"||!t.match)&&(t=this.createDescriptor(t,"Type","anonymous")),it(this,t,r,!1))}findValueFragments(t,r,n,o){return ln(this,r,this.matchProperty(t,r),n,o)}findDeclarationValueFragments(t,r,n){return ln(this,t.value,this.matchDeclaration(t),r,n)}findAllFragments(t,r,n){let o=[];return this.syntax.walk(t,{visit:"Declaration",enter:i=>{o.push.apply(o,this.findDeclarationValueFragments(i,r,n))}}),o}getAtrule(t,r=!0){let n=Je(t);return(n.vendor&&r?this.atrules[n.name]||this.atrules[n.basename]:this.atrules[n.name])||null}getAtrulePrelude(t,r=!0){let n=this.getAtrule(t,r);return n&&n.prelude||null}getAtruleDescriptor(t,r){let n=this.getAtrule(t),o=Je(r);return(n&&n.descriptors?n.descriptors[o.name]||n.descriptors[o.basename]:null)||null}getProperty(t,r=!0){let n=Xt(t);return(n.vendor&&r?this.properties[n.name]||this.properties[n.basename]:this.properties[n.name])||null}getType(t){return hasOwnProperty.call(this.types,t)?this.types[t]:null}validate(){function t(u,s){return s?`<${u}>`:`<'${u}'>`}function r(u,s,l,p){if(l.has(s))return l.get(s);l.set(s,!1),p.syntax!==null&&ar(p.syntax,function(h){if(h.type!=="Type"&&h.type!=="Property")return;let d=h.type==="Type"?u.types:u.properties,b=h.type==="Type"?o:i;hasOwnProperty.call(d,h.name)?r(u,h.name,b,d[h.name])&&(n.push(`${t(s,l===o)} used broken syntax definition ${t(h.name,h.type==="Type")}`),l.set(s,!0)):(n.push(`${t(s,l===o)} used missed syntax definition ${t(h.name,h.type==="Type")}`),l.set(s,!0))},this)}let n=[],o=new Map,i=new Map;for(let u in this.types)r(this,u,o,this.types[u]);for(let u in this.properties)r(this,u,i,this.properties[u]);let a=[...o.keys()].filter(u=>o.get(u)),c=[...i.keys()].filter(u=>i.get(u));return a.length||c.length?{errors:n,types:a,properties:c}:null}dump(t,r){return{generic:this.generic,cssWideKeywords:this.cssWideKeywords,units:this.units,types:un(this.types,!r,t),properties:un(this.properties,!r,t),atrules:uu(this.atrules,!r,t)}}toString(){return JSON.stringify(this.dump())}};function pn(e,t){return typeof t=="string"&&/^\s*\|/.test(t)?typeof e=="string"?e+t:t.replace(/^\s*\|\s*/,""):t||null}function du(e,t){let r=Object.create(null);for(let n of Object.keys(e))t.includes(n)&&(r[n]=e[n]);return r}function hn(e,t,r){let n={...e};for(let[o,i]of Object.entries(t))n[o]={...n[o],...r?du(i,r):i};return n}function Tt(e,t){let r={...e};for(let[n,o]of Object.entries(t))switch(n){case"generic":r[n]=!!o;break;case"cssWideKeywords":r[n]=e[n]?[...e[n],...o]:o||[];break;case"units":r[n]={...e[n]};for(let[i,a]of Object.entries(o))r[n][i]=Array.isArray(a)?a:[];break;case"atrules":r[n]={...e[n]};for(let[i,a]of Object.entries(o)){let c=r[n][i]||{},u=r[n][i]={prelude:c.prelude||null,descriptors:{...c.descriptors}};if(a){u.prelude=a.prelude?pn(u.prelude,a.prelude):u.prelude||null;for(let[s,l]of Object.entries(a.descriptors||{}))u.descriptors[s]=l?pn(u.descriptors[s],l):null;Object.keys(u.descriptors).length||(u.descriptors=null)}}break;case"types":case"properties":r[n]={...e[n]};for(let[i,a]of Object.entries(o))r[n][i]=pn(r[n][i],a);break;case"parseContext":r[n]={...e[n],...o};break;case"scope":case"features":r[n]=hn(e[n],o);break;case"atrule":case"pseudo":r[n]=hn(e[n],o,["parse"]);break;case"node":r[n]=hn(e[n],o,["name","structure","parse","generate","walkContext"]);break;case"tokenize":typeof o=="function"&&(r[n]=o);break}return r}function Va(e){let t=Ni(e),r=ca(e),n=na(e),{fromPlainObject:o,toPlainObject:i}=oa(r),a={lexer:null,createLexer:c=>new Re(c,a,a.lexer.structure),tokenize:Ae(e),parse:t,generate:n,walk:r,find:r.find,findLast:r.findLast,findAll:r.findAll,fromPlainObject:o,toPlainObject:i,fork(c){let u=Tt({},e);return Va(typeof c=="function"?c(u):Tt(u,c))}};return a.lexer=new Re({generic:e.generic,cssWideKeywords:e.cssWideKeywords,units:e.units,types:e.types,atrules:e.atrules,properties:e.properties,node:e.node},a),a}var lr=e=>Va(Tt({},e));var Qa={generic:!0,cssWideKeywords:["initial","inherit","unset","revert","revert-layer"],units:{angle:["deg","grad","rad","turn"],decibel:["db"],flex:["fr"],frequency:["hz","khz"],length:["cm","mm","q","in","pt","pc","px","em","rem","ex","rex","cap","rcap","ch","rch","ic","ric","lh","rlh","vw","svw","lvw","dvw","vh","svh","lvh","dvh","vi","svi","lvi","dvi","vb","svb","lvb","dvb","vmin","svmin","lvmin","dvmin","vmax","svmax","lvmax","dvmax","cqw","cqh","cqi","cqb","cqmin","cqmax"],resolution:["dpi","dpcm","dppx","x"],semitones:["st"],time:["s","ms"]},types:{"abs()":"abs( <calc-sum> )","absolute-size":"xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large","acos()":"acos( <calc-sum> )","alpha-value":"<number>|<percentage>","an+b":"odd|even|<integer>|<n-dimension>|'+'? \u2020 n|-n|<ndashdigit-dimension>|'+'? \u2020 <ndashdigit-ident>|<dashndashdigit-ident>|<n-dimension> <signed-integer>|'+'? \u2020 n <signed-integer>|-n <signed-integer>|<ndash-dimension> <signless-integer>|'+'? \u2020 n- <signless-integer>|-n- <signless-integer>|<n-dimension> ['+'|'-'] <signless-integer>|'+'? \u2020 n ['+'|'-'] <signless-integer>|-n ['+'|'-'] <signless-integer>","anchor()":"anchor( <anchor-name>?&&<anchor-side> , <length-percentage>? )","anchor-name":"<dashed-ident>","anchor-side":"inside|outside|top|left|right|bottom|start|end|self-start|self-end|<percentage>|center","anchor-size":"width|height|block|inline|self-block|self-inline","anchor-size()":"anchor-size( [<anchor-name>||<anchor-size>]? , <length-percentage>? )","angle-percentage":"<angle>|<percentage>","angular-color-hint":"<angle-percentage>|<zero>","angular-color-stop":"<color> <color-stop-angle>?","angular-color-stop-list":"<angular-color-stop> , [<angular-color-hint>? , <angular-color-stop>]#?","animateable-feature":"scroll-position|contents|<custom-ident>","animation-action":"none|play|play-once|play-forwards|play-backwards|pause|reset|replay","asin()":"asin( <calc-sum> )","atan()":"atan( <calc-sum> )","atan2()":"atan2( <calc-sum> , <calc-sum> )",attachment:"scroll|fixed|local","attr()":"attr( <attr-name> <attr-type>? , <declaration-value>? )","attr-matcher":"['~'|'|'|'^'|'$'|'*']? '='","attr-modifier":"i|s","attr-type":"type( <syntax> )|raw-string|number|<attr-unit>","attribute-selector":"'[' <wq-name> ']'|'[' <wq-name> <attr-matcher> [<string-token>|<ident-token>] <attr-modifier>? ']'","auto-repeat":"repeat( [auto-fill|auto-fit] , [<line-names>? <fixed-size>]+ <line-names>? )","auto-track-list":"[<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>? <auto-repeat> [<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>?",axis:"block|inline|x|y","baseline-position":"[first|last]? baseline","basic-shape":"<inset()>|<xywh()>|<rect()>|<circle()>|<ellipse()>|<polygon()>|<path()>|shape( )","basic-shape-rect":"<inset()>|<rect()>|<xywh()>","bg-clip":"<visual-box>|border-area|text","bg-image":"<image>|none","bg-layer":"<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<visual-box>||<visual-box>","bg-position":"[[left|center|right|top|bottom|<length-percentage>]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]|[center|[left|right] <length-percentage>?]&&[center|[top|bottom] <length-percentage>?]]","bg-size":"[<length-percentage [0,\u221E]>|auto]{1,2}|cover|contain","blend-mode":"normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity","blur()":"blur( <length>? )","brightness()":"brightness( [<number>|<percentage>]? )","calc()":"calc( <calc-sum> )","calc-constant":"e|pi|infinity|-infinity|NaN","calc-product":"<calc-value> ['*' <calc-value>|'/' <number>]*","calc-size()":"calc-size( <calc-size-basis> , <calc-sum> )","calc-size-basis":"<intrinsic-size-keyword>|<calc-size()>|any|<calc-sum>","calc-sum":"<calc-product> [['+'|'-'] <calc-product>]*","calc-value":"<number>|<dimension>|<percentage>|<calc-constant>|( <calc-sum> )","cf-final-image":"<image>|<color>","cf-mixing-image":"<percentage>?&&<image>","circle()":"circle( <radial-size>? [at <position>]? )","clamp()":"clamp( <calc-sum>#{3} )","class-selector":"'.' <ident-token>","clip-source":"<url>",color:"<color-base>|currentColor|<system-color>|<device-cmyk()>|<light-dark()>|<-non-standard-color>","color()":"color( <colorspace-params> [/ [<alpha-value>|none]]? )","color-base":"<hex-color>|<color-function>|<named-color>|<color-mix()>|transparent","color-function":"<rgb()>|<rgba()>|<hsl()>|<hsla()>|<hwb()>|<lab()>|<lch()>|<oklab()>|<oklch()>|<alpha()>|<color()>","color-interpolation-method":"in [<rectangular-color-space>|<polar-color-space> <hue-interpolation-method>?|<custom-color-space>]","color-mix()":"color-mix( <color-interpolation-method> , [<color>&&<percentage [0,100]>?]#{2} )","color-stop":"<color-stop-length>|<color-stop-angle>","color-stop-angle":"[<angle-percentage>|<zero>]{1,2}","color-stop-length":"<length-percentage>{1,2}","color-stop-list":"<linear-color-stop> , [<linear-color-hint>? , <linear-color-stop>]#?","colorspace-params":"[<predefined-rgb-params>|<xyz-params>]",combinator:"'>'|'+'|'~'|['|' '|']","common-lig-values":"[common-ligatures|no-common-ligatures]","compat-auto":"searchfield|textarea|checkbox|radio|menulist|listbox|meter|progress-bar|button","compat-special":"textfield|menulist-button","complex-selector":"<complex-selector-unit> [<combinator>? <complex-selector-unit>]*","complex-selector-list":"<complex-selector>#","composite-style":"clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor","compositing-operator":"add|subtract|intersect|exclude","compound-selector":"[<type-selector>? <subclass-selector>*]!","compound-selector-list":"<compound-selector>#","conic-gradient()":"conic-gradient( [<conic-gradient-syntax>] )","conic-gradient-syntax":"[[[from [<angle>|<zero>]]? [at <position>]?]||<color-interpolation-method>]? , <angular-color-stop-list>","container-condition":"not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]","container-name":"<custom-ident>","container-query":"not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]","content-distribution":"space-between|space-around|space-evenly|stretch","content-list":"[<string>|contents|<image>|<counter>|<quote>|<target>|<leader()>|<attr()>]+","content-position":"center|start|end|flex-start|flex-end","content-replacement":"<image>","contextual-alt-values":"[contextual|no-contextual]","contrast()":"contrast( [<number>|<percentage>]? )","coord-box":"content-box|padding-box|border-box|fill-box|stroke-box|view-box","corner-shape-value":"round|scoop|bevel|notch|square|squircle|<superellipse()>","cos()":"cos( <calc-sum> )",counter:"<counter()>|<counters()>","counter()":"counter( <counter-name> , <counter-style>? )","counter-name":"<custom-ident>","counter-style":"<counter-style-name>|symbols( )","counter-style-name":"<custom-ident>","counters()":"counters( <counter-name> , <string> , <counter-style>? )","cross-fade()":"cross-fade( <cf-mixing-image> , <cf-final-image>? )","cubic-bezier()":"cubic-bezier( [<number [0,1]> , <number>]#{2} )","cubic-bezier-easing-function":"ease|ease-in|ease-out|ease-in-out|cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )","cursor-predefined":"auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing","custom-color-space":"<dashed-ident>","custom-params":"<dashed-ident> [<number>|<percentage>|none]+",dasharray:"[[<length-percentage>|<number>]+]#","dashndashdigit-ident":"<ident-token>","deprecated-system-color":"ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonHighlight|ButtonShadow|CaptionText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText","discretionary-lig-values":"[discretionary-ligatures|no-discretionary-ligatures]","display-box":"contents|none","display-inside":"flow|flow-root|table|flex|grid|ruby","display-internal":"table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container","display-legacy":"inline-block|inline-list-item|inline-table|inline-flex|inline-grid","display-listitem":"<display-outside>?&&[flow|flow-root]?&&list-item","display-outside":"block|inline|run-in","drop-shadow()":"drop-shadow( [<color>?&&<length>{2,3}] )","dynamic-range-limit-mix()":"dynamic-range-limit-mix( [<'dynamic-range-limit'>&&<percentage [0,100]>]#{2,} )","easing-function":"<linear-easing-function>|<cubic-bezier-easing-function>|<step-easing-function>","east-asian-variant-values":"[jis78|jis83|jis90|jis04|simplified|traditional]","east-asian-width-values":"[full-width|proportional-width]","element()":"element( <custom-ident> , [first|start|last|first-except]? )|element( <id-selector> )","ellipse()":"ellipse( <radial-size>? [at <position>]? )","env()":"env( <custom-ident> , <declaration-value>? )","exp()":"exp( <calc-sum> )","explicit-track-list":"[<line-names>? <track-size>]+ <line-names>?","family-name":"<string>|<custom-ident>+","feature-tag-value":"<string> [<integer>|on|off]?","feature-type":"@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation","feature-value-block":"<feature-type> '{' <feature-value-declaration-list> '}'","feature-value-block-list":"<feature-value-block>+","feature-value-declaration":"<custom-ident> : <integer>+ ;","feature-value-declaration-list":"<feature-value-declaration>","feature-value-name":"<custom-ident>","filter-function":"<blur()>|<brightness()>|<contrast()>|<drop-shadow()>|<grayscale()>|<hue-rotate()>|<invert()>|<opacity()>|<saturate()>|<sepia()>","filter-value-list":"[<filter-function>|<url>]+","final-bg-layer":"<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<visual-box>||<visual-box>||<'background-color'>","fit-content()":"fit-content( <length-percentage [0,\u221E]> )","fixed-breadth":"<length-percentage>","fixed-repeat":"repeat( [<integer [1,\u221E]>] , [<line-names>? <fixed-size>]+ <line-names>? )","fixed-size":"<fixed-breadth>|minmax( <fixed-breadth> , <track-breadth> )|minmax( <inflexible-breadth> , <fixed-breadth> )","font-stretch-absolute":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|<percentage>","font-variant-css2":"normal|small-caps","font-weight-absolute":"normal|bold|<number [1,1000]>","font-width-css3":"normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded","form-control-identifier":"select","frequency-percentage":"<frequency>|<percentage>","generic-complete":"serif|sans-serif|system-ui|cursive|fantasy|math|monospace","general-enclosed":"[<function-token> <any-value>? )]|[( <any-value>? )]","generic-family":"<generic-script-specific>|<generic-complete>|<generic-incomplete>|<-non-standard-generic-family>","generic-incomplete":"ui-serif|ui-sans-serif|ui-monospace|ui-rounded","geometry-box":"<shape-box>|fill-box|stroke-box|view-box",gradient:"<linear-gradient()>|<repeating-linear-gradient()>|<radial-gradient()>|<repeating-radial-gradient()>|<conic-gradient()>|<repeating-conic-gradient()>|<-legacy-gradient>","grayscale()":"grayscale( [<number>|<percentage>]? )","grid-line":"auto|<custom-ident>|[<integer>&&<custom-ident>?]|[span&&[<integer>||<custom-ident>]]","historical-lig-values":"[historical-ligatures|no-historical-ligatures]","hsl()":"<legacy-hsl-syntax>|<modern-hsl-syntax>","hsla()":"<legacy-hsla-syntax>|<modern-hsla-syntax>",hue:"<number>|<angle>","hue-interpolation-method":"[shorter|longer|increasing|decreasing] hue","hue-rotate()":"hue-rotate( [<angle>|<zero>]? )","hwb()":"<legacy-hwb-syntax>|<modern-hwb-syntax>","hypot()":"hypot( <calc-sum># )",image:"<url>|<image()>|<image-set()>|<element()>|<paint()>|<cross-fade()>|<gradient>","image()":"image( <image-tags>? [<image-src>? , <color>?]! )","image-set()":"image-set( <image-set-option># )","image-set-option":"[<image>|<string>] [<resolution>||type( <string> )]","image-src":"<url>|<string>","image-tags":"ltr|rtl","inflexible-breadth":"<length-percentage>|min-content|max-content|auto","inset()":"inset( <length-percentage>{1,4} [round <'border-radius'>]? )","invert()":"invert( [<number>|<percentage>]? )","keyframe-block":"<keyframe-selector># { <declaration-list> }","keyframe-selector":"from|to|<percentage [0,100]>|<timeline-range-name> <percentage>","keyframes-name":"<custom-ident>|<string>","lab()":"<legacy-lab-syntax>|<modern-lab-syntax>","layer()":"layer( <layer-name> )","layer-name":"<ident> ['.' <ident>]*","lch()":"<legacy-lch-syntax>|<modern-lch-syntax>","leader()":"leader( <leader-type> )","leader-type":"dotted|solid|space|<string>","length-percentage":"<length>|<percentage>","light-dark()":"light-dark( <color> , <color> )","line-name-list":"[<line-names>|<name-repeat>]+","line-names":"'[' <custom-ident>* ']'","line-style":"none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset","line-width":"<length>|thin|medium|thick","linear()":"linear( [<number>&&<percentage>{0,2}]# )","linear-color-hint":"<length-percentage>","linear-color-stop":"<color> <color-stop-length>?","linear-easing-function":"linear|<linear()>","linear-gradient()":"linear-gradient( [<linear-gradient-syntax>] )","linear-gradient-syntax":"[[<angle>|<zero>|to <side-or-corner>]||<color-interpolation-method>]? , <color-stop-list>","log()":"log( <calc-sum> , <calc-sum>? )","mask-layer":"<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||<geometry-box>||[<geometry-box>|no-clip]||<compositing-operator>||<masking-mode>","mask-position":"[<length-percentage>|left|center|right] [<length-percentage>|top|center|bottom]?","mask-reference":"none|<image>|<mask-source>","mask-source":"<url>","masking-mode":"alpha|luminance|match-source","matrix()":"matrix( <number>#{6} )","matrix3d()":"matrix3d( <number>#{16} )","max()":"max( <calc-sum># )","media-and":"<media-in-parens> [and <media-in-parens>]+","media-condition":"<media-not>|<media-and>|<media-or>|<media-in-parens>","media-condition-without-or":"<media-not>|<media-and>|<media-in-parens>","media-feature":"( [<mf-plain>|<mf-boolean>|<mf-range>] )","media-in-parens":"( <media-condition> )|<media-feature>|<general-enclosed>","media-not":"not <media-in-parens>","media-or":"<media-in-parens> [or <media-in-parens>]+","media-query":"<media-condition>|[not|only]? <media-type> [and <media-condition-without-or>]?","media-query-list":"<media-query>#","media-type":"<ident>","mf-boolean":"<mf-name>","mf-name":"<ident>","mf-plain":"<mf-name> : <mf-value>","mf-range":"<mf-name> ['<'|'>']? '='? <mf-value>|<mf-value> ['<'|'>']? '='? <mf-name>|<mf-value> '<' '='? <mf-name> '<' '='? <mf-value>|<mf-value> '>' '='? <mf-name> '>' '='? <mf-value>","mf-value":"<number>|<dimension>|<ident>|<ratio>","min()":"min( <calc-sum># )","minmax()":"minmax( [<length-percentage>|min-content|max-content|auto] , [<length-percentage>|<flex>|min-content|max-content|auto] )","mod()":"mod( <calc-sum> , <calc-sum> )","n-dimension":"<dimension-token>","name-repeat":"repeat( [<integer [1,\u221E]>|auto-fill] , <line-names>+ )","named-color":"aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen","namespace-prefix":"<ident>","ndash-dimension":"<dimension-token>","ndashdigit-dimension":"<dimension-token>","ndashdigit-ident":"<ident-token>","ns-prefix":"[<ident-token>|'*']? '|'","number-percentage":"<number>|<percentage>","numeric-figure-values":"[lining-nums|oldstyle-nums]","numeric-fraction-values":"[diagonal-fractions|stacked-fractions]","numeric-spacing-values":"[proportional-nums|tabular-nums]","offset-path":"<ray()>|<url>|<basic-shape>","oklab()":"<legacy-oklab-syntax>|<modern-oklab-syntax>","oklch()":"<legacy-oklch-syntax>|<modern-oklch-syntax>","opacity()":"opacity( [<number>|<percentage>]? )","opacity-value":"<number>|<percentage>","outline-line-style":"none|dotted|dashed|solid|double|groove|ridge|inset|outset","outline-radius":"<length>|<percentage>","overflow-position":"unsafe|safe","page-body":"<declaration>? [; <page-body>]?|<page-margin-box> <page-body>","page-margin-box":"<page-margin-box-type> '{' <declaration-list> '}'","page-margin-box-type":"@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom","page-selector":"<pseudo-page>+|<ident> <pseudo-page>*","page-selector-list":"[<page-selector>#]?","page-size":"A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger",paint:"none|<color>|<url> [none|<color>]?|context-fill|context-stroke","paint()":"paint( <ident> , <declaration-value>? )","paint-box":"<visual-box>|fill-box|stroke-box","palette-identifier":"<dashed-ident>","palette-mix()":"palette-mix( <color-interpolation-method> , [[normal|light|dark|<palette-identifier>|<palette-mix()>]&&<percentage [0,100]>?]#{2} )","path()":"path( <'fill-rule'>? , <string> )","perspective()":"perspective( [<length [0,\u221E]>|none] )","polar-color-space":"hsl|hwb|lch|oklch","polygon()":"polygon( <'fill-rule'>? , [<length-percentage> <length-percentage>]# )",position:"[[left|center|right]||[top|center|bottom]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]?|[[left|right] <length-percentage>]&&[[top|bottom] <length-percentage>]]","position-area":"[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|center|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|center|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]","pow()":"pow( <calc-sum> , <calc-sum> )","predefined-rgb":"srgb|srgb-linear|display-p3|display-p3-linear|a98-rgb|prophoto-rgb|rec2020","predefined-rgb-params":"<predefined-rgb> [<number>|<percentage>|none]{3}","pseudo-class-selector":"':' <ident-token>|':' <function-token> <any-value> ')'","pseudo-element-selector":"':' <pseudo-class-selector>|<legacy-pseudo-element-selector>","pseudo-page":": [left|right|first|blank]","query-in-parens":"( <container-condition> )|( <size-feature> )|style( <style-query> )|<general-enclosed>",quote:"open-quote|close-quote|no-open-quote|no-close-quote","radial-extent":"closest-corner|closest-side|farthest-corner|farthest-side","radial-gradient()":"radial-gradient( [<radial-gradient-syntax>] )","radial-gradient-syntax":"[[[<radial-shape>||<radial-size>]? [at <position>]?]||<color-interpolation-method>]? , <color-stop-list>","radial-shape":"circle|ellipse","radial-size":"<radial-extent>|<length [0,\u221E]>|<length-percentage [0,\u221E]>{2}",ratio:"<number [0,\u221E]> [/ <number [0,\u221E]>]?","ray()":"ray( <angle>&&<ray-size>?&&contain?&&[at <position>]? )","ray-size":"closest-side|closest-corner|farthest-side|farthest-corner|sides","rect()":"rect( [<length-percentage>|auto]{4} [round <'border-radius'>]? )","rectangular-color-space":"srgb|srgb-linear|display-p3|display-p3-linear|a98-rgb|prophoto-rgb|rec2020|lab|oklab|xyz|xyz-d50|xyz-d65","relative-selector":"<combinator>? <complex-selector>","relative-selector-list":"<relative-selector>#","relative-size":"larger|smaller","rem()":"rem( <calc-sum> , <calc-sum> )","repeat-style":"repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}","repeating-conic-gradient()":"repeating-conic-gradient( [<conic-gradient-syntax>] )","repeating-linear-gradient()":"repeating-linear-gradient( [<linear-gradient-syntax>] )","repeating-radial-gradient()":"repeating-radial-gradient( [<radial-gradient-syntax>] )","reversed-counter-name":"reversed( <counter-name> )","rgb()":"<legacy-rgb-syntax>|<modern-rgb-syntax>","rgba()":"<legacy-rgba-syntax>|<modern-rgba-syntax>","rotate()":"rotate( [<angle>|<zero>] )","rotate3d()":"rotate3d( <number> , <number> , <number> , [<angle>|<zero>] )","rotateX()":"rotateX( [<angle>|<zero>] )","rotateY()":"rotateY( [<angle>|<zero>] )","rotateZ()":"rotateZ( [<angle>|<zero>] )","round()":"round( <rounding-strategy>? , <calc-sum> , <calc-sum> )","rounding-strategy":"nearest|up|down|to-zero","saturate()":"saturate( [<number>|<percentage>]? )","scale()":"scale( [<number>|<percentage>]#{1,2} )","scale3d()":"scale3d( [<number>|<percentage>]#{3} )","scaleX()":"scaleX( [<number>|<percentage>] )","scaleY()":"scaleY( [<number>|<percentage>] )","scaleZ()":"scaleZ( [<number>|<percentage>] )","scope-end":"<forgiving-selector-list>","scope-start":"<forgiving-selector-list>","scroll()":"scroll( [<scroller>||<axis>]? )",scroller:"root|nearest|self","scroll-state-feature":"<media-query-list>","scroll-state-in-parens":"( <scroll-state-query> )|( <scroll-state-feature> )|<general-enclosed>","scroll-state-query":"not <scroll-state-in-parens>|<scroll-state-in-parens> [[and <scroll-state-in-parens>]*|[or <scroll-state-in-parens>]*]|<scroll-state-feature>","selector-list":"<complex-selector-list>","self-position":"center|start|end|self-start|self-end|flex-start|flex-end","sepia()":"sepia( [<number>|<percentage>]? )",shadow:"inset?&&<length>{2,4}&&<color>?","shadow-t":"[<length>{2,3}&&<color>?]",shape:"rect( <top> , <right> , <bottom> , <left> )|rect( <top> <right> <bottom> <left> )","shape-box":"<visual-box>|margin-box","side-or-corner":"[left|right]||[top|bottom]","sign()":"sign( <calc-sum> )","signed-integer":"<number-token>","signless-integer":"<number-token>","sin()":"sin( <calc-sum> )","single-animation":"<'animation-duration'>||<easing-function>||<'animation-delay'>||<single-animation-iteration-count>||<single-animation-direction>||<single-animation-fill-mode>||<single-animation-play-state>||[none|<keyframes-name>]||<single-animation-timeline>","single-animation-composition":"replace|add|accumulate","single-animation-direction":"normal|reverse|alternate|alternate-reverse","single-animation-fill-mode":"none|forwards|backwards|both","single-animation-iteration-count":"infinite|<number>","single-animation-play-state":"running|paused","single-animation-timeline":"auto|none|<dashed-ident>|<scroll()>|<view()>","single-transition":"[none|<single-transition-property>]||<time>||<easing-function>||<time>||<transition-behavior-value>","single-transition-property":"all|<custom-ident>",size:"closest-side|farthest-side|closest-corner|farthest-corner|<length>|<length-percentage>{2}","size-feature":"<mf-plain>|<mf-boolean>|<mf-range>","skew()":"skew( [<angle>|<zero>] , [<angle>|<zero>]? )","skewX()":"skewX( [<angle>|<zero>] )","skewY()":"skewY( [<angle>|<zero>] )","sqrt()":"sqrt( <calc-sum> )","step-position":"jump-start|jump-end|jump-none|jump-both|start|end","step-easing-function":"step-start|step-end|<steps()>","steps()":"steps( <integer> , <step-position>? )","style-feature":"<declaration>","style-in-parens":"( <style-condition> )|( <style-feature> )|<general-enclosed>","style-query":"<style-condition>|<style-feature>","subclass-selector":"<id-selector>|<class-selector>|<attribute-selector>|<pseudo-class-selector>","superellipse()":"superellipse( [<number>|infinity|-infinity] )","supports-condition":"not <supports-in-parens>|<supports-in-parens> [and <supports-in-parens>]*|<supports-in-parens> [or <supports-in-parens>]*","supports-decl":"( <declaration> )","supports-feature":"<supports-decl>|<supports-selector-fn>","supports-in-parens":"( <supports-condition> )|<supports-feature>|<general-enclosed>","supports-selector-fn":"selector( <complex-selector> )",symbol:"<string>|<image>|<custom-ident>","symbols()":"symbols( <symbols-type>? [<string>|<image>]+ )","symbols-type":"cyclic|numeric|alphabetic|symbolic|fixed","system-color":"AccentColor|AccentColorText|ActiveText|ButtonBorder|ButtonFace|ButtonText|Canvas|CanvasText|Field|FieldText|GrayText|Highlight|HighlightText|LinkText|Mark|MarkText|SelectedItem|SelectedItemText|VisitedText","system-family-name":"caption|icon|menu|message-box|small-caption|status-bar","tan()":"tan( <calc-sum> )",target:"<target-counter()>|<target-counters()>|<target-text()>","target-counter()":"target-counter( [<string>|<url>] , <custom-ident> , <counter-style>? )","target-counters()":"target-counters( [<string>|<url>] , <custom-ident> , <string> , <counter-style>? )","target-text()":"target-text( [<string>|<url>] , [content|before|after|first-letter]? )","text-edge":"[text|cap|ex|ideographic|ideographic-ink] [text|alphabetic|ideographic|ideographic-ink]?","time-percentage":"<time>|<percentage>","timeline-range-name":"cover|contain|entry|exit|entry-crossing|exit-crossing","track-breadth":"<length-percentage>|<flex>|min-content|max-content|auto","track-list":"[<line-names>? [<track-size>|<track-repeat>]]+ <line-names>?","track-repeat":"repeat( [<integer [1,\u221E]>] , [<line-names>? <track-size>]+ <line-names>? )","track-size":"<track-breadth>|minmax( <inflexible-breadth> , <track-breadth> )|fit-content( <length-percentage> )","transform-function":"<matrix()>|<translate()>|<translateX()>|<translateY()>|<scale()>|<scaleX()>|<scaleY()>|<rotate()>|<skew()>|<skewX()>|<skewY()>|<matrix3d()>|<translate3d()>|<translateZ()>|<scale3d()>|<scaleZ()>|<rotate3d()>|<rotateX()>|<rotateY()>|<rotateZ()>|<perspective()>","transform-list":"<transform-function>+","transition-behavior-value":"normal|allow-discrete","translate()":"translate( <length-percentage> , <length-percentage>? )","translate3d()":"translate3d( <length-percentage> , <length-percentage> , <length> )","translateX()":"translateX( <length-percentage> )","translateY()":"translateY( <length-percentage> )","translateZ()":"translateZ( <length> )","try-size":"most-width|most-height|most-block-size|most-inline-size","try-tactic":"flip-block||flip-inline||flip-start","type-or-unit":"string|color|url|integer|number|length|angle|time|frequency|cap|ch|em|ex|ic|lh|rlh|rem|vb|vi|vw|vh|vmin|vmax|mm|Q|cm|in|pt|pc|px|deg|grad|rad|turn|ms|s|Hz|kHz|%","type-selector":"<wq-name>|<ns-prefix>? '*'","var()":"var( <custom-property-name> , <declaration-value>? )","view()":"view( [<axis>||<'view-timeline-inset'>]? )","viewport-length":"auto|<length-percentage>","visual-box":"content-box|padding-box|border-box","wq-name":"<ns-prefix>? <ident-token>","xywh()":"xywh( <length-percentage>{2} <length-percentage [0,\u221E]>{2} [round <'border-radius'>]? )",xyz:"xyz|xyz-d50|xyz-d65","xyz-params":"<xyz-space> [<number>|<percentage>|none]{3}","-legacy-gradient":"<-webkit-gradient()>|<-legacy-linear-gradient>|<-legacy-repeating-linear-gradient>|<-legacy-radial-gradient>|<-legacy-repeating-radial-gradient>","-legacy-linear-gradient":"-moz-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-repeating-linear-gradient":"-moz-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )","-legacy-linear-gradient-arguments":"[<angle>|<side-or-corner>]? , <color-stop-list>","-legacy-radial-gradient":"-moz-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-repeating-radial-gradient":"-moz-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )","-legacy-radial-gradient-arguments":"[<position> ,]? [[[<-legacy-radial-gradient-shape>||<-legacy-radial-gradient-size>]|[<length>|<percentage>]{2}] ,]? <color-stop-list>","-legacy-radial-gradient-size":"closest-side|closest-corner|farthest-side|farthest-corner|contain|cover","-legacy-radial-gradient-shape":"circle|ellipse","-non-standard-font":"-apple-system-body|-apple-system-headline|-apple-system-subheadline|-apple-system-caption1|-apple-system-caption2|-apple-system-footnote|-apple-system-short-body|-apple-system-short-headline|-apple-system-short-subheadline|-apple-system-short-caption1|-apple-system-short-footnote|-apple-system-tall-body","-non-standard-color":"-moz-ButtonDefault|-moz-ButtonHoverFace|-moz-ButtonHoverText|-moz-CellHighlight|-moz-CellHighlightText|-moz-Combobox|-moz-ComboboxText|-moz-Dialog|-moz-DialogText|-moz-dragtargetzone|-moz-EvenTreeRow|-moz-Field|-moz-FieldText|-moz-html-CellHighlight|-moz-html-CellHighlightText|-moz-mac-accentdarkestshadow|-moz-mac-accentdarkshadow|-moz-mac-accentface|-moz-mac-accentlightesthighlight|-moz-mac-accentlightshadow|-moz-mac-accentregularhighlight|-moz-mac-accentregularshadow|-moz-mac-chrome-active|-moz-mac-chrome-inactive|-moz-mac-focusring|-moz-mac-menuselect|-moz-mac-menushadow|-moz-mac-menutextselect|-moz-MenuHover|-moz-MenuHoverText|-moz-MenuBarText|-moz-MenuBarHoverText|-moz-nativehyperlinktext|-moz-OddTreeRow|-moz-win-communicationstext|-moz-win-mediatext|-moz-activehyperlinktext|-moz-default-background-color|-moz-default-color|-moz-hyperlinktext|-moz-visitedhyperlinktext|-webkit-activelink|-webkit-focus-ring-color|-webkit-link|-webkit-text","-non-standard-image-rendering":"optimize-contrast|-moz-crisp-edges|-o-crisp-edges|-webkit-optimize-contrast","-non-standard-overflow":"overlay|-moz-scrollbars-none|-moz-scrollbars-horizontal|-moz-scrollbars-vertical|-moz-hidden-unscrollable","-non-standard-size":"intrinsic|min-intrinsic|-webkit-fill-available|-webkit-fit-content|-webkit-min-content|-webkit-max-content|-moz-available|-moz-fit-content|-moz-min-content|-moz-max-content","-webkit-gradient()":"-webkit-gradient( <-webkit-gradient-type> , <-webkit-gradient-point> [, <-webkit-gradient-point>|, <-webkit-gradient-radius> , <-webkit-gradient-point>] [, <-webkit-gradient-radius>]? [, <-webkit-gradient-color-stop>]* )","-webkit-gradient-color-stop":"from( <color> )|color-stop( [<number-zero-one>|<percentage>] , <color> )|to( <color> )","-webkit-gradient-point":"[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]","-webkit-gradient-radius":"<length>|<percentage>","-webkit-gradient-type":"linear|radial","-webkit-mask-box-repeat":"repeat|stretch|round","-ms-filter-function-list":"<-ms-filter-function>+","-ms-filter-function":"<-ms-filter-function-progid>|<-ms-filter-function-legacy>","-ms-filter-function-progid":"'progid:' [<ident-token> '.']* [<ident-token>|<function-token> <any-value>? )]","-ms-filter-function-legacy":"<ident-token>|<function-token> <any-value>? )",age:"child|young|old","attr-name":"<wq-name>","attr-fallback":"<any-value>",autospace:"no-autospace|[ideograph-alpha||ideograph-numeric||punctuation]||[insert|replace]",bottom:"<length>|auto","generic-voice":"[<age>? <gender> <integer>?]",gender:"male|female|neutral","generic-script-specific":"generic( kai )|generic( fangsong )|generic( nastaliq )","-non-standard-generic-family":"-apple-system|BlinkMacSystemFont","intrinsic-size-keyword":"min-content|max-content|fit-content",left:"<length>|auto","device-cmyk()":"<legacy-device-cmyk-syntax>|<modern-device-cmyk-syntax>","legacy-device-cmyk-syntax":"device-cmyk( <number>#{4} )","modern-device-cmyk-syntax":"device-cmyk( <cmyk-component>{4} [/ [<alpha-value>|none]]? )","cmyk-component":"<number>|<percentage>|none","color-space":"<rectangular-color-space>|<polar-color-space>|<custom-color-space>",right:"<length>|auto","forgiving-selector-list":"<complex-real-selector-list>","forgiving-relative-selector-list":"<relative-real-selector-list>","complex-real-selector-list":"<complex-real-selector>#","simple-selector-list":"<simple-selector>#","relative-real-selector-list":"<relative-real-selector>#","complex-selector-unit":"[<compound-selector>? <pseudo-compound-selector>*]!","complex-real-selector":"<compound-selector> [<combinator>? <compound-selector>]*","relative-real-selector":"<combinator>? <complex-real-selector>","pseudo-compound-selector":"<pseudo-element-selector> <pseudo-class-selector>*","simple-selector":"<type-selector>|<subclass-selector>","legacy-pseudo-element-selector":"':' [before|after|first-line|first-letter]","svg-length":"<percentage>|<length>|<number>","svg-writing-mode":"lr-tb|rl-tb|tb-rl|lr|rl|tb",top:"<length>|auto",x:"<number>",y:"<number>",declaration:"<ident-token> : <declaration-value>? ['!' important]?","declaration-list":"[<declaration>? ';']* <declaration>?",url:"url( <string> <url-modifier>* )|<url-token>","url-modifier":"<ident>|<function-token> <any-value> )","number-zero-one":"<number [0,1]>","number-one-or-greater":"<number [1,\u221E]>","rgb-component":"r|g|b|alpha","legacy-rgb-syntax":"rgb( <percentage>#{3} , <alpha-value>? )|rgb( <number>#{3} , <alpha-value>? )|rgb( [<number>|<percentage>|none]{3} [/ [<alpha-value>|none]]? )","modern-rgb-syntax":"rgb( from <color> [<number>|<percentage>|<rgb-component>]{3} [/ [<alpha-value>|<rgb-component>]]? )","legacy-rgba-syntax":"rgba( <percentage>#{3} , <alpha-value>? )|rgba( <number>#{3} , <alpha-value>? )|rgba( [<number>|<percentage>|none]{3} [/ [<alpha-value>|none]]? )","modern-rgba-syntax":"rgba( from <color> [<number>|<percentage>|<rgb-component>]{3} [/ [<alpha-value>|<rgb-component>]]? )","hsl-component":"h|s|l|alpha","legacy-hsl-syntax":"hsl( <hue> , <percentage> , <percentage> , <alpha-value>? )|hsl( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","modern-hsl-syntax":"hsl( from <color> [<hue>|<percentage>|<number>|<hsl-component>|none] [<percentage>|<number>|<hsl-component>|none] [<percentage>|<number>|<hsl-component>|none] [/ [<alpha-value>|<hsl-component>|none]]? )","legacy-hsla-syntax":"hsla( <hue> , <percentage> , <percentage> , <alpha-value>? )|hsla( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","modern-hsla-syntax":"hsla( from <color> [<hue>|<percentage>|<number>|<hsl-component>|none] [<percentage>|<number>|<hsl-component>|none] [<percentage>|<number>|<hsl-component>|none] [/ [<alpha-value>|<hsl-component>|none]]? )","hwb-component":"h|w|b","legacy-hwb-syntax":"hwb( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","modern-hwb-syntax":"hwb( from <color> [<hue>|<percentage>|<number>|<hwb-component>|none] [<percentage>|<number>|<hwb-component>|none] [<percentage>|<number>|<hwb-component>|none] [/ [<alpha-value>|<hwb-component>|none]]? )","lab-component":"l|a|b|alpha","legacy-lab-syntax":"lab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","modern-lab-syntax":"lab( from <color> [<number>|<percentage>|<lab-component>]{3} [/ [<alpha-value>|<lab-component>]]? )","legacy-oklab-syntax":"oklab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )","modern-oklab-syntax":"oklab( from <color> [<number>|<percentage>|<lab-component>]{3} [/ [<alpha-value>|<lab-component>]]? )","lch-component":"l|c|h|alpha","legacy-lch-syntax":"lch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )","modern-lch-syntax":"lch( from <color> [<number>|<percentage>|<lch-component>]{3} [/ [<alpha-value>|<lch-component>]]? )","legacy-oklch-syntax":"oklch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )","modern-oklch-syntax":"oklch( from <color> [<number>|<percentage>|<lch-component>]{3} [/ [<alpha-value>|<lch-component>]]? )","alpha()":"alpha( [from <color>] [/ [<alpha-value>|none]]? )","xyz-space":"xyz|xyz-d50|xyz-d65","style-condition":"not <style-in-parens>|<style-in-parens> [[and <style-in-parens>]*|[or <style-in-parens>]*]","-non-standard-display":"-ms-inline-flexbox|-ms-grid|-ms-inline-grid|-webkit-flex|-webkit-inline-flex|-webkit-box|-webkit-inline-box|-moz-inline-stack|-moz-box|-moz-inline-box","inset-area":"[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]",syntax:"'*'|<syntax-component> [<syntax-combinator> <syntax-component>]*|<syntax-string>","syntax-component":"<syntax-single-component> <syntax-multiplier>?|'<' transform-list '>'","syntax-single-component":"'<' <syntax-type-name> '>'|<ident>","syntax-type-name":"angle|color|custom-ident|image|integer|length|length-percentage|number|percentage|resolution|string|time|url|transform-function","syntax-combinator":"'|'","syntax-multiplier":"'#'|'+'","syntax-string":"<string>"},properties:{"--*":"<declaration-value>","-ms-accelerator":"false|true","-ms-block-progression":"tb|rl|bt|lr","-ms-content-zoom-chaining":"none|chained","-ms-content-zoom-limit":"<'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'>","-ms-content-zoom-limit-max":"<percentage>","-ms-content-zoom-limit-min":"<percentage>","-ms-content-zoom-snap":"<'-ms-content-zoom-snap-type'>||<'-ms-content-zoom-snap-points'>","-ms-content-zoom-snap-points":"snapInterval( <percentage> , <percentage> )|snapList( <percentage># )","-ms-content-zoom-snap-type":"none|proximity|mandatory","-ms-content-zooming":"none|zoom","-ms-filter":"<string>","-ms-flow-from":"[none|<custom-ident>]#","-ms-flow-into":"[none|<custom-ident>]#","-ms-grid-columns":"none|<track-list>|<auto-track-list>","-ms-grid-rows":"none|<track-list>|<auto-track-list>","-ms-high-contrast-adjust":"auto|none","-ms-hyphenate-limit-chars":"auto|<integer>{1,3}","-ms-hyphenate-limit-lines":"no-limit|<integer>","-ms-hyphenate-limit-zone":"<percentage>|<length>","-ms-ime-align":"auto|after","-ms-overflow-style":"auto|none|scrollbar|-ms-autohiding-scrollbar","-ms-scroll-chaining":"chained|none","-ms-scroll-limit":"<'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'>","-ms-scroll-limit-x-max":"auto|<length>","-ms-scroll-limit-x-min":"<length>","-ms-scroll-limit-y-max":"auto|<length>","-ms-scroll-limit-y-min":"<length>","-ms-scroll-rails":"none|railed","-ms-scroll-snap-points-x":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-points-y":"snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )","-ms-scroll-snap-type":"none|proximity|mandatory","-ms-scroll-snap-x":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-x'>","-ms-scroll-snap-y":"<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-y'>","-ms-scroll-translation":"none|vertical-to-horizontal","-ms-scrollbar-3dlight-color":"<color>","-ms-scrollbar-arrow-color":"<color>","-ms-scrollbar-base-color":"<color>","-ms-scrollbar-darkshadow-color":"<color>","-ms-scrollbar-face-color":"<color>","-ms-scrollbar-highlight-color":"<color>","-ms-scrollbar-shadow-color":"<color>","-ms-scrollbar-track-color":"<color>","-ms-text-autospace":"none|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space","-ms-touch-select":"grippers|none","-ms-user-select":"none|element|text","-ms-wrap-flow":"auto|both|start|end|maximum|clear","-ms-wrap-margin":"<length>","-ms-wrap-through":"wrap|none","-moz-appearance":"none|button|button-arrow-down|button-arrow-next|button-arrow-previous|button-arrow-up|button-bevel|button-focus|caret|checkbox|checkbox-container|checkbox-label|checkmenuitem|dualbutton|groupbox|listbox|listitem|menuarrow|menubar|menucheckbox|menuimage|menuitem|menuitemtext|menulist|menulist-button|menulist-text|menulist-textfield|menupopup|menuradio|menuseparator|meterbar|meterchunk|progressbar|progressbar-vertical|progresschunk|progresschunk-vertical|radio|radio-container|radio-label|radiomenuitem|range|range-thumb|resizer|resizerpanel|scale-horizontal|scalethumbend|scalethumb-horizontal|scalethumbstart|scalethumbtick|scalethumb-vertical|scale-vertical|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|separator|sheet|spinner|spinner-downbutton|spinner-textfield|spinner-upbutton|splitter|statusbar|statusbarpanel|tab|tabpanel|tabpanels|tab-scroll-arrow-back|tab-scroll-arrow-forward|textfield|textfield-multiline|toolbar|toolbarbutton|toolbarbutton-dropdown|toolbargripper|toolbox|tooltip|treeheader|treeheadercell|treeheadersortarrow|treeitem|treeline|treetwisty|treetwistyopen|treeview|-moz-mac-unified-toolbar|-moz-win-borderless-glass|-moz-win-browsertabbar-toolbox|-moz-win-communicationstext|-moz-win-communications-toolbox|-moz-win-exclude-glass|-moz-win-glass|-moz-win-mediatext|-moz-win-media-toolbox|-moz-window-button-box|-moz-window-button-box-maximized|-moz-window-button-close|-moz-window-button-maximize|-moz-window-button-minimize|-moz-window-button-restore|-moz-window-frame-bottom|-moz-window-frame-left|-moz-window-frame-right|-moz-window-titlebar|-moz-window-titlebar-maximized","-moz-binding":"<url>|none","-moz-border-bottom-colors":"<color>+|none","-moz-border-left-colors":"<color>+|none","-moz-border-right-colors":"<color>+|none","-moz-border-top-colors":"<color>+|none","-moz-context-properties":"none|[fill|fill-opacity|stroke|stroke-opacity]#","-moz-float-edge":"border-box|content-box|margin-box|padding-box","-moz-force-broken-image-icon":"0|1","-moz-orient":"inline|block|horizontal|vertical","-moz-outline-radius":"<outline-radius>{1,4} [/ <outline-radius>{1,4}]?","-moz-outline-radius-bottomleft":"<outline-radius>","-moz-outline-radius-bottomright":"<outline-radius>","-moz-outline-radius-topleft":"<outline-radius>","-moz-outline-radius-topright":"<outline-radius>","-moz-stack-sizing":"ignore|stretch-to-fit","-moz-text-blink":"none|blink","-moz-user-focus":"ignore|normal|select-after|select-before|select-menu|select-same|select-all|none","-moz-user-input":"auto|none|enabled|disabled","-moz-user-modify":"read-only|read-write|write-only","-moz-window-dragging":"drag|no-drag","-moz-window-shadow":"default|menu|tooltip|sheet|none","-webkit-appearance":"none|button|button-bevel|caps-lock-indicator|caret|checkbox|default-button|inner-spin-button|listbox|listitem|media-controls-background|media-controls-fullscreen-background|media-current-time-display|media-enter-fullscreen-button|media-exit-fullscreen-button|media-fullscreen-button|media-mute-button|media-overlay-play-button|media-play-button|media-seek-back-button|media-seek-forward-button|media-slider|media-sliderthumb|media-time-remaining-display|media-toggle-closed-captions-button|media-volume-slider|media-volume-slider-container|media-volume-sliderthumb|menulist|menulist-button|menulist-text|menulist-textfield|meter|progress-bar|progress-bar-value|push-button|radio|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbargripper-horizontal|scrollbargripper-vertical|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|searchfield-cancel-button|searchfield-decoration|searchfield-results-button|searchfield-results-decoration|slider-horizontal|slider-vertical|sliderthumb-horizontal|sliderthumb-vertical|square-button|textarea|textfield|-apple-pay-button","-webkit-border-after":"<'border-top'>","-webkit-border-after-color":"<'border-top-color'>","-webkit-border-after-style":"<'border-top-style'>","-webkit-border-after-width":"<'border-top-width'>","-webkit-border-before":"<'border-top'>","-webkit-border-before-color":"<'border-top-color'>","-webkit-border-before-style":"<'border-top-style'>","-webkit-border-before-width":"<'border-top-width'>","-webkit-border-end":"<'border-top'>","-webkit-border-end-color":"<'border-top-color'>","-webkit-border-end-style":"<'border-top-style'>","-webkit-border-end-width":"<'border-top-width'>","-webkit-border-start":"<'border-top'>","-webkit-border-start-color":"<'border-top-color'>","-webkit-border-start-style":"<'border-top-style'>","-webkit-border-start-width":"<'border-top-width'>","-webkit-box-reflect":"[above|below|right|left]? <length>? <image>?","-webkit-line-clamp":"none|<integer>","-webkit-mask":"[<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||[<visual-box>|border|padding|content|text]||[<visual-box>|border|padding|content]]#","-webkit-mask-attachment":"<attachment>#","-webkit-mask-clip":"[<coord-box>|no-clip|border|padding|content|text]#","-webkit-mask-composite":"<composite-style>#","-webkit-mask-image":"<mask-reference>#","-webkit-mask-origin":"[<coord-box>|border|padding|content]#","-webkit-mask-position":"<position>#","-webkit-mask-position-x":"[<length-percentage>|left|center|right]#","-webkit-mask-position-y":"[<length-percentage>|top|center|bottom]#","-webkit-mask-repeat":"<repeat-style>#","-webkit-mask-repeat-x":"repeat|no-repeat|space|round","-webkit-mask-repeat-y":"repeat|no-repeat|space|round","-webkit-mask-size":"<bg-size>#","-webkit-overflow-scrolling":"auto|touch","-webkit-tap-highlight-color":"<color>","-webkit-text-fill-color":"<color>","-webkit-text-stroke":"<length>||<color>","-webkit-text-stroke-color":"<color>","-webkit-text-stroke-width":"<length>","-webkit-touch-callout":"default|none","-webkit-user-modify":"read-only|read-write|read-write-plaintext-only","-webkit-user-select":"auto|none|text|all","accent-color":"auto|<color>","align-content":"normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>","align-items":"normal|stretch|<baseline-position>|[<overflow-position>? <self-position>]|anchor-center","align-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? <self-position>|anchor-center","align-tracks":"[normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>]#","alignment-baseline":"auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical",all:"initial|inherit|unset|revert|revert-layer","anchor-name":"none|<dashed-ident>#","anchor-scope":"none|all|<dashed-ident>#",animation:"<single-animation>#","animation-composition":"<single-animation-composition>#","animation-delay":"<time>#","animation-direction":"<single-animation-direction>#","animation-duration":"[auto|<time [0s,\u221E]>]#","animation-fill-mode":"<single-animation-fill-mode>#","animation-iteration-count":"<single-animation-iteration-count>#","animation-name":"[none|<keyframes-name>]#","animation-play-state":"<single-animation-play-state>#","animation-range":"[<'animation-range-start'> <'animation-range-end'>?]#","animation-range-end":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","animation-range-start":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","animation-timeline":"<single-animation-timeline>#","animation-timing-function":"<easing-function>#","animation-trigger":"[none|[<dashed-ident> <animation-action>+]+]#",appearance:"none|auto|<compat-auto>|<compat-special>","aspect-ratio":"auto||<ratio>","backdrop-filter":"none|<filter-value-list>","backface-visibility":"visible|hidden",background:"<bg-layer>#? , <final-bg-layer>","background-attachment":"<attachment>#","background-blend-mode":"<blend-mode>#","background-clip":"<bg-clip>#","background-color":"<color>","background-image":"<bg-image>#","background-origin":"<visual-box>#","background-position":"<bg-position>#","background-position-x":"[center|[[left|right|x-start|x-end]? <length-percentage>?]!]#","background-position-y":"[center|[[top|bottom|y-start|y-end]? <length-percentage>?]!]#","background-repeat":"<repeat-style>#","background-size":"<bg-size>#","baseline-shift":"baseline|sub|super|<svg-length>","baseline-source":"auto|first|last","block-size":"<'width'>",border:"<line-width>||<line-style>||<color>","border-block":"<'border-top'>","border-block-color":"<'border-top-color'>{1,2}","border-block-end":"<'border-top'>","border-block-end-color":"<'border-top-color'>","border-block-end-style":"<'border-top-style'>","border-block-end-width":"<'border-top-width'>","border-block-start":"<'border-top'>","border-block-start-color":"<'border-top-color'>","border-block-start-style":"<'border-top-style'>","border-block-start-width":"<'border-top-width'>","border-block-style":"<'border-top-style'>{1,2}","border-block-width":"<'border-top-width'>{1,2}","border-bottom":"<line-width>||<line-style>||<color>","border-bottom-color":"<'border-top-color'>","border-bottom-left-radius":"<length-percentage [0,\u221E]>{1,2}","border-bottom-right-radius":"<length-percentage [0,\u221E]>{1,2}","border-bottom-style":"<line-style>","border-bottom-width":"<line-width>","border-collapse":"separate|collapse","border-color":"<color>{1,4}","border-end-end-radius":"<'border-top-left-radius'>","border-end-start-radius":"<'border-top-left-radius'>","border-image":"<'border-image-source'>||<'border-image-slice'> [/ <'border-image-width'>|/ <'border-image-width'>? / <'border-image-outset'>]?||<'border-image-repeat'>","border-image-outset":"[<length [0,\u221E]>|<number [0,\u221E]>]{1,4}","border-image-repeat":"[stretch|repeat|round|space]{1,2}","border-image-slice":"[<number [0,\u221E]>|<percentage [0,\u221E]>]{1,4}&&fill?","border-image-source":"none|<image>","border-image-width":"[<length-percentage [0,\u221E]>|<number [0,\u221E]>|auto]{1,4}","border-inline":"<'border-top'>","border-inline-color":"<'border-top-color'>{1,2}","border-inline-end":"<'border-top'>","border-inline-end-color":"<'border-top-color'>","border-inline-end-style":"<'border-top-style'>","border-inline-end-width":"<'border-top-width'>","border-inline-start":"<'border-top'>","border-inline-start-color":"<'border-top-color'>","border-inline-start-style":"<'border-top-style'>","border-inline-start-width":"<'border-top-width'>","border-inline-style":"<'border-top-style'>{1,2}","border-inline-width":"<'border-top-width'>{1,2}","border-left":"<line-width>||<line-style>||<color>","border-left-color":"<color>","border-left-style":"<line-style>","border-left-width":"<line-width>","border-radius":"<length-percentage [0,\u221E]>{1,4} [/ <length-percentage [0,\u221E]>{1,4}]?","border-right":"<line-width>||<line-style>||<color>","border-right-color":"<color>","border-right-style":"<line-style>","border-right-width":"<line-width>","border-shape":"none|[<basic-shape> <geometry-box>?]{1,2}","border-spacing":"<length>{1,2}","border-start-end-radius":"<'border-top-left-radius'>","border-start-start-radius":"<'border-top-left-radius'>","border-style":"<line-style>{1,4}","border-top":"<line-width>||<line-style>||<color>","border-top-color":"<color>","border-top-left-radius":"<length-percentage [0,\u221E]>{1,2}","border-top-right-radius":"<length-percentage [0,\u221E]>{1,2}","border-top-style":"<line-style>","border-top-width":"<line-width>","border-width":"<line-width>{1,4}",bottom:"auto|<length-percentage>|<anchor()>|<anchor-size()>","box-align":"start|center|end|baseline|stretch","box-decoration-break":"slice|clone","box-direction":"normal|reverse|inherit","box-flex":"<number>","box-flex-group":"<integer>","box-lines":"single|multiple","box-ordinal-group":"<integer>","box-orient":"horizontal|vertical|inline-axis|block-axis|inherit","box-pack":"start|center|end|justify","box-shadow":"none|<shadow>#","box-sizing":"content-box|border-box","break-after":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avo   id-region|region","break-before":"auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region","break-inside":"auto|avoid|avoid-page|avoid-column|avoid-region","caption-side":"top|bottom",caret:"<'caret-color'>||<'caret-animation'>||<'caret-shape'>","caret-animation":"auto|manual","caret-color":"auto|<color>","caret-shape":"auto|bar|block|underscore",clear:"none|left|right|both|inline-start|inline-end",clip:"<shape>|auto","clip-path":"<clip-source>|[<basic-shape>||<geometry-box>]|none","clip-rule":"nonzero|evenodd",color:"<color>","color-interpolation-filters":"auto|sRGB|linearRGB","color-scheme":"normal|[light|dark|<custom-ident>]+&&only?","column-count":"<integer>|auto","column-fill":"auto|balance","column-gap":"normal|<length-percentage>","column-height":"auto|<length [0,\u221E]>","column-rule":"<'column-rule-width'>||<'column-rule-style'>||<'column-rule-color'>","column-rule-color":"<color>","column-rule-style":"<line-style>","column-rule-width":"<line-width>","column-span":"none|all","column-width":"auto|<length [0,\u221E]>","column-wrap":"auto|nowrap|wrap",columns:"[<'column-width'>||<'column-count'>] [/ <'column-height'>]?",contain:"none|strict|content|[[size||inline-size]||layout||style||paint]","contain-intrinsic-block-size":"auto? [none|<length>]","contain-intrinsic-height":"auto? [none|<length>]","contain-intrinsic-inline-size":"auto? [none|<length>]","contain-intrinsic-size":"[auto? [none|<length>]]{1,2}","contain-intrinsic-width":"auto? [none|<length>]",container:"<'container-name'> [/ <'container-type'>]?","container-name":"none|<custom-ident>+","container-type":"normal||[size|inline-size]",content:"normal|none|[<content-replacement>|<content-list>] [/ [<string>|<counter>|<attr()>]+]?","content-visibility":"visible|auto|hidden","corner-block-end-shape":"<corner-shape-value>{1,2}","corner-block-start-shape":"<corner-shape-value>{1,2}","corner-bottom-shape":"<corner-shape-value>{1,2}","corner-bottom-left-shape":"<corner-shape-value>","corner-bottom-right-shape":"<corner-shape-value>","corner-end-end-shape":"<corner-shape-value>","corner-end-start-shape":"<corner-shape-value>","corner-inline-end-shape":"<corner-shape-value>{1,2}","corner-inline-start-shape":"<corner-shape-value>{1,2}","corner-left-shape":"<corner-shape-value>{1,2}","corner-right-shape":"<corner-shape-value>{1,2}","corner-shape":"<corner-shape-value>{1,4}","corner-start-start-shape":"<corner-shape-value>","corner-start-end-shape":"<corner-shape-value>","corner-top-shape":"<corner-shape-value>{1,2}","corner-top-left-shape":"<corner-shape-value>","corner-top-right-shape":"<corner-shape-value>","counter-increment":"[<counter-name> <integer>?]+|none","counter-reset":"[<counter-name> <integer>?|<reversed-counter-name> <integer>?]+|none","counter-set":"[<counter-name> <integer>?]+|none",cursor:"[[<url> [<x> <y>]? ,]* [auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing|hand|-webkit-grab|-webkit-grabbing|-webkit-zoom-in|-webkit-zoom-out|-moz-grab|-moz-grabbing|-moz-zoom-in|-moz-zoom-out]]",cx:"<length>|<percentage>",cy:"<length>|<percentage>",d:"none|path( <string> )",direction:"ltr|rtl",display:"[<display-outside>||<display-inside>]|<display-listitem>|<display-internal>|<display-box>|<display-legacy>|<-non-standard-display>","dominant-baseline":"auto|use-script|no-change|reset-size|ideographic|alphabetic|hanging|mathematical|central|middle|text-after-edge|text-before-edge","dynamic-range-limit":"standard|no-limit|constrained|<dynamic-range-limit-mix()>","empty-cells":"show|hide","field-sizing":"content|fixed",fill:"<paint>","fill-opacity":"<number-zero-one>|<percentage>","fill-rule":"nonzero|evenodd",filter:"none|<filter-value-list>|<-ms-filter-function-list>",flex:"none|[<'flex-grow'> <'flex-shrink'>?||<'flex-basis'>]","flex-basis":"content|<'width'>","flex-direction":"row|row-reverse|column|column-reverse","flex-flow":"<'flex-direction'>||<'flex-wrap'>","flex-grow":"<number>","flex-shrink":"<number>","flex-wrap":"nowrap|wrap|wrap-reverse",float:"left|right|none|inline-start|inline-end","flood-color":"<color>","flood-opacity":"<'opacity'>",font:"[[<'font-style'>||<font-variant-css2>||<'font-weight'>||<font-width-css3>]? <'font-size'> [/ <'line-height'>]? <'font-family'>#]|<system-family-name>|<-non-standard-font>","font-family":"[<family-name>|<generic-family>]#","font-feature-settings":"normal|<feature-tag-value>#","font-kerning":"auto|normal|none","font-language-override":"normal|<string>","font-optical-sizing":"auto|none","font-palette":"normal|light|dark|<palette-identifier>|<palette-mix()>","font-size":"<absolute-size>|<relative-size>|<length-percentage [0,\u221E]>|math","font-size-adjust":"none|[ex-height|cap-height|ch-width|ic-width|ic-height]? [from-font|<number>]","font-smooth":"auto|never|always|<absolute-size>|<length>","font-stretch":"<font-stretch-absolute>","font-style":"normal|italic|oblique <angle>?","font-synthesis":"none|[weight||style||small-caps||position]","font-synthesis-position":"auto|none","font-synthesis-small-caps":"auto|none","font-synthesis-style":"auto|none","font-synthesis-weight":"auto|none","font-variant":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-alternates":"normal|[stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )]","font-variant-caps":"normal|small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps","font-variant-east-asian":"normal|[<east-asian-variant-values>||<east-asian-width-values>||ruby]","font-variant-emoji":"normal|text|emoji|unicode","font-variant-ligatures":"normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>]","font-variant-numeric":"normal|[<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero]","font-variant-position":"normal|sub|super","font-variation-settings":"normal|[<string> <number>]#","font-weight":"<font-weight-absolute>|bolder|lighter","font-width":"normal|<percentage [0,\u221E]>|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded","forced-color-adjust":"auto|none|preserve-parent-color","frame-sizing":"auto|content-width|content-height|content-block-size|content-inline-size",gap:"<'row-gap'> <'column-gap'>?",grid:"<'grid-template'>|<'grid-template-rows'> / [auto-flow&&dense?] <'grid-auto-columns'>?|[auto-flow&&dense?] <'grid-auto-rows'>? / <'grid-template-columns'>","grid-area":"<grid-line> [/ <grid-line>]{0,3}","grid-auto-columns":"<track-size>+","grid-auto-flow":"[row|column]||dense","grid-auto-rows":"<track-size>+","grid-column":"<grid-line> [/ <grid-line>]?","grid-column-end":"<grid-line>","grid-column-gap":"<length-percentage>","grid-column-start":"<grid-line>","grid-gap":"<'grid-row-gap'> <'grid-column-gap'>?","grid-row":"<grid-line> [/ <grid-line>]?","grid-row-end":"<grid-line>","grid-row-gap":"<length-percentage>","grid-row-start":"<grid-line>","grid-template":"none|[<'grid-template-rows'> / <'grid-template-columns'>]|[<line-names>? <string> <track-size>? <line-names>?]+ [/ <explicit-track-list>]?","grid-template-areas":"none|<string>+","grid-template-columns":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","grid-template-rows":"none|<track-list>|<auto-track-list>|subgrid <line-name-list>?","hanging-punctuation":"none|[first||[force-end|allow-end]||last]",height:"auto|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","hyphenate-character":"auto|<string>","hyphenate-limit-chars":"[auto|<integer>]{1,3}",hyphens:"none|manual|auto","image-orientation":"from-image|<angle>|[<angle>? flip]","image-rendering":"auto|crisp-edges|pixelated|smooth|optimizeSpeed|optimizeQuality|<-non-standard-image-rendering>","image-resolution":"[from-image||<resolution>]&&snap?","ime-mode":"auto|normal|active|inactive|disabled","initial-letter":"normal|[<number> <integer>?]","initial-letter-align":"[auto|alphabetic|hanging|ideographic]","inline-size":"<'width'>",inset:"<'top'>{1,4}","inset-block":"<'top'>{1,2}","inset-block-end":"<'top'>","inset-block-start":"<'top'>","inset-inline":"<'top'>{1,2}","inset-inline-end":"<'top'>","inset-inline-start":"<'top'>","interpolate-size":"numeric-only|allow-keywords",isolation:"auto|isolate",interactivity:"auto|inert","interest-delay":"<'interest-delay-start'>{1,2}","interest-delay-end":"normal|<time>","interest-delay-start":"normal|<time>","justify-content":"normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]","justify-items":"normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|legacy|legacy&&[left|right|center]|anchor-center","justify-self":"auto|normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|anchor-center","justify-tracks":"[normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]]#",left:"auto|<length-percentage>|<anchor()>|<anchor-size()>","letter-spacing":"normal|<length-percentage>","lighting-color":"<color>","line-break":"auto|loose|normal|strict|anywhere","line-clamp":"none|<integer>","line-height":"normal|<number>|<length>|<percentage>","line-height-step":"<length>","list-style":"<'list-style-type'>||<'list-style-position'>||<'list-style-image'>","list-style-image":"<image>|none","list-style-position":"inside|outside","list-style-type":"<counter-style>|<string>|none",margin:"<'margin-top'>{1,4}","margin-block":"<'margin-top'>{1,2}","margin-block-end":"<'margin-top'>","margin-block-start":"<'margin-top'>","margin-bottom":"<length-percentage>|auto|<anchor-size()>","margin-inline":"<'margin-top'>{1,2}","margin-inline-end":"<'margin-top'>","margin-inline-start":"<'margin-top'>","margin-left":"<length-percentage>|auto|<anchor-size()>","margin-right":"<length-percentage>|auto|<anchor-size()>","margin-top":"<length-percentage>|auto|<anchor-size()>","margin-trim":"none|in-flow|all",marker:"none|<url>","marker-end":"none|<url>","marker-mid":"none|<url>","marker-start":"none|<url>",mask:"<mask-layer>#","mask-border":"<'mask-border-source'>||<'mask-border-slice'> [/ <'mask-border-width'>? [/ <'mask-border-outset'>]?]?||<'mask-border-repeat'>||<'mask-border-mode'>","mask-border-mode":"luminance|alpha","mask-border-outset":"[<length>|<number>]{1,4}","mask-border-repeat":"[stretch|repeat|round|space]{1,2}","mask-border-slice":"<number-percentage>{1,4} fill?","mask-border-source":"none|<image>","mask-border-width":"[<length-percentage>|<number>|auto]{1,4}","mask-clip":"[<coord-box>|no-clip]#","mask-composite":"<compositing-operator>#","mask-image":"<mask-reference>#","mask-mode":"<masking-mode>#","mask-origin":"<coord-box>#","mask-position":"<position>#","mask-repeat":"<repeat-style>#","mask-size":"<bg-size>#","mask-type":"luminance|alpha","masonry-auto-flow":"[pack|next]||[definite-first|ordered]","math-depth":"auto-add|add( <integer> )|<integer>","math-shift":"normal|compact","math-style":"normal|compact","max-block-size":"<'max-width'>","max-height":"none|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","max-inline-size":"<'max-width'>","max-lines":"none|<integer>","max-width":"none|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","min-block-size":"<'min-width'>","min-height":"auto|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","min-inline-size":"<'min-width'>","min-width":"auto|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","mix-blend-mode":"<blend-mode>|plus-darker|plus-lighter","object-fit":"fill|contain|cover|none|scale-down","object-position":"<position>","object-view-box":"none|<basic-shape-rect>",offset:"[<'offset-position'>? [<'offset-path'> [<'offset-distance'>||<'offset-rotate'>]?]?]! [/ <'offset-anchor'>]?","offset-anchor":"auto|<position>","offset-distance":"<length-percentage>","offset-path":"none|<offset-path>||<coord-box>","offset-position":"normal|auto|<position>","offset-rotate":"[auto|reverse]||<angle>",opacity:"<opacity-value>",order:"<integer>",orphans:"<integer>",outline:"<'outline-width'>||<'outline-style'>||<'outline-color'>","outline-color":"auto|<color>","outline-offset":"<length>","outline-style":"auto|<outline-line-style>","outline-width":"<line-width>",overflow:"[visible|hidden|clip|scroll|auto]{1,2}|<-non-standard-overflow>","overflow-anchor":"auto|none","overflow-block":"visible|hidden|clip|scroll|auto|<-non-standard-overflow>","overflow-clip-box":"padding-box|content-box","overflow-clip-margin":"<visual-box>||<length [0,\u221E]>","overflow-inline":"visible|hidden|clip|scroll|auto|<-non-standard-overflow>","overflow-wrap":"normal|break-word|anywhere","overflow-x":"visible|hidden|clip|scroll|auto|<-non-standard-overflow>","overflow-y":"visible|hidden|clip|scroll|auto|<-non-standard-overflow>",overlay:"none|auto","overscroll-behavior":"[contain|none|auto]{1,2}","overscroll-behavior-block":"contain|none|auto","overscroll-behavior-inline":"contain|none|auto","overscroll-behavior-x":"contain|none|auto","overscroll-behavior-y":"contain|none|auto",padding:"<'padding-top'>{1,4}","padding-block":"<'padding-top'>{1,2}","padding-block-end":"<'padding-top'>","padding-block-start":"<'padding-top'>","padding-bottom":"<length-percentage [0,\u221E]>","padding-inline":"<'padding-top'>{1,2}","padding-inline-end":"<'padding-top'>","padding-inline-start":"<'padding-top'>","padding-left":"<length-percentage [0,\u221E]>","padding-right":"<length-percentage [0,\u221E]>","padding-top":"<length-percentage [0,\u221E]>",page:"auto|<custom-ident>","page-break-after":"auto|always|avoid|left|right|recto|verso","page-break-before":"auto|always|avoid|left|right|recto|verso","page-break-inside":"auto|avoid","paint-order":"normal|[fill||stroke||markers]",perspective:"none|<length>","perspective-origin":"<position>","place-content":"<'align-content'> <'justify-content'>?","place-items":"<'align-items'> <'justify-items'>?","place-self":"<'align-self'> <'justify-self'>?","pointer-events":"auto|none|visiblePainted|visibleFill|visibleStroke|visible|painted|fill|stroke|all|inherit",position:"static|relative|absolute|sticky|fixed|-webkit-sticky","position-anchor":"normal|auto|none|<anchor-name>|match-parent","position-area":"none|<position-area>","position-try":"<'position-try-order'>? <'position-try-fallbacks'>","position-try-fallbacks":"none|[[<dashed-ident>||<try-tactic>]|<'position-area'>]#","position-try-order":"normal|<try-size>","position-visibility":"always|[anchors-valid||anchors-visible||no-overflow]","print-color-adjust":"economy|exact",quotes:"none|auto|[<string> <string>]+",r:"<length>|<percentage>","reading-flow":"normal|source-order|flex-visual|flex-flow|grid-rows|grid-columns|grid-order","reading-order":"<integer>",resize:"none|both|horizontal|vertical|block|inline",right:"auto|<length-percentage>|<anchor()>|<anchor-size()>",rotate:"none|<angle>|[x|y|z|<number>{3}]&&<angle>","row-gap":"normal|<length-percentage>","ruby-align":"start|center|space-between|space-around","ruby-merge":"separate|collapse|auto","ruby-overhang":"auto|none","ruby-position":"[alternate||[over|under]]|inter-character",rx:"<length-percentage>|auto",ry:"<length-percentage>|auto",scale:"none|[<number>|<percentage>]{1,3}","scroll-behavior":"auto|smooth","scroll-initial-target":"none|nearest","scroll-margin":"<length>{1,4}","scroll-margin-block":"<length>{1,2}","scroll-margin-block-end":"<length>","scroll-margin-block-start":"<length>","scroll-margin-bottom":"<length>","scroll-margin-inline":"<length>{1,2}","scroll-margin-inline-end":"<length>","scroll-margin-inline-start":"<length>","scroll-margin-left":"<length>","scroll-margin-right":"<length>","scroll-margin-top":"<length>","scroll-marker-group":"none|before|after","scroll-padding":"[auto|<length-percentage>]{1,4}","scroll-padding-block":"[auto|<length-percentage>]{1,2}","scroll-padding-block-end":"auto|<length-percentage>","scroll-padding-block-start":"auto|<length-percentage>","scroll-padding-bottom":"auto|<length-percentage>","scroll-padding-inline":"[auto|<length-percentage>]{1,2}","scroll-padding-inline-end":"auto|<length-percentage>","scroll-padding-inline-start":"auto|<length-percentage>","scroll-padding-left":"auto|<length-percentage>","scroll-padding-right":"auto|<length-percentage>","scroll-padding-top":"auto|<length-percentage>","scroll-snap-align":"[none|start|end|center]{1,2}","scroll-snap-coordinate":"none|<position>#","scroll-snap-destination":"<position>","scroll-snap-points-x":"none|repeat( <length-percentage> )","scroll-snap-points-y":"none|repeat( <length-percentage> )","scroll-snap-stop":"normal|always","scroll-snap-type":"none|[x|y|block|inline|both] [mandatory|proximity]?","scroll-snap-type-x":"none|mandatory|proximity","scroll-snap-type-y":"none|mandatory|proximity","scroll-target-group":"none|auto","scroll-timeline":"[<'scroll-timeline-name'> <'scroll-timeline-axis'>?]#","scroll-timeline-axis":"[block|inline|x|y]#","scroll-timeline-name":"[none|<dashed-ident>]#","scrollbar-color":"auto|<color>{2}","scrollbar-gutter":"auto|stable&&both-edges?","scrollbar-width":"auto|thin|none","shape-image-threshold":"<opacity-value>","shape-margin":"<length-percentage>","shape-outside":"none|[<shape-box>||<basic-shape>]|<image>","shape-rendering":"auto|optimizeSpeed|crispEdges|geometricPrecision","speak-as":"normal|spell-out||digits||[literal-punctuation|no-punctuation]","stop-color":"<'color'>","stop-opacity":"<'opacity'>",stroke:"<paint>","stroke-color":"<color>","stroke-dasharray":"none|[<svg-length>+]#","stroke-dashoffset":"<svg-length>","stroke-linecap":"butt|round|square","stroke-linejoin":"miter|round|bevel","stroke-miterlimit":"<number-one-or-greater>","stroke-opacity":"<'opacity'>","stroke-width":"<svg-length>","tab-size":"<integer>|<length>","table-layout":"auto|fixed","text-align":"start|end|left|right|center|justify|match-parent","text-align-last":"auto|start|end|left|right|center|justify","text-anchor":"start|middle|end","text-autospace":"normal|<autospace>|auto","text-box":"normal|<'text-box-trim'>||<'text-box-edge'>","text-box-edge":"auto|<text-edge>","text-box-trim":"none|trim-start|trim-end|trim-both","text-combine-upright":"none|all|[digits <integer>?]","text-decoration":"<'text-decoration-line'>||<'text-decoration-style'>||<'text-decoration-color'>||<'text-decoration-thickness'>","text-decoration-color":"<color>","text-decoration-inset":"<length>{1,2}|auto","text-decoration-line":"none|[underline||overline||line-through||blink]|spelling-error|grammar-error","text-decoration-skip":"none|[objects||[spaces|[leading-spaces||trailing-spaces]]||edges||box-decoration]","text-decoration-skip-ink":"auto|all|none","text-decoration-style":"solid|double|dotted|dashed|wavy","text-decoration-thickness":"auto|from-font|<length>|<percentage>","text-emphasis":"<'text-emphasis-style'>||<'text-emphasis-color'>","text-emphasis-color":"<color>","text-emphasis-position":"auto|[over|under]&&[right|left]?","text-emphasis-style":"none|[[filled|open]||[dot|circle|double-circle|triangle|sesame]]|<string>","text-indent":"<length-percentage>&&hanging?&&each-line?","text-justify":"auto|inter-character|inter-word|none","text-orientation":"mixed|upright|sideways","text-overflow":"[clip|ellipsis|<string>]{1,2}","text-rendering":"auto|optimizeSpeed|optimizeLegibility|geometricPrecision","text-shadow":"none|<shadow-t>#","text-size-adjust":"none|auto|<percentage>","text-spacing-trim":"space-all|normal|space-first|trim-start","text-transform":"none|[capitalize|uppercase|lowercase]||full-width||full-size-kana|math-auto","text-underline-offset":"auto|<length>|<percentage>","text-underline-position":"auto|from-font|[under||[left|right]]","text-wrap":"<'text-wrap-mode'>||<'text-wrap-style'>","text-wrap-mode":"wrap|nowrap","text-wrap-style":"auto|balance|stable|pretty","timeline-scope":"none|<dashed-ident>#","timeline-trigger":"none|[<'timeline-trigger-name'> <'timeline-trigger-source'> <'timeline-trigger-activation-range'> ['/' <'timeline-trigger-active-range'>]?]#","timeline-trigger-activation-range":"[<'timeline-trigger-activation-range-start'> <'timeline-trigger-activation-range-end'>?]#","timeline-trigger-activation-range-end":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-activation-range-start":"[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-active-range":"[<'timeline-trigger-active-range-start'> <'timeline-trigger-active-range-end'>?]#","timeline-trigger-active-range-end":"[auto|normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-active-range-start":"[auto|normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#","timeline-trigger-name":"none|<dashed-ident>#","timeline-trigger-source":"<single-animation-timeline>#",top:"auto|<length-percentage>|<anchor()>|<anchor-size()>","touch-action":"auto|none|[[pan-x|pan-left|pan-right]||[pan-y|pan-up|pan-down]||pinch-zoom]|manipulation",transform:"none|<transform-list>","transform-box":"content-box|border-box|fill-box|stroke-box|view-box","transform-origin":"[<length-percentage>|left|center|right|top|bottom]|[[<length-percentage>|left|center|right]&&[<length-percentage>|top|center|bottom]] <length>?","transform-style":"flat|preserve-3d",transition:"<single-transition>#","transition-behavior":"<transition-behavior-value>#","transition-delay":"<time>#","transition-duration":"<time>#","transition-property":"none|<single-transition-property>#","transition-timing-function":"<easing-function>#",translate:"none|<length-percentage> [<length-percentage> <length>?]?","trigger-scope":"none|all|<dashed-ident>#","unicode-bidi":"normal|embed|isolate|bidi-override|isolate-override|plaintext|-moz-isolate|-moz-isolate-override|-moz-plaintext|-webkit-isolate|-webkit-isolate-override|-webkit-plaintext","user-select":"auto|text|none|all","vector-effect":"none|non-scaling-stroke|non-scaling-size|non-rotation|fixed-position","vertical-align":"baseline|sub|super|text-top|text-bottom|middle|top|bottom|<percentage>|<length>","view-timeline":"[<'view-timeline-name'> [<'view-timeline-axis'>||<'view-timeline-inset'>]?]#","view-timeline-axis":"[block|inline|x|y]#","view-timeline-inset":"[[auto|<length-percentage>]{1,2}]#","view-timeline-name":"[none|<dashed-ident>]#","view-transition-class":"none|<custom-ident>+","view-transition-name":"none|<custom-ident>|match-element","view-transition-scope":"none|all",visibility:"visible|hidden|collapse","white-space":"normal|pre|pre-wrap|pre-line|<'white-space-collapse'>||<'text-wrap-mode'>","white-space-collapse":"collapse|preserve|preserve-breaks|preserve-spaces|break-spaces",widows:"<integer>",width:"auto|<length-percentage [0,\u221E]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,\u221E]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>","will-change":"auto|<animateable-feature>#","word-break":"normal|break-all|keep-all|break-word|auto-phrase","word-spacing":"normal|<length>","word-wrap":"normal|break-word","writing-mode":"horizontal-tb|vertical-rl|vertical-lr|sideways-rl|sideways-lr|<svg-writing-mode>",x:"<length>|<percentage>",y:"<length>|<percentage>","z-index":"auto|<integer>",zoom:"normal|reset|<number [0,\u221E]>||<percentage [0,\u221E]>","-moz-background-clip":"padding|border","-moz-border-radius-bottomleft":"<'border-bottom-left-radius'>","-moz-border-radius-bottomright":"<'border-bottom-right-radius'>","-moz-border-radius-topleft":"<'border-top-left-radius'>","-moz-border-radius-topright":"<'border-bottom-right-radius'>","-moz-control-character-visibility":"visible|hidden","-moz-osx-font-smoothing":"auto|grayscale","-moz-user-select":"none|text|all|-moz-none","-ms-flex-align":"start|end|center|baseline|stretch","-ms-flex-item-align":"auto|start|end|center|baseline|stretch","-ms-flex-line-pack":"start|end|center|justify|distribute|stretch","-ms-flex-negative":"<'flex-shrink'>","-ms-flex-pack":"start|end|center|justify|distribute","-ms-flex-order":"<integer>","-ms-flex-positive":"<'flex-grow'>","-ms-flex-preferred-size":"<'flex-basis'>","-ms-interpolation-mode":"nearest-neighbor|bicubic","-ms-grid-column-align":"start|end|center|stretch","-ms-grid-row-align":"start|end|center|stretch","-ms-hyphenate-limit-last":"none|always|column|page|spread","-webkit-background-clip":"[<visual-box>|border|padding|content|text]#","-webkit-column-break-after":"always|auto|avoid","-webkit-column-break-before":"always|auto|avoid","-webkit-column-break-inside":"always|auto|avoid","-webkit-font-smoothing":"auto|none|antialiased|subpixel-antialiased","-webkit-mask-box-image":"[<url>|<gradient>|none] [<length-percentage>{4} <-webkit-mask-box-repeat>{2}]?","-webkit-print-color-adjust":"economy|exact","-webkit-text-security":"none|circle|disc|square","-webkit-user-drag":"none|element|auto",behavior:"<url>+",cue:"<'cue-before'> <'cue-after'>?","cue-after":"<url> <decibel>?|none","cue-before":"<url> <decibel>?|none","glyph-orientation-horizontal":"<angle>","glyph-orientation-vertical":"<angle>",kerning:"auto|<svg-length>",pause:"<'pause-before'> <'pause-after'>?","pause-after":"<time>|none|x-weak|weak|medium|strong|x-strong","pause-before":"<time>|none|x-weak|weak|medium|strong|x-strong","position-try-options":"<'position-try-fallbacks'>",rest:"<'rest-before'> <'rest-after'>?","rest-after":"<time>|none|x-weak|weak|medium|strong|x-strong","rest-before":"<time>|none|x-weak|weak|medium|strong|x-strong",speak:"auto|never|always","voice-balance":"<number>|left|center|right|leftwards|rightwards","voice-duration":"auto|<time>","voice-family":"[[<family-name>|<generic-voice>] ,]* [<family-name>|<generic-voice>]|preserve","voice-pitch":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-range":"<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]","voice-rate":"[normal|x-slow|slow|medium|fast|x-fast]||<percentage>","voice-stress":"normal|strong|moderate|none|reduced","voice-volume":"silent|[[x-soft|soft|medium|loud|x-loud]||<decibel>]","white-space-trim":"none|discard-before||discard-after||discard-inner"},atrules:{charset:{prelude:"<string>",descriptors:null},"counter-style":{prelude:"<counter-style-name>",descriptors:{"additive-symbols":"[<integer [0,\u221E]>&&<symbol>]#",fallback:"<counter-style-name>",negative:"<symbol> <symbol>?",pad:"<integer [0,\u221E]>&&<symbol>",prefix:"<symbol>",range:"[[<integer>|infinite]{2}]#|auto","speak-as":"auto|bullets|numbers|words|spell-out|<counter-style-name>",suffix:"<symbol>",symbols:"<symbol>+",system:"cyclic|numeric|alphabetic|symbolic|additive|[fixed <integer>?]|[extends <counter-style-name>]"}},container:{prelude:"[<container-name>]? <container-condition>",descriptors:null},document:{prelude:"[<url>|url-prefix( <string> )|domain( <string> )|media-document( <string> )|regexp( <string> )]#",descriptors:null},"font-face":{prelude:null,descriptors:{"ascent-override":"normal|<percentage>","descent-override":"normal|<percentage>","font-display":"auto|block|swap|fallback|optional","font-family":"<family-name>","font-feature-settings":"normal|<feature-tag-value>#","font-stretch":"<font-stretch-absolute>{1,2}","font-style":"normal|italic|oblique <angle>{0,2}","font-variation-settings":"normal|[<string> <number>]#","font-weight":"<font-weight-absolute>{1,2}","line-gap-override":"normal|<percentage>","size-adjust":"<percentage>",src:"[<url> [format( <string># )]?|local( <family-name> )]#","unicode-range":"<urange>#"}},"font-feature-values":{prelude:"<family-name>#",descriptors:null},"font-palette-values":{prelude:"<dashed-ident>",descriptors:{"base-palette":"light|dark|<integer [0,\u221E]>","font-family":"<family-name>#","override-colors":"[<integer [0,\u221E]> <color>]#"}},import:{prelude:"[<string>|<url>] [layer|layer( <layer-name> )]? [supports( [<supports-condition>|<declaration>] )]? <media-query-list>?",descriptors:null},keyframes:{prelude:"<keyframes-name>",descriptors:null},layer:{prelude:"[<layer-name>#|<layer-name>?]",descriptors:null},media:{prelude:"<media-query-list>",descriptors:null},namespace:{prelude:"<namespace-prefix>? [<string>|<url>]",descriptors:null},page:{prelude:"<page-selector-list>",descriptors:{bleed:"auto|<length>",marks:"none|[crop||cross]","page-orientation":"upright|rotate-left|rotate-right",size:"<length [0,\u221E]>{1,2}|auto|[<page-size>||[portrait|landscape]]"}},"position-try":{prelude:"<dashed-ident>",descriptors:{top:"<'top'>",left:"<'left'>",bottom:"<'bottom'>",right:"<'right'>","inset-block-start":"<'inset-block-start'>","inset-block-end":"<'inset-block-end'>","inset-inline-start":"<'inset-inline-start'>","inset-inline-end":"<'inset-inline-end'>","inset-block":"<'inset-block'>","inset-inline":"<'inset-inline'>",inset:"<'inset'>","margin-top":"<'margin-top'>","margin-left":"<'margin-left'>","margin-bottom":"<'margin-bottom'>","margin-right":"<'margin-right'>","margin-block-start":"<'margin-block-start'>","margin-block-end":"<'margin-block-end'>","margin-inline-start":"<'margin-inline-start'>","margin-inline-end":"<'margin-inline-end'>",margin:"<'margin'>","margin-block":"<'margin-block'>","margin-inline":"<'margin-inline'>",width:"<'width'>",height:"<'height'>","min-width":"<'min-width'>","min-height":"<'min-height'>","max-width":"<'max-width'>","max-height":"<'max-height'>","block-size":"<'block-size'>","inline-size":"<'inline-size'>","min-block-size":"<'min-block-size'>","min-inline-size":"<'min-inline-size'>","max-block-size":"<'max-block-size'>","max-inline-size":"<'max-inline-size'>","align-self":"<'align-self'>|anchor-center","justify-self":"<'justify-self'>|anchor-center"}},property:{prelude:"<custom-property-name>",descriptors:{inherits:"true|false","initial-value":"<declaration-value>?",syntax:"<string>"}},scope:{prelude:"[( <scope-start> )]? [to ( <scope-end> )]?",descriptors:null},"starting-style":{prelude:null,descriptors:null},supports:{prelude:"<supports-condition>",descriptors:null},"view-transition":{prelude:null,descriptors:{navigation:"auto|none",types:"none|<custom-ident>+"}},"font-features-values":{prelude:"[<string>|<custom-ident>]+",descriptors:{"font-display":"auto|block|swap|fallback|optional"}}}};var Et={};f(Et,{AnPlusB:()=>fn,Atrule:()=>bn,AtrulePrelude:()=>xn,AttributeSelector:()=>vn,Block:()=>Cn,Brackets:()=>Ln,CDC:()=>En,CDO:()=>In,ClassSelector:()=>Nn,Combinator:()=>On,Comment:()=>Rn,Condition:()=>Bn,Declaration:()=>Wn,DeclarationList:()=>Un,Dimension:()=>Gn,Feature:()=>Kn,FeatureFunction:()=>Qn,FeatureRange:()=>Zn,Function:()=>eo,GeneralEnclosed:()=>ro,Hash:()=>oo,IdSelector:()=>lo,Identifier:()=>ao,Layer:()=>uo,LayerList:()=>ho,MediaQuery:()=>fo,MediaQueryList:()=>bo,NestingSelector:()=>xo,Nth:()=>wo,Number:()=>So,Operator:()=>To,Parentheses:()=>Ao,Percentage:()=>zo,PseudoClassSelector:()=>Po,PseudoElementSelector:()=>Do,Ratio:()=>Fo,Raw:()=>Mo,Rule:()=>_o,Scope:()=>qo,Selector:()=>Uo,SelectorList:()=>Go,String:()=>Qo,StyleSheet:()=>$o,SupportsDeclaration:()=>Jo,TypeSelector:()=>ri,UnicodeRange:()=>ii,Url:()=>ui,Value:()=>hi,WhiteSpace:()=>di});var fn={};f(fn,{generate:()=>yu,name:()=>gu,parse:()=>dn,structure:()=>bu});var fe=43,oe=45,cr=110,Me=!0,fu=!1;function ur(e,t){let r=this.tokenStart+e,n=this.charCodeAt(r);for((n===fe||n===oe)&&(t&&this.error("Number sign is not allowed"),r++);r<this.tokenEnd;r++)M(this.charCodeAt(r))||this.error("Integer is expected",r)}function at(e){return ur.call(this,0,e)}function Ie(e,t){if(!this.cmpChar(this.tokenStart+e,t)){let r="";switch(t){case cr:r="N is expected";break;case oe:r="HyphenMinus is expected";break}this.error(r,this.tokenStart+e)}}function mn(){let e=0,t=0,r=this.tokenType;for(;r===13||r===25;)r=this.lookupType(++e);if(r!==10)if(this.isDelim(fe,e)||this.isDelim(oe,e)){t=this.isDelim(fe,e)?fe:oe;do r=this.lookupType(++e);while(r===13||r===25);r!==10&&(this.skip(e),at.call(this,Me))}else return null;return e>0&&this.skip(e),t===0&&(r=this.charCodeAt(this.tokenStart),r!==fe&&r!==oe&&this.error("Number sign is expected")),at.call(this,t!==0),t===oe?"-"+this.consume(10):this.consume(10)}var gu="AnPlusB",bu={a:[String,null],b:[String,null]};function dn(){let e=this.tokenStart,t=null,r=null;if(this.tokenType===10)at.call(this,fu),r=this.consume(10);else if(this.tokenType===1&&this.cmpChar(this.tokenStart,oe))switch(t="-1",Ie.call(this,1,cr),this.tokenEnd-this.tokenStart){case 2:this.next(),r=mn.call(this);break;case 3:Ie.call(this,2,oe),this.next(),this.skipSC(),at.call(this,Me),r="-"+this.consume(10);break;default:Ie.call(this,2,oe),ur.call(this,3,Me),this.next(),r=this.substrToCursor(e+2)}else if(this.tokenType===1||this.isDelim(fe)&&this.lookupType(1)===1){let n=0;switch(t="1",this.isDelim(fe)&&(n=1,this.next()),Ie.call(this,0,cr),this.tokenEnd-this.tokenStart){case 1:this.next(),r=mn.call(this);break;case 2:Ie.call(this,1,oe),this.next(),this.skipSC(),at.call(this,Me),r="-"+this.consume(10);break;default:Ie.call(this,1,oe),ur.call(this,2,Me),this.next(),r=this.substrToCursor(e+n+1)}}else if(this.tokenType===12){let n=this.charCodeAt(this.tokenStart),o=n===fe||n===oe,i=this.tokenStart+o;for(;i<this.tokenEnd&&M(this.charCodeAt(i));i++);i===this.tokenStart+o&&this.error("Integer is expected",this.tokenStart+o),Ie.call(this,i-this.tokenStart,cr),t=this.substring(e,i),i+1===this.tokenEnd?(this.next(),r=mn.call(this)):(Ie.call(this,i-this.tokenStart+1,oe),i+2===this.tokenEnd?(this.next(),this.skipSC(),at.call(this,Me),r="-"+this.consume(10)):(ur.call(this,i-this.tokenStart+2,Me),this.next(),r=this.substrToCursor(i+1)))}else this.error();return t!==null&&t.charCodeAt(0)===fe&&(t=t.substr(1)),r!==null&&r.charCodeAt(0)===fe&&(r=r.substr(1)),{type:"AnPlusB",loc:this.getLocation(e,this.tokenStart),a:t,b:r}}function yu(e){if(e.a){let t=e.a==="+1"&&"n"||e.a==="1"&&"n"||e.a==="-1"&&"-n"||e.a+"n";if(e.b){let r=e.b[0]==="-"||e.b[0]==="+"?e.b:"+"+e.b;this.tokenize(t+r)}else this.tokenize(t)}else this.tokenize(e.b)}var bn={};f(bn,{generate:()=>Su,name:()=>ku,parse:()=>gn,structure:()=>vu,walkContext:()=>wu});function Xa(){return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon,!0)}function xu(){for(let e=1,t;t=this.lookupType(e);e++){if(t===24)return!0;if(t===23||t===3)return!1}return!1}var ku="Atrule",wu="atrule",vu={name:String,prelude:["AtrulePrelude","Raw",null],block:["Block",null]};function gn(e=!1,{allowNestedRules:t=!1}={}){let r=this.tokenStart,n,o,i=null,a=null;switch(this.eat(3),n=this.substrToCursor(r+1),o=n.toLowerCase(),this.skipSC(),this.eof===!1&&this.tokenType!==23&&this.tokenType!==17&&(this.parseAtrulePrelude?i=this.parseWithFallback(this.AtrulePrelude.bind(this,n,e),Xa):i=Xa.call(this,this.tokenIndex),this.skipSC()),this.tokenType){case 17:this.next();break;case 23:hasOwnProperty.call(this.atrule,o)&&typeof this.atrule[o].block=="function"?a=this.atrule[o].block.call(this,e,{allowNestedRules:t}):a=this.Block(e||xu.call(this),{allowNestedRules:t});break}return{type:"Atrule",loc:this.getLocation(r,this.tokenStart),name:n,prelude:i,block:a}}function Su(e){this.token(3,"@"+e.name),e.prelude!==null&&this.node(e.prelude),e.block?this.node(e.block):this.token(17,";")}var xn={};f(xn,{generate:()=>Au,name:()=>Cu,parse:()=>yn,structure:()=>Lu,walkContext:()=>Tu});var Cu="AtrulePrelude",Tu="atrulePrelude",Lu={children:[[]]};function yn(e){let t=null;return e!==null&&(e=e.toLowerCase()),this.skipSC(),hasOwnProperty.call(this.atrule,e)&&typeof this.atrule[e].prelude=="function"?t=this.atrule[e].prelude.call(this):t=this.readSequence(this.scope.AtrulePrelude),this.skipSC(),this.eof!==!0&&this.tokenType!==23&&this.tokenType!==17&&this.error("Semicolon or block is expected"),{type:"AtrulePrelude",loc:this.getLocationFromList(t),children:t}}function Au(e){this.children(e)}var vn={};f(vn,{generate:()=>Fu,name:()=>Du,parse:()=>wn,structure:()=>Ou});var Eu=36,$a=42,pr=61,zu=94,kn=124,Iu=126;function Pu(){this.eof&&this.error("Unexpected end of input");let e=this.tokenStart,t=!1;return this.isDelim($a)?(t=!0,this.next()):this.isDelim(kn)||this.eat(1),this.isDelim(kn)?this.charCodeAt(this.tokenStart+1)!==pr?(this.next(),this.eat(1)):t&&this.error("Identifier is expected",this.tokenEnd):t&&this.error("Vertical line is expected"),{type:"Identifier",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function Nu(){let e=this.tokenStart,t=this.charCodeAt(e);return t!==pr&&t!==Iu&&t!==zu&&t!==Eu&&t!==$a&&t!==kn&&this.error("Attribute selector (=, ~=, ^=, $=, *=, |=) is expected"),this.next(),t!==pr&&(this.isDelim(pr)||this.error("Equal sign is expected"),this.next()),this.substrToCursor(e)}var Du="AttributeSelector",Ou={name:"Identifier",matcher:[String,null],value:["String","Identifier",null],flags:[String,null]};function wn(){let e=this.tokenStart,t,r=null,n=null,o=null;return this.eat(19),this.skipSC(),t=Pu.call(this),this.skipSC(),this.tokenType!==20&&(this.tokenType!==1&&(r=Nu.call(this),this.skipSC(),n=this.tokenType===5?this.String():this.Identifier(),this.skipSC()),this.tokenType===1&&(o=this.consume(1),this.skipSC())),this.eat(20),{type:"AttributeSelector",loc:this.getLocation(e,this.tokenStart),name:t,matcher:r,value:n,flags:o}}function Fu(e){this.token(9,"["),this.node(e.name),e.matcher!==null&&(this.tokenize(e.matcher),this.node(e.value)),e.flags!==null&&this.token(1,e.flags),this.token(9,"]")}var Cn={};f(Cn,{generate:()=>Yu,name:()=>Uu,parse:()=>Sn,structure:()=>Gu,walkContext:()=>Hu});var es=38,Ru=46,ts=42,rs=43,Mu=62,Bu=126,_u=new Set([es,Ru,ts,rs,Mu,Bu]);function ns(){return this.Raw(null,!0)}function Za(){return this.parseWithFallback(this.Rule,ns)}function Ja(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function Wu(){if(this.tokenType===17)return Ja.call(this,this.tokenIndex);let e=this.parseWithFallback(this.Declaration,Ja);return this.tokenType===17&&this.next(),e}function qu(){if(this.tokenType!==1)return!1;let e=this.lookupTypeNonSC(1);if(e!==16&&e!==17&&e!==24)return!0;if(e===16){let t=this.lookupTypeNonSC(2);if(t===1||t===2){let r=3,n;for(;r<=15;){if(n=this.lookupType(r),n===23)return!0;if(n===17||n===24)return!1;if(n===13||n===25){r++;continue}else r++}}return!1}return!1}function ju(){if(this.tokenType===9&&_u.has(this.source.charCodeAt(this.tokenStart))){let e=this.source.charCodeAt(this.tokenStart);if(e===ts||e===rs||e===es){let t=this.lookupType(1),r=this.lookupTypeNonSC(1);if(t===1&&r===1)return!1}return!0}return this.tokenType===4?!0:this.tokenType===19||this.tokenType===16||qu.call(this)}var Uu="Block",Hu="block",Gu={children:[["Atrule","Rule","Declaration"]]};function Sn(e,{allowNestedRules:t=!1}={}){let r=this.tokenStart,n=this.createList();this.eat(23);e:for(;!this.eof;)switch(this.tokenType){case 24:break e;case 13:case 25:this.next();break;case 3:n.push(this.parseWithFallback(this.Atrule.bind(this,e,{allowNestedRules:t}),ns));break;default:e?t&&ju.call(this)?n.push(Za.call(this)):n.push(Wu.call(this)):n.push(Za.call(this))}return this.eof||this.eat(24),{type:"Block",loc:this.getLocation(r,this.tokenStart),children:n}}function Yu(e){this.token(23,"{"),this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")}),this.token(24,"}")}var Ln={};f(Ln,{generate:()=>Qu,name:()=>Ku,parse:()=>Tn,structure:()=>Vu});var Ku="Brackets",Vu={children:[[]]};function Tn(e,t){let r=this.tokenStart,n=null;return this.eat(19),n=e.call(this,t),this.eof||this.eat(20),{type:"Brackets",loc:this.getLocation(r,this.tokenStart),children:n}}function Qu(e){this.token(9,"["),this.children(e),this.token(9,"]")}var En={};f(En,{generate:()=>Zu,name:()=>Xu,parse:()=>An,structure:()=>$u});var Xu="CDC",$u={};function An(){let e=this.tokenStart;return this.eat(15),{type:"CDC",loc:this.getLocation(e,this.tokenStart)}}function Zu(){this.token(15,"-->")}var In={};f(In,{generate:()=>tp,name:()=>Ju,parse:()=>zn,structure:()=>ep});var Ju="CDO",ep={};function zn(){let e=this.tokenStart;return this.eat(14),{type:"CDO",loc:this.getLocation(e,this.tokenStart)}}function tp(){this.token(14,"<!--")}var Nn={};f(Nn,{generate:()=>ip,name:()=>np,parse:()=>Pn,structure:()=>op});var rp=46,np="ClassSelector",op={name:String};function Pn(){return this.eatDelim(rp),{type:"ClassSelector",loc:this.getLocation(this.tokenStart-1,this.tokenEnd),name:this.consume(1)}}function ip(e){this.token(9,"."),this.token(1,e.name)}var On={};f(On,{generate:()=>pp,name:()=>cp,parse:()=>Dn,structure:()=>up});var ap=43,os=47,sp=62,lp=126,cp="Combinator",up={name:String};function Dn(){let e=this.tokenStart,t;switch(this.tokenType){case 13:t=" ";break;case 9:switch(this.charCodeAt(this.tokenStart)){case sp:case ap:case lp:this.next();break;case os:this.next(),this.eatIdent("deep"),this.eatDelim(os);break;default:this.error("Combinator is expected")}t=this.substrToCursor(e);break}return{type:"Combinator",loc:this.getLocation(e,this.tokenStart),name:t}}function pp(e){this.tokenize(e.name)}var Rn={};f(Rn,{generate:()=>gp,name:()=>dp,parse:()=>Fn,structure:()=>fp});var hp=42,mp=47,dp="Comment",fp={value:String};function Fn(){let e=this.tokenStart,t=this.tokenEnd;return this.eat(25),t-e+2>=2&&this.charCodeAt(t-2)===hp&&this.charCodeAt(t-1)===mp&&(t-=2),{type:"Comment",loc:this.getLocation(e,this.tokenStart),value:this.substring(e+2,t)}}function gp(e){this.token(25,"/*"+e.value+"*/")}var Bn={};f(Bn,{generate:()=>wp,name:()=>yp,parse:()=>Mn,structure:()=>xp});var bp=new Set([16,22,0]),yp="Condition",xp={kind:String,children:[["Identifier","Feature","FeatureFunction","FeatureRange","SupportsDeclaration"]]};function is(e){return this.lookupTypeNonSC(1)===1&&bp.has(this.lookupTypeNonSC(2))?this.Feature(e):this.FeatureRange(e)}var kp={media:is,container:is,supports(){return this.SupportsDeclaration()}};function Mn(e="media"){let t=this.createList();e:for(;!this.eof;)switch(this.tokenType){case 25:case 13:this.next();continue;case 1:t.push(this.Identifier());break;case 21:{let r=this.parseWithFallback(()=>kp[e].call(this,e),()=>null);r||(r=this.parseWithFallback(()=>{this.eat(21);let n=this.Condition(e);return this.eat(22),n},()=>this.GeneralEnclosed(e))),t.push(r);break}case 2:{let r=this.parseWithFallback(()=>this.FeatureFunction(e),()=>null);r||(r=this.GeneralEnclosed(e)),t.push(r);break}default:break e}return t.isEmpty&&this.error("Condition is expected"),{type:"Condition",loc:this.getLocationFromList(t),kind:e,children:t}}function wp(e){e.children.forEach(t=>{t.type==="Condition"?(this.token(21,"("),this.node(t),this.token(22,")")):this.node(t)})}var Wn={};f(Wn,{generate:()=>Dp,name:()=>Ip,parse:()=>_n,structure:()=>Np,walkContext:()=>Pp});var ss=33,vp=35,Sp=36,Cp=38,Tp=42,Lp=43,as=47;function Ap(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!0)}function Ep(){return this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1)}function zp(){let e=this.tokenIndex,t=this.Value();return t.type!=="Raw"&&this.eof===!1&&this.tokenType!==17&&this.isDelim(ss)===!1&&this.isBalanceEdge(e)===!1&&this.error(),t}var Ip="Declaration",Pp="declaration",Np={important:[Boolean,String],property:String,value:["Value","Raw"]};function _n(){let e=this.tokenStart,t=this.tokenIndex,r=Op.call(this),n=gt(r),o=n?this.parseCustomProperty:this.parseValue,i=n?Ep:Ap,a=!1,c;this.skipSC(),this.eat(16);let u=this.tokenIndex;if(n||this.skipSC(),o?c=this.parseWithFallback(zp,i):c=i.call(this,this.tokenIndex),n&&c.type==="Value"&&c.children.isEmpty){for(let s=u-this.tokenIndex;s<=0;s++)if(this.lookupType(s)===13){c.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}return this.isDelim(ss)&&(a=Fp.call(this),this.skipSC()),this.eof===!1&&this.tokenType!==17&&this.isBalanceEdge(t)===!1&&this.error(),{type:"Declaration",loc:this.getLocation(e,this.tokenStart),important:a,property:r,value:c}}function Dp(e){this.token(1,e.property),this.token(16,":"),this.node(e.value),e.important&&(this.token(9,"!"),this.token(1,e.important===!0?"important":e.important))}function Op(){let e=this.tokenStart;if(this.tokenType===9)switch(this.charCodeAt(this.tokenStart)){case Tp:case Sp:case Lp:case vp:case Cp:this.next();break;case as:this.next(),this.isDelim(as)&&this.next();break}return this.tokenType===4?this.eat(4):this.eat(1),this.substrToCursor(e)}function Fp(){this.eat(9),this.skipSC();let e=this.consume(1);return e==="important"?!0:e}var Un={};f(Un,{generate:()=>Kp,name:()=>Gp,parse:()=>jn,structure:()=>Yp});var Rp=38,Mp=46,Bp=42,_p=43,Wp=62,qp=126,jp=new Set([Rp,Mp,Bp,_p,Wp,qp]);function qn(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}function Up(){if(this.tokenType!==1)return!1;let e=this.lookupTypeNonSC(1);return e===23?!0:e===17||e===18||e===24?!1:e===16&&this.lookupTypeNonSC(2)===1?this.lookupTypeNonSC(3)===23:!1}function Hp(){return this.tokenType===9&&jp.has(this.source.charCodeAt(this.tokenStart))||this.tokenType===4||this.tokenType===19||this.tokenType===16||Up.call(this)}var Gp="DeclarationList",Yp={children:[["Declaration","Atrule","Rule"]]};function jn(){let e=this.createList();for(;!this.eof;)switch(this.tokenType){case 13:case 25:case 17:this.next();break;case 3:e.push(this.parseWithFallback(this.Atrule.bind(this,!0),qn));break;default:Hp.call(this)?e.push(this.parseWithFallback(this.Rule,qn)):e.push(this.parseWithFallback(this.Declaration,qn))}return{type:"DeclarationList",loc:this.getLocationFromList(e),children:e}}function Kp(e){this.children(e,t=>{t.type==="Declaration"&&this.token(17,";")})}var Gn={};f(Gn,{generate:()=>Xp,name:()=>Vp,parse:()=>Hn,structure:()=>Qp});var Vp="Dimension",Qp={value:String,unit:String};function Hn(){let e=this.tokenStart,t=this.consumeNumber(12);return{type:"Dimension",loc:this.getLocation(e,this.tokenStart),value:t,unit:this.substring(e+t.length,this.tokenStart)}}function Xp(e){this.token(12,e.value+e.unit)}var Kn={};f(Kn,{generate:()=>eh,name:()=>Zp,parse:()=>Yn,structure:()=>Jp});var $p=47,Zp="Feature",Jp={kind:String,name:String,value:["Identifier","Number","Dimension","Ratio","Function",null]};function Yn(e){let t=this.tokenStart,r,n=null;if(this.eat(21),this.skipSC(),r=this.consume(1),this.skipSC(),this.tokenType!==22){switch(this.eat(16),this.skipSC(),this.tokenType){case 10:this.lookupNonWSType(1)===9?n=this.Ratio():n=this.Number();break;case 12:n=this.Dimension();break;case 1:n=this.Identifier();break;case 2:n=this.parseWithFallback(()=>{let o=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim($p)&&this.error(),o},()=>this.Ratio());break;default:this.error("Number, dimension, ratio or identifier is expected")}this.skipSC()}return this.eof||this.eat(22),{type:"Feature",loc:this.getLocation(t,this.tokenStart),kind:e,name:r,value:n}}function eh(e){this.token(21,"("),this.token(1,e.name),e.value!==null&&(this.token(16,":"),this.node(e.value)),this.token(22,")")}var Qn={};f(Qn,{generate:()=>oh,name:()=>th,parse:()=>Vn,structure:()=>rh});var th="FeatureFunction",rh={kind:String,feature:String,value:["Declaration","Selector"]};function nh(e,t){let n=(this.features[e]||{})[t];return typeof n!="function"&&this.error(`Unknown feature ${t}()`),n}function Vn(e="unknown"){let t=this.tokenStart,r=this.consumeFunctionName(),n=nh.call(this,e,r.toLowerCase());this.skipSC();let o=this.parseWithFallback(()=>{let i=this.tokenIndex,a=n.call(this);return this.eof===!1&&this.isBalanceEdge(i)===!1&&this.error(),a},()=>this.Raw(null,!1));return this.eof||this.eat(22),{type:"FeatureFunction",loc:this.getLocation(t,this.tokenStart),kind:e,feature:r,value:o}}function oh(e){this.token(2,e.feature+"("),this.node(e.value),this.token(22,")")}var Zn={};f(Zn,{generate:()=>ch,name:()=>sh,parse:()=>$n,structure:()=>lh});var ls=47,ih=60,cs=61,ah=62,sh="FeatureRange",lh={kind:String,left:["Identifier","Number","Dimension","Ratio","Function"],leftComparison:String,middle:["Identifier","Number","Dimension","Ratio","Function"],rightComparison:[String,null],right:["Identifier","Number","Dimension","Ratio","Function",null]};function Xn(){switch(this.skipSC(),this.tokenType){case 10:return this.isDelim(ls,this.lookupOffsetNonSC(1))?this.Ratio():this.Number();case 12:return this.Dimension();case 1:return this.Identifier();case 2:return this.parseWithFallback(()=>{let e=this.Function(this.readSequence,this.scope.Value);return this.skipSC(),this.isDelim(ls)&&this.error(),e},()=>this.Ratio());default:this.error("Number, dimension, ratio or identifier is expected")}}function us(e){if(this.skipSC(),this.isDelim(ih)||this.isDelim(ah)){let t=this.source[this.tokenStart];return this.next(),this.isDelim(cs)?(this.next(),t+"="):t}if(this.isDelim(cs))return"=";this.error(`Expected ${e?'":", ':""}"<", ">", "=" or ")"`)}function $n(e="unknown"){let t=this.tokenStart;this.skipSC(),this.eat(21);let r=Xn.call(this),n=us.call(this,r.type==="Identifier"),o=Xn.call(this),i=null,a=null;return this.lookupNonWSType(0)!==22&&(i=us.call(this),a=Xn.call(this)),this.skipSC(),this.eat(22),{type:"FeatureRange",loc:this.getLocation(t,this.tokenStart),kind:e,left:r,leftComparison:n,middle:o,rightComparison:i,right:a}}function ch(e){this.token(21,"("),this.node(e.left),this.tokenize(e.leftComparison),this.node(e.middle),e.right&&(this.tokenize(e.rightComparison),this.node(e.right)),this.token(22,")")}var eo={};f(eo,{generate:()=>mh,name:()=>uh,parse:()=>Jn,structure:()=>hh,walkContext:()=>ph});var uh="Function",ph="function",hh={name:String,children:[[]]};function Jn(e,t){let r=this.tokenStart,n=this.consumeFunctionName(),o=n.toLowerCase(),i;return i=t.hasOwnProperty(o)?t[o].call(this,t):e.call(this,t),this.eof||this.eat(22),{type:"Function",loc:this.getLocation(r,this.tokenStart),name:n,children:i}}function mh(e){this.token(2,e.name+"("),this.children(e),this.token(22,")")}var ro={};f(ro,{generate:()=>gh,name:()=>dh,parse:()=>to,structure:()=>fh});var dh="GeneralEnclosed",fh={kind:String,function:[String,null],children:[[]]};function to(e){let t=this.tokenStart,r=null;this.tokenType===2?r=this.consumeFunctionName():this.eat(21);let n=this.parseWithFallback(()=>{let o=this.tokenIndex,i=this.readSequence(this.scope.Value);return this.eof===!1&&this.isBalanceEdge(o)===!1&&this.error(),i},()=>this.createSingleNodeList(this.Raw(null,!1)));return this.eof||this.eat(22),{type:"GeneralEnclosed",loc:this.getLocation(t,this.tokenStart),kind:e,function:r,children:n}}function gh(e){e.function?this.token(2,e.function+"("):this.token(21,"("),this.children(e),this.token(22,")")}var oo={};f(oo,{generate:()=>kh,name:()=>yh,parse:()=>no,structure:()=>xh,xxx:()=>bh});var bh="XXX",yh="Hash",xh={value:String};function no(){let e=this.tokenStart;return this.eat(4),{type:"Hash",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e+1)}}function kh(e){this.token(4,"#"+e.value)}var ao={};f(ao,{generate:()=>Sh,name:()=>wh,parse:()=>io,structure:()=>vh});var wh="Identifier",vh={name:String};function io(){return{type:"Identifier",loc:this.getLocation(this.tokenStart,this.tokenEnd),name:this.consume(1)}}function Sh(e){this.token(1,e.name)}var lo={};f(lo,{generate:()=>Lh,name:()=>Ch,parse:()=>so,structure:()=>Th});var Ch="IdSelector",Th={name:String};function so(){let e=this.tokenStart;return this.eat(4),{type:"IdSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e+1)}}function Lh(e){this.token(9,"#"+e.name)}var uo={};f(uo,{generate:()=>Ih,name:()=>Eh,parse:()=>co,structure:()=>zh});var Ah=46,Eh="Layer",zh={name:String};function co(){let e=this.tokenStart,t=this.consume(1);for(;this.isDelim(Ah);)this.eat(9),t+="."+this.consume(1);return{type:"Layer",loc:this.getLocation(e,this.tokenStart),name:t}}function Ih(e){this.tokenize(e.name)}var ho={};f(ho,{generate:()=>Dh,name:()=>Ph,parse:()=>po,structure:()=>Nh});var Ph="LayerList",Nh={children:[["Layer"]]};function po(){let e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.Layer()),this.lookupTypeNonSC(0)===18);)this.skipSC(),this.next(),this.skipSC();return{type:"LayerList",loc:this.getLocationFromList(e),children:e}}function Dh(e){this.children(e,()=>this.token(18,","))}var fo={};f(fo,{generate:()=>Rh,name:()=>Oh,parse:()=>mo,structure:()=>Fh});var Oh="MediaQuery",Fh={modifier:[String,null],mediaType:[String,null],condition:["Condition",null]};function mo(){let e=this.tokenStart,t=null,r=null,n=null;if(this.skipSC(),this.tokenType===1&&this.lookupTypeNonSC(1)!==21){let o=this.consume(1),i=o.toLowerCase();switch(i==="not"||i==="only"?(this.skipSC(),t=i,r=this.consume(1)):r=o,this.lookupTypeNonSC(0)){case 1:{this.skipSC(),this.eatIdent("and"),n=this.Condition("media");break}case 23:case 17:case 18:case 0:break;default:this.error("Identifier or parenthesis is expected")}}else switch(this.tokenType){case 1:case 21:case 2:{n=this.Condition("media");break}case 23:case 17:case 0:break;default:this.error("Identifier or parenthesis is expected")}return{type:"MediaQuery",loc:this.getLocation(e,this.tokenStart),modifier:t,mediaType:r,condition:n}}function Rh(e){e.mediaType?(e.modifier&&this.token(1,e.modifier),this.token(1,e.mediaType),e.condition&&(this.token(1,"and"),this.node(e.condition))):e.condition&&this.node(e.condition)}var bo={};f(bo,{generate:()=>_h,name:()=>Mh,parse:()=>go,structure:()=>Bh});var Mh="MediaQueryList",Bh={children:[["MediaQuery"]]};function go(){let e=this.createList();for(this.skipSC();!this.eof&&(e.push(this.MediaQuery()),this.tokenType===18);)this.next();return{type:"MediaQueryList",loc:this.getLocationFromList(e),children:e}}function _h(e){this.children(e,()=>this.token(18,","))}var xo={};f(xo,{generate:()=>Uh,name:()=>qh,parse:()=>yo,structure:()=>jh});var Wh=38,qh="NestingSelector",jh={};function yo(){let e=this.tokenStart;return this.eatDelim(Wh),{type:"NestingSelector",loc:this.getLocation(e,this.tokenStart)}}function Uh(){this.token(9,"&")}var wo={};f(wo,{generate:()=>Yh,name:()=>Hh,parse:()=>ko,structure:()=>Gh});var Hh="Nth",Gh={nth:["AnPlusB","Identifier"],selector:["SelectorList",null]};function ko(){this.skipSC();let e=this.tokenStart,t=e,r=null,n;return this.lookupValue(0,"odd")||this.lookupValue(0,"even")?n=this.Identifier():n=this.AnPlusB(),t=this.tokenStart,this.skipSC(),this.lookupValue(0,"of")&&(this.next(),r=this.SelectorList(),t=this.tokenStart),{type:"Nth",loc:this.getLocation(e,t),nth:n,selector:r}}function Yh(e){this.node(e.nth),e.selector!==null&&(this.token(1,"of"),this.node(e.selector))}var So={};f(So,{generate:()=>Qh,name:()=>Kh,parse:()=>vo,structure:()=>Vh});var Kh="Number",Vh={value:String};function vo(){return{type:"Number",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consume(10)}}function Qh(e){this.token(10,e.value)}var To={};f(To,{generate:()=>Zh,name:()=>Xh,parse:()=>Co,structure:()=>$h});var Xh="Operator",$h={value:String};function Co(){let e=this.tokenStart;return this.next(),{type:"Operator",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function Zh(e){this.tokenize(e.value)}var Ao={};f(Ao,{generate:()=>tm,name:()=>Jh,parse:()=>Lo,structure:()=>em});var Jh="Parentheses",em={children:[[]]};function Lo(e,t){let r=this.tokenStart,n=null;return this.eat(21),n=e.call(this,t),this.eof||this.eat(22),{type:"Parentheses",loc:this.getLocation(r,this.tokenStart),children:n}}function tm(e){this.token(21,"("),this.children(e),this.token(22,")")}var zo={};f(zo,{generate:()=>om,name:()=>rm,parse:()=>Eo,structure:()=>nm});var rm="Percentage",nm={value:String};function Eo(){return{type:"Percentage",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:this.consumeNumber(11)}}function om(e){this.token(11,e.value+"%")}var Po={};f(Po,{generate:()=>lm,name:()=>im,parse:()=>Io,structure:()=>sm,walkContext:()=>am});var im="PseudoClassSelector",am="function",sm={name:String,children:[["Raw"],null]};function Io(){let e=this.tokenStart,t=null,r,n;return this.eat(16),this.tokenType===2?(r=this.consumeFunctionName(),n=r.toLowerCase(),this.lookupNonWSType(0)==22?t=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),t=this.pseudo[n].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(22)):r=this.consume(1),{type:"PseudoClassSelector",loc:this.getLocation(e,this.tokenStart),name:r,children:t}}function lm(e){this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var Do={};f(Do,{generate:()=>hm,name:()=>cm,parse:()=>No,structure:()=>pm,walkContext:()=>um});var cm="PseudoElementSelector",um="function",pm={name:String,children:[["Raw"],null]};function No(){let e=this.tokenStart,t=null,r,n;return this.eat(16),this.eat(16),this.tokenType===2?(r=this.consumeFunctionName(),n=r.toLowerCase(),this.lookupNonWSType(0)==22?t=this.createList():hasOwnProperty.call(this.pseudo,n)?(this.skipSC(),t=this.pseudo[n].call(this),this.skipSC()):(t=this.createList(),t.push(this.Raw(null,!1))),this.eat(22)):r=this.consume(1),{type:"PseudoElementSelector",loc:this.getLocation(e,this.tokenStart),name:r,children:t}}function hm(e){this.token(16,":"),this.token(16,":"),e.children===null?this.token(1,e.name):(this.token(2,e.name+"("),this.children(e),this.token(22,")"))}var Fo={};f(Fo,{generate:()=>fm,name:()=>mm,parse:()=>Oo,structure:()=>dm});var ps=47;function hs(){switch(this.skipSC(),this.tokenType){case 10:return this.Number();case 2:return this.Function(this.readSequence,this.scope.Value);default:this.error("Number of function is expected")}}var mm="Ratio",dm={left:["Number","Function"],right:["Number","Function",null]};function Oo(){let e=this.tokenStart,t=hs.call(this),r=null;return this.skipSC(),this.isDelim(ps)&&(this.eatDelim(ps),r=hs.call(this)),{type:"Ratio",loc:this.getLocation(e,this.tokenStart),left:t,right:r}}function fm(e){this.node(e.left),this.token(9,"/"),e.right?this.node(e.right):this.node(10,1)}var Mo={};f(Mo,{generate:()=>xm,name:()=>bm,parse:()=>Ro,structure:()=>ym});function gm(){return this.tokenIndex>0&&this.lookupType(-1)===13?this.tokenIndex>1?this.getTokenStart(this.tokenIndex-1):this.firstCharOffset:this.tokenStart}var bm="Raw",ym={value:String};function Ro(e,t){let r=this.getTokenStart(this.tokenIndex),n;return this.skipUntilBalanced(this.tokenIndex,e||this.consumeUntilBalanceEnd),t&&this.tokenStart>r?n=gm.call(this):n=this.tokenStart,{type:"Raw",loc:this.getLocation(r,n),value:this.substring(r,n)}}function xm(e){this.tokenize(e.value)}var _o={};f(_o,{generate:()=>Cm,name:()=>wm,parse:()=>Bo,structure:()=>Sm,walkContext:()=>vm});function ms(){return this.Raw(this.consumeUntilLeftCurlyBracket,!0)}function km(){let e=this.SelectorList();return e.type!=="Raw"&&this.eof===!1&&this.tokenType!==23&&this.error(),e}var wm="Rule",vm="rule",Sm={prelude:["SelectorList","Raw"],block:["Block"]};function Bo(){let e=this.tokenIndex,t=this.tokenStart,r,n;return this.parseRulePrelude?r=this.parseWithFallback(km,ms):r=ms.call(this,e),n=this.Block(!0,{allowNestedRules:!0}),{type:"Rule",loc:this.getLocation(t,this.tokenStart),prelude:r,block:n}}function Cm(e){this.node(e.prelude),this.node(e.block)}var qo={};f(qo,{generate:()=>Am,name:()=>Tm,parse:()=>Wo,structure:()=>Lm});var Tm="Scope",Lm={root:["SelectorList","Raw",null],limit:["SelectorList","Raw",null]};function Wo(){let e=null,t=null;this.skipSC();let r=this.tokenStart;return this.tokenType===21&&(this.next(),this.skipSC(),e=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(22)),this.lookupNonWSType(0)===1&&(this.skipSC(),this.eatIdent("to"),this.skipSC(),this.eat(21),this.skipSC(),t=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(22)),{type:"Scope",loc:this.getLocation(r,this.tokenStart),root:e,limit:t}}function Am(e){e.root&&(this.token(21,"("),this.node(e.root),this.token(22,")")),e.limit&&(this.token(1,"to"),this.token(21,"("),this.node(e.limit),this.token(22,")"))}var Uo={};f(Uo,{generate:()=>Im,name:()=>Em,parse:()=>jo,structure:()=>zm});var Em="Selector",zm={children:[["TypeSelector","IdSelector","ClassSelector","AttributeSelector","PseudoClassSelector","PseudoElementSelector","Combinator"]]};function jo(){let e=this.readSequence(this.scope.Selector);return this.getFirstListNode(e)===null&&this.error("Selector is expected"),{type:"Selector",loc:this.getLocationFromList(e),children:e}}function Im(e){this.children(e)}var Go={};f(Go,{generate:()=>Om,name:()=>Pm,parse:()=>Ho,structure:()=>Dm,walkContext:()=>Nm});var Pm="SelectorList",Nm="selector",Dm={children:[["Selector","Raw"]]};function Ho(){let e=this.createList();for(;!this.eof;){if(e.push(this.Selector()),this.tokenType===18){this.next();continue}break}return{type:"SelectorList",loc:this.getLocationFromList(e),children:e}}function Om(e){this.children(e,()=>this.token(18,","))}var Qo={};f(Qo,{generate:()=>Mm,name:()=>Fm,parse:()=>Vo,structure:()=>Rm});var hr={};f(hr,{decode:()=>Lt,encode:()=>Ko});var Yo=92,ds=34,fs=39;function Lt(e){let t=e.length,r=e.charCodeAt(0),n=r===ds||r===fs?1:0,o=n===1&&t>1&&e.charCodeAt(t-1)===r?t-2:t-1,i="";for(let a=n;a<=o;a++){let c=e.charCodeAt(a);if(c===Yo){if(a===o){a!==t-1&&(i=e.substr(a+1));break}if(c=e.charCodeAt(++a),$(Yo,c)){let u=a-1,s=le(e,u);a=s-1,i+=Ge(e.substring(u+1,s))}else c===13&&e.charCodeAt(a+1)===10&&a++}else i+=e[a]}return i}function Ko(e,t){let r=t?"'":'"',n=t?fs:ds,o="",i=!1;for(let a=0;a<e.length;a++){let c=e.charCodeAt(a);if(c===0){o+="\uFFFD";continue}if(c<=31||c===127){o+="\\"+c.toString(16),i=!0;continue}c===n||c===Yo?(o+="\\"+e.charAt(a),i=!1):(i&&(te(c)||me(c))&&(o+=" "),o+=e.charAt(a),i=!1)}return r+o+r}var Fm="String",Rm={value:String};function Vo(){return{type:"String",loc:this.getLocation(this.tokenStart,this.tokenEnd),value:Lt(this.consume(5))}}function Mm(e){this.token(5,Ko(e.value))}var $o={};f($o,{generate:()=>jm,name:()=>_m,parse:()=>Xo,structure:()=>qm,walkContext:()=>Wm});var Bm=33;function gs(){return this.Raw(null,!1)}var _m="StyleSheet",Wm="stylesheet",qm={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function Xo(){let e=this.tokenStart,t=this.createList(),r;for(;!this.eof;){switch(this.tokenType){case 13:this.next();continue;case 25:if(this.charCodeAt(this.tokenStart+2)!==Bm){this.next();continue}r=this.Comment();break;case 14:r=this.CDO();break;case 15:r=this.CDC();break;case 3:r=this.parseWithFallback(this.Atrule,gs);break;default:r=this.parseWithFallback(this.Rule,gs)}t.push(r)}return{type:"StyleSheet",loc:this.getLocation(e,this.tokenStart),children:t}}function jm(e){this.children(e)}var Jo={};f(Jo,{generate:()=>Gm,name:()=>Um,parse:()=>Zo,structure:()=>Hm});var Um="SupportsDeclaration",Hm={declaration:"Declaration"};function Zo(){let e=this.tokenStart;this.eat(21),this.skipSC();let t=this.Declaration();return this.eof||this.eat(22),{type:"SupportsDeclaration",loc:this.getLocation(e,this.tokenStart),declaration:t}}function Gm(e){this.token(21,"("),this.node(e.declaration),this.token(22,")")}var ri={};f(ri,{generate:()=>Vm,name:()=>Ym,parse:()=>ti,structure:()=>Km});var bs=42,ys=124;function ei(){if(this.tokenType!==1&&this.isDelim(bs)===!1&&this.error("Identifier or asterisk is expected"),this.isDelim(bs)){let e=this.tokenStart+1;this.next(),this.tokenType===1&&this.tokenStart===e&&this.error("Whitespace is required between universal selector and type selector");return}this.next()}var Ym="TypeSelector",Km={name:String};function ti(){let e=this.tokenStart;return this.isDelim(ys)?(this.next(),ei.call(this)):(ei.call(this),this.isDelim(ys)&&(this.next(),ei.call(this))),{type:"TypeSelector",loc:this.getLocation(e,this.tokenStart),name:this.substrToCursor(e)}}function Vm(e){this.tokenize(e.name)}var ii={};f(ii,{generate:()=>Jm,name:()=>$m,parse:()=>oi,structure:()=>Zm});var xs=43,ks=45,ni=63;function At(e,t){let r=0;for(let n=this.tokenStart+e;n<this.tokenEnd;n++){let o=this.charCodeAt(n);if(o===ks&&t&&r!==0)return At.call(this,e+r+1,!1),-1;te(o)||this.error(t&&r!==0?"Hyphen minus"+(r<6?" or hex digit":"")+" is expected":r<6?"Hex digit is expected":"Unexpected input",n),++r>6&&this.error("Too many hex digits",n)}return this.next(),r}function mr(e){let t=0;for(;this.isDelim(ni);)++t>e&&this.error("Too many question marks"),this.next()}function Qm(e){this.charCodeAt(this.tokenStart)!==e&&this.error((e===xs?"Plus sign":"Hyphen minus")+" is ex*Ppected")}function Xm(){let e=0;switch(this.tokenType){case 10:if(e=At.call(this,1,!0),this.isDelim(ni)){mr.call(this,6-e);break}if(this.tokenType===12||this.tokenType===10){Qm.call(this,ks),At.call(this,1,!1);break}break;case 12:e=At.call(this,1,!0),e>0&&mr.call(this,6-e);break;default:if(this.eatDelim(xs),this.tokenType===1){e=At.call(this,0,!0),e>0&&mr.call(this,6-e);break}if(this.isDelim(ni)){this.next(),mr.call(this,5);break}this.error("Hex digit or question mark is expected")}}var $m="UnicodeRange",Zm={value:String};function oi(){let e=this.tokenStart;return this.eatIdent("u"),Xm.call(this),{type:"UnicodeRange",loc:this.getLocation(e,this.tokenStart),value:this.substrToCursor(e)}}function Jm(e){this.tokenize(e.value)}var ui={};f(ui,{generate:()=>ad,name:()=>od,parse:()=>ci,structure:()=>id});var dr={};f(dr,{decode:()=>si,encode:()=>li});var ed=32,ai=92,td=34,rd=39,nd=40,ws=41;function si(e){let t=e.length,r=4,n=e.charCodeAt(t-1)===ws?t-2:t-1,o="";for(;r<n&&me(e.charCodeAt(r));)r++;for(;r<n&&me(e.charCodeAt(n));)n--;for(let i=r;i<=n;i++){let a=e.charCodeAt(i);if(a===ai){if(i===n){i!==t-1&&(o=e.substr(i+1));break}if(a=e.charCodeAt(++i),$(ai,a)){let c=i-1,u=le(e,c);i=u-1,o+=Ge(e.substring(c+1,u))}else a===13&&e.charCodeAt(i+1)===10&&i++}else o+=e[i]}return o}function li(e){let t="",r=!1;for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);if(o===0){t+="\uFFFD";continue}if(o<=31||o===127){t+="\\"+o.toString(16),r=!0;continue}o===ed||o===ai||o===td||o===rd||o===nd||o===ws?(t+="\\"+e.charAt(n),r=!1):(r&&te(o)&&(t+=" "),t+=e.charAt(n),r=!1)}return"url("+t+")"}var od="Url",id={value:String};function ci(){let e=this.tokenStart,t;switch(this.tokenType){case 7:t=si(this.consume(7));break;case 2:this.cmpStr(this.tokenStart,this.tokenEnd,"url(")||this.error("Function name must be `url`"),this.eat(2),this.skipSC(),t=Lt(this.consume(5)),this.skipSC(),this.eof||this.eat(22);break;default:this.error("Url or Function is expected")}return{type:"Url",loc:this.getLocation(e,this.tokenStart),value:t}}function ad(e){this.token(7,li(e.value))}var hi={};f(hi,{generate:()=>cd,name:()=>sd,parse:()=>pi,structure:()=>ld});var sd="Value",ld={children:[[]]};function pi(){let e=this.tokenStart,t=this.readSequence(this.scope.Value);return{type:"Value",loc:this.getLocation(e,this.tokenStart),children:t}}function cd(e){this.children(e)}var di={};f(di,{generate:()=>md,name:()=>pd,parse:()=>mi,structure:()=>hd});var ud=Object.freeze({type:"WhiteSpace",loc:null,value:" "}),pd="WhiteSpace",hd={value:String};function mi(){return this.eat(13),ud}function md(e){this.token(13,e.value)}var vs={generic:!0,cssWideKeywords:et,...Qa,node:Et};var fi={};f(fi,{AtrulePrelude:()=>Cs,Selector:()=>Ls,Value:()=>Is});var dd=35,fd=42,Ss=43,gd=45,bd=47,yd=117;function zt(e){switch(this.tokenType){case 4:return this.Hash();case 18:return this.Operator();case 21:return this.Parentheses(this.readSequence,e.recognizer);case 19:return this.Brackets(this.readSequence,e.recognizer);case 5:return this.String();case 12:return this.Dimension();case 11:return this.Percentage();case 10:return this.Number();case 2:return this.cmpStr(this.tokenStart,this.tokenEnd,"url(")?this.Url():this.Function(this.readSequence,e.recognizer);case 7:return this.Url();case 1:return this.cmpChar(this.tokenStart,yd)&&this.cmpChar(this.tokenStart+1,Ss)?this.UnicodeRange():this.Identifier();case 9:{let t=this.charCodeAt(this.tokenStart);if(t===bd||t===fd||t===Ss||t===gd)return this.Operator();t===dd&&this.error("Hex or identifier is expected",this.tokenStart+1);break}}}var Cs={getNode:zt};var xd=35,kd=38,wd=42,vd=43,Sd=47,Ts=46,Cd=62,Td=124,Ld=126;function Ad(e,t){t.last!==null&&t.last.type!=="Combinator"&&e!==null&&e.type!=="Combinator"&&t.push({type:"Combinator",loc:null,name:" "})}function Ed(){switch(this.tokenType){case 19:return this.AttributeSelector();case 4:return this.IdSelector();case 16:return this.lookupType(1)===16?this.PseudoElementSelector():this.PseudoClassSelector();case 1:return this.TypeSelector();case 10:case 11:return this.Percentage();case 12:this.charCodeAt(this.tokenStart)===Ts&&this.error("Identifier is expected",this.tokenStart+1);break;case 9:{switch(this.charCodeAt(this.tokenStart)){case vd:case Cd:case Ld:case Sd:return this.Combinator();case Ts:return this.ClassSelector();case wd:case Td:return this.TypeSelector();case xd:return this.IdSelector();case kd:return this.NestingSelector()}break}}}var Ls={onWhiteSpace:Ad,getNode:Ed};function As(){return this.createSingleNodeList(this.Raw(null,!1))}function Es(){let e=this.createList();if(this.skipSC(),e.push(this.Identifier()),this.skipSC(),this.tokenType===18){e.push(this.Operator());let t=this.tokenIndex,r=this.parseCustomProperty?this.Value(null):this.Raw(this.consumeUntilExclamationMarkOrSemicolon,!1);if(r.type==="Value"&&r.children.isEmpty){for(let n=t-this.tokenIndex;n<=0;n++)if(this.lookupType(n)===13){r.children.appendData({type:"WhiteSpace",loc:null,value:" "});break}}e.push(r)}return e}function zs(e){return e!==null&&e.type==="Operator"&&(e.value[e.value.length-1]==="-"||e.value[e.value.length-1]==="+")}var Is={getNode:zt,onWhiteSpace(e,t){zs(e)&&(e.value=" "+e.value),zs(t.last)&&(t.last.value+=" ")},expression:As,var:Es};var zd=new Set(["none","and","not","or"]),Ps={parse:{prelude(){let e=this.createList();if(this.tokenType===1){let t=this.substring(this.tokenStart,this.tokenEnd);zd.has(t.toLowerCase())||e.push(this.Identifier())}return e.push(this.Condition("container")),e},block(e=!1){return this.Block(e)}}};var Ns={parse:{prelude:null,block(){return this.Block(!0)}}};function gi(e,t){return this.parseWithFallback(()=>{try{return e.call(this)}finally{this.skipSC(),this.lookupNonWSType(0)!==22&&this.error()}},t||(()=>this.Raw(null,!0)))}var Ds={layer(){this.skipSC();let e=this.createList(),t=gi.call(this,this.Layer);return(t.type!=="Raw"||t.value!=="")&&e.push(t),e},supports(){this.skipSC();let e=this.createList(),t=gi.call(this,this.Declaration,()=>gi.call(this,()=>this.Condition("supports")));return(t.type!=="Raw"||t.value!=="")&&e.push(t),e}},Os={parse:{prelude(){let e=this.createList();switch(this.tokenType){case 5:e.push(this.String());break;case 7:case 2:e.push(this.Url());break;default:this.error("String or url() is expected")}return this.skipSC(),this.tokenType===1&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer")?e.push(this.Identifier()):this.tokenType===2&&this.cmpStr(this.tokenStart,this.tokenEnd,"layer(")&&e.push(this.Function(null,Ds)),this.skipSC(),this.tokenType===2&&this.cmpStr(this.tokenStart,this.tokenEnd,"supports(")&&e.push(this.Function(null,Ds)),(this.lookupNonWSType(0)===1||this.lookupNonWSType(0)===21)&&e.push(this.MediaQueryList()),e},block:null}};var Fs={parse:{prelude(){return this.createSingleNodeList(this.LayerList())},block(e=!1,{allowNestedRules:t=!1}={}){return this.Block(e,{allowNestedRules:t})}}};var Rs={parse:{prelude(){return this.createSingleNodeList(this.MediaQueryList())},block(e=!1,{allowNestedRules:t=!1}={}){return this.Block(e,{allowNestedRules:t})}}};var Ms={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}};var Bs={parse:{prelude(){return this.createSingleNodeList(this.SelectorList())},block(){return this.Block(!0)}}};var _s={parse:{prelude(){return this.createSingleNodeList(this.Scope())},block(e=!1){return this.Block(e)}}};var Ws={parse:{prelude:null,block(e=!1){return this.Block(e)}}};var qs={parse:{prelude(){return this.createSingleNodeList(this.Condition("supports"))},block(e=!1){return this.Block(e)}}};var js={container:Ps,"font-face":Ns,import:Os,layer:Fs,media:Rs,nest:Ms,page:Bs,scope:_s,"starting-style":Ws,supports:qs};function Us(){let e=this.createList();this.skipSC();e:for(;!this.eof;){switch(this.tokenType){case 1:e.push(this.Identifier());break;case 5:e.push(this.String());break;case 18:e.push(this.Operator());break;case 22:break e;default:this.error("Identifier, string or comma is expected")}this.skipSC()}return e}var Be={parse(){return this.createSingleNodeList(this.SelectorList())}},bi={parse(){return this.createSingleNodeList(this.Selector())}},Id={parse(){return this.createSingleNodeList(this.Identifier())}},Pd={parse:Us},fr={parse(){return this.createSingleNodeList(this.Nth())}},Hs={dir:Id,has:Be,lang:Pd,matches:Be,is:Be,"-moz-any":Be,"-webkit-any":Be,where:Be,not:Be,"nth-child":fr,"nth-last-child":fr,"nth-last-of-type":fr,"nth-of-type":fr,slotted:bi,host:bi,"host-context":bi};var yi={};f(yi,{AnPlusB:()=>dn,Atrule:()=>gn,AtrulePrelude:()=>yn,AttributeSelector:()=>wn,Block:()=>Sn,Brackets:()=>Tn,CDC:()=>An,CDO:()=>zn,ClassSelector:()=>Pn,Combinator:()=>Dn,Comment:()=>Fn,Condition:()=>Mn,Declaration:()=>_n,DeclarationList:()=>jn,Dimension:()=>Hn,Feature:()=>Yn,FeatureFunction:()=>Vn,FeatureRange:()=>$n,Function:()=>Jn,GeneralEnclosed:()=>to,Hash:()=>no,IdSelector:()=>so,Identifier:()=>io,Layer:()=>co,LayerList:()=>po,MediaQuery:()=>mo,MediaQueryList:()=>go,NestingSelector:()=>yo,Nth:()=>ko,Number:()=>vo,Operator:()=>Co,Parentheses:()=>Lo,Percentage:()=>Eo,PseudoClassSelector:()=>Io,PseudoElementSelector:()=>No,Ratio:()=>Oo,Raw:()=>Ro,Rule:()=>Bo,Scope:()=>Wo,Selector:()=>jo,SelectorList:()=>Ho,String:()=>Vo,StyleSheet:()=>Xo,SupportsDeclaration:()=>Zo,TypeSelector:()=>ti,UnicodeRange:()=>oi,Url:()=>ci,Value:()=>pi,WhiteSpace:()=>mi});var Gs={parseContext:{default:"StyleSheet",stylesheet:"StyleSheet",atrule:"Atrule",atrulePrelude(e){return this.AtrulePrelude(e.atrule?String(e.atrule):null)},mediaQueryList:"MediaQueryList",mediaQuery:"MediaQuery",condition(e){return this.Condition(e.kind)},rule:"Rule",selectorList:"SelectorList",selector:"Selector",block(){return this.Block(!0)},declarationList:"DeclarationList",declaration:"Declaration",value:"Value"},features:{supports:{selector(){return this.Selector()}},container:{style(){return this.Declaration()}}},scope:fi,atrule:js,pseudo:Hs,node:yi,tokenize:qt};var Ys={node:Et};var Ks=lr({...vs,...Gs,...Ys});var Nd="4.0.5";function gr(e){let t={};for(let r of Object.keys(e)){let n=e[r];n&&(Array.isArray(n)||n instanceof U?n=n.map(gr):n.constructor===Object&&(n=gr(n))),t[r]=n}return t}var xi={};f(xi,{decode:()=>Dd,encode:()=>Od});var Vs=92;function Dd(e){let t=e.length-1,r="";for(let n=0;n<e.length;n++){let o=e.charCodeAt(n);if(o===Vs){if(n===t)break;if(o=e.charCodeAt(++n),$(Vs,o)){let i=n-1,a=le(e,i);n=a-1,r+=Ge(e.substring(i+1,a))}else o===13&&e.charCodeAt(n+1)===10&&n++}else r+=e[n]}return r}function Od(e){let t="";if(e.length===1&&e.charCodeAt(0)===45)return"\\-";for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);if(n===0){t+="\uFFFD";continue}if(n<=31||n===127||n>=48&&n<=57&&(r===0||r===1&&e.charCodeAt(0)===45)){t+="\\"+n.toString(16)+" ";continue}je(n)?t+=e.charAt(r):t+="\\"+e.charAt(r)}return t}var{tokenize:Fd,parse:Rd,generate:Md,lexer:Bd,createLexer:_d,walk:Wd,find:qd,findLast:jd,findAll:Ud,toPlainObject:Hd,fromPlainObject:Gd,fork:Yd}=Ks;return tl(Kd);})();
4Vk1x   module.exports = {
    "generic": true,
    "cssWideKeywords": [
        "initial",
        "inherit",
        "unset",
        "revert",
        "revert-layer"
    ],
    "units": {
        "angle": [
            "deg",
            "grad",
            "rad",
            "turn"
        ],
        "decibel": [
            "db"
        ],
        "flex": [
            "fr"
        ],
        "frequency": [
            "hz",
            "khz"
        ],
        "length": [
            "cm",
            "mm",
            "q",
            "in",
            "pt",
            "pc",
            "px",
            "em",
            "rem",
            "ex",
            "rex",
            "cap",
            "rcap",
            "ch",
            "rch",
            "ic",
            "ric",
            "lh",
            "rlh",
            "vw",
            "svw",
            "lvw",
            "dvw",
            "vh",
            "svh",
            "lvh",
            "dvh",
            "vi",
            "svi",
            "lvi",
            "dvi",
            "vb",
            "svb",
            "lvb",
            "dvb",
            "vmin",
            "svmin",
            "lvmin",
            "dvmin",
            "vmax",
            "svmax",
            "lvmax",
            "dvmax",
            "cqw",
            "cqh",
            "cqi",
            "cqb",
            "cqmin",
            "cqmax"
        ],
        "resolution": [
            "dpi",
            "dpcm",
            "dppx",
            "x"
        ],
        "semitones": [
            "st"
        ],
        "time": [
            "s",
            "ms"
        ]
    },
    "types": {
        "abs()": "abs( <calc-sum> )",
        "absolute-size": "xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large",
        "acos()": "acos( <calc-sum> )",
        "alpha-value": "<number>|<percentage>",
        "an+b": "odd|even|<integer>|<n-dimension>|'+'? † n|-n|<ndashdigit-dimension>|'+'? † <ndashdigit-ident>|<dashndashdigit-ident>|<n-dimension> <signed-integer>|'+'? † n <signed-integer>|-n <signed-integer>|<ndash-dimension> <signless-integer>|'+'? † n- <signless-integer>|-n- <signless-integer>|<n-dimension> ['+'|'-'] <signless-integer>|'+'? † n ['+'|'-'] <signless-integer>|-n ['+'|'-'] <signless-integer>",
        "anchor()": "anchor( <anchor-name>?&&<anchor-side> , <length-percentage>? )",
        "anchor-name": "<dashed-ident>",
        "anchor-side": "inside|outside|top|left|right|bottom|start|end|self-start|self-end|<percentage>|center",
        "anchor-size": "width|height|block|inline|self-block|self-inline",
        "anchor-size()": "anchor-size( [<anchor-name>||<anchor-size>]? , <length-percentage>? )",
        "angle-percentage": "<angle>|<percentage>",
        "angular-color-hint": "<angle-percentage>|<zero>",
        "angular-color-stop": "<color> <color-stop-angle>?",
        "angular-color-stop-list": "<angular-color-stop> , [<angular-color-hint>? , <angular-color-stop>]#?",
        "animateable-feature": "scroll-position|contents|<custom-ident>",
        "animation-action": "none|play|play-once|play-forwards|play-backwards|pause|reset|replay",
        "asin()": "asin( <calc-sum> )",
        "atan()": "atan( <calc-sum> )",
        "atan2()": "atan2( <calc-sum> , <calc-sum> )",
        "attachment": "scroll|fixed|local",
        "attr()": "attr( <attr-name> <attr-type>? , <declaration-value>? )",
        "attr-matcher": "['~'|'|'|'^'|'$'|'*']? '='",
        "attr-modifier": "i|s",
        "attr-type": "type( <syntax> )|raw-string|number|<attr-unit>",
        "attribute-selector": "'[' <wq-name> ']'|'[' <wq-name> <attr-matcher> [<string-token>|<ident-token>] <attr-modifier>? ']'",
        "auto-repeat": "repeat( [auto-fill|auto-fit] , [<line-names>? <fixed-size>]+ <line-names>? )",
        "auto-track-list": "[<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>? <auto-repeat> [<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>?",
        "axis": "block|inline|x|y",
        "baseline-position": "[first|last]? baseline",
        "basic-shape": "<inset()>|<xywh()>|<rect()>|<circle()>|<ellipse()>|<polygon()>|<path()>|shape( )",
        "basic-shape-rect": "<inset()>|<rect()>|<xywh()>",
        "bg-clip": "<visual-box>|border-area|text",
        "bg-image": "<image>|none",
        "bg-layer": "<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<visual-box>||<visual-box>",
        "bg-position": "[[left|center|right|top|bottom|<length-percentage>]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]|[center|[left|right] <length-percentage>?]&&[center|[top|bottom] <length-percentage>?]]",
        "bg-size": "[<length-percentage [0,∞]>|auto]{1,2}|cover|contain",
        "blend-mode": "normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity",
        "blur()": "blur( <length>? )",
        "brightness()": "brightness( [<number>|<percentage>]? )",
        "calc()": "calc( <calc-sum> )",
        "calc-constant": "e|pi|infinity|-infinity|NaN",
        "calc-product": "<calc-value> ['*' <calc-value>|'/' <number>]*",
        "calc-size()": "calc-size( <calc-size-basis> , <calc-sum> )",
        "calc-size-basis": "<intrinsic-size-keyword>|<calc-size()>|any|<calc-sum>",
        "calc-sum": "<calc-product> [['+'|'-'] <calc-product>]*",
        "calc-value": "<number>|<dimension>|<percentage>|<calc-constant>|( <calc-sum> )",
        "cf-final-image": "<image>|<color>",
        "cf-mixing-image": "<percentage>?&&<image>",
        "circle()": "circle( <radial-size>? [at <position>]? )",
        "clamp()": "clamp( <calc-sum>#{3} )",
        "class-selector": "'.' <ident-token>",
        "clip-source": "<url>",
        "color": "<color-base>|currentColor|<system-color>|<device-cmyk()>|<light-dark()>|<-non-standard-color>",
        "color()": "color( <colorspace-params> [/ [<alpha-value>|none]]? )",
        "color-base": "<hex-color>|<color-function>|<named-color>|<color-mix()>|transparent",
        "color-function": "<rgb()>|<rgba()>|<hsl()>|<hsla()>|<hwb()>|<lab()>|<lch()>|<oklab()>|<oklch()>|<alpha()>|<color()>",
        "color-interpolation-method": "in [<rectangular-color-space>|<polar-color-space> <hue-interpolation-method>?|<custom-color-space>]",
        "color-mix()": "color-mix( <color-interpolation-method> , [<color>&&<percentage [0,100]>?]#{2} )",
        "color-stop": "<color-stop-length>|<color-stop-angle>",
        "color-stop-angle": "[<angle-percentage>|<zero>]{1,2}",
        "color-stop-length": "<length-percentage>{1,2}",
        "color-stop-list": "<linear-color-stop> , [<linear-color-hint>? , <linear-color-stop>]#?",
        "colorspace-params": "[<predefined-rgb-params>|<xyz-params>]",
        "combinator": "'>'|'+'|'~'|['|' '|']",
        "common-lig-values": "[common-ligatures|no-common-ligatures]",
        "compat-auto": "searchfield|textarea|checkbox|radio|menulist|listbox|meter|progress-bar|button",
        "compat-special": "textfield|menulist-button",
        "complex-selector": "<complex-selector-unit> [<combinator>? <complex-selector-unit>]*",
        "complex-selector-list": "<complex-selector>#",
        "composite-style": "clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor",
        "compositing-operator": "add|subtract|intersect|exclude",
        "compound-selector": "[<type-selector>? <subclass-selector>*]!",
        "compound-selector-list": "<compound-selector>#",
        "conic-gradient()": "conic-gradient( [<conic-gradient-syntax>] )",
        "conic-gradient-syntax": "[[[from [<angle>|<zero>]]? [at <position>]?]||<color-interpolation-method>]? , <angular-color-stop-list>",
        "container-condition": "not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]",
        "container-name": "<custom-ident>",
        "container-query": "not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]",
        "content-distribution": "space-between|space-around|space-evenly|stretch",
        "content-list": "[<string>|contents|<image>|<counter>|<quote>|<target>|<leader()>|<attr()>]+",
        "content-position": "center|start|end|flex-start|flex-end",
        "content-replacement": "<image>",
        "contextual-alt-values": "[contextual|no-contextual]",
        "contrast()": "contrast( [<number>|<percentage>]? )",
        "coord-box": "content-box|padding-box|border-box|fill-box|stroke-box|view-box",
        "corner-shape-value": "round|scoop|bevel|notch|square|squircle|<superellipse()>",
        "cos()": "cos( <calc-sum> )",
        "counter": "<counter()>|<counters()>",
        "counter()": "counter( <counter-name> , <counter-style>? )",
        "counter-name": "<custom-ident>",
        "counter-style": "<counter-style-name>|symbols( )",
        "counter-style-name": "<custom-ident>",
        "counters()": "counters( <counter-name> , <string> , <counter-style>? )",
        "cross-fade()": "cross-fade( <cf-mixing-image> , <cf-final-image>? )",
        "cubic-bezier()": "cubic-bezier( [<number [0,1]> , <number>]#{2} )",
        "cubic-bezier-easing-function": "ease|ease-in|ease-out|ease-in-out|cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )",
        "cursor-predefined": "auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing",
        "custom-color-space": "<dashed-ident>",
        "custom-params": "<dashed-ident> [<number>|<percentage>|none]+",
        "dasharray": "[[<length-percentage>|<number>]+]#",
        "dashndashdigit-ident": "<ident-token>",
        "deprecated-system-color": "ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonHighlight|ButtonShadow|CaptionText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText",
        "discretionary-lig-values": "[discretionary-ligatures|no-discretionary-ligatures]",
        "display-box": "contents|none",
        "display-inside": "flow|flow-root|table|flex|grid|ruby",
        "display-internal": "table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container",
        "display-legacy": "inline-block|inline-list-item|inline-table|inline-flex|inline-grid",
        "display-listitem": "<display-outside>?&&[flow|flow-root]?&&list-item",
        "display-outside": "block|inline|run-in",
        "drop-shadow()": "drop-shadow( [<color>?&&<length>{2,3}] )",
        "dynamic-range-limit-mix()": "dynamic-range-limit-mix( [<'dynamic-range-limit'>&&<percentage [0,100]>]#{2,} )",
        "easing-function": "<linear-easing-function>|<cubic-bezier-easing-function>|<step-easing-function>",
        "east-asian-variant-values": "[jis78|jis83|jis90|jis04|simplified|traditional]",
        "east-asian-width-values": "[full-width|proportional-width]",
        "element()": "element( <custom-ident> , [first|start|last|first-except]? )|element( <id-selector> )",
        "ellipse()": "ellipse( <radial-size>? [at <position>]? )",
        "env()": "env( <custom-ident> , <declaration-value>? )",
        "exp()": "exp( <calc-sum> )",
        "explicit-track-list": "[<line-names>? <track-size>]+ <line-names>?",
        "family-name": "<string>|<custom-ident>+",
        "feature-tag-value": "<string> [<integer>|on|off]?",
        "feature-type": "@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation",
        "feature-value-block": "<feature-type> '{' <feature-value-declaration-list> '}'",
        "feature-value-block-list": "<feature-value-block>+",
        "feature-value-declaration": "<custom-ident> : <integer>+ ;",
        "feature-value-declaration-list": "<feature-value-declaration>",
        "feature-value-name": "<custom-ident>",
        "filter-function": "<blur()>|<brightness()>|<contrast()>|<drop-shadow()>|<grayscale()>|<hue-rotate()>|<invert()>|<opacity()>|<saturate()>|<sepia()>",
        "filter-value-list": "[<filter-function>|<url>]+",
        "final-bg-layer": "<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<visual-box>||<visual-box>||<'background-color'>",
        "fit-content()": "fit-content( <length-percentage [0,∞]> )",
        "fixed-breadth": "<length-percentage>",
        "fixed-repeat": "repeat( [<integer [1,∞]>] , [<line-names>? <fixed-size>]+ <line-names>? )",
        "fixed-size": "<fixed-breadth>|minmax( <fixed-breadth> , <track-breadth> )|minmax( <inflexible-breadth> , <fixed-breadth> )",
        "font-stretch-absolute": "normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|<percentage>",
        "font-variant-css2": "normal|small-caps",
        "font-weight-absolute": "normal|bold|<number [1,1000]>",
        "font-width-css3": "normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",
        "form-control-identifier": "select",
        "frequency-percentage": "<frequency>|<percentage>",
        "generic-complete": "serif|sans-serif|system-ui|cursive|fantasy|math|monospace",
        "general-enclosed": "[<function-token> <any-value>? )]|[( <any-value>? )]",
        "generic-family": "<generic-script-specific>|<generic-complete>|<generic-incomplete>|<-non-standard-generic-family>",
        "generic-incomplete": "ui-serif|ui-sans-serif|ui-monospace|ui-rounded",
        "geometry-box": "<shape-box>|fill-box|stroke-box|view-box",
        "gradient": "<linear-gradient()>|<repeating-linear-gradient()>|<radial-gradient()>|<repeating-radial-gradient()>|<conic-gradient()>|<repeating-conic-gradient()>|<-legacy-gradient>",
        "grayscale()": "grayscale( [<number>|<percentage>]? )",
        "grid-line": "auto|<custom-ident>|[<integer>&&<custom-ident>?]|[span&&[<integer>||<custom-ident>]]",
        "historical-lig-values": "[historical-ligatures|no-historical-ligatures]",
        "hsl()": "<legacy-hsl-syntax>|<modern-hsl-syntax>",
        "hsla()": "<legacy-hsla-syntax>|<modern-hsla-syntax>",
        "hue": "<number>|<angle>",
        "hue-interpolation-method": "[shorter|longer|increasing|decreasing] hue",
        "hue-rotate()": "hue-rotate( [<angle>|<zero>]? )",
        "hwb()": "<legacy-hwb-syntax>|<modern-hwb-syntax>",
        "hypot()": "hypot( <calc-sum># )",
        "image": "<url>|<image()>|<image-set()>|<element()>|<paint()>|<cross-fade()>|<gradient>",
        "image()": "image( <image-tags>? [<image-src>? , <color>?]! )",
        "image-set()": "image-set( <image-set-option># )",
        "image-set-option": "[<image>|<string>] [<resolution>||type( <string> )]",
        "image-src": "<url>|<string>",
        "image-tags": "ltr|rtl",
        "inflexible-breadth": "<length-percentage>|min-content|max-content|auto",
        "inset()": "inset( <length-percentage>{1,4} [round <'border-radius'>]? )",
        "invert()": "invert( [<number>|<percentage>]? )",
        "keyframe-block": "<keyframe-selector># { <declaration-list> }",
        "keyframe-selector": "from|to|<percentage [0,100]>|<timeline-range-name> <percentage>",
        "keyframes-name": "<custom-ident>|<string>",
        "lab()": "<legacy-lab-syntax>|<modern-lab-syntax>",
        "layer()": "layer( <layer-name> )",
        "layer-name": "<ident> ['.' <ident>]*",
        "lch()": "<legacy-lch-syntax>|<modern-lch-syntax>",
        "leader()": "leader( <leader-type> )",
        "leader-type": "dotted|solid|space|<string>",
        "length-percentage": "<length>|<percentage>",
        "light-dark()": "light-dark( <color> , <color> )",
        "line-name-list": "[<line-names>|<name-repeat>]+",
        "line-names": "'[' <custom-ident>* ']'",
        "line-style": "none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset",
        "line-width": "<length>|thin|medium|thick",
        "linear()": "linear( [<number>&&<percentage>{0,2}]# )",
        "linear-color-hint": "<length-percentage>",
        "linear-color-stop": "<color> <color-stop-length>?",
        "linear-easing-function": "linear|<linear()>",
        "linear-gradient()": "linear-gradient( [<linear-gradient-syntax>] )",
        "linear-gradient-syntax": "[[<angle>|<zero>|to <side-or-corner>]||<color-interpolation-method>]? , <color-stop-list>",
        "log()": "log( <calc-sum> , <calc-sum>? )",
        "mask-layer": "<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||<geometry-box>||[<geometry-box>|no-clip]||<compositing-operator>||<masking-mode>",
        "mask-position": "[<length-percentage>|left|center|right] [<length-percentage>|top|center|bottom]?",
        "mask-reference": "none|<image>|<mask-source>",
        "mask-source": "<url>",
        "masking-mode": "alpha|luminance|match-source",
        "matrix()": "matrix( <number>#{6} )",
        "matrix3d()": "matrix3d( <number>#{16} )",
        "max()": "max( <calc-sum># )",
        "media-and": "<media-in-parens> [and <media-in-parens>]+",
        "media-condition": "<media-not>|<media-and>|<media-or>|<media-in-parens>",
        "media-condition-without-or": "<media-not>|<media-and>|<media-in-parens>",
        "media-feature": "( [<mf-plain>|<mf-boolean>|<mf-range>] )",
        "media-in-parens": "( <media-condition> )|<media-feature>|<general-enclosed>",
        "media-not": "not <media-in-parens>",
        "media-or": "<media-in-parens> [or <media-in-parens>]+",
        "media-query": "<media-condition>|[not|only]? <media-type> [and <media-condition-without-or>]?",
        "media-query-list": "<media-query>#",
        "media-type": "<ident>",
        "mf-boolean": "<mf-name>",
        "mf-name": "<ident>",
        "mf-plain": "<mf-name> : <mf-value>",
        "mf-range": "<mf-name> ['<'|'>']? '='? <mf-value>|<mf-value> ['<'|'>']? '='? <mf-name>|<mf-value> '<' '='? <mf-name> '<' '='? <mf-value>|<mf-value> '>' '='? <mf-name> '>' '='? <mf-value>",
        "mf-value": "<number>|<dimension>|<ident>|<ratio>",
        "min()": "min( <calc-sum># )",
        "minmax()": "minmax( [<length-percentage>|min-content|max-content|auto] , [<length-percentage>|<flex>|min-content|max-content|auto] )",
        "mod()": "mod( <calc-sum> , <calc-sum> )",
        "n-dimension": "<dimension-token>",
        "name-repeat": "repeat( [<integer [1,∞]>|auto-fill] , <line-names>+ )",
        "named-color": "aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen",
        "namespace-prefix": "<ident>",
        "ndash-dimension": "<dimension-token>",
        "ndashdigit-dimension": "<dimension-token>",
        "ndashdigit-ident": "<ident-token>",
        "ns-prefix": "[<ident-token>|'*']? '|'",
        "number-percentage": "<number>|<percentage>",
        "numeric-figure-values": "[lining-nums|oldstyle-nums]",
        "numeric-fraction-values": "[diagonal-fractions|stacked-fractions]",
        "numeric-spacing-values": "[proportional-nums|tabular-nums]",
        "offset-path": "<ray()>|<url>|<basic-shape>",
        "oklab()": "<legacy-oklab-syntax>|<modern-oklab-syntax>",
        "oklch()": "<legacy-oklch-syntax>|<modern-oklch-syntax>",
        "opacity()": "opacity( [<number>|<percentage>]? )",
        "opacity-value": "<number>|<percentage>",
        "outline-line-style": "none|dotted|dashed|solid|double|groove|ridge|inset|outset",
        "outline-radius": "<length>|<percentage>",
        "overflow-position": "unsafe|safe",
        "page-body": "<declaration>? [; <page-body>]?|<page-margin-box> <page-body>",
        "page-margin-box": "<page-margin-box-type> '{' <declaration-list> '}'",
        "page-margin-box-type": "@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom",
        "page-selector": "<pseudo-page>+|<ident> <pseudo-page>*",
        "page-selector-list": "[<page-selector>#]?",
        "page-size": "A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger",
        "paint": "none|<color>|<url> [none|<color>]?|context-fill|context-stroke",
        "paint()": "paint( <ident> , <declaration-value>? )",
        "paint-box": "<visual-box>|fill-box|stroke-box",
        "palette-identifier": "<dashed-ident>",
        "palette-mix()": "palette-mix( <color-interpolation-method> , [[normal|light|dark|<palette-identifier>|<palette-mix()>]&&<percentage [0,100]>?]#{2} )",
        "path()": "path( <'fill-rule'>? , <string> )",
        "perspective()": "perspective( [<length [0,∞]>|none] )",
        "polar-color-space": "hsl|hwb|lch|oklch",
        "polygon()": "polygon( <'fill-rule'>? , [<length-percentage> <length-percentage>]# )",
        "position": "[[left|center|right]||[top|center|bottom]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]?|[[left|right] <length-percentage>]&&[[top|bottom] <length-percentage>]]",
        "position-area": "[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|center|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|center|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]",
        "pow()": "pow( <calc-sum> , <calc-sum> )",
        "predefined-rgb": "srgb|srgb-linear|display-p3|display-p3-linear|a98-rgb|prophoto-rgb|rec2020",
        "predefined-rgb-params": "<predefined-rgb> [<number>|<percentage>|none]{3}",
        "pseudo-class-selector": "':' <ident-token>|':' <function-token> <any-value> ')'",
        "pseudo-element-selector": "':' <pseudo-class-selector>|<legacy-pseudo-element-selector>",
        "pseudo-page": ": [left|right|first|blank]",
        "query-in-parens": "( <container-condition> )|( <size-feature> )|style( <style-query> )|<general-enclosed>",
        "quote": "open-quote|close-quote|no-open-quote|no-close-quote",
        "radial-extent": "closest-corner|closest-side|farthest-corner|farthest-side",
        "radial-gradient()": "radial-gradient( [<radial-gradient-syntax>] )",
        "radial-gradient-syntax": "[[[<radial-shape>||<radial-size>]? [at <position>]?]||<color-interpolation-method>]? , <color-stop-list>",
        "radial-shape": "circle|ellipse",
        "radial-size": "<radial-extent>|<length [0,∞]>|<length-percentage [0,∞]>{2}",
        "ratio": "<number [0,∞]> [/ <number [0,∞]>]?",
        "ray()": "ray( <angle>&&<ray-size>?&&contain?&&[at <position>]? )",
        "ray-size": "closest-side|closest-corner|farthest-side|farthest-corner|sides",
        "rect()": "rect( [<length-percentage>|auto]{4} [round <'border-radius'>]? )",
        "rectangular-color-space": "srgb|srgb-linear|display-p3|display-p3-linear|a98-rgb|prophoto-rgb|rec2020|lab|oklab|xyz|xyz-d50|xyz-d65",
        "relative-selector": "<combinator>? <complex-selector>",
        "relative-selector-list": "<relative-selector>#",
        "relative-size": "larger|smaller",
        "rem()": "rem( <calc-sum> , <calc-sum> )",
        "repeat-style": "repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}",
        "repeating-conic-gradient()": "repeating-conic-gradient( [<conic-gradient-syntax>] )",
        "repeating-linear-gradient()": "repeating-linear-gradient( [<linear-gradient-syntax>] )",
        "repeating-radial-gradient()": "repeating-radial-gradient( [<radial-gradient-syntax>] )",
        "reversed-counter-name": "reversed( <counter-name> )",
        "rgb()": "<legacy-rgb-syntax>|<modern-rgb-syntax>",
        "rgba()": "<legacy-rgba-syntax>|<modern-rgba-syntax>",
        "rotate()": "rotate( [<angle>|<zero>] )",
        "rotate3d()": "rotate3d( <number> , <number> , <number> , [<angle>|<zero>] )",
        "rotateX()": "rotateX( [<angle>|<zero>] )",
        "rotateY()": "rotateY( [<angle>|<zero>] )",
        "rotateZ()": "rotateZ( [<angle>|<zero>] )",
        "round()": "round( <rounding-strategy>? , <calc-sum> , <calc-sum> )",
        "rounding-strategy": "nearest|up|down|to-zero",
        "saturate()": "saturate( [<number>|<percentage>]? )",
        "scale()": "scale( [<number>|<percentage>]#{1,2} )",
        "scale3d()": "scale3d( [<number>|<percentage>]#{3} )",
        "scaleX()": "scaleX( [<number>|<percentage>] )",
        "scaleY()": "scaleY( [<number>|<percentage>] )",
        "scaleZ()": "scaleZ( [<number>|<percentage>] )",
        "scope-end": "<forgiving-selector-list>",
        "scope-start": "<forgiving-selector-list>",
        "scroll()": "scroll( [<scroller>||<axis>]? )",
        "scroller": "root|nearest|self",
        "scroll-state-feature": "<media-query-list>",
        "scroll-state-in-parens": "( <scroll-state-query> )|( <scroll-state-feature> )|<general-enclosed>",
        "scroll-state-query": "not <scroll-state-in-parens>|<scroll-state-in-parens> [[and <scroll-state-in-parens>]*|[or <scroll-state-in-parens>]*]|<scroll-state-feature>",
        "selector-list": "<complex-selector-list>",
        "self-position": "center|start|end|self-start|self-end|flex-start|flex-end",
        "sepia()": "sepia( [<number>|<percentage>]? )",
        "shadow": "inset?&&<length>{2,4}&&<color>?",
        "shadow-t": "[<length>{2,3}&&<color>?]",
        "shape": "rect( <top> , <right> , <bottom> , <left> )|rect( <top> <right> <bottom> <left> )",
        "shape-box": "<visual-box>|margin-box",
        "side-or-corner": "[left|right]||[top|bottom]",
        "sign()": "sign( <calc-sum> )",
        "signed-integer": "<number-token>",
        "signless-integer": "<number-token>",
        "sin()": "sin( <calc-sum> )",
        "single-animation": "<'animation-duration'>||<easing-function>||<'animation-delay'>||<single-animation-iteration-count>||<single-animation-direction>||<single-animation-fill-mode>||<single-animation-play-state>||[none|<keyframes-name>]||<single-animation-timeline>",
        "single-animation-composition": "replace|add|accumulate",
        "single-animation-direction": "normal|reverse|alternate|alternate-reverse",
        "single-animation-fill-mode": "none|forwards|backwards|both",
        "single-animation-iteration-count": "infinite|<number>",
        "single-animation-play-state": "running|paused",
        "single-animation-timeline": "auto|none|<dashed-ident>|<scroll()>|<view()>",
        "single-transition": "[none|<single-transition-property>]||<time>||<easing-function>||<time>||<transition-behavior-value>",
        "single-transition-property": "all|<custom-ident>",
        "size": "closest-side|farthest-side|closest-corner|farthest-corner|<length>|<length-percentage>{2}",
        "size-feature": "<mf-plain>|<mf-boolean>|<mf-range>",
        "skew()": "skew( [<angle>|<zero>] , [<angle>|<zero>]? )",
        "skewX()": "skewX( [<angle>|<zero>] )",
        "skewY()": "skewY( [<angle>|<zero>] )",
        "sqrt()": "sqrt( <calc-sum> )",
        "step-position": "jump-start|jump-end|jump-none|jump-both|start|end",
        "step-easing-function": "step-start|step-end|<steps()>",
        "steps()": "steps( <integer> , <step-position>? )",
        "style-feature": "<declaration>",
        "style-in-parens": "( <style-condition> )|( <style-feature> )|<general-enclosed>",
        "style-query": "<style-condition>|<style-feature>",
        "subclass-selector": "<id-selector>|<class-selector>|<attribute-selector>|<pseudo-class-selector>",
        "superellipse()": "superellipse( [<number>|infinity|-infinity] )",
        "supports-condition": "not <supports-in-parens>|<supports-in-parens> [and <supports-in-parens>]*|<supports-in-parens> [or <supports-in-parens>]*",
        "supports-decl": "( <declaration> )",
        "supports-feature": "<supports-decl>|<supports-selector-fn>",
        "supports-in-parens": "( <supports-condition> )|<supports-feature>|<general-enclosed>",
        "supports-selector-fn": "selector( <complex-selector> )",
        "symbol": "<string>|<image>|<custom-ident>",
        "symbols()": "symbols( <symbols-type>? [<string>|<image>]+ )",
        "symbols-type": "cyclic|numeric|alphabetic|symbolic|fixed",
        "system-color": "AccentColor|AccentColorText|ActiveText|ButtonBorder|ButtonFace|ButtonText|Canvas|CanvasText|Field|FieldText|GrayText|Highlight|HighlightText|LinkText|Mark|MarkText|SelectedItem|SelectedItemText|VisitedText",
        "system-family-name": "caption|icon|menu|message-box|small-caption|status-bar",
        "tan()": "tan( <calc-sum> )",
        "target": "<target-counter()>|<target-counters()>|<target-text()>",
        "target-counter()": "target-counter( [<string>|<url>] , <custom-ident> , <counter-style>? )",
        "target-counters()": "target-counters( [<string>|<url>] , <custom-ident> , <string> , <counter-style>? )",
        "target-text()": "target-text( [<string>|<url>] , [content|before|after|first-letter]? )",
        "text-edge": "[text|cap|ex|ideographic|ideographic-ink] [text|alphabetic|ideographic|ideographic-ink]?",
        "time-percentage": "<time>|<percentage>",
        "timeline-range-name": "cover|contain|entry|exit|entry-crossing|exit-crossing",
        "track-breadth": "<length-percentage>|<flex>|min-content|max-content|auto",
        "track-list": "[<line-names>? [<track-size>|<track-repeat>]]+ <line-names>?",
        "track-repeat": "repeat( [<integer [1,∞]>] , [<line-names>? <track-size>]+ <line-names>? )",
        "track-size": "<track-breadth>|minmax( <inflexible-breadth> , <track-breadth> )|fit-content( <length-percentage> )",
        "transform-function": "<matrix()>|<translate()>|<translateX()>|<translateY()>|<scale()>|<scaleX()>|<scaleY()>|<rotate()>|<skew()>|<skewX()>|<skewY()>|<matrix3d()>|<translate3d()>|<translateZ()>|<scale3d()>|<scaleZ()>|<rotate3d()>|<rotateX()>|<rotateY()>|<rotateZ()>|<perspective()>",
        "transform-list": "<transform-function>+",
        "transition-behavior-value": "normal|allow-discrete",
        "translate()": "translate( <length-percentage> , <length-percentage>? )",
        "translate3d()": "translate3d( <length-percentage> , <length-percentage> , <length> )",
        "translateX()": "translateX( <length-percentage> )",
        "translateY()": "translateY( <length-percentage> )",
        "translateZ()": "translateZ( <length> )",
        "try-size": "most-width|most-height|most-block-size|most-inline-size",
        "try-tactic": "flip-block||flip-inline||flip-start",
        "type-or-unit": "string|color|url|integer|number|length|angle|time|frequency|cap|ch|em|ex|ic|lh|rlh|rem|vb|vi|vw|vh|vmin|vmax|mm|Q|cm|in|pt|pc|px|deg|grad|rad|turn|ms|s|Hz|kHz|%",
        "type-selector": "<wq-name>|<ns-prefix>? '*'",
        "var()": "var( <custom-property-name> , <declaration-value>? )",
        "view()": "view( [<axis>||<'view-timeline-inset'>]? )",
        "viewport-length": "auto|<length-percentage>",
        "visual-box": "content-box|padding-box|border-box",
        "wq-name": "<ns-prefix>? <ident-token>",
        "xywh()": "xywh( <length-percentage>{2} <length-percentage [0,∞]>{2} [round <'border-radius'>]? )",
        "xyz": "xyz|xyz-d50|xyz-d65",
        "xyz-params": "<xyz-space> [<number>|<percentage>|none]{3}",
        "-legacy-gradient": "<-webkit-gradient()>|<-legacy-linear-gradient>|<-legacy-repeating-linear-gradient>|<-legacy-radial-gradient>|<-legacy-repeating-radial-gradient>",
        "-legacy-linear-gradient": "-moz-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-linear-gradient( <-legacy-linear-gradient-arguments> )",
        "-legacy-repeating-linear-gradient": "-moz-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )",
        "-legacy-linear-gradient-arguments": "[<angle>|<side-or-corner>]? , <color-stop-list>",
        "-legacy-radial-gradient": "-moz-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-radial-gradient( <-legacy-radial-gradient-arguments> )",
        "-legacy-repeating-radial-gradient": "-moz-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )",
        "-legacy-radial-gradient-arguments": "[<position> ,]? [[[<-legacy-radial-gradient-shape>||<-legacy-radial-gradient-size>]|[<length>|<percentage>]{2}] ,]? <color-stop-list>",
        "-legacy-radial-gradient-size": "closest-side|closest-corner|farthest-side|farthest-corner|contain|cover",
        "-legacy-radial-gradient-shape": "circle|ellipse",
        "-non-standard-font": "-apple-system-body|-apple-system-headline|-apple-system-subheadline|-apple-system-caption1|-apple-system-caption2|-apple-system-footnote|-apple-system-short-body|-apple-system-short-headline|-apple-system-short-subheadline|-apple-system-short-caption1|-apple-system-short-footnote|-apple-system-tall-body",
        "-non-standard-color": "-moz-ButtonDefault|-moz-ButtonHoverFace|-moz-ButtonHoverText|-moz-CellHighlight|-moz-CellHighlightText|-moz-Combobox|-moz-ComboboxText|-moz-Dialog|-moz-DialogText|-moz-dragtargetzone|-moz-EvenTreeRow|-moz-Field|-moz-FieldText|-moz-html-CellHighlight|-moz-html-CellHighlightText|-moz-mac-accentdarkestshadow|-moz-mac-accentdarkshadow|-moz-mac-accentface|-moz-mac-accentlightesthighlight|-moz-mac-accentlightshadow|-moz-mac-accentregularhighlight|-moz-mac-accentregularshadow|-moz-mac-chrome-active|-moz-mac-chrome-inactive|-moz-mac-focusring|-moz-mac-menuselect|-moz-mac-menushadow|-moz-mac-menutextselect|-moz-MenuHover|-moz-MenuHoverText|-moz-MenuBarText|-moz-MenuBarHoverText|-moz-nativehyperlinktext|-moz-OddTreeRow|-moz-win-communicationstext|-moz-win-mediatext|-moz-activehyperlinktext|-moz-default-background-color|-moz-default-color|-moz-hyperlinktext|-moz-visitedhyperlinktext|-webkit-activelink|-webkit-focus-ring-color|-webkit-link|-webkit-text",
        "-non-standard-image-rendering": "optimize-contrast|-moz-crisp-edges|-o-crisp-edges|-webkit-optimize-contrast",
        "-non-standard-overflow": "overlay|-moz-scrollbars-none|-moz-scrollbars-horizontal|-moz-scrollbars-vertical|-moz-hidden-unscrollable",
        "-non-standard-size": "intrinsic|min-intrinsic|-webkit-fill-available|-webkit-fit-content|-webkit-min-content|-webkit-max-content|-moz-available|-moz-fit-content|-moz-min-content|-moz-max-content",
        "-webkit-gradient()": "-webkit-gradient( <-webkit-gradient-type> , <-webkit-gradient-point> [, <-webkit-gradient-point>|, <-webkit-gradient-radius> , <-webkit-gradient-point>] [, <-webkit-gradient-radius>]? [, <-webkit-gradient-color-stop>]* )",
        "-webkit-gradient-color-stop": "from( <color> )|color-stop( [<number-zero-one>|<percentage>] , <color> )|to( <color> )",
        "-webkit-gradient-point": "[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]",
        "-webkit-gradient-radius": "<length>|<percentage>",
        "-webkit-gradient-type": "linear|radial",
        "-webkit-mask-box-repeat": "repeat|stretch|round",
        "-ms-filter-function-list": "<-ms-filter-function>+",
        "-ms-filter-function": "<-ms-filter-function-progid>|<-ms-filter-function-legacy>",
        "-ms-filter-function-progid": "'progid:' [<ident-token> '.']* [<ident-token>|<function-token> <any-value>? )]",
        "-ms-filter-function-legacy": "<ident-token>|<function-token> <any-value>? )",
        "age": "child|young|old",
        "attr-name": "<wq-name>",
        "attr-fallback": "<any-value>",
        "autospace": "no-autospace|[ideograph-alpha||ideograph-numeric||punctuation]||[insert|replace]",
        "bottom": "<length>|auto",
        "generic-voice": "[<age>? <gender> <integer>?]",
        "gender": "male|female|neutral",
        "generic-script-specific": "generic( kai )|generic( fangsong )|generic( nastaliq )",
        "-non-standard-generic-family": "-apple-system|BlinkMacSystemFont",
        "intrinsic-size-keyword": "min-content|max-content|fit-content",
        "left": "<length>|auto",
        "device-cmyk()": "<legacy-device-cmyk-syntax>|<modern-device-cmyk-syntax>",
        "legacy-device-cmyk-syntax": "device-cmyk( <number>#{4} )",
        "modern-device-cmyk-syntax": "device-cmyk( <cmyk-component>{4} [/ [<alpha-value>|none]]? )",
        "cmyk-component": "<number>|<percentage>|none",
        "color-space": "<rectangular-color-space>|<polar-color-space>|<custom-color-space>",
        "right": "<length>|auto",
        "forgiving-selector-list": "<complex-real-selector-list>",
        "forgiving-relative-selector-list": "<relative-real-selector-list>",
        "complex-real-selector-list": "<complex-real-selector>#",
        "simple-selector-list": "<simple-selector>#",
        "relative-real-selector-list": "<relative-real-selector>#",
        "complex-selector-unit": "[<compound-selector>? <pseudo-compound-selector>*]!",
        "complex-real-selector": "<compound-selector> [<combinator>? <compound-selector>]*",
        "relative-real-selector": "<combinator>? <complex-real-selector>",
        "pseudo-compound-selector": "<pseudo-element-selector> <pseudo-class-selector>*",
        "simple-selector": "<type-selector>|<subclass-selector>",
        "legacy-pseudo-element-selector": "':' [before|after|first-line|first-letter]",
        "svg-length": "<percentage>|<length>|<number>",
        "svg-writing-mode": "lr-tb|rl-tb|tb-rl|lr|rl|tb",
        "top": "<length>|auto",
        "x": "<number>",
        "y": "<number>",
        "declaration": "<ident-token> : <declaration-value>? ['!' important]?",
        "declaration-list": "[<declaration>? ';']* <declaration>?",
        "url": "url( <string> <url-modifier>* )|<url-token>",
        "url-modifier": "<ident>|<function-token> <any-value> )",
        "number-zero-one": "<number [0,1]>",
        "number-one-or-greater": "<number [1,∞]>",
        "rgb-component": "r|g|b|alpha",
        "legacy-rgb-syntax": "rgb( <percentage>#{3} , <alpha-value>? )|rgb( <number>#{3} , <alpha-value>? )|rgb( [<number>|<percentage>|none]{3} [/ [<alpha-value>|none]]? )",
        "modern-rgb-syntax": "rgb( from <color> [<number>|<percentage>|<rgb-component>]{3} [/ [<alpha-value>|<rgb-component>]]? )",
        "legacy-rgba-syntax": "rgba( <percentage>#{3} , <alpha-value>? )|rgba( <number>#{3} , <alpha-value>? )|rgba( [<number>|<percentage>|none]{3} [/ [<alpha-value>|none]]? )",
        "modern-rgba-syntax": "rgba( from <color> [<number>|<percentage>|<rgb-component>]{3} [/ [<alpha-value>|<rgb-component>]]? )",
        "hsl-component": "h|s|l|alpha",
        "legacy-hsl-syntax": "hsl( <hue> , <percentage> , <percentage> , <alpha-value>? )|hsl( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )",
        "modern-hsl-syntax": "hsl( from <color> [<hue>|<percentage>|<number>|<hsl-component>|none] [<percentage>|<number>|<hsl-component>|none] [<percentage>|<number>|<hsl-component>|none] [/ [<alpha-value>|<hsl-component>|none]]? )",
        "legacy-hsla-syntax": "hsla( <hue> , <percentage> , <percentage> , <alpha-value>? )|hsla( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )",
        "modern-hsla-syntax": "hsla( from <color> [<hue>|<percentage>|<number>|<hsl-component>|none] [<percentage>|<number>|<hsl-component>|none] [<percentage>|<number>|<hsl-component>|none] [/ [<alpha-value>|<hsl-component>|none]]? )",
        "hwb-component": "h|w|b",
        "legacy-hwb-syntax": "hwb( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )",
        "modern-hwb-syntax": "hwb( from <color> [<hue>|<percentage>|<number>|<hwb-component>|none] [<percentage>|<number>|<hwb-component>|none] [<percentage>|<number>|<hwb-component>|none] [/ [<alpha-value>|<hwb-component>|none]]? )",
        "lab-component": "l|a|b|alpha",
        "legacy-lab-syntax": "lab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )",
        "modern-lab-syntax": "lab( from <color> [<number>|<percentage>|<lab-component>]{3} [/ [<alpha-value>|<lab-component>]]? )",
        "legacy-oklab-syntax": "oklab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )",
        "modern-oklab-syntax": "oklab( from <color> [<number>|<percentage>|<lab-component>]{3} [/ [<alpha-value>|<lab-component>]]? )",
        "lch-component": "l|c|h|alpha",
        "legacy-lch-syntax": "lch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )",
        "modern-lch-syntax": "lch( from <color> [<number>|<percentage>|<lch-component>]{3} [/ [<alpha-value>|<lch-component>]]? )",
        "legacy-oklch-syntax": "oklch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )",
        "modern-oklch-syntax": "oklch( from <color> [<number>|<percentage>|<lch-component>]{3} [/ [<alpha-value>|<lch-component>]]? )",
        "alpha()": "alpha( [from <color>] [/ [<alpha-value>|none]]? )",
        "xyz-space": "xyz|xyz-d50|xyz-d65",
        "style-condition": "not <style-in-parens>|<style-in-parens> [[and <style-in-parens>]*|[or <style-in-parens>]*]",
        "-non-standard-display": "-ms-inline-flexbox|-ms-grid|-ms-inline-grid|-webkit-flex|-webkit-inline-flex|-webkit-box|-webkit-inline-box|-moz-inline-stack|-moz-box|-moz-inline-box",
        "inset-area": "[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]",
        "syntax": "'*'|<syntax-component> [<syntax-combinator> <syntax-component>]*|<syntax-string>",
        "syntax-component": "<syntax-single-component> <syntax-multiplier>?|'<' transform-list '>'",
        "syntax-single-component": "'<' <syntax-type-name> '>'|<ident>",
        "syntax-type-name": "angle|color|custom-ident|image|integer|length|length-percentage|number|percentage|resolution|string|time|url|transform-function",
        "syntax-combinator": "'|'",
        "syntax-multiplier": "'#'|'+'",
        "syntax-string": "<string>"
    },
    "properties": {
        "--*": "<declaration-value>",
        "-ms-accelerator": "false|true",
        "-ms-block-progression": "tb|rl|bt|lr",
        "-ms-content-zoom-chaining": "none|chained",
        "-ms-content-zoom-limit": "<'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'>",
        "-ms-content-zoom-limit-max": "<percentage>",
        "-ms-content-zoom-limit-min": "<percentage>",
        "-ms-content-zoom-snap": "<'-ms-content-zoom-snap-type'>||<'-ms-content-zoom-snap-points'>",
        "-ms-content-zoom-snap-points": "snapInterval( <percentage> , <percentage> )|snapList( <percentage># )",
        "-ms-content-zoom-snap-type": "none|proximity|mandatory",
        "-ms-content-zooming": "none|zoom",
        "-ms-filter": "<string>",
        "-ms-flow-from": "[none|<custom-ident>]#",
        "-ms-flow-into": "[none|<custom-ident>]#",
        "-ms-grid-columns": "none|<track-list>|<auto-track-list>",
        "-ms-grid-rows": "none|<track-list>|<auto-track-list>",
        "-ms-high-contrast-adjust": "auto|none",
        "-ms-hyphenate-limit-chars": "auto|<integer>{1,3}",
        "-ms-hyphenate-limit-lines": "no-limit|<integer>",
        "-ms-hyphenate-limit-zone": "<percentage>|<length>",
        "-ms-ime-align": "auto|after",
        "-ms-overflow-style": "auto|none|scrollbar|-ms-autohiding-scrollbar",
        "-ms-scroll-chaining": "chained|none",
        "-ms-scroll-limit": "<'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'>",
        "-ms-scroll-limit-x-max": "auto|<length>",
        "-ms-scroll-limit-x-min": "<length>",
        "-ms-scroll-limit-y-max": "auto|<length>",
        "-ms-scroll-limit-y-min": "<length>",
        "-ms-scroll-rails": "none|railed",
        "-ms-scroll-snap-points-x": "snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )",
        "-ms-scroll-snap-points-y": "snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )",
        "-ms-scroll-snap-type": "none|proximity|mandatory",
        "-ms-scroll-snap-x": "<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-x'>",
        "-ms-scroll-snap-y": "<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-y'>",
        "-ms-scroll-translation": "none|vertical-to-horizontal",
        "-ms-scrollbar-3dlight-color": "<color>",
        "-ms-scrollbar-arrow-color": "<color>",
        "-ms-scrollbar-base-color": "<color>",
        "-ms-scrollbar-darkshadow-color": "<color>",
        "-ms-scrollbar-face-color": "<color>",
        "-ms-scrollbar-highlight-color": "<color>",
        "-ms-scrollbar-shadow-color": "<color>",
        "-ms-scrollbar-track-color": "<color>",
        "-ms-text-autospace": "none|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space",
        "-ms-touch-select": "grippers|none",
        "-ms-user-select": "none|element|text",
        "-ms-wrap-flow": "auto|both|start|end|maximum|clear",
        "-ms-wrap-margin": "<length>",
        "-ms-wrap-through": "wrap|none",
        "-moz-appearance": "none|button|button-arrow-down|button-arrow-next|button-arrow-previous|button-arrow-up|button-bevel|button-focus|caret|checkbox|checkbox-container|checkbox-label|checkmenuitem|dualbutton|groupbox|listbox|listitem|menuarrow|menubar|menucheckbox|menuimage|menuitem|menuitemtext|menulist|menulist-button|menulist-text|menulist-textfield|menupopup|menuradio|menuseparator|meterbar|meterchunk|progressbar|progressbar-vertical|progresschunk|progresschunk-vertical|radio|radio-container|radio-label|radiomenuitem|range|range-thumb|resizer|resizerpanel|scale-horizontal|scalethumbend|scalethumb-horizontal|scalethumbstart|scalethumbtick|scalethumb-vertical|scale-vertical|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|separator|sheet|spinner|spinner-downbutton|spinner-textfield|spinner-upbutton|splitter|statusbar|statusbarpanel|tab|tabpanel|tabpanels|tab-scroll-arrow-back|tab-scroll-arrow-forward|textfield|textfield-multiline|toolbar|toolbarbutton|toolbarbutton-dropdown|toolbargripper|toolbox|tooltip|treeheader|treeheadercell|treeheadersortarrow|treeitem|treeline|treetwisty|treetwistyopen|treeview|-moz-mac-unified-toolbar|-moz-win-borderless-glass|-moz-win-browsertabbar-toolbox|-moz-win-communicationstext|-moz-win-communications-toolbox|-moz-win-exclude-glass|-moz-win-glass|-moz-win-mediatext|-moz-win-media-toolbox|-moz-window-button-box|-moz-window-button-box-maximized|-moz-window-button-close|-moz-window-button-maximize|-moz-window-button-minimize|-moz-window-button-restore|-moz-window-frame-bottom|-moz-window-frame-left|-moz-window-frame-right|-moz-window-titlebar|-moz-window-titlebar-maximized",
        "-moz-binding": "<url>|none",
        "-moz-border-bottom-colors": "<color>+|none",
        "-moz-border-left-colors": "<color>+|none",
        "-moz-border-right-colors": "<color>+|none",
        "-moz-border-top-colors": "<color>+|none",
        "-moz-context-properties": "none|[fill|fill-opacity|stroke|stroke-opacity]#",
        "-moz-float-edge": "border-box|content-box|margin-box|padding-box",
        "-moz-force-broken-image-icon": "0|1",
        "-moz-orient": "inline|block|horizontal|vertical",
        "-moz-outline-radius": "<outline-radius>{1,4} [/ <outline-radius>{1,4}]?",
        "-moz-outline-radius-bottomleft": "<outline-radius>",
        "-moz-outline-radius-bottomright": "<outline-radius>",
        "-moz-outline-radius-topleft": "<outline-radius>",
        "-moz-outline-radius-topright": "<outline-radius>",
        "-moz-stack-sizing": "ignore|stretch-to-fit",
        "-moz-text-blink": "none|blink",
        "-moz-user-focus": "ignore|normal|select-after|select-before|select-menu|select-same|select-all|none",
        "-moz-user-input": "auto|none|enabled|disabled",
        "-moz-user-modify": "read-only|read-write|write-only",
        "-moz-window-dragging": "drag|no-drag",
        "-moz-window-shadow": "default|menu|tooltip|sheet|none",
        "-webkit-appearance": "none|button|button-bevel|caps-lock-indicator|caret|checkbox|default-button|inner-spin-button|listbox|listitem|media-controls-background|media-controls-fullscreen-background|media-current-time-display|media-enter-fullscreen-button|media-exit-fullscreen-button|media-fullscreen-button|media-mute-button|media-overlay-play-button|media-play-button|media-seek-back-button|media-seek-forward-button|media-slider|media-sliderthumb|media-time-remaining-display|media-toggle-closed-captions-button|media-volume-slider|media-volume-slider-container|media-volume-sliderthumb|menulist|menulist-button|menulist-text|menulist-textfield|meter|progress-bar|progress-bar-value|push-button|radio|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbargripper-horizontal|scrollbargripper-vertical|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|searchfield-cancel-button|searchfield-decoration|searchfield-results-button|searchfield-results-decoration|slider-horizontal|slider-vertical|sliderthumb-horizontal|sliderthumb-vertical|square-button|textarea|textfield|-apple-pay-button",
        "-webkit-border-after": "<'border-top'>",
        "-webkit-border-after-color": "<'border-top-color'>",
        "-webkit-border-after-style": "<'border-top-style'>",
        "-webkit-border-after-width": "<'border-top-width'>",
        "-webkit-border-before": "<'border-top'>",
        "-webkit-border-before-color": "<'border-top-color'>",
        "-webkit-border-before-style": "<'border-top-style'>",
        "-webkit-border-before-width": "<'border-top-width'>",
        "-webkit-border-end": "<'border-top'>",
        "-webkit-border-end-color": "<'border-top-color'>",
        "-webkit-border-end-style": "<'border-top-style'>",
        "-webkit-border-end-width": "<'border-top-width'>",
        "-webkit-border-start": "<'border-top'>",
        "-webkit-border-start-color": "<'border-top-color'>",
        "-webkit-border-start-style": "<'border-top-style'>",
        "-webkit-border-start-width": "<'border-top-width'>",
        "-webkit-box-reflect": "[above|below|right|left]? <length>? <image>?",
        "-webkit-line-clamp": "none|<integer>",
        "-webkit-mask": "[<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||[<visual-box>|border|padding|content|text]||[<visual-box>|border|padding|content]]#",
        "-webkit-mask-attachment": "<attachment>#",
        "-webkit-mask-clip": "[<coord-box>|no-clip|border|padding|content|text]#",
        "-webkit-mask-composite": "<composite-style>#",
        "-webkit-mask-image": "<mask-reference>#",
        "-webkit-mask-origin": "[<coord-box>|border|padding|content]#",
        "-webkit-mask-position": "<position>#",
        "-webkit-mask-position-x": "[<length-percentage>|left|center|right]#",
        "-webkit-mask-position-y": "[<length-percentage>|top|center|bottom]#",
        "-webkit-mask-repeat": "<repeat-style>#",
        "-webkit-mask-repeat-x": "repeat|no-repeat|space|round",
        "-webkit-mask-repeat-y": "repeat|no-repeat|space|round",
        "-webkit-mask-size": "<bg-size>#",
        "-webkit-overflow-scrolling": "auto|touch",
        "-webkit-tap-highlight-color": "<color>",
        "-webkit-text-fill-color": "<color>",
        "-webkit-text-stroke": "<length>||<color>",
        "-webkit-text-stroke-color": "<color>",
        "-webkit-text-stroke-width": "<length>",
        "-webkit-touch-callout": "default|none",
        "-webkit-user-modify": "read-only|read-write|read-write-plaintext-only",
        "-webkit-user-select": "auto|none|text|all",
        "accent-color": "auto|<color>",
        "align-content": "normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>",
        "align-items": "normal|stretch|<baseline-position>|[<overflow-position>? <self-position>]|anchor-center",
        "align-self": "auto|normal|stretch|<baseline-position>|<overflow-position>? <self-position>|anchor-center",
        "align-tracks": "[normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>]#",
        "alignment-baseline": "auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical",
        "all": "initial|inherit|unset|revert|revert-layer",
        "anchor-name": "none|<dashed-ident>#",
        "anchor-scope": "none|all|<dashed-ident>#",
        "animation": "<single-animation>#",
        "animation-composition": "<single-animation-composition>#",
        "animation-delay": "<time>#",
        "animation-direction": "<single-animation-direction>#",
        "animation-duration": "[auto|<time [0s,∞]>]#",
        "animation-fill-mode": "<single-animation-fill-mode>#",
        "animation-iteration-count": "<single-animation-iteration-count>#",
        "animation-name": "[none|<keyframes-name>]#",
        "animation-play-state": "<single-animation-play-state>#",
        "animation-range": "[<'animation-range-start'> <'animation-range-end'>?]#",
        "animation-range-end": "[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#",
        "animation-range-start": "[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#",
        "animation-timeline": "<single-animation-timeline>#",
        "animation-timing-function": "<easing-function>#",
        "animation-trigger": "[none|[<dashed-ident> <animation-action>+]+]#",
        "appearance": "none|auto|<compat-auto>|<compat-special>",
        "aspect-ratio": "auto||<ratio>",
        "backdrop-filter": "none|<filter-value-list>",
        "backface-visibility": "visible|hidden",
        "background": "<bg-layer>#? , <final-bg-layer>",
        "background-attachment": "<attachment>#",
        "background-blend-mode": "<blend-mode>#",
        "background-clip": "<bg-clip>#",
        "background-color": "<color>",
        "background-image": "<bg-image>#",
        "background-origin": "<visual-box>#",
        "background-position": "<bg-position>#",
        "background-position-x": "[center|[[left|right|x-start|x-end]? <length-percentage>?]!]#",
        "background-position-y": "[center|[[top|bottom|y-start|y-end]? <length-percentage>?]!]#",
        "background-repeat": "<repeat-style>#",
        "background-size": "<bg-size>#",
        "baseline-shift": "baseline|sub|super|<svg-length>",
        "baseline-source": "auto|first|last",
        "block-size": "<'width'>",
        "border": "<line-width>||<line-style>||<color>",
        "border-block": "<'border-top'>",
        "border-block-color": "<'border-top-color'>{1,2}",
        "border-block-end": "<'border-top'>",
        "border-block-end-color": "<'border-top-color'>",
        "border-block-end-style": "<'border-top-style'>",
        "border-block-end-width": "<'border-top-width'>",
        "border-block-start": "<'border-top'>",
        "border-block-start-color": "<'border-top-color'>",
        "border-block-start-style": "<'border-top-style'>",
        "border-block-start-width": "<'border-top-width'>",
        "border-block-style": "<'border-top-style'>{1,2}",
        "border-block-width": "<'border-top-width'>{1,2}",
        "border-bottom": "<line-width>||<line-style>||<color>",
        "border-bottom-color": "<'border-top-color'>",
        "border-bottom-left-radius": "<length-percentage [0,∞]>{1,2}",
        "border-bottom-right-radius": "<length-percentage [0,∞]>{1,2}",
        "border-bottom-style": "<line-style>",
        "border-bottom-width": "<line-width>",
        "border-collapse": "separate|collapse",
        "border-color": "<color>{1,4}",
        "border-end-end-radius": "<'border-top-left-radius'>",
        "border-end-start-radius": "<'border-top-left-radius'>",
        "border-image": "<'border-image-source'>||<'border-image-slice'> [/ <'border-image-width'>|/ <'border-image-width'>? / <'border-image-outset'>]?||<'border-image-repeat'>",
        "border-image-outset": "[<length [0,∞]>|<number [0,∞]>]{1,4}",
        "border-image-repeat": "[stretch|repeat|round|space]{1,2}",
        "border-image-slice": "[<number [0,∞]>|<percentage [0,∞]>]{1,4}&&fill?",
        "border-image-source": "none|<image>",
        "border-image-width": "[<length-percentage [0,∞]>|<number [0,∞]>|auto]{1,4}",
        "border-inline": "<'border-top'>",
        "border-inline-color": "<'border-top-color'>{1,2}",
        "border-inline-end": "<'border-top'>",
        "border-inline-end-color": "<'border-top-color'>",
        "border-inline-end-style": "<'border-top-style'>",
        "border-inline-end-width": "<'border-top-width'>",
        "border-inline-start": "<'border-top'>",
        "border-inline-start-color": "<'border-top-color'>",
        "border-inline-start-style": "<'border-top-style'>",
        "border-inline-start-width": "<'border-top-width'>",
        "border-inline-style": "<'border-top-style'>{1,2}",
        "border-inline-width": "<'border-top-width'>{1,2}",
        "border-left": "<line-width>||<line-style>||<color>",
        "border-left-color": "<color>",
        "border-left-style": "<line-style>",
        "border-left-width": "<line-width>",
        "border-radius": "<length-percentage [0,∞]>{1,4} [/ <length-percentage [0,∞]>{1,4}]?",
        "border-right": "<line-width>||<line-style>||<color>",
        "border-right-color": "<color>",
        "border-right-style": "<line-style>",
        "border-right-width": "<line-width>",
        "border-shape": "none|[<basic-shape> <geometry-box>?]{1,2}",
        "border-spacing": "<length>{1,2}",
        "border-start-end-radius": "<'border-top-left-radius'>",
        "border-start-start-radius": "<'border-top-left-radius'>",
        "border-style": "<line-style>{1,4}",
        "border-top": "<line-width>||<line-style>||<color>",
        "border-top-color": "<color>",
        "border-top-left-radius": "<length-percentage [0,∞]>{1,2}",
        "border-top-right-radius": "<length-percentage [0,∞]>{1,2}",
        "border-top-style": "<line-style>",
        "border-top-width": "<line-width>",
        "border-width": "<line-width>{1,4}",
        "bottom": "auto|<length-percentage>|<anchor()>|<anchor-size()>",
        "box-align": "start|center|end|baseline|stretch",
        "box-decoration-break": "slice|clone",
        "box-direction": "normal|reverse|inherit",
        "box-flex": "<number>",
        "box-flex-group": "<integer>",
        "box-lines": "single|multiple",
        "box-ordinal-group": "<integer>",
        "box-orient": "horizontal|vertical|inline-axis|block-axis|inherit",
        "box-pack": "start|center|end|justify",
        "box-shadow": "none|<shadow>#",
        "box-sizing": "content-box|border-box",
        "break-after": "auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region",
        "break-before": "auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region",
        "break-inside": "auto|avoid|avoid-page|avoid-column|avoid-region",
        "caption-side": "top|bottom",
        "caret": "<'caret-color'>||<'caret-animation'>||<'caret-shape'>",
        "caret-animation": "auto|manual",
        "caret-color": "auto|<color>",
        "caret-shape": "auto|bar|block|underscore",
        "clear": "none|left|right|both|inline-start|inline-end",
        "clip": "<shape>|auto",
        "clip-path": "<clip-source>|[<basic-shape>||<geometry-box>]|none",
        "clip-rule": "nonzero|evenodd",
        "color": "<color>",
        "color-interpolation-filters": "auto|sRGB|linearRGB",
        "color-scheme": "normal|[light|dark|<custom-ident>]+&&only?",
        "column-count": "<integer>|auto",
        "column-fill": "auto|balance",
        "column-gap": "normal|<length-percentage>",
        "column-height": "auto|<length [0,∞]>",
        "column-rule": "<'column-rule-width'>||<'column-rule-style'>||<'column-rule-color'>",
        "column-rule-color": "<color>",
        "column-rule-style": "<line-style>",
        "column-rule-width": "<line-width>",
        "column-span": "none|all",
        "column-width": "auto|<length [0,∞]>",
        "column-wrap": "auto|nowrap|wrap",
        "columns": "[<'column-width'>||<'column-count'>] [/ <'column-height'>]?",
        "contain": "none|strict|content|[[size||inline-size]||layout||style||paint]",
        "contain-intrinsic-block-size": "auto? [none|<length>]",
        "contain-intrinsic-height": "auto? [none|<length>]",
        "contain-intrinsic-inline-size": "auto? [none|<length>]",
        "contain-intrinsic-size": "[auto? [none|<length>]]{1,2}",
        "contain-intrinsic-width": "auto? [none|<length>]",
        "container": "<'container-name'> [/ <'container-type'>]?",
        "container-name": "none|<custom-ident>+",
        "container-type": "normal||[size|inline-size]",
        "content": "normal|none|[<content-replacement>|<content-list>] [/ [<string>|<counter>|<attr()>]+]?",
        "content-visibility": "visible|auto|hidden",
        "corner-block-end-shape": "<corner-shape-value>{1,2}",
        "corner-block-start-shape": "<corner-shape-value>{1,2}",
        "corner-bottom-shape": "<corner-shape-value>{1,2}",
        "corner-bottom-left-shape": "<corner-shape-value>",
        "corner-bottom-right-shape": "<corner-shape-value>",
        "corner-end-end-shape": "<corner-shape-value>",
        "corner-end-start-shape": "<corner-shape-value>",
        "corner-inline-end-shape": "<corner-shape-value>{1,2}",
        "corner-inline-start-shape": "<corner-shape-value>{1,2}",
        "corner-left-shape": "<corner-shape-value>{1,2}",
        "corner-right-shape": "<corner-shape-value>{1,2}",
        "corner-shape": "<corner-shape-value>{1,4}",
        "corner-start-start-shape": "<corner-shape-value>",
        "corner-start-end-shape": "<corner-shape-value>",
        "corner-top-shape": "<corner-shape-value>{1,2}",
        "corner-top-left-shape": "<corner-shape-value>",
        "corner-top-right-shape": "<corner-shape-value>",
        "counter-incremedsnt": "[<counter-name> <integer>?]+|none",
        "counter-reset": "[<counter-name> <integer>?|<reversed-counter-name> <integer>?]+|none",
        "counter-set": "[<counter-name> <integer>?]+|none",
        "cursor": "[[<url> [<x> <y>]? ,]* [auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing|hand|-webkit-grab|-webkit-grabbing|-webkit-zoom-in|-webkit-zoom-out|-moz-grab|-moz-grabbing|-moz-zoom-in|-moz-zoom-out]]",
        "cx": "<length>|<percentage>",
        "cy": "<length>|<percentage>",
        "d": "none|path( <string> )",
        "direction": "ltr|rtl",
        "display": "[<display-outside>||<display-inside>]|<display-listitem>|<display-internal>|<display-box>|<display-legacy>|<-non-standard-display>",
        "dominant-baseline": "auto|use-script|no-change|reset-size|ideographic|alphabetic|hanging|mathematical|central|middle|text-after-edge|text-before-edge",
        "dynamic-range-limit": "standard|no-limit|constrained|<dynamic-range-limit-mix()>",
        "empty-cells": "show|hide",
        "field-sizing": "content|fixed",
        "fill": "<paint>",
        "fill-opacity": "<number-zero-one>|<percentage>",
        "fill-rule": "nonzero|evenodd",
        "filter": "none|<filter-value-list>|<-ms-filter-function-list>",
        "flex": "none|[<'flex-grow'> <'flex-shrink'>?||<'flex-basis'>]",
        "flex-basis": "content|<'width'>",
        "flex-direction": "row|row-reverse|column|column-reverse",
        "flex-flow": "<'flex-direction'>||<'flex-wrap'>",
        "flex-grow": "<number>",
        "flex-shrink": "<number>",
        "flex-wrap": "nowrap|wrap|wrap-reverse",
        "float": "left|right|none|inline-start|inline-end",
        "flood-color": "<color>",
        "flood-opacity": "<'opacity'>",
        "font": "[[<'font-style'>||<font-variant-css2>||<'font-weight'>||<font-width-css3>]? <'font-size'> [/ <'line-height'>]? <'font-family'>#]|<system-family-name>|<-non-standard-font>",
        "font-family": "[<family-name>|<generic-family>]#",
        "font-feature-settings": "normal|<feature-tag-value>#",
        "font-kerning": "auto|normal|none",
        "font-language-override": "normal|<string>",
        "font-optical-sizing": "auto|none",
        "font-palette": "normal|light|dark|<palette-identifier>|<palette-mix()>",
        "font-size": "<absolute-size>|<relative-size>|<length-percentage [0,∞]>|math",
        "font-size-adjust": "none|[ex-height|cap-height|ch-width|ic-width|ic-height]? [from-font|<number>]",
        "font-smooth": "auto|never|always|<absolute-size>|<length>",
        "font-stretch": "<font-stretch-absolute>",
        "font-style": "normal|italic|oblique <angle>?",
        "font-synthesis": "none|[weight||style||small-caps||position]",
        "font-synthesis-position": "auto|none",
        "font-synthesis-small-caps": "auto|none",
        "font-synthesis-style": "auto|none",
        "font-synthesis-weight": "auto|none",
        "font-variant": "normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]",
        "font-variant-alternates": "normal|[stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )]",
        "font-variant-caps": "normal|small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps",
        "font-variant-east-asian": "normal|[<east-asian-variant-values>||<east-asian-width-values>||ruby]",
        "font-variant-emoji": "normal|text|emoji|unicode",
        "font-variant-ligatures": "normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>]",
        "font-variant-numeric": "normal|[<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero]",
        "font-variant-position": "normal|sub|super",
        "font-variation-settings": "normal|[<string> <number>]#",
        "font-weight": "<font-weight-absolute>|bolder|lighter",
        "font-width": "normal|<percentage [0,∞]>|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",
        "forced-color-adjust": "auto|none|preserve-parent-color",
        "frame-sizing": "auto|content-width|content-height|content-block-size|content-inline-size",
        "gap": "<'row-gap'> <'column-gap'>?",
        "grid": "<'grid-template'>|<'grid-template-rows'> / [auto-flow&&dense?] <'grid-auto-columns'>?|[auto-flow&&dense?] <'grid-auto-rows'>? / <'grid-template-columns'>",
        "grid-area": "<grid-line> [/ <grid-line>]{0,3}",
        "grid-auto-columns": "<track-size>+",
        "grid-auto-flow": "[row|column]||dense",
        "grid-auto-rows": "<track-size>+",
        "grid-column": "<grid-line> [/ <grid-line>]?",
        "grid-column-end": "<grid-line>",
        "grid-column-gap": "<length-percentage>",
        "grid-column-start": "<grid-line>",
        "grid-gap": "<'grid-row-gap'> <'grid-column-gap'>?",
        "grid-row": "<grid-line> [/ <grid-line>]?",
        "grid-row-end": "<grid-line>",
        "grid-row-gap": "<length-percentage>",
        "grid-row-start": "<grid-line>",
        "grid-template": "none|[<'grid-template-rows'> / <'grid-template-columns'>]|[<line-names>? <string> <track-size>? <line-names>?]+ [/ <explicit-track-list>]?",
        "grid-template-areas": "none|<string>+",
        "grid-template-columns": "none|<track-list>|<auto-track-list>|subgrid <line-name-list>?",
        "grid-template-rows": "none|<track-list>|<auto-track-list>|subgrid <line-name-list>?",
        "hanging-punctuation": "none|[first||[force-end|allow-end]||last]",
        "height": "auto|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>",
        "hyphenate-character": "auto|<string>",
        "hyphenate-limit-chars": "[auto|<integer>]{1,3}",
        "hyphens": "none|manual|auto",
        "image-orientation": "from-image|<angle>|[<angle>? flip]",
        "image-rendering": "auto|crisp-edges|pixelated|smooth|optimizeSpeed|optimizeQuality|<-non-standard-image-rendering>",
        "image-resolution": "[from-image||<resolution>]&&snap?",
        "ime-mode": "auto|normal|active|inactive|disabled",
        "initial-letter": "normal|[<number> <integer>?]",
        "initial-letter-align": "[auto|alphabetic|hanging|ideographic]",
        "inline-size": "<'width'>",
        "inset": "<'top'>{1,4}",
        "inset-block": "<'top'>{1,2}",
        "inset-block-end": "<'top'>",
        "inset-block-start": "<'top'>",
        "inset-inline": "<'top'>{1,2}",
        "inset-inline-end": "<'top'>",
        "inset-inline-start": "<'top'>",
        "interpolate-size": "numeric-only|allow-keywords",
        "isolation": "auto|isolate",
        "interactivity": "auto|inert",
        "interest-delay": "<'interest-delay-start'>{1,2}",
        "interest-delay-end": "normal|<time>",
        "interest-delay-start": "normal|<time>",
        "justify-content": "normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]",
        "justify-items": "normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|legacy|legacy&&[left|right|center]|anchor-center",
        "justify-self": "auto|normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|anchor-center",
        "justify-tracks": "[normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]]#",
        "left": "auto|<length-percentage>|<anchor()>|<anchor-size()>",
        "letter-spacing": "normal|<length-percentage>",
        "lighting-color": "<color>",
        "line-break": "auto|loose|normal|strict|anywhere",
        "line-clamp": "none|<integer>",
        "line-height": "normal|<number>|<length>|<percentage>",
        "line-height-step": "<length>",
        "list-style": "<'list-style-type'>||<'list-style-position'>||<'list-style-image'>",
        "list-style-image": "<image>|none",
        "list-style-position": "inside|outside",
        "list-style-type": "<counter-style>|<string>|none",
        "margin": "<'margin-top'>{1,4}",
        "margin-block": "<'margin-top'>{1,2}",
        "margin-block-end": "<'margin-top'>",
        "margin-block-start": "<'margin-top'>",
        "margin-bottom": "<length-percentage>|auto|<anchor-size()>",
        "margin-inline": "<'margin-top'>{1,2}",
        "margin-inline-end": "<'margin-top'>",
        "margin-inline-start": "<'margin-top'>",
        "margin-left": "<length-percentage>|auto|<anchor-size()>",
        "margin-right": "<length-percentage>|auto|<anchor-size()>",
        "margin-top": "<length-percentage>|auto|<anchor-size()>",
        "margin-trim": "none|in-flow|all",
        "marker": "none|<url>",
        "marker-end": "none|<url>",
        "marker-mid": "none|<url>",
        "marker-start": "none|<url>",
        "mask": "<mask-layer>#",
        "mask-border": "<'mask-border-source'>||<'mask-border-slice'> [/ <'mask-border-width'>? [/ <'mask-border-outset'>]?]?||<'mask-border-repeat'>||<'mask-border-mode'>",
        "mask-border-mode": "luminance|alpha",
        "mask-border-outset": "[<length>|<number>]{1,4}",
        "mask-border-repeat": "[stretch|repeat|round|space]{1,2}",
        "mask-border-slice": "<number-percentage>{1,4} fill?",
        "mask-border-source": "none|<image>",
        "mask-border-width": "[<length-percentage>|<number>|auto]{1,4}",
        "mask-clip": "[<coord-box>|no-clip]#",
        "mask-composite": "<compositing-operator>#",
        "mask-image": "<mask-reference>#",
        "mask-mode": "<masking-mode>#",
        "mask-origin": "<coord-box>#",
        "mask-position": "<position>#",
        "mask-repeat": "<repeat-style>#",
        "mask-size": "<bg-size>#",
        "mask-type": "luminance|alpha",
        "masonry-auto-flow": "[pack|next]||[definite-first|ordered]",
        "math-depth": "auto-add|add( <integer> )|<integer>",
        "math-shift": "normal|compact",
        "math-style": "normal|compact",
        "max-block-size": "<'max-width'>",
        "max-height": "none|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>",
        "max-inline-size": "<'max-width'>",
        "max-lines": "none|<integer>",
        "max-width": "none|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>",
        "min-block-size": "<'min-width'>",
        "min-height": "auto|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>",
        "min-inline-size": "<'min-width'>",
        "min-width": "auto|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>",
        "mix-blend-mode": "<blend-mode>|plus-darker|plus-lighter",
        "object-fit": "fill|contain|cover|none|scale-down",
        "object-position": "<position>",
        "object-view-box": "none|<basic-shape-rect>",
        "offset": "[<'offset-position'>? [<'offset-path'> [<'offset-distance'>||<'offset-rotate'>]?]?]! [/ <'offset-anchor'>]?",
        "offset-anchor": "auto|<position>",
        "offset-distance": "<length-percentage>",
        "offset-path": "none|<offset-path>||<coord-box>",
        "offset-position": "normal|auto|<position>",
        "offset-rotate": "[auto|reverse]||<angle>",
        "opacity": "<opacity-value>",
        "order": "<integer>",
        "orphans": "<integer>",
        "outline": "<'outline-width'>||<'outline-style'>||<'outline-color'>",
        "outline-color": "auto|<color>",
        "outline-offset": "<length>",
        "outline-style": "auto|<outline-line-style>",
        "outline-width": "<line-width>",
        "overflow": "[visible|hidden|clip|scroll|auto]{1,2}|<-non-standard-overflow>",
        "overflow-anchor": "auto|none",
        "overflow-block": "visible|hidden|clip|scroll|auto|<-non-standard-overflow>",
        "overflow-clip-box": "padding-box|content-box",
        "overflow-clip-margin": "<visual-box>||<length [0,∞]>",
        "overflow-inline": "visible|hidden|clip|scroll|auto|<-non-standard-overflow>",
        "overflow-wrap": "normal|break-word|anywhere",
        "overflow-x": "visible|hidden|clip|scroll|auto|<-non-standard-overflow>",
        "overflow-y": "visible|hidden|clip|scroll|auto|<-non-standard-overflow>",
        "overlay": "none|auto",
        "overscroll-behavior": "[contain|none|auto]{1,2}",
        "overscroll-behavior-block": "contain|none|auto",
        "overscroll-behavior-inline": "contain|none|auto",
        "overscroll-behavior-x": "contain|none|auto",
        "overscroll-behavior-y": "contain|none|auto",
        "padding": "<'padding-top'>{1,4}",
        "padding-block": "<'padding-top'>{1,2}",
        "padding-block-end": "<'padding-top'>",
        "padding-block-start": "<'padding-top'>",
        "padding-bottom": "<length-percentage [0,∞]>",
        "padding-inline": "<'padding-top'>{1,2}",
        "padding-inline-end": "<'padding-top'>",
        "padding-inline-start": "<'padding-top'>",
        "padding-left": "<length-percentage [0,∞]>",
        "padding-right": "<length-percentage [0,∞]>",
        "padding-top": "<length-percentage [0,∞]>",
        "page": "auto|<custom-ident>",
        "page-break-after": "auto|always|avoid|left|right|recto|verso",
        "page-break-before": "auto|always|avoid|left|right|recto|verso",
        "page-break-inside": "auto|avoid",
        "paint-order": "normal|[fill||stroke||markers]",
        "perspective": "none|<length>",
        "perspective-origin": "<position>",
        "place-content": "<'align-content'> <'justify-content'>?",
        "place-items": "<'align-items'> <'justify-items'>?",
        "place-self": "<'align-self'> <'justify-self'>?",
        "pointer-events": "auto|none|visiblePainted|visibleFill|visibleStroke|visible|painted|fill|stroke|all|inherit",
        "position": "static|relative|absolute|sticky|fixed|-webkit-sticky",
        "position-anchor": "normal|auto|none|<anchor-name>|match-parent",
        "position-area": "none|<position-area>",
        "position-try": "<'position-try-order'>? <'position-try-fallbacks'>",
        "position-try-fallbacks": "none|[[<dashed-ident>||<try-tactic>]|<'position-area'>]#",
        "position-try-order": "normal|<try-size>",
        "position-visibility": "always|[anchors-valid||anchors-visible||no-overflow]",
        "print-color-adjust": "economy|exact",
        "quotes": "none|auto|[<string> <string>]+",
        "r": "<length>|<percentage>",
        "reading-flow": "normal|source-order|flex-visual|flex-flow|grid-rows|grid-columns|grid-order",
        "reading-order": "<integer>",
        "resize": "none|both|horizontal|vertical|block|inline",
        "right": "auto|<length-percentage>|<anchor()>|<anchor-size()>",
        "rotate": "none|<angle>|[x|y|z|<number>{3}]&&<angle>",
        "row-gap": "normal|<length-percentage>",
        "ruby-align": "start|center|space-between|space-around",
        "ruby-merge": "separate|collapse|auto",
        "ruby-overhang": "auto|none",
        "ruby-position": "[alternate||[over|under]]|inter-character",
        "rx": "<length-percentage>|auto",
        "ry": "<length-percentage>|auto",
        "scale": "none|[<number>|<percentage>]{1,3}",
        "scroll-behavior": "auto|smooth",
        "scroll-initial-target": "none|nearest",
        "scroll-margin": "<length>{1,4}",
        "scroll-margin-block": "<length>{1,2}",
        "scroll-margin-block-end": "<length>",
        "scroll-margin-block-start": "<length>",
        "scroll-margin-bottom": "<length>",
        "scroll-margin-inline": "<length>{1,2}",
        "scroll-margin-inline-end": "<length>",
        "scroll-margin-inline-start": "<length>",
        "scroll-margin-left": "<length>",
        "scroll-margin-right": "<length>",
        "scroll-margin-top": "<length>",
        "scroll-marker-group": "none|before|after",
        "scroll-padding": "[auto|<length-percentage>]{1,4}",
        "scroll-padding-block": "[auto|<length-percentage>]{1,2}",
        "scroll-padding-block-end": "auto|<length-percentage>",
        "scroll-padding-block-start": "auto|<length-percentage>",
        "scroll-padding-bottom": "auto|<length-percentage>",
        "scroll-padding-inline": "[auto|<length-percentage>]{1,2}",
        "scroll-padding-inline-end": "auto|<length-percentage>",
        "scroll-padding-inline-start": "auto|<length-percentage>",
        "scroll-padding-left": "auto|<length-percentage>",
        "scroll-padding-right": "auto|<length-percentage>",
        "scroll-padding-top": "auto|<length-percentage>",
        "scroll-snap-align": "[none|start|end|center]{1,2}",
        "scroll-snap-coordinate": "none|<position>#",
        "scroll-snap-destination": "<position>",
        "scroll-snap-points-x": "none|repeat( <length-percentage> )",
        "scroll-snap-points-y": "none|repeat( <length-percentage> )",
        "scroll-snap-stop": "normal|always",
        "scroll-snap-type": "none|[x|y|block|inline|both] [mandatory|proximity]?",
        "scroll-snap-type-x": "none|mandatory|proximity",
        "scroll-snap-type-y": "none|mandatory|proximity",
        "scroll-target-group": "none|auto",
        "scroll-timeline": "[<'scroll-timeline-name'> <'scroll-timeline-axis'>?]#",
        "scroll-timeline-axis": "[block|inline|x|y]#",
        "scroll-timeline-name": "[none|<dashed-ident>]#",
        "scrollbar-color": "auto|<color>{2}",
        "scrollbar-gutter": "auto|stable&&both-edges?",
        "scrollbar-width": "auto|thin|none",
        "shape-image-threshold": "<opacity-value>",
        "shape-margin": "<length-percentage>",
        "shape-outside": "none|[<shape-box>||<basic-shape>]|<image>",
        "shape-rendering": "auto|optimizeSpeed|crispEdges|geometricPrecision",
        "speak-as": "normal|spell-out||digits||[literal-punctuation|no-punctuation]",
        "stop-color": "<'color'>",
        "stop-opacity": "<'opacity'>",
        "stroke": "<paint>",
        "stroke-color": "<color>",
        "stroke-dasharray": "none|[<svg-length>+]#",
        "stroke-dashoffset": "<svg-length>",
        "stroke-linecap": "butt|round|square",
        "stroke-linejoin": "miter|round|bevel",
        "stroke-miterlimit": "<number-one-or-greater>",
        "stroke-opacity": "<'opacity'>",
        "stroke-width": "<svg-length>",
        "tab-size": "<integer>|<length>",
        "table-layout": "auto|fixed",
        "text-align": "start|end|left|right|center|justify|match-parent",
        "text-align-last": "auto|start|end|left|right|center|justify",
        "text-anchor": "start|middle|end",
        "text-autospace": "normal|<autospace>|auto",
        "text-box": "normal|<'text-box-trim'>||<'text-box-edge'>",
        "text-box-edge": "auto|<text-edge>",
        "text-box-trim": "none|trim-start|trim-end|trim-both",
        "text-combine-upright": "none|all|[digits <integer>?]",
        "text-decoration": "<'text-decoration-line'>||<'text-decoration-style'>||<'text-decoration-color'>||<'text-decoration-thickness'>",
        "text-decoration-color": "<color>",
        "text-decoration-inset": "<length>{1,2}|auto",
        "text-decoration-line": "none|[underline||overline||line-through||blink]|spelling-error|grammar-error",
        "text-decoration-skip": "none|[objects||[spaces|[leading-spaces||trailing-spaces]]||edges||box-decoration]",
        "text-decoration-skip-ink": "auto|all|none",
        "text-decoration-style": "solid|double|dotted|dashed|wavy",
        "text-decoration-thickness": "auto|from-font|<length>|<percentage>",
        "text-emphasis": "<'text-emphasis-style'>||<'text-emphasis-color'>",
        "text-emphasis-color": "<color>",
        "text-emphasis-position": "auto|[over|under]&&[right|left]?",
        "text-emphasis-style": "none|[[filled|open]||[dot|circle|double-circle|triangle|sesame]]|<string>",
        "text-indent": "<length-percentage>&&hanging?&&each-line?",
        "text-justify": "auto|inter-character|inter-word|none",
        "text-orientation": "mixed|upright|sideways",
        "text-overflow": "[clip|ellipsis|<string>]{1,2}",
        "text-rendering": "auto|optimizeSpeed|optimizeLegibility|geometricPrecision",
        "text-shadow": "none|<shadow-t>#",
        "text-size-adjust": "none|auto|<percentage>",
        "text-spacing-trim": "space-all|normal|space-first|trim-start",
        "text-transform": "none|[capitalize|uppercase|lowercase]||full-width||full-size-kana|math-auto",
        "text-underline-offset": "auto|<length>|<percentage>",
        "text-underline-position": "auto|from-font|[under||[left|right]]",
        "text-wrap": "<'text-wrap-mode'>||<'text-wrap-style'>",
        "text-wrap-mode": "wrap|nowrap",
        "text-wrap-style": "auto|balance|stable|pretty",
        "timeline-scope": "none|<dashed-ident>#",
        "timeline-trigger": "none|[<'timeline-trigger-name'> <'timeline-trigger-source'> <'timeline-trigger-activation-range'> ['/' <'timeline-trigger-active-range'>]?]#",
        "timeline-trigger-activation-range": "[<'timeline-trigger-activation-range-start'> <'timeline-trigger-activation-range-end'>?]#",
        "timeline-trigger-activation-range-end": "[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#",
        "timeline-trigger-activation-range-start": "[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#",
        "timeline-trigger-active-range": "[<'timeline-trigger-active-range-start'> <'timeline-trigger-active-range-end'>?]#",
        "timeline-trigger-active-range-end": "[auto|normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#",
        "timeline-trigger-active-range-start": "[auto|normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#",
        "timeline-trigger-name": "none|<dashed-ident>#",
        "timeline-trigger-source": "<single-animation-timeline>#",
        "top": "auto|<length-percentage>|<anchor()>|<anchor-size()>",
        "touch-action": "auto|none|[[pan-x|pan-left|pan-right]||[pan-y|pan-up|pan-down]||pinch-zoom]|manipulation",
        "transform": "none|<transform-list>",
        "transform-box": "content-box|border-box|fill-box|stroke-box|view-box",
        "transform-origin": "[<length-percentage>|left|center|right|top|bottom]|[[<length-percentage>|left|center|right]&&[<length-percentage>|top|center|bottom]] <length>?",
        "transform-style": "flat|preserve-3d",
        "transition": "<single-transition>#",
        "transition-behavior": "<transition-behavior-value>#",
        "transition-delay": "<time>#",
        "transition-duration": "<time>#",
        "transition-property": "none|<single-transition-property>#",
        "transition-timing-function": "<easing-function>#",
        "translate": "none|<length-percentage> [<length-percentage> <length>?]?",
        "trigger-scope": "none|all|<dashed-ident>#",
        "unicode-bidi": "normal|embed|isolate|bidi-override|isolate-override|plaintext|-moz-isolate|-moz-isolate-override|-moz-plaintext|-webkit-isolate|-webkit-isolate-override|-webkit-plaintext",
        "user-select": "auto|text|none|all",
        "vector-effect": "none|non-scaling-stroke|non-scaling-size|non-rotation|fixed-position",
        "vertical-align": "baseline|sub|super|text-top|text-bottom|middle|top|bottom|<percentage>|<length>",
        "view-timeline": "[<'view-timeline-name'> [<'view-timeline-axis'>||<'view-timeline-inset'>]?]#",
        "view-timeline-axis": "[block|inline|x|y]#",
        "view-timeline-inset": "[[auto|<length-percentage>]{1,2}]#",
        "view-timeline-name": "[none|<dashed-ident>]#",
        "view-transition-class": "none|<custom-ident>+",
        "view-transition-name": "none|<custom-ident>|match-element",
        "view-transition-scope": "none|all",
        "visibility": "visible|hidden|collapse",
        "white-space": "normal|pre|pre-wrap|pre-line|<'white-space-collapse'>||<'text-wrap-mode'>",
        "white-space-collapse": "collapse|preserve|preserve-breaks|preserve-spaces|break-spaces",
        "widows": "<integer>",
        "width": "auto|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>",
        "will-change": "auto|<animateable-feature>#",
        "word-break": "normal|break-all|keep-all|break-word|auto-phrase",
        "word-spacing": "normal|<length>",
        "word-wrap": "normal|break-word",
        "writing-mode": "horizontal-tb|vertical-rl|vertical-lr|sideways-rl|sideways-lr|<svg-writing-mode>",
        "x": "<length>|<percentage>",
        "y": "<length>|<percentage>",
        "z-index": "auto|<integer>",
        "zoom": "normal|reset|<number [0,∞]>||<percentage [0,∞]>",
        "-moz-background-clip": "padding|border",
        "-moz-border-radius-bottomleft": "<'border-bottom-left-radius'>",
        "-moz-border-radius-bottomright": "<'border-bottom-right-radius'>",
        "-moz-border-radius-topleft": "<'border-top-left-radius'>",
        "-moz-border-radius-topright": "<'border-bottom-right-radius'>",
        "-moz-control-character-visibility": "visible|hidden",
        "-moz-osx-font-smoothing": "auto|grayscale",
        "-moz-user-select": "none|text|all|-moz-none",
        "-ms-flex-align": "start|end|center|baseline|stretch",
        "-ms-flex-item-align": "auto|start|end|center|baseline|stretch",
        "-ms-flex-line-pack": "start|end|center|justify|distribute|stretch",
        "-ms-flex-negative": "<'flex-shrink'>",
        "-ms-flex-pack": "start|end|center|justify|distribute",
        "-ms-flex-order": "<integer>",
        "-ms-flex-positive": "<'flex-grow'>",
        "-ms-flex-preferred-size": "<'flex-basis'>",
        "-ms-interpolation-mode": "nearest-neighbor|bicubic",
        "-ms-grid-column-align": "start|end|center|stretch",
        "-ms-grid-row-align": "start|end|center|stretch",
        "-ms-hyphenate-limit-last": "none|always|column|page|spread",
        "-webkit-background-clip": "[<visual-box>|border|padding|content|text]#",
        "-webkit-column-break-after": "always|auto|avoid",
        "-webkit-column-break-before": "always|auto|avoid",
        "-webkit-column-break-inside": "always|auto|avoid",
        "-webkit-font-smoothing": "auto|none|antialiased|subpixel-antialiased",
        "-webkit-mask-box-image": "[<url>|<gradient>|none] [<length-percentage>{4} <-webkit-mask-box-repeat>{2}]?",
        "-webkit-print-color-adjust": "economy|exact",
        "-webkit-text-security": "none|circle|disc|square",
        "-webkit-user-drag": "none|element|auto",
        "behavior": "<url>+",
        "cue": "<'cue-before'> <'cue-after'>?",
        "cue-after": "<url> <decibel>?|none",
        "cue-before": "<url> <decibel>?|none",
        "glyph-orientation-horizontal": "<angle>",
        "glyph-orientation-vertical": "<angle>",
        "kerning": "auto|<svg-length>",
        "pause": "<'pause-before'> <'pause-after'>?",
        "pause-after": "<time>|none|x-weak|weak|medium|strong|x-strong",
        "pause-before": "<time>|none|x-weak|weak|medium|strong|x-strong",
        "position-try-options": "<'position-try-fallbacks'>",
        "rest": "<'rest-before'> <'rest-after'>?",
        "rest-after": "<time>|none|x-weak|weak|medium|strong|x-strong",
        "rest-before": "<time>|none|x-weak|weak|medium|strong|x-strong",
        "speak": "auto|never|always",
        "voice-balance": "<number>|left|center|right|leftwards|rightwards",
        "voice-duration": "auto|<time>",
        "voice-family": "[[<family-name>|<generic-voice>] ,]* [<family-name>|<generic-voice>]|preserve",
        "voice-pitch": "<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]",
        "voice-range": "<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]",
        "voice-rate": "[normal|x-slow|slow|medium|fast|x-fast]||<percentage>",
        "voice-stress": "normal|strong|moderate|none|reduced",
        "voice-volume": "silent|[[x-soft|soft|medium|loud|x-loud]||<decibel>]",
        "white-space-trim": "none|discard-before||discard-after||discard-inner"
    },
    "atrules": {
        "charset": {
            "prelude": "<string>",
            "descriptors": null
        },
        "counter-style": {
            "prelude": "<counter-style-name>",
            "descriptors": {
                "additive-symbols": "[<integer [0,∞]>&&<symbol>]#",
                "fallback": "<counter-style-name>",
                "negative": "<symbol> <symbol>?",
                "pad": "<integer [0,∞]>&&<symbol>",
                "prefix": "<symbol>",
                "range": "[[<integer>|infinite]{2}]#|auto",
                "speak-as": "auto|bullets|numbers|words|spell-out|<counter-style-name>",
                "suffix": "<symbol>",
                "symbols": "<symbol>+",
                "system": "cyclic|numeric|alphabetic|symbolic|additive|[fixed <integer>?]|[extends <counter-style-name>]"
            }
        },
        "container": {
            "prelude": "[<container-name>]? <container-condition>",
            "descriptors": null
        },
        "document": {
            "prelude": "[<url>|url-prefix( <string> )|domain( <string> )|media-document( <string> )|regexp( <string> )]#",
            "descriptors": null
        },
        "font-face": {
            "prelude": null,
            "descriptors": {
                "ascent-override": "normal|<percentage>",
                "descent-override": "normal|<percentage>",
                "font-display": "auto|block|swap|fallback|optional",
                "font-family": "<family-name>",
                "font-feature-settings": "normal|<feature-tag-value>#",
                "font-stretch": "<font-stretch-absolute>{1,2}",
                "font-style": "normal|italic|oblique <angle>{0,2}",
                "font-variation-settings": "normal|[<string> <number>]#",
                "font-weight": "<font-weight-absolute>{1,2}",
                "line-gap-override": "normal|<percentage>",
                "size-adjust": "<percentage>",
                "src": "[<url> [format( <string># )]?|local( <family-name> )]#",
                "unicode-range": "<urange>#"
            }
        },
        "font-feature-values": {
            "prelude": "<family-name>#",
            "descriptors": null
        },
        "font-palette-values": {
            "prelude": "<dashed-ident>",
            "descriptors": {
                "base-palette": "light|dark|<integer [0,∞]>",
                "font-family": "<family-name>#",
                "override-colors": "[<integer [0,∞]> <color>]#"
            }
        },
        "import": {
            "prelude": "[<string>|<url>] [layer|layer( <layer-name> )]? [supports( [<supports-condition>|<declaration>] )]? <media-query-list>?",
            "descriptors": null
        },
        "keyframes": {
            "prelude": "<keyframes-name>",
            "descriptors": null
        },
        "layer": {
            "prelude": "[<layer-name>#|<layer-name>?]",
            "descriptors": null
        },
        "media": {
            "prelude": "<media-query-list>",
            "descriptors": null
        },
        "namespace": {
            "prelude": "<namespace-prefix>? [<string>|<url>]",
            "descriptors": null
        },
        "page": {
            "prelude": "<page-selector-list>",
            "descriptors": {
                "bleed": "auto|<length>",
                "marks": "none|[crop||cross]",
                "page-orientation": "upright|rotate-left|rotate-right",
                "size": "<length [0,∞]>{1,2}|auto|[<page-size>||[portrait|landscape]]"
            }
        },
        "position-try": {
            "prelude": "<dashed-ident>",
            "descriptors": {
                "top": "<'top'>",
                "left": "<'left'>",
                "bottom": "<'bottom'>",
                "right": "<'right'>",
                "inset-block-start": "<'inset-block-start'>",
                "inset-block-end": "<'inset-block-end'>",
                "inset-inline-start": "<'inset-inline-start'>",
                "inset-inline-end": "<'inset-inline-end'>",
                "inset-block": "<'inset-block'>",
                "inset-inline": "<'inset-inline'>",
                "inset": "<'inset'>",
                "margin-top": "<'margin-top'>",
                "margin-left": "<'margin-left'>",
                "margin-bottom": "<'margin-bottom'>",
                "margin-right": "<'margin-right'>",
                "margin-block-start": "<'margin-block-start'>",
                "margin-block-end": "<'margin-block-end'>",
                "margin-inline-start": "<'margin-inline-start'>",
                "margin-inline-end": "<'margin-inline-end'>",
                "margin": "<'margin'>",
                "margin-block": "<'margin-block'>",
                "margin-inline": "<'margin-inline'>",
                "width": "<'width'>",
                "height": "<'height'>",
                "min-width": "<'min-width'>",
                "min-height": "<'min-height'>",
                "max-width": "<'max-width'>",
                "max-height": "<'max-height'>",
                "block-size": "<'block-size'>",
                "inline-size": "<'inline-size'>",
                "min-block-size": "<'min-block-size'>",
                "min-inline-size": "<'min-inline-size'>",
                "max-block-size": "<'max-block-size'>",
                "max-inline-size": "<'max-inline-size'>",
                "align-self": "<'align-self'>|anchor-center",
                "justify-self": "<'justify-self'>|anchor-center"
            }
        },
        "property": {
            "prelude": "<custom-property-name>",
            "descriptors": {
                "inherits": "true|false",
                "initial-value": "<declaration-value>?",
                "syntax": "<string>"
            }
        },
        "scope": {
            "prelude": "[( <scope-start> )]? [to ( <scope-end> )]?",
            "descriptors": null
        },
        "starting-style": {
            "prelude": null,
            "descriptors": null
        },
        "supports": {
            "prelude": "<supports-condition>",
            "descriptors": null
        },
        "view-transition": {
            "prelude": null,
            "descriptors": {
                "navigation": "auto|none",
                "types": "none|<custom-ident>+"
            }
        },
        "font-features-values": {
            "prelude": "[<string>|<custom-ident>]+",
            "descriptors": {
                "font-display": "auto|block|swap|fallback|optional"
            }
        }
    }
};ٱṟ1x   export default {
    "generic": true,
    "cssWideKeywords": [
        "initial",
        "inherit",
        "unset",
        "revert",
        "revert-layer"
    ],
    "units": {
        "angle": [
            "deg",
            "grad",
            "rad",
            "turn"
        ],
        "decibel": [
            "db"
        ],
        "flex": [
            "fr"
        ],
        "frequency": [
            "hz",
            "khz"
        ],
        "length": [
            "cm",
            "mm",
            "q",
            "in",
            "pt",
            "pc",
            "px",
            "em",
            "rem",
            "ex",
            "rex",
            "cap",
            "rcap",
            "ch",
            "rch",
            "ic",
            "ric",
            "lh",
            "rlh",
            "vw",
            "svw",
            "lvw",
            "dvw",
            "vh",
            "svh",
            "lvh",
            "dvh",
            "vi",
            "svi",
            "lvi",
            "dvi",
            "vb",
            "svb",
            "lvb",
            "dvb",
            "vmin",
            "svmin",
            "lvmin",
            "dvmin",
            "vmax",
            "svmax",
            "lvmax",
            "dvmax",
            "cqw",
            "cqh",
            "cqi",
            "cqb",
            "cqmin",
            "cqmax"
        ],
        "resolution": [
            "dpi",
            "dpcm",
            "dppx",
            "x"
        ],
        "semitones": [
            "st"
        ],
        "time": [
            "s",
            "ms"
        ]
    },
    "types": {
        "abs()": "abs( <calc-sum> )",
        "absolute-size": "xx-small|x-small|small|medium|large|x-large|xx-large|xxx-large",
        "acos()": "acos( <calc-sum> )",
        "alpha-value": "<number>|<percentage>",
        "an+b": "odd|even|<integer>|<n-dimension>|'+'? † n|-n|<ndashdigit-dimension>|'+'? † <ndashdigit-ident>|<dashndashdigit-ident>|<n-dimension> <signed-integer>|'+'? † n <signed-integer>|-n <signed-integer>|<ndash-dimension> <signless-integer>|'+'? † n- <signless-integer>|-n- <signless-integer>|<n-dimension> ['+'|'-'] <signless-integer>|'+'? † n ['+'|'-'] <signless-integer>|-n ['+'|'-'] <signless-integer>",
        "anchor()": "anchor( <anchor-name>?&&<anchor-side> , <length-percentage>? )",
        "anchor-name": "<dashed-ident>",
        "anchor-side": "inside|outside|top|left|right|bottom|start|end|self-start|self-end|<percentage>|center",
        "anchor-size": "width|height|block|inline|self-block|self-inline",
        "anchor-size()": "anchor-size( [<anchor-name>||<anchor-size>]? , <length-percentage>? )",
        "angle-percentage": "<angle>|<percentage>",
        "angular-color-hint": "<angle-percentage>|<zero>",
        "angular-color-stop": "<color> <color-stop-angle>?",
        "angular-color-stop-list": "<angular-color-stop> , [<angular-color-hint>? , <angular-color-stop>]#?",
        "animateable-feature": "scroll-position|contents|<custom-ident>",
        "animation-action": "none|play|play-once|play-forwards|play-backwards|pause|reset|replay",
        "asin()": "asin( <calc-sum> )",
        "atan()": "atan( <calc-sum> )",
        "atan2()": "atan2( <calc-sum> , <calc-sum> )",
        "attachment": "scroll|fixed|local",
        "attr()": "attr( <attr-name> <attr-type>? , <declaration-value>? )",
        "attr-matcher": "['~'|'|'|'^'|'$'|'*']? '='",
        "attr-modifier": "i|s",
        "attr-type": "type( <syntax> )|raw-string|number|<attr-unit>",
        "attribute-selector": "'[' <wq-name> ']'|'[' <wq-name> <attr-matcher> [<string-token>|<ident-token>] <attr-modifier>? ']'",
        "auto-repeat": "repeat( [auto-fill|auto-fit] , [<line-names>? <fixed-size>]+ <line-names>? )",
        "auto-track-list": "[<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>? <auto-repeat> [<line-names>? [<fixed-size>|<fixed-repeat>]]* <line-names>?",
        "axis": "block|inline|x|y",
        "baseline-position": "[first|last]? baseline",
        "basic-shape": "<inset()>|<xywh()>|<rect()>|<circle()>|<ellipse()>|<polygon()>|<path()>|shape( )",
        "basic-shape-rect": "<inset()>|<rect()>|<xywh()>",
        "bg-clip": "<visual-box>|border-area|text",
        "bg-image": "<image>|none",
        "bg-layer": "<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<visual-box>||<visual-box>",
        "bg-position": "[[left|center|right|top|bottom|<length-percentage>]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]|[center|[left|right] <length-percentage>?]&&[center|[top|bottom] <length-percentage>?]]",
        "bg-size": "[<length-percentage [0,∞]>|auto]{1,2}|cover|contain",
        "blend-mode": "normal|multiply|screen|overlay|darken|lighten|color-dodge|color-burn|hard-light|soft-light|difference|exclusion|hue|saturation|color|luminosity",
        "blur()": "blur( <length>? )",
        "brightness()": "brightness( [<number>|<percentage>]? )",
        "calc()": "calc( <calc-sum> )",
        "calc-constant": "e|pi|infinity|-infinity|NaN",
        "calc-product": "<calc-value> ['*' <calc-value>|'/' <number>]*",
        "calc-size()": "calc-size( <calc-size-basis> , <calc-sum> )",
        "calc-size-basis": "<intrinsic-size-keyword>|<calc-size()>|any|<calc-sum>",
        "calc-sum": "<calc-product> [['+'|'-'] <calc-product>]*",
        "calc-value": "<number>|<dimension>|<percentage>|<calc-constant>|( <calc-sum> )",
        "cf-final-image": "<image>|<color>",
        "cf-mixing-image": "<percentage>?&&<image>",
        "circle()": "circle( <radial-size>? [at <position>]? )",
        "clamp()": "clamp( <calc-sum>#{3} )",
        "class-selector": "'.' <ident-token>",
        "clip-source": "<url>",
        "color": "<color-base>|currentColor|<system-color>|<device-cmyk()>|<light-dark()>|<-non-standard-color>",
        "color()": "color( <colorspace-params> [/ [<alpha-value>|none]]? )",
        "color-base": "<hex-color>|<color-function>|<named-color>|<color-mix()>|transparent",
        "color-function": "<rgb()>|<rgba()>|<hsl()>|<hsla()>|<hwb()>|<lab()>|<lch()>|<oklab()>|<oklch()>|<alpha()>|<color()>",
        "color-interpolation-method": "in [<rectangular-color-space>|<polar-color-space> <hue-interpolation-method>?|<custom-color-space>]",
        "color-mix()": "color-mix( <color-interpolation-method> , [<color>&&<percentage [0,100]>?]#{2} )",
        "color-stop": "<color-stop-length>|<color-stop-angle>",
        "color-stop-angle": "[<angle-percentage>|<zero>]{1,2}",
        "color-stop-length": "<length-percentage>{1,2}",
        "color-stop-list": "<linear-color-stop> , [<linear-color-hint>? , <linear-color-stop>]#?",
        "colorspace-params": "[<predefined-rgb-params>|<xyz-params>]",
        "combinator": "'>'|'+'|'~'|['|' '|']",
        "common-lig-values": "[common-ligatures|no-common-ligatures]",
        "compat-auto": "searchfield|textarea|checkbox|radio|menulist|listbox|meter|progress-bar|button",
        "compat-special": "textfield|menulist-button",
        "complex-selector": "<complex-selector-unit> [<combinator>? <complex-selector-unit>]*",
        "complex-selector-list": "<complex-selector>#",
        "composite-style": "clear|copy|source-over|source-in|source-out|source-atop|destination-over|destination-in|destination-out|destination-atop|xor",
        "compositing-operator": "add|subtract|intersect|exclude",
        "compound-selector": "[<type-selector>? <subclass-selector>*]!",
        "compound-selector-list": "<compound-selector>#",
        "conic-gradient()": "conic-gradient( [<conic-gradient-syntax>] )",
        "conic-gradient-syntax": "[[[from [<angle>|<zero>]]? [at <position>]?]||<color-interpolation-method>]? , <angular-color-stop-list>",
        "container-condition": "not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]",
        "container-name": "<custom-ident>",
        "container-query": "not <query-in-parens>|<query-in-parens> [[and <query-in-parens>]*|[or <query-in-parens>]*]",
        "content-distribution": "space-between|space-around|space-evenly|stretch",
        "content-list": "[<string>|contents|<image>|<counter>|<quote>|<target>|<leader()>|<attr()>]+",
        "content-position": "center|start|end|flex-start|flex-end",
        "content-replacement": "<image>",
        "contextual-alt-values": "[contextual|no-contextual]",
        "contrast()": "contrast( [<number>|<percentage>]? )",
        "coord-box": "content-box|padding-box|border-box|fill-box|stroke-box|view-box",
        "corner-shape-value": "round|scoop|bevel|notch|square|squircle|<superellipse()>",
        "cos()": "cos( <calc-sum> )",
        "counter": "<counter()>|<counters()>",
        "counter()": "counter( <counter-name> , <counter-style>? )",
        "counter-name": "<custom-ident>",
        "counter-style": "<counter-style-name>|symbols( )",
        "counter-style-name": "<custom-ident>",
        "counters()": "counters( <counter-name> , <string> , <counter-style>? )",
        "cross-fade()": "cross-fade( <cf-mixing-image> , <cf-final-image>? )",
        "cubic-bezier()": "cubic-bezier( [<number [0,1]> , <number>]#{2} )",
        "cubic-bezier-easing-function": "ease|ease-in|ease-out|ease-in-out|cubic-bezier( <number [0,1]> , <number> , <number [0,1]> , <number> )",
        "cursor-predefined": "auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing",
        "custom-color-space": "<dashed-ident>",
        "custom-params": "<dashed-ident> [<number>|<percentage>|none]+",
        "dasharray": "[[<length-percentage>|<number>]+]#",
        "dashndashdigit-ident": "<ident-token>",
        "deprecated-system-color": "ActiveBorder|ActiveCaption|AppWorkspace|Background|ButtonHighlight|ButtonShadow|CaptionText|InactiveBorder|InactiveCaption|InactiveCaptionText|InfoBackground|InfoText|Menu|MenuText|Scrollbar|ThreeDDarkShadow|ThreeDFace|ThreeDHighlight|ThreeDLightShadow|ThreeDShadow|Window|WindowFrame|WindowText",
        "discretionary-lig-values": "[discretionary-ligatures|no-discretionary-ligatures]",
        "display-box": "contents|none",
        "display-inside": "flow|flow-root|table|flex|grid|ruby",
        "display-internal": "table-row-group|table-header-group|table-footer-group|table-row|table-cell|table-column-group|table-column|table-caption|ruby-base|ruby-text|ruby-base-container|ruby-text-container",
        "display-legacy": "inline-block|inline-list-item|inline-table|inline-flex|inline-grid",
        "display-listitem": "<display-outside>?&&[flow|flow-root]?&&list-item",
        "display-outside": "block|inline|run-in",
        "drop-shadow()": "drop-shadow( [<color>?&&<length>{2,3}] )",
        "dynamic-range-limit-mix()": "dynamic-range-limit-mix( [<'dynamic-range-limit'>&&<percentage [0,100]>]#{2,} )",
        "easing-function": "<linear-easing-function>|<cubic-bezier-easing-function>|<step-easing-function>",
        "east-asian-variant-values": "[jis78|jis83|jis90|jis04|simplified|traditional]",
        "east-asian-width-values": "[full-width|proportional-width]",
        "element()": "element( <custom-ident> , [first|start|last|first-except]? )|element( <id-selector> )",
        "ellipse()": "ellipse( <radial-size>? [at <position>]? )",
        "env()": "env( <custom-ident> , <declaration-value>? )",
        "exp()": "exp( <calc-sum> )",
        "explicit-track-list": "[<line-names>? <track-size>]+ <line-names>?",
        "family-name": "<string>|<custom-ident>+",
        "feature-tag-value": "<string> [<integer>|on|off]?",
        "feature-type": "@stylistic|@historical-forms|@styleset|@character-variant|@swash|@ornaments|@annotation",
        "feature-value-block": "<feature-type> '{' <feature-value-declaration-list> '}'",
        "feature-value-block-list": "<feature-value-block>+",
        "feature-value-declaration": "<custom-ident> : <integer>+ ;",
        "feature-value-declaration-list": "<feature-value-declaration>",
        "feature-value-name": "<custom-ident>",
        "filter-function": "<blur()>|<brightness()>|<contrast()>|<drop-shadow()>|<grayscale()>|<hue-rotate()>|<invert()>|<opacity()>|<saturate()>|<sepia()>",
        "filter-value-list": "[<filter-function>|<url>]+",
        "final-bg-layer": "<bg-image>||<bg-position> [/ <bg-size>]?||<repeat-style>||<attachment>||<visual-box>||<visual-box>||<'background-color'>",
        "fit-content()": "fit-content( <length-percentage [0,∞]> )",
        "fixed-breadth": "<length-percentage>",
        "fixed-repeat": "repeat( [<integer [1,∞]>] , [<line-names>? <fixed-size>]+ <line-names>? )",
        "fixed-size": "<fixed-breadth>|minmax( <fixed-breadth> , <track-breadth> )|minmax( <inflexible-breadth> , <fixed-breadth> )",
        "font-stretch-absolute": "normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded|<percentage>",
        "font-variant-css2": "normal|small-caps",
        "font-weight-absolute": "normal|bold|<number [1,1000]>",
        "font-width-css3": "normal|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",
        "form-control-identifier": "select",
        "frequency-percentage": "<frequency>|<percentage>",
        "generic-complete": "serif|sans-serif|system-ui|cursive|fantasy|math|monospace",
        "general-enclosed": "[<function-token> <any-value>? )]|[( <any-value>? )]",
        "generic-family": "<generic-script-specific>|<generic-complete>|<generic-incomplete>|<-non-standard-generic-family>",
        "generic-incomplete": "ui-serif|ui-sans-serif|ui-monospace|ui-rounded",
        "geometry-box": "<shape-box>|fill-box|stroke-box|view-box",
        "gradient": "<linear-gradient()>|<repeating-linear-gradient()>|<radial-gradient()>|<repeating-radial-gradient()>|<conic-gradient()>|<repeating-conic-gradient()>|<-legacy-gradient>",
        "grayscale()": "grayscale( [<number>|<percentage>]? )",
        "grid-line": "auto|<custom-ident>|[<integer>&&<custom-ident>?]|[span&&[<integer>||<custom-ident>]]",
        "historical-lig-values": "[historical-ligatures|no-historical-ligatures]",
        "hsl()": "<legacy-hsl-syntax>|<modern-hsl-syntax>",
        "hsla()": "<legacy-hsla-syntax>|<modern-hsla-syntax>",
        "hue": "<number>|<angle>",
        "hue-interpolation-method": "[shorter|longer|increasing|decreasing] hue",
        "hue-rotate()": "hue-rotate( [<angle>|<zero>]? )",
        "hwb()": "<legacy-hwb-syntax>|<modern-hwb-syntax>",
        "hypot()": "hypot( <calc-sum># )",
        "image": "<url>|<image()>|<image-set()>|<element()>|<paint()>|<cross-fade()>|<gradient>",
        "image()": "image( <image-tags>? [<image-src>? , <color>?]! )",
        "image-set()": "image-set( <image-set-option># )",
        "image-set-option": "[<image>|<string>] [<resolution>||type( <string> )]",
        "image-src": "<url>|<string>",
        "image-tags": "ltr|rtl",
        "inflexible-breadth": "<length-percentage>|min-content|max-content|auto",
        "inset()": "inset( <length-percentage>{1,4} [round <'border-radius'>]? )",
        "invert()": "invert( [<number>|<percentage>]? )",
        "keyframe-block": "<keyframe-selector># { <declaration-list> }",
        "keyframe-selector": "from|to|<percentage [0,100]>|<timeline-range-name> <percentage>",
        "keyframes-name": "<custom-ident>|<string>",
        "lab()": "<legacy-lab-syntax>|<modern-lab-syntax>",
        "layer()": "layer( <layer-name> )",
        "layer-name": "<ident> ['.' <ident>]*",
        "lch()": "<legacy-lch-syntax>|<modern-lch-syntax>",
        "leader()": "leader( <leader-type> )",
        "leader-type": "dotted|solid|space|<string>",
        "length-percentage": "<length>|<percentage>",
        "light-dark()": "light-dark( <color> , <color> )",
        "line-name-list": "[<line-names>|<name-repeat>]+",
        "line-names": "'[' <custom-ident>* ']'",
        "line-style": "none|hidden|dotted|dashed|solid|double|groove|ridge|inset|outset",
        "line-width": "<length>|thin|medium|thick",
        "linear()": "linear( [<number>&&<percentage>{0,2}]# )",
        "linear-color-hint": "<length-percentage>",
        "linear-color-stop": "<color> <color-stop-length>?",
        "linear-easing-function": "linear|<linear()>",
        "linear-gradient()": "linear-gradient( [<linear-gradient-syntax>] )",
        "linear-gradient-syntax": "[[<angle>|<zero>|to <side-or-corner>]||<color-interpolation-method>]? , <color-stop-list>",
        "log()": "log( <calc-sum> , <calc-sum>? )",
        "mask-layer": "<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||<geometry-box>||[<geometry-box>|no-clip]||<compositing-operator>||<masking-mode>",
        "mask-position": "[<length-percentage>|left|center|right] [<length-percentage>|top|center|bottom]?",
        "mask-reference": "none|<image>|<mask-source>",
        "mask-source": "<url>",
        "masking-mode": "alpha|luminance|match-source",
        "matrix()": "matrix( <number>#{6} )",
        "matrix3d()": "matrix3d( <number>#{16} )",
        "max()": "max( <calc-sum># )",
        "media-and": "<media-in-parens> [and <media-in-parens>]+",
        "media-condition": "<media-not>|<media-and>|<media-or>|<media-in-parens>",
        "media-condition-without-or": "<media-not>|<media-and>|<media-in-parens>",
        "media-feature": "( [<mf-plain>|<mf-boolean>|<mf-range>] )",
        "media-in-parens": "( <media-condition> )|<media-feature>|<general-enclosed>",
        "media-not": "not <media-in-parens>",
        "media-or": "<media-in-parens> [or <media-in-parens>]+",
        "media-query": "<media-condition>|[not|only]? <media-type> [and <media-condition-without-or>]?",
        "media-query-list": "<media-query>#",
        "media-type": "<ident>",
        "mf-boolean": "<mf-name>",
        "mf-name": "<ident>",
        "mf-plain": "<mf-name> : <mf-value>",
        "mf-range": "<mf-name> ['<'|'>']? '='? <mf-value>|<mf-value> ['<'|'>']? '='? <mf-name>|<mf-value> '<' '='? <mf-name> '<' '='? <mf-value>|<mf-value> '>' '='? <mf-name> '>' '='? <mf-value>",
        "mf-value": "<number>|<dimension>|<ident>|<ratio>",
        "min()": "min( <calc-sum># )",
        "minmax()": "minmax( [<length-percentage>|min-content|max-content|auto] , [<length-percentage>|<flex>|min-content|max-content|auto] )",
        "mod()": "mod( <calc-sum> , <calc-sum> )",
        "n-dimension": "<dimension-token>",
        "name-repeat": "repeat( [<integer [1,∞]>|auto-fill] , <line-names>+ )",
        "named-color": "aliceblue|antiquewhite|aqua|aquamarine|azure|beige|bisque|black|blanchedalmond|blue|blueviolet|brown|burlywood|cadetblue|chartreuse|chocolate|coral|cornflowerblue|cornsilk|crimson|cyan|darkblue|darkcyan|darkgoldenrod|darkgray|darkgreen|darkgrey|darkkhaki|darkmagenta|darkolivegreen|darkorange|darkorchid|darkred|darksalmon|darkseagreen|darkslateblue|darkslategray|darkslategrey|darkturquoise|darkviolet|deeppink|deepskyblue|dimgray|dimgrey|dodgerblue|firebrick|floralwhite|forestgreen|fuchsia|gainsboro|ghostwhite|gold|goldenrod|gray|green|greenyellow|grey|honeydew|hotpink|indianred|indigo|ivory|khaki|lavender|lavenderblush|lawngreen|lemonchiffon|lightblue|lightcoral|lightcyan|lightgoldenrodyellow|lightgray|lightgreen|lightgrey|lightpink|lightsalmon|lightseagreen|lightskyblue|lightslategray|lightslategrey|lightsteelblue|lightyellow|lime|limegreen|linen|magenta|maroon|mediumaquamarine|mediumblue|mediumorchid|mediumpurple|mediumseagreen|mediumslateblue|mediumspringgreen|mediumturquoise|mediumvioletred|midnightblue|mintcream|mistyrose|moccasin|navajowhite|navy|oldlace|olive|olivedrab|orange|orangered|orchid|palegoldenrod|palegreen|paleturquoise|palevioletred|papayawhip|peachpuff|peru|pink|plum|powderblue|purple|rebeccapurple|red|rosybrown|royalblue|saddlebrown|salmon|sandybrown|seagreen|seashell|sienna|silver|skyblue|slateblue|slategray|slategrey|snow|springgreen|steelblue|tan|teal|thistle|tomato|turquoise|violet|wheat|white|whitesmoke|yellow|yellowgreen",
        "namespace-prefix": "<ident>",
        "ndash-dimension": "<dimension-token>",
        "ndashdigit-dimension": "<dimension-token>",
        "ndashdigit-ident": "<ident-token>",
        "ns-prefix": "[<ident-token>|'*']? '|'",
        "number-percentage": "<number>|<percentage>",
        "numeric-figure-values": "[lining-nums|oldstyle-nums]",
        "numeric-fraction-values": "[diagonal-fractions|stacked-fractions]",
        "numeric-spacing-values": "[proportional-nums|tabular-nums]",
        "offset-path": "<ray()>|<url>|<basic-shape>",
        "oklab()": "<legacy-oklab-syntax>|<modern-oklab-syntax>",
        "oklch()": "<legacy-oklch-syntax>|<modern-oklch-syntax>",
        "opacity()": "opacity( [<number>|<percentage>]? )",
        "opacity-value": "<number>|<percentage>",
        "outline-line-style": "none|dotted|dashed|solid|double|groove|ridge|inset|outset",
        "outline-radius": "<length>|<percentage>",
        "overflow-position": "unsafe|safe",
        "page-body": "<declaration>? [; <page-body>]?|<page-margin-box> <page-body>",
        "page-margin-box": "<page-margin-box-type> '{' <declaration-list> '}'",
        "page-margin-box-type": "@top-left-corner|@top-left|@top-center|@top-right|@top-right-corner|@bottom-left-corner|@bottom-left|@bottom-center|@bottom-right|@bottom-right-corner|@left-top|@left-middle|@left-bottom|@right-top|@right-middle|@right-bottom",
        "page-selector": "<pseudo-page>+|<ident> <pseudo-page>*",
        "page-selector-list": "[<page-selector>#]?",
        "page-size": "A5|A4|A3|B5|B4|JIS-B5|JIS-B4|letter|legal|ledger",
        "paint": "none|<color>|<url> [none|<color>]?|context-fill|context-stroke",
        "paint()": "paint( <ident> , <declaration-value>? )",
        "paint-box": "<visual-box>|fill-box|stroke-box",
        "palette-identifier": "<dashed-ident>",
        "palette-mix()": "palette-mix( <color-interpolation-method> , [[normal|light|dark|<palette-identifier>|<palette-mix()>]&&<percentage [0,100]>?]#{2} )",
        "path()": "path( <'fill-rule'>? , <string> )",
        "perspective()": "perspective( [<length [0,∞]>|none] )",
        "polar-color-space": "hsl|hwb|lch|oklch",
        "polygon()": "polygon( <'fill-rule'>? , [<length-percentage> <length-percentage>]# )",
        "position": "[[left|center|right]||[top|center|bottom]|[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]?|[[left|right] <length-percentage>]&&[[top|bottom] <length-percentage>]]",
        "position-area": "[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|center|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|center|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]",
        "pow()": "pow( <calc-sum> , <calc-sum> )",
        "predefined-rgb": "srgb|srgb-linear|display-p3|display-p3-linear|a98-rgb|prophoto-rgb|rec2020",
        "predefined-rgb-params": "<predefined-rgb> [<number>|<percentage>|none]{3}",
        "pseudo-class-selector": "':' <ident-token>|':' <function-token> <any-value> ')'",
        "pseudo-element-selector": "':' <pseudo-class-selector>|<legacy-pseudo-element-selector>",
        "pseudo-page": ": [left|right|first|blank]",
        "query-in-parens": "( <container-condition> )|( <size-feature> )|style( <style-query> )|<general-enclosed>",
        "quote": "open-quote|close-quote|no-open-quote|no-close-quote",
        "radial-extent": "closest-corner|closest-side|farthest-corner|farthest-side",
        "radial-gradient()": "radial-gradient( [<radial-gradient-syntax>] )",
        "radial-gradient-syntax": "[[[<radial-shape>||<radial-size>]? [at <position>]?]||<color-interpolation-method>]? , <color-stop-list>",
        "radial-shape": "circle|ellipse",
        "radial-size": "<radial-extent>|<length [0,∞]>|<length-percentage [0,∞]>{2}",
        "ratio": "<number [0,∞]> [/ <number [0,∞]>]?",
        "ray()": "ray( <angle>&&<ray-size>?&&contain?&&[at <position>]? )",
        "ray-size": "closest-side|closest-corner|farthest-side|farthest-corner|sides",
        "rect()": "rect( [<length-percentage>|auto]{4} [round <'border-radius'>]? )",
        "rectangular-color-space": "srgb|srgb-linear|display-p3|display-p3-linear|a98-rgb|prophoto-rgb|rec2020|lab|oklab|xyz|xyz-d50|xyz-d65",
        "relative-selector": "<combinator>? <complex-selector>",
        "relative-selector-list": "<relative-selector>#",
        "relative-size": "larger|smaller",
        "rem()": "rem( <calc-sum> , <calc-sum> )",
        "repeat-style": "repeat-x|repeat-y|[repeat|space|round|no-repeat]{1,2}",
        "repeating-conic-gradient()": "repeating-conic-gradient( [<conic-gradient-syntax>] )",
        "repeating-linear-gradient()": "repeating-linear-gradient( [<linear-gradient-syntax>] )",
        "repeating-radial-gradient()": "repeating-radial-gradient( [<radial-gradient-syntax>] )",
        "reversed-counter-name": "reversed( <counter-name> )",
        "rgb()": "<legacy-rgb-syntax>|<modern-rgb-syntax>",
        "rgba()": "<legacy-rgba-syntax>|<modern-rgba-syntax>",
        "rotate()": "rotate( [<angle>|<zero>] )",
        "rotate3d()": "rotate3d( <number> , <number> , <number> , [<angle>|<zero>] )",
        "rotateX()": "rotateX( [<angle>|<zero>] )",
        "rotateY()": "rotateY( [<angle>|<zero>] )",
        "rotateZ()": "rotateZ( [<angle>|<zero>] )",
        "round()": "round( <rounding-strategy>? , <calc-sum> , <calc-sum> )",
        "rounding-strategy": "nearest|up|down|to-zero",
        "saturate()": "saturate( [<number>|<percentage>]? )",
        "scale()": "scale( [<number>|<percentage>]#{1,2} )",
        "scale3d()": "scale3d( [<number>|<percentage>]#{3} )",
        "scaleX()": "scaleX( [<number>|<percentage>] )",
        "scaleY()": "scaleY( [<number>|<percentage>] )",
        "scaleZ()": "scaleZ( [<number>|<percentage>] )",
        "scope-end": "<forgiving-selector-list>",
        "scope-start": "<forgiving-selector-list>",
        "scroll()": "scroll( [<scroller>||<axis>]? )",
        "scroller": "root|nearest|self",
        "scroll-state-feature": "<media-query-list>",
        "scroll-state-in-parens": "( <scroll-state-query> )|( <scroll-state-feature> )|<general-enclosed>",
        "scroll-state-query": "not <scroll-state-in-parens>|<scroll-state-in-parens> [[and <scroll-state-in-parens>]*|[or <scroll-state-in-parens>]*]|<scroll-state-feature>",
        "selector-list": "<complex-selector-list>",
        "self-position": "center|start|end|self-start|self-end|flex-start|flex-end",
        "sepia()": "sepia( [<number>|<percentage>]? )",
        "shadow": "inset?&&<length>{2,4}&&<color>?",
        "shadow-t": "[<length>{2,3}&&<color>?]",
        "shape": "rect( <top> , <right> , <bottom> , <left> )|rect( <top> <right> <bottom> <left> )",
        "shape-box": "<visual-box>|margin-box",
        "side-or-corner": "[left|right]||[top|bottom]",
        "sign()": "sign( <calc-sum> )",
        "signed-integer": "<number-token>",
        "signless-integer": "<number-token>",
        "sin()": "sin( <calc-sum> )",
        "single-animation": "<'animation-duration'>||<easing-function>||<'animation-delay'>||<single-animation-iteration-count>||<single-animation-direction>||<single-animation-fill-mode>||<single-animation-play-state>||[none|<keyframes-name>]||<single-animation-timeline>",
        "single-animation-composition": "replace|add|accumulate",
        "single-animation-direction": "normal|reverse|alternate|alternate-reverse",
        "single-animation-fill-mode": "none|forwards|backwards|both",
        "single-animation-iteration-count": "infinite|<number>",
        "single-animation-play-state": "running|paused",
        "single-animation-timeline": "auto|none|<dashed-ident>|<scroll()>|<view()>",
        "single-transition": "[none|<single-transition-property>]||<time>||<easing-function>||<time>||<transition-behavior-value>",
        "single-transition-property": "all|<custom-ident>",
        "size": "closest-side|farthest-side|closest-corner|farthest-corner|<length>|<length-percentage>{2}",
        "size-feature": "<mf-plain>|<mf-boolean>|<mf-range>",
        "skew()": "skew( [<angle>|<zero>] , [<angle>|<zero>]? )",
        "skewX()": "skewX( [<angle>|<zero>] )",
        "skewY()": "skewY( [<angle>|<zero>] )",
        "sqrt()": "sqrt( <calc-sum> )",
        "step-position": "jump-start|jump-end|jump-none|jump-both|start|end",
        "step-easing-function": "step-start|step-end|<steps()>",
        "steps()": "steps( <integer> , <step-position>? )",
        "style-feature": "<declaration>",
        "style-in-parens": "( <style-condition> )|( <style-feature> )|<general-enclosed>",
        "style-query": "<style-condition>|<style-feature>",
        "subclass-selector": "<id-selector>|<class-selector>|<attribute-selector>|<pseudo-class-selector>",
        "superellipse()": "superellipse( [<number>|infinity|-infinity] )",
        "supports-condition": "not <supports-in-parens>|<supports-in-parens> [and <supports-in-parens>]*|<supports-in-parens> [or <supports-in-parens>]*",
        "supports-decl": "( <declaration> )",
        "supports-feature": "<supports-decl>|<supports-selector-fn>",
        "supports-in-parens": "( <supports-condition> )|<supports-feature>|<general-enclosed>",
        "supports-selector-fn": "selector( <complex-selector> )",
        "symbol": "<string>|<image>|<custom-ident>",
        "symbols()": "symbols( <symbols-type>? [<string>|<image>]+ )",
        "symbols-type": "cyclic|numeric|alphabetic|symbolic|fixed",
        "system-color": "AccentColor|AccentColorText|ActiveText|ButtonBorder|ButtonFace|ButtonText|Canvas|CanvasText|Field|FieldText|GrayText|Highlight|HighlightText|LinkText|Mark|MarkText|SelectedItem|SelectedItemText|VisitedText",
        "system-family-name": "caption|icon|menu|message-box|small-caption|status-bar",
        "tan()": "tan( <calc-sum> )",
        "target": "<target-counter()>|<target-counters()>|<target-text()>",
        "target-counter()": "target-counter( [<string>|<url>] , <custom-ident> , <counter-style>? )",
        "target-counters()": "target-counters( [<string>|<url>] , <custom-ident> , <string> , <counter-style>? )",
        "target-text()": "target-text( [<string>|<url>] , [content|before|after|first-letter]? )",
        "text-edge": "[text|cap|ex|ideographic|ideographic-ink] [text|alphabetic|ideographic|ideographic-ink]?",
        "time-percentage": "<time>|<percentage>",
        "timeline-range-name": "cover|contain|entry|exit|entry-crossing|exit-crossing",
        "track-breadth": "<length-percentage>|<flex>|min-content|max-content|auto",
        "track-list": "[<line-names>? [<track-size>|<track-repeat>]]+ <line-names>?",
        "track-repeat": "repeat( [<integer [1,∞]>] , [<line-names>? <track-size>]+ <line-names>? )",
        "track-size": "<track-breadth>|minmax( <inflexible-breadth> , <track-breadth> )|fit-content( <length-percentage> )",
        "transform-function": "<matrix()>|<translate()>|<translateX()>|<translateY()>|<scale()>|<scaleX()>|<scaleY()>|<rotate()>|<skew()>|<skewX()>|<skewY()>|<matrix3d()>|<translate3d()>|<translateZ()>|<scale3d()>|<scaleZ()>|<rotate3d()>|<rotateX()>|<rotateY()>|<rotateZ()>|<perspective()>",
        "transform-list": "<transform-function>+",
        "transition-behavior-value": "normal|allow-discrete",
        "translate()": "translate( <length-percentage> , <length-percentage>? )",
        "translate3d()": "translate3d( <length-percentage> , <length-percentage> , <length> )",
        "translateX()": "translateX( <length-percentage> )",
        "translateY()": "translateY( <length-percentage> )",
        "translateZ()": "translateZ( <length> )",
        "try-size": "most-width|most-height|most-block-size|most-inline-size",
        "try-tactic": "flip-block||flip-inline||flip-start",
        "type-or-unit": "string|color|url|integer|number|length|angle|time|frequency|cap|ch|em|ex|ic|lh|rlh|rem|vb|vi|vw|vh|vmin|vmax|mm|Q|cm|in|pt|pc|px|deg|grad|rad|turn|ms|s|Hz|kHz|%",
        "type-selector": "<wq-name>|<ns-prefix>? '*'",
        "var()": "var( <custom-property-name> , <declaration-value>? )",
        "view()": "view( [<axis>||<'view-timeline-inset'>]? )",
        "viewport-length": "auto|<length-percentage>",
        "visual-box": "content-box|padding-box|border-box",
        "wq-name": "<ns-prefix>? <ident-token>",
        "xywh()": "xywh( <length-percentage>{2} <length-percentage [0,∞]>{2} [round <'border-radius'>]? )",
        "xyz": "xyz|xyz-d50|xyz-d65",
        "xyz-params": "<xyz-space> [<number>|<percentage>|none]{3}",
        "-legacy-gradient": "<-webkit-gradient()>|<-legacy-linear-gradient>|<-legacy-repeating-linear-gradient>|<-legacy-radial-gradient>|<-legacy-repeating-radial-gradient>",
        "-legacy-linear-gradient": "-moz-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-linear-gradient( <-legacy-linear-gradient-arguments> )",
        "-legacy-repeating-linear-gradient": "-moz-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-webkit-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )|-o-repeating-linear-gradient( <-legacy-linear-gradient-arguments> )",
        "-legacy-linear-gradient-arguments": "[<angle>|<side-or-corner>]? , <color-stop-list>",
        "-legacy-radial-gradient": "-moz-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-radial-gradient( <-legacy-radial-gradient-arguments> )",
        "-legacy-repeating-radial-gradient": "-moz-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-webkit-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )|-o-repeating-radial-gradient( <-legacy-radial-gradient-arguments> )",
        "-legacy-radial-gradient-arguments": "[<position> ,]? [[[<-legacy-radial-gradient-shape>||<-legacy-radial-gradient-size>]|[<length>|<percentage>]{2}] ,]? <color-stop-list>",
        "-legacy-radial-gradient-size": "closest-side|closest-corner|farthest-side|farthest-corner|contain|cover",
        "-legacy-radial-gradient-shape": "circle|ellipse",
        "-non-standard-font": "-apple-system-body|-apple-system-headline|-apple-system-subheadline|-apple-system-caption1|-apple-system-caption2|-apple-system-footnote|-apple-system-short-body|-apple-system-short-headline|-apple-system-short-subheadline|-apple-system-short-caption1|-apple-system-short-footnote|-apple-system-tall-body",
        "-non-standard-color": "-moz-ButtonDefault|-moz-ButtonHoverFace|-moz-ButtonHoverText|-moz-CellHighlight|-moz-CellHighlightText|-moz-Combobox|-moz-ComboboxText|-moz-Dialog|-moz-DialogText|-moz-dragtargetzone|-moz-EvenTreeRow|-moz-Field|-moz-FieldText|-moz-html-CellHighlight|-moz-html-CellHighlightText|-moz-mac-accentdarkestshadow|-moz-mac-accentdarkshadow|-moz-mac-accentface|-moz-mac-accentlightesthighlight|-moz-mac-accentlightshadow|-moz-mac-accentregularhighlight|-moz-mac-accentregularshadow|-moz-mac-chrome-active|-moz-mac-chrome-inactive|-moz-mac-focusring|-moz-mac-menuselect|-moz-mac-menushadow|-moz-mac-menutextselect|-moz-MenuHover|-moz-MenuHoverText|-moz-MenuBarText|-moz-MenuBarHoverText|-moz-nativehyperlinktext|-moz-OddTreeRow|-moz-win-communicationstext|-moz-win-mediatext|-moz-activehyperlinktext|-moz-default-background-color|-moz-default-color|-moz-hyperlinktext|-moz-visitedhyperlinktext|-webkit-activelink|-webkit-focus-ring-color|-webkit-link|-webkit-text",
        "-non-standard-image-rendering": "optimize-contrast|-moz-crisp-edges|-o-crisp-edges|-webkit-optimize-contrast",
        "-non-standard-overflow": "overlay|-moz-scrollbars-none|-moz-scrollbars-horizontal|-moz-scrollbars-vertical|-moz-hidden-unscrollable",
        "-non-standard-size": "intrinsic|min-intrinsic|-webkit-fill-available|-webkit-fit-content|-webkit-min-content|-webkit-max-content|-moz-available|-moz-fit-content|-moz-min-content|-moz-max-content",
        "-webkit-gradient()": "-webkit-gradient( <-webkit-gradient-type> , <-webkit-gradient-point> [, <-webkit-gradient-point>|, <-webkit-gradient-radius> , <-webkit-gradient-point>] [, <-webkit-gradient-radius>]? [, <-webkit-gradient-color-stop>]* )",
        "-webkit-gradient-color-stop": "from( <color> )|color-stop( [<number-zero-one>|<percentage>] , <color> )|to( <color> )",
        "-webkit-gradient-point": "[left|center|right|<length-percentage>] [top|center|bottom|<length-percentage>]",
        "-webkit-gradient-radius": "<length>|<percentage>",
        "-webkit-gradient-type": "linear|radial",
        "-webkit-mask-box-repeat": "repeat|stretch|round",
        "-ms-filter-function-list": "<-ms-filter-function>+",
        "-ms-filter-function": "<-ms-filter-function-progid>|<-ms-filter-function-legacy>",
        "-ms-filter-function-progid": "'progid:' [<ident-token> '.']* [<ident-token>|<function-token> <any-value>? )]",
        "-ms-filter-function-legacy": "<ident-token>|<function-token> <any-value>? )",
        "age": "child|young|old",
        "attr-name": "<wq-name>",
        "attr-fallback": "<any-value>",
        "autospace": "no-autospace|[ideograph-alpha||ideograph-numeric||punctuation]||[insert|replace]",
        "bottom": "<length>|auto",
        "generic-voice": "[<age>? <gender> <integer>?]",
        "gender": "male|female|neutral",
        "generic-script-specific": "generic( kai )|generic( fangsong )|generic( nastaliq )",
        "-non-standard-generic-family": "-apple-system|BlinkMacSystemFont",
        "intrinsic-size-keyword": "min-content|max-content|fit-content",
        "left": "<length>|auto",
        "device-cmyk()": "<legacy-device-cmyk-syntax>|<modern-device-cmyk-syntax>",
        "legacy-device-cmyk-syntax": "device-cmyk( <number>#{4} )",
        "modern-device-cmyk-syntax": "device-cmyk( <cmyk-component>{4} [/ [<alpha-value>|none]]? )",
        "cmyk-component": "<number>|<percentage>|none",
        "color-space": "<rectangular-color-space>|<polar-color-space>|<custom-color-space>",
        "right": "<length>|auto",
        "forgiving-selector-list": "<complex-real-selector-list>",
        "forgiving-relative-selector-list": "<relative-real-selector-list>",
        "complex-real-selector-list": "<complex-real-selector>#",
        "simple-selector-list": "<simple-selector>#",
        "relative-real-selector-list": "<relative-real-selector>#",
        "complex-selector-unit": "[<compound-selector>? <pseudo-compound-selector>*]!",
        "complex-real-selector": "<compound-selector> [<combinator>? <compound-selector>]*",
        "relative-real-selector": "<combinator>? <complex-real-selector>",
        "pseudo-compound-selector": "<pseudo-element-selector> <pseudo-class-selector>*",
        "simple-selector": "<type-selector>|<subclass-selector>",
        "legacy-pseudo-element-selector": "':' [before|after|first-line|first-letter]",
        "svg-length": "<percentage>|<length>|<number>",
        "svg-writing-mode": "lr-tb|rl-tb|tb-rl|lr|rl|tb",
        "top": "<length>|auto",
        "x": "<number>",
        "y": "<number>",
        "declaration": "<ident-token> : <declaration-value>? ['!' important]?",
        "declaration-list": "[<declaration>? ';']* <declaration>?",
        "url": "url( <string> <url-modifier>* )|<url-token>",
        "url-modifier": "<ident>|<function-token> <any-value> )",
        "number-zero-one": "<number [0,1]>",
        "number-one-or-greater": "<number [1,∞]>",
        "rgb-component": "r|g|b|alpha",
        "legacy-rgb-syntax": "rgb( <percentage>#{3} , <alpha-value>? )|rgb( <number>#{3} , <alpha-value>? )|rgb( [<number>|<percentage>|none]{3} [/ [<alpha-value>|none]]? )",
        "modern-rgb-syntax": "rgb( from <color> [<number>|<percentage>|<rgb-component>]{3} [/ [<alpha-value>|<rgb-component>]]? )",
        "legacy-rgba-syntax": "rgba( <percentage>#{3} , <alpha-value>? )|rgba( <number>#{3} , <alpha-value>? )|rgba( [<number>|<percentage>|none]{3} [/ [<alpha-value>|none]]? )",
        "modern-rgba-syntax": "rgba( from <color> [<number>|<percentage>|<rgb-component>]{3} [/ [<alpha-value>|<rgb-component>]]? )",
        "hsl-component": "h|s|l|alpha",
        "legacy-hsl-syntax": "hsl( <hue> , <percentage> , <percentage> , <alpha-value>? )|hsl( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )",
        "modern-hsl-syntax": "hsl( from <color> [<hue>|<percentage>|<number>|<hsl-component>|none] [<percentage>|<number>|<hsl-component>|none] [<percentage>|<number>|<hsl-component>|none] [/ [<alpha-value>|<hsl-component>|none]]? )",
        "legacy-hsla-syntax": "hsla( <hue> , <percentage> , <percentage> , <alpha-value>? )|hsla( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )",
        "modern-hsla-syntax": "hsla( from <color> [<hue>|<percentage>|<number>|<hsl-component>|none] [<percentage>|<number>|<hsl-component>|none] [<percentage>|<number>|<hsl-component>|none] [/ [<alpha-value>|<hsl-component>|none]]? )",
        "hwb-component": "h|w|b",
        "legacy-hwb-syntax": "hwb( [<hue>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )",
        "modern-hwb-syntax": "hwb( from <color> [<hue>|<percentage>|<number>|<hwb-component>|none] [<percentage>|<number>|<hwb-component>|none] [<percentage>|<number>|<hwb-component>|none] [/ [<alpha-value>|<hwb-component>|none]]? )",
        "lab-component": "l|a|b|alpha",
        "legacy-lab-syntax": "lab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )",
        "modern-lab-syntax": "lab( from <color> [<number>|<percentage>|<lab-component>]{3} [/ [<alpha-value>|<lab-component>]]? )",
        "legacy-oklab-syntax": "oklab( [<percentage>|<number>|none] [<percentage>|<number>|none] [<percentage>|<number>|none] [/ [<alpha-value>|none]]? )",
        "modern-oklab-syntax": "oklab( from <color> [<number>|<percentage>|<lab-component>]{3} [/ [<alpha-value>|<lab-component>]]? )",
        "lch-component": "l|c|h|alpha",
        "legacy-lch-syntax": "lch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )",
        "modern-lch-syntax": "lch( from <color> [<number>|<percentage>|<lch-component>]{3} [/ [<alpha-value>|<lch-component>]]? )",
        "legacy-oklch-syntax": "oklch( [<percentage>|<number>|none] [<percentage>|<number>|none] [<hue>|none] [/ [<alpha-value>|none]]? )",
        "modern-oklch-syntax": "oklch( from <color> [<number>|<percentage>|<lch-component>]{3} [/ [<alpha-value>|<lch-component>]]? )",
        "alpha()": "alpha( [from <color>] [/ [<alpha-value>|none]]? )",
        "xyz-space": "xyz|xyz-d50|xyz-d65",
        "style-condition": "not <style-in-parens>|<style-in-parens> [[and <style-in-parens>]*|[or <style-in-parens>]*]",
        "-non-standard-display": "-ms-inline-flexbox|-ms-grid|-ms-inline-grid|-webkit-flex|-webkit-inline-flex|-webkit-box|-webkit-inline-box|-moz-inline-stack|-moz-box|-moz-inline-box",
        "inset-area": "[[left|center|right|span-left|span-right|x-start|x-end|span-x-start|span-x-end|x-self-start|x-self-end|span-x-self-start|span-x-self-end|span-all]||[top|center|bottom|span-top|span-bottom|y-start|y-end|span-y-start|span-y-end|y-self-start|y-self-end|span-y-self-start|span-y-self-end|span-all]|[block-start|center|block-end|span-block-start|span-block-end|span-all]||[inline-start|center|inline-end|span-inline-start|span-inline-end|span-all]|[self-block-start|self-block-end|span-self-block-start|span-self-block-end|span-all]||[self-inline-start|self-inline-end|span-self-inline-start|span-self-inline-end|span-all]|[start|center|end|span-start|span-end|span-all]{1,2}|[self-start|center|self-end|span-self-start|span-self-end|span-all]{1,2}]",
        "syntax": "'*'|<syntax-component> [<syntax-combinator> <syntax-component>]*|<syntax-string>",
        "syntax-component": "<syntax-single-component> <syntax-multiplier>?|'<' transform-list '>'",
        "syntax-single-component": "'<' <syntax-type-name> '>'|<ident>",
        "syntax-type-name": "angle|color|custom-ident|image|integer|length|length-percentage|number|percentage|resolution|string|time|url|transform-function",
        "syntax-combinator": "'|'",
        "syntax-multiplier": "'#'|'+'",
        "syntax-string": "<string>"
    },
    "properties": {
        "--*": "<declaration-value>",
        "-ms-accelerator": "false|true",
        "-ms-block-progression": "tb|rl|bt|lr",
        "-ms-content-zoom-chaining": "none|chained",
        "-ms-content-zoom-limit": "<'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'>",
        "-ms-content-zoom-limit-max": "<percentage>",
        "-ms-content-zoom-limit-min": "<percentage>",
        "-ms-content-zoom-snap": "<'-ms-content-zoom-snap-type'>||<'-ms-content-zoom-snap-points'>",
        "-ms-content-zoom-snap-points": "snapInterval( <percentage> , <percentage> )|snapList( <percentage># )",
        "-ms-content-zoom-snap-type": "none|proximity|mandatory",
        "-ms-content-zooming": "none|zoom",
        "-ms-filter": "<string>",
        "-ms-flow-from": "[none|<custom-ident>]#",
        "-ms-flow-into": "[none|<custom-ident>]#",
        "-ms-grid-columns": "none|<track-list>|<auto-track-list>",
        "-ms-grid-rows": "none|<track-list>|<auto-track-list>",
        "-ms-high-contrast-adjust": "auto|none",
        "-ms-hyphenate-limit-chars": "auto|<integer>{1,3}",
        "-ms-hyphenate-limit-lines": "no-limit|<integer>",
        "-ms-hyphenate-limit-zone": "<percentage>|<length>",
        "-ms-ime-align": "auto|after",
        "-ms-overflow-style": "auto|none|scrollbar|-ms-autohiding-scrollbar",
        "-ms-scroll-chaining": "chained|none",
        "-ms-scroll-limit": "<'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'>",
        "-ms-scroll-limit-x-max": "auto|<length>",
        "-ms-scroll-limit-x-min": "<length>",
        "-ms-scroll-limit-y-max": "auto|<length>",
        "-ms-scroll-limit-y-min": "<length>",
        "-ms-scroll-rails": "none|railed",
        "-ms-scroll-snap-points-x": "snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )",
        "-ms-scroll-snap-points-y": "snapInterval( <length-percentage> , <length-percentage> )|snapList( <length-percentage># )",
        "-ms-scroll-snap-type": "none|proximity|mandatory",
        "-ms-scroll-snap-x": "<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-x'>",
        "-ms-scroll-snap-y": "<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-y'>",
        "-ms-scroll-translation": "none|vertical-to-horizontal",
        "-ms-scrollbar-3dlight-color": "<color>",
        "-ms-scrollbar-arrow-color": "<color>",
        "-ms-scrollbar-base-color": "<color>",
        "-ms-scrollbar-darkshadow-color": "<color>",
        "-ms-scrollbar-face-color": "<color>",
        "-ms-scrollbar-highlight-color": "<color>",
        "-ms-scrollbar-shadow-color": "<color>",
        "-ms-scrollbar-track-color": "<color>",
        "-ms-text-autospace": "none|ideograph-alpha|ideograph-numeric|ideograph-parenthesis|ideograph-space",
        "-ms-touch-select": "grippers|none",
        "-ms-user-select": "none|element|text",
        "-ms-wrap-flow": "auto|both|start|end|maximum|clear",
        "-ms-wrap-margin": "<length>",
        "-ms-wrap-through": "wrap|none",
        "-moz-appearance": "none|button|button-arrow-down|button-arrow-next|button-arrow-previous|button-arrow-up|button-bevel|button-focus|caret|checkbox|checkbox-container|checkbox-label|checkmenuitem|dualbutton|groupbox|listbox|listitem|menuarrow|menubar|menucheckbox|menuimage|menuitem|menuitemtext|menulist|menulist-button|menulist-text|menulist-textfield|menupopup|menuradio|menuseparator|meterbar|meterchunk|progressbar|progressbar-vertical|progresschunk|progresschunk-vertical|radio|radio-container|radio-label|radiomenuitem|range|range-thumb|resizer|resizerpanel|scale-horizontal|scalethumbend|scalethumb-horizontal|scalethumbstart|scalethumbtick|scalethumb-vertical|scale-vertical|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|separator|sheet|spinner|spinner-downbutton|spinner-textfield|spinner-upbutton|splitter|statusbar|statusbarpanel|tab|tabpanel|tabpanels|tab-scroll-arrow-back|tab-scroll-arrow-forward|textfield|textfield-multiline|toolbar|toolbarbutton|toolbarbutton-dropdown|toolbargripper|toolbox|tooltip|treeheader|treeheadercell|treeheadersortarrow|treeitem|treeline|treetwisty|treetwistyopen|treeview|-moz-mac-unified-toolbar|-moz-win-borderless-glass|-moz-win-browsertabbar-toolbox|-moz-win-communicationstext|-moz-win-communications-toolbox|-moz-win-exclude-glass|-moz-win-glass|-moz-win-mediatext|-moz-win-media-toolbox|-moz-window-button-box|-moz-window-button-box-maximized|-moz-window-button-close|-moz-window-button-maximize|-moz-window-button-minimize|-moz-window-button-restore|-moz-window-frame-bottom|-moz-window-frame-left|-moz-window-frame-right|-moz-window-titlebar|-moz-window-titlebar-maximized",
        "-moz-binding": "<url>|none",
        "-moz-border-bottom-colors": "<color>+|none",
        "-moz-border-left-colors": "<color>+|none",
        "-moz-border-right-colors": "<color>+|none",
        "-moz-border-top-colors": "<color>+|none",
        "-moz-context-properties": "none|[fill|fill-opacity|stroke|stroke-opacity]#",
        "-moz-float-edge": "border-box|content-box|margin-box|padding-box",
        "-moz-force-broken-image-icon": "0|1",
        "-moz-orient": "inline|block|horizontal|vertical",
        "-moz-outline-radius": "<outline-radius>{1,4} [/ <outline-radius>{1,4}]?",
        "-moz-outline-radius-bottomleft": "<outline-radius>",
        "-moz-outline-radius-bottomright": "<outline-radius>",
        "-moz-outline-radius-topleft": "<outline-radius>",
        "-moz-outline-radius-topright": "<outline-radius>",
        "-moz-stack-sizing": "ignore|stretch-to-fit",
        "-moz-text-blink": "none|blink",
        "-moz-user-focus": "ignore|normal|select-after|select-before|select-menu|select-same|select-all|none",
        "-moz-user-input": "auto|none|enabled|disabled",
        "-moz-user-modify": "read-only|read-write|write-only",
        "-moz-window-dragging": "drag|no-drag",
        "-moz-window-shadow": "default|menu|tooltip|sheet|none",
        "-webkit-appearance": "none|button|button-bevel|caps-lock-indicator|caret|checkbox|default-button|inner-spin-button|listbox|listitem|media-controls-background|media-controls-fullscreen-background|media-current-time-display|media-enter-fullscreen-button|media-exit-fullscreen-button|media-fullscreen-button|media-mute-button|media-overlay-play-button|media-play-button|media-seek-back-button|media-seek-forward-button|media-slider|media-sliderthumb|media-time-remaining-display|media-toggle-closed-captions-button|media-volume-slider|media-volume-slider-container|media-volume-sliderthumb|menulist|menulist-button|menulist-text|menulist-textfield|meter|progress-bar|progress-bar-value|push-button|radio|scrollbarbutton-down|scrollbarbutton-left|scrollbarbutton-right|scrollbarbutton-up|scrollbargripper-horizontal|scrollbargripper-vertical|scrollbarthumb-horizontal|scrollbarthumb-vertical|scrollbartrack-horizontal|scrollbartrack-vertical|searchfield|searchfield-cancel-button|searchfield-decoration|searchfield-results-button|searchfield-results-decoration|slider-horizontal|slider-vertical|sliderthumb-horizontal|sliderthumb-vertical|square-button|textarea|textfield|-apple-pay-button",
        "-webkit-border-after": "<'border-top'>",
        "-webkit-border-after-color": "<'border-top-color'>",
        "-webkit-border-after-style": "<'border-top-style'>",
        "-webkit-border-after-width": "<'border-top-width'>",
        "-webkit-border-before": "<'border-top'>",
        "-webkit-border-before-color": "<'border-top-color'>",
        "-webkit-border-before-style": "<'border-top-style'>",
        "-webkit-border-before-width": "<'border-top-width'>",
        "-webkit-border-end": "<'border-top'>",
        "-webkit-border-end-color": "<'border-top-color'>",
        "-webkit-border-end-style": "<'border-top-style'>",
        "-webkit-border-end-width": "<'border-top-width'>",
        "-webkit-border-start": "<'border-top'>",
        "-webkit-border-start-color": "<'border-top-color'>",
        "-webkit-border-start-style": "<'border-top-style'>",
        "-webkit-border-start-width": "<'border-top-width'>",
        "-webkit-box-reflect": "[above|below|right|left]? <length>? <image>?",
        "-webkit-line-clamp": "none|<integer>",
        "-webkit-mask": "[<mask-reference>||<position> [/ <bg-size>]?||<repeat-style>||[<visual-box>|border|padding|content|text]||[<visual-box>|border|padding|content]]#",
        "-webkit-mask-attachment": "<attachment>#",
        "-webkit-mask-clip": "[<coord-box>|no-clip|border|padding|content|text]#",
        "-webkit-mask-composite": "<composite-style>#",
        "-webkit-mask-image": "<mask-reference>#",
        "-webkit-mask-origin": "[<coord-box>|border|padding|content]#",
        "-webkit-mask-position": "<position>#",
        "-webkit-mask-position-x": "[<length-percentage>|left|center|right]#",
        "-webkit-mask-position-y": "[<length-percentage>|top|center|bottom]#",
        "-webkit-mask-repeat": "<repeat-style>#",
        "-webkit-mask-repeat-x": "repeat|no-repeat|space|round",
        "-webkit-mask-repeat-y": "repeat|no-repeat|space|round",
        "-webkit-mask-size": "<bg-size>#",
        "-webkit-overflow-scrolling": "auto|touch",
        "-webkit-tap-highlight-color": "<color>",
        "-webkit-text-fill-color": "<color>",
        "-webkit-text-stroke": "<length>||<color>",
        "-webkit-text-stroke-color": "<color>",
        "-webkit-text-stroke-width": "<length>",
        "-webkit-touch-callout": "default|none",
        "-webkit-user-modify": "read-only|read-write|read-write-plaintext-only",
        "-webkit-user-select": "auto|none|text|all",
        "accent-color": "auto|<color>",
        "align-content": "normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>",
        "align-items": "normal|stretch|<baseline-position>|[<overflow-position>? <self-position>]|anchor-center",
        "align-self": "auto|normal|stretch|<baseline-position>|<overflow-position>? <self-position>|anchor-center",
        "align-tracks": "[normal|<baseline-position>|<content-distribution>|<overflow-position>? <content-position>]#",
        "alignment-baseline": "auto|baseline|before-edge|text-before-edge|middle|central|after-edge|text-after-edge|ideographic|alphabetic|hanging|mathematical",
        "all": "initial|inherit|unset|revert|revert-layer",
        "anchor-name": "none|<dashed-ident>#",
        "anchor-scope": "none|all|<dashed-ident>#",
        "animation": "<single-animation>#",
        "animation-composition": "<single-animation-composition>#",
        "animation-delay": "<time>#",
        "animation-direction": "<single-animation-direction>#",
        "animation-duration": "[auto|<time [0s,∞]>]#",
        "animation-fill-mode": "<single-animation-fill-mode>#",
        "animation-iteration-count": "<single-animation-iteration-count>#",
        "animation-name": "[none|<keyframes-name>]#",
        "animation-play-state": "<single-animation-play-state>#",
        "animation-range": "[<'animation-range-start'> <'animation-range-end'>?]#",
        "animation-range-end": "[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#",
        "animation-range-start": "[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#",
        "animation-timeline": "<single-animation-timeline>#",
        "animation-timing-function": "<easing-function>#",
        "animation-trigger": "[none|[<dashed-ident> <animation-action>+]+]#",
        "appearance": "none|auto|<compat-auto>|<compat-special>",
        "aspect-ratio": "auto||<ratio>",
        "backdrop-filter": "none|<filter-value-list>",
        "backface-visibility": "visible|hidden",
        "background": "<bg-layer>#? , <final-bg-layer>",
        "background-attachment": "<attachment>#",
        "background-blend-mode": "<blend-mode>#",
        "background-clip": "<bg-clip>#",
        "background-color": "<color>",
        "background-image": "<bg-image>#",
        "background-origin": "<visual-box>#",
        "background-position": "<bg-position>#",
        "background-position-x": "[center|[[left|right|x-start|x-end]? <length-percentage>?]!]#",
        "background-position-y": "[center|[[top|bottom|y-start|y-end]? <length-percentage>?]!]#",
        "background-repeat": "<repeat-style>#",
        "background-size": "<bg-size>#",
        "baseline-shift": "baseline|sub|super|<svg-length>",
        "baseline-source": "auto|first|last",
        "block-size": "<'width'>",
        "border": "<line-width>||<line-style>||<color>",
        "border-block": "<'border-top'>",
        "border-block-color": "<'border-top-color'>{1,2}",
        "border-block-end": "<'border-top'>",
        "border-block-end-color": "<'border-top-color'>",
        "border-block-end-style": "<'border-top-style'>",
        "border-block-end-width": "<'border-top-width'>",
        "border-block-start": "<'border-top'>",
        "border-block-start-color": "<'border-top-color'>",
        "border-block-start-style": "<'border-top-style'>",
        "border-block-start-width": "<'border-top-width'>",
        "border-block-style": "<'border-top-style'>{1,2}",
        "border-block-width": "<'border-top-width'>{1,2}",
        "border-bottom": "<line-width>||<line-style>||<color>",
        "border-bottom-color": "<'border-top-color'>",
        "border-bottom-left-radius": "<length-percentage [0,∞]>{1,2}",
        "border-bottom-right-radius": "<length-percentage [0,∞]>{1,2}",
        "border-bottom-style": "<line-style>",
        "border-bottom-width": "<line-width>",
        "border-collapse": "separate|collapse",
        "border-color": "<color>{1,4}",
        "border-end-end-radius": "<'border-top-left-radius'>",
        "border-end-start-radius": "<'border-top-left-radius'>",
        "border-image": "<'border-image-source'>||<'border-image-slice'> [/ <'border-image-width'>|/ <'border-image-width'>? / <'border-image-outset'>]?||<'border-image-repeat'>",
        "border-image-outset": "[<length [0,∞]>|<number [0,∞]>]{1,4}",
        "border-image-repeat": "[stretch|repeat|round|space]{1,2}",
        "border-image-slice": "[<number [0,∞]>|<percentage [0,∞]>]{1,4}&&fill?",
        "border-image-source": "none|<image>",
        "border-image-width": "[<length-percentage [0,∞]>|<number [0,∞]>|auto]{1,4}",
        "border-inline": "<'border-top'>",
        "border-inline-color": "<'border-top-color'>{1,2}",
        "border-inline-end": "<'border-top'>",
        "border-inline-end-color": "<'border-top-color'>",
        "border-inline-end-style": "<'border-top-style'>",
        "border-inline-end-width": "<'border-top-width'>",
        "border-inline-start": "<'border-top'>",
        "border-inline-start-color": "<'border-top-color'>",
        "border-inline-start-style": "<'border-top-style'>",
        "border-inline-start-width": "<'border-top-width'>",
        "border-inline-style": "<'border-top-style'>{1,2}",
        "border-inline-width": "<'border-top-width'>{1,2}",
        "border-left": "<line-width>||<line-style>||<color>",
        "border-left-color": "<color>",
        "border-left-style": "<line-style>",
        "border-left-width": "<line-width>",
        "border-radius": "<length-percentage [0,∞]>{1,4} [/ <length-percentage [0,∞]>{1,4}]?",
        "border-right": "<line-width>||<line-style>||<color>",
        "border-right-color": "<color>",
        "border-right-style": "<line-style>",
        "border-right-width": "<line-width>",
        "border-shape": "none|[<basic-shape> <geometry-box>?]{1,2}",
        "border-spacing": "<length>{1,2}",
        "border-start-end-radius": "<'border-top-left-radius'>",
        "border-start-start-radius": "<'border-top-left-radius'>",
        "border-style": "<line-style>{1,4}",
        "border-top": "<line-width>||<line-style>||<color>",
        "border-top-color": "<color>",
        "border-top-left-radius": "<length-percentage [0,∞]>{1,2}",
        "border-top-right-radius": "<length-percentage [0,∞]>{1,2}",
        "border-top-style": "<line-style>",
        "border-top-width": "<line-width>",
        "border-width": "<line-width>{1,4}",
        "bottom": "auto|<length-percentage>|<anchor()>|<anchor-size()>",
        "box-align": "start|center|end|baseline|stretch",
        "box-decoration-break": "slice|clone",
        "box-direction": "normal|reverse|inherit",
        "box-flex": "<number>",
        "box-flex-group": "<integer>",
        "box-lines": "single|multiple",
        "box-ordinal-group": "<integer>",
        "box-orient": "horizontal|vertical|inline-axis|block-axis|inherit",
        "box-pack": "start|center|end|justify",
        "box-shadow": "none|<shadow>#",
        "box-sizing": "content-box|border-box",
        "break-after": "auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region",
        "break-before": "auto|avoid|always|all|avoid-page|page|left|right|recto|verso|avoid-column|column|avoid-region|region",
        "break-inside": "auto|avoid|avoid-page|avoid-column|avoid-region",
        "caption-side": "top|bottom",
        "caret": "<'caret-color'>||<'caret-animation'>||<'caret-shape'>",
        "caret-animation": "auto|manual",
        "caret-color": "auto|<color>",
        "caret-shape": "auto|bar|block|underscore",
        "clear": "none|left|right|both|inline-start|inline-end",
        "clip": "<shape>|auto",
        "clip-path": "<clip-source>|[<basic-shape>||<geometry-box>]|none",
        "clip-rule": "nonzero|evenodd",
        "color": "<color>",
        "color-interpolation-filters": "auto|sRGB|linearRGB",
        "color-scheme": "normal|[light|dark|<custom-ident>]+&&only?",
        "column-count": "<integer>|auto",
        "column-fill": "auto|balance",
        "column-gap": "normal|<length-percentage>",
        "column-height": "auto|<length [0,∞]>",
        "column-rule": "<'column-rule-width'>||<'column-rule-style'>||<'column-rule-color'>",
        "column-rule-color": "<color>",
        "column-rule-style": "<line-style>",
        "column-rule-width": "<line-width>",
        "column-span": "none|all",
        "column-width": "auto|<length [0,∞]>",
        "column-wrap": "auto|nowrap|wrap",
        "columns": "[<'column-width'>||<'column-count'>] [/ <'column-height'>]?",
        "contain": "none|strict|content|[[size||inline-size]||layout||style||paint]",
        "contain-intrinsic-block-size": "auto? [none|<length>]",
        "contain-intrinsic-height": "auto? [none|<length>]",
        "contain-intrinsic-inline-size": "auto? [none|<length>]",
        "contain-intrinsic-size": "[auto? [none|<length>]]{1,2}",
        "contain-intrinsic-width": "auto? [none|<length>]",
        "container": "<'container-name'> [/ <'container-type'>]?",
        "container-name": "none|<custom-ident>+",
        "container-type": "normal||[size|inline-size]",
        "content": "normal|none|[<content-replacement>|<content-list>] [/ [<string>|<counter>|<attr()>]+]?",
        "content-visibility": "visible|auto|hidden",
        "corner-block-end-shape": "<corner-shape-value>{1,2}",
        "corner-block-start-shape": "<corner-shape-value>{1,2}",
        "corner-bottom-shape": "<corner-shape-value>{1,2}",
        "corner-bottom-left-shape": "<corner-shape-value>",
        "corner-bottom-right-shape": "<corner-shape-value>",
        "corner-end-end-shape": "<corner-shape-value>",
        "corner-end-start-shape": "<corner-shape-value>",
        "corner-inline-end-shape": "<corner-shape-value>{1,2}",
        "corner-inline-start-shape": "<corner-shape-value>{1,2}",
        "corner-left-shape": "<corner-shape-value>{1,2}",
        "corner-right-shape": "<corner-shape-value>{1,2}",
        "corner-shape": "<corner-shape-value>{1,4}",
        "corner-start-start-shape": "<corner-shape-value>",
        "corner-start-end-shape": "<corner-shape-value>",
        "corner-top-shape": "<corner-shape-value>{1,2}",
        "corner-top-left-shape": "<corner-shape-value>",
        "corner-top-right-shape": "<corner-shape-value>",
        "counter-incrementbs": "[<counter-name> <integer>?]+|none",
        "counter-reset": "[<counter-name> <integer>?|<reversed-counter-name> <integer>?]+|none",
        "counter-set": "[<counter-name> <integer>?]+|none",
        "cursor": "[[<url> [<x> <y>]? ,]* [auto|default|none|context-menu|help|pointer|progress|wait|cell|crosshair|text|vertical-text|alias|copy|move|no-drop|not-allowed|e-resize|n-resize|ne-resize|nw-resize|s-resize|se-resize|sw-resize|w-resize|ew-resize|ns-resize|nesw-resize|nwse-resize|col-resize|row-resize|all-scroll|zoom-in|zoom-out|grab|grabbing|hand|-webkit-grab|-webkit-grabbing|-webkit-zoom-in|-webkit-zoom-out|-moz-grab|-moz-grabbing|-moz-zoom-in|-moz-zoom-out]]",
        "cx": "<length>|<percentage>",
        "cy": "<length>|<percentage>",
        "d": "none|path( <string> )",
        "direction": "ltr|rtl",
        "display": "[<display-outside>||<display-inside>]|<display-listitem>|<display-internal>|<display-box>|<display-legacy>|<-non-standard-display>",
        "dominant-baseline": "auto|use-script|no-change|reset-size|ideographic|alphabetic|hanging|mathematical|central|middle|text-after-edge|text-before-edge",
        "dynamic-range-limit": "standard|no-limit|constrained|<dynamic-range-limit-mix()>",
        "empty-cells": "show|hide",
        "field-sizing": "content|fixed",
        "fill": "<paint>",
        "fill-opacity": "<number-zero-one>|<percentage>",
        "fill-rule": "nonzero|evenodd",
        "filter": "none|<filter-value-list>|<-ms-filter-function-list>",
        "flex": "none|[<'flex-grow'> <'flex-shrink'>?||<'flex-basis'>]",
        "flex-basis": "content|<'width'>",
        "flex-direction": "row|row-reverse|column|column-reverse",
        "flex-flow": "<'flex-direction'>||<'flex-wrap'>",
        "flex-grow": "<number>",
        "flex-shrink": "<number>",
        "flex-wrap": "nowrap|wrap|wrap-reverse",
        "float": "left|right|none|inline-start|inline-end",
        "flood-color": "<color>",
        "flood-opacity": "<'opacity'>",
        "font": "[[<'font-style'>||<font-variant-css2>||<'font-weight'>||<font-width-css3>]? <'font-size'> [/ <'line-height'>]? <'font-family'>#]|<system-family-name>|<-non-standard-font>",
        "font-family": "[<family-name>|<generic-family>]#",
        "font-feature-settings": "normal|<feature-tag-value>#",
        "font-kerning": "auto|normal|none",
        "font-language-override": "normal|<string>",
        "font-optical-sizing": "auto|none",
        "font-palette": "normal|light|dark|<palette-identifier>|<palette-mix()>",
        "font-size": "<absolute-size>|<relative-size>|<length-percentage [0,∞]>|math",
        "font-size-adjust": "none|[ex-height|cap-height|ch-width|ic-width|ic-height]? [from-font|<number>]",
        "font-smooth": "auto|never|always|<absolute-size>|<length>",
        "font-stretch": "<font-stretch-absolute>",
        "font-style": "normal|italic|oblique <angle>?",
        "font-synthesis": "none|[weight||style||small-caps||position]",
        "font-synthesis-position": "auto|none",
        "font-synthesis-small-caps": "auto|none",
        "font-synthesis-style": "auto|none",
        "font-synthesis-weight": "auto|none",
        "font-variant": "normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>||stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )||[small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps]||<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero||<east-asian-variant-values>||<east-asian-width-values>||ruby]",
        "font-variant-alternates": "normal|[stylistic( <feature-value-name> )||historical-forms||styleset( <feature-value-name># )||character-variant( <feature-value-name># )||swash( <feature-value-name> )||ornaments( <feature-value-name> )||annotation( <feature-value-name> )]",
        "font-variant-caps": "normal|small-caps|all-small-caps|petite-caps|all-petite-caps|unicase|titling-caps",
        "font-variant-east-asian": "normal|[<east-asian-variant-values>||<east-asian-width-values>||ruby]",
        "font-variant-emoji": "normal|text|emoji|unicode",
        "font-variant-ligatures": "normal|none|[<common-lig-values>||<discretionary-lig-values>||<historical-lig-values>||<contextual-alt-values>]",
        "font-variant-numeric": "normal|[<numeric-figure-values>||<numeric-spacing-values>||<numeric-fraction-values>||ordinal||slashed-zero]",
        "font-variant-position": "normal|sub|super",
        "font-variation-settings": "normal|[<string> <number>]#",
        "font-weight": "<font-weight-absolute>|bolder|lighter",
        "font-width": "normal|<percentage [0,∞]>|ultra-condensed|extra-condensed|condensed|semi-condensed|semi-expanded|expanded|extra-expanded|ultra-expanded",
        "forced-color-adjust": "auto|none|preserve-parent-color",
        "frame-sizing": "auto|content-width|content-height|content-block-size|content-inline-size",
        "gap": "<'row-gap'> <'column-gap'>?",
        "grid": "<'grid-template'>|<'grid-template-rows'> / [auto-flow&&dense?] <'grid-auto-columns'>?|[auto-flow&&dense?] <'grid-auto-rows'>? / <'grid-template-columns'>",
        "grid-area": "<grid-line> [/ <grid-line>]{0,3}",
        "grid-auto-columns": "<track-size>+",
        "grid-auto-flow": "[row|column]||dense",
        "grid-auto-rows": "<track-size>+",
        "grid-column": "<grid-line> [/ <grid-line>]?",
        "grid-column-end": "<grid-line>",
        "grid-column-gap": "<length-percentage>",
        "grid-column-start": "<grid-line>",
        "grid-gap": "<'grid-row-gap'> <'grid-column-gap'>?",
        "grid-row": "<grid-line> [/ <grid-line>]?",
        "grid-row-end": "<grid-line>",
        "grid-row-gap": "<length-percentage>",
        "grid-row-start": "<grid-line>",
        "grid-template": "none|[<'grid-template-rows'> / <'grid-template-columns'>]|[<line-names>? <string> <track-size>? <line-names>?]+ [/ <explicit-track-list>]?",
        "grid-template-areas": "none|<string>+",
        "grid-template-columns": "none|<track-list>|<auto-track-list>|subgrid <line-name-list>?",
        "grid-template-rows": "none|<track-list>|<auto-track-list>|subgrid <line-name-list>?",
        "hanging-punctuation": "none|[first||[force-end|allow-end]||last]",
        "height": "auto|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>",
        "hyphenate-character": "auto|<string>",
        "hyphenate-limit-chars": "[auto|<integer>]{1,3}",
        "hyphens": "none|manual|auto",
        "image-orientation": "from-image|<angle>|[<angle>? flip]",
        "image-rendering": "auto|crisp-edges|pixelated|smooth|optimizeSpeed|optimizeQuality|<-non-standard-image-rendering>",
        "image-resolution": "[from-image||<resolution>]&&snap?",
        "ime-mode": "auto|normal|active|inactive|disabled",
        "initial-letter": "normal|[<number> <integer>?]",
        "initial-letter-align": "[auto|alphabetic|hanging|ideographic]",
        "inline-size": "<'width'>",
        "inset": "<'top'>{1,4}",
        "inset-block": "<'top'>{1,2}",
        "inset-block-end": "<'top'>",
        "inset-block-start": "<'top'>",
        "inset-inline": "<'top'>{1,2}",
        "inset-inline-end": "<'top'>",
        "inset-inline-start": "<'top'>",
        "interpolate-size": "numeric-only|allow-keywords",
        "isolation": "auto|isolate",
        "interactivity": "auto|inert",
        "interest-delay": "<'interest-delay-start'>{1,2}",
        "interest-delay-end": "normal|<time>",
        "interest-delay-start": "normal|<time>",
        "justify-content": "normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]",
        "justify-items": "normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|legacy|legacy&&[left|right|center]|anchor-center",
        "justify-self": "auto|normal|stretch|<baseline-position>|<overflow-position>? [<self-position>|left|right]|anchor-center",
        "justify-tracks": "[normal|<content-distribution>|<overflow-position>? [<content-position>|left|right]]#",
        "left": "auto|<length-percentage>|<anchor()>|<anchor-size()>",
        "letter-spacing": "normal|<length-percentage>",
        "lighting-color": "<color>",
        "line-break": "auto|loose|normal|strict|anywhere",
        "line-clamp": "none|<integer>",
        "line-height": "normal|<number>|<length>|<percentage>",
        "line-height-step": "<length>",
        "list-style": "<'list-style-type'>||<'list-style-position'>||<'list-style-image'>",
        "list-style-image": "<image>|none",
        "list-style-position": "inside|outside",
        "list-style-type": "<counter-style>|<string>|none",
        "margin": "<'margin-top'>{1,4}",
        "margin-block": "<'margin-top'>{1,2}",
        "margin-block-end": "<'margin-top'>",
        "margin-block-start": "<'margin-top'>",
        "margin-bottom": "<length-percentage>|auto|<anchor-size()>",
        "margin-inline": "<'margin-top'>{1,2}",
        "margin-inline-end": "<'margin-top'>",
        "margin-inline-start": "<'margin-top'>",
        "margin-left": "<length-percentage>|auto|<anchor-size()>",
        "margin-right": "<length-percentage>|auto|<anchor-size()>",
        "margin-top": "<length-percentage>|auto|<anchor-size()>",
        "margin-trim": "none|in-flow|all",
        "marker": "none|<url>",
        "marker-end": "none|<url>",
        "marker-mid": "none|<url>",
        "marker-start": "none|<url>",
        "mask": "<mask-layer>#",
        "mask-border": "<'mask-border-source'>||<'mask-border-slice'> [/ <'mask-border-width'>? [/ <'mask-border-outset'>]?]?||<'mask-border-repeat'>||<'mask-border-mode'>",
        "mask-border-mode": "luminance|alpha",
        "mask-border-outset": "[<length>|<number>]{1,4}",
        "mask-border-repeat": "[stretch|repeat|round|space]{1,2}",
        "mask-border-slice": "<number-percentage>{1,4} fill?",
        "mask-border-source": "none|<image>",
        "mask-border-width": "[<length-percentage>|<number>|auto]{1,4}",
        "mask-clip": "[<coord-box>|no-clip]#",
        "mask-composite": "<compositing-operator>#",
        "mask-image": "<mask-reference>#",
        "mask-mode": "<masking-mode>#",
        "mask-origin": "<coord-box>#",
        "mask-position": "<position>#",
        "mask-repeat": "<repeat-style>#",
        "mask-size": "<bg-size>#",
        "mask-type": "luminance|alpha",
        "masonry-auto-flow": "[pack|next]||[definite-first|ordered]",
        "math-depth": "auto-add|add( <integer> )|<integer>",
        "math-shift": "normal|compact",
        "math-style": "normal|compact",
        "max-block-size": "<'max-width'>",
        "max-height": "none|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>",
        "max-inline-size": "<'max-width'>",
        "max-lines": "none|<integer>",
        "max-width": "none|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>",
        "min-block-size": "<'min-width'>",
        "min-height": "auto|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>",
        "min-inline-size": "<'min-width'>",
        "min-width": "auto|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>",
        "mix-blend-mode": "<blend-mode>|plus-darker|plus-lighter",
        "object-fit": "fill|contain|cover|none|scale-down",
        "object-position": "<position>",
        "object-view-box": "none|<basic-shape-rect>",
        "offset": "[<'offset-position'>? [<'offset-path'> [<'offset-distance'>||<'offset-rotate'>]?]?]! [/ <'offset-anchor'>]?",
        "offset-anchor": "auto|<position>",
        "offset-distance": "<length-percentage>",
        "offset-path": "none|<offset-path>||<coord-box>",
        "offset-position": "normal|auto|<position>",
        "offset-rotate": "[auto|reverse]||<angle>",
        "opacity": "<opacity-value>",
        "order": "<integer>",
        "orphans": "<integer>",
        "outline": "<'outline-width'>||<'outline-style'>||<'outline-color'>",
        "outline-color": "auto|<color>",
        "outline-offset": "<length>",
        "outline-style": "auto|<outline-line-style>",
        "outline-width": "<line-width>",
        "overflow": "[visible|hidden|clip|scroll|auto]{1,2}|<-non-standard-overflow>",
        "overflow-anchor": "auto|none",
        "overflow-block": "visible|hidden|clip|scroll|auto|<-non-standard-overflow>",
        "overflow-clip-box": "padding-box|content-box",
        "overflow-clip-margin": "<visual-box>||<length [0,∞]>",
        "overflow-inline": "visible|hidden|clip|scroll|auto|<-non-standard-overflow>",
        "overflow-wrap": "normal|break-word|anywhere",
        "overflow-x": "visible|hidden|clip|scroll|auto|<-non-standard-overflow>",
        "overflow-y": "visible|hidden|clip|scroll|auto|<-non-standard-overflow>",
        "overlay": "none|auto",
        "overscroll-behavior": "[contain|none|auto]{1,2}",
        "overscroll-behavior-block": "contain|none|auto",
        "overscroll-behavior-inline": "contain|none|auto",
        "overscroll-behavior-x": "contain|none|auto",
        "overscroll-behavior-y": "contain|none|auto",
        "padding": "<'padding-top'>{1,4}",
        "padding-block": "<'padding-top'>{1,2}",
        "padding-block-end": "<'padding-top'>",
        "padding-block-start": "<'padding-top'>",
        "padding-bottom": "<length-percentage [0,∞]>",
        "padding-inline": "<'padding-top'>{1,2}",
        "padding-inline-end": "<'padding-top'>",
        "padding-inline-start": "<'padding-top'>",
        "padding-left": "<length-percentage [0,∞]>",
        "padding-right": "<length-percentage [0,∞]>",
        "padding-top": "<length-percentage [0,∞]>",
        "page": "auto|<custom-ident>",
        "page-break-after": "auto|always|avoid|left|right|recto|verso",
        "page-break-before": "auto|always|avoid|left|right|recto|verso",
        "page-break-inside": "auto|avoid",
        "paint-order": "normal|[fill||stroke||markers]",
        "perspective": "none|<length>",
        "perspective-origin": "<position>",
        "place-content": "<'align-content'> <'justify-content'>?",
        "place-items": "<'align-items'> <'justify-items'>?",
        "place-self": "<'align-self'> <'justify-self'>?",
        "pointer-events": "auto|none|visiblePainted|visibleFill|visibleStroke|visible|painted|fill|stroke|all|inherit",
        "position": "static|relative|absolute|sticky|fixed|-webkit-sticky",
        "position-anchor": "normal|auto|none|<anchor-name>|match-parent",
        "position-area": "none|<position-area>",
        "position-try": "<'position-try-order'>? <'position-try-fallbacks'>",
        "position-try-fallbacks": "none|[[<dashed-ident>||<try-tactic>]|<'position-area'>]#",
        "position-try-order": "normal|<try-size>",
        "position-visibility": "always|[anchors-valid||anchors-visible||no-overflow]",
        "print-color-adjust": "economy|exact",
        "quotes": "none|auto|[<string> <string>]+",
        "r": "<length>|<percentage>",
        "reading-flow": "normal|source-order|flex-visual|flex-flow|grid-rows|grid-columns|grid-order",
        "reading-order": "<integer>",
        "resize": "none|both|horizontal|vertical|block|inline",
        "right": "auto|<length-percentage>|<anchor()>|<anchor-size()>",
        "rotate": "none|<angle>|[x|y|z|<number>{3}]&&<angle>",
        "row-gap": "normal|<length-percentage>",
        "ruby-align": "start|center|space-between|space-around",
        "ruby-merge": "separate|collapse|auto",
        "ruby-overhang": "auto|none",
        "ruby-position": "[alternate||[over|under]]|inter-character",
        "rx": "<length-percentage>|auto",
        "ry": "<length-percentage>|auto",
        "scale": "none|[<number>|<percentage>]{1,3}",
        "scroll-behavior": "auto|smooth",
        "scroll-initial-target": "none|nearest",
        "scroll-margin": "<length>{1,4}",
        "scroll-margin-block": "<length>{1,2}",
        "scroll-margin-block-end": "<length>",
        "scroll-margin-block-start": "<length>",
        "scroll-margin-bottom": "<length>",
        "scroll-margin-inline": "<length>{1,2}",
        "scroll-margin-inline-end": "<length>",
        "scroll-margin-inline-start": "<length>",
        "scroll-margin-left": "<length>",
        "scroll-margin-right": "<length>",
        "scroll-margin-top": "<length>",
        "scroll-marker-group": "none|before|after",
        "scroll-padding": "[auto|<length-percentage>]{1,4}",
        "scroll-padding-block": "[auto|<length-percentage>]{1,2}",
        "scroll-padding-block-end": "auto|<length-percentage>",
        "scroll-padding-block-start": "auto|<length-percentage>",
        "scroll-padding-bottom": "auto|<length-percentage>",
        "scroll-padding-inline": "[auto|<length-percentage>]{1,2}",
        "scroll-padding-inline-end": "auto|<length-percentage>",
        "scroll-padding-inline-start": "auto|<length-percentage>",
        "scroll-padding-left": "auto|<length-percentage>",
        "scroll-padding-right": "auto|<length-percentage>",
        "scroll-padding-top": "auto|<length-percentage>",
        "scroll-snap-align": "[none|start|end|center]{1,2}",
        "scroll-snap-coordinate": "none|<position>#",
        "scroll-snap-destination": "<position>",
        "scroll-snap-points-x": "none|repeat( <length-percentage> )",
        "scroll-snap-points-y": "none|repeat( <length-percentage> )",
        "scroll-snap-stop": "normal|always",
        "scroll-snap-type": "none|[x|y|block|inline|both] [mandatory|proximity]?",
        "scroll-snap-type-x": "none|mandatory|proximity",
        "scroll-snap-type-y": "none|mandatory|proximity",
        "scroll-target-group": "none|auto",
        "scroll-timeline": "[<'scroll-timeline-name'> <'scroll-timeline-axis'>?]#",
        "scroll-timeline-axis": "[block|inline|x|y]#",
        "scroll-timeline-name": "[none|<dashed-ident>]#",
        "scrollbar-color": "auto|<color>{2}",
        "scrollbar-gutter": "auto|stable&&both-edges?",
        "scrollbar-width": "auto|thin|none",
        "shape-image-threshold": "<opacity-value>",
        "shape-margin": "<length-percentage>",
        "shape-outside": "none|[<shape-box>||<basic-shape>]|<image>",
        "shape-rendering": "auto|optimizeSpeed|crispEdges|geometricPrecision",
        "speak-as": "normal|spell-out||digits||[literal-punctuation|no-punctuation]",
        "stop-color": "<'color'>",
        "stop-opacity": "<'opacity'>",
        "stroke": "<paint>",
        "stroke-color": "<color>",
        "stroke-dasharray": "none|[<svg-length>+]#",
        "stroke-dashoffset": "<svg-length>",
        "stroke-linecap": "butt|round|square",
        "stroke-linejoin": "miter|round|bevel",
        "stroke-miterlimit": "<number-one-or-greater>",
        "stroke-opacity": "<'opacity'>",
        "stroke-width": "<svg-length>",
        "tab-size": "<integer>|<length>",
        "table-layout": "auto|fixed",
        "text-align": "start|end|left|right|center|justify|match-parent",
        "text-align-last": "auto|start|end|left|right|center|justify",
        "text-anchor": "start|middle|end",
        "text-autospace": "normal|<autospace>|auto",
        "text-box": "normal|<'text-box-trim'>||<'text-box-edge'>",
        "text-box-edge": "auto|<text-edge>",
        "text-box-trim": "none|trim-start|trim-end|trim-both",
        "text-combine-upright": "none|all|[digits <integer>?]",
        "text-decoration": "<'text-decoration-line'>||<'text-decoration-style'>||<'text-decoration-color'>||<'text-decoration-thickness'>",
        "text-decoration-color": "<color>",
        "text-decoration-inset": "<length>{1,2}|auto",
        "text-decoration-line": "none|[underline||overline||line-through||blink]|spelling-error|grammar-error",
        "text-decoration-skip": "none|[objects||[spaces|[leading-spaces||trailing-spaces]]||edges||box-decoration]",
        "text-decoration-skip-ink": "auto|all|none",
        "text-decoration-style": "solid|double|dotted|dashed|wavy",
        "text-decoration-thickness": "auto|from-font|<length>|<percentage>",
        "text-emphasis": "<'text-emphasis-style'>||<'text-emphasis-color'>",
        "text-emphasis-color": "<color>",
        "text-emphasis-position": "auto|[over|under]&&[right|left]?",
        "text-emphasis-style": "none|[[filled|open]||[dot|circle|double-circle|triangle|sesame]]|<string>",
        "text-indent": "<length-percentage>&&hanging?&&each-line?",
        "text-justify": "auto|inter-character|inter-word|none",
        "text-orientation": "mixed|upright|sideways",
        "text-overflow": "[clip|ellipsis|<string>]{1,2}",
        "text-rendering": "auto|optimizeSpeed|optimizeLegibility|geometricPrecision",
        "text-shadow": "none|<shadow-t>#",
        "text-size-adjust": "none|auto|<percentage>",
        "text-spacing-trim": "space-all|normal|space-first|trim-start",
        "text-transform": "none|[capitalize|uppercase|lowercase]||full-width||full-size-kana|math-auto",
        "text-underline-offset": "auto|<length>|<percentage>",
        "text-underline-position": "auto|from-font|[under||[left|right]]",
        "text-wrap": "<'text-wrap-mode'>||<'text-wrap-style'>",
        "text-wrap-mode": "wrap|nowrap",
        "text-wrap-style": "auto|balance|stable|pretty",
        "timeline-scope": "none|<dashed-ident>#",
        "timeline-trigger": "none|[<'timeline-trigger-name'> <'timeline-trigger-source'> <'timeline-trigger-activation-range'> ['/' <'timeline-trigger-active-range'>]?]#",
        "timeline-trigger-activation-range": "[<'timeline-trigger-activation-range-start'> <'timeline-trigger-activation-range-end'>?]#",
        "timeline-trigger-activation-range-end": "[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#",
        "timeline-trigger-activation-range-start": "[normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#",
        "timeline-trigger-active-range": "[<'timeline-trigger-active-range-start'> <'timeline-trigger-active-range-end'>?]#",
        "timeline-trigger-active-range-end": "[auto|normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#",
        "timeline-trigger-active-range-start": "[auto|normal|<length-percentage>|<timeline-range-name> <length-percentage>?]#",
        "timeline-trigger-name": "none|<dashed-ident>#",
        "timeline-trigger-source": "<single-animation-timeline>#",
        "top": "auto|<length-percentage>|<anchor()>|<anchor-size()>",
        "touch-action": "auto|none|[[pan-x|pan-left|pan-right]||[pan-y|pan-up|pan-down]||pinch-zoom]|manipulation",
        "transform": "none|<transform-list>",
        "transform-box": "content-box|border-box|fill-box|stroke-box|view-box",
        "transform-origin": "[<length-percentage>|left|center|right|top|bottom]|[[<length-percentage>|left|center|right]&&[<length-percentage>|top|center|bottom]] <length>?",
        "transform-style": "flat|preserve-3d",
        "transition": "<single-transition>#",
        "transition-behavior": "<transition-behavior-value>#",
        "transition-delay": "<time>#",
        "transition-duration": "<time>#",
        "transition-property": "none|<single-transition-property>#",
        "transition-timing-function": "<easing-function>#",
        "translate": "none|<length-percentage> [<length-percentage> <length>?]?",
        "trigger-scope": "none|all|<dashed-ident>#",
        "unicode-bidi": "normal|embed|isolate|bidi-override|isolate-override|plaintext|-moz-isolate|-moz-isolate-override|-moz-plaintext|-webkit-isolate|-webkit-isolate-override|-webkit-plaintext",
        "user-select": "auto|text|none|all",
        "vector-effect": "none|non-scaling-stroke|non-scaling-size|non-rotation|fixed-position",
        "vertical-align": "baseline|sub|super|text-top|text-bottom|middle|top|bottom|<percentage>|<length>",
        "view-timeline": "[<'view-timeline-name'> [<'view-timeline-axis'>||<'view-timeline-inset'>]?]#",
        "view-timeline-axis": "[block|inline|x|y]#",
        "view-timeline-inset": "[[auto|<length-percentage>]{1,2}]#",
        "view-timeline-name": "[none|<dashed-ident>]#",
        "view-transition-class": "none|<custom-ident>+",
        "view-transition-name": "none|<custom-ident>|match-element",
        "view-transition-scope": "none|all",
        "visibility": "visible|hidden|collapse",
        "white-space": "normal|pre|pre-wrap|pre-line|<'white-space-collapse'>||<'text-wrap-mode'>",
        "white-space-collapse": "collapse|preserve|preserve-breaks|preserve-spaces|break-spaces",
        "widows": "<integer>",
        "width": "auto|<length-percentage [0,∞]>|min-content|max-content|fit-content|fit-content( <length-percentage [0,∞]> )|<calc-size()>|<anchor-size()>|stretch|<-non-standard-size>",
        "will-change": "auto|<animateable-feature>#",
        "word-break": "normal|break-all|keep-all|break-word|auto-phrase",
        "word-spacing": "normal|<length>",
        "word-wrap": "normal|break-word",
        "writing-mode": "horizontal-tb|vertical-rl|vertical-lr|sideways-rl|sideways-lr|<svg-writing-mode>",
        "x": "<length>|<percentage>",
        "y": "<length>|<percentage>",
        "z-index": "auto|<integer>",
        "zoom": "normal|reset|<number [0,∞]>||<percentage [0,∞]>",
        "-moz-background-clip": "padding|border",
        "-moz-border-radius-bottomleft": "<'border-bottom-left-radius'>",
        "-moz-border-radius-bottomright": "<'border-bottom-right-radius'>",
        "-moz-border-radius-topleft": "<'border-top-left-radius'>",
        "-moz-border-radius-topright": "<'border-bottom-right-radius'>",
        "-moz-control-character-visibility": "visible|hidden",
        "-moz-osx-font-smoothing": "auto|grayscale",
        "-moz-user-select": "none|text|all|-moz-none",
        "-ms-flex-align": "start|end|center|baseline|stretch",
        "-ms-flex-item-align": "auto|start|end|center|baseline|stretch",
        "-ms-flex-line-pack": "start|end|center|justify|distribute|stretch",
        "-ms-flex-negative": "<'flex-shrink'>",
        "-ms-flex-pack": "start|end|center|justify|distribute",
        "-ms-flex-order": "<integer>",
        "-ms-flex-positive": "<'flex-grow'>",
        "-ms-flex-preferred-size": "<'flex-basis'>",
        "-ms-interpolation-mode": "nearest-neighbor|bicubic",
        "-ms-grid-column-align": "start|end|center|stretch",
        "-ms-grid-row-align": "start|end|center|stretch",
        "-ms-hyphenate-limit-last": "none|always|column|page|spread",
        "-webkit-background-clip": "[<visual-box>|border|padding|content|text]#",
        "-webkit-column-break-after": "always|auto|avoid",
        "-webkit-column-break-before": "always|auto|avoid",
        "-webkit-column-break-inside": "always|auto|avoid",
        "-webkit-font-smoothing": "auto|none|antialiased|subpixel-antialiased",
        "-webkit-mask-box-image": "[<url>|<gradient>|none] [<length-percentage>{4} <-webkit-mask-box-repeat>{2}]?",
        "-webkit-print-color-adjust": "economy|exact",
        "-webkit-text-security": "none|circle|disc|square",
        "-webkit-user-drag": "none|element|auto",
        "behavior": "<url>+",
        "cue": "<'cue-before'> <'cue-after'>?",
        "cue-after": "<url> <decibel>?|none",
        "cue-before": "<url> <decibel>?|none",
        "glyph-orientation-horizontal": "<angle>",
        "glyph-orientation-vertical": "<angle>",
        "kerning": "auto|<svg-length>",
        "pause": "<'pause-before'> <'pause-after'>?",
        "pause-after": "<time>|none|x-weak|weak|medium|strong|x-strong",
        "pause-before": "<time>|none|x-weak|weak|medium|strong|x-strong",
        "position-try-options": "<'position-try-fallbacks'>",
        "rest": "<'rest-before'> <'rest-after'>?",
        "rest-after": "<time>|none|x-weak|weak|medium|strong|x-strong",
        "rest-before": "<time>|none|x-weak|weak|medium|strong|x-strong",
        "speak": "auto|never|always",
        "voice-balance": "<number>|left|center|right|leftwards|rightwards",
        "voice-duration": "auto|<time>",
        "voice-family": "[[<family-name>|<generic-voice>] ,]* [<family-name>|<generic-voice>]|preserve",
        "voice-pitch": "<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]",
        "voice-range": "<frequency>&&absolute|[[x-low|low|medium|high|x-high]||[<frequency>|<semitones>|<percentage>]]",
        "voice-rate": "[normal|x-slow|slow|medium|fast|x-fast]||<percentage>",
        "voice-stress": "normal|strong|moderate|none|reduced",
        "voice-volume": "silent|[[x-soft|soft|medium|loud|x-loud]||<decibel>]",
        "white-space-trim": "none|discard-before||discard-after||discard-inner"
    },
    "atrules": {
        "charset": {
            "prelude": "<string>",
            "descriptors": null
        },
        "counter-style": {
            "prelude": "<counter-style-name>",
            "descriptors": {
                "additive-symbols": "[<integer [0,∞]>&&<symbol>]#",
                "fallback": "<counter-style-name>",
                "negative": "<symbol> <symbol>?",
                "pad": "<integer [0,∞]>&&<symbol>",
                "prefix": "<symbol>",
                "range": "[[<integer>|infinite]{2}]#|auto",
                "speak-as": "auto|bullets|numbers|words|spell-out|<counter-style-name>",
                "suffix": "<symbol>",
                "symbols": "<symbol>+",
                "system": "cyclic|numeric|alphabetic|symbolic|additive|[fixed <integer>?]|[extends <counter-style-name>]"
            }
        },
        "container": {
            "prelude": "[<container-name>]? <container-condition>",
            "descriptors": null
        },
        "document": {
            "prelude": "[<url>|url-prefix( <string> )|domain( <string> )|media-document( <string> )|regexp( <string> )]#",
            "descriptors": null
        },
        "font-face": {
            "prelude": null,
            "descriptors": {
                "ascent-override": "normal|<percentage>",
                "descent-override": "normal|<percentage>",
                "font-display": "auto|block|swap|fallback|optional",
                "font-family": "<family-name>",
                "font-feature-settings": "normal|<feature-tag-value>#",
                "font-stretch": "<font-stretch-absolute>{1,2}",
                "font-style": "normal|italic|oblique <angle>{0,2}",
                "font-variation-settings": "normal|[<string> <number>]#",
                "font-weight": "<font-weight-absolute>{1,2}",
                "line-gap-override": "normal|<percentage>",
                "size-adjust": "<percentage>",
                "src": "[<url> [format( <string># )]?|local( <family-name> )]#",
                "unicode-range": "<urange>#"
            }
        },
        "font-feature-values": {
            "prelude": "<family-name>#",
            "descriptors": null
        },
        "font-palette-values": {
            "prelude": "<dashed-ident>",
            "descriptors": {
                "base-palette": "light|dark|<integer [0,∞]>",
                "font-family": "<family-name>#",
                "override-colors": "[<integer [0,∞]> <color>]#"
            }
        },
        "import": {
            "prelude": "[<string>|<url>] [layer|layer( <layer-name> )]? [supports( [<supports-condition>|<declaration>] )]? <media-query-list>?",
            "descriptors": null
        },
        "keyframes": {
            "prelude": "<keyframes-name>",
            "descriptors": null
        },
        "layer": {
            "prelude": "[<layer-name>#|<layer-name>?]",
            "descriptors": null
        },
        "media": {
            "prelude": "<media-query-list>",
            "descriptors": null
        },
        "namespace": {
            "prelude": "<namespace-prefix>? [<string>|<url>]",
            "descriptors": null
        },
        "page": {
            "prelude": "<page-selector-list>",
            "descriptors": {
                "bleed": "auto|<length>",
                "marks": "none|[crop||cross]",
                "page-orientation": "upright|rotate-left|rotate-right",
                "size": "<length [0,∞]>{1,2}|auto|[<page-size>||[portrait|landscape]]"
            }
        },
        "position-try": {
            "prelude": "<dashed-ident>",
            "descriptors": {
                "top": "<'top'>",
                "left": "<'left'>",
                "bottom": "<'bottom'>",
                "right": "<'right'>",
                "inset-block-start": "<'inset-block-start'>",
                "inset-block-end": "<'inset-block-end'>",
                "inset-inline-start": "<'inset-inline-start'>",
                "inset-inline-end": "<'inset-inline-end'>",
                "inset-block": "<'inset-block'>",
                "inset-inline": "<'inset-inline'>",
                "inset": "<'inset'>",
                "margin-top": "<'margin-top'>",
                "margin-left": "<'margin-left'>",
                "margin-bottom": "<'margin-bottom'>",
                "margin-right": "<'margin-right'>",
                "margin-block-start": "<'margin-block-start'>",
                "margin-block-end": "<'margin-block-end'>",
                "margin-inline-start": "<'margin-inline-start'>",
                "margin-inline-end": "<'margin-inline-end'>",
                "margin": "<'margin'>",
                "margin-block": "<'margin-block'>",
                "margin-inline": "<'margin-inline'>",
                "width": "<'width'>",
                "height": "<'height'>",
                "min-width": "<'min-width'>",
                "min-height": "<'min-height'>",
                "max-width": "<'max-width'>",
                "max-height": "<'max-height'>",
                "block-size": "<'block-size'>",
                "inline-size": "<'inline-size'>",
                "min-block-size": "<'min-block-size'>",
                "min-inline-size": "<'min-inline-size'>",
                "max-block-size": "<'max-block-size'>",
                "max-inline-size": "<'max-inline-size'>",
                "align-self": "<'align-self'>|anchor-center",
                "justify-self": "<'justify-self'>|anchor-center"
            }
        },
        "property": {
            "prelude": "<custom-property-name>",
            "descriptors": {
                "inherits": "true|false",
                "initial-value": "<declaration-value>?",
                "syntax": "<string>"
            }
        },
        "scope": {
            "prelude": "[( <scope-start> )]? [to ( <scope-end> )]?",
            "descriptors": null
        },
        "starting-style": {
            "prelude": null,
            "descriptors": null
        },
        "supports": {
            "prelude": "<supports-condition>",
            "descriptors": null
        },
        "view-transition": {
            "prelude": null,
            "descriptors": {
                "navigation": "auto|none",
                "types": "none|<custom-ident>+"
            }
        },
        "font-features-values": {
            "prelude": "[<string>|<custom-ident>]+",
            "descriptors": {
                "font-display": "auto|block|swap|fallback|optional"
            }
        }
    }
};$rMx module.exports = "4.0.5";ux export const version = "4.0.5";_
!x40000 convertor $Е3b:	
i100644 data-patch.js I>}u100644 data.d.ts 5[+%@ӑfcz100644 data.js /EA>A^"oL7&#40000 definition-syntax %(E'PׂZAr40000 generator 顀:_MY.100644 index.d.ts nONȏ;ىͦ{[K100644 index.js "I0*&ǺSr?40000 lexer EAMѺ9RfrJ140000 parser <yߙnD40000 syntax ;ow/\l`^QT40000 tokenizer y'T?Jv%mJ/-40000 utils NaODfÐ2Uv100644 version.js ?C>˭l:X"540000 walker (嫖YK1xI 100644 create.js V38){4'100644 index.js J.gW[T -/ximport { List } from '../utils/List.js';

export function createConvertor(walk) {
    return {
        fromPlainObject(ast) {
            walk(ast, {
                enter(node) {
                    if (node.children && node.children instanceof List === false) {
                        node.children = new List().fromArray(node.children);
                    }
                }
            });

            return ast;
        },
        toPlainObject(ast) {
            walk(ast, {
                leave(node) {
                    if (node.children && node.children instanceof List) {
                        node.children = node.children.toArray();
                    }
                }
            });

            return ast;
        }
    };
};
@x ~import { createConvertor } from './create.js';
import walker from '../walker/index.js';

export default createConvertor(walker);
-۽	x bimport { createRequire } from 'module';

const require = createRequire(import.meta.url);
const patch = require('../data/patch.json');

export default patch;
Y7xP/**
 * @fileoverview Type definitions for @eslint/css-tree/definition-syntax-data
 * @author Nicholas C. Zakas
 */

import type { SyntaxConfig } from "./index.js";

export type DefaultSyntaxConfig = Pick<SyntaxConfig, "atrules" | "types" | "properties">;

declare const defaultConfig: DefaultSyntaxConfig;
export default defaultConfig;
ux4import { createRequire } from 'module';
import patch from './data-patch.js';

const require = createRequire(import.meta.url);
const mdnAtrules = require('mdn-data/css/at-rules.json');
const mdnProperties = require('mdn-data/css/properties.json');
const mdnSyntaxes = require('mdn-data/css/syntaxes.json');

const hasOwn = Object.hasOwn || ((object, property) => Object.prototype.hasOwnProperty.call(object, property));
const extendSyntax = /^\s*\|\s*/;

function preprocessAtrules(dict) {
    const result = Object.create(null);

    for (const [atruleName, atrule] of Object.entries(dict)) {
        let descriptors = null;

        if (atrule.descriptors) {
            descriptors = Object.create(null);

            for (const [name, descriptor] of Object.entries(atrule.descriptors)) {
                descriptors[name] = descriptor.syntax;
            }
        }

        result[atruleName.substr(1)] = {
            prelude: atrule.syntax.trim().replace(/\{(.|\s)+\}/, '').match(/^@\S+\s+([^;\{]*)/)[1].trim() || null,
            descriptors
        };
    }

    return result;
}

function patchDictionary(dict, patchDict) {
    const result = Object.create(null);

    // copy all syntaxes for an original dict
    for (const [key, value] of Object.entries(dict)) {
        if (value) {
            result[key] = value.syntax || value;
        }
    }

    // apply a patch
    for (const key of Object.keys(patchDict)) {
        if (hasOwn(dict, key)) {
            if (patchDict[key].syntax) {
                result[key] = extendSyntax.test(patchDict[key].syntax)
                    ? result[key] + ' ' + patchDict[key].syntax.trim()
                    : patchDict[key].syntax;
            } else {
                delete result[key];
            }
        } else {
            if (patchDict[key].syntax) {
                result[key] = patchDict[key].syntax.replace(extendSyntax, '');
            }
        }
    }

    return result;
}

function preprocessPatchAtrulesDescritors(declarations) {
    const result = {};

    for (const [key, value] of Object.entries(declarations || {})) {
        result[key] = typeof value === 'string'
            ? { syntax: value }
            : value;
    }

    return result;
}

function patchAtrules(dict, patchDict) {
    const result = {};

    // copy all syntaxes for an original dict
    for (const key in dict) {
        if (patchDict[key] === null) {
            continue;
        }

        const atrulePatch = patchDict[key] || {};

        result[key] = {
            prelude: key in patchDict && 'prelude' in atrulePatch
                ? atrulePatch.prelude
                : dict[key].prelude || null,
            descriptors: patchDictionary(
                dict[key].descriptors || {},
                preprocessPatchAtrulesDescritors(atrulePatch.descriptors)
            )
        };
    }

    // apply a patch
    for (const [key, atrulePatch] of Object.entries(patchDict)) {
        if (atrulePatch && !hasOwn(dict, key)) {
            result[key] = {
                prelude: atrulePatch.prelude || null,
                descriptors: atrulePatch.descriptors
                    ? patchDictionary({}, preprocessPatchAtrulesDescritors(atrulePatch.descriptors))
                    : null
            };
        }
    }

    return result;
}

export default {
    types: patchDictionary(mdnSyntaxes, patch.types),
    atrules: patchAtrules(preprocessAtrules(mdnAtrules), patch.atrules),
    properties: patchDictionary(mdnProperties, patch.properties)
};
o=^x 100644 SyntaxError.js _cߧ2\ |NcR2 100644 generate.js cm.(G/ro100644 index.js $>7+Q>100644 parse.js ԖItwg,Ho H100644 scanner.js б^'R="Q=_m@100644 walk.js ǕYگvQkK[LXxgimport { createCustomError } from '../utils/create-custom-error.js';

export function SyntaxError(message, input, offset) {
    return Object.assign(createCustomError('SyntaxError', message), {
        input,
        offset,
        rawMessage: message,
        message: message + '\n' +
            '  ' + input + '\n' +
            '--' + new Array((offset || input.length) + 1).join('-') + '^'
    });
};
M_zx\function noop(value) {
    return value;
}

function generateMultiplier(multiplier) {
    const { min, max, comma } = multiplier;

    if (min === 0 && max === 0) {
        return comma ? '#?' : '*';
    }

    if (min === 0 && max === 1) {
        return '?';
    }

    if (min === 1 && max === 0) {
        return comma ? '#' : '+';
    }

    if (min === 1 && max === 1) {
        return '';
    }

    return (
        (comma ? '#' : '') +
        (min === max
            ? '{' + min + '}'
            : '{' + min + ',' + (max !== 0 ? max : '') + '}'
        )
    );
}

function generateTypeOpts(node) {
    switch (node.type) {
        case 'Range':
            return (
                ' [' +
                (node.min === null ? '-∞' : node.min) +
                ',' +
                (node.max === null ? '∞' : node.max) +
                ']'
            );

        default:
            throw new Error('Unknown node type `' + node.type + '`');
    }
}

function generateSequence(node, decorate, forceBraces, compact) {
    const combinator = node.combinator === ' ' || compact ? node.combinator : ' ' + node.combinator + ' ';
    const result = node.terms
        .map(term => internalGenerate(term, decorate, forceBraces, compact))
        .join(combinator);

    if (node.explicit || forceBraces) {
        return (compact || result[0] === ',' ? '[' : '[ ') + result + (compact ? ']' : ' ]');
    }

    return result;
}

function internalGenerate(node, decorate, forceBraces, compact) {
    let result;

    switch (node.type) {
        case 'Group':
            result =
                generateSequence(node, decorate, forceBraces, compact) +
                (node.disallowEmpty ? '!' : '');
            break;

        case 'Multiplier':
            // return since node is a composition
            return (
                internalGenerate(node.term, decorate, forceBraces, compact) +
                decorate(generateMultiplier(node), node)
            );

        case 'Boolean':
            result = '<boolean-expr[' + internalGenerate(node.term, decorate, forceBraces, compact) + ']>';
            break;

        case 'Type':
            result = '<' + node.name + (node.opts ? decorate(generateTypeOpts(node.opts), node.opts) : '') + '>';
            break;

        case 'Property':
            result = '<\'' + node.name + '\'>';
            break;

        case 'Keyword':
            result = node.name;
            break;

        case 'AtKeyword':
            result = '@' + node.name;
            break;

        case 'Function':
            result = node.name + '(';
            break;

        case 'String':
        case 'Token':
            result = node.value;
            break;

        case 'Comma':
            result = ',';
            break;

        default:
            throw new Error('Unknown node type `' + node.type + '`');
    }

    return decorate(result, node);
}

export function generate(node, options) {
    let decorate = noop;
    let forceBraces = false;
    let compact = false;

    if (typeof options === 'function') {
        decorate = options;
    } else if (options) {
        forceBraces = Boolean(options.forceBraces);
        compact = Boolean(options.compact);
        if (typeof options.decorate === 'function') {
            decorate = options.decorate;
        }
    }

    return internalGenerate(node, decorate, forceBraces, compact);
};
t
x _export { SyntaxError } from './SyntaxError.js';
export { generate } from './generate.js';
export { parse } from './parse.js';
export { walk } from './walk.js';
76x:import { Scanner } from './scanner.js';

const TAB = 9;
const N = 10;
const F = 12;
const R = 13;
const SPACE = 32;
const EXCLAMATIONMARK = 33;    // !
const NUMBERSIGN = 35;         // #
const AMPERSAND = 38;          // &
const APOSTROPHE = 39;         // '
const LEFTPARENTHESIS = 40;    // (
const RIGHTPARENTHESIS = 41;   // )
const ASTERISK = 42;           // *
const PLUSSIGN = 43;           // +
const COMMA = 44;              // ,
const HYPERMINUS = 45;         // -
const LESSTHANSIGN = 60;       // <
const GREATERTHANSIGN = 62;    // >
const QUESTIONMARK = 63;       // ?
const COMMERCIALAT = 64;       // @
const LEFTSQUAREBRACKET = 91;  // [
const RIGHTSQUAREBRACKET = 93; // ]
const LEFTCURLYBRACKET = 123;  // {
const VERTICALLINE = 124;      // |
const RIGHTCURLYBRACKET = 125; // }
const INFINITY = 8734;         // ∞
const COMBINATOR_PRECEDENCE = {
    ' ': 1,
    '&&': 2,
    '||': 3,
    '|': 4
};

function readMultiplierRange(scanner) {
    let min = null;
    let max = null;

    scanner.eat(LEFTCURLYBRACKET);
    scanner.skipWs();

    min = scanner.scanNumber(scanner);
    scanner.skipWs();

    if (scanner.charCode() === COMMA) {
        scanner.pos++;
        scanner.skipWs();

        if (scanner.charCode() !== RIGHTCURLYBRACKET) {
            max = scanner.scanNumber(scanner);
            scanner.skipWs();
        }
    } else {
        max = min;
    }

    scanner.eat(RIGHTCURLYBRACKET);

    return {
        min: Number(min),
        max: max ? Number(max) : 0
    };
}

function readMultiplier(scanner) {
    let range = null;
    let comma = false;

    switch (scanner.charCode()) {
        case ASTERISK:
            scanner.pos++;

            range = {
                min: 0,
                max: 0
            };

            break;

        case PLUSSIGN:
            scanner.pos++;

            range = {
                min: 1,
                max: 0
            };

            break;

        case QUESTIONMARK:
            scanner.pos++;

            range = {
                min: 0,
                max: 1
            };

            break;

        case NUMBERSIGN:
            scanner.pos++;

            comma = true;

            if (scanner.charCode() === LEFTCURLYBRACKET) {
                range = readMultiplierRange(scanner);
            } else if (scanner.charCode() === QUESTIONMARK) {
                // https://www.w3.org/TR/css-values-4/#component-multipliers
                // > the # and ? multipliers may be stacked as #?
                // In this case just treat "#?" as a single multiplier
                // { min: 0, max: 0, comma: true }
                scanner.pos++;
                range = {
                    min: 0,
                    max: 0
                };
            } else {
                range = {
                    min: 1,
                    max: 0
                };
            }

            break;

        case LEFTCURLYBRACKET:
            range = readMultiplierRange(scanner);
            break;

        default:
            return null;
    }

    return {
        type: 'Multiplier',
        comma,
        min: range.min,
        max: range.max,
        term: null
    };
}

function maybeMultiplied(scanner, node) {
    const multiplier = readMultiplier(scanner);

    if (multiplier !== null) {
        multiplier.term = node;

        // https://www.w3.org/TR/css-values-4/#component-multipliers
        // > The + and # multipliers may be stacked as +#;
        // Represent "+#" as nested multipliers:
        // { ...<multiplier #>,
        //   term: {
        //     ...<multipler +>,
        //     term: node
        //   }
        // }
        if (scanner.charCode() === NUMBERSIGN &&
            scanner.charCodeAt(scanner.pos - 1) === PLUSSIGN) {
            return maybeMultiplied(scanner, multiplier);
        }

        // https://www.w3.org/TR/css-values-4/#component-multipliers
        // > the # and ? multipliers, {A} and ? multipliers, and {A,B} and ? multipliers
        // > may be stacked as #?, {A}?, and {A,B}?, respectively
        // Represent "{}?" as nested multipliers as well as "+#".
        // The "#?" case is already handled above, in maybeMultiplied()
        if (scanner.charCode() === QUESTIONMARK &&
            scanner.charCodeAt(scanner.pos - 1) === RIGHTCURLYBRACKET) {
            return maybeMultiplied(scanner, multiplier);
        }

        return multiplier;
    }

    return node;
}

function maybeToken(scanner) {
    const ch = scanner.peek();

    if (ch === '') {
        return null;
    }

    return maybeMultiplied(scanner, {
        type: 'Token',
        value: ch
    });
}

function readProperty(scanner) {
    let name;

    scanner.eat(LESSTHANSIGN);
    scanner.eat(APOSTROPHE);

    name = scanner.scanWord();

    scanner.eat(APOSTROPHE);
    scanner.eat(GREATERTHANSIGN);

    return maybeMultiplied(scanner, {
        type: 'Property',
        name
    });
}

// https://drafts.csswg.org/css-values-3/#numeric-ranges
// 4.1. Range Restrictions and Range Definition Notation
//
// Range restrictions can be annotated in the numeric type notation using CSS bracketed
// range notation—[min,max]—within the angle brackets, after the identifying keyword,
// indicating a closed range between (and including) min and max.
// For example, <integer [0, 10]> indicates an integer between 0 and 10, inclusive.
function readTypeRange(scanner) {
    // use null for Infinity to make AST format JSON serializable/deserializable
    let min = null; // -Infinity
    let max = null; // Infinity
    let sign = 1;

    scanner.eat(LEFTSQUAREBRACKET);

    if (scanner.charCode() === HYPERMINUS) {
        scanner.peek();
        sign = -1;
    }

    if (sign == -1 && scanner.charCode() === INFINITY) {
        scanner.peek();
    } else {
        min = sign * Number(scanner.scanNumber(scanner));

        if (scanner.isNameCharCode()) {
            min += scanner.scanWord();
        }
    }

    scanner.skipWs();
    scanner.eat(COMMA);
    scanner.skipWs();

    if (scanner.charCode() === INFINITY) {
        scanner.peek();
    } else {
        sign = 1;

        if (scanner.charCode() === HYPERMINUS) {
            scanner.peek();
            sign = -1;
        }

        max = sign * Number(scanner.scanNumber(scanner));

        if (scanner.isNameCharCode()) {
            max += scanner.scanWord();
        }
    }

    scanner.eat(RIGHTSQUAREBRACKET);

    return {
        type: 'Range',
        min,
        max
    };
}

function readType(scanner) {
    let name;
    let opts = null;

    scanner.eat(LESSTHANSIGN);
    name = scanner.scanWord();

    // https://drafts.csswg.org/css-values-5/#boolean
    if (name === 'boolean-expr') {
        scanner.eat(LEFTSQUAREBRACKET);

        const implicitGroup = readImplicitGroup(scanner, RIGHTSQUAREBRACKET);

        scanner.eat(RIGHTSQUAREBRACKET);
        scanner.eat(GREATERTHANSIGN);

        return maybeMultiplied(scanner, {
            type: 'Boolean',
            term: implicitGroup.terms.length === 1
                ? implicitGroup.terms[0]
                : implicitGroup
        });
    }

    if (scanner.charCode() === LEFTPARENTHESIS &&
        scanner.nextCharCode() === RIGHTPARENTHESIS) {
        scanner.pos += 2;
        name += '()';
    }

    if (scanner.charCodeAt(scanner.findWsEnd(scanner.pos)) === LEFTSQUAREBRACKET) {
        scanner.skipWs();
        opts = readTypeRange(scanner);
    }

    scanner.eat(GREATERTHANSIGN);

    return maybeMultiplied(scanner, {
        type: 'Type',
        name,
        opts
    });
}

function readKeywordOrFunction(scanner) {
    const name = scanner.scanWord();

    if (scanner.charCode() === LEFTPARENTHESIS) {
        scanner.pos++;

        return {
            type: 'Function',
            name
        };
    }

    return maybeMultiplied(scanner, {
        type: 'Keyword',
        name
    });
}

function regroupTerms(terms, combinators) {
    function createGroup(terms, combinator) {
        return {
            type: 'Group',
            terms,
            combinator,
            disallowEmpty: false,
            explicit: false
        };
    }

    let combinator;

    combinators = Object.keys(combinators)
        .sort((a, b) => COMBINATOR_PRECEDENCE[a] - COMBINATOR_PRECEDENCE[b]);

    while (combinators.length > 0) {
        combinator = combinators.shift();

        let i = 0;
        let subgroupStart = 0;

        for (; i < terms.length; i++) {
            const term = terms[i];

            if (term.type === 'Combinator') {
                if (term.value === combinator) {
                    if (subgroupStart === -1) {
                        subgroupStart = i - 1;
                    }
                    terms.splice(i, 1);
                    i--;
                } else {
                    if (subgroupStart !== -1 && i - subgroupStart > 1) {
                        terms.splice(
                            subgroupStart,
                            i - subgroupStart,
                            createGroup(terms.slice(subgroupStart, i), combinator)
                        );
                        i = subgroupStart + 1;
                    }
                    subgroupStart = -1;
                }
            }
        }

        if (subgroupStart !== -1 && combinators.length) {
            terms.splice(
                subgroupStart,
                i - subgroupStart,
                createGroup(terms.slice(subgroupStart, i), combinator)
            );
        }
    }

    return combinator;
}

function readImplicitGroup(scanner, stopCharCode = -1) {
    const combinators = Object.create(null);
    const terms = [];
    let prevToken = null;
    let prevTokenPos = scanner.pos;
    let prevTokenIsFunction = false;

    while (scanner.charCode() !== stopCharCode) {
        let token = prevTokenIsFunction
            ? readImplicitGroup(scanner, RIGHTPARENTHESIS)
            : peek(scanner);

        if (!token) {
            break;
        }

        if (token.type === 'Spaces') {
            continue;
        }

        if (prevTokenIsFunction) {
            if (token.terms.length === 0) {
                prevTokenIsFunction = false;
                continue;
            }

            if (token.combinator === ' ') {
                while (token.terms.length > 1) {
                    combinators[' '] = true;  // a b
                    terms.push({
                        type: 'Combinator',
                        value: ' '
                    }, token.terms.shift());
                }

                token = token.terms[0];
            }
        }

        if (token.type === 'Combinator') {
            // check for combinator in group beginning and double combinator sequence
            if (prevToken === null || prevToken.type === 'Combinator') {
                scanner.pos = prevTokenPos;
                scanner.error('Unexpected combinator');
            }

            combinators[token.value] = true;
        } else if (prevToken !== null && prevToken.type !== 'Combinator') {
            combinators[' '] = true;  // a b
            terms.push({
                type: 'Combinator',
                value: ' '
            });
        }

        terms.push(token);
        prevToken = token;
        prevTokenPos = scanner.pos;
        prevTokenIsFunction = token.type === 'Function';
    }

    // check for combinator in group ending
    if (prevToken !== null && prevToken.type === 'Combinator') {
        scanner.pos -= prevTokenPos;
        scanner.error('Unexpected combinator');
    }

    return {
        type: 'Group',
        terms,
        combinator: regroupTerms(terms, combinators) || ' ',
        disallowEmpty: false,
        explicit: false
    };
}

function readGroup(scanner) {
    let result;

    scanner.eat(LEFTSQUAREBRACKET);
    result = readImplicitGroup(scanner, RIGHTSQUAREBRACKET);
    scanner.eat(RIGHTSQUAREBRACKET);

    result.explicit = true;

    if (scanner.charCode() === EXCLAMATIONMARK) {
        scanner.pos++;
        result.disallowEmpty = true;
    }

    return result;
}

function peek(scanner) {
    let code = scanner.charCode();

    switch (code) {
        case RIGHTSQUAREBRACKET:
            // don't eat, stop scan a group
            break;

        case LEFTSQUAREBRACKET:
            return maybeMultiplied(scanner, readGroup(scanner));

        case LESSTHANSIGN:
            return scanner.nextCharCode() === APOSTROPHE
                ? readProperty(scanner)
                : readType(scanner);

        case VERTICALLINE:
            return {
                type: 'Combinator',
                value: scanner.substringToPos(
                    scanner.pos + (scanner.nextCharCode() === VERTICALLINE ? 2 : 1)
                )
            };

        case AMPERSAND:
            scanner.pos++;
            scanner.eat(AMPERSAND);

            return {
                type: 'Combinator',
                value: '&&'
            };

        case COMMA:
            scanner.pos++;
            return {
                type: 'Comma'
            };

        case APOSTROPHE:
            return maybeMultiplied(scanner, {
                type: 'String',
                value: scanner.scanString()
            });

        case SPACE:
        case TAB:
        case N:
        case R:
        case F:
            return {
                type: 'Spaces',
                value: scanner.scanSpaces()
            };

        case COMMERCIALAT:
            code = scanner.nextCharCode();

            if (scanner.isNameCharCode(code)) {
                scanner.pos++;
                return {
                    type: 'AtKeyword',
                    name: scanner.scanWord()
                };
            }

            return maybeToken(scanner);

        case ASTERISK:
        case PLUSSIGN:
        case QUESTIONMARK:
        case NUMBERSIGN:
        case EXCLAMATIONMARK:
            // prohibited tokens (used as a multiplier start)
            break;

        case LEFTCURLYBRACKET:
            // LEFTCURLYBRACKET is allowed since mdn/data uses it w/o quoting
            // check next char isn't a number, because it's likely a disjoined multiplier
            code = scanner.nextCharCode();

            if (code < 48 || code > 57) {
                return maybeToken(scanner);
            }

            break;

        default:
            if (scanner.isNameCharCode(code)) {
                return readKeywordOrFunction(scanner);
            }

            return maybeToken(scanner);
    }
}

export function parse(source) {
    const scanner = new Scanner(source);
    const result = readImplicitGroup(scanner);

    if (scanner.pos !== source.length) {
        scanner.error('Unexpected input');
    }

    // reduce redundant groups with single group term
    if (result.terms.length === 1 && result.terms[0].type === 'Group') {
        return result.terms[0];
    }

    return result;
};
~ǽxZ
import { SyntaxError } from './SyntaxError.js';

const TAB = 9;
const N = 10;
const F = 12;
const R = 13;
const SPACE = 32;
const NAME_CHAR = new Uint8Array(128).map((_, idx) =>
    /[a-zA-Z0-9\-]/.test(String.fromCharCode(idx)) ? 1 : 0
);

export class Scanner {
    constructor(str) {
        this.str = str;
        this.pos = 0;
    }

    charCodeAt(pos) {
        return pos < this.str.length ? this.str.charCodeAt(pos) : 0;
    }
    charCode() {
        return this.charCodeAt(this.pos);
    }
    isNameCharCode(code = this.charCode()) {
        return code < 128 && NAME_CHAR[code] === 1;
    }
    nextCharCode() {
        return this.charCodeAt(this.pos + 1);
    }
    nextNonWsCode(pos) {
        return this.charCodeAt(this.findWsEnd(pos));
    }
    skipWs() {
        this.pos = this.findWsEnd(this.pos);
    }
    findWsEnd(pos) {
        for (; pos < this.str.length; pos++) {
            const code = this.str.charCodeAt(pos);
            if (code !== R && code !== N && code !== F && code !== SPACE && code !== TAB) {
                break;
            }
        }

        return pos;
    }
    substringToPos(end) {
        return this.str.substring(this.pos, this.pos = end);
    }
    eat(code) {
        if (this.charCode() !== code) {
            this.error('Expect `' + String.fromCharCode(code) + '`');
        }

        this.pos++;
    }
    peek() {
        return this.pos < this.str.length ? this.str.charAt(this.pos++) : '';
    }
    error(message) {
        throw new SyntaxError(message, this.str, this.pos);
    }

    scanSpaces() {
        return this.substringToPos(this.findWsEnd(this.pos));
    }
    scanWord() {
        let end = this.pos;

        for (; end < this.str.length; end++) {
            const code = this.str.charCodeAt(end);
            if (code >= 128 || NAME_CHAR[code] === 0) {
                break;
            }
        }

        if (this.pos === end) {
            this.error('Expect a keyword');
        }

        return this.substringToPos(end);
    }
    scanNumber() {
        let end = this.pos;

        for (; end < this.str.length; end++) {
            const code = this.str.charCodeAt(end);

            if (code < 48 || code > 57) {
                break;
            }
        }

        if (this.pos === end) {
            this.error('Expect a number');
        }

        return this.substringToPos(end);
    }
    scanString() {
        const end = this.str.indexOf('\'', this.pos + 1);

        if (end === -1) {
            this.pos = this.str.length;
            this.error('Expect an apostrophe');
        }

        return this.substringToPos(end + 1);
    }
};
uw܊Ox
const noop = function() {};

function ensureFunction(value) {
    return typeof value === 'function' ? value : noop;
}

export function walk(node, options, context) {
    function walk(node) {
        enter.call(context, node);

        switch (node.type) {
            case 'Group':
                node.terms.forEach(walk);
                break;

            case 'Multiplier':
            case 'Boolean':
                walk(node.term);
                break;

            case 'Type':
            case 'Property':
            case 'Keyword':
            case 'AtKeyword':
            case 'Function':
            case 'String':
            case 'Token':
            case 'Comma':
                break;

            default:
                throw new Error('Unknown type: ' + node.type);
        }

        leave.call(context, node);
    }

    let enter = noop;
    let leave = noop;

    if (typeof options === 'function') {
        enter = options;
    } else if (options) {
        enter = ensureFunction(options.enter);
        leave = ensureFunction(options.leave);
    }

    if (enter === noop && leave === noop) {
        throw new Error('Neither `enter` nor `leave` walker handler is set or both aren\'t a function');
    }

    walk(node, context);
};
.b	x c100644 create.js Yj}`@^Ɉ6100644 index.js g /V݅0vj100644 sourceMap.js _~X,v׊hƖ=100644 token-before.js nO&b/U 3<ximport { Delim, WhiteSpace } from '../tokenizer/index.js';
import { getTokenizer } from '../utils/get-tokenizer.js';
import { generateSourceMap } from './sourceMap.js';
import * as tokenBefore from './token-before.js';

const REVERSESOLIDUS = 0x005c; // U+005C REVERSE SOLIDUS (\)

function processChildren(node, delimeter) {
    if (typeof delimeter === 'function') {
        let prev = null;

        node.children.forEach(node => {
            if (prev !== null) {
                delimeter.call(this, prev);
            }

            this.node(node);
            prev = node;
        });

        return;
    }

    node.children.forEach(this.node, this);
}

export function createGenerator(config) {
    const types = new Map();

    for (let [name, item] of Object.entries(config.node)) {
        const fn = item.generate || item;

        if (typeof fn === 'function') {
            types.set(name, item.generate || item);
        }
    }

    return function(node, options) {
        let buffer = '';
        let prevCode = 0;
        let handlers = {
            node(node) {
                if (types.has(node.type)) {
                    types.get(node.type).call(publicApi, node);
                } else {
                    throw new Error('Unknown node type: ' + node.type);
                }
            },
            tokenBefore: tokenBefore.safe,
            token(type, value, suppressAutoWhiteSpace) {
                prevCode = this.tokenBefore(prevCode, type, value);

                if (!suppressAutoWhiteSpace && prevCode & 1) {
                    this.emit(' ', WhiteSpace, true);
                }

                this.emit(value, type, false);

                if (type === Delim && value.charCodeAt(0) === REVERSESOLIDUS) {
                    this.emit('\n', WhiteSpace, true);
                }
            },
            emit(value) {
                buffer += value;
            },
            result() {
                return buffer;
            }
        };

        if (options) {
            if (typeof options.decorator === 'function') {
                handlers = options.decorator(handlers);
            }

            if (options.sourceMap) {
                handlers = generateSourceMap(handlers);
            }

            if (options.mode in tokenBefore) {
                handlers.tokenBefore = tokenBefore[options.mode];
            }
        }

        const publicApi = {
            node: (node) => handlers.node(node),
            children: processChildren,
            token: (type, value) => handlers.token(type, value),
            tokenize: function (chunk) {
                const tokenize = getTokenizer(config);

                return tokenize(chunk, (type, start, end) => {
                    handlers.token(
                        type,
                        chunk.slice(start, end),
                        start !== 0 // suppress auto whitespace for internal value tokens
                    );
                });
            }
        };

        handlers.node(node);

        return handlers.result();
    };
};
pHȼx simport { createGenerator } from './create.js';
import config from '../syntax/config/generator.js';

export default createGenerator(config);
1x-
import { SourceMapGenerator } from 'source-map-js/lib/source-map-generator.js';

const trackNodes = new Set(['Atrule', 'Selector', 'Declaration']);

export function generateSourceMap(handlers) {
    const map = new SourceMapGenerator();
    const generated = {
        line: 1,
        column: 0
    };
    const original = {
        line: 0, // should be zero to add first mapping
        column: 0
    };
    const activatedGenerated = {
        line: 1,
        column: 0
    };
    const activatedMapping = {
        generated: activatedGenerated
    };
    let line = 1;
    let column = 0;
    let sourceMappingActive = false;

    const origHandlersNode = handlers.node;
    handlers.node = function(node) {
        if (node.loc && node.loc.start && trackNodes.has(node.type)) {
            const nodeLine = node.loc.start.line;
            const nodeColumn = node.loc.start.column - 1;

            if (original.line !== nodeLine ||
                original.column !== nodeColumn) {
                original.line = nodeLine;
                original.column = nodeColumn;

                generated.line = line;
                generated.column = column;

                if (sourceMappingActive) {
                    sourceMappingActive = false;
                    if (generated.line !== activatedGenerated.line ||
                        generated.column !== activatedGenerated.column) {
                        map.addMapping(activatedMapping);
                    }
                }

                sourceMappingActive = true;
                map.addMapping({
                    source: node.loc.source,
                    original,
                    generated
                });
            }
        }

        origHandlersNode.call(this, node);

        if (sourceMappingActive && trackNodes.has(node.type)) {
            activatedGenerated.line = line;
            activatedGenerated.column = column;
        }
    };

    const origHandlersEmit = handlers.emit;
    handlers.emit = function(value, type, auto) {
        for (let i = 0; i < value.length; i++) {
            if (value.charCodeAt(i) === 10) { // \n
                line++;
                column = 0;
            } else {
                column++;
            }
        }

        origHandlersEmit(value, type, auto);
    };

    const origHandlersResult = handlers.result;
    handlers.result = function() {
        if (sourceMappingActive) {
            map.addMapping(activatedMapping);
        }

        return {
            css: origHandlersResult(),
            map
        };
    };

    return handlers;
};
Zڐx4import {
    Delim,
    Ident,
    Function as FunctionToken,
    Url,
    BadUrl,
    AtKeyword,
    Hash,
    Percentage,
    Dimension,
    Number as NumberToken,
    String as StringToken,
    Colon,
    LeftParenthesis,
    RightParenthesis,
    CDC
} from '../tokenizer/index.js';

const PLUSSIGN = 0x002B;    // U+002B PLUS SIGN (+)
const HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)

// code:
// 0xxxxxxx x0000000 - char code (0x80 for non-ASCII) or delim value
// 00000000 0xxxxxx0 - token type (0 for delim, 1 for token)
// 00000000 0000000x - reserved for carriage emit flag (0 for no space, 1 for space)
const code = (type, value) => {
    if (type === Delim) {
        type = value;
    }

    if (typeof type === 'string') {
        type = Math.min(type.charCodeAt(0), 0x80) << 6; // replace non-ASCII with 0x80
    }

    return type << 1;
};

// https://www.w3.org/TR/css-syntax-3/#serialization
// The only requirement for serialization is that it must "round-trip" with parsing,
// that is, parsing the stylesheet must produce the same data structures as parsing,
// serializing, and parsing again, except for consecutive <whitespace-token>s,
// which may be collapsed into a single token.

const specPairs = [
    [Ident, Ident],
    [Ident, FunctionToken],
    [Ident, Url],
    [Ident, BadUrl],
    [Ident, '-'],
    [Ident, NumberToken],
    [Ident, Percentage],
    [Ident, Dimension],
    [Ident, CDC],
    [Ident, LeftParenthesis],

    [AtKeyword, Ident],
    [AtKeyword, FunctionToken],
    [AtKeyword, Url],
    [AtKeyword, BadUrl],
    [AtKeyword, '-'],
    [AtKeyword, NumberToken],
    [AtKeyword, Percentage],
    [AtKeyword, Dimension],
    [AtKeyword, CDC],

    [Hash, Ident],
    [Hash, FunctionToken],
    [Hash, Url],
    [Hash, BadUrl],
    [Hash, '-'],
    [Hash, NumberToken],
    [Hash, Percentage],
    [Hash, Dimension],
    [Hash, CDC],

    [Dimension, Ident],
    [Dimension, FunctionToken],
    [Dimension, Url],
    [Dimension, BadUrl],
    [Dimension, '-'],
    [Dimension, NumberToken],
    [Dimension, Percentage],
    [Dimension, Dimension],
    [Dimension, CDC],

    ['#', Ident],
    ['#', FunctionToken],
    ['#', Url],
    ['#', BadUrl],
    ['#', '-'],
    ['#', NumberToken],
    ['#', Percentage],
    ['#', Dimension],
    ['#', CDC], // https://github.com/w3c/csswg-drafts/pull/6874

    ['-', Ident],
    ['-', FunctionToken],
    ['-', Url],
    ['-', BadUrl],
    ['-', '-'],
    ['-', NumberToken],
    ['-', Percentage],
    ['-', Dimension],
    ['-', CDC], // https://github.com/w3c/csswg-drafts/pull/6874

    [NumberToken, Ident],
    [NumberToken, FunctionToken],
    [NumberToken, Url],
    [NumberToken, BadUrl],
    [NumberToken, NumberToken],
    [NumberToken, Percentage],
    [NumberToken, Dimension],
    [NumberToken, '%'],
    [NumberToken, CDC], // https://github.com/w3c/csswg-drafts/pull/6874

    ['@', Ident],
    ['@', FunctionToken],
    ['@', Url],
    ['@', BadUrl],
    ['@', '-'],
    ['@', CDC], // https://github.com/w3c/csswg-drafts/pull/6874

    ['.', NumberToken],
    ['.', Percentage],
    ['.', Dimension],

    ['+', NumberToken],
    ['+', Percentage],
    ['+', Dimension],

    ['/', '*']
];
// validate with scripts/generate-safe
const safePairs = specPairs.concat([
    [Ident, Hash],

    [Dimension, Hash],

    [Hash, Hash],

    [AtKeyword, LeftParenthesis],
    [AtKeyword, StringToken],
    [AtKeyword, Colon],

    [Percentage, Percentage],
    [Percentage, Dimension],
    [Percentage, FunctionToken],
    [Percentage, '-'],

    [RightParenthesis, Ident],
    [RightParenthesis, FunctionToken],
    [RightParenthesis, Percentage],
    [RightParenthesis, Dimension],
    [RightParenthesis, Hash],
    [RightParenthesis, '-']
]);

function createMap(pairs) {
    const isWhiteSpaceRequired = new Set(
        pairs.map(([prev, next]) => (code(prev) << 16 | code(next)))
    );

    return function(prevCode, type, value) {
        const nextCode = code(type, value);
        const nextCharCode = value.charCodeAt(0);
        const emitWs =
            (nextCharCode === HYPHENMINUS &&
                type !== Ident &&
                type !== FunctionToken &&
                type !== CDC) ||
            (nextCharCode === PLUSSIGN)
                ? isWhiteSpaceRequired.has((prevCode & 0xFFFE) << 16 | nextCharCode << 7)
                : isWhiteSpaceRequired.has((prevCode & 0xFFFE) << 16 | nextCode);

        return nextCode | emitWs;
    };
}

export const spec = createMap(specPairs);
export const safe = createMap(safePairs);
@EA1x   /**
 * @fileoverview Type definitions for @eslint/css-tree
 * @author ScriptHunter7
 * @license MIT
 * Based on https://github.com/scripthunter7/DefinitelyTyped/blob/master/types/css-tree/index.d.ts
 */

/*
 * MIT License
 * Copyright (c) Microsoft Corporation.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE
 */


// FIXME: Custom context / nodes for every fork, maybe add a template for internal context

// ----------------------------------------------------------
// CSS Locations
// ----------------------------------------------------------

/**
 * Represents a location within a CSS source.
 */
export interface CssLocation {
    /**
     * The 0-indexed character offset from the beginning of the source.
     */
    offset: number;

    /**
     * The 1-indexed line number.
     */
    line: number;

    /**
     * The 1-indexed column number.
     */
    column: number;
}

/**
 * Represents a range of locations within a CSS source.
 */
export interface CssLocationRange {
    /**
     * The source file name. If not provided, it will be set to `<unknown>`.
     */
    source: string;

    /**
     * The starting location of the range.
     */
    start: CssLocation;

    /**
     * The ending location of the range.
     */
    end: CssLocation;
}

// ----------------------------------------------------------
// Linked list utils
// https://github.com/csstree/csstree/blob/master/lib/utils/List.js
// ----------------------------------------------------------

/**
 * Represents an item in a linked list.
 *
 * @template TData - The type of data stored in the item.
 */
export interface ListItem<TData> {
    /**
     * The previous item in the list.
     */
    prev: ListItem<TData> | null;

    /**
     * The next item in the list.
     */
    next: ListItem<TData> | null;

    /**
     * The data stored in the item.
     */
    data: TData;
}

/**
 * A callback function used for iterating over a list.
 *
 * @template TData - The type of data in the list.
 * @template TResult - The type of the result returned by the function.
 * @template TContext - The type of the context object passed to the function. Defaults to List<TData>.
 *
 * @param {TData} item - The current item being iterated over.
 * @param {ListItem<TData>} node - The list item associated with the current item.
 * @param {List<TData>} list - The list being iterated over.
 * @returns {TResult} The result of the function.
 */
export type IteratorFn<TData, TResult, TContext = List<TData>> = (
    this: TContext,
    item: TData,
    node: ListItem<TData>,
    list: List<TData>,
) => TResult;

/**
 * A callback function used for filtering a list.
 *
 * @template TData - The type of data in the list.
 * @template TResult - The type of the result returned by the function, which must extend TData.
 * @template TContext - The type of the context object passed to the function. Defaults to List<TData>.
 *
 * @param {TData} item - The current item being iterated over.
 * @param {ListItem<TData>} node - The list item associated with the current item.
 * @param {List<TData>} list - The list being filtered.
 * @returns {boolean} Whether the item should be included in the filtered list.
 */
export type FilterFn<TData, TResult extends TData, TContext = List<TData>> = (
    this: TContext,
    item: TData,
    node: ListItem<TData>,
    list: List<TData>,
) => item is TResult;

/**
 * A callback function used for reducing a list to a single value.
 *
 * @template TData - The type of data in the list.
 * @template TValue - The type of the accumulator value.
 * @template TContext - The type of the context object passed to the function. Defaults to List<TData>.
 *
 * @param {TValue} accum - The accumulator value.
 * @param {TData} data - The current item being iterated over.
 * @param {ListItem<TData>} node - The list item associated with the current item.
 * @param {List<TData>} list - The list being reduced.
 * @returns {TValue} The new accumulator value.
 */
export type ReduceFn<TData, TValue, TContext = List<TData>> = (this: TContext, accum: TValue, data: TData) => TValue;

/**
 * A doubly linked list implementation.
 *
 * ```plaintext
 *                                 list
 *                               ┌──────┐
 *                ┌──────────────┼─head │
 *                │              │ tail─┼─────────────┐
 *                │              └──────┘             │
 *                ▼                                   ▼
 *              item        item        item        item
 *            ┌──────┐    ┌──────┐    ┌──────┐    ┌──────┐
 *    null <──┼─prev │<───┼─prev │<───┼─prev │<───┼─prev │
 *            │ next─┼───>│ next─┼───>│ next─┼───>│ next─┼──> null
 *            ├──────┤    ├──────┤    ├──────┤    ├──────┤
 *            │ data │    │ data │    │ data │    │ data │
 *            └──────┘    └──────┘    └──────┘    └──────┘
 * ```
 *
 * @template TData - The type of data stored in the list elements.
 */
export class List<TData> {
    /**
     * Creates a new empty linked list.
     */
    constructor();

    /**
     * Static factory method for creating list items.
     *
     * @param data Item data.
     * @returns
     */
    static createItem<TData>(data: TData): ListItem<TData>;

    /**
     * Gets the number of items in the list.
     *
     * @returns {number} The number of items in the list.
     */
    get size(): number;

    /**
     * Checks if the list is empty.
     *
     * @returns {boolean} True if the list is empty, false otherwise.
     */
    get isEmpty(): boolean;

    /**
     * Gets the first item in the list.
     *
     * @returns {TData | null} The first item in the list, or null if the list is empty.
     */
    get first(): TData | null;

    /**
     * Gets the last item in the list.
     *
     * @returns {TData | null} The last item in the list, or null if the list is empty.
     */
    get last(): TData | null;

    /**
     * Returns an iterator for the list.
     *
     * @returns {IterableIterator<TData>} An iterator for the list.
     */
    [Symbol.iterator](): IterableIterator<TData>;

    /**
     * Creates a new list from an array.
     *
     * @param {TData[]} array - The array to create the list from.
     * @returns {List<TData>} The new list.
     */
    fromArray(array: TData[]): List<TData>;

    /**
     * Creates a new list item.
     *
     * @param {TData} data - The data to store in the item.
     * @returns {ListItem<TData>} The new list item.
     */
    createItem(data: TData): ListItem<TData>;

    /**
     * Converts the list to an array.
     *
     * @returns {TData[]} The list as an array.
     */
    toArray(): TData[];

    /**
     * Converts the list to a JSON array.
     *
     * @returns {TData[]} The list as a JSON array.
     */
    toJSON(): TData[];

    /**
     * Iterates over each item in the list, calling the provided callback function for each item.
     *
     * @template TContext - The type of the context object passed to the callback function.
     *
     * @param {IteratorFn<TData, void, TContext>} fn - The callback function to be called for each item.
     * @param {TContext} context - The context object to be passed to the callback function.
     */
    forEach<TContext>(fn: IteratorFn<TData, void, TContext>, context: TContext): void;
    forEach(fn: IteratorFn<TData, void>): void;

    /**
     * Iterates over each item in the list, starting from the end and moving towards the beginning, calling the provided callback function for each item.
     *
     * @template TContext - The type of the context object passed to the callback function.
     *
     * @param {IteratorFn<TData, void, TContext>} fn - The callback function to be called for each item.
     * @param {TContext} context - The context object to be passed to the callback function.
     */
    forEachRight<TContext>(fn: IteratorFn<TData, void, TContext>, context: TContext): void;
    forEachRight(fn: IteratorFn<TData, void>): void;

    /**
     * Iterates over the items in the list starting from the specified item until the provided callback function returns true.
     *
     * @template TContext - The type of the context object passed to the callback function.
     *
     * @param {ListItem<TData>} start - The starting item for the iteration.
     * @param {IteratorFn<TData, boolean, TContext>} fn - The callback function to be called for each item.
     * @param {TContext} context - The context object to be passed to the callback function.
     */
    nextUntil<TContext>(start: ListItem<TData>, fn: IteratorFn<TData, boolean, TContext>, context: TContext): void;
    nextUntil(start: ListItem<TData>, fn: IteratorFn<TData, boolean>): void;

    /**
     * Iterates over the items in the list starting from the specified item and moving towards the beginning until the provided callback function returns true.
     *
     * @template TContext - The type of the context object passed to the callback function.
     *
     * @param {ListItem<TData>} start - The starting item for the iteration.
     * @param {IteratorFn<TData, boolean, TContext>} fn - The callback function to be called for each item.
     * @param {TContext} context - The context object to be passed to the callback function.
     */
    prevUntil<TContext>(start: ListItem<TData>, fn: IteratorFn<TData, boolean, TContext>, context: TContext): void;
    prevUntil(start: ListItem<TData>, fn: IteratorFn<TData, boolean>): void;

    /**
     * Reduces the list to a single value.
     *
     * @template TValue - The type of the accumulator value.
     * @template TContext - The type of the context object passed to the callback function.
     *
     * @param {ReduceFn<TData, TValue, TContext>} fn - The callback function to be called for each item.
     * @param {TValue} initialValue - The initial value of the accumulator.
     * @param {TContext} context - The context object to be passed to the callback function.
     * @returns {TValue} The final value of the accumulator.
     */
    reduce<TValue, TContext>(fn: ReduceFn<TData, TValue, TContext>, initialValue: TValue, context: TContext): TValue;
    reduce<TValue>(fn: ReduceFn<TData, TValue>, initialValue: TValue): TValue;

    /**
     * Reduces the list to a single value, starting from the end and moving towards the beginning.
     *
     * @template TValue - The type of the accumulator value.
     * @template TContext - The type of the context object passed to the callback function.
     *
     * @param {ReduceFn<TData, TValue, TContext>} fn - The callback function to be called for each item.
     * @param {TValue} initialValue - The initial value of the accumulator.
     * @param {TContext} context - The context object to be passed to the callback function.
     * @returns {TValue} The final value of the accumulator.
     */
    reduceRight<TValue, TContext>(
        fn: ReduceFn<TData, TValue, TContext>,
        initialValue: TValue,
        context: TContext,
    ): TValue;
    reduceRight<TValue>(fn: ReduceFn<TData, TValue>, initialValue: TValue): TValue;

    /**
     * Checks if at least one item in the list satisfies the provided callback function.
     *
     * @template TContext - The type of the context object passed to the callback function.
     *
     * @param {IteratorFn<TData, boolean, TContext>} fn - The callback function to be called for each item.
     * @param {TContext} context - The context object to be passed to the callback function.
     * @returns {boolean} True if at least one item satisfies the callback function, false otherwise.
     */
    some<TContext>(fn: IteratorFn<TData, boolean, TContext>, context: TContext): boolean;
    some(fn: IteratorFn<TData, boolean>): boolean;

    /**
     * Creates a new list by applying the provided callback function to each item in the current list.
     *
     * @template TContext - The type of the context object passed to the callback function.
     * @template TResult - The type of the elements in the new list.
     *
     * @param {IteratorFn<TData, TResult, TContext>} fn - The callback function to be called for each item.
     * @param {TContext} context - The context object to be passed to the callback function.
     * @returns {List<TResult>} The new list containing the transformed elements.
     */
    map<TContext, TResult>(fn: IteratorFn<TData, TResult, TContext>, context: TContext): List<TResult>;
    map<TResult>(fn: IteratorFn<TData, TResult>): List<TResult>;

    /**
     * Creates a new list containing only the items from the current list that satisfy the provided callback function.
     *
     * @template TContext - The type of the context object passed to the callback function.
     * @template TResult - The type of the elements in the new list, which must extend TData.
     *
     * @param {FilterFn<TData, TResult, TContext>} fn - The callback function to be called for each item.
     * @param {TContext} context - The context object to be passed to the callback function.
     * @returns {List<TResult>} The new list containing the filtered elements.
     */
    filter<TContext, TResult extends TData>(fn: FilterFn<TData, TResult, TContext>, context: TContext): List<TResult>;
    filter<TResult extends TData>(fn: FilterFn<TData, TResult>): List<TResult>;
    /**
     * Creates a new list containing only the items from the current list that satisfy the provided callback function.
     *
     * @template TContext - The type of the context object passed to the callback function.
     *
     * @param {IteratorFn<TData, boolean, TContext>} fn - The callback function to be called for each item.
     * @param {TContext} context - The context object to be passed to the callback function.
     * @returns {List<TData>} The new list containing the filtered elements.
     */
    filter<TContext>(fn: IteratorFn<TData, boolean, TContext>, context: TContext): List<TData>;
    filter(fn: IteratorFn<TData, boolean>): List<TData>;


    /**
     * Removes all items from the list.
     */
    clear(): void;

    /**
     * Creates a copy of the list.
     *
     * @returns {List<TData>} A copy of the list.
     */
    copy(): List<TData>;

    /**
     * Inserts an item at the beginning of the list.
     *
     * @param {ListItem<TData>} item - The item to insert.
     * @returns {List<TData>} The list itself.
     */
    prepend(item: ListItem<TData>): List<TData>;

    /**
     * Inserts a new item at the beginning of the list.
     *
     * @param {TData} data - The data for the new item.
     * @returns {List<TData>} The list itself.
     */
    prependData(data: TData): List<TData>;

    /**
     * Inserts an item at the end of the list.
     *
     * @param {ListItem<TData>} item - The item to insert.
     * @returns {List<TData>} The list itself.
     */
    append(item: ListItem<TData>): List<TData>;

    /**
     * Inserts a new item at the end of the list.
     *
     * @param {TData} data - The data for the new item.
     * @returns {List<TData>} The list itself.
     */
    appendData(data: TData): List<TData>;

    /**
     * Inserts an item before the specified item in the list.
     *
     * @param {ListItem<TData>} item - The item to insert.
     * @param {ListItem<TData>} before - The item before which to insert the new item.
     * @returns {List<TData>} The list itself.
     */
    insert(item: ListItem<TData>, before: ListItem<TData>): List<TData>;

    /**
     * Inserts a new item before the specified item in the list.
     *
     * @param {TData} data - The data for the new item.
     * @param {ListItem<TData>} before - The item before which to insert the new item.
     * @returns {List<TData>} The list itself.
     */
    insertData(data: TData, before: ListItem<TData>): List<TData>;

    /**
     * Removes an item from the list.
     *
     * @param {ListItem<TData>} item - The item to remove.
     * @returns {ListItem<TData>} The removed item, or null if the item was not found.
     */
    remove(item: ListItem<TData>): ListItem<TData>;

    /**
     * Adds an item to the end of the list.
     *
     * @param {TData} item - The item to add.
     */
    push(item: TData): void;

    /**
     * Removes the last item from the list and returns it.
     *
     * @returns {ListItem<TData> | undefined} The removed item, or undefined if the list is empty.
     */
    pop(): ListItem<TData> | undefined;

    /**
     * Adds an item to the beginning of the list.
     *
     * @param {TData} data - The data for the new item.
     */
    unshift(data: TData): void;

    /**
     * Removes the first item from the list and returns it.
     *
     * @returns {ListItem<TData> | undefined} The removed item, or undefined if the list is empty.
     */
    shift(): ListItem<TData> | undefined;

    /**
     * Inserts a list at the beginning of this list.
     *
     * @param {List<TData>} list - The list to insert.
     * @returns {List<TData>} The list itself.
     */
    prependList(list: List<TData>): List<TData>;

    /**
     * Inserts a list at the end of this list.
     *
     * @param {List<TData>} list - The list to insert.
     * @returns {List<TData>} The list itself.
     */
    appendList(list: List<TData>): List<TData>;

    /**
     * Inserts a list before the specified item in this list.
     *
     * @param {List<TData>} list - The list to insert.
     * @param {ListItem<TData>} before - The item before which to insert the new list.
     * @returns {List<TData>} The list itself.
     */
    insertList(list: List<TData>, before: ListItem<TData>): List<TData>;

    /**
     * Replaces an item in the list with another item or list.
     *
     * @param {ListItem<TData>} oldItem - The item to replace.
     * @param {List<TData> | ListItem<TData>} newItemOrList - The new item or list to insert.
     * @returns {List<TData>} The list itself.
     */
    replace(oldItem: ListItem<TData>, newItemOrList: List<TData> | ListItem<TData>): List<TData>;
}

// ----------------------------------------------------------
// CSS Nodes
// ----------------------------------------------------------

export interface CssNodeCommon {
    type: string;
    loc?: CssLocationRange | null;
}

export interface CssParentNodeCommon<T extends CssNode = CssNode> extends CssNodeCommon {
    children: List<T>;
}

export interface CssParentNodeCommonPlain<T extends CssNodePlain = CssNodePlain> extends CssNodeCommon {
    children: T[];
}

export interface CssOptionalParentNodeCommon<T extends CssNode = CssNode> extends CssNodeCommon {
    children: List<T> | null;
}

export interface CssOptionalParentNodeCommonPlain<T extends CssNodePlain = CssNodePlain> extends CssNodeCommon {
    children: T[] | null;
}

export interface AnPlusB extends CssNodeCommon {
    type: "AnPlusB";
    a: string | null;
    b: string | null;
}

export interface Atrule extends CssNodeCommon {
    type: "Atrule";
    name: string;
    prelude: AtrulePrelude | Raw | null;
    block: Block | null;
}

export interface AtrulePlain extends CssNodeCommon {
    type: "Atrule";
    name: string;
    prelude: AtrulePreludePlain | Raw | null;
    block: BlockPlain | null;
}

export interface AtrulePrelude extends CssParentNodeCommon {
    type: "AtrulePrelude";
}

export interface AtrulePreludePlain extends CssParentNodeCommonPlain {
    type: "AtrulePrelude";
}

export interface AttributeSelector extends CssNodeCommon {
    type: "AttributeSelector";
    name: Identifier;
    matcher: string | null;
    value: StringNode | Identifier | null;
    flags: string | null;
}

export interface Block extends CssParentNodeCommon {
    type: "Block";
}

export interface BlockPlain extends CssParentNodeCommonPlain {
    type: "Block";
}

export interface Brackets extends CssParentNodeCommon {
    type: "Brackets";
}

export interface BracketsPlain extends CssParentNodeCommonPlain {
    type: "Brackets";
}

export interface CDC extends CssNodeCommon {
    type: "CDC";
}

export interface CDO extends CssNodeCommon {
    type: "CDO";
}

export interface ClassSelector extends CssNodeCommon {
    type: "ClassSelector";
    name: string;
}

export interface Combinator extends CssNodeCommon {
    type: "Combinator";
    name: string;
}

export interface Comment extends CssNodeCommon {
    type: "Comment";
    value: string;
}

export interface Condition extends CssParentNodeCommon {
    type: "Condition";
    kind: string;
}

export interface ConditionPlain extends CssParentNodeCommonPlain {
    type: "Condition";
    kind: string;
}

export interface Declaration extends CssNodeCommon {
    type: "Declaration";
    important: boolean | string;
    property: string;
    value: Value | Raw;
}

export interface DeclarationPlain extends CssNodeCommon {
    type: "Declaration";
    important: boolean | string;
    property: string;
    value: ValuePlain | Raw;
}

export interface DeclarationList extends CssParentNodeCommon {
    type: "DeclarationList";
}

export interface DeclarationListPlain extends CssParentNodeCommonPlain {
    type: "DeclarationList";
}

export interface Dimension extends CssNodeCommon {
    type: "Dimension";
    value: string;
    unit: string;
}

export interface Feature extends CssNodeCommon {
    type: "Feature";
    name: string;
    kind: string;
    value: Identifier | NumberNode | Dimension | Ratio | FunctionNode | null;
}

export interface FeatureFunction extends CssNodeCommon {
    type: "FeatureFunction";
    feature: string;
    kind: string;
    value: Declaration | Selector;
}

export interface FeatureFunctionPlain extends CssNodeCommon {
    type: "FeatureFunction";
    feature: string;
    kind: string;
    value: DeclarationPlain | SelectorPlain;
}

export interface FeatureRange extends CssNodeCommon {
    type: "FeatureRange";
    kind: string;
    left: Identifier | NumberNode | Dimension | Ratio | FunctionNode;
    leftComparison: string;
    middle: Identifier | NumberNode | Dimension | Ratio | FunctionNode;
    rightComparison: string | null;
    right: Identifier | NumberNode | Dimension | Ratio | FunctionNode | null;
}

export interface FunctionNode extends CssParentNodeCommon {
    type: "Function";
    name: string;
}

export interface FunctionNodePlain extends CssParentNodeCommonPlain {
    type: "Function";
    name: string;
}

export interface Hash extends CssNodeCommon {
    type: "Hash";
    value: string;
}

export interface IdSelector extends CssNodeCommon {
    type: "IdSelector";
    name: string;
}

export interface Identifier extends CssNodeCommon {
    type: "Identifier";
    name: string;
}

export interface Layer extends CssNodeCommon {
    type: "Layer";
    name: string;
}

export interface LayerList extends CssParentNodeCommon<Layer> {
    type: "LayerList";
}

export interface LayerListPlain extends CssParentNodeCommonPlain<Layer> {
    type: "LayerList";
}

export interface MediaFeature extends CssNodeCommon {
    type: "MediaFeature";
    name: string;
    value: Identifier | NumberNode | Dimension | Ratio | null;
}

export interface MediaQuery extends CssParentNodeCommon {
    type: "MediaQuery";
}

export interface MediaQueryPlain extends CssParentNodeCommonPlain {
    type: "MediaQuery";
}

export interface MediaQueryList extends CssParentNodeCommon<MediaQuery> {
    type: "MediaQueryList";
}

export interface MediaQueryListPlain extends CssParentNodeCommonPlain<MediaQueryPlain> {
    type: "MediaQueryList";
}

export interface NestingSelector extends CssNodeCommon {
    type: "NestingSelector";
}

export interface Nth extends CssNodeCommon {
    type: "Nth";
    nth: AnPlusB | Identifier;
    selector: SelectorList | null;
}

export interface NthPlain extends CssNodeCommon {
    type: "Nth";
    nth: AnPlusB | Identifier;
    selector: SelectorListPlain | null;
}

export interface NumberNode extends CssNodeCommon {
    type: "Number";
    value: string;
}

export interface Operator extends CssNodeCommon {
    type: "Operator";
    value: string;
}

export interface Parentheses extends CssParentNodeCommon {
    type: "Parentheses";
}

export interface ParenthesesPlain extends CssParentNodeCommonPlain {
    type: "Parentheses";
}

export interface Percentage extends CssNodeCommon {
    type: "Percentage";
    value: string;
}

export interface PseudoClassSelector extends CssOptionalParentNodeCommon {
    type: "PseudoClassSelector";
    name: string;
}

export interface PseudoClassSelectorPlain extends CssOptionalParentNodeCommonPlain {
    type: "PseudoClassSelector";
    name: string;
}

export interface PseudoElementSelector extends CssOptionalParentNodeCommon {
    type: "PseudoElementSelector";
    name: string;
}

export interface PseudoElementSelectorPlain extends CssOptionalParentNodeCommonPlain {
    type: "PseudoElementSelector";
    name: string;
}

export interface Ratio extends CssNodeCommon {
    type: "Ratio";
    left: string;
    right: string;
}

export interface Raw extends CssNodeCommon {
    type: "Raw";
    value: string;
}

export interface Rule extends CssNodeCommon {
    type: "Rule";
    prelude: SelectorList | Raw;
    block: Block;
}

export interface RulePlain extends CssNodeCommon {
    type: "Rule";
    prelude: SelectorListPlain | Raw;
    block: BlockPlain;
}

export interface Selector extends CssParentNodeCommon {
    type: "Selector";
}

export interface SelectorPlain extends CssParentNodeCommonPlain {
    type: "Selector";
}

export interface SelectorList extends CssParentNodeCommon {
    type: "SelectorList";
}

export interface SelectorListPlain extends CssParentNodeCommonPlain {
    type: "SelectorList";
}

export interface StringNode extends CssNodeCommon {
    type: "String";
    value: string;
}

export interface StyleSheet extends CssParentNodeCommon {
    type: "StyleSheet";
}

export interface SupportsDeclaration extends CssNodeCommon {
    type: "SupportsDeclaration";
    declaration: Declaration | Raw;
}

export interface StyleSheetPlain extends CssParentNodeCommonPlain {
    type: "StyleSheet";
}

export interface TypeSelector extends CssNodeCommon {
    type: "TypeSelector";
    name: string;
}

export interface UnicodeRange extends CssNodeCommon {
    type: "UnicodeRange";
    value: string;
}

export interface Url extends CssNodeCommon {
    type: "Url";
    value: string;
}

export interface Value extends CssParentNodeCommon {
    type: "Value";
}

export interface ValuePlain extends CssParentNodeCommonPlain {
    type: "Value";
}

export interface WhiteSpace extends CssNodeCommon {
    type: "WhiteSpace";
    value: string;
}

/* IMPORTANT! If you update this, also update `CssNodePlain` */
export type CssNode =
    | AnPlusB
    | Atrule
    | AtrulePrelude
    | AttributeSelector
    | Block
    | Brackets
    | CDC
    | CDO
    | ClassSelector
    | Combinator
    | Comment
    | Condition
    | Declaration
    | DeclarationList
    | Dimension
    | Feature
    | FeatureFunction
    | FeatureRange
    | FunctionNode
    | Hash
    | IdSelector
    | Identifier
    | Layer
    | LayerList
    | MediaFeature
    | MediaQuery
    | MediaQueryList
    | NestingSelector
    | Nth
    | NumberNode
    | Operator
    | Parentheses
    | Percentage
    | PseudoClassSelector
    | PseudoElementSelector
    | Ratio
    | Raw
    | Rule
    | Selector
    | SelectorList
    | StringNode
    | StyleSheet
    | SupportsDeclaration
    | TypeSelector
    | UnicodeRange
    | Url
    | Value
    | WhiteSpace;

/* IMPORTANT! If you update this, also update `CssNode` */
export type CssNodePlain =
    | AnPlusB
    | AtrulePlain
    | AtrulePreludePlain
    | AttributeSelector
    | BlockPlain
    | BracketsPlain
    | CDC
    | CDO
    | ClassSelector
    | Combinator
    | Comment
    | ConditionPlain
    | DeclarationPlain
    | DeclarationListPlain
    | Dimension
    | Feature
    | FeatureFunctionPlain
    | FeatureRange
    | FunctionNodePlain
    | Hash
    | IdSelector
    | Identifier
    | Layer
    | LayerListPlain
    | MediaFeature
    | MediaQueryPlain
    | MediaQueryListPlain
    | NestingSelector
    | NthPlain
    | NumberNode
    | Operator
    | ParenthesesPlain
    | Percentage
    | PseudoClassSelectorPlain
    | PseudoElementSelectorPlain
    | Ratio
    | Raw
    | RulePlain
    | SelectorPlain
    | SelectorListPlain
    | StringNode
    | StyleSheetPlain
    | SupportsDeclaration
    | TypeSelector
    | UnicodeRange
    | Url
    | ValuePlain
    | WhiteSpace;

type CssNodeNames = CssNode["type"];

type AnyCssNode = CssNode | CssNodePlain;

// ----------------------------------------------------------
// Tokenizer
// https://github.com/csstree/csstree/tree/master/lib/tokenizer
// ----------------------------------------------------------

type ReadonlyRecord<K extends keyof any, T> = Readonly<Record<K, T>>;

/**
 * A dictionary mapping token names (strings) to their corresponding numeric token types.
 */
export const tokenTypes: ReadonlyRecord<string, number>;

/**
 * An array containing all the possible token names as strings, indexed by their numeric token types.
 */
export const tokenNames: ReadonlyArray<string>;

/**
 * A callback function used during tokenization. It takes three arguments:
 *
 * @param token - The numeric type of the current token.
 * @param start - The starting index of the token in the source string.
 * @param end - The ending index (exclusive) of the token in the source string.
 */
export type CssTokenizerCallback = (token: number, start: number, end: number) => void;

/**
 * Represents the API for iterating over tokens in a CSS source string.
 */
export interface TokenIterateAPI {
    /**
     * The name of the file being parsed.
     */
    filename: string;

    /**
     * The CSS source string being tokenized.
     */
    source: string;

    /**
     * The total number of tokens in the stream.
     */
    tokenCount: number;

    /**
     * Gets the type of the token at the specified index.
     *
     * @param index - The index of the token.
     * @returns The numeric type of the token.
     */
    getTokenType(index: number): number;

    /**
     * Gets the name of the token type at the specified index.
     *
     * @param index - The index of the token.
     * @returns The string name of the token type.
     */
    getTokenTypeName(index: number): string;

    /**
     * Gets the start position of the token at the specified index.
     *
     * @param index - The index of the token.
     * @returns The starting character position of the token.
     */
    getTokenStart(index: number): number;

    /**
     * Gets the end position of the token at the specified index.
     *
     * @param index - The index of the token.
     * @returns The ending character position of the token.
     */
    getTokenEnd(index: number): number;

    /**
     * Gets the value of the token at the specified index.
     *
     * @param index - The index of the token.
     * @returns The string value of the token.
     */
    getTokenValue(index: number): string;

    /**
     * Gets a substring from the source string.
     *
     * @param start - The starting index.
     * @param end - The ending index.
     * @returns The substring from the source.
     */
    substring(start: number, end: number): string;

    /**
     * A Uint32Array containing balance information for tokens.
     */
    balance: Uint32Array;

    /**
     * Checks if a token type represents a block opener.
     *
     * @param type - The token type to check.
     * @returns True if the token type is a block opener.
     */
    isBlockOpenerTokenType(type: number): boolean;

    /**
     * Checks if a token type represents a block closer.
     *
     * @param type - The token type to check.
     * @returns True if the token type is a block closer.
     */
    isBlockCloserTokenType(type: number): boolean;

    /**
     * Gets the index of the matching pair token for a block token.
     *
     * @param index - The index of the block token.
     * @returns The index of the matching pair token.
     */
    getBlockTokenPairIndex(index: number): number;

    /**
     * Gets the location information for a position in the source.
     *
     * @param offset - The character offset in the source.
     * @returns The location information.
     */
    getLocation(offset: number): CssLocation;

    /**
     * Gets the location range information for a range in the source.
     *
     * @param start - The starting offset.
     * @param end - The ending offset.
     * @returns The location range information.
     */
    getRangeLocation(start: number, end: number): CssLocationRange;
}

/**
 * A function used to tokenize CSS source code.
 *
 * @param css - The CSS source code to tokenize.
 * @param onToken - The callback function to be called for each token found in the source code.
 */
export type TokenizeFunction = (css: string, onToken: CssTokenizerCallback) => void;

/**
 * Tokenizes a CSS source code string.
 *
 * @param css - The CSS source code to tokenize.
 * @param onToken - The callback function to be called for each token found in the source code.
 */
export const tokenize: TokenizeFunction;

export interface TokenStreamDumpEntry {
    idx: number;
    type: string;
    chunk: string;
    balance: number;
}

export type TokenStreamDump = TokenStreamDumpEntry[];

export type TokenStreamIteratorFunction = (token: number, start: number, end: number, index: number) => void;

export type TokenStreamConsumeStopFunction = (charCode: number) => number;

/**
 * This class represents a stream of tokens generated from a CSS string.
 */
export class TokenStream {
    /**
     * The original CSS source string.
     */
    readonly source: string;

    /**
     * The offset of the first character in the source string (usually 0).
     */
    readonly firstCharOffset: number;

    /**
     * A boolean flag indicating whether the end of the stream has been reached.
     */
    readonly eof: boolean;

    /**
     * The total number of tokens in the stream.
     */
    readonly tokenCount: number;

    /**
     * The index of the current token in the stream (starts at -1 before `next()` is called).
     */
    readonly tokenIndex: number;

    /**
     * The numeric type of the current token.
     */
    readonly tokenType: number;

    /**
     * The starting index of the current token in the source string.
     */
    readonly tokenStart: number;

    /**
     * The ending index (exclusive) of the current token in the source string.
     */
    readonly tokenEnd: number;

    /**
     * An internal buffer used for managing balance between opening and closing tokens.
     */
    readonly balance: Uint32Array;

    /**
     * An internal buffer used for storing token information, including type and offset.
     * The 32-bit integer at each index contains two pieces of information:
     * - The starting index (inclusive) of the token within the source string is stored in the lower 24 bits of the 32-bit integer.
     * - The numeric type of the token is stored in the upper 8 bits of the 32-bit integer.
     */
    readonly offsetAndType: Uint32Array;

    /**
     * Creates a new token stream from a CSS source string.
     *
     * @param source - The CSS source code to tokenize.
     * @param tokenize - The tokenizer function to use.
     */
    constructor(source: string, tokenize: TokenizeFunction);

    /**
     * Resets the stream to its initial state (all properties set to their default values).
     */
    reset(): void;

    /**
     * Sets a new source string and optionally a new tokenize function for the stream.
     *
     * @param source - The new CSS source code to tokenize.
     * @param tokenize - The new tokenizer function to use.
     */
    setSource(source?: string, tokenize?: TokenizeFunction): void;

    /**
     * Returns the numeric type of the token at a specific offset (relative to the current position).
     *
     * @param offset - The offset of the token to look up.
     * @returns The numeric type of the token at the specified offset.
     */
    lookupType(offset: number): number;

    /**
     * Returns the numeric type of the idx-th non-whitespace/comment token in the TokenStream. This method skips whitespace and comment tokens until it finds the specified non-whitespace/comment token.
     *
     * @param index - The index of the non-whitespace/comment token to look up (starting from 0).
     * @returns The numeric type of the idx-th non-whitespace/comment token, or EOF if the index is out of bounds or if the end of the stream is reached before the specified token is found.
     */
    lookupTypeNonSC(index: number): number;

    /**
     * Returns the starting index (inclusive) of the token at a specific offset (relative to the current position) within the TokenStream.
     *
     * @param offset - The offset from the current token's starting index. A positive offset indicates a position later in the stream, while a negative offset indicates a position earlier in the stream.
     * @returns The starting index of the token at the specified offset, or the length of the source string if the offset is out of bounds.
     */
    lookupOffset(offset: number): number;

    /**
     * Returns the starting index (inclusive) of the `idx`-th non-whitespace/comment token in the `TokenStream`. This method skips whitespace and comment tokens until it finds the specified non-whitespace/comment token.
     *
     * @param index - The index of the non-whitespace/comment token to look up (starting from 0).
     * @returns The starting index of the `idx`-th non-whitespace/comment token, or `EOF` if the index is out of bounds or if the end of the stream is reached before the specified token is found.
     */
    lookupOffsetNonSC(index: number): number;

    /**
     * Compares the value of the token at a specific offset with a given reference string and returns true if they match.
     *
     * @param offset - The offset from the current token's starting index. A positive offset indicates a position later in the stream, while a negative offset indicates a position earlier in the stream.
     * @param referenceStr - The reference string to compare with the token value.
     * @returns True if the token value matches the reference string, false otherwise.
     */
    lookupValue(offset: number, referenceStr: string): boolean;

    /**
     * Returns the starting index (inclusive) of the token at a specific index in the `TokenStream`.
     *
     * @param tokenIndex - The index of the token to look up (starting from 0).
     * @returns The starting index of the token at the specified index, or `EOF` if the index is out of bounds.
     */
    getTokenStart(tokenIndex: number): number;

    /**
     * Returns the substring of the source string from the specified starting index to the current token's starting index.
     *
     * @param start The starting index of the substring.
     * @returns The extracted substring.
     */
    substrToCursor(start: number): string;

    /**
     * Checks if the current position is at the edge of a balanced block (e.g., before an opening parenthesis).
     *
     * @param pos - The position to check.
     * @returns True if the position is at a balance edge, false otherwise.
     */
    isBalanceEdge(pos: number): boolean;

    /**
     * Checks if the current token (or the token at a specific offset) is a delimiter with a specific character code.
     *
     * @param code - The character code to check for.
     * @param offset - The offset from the current token's starting index (optional). If provided, the function checks the token at the specified offset instead of the current token.
     * @returns True if the token is a delimiter with the specified character code, false otherwise.
     */
    isDelim(code: number, offset?: number): boolean;

    /**
     * Skips a specified number of tokens forward in the stream.
     *
     * @param tokenCount - The number of tokens to skip.
     */
    skip(tokenCount: number): void;

    /**
     * Moves the stream forward to the next token.
     */
    next(): void;

    /**
     * Skips any whitespace or comment tokens until encountering a non-whitespace/comment token.
     */
    skipSC(): void;

    /**
     * Skips tokens until a balanced block is reached, optionally stopping at a specified condition.
     *
     * @param startToken - The index of the starting token of the balanced block.
     * @param stopConsume - A function that determines whether to stop skipping tokens. It should take a character code as input and return:
     *   - 1: Stop skipping immediately.
     *   - 2: Stop skipping and include the current token.
     *   - 0: Continue skipping.
     */
    skipUntilBalanced(startToken: number, stopConsume: TokenStreamConsumeStopFunction): void;

    /**
     * Iterates over each token in the stream and calls the provided function for each token.
     *
     * @param fn - The function to be called for each token. It should take the following arguments:
     *   - token: The numeric type of the token.
     *   - start: The starting index of the token in the source string.
     *   - end: The ending index (exclusive) of the token in the source string.
     *   - index: The index of the token in the stream.
     */
    forEachToken(fn: TokenStreamIteratorFunction): void;

    /**
     * Dumps the token stream data.
     *
     * @returns An array of token stream entries.
     */
    dump(): TokenStreamDump;
}

/**
 * A class that maps offsets within a source string to their corresponding line and column numbers.
 */
export class OffsetToLocation {
    /**
     * Sets the source string and optionally the starting offset, line, and column.
     *
     * @param source - The source string.
     * @param startOffset The offset of the first character in the source string (default: 0).
     * @param startLine - The line number of the first character in the source string (default: 1).
     * @param startColumn - The column number of the first character in the source string (default: 1).
     */
    setSource(source: string, startOffset?: number, startLine?: number, startColumn?: number): void;

    /**
     * Gets the line and column numbers for a given offset within the source string.
     *
     * @param offset - The offset within the source string.
     * @param filename - The filename associated with the source string (optional).
     * @returns A {@link CssLocation} object containing the line and column numbers.
     */
    getLocation(offset: number, filename?: string): CssLocation;

    /**
     * Gets the line and column numbers for a range of offsets within the source string.
     *
     * @param start - The starting offset within the source string.
     * @param end - The ending offset within the source string (exclusive).
     * @param filename - The filename associated with the source string (optional).
     * @returns A {@link CssLocationRange} object containing the line and column numbers for the start and end positions.
     */
    getLocationRange(start: number, end: number, filename?: string): CssLocationRange;
}

// ----------------------------------------------------------
// Parser
// https://github.com/csstree/csstree/tree/master/lib/parser
// ----------------------------------------------------------

/**
 * Represents an error that occurs during CSS parsing. Extends the standard `SyntaxError`
 * to include additional details about the parsing error.
 */

/**
 * Represents a syntax error while parsing CSS code. In the actual code,
 * this is called `SyntaxError`, but that clashes with the global `SyntaxError` class.
 * This isn't exported separately but rather as a member of the `parse` function.
 */
export interface SyntaxParseError extends SyntaxError {

    /**
     * The source code where the error occurred.
     */
    source: string;

    /**
     * The character offset in the source code where the error occurred.
     */
    offset: number;

    /**
     * The line number (1-indexed) in the source code where the error occurred.
     */
    line: number;

    /**
     * The column number (1-indexed) in the source code where the error occurred.
     */
    column: number;

    /**
     * The source code fragment around the error, including a specified number of extra lines.
     * @param extraLines The number of extra lines to include in the fragment.
     * @return A string containing the source code fragment around the error.
     * This fragment includes the error line and the specified number of lines before and after it.
     */
    sourceFragment(extraLines: number): string;

    /**
     * The error message formatted with the source fragment.
     */
    readonly formattedMessage: string;
}

/**
 * A callback function invoked when a comment is encountered during parsing.
 *
 * @param value - The content of the comment.
 * @param loc - The location range of the comment in the source input.
 */
export type OnParseCommentCallback = (value: string, loc: CssLocationRange) => void;

/**
 * A callback function invoked when a parsing error occurs.
 *
 * @param error - The parsing error details as a `SyntaxParseError`.
 * @param fallbackNode - A fallback `CssNode` that can be used in place of the invalid input.
 */
export type OnParseErrorCallback = (error: SyntaxParseError, fallbackNode: CssNode) => void;

/**
 * A callback function invoked for each token encountered during parsing.
 *
 * @param token - The numeric type of the token.
 * @param start - The starting index of the token in the source string.
 * @param end - The ending index (exclusive) of the token in the source string.
 * @param index - The index of the token in the stream.
 */
export type OnTokenCallback = (this: TokenIterateAPI, token: number, start: number, end: number, index: number) => void;

/**
 * Options for controlling the behavior of the CSS parser.
 */
export interface ParseOptions {
    /**
     * The parsing context (e.g., "stylesheet", "value").
     */
    context?: string | undefined;

    /**
     * The at-rule name for parsing its prelude.
     */
    atrule?: string | undefined;

    /**
     * Whether to include position information in the parsed nodes.
     */
    positions?: boolean | undefined;

    /**
     * A callback function invoked for each comment encountered during parsing.
     */
    onComment?: OnParseCommentCallback;

    /**
     * A callback function invoked for handling parsing errors.
     */
    onParseError?: OnParseErrorCallback;

    /**
     * A callback function invoked for each token encountered during parsing.
     */
    onToken?: OnTokenCallback;

    /**
     * The name of the file being parsed, used for error reporting.
     */
    filename?: string | undefined;

    /**
     * The character offset to start parsing from in the input string.
     */
    offset?: number | undefined;

    /**
     * The line number to start parsing from in the input string.
     */
    line?: number | undefined;

    /**
     * The column number to start parsing from in the input string.
     */
    column?: number | undefined;

    /**
     * Whether to parse the prelude of at-rules.
     */
    parseAtrulePrelude?: boolean | undefined;

    /**
     * Whether to parse the prelude of rules.
     */
    parseRulePrelude?: boolean | undefined;

    /**
     * Whether to parse CSS values.
     */
    parseValue?: boolean | undefined;

    /**
     * Whether to parse custom property values.
     */
    parseCustomProperty?: boolean | undefined;
}

/**
 * Creates a new instance of a parse error.
 * @param message The error message describing the syntax error.
 * @param source The source code where the error occurred.
 * @param offset The character offset in the source code where the error occurred.
 * @param line The line number (1-indexed) in the source code where the error occurred.
 * @param column The column number (1-indexed) in the source code where the error occurred.
 * @param baseLine The base line number (1-indexed) for the error, used for relative positioning.
 * @param baseColumn The base column number (1-indexed) for the error, used for relative positioning.
 */
export type SyntaxErrorCreator = (message: string, source: string, offset: number, line: number, column: number, baseLine?: number, baseColumn?: number) => SyntaxParseError;

/**
 * A function that parses a CSS string into an abstract syntax tree (AST).
 */
export interface ParseFunction {

    /**
     * Parses a CSS source string into an abstract syntax tree (AST).
     * @param source - The CSS source string to parse.
     * @param options - Optional configuration for the parser.
     * @returns The parsed CSS as a `CssNode`.
     * @throws {CSSSyntaxError} If a parsing error occurs, this error will be thrown.
     */
    (source: string, options?: ParseOptions): CssNode;

    /**
     * The error class used for parsing errors.
     */
    SyntaxError: SyntaxErrorCreator;

    /**
     * The configuration used by the parser.
     */
    config: ParseConfig;
}

/**
 * Parses a CSS string into an abstract syntax tree (AST).
 */
export const parse: ParseFunction;

/**
 * Represents a function that reads a sequence of CSS tokens and returns a list of nodes.
 *
 * @param recognizer - A recognizer instance to determine node boundaries.
 * @returns A list of parsed nodes.
 */
export type ReadSequenceFunction = (this: ParserContext, recognizer: Recognizer) => List<CssNode>;

// ----------------------------------------------------------
// Generator
// https://github.com/csstree/csstree/tree/master/lib/generator
// ----------------------------------------------------------

/**
 * Handlers used during the generation of a CSS string from an abstract syntax tree (AST).
 */
export interface GenerateHandlers {
    /**
     * Handles traversal of child nodes and applies a delimiter between nodes if specified.
     *
     * @param node - The current CSS node whose children are being processed.
     * @param delimiter - An optional function invoked to add a delimiter between child nodes.
     */
    children: (node: CssNode, delimiter?: (node: CssNode) => void) => void;

    /**
     * Processes an individual CSS node and adds it to the generated output.
     *
     * @param node - The current CSS node being processed.
     */
    node: (node: CssNode) => void;

    /**
     * Adds a chunk of CSS text to the generated output.
     *
     * @param chunk - The CSS string chunk to add to the output.
     */
    chunk: (chunk: string) => void;

    /**
     * Retrieves the final generated CSS string.
     *
     * @returns The generated CSS string.
     */
    result: () => string;
}

/**
 * Specifies the mode to use during CSS generation.
 * - `"safe"`: Ensures compatibility and avoids unsafe constructs.
 * - `"spec"`: Adheres strictly to the CSS specification.
 */
export type GenerateMode = "safe" | "spec";

/**
 * Options for customizing the behavior of the CSS generator.
 */
export interface GenerateOptions {
    /**
     * Whether to include source map information in the generated output.
     */
    sourceMap?: boolean | undefined;

    /**
     * A function to decorate the `GenerateHandlers`, allowing customization
     * of the behavior during CSS generation.
     *
     * @param handlers - The default `GenerateHandlers` instance.
     * @returns A modified or new `GenerateHandlers` instance.
     */
    decorator?: ((handlers: GenerateHandlers) => GenerateHandlers) | undefined;

    /**
     * The mode to use for CSS generation. Defaults to `"safe"`.
     */
    mode?: GenerateMode | undefined;
}

/**
 * A function that generates a CSS string from an abstract syntax tree (AST).
 *
 * @param ast - The CSS abstract syntax tree to generate from.
 * @param options - Optional configuration for the generator.
 * @returns The generated CSS string.
 */
export type GenerateFunction = (ast: AnyCssNode, options?: GenerateOptions) => string;

/**
 * Generates a CSS string from an abstract syntax tree (AST).
 */
export const generate: GenerateFunction;

/**
 * Represents the context object passed to a Node's `generate` function.
 * @see https://github.com/csstree/csstree/blob/56afb6dd761149099cd3cdfb0a38e15e8cc0a71a/lib/generator/create.js#L86-L91
 */
export interface GeneratorContext {
    /**
     * Tokenizes a string or node.
     * @param value - The value to tokenize.
     */
    tokenize(value: string): void;

    /**
     * Processes a child node.
     * @param node - The child node to process.
     */
    node(node: CssNode): void;

    /**
     * Processes all children of a node.
     * @param node - The parent node whose children are processed.
     */
    children(node: CssNode): void;

    /**
     * Emits a token with a specific type and value.
     * @param type - The type of the token.
     * @param value - The value of the token.
     */
    token(type: number, value: string): void;
}

// ----------------------------------------------------------
// Walker
// ----------------------------------------------------------

/**
 * Represents the context in which a tree-walking traversal occurs.
 */
export interface WalkContext {
    /**
     * Stops traversal. No visitor function will be invoked once this value is
     * returned by a visitor.
     */
    break: symbol;

    /**
     * Prevents the current node from being iterated. No visitor function will be invoked for its properties or children nodes. This value only affects
     * the `enter` visitor; the `leave` visitor is invoked after iterating
     * over all node's properties and children.
     */
    skip: symbol;

    /**
     * The root node of the tree being traversed.
     */
    root: AnyCssNode;

    /**
     * The current stylesheet node being visited, or `null` if not applicable.
     */
    stylesheet: StyleSheet | null;

    /**
     * The current at-rule node being visited, or `null` if not applicable.
     */
    atrule: Atrule | null;

    /**
     * The prelude of the current at-rule being visited, or `null` if not applicable.
     */
    atrulePrelude: AtrulePrelude | null;

    /**
     * The current rule node being visited, or `null` if not applicable.
     */
    rule: Rule | null;

    /**
     * The selector list of the current rule, or `null` if not applicable.
     */
    selector: SelectorList | null;

    /**
     * The block of the current rule or at-rule, or `null` if not applicable.
     */
    block: Block | null;

    /**
     * The current declaration node being visited, or `null` if not applicable.
     */
    declaration: Declaration | null;

    /**
     * The current function or pseudo-class/element node being visited,
     * or `null` if not applicable.
     */
    function: FunctionNode | PseudoClassSelector | PseudoElementSelector | null;
}

/**
 * A function called during tree traversal for entering or leaving a node.
 *
 * @param node - The current node being visited.
 * @param item - The list item corresponding to the current node.
 * @param list - The list containing the current node.
 */
export type EnterOrLeaveFn<NodeType = CssNode> = (
    this: WalkContext,
    node: NodeType,
    item: ListItem<CssNode>,
    list: List<CssNode>,
) => void;

/**
 * Options for controlling the tree-walking process without specifying a node type to visit.
 */
export interface WalkOptionsNoVisit {
    /**
     * A function to invoke when entering a node.
     */
    enter?: EnterOrLeaveFn | undefined;

    /**
     * A function to invoke when leaving a node.
     */
    leave?: EnterOrLeaveFn | undefined;

    /**
     * Whether to traverse the tree in reverse order.
     */
    reverse?: boolean | undefined;
}

/**
 * Options for controlling the tree-walking process with a specific node type to visit.
 *
 * @template NodeType - The specific type of node to visit.
 */
export interface WalkOptionsVisit<NodeType extends CssNode = CssNode> {
    /**
     * The type of node to visit during traversal.
     */
    visit: NodeType["type"];

    /**
     * A function to invoke when entering a node.
     */
    enter?: EnterOrLeaveFn<NodeType> | undefined;

    /**
     * A function to invoke when leaving a node.
     */
    leave?: EnterOrLeaveFn<NodeType> | undefined;

    /**
     * Whether to traverse the tree in reverse order.
     */
    reverse?: boolean | undefined;
}

/**
 * Combined options for tree-walking, supporting specific node types or general traversal options.
 */
export type WalkOptions = WalkOptionsVisit<CssNode> | WalkOptionsNoVisit;

/**
 * Walks through a CSS abstract syntax tree (AST) and invokes callback functions on nodes.
 */
export const walk: {
    /**
     * Performs a traversal of the given AST.
     *
     * @param ast - The CSS abstract syntax tree to traverse.
     * @param options - The options controlling the traversal process.
     */
    (ast: AnyCssNode, options: EnterOrLeaveFn | WalkOptions): void;

    /**
     * Stops traversal. No visitor function will be invoked once this value is returned by a visitor.
     */
    readonly break: symbol;

    /**
     * Prevents the current node from being iterated. No visitor function will be invoked for its properties or children
     * nodes. This value only affects the `enter` visitor.
     */
    readonly skip: symbol;
};

/**
 * A predicate function used to find specific nodes during tree traversal.
 *
 * @param node - The current node being visited.
 * @param item - The list item corresponding to the current node.
 * @param list - The list containing the current node.
 * @returns `true` if the node matches the condition; `false` otherwise.
 */
export type FindFn = (this: WalkContext, node: AnyCssNode, item: ListItem<CssNode>, list: List<CssNode>) => boolean;

/**
 * Finds the first node in the tree that matches the specified predicate function.
 *
 * @param ast - The CSS abstract syntax tree to search.
 * @param fn - The predicate function to match nodes.
 * @returns The first matching node, or `null` if no match is found.
 */
export function find(ast: AnyCssNode, fn: FindFn): AnyCssNode | null;

/**
 * Finds the last node in the tree that matches the specified predicate function.
 *
 * @param ast - The CSS abstract syntax tree to search.
 * @param fn - The predicate function to match nodes.
 * @returns The last matching node, or `null` if no match is found.
 */
export function findLast(ast: AnyCssNode, fn: FindFn): AnyCssNode | null;

/**
 * Finds all nodes in the tree that match the specified predicate function.
 *
 * @param ast - The CSS abstract syntax tree to search.
 * @param fn - The predicate function to match nodes.
 * @returns An array of all matching nodes.
 */
export function findAll(ast: AnyCssNode, fn: FindFn): AnyCssNode[];

// ----------------------------------------------------------
// Name utils
// https://github.com/csstree/csstree/blob/master/lib/utils/names.js
// ----------------------------------------------------------

/**
 * Represents a CSS property with detailed metadata, including vendor and custom information.
 */
export interface Property {
    /**
     * The base name of the property, excluding vendor prefixes or hacks.
     */
    readonly basename: string;

    /**
     * The full name of the property, including any vendor prefixes or hacks.
     */
    readonly name: string;

    /**
     * Any hack associated with the property (e.g., `_`, `*`, `$`).
     */
    readonly hack: string;

    /**
     * The vendor prefix of the property, if present (e.g., `-webkit-`).
     */
    readonly vendor: string;

    /**
     * The prefix used for the property, including vendor prefixes or hacks.
     */
    readonly prefix: string;

    /**
     * Indicates whether the property is a custom property (e.g., `--property-name`).
     */
    readonly custom: boolean;
}

/**
 * Parses a CSS property name and returns detailed metadata about the property.
 *
 * @param value - The CSS property name to parse.
 * @returns A `Property` object with metadata about the parsed property.
 */
export function property(value: string): Property;

/**
 * Represents a CSS keyword with detailed metadata, including vendor and custom information.
 */
export interface Keyword {
    /**
     * The base name of the keyword, excluding vendor prefixes.
     */
    readonly basename: string;

    /**
     * The full name of the keyword, including any vendor prefixes.
     */
    readonly name: string;

    /**
     * The vendor prefix of the keyword, if present (e.g., `-webkit-`).
     */
    readonly vendor: string;

    /**
     * The prefix used for the keyword, including vendor prefixes.
     */
    readonly prefix: string;

    /**
     * Indicates whether the keyword is a custom property.
     */
    readonly custom: boolean;
}

/**
 * Parses a CSS keyword and returns detailed metadata about the keyword.
 *
 * @param value - The CSS keyword to parse.
 * @returns A `Keyword` object with metadata about the parsed keyword.
 */
export function keyword(value: string): Keyword;

/**
 * Extracts the vendor prefix from a given string.
 *
 * @param str - The string to extract the vendor prefix from.
 * @param offset - The starting position in the string.
 * @returns The extracted vendor prefix, or an empty string if none exists.
 */
export function vendorPrefix(str: string, offset: number): string;

/**
 * Determines whether a given string represents a custom property.
 *
 * @param str - The string to check.
 * @param offset - The starting position in the string.
 * @returns `true` if the string represents a custom property, `false` otherwise.
 */
export function isCustomProperty(str: string, offset: number): boolean;

// ----------------------------------------------------------
// Clone
// https://github.com/csstree/csstree/blob/master/lib/utils/clone.js
// ----------------------------------------------------------

/**
 * Creates a deep copy of a CSS abstract syntax tree (AST) node.
 *
 * @param node - The `CssNode` to clone.
 * @returns A new `CssNode` instance that is a deep copy of the provided node.
 */
export function clone(node: CssNode): CssNode;

// ----------------------------------------------------------
// Convertor
// https://github.com/csstree/csstree/blob/master/lib/convertor/create.js
// ----------------------------------------------------------

export function fromPlainObject(node: CssNodePlain): CssNode;

export function toPlainObject(node: CssNode): CssNodePlain;

// ----------------------------------------------------------
// Definition syntax
// https://github.com/csstree/csstree/tree/master/lib/definition-syntax
// ----------------------------------------------------------

/**
 * Definition syntax AtWord node
 */
export interface DSNodeAtWord {
    type: "AtKeyword";
    name: string;
}

/**
 * Definition syntax Comma node
 */
export interface DSNodeComma {
    type: "Comma";
}

/**
 * Definition syntax Function node
 */
export interface DSNodeFunction {
    type: "Function";
    name: string;
}

export type DSNodeCombinator = "|" | "||" | "&&" | " ";

/**
 * Definition syntax Group node
 */
export interface DSNodeGroup {
    type: "Group";
    terms: DSNode[];
    combinator: DSNodeCombinator;
    disallowEmpty: boolean;
    explicit: boolean;
}

/**
 * Definition syntax Keyword node
 */
export interface DSNodeKeyword {
    type: "Keyword";
    name: string;
}

/**
 * Definition syntax Multiplier node
 */
export interface DSNodeMultiplier {
    type: "Multiplier";
    comma: boolean;
    min: number;
    max: number;
    term: DSNodeMultiplied;
}

/**
 * Definition syntax Property node
 */
export interface DSNodeProperty {
    type: "Property";
    name: string;
}

/**
 * Definition syntax String node
 */
export interface DSNodeString {
    type: "String";
    value: string;
}

/**
 * Definition syntax Token node
 */
export interface DSNodeToken {
    type: "Token";
    value: string;
}

/**
 * Definition syntax Type node options
 */
export interface DSNodeTypeOpts {
    type: "Range";
    min: number | null;
    max: numberhu | null;
}

/**
 * Definition syntax Type node
 */
export interface DSNodeType {
    type: "Type";
    name: string;
    opts: DSNodeTypeOpts | null;
}

/**
 * Definition syntax node
 */
export type DSNode =
    | DSNodeAtWord
    | DSNodeComma
    | DSNodeFunction
    | DSNodeGroup
    | DSNodeKeyword
    | DSNodeMultiplier
    | DSNodeProperty
    | DSNodeString
    | DSNodeToken
    | DSNodeType;

/**
 * Definition syntax node compatible with a multiplier
 */
export type DSNodeMultiplied =
    | DSNodeFunction
    | DSNodeGroup
    | DSNodeKeyword
    | DSNodeProperty
    | DSNodeString
    | DSNodeType;

/**
 * Definition syntax generate options
 */
export interface DSGenerateOptions {
    forceBraces?: boolean | undefined;
    compact?: boolean | undefined;
    decorate?: ((result: string, node: DSNode) => void) | undefined;
}

/**
 * Definition syntax walk options
 */
export interface DSWalkOptions {
    enter?: DSWalkEnterOrLeaveFn | undefined;
    leave?: DSWalkEnterOrLeaveFn | undefined;
}

/**
 * Definition syntax walk callback
 */
export type DSWalkEnterOrLeaveFn = (node: DSNode) => void;

/**
 * DefinitionSyntax
 */
export interface DefinitionSyntax {
    /**
     * Generates CSS value definition syntax from an AST
     *
     * @param node - The AST
     * @param options - Options that affect generation
     *
     * @example
     *  generate({type: 'Keyword', name: 'foo'}) => 'foo'
     */
    generate(node: DSNode, options?: DSGenerateOptions): string;

    /**
     * Generates an AST from a CSS value syntax
     *
     * @param source - The CSS value syntax to parse
     *
     * @example
     *  parse('foo | bar') =>
     *    {
     *      type: 'Group',
     *      terms: [
     *        { type: 'Keyword', name: 'foo' },
     *        { type: 'Keyword', name: 'bar' }
     *      ],
     *      combinator: '|',
     *      disallowEmpty: false,
     *      explicit: false
     *    }
     */
    parse(source: string): DSNodeGroup;

    /**
     * Walks definition syntax AST
     */
    walk(node: DSNode, options: DSWalkEnterOrLeaveFn | DSWalkOptions, context?: any): void;

    /**
     * Wrapper for syntax errors
     */
    syntaxError: SyntaxError;
}

export const definitionSyntax: DefinitionSyntax;

// ----------------------------------------------------------
// Ident utils
// https://github.com/csstree/csstree/blob/master/lib/utils/ident.js
// ----------------------------------------------------------

/**
 * Utilities for encoding and decoding CSS identifiers.
 */
export const ident: {
    /**
     * Decodes a CSS identifier from its escaped form.
     *
     * @param input - The escaped CSS identifier to decode.
     * @returns The decoded identifier as a string.
     */
    decode(input: string): string;

    /**
     * Encodes a string into a valid CSS identifier, escaping special characters as necessary.
     *
     * @param input - The string to encode as a CSS identifier.
     * @returns The encoded CSS identifier.
     */
    encode(input: string): string;
};

// ----------------------------------------------------------
// String utils
// https://github.com/csstree/csstree/blob/master/lib/utils/string.js
// ----------------------------------------------------------

/**
 * Utilities for encoding and decoding CSS strings.
 */
export const string: {
    /**
     * Encodes a string into a valid CSS string, escaping special characters as necessary.
     * Optionally uses apostrophes (`'`) instead of quotation marks (`"`).
     *
     * @param input - The string to encode.
     * @param apostrophe - Whether to use apostrophes for the string. Defaults to `false`.
     * @returns The encoded CSS string.
     */
    encode(input: string, apostrophe?: boolean): string;

    /**
     * Decodes a CSS string from its escaped form.
     *
     * @param input - The escaped CSS string to decode.
     * @returns The decoded string.
     */
    decode(input: string): string;
};

// ----------------------------------------------------------
// URL utils
// https://github.com/csstree/csstree/blob/master/lib/utils/url.js
// ----------------------------------------------------------

/**
 * Utilities for encoding and decoding CSS URLs.
 */
export const url: {
    /**
     * Decodes a CSS URL from its escaped form.
     *
     * @param input - The escaped CSS URL to decode.
     * @returns The decoded URL as a string.
     */
    decode(input: string): string;

    /**
     * Encodes a string into a valid CSS URL, escaping special characters as necessary.
     *
     * @param input - The string to encode as a CSS URL.
     * @returns The encoded CSS URL.
     */
    encode(input: string): string;
};

// ----------------------------------------------------------
// Lexer
// https://github.com/csstree/csstree/blob/master/lib/lexer/Lexer.js
// ----------------------------------------------------------

/**
 * Represents an error that occurs during the syntax matching process.
 * Extends the standard `SyntaxError` with additional properties specific to CSS parsing.
 */
export class SyntaxMatchError extends SyntaxError {
    /**
     * The raw error message before formatting.
     */
    rawMessage: string;

    /**
     * The CSS syntax that was being matched when the error occurred.
     */
    syntax: string;

    /**
     * The CSS code where the mismatch occurred.
     */
    css: string;

    /**
     * The offset (character position) within the CSS string where the mismatch occurred.
     */
    mismatchOffset: number;

    /**
     * The length (number of characters) of the mismatched segment.
     */
    mismatchLength: number;

    /**
     * The overall offset (character position) from the start of the CSS input.
     */
    offset: number;

    /**
     * The line number (1-indexed) where the mismatch occurred.
     */
    line: number;

    /**
     * The column number (1-indexed) within the line where the mismatch occurred.
     */
    column: number;

    /**
     * The location range within the CSS input where the mismatch occurred.
     */
    loc: CssLocationRange;
}

/**
 * Represents an error that occurs when a reference to a syntax rule is invalid
 * or cannot be resolved. Extends the standard `SyntaxError`.
 */
export class SyntaxReferenceError extends SyntaxError {
    /**
     * The reference to the syntax rule that caused the error.
     */
    reference: string;
}

/**
 * Represents the result of a lexer match operation.
 */
export interface LexerMatchResult {
    /**
     * The matched CSS node, or `null` if no match was found.
     */
    matched: CssNode | null;

    /**
     * The number of iterations performed during the matching process.
     */
    iterations: number;

    /**
     * An error object if a matching error occurred, or `null` if no error.
     */
    error: Error | SyntaxMatchError | SyntaxReferenceError | null;

    /**
     * Retrieves the trace of matching operations for a specific node.
     *
     * @param node - The CSS node to trace.
     * @returns An array of `SyntaxDescriptor` objects or `null` if tracing is not applicable.
     */
    getTrace: (node: CssNode) => SyntaxDescriptor[] | null;

    /**
     * Checks if the specified node is a keyword.
     *
     * @param node - The CSS node to check.
     * @returns `true` if the node is a keyword, `false` otherwise.
     */
    isKeyword: (node: CssNode) => boolean;

    /**
     * Checks if the specified node matches a specific property.
     *
     * @param node - The CSS node to check.
     * @param property - The property name to match against.
     * @returns `true` if the node matches the property, `false` otherwise.
     */
    isProperty: (node: CssNode, property: string) => boolean;

    /**
     * Checks if the specified node matches a specific type.
     *
     * @param node - The CSS node to check.
     * @param type - The type name to match against.
     * @returns `true` if the node matches the type, `false` otherwise.
     */
    isType: (node: CssNode, type: string) => boolean;
}

type ConsumerFunction = (this: ParserContext, ...args: unknown[]) => CssNode;

/**
 * Recognizer is responsible for identifying specific patterns or constructs within the CSS syntax.
 * It provides methods to interpret and handle these constructs during parsing.
 * @see https://github.com/csstree/csstree/blob/master/lib/syntax/scope
 */
interface Recognizer {
    /**
     * Retrieves a node based on the provided parsing context.
     *
     * @param context - The parsing context, which contains relevant state and configuration for the parser.
     * @returns A function that, when executed, produces a `CssNode`.
     */
    getNode(this: ParserContext): CssNode;

    /**
     * Handles whitespace between CSS selectors during parsing.
     * Ensures that whitespace is correctly interpreted as a descendant combinator.
     *
     * @param next - The next node or token in the parsing sequence.
     * @param children - The list of parsed nodes, which will be modified to include a `Combinator` node if applicable.
     */
    onWhitespace?(this: ParserContext, next: CssNode | null, children: List<CssNode>): void;

    // any number of other properties
    [key:string]: any;
}

/**
 * The `Parser` interface defines the methods and properties used for parsing CSS syntax.
 *
 * @see {@link https://github.com/csstree/csstree/blob/9de5189fadd6fb4e3a149eec0e80d6ed0d0541e5/lib/parser/create.js#L91-L293}
 */
interface Parser {
    /**
     * Indicates whether at-rule prelude parsing is enabled.
     */
    parseAtrulePrelude: boolean;

    /**
     * Indicates whether rule prelude parsing is enabled.
     */
    parseRulePrelude: boolean;

    /**
     * Indicates whether value parsing is enabled.
     */
    parseValue: boolean;

    /**
     * Indicates whether custom property parsing is enabled.
     */
    parseCustomProperty: boolean;

    /**
     * Reads a sequence of CSS nodes based on the provided recognizer.
     */
    readSequence: ReadSequenceFunction;

    /**
     * Consumes input until the end of a balance context is reached.
     *
     * @returns Always returns `0`.
     */
    consumeUntilBalanceEnd: (this: ParserContext) => 0;

    /**
     * Consumes input until a left curly bracket (`{`) is encountered.
     *
     * @param code - The character code to check.
     * @returns `0` or `1` depending on the outcome.
     */
    consumeUntilLeftCurlyBracket: (this: ParserContext, code: number) => 0 | 1;

    /**
     * Consumes input until a left curly bracket (`{`) or semicolon (`;`) is encountered.
     *
     * @param code - The character code to check.
     * @returns `0` or `1` depending on the outcome.
     */
    consumeUntilLeftCurlyBracketOrSemicolon: (this: ParserContext, code: number) => 0 | 1;

    /**
     * Consumes input until an exclamation mark (`!`) or semicolon (`;`) is encountered.
     *
     * @param code - The character code to check.
     * @returns `0` or `1` depending on the outcome.
     */
    consumeUntilExclamationMarkOrSemicolon: (this: ParserContext, code: number) => 0 | 1;

    /**
     * Consumes input until a semicolon (`;`) is included.
     *
     * @returns `0` or `2` depending on the outcome.
     */
    consumeUntilSemicolonIncluded: (this: ParserContext) => 0 | 2;

    /**
     * Creates a new, empty list of CSS nodes.
     *
     * @returns A new `List` of `CssNode` objects.
     */
    createList: (this: ParserContext) => List<CssNode>;

    /**
     * Creates a new list containing a single CSS node.
     *
     * @param node - The node to include in the list.
     * @returns A new `List` containing the provided node.
     */
    createSingleNodeList: (this: ParserContext, node: CssNode) => List<CssNode>;

    /**
     * Retrieves the first item from a list of CSS nodes.
     *
     * @param list - The list to process.
     * @returns The first list item, or `null` if the list is empty.
     */
    getFirstListNode: (this: ParserContext, list: List<CssNode>) => ListItem<CssNode> | null;

    /**
     * Retrieves the last item from a list of CSS nodes.
     *
     * @param list - The list to process.
     * @returns The last list item, or `null` if the list is empty.
     */
    getLastListNode: (this: ParserContext, list: List<CssNode>) => ListItem<CssNode> | null;

    /**
     * Parses input using a consumer function, with a fallback function as a backup.
     *
     * @param consumer - The primary function to parse input.
     * @param fallback - The fallback function to use if the primary function fails.
     * @returns A `CssNode` parsed from the input.
     */
    parseWithFallback: (this: ParserContext, consumer: ConsumerFunction, fallback: ConsumerFunction) => CssNode;

    /**
     * Looks up a non-whitespace token type at a given offset.
     *
     * @param offset - The offset to check.
     * @returns The token type code.
     */
    lookupNonWSType: (this: ParserContext, offset: number) => number;

    /**
     * Retrieves the character code at a specific offset.
     *
     * @param offset - The offset to check.
     * @returns The character code.
     */
    charCodeAt: (this: ParserContext, offset: number) => number;

    /**
     * Extracts a substring from the input based on the provided offsets.
     *
     * @param offsetStart - The start offset.
     * @param offsetEnd - The end offset.
     * @returns The extracted substring.
     */
    substring: (this: ParserContext, offsetStart: number, offsetEnd: number) => string;

    /**
     * Extracts a substring from the input starting at a specific point up to the cursor.
     *
     * @param start - The start offset.
     * @returns The extracted substring.
     */
    substrToCursor: (this: ParserContext, start: number) => string;

    /**
     * Compares a character at a specific offset with a given character code.
     *
     * @param offset - The offset to check.
     * @param charCode - The character code to compare against.
     * @returns `true` if the character matches, `false` otherwise.
     */
    cmpChar: (this: ParserContext, offset: number, charCode: number) => boolean;

    /**
     * Compares a substring with a given string.
     *
     * @param offsetStart - The start offset.
     * @param offsetEnd - The end offset.
     * @param str - The string to compare against.
     * @returns `true` if the substring matches, `false` otherwise.
     */
    cmpStr: (this: ParserContext, offsetStart: number, offsetEnd: number, str: string) => boolean;

    /**
     * Consumes a token of a specific type from the input.
     *
     * @param tokenType - The token type to consume.
     * @returns The consumed token value.
     */
    consume: (this: ParserContext, tokenType: number) => string;

    /**
     * Consumes a function name token from the input.
     *
     * @returns The consumed function name.
     */
    consumeFunctionName: (this: ParserContext) => string;

    /**
     * Consumes a number token from the input.
     *
     * @param type - The type of number to consume.
     * @returns The consumed number value.
     */
    consumeNumber: (this: ParserContext, type: number) => string;

    /**
     * Consumes a specific token type from the input without returning its value.
     *
     * @param tokenType - The token type to consume.
     */
    eat: (this: ParserContext, tokenType: number) => void;

    /**
     * Consumes an identifier token with a specific name.
     *
     * @param name - The name of the identifier to consume.
     */
    eatIdent: (this: ParserContext, name: string) => void;

    /**
     * Consumes a delimiter token with a specific character code.
     *
     * @param code - The character code of the delimiter to consume.
     */
    eatDelim: (this: ParserContext, code: number) => void;

    /**
     * Retrieves the location range of a specific segment of input.
     *
     * @param start - The start offset.
     * @param end - The end offset.
     * @returns The location range, or `null` if unavailable.
     */
    getLocation: (this: ParserContext, start: number, end: number) => CssLocationRange | null;

    /**
     * Retrieves the location range from a list of CSS nodes.
     *
     * @param list - The list of CSS nodes.
     * @returns The location range, or `null` if unavailable.
     */
    getLocationFromList: (this: ParserContext, list: List<CssNode>) => CssLocationRange | null;

    /**
     * Reports a parsing error with a specific message and offset.
     *
     * @param message - The error message.
     * @param offset - The offset at which the error occurred.
     */
    error: (this: ParserContext, message: string, offset: number) => void;
}

// AtruleParseConfig type based on the structure of files in lib/syntax/atrule/
interface AtruleParseConfig {
    parse: {
        prelude?: ((this: ParserContext) => List<CssNode>) | null;
        block?: ((this: ParserContext, nested?: boolean) => CssNode) | null;
    };
}

// https://github.com/csstree/csstree/blob/9de5189fadd6fb4e3a149eec0e80d6ed0d0541e5/lib/parser/create.js#L53-L80
type ParseConfig = {
    context: Record<string, ConsumerFunction | undefined>;
    atrule: Record<string, ConsumerFunction | undefined>;
    pseudo: Record<string, ConsumerFunction | undefined>;
    // node: Record<CssNodeNames, ConsumerFunction> & Record<string, ConsumerFunction | undefined>;
    node: Record<string, ConsumerFunction | undefined>;
} & Pick<SyntaxConfig, 'features' | 'scope'>;

// https://github.com/csstree/csstree/blob/9de5189fadd6fb4e3a149eec0e80d6ed0d0541e5/lib/parser/create.js#L90
type ParserContext<AvailableNodes extends CssNodeCommon = CssNode> = TokenStream
    & ParseConfig
    & { config: ParseConfig }
    & Parser
    & {
        [K in AvailableNodes["type"]]: (this: ParserContext, ...args: unknown[]) => Extract<AvailableNodes, { type: K }>;
    }
    & {
        // Anything else
        [key: string]: unknown;
    };

type StructureValue = string | Function | null;
type StructureDescriptor =  StructureValue | Array<StructureValue> | Array<Array<StructureValue>>;

interface StructureDefinition {
    children?: Array<Array<string>>;

    [key: string]: StructureDescriptor | undefined;
}

interface NodeSyntaxConfig<T extends CssNodeCommon = CssNodeCommon> {
    name: string;
    structure: StructureDefinition;
    parse(this: ParserContext, ...args:Array<unknown>): T;
    generate(this: GeneratorContext, node: T): void;
    walkContext?: string;
}

interface AtruleSyntax {
    prelude: string | null;
    descriptors?: Record<string, string> | null;
}

// https://github.com/csstree/csstree/blob/9de5189fadd6fb4e3a149eec0e80d6ed0d0541e5/lib/syntax/config/parser.js#L7-L28
interface ParseContext {
    default: string;

    /**
     * Key is name
     * Value is context
     */
    [key: string]: string | ((options: Record<string, unknown>) => CssNode);
}

export interface SyntaxConfig<T extends CssNodeCommon = CssNodeCommon> {
    generic: boolean;
    units: Record<string, string[]>;
    types: Record<string, string>;
    properties: Record<string, string>;
    atrules: Record<string, AtruleSyntax>;
    node: Record<string, Partial<NodeSyntaxConfig<T>>>;
    atrule: Record<string, AtruleParseConfig>;
    pseudo: Record<string, { parse: ConsumerFunction; }>;
    scope: Record<string, Partial<Recognizer>>;
    features: Record<string, Partial<Recognizer>>;
    parseContext: ParseContext;
    tokenize: TokenizeFunction;
}

interface LexerStructureWarning {
    node: CssNode;
    message: string;
}

type StructureDocs = Record<string, string>;

type StructureCheckCallback = (node: CssNode, message: string) => void;

type StructureCheckFunction = (node: CssNode, warn: StructureCheckCallback) => void;

interface StructureData {
    docs: StructureDocs;
    check: StructureCheckFunction;
}

type Structure = Record<string, StructureData>;

/**
 * Represents a collection of tools and utilities for working with CSS syntax,
 * including parsing, generating, walking, and manipulating CSS abstract syntax trees (ASTs).
 */
interface Syntax {
    /**
     * The `Lexer` instance used for matching and validating CSS syntax.
     */
    lexer: Lexer;

    /**
     * Creates a new `Lexer` instance with the specified configuration.
     *
     * @param config - The syntax configuration object.
     * @returns A new `Lexer` instance.
     */
    createLexer: (config: SyntaxConfig) => Lexer;

    /**
     * Tokenizes a CSS string into a stream of tokens.
     */
    tokenize: TokenizeFunction;

    /**
     * Parses a CSS string into an abstract syntax tree (AST).
     */
    parse: ParseFunction;

    /**
     * Generates a CSS string from an abstract syntax tree (AST).
     */
    generate: GenerateFunction;

    /**
     * Walks through a CSS abstract syntax tree (AST) and applies a callback function to each node.
     *
     * @see {@link walk}
     */
    walk: typeof walk;

    /**
     * Finds the first node in a CSS abstract syntax tree (AST) that matches a given condition.
     *
     * @see {@link find}
     */
    find: typeof find;

    /**
     * Finds the last node in a CSS abstract syntax tree (AST) that matches a given condition.
     *
     * @see {@link findLast}
     */
    findLast: typeof findLast;

    /**
     * Finds all nodes in a CSS abstract syntax tree (AST) that match a given condition.
     *
     * @see {@link findAll}
     */
    findAll: typeof findAll;

    /**
     * Converts a plain JavaScript object into a CSS abstract syntax tree (AST).
     *
     * @see {@link fromPlainObject}
     */
    fromPlainObject: typeof fromPlainObject;

    /**
     * Converts a CSS abstract syntax tree (AST) into a plain JavaScript object.
     *
     * @see {@link toPlainObject}
     */
    toPlainObject: typeof toPlainObject;

    /**
     * Creates a new `Syntax` instance with customized or extended functionality.
     *
     * @returns A new forked `Syntax` instance.
     */
    fork: ForkFunction;
}

/**
 * Represents a match in the syntax, containing details about the type,
 * name, and corresponding syntax tree node.
 */
interface SyntaxMatch {
    /**
     * The type of the matched syntax (e.g., "Type", "Property").
     */
    type: string;

    /**
     * The name of the matched syntax rule.
     */
    name: string;

    /**
     * The syntax tree node representing the matched syntax.
     */
    syntax: DSNode;
}

/**
 * Represents a graph of syntax matches, including the match type,
 * syntax tree node, and source node.
 */
interface SyntaxMatchGraph {
    /**
     * The type of the syntax match graph (e.g., "Type", "Property").
     */
    type: string;

    /**
     * The primary match information.
     */
    match: SyntaxMatch;

    /**
     * The syntax tree node representing the match graph.
     */
    syntax: DSNode;

    /**
     * The source syntax tree node for the match graph.
     */
    source: DSNode;
}

/**
 * Kinds of syntax descriptors created by the lexer.
 */
type SyntaxDescriptorType = "AtruleDescriptor" | "AtrulePrelude" | "Property" | "Type";

/**
 * The built-in unit groups stored on a `Lexer` instance.
 */
interface LexerUnits {
    /**
     * Length units such as `px`, `em`, and `vh`.
     */
    length: string[];

    /**
     * Angle units such as `deg` and `rad`.
     */
    angle: string[];

    /**
     * Time units such as `s` and `ms`.
     */
    time: string[];

    /**
     * Frequency units such as `hz` and `khz`.
     */
    frequency: string[];

    /**
     * Resolution units such as `dpi` and `dppx`.
     */
    resolution: string[];

    /**
     * Flex units such as `fr`.
     */
    flex: string[];

    /**
     * Volume-related decibel units.
     */
    decibel: string[];

    /**
     * Pitch-related semitone units.
     */
    semitones: string[];
}

/**
 * Describes a syntax rule or definition.
 */
type SyntaxDescriptor<Kind extends SyntaxDescriptorType = SyntaxDescriptorType> = {
    /**
     * The type of the syntax descriptor (e.g., "Type", "Property").
     */
    type: Kind;

    /**
     * The name of the syntax descriptor.
     */
    name: string;

    /**
     * The name of the parent syntax descriptor, or `null` if none exists.
     */
    parent: string | null;

    /**
     * Whether the syntax descriptor can be serialized.
     */
    serializable: boolean;

    /**
     * The parsed definition-syntax AST, or `null` for function-backed descriptors.
     */
    syntax: DSNode | null;

    /**
     * The graph of syntax matches for this descriptor, or `null` if none exists.
     */
    match: SyntaxMatchGraph | null;

    /**
     * A reference to a graph of syntax matches, or `null` if none exists.
     */
    matchRef: SyntaxMatchGraph | null;
};

/**
 * An at-rule definition exposed through `Lexer#atrules`.
 */
interface LexerAtruleDefinition {
    /**
     * Discriminator for at-rule entries.
     */
    type: "Atrule";

    /**
     * The at-rule name.
     */
    name: string;

    /**
     * The descriptor for the at-rule prelude, if one exists.
     */
    prelude: SyntaxDescriptor<"AtrulePrelude"> | null;

    /**
     * At-rule descriptors keyed by descriptor name, if any.
     */
    descriptors: Record<string, SyntaxDescriptor<"AtruleDescriptor"> | undefined> | null;
}

/**
 * Represents a fragment match, including its parent list and nodes.
 */
type FragmentMatch<T extends CssNode = CssNode> = {
    /**
     * The parent list of CSS nodes containing the fragment.
     */
    parent: List<CssNode>;

    /**
     * The list of nodes that make up the fragment.
     */
    nodes: List<T>;
};

/**
 * Represents the result of validating a set of syntax rules.
 */
type LexerValidationResult = {
    /**
     * Broken types as an array of type names.
     */
    types: string[];

    /**
     * Broken properties as an array of property names.
     */
    properties: string[];
};

/**
 * The `Lexer` class is responsible for matching and validating CSS syntax.
 * It provides utilities for handling at-rules, properties, types, and general syntax.
 */
export class Lexer {
    /**
     * CSS-wide keywords accepted by the lexer.
     */
    cssWideKeywords: string[];

    /**
     * The associated `Syntax` instance, if the lexer was created from one.
     */
    syntax: Syntax | undefined;

    /**
     * Whether generic types are enabled for this lexer.
     */
    generic: boolean;

    /**
     * Known CSS units grouped by unit family.
     */
    units: LexerUnits;

    /**
     * Known at-rule definitions keyed by at-rule name.
     */
    atrules: Record<string, LexerAtruleDefinition | undefined>;

    /**
     * Known property definitions keyed by property name.
     */
    properties: Record<string, SyntaxDescriptor<"Property"> | undefined>;

    /**
     * Known type definitions keyed by type name.
     */
    types: Record<string, SyntaxDescriptor<"Type"> | undefined>;

    /**
     * Node structure validators used by `checkStructure()`.
     */
    structure: Structure;

    /**
     * Creates a new `Lexer` instance.
     *
     * @param config - The syntax configuration object.
     * @param syntax - (Optional) A reference to the associated `Syntax` object.
     * @param structure - (Optional) The structure definitions for the lexer.
     */
    constructor(config: SyntaxConfig, syntax?: Syntax, structure?: Structure);

    /**
     * Checks the structure of the given CSS AST.
     *
     * @param ast - The CSS abstract syntax tree to validate.
     * @returns An array of structure warnings or `false` if the structure is valid.
     */
    checkStructure(ast: CssNode): LexerStructureWarning[] | false;

    /**
     * Creates a syntax descriptor for the given syntax string or object.
     *
     * @param syntax - The syntax definition.
     * @param type - The type of syntax (e.g., "Type", "Property").
     * @param name - The name of the syntax rule.
     * @param parent - (Optional) The parent rule, if applicable.
     * @returns A `SyntaxDescriptor` for the provided syntax.
     */
    createDescriptor(syntax: Syntax | string, type: string, name: string, parent: string | null): SyntaxDescriptor;

    /**
     * Checks if an at-rule name is valid.
     *
     * @param atruleName - The name of the at-rule.
     * @returns A `SyntaxReferenceError` if invalid, or `undefined` if valid.
     */
    checkAtruleName(atruleName: string): SyntaxReferenceError | undefined;

    /**
     * Checks if an at-rule prelude is valid.
     *
     * @param atruleName - The name of the at-rule.
     * @param prelude - The prelude content as a CSS node or string.
     * @returns A `SyntaxError` if invalid, or `undefined` if valid.
     */
    checkAtrulePrelude(atruleName: string, prelude: CssNode | string): SyntaxError | undefined;

    /**
     * Checks if an at-rule descriptor name is valid.
     *
     * @param atruleName - The name of the at-rule.
     * @param descriptorName - The name of the descriptor.
     * @returns A syntax error or `undefined` if valid.
     */
    checkAtruleDescriptorName(
        atruleName: string,
        descriptorName: string,
    ): SyntaxReferenceError | SyntaxError | undefined;

    /**
     * Checks if a property name is valid.
     *
     * @param propertyName - The name of the property.
     * @returns A `SyntaxReferenceError` if invalid, or `undefined` if valid.
     */
    checkPropertyName(propertyName: string): SyntaxReferenceError | undefined;

    /**
     * Matches an at-rule prelude against its syntax definition.
     *
     * @param atruleName - The name of the at-rule.
     * @param prelude - The prelude content.
     * @returns The match result as a `LexerMatchResult`.
     */
    matchAtrulePrelude(atruleName: string, prelude: AnyCssNode | string): LexerMatchResult;

    /**
     * Matches an at-rule descriptor value against its syntax definition.
     *
     * @param atruleName - The name of the at-rule.
     * @param descriptorName - The descriptor name.
     * @param value - The value to match.
     * @returns The match result as a `LexerMatchResult`.
     */
    matchAtruleDescriptor(atruleName: string, descriptorName: string, value: AnyCssNode | string): LexerMatchResult;

    /**
     * Matches a declaration node against its syntax definition.
     *
     * @param node - The declaration node to match.
     * @returns The match result as a `LexerMatchResult`.
     */
    matchDeclaration(node: AnyCssNode): LexerMatchResult;

    /**
     * Matches a property value against its syntax definition.
     *
     * @param propertyName - The name of the property.
     * @param value - The value to match.
     * @returns The match result as a `LexerMatchResult`.
     */
    matchProperty(propertyName: string, value: AnyCssNode | string): LexerMatchResult;

    /**
     * Matches a type value against its syntax definition.
     *
     * @param typeName - The name of the type.
     * @param value - The value to match.
     * @returns The match result as a `LexerMatchResult`.
     */
    matchType(typeName: string, value: AnyCssNode | string): LexerMatchResult;

    /**
     * Matches a generic syntax descriptor against a value.
     *
     * @param syntax - The syntax descriptor or string.
     * @param value - The value to match.
     * @returns The match result as a `LexerMatchResult`.
     */
    match(syntax: SyntaxDescriptor | string, value: AnyCssNode | string): LexerMatchResult;

    /**
     * Finds fragments of a value that match a specific syntax type and name.
     *
     * @param propertyName - The name of the property.
     * @param value - The value to search.
     * @param type - The type to match.
     * @param name - The name to match.
     * @returns An array of matching fragments.
     */
    findValueFragments(propertyName: string, value: AnyCssNode, type: string, name: string): FragmentMatch<Value>[];

    /**
     * Finds fragments of a declaration value that match a specific syntax type and name.
     *
     * @param declaration - The declaration node to search.
     * @param type - The type to match.
     * @param name - The name to match.
     * @returns An array of matching fragments.
     */
    findDeclarationValueFragments(declaration: Declaration, type: string, name: string): FragmentMatch<Value>[];

    /**
     * Finds all fragments in an AST that match a specific syntax type and name.
     *
     * @param ast - The AST to search.
     * @param type - The type to match.
     * @param name - The name to match.
     * @returns An array of matching fragments.
     */
    findAllFragments(ast: AnyCssNode, type: string, name: string): FragmentMatch[];

    /**
     * Retrieves the definition for an at-rule.
     *
     * @param atruleName - The name of the at-rule.
     * @param fallbackBasename - (Optional) Whether to use a fallback basename.
     * @returns The at-rule definition or `null` if not found.
     */
    getAtrule(atruleName: string, fallbackBasename?: boolean): LexerAtruleDefinition | null;

    /**
     * Retrieves the prelude descriptor for an at-rule.
     *
     * @param atruleName - The name of the at-rule.
     * @param fallbackBasename - (Optional) Whether to use a fallback basename.
     * @returns The syntax descriptor or `null` if not found.
     */
    getAtrulePrelude(atruleName: string, fallbackBasename?: boolean): SyntaxDescriptor<"AtrulePrelude"> | null;

    /**
     * Retrieves the descriptor for an at-rule's property.
     *
     * @param atruleName - The name of the at-rule.
     * @param name - The property name.
     * @returns The syntax descriptor or `null` if not found.
     */
    getAtruleDescriptor(atruleName: string, name: string): SyntaxDescriptor<"AtruleDescriptor"> | null;

    /**
     * Retrieves the syntax descriptor for a property.
     *
     * @param propertyName - The name of the property.
     * @param fallbackBasename - (Optional) Whether to use a fallback basename.
     * @returns The syntax descriptor or `null` if not found.
     */
    getProperty(propertyName: string, fallbackBasename?: boolean): SyntaxDescriptor<"Property"> | null;

    /**
     * Retrieves the syntax descriptor for a type.
     *
     * @param name - The name of the type.
     * @returns The syntax descriptor or `null` if not found.
     */
    getType(name: string): SyntaxDescriptor<"Type"> | null;

    /**
     * Validates the syntax rules and properties.
     *
     * @returns Validation results or `null` if everything is valid.
     */
    validate(): LexerValidationResult | null;

    /**
     * Dumps the current syntax configuration as a configuration object.
     *
     * @param syntaxAsAst - Whether to return syntax as AST.
     * @param pretty - Whether to format the output for readability.
     * @returns The syntax configuration.
     */
    dump(syntaxAsAst: Syntax, pretty: boolean): SyntaxConfig;

    /**
     * Converts the lexer to a string representation.
     *
     * @returns A string representation of the lexer.
     */
    toString(): string;
}

/**
 * Lexer instance.
 */
export const lexer: Lexer;

type SyntaxExtensionCallback = (prev: SyntaxConfig, assign?: typeof Object.assign) => SyntaxConfig;

type SyntaxExtension = Partial<SyntaxConfig> | SyntaxExtensionCallback;

type ForkFunction = (extension: SyntaxExtension) => Syntax;

export const fork: ForkFunction;
ێ0ximport syntax from './syntax/index.js';

export * from './version.js';
export { default as createSyntax } from './syntax/create.js';
export { List } from './utils/List.js';
export { Lexer } from './lexer/Lexer.js';
export { tokenTypes, tokenNames, TokenStream, OffsetToLocation } from './tokenizer/index.js';
export * as definitionSyntax from './definition-syntax/index.js';
export { clone } from './utils/clone.js';
export * from './utils/names.js';
export * as ident from './utils/ident.js';
export * as string from './utils/string.js';
export * as url from './utils/url.js';
export const {
    tokenize,
    parse,
    generate,
    lexer,
    createLexer,

    walk,
    find,
    findLast,
    findAll,

    toPlainObject,
    fromPlainObject,

    fork
} = syntax;
0 "x+100644 Lexer.js 9 aC䈩|Qj100644 error.js @t Ff100644 generic-an-plus-b.js 4w¹:OL˷100644 generic-const.js j2Yp=勇3100644 generic-urange.js x@)MV?)Uc 100644 generic.js `]Фw.wm<ӳ100644 index.js ach,nS!z߲100644 match-graph.js ]=	_54<1vfM100644 match.js +P+j{ =VWm1100644 prepare-tokens.js _>Z=100644 search.js hUDyY5100644 structure.js ;׏\66100644 trace.js 6e;PE 
:/100644 units.js DĔUg<"Q⩹xC&import { SyntaxReferenceError, SyntaxMatchError } from './error.js';
import * as names from '../utils/names.js';
import { cssWideKeywords } from './generic-const.js';
import { createGenericTypes } from './generic.js';
import * as units from './units.js';
import { parse, generate, walk } from '../definition-syntax/index.js';
import prepareTokens from './prepare-tokens.js';
import { buildMatchGraph } from './match-graph.js';
import { matchAsTree } from './match.js';
import * as trace from './trace.js';
import { matchFragments } from './search.js';
import { getStructureFromConfig } from './structure.js';

function dumpMapSyntax(map, compact, syntaxAsAst) {
    const result = {};

    for (const name in map) {
        if (map[name].syntax) {
            result[name] = syntaxAsAst
                ? map[name].syntax
                : generate(map[name].syntax, { compact });
        }
    }

    return result;
}

function dumpAtruleMapSyntax(map, compact, syntaxAsAst) {
    const result = {};

    for (const [name, atrule] of Object.entries(map)) {
        result[name] = {
            prelude: atrule.prelude && (
                syntaxAsAst
                    ? atrule.prelude.syntax
                    : generate(atrule.prelude.syntax, { compact })
            ),
            descriptors: atrule.descriptors && dumpMapSyntax(atrule.descriptors, compact, syntaxAsAst)
        };
    }

    return result;
}

function valueHasVar(tokens) {
    for (let i = 0; i < tokens.length; i++) {
        if (tokens[i].value.toLowerCase() === 'var(') {
            return true;
        }
    }

    return false;
}

function syntaxHasTopLevelCommaMultiplier(syntax) {
    const singleTerm = syntax.terms[0];

    return (
        syntax.explicit === false &&
        syntax.terms.length === 1 &&
        singleTerm.type === 'Multiplier' &&
        singleTerm.comma === true
    );
}

function valueHasEnv(tokens) {
    for (let i = 0; i < tokens.length; i++) {
        if (tokens[i].value.toLowerCase() === 'env(') {
            return true;
        }
    }

    return false;
}

function buildMatchResult(matched, error, iterations) {
    return {
        matched,
        iterations,
        error,
        ...trace
    };
}

function matchSyntax(lexer, syntax, value, useCssWideKeywords) {
    const tokens = prepareTokens(value, lexer.syntax);
    let result;

    if (valueHasVar(tokens)) {
        return buildMatchResult(null, new Error('Matching for a tree with var() is not supported'));
    }

    if (valueHasEnv(tokens)) {
        return buildMatchResult(null, new Error('Matching for a tree with env() is not supported'));
    }

    if (useCssWideKeywords) {
        result = matchAsTree(tokens, lexer.cssWideKeywordsSyntax, lexer);
    }

    if (!useCssWideKeywords || !result.match) {
        result = matchAsTree(tokens, syntax.match, lexer);
        if (!result.match) {
            return buildMatchResult(
                null,
                new SyntaxMatchError(result.reason, syntax.syntax, value, result),
                result.iterations
            );
        }
    }

    return buildMatchResult(result.match, null, result.iterations);
}

export class Lexer {
    constructor(config, syntax, structure) {
        this.cssWideKeywords = cssWideKeywords;
        this.syntax = syntax;
        this.generic = false;
        this.units = { ...units };
        this.atrules = Object.create(null);
        this.properties = Object.create(null);
        this.types = Object.create(null);
        this.structure = structure || getStructureFromConfig(config);

        if (config) {
            if (config.cssWideKeywords) {
                this.cssWideKeywords = config.cssWideKeywords;
            }

            if (config.units) {
                for (const group of Object.keys(units)) {
                    if (Array.isArray(config.units[group])) {
                        this.units[group] = config.units[group];
                    }
                }
            }

            if (config.types) {
                for (const [name, type] of Object.entries(config.types)) {
                    this.addType_(name, type);
                }
            }

            if (config.generic) {
                this.generic = true;
                for (const [name, value] of Object.entries(createGenericTypes(this.units))) {
                    this.addType_(name, value);
                }
            }

            if (config.atrules) {
                for (const [name, atrule] of Object.entries(config.atrules)) {
                    this.addAtrule_(name, atrule);
                }
            }

            if (config.properties) {
                for (const [name, property] of Object.entries(config.properties)) {
                    this.addProperty_(name, property);
                }
            }
        }

        this.cssWideKeywordsSyntax = buildMatchGraph(this.cssWideKeywords.join(' |  '));
    }

    checkStructure(ast) {
        function collectWarning(node, message) {
            warns.push({ node, message });
        }

        const structure = this.structure;
        const warns = [];

        this.syntax.walk(ast, function(node) {
            if (structure.hasOwnProperty(node.type)) {
                structure[node.type].check(node, collectWarning);
            } else {
                collectWarning(node, 'Unknown node type `' + node.type + '`');
            }
        });

        return warns.length ? warns : false;
    }

    createDescriptor(syntax, type, name, parent = null) {
        const ref = {
            type,
            name
        };
        const descriptor = {
            type,
            name,
            parent,
            serializable: typeof syntax === 'string' || (syntax && typeof syntax.type === 'string'),
            syntax: null,
            match: null,
            matchRef: null // used for properties when a syntax referenced as <'property'> in other syntax definitions
        };

        if (typeof syntax === 'function') {
            descriptor.match = buildMatchGraph(syntax, ref);
        } else {
            if (typeof syntax === 'string') {
                // lazy parsing on first access
                Object.defineProperty(descriptor, 'syntax', {
                    get() {
                        Object.defineProperty(descriptor, 'syntax', {
                            value: parse(syntax)
                        });

                        return descriptor.syntax;
                    }
                });
            } else {
                descriptor.syntax = syntax;
            }

            // lazy graph build on first access
            Object.defineProperty(descriptor, 'match', {
                get() {
                    Object.defineProperty(descriptor, 'match', {
                        value: buildMatchGraph(descriptor.syntax, ref)
                    });

                    return descriptor.match;
                }
            });

            if (type === 'Property') {
                Object.defineProperty(descriptor, 'matchRef', {
                    get() {
                        const syntax = descriptor.syntax;
                        const value = syntaxHasTopLevelCommaMultiplier(syntax)
                            ? buildMatchGraph({
                                ...syntax,
                                terms: [syntax.terms[0].term]
                            }, ref)
                            : null;

                        Object.defineProperty(descriptor, 'matchRef', {
                            value
                        });

                        return value;
                    }
                });
            }
        }

        return descriptor;
    }
    addAtrule_(name, syntax) {
        if (!syntax) {
            return;
        }

        this.atrules[name] = {
            type: 'Atrule',
            name: name,
            prelude: syntax.prelude ? this.createDescriptor(syntax.prelude, 'AtrulePrelude', name) : null,
            descriptors: syntax.descriptors
                ? Object.keys(syntax.descriptors).reduce(
                    (map, descName) => {
                        map[descName] = this.createDescriptor(syntax.descriptors[descName], 'AtruleDescriptor', descName, name);
                        return map;
                    },
                    Object.create(null)
                )
                : null
        };
    }
    addProperty_(name, syntax) {
        if (!syntax) {
            return;
        }

        this.properties[name] = this.createDescriptor(syntax, 'Property', name);
    }
    addType_(name, syntax) {
        if (!syntax) {
            return;
        }

        this.types[name] = this.createDescriptor(syntax, 'Type', name);
    }

    checkAtruleName(atruleName) {
        if (!this.getAtrule(atruleName)) {
            return new SyntaxReferenceError('Unknown at-rule', '@' + atruleName);
        }
    }
    checkAtrulePrelude(atruleName, prelude) {
        const error = this.checkAtruleName(atruleName);

        if (error) {
            return error;
        }

        const atrule = this.getAtrule(atruleName);

        if (!atrule.prelude && prelude) {
            return new SyntaxError('At-rule `@' + atruleName + '` should not contain a prelude');
        }

        if (atrule.prelude && !prelude) {
            if (!matchSyntax(this, atrule.prelude, '', false).matched) {
                return new SyntaxError('At-rule `@' + atruleName + '` should contain a prelude');
            }
        }
    }
    checkAtruleDescriptorName(atruleName, descriptorName) {
        const error = this.checkAtruleName(atruleName);

        if (error) {
            return error;
        }

        const atrule = this.getAtrule(atruleName);
        const descriptor = names.keyword(descriptorName);

        if (!atrule.descriptors) {
            return new SyntaxError('At-rule `@' + atruleName + '` has no known descriptors');
        }

        if (!atrule.descriptors[descriptor.name] &&
            !atrule.descriptors[descriptor.basename]) {
            return new SyntaxReferenceError('Unknown at-rule descriptor', descriptorName);
        }
    }
    checkPropertyName(propertyName) {
        if (!this.getProperty(propertyName)) {
            return new SyntaxReferenceError('Unknown property', propertyName);
        }
    }

    matchAtrulePrelude(atruleName, prelude) {
        const error = this.checkAtrulePrelude(atruleName, prelude);

        if (error) {
            return buildMatchResult(null, error);
        }

        const atrule = this.getAtrule(atruleName);

        if (!atrule.prelude) {
            return buildMatchResult(null, null);
        }

        return matchSyntax(this, atrule.prelude, prelude || '', false);
    }
    matchAtruleDescriptor(atruleName, descriptorName, value) {
        const error = this.checkAtruleDescriptorName(atruleName, descriptorName);

        if (error) {
            return buildMatchResult(null, error);
        }

        const atrule = this.getAtrule(atruleName);
        const descriptor = names.keyword(descriptorName);

        return matchSyntax(this, atrule.descriptors[descriptor.name] || atrule.descriptors[descriptor.basename], value, false);
    }
    matchDeclaration(node) {
        if (node.type !== 'Declaration') {
            return buildMatchResult(null, new Error('Not a Declaration node'));
        }

        return this.matchProperty(node.property, node.value);
    }
    matchProperty(propertyName, value) {
        if (
            !this.getProperty(propertyName) &&
            names.property(propertyName).custom
        ) {
            return buildMatchResult(null, new Error('Lexer matching doesn\'t applicable for custom properties'));
        }

        const error = this.checkPropertyName(propertyName);

        if (error) {
            return buildMatchResult(null, error);
        }

        return matchSyntax(this, this.getProperty(propertyName), value, true);
    }
    matchType(typeName, value) {
        const typeSyntax = this.getType(typeName);

        if (!typeSyntax) {
            return buildMatchResult(null, new SyntaxReferenceError('Unknown type', typeName));
        }

        return matchSyntax(this, typeSyntax, value, false);
    }
    match(syntax, value) {
        if (typeof syntax !== 'string' && (!syntax || !syntax.type)) {
            return buildMatchResult(null, new SyntaxReferenceError('Bad syntax'));
        }

        if (typeof syntax === 'string' || !syntax.match) {
            syntax = this.createDescriptor(syntax, 'Type', 'anonymous');
        }

        return matchSyntax(this, syntax, value, false);
    }

    findValueFragments(propertyName, value, type, name) {
        return matchFragments(this, value, this.matchProperty(propertyName, value), type, name);
    }
    findDeclarationValueFragments(declaration, type, name) {
        return matchFragments(this, declaration.value, this.matchDeclaration(declaration), type, name);
    }
    findAllFragments(ast, type, name) {
        const result = [];

        this.syntax.walk(ast, {
            visit: 'Declaration',
            enter: (declaration) => {
                result.push.apply(result, this.findDeclarationValueFragments(declaration, type, name));
            }
        });

        return result;
    }

    getAtrule(atruleName, fallbackBasename = true) {
        const atrule = names.keyword(atruleName);
        const atruleEntry = atrule.vendor && fallbackBasename
            ? this.atrules[atrule.name] || this.atrules[atrule.basename]
            : this.atrules[atrule.name];

        return atruleEntry || null;
    }
    getAtrulePrelude(atruleName, fallbackBasename = true) {
        const atrule = this.getAtrule(atruleName, fallbackBasename);

        return atrule && atrule.prelude || null;
    }
    getAtruleDescriptor(atruleName, name) {
        const atrule = this.getAtrule(atruleName);
        const descriptor = names.keyword(name);
        const descriptorEntry = atrule && atrule.descriptors
            ? atrule.descriptors[descriptor.name] || atrule.descriptors[descriptor.basename]
            : null;

        return descriptorEntry || null;
    }
    getProperty(propertyName, fallbackBasename = true) {
        const property = names.property(propertyName);
        const propertyEntry = property.vendor && fallbackBasename
            ? this.properties[property.name] || this.properties[property.basename]
            : this.properties[property.name];

        return propertyEntry || null;
    }
    getType(name) {
        return hasOwnProperty.call(this.types, name) ? this.types[name] : null;
    }

    validate() {
        function syntaxRef(name, isType) {
            return isType ? `<${name}>` : `<'${name}'>`;
        }

        function validate(syntax, name, broken, descriptor) {
            if (broken.has(name)) {
                return broken.get(name);
            }

            broken.set(name, false);
            if (descriptor.syntax !== null) {
                walk(descriptor.syntax, function(node) {
                    if (node.type !== 'Type' && node.type !== 'Property') {
                        return;
                    }

                    const map = node.type === 'Type' ? syntax.types : syntax.properties;
                    const brokenMap = node.type === 'Type' ? brokenTypes : brokenProperties;

                    if (!hasOwnProperty.call(map, node.name)) {
                        errors.push(`${syntaxRef(name, broken === brokenTypes)} used missed syntax definition ${syntaxRef(node.name, node.type === 'Type')}`);
                        broken.set(name, true);
                    } else if (validate(syntax, node.name, brokenMap, map[node.name])) {
                        errors.push(`${syntaxRef(name, broken === brokenTypes)} used broken syntax definition ${syntaxRef(node.name, node.type === 'Type')}`);
                        broken.set(name, true);
                    }
                }, this);
            }
        }

        const errors = [];
        let brokenTypes = new Map();
        let brokenProperties = new Map();

        for (const key in this.types) {
            validate(this, key, brokenTypes, this.types[key]);
        }

        for (const key in this.properties) {
            validate(this, key, brokenProperties, this.properties[key]);
        }

        const brokenTypesArray = [...brokenTypes.keys()].filter(name => brokenTypes.get(name));
        const brokenPropertiesArray = [...brokenProperties.keys()].filter(name => brokenProperties.get(name));

        if (brokenTypesArray.length || brokenPropertiesArray.length) {
            return {
                errors,
                types: brokenTypesArray,
                properties: brokenPropertiesArray
            };
        }

        return null;
    }
    dump(syntaxAsAst, pretty) {
        return {
            generic: this.generic,
            cssWideKeywords: this.cssWideKeywords,
            units: this.units,
            types: dumpMapSyntax(this.types, !pretty, syntaxAsAst),
            properties: dumpMapSyntax(this.properties, !pretty, syntaxAsAst),
            atrules: dumpAtruleMapSyntax(this.atrules, !pretty, syntaxAsAst)
        };
    }
    toString() {
        return JSON.stringify(this.dump());
    }
};
/ximport { createCustomError } from '../utils/create-custom-error.js';
import { generate } from '../definition-syntax/generate.js';

const defaultLoc = { offset: 0, line: 1, column: 1 };

function locateMismatch(matchResult, node) {
    const tokens = matchResult.tokens;
    const longestMatch = matchResult.longestMatch;
    const mismatchNode = longestMatch < tokens.length ? tokens[longestMatch].node || null : null;
    const badNode = mismatchNode !== node ? mismatchNode : null;
    let mismatchOffset = 0;
    let mismatchLength = 0;
    let entries = 0;
    let css = '';
    let start;
    let end;

    for (let i = 0; i < tokens.length; i++) {
        const token = tokens[i].value;

        if (i === longestMatch) {
            mismatchLength = token.length;
            mismatchOffset = css.length;
        }

        if (badNode !== null && tokens[i].node === badNode) {
            if (i <= longestMatch) {
                entries++;
            } else {
                entries = 0;
            }
        }

        css += token;
    }

    if (longestMatch === tokens.length || entries > 1) { // last
        start = fromLoc(badNode || node, 'end') || buildLoc(defaultLoc, css);
        end = buildLoc(start);
    } else {
        start = fromLoc(badNode, 'start') ||
            buildLoc(fromLoc(node, 'start') || defaultLoc, css.slice(0, mismatchOffset));
        end = fromLoc(badNode, 'end') ||
            buildLoc(start, css.substr(mismatchOffset, mismatchLength));
    }

    return {
        css,
        mismatchOffset,
        mismatchLength,
        start,
        end
    };
}

function fromLoc(node, point) {
    const value = node && node.loc && node.loc[point];

    if (value) {
        return 'line' in value ? buildLoc(value) : value;
    }

    return null;
}

function buildLoc({ offset, line, column }, extra) {
    const loc = {
        offset,
        line,
        column
    };

    if (extra) {
        const lines = extra.split(/\n|\r\n?|\f/);

        loc.offset += extra.length;
        loc.line += lines.length - 1;
        loc.column = lines.length === 1 ? loc.column + extra.length : lines.pop().length + 1;
    }

    return loc;
}

export const SyntaxReferenceError = function(type, referenceName) {
    const error = createCustomError(
        'SyntaxReferenceError',
        type + (referenceName ? ' `' + referenceName + '`' : '')
    );

    error.reference = referenceName;

    return error;
};

export const SyntaxMatchError = function(message, syntax, node, matchResult) {
    const error = createCustomError('SyntaxMatchError', message);
    const {
        css,
        mismatchOffset,
        mismatchLength,
        start,
        end
    } = locateMismatch(matchResult, node);

    error.rawMessage = message;
    error.syntax = syntax ? generate(syntax) : '<generic>';
    error.css = css;
    error.mismatchOffset = mismatchOffset;
    error.mismatchLength = mismatchLength;
    error.message = message + '\n' +
        '  syntax: ' + error.syntax + '\n' +
        '   value: ' + (css || '<empty string>') + '\n' +
        '  --------' + new Array(error.mismatchOffset + 1).join('-') + '^';

    Object.assign(error, start);
    error.loc = {
        source: (node && node.loc && node.loc.source) || '<unknown>',
        start,
        end
    };

    return error;
};
~ٰx import {
    isDigit,
    cmpChar,
    Delim,
    WhiteSpace,
    Comment,
    Ident,
    Number as NumberToken,
    Dimension
} from '../tokenizer/index.js';

const PLUSSIGN = 0x002B;    // U+002B PLUS SIGN (+)
const HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)
const N = 0x006E;           // U+006E LATIN SMALL LETTER N (n)
const DISALLOW_SIGN = true;
const ALLOW_SIGN = false;

function isDelim(token, code) {
    return token !== null && token.type === Delim && token.value.charCodeAt(0) === code;
}

function skipSC(token, offset, getNextToken) {
    while (token !== null && (token.type === WhiteSpace || token.type === Comment)) {
        token = getNextToken(++offset);
    }

    return offset;
}

function checkInteger(token, valueOffset, disallowSign, offset) {
    if (!token) {
        return 0;
    }

    const code = token.value.charCodeAt(valueOffset);

    if (code === PLUSSIGN || code === HYPHENMINUS) {
        if (disallowSign) {
            // Number sign is not allowed
            return 0;
        }
        valueOffset++;
    }

    for (; valueOffset < token.value.length; valueOffset++) {
        if (!isDigit(token.value.charCodeAt(valueOffset))) {
            // Integer is expected
            return 0;
        }
    }

    return offset + 1;
}

// ... <signed-integer>
// ... ['+' | '-'] <signless-integer>
function consumeB(token, offset_, getNextToken) {
    let sign = false;
    let offset = skipSC(token, offset_, getNextToken);

    token = getNextToken(offset);

    if (token === null) {
        return offset_;
    }

    if (token.type !== NumberToken) {
        if (isDelim(token, PLUSSIGN) || isDelim(token, HYPHENMINUS)) {
            sign = true;
            offset = skipSC(getNextToken(++offset), offset, getNextToken);
            token = getNextToken(offset);

            if (token === null || token.type !== NumberToken) {
                return 0;
            }
        } else {
            return offset_;
        }
    }

    if (!sign) {
        const code = token.value.charCodeAt(0);
        if (code !== PLUSSIGN && code !== HYPHENMINUS) {
            // Number sign is expected
            return 0;
        }
    }

    return checkInteger(token, sign ? 0 : 1, sign, offset);
}

// An+B microsyntax https://www.w3.org/TR/css-syntax-3/#anb
export default function anPlusB(token, getNextToken) {
    /* eslint-disable brace-style*/
    let offset = 0;

    if (!token) {
        return 0;
    }

    // <integer>
    if (token.type === NumberToken) {
        return checkInteger(token, 0, ALLOW_SIGN, offset); // b
    }

    // -n
    // -n <signed-integer>
    // -n ['+' | '-'] <signless-integer>
    // -n- <signless-integer>
    // <dashndashdigit-ident>
    else if (token.type === Ident && token.value.charCodeAt(0) === HYPHENMINUS) {
        // expect 1st char is N
        if (!cmpChar(token.value, 1, N)) {
            return 0;
        }

        switch (token.value.length) {
            // -n
            // -n <signed-integer>
            // -n ['+' | '-'] <signless-integer>
            case 2:
                return consumeB(getNextToken(++offset), offset, getNextToken);

            // -n- <signless-integer>
            case 3:
                if (token.value.charCodeAt(2) !== HYPHENMINUS) {
                    return 0;
                }

                offset = skipSC(getNextToken(++offset), offset, getNextToken);
                token = getNextToken(offset);

                return checkInteger(token, 0, DISALLOW_SIGN, offset);

            // <dashndashdigit-ident>
            default:
                if (token.value.charCodeAt(2) !== HYPHENMINUS) {
                    return 0;
                }

                return checkInteger(token, 3, DISALLOW_SIGN, offset);
        }
    }

    // '+'? n
    // '+'? n <signed-integer>
    // '+'? n ['+' | '-'] <signless-integer>
    // '+'? n- <signless-integer>
    // '+'? <ndashdigit-ident>
    else if (token.type === Ident || (isDelim(token, PLUSSIGN) && getNextToken(offset + 1).type === Ident)) {
        // just ignore a plus
        if (token.type !== Ident) {
            token = getNextToken(++offset);
        }

        if (token === null || !cmpChar(token.value, 0, N)) {
            return 0;
        }

        switch (token.value.length) {
            // '+'? n
            // '+'? n <signed-integer>
            // '+'? n ['+' | '-'] <signless-integer>
            case 1:
                return consumeB(getNextToken(++offset), offset, getNextToken);

            // '+'? n- <signless-integer>
            case 2:
                if (token.value.charCodeAt(1) !== HYPHENMINUS) {
                    return 0;
                }

                offset = skipSC(getNextToken(++offset), offset, getNextToken);
                token = getNextToken(offset);

                return checkInteger(token, 0, DISALLOW_SIGN, offset);

            // '+'? <ndashdigit-ident>
            default:
                if (token.value.charCodeAt(1) !== HYPHENMINUS) {
                    return 0;
                }

                return checkInteger(token, 2, DISALLOW_SIGN, offset);
        }
    }

    // <ndashdigit-dimension>
    // <ndash-dimension> <signless-integer>
    // <n-dimension>
    // <n-dimension> <signed-integer>
    // <n-dimension> ['+' | '-'] <signless-integer>
    else if (token.type === Dimension) {
        let code = token.value.charCodeAt(0);
        let sign = code === PLUSSIGN || code === HYPHENMINUS ? 1 : 0;
        let i = sign;

        for (; i < token.value.length; i++) {
            if (!isDigit(token.value.charCodeAt(i))) {
                break;
            }
        }

        if (i === sign) {
            // Integer is expected
            return 0;
        }

        if (!cmpChar(token.value, i, N)) {
            return 0;
        }

        // <n-dimension>
        // <n-dimension> <signed-integer>
        // <n-dimension> ['+' | '-'] <signless-integer>
        if (i + 1 === token.value.length) {
            return consumeB(getNextToken(++offset), offset, getNextToken);
        } else {
            if (token.value.charCodeAt(i + 1) !== HYPHENMINUS) {
                return 0;
            }

            // <ndash-dimension> <signless-integer>
            if (i + 2 === token.value.length) {
                offset = skipSC(getNextToken(++offset), offset, getNextToken);
                token = getNextToken(offset);

                return checkInteger(token, 0, DISALLOW_SIGN, offset);
            }
            // <ndashdigit-dimension>
            else {
                return checkInteger(token, i + 2, DISALLOW_SIGN, offset);
            }
        }
    }

    return 0;
};
$x&*	x d// https://drafts.csswg.org/css-cascade-5/
export const cssWideKeywords = [
    'initial',
    'inherit',
    'unset',
    'revert',
    'revert-layer'
];
t]/¸ximport {
    isHexDigit,
    cmpChar,
    Ident,
    Delim,
    Number as NumberToken,
    Dimension
} from '../tokenizer/index.js';

const PLUSSIGN = 0x002B;     // U+002B PLUS SIGN (+)
const HYPHENMINUS = 0x002D;  // U+002D HYPHEN-MINUS (-)
const QUESTIONMARK = 0x003F; // U+003F QUESTION MARK (?)
const U = 0x0075;            // U+0075 LATIN SMALL LETTER U (u)

function isDelim(token, code) {
    return token !== null && token.type === Delim && token.value.charCodeAt(0) === code;
}

function startsWith(token, code) {
    return token.value.charCodeAt(0) === code;
}

function hexSequence(token, offset, allowDash) {
    let hexlen = 0;

    for (let pos = offset; pos < token.value.length; pos++) {
        const code = token.value.charCodeAt(pos);

        if (code === HYPHENMINUS && allowDash && hexlen !== 0) {
            hexSequence(token, offset + hexlen + 1, false);
            return 6; // dissallow following question marks
        }

        if (!isHexDigit(code)) {
            return 0; // not a hex digit
        }

        if (++hexlen > 6) {
            return 0; // too many hex digits
        };
    }

    return hexlen;
}

function withQuestionMarkSequence(consumed, length, getNextToken) {
    if (!consumed) {
        return 0; // nothing consumed
    }

    while (isDelim(getNextToken(length), QUESTIONMARK)) {
        if (++consumed > 6) {
            return 0; // too many question marks
        }

        length++;
    }

    return length;
}

// https://drafts.csswg.org/css-syntax/#urange
// Informally, the <urange> production has three forms:
// U+0001
//      Defines a range consisting of a single code point, in this case the code point "1".
// U+0001-00ff
//      Defines a range of codepoints between the first and the second value, in this case
//      the range between "1" and "ff" (255 in decimal) inclusive.
// U+00??
//      Defines a range of codepoints where the "?" characters range over all hex digits,
//      in this case defining the same as the value U+0000-00ff.
// In each form, a maximum of 6 digits is allowed for each hexadecimal number (if you treat "?" as a hexadecimal digit).
//
// <urange> =
//   u '+' <ident-token> '?'* |
//   u <dimension-token> '?'* |
//   u <number-token> '?'* |
//   u <number-token> <dimension-token> |
//   u <number-token> <number-token> |
//   u '+' '?'+
export default function urange(token, getNextToken) {
    let length = 0;

    // should start with `u` or `U`
    if (token === null || token.type !== Ident || !cmpChar(token.value, 0, U)) {
        return 0;
    }

    token = getNextToken(++length);
    if (token === null) {
        return 0;
    }

    // u '+' <ident-token> '?'*
    // u '+' '?'+
    if (isDelim(token, PLUSSIGN)) {
        token = getNextToken(++length);
        if (token === null) {
            return 0;
        }

        if (token.type === Ident) {
            // u '+' <ident-token> '?'*
            return withQuestionMarkSequence(hexSequence(token, 0, true), ++length, getNextToken);
        }

        if (isDelim(token, QUESTIONMARK)) {
            // u '+' '?'+
            return withQuestionMarkSequence(1, ++length, getNextToken);
        }

        // Hex digit or question mark is expected
        return 0;
    }

    // u <number-token> '?'*
    // u <number-token> <dimension-token>
    // u <number-token> <number-token>
    if (token.type === NumberToken) {
        const consumedHexLength = hexSequence(token, 1, true);
        if (consumedHexLength === 0) {
            return 0;
        }

        token = getNextToken(++length);
        if (token === null) {
            // u <number-token> <eof>
            return length;
        }

        if (token.type === Dimension || token.type === NumberToken) {
            // u <number-token> <dimension-token>
            // u <number-token> <number-token>
            if (!startsWith(token, HYPHENMINUS) || !hexSequence(token, 1, false)) {
                return 0;
            }

            return length + 1;
        }

        // u <number-token> '?'*
        return withQuestionMarkSequence(consumedHexLength, length, getNextToken);
    }

    // u <dimension-token> '?'*
    if (token.type === Dimension) {
        return withQuestionMarkSequence(hexSequence(token, 1, true), ++length, getNextToken);
    }

    return 0;
};
Hھ
xPimport { cssWideKeywords } from './generic-const.js';
import anPlusB from './generic-an-plus-b.js';
import urange from './generic-urange.js';
import {
    isIdentifierStart,
    isHexDigit,
    isDigit,
    cmpStr,
    consumeNumber,

    Ident,
    Function as FunctionToken,
    AtKeyword,
    Hash,
    String as StringToken,
    BadString,
    Url,
    BadUrl,
    Delim,
    Number as NumberToken,
    Percentage,
    Dimension,
    WhiteSpace,
    CDO,
    CDC,
    Colon,
    Semicolon,
    Comma,
    LeftSquareBracket,
    RightSquareBracket,
    LeftParenthesis,
    RightParenthesis,
    LeftCurlyBracket,
    RightCurlyBracket
} from '../tokenizer/index.js';

// CSS mathematical functions categorized by return type behavior
// See: https://www.w3.org/TR/css-values-4/#math

// Calculation functions that return different types depending on input
const calcFunctionNames = [
    'calc(',
    '-moz-calc(',
    '-webkit-calc('
];

// Comparison functions that return different types depending on input
const comparisonFunctionNames = [
    'min(',
    'max(',
    'clamp('
];

// Functions that return a stepped value, i.e. a value that is rounded to the nearest step
const steppedValueFunctionNames = [
    'round(',
    'mod(',
    'rem('
];

// Trigonometrical functions that return a <number>
const trigNumberFunctionNames = [
    'sin(',
    'cos(',
    'tan('
];

// Trigonometrical functions that return a <angle>
const trigAngleFunctionNames = [
    'asin(',
    'acos(',
    'atan(',
    'atan2('
];

// Other functions that return a <number>
const otherNumberFunctionNames = [
    'pow(',
    'sqrt(',
    'log(',
    'exp(',
    'sign('
];

// Exponential functions that return a <number> or <dimension> or <percentage>
const expNumberDimensionPercentageFunctionNames = [
    'hypot('
];

// Return the same type as the input
const signFunctionNames = [
    'abs('
];

const numberFunctionNames = [
    ...calcFunctionNames,
    ...comparisonFunctionNames,
    ...steppedValueFunctionNames,
    ...trigNumberFunctionNames,
    ...otherNumberFunctionNames,
    ...expNumberDimensionPercentageFunctionNames,
    ...signFunctionNames
];

const percentageFunctionNames = [
    ...calcFunctionNames,
    ...comparisonFunctionNames,
    ...steppedValueFunctionNames,
    ...expNumberDimensionPercentageFunctionNames,
    ...signFunctionNames
];

const dimensionFunctionNames = [
    ...calcFunctionNames,
    ...comparisonFunctionNames,
    ...steppedValueFunctionNames,
    ...trigAngleFunctionNames,
    ...expNumberDimensionPercentageFunctionNames,
    ...signFunctionNames
];

const balancePair = new Map([
    [FunctionToken, RightParenthesis],
    [LeftParenthesis, RightParenthesis],
    [LeftSquareBracket, RightSquareBracket],
    [LeftCurlyBracket, RightCurlyBracket]
]);

// safe char code getter
function charCodeAt(str, index) {
    return index < str.length ? str.charCodeAt(index) : 0;
}

function eqStr(actual, expected) {
    return cmpStr(actual, 0, actual.length, expected);
}

function eqStrAny(actual, expected) {
    for (let i = 0; i < expected.length; i++) {
        if (eqStr(actual, expected[i])) {
            return true;
        }
    }

    return false;
}

// IE postfix hack, i.e. 123\0 or 123px\9
function isPostfixIeHack(str, offset) {
    if (offset !== str.length - 2) {
        return false;
    }

    return (
        charCodeAt(str, offset) === 0x005C &&  // U+005C REVERSE SOLIDUS (\)
        isDigit(charCodeAt(str, offset + 1))
    );
}

function outOfRange(opts, value, numEnd) {
    if (opts && opts.type === 'Range') {
        const num = Number(
            numEnd !== undefined && numEnd !== value.length
                ? value.substr(0, numEnd)
                : value
        );

        if (isNaN(num)) {
            return true;
        }

        // FIXME: when opts.min is a string it's a dimension, skip a range validation
        // for now since it requires a type covertation which is not implmented yet
        if (opts.min !== null && num < opts.min && typeof opts.min !== 'string') {
            return true;
        }

        // FIXME: when opts.max is a string it's a dimension, skip a range validation
        // for now since it requires a type covertation which is not implmented yet
        if (opts.max !== null && num > opts.max && typeof opts.max !== 'string') {
            return true;
        }
    }

    return false;
}

function consumeFunction(token, getNextToken) {
    let balanceCloseType = 0;
    let balanceStash = [];
    let length = 0;

    // balanced token consuming
    scan:
    do {
        switch (token.type) {
            case RightCurlyBracket:
            case RightParenthesis:
            case RightSquareBracket:
                if (token.type !== balanceCloseType) {
                    break scan;
                }

                balanceCloseType = balanceStash.pop();

                if (balanceStash.length === 0) {
                    length++;
                    break scan;
                }

                break;

            case FunctionToken:
            case LeftParenthesis:
            case LeftSquareBracket:
            case LeftCurlyBracket:
                balanceStash.push(balanceCloseType);
                balanceCloseType = balancePair.get(token.type);
                break;
        }

        length++;
    } while (token = getNextToken(length));

    return length;
}


// TODO: implement
// can be used wherever <length>, <frequency>, <angle>, <time>, <percentage>, <number>, or <integer> values are allowed
// https://drafts.csswg.org/css-values/#calc-notation
function math(next, functionNames) {
    return function(token, getNextToken, opts) {
        if (token === null) {
            return 0;
        }

        if (token.type === FunctionToken && eqStrAny(token.value, functionNames)) {
            return consumeFunction(token, getNextToken);
        }

        return next(token, getNextToken, opts);
    };
}

function tokenType(expectedTokenType) {
    return function(token) {
        if (token === null || token.type !== expectedTokenType) {
            return 0;
        }

        return 1;
    };
}

// =========================
// Complex types
//

// https://drafts.csswg.org/css-values-4/#custom-idents
// 4.2. Author-defined Identifiers: the <custom-ident> type
// Some properties accept arbitrary author-defined identifiers as a component value.
// This generic data type is denoted by <custom-ident>, and represents any valid CSS identifier
// that would not be misinterpreted as a pre-defined keyword in that property’s value definition.
//
// See also: https://developer.mozilla.org/en-US/docs/Web/CSS/custom-ident
function customIdent(token) {
    if (token === null || token.type !== Ident) {
        return 0;
    }

    const name = token.value.toLowerCase();

    // The CSS-wide keywords are not valid <custom-ident>s
    if (eqStrAny(name, cssWideKeywords)) {
        return 0;
    }

    // The default keyword is reserved and is also not a valid <custom-ident>
    if (eqStr(name, 'default')) {
        return 0;
    }

    // TODO: ignore property specific keywords (as described https://developer.mozilla.org/en-US/docs/Web/CSS/custom-ident)
    // Specifications using <custom-ident> must specify clearly what other keywords
    // are excluded from <custom-ident>, if any—for example by saying that any pre-defined keywords
    // in that property’s value definition are excluded. Excluded keywords are excluded
    // in all ASCII case permutations.

    return 1;
}

// https://drafts.csswg.org/css-values-4/#dashed-idents
// The <dashed-ident> production is a <custom-ident>, with all the case-sensitivity that implies,
// with the additional restriction that it must start with two dashes (U+002D HYPHEN-MINUS).
function dashedIdent(token) {
    if (token === null || token.type !== Ident) {
        return 0;
    }

    // ... must start with two dashes (U+002D HYPHEN-MINUS)
    if (charCodeAt(token.value, 0) !== 0x002D || charCodeAt(token.value, 1) !== 0x002D) {
        return 0;
    }

    return 1;
}

// https://drafts.csswg.org/css-variables/#typedef-custom-property-name
// A custom property is any property whose name starts with two dashes (U+002D HYPHEN-MINUS), like --foo.
// The <custom-property-name> production corresponds to this: it’s defined as any <dashed-ident>
// (a valid identifier that starts with two dashes), except -- itself, which is reserved for future use by CSS.
function customPropertyName(token) {
    // ... it’s defined as any <dashed-ident>
    if (!dashedIdent(token)) {
        return 0;
    }

    // ... except -- itself, which is reserved for future use by CSS
    if (token.value === '--') {
        return 0;
    }

    return 1;
}

// https://drafts.csswg.org/css-color-4/#hex-notation
// The syntax of a <hex-color> is a <hash-token> token whose value consists of 3, 4, 6, or 8 hexadecimal digits.
// In other words, a hex color is written as a hash character, "#", followed by some number of digits 0-9 or
// letters a-f (the case of the letters doesn’t matter - #00ff00 is identical to #00FF00).
function hexColor(token) {
    if (token === null || token.type !== Hash) {
        return 0;
    }

    const length = token.value.length;

    // valid values (length): #rgb (4), #rgba (5), #rrggbb (7), #rrggbbaa (9)
    if (length !== 4 && length !== 5 && length !== 7 && length !== 9) {
        return 0;
    }

    for (let i = 1; i < length; i++) {
        if (!isHexDigit(charCodeAt(token.value, i))) {
            return 0;
        }
    }

    return 1;
}

function idSelector(token) {
    if (token === null || token.type !== Hash) {
        return 0;
    }

    if (!isIdentifierStart(charCodeAt(token.value, 1), charCodeAt(token.value, 2), charCodeAt(token.value, 3))) {
        return 0;
    }

    return 1;
}

// https://drafts.csswg.org/css-syntax/#any-value
// It represents the entirety of what a valid declaration can have as its value.
function declarationValue(token, getNextToken) {
    if (!token) {
        return 0;
    }

    let balanceCloseType = 0;
    let balanceStash = [];
    let length = 0;

    // The <declaration-value> production matches any sequence of one or more tokens,
    // so long as the sequence does not contain ...
    scan:
    do {
        switch (token.type) {
            // ... <bad-string-token>, <bad-url-token>,
            case BadString:
            case BadUrl:
                break scan;

            // ... unmatched <)-token>, <]-token>, or <}-token>,
            case RightCurlyBracket:
            case RightParenthesis:
            case RightSquareBracket:
                if (token.type !== balanceCloseType) {
                    break scan;
                }

                balanceCloseType = balanceStash.pop();
                break;

            // ... or top-level <semicolon-token> tokens
            case Semicolon:
                if (balanceCloseType === 0) {
                    break scan;
                }

                break;

            // ... or <delim-token> tokens with a value of "!"
            case Delim:
                if (balanceCloseType === 0 && token.value === '!') {
                    break scan;
                }

                break;

            case FunctionToken:
            case LeftParenthesis:
            case LeftSquareBracket:
            case LeftCurlyBracket:
                balanceStash.push(balanceCloseType);
                balanceCloseType = balancePair.get(token.type);
                break;
        }

        length++;
    } while (token = getNextToken(length));

    return length;
}

// https://drafts.csswg.org/css-syntax/#any-value
// The <any-value> production is identical to <declaration-value>, but also
// allows top-level <semicolon-token> tokens and <delim-token> tokens
// with a value of "!". It represents the entirety of what valid CSS can be in any context.
function anyValue(token, getNextToken) {
    if (!token) {
        return 0;
    }

    let balanceCloseType = 0;
    let balanceStash = [];
    let length = 0;

    // The <any-value> production matches any sequence of one or more tokens,
    // so long as the sequence ...
    scan:
    do {
        switch (token.type) {
            // ... does not contain <bad-string-token>, <bad-url-token>,
            case BadString:
            case BadUrl:
                break scan;

            // ... unmatched <)-token>, <]-token>, or <}-token>,
            case RightCurlyBracket:
            case RightParenthesis:
            case RightSquareBracket:
                if (token.type !== balanceCloseType) {
                    break scan;
                }

                balanceCloseType = balanceStash.pop();
                break;

            case FunctionToken:
            case LeftParenthesis:
            case LeftSquareBracket:
            case LeftCurlyBracket:
                balanceStash.push(balanceCloseType);
                balanceCloseType = balancePair.get(token.type);
                break;
        }

        length++;
    } while (token = getNextToken(length));

    return length;
}

// =========================
// Dimensions
//

function dimension(type) {
    if (type) {
        type = new Set(type);
    }

    return function(token, getNextToken, opts) {
        if (token === null || token.type !== Dimension) {
            return 0;
        }

        const numberEnd = consumeNumber(token.value, 0);

        // check unit
        if (type !== null) {
            // check for IE postfix hack, i.e. 123px\0 or 123px\9
            const reverseSolidusOffset = token.value.indexOf('\\', numberEnd);
            const unit = reverseSolidusOffset === -1 || !isPostfixIeHack(token.value, reverseSolidusOffset)
                ? token.value.substr(numberEnd)
                : token.value.substring(numberEnd, reverseSolidusOffset);

            if (type.has(unit.toLowerCase()) === false) {
                return 0;
            }
        }

        // check range if specified
        if (outOfRange(opts, token.value, numberEnd)) {
            return 0;
        }

        return 1;
    };
}

// =========================
// Percentage
//

// §5.5. Percentages: the <percentage> type
// https://drafts.csswg.org/css-values-4/#percentages
function percentage(token, getNextToken, opts) {
    // ... corresponds to the <percentage-token> production
    if (token === null || token.type !== Percentage) {
        return 0;
    }

    // check range if specified
    if (outOfRange(opts, token.value, token.value.length - 1)) {
        return 0;
    }

    return 1;
}

// =========================
// Numeric
//

// https://drafts.csswg.org/css-values-4/#numbers
// The value <zero> represents a literal number with the value 0. Expressions that merely
// evaluate to a <number> with the value 0 (for example, calc(0)) do not match <zero>;
// only literal <number-token>s do.
function zero(next) {
    if (typeof next !== 'function') {
        next = function() {
            return 0;
        };
    }

    return function(token, getNextToken, opts) {
        if (token !== null && token.type === NumberToken) {
            if (Number(token.value) === 0) {
                return 1;
            }
        }

        return next(token, getNextToken, opts);
    };
}

// § 5.3. Real Numbers: the <number> type
// https://drafts.csswg.org/css-values-4/#numbers
// Number values are denoted by <number>, and represent real numbers, possibly with a fractional component.
// ... It corresponds to the <number-token> production
function number(token, getNextToken, opts) {
    if (token === null) {
        return 0;
    }

    const numberEnd = consumeNumber(token.value, 0);
    const isNumber = numberEnd === token.value.length;
    if (!isNumber && !isPostfixIeHack(token.value, numberEnd)) {
        return 0;
    }

    // check range if specified
    if (outOfRange(opts, token.value, numberEnd)) {
        return 0;
    }

    return 1;
}

// §5.2. Integers: the <integer> type
// https://drafts.csswg.org/css-values-4/#integers
function integer(token, getNextToken, opts) {
    // ... corresponds to a subset of the <number-token> production
    if (token === null || token.type !== NumberToken) {
        return 0;
    }

    // The first digit of an integer may be immediately preceded by `-` or `+` to indicate the integer’s sign.
    let i = charCodeAt(token.value, 0) === 0x002B ||       // U+002B PLUS SIGN (+)
            charCodeAt(token.value, 0) === 0x002D ? 1 : 0; // U+002D HYPHEN-MINUS (-)

    // When written literally, an integer is one or more decimal digits 0 through 9 ...
    for (; i < token.value.length; i++) {
        if (!isDigit(charCodeAt(token.value, i))) {
            return 0;
        }
    }

    // check range if specified
    if (outOfRange(opts, token.value, i)) {
        return 0;
    }

    return 1;
}

// token types
export const tokenTypes = {
    'ident-token': tokenType(Ident),
    'function-token': tokenType(FunctionToken),
    'at-keyword-token': tokenType(AtKeyword),
    'hash-token': tokenType(Hash),
    'string-token': tokenType(StringToken),
    'bad-string-token': tokenType(BadString),
    'url-token': tokenType(Url),
    'bad-url-token': tokenType(BadUrl),
    'delim-token': tokenType(Delim),
    'number-token': tokenType(NumberToken),
    'percentage-token': tokenType(Percentage),
    'dimension-token': tokenType(Dimension),
    'whitespace-token': tokenType(WhiteSpace),
    'CDO-token': tokenType(CDO),
    'CDC-token': tokenType(CDC),
    'colon-token': tokenType(Colon),
    'semicolon-token': tokenType(Semicolon),
    'comma-token': tokenType(Comma),
    '[-token': tokenType(LeftSquareBracket),
    ']-token': tokenType(RightSquareBracket),
    '(-token': tokenType(LeftParenthesis),
    ')-token': tokenType(RightParenthesis),
    '{-token': tokenType(LeftCurlyBracket),
    '}-token': tokenType(RightCurlyBracket)
};

// token production types
export const productionTypes = {
    // token type aliases
    'string': tokenType(StringToken),
    'ident': tokenType(Ident),

    // percentage
    'percentage': math(percentage, percentageFunctionNames),

    // numeric
    'zero': zero(),
    'number': math(number, numberFunctionNames),
    'integer': math(integer, numberFunctionNames),

    // complex types
    'custom-ident': customIdent,
    'dashed-ident': dashedIdent,
    'custom-property-name': customPropertyName,
    'hex-color': hexColor,
    'id-selector': idSelector, // element( <id-selector> )
    'an-plus-b': anPlusB,
    'urange': urange,
    'declaration-value': declarationValue,
    'any-value': anyValue
};

export const unitGroups = [
    'length',
    'angle',
    'time',
    'frequency',
    'resolution',
    'flex',
    'decibel',
    'semitones'
];

// dimensions types depend on units set
export function createDemensionTypes(units) {
    const {
        angle,
        decibel,
        frequency,
        flex,
        length,
        resolution,
        semitones,
        time
    } = units || {};

    return {
        'dimension': math(dimension(null), dimensionFunctionNames),
        'angle': math(dimension(angle), dimensionFunctionNames),
        'decibel': math(dimension(decibel), dimensionFunctionNames),
        'frequency': math(dimension(frequency), dimensionFunctionNames),
        'flex': math(dimension(flex), dimensionFunctionNames),
        'length': math(zero(dimension(length)), dimensionFunctionNames),
        'resolution': math(dimension(resolution), dimensionFunctionNames),
        'semitones': math(dimension(semitones), dimensionFunctionNames),
        'time': math(dimension(time), dimensionFunctionNames)
    };
}

// The <attr-unit> production matches any identifier that is an ASCII case-insensitive
// match for the name of a CSS dimension unit, such as px, or the <delim-token> %.
function createAttrUnit(units) {
    const unitSet = new Set();

    for (const group of unitGroups) {
        if (Array.isArray(units[group])) {
            for (const unit of units[group]) {
                unitSet.add(unit.toLowerCase());
            }
        }
    }

    return function attrUnit(token) {
        if (token === null) {
            return 0;
        }

        if (token.type === Delim && token.value === '%') {
            return 1;
        }

        if (token.type === Ident && unitSet.has(token.value.toLowerCase())) {
            return 1;
        }

        return 0;
    };
}

export function createGenericTypes(units) {
    return {
        ...tokenTypes,
        ...productionTypes,
        ...createDemensionTypes(units),
        'attr-unit': createAttrUnit(units)
    };
};
#
x$ export { Lexer } from './Lexer.js';
꿼x;0import { parse } from '../definition-syntax/parse.js';

export const MATCH = { type: 'Match' };
export const MISMATCH = { type: 'Mismatch' };
export const DISALLOW_EMPTY = { type: 'DisallowEmpty' };

const LEFTPARENTHESIS = 40;  // (
const RIGHTPARENTHESIS = 41; // )

function createCondition(match, thenBranch, elseBranch) {
    // reduce node count
    if (thenBranch === MATCH && elseBranch === MISMATCH) {
        return match;
    }

    if (match === MATCH && thenBranch === MATCH && elseBranch === MATCH) {
        return match;
    }

    if (match.type === 'If' && match.else === MISMATCH && thenBranch === MATCH) {
        thenBranch = match.then;
        match = match.match;
    }

    return {
        type: 'If',
        match,
        then: thenBranch,
        else: elseBranch
    };
}

function isFunctionType(name) {
    return (
        name.length > 2 &&
        name.charCodeAt(name.length - 2) === LEFTPARENTHESIS &&
        name.charCodeAt(name.length - 1) === RIGHTPARENTHESIS
    );
}

function isEnumCapatible(term) {
    return (
        term.type === 'Keyword' ||
        term.type === 'AtKeyword' ||
        term.type === 'Function' ||
        term.type === 'Type' && isFunctionType(term.name)
    );
}

function groupNode(terms, combinator = ' ', explicit = false) {
    return {
        type: 'Group',
        terms,
        combinator,
        disallowEmpty: false,
        explicit
    };
}

function replaceTypeInGraph(node, replacements, visited = new Set()) {
    if (!visited.has(node)) {
        visited.add(node);

        switch (node.type) {
            case 'If':
                node.match = replaceTypeInGraph(node.match, replacements, visited);
                node.then = replaceTypeInGraph(node.then, replacements, visited);
                node.else = replaceTypeInGraph(node.else, replacements, visited);
                break;

            case 'Type':
                return replacements[node.name] || node;
        }
    }

    return node;
}

function buildGroupMatchGraph(combinator, terms, atLeastOneTermMatched) {
    switch (combinator) {
        case ' ': {
            // Juxtaposing components means that all of them must occur, in the given order.
            //
            // a b c
            // =
            // match a
            //   then match b
            //     then match c
            //       then MATCH
            //       else MISMATCH
            //     else MISMATCH
            //   else MISMATCH
            let result = MATCH;

            for (let i = terms.length - 1; i >= 0; i--) {
                const term = terms[i];

                result = createCondition(
                    term,
                    result,
                    MISMATCH
                );
            };

            return result;
        }

        case '|': {
            // A bar (|) separates two or more alternatives: exactly one of them must occur.
            //
            // a | b | c
            // =
            // match a
            //   then MATCH
            //   else match b
            //     then MATCH
            //     else match c
            //       then MATCH
            //       else MISMATCH

            let result = MISMATCH;
            let map = null;

            for (let i = terms.length - 1; i >= 0; i--) {
                let term = terms[i];

                // reduce sequence of keywords into a Enum
                if (isEnumCapatible(term)) {
                    if (map === null && i > 0 && isEnumCapatible(terms[i - 1])) {
                        map = Object.create(null);
                        result = createCondition(
                            {
                                type: 'Enum',
                                map
                            },
                            MATCH,
                            result
                        );
                    }

                    if (map !== null) {
                        const key = (isFunctionType(term.name) ? term.name.slice(0, -1) : term.name).toLowerCase();
                        if (key in map === false) {
                            map[key] = term;
                            continue;
                        }
                    }
                }

                map = null;

                // create a new conditonal node
                result = createCondition(
                    term,
                    MATCH,
                    result
                );
            };

            return result;
        }

        case '&&': {
            // A double ampersand (&&) separates two or more components,
            // all of which must occur, in any order.

            // Use MatchOnce for groups with a large number of terms,
            // since &&-groups produces at least N!-node trees
            if (terms.length > 5) {
                return {
                    type: 'MatchOnce',
                    terms,
                    all: true
                };
            }

            // Use a combination tree for groups with small number of terms
            //
            // a && b && c
            // =
            // match a
            //   then [b && c]
            //   else match b
            //     then [a && c]
            //     else match c
            //       then [a && b]
            //       else MISMATCH
            //
            // a && b
            // =
            // match a
            //   then match b
            //     then MATCH
            //     else MISMATCH
            //   else match b
            //     then match a
            //       then MATCH
            //       else MISMATCH
            //     else MISMATCH
            let result = MISMATCH;

            for (let i = terms.length - 1; i >= 0; i--) {
                const term = terms[i];
                let thenClause;

                if (terms.length > 1) {
                    thenClause = buildGroupMatchGraph(
                        combinator,
                        terms.filter(function(newGroupTerm) {
                            return newGroupTerm !== term;
                        }),
                        false
                    );
                } else {
                    thenClause = MATCH;
                }

                result = createCondition(
                    term,
                    thenClause,
                    result
                );
            };

            return result;
        }

        case '||': {
            // A double bar (||) separates two or more options:
            // one or more of them must occur, in any order.

            // Use MatchOnce for groups with a large number of terms,
            // since ||-groups produces at least N!-node trees
            if (terms.length > 5) {
                return {
                    type: 'MatchOnce',
                    terms,
                    all: false
                };
            }

            // Use a combination tree for groups with small number of terms
            //
            // a || b || c
            // =
            // match a
            //   then [b || c]
            //   else match b
            //     then [a || c]
            //     else match c
            //       then [a || b]
            //       else MISMATCH
            //
            // a || b
            // =
            // match a
            //   then match b
            //     then MATCH
            //     else MATCH
            //   else match b
            //     then match a
            //       then MATCH
            //       else MATCH
            //     else MISMATCH
            let result = atLeastOneTermMatched ? MATCH : MISMATCH;

            for (let i = terms.length - 1; i >= 0; i--) {
                const term = terms[i];
                let thenClause;

                if (terms.length > 1) {
                    thenClause = buildGroupMatchGraph(
                        combinator,
                        terms.filter(function(newGroupTerm) {
                            return newGroupTerm !== term;
                        }),
                        true
                    );
                } else {
                    thenClause = MATCH;
                }

                result = createCondition(
                    term,
                    thenClause,
                    result
                );
            };

            return result;
        }
    }
}

function buildMultiplierMatchGraph(node) {
    let result = MATCH;
    let matchTerm = buildMatchGraphInternal(node.term);

    if (node.max === 0) {
        // disable repeating of empty match to prevent infinite loop
        matchTerm = createCondition(
            matchTerm,
            DISALLOW_EMPTY,
            MISMATCH
        );

        // an occurrence count is not limited, make a cycle;
        // to collect more terms on each following matching mismatch
        result = createCondition(
            matchTerm,
            null, // will be a loop
            MISMATCH
        );

        result.then = createCondition(
            MATCH,
            MATCH,
            result // make a loop
        );

        if (node.comma) {
            result.then.else = createCondition(
                { type: 'Comma', syntax: node },
                result,
                MISMATCH
            );
        }
    } else {
        // create a match node chain for [min .. max] interval with optional matches
        for (let i = node.min || 1; i <= node.max; i++) {
            if (node.comma && result !== MATCH) {
                result = createCondition(
                    { type: 'Comma', syntax: node },
                    result,
                    MISMATCH
                );
            }

            result = createCondition(
                matchTerm,
                createCondition(
                    MATCH,
                    MATCH,
                    result
                ),
                MISMATCH
            );
        }
    }

    if (node.min === 0) {
        // allow zero match
        result = createCondition(
            MATCH,
            MATCH,
            result
        );
    } else {
        // create a match node chain to collect [0 ... min - 1] required matches
        for (let i = 0; i < node.min - 1; i++) {
            if (node.comma && result !== MATCH) {
                result = createCondition(
                    { type: 'Comma', syntax: node },
                    result,
                    MISMATCH
                );
            }

            result = createCondition(
                matchTerm,
                result,
                MISMATCH
            );
        }
    }

    return result;
}

function buildMatchGraphInternal(node) {
    if (typeof node === 'function') {
        return {
            type: 'Generic',
            fn: node
        };
    }

    switch (node.type) {
        case 'Group': {
            let result = buildGroupMatchGraph(
                node.combinator,
                node.terms.map(buildMatchGraphInternal),
                false
            );

            if (node.disallowEmpty) {
                result = createCondition(
                    result,
                    DISALLOW_EMPTY,
                    MISMATCH
                );
            }

            return result;
        }

        case 'Multiplier':
            return buildMultiplierMatchGraph(node);

        // https://drafts.csswg.org/css-values-5/#boolean
        case 'Boolean': {
            const term = buildMatchGraphInternal(node.term);
            // <boolean-expr[ <test> ]> = not <boolean-expr-group> | <boolean-expr-group> [ [ and <boolean-expr-group> ]* | [ or <boolean-expr-group> ]* ]
            const matchNode = buildMatchGraphInternal(groupNode([
                groupNode([
                    { type: 'Keyword', name: 'not' },
                    { type: 'Type', name: '!boolean-group' }
                ]),
                groupNode([
                    { type: 'Type', name: '!boolean-group' },
                    groupNode([
                        { type: 'Multiplier', comma: false, min: 0, max: 0, term: groupNode([
                            { type: 'Keyword', name: 'and' },
                            { type: 'Type', name: '!boolean-group' }
                        ]) },
                        { type: 'Multiplier', comma: false, min: 0, max: 0, term: groupNode([
                            { type: 'Keyword', name: 'or' },
                            { type: 'Type', name: '!boolean-group' }
                        ]) }
                    ], '|')
                ])
            ], '|'));
            // <boolean-expr-group> = <test> | ( <boolean-expr[ <test> ]> ) | <general-enclosed>
            const booleanGroup = buildMatchGraphInternal(
                groupNode([
                    { type: 'Type', name: '!term' },
                    groupNode([
                        { type: 'Token', value: '(' },
                        { type: 'Type', name: '!self' },
                        { type: 'Token', value: ')' }
                    ]),
                    { type: 'Type', name: 'general-enclosed' }
                ], '|')
            );

            replaceTypeInGraph(booleanGroup, { '!term': term, '!self': matchNode });
            replaceTypeInGraph(matchNode, { '!boolean-group': booleanGroup });

            return matchNode;
        }

        case 'Type':
        case 'Property':
            return {
                type: node.type,
                name: node.name,
                syntax: node
            };

        case 'Keyword':
            return {
                type: node.type,
                name: node.name.toLowerCase(),
                syntax: node
            };

        case 'AtKeyword':
            return {
                type: node.type,
                name: '@' + node.name.toLowerCase(),
                syntax: node
            };

        case 'Function':
            return {
                type: node.type,
                name: node.name.toLowerCase() + '(',
                syntax: node
            };

        case 'String':
            // convert a one char length String to a Token
            if (node.value.length === 3) {
                return {
                    type: 'Token',
                    value: node.value.charAt(1),
                    syntax: node
                };
            }

            // otherwise use it as is
            return {
                type: node.type,
                value: node.value.substr(1, node.value.length - 2).replace(/\\'/g, '\''),
                syntax: node
            };

        case 'Token':
            return {
                type: node.type,
                value: node.value,
                syntax: node
            };

        case 'Comma':
            return {
                type: node.type,
                syntax: node
            };

        default:
            throw new Error('Unknown node type:', node.type);
    }
}

export function buildMatchGraph(syntaxTree, ref) {
    if (typeof syntaxTree === 'string') {
        syntaxTree = parse(syntaxTree);
    }

    return {
        type: 'MatchGraph',
        match: buildMatchGraphInternal(syntaxTree),
        syntax: ref || null,
        source: syntaxTree
    };
}
Ӵ	x;Lĳimport { MATCH, MISMATCH, DISALLOW_EMPTY } from './match-graph.js';
import * as TYPE from '../tokenizer/types.js';

const { hasOwnProperty } = Object.prototype;
const STUB = 0;
const TOKEN = 1;
const OPEN_SYNTAX = 2;
const CLOSE_SYNTAX = 3;

const EXIT_REASON_MATCH = 'Match';
const EXIT_REASON_MISMATCH = 'Mismatch';
const EXIT_REASON_ITERATION_LIMIT = 'Maximum iteration number exceeded (please fill an issue on https://github.com/csstree/csstree/issues)';

const ITERATION_LIMIT = 150000;
export let totalIterationCount = 0;

function reverseList(list) {
    let prev = null;
    let next = null;
    let item = list;

    while (item !== null) {
        next = item.prev;
        item.prev = prev;
        prev = item;
        item = next;
    }

    return prev;
}

function areStringsEqualCaseInsensitive(testStr, referenceStr) {
    if (testStr.length !== referenceStr.length) {
        return false;
    }

    for (let i = 0; i < testStr.length; i++) {
        const referenceCode = referenceStr.charCodeAt(i);
        let testCode = testStr.charCodeAt(i);

        // testCode.toLowerCase() for U+0041 LATIN CAPITAL LETTER A (A) .. U+005A LATIN CAPITAL LETTER Z (Z).
        if (testCode >= 0x0041 && testCode <= 0x005A) {
            testCode = testCode | 32;
        }

        if (testCode !== referenceCode) {
            return false;
        }
    }

    return true;
}

function isContextEdgeDelim(token) {
    if (token.type !== TYPE.Delim) {
        return false;
    }

    // Fix matching for unicode-range: U+30??, U+FF00-FF9F
    // Probably we need to check out previous match instead
    return token.value !== '?';
}

function isCommaContextStart(token) {
    if (token === null) {
        return true;
    }

    return (
        token.type === TYPE.Comma ||
        token.type === TYPE.Function ||
        token.type === TYPE.LeftParenthesis ||
        token.type === TYPE.LeftSquareBracket ||
        token.type === TYPE.LeftCurlyBracket ||
        isContextEdgeDelim(token)
    );
}

function isCommaContextEnd(token) {
    if (token === null) {
        return true;
    }

    return (
        token.type === TYPE.RightParenthesis ||
        token.type === TYPE.RightSquareBracket ||
        token.type === TYPE.RightCurlyBracket ||
        (token.type === TYPE.Delim && token.value === '/')
    );
}

function internalMatch(tokens, state, syntaxes) {
    function moveToNextToken() {
        do {
            tokenIndex++;
            token = tokenIndex < tokens.length ? tokens[tokenIndex] : null;
        } while (token !== null && (token.type === TYPE.WhiteSpace || token.type === TYPE.Comment));
    }

    function getNextToken(offset) {
        const nextIndex = tokenIndex + offset;

        return nextIndex < tokens.length ? tokens[nextIndex] : null;
    }

    function stateSnapshotFromSyntax(nextState, prev) {
        return {
            nextState,
            matchStack,
            syntaxStack,
            thenStack,
            tokenIndex,
            prev
        };
    }

    function pushThenStack(nextState) {
        thenStack = {
            nextState,
            matchStack,
            syntaxStack,
            prev: thenStack
        };
    }

    function pushElseStack(nextState) {
        elseStack = stateSnapshotFromSyntax(nextState, elseStack);
    }

    function addTokenToMatch() {
        matchStack = {
            type: TOKEN,
            syntax: state.syntax,
            token,
            prev: matchStack
        };

        moveToNextToken();
        syntaxStash = null;

        if (tokenIndex > longestMatch) {
            longestMatch = tokenIndex;
        }
    }

    function openSyntax() {
        syntaxStack = {
            syntax: state.syntax,
            opts: state.syntax.opts || (syntaxStack !== null && syntaxStack.opts) || null,
            prev: syntaxStack
        };

        matchStack = {
            type: OPEN_SYNTAX,
            syntax: state.syntax,
            token: matchStack.token,
            prev: matchStack
        };
    }

    function closeSyntax() {
        if (matchStack.type === OPEN_SYNTAX) {
            matchStack = matchStack.prev;
        } else {
            matchStack = {
                type: CLOSE_SYNTAX,
                syntax: syntaxStack.syntax,
                token: matchStack.token,
                prev: matchStack
            };
        }

        syntaxStack = syntaxStack.prev;
    }

    let syntaxStack = null;
    let thenStack = null;
    let elseStack = null;

    // null – stashing allowed, nothing stashed
    // false – stashing disabled, nothing stashed
    // anithing else – fail stashable syntaxes, some syntax stashed
    let syntaxStash = null;

    let iterationCount = 0; // count iterations and prevent infinite loop
    let exitReason = null;

    let token = null;
    let tokenIndex = -1;
    let longestMatch = 0;
    let matchStack = {
        type: STUB,
        syntax: null,
        token: null,
        prev: null
    };

    moveToNextToken();

    while (exitReason === null && ++iterationCount < ITERATION_LIMIT) {
        // function mapList(list, fn) {
        //     const result = [];
        //     while (list) {
        //         result.unshift(fn(list));
        //         list = list.prev;
        //     }
        //     return result;
        // }
        // console.log('--\n',
        //     '#' + iterationCount,
        //     require('util').inspect({
        //         match: mapList(matchStack, x => x.type === TOKEN ? x.token && x.token.value : x.syntax ? ({ [OPEN_SYNTAX]: '<', [CLOSE_SYNTAX]: '</' }[x.type] || x.type) + '!' + x.syntax.name : null),
        //         token: token && token.value,
        //         tokenIndex,
        //         syntax: syntax.type + (syntax.id ? ' #' + syntax.id : '')
        //     }, { depth: null })
        // );
        switch (state.type) {
            case 'Match':
                if (thenStack === null) {
                    // turn to MISMATCH when some tokens left unmatched
                    if (token !== null) {
                        // doesn't mismatch if just one token left and it's an IE hack
                        if (tokenIndex !== tokens.length - 1 || (token.value !== '\\0' && token.value !== '\\9')) {
                            state = MISMATCH;
                            break;
                        }
                    }

                    // break the main loop, return a result - MATCH
                    exitReason = EXIT_REASON_MATCH;
                    break;
                }

                // go to next syntax (`then` branch)
                state = thenStack.nextState;

                // check match is not empty
                if (state === DISALLOW_EMPTY) {
                    if (thenStack.matchStack === matchStack) {
                        state = MISMATCH;
                        break;
                    } else {
                        state = MATCH;
                    }
                }

                // close syntax if needed
                while (thenStack.syntaxStack !== syntaxStack) {
                    closeSyntax();
                }

                // pop stack
                thenStack = thenStack.prev;
                break;

            case 'Mismatch':
                // when some syntax is stashed
                if (syntaxStash !== null && syntaxStash !== false) {
                    // there is no else branches or a branch reduce match stack
                    if (elseStack === null || tokenIndex > elseStack.tokenIndex) {
                        // restore state from the stash
                        elseStack = syntaxStash;
                        syntaxStash = false; // disable stashing
                    }
                } else if (elseStack === null) {
                    // no else branches -> break the main loop
                    // return a result - MISMATCH
                    exitReason = EXIT_REASON_MISMATCH;
                    break;
                }

                // go to next syntax (`else` branch)
                state = elseStack.nextState;

                // restore all the rest stack states
                thenStack = elseStack.thenStack;
                syntaxStack = elseStack.syntaxStack;
                matchStack = elseStack.matchStack;
                tokenIndex = elseStack.tokenIndex;
                token = tokenIndex < tokens.length ? tokens[tokenIndex] : null;

                // pop stack
                elseStack = elseStack.prev;
                break;

            case 'MatchGraph':
                state = state.match;
                break;

            case 'If':
                // IMPORTANT: else stack push must go first,
                // since it stores the state of thenStack before changes
                if (state.else !== MISMATCH) {
                    pushElseStack(state.else);
                }

                if (state.then !== MATCH) {
                    pushThenStack(state.then);
                }

                state = state.match;
                break;

            case 'MatchOnce':
                state = {
                    type: 'MatchOnceBuffer',
                    syntax: state,
                    index: 0,
                    mask: 0
                };
                break;

            case 'MatchOnceBuffer': {
                const terms = state.syntax.terms;

                if (state.index === terms.length) {
                    // no matches at all or it's required all terms to be matched
                    if (state.mask === 0 || state.syntax.all) {
                        state = MISMATCH;
                        break;
                    }

                    // a partial match is ok
                    state = MATCH;
                    break;
                }

                // all terms are matched
                if (state.mask === (1 << terms.length) - 1) {
                    state = MATCH;
                    break;
                }

                for (; state.index < terms.length; state.index++) {
                    const matchFlag = 1 << state.index;

                    if ((state.mask & matchFlag) === 0) {
                        // IMPORTANT: else stack push must go first,
                        // since it stores the state of thenStack before changes
                        pushElseStack(state);
                        pushThenStack({
                            type: 'AddMatchOnce',
                            syntax: state.syntax,
                            mask: state.mask | matchFlag
                        });

                        // match
                        state = terms[state.index++];
                        break;
                    }
                }
                break;
            }

            case 'AddMatchOnce':
                state = {
                    type: 'MatchOnceBuffer',
                    syntax: state.syntax,
                    index: 0,
                    mask: state.mask
                };
                break;

            case 'Enum':
                if (token !== null) {
                    let name = token.value.toLowerCase();

                    // drop \0 and \9 hack from keyword name
                    if (name.indexOf('\\') !== -1) {
                        name = name.replace(/\\[09].*$/, '');
                    }

                    if (hasOwnProperty.call(state.map, name)) {
                        state = state.map[name];
                        break;
                    }
                }

                state = MISMATCH;
                break;

            case 'Generic': {
                const opts = syntaxStack !== null ? syntaxStack.opts : null;
                const lastTokenIndex = tokenIndex + Math.floor(state.fn(token, getNextToken, opts));

                if (!isNaN(lastTokenIndex) && lastTokenIndex > tokenIndex) {
                    while (tokenIndex < lastTokenIndex) {
                        addTokenToMatch();
                    }

                    state = MATCH;
                } else {
                    state = MISMATCH;
                }

                break;
            }

            case 'Type':
            case 'Property': {
                const syntaxDict = state.type === 'Type' ? 'types' : 'properties';
                const dictSyntax = hasOwnProperty.call(syntaxes, syntaxDict) ? syntaxes[syntaxDict][state.name] : null;

                if (!dictSyntax || !dictSyntax.match) {
                    throw new Error(
                        'Bad syntax reference: ' +
                        (state.type === 'Type'
                            ? '<' + state.name + '>'
                            : '<\'' + state.name + '\'>')
                    );
                }

                // stash a syntax for types with low priority
                if (syntaxStash !== false && token !== null && state.type === 'Type') {
                    const lowPriorityMatching =
                        // https://drafts.csswg.org/css-values-4/#custom-idents
                        // When parsing positionally-ambiguous keywords in a property value, a <custom-ident> production
                        // can only claim the keyword if no other unfulfilled production can claim it.
                        (state.name === 'custom-ident' && token.type === TYPE.Ident) ||

                        // https://drafts.csswg.org/css-values-4/#lengths
                        // ... if a `0` could be parsed as either a <number> or a <length> in a property (such as line-height),
                        // it must parse as a <number>
                        (state.name === 'length' && token.value === '0');

                    if (lowPriorityMatching) {
                        if (syntaxStash === null) {
                            syntaxStash = stateSnapshotFromSyntax(state, elseStack);
                        }

                        state = MISMATCH;
                        break;
                    }
                }

                openSyntax();
                state = dictSyntax.matchRef || dictSyntax.match;
                break;
            }

            case 'Keyword': {
                const name = state.name;

                if (token !== null) {
                    let keywordName = token.value;

                    // drop \0 and \9 hack from keyword name
                    if (keywordName.indexOf('\\') !== -1) {
                        keywordName = keywordName.replace(/\\[09].*$/, '');
                    }

                    if (areStringsEqualCaseInsensitive(keywordName, name)) {
                        addTokenToMatch();
                        state = MATCH;
                        break;
                    }
                }

                state = MISMATCH;
                break;
            }

            case 'AtKeyword':
            case 'Function':
                if (token !== null && areStringsEqualCaseInsensitive(token.value, state.name)) {
                    addTokenToMatch();
                    state = MATCH;
                    break;
                }

                state = MISMATCH;
                break;

            case 'Token':
                if (token !== null && token.value === state.value) {
                    addTokenToMatch();
                    state = MATCH;
                    break;
                }

                state = MISMATCH;
                break;

            case 'Comma':
                if (token !== null && token.type === TYPE.Comma) {
                    if (isCommaContextStart(matchStack.token)) {
                        state = MISMATCH;
                    } else {
                        addTokenToMatch();
                        state = isCommaContextEnd(token) ? MISMATCH : MATCH;
                    }
                } else {
                    state = isCommaContextStart(matchStack.token) || isCommaContextEnd(token) ? MATCH : MISMATCH;
                }

                break;

            case 'String':
                let string = '';
                let lastTokenIndex = tokenIndex;

                for (; lastTokenIndex < tokens.length && string.length < state.value.length; lastTokenIndex++) {
                    string += tokens[lastTokenIndex].value;
                }

                if (areStringsEqualCaseInsensitive(string, state.value)) {
                    while (tokenIndex < lastTokenIndex) {
                        addTokenToMatch();
                    }

                    state = MATCH;
                } else {
                    state = MISMATCH;
                }

                break;

            default:
                throw new Error('Unknown node type: ' + state.type);
        }
    }

    totalIterationCount += iterationCount;

    switch (exitReason) {
        case null:
            console.warn('[csstree-match] BREAK after ' + ITERATION_LIMIT + ' iterations');
            exitReason = EXIT_REASON_ITERATION_LIMIT;
            matchStack = null;
            break;

        case EXIT_REASON_MATCH:
            while (syntaxStack !== null) {
                closeSyntax();
            }
            break;

        default:
            matchStack = null;
    }

    return {
        tokens,
        reason: exitReason,
        iterations: iterationCount,
        match: matchStack,
        longestMatch
    };
}

export function matchAsList(tokens, matchGraph, syntaxes) {
    const matchResult = internalMatch(tokens, matchGraph, syntaxes || {});

    if (matchResult.match !== null) {
        let item = reverseList(matchResult.match).prev;

        matchResult.match = [];

        while (item !== null) {
            switch (item.type) {
                case OPEN_SYNTAX:
                case CLOSE_SYNTAX:
                    matchResult.match.push({
                        type: item.type,
                        syntax: item.syntax
                    });
                    break;

                default:
                    matchResult.match.push({
                        token: item.token.value,
                        node: item.token.node
                    });
                    break;
            }

            item = item.prev;
        }
    }

    return matchResult;
}

export function matchAsTree(tokens, matchGraph, syntaxes) {
    const matchResult = internalMatch(tokens, matchGraph, syntaxes || {});

    if (matchResult.match === null) {
        return matchResult;
    }

    let item = matchResult.match;
    let host = matchResult.match = {
        syntax: matchGraph.syntax || null,
        match: []
    };
    const hostStack = [host];

    // revert a list and start with 2nd item since 1st is a stub item
    item = reverseList(item).prev;

    // build a tree
    while (item !== null) {
        switch (item.type) {
            case OPEN_SYNTAX:
                host.match.push(host = {
                    syntax: item.syntax,
                    match: []
                });
                hostStack.push(host);
                break;

            case CLOSE_SYNTAX:
                hostStack.pop();
                host = hostStack[hostStack.length - 1];
                break;

            default:
                host.match.push({
                    syntax: item.syntax || null,
                    token: item.token.value,
                    node: item.token.node
                });
        }

        item = item.prev;
    }

    return matchResult;
}
'ٸHxwimport { getTokenizer } from '../utils/get-tokenizer.js';

const astToTokens = {
    decorator(handlers) {
        const tokens = [];
        let curNode = null;

        return {
            ...handlers,
            node(node) {
                const tmp = curNode;
                curNode = node;
                handlers.node.call(this, node);
                curNode = tmp;
            },
            emit(value, type, auto) {
                tokens.push({
                    type,
                    value,
                    node: auto ? null : curNode
                });
            },
            result() {
                return tokens;
            }
        };
    }
};

function stringToTokens(str, syntax) {
    const tokens = [];
    const tokenize = getTokenizer(syntax);

    tokenize(str, (type, start, end) =>
        tokens.push({
            type,
            value: str.slice(start, end),
            node: null
        })
    );

    return tokens;
}

export default function(value, syntax) {
    if (typeof value === 'string') {
        return stringToTokens(value, syntax);
    }

    return syntax.generate(value, astToTokens);
};
9cbx.import { List } from '../utils/List.js';

function getFirstMatchNode(matchNode) {
    if ('node' in matchNode) {
        return matchNode.node;
    }

    return getFirstMatchNode(matchNode.match[0]);
}

function getLastMatchNode(matchNode) {
    if ('node' in matchNode) {
        return matchNode.node;
    }

    return getLastMatchNode(matchNode.match[matchNode.match.length - 1]);
}

export function matchFragments(lexer, ast, match, type, name) {
    function findFragments(matchNode) {
        if (matchNode.syntax !== null &&
            matchNode.syntax.type === type &&
            matchNode.syntax.name === name) {
            const start = getFirstMatchNode(matchNode);
            const end = getLastMatchNode(matchNode);

            lexer.syntax.walk(ast, function(node, item, list) {
                if (node === start) {
                    const nodes = new List();

                    do {
                        nodes.appendData(item.data);

                        if (item.data === end) {
                            break;
                        }

                        item = item.next;
                    } while (item !== null);

                    fragments.push({
                        parent: list,
                        nodes
                    });
                }
            });
        }

        if (Array.isArray(matchNode.match)) {
            matchNode.match.forEach(findFragments);
        }
    }

    const fragments = [];

    if (match.matched !== null) {
        findFragments(match.matched);
    }

    return fragments;
}
ڱxzimport { List } from '../utils/List.js';

const { hasOwnProperty } = Object.prototype;

function isValidNumber(value) {
    // Number.isInteger(value) && value >= 0
    return (
        typeof value === 'number' &&
        isFinite(value) &&
        Math.floor(value) === value &&
        value >= 0
    );
}

function isValidLocation(loc) {
    return (
        Boolean(loc) &&
        isValidNumber(loc.offset) &&
        isValidNumber(loc.line) &&
        isValidNumber(loc.column)
    );
}

function createNodeStructureChecker(type, fields) {
    return function checkNode(node, warn) {
        if (!node || node.constructor !== Object) {
            return warn(node, 'Type of node should be an Object');
        }

        for (let key in node) {
            let valid = true;

            if (hasOwnProperty.call(node, key) === false) {
                continue;
            }

            if (key === 'type') {
                if (node.type !== type) {
                    warn(node, 'Wrong node type `' + node.type + '`, expected `' + type + '`');
                }
            } else if (key === 'loc') {
                if (node.loc === null) {
                    continue;
                } else if (node.loc && node.loc.constructor === Object) {
                    if (typeof node.loc.source !== 'string') {
                        key += '.source';
                    } else if (!isValidLocation(node.loc.start)) {
                        key += '.start';
                    } else if (!isValidLocation(node.loc.end)) {
                        key += '.end';
                    } else {
                        continue;
                    }
                }

                valid = false;
            } else if (fields.hasOwnProperty(key)) {
                valid = false;

                for (let i = 0; !valid && i < fields[key].length; i++) {
                    const fieldType = fields[key][i];

                    switch (fieldType) {
                        case String:
                            valid = typeof node[key] === 'string';
                            break;

                        case Boolean:
                            valid = typeof node[key] === 'boolean';
                            break;

                        case null:
                            valid = node[key] === null;
                            break;

                        default:
                            if (typeof fieldType === 'string') {
                                valid = node[key] && node[key].type === fieldType;
                            } else if (Array.isArray(fieldType)) {
                                valid = node[key] instanceof List;
                            }
                    }
                }
            } else {
                warn(node, 'Unknown field `' + key + '` for ' + type + ' node type');
            }

            if (!valid) {
                warn(node, 'Bad value for `' + type + '.' + key + '`');
            }
        }

        for (const key in fields) {
            if (hasOwnProperty.call(fields, key) &&
                hasOwnProperty.call(node, key) === false) {
                warn(node, 'Field `' + type + '.' + key + '` is missed');
            }
        }
    };
}

function genTypesList(fieldTypes, path) {
    const docsTypes = [];

    for (let i = 0; i < fieldTypes.length; i++) {
        const fieldType = fieldTypes[i];
        if (fieldType === String || fieldType === Boolean) {
            docsTypes.push(fieldType.name.toLowerCase());
        } else if (fieldType === null) {
            docsTypes.push('null');
        } else if (typeof fieldType === 'string') {
            docsTypes.push(fieldType);
        } else if (Array.isArray(fieldType)) {
            docsTypes.push('List<' + (genTypesList(fieldType, path) || 'any') + '>'); // TODO: use type enum
        } else {
            throw new Error('Wrong value `' + fieldType + '` in `' + path + '` structure definition');
        }
    }

    return docsTypes.join(' | ');
}

function processStructure(name, nodeType) {
    const structure = nodeType.structure;
    const fields = {
        type: String,
        loc: true
    };
    const docs = {
        type: '"' + name + '"'
    };

    for (const key in structure) {
        if (hasOwnProperty.call(structure, key) === false) {
            continue;
        }

        const fieldTypes = fields[key] = Array.isArray(structure[key])
            ? structure[key].slice()
            : [structure[key]];

        docs[key] = genTypesList(fieldTypes, name + '.' + key);
    }

    return {
        docs,
        check: createNodeStructureChecker(name, fields)
    };
}

export function getStructureFromConfig(config) {
    const structure = {};

    if (config.node) {
        for (const name in config.node) {
            if (hasOwnProperty.call(config.node, name)) {
                const nodeType = config.node[name];

                if (nodeType.structure) {
                    structure[name] = processStructure(name, nodeType);
                } else {
                    throw new Error('Missed `structure` field in `' + name + '` node type definition');
                }
            }
        }
    }

    return structure;
};
wfxfexport function getTrace(node) {
    function shouldPutToTrace(syntax) {
        if (syntax === null) {
            return false;
        }

        return (
            syntax.type === 'Type' ||
            syntax.type === 'Property' ||
            syntax.type === 'Keyword'
        );
    }

    function hasMatch(matchNode) {
        if (Array.isArray(matchNode.match)) {
            // use for-loop for better perfomance
            for (let i = 0; i < matchNode.match.length; i++) {
                if (hasMatch(matchNode.match[i])) {
                    if (shouldPutToTrace(matchNode.syntax)) {
                        result.unshift(matchNode.syntax);
                    }

                    return true;
                }
            }
        } else if (matchNode.node === node) {
            result = shouldPutToTrace(matchNode.syntax)
                ? [matchNode.syntax]
                : [];

            return true;
        }

        return false;
    }

    let result = null;

    if (this.matched !== null) {
        hasMatch(this.matched);
    }

    return result;
}

export function isType(node, type) {
    return testNode(this, node, match => match.type === 'Type' && match.name === type);
}

export function isProperty(node, property) {
    return testNode(this, node, match => match.type === 'Property' && match.name === property);
}

export function isKeyword(node) {
    return testNode(this, node, match => match.type === 'Keyword');
}

function testNode(match, node, fn) {
    const trace = getTrace.call(match, node);

    if (trace === null) {
        return false;
    }

    return trace.some(fn);
}
 `xexport const length = [
    // absolute length units https://www.w3.org/TR/css-values-3/#lengths
    'cm', 'mm', 'q', 'in', 'pt', 'pc', 'px',
    // font-relative length units https://drafts.csswg.org/css-values-4/#font-relative-lengths
    'em', 'rem',
    'ex', 'rex',
    'cap', 'rcap',
    'ch', 'rch',
    'ic', 'ric',
    'lh', 'rlh',
    // viewport-percentage lengths https://drafts.csswg.org/css-values-4/#viewport-relative-lengths
    'vw', 'svw', 'lvw', 'dvw',
    'vh', 'svh', 'lvh', 'dvh',
    'vi', 'svi', 'lvi', 'dvi',
    'vb', 'svb', 'lvb', 'dvb',
    'vmin', 'svmin', 'lvmin', 'dvmin',
    'vmax', 'svmax', 'lvmax', 'dvmax',
    // container relative lengths https://drafts.csswg.org/css-contain-3/#container-lengths
    'cqw', 'cqh', 'cqi', 'cqb', 'cqmin', 'cqmax'
];
export const angle = ['deg', 'grad', 'rad', 'turn'];    // https://www.w3.org/TR/css-values-3/#angles
export const time = ['s', 'ms'];                        // https://www.w3.org/TR/css-values-3/#time
export const frequency = ['hz', 'khz'];                 // https://www.w3.org/TR/css-values-3/#frequency
export const resolution = ['dpi', 'dpcm', 'dppx', 'x']; // https://www.w3.org/TR/css-values-3/#resolution
export const flex = ['fr'];                             // https://drafts.csswg.org/css-grid/#fr-unit
export const decibel = ['db'];                          // https://www.w3.org/TR/css3-speech/#mixing-props-voice-volume
export const semitones = ['st'];                        // https://www.w3.org/TR/css3-speech/#voice-props-voice-pitch
WMx 8100644 SyntaxError.js UҢq܍	zƪw100644 create.js 
ls#`3gy:"#100644 index.js |b)^t=r} &;100644 parse-selector.js 9@E_7͢v| ;100644 sequence.js G0vG6BBR
PRx	import { createCustomError } from '../utils/create-custom-error.js';

const MAX_LINE_LENGTH = 100;
const OFFSET_CORRECTION = 60;
const TAB_REPLACEMENT = '    ';

function sourceFragment({ source, line, column, baseLine, baseColumn }, extraLines) {
    function processLines(start, end) {
        return lines
            .slice(start, end)
            .map((line, idx) =>
                String(start + idx + 1).padStart(maxNumLength) + ' |' + line
            ).join('\n');
    }

    const prelines = '\n'.repeat(Math.max(baseLine - 1, 0));
    const precolumns = ' '.repeat(Math.max(baseColumn - 1, 0));
    const lines = (prelines + precolumns + source).split(/\r\n?|\n|\f/);
    const startLine = Math.max(1, line - extraLines) - 1;
    const endLine = Math.min(line + extraLines, lines.length + 1);
    const maxNumLength = Math.max(4, String(endLine).length) + 1;
    let cutLeft = 0;

    // column correction according to replaced tab before column
    column += (TAB_REPLACEMENT.length - 1) * (lines[line - 1].substr(0, column - 1).match(/\t/g) || []).length;

    if (column > MAX_LINE_LENGTH) {
        cutLeft = column - OFFSET_CORRECTION + 3;
        column = OFFSET_CORRECTION - 2;
    }

    for (let i = startLine; i <= endLine; i++) {
        if (i >= 0 && i < lines.length) {
            lines[i] = lines[i].replace(/\t/g, TAB_REPLACEMENT);
            lines[i] =
                (cutLeft > 0 && lines[i].length > cutLeft ? '\u2026' : '') +
                lines[i].substr(cutLeft, MAX_LINE_LENGTH - 2) +
                (lines[i].length > cutLeft + MAX_LINE_LENGTH - 1 ? '\u2026' : '');
        }
    }

    return [
        processLines(startLine, line),
        new Array(column + maxNumLength + 2).join('-') + '^',
        processLines(line, endLine)
    ].filter(Boolean)
        .join('\n')
        .replace(/^(\s+\d+\s+\|\n)+/, '')
        .replace(/\n(\s+\d+\s+\|)+$/, '');
}

export function SyntaxError(message, source, offset, line, column, baseLine = 1, baseColumn = 1) {
    const error = Object.assign(createCustomError('SyntaxError', message), {
        source,
        offset,
        line,
        column,
        sourceFragment(extraLines) {
            return sourceFragment({ source, line, column, baseLine, baseColumn }, isNaN(extraLines) ? 0 : extraLines);
        },
        get formattedMessage() {
            return (
                `Parse error: ${message}\n` +
                sourceFragment({ source, line, column, baseLine, baseColumn }, 2)
            );
        }
    });

    return error;
}
_᧴x1;import { List } from '../utils/List.js';
import { SyntaxError } from './SyntaxError.js';
import {
    OffsetToLocation,
    TokenStream,
    tokenNames,

    consumeNumber,
    findWhiteSpaceStart,
    cmpChar,
    cmpStr,

    WhiteSpace,
    Comment,
    Ident,
    Function as FunctionToken,
    Url,
    Hash,
    Percentage,
    Number as NumberToken
} from '../tokenizer/index.js';
import { readSequence } from './sequence.js';
import { getTokenizer } from '../utils/get-tokenizer.js';

const NOOP = () => {};
const EXCLAMATIONMARK = 0x0021;  // U+0021 EXCLAMATION MARK (!)
const NUMBERSIGN = 0x0023;       // U+0023 NUMBER SIGN (#)
const SEMICOLON = 0x003B;        // U+003B SEMICOLON (;)
const LEFTCURLYBRACKET = 0x007B; // U+007B LEFT CURLY BRACKET ({)
const NULL = 0;

const arrayMethods = {
    createList() {
        return [];
    },
    createSingleNodeList(node) {
        return [node];
    },
    getFirstListNode(list) {
        return list && list[0] || null;
    },
    getLastListNode(list) {
        return list && list.length > 0 ? list[list.length - 1] : null;
    }
};

const listMethods = {
    createList() {
        return new List();
    },
    createSingleNodeList(node) {
        return new List().appendData(node);
    },
    getFirstListNode(list) {
        return list && list.first;
    },
    getLastListNode(list) {
        return list && list.last;
    }
};

function createParseContext(name) {
    return function() {
        return this[name]();
    };
}

function fetchParseValues(dict) {
    const result = Object.create(null);

    for (const name of Object.keys(dict)) {
        const item = dict[name];
        const fn = item.parse || item;

        if (fn) {
            result[name] = fn;
        }
    }

    return result;
}

function processConfig(config) {
    const parseConfig = {
        context: Object.create(null),
        features: Object.assign(Object.create(null), config.features),
        scope: Object.assign(Object.create(null), config.scope),
        atrule: fetchParseValues(config.atrule),
        pseudo: fetchParseValues(config.pseudo),
        node: fetchParseValues(config.node),
        tokenize: getTokenizer(config)
    };

    for (const [name, context] of Object.entries(config.parseContext)) {
        switch (typeof context) {
            case 'function':
                parseConfig.context[name] = context;
                break;

            case 'string':
                parseConfig.context[name] = createParseContext(context);
                break;
        }
    }

    return {
        config: parseConfig,
        ...parseConfig,
        ...parseConfig.node
    };
}

export function createParser(config) {
    let source = '';
    let filename = '<unknown>';
    let needPositions = false;
    let onParseError = NOOP;
    let onParseErrorThrow = false;

    const locationMap = new OffsetToLocation();
    const parser = Object.assign(new TokenStream(), processConfig(config || {}), {
        parseAtrulePrelude: true,
        parseRulePrelude: true,
        parseValue: true,
        parseCustomProperty: false,

        readSequence,

        consumeUntilBalanceEnd: () => 0,
        consumeUntilLeftCurlyBracket(code) {
            return code === LEFTCURLYBRACKET ? 1 : 0;
        },
        consumeUntilLeftCurlyBracketOrSemicolon(code) {
            return code === LEFTCURLYBRACKET || code === SEMICOLON ? 1 : 0;
        },
        consumeUntilExclamationMarkOrSemicolon(code) {
            return code === EXCLAMATIONMARK || code === SEMICOLON ? 1 : 0;
        },
        consumeUntilSemicolonIncluded(code) {
            return code === SEMICOLON ? 2 : 0;
        },

        createList: NOOP,
        createSingleNodeList: NOOP,
        getFirstListNode: NOOP,
        getLastListNode: NOOP,

        parseWithFallback(consumer, fallback) {
            const startIndex = this.tokenIndex;

            try {
                return consumer.call(this);
            } catch (e) {
                if (onParseErrorThrow) {
                    throw e;
                }

                this.skip(startIndex - this.tokenIndex);
                const fallbackNode = fallback.call(this);

                onParseErrorThrow = true;
                onParseError(e, fallbackNode);
                onParseErrorThrow = false;

                return fallbackNode;
            }
        },

        lookupNonWSType(offset) {
            let type;

            do {
                type = this.lookupType(offset++);
                if (type !== WhiteSpace && type !== Comment) {
                    return type;
                }
            } while (type !== NULL);

            return NULL;
        },

        charCodeAt(offset) {
            return offset >= 0 && offset < source.length ? source.charCodeAt(offset) : 0;
        },
        substring(offsetStart, offsetEnd) {
            return source.substring(offsetStart, offsetEnd);
        },
        substrToCursor(start) {
            return this.source.substring(start, this.tokenStart);
        },

        cmpChar(offset, charCode) {
            return cmpChar(source, offset, charCode);
        },
        cmpStr(offsetStart, offsetEnd, str) {
            return cmpStr(source, offsetStart, offsetEnd, str);
        },

        consume(tokenType) {
            const start = this.tokenStart;

            this.eat(tokenType);

            return this.substrToCursor(start);
        },
        consumeFunctionName() {
            const name = source.substring(this.tokenStart, this.tokenEnd - 1);

            this.eat(FunctionToken);

            return name;
        },
        consumeNumber(type) {
            const number = source.substring(this.tokenStart, consumeNumber(source, this.tokenStart));

            this.eat(type);

            return number;
        },

        eat(tokenType) {
            if (this.tokenType !== tokenType) {
                const tokenName = tokenNames[tokenType].slice(0, -6).replace(/-/g, ' ').replace(/^./, m => m.toUpperCase());
                let message = `${/[[\](){}]/.test(tokenName) ? `"${tokenName}"` : tokenName} is expected`;
                let offset = this.tokenStart;

                // tweak message and offset
                switch (tokenType) {
                    case Ident:
                        // when identifier is expected but there is a function or url
                        if (this.tokenType === FunctionToken || this.tokenType === Url) {
                            offset = this.tokenEnd - 1;
                            message = 'Identifier is expected but function found';
                        } else {
                            message = 'Identifier is expected';
                        }
                        break;

                    case Hash:
                        if (this.isDelim(NUMBERSIGN)) {
                            this.next();
                            offset++;
                            message = 'Name is expected';
                        }
                        break;

                    case Percentage:
                        if (this.tokenType === NumberToken) {
                            offset = this.tokenEnd;
                            message = 'Percent sign is expected';
                        }
                        break;
                }

                this.error(message, offset);
            }

            this.next();
        },
        eatIdent(name) {
            if (this.tokenType !== Ident || this.lookupValue(0, name) === false) {
                this.error(`Identifier "${name}" is expected`);
            }

            this.next();
        },
        eatDelim(code) {
            if (!this.isDelim(code)) {
                this.error(`Delim "${String.fromCharCode(code)}" is expected`);
            }

            this.next();
        },

        getLocation(start, end) {
            if (needPositions) {
                return locationMap.getLocationRange(
                    start,
                    end,
                    filename
                );
            }

            return null;
        },
        getLocationFromList(list) {
            if (needPositions) {
                const head = this.getFirstListNode(list);
                const tail = this.getLastListNode(list);
                return locationMap.getLocationRange(
                    head !== null ? head.loc.start.offset - locationMap.startOffset : this.tokenStart,
                    tail !== null ? tail.loc.end.offset - locationMap.startOffset : this.tokenStart,
                    filename
                );
            }

            return null;
        },

        error(message, offset) {
            const location = typeof offset !== 'undefined' && offset < source.length
                ? locationMap.getLocation(offset)
                : this.eof
                    ? locationMap.getLocation(findWhiteSpaceStart(source, source.length - 1))
                    : locationMap.getLocation(this.tokenStart);

            throw new SyntaxError(
                message || 'Unexpected input',
                source,
                location.offset,
                location.line,
                location.column,
                locationMap.startLine,
                locationMap.startColumn
            );
        }
    });
    const createTokenIterateAPI = () => ({
        filename,
        source,
        tokenCount: parser.tokenCount,

        getTokenType: (index) =>
            parser.getTokenType(index),
        getTokenTypeName: (index) =>
            tokenNames[parser.getTokenType(index)],
        getTokenStart: (index) =>
            parser.getTokenStart(index),
        getTokenEnd: (index) =>
            parser.getTokenEnd(index),
        getTokenValue: (index) =>
            parser.source.substring(parser.getTokenStart(index), parser.getTokenEnd(index)),

        substring: (start, end) =>
            parser.source.substring(start, end),

        balance: parser.balance.subarray(0, parser.tokenCount + 1),
        isBlockOpenerTokenType: parser.isBlockOpenerTokenType,
        isBlockCloserTokenType: parser.isBlockCloserTokenType,
        getBlockTokenPairIndex: (index) =>
            parser.getBlockTokenPairIndex(index),

        getLocation: (offset) =>
            locationMap.getLocation(offset, filename),
        getRangeLocation: (start, end) =>
            locationMap.getLocationRange(start, end, filename)
    });

    const parse = function(source_, options) {
        source = source_;
        options = options || {};

        parser.setSource(source, parser.tokenize);
        locationMap.setSource(
            source,
            options.offset,
            options.line,
            options.column
        );

        filename = options.filename || '<unknown>';
        needPositions = Boolean(options.positions);
        onParseError = typeof options.onParseError === 'function' ? options.onParseError : NOOP;
        onParseErrorThrow = false;

        parser.parseAtrulePrelude = 'parseAtrulePrelude' in options ? Boolean(options.parseAtrulePrelude) : true;
        parser.parseRulePrelude = 'parseRulePrelude' in options ? Boolean(options.parseRulePrelude) : true;
        parser.parseValue = 'parseValue' in options ? Boolean(options.parseValue) : true;
        parser.parseCustomProperty = 'parseCustomProperty' in options ? Boolean(options.parseCustomProperty) : false;

        const { context = 'default', list = true, onComment, onToken } = options;

        if (context in parser.context === false) {
            throw new Error('Unknown context `' + context + '`');
        }

        Object.assign(parser, list ? listMethods : arrayMethods);

        if (Array.isArray(onToken)) {
            parser.forEachToken((type, start, end) => {
                onToken.push({ type, start, end });
            });
        } else if (typeof onToken === 'function') {
            parser.forEachToken(onToken.bind(createTokenIterateAPI()));
        }

        if (typeof onComment === 'function') {
            parser.forEachToken((type, start, end) => {
                if (type === Comment) {
                    const loc = parser.getLocation(start, end);
                    const value = cmpStr(source, end - 2, end, '*/')
                        ? source.slice(start + 2, end - 2)
                        : source.slice(start + 2, end);

                    onComment(value, loc);
                }
            });
        }

        const ast = parser.context[context].call(parser, options);

        if (!parser.eof) {
            parser.error();
        }

        return ast;
    };

    return Object.assign(parse, {
        SyntaxError,
        config: parser.config
    });
};
@x |import { createParser } from './create.js';
import config from '../syntax/config/parser.js';

export default createParser(config);
.Lx simport { createParser } from './create.js';
import config from '../syntax/config/parser-selector.js';

export default createParser(config);
1ڷ=x(import { WhiteSpace, Comment } from '../tokenizer/index.js';

export function readSequence(recognizer) {
    const children = this.createList();
    let space = false;
    const context = {
        recognizer
    };

    while (!this.eof) {
        switch (this.tokenType) {
            case Comment:
                this.next();
                continue;

            case WhiteSpace:
                space = true;
                this.next();
                continue;
        }

        let child = recognizer.getNode.call(this, context);

        if (child === undefined) {
            break;
        }

        if (space) {
            if (recognizer.onWhiteSpace) {
                recognizer.onWhiteSpace.call(this, child, children, context);
            }
            space = false;
        }

        children.push(child);
    }

    if (space && recognizer.onWhiteSpace) {
        recognizer.onWhiteSpace.call(this, null, children, context);
    }

    return children;
};
x40000 atrule `0zN
#6u] u40000 config >J?ѵM;&%n$0100644 create.js :?#S敕F40000 function O1IlKn%100644 index.js .{#U"DK*40000 node ._4v/ZivqIC40000 pseudo ) Hs	\RbP=40000 scope `f̤lb̡Ml3x`100644 container.js URn9r*E100644 font-face.js HW
vM;Yy100644 import.js NZcy'#˴G?H~&*100644 index.js FZGuб$*"UO100644 layer.js ڏDX,JE2E]100644 media.js ڇdWyBm]T100644 nest.js "U)NH100644 page.js "U)NH100644 scope.js q8CMC{9100644 starting-style.js dpG`OM*S͡100644 supports.js P$ř͹4xIimport { Ident } from '../../tokenizer/index.js';

// https://drafts.csswg.org/css-contain-3/#container-rule
// The keywords `none`, `and`, `not`, and `or` are excluded from the <custom-ident> above.
const nonContainerNameKeywords = new Set(['none', 'and', 'not', 'or']);

export default {
    parse: {
        prelude() {
            const children = this.createList();

            if (this.tokenType === Ident) {
                const name = this.substring(this.tokenStart, this.tokenEnd);

                if (!nonContainerNameKeywords.has(name.toLowerCase())) {
                    children.push(this.Identifier());
                }
            }

            children.push(this.Condition('container'));

            return children;
        },
        block(nested = false) {
            return this.Block(nested);
        }
    }
};
x export default {
    parse: {
        prelude: null,
        block() {
            return this.Block(true);
        }
    }
};
!x
iimport {
    String as StringToken,
    Ident,
    Url,
    Function as FunctionToken,
    LeftParenthesis,
    RightParenthesis
} from '../../tokenizer/index.js';

function parseWithFallback(parse, fallback) {
    return this.parseWithFallback(
        () => {
            try {
                return parse.call(this);
            } finally {
                this.skipSC();
                if (this.lookupNonWSType(0) !== RightParenthesis) {
                    this.error();
                }
            }
        },
        fallback || (() => this.Raw(null, true))
    );
}

const parseFunctions = {
    layer() {
        this.skipSC();

        const children = this.createList();
        const node = parseWithFallback.call(this, this.Layer);

        if (node.type !== 'Raw' || node.value !== '') {
            children.push(node);
        }

        return children;
    },
    supports() {
        this.skipSC();

        const children = this.createList();
        const node = parseWithFallback.call(
            this,
            this.Declaration,
            () => parseWithFallback.call(this, () => this.Condition('supports'))
        );

        if (node.type !== 'Raw' || node.value !== '') {
            children.push(node);
        }

        return children;
    }
};

export default {
    parse: {
        prelude() {
            const children = this.createList();

            switch (this.tokenType) {
                case StringToken:
                    children.push(this.String());
                    break;

                case Url:
                case FunctionToken:
                    children.push(this.Url());
                    break;

                default:
                    this.error('String or url() is expected');
            }

            this.skipSC();

            if (this.tokenType === Ident &&
                this.cmpStr(this.tokenStart, this.tokenEnd, 'layer')) {
                children.push(this.Identifier());
            } else if (
                this.tokenType === FunctionToken &&
                this.cmpStr(this.tokenStart, this.tokenEnd, 'layer(')
            ) {
                children.push(this.Function(null, parseFunctions));
            }

            this.skipSC();

            if (this.tokenType === FunctionToken &&
                this.cmpStr(this.tokenStart, this.tokenEnd, 'supports(')) {
                children.push(this.Function(null, parseFunctions));
            }

            if (this.lookupNonWSType(0) === Ident ||
                this.lookupNonWSType(0) === LeftParenthesis) {
                children.push(this.MediaQueryList());
            }

            return children;
        },
        block: null
    }
};
NԺ"x*import container from './container.js';
import fontFace from './font-face.js';
import importAtrule from './import.js';
import layer from './layer.js';
import media from './media.js';
import nest from './nest.js';
import page from './page.js';
import scope from './scope.js';
import startingStyle from './starting-style.js';
import supports from './supports.js';

export default {
    container,
    'font-face': fontFace,
    import: importAtrule,
    layer,
    media,
    nest,
    page,
    scope,
    'starting-style': startingStyle,
    supports
};
L x.export default {
    parse: {
        prelude() {
            return this.createSingleNodeList(
                this.LayerList()
            );
        },
        block(nested = false, { allowNestedRules = false } = {}) {
            return this.Block(nested, { allowNestedRules });
        }
    }
};
Tx3export default {
    parse: {
        prelude() {
            return this.createSingleNodeList(
                this.MediaQueryList()
            );
        },
        block(nested = false, { allowNestedRules = false } = {}) {
            return this.Block(nested, { allowNestedRules });
        }
    }
};
bVx export default {
    parse: {
        prelude() {
            return this.createSingleNodeList(
                this.SelectorList()
            );
        },
        block() {
            return this.Block(true);
        }
    }
};
;ux export default {
    parse: {
        prelude() {
            return this.createSingleNodeList(
                this.Scope()
            );
        },
        block(nested = false) {
            return this.Block(nested);
        }
    }
};
>`x pexport default {
    parse: {
        prelude: null,
        block(nested = false) {
            return this.Block(nested);
        }
    }
};
'x  export default {
    parse: {
        prelude() {
            return this.createSingleNodeList(
                this.Condition('supports')
            );
        },
        block(nested = false) {
            return this.Block(nested);
        }
    }
};
Q[Cx 100644 generator.js th۰Bq100644 lexer.js yRT>g/ 	/H100644 mix.js B7;*̂7U q{100644 parser-selector.js +2"PI100644 parser.js Oa7$С6SU100644 walker.js !]H?nR\	|#V]˱xQ import * as node from '../node/index-generate.js';

export default {
    node
};
ajx import { cssWideKeywords } from '../../lexer/generic-const.js';
import definitions from '../../data.js';
import * as node from '../node/index.js';

export default {
    generic: true,
    cssWideKeywords,
    ...definitions,
    node
};
TM9xfunction appendOrSet(a, b) {
    if (typeof b === 'string' && /^\s*\|/.test(b)) {
        return typeof a === 'string'
            ? a + b
            : b.replace(/^\s*\|\s*/, '');
    }

    return b || null;
}

function extractProps(obj, props) {
    const result = Object.create(null);

    for (const prop of Object.keys(obj)) {
        if (props.includes(prop)) {
            result[prop] = obj[prop];
        }
    }

    return result;
}

function mergeDicts(base, ext, fields) {
    const result = { ...base };

    for (const [key, props] of Object.entries(ext)) {
        result[key] = {
            ...result[key],
            ...fields ? extractProps(props, fields) : props
        };
    }

    return result;
}

export default function mix(dest, src) {
    const result = { ...dest };

    for (const [prop, value] of Object.entries(src)) {
        switch (prop) {
            case 'generic':
                result[prop] = Boolean(value);
                break;

            case 'cssWideKeywords':
                result[prop] = dest[prop]
                    ? [...dest[prop], ...value]
                    : value || [];
                break;

            case 'units':
                result[prop] = { ...dest[prop] };
                for (const [name, patch] of Object.entries(value)) {
                    result[prop][name] = Array.isArray(patch) ? patch : [];
                }
                break;

            case 'atrules':
                result[prop] = { ...dest[prop] };

                for (const [name, atrule] of Object.entries(value)) {
                    const exists = result[prop][name] || {};
                    const current = result[prop][name] = {
                        prelude: exists.prelude || null,
                        descriptors: {
                            ...exists.descriptors
                        }
                    };

                    if (!atrule) {
                        continue;
                    }

                    current.prelude = atrule.prelude
                        ? appendOrSet(current.prelude, atrule.prelude)
                        : current.prelude || null;

                    for (const [descriptorName, descriptorValue] of Object.entries(atrule.descriptors || {})) {
                        current.descriptors[descriptorName] = descriptorValue
                            ? appendOrSet(current.descriptors[descriptorName], descriptorValue)
                            : null;
                    }

                    if (!Object.keys(current.descriptors).length) {
                        current.descriptors = null;
                    }
                }
                break;

            case 'types':
            case 'properties':
                result[prop] = { ...dest[prop] };
                for (const [name, syntax] of Object.entries(value)) {
                    result[prop][name] = appendOrSet(result[prop][name], syntax);
                }
                break;

            case 'parseContext':
                result[prop] = {
                    ...dest[prop],
                    ...value
                };
                break;

            case 'scope':
            case 'features':
                result[prop] = mergeDicts(dest[prop], value);
                break;

            case 'atrule':
            case 'pseudo':
                result[prop] = mergeDicts(dest[prop], value, ['parse']);
                break;

            case 'node':
                result[prop] = mergeDicts(dest[prop], value, ['name', 'structure', 'parse', 'generate', 'walkContext']);
                break;

            case 'tokenize':
                if (typeof value === 'function') {
                    result[prop] = value;
                }
                break;
        }
    }

    return result;
}
SLxbimport { Selector } from '../scope/index.js';
import pseudo from '../pseudo/index.js';
import * as node from '../node/index-parse-selector.js';

export default {
    parseContext: {
        default: 'SelectorList',
        selectorList: 'SelectorList',
        selector: 'Selector'
    },
    scope: { Selector },
    atrule: {},
    pseudo,
    node
};
	couLx9import * as scope from '../scope/index.js';
import atrule from '../atrule/index.js';
import pseudo from '../pseudo/index.js';
import * as node from '../node/index-parse.js';
import { tokenize } from '../../tokenizer/index.js';

export default {
    parseContext: {
        default: 'StyleSheet',
        stylesheet: 'StyleSheet',
        atrule: 'Atrule',
        atrulePrelude(options) {
            return this.AtrulePrelude(options.atrule ? String(options.atrule) : null);
        },
        mediaQueryList: 'MediaQueryList',
        mediaQuery: 'MediaQuery',
        condition(options) {
            return this.Condition(options.kind);
        },
        rule: 'Rule',
        selectorList: 'SelectorList',
        selector: 'Selector',
        block() {
            return this.Block(true);
        },
        declarationList: 'DeclarationList',
        declaration: 'Declaration',
        value: 'Value'
    },
    features: {
        supports: {
            selector() {
                return this.Selector();
            }
        },
        container: {
            style() {
                return this.Declaration();
            }
        }
    },
    scope,
    atrule,
    pseudo,
    node,
    tokenize
};
`;xH import * as node from '../node/index.js';

export default {
    node
};
ffxbimport { createParser } from '../parser/create.js';
import { createGenerator } from '../generator/create.js';
import { createConvertor } from '../convertor/create.js';
import { createWalker } from '../walker/create.js';
import { Lexer } from '../lexer/Lexer.js';
import mix from './config/mix.js';
import { getTokenizer } from '../utils/get-tokenizer.js';

function createSyntax(config) {
    const parse = createParser(config);
    const walk = createWalker(config);
    const generate = createGenerator(config);
    const { fromPlainObject, toPlainObject } = createConvertor(walk);

    const syntax = {
        lexer: null,
        createLexer: config => new Lexer(config, syntax, syntax.lexer.structure),

        tokenize: getTokenizer(config),
        parse,
        generate,

        walk,
        find: walk.find,
        findLast: walk.findLast,
        findAll: walk.findAll,

        fromPlainObject,
        toPlainObject,

        fork(extension) {
            const base = mix({}, config); // copy of config

            return createSyntax(
                typeof extension === 'function'
                    ? extension(base) // TODO: remove Object.assign as second parameter
                    : mix(base, extension)
            );
        }
    };

    syntax.lexer = new Lexer({
        generic: config.generic,
        cssWideKeywords: config.cssWideKeywords,
        units: config.units,
        types: config.types,
        atrules: config.atrules,
        properties: config.properties,
        node: config.node
    }, syntax);

    return syntax;
};

export default config => createSyntax(mix({}, config));
C!xK 100644 expression.js lB,]B100644 var.js 9G;APtw9Oؼ	x c// legacy IE function
// expression( <any-value> )
export default function() {
    return this.createSingleNodeList(
        this.Raw(null, false)
    );
}
 2Fxoimport { Comma, WhiteSpace } from '../../tokenizer/index.js';

// var( <ident> , <value>? )
export default function() {
    const children = this.createList();

    this.skipSC();

    // NOTE: Don't check more than a first argument is an ident, rest checks are for lexer
    children.push(this.Identifier());

    this.skipSC();

    if (this.tokenType === Comma) {
        children.push(this.Operator());

        const startIndex = this.tokenIndex;
        const value = this.parseCustomProperty
            ? this.Value(null)
            : this.Raw(this.consumeUntilExclamationMarkOrSemicolon, false);

        if (value.type === 'Value' && value.children.isEmpty) {
            for (let offset = startIndex - this.tokenIndex; offset <= 0; offset++) {
                if (this.lookupType(offset) === WhiteSpace) {
                    value.children.appendData({
                        type: 'WhiteSpace',
                        loc: null,
                        value: ' '
                    });
                    break;
                }
            }
        }

        children.push(value);
    }

    return children;
};
Aximport createSyntax from './create.js';
import lexerConfig from './config/lexer.js';
import parserConfig from './config/parser.js';
import walkerConfig from './config/walker.js';

export default createSyntax({
    ...lexerConfig,
    ...parserConfig,
    ...walkerConfig
});
^b]xk100644 AnPlusB.js O+:T#ZC(Oבa100644 Atrule.js 3yT	Nqz龬a5"100644 AtrulePrelude.js [VETuSOA c100644 AttributeSelector.js x*%?bp100644 Block.js prU
P7@ 100644 Brackets.js 868C100644 CDC.js HŤCOcl{)Juhe100644 CDO.js *A"Y)EF100644 ClassSelector.js p^uQOy100644 Combinator.js .[>@򔉷Ƭ0uI100644 Comment.js )>3|߂D100644 Condition.js մ2@B2[5100644 Declaration.js >w0w$4100644 DeclarationList.js O'12'김0)hj100644 Dimension.js K(X@(100644 Feature.js /-mp67Ep`!100644 FeatureFunction.js XiG\ŘIQլ7y100644 FeatureRange.js >G?4Vڍ100644 Function.js A@ASIVϙƜ100644 GeneralEnclosed.js 0`() ԇ5A	100644 Hash.js Ru,ZV1Kʜ\ϝ100644 IdSelector.js \/-rDNmA9AdVę@100644 Identifier.js |-*N100644 Layer.js pܵkH}u_5/100644 LayerList.js \աU^<el100644 MediaQuery.js iUk<!7t("抷100644 MediaQueryList.js K.R/<Alx100644 NestingSelector.js 3ȶ
H*,RneW{@100644 Nth.js J2
HaFy:R˧P100644 Number.js !P(n*W7)D100644 Operator.js O8&WO	?"]E100644 Parentheses.js lR΄tP100644 Percentage.js <b:^]
; #Pğ100644 PseudoClassSelector.js XEFƁ<}Û1f| 100644 PseudoElementSelector.js ;ctݶ100644 Ratio.js l !ۿ9P=100644 Raw.js .ԽcMT͖100644 Rule.js id17۩VDC100644 Scope.js eZL~/KqU100644 Selector.js 6UQA(p/l100644 SelectorList.js <݋?*LWi+Y>zy100644 String.js ᪥C\ˀTCsa100644 StyleSheet.js ;4zrUGfWl)Z100644 SupportsDeclaration.js nSCX1gU(oM100644 TypeSelector.js 2\\dS=<100644 UnicodeRange.js IYK-tj100644 Url.js Rbfs ]ӞW100644 Value.js F[03c?LX100644 WhiteSpace.js 46s%C'"np8100644 index-generate.js V6m&2`2100644 index-parse-selector.js :
*>i{9p96_u100644 index-parse.js m9
jn*~100644 index.js Jޢ "Q\IKx_import {
    isDigit,
    WhiteSpace,
    Comment,
    Ident,
    Number,
    Dimension
} from '../../tokenizer/index.js';

const PLUSSIGN = 0x002B;    // U+002B PLUS SIGN (+)
const HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)
const N = 0x006E;           // U+006E LATIN SMALL LETTER N (n)
const DISALLOW_SIGN = true;
const ALLOW_SIGN = false;

function checkInteger(offset, disallowSign) {
    let pos = this.tokenStart + offset;
    const code = this.charCodeAt(pos);

    if (code === PLUSSIGN || code === HYPHENMINUS) {
        if (disallowSign) {
            this.error('Number sign is not allowed');
        }
        pos++;
    }

    for (; pos < this.tokenEnd; pos++) {
        if (!isDigit(this.charCodeAt(pos))) {
            this.error('Integer is expected', pos);
        }
    }
}

function checkTokenIsInteger(disallowSign) {
    return checkInteger.call(this, 0, disallowSign);
}

function expectCharCode(offset, code) {
    if (!this.cmpChar(this.tokenStart + offset, code)) {
        let msg = '';

        switch (code) {
            case N:
                msg = 'N is expected';
                break;
            case HYPHENMINUS:
                msg = 'HyphenMinus is expected';
                break;
        }

        this.error(msg, this.tokenStart + offset);
    }
}

// ... <signed-integer>
// ... ['+' | '-'] <signless-integer>
function consumeB() {
    let offset = 0;
    let sign = 0;
    let type = this.tokenType;

    while (type === WhiteSpace || type === Comment) {
        type = this.lookupType(++offset);
    }

    if (type !== Number) {
        if (this.isDelim(PLUSSIGN, offset) ||
            this.isDelim(HYPHENMINUS, offset)) {
            sign = this.isDelim(PLUSSIGN, offset) ? PLUSSIGN : HYPHENMINUS;

            do {
                type = this.lookupType(++offset);
            } while (type === WhiteSpace || type === Comment);

            if (type !== Number) {
                this.skip(offset);
                checkTokenIsInteger.call(this, DISALLOW_SIGN);
            }
        } else {
            return null;
        }
    }

    if (offset > 0) {
        this.skip(offset);
    }

    if (sign === 0) {
        type = this.charCodeAt(this.tokenStart);
        if (type !== PLUSSIGN && type !== HYPHENMINUS) {
            this.error('Number sign is expected');
        }
    }

    checkTokenIsInteger.call(this, sign !== 0);
    return sign === HYPHENMINUS ? '-' + this.consume(Number) : this.consume(Number);
}

// An+B microsyntax https://www.w3.org/TR/css-syntax-3/#anb
export const name = 'AnPlusB';
export const structure = {
    a: [String, null],
    b: [String, null]
};

export function parse() {
    /* eslint-disable brace-style*/
    const start = this.tokenStart;
    let a = null;
    let b = null;

    // <integer>
    if (this.tokenType === Number) {
        checkTokenIsInteger.call(this, ALLOW_SIGN);
        b = this.consume(Number);
    }

    // -n
    // -n <signed-integer>
    // -n ['+' | '-'] <signless-integer>
    // -n- <signless-integer>
    // <dashndashdigit-ident>
    else if (this.tokenType === Ident && this.cmpChar(this.tokenStart, HYPHENMINUS)) {
        a = '-1';

        expectCharCode.call(this, 1, N);

        switch (this.tokenEnd - this.tokenStart) {
            // -n
            // -n <signed-integer>
            // -n ['+' | '-'] <signless-integer>
            case 2:
                this.next();
                b = consumeB.call(this);
                break;

            // -n- <signless-integer>
            case 3:
                expectCharCode.call(this, 2, HYPHENMINUS);

                this.next();
                this.skipSC();

                checkTokenIsInteger.call(this, DISALLOW_SIGN);

                b = '-' + this.consume(Number);
                break;

            // <dashndashdigit-ident>
            default:
                expectCharCode.call(this, 2, HYPHENMINUS);
                checkInteger.call(this, 3, DISALLOW_SIGN);
                this.next();

                b = this.substrToCursor(start + 2);
        }
    }

    // '+'? n
    // '+'? n <signed-integer>
    // '+'? n ['+' | '-'] <signless-integer>
    // '+'? n- <signless-integer>
    // '+'? <ndashdigit-ident>
    else if (this.tokenType === Ident || (this.isDelim(PLUSSIGN) && this.lookupType(1) === Ident)) {
        let sign = 0;
        a = '1';

        // just ignore a plus
        if (this.isDelim(PLUSSIGN)) {
            sign = 1;
            this.next();
        }

        expectCharCode.call(this, 0, N);

        switch (this.tokenEnd - this.tokenStart) {
            // '+'? n
            // '+'? n <signed-integer>
            // '+'? n ['+' | '-'] <signless-integer>
            case 1:
                this.next();
                b = consumeB.call(this);
                break;

            // '+'? n- <signless-integer>
            case 2:
                expectCharCode.call(this, 1, HYPHENMINUS);

                this.next();
                this.skipSC();

                checkTokenIsInteger.call(this, DISALLOW_SIGN);

                b = '-' + this.consume(Number);
                break;

            // '+'? <ndashdigit-ident>
            default:
                expectCharCode.call(this, 1, HYPHENMINUS);
                checkInteger.call(this, 2, DISALLOW_SIGN);
                this.next();

                b = this.substrToCursor(start + sign + 1);
        }
    }

    // <ndashdigit-dimension>
    // <ndash-dimension> <signless-integer>
    // <n-dimension>
    // <n-dimension> <signed-integer>
    // <n-dimension> ['+' | '-'] <signless-integer>
    else if (this.tokenType === Dimension) {
        const code = this.charCodeAt(this.tokenStart);
        const sign = code === PLUSSIGN || code === HYPHENMINUS;
        let i = this.tokenStart + sign;

        for (; i < this.tokenEnd; i++) {
            if (!isDigit(this.charCodeAt(i))) {
                break;
            }
        }

        if (i === this.tokenStart + sign) {
            this.error('Integer is expected', this.tokenStart + sign);
        }

        expectCharCode.call(this, i - this.tokenStart, N);
        a = this.substring(start, i);

        // <n-dimension>
        // <n-dimension> <signed-integer>
        // <n-dimension> ['+' | '-'] <signless-integer>
        if (i + 1 === this.tokenEnd) {
            this.next();
            b = consumeB.call(this);
        } else {
            expectCharCode.call(this, i - this.tokenStart + 1, HYPHENMINUS);

            // <ndash-dimension> <signless-integer>
            if (i + 2 === this.tokenEnd) {
                this.next();
                this.skipSC();
                checkTokenIsInteger.call(this, DISALLOW_SIGN);
                b = '-' + this.consume(Number);
            }
            // <ndashdigit-dimension>
            else {
                checkInteger.call(this, i - this.tokenStart + 2, DISALLOW_SIGN);
                this.next();
                b = this.substrToCursor(i + 1);
            }
        }
    } else {
        this.error();
    }

    if (a !== null && a.charCodeAt(0) === PLUSSIGN) {
        a = a.substr(1);
    }

    if (b !== null && b.charCodeAt(0) === PLUSSIGN) {
        b = b.substr(1);
    }

    return {
        type: 'AnPlusB',
        loc: this.getLocation(start, this.tokenStart),
        a,
        b
    };
}

export function generate(node) {
    if (node.a) {
        const a =
            node.a === '+1' && 'n' ||
            node.a ===  '1' && 'n' ||
            node.a === '-1' && '-n' ||
            node.a + 'n';

        if (node.b) {
            const b = node.b[0] === '-' || node.b[0] === '+'
                ? node.b
                : '+' + node.b;
            this.tokenize(a + b);
        } else {
            this.tokenize(a);
        }
    } else {
        this.tokenize(node.b);
    }
}
/Lx	?import {
    AtKeyword,
    Semicolon,
    LeftCurlyBracket,
    RightCurlyBracket
} from '../../tokenizer/index.js';

function consumeRaw() {
    return this.Raw(this.consumeUntilLeftCurlyBracketOrSemicolon, true);
}

function isDeclarationBlockAtrule() {
    for (let offset = 1, type; type = this.lookupType(offset); offset++) {
        if (type === RightCurlyBracket) {
            return true;
        }

        if (type === LeftCurlyBracket ||
            type === AtKeyword) {
            return false;
        }
    }

    return false;
}


export const name = 'Atrule';
export const walkContext = 'atrule';
export const structure = {
    name: String,
    prelude: ['AtrulePrelude', 'Raw', null],
    block: ['Block', null]
};

export function parse(isDeclaration = false, { allowNestedRules = false } = {}) {
    const start = this.tokenStart;
    let name;
    let nameLowerCase;
    let prelude = null;
    let block = null;

    this.eat(AtKeyword);

    name = this.substrToCursor(start + 1);
    nameLowerCase = name.toLowerCase();
    this.skipSC();

    // parse prelude
    if (this.eof === false &&
        this.tokenType !== LeftCurlyBracket &&
        this.tokenType !== Semicolon) {
        if (this.parseAtrulePrelude) {
            prelude = this.parseWithFallback(this.AtrulePrelude.bind(this, name, isDeclaration), consumeRaw);
        } else {
            prelude = consumeRaw.call(this, this.tokenIndex);
        }

        this.skipSC();
    }

    switch (this.tokenType) {
        case Semicolon:
            this.next();
            break;

        case LeftCurlyBracket:
            if (hasOwnProperty.call(this.atrule, nameLowerCase) &&
                typeof this.atrule[nameLowerCase].block === 'function') {
                block = this.atrule[nameLowerCase].block.call(this, isDeclaration, { allowNestedRules });
            } else {
                // TODO: should consume block content as Raw?
                block = this.Block(isDeclaration || isDeclarationBlockAtrule.call(this), { allowNestedRules });
            }

            break;
    }

    return {
        type: 'Atrule',
        loc: this.getLocation(start, this.tokenStart),
        name,
        prelude,
        block
    };
}

export function generate(node) {
    this.token(AtKeyword, '@' + node.name);

    if (node.prelude !== null) {
        this.node(node.prelude);
    }

    if (node.block) {
        this.node(node.block);
    } else {
        this.token(Semicolon, ';');
    }
}
3@ximport {
    Semicolon,
    LeftCurlyBracket
} from '../../tokenizer/index.js';

export const name = 'AtrulePrelude';
export const walkContext = 'atrulePrelude';
export const structure = {
    children: [[]]
};

export function parse(name) {
    let children = null;

    if (name !== null) {
        name = name.toLowerCase();
    }

    this.skipSC();

    if (hasOwnProperty.call(this.atrule, name) &&
        typeof this.atrule[name].prelude === 'function') {
        // custom consumer
        children = this.atrule[name].prelude.call(this);
    } else {
        // default consumer
        children = this.readSequence(this.scope.AtrulePrelude);
    }

    this.skipSC();

    if (this.eof !== true &&
        this.tokenType !== LeftCurlyBracket &&
        this.tokenType !== Semicolon) {
        this.error('Semicolon or block is expected');
    }

    return {
        type: 'AtrulePrelude',
        loc: this.getLocationFromList(children),
        children
    };
}

export function generate(node) {
    this.children(node);
}
 Aپximport {
    Ident,
    String as StringToken,
    Delim,
    LeftSquareBracket,
    RightSquareBracket
} from '../../tokenizer/index.js';

const DOLLARSIGN = 0x0024;       // U+0024 DOLLAR SIGN ($)
const ASTERISK = 0x002A;         // U+002A ASTERISK (*)
const EQUALSSIGN = 0x003D;       // U+003D EQUALS SIGN (=)
const CIRCUMFLEXACCENT = 0x005E; // U+005E (^)
const VERTICALLINE = 0x007C;     // U+007C VERTICAL LINE (|)
const TILDE = 0x007E;            // U+007E TILDE (~)

function getAttributeName() {
    if (this.eof) {
        this.error('Unexpected end of input');
    }

    const start = this.tokenStart;
    let expectIdent = false;

    if (this.isDelim(ASTERISK)) {
        expectIdent = true;
        this.next();
    } else if (!this.isDelim(VERTICALLINE)) {
        this.eat(Ident);
    }

    if (this.isDelim(VERTICALLINE)) {
        if (this.charCodeAt(this.tokenStart + 1) !== EQUALSSIGN) {
            this.next();
            this.eat(Ident);
        } else if (expectIdent) {
            this.error('Identifier is expected', this.tokenEnd);
        }
    } else if (expectIdent) {
        this.error('Vertical line is expected');
    }

    return {
        type: 'Identifier',
        loc: this.getLocation(start, this.tokenStart),
        name: this.substrToCursor(start)
    };
}

function getOperator() {
    const start = this.tokenStart;
    const code = this.charCodeAt(start);

    if (code !== EQUALSSIGN &&        // =
        code !== TILDE &&             // ~=
        code !== CIRCUMFLEXACCENT &&  // ^=
        code !== DOLLARSIGN &&        // $=
        code !== ASTERISK &&          // *=
        code !== VERTICALLINE         // |=
    ) {
        this.error('Attribute selector (=, ~=, ^=, $=, *=, |=) is expected');
    }

    this.next();

    if (code !== EQUALSSIGN) {
        if (!this.isDelim(EQUALSSIGN)) {
            this.error('Equal sign is expected');
        }

        this.next();
    }

    return this.substrToCursor(start);
}

// '[' <wq-name> ']'
// '[' <wq-name> <attr-matcher> [ <string-token> | <ident-token> ] <attr-modifier>? ']'
export const name = 'AttributeSelector';
export const structure = {
    name: 'Identifier',
    matcher: [String, null],
    value: ['String', 'Identifier', null],
    flags: [String, null]
};

export function parse() {
    const start = this.tokenStart;
    let name;
    let matcher = null;
    let value = null;
    let flags = null;

    this.eat(LeftSquareBracket);
    this.skipSC();

    name = getAttributeName.call(this);
    this.skipSC();

    if (this.tokenType !== RightSquareBracket) {
        // avoid case `[name i]`
        if (this.tokenType !== Ident) {
            matcher = getOperator.call(this);

            this.skipSC();

            value = this.tokenType === StringToken
                ? this.String()
                : this.Identifier();

            this.skipSC();
        }

        // attribute flags
        if (this.tokenType === Ident) {
            flags = this.consume(Ident);

            this.skipSC();
        }
    }

    this.eat(RightSquareBracket);

    return {
        type: 'AttributeSelector',
        loc: this.getLocation(start, this.tokenStart),
        name,
        matcher,
        value,
        flags
    };
}

export function generate(node) {
    this.token(Delim, '[');
    this.node(node.name);

    if (node.matcher !== null) {
        this.tokenize(node.matcher);
        this.node(node.value);
    }

    if (node.flags !== null) {
        this.token(Ident, node.flags);
    }

    this.token(Delim, ']');
}
嵏x
import {
    WhiteSpace,
    Comment,
    Delim,
    Semicolon,
    Hash,
    Colon,
    Ident,
    Function,
    AtKeyword,
    LeftSquareBracket,
    LeftCurlyBracket,
    RightCurlyBracket
} from '../../tokenizer/index.js';

const AMPERSAND = 0x0026;       // U+0026 AMPERSAND (&)
const DOT = 0x002E;             // U+002E FULL STOP (.)
const STAR = 0x002A;            // U+002A ASTERISK (*);
const PLUSSIGN = 0x002B;        // U+002B PLUS SIGN (+)
const GREATERTHANSIGN = 0x003E; // U+003E GREATER-THAN SIGN (>)
const TILDE = 0x007E;           // U+007E TILDE (~)

const selectorStarts = new Set([
    AMPERSAND,
    DOT,
    STAR,
    PLUSSIGN,
    GREATERTHANSIGN,
    TILDE
]);

function consumeRaw() {
    return this.Raw(null, true);
}
function consumeRule() {
    return this.parseWithFallback(this.Rule, consumeRaw);
}
function consumeRawDeclaration() {
    return this.Raw(this.consumeUntilSemicolonIncluded, true);
}
function consumeDeclaration() {
    if (this.tokenType === Semicolon) {
        return consumeRawDeclaration.call(this, this.tokenIndex);
    }

    const node = this.parseWithFallback(this.Declaration, consumeRawDeclaration);

    if (this.tokenType === Semicolon) {
        this.next();
    }

    return node;
}

function isElementSelectorStart() {
    if (this.tokenType !== Ident) {
        return false;
    }

    const nextTokenType = this.lookupTypeNonSC(1);

    // If next token is not colon, semicolon, or right curly bracket, it's likely a selector
    if (nextTokenType !== Colon && nextTokenType !== Semicolon && nextTokenType !== RightCurlyBracket) {
        return true;
    }

    // If next token is colon, we need to look further ahead to distinguish
    // between property declarations (p: value) and pseudo-class selectors (p:hover)
    if (nextTokenType === Colon) {
        // Look for the token after the colon (skipping whitespace)
        const tokenAfterColon = this.lookupTypeNonSC(2);

        // If it's an identifier (like 'hover', 'first-of-type') or function (like 'nth-child()', 'not()'),
        // this could be a pseudo-class
        if (tokenAfterColon === Ident || tokenAfterColon === Function) {
            // Look further ahead to see if there's a left curly bracket
            // which would indicate this is a selector with a block
            let offset = 3;
            let tokenType;

            // Skip whitespace and look for either a left curly bracket or other tokens
            while (offset <= 15) { // Increased limit to handle function pseudo-classes
                tokenType = this.lookupType(offset);

                if (tokenType === LeftCurlyBracket) {
                    // Found opening brace, this is definitely a selector
                    return true;
                } else if (tokenType === Semicolon || tokenType === RightCurlyBracket) {
                    // Found semicolon or closing brace before opening brace, likely a property
                    return false;
                } else if (tokenType === WhiteSpace || tokenType === Comment) {
                    // Skip whitespace and comments
                    offset++;
                    continue;
                } else {
                    // Other tokens might indicate more complex selectors, continue looking
                    offset++;
                }
            }
        }

        // If we can't determine conclusively, default to property behavior
        return false;
    }

    return false;
}

function isSelectorStart() {
    // Check for Delim tokens that might be selector starts
    if (this.tokenType === Delim && selectorStarts.has(this.source.charCodeAt(this.tokenStart))) {
        const code = this.source.charCodeAt(this.tokenStart);

        // Special case: browser hack prefixes (*, +, &) followed immediately by an ident
        // (no whitespace) are declarations, not selectors. Examples: *zoom: 1; +width: 100px; &prop: value;
        if (code === STAR || code === PLUSSIGN || code === AMPERSAND) {
            const nextToken = this.lookupType(1);
            const nextTokenNonSC = this.lookupTypeNonSC(1);

            // If next token is Ident and there's no whitespace between, it's a declaration
            if (nextToken === Ident && nextTokenNonSC === Ident) {
                return false;
            }
        }
        return true;
    }

    // Hash can be either a Hash token (#id selector) or Delim(#) + Ident (browser hack)
    // When it's a Hash token, it's a selector. When it's Delim, check if followed by Ident without whitespace
    if (this.tokenType === Hash) {
        return true;
    }

    return this.tokenType === LeftSquareBracket ||
        this.tokenType === Colon || isElementSelectorStart.call(this);
}

export const name = 'Block';
export const walkContext = 'block';
export const structure = {
    children: [[
        'Atrule',
        'Rule',
        'Declaration'
    ]]
};

export function parse(isStyleBlock, { allowNestedRules = false } = {}) {
    const start = this.tokenStart;
    let children = this.createList();

    this.eat(LeftCurlyBracket);

    scan:
    while (!this.eof) {
        switch (this.tokenType) {
            case RightCurlyBracket:
                break scan;

            case WhiteSpace:
            case Comment:
                this.next();
                break;

            case AtKeyword:
                children.push(this.parseWithFallback(this.Atrule.bind(this, isStyleBlock, { allowNestedRules }), consumeRaw));
                break;

            default:
                if (isStyleBlock) {

                    if (allowNestedRules && isSelectorStart.call(this)) {
                        children.push(consumeRule.call(this));
                    } else {
                        children.push(consumeDeclaration.call(this));
                    }

                } else {
                    children.push(consumeRule.call(this));
                }
        }
    }

    if (!this.eof) {
        this.eat(RightCurlyBracket);
    }

    return {
        type: 'Block',
        loc: this.getLocation(start, this.tokenStart),
        children
    };
}

export function generate(node) {
    this.token(LeftCurlyBracket, '{');
    this.children(node, prev => {
        if (prev.type === 'Declaration') {
            this.token(Semicolon, ';');
        }
    });
    this.token(RightCurlyBracket, '}');
}
|];*xRimport {
    Delim,
    LeftSquareBracket,
    RightSquareBracket
} from '../../tokenizer/index.js';

export const name = 'Brackets';
export const structure = {
    children: [[]]
};

export function parse(readSequence, recognizer) {
    const start = this.tokenStart;
    let children = null;

    this.eat(LeftSquareBracket);

    children = readSequence.call(this, recognizer);

    if (!this.eof) {
        this.eat(RightSquareBracket);
    }

    return {
        type: 'Brackets',
        loc: this.getLocation(start, this.tokenStart),
        children
    };
}

export function generate(node) {
    this.token(Delim, '[');
    this.children(node);
    this.token(Delim, ']');
}
،x`import { CDC } from '../../tokenizer/index.js';

export const name = 'CDC';
export const structure = {};

export function parse() {
    const start = this.tokenStart;

    this.eat(CDC); // -->

    return {
        type: 'CDC',
        loc: this.getLocation(start, this.tokenStart)
    };
}

export function generate() {
    this.token(CDC, '-->');
}
;lOxbimport { CDO } from '../../tokenizer/index.js';

export const name = 'CDO';
export const structure = {};

export function parse() {
    const start = this.tokenStart;

    this.eat(CDO); // <!--

    return {
        type: 'CDO',
        loc: this.getLocation(start, this.tokenStart)
    };
}

export function generate() {
    this.token(CDO, '<!--');
}
lɲ ximport { Delim, Ident } from '../../tokenizer/index.js';

const FULLSTOP = 0x002E; // U+002E FULL STOP (.)

// '.' ident
export const name = 'ClassSelector';
export const structure = {
    name: String
};

export function parse() {
    this.eatDelim(FULLSTOP);

    return {
        type: 'ClassSelector',
        loc: this.getLocation(this.tokenStart - 1, this.tokenEnd),
        name: this.consume(Ident)
    };
}

export function generate(node) {
    this.token(Delim, '.');
    this.token(Ident, node.name);
}
eSx8import { WhiteSpace, Delim } from '../../tokenizer/index.js';

const PLUSSIGN = 0x002B;        // U+002B PLUS SIGN (+)
const SOLIDUS = 0x002F;         // U+002F SOLIDUS (/)
const GREATERTHANSIGN = 0x003E; // U+003E GREATER-THAN SIGN (>)
const TILDE = 0x007E;           // U+007E TILDE (~)

export const name = 'Combinator';
export const structure = {
    name: String
};

// + | > | ~ | /deep/
export function parse() {
    const start = this.tokenStart;
    let name;

    switch (this.tokenType) {
        case WhiteSpace:
            name = ' ';
            break;

        case Delim:
            switch (this.charCodeAt(this.tokenStart)) {
                case GREATERTHANSIGN:
                case PLUSSIGN:
                case TILDE:
                    this.next();
                    break;

                case SOLIDUS:
                    this.next();
                    this.eatIdent('deep');
                    this.eatDelim(SOLIDUS);
                    break;

                default:
                    this.error('Combinator is expected');
            }

            name = this.substrToCursor(start);
            break;
    }

    return {
        type: 'Combinator',
        loc: this.getLocation(start, this.tokenStart),
        name
    };
}

export function generate(node) {
    this.tokenize(node.name);
}
\.ximport { Comment } from '../../tokenizer/index.js';

const ASTERISK = 0x002A;        // U+002A ASTERISK (*)
const SOLIDUS = 0x002F;         // U+002F SOLIDUS (/)


export const name = 'Comment';
export const structure = {
    value: String
};

export function parse() {
    const start = this.tokenStart;
    let end = this.tokenEnd;

    this.eat(Comment);

    if ((end - start + 2) >= 2 &&
        this.charCodeAt(end - 2) === ASTERISK &&
        this.charCodeAt(end - 1) === SOLIDUS) {
        end -= 2;
    }

    return {
        type: 'Comment',
        loc: this.getLocation(start, this.tokenStart),
        value: this.substring(start + 2, end)
    };
}

export function generate(node) {
    this.token(Comment, '/*' + node.value + '*/');
}
8״xuimport {
    WhiteSpace,
    Comment,
    Ident,
    LeftParenthesis,
    RightParenthesis,
    Function as FunctionToken,
    Colon,
    EOF
} from '../../tokenizer/index.js';

const likelyFeatureToken = new Set([Colon, RightParenthesis, EOF]);

export const name = 'Condition';
export const structure = {
    kind: String,
    children: [[
        'Identifier',
        'Feature',
        'FeatureFunction',
        'FeatureRange',
        'SupportsDeclaration'
    ]]
};

function featureOrRange(kind) {
    if (this.lookupTypeNonSC(1) === Ident &&
        likelyFeatureToken.has(this.lookupTypeNonSC(2))) {
        return this.Feature(kind);
    }

    return this.FeatureRange(kind);
}

const parentheses = {
    media: featureOrRange,
    container: featureOrRange,
    supports() {
        return this.SupportsDeclaration();
    }
};

export function parse(kind = 'media') {
    const children = this.createList();

    scan: while (!this.eof) {
        switch (this.tokenType) {
            case Comment:
            case WhiteSpace:
                this.next();
                continue;

            case Ident:
                children.push(this.Identifier());
                break;

            case LeftParenthesis: {
                let term = this.parseWithFallback(
                    () => parentheses[kind].call(this, kind),
                    () => null
                );

                if (!term) {
                    term = this.parseWithFallback(
                        () => {
                            this.eat(LeftParenthesis);
                            const res = this.Condition(kind);
                            this.eat(RightParenthesis);
                            return res;
                        },
                        () => {
                            return this.GeneralEnclosed(kind);
                        }
                    );
                }

                children.push(term);
                break;
            }

            case FunctionToken: {
                let term = this.parseWithFallback(
                    () => this.FeatureFunction(kind),
                    () => null
                );

                if (!term) {
                    term = this.GeneralEnclosed(kind);
                }

                children.push(term);
                break;
            }

            default:
                break scan;
        }
    }

    if (children.isEmpty) {
        this.error('Condition is expected');
    }

    return {
        type: 'Condition',
        loc: this.getLocationFromList(children),
        kind,
        children
    };
}

export function generate(node) {
    node.children.forEach(child => {
        if (child.type === 'Condition') {
            this.token(LeftParenthesis, '(');
            this.node(child);
            this.token(RightParenthesis, ')');
        } else {
            this.node(child);
        }
    });
}

mx,import { isCustomProperty } from '../../utils/names.js';
import {
    Ident,
    Hash,
    Colon,
    Semicolon,
    Delim,
    WhiteSpace
} from '../../tokenizer/index.js';

const EXCLAMATIONMARK = 0x0021; // U+0021 EXCLAMATION MARK (!)
const NUMBERSIGN = 0x0023;      // U+0023 NUMBER SIGN (#)
const DOLLARSIGN = 0x0024;      // U+0024 DOLLAR SIGN ($)
const AMPERSAND = 0x0026;       // U+0026 AMPERSAND (&)
const ASTERISK = 0x002A;        // U+002A ASTERISK (*)
const PLUSSIGN = 0x002B;        // U+002B PLUS SIGN (+)
const SOLIDUS = 0x002F;         // U+002F SOLIDUS (/)

function consumeValueRaw() {
    return this.Raw(this.consumeUntilExclamationMarkOrSemicolon, true);
}

function consumeCustomPropertyRaw() {
    return this.Raw(this.consumeUntilExclamationMarkOrSemicolon, false);
}

function consumeValue() {
    const startValueToken = this.tokenIndex;
    const value = this.Value();

    if (value.type !== 'Raw' &&
        this.eof === false &&
        this.tokenType !== Semicolon &&
        this.isDelim(EXCLAMATIONMARK) === false &&
        this.isBalanceEdge(startValueToken) === false) {
        this.error();
    }

    return value;
}

export const name = 'Declaration';
export const walkContext = 'declaration';
export const structure = {
    important: [Boolean, String],
    property: String,
    value: ['Value', 'Raw']
};

export function parse() {
    const start = this.tokenStart;
    const startToken = this.tokenIndex;
    const property = readProperty.call(this);
    const customProperty = isCustomProperty(property);
    const parseValue = customProperty ? this.parseCustomProperty : this.parseValue;
    const consumeRaw = customProperty ? consumeCustomPropertyRaw : consumeValueRaw;
    let important = false;
    let value;

    this.skipSC();
    this.eat(Colon);

    const valueStart = this.tokenIndex;

    if (!customProperty) {
        this.skipSC();
    }

    if (parseValue) {
        value = this.parseWithFallback(consumeValue, consumeRaw);
    } else {
        value = consumeRaw.call(this, this.tokenIndex);
    }

    if (customProperty && value.type === 'Value' && value.children.isEmpty) {
        for (let offset = valueStart - this.tokenIndex; offset <= 0; offset++) {
            if (this.lookupType(offset) === WhiteSpace) {
                value.children.appendData({
                    type: 'WhiteSpace',
                    loc: null,
                    value: ' '
                });
                break;
            }
        }
    }

    if (this.isDelim(EXCLAMATIONMARK)) {
        important = getImportant.call(this);
        this.skipSC();
    }

    // Do not include semicolon to range per spec
    // https://drafts.csswg.org/css-syntax/#declaration-diagram

    if (this.eof === false &&
        this.tokenType !== Semicolon &&
        this.isBalanceEdge(startToken) === false) {
        this.error();
    }

    return {
        type: 'Declaration',
        loc: this.getLocation(start, this.tokenStart),
        important,
        property,
        value
    };
}

export function generate(node) {
    this.token(Ident, node.property);
    this.token(Colon, ':');
    this.node(node.value);

    if (node.important) {
        this.token(Delim, '!');
        this.token(Ident, node.important === true ? 'important' : node.important);
    }
}

function readProperty() {
    const start = this.tokenStart;

    // hacks
    if (this.tokenType === Delim) {
        switch (this.charCodeAt(this.tokenStart)) {
            case ASTERISK:
            case DOLLARSIGN:
            case PLUSSIGN:
            case NUMBERSIGN:
            case AMPERSAND:
                this.next();
                break;

            // TODO: not sure we should support this hack
            case SOLIDUS:
                this.next();
                if (this.isDelim(SOLIDUS)) {
                    this.next();
                }
                break;
        }
    }

    if (this.tokenType === Hash) {
        this.eat(Hash);
    } else {
        this.eat(Ident);
    }

    return this.substrToCursor(start);
}

// ! ws* important
function getImportant() {
    this.eat(Delim);
    this.skipSC();

    const important = this.consume(Ident);

    // store original value in case it differ from `important`
    // for better original source restoring and hacks like `!ie` support
    return important === 'important' ? true : important;
}
i%x'import {
    WhiteSpace,
    Comment,
    Semicolon,
    AtKeyword,
    Delim,
    Hash,
    LeftSquareBracket,
    Colon,
    Ident,
    RightCurlyBracket,
    LeftCurlyBracket,
    Comma
} from '../../tokenizer/index.js';

const AMPERSAND = 0x0026;       // U+0026 AMPERSAND (&)
const DOT = 0x002E;             // U+002E FULL STOP (.)
const STAR = 0x002A;            // U+002A ASTERISK (*);
const PLUSSIGN = 0x002B;        // U+002B PLUS SIGN (+)
const GREATERTHANSIGN = 0x003E; // U+003E GREATER-THAN SIGN (>)
const TILDE = 0x007E;           // U+007E TILDE (~)

const selectorStarts = new Set([
    AMPERSAND,
    DOT,
    STAR,
    PLUSSIGN,
    GREATERTHANSIGN,
    TILDE
]);

function consumeRaw() {
    return this.Raw(this.consumeUntilSemicolonIncluded, true);
}

function isElementSelectorStart() {
    if (this.tokenType !== Ident) {
        return false;
    }

    const nextTokenType = this.lookupTypeNonSC(1);

    // If next token is a left curly bracket, it's definitely a selector (e.g., "div { ... }")
    if (nextTokenType === LeftCurlyBracket) {
        return true;
    }

    // If next token is semicolon, comma, or closing brace, it's definitely a declaration
    if (nextTokenType === Semicolon || nextTokenType === Comma || nextTokenType === RightCurlyBracket) {
        return false;
    }

    // Special handling for colon case - could be pseudo-class/pseudo-element or property
    if (nextTokenType === Colon) {
        // Look ahead further to see what follows the colon
        const afterColonType = this.lookupTypeNonSC(2);

        // If after colon there's an identifier (pseudo-class/pseudo-element name),
        // check what comes after that
        if (afterColonType === Ident) {
            const afterPseudoType = this.lookupTypeNonSC(3);
            // If it's followed by {, it's definitely a selector (e.g., "div:hover { ... }")
            if (afterPseudoType === LeftCurlyBracket) {
                return true;
            }
            // Otherwise, it's a property (e.g., "transition: opacity 1s")
            return false;
        }
        // If after colon there's not an identifier, it's a property
        return false;
    }

    // For other token types (dimensions, numbers, strings, etc.), assume it's a declaration
    // This handles cases like multi-value properties
    return false;
}

function isSelectorStart() {
    return this.tokenType === Delim && selectorStarts.has(this.source.charCodeAt(this.tokenStart)) ||
        this.tokenType === Hash || this.tokenType === LeftSquareBracket ||
        this.tokenType === Colon || isElementSelectorStart.call(this);
}

export const name = 'DeclarationList';
export const structure = {
    children: [[
        'Declaration',
        'Atrule',
        'Rule'
    ]]
};

export function parse() {
    const children = this.createList();

    scan:
    while (!this.eof) {
        switch (this.tokenType) {
            case WhiteSpace:
            case Comment:
            case Semicolon:
                this.next();
                break;

            case AtKeyword:
                children.push(this.parseWithFallback(this.Atrule.bind(this, true), consumeRaw));
                break;

            default:
                if (isSelectorStart.call(this))  {
                    children.push(this.parseWithFallback(this.Rule, consumeRaw));
                } else {
                    children.push(this.parseWithFallback(this.Declaration, consumeRaw));
                }
        }
    }

    return {
        type: 'DeclarationList',
        loc: this.getLocationFromList(children),
        children
    };
}

export function generate(node) {
    this.children(node, prev => {
        if (prev.type === 'Declaration') {
            this.token(Semicolon, ';');
        }
    });
}

a!ximport { Dimension } from '../../tokenizer/index.js';

export const name = 'Dimension';
export const structure = {
    value: String,
    unit: String
};

export function parse() {
    const start = this.tokenStart;
    const value = this.consumeNumber(Dimension);

    return {
        type: 'Dimension',
        loc: this.getLocation(start, this.tokenStart),
        value,
        unit: this.substring(start + value.length, this.tokenStart)
    };
}

export function generate(node) {
    this.token(Dimension, node.value + node.unit);
}
`x	import {
    Ident,
    Number,
    Dimension,
    Function as FunctionToken,
    LeftParenthesis,
    RightParenthesis,
    Colon,
    Delim
} from '../../tokenizer/index.js';

const SOLIDUS = 0x002F;  // U+002F SOLIDUS (/)

export const name = 'Feature';
export const structure = {
    kind: String,
    name: String,
    value: ['Identifier', 'Number', 'Dimension', 'Ratio', 'Function', null]
};

export function parse(kind) {
    const start = this.tokenStart;
    let name;
    let value = null;

    this.eat(LeftParenthesis);
    this.skipSC();

    name = this.consume(Ident);
    this.skipSC();

    if (this.tokenType !== RightParenthesis) {
        this.eat(Colon);
        this.skipSC();

        switch (this.tokenType) {
            case Number:
                if (this.lookupNonWSType(1) === Delim) {
                    value = this.Ratio();
                } else {
                    value = this.Number();
                }

                break;

            case Dimension:
                value = this.Dimension();
                break;

            case Ident:
                value = this.Identifier();
                break;

            case FunctionToken:
                value = this.parseWithFallback(
                    () => {
                        const res = this.Function(this.readSequence, this.scope.Value);

                        this.skipSC();

                        if (this.isDelim(SOLIDUS)) {
                            this.error();
                        }

                        return res;
                    },
                    () => {
                        return this.Ratio();
                    }
                );
                break;

            default:
                this.error('Number, dimension, ratio or identifier is expected');
        }

        this.skipSC();
    }

    if (!this.eof) {
        this.eat(RightParenthesis);
    }

    return {
        type: 'Feature',
        loc: this.getLocation(start, this.tokenStart),
        kind,
        name,
        value
    };
}

export function generate(node) {
    this.token(LeftParenthesis, '(');
    this.token(Ident, node.name);

    if (node.value !== null) {
        this.token(Colon, ':');
        this.node(node.value);
    }

    this.token(RightParenthesis, ')');
}
`κ^ximport {
    Function as FunctionToken,
    RightParenthesis
} from '../../tokenizer/index.js';

export const name = 'FeatureFunction';
export const structure = {
    kind: String,
    feature: String,
    value: ['Declaration', 'Selector']
};

function getFeatureParser(kind, name) {
    const featuresOfKind = this.features[kind] || {};
    const parser = featuresOfKind[name];

    if (typeof parser !== 'function') {
        this.error(`Unknown feature ${name}()`);
    }

    return parser;
}

export function parse(kind = 'unknown') {
    const start = this.tokenStart;
    const functionName = this.consumeFunctionName();
    const valueParser = getFeatureParser.call(this, kind, functionName.toLowerCase());

    this.skipSC();

    const value = this.parseWithFallback(
        () => {
            const startValueToken = this.tokenIndex;
            const value = valueParser.call(this);

            if (this.eof === false &&
                this.isBalanceEdge(startValueToken) === false) {
                this.error();
            }

            return value;
        },
        () => this.Raw(null, false)
    );

    if (!this.eof) {
        this.eat(RightParenthesis);
    }

    return {
        type: 'FeatureFunction',
        loc: this.getLocation(start, this.tokenStart),
        kind,
        feature: functionName,
        value
    };
}

export function generate(node) {
    this.token(FunctionToken, node.feature + '(');
    this.node(node.value);
    this.token(RightParenthesis, ')');
}
щximport {
    Ident,
    Number,
    Dimension,
    Function as FunctionToken,
    LeftParenthesis,
    RightParenthesis
} from '../../tokenizer/index.js';

const SOLIDUS = 0x002F;         // U+002F SOLIDUS (/)
const LESSTHANSIGN = 0x003C;    // U+003C LESS-THAN SIGN (<)
const EQUALSSIGN = 0x003D;      // U+003D EQUALS SIGN (=)
const GREATERTHANSIGN = 0x003E; // U+003E GREATER-THAN SIGN (>)

export const name = 'FeatureRange';
export const structure = {
    kind: String,
    left: ['Identifier', 'Number', 'Dimension', 'Ratio', 'Function'],
    leftComparison: String,
    middle: ['Identifier', 'Number', 'Dimension', 'Ratio', 'Function'],
    rightComparison: [String, null],
    right: ['Identifier', 'Number', 'Dimension', 'Ratio', 'Function', null]
};

function readTerm() {
    this.skipSC();

    switch (this.tokenType) {
        case Number:
            if (this.isDelim(SOLIDUS, this.lookupOffsetNonSC(1))) {
                return this.Ratio();
            } else {
                return this.Number();
            }

        case Dimension:
            return this.Dimension();

        case Ident:
            return this.Identifier();

        case FunctionToken:
            return this.parseWithFallback(
                () => {
                    const res = this.Function(this.readSequence, this.scope.Value);

                    this.skipSC();

                    if (this.isDelim(SOLIDUS)) {
                        this.error();
                    }

                    return res;
                },
                () => {
                    return this.Ratio();
                }
            );

        default:
            this.error('Number, dimension, ratio or identifier is expected');
    }
}

function readComparison(expectColon) {
    this.skipSC();

    if (this.isDelim(LESSTHANSIGN) ||
        this.isDelim(GREATERTHANSIGN)) {
        const value = this.source[this.tokenStart];

        this.next();

        if (this.isDelim(EQUALSSIGN)) {
            this.next();
            return value + '=';
        }

        return value;
    }

    if (this.isDelim(EQUALSSIGN)) {
        return '=';
    }

    this.error(`Expected ${expectColon ? '":", ' : ''}"<", ">", "=" or ")"`);
}

export function parse(kind = 'unknown') {
    const start = this.tokenStart;

    this.skipSC();
    this.eat(LeftParenthesis);

    const left = readTerm.call(this);
    const leftComparison = readComparison.call(this, left.type === 'Identifier');
    const middle = readTerm.call(this);
    let rightComparison = null;
    let right = null;

    if (this.lookupNonWSType(0) !== RightParenthesis) {
        rightComparison = readComparison.call(this);
        right = readTerm.call(this);
    }

    this.skipSC();
    this.eat(RightParenthesis);

    return {
        type: 'FeatureRange',
        loc: this.getLocation(start, this.tokenStart),
        kind,
        left,
        leftComparison,
        middle,
        rightComparison,
        right
    };
}

export function generate(node) {
    this.token(LeftParenthesis, '(');
    this.node(node.left);
    this.tokenize(node.leftComparison);
    this.node(node.middle);

    if (node.right) {
        this.tokenize(node.rightComparison);
        this.node(node.right);
    }

    this.token(RightParenthesis, ')');
}
z$<x1import {
    Function as FunctionToken,
    RightParenthesis
} from '../../tokenizer/index.js';


export const name = 'Function';
export const walkContext = 'function';
export const structure = {
    name: String,
    children: [[]]
};

// <function-token> <sequence> )
export function parse(readSequence, recognizer) {
    const start = this.tokenStart;
    const name = this.consumeFunctionName();
    const nameLowerCase = name.toLowerCase();
    let children;

    children = recognizer.hasOwnProperty(nameLowerCase)
        ? recognizer[nameLowerCase].call(this, recognizer)
        : readSequence.call(this, recognizer);

    if (!this.eof) {
        this.eat(RightParenthesis);
    }

    return {
        type: 'Function',
        loc: this.getLocation(start, this.tokenStart),
        name,
        children
    };
}

export function generate(node) {
    this.token(FunctionToken, node.name + '(');
    this.children(node);
    this.token(RightParenthesis, ')');
}
:T]x'import {
    Function as FunctionToken,
    LeftParenthesis,
    RightParenthesis
} from '../../tokenizer/index.js';


export const name = 'GeneralEnclosed';
export const structure = {
    kind: String,
    function: [String, null],
    children: [[]]
};

// <function-token> <any-value> )
// ( <any-value> )
export function parse(kind) {
    const start = this.tokenStart;
    let functionName = null;

    if (this.tokenType === FunctionToken) {
        functionName = this.consumeFunctionName();
    } else {
        this.eat(LeftParenthesis);
    }

    const children = this.parseWithFallback(
        () => {
            const startValueToken = this.tokenIndex;
            const children = this.readSequence(this.scope.Value);

            if (this.eof === false &&
                this.isBalanceEdge(startValueToken) === false) {
                this.error();
            }

            return children;
        },
        () => this.createSingleNodeList(
            this.Raw(null, false)
        )
    );

    if (!this.eof) {
        this.eat(RightParenthesis);
    }

    return {
        type: 'GeneralEnclosed',
        loc: this.getLocation(start, this.tokenStart),
        kind,
        function: functionName,
        children
    };
}

export function generate(node) {
    if (node.function) {
        this.token(FunctionToken, node.function + '(');
    } else {
        this.token(LeftParenthesis, '(');
    }

    this.children(node);
    this.token(RightParenthesis, ')');
}
.x*import { Hash } from '../../tokenizer/index.js';

// '#' ident
export const xxx = 'XXX';
export const name = 'Hash';
export const structure = {
    value: String
};
export function parse() {
    const start = this.tokenStart;

    this.eat(Hash);

    return {
        type: 'Hash',
        loc: this.getLocation(start, this.tokenStart),
        value: this.substrToCursor(start + 1)
    };
}
export function generate(node) {
    this.token(Hash, '#' + node.value);
}

.ximport { Hash, Delim } from '../../tokenizer/index.js';

export const name = 'IdSelector';
export const structure = {
    name: String
};

export function parse() {
    const start = this.tokenStart;

    // TODO: check value is an ident
    this.eat(Hash);

    return {
        type: 'IdSelector',
        loc: this.getLocation(start, this.tokenStart),
        name: this.substrToCursor(start + 1)
    };
}

export function generate(node) {
    // Using Delim instead of Hash is a hack to avoid for a whitespace between ident and id-selector
    // in safe mode (e.g. "a#id"), because IE11 doesn't allow a sequence <ident-token> <hash-token>
    // without a whitespace in values (e.g. "1px solid#000")
    this.token(Delim, '#' + node.name);
}
6xximport { Ident } from '../../tokenizer/index.js';

export const name = 'Identifier';
export const structure = {
    name: String
};

export function parse() {
    return {
        type: 'Identifier',
        loc: this.getLocation(this.tokenStart, this.tokenEnd),
        name: this.consume(Ident)
    };
}

export function generate(node) {
    this.token(Ident, node.name);
}
|y$xFimport { Ident, Delim } from '../../tokenizer/index.js';

const FULLSTOP = 0x002E; // U+002E FULL STOP (.)

export const name = 'Layer';
export const structure = {
    name: String
};

export function parse() {
    let tokenStart = this.tokenStart;
    let name = this.consume(Ident);

    while (this.isDelim(FULLSTOP)) {
        this.eat(Delim);
        name += '.' + this.consume(Ident);
    }

    return {
        type: 'Layer',
        loc: this.getLocation(tokenStart, this.tokenStart),
        name
    };
}

export function generate(node) {
    this.tokenize(node.name);
}
L/q*x[import { Comma } from '../../tokenizer/index.js';

export const name = 'SelectorList';
export const walkContext = 'selector';
export const structure = {
    children: [[
        'Selector',
        'Raw'
    ]]
};

export function parse() {
    const children = this.createList();

    while (!this.eof) {
        children.push(this.Selector());

        if (this.tokenType === Comma) {
            this.next();
            continue;
        }

        break;
    }

    return {
        type: 'SelectorList',
        loc: this.getLocationFromList(children),
        children
    };
}

export function generate(node) {
    this.children(node, () => this.token(Comma, ','));
}
7
1x THLayeO(LayerTthis.skipSC8MLayer());

        if (this.lookupTypeNonSC(0) !== Comma) {
            breakthis.skipSC();
this.skipSC()%Laye#4x	Limport {
    Comma,
    EOF,
    Ident,
    LeftCurlyBracket,
    LeftParenthesis,
    Function as FunctionToken,
    Semicolon
} from '../../tokenizer/index.js';

export const name = 'MediaQuery';
export const structure = {
    modifier: [String, null],
    mediaType: [String, null],
    condition: ['Condition', null]
};

export function parse() {
    const start = this.tokenStart;
    let modifier = null;
    let mediaType = null;
    let condition = null;

    this.skipSC();

    if (this.tokenType === Ident && this.lookupTypeNonSC(1) !== LeftParenthesis) {
        // [ not | only ]? <media-type>
        const ident = this.consume(Ident);
        const identLowerCase = ident.toLowerCase();

        if (identLowerCase === 'not' || identLowerCase === 'only') {
            this.skipSC();
            modifier = identLowerCase;
            mediaType = this.consume(Ident);
        } else {
            mediaType = ident;
        }

        switch (this.lookupTypeNonSC(0)) {
            case Ident: {
                // and <media-condition-without-or>
                this.skipSC();
                this.eatIdent('and');
                condition = this.Condition('media');
                break;
            }

            case LeftCurlyBracket:
            case Semicolon:
            case Comma:
            case EOF:
                break;

            default:
                this.error('Identifier or parenthesis is expected');
        }
    } else {
        switch (this.tokenType) {
            case Ident:
            case LeftParenthesis:
            case FunctionToken: {
                // <media-condition>
                condition = this.Condition('media');
                break;
            }

            case LeftCurlyBracket:
            case Semicolon:
            case EOF:
                break;

            default:
                this.error('Identifier or parenthesis is expected');
        }
    }

    return {
        type: 'MediaQuery',
        loc: this.getLocation(start, this.tokenStart),
        modifier,
        mediaType,
        condition
    };
}

export function generate(node) {
    if (node.mediaType) {
        if (node.modifier) {
            this.token(Ident, node.modifier);
        }

        this.token(Ident, node.mediaType);

        if (node.condition) {
            this.token(Ident, 'and');
            this.node(node.condition);
        }
    } else if (node.condition) {
        this.node(node.condition);
    }
}

f'xtimport { Comma } from '../../tokenizer/index.js';

export const name = 'MediaQueryList';
export const structure = {
    children: [[
        'MediaQuery'
    ]]
};

export function parse() {
    const children = this.createList();

    this.skipSC();

    while (!this.eof) {
        children.push(this.MediaQuery());

        if (this.tokenType !== Comma) {
            break;
        }

        this.next();
    }

    return {
        type: 'MediaQueryList',
        loc: this.getLocationFromList(children),
        children
    };
}

export function generate(node) {
    this.children(node, () => this.token(Comma, ','));
}
>	Sx dimport { Delim h*2AMPERSAND = 0x0026;       // U+0026 AMPERSAND (&)
.NestingM&A
    this.eatDelim(AMPERSAND Nesting7@$&');
}
N+p:xPimport { Ident } from '../../tokenizer/index.js';

export const name = 'Nth';
export const structure = {
    nth: ['AnPlusB', 'Identifier'],
    selector: ['SelectorList', null]
};

export function parse() {
    this.skipSC();

    const start = this.tokenStart;
    let end = start;
    let selector = null;
    let nth;

    if (this.lookupValue(0, 'odd') || this.lookupValue(0, 'even')) {
        nth = this.Identifier();
    } else {
        nth = this.AnPlusB();
    }

    end = this.tokenStart;
    this.skipSC();

    if (this.lookupValue(0, 'of')) {
        this.next();

        selector = this.SelectorList();
        end = this.tokenStart;
    }

    return {
        type: 'Nth',
        loc: this.getLocation(start, end),
        nth,
        selector
    };
}

export function generate(node) {
    this.node(node.nth);
    if (node.selector !== null) {
        this.token(Ident, 'of');
        this.node(node.selector);
    }
}
vxpimport { Number as NumberToken } from '../../tokenizer/index.js';

export const name = 'Number';
export const structure = {
    value: String
};

export function parse() {
    return {
        type: 'Number',
        loc: this.getLocation(this.tokenStart, this.tokenEnd),
        value: this.consume(NumberToken)
    };
}

export function generate(node) {
    this.token(NumberToken, node.value);
}
삟xe// '/' | '*' | ',' | ':' | '+' | '-'
export const name = 'Operator';
export const structure = {
    value: String
};

export function parse() {
    const start = this.tokenStart;

    this.next();

    return {
        type: 'Operator',
        loc: this.getLocation(start, this.tokenStart),
        value: this.substrToCursor(start)
    };
}

export function generate(node) {
    this.tokenize(node.value);
}
}+xJimport {
    LeftParenthesis,
    RightParenthesis
} from '../../tokenizer/index.js';

export const name = 'Parentheses';
export const structure = {
    children: [[]]
};

export function parse(readSequence, recognizer) {
    const start = this.tokenStart;
    let children = null;

    this.eat(LeftParenthesis);

    children = readSequence.call(this, recognizer);

    if (!this.eof) {
        this.eat(RightParenthesis);
    }

    return {
        type: 'Parentheses',
        loc: this.getLocation(start, this.tokenStart),
        children
    };
}

export function generate(node) {
    this.token(LeftParenthesis, '(');
    this.children(node);
    this.token(RightParenthesis, ')');
}
bMxiimport { Percentage } from '../../tokenizer/index.js';

export const name = 'Percentage';
export const structure = {
    value: String
};

export function parse() {
    return {
        type: 'Percentage',
        loc: this.getLocation(this.tokenStart, this.tokenEnd),
        value: this.consumeNumber(Percentage)
    };
}

export function generate(node) {
    this.token(Percentage, node.value + '%');
}
OexQimport {
    Ident,
    Function as FunctionToken,
    Colon,
    RightParenthesis
} from '../../tokenizer/index.js';

export const name = 'PseudoElementSelector';
export const walkContext = 'function';
export const structure = {
    name: String,
    children: [['Raw'], null]
};

// :: [ <ident> | <function-token> <any-value>? ) ]
export function parse() {
    const start = this.tokenStart;
    let children = null;
    let name;
    let nameLowerCase;

    this.eat(Colon);
    this.eat(Colon);

    if (this.tokenType === FunctionToken) {
        name = this.consumeFunctionName();
        nameLowerCase = name.toLowerCase();

        if (this.lookupNonWSType(0) == RightParenthesis) {
            children = this.createList();
        } else if (hasOwnProperty.call(this.pseudo, nameLowerCase)) {
            this.skipSC();
            children = this.pseudo[nameLowerCase].call(this);
            this.skipSC();
        } else {
            children = this.createList();
            children.push(
                this.Raw(null, false)
            );
        }

        this.eat(RightParenthesis);
    } else {
        name = this.consume(Ident);
    }

    return {
        type: 'PseudoElementSelector',
        loc: this.getLocation(start, this.tokenStart),
        name,
        children
    };
}

export function generate(node) {
    this.token(Colon, ':');
    this.token(Colon, ':');

    if (node.children === null) {
        this.token(Ident, node.name);
    } else {
        this.token(FunctionToken, node.name + '(');
        this.children(node);
        this.token(RightParenthesis, ')');
    }
}
qz^xB w!
export const name = 'PseudoClassClassw:ƺ|x5import {
    Delim,
    Number as NumberToken,
    Function as FunctionToken
} from '../../tokenizer/index.js';

const SOLIDUS = 0x002F;  // U+002F SOLIDUS (/)

// Media Queries Level 3 defines terms of <ratio> as a positive (not zero or negative)
// integers (see https://drafts.csswg.org/mediaqueries-3/#values)
// However, Media Queries Level 4 removes any definition of values
// (see https://drafts.csswg.org/mediaqueries-4/#values) and refers to
// CSS Values and Units for detail. In CSS Values and Units Level 4 a <ratio>
// definition was added (see https://drafts.csswg.org/css-values-4/#ratios) which
// defines ratio as "<number [0,∞]> [ / <number [0,∞]> ]?" and based on it
// any constrains on terms were removed. Parser also doesn't test numbers
// in any way to make possible for linting and fixing them by the tools using CSSTree.
// An additional syntax examination may be applied by a lexer.
function consumeTerm() {
    this.skipSC();

    switch (this.tokenType) {
        case NumberToken:
            return this.Number();

        case FunctionToken:
            return this.Function(this.readSequence, this.scope.Value);

        default:
            this.error('Number of function is expected');
    }
}

export const name = 'Ratio';
export const structure = {
    left: ['Number', 'Function'],
    right: ['Number', 'Function', null]
};

// <number [0,∞]> [ / <number [0,∞]> ]?
export function parse() {
    const start = this.tokenStart;
    const left = consumeTerm.call(this);
    let right = null;

    this.skipSC();
    if (this.isDelim(SOLIDUS)) {
        this.eatDelim(SOLIDUS);
        right = consumeTerm.call(this);
    }

    return {
        type: 'Ratio',
        loc: this.getLocation(start, this.tokenStart),
        left,
        right
    };
}

export function generate(node) {
    this.node(node.left);
    this.token(Delim, '/');
    if (node.right) {
        this.node(node.right);
    } else {
        this.node(NumberToken, 1);
    }
}
:zAximport { WhiteSpace } from '../../tokenizer/index.js';

function getOffsetExcludeWS() {
    if (this.tokenIndex > 0) {
        if (this.lookupType(-1) === WhiteSpace) {
            return this.tokenIndex > 1
                ? this.getTokenStart(this.tokenIndex - 1)
                : this.firstCharOffset;
        }
    }

    return this.tokenStart;
}

export const name = 'Raw';
export const structure = {
    value: String
};

export function parse(consumeUntil, excludeWhiteSpace) {
    const startOffset = this.getTokenStart(this.tokenIndex);
    let endOffset;

    this.skipUntilBalanced(this.tokenIndex, consumeUntil || this.consumeUntilBalanceEnd);

    if (excludeWhiteSpace && this.tokenStart > startOffset) {
        endOffset = getOffsetExcludeWS.call(this);
    } else {
        endOffset = this.tokenStart;
    }

    return {
        type: 'Raw',
        loc: this.getLocation(startOffset, endOffset),
        value: this.substring(startOffset, endOffset)
    };
}

export function generate(node) {
    this.tokenize(node.value);
}
vNGxsimport { LeftCurlyBracket } from '../../tokenizer/index.js';

function consumeRaw() {
    return this.Raw(this.consumeUntilLeftCurlyBracket, true);
}

function consumePrelude() {
    const prelude = this.SelectorList();

    if (prelude.type !== 'Raw' &&
        this.eof === false &&
        this.tokenType !== LeftCurlyBracket) {
        this.error();
    }

    return prelude;
}

export const name = 'Rule';
export const walkContext = 'rule';
export const structure = {
    prelude: ['SelectorList', 'Raw'],
    block: ['Block']
};

export function parse() {
    const startToken = this.tokenIndex;
    const startOffset = this.tokenStart;
    let prelude;
    let block;

    if (this.parseRulePrelude) {
        prelude = this.parseWithFallback(consumePrelude, consumeRaw);
    } else {
        prelude = consumeRaw.call(this, startToken);
    }

    block = this.Block(true, { allowNestedRules: true });

    return {
        type: 'Rule',
        loc: this.getLocation(startOffset, this.tokenStart),
        prelude,
        block
    };
}
export function generate(node) {
    this.node(node.prelude);
    this.node(node.block);
}
Ak(^ximport {
    Ident,
    LeftParenthesis,
    RightParenthesis
} from '../../tokenizer/index.js';

export const name = 'Scope';
export const structure = {
    root: ['SelectorList', 'Raw', null],
    limit: ['SelectorList', 'Raw', null]
};

export function parse() {
    let root = null;
    let limit = null;

    this.skipSC();

    const startOffset = this.tokenStart;
    if (this.tokenType === LeftParenthesis) {
        this.next();
        this.skipSC();
        root = this.parseWithFallback(
            this.SelectorList,
            () => this.Raw(false, true)
        );
        this.skipSC();
        this.eat(RightParenthesis);
    }

    if (this.lookupNonWSType(0) === Ident) {
        this.skipSC();
        this.eatIdent('to');
        this.skipSC();
        this.eat(LeftParenthesis);
        this.skipSC();
        limit = this.parseWithFallback(
            this.SelectorList,
            () => this.Raw(false, true)
        );
        this.skipSC();
        this.eat(RightParenthesis);
    }

    return {
        type: 'Scope',
        loc: this.getLocation(startOffset, this.tokenStart),
        root,
        limit
    };
}

export function generate(node) {
    if (node.root) {
        this.token(LeftParenthesis, '(');
        this.node(node.root);
        this.token(RightParenthesis, ')');
    }

    if (node.limit) {
        this.token(Ident, 'to');
        this.token(LeftParenthesis, '(');
        this.node(node.limit);
        this.token(RightParenthesis, ')');
    }
}
։\)xdexport const name = 'Selector';
export const structure = {
    children: [[
        'TypeSelector',
        'IdSelector',
        'ClassSelector',
        'AttributeSelector',
        'PseudoClassSelector',
        'PseudoElementSelector',
        'Combinator'
    ]]
};

export function parse() {
    const children = this.readSequence(this.scope.Selector);

    // nothing were consumed
    if (this.getFirstListNode(children) === null) {
        this.error('Selector is expected');
    }

    return {
        type: 'Selector',
        loc: this.getLocationFromList(children),
        children
    };
}

export function generate(node) {
    this.children(node);
}
̡x(import { String as StringToken } from '../../tokenizer/index.js';
import { decode, encode } from '../../utils/string.js';

export const name = 'String';
export const structure = {
    value: String
};

export function parse() {
    return {
        type: 'String',
        loc: this.getLocation(this.tokenStart, this.tokenEnd),
        value: decode(this.consume(StringToken))
    };
}

export function generate(node) {
    this.token(StringToken, encode(node.value));
}
'(xxyimport {
    WhiteSpace,
    Comment,
    AtKeyword,
    CDO,
    CDC
} from '../../tokenizer/index.js';

const EXCLAMATIONMARK = 0x0021; // U+0021 EXCLAMATION MARK (!)

function consumeRaw() {
    return this.Raw(null, false);
}

export const name = 'StyleSheet';
export const walkContext = 'stylesheet';
export const structure = {
    children: [[
        'Comment',
        'CDO',
        'CDC',
        'Atrule',
        'Rule',
        'Raw'
    ]]
};

export function parse() {
    const start = this.tokenStart;
    const children = this.createList();
    let child;

    scan:
    while (!this.eof) {
        switch (this.tokenType) {
            case WhiteSpace:
                this.next();
                continue;

            case Comment:
                // ignore comments except exclamation comments (i.e. /*! .. */) on top level
                if (this.charCodeAt(this.tokenStart + 2) !== EXCLAMATIONMARK) {
                    this.next();
                    continue;
                }

                child = this.Comment();
                break;

            case CDO: // <!--
                child = this.CDO();
                break;

            case CDC: // -->
                child = this.CDC();
                break;

            // CSS Syntax Module Level 3
            // §2.2 Error handling
            // At the "top level" of a stylesheet, an <at-keyword-token> starts an at-rule.
            case AtKeyword:
                child = this.parseWithFallback(this.Atrule, consumeRaw);
                break;

            // Anything else starts a qualified rule ...
            default:
                child = this.parseWithFallback(this.Rule, consumeRaw);
        }

        children.push(child);
    }

    return {
        type: 'StyleSheet',
        loc: this.getLocation(start, this.tokenStart),
        children
    };
}

export function generate(node) {
    this.children(node);
}
ζ+xIimport {
    LeftParenthesis,
    RightParenthesis
} from '../../tokenizer/index.js';

export const name = 'SupportsDeclaration';
export const structure = {
    declaration: 'Declaration'
};

export function parse() {
    const start = this.tokenStart;

    this.eat(LeftParenthesis);
    this.skipSC();

    const declaration = this.Declaration();

    if (!this.eof) {
        this.eat(RightParenthesis);
    }

    return {
        type: 'SupportsDeclaration',
        loc: this.getLocation(start, this.tokenStart),
        declaration
    };
}

export function generate(node) {
    this.token(LeftParenthesis, '(');
    this.node(node.declaration);
    this.token(RightParenthesis, ')');
}
1ixgimport { Ident } from '../../tokenizer/index.js';

const ASTERISK = 0x002A;     // U+002A ASTERISK (*)
const VERTICALLINE = 0x007C; // U+007C VERTICAL LINE (|)

function eatIdentifierOrAsterisk() {
    if (this.tokenType !== Ident &&
        this.isDelim(ASTERISK) === false) {
        this.error('Identifier or asterisk is expected');
    }

    // Check if asterisk is followed immediately by an ident (no whitespace)
    // This is invalid in selectors (e.g., "*foo" should error, "* foo" or "*:hover" is ok)
    if (this.isDelim(ASTERISK)) {
        const currentTokenEnd = this.tokenStart + 1; // asterisk is 1 char
        this.next();

        // If next token is an ident and starts immediately after asterisk, it's an error
        if (this.tokenType === Ident && this.tokenStart === currentTokenEnd) {
            this.error('Whitespace is required between universal selector and type selector');
        }

        return;
    }

    this.next();
}

export const name = 'TypeSelector';
export const structure = {
    name: String
};

// ident
// ident|ident
// ident|*
// *
// *|ident
// *|*
// |ident
// |*
export function parse() {
    const start = this.tokenStart;

    if (this.isDelim(VERTICALLINE)) {
        this.next();
        eatIdentifierOrAsterisk.call(this);
    } else {
        eatIdentifierOrAsterisk.call(this);

        if (this.isDelim(VERTICALLINE)) {
            this.next();
            eatIdentifierOrAsterisk.call(this);
        }
    }

    return {
        type: 'TypeSelector',
        loc: this.getLocation(start, this.tokenStart),
        name: this.substrToCursor(start)
    };
}

export function generate(node) {
    this.tokenize(node.name);
}
ximport {
    isHexDigit,
    Ident,
    Number,
    Dimension
} from '../../tokenizer/index.js';

const PLUSSIGN = 0x002B;     // U+002B PLUS SIGN (+)
const HYPHENMINUS = 0x002D;  // U+002D HYPHEN-MINUS (-)
const QUESTIONMARK = 0x003F; // U+003F QUESTION MARK (?)

function eatHexSequence(offset, allowDash) {
    let len = 0;

    for (let pos = this.tokenStart + offset; pos < this.tokenEnd; pos++) {
        const code = this.charCodeAt(pos);

        if (code === HYPHENMINUS && allowDash && len !== 0) {
            eatHexSequence.call(this, offset + len + 1, false);
            return -1;
        }

        if (!isHexDigit(code)) {
            this.error(
                allowDash && len !== 0
                    ? 'Hyphen minus' + (len < 6 ? ' or hex digit' : '') + ' is expected'
                    : (len < 6 ? 'Hex digit is expected' : 'Unexpected input'),
                pos
            );
        }

        if (++len > 6) {
            this.error('Too many hex digits', pos);
        };
    }

    this.next();
    return len;
}

function eatQuestionMarkSequence(max) {
    let count = 0;

    while (this.isDelim(QUESTIONMARK)) {
        if (++count > max) {
            this.error('Too many question marks');
        }

        this.next();
    }
}

function startsWith(code) {
    if (this.charCodeAt(this.tokenStart) !== code) {
        this.error((code === PLUSSIGN ? 'Plus sign' : 'Hyphen minus') + ' is expected');
    }
}

// https://drafts.csswg.org/css-syntax/#urange
// Informally, the <urange> production has three forms:
// U+0001
//      Defines a range consisting of a single code point, in this case the code point "1".
// U+0001-00ff
//      Defines a range of codepoints between the first and the second value, in this case
//      the range between "1" and "ff" (255 in decimal) inclusive.
// U+00??
//      Defines a range of codepoints where the "?" characters range over all hex digits,
//      in this case defining the same as the value U+0000-00ff.
// In each form, a maximum of 6 digits is allowed for each hexadecimal number (if you treat "?" as a hexadecimal digit).
//
// <urange> =
//   u '+' <ident-token> '?'* |
//   u <dimension-token> '?'* |
//   u <number-token> '?'* |
//   u <number-token> <dimension-token> |
//   u <number-token> <number-token> |
//   u '+' '?'+
function scanUnicodeRange() {
    let hexLength = 0;

    switch (this.tokenType) {
        case Number:
            // u <number-token> '?'*
            // u <number-token> <dimension-token>
            // u <number-token> <number-token>
            hexLength = eatHexSequence.call(this, 1, true);

            if (this.isDelim(QUESTIONMARK)) {
                eatQuestionMarkSequence.call(this, 6 - hexLength);
                break;
            }

            if (this.tokenType === Dimension ||
                this.tokenType === Number) {
                startsWith.call(this, HYPHENMINUS);
                eatHexSequence.call(this, 1, false);
                break;
            }

            break;

        case Dimension:
            // u <dimension-token> '?'*
            hexLength = eatHexSequence.call(this, 1, true);

            if (hexLength > 0) {
                eatQuestionMarkSequence.call(this, 6 - hexLength);
            }

            break;

        default:
            // u '+' <ident-token> '?'*
            // u '+' '?'+
            this.eatDelim(PLUSSIGN);

            if (this.tokenType === Ident) {
                hexLength = eatHexSequence.call(this, 0, true);
                if (hexLength > 0) {
                    eatQuestionMarkSequence.call(this, 6 - hexLength);
                }
                break;
            }

            if (this.isDelim(QUESTIONMARK)) {
                this.next();
                eatQuestionMarkSequence.call(this, 5);
                break;
            }

            this.error('Hex digit or question mark is expected');
    }
}

export const name = 'UnicodeRange';
export const structure = {
    value: String
};

export function parse() {
    const start = this.tokenStart;

    // U or u
    this.eatIdent('u');
    scanUnicodeRange.call(this);

    return {
        type: 'UnicodeRange',
        loc: this.getLocation(start, this.tokenStart),
        value: this.substrToCursor(start)
    };
}

export function generate(node) {
    this.tokenize(node.value);
}
;^Nximport * as url from '../../utils/url.js';
import * as string from '../../utils/string.js';
import {
    Function as FunctionToken,
    String as StringToken,
    Url,
    RightParenthesis
} from '../../tokenizer/index.js';

export const name = 'Url';
export const structure = {
    value: String
};

// <url-token> | <function-token> <string> )
export function parse() {
    const start = this.tokenStart;
    let value;

    switch (this.tokenType) {
        case Url:
            value = url.decode(this.consume(Url));
            break;

        case FunctionToken:
            if (!this.cmpStr(this.tokenStart, this.tokenEnd, 'url(')) {
                this.error('Function name must be `url`');
            }

            this.eat(FunctionToken);
            this.skipSC();
            value = string.decode(this.consume(StringToken));
            this.skipSC();
            if (!this.eof) {
                this.eat(RightParenthesis);
            }
            break;

        default:
            this.error('Url or Function is expected');
    }

    return {
        type: 'Url',
        loc: this.getLocation(start, this.tokenStart),
        value
    };
}

export function generate(node) {
    this.token(Url, url.encode(node.value));
}
$	p=xyexport const name = 'Value';
export const structure = {
    children: [[]]
};

export function parse() {
    const start = this.tokenStart;
    const children = this.readSequence(this.scope.Value);

    return {
        type: 'Value',
        loc: this.getLocation(start, this.tokenStart),
        children
    };
}

export function generate(node) {
    this.children(node);
}
tWy!ximport { WhiteSpace } from '../../tokenizer/index.js';

const SPACE = Object.freeze({
    type: 'WhiteSpace',
    loc: null,
    value: ' '
});

export const name = 'WhiteSpace';
export const structure = {
    value: String
};

export function parse() {
    this.eat(WhiteSpace);
    return SPACE;

    // return {
    //     type: 'WhiteSpace',
    //     loc: this.getLocation(this.tokenStart, this.tokenEnd),
    //     value: this.consume(WHITESPACE)
    // };
}

export function generate(node) {
    this.token(WhiteSpace, node.value);
}
Tx
export { generate as AnPlusB } from './AnPlusB.js';
export { generate as Atrule } from './Atrule.js';
export { generate as AtrulePrelude } from './AtrulePrelude.js';
export { generate as AttributeSelector } from './AttributeSelector.js';
export { generate as Block } from './Block.js';
export { generate as Brackets } from './Brackets.js';
export { generate as CDC } from './CDC.js';
export { generate as CDO } from './CDO.js';
export { generate as ClassSelector } from './ClassSelector.js';
export { generate as Combinator } from './Combinator.js';
export { generate as Comment } from './Comment.js';
export { generate as Condition } from './Condition.js';
export { generate as Declaration } from './Declaration.js';
export { generate as DeclarationList } from './DeclarationList.js';
export { generate as Dimension } from './Dimension.js';
export { generate as Feature } from './Feature.js';
export { generate as FeatureFunction } from './FeatureFunction.js';
export { generate as FeatureRange } from './FeatureRange.js';
export { generate as Function } from './Function.js';
export { generate as GeneralEnclosed } from './GeneralEnclosed.js';
export { generate as Hash } from './Hash.js';
export { generate as Identifier } from './Identifier.js';
export { generate as IdSelector } from './IdSelector.js';
export { generate as Layer } from './Layer.js';
export { generate as LayerList } from './LayerList.js';
export { generate as MediaQuery } from './MediaQuery.js';
export { generate as MediaQueryList } from './MediaQueryList.js';
export { generate as NestingSelector } from './NestingSelector.js';
export { generate as Nth } from './Nth.js';
export { generate as Number } from './Number.js';
export { generate as Operator } from './Operator.js';
export { generate as Parentheses } from './Parentheses.js';
export { generate as Percentage } from './Percentage.js';
export { generate as PseudoClassSelector } from './PseudoClassSelector.js';
export { generate as PseudoElementSelector } from './PseudoElementSelector.js';
export { generate as Ratio } from './Ratio.js';
export { generate as Raw } from './Raw.js';
export { generate as Rule } from './Rule.js';
export { generate as Scope } from './Scope.js';
export { generate as Selector } from './Selector.js';
export { generate as SelectorList } from './SelectorList.js';
export { generate as String } from './String.js';
export { generate as StyleSheet } from './StyleSheet.js';
export { generate as SupportsDeclaration } from './SupportsDeclaration.js';
export { generate as TypeSelector } from './TypeSelector.js';
export { generate as UnicodeRange } from './UnicodeRange.js';
export { generate as Url } from './Url.js';
export { generate as Value } from './Value.js';
export { generate as WhiteSpace } from './WhiteSpace.js';
 <x<export { parse as AnPlusB } from './AnPlusB.js';
export { parse as AttributeSelector } from './AttributeSelector.js';
export { parse as ClassSelector } from './ClassSelector.js';
export { parse as Combinator } from './Combinator.js';
export { parse as Identifier } from './Identifier.js';
export { parse as IdSelector } from './IdSelector.js';
export { parse as NestingSelector } from './NestingSelector.js';
export { parse as Nth } from './Nth.js';
export { parse as Operator } from './Operator.js';
export { parse as Percentage } from './Percentage.js';
export { parse as PseudoClassSelector } from './PseudoClassSelector.js';
export { parse as PseudoElementSelector } from './PseudoElementSelector.js';
export { parse as Raw } from './Raw.js';
export { parse as Selector } from './Selector.js';
export { parse as SelectorList } from './SelectorList.js';
export { parse as String } from './String.js';
export { parse as TypeSelector } from './TypeSelector.js';
mPʿxO
export { parse as AnPlusB } from './AnPlusB.js';
export { parse as Atrule } from './Atrule.js';
export { parse as AtrulePrelude } from './AtrulePrelude.js';
export { parse as AttributeSelector } from './AttributeSelector.js';
export { parse as Block } from './Block.js';
export { parse as Brackets } from './Brackets.js';
export { parse as CDC } from './CDC.js';
export { parse as CDO } from './CDO.js';
export { parse as ClassSelector } from './ClassSelector.js';
export { parse as Combinator } from './Combinator.js';
export { parse as Comment } from './Comment.js';
export { parse as Condition } from './Condition.js';
export { parse as Declaration } from './Declaration.js';
export { parse as DeclarationList } from './DeclarationList.js';
export { parse as Dimension } from './Dimension.js';
export { parse as Feature } from './Feature.js';
export { parse as FeatureFunction } from './FeatureFunction.js';
export { parse as FeatureRange } from './FeatureRange.js';
export { parse as Function } from './Function.js';
export { parse as GeneralEnclosed } from './GeneralEnclosed.js';
export { parse as Hash } from './Hash.js';
export { parse as Identifier } from './Identifier.js';
export { parse as IdSelector } from './IdSelector.js';
export { parse as Layer } from './Layer.js';
export { parse as LayerList } from './LayerList.js';
export { parse as MediaQuery } from './MediaQuery.js';
export { parse as MediaQueryList } from './MediaQueryList.js';
export { parse as NestingSelector } from './NestingSelector.js';
export { parse as Nth } from './Nth.js';
export { parse as Number } from './Number.js';
export { parse as Operator } from './Operator.js';
export { parse as Parentheses } from './Parentheses.js';
export { parse as Percentage } from './Percentage.js';
export { parse as PseudoClassSelector } from './PseudoClassSelector.js';
export { parse as PseudoElementSelector } from './PseudoElementSelector.js';
export { parse as Ratio } from './Ratio.js';
export { parse as Raw } from './Raw.js';
export { parse as Rule } from './Rule.js';
export { parse as Scope } from './Scope.js';
export { parse as Selector } from './Selector.js';
export { parse as SelectorList } from './SelectorList.js';
export { parse as String } from './String.js';
export { parse as StyleSheet } from './StyleSheet.js';
export { parse as SupportsDeclaration } from './SupportsDeclaration.js';
export { parse as TypeSelector } from './TypeSelector.js';
export { parse as UnicodeRange } from './UnicodeRange.js';
export { parse as Url } from './Url.js';
export { parse as Value } from './Value.js';
export { parse as WhiteSpace } from './WhiteSpace.js';
x8export * as AnPlusB from './AnPlusB.js';
export * as Atrule from './Atrule.js';
export * as AtrulePrelude from './AtrulePrelude.js';
export * as AttributeSelector from './AttributeSelector.js';
export * as Block from './Block.js';
export * as Brackets from './Brackets.js';
export * as CDC from './CDC.js';
export * as CDO from './CDO.js';
export * as ClassSelector from './ClassSelector.js';
export * as Combinator from './Combinator.js';
export * as Comment from './Comment.js';
export * as Condition from './Condition.js';
export * as Declaration from './Declaration.js';
export * as DeclarationList from './DeclarationList.js';
export * as Dimension from './Dimension.js';
export * as Feature from './Feature.js';
export * as FeatureFunction from './FeatureFunction.js';
export * as FeatureRange from './FeatureRange.js';
export * as Function from './Function.js';
export * as GeneralEnclosed from './GeneralEnclosed.js';
export * as Hash from './Hash.js';
export * as Identifier from './Identifier.js';
export * as IdSelector from './IdSelector.js';
export * as Layer from './Layer.js';
export * as LayerList from './LayerList.js';
export * as MediaQuery from './MediaQuery.js';
export * as MediaQueryList from './MediaQueryList.js';
export * as NestingSelector from './NestingSelector.js';
export * as Nth from './Nth.js';
export * as Number from './Number.js';
export * as Operator from './Operator.js';
export * as Parentheses from './Parentheses.js';
export * as Percentage from './Percentage.js';
export * as PseudoClassSelector from './PseudoClassSelector.js';
export * as PseudoElementSelector from './PseudoElementSelector.js';
export * as Ratio from './Ratio.js';
export * as Raw from './Raw.js';
export * as Rule from './Rule.js';
export * as Scope from './Scope.js';
export * as Selector from './Selector.js';
export * as SelectorList from './SelectorList.js';
export * as String from './String.js';
export * as StyleSheet from './StyleSheet.js';
export * as SupportsDeclaration from './SupportsDeclaration.js';
export * as TypeSelector from './TypeSelector.js';
export * as UnicodeRange from './UnicodeRange.js';
export * as Url from './Url.js';
export * as Value from './Value.js';
export * as WhiteSpace from './WhiteSpace.js';
xG 100644 index.js }u
(R^#{100644 lang.js :ۆGZmY&LeAximport { parseLanguageRangeList } from './lang.js';

const selectorList = {
    parse() {
        return this.createSingleNodeList(
            this.SelectorList()
        );
    }
};

const selector = {
    parse() {
        return this.createSingleNodeList(
            this.Selector()
        );
    }
};

const identList = {
    parse() {
        return this.createSingleNodeList(
            this.Identifier()
        );
    }
};

const langList = {
    parse: parseLanguageRangeList
};

const nth = {
    parse() {
        return this.createSingleNodeList(
            this.Nth()
        );
    }
};

export default {
    'dir': identList,
    'has': selectorList,
    'lang': langList,
    'matches': selectorList,
    'is': selectorList,
    '-moz-any': selectorList,
    '-webkit-any': selectorList,
    'where': selectorList,
    'not': selectorList,
    'nth-child': nth,
    'nth-last-child': nth,
    'nth-last-of-type': nth,
    'nth-of-type': nth,
    'slotted': selector,
    'host': selector,
    'host-context': selector
};
]30ximport { Comma, String as StringToken, Ident, RightParenthesis } from '../../tokenizer/index.js';

export function parseLanguageRangeList() {
    const children = this.createList();

    this.skipSC();

    loop: while (!this.eof) {
        switch (this.tokenType) {
            case Ident:
                children.push(this.Identifier());
                break;

            case StringToken:
                children.push(this.String());
                break;

            case Comma:
                children.push(this.Operator());
                break;

            case RightParenthesis:
                break loop;

            default:
                this.error('Identifier, string or comma is expected');
        }

        this.skipSC();
    }

    return children;
}
ٝx >100644 atrulePrelude.js URx9&VYs;100644 default.js ^)7>hy100644 index.js mCybڽDc_zR100644 selector.js RTbBՔ+h!4100644 value.js ܔ! Ryv*$ǮLxE import getNode from './default.js';

export default {
    getNode
};
Fdx8	import {
    Ident,
    String as StringToken,
    Number as NumberToken,
    Function as FunctionToken,
    Url,
    Hash,
    Dimension,
    Percentage,
    LeftParenthesis,
    LeftSquareBracket,
    Comma,
    Delim
} from '../../tokenizer/index.js';

const NUMBERSIGN = 0x0023;  // U+0023 NUMBER SIGN (#)
const ASTERISK = 0x002A;    // U+002A ASTERISK (*)
const PLUSSIGN = 0x002B;    // U+002B PLUS SIGN (+)
const HYPHENMINUS = 0x002D; // U+002D HYPHEN-MINUS (-)
const SOLIDUS = 0x002F;     // U+002F SOLIDUS (/)
const U = 0x0075;           // U+0075 LATIN SMALL LETTER U (u)

export default function defaultRecognizer(context) {
    switch (this.tokenType) {
        case Hash:
            return this.Hash();

        case Comma:
            return this.Operator();

        case LeftParenthesis:
            return this.Parentheses(this.readSequence, context.recognizer);

        case LeftSquareBracket:
            return this.Brackets(this.readSequence, context.recognizer);

        case StringToken:
            return this.String();

        case Dimension:
            return this.Dimension();

        case Percentage:
            return this.Percentage();

        case NumberToken:
            return this.Number();

        case FunctionToken:
            return this.cmpStr(this.tokenStart, this.tokenEnd, 'url(')
                ? this.Url()
                : this.Function(this.readSequence, context.recognizer);

        case Url:
            return this.Url();

        case Ident:
            // check for unicode range, it should start with u+ or U+
            if (this.cmpChar(this.tokenStart, U) &&
                this.cmpChar(this.tokenStart + 1, PLUSSIGN)) {
                return this.UnicodeRange();
            } else {
                return this.Identifier();
            }

        case Delim: {
            const code = this.charCodeAt(this.tokenStart);

            if (code === SOLIDUS ||
                code === ASTERISK ||
                code === PLUSSIGN ||
                code === HYPHENMINUS) {
                return this.Operator(); // TODO: replace with Delim
            }

            // TODO: produce a node with Delim node type

            if (code === NUMBERSIGN) {
                this.error('Hex or identifier is expected', this.tokenStart + 1);
            }

            break;
        }
    }
};
X
x \export { default as AtrulePrelude } from './atrulePrelude.js';
export { default as Selector } from './selector.js';
export { default as Value } from './value.js';
8x
import {
    Delim,
    Ident,
    Dimension,
    Percentage,
    Number as NumberToken,
    Hash,
    Colon,
    LeftSquareBracket
} from '../../tokenizer/index.js';

const NUMBERSIGN = 0x0023;      // U+0023 NUMBER SIGN (#)
const AMPERSAND = 0x0026;       // U+0026 AMPERSAND (&)
const ASTERISK = 0x002A;        // U+002A ASTERISK (*)
const PLUSSIGN = 0x002B;        // U+002B PLUS SIGN (+)
const SOLIDUS = 0x002F;         // U+002F SOLIDUS (/)
const FULLSTOP = 0x002E;        // U+002E FULL STOP (.)
const GREATERTHANSIGN = 0x003E; // U+003E GREATER-THAN SIGN (>)
const VERTICALLINE = 0x007C;    // U+007C VERTICAL LINE (|)
const TILDE = 0x007E;           // U+007E TILDE (~)

function onWhiteSpace(next, children) {
    if (children.last !== null && children.last.type !== 'Combinator' &&
        next !== null && next.type !== 'Combinator') {
        children.push({  // FIXME: this.Combinator() should be used instead
            type: 'Combinator',
            loc: null,
            name: ' '
        });
    }
}

function getNode() {
    switch (this.tokenType) {
        case LeftSquareBracket:
            return this.AttributeSelector();

        case Hash:
            return this.IdSelector();

        case Colon:
            if (this.lookupType(1) === Colon) {
                return this.PseudoElementSelector();
            } else {
                return this.PseudoClassSelector();
            }

        case Ident:
            return this.TypeSelector();

        case NumberToken:
        case Percentage:
            return this.Percentage();

        case Dimension:
            // throws when .123ident
            if (this.charCodeAt(this.tokenStart) === FULLSTOP) {
                this.error('Identifier is expected', this.tokenStart + 1);
            }
            break;

        case Delim: {
            const code = this.charCodeAt(this.tokenStart);

            switch (code) {
                case PLUSSIGN:
                case GREATERTHANSIGN:
                case TILDE:
                case SOLIDUS:  // /deep/
                    return this.Combinator();

                case FULLSTOP:
                    return this.ClassSelector();

                case ASTERISK:
                case VERTICALLINE:
                    return this.TypeSelector();

                case NUMBERSIGN:
                    return this.IdSelector();

                case AMPERSAND:
                    return this.NestingSelector();
            }

            break;
        }
    }
};

export default {
    onWhiteSpace,
    getNode
};
@)xdimport getNode from './default.js';
import expressionFn from '../function/expression.js';
import varFn from '../function/var.js';

function isPlusMinusOperator(node) {
    return (
        node !== null &&
        node.type === 'Operator' &&
        (node.value[node.value.length - 1] === '-' || node.value[node.value.length - 1] === '+')
    );
}

export default {
    getNode,
    onWhiteSpace(next, children) {
        if (isPlusMinusOperator(next)) {
            next.value = ' ' + next.value;
        }
        if (isPlusMinusOperator(children.last)) {
            children.last.value += ' ';
        }
    },
    'expression': expressionFn,
    'var': varFn
};
DbxH100644 OffsetToLocation.js XL	uJ	)\K100644 TokenStream.js {iŕ#^O#׸"100644 adopt-buffer.js Ef2YܢtU1}Hk100644 char-code-definitions.js qUr*;<Ib!X:zN100644 index.js DΪDQ"lX~]=&100644 names.js T^/L#,4V100644 types.js PVkUn(6
kd+100644 utils.js 1[³?1O.Ȼ~2x	eimport { adoptBuffer } from './adopt-buffer.js';
import { isBOM } from './char-code-definitions.js';

const N = 10;
const F = 12;
const R = 13;

function computeLinesAndColumns(host) {
    const source = host.source;
    const sourceLength = source.length;
    const startOffset = source.length > 0 ? isBOM(source.charCodeAt(0)) : 0;
    const lines = adoptBuffer(host.lines, sourceLength);
    const columns = adoptBuffer(host.columns, sourceLength);
    let line = host.startLine;
    let column = host.startColumn;

    for (let i = startOffset; i < sourceLength; i++) {
        const code = source.charCodeAt(i);

        lines[i] = line;
        columns[i] = column++;

        if (code === N || code === R || code === F) {
            if (code === R && i + 1 < sourceLength && source.charCodeAt(i + 1) === N) {
                i++;
                lines[i] = line;
                columns[i] = column;
            }

            line++;
            column = 1;
        }
    }

    lines[sourceLength] = line;
    columns[sourceLength] = column;

    host.lines = lines;
    host.columns = columns;
    host.computed = true;
}

export class OffsetToLocation {
    constructor(source, startOffset, startLine, startColumn) {
        this.setSource(source, startOffset, startLine, startColumn);
        this.lines = null;
        this.columns = null;
    }
    setSource(source = '', startOffset = 0, startLine = 1, startColumn = 1) {
        this.source = source;
        this.startOffset = startOffset;
        this.startLine = startLine;
        this.startColumn = startColumn;
        this.computed = false;
    }
    getLocation(offset, filename) {
        if (!this.computed) {
            computeLinesAndColumns(this);
        }

        return {
            source: filename,
            offset: this.startOffset + offset,
            line: this.lines[offset],
            column: this.columns[offset]
        };
    }
    getLocationRange(start, end, filename) {
        if (!this.computed) {
            computeLinesAndColumns(this);
        }

        return {
            source: filename,
            start: {
                offset: this.startOffset + start,
                line: this.lines[start],
                column: this.columns[start]
            },
            end: {
                offset: this.startOffset + end,
                line: this.lines[end],
                column: this.columns[end]
            }
        };
    }
};
eΪxX,import { adoptBuffer } from './adopt-buffer.js';
import { cmpStr } from './utils.js';
import tokenNames from './names.js';
import {
    WhiteSpace,
    Comment,
    Delim,
    EOF,
    Function as FunctionToken,
    LeftParenthesis,
    RightParenthesis,
    LeftSquareBracket,
    RightSquareBracket,
    LeftCurlyBracket,
    RightCurlyBracket
} from './types.js';

const OFFSET_MASK = 0x00FFFFFF;
const TYPE_SHIFT = 24;
const BLOCK_OPEN_TOKEN = 1;
const BLOCK_CLOSE_TOKEN = 2;
const balancePair = new Uint8Array(32); // 32b of memory ought to be enough for anyone (any number of tokens)
balancePair[FunctionToken] = RightParenthesis;
balancePair[LeftParenthesis] = RightParenthesis;
balancePair[LeftSquareBracket] = RightSquareBracket;
balancePair[LeftCurlyBracket] = RightCurlyBracket;

const blockTokens = new Uint8Array(32);
blockTokens[FunctionToken] = BLOCK_OPEN_TOKEN;
blockTokens[LeftParenthesis] = BLOCK_OPEN_TOKEN;
blockTokens[LeftSquareBracket] = BLOCK_OPEN_TOKEN;
blockTokens[LeftCurlyBracket] = BLOCK_OPEN_TOKEN;
blockTokens[RightParenthesis] = BLOCK_CLOSE_TOKEN;
blockTokens[RightSquareBracket] = BLOCK_CLOSE_TOKEN;
blockTokens[RightCurlyBracket] = BLOCK_CLOSE_TOKEN;

function boundIndex(index, min, max) {
    return index < min ? min : index > max ? max : index;
}

export class TokenStream {
    constructor(source, tokenize) {
        this.setSource(source, tokenize);
    }
    reset() {
        this.eof = false;
        this.tokenIndex = -1;
        this.tokenType = 0;
        this.tokenStart = this.firstCharOffset;
        this.tokenEnd = this.firstCharOffset;
    }
    setSource(source = '', tokenize = () => {}) {
        source = String(source || '');

        const sourceLength = source.length;
        const offsetAndType = adoptBuffer(this.offsetAndType, source.length + 1); // +1 because of eof-token
        const balance = adoptBuffer(this.balance, source.length + 1);
        let tokenCount = 0;
        let firstCharOffset = -1;
        let balanceCloseType = 0;
        let balanceStart = source.length;

        // capture buffers
        this.offsetAndType = null;
        this.balance = null;
        balance.fill(0);

        tokenize(source, (type, start, end) => {
            const index = tokenCount++;

            // type & offset
            offsetAndType[index] = (type << TYPE_SHIFT) | end;

            if (firstCharOffset === -1) {
                firstCharOffset = start;
            }

            // balance
            balance[index] = balanceStart;

            if (type === balanceCloseType) {
                const prevBalanceStart = balance[balanceStart];

                // set reference to balance end for a block opener
                balance[balanceStart] = index;

                // pop state
                balanceStart = prevBalanceStart;
                balanceCloseType = balancePair[offsetAndType[prevBalanceStart] >> TYPE_SHIFT];
            } else if (this.isBlockOpenerTokenType(type)) { // check for FunctionToken, <(-token>, <[-token> and <{-token>
                // push state
                balanceStart = index;
                balanceCloseType = balancePair[type];
            }
        });

        // finalize buffers
        offsetAndType[tokenCount] = (EOF << TYPE_SHIFT) | sourceLength; // <EOF-token>
        balance[tokenCount] = tokenCount; // prevents false positive balance match with any token

        // reverse references from balance start to end
        // tokens
        //   token:   a ( [ b c ] d e ) {
        //   index:   0 1 2 3 4 5 6 7 8 9
        // before
        //   balance: 0 8 5 2 2 2 1 1 1 0
        //            - > > < < < < < < -
        // after
        //   balance: 9 8 5 5 5 2 8 8 1 9
        //            > > > > > < > > < >
        for (let i = 0; i < tokenCount; i++) {
            const balanceStart = balance[i];

            if (balanceStart <= i) {
                const balanceEnd = balance[balanceStart];

                if (balanceEnd !== i) {
                    balance[i] = balanceEnd;
                }
            } else if (balanceStart > tokenCount) {
                balance[i] = tokenCount;
            }
        }

        // balance[0] = tokenCount;

        this.source = source;
        this.firstCharOffset = firstCharOffset === -1 ? 0 : firstCharOffset;
        this.tokenCount = tokenCount;
        this.offsetAndType = offsetAndType;
        this.balance = balance;

        this.reset();
        this.next();
    }

    lookupType(offset) {
        offset += this.tokenIndex;

        if (offset < this.tokenCount) {
            return this.offsetAndType[offset] >> TYPE_SHIFT;
        }

        return EOF;
    }
    lookupTypeNonSC(idx) {
        for (let offset = this.tokenIndex; offset < this.tokenCount; offset++) {
            const tokenType = this.offsetAndType[offset] >> TYPE_SHIFT;

            if (tokenType !== WhiteSpace && tokenType !== Comment) {
                if (idx-- === 0) {
                    return tokenType;
                }
            }
        }

        return EOF;
    }
    lookupOffset(offset) {
        offset += this.tokenIndex;

        if (offset < this.tokenCount) {
            return this.offsetAndType[offset - 1] & OFFSET_MASK;
        }

        return this.source.length;
    }
    lookupOffsetNonSC(idx) {
        for (let offset = this.tokenIndex; offset < this.tokenCount; offset++) {
            const tokenType = this.offsetAndType[offset] >> TYPE_SHIFT;

            if (tokenType !== WhiteSpace && tokenType !== Comment) {
                if (idx-- === 0) {
                    return offset - this.tokenIndex;
                }
            }
        }

        return EOF;
    }
    lookupValue(offset, referenceStr) {
        offset += this.tokenIndex;

        if (offset < this.tokenCount) {
            return cmpStr(
                this.source,
                this.offsetAndType[offset - 1] & OFFSET_MASK,
                this.offsetAndType[offset] & OFFSET_MASK,
                referenceStr
            );
        }

        return false;
    }
    getTokenStart(tokenIndex) {
        if (tokenIndex === this.tokenIndex) {
            return this.tokenStart;
        }

        if (tokenIndex > 0) {
            return tokenIndex < this.tokenCount
                ? this.offsetAndType[tokenIndex - 1] & OFFSET_MASK
                : this.offsetAndType[this.tokenCount] & OFFSET_MASK;
        }

        return this.firstCharOffset;
    }
    getTokenEnd(tokenIndex) {
        if (tokenIndex === this.tokenIndex) {
            return this.tokenEnd;
        }

        return this.offsetAndType[boundIndex(tokenIndex, 0, this.tokenCount)] & OFFSET_MASK;
    }
    getTokenType(tokenIndex) {
        if (tokenIndex === this.tokenIndex) {
            return this.tokenType;
        }

        return this.offsetAndType[boundIndex(tokenIndex, 0, this.tokenCount)] >> TYPE_SHIFT;
    }
    substrToCursor(start) {
        return this.source.substring(start, this.tokenStart);
    }

    isBlockOpenerTokenType(tokenType) {
        return blockTokens[tokenType] === BLOCK_OPEN_TOKEN;
    }
    isBlockCloserTokenType(tokenType) {
        return blockTokens[tokenType] === BLOCK_CLOSE_TOKEN;
    }
    getBlockTokenPairIndex(tokenIndex) {
        const type = this.getTokenType(tokenIndex);

        if (blockTokens[type] === 1) {
            // block open token
            const pairIndex = this.balance[tokenIndex];
            const closeType = this.getTokenType(pairIndex);

            return balancePair[type] === closeType ? pairIndex : -1;
        } else if (blockTokens[type] === 2) {
            // block close token
            const pairIndex = this.balance[tokenIndex];
            const openType = this.getTokenType(pairIndex);

            return balancePair[openType] === type ? pairIndex : -1;
        }

        return -1;
    }
    isBalanceEdge(tokenIndex) {
        return this.balance[this.tokenIndex] < tokenIndex;
    }

    isDelim(code, offset) {
        if (offset) {
            return (
                this.lookupType(offset) === Delim &&
                this.source.charCodeAt(this.lookupOffset(offset)) === code
            );
        }

        return (
            this.tokenType === Delim &&
            this.source.charCodeAt(this.tokenStart) === code
        );
    }

    skip(tokenCount) {
        let next = this.tokenIndex + tokenCount;

        if (next < this.tokenCount) {
            this.tokenIndex = next;
            this.tokenStart = this.offsetAndType[next - 1] & OFFSET_MASK;
            next = this.offsetAndType[next];
            this.tokenType = next >> TYPE_SHIFT;
            this.tokenEnd = next & OFFSET_MASK;
        } else {
            this.tokenIndex = this.tokenCount;
            this.next();
        }
    }
    next() {
        let next = this.tokenIndex + 1;

        if (next < this.tokenCount) {
            this.tokenIndex = next;
            this.tokenStart = this.tokenEnd;
            next = this.offsetAndType[next];
            this.tokenType = next >> TYPE_SHIFT;
            this.tokenEnd = next & OFFSET_MASK;
        } else {
            this.eof = true;
            this.tokenIndex = this.tokenCount;
            this.tokenType = EOF;
            this.tokenStart = this.tokenEnd = this.source.length;
        }
    }
    skipSC() {
        while (this.tokenType === WhiteSpace || this.tokenType === Comment) {
            this.next();
        }
    }
    skipUntilBalanced(startToken, stopConsume) {
        let cursor = startToken;
        let balanceEnd = 0;
        let offset = 0;

        loop:
        for (; cursor < this.tokenCount; cursor++) {
            balanceEnd = this.balance[cursor];

            // stop scanning on balance edge that points to offset before start token
            if (balanceEnd < startToken) {
                break loop;
            }

            offset = cursor > 0 ? this.offsetAndType[cursor - 1] & OFFSET_MASK : this.firstCharOffset;

            // check stop condition
            switch (stopConsume(this.source.charCodeAt(offset))) {
                case 1: // just stop
                    break loop;

                case 2: // stop & included
                    cursor++;
                    break loop;

                default:
                    // fast forward to the end of balanced block for an open block tokens
                    if (this.isBlockOpenerTokenType(this.offsetAndType[cursor] >> TYPE_SHIFT)) {
                        cursor = balanceEnd;
                    }
            }
        }

        this.skip(cursor - this.tokenIndex);
    }

    forEachToken(fn) {
        for (let i = 0, offset = this.firstCharOffset; i < this.tokenCount; i++) {
            const start = offset;
            const item = this.offsetAndType[i];
            const end = item & OFFSET_MASK;
            const type = item >> TYPE_SHIFT;

            offset = end;

            fn(type, start, end, i);
        }
    }
    dump() {
        const tokens = new Array(this.tokenCount);

        this.forEachToken((type, start, end, index) => {
            tokens[index] = {
                idx: index,
                type: tokenNames[type],
                chunk: this.source.substring(start, end),
                balance: this.balance[index]
            };
        });

        return tokens;
    }
};
n˱x const MIN_SIZE = 16 * 1024;

export function adoptBuffer(buffer = null, size) {
    if (buffer === null || buffer.length < size) {
        return new Uint32Array(Math.max(size + 1024, MIN_SIZE));
    }

    return buffer;
};
rDYx~const EOF = 0;

// https://drafts.csswg.org/css-syntax-3/
// § 4.2. Definitions

// digit
// A code point between U+0030 DIGIT ZERO (0) and U+0039 DIGIT NINE (9).
export function isDigit(code) {
    return code >= 0x0030 && code <= 0x0039;
}

// hex digit
// A digit, or a code point between U+0041 LATIN CAPITAL LETTER A (A) and U+0046 LATIN CAPITAL LETTER F (F),
// or a code point between U+0061 LATIN SMALL LETTER A (a) and U+0066 LATIN SMALL LETTER F (f).
export function isHexDigit(code) {
    return (
        isDigit(code) || // 0 .. 9
        (code >= 0x0041 && code <= 0x0046) || // A .. F
        (code >= 0x0061 && code <= 0x0066)    // a .. f
    );
}

// uppercase letter
// A code point between U+0041 LATIN CAPITAL LETTER A (A) and U+005A LATIN CAPITAL LETTER Z (Z).
export function isUppercaseLetter(code) {
    return code >= 0x0041 && code <= 0x005A;
}

// lowercase letter
// A code point between U+0061 LATIN SMALL LETTER A (a) and U+007A LATIN SMALL LETTER Z (z).
export function isLowercaseLetter(code) {
    return code >= 0x0061 && code <= 0x007A;
}

// letter
// An uppercase letter or a lowercase letter.
export function isLetter(code) {
    return isUppercaseLetter(code) || isLowercaseLetter(code);
}

// non-ASCII code point
// A code point with a value equal to or greater than U+0080 <control>.
//
// 2024-09-02: The latest spec narrows the range for non-ASCII characters (see https://github.com/csstree/csstree/issues/188).
// However, all modern browsers support a wider range, and strictly following the latest spec could result
// in some CSS being parsed incorrectly, even though it works in the browser. Therefore, this function adheres
// to the previous, broader definition of non-ASCII characters.
export function isNonAscii(code) {
    return code >= 0x0080;
}

// name-start code point
// A letter, a non-ASCII code point, or U+005F LOW LINE (_).
export function isNameStart(code) {
    return isLetter(code) || isNonAscii(code) || code === 0x005F;
}

// name code point
// A name-start code point, a digit, or U+002D HYPHEN-MINUS (-).
export function isName(code) {
    return isNameStart(code) || isDigit(code) || code === 0x002D;
}

// non-printable code point
// A code point between U+0000 NULL and U+0008 BACKSPACE, or U+000B LINE TABULATION,
// or a code point between U+000E SHIFT OUT and U+001F INFORMATION SEPARATOR ONE, or U+007F DELETE.
export function isNonPrintable(code) {
    return (
        (code >= 0x0000 && code <= 0x0008) ||
        (code === 0x000B) ||
        (code >= 0x000E && code <= 0x001F) ||
        (code === 0x007F)
    );
}

// newline
// U+000A LINE FEED. Note that U+000D CARRIAGE RETURN and U+000C FORM FEED are not included in this definition,
// as they are converted to U+000A LINE FEED during preprocessing.
// TODO: we doesn't do a preprocessing, so check a code point for U+000D CARRIAGE RETURN and U+000C FORM FEED
export function isNewline(code) {
    return code === 0x000A || code === 0x000D || code === 0x000C;
}

// whitespace
// A newline, U+0009 CHARACTER TABULATION, or U+0020 SPACE.
export function isWhiteSpace(code) {
    return isNewline(code) || code === 0x0020 || code === 0x0009;
}

// § 4.3.8. Check if two code points are a valid escape
export function isValidEscape(first, second) {
    // If the first code point is not U+005C REVERSE SOLIDUS (\), return false.
    if (first !== 0x005C) {
        return false;
    }

    // Otherwise, if the second code point is a newline or EOF, return false.
    if (isNewline(second) || second === EOF) {
        return false;
    }

    // Otherwise, return true.
    return true;
}

// § 4.3.9. Check if three code points would start an identifier
export function isIdentifierStart(first, second, third) {
    // Look at the first code point:

    // U+002D HYPHEN-MINUS
    if (first === 0x002D) {
        // If the second code point is a name-start code point or a U+002D HYPHEN-MINUS,
        // or the second and third code points are a valid escape, return true. Otherwise, return false.
        return (
            isNameStart(second) ||
            second === 0x002D ||
            isValidEscape(second, third)
        );
    }

    // name-start code point
    if (isNameStart(first)) {
        // Return true.
        return true;
    }

    // U+005C REVERSE SOLIDUS (\)
    if (first === 0x005C) {
        // If the first and second code points are a valid escape, return true. Otherwise, return false.
        return isValidEscape(first, second);
    }

    // anything else
    // Return false.
    return false;
}

// § 4.3.10. Check if three code points would start a number
export function isNumberStart(first, second, third) {
    // Look at the first code point:

    // U+002B PLUS SIGN (+)
    // U+002D HYPHEN-MINUS (-)
    if (first === 0x002B || first === 0x002D) {
        // If the second code point is a digit, return true.
        if (isDigit(second)) {
            return 2;
        }

        // Otherwise, if the second code point is a U+002E FULL STOP (.)
        // and the third code point is a digit, return true.
        // Otherwise, return false.
        return second === 0x002E && isDigit(third) ? 3 : 0;
    }

    // U+002E FULL STOP (.)
    if (first === 0x002E) {
        // If the second code point is a digit, return true. Otherwise, return false.
        return isDigit(second) ? 2 : 0;
    }

    // digit
    if (isDigit(first)) {
        // Return true.
        return 1;
    }

    // anything else
    // Return false.
    return 0;
}

//
// Misc
//

// detect BOM (https://en.wikipedia.org/wiki/Byte_order_mark)
export function isBOM(code) {
    // UTF-16BE
    if (code === 0xFEFF) {
        return 1;
    }

    // UTF-16LE
    if (code === 0xFFFE) {
        return 1;
    }

    return 0;
}

// Fast code category
// Only ASCII code points has a special meaning, that's why we define a maps for 0..127 codes only
const CATEGORY = new Array(0x80);
export const EofCategory = 0x80;
export const WhiteSpaceCategory = 0x82;
export const DigitCategory = 0x83;
export const NameStartCategory = 0x84;
export const NonPrintableCategory = 0x85;

for (let i = 0; i < CATEGORY.length; i++) {
    CATEGORY[i] =
        isWhiteSpace(i) && WhiteSpaceCategory ||
        isDigit(i) && DigitCategory ||
        isNameStart(i) && NameStartCategory ||
        isNonPrintable(i) && NonPrintableCategory ||
        i || EofCategory;
}

export function charCodeCategory(code) {
    return code < 0x80 ? CATEGORY[code] : NameStartCategory;
}
vt
xPAimport * as TYPE from './types.js';
import {
    isNewline,
    isName,
    isValidEscape,
    isNumberStart,
    isIdentifierStart,
    isBOM,
    charCodeCategory,
    WhiteSpaceCategory,
    DigitCategory,
    NameStartCategory,
    NonPrintableCategory
} from './char-code-definitions.js';
import {
    cmpStr,
    getNewlineLength,
    findWhiteSpaceEnd,
    consumeEscaped,
    consumeName,
    consumeNumber,
    consumeBadUrlRemnants
} from './utils.js';

export function tokenize(source, onToken) {
    function getCharCode(offset) {
        return offset < sourceLength ? source.charCodeAt(offset) : 0;
    }

    // § 4.3.3. Consume a numeric token
    function consumeNumericToken() {
        // Consume a number and let number be the result.
        offset = consumeNumber(source, offset);

        // If the next 3 input code points would start an identifier, then:
        if (isIdentifierStart(getCharCode(offset), getCharCode(offset + 1), getCharCode(offset + 2))) {
            // Create a <dimension-token> with the same value and type flag as number, and a unit set initially to the empty string.
            // Consume a name. Set the <dimension-token>’s unit to the returned value.
            // Return the <dimension-token>.
            type = TYPE.Dimension;
            offset = consumeName(source, offset);
            return;
        }

        // Otherwise, if the next input code point is U+0025 PERCENTAGE SIGN (%), consume it.
        if (getCharCode(offset) === 0x0025) {
            // Create a <percentage-token> with the same value as number, and return it.
            type = TYPE.Percentage;
            offset++;
            return;
        }

        // Otherwise, create a <number-token> with the same value and type flag as number, and return it.
        type = TYPE.Number;
    }

    // § 4.3.4. Consume an ident-like token
    function consumeIdentLikeToken() {
        const nameStartOffset = offset;

        // Consume a name, and let string be the result.
        offset = consumeName(source, offset);

        // If string’s value is an ASCII case-insensitive match for "url",
        // and the next input code point is U+0028 LEFT PARENTHESIS ((), consume it.
        if (cmpStr(source, nameStartOffset, offset, 'url') && getCharCode(offset) === 0x0028) {
            // While the next two input code points are whitespace, consume the next input code point.
            offset = findWhiteSpaceEnd(source, offset + 1);

            // If the next one or two input code points are U+0022 QUOTATION MARK ("), U+0027 APOSTROPHE ('),
            // or whitespace followed by U+0022 QUOTATION MARK (") or U+0027 APOSTROPHE ('),
            // then create a <function-token> with its value set to string and return it.
            if (getCharCode(offset) === 0x0022 ||
                getCharCode(offset) === 0x0027) {
                type = TYPE.Function;
                offset = nameStartOffset + 4;
                return;
            }

            // Otherwise, consume a url token, and return it.
            consumeUrlToken();
            return;
        }

        // Otherwise, if the next input code point is U+0028 LEFT PARENTHESIS ((), consume it.
        // Create a <function-token> with its value set to string and return it.
        if (getCharCode(offset) === 0x0028) {
            type = TYPE.Function;
            offset++;
            return;
        }

        // Otherwise, create an <ident-token> with its value set to string and return it.
        type = TYPE.Ident;
    }

    // § 4.3.5. Consume a string token
    function consumeStringToken(endingCodePoint) {
        // This algorithm may be called with an ending code point, which denotes the code point
        // that ends the string. If an ending code point is not specified,
        // the current input code point is used.
        if (!endingCodePoint) {
            endingCodePoint = getCharCode(offset++);
        }

        // Initially create a <string-token> with its value set to the empty string.
        type = TYPE.String;

        // Repeatedly consume the next input code point from the stream:
        for (; offset < source.length; offset++) {
            const code = source.charCodeAt(offset);

            switch (charCodeCategory(code)) {
                // ending code point
                case endingCodePoint:
                    // Return the <string-token>.
                    offset++;
                    return;

                    // EOF
                    // case EofCategory:
                    // This is a parse error. Return the <string-token>.
                    // return;

                // newline
                case WhiteSpaceCategory:
                    if (isNewline(code)) {
                        // This is a parse error. Reconsume the current input code point,
                        // create a <bad-string-token>, and return it.
                        offset += getNewlineLength(source, offset, code);
                        type = TYPE.BadString;
                        return;
                    }
                    break;

                // U+005C REVERSE SOLIDUS (\)
                case 0x005C:
                    // If the next input code point is EOF, do nothing.
                    if (offset === source.length - 1) {
                        break;
                    }

                    const nextCode = getCharCode(offset + 1);

                    // Otherwise, if the next input code point is a newline, consume it.
                    if (isNewline(nextCode)) {
                        offset += getNewlineLength(source, offset + 1, nextCode);
                    } else if (isValidEscape(code, nextCode)) {
                        // Otherwise, (the stream starts with a valid escape) consume
                        // an escaped code point and append the returned code point to
                        // the <string-token>’s value.
                        offset = consumeEscaped(source, offset) - 1;
                    }
                    break;

                // anything else
                // Append the current input code point to the <string-token>’s value.
            }
        }
    }

    // § 4.3.6. Consume a url token
    // Note: This algorithm assumes that the initial "url(" has already been consumed.
    // This algorithm also assumes that it’s being called to consume an "unquoted" value, like url(foo).
    // A quoted value, like url("foo"), is parsed as a <function-token>. Consume an ident-like token
    // automatically handles this distinction; this algorithm shouldn’t be called directly otherwise.
    function consumeUrlToken() {
        // Initially create a <url-token> with its value set to the empty string.
        type = TYPE.Url;

        // Consume as much whitespace as possible.
        offset = findWhiteSpaceEnd(source, offset);

        // Repeatedly consume the next input code point from the stream:
        for (; offset < source.length; offset++) {
            const code = source.charCodeAt(offset);

            switch (charCodeCategory(code)) {
                // U+0029 RIGHT PARENTHESIS ())
                case 0x0029:
                    // Return the <url-token>.
                    offset++;
                    return;

                    // EOF
                    // case EofCategory:
                    // This is a parse error. Return the <url-token>.
                    // return;

                // whitespace
                case WhiteSpaceCategory:
                    // Consume as much whitespace as possible.
                    offset = findWhiteSpaceEnd(source, offset);

                    // If the next input code point is U+0029 RIGHT PARENTHESIS ()) or EOF,
                    // consume it and return the <url-token>
                    // (if EOF was encountered, this is a parse error);
                    if (getCharCode(offset) === 0x0029 || offset >= source.length) {
                        if (offset < source.length) {
                            offset++;
                        }
                        return;
                    }

                    // otherwise, consume the remnants of a bad url, create a <bad-url-token>,
                    // and return it.
                    offset = consumeBadUrlRemnants(source, offset);
                    type = TYPE.BadUrl;
                    return;

                // U+0022 QUOTATION MARK (")
                // U+0027 APOSTROPHE (')
                // U+0028 LEFT PARENTHESIS (()
                // non-printable code point
                case 0x0022:
                case 0x0027:
                case 0x0028:
                case NonPrintableCategory:
                    // This is a parse error. Consume the remnants of a bad url,
                    // create a <bad-url-token>, and return it.
                    offset = consumeBadUrlRemnants(source, offset);
                    type = TYPE.BadUrl;
                    return;

                // U+005C REVERSE SOLIDUS (\)
                case 0x005C:
                    // If the stream starts with a valid escape, consume an escaped code point and
                    // append the returned code point to the <url-token>’s value.
                    if (isValidEscape(code, getCharCode(offset + 1))) {
                        offset = consumeEscaped(source, offset) - 1;
                        break;
                    }

                    // Otherwise, this is a parse error. Consume the remnants of a bad url,
                    // create a <bad-url-token>, and return it.
                    offset = consumeBadUrlRemnants(source, offset);
                    type = TYPE.BadUrl;
                    return;

                // anything else
                // Append the current input code point to the <url-token>’s value.
            }
        }
    }

    // ensure source is a string
    source = String(source || '');

    const sourceLength = source.length;
    let start = isBOM(getCharCode(0));
    let offset = start;
    let type;

    // https://drafts.csswg.org/css-syntax-3/#consume-token
    // § 4.3.1. Consume a token
    while (offset < sourceLength) {
        const code = source.charCodeAt(offset);

        switch (charCodeCategory(code)) {
            // whitespace
            case WhiteSpaceCategory:
                // Consume as much whitespace as possible. Return a <whitespace-token>.
                type = TYPE.WhiteSpace;
                offset = findWhiteSpaceEnd(source, offset + 1);
                break;

            // U+0022 QUOTATION MARK (")
            case 0x0022:
                // Consume a string token and return it.
                consumeStringToken();
                break;

            // U+0023 NUMBER SIGN (#)
            case 0x0023:
                // If the next input code point is a name code point or the next two input code points are a valid escape, then:
                if (isName(getCharCode(offset + 1)) || isValidEscape(getCharCode(offset + 1), getCharCode(offset + 2))) {
                    // Create a <hash-token>.
                    type = TYPE.Hash;

                    // If the next 3 input code points would start an identifier, set the <hash-token>’s type flag to "id".
                    // if (isIdentifierStart(getCharCode(offset + 1), getCharCode(offset + 2), getCharCode(offset + 3))) {
                    //     // TODO: set id flag
                    // }

                    // Consume a name, and set the <hash-token>’s value to the returned string.
                    offset = consumeName(source, offset + 1);

                    // Return the <hash-token>.
                } else {
                    // Otherwise, return a <delim-token> with its value set to the current input code point.
                    type = TYPE.Delim;
                    offset++;
                }

                break;

            // U+0027 APOSTROPHE (')
            case 0x0027:
                // Consume a string token and return it.
                consumeStringToken();
                break;

            // U+0028 LEFT PARENTHESIS (()
            case 0x0028:
                // Return a <(-token>.
                type = TYPE.LeftParenthesis;
                offset++;
                break;

            // U+0029 RIGHT PARENTHESIS ())
            case 0x0029:
                // Return a <)-token>.
                type = TYPE.RightParenthesis;
                offset++;
                break;

            // U+002B PLUS SIGN (+)
            case 0x002B:
                // If the input stream starts with a number, ...
                if (isNumberStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
                    // ... reconsume the current input code point, consume a numeric token, and return it.
                    consumeNumericToken();
                } else {
                    // Otherwise, return a <delim-token> with its value set to the current input code point.
                    type = TYPE.Delim;
                    offset++;
                }
                break;

            // U+002C COMMA (,)
            case 0x002C:
                // Return a <comma-token>.
                type = TYPE.Comma;
                offset++;
                break;

            // U+002D HYPHEN-MINUS (-)
            case 0x002D:
                // If the input stream starts with a number, reconsume the current input code point, consume a numeric token, and return it.
                if (isNumberStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
                    consumeNumericToken();
                } else {
                    // Otherwise, if the next 2 input code points are U+002D HYPHEN-MINUS U+003E GREATER-THAN SIGN (->), consume them and return a <CDC-token>.
                    if (getCharCode(offset + 1) === 0x002D &&
                        getCharCode(offset + 2) === 0x003E) {
                        type = TYPE.CDC;
                        offset = offset + 3;
                    } else {
                        // Otherwise, if the input stream starts with an identifier, ...
                        if (isIdentifierStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
                            // ... reconsume the current input code point, consume an ident-like token, and return it.
                            consumeIdentLikeToken();
                        } else {
                            // Otherwise, return a <delim-token> with its value set to the current input code point.
                            type = TYPE.Delim;
                            offset++;
                        }
                    }
                }
                break;

            // U+002E FULL STOP (.)
            case 0x002E:
                // If the input stream starts with a number, ...
                if (isNumberStart(code, getCharCode(offset + 1), getCharCode(offset + 2))) {
                    // ... reconsume the current input code point, consume a numeric token, and return it.
                    consumeNumericToken();
                } else {
                    // Otherwise, return a <delim-token> with its value set to the current input code point.
                    type = TYPE.Delim;
                    offset++;
                }

                break;

            // U+002F SOLIDUS (/)
            case 0x002F:
                // If the next two input code point are U+002F SOLIDUS (/) followed by a U+002A ASTERISK (*),
                if (getCharCode(offset + 1) === 0x002A) {
                    // ... consume them and all following code points up to and including the first U+002A ASTERISK (*)
                    // followed by a U+002F SOLIDUS (/), or up to an EOF code point.
                    type = TYPE.Comment;
                    offset = source.indexOf('*/', offset + 2);
                    offset = offset === -1 ? source.length : offset + 2;
                } else {
                    type = TYPE.Delim;
                    offset++;
                }
                break;

            // U+003A COLON (:)
            case 0x003A:
                // Return a <colon-token>.
                type = TYPE.Colon;
                offset++;
                break;

            // U+003B SEMICOLON (;)
            case 0x003B:
                // Return a <semicolon-token>.
                type = TYPE.Semicolon;
                offset++;
                break;

            // U+003C LESS-THAN SIGN (<)
            case 0x003C:
                // If the next 3 input code points are U+0021 EXCLAMATION MARK U+002D HYPHEN-MINUS U+002D HYPHEN-MINUS (!--), ...
                if (getCharCode(offset + 1) === 0x0021 &&
                    getCharCode(offset + 2) === 0x002D &&
                    getCharCode(offset + 3) === 0x002D) {
                    // ... consume them and return a <CDO-token>.
                    type = TYPE.CDO;
                    offset = offset + 4;
                } else {
                    // Otherwise, return a <delim-token> with its value set to the current input code point.
                    type = TYPE.Delim;
                    offset++;
                }

                break;

            // U+0040 COMMERCIAL AT (@)
            case 0x0040:
                // If the next 3 input code points would start an identifier, ...
                if (isIdentifierStart(getCharCode(offset + 1), getCharCode(offset + 2), getCharCode(offset + 3))) {
                    // ... consume a name, create an <at-keyword-token> with its value set to the returned value, and return it.
                    type = TYPE.AtKeyword;
                    offset = consumeName(source, offset + 1);
                } else {
                    // Otherwise, return a <delim-token> with its value set to the current input code point.
                    type = TYPE.Delim;
                    offset++;
                }

                break;

            // U+005B LEFT SQUARE BRACKET ([)
            case 0x005B:
                // Return a <[-token>.
                type = TYPE.LeftSquareBracket;
                offset++;
                break;

            // U+005C REVERSE SOLIDUS (\)
            case 0x005C:
                // If the input stream starts with a valid escape, ...
                if (isValidEscape(code, getCharCode(offset + 1))) {
                    // ... reconsume the current input code point, consume an ident-like token, and return it.
                    consumeIdentLikeToken();
                } else {
                    // Otherwise, this is a parse error. Return a <delim-token> with its value set to the current input code point.
                    type = TYPE.Delim;
                    offset++;
                }
                break;

            // U+005D RIGHT SQUARE BRACKET (])
            case 0x005D:
                // Return a <]-token>.
                type = TYPE.RightSquareBracket;
                offset++;
                break;

            // U+007B LEFT CURLY BRACKET ({)
            case 0x007B:
                // Return a <{-token>.
                type = TYPE.LeftCurlyBracket;
                offset++;
                break;

            // U+007D RIGHT CURLY BRACKET (})
            case 0x007D:
                // Return a <}-token>.
                type = TYPE.RightCurlyBracket;
                offset++;
                break;

            // digit
            case DigitCategory:
                // Reconsume the current input code point, consume a numeric token, and return it.
                consumeNumericToken();
                break;

            // name-start code point
            case NameStartCategory:
                // Reconsume the current input code point, consume an ident-like token, and return it.
                consumeIdentLikeToken();
                break;

                // EOF
                // case EofCategory:
                // Return an <EOF-token>.
                // break;

            // anything else
            default:
                // Return a <delim-token> with its value set to the current input code point.
                type = TYPE.Delim;
                offset++;
        }

        // put token to stream
        onToken(type, start, start = offset);
    }
}

export * from './types.js';
export * as tokenTypes from './types.js';
export { default as tokenNames } from './names.js';
export * from './char-code-definitions.js';
export * from './utils.js';
export * from './OffsetToLocation.js';
export * from './TokenStream.js';
~ xexport default [
    'EOF-token',
    'ident-token',
    'function-token',
    'at-keyword-token',
    'hash-token',
    'string-token',
    'bad-string-token',
    'url-token',
    'bad-url-token',
    'delim-token',
    'number-token',
    'percentage-token',
    'dimension-token',
    'whitespace-token',
    'CDO-token',
    'CDC-token',
    'colon-token',
    'semicolon-token',
    'comma-token',
    '[-token',
    ']-token',
    '(-token',
    ')-token',
    '{-token',
    '}-token',
    'comment-token'
];
*2\x1// CSS Syntax Module Level 3
// https://www.w3.org/TR/css-syntax-3/
export const EOF = 0;                 // <EOF-token>
export const Ident = 1;               // <ident-token>
export const Function = 2;            // <function-token>
export const AtKeyword = 3;           // <at-keyword-token>
export const Hash = 4;                // <hash-token>
export const String = 5;              // <string-token>
export const BadString = 6;           // <bad-string-token>
export const Url = 7;                 // <url-token>
export const BadUrl = 8;              // <bad-url-token>
export const Delim = 9;               // <delim-token>
export const Number = 10;             // <number-token>
export const Percentage = 11;         // <percentage-token>
export const Dimension = 12;          // <dimension-token>
export const WhiteSpace = 13;         // <whitespace-token>
export const CDO = 14;                // <CDO-token>
export const CDC = 15;                // <CDC-token>
export const Colon = 16;              // <colon-token>     :
export const Semicolon = 17;          // <semicolon-token> ;
export const Comma = 18;              // <comma-token>     ,
export const LeftSquareBracket = 19;  // <[-token>
export const RightSquareBracket = 20; // <]-token>
export const LeftParenthesis = 21;    // <(-token>
export const RightParenthesis = 22;   // <)-token>
export const LeftCurlyBracket = 23;   // <{-token>
export const RightCurlyBracket = 24;  // <}-token>
export const Comment = 25;
Jxsimport {
    isDigit,
    isHexDigit,
    isUppercaseLetter,
    isName,
    isWhiteSpace,
    isValidEscape
} from './char-code-definitions.js';

function getCharCode(source, offset) {
    return offset < source.length ? source.charCodeAt(offset) : 0;
}

export function getNewlineLength(source, offset, code) {
    if (code === 13 /* \r */ && getCharCode(source, offset + 1) === 10 /* \n */) {
        return 2;
    }

    return 1;
}

export function cmpChar(testStr, offset, referenceCode) {
    let code = testStr.charCodeAt(offset);

    // code.toLowerCase() for A..Z
    if (isUppercaseLetter(code)) {
        code = code | 32;
    }

    return code === referenceCode;
}

export function cmpStr(testStr, start, end, referenceStr) {
    if (end - start !== referenceStr.length) {
        return false;
    }

    if (start < 0 || end > testStr.length) {
        return false;
    }

    for (let i = start; i < end; i++) {
        const referenceCode = referenceStr.charCodeAt(i - start);
        let testCode = testStr.charCodeAt(i);

        // testCode.toLowerCase() for A..Z
        if (isUppercaseLetter(testCode)) {
            testCode = testCode | 32;
        }

        if (testCode !== referenceCode) {
            return false;
        }
    }

    return true;
}

export function findWhiteSpaceStart(source, offset) {
    for (; offset >= 0; offset--) {
        if (!isWhiteSpace(source.charCodeAt(offset))) {
            break;
        }
    }

    return offset + 1;
}

export function findWhiteSpaceEnd(source, offset) {
    for (; offset < source.length; offset++) {
        if (!isWhiteSpace(source.charCodeAt(offset))) {
            break;
        }
    }

    return offset;
}

export function findDecimalNumberEnd(source, offset) {
    for (; offset < source.length; offset++) {
        if (!isDigit(source.charCodeAt(offset))) {
            break;
        }
    }

    return offset;
}

// § 4.3.7. Consume an escaped code point
export function consumeEscaped(source, offset) {
    // It assumes that the U+005C REVERSE SOLIDUS (\) has already been consumed and
    // that the next input code point has already been verified to be part of a valid escape.
    offset += 2;

    // hex digit
    if (isHexDigit(getCharCode(source, offset - 1))) {
        // Consume as many hex digits as possible, but no more than 5.
        // Note that this means 1-6 hex digits have been consumed in total.
        for (const maxOffset = Math.min(source.length, offset + 5); offset < maxOffset; offset++) {
            if (!isHexDigit(getCharCode(source, offset))) {
                break;
            }
        }

        // If the next input code point is whitespace, consume it as well.
        const code = getCharCode(source, offset);
        if (isWhiteSpace(code)) {
            offset += getNewlineLength(source, offset, code);
        }
    }

    return offset;
}

// §4.3.11. Consume a name
// Note: This algorithm does not do the verification of the first few code points that are necessary
// to ensure the returned code points would constitute an <ident-token>. If that is the intended use,
// ensure that the stream starts with an identifier before calling this algorithm.
export function consumeName(source, offset) {
    // Let result initially be an empty string.
    // Repeatedly consume the next input code point from the stream:
    for (; offset < source.length; offset++) {
        const code = source.charCodeAt(offset);

        // name code point
        if (isName(code)) {
            // Append the code point to result.
            continue;
        }

        // the stream starts with a valid escape
        if (isValidEscape(code, getCharCode(source, offset + 1))) {
            // Consume an escaped code point. Append the returned code point to result.
            offset = consumeEscaped(source, offset) - 1;
            continue;
        }

        // anything else
        // Reconsume the current input code point. Return result.
        break;
    }

    return offset;
}

// §4.3.12. Consume a number
export function consumeNumber(source, offset) {
    let code = source.charCodeAt(offset);

    // 2. If the next input code point is U+002B PLUS SIGN (+) or U+002D HYPHEN-MINUS (-),
    // consume it and append it to repr.
    if (code === 0x002B || code === 0x002D) {
        code = source.charCodeAt(offset += 1);
    }

    // 3. While the next input code point is a digit, consume it and append it to repr.
    if (isDigit(code)) {
        offset = findDecimalNumberEnd(source, offset + 1);
        code = source.charCodeAt(offset);
    }

    // 4. If the next 2 input code points are U+002E FULL STOP (.) followed by a digit, then:
    if (code === 0x002E && isDigit(source.charCodeAt(offset + 1))) {
        // 4.1 Consume them.
        // 4.2 Append them to repr.
        offset += 2;

        // 4.3 Set type to "number".
        // TODO

        // 4.4 While the next input code point is a digit, consume it and append it to repr.

        offset = findDecimalNumberEnd(source, offset);
    }

    // 5. If the next 2 or 3 input code points are U+0045 LATIN CAPITAL LETTER E (E)
    // or U+0065 LATIN SMALL LETTER E (e), ... , followed by a digit, then:
    if (cmpChar(source, offset, 101 /* e */)) {
        let sign = 0;
        code = source.charCodeAt(offset + 1);

        // ... optionally followed by U+002D HYPHEN-MINUS (-) or U+002B PLUS SIGN (+) ...
        if (code === 0x002D || code === 0x002B) {
            sign = 1;
            code = source.charCodeAt(offset + 2);
        }

        // ... followed by a digit
        if (isDigit(code)) {
            // 5.1 Consume them.
            // 5.2 Append them to repr.

            // 5.3 Set type to "number".
            // TODO

            // 5.4 While the next input code point is a digit, consume it and append it to repr.
            offset = findDecimalNumberEnd(source, offset + 1 + sign + 1);
        }
    }

    return offset;
}

// § 4.3.14. Consume the remnants of a bad url
// ... its sole use is to consume enough of the input stream to reach a recovery point
// where normal tokenizing can resume.
export function consumeBadUrlRemnants(source, offset) {
    // Repeatedly consume the next input code point from the stream:
    for (; offset < source.length; offset++) {
        const code = source.charCodeAt(offset);

        // U+0029 RIGHT PARENTHESIS ())
        // EOF
        if (code === 0x0029) {
            // Return.
            offset++;
            break;
        }

        if (isValidEscape(code, getCharCode(source, offset + 1))) {
            // Consume an escaped code point.
            // Note: This allows an escaped right parenthesis ("\)") to be encountered
            // without ending the <bad-url-token>. This is otherwise identical to
            // the "anything else" clause.
            offset = consumeEscaped(source, offset);
        }
    }

    return offset;
}

// § 4.3.7. Consume an escaped code point
// Note: This algorithm assumes that escaped is valid without leading U+005C REVERSE SOLIDUS (\)
export function decodeEscaped(escaped) {
    // Single char escaped that's not a hex digit
    if (escaped.length === 1 && !isHexDigit(escaped.charCodeAt(0))) {
        return escaped[0];
    }

    // Interpret the hex digits as a hexadecimal number.
    let code = parseInt(escaped, 16);

    if (
        (code === 0) ||                       // If this number is zero,
        (code >= 0xD800 && code <= 0xDFFF) || // or is for a surrogate,
        (code > 0x10FFFF)                     // or is greater than the maximum allowed code point
    ) {
        // ... return U+FFFD REPLACEMENT CHARACTER
        code = 0xFFFD;
    }

    // Otherwise, return the code point with that value.
    return String.fromCodePoint(code);
}
`ƨxX100644 List.js S&IZ4"Ϙ#F100644 clone.js Lyv,A&[100644 create-custom-error.js ۡ"7/5Ȓ,100644 get-tokenizer.js ;KĳS;a?ET_D100644 ident.js ,7߾100644 index.js .`ۋ q100644 names.js KPbF100644 string.js >뮒y_Wǡ100644 url.js pU^PвR)	_֬3x1//
//                              list
//                            ┌──────┐
//             ┌──────────────┼─head │
//             │              │ tail─┼──────────────┐
//             │              └──────┘              │
//             ▼                                    ▼
//            item        item        item        item
//          ┌──────┐    ┌──────┐    ┌──────┐    ┌──────┐
//  null ◀──┼─prev │◀───┼─prev │◀───┼─prev │◀───┼─prev │
//          │ next─┼───▶│ next─┼───▶│ next─┼───▶│ next─┼──▶ null
//          ├──────┤    ├──────┤    ├──────┤    ├──────┤
//          │ data │    │ data │    │ data │    │ data │
//          └──────┘    └──────┘    └──────┘    └──────┘
//

let releasedCursors = null;

export class List {
    static createItem(data) {
        return {
            prev: null,
            next: null,
            data
        };
    }

    constructor() {
        this.head = null;
        this.tail = null;
        this.cursor = null;
    }
    createItem(data) {
        return List.createItem(data);
    }

    // cursor helpers
    allocateCursor(prev, next) {
        let cursor;

        if (releasedCursors !== null) {
            cursor = releasedCursors;
            releasedCursors = releasedCursors.cursor;
            cursor.prev = prev;
            cursor.next = next;
            cursor.cursor = this.cursor;
        } else {
            cursor = {
                prev,
                next,
                cursor: this.cursor
            };
        }

        this.cursor = cursor;

        return cursor;
    }
    releaseCursor() {
        const { cursor } = this;

        this.cursor = cursor.cursor;
        cursor.prev = null;
        cursor.next = null;
        cursor.cursor = releasedCursors;
        releasedCursors = cursor;
    }
    updateCursors(prevOld, prevNew, nextOld, nextNew) {
        let { cursor } = this;

        while (cursor !== null) {
            if (cursor.prev === prevOld) {
                cursor.prev = prevNew;
            }

            if (cursor.next === nextOld) {
                cursor.next = nextNew;
            }

            cursor = cursor.cursor;
        }
    }
    *[Symbol.iterator]() {
        for (let cursor = this.head; cursor !== null; cursor = cursor.next) {
            yield cursor.data;
        }
    }

    // getters
    get size() {
        let size = 0;

        for (let cursor = this.head; cursor !== null; cursor = cursor.next) {
            size++;
        }

        return size;
    }
    get isEmpty() {
        return this.head === null;
    }
    get first() {
        return this.head && this.head.data;
    }
    get last() {
        return this.tail && this.tail.data;
    }

    // convertors
    fromArray(array) {
        let cursor = null;
        this.head = null;

        for (let data of array) {
            const item = List.createItem(data);

            if (cursor !== null) {
                cursor.next = item;
            } else {
                this.head = item;
            }

            item.prev = cursor;
            cursor = item;
        }

        this.tail = cursor;
        return this;
    }
    toArray() {
        return [...this];
    }
    toJSON() {
        return [...this];
    }

    // array-like methods
    forEach(fn, thisArg = this) {
        // push cursor
        const cursor = this.allocateCursor(null, this.head);

        while (cursor.next !== null) {
            const item = cursor.next;
            cursor.next = item.next;
            fn.call(thisArg, item.data, item, this);
        }

        // pop cursor
        this.releaseCursor();
    }
    forEachRight(fn, thisArg = this) {
        // push cursor
        const cursor = this.allocateCursor(this.tail, null);

        while (cursor.prev !== null) {
            const item = cursor.prev;
            cursor.prev = item.prev;
            fn.call(thisArg, item.data, item, this);
        }

        // pop cursor
        this.releaseCursor();
    }
    reduce(fn, initialValue, thisArg = this) {
        // push cursor
        let cursor = this.allocateCursor(null, this.head);
        let acc = initialValue;
        let item;

        while (cursor.next !== null) {
            item = cursor.next;
            cursor.next = item.next;

            acc = fn.call(thisArg, acc, item.data, item, this);
        }

        // pop cursor
        this.releaseCursor();

        return acc;
    }
    reduceRight(fn, initialValue, thisArg = this) {
        // push cursor
        let cursor = this.allocateCursor(this.tail, null);
        let acc = initialValue;
        let item;

        while (cursor.prev !== null) {
            item = cursor.prev;
            cursor.prev = item.prev;

            acc = fn.call(thisArg, acc, item.data, item, this);
        }

        // pop cursor
        this.releaseCursor();

        return acc;
    }
    some(fn, thisArg = this) {
        for (let cursor = this.head; cursor !== null; cursor = cursor.next) {
            if (fn.call(thisArg, cursor.data, cursor, this)) {
                return true;
            }
        }

        return false;
    }
    map(fn, thisArg = this) {
        const result = new List();

        for (let cursor = this.head; cursor !== null; cursor = cursor.next) {
            result.appendData(fn.call(thisArg, cursor.data, cursor, this));
        }

        return result;
    }
    filter(fn, thisArg = this) {
        const result = new List();

        for (let cursor = this.head; cursor !== null; cursor = cursor.next) {
            if (fn.call(thisArg, cursor.data, cursor, this)) {
                result.appendData(cursor.data);
            }
        }

        return result;
    }

    nextUntil(start, fn, thisArg = this) {
        if (start === null) {
            return;
        }

        // push cursor
        const cursor = this.allocateCursor(null, start);

        while (cursor.next !== null) {
            const item = cursor.next;
            cursor.next = item.next;
            if (fn.call(thisArg, item.data, item, this)) {
                break;
            }
        }

        // pop cursor
        this.releaseCursor();
    }
    prevUntil(start, fn, thisArg = this) {
        if (start === null) {
            return;
        }

        // push cursor
        const cursor = this.allocateCursor(start, null);

        while (cursor.prev !== null) {
            const item = cursor.prev;
            cursor.prev = item.prev;
            if (fn.call(thisArg, item.data, item, this)) {
                break;
            }
        }

        // pop cursor
        this.releaseCursor();
    }

    // mutation
    clear() {
        this.head = null;
        this.tail = null;
    }
    copy() {
        const result = new List();

        for (let data of this) {
            result.appendData(data);
        }

        return result;
    }
    prepend(item) {
        //      head
        //    ^
        // item
        this.updateCursors(null, item, this.head, item);

        // insert to the beginning of the list
        if (this.head !== null) {
            // new item <- first item
            this.head.prev = item;
            // new item -> first item
            item.next = this.head;
        } else {
            // if list has no head, then it also has no tail
            // in this case tail points to the new item
            this.tail = item;
        }

        // head always points to new item
        this.head = item;
        return this;
    }
    prependData(data) {
        return this.prepend(List.createItem(data));
    }
    append(item) {
        return this.insert(item);
    }
    appendData(data) {
        return this.insert(List.createItem(data));
    }
    insert(item, before = null) {
        if (before !== null) {
            // prev   before
            //      ^
            //     item
            this.updateCursors(before.prev, item, before, item);

            if (before.prev === null) {
                // insert to the beginning of list
                if (this.head !== before) {
                    throw new Error('before doesn\'t belong to list');
                }
                // since head points to before therefore list doesn't empty
                // no need to check tail
                this.head = item;
                before.prev = item;
                item.next = before;
                this.updateCursors(null, item);
            } else {
                // insert between two items
                before.prev.next = item;
                item.prev = before.prev;
                before.prev = item;
                item.next = before;
            }
        } else {
            // tail
            //      ^
            //      item
            this.updateCursors(this.tail, item, null, item);

            // insert to the ending of the list
            if (this.tail !== null) {
                // last item -> new item
                this.tail.next = item;
                // last item <- new item
                item.prev = this.tail;
            } else {
                // if list has no tail, then it also has no head
                // in this case head points to new item
                this.head = item;
            }

            // tail always points to new item
            this.tail = item;
        }

        return this;
    }
    insertData(data, before) {
        return this.insert(List.createItem(data), before);
    }
    remove(item) {
        //      item
        //       ^
        // prev     next
        this.updateCursors(item, item.prev, item, item.next);

        if (item.prev !== null) {
            item.prev.next = item.next;
        } else {
            if (this.head !== item) {
                throw new Error('item doesn\'t belong to list');
            }

            this.head = item.next;
        }

        if (item.next !== null) {
            item.next.prev = item.prev;
        } else {
            if (this.tail !== item) {
                throw new Error('item doesn\'t belong to list');
            }

            this.tail = item.prev;
        }

        item.prev = null;
        item.next = null;

        return item;
    }
    push(data) {
        this.insert(List.createItem(data));
    }
    pop() {
        return this.tail !== null ? this.remove(this.tail) : null;
    }
    unshift(data) {
        this.prepend(List.createItem(data));
    }
    shift() {
        return this.head !== null ? this.remove(this.head) : null;
    }
    prependList(list) {
        return this.insertList(list, this.head);
    }
    appendList(list) {
        return this.insertList(list);
    }
    insertList(list, before) {
        // ignore empty lists
        if (list.head === null) {
            return this;
        }

        if (before !== undefined && before !== null) {
            this.updateCursors(before.prev, list.tail, before, list.head);

            // insert in the middle of dist list
            if (before.prev !== null) {
                // before.prev <-> list.head
                before.prev.next = list.head;
                list.head.prev = before.prev;
            } else {
                this.head = list.head;
            }

            before.prev = list.tail;
            list.tail.next = before;
        } else {
            this.updateCursors(this.tail, list.tail, null, list.head);

            // insert to end of the list
            if (this.tail !== null) {
                // if destination list has a tail, then it also has a head,
                // but head doesn't change
                // dest tail -> source head
                this.tail.next = list.head;
                // dest tail <- source head
                list.head.prev = this.tail;
            } else {
                // if list has no a tail, then it also has no a head
                // in this case points head to new item
                this.head = list.head;
            }

            // tail always start point to new item
            this.tail = list.tail;
        }

        list.head = null;
        list.tail = null;
        return this;
    }
    replace(oldItem, newItemOrList) {
        if ('head' in newItemOrList) {
            this.insertList(newItemOrList, oldItem);
        } else {
            this.insert(newItemOrList, oldItem);
        }

        this.remove(oldItem);
    }
}
7|sx,import { List } from './List.js';

export function clone(node) {
    const result = {};

    for (const key of Object.keys(node)) {
        let value = node[key];

        if (value) {
            if (Array.isArray(value) || value instanceof List) {
                value = value.map(clone);
            } else if (value.constructor === Object) {
                value = clone(value);
            }
        }

        result[key] = value;
    }

    return result;
}
Px"export function createCustomError(name, message) {
    // use Object.create(), because some VMs prevent setting line/column otherwise
    // (iOS Safari 10 even throws an exception)
    const error = Object.create(SyntaxError.prototype);
    const errorStack = new Error();

    return Object.assign(error, {
        name,
        message,
        get stack() {
            return (errorStack.stack || '').replace(/^(.+\n){1,3}/, `${name}: ${message}\n`);
        }
    });
};
x!import { tokenize } from '../tokenizer/index.js';

const FUNCTION_TYPE = 'function';

/**
 * Gets the tokenizer function from the configuration object or returns the default tokenizer
 *
 * @param config Configuration object
 * @returns Corresponding tokenizer function
 */
export function getTokenizer(config) {
    if (config && typeof config.tokenize === FUNCTION_TYPE) {
        return config.tokenize;
    }

    // Fallback to the default tokenizer
    return tokenize;
}
չxIimport {
    isName,
    isValidEscape,
    consumeEscaped,
    decodeEscaped
} from '../tokenizer/index.js';

const REVERSE_SOLIDUS = 0x005c; // U+005C REVERSE SOLIDUS (\)

export function decode(str) {
    const end = str.length - 1;
    let decoded = '';

    for (let i = 0; i < str.length; i++) {
        let code = str.charCodeAt(i);

        if (code === REVERSE_SOLIDUS) {
            // special case at the ending
            if (i === end) {
                // if the next input code point is EOF, do nothing
                break;
            }

            code = str.charCodeAt(++i);

            // consume escaped
            if (isValidEscape(REVERSE_SOLIDUS, code)) {
                const escapeStart = i - 1;
                const escapeEnd = consumeEscaped(str, escapeStart);

                i = escapeEnd - 1;
                decoded += decodeEscaped(str.substring(escapeStart + 1, escapeEnd));
            } else {
                // \r\n
                if (code === 0x000d && str.charCodeAt(i + 1) === 0x000a) {
                    i++;
                }
            }
        } else {
            decoded += str[i];
        }
    }

    return decoded;
}

// https://drafts.csswg.org/cssom/#serialize-an-identifier
// § 2.1. Common Serializing Idioms
export function encode(str) {
    let encoded = '';

    // If the character is the first character and is a "-" (U+002D),
    // and there is no second character, then the escaped character.
    // Note: That's means a single dash string "-" return as escaped dash,
    // so move the condition out of the main loop
    if (str.length === 1 && str.charCodeAt(0) === 0x002D) {
        return '\\-';
    }

    // To serialize an identifier means to create a string represented
    // by the concatenation of, for each character of the identifier:
    for (let i = 0; i < str.length; i++) {
        const code = str.charCodeAt(i);

        // If the character is NULL (U+0000), then the REPLACEMENT CHARACTER (U+FFFD).
        if (code === 0x0000) {
            encoded += '\uFFFD';
            continue;
        }

        if (
            // If the character is in the range [\1-\1f] (U+0001 to U+001F) or is U+007F ...
            // Note: Do not compare with 0x0001 since 0x0000 is precessed before
            code <= 0x001F || code === 0x007F ||
            // [or] ... is in the range [0-9] (U+0030 to U+0039),
            (code >= 0x0030 && code <= 0x0039 && (
                // If the character is the first character ...
                i === 0 ||
                // If the character is the second character ... and the first character is a "-" (U+002D)
                i === 1 && str.charCodeAt(0) === 0x002D
            ))
        ) {
            // ... then the character escaped as code point.
            encoded += '\\' + code.toString(16) + ' ';
            continue;
        }

        // If the character is not handled by one of the above rules and is greater
        // than or equal to U+0080, is "-" (U+002D) or "_" (U+005F), or is in one
        // of the ranges [0-9] (U+0030 to U+0039), [A-Z] (U+0041 to U+005A),
        // or \[a-z] (U+0061 to U+007A), then the character itself.
        if (isName(code)) {
            encoded += str.charAt(i);
        } else {
            // Otherwise, the escaped character.
            encoded += '\\' + str.charAt(i);
        }
    }

    return encoded;
}
ܓ|x ?export * from './clone.js';
export * as ident from './ident.js';
export * from './List.js';
export * from './names.js';
export * as string from './string.js';
export * as url from './url.js';
>x|const keywords = new Map();
const properties = new Map();
const HYPHENMINUS = 45; // '-'.charCodeAt()

export const keyword = getKeywordDescriptor;
export const property = getPropertyDescriptor;
export const vendorPrefix = getVendorPrefix;
export function isCustomProperty(str, offset) {
    offset = offset || 0;

    return str.length - offset >= 2 &&
           str.charCodeAt(offset) === HYPHENMINUS &&
           str.charCodeAt(offset + 1) === HYPHENMINUS;
}

function getVendorPrefix(str, offset) {
    offset = offset || 0;

    // verdor prefix should be at least 3 chars length
    if (str.length - offset >= 3) {
        // vendor prefix starts with hyper minus following non-hyper minus
        if (str.charCodeAt(offset) === HYPHENMINUS &&
            str.charCodeAt(offset + 1) !== HYPHENMINUS) {
            // vendor prefix should contain a hyper minus at the ending
            const secondDashIndex = str.indexOf('-', offset + 2);

            if (secondDashIndex !== -1) {
                return str.substring(offset, secondDashIndex + 1);
            }
        }
    }

    return '';
}

function getKeywordDescriptor(keyword) {
    if (keywords.has(keyword)) {
        return keywords.get(keyword);
    }

    const name = keyword.toLowerCase();
    let descriptor = keywords.get(name);

    if (descriptor === undefined) {
        const custom = isCustomProperty(name, 0);
        const vendor = !custom ? getVendorPrefix(name, 0) : '';
        descriptor = Object.freeze({
            basename: name.substr(vendor.length),
            name,
            prefix: vendor,
            vendor,
            custom
        });
    }

    keywords.set(keyword, descriptor);

    return descriptor;
}

function getPropertyDescriptor(property) {
    if (properties.has(property)) {
        return properties.get(property);
    }

    let name = property;
    let hack = property[0];

    if (hack === '/') {
        hack = property[1] === '/' ? '//' : '/';
    } else if (hack !== '_' &&
               hack !== '*' &&
               hack !== '$' &&
               hack !== '#' &&
               hack !== '+' &&
               hack !== '&') {
        hack = '';
    }

    const custom = isCustomProperty(name, hack.length);

    // re-use result when possible (the same as for lower case)
    if (!custom) {
        name = name.toLowerCase();
        if (properties.has(name)) {
            const descriptor = properties.get(name);
            properties.set(property, descriptor);
            return descriptor;
        }
    }

    const vendor = !custom ? getVendorPrefix(name, hack.length) : '';
    const prefix = name.substr(0, hack.length + vendor.length);
    const descriptor = Object.freeze({
        basename: name.substr(prefix.length),
        name: name.substr(hack.length),
        hack,
        vendor,
        prefix,
        custom
    });

    properties.set(property, descriptor);

    return descriptor;
}
*h"xdimport {
    isHexDigit,
    isWhiteSpace,
    isValidEscape,
    consumeEscaped,
    decodeEscaped
} from '../tokenizer/index.js';

const REVERSE_SOLIDUS = 0x005c; // U+005C REVERSE SOLIDUS (\)
const QUOTATION_MARK = 0x0022;  // "
const APOSTROPHE = 0x0027;      // '

export function decode(str) {
    const len = str.length;
    const firstChar = str.charCodeAt(0);
    const start = firstChar === QUOTATION_MARK || firstChar === APOSTROPHE ? 1 : 0;
    const end = start === 1 && len > 1 && str.charCodeAt(len - 1) === firstChar ? len - 2 : len - 1;
    let decoded = '';

    for (let i = start; i <= end; i++) {
        let code = str.charCodeAt(i);

        if (code === REVERSE_SOLIDUS) {
            // special case at the ending
            if (i === end) {
                // if the next input code point is EOF, do nothing
                // otherwise include last quote as escaped
                if (i !== len - 1) {
                    decoded = str.substr(i + 1);
                }
                break;
            }

            code = str.charCodeAt(++i);

            // consume escaped
            if (isValidEscape(REVERSE_SOLIDUS, code)) {
                const escapeStart = i - 1;
                const escapeEnd = consumeEscaped(str, escapeStart);

                i = escapeEnd - 1;
                decoded += decodeEscaped(str.substring(escapeStart + 1, escapeEnd));
            } else {
                // \r\n
                if (code === 0x000d && str.charCodeAt(i + 1) === 0x000a) {
                    i++;
                }
            }
        } else {
            decoded += str[i];
        }
    }

    return decoded;
}

// https://drafts.csswg.org/cssom/#serialize-a-string
// § 2.1. Common Serializing Idioms
export function encode(str, apostrophe) {
    const quote = apostrophe ? '\'' : '"';
    const quoteCode = apostrophe ? APOSTROPHE : QUOTATION_MARK;
    let encoded = '';
    let wsBeforeHexIsNeeded = false;

    for (let i = 0; i < str.length; i++) {
        const code = str.charCodeAt(i);

        // If the character is NULL (U+0000), then the REPLACEMENT CHARACTER (U+FFFD).
        if (code === 0x0000) {
            encoded += '\uFFFD';
            continue;
        }

        // If the character is in the range [\1-\1f] (U+0001 to U+001F) or is U+007F,
        // the character escaped as code point.
        // Note: Do not compare with 0x0001 since 0x0000 is precessed before
        if (code <= 0x001f || code === 0x007F) {
            encoded += '\\' + code.toString(16);
            wsBeforeHexIsNeeded = true;
            continue;
        }

        // If the character is '"' (U+0022) or "\" (U+005C), the escaped character.
        if (code === quoteCode || code === REVERSE_SOLIDUS) {
            encoded += '\\' + str.charAt(i);
            wsBeforeHexIsNeeded = false;
        } else {
            if (wsBeforeHexIsNeeded && (isHexDigit(code) || isWhiteSpace(code))) {
                encoded += ' ';
            }

            // Otherwise, the character itself.
            encoded += str.charAt(i);
            wsBeforeHexIsNeeded = false;
        }
    }

    return quote + encoded + quote;
}
Wvxdimport {
    isHexDigit,
    isWhiteSpace,
    isValidEscape,
    consumeEscaped,
    decodeEscaped
} from '../tokenizer/index.js';

const SPACE = 0x0020;            // U+0020 SPACE
const REVERSE_SOLIDUS = 0x005c;  // U+005C REVERSE SOLIDUS (\)
const QUOTATION_MARK = 0x0022;   // "
const APOSTROPHE = 0x0027;       // '
const LEFTPARENTHESIS = 0x0028;  // U+0028 LEFT PARENTHESIS (()
const RIGHTPARENTHESIS = 0x0029; // U+0029 RIGHT PARENTHESIS ())

export function decode(str) {
    const len = str.length;
    let start = 4; // length of "url("
    let end = str.charCodeAt(len - 1) === RIGHTPARENTHESIS ? len - 2 : len - 1;
    let decoded = '';

    while (start < end && isWhiteSpace(str.charCodeAt(start))) {
        start++;
    }

    while (start < end && isWhiteSpace(str.charCodeAt(end))) {
        end--;
    }

    for (let i = start; i <= end; i++) {
        let code = str.charCodeAt(i);

        if (code === REVERSE_SOLIDUS) {
            // special case at the ending
            if (i === end) {
                // if the next input code point is EOF, do nothing
                // otherwise include last left parenthesis as escaped
                if (i !== len - 1) {
                    decoded = str.substr(i + 1);
                }
                break;
            }

            code = str.charCodeAt(++i);

            // consume escaped
            if (isValidEscape(REVERSE_SOLIDUS, code)) {
                const escapeStart = i - 1;
                const escapeEnd = consumeEscaped(str, escapeStart);

                i = escapeEnd - 1;
                decoded += decodeEscaped(str.substring(escapeStart + 1, escapeEnd));
            } else {
                // \r\n
                if (code === 0x000d && str.charCodeAt(i + 1) === 0x000a) {
                    i++;
                }
            }
        } else {
            decoded += str[i];
        }
    }

    return decoded;
}

export function encode(str) {
    let encoded = '';
    let wsBeforeHexIsNeeded = false;

    for (let i = 0; i < str.length; i++) {
        const code = str.charCodeAt(i);

        // If the character is NULL (U+0000), then the REPLACEMENT CHARACTER (U+FFFD).
        if (code === 0x0000) {
            encoded += '\uFFFD';
            continue;
        }

        // If the character is in the range [\1-\1f] (U+0001 to U+001F) or is U+007F,
        // the character escaped as code point.
        // Note: Do not compare with 0x0001 since 0x0000 is precessed before
        if (code <= 0x001f || code === 0x007F) {
            encoded += '\\' + code.toString(16);
            wsBeforeHexIsNeeded = true;
            continue;
        }

        if (code === SPACE ||
            code === REVERSE_SOLIDUS ||
            code === QUOTATION_MARK ||
            code === APOSTROPHE ||
            code === LEFTPARENTHESIS ||
            code === RIGHTPARENTHESIS) {
            encoded += '\\' + str.charAt(i);
            wsBeforeHexIsNeeded = false;
        } else {
            if (wsBeforeHexIsNeeded && isHexDigit(code)) {
                encoded += ' ';
            }

            encoded += str.charAt(i);
            wsBeforeHexIsNeeded = false;
        }
    }

    return 'url(' + encoded + ')';
}
6I˱	x nimport { createRequire } from 'module';

const require = createRequire(import.meta.url);

export const { version } = require('../package.json');
2xI 100644 create.js v0婈xop?.4Ï100644 index.js $Gt",Ty.mF>c,xBconst { hasOwnProperty } = Object.prototype;
const noop = function() {};

function ensureFunction(value) {
    return typeof value === 'function' ? value : noop;
}

function invokeForType(fn, type) {
    return function(node, item, list) {
        if (node.type === type) {
            fn.call(this, node, item, list);
        }
    };
}

function getWalkersFromStructure(name, nodeType) {
    const structure = nodeType.structure;
    const walkers = [];

    for (const key in structure) {
        if (hasOwnProperty.call(structure, key) === false) {
            continue;
        }

        let fieldTypes = structure[key];
        const walker = {
            name: key,
            type: false,
            nullable: false
        };

        if (!Array.isArray(fieldTypes)) {
            fieldTypes = [fieldTypes];
        }

        for (const fieldType of fieldTypes) {
            if (fieldType === null) {
                walker.nullable = true;
            } else if (typeof fieldType === 'string') {
                walker.type = 'node';
            } else if (Array.isArray(fieldType)) {
                walker.type = 'list';
            }
        }

        if (walker.type) {
            walkers.push(walker);
        }
    }

    if (walkers.length) {
        return {
            context: nodeType.walkContext,
            fields: walkers
        };
    }

    return null;
}

function getTypesFromConfig(config) {
    const types = {};

    for (const name in config.node) {
        if (hasOwnProperty.call(config.node, name)) {
            const nodeType = config.node[name];

            if (!nodeType.structure) {
                throw new Error('Missed `structure` field in `' + name + '` node type definition');
            }

            types[name] = getWalkersFromStructure(name, nodeType);
        }
    }

    return types;
}

function createTypeIterator(config, reverse) {
    const fields = config.fields.slice();
    const contextName = config.context;
    const useContext = typeof contextName === 'string';

    if (reverse) {
        fields.reverse();
    }

    return function(node, context, walk, walkReducer) {
        let prevContextValue;

        if (useContext) {
            prevContextValue = context[contextName];
            context[contextName] = node;
        }

        for (const field of fields) {
            const ref = node[field.name];

            if (!field.nullable || ref) {
                if (field.type === 'list') {
                    const breakWalk = reverse
                        ? ref.reduceRight(walkReducer, false)
                        : ref.reduce(walkReducer, false);

                    if (breakWalk) {
                        return true;
                    }
                } else if (walk(ref)) {
                    return true;
                }
            }
        }

        if (useContext) {
            context[contextName] = prevContextValue;
        }
    };
}

function createFastTraveralMap({
    StyleSheet,
    Atrule,
    Rule,
    Block,
    DeclarationList
}) {
    return {
        Atrule: {
            StyleSheet,
            Atrule,
            Rule,
            Block
        },
        Rule: {
            StyleSheet,
            Atrule,
            Rule,
            Block
        },
        Declaration: {
            StyleSheet,
            Atrule,
            Rule,
            Block,
            DeclarationList
        }
    };
}

export function createWalker(config) {
    const types = getTypesFromConfig(config);
    const iteratorsNatural = {};
    const iteratorsReverse = {};
    const breakWalk = Symbol('break-walk');
    const skipNode = Symbol('skip-node');

    for (const name in types) {
        if (hasOwnProperty.call(types, name) && types[name] !== null) {
            iteratorsNatural[name] = createTypeIterator(types[name], false);
            iteratorsReverse[name] = createTypeIterator(types[name], true);
        }
    }

    const fastTraversalIteratorsNatural = createFastTraveralMap(iteratorsNatural);
    const fastTraversalIteratorsReverse = createFastTraveralMap(iteratorsReverse);

    const walk = function(root, options) {
        function walkNode(node, item, list) {
            const enterRet = enter.call(context, node, item, list);

            if (enterRet === breakWalk) {
                return true;
            }

            if (enterRet === skipNode) {
                return false;
            }

            if (iterators.hasOwnProperty(node.type)) {
                if (iterators[node.type](node, context, walkNode, walkReducer)) {
                    return true;
                }
            }

            if (leave.call(context, node, item, list) === breakWalk) {
                return true;
            }

            return false;
        }

        let enter = noop;
        let leave = noop;
        let iterators = iteratorsNatural;
        let walkReducer = (ret, data, item, list) => ret || walkNode(data, item, list);
        const context = {
            break: breakWalk,
            skip: skipNode,

            root,
            stylesheet: null,
            atrule: null,
            atrulePrelude: null,
            rule: null,
            selector: null,
            block: null,
            declaration: null,
            function: null
        };

        if (typeof options === 'function') {
            enter = options;
        } else if (options) {
            enter = ensureFunction(options.enter);
            leave = ensureFunction(options.leave);

            if (options.reverse) {
                iterators = iteratorsReverse;
            }

            if (options.visit) {
                if (fastTraversalIteratorsNatural.hasOwnProperty(options.visit)) {
                    iterators = options.reverse
                        ? fastTraversalIteratorsReverse[options.visit]
                        : fastTraversalIteratorsNatural[options.visit];
                } else if (!types.hasOwnProperty(options.visit)) {
                    throw new Error('Bad value `' + options.visit + '` for `visit` option (should be: ' + Object.keys(types).sort().join(', ') + ')');
                }

                enter = invokeForType(enter, options.visit);
                leave = invokeForType(leave, options.visit);
            }
        }

        if (enter === noop && leave === noop) {
            throw new Error('Neither `enter` nor `leave` walker handler is set or both aren\'t a function');
        }

        walkNode(root);
    };

    walk.break = breakWalk;
    walk.skip = skipNode;

    walk.find = function(ast, fn) {
        let found = null;

        walk(ast, function(node, item, list) {
            if (fn.call(this, node, item, list)) {
                found = node;
                return breakWalk;
            }
        });

        return found;
    };

    walk.findLast = function(ast, fn) {
        let found = null;

        walk(ast, {
            reverse: true,
            enter(node, item, list) {
                if (fn.call(this, node, item, list)) {
                    found = node;
                    return breakWalk;
                }
            }
        });

        return found;
    };

    walk.findAll = function(ast, fn) {
        const found = [];

        walk(ast, function(node, item, list) {
            if (fn.call(this, node, item, list)) {
                found.push(node);
            }
        });

        return found;
    };

    return walk;
};
=$6x |import { createWalker } from './create.js';
import config from '../syntax/config/walker.js';

export default createWalker(config);
O.7x){
  "name": "@eslint/css-tree",
  "version": "4.0.5",
  "description": "A tool set for CSS: fast detailed parser (CSS → AST), walker (AST traversal), generator (AST → CSS) and lexer (validation and matching) based on specs and browser implementations",
  "author": "Roman Dvornov <rdvornov@gmail.com> (https://github.com/lahmatiy)",
  "license": "MIT",
  "publishConfig": {
    "access": "public"
  },
  "repository": "eslint/csstree",
  "keywords": [
    "css",
    "ast",
    "tokenizer",
    "parser",
    "walker",
    "lexer",
    "generator",
    "utils",
    "syntax",
    "validation"
  ],
  "type": "module",
  "module": "./lib/index.js",
  "types": "./lib/index.d.ts",
  "sideEffects": false,
  "main": "./cjs/index.cjs",
  "exports": {
    ".": {
      "import": "./lib/index.js",
      "require": "./cjs/index.cjs",
      "types": "./lib/index.d.ts"
    },
    "./dist/*": "./dist/*.js",
    "./package.json": "./package.json",
    "./tokenizer": {
      "import": "./lib/tokenizer/index.js",
      "require": "./cjs/tokenizer/index.cjs"
    },
    "./parser": {
      "import": "./lib/parser/index.js",
      "require": "./cjs/parser/index.cjs"
    },
    "./selector-parser": {
      "import": "./lib/parser/parse-selector.js",
      "require": "./cjs/parser/parse-selector.cjs"
    },
    "./generator": {
      "import": "./lib/generator/index.js",
      "require": "./cjs/generator/index.cjs"
    },
    "./walker": {
      "import": "./lib/walker/index.js",
      "require": "./cjs/walker/index.cjs"
    },
    "./convertor": {
      "import": "./lib/convertor/index.js",
      "require": "./cjs/convertor/index.cjs"
    },
    "./lexer": {
      "import": "./lib/lexer/index.js",
      "require": "./cjs/lexer/index.cjs"
    },
    "./definition-syntax": {
      "import": "./lib/definition-syntax/index.js",
      "require": "./cjs/definition-syntax/index.cjs"
    },
    "./definition-syntax-data": {
      "import": "./lib/data.js",
      "require": "./cjs/data.cjs",
      "types": "./lib/data.d.ts"
    },
    "./definition-syntax-data-patch": {
      "import": "./lib/data-patch.js",
      "require": "./cjs/data-patch.cjs"
    },
    "./utils": {
      "import": "./lib/utils/index.js",
      "require": "./cjs/utils/index.cjs"
    }
  },
  "browser": {
    "./cjs/data.cjs": "./dist/data.cjs",
    "./cjs/version.cjs": "./dist/version.cjs",
    "./lib/data.js": "./dist/data.js",
    "./lib/version.js": "./dist/version.js"
  },
  "unpkg": "dist/csstree.esm.js",
  "jsdelivr": "dist/csstree.esm.js",
  "scripts": {
    "watch": "npm run build -- --watch",
    "build": "npm run bundle && npm run esm-to-cjs --",
    "build-and-test": "npm run build && npm run test:dist && npm run test:cjs",
    "bundle": "node scripts/bundle",
    "bundle-and-test": "npm run bundle && npm run test:dist",
    "esm-to-cjs": "node scripts/esm-to-cjs.cjs",
    "esm-to-cjs-and-test": "npm run esm-to-cjs && npm run test:cjs",
    "lint": "eslint lib scripts && node scripts/review-syntax-patch --lint && node scripts/update-docs --lint",
    "lint-and-test": "npm run lint && npm test",
    "update:docs": "node scripts/update-docs",
    "review:syntax-patch": "node scripts/review-syntax-patch",
    "test": "mocha lib/__tests --require lib/__tests/helpers/setup.js --reporter progress",
    "test:cjs": "mocha cjs/__tests --require lib/__tests/helpers/setup.js --reporter progress",
    "test:dist": "mocha dist/__tests --reporter progress",
    "coverage": "c8 --exclude lib/__tests --reporter=lcovonly npm test",
    "prepublishOnly": "npm run lint-and-test && npm run build-and-test",
    "test:types": "tsc -p tests/types/tsconfig.json"
  },
  "dependencies": {
    "mdn-data": "2.29.0",
    "source-map-js": "^1.2.1"
  },
  "devDependencies": {
    "c8": "^11.0.0",
    "clap": "^2.0.1",
    "esbuild": "^0.27.3",
    "eslint": "^8.50.0",
    "json-to-ast": "^2.1.0",
    "mocha": "^11.7.6",
    "rollup": "^2.80.0",
    "typescript": "^5.7.3"
  },
  "engines": {
    "node": "^20.19.0 || ^22.13.0 || >=24"
  },
  "files": [
    "data",
    "dist",
    "cjs",
    "!cjs/__tests",
    "lib",
    "!lib/__tests"
  ]
}
˴x p100644 LICENSE &랟+Kfݩo\d100644 README.md Q9uΝ%6D)40000 dist FYԒ,KH100644 package.json ne:ԙ)`;x2%# ESLint CSS Language Plugin

## Overview

This package contains a plugin that allows you to natively lint CSS files using ESLint.

**Important:** This plugin requires ESLint v9.15.0 or higher and you must be using the [new configuration system](https://eslint.org/docs/latest/use/configure/configuration-files).

## Prerequisites

In order to use the ESLint CSS plugin, you must have the following installed:

1. [Node.js](https://nodejs.org)
1. [ESLint](https://eslint.org/docs/latest/use/getting-started)

## Installation

For Node.js and compatible runtimes:

```shell
npm install @eslint/css -D
# or
yarn add @eslint/css -D
# or
pnpm install @eslint/css -D
# or
bun add @eslint/css -D
```

For Deno (experimental):

```shell
deno add jsr:@eslint/css
```

### Configurations

| **Configuration Name** | **Description**                |
| ---------------------- | ------------------------------ |
| `recommended`          | Enables all recommended rules. |

In your `eslint.config.js` file, import `@eslint/css` and include the recommended config:

```js
// eslint.config.js
import { defineConfig } from "eslint/config";
import css from "@eslint/css";

export default defineConfig([
	// lint CSS files
	{
		files: ["**/*.css"],
		language: "css/css",
		plugins: { css },
		extends: ["css/recommended"],
	},

	// your other configs here
]);
```

### Rules

<!-- NOTE: The following table is autogenerated. Do not manually edit. -->

<!-- Rule Table Start -->

| **Rule Name**                                                                        | **Description**                                       | **Recommended** |
| :----------------------------------------------------------------------------------- | :---------------------------------------------------- | :-------------: |
| [`font-family-fallbacks`](./docs/rules/font-family-fallbacks.md)                     | Enforce use of fallback fonts and a generic font last |       yes       |
| [`no-duplicate-imports`](./docs/rules/no-duplicate-imports.md)                       | Disallow duplicate @import rules                      |       yes       |
| [`no-duplicate-keyframe-selectors`](./docs/rules/no-duplicate-keyframe-selectors.md) | Disallow duplicate selectors within keyframe blocks   |       yes       |
| [`no-empty-blocks`](./docs/rules/no-empty-blocks.md)                                 | Disallow empty blocks                                 |       yes       |
| [`no-important`](./docs/rules/no-important.md)                                       | Disallow !important flags                             |       yes       |
| [`no-invalid-at-rule-placement`](./docs/rules/no-invalid-at-rule-placement.md)       | Disallow invalid placement of at-rules                |       yes       |
| [`no-invalid-at-rules`](./docs/rules/no-invalid-at-rules.md)                         | Disallow invalid at-rules                             |       yes       |
| [`no-invalid-named-grid-areas`](./docs/rules/no-invalid-named-grid-areas.md)         | Disallow invalid named grid areas                     |       yes       |
| [`no-invalid-properties`](./docs/rules/no-invalid-properties.md)                     | Disallow invalid properties                           |       yes       |
| [`no-unmatchable-selectors`](./docs/rules/no-unmatchable-selectors.md)               | Disallow unmatchable selectors                        |       yes       |
| [`prefer-logical-properties`](./docs/rules/prefer-logical-properties.md)             | Enforce the use of logical properties                 |       no        |
| [`relative-font-units`](./docs/rules/relative-font-units.md)                         | Enforce the use of relative font units                |       no        |
| [`selector-complexity`](./docs/rules/selector-complexity.md)                         | Disallow and limit CSS selectors                      |       no        |
| [`use-baseline`](./docs/rules/use-baseline.md)                                       | Enforce the use of baseline features                  |       yes       |
| [`use-layers`](./docs/rules/use-layers.md)                                           | Require use of layers                                 |       no        |

<!-- Rule Table End -->

**Note:** This plugin does not provide formatting rules. We recommend using a source code formatter such as [Prettier](https://prettier.io) for that purpose.

In order to individually configure a rule in your `eslint.config.js` file, import `@eslint/css` and configure each rule with a prefix:

```js
// eslint.config.js
import { defineConfig } from "eslint/config";
import css from "@eslint/css";

export default defineConfig([
	{
		files: ["**/*.css"],
		plugins: {
			css,
		},
		language: "css/css",
		rules: {
			"css/no-empty-blocks": "error",
		},
	},
]);
```

You can individually configure, disable, and enable rules in CSS using comments, such as:

<!-- prettier-ignore -->
```css
/* eslint css/no-empty-blocks: error */

/* eslint-disable css/no-empty-blocks -- this one is ok */
a {
}
/* eslint-enable css/no-empty-blocks */

b { /* eslint-disable-line css/no-empty-blocks */
}

/* eslint-disable-next-line css/no-empty-blocks */
em {
}
```

### Languages

| **Language Name** | **Description**        |
| ----------------- | ---------------------- |
| `css`             | Parse CSS stylesheets. |

In order to individually configure a language in your `eslint.config.js` file, import `@eslint/css` and configure a `language`:

```js
// eslint.config.js
import { defineConfig } from "eslint/config";
import css from "@eslint/css";

export default defineConfig([
	{
		files: ["**/*.css"],
		plugins: {
			css,
		},
		language: "css/css",
		rules: {
			"css/no-empty-blocks": "error",
		},
	},
]);
```

#### Tolerant Mode

By default, the CSS parser runs in strict mode, which reports all parsing errors. If you'd like to allow recoverable parsing errors (those that the browser automatically fixes on its own), you can set the `tolerant` option to `true`:

```js
// eslint.config.js
import { defineConfig } from "eslint/config";
import css from "@eslint/css";

export default defineConfig([
	{
		files: ["**/*.css"],
		plugins: {
			css,
		},
		language: "css/css",
		languageOptions: {
			tolerant: true,
		},
		rules: {
			"css/no-empty-blocks": "error",
		},
	},
]);
```

Setting `tolerant` to `true` is necessary if you are using custom syntax, such as [PostCSS](https://postcss.org/) plugins, that aren't part of the standard CSS syntax.

#### Configuring Custom Syntax

The CSS lexer comes prebuilt with a set of known syntax for CSS that is used in rules like `no-invalid-properties` to validate CSS code. While this works for most cases, there may be cases when you want to define your own extensions to CSS, and this can be done using the `customSyntax` language option.

The `customSyntax` option accepts either an object or a function:

**Object-based syntax**: An object that uses the [CSSTree format](https://github.com/csstree/csstree/blob/master/data/patch.json) for defining custom syntax, which allows you to specify at-rules, properties, and some types. For example, suppose you'd like to define a custom at-rule that looks like this:

```css
@my-at-rule "hello world!";
```

You can configure that syntax as follows:

```js
// eslint.config.js
import { defineConfig } from "eslint/config";
import css from "@eslint/css";

export default defineConfig([
	{
		files: ["**/*.css"],
		plugins: {
			css,
		},
		language: "css/css",
		languageOptions: {
			customSyntax: {
				atrules: {
					"my-at-rule": {
						prelude: "<string>",
					},
				},
			},
		},
		rules: {
			"css/no-empty-blocks": "error",
		},
	},
]);
```

**Function-based syntax**: A function that receives the default CSS syntax data and returns a custom syntax configuration. This is useful when you want to extend the base syntax rather than replace it. For example:

```js
// eslint.config.js
import { defineConfig } from "eslint/config";
import css from "@eslint/css";

export default defineConfig([
	{
		files: ["**/*.css"],
		plugins: {
			css,
		},
		language: "css/css",
		languageOptions: {
			customSyntax: defaultSyntax => ({
				...defaultSyntax,
				properties: {
					...defaultSyntax.properties,
					"-webkit-custom": "<length>",
					"-moz-custom": "<color>",
				},
			}),
		},
		rules: {
			"css/no-empty-blocks": "error",
		},
	},
]);
```

#### Configuring Tailwind Syntax

[Tailwind](https://tailwindcss.com) specifies some extensions to CSS that will otherwise be flagged as invalid by the rules in this plugin. To properly parse Tailwind-specific syntax, install the [`tailwind-csstree`](https://npmjs.com/package/tailwind-csstree) package:

```shell
npm i tailwind-csstree --save-dev
```

Then include it in your configuration using `languageOptions.customSyntax`:

```js
// eslint.config.js
import { defineConfig } from "eslint/config";
import css from "@eslint/css";
import { tailwind4 } from "tailwind-csstree";

export default defineConfig([
	{
		files: ["**/*.css"],
		plugins: {
			css,
		},
		language: "css/css",
		languageOptions: {
			customSyntax: tailwind4,
		},
		rules: {
			"css/no-empty-blocks": "error",
		},
	},
]);
```

## Editor and IDE Setup

### Visual Studio Code

First, ensure you have the [ESLint plugin](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) installed.

Then, edit `eslint.validate` in your `settings.json` file to include `css`:

```json
{
	"eslint.validate": ["css"]
}
```

### JetBrains WebStorm

For any [JetBrains WebStorm](https://www.jetbrains.com/webstorm/), configure the [ESLint scope](https://www.jetbrains.com/help/webstorm/eslint.html#ws_eslint_configure_scope) to include `css`, such as:

```text
**/*.{js,ts,jsx,tsx,cjs,cts,mjs,mts,html,vue,css}
```

## License

Apache 2.0

<!-- NOTE: This section is autogenerated. Do not manually edit.-->
<!--sponsorsstart-->

## Sponsors

The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
to get your logo on our READMEs and [website](https://eslint.org/sponsors).

<h3>Platinum Sponsors</h3>
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a></p><h3>Gold Sponsors</h3>
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a> <a href="https://www.coderabbit.ai/?utm_source=cr_org&utm_medium=github"><img src="https://avatars.githubusercontent.com/u/132028505" alt="CodeRabbit" height="96"></a></p><h3>Silver Sponsors</h3>
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/d472863/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/2d6c3b6/logo.png" alt="Liftoff" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" height="32"></a> <a href="https://www.crawljobs.com/"><img src="https://images.opencollective.com/crawljobs-poland/fa43a17/logo.png" alt="CrawlJobs" height="32"></a> <a href="https://depot.dev"><img src="https://images.opencollective.com/depot/39125a1/logo.png" alt="Depot" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://citadel.co.jp"><img src="https://avatars.githubusercontent.com/u/75781367" alt="Citadel AI" height="32"></a></p>
<h3>Technology Sponsors</h3>
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
<!--sponsorsend-->
z_ x_40000 build 
0bG8]ݫ40000 data 7GmJ
ExƜj100644 index.d.ts ;6q]BD](y100644 index.js ؅X7VX40000 languages ?uA[!d%́40000 rules SԨè100644 types.d.ts yt
pw?&D98100644 types.js SweN׬]FW2-C100644 util.d.ts 	'VxK100644 util.js r1s>OOv>WE%h[
x Q100644 recommended-config.d.ts UP%+100644 recommended-config.js ,{SiFULGKW100644 rules.d.ts Y@EaISs100644 rules.js Z%~ѳUi2CCHFK&x`export default rules;
declare const rules: {
    readonly "css/font-family-fallbacks": "error";
    readonly "css/no-duplicate-imports": "error";
    readonly "css/no-duplicate-keyframe-selectors": "error";
    readonly "css/no-empty-blocks": "error";
    readonly "css/no-important": "error";
    readonly "css/no-invalid-at-rule-placement": "error";
    readonly "css/no-invalid-at-rules": "error";
    readonly "css/no-invalid-named-grid-areas": "error";
    readonly "css/no-invalid-properties": "error";
    readonly "css/no-unmatchable-selectors": "error";
    readonly "css/use-baseline": "error";
};
U  xconst rules = /** @type {const} */ ({
    "css/font-family-fallbacks": "error",
    "css/no-duplicate-imports": "error",
    "css/no-duplicate-keyframe-selectors": "error",
    "css/no-empty-blocks": "error",
    "css/no-important": "error",
    "css/no-invalid-at-rule-placement": "error",
    "css/no-invalid-at-rules": "error",
    "css/no-invalid-named-grid-areas": "error",
    "css/no-invalid-properties": "error",
    "css/no-unmatchable-selectors": "error",
    "css/use-baseline": "error"
});
export default rules;
wUƿx0declare const _default: {
    "fenced-code-language": {
        meta: typeof rule0.meta;
        create: (context: unknown) => any;
    };
    "fenced-code-meta": {
        meta: typeof rule1.meta;
        create: (context: unknown) => any;
    };
    "heading-increment": {
        meta: typeof rule2.meta;
        create: (context: unknown) => any;
    };
    "no-bare-urls": {
        meta: typeof rule3.meta;
        create: (context: unknown) => any;
    };
    "no-duplicate-definitions": {
        meta: typeof rule4.meta;
        create: (context: unknown) => any;
    };
    "no-duplicate-headings": {
        meta: typeof rule5.meta;
        create: (context: unknown) => any;
    };
    "no-empty-definitions": {
        meta: typeof rule6.meta;
        create: (context: unknown) => any;
    };
    "no-empty-images": {
        meta: typeof rule7.meta;
        create: (context: unknown) => any;
    };
    "no-empty-links": {
        meta: typeof rule8.meta;
        create: (context: unknown) => any;
    };
    "no-html": {
        meta: typeof rule9.meta;
        create: (context: unknown) => any;
    };
    "no-invalid-label-refs": {
        meta: typeof rule10.meta;
        create: (context: unknown) => any;
    };
    "no-missing-atx-heading-space": {
        meta: typeof rule11.meta;
        create: (context: unknown) => any;
    };
    "no-missing-label-refs": {
        meta: typeof rule12.meta;
        create: (context: unknown) => any;
    };
    "no-missing-link-fragments": {
        meta: typeof rule13.meta;
        create: (context: unknown) => any;
    };
    "no-multiple-h1": {
        meta: typeof rule14.meta;
        create: (context: unknown) => any;
    };
    "no-reference-like-urls": {
        meta: typeof rule15.meta;
        create: (context: unknown) => any;
    };
    "no-reversed-media-syntax": {
        meta: typeof rule16.meta;
        create: (context: unknown) => any;
    };
    "no-space-in-emphasis": {
        meta: typeof rule17.meta;
        create: (context: unknown) => any;
    };
    "no-unused-definitions": {
        meta: typeof rule18.meta;
        create: (context: unknown) => any;
    };
    "require-alt-text": {
        meta: typeof rule19.meta;
        create: (context: unknown) => any;
    };
    "table-column-count": {
        meta: typeof rule20.meta;
        create: (context: unknown) => any;
    };
};
export default _default;
import rule0 from "../rules/fenced-code-language.js";
import rule1 from "../rules/fenced-code-meta.js";
import rule2 from "../rules/heading-increment.js";
import rule3 from "../rules/no-bare-urls.js";
import rule4 from "../rules/no-duplicate-definitions.js";
import rule5 from "../rules/no-duplicate-headings.js";
import rule6 from "../rules/no-empty-definitions.js";
import rule7 from "../rules/no-empty-images.js";
import rule8 from "../rules/no-empty-links.js";
import rule9 from "../rules/no-html.js";
import rule10 from "../rules/no-invalid-label-refs.js";
import rule11 from "../rules/no-missing-atx-heading-space.js";
import rule12 from "../rules/no-missing-label-refs.js";
import rule13 from "../rules/no-missing-link-fragments.js";
import rule14 from "../rules/no-multiple-h1.js";
import rule15 from "../rules/no-reference-like-urls.js";
import rule16 from "../rules/no-reversed-media-syntax.js";
import rule17 from "../rules/no-space-in-emphasis.js";
import rule18 from "../rules/no-unused-definitions.js";
import rule19 from "../rules/require-alt-text.js";
import rule20 from "../rules/table-column-count.js";
K,]x2 ont-family-fallbacksQ?Iimports]Ikeyframe-selectors,B/blocksB	important
Binvalid-at-rule-placement|Binvalid-at-rulesBinvalid-named-grid-areasYBinvalid-propertiesBunmatchable-selectors(?prefer-logical-properties?relative-font-units?selector-complexity?use-baseline^
use-layersk:R	9ont-family-fallbacks	"
imports	"
keyframe-selectors
%.block0
&importa
|
invalid-at-rule-plac	
invalid-at-rule
&invalid-named-grid-area&invalid-propertie8&unmatchable-selectorsb#prefer-logical-propertie$relative-font-units#selector-complexity#use-baselineM#use-layers.js";
3ϸxGimport rule0 from "../rules/fenced-code-language.js";
import rule1 from "../rules/fenced-code-meta.js";
import rule2 from "../rules/heading-increment.js";
import rule3 from "../rules/no-bare-urls.js";
import rule4 from "../rules/no-duplicate-definitions.js";
import rule5 from "../rules/no-duplicate-headings.js";
import rule6 from "../rules/no-empty-definitions.js";
import rule7 from "../rules/no-empty-images.js";
import rule8 from "../rules/no-empty-links.js";
import rule9 from "../rules/no-html.js";
import rule10 from "../rules/no-invalid-label-refs.js";
import rule11 from "../rules/no-missing-atx-heading-space.js";
import rule12 from "../rules/no-missing-label-refs.js";
import rule13 from "../rules/no-missing-link-fragments.js";
import rule14 from "../rules/no-multiple-h1.js";
import rule15 from "../rules/no-reference-like-urls.js";
import rule16 from "../rules/no-reversed-media-syntax.js";
import rule17 from "../rules/no-space-in-emphasis.js";
import rule18 from "../rules/no-unused-definitions.js";
import rule19 from "../rules/require-alt-text.js";
import rule20 from "../rules/table-column-count.js";
export default {
    "fenced-code-language": /** @type {{meta: typeof rule0.meta; create: (context: unknown) => any}} */ (rule0),
    "fenced-code-meta": /** @type {{meta: typeof rule1.meta; create: (context: unknown) => any}} */ (rule1),
    "heading-increment": /** @type {{meta: typeof rule2.meta; create: (context: unknown) => any}} */ (rule2),
    "no-bare-urls": /** @type {{meta: typeof rule3.meta; create: (context: unknown) => any}} */ (rule3),
    "no-duplicate-definitions": /** @type {{meta: typeof rule4.meta; create: (context: unknown) => any}} */ (rule4),
    "no-duplicate-headings": /** @type {{meta: typeof rule5.meta; create: (context: unknown) => any}} */ (rule5),
    "no-empty-definitions": /** @type {{meta: typeof rule6.meta; create: (context: unknown) => any}} */ (rule6),
    "no-empty-images": /** @type {{meta: typeof rule7.meta; create: (context: unknown) => any}} */ (rule7),
    "no-empty-links": /** @type {{meta: typeof rule8.meta; create: (context: unknown) => any}} */ (rule8),
    "no-html": /** @type {{meta: typeof rule9.meta; create: (context: unknown) => any}} */ (rule9),
    "no-invalid-label-refs": /** @type {{meta: typeof rule10.meta; create: (context: unknown) => any}} */ (rule10),
    "no-missing-atx-heading-space": /** @type {{meta: typeof rule11.meta; create: (context: unknown) => any}} */ (rule11),
    "no-missing-label-refs": /** @type {{meta: typeof rule12.meta; create: (context: unknown) => any}} */ (rule12),
    "no-missing-link-fragments": /** @type {{meta: typeof rule13.meta; create: (context: unknown) => any}} */ (rule13),
    "no-multiple-h1": /** @type {{meta: typeof rule14.meta; create: (context: unknown) => any}} */ (rule14),
    "no-reference-like-urls": /** @type {{meta: typeof rule15.meta; create: (context: unknown) => any}} */ (rule15),
    "no-reversed-media-syntax": /** @type {{meta: typeof rule16.meta; create: (context: unknown) => any}} */ (rule16),
    "no-space-in-emphasis": /** @type {{meta: typeof rule17.meta; create: (context: unknown) => any}} */ (rule17),
    "no-unused-definitions": /** @type {{meta: typeof rule18.meta; create: (context: unknown) => any}} */ (rule18),
    "require-alt-text": /** @type {{meta: typeof rule19.meta; create: (context: unknown) => any}} */ (rule19),
    "table-column-count": /** @type {{meta: typeof rule20.meta; create: (context: unknown) => any}} */ (rule20),
};
HБ-Fx*ont-family-fallbacks0"importsb"keyframe-selectors%block&	important%invalid-at-rule-placEinvalid-at-rulei&invalid-named-grid-area&invalid-propertie&unmatchable-selectors#prefer-logical-propertie+$relative-font-unitsk#selector-complexity#use-baseline#
use-layers[ont-family-fallback!=no-duplicate-importsO	!<no-duplicate-keyframe-selector!@empty-blocka	important d@invalid-at-rule-placa%@invalid-at-rul"G@invalid-named-grid-area!@invalid-properti"@unmatchable-selector!=prefer-logical-properti"?relative-font-unitsO	_selector-complexityO	!	>use-baselinN	"\
>
use-layersO	!
9};
}

x Y100644 baseline-data.d.ts ;xINa7?vM100644 baseline-data.js $_sB˼ۥ3ƻ100644 colors.d.ts q`7wܚ!}wB100644 colors.js ,M~6-l[Ь2)ǸC#x;/**
 * @fileoverview CSS features extracted from the web-features package.
 * @author tools/generate-baseline.js
 *
 * THIS FILE IS AUTOGENERATED. DO NOT MODIFY DIRECTLY.
 */
export const BASELINE_HIGH: 10;
export const BASELINE_LOW: 5;
export const properties: Map<string, string>;
export const atRules: Map<string, string>;
export const mediaConditions: Map<string, string>;
export const functions: Map<string, string>;
export const units: Map<string, string>;
export const selectors: Map<string, string>;
export const propertyValues: Map<string, Map<string, string>>;
c9x   /**
 * @fileoverview CSS features extracted from the web-features package.
 * @author tools/generate-baseline.js
 *
 * THIS FILE IS AUTOGENERATED. DO NOT MODIFY DIRECTLY.
 */
export const BASELINE_HIGH = 10;
export const BASELINE_LOW = 5;
export const properties = new Map([
    ["accent-color", "0:"],
    ["alignment-baseline", "5:2026"],
    ["all", "10:2020"],
    ["anchor-name", "5:2026"],
    ["anchor-scope", "5:2026"],
    ["position-anchor", "0:"],
    ["position-area", "5:2026"],
    ["position-try", "5:2026"],
    ["position-try-fallbacks", "5:2026"],
    ["position-try-order", "5:2026"],
    ["position-visibility", "5:2026"],
    ["animation-composition", "10:2023"],
    ["animation", "10:2015"],
    ["animation-delay", "10:2015"],
    ["animation-direction", "10:2015"],
    ["animation-duration", "10:2015"],
    ["animation-fill-mode", "10:2015"],
    ["animation-iteration-count", "10:2015"],
    ["animation-name", "10:2015"],
    ["animation-play-state", "10:2015"],
    ["animation-timing-function", "10:2015"],
    ["appearance", "10:2022"],
    ["aspect-ratio", "10:2021"],
    ["backdrop-filter", "5:2024"],
    ["background", "10:2015"],
    ["background-attachment", "10:2015"],
    ["background-blend-mode", "10:2020"],
    ["background-clip", "10:2015"],
    ["background-color", "10:2015"],
    ["background-image", "10:2015"],
    ["background-origin", "10:2015"],
    ["background-position", "10:2015"],
    ["background-position-x", "10:2016"],
    ["background-position-y", "10:2016"],
    ["background-repeat", "10:2015"],
    ["background-size", "10:2015"],
    ["baseline-shift", "5:2026"],
    ["baseline-source", "0:"],
    ["border-image", "10:2015"],
    ["border-image-outset", "10:2015"],
    ["border-image-repeat", "10:2016"],
    ["border-image-slice", "10:2015"],
    ["border-image-source", "10:2015"],
    ["border-image-width", "10:2015"],
    ["border-bottom-left-radius", "10:2015"],
    ["border-bottom-right-radius", "10:2015"],
    ["border-radius", "10:2015"],
    ["border-top-left-radius", "10:2015"],
    ["border-top-right-radius", "10:2015"],
    ["border-shape", "0:"],
    ["border", "10:2015"],
    ["border-bottom", "10:2015"],
    ["border-bottom-color", "10:2015"],
    ["border-bottom-style", "10:2015"],
    ["border-bottom-width", "10:2015"],
    ["border-color", "10:2015"],
    ["border-left", "10:2015"],
    ["border-left-color", "10:2015"],
    ["border-left-style", "10:2015"],
    ["border-left-width", "10:2015"],
    ["border-right", "10:2015"],
    ["border-right-color", "10:2015"],
    ["border-right-style", "10:2015"],
    ["border-right-width", "10:2015"],
    ["border-style", "10:2015"],
    ["border-top", "10:2015"],
    ["border-top-color", "10:2015"],
    ["border-top-style", "10:2015"],
    ["border-top-width", "10:2015"],
    ["border-width", "10:2015"],
    ["box-decoration-break", "0:"],
    ["box-shadow", "10:2015"],
    ["box-sizing", "10:2015"],
    ["caret-color", "10:2020"],
    ["caret-shape", "0:"],
    ["clip", "0:"],
    ["clip-path", "10:2020"],
    ["color", "10:2015"],
    ["color-adjust", "0:"],
    ["color-scheme", "10:2022"],
    ["column-fill", "10:2017"],
    ["column-span", "10:2020"],
    ["contain", "10:2022"],
    ["contain-intrinsic-block-size", "10:2023"],
    ["contain-intrinsic-height", "10:2023"],
    ["contain-intrinsic-inline-size", "10:2023"],
    ["contain-intrinsic-size", "10:2023"],
    ["contain-intrinsic-width", "10:2023"],
    ["container", "10:2023"],
    ["container-name", "10:2023"],
    ["container-type", "10:2023"],
    ["content", "10:2015"],
    ["content-visibility", "5:2024"],
    ["corner-block-end-shape", "0:"],
    ["corner-block-start-shape", "0:"],
    ["corner-bottom-left-shape", "0:"],
    ["corner-bottom-right-shape", "0:"],
    ["corner-bottom-shape", "0:"],
    ["corner-end-end-shape", "0:"],
    ["corner-end-start-shape", "0:"],
    ["corner-inline-end-shape", "0:"],
    ["corner-inline-start-shape", "0:"],
    ["corner-left-shape", "0:"],
    ["corner-right-shape", "0:"],
    ["corner-shape", "0:"],
    ["corner-start-end-shape", "0:"],
    ["corner-start-start-shape", "0:"],
    ["corner-top-left-shape", "0:"],
    ["corner-top-right-shape", "0:"],
    ["corner-top-shape", "0:"],
    ["counter-set", "10:2023"],
    ["counter-increment", "10:2015"],
    ["counter-reset", "10:2015"],
    ["custom-property", "10:2017"],
    ["display", "10:2015"],
    ["dominant-baseline", "10:2020"],
    ["dynamic-range-limit", "0:"],
    ["field-sizing", "5:2026"],
    ["filter", "10:2016"],
    ["align-content", "10:2015"],
    ["align-items", "10:2015"],
    ["align-self", "10:2015"],
    ["flex", "10:2015"],
    ["flex-basis", "10:2015"],
    ["flex-direction", "10:2015"],
    ["flex-flow", "10:2015"],
    ["flex-grow", "10:2015"],
    ["flex-shrink", "10:2015"],
    ["flex-wrap", "10:2015"],
    ["justify-content", "10:2015"],
    ["justify-items", "10:2016"],
    ["order", "10:2015"],
    ["place-content", "10:2020"],
    ["place-items", "10:2020"],
    ["place-self", "10:2020"],
    ["clear", "10:2015"],
    ["float", "10:2015"],
    ["font-family", "10:2015"],
    ["font-feature-settings", "10:2017"],
    ["font-kerning", "10:2020"],
    ["font-language-override", "0:"],
    ["font-optical-sizing", "10:2020"],
    ["font-palette", "10:2022"],
    ["font", "10:2015"],
    ["font-size", "10:2015"],
    ["font-size-adjust", "5:2024"],
    ["font-stretch", "10:2017"],
    ["font-style", "10:2015"],
    ["font-synthesis", "10:2022"],
    ["font-synthesis-position", "0:"],
    ["font-synthesis-small-caps", "10:2023"],
    ["font-synthesis-style", "10:2023"],
    ["font-synthesis-weight", "10:2023"],
    ["font-variant", "10:2015"],
    ["font-variant-alternates", "10:2023"],
    ["font-variant-caps", "10:2020"],
    ["font-variant-east-asian", "10:2020"],
    ["font-variant-emoji", "0:"],
    ["font-variant-ligatures", "10:2020"],
    ["font-variant-numeric", "10:2020"],
    ["font-variant-position", "10:2023"],
    ["font-variation-settings", "10:2018"],
    ["font-weight", "10:2015"],
    ["font-width", "0:"],
    ["forced-color-adjust", "0:"],
    ["column-rule-break", "0:"],
    ["column-rule-inset", "0:"],
    ["column-rule-inset-cap", "0:"],
    ["column-rule-inset-cap-end", "0:"],
    ["column-rule-inset-cap-start", "0:"],
    ["column-rule-inset-end", "0:"],
    ["column-rule-inset-junction", "0:"],
    ["column-rule-inset-junction-end", "0:"],
    ["column-rule-inset-junction-start", "0:"],
    ["column-rule-inset-start", "0:"],
    ["column-rule-visibility-items", "0:"],
    ["row-rule", "0:"],
    ["row-rule-break", "0:"],
    ["row-rule-color", "0:"],
    ["row-rule-inset", "0:"],
    ["row-rule-inset-cap", "0:"],
    ["row-rule-inset-cap-end", "0:"],
    ["row-rule-inset-cap-start", "0:"],
    ["row-rule-inset-end", "0:"],
    ["row-rule-inset-junction", "0:"],
    ["row-rule-inset-junction-end", "0:"],
    ["row-rule-inset-junction-start", "0:"],
    ["row-rule-inset-start", "0:"],
    ["row-rule-style", "0:"],
    ["row-rule-visibility-items", "0:"],
    ["row-rule-width", "0:"],
    ["rule", "0:"],
    ["rule-break", "0:"],
    ["rule-color", "0:"],
    ["rule-inset", "0:"],
    ["rule-inset-cap", "0:"],
    ["rule-inset-end", "0:"],
    ["rule-inset-junction", "0:"],
    ["rule-inset-start", "0:"],
    ["rule-overlap", "0:"],
    ["rule-style", "0:"],
    ["rule-visibility-items", "0:"],
    ["rule-width", "0:"],
    ["glyph-orientation-vertical", "0:"],
    ["gap", "10:2017"],
    ["grid", "10:2017"],
    ["grid-area", "10:2017"],
    ["grid-auto-columns", "10:2020"],
    ["grid-auto-flow", "10:2017"],
    ["grid-auto-rows", "10:2020"],
    ["grid-column", "10:2017"],
    ["grid-column-end", "10:2017"],
    ["grid-column-start", "10:2017"],
    ["grid-row", "10:2017"],
    ["grid-row-end", "10:2017"],
    ["grid-row-start", "10:2017"],
    ["grid-template", "10:2017"],
    ["grid-template-areas", "10:2017"],
    ["grid-template-columns", "10:2017"],
    ["grid-template-rows", "10:2017"],
    ["justify-self", "10:2017"],
    ["row-gap", "10:2017"],
    ["hanging-punctuation", "0:"],
    ["hyphenate-character", "10:2023"],
    ["hyphenate-limit-chars", "0:"],
    ["hyphens", "10:2023"],
    ["image-orientation", "10:2020"],
    ["image-rendering", "10:2020"],
    ["ime-mode", "0:"],
    ["rotate", "10:2022"],
    ["scale", "10:2022"],
    ["translate", "10:2022"],
    ["initial-letter", "0:"],
    ["interactivity", "0:"],
    ["interpolate-size", "0:"],
    ["isolation", "10:2020"],
    ["direction", "10:2015"],
    ["unicode-bidi", "10:2015"],
    ["letter-spacing", "10:2015"],
    ["line-break", "10:2020"],
    ["line-clamp", "0:"],
    ["line-height", "10:2015"],
    ["list-style", "10:2015"],
    ["list-style-image", "10:2015"],
    ["list-style-position", "10:2015"],
    ["list-style-type", "10:2015"],
    ["block-size", "10:2020"],
    ["border-block", "10:2021"],
    ["border-block-color", "10:2021"],
    ["border-block-end", "10:2020"],
    ["border-block-end-color", "10:2020"],
    ["border-block-end-style", "10:2020"],
    ["border-block-end-width", "10:2020"],
    ["border-block-start", "10:2020"],
    ["border-block-start-color", "10:2020"],
    ["border-block-start-style", "10:2020"],
    ["border-block-start-width", "10:2020"],
    ["border-block-style", "10:2021"],
    ["border-block-width", "10:2021"],
    ["border-end-end-radius", "10:2021"],
    ["border-end-start-radius", "10:2021"],
    ["border-inline", "10:2021"],
    ["border-inline-color", "10:2021"],
    ["border-inline-end", "10:2020"],
    ["border-inline-end-color", "10:2020"],
    ["border-inline-end-style", "10:2020"],
    ["border-inline-end-width", "10:2020"],
    ["border-inline-start", "10:2020"],
    ["border-inline-start-color", "10:2020"],
    ["border-inline-start-style", "10:2020"],
    ["border-inline-start-width", "10:2020"],
    ["border-inline-style", "10:2021"],
    ["border-inline-width", "10:2021"],
    ["border-start-end-radius", "10:2021"],
    ["border-start-start-radius", "10:2021"],
    ["inline-size", "10:2020"],
    ["inset", "10:2021"],
    ["inset-block", "10:2021"],
    ["inset-block-end", "10:2021"],
    ["inset-block-start", "10:2021"],
    ["inset-inline", "10:2021"],
    ["inset-inline-end", "10:2021"],
    ["inset-inline-start", "10:2021"],
    ["margin-block", "10:2021"],
    ["margin-block-end", "10:2020"],
    ["margin-block-start", "10:2020"],
    ["margin-inline", "10:2021"],
    ["margin-inline-end", "10:2020"],
    ["margin-inline-start", "10:2020"],
    ["max-block-size", "10:2020"],
    ["max-inline-size", "10:2020"],
    ["min-block-size", "10:2020"],
    ["min-inline-size", "10:2020"],
    ["overflow-block", "5:2025"],
    ["overflow-inline", "5:2025"],
    ["padding-block", "10:2021"],
    ["padding-block-end", "10:2020"],
    ["padding-block-start", "10:2020"],
    ["padding-inline", "10:2021"],
    ["padding-inline-end", "10:2020"],
    ["padding-inline-start", "10:2020"],
    ["margin", "10:2015"],
    ["margin-bottom", "10:2015"],
    ["margin-left", "10:2015"],
    ["margin-right", "10:2015"],
    ["margin-top", "10:2015"],
    ["margin-trim", "0:"],
    ["mask-border", "0:"],
    ["mask-border-outset", "0:"],
    ["mask-border-repeat", "0:"],
    ["mask-border-slice", "0:"],
    ["mask-border-source", "0:"],
    ["mask-border-width", "0:"],
    ["mask-type", "10:2020"],
    ["mask", "10:2023"],
    ["mask-clip", "10:2023"],
    ["mask-composite", "10:2023"],
    ["mask-image", "10:2023"],
    ["mask-mode", "10:2023"],
    ["mask-origin", "10:2023"],
    ["mask-position", "10:2023"],
    ["mask-repeat", "10:2023"],
    ["mask-size", "10:2023"],
    ["math-depth", "5:2026"],
    ["math-shift", "5:2025"],
    ["math-style", "10:2023"],
    ["max-height", "10:2015"],
    ["max-width", "10:2015"],
    ["min-height", "10:2015"],
    ["min-width", "10:2015"],
    ["mix-blend-mode", "10:2020"],
    ["offset", "10:2022"],
    ["offset-anchor", "10:2023"],
    ["offset-distance", "10:2022"],
    ["offset-path", "10:2022"],
    ["offset-position", "5:2024"],
    ["offset-rotate", "10:2022"],
    ["column-count", "10:2017"],
    ["column-gap", "10:2015"],
    ["column-rule", "10:2017"],
    ["column-rule-color", "10:2017"],
    ["column-rule-style", "10:2017"],
    ["column-rule-width", "10:2017"],
    ["column-width", "10:2016"],
    ["columns", "10:2017"],
    ["object-fit", "10:2020"],
    ["object-position", "10:2020"],
    ["object-view-box", "0:"],
    ["opacity", "10:2015"],
    ["fill-opacity", "10:2017"],
    ["stroke-opacity", "10:2017"],
    ["outline", "10:2023"],
    ["outline-color", "10:2015"],
    ["outline-offset", "10:2017"],
    ["outline-style", "10:2015"],
    ["outline-width", "10:2015"],
    ["overflow-anchor", "0:"],
    ["overflow-clip-margin", "0:"],
    ["overflow", "10:2015"],
    ["overflow-x", "10:2015"],
    ["overflow-y", "10:2015"],
    ["overflow-wrap", "10:2018"],
    ["overlay", "0:"],
    ["overscroll-behavior", "0:"],
    ["overscroll-behavior-block", "0:"],
    ["overscroll-behavior-inline", "0:"],
    ["overscroll-behavior-x", "0:"],
    ["overscroll-behavior-y", "0:"],
    ["padding", "10:2015"],
    ["padding-bottom", "10:2015"],
    ["padding-left", "10:2015"],
    ["padding-right", "10:2015"],
    ["padding-top", "10:2015"],
    ["page-break-after", "0:"],
    ["page-break-before", "0:"],
    ["page-break-inside", "0:"],
    ["break-after", "10:2019"],
    ["break-before", "10:2019"],
    ["break-inside", "10:2019"],
    ["page", "10:2023"],
    ["paint-order", "5:2024"],
    ["bottom", "10:2015"],
    ["left", "10:2015"],
    ["right", "10:2015"],
    ["top", "10:2015"],
    ["pointer-events", "10:2015"],
    ["position", "10:2015"],
    ["print-color-adjust", "5:2025"],
    ["quotes", "10:2015"],
    ["reading-flow", "0:"],
    ["reading-order", "0:"],
    ["resize", "0:"],
    ["ruby-align", "5:2024"],
    ["ruby-overhang", "0:"],
    ["ruby-position", "5:2024"],
    ["scroll-behavior", "10:2022"],
    ["animation-range", "0:"],
    ["animation-range-end", "0:"],
    ["animation-range-start", "0:"],
    ["animation-timeline", "0:"],
    ["scroll-timeline", "0:"],
    ["scroll-timeline-axis", "0:"],
    ["scroll-timeline-name", "0:"],
    ["timeline-scope", "0:"],
    ["view-timeline", "0:"],
    ["view-timeline-axis", "0:"],
    ["view-timeline-inset", "0:"],
    ["view-timeline-name", "0:"],
    ["scroll-initial-target", "0:"],
    ["scroll-marker-group", "0:"],
    ["scroll-margin", "10:2021"],
    ["scroll-margin-block", "10:2021"],
    ["scroll-margin-block-end", "10:2021"],
    ["scroll-margin-block-start", "10:2021"],
    ["scroll-margin-bottom", "10:2021"],
    ["scroll-margin-inline", "10:2021"],
    ["scroll-margin-inline-end", "10:2021"],
    ["scroll-margin-inline-start", "10:2021"],
    ["scroll-margin-left", "10:2021"],
    ["scroll-margin-right", "10:2021"],
    ["scroll-margin-top", "10:2021"],
    ["scroll-padding", "10:2021"],
    ["scroll-padding-block", "10:2021"],
    ["scroll-padding-block-end", "10:2021"],
    ["scroll-padding-block-start", "10:2021"],
    ["scroll-padding-bottom", "10:2021"],
    ["scroll-padding-inline", "10:2021"],
    ["scroll-padding-inline-end", "10:2021"],
    ["scroll-padding-inline-start", "10:2021"],
    ["scroll-padding-left", "10:2021"],
    ["scroll-padding-right", "10:2021"],
    ["scroll-padding-top", "10:2021"],
    ["scroll-snap-align", "10:2020"],
    ["scroll-snap-stop", "10:2022"],
    ["scroll-snap-type", "10:2022"],
    ["scroll-target-group", "0:"],
    ["scrollbar-color", "5:2025"],
    ["scrollbar-gutter", "5:2024"],
    ["scrollbar-width", "5:2024"],
    ["shape-image-threshold", "10:2020"],
    ["shape-margin", "10:2020"],
    ["shape-outside", "10:2020"],
    ["speak", "0:"],
    ["speak-as", "0:"],
    ["clip-rule", "10:2020"],
    ["color-interpolation", "10:2020"],
    ["cx", "10:2020"],
    ["cy", "10:2020"],
    ["d", "0:"],
    ["fill", "10:2017"],
    ["fill-rule", "10:2017"],
    ["marker", "10:2017"],
    ["marker-end", "10:2017"],
    ["marker-mid", "10:2017"],
    ["marker-start", "10:2017"],
    ["r", "10:2020"],
    ["rx", "5:2024"],
    ["ry", "5:2024"],
    ["shape-rendering", "10:2020"],
    ["stop-color", "10:2017"],
    ["stop-opacity", "10:2017"],
    ["stroke", "10:2017"],
    ["stroke-color", "0:"],
    ["stroke-dasharray", "10:2017"],
    ["stroke-dashoffset", "10:2017"],
    ["stroke-linecap", "10:2017"],
    ["stroke-linejoin", "10:2017"],
    ["stroke-miterlimit", "10:2017"],
    ["stroke-width", "10:2017"],
    ["text-anchor", "10:2016"],
    ["text-rendering", "10:2020"],
    ["vector-effect", "10:2020"],
    ["x", "10:2020"],
    ["y", "10:2020"],
    ["color-interpolation-filters", "10:2020"],
    ["flood-color", "10:2015"],
    ["flood-opacity", "10:2015"],
    ["lighting-color", "10:2015"],
    ["tab-size", "10:2021"],
    ["border-collapse", "10:2015"],
    ["border-spacing", "10:2015"],
    ["caption-side", "10:2015"],
    ["empty-cells", "10:2015"],
    ["table-layout", "10:2015"],
    ["text-align", "10:2015"],
    ["text-align-last", "10:2022"],
    ["text-autospace", "5:2025"],
    ["text-box", "0:"],
    ["text-box-edge", "0:"],
    ["text-box-trim", "0:"],
    ["text-combine-upright", "10:2022"],
    ["text-decoration", "10:2015"],
    ["text-decoration-color", "10:2020"],
    ["text-decoration-line", "10:2020"],
    ["text-decoration-style", "10:2020"],
    ["text-decoration-thickness", "10:2021"],
    ["text-decoration-skip-ink", "10:2022"],
    ["text-emphasis", "10:2022"],
    ["text-emphasis-color", "10:2022"],
    ["text-emphasis-position", "10:2022"],
    ["text-emphasis-style", "10:2022"],
    ["text-indent", "10:2015"],
    ["text-justify", "0:"],
    ["text-orientation", "10:2020"],
    ["text-overflow", "10:2015"],
    ["text-shadow", "10:2015"],
    ["text-size-adjust", "0:"],
    ["text-spacing-trim", "0:"],
    ["-webkit-text-fill-color", "10:2016"],
    ["-webkit-text-stroke", "10:2017"],
    ["-webkit-text-stroke-color", "10:2017"],
    ["-webkit-text-stroke-width", "10:2017"],
    ["text-transform", "10:2015"],
    ["text-underline-offset", "10:2020"],
    ["text-underline-position", "10:2020"],
    ["text-wrap", "5:2024"],
    ["text-wrap-mode", "5:2024"],
    ["text-wrap-style", "5:2024"],
    ["touch-action", "10:2019"],
    ["transform-box", "10:2020"],
    ["transform", "10:2015"],
    ["transform-origin", "10:2015"],
    ["backface-visibility", "10:2022"],
    ["perspective", "10:2015"],
    ["perspective-origin", "10:2015"],
    ["transform-style", "10:2015"],
    ["transition-behavior", "5:2024"],
    ["transition", "10:2015"],
    ["transition-delay", "10:2015"],
    ["transition-duration", "10:2015"],
    ["transition-property", "10:2015"],
    ["transition-timing-function", "10:2015"],
    ["user-select", "0:"],
    ["vertical-align", "10:2015"],
    ["view-transition-class", "5:2025"],
    ["view-transition-name", "5:2025"],
    ["view-transition-scope", "0:"],
    ["visibility", "10:2015"],
    ["white-space", "10:2015"],
    ["white-space-collapse", "5:2024"],
    ["orphans", "0:"],
    ["widows", "0:"],
    ["height", "10:2015"],
    ["width", "10:2015"],
    ["will-change", "10:2020"],
    ["word-break", "10:2015"],
    ["word-spacing", "10:2015"],
    ["writing-mode", "10:2017"],
    ["z-index", "10:2015"],
    ["zoom", "5:2024"],
]);
export const atRules = new Map([
    ["position-try", "5:2026"],
    ["keyframes", "10:2015"],
    ["layer", "10:2022"],
    ["charset", "10:2015"],
    ["container", "10:2023"],
    ["counter-style", "10:2023"],
    ["view-transition", "0:"],
    ["custom-media", "0:"],
    ["font-face", "10:2015"],
    ["font-palette-values", "10:2022"],
    ["font-feature-values", "10:2023"],
    ["function", "0:"],
    ["import", "10:2015"],
    ["media", "10:2015"],
    ["namespace", "10:2015"],
    ["page", "5:2024"],
    ["property", "5:2024"],
    ["scope", "5:2025"],
    ["starting-style", "5:2024"],
    ["supports", "10:2015"],
]);
export const mediaConditions = new Map([
    ["color-gamut", "10:2023"],
    ["device-posture", "0:"],
    ["device-aspect-ratio", "0:"],
    ["device-height", "0:"],
    ["device-width", "0:"],
    ["display-mode", "10:2020"],
    ["dynamic-range", "10:2022"],
    ["forced-colors", "10:2022"],
    ["any-hover", "10:2018"],
    ["any-pointer", "10:2018"],
    ["hover", "10:2018"],
    ["pointer", "10:2018"],
    ["inverted-colors", "0:"],
    ["aspect-ratio", "10:2015"],
    ["calc", "10:2020"],
    ["color", "10:2015"],
    ["color-index", "0:"],
    ["grid", "10:2015"],
    ["height", "10:2015"],
    ["monochrome", "10:2020"],
    ["nested-queries", "10:2015"],
    ["orientation", "10:2015"],
    ["width", "10:2015"],
    ["overflow-block", "10:2023"],
    ["overflow-inline", "10:2023"],
    ["prefers-color-scheme", "10:2020"],
    ["prefers-contrast", "10:2022"],
    ["prefers-reduced-data", "0:"],
    ["prefers-reduced-motion", "10:2020"],
    ["prefers-reduced-transparency", "0:"],
    ["resolution", "10:2022"],
    ["-webkit-device-pixel-ratio", "10:2018"],
    ["-webkit-max-device-pixel-ratio", "10:2018"],
    ["-webkit-min-device-pixel-ratio", "10:2018"],
    ["scripting", "10:2023"],
    ["-webkit-transform-3d", "10:2016"],
    ["update", "10:2023"],
    ["video-dynamic-range", "0:"],
    ["horizontal-viewport-segments", "0:"],
    ["vertical-viewport-segments", "0:"],
]);
export const functions = new Map([
    ["abs", "5:2025"],
    ["sign", "5:2025"],
    ["anchor", "5:2026"],
    ["anchor-size", "5:2026"],
    ["attr", "10:2015"],
    ["calc", "10:2015"],
    ["calc-size", "0:"],
    ["shape", "5:2026"],
    ["rect", "5:2024"],
    ["color", "10:2023"],
    ["color-mix", "10:2023"],
    ["conic-gradient", "10:2020"],
    ["repeating-conic-gradient", "10:2020"],
    ["contrast-color", "5:2026"],
    ["round", "5:2024"],
    ["superellipse", "0:"],
    ["counter", "10:2015"],
    ["counters", "10:2015"],
    ["cross-fade", "0:"],
    ["cubic-bezier", "10:2015"],
    ["var", "10:2017"],
    ["dynamic-range-limit-mix", "0:"],
    ["element", "0:"],
    ["exp", "10:2023"],
    ["hypot", "10:2023"],
    ["log", "10:2023"],
    ["pow", "10:2023"],
    ["sqrt", "10:2023"],
    ["blur", "10:2016"],
    ["brightness", "10:2016"],
    ["contrast", "10:2016"],
    ["drop-shadow", "10:2016"],
    ["grayscale", "10:2016"],
    ["hue-rotate", "10:2016"],
    ["invert", "10:2016"],
    ["opacity", "10:2016"],
    ["saturate", "10:2016"],
    ["sepia", "10:2016"],
    ["filter", "0:"],
    ["fit-content", "0:"],
    ["url", "10:2015"],
    ["type", "0:"],
    ["linear-gradient", "10:2015"],
    ["radial-gradient", "10:2015"],
    ["repeating-linear-gradient", "10:2015"],
    ["repeating-radial-gradient", "10:2015"],
    ["hsl", "10:2015"],
    ["hwb", "10:2022"],
    ["if", "0:"],
    ["image", "0:"],
    ["image-set", "10:2023"],
    ["lab", "10:2023"],
    ["lch", "10:2023"],
    ["light-dark", "5:2024"],
    ["clamp", "10:2020"],
    ["max", "10:2020"],
    ["min", "10:2020"],
    ["ray", "5:2024"],
    ["oklab", "10:2023"],
    ["oklch", "10:2023"],
    ["paint", "0:"],
    ["path", "10:2020"],
    ["progress", "0:"],
    ["random", "0:"],
    ["xywh", "5:2024"],
    ["rgb", "10:2015"],
    ["mod", "5:2024"],
    ["rem", "5:2024"],
    ["env", "10:2020"],
    ["circle", "10:2020"],
    ["ellipse", "10:2020"],
    ["inset", "10:2020"],
    ["polygon", "10:2020"],
    ["sibling-count", "0:"],
    ["sibling-index", "0:"],
    ["steps", "10:2015"],
    ["matrix", "10:2015"],
    ["rotate", "10:2015"],
    ["scale", "10:2015"],
    ["scaleX", "10:2015"],
    ["scaleY", "10:2015"],
    ["skew", "10:2015"],
    ["skewX", "10:2015"],
    ["skewY", "10:2015"],
    ["translate", "10:2015"],
    ["translateX", "10:2015"],
    ["translateY", "10:2015"],
    ["matrix3d", "10:2015"],
    ["perspective", "10:2015"],
    ["rotate3d", "10:2015"],
    ["rotateX", "10:2015"],
    ["rotateY", "10:2015"],
    ["rotateZ", "10:2015"],
    ["scale3d", "10:2015"],
    ["scaleZ", "10:2015"],
    ["translate3d", "10:2015"],
    ["translateZ", "10:2015"],
    ["acos", "10:2023"],
    ["asin", "10:2023"],
    ["atan", "10:2023"],
    ["atan2", "10:2023"],
    ["cos", "10:2023"],
    ["sin", "10:2023"],
    ["tan", "10:2023"],
    ["cross-origin", "0:"],
    ["integrity", "0:"],
    ["referrer-policy", "0:"],
]);
export const units = new Map([
    ["cap", "10:2023"],
    ["ch", "10:2015"],
    ["cqw", "10:2023"],
    ["cqh", "10:2023"],
    ["cqi", "10:2023"],
    ["cqb", "10:2023"],
    ["cqmin", "10:2023"],
    ["cqmax", "10:2023"],
    ["em", "10:2015"],
    ["ex", "10:2015"],
    ["ic", "10:2022"],
    ["lh", "10:2023"],
    ["Q", "10:2020"],
    ["rcap", "5:2026"],
    ["rch", "5:2026"],
    ["rem", "10:2015"],
    ["rex", "5:2026"],
    ["ric", "5:2026"],
    ["rlh", "10:2023"],
    ["vb", "10:2022"],
    ["vi", "10:2022"],
    ["dvb", "10:2022"],
    ["dvh", "10:2022"],
    ["dvi", "10:2022"],
    ["dvmax", "10:2022"],
    ["dvmin", "10:2022"],
    ["dvw", "10:2022"],
    ["lvb", "10:2022"],
    ["lvh", "10:2022"],
    ["lvi", "10:2022"],
    ["lvmax", "10:2022"],
    ["lvmin", "10:2022"],
    ["lvw", "10:2022"],
    ["svb", "10:2022"],
    ["svh", "10:2022"],
    ["svi", "10:2022"],
    ["svmax", "10:2022"],
    ["svmin", "10:2022"],
    ["svw", "10:2022"],
    ["vh", "10:2015"],
    ["vmax", "10:2017"],
    ["vmin", "10:2015"],
    ["vw", "10:2015"],
]);
export const selectors = new Map([
    ["active-view-transition", "5:2025"],
    ["active-view-transition-type", "5:2026"],
    ["autofill", "0:"],
    ["defined", "10:2020"],
    ["backdrop", "10:2022"],
    ["after", "10:2015"],
    ["before", "10:2015"],
    ["column", "0:"],
    ["checkmark", "0:"],
    ["picker", "0:"],
    ["picker-icon", "0:"],
    ["default", "10:2020"],
    ["details-content", "5:2025"],
    ["dir", "10:2023"],
    ["empty", "10:2015"],
    ["file-selector-button", "10:2021"],
    ["first-letter", "10:2015"],
    ["first-line", "10:2015"],
    ["focus-visible", "10:2022"],
    ["focus-within", "10:2020"],
    ["in-range", "10:2015"],
    ["invalid", "10:2015"],
    ["optional", "10:2015"],
    ["out-of-range", "10:2015"],
    ["required", "10:2015"],
    ["valid", "10:2015"],
    ["fullscreen", "0:"],
    ["has", "10:2023"],
    ["has-slotted", "0:"],
    ["heading", "0:"],
    ["headingfunction", "0:"],
    ["highlight", "5:2026"],
    ["host", "10:2020"],
    ["hostfunction", "10:2020"],
    ["host-context", "0:"],
    ["indeterminate", "10:2015"],
    ["checked", "10:2015"],
    ["disabled", "10:2015"],
    ["enabled", "10:2015"],
    ["interest-source", "0:"],
    ["interest-target", "0:"],
    ["is", "10:2021"],
    ["lang", "10:2015"],
    ["any-link", "10:2020"],
    ["link", "10:2015"],
    ["visited", "10:2015"],
    ["marker", "0:"],
    ["buffering", "0:"],
    ["muted", "0:"],
    ["paused", "0:"],
    ["playing", "0:"],
    ["seeking", "0:"],
    ["stalled", "0:"],
    ["volume-locked", "0:"],
    ["modal", "10:2022"],
    ["namespace", "10:2015"],
    ["nesting", "10:2023"],
    ["not", "10:2015"],
    ["first-child", "10:2015"],
    ["last-child", "10:2015"],
    ["nth-child", "10:2015"],
    ["nth-last-child", "10:2015"],
    ["only-child", "10:2015"],
    ["first-of-type", "10:2015"],
    ["last-of-type", "10:2015"],
    ["nth-last-of-type", "10:2015"],
    ["nth-of-type", "10:2015"],
    ["only-of-type", "10:2015"],
    ["open", "5:2026"],
    ["first", "10:2023"],
    ["left", "0:"],
    ["right", "0:"],
    ["picture-in-picture", "0:"],
    ["placeholder", "10:2020"],
    ["placeholder-shown", "10:2020"],
    ["popover-open", "5:2024"],
    ["read-only", "10:2020"],
    ["read-write", "10:2020"],
    ["root", "10:2015"],
    ["scope", "10:2020"],
    ["scroll-button", "0:"],
    ["target-after", "0:"],
    ["target-before", "0:"],
    ["target-current", "0:"],
    ["scroll-marker", "0:"],
    ["scroll-marker-group", "0:"],
    ["selection", "0:"],
    ["attribute", "10:2015"],
    ["child", "10:2015"],
    ["class", "10:2015"],
    ["descendant", "10:2015"],
    ["id", "10:2015"],
    ["list", "10:2015"],
    ["next-sibling", "10:2015"],
    ["subsequent-sibling", "10:2015"],
    ["type", "10:2015"],
    ["universal", "10:2015"],
    ["part", "10:2020"],
    ["slotted", "10:2020"],
    ["grammar-error", "0:"],
    ["spelling-error", "0:"],
    ["state", "5:2024"],
    ["target", "10:2015"],
    ["target-text", "5:2024"],
    ["future", "0:"],
    ["past", "0:"],
    ["active", "10:2015"],
    ["focus", "10:2015"],
    ["hover", "10:2015"],
    ["user-invalid", "10:2023"],
    ["user-valid", "10:2023"],
    ["view-transition", "5:2025"],
    ["view-transition-group", "5:2025"],
    ["view-transition-image-pair", "5:2025"],
    ["view-transition-new", "5:2025"],
    ["view-transition-old", "5:2025"],
    ["cue", "10:2020"],
    ["xr-overlay", "0:"],
    ["where", "10:2021"],
]);
export const propertyValues = new Map([
    [
        "position",
        new Map([
            ["absolute", "10:2015"],
            ["fixed", "10:2015"],
            ["relative", "10:2015"],
            ["static", "10:2015"],
            ["sticky", "10:2019"],
        ]),
    ],
    [
        "accent-color",
        new Map([
            ["auto", "0:"],
            ["currentColor", "0:"],
            ["transparent", "0:"],
        ]),
    ],
    [
        "alignment-baseline",
        new Map([
            ["alphabetic", "0:"],
            ["baseline", "5:2026"],
            ["central", "0:"],
            ["ideographic", "0:"],
            ["mathematical", "0:"],
            ["middle", "5:2026"],
            ["text-after-edge", "0:"],
            ["text-before-edge", "0:"],
        ]),
    ],
    ["align-items", new Map([["anchor-center", "5:2026"]])],
    [
        "align-self",
        new Map([
            ["anchor-center", "5:2026"],
            ["auto", "10:2020"],
            ["normal", "10:2020"],
            ["stretch", "10:2020"],
        ]),
    ],
    ["anchor-name", new Map([["none", "5:2026"]])],
    [
        "anchor-scope",
        new Map([
            ["all", "5:2026"],
            ["none", "5:2026"],
        ]),
    ],
    [
        "block-size",
        new Map([
            ["anchor-size", "5:2026"],
            ["fit-content", "10:2021"],
            ["max-content", "10:2020"],
            ["min-content", "10:2020"],
        ]),
    ],
    [
        "bottom",
        new Map([
            ["anchor", "5:2026"],
            ["anchor-size", "5:2026"],
            ["auto", "10:2015"],
        ]),
    ],
    [
        "height",
        new Map([
            ["anchor-size", "5:2026"],
            ["fit-content", "10:2021"],
            ["max-content", "10:2020"],
            ["min-content", "10:2020"],
            ["stretch", "0:"],
            ["auto", "10:2015"],
        ]),
    ],
    [
        "inline-size",
        new Map([
            ["anchor-size", "5:2026"],
            ["fit-content", "10:2021"],
            ["max-content", "10:2020"],
            ["min-content", "10:2020"],
        ]),
    ],
    [
        "inset-block-end",
        new Map([
            ["anchor", "5:2026"],
            ["anchor-size", "5:2026"],
            ["auto", "10:2021"],
        ]),
    ],
    [
        "inset-block-start",
        new Map([
            ["anchor", "5:2026"],
            ["anchor-size", "5:2026"],
            ["auto", "10:2021"],
        ]),
    ],
    [
        "inset-block",
        new Map([
            ["anchor", "5:2026"],
            ["anchor-size", "5:2026"],
            ["auto", "10:2021"],
        ]),
    ],
    [
        "inset-inline-end",
        new Map([
            ["anchor", "5:2026"],
            ["anchor-size", "5:2026"],
            ["auto", "10:2021"],
        ]),
    ],
    [
        "inset-inline-start",
        new Map([
            ["anchor", "5:2026"],
            ["anchor-size", "5:2026"],
            ["auto", "10:2021"],
        ]),
    ],
    [
        "inset-inline",
        new Map([
            ["anchor", "5:2026"],
            ["anchor-size", "5:2026"],
            ["auto", "10:2021"],
        ]),
    ],
    [
        "inset",
        new Map([
            ["anchor", "5:2026"],
            ["anchor-size", "5:2026"],
            ["auto", "10:2021"],
        ]),
    ],
    [
        "justify-items",
        new Map([
            ["anchor-center", "5:2026"],
            ["center", "10:2020"],
            ["left", "10:2020"],
            ["legacy", "10:2020"],
            ["right", "10:2020"],
        ]),
    ],
    [
        "justify-self",
        new Map([
            ["anchor-center", "5:2026"],
            ["auto", "10:2020"],
            ["left", "10:2020"],
            ["normal", "10:2020"],
            ["right", "10:2020"],
            ["stretch", "10:2020"],
        ]),
    ],
    [
        "left",
        new Map([
            ["anchor", "5:2026"],
            ["anchor-size", "5:2026"],
            ["auto", "10:2015"],
        ]),
    ],
    ["margin-block-end", new Map([["anchor-size", "5:2026"]])],
    ["margin-block-start", new Map([["anchor-size", "5:2026"]])],
    ["margin-block", new Map([["anchor-size", "5:2026"]])],
    [
        "margin-bottom",
        new Map([
            ["anchor-size", "5:2026"],
            ["auto", "10:2015"],
        ]),
    ],
    ["margin-inline-end", new Map([["anchor-size", "5:2026"]])],
    ["margin-inline-start", new Map([["anchor-size", "5:2026"]])],
    ["margin-inline", new Map([["anchor-size", "5:2026"]])],
    [
        "margin-left",
        new Map([
            ["anchor-size", "5:2026"],
            ["auto", "10:2015"],
        ]),
    ],
    [
        "margin-right",
        new Map([
            ["anchor-size", "5:2026"],
            ["auto", "10:2015"],
        ]),
    ],
    [
        "margin-top",
        new Map([
            ["anchor-size", "5:2026"],
            ["auto", "10:2015"],
        ]),
    ],
    [
        "margin",
        new Map([
            ["anchor-size", "5:2026"],
            ["auto", "10:2015"],
        ]),
    ],
    [
        "max-block-size",
        new Map([
            ["anchor-size", "5:2026"],
            ["fit-content", "10:2021"],
            ["max-content", "10:2020"],
            ["min-content", "10:2020"],
        ]),
    ],
    [
        "max-height",
        new Map([
            ["anchor-size", "5:2026"],
            ["fit-content", "10:2021"],
            ["max-content", "10:2020"],
            ["min-content", "10:2020"],
            ["none", "10:2015"],
            ["stretch", "0:"],
        ]),
    ],
    [
        "max-inline-size",
        new Map([
            ["anchor-size", "5:2026"],
            ["fit-content", "10:2021"],
            ["max-content", "10:2020"],
            ["min-content", "10:2020"],
        ]),
    ],
    [
        "max-width",
        new Map([
            ["anchor-size", "5:2026"],
            ["fit-content", "10:2021"],
            ["max-content", "10:2020"],
            ["min-content", "10:2020"],
            ["none", "10:2015"],
            ["stretch", "0:"],
        ]),
    ],
    [
        "min-block-size",
        new Map([
            ["anchor-size", "5:2026"],
            ["fit-content", "10:2021"],
            ["max-content", "10:2020"],
            ["min-content", "10:2020"],
        ]),
    ],
    [
        "min-height",
        new Map([
            ["anchor-size", "5:2026"],
            ["fit-content", "10:2021"],
            ["max-content", "10:2020"],
            ["min-content", "10:2020"],
            ["auto", "10:2015"],
            ["stretch", "0:"],
        ]),
    ],
    [
        "min-inline-size",
        new Map([
            ["anchor-size", "5:2026"],
            ["fit-content", "10:2021"],
            ["max-content", "10:2020"],
            ["min-content", "10:2020"],
        ]),
    ],
    [
        "min-width",
        new Map([
            ["anchor-size", "5:2026"],
            ["fit-content", "10:2021"],
            ["max-content", "10:2020"],
            ["min-content", "10:2020"],
            ["auto", "10:2015"],
            ["stretch", "0:"],
        ]),
    ],
    ["place-items", new Map([["anchor-center", "5:2026"]])],
    ["place-self", new Map([["anchor-center", "5:2026"]])],
    [
        "position-anchor",
        new Map([
            ["auto", "0:"],
            ["none", "0:"],
            ["normal", "0:"],
        ]),
    ],
    [
        "position-area",
        new Map([
            ["block-end", "5:2026"],
            ["block-start", "5:2026"],
            ["bottom", "5:2026"],
            ["center", "5:2026"],
            ["end", "5:2026"],
            ["inline-end", "5:2026"],
            ["inline-start", "5:2026"],
            ["left", "5:2026"],
            ["none", "5:2026"],
            ["right", "5:2026"],
            ["self-block-end", "5:2026"],
            ["self-block-start", "5:2026"],
            ["self-end", "5:2026"],
            ["self-inline-end", "5:2026"],
            ["self-inline-start", "5:2026"],
            ["self-start", "5:2026"],
            ["self-x-end", "5:2026"],
            ["self-x-start", "5:2026"],
            ["self-y-end", "5:2026"],
            ["self-y-start", "5:2026"],
            ["span-all", "5:2026"],
            ["span-block-end", "5:2026"],
            ["span-block-start", "5:2026"],
            ["span-bottom", "5:2026"],
            ["span-end", "5:2026"],
            ["span-inline-end", "5:2026"],
            ["span-inline-start", "5:2026"],
            ["span-left", "5:2026"],
            ["span-right", "5:2026"],
            ["span-self-block-end", "5:2026"],
            ["span-self-block-start", "5:2026"],
            ["span-self-end", "5:2026"],
            ["span-self-inline-end", "5:2026"],
            ["span-self-inline-start", "5:2026"],
            ["span-self-start", "5:2026"],
            ["span-self-x-end", "5:2026"],
            ["span-self-x-start", "5:2026"],
            ["span-self-y-end", "5:2026"],
            ["span-self-y-start", "5:2026"],
            ["span-start", "5:2026"],
            ["span-top", "5:2026"],
            ["span-x-end", "5:2026"],
            ["span-x-start", "5:2026"],
            ["span-y-end", "5:2026"],
            ["span-y-start", "5:2026"],
            ["start", "5:2026"],
            ["top", "5:2026"],
            ["x-end", "5:2026"],
            ["x-start", "5:2026"],
            ["y-end", "5:2026"],
            ["y-start", "5:2026"],
        ]),
    ],
    [
        "position-try-fallbacks",
        new Map([
            ["block-end", "5:2026"],
            ["block-start", "5:2026"],
            ["bottom", "5:2026"],
            ["center", "5:2026"],
            ["end", "5:2026"],
            ["flip-block", "5:2026"],
            ["flip-inline", "5:2026"],
            ["flip-start", "5:2026"],
            ["flip-x", "5:2026"],
            ["flip-y", "5:2026"],
            ["inline-end", "5:2026"],
            ["inline-start", "5:2026"],
            ["left", "5:2026"],
            ["none", "5:2026"],
            ["position-area", "5:2026"],
            ["right", "5:2026"],
            ["self-block-end", "5:2026"],
            ["self-block-start", "5:2026"],
            ["self-end", "5:2026"],
            ["self-inline-end", "5:2026"],
            ["self-inline-start", "5:2026"],
            ["self-start", "5:2026"],
            ["self-x-end", "5:2026"],
            ["self-x-start", "5:2026"],
            ["self-y-end", "5:2026"],
            ["self-y-start", "5:2026"],
            ["span-all", "5:2026"],
            ["span-block-end", "5:2026"],
            ["span-block-start", "5:2026"],
            ["span-bottom", "5:2026"],
            ["span-end", "5:2026"],
            ["span-inline-end", "5:2026"],
            ["span-inline-start", "5:2026"],
            ["span-left", "5:2026"],
            ["span-right", "5:2026"],
            ["span-self-block-end", "5:2026"],
            ["span-self-block-start", "5:2026"],
            ["span-self-end", "5:2026"],
            ["span-self-inline-end", "5:2026"],
            ["span-self-inline-start", "5:2026"],
            ["span-self-start", "5:2026"],
            ["span-self-x-end", "5:2026"],
            ["span-self-x-start", "5:2026"],
            ["span-self-y-end", "5:2026"],
            ["span-self-y-start", "5:2026"],
            ["span-start", "5:2026"],
            ["span-top", "5:2026"],
            ["span-x-end", "5:2026"],
            ["span-x-start", "5:2026"],
            ["span-y-end", "5:2026"],
            ["span-y-start", "5:2026"],
            ["start", "5:2026"],
            ["top", "5:2026"],
            ["x-end", "5:2026"],
            ["x-start", "5:2026"],
            ["y-end", "5:2026"],
            ["y-start", "5:2026"],
        ]),
    ],
    [
        "position-try-order",
        new Map([
            ["most-block-size", "5:2026"],
            ["most-height", "5:2026"],
            ["most-inline-size", "5:2026"],
            ["most-width", "5:2026"],
            ["normal", "5:2026"],
        ]),
    ],
    [
        "position-try",
        new Map([
            ["block-end", "5:2026"],
            ["block-start", "5:2026"],
            ["bottom", "5:2026"],
            ["center", "5:2026"],
            ["end", "5:2026"],
            ["flip-block", "5:2026"],
            ["flip-inline", "5:2026"],
            ["flip-start", "5:2026"],
            ["flip-x", "5:2026"],
            ["flip-y", "5:2026"],
            ["inline-end", "5:2026"],
            ["inline-start", "5:2026"],
            ["left", "5:2026"],
            ["none", "5:2026"],
            ["right", "5:2026"],
            ["self-block-end", "5:2026"],
            ["self-block-start", "5:2026"],
            ["self-end", "5:2026"],
            ["self-inline-end", "5:2026"],
            ["self-inline-start", "5:2026"],
            ["self-start", "5:2026"],
            ["self-x-end", "5:2026"],
            ["self-x-start", "5:2026"],
            ["self-y-end", "5:2026"],
            ["self-y-start", "5:2026"],
            ["span-all", "5:2026"],
            ["span-block-end", "5:2026"],
            ["span-block-start", "5:2026"],
            ["span-bottom", "5:2026"],
            ["span-end", "5:2026"],
            ["span-inline-end", "5:2026"],
            ["span-inline-start", "5:2026"],
            ["span-left", "5:2026"],
            ["span-right", "5:2026"],
            ["span-self-block-end", "5:2026"],
            ["span-self-block-start", "5:2026"],
            ["span-self-end", "5:2026"],
            ["span-self-inline-end", "5:2026"],
            ["span-self-inline-start", "5:2026"],
            ["span-self-start", "5:2026"],
            ["span-self-x-end", "5:2026"],
            ["span-self-x-start", "5:2026"],
            ["span-self-y-end", "5:2026"],
            ["span-self-y-start", "5:2026"],
            ["span-start", "5:2026"],
            ["span-top", "5:2026"],
            ["span-x-end", "5:2026"],
            ["span-x-start", "5:2026"],
            ["span-y-end", "5:2026"],
            ["span-y-start", "5:2026"],
            ["start", "5:2026"],
            ["top", "5:2026"],
            ["x-end", "5:2026"],
            ["x-start", "5:2026"],
            ["y-end", "5:2026"],
            ["y-start", "5:2026"],
        ]),
    ],
    [
        "position-visibility",
        new Map([
            ["always", "5:2026"],
            ["anchors-valid", "0:"],
            ["anchors-visible", "5:2026"],
            ["no-overflow", "5:2026"],
        ]),
    ],
    [
        "right",
        new Map([
            ["anchor", "5:2026"],
            ["anchor-size", "5:2026"],
            ["auto", "10:2015"],
        ]),
    ],
    [
        "top",
        new Map([
            ["anchor", "5:2026"],
            ["anchor-size", "5:2026"],
            ["auto", "10:2015"],
        ]),
    ],
    [
        "width",
        new Map([
            ["anchor-size", "5:2026"],
            ["fit-content", "10:2021"],
            ["max-content", "10:2020"],
            ["min-content", "10:2020"],
            ["stretch", "0:"],
            ["auto", "10:2015"],
        ]),
    ],
    [
        "animation-direction",
        new Map([
            ["alternate", "10:2015"],
            ["alternate-reverse", "10:2015"],
            ["normal", "10:2015"],
            ["reverse", "10:2015"],
        ]),
    ],
    ["animation-duration", new Map([["auto", "0:"]])],
    [
        "animation-fill-mode",
        new Map([
            ["backwards", "10:2015"],
            ["both", "10:2015"],
            ["forwards", "10:2015"],
            ["none", "10:2015"],
        ]),
    ],
    ["animation-iteration-count", new Map([["infinite", "10:2015"]])],
    ["animation-name", new Map([["none", "10:2015"]])],
    [
        "animation-play-state",
        new Map([
            ["paused", "10:2015"],
            ["running", "10:2015"],
        ]),
    ],
    [
        "animation-timing-function",
        new Map([
            ["ease", "10:2015"],
            ["ease-in", "10:2015"],
            ["ease-in-out", "10:2015"],
            ["ease-out", "10:2015"],
            ["jump", "10:2020"],
            ["linear", "10:2015"],
            ["step-end", "10:2015"],
            ["step-start", "10:2015"],
        ]),
    ],
    [
        "animation",
        new Map([
            ["alternate", "10:2015"],
            ["alternate-reverse", "10:2015"],
            ["auto", "10:2015"],
            ["backwards", "10:2015"],
            ["both", "10:2015"],
            ["ease", "10:2015"],
            ["ease-in", "10:2015"],
            ["ease-in-out", "10:2015"],
            ["ease-out", "10:2015"],
            ["forwards", "10:2015"],
            ["infinite", "10:2015"],
            ["linear", "10:2015"],
            ["none", "10:2015"],
            ["normal", "10:2015"],
            ["reverse", "10:2015"],
            ["step-end", "10:2015"],
            ["step-start", "10:2015"],
        ]),
    ],
    [
        "appearance",
        new Map([
            ["auto", "10:2022"],
            ["button", "10:2022"],
            ["checkbox", "10:2022"],
            ["listbox", "10:2022"],
            ["menulist", "10:2022"],
            ["menulist-button", "10:2022"],
            ["meter", "10:2022"],
            ["none", "10:2022"],
            ["progress-bar", "10:2022"],
            ["radio", "10:2022"],
            ["searchfield", "10:2022"],
            ["textarea", "10:2022"],
            ["textfield", "10:2022"],
            ["base-select", "0:"],
        ]),
    ],
    ["aspect-ratio", new Map([["auto", "10:2021"]])],
    [
        "background",
        new Map([
            ["local", "10:2015"],
            ["no-repeat", "10:2015"],
            ["none", "10:2015"],
            ["repeat", "10:2015"],
            ["repeat-x", "10:2015"],
            ["repeat-y", "10:2015"],
            ["round", "10:2015"],
            ["scroll", "10:2015"],
            ["space", "10:2015"],
            ["transparent", "10:2015"],
            ["background-clip", "10:2015"],
            ["background-origin", "10:2015"],
            ["background-size", "10:2015"],
            ["currentColor", "10:2015"],
        ]),
    ],
    [
        "background-attachment",
        new Map([
            ["fixed", "0:"],
            ["local", "10:2022"],
            ["scroll", "10:2015"],
        ]),
    ],
    [
        "background-clip",
        new Map([
            ["border-box", "10:2015"],
            ["content-box", "10:2015"],
            ["padding-box", "10:2015"],
            ["border-area", "0:"],
            ["text", "0:"],
        ]),
    ],
    [
        "background-color",
        new Map([
            ["transparent", "10:2015"],
            ["currentColor", "10:2015"],
        ]),
    ],
    [
        "background-image",
        new Map([
            ["none", "10:2015"],
            ["element", "0:"],
            ["gradients", "10:2015"],
            ["image-set", "10:2023"],
        ]),
    ],
    [
        "background-origin",
        new Map([
            ["border-box", "10:2015"],
            ["content-box", "10:2015"],
            ["padding-box", "10:2015"],
        ]),
    ],
    [
        "background-position",
        new Map([
            ["bottom", "10:2020"],
            ["center", "10:2020"],
            ["left", "10:2020"],
            ["right", "10:2020"],
            ["top", "10:2020"],
        ]),
    ],
    [
        "background-repeat",
        new Map([
            ["2-value", "10:2015"],
            ["no-repeat", "10:2015"],
            ["repeat", "10:2015"],
            ["repeat-x", "10:2015"],
            ["repeat-y", "10:2015"],
            ["round", "10:2016"],
            ["space", "10:2016"],
        ]),
    ],
    [
        "background-size",
        new Map([
            ["auto", "10:2015"],
            ["contain", "10:2015"],
            ["cover", "10:2015"],
        ]),
    ],
    [
        "baseline-shift",
        new Map([
            ["sub", "5:2026"],
            ["super", "5:2026"],
        ]),
    ],
    [
        "baseline-source",
        new Map([
            ["auto", "0:"],
            ["first", "0:"],
            ["last", "0:"],
        ]),
    ],
    [
        "border-image-repeat",
        new Map([
            ["repeat", "10:2016"],
            ["round", "10:2016"],
            ["space", "10:2017"],
            ["stretch", "10:2016"],
        ]),
    ],
    ["border-image-width", new Map([["auto", "10:2015"]])],
    [
        "border-image",
        new Map([
            ["fill", "10:2015"],
            ["gradient", "10:2015"],
            ["none", "10:2015"],
            ["repeat", "10:2015"],
            ["round", "10:2015"],
            ["space", "10:2015"],
            ["stretch", "10:2015"],
        ]),
    ],
    ["border-bottom-left-radius", new Map([["percentages", "10:2015"]])],
    ["border-bottom-right-radius", new Map([["percentages", "10:2015"]])],
    ["border-radius", new Map([["percentages", "10:2015"]])],
    ["border-top-left-radius", new Map([["percentages", "10:2015"]])],
    ["border-top-right-radius", new Map([["percentages", "10:2015"]])],
    ["border-shape", new Map([["none", "0:"]])],
    [
        "border-bottom-color",
        new Map([
            ["transparent", "10:2015"],
            ["currentColor", "10:2015"],
        ]),
    ],
    [
        "border-bottom-style",
        new Map([
            ["dashed", "10:2015"],
            ["dotted", "10:2015"],
            ["double", "10:2015"],
            ["groove", "10:2015"],
            ["hidden", "10:2015"],
            ["inset", "10:2015"],
            ["none", "10:2015"],
            ["outset", "10:2015"],
            ["ridge", "10:2015"],
            ["solid", "10:2015"],
        ]),
    ],
    [
        "border-bottom-width",
        new Map([
            ["medium", "10:2015"],
            ["thick", "10:2015"],
            ["thin", "10:2015"],
        ]),
    ],
    [
        "border-bottom",
        new Map([
            ["dashed", "10:2015"],
            ["dotted", "10:2015"],
            ["double", "10:2015"],
            ["groove", "10:2015"],
            ["hidden", "10:2015"],
            ["inset", "10:2015"],
            ["medium", "10:2015"],
            ["none", "10:2015"],
            ["outset", "10:2015"],
            ["ridge", "10:2015"],
            ["solid", "10:2015"],
            ["thick", "10:2015"],
            ["thin", "10:2015"],
            ["transparent", "10:2015"],
            ["currentColor", "10:2015"],
        ]),
    ],
    [
        "border-color",
        new Map([
            ["transparent", "10:2015"],
            ["currentColor", "10:2015"],
        ]),
    ],
    [
        "border-left-color",
        new Map([
            ["transparent", "10:2015"],
            ["currentColor", "10:2015"],
        ]),
    ],
    [
        "border-left-style",
        new Map([
            ["dashed", "10:2015"],
            ["dotted", "10:2015"],
            ["double", "10:2015"],
            ["groove", "10:2015"],
            ["hidden", "10:2015"],
            ["inset", "10:2015"],
            ["none", "10:2015"],
            ["outset", "10:2015"],
            ["ridge", "10:2015"],
            ["solid", "10:2015"],
        ]),
    ],
    [
        "border-left-width",
        new Map([
            ["medium", "10:2015"],
            ["thick", "10:2015"],
            ["thin", "10:2015"],
        ]),
    ],
    [
        "border-left",
        new Map([
            ["dashed", "10:2015"],
            ["dotted", "10:2015"],
            ["double", "10:2015"],
            ["groove", "10:2015"],
            ["hidden", "10:2015"],
            ["inset", "10:2015"],
            ["medium", "10:2015"],
            ["none", "10:2015"],
            ["outset", "10:2015"],
            ["ridge", "10:2015"],
            ["solid", "10:2015"],
            ["thick", "10:2015"],
            ["thin", "10:2015"],
            ["transparent", "10:2015"],
            ["currentColor", "10:2015"],
        ]),
    ],
    [
        "border-right-color",
        new Map([
            ["transparent", "10:2015"],
            ["currentColor", "10:2015"],
        ]),
    ],
    [
        "border-right-style",
        new Map([
            ["dashed", "10:2015"],
            ["dotted", "10:2015"],
            ["double", "10:2015"],
            ["groove", "10:2015"],
            ["hidden", "10:2015"],
            ["inset", "10:2015"],
            ["none", "10:2015"],
            ["outset", "10:2015"],
            ["ridge", "10:2015"],
            ["solid", "10:2015"],
        ]),
    ],
    [
        "border-right-width",
        new Map([
            ["medium", "10:2015"],
            ["thick", "10:2015"],
            ["thin", "10:2015"],
        ]),
    ],
    [
        "border-right",
        new Map([
            ["dashed", "10:2015"],
            ["dotted", "10:2015"],
            ["double", "10:2015"],
            ["groove", "10:2015"],
            ["hidden", "10:2015"],
            ["inset", "10:2015"],
            ["medium", "10:2015"],
            ["none", "10:2015"],
            ["outset", "10:2015"],
            ["ridge", "10:2015"],
            ["solid", "10:2015"],
            ["thick", "10:2015"],
            ["thin", "10:2015"],
            ["transparent", "10:2015"],
            ["currentColor", "10:2015"],
        ]),
    ],
    [
        "border-style",
        new Map([
            ["dashed", "10:2015"],
            ["dotted", "10:2015"],
            ["double", "10:2015"],
            ["groove", "10:2015"],
            ["hidden", "10:2015"],
            ["inset", "10:2015"],
            ["none", "10:2015"],
            ["outset", "10:2015"],
            ["ridge", "10:2015"],
            ["solid", "10:2015"],
        ]),
    ],
    [
        "border-top-color",
        new Map([
            ["transparent", "10:2015"],
            ["currentColor", "10:2015"],
        ]),
    ],
    [
        "border-top-style",
        new Map([
            ["dashed", "10:2015"],
            ["dotted", "10:2015"],
            ["double", "10:2015"],
            ["groove", "10:2015"],
            ["hidden", "10:2015"],
            ["inset", "10:2015"],
            ["none", "10:2015"],
            ["outset", "10:2015"],
            ["ridge", "10:2015"],
            ["solid", "10:2015"],
        ]),
    ],
    [
        "border-top-width",
        new Map([
            ["medium", "10:2015"],
            ["thick", "10:2015"],
            ["thin", "10:2015"],
        ]),
    ],
    [
        "border-top",
        new Map([
            ["dashed", "10:2015"],
            ["dotted", "10:2015"],
            ["double", "10:2015"],
            ["groove", "10:2015"],
            ["hidden", "10:2015"],
            ["inset", "10:2015"],
            ["medium", "10:2015"],
            ["none", "10:2015"],
            ["outset", "10:2015"],
            ["ridge", "10:2015"],
            ["solid", "10:2015"],
            ["thick", "10:2015"],
            ["thin", "10:2015"],
            ["transparent", "10:2015"],
            ["currentColor", "10:2015"],
        ]),
    ],
    [
        "border-width",
        new Map([
            ["medium", "10:2015"],
            ["thick", "10:2015"],
            ["thin", "10:2015"],
        ]),
    ],
    [
        "border",
        new Map([
            ["dashed", "10:2015"],
            ["dotted", "10:2015"],
            ["double", "10:2015"],
            ["groove", "10:2015"],
            ["hidden", "10:2015"],
            ["inset", "10:2015"],
            ["medium", "10:2015"],
            ["none", "10:2015"],
            ["outset", "10:2015"],
            ["ridge", "10:2015"],
            ["solid", "10:2015"],
            ["thick", "10:2015"],
            ["thin", "10:2015"],
            ["transparent", "10:2015"],
            ["currentColor", "10:2015"],
        ]),
    ],
    [
        "box-decoration-break",
        new Map([
            ["clone", "0:"],
            ["slice", "0:"],
        ]),
    ],
    [
        "box-shadow",
        new Map([
            ["inset", "10:2015"],
            ["none", "10:2015"],
        ]),
    ],
    [
        "box-sizing",
        new Map([
            ["border-box", "10:2015"],
            ["content-box", "10:2015"],
        ]),
    ],
    [
        "caret-color",
        new Map([
            ["currentColor", "10:2020"],
            ["transparent", "10:2020"],
        ]),
    ],
    [
        "caret-shape",
        new Map([
            ["auto", "0:"],
            ["bar", "0:"],
            ["block", "0:"],
            ["underscore", "0:"],
        ]),
    ],
    ["clip", new Map([["auto", "0:"]])],
    [
        "clip-path",
        new Map([
            ["path", "10:2021"],
            ["fill-box", "10:2023"],
            ["stroke-box", "10:2023"],
            ["view-box", "10:2023"],
        ]),
    ],
    [
        "color",
        new Map([
            ["transparent", "10:2015"],
            ["currentColor", "10:2015"],
        ]),
    ],
    [
        "color-scheme",
        new Map([
            ["dark", "10:2022"],
            ["light", "10:2022"],
            ["normal", "10:2022"],
            ["only", "10:2022"],
        ]),
    ],
    [
        "break-after",
        new Map([
            ["avoid-column", "0:"],
            ["column", "0:"],
            ["always", "0:"],
            ["auto", "10:2020"],
            ["avoid", "0:"],
            ["avoid-page", "0:"],
            ["left", "10:2020"],
            ["page", "10:2020"],
            ["recto", "0:"],
            ["right", "10:2020"],
            ["verso", "0:"],
        ]),
    ],
    [
        "break-before",
        new Map([
            ["avoid-column", "0:"],
            ["column", "0:"],
            ["always", "0:"],
            ["auto", "10:2020"],
            ["avoid", "0:"],
            ["avoid-page", "0:"],
            ["left", "10:2020"],
            ["page", "10:2020"],
            ["recto", "0:"],
            ["right", "10:2020"],
            ["verso", "0:"],
        ]),
    ],
    [
        "break-inside",
        new Map([
            ["avoid-column", "10:2021"],
            ["auto", "10:2020"],
            ["avoid", "10:2020"],
            ["avoid-page", "10:2021"],
        ]),
    ],
    [
        "column-fill",
        new Map([
            ["auto", "10:2017"],
            ["balance", "10:2017"],
        ]),
    ],
    [
        "column-span",
        new Map([
            ["all", "10:2020"],
            ["none", "10:2020"],
        ]),
    ],
    [
        "contain",
        new Map([
            ["content", "10:2022"],
            ["none", "10:2022"],
            ["strict", "10:2022"],
            ["inline-size", "10:2022"],
            ["layout", "10:2022"],
            ["paint", "10:2022"],
            ["size", "10:2022"],
            ["style", "10:2022"],
        ]),
    ],
    ["contain-intrinsic-block-size", new Map([["none", "10:2023"]])],
    ["contain-intrinsic-height", new Map([["none", "10:2023"]])],
    ["contain-intrinsic-inline-size", new Map([["none", "10:2023"]])],
    ["contain-intrinsic-size", new Map([["none", "10:2023"]])],
    ["contain-intrinsic-width", new Map([["none", "10:2023"]])],
    [
        "container-type",
        new Map([
            ["anchored", "0:"],
            ["inline-size", "10:2023"],
            ["normal", "10:2023"],
            ["size", "10:2023"],
            ["scroll-state", "0:"],
        ]),
    ],
    ["container-name", new Map([["none", "10:2023"]])],
    [
        "content",
        new Map([
            ["close-quote", "10:2015"],
            ["gradient", "0:"],
            ["no-close-quote", "10:2015"],
            ["no-open-quote", "10:2015"],
            ["none", "10:2015"],
            ["normal", "10:2015"],
            ["open-quote", "10:2015"],
            ["url", "10:2015"],
            ["image-set", "10:2023"],
        ]),
    ],
    [
        "content-visibility",
        new Map([
            ["auto", "5:2025"],
            ["hidden", "5:2024"],
            ["visible", "5:2024"],
        ]),
    ],
    [
        "counter-reset",
        new Map([
            ["reversed", "0:"],
            ["list-item", "0:"],
            ["none", "10:2015"],
        ]),
    ],
    [
        "counter-set",
        new Map([
            ["list-item", "10:2023"],
            ["none", "10:2023"],
        ]),
    ],
    [
        "counter-increment",
        new Map([
            ["list-item", "10:2015"],
            ["none", "10:2015"],
        ]),
    ],
    [
        "image-rendering",
        new Map([
            ["crisp-edges", "5:2026"],
            ["auto", "10:2020"],
            ["pixelated", "10:2021"],
            ["smooth", "0:"],
        ]),
    ],
    [
        "outline-color",
        new Map([
            ["currentColor", "10:2015"],
            ["transparent", "10:2015"],
        ]),
    ],
    [
        "text-overflow",
        new Map([
            ["string", "0:"],
            ["clip", "10:2015"],
            ["ellipsis", "10:2015"],
        ]),
    ],
    [
        "display",
        new Map([
            ["block", "10:2015"],
            ["inline", "10:2015"],
            ["inline-block", "10:2015"],
            ["none", "10:2015"],
            ["contents", "10:2020"],
            ["flow-root", "10:2020"],
            ["list-item", "10:2015"],
            ["ruby", "0:"],
            ["ruby-base", "0:"],
            ["ruby-base-container", "0:"],
            ["ruby-text", "0:"],
            ["ruby-text-container", "0:"],
            ["inline-table", "10:2015"],
            ["table", "10:2015"],
            ["table-caption", "10:2015"],
            ["table-cell", "10:2015"],
            ["table-column", "10:2015"],
            ["table-column-group", "10:2015"],
            ["table-footer-group", "10:2015"],
            ["table-header-group", "10:2015"],
            ["table-row", "10:2015"],
            ["table-row-group", "10:2015"],
            ["flex", "10:2015"],
            ["inline-flex", "10:2015"],
            ["grid", "10:2017"],
            ["inline-grid", "10:2017"],
            ["math", "0:"],
        ]),
    ],
    [
        "ruby-position",
        new Map([
            ["alternate", "0:"],
            ["inter-character", "0:"],
            ["over", "5:2024"],
            ["under", "5:2024"],
        ]),
    ],
    [
        "dominant-baseline",
        new Map([
            ["alphabetic", "10:2020"],
            ["auto", "10:2020"],
            ["central", "10:2020"],
            ["hanging", "10:2020"],
            ["ideographic", "10:2020"],
            ["mathematical", "10:2020"],
            ["middle", "10:2020"],
        ]),
    ],
    [
        "dynamic-range-limit",
        new Map([
            ["constrained", "0:"],
            ["no-limit", "0:"],
            ["standard", "0:"],
        ]),
    ],
    [
        "field-sizing",
        new Map([
            ["content", "5:2026"],
            ["fixed", "5:2026"],
        ]),
    ],
    [
        "filter",
        new Map([
            ["blur", "10:2016"],
            ["brightness", "10:2016"],
            ["contrast", "10:2016"],
            ["drop-shadow", "10:2016"],
            ["grayscale", "10:2016"],
            ["hue-rotate", "10:2016"],
            ["invert", "10:2016"],
            ["opacity", "10:2016"],
            ["saturate", "10:2016"],
            ["sepia", "10:2016"],
        ]),
    ],
    ["align-content", new Map([["normal", "10:2015"]])],
    [
        "flex-basis",
        new Map([
            ["auto", "10:2015"],
            ["content", "10:2022"],
            ["fit-content", "10:2022"],
            ["max-content", "10:2022"],
            ["min-content", "10:2022"],
        ]),
    ],
    [
        "flex-direction",
        new Map([
            ["column", "10:2015"],
            ["column-reverse", "10:2020"],
            ["row", "10:2015"],
            ["row-reverse", "10:2020"],
        ]),
    ],
    [
        "flex-wrap",
        new Map([
            ["nowrap", "10:2015"],
            ["wrap", "10:2015"],
            ["wrap-reverse", "10:2015"],
        ]),
    ],
    ["flex", new Map([["none", "10:2015"]])],
    [
        "justify-content",
        new Map([
            ["left", "10:2020"],
            ["normal", "10:2020"],
            ["right", "10:2020"],
        ]),
    ],
    [
        "clear",
        new Map([
            ["both", "10:2015"],
            ["left", "10:2015"],
            ["none", "10:2015"],
            ["right", "10:2015"],
   )5         ["inline-end", "10:2023"],
            ["inline-start", "10:2023"],
        ]),
    ],
    [
        "float",
        new Map([
            ["left", "10:2015"],
            ["none", "10:2015"],
            ["right", "10:2015"],
            ["inline-end", "10:2023"],
            ["inline-start", "10:2023"],
        ]),
    ],
    [
        "font-family",
        new Map([
            ["cursive", "10:2015"],
            ["fantasy", "10:2015"],
            ["monospace", "10:2015"],
            ["sans-serif", "10:2015"],
            ["serif", "10:2015"],
            ["math", "5:2026"],
            ["system-ui", "10:2021"],
            ["ui-monospace", "0:"],
            ["ui-rounded", "0:"],
            ["ui-sans-serif", "0:"],
            ["ui-serif", "0:"],
        ]),
    ],
    ["font-feature-settings", new Map([["normal", "10:2017"]])],
    [
        "font-kerning",
        new Map([
            ["auto", "10:2020"],
            ["none", "10:2020"],
            ["normal", "10:2020"],
        ]),
    ],
    [
        "font-optical-sizing",
        new Map([
            ["auto", "10:2020"],
            ["none", "10:2020"],
        ]),
    ],
    [
        "font-palette",
        new Map([
            ["dark", "10:2022"],
            ["light", "10:2022"],
            ["normal", "10:2022"],
        ]),
    ],
    [
        "font",
        new Map([
            ["caption", "10:2015"],
            ["icon", "10:2015"],
            ["menu", "10:2015"],
            ["message-box", "10:2015"],
            ["small-caption", "10:2015"],
            ["status-bar", "10:2015"],
        ]),
    ],
    [
        "font-size",
        new Map([
            ["xxx-large", "10:2023"],
            ["math", "5:2026"],
        ]),
    ],
    [
        "font-size-adjust",
        new Map([
            ["from-font", "5:2024"],
            ["none", "5:2024"],
            ["two-values", "5:2024"],
        ]),
    ],
    [
        "font-stretch",
        new Map([
            ["condensed", "10:2017"],
            ["expanded", "10:2017"],
            ["extra-condensed", "10:2017"],
            ["extra-expanded", "10:2017"],
            ["normal", "10:2017"],
            ["percentage", "10:2018"],
            ["semi-condensed", "10:2017"],
            ["semi-expanded", "10:2017"],
            ["ultra-condensed", "10:2017"],
            ["ultra-expanded", "10:2017"],
        ]),
    ],
    [
        "font-style",
        new Map([
            ["italic", "10:2015"],
            ["normal", "10:2015"],
            ["oblique", "10:2015"],
            ["oblique-angle", "0:"],
        ]),
    ],
    [
        "font-synthesis",
        new Map([
            ["position", "0:"],
            ["small-caps", "10:2022"],
            ["style", "10:2022"],
            ["weight", "10:2022"],
        ]),
    ],
    [
        "font-synthesis-position",
        new Map([
            ["auto", "0:"],
            ["none", "0:"],
        ]),
    ],
    [
        "font-synthesis-small-caps",
        new Map([
            ["auto", "10:2023"],
            ["none", "10:2023"],
        ]),
    ],
    [
        "font-synthesis-style",
        new Map([
            ["auto", "10:2023"],
            ["none", "10:2023"],
        ]),
    ],
    [
        "font-synthesis-weight",
        new Map([
            ["auto", "10:2023"],
            ["none", "10:2023"],
        ]),
    ],
    [
        "font-variant",
        new Map([
            ["historical-forms", "10:2023"],
            ["none", "10:2020"],
            ["normal", "10:2015"],
            ["sub", "10:2023"],
            ["super", "10:2023"],
        ]),
    ],
    [
        "font-variant-alternates",
        new Map([
            ["annotation", "10:2023"],
            ["historical-forms", "10:2023"],
            ["normal", "10:2023"],
            ["ornaments", "10:2023"],
            ["styleset", "10:2023"],
            ["stylistic", "10:2023"],
            ["swash", "10:2023"],
        ]),
    ],
    [
        "font-variant-caps",
        new Map([
            ["all-petite-caps", "10:2020"],
            ["all-small-caps", "10:2020"],
            ["normal", "10:2020"],
            ["petite-caps", "10:2020"],
            ["small-caps", "10:2020"],
            ["titling-caps", "10:2020"],
            ["unicase", "10:2020"],
        ]),
    ],
    [
        "font-variant-east-asian",
        new Map([
            ["full-width", "10:2020"],
            ["jis04", "10:2020"],
            ["jis78", "10:2020"],
            ["jis83", "10:2020"],
            ["jis90", "10:2020"],
            ["normal", "10:2020"],
            ["proportional-width", "10:2020"],
            ["ruby", "10:2020"],
            ["simplified", "10:2020"],
            ["traditional", "10:2020"],
        ]),
    ],
    [
        "font-variant-emoji",
        new Map([
            ["emoji", "0:"],
            ["normal", "0:"],
            ["text", "0:"],
            ["unicode", "0:"],
        ]),
    ],
    [
        "font-variant-ligatures",
        new Map([
            ["common-ligatures", "10:2020"],
            ["contextual", "10:2020"],
            ["discretionary-ligatures", "10:2020"],
            ["historical-ligatures", "10:2020"],
            ["no-common-ligatures", "10:2020"],
            ["no-contextual", "10:2020"],
            ["no-discretionary-ligatures", "10:2020"],
            ["no-historical-ligatures", "10:2020"],
            ["none", "10:2020"],
            ["normal", "10:2020"],
        ]),
    ],
    [
        "font-variant-numeric",
        new Map([
            ["diagonal-fractions", "10:2020"],
            ["lining-nums", "10:2020"],
            ["normal", "10:2020"],
            ["oldstyle-nums", "10:2020"],
            ["ordinal", "10:2020"],
            ["proportional-nums", "10:2020"],
            ["slashed-zero", "10:2020"],
            ["stacked-fractions", "10:2020"],
            ["tabular-nums", "10:2020"],
        ]),
    ],
    [
        "font-variant-position",
        new Map([
            ["normal", "10:2023"],
            ["sub", "0:"],
            ["super", "0:"],
        ]),
    ],
    [
        "font-weight",
        new Map([
            ["bold", "10:2015"],
            ["bolder", "10:2015"],
            ["lighter", "10:2015"],
            ["normal", "10:2015"],
            ["number", "10:2018"],
        ]),
    ],
    [
        "font-width",
        new Map([
            ["condensed", "0:"],
            ["expanded", "0:"],
            ["extra-condensed", "0:"],
            ["extra-expanded", "0:"],
            ["normal", "0:"],
            ["semi-condensed", "0:"],
            ["semi-expanded", "0:"],
            ["ultra-condensed", "0:"],
            ["ultra-expanded", "0:"],
        ]),
    ],
    [
        "forced-color-adjust",
        new Map([
            ["auto", "0:"],
            ["none", "0:"],
            ["preserve-parent-color", "0:"],
        ]),
    ],
    [
        "column-rule-break",
        new Map([
            ["intersection", "0:"],
            ["none", "0:"],
            ["normal", "0:"],
        ]),
    ],
    ["column-rule-inset-cap-end", new Map([["overlap-join", "0:"]])],
    ["column-rule-inset-cap-start", new Map([["overlap-join", "0:"]])],
    ["column-rule-inset-cap", new Map([["overlap-join", "0:"]])],
    ["column-rule-inset-end", new Map([["overlap-join", "0:"]])],
    ["column-rule-inset-junction-end", new Map([["overlap-join", "0:"]])],
    ["column-rule-inset-junction-start", new Map([["overlap-join", "0:"]])],
    ["column-rule-inset-junction", new Map([["overlap-join", "0:"]])],
    ["column-rule-inset-start", new Map([["overlap-join", "0:"]])],
    ["column-rule-inset", new Map([["overlap-join", "0:"]])],
    [
        "column-rule-visibility-items",
        new Map([
            ["all", "0:"],
            ["around", "0:"],
            ["between", "0:"],
            ["normal", "0:"],
        ]),
    ],
    [
        "row-rule-break",
        new Map([
            ["intersection", "0:"],
            ["none", "0:"],
            ["normal", "0:"],
        ]),
    ],
    [
        "row-rule-color",
        new Map([
            ["currentColor", "0:"],
            ["transparent", "0:"],
        ]),
    ],
    ["row-rule-inset-cap-end", new Map([["overlap-join", "0:"]])],
    ["row-rule-inset-cap-start", new Map([["overlap-join", "0:"]])],
    ["row-rule-inset-cap", new Map([["overlap-join", "0:"]])],
    ["row-rule-inset-end", new Map([["overlap-join", "0:"]])],
    ["row-rule-inset-junction-end", new Map([["overlap-join", "0:"]])],
    ["row-rule-inset-junction-start", new Map([["overlap-join", "0:"]])],
    ["row-rule-inset-junction", new Map([["overlap-join", "0:"]])],
    ["row-rule-inset-start", new Map([["overlap-join", "0:"]])],
    ["row-rule-inset", new Map([["overlap-join", "0:"]])],
    [
        "row-rule-style",
        new Map([
            ["dashed", "0:"],
            ["dotted", "0:"],
            ["double", "0:"],
            ["groove", "0:"],
            ["hidden", "0:"],
            ["inset", "0:"],
            ["none", "0:"],
            ["outset", "0:"],
            ["ridge", "0:"],
            ["solid", "0:"],
        ]),
    ],
    [
        "row-rule-visibility-items",
        new Map([
            ["all", "0:"],
            ["around", "0:"],
            ["between", "0:"],
            ["normal", "0:"],
        ]),
    ],
    [
        "row-rule-width",
        new Map([
            ["medium", "0:"],
            ["thick", "0:"],
            ["thin", "0:"],
        ]),
    ],
    [
        "row-rule",
        new Map([
            ["currentColor", "0:"],
            ["dashed", "0:"],
            ["dotted", "0:"],
            ["double", "0:"],
            ["groove", "0:"],
            ["hidden", "0:"],
            ["inset", "0:"],
            ["medium", "0:"],
            ["none", "0:"],
            ["outset", "0:"],
            ["ridge", "0:"],
            ["solid", "0:"],
            ["thick", "0:"],
            ["thin", "0:"],
            ["transparent", "0:"],
        ]),
    ],
    [
        "rule-break",
        new Map([
            ["intersection", "0:"],
            ["none", "0:"],
            ["normal", "0:"],
        ]),
    ],
    [
        "rule-color",
        new Map([
            ["currentColor", "0:"],
            ["transparent", "0:"],
        ]),
    ],
    ["rule-inset-cap", new Map([["overlap-join", "0:"]])],
    ["rule-inset-end", new Map([["overlap-join", "0:"]])],
    ["rule-inset-junction", new Map([["overlap-join", "0:"]])],
    ["rule-inset-start", new Map([["overlap-join", "0:"]])],
    ["rule-inset", new Map([["overlap-join", "0:"]])],
    [
        "rule-overlap",
        new Map([
            ["column-over-row", "0:"],
            ["row-over-column", "0:"],
        ]),
    ],
    [
        "rule-style",
        new Map([
            ["dashed", "0:"],
            ["dotted", "0:"],
            ["double", "0:"],
            ["groove", "0:"],
            ["hidden", "0:"],
            ["inset", "0:"],
            ["none", "0:"],
            ["outset", "0:"],
            ["ridge", "0:"],
            ["solid", "0:"],
        ]),
    ],
    [
        "rule-visibility-items",
        new Map([
            ["all", "0:"],
            ["around", "0:"],
            ["between", "0:"],
            ["normal", "0:"],
        ]),
    ],
    [
        "rule-width",
        new Map([
            ["medium", "0:"],
            ["thick", "0:"],
            ["thin", "0:"],
        ]),
    ],
    [
        "rule",
        new Map([
            ["currentColor", "0:"],
            ["dashed", "0:"],
            ["dotted", "0:"],
            ["double", "0:"],
            ["groove", "0:"],
            ["hidden", "0:"],
            ["inset", "0:"],
            ["medium", "0:"],
            ["none", "0:"],
            ["outset", "0:"],
            ["ridge", "0:"],
            ["solid", "0:"],
            ["thick", "0:"],
            ["thin", "0:"],
            ["transparent", "0:"],
        ]),
    ],
    ["gap", new Map([["normal", "10:2017"]])],
    [
        "grid-auto-flow",
        new Map([
            ["column", "10:2020"],
            ["dense", "10:2020"],
            ["row", "10:2020"],
        ]),
    ],
    ["grid-template-areas", new Map([["none", "10:2020"]])],
    [
        "grid-template-columns",
        new Map([
            ["auto", "10:2020"],
            ["fit-content", "10:2017"],
            ["max-content", "10:2020"],
            ["min-content", "10:2020"],
            ["minmax", "10:2017"],
            ["none", "10:2020"],
            ["repeat", "10:2020"],
            ["animation", "10:2022"],
            ["masonry", "0:"],
            ["subgrid", "10:2023"],
        ]),
    ],
    [
        "grid-template-rows",
        new Map([
            ["auto", "10:2020"],
            ["fit-content", "10:2017"],
            ["max-content", "10:2020"],
            ["min-content", "10:2020"],
            ["minmax", "10:2017"],
            ["none", "10:2020"],
            ["repeat", "10:2020"],
            ["animation", "10:2022"],
            ["masonry", "0:"],
            ["subgrid", "10:2023"],
        ]),
    ],
    ["grid-template", new Map([["none", "10:2020"]])],
    ["row-gap", new Map([["normal", "10:2017"]])],
    [
        "hanging-punctuation",
        new Map([
            ["allow-end", "0:"],
            ["first", "0:"],
            ["force-end", "0:"],
            ["last", "0:"],
            ["none", "0:"],
        ]),
    ],
    ["hyphenate-character", new Map([["auto", "10:2023"]])],
    ["hyphenate-limit-chars", new Map([["auto", "0:"]])],
    ["hyphens", new Map([["auto", "10:2023"]])],
    [
        "image-orientation",
        new Map([
            ["from-image", "10:2020"],
            ["none", "10:2020"],
        ]),
    ],
    ["rotate", new Map([["none", "10:2022"]])],
    ["scale", new Map([["none", "10:2022"]])],
    ["translate", new Map([["none", "10:2022"]])],
    ["initial-letter", new Map([["normal", "0:"]])],
    [
        "interactivity",
        new Map([
            ["auto", "0:"],
            ["inert", "0:"],
        ]),
    ],
    [
        "interpolate-size",
        new Map([
            ["allow-keywords", "0:"],
            ["numeric-only", "0:"],
        ]),
    ],
    [
        "direction",
        new Map([
            ["ltr", "10:2015"],
            ["rtl", "10:2015"],
        ]),
    ],
    [
        "unicode-bidi",
        new Map([
            ["bidi-override", "10:2015"],
            ["embed", "10:2015"],
            ["isolate", "10:2020"],
            ["isolate-override", "10:2020"],
            ["normal", "10:2015"],
            ["plaintext", "10:2020"],
        ]),
    ],
    ["letter-spacing", new Map([["normal", "10:2015"]])],
    [
        "line-break",
        new Map([
            ["anywhere", "10:2020"],
            ["auto", "10:2020"],
            ["loose", "10:2020"],
            ["normal", "10:2020"],
            ["strict", "10:2020"],
        ]),
    ],
    ["line-clamp", new Map([["none", "0:"]])],
    ["line-height", new Map([["normal", "10:2015"]])],
    ["list-style-image", new Map([["none", "10:2015"]])],
    [
        "list-style-position",
        new Map([
            ["inside", "10:2015"],
            ["outside", "10:2015"],
        ]),
    ],
    [
        "list-style-type",
        new Map([
            ["arabic-indic", "10:2020"],
            ["armenian", "10:2015"],
            ["bengali", "10:2020"],
            ["cambodian", "10:2020"],
            ["circle", "10:2015"],
            ["cjk-decimal", "10:2021"],
            ["cjk-earthly-branch", "10:2020"],
            ["cjk-heavenly-stem", "10:2020"],
            ["cjk-ideographic", "10:2020"],
            ["decimal", "10:2015"],
            ["decimal-leading-zero", "10:2015"],
            ["devanagari", "10:2020"],
            ["disc", "10:2015"],
            ["disclosure-closed", "10:2021"],
            ["disclosure-open", "10:2021"],
            ["ethiopic-numeric", "10:2021"],
            ["georgian", "10:2015"],
            ["gujarati", "10:2020"],
            ["gurmukhi", "10:2020"],
            ["hebrew", "10:2015"],
            ["hiragana", "10:2015"],
            ["hiragana-iroha", "10:2015"],
            ["japanese-formal", "10:2021"],
            ["japanese-informal", "10:2021"],
            ["kannada", "10:2020"],
            ["katakana", "10:2015"],
            ["katakana-iroha", "10:2015"],
            ["khmer", "10:2020"],
            ["korean-hangul-formal", "10:2021"],
            ["korean-hanja-formal", "10:2021"],
            ["korean-hanja-informal", "10:2021"],
            ["lao", "10:2020"],
            ["lower-alpha", "10:2015"],
            ["lower-armenian", "10:2020"],
            ["lower-greek", "10:2015"],
            ["lower-latin", "10:2015"],
            ["lower-roman", "10:2015"],
            ["malayalam", "10:2020"],
            ["mongolian", "10:2020"],
            ["myanmar", "10:2020"],
            ["none", "10:2015"],
            ["oriya", "10:2020"],
            ["persian", "10:2020"],
            ["simp-chinese-formal", "10:2021"],
            ["simp-chinese-informal", "10:2021"],
            ["square", "10:2015"],
            ["string", "10:2021"],
            ["symbols", "0:"],
            ["tamil", "10:2021"],
            ["telugu", "10:2020"],
            ["thai", "10:2020"],
            ["tibetan", "10:2020"],
            ["trad-chinese-formal", "10:2021"],
            ["trad-chinese-informal", "10:2021"],
            ["upper-alpha", "10:2015"],
            ["upper-armenian", "10:2020"],
            ["upper-latin", "10:2015"],
            ["upper-roman", "10:2015"],
        ]),
    ],
    [
        "list-style",
        new Map([
            ["inside", "10:2015"],
            ["none", "10:2015"],
            ["outside", "10:2015"],
            ["symbols", "0:"],
        ]),
    ],
    [
        "border-block-color",
        new Map([
            ["currentColor", "10:2021"],
            ["transparent", "10:2021"],
        ]),
    ],
    [
        "border-block-end-color",
        new Map([
            ["currentColor", "10:2020"],
            ["transparent", "10:2020"],
        ]),
    ],
    [
        "border-block-end-style",
        new Map([
            ["dashed", "10:2020"],
            ["dotted", "10:2020"],
            ["double", "10:2020"],
            ["groove", "10:2020"],
            ["hidden", "10:2020"],
            ["inset", "10:2020"],
            ["none", "10:2020"],
            ["outset", "10:2020"],
            ["ridge", "10:2020"],
            ["solid", "10:2020"],
        ]),
    ],
    [
        "border-block-end-width",
        new Map([
            ["medium", "10:2020"],
            ["thick", "10:2020"],
            ["thin", "10:2020"],
        ]),
    ],
    [
        "border-block-end",
        new Map([
            ["currentColor", "10:2020"],
            ["dashed", "10:2020"],
            ["dotted", "10:2020"],
            ["double", "10:2020"],
            ["groove", "10:2020"],
            ["hidden", "10:2020"],
            ["inset", "10:2020"],
            ["medium", "10:2020"],
            ["none", "10:2020"],
            ["outset", "10:2020"],
            ["ridge", "10:2020"],
            ["solid", "10:2020"],
            ["thick", "10:2020"],
            ["thin", "10:2020"],
            ["transparent", "10:2020"],
        ]),
    ],
    [
        "border-block-start-color",
        new Map([
            ["currentColor", "10:2020"],
            ["transparent", "10:2020"],
        ]),
    ],
    [
        "border-block-start-style",
        new Map([
            ["dashed", "10:2020"],
            ["dotted", "10:2020"],
            ["double", "10:2020"],
            ["groove", "10:2020"],
            ["hidden", "10:2020"],
            ["inset", "10:2020"],
            ["none", "10:2020"],
            ["outset", "10:2020"],
            ["ridge", "10:2020"],
            ["solid", "10:2020"],
        ]),
    ],
    [
        "border-block-start-width",
        new Map([
            ["medium", "10:2020"],
            ["thick", "10:2020"],
            ["thin", "10:2020"],
        ]),
    ],
    [
        "border-block-start",
        new Map([
            ["currentColor", "10:2020"],
            ["dashed", "10:2020"],
            ["dotted", "10:2020"],
            ["double", "10:2020"],
            ["groove", "10:2020"],
            ["hidden", "10:2020"],
            ["inset", "10:2020"],
            ["medium", "10:2020"],
            ["none", "10:2020"],
            ["outset", "10:2020"],
            ["ridge", "10:2020"],
            ["solid", "10:2020"],
            ["thick", "10:2020"],
            ["thin", "10:2020"],
            ["transparent", "10:2020"],
        ]),
    ],
    [
        "border-block-style",
        new Map([
            ["dashed", "10:2021"],
            ["dotted", "10:2021"],
            ["double", "10:2021"],
            ["groove", "10:2021"],
            ["hidden", "10:2021"],
            ["inset", "10:2021"],
            ["none", "10:2021"],
            ["outset", "10:2021"],
            ["ridge", "10:2021"],
            ["solid", "10:2021"],
        ]),
    ],
    [
        "border-block-width",
        new Map([
            ["medium", "10:2021"],
            ["thick", "10:2021"],
            ["thin", "10:2021"],
        ]),
    ],
    [
        "border-block",
        new Map([
            ["currentColor", "10:2021"],
            ["dashed", "10:2021"],
            ["dotted", "10:2021"],
            ["double", "10:2021"],
            ["groove", "10:2021"],
            ["hidden", "10:2021"],
            ["inset", "10:2021"],
            ["medium", "10:2021"],
            ["none", "10:2021"],
            ["outset", "10:2021"],
            ["ridge", "10:2021"],
            ["solid", "10:2021"],
            ["thick", "10:2021"],
            ["thin", "10:2021"],
            ["transparent", "10:2021"],
        ]),
    ],
    [
        "border-inline-color",
        new Map([
            ["currentColor", "10:2021"],
            ["transparent", "10:2021"],
        ]),
    ],
    [
        "border-inline-end-color",
        new Map([
            ["currentColor", "10:2020"],
            ["transparent", "10:2020"],
        ]),
    ],
    [
        "border-inline-end-style",
        new Map([
            ["dashed", "10:2020"],
            ["dotted", "10:2020"],
            ["double", "10:2020"],
            ["groove", "10:2020"],
            ["hidden", "10:2020"],
            ["inset", "10:2020"],
            ["none", "10:2020"],
            ["outset", "10:2020"],
            ["ridge", "10:2020"],
            ["solid", "10:2020"],
        ]),
    ],
    [
        "border-inline-end-width",
        new Map([
            ["medium", "10:2020"],
            ["thick", "10:2020"],
            ["thin", "10:2020"],
        ]),
    ],
    [
        "border-inline-end",
        new Map([
            ["currentColor", "10:2020"],
            ["dashed", "10:2020"],
            ["dotted", "10:2020"],
            ["double", "10:2020"],
            ["groove", "10:2020"],
            ["hidden", "10:2020"],
            ["inset", "10:2020"],
            ["medium", "10:2020"],
            ["none", "10:2020"],
            ["outset", "10:2020"],
            ["ridge", "10:2020"],
            ["solid", "10:2020"],
            ["thick", "10:2020"],
            ["thin", "10:2020"],
            ["transparent", "10:2020"],
        ]),
    ],
    [
        "border-inline-start-color",
        new Map([
            ["currentColor", "10:2020"],
            ["transparent", "10:2020"],
        ]),
    ],
    [
        "border-inline-start-style",
        new Map([
            ["dashed", "10:2020"],
            ["dotted", "10:2020"],
            ["double", "10:2020"],
            ["groove", "10:2020"],
            ["hidden", "10:2020"],
            ["inset", "10:2020"],
            ["none", "10:2020"],
            ["outset", "10:2020"],
            ["ridge", "10:2020"],
            ["solid", "10:2020"],
        ]),
    ],
    [
        "border-inline-start-width",
        new Map([
            ["medium", "10:2020"],
            ["thick", "10:2020"],
            ["thin", "10:2020"],
        ]),
    ],
    [
        "border-inline-start",
        new Map([
            ["currentColor", "10:2020"],
            ["dashed", "10:2020"],
            ["dotted", "10:2020"],
            ["double", "10:2020"],
            ["groove", "10:2020"],
            ["hidden", "10:2020"],
            ["inset", "10:2020"],
            ["medium", "10:2020"],
            ["none", "10:2020"],
            ["outset", "10:2020"],
            ["ridge", "10:2020"],
            ["solid", "10:2020"],
            ["thick", "10:2020"],
            ["thin", "10:2020"],
            ["transparent", "10:2020"],
        ]),
    ],
    [
        "border-inline-style",
        new Map([
            ["dashed", "10:2021"],
            ["dotted", "10:2021"],
            ["double", "10:2021"],
            ["groove", "10:2021"],
            ["hidden", "10:2021"],
            ["inset", "10:2021"],
            ["none", "10:2021"],
            ["outset", "10:2021"],
            ["ridge", "10:2021"],
            ["solid", "10:2021"],
        ]),
    ],
    [
        "border-inline-width",
        new Map([
            ["medium", "10:2021"],
            ["thick", "10:2021"],
            ["thin", "10:2021"],
        ]),
    ],
    [
        "border-inline",
        new Map([
            ["currentColor", "10:2021"],
            ["dashed", "10:2021"],
            ["dotted", "10:2021"],
            ["double", "10:2021"],
            ["groove", "10:2021"],
            ["hidden", "10:2021"],
            ["inset", "10:2021"],
            ["medium", "10:2021"],
            ["none", "10:2021"],
            ["outset", "10:2021"],
            ["ridge", "10:2021"],
            ["solid", "10:2021"],
            ["thick", "10:2021"],
            ["thin", "10:2021"],
            ["transparent", "10:2021"],
        ]),
    ],
    ["overflow-block", new Map([["overlay", "0:"]])],
    ["overflow-inline", new Map([["overlay", "0:"]])],
    [
        "margin-trim",
        new Map([
            ["block", "0:"],
            ["block-end", "0:"],
            ["block-start", "0:"],
            ["inline", "0:"],
            ["inline-end", "0:"],
            ["inline-start", "0:"],
            ["none", "0:"],
        ]),
    ],
    [
        "mask-type",
        new Map([
            ["alpha", "10:2020"],
            ["luminance", "10:2020"],
        ]),
    ],
    [
        "mask-clip",
        new Map([
            ["border", "0:"],
            ["content", "0:"],
            ["padding", "0:"],
            ["text", "0:"],
        ]),
    ],
    [
        "mask-composite",
        new Map([
            ["add", "10:2023"],
            ["exclude", "10:2023"],
            ["intersect", "10:2023"],
            ["subtract", "10:2023"],
        ]),
    ],
    [
        "mask-mode",
        new Map([
            ["alpha", "10:2023"],
            ["luminance", "10:2023"],
            ["match-source", "10:2023"],
        ]),
    ],
    [
        "mask-origin",
        new Map([
            ["border", "0:"],
            ["content", "0:"],
            ["fill-box", "0:"],
            ["padding", "0:"],
            ["stroke-box", "0:"],
            ["view-box", "0:"],
        ]),
    ],
    [
        "text-transform",
        new Map([
            ["math-auto", "0:"],
            ["capitalize", "10:2015"],
            ["full-size-kana", "0:"],
            ["full-width", "0:"],
            ["lowercase", "10:2015"],
            ["none", "10:2015"],
            ["uppercase", "10:2015"],
        ]),
    ],
    [
        "mix-blend-mode",
        new Map([
            ["plus-darker", "0:"],
            ["plus-lighter", "10:2022"],
        ]),
    ],
    [
        "offset-anchor",
        new Map([
            ["auto", "10:2023"],
            ["bottom", "10:2023"],
            ["center", "10:2023"],
            ["left", "10:2023"],
            ["right", "10:2023"],
            ["top", "10:2023"],
        ]),
    ],
    [
        "offset-path",
        new Map([
            ["border-box", "5:2024"],
            ["content-box", "5:2024"],
            ["fill-box", "5:2024"],
            ["margin-box", "0:"],
            ["none", "5:2024"],
            ["padding-box", "5:2024"],
            ["path", "10:2022"],
            ["ray", "5:2024"],
            ["stroke-box", "5:2024"],
            ["url", "5:2024"],
            ["view-box", "5:2024"],
        ]),
    ],
    [
        "offset-position",
        new Map([
            ["auto", "5:2024"],
            ["bottom", "5:2024"],
            ["center", "5:2024"],
            ["left", "5:2024"],
            ["normal", "5:2024"],
            ["right", "5:2024"],
            ["top", "5:2024"],
        ]),
    ],
    [
        "offset-rotate",
        new Map([
            ["auto", "10:2022"],
            ["reverse", "10:2022"],
        ]),
    ],
    ["column-count", new Map([["auto", "10:2017"]])],
    ["column-gap", new Map([["normal", "10:2015"]])],
    [
        "column-rule-color",
        new Map([
            ["currentColor", "10:2017"],
            ["transparent", "10:2017"],
        ]),
    ],
    [
        "column-rule-style",
        new Map([
            ["dashed", "10:2017"],
            ["dotted", "10:2017"],
            ["double", "10:2017"],
            ["groove", "10:2017"],
            ["hidden", "10:2017"],
            ["inset", "10:2017"],
            ["none", "10:2017"],
            ["outset", "10:2017"],
            ["ridge", "10:2017"],
            ["solid", "10:2017"],
        ]),
    ],
    [
        "column-rule-width",
        new Map([
            ["medium", "10:2017"],
            ["thick", "10:2017"],
            ["thin", "10:2017"],
        ]),
    ],
    [
        "column-rule",
        new Map([
            ["currentColor", "10:2017"],
            ["dashed", "10:2017"],
            ["dotted", "10:2017"],
            ["double", "10:2017"],
            ["groove", "10:2017"],
            ["hidden", "10:2017"],
            ["inset", "10:2017"],
            ["medium", "10:2017"],
            ["none", "10:2017"],
            ["outset", "10:2017"],
            ["ridge", "10:2017"],
            ["solid", "10:2017"],
            ["thick", "10:2017"],
            ["thin", "10:2017"],
            ["transparent", "10:2017"],
        ]),
    ],
    ["column-width", new Map([["auto", "10:2016"]])],
    [
        "object-fit",
        new Map([
            ["contain", "10:2020"],
            ["cover", "10:2020"],
            ["fill", "10:2020"],
            ["none", "10:2020"],
            ["scale-down", "10:2020"],
        ]),
    ],
    ["object-view-box", new Map([["none", "0:"]])],
    ["opacity", new Map([["percentages", "10:2020"]])],
    [
        "outline",
        new Map([
            ["currentColor", "10:2023"],
            ["dashed", "10:2023"],
            ["dotted", "10:2023"],
            ["double", "10:2023"],
            ["groove", "10:2023"],
            ["inset", "10:2023"],
            ["medium", "10:2023"],
            ["none", "10:2023"],
            ["outset", "10:2023"],
            ["ridge", "10:2023"],
            ["solid", "10:2023"],
            ["thick", "10:2023"],
            ["thin", "10:2023"],
            ["transparent", "10:2023"],
        ]),
    ],
    [
        "outline-style",
        new Map([
            ["auto", "10:2015"],
            ["dashed", "10:2015"],
            ["dotted", "10:2015"],
            ["double", "10:2015"],
            ["groove", "10:2015"],
            ["inset", "10:2015"],
            ["none", "10:2015"],
            ["outset", "10:2015"],
            ["ridge", "10:2015"],
            ["solid", "10:2015"],
        ]),
    ],
    [
        "outline-width",
        new Map([
            ["medium", "10:2015"],
            ["thick", "10:2015"],
            ["thin", "10:2015"],
        ]),
    ],
    [
        "overflow-anchor",
        new Map([
            ["auto", "0:"],
            ["none", "0:"],
        ]),
    ],
    [
        "overflow-x",
        new Map([
            ["clip", "10:2022"],
            ["auto", "10:2015"],
            ["hidden", "10:2015"],
            ["scroll", "10:2015"],
            ["visible", "10:2015"],
        ]),
    ],
    [
        "overflow-y",
        new Map([
            ["clip", "10:2022"],
            ["auto", "10:2015"],
            ["hidden", "10:2015"],
            ["scroll", "10:2015"],
            ["visible", "10:2015"],
        ]),
    ],
    [
        "overflow",
        new Map([
            ["clip", "10:2022"],
            ["auto", "10:2015"],
            ["hidden", "10:2015"],
            ["scroll", "10:2015"],
            ["visible", "10:2015"],
        ]),
    ],
    [
        "overflow-clip-margin",
        new Map([
            ["border-box", "0:"],
            ["content-box", "0:"],
            ["padding-box", "0:"],
        ]),
    ],
    [
        "overflow-wrap",
        new Map([
            ["anywhere", "10:2022"],
            ["break-word", "10:2018"],
            ["normal", "10:2018"],
        ]),
    ],
    [
        "overlay",
        new Map([
            ["auto", "0:"],
            ["none", "0:"],
        ]),
    ],
    [
        "overscroll-behavior-block",
        new Map([
            ["auto", "0:"],
            ["contain", "0:"],
            ["none", "0:"],
        ]),
    ],
    [
        "overscroll-behavior-inline",
        new Map([
            ["auto", "0:"],
            ["contain", "0:"],
            ["none", "0:"],
        ]),
    ],
    [
        "overscroll-behavior-x",
        new Map([
            ["auto", "0:"],
            ["contain", "0:"],
            ["none", "0:"],
        ]),
    ],
    [
        "overscroll-behavior-y",
        new Map([
            ["auto", "0:"],
            ["contain", "0:"],
            ["none", "0:"],
        ]),
    ],
    [
        "overscroll-behavior",
        new Map([
            ["auto", "0:"],
            ["contain", "0:"],
            ["none", "0:"],
        ]),
    ],
    [
        "page-break-after",
        new Map([
            ["always", "0:"],
            ["auto", "0:"],
            ["avoid", "0:"],
            ["left", "0:"],
            ["right", "0:"],
        ]),
    ],
    [
        "page-break-before",
        new Map([
            ["always", "0:"],
            ["auto", "0:"],
            ["avoid", "0:"],
            ["left", "0:"],
            ["right", "0:"],
        ]),
    ],
    [
        "page-break-inside",
        new Map([
            ["auto", "0:"],
            ["avoid", "0:"],
        ]),
    ],
    [
        "print-color-adjust",
        new Map([
            ["economy", "5:2025"],
            ["exact", "5:2025"],
        ]),
    ],
    [
        "quotes",
        new Map([
            ["auto", "10:2021"],
            ["none", "10:2015"],
        ]),
    ],
    [
        "reading-flow",
        new Map([
            ["flex-flow", "0:"],
            ["flex-visual", "0:"],
            ["grid-columns", "0:"],
            ["grid-order", "0:"],
            ["grid-rows", "0:"],
            ["normal", "0:"],
            ["source-order", "0:"],
        ]),
    ],
    [
        "resize",
        new Map([
            ["block", "0:"],
            ["inline", "0:"],
        ]),
    ],
    [
        "ruby-align",
        new Map([
            ["center", "5:2024"],
            ["space-around", "5:2024"],
            ["space-between", "5:2024"],
            ["start", "5:2024"],
        ]),
    ],
    [
        "ruby-overhang",
        new Map([
            ["auto", "0:"],
            ["none", "0:"],
        ]),
    ],
    [
        "scroll-behavior",
        new Map([
            ["auto", "10:2022"],
            ["smooth", "10:2022"],
        ]),
    ],
    ["animation-range-end", new Map([["normal", "0:"]])],
    ["animation-range-start", new Map([["normal", "0:"]])],
    [
        "animation-timeline",
        new Map([
            ["scroll", "0:"],
            ["view", "0:"],
        ]),
    ],
    [
        "scroll-timeline-axis",
        new Map([
            ["block", "0:"],
            ["inline", "0:"],
            ["x", "0:"],
            ["y", "0:"],
        ]),
    ],
    [
        "timeline-scope",
        new Map([
            ["all", "0:"],
            ["none", "0:"],
        ]),
    ],
    [
        "view-timeline-axis",
        new Map([
            ["block", "0:"],
            ["inline", "0:"],
            ["x", "0:"],
            ["y", "0:"],
        ]),
    ],
    ["view-timeline-inset", new Map([["auto", "0:"]])],
    [
        "scroll-initial-target",
        new Map([
            ["nearest", "0:"],
            ["none", "0:"],
        ]),
    ],
    [
        "scroll-marker-group",
        new Map([
            ["after", "0:"],
            ["before", "0:"],
            ["none", "0:"],
        ]),
    ],
    ["scroll-padding-block-end", new Map([["auto", "10:2021"]])],
    ["scroll-padding-block-start", new Map([["auto", "10:2021"]])],
    ["scroll-padding-block", new Map([["auto", "10:2021"]])],
    ["scroll-padding-inline-end", new Map([["auto", "10:2021"]])],
    ["scroll-padding-inline-start", new Map([["auto", "10:2021"]])],
    ["scroll-padding-inline", new Map([["auto", "10:2021"]])],
    ["scroll-padding", new Map([["auto", "10:2021"]])],
    [
        "scroll-snap-align",
        new Map([
            ["center", "10:2020"],
            ["end", "10:2020"],
            ["none", "10:2020"],
            ["start", "10:2020"],
        ]),
    ],
    [
        "scroll-snap-stop",
        new Map([
            ["always", "10:2022"],
            ["normal", "10:2022"],
        ]),
    ],
    [
        "scroll-snap-type",
        new Map([
            ["block", "10:2022"],
            ["both", "10:2022"],
            ["inline", "10:2022"],
            ["none", "10:2022"],
            ["x", "10:2022"],
            ["y", "10:2022"],
        ]),
    ],
    [
        "scroll-target-group",
        new Map([
            ["auto", "0:"],
            ["none", "0:"],
        ]),
    ],
    ["scrollbar-color", new Map([["auto", "5:2025"]])],
    [
        "scrollbar-gutter",
        new Map([
            ["auto", "5:2024"],
            ["stable", "5:2024"],
        ]),
    ],
    [
        "scrollbar-width",
        new Map([
            ["auto", "5:2024"],
            ["none", "5:2024"],
            ["thin", "5:2024"],
        ]),
    ],
    ["shape-image-threshold", new Map([["percentages", "0:"]])],
    [
        "shape-outside",
        new Map([
            ["circle", "10:2020"],
            ["gradient", "10:2020"],
            ["image", "10:2020"],
            ["inset", "10:2020"],
            ["none", "10:2020"],
            ["path", "0:"],
            ["polygon", "10:2020"],
        ]),
    ],
    [
        "speak-as",
        new Map([
            ["digits", "0:"],
            ["literal-punctuation", "0:"],
            ["no-punctuation", "0:"],
            ["normal", "0:"],
            ["spell-out", "0:"],
        ]),
    ],
    [
        "clip-rule",
        new Map([
            ["evenodd", "10:2020"],
            ["nonzero", "10:2020"],
        ]),
    ],
    [
        "color-interpolation",
        new Map([
            ["auto", "10:2020"],
            ["linearGradient", "0:"],
            ["sRGB", "10:2020"],
        ]),
    ],
    [
        "fill-rule",
        new Map([
            ["evenodd", "10:2017"],
            ["nonzero", "10:2017"],
        ]),
    ],
    ["fill", new Map([["none", "10:2017"]])],
    ["marker-end", new Map([["none", "10:2017"]])],
    ["marker-mid", new Map([["none", "10:2017"]])],
    ["marker-start", new Map([["none", "10:2017"]])],
    ["marker", new Map([["none", "10:2017"]])],
    ["shape-rendering", new Map([["auto", "10:2020"]])],
    [
        "stop-color",
        new Map([
            ["currentColor", "10:2017"],
            ["transparent", "10:2017"],
        ]),
    ],
    [
        "stroke-color",
        new Map([
            ["currentColor", "0:"],
            ["transparent", "0:"],
        ]),
    ],
    ["stroke-dasharray", new Map([["none", "10:2017"]])],
    [
        "stroke-linecap",
        new Map([
            ["butt", "10:2017"],
            ["round", "10:2017"],
            ["square", "10:2017"],
        ]),
    ],
    [
        "stroke-linejoin",
        new Map([
            ["bevel", "10:2017"],
            ["miter", "10:2017"],
            ["round", "10:2017"],
        ]),
    ],
    ["stroke", new Map([["none", "10:2017"]])],
    [
        "text-anchor",
        new Map([
            ["end", "10:2016"],
            ["middle", "10:2016"],
            ["start", "10:2016"],
        ]),
    ],
    [
        "text-rendering",
        new Map([
            ["auto", "10:2020"],
            ["geometricPrecision", "10:2020"],
        ]),
    ],
    [
        "color-interpolation-filters",
        new Map([
            ["auto", "10:2020"],
            ["linearRGB", "10:2020"],
            ["sRGB", "10:2020"],
        ]),
    ],
    [
        "flood-color",
        new Map([
            ["currentColor", "10:2015"],
            ["transparent", "10:2015"],
        ]),
    ],
    [
        "lighting-color",
        new Map([
            ["currentColor", "10:2015"],
            ["transparent", "10:2015"],
        ]),
    ],
    ["tab-size", new Map([["length", "10:2021"]])],
    [
        "border-collapse",
        new Map([
            ["collapse", "10:2020"],
            ["separate", "10:2020"],
        ]),
    ],
    [
        "caption-side",
        new Map([
            ["bottom", "10:2020"],
            ["bottom-outside", "0:"],
            ["top", "10:2020"],
            ["top-outside", "0:"],
        ]),
    ],
    [
        "empty-cells",
        new Map([
            ["hide", "10:2015"],
            ["show", "10:2015"],
        ]),
    ],
    [
        "table-layout",
        new Map([
            ["auto", "10:2015"],
            ["fixed", "10:2015"],
        ]),
    ],
    [
        "text-align",
        new Map([
            ["center", "10:2020"],
            ["end", "10:2020"],
            ["justify", "10:2015"],
            ["left", "10:2020"],
            ["match-parent", "0:"],
            ["right", "10:2020"],
            ["start", "10:2020"],
        ]),
    ],
    ["text-align-last", new Map([["auto", "10:2022"]])],
    [
        "text-autospace",
        new Map([
            ["auto", "0:"],
            ["ideograph-alpha", "0:"],
            ["ideograph-numeric", "0:"],
            ["insert", "0:"],
            ["no-autospace", "5:2025"],
            ["normal", "5:2025"],
            ["punctuation", "0:"],
            ["replace", "0:"],
        ]),
    ],
    ["text-box-edge", new Map([["auto", "0:"]])],
    [
        "text-box-trim",
        new Map([
            ["none", "0:"],
            ["trim-both", "0:"],
            ["trim-end", "0:"],
            ["trim-start", "0:"],
        ]),
    ],
    ["text-box", new Map([["normal", "0:"]])],
    [
        "text-combine-upright",
        new Map([
            ["all", "10:2022"],
            ["none", "10:2022"],
        ]),
    ],
    [
        "text-decoration-color",
        new Map([
            ["currentColor", "10:2020"],
            ["transparent", "10:2020"],
        ]),
    ],
    [
        "text-decoration-line",
        new Map([
            ["line-through", "10:2020"],
            ["none", "10:2020"],
            ["overline", "10:2020"],
            ["underline", "10:2020"],
            ["blink", "0:"],
            ["grammar-error", "5:2025"],
            ["spelling-error", "5:2025"],
        ]),
    ],
    ["text-decoration-style", new Map([["wavy", "10:2020"]])],
    [
        "text-decoration-thickness",
        new Map([
            ["auto", "10:2021"],
            ["from-font", "10:2021"],
            ["percentage", "5:2024"],
        ]),
    ],
    [
        "text-decoration",
        new Map([
            ["currentColor", "5:2025"],
            ["line-through", "10:2015"],
            ["none", "10:2015"],
            ["overline", "10:2015"],
            ["transparent", "5:2025"],
            ["underline", "10:2015"],
        ]),
    ],
    [
        "text-decoration-skip-ink",
        new Map([
            ["auto", "10:2022"],
            ["none", "10:2022"],
            ["all", "5:2026"],
        ]),
    ],
    [
        "text-emphasis-color",
        new Map([
            ["currentColor", "10:2022"],
            ["transparent", "10:2022"],
        ]),
    ],
    [
        "text-emphasis-position",
        new Map([
            ["auto", "0:"],
            ["left", "10:2022"],
            ["over", "10:2022"],
            ["right", "10:2022"],
            ["under", "10:2022"],
        ]),
    ],
    [
        "text-emphasis-style",
        new Map([
            ["circle", "10:2022"],
            ["dot", "10:2022"],
            ["double-circle", "10:2022"],
            ["filled", "10:2022"],
            ["none", "10:2022"],
            ["sesame", "10:2022"],
            ["triangle", "10:2022"],
        ]),
    ],
    [
        "text-emphasis",
        new Map([
            ["currentColor", "10:2022"],
            ["transparent", "10:2022"],
        ]),
    ],
    [
        "text-indent",
        new Map([
            ["each-line", "5:2026"],
            ["hanging", "5:2026"],
        ]),
    ],
    [
        "text-justify",
        new Map([
            ["auto", "0:"],
            ["inter-character", "0:"],
            ["inter-word", "0:"],
            ["none", "0:"],
        ]),
    ],
    [
        "text-orientation",
        new Map([
            ["mixed", "10:2020"],
            ["sideways", "10:2020"],
            ["upright", "10:2020"],
        ]),
    ],
    [
        "text-size-adjust",
        new Map([
            ["auto", "0:"],
            ["none", "0:"],
            ["percentages", "0:"],
        ]),
    ],
    [
        "text-spacing-trim",
        new Map([
            ["normal", "0:"],
            ["space-all", "0:"],
            ["space-first", "0:"],
            ["trim-start", "0:"],
        ]),
    ],
    [
        "text-underline-offset",
        new Map([
            ["auto", "10:2020"],
            ["percentage", "5:2024"],
        ]),
    ],
    [
        "text-underline-position",
        new Map([
            ["auto", "10:2020"],
            ["from-font", "10:2020"],
            ["left", "5:2024"],
            ["right", "5:2024"],
            ["under", "10:2020"],
        ]),
    ],
    [
        "text-wrap-mode",
        new Map([
            ["nowrap", "5:2024"],
            ["wrap", "5:2024"],
        ]),
    ],
    [
        "text-wrap-style",
        new Map([
            ["auto", "5:2024"],
            ["stable", "5:2024"],
            ["balance", "5:2024"],
            ["pretty", "0:"],
        ]),
    ],
    [
        "text-wrap",
        new Map([
            ["nowrap", "5:2024"],
            ["stable", "5:2024"],
            ["wrap", "5:2024"],
            ["balance", "5:2024"],
            ["pretty", "0:"],
        ]),
    ],
    [
        "touch-action",
        new Map([
            ["manipulation", "10:2019"],
            ["none", "10:2019"],
            ["pan-down", "0:"],
            ["pan-left", "0:"],
            ["pan-right", "0:"],
            ["pan-up", "0:"],
            ["pan-x", "10:2019"],
            ["pan-y", "10:2019"],
            ["pinch-zoom", "10:2021"],
        ]),
    ],
    [
        "transform-box",
        new Map([
            ["border-box", "10:2023"],
            ["content-box", "5:2024"],
            ["fill-box", "10:2020"],
            ["stroke-box", "5:2024"],
            ["view-box", "10:2020"],
        ]),
    ],
    [
        "transform-origin",
        new Map([
            ["bottom", "10:2015"],
            ["center", "10:2015"],
            ["left", "10:2015"],
            ["right", "10:2015"],
            ["top", "10:2015"],
        ]),
    ],
    [
        "transform",
        new Map([
            ["none", "10:2015"],
            ["3d", "10:2015"],
        ]),
    ],
    [
        "perspective-origin",
        new Map([
            ["bottom", "10:2015"],
            ["center", "10:2015"],
            ["left", "10:2015"],
            ["right", "10:2015"],
            ["top", "10:2015"],
        ]),
    ],
    ["perspective", new Map([["none", "10:2015"]])],
    [
        "transition",
        new Map([
            ["transition-behavior", "5:2024"],
            ["all", "10:2015"],
            ["ease", "10:2015"],
            ["ease-in", "10:2015"],
            ["ease-in-out", "10:2015"],
            ["ease-out", "10:2015"],
            ["linear", "10:2015"],
            ["none", "10:2015"],
            ["step-end", "10:2015"],
            ["step-start", "10:2015"],
        ]),
    ],
    [
        "transition-property",
        new Map([
            ["all", "10:2015"],
            ["none", "10:2015"],
        ]),
    ],
    [
        "transition-timing-function",
        new Map([
            ["ease", "10:2015"],
            ["ease-in", "10:2015"],
            ["ease-in-out", "10:2015"],
            ["ease-out", "10:2015"],
            ["jump", "10:2020"],
            ["linear", "10:2015"],
            ["step-end", "10:2015"],
            ["step-start", "10:2015"],
        ]),
    ],
    [
        "user-select",
        new Map([
            ["all", "0:"],
            ["auto", "0:"],
            ["none", "0:"],
            ["text", "0:"],
        ]),
    ],
    [
        "vertical-align",
        new Map([
            ["baseline", "10:2015"],
            ["bottom", "10:2015"],
            ["middle", "10:2015"],
            ["sub", "10:2015"],
            ["super", "10:2015"],
            ["text-bottom", "10:2015"],
            ["text-top", "10:2015"],
            ["top", "10:2015"],
        ]),
    ],
    ["view-transition-class", new Map([["none", "5:2025"]])],
    [
        "view-transition-name",
        new Map([
            ["match-element", "5:2025"],
            ["none", "5:2025"],
        ]),
    ],
    [
        "view-transition-scope",
        new Map([
            ["all", "0:"],
            ["none", "0:"],
        ]),
    ],
    [
        "visibility",
        new Map([
            ["collapse", "10:2015"],
            ["hidden", "10:2015"],
            ["visible", "10:2015"],
        ]),
    ],
    [
        "white-space",
        new Map([
            ["break-spaces", "10:2020"],
            ["normal", "10:2015"],
            ["nowrap", "10:2015"],
            ["pre", "10:2015"],
            ["pre-line", "10:2015"],
            ["pre-wrap", "10:2015"],
        ]),
    ],
    [
        "white-space-collapse",
        new Map([
            ["break-spaces", "5:2024"],
            ["collapse", "5:2024"],
            ["preserve", "5:2024"],
            ["preserve-breaks", "5:2024"],
            ["preserve-spaces", "0:"],
        ]),
    ],
    [
        "will-change",
        new Map([
            ["auto", "10:2020"],
            ["contents", "10:2020"],
            ["scroll-position", "10:2020"],
        ]),
    ],
    [
        "word-break",
        new Map([
            ["break-all", "10:2015"],
            ["keep-all", "10:2015"],
            ["normal", "10:2015"],
            ["auto-phrase", "0:"],
            ["break-word", "0:"],
        ]),
    ],
    ["word-spacing", new Map([["normal", "10:2015"]])],
    [
        "writing-mode",
        new Map([
            ["horizontal-tb", "10:2017"],
            ["sideways-lr", "5:2025"],
            ["sideways-rl", "5:2025"],
            ["vertical-lr", "10:2017"],
            ["vertical-rl", "10:2017"],
            ["lr", "0:"],
            ["lr-tb", "0:"],
            ["rl", "0:"],
            ["rl-tb", "0:"],
            ["tb", "0:"],
            ["tb-rl", "0:"],
        ]),
    ],
    ["z-index", new Map([["auto", "10:2015"]])],
]);
rPxx /**
 * @fileoverview Color information for CSS.
 * @author Nicholas C. Zakas
 */
export const namedColors: Set<string>;
H
'xD
/**
 * @fileoverview Color information for CSS.
 * @author Nicholas C. Zakas
 */
export const namedColors = new Set([
    "aliceblue",
    "antiquewhite",
    "aqua",
    "aquamarine",
    "azure",
    "beige",
    "bisque",
    "black",
    "blanchedalmond",
    "blue",
    "blueviolet",
    "brown",
    "burlywood",
    "cadetblue",
    "chartreuse",
    "chocolate",
    "coral",
    "cornflowerblue",
    "cornsilk",
    "crimson",
    "cyan",
    "darkblue",
    "darkcyan",
    "darkgoldenrod",
    "darkgray",
    "darkgreen",
    "darkgrey",
    "darkkhaki",
    "darkmagenta",
    "darkolivegreen",
    "darkorange",
    "darkorchid",
    "darkred",
    "darksalmon",
    "darkseagreen",
    "darkslateblue",
    "darkslategray",
    "darkslategrey",
    "darkturquoise",
    "darkviolet",
    "deeppink",
    "deepskyblue",
    "dimgray",
    "dimgrey",
    "dodgerblue",
    "firebrick",
    "floralwhite",
    "forestgreen",
    "fuchsia",
    "gainsboro",
    "ghostwhite",
    "gold",
    "goldenrod",
    "gray",
    "green",
    "greenyellow",
    "grey",
    "honeydew",
    "hotpink",
    "indianred",
    "indigo",
    "ivory",
    "khaki",
    "lavender",
    "lavenderblush",
    "lawngreen",
    "lemonchiffon",
    "lightblue",
    "lightcoral",
    "lightcyan",
    "lightgoldenrodyellow",
    "lightgray",
    "lightgreen",
    "lightgrey",
    "lightpink",
    "lightsalmon",
    "lightseagreen",
    "lightskyblue",
    "lightslategray",
    "lightslategrey",
    "lightsteelblue",
    "lightyellow",
    "lime",
    "limegreen",
    "linen",
    "magenta",
    "maroon",
    "mediumaquamarine",
    "mediumblue",
    "mediumorchid",
    "mediumpurple",
    "mediumseagreen",
    "mediumslateblue",
    "mediumspringgreen",
    "mediumturquoise",
    "mediumvioletred",
    "midnightblue",
    "mintcream",
    "mistyrose",
    "moccasin",
    "navajowhite",
    "navy",
    "oldlace",
    "olive",
    "olivedrab",
    "orange",
    "orangered",
    "orchid",
    "palegoldenrod",
    "palegreen",
    "paleturquoise",
    "palevioletred",
    "papayawhip",
    "peachpuff",
    "peru",
    "pink",
    "plum",
    "powderblue",
    "purple",
    "rebeccapurple",
    "red",
    "rosybrown",
    "royalblue",
    "saddlebrown",
    "salmon",
    "sandybrown",
    "seagreen",
    "seashell",
    "sienna",
    "silver",
    "skyblue",
    "slateblue",
    "slategray",
    "slategrey",
    "snow",
    "springgreen",
    "steelblue",
    "tan",
    "teal",
    "thistle",
    "tomato",
    "turquoise",
    "violet",
    "wheat",
    "white",
    "whitesmoke",
    "yellow",
    "yellowgreen",
]);
l7xexport default plugin;
export { JSONSourceCode };
export * from "./languages/json-language.js";
export * from "./types.js";
declare namespace plugin {
    export namespace meta {
        let name: string;
        let namespace: string;
        let version: string;
    }
    export namespace languages {
        let json: JSONLanguage;
        let jsonc: JSONLanguage;
        let json5: JSONLanguage;
    }
    export { rules };
    export namespace configs {
        namespace recommended {
            let name_1: string;
            export { name_1 as name };
            export let plugins: {};
            export { recommendedRules as rules };
        }
    }
}
import { JSONSourceCode } from "./languages/json-source-code.js";
import { JSONLanguage } from "./languages/json-language.js";
import rules from "./build/rules.js";
import recommendedRules from "./build/recommended-config.js";
OxE  CSS$)cssQDcss: CSSCSScssCSScsss,oIxk/**
 * @fileoverview CSS plugin.
 * @author Nicholas C. Zakas
 */
//-----------------------------------------------------------------------------
// Imports
//-----------------------------------------------------------------------------
import { CSSLanguage } from "./languages/css-language.js";
import { CSSSourceCode } from "./languages/css-source-code.js";
import recommendedRules from "./build/recommended-config.js";
import rules from "./build/rules.js";
//-----------------------------------------------------------------------------
// Plugin
//-----------------------------------------------------------------------------
const plugin = {
    meta: {
        name: "@eslint/css",
        version: "1.4.0", // x-release-please-version
    },
    languages: {
        css: new CSSLanguage(),
    },
    rules,
    configs: {
        recommended: {
            name: "@eslint/css/recommended",
            plugins: {},
            rules: recommendedRules,
        },
    },
};
Object.assign(plugin.configs.recommended.plugins, { css: plugin });
export default plugin;
export { CSSSourceCode };
export * from "./languages/css-language.js";
export * from "./types.js";
Ckx100644 css-language.d.ts )A(= Al100644 css-language.js \u7;V100644 css-source-code.d.ts h^Xv0㚍OQ100644 css-source-code.js J=s_H100644 css-visitor-keys.d.ts ԩí_Q$?MƢ|D100644 css-visitor-keys.js J
=!Oͱ,6>ṉxq/**
 * CSS Language Object
 * @implements {Language<{ LangOptions: CSSLanguageOptions; Code: CSSSourceCode; RootNode: StyleSheetPlain; Node: CssNodePlain}>}
 */
export class CSSLanguage implements Language {
    /**
     * The type of file to read.
     * @type {"text"}
     */
    fileType: "text";
    /**
     * The line number at which the parser starts counting.
     * @type {0|1}
     */
    lineStart: 0 | 1;
    /**
     * The column number at which the parser starts counting.
     * @type {0|1}
     */
    columnStart: 0 | 1;
    /**
     * The name of the key that holds the type of the node.
     * @type {string}
     */
    nodeTypeKey: string;
    /**
     * The visitor keys for the CSSTree AST.
     * @type {Record<string, string[]>}
     */
    visitorKeys: Record<string, string[]>;
    /**
     * The default language options.
     * @type {CSSLanguageOptions}
     */
    defaultLanguageOptions: CSSLanguageOptions;
    /**
     * Validates the language options.
     * @param {CSSLanguageOptions} languageOptions The language options to validate.
     * @returns {void}
     * @throws {TypeError} When the language options are invalid.
     */
    validateLanguageOptions(languageOptions: CSSLanguageOptions): void;
    /**
     * Normalizes the language options so they can be serialized.
     * @param {CSSLanguageOptions} languageOptions The language options to normalize.
     * @returns {CSSLanguageOptions} The normalized language options.
     */
    normalizeLanguageOptions(languageOptions: CSSLanguageOptions): CSSLanguageOptions;
    /**
     * Parses the given file into an AST.
     * @param {File} file The virtual file to parse.
     * @param {Object} [context] The parsing context.
     * @param {CSSLanguageOptions} [context.languageOptions] The language options to use for parsing.
     * @returns {CSSParseResult} The result of parsing.
     */
    parse(file: File, { languageOptions }?: {
        languageOptions?: CSSLanguageOptions;
    }): CSSParseResult;
    /**
     * Creates a new `CSSSourceCode` object from the given information.
     * @param {File} file The virtual file to create a `CSSSourceCode` object from.
     * @param {CSSOkParseResult} parseResult The result returned from `parse()`.
     * @returns {CSSSourceCode} The new `CSSSourceCode` object.
     */
    createSourceCode(file: File, parseResult: CSSOkParseResult): CSSSourceCode;
}
export type CSSOkParseResult = OkParseResult<StyleSheetPlain> & {
    comments: Comment[];
    lexer: Lexer;
};
export type CSSParseResult = ParseResult<StyleSheetPlain>;
/**
 * DefaultSyntaxConfig type representing the structure returned by `@eslint/css-tree/definition-syntax-data`.
 * This type is defined inline because it's not exported from the main `@eslint/css-tree` package.
 */
export type DefaultSyntaxConfig = Pick<SyntaxConfig, "atrules" | "types" | "properties">;
export type SyntaxExtensionCallback = (defaultSyntax: DefaultSyntaxConfig) => Partial<SyntaxConfig>;
export type CSSLanguageOptions = {
    /**
     * Whether to be tolerant of recoverable parsing errors.
     */
    tolerant?: boolean;
    /**
     * Custom syntax to use for parsing.
     */
    customSyntax?: Partial<SyntaxConfig> | SyntaxExtensionCallback;
};
import type { Language } from "@eslint/core";
import type { File } from "@eslint/core";
import { CSSSourceCode } from "./css-source-code.js";
import type { StyleSheetPlain } from "@eslint/css-tree";
import type { OkParseResult } from "@eslint/core";
import type { Comment } from "@eslint/css-tree";
import type { Lexer } from "@eslint/css-tree";
import type { ParseResult } from "@eslint/core";
import type { SyntaxConfig } from "@eslint/css-tree";
±xa*/**
 * @fileoverview The CSSLanguage class.
 * @author Nicholas C. Zakas
 */
//------------------------------------------------------------------------------
// Imports
//------------------------------------------------------------------------------
import { parse as originalParse, lexer as originalLexer, fork, toPlainObject, tokenTypes, } from "@eslint/css-tree";
import defaultSyntax from "@eslint/css-tree/definition-syntax-data";
import { CSSSourceCode } from "./css-source-code.js";
import { visitorKeys } from "./css-visitor-keys.js";
//-----------------------------------------------------------------------------
// Types
//-----------------------------------------------------------------------------
/**
 * @import { CssNodePlain, Comment, Lexer, StyleSheetPlain, SyntaxConfig } from "@eslint/css-tree"
 * @import { Language, OkParseResult, ParseResult, File, FileError } from "@eslint/core";
 */
/** @typedef {OkParseResult<StyleSheetPlain> & { comments: Comment[], lexer: Lexer }} CSSOkParseResult */
/** @typedef {ParseResult<StyleSheetPlain>} CSSParseResult */
/**
 * DefaultSyntaxConfig type representing the structure returned by `@eslint/css-tree/definition-syntax-data`.
 * This type is defined inline because it's not exported from the main `@eslint/css-tree` package.
 * @typedef {Pick<SyntaxConfig, "atrules" | "types" | "properties">} DefaultSyntaxConfig
 */
/**
 * @typedef {(defaultSyntax: DefaultSyntaxConfig) => Partial<SyntaxConfig>} SyntaxExtensionCallback
 */
/**
 * @typedef {Object} CSSLanguageOptions
 * @property {boolean} [tolerant] Whether to be tolerant of recoverable parsing errors.
 * @property {Partial<SyntaxConfig> | SyntaxExtensionCallback} [customSyntax] Custom syntax to use for parsing.
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
const blockOpenerTokenTypes = new Map([
    [tokenTypes.Function, ")"],
    [tokenTypes.LeftCurlyBracket, "}"],
    [tokenTypes.LeftParenthesis, ")"],
    [tokenTypes.LeftSquareBracket, "]"],
]);
const blockCloserTokenTypes = new Map([
    [tokenTypes.RightCurlyBracket, "{"],
    [tokenTypes.RightParenthesis, "("],
    [tokenTypes.RightSquareBracket, "["],
]);
/**
 * Recursively replaces all function values in an object with boolean true.
 * Used to make objects serializable for JSON output.
 * @param {Record<string,any>|unknown[]|unknown} object The object to process.
 * @returns {Record<string,any>|unknown[]|unknown} A copy of the object with all functions replaced by true.
 */
function replaceFunctions(object) {
    if (typeof object !== "object" || object === null) {
        return object;
    }
    if (Array.isArray(object)) {
        return object.map(replaceFunctions);
    }
    const result = {};
    for (const key of Object.keys(object)) {
        const value = object[key];
        if (typeof value === "function") {
            result[key] = true;
        }
        else if (typeof value === "object" && value !== null) {
            result[key] = replaceFunctions(value);
        }
        else {
            result[key] = value;
        }
    }
    return result;
}
//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------
/**
 * CSS Language Object
 * @implements {Language<{ LangOptions: CSSLanguageOptions; Code: CSSSourceCode; RootNode: StyleSheetPlain; Node: CssNodePlain}>}
 */
export class CSSLanguage {
    /**
     * The type of file to read.
     * @type {"text"}
     */
    fileType = "text";
    /**
     * The line number at which the parser starts counting.
     * @type {0|1}
     */
    lineStart = 1;
    /**
     * The column number at which the parser starts counting.
     * @type {0|1}
     */
    columnStart = 1;
    /**
     * The name of the key that holds the type of the node.
     * @type {string}
     */
    nodeTypeKey = "type";
    /**
     * The visitor keys for the CSSTree AST.
     * @type {Record<string, string[]>}
     */
    visitorKeys = visitorKeys;
    /**
     * The default language options.
     * @type {CSSLanguageOptions}
     */
    defaultLanguageOptions = {
        tolerant: false,
    };
    /**
     * Validates the language options.
     * @param {CSSLanguageOptions} languageOptions The language options to validate.
     * @returns {void}
     * @throws {TypeError} When the language options are invalid.
     */
    validateLanguageOptions(languageOptions) {
        if ("tolerant" in languageOptions &&
            typeof languageOptions.tolerant !== "boolean") {
            throw new TypeError("Expected a boolean value for 'tolerant' option.");
        }
        if ("customSyntax" in languageOptions) {
            if (typeof languageOptions.customSyntax !== "object" &&
                typeof languageOptions.customSyntax !== "function") {
                throw new TypeError("Expected an object or function value for 'customSyntax' option.");
            }
            if (typeof languageOptions.customSyntax === "object" &&
                languageOptions.customSyntax === null) {
                throw new TypeError("Expected an object or function value for 'customSyntax' option.");
            }
        }
    }
    /**
     * Normalizes the language options so they can be serialized.
     * @param {CSSLanguageOptions} languageOptions The language options to normalize.
     * @returns {CSSLanguageOptions} The normalized language options.
     */
    normalizeLanguageOptions(languageOptions) {
        // if there's no custom syntax then no changes are necessary
        if (!languageOptions?.customSyntax) {
            return languageOptions;
        }
        // Shallow copy
        const clone = { ...languageOptions };
        // If customSyntax is a function, call it with the default syntax to get the config object
        if (typeof languageOptions.customSyntax === "function") {
            clone.customSyntax = languageOptions.customSyntax(defaultSyntax);
        }
        Object.defineProperty(clone, "toJSON", {
            value() {
                // another shallow copy
                const result = { ...this };
                result.customSyntax = replaceFunctions(result.customSyntax);
                return result;
            },
            enumerable: false,
            configurable: true,
        });
        return clone;
    }
    /**
     * Parses the given file into an AST.
     * @param {File} file The virtual file to parse.
     * @param {Object} [context] The parsing context.
     * @param {CSSLanguageOptions} [context.languageOptions] The language options to use for parsing.
     * @returns {CSSParseResult} The result of parsing.
     */
    parse(file, { languageOptions = {} } = {}) {
        // Note: BOM already removed
        const text = /** @type {string} */ (file.body);
        /** @type {Comment[]} */
        const comments = [];
        /** @type {FileError[]} */
        const errors = [];
        const { tolerant } = languageOptions;
        const { parse, lexer } = languageOptions.customSyntax
            ? fork(
            /** @type {Partial<SyntaxConfig>} */ (languageOptions.customSyntax))
            : { parse: originalParse, lexer: originalLexer };
        /*
         * Check for parsing errors first. If there's a parsing error, nothing
         * else can happen. However, a parsing error does not throw an error
         * from this method - it's just considered a fatal error message, a
         * problem that ESLint identified just like any other.
         */
        try {
            const root = toPlainObject(parse(text, {
                filename: file.path,
                positions: true,
                onComment(value, loc) {
                    comments.push({
                        type: "Comment",
                        value,
                        loc,
                    });
                },
                onParseError(error) {
                    if (!tolerant) {
                        errors.push(error);
                    }
                },
                onToken(type, start, end, index) {
                    if (tolerant) {
                        return;
                    }
                    switch (type) {
                        // these already generate errors
                        case tokenTypes.BadString:
                        case tokenTypes.BadUrl:
                            break;
                        default:
                            /* eslint-disable new-cap -- This is a valid call */
                            if (this.isBlockOpenerTokenType(type)) {
                                if (this.getBlockTokenPairIndex(index) ===
                                    -1) {
                                    const loc = this.getRangeLocation(start, end);
                                    errors.push(parse.SyntaxError(`Missing closing ${blockOpenerTokenTypes.get(type)}`, text, start, loc.start.line, loc.start.column));
                                }
                            }
                            else if (this.isBlockCloserTokenType(type)) {
                                if (this.getBlockTokenPairIndex(index) ===
                                    -1) {
                                    const loc = this.getRangeLocation(start, end);
                                    errors.push(parse.SyntaxError(`Missing opening ${blockCloserTokenTypes.get(type)}`, text, start, loc.start.line, loc.start.column));
                                }
                            }
                        /* eslint-enable new-cap -- This is a valid call */
                    }
                },
            }));
            if (errors.length) {
                return {
                    ok: false,
                    errors,
                };
            }
            return {
                ok: true,
                ast: /** @type {StyleSheetPlain} */ (root),
                comments,
                lexer,
            };
        }
        catch (ex) {
            return {
                ok: false,
                errors: [ex],
            };
        }
    }
    /**
     * Creates a new `CSSSourceCode` object from the given information.
     * @param {File} file The virtual file to create a `CSSSourceCode` object from.
     * @param {CSSOkParseResult} parseResult The result returned from `parse()`.
     * @returns {CSSSourceCode} The new `CSSSourceCode` object.
     */
    createSourceCode(file, parseResult) {
        return new CSSSourceCode({
            text: /** @type {string} */ (file.body),
            ast: parseResult.ast,
            comments: parseResult.comments,
            lexer: parseResult.lexer,
        });
    }
}
g8qx/**
 * JSON Source Code Object
 * @extends {TextSourceCodeBase<{LangOptions: JSONLanguageOptions, RootNode: DocumentNode, SyntaxElementWithLoc: JSONSyntaxElement, ConfigNode: Token}>}
 */
export class JSONSourceCode extends TextSourceCodeBase<{
    LangOptions: JSONLanguageOptions;
    RootNode: DocumentNode;
    SyntaxElementWithLoc: JSONSyntaxElement;
    ConfigNode: Token;
}> {
    /**
     * Creates a new instance.
     * @param {Object} options The options for the instance.
     * @param {string} options.text The source code text.
     * @param {DocumentNode} options.ast The root AST node.
     */
    constructor({ text, ast }: {
        text: string;
        ast: DocumentNode;
    });
    /**
     * The comment tokens in the source code.
     * @type {Array<Token>|undefined}
     */
    comments: Array<Token> | undefined;
    /**
     * Returns an array of all inline configuration nodes found in the
     * source code.
     * @returns {Array<Token>} An array of all inline configuration nodes.
     */
    getInlineConfigNodes(): Array<Token>;
    /**
     * Returns directives that enable or disable rules along with any problems
     * encountered while parsing the directives.
     * @returns {{problems:Array<FileProblem>,directives:Array<Directive>}} Information
     *      that ESLint needs to further process the directives.
     */
    getDisableDirectives(): {
        problems: Array<FileProblem>;
        directives: Array<Directive>;
    };
    /**
     * Returns inline rule configurations along with any problems
     * encountered while parsing the configurations.
     * @returns {{problems:Array<FileProblem>,configs:Array<{config:{rules:RulesConfig},loc:LocationRange}>}} Information
     *      that ESLint needs to further process the rule configurations.
     */
    applyInlineConfig(): {
        problems: Array<FileProblem>;
        configs: Array<{
            config: {
                rules: RulesConfig;
            };
            loc: LocationRange;
        }>;
    };
    /**
     * Returns the parent of the given node.
     * @param {AnyNode} node The node to get the parent of.
     * @returns {AnyNode|undefined} The parent of the node.
     */
    getParent(node: AnyNode): AnyNode | undefined;
    /**
     * Traverse the source code and return the steps that were taken.
     * @returns {Iterable<JSONTraversalStep>} The steps that were taken while traversing the source code.
     */
    traverse(): Iterable<JSONTraversalStep>;
    /**
     * Gets the token before the given node or token, optionally including comments.
     * @param {AnyNode|Token} nodeOrToken The node or token to get the previous token for.
     * @param {Object} [options] Options object.
     * @param {boolean} [options.includeComments] If true, return comments when they are present.
     * @returns {Token|null} The previous token or comment, or null if there is none.
     */
    getTokenBefore(nodeOrToken: AnyNode | Token, { includeComments }?: {
        includeComments?: boolean;
    }): Token | null;
    /**
     * Gets the token after the given node or token, skipping any comments unless includeComments is true.
     * @param {AnyNode|Token} nodeOrToken The node or token to get the next token for.
     * @param {Object} [options] Options object.
     * @param {boolean} [options.includeComments=false] If true, return comments when they are present.
     * @returns {Token|null} The next token or comment, or null if there is none.
     */
    getTokenAfter(nodeOrToken: AnyNode | Token, { includeComments }?: {
        includeComments?: boolean;
    }): Token | null;
    #private;
}
import type { JSONLanguageOptions } from "./json-language.js";
import type { DocumentNode } from "@humanwhocodes/momoa";
import type { JSONSyntaxElement } from "../types.js";
import type { Token } from "@humanwhocodes/momoa";
import { TextSourceCodeBase } from "@eslint/plugin-kit";
import type { FileProblem } from "@eslint/core";
import { Directive } from "@eslint/plugin-kit";
import type { RulesConfig } from "@eslint/core";
import type { LocationRange } from "@humanwhocodes/momoa";
import type { AnyNode } from "@humanwhocodes/momoa";
/**
 * A class to represent a step in the traversal process.
 */
declare class JSONTraversalStep extends VisitNodeStep {
    /**
     * Creates a new instance.
     * @param {Object} options The options for the step.
     * @param {AnyNode} options.target The target of the step.
     * @param {1|2} options.phase The phase of the step.
     * @param {Array<any>} options.args The arguments of the step.
     */
    constructor({ target, phase, args }: {
        target: AnyNode;
        phase: 1 | 2;
        args: Array<any>;
    });
    /**
     * The target of the step.
     * @type {AnyNode}
     */
    target: AnyNode;
}
import { VisitNodeStep } from "@eslint/plugin-kit";
export {};
[9=x+&/**
 * CSS Source Code Object./CSSQdStyleSheetPlain, SyntaxElementWithLoc: CSSSyntaxElement, ConfigNode: Comment}>}
 */
export class CSS9CSS
.StyleSheetPlain;
    SyntaxElementWithLoc: CSSUCommentyStyleSheetPlain9'
/Comment>} options.comments The comment nodes inq	5 @param {Lexer} options.lexer The lexer used to parseq	ext, ast, comments, lexer})StyleSheetPlain;
     Comment>;
        lexer: Lexer\node inq	Comment)Comment>Ihe lexer for this instance.
     * @type {Lexer}
     */
    lexer: Lexer_cComment>} A`),Comment>?^Css$Css1YCSS7	mCSSTraversalStep>  CSSLanguageOptions } from "./cssa<StyleSheetPlain } from "@eslint/css-tree";
import type { CSS2 Comment } from "@eslint/css-treeJLexer } from "@eslint/css-treeI)CssLocationRange } from "@eslint/css-treeKRCSSCss9Css(sCssCss<.CssNode } from "@eslint/css-tree";
export {};
GiKx0S/**
 * @fileoverview The JSONSourceCode class.
 * @author Nicholas C. Zakas
 */
//-----------------------------------------------------------------------------
// Imports
//-----------------------------------------------------------------------------
import { iterator } from "@humanwhocodes/momoa";
import { VisitNodeStep, TextSourceCodeBase, ConfigCommentParser, Directive, } from "@eslint/plugin-kit";
//-----------------------------------------------------------------------------
// Types
//-----------------------------------------------------------------------------
/**
 * @import { DocumentNode, AnyNode, Token, LocationRange } from "@humanwhocodes/momoa";
 * @import { FileProblem, DirectiveType, RulesConfig } from "@eslint/core";
 * @import { JSONSyntaxElement } from "../types.js";
 * @import { JSONLanguageOptions } from "./json-language.js";
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
const commentParser = new ConfigCommentParser();
const INLINE_CONFIG = /^\s*eslint(?:-enable|-disable(?:(?:-next)?-line)?)?(?:\s|$)/u;
/**
 * A class to represent a step in the traversal process.
 */
class JSONTraversalStep extends VisitNodeStep {
    /**
     * The target of the step.
     * @type {AnyNode}
     */
    target = undefined;
    /**
     * Creates a new instance.
     * @param {Object} options The options for the step.
     * @param {AnyNode} options.target The target of the step.
     * @param {1|2} options.phase The phase of the step.
     * @param {Array<any>} options.args The arguments of the step.
     */
    constructor({ target, phase, args }) {
        super({ target, phase, args });
        this.target = target;
    }
}
/**
 * Processes tokens to extract comments and their starting tokens.
 * @param {Array<Token>} tokens The tokens to process.
 * @returns {{ comments: Array<Token>, starts: Map<number, number>, ends: Map<number, number>}}
 * An object containing an array of comments, a map of starting token range to token index, and
 * a map of ending token range to token index.
 */
function processTokens(tokens) {
    /** @type {Array<Token>} */
    const comments = [];
    /** @type {Map<number, number>} */
    const starts = new Map();
    /** @type {Map<number, number>} */
    const ends = new Map();
    for (let i = 0; i < tokens.length; i++) {
        const token = tokens[i];
        if (token.type.endsWith("Comment")) {
            comments.push(token);
        }
        starts.set(token.range[0], i);
        ends.set(token.range[1], i);
    }
    return { comments, starts, ends };
}
//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------
/**
 * JSON Source Code Object
 * @extends {TextSourceCodeBase<{LangOptions: JSONLanguageOptions, RootNode: DocumentNode, SyntaxElementWithLoc: JSONSyntaxElement, ConfigNode: Token}>}
 */
export class JSONSourceCode extends TextSourceCodeBase {
    /**
     * Cached traversal steps.
     * @type {Array<JSONTraversalStep>|undefined}
     */
    #steps;
    /**
     * Cache of parent nodes.
     * @type {WeakMap<AnyNode, AnyNode>}
     */
    #parents = new WeakMap();
    /**
     * Collection of inline configuration comments.
     * @type {Array<Token>}
     */
    #inlineConfigComments;
    /**
     * The AST of the source code.
     * @type {DocumentNode}
     */
    ast = undefined;
    /**
     * The comment tokens in the source code.
     * @type {Array<Token>|undefined}
     */
    comments;
    /**
     * A map of token start positions to their corresponding index.
     * @type {Map<number, number>}
     */
    #tokenStarts;
    /**
     * A map of token end positions to their corresponding index.
     * @type {Map<number, number>}
     */
    #tokenEnds;
    /**
     * Creates a new instance.
     * @param {Object} options The options for the instance.
     * @param {string} options.text The source code text.
     * @param {DocumentNode} options.ast The root AST node.
     */
    constructor({ text, ast }) {
        super({ text, ast, lineEndingPattern: /\r\n|[\r\n]/u });
        this.ast = ast;
        const { comments, starts, ends } = processTokens(this.ast.tokens ?? []);
        this.comments = comments;
        this.#tokenStarts = starts;
        this.#tokenEnds = ends;
    }
    /**
     * Returns the value of the given comment.
     * @param {Token} comment The comment to get the value of.
     * @returns {string} The value of the comment.
     * @throws {Error} When an unexpected comment type is passed.
     */
    #getCommentValue(comment) {
        if (comment.type === "LineComment") {
            return this.getText(comment).slice(2); // strip leading `//`
        }
        if (comment.type === "BlockComment") {
            return this.getText(comment).slice(2, -2); // strip leading `/*` and trailing `*/`
        }
        throw new Error(`Unexpected comment type '${comment.type}'`);
    }
    /**
     * Returns an array of all inline configuration nodes found in the
     * source code.
     * @returns {Array<Token>} An array of all inline configuration nodes.
     */
    getInlineConfigNodes() {
        if (!this.#inlineConfigComments) {
            this.#inlineConfigComments = this.comments.filter(comment => INLINE_CONFIG.test(this.#getCommentValue(comment)));
        }
        return this.#inlineConfigComments ?? [];
    }
    /**
     * Returns directives that enable or disable rules along with any problems
     * encountered while parsing the directives.
     * @returns {{problems:Array<FileProblem>,directives:Array<Directive>}} Information
     *      that ESLint needs to further process the directives.
     */
    getDisableDirectives() {
        /** @type {Array<FileProblem>} */
        const problems = [];
        /** @type {Array<Directive>} */
        const directives = [];
        this.getInlineConfigNodes().forEach(comment => {
            const { label, value, justification } = commentParser.parseDirective(this.#getCommentValue(comment));
            // `eslint-disable-line` directives are not allowed to span multiple lines as it would be confusing to which lines they apply
            if (label === "eslint-disable-line" &&
                comment.loc.start.line !== comment.loc.end.line) {
                const message = `${label} comment should not span multiple lines.`;
                problems.push({
                    ruleId: null,
                    message,
                    loc: comment.loc,
                });
                return;
            }
            switch (label) {
                case "eslint-disable":
                case "eslint-enable":
                case "eslint-disable-next-line":
                case "eslint-disable-line": {
                    const directiveType = label.slice("eslint-".length);
                    directives.push(new Directive({
                        type: /** @type {DirectiveType} */ (directiveType),
                        node: comment,
                        value,
                        justification,
                    }));
                }
                // no default
            }
        });
        return { problems, directives };
    }
    /**
     * Returns inline rule configurations along with any problems
     * encountered while parsing the configurations.
     * @returns {{problems:Array<FileProblem>,configs:Array<{config:{rules:RulesConfig},loc:LocationRange}>}} Information
     *      that ESLint needs to further process the rule configurations.
     */
    applyInlineConfig() {
        /** @type {Array<FileProblem>} */
        const problems = [];
        /** @type {Array<{config:{rules:RulesConfig},loc:LocationRange}>} */
        const configs = [];
        this.getInlineConfigNodes().forEach(comment => {
            const { label, value } = commentParser.parseDirective(this.#getCommentValue(comment));
            if (label === "eslint") {
                const parseResult = commentParser.parseJSONLikeConfig(value);
                if (parseResult.ok) {
                    configs.push({
                        config: {
                            rules: parseResult.config,
                        },
                        loc: comment.loc,
                    });
                }
                else {
                    problems.push({
                        ruleId: null,
                        message: 
                        /** @type {{ok: false, error: { message: string }}} */ (parseResult).error.message,
                        loc: comment.loc,
                    });
                }
            }
        });
        return {
            configs,
            problems,
        };
    }
    /**
     * Returns the parent of the given node.
     * @param {AnyNode} node The node to get the parent of.
     * @returns {AnyNode|undefined} The parent of the node.
     */
    getParent(node) {
        return this.#parents.get(node);
    }
    /**
     * Traverse the source code and return the steps that were taken.
     * @returns {Iterable<JSONTraversalStep>} The steps that were taken while traversing the source code.
     */
    traverse() {
        // Because the AST doesn't mutate, we can cache the steps
        if (this.#steps) {
            return this.#steps.values();
        }
        /** @type {Array<JSONTraversalStep>} */
        const steps = (this.#steps = []);
        for (const { node, parent, phase } of iterator(this.ast)) {
            if (parent) {
                this.#parents.set(
                /** @type {AnyNode} */ (node), 
                /** @type {AnyNode} */ (parent));
            }
            steps.push(new JSONTraversalStep({
                target: /** @type {AnyNode} */ (node),
                phase: phase === "enter" ? 1 : 2,
                args: [node, parent],
            }));
        }
        return steps;
    }
    /**
     * Gets the token before the given node or token, optionally including comments.
     * @param {AnyNode|Token} nodeOrToken The node or token to get the previous token for.
     * @param {Object} [options] Options object.
     * @param {boolean} [options.includeComments] If true, return comments when they are present.
     * @returns {Token|null} The previous token or comment, or null if there is none.
     */
    getTokenBefore(nodeOrToken, { includeComments = false } = {}) {
        const index = this.#tokenStarts.get(nodeOrToken.range[0]);
        if (index === undefined) {
            return null;
        }
        let previousIndex = index - 1;
        if (previousIndex < 0) {
            return null;
        }
        const tokens = this.ast.tokens;
        let tokenOrComment = tokens[previousIndex];
        if (includeComments) {
            return tokenOrComment;
        }
        // skip comments
        while (tokenOrComment?.type.endsWith("Comment")) {
            previousIndex--;
            if (previousIndex < 0) {
                return null;
            }
            tokenOrComment = tokens[previousIndex];
        }
        return tokenOrComment;
    }
    /**
     * Gets the token after the given node or token, skipping any comments unless includeComments is true.
     * @param {AnyNode|Token} nodeOrToken The node or token to get the next token for.
     * @param {Object} [options] Options object.
     * @param {boolean} [options.includeComments=false] If true, return comments when they are present.
     * @returns {Token|null} The next token or comment, or null if there is none.
     */
    getTokenAfter(nodeOrToken, { includeComments = false } = {}) {
        const index = this.#tokenEnds.get(nodeOrToken.range[1]);
        if (index === undefined) {
            return null;
        }
        let nextIndex = index + 1;
        const tokens = this.ast.tokens;
        if (nextIndex >= tokens.length) {
            return null;
        }
        let tokenOrComment = tokens[nextIndex];
        if (includeComments) {
            return tokenOrComment;
        }
        // skip comments
        while (tokenOrComment?.type.endsWith("Comment")) {
            nextIndex++;
            if (nextIndex >= tokens.length) {
                return null;
            }
            tokenOrComment = tokens[nextIndex];
        }
        return tokenOrComment;
    }
}
9 Js:x<aICSS5`4import { visitorKeys } from "./css-visitor-keys.js";p
TgCssNode, CssNodePlain, CssLocationRange, Comment, Lexer, StyleSheetPlain } from "@eslint/css-tree"
 * @import { SourceRange, Fi;
 * @import { CSS"
 * @import { CSS,css-language.js"
 */p
T&CSS[Css8Css+r
CSS Source Code Object.:/CSSm*StyleSheetPlain, SyntaxElementWithLoc: CSSCommentCSScCSSPjCssNodePlain, CssNodePlainyCommentH_StyleSheetPlain:node in Array<Comment!2CThe lexer for this instance.
     * @type {Lexer}
     */
    lexerPStyleSheetPlain'"
rray<Comment>} options.comments The comment nodes in the source code.
     * @param {Lexer} options.lexer The lexer used to parse the source c'(, comments, lexerO?\f('lexer = lexer"#range"#CssNodePlain"range#SourceRange} The range of the node.
     * @override
     */
    getRange(node) {
        return [node.loc.start.offset, node.loc.end.offset]Comment>} A)comment.value)$+}Gcomment.+sCss
Csscomment.gCssNodePlain"7CssNodePlain,#CSS$CSS%E// Note: We can't use `walk` from `css-tree` because it uses `CssNode` instead of `CssNodePlain`
        const visit = (node, p0arent) => {
            // first set the parent
%Nnode, parent);
            // then add the step
            steps.push(new CSSg&(node&1&AY    // then visit the children
            for (const key of visitorKeys[node.type] || []%/,child = node[key];
                if (child%@if (Array.isArray(child)%@ child.forEach(grandchild =>P visit(grandchild, nodeA@@Z@	!@visit(child, nodeAZ:"P&8// then add the exit step
            steps.push(new CSSg&(node&&C;
        visit(this.ast); '}
T^Xx{export namespace visitorKeys {
    let AnPlusB: any[];
    let Atrule: string[];
    let AtrulePrelude: string[];
    let AttributeSelector: string[];
    let Block: string[];
    let Brackets: string[];
    let CDC: any[];
    let CDO: any[];
    let ClassSelector: any[];
    let Combinator: any[];
    let Comment: any[];
    let Condition: string[];
    let Declaration: string[];
    let DeclarationList: string[];
    let Dimension: any[];
    let Feature: string[];
    let FeatureFunction: string[];
    let FeatureRange: string[];
    let Function: string[];
    let GeneralEnclosed: string[];
    let Hash: any[];
    let IdSelector: any[];
    let Identifier: any[];
    let Layer: any[];
    let LayerList: string[];
    let MediaQuery: string[];
    let MediaQueryList: string[];
    let NestingSelector: any[];
    let Nth: string[];
    let Number: any[];
    let Operator: any[];
    let Parentheses: string[];
    let Percentage: any[];
    let PseudoClassSelector: string[];
    let PseudoElementSelector: string[];
    let Ratio: string[];
    let Raw: any[];
    let Rule: string[];
    let Scope: string[];
    let Selector: string[];
    let SelectorList: string[];
    let String: any[];
    let StyleSheet: string[];
    let SupportsDeclaration: string[];
    let TypeSelector: any[];
    let UnicodeRange: any[];
    let Url: any[];
    let Value: string[];
    let WhiteSpace: any[];
}
Wxy/**
 * @fileoverview Visitor keys for the CSS Tree AST.
 * @author Nicholas C. Zakas
 */
export const visitorKeys = {
    AnPlusB: [],
    Atrule: ["prelude", "block"],
    AtrulePrelude: ["children"],
    AttributeSelector: ["name", "value"],
    Block: ["children"],
    Brackets: ["children"],
    CDC: [],
    CDO: [],
    ClassSelector: [],
    Combinator: [],
    Comment: [],
    Condition: ["children"],
    Declaration: ["value"],
    DeclarationList: ["children"],
    Dimension: [],
    Feature: ["value"],
    FeatureFunction: ["value"],
    FeatureRange: ["left", "middle", "right"],
    Function: ["children"],
    GeneralEnclosed: ["children"],
    Hash: [],
    IdSelector: [],
    Identifier: [],
    Layer: [],
    LayerList: ["children"],
    MediaQuery: ["condition"],
    MediaQueryList: ["children"],
    NestingSelector: [],
    Nth: ["nth", "selector"],
    Number: [],
    Operator: [],
    Parentheses: ["children"],
    Percentage: [],
    PseudoClassSelector: ["children"],
    PseudoElementSelector: ["children"],
    Ratio: ["left", "right"],
    Raw: [],
    Rule: ["prelude", "block"],
    Scope: ["root", "limit"],
    Selector: ["children"],
    SelectorList: ["children"],
    String: [],
    StyleSheet: ["children"],
    SupportsDeclaration: ["declaration"],
    TypeSelector: [],
    UnicodeRange: [],
    Url: [],
    Value: ["children"],
    WhiteSpace: [],
};
!Ϧax100644 font-family-fallbacks.d.ts »nCY:<x;100644 font-family-fallbacks.js t;UVZL3!100644 no-duplicate-imports.d.ts &v_ve]jb!4.100644 no-duplicate-imports.js =jR#5<xA'100644 no-duplicate-keyframe-selectors.d.ts ēW),8ۓ3Kf100644 no-duplicate-keyframe-selectors.js 1yL^ƅc100644 no-empty-blocks.d.ts sB{[?+99	F]100644 no-empty-blocks.js HEݦפx!QEXVfr100644 no-important.d.ts d!r)䵜Gu6
100644 no-important.js !먃K.1kl=Y100644 no-invalid-at-rule-placement.d.ts Q;#p4100644 no-invalid-at-rule-placement.js  Ŧloي?dq"w100644 no-invalid-at-rules.d.ts 4%tDQVb^NW100644 no-invalid-at-rules.js _s֫#J.100644 no-invalid-named-grid-areas.d.ts 1d8R+V6~B?100644 no-invalid-named-grid-areas.js ̷)~؝Bؤw!VƖ100644 no-invalid-properties.d.ts 5=v 100644 no-invalid-properties.js ,y'ڀ\\z"ytW\~j100644 no-unmatchable-selectors.d.ts ~-widgZ100644 no-unmatchable-selectors.js <iZdkSh$SO24100644 prefer-logical-properties.d.ts .8N+ڱh100644 prefer-logical-properties.js v ׳F*k[^q100644 relative-font-units.d.ts Ir$350?100644 relative-font-units.js +&F1V100644 selector-complexity.d.ts m\w #t$100644 selector-complexity.js Aȥؠ|_2rmi100644 use-baseline.d.ts XPQA[MSHH!100644 use-baseline.js 7u\B1iSLg[8100644 use-layers.d.ts e	@<9Q(<x0100644 use-layers.js TBJhQRsb^~0
_ٳKxLdeclare namespace _default {
    namespace meta {
        let type: "suggestion";
        namespace docs {
            let description: string;
            let recommended: boolean;
            let url: string;
        }
        namespace messages {
            let useFallbackFonts: string;
            let useGenericFont: string;
        }
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../index.js").CSSLanguageOptions;
        Code: import("../index.js").CSSSourceCode;
        RuleOptions: [];
        Node: import("@eslint/css-tree").CssNodePlain;
        MessageIds: FontFamilyFallbacksMessageIds;
    }>): {
        "Rule > Block > Declaration"(node: any): void;
        "Rule > Block > Declaration[property='font-family'] > Value"(node: any): void;
        "Rule > Block > Declaration[property='font'] > Value"(node: any): void;
    };
}
export default _default;
export type FontFamilyFallbacksMessageIds = "useFallbackFonts" | "useGenericFont";
export type FontFamilyFallbacksRuleDefinition = CSSRuleDefinition<{
    RuleOptions: [];
    MessageIds: FontFamilyFallbacksMessageIds;
}>;
import type { CSSRuleDefinition } from "../types.js";
{x?{/**
 * @fileoverview Rule to enforce the use of fallback fonts and a generic font last.
 * @author Tanuj Kanti
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { CSSRuleDefinition } from "../types.js"
 * @typedef {"useFallbackFonts" | "useGenericFont"} FontFamilyFallbacksMessageIds
 * @typedef {CSSRuleDefinition<{ RuleOptions: [], MessageIds: FontFamilyFallbacksMessageIds }>} FontFamilyFallbacksRuleDefinition
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
const genericFonts = new Set([
    "serif",
    "sans-serif",
    "monospace",
    "cursive",
    "fantasy",
    "system-ui",
    "ui-serif",
    "ui-sans-serif",
    "ui-monospace",
    "ui-rounded",
    "emoji",
    "math",
    "fangsong",
]);
/**
 * Check if the value is a CSS-wide keyword.
 * @param {string} value The value to check.
 * @param {Set<string>} cssWideKeywords The CSS-wide keywords to check against.
 * @returns {boolean} True if the value is a CSS-wide keyword, false otherwise.
 */
function isCSSWideKeyword(value, cssWideKeywords) {
    return cssWideKeywords.has(value.trim().toLowerCase());
}
/**
 * Check if the node is an identifier with a CSS-wide keyword.
 * @param {Object} node The node to check.
 * @param {Set<string>} cssWideKeywords The CSS-wide keywords to check against.
 * @returns {boolean} True if the node is a CSS-wide keyword identifier, false otherwise.
 */
function isCSSWideKeywordIdentifier(node, cssWideKeywords) {
    return (node.type === "Identifier" &&
        isCSSWideKeyword(node.name, cssWideKeywords));
}
/**
 * Check if the node is a CSS variable function.
 * @param {Object} node The node to check.
 * @returns {boolean} True if the node is a variable function, false otherwise.
 */
function isVarFunction(node) {
    return node.type === "Function" && node.name === "var";
}
/**
 * Report an error if the font property values do not have fallbacks or a generic font.
 * @param {string} fontPropertyValues The font property values to check.
 * @param {Object} context The ESLint context object.
 * @param {Object} node The CSS node being checked.
 * @param {Set<string>} cssWideKeywords The CSS-wide keywords to check against.
 * @returns {void}
 * @private
 */
function reportFontWithoutFallbacksInFontProperty(fontPropertyValues, context, node, cssWideKeywords) {
    if (isCSSWideKeyword(fontPropertyValues, cssWideKeywords)) {
        return;
    }
    const valueList = fontPropertyValues.split(",").map(v => v.trim());
    if (valueList.length === 1) {
        const containsGenericFont = Array.from(genericFonts).some(font => valueList[0].includes(font));
        if (!containsGenericFont) {
            context.report({
                loc: node.loc,
                messageId: "useFallbackFonts",
            });
        }
    }
    else {
        if (!genericFonts.has(valueList.at(-1))) {
            context.report({
                loc: node.loc,
                messageId: "useGenericFont",
            });
        }
    }
}
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {FontFamilyFallbacksRuleDefinition} */ ({
    meta: {
        type: "suggestion",
        docs: {
            description: "Enforce use of fallback fonts and a generic font last",
            recommended: true,
            url: "https://github.com/eslint/css/blob/main/docs/rules/font-family-fallbacks.md",
        },
        messages: {
            useFallbackFonts: "Use fallback fonts and a generic font last.",
            useGenericFont: "Use a generic font last.",
        },
    },
    create(context) {
        const sourceCode = context.sourceCode;
        const cssWideKeywords = new Set(sourceCode.lexer.cssWideKeywords.map(keyword => keyword.toLowerCase()));
        const variableMap = new Map();
        return {
            "Rule > Block > Declaration"(node) {
                if (node.property.startsWith("--")) {
                    const variableName = node.property;
                    const variableValue = node.value.type === "Raw" && node.value.value;
                    variableMap.set(variableName, variableValue);
                }
            },
            "Rule > Block > Declaration[property='font-family'] > Value"(node) {
                const valueArr = node.children;
                if (valueArr.length === 1) {
                    if (isCSSWideKeywordIdentifier(valueArr[0], cssWideKeywords)) {
                        return;
                    }
                    if (valueArr[0].type === "Function" &&
                        valueArr[0].name === "var") {
                        const variableName = valueArr[0].children[0].type === "Identifier" &&
                            valueArr[0].children[0].name;
                        const variableValue = variableMap.get(variableName);
                        if (!variableValue) {
                            return;
                        }
                        if (isCSSWideKeyword(variableValue, cssWideKeywords)) {
                            return;
                        }
                        const variableList = variableValue
                            .split(",")
                            .map(v => v.trim());
                        if (variableList.length === 1 &&
                            !genericFonts.has(variableList[0])) {
                            context.report({
                                loc: node.loc,
                                messageId: "useFallbackFonts",
                            });
                        }
                        else if (!genericFonts.has(variableList.at(-1))) {
                            context.report({
                                loc: node.loc,
                                messageId: "useGenericFont",
                            });
                        }
                    }
                    else {
                        if (valueArr[0].type === "Identifier" &&
                            genericFonts.has(valueArr[0].name)) {
                            return;
                        }
                        context.report({
                            loc: node.loc,
                            messageId: "useFallbackFonts",
                        });
                    }
                }
                else {
                    const isUsingVariable = valueArr.some(child => isVarFunction(child));
                    if (isUsingVariable) {
                        const fontsList = [];
                        const lastNode = valueArr.at(-1);
                        if (lastNode.type === "Function" &&
                            lastNode.name === "var") {
                            const variableName = lastNode.children[0].type === "Identifier" &&
                                lastNode.children[0].name;
                            const lastVariable = variableMap.get(variableName);
                            if (!lastVariable) {
                                return;
                            }
                        }
                        valueArr.forEach(child => {
                            if (child.type === "String") {
                                fontsList.push(child.value);
                            }
                            if (child.type === "Identifier") {
                                fontsList.push(child.name);
                            }
                            if (child.type === "Function" &&
                                child.name === "var") {
                                const variableName = child.children[0].type === "Identifier" &&
                                    child.children[0].name;
                                const variableValue = variableMap.get(variableName);
                                if (variableValue) {
                                    const variableList = variableValue
                                        .split(",")
                                        .map(v => v.trim());
                                    fontsList.push(...variableList);
                                }
                            }
                        });
                        if (fontsList.length > 0 &&
                            !genericFonts.has(fontsList.at(-1))) {
                            context.report({
                                loc: node.loc,
                                messageId: "useGenericFont",
                            });
                        }
                    }
                    else {
                        const lastFont = valueArr.at(-1);
                        if (!(lastFont.type === "Identifier" &&
                            genericFonts.has(lastFont.name))) {
                            context.report({
                                loc: node.loc,
                                messageId: "useGenericFont",
                            });
                        }
                    }
                }
            },
            "Rule > Block > Declaration[property='font'] > Value"(node) {
                const valueArr = node.children;
                if (valueArr.length === 1) {
                    const firstValue = valueArr[0];
                    // If it font is set to system font, we don't need to check for fallbacks
                    if (firstValue.type === "Identifier") {
                        return;
                    }
                    // If the value is a variable function, we need to check the variable value
                    if (firstValue.type === "Function" &&
                        firstValue.name === "var") {
                        // Check if the function is a variable
                        const variableName = firstValue.children[0].type === "Identifier" &&
                            firstValue.children[0].name;
                        const variableValue = variableMap.get(variableName);
                        if (!variableValue) {
                            return;
                        }
                        reportFontWithoutFallbacksInFontProperty(variableValue, context, node, cssWideKeywords);
                    }
                }
                else {
                    const isUsingVariable = valueArr.some(child => isVarFunction(child));
                    if (isUsingVariable) {
                        const beforOperator = [];
                        const afterOperator = [];
                        const operator = valueArr.find(child => child.type === "Operator" &&
                            child.value === ",");
                        const operatorOffset = operator && operator.loc.end.offset;
                        if (operatorOffset) {
                            valueArr.forEach(child => {
                                if (child.loc.end.offset < operatorOffset) {
                                    beforOperator.push(sourceCode.getText(child).trim());
                                }
                                else if (child.loc.end.offset > operatorOffset) {
                                    afterOperator.push(sourceCode.getText(child).trim());
                                }
                            });
                            if (afterOperator.length !== 0) {
                                const usingVar = afterOperator.some(value => value.startsWith("var"));
                                if (!usingVar) {
                                    if (!genericFonts.has(afterOperator.at(-1))) {
                                        context.report({
                                            loc: node.loc,
                                            messageId: "useGenericFont",
                                        });
                                    }
                                }
                                else {
                                    if (afterOperator.at(-1).startsWith("var")) {
                                        const lastNode = valueArr.at(-1);
                                        const isFunctionVar = lastNode.type === "Function" &&
                                            lastNode.name === "var";
                                        const variableName = isFunctionVar &&
                                            lastNode.children[0].type ===
                                                "Identifier" &&
                                            lastNode.children[0].name;
                                        const variableValue = variableMap.get(variableName);
                                        if (!variableValue) {
                                            return;
                                        }
                                        const variableList = variableValue
                                            .split(",")
                                            .map(v => v.trim());
                                        if (variableList.length > 0 &&
                                            !genericFonts.has(variableList.at(-1))) {
                                            context.report({
                                                loc: node.loc,
                                                messageId: "useGenericFont",
                                            });
                                        }
                                    }
                                    else {
                                        if (!genericFonts.has(afterOperator.at(-1))) {
                                            context.report({
                                                loc: node.loc,
                                                messageId: "useGenericFont",
                                            });
                                        }
                                    }
                                }
                            }
                        }
                        else {
                            if (sourceCode
                                .getText(valueArr.at(-1))
                                .trim()
                                .startsWith("var")) {
                                const lastNode = valueArr.at(-1);
                                const isFunctionVar = lastNode.type === "Function" &&
                                    lastNode.name === "var";
                                const variableName = isFunctionVar &&
                                    lastNode.children[0].type ===
                                        "Identifier" &&
                                    lastNode.children[0].name;
                                const variableValue = variableMap.get(variableName);
                                if (!variableValue) {
                                    return;
                                }
                                reportFontWithoutFallbacksInFontProperty(variableValue, context, node, cssWideKeywords);
                            }
                            else {
                                if (!genericFonts.has(sourceCode
                                    .getText(valueArr.at(-1))
                                    .trim())) {
                                    context.report({
                                        loc: node.loc,
                                        messageId: "useFallbackFonts",
                                    });
                                }
                            }
                        }
                    }
                    else {
                        const fontPropertyValues = sourceCode.getText(node);
                        if (fontPropertyValues) {
                            reportFontWithoutFallbacksInFontProperty(fontPropertyValues, context, node, cssWideKeywords);
                        }
                    }
                }
            },
        };
    },
});
tLx7declare namespace _default {
    namespace meta {
        let type: "problem";
        let fixable: "code";
        let hasSuggestions: true;
        namespace docs {
            let description: string;
            let recommended: boolean;
            let url: string;
        }
        namespace messages {
            let duplicateImport: string;
            let removeDuplicateImportWithModifiers: string;
            let removeDuplicateImportWithoutModifiers: string;
        }
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../index.js").CSSLanguageOptions;
        Code: import("../index.js").CSSSourceCode;
        RuleOptions: [];
        Node: import("@eslint/css-tree").CssNodePlain;
        MessageIds: NoDuplicateKeysMessageIds;
    }>): {
        "Atrule[name=/^import$/i]"(node: any): void;
    };
}
export default _default;
export type NoDuplicateKeysMessageIds = "duplicateImport" | "removeDuplicateImportWithModifiers" | "removeDuplicateImportWithoutModifiers";
export type NoDuplicateImportsRuleDefinition = CSSRuleDefinition<{
    RuleOptions: [];
    MessageIds: NoDuplicateKeysMessageIds;
}>;
import type { CSSRuleDefinition } from "../types.js";
2Nx	/**
 * @fileoverview Rule to prevent duplicate imports in CSS.
 * @author Nicholas C. Zakas
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { CSSRuleDefinition } from "../types.js"
 * @typedef {"duplicateImport" | "removeDuplicateImportWithModifiers" | "removeDuplicateImportWithoutModifiers"} NoDuplicateKeysMessageIds
 * @typedef {CSSRuleDefinition<{ RuleOptions: [], MessageIds: NoDuplicateKeysMessageIds }>} NoDuplicateImportsRuleDefinition
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
/**
 * Get the end index of import statement including a following newline if present.
 * @param {string} text The full text of the source code.
 * @param {number} end The end index of the import statement.
 * @returns {number} The end index of the import statement including a following newline.
 */
function getImportEnd(text, end) {
    let removeEnd = end;
    // Remove the node, and also remove a following newline if present
    if (text[removeEnd] === "\r") {
        removeEnd += text[removeEnd + 1] === "\n" ? 2 : 1;
    }
    else if (text[removeEnd] === "\n" || text[removeEnd] === "\f") {
        removeEnd += 1;
    }
    return removeEnd;
}
/**
 * Get the modifiers of an import statement.
 * @param {Object} importNode The import node to get modifiers from.
 * @param {Object} sourceCode The source code object.
 * @returns {string[]} An array of modifiers for the import statement.
 */
function getImportModifiers(importNode, sourceCode) {
    const importModifiers = [];
    const importHasModifiers = importNode.prelude?.children.length > 1;
    if (importHasModifiers) {
        importNode.prelude?.children.slice(1).forEach(modifier => {
            const modifierText = sourceCode.getText(modifier).trim();
            importModifiers.push(modifierText);
        });
    }
    return importModifiers;
}
/**
 * Get the fix for a duplicate import statement.
 * @param {Object} fixer The fixer object.
 * @param {string} text The full text of the source code.
 * @param {number} start The start index of the import statement to fix.
 * @param {number} end The end index of the import statement to fix.
 * @param {boolean} hasModifiers A boolean indicating whether the import statement has modifiers that differ from the original import.
 * @returns {Object|null} A fix object if a fix is applicable, or null if no fix should be applied.
 */
function getFixForImport(fixer, text, start, end, hasModifiers) {
    const removeEnd = getImportEnd(text, end);
    if (hasModifiers) {
        return fixer.removeRange([start, removeEnd]);
    }
    return null;
}
//-----------------------------------------------------------------------------
// Rule
//-----------------------------------------------------------------------------
export default /** @satisfies {NoDuplicateImportsRuleDefinition} */ ({
    meta: {
        type: "problem",
        fixable: "code",
        hasSuggestions: true,
        docs: {
            description: "Disallow duplicate @import rules",
            recommended: true,
            url: "https://github.com/eslint/css/blob/main/docs/rules/no-duplicate-imports.md",
        },
        messages: {
            duplicateImport: "Unexpected duplicate @import rule for '{{url}}'.",
            removeDuplicateImportWithModifiers: "Remove duplicate @import rule with modifier(s) - {{modifiers}}.",
            removeDuplicateImportWithoutModifiers: "Remove duplicate @import rule without modifiers.",
        },
    },
    create(context) {
        const { sourceCode } = context;
        const imports = [];
        return {
            "Atrule[name=/^import$/i]"(node) {
                const url = node.prelude?.children[0].value;
                const hasImport = imports.some(importNode => importNode.prelude?.children[0].value === url);
                if (hasImport) {
                    const firstImportNode = imports.find(importNode => importNode.prelude?.children[0].value === url);
                    const [firstImportStart, firstImportEnd] = sourceCode.getRange(firstImportNode);
                    const firstImportHasModifiers = firstImportNode.prelude?.children.length > 1;
                    const nodeHasModifiers = node.prelude?.children.length > 1;
                    const [start, end] = sourceCode.getRange(node);
                    const text = sourceCode.text;
                    const firstImportModifiers = getImportModifiers(firstImportNode, sourceCode);
                    const duplicateImportModifiers = getImportModifiers(node, sourceCode);
                    const hasSameModifiers = firstImportModifiers.length ===
                        duplicateImportModifiers.length &&
                        firstImportModifiers.every((modifier, index) => modifier === duplicateImportModifiers[index]);
                    context.report({
                        loc: node.loc,
                        messageId: "duplicateImport",
                        data: { url },
                        fix(fixer) {
                            const hasModifiers = (!firstImportHasModifiers &&
                                !nodeHasModifiers) ||
                                hasSameModifiers;
                            return getFixForImport(fixer, text, start, end, hasModifiers);
                        },
                        suggest: [
                            {
                                messageId: firstImportHasModifiers
                                    ? "removeDuplicateImportWithModifiers"
                                    : "removeDuplicateImportWithoutModifiers",
                                data: {
                                    modifiers: firstImportModifiers.join(" "),
                                },
                                fix(fixer) {
                                    const hasModifiers = (firstImportHasModifiers ||
                                        nodeHasModifiers) &&
                                        !hasSameModifiers;
                                    return getFixForImport(fixer, text, firstImportStart, firstImportEnd, hasModifiers);
                                },
                            },
                            {
                                messageId: nodeHasModifiers
                                    ? "removeDuplicateImportWithModifiers"
                                    : "removeDuplicateImportWithoutModifiers",
                                data: {
                                    modifiers: duplicateImportModifiers.join(" "),
                                },
                                fix(fixer) {
                                    const hasModifiers = (firstImportHasModifiers ||
                                        nodeHasModifiers) &&
                                        !hasSameModifiers;
                                    return getFixForImport(fixer, text, start, end, hasModifiers);
                                },
                            },
                        ],
                    });
                }
                else {
                    imports.push(node);
                }
            },
        };
    },
});
^%5#Hx}declare namespace _default {
    namespace meta {
        let type: "problem";
        namespace docs {
            let description: string;
            let recommended: boolean;
            let url: string;
        }
        namespace messages {
            let duplicateKeyframeSelector: string;
        }
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../index.js").CSSLanguageOptions;
        Code: import("../index.js").CSSSourceCode;
        RuleOptions: [];
        Node: import("@eslint/css-tree").CssNodePlain;
        MessageIds: "duplicateKeyframeSelector";
    }>): {
        "Atrule[name=/^(-(o|moz|webkit)-)?keyframes$/i]"(): void;
        "Atrule[name=/^(-(o|moz|webkit)-)?keyframes$/i]:exit"(): void;
        Rule(node: import("@eslint/css-tree").RulePlain): void;
    };
}
export default _default;
export type DuplicateKeyframeSelectorMessageIds = "duplicateKeyframeSelector";
export type DuplicateKeyframeSelectorRuleDefinition = CSSRuleDefinition<{
    RuleOptions: [];
    MessageIds: DuplicateKeyframeSelectorMessageIds;
}>;
import type { CSSRuleDefinition } from "../types.js";
p~x
_/**
 * @fileoverview Rule to disallow duplicate selectors within keyframe blocks.
 * @author Nitin Kumar
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { CSSRuleDefinition } from "../types.js"
 * @typedef {"duplicateKeyframeSelector"} DuplicateKeyframeSelectorMessageIds
 * @typedef {CSSRuleDefinition<{ RuleOptions: [], MessageIds: DuplicateKeyframeSelectorMessageIds }>} DuplicateKeyframeSelectorRuleDefinition
 */
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {DuplicateKeyframeSelectorRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            description: "Disallow duplicate selectors within keyframe blocks",
            recommended: true,
            url: "https://github.com/eslint/css/blob/main/docs/rules/no-duplicate-keyframe-selectors.md",
        },
        messages: {
            duplicateKeyframeSelector: "Unexpected duplicate selector '{{selector}}' found within keyframe block.",
        },
    },
    create(context) {
        let insideKeyframes = false;
        const seen = new Map();
        return {
            "Atrule[name=/^(-(o|moz|webkit)-)?keyframes$/i]"() {
                insideKeyframes = true;
                seen.clear();
            },
            "Atrule[name=/^(-(o|moz|webkit)-)?keyframes$/i]:exit"() {
                insideKeyframes = false;
            },
            Rule(node) {
                if (!insideKeyframes) {
                    return;
                }
                // @ts-ignore - children is a valid property for prelude
                const selector = node.prelude.children[0].children[0];
                let value;
                if (selector.type === "Percentage") {
                    value = `${selector.value}%`;
                }
                else if (selector.type === "TypeSelector") {
                    value = selector.name.toLowerCase();
                }
                else {
                    value = selector.value;
                }
                if (seen.has(value)) {
                    context.report({
                        loc: selector.loc,
                        messageId: "duplicateKeyframeSelector",
                        data: {
                            selector: value,
                        },
                    });
                }
                else {
                    seen.set(value, true);
                }
            },
        };
    },
});
&Ӌ:xUdeclare namespace _default {
    namespace meta {
        let type: "problem";
        namespace docs {
            let description: string;
            let recommended: boolean;
            let url: string;
        }
        namespace messages {
            let emptyBlock: string;
        }
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../index.js").CSSLanguageOptions;
        Code: import("../index.js").CSSSourceCode;
        RuleOptions: [];
        Node: import("@eslint/css-tree").CssNodePlain;
        MessageIds: "emptyBlock";
    }>): {
        Block(node: import("@eslint/css-tree").BlockPlain): void;
    };
}
export default _default;
export type NoEmptyBlocksMessageIds = "emptyBlock";
export type NoEmptyBlocksRuleDefinition = CSSRuleDefinition<{
    RuleOptions: [];
    MessageIds: NoEmptyBlocksMessageIds;
}>;
import type { CSSRuleDefinition } from "../types.js";
%NWxr/**
 * @fileoverview Rule to prevent empty blocks in CSS.
 * @author Nicholas C. Zakas
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { CSSRuleDefinition } from "../types.js"
 * @typedef {"emptyBlock"} NoEmptyBlocksMessageIds
 * @typedef {CSSRuleDefinition<{ RuleOptions: [], MessageIds: NoEmptyBlocksMessageIds }>} NoEmptyBlocksRuleDefinition
 */
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {NoEmptyBlocksRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            description: "Disallow empty blocks",
            recommended: true,
            url: "https://github.com/eslint/css/blob/main/docs/rules/no-empty-blocks.md",
        },
        messages: {
            emptyBlock: "Unexpected empty block found.",
        },
    },
    create(context) {
        return {
            Block(node) {
                if (node.children.length === 0) {
                    context.report({
                        loc: node.loc,
                        messageId: "emptyBlock",
                    });
                }
            },
        };
    },
});
)GlJxPdeclare namespace _default {
    namespace meta {
        let type: "problem";
        namespace docs {
            let description: string;
            let recommended: boolean;
            let url: string;
        }
        namespace messages {
            let invalidCharsetPlacement: string;
            let invalidImportPlacement: string;
            let invalidNamespacePlacement: string;
        }
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../index.js").CSSLanguageOptions;
        Code: import("../index.js").CSSSourceCode;
        RuleOptions: [];
        Node: import("@eslint/css-tree").CssNodePlain;
        MessageIds: NoInvalidAtRulePlacementMessageIds;
    }>): {
        Atrule(node: import("@eslint/css-tree").AtrulePlain): void;
        Rule(): void;
    };
}
export default _default;
export type NoInvalidAtRulePlacementMessageIds = "invalidCharsetPlacement" | "invalidImportPlacement" | "invalidNamespacePlacement";
export type NoInvalidAtRulePlacementRuleDefinition = CSSRuleDefinition<{
    RuleOptions: [];
    MessageIds: NoInvalidAtRulePlacementMessageIds;
}>;
import type { CSSRuleDefinition } from "../types.js";
Q<x 	Wlet hasSuggestions: trueMunexpectedImportaremoveImporta7mporta!Declaration"DeclarationPlain3:UmportantMessageIds = "unexpectedImportant" | "removeImportant";
export type NoImportaOmportagHһRx/**
 * @fileoverview Rule to disallow `!important` flags.
 * @author thecalamiity
 * @author Yann Bertrand
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { CSSRuleDefinition } from "../types.js"
 * @typedef {"unexpectedImportant" | "removeImportant"} NoImportantMessageIds
 * @typedef {CSSRuleDefinition<{ RuleOptions: [], MessageIds: NoImportantMessageIds }>} NoImportantRuleDefinition
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
const importantPattern = /!\s*important/iu;
const commentPattern = /\/\*[\s\S]*?\*\//gu;
const trailingWhitespacePattern = /\s*$/u;
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {NoImportantRuleDefinition} */ ({
    meta: {
        type: "problem",
        hasSuggestions: true,
        docs: {
            description: "Disallow !important flags",
            recommended: true,
            url: "https://github.com/eslint/css/blob/main/docs/rules/no-important.md",
        },
        messages: {
            unexpectedImportant: "Unexpected !important flag found.",
            removeImportant: "Remove !important flag.",
        },
    },
    create(context) {
        const { sourceCode } = context;
        return {
            Declaration(node) {
                if (node.important) {
                    const declarationText = sourceCode.getText(node);
                    const textWithoutComments = declarationText.replace(commentPattern, 
                    /* eslint-disable-next-line require-unicode-regexp -- we want to replace each code unit with a space */
                    match => match.replace(/[^\r\n\f]/g, " "));
                    const importantMatch = importantPattern.exec(textWithoutComments);
                    const importantStartOffset = importantMatch.index;
                    const importantEndOffset = importantStartOffset + importantMatch[0].length;
                    const nodeStartOffset = node.loc.start.offset;
                    context.report({
                        loc: {
                            start: sourceCode.getLocFromIndex(nodeStartOffset + importantStartOffset),
                            end: sourceCode.getLocFromIndex(nodeStartOffset + importantEndOffset),
                        },
                        messageId: "unexpectedImportant",
                        suggest: [
                            {
                                messageId: "removeImportant",
                                fix(fixer) {
                                    // Find any trailing whitespace before the `!important`
                                    const whitespaceEndOffset = declarationText
                                        .slice(0, importantStartOffset)
                                        .search(trailingWhitespacePattern);
                                    return fixer.removeRange([
                                        nodeStartOffset + whitespaceEndOffset,
                                        nodeStartOffset + importantEndOffset,
                                    ]);
                                },
                            },
                        ],
                    });
                }
            },
        };
    },
});
xc/**
 * @fileoverview Rule to enforce correct placement of at-rules.
 * @author thecalamiity
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { CSSRuleDefinition } from "../types.js"
 * @typedef {"invalidCharsetPlacement" | "invalidImportPlacement" | "invalidNamespacePlacement"} NoInvalidAtRulePlacementMessageIds
 * @typedef {CSSRuleDefinition<{ RuleOptions: [], MessageIds: NoInvalidAtRulePlacementMessageIds }>} NoInvalidAtRulePlacementRuleDefinition
 */
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {NoInvalidAtRulePlacementRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            description: "Disallow invalid placement of at-rules",
            recommended: true,
            url: "https://github.com/eslint/css/blob/main/docs/rules/no-invalid-at-rule-placement.md",
        },
        messages: {
            invalidCharsetPlacement: "@charset must be placed at the very beginning of the stylesheet, before any rules, comments, or whitespace.",
            invalidImportPlacement: "@import must be placed before all other rules, except @charset and @layer statements.",
            invalidNamespacePlacement: "@namespace must be placed before all other rules, except @charset and @import.",
        },
    },
    create(context) {
        let hasSeenNonImportRule = false;
        let hasSeenLayerBlock = false;
        let hasSeenLayer = false;
        let hasSeenNamespace = false;
        return {
            Atrule(node) {
                const name = node.name.toLowerCase();
                if (name === "charset") {
                    if (node.loc.start.line !== 1 ||
                        node.loc.start.column !== 1) {
                        context.report({
                            node,
                            messageId: "invalidCharsetPlacement",
                        });
                    }
                    return;
                }
                if (name === "layer") {
                    if (node.block) {
                        hasSeenLayerBlock = true;
                    }
                    hasSeenLayer = true;
                    return;
                }
                if (name === "namespace") {
                    if (hasSeenNonImportRule || hasSeenLayer) {
                        context.report({
                            node,
                            messageId: "invalidNamespacePlacement",
                        });
                    }
                    hasSeenNamespace = true;
                    return;
                }
                if (name === "import") {
                    if (hasSeenNonImportRule ||
                        hasSeenNamespace ||
                        hasSeenLayerBlock) {
                        context.report({
                            node,
                            messageId: "invalidImportPlacement",
                        });
                    }
                    return;
                }
                hasSeenNonImportRule = true;
            },
            Rule() {
                hasSeenNonImportRule = true;
            },
        };
    },
});
I[xBdeclare namespace _default {
    namespace meta {
        let type: "problem";
        let fixable: "code";
        namespace docs {
            let description: string;
            let recommended: boolean;
            let url: string;
        }
        namespace messages {
            let unknownAtRule: string;
            let invalidPrelude: string;
            let unknownDescriptor: string;
            let invalidDescriptor: string;
            let invalidExtraPrelude: string;
            let missingPrelude: string;
            let invalidCharsetSyntax: string;
        }
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../index.js").CSSLanguageOptions;
        Code: import("../index.js").CSSSourceCode;
        RuleOptions: [];
        Node: import("@eslint/css-tree").CssNodePlain;
        MessageIds: NoInvalidAtRulesMessageIds;
    }>): {
        Atrule(node: AtrulePlain): void;
        "AtRule > Block > Declaration"(node: any): void;
    };
}
export default _default;
export type NoInvalidAtRulesMessageIds = "unknownAtRule" | "invalidPrelude" | "unknownDescriptor" | "invalidDescriptor" | "invalidExtraPrelude" | "missingPrelude" | "invalidCharsetSyntax";
export type NoInvalidAtRulesRuleDefinition = CSSRuleDefinition<{
    RuleOptions: [];
    MessageIds: NoInvalidAtRulesMessageIds;
}>;
import type { AtrulePlain } from "@eslint/css-tree";
import type { CSSRuleDefinition } from "../types.js";
2FƼx\$/**
 * @fileoverview Rule to prevent the use of unknown at-rules in CSS.
 * @author Nicholas C. Zakas
 */
//-----------------------------------------------------------------------------
// Imports
//-----------------------------------------------------------------------------
import { isSyntaxMatchError } from "../util.js";
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { AtrulePlain } from "@eslint/css-tree"
 * @import { CSSRuleDefinition } from "../types.js"
 * @typedef {"unknownAtRule" | "invalidPrelude" | "unknownDescriptor" | "invalidDescriptor" | "invalidExtraPrelude" | "missingPrelude" | "invalidCharsetSyntax"} NoInvalidAtRulesMessageIds
 * @typedef {CSSRuleDefinition<{ RuleOptions: [], MessageIds: NoInvalidAtRulesMessageIds }>} NoInvalidAtRulesRuleDefinition
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
/**
 * Set of at-rules that can be nested inside style rules.
 * @see https://www.w3.org/TR/css-nesting-1/#conditionals
 */
const nestableAtRules = new Set([
    "media",
    "supports",
    "layer",
    "scope",
    "container",
    "starting-style",
]);
/**
 * A valid `@charset` rule must:
 * - Enclose the encoding name in double quotes
 * - Include exactly one space character after `@charset`
 * - End immediately with a semicolon
 */
const charsetPattern = /^@charset "[^"]+";$/u;
const charsetEncodingPattern = /^['"]?([^"';]+)['"]?/u;
/**
 * Extracts metadata from an error object.
 * @param {SyntaxError} error The error object to extract metadata from.
 * @returns {Object} The metadata extracted from the error.
 */
function extractMetaDataFromError(error) {
    const message = error.message;
    const atRuleName = /`@(.*)`/u.exec(message)[1];
    let messageId = "unknownAtRule";
    if (message.endsWith("prelude")) {
        messageId = message.includes("should not")
            ? "invalidExtraPrelude"
            : "missingPrelude";
    }
    return {
        messageId,
        data: {
            name: atRuleName,
        },
    };
}
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {NoInvalidAtRulesRuleDefinition} */ ({
    meta: {
        type: "problem",
        fixable: "code",
        docs: {
            description: "Disallow invalid at-rules",
            recommended: true,
            url: "https://github.com/eslint/css/blob/main/docs/rules/no-invalid-at-rules.md",
        },
        messages: {
            unknownAtRule: "Unknown at-rule '@{{name}}' found.",
            invalidPrelude: "Invalid prelude '{{prelude}}' found for at-rule '@{{name}}'. Expected '{{expected}}'.",
            unknownDescriptor: "Unknown descriptor '{{descriptor}}' found for at-rule '@{{name}}'.",
            invalidDescriptor: "Invalid value '{{value}}' for descriptor '{{descriptor}}' found for at-rule '@{{name}}'. Expected {{expected}}.",
            invalidExtraPrelude: "At-rule '@{{name}}' should not contain a prelude.",
            missingPrelude: "At-rule '@{{name}}' should contain a prelude.",
            invalidCharsetSyntax: "Invalid @charset syntax. Expected '@charset \"{{encoding}}\";'.",
        },
    },
    create(context) {
        const { sourceCode } = context;
        const lexer = sourceCode.lexer;
        /**
         * Validates a `@charset` rule for correct syntax:
         * - Verifies the rule name is exactly "charset" (case-sensitive)
         * - Ensures the rule has a prelude
         * - Validates the prelude matches the expected pattern
         * @param {AtrulePlain} node The node representing the rule.
         * @returns {void}
         */
        function validateCharsetRule(node) {
            const { name, prelude, loc } = node;
            const charsetNameLoc = {
                start: loc.start,
                end: {
                    line: loc.start.line,
                    column: loc.start.column + name.length + 1,
                },
            };
            if (name !== "charset") {
                context.report({
                    loc: charsetNameLoc,
                    messageId: "unknownAtRule",
                    data: {
                        name,
                    },
                    fix(fixer) {
                        return fixer.replaceTextRange([
                            loc.start.offset,
                            loc.start.offset + name.length + 1,
                        ], "@charset");
                    },
                });
                return;
            }
            if (!prelude) {
                context.report({
                    loc: charsetNameLoc,
                    messageId: "missingPrelude",
                    data: {
                        name,
                    },
                });
                return;
            }
            const nodeText = sourceCode.getText(node);
            const preludeText = sourceCode.getText(prelude);
            const encoding = preludeText
                .match(charsetEncodingPattern)?.[1]
                ?.trim();
            if (!encoding) {
                context.report({
                    loc: prelude.loc,
                    messageId: "invalidCharsetSyntax",
                    data: { encoding: "<charset>" },
                });
                return;
            }
            if (!charsetPattern.test(nodeText)) {
                context.report({
                    loc: prelude.loc,
                    messageId: "invalidCharsetSyntax",
                    data: { encoding },
                    fix(fixer) {
                        return fixer.replaceText(node, `@charset "${encoding}";`);
                    },
                });
            }
        }
        return {
            Atrule(node) {
                if (node.name.toLowerCase() === "charset") {
                    validateCharsetRule(node);
                    return;
                }
                // checks both name and prelude
                const { error } = lexer.matchAtrulePrelude(node.name, node.prelude);
                if (error) {
                    if (isSyntaxMatchError(error)) {
                        context.report({
                            loc: error.loc,
                            messageId: "invalidPrelude",
                            data: {
                                name: node.name,
                                prelude: error.css,
                                expected: error.syntax,
                            },
                        });
                        return;
                    }
                    const loc = node.loc;
                    context.report({
                        loc: {
                            start: loc.start,
                            end: {
                                line: loc.start.line,
                                // add 1 to account for the @ symbol
                                column: loc.start.column + node.name.length + 1,
                            },
                        },
                        ...extractMetaDataFromError(error),
                    });
                }
            },
            "AtRule > Block > Declaration"(node) {
                // skip custom descriptors
                if (node.property.startsWith("--")) {
                    return;
                }
                // get at rule node
                const atRule = /** @type {AtrulePlain} */ (sourceCode.getParent(sourceCode.getParent(node)));
                if (nestableAtRules.has(atRule.name.toLowerCase())) {
                    return;
                }
                const { error } = lexer.matchAtruleDescriptor(atRule.name, node.property, node.value);
                if (error) {
                    if (isSyntaxMatchError(error)) {
                        context.report({
                            loc: error.loc,
                            messageId: "invalidDescriptor",
                            data: {
                                name: atRule.name,
                                descriptor: node.property,
                                value: error.css,
                                expected: error.syntax,
                            },
                        });
                        return;
                    }
                    const loc = node.loc;
                    context.report({
                        loc: {
                            start: loc.start,
                            end: {
                                line: loc.start.line,
                                column: loc.start.column + node.property.length,
                            },
                        },
                        messageId: "unknownDescriptor",
                        data: {
                            name: atRule.name,
                            descriptor: node.property,
                        },
                    });
                }
            },
        };
    },
});
vbGxudeclare namespace _default {
    namespace meta {
        let type: "problem";
        namespace docs {
            let description: string;
            let recommended: boolean;
            let url: string;
        }
        namespace messages {
            let emptyGridArea: string;
            let unevenGridArea: string;
            let nonRectangularGridArea: string;
        }
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../index.js").CSSLanguageOptions;
        Code: import("../index.js").CSSSourceCode;
        RuleOptions: [];
        Node: import("@eslint/css-tree").CssNodePlain;
        MessageIds: NoInvalidNamedGridAreasMessageIds;
    }>): {
        Declaration(node: import("@eslint/css-tree").DeclarationPlain): void;
    };
}
export default _default;
export type NoInvalidNamedGridAreasMessageIds = "emptyGridArea" | "unevenGridArea" | "nonRectangularGridArea";
export type NoInvalidNamedGridAreasRuleDefinition = CSSRuleDefinition<{
    RuleOptions: [];
    MessageIds: NoInvalidNamedGridAreasMessageIds;
}>;
import type { CSSRuleDefinition } from "../types.js";
b~jxy/**
 * @fileoverview Rule to prevent invalid named grid areas in CSS grid templates.
 * @author xbinaryx
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { CSSRuleDefinition } from "../types.js"
 * @typedef {"emptyGridArea" | "unevenGridArea" | "nonRectangularGridArea"} NoInvalidNamedGridAreasMessageIds
 * @typedef {CSSRuleDefinition<{ RuleOptions: [], MessageIds: NoInvalidNamedGridAreasMessageIds }>} NoInvalidNamedGridAreasRuleDefinition
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
/**
 * Regular expression to match null cell tokens (sequences of one or more dots)
 */
const nullCellToken = /^\.+$/u;
/**
 * Finds non-rectangular grid areas in a 2D grid
 * @param {string[][]} grid 2D array representing the grid areas
 * @returns {Array<{name: string, row: number}>} Array of errors found
 */
function findNonRectangularAreas(grid) {
    const errors = [];
    const reported = new Set();
    const names = [...new Set(grid.flat())].filter(name => !nullCellToken.test(name));
    for (const name of names) {
        const indicesByRow = grid.map(row => {
            const indices = [];
            let idx = row.indexOf(name);
            while (idx !== -1) {
                indices.push(idx);
                idx = row.indexOf(name, idx + 1);
            }
            return indices;
        });
        for (let i = 0; i < indicesByRow.length; i++) {
            for (let j = i + 1; j < indicesByRow.length; j++) {
                const row1 = indicesByRow[i];
                const row2 = indicesByRow[j];
                if (row1.length === 0 || row2.length === 0) {
                    continue;
                }
                if (row1.length !== row2.length ||
                    !row1.every((val, idx) => val === row2[idx])) {
                    const key = `${name}|${j}`;
                    if (!reported.has(key)) {
                        errors.push({ name, row: j });
                        reported.add(key);
                    }
                }
            }
        }
    }
    return errors;
}
const validProps = new Set(["grid-template-areas", "grid-template", "grid"]);
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {NoInvalidNamedGridAreasRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            description: "Disallow invalid named grid areas",
            recommended: true,
            url: "https://github.com/eslint/css/blob/main/docs/rules/no-invalid-named-grid-areas.md",
        },
        messages: {
            emptyGridArea: "Grid area must contain at least one cell token.",
            unevenGridArea: "Grid area strings must have the same number of cell tokens.",
            nonRectangularGridArea: "Cell tokens with name '{{name}}' must form a rectangle.",
        },
    },
    create(context) {
        return {
            Declaration(node) {
                const propName = node.property.toLowerCase();
                if (validProps.has(propName) &&
                    node.value.type === "Value" &&
                    node.value.children.length > 0) {
                    const stringNodes = node.value.children.filter(child => child.type === "String");
                    if (stringNodes.length === 0) {
                        return;
                    }
                    const grid = [];
                    const emptyNodes = [];
                    const unevenNodes = [];
                    let firstRowLen = null;
                    for (const stringNode of stringNodes) {
                        const trimmedValue = stringNode.value.trim();
                        if (trimmedValue === "") {
                            emptyNodes.push(stringNode);
                            continue;
                        }
                        const row = trimmedValue.split(" ").filter(Boolean);
                        grid.push(row);
                        if (firstRowLen === null) {
                            firstRowLen = row.length;
                        }
                        else if (row.length !== firstRowLen) {
                            unevenNodes.push(stringNode);
                        }
                    }
                    if (emptyNodes.length > 0) {
                        emptyNodes.forEach(emptyNode => context.report({
                            node: emptyNode,
                            messageId: "emptyGridArea",
                        }));
                        return;
                    }
                    if (unevenNodes.length > 0) {
                        unevenNodes.forEach(unevenNode => context.report({
                            node: unevenNode,
                            messageId: "unevenGridArea",
                        }));
                        return;
                    }
                    const nonRectErrors = findNonRectangularAreas(grid);
                    nonRectErrors.forEach(({ name, row }) => {
                        const stringNode = stringNodes[row];
                        context.report({
                            node: stringNode,
                            messageId: "nonRectangularGridArea",
                            data: {
                                name,
                            },
                        });
                    });
                }
            },
        };
    },
});
1Ƕx	declare namespace _default {
    namespace meta {
        let type: "problem";
        let hasSuggestions: true;
        namespace docs {
            let description: string;
            let url: string;
        }
        let schema: {
            type: "object";
            properties: {
                allowProperties: {
                    type: "array";
                    items: {
                        enum: string[];
                    };
                    uniqueItems: true;
                };
                allowUnits: {
                    type: "array";
                    items: {
                        enum: string[];
                    };
                    uniqueItems: true;
                };
            };
            additionalProperties: false;
        }[];
        let defaultOptions: [{
            allowProperties: any[];
            allowUnits: any[];
        }];
        namespace messages {
            let notLogicalProperty: string;
            let notLogicalValue: string;
            let notLogicalUnit: string;
            let replaceWithLogicalProperty: string;
            let replaceWithLogicalValue: string;
            let replaceWithLogicalUnit: string;
        }
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../index.js").CSSLanguageOptions;
        Code: import("../index.js").CSSSourceCode;
        RuleOptions: PreferLogicalPropertiesOptions;
        Node: import("@eslint/css-tree").CssNodePlain;
        MessageIds: PreferLogicalPropertiesMessageIds;
    }>): {
        Declaration(node: import("@eslint/css-tree").DeclarationPlain): void;
        Dimension(node: import("@eslint/css-tree").Dimension): void;
    };
}
export default _default;
export type PreferLogicalPropertiesMessageIds = "notLogicalProperty" | "notLogicalValue" | "notLogicalUnit" | "replaceWithLogicalProperty" | "replaceWithLogicalValue" | "replaceWithLogicalUnit";
export type PreferLogicalPropertiesOptions = [{
    allowProperties?: string[];
    allowUnits?: string[];
}];
export type PreferLogicalPropertiesRuleDefinition = CSSRuleDefinition<{
    RuleOptions: PreferLogicalPropertiesOptions;
    MessageIds: PreferLogicalPropertiesMessageIds;
}>;
import type { CSSRuleDefinition } from "../types.js";
ܫ-.xWyFrecommended: booleanUnknownVariabl?!boolean"UnknownVariables: falsez;invalidPropertyunknown"
unknownVar	NoInvalid^	NoInvalid)"Rule > Block Declaration"(): void;
        "Rule > Block Declaration > Value > *:not(Function)"(node: any): void;
        Function(): void;
        "Function > *:not(Function)"(node: any): void;
        "Function:exit"(node: FunctionNodePlain): void;
  /      "Rule > Block Declaration:exit"(node: any7NoInvalidPropertiesMessageIds = "invalidPropertyValue" | "unknownProperty" | "unknownVar";
export type NoInvalidPropertiesOptio5UnknownVariables?: boolean;
}];
export type NoInvalid)@	NoInvalid	NoInvalid(+FunctionNodePlain } from "@eslint/css-tree"8xC4/**
 * @fileoverview Rule to prevent invalid properties in CSS.
 * @author Nicholas C. Zakas
 */
//-----------------------------------------------------------------------------
// Imports
//-----------------------------------------------------------------------------
import { isSyntaxMatchError, isSyntaxReferenceError } from "../util.js";
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { CSSRuleDefinition } from "../types.js"
 * @import { ValuePlain, FunctionNodePlain, CssLocationRange } from "@eslint/css-tree";
 * @typedef {"invalidPropertyValue" | "unknownProperty" | "unknownVar"} NoInvalidPropertiesMessageIds
 * @typedef {[{allowUnknownVariables?: boolean}]} NoInvalidPropertiesOptions
 * @typedef {CSSRuleDefinition<{ RuleOptions: NoInvalidPropertiesOptions, MessageIds: NoInvalidPropertiesMessageIds }>} NoInvalidPropertiesRuleDefinition
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
/**
 * Regex to match var() functional notation with optional fallback.
 */
const varFunctionPattern = /var\(\s*(--[^,\s)]+)\s*(?:,([\s\S]+))?\)/iu;
/**
 * Parses a var() function text and extracts the custom property name and fallback.
 * @param {string} text The text containing a var() function.
 * @returns {{ name: string, fallbackText: string | null } | null} The parsed variable name and optional fallback, or null if not a var().
 */
function parseVarFunction(text) {
    const match = text.match(varFunctionPattern);
    if (!match) {
        return null;
    }
    return {
        name: match[1].trim(),
        fallbackText: match[2]?.trim(),
    };
}
/**
 * Extracts the list of fallback value or variable name used in a `var()` that is used as fallback function.
 * For example, for `var(--my-color, var(--fallback-color, red));` it will return `["--fallback-color", "red"]`.
 * @param {string} value The fallback value that is used in `var()`.
 * @returns {Array<string>} The list of variable names of fallback value.
 */
function getVarFallbackList(value) {
    const list = [];
    let currentValue = value;
    while (true) {
        const parsed = parseVarFunction(currentValue);
        if (!parsed) {
            break;
        }
        list.push(parsed.name);
        if (!parsed.fallbackText) {
            break;
        }
        // If fallback is not another var(), we're done
        if (!parsed.fallbackText.toLowerCase().includes("var(")) {
            list.push(parsed.fallbackText);
            break;
        }
        // Continue parsing from fallback
        currentValue = parsed.fallbackText;
    }
    return list;
}
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {NoInvalidPropertiesRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            description: "Disallow invalid properties",
            recommended: true,
            url: "https://github.com/eslint/css/blob/main/docs/rules/no-invalid-properties.md",
        },
        schema: [
            {
                type: "object",
                properties: {
                    allowUnknownVariables: {
                        type: "boolean",
                    },
                },
                additionalProperties: false,
            },
        ],
        defaultOptions: [
            {
                allowUnknownVariables: false,
            },
        ],
        messages: {
            invalidPropertyValue: "Invalid value '{{value}}' for property '{{property}}'. Expected {{expected}}.",
            unknownProperty: "Unknown property '{{property}}' found.",
            unknownVar: "Can't validate with unknown variable '{{var}}'.",
        },
    },
    create(context) {
        const sourceCode = context.sourceCode;
        const lexer = sourceCode.lexer;
        /** @type {Map<string,ValuePlain>} */
        const vars = new Map();
        /**
         * @type {Array<{
         *   valueParts: string[],
         *   functionPartsStack: string[][],
         *   valueSegmentLocs: Map<string,CssLocationRange>,
         *   skipValidation: boolean,
         *   hadVarSubstitution: boolean,
         *   resolvedCache:  Map<string,string>
         * }>}
         */
        const declStack = [];
        const [{ allowUnknownVariables }] = context.options;
        /**
         * Iteratively resolves CSS variable references until a value is found.
         * @param {string} variableName The variable name to resolve
         * @param {Map<string, string>} cache Cache for memoization within a single resolution scope
         * @param {Set<string>} [seen] Set of already seen variables to detect cycles
         * @returns {string|null} The resolved value or null if not found
         */
        function resolveVariable(variableName, cache, seen = new Set()) {
            /** @type {Array<string>} */
            const fallbackStack = [];
            let currentVarName = variableName;
            /*
             * Resolves a CSS variable by following its reference chain.
             *
             * Phase 1: Follow var() references
             * - Use `seen` to detect cycles
             * - Use `cache` for memoization
             * - If value is concrete: cache and return
             * - If value is another var(--next, <fallback>):
             *     push fallback to stack and continue with --next
             * - If variable unknown: proceed to Phase 2
             *
             * Phase 2: Try fallback values (if Phase 1 failed)
             * - Process fallbacks in reverse order (LIFO)
             * - Resolve each via resolveFallback()
             * - Return first successful resolution
             */
            while (true) {
                if (seen.has(currentVarName)) {
                    break;
                }
                seen.add(currentVarName);
                if (cache.has(currentVarName)) {
                    return cache.get(currentVarName);
                }
                const valueNode = vars.get(currentVarName);
                if (!valueNode) {
                    break;
                }
                const valueText = sourceCode.getText(valueNode).trim();
                const parsed = parseVarFunction(valueText);
                if (!parsed) {
                    cache.set(currentVarName, valueText);
                    return valueText;
                }
                if (parsed.fallbackText) {
                    fallbackStack.push(parsed.fallbackText);
                }
                currentVarName = parsed.name;
            }
            while (fallbackStack.length > 0) {
                const fallbackText = fallbackStack.pop();
                // eslint-disable-next-line no-use-before-define -- resolveFallback and resolveVariable are mutually recursive
                const resolvedFallback = resolveFallback(fallbackText, cache, seen);
                if (resolvedFallback !== null) {
                    return resolvedFallback;
                }
            }
            return null;
        }
        /**
         * Resolves a fallback text which can contain nested var() calls.
         * Returns the first resolvable value or null if none resolve.
         * @param {string} rawFallbackText The raw fallback text to resolve.
         * @param {Map<string, string>} cache Cache for memoization within a single resolution scope.
         * @param {Set<string>} [seen] Set of already seen variables to detect cycles.
         * @returns {string | null} The resolved fallback value, or null if none can be resolved.
         */
        function resolveFallback(rawFallbackText, cache, seen = new Set()) {
            const fallbackVarList = getVarFallbackList(rawFallbackText);
            if (fallbackVarList.length === 0) {
                return rawFallbackText;
            }
            for (const fallbackCandidate of fallbackVarList) {
                if (fallbackCandidate.startsWith("--")) {
                    const resolved = resolveVariable(fallbackCandidate, cache, seen);
                    if (resolved !== null) {
                        return resolved;
                    }
                    continue;
                }
                return fallbackCandidate.trim();
            }
            return null;
        }
        /**
         * Process a var function node and add its resolved value to the value list
         * @param {Object} varNode The var() function node
         * @param {string[]} valueList Array to collect processed values
         * @param {Map<string,CssLocationRange>} valueSegmentLocs Map of rebuilt value segments to their locations
         * @param {Map<string, string>} resolvedCache Cache for resolved variable values to prevent redundant lookups
         * @returns {boolean} Whether processing was successful
         */
        function processVarFunction(varNode, valueList, valueSegmentLocs, resolvedCache) {
            const varValue = vars.get(varNode.children[0].name);
            if (varValue) {
                const resolvedValue = resolveVariable(varNode.children[0].name, resolvedCache);
                if (resolvedValue) {
                    valueList.push(resolvedValue);
                    valueSegmentLocs.set(resolvedValue, varNode.loc);
                    return true;
                }
            }
            // If the variable is not found and doesn't have a fallback value, report it
            if (varNode.children.length === 1) {
                if (!allowUnknownVariables) {
                    context.report({
                        loc: varNode.children[0].loc,
                        messageId: "unknownVar",
                        data: { var: varNode.children[0].name },
                    });
                    return false;
                }
                return true;
            }
            // Handle fallback values
            if (varNode.children[2].type !== "Raw") {
                return true;
            }
            const fallbackValue = varNode.children[2].value.trim();
            const resolvedFallbackValue = resolveFallback(fallbackValue, resolvedCache);
            if (resolvedFallbackValue) {
                valueList.push(resolvedFallbackValue);
                valueSegmentLocs.set(resolvedFallbackValue, varNode.loc);
                return true;
            }
            // No valid fallback found
            if (!allowUnknownVariables) {
                context.report({
                    loc: varNode.children[0].loc,
                    messageId: "unknownVar",
                    data: { var: varNode.children[0].name },
                });
                return false;
            }
            return true;
        }
        return {
            "Rule > Block Declaration"() {
                declStack.push({
                    valueParts: [],
                    functionPartsStack: [],
                    valueSegmentLocs: new Map(),
                    skipValidation: false,
                    hadVarSubstitution: false,
                    /**
                     * Cache for resolved variable values within this single declaration.
                     * Prevents re-resolving the same variable and re-walking long `var()` chains.
                     */
                    resolvedCache: new Map(),
                });
            },
            "Rule > Block Declaration > Value > *:not(Function)"(node) {
                const state = declStack.at(-1);
                const text = sourceCode.getText(node).trim();
                state.valueParts.push(text);
                state.valueSegmentLocs.set(text, node.loc);
            },
            Function() {
                const state = declStack.at(-1);
                if (!state) {
                    return;
                }
                state.functionPartsStack.push([]);
            },
            "Function > *:not(Function)"(node) {
                const state = declStack.at(-1);
                if (!state) {
                    return;
                }
                const parts = state.functionPartsStack.at(-1);
                const text = sourceCode.getText(node).trim();
                parts.push(text);
                state.valueSegmentLocs.set(text, node.loc);
            },
            "Function:exit"(node) {
                const state = declStack.at(-1);
                if (!state || state.skipValidation) {
                    return;
                }
                const parts = state.functionPartsStack.pop();
                let result;
                if (node.name.toLowerCase() === "var") {
                    const resolvedParts = [];
                    const success = processVarFunction(node, resolvedParts, state.valueSegmentLocs, state.resolvedCache);
                    if (!success) {
                        state.skipValidation = true;
                        return;
                    }
                    if (resolvedParts.length === 0) {
                        return;
                    }
                    state.hadVarSubstitution = true;
                    result = resolvedParts[0];
                }
                else {
                    result = `${node.name}(${parts.join(" ")})`;
                }
                const parentParts = state.functionPartsStack.at(-1);
                if (parentParts) {
                    parentParts.push(result);
                }
                else {
                    state.valueParts.push(result);
                }
            },
            "Rule > Block Declaration:exit"(node) {
                const state = declStack.pop();
                if (node.property.startsWith("--")) {
                    // store the custom property name and value to validate later
                    vars.set(node.property, node.value);
                    // don't validate custom properties
                    return;
                }
                if (state.skipValidation) {
                    return;
                }
                let value = node.value;
                if (state.hadVarSubstitution) {
                    const valueList = state.valueParts;
                    value =
                        valueList.length > 0
                            ? valueList.join(" ")
                            : sourceCode.getText(node.value);
                }
                const { error } = lexer.matchProperty(node.property, value);
                if (error) {
                    // validation failure
                    if (isSyntaxMatchError(error)) {
                        const errorValue = state.hadVarSubstitution &&
                            value.slice(error.mismatchOffset, error.mismatchOffset + error.mismatchLength);
                        context.report({
                            /*
                             * When using variables, check to see if the error
                             * occurred at a location where a variable was replaced.
                             * If so, use that location; otherwise, use the error's
                             * reported location.
                             */
                            loc: state.hadVarSubstitution
                                ? (state.valueSegmentLocs.get(errorValue) ??
                                    node.value.loc)
                                : error.loc,
                            messageId: "invalidPropertyValue",
                            data: {
                                property: node.property,
                                /*
                                 * When using variables, slice the value to
                                 * only include the part that caused the error.
                                 * Otherwise, use the full value from the error.
                                 */
                                value: state.hadVarSubstitution
                                    ? errorValue
                                    : error.css,
                                expected: error.syntax,
                            },
                        });
                        return;
                    }
                    if (!allowUnknownVariables ||
                        isSyntaxReferenceError(error)) {
                        // unknown property
                        context.report({
                            loc: {
                                start: node.loc.start,
                                end: {
                                    line: node.loc.start.line,
                                    column: node.loc.start.column +
                                        node.property.length,
                                },
                            },
                            messageId: "unknownProperty",
                            data: {
                                property: node.property,
                            },
                        });
                    }
                }
            },
        };
    },
});
)3R^\x +	
unmatchabl<0unmatchableSelector";
    }>): {
        AnPlusB"AnPlusB:7\NoUnmatchableSelectorsMessageIds = "unmatchableSelector";
export type NoUnmatchableSelectorsJNoUnmatchableSelectors<FI21x"&,unmatchable selectors.
 * @author TKDev7
 */R,unmatchableSelector"} NoUnmatchableSelectorsI;NoUnmatchableSelectorsMessageIds }>} NoUnmatchableSelectors&NoUnmatchableSelectors$nunmatchable selectork
unmatchabl7<DunmatchableSelector: "Unexpected unmatchable selector '{{selector}}'4const { sourceCode } = contextFAnPlusB}// Either node.a or node.b can be null; Number(null) === 0.
                // This coercion is intentional so that omitted coefficients are treated as 0.
                const a = Number(node.a);
                const b = Number(node.b);
                if (a <= 0 && b <= 0	=st pseudo = sourceCode.getParent(sourceCode.getParent(node));		.pseudoO	*
unmatchabl	+' selector: sourceCode.getText(pseudo) }	
"};
    },
});
K
ضx6*//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { CSSRuleDefinition } from "../types.js"
 * @typedef {"notLogicalProperty" | "notLogicalValue" | "notLogicalUnit" | "replaceWithLogicalProperty" | "replaceWithLogicalValue" | "replaceWithLogicalUnit"} PreferLogicalPropertiesMessageIds
 * @typedef {[{
 *     allowProperties?: string[],
 *     allowUnits?: string[]
 * }]} PreferLogicalPropertiesOptions
 * @typedef {CSSRuleDefinition<{ RuleOptions: PreferLogicalPropertiesOptions, MessageIds: PreferLogicalPropertiesMessageIds }>} PreferLogicalPropertiesRuleDefinition
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
const propertiesReplacements = new Map([
    ["bottom", "inset-block-end"],
    ["border-bottom", "border-block-end"],
    ["border-bottom-color", "border-block-end-color"],
    ["border-bottom-left-radius", "border-end-start-radius"],
    ["border-bottom-right-radius", "border-end-end-radius"],
    ["border-bottom-style", "border-block-end-style"],
    ["border-bottom-width", "border-block-end-width"],
    ["border-left", "border-inline-start"],
    ["border-left-color", "border-inline-start-color"],
    ["border-left-style", "border-inline-start-style"],
    ["border-left-width", "border-inline-start-width"],
    ["border-right", "border-inline-end"],
    ["border-right-color", "border-inline-end-color"],
    ["border-right-style", "border-inline-end-style"],
    ["border-right-width", "border-inline-end-width"],
    ["border-top", "border-block-start"],
    ["border-top-color", "border-block-start-color"],
    ["border-top-left-radius", "border-start-start-radius"],
    ["border-top-right-radius", "border-start-end-radius"],
    ["border-top-style", "border-block-start-style"],
    ["border-top-width", "border-block-start-width"],
    ["contain-intrinsic-height", "contain-intrinsic-block-size"],
    ["contain-intrinsic-width", "contain-intrinsic-inline-size"],
    ["height", "block-size"],
    ["left", "inset-inline-start"],
    ["margin-bottom", "margin-block-end"],
    ["margin-left", "margin-inline-start"],
    ["margin-right", "margin-inline-end"],
    ["margin-top", "margin-block-start"],
    ["max-height", "max-block-size"],
    ["max-width", "max-inline-size"],
    ["min-height", "min-block-size"],
    ["min-width", "min-inline-size"],
    ["overflow-x", "overflow-inline"],
    ["overflow-y", "overflow-block"],
    ["overscroll-behavior-x", "overscroll-behavior-inline"],
    ["overscroll-behavior-y", "overscroll-behavior-block"],
    ["padding-bottom", "padding-block-end"],
    ["padding-left", "padding-inline-start"],
    ["padding-right", "padding-inline-end"],
    ["padding-top", "padding-block-start"],
    ["right", "inset-inline-end"],
    ["scroll-margin-bottom", "scroll-margin-block-end"],
    ["scroll-margin-left", "scroll-margin-inline-start"],
    ["scroll-margin-right", "scroll-margin-inline-end"],
    ["scroll-margin-top", "scroll-margin-block-start"],
    ["scroll-padding-bottom", "scroll-padding-block-end"],
    ["scroll-padding-left", "scroll-padding-inline-start"],
    ["scroll-padding-right", "scroll-padding-inline-end"],
    ["scroll-padding-top", "scroll-padding-block-start"],
    ["top", "inset-block-start"],
    ["width", "inline-size"],
]);
const propertyValuesReplacements = new Map([
    [
        "text-align",
        {
            left: "start",
            right: "end",
        },
    ],
    [
        "resize",
        {
            horizontal: "inline",
            vertical: "block",
        },
    ],
    [
        "caption-side",
        {
            left: "inline-start",
            right: "inline-end",
        },
    ],
    [
        "box-orient",
        {
            horizontal: "inline-axis",
            vertical: "block-axis",
        },
    ],
    [
        "float",
        {
            left: "inline-start",
            right: "inline-end",
        },
    ],
    [
        "clear",
        {
            left: "inline-start",
            right: "inline-end",
        },
    ],
]);
const unitReplacements = new Map([
    ["cqh", "cqb"],
    ["cqw", "cqi"],
    ["dvh", "dvb"],
    ["dvw", "dvi"],
    ["lvh", "lvb"],
    ["lvw", "lvi"],
    ["svh", "svb"],
    ["svw", "svi"],
    ["vh", "vb"],
    ["vw", "vi"],
]);
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {PreferLogicalPropertiesRuleDefinition} */ ({
    meta: {
        type: "problem",
        hasSuggestions: true,
        docs: {
            description: "Enforce the use of logical properties",
            url: "https://github.com/eslint/css/blob/main/docs/rules/prefer-logical-properties.md",
        },
        schema: [
            {
                type: "object",
                properties: {
                    allowProperties: {
                        type: "array",
                        items: {
                            enum: Array.from(propertiesReplacements.keys()),
                        },
                        uniqueItems: true,
                    },
                    allowUnits: {
                        type: "array",
                        items: {
                            enum: Array.from(unitReplacements.keys()),
                        },
                        uniqueItems: true,
                    },
                },
                additionalProperties: false,
            },
        ],
        defaultOptions: [
            {
                allowProperties: [],
                allowUnits: [],
            },
        ],
        messages: {
            notLogicalProperty: "Expected logical property '{{replacement}}' instead of '{{property}}'.",
            notLogicalValue: "Expected logical value '{{replacement}}' instead of '{{value}}'.",
            notLogicalUnit: "Expected logical unit '{{replacement}}' instead of '{{unit}}'.",
            replaceWithLogicalProperty: "Replace '{{property}}' with logical property '{{replacement}}'.",
            replaceWithLogicalValue: "Replace '{{value}}' with logical value '{{replacement}}'.",
            replaceWithLogicalUnit: "Replace '{{unit}}' with logical unit '{{replacement}}'.",
        },
    },
    create(context) {
        const [{ allowProperties, allowUnits }] = context.options;
        return {
            Declaration(node) {
                const parent = context.sourceCode.getParent(node);
                if (parent.type === "SupportsDeclaration") {
                    return;
                }
                const propertyReplacement = propertiesReplacements.get(node.property);
                if (propertyReplacement &&
                    !allowProperties.includes(node.property)) {
                    context.report({
                        loc: node.loc,
                        messageId: "notLogicalProperty",
                        data: {
                            property: node.property,
                            replacement: propertyReplacement,
                        },
                        suggest: [
                            {
                                messageId: "replaceWithLogicalProperty",
                                data: {
                                    property: node.property,
                                    replacement: propertyReplacement,
                                },
                                fix(fixer) {
                                    return fixer.replaceTextRange([
                                        node.loc.start.offset,
                                        node.loc.start.offset +
                                            node.property.length,
                                    ], propertyReplacement);
                                },
                            },
                        ],
                    });
                }
                const valueReplacements = propertyValuesReplacements.get(node.property);
                if (valueReplacements &&
                    node.value.type === "Value" &&
                    node.value.children[0].type === "Identifier") {
                    const identifier = node.value.children[0];
                    const nodeValue = identifier.name;
                    const valueReplacement = valueReplacements[nodeValue];
                    if (valueReplacement) {
                        context.report({
                            loc: identifier.loc,
                            messageId: "notLogicalValue",
                            data: {
                                value: nodeValue,
                                replacement: valueReplacement,
                            },
                            suggest: [
                                {
                                    messageId: "replaceWithLogicalValue",
                                    data: {
                                        value: nodeValue,
                                        replacement: valueReplacement,
                                    },
                                    fix(fixer) {
                                        return fixer.replaceText(identifier, valueReplacement);
                                    },
                                },
                            ],
                        });
                    }
                }
            },
            Dimension(node) {
                const unitReplacement = unitReplacements.get(node.unit);
                if (unitReplacement && !allowUnits.includes(node.unit)) {
                    context.report({
                        loc: node.loc,
                        messageId: "notLogicalUnit",
                        data: {
                            unit: node.unit,
                            replacement: unitReplacement,
                        },
                        suggest: [
                            {
                                messageId: "replaceWithLogicalUnit",
                                data: {
                                    unit: node.unit,
                                    replacement: unitReplacement,
                                },
                                fix(fixer) {
                                    return fixer.replaceText(node, node.value + unitReplacement);
                                },
                            },
                        ],
                    });
                }
            },
        };
    },
});
r0б`xdeclare namespace _default {
    namespace meta {
        let type: "suggestion";
        namespace docs {
            let description: string;
            let recommended: boolean;
            let url: string;
        }
        let schema: {
            type: "object";
            properties: {
                allowUnits: {
                    type: "array";
                    items: {
                        enum: string[];
                    };
                    uniqueItems: true;
                };
            };
            additionalProperties: false;
        }[];
        let defaultOptions: [{
            allowUnits: string[];
        }];
        namespace messages {
            let allowedFontUnits: string;
        }
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../index.js").CSSLanguageOptions;
        Code: import("../index.js").CSSSourceCode;
        RuleOptions: RelativeFontUnitsOptions;
        Node: import("@eslint/css-tree").CssNodePlain;
        MessageIds: "allowedFontUnits";
    }>): {
        Declaration(node: import("@eslint/css-tree").DeclarationPlain): void;
    };
}
export default _default;
export type RelativeFontUnitsMessageIds = "allowedFontUnits";
export type RelativeFontUnitsOptions = [{
    allowUnits?: string[];
}];
export type RelativeFontUnitsRuleDefinition = CSSRuleDefinition<{
    RuleOptions: RelativeFontUnitsOptions;
    MessageIds: RelativeFontUnitsMessageIds;
}>;
import type { CSSRuleDefinition } from "../types.js";
Yɉxo/**
 * @fileoverview Enforce the use of relative units for font size.
 * @author Tanuj Kanti
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { CSSRuleDefinition } from "../types.js"
 * @typedef {"allowedFontUnits"} RelativeFontUnitsMessageIds
 * @typedef {[{allowUnits?: string[]}]} RelativeFontUnitsOptions
 * @typedef {CSSRuleDefinition<{ RuleOptions: RelativeFontUnitsOptions, MessageIds: RelativeFontUnitsMessageIds}>} RelativeFontUnitsRuleDefinition
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
const relativeFontUnits = [
    "%",
    "cap",
    "ch",
    "em",
    "ex",
    "ic",
    "lh",
    "rcap",
    "rch",
    "rem",
    "rex",
    "ric",
    "rlh",
];
const disallowedFontSizeKeywords = new Set([
    "xx-small",
    "x-small",
    "small",
    "medium",
    "large",
    "x-large",
    "xx-large",
    "xxx-large",
    "math",
]);
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {RelativeFontUnitsRuleDefinition} */ ({
    meta: {
        type: "suggestion",
        docs: {
            description: "Enforce the use of relative font units",
            recommended: false,
            url: "https://github.com/eslint/css/blob/main/docs/rules/relative-font-units.md",
        },
        schema: [
            {
                type: "object",
                properties: {
                    allowUnits: {
                        type: "array",
                        items: {
                            enum: relativeFontUnits,
                        },
                        uniqueItems: true,
                    },
                },
                additionalProperties: false,
            },
        ],
        defaultOptions: [
            {
                allowUnits: ["rem"],
            },
        ],
        messages: {
            allowedFontUnits: "Use only allowed relative units for 'font-size' - {{allowedFontUnits}}.",
        },
    },
    create(context) {
        const [{ allowUnits: allowedFontUnits }] = context.options;
        return {
            Declaration(node) {
                if (node.property === "font-size") {
                    if (node.value.type === "Value" &&
                        node.value.children.length > 0) {
                        const value = node.value.children[0];
                        if ((value.type === "Dimension" &&
                            !allowedFontUnits.includes(value.unit.toLowerCase())) ||
                            (value.type === "Identifier" &&
                                disallowedFontSizeKeywords.has(value.name.toLowerCase())) ||
                            (value.type === "Percentage" &&
                                !allowedFontUnits.includes("%"))) {
                            context.report({
                                loc: value.loc,
                                messageId: "allowedFontUnits",
                                data: {
                                    allowedFontUnits: allowedFontUnits.join(", "),
                                },
                            });
                        }
                    }
                }
                if (node.property === "font") {
                    if (node.value.type === "Value" &&
                        node.value.children.length > 0) {
                        const value = node.value;
                        const dimensionNode = value.children.find(child => child.type === "Dimension");
                        const identifierNode = value.children.find(child => child.type === "Identifier" &&
                            disallowedFontSizeKeywords.has(child.name.toLowerCase()));
                        const percentageNode = value.children.find((child, index) => {
                            const isPercentage = child.type === "Percentage";
                            const previousNode = value.children[index - 1];
                            const previousNodeIsSlashOperator = previousNode &&
                                previousNode.type === "Operator" &&
                                previousNode.value === "/";
                            return (isPercentage && !previousNodeIsSlashOperator);
                        });
                        let location;
                        let shouldReport = false;
                        const conditions = [
                            {
                                check: !allowedFontUnits.includes("%") &&
                                    percentageNode,
                                loc: percentageNode?.loc,
                            },
                            {
                                check: identifierNode,
                                loc: identifierNode?.loc,
                            },
                            {
                                check: dimensionNode &&
                                    !allowedFontUnits.includes(dimensionNode.unit.toLowerCase()),
                                loc: dimensionNode?.loc,
                            },
                        ];
                        for (const condition of conditions) {
                            if (condition.check) {
                                shouldReport = true;
                                location = condition.loc;
                                break;
                            }
                        }
                        if (shouldReport) {
                            context.report({
                                loc: location,
                                messageId: "allowedFontUnits",
                                data: {
                                    allowedFontUnits: allowedFontUnits.join(", "),
                                },
                            });
                        }
                    }
                }
            },
        };
    },
});
xdeclare namespace _default {
    namespace meta {
        let type: "problem";
        namespace docs {
            let description: string;
            let recommended: boolean;
            let url: string;
        }
        let schema: {
            type: "object";
            properties: {
                maxIds: {
                    type: "integer";
                    minimum: number;
                };
                maxClasses: {
                    type: "integer";
                    minimum: number;
                };
                maxTypes: {
                    type: "integer";
                    minimum: number;
                };
                maxAttributes: {
                    type: "integer";
                    minimum: number;
                };
                maxPseudoClasses: {
                    type: "integer";
                    minimum: number;
                };
                maxUniversals: {
                    type: "integer";
                    minimum: number;
                };
                maxCompounds: {
                    type: "integer";
                    minimum: number;
                };
                maxCombinators: {
                    type: "integer";
                    minimum: number;
                };
                disallowCombinators: {
                    type: "array";
                    items: {
                        type: "string";
                    };
                    uniqueItems: true;
                };
                disallowPseudoClasses: {
                    type: "array";
                    items: {
                        type: "string";
                    };
                    uniqueItems: true;
                };
                disallowPseudoElements: {
                    type: "array";
                    items: {
                        type: "string";
                    };
                    uniqueItems: true;
                };
                disallowAttributes: {
                    type: "array";
                    items: {
                        type: "string";
                    };
                    uniqueItems: true;
                };
                disallowAttributeMatchers: {
                    type: "array";
                    items: {
                        type: "string";
                    };
                    uniqueItems: true;
                };
            };
            additionalProperties: false;
        }[];
        let defaultOptions: [{
            maxIds: number;
            maxClasses: number;
            maxTypes: number;
            maxAttributes: number;
            maxPseudoClasses: number;
            maxUniversals: number;
            maxCompounds: number;
            maxCombinators: number;
            disallowCombinators: any[];
            disallowPseudoClasses: any[];
            disallowPseudoElements: any[];
            disallowAttributes: any[];
            disallowAttributeMatchers: any[];
        }];
        namespace messages {
            let maxSelectors: string;
            let disallowedSelectors: string;
        }
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../index.js").CSSLanguageOptions;
        Code: import("../index.js").CSSSourceCode;
        RuleOptions: SelectorComplexityOptions;
        Node: import("@eslint/css-tree").CssNodePlain;
        MessageIds: SelectorComplexityMessageIds;
    }>): {
        Selector(node: import("@eslint/css-tree").SelectorPlain): void;
    };
}
export default _default;
export type SelectorComplexityMessageIds = "maxSelectors" | "disallowedSelectors";
export type SelectorComplexityOptions = [{
    maxIds?: number;
    maxClasses?: number;
    maxTypes?: number;
    maxAttributes?: number;
    maxPseudoClasses?: number;
    maxUniversals?: number;
    maxCompounds?: number;
    maxCombinators?: number;
    disallowCombinators?: string[];
    disallowPseudoClasses?: string[];
    disallowPseudoElements?: string[];
    disallowAttributes?: string[];
    disallowAttributeMatchers?: string[];
}];
export type SelectorComplexityRuleDefinition = CSSRuleDefinition<{
    RuleOptions: SelectorComplexityOptions;
    MessageIds: SelectorComplexityMessageIds;
}>;
import type { CSSRuleDefinition } from "../types.js";
d~xc?/**
 * @fileoverview Rule to limit and disallow CSS selectors.
 * @author Tanuj Kanti
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { CSSRuleDefinition } from "../types.js"
 * @typedef {"maxSelectors" | "disallowedSelectors"} SelectorComplexityMessageIds
 * @typedef {[{
 *     maxIds?: number,
 *     maxClasses?: number,
 *     maxTypes?: number,
 *     maxAttributes?: number,
 *     maxPseudoClasses?: number,
 *     maxUniversals?: number,
 *     maxCompounds?: number,
 *     maxCombinators?: number,
 *     disallowCombinators?: string[],
 *     disallowPseudoClasses?: string[],
 *     disallowPseudoElements?: string[],
 *     disallowAttributes?: string[],
 *     disallowAttributeMatchers?: string[],
 * }]} SelectorComplexityOptions
 * @typedef {CSSRuleDefinition<{ RuleOptions: SelectorComplexityOptions, MessageIds: SelectorComplexityMessageIds }> } SelectorComplexityRuleDefinition
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
/**
 * Get the location of a selector of a given name.
 * @param {Array<Object>} allSelector All CSS selector nodes.
 * @param {string} disallowedSelector The name of the disallowed selector.
 * @returns {Object} The location of the disallowed selector.
 */
function getDisallowedSelectorsLocation(allSelector, disallowedSelector) {
    return allSelector.find(selector => selector.name === disallowedSelector)
        .loc;
}
/**
 * An error for exceeding the maximum allowed selectors of a specific type.
 * @param {Object} context The ESLint rule context object.
 * @param {Object} selectorLoc The location of the selector.
 * @param {number} maxValue The max number of selectors that are allowed.
 * @param {string} selectorType The type of CSS selector.
 * @returns {void}
 */
function exceedLimitError(context, selectorLoc, maxValue, selectorType) {
    context.report({
        loc: selectorLoc,
        messageId: "maxSelectors",
        data: {
            selector: selectorType,
            limit: maxValue,
        },
    });
}
/**
 * Gives an array of CSS selectors of a specific type.
 * @param {Array<Object>} selectors All CSS selectors nodes.
 * @param {string} selectorType The type of CSS selector to filter out.
 * @returns {Array<Object>} Filtered selectors.
 */
function getSelectors(selectors, selectorType) {
    return selectors.filter(selector => selector.type === selectorType);
}
/**
 * Get the names of all CSS selectors.
 * @param {Array<Object>} selectors All CSS selector nodes.
 * @returns {Array<string>} Array of selector names.
 */
function getSelectorNames(selectors) {
    return selectors.map(selector => selector.name);
}
/**
 * Get the location of the attribute matcher or operator in a given attribute selector.
 * @param {Array<Object>} selectors All CSS selector nodes.
 * @param {number} index The index of the attribute selector in the selectors array.
 * @returns {{ startLoc: Object, endLoc: Object }} The start and end locations of the operator.
 */
function getOperatorLocation(selectors, index) {
    const selector = selectors[index];
    let startLoc;
    let endLoc;
    if (selector.name.type === "Identifier") {
        startLoc = selector.name.loc.end;
    }
    if (selector.value) {
        endLoc = selector.value.loc.start;
    }
    return { startLoc, endLoc };
}
/**
 * Get the location of a given disallowed combinator.
 * @param {Array<Object>} selectors All CSS selector nodes.
 * @param {Array<Object>} combinatorNodes All combinator nodes.
 * @param {string} combinator Name of combinator.
 * @param {number} index The index of the given combinator.
 * @returns {Object} The location of the disallowed combinator.
 */
function getDisallowedCombinatorsLocation(selectors, combinatorNodes, combinator, index) {
    let location;
    if (combinator === " ") {
        const selectorsArr = [];
        let selectorsGroup = [];
        selectors.forEach(selector => {
            if (selector.type === "Combinator") {
                selectorsArr.push(selectorsGroup);
                selectorsGroup = [];
            }
            else {
                selectorsGroup.push(selector);
            }
        });
        if (selectorsGroup.length > 0) {
            selectorsArr.push(selectorsGroup);
        }
        location = {
            start: selectorsArr[index].at(-1).loc.end,
            end: selectorsArr[index + 1][0].loc.start,
        };
    }
    else {
        const currentCombinatorNode = combinatorNodes[index];
        location = currentCombinatorNode.loc;
    }
    return location;
}
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {SelectorComplexityRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            description: "Disallow and limit CSS selectors",
            recommended: false,
            url: "https://github.com/eslint/css/blob/main/docs/rules/selector-complexity.md",
        },
        schema: [
            {
                type: "object",
                properties: {
                    maxIds: {
                        type: "integer",
                        minimum: 0,
                    },
                    maxClasses: {
                        type: "integer",
                        minimum: 0,
                    },
                    maxTypes: {
                        type: "integer",
                        minimum: 0,
                    },
                    maxAttributes: {
                        type: "integer",
                        minimum: 0,
                    },
                    maxPseudoClasses: {
                        type: "integer",
                        minimum: 0,
                    },
                    maxUniversals: {
                        type: "integer",
                        minimum: 0,
                    },
                    maxCompounds: {
                        type: "integer",
                        minimum: 0,
                    },
                    maxCombinators: {
                        type: "integer",
                        minimum: 0,
                    },
                    disallowCombinators: {
                        type: "array",
                        items: {
                            type: "string",
                        },
                        uniqueItems: true,
                    },
                    disallowPseudoClasses: {
                        type: "array",
                        items: {
                            type: "string",
                        },
                        uniqueItems: true,
                    },
                    disallowPseudoElements: {
                        type: "array",
                        items: {
                            type: "string",
                        },
                        uniqueItems: true,
                    },
                    disallowAttributes: {
                        type: "array",
                        items: {
                            type: "string",
                        },
                        uniqueItems: true,
                    },
                    disallowAttributeMatchers: {
                        type: "array",
                        items: {
                            type: "string",
                        },
                        uniqueItems: true,
                    },
                },
                additionalProperties: false,
            },
        ],
        defaultOptions: [
            {
                maxIds: Infinity,
                maxClasses: Infinity,
                maxTypes: Infinity,
                maxAttributes: Infinity,
                maxPseudoClasses: Infinity,
                maxUniversals: Infinity,
                maxCompounds: Infinity,
                maxCombinators: Infinity,
                disallowCombinators: [],
                disallowPseudoClasses: [],
                disallowPseudoElements: [],
                disallowAttributes: [],
                disallowAttributeMatchers: [],
            },
        ],
        messages: {
            maxSelectors: "Exceeded maximum {{selector}} selector. Only {{limit}} allowed.",
            disallowedSelectors: "'{{selectorName}}' {{selector}} is not allowed.",
        },
    },
    create(context) {
        const [{ maxIds, maxClasses, maxTypes, maxAttributes, maxPseudoClasses, maxUniversals, maxCompounds, maxCombinators, disallowCombinators, disallowPseudoClasses, disallowPseudoElements, disallowAttributes, disallowAttributeMatchers, },] = context.options;
        return {
            Selector(node) {
                const selectors = node.children;
                const selectorLoc = node.loc;
                const idSelectors = getSelectors(selectors, "IdSelector");
                const classSelectors = getSelectors(selectors, "ClassSelector");
                const typeSelectors = selectors.filter(child => child.type === "TypeSelector" && child.name !== "*");
                const attributeSelectors = getSelectors(selectors, "AttributeSelector");
                const pseudoClassSelectors = getSelectors(selectors, "PseudoClassSelector");
                const universalSelectors = selectors.filter(child => child.type === "TypeSelector" && child.name === "*");
                const combinatorNodes = getSelectors(selectors, "Combinator");
                const combinators = getSelectorNames(combinatorNodes);
                const pseudoClassSelectorsNames = getSelectorNames(pseudoClassSelectors);
                const pseudoElementSelectors = getSelectors(selectors, "PseudoElementSelector");
                const pseudoElementNames = getSelectorNames(pseudoElementSelectors);
                const attributeNames = attributeSelectors.map(s => s.name.name);
                const attributeMatchers = attributeSelectors
                    .map(child => child.matcher)
                    .filter(Boolean);
                if (idSelectors.length > maxIds) {
                    exceedLimitError(context, selectorLoc, maxIds, "id");
                }
                if (classSelectors.length > maxClasses) {
                    exceedLimitError(context, selectorLoc, maxClasses, "class");
                }
                if (typeSelectors.length > maxTypes) {
                    exceedLimitError(context, selectorLoc, maxTypes, "type");
                }
                if (attributeSelectors.length > maxAttributes) {
                    exceedLimitError(context, selectorLoc, maxAttributes, "attribute");
                }
                if (pseudoClassSelectors.length > maxPseudoClasses) {
                    exceedLimitError(context, selectorLoc, maxPseudoClasses, "pseudo-class");
                }
                if (universalSelectors.length > maxUniversals) {
                    exceedLimitError(context, selectorLoc, maxUniversals, "universal");
                }
                if (combinatorNodes.length > maxCombinators) {
                    exceedLimitError(context, selectorLoc, maxCombinators, "combinator");
                }
                if (combinatorNodes.length + 1 > maxCompounds) {
                    exceedLimitError(context, selectorLoc, maxCompounds, "compound");
                }
                if (disallowPseudoClasses.length > 0) {
                    let disallowedPseudoClassLocation;
                    for (const pseudoClassName of pseudoClassSelectorsNames) {
                        if (disallowPseudoClasses.includes(pseudoClassName)) {
                            disallowedPseudoClassLocation =
                                getDisallowedSelectorsLocation(pseudoClassSelectors, pseudoClassName);
                            context.report({
                                loc: disallowedPseudoClassLocation,
                                messageId: "disallowedSelectors",
                                data: {
                                    selectorName: pseudoClassName,
                                    selector: "pseudo-class",
                                },
                            });
                        }
                    }
                }
                if (disallowCombinators.length > 0) {
                    let disallowedCombinatorLocation;
                    for (const [index, combinator] of combinators.entries()) {
                        if (disallowCombinators.includes(combinator)) {
                            disallowedCombinatorLocation =
                                getDisallowedCombinatorsLocation(selectors, combinatorNodes, combinator, index);
                            context.report({
                                loc: disallowedCombinatorLocation,
                                messageId: "disallowedSelectors",
                                data: {
                                    selectorName: combinator,
                                    selector: "combinator",
                                },
                            });
                        }
                    }
                }
                if (disallowPseudoElements.length > 0) {
                    let disallowPseudoElementsLocation;
                    for (const pseudoElement of pseudoElementNames) {
                        if (disallowPseudoElements.includes(pseudoElement)) {
                            disallowPseudoElementsLocation =
                                getDisallowedSelectorsLocation(pseudoElementSelectors, pseudoElement);
                            context.report({
                                loc: disallowPseudoElementsLocation,
                                messageId: "disallowedSelectors",
                                data: {
                                    selectorName: pseudoElement,
                                    selector: "pseudo-element",
                                },
                            });
                        }
                    }
                }
                if (disallowAttributes.length > 0) {
                    let disallowAttributesLocation;
                    for (const attributeName of attributeNames) {
                        if (disallowAttributes.includes(attributeName)) {
                            disallowAttributesLocation =
                                attributeSelectors.find(selector => selector.name.name === attributeName).name.loc;
                            context.report({
                                loc: disallowAttributesLocation,
                                messageId: "disallowedSelectors",
                                data: {
                                    selectorName: attributeName,
                                    selector: "attribute",
                                },
                            });
                        }
                    }
                }
                if (disallowAttributeMatchers.length > 0) {
                    for (const [index, attributeMatcher,] of attributeMatchers.entries()) {
                        if (disallowAttributeMatchers.includes(attributeMatcher)) {
                            const { startLoc, endLoc } = getOperatorLocation(attributeSelectors.filter(s => s.matcher), index);
                            context.report({
                                loc: {
                                    start: startLoc,
                                    end: endLoc,
                                },
                                messageId: "disallowedSelectors",
                                data: {
                                    selectorName: attributeMatcher,
                                    selector: "attribute-matcher",
                                },
                            });
                        }
                    }
                }
            },
        };
    },
});
vBxudeclare namespace _default {
    namespace meta {
        let type: "problem";
        namespace docs {
            let description: string;
            let recommended: boolean;
            let url: string;
        }
        let schema: {
            type: "object";
            properties: {
                available: {
                    anyOf: ({
                        enum: string[];
                        type?: undefined;
                        minimum?: undefined;
                        maximum?: undefined;
                    } | {
                        type: "integer";
                        minimum: number;
                        maximum: number;
                        enum?: undefined;
                    })[];
                };
                allowAtRules: {
                    type: "array";
                    items: {
                        enum: string[];
                    };
                    uniqueItems: true;
                };
                allowFunctions: {
                    type: "array";
                    items: {
                        enum: string[];
                    };
                    uniqueItems: true;
                };
                allowMediaConditions: {
                    type: "array";
                    items: {
                        enum: string[];
                    };
                    uniqueItems: true;
                };
                allowProperties: {
                    type: "array";
                    items: {
                        enum: string[];
                    };
                    uniqueItems: true;
                };
                allowPropertyValues: {
                    type: "object";
                    properties: {
                        [k: string]: {
                            type: "array";
                            items: {
                                enum: string[];
                            };
                            uniqueItems: true;
                        };
                    };
                    additionalProperties: false;
                };
                allowSelectors: {
                    type: "array";
                    items: {
                        enum: string[];
                    };
                    uniqueItems: true;
                };
                allowUnits: {
                    type: "array";
                    items: {
                        enum: string[];
                    };
                    uniqueItems: true;
                };
            };
            additionalProperties: false;
        }[];
        let defaultOptions: [{
            available: "widely";
            allowAtRules: any[];
            allowFunctions: any[];
            allowMediaConditions: any[];
            allowProperties: any[];
            allowPropertyValues: {};
            allowSelectors: any[];
            allowUnits: any[];
        }];
        namespace messages {
            let notBaselineProperty: string;
            let notBaselinePropertyValue: string;
            let notBaselineAtRule: string;
            let notBaselineFunction: string;
            let notBaselineMediaCondition: string;
            let notBaselineSelector: string;
            let notBaselineUnit: string;
        }
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../index.js").CSSLanguageOptions;
        Code: import("../index.js").CSSSourceCode;
        RuleOptions: UseBaselineOptions;
        Node: import("@eslint/css-tree").CssNodePlain;
        MessageIds: UseBaselineMessageIds;
    }>): {
        "Atrule[name=/^supports$/i]"(): void;
        "Atrule[name=/^supports$/i] > AtrulePrelude > Condition"(node: any): void;
        "Rule > Block > Declaration"(node: any): void;
        "Atrule[name=/^supports$/i]:exit"(): void;
        "Atrule[name=/^media$/i] > AtrulePrelude > MediaQueryList > MediaQuery > Condition"(node: any): void;
        Atrule(node: import("@eslint/css-tree").AtrulePlain): void;
        "PseudoClassSelector,PseudoElementSelector"(node: any): void;
        NestingSelector(node: import("@eslint/css-tree").NestingSelector): void;
    };
}
export default _default;
export type UseBaselineMessageIds = "notBaselineProperty" | "notBaselinePropertyValue" | "notBaselineAtRule" | "notBaselineFunction" | "notBaselineMediaCondition" | "notBaselineSelector" | "notBaselineUnit";
export type UseBaselineOptions = [{
    available?: "widely" | "newly" | number;
    allowAtRules?: string[];
    allowFunctions?: string[];
    allowMediaConditions?: string[];
    allowProperties?: string[];
    allowPropertyValues?: {
        [property: string]: string[];
    };
    allowSelectors?: string[];
    allowUnits?: string[];
}];
export type UseBaselineRuleDefinition = CSSRuleDefinition<{
    RuleOptions: UseBaselineOptions;
    MessageIds: UseBaselineMessageIds;
}>;
import type { CSSRuleDefinition } from "../types.js";
h@,x_z/**
 * @fileoverview Rule to enforce the use of baseline features.
 * @author Nicholas C. Zakas
 */
//-----------------------------------------------------------------------------
// Imports
//-----------------------------------------------------------------------------
import { BASELINE_HIGH, BASELINE_LOW, properties, propertyValues, atRules, mediaConditions, functions, units, selectors, } from "../data/baseline-data.js";
import { namedColors } from "../data/colors.js";
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { CSSRuleDefinition } from "../types.js"
 * @import { Identifier, FunctionNodePlain, Dimension } from "@eslint/css-tree"
 * @typedef {"notBaselineProperty" | "notBaselinePropertyValue" | "notBaselineAtRule" | "notBaselineFunction" | "notBaselineMediaCondition" | "notBaselineSelector" | "notBaselineUnit"} UseBaselineMessageIds
 * @typedef {[{
 *     available?: "widely" | "newly" | number,
 *     allowAtRules?: string[],
 *     allowFunctions?: string[],
 *     allowMediaConditions?: string[],
 *     allowProperties?: string[],
 *     allowPropertyValues?: { [property: string]: string[] },
 *     allowSelectors?: string[],
 *     allowUnits?: string[]
 * }]} UseBaselineOptions
 * @typedef {CSSRuleDefinition<{ RuleOptions: UseBaselineOptions, MessageIds: UseBaselineMessageIds }>} UseBaselineRuleDefinition
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
/**
 * Represents a property that is supported via `@supports`.
 */
class SupportedProperty {
    /**
     * The name of the property.
     * @type {string}
     */
    name;
    /**
     * Supported identifier values.
     * @type {Set<string>}
     */
    #identifiers = new Set();
    /**
     * Supported units.
     * @type {Set<string>}
     */
    #units = new Set();
    /**
     * Supported function types.
     * @type {Set<string>}
     */
    #functions = new Set();
    /**
     * Creates a new instance.
     * @param {string} name The name of the property.
     */
    constructor(name) {
        this.name = name;
    }
    /**
     * Adds an identifier to the list of supported identifiers.
     * @param {string} identifier The identifier to add.
     * @returns {void}
     */
    addIdentifier(identifier) {
        this.#identifiers.add(identifier);
    }
    /**
     * Determines if an identifier is supported.
     * @param {string} identifier The identifier to check.
     * @returns {boolean} `true` if the identifier is supported, `false` if not.
     */
    hasIdentifier(identifier) {
        return this.#identifiers.has(identifier);
    }
    /**
     * Determines if any identifiers are supported.
     * @returns {boolean} `true` if any identifiers are supported, `false` if not.
     */
    hasIdentifiers() {
        return this.#identifiers.size > 0;
    }
    /**
     * Adds a unit to the list of supported units.
     * @param {string} unit The unit to add.
     * @returns {void}
     */
    addUnit(unit) {
        this.#units.add(unit);
    }
    /**
     * Determines if a unit is supported.
     * @param {string} unit The unit to check.
     * @returns {boolean} `true` if the unit is supported, `false` if not.
     */
    hasUnit(unit) {
        return this.#units.has(unit);
    }
    /**
     * Determines if any units are supported.
     * @returns {boolean} `true` if any units are supported, `false` if not.
     */
    hasUnits() {
        return this.#units.size > 0;
    }
    /**
     * Adds a function to the list of supported functions.
     * @param {string} func The function to add.
     * @returns {void}
     */
    addFunction(func) {
        this.#functions.add(func);
    }
    /**
     * Determines if a function is supported.
     * @param {string} func The function to check.
     * @returns {boolean} `true` if the function is supported, `false` if not.
     */
    hasFunction(func) {
        return this.#functions.has(func);
    }
    /**
     * Determines if any functions are supported.
     * @returns {boolean} `true` if any functions are supported, `false` if not.
     */
    hasFunctions() {
        return this.#functions.size > 0;
    }
}
/**
 * Represents an `@supports` rule and everything it enables.
 */
class SupportsRule {
    /**
     * The properties supported by this rule.
     * @type {Map<string, SupportedProperty>}
     */
    #properties = new Map();
    /**
     * The selectors supported by this rule.
     * @type {Set<string>}
     */
    #selectors = new Set();
    /**
     * Adds a property to the rule.
     * @param {string} property The name of the property.
     * @returns {SupportedProperty} The supported property object.
     */
    addProperty(property) {
        if (this.#properties.has(property)) {
            return this.#properties.get(property);
        }
        const supportedProperty = new SupportedProperty(property);
        this.#properties.set(property, supportedProperty);
        return supportedProperty;
    }
    /**
     * Determines if the rule supports a property.
     * @param {string} property The name of the property.
     * @returns {boolean} `true` if the property is supported, `false` if not.
     */
    hasProperty(property) {
        return this.#properties.has(property);
    }
    /**
     * Gets the supported property.
     * @param {string} property The name of the property.
     * @returns {SupportedProperty} The supported property.
     */
    getProperty(property) {
        return this.#properties.get(property);
    }
    /**
     * Determines if the rule supports a property value.
     * @param {string} property The name of the property.
     * @param {string} identifier The identifier to check.
     * @returns {boolean} `true` if the property value is supported, `false` if not.
     */
    hasPropertyIdentifier(property, identifier) {
        const supportedProperty = this.#properties.get(property);
        if (!supportedProperty) {
            return false;
        }
        return supportedProperty.hasIdentifier(identifier);
    }
    /**
     * Determines if the rule supports any property values.
     * @param {string} property The name of the property.
     * @returns {boolean} `true` if any property values are supported, `false` if not.
     */
    hasPropertyIdentifiers(property) {
        const supportedProperty = this.#properties.get(property);
        if (!supportedProperty) {
            return false;
        }
        return supportedProperty.hasIdentifiers();
    }
    /**
     * Determines if the rule supports a function.
     * @param {string} property The name of the property.
     * @param {string} func The function to check.
     * @returns {boolean} `true` if the function is supported, `false` if not.
     */
    hasFunction(property, func) {
        const supportedProperty = this.#properties.get(property);
        if (!supportedProperty) {
            return false;
        }
        return supportedProperty.hasFunction(func);
    }
    /**
     * Determines if the rule supports any functions.
     * @param {string} property The name of the property.
     * @returns {boolean} `true` if any functions are supported, `false` if not.
     */
    hasFunctions(property) {
        const supportedProperty = this.#properties.get(property);
        if (!supportedProperty) {
            return false;
        }
        return supportedProperty.hasFunctions();
    }
    /**
     * Determines if the rule supports a unit.
     * @param {string} property The name of the property.
     * @param {string} unit The unit to check.
     * @returns {boolean} `true` if the unit is supported, `false` if not.
     */
    hasPropertyUnit(property, unit) {
        const supportedProperty = this.#properties.get(property);
        if (!supportedProperty) {
            return false;
        }
        return supportedProperty.hasUnit(unit);
    }
    /**
     * Determines if the rule supports any units.
     * @param {string} property The name of the property.
     * @returns {boolean} `true` if any units are supported, `false` if not.
     */
    hasPropertyUnits(property) {
        const supportedProperty = this.#properties.get(property);
        if (!supportedProperty) {
            return false;
        }
        return supportedProperty.hasUnits();
    }
    /**
     * Adds a selector to the rule.
     * @param {string} selector The name of the selector.
     * @returns {void}
     */
    addSelector(selector) {
        this.#selectors.add(selector);
    }
    /**
     * Determines if the rule supports a selector.
     * @param {string} selector The name of the selector.
     * @returns {boolean} `true` if the selector is supported, `false` if not.
     */
    hasSelector(selector) {
        return this.#selectors.has(selector);
    }
}
/**
 * Represents a collection of supports rules.
 */
class SupportsRules {
    /**
     * A collection of supports rules.
     * @type {Array<SupportsRule>}
     */
    #rules = [];
    /**
     * Adds a rule to the collection.
     * @param {SupportsRule} rule The rule to add.
     * @returns {void}
     */
    push(rule) {
        this.#rules.push(rule);
    }
    /**
     * Removes the last rule from the collection.
     * @returns {SupportsRule} The last rule in the collection.
     */
    pop() {
        return this.#rules.pop();
    }
    /**
     * Retrieves the last rule in the collection.
     * @returns {SupportsRule} The last rule in the collection.
     */
    last() {
        return this.#rules.at(-1);
    }
    /**
     * Determines if any rule supports a property.
     * @param {string} property The name of the property.
     * @returns {boolean} `true` if any rule supports the property, `false` if not.
     */
    hasProperty(property) {
        return this.#rules.some(rule => rule.hasProperty(property));
    }
    /**
     * Determines if any rule supports a property identifier.
     * @param {string} property The name of the property.
     * @param {string} identifier The identifier to check.
     * @returns {boolean} `true` if any rule supports the property value, `false` if not.
     */
    hasPropertyIdentifier(property, identifier) {
        return this.#rules.some(rule => rule.hasPropertyIdentifier(property, identifier));
    }
    /**
     * Determines if any rule supports any property identifiers.
     * @param {string} property The name of the property.
     * @returns {boolean} `true` if any rule supports the property values, `false` if not.
     */
    hasPropertyIdentifiers(property) {
        return this.#rules.some(rule => rule.hasPropertyIdentifiers(property));
    }
    /**
     * Determines if any rule supports a function.
     * @param {string} property The name of the property.
     * @param {string} func The function to check.
     * @returns {boolean} `true` if any rule supports the function, `false` if not.
     */
    hasPropertyFunction(property, func) {
        return this.#rules.some(rule => rule.hasFunction(property, func));
    }
    /**
     * Determines if any rule supports any functions.
     * @param {string} property The name of the property.
     * @returns {boolean} `true` if any rule supports the functions, `false` if not.
     */
    hasPropertyFunctions(property) {
        return this.#rules.some(rule => rule.hasFunctions(property));
    }
    /**
     * Determines if any rule supports a unit.
     * @param {string} property The name of the property.
     * @param {string} unit The unit to check.
     * @returns {boolean} `true` if any rule supports the unit, `false` if not.
     */
    hasPropertyUnit(property, unit) {
        return this.#rules.some(rule => rule.hasPropertyUnit(property, unit));
    }
    /**
     * Determines if any rule supports a selector.
     * @param {string} selector The name of the selector.
     * @returns {boolean} `true` if any rule supports the selector, `false` if not.
     */
    hasSelector(selector) {
        return this.#rules.some(rule => rule.hasSelector(selector));
    }
}
/**
 * Represents the required availability of a feature.
 */
class BaselineAvailability {
    /**
     * The preferred Baseline year.
     * @type {number}
     */
    #baselineYear = undefined;
    /**
     * The preferred Baseline status.
     * @type {number}
     */
    #baselineStatus = undefined;
    /**
     * @param {string | number} availability The required level of feature availability.
     */
    constructor(availability) {
        this.availability = availability;
        if (typeof availability === "number") {
            this.#baselineYear = availability;
        }
        else {
            this.#baselineStatus =
                availability === "widely" ? BASELINE_HIGH : BASELINE_LOW;
        }
    }
    /**
     * Determines whether a feature meets the required availability.
     * @param {Object} encodedStatus A feature's encoded baseline status and year.
     * @returns {boolean} `true` if the feature is supported, `false` if not.
     */
    isSupported(encodedStatus) {
        if (!encodedStatus) {
            // if we don't know the status, assume it's supported
            return true;
        }
        const parts = encodedStatus.split(":");
        const status = Number(parts[0]);
        const year = Number(parts[1] || NaN);
        if (this.#baselineYear) {
            return year <= this.#baselineYear;
        }
        return status >= this.#baselineStatus;
    }
}
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {UseBaselineRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            description: "Enforce the use of baseline features",
            recommended: true,
            url: "https://github.com/eslint/css/blob/main/docs/rules/use-baseline.md",
        },
        schema: [
            {
                type: "object",
                properties: {
                    available: {
                        anyOf: [
                            {
                                enum: ["widely", "newly"],
                            },
                            {
                                // baseline year
                                type: "integer",
                                minimum: 2000,
                                maximum: new Date().getFullYear(),
                            },
                        ],
                    },
                    allowAtRules: {
                        type: "array",
                        items: {
                            enum: Array.from(atRules.keys()),
                        },
                        uniqueItems: true,
                    },
                    allowFunctions: {
                        type: "array",
                        items: {
                            enum: Array.from(functions.keys()),
                        },
                        uniqueItems: true,
                    },
                    allowMediaConditions: {
                        type: "array",
                        items: {
                            enum: Array.from(mediaConditions.keys()),
                        },
                        uniqueItems: true,
                    },
                    allowProperties: {
                        type: "array",
                        items: {
                            enum: Array.from(properties.keys()),
                        },
                        uniqueItems: true,
                    },
                    allowPropertyValues: {
                        type: "object",
                        properties: Object.fromEntries(Array.from(propertyValues.entries()).map(([prop, valuesMap]) => [
                            prop,
                            {
                                type: "array",
                                items: {
                                    enum: Array.from(valuesMap.keys()),
                                },
                                uniqueItems: true,
                            },
                        ])),
                        additionalProperties: false,
                    },
                    allowSelectors: {
                        type: "array",
                        items: {
                            enum: Array.from(selectors.keys()),
                        },
                        uniqueItems: true,
                    },
                    allowUnits: {
                        type: "array",
                        items: {
                            enum: Array.from(units.keys()),
                        },
                        uniqueItems: true,
                    },
                },
                additionalProperties: false,
            },
        ],
        defaultOptions: [
            {
                available: "widely",
                allowAtRules: [],
                allowFunctions: [],
                allowMediaConditions: [],
                allowProperties: [],
                allowPropertyValues: {},
                allowSelectors: [],
                allowUnits: [],
            },
        ],
        messages: {
            notBaselineProperty: "Property '{{property}}' is not a {{availability}} available baseline feature.",
            notBaselinePropertyValue: "Value '{{value}}' of property '{{property}}' is not a {{availability}} available baseline feature.",
            notBaselineAtRule: "At-rule '@{{atRule}}' is not a {{availability}} available baseline feature.",
            notBaselineFunction: "Function '{{function}}' is not a {{availability}} available baseline feature.",
            notBaselineMediaCondition: "Media condition '{{condition}}' is not a {{availability}} available baseline feature.",
            notBaselineSelector: "Selector '{{selector}}' is not a {{availability}} available baseline feature.",
            notBaselineUnit: "Unit '{{unit}}' is not a {{availability}} available baseline feature.",
        },
    },
    create(context) {
        const baselineAvailability = new BaselineAvailability(context.options[0].available);
        const supportsRules = new SupportsRules();
        const allowAtRules = new Set(context.options[0].allowAtRules);
        const allowProperties = new Set(context.options[0].allowProperties);
        const allowSelectors = new Set(context.options[0].allowSelectors);
        const allowFunctions = new Set(context.options[0].allowFunctions);
        const allowMediaConditions = new Set(context.options[0].allowMediaConditions);
        const allowUnits = new Set(context.options[0].allowUnits);
        const allowPropertyValuesMap = new Map();
        for (const [prop, values] of Object.entries(context.options[0].allowPropertyValues)) {
            allowPropertyValuesMap.set(prop, new Set(values));
        }
        /**
         * Checks a property value identifier to see if it's a baseline feature.
         * @param {string} property The name of the property.
         * @param {Identifier} child The node to check.
         * @returns {void}
         */
        function checkPropertyValueIdentifier(property, child) {
            // named colors are always valid
            if (namedColors.has(child.name)) {
                return;
            }
            const allowedValues = allowPropertyValuesMap.get(property);
            if (allowedValues?.has(child.name)) {
                return;
            }
            const possiblePropertyValues = propertyValues.get(property);
            // if we don't know of any possible property values, just skip it
            if (!possiblePropertyValues) {
                return;
            }
            const featureStatus = possiblePropertyValues.get(child.name);
            // if we don't know of any possible property values, just skip it
            if (featureStatus === undefined) {
                return;
            }
            if (!baselineAvailability.isSupported(featureStatus)) {
                context.report({
                    loc: child.loc,
                    messageId: "notBaselinePropertyValue",
                    data: {
                        property,
                        value: child.name,
                        availability: baselineAvailability.availability,
                    },
                });
            }
        }
        /**
         * Checks a property value function to see if it's a baseline feature.
         * @param {FunctionNodePlain} child The node to check.
         * @returns {void}
         */
        function checkPropertyValueFunction(child) {
            if (allowFunctions.has(child.name)) {
                return;
            }
            const featureStatus = functions.get(child.name);
            // if we don't know of any possible property values, just skip it
            if (featureStatus === undefined) {
                return;
            }
            if (!baselineAvailability.isSupported(featureStatus)) {
                context.report({
                    loc: child.loc,
                    messageId: "notBaselineFunction",
                    data: {
                        function: child.name,
                        availability: baselineAvailability.availability,
                    },
                });
            }
        }
        /**
         * Checks a property value unit to see if it's a baseline feature.
         * @param {string} property The name of the property.
         * @param {Dimension} child The node to check.
         * @returns {void}
         */
        function checkPropertyValueUnit(property, child) {
            if (allowUnits.has(child.unit)) {
                return;
            }
            const featureStatus = units.get(child.unit);
            // if we don't know of this unit, just skip it
            if (featureStatus === undefined) {
                return;
            }
            if (!baselineAvailability.isSupported(featureStatus)) {
                context.report({
                    loc: child.loc,
                    messageId: "notBaselineUnit",
                    data: {
                        unit: child.unit,
                        availability: baselineAvailability.availability,
                    },
                });
            }
        }
        return {
            "Atrule[name=/^supports$/i]"() {
                supportsRules.push(new SupportsRule());
            },
            "Atrule[name=/^supports$/i] > AtrulePrelude > Condition"(node) {
                const supportsRule = supportsRules.last();
                for (let i = 0; i < node.children.length; i++) {
                    const conditionChild = node.children[i];
                    // if a SupportsDeclaration is preceded by "not" then we don't consider it
                    if (conditionChild.type === "Identifier" &&
                        conditionChild.name === "not") {
                        i++;
                        continue;
                    }
                    // save the supported properties and values for this at-rule
                    if (conditionChild.type === "SupportsDeclaration") {
                        const { declaration } = conditionChild;
                        const property = declaration.property;
                        const supportedProperty = supportsRule.addProperty(property);
                        declaration.value.children.forEach(child => {
                            if (child.type === "Identifier") {
                                supportedProperty.addIdentifier(child.name);
                                return;
                            }
                            if (child.type === "Dimension") {
                                supportedProperty.addUnit(child.unit);
                                return;
                            }
                            if (child.type === "Function") {
                                supportedProperty.addFunction(child.name);
                            }
                        });
                        continue;
                    }
                    if (conditionChild.type === "FeatureFunction" &&
                        conditionChild.feature === "selector") {
                        for (const selectorChild of conditionChild.value
                            .children) {
                            supportsRule.addSelector(selectorChild.name);
                        }
                    }
                }
            },
            "Rule > Block > Declaration"(node) {
                const property = node.property;
                // ignore unknown properties - no-invalid-properties already catches this
                if (!properties.has(property)) {
                    return;
                }
                if (allowProperties.has(property)) {
                    return;
                }
                /*
                 * Step 1: Check that the property is in the baseline.
                 *
                 * If the property has been tested in a @supports rule, we don't need to
                 * check it because it won't be applied if the browser doesn't support it.
                 */
                if (!supportsRules.hasProperty(property)) {
                    const featureStatus = properties.get(property);
                    if (!baselineAvailability.isSupported(featureStatus)) {
                        context.report({
                            loc: {
                                start: node.loc.start,
                                end: {
                                    line: node.loc.start.line,
                                    column: node.loc.start.column +
                                        node.property.length,
                                },
                            },
                            messageId: "notBaselineProperty",
                            data: {
                                property,
                                availability: baselineAvailability.availability,
                            },
                        });
                        /*
                         * If the property isn't in baseline, then we don't go
                         * on to check the values. If the property itself isn't
                         * in baseline then chances are the values aren't too,
                         * and there's no need to report multiple errors for the
                         * same property.
                         */
                        return;
                    }
                }
                /*
                 * With tolerant parsing, it's possible that the value is `Raw`
                 * and therefore doesn't have children. If that's the case then
                 * we just exit.
                 */
                if (!node.value?.children) {
                    return;
                }
                /*
                 * Step 2: Check that the property values are in the baseline.
                 */
                for (const child of node.value.children) {
                    if (child.type === "Identifier") {
                        // if the property value has been tested in a @supports rule, don't check it
                        if (!supportsRules.hasPropertyIdentifier(property, child.name)) {
                            checkPropertyValueIdentifier(property, child);
                        }
                        continue;
                    }
                    if (child.type === "Dimension") {
                        if (!supportsRules.hasPropertyUnit(property, child.unit)) {
                            checkPropertyValueUnit(property, child);
                        }
                        continue;
                    }
                    if (child.type === "Function") {
                        if (!supportsRules.hasPropertyFunction(property, child.name)) {
                            checkPropertyValueFunction(child);
                        }
                    }
                }
            },
            "Atrule[name=/^supports$/i]:exit"() {
                supportsRules.pop();
            },
            "Atrule[name=/^media$/i] > AtrulePrelude > MediaQueryList > MediaQuery > Condition"(node) {
                for (const child of node.children) {
                    // ignore unknown media conditions - no-invalid-at-rules already catches this
                    if (!mediaConditions.has(child.name)) {
                        continue;
                    }
                    if (child.type !== "Feature") {
                        continue;
                    }
                    if (allowMediaConditions.has(child.name)) {
                        continue;
                    }
                    const featureStatus = mediaConditions.get(child.name);
                    if (!baselineAvailability.isSupported(featureStatus)) {
                        const loc = child.loc;
                        context.report({
                            loc: {
                                start: {
                                    line: loc.start.line,
                                    // add 1 to account for the @ symbol
                                    column: loc.start.column + 1,
                                },
                                end: {
                                    line: loc.start.line,
                                    column: 
                                    // add 1 to account for the @ symbol
                                    loc.start.column +
                                        child.name.length +
                                        1,
                                },
                            },
                            messageId: "notBaselineMediaCondition",
                            data: {
                                condition: child.name,
                                availability: baselineAvailability.availability,
                            },
                        });
                    }
                }
            },
            Atrule(node) {
                // ignore unknown at-rules - no-invalid-at-rules already catches this
                const atRuleName = node.name.toLowerCase();
                if (!atRules.has(atRuleName)) {
                    return;
                }
                if (allowAtRules.has(atRuleName)) {
                    return;
                }
                const featureStatus = atRules.get(atRuleName);
                if (!baselineAvailability.isSupported(featureStatus)) {
                    const loc = node.loc;
                    context.report({
                        loc: {
                            start: loc.start,
                            end: {
                                line: loc.start.line,
                                // add 1 to account for the @ symbol
                                column: loc.start.column + node.name.length + 1,
                            },
                        },
                        messageId: "notBaselineAtRule",
                        data: {
                            atRule: node.name,
                            availability: baselineAvailability.availability,
                        },
                    });
                }
            },
            "PseudoClassSelector,PseudoElementSelector"(node) {
                const selector = node.name;
                if (!selectors.has(selector)) {
                    return;
                }
                if (allowSelectors.has(selector)) {
                    return;
                }
                // if the selector has been tested in a @supports rule, don't check it
                if (supportsRules.hasSelector(selector)) {
                    return;
                }
                const featureStatus = selectors.get(selector);
                if (!baselineAvailability.isSupported(featureStatus)) {
                    const loc = node.loc;
                    // some selectors are prefixed with the : or :: symbols
                    let prefixSymbolLength = 0;
                    if (node.type.startsWith("PseudoClass")) {
                        prefixSymbolLength = 1;
                    }
                    else if (node.type.startsWith("PseudoElement")) {
                        prefixSymbolLength = 2;
                    }
                    context.report({
                        loc: {
                            start: loc.start,
                            end: {
                                line: loc.start.line,
                                column: loc.start.column +
                                    selector.length +
                                    prefixSymbolLength,
                            },
                        },
                        messageId: "notBaselineSelector",
                        data: {
                            selector,
                            availability: baselineAvailability.availability,
                        },
                    });
                }
            },
            NestingSelector(node) {
                // NestingSelector implies CSS nesting
                const selector = "nesting";
                if (allowSelectors.has(selector)) {
                    return;
                }
                const featureStatus = selectors.get(selector);
                if (baselineAvailability.isSupported(featureStatus)) {
                    return;
                }
                context.report({
                    loc: node.loc,
                    messageId: "notBaselineSelector",
                    data: {
                        selector,
                        availability: baselineAvailability.availability,
                    },
                });
            },
        };
    },
});
Ѱxdeclare namespace _default {
    namespace meta {
        let type: "problem";
        namespace docs {
            let description: string;
            let url: string;
        }
        let schema: {
            type: "object";
            properties: {
                allowUnnamedLayers: {
                    type: "boolean";
                };
                requireImportLayers: {
                    type: "boolean";
                };
                layerNamePattern: {
                    type: "string";
                };
            };
            additionalProperties: false;
        }[];
        let defaultOptions: [{
            allowUnnamedLayers: false;
            requireImportLayers: true;
            layerNamePattern: string;
        }];
        namespace messages {
            let missingLayer: string;
            let missingLayerName: string;
            let missingImportLayer: string;
            let layerNameMismatch: string;
        }
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../index.js").CSSLanguageOptions;
        Code: import("../index.js").CSSSourceCode;
        RuleOptions: UseLayersOptions;
        Node: import("@eslint/css-tree").CssNodePlain;
        MessageIds: UseLayersMessageIds;
    }>): {
        "Atrule[name=/^import$/i]"(node: any): void;
        Layer(node: import("@eslint/css-tree").Layer): void;
        "Atrule[name=/^layer$/i]"(node: any): void;
        "Atrule[name=/^layer$/i]:exit"(): void;
        Rule(node: import("@eslint/css-tree").RulePlain): void;
    };
}
export default _default;
export type UseLayersMessageIds = "missingLayer" | "missingLayerName" | "missingImportLayer" | "layerNameMismatch";
export type UseLayersOptions = [{
    allowUnnamedLayers?: boolean;
    requireImportLayers?: boolean;
    layerNamePattern?: string;
}];
export type UseLayersRuleDefinition = CSSRuleDefinition<{
    RuleOptions: UseLayersOptions;
    MessageIds: UseLayersMessageIds;
}>;
import type { CSSRuleDefinition } from "../types.js";
[exO/**
 * @fileoverview Rule to require layers in CSS.
 * @author Nicholas C. Zakas
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { CSSRuleDefinition } from "../types.js"
 * @typedef {"missingLayer" | "missingLayerName" | "missingImportLayer" | "layerNameMismatch"} UseLayersMessageIds
 * @typedef {[{
 *     allowUnnamedLayers?: boolean,
 *     requireImportLayers?: boolean,
 *     layerNamePattern?: string
 * }]} UseLayersOptions
 * @typedef {CSSRuleDefinition<{ RuleOptions: UseLayersOptions, MessageIds: UseLayersMessageIds }>} UseLayersRuleDefinition
 */
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {UseLayersRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            description: "Require use of layers",
            url: "https://github.com/eslint/css/blob/main/docs/rules/use-layers.md",
        },
        schema: [
            {
                type: "object",
                properties: {
                    allowUnnamedLayers: {
                        type: "boolean",
                    },
                    requireImportLayers: {
                        type: "boolean",
                    },
                    layerNamePattern: {
                        type: "string",
                    },
                },
                additionalProperties: false,
            },
        ],
        defaultOptions: [
            {
                allowUnnamedLayers: false,
                requireImportLayers: true,
                layerNamePattern: "",
            },
        ],
        messages: {
            missingLayer: "Expected rule to be within a layer.",
            missingLayerName: "Expected layer to have a name.",
            missingImportLayer: "Expected import to be within a layer.",
            layerNameMismatch: "Expected layer name '{{ name }}' to match pattern '{{pattern}}'.",
        },
    },
    create(context) {
        let layerDepth = 0;
        const options = context.options[0];
        const layerNameRegex = options.layerNamePattern
            ? new RegExp(options.layerNamePattern, "u")
            : null;
        return {
            "Atrule[name=/^import$/i]"(node) {
                // layer, if present, must always be the second child of the prelude
                const secondChild = node.prelude?.children[1];
                const layerNode = secondChild?.name === "layer" ? secondChild : null;
                if (options.requireImportLayers && !layerNode) {
                    context.report({
                        loc: node.loc,
                        messageId: "missingImportLayer",
                    });
                }
                if (layerNode) {
                    const isLayerFunction = layerNode.type === "Function";
                    if (!options.allowUnnamedLayers && !isLayerFunction) {
                        context.report({
                            loc: layerNode.loc,
                            messageId: "missingLayerName",
                        });
                    }
                }
            },
            Layer(node) {
                if (!layerNameRegex) {
                    return;
                }
                const parts = node.name.split(".");
                let currentPos = 0;
                parts.forEach((part, index) => {
                    if (!layerNameRegex.test(part)) {
                        const startColumn = node.loc.start.column + currentPos;
                        const endColumn = startColumn + part.length;
                        context.report({
                            loc: {
                                start: {
                                    line: node.loc.start.line,
                                    column: startColumn,
                                },
                                end: {
                                    line: node.loc.start.line,
                                    column: endColumn,
                                },
                            },
                            messageId: "layerNameMismatch",
                            data: {
                                name: part,
                                pattern: options.layerNamePattern,
                            },
                        });
                    }
                    currentPos += part.length;
                    // add 1 to account for the . symbol
                    if (index < parts.length - 1) {
                        currentPos += 1;
                    }
                });
            },
            "Atrule[name=/^layer$/i]"(node) {
                layerDepth++;
                if (!options.allowUnnamedLayers && !node.prelude) {
                    context.report({
                        loc: node.loc,
                        messageId: "missingLayerName",
                    });
                }
            },
            "Atrule[name=/^layer$/i]:exit"() {
                layerDepth--;
            },
            Rule(node) {
                if (layerDepth > 0) {
                    return;
                }
                context.report({
                    loc: node.loc,
                    messageId: "missingLayer",
                });
            },
        };
    },
});
s`5Lx</**
 * @fileoverview Additional types for this package.
 * @author Nicholas C. Zakas
 */
import type { RuleVisitor } from "@eslint/core";
import type { CssNodePlain, StyleSheetPlain } from "@eslint/css-tree";
import type { CustomRuleDefinitionType, CustomRuleTypeDefinitions, CustomRuleVisitorWithExit } from "@eslint/plugin-kit";
import type { CSSLanguageOptions, CSSSourceCode } from "./index.js";
/**
 * A CSS syntax element, including nodes and comments.
 */
export type CSSSyntaxElement = CssNodePlain;
type CSSNodeVisitor = {
    [Node in CssNodePlain as Node["type"]]: Node extends StyleSheetPlain ? ((node: Node) => void) | undefined : ((node: Node, parent: CssNodePlain) => void) | undefined;
};
/**
 * A visitor for CSS nodes.
 */
export interface CSSRuleVisitor extends RuleVisitor, Partial<CustomRuleVisitorWithExit<CSSNodeVisitor>> {
}
export type CSSRuleDefinitionTypeOptions = CustomRuleTypeDefinitions;
/**
 * A rule definition for CSS.
 */
export type CSSRuleDefinition<Options extends Partial<CSSRuleDefinitionTypeOptions> = {}> = CustomRuleDefinitionType<{
    LangOptions: CSSLanguageOptions;
    Code: CSSSourceCode;
    Visitor: CSSRuleVisitor;
    Node: CSSSyntaxElement;
}, Options>;
export {};
iʴxd /**
 * @fileoverview Additional types for this package.
 * @author Nicholas C. Zakas
 */
export {};
 7xw/**
 * @fileoverview Utility functions for ESLint CSS plugin.
 * @author Nicholas C. Zakas
 */
/**
 * @import { SyntaxMatchError, SyntaxReferenceError } from "@eslint/css-tree"
 */
/**
 * Determines if an error is a syntax match error.
 * @param {Object} error The error object to check.
 * @returns {error is SyntaxMatchError} True if the error is a syntax match error, false if not.
 */
export function isSyntaxMatchError(error: any): error is SyntaxMatchError;
/**
 * Determines if an error is a syntax reference error.
 * @param {Object} error The error object to check.
 * @returns {error is SyntaxReferenceError} True if the error is a syntax reference error, false if not.
 */
export function isSyntaxReferenceError(error: any): error is SyntaxReferenceError;
import type { SyntaxMatchError } from "@eslint/css-tree";
import type { SyntaxReferenceError } from "@eslint/css-tree";
6.Gx}/**
 * @fileoverview Utility functions for ESLint CSS plugin.
 * @author Nicholas C. Zakas
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { SyntaxMatchError, SyntaxReferenceError } from "@eslint/css-tree"
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
/**
 * Determines if an error is a syntax match error.
 * @param {Object} error The error object to check.
 * @returns {error is SyntaxMatchError} True if the error is a syntax match error, false if not.
 */
export function isSyntaxMatchError(error) {
    return typeof error.syntax === "string";
}
/**
 * Determines if an error is a syntax reference error.
 * @param {Object} error The error object to check.
 * @returns {error is SyntaxReferenceError} True if the error is a syntax reference error, false if not.
 */
export function isSyntaxReferenceError(error) {
    return typeof error.reference === "string";
}
.3TWx{
  "name": "@eslint/css",
  "version": "1.4.0",
  "description": "CSS linting plugin for ESLint",
  "author": "Nicholas C. Zakas",
  "type": "module",
  "main": "dist/index.js",
  "types": "dist/index.d.ts",
  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "default": "./dist/index.js"
    }
  },
  "files": [
    "dist"
  ],
  "publishConfig": {
    "access": "public"
  },
  "gitHooks": {
    "pre-commit": "lint-staged"
  },
  "lint-staged": {
    "*.js": [
      "eslint --fix",
      "prettier --write"
    ],
    "!(*.js)": "prettier --write --ignore-unknown",
    "{src/rules/*.js,tools/update-rules-docs.js,README.md}": [
      "npm run build:update-rules-docs",
      "git add README.md"
    ]
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/eslint/css.git"
  },
  "bugs": {
    "url": "https://github.com/eslint/css/issues"
  },
  "homepage": "https://github.com/eslint/css#readme",
  "scripts": {
    "build": "npm run build:rules && npm run build:types && npm run build:update-rules-docs",
    "build:baseline": "node tools/generate-baseline.js",
    "build:rules": "node tools/build-rules.js",
    "build:types": "tsc",
    "build:update-rules-docs": "node tools/update-rules-docs.js",
    "prepare": "npm run build",
    "pretest": "npm run build",
    "lint": "eslint",
    "lint:fix": "eslint --fix",
    "lint:types": "attw --pack --profile esm-only",
    "lint:unused": "knip",
    "fmt": "prettier --write .",
    "fmt:check": "prettier --check .",
    "test": "mocha \"tests/**/*.test.js\"",
    "test:coverage": "c8 npm test",
    "test:jsr": "npx -y jsr@latest publish --dry-run",
    "test:types": "npm run build && tsc -p tests/types/tsconfig.json",
    "test:types:5.3": "npx -p typescript@5.3 -y -- tsc -p tests/types/tsconfig.legacy.json",
    "test:types:5.x": "npx -p typescript@5.x -y -- tsc -p tests/types/tsconfig.json",
    "test:types:7.x": "npx -p @typescript/native-preview@latest -y -- tsgo -p tests/types/tsconfig.json",
    "test:types:all": "npm run test:types && npm run test:types:5.3 && npm run test:types:5.x && npm run test:types:7.x"
  },
  "keywords": [
    "eslint",
    "eslint-plugin",
    "eslintplugin",
    "css",
    "linting"
  ],
  "license": "Apache-2.0",
  "dependencies": {
    "@eslint/core": "^1.2.1",
    "@eslint/css-tree": "^4.0.4",
    "@eslint/plugin-kit": "^0.7.2"
  },
  "devDependencies": {
    "@arethetypeswrong/cli": "^0.18.3",
    "@eslint/json": "^2.0.0",
    "@types/node": "^20.19.0",
    "@webref/css": "^8.6.0",
    "c8": "^11.0.0",
    "dedent": "^1.5.3",
    "eslint": "^10.0.0",
    "eslint-config-eslint": "^14.0.0",
    "eslint-plugin-eslint-plugin": "^7.3.2",
    "globals": "^17.0.0",
    "knip": "^6.0.0",
    "lint-staged": "^16.0.0",
    "mdast-util-from-markdown": "^2.0.2",
    "mocha": "^11.0.0",
    "prettier": "3.8.4",
    "tailwind-csstree": "^0.3.0",
    "typescript": "^6.0.3",
    "web-features": "^3.32.0",
    "yorkie": "^2.0.0"
  },
  "engines": {
    "node": "^20.19.0 || ^22.13.0 || >=24"
  }
}
@xh
x Q100644 LICENSE 6l36Ņz100644 README.md .Y^ߌkY;100644 package.json :i5o(h4VWH40000 src qQ+Zq}u^!ŭ40000 types &9&!BzHv<NBǾAxCopyright (c) George Zahariev

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
P+x+ECopyright OpenJS Foundation and other contributors, <www.openjsf.org>= obtaining a copy
l- 
in the Software without 4	
to use, { Software is
, K included in
t EXPRESS OR
4 
$ 
&
1 F1
LIABILITY, < FROM,
7! OTHER DEALINGS IN
THE SOFTWARE.
r[x
[![npm version](https://img.shields.io/npm/v/@eslint/js.svg)](https://www.npmjs.com/package/@eslint/js)
[![Downloads](https://img.shields.io/npm/dm/@eslint/js.svg)](https://www.npmjs.com/package/@eslint/js)
[![Build Status](https://github.com/eslint/eslint/workflows/CI/badge.svg)](https://github.com/eslint/eslint/actions)
<br>
[![Open Collective Backers](https://img.shields.io/opencollective/backers/eslint)](https://opencollective.com/eslint)
[![Open Collective Sponsors](https://img.shields.io/opencollective/sponsors/eslint)](https://opencollective.com/eslint)

# ESLint JavaScript Plugin

[Website](https://eslint.org) |
[Configure ESLint](https://eslint.org/docs/latest/use/configure) |
[Rules](https://eslint.org/docs/rules/) |
[Contribute to ESLint](https://eslint.org/docs/latest/contribute) |
[Report Bugs](https://eslint.org/docs/latest/contribute/report-bugs) |
[Code of Conduct](https://eslint.org/conduct) |
[X](https://x.com/geteslint) |
[Discord](https://eslint.org/chat) |
[Mastodon](https://fosstodon.org/@eslint) |
[Bluesky](https://bsky.app/profile/eslint.org)

The beginnings of separating out JavaScript-specific functionality from ESLint.

Right now, this plugin contains two configurations:

- `recommended` - enables the rules recommended by the ESLint team (the replacement for `"eslint:recommended"`)
- `all` - enables all ESLint rules (the replacement for `"eslint:all"`)

## Installation

You can install ESLint using npm or other package managers:

```shell
npm install eslint -D
# or
yarn add eslint -D
# or
pnpm install eslint -D
# or
bun add eslint -D
```

Then install this plugin:

```shell
npm install @eslint/js -D
# or
yarn add @eslint/js -D
# or
pnpm install @eslint/js -D
# or
bun add @eslint/js -D
```

## Usage

Use in your `eslint.config.js` file anytime you want to extend one of the configs:

```js
import { defineConfig } from "eslint/config";
import js from "@eslint/js";

export default defineConfig([
	// apply recommended rules to JS files
	{
		name: "your-project/recommended-rules",
		files: ["**/*.js"],
		plugins: {
			js,
		},
		extends: ["js/recommended"],
	},

	// apply recommended rules to JS files with an override
	{
		name: "your-project/recommended-rules-with-override",
		files: ["**/*.js"],
		plugins: {
			js,
		},
		extends: ["js/recommended"],
		rules: {
			"no-unused-vars": "warn",
		},
	},

	// apply all rules to JS files
	{
		name: "your-project/all-rules",
		files: ["**/*.js"],
		plugins: {
			js,
		},
		extends: ["js/all"],
		rules: {
			"no-unused-vars": "warn",
		},
	},
]);
```

## License

MIT
^m78xp{
  "name": "@eslint/js",
  "version": "10.0.1",
  "description": "ESLint JavaScript language implementation",
  "funding": "https://eslint.org/donate",
  "main": "./src/index.js",
  "types": "./types/index.d.ts",
  "scripts": {
    "test:types": "tsc -p tests/types/tsconfig.json"
  },
  "files": [
    "LICENSE",
    "README.md",
    "src",
    "types"
  ],
  "publishConfig": {
    "access": "public"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/eslint/eslint.git",
    "directory": "packages/js"
  },
  "homepage": "https://eslint.org",
  "bugs": "https://github.com/eslint/eslint/issues/",
  "keywords": [
    "javascript",
    "eslint-plugin",
    "eslint"
  ],
  "license": "MIT",
  "peerDependencies": {
    "eslint": "^10.0.0"
  },
  "peerDependenciesMeta": {
    "eslint": {
      "optional": true
    }
  },
  "engines": {
    "node": "^20.19.0 || ^22.13.0 || >=24"
  }
}
}xF 40000 configs T1_I>b7100644 index.js j!ud&yZ	İxZ 100644 eslint-all.js C*y@W}ݬ#Ҭ100644 eslint-recommended.js 'Diy;evWC)߷xX/*
 * WARNING: This file is autogenerated using the tools/update-eslint-all.js
 * script. Do not edit manually.
 */
"use strict";

module.exports = Object.freeze({
    name: "@eslint/js/all",
    rules: Object.freeze({
        "accessor-pairs": "error",
        "array-callback-return": "error",
        "arrow-body-style": "error",
        "block-scoped-var": "error",
        "camelcase": "error",
        "capitalized-comments": "error",
        "class-methods-use-this": "error",
        "complexity": "error",
        "consistent-return": "error",
        "consistent-this": "error",
        "constructor-super": "error",
        "curly": "error",
        "default-case": "error",
        "default-case-last": "error",
        "default-param-last": "error",
        "dot-notation": "error",
        "eqeqeq": "error",
        "for-direction": "error",
        "func-name-matching": "error",
        "func-names": "error",
        "func-style": "error",
        "getter-return": "error",
        "grouped-accessor-pairs": "error",
        "guard-for-in": "error",
        "id-denylist": "error",
        "id-length": "error",
        "id-match": "error",
        "init-declarations": "error",
        "logical-assignment-operators": "error",
        "max-classes-per-file": "error",
        "max-depth": "error",
        "max-lines": "error",
        "max-lines-per-function": "error",
        "max-nested-callbacks": "error",
        "max-params": "error",
        "max-statements": "error",
        "new-cap": "error",
        "no-alert": "error",
        "no-array-constructor": "error",
        "no-async-promise-executor": "error",
        "no-await-in-loop": "error",
        "no-bitwise": "error",
        "no-caller": "error",
        "no-case-declarations": "error",
        "no-class-assign": "error",
        "no-compare-neg-zero": "error",
        "no-cond-assign": "error",
        "no-console": "error",
        "no-const-assign": "error",
        "no-constant-binary-expression": "error",
        "no-constant-condition": "error",
        "no-constructor-return": "error",
        "no-continue": "error",
        "no-control-regex": "error",
        "no-debugger": "error",
        "no-delete-var": "error",
        "no-div-regex": "error",
        "no-dupe-args": "error",
        "no-dupe-class-members": "error",
        "no-dupe-else-if": "error",
        "no-dupe-keys": "error",
        "no-duplicate-case": "error",
        "no-duplicate-imports": "error",
        "no-else-return": "error",
        "no-empty": "error",
        "no-empty-character-class": "error",
        "no-empty-function": "error",
        "no-empty-pattern": "error",
        "no-empty-static-block": "error",
        "no-eq-null": "error",
        "no-eval": "error",
        "no-ex-assign": "error",
        "no-extend-native": "error",
        "no-extra-bind": "error",
        "no-extra-boolean-cast": "error",
        "no-extra-label": "error",
        "no-fallthrough": "error",
        "no-func-assign": "error",
        "no-global-assign": "error",
        "no-implicit-coercion": "error",
        "no-implicit-globals": "error",
        "no-implied-eval": "error",
        "no-import-assign": "error",
        "no-inline-comments": "error",
        "no-inner-declarations": "error",
        "no-invalid-regexp": "error",
        "no-invalid-this": "error",
        "no-irregular-whitespace": "error",
        "no-iterator": "error",
        "no-label-var": "error",
        "no-labels": "error",
        "no-lone-blocks": "error",
        "no-lonely-if": "error",
        "no-loop-func": "error",
        "no-loss-of-precision": "error",
        "no-magic-numbers": "error",
        "no-misleading-character-class": "error",
        "no-multi-assign": "error",
        "no-multi-str": "error",
        "no-negated-condition": "error",
        "no-nested-ternary": "error",
        "no-new": "error",
        "no-new-func": "error",
        "no-new-native-nonconstructor": "error",
        "no-new-wrappers": "error",
        "no-nonoctal-decimal-escape": "error",
        "no-obj-calls": "error",
        "no-object-constructor": "error",
        "no-octal": "error",
        "no-octal-escape": "error",
        "no-param-reassign": "error",
        "no-plusplus": "error",
        "no-promise-executor-return": "error",
        "no-proto": "error",
        "no-prototype-builtins": "error",
        "no-redeclare": "error",
        "no-regex-spaces": "error",
        "no-restricted-exports": "error",
        "no-restricted-globals": "error",
        "no-restricted-imports": "error",
        "no-restricted-properties": "error",
        "no-restricted-syntax": "error",
        "no-return-assign": "error",
        "no-script-url": "error",
        "no-self-assign": "error",
        "no-self-compare": "error",
        "no-sequences": "error",
        "no-setter-return": "error",
        "no-shadow": "error",
        "no-shadow-restricted-names": "error",
        "no-sparse-arrays": "error",
        "no-template-curly-in-string": "error",
        "no-ternary": "error",
        "no-this-before-super": "error",
        "no-throw-literal": "error",
        "no-unassigned-vars": "error",
        "no-undef": "error",
        "no-undef-init": "error",
        "no-undefined": "error",
        "no-underscore-dangle": "error",
        "no-unexpected-multiline": "error",
        "no-unmodified-loop-condition": "error",
        "no-unneeded-ternary": "error",
        "no-unreachable": "error",
        "no-unreachable-loop": "error",
        "no-unsafe-finally": "error",
        "no-unsafe-negation": "error",
        "no-unsafe-optional-chaining": "error",
        "no-unused-expressions": "error",
        "no-unused-labels": "error",
        "no-unused-private-class-members": "error",
        "no-unused-vars": "error",
        "no-use-before-define": "error",
        "no-useless-assignment": "error",
        "no-useless-backreference": "error",
        "no-useless-call": "error",
        "no-useless-catch": "error",
        "no-useless-computed-key": "error",
        "no-useless-concat": "error",
        "no-useless-constructor": "error",
        "no-useless-escape": "error",
        "no-useless-rename": "error",
        "no-useless-return": "error",
        "no-var": "error",
        "no-void": "error",
        "no-warning-comments": "error",
        "no-with": "error",
        "object-shorthand": "error",
        "one-var": "error",
        "operator-assignment": "error",
        "prefer-arrow-callback": "error",
        "prefer-const": "error",
        "prefer-destructuring": "error",
        "prefer-exponentiation-operator": "error",
        "prefer-named-capture-group": "error",
        "prefer-numeric-literals": "error",
        "prefer-object-has-own": "error",
        "prefer-object-spread": "error",
        "prefer-promise-reject-errors": "error",
        "prefer-regex-literals": "error",
        "prefer-rest-params": "error",
        "prefer-spread": "error",
        "prefer-template": "error",
        "preserve-caught-error": "error",
        "radix": "error",
        "require-atomic-updates": "error",
        "require-await": "error",
        "require-unicode-regexp": "error",
        "require-yield": "error",
        "sort-imports": "error",
        "sort-keys": "error",
        "sort-vars": "error",
        "strict": "error",
        "symbol-description": "error",
        "unicode-bom": "error",
        "use-isnan": "error",
        "valid-typeof": "error",
        "vars-on-top": "error",
        "yoda": "error"
    })
});
"x
t/*
 * WARNING: This file is autogenerated using the tools/update-eslint-recommended.js
 * script. Do not edit manually.
 */
"use strict";

module.exports = Object.freeze({
    name: "@eslint/js/recommended",
    rules: Object.freeze({
        "constructor-super": "error",
        "for-direction": "error",
        "getter-return": "error",
        "no-async-promise-executor": "error",
        "no-case-declarations": "error",
        "no-class-assign": "error",
        "no-compare-neg-zero": "error",
        "no-cond-assign": "error",
        "no-const-assign": "error",
        "no-constant-binary-expression": "error",
        "no-constant-condition": "error",
        "no-control-regex": "error",
        "no-debugger": "error",
        "no-delete-var": "error",
        "no-dupe-args": "error",
        "no-dupe-class-members": "error",
        "no-dupe-else-if": "error",
        "no-dupe-keys": "error",
        "no-duplicate-case": "error",
        "no-empty": "error",
        "no-empty-character-class": "error",
        "no-empty-pattern": "error",
        "no-empty-static-block": "error",
        "no-ex-assign": "error",
        "no-extra-boolean-cast": "error",
        "no-fallthrough": "error",
        "no-func-assign": "error",
        "no-global-assign": "error",
        "no-import-assign": "error",
        "no-invalid-regexp": "error",
        "no-irregular-whitespace": "error",
        "no-loss-of-precision": "error",
        "no-misleading-character-class": "error",
        "no-new-native-nonconstructor": "error",
        "no-nonoctal-decimal-escape": "error",
        "no-obj-calls": "error",
        "no-octal": "error",
        "no-prototype-builtins": "error",
        "no-redeclare": "error",
        "no-regex-spaces": "error",
        "no-self-assign": "error",
        "no-setter-return": "error",
        "no-shadow-restricted-names": "error",
        "no-sparse-arrays": "error",
        "no-this-before-super": "error",
        "no-unassigned-vars": "error",
        "no-undef": "error",
        "no-unexpected-multiline": "error",
        "no-unreachable": "error",
        "no-unsafe-finally": "error",
        "no-unsafe-negation": "error",
        "no-unsafe-optional-chaining": "error",
        "no-unused-labels": "error",
        "no-unused-private-class-members": "error",
        "no-unused-vars": "error",
        "no-useless-assignment": "error",
        "no-useless-backreference": "error",
        "no-useless-catch": "error",
        "no-useless-escape": "error",
        "no-with": "error",
        "preserve-caught-error": "error",
        "require-yield": "error",
        "use-isnan": "error",
        "valid-typeof": "error"
    }),
});
INx/**
 * @fileoverview Main package entrypoint.
 * @author Nicholas C. Zakas
 */

"use strict";

const { name, version } = require("../package.json");

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

module.exports = {
	meta: {
		name,
		version,
	},
	configs: {
		all: require("./configs/eslint-all"),
		recommended: require("./configs/eslint-recommended"),
	},
};
5#Ȧx& 100644 index.d.ts Ԓf{R0Qx<import type { Linter } from "eslint";

declare const js: {
	readonly meta: {
		readonly name: string;
		readonly version: string;
	};
	readonly configs: {
		readonly recommended: { readonly rules: Readonly<Linter.RulesRecord> };
		readonly all: { readonly rules: Readonly<Linter.RulesRecord> };
	};
};

export = js;
lx p100644 LICENSE &랟+Kfݩo\d100644 README.md m$c7Ҹ<T40000 dist mM{|;(;100644 package.json 7,x]k_6x-9# ESLint JSON Language Plugin

## Overview

This package contains a plugin that allows you to natively lint JSON, JSONC, and JSON5 files using ESLint.

**Important:** This plugin requires ESLint v9.15.0 or higher and you must be using the [new configuration system](https://eslint.org/docs/latest/use/configure/configuration-files).

## Installation

For Node.js and compatible runtimes:

```shell
npm install @eslint/json -D
# or
yarn add @eslint/json -D
# or
pnpm install @eslint/json -D
# or
bun add @eslint/json -D
```

For Deno:

```shell
deno add @eslint/json
```

## Usage

This package exports these languages:

- `"json/json"` is for regular JSON files
- `"json/jsonc"` is for JSON files that support comments ([JSONC](https://github.com/microsoft/node-jsonc-parser)) such as those used for [Visual Studio Code](https://code.visualstudio.com/) configuration files
- `"json/json5"` is for [JSON5](https://json5.org) files

Depending on which types of JSON files you'd like to lint, you can set up your `eslint.config.js` file to include just the files you'd like. Here's an example that lints JSON, JSONC, and JSON5 files:

```js
// eslint.config.js
import { defineConfig } from "eslint/config";
import json from "@eslint/json";

export default defineConfig([
	{
		plugins: {
			json,
		},
	},

	// lint JSON files
	{
		files: ["**/*.json"],
		language: "json/json",
		rules: {
			"json/no-duplicate-keys": "error",
		},
	},

	// lint JSONC files
	{
		files: ["**/*.jsonc", ".vscode/*.json"],
		language: "json/jsonc",
		rules: {
			"json/no-duplicate-keys": "error",
		},
	},

	// lint JSON5 files
	{
		files: ["**/*.json5"],
		language: "json/json5",
		rules: {
			"json/no-duplicate-keys": "error",
		},
	},
]);
```

In CommonJS format:

```js
// eslint.config.js
const { defineConfig } = require("eslint/config");
const json = require("@eslint/json").default;

module.exports = defineConfig([
	{
		plugins: {
			json,
		},
	},

	// lint JSON files
	{
		files: ["**/*.json"],
		language: "json/json",
		rules: {
			"json/no-duplicate-keys": "error",
		},
	},

	// lint JSONC files
	{
		files: ["**/*.jsonc", ".vscode/*.json"],
		language: "json/jsonc",
		rules: {
			"json/no-duplicate-keys": "error",
		},
	},

	// lint JSON5 files
	{
		files: ["**/*.json5"],
		language: "json/json5",
		rules: {
			"json/no-duplicate-keys": "error",
		},
	},
]);
```

## Recommended Configuration

To use the recommended configuration for this plugin, specify your matching `files` and then use the `extends: ["json/recommended"]` property, like this:

```js
// eslint.config.js
import { defineConfig } from "eslint/config";
import json from "@eslint/json";

export default defineConfig([
	// lint JSON files
	{
		files: ["**/*.json"],
		ignores: ["package-lock.json"],
		plugins: { json },
		language: "json/json",
		extends: ["json/recommended"],
	},

	// lint JSONC files
	{
		files: ["**/*.jsonc"],
		plugins: { json },
		language: "json/jsonc",
		extends: ["json/recommended"],
	},

	// lint JSON5 files
	{
		files: ["**/*.json5"],
		plugins: { json },
		language: "json/json5",
		extends: ["json/recommended"],
	},
]);
```

**Note:** You generally want to ignore `package-lock.json` because it is auto-generated and you typically will not want to manually make changes to it.

## Rules

<!-- NOTE: The following table is autogenerated. Do not manually edit. -->

<!-- Rule Table Start -->

| **Rule Name**                                                  | **Description**                                           | **Recommended** |
| :------------------------------------------------------------- | :-------------------------------------------------------- | :-------------: |
| [`no-duplicate-keys`](./docs/rules/no-duplicate-keys.md)       | Disallow duplicate keys in JSON objects                   |       yes       |
| [`no-empty-keys`](./docs/rules/no-empty-keys.md)               | Disallow empty keys in JSON objects                       |       yes       |
| [`no-unnormalized-keys`](./docs/rules/no-unnormalized-keys.md) | Disallow JSON keys that are not normalized                |       yes       |
| [`no-unsafe-values`](./docs/rules/no-unsafe-values.md)         | Disallow JSON values that are unsafe for interchange      |       yes       |
| [`sort-keys`](./docs/rules/sort-keys.md)                       | Require JSON object keys to be sorted                     |       no        |
| [`top-level-interop`](./docs/rules/top-level-interop.md)       | Require the JSON top-level value to be an array or object |       no        |

<!-- Rule Table End -->

## Configuration Comments

In JSONC and JSON5 files, you can also use [rule configurations comments](https://eslint.org/docs/latest/use/configure/rules#using-configuration-comments) and [disable directives](https://eslint.org/docs/latest/use/configure/rules#disabling-rules).

```jsonc
/* eslint json/no-empty-keys: "error" */

{
	"foo": {
		"": 1, // eslint-disable-line json/no-empty-keys -- We want an empty key here
	},
	"bar": {
		// eslint-disable-next-line json/no-empty-keys -- We want an empty key here too
		"": 2,
	},
	/* eslint-disable json/no-empty-keys -- Empty keys are allowed in the following code as well */
	"baz": [
		{
			"": 3,
		},
		{
			"": 4,
		},
	],
	/* eslint-enable json/no-empty-keys -- re-enable now */
}
```

Both line and block comments can be used for all kinds of configuration comments.

## Allowing trailing commas in JSONC

The Microsoft implementation of JSONC optionally allows for trailing commas in objects and arrays (files like `tsconfig.json` have this option enabled by default in Visual Studio Code). To enable trailing commas in JSONC files, use the `allowTrailingCommas` language option, as in this example:

```js
// eslint.config.js
import { defineConfig } from "eslint/config";
import json from "@eslint/json";

export default defineConfig([
	// lint JSONC files
	{
		files: ["**/*.jsonc"],
		plugins: { json },
		language: "json/jsonc",
		extends: ["json/recommended"],
	},

	// lint JSONC files and allow trailing commas
	{
		files: ["**/tsconfig.json", ".vscode/*.json"],
		plugins: { json },
		language: "json/jsonc",
		languageOptions: {
			allowTrailingCommas: true,
		},
		extends: ["json/recommended"],
	},
]);
```

**Note:** The `allowTrailingCommas` option is only valid for the `json/jsonc` language.

## Frequently Asked Questions

### How does this relate to `eslint-plugin-json` and `eslint-plugin-jsonc`?

This plugin implements JSON parsing for ESLint using the language plugins API, which is the official way of supporting non-JavaScript languages in ESLint. This differs from the other plugins:

- [`eslint-plugin-json`](https://github.com/azeemba/eslint-plugin-json) uses a processor to parse the JSON, meaning it doesn't create an AST and you can't write custom rules for it.
- [`eslint-plugin-jsonc`](https://github.com/ota-meshi/eslint-plugin-jsonc) uses a parser that still goes through the JavaScript linting functionality and requires several rules to disallow valid JavaScript syntax that is invalid in JSON.

As such, this plugin is more robust and faster than the others. You can write your own custom rules when using the languages in this plugin, too.

### What about missing rules that are available in `eslint-plugin-json` and `eslint-plugin-jsonc`?

Most of the rules in `eslint-plugin-json` are actually syntax errors that are caught automatically by the parser used in this plugin.

Similarly, many of the rules in `eslint-plugin-jsonc` specifically disallow valid JavaScript syntax that is invalid in the context of JSON. These are also automatically caught by the parser in this plugin.

Any other rules that catch potential problems in JSON are welcome to be implemented. You can [open an issue](https://github.com/eslint/json/issues/new/choose) to propose a new rule.

## Editor and IDE Setup

### Visual Studio Code

First, ensure you have the [ESLint plugin](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) installed.

Then, edit `eslint.validate` in your `settings.json` file to include `json`, `jsonc`, and `json5`:

```json
{
	"eslint.validate": ["json", "jsonc", "json5"]
}
```

### JetBrains WebStorm

For any [JetBrains WebStorm](https://www.jetbrains.com/webstorm/), configure the [ESLint scope](https://www.jetbrains.com/help/webstorm/eslint.html#ws_eslint_configure_scope) to include `json`, `jsonc`, and `json5`, such as:

```text
**/*.{js,ts,jsx,tsx,cjs,cts,mjs,mts,html,vue,json,jsonc,json5}
```

## License

Apache 2.0

<!-- NOTE: This section is autogenerated. Do not manually edit.-->
<!--sponsorsstart-->

## Sponsors

The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
to get your logo on our READMEs and [website](https://eslint.org/sponsors).

<h3>Platinum Sponsors</h3>
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a></p><h3>Gold Sponsors</h3>
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a> <a href="https://www.coderabbit.ai/?utm_source=cr_org&utm_medium=github"><img src="https://avatars.githubusercontent.com/u/132028505" alt="CodeRabbit" height="96"></a></p><h3>Silver Sponsors</h3>
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/d472863/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/2d6c3b6/logo.png" alt="Liftoff" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" height="32"></a> <a href="https://www.crawljobs.com/"><img src="https://images.opencollective.com/crawljobs-poland/fa43a17/logo.png" alt="CrawlJobs" height="32"></a> <a href="https://depot.dev"><img src="https://images.opencollective.com/depot/39125a1/logo.png" alt="Depot" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://citadel.co.jp"><img src="https://avatars.githubusercontent.com/u/75781367" alt="Citadel AI" height="32"></a></p>
<h3>Technology Sponsors</h3>
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
<!--sponsorsend-->
M&x@40000 build yXѵyY100644 index.d.ts hb!{FfC#Y100644 index.js }W󼸰F%$ )40000 languages 9Y-MTS+BS40000 rules ǊrkVݟӌ100644 types.d.ts eN:`B7100644 types.js SweN׬]FW2-C100644 util.d.ts HbFhvD?ڧ100644 util.js e8t}#ISդޮ
x Q100644 recommended-config.d.ts (ٶ`bA>3100644 recommended-config.js Qʢ}8T[4h100644 rules.d.ts Wh+}ݽK)Yo100644 rules.js *mYgt/J@*U_Eɾx export default rules;
declare const rules: {
    readonly "json/no-duplicate-keys": "error";
    readonly "json/no-empty-keys": "error";
    readonly "json/no-unnormalized-keys": "error";
    readonly "json/no-unsafe-values": "error";
};
0sP?x &const rules = /** @type {const} */ ({
    "json/no-duplicate-keys": "error",
    "json/no-empty-keys": "error",
    "json/no-unnormalized-keys": "error",
    "json/no-unsafe-values": "error"
});
export default rules;
cE%xYdeclare const _default: {
    "no-duplicate-keys": import("../rules/no-duplicate-keys.js").NoDuplicateKeysRuleDefinition;
    "no-empty-keys": import("../rules/no-empty-keys.js").NoEmptyKeysRuleDefinition;
    "no-unnormalized-keys": import("../rules/no-unnormalized-keys.js").NoUnnormalizedKeysRuleDefinition;
    "no-unsafe-values": import("../rules/no-unsafe-values.js").NoUnsafeValuesRuleDefinition;
    "sort-keys": import("../rules/sort-keys.js").SortKeysRuleDefinition;
    "top-level-interop": import("../rules/top-level-interop.js").TopLevelInteropRuleDefinition;
};
export default _default;
|ximport rule0 from "../rules/no-duplicate-keys.js";
import rule1 from "../rules/no-empty-keys.js";
import rule2 from "../rules/no-unnormalized-keys.js";
import rule3 from "../rules/no-unsafe-values.js";
import rule4 from "../rules/sort-keys.js";
import rule5 from "../rules/top-level-interop.js";
export default {
    "no-duplicate-keys": rule0,
    "no-empty-keys": rule1,
    "no-unnormalized-keys": rule2,
    "no-unsafe-values": rule3,
    "sort-keys": rule4,
    "top-level-interop": rule5,
};
@+Sx3/**
 * @fileoverview JSON plugin.
 * @author Nicholas C. Zakas
 */
//-----------------------------------------------------------------------------
// Imports
//-----------------------------------------------------------------------------
import { JSONLanguage } from "./languages/json-language.js";
import { JSONSourceCode } from "./languages/json-source-code.js";
import recommendedRules from "./build/recommended-config.js";
import rules from "./build/rules.js";
//-----------------------------------------------------------------------------
// Plugin
//-----------------------------------------------------------------------------
const plugin = {
    meta: {
        name: "@eslint/json",
        namespace: "json",
        version: "2.0.1", // x-release-please-version
    },
    languages: {
        json: new JSONLanguage({ mode: "json" }),
        jsonc: new JSONLanguage({ mode: "jsonc" }),
        json5: new JSONLanguage({ mode: "json5" }),
    },
    rules,
    configs: {
        recommended: {
            name: "@eslint/json/recommended",
            plugins: {},
            rules: recommendedRules,
        },
    },
};
Object.assign(plugin.configs.recommended.plugins, { json: plugin });
export default plugin;
export { JSONSourceCode };
export * from "./languages/json-language.js";
export * from "./types.js";
rx E100644 json-language.d.ts 92:O(100644 json-language.js s$jolws100644 json-source-code.d.ts N ZÝk!UtVY4100644 json-source-code.js {rrLB
rP3H7Qx/**
 * @import { DocumentNode, AnyNode } from "@humanwhocodes/momoa";
 * @import { Language, OkParseResult, ParseResult, File } * @typedef {OkParseResult<DocumentNode>} JSONOkParseResult
 * @typedef {ParseResult<DocumentNode>} JSONParseResult
 * @typedef {Object} JSONLanguageOptions
 * @property {boolean} [allowTrailingCommas] Whether to allow trailing commas in JSONC mode.
 */
/**
 * JSON
9JSONLanguageOptions; Code: JSON`5DocumentNode; Node: AnyNode }>}
 */
export class JSON.Creates a new instance.
     * @param {Object} options The options to use for this instance.
     * @param {"json"|"jsonc"|"json5"} options.mode The parser mode to use.
     */
    constructor({ mode }: {
        mode: "json" | "jsonc" | "json5";
    });l/JSONj\cJSON'.g2{languageOptions: JSONLanguageOptions}} context Th/JSON6Bcontext: JSONJSON+JSONaPJSONa(JSONPJSONJSONJJSONOkParseResult): JSONSourceCode;
    #private;
}
export type JSONOkParseResult = OkParseResult<DocumentNode>;
export type JS;ONParseResult = ParseResult<DocumentNode>;
export type JSON.Nallow trailing commas in JSONC mode.
     */
    allowTrailingCommas?: booleanfJSONSourceCode } from "./json, )DocumentNode } from "@humanwhocodes/momoatD#ڽxb/**
 * @fileoverview The MarkdownLanguage class.
 * @author Nicholas C. Zakas
 */
/* eslint class-methods-use-this: 0 -- Required to complete interface. */
//------------------------------------------------------------------------------
// Imports
//------------------------------------------------------------------------------
import { MarkdownSourceCode } from "./markdown-source-code.js";
import { fromMarkdown } from "mdast-util-from-markdown";
import { frontmatterFromMarkdown } from "mdast-util-frontmatter";
import { gfmFromMarkdown } from "mdast-util-gfm";
import { mathFromMarkdown } from "mdast-util-math";
import { frontmatter } from "micromark-extension-frontmatter";
import { gfm } from "micromark-extension-gfm";
import { math } from "micromark-extension-math";
//-----------------------------------------------------------------------------
// Types
//-----------------------------------------------------------------------------
/**
 * @import { Language, File, ParseResult, OkParseResult } from "@eslint/core";
 * @import { Root } from "mdast";
 * @import { Options } from "mdast-util-from-markdown";
 * @import { MarkdownLanguageOptions, MarkdownLanguageContext } from "../types.js";
 * @typedef {Options['extensions']} Extensions
 * @typedef {Options['mdastExtensions']} MdastExtensions
 * @typedef {"commonmark"|"gfm"} ParserMode
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
/**
 * Parser configuration for JSON frontmatter.
 * Example of supported frontmatter format:
 * ```markdown
 * ---
 * {
 *   "title": "My Document",
 *   "date": "2025-06-09"
 * }
 * ---
 * ```
 */
const jsonFrontmatterConfig = {
    type: "json",
    marker: "-",
};
/**
 * Create parser options based on `mode` and `languageOptions`.
 * @param {ParserMode} mode The markdown parser mode.
 * @param {MarkdownLanguageOptions} languageOptions Language options.
 * @returns {{extensions: Extensions, mdastExtensions: MdastExtensions}} Parser options for micromark and mdast.
 */
function createParserOptions(mode, languageOptions) {
    /** @type {Extensions} */
    const extensions = [];
    /** @type {MdastExtensions} */
    const mdastExtensions = [];
    // 1. `mode`: Add GFM extensions if mode is "gfm"
    if (mode === "gfm") {
        extensions.push(gfm());
        mdastExtensions.push(gfmFromMarkdown());
    }
    // 2. `languageOptions.frontmatter`: Handle frontmatter options
    const frontmatterOption = languageOptions?.frontmatter;
    // Skip frontmatter entirely if false
    if (frontmatterOption !== false) {
        if (frontmatterOption === "yaml") {
            extensions.push(frontmatter(["yaml"]));
            mdastExtensions.push(frontmatterFromMarkdown(["yaml"]));
        }
        else if (frontmatterOption === "toml") {
            extensions.push(frontmatter(["toml"]));
            mdastExtensions.push(frontmatterFromMarkdown(["toml"]));
        }
        else if (frontmatterOption === "json") {
            extensions.push(frontmatter(jsonFrontmatterConfig));
            mdastExtensions.push(frontmatterFromMarkdown(jsonFrontmatterConfig));
        }
    }
    // 3. `languageOptions.math`: Handle math option
    const mathOption = languageOptions?.math;
    // Skip math entirely if false
    if (mathOption === true) {
        extensions.push(math());
        mdastExtensions.push(mathFromMarkdown());
    }
    return {
        extensions,
        mdastExtensions,
    };
}
//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------
/**
 * Markdown Language Object
 * @implements {Language}
 */
export class MarkdownLanguage {
    /**
     * The type of file to read.
     * @type {"text"}
     */
    fileType = "text";
    /**
     * The line number at which the parser starts counting.
     * @type {0|1}
     */
    lineStart = 1;
    /**
     * The column number at which the parser starts counting.
     * @type {0|1}
     */
    columnStart = 1;
    /**
     * The name of the key that holds the type of the node.
     * @type {string}
     */
    nodeTypeKey = "type";
    /**
     * Default language options. User-defined options are merged with this object.
     * @type {MarkdownLanguageOptions}
     */
    defaultLanguageOptions = {
        frontmatter: false,
        math: false,
    };
    /**
     * The Markdown parser mode.
     * @type {ParserMode}
     */
    #mode = "commonmark";
    /**
     * Creates a new instance.
     * @param {Object} options The options to use for this instance.
     * @param {ParserMode} [options.mode] The Markdown parser mode to use.
     */
    constructor({ mode } = {}) {
        if (mode) {
            this.#mode = mode;
        }
    }
    /**
     * Validates the language options.
     * @param {MarkdownLanguageOptions} languageOptions The language options to validate.
     * @returns {void}
     * @throws {Error} When the language options are invalid.
     */
    validateLanguageOptions(languageOptions) {
        // `frontmatter` option validation
        const frontmatterOption = languageOptions?.frontmatter;
        const validFrontmatterOptions = new Set([
            false,
            "yaml",
            "toml",
            "json",
        ]);
        if (frontmatterOption !== undefined &&
            !validFrontmatterOptions.has(frontmatterOption)) {
            throw new Error(`Invalid language option value \`${frontmatterOption}\` for frontmatter. Expected one of \`false\`, \`"yaml"\`, \`"toml"\`, or \`"json"\`.`);
        }
        // `math` option validation
        const mathOption = languageOptions?.math;
        if (mathOption !== undefined && typeof mathOption !== "boolean") {
            throw new Error(`Invalid language option value \`${mathOption}\` for math. Expected a boolean.`);
        }
    }
    /**
     * Parses the given file into an AST.
     * @param {File} file The virtual file to parse.
     * @param {MarkdownLanguageContext} context The options to use for parsing.
     * @returns {ParseResult<Root>} The result of parsing.
     */
    parse(file, context) {
        // Note: BOM already removed
        const text = /** @type {string} */ (file.body);
        /*
         * Check for parsing errors first. If there's a parsing error, nothing
         * else can happen. However, a parsing error does not throw an error
         * from this method - it's just considered a fatal error message, a
         * problem that ESLint identified just like any other.
         */
        try {
            const options = createParserOptions(this.#mode, context?.languageOptions);
            const root = fromMarkdown(text, options);
            return {
                ok: true,
                ast: root,
            };
        }
        catch (ex) {
            return {
                ok: false,
                errors: [ex],
            };
        }
    }
    /**
     * Creates a new `MarkdownSourceCode` object from the given information.
     * @param {File} file The virtual file to create a `MarkdownSourceCode` object from.
     * @param {OkParseResult<Root>} parseResult The result returned from `parse()`.
     * @returns {MarkdownSourceCode} The new `MarkdownSourceCode` object.
     */
    createSourceCode(file, parseResult) {
        return new MarkdownSourceCode({
            text: /** @type {string} */ (file.body),
            ast: parseResult.ast,
        });
    }
}
.+xx;(JSON!2cNgparse } from "@humanwhocodes/momoa";
import { JSONSourceCode } from "./json-source-code.js";
import { visitorKeys } from "@humanwhocodes/momoa";aRZiDocumentNode, AnyNode } from "@humanwhocodes/momoa";
 * @import { Language, OkParseResult, ParseResult, File } from "@eslint/co	typedef {OkParseResult<DocumentNode>} JSONOkParseResult
 * @typedef {ParseResult<DocumentNode>} JSONParseResult
 * @typedef {Object} JSONLanguageOptions
 * @property {boolean} [allowTrailingCommas] Whether to allow trailing commas in JSONC mode.
 */
//--fM+aJSON)<{ LangOptions: JSONLanguageOptions; Code: JSONSourceCode; RootNode: DocumentNode; Node: AnyNode }>}
 */
export class JSONLanguP2"json"|"jsonc"|"json5"}
     */
    #mode = "json"visitor keys.
     * @type {Record<string, string[]>}
     */
    visitorKeys = Object.fromEntries([...visitorKeys]);
    /**
 ^("json"|"jsonc"|"json5"} options.mode The5) {
        this.#mode = mode;EJSON!uif (languageOptions.allowTrailingCommas !== undefined) {
            if (typeof languageOptions.allowTrailingCommas !== "boolea@"allowTrailingCommas must be a boolean if provided.");
            }
            // we know that allowTrailingCommas is a booleYan here
            // only allowed in JSONC mode
            if (this.#mode !== "jsonc")1H"allowTrailingCommas option is only available in JSONC.");
            } kg&{languageOptions: JSONLanguageOptions};JSONParseResult5Iconst allowTrailingCommas = context?.languageOptions?.allowTrailingCommas`root = parse(text,1(mode: this.#mode,
                rangestokens#llowTrailingCommas,
            });*[// error messages end with (line:column) so we strip that off for ESLint
            const message = ex.message
               @ .slice(0, ex.message.lastIndexOf("("))
                .trim();J
                   1X        ...ex,
                        message,
                    },
                ]& eslint-disable class-methods-use-thisu'JSON!PJSON!(JSONOkParseResult\CJSONSourceCode} The new `JSONYJSON%xZ#x8100644 no-duplicate-keys.d.ts S,fϻ(|sö100644 no-duplicate-keys.js A%?J	6JardY100644 no-empty-keys.d.ts q^ vi,100644 no-empty-keys.js AiÁ#o۩ 100644 no-unnormalized-keys.d.ts 	3l7g!)r7+g100644 no-unnormalized-keys.js =/:a\[Gx-100644 no-unsafe-values.d.ts FD; bF&$lp100644 no-unsafe-values.js e85vDXMB100644 sort-keys.d.ts L obԻp9100644 sort-keys.js  qo\S100644 top-level-interop.d.ts ټ|rd<KD100644 top-level-interop.js )1FMC&l>8C&xjexport default rule;
export type NoDuplicateKeysMessageIds = "duplicateKey";
export type NoDuplicateKeysRuleDefinition = JSONRuleDefinition<{
    MessageIds: NoDuplicateKeysMessageIds;
}>;
/**
 * @import { MemberNode } from "@humanwhocodes/momoa";
 * @import { JSONRuleDefinition } from "../types.js";
 * @typedef {"duplicateKey"} NoDuplicateKeysMessageIds
 * @typedef {JSONRuleDefinition<{ MessageIds: NoDuplicateKeysMessageIds }>} NoDuplicateKeysRuleDefinition
 */
/** @type {NoDuplicateKeysRuleDefinition} */
declare const rule: NoDuplicateKeysRuleDefinition;
import type { JSONRuleDefinition } from "../types.js";
>fx	Z/**
 * @fileoverview Rule to prevent duplicate keys in JSON.
 * @author Nicholas C. Zakas
 */
//-----------------------------------------------------------------------------
// Imports
//-----------------------------------------------------------------------------
import { getKey, getRawKey } from "../util.js";
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { MemberNode } from "@humanwhocodes/momoa";
 * @import { JSONRuleDefinition } from "../types.js";
 * @typedef {"duplicateKey"} NoDuplicateKeysMessageIds
 * @typedef {JSONRuleDefinition<{ MessageIds: NoDuplicateKeysMessageIds }>} NoDuplicateKeysRuleDefinition
 */
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
/** @type {NoDuplicateKeysRuleDefinition} */
const rule = {
    meta: {
        type: "problem",
        languages: ["json/json", "json/jsonc", "json/json5"],
        docs: {
            recommended: true,
            description: "Disallow duplicate keys in JSON objects",
            dialects: ["JSON", "JSONC", "JSON5"],
            url: "https://github.com/eslint/json/tree/main/docs/rules/no-duplicate-keys.md",
        },
        messages: {
            duplicateKey: 'Duplicate key "{{key}}" found.',
        },
    },
    create(context) {
        /** @type {Array<Map<string, MemberNode>|undefined>} */
        const objectKeys = [];
        /** @type {Map<string, MemberNode>|undefined} */
        let keys;
        return {
            Object() {
                objectKeys.push(keys);
                keys = new Map();
            },
            Member(node) {
                const key = getKey(node);
                const rawKey = getRawKey(node, context.sourceCode);
                if (keys.has(key)) {
                    context.report({
                        loc: node.name.loc,
                        messageId: "duplicateKey",
                        data: {
                            key: rawKey,
                        },
                    });
                }
                else {
                    keys.set(key, node);
                }
            },
            "Object:exit"() {
                keys = objectKeys.pop();
            },
        };
    },
};
export default rule;
y+ xexport default rule;
export type NoEmptyKeysMessageIds = "emptyKey";
export type NoEmptyKeysRuleDefinition = JSONRuleDefinition<{
    MessageIds: NoEmptyKeysMessageIds;
}>;
/**
 * @import { JSONRuleDefinition } from "../types.js";
 * @typedef {"emptyKey"} NoEmptyKeysMessageIds
 * @typedef {JSONRuleDefinition<{ MessageIds: NoEmptyKeysMessageIds }>} NoEmptyKeysRuleDefinition
 */
/** @type {NoEmptyKeysRuleDefinition} */
declare const rule: NoEmptyKeysRuleDefinition;
import type { JSONRuleDefinition } from "../types.js";
blx7/**
 * @fileoverview Rule to prevent empty keys in JSON.
 * @author Nicholas C. Zakas
 */
//-----------------------------------------------------------------------------
// Imports
//-----------------------------------------------------------------------------
import { getKey } from "../util.js";
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { JSONRuleDefinition } from "../types.js";
 * @typedef {"emptyKey"} NoEmptyKeysMessageIds
 * @typedef {JSONRuleDefinition<{ MessageIds: NoEmptyKeysMessageIds }>} NoEmptyKeysRuleDefinition
 */
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
/** @type {NoEmptyKeysRuleDefinition} */
const rule = {
    meta: {
        type: "problem",
        languages: ["json/json", "json/jsonc", "json/json5"],
        docs: {
            recommended: true,
            description: "Disallow empty keys in JSON objects",
            dialects: ["JSON", "JSONC", "JSON5"],
            url: "https://github.com/eslint/json/tree/main/docs/rules/no-empty-keys.md",
        },
        messages: {
            emptyKey: "Empty key found.",
        },
    },
    create(context) {
        return {
            Member(node) {
                const key = getKey(node);
                if (key.trim() === "") {
                    context.report({
                        loc: node.name.loc,
                        messageId: "emptyKey",
                    });
                }
            },
        };
    },
};
export default rule;
	Ӹ52x!export default rule;
export type NoUnnormalizedKeysMessageIds = "unnormalizedKey";
export type NoUnnormalizedKeysOptions = {
    form: string;
};
export type NoUnnormalizedKeysRuleDefinition = JSONRuleDefinition<{
    RuleOptions: [NoUnnormalizedKeysOptions];
    MessageIds: NoUnnormalizedKeysMessageIds;
}>;
/**
 * @import { JSONRuleDefinition } from "../types.js";
 * @typedef {"unnormalizedKey"} NoUnnormalizedKeysMessageIds
 * @typedef {{ form: string }} NoUnnormalizedKeysOptions
 * @typedef {JSONRuleDefinition<{ RuleOptions: [NoUnnormalizedKeysOptions], MessageIds: NoUnnormalizedKeysMessageIds }>} NoUnnormalizedKeysRuleDefinition
 */
/** @type {NoUnnormalizedKeysRuleDefinition} */
declare const rule: NoUnnormalizedKeysRuleDefinition;
import type { JSONRuleDefinition } from "../types.js";
`!~NNxdetect unnormalized.Bradley Meck FariasXM57unnormalizedKey"} NoUnnormalizedKeysMessageIds
 * @typedef {{ form: string }} NoUnnormalizedKeysOptions
 * @typedef {JSONRuleDeeRuleOptions: [NoUnnormalizedKeysOptions], MessageIds: NoUnnormalizedKeysMessageIds }>} NoUnnormalizedUnnormalizedfixable: "code"ST!JSON keys that are not normalized~unnormalizedL6unnormalizedKey: "Unnormalized key '{{key}}' found.",
        },
        schema: [
            {
                type: "object",
                properties:form:$enum: ["NFC", "NFD", "NFKC", "NFKD"]additionalProperties: false,
            },
        ],
        defaultOptions: [
            {
                form: "NFC",
            },
        ]'!const [{ form }] = context.option /"normalizedKey = key.normalize(form	if (normalizedKey !== keyst { name } = node;D-unnormalized0~	fix(fixer !== rawKeyF// Do not perform auto-fix when the raw key contains escape sequences.return null;4return fixer.replaceTextRange(name.type === "String"(? [name.range[0] + 1, name.range[1] - 1]: name.range, normalizedKey	:x	-:xoexport default rule;
export type NoUnsafeValuesMessageIds = "unsafeNumber" | "unsafeInteger" | "unsafeZero" | "subnormal" | "loneSurrogate";
export type NoUnsafeValuesRuleDefinition = JSONRuleDefinition<{
    MessageIds: NoUnsafeValuesMessageIds;
}>;
/** @type {NoUnsafeValuesRuleDefinition} */
declare const rule: NoUnsafeValuesRuleDefinition;
import type { JSONRuleDefinition } from "../types.js";
xY/**
 * @fileoverview Rule to detect unsafe values in JSON.
 * @author Bradley Meck Farias
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { JSONRuleDefinition } from "../types.js";
 * @typedef {"unsafeNumber"|"unsafeInteger"|"unsafeZero"|"subnormal"|"loneSurrogate"} NoUnsafeValuesMessageIds
 * @typedef {JSONRuleDefinition<{ MessageIds: NoUnsafeValuesMessageIds }>} NoUnsafeValuesRuleDefinition
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
/*
 * This rule is based on the JSON grammar from RFC 8259, section 6.
 * https://tools.ietf.org/html/rfc8259#section-6
 *
 * Also, this rule is based on the JSON5 grammar from json5.org, section 6.
 * https://spec.json5.org/#numbers
 *
 * We separately capture the integer and fractional parts of a number, so that
 * we can check for unsafe numbers that will evaluate to Infinity.
 */
const NUMBER = /^[+-]?(?<int>0|([1-9]\d*))?(?:\.(?<frac>\d*))?(?:e[+-]?\d+)?$/iu;
const NON_ZERO = /[1-9]/u;
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
/** @type {NoUnsafeValuesRuleDefinition} */
const rule = {
    meta: {
        type: "problem",
        languages: ["json/json", "json/jsonc", "json/json5"],
        docs: {
            recommended: true,
            description: "Disallow JSON values that are unsafe for interchange",
            dialects: ["JSON", "JSONC", "JSON5"],
            url: "https://github.com/eslint/json/tree/main/docs/rules/no-unsafe-values.md",
        },
        messages: {
            unsafeNumber: "The number '{{ value }}' will evaluate to Infinity.",
            unsafeInteger: "The integer '{{ value }}' is outside the safe integer range.",
            unsafeZero: "The number '{{ value }}' will evaluate to zero.",
            subnormal: "Unexpected subnormal number '{{ value }}' found, which may cause interoperability issues.",
            loneSurrogate: "Lone surrogate '{{ surrogate }}' found.",
        },
    },
    create(context) {
        return {
            Number(node) {
                const value = context.sourceCode.getText(node);
                if (Number.isFinite(node.value) !== true) {
                    context.report({
                        loc: node.loc,
                        messageId: "unsafeNumber",
                        data: { value },
                    });
                }
                else {
                    // Also matches -0, intentionally
                    if (node.value === 0) {
                        // If the value has been rounded down to 0, but there was some
                        // fraction or non-zero part before the e-, this is a very small
                        // number that doesn't fit inside an f64.
                        const match = value.match(NUMBER);
                        if (match === null) {
                            return;
                        }
                        // If any part of the number other than the exponent has a
                        // non-zero digit in it, this number was not intended to be
                        // evaluated down to a zero.
                        if (NON_ZERO.test(match.groups.int) ||
                            NON_ZERO.test(match.groups.frac)) {
                            context.report({
                                loc: node.loc,
                                messageId: "unsafeZero",
                                data: { value },
                            });
                        }
                    }
                    else if (!/[.e]/iu.test(value)) {
                        // Intended to be an integer
                        if (node.value > Number.MAX_SAFE_INTEGER ||
                            node.value < Number.MIN_SAFE_INTEGER) {
                            context.report({
                                loc: node.loc,
                                messageId: "unsafeInteger",
                                data: { value },
                            });
                        }
                    }
                    else {
                        // Floating point. Check for subnormal.
                        const buffer = new ArrayBuffer(8);
                        const view = new DataView(buffer);
                        view.setFloat64(0, node.value, false);
                        const asBigInt = view.getBigUint64(0, false);
                        // Subnormals have an 11-bit exponent of 0 and a non-zero mantissa.
                        if ((asBigInt & 0x7ff0000000000000n) === 0n) {
                            context.report({
                                loc: node.loc,
                                messageId: "subnormal",
                                // Value included so that it's seen in scientific notation
                                data: {
                                    value,
                                },
                            });
                        }
                    }
                }
            },
            String(node) {
                if (node.value.isWellFormed) {
                    if (node.value.isWellFormed()) {
                        return;
                    }
                }
                // match any high surrogate and, if it exists, a paired low surrogate
                // match any low surrogate not already matched
                const surrogatePattern = /[\uD800-\uDBFF][\uDC00-\uDFFF]?|[\uDC00-\uDFFF]/gu;
                /** @type {RegExpExecArray | null} */
                let match;
                while ((match = surrogatePattern.exec(node.value)) !== null) {
                    // only need to report non-paired surrogates
                    if (match[0].length < 2) {
                        context.report({
                            loc: node.loc,
                            messageId: "loneSurrogate",
                            data: {
                                surrogate: JSON.stringify(match[0]).slice(1, -1),
                            },
                        });
                    }
                }
            },
        };
    },
};
export default rule;
eƱOxexport default rule;
export type SortOptions = {
    /**
     * Whether key comparisons are case-sensitive.
     */
    caseSensitive: boolean;
    /**
     * Whether to use natural sort order instead of purely alphanumeric.
     */
    natural: boolean;
    /**
     * Minimum number of keys in an object before enforcing sorting.
     */
    minKeys: number;
    /**
     * Whether a blank line between properties starts a new group that is independently sorted.
     */
    allowLineSeparatedGroups: boolean;
};
export type SortKeysMessageIds = "sortKeys";
export type SortDirection = "asc" | "desc";
export type SortKeysRuleOptions = [SortDirection, SortOptions];
export type SortKeysRuleDefinition = JSONRuleDefinition<{
    RuleOptions: SortKeysRuleOptions;
    MessageIds: SortKeysMessageIds;
}>;
export type Comparator = (a: string, b: string) => boolean;
export type DirectionName = "ascending" | "descending";
export type SortName = "alphanumeric" | "natural";
export type Sensitivity = "sensitive" | "insensitive";
export type ComparatorMap = Record<DirectionName, Record<SortName, Record<Sensitivity, Comparator>>>;
/** @type {SortKeysRuleDefinition} */
declare const rule: SortKeysRuleDefinition;
import type { JSONRuleDefinition } from "../types.js";
a]Xx&/**
 * @fileoverview Rule to require JSON object keys to be sorted.
 * Copied largely from https://github.com/eslint/eslint/blob/main/lib/rules/sort-keys.js
 * @author Robin Thomas
 */
//-----------------------------------------------------------------------------
// Imports
//-----------------------------------------------------------------------------
import naturalCompare from "natural-compare";
import { getKey, getRawKey } from "../util.js";
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { JSONRuleDefinition } from "../types.js";
 * @import { MemberNode } from "@humanwhocodes/momoa";
 * @typedef {Object} SortOptions
 * @property {boolean} caseSensitive Whether key comparisons are case-sensitive.
 * @property {boolean} natural Whether to use natural sort order instead of purely alphanumeric.
 * @property {number} minKeys Minimum number of keys in an object before enforcing sorting.
 * @property {boolean} allowLineSeparatedGroups Whether a blank line between properties starts a new group that is independently sorted.
 * @typedef {"sortKeys"} SortKeysMessageIds
 * @typedef {"asc"|"desc"} SortDirection
 * @typedef {[SortDirection, SortOptions]} SortKeysRuleOptions
 * @typedef {JSONRuleDefinition<{ RuleOptions: SortKeysRuleOptions, MessageIds: SortKeysMessageIds }>} SortKeysRuleDefinition
 * @typedef {(a:string,b:string) => boolean} Comparator
 * @typedef {"ascending"|"descending"} DirectionName
 * @typedef {"alphanumeric"|"natural"} SortName
 * @typedef {"sensitive"|"insensitive"} Sensitivity
 * @typedef {Record<DirectionName, Record<SortName, Record<Sensitivity, Comparator>>>} ComparatorMap
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
const hasNonWhitespace = /\S/u;
const commentTypes = new Set(["LineComment", "BlockComment"]);
/** @type {ComparatorMap} */
const comparators = {
    ascending: {
        alphanumeric: {
            sensitive: (a, b) => a <= b,
            insensitive: (a, b) => a.toLowerCase() <= b.toLowerCase(),
        },
        natural: {
            sensitive: (a, b) => naturalCompare(a, b) <= 0,
            insensitive: (a, b) => naturalCompare(a.toLowerCase(), b.toLowerCase()) <= 0,
        },
    },
    descending: {
        alphanumeric: {
            sensitive: (a, b) => comparators.ascending.alphanumeric.sensitive(b, a),
            insensitive: (a, b) => comparators.ascending.alphanumeric.insensitive(b, a),
        },
        natural: {
            sensitive: (a, b) => comparators.ascending.natural.sensitive(b, a),
            insensitive: (a, b) => comparators.ascending.natural.insensitive(b, a),
        },
    },
};
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
/** @type {SortKeysRuleDefinition} */
const rule = {
    meta: {
        type: "suggestion",
        languages: ["json/json", "json/jsonc", "json/json5"],
        fixable: "code",
        defaultOptions: [
            "asc",
            {
                allowLineSeparatedGroups: false,
                caseSensitive: true,
                minKeys: 2,
                natural: false,
            },
        ],
        docs: {
            recommended: false,
            description: `Require JSON object keys to be sorted`,
            dialects: ["JSON", "JSONC", "JSON5"],
            url: "https://github.com/eslint/json/tree/main/docs/rules/sort-keys.md",
        },
        messages: {
            sortKeys: "Expected object keys to be in {{sortName}} case-{{sensitivity}} {{direction}} order. '{{thisName}}' should be before '{{prevName}}'.",
        },
        schema: [
            {
                enum: ["asc", "desc"],
            },
            {
                type: "object",
                properties: {
                    caseSensitive: {
                        type: "boolean",
                    },
                    natural: {
                        type: "boolean",
                    },
                    minKeys: {
                        type: "integer",
                        minimum: 2,
                    },
                    allowLineSeparatedGroups: {
                        type: "boolean",
                    },
                },
                additionalProperties: false,
            },
        ],
    },
    create(context) {
        const { sourceCode } = context;
        const [directionShort, { allowLineSeparatedGroups, caseSensitive, natural, minKeys },] = context.options;
        /** @type {DirectionName} */
        const direction = directionShort === "asc" ? "ascending" : "descending";
        /** @type {SortName} */
        const sortName = natural ? "natural" : "alphanumeric";
        /** @type {Sensitivity} */
        const sensitivity = caseSensitive ? "sensitive" : "insensitive";
        /** @type {Comparator} */
        const isValidOrder = comparators[direction][sortName][sensitivity];
        // Note that @humanwhocodes/momoa doesn't include comments in the object.members tree, so we can't just see if a member is preceded by a comment
        const commentLineNums = new Set();
        for (const comment of sourceCode.comments) {
            for (let lineNum = comment.loc.start.line; lineNum <= comment.loc.end.line; lineNum += 1) {
                commentLineNums.add(lineNum);
            }
        }
        /**
         * Checks if two members are line-separated.
         * @param {MemberNode} prevMember The previous member.
         * @param {MemberNode} member The current member.
         * @returns {boolean} True if the members are separated by at least one blank line (ignoring comment-only lines).
         */
        function isLineSeparated(prevMember, member) {
            // Note that there can be comments *inside* members, e.g. `{"foo: /* comment *\/ "bar"}`, but these are ignored when calculating line-separated groups
            const prevMemberEndLine = prevMember.loc.end.line;
            const thisStartLine = member.loc.start.line;
            if (thisStartLine - prevMemberEndLine < 2) {
                return false;
            }
            for (let lineNum = prevMemberEndLine + 1; lineNum < thisStartLine; lineNum += 1) {
                if (!commentLineNums.has(lineNum) &&
                    !hasNonWhitespace.test(sourceCode.lines[lineNum - 1])) {
                    return true;
                }
            }
            return false;
        }
        /**
         * Checks if a member has a comment before or after it.
         * @param {MemberNode} member The member to check.
         * @returns {boolean} True if a comment is adjacent to the member.
         */
        function hasAdjacentComment(member) {
            const before = sourceCode.getTokenBefore(member, {
                includeComments: true,
            });
            let after = sourceCode.getTokenAfter(member, {
                includeComments: true,
            });
            if (after.type === "Comma") {
                after = sourceCode.getTokenAfter(after, {
                    includeComments: true,
                });
            }
            return (commentTypes.has(before.type) || commentTypes.has(after.type));
        }
        return {
            Object(node) {
                /** @type {MemberNode} */
                let prevMember;
                /** @type {string} */
                let prevName;
                /** @type {string} */
                let prevRawName;
                if (node.members.length < minKeys) {
                    return;
                }
                for (const member of node.members) {
                    const thisName = getKey(member);
                    const thisRawName = getRawKey(member, sourceCode);
                    // Capture `prevMember` for this iteration so the fixer closure uses the
                    // intended node even though `prevMember` is reassigned in the loop.
                    const prevMemberNode = prevMember;
                    if (prevMember &&
                        !isValidOrder(prevName, thisName) &&
                        (!allowLineSeparatedGroups ||
                            !isLineSeparated(prevMember, member))) {
                        context.report({
                            loc: member.name.loc,
                            messageId: "sortKeys",
                            data: {
                                thisName: thisRawName,
                                prevName: prevRawName,
                                direction,
                                sensitivity,
                                sortName,
                            },
                            fix(fixer) {
                                if (hasAdjacentComment(member) ||
                                    hasAdjacentComment(prevMemberNode)) {
                                    return null;
                                }
                                return [
                                    fixer.replaceText(member, sourceCode.getText(prevMemberNode)),
                                    fixer.replaceText(prevMemberNode, sourceCode.getText(member)),
                                ];
                            },
                        });
                    }
                    prevMember = member;
                    prevName = thisName;
                    prevRawName = thisRawName;
                }
            },
        };
    },
};
export default rule;
ߊ)xcexport default rule;
export type TopLevelInteropMessageIds = "topLevel";
export type TopLevelInteropRuleDefinition = JSONRuleDefinition<{
    MessageIds: TopLevelInteropMessageIds;
}>;
/**
 * @fileoverview Rule to ensure top-level items are either an array or object.
 * @author Joe Hildebrand
 */
/**
 * @import { JSONRuleDefinition } from "../types.js";
 * @typedef {"topLevel"} TopLevelInteropMessageIds
 * @typedef {JSONRuleDefinition<{ MessageIds: TopLevelInteropMessageIds }>} TopLevelInteropRuleDefinition
 */
/** @type {TopLevelInteropRuleDefinition} */
declare const rule: TopLevelInteropRuleDefinition;
import type { JSONRuleDefinition } from "../types.js";
_ixa/**
 * @fileoverview Rule to ensure top-level items are either an array or object.
 * @author Joe Hildebrand
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { JSONRuleDefinition } from "../types.js";
 * @typedef {"topLevel"} TopLevelInteropMessageIds
 * @typedef {JSONRuleDefinition<{ MessageIds: TopLevelInteropMessageIds }>} TopLevelInteropRuleDefinition
 */
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
/** @type {TopLevelInteropRuleDefinition} */
const rule = {
    meta: {
        type: "problem",
        languages: ["json/json", "json/jsonc", "json/json5"],
        docs: {
            recommended: false,
            description: "Require the JSON top-level value to be an array or object",
            dialects: ["JSON", "JSONC", "JSON5"],
            url: "https://github.com/eslint/json/tree/main/docs/rules/top-level-interop.md",
        },
        messages: {
            topLevel: "Top level item should be array or object, got '{{type}}'.",
        },
    },
    create(context) {
        return {
            Document(node) {
                const { type } = node.body;
                if (type !== "Object" && type !== "Array") {
                    context.report({
                        loc: node.loc,
                        messageId: "topLevel",
                        data: { type },
                    });
                }
            },
        };
    },
};
export default rule;
7yxo/**
 * @fileoverview Additional types for this package.
 * @author Nicholas C. Zakas
 */
import type { RuleVisitor } from "@eslint/core";
import type { CustomRuleDefinitionType, CustomRuleTypeDefinitions, CustomRuleVisitorWithExit } from "@eslint/plugin-kit";
import type { DocumentNode, MemberNode, ElementNode, ObjectNode, ArrayNode, StringNode, NullNode, NumberNode, BooleanNode, NaNNode, InfinityNode, IdentifierNode, AnyNode, Token } from "@humanwhocodes/momoa";
import type { JSONLanguageOptions, JSONSourceCode } from "./index.js";
type ValueNodeParent = DocumentNode | MemberNode | ElementNode;
/**
 * A JSON syntax element, including nodes and tokens.
 */
export type JSONSyntaxElement = Token | AnyNode;
/**
 * The visitor format returned from rules in this package.
 */
export interface JSONRuleVisitor extends RuleVisitor, CustomRuleVisitorWithExit<{
    Document?(node: DocumentNode): void;
    Member?(node: MemberNode, parent?: ObjectNode): void;
    Element?(node: ElementNode, parent?: ArrayNode): void;
    Object?(node: ObjectNode, parent?: ValueNodeParent): void;
    Array?(node: ArrayNode, parent?: ValueNodeParent): void;
    String?(node: StringNode, parent?: ValueNodeParent): void;
    Null?(node: NullNode, parent?: ValueNodeParent): void;
    Number?(node: NumberNode, parent?: ValueNodeParent): void;
    Boolean?(node: BooleanNode, parent?: ValueNodeParent): void;
    NaN?(node: NaNNode, parent?: ValueNodeParent): void;
    Infinity?(node: InfinityNode, parent?: ValueNodeParent): void;
    Identifier?(node: IdentifierNode, parent?: ValueNodeParent): void;
}> {
}
export type JSONRuleDefinitionTypeOptions = CustomRuleTypeDefinitions;
export type JSONRuleDefinition<Options extends Partial<JSONRuleDefinitionTypeOptions> = {}> = CustomRuleDefinitionType<{
    LangOptions: JSONLanguageOptions;
    Code: JSONSourceCode;
    Visitor: JSONRuleVisitor;
    Node: JSONSyntaxElement;
}, Options>;
export {};
ܛp3x:/**
 * @fileoverview Utility Library
 * @author 루밀LuMir(lumirlumir)
 */
/**
 * @import { MemberNode } from "@humanwhocodes/momoa";
 * @import { JSONSourceCode } from "./languages/json-source-code.js";
 */
/**
 * Gets the `MemberNode`'s key value.
 * @param {MemberNode} node The node to get the key from.
 * @returns {string} The key value.
 */
export function getKey(node: MemberNode): string;
/**
 * Gets the `MemberNode`'s raw key value.
 * @param {MemberNode} node The node to get the raw key from.
 * @param {JSONSourceCode} sourceCode The JSON source code object.
 * @returns {string} The raw key value.
 */
export function getRawKey(node: MemberNode, sourceCode: JSONSourceCode): string;
import type { MemberNode } from "@humanwhocodes/momoa";
import type { JSONSourceCode } from "./languages/json-source-code.js";
qKxL/**
 * @fileoverview Utility Library
 * @author 루밀LuMir(lumirlumir)
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { MemberNode } from "@humanwhocodes/momoa";
 * @import { JSONSourceCode } from "./languages/json-source-code.js";
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
/**
 * Gets the `MemberNode`'s key value.
 * @param {MemberNode} node The node to get the key from.
 * @returns {string} The key value.
 */
export function getKey(node) {
    return node.name.type === "String" ? node.name.value : node.name.name;
}
/**
 * Gets the `MemberNode`'s raw key value.
 * @param {MemberNode} node The node to get the raw key from.
 * @param {JSONSourceCode} sourceCode The JSON source code object.
 * @returns {string} The raw key value.
 */
export function getRawKey(node, sourceCode) {
    return node.name.type === "String"
        ? sourceCode.getText(node.name, -1, -1)
        : sourceCode.getText(node.name);
}
sx\?xu{
  "name": "@eslint/json",
  "version": "2.0.1",
  "description": "JSON linting plugin for ESLint",
  "author": "Nicholas C. Zakas",
  "type": "module",
  "main": "dist/index.js",
  "types": "dist/index.d.ts",
  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "default": "./dist/index.js"
    }
  },
  "files": [
    "dist"
  ],
  "publishConfig": {
    "access": "public"
  },
  "gitHooks": {
    "pre-commit": "lint-staged"
  },
  "lint-staged": {
    "*.js": [
      "eslint --fix",
      "prettier --write"
    ],
    "!(*.js)": "prettier --write --ignore-unknown",
    "{src/rules/*.js,tools/update-rules-docs.js,README.md}": [
      "npm run build:update-rules-docs",
      "git add README.md"
    ]
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/eslint/json.git"
  },
  "bugs": {
    "url": "https://github.com/eslint/json/issues"
  },
  "homepage": "https://github.com/eslint/json#readme",
  "scripts": {
    "build": "npm run build:rules && npm run build:types && npm run build:update-rules-docs",
    "build:rules": "node tools/build-rules.js",
    "build:types": "tsc",
    "build:update-rules-docs": "node tools/update-rules-docs.js",
    "prepare": "npm run build",
    "pretest": "npm run build",
    "lint": "eslint",
    "lint:fix": "eslint --fix",
    "lint:types": "attw --pack --profile esm-only",
    "lint:unused": "knip",
    "fmt": "prettier --write .",
    "fmt:check": "prettier --check .",
    "test": "mocha \"tests/**/*.test.js\"",
    "test:coverage": "c8 npm test",
    "test:jsr": "npx -y jsr@latest publish --dry-run",
    "test:types": "tsc -p tests/types/tsconfig.json",
    "test:types:5.3": "npx -p typescript@5.3 -y -- tsc -p tests/types/tsconfig.legacy.json",
    "test:types:5.x": "npx -p typescript@5.x -y -- tsc -p tests/types/tsconfig.json",
    "test:types:7.x": "npx -p @typescript/native-preview@latest -y -- tsgo -p tests/types/tsconfig.json",
    "test:types:all": "npm run test:types && npm run test:types:5.3 && npm run test:types:5.x && npm run test:types:7.x"
  },
  "keywords": [
    "eslint",
    "eslint-plugin",
    "eslintplugin",
    "json",
    "linting"
  ],
  "license": "Apache-2.0",
  "dependencies": {
    "@eslint/core": "^1.2.1",
    "@eslint/plugin-kit": "^0.7.2",
    "@humanwhocodes/momoa": "^3.3.10",
    "natural-compare": "^1.4.0"
  },
  "devDependencies": {
    "@arethetypeswrong/cli": "^0.18.3",
    "@types/natural-compare": "^1.4.3",
    "@types/node": "^20.19.0",
    "c8": "^11.0.0",
    "dedent": "^1.5.3",
    "eslint": "^10.4.0",
    "eslint-config-eslint": "^14.0.0",
    "eslint-plugin-eslint-plugin": "^7.3.2",
    "globals": "^17.0.0",
    "knip": "^6.0.0",
    "lint-staged": "^16.0.0",
    "mdast-util-from-markdown": "^2.0.2",
    "mocha": "^11.3.0",
    "prettier": "3.8.4",
    "typescript": "^6.0.2",
    "yorkie": "^2.0.0"
  },
  "engines": {
    "node": "^20.19.0 || ^22.13.0 || >=24"
  }
}
_Xx p100644 LICENSE =zRsRB0GE_Q100644 README.md ) -G<PnWY7Z40000 dist }&Ӡ37(Vּ^100644 package.json wЦiyyT36Yxc !=OpenJS Foundation and other contributors, https://openjsf.org@
all C
THE SOFTWARE.
"hx+@Կ# ESLint Markdown Language Plugin

[![npm Version](https://img.shields.io/npm/v/@eslint/markdown.svg)](https://www.npmjs.com/package/@eslint/markdown)
[![Downloads](https://img.shields.io/npm/dm/@eslint/markdown.svg)](https://www.npmjs.com/package/@eslint/markdown)
[![Build Status](https://github.com/eslint/markdown/workflows/CI/badge.svg)](https://github.com/eslint/markdown/actions)

Lint Markdown with ESLint, as well JS, JSX, TypeScript, and more inside Markdown.

<img
    src="screenshot.png"
    height="142"
    width="432"
    alt="A JS code snippet in a Markdown editor has red squiggly underlines. A tooltip explains the problem."
/>

## Usage

### Installing

Install the plugin alongside ESLint v9.15.0 or greater. Type compatibility is guaranteed with ESLint v9.39.0 or greater.

For Node.js and compatible runtimes:

```sh
npm install @eslint/markdown -D
# or
yarn add @eslint/markdown -D
# or
pnpm install @eslint/markdown -D
# or
bun add @eslint/markdown -D
```

For Deno:

```sh
deno add jsr:@eslint/markdown
```

### Configurations

| **Configuration Name** | **Description**                                                                                            |
| ---------------------- | ---------------------------------------------------------------------------------------------------------- |
| `recommended`          | Lints all `.md` files with the recommended rules and assumes [CommonMark](https://commonmark.org/) format. |
| `processor`            | Enables extracting code blocks from all `.md` files so code blocks can be individually linted.             |

In your `eslint.config.js` file, import `@eslint/markdown` and include the recommended config to enable Markdown parsing and linting:

```js
// eslint.config.js
import { defineConfig } from "eslint/config";
import markdown from "@eslint/markdown";

export default defineConfig([
	{
		files: ["**/*.md"],
		plugins: {
			markdown,
		},
		extends: ["markdown/recommended"],
	},
	// your other configs here
]);
```

You can also modify the recommended config by using `extends`:

```js
// eslint.config.js
import { defineConfig } from "eslint/config";
import markdown from "@eslint/markdown";

export default defineConfig([
	{
		plugins: {
			markdown,
		},
		extends: ["markdown/recommended"],
		rules: {
			"markdown/no-html": "error",
		},
	},

	// your other configs here
]);
```

### Rules

<!-- NOTE: The following table is autogenerated. Do not manually edit. -->

<!-- Rule Table Start -->

| **Rule Name**                                                                  | **Description**                                                                                   | **Recommended** |
| :----------------------------------------------------------------------------- | :------------------------------------------------------------------------------------------------ | :-------------: |
| [`fenced-code-language`](./docs/rules/fenced-code-language.md)                 | Require languages for fenced code blocks                                                          |       yes       |
| [`fenced-code-meta`](./docs/rules/fenced-code-meta.md)                         | Require or disallow metadata for fenced code blocks                                               |       no        |
| [`heading-increment`](./docs/rules/heading-increment.md)                       | Enforce heading levels increment by one                                                           |       yes       |
| [`no-bare-urls`](./docs/rules/no-bare-urls.md)                                 | Disallow bare URLs                                                                                |       no        |
| [`no-duplicate-definitions`](./docs/rules/no-duplicate-definitions.md)         | Disallow duplicate definitions                                                                    |       yes       |
| [`no-duplicate-headings`](./docs/rules/no-duplicate-headings.md)               | Disallow duplicate headings in the same document                                                  |       no        |
| [`no-empty-definitions`](./docs/rules/no-empty-definitions.md)                 | Disallow empty definitions                                                                        |       yes       |
| [`no-empty-images`](./docs/rules/no-empty-images.md)                           | Disallow empty images                                                                             |       yes       |
| [`no-empty-links`](./docs/rules/no-empty-links.md)                             | Disallow empty links                                                                              |       yes       |
| [`no-html`](./docs/rules/no-html.md)                                           | Disallow HTML tags                                                                                |       no        |
| [`no-invalid-label-refs`](./docs/rules/no-invalid-label-refs.md)               | Disallow invalid label references                                                                 |       yes       |
| [`no-missing-atx-heading-space`](./docs/rules/no-missing-atx-heading-space.md) | Disallow headings without a space after the hash characters                                       |       yes       |
| [`no-missing-label-refs`](./docs/rules/no-missing-label-refs.md)               | Disallow missing label references                                                                 |       yes       |
| [`no-missing-link-fragments`](./docs/rules/no-missing-link-fragments.md)       | Disallow link fragments that do not reference valid headings                                      |       yes       |
| [`no-multiple-h1`](./docs/rules/no-multiple-h1.md)                             | Disallow multiple H1 headings in the same document                                                |       yes       |
| [`no-reference-like-urls`](./docs/rules/no-reference-like-urls.md)             | Disallow URLs that match defined reference identifiers                                            |       yes       |
| [`no-reversed-media-syntax`](./docs/rules/no-reversed-media-syntax.md)         | Disallow reversed link and image syntax                                                           |       yes       |
| [`no-space-in-emphasis`](./docs/rules/no-space-in-emphasis.md)                 | Disallow spaces around emphasis markers                                                           |       yes       |
| [`no-unused-definitions`](./docs/rules/no-unused-definitions.md)               | Disallow unused definitions                                                                       |       yes       |
| [`require-alt-text`](./docs/rules/require-alt-text.md)                         | Require alternative text for images                                                               |       yes       |
| [`table-column-count`](./docs/rules/table-column-count.md)                     | Disallow data rows in a GitHub Flavored Markdown table from having more cells than the header row |       yes       |

<!-- Rule Table End -->

**Note:** This plugin does not provide formatting rules. We recommend using a source code formatter such as [Prettier](https://prettier.io) for that purpose.

In order to individually configure a rule in your `eslint.config.js` file, import `@eslint/markdown` and configure each rule with a prefix:

```js
// eslint.config.js
import { defineConfig } from "eslint/config";
import markdown from "@eslint/markdown";

export default defineConfig([
	{
		files: ["**/*.md"],
		plugins: {
			markdown,
		},
		language: "markdown/commonmark",
		rules: {
			"markdown/no-html": "error",
		},
	},
]);
```

You can individually disable rules in Markdown using HTML comments, such as:

<!-- prettier-ignore-start -->
```markdown
<!-- eslint-disable-next-line markdown/no-html -- I want to allow HTML here -->
<custom-element>Hello world!</custom-element>

<!-- eslint-disable markdown/no-html -- here too -->
<another-element>Goodbye world!</another-element>
<!-- eslint-enable markdown/no-html -- safe to re-enable now -->

[Object] <!-- eslint-disable-line markdown/no-missing-label-refs -- not meant to be a link ref -->
```
<!-- prettier-ignore-end -->

### Languages

| **Language Name** | **Description**                                                               |
| ----------------- | ----------------------------------------------------------------------------- |
| `commonmark`      | Parse using [CommonMark](https://commonmark.org) Markdown format              |
| `gfm`             | Parse using [GitHub-Flavored Markdown](https://github.github.com/gfm/) format |

In order to individually configure a language in your `eslint.config.js` file, import `@eslint/markdown` and configure a `language`:

```js
// eslint.config.js
import { defineConfig } from "eslint/config";
import markdown from "@eslint/markdown";

export default defineConfig([
	{
		files: ["**/*.md"],
		plugins: {
			markdown,
		},
		language: "markdown/gfm",
		rules: {
			"markdown/no-html": "error",
		},
	},
]);
```

### Language Options

#### Enabling Front Matter in both `commonmark` and `gfm`

By default, Markdown parsers do not support [front matter](https://jekyllrb.com/docs/front-matter/). To enable front matter in both `commonmark` and `gfm`, you can use the `frontmatter` option in `languageOptions`.

> `@eslint/markdown` internally uses [`micromark-extension-frontmatter`](https://github.com/micromark/micromark-extension-frontmatter) and [`mdast-util-frontmatter`](https://github.com/syntax-tree/mdast-util-frontmatter) to parse front matter.

| **Option Value** | **Description**                                            |
| ---------------- | ---------------------------------------------------------- |
| `false`          | Disables front matter parsing in Markdown files. (Default) |
| `"yaml"`         | Enables YAML front matter parsing in Markdown files.       |
| `"toml"`         | Enables TOML front matter parsing in Markdown files.       |
| `"json"`         | Enables JSON front matter parsing in Markdown files.       |

```js
// eslint.config.js
import { defineConfig } from "eslint/config";
import markdown from "@eslint/markdown";

export default defineConfig([
	{
		files: ["**/*.md"],
		plugins: {
			markdown,
		},
		language: "markdown/gfm",
		languageOptions: {
			frontmatter: "yaml", // Or pass `"toml"` or `"json"` to enable TOML or JSON front matter parsing.
		},
		rules: {
			"markdown/no-html": "error",
		},
	},
]);
```

#### Enabling Math (LaTeX) in both `commonmark` and `gfm`

By default, Markdown parsers do not support [math](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/writing-mathematical-expressions) ([LaTeX](https://www.latex-project.org/)). To enable math in both `commonmark` and `gfm`, you can use the `math` option in `languageOptions`.

> `@eslint/markdown` internally uses [`micromark-extension-math`](https://github.com/micromark/micromark-extension-math) and [`mdast-util-math`](https://github.com/syntax-tree/mdast-util-math) to parse math.

| **Option Value** | **Description**                                    |
| ---------------- | -------------------------------------------------- |
| `false`          | Disables math parsing in Markdown files. (Default) |
| `true`           | Enables math parsing in Markdown files.            |

```js
// eslint.config.js
import { defineConfig } from "eslint/config";
import markdown from "@eslint/markdown";

export default defineConfig([
	{
		files: ["**/*.md"],
		plugins: {
			markdown,
		},
		language: "markdown/gfm",
		languageOptions: {
			math: true, // Or pass `false` to disable math parsing.
		},
		rules: {
			"markdown/no-html": "error",
		},
	},
]);
```

### Processors

| **Processor Name**                          | **Description**                                                                     |
| ------------------------------------------- | ----------------------------------------------------------------------------------- |
| [`markdown`](./docs/processors/markdown.md) | Extract fenced code blocks from the Markdown code so they can be linted separately. |

## Migration from `eslint-plugin-markdown`

See [Migration](./docs/migration.md#from-eslint-plugin-markdown).

## Editor Integrations

### VSCode

[`vscode-eslint`](https://github.com/microsoft/vscode-eslint) has built-in support for the Markdown processor.

## File Name Details

This processor will use file names from blocks if a `filename` meta is present.

For example, the following block will result in a parsed file name of `src/index.js`:

````md
```js filename="src/index.js"
export const value = "Hello, world!";
```
````

This can be useful for user configurations that include linting overrides for specific file paths. In this example, you could then target the specific code block in your configuration using `"file-name.md/*src/index.js"`.

## Contributing

```sh
$ git clone https://github.com/eslint/markdown.git
$ cd markdown
$ npm install
$ npm test
```

This project follows the [ESLint contribution guidelines](https://eslint.org/docs/latest/contribute/).

<!-- NOTE: This section is autogenerated. Do not manually edit.-->
<!--sponsorsstart-->

## Sponsors

The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
to get your logo on our READMEs and [website](https://eslint.org/sponsors).

<h3>Platinum Sponsors</h3>
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a></p><h3>Gold Sponsors</h3>
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a> <a href="https://www.coderabbit.ai/?utm_source=cr_org&utm_medium=github"><img src="https://avatars.githubusercontent.com/u/132028505" alt="CodeRabbit" height="96"></a></p><h3>Silver Sponsors</h3>
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/d472863/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/2d6c3b6/logo.png" alt="Liftoff" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" height="32"></a> <a href="https://www.crawljobs.com/"><img src="https://images.opencollective.com/crawljobs-poland/fa43a17/logo.png" alt="CrawlJobs" height="32"></a> <a href="https://depot.dev"><img src="https://images.opencollective.com/depot/39125a1/logo.png" alt="Depot" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://citadel.co.jp"><img src="https://avatars.githubusercontent.com/u/75781367" alt="Citadel AI" height="32"></a></p>
<h3>Technology Sponsors</h3>
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
<!--sponsorsend-->
ɡxn40000 build /2mY,Uܵ100644 index.d.ts 7rzYec2m100644 index.js 'sF",}qZ40000 language e
rf7J%100644 processor.d.ts bwQ43z6b100644 processor.js ony.40000 rules C<qYLsk	100644 types.d.ts -Nܳ7=I,r4a100644 types.js I9U$"yނ100644 util.d.ts 3..Dk*o100644 util.js {o=נLN]ή
x Q100644 recommended-config.d.ts rƬ*}D4%e100644 recommended-config.js <z%%̐0|100644 rules.d.ts 42oR5R	N100644 rules.js /P<(jvrTYEC=x(export default rules;
declare const rules: {
    readonly "markdown/fenced-code-language": "error";
    readonly "markdown/heading-increment": "error";
    readonly "markdown/no-duplicate-definitions": "error";
    readonly "markdown/no-empty-definitions": "error";
    readonly "markdown/no-empty-images": "error";
    readonly "markdown/no-empty-links": "error";
    readonly "markdown/no-invalid-label-refs": "error";
    readonly "markdown/no-missing-atx-heading-space": "error";
    readonly "markdown/no-missing-label-refs": "error";
    readonly "markdown/no-missing-link-fragments": "error";
    readonly "markdown/no-multiple-h1": "error";
    readonly "markdown/no-reference-like-urls": "error";
    readonly "markdown/no-reversed-media-syntax": "error";
    readonly "markdown/no-space-in-emphasis": "error";
    readonly "markdown/no-unused-definitions": "error";
    readonly "markdown/require-alt-text": "error";
    readonly "markdown/table-column-count": "error";
};
2N4xMconst rules = /** @type {const} */ ({
    "markdown/fenced-code-language": "error",
    "markdown/heading-increment": "error",
    "markdown/no-duplicate-definitions": "error",
    "markdown/no-empty-definitions": "error",
    "markdown/no-empty-images": "error",
    "markdown/no-empty-links": "error",
    "markdown/no-invalid-label-refs": "error",
    "markdown/no-missing-atx-heading-space": "error",
    "markdown/no-missing-label-refs": "error",
    "markdown/no-missing-link-fragments": "error",
    "markdown/no-multiple-h1": "error",
    "markdown/no-reference-like-urls": "error",
    "markdown/no-reversed-media-syntax": "error",
    "markdown/no-space-in-emphasis": "error",
    "markdown/no-unused-definitions": "error",
    "markdown/require-alt-text": "error",
    "markdown/table-column-count": "error"
});
export default rules;
9xWexport default plugin;
export { MarkdownSourceCode };
export * from "./language/markdown-language.js";
export * from "./types.js";
declare namespace plugin {
    export namespace meta {
        let name: string;
        let version: string;
    }
    export namespace processors {
        export { processor as markdown };
    }
    export namespace languages {
        let commonmark: MarkdownLanguage;
        let gfm: MarkdownLanguage;
    }
    export { rules };
    export let configs: {
        "recommended-legacy": {
            plugins: string[];
            overrides: ({
                files: string[];
                processor: string;
                parserOptions?: undefined;
                rules?: undefined;
            } | {
                files: string[];
                parserOptions: {
                    ecmaFeatures: {
                        impliedStrict: boolean;
                    };
                };
                rules: {
                    "eol-last": "off";
                    "no-undef": "off";
                    "no-unused-expressions": "off";
                    "no-unused-vars": "off";
                    "padded-blocks": "off";
                    strict: "off";
                    "unicode-bom": "off";
                };
                processor?: undefined;
            })[];
        };
        recommended: {
            name: string;
            files: string[];
            language: string;
            plugins: {};
            rules: {
                readonly "markdown/fenced-code-language": "error";
                readonly "markdown/heading-increment": "error";
                readonly "markdown/no-duplicate-definitions": "error";
                readonly "markdown/no-empty-definitions": "error";
                readonly "markdown/no-empty-images": "error";
                readonly "markdown/no-empty-links": "error";
                readonly "markdown/no-invalid-label-refs": "error";
                readonly "markdown/no-missing-atx-heading-space": "error";
                readonly "markdown/no-missing-label-refs": "error";
                readonly "markdown/no-missing-link-fragments": "error";
                readonly "markdown/no-multiple-h1": "error";
                readonly "markdown/no-reference-like-urls": "error";
                readonly "markdown/no-reversed-media-syntax": "error";
                readonly "markdown/no-space-in-emphasis": "error";
                readonly "markdown/no-unused-definitions": "error";
                readonly "markdown/require-alt-text": "error";
                readonly "markdown/table-column-count": "error";
            };
        }[];
        processor: ConfigObject[];
    };
}
import { MarkdownSourceCode } from "./language/markdown-source-code.js";
import { processor } from "./processor.js";
import { MarkdownLanguage } from "./language/markdown-language.js";
import rules from "./build/rules.js";
import type { ConfigObject } from "@eslint/core";
rVx>/**
 * @fileoverview Markdown plugin.
 * @author Brandon Mills
 */
//-----------------------------------------------------------------------------
// Imports
//-----------------------------------------------------------------------------
import { processor } from "./processor.js";
import { MarkdownLanguage } from "./language/markdown-language.js";
import { MarkdownSourceCode } from "./language/markdown-source-code.js";
import recommendedRules from "./build/recommended-config.js";
import rules from "./build/rules.js";
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { ConfigObject, RulesConfig } from "@eslint/core";
 */
//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------
/** @satisfies {RulesConfig} */
const processorRulesConfig = {
    // The Markdown parser automatically trims trailing
    // newlines from code blocks.
    "eol-last": "off",
    // In code snippets and examples, these rules are often
    // counterproductive to clarity and brevity.
    "no-undef": "off",
    "no-unused-expressions": "off",
    "no-unused-vars": "off",
    "padded-blocks": "off",
    // Adding a "use strict" directive at the top of every
    // code block is tedious and distracting. The config
    // opts into strict mode parsing without the directive.
    strict: "off",
    // The processor will not receive a Unicode Byte Order
    // Mark from the Markdown parser.
    "unicode-bom": "off",
};
let recommendedPlugins, processorPlugins;
const plugin = {
    meta: {
        name: "@eslint/markdown",
        version: "8.0.3", // x-release-please-version
    },
    processors: {
        markdown: processor,
    },
    languages: {
        commonmark: new MarkdownLanguage({ mode: "commonmark" }),
        gfm: new MarkdownLanguage({ mode: "gfm" }),
    },
    rules,
    configs: {
        "recommended-legacy": {
            plugins: ["markdown"],
            overrides: [
                {
                    files: ["*.md"],
                    processor: "markdown/markdown",
                },
                {
                    files: ["**/*.md/**"],
                    parserOptions: {
                        ecmaFeatures: {
                            // Adding a "use strict" directive at the top of
                            // every code block is tedious and distracting, so
                            // opt into strict mode parsing without the
                            // directive.
                            impliedStrict: true,
                        },
                    },
                    rules: {
                        ...processorRulesConfig,
                    },
                },
            ],
        },
        recommended: [
            {
                name: "markdown/recommended",
                files: ["**/*.md"],
                language: "markdown/commonmark",
                plugins: (recommendedPlugins = {}),
                rules: recommendedRules,
            },
        ],
        processor: /** @type {ConfigObject[]} */ ([
            {
                name: "markdown/recommended/plugin",
                plugins: (processorPlugins = {}),
            },
            {
                name: "markdown/recommended/processor",
                files: ["**/*.md"],
                processor: "markdown/markdown",
            },
            {
                name: "markdown/recommended/code-blocks",
                files: ["**/*.md/**"],
                languageOptions: {
                    parserOptions: {
                        ecmaFeatures: {
                            // Adding a "use strict" directive at the top of
                            // every code block is tedious and distracting, so
                            // opt into strict mode parsing without the
                            // directive.
                            impliedStrict: true,
                        },
                    },
                },
                rules: {
                    ...processorRulesConfig,
                },
            },
        ]),
    },
};
Object.assign(recommendedPlugins, { markdown: plugin });
Object.assign(processorPlugins, { markdown: plugin });
export default plugin;
export { MarkdownSourceCode };
export * from "./language/markdown-language.js";
export * from "./types.js";
zܶ#x 5100644 markdown-language.d.ts YsŤZ/Wb9Q$100644 markdown-language.js Xdֲ|m)e.;100644 markdown-source-code.d.ts y0W#Fk#8qyq100644 markdown-source-code.js eWr]&}<c>t!cMEAx\/**
 * Markdown
)}
 */
export class Markdown.Creates a new instance.
     * @param {Object} options The options to use for this instance.
     * @param {ParserMode} [options.mode] The Markdown parser mode to use.
     */
    constructor({ mode }?: {
        mode?: ParserMode;
    });
    /**
     *bDefault language options. User-defined options are merged with this object.
     * @type {Markdownd5Markdown /Markdownj\cMarkdown'.g#MarkdownLanguageContext} context Th/ParseResult<Root>A74context: MarkdownLanguageContext): ParseResult<Root> MarkdownaPMarkdowna(OkParseResult<Root>CMarkdownMarkdownJOkParseResult<Root>): MarkdownSourceCode;
    #private;
}
export type Extensions = Options["extensions"];
export type MdastExteRnsions = Options["mdastExtensions"];
export type ParserMode = "commonmark" | "gfm">+MarkdownLanguageOptions } from "../types.js4Utype { MarkdownLanguageContext } from "../types.js";
import type { Root } from "mdastB,'{ MarkdownSourceCode } from "./markdown, +Options } from "mdast-util-from-markdown";
B?x'&-/**
 * Represents an inline config comment inq	#*/
export class InlineConfigComment}`value The comment text.
     * @param {Position} options.position The position of the comment inq	Fvalue, position }: {
        value: string;
        position: Position\	cext.
     * @type {string}
     */
    value: string;
    /**
     * The position of the comment inq	C @type {Position}
     */
    position: Position;
}
/**
 * MarkdownBMarkdownQRoot, SyntaxElementWithLoc: Node, ConfigNode: { value: string; position: Position }}>}
 */
export class MarkdownSourceCode exte*Markdown
Root;
    SyntaxElementWithLoc: Node;
    ConfigNode: {
        value: string;
        position: Position;
    };
}> {
    /**
Root9mRoot\5*;Parentl@Node): ParentWkInlineConfigComment>} A`),InlineConfigComment>an all directive nodGVPositionPosition%>Position } from "unist";
import type { MarkdownLanguageOptions%5Root } from "mdast";
import type { Node } from "mdastJParent } from "mdasH'aFxGaQMarkdown5`/import { lineEndingPattern } from "../util.js";p
TgPosition } from "unist";
 * @import { Parent, Root, Node, Html } from "mdast";
 * @import { TraversalStep, FileProblem, Directi8Markdown,./types.js";
 */p
TconfigCommentStart = /<!--Q8-->)/u;
const htmlComment = /<!--(.*?)-->/gsu;
/**
 * Represents an inline config comment in the source code.
 */
export class InlineConfigComment {,ext.
     * @type {string}
     */
    valueposition of the comment in Position}
     */
    positionPvalue The comment text.
     * @param {Position} options.position The position of the comment in the source code.
     */
    c9value, position }) {
        this.value = value.trim();
        this.position = position;
    }
}
/**
 * Extracts inline config7 from an HTML node.
 * @param {Html} node The HTML nodefrom.
 * @param {MarkdownSourceCode} sourceCode The Markdown source code object.
 * @returns {Array<InlineConfigComment>} The i found in the node.
 */
function extractInlineConfigCommentsFromHTML(node, sourceCode) {
    if (!configCommentStart.test(node.#value)) {
        return [];
    }
1InlineConfigComment.RegExpExecArray | null} */
    let match;
    while ((match = htmlComment.exec(node.value))) {
        if (configCommentStart.test(match[0])) {
            // calculate offset of the comment inside the node
            const startOffset = match.index + nWode.position.start.offset;
            const endOffset = startOffset + match[0].length;	new InlineConfigComment1!value: match[1].trim(
position: startO )...sourceCode.getLocFromIndex(startOffsetoffset: startOffset" endO '...sourceCode.getLocFromIndex(endOffsetoffset: endOffset" }'!}
    return commentsm
Markdown'BMarkdownmSRoot, SyntaxElementWithLoc: Node, ConfigNode: { value: string; position: Position }MarkdowncVisitNodeStep!vDNode, Parent|undefinedFcHTML nodes. Used to find directive comments.
     * @type {Array<Html>}
     */
    #htmlNodes = []RInlineConfigCommentH_Root.mKSRootZast, text, lineEndingPattern%// need to t#6to get the inline config nodes
        this.traverse()"L";Parent,#cInlineConfigComment>} A)R#htmlNodes.flatMap(htmlNode => extractInlineConfigCommentsFromHTML(htmlNode, this)$+}#ll directive nod// Step 1: Parse the directive!: justificationPart,1"comment.*// Step 2: Validate the directive does notaL1position.start.line !== comment.position.end.line%/positionHF// Step 3: Extract the directive value and create the Directive object1: justificationPart"GW	Position}pEPositioncomment.Jposition"8!position"#Y$	VisitNode#%</**
         * Recursively visits a node and its children.
         * @param {Node} node The node to visit.
         * @param {Parent} [parent]7#    * @returns {void}
         */
        const visit = (node, parent) => {
            // first set the parent
            thi%Tnode, parent);
            // then add the step
            steps.push(new VisitNodep&node&1&A;    // save HTML nodes
            if (node.type === "html"%,htmlNodes.push(/** @type {Html} */ (node));
N=// then visit the children
            if ("children" in node%/(parentNode = /** @type {Parent} */ (nodeA%parentNode.children.forEach(child => visit(child, parentNodeAZ>// then add the exit step
            steps.push(new VisitNodep&node&&C;
        visit(this.ast); '.values();
    }
}
x[Ex\export namespace processor {
    export namespace meta {
        let name: string;
        let version: string;
    }
    export { preprocess };
    export { postprocess };
    export { SUPPORTS_AUTOFIX as supportsAutofix };
}
/**
 * Extracts lintable code blocks from Markdown text.
 * @param {string} sourceText The text of the file.
 * @param {string} filename The filename of the file.
 * @returns {Array<{ filename: string, text: string }>} Source code blocks to lint.
 */
declare function preprocess(sourceText: string, filename: string): Array<{
    filename: string;
    text: string;
}>;
/**
 * Transforms generated messages for output.
 * @param {Array<LintMessage[]>} messages An array containing one array of messages
 *     for each code block returned from `preprocess`.
 * @param {string} filename The filename of the file
 * @returns {LintMessage[]} A flattened array of messages with mapped locations.
 */
declare function postprocess(messages: Array<LintMessage[]>, filename: string): LintMessage[];
declare const SUPPORTS_AUTOFIX: true;
import type { LintMessage } from "@eslint/core";
export {};
xA>/**
 * @fileoverview Processes Markdown files for consumption by ESLint.
 * @author Brandon Mills
 */
//-----------------------------------------------------------------------------
// Imports
//-----------------------------------------------------------------------------
import { fromMarkdown } from "mdast-util-from-markdown";
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { LintMessage, RuleTextEdit, SourceRange } from "@eslint/core";
 * @import { Node, Parent, Code, Html } from "mdast";
 * @import { Block, RangeMap } from "./types.js";
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
const UNSATISFIABLE_RULES = new Set([
    "eol-last", // The Markdown parser strips trailing newlines in code fences
    "unicode-bom", // Code blocks will begin in the middle of Markdown files
]);
const SUPPORTS_AUTOFIX = true;
const BOM = "\uFEFF";
/**
 * @type {Map<string, Block[]>}
 */
const blocksCache = new Map();
/**
 * Performs a depth-first traversal of the Markdown AST.
 * @param {Node} node A Markdown AST node.
 * @param {{[key: string]: (() => void) | ((node: Code) => void) | ((node: Html) => void)}} callbacks A map of node types to callbacks.
 * @returns {void}
 */
function traverse(node, callbacks) {
    if (callbacks[node.type]) {
        /** @type {(node: Node) => void} */ (callbacks[node.type])(node);
    }
    else {
        /** @type {() => void} */ (callbacks["*"])();
    }
    const parent = /** @type {Parent} */ (node);
    if (typeof parent.children !== "undefined") {
        for (let i = 0; i < parent.children.length; i++) {
            traverse(parent.children[i], callbacks);
        }
    }
}
/**
 * Extracts `eslint-*` or `global` comments from HTML comments if present.
 * @param {string} html The text content of an HTML AST node.
 * @returns {string} The comment's text without the opening and closing tags or
 *     an empty string if the text is not an ESLint HTML comment.
 */
function getComment(html) {
    const commentStart = "<!--";
    const commentEnd = "-->";
    const regex = /^(?:eslint\b|global\s)/u;
    if (html.slice(0, commentStart.length) !== commentStart ||
        html.slice(-commentEnd.length) !== commentEnd) {
        return "";
    }
    const comment = html.slice(commentStart.length, -commentEnd.length);
    if (!regex.test(comment.trim())) {
        return "";
    }
    return comment;
}
// Before a code block, blockquote characters (`>`) are also considered
// "whitespace".
const leadingWhitespaceRegex = /^[>\s]*/u;
/**
 * Gets the offset for the first column of the node's first line in the
 * original source text.
 * @param {Code} node A Markdown code block AST node.
 * @returns {number} The offset for the first column of the node's first line.
 */
function getBeginningOfLineOffset(node) {
    return node.position.start.offset - node.position.start.column + 1;
}
/**
 * Gets the leading text, typically whitespace with possible blockquote chars,
 * used to indent a code block.
 * @param {string} text The text of the file.
 * @param {Code} node A Markdown code block AST node.
 * @returns {string} The text from the start of the first line to the opening
 *     fence of the code block.
 */
function getIndentText(text, node) {
    return leadingWhitespaceRegex.exec(text.slice(getBeginningOfLineOffset(node)))[0];
}
/**
 * When applying fixes, the postprocess step needs to know how to map fix ranges
 * from their location in the linted JS to the original offset in the Markdown.
 * Configuration comments and indentation trimming both complicate this process.
 *
 * Configuration comments appear in the linted JS but not in the Markdown code
 * block. Fixes to configuration comments would cause undefined behavior and
 * should be ignored during postprocessing. Fixes to actual code after
 * configuration comments need to be mapped back to the code block after
 * removing any offset due to configuration comments.
 *
 * Fenced code blocks can be indented by up to three spaces at the opening
 * fence. Inside of a list, for example, this indent can be in addition to the
 * indent already required for list item children. Leading whitespace inside
 * indented code blocks is trimmed up to the level of the opening fence and does
 * not appear in the linted code. Further, lines can have less leading
 * whitespace than the opening fence, so not all lines are guaranteed to have
 * the same column offset as the opening fence.
 *
 * The source code of a non-configuration-comment line in the linted JS is a
 * suffix of the corresponding line in the Markdown code block. There are no
 * differences within the line, so the mapping need only provide the offset
 * delta at the beginning of each line.
 * @param {string} text The text of the file.
 * @param {Code} node A Markdown code block AST node.
 * @param {string[]} comments List of configuration comment strings that will be
 *     inserted at the beginning of the code block.
 * @returns {RangeMap[]} A list of offset-based adjustments, where lookups are
 *     done based on the `js` key, which represents the range in the linted JS,
 *     and the `md` key is the offset delta that, when added to the JS range,
 *     returns the corresponding location in the original Markdown source.
 */
function getBlockRangeMap(text, node, comments) {
    /*
     * The parser sets the fenced code block's start offset to wherever content
     * should normally begin (typically the first column of the line, but more
     * inside a list item, for example). The code block's opening fence may be
     * further indented by up to three characters. If the code block has
     * additional indenting, the opening fence's first backtick may be up to
     * three whitespace characters after the start offset.
     */
    const startOffset = getBeginningOfLineOffset(node);
    /*
     * Extract the Markdown source to determine the leading whitespace for each
     * line.
     */
    const code = text.slice(startOffset, node.position.end.offset);
    const lines = code.split("\n");
    /*
     * The parser trims leading whitespace from each line of code within the
     * fenced code block up to the opening fence's first backtick. The first
     * backtick's column is the AST node's starting column plus any additional
     * indentation.
     */
    const baseIndent = getIndentText(text, node).length;
    /*
     * Track the length of any inserted configuration comments at the beginning
     * of the linted JS and start the JS offset lookup keys at this index.
     */
    const commentLength = comments.reduce((len, comment) => len + comment.length + 1, 0);
    /*
     * In case there are configuration comments, initialize the map so that the
     * first lookup index is always 0. If there are no configuration comments,
     * the lookup index will also be 0, and the lookup should always go to the
     * last range that matches, skipping this initialization entry.
     */
    const rangeMap = [
        {
            indent: baseIndent,
            js: 0,
            md: 0,
        },
    ];
    // Start the JS offset after any configuration comments.
    let jsOffset = commentLength;
    /*
     * Start the Markdown offset at the beginning of the block's first line of
     * actual code. The first line of the block is always the opening fence, so
     * the code begins on the second line.
     */
    let mdOffset = startOffset + lines[0].length + 1;
    /*
     * For each line, determine how much leading whitespace was trimmed due to
     * indentation. Increase the JS lookup offset by the length of the line
     * post-trimming and the Markdown offset by the total line length.
     */
    for (let i = 0; i + 1 < lines.length; i++) {
        const line = lines[i + 1];
        const leadingWhitespaceLength = leadingWhitespaceRegex.exec(line)[0].length;
        // The parser trims leading whitespace up to the level of the opening
        // fence, so keep any additional indentation beyond that.
        const trimLength = Math.min(baseIndent, leadingWhitespaceLength);
        rangeMap.push({
            indent: trimLength,
            js: jsOffset,
            // Advance `trimLength` character from the beginning of the Markdown
            // line to the beginning of the equivalent JS line, then compute the
            // delta.
            md: mdOffset + trimLength - jsOffset,
        });
        // Accumulate the current line in the offsets, and don't forget the
        // newline.
        mdOffset += line.length + 1;
        jsOffset += line.length - trimLength + 1;
    }
    return rangeMap;
}
const codeBlockFileNameRegex = /filename=(?<quote>["'])(?<filename>.*?)\1/u;
/**
 * Parses the file name from a block meta, if available.
 * @param {Block} block A code block.
 * @returns {string | null | undefined} The filename, if parsed from block meta.
 */
function fileNameFromMeta(block) {
    return block.meta
        ?.match(codeBlockFileNameRegex)
        ?.groups.filename.replaceAll(/\s+/gu, "_");
}
const languageToFileExtension = {
    javascript: "js",
    ecmascript: "js",
    typescript: "ts",
    markdown: "md",
};
/**
 * Extracts lintable code blocks from Markdown text.
 * @param {string} sourceText The text of the file.
 * @param {string} filename The filename of the file.
 * @returns {Array<{ filename: string, text: string }>} Source code blocks to lint.
 */
function preprocess(sourceText, filename) {
    const text = sourceText.startsWith(BOM) ? sourceText.slice(1) : sourceText;
    const ast = fromMarkdown(text);
    /** @type {Block[]} */
    const blocks = [];
    blocksCache.set(filename, blocks);
    /**
     * During the depth-first traversal, keep track of any sequences of HTML
     * comment nodes containing `eslint-*` or `global` comments. If a code
     * block immediately follows such a sequence, insert the comments at the
     * top of the code block. Any non-ESLint comment or other node type breaks
     * and empties the sequence.
     * @type {string[]}
     */
    let htmlComments = [];
    traverse(ast, {
        "*"() {
            htmlComments = [];
        },
        /**
         * Visit a code node.
         * @param {Code} node The visited node.
         * @returns {void}
         */
        code(node) {
            if (node.lang) {
                /** @type {string[]} */
                const comments = [];
                for (const comment of htmlComments) {
                    if (comment.trim() === "eslint-skip") {
                        htmlComments = [];
                        return;
                    }
                    comments.push(`/*${comment}*/`);
                }
                htmlComments = [];
                blocks.push({
                    ...node,
                    baseIndentText: getIndentText(text, node),
                    comments,
                    rangeMap: getBlockRangeMap(text, node, comments),
                });
            }
        },
        /**
         * Visit an HTML node.
         * @param {Html} node The visited node.
         * @returns {void}
         */
        html(node) {
            const comment = getComment(node.value);
            if (comment) {
                htmlComments.push(comment);
            }
            else {
                htmlComments = [];
            }
        },
    });
    return blocks.map((block, index) => {
        const [language] = block.lang.trim().split(" ");
        const fileExtension = Object.hasOwn(languageToFileExtension, language)
            ? languageToFileExtension[
            /** @type {keyof typeof languageToFileExtension} */ (language)]
            : language;
        return {
            filename: fileNameFromMeta(block) ?? `${index}.${fileExtension}`,
            text: [...block.comments, block.value, ""].join("\n"),
        };
    });
}
/**
 * Adjusts a fix in a code block.
 * @param {Block} block A code block.
 * @param {RuleTextEdit} fix A fix to adjust.
 * @returns {RuleTextEdit} The fix with adjusted ranges.
 */
function adjustFix(block, fix) {
    return {
        range: /** @type {SourceRange} */ (fix.range.map(range => {
            // Advance through the block's range map to find the last
            // matching range by finding the first range too far and
            // then going back one.
            let i = 1;
            while (i < block.rangeMap.length &&
                block.rangeMap[i].js <= range) {
                i++;
            }
            // Apply the mapping delta for this range.
            return range + block.rangeMap[i - 1].md;
        })),
        text: fix.text.replace(/\n/gu, `\n${block.baseIndentText}`),
    };
}
/**
 * Creates a map function that adjusts messages in a code block.
 * @param {Block} block A code block.
 * @returns {(message: LintMessage) => LintMessage | null} A function that adjusts messages in a code block.
 */
function adjustBlock(block) {
    const leadingCommentLines = block.comments.reduce((count, comment) => count + comment.split("\n").length, 0);
    const blockStart = block.position.start.line;
    /**
     * Adjusts ESLint messages to point to the correct location in the Markdown.
     * @param {LintMessage} message A message from ESLint.
     * @returns {LintMessage} The same message, but adjusted to the correct location.
     */
    return function adjustMessage(message) {
        if (!Number.isInteger(message.line)) {
            return {
                ...message,
                line: blockStart,
                column: block.position.start.column,
            };
        }
        const lineInCode = message.line - leadingCommentLines;
        if (lineInCode < 1 || lineInCode >= block.rangeMap.length) {
            return null;
        }
        /** @type {Pick<LintMessage, "line" | "column" | "endLine" | "suggestions">} */
        const out = {
            line: lineInCode + blockStart,
            column: message.column + block.rangeMap[lineInCode].indent,
        };
        if (Number.isInteger(message.endLine)) {
            out.endLine = message.endLine - leadingCommentLines + blockStart;
        }
        if (Array.isArray(message.suggestions)) {
            out.suggestions = message.suggestions.map(suggestion => ({
                ...suggestion,
                fix: adjustFix(block, suggestion.fix),
            }));
        }
        const adjustedFix = {};
        if (message.fix) {
            adjustedFix.fix = adjustFix(block, message.fix);
        }
        return { ...message, ...out, ...adjustedFix };
    };
}
/**
 * Excludes unsatisfiable rules from the list of messages.
 * @param {LintMessage} message A message from the linter.
 * @returns {boolean} True if the message should be included in output.
 */
function excludeUnsatisfiableRules(message) {
    return message && !UNSATISFIABLE_RULES.has(message.ruleId);
}
/**
 * Transforms generated messages for output.
 * @param {Array<LintMessage[]>} messages An array containing one array of messages
 *     for each code block returned from `preprocess`.
 * @param {string} filename The filename of the file
 * @returns {LintMessage[]} A flattened array of messages with mapped locations.
 */
function postprocess(messages, filename) {
    const blocks = blocksCache.get(filename);
    blocksCache.delete(filename);
    return messages.flatMap((group, i) => {
        const adjust = adjustBlock(blocks[i]);
        return group.map(adjust).filter(excludeUnsatisfiableRules);
    });
}
export const processor = {
    meta: {
        name: "@eslint/markdown/markdown",
        version: "8.0.3", // x-release-please-version
    },
    preprocess,
    postprocess,
    supportsAutofix: SUPPORTS_AUTOFIX,
};
`稅xX100644 fenced-code-language.d.ts ᾰ6%- "100644 fenced-code-language.js OJMtc L100644 fenced-code-meta.d.ts #x#"XQ*100644 fenced-code-meta.js N|f*f^D100644 heading-increment.d.ts SstbF	 et100644 heading-increment.js Ef/·\100644 no-bare-urls.d.ts ?d?4ޥw	+@100644 no-bare-urls.js ΄~Ucцz
100644 no-duplicate-definitions.d.ts \ᢆE-100644 no-duplicate-definitions.js !kl<jg"100644 no-duplicate-headings.d.ts ]>tYr1SQܔ3F100644 no-duplicate-headings.js $DyBv^J100644 no-empty-definitions.d.ts g-"!ɱS;g<100644 no-empty-definitions.js }tNjthA100644 no-empty-images.d.ts 7T:s
z*O100644 no-empty-images.js ?FqoTN2y100644 no-empty-links.d.ts JC\N.ځмO100644 no-empty-links.js '[Fo`"~<N100644 no-html.d.ts ±Nόet?SR~100644 no-html.js :IlixbO,K(t100644 no-invalid-label-refs.d.ts n=Ho<v100644 no-invalid-label-refs.js {åd_E100644 no-missing-atx-heading-space.d.ts Ƹp&)ҵ#Eq_100644 no-missing-atx-heading-space.js Ȣ4</U100644 no-missing-label-refs.d.ts y&ƥP>T? 100644 no-missing-label-refs.js ~ˢ}U/>_100644 no-missing-link-fragments.d.ts eՠ&giȔ100644 no-missing-link-fragments.js b	ZD.vPN100644 no-multiple-h1.d.ts µ/kCi_$w100644 no-multiple-h1.js {̰c(qfN100644 no-reference-like-urls.d.ts iN▤y*100644 no-reference-like-urls.js U9
P
n'x100644 no-reversed-media-syntax.d.ts 0jبNuo,afH100644 no-reversed-media-syntax.js i%`ϨkIx100644 no-space-in-emphasis.d.ts m ǡA?~<]S100644 no-space-in-emphasis.js gEo<+iO100644 no-unused-definitions.d.ts *w˾/vq100644 no-unused-definitions.js 'L"gV%N+kƉ0i100644 require-alt-text.d.ts q|dA7ǴOb100644 require-alt-text.js ܿ+as
hm100644 table-column-count.d.ts 3hHXP:xy!100644 table-column-count.js ̩D	:֢br; BNfxmdeclare namespace _default {
    namespace meta {
        let type: "problem";
        namespace docs {
            let recommended: boolean;
            let description: string;
            let url: string;
        }
        namespace messages {
            let missingLanguage: string;
            let disallowedLanguage: string;
        }
        let schema: {
            type: "object";
            properties: {
                required: {
                    type: "array";
                    items: {
                        type: "string";
                    };
                    uniqueItems: true;
                };
            };
            additionalProperties: false;
        }[];
        let defaultOptions: [{
            required: any[];
        }];
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../types.js").MarkdownLanguageOptions;
        Code: import("../index.js").MarkdownSourceCode;
        RuleOptions: FencedCodeLanguageOptions;
        Node: import("mdast").Node | import("../language/markdown-source-code.js").InlineConfigComment;
        MessageIds: FencedCodeLanguageMessageIds;
    }>): {
        code(node: import("mdast").Code): void;
    };
}
export default _default;
export type FencedCodeLanguageMessageIds = "missingLanguage" | "disallowedLanguage";
export type FencedCodeLanguageOptions = [{
    required?: string[];
}];
export type FencedCodeLanguageRuleDefinition = MarkdownRuleDefinition<{
    RuleOptions: FencedCodeLanguageOptions;
    MessageIds: FencedCodeLanguageMessageIds;
}>;
import type { MarkdownRuleDefinition } from "../types.js";
bx/**
 * @fileoverview Rule to enforce languages for fenced code.
 * @author Nicholas C. Zakas
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { MarkdownRuleDefinition } from "../types.js";
 * @typedef {"missingLanguage" | "disallowedLanguage"} FencedCodeLanguageMessageIds
 * @typedef {[{ required?: string[] }]} FencedCodeLanguageOptions
 * @typedef {MarkdownRuleDefinition<{ RuleOptions: FencedCodeLanguageOptions, MessageIds: FencedCodeLanguageMessageIds }>} FencedCodeLanguageRuleDefinition
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
const fencedCodeCharacters = new Set(["`", "~"]);
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {FencedCodeLanguageRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            recommended: true,
            description: "Require languages for fenced code blocks",
            url: "https://github.com/eslint/markdown/blob/main/docs/rules/fenced-code-language.md",
        },
        messages: {
            missingLanguage: "Missing code block language.",
            disallowedLanguage: 'Code block language "{{lang}}" is not allowed.',
        },
        schema: [
            {
                type: "object",
                properties: {
                    required: {
                        type: "array",
                        items: {
                            type: "string",
                        },
                        uniqueItems: true,
                    },
                },
                additionalProperties: false,
            },
        ],
        defaultOptions: [
            {
                required: [],
            },
        ],
    },
    create(context) {
        const required = new Set(context.options[0].required);
        const { sourceCode } = context;
        return {
            code(node) {
                if (!node.lang) {
                    // only check fenced code blocks
                    if (!fencedCodeCharacters.has(sourceCode.text[node.position.start.offset])) {
                        return;
                    }
                    /** @type {number} */
                    let openingCodeFenceEndOffset;
                    for (openingCodeFenceEndOffset = node.position.start.offset; fencedCodeCharacters.has(sourceCode.text[openingCodeFenceEndOffset]); openingCodeFenceEndOffset++) {
                        // Find the end offset of the opening code fence.
                    }
                    context.report({
                        loc: {
                            start: node.position.start,
                            end: {
                                line: node.position.start.line,
                                column: node.position.start.column +
                                    openingCodeFenceEndOffset -
                                    node.position.start.offset,
                            },
                        },
                        messageId: "missingLanguage",
                    });
                    return;
                }
                if (required.size && !required.has(node.lang)) {
                    const langIndex = sourceCode
                        .getText(node)
                        .indexOf(node.lang);
                    context.report({
                        loc: {
                            start: node.position.start,
                            end: {
                                line: node.position.start.line,
                                column: node.position.start.column +
                                    langIndex +
                                    node.lang.length,
                            },
                        },
                        messageId: "disallowedLanguage",
                        data: {
                            lang: node.lang,
                        },
                    });
                }
            },
        };
    },
});
9ްPx declare namespace _default {
    namespace meta {
        let type: "problem";
        namespace docs {
            let recommended: boolean;
            let description: string;
            let url: string;
        }
        namespace messages {
            let missingMetadata: string;
            let disallowedMetadata: string;
        }
        let schema: {
            enum: string[];
        }[];
        let defaultOptions: ["always"];
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../types.js").MarkdownLanguageOptions;
        Code: import("../index.js").MarkdownSourceCode;
        RuleOptions: FencedCodeMetaOptions;
        Node: import("mdast").Node | import("../language/markdown-source-code.js").InlineConfigComment;
        MessageIds: FencedCodeMetaMessageIds;
    }>): {
        code(node: import("mdast").Code): void;
    };
}
export default _default;
export type FencedCodeMetaMessageIds = "missingMetadata" | "disallowedMetadata";
export type FencedCodeMetaOptions = ["always" | "never"];
export type FencedCodeMetaRuleDefinition = MarkdownRuleDefinition<{
    RuleOptions: FencedCodeMetaOptions;
    MessageIds: FencedCodeMetaMessageIds;
}>;
import type { MarkdownRuleDefinition } from "../types.js";
	Dxt/**
 * @fileoverview Rule to require or disallow metadata for fenced code blocks.
 * @author TKDev7
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { MarkdownRuleDefinition } from "../types.js";
 * @typedef {"missingMetadata" | "disallowedMetadata"} FencedCodeMetaMessageIds
 * @typedef {["always" | "never"]} FencedCodeMetaOptions
 * @typedef {MarkdownRuleDefinition<{ RuleOptions: FencedCodeMetaOptions, MessageIds: FencedCodeMetaMessageIds }>} FencedCodeMetaRuleDefinition
 */
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {FencedCodeMetaRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            recommended: false,
            description: "Require or disallow metadata for fenced code blocks",
            url: "https://github.com/eslint/markdown/blob/main/docs/rules/fenced-code-meta.md",
        },
        messages: {
            missingMetadata: "Missing code block metadata.",
            disallowedMetadata: "Code block metadata is not allowed.",
        },
        schema: [
            {
                enum: ["always", "never"],
            },
        ],
        defaultOptions: ["always"],
    },
    create(context) {
        const [mode] = context.options;
        const { sourceCode } = context;
        return {
            code(node) {
                const lineText = sourceCode.lines[node.position.start.line - 1];
                const fenceLineText = lineText.slice(node.position.start.column - 1);
                if (mode === "always") {
                    if (node.lang && !node.meta) {
                        const langIndex = fenceLineText.indexOf(node.lang);
                        context.report({
                            loc: {
                                start: node.position.start,
                                end: {
                                    line: node.position.start.line,
                                    column: node.position.start.column +
                                        langIndex +
                                        node.lang.length,
                                },
                            },
                            messageId: "missingMetadata",
                        });
                    }
                    return;
                }
                if (node.meta) {
                    const metaIndex = fenceLineText.lastIndexOf(node.meta);
                    context.report({
                        loc: {
                            start: {
                                line: node.position.start.line,
                                column: node.position.start.column + metaIndex,
                            },
                            end: {
                                line: node.position.start.line,
                                column: node.position.start.column +
                                    metaIndex +
                                    node.meta.trimEnd().length,
                            },
                        },
                        messageId: "disallowedMetadata",
                    });
                }
            },
        };
    },
});
W`ɷdxGdeclare namespace _default {
    namespace meta {
        let type: "problem";
        namespace docs {
            let recommended: boolean;
            let description: string;
            let url: string;
        }
        namespace messages {
            let skippedHeading: string;
        }
        let schema: {
            type: "object";
            properties: {
                frontmatterTitle: {
                    type: "string";
                };
            };
            additionalProperties: false;
        }[];
        let defaultOptions: [{
            frontmatterTitle: string;
        }];
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../types.js").MarkdownLanguageOptions;
        Code: import("../index.js").MarkdownSourceCode;
        RuleOptions: HeadingIncrementOptions;
        Node: import("mdast").Node | import("../language/markdown-source-code.js").InlineConfigComment;
        MessageIds: "skippedHeading";
    }>): {
        yaml(node: import("mdast").Yaml): void;
        toml(node: import("../types.js").Toml): void;
        json(node: import("../types.js").Json): void;
        heading(node: import("mdast").Heading): void;
    };
}
export default _default;
export type HeadingIncrementMessageIds = "skippedHeading";
export type HeadingIncrementOptions = [{
    frontmatterTitle?: string;
}];
export type HeadingIncrementRuleDefinition = MarkdownRuleDefinition<{
    RuleOptions: HeadingIncrementOptions;
    MessageIds: HeadingIncrementMessageIds;
}>;
import type { MarkdownRuleDefinition } from "../types.js";
^xy/**
 * @fileoverview Rule to enforce heading levels increment by one.
 * @author Nicholas C. Zakas
 */
//-----------------------------------------------------------------------------
// Imports
//-----------------------------------------------------------------------------
import { frontmatterHasTitle } from "../util.js";
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { MarkdownRuleDefinition } from "../types.js";
 * @typedef {"skippedHeading"} HeadingIncrementMessageIds
 * @typedef {[{ frontmatterTitle?: string }]} HeadingIncrementOptions
 * @typedef {MarkdownRuleDefinition<{ RuleOptions: HeadingIncrementOptions, MessageIds: HeadingIncrementMessageIds }>} HeadingIncrementRuleDefinition
 */
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {HeadingIncrementRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            recommended: true,
            description: "Enforce heading levels increment by one",
            url: "https://github.com/eslint/markdown/blob/main/docs/rules/heading-increment.md",
        },
        messages: {
            skippedHeading: "Heading level skipped from {{fromLevel}} to {{toLevel}}.",
        },
        schema: [
            {
                type: "object",
                properties: {
                    frontmatterTitle: {
                        type: "string",
                    },
                },
                additionalProperties: false,
            },
        ],
        defaultOptions: [
            {
                frontmatterTitle: "^(?!\\s*['\"]title[:=]['\"])\\s*\\{?\\s*['\"]?title['\"]?\\s*[:=]",
            },
        ],
    },
    create(context) {
        const [{ frontmatterTitle }] = context.options;
        const titlePattern = frontmatterTitle === "" ? null : new RegExp(frontmatterTitle, "iu");
        let lastHeadingDepth = 0;
        return {
            yaml(node) {
                if (frontmatterHasTitle(node.value, titlePattern)) {
                    lastHeadingDepth = 1;
                }
            },
            toml(node) {
                if (frontmatterHasTitle(node.value, titlePattern)) {
                    lastHeadingDepth = 1;
                }
            },
            json(node) {
                if (frontmatterHasTitle(node.value, titlePattern)) {
                    lastHeadingDepth = 1;
                }
            },
            heading(node) {
                if (lastHeadingDepth > 0 && node.depth > lastHeadingDepth + 1) {
                    context.report({
                        loc: node.position,
                        messageId: "skippedHeading",
                        data: {
                            fromLevel: lastHeadingDepth,
                            toLevel: node.depth,
                        },
                    });
                }
                lastHeadingDepth = node.depth;
            },
        };
    },
});
Ex
declare namespace _default {
    namespace meta {
        let type: "problem";
        namespace docs {
            let recommended: boolean;
            let description: string;
            let url: string;
        }
        namespace messages {
            let unusedDefinition: string;
            let unusedFootnoteDefinition: string;
        }
        let schema: {
            type: "object";
            properties: {
                allowDefinitions: {
                    type: "array";
                    items: {
                        type: "string";
                    };
                    uniqueItems: true;
                };
                allowFootnoteDefinitions: {
                    type: "array";
                    items: {
                        type: "string";
                    };
                    uniqueItems: true;
                };
                checkFootnoteDefinitions: {
                    type: "boolean";
                };
            };
            additionalProperties: false;
        }[];
        let defaultOptions: [{
            allowDefinitions: string[];
            allowFootnoteDefinitions: any[];
            checkFootnoteDefinitions: true;
        }];
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../types.js").MarkdownLanguageOptions;
        Code: import("../index.js").MarkdownSourceCode;
        RuleOptions: NoUnusedDefinitionsOptions;
        Node: import("mdast").Node | import("../language/markdown-source-code.js").InlineConfigComment;
        MessageIds: NoUnusedDefinitionsMessageIds;
    }>): {
        imageReference(node: import("mdast").ImageReference): void;
        linkReference(node: import("mdast").LinkReference): void;
        footnoteReference(node: import("mdast").FootnoteReference): void;
        definition(node: Definition): void;
        footnoteDefinition(node: FootnoteDefinition): void;
        "root:exit"(): void;
    };
}
export default _default;
export type NoUnusedDefinitionsMessageIds = "unusedDefinition" | "unusedFootnoteDefinition";
export type NoUnusedDefinitionsOptions = [{
    allowDefinitions?: string[];
    allowFootnoteDefinitions?: string[];
    checkFootnoteDefinitions?: boolean;
}];
export type NoUnusedDefinitionsRuleDefinition = MarkdownRuleDefinition<{
    RuleOptions: NoUnusedDefinitionsOptions;
    MessageIds: NoUnusedDefinitionsMessageIds;
}>;
import type { Definition } from "mdast";
import type { FootnoteDefinition } from "mdast";
import type { MarkdownRuleDefinition } from "../types.js";
7x,
xDlet fixable: "code";.bareUrl: string;
        }[]~"bareUrl";
    }>): {
        ":matches(heading, paragraph, tableCell) html"(node: Html): void;
        ":matches(heading, para;graph, tableCell) link"(node: Link): void;
        "heading    "paragraph    "tableCellIYBareUrlsMessageIds = "bareUrl";
export type NoBareUrlsOptions = [];
export type NoBareUrl>BareUrl=	BareUrli	'Html } from "mdast";
import type { Link	LАJx/**
 * @fileoverview Rule to prevent bare URLs in Markdown.
 * @author xbinaryx
 */
/*
 * Here's a note on how the approach (algorithm) works:
 *
 * - When entering an `Html` node that is a child of a `Heading`, `Paragraph` or `TableCell`,
 *   we check whether it is an opening or closing tag.
 *   If we encounter an opening tag, we store the tag name and set `lastTagName`.
 *   (`lastTagName` serves as a state to represent whether we're between opening and closing HTML tags.)
 *   If we encounter a closing tag, we reset the stored tag name and `tempLinkNodes`.
 *
 * - When entering a `Link` node that is a child of a `Heading`, `Paragraph` or `TableCell`,
 *   we check whether it is between opening and closing HTML tags.
 *   If it's between opening and closing HTML tags, we add it to `tempLinkNodes`.
 *   If it's not between opening and closing HTML tags, we add it to `linkNodes`.
 *
 * - When exiting a `Heading`, `Paragraph` or `TableCell`, we add all `tempLinkNodes` to `linkNodes`.
 *   If there are any remaining `tempLinkNodes`, it means they are not between opening and closing HTML tags. (ex. `<br> ... <br>`)
 *   If there are no remaining `tempLinkNodes`, it means they are between opening and closing HTML tags.
 *
 * - When exiting a `root` node, we report all `Link` nodes for bare URLs.
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { Link, Html } from "mdast";
 * @import { MarkdownRuleDefinition } from "../types.js";
 * @typedef {"bareUrl"} NoBareUrlsMessageIds
 * @typedef {[]} NoBareUrlsOptions
 * @typedef {MarkdownRuleDefinition<{ RuleOptions: NoBareUrlsOptions, MessageIds: NoBareUrlsMessageIds }>} NoBareUrlsRuleDefinition
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
const htmlTagNamePattern = /^<(?<tagName>[^!>][^/\s>]*)/u;
/**
 * Parses an HTML tag to extract its name and closing status
 * @param {string} tagText The HTML tag text to parse
 * @returns {{ name: string, isClosing: boolean } | null} Object containing tag name and closing status, or null if not a valid tag
 */
function parseHtmlTag(tagText) {
    const match = tagText.match(htmlTagNamePattern);
    if (match) {
        const tagName = match.groups.tagName.toLowerCase();
        const isClosing = tagName.startsWith("/");
        return {
            name: isClosing ? tagName.slice(1) : tagName,
            isClosing,
        };
    }
    return null;
}
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {NoBareUrlsRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            description: "Disallow bare URLs",
            url: "https://github.com/eslint/markdown/blob/main/docs/rules/no-bare-urls.md",
        },
        fixable: "code",
        messages: {
            bareUrl: "Unexpected bare URL. Use autolink (<URL>) or link ([text](URL)) instead.",
        },
    },
    create(context) {
        const { sourceCode } = context;
        /**
         * This array is used to store all `Link` nodes for the final report.
         * @type {Array<Link>}
         */
        const linkNodes = [];
        /**
         * This array is used to store `Link` nodes that are estimated to be between opening and closing HTML tags.
         * @type {Array<Link>}
         */
        const tempLinkNodes = [];
        /** @type {string | null} */
        let lastTagName = null;
        /**
         * Resets `tempLinkNodes` and `lastTagName`
         * @returns {void}
         */
        function reset() {
            tempLinkNodes.length = 0;
            lastTagName = null;
        }
        return {
            ":matches(heading, paragraph, tableCell) html"(
            /** @type {Html} */ node) {
                const tagInfo = parseHtmlTag(node.value);
                if (!tagInfo) {
                    return;
                }
                if (!tagInfo.isClosing && lastTagName === null) {
                    lastTagName = tagInfo.name;
                }
                if (tagInfo.isClosing && lastTagName === tagInfo.name) {
                    reset();
                }
            },
            ":matches(heading, paragraph, tableCell) link"(
            /** @type {Link} */ node) {
                if (lastTagName !== null) {
                    tempLinkNodes.push(node);
                }
                else {
                    linkNodes.push(node);
                }
            },
            "heading:exit"() {
                linkNodes.push(...tempLinkNodes);
                reset();
            },
            "paragraph:exit"() {
                linkNodes.push(...tempLinkNodes);
                reset();
            },
            "tableCell:exit"() {
                linkNodes.push(...tempLinkNodes);
                reset();
            },
            "root:exit"() {
                for (const linkNode of linkNodes) {
                    const text = sourceCode.getText(linkNode);
                    const { url } = linkNode;
                    if (url === text ||
                        url === `http://${text}` ||
                        url === `mailto:${text}`) {
                        context.report({
                            node: linkNode,
                            messageId: "bareUrl",
                            fix(fixer) {
                                return fixer.replaceText(linkNode, `<${text}>`);
                            },
                        });
                    }
                }
            },
        };
    },
});
Gc!x 9duplica=    let duplicate7d	Duplicate	Duplicate_	P3d,	Duplicate_	% = "duplicateDefinition" | "duplicate#	DuplicateC	DuplicateH	DuplicateK		Duplicate_	Ckx/**
 * @fileoverview Rule to prevent unused definitions in Markdown.
 * @author 루밀LuMir(lumirlumir)
 */
//-----------------------------------------------------------------------------
// Imports
//-----------------------------------------------------------------------------
import { normalizeIdentifier } from "micromark-util-normalize-identifier";
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { Definition, FootnoteDefinition } from "mdast";
 * @import { MarkdownRuleDefinition } from "../types.js";
 * @typedef {"unusedDefinition" | "unusedFootnoteDefinition"} NoUnusedDefinitionsMessageIds
 * @typedef {[{ allowDefinitions?: string[], allowFootnoteDefinitions?: string[], checkFootnoteDefinitions?: boolean }]} NoUnusedDefinitionsOptions
 * @typedef {MarkdownRuleDefinition<{ RuleOptions: NoUnusedDefinitionsOptions, MessageIds: NoUnusedDefinitionsMessageIds }>} NoUnusedDefinitionsRuleDefinition
 */
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {NoUnusedDefinitionsRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            recommended: true,
            description: "Disallow unused definitions",
            url: "https://github.com/eslint/markdown/blob/main/docs/rules/no-unused-definitions.md",
        },
        messages: {
            unusedDefinition: "Unexpected unused definition `{{ identifier }}` (label: `{{ label }}`) found.",
            unusedFootnoteDefinition: "Unexpected unused footnote definition `{{ identifier }}` (label: `{{ label }}`) found.",
        },
        schema: [
            {
                type: "object",
                properties: {
                    allowDefinitions: {
                        type: "array",
                        items: {
                            type: "string",
                        },
                        uniqueItems: true,
                    },
                    allowFootnoteDefinitions: {
                        type: "array",
                        items: {
                            type: "string",
                        },
                        uniqueItems: true,
                    },
                    checkFootnoteDefinitions: {
                        type: "boolean",
                    },
                },
                additionalProperties: false,
            },
        ],
        defaultOptions: [
            {
                allowDefinitions: ["//"],
                allowFootnoteDefinitions: [],
                checkFootnoteDefinitions: true,
            },
        ],
    },
    create(context) {
        const allowDefinitions = new Set(context.options[0].allowDefinitions.map(identifier => normalizeIdentifier(identifier).toLowerCase()));
        const allowFootnoteDefinitions = new Set(context.options[0].allowFootnoteDefinitions.map(identifier => normalizeIdentifier(identifier).toLowerCase()));
        const [{ checkFootnoteDefinitions }] = context.options;
        /** @type {Set<string>} Set to track used identifiers */
        const usedIdentifiers = new Set();
        /** @type {Set<string>} Set to track used footnote identifiers */
        const usedFootnoteIdentifiers = new Set();
        /** @type {Set<Definition>} */
        const definitions = new Set();
        /** @type {Set<FootnoteDefinition>} */
        const footnoteDefinitions = new Set();
        return {
            imageReference(node) {
                usedIdentifiers.add(node.identifier);
            },
            linkReference(node) {
                usedIdentifiers.add(node.identifier);
            },
            footnoteReference(node) {
                usedFootnoteIdentifiers.add(node.identifier);
            },
            definition(node) {
                if (allowDefinitions.has(node.identifier)) {
                    return;
                }
                definitions.add(node);
            },
            footnoteDefinition(node) {
                if (!checkFootnoteDefinitions ||
                    allowFootnoteDefinitions.has(node.identifier)) {
                    return;
                }
                footnoteDefinitions.add(node);
            },
            "root:exit"() {
                for (const definition of definitions) {
                    if (!usedIdentifiers.has(definition.identifier)) {
                        context.report({
                            node: definition,
                            messageId: "unusedDefinition",
                            data: {
                                identifier: definition.identifier,
                                label: definition.label.trim(),
                            },
                        });
                    }
                }
                for (const footnoteDefinition of footnoteDefinitions) {
                    if (!usedFootnoteIdentifiers.has(footnoteDefinition.identifier)) {
                        context.report({
                            node: footnoteDefinition,
                            messageId: "unusedFootnoteDefinition",
                            data: {
                                identifier: footnoteDefinition.identifier,
                                label: footnoteDefinition.label,
                            },
                        });
                    }
                }
            },
        };
    },
});
6Hxu,+%	duplicate+sAduplicateDefinition" | "duplicateFootnoteDefinition"} NoDuplicate	DuplicatemH	Duplicate".DuplicateDefinitionsMessageIds }>} NoDuplicate	Duplicate	duplicate\	duplicate=	duplicate@	duplicate^<[ First defined at line {{ firstLine }} (label: `{{ firstLabel }}`).",
            duplicate duplicate footnote^<F First defined at line {{ firstLine }} (label: `{{ firstLabel }}`).",
0Map<string, 0Map()
Map<string1Map();
        return {d7+const firstDefinitionNode = definitions.get.@)node!	`duplica'$node,)label: node+2firstLine: firstDefinitionNode.position.start.line!	firstLabel: firstDefinitionNode'
] else&definitions.set(node.identifier, node) }	Uϓf?;const firstFootnoteDefinitionNode = footnoteDefinitions.get.@)node!	`	duplicate-$node,)label: node.label!	:firstLine: firstFootnoteDefinitionNode.position.start.line!	-firstLabel: firstFootnoteDefinitionNode.label!	1] elseUs.set(node.identifier, node) }	};
    },
});
ku`xdeclare namespace _default {
    namespace meta {
        let type: "problem";
        namespace docs {
            let description: string;
            let url: string;
        }
        namespace messages {
            let duplicateHeading: string;
        }
        let schema: {
            type: "object";
            properties: {
                checkSiblingsOnly: {
                    type: "boolean";
                };
            };
            additionalProperties: false;
        }[];
        let defaultOptions: [{
            checkSiblingsOnly: false;
        }];
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../types.js").MarkdownLanguageOptions;
        Code: import("../index.js").MarkdownSourceCode;
        RuleOptions: NoDuplicateHeadingsOptions;
        Node: import("mdast").Node | import("../language/markdown-source-code.js").InlineConfigComment;
        MessageIds: "duplicateHeading";
    }>): {
        heading(node: import("mdast").Heading): void;
        "heading *"({ type, value }: any): void;
        "heading:exit"(node: import("mdast").Heading): void;
    };
}
export default _default;
export type NoDuplicateHeadingsMessageIds = "duplicateHeading";
export type NoDuplicateHeadingsOptions = [{
    checkSiblingsOnly?: boolean;
}];
export type NoDuplicateHeadingsRuleDefinition = MarkdownRuleDefinition<{
    RuleOptions: NoDuplicateHeadingsOptions;
    MessageIds: NoDuplicateHeadingsMessageIds;
}>;
import type { MarkdownRuleDefinition } from "../types.js";
*x-/**
 * @fileoverview Rule to prevent duplicate headings in Markdown.
 * @author Nicholas C. Zakas
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { MarkdownRuleDefinition } from "../types.js";
 * @typedef {"duplicateHeading"} NoDuplicateHeadingsMessageIds
 * @typedef {[{ checkSiblingsOnly?: boolean }]} NoDuplicateHeadingsOptions
 * @typedef {MarkdownRuleDefinition<{ RuleOptions: NoDuplicateHeadingsOptions, MessageIds: NoDuplicateHeadingsMessageIds }>} NoDuplicateHeadingsRuleDefinition
 */
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {NoDuplicateHeadingsRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            description: "Disallow duplicate headings in the same document",
            url: "https://github.com/eslint/markdown/blob/main/docs/rules/no-duplicate-headings.md",
        },
        messages: {
            duplicateHeading: 'Duplicate heading "{{text}}" found.',
        },
        schema: [
            {
                type: "object",
                properties: {
                    checkSiblingsOnly: {
                        type: "boolean",
                    },
                },
                additionalProperties: false,
            },
        ],
        defaultOptions: [{ checkSiblingsOnly: false }],
    },
    create(context) {
        const [{ checkSiblingsOnly }] = context.options;
        /** @type {Map<number, Set<string>>} */
        const headingsByLevel = checkSiblingsOnly
            ? new Map([
                [1, new Set()],
                [2, new Set()],
                [3, new Set()],
                [4, new Set()],
                [5, new Set()],
                [6, new Set()],
            ])
            : new Map([[1, new Set()]]);
        let lastLevel = 1;
        let currentLevelHeadings = headingsByLevel.get(lastLevel);
        /** @type {string} */
        let headingChildrenSequence;
        /** @type {string} */
        let headingText;
        return {
            heading(node) {
                headingChildrenSequence = "";
                headingText = "";
                if (checkSiblingsOnly) {
                    const currentLevel = node.depth;
                    if (currentLevel < lastLevel) {
                        for (let level = lastLevel; level > currentLevel; level--) {
                            headingsByLevel.get(level).clear();
                        }
                    }
                    lastLevel = currentLevel;
                    currentLevelHeadings = headingsByLevel.get(currentLevel);
                }
            },
            "heading *"({ type, value }) {
                if (value) {
                    headingChildrenSequence += `[${type},${value}]`; // We use a custom sequence representation to keep track of heading children.
                    if (type !== "html") {
                        headingText += value;
                    }
                }
                else {
                    headingChildrenSequence += `[${type}]`;
                }
            },
            "heading:exit"(node) {
                if (currentLevelHeadings.has(headingChildrenSequence)) {
                    context.report({
                        loc: node.position,
                        messageId: "duplicateHeading",
                        data: {
                            text: headingText,
                        },
                    });
                }
                else {
                    currentLevelHeadings.add(headingChildrenSequence);
                }
            },
        };
    },
});

]x Kempty?    let empty7dEmptyEmpty_	P3x_xx,Empty_	 = "emptyDefinition" | "empty#EmptyCEmptyHEmptyK	Empty_	)	-t9xj/**
 * @fileoverview Rule to prevent empty definitions in Markdown.
 * @author Pixel998
 */
//-----------------------------------------------------------------------------
// Imports
//-----------------------------------------------------------------------------
import { normalizeIdentifier } from "micromark-util-normalize-identifier";
import { htmlCommentPattern } from "../util.js";
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { MarkdownRuleDefinition } from "../types.js";
 * @typedef {"emptyDefinition" | "emptyFootnoteDefinition"} NoEmptyDefinitionsMessageIds
 * @typedef {[{ allowDefinitions?: string[], allowFootnoteDefinitions?: string[], checkFootnoteDefinitions?: boolean }]} NoEmptyDefinitionsOptions
 * @typedef {MarkdownRuleDefinition<{ RuleOptions: NoEmptyDefinitionsOptions, MessageIds: NoEmptyDefinitionsMessageIds }>} NoEmptyDefinitionsRuleDefinition
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
/**
 * Checks if a string contains only HTML comments.
 * @param {string} value The input string to check.
 * @returns {boolean} True if the string contains only HTML comments, false otherwise.
 */
function isOnlyComments(value) {
    const withoutComments = value.replace(htmlCommentPattern, "");
    return withoutComments.trim().length === 0;
}
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {NoEmptyDefinitionsRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            recommended: true,
            description: "Disallow empty definitions",
            url: "https://github.com/eslint/markdown/blob/main/docs/rules/no-empty-definitions.md",
        },
        messages: {
            emptyDefinition: "Unexpected empty definition `{{ identifier }}` (label: `{{ label }}`) found.",
            emptyFootnoteDefinition: "Unexpected empty footnote definition `{{ identifier }}` (label: `{{ label }}`) found.",
        },
        schema: [
            {
                type: "object",
                properties: {
                    allowDefinitions: {
                        type: "array",
                        items: {
                            type: "string",
                        },
                        uniqueItems: true,
                    },
                    allowFootnoteDefinitions: {
                        type: "array",
                        items: {
                            type: "string",
                        },
                        uniqueItems: true,
                    },
                    checkFootnoteDefinitions: {
                        type: "boolean",
                    },
                },
                additionalProperties: false,
            },
        ],
        defaultOptions: [
            {
                allowDefinitions: ["//"],
                allowFootnoteDefinitions: [],
                checkFootnoteDefinitions: true,
            },
        ],
    },
    create(context) {
        const allowDefinitions = new Set(context.options[0].allowDefinitions.map(identifier => normalizeIdentifier(identifier).toLowerCase()));
        const allowFootnoteDefinitions = new Set(context.options[0].allowFootnoteDefinitions.map(identifier => normalizeIdentifier(identifier).toLowerCase()));
        const [{ checkFootnoteDefinitions }] = context.options;
        return {
            definition(node) {
                if ((!node.url || node.url === "#") &&
                    !allowDefinitions.has(node.identifier)) {
                    context.report({
                        loc: node.position,
                        messageId: "emptyDefinition",
                        data: {
                            identifier: node.identifier,
                            label: node.label.trim(),
                        },
                    });
                }
            },
            footnoteDefinition(node) {
                if (checkFootnoteDefinitions &&
                    !allowFootnoteDefinitions.has(node.identifier) &&
                    (node.children.length === 0 ||
                        node.children.every(child => child.type === "html" &&
                            isOnlyComments(child.value)))) {
                    context.report({
                        loc: node.position,
                        messageId: "emptyFootnoteDefinition",
                        data: {
                            identifier: node.identifier,
                            label: node.label,
                        },
                    });
                }
            },
        };
    },
});
5Axdeclare namespace _default {
    namespace meta {
        let type: "problem";
        namespace docs {
            let recommended: boolean;
            let description: string;
            let url: string;
        }
        namespace messages {
            let emptyImage: string;
        }
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../types.js").MarkdownLanguageOptions;
        Code: import("../index.js").MarkdownSourceCode;
        RuleOptions: [];
        Node: import("mdast").Node | import("../language/markdown-source-code.js").InlineConfigComment;
        MessageIds: "emptyImage";
    }>): {
        image(node: import("mdast").Image): void;
    };
}
export default _default;
export type NoEmptyImagesMessageIds = "emptyImage";
export type NoEmptyImagesOptions = [];
export type NoEmptyImagesRuleDefinition = MarkdownRuleDefinition<{
    RuleOptions: NoEmptyImagesOptions;
    MessageIds: NoEmptyImagesMessageIds;
}>;
import type { MarkdownRuleDefinition } from "../types.js";
'O\x2/**
 * @fileoverview Rule to prevent empty images in Markdown.
 * @author 루밀LuMir(lumirlumir)
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { MarkdownRuleDefinition } from "../types.js";
 * @typedef {"emptyImage"} NoEmptyImagesMessageIds
 * @typedef {[]} NoEmptyImagesOptions
 * @typedef {MarkdownRuleDefinition<{ RuleOptions: NoEmptyImagesOptions, MessageIds: NoEmptyImagesMessageIds }>} NoEmptyImagesRuleDefinition
 */
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {NoEmptyImagesRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            recommended: true,
            description: "Disallow empty images",
            url: "https://github.com/eslint/markdown/blob/main/docs/rules/no-empty-images.md",
        },
        messages: {
            emptyImage: "Unexpected empty image found.",
        },
    },
    create(context) {
        return {
            image(node) {
                if (!node.url || node.url === "#") {
                    context.report({
                        loc: node.position,
                        messageId: "emptyImage",
                    });
                }
            },
        };
    },
});
=V@xdeclare namespace _default {
    namespace meta {
        let type: "problem";
        namespace docs {
            let recommended: boolean;
            let description: string;
            let url: string;
        }
        namespace messages {
            let emptyLink: string;
        }
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../types.js").MarkdownLanguageOptions;
        Code: import("../index.js").MarkdownSourceCode;
        RuleOptions: [];
        Node: import("mdast").Node | import("../language/markdown-source-code.js").InlineConfigComment;
        MessageIds: "emptyLink";
    }>): {
        link(node: import("mdast").Link): void;
    };
}
export default _default;
export type NoEmptyLinksMessageIds = "emptyLink";
export type NoEmptyLinksOptions = [];
export type NoEmptyLinksRuleDefinition = MarkdownRuleDefinition<{
    RuleOptions: NoEmptyLinksOptions;
    MessageIds: NoEmptyLinksMessageIds;
}>;
import type { MarkdownRuleDefinition } from "../types.js";
HLP[xF/**
 * @fileoverview Rule to prevent empty links in Markdown.
 * @author Nicholas C. Zakas
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { MarkdownRuleDefinition } from "../types.js";
 * @typedef {"emptyLink"} NoEmptyLinksMessageIds
 * @typedef {[]} NoEmptyLinksOptions
 * @typedef {MarkdownRuleDefinition<{ RuleOptions: NoEmptyLinksOptions, MessageIds: NoEmptyLinksMessageIds }>} NoEmptyLinksRuleDefinition
 */
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {NoEmptyLinksRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            recommended: true,
            description: "Disallow empty links",
            url: "https://github.com/eslint/markdown/blob/main/docs/rules/no-empty-links.md",
        },
        messages: {
            emptyLink: "Unexpected empty link found.",
        },
    },
    create(context) {
        return {
            link(node) {
                if (!node.url || node.url === "#") {
                    context.report({
                        loc: node.position,
                        messageId: "emptyLink",
                    });
                }
            },
        };
    },
});
+exXdeclare namespace _default {
    namespace meta {
        let type: "problem";
        namespace docs {
            let description: string;
            let url: string;
        }
        namespace messages {
            let disallowedElement: string;
        }
        let schema: {
            type: "object";
            properties: {
                allowed: {
                    type: "array";
                    items: {
                        type: "string";
                    };
                    uniqueItems: true;
                };
                allowedIgnoreCase: {
                    type: "boolean";
                };
            };
            additionalProperties: false;
        }[];
        let defaultOptions: [{
            allowed: any[];
            allowedIgnoreCase: false;
        }];
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../types.js").MarkdownLanguageOptions;
        Code: import("../index.js").MarkdownSourceCode;
        RuleOptions: NoHtmlOptions;
        Node: import("mdast").Node | import("../language/markdown-source-code.js").InlineConfigComment;
        MessageIds: "disallowedElement";
    }>): {
        html(node: import("mdast").Html): void;
    };
}
export default _default;
export type NoHtmlMessageIds = "disallowedElement";
export type NoHtmlOptions = [{
    allowed?: string[];
    allowedIgnoreCase?: boolean;
}];
export type NoHtmlRuleDefinition = MarkdownRuleDefinition<{
    RuleOptions: NoHtmlOptions;
    MessageIds: NoHtmlMessageIds;
}>;
import type { MarkdownRuleDefinition } from "../types.js";
5x5/**
 * @fileoverview Rule to disallow HTML inside of content.
 * @author Nicholas C. Zakas
 */
//-----------------------------------------------------------------------------
// Imports
//-----------------------------------------------------------------------------
import { lineEndingPattern, stripHtmlComments } from "../util.js";
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { MarkdownRuleDefinition } from "../types.js";
 * @typedef {"disallowedElement"} NoHtmlMessageIds
 * @typedef {[{ allowed?: string[], allowedIgnoreCase?: boolean }]} NoHtmlOptions
 * @typedef {MarkdownRuleDefinition<{ RuleOptions: NoHtmlOptions, MessageIds: NoHtmlMessageIds }>} NoHtmlRuleDefinition
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
const htmlTagPattern = /<(?<tagName>[a-z0-9]+(?:-[a-z0-9]+)*)(?:\s(?:[^>"']|"[^"]*"|'[^']*')*)?\/?>/giu;
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {NoHtmlRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            description: "Disallow HTML tags",
            url: "https://github.com/eslint/markdown/blob/main/docs/rules/no-html.md",
        },
        messages: {
            disallowedElement: 'HTML element "{{name}}" is not allowed.',
        },
        schema: [
            {
                type: "object",
                properties: {
                    allowed: {
                        type: "array",
                        items: {
                            type: "string",
                        },
                        uniqueItems: true,
                    },
                    allowedIgnoreCase: {
                        type: "boolean",
                    },
                },
                additionalProperties: false,
            },
        ],
        defaultOptions: [
            {
                allowed: [],
                allowedIgnoreCase: false,
            },
        ],
    },
    create(context) {
        const { sourceCode } = context;
        const [{ allowed, allowedIgnoreCase }] = context.options;
        /**
         * Normalize a tag name based on the `allowedIgnoreCase` option.
         * @param {string} tagName The tag name to normalize.
         * @returns {string} The normalized tag name.
         */
        function normalizeTagName(tagName) {
            return allowedIgnoreCase ? tagName.toLowerCase() : tagName;
        }
        const allowedElements = new Set(allowed.map(normalizeTagName));
        return {
            html(node) {
                const text = stripHtmlComments(sourceCode.getText(node));
                /** @type {RegExpExecArray | null} */
                let match;
                while ((match = htmlTagPattern.exec(text)) !== null) {
                    const fullMatch = match[0];
                    const { tagName } = match.groups;
                    const firstNewlineIndex = fullMatch.search(lineEndingPattern);
                    const startOffset = // Adjust `htmlTagPattern` match index to the full source code.
                     match.index + node.position.start.offset;
                    const endOffset = startOffset +
                        (firstNewlineIndex === -1
                            ? fullMatch.length
                            : firstNewlineIndex);
                    if (!allowedElements.has(normalizeTagName(tagName))) {
                        context.report({
                            loc: {
                                start: sourceCode.getLocFromIndex(startOffset),
                                end: sourceCode.getLocFromIndex(endOffset),
                            },
                            messageId: "disallowedElement",
                            data: {
                                name: tagName,
                            },
                        });
                    }
                }
            },
        };
    },
});
yLkxGdeclare namespace _default {
    namespace meta {
        let type: "problem";
        namespace docs {
            let recommended: boolean;
            let description: string;
            let url: string;
        }
        let schema: {
            type: "object";
            properties: {
                allowLabels: {
                    type: "array";
                    items: {
                        type: "string";
                    };
                    uniqueItems: true;
                };
            };
            additionalProperties: false;
        }[];
        let defaultOptions: [{
            allowLabels: any[];
        }];
        namespace messages {
            let notFound: string;
        }
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../types.js").MarkdownLanguageOptions;
        Code: MarkdownSourceCode;
        RuleOptions: NoMissingLabelRefsOptions;
        Node: import("mdast").Node | import("../language/markdown-source-code.js").InlineConfigComment;
        MessageIds: "notFound";
    }>): {
        "root:exit"(): void;
        text(node: Text): void;
        definition(node: import("mdast").Definition): void;
    };
}
export default _default;
export type NoMissingLabelRefsMessageIds = "notFound";
export type NoMissingLabelRefsOptions = [{
    allowLabels?: string[];
}];
export type NoMissingLabelRefsRuleDefinition = MarkdownRuleDefinition<{
    RuleOptions: NoMissingLabelRefsOptions;
    MessageIds: NoMissingLabelRefsMessageIds;
}>;
import type { MarkdownSourceCode } from "../language/markdown-source-code.js";
import type { Text } from "mdast";
import type { MarkdownRuleDefinition } from "../types.js";
pjEx 	ⓖ%invalidLabelRef[]invalidLabelRef";
    }>): {d%,InvalidLabelRefsMessageIds = "invalidLabelRef";
export type NoInvalidLabelRefsOptions = [];
export type NoInvalidLabelRefsRuleD8Invalid$InvalidƂ4SŶx/**
 * @fileoverview Rule to prevent missing label references in Markdown.
 * @author Nicholas C. Zakas
 */
//-----------------------------------------------------------------------------
// Imports
//-----------------------------------------------------------------------------
import { illegalShorthandTailPattern } from "../util.js";
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { Position } from "unist";
 * @import { Text } from "mdast";
 * @import { MarkdownRuleDefinition } from "../types.js";
 * @import { MarkdownSourceCode } from "../language/markdown-source-code.js";
 * @typedef {"notFound"} NoMissingLabelRefsMessageIds
 * @typedef {[{ allowLabels?: string[] }]} NoMissingLabelRefsOptions
 * @typedef {MarkdownRuleDefinition<{ RuleOptions: NoMissingLabelRefsOptions, MessageIds: NoMissingLabelRefsMessageIds }>} NoMissingLabelRefsRuleDefinition
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
/**
 * Finds missing references in a node.
 * @param {Text} node The node to check.
 * @param {MarkdownSourceCode} sourceCode The Markdown source code object.
 * @returns {Array<{label:string,position:Position}>} The missing references.
 */
function findMissingReferences(node, sourceCode) {
    /** @type {Array<{label:string,position:Position}>} */
    const missing = [];
    const nodeText = sourceCode.getText(node);
    /**
     * Matches substrings like `"[foo]"`, `"[]"`, `"[foo][bar]"`, `"[foo][]"`, `"[][bar]"`, or `"[][]"`.
     * `left` is the content between the first brackets. It can be empty.
     * `right` is the content between the second brackets. It can be empty, and it can be undefined.
     */
    const labelPattern = /(?<=(?<!\\)(?:\\{2})*)\[(?<left>(?:\\.|[^[\]\\])*)\](?:\[(?<right>(?:\\.|[^\]\\])*)\])?/dgu;
    /** @type {RegExpExecArray | null} */
    let match;
    /*
     * This loop searches the text inside the node for sequences that
     * look like label references and reports an error for each one found.
     */
    while ((match = labelPattern.exec(nodeText))) {
        // skip illegal shorthand tail -- handled by no-invalid-label-refs
        if (illegalShorthandTailPattern.test(match[0])) {
            continue;
        }
        const { left, right } = match.groups;
        // `[][]` or `[]`
        if (!left && !right) {
            continue;
        }
        let label, labelIndices;
        if (right) {
            label = right;
            labelIndices = match.indices.groups.right;
        }
        else {
            label = left;
            labelIndices = match.indices.groups.left;
        }
        const startOffset = labelIndices[0] + node.position.start.offset;
        const endOffset = labelIndices[1] + node.position.start.offset;
        missing.push({
            label: label.trim(),
            position: {
                start: sourceCode.getLocFromIndex(startOffset),
                end: sourceCode.getLocFromIndex(endOffset),
            },
        });
    }
    return missing;
}
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {NoMissingLabelRefsRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            recommended: true,
            description: "Disallow missing label references",
            url: "https://github.com/eslint/markdown/blob/main/docs/rules/no-missing-label-refs.md",
        },
        schema: [
            {
                type: "object",
                properties: {
                    allowLabels: {
                        type: "array",
                        items: {
                            type: "string",
                        },
                        uniqueItems: true,
                    },
                },
                additionalProperties: false,
            },
        ],
        defaultOptions: [
            {
                allowLabels: [],
            },
        ],
        messages: {
            notFound: "Label reference '{{label}}' not found.",
        },
    },
    create(context) {
        const { sourceCode } = context;
        const allowLabels = new Set(context.options[0].allowLabels);
        /** @type {Array<{label:string,position:Position}>} */
        let allMissingReferences = [];
        return {
            "root:exit"() {
                for (const missingReference of allMissingReferences) {
                    context.report({
                        loc: missingReference.position,
                        messageId: "notFound",
                        data: {
                            label: missingReference.label,
                        },
                    });
                }
            },
            text(node) {
                const missingReferences = findMissingReferences(node, sourceCode);
                for (const missingReference of missingReferences) {
                    if (!allowLabels.has(missingReference.label)) {
                        allMissingReferences.push(missingReference);
                    }
                }
            },
            definition(node) {
                /*
                 * Sometimes a poorly-formatted link will end up a text node instead of a link node
                 * even though the label definition exists. Here, we remove any missing references
                 * that have a matching label definition.
                 */
                allMissingReferences = allMissingReferences.filter(missingReference => missingReference.label !== node.identifier);
            },
        };
    },
});
G<tT{$xF.%%non-complaint link referencesIinvalidLabelRef"} NoInvalid"]} NoInvalidCFInvalid (InvalidLabelRefsMessageIds }>} NoInvalid matches i.e., `[foo][bar]` */
q\]\[([^\]]+)\]/u;InvalidLabel#/Oconst docText = sourceCode.text;
    const invalid = [];
    let startIndex = 0works by searching the string inside the node for the next
     * label reference. If it finds one, it checks to see if there is any
     * white space between the [ and ]. If there is, it reports an error.
     * It then moves the start index to the end\ of the label reference and
     * continues searching the text until the end of the text isstartIndex < nodeText.length) {
        const value = nodeText.slice(startIndex);
        const match = value.match(labelPatter+n);
        if (!match) {
            break
if (! c	,startIndex += match.index + match[0].length;	)I/*
         * Adjust `labelPattern` match index to the full source code.
a startIndex + match.index'jstartOffset + match[0].length;
        /*
         * Search the entire document text to find the preceding open bracket.
      gconst lastOpenBracketIndex = docText.lastIndexOf("[", startOffset);
        if (lastOpenBracketIndex === -1) {
            star(tIndex += match.index + match[0].length;	)/*
         * Note: `label` can contain leading and trailing newlines, so we need to
         * take that into account when cal&culating the line and column offsets.
aconst label = docText
            .slice(lastOpenBracketIndex, endOffset)
            .match(/!?\[([^\]]+)\]/u)[1];
        inv
alid.push(Q
e + 17^L    startIndex += match.index + match[0].length;
    }
    return invalid;
}PTInvalidinvalid%ainvalid$invalidLabelRef-is invalid due to white space between [ and ]\#$invalidReferences = findInvalidLabel9invalidReference of invalidmPinvalid8invalidLabelRef",q+invalidQmL=+SxO
let fixable: "whitespace";5SpaceB6type: "object";
            properties: {
                checkClosedHeadings: {
                    type: "boolean";
         @       };
            };
            additionalProperties: false,3{
            checkClosedHeadings: false;
        }NoMissingAtxHeadingSpace"missingSpace"A_heading(node: import("mdast").Heading): void;
        paragraph(node: import("mdast").Paragraphu7NoMissingAtxHeadingSpaceMessageIds = "missingSpace";
export type NoMissingAtxHeadingSpaceOptions = [{
    checkClosedHeadings?:2 boolean;
}];
export type NoMissingAtxHeadingSpaceE;NoMissingAtxHeadingSpaceNoMissingAtxHeadingSpaceKu܆xX/**
 * @fileoverview Rule to ensure there is a space after hash on ATX style headings in Markdown.
 * @author Sweta Tanwar (@SwetaTanwar)
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { MarkdownRuleDefinition } from "../types.js";
 * @typedef {"missingSpace"} NoMissingAtxHeadingSpaceMessageIds
 * @typedef {[{ checkClosedHeadings?: boolean }]} NoMissingAtxHeadingSpaceOptions
 * @typedef {MarkdownRuleDefinition<{ RuleOptions: NoMissingAtxHeadingSpaceOptions, MessageIds: NoMissingAtxHeadingSpaceMessageIds }>} NoMissingAtxHeadingSpaceRuleDefinition
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
const leadingAtxHeadingHashPattern = /(?:^|(?<=[\r\n]))(?<hashes>#{1,6})(?:[^# \t]|$)/gu;
const trailingAtxHeadingHashPattern = /(?<![ \t])(?<spaces>[ \t]*)(?<=(?<!\\)(?:\\{2})*)(?<hashes>#+)[ \t]*$/u;
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {NoMissingAtxHeadingSpaceRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            recommended: true,
            description: "Disallow headings without a space after the hash characters",
            url: "https://github.com/eslint/markdown/blob/main/docs/rules/no-missing-atx-heading-space.md",
        },
        fixable: "whitespace",
        messages: {
            missingSpace: "Missing space {{position}} hash(es) on ATX style heading.",
        },
        schema: [
            {
                type: "object",
                properties: {
                    checkClosedHeadings: {
                        type: "boolean",
                    },
                },
                additionalProperties: false,
            },
        ],
        defaultOptions: [{ checkClosedHeadings: false }],
    },
    create(context) {
        const { sourceCode } = context;
        const [{ checkClosedHeadings }] = context.options;
        return {
            heading(node) {
                if (!checkClosedHeadings) {
                    return;
                }
                const text = sourceCode.getText(node);
                const match = trailingAtxHeadingHashPattern.exec(text);
                if (match === null) {
                    return;
                }
                const { spaces, hashes } = match.groups;
                if (spaces.length > 0) {
                    return;
                }
                const startOffset = node.position.start.offset + match.index;
                const endOffset = startOffset + hashes.length;
                context.report({
                    loc: {
                        start: sourceCode.getLocFromIndex(startOffset - 1),
                        end: sourceCode.getLocFromIndex(endOffset),
                    },
                    messageId: "missingSpace",
                    data: { position: "before" },
                    fix(fixer) {
                        return fixer.insertTextBeforeRange([startOffset, startOffset + 1], " ");
                    },
                });
            },
            paragraph(node) {
                const text = sourceCode.getText(node);
                /** @type {RegExpExecArray | null} */
                let match;
                while ((match = leadingAtxHeadingHashPattern.exec(text)) !== null) {
                    const { hashes } = match.groups;
                    const startOffset = node.position.start.offset + match.index;
                    const endOffset = startOffset + hashes.length;
                    context.report({
                        loc: {
                            start: sourceCode.getLocFromIndex(startOffset),
                            end: sourceCode.getLocFromIndex(endOffset + 1),
                        },
                        messageId: "missingSpace",
                        data: { position: "after" },
                        fix(fixer) {
                            return fixer.insertTextAfterRange([endOffset - 1, endOffset], " ");
                        },
                    });
                }
            },
        };
    },
});
5^xdeclare namespace _default {
    namespace meta {
        let type: "problem";
        namespace docs {
            let recommended: boolean;
            let description: string;
            let url: string;
        }
        namespace messages {
            let extraCells: string;
            let missingCells: string;
        }
        let schema: {
            type: "object";
            properties: {
                checkMissingCells: {
                    type: "boolean";
                };
            };
            additionalProperties: false;
        }[];
        let defaultOptions: [{
            checkMissingCells: false;
        }];
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../types.js").MarkdownLanguageOptions;
        Code: import("../index.js").MarkdownSourceCode;
        RuleOptions: TableColumnCountOptions;
        Node: import("mdast").Node | import("../language/markdown-source-code.js").InlineConfigComment;
        MessageIds: TableColumnCountMessageIds;
    }>): {
        table(node: import("mdast").Table): void;
    };
}
export default _default;
export type TableColumnCountMessageIds = "extraCells" | "missingCells";
export type TableColumnCountOptions = [{
    checkMissingCells?: boolean;
}];
export type TableColumnCountRuleDefinition = MarkdownRuleDefinition<{
    RuleOptions: TableColumnCountOptions;
    MessageIds: TableColumnCountMessageIds;
}>;
import type { MarkdownRuleDefinition } from "../types.js";
І/qx
ST
ignoreCaseH    allowPatternstringc%invalidFragment7 E2ignoreCase: true;
            allowPattern: string|NoMissingLinkFragmentss"invalidFragment";
    }>): {
        heading(): void;
        "heading *:not(html)"({ value }: any): void;
        "heading:exit"(): void;
        html(node: import("mdast").Html): void;
        "definition, link"(node: Definition | Link): void;
        "root:exit"(H7NoMissingLinkFragmentsMessageIds = "invalidFragment";
export type NoMissingLinkFragmentsOptions = [{
    ignoreCase?: boolean;
A    allowPattern?: string;
}];
export type NoMissingLinkFragments%;NoMissingLinkFragmentspNoMissingLinkFragments<Definition } from "mdast";
import type { Link } from "mdast"=yPx~/**
 * @fileoverview Rule to ensure link fragments (URLs that start with #) reference valid headings
 * @author Sweta Tanwar (@SwetaTanwar)
 */
//-----------------------------------------------------------------------------
// Imports
//-----------------------------------------------------------------------------
import GithubSlugger from "github-slugger";
import { stripHtmlComments } from "../util.js";
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { Definition, Link } from "mdast";
 * @import { MarkdownRuleDefinition } from "../types.js";
 * @typedef {"invalidFragment"} NoMissingLinkFragmentsMessageIds
 * @typedef {[{ ignoreCase?: boolean; allowPattern?: string }]} NoMissingLinkFragmentsOptions
 * @typedef {MarkdownRuleDefinition<{ RuleOptions: NoMissingLinkFragmentsOptions, MessageIds: NoMissingLinkFragmentsMessageIds }>} NoMissingLinkFragmentsRuleDefinition
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
const githubLineReferencePattern = /^L\d+(?:C\d+)?(?:-L\d+(?:C\d+)?)?$/u;
const customHeadingIdPattern = /\{#(?<id>[^}\s]+)\}\s*$/u;
const htmlHeadingPattern = /<h(?<depth>[1-6])[^>]*>(?<children>[\s\S]*?)<\/h\k<depth>\s*>/giu;
const htmlIdNamePattern = /(?<!<)<[^>]+\s(?:id|name)\s*=\s*["']?(?<id>[^"'\s>]+)["']?/giu;
const htmlTagPattern = /<\/?[a-z0-9]+(?:-[a-z0-9]+)*(?:\s(?:[^>"']|"[^"]*"|'[^']*')*)?(?:\/\s*)?>/giu;
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {NoMissingLinkFragmentsRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            recommended: true,
            description: "Disallow link fragments that do not reference valid headings",
            url: "https://github.com/eslint/markdown/blob/main/docs/rules/no-missing-link-fragments.md",
        },
        schema: [
            {
                type: "object",
                properties: {
                    ignoreCase: {
                        type: "boolean",
                    },
                    allowPattern: {
                        type: "string",
                    },
                },
                additionalProperties: false,
            },
        ],
        messages: {
            invalidFragment: "Link fragment '#{{fragment}}' does not reference a heading or anchor in this document.",
        },
        defaultOptions: [
            {
                ignoreCase: true,
                allowPattern: "",
            },
        ],
    },
    create(context) {
        const [{ allowPattern, ignoreCase }] = context.options;
        const allowPatternOrNull = allowPattern
            ? new RegExp(allowPattern, "u")
            : null;
        const fragmentIds = new Set(["top"]);
        const slugger = new GithubSlugger();
        /** @type {Array<Definition | Link>} */
        const relevantNodes = [];
        /** @type {string} */
        let headingText;
        return {
            heading() {
                headingText = "";
            },
            "heading *:not(html)"({ value }) {
                headingText += value ?? "";
            },
            "heading:exit"() {
                const customIdMatch = headingText.match(customHeadingIdPattern);
                const id = customIdMatch
                    ? customIdMatch.groups.id
                    : headingText;
                fragmentIds.add(slugger.slug(id));
            },
            html(node) {
                // 1. Remove all comments
                const htmlTextWithoutComments = stripHtmlComments(node.value);
                // 2. Then look for IDs in the remaining text
                for (const match of htmlTextWithoutComments.matchAll(htmlIdNamePattern)) {
                    const { id } = match.groups;
                    fragmentIds.add(slugger.slug(id));
                }
                // 3. Finally, look for headings in the HTML
                for (const match of htmlTextWithoutComments.matchAll(htmlHeadingPattern)) {
                    const { children } = match.groups;
                    // Remove any HTML tags within the heading content to get plain text
                    const id = children.replace(htmlTagPattern, "");
                    fragmentIds.add(slugger.slug(id));
                }
            },
            "definition, link"(/** @type {Definition | Link} */ node) {
                const { url } = node;
                // If `url` is empty, `"#"`, or does not start with `"#"`, skip it.
                if (url === "" || url === "#" || !url.startsWith("#")) {
                    return;
                }
                relevantNodes.push(node);
            },
            "root:exit"() {
                for (const node of relevantNodes) {
                    const fragment = node.url.slice(1);
                    let decodedFragment = fragment;
                    // Decode URI component to handle encoded characters such as `%20`.
                    try {
                        decodedFragment = decodeURIComponent(fragment);
                    }
                    catch {
                        // If decoding fails due to an invalid URI sequence, use the original fragment.
                    }
                    if (allowPatternOrNull?.test(decodedFragment) ||
                        githubLineReferencePattern.test(decodedFragment)) {
                        continue;
                    }
                    const normalizedFragment = ignoreCase
                        ? decodedFragment.toLowerCase()
                        : decodedFragment;
                    if (!fragmentIds.has(normalizedFragment)) {
                        context.report({
                            loc: node.position,
                            messageId: "invalidFragment",
                            data: { fragment },
                        });
                    }
                }
            },
        };
    },
});
掼fxhdeclare namespace _default {
    namespace meta {
        let type: "problem";
        namespace docs {
            let recommended: boolean;
            let description: string;
            let url: string;
        }
        namespace messages {
            let multipleH1: string;
        }
        let schema: {
            type: "object";
            properties: {
                frontmatterTitle: {
                    type: "string";
                };
            };
            additionalProperties: false;
        }[];
        let defaultOptions: [{
            frontmatterTitle: string;
        }];
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../types.js").MarkdownLanguageOptions;
        Code: import("../index.js").MarkdownSourceCode;
        RuleOptions: NoMultipleH1Options;
        Node: import("mdast").Node | import("../language/markdown-source-code.js").InlineConfigComment;
        MessageIds: "multipleH1";
    }>): {
        "yaml, toml, json"(node: Yaml | Toml | Json): void;
        html(node: import("mdast").Html): void;
        heading(node: import("mdast").Heading): void;
    };
}
export default _default;
export type NoMultipleH1MessageIds = "multipleH1";
export type NoMultipleH1Options = [{
    frontmatterTitle?: string;
}];
export type NoMultipleH1RuleDefinition = MarkdownRuleDefinition<{
    RuleOptions: NoMultipleH1Options;
    MessageIds: NoMultipleH1MessageIds;
}>;
import type { Yaml } from "mdast";
import type { Toml } from "../types.js";
import type { Json } from "../types.js";
import type { MarkdownRuleDefinition } from "../types.js";
Bxs/**
 * @fileoverview Rule to enforce at most one H1 heading in Markdown.
 * @author Pixel998
 */
//-----------------------------------------------------------------------------
// Imports
//-----------------------------------------------------------------------------
import { frontmatterHasTitle, stripHtmlComments } from "../util.js";
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { Yaml } from "mdast";
 * @import { MarkdownRuleDefinition, Toml, Json } from "../types.js";
 * @typedef {"multipleH1"} NoMultipleH1MessageIds
 * @typedef {[{ frontmatterTitle?: string }]} NoMultipleH1Options
 * @typedef {MarkdownRuleDefinition<{ RuleOptions: NoMultipleH1Options, MessageIds: NoMultipleH1MessageIds }>} NoMultipleH1RuleDefinition
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
const h1TagPattern = /<h1[^>]*>[\s\S]*?<\/h1\s*>/giu;
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {NoMultipleH1RuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            recommended: true,
            description: "Disallow multiple H1 headings in the same document",
            url: "https://github.com/eslint/markdown/blob/main/docs/rules/no-multiple-h1.md",
        },
        messages: {
            multipleH1: "Unexpected additional H1 heading found.",
        },
        schema: [
            {
                type: "object",
                properties: {
                    frontmatterTitle: {
                        type: "string",
                    },
                },
                additionalProperties: false,
            },
        ],
        defaultOptions: [
            {
                frontmatterTitle: "^(?!\\s*['\"]title[:=]['\"])\\s*\\{?\\s*['\"]?title['\"]?\\s*[:=]",
            },
        ],
    },
    create(context) {
        const { sourceCode } = context;
        const [{ frontmatterTitle }] = context.options;
        const titlePattern = frontmatterTitle === "" ? null : new RegExp(frontmatterTitle, "iu");
        let h1Count = 0;
        return {
            "yaml, toml, json"(/** @type {Yaml | Toml | Json} */ node) {
                if (frontmatterHasTitle(node.value, titlePattern)) {
                    h1Count++;
                }
            },
            html(node) {
                const text = stripHtmlComments(node.value);
                /** @type {RegExpExecArray | null} */
                let match;
                while ((match = h1TagPattern.exec(text)) !== null) {
                    h1Count++;
                    if (h1Count > 1) {
                        const startOffset = // Adjust `h1TagPattern` match index to the full source code.
                         match.index + node.position.start.offset;
                        const endOffset = startOffset + match[0].length;
                        context.report({
                            loc: {
                                start: sourceCode.getLocFromIndex(startOffset),
                                end: sourceCode.getLocFromIndex(endOffset),
                            },
                            messageId: "multipleH1",
                        });
                    }
                }
            },
            heading(node) {
                if (node.depth === 1) {
                    h1Count++;
                    if (h1Count > 1) {
                        context.report({
                            loc: node.position,
                            messageId: "multipleH1",
                        });
                    }
                }
            },
        };
    },
});
ȭ4xw
let fixable: "code";.#referenceLikeUrl: string;
        }[]~"referenceLikeUrl";
    }>): {*ximage, link"(node: Image | LinkVReferenceLikeUrlsMessageIds = "referenceLikeUrl";
export type NoReferenceLikeUrlsOptions = [];
export type NoReferenceLikeUrlsR<ReferenceLikeUrl=	ReferenceLikeUrli	(Image } from "mdast";
import type { Link	L̓4zxW- ]enforce reference-style links when URL matches a defined identifier.
 * @author TKDev7
 */
//
K--
// Imports
//
KP--
import { normalizeIdentifier } from "micromark-util-normalize-identifier";
//
KtxImage, LinkY!referenceLikeUrl"} NoReferenceLik^#ReferenceLikBReferenceLik.ReferenceLikeUrlsMessageIds }>} NoReferenceLik/** Pattern to match both inline links: `[text](url)` and images: `![alt](url)`, with optional title */
const linkOrImagePattern = /\[(?<label>(?:\\.|[^()\\]|\([\s\S]*\))*?)\]\((?<destination>[ \t]*\r?\n?(?<![ \t])[ \t]*(?:<[^>]*>|[^ \t()]+))(?:[ \t]*\r?W\n?(?<![ \t])[ \t]*(?:"[^"]*"|'[^']*'|\([^)]*\)))?[ \t]*\r?\n?(?<![ \t])[ \t]*\)$/u;
//
K
ReferenceLik1\recommended: true,$,URLs that match defined reference identifierQreference-likPreferenceLikeUrl: "Unexpected resource {{type}} ('{{prefix}}[text](url)') with URL that matches a definition identifier. Use '[text][id]' syntaxg @type {Set<string>} */
        const definitionIdentifiers = new Set();
        /** @type {Array<Image | Link>} */
        const relevantNodes = [];{definition()definitionIdentifiers.add(node.identifier image, link"(/** @type {Image | !relevant0,2*node of relevantl=P*const match = linkOrImagePattern.exec(textif (match !P+const { label, destination } = match.groupsqconst { type, title } = nodeq*const prefix = type === "image" ? "!" : ""q,const url = normalizeIdentifier(destination)	P"if (definitionIdentifiers.has(url)q*Ploc: node.position,!!messageId: "referenceLikeUrl",!!data:  type,!!Pprefix,!!.P`// The AST treats both missing and empty titles as null, so it's safe to auto-fix in both cases.!!Pif (titlAP_ nullqP_H+node, `${prefix}[${label}][${destination}]`PPPP,#5qxdeclare namespace _default {
    namespace meta {
        let type: "problem";
        namespace docs {
            let recommended: boolean;
            let description: string;
            let url: string;
        }
        let fixable: "code";
        namespace messages {
            let reversedSyntax: string;
        }
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../types.js").MarkdownLanguageOptions;
        Code: import("../index.js").MarkdownSourceCode;
        RuleOptions: [];
        Node: import("mdast").Node | import("../language/markdown-source-code.js").InlineConfigComment;
        MessageIds: "reversedSyntax";
    }>): {
        "heading, paragraph, tableCell"(node: Heading | Paragraph | TableCell): void;
        ":matches(heading, paragraph, tableCell) :matches(html, image, imageReference, inlineCode, linkReference, inlineMath)"(node: Html | Image | ImageReference | InlineCode | LinkReference | InlineMath): void;
        ":matches(heading, paragraph, tableCell):exit"(): void;
    };
}
export default _default;
export type NoReversedMediaSyntaxMessageIds = "reversedSyntax";
export type NoReversedMediaSyntaxOptions = [];
export type NoReversedMediaSyntaxRuleDefinition = MarkdownRuleDefinition<{
    RuleOptions: NoReversedMediaSyntaxOptions;
    MessageIds: NoReversedMediaSyntaxMessageIds;
}>;
import type { Heading } from "mdast";
import type { Paragraph } from "mdast";
import type { TableCell } from "mdast";
import type { Html } from "mdast";
import type { Image } from "mdast";
import type { ImageReference } from "mdast";
import type { InlineCode } from "mdast";
import type { LinkReference } from "mdast";
import type { InlineMath } from "mdast-util-math";
import type { MarkdownRuleDefinition } from "../types.js";
Wෞx/**
 * @fileoverview Rule to prevent reversed link and image syntax in Markdown.
 * @author xbinaryx
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { Heading, Paragraph, TableCell, Html, Image, ImageReference, InlineCode, LinkReference } from "mdast";
 * @import { InlineMath } from "mdast-util-math";
 * @import { MarkdownRuleDefinition } from "../types.js";
 * @typedef {"reversedSyntax"} NoReversedMediaSyntaxMessageIds
 * @typedef {[]} NoReversedMediaSyntaxOptions
 * @typedef {MarkdownRuleDefinition<{ RuleOptions: NoReversedMediaSyntaxOptions, MessageIds: NoReversedMediaSyntaxMessageIds }>} NoReversedMediaSyntaxRuleDefinition
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
/** Matches reversed link/image syntax like `(text)[url]`, ignoring escaped characters like `\(text\)[url]`. */
const reversedPattern = /(?<=(?<!\\)(?:\\{2})*)\((?<label>(?:\\.|[^()\\]|\([\s\S]*\))*)\)\[(?<url>(?:\\.|[^\]\\\r\n])*)\](?!\()/gu;
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {NoReversedMediaSyntaxRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            recommended: true,
            description: "Disallow reversed link and image syntax",
            url: "https://github.com/eslint/markdown/blob/main/docs/rules/no-reversed-media-syntax.md",
        },
        fixable: "code",
        messages: {
            reversedSyntax: "Unexpected reversed syntax found. Use [label](URL) syntax instead.",
        },
    },
    create(context) {
        const { sourceCode } = context;
        /** @type {string[]} */
        let buffer;
        /** @type {number} */
        let nodeStartOffset;
        return {
            "heading, paragraph, tableCell"(
            /** @type {Heading | Paragraph | TableCell} */ node) {
                // Use UTF-16 code units so the buffer stays aligned with source offsets.
                buffer = sourceCode.getText(node).split("");
                // Store the start offset of the node for later calculations.
                nodeStartOffset = node.position.start.offset;
            },
            ":matches(heading, paragraph, tableCell) :matches(html, image, imageReference, inlineCode, linkReference, inlineMath)"(
            /** @type {Html | Image | ImageReference | InlineCode | LinkReference | InlineMath} */ node) {
                const [startOffset, endOffset] = sourceCode.getRange(node);
                // Mask the content of `html`, `image`, `imageReference`, `inlineCode`, `linkReference`, and `inlineMath` nodes with whitespaces.
                for (let i = startOffset; i < endOffset; i++) {
                    buffer[i - nodeStartOffset] = " ";
                }
            },
            ":matches(heading, paragraph, tableCell):exit"() {
                const maskedText = buffer.join("");
                /** @type {RegExpExecArray | null} */
                let match;
                while ((match = reversedPattern.exec(maskedText)) !== null) {
                    const { label, url } = match.groups;
                    const startOffset = match.index + nodeStartOffset; // Adjust `reversedPattern` match index to the full source code.
                    const endOffset = startOffset + match[0].length;
                    const labelStartOffset = startOffset + 1; // Skip "("
                    const labelEndOffset = labelStartOffset + label.length;
                    const urlStartOffset = labelEndOffset + 2; // Skip ")["
                    const urlEndOffset = urlStartOffset + url.length;
                    context.report({
                        loc: {
                            start: sourceCode.getLocFromIndex(startOffset),
                            end: sourceCode.getLocFromIndex(endOffset),
                        },
                        messageId: "reversedSyntax",
                        fix(fixer) {
                            return fixer.replaceTextRange([startOffset, endOffset], `[${sourceCode.text.slice(labelStartOffset, labelEndOffset)}](${sourceCode.text.slice(urlStartOffset, urlEndOffset)})`);
                        },
                    });
                }
            },
        };
    },
});
Hb ƸtxHdeclare namespace _default {
    namespace meta {
        let type: "problem";
        namespace docs {
            let recommended: boolean;
            let description: string;
            let url: string;
        }
        let fixable: "whitespace";
        namespace messages {
            let spaceInEmphasis: string;
        }
        let schema: {
            type: "object";
            properties: {
                checkStrikethrough: {
                    type: "boolean";
                };
            };
            additionalProperties: false;
        }[];
        let defaultOptions: [{
            checkStrikethrough: false;
        }];
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../types.js").MarkdownLanguageOptions;
        Code: import("../index.js").MarkdownSourceCode;
        RuleOptions: NoSpaceInEmphasisOptions;
        Node: import("mdast").Node | import("../language/markdown-source-code.js").InlineConfigComment;
        MessageIds: "spaceInEmphasis";
    }>): {
        "heading, paragraph, tableCell"(node: Heading | Paragraph | TableCell): void;
        ":matches(heading, paragraph, tableCell) > text"(node: Text): void;
        ":matches(heading, paragraph, tableCell):exit"(node: Heading | Paragraph | TableCell): void;
    };
}
export default _default;
export type NoSpaceInEmphasisMessageIds = "spaceInEmphasis";
export type NoSpaceInEmphasisOptions = [{
    checkStrikethrough?: boolean;
}];
export type NoSpaceInEmphasisRuleDefinition = MarkdownRuleDefinition<{
    RuleOptions: NoSpaceInEmphasisOptions;
    MessageIds: NoSpaceInEmphasisMessageIds;
}>;
import type { Heading } from "mdast";
import type { Paragraph } from "mdast";
import type { TableCell } from "mdast";
import type { Text } from "mdast";
import type { MarkdownRuleDefinition } from "../types.js";
]+Gx3/**
 * @fileoverview Rule to prevent spaces around emphasis markers in Markdown.
 * @author Pixel998
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { SourceRange } from "@eslint/core";
 * @import { Heading, Paragraph, TableCell, Text } from "mdast";
 * @import { MarkdownRuleDefinition } from "../types.js";
 * @typedef {"spaceInEmphasis"} NoSpaceInEmphasisMessageIds
 * @typedef {[{ checkStrikethrough?: boolean }]} NoSpaceInEmphasisOptions
 * @typedef {MarkdownRuleDefinition<{ RuleOptions: NoSpaceInEmphasisOptions, MessageIds: NoSpaceInEmphasisMessageIds }>} NoSpaceInEmphasisRuleDefinition
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
const whitespacePattern = /[ \t]/u;
/**
 * Creates a marker pattern based on whether strikethrough should be included.
 * @param {boolean} checkStrikethrough Whether to include strikethrough markers.
 * @returns {RegExp} The marker pattern.
 */
function createMarkerPattern(checkStrikethrough) {
    return checkStrikethrough
        ? /(?<=(?<!\\)(?:\\{2})*)(?:\*\*\*|\*\*|\*|___|__|_|~~|~)/gu
        : /(?<=(?<!\\)(?:\\{2})*)(?:\*\*\*|\*\*|\*|___|__|_)/gu;
}
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {NoSpaceInEmphasisRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            recommended: true,
            description: "Disallow spaces around emphasis markers",
            url: "https://github.com/eslint/markdown/blob/main/docs/rules/no-space-in-emphasis.md",
        },
        fixable: "whitespace",
        messages: {
            spaceInEmphasis: "Unexpected space around emphasis marker.",
        },
        schema: [
            {
                type: "object",
                properties: {
                    checkStrikethrough: {
                        type: "boolean",
                    },
                },
                additionalProperties: false,
            },
        ],
        defaultOptions: [
            {
                checkStrikethrough: false,
            },
        ],
    },
    create(context) {
        const { sourceCode } = context;
        const [{ checkStrikethrough }] = context.options;
        const markerPattern = createMarkerPattern(checkStrikethrough);
        /** @type {string[]} */
        let buffer;
        /**
         * Reports a surrounding-space violation if present.
         * @param {number} checkIndex Character index to test for whitespace.
         * @param {number} highlightStartIndex Start index for highlighting.
         * @param {number} highlightEndIndex End index for highlighting.
         * @returns {void}
         */
        function reportWhitespace(checkIndex, highlightStartIndex, highlightEndIndex) {
            if (whitespacePattern.test(sourceCode.text[checkIndex])) {
                context.report({
                    loc: {
                        start: sourceCode.getLocFromIndex(highlightStartIndex),
                        end: sourceCode.getLocFromIndex(highlightEndIndex),
                    },
                    messageId: "spaceInEmphasis",
                    fix(fixer) {
                        return fixer.removeRange([checkIndex, checkIndex + 1]);
                    },
                });
            }
        }
        return {
            "heading, paragraph, tableCell"(
            /** @type {Heading | Paragraph | TableCell} */ node) {
                const [startOffset, endOffset] = sourceCode.getRange(node);
                // Initialize `buffer` with a whitespace-masked character array.
                buffer = new Array(endOffset - startOffset).fill(" ");
            },
            ":matches(heading, paragraph, tableCell) > text"(
            /** @type {Text} */ node) {
                const [startOffset, endOffset] = sourceCode.getRange(node);
                const parentNodeStartOffset = // Parent node can be `Heading`, `Paragraph`, or `TableCell`.
                 sourceCode.getParent(node).position.start.offset;
                // Add the content of a `Text` node into the current buffer at the correct offsets.
                for (let i = startOffset; i < endOffset; i++) {
                    buffer[i - parentNodeStartOffset] = sourceCode.text[i];
                }
            },
            ":matches(heading, paragraph, tableCell):exit"(
            /** @type {Heading | Paragraph | TableCell} */ node) {
                const maskedText = buffer.join("");
                /** @type {Map<string, SourceRange[]>} */
                const markerGroups = new Map();
                /** @type {RegExpExecArray | null} */
                let match;
                while ((match = markerPattern.exec(maskedText)) !== null) {
                    const marker = match[0];
                    const startOffset = // Adjust `markerPattern` match index to the full source code.
                     match.index + node.position.start.offset;
                    const endOffset = startOffset + marker.length;
                    if (!markerGroups.has(marker)) {
                        markerGroups.set(marker, []);
                    }
                    markerGroups.get(marker).push([startOffset, endOffset]);
                }
                for (const group of markerGroups.values()) {
                    for (let i = 0; i < group.length - 1; i += 2) {
                        const startMarker = group[i];
                        reportWhitespace(startMarker[1], startMarker[0], startMarker[1] + 2);
                        const endMarker = group[i + 1];
                        reportWhitespace(endMarker[0] - 1, endMarker[0] - 2, endMarker[1]);
                    }
                }
            },
        };
    },
});
ۏRLx?declare namespace _default {
    namespace meta {
        let type: "problem";
        namespace docs {
            let recommended: boolean;
            let description: string;
            let url: string;
        }
        namespace messages {
            let altTextRequired: string;
        }
    }
    function create(context: import("@eslint/core").RuleContext<{
        LangOptions: import("../types.js").MarkdownLanguageOptions;
        Code: import("../index.js").MarkdownSourceCode;
        RuleOptions: [];
        Node: import("mdast").Node | import("../language/markdown-source-code.js").InlineConfigComment;
        MessageIds: "altTextRequired";
    }>): {
        "image, imageReference"(node: Image | ImageReference): void;
        html(node: import("mdast").Html): void;
    };
}
export default _default;
export type RequireAltTextMessageIds = "altTextRequired";
export type RequireAltTextOptions = [];
export type RequireAltTextRuleDefinition = MarkdownRuleDefinition<{
    RuleOptions: RequireAltTextOptions;
    MessageIds: RequireAltTextMessageIds;
}>;
import type { Image } from "mdast";
import type { ImageReference } from "mdast";
import type { MarkdownRuleDefinition } from "../types.js";
7͹xy/**
 * @fileoverview Rule to require alternative text for images in Markdown.
 * @author Pixel998
 */
//-----------------------------------------------------------------------------
// Imports
//-----------------------------------------------------------------------------
import { stripHtmlComments } from "../util.js";
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { Image, ImageReference } from "mdast";
 * @import { MarkdownRuleDefinition } from "../types.js";
 * @typedef {"altTextRequired"} RequireAltTextMessageIds
 * @typedef {[]} RequireAltTextOptions
 * @typedef {MarkdownRuleDefinition<{ RuleOptions: RequireAltTextOptions, MessageIds: RequireAltTextMessageIds }>} RequireAltTextRuleDefinition
 */
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
const imgTagPattern = /<img(?:\s(?:[^>"']|"[^"]*"|'[^']*')*)?\/?>/giu;
/**
 * Creates a regex to match HTML attributes
 * @param {string} name The attribute name to match
 * @returns {RegExp} Regular expression for matching the attribute
 */
function getHtmlAttributeRe(name) {
    return new RegExp(`\\s${name}(?:\\s*=\\s*['"]([^'"]*)['"])?`, "iu");
}
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {RequireAltTextRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            recommended: true,
            description: "Require alternative text for images",
            url: "https://github.com/eslint/markdown/blob/main/docs/rules/require-alt-text.md",
        },
        messages: {
            altTextRequired: "Alternative text for image is required.",
        },
    },
    create(context) {
        const { sourceCode } = context;
        return {
            "image, imageReference"(
            /** @type {Image | ImageReference} */ node) {
                if (node.alt.trim().length === 0) {
                    context.report({
                        loc: node.position,
                        messageId: "altTextRequired",
                    });
                }
            },
            html(node) {
                const text = stripHtmlComments(sourceCode.getText(node));
                /** @type {RegExpExecArray | null} */
                let match;
                while ((match = imgTagPattern.exec(text)) !== null) {
                    const imgTag = match[0];
                    const ariaHiddenMatch = imgTag.match(getHtmlAttributeRe("aria-hidden"));
                    if (ariaHiddenMatch &&
                        ariaHiddenMatch[1] &&
                        ariaHiddenMatch[1].toLowerCase() === "true") {
                        continue;
                    }
                    const altMatch = imgTag.match(getHtmlAttributeRe("alt"));
                    if (!altMatch ||
                        (altMatch[1] &&
                            altMatch[1].trim().length === 0 &&
                            altMatch[1].length > 0)) {
                        const startOffset = // Adjust `imgTagPattern` match indices to the full source code.
                         match.index + node.position.start.offset;
                        const endOffset = startOffset + imgTag.length;
                        context.report({
                            loc: {
                                start: sourceCode.getLocFromIndex(startOffset),
                                end: sourceCode.getLocFromIndex(endOffset),
                            },
                            messageId: "altTextRequired",
                        });
                    }
                }
            },
        };
    },
});
wx|/**
 * @fileoverview Rule to disallow data rows in a GitHub Flavored Markdown table from having more cells than the header row
 * @author Sweta Tanwar (@SwetaTanwar)
 */
//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------
/**
 * @import { MarkdownRuleDefinition } from "../types.js";
 * @typedef {"extraCells" | "missingCells"} TableColumnCountMessageIds
 * @typedef {[{ checkMissingCells?: boolean }]} TableColumnCountOptions
 * @typedef {MarkdownRuleDefinition<{ RuleOptions: TableColumnCountOptions, MessageIds: TableColumnCountMessageIds }>} TableColumnCountRuleDefinition
 */
//-----------------------------------------------------------------------------
// Rule Definition
//-----------------------------------------------------------------------------
export default /** @satisfies {TableColumnCountRuleDefinition} */ ({
    meta: {
        type: "problem",
        docs: {
            recommended: true,
            description: "Disallow data rows in a GitHub Flavored Markdown table from having more cells than the header row",
            url: "https://github.com/eslint/markdown/blob/main/docs/rules/table-column-count.md",
        },
        messages: {
            extraCells: "Table column count mismatch (Expected: {{expectedCells}}, Actual: {{actualCells}}), extra data starting here will be ignored.",
            missingCells: "Table column count mismatch (Expected: {{expectedCells}}, Actual: {{actualCells}}), row might be missing data.",
        },
        schema: [
            {
                type: "object",
                properties: {
                    checkMissingCells: {
                        type: "boolean",
                    },
                },
                additionalProperties: false,
            },
        ],
        defaultOptions: [{ checkMissingCells: false }],
    },
    create(context) {
        const [{ checkMissingCells }] = context.options;
        return {
            table(node) {
                if (node.children.length < 1) {
                    return;
                }
                const headerRow = node.children[0];
                const expectedCellsLength = headerRow.children.length;
                for (let i = 1; i < node.children.length; i++) {
                    const currentRow = node.children[i];
                    const actualCellsLength = currentRow.children.length;
                    const lastActualCellNode = currentRow.children[actualCellsLength - 1];
                    if (actualCellsLength > expectedCellsLength) {
                        const firstExtraCellNode = currentRow.children[expectedCellsLength];
                        context.report({
                            loc: {
                                start: firstExtraCellNode.position.start,
                                end: lastActualCellNode.position.end,
                            },
                            messageId: "extraCells",
                            data: {
                                actualCells: actualCellsLength,
                                expectedCells: expectedCellsLength,
                            },
                        });
                    }
                    else if (checkMissingCells &&
                        actualCellsLength < expectedCellsLength) {
                        context.report({
                            loc: {
                                start: {
                                    column: lastActualCellNode.position.end.column -
                                        1,
                                    line: lastActualCellNode.position.end.line,
                                },
                                end: currentRow.position.end,
                            },
                            messageId: "missingCells",
                            data: {
                                actualCells: actualCellsLength,
                                expectedCells: expectedCellsLength,
                            },
                        });
                    }
                }
            },
        };
    },
});
[X5ximport type { Node, Data, Literal, Parent, Blockquote, Break, Code, Definition, Emphasis, Heading, Html, Image, ImageReference, InlineCode, Link, LinkReference, List, ListItem, Paragraph, Root, Strong, Text, ThematicBreak, Delete, FootnoteDefinition, FootnoteReference, Table, TableCell, TableRow, Yaml } from "mdast";
import type { InlineMath, Math } from "mdast-util-math";
import type { LanguageContext, LanguageOptions, RuleVisitor } from "@eslint/core";
import type { CustomRuleDefinitionType, CustomRuleTypeDefinitions, CustomRuleVisitorWithExit } from "@eslint/plugin-kit";
import type { InlineConfigComment, MarkdownSourceCode } from "./language/markdown-source-code.js";
export interface RangeMap {
    indent: number;
    js: number;
    md: number;
}
export interface BlockBase {
    baseIndentText: string;
    comments: string[];
    rangeMap: RangeMap[];
}
export type Block = Code & BlockBase;
/**
 * Markdown TOML.
 */
export interface Toml extends Literal {
    /**
     * Node type of mdast TOML.
     */
    type: "toml";
    /**
     * Data associated with the mdast TOML.
     */
    data?: TomlData | undefined;
}
/**
 * Info associated with mdast TOML nodes by the ecosystem.
 */
export interface TomlData extends Data {
}
/**
 * Markdown JSON.
 */
export interface Json extends Literal {
    /**
     * Node type of mdast JSON.
     */
    type: "json";
    /**
     * Data associated with the mdast JSON.
     */
    data?: JsonData | undefined;
}
/**
 * Info associated with mdast JSON nodes by the ecosystem.
 */
export interface JsonData extends Data {
}
/**
 * Language options provided for Markdown files.
 */
export interface MarkdownLanguageOptions extends LanguageOptions {
    /**
     * The options for parsing frontmatter.
     */
    frontmatter?: false | "yaml" | "toml" | "json";
    /**
     * The options for parsing math.
     */
    math?: boolean;
}
/**
 * The context object that is passed to the Markdown language plugin methods.
 */
export type MarkdownLanguageContext = LanguageContext<MarkdownLanguageOptions>;
/**
 * A Markdown syntax element, including nodes and comments.
 */
type MarkdownSyntaxElement = Node | InlineConfigComment;
export interface MarkdownRuleVisitor extends RuleVisitor, CustomRuleVisitorWithExit<{
    root?(node: Root): void;
} & {
    [NodeType in Blockquote | Break | Code | Definition | Emphasis | Heading | Html | Image | ImageReference | InlineCode | Link | LinkReference | List | ListItem | Paragraph | Strong | Text | ThematicBreak | Delete | FootnoteDefinition | FootnoteReference | Table | TableCell | TableRow | Yaml | Toml | Json | InlineMath | Math as NodeType["type"]]?: (node: NodeType, parent?: Parent) => void;
}> {
}
export type MarkdownRuleDefinitionTypeOptions = CustomRuleTypeDefinitions;
export type MarkdownRuleDefinition<Options extends Partial<MarkdownRuleDefinitionTypeOptions> = {}> = CustomRuleDefinitionType<{
    LangOptions: MarkdownLanguageOptions;
    Code: MarkdownSourceCode;
    Visitor: MarkdownRuleVisitor;
    Node: MarkdownSyntaxElement;
}, Options>;
export {};
/x G//------------------------------------------------------------------------------
// Imports
//------------------------------------------------------------------------------
export {};
H#Vxi/**
 * Checks if a frontmatter block contains a title matching the given pattern.
 * @param {string} value The frontmatter content.
 * @param {RegExp|null} pattern The pattern to match against.
 * @returns {boolean} Whether a title was found.
 */
export function frontmatterHasTitle(value: string, pattern: RegExp | null): boolean;
/**
 * Replaces all HTML comments with whitespace.
 * This preserves offsets and locations of characters
 * outside HTML comments by keeping line breaks and replacing
 * other code units with a space character.
 * @param {string} value The string to remove HTML comments from.
 * @returns {string} The string with HTML comments removed.
 */
export function stripHtmlComments(value: string): string;
/**
 * @fileoverview Utility Library
 * @author Nicholas C. Zakas
 */
/**
 * Line ending pattern to match all line endings (CRLF, CR, LF). (CommonMark spec)
 * @see https://spec.commonmark.org/0.31.2/#line-ending
 */
export const lineEndingPattern: RegExp;
/**
 * CommonMark does not allow any white space between the brackets in a reference link.
 * If that pattern is detected, then it's treated as text and not as a link. This pattern
 * is used to detect that situation.
 */
export const illegalShorthandTailPattern: RegExp;
/**
 * Regular expression to match HTML comments, including multiline comments.
 */
export const htmlCommentPattern: RegExp;
ZWߘxm/**
 * @fileoverview Utility Library
 * @author Nicholas C. Zakas
 */
//-----------------------------------------------------------------------------
// Regex Patterns
//-----------------------------------------------------------------------------
/**
 * Line ending pattern to match all line endings (CRLF, CR, LF). (CommonMark spec)
 * @see https://spec.commonmark.org/0.31.2/#line-ending
 */
export const lineEndingPattern = /\r\n|[\r\n]/u;
/**
 * CommonMark does not allow any white space between the brackets in a reference link.
 * If that pattern is detected, then it's treated as text and not as a link. This pattern
 * is used to detect that situation.
 */
export const illegalShorthandTailPattern = /\]\[\s+\]$/u;
/**
 * Regular expression to match HTML comments, including multiline comments.
 */
export const htmlCommentPattern = /<!--[\s\S]*?-->/gu;
//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------
/**
 * Checks if a frontmatter block contains a title matching the given pattern.
 * @param {string} value The frontmatter content.
 * @param {RegExp|null} pattern The pattern to match against.
 * @returns {boolean} Whether a title was found.
 */
export function frontmatterHasTitle(value, pattern) {
    if (!pattern) {
        return false;
    }
    const lines = value.split(lineEndingPattern);
    for (const line of lines) {
        if (pattern.test(line)) {
            return true;
        }
    }
    return false;
}
/**
 * Replaces all HTML comments with whitespace.
 * This preserves offsets and locations of characters
 * outside HTML comments by keeping line breaks and replacing
 * other code units with a space character.
 * @param {string} value The string to remove HTML comments from.
 * @returns {string} The string with HTML comments removed.
 */
export function stripHtmlComments(value) {
    return value.replace(htmlCommentPattern, match => 
    /* eslint-disable-next-line require-unicode-regexp
       -- we want to replace each code unit with a space
    */
    match.replace(/[^\r\n]/g, " "));
}
٫xM{
  "name": "@eslint/markdown",
  "version": "8.0.3",
  "description": "The official ESLint language plugin for Markdown",
  "license": "MIT",
  "author": {
    "name": "Brandon Mills",
    "url": "https://github.com/btmills"
  },
  "type": "module",
  "main": "dist/index.js",
  "types": "dist/index.d.ts",
  "exports": {
    ".": {
      "types": "./dist/index.d.ts",
      "default": "./dist/index.js"
    }
  },
  "files": [
    "dist"
  ],
  "publishConfig": {
    "access": "public"
  },
  "repository": "eslint/markdown",
  "bugs": {
    "url": "https://github.com/eslint/markdown/issues"
  },
  "homepage": "https://github.com/eslint/markdown#readme",
  "keywords": [
    "eslint",
    "eslintplugin",
    "markdown",
    "lint",
    "linter"
  ],
  "workspaces": [
    "examples/*"
  ],
  "gitHooks": {
    "pre-commit": "lint-staged"
  },
  "lint-staged": {
    "*.js": [
      "eslint --fix",
      "prettier --write"
    ],
    "*.md": [
      "eslint --fix",
      "eslint --fix -c eslint.config-content.js"
    ],
    "!(*.{js,md})": "prettier --write --ignore-unknown",
    "{src/rules/*.js,tools/update-rules-docs.js,README.md}": [
      "npm run build:update-rules-docs",
      "git add README.md"
    ]
  },
  "scripts": {
    "lint": "eslint && eslint -c eslint.config-content.js",
    "lint:fix": "eslint --fix && eslint --fix -c eslint.config-content.js",
    "lint:types": "attw --pack --profile esm-only",
    "lint:unused": "knip",
    "fmt": "prettier --write .",
    "fmt:check": "prettier --check .",
    "build": "npm run build:rules && npm run build:types && npm run build:update-rules-docs",
    "build:rules": "node tools/build-rules.js",
    "build:types": "tsc",
    "build:update-rules-docs": "node tools/update-rules-docs.js",
    "prepare": "npm run build",
    "test": "mocha \"tests/**/*.test.js\" --timeout 30000",
    "test:coverage": "c8 npm test",
    "test:jsr": "npx -y jsr@latest publish --dry-run",
    "test:types": "tsc -p tests/types/tsconfig.json",
    "test:types:5.3": "npx -p typescript@5.3 -y -- tsc -p tests/types/tsconfig.legacy.json",
    "test:types:5.x": "npx -p typescript@5.x -y -- tsc -p tests/types/tsconfig.json",
    "test:types:7.x": "npx -p @typescript/native-preview@latest -y -- tsgo -p tests/types/tsconfig.json",
    "test:types:all": "npm run test:types && npm run test:types:5.3 && npm run test:types:5.x && npm run test:types:7.x"
  },
  "devDependencies": {
    "@arethetypeswrong/cli": "^0.18.3",
    "@eslint/js": "^10.0.1",
    "@eslint/json": "^2.0.0",
    "@types/mdast": "^4.0.4",
    "@types/unist": "^3.0.3",
    "c8": "^11.0.0",
    "dedent": "^1.7.1",
    "eslint": "^10.0.3",
    "eslint-v9": "npm:eslint@9.x",
    "eslint-config-eslint": "^14.0.0",
    "eslint-plugin-eslint-plugin": "^7.3.2",
    "globals": "^17.1.0",
    "knip": "^6.0.0",
    "lint-staged": "^16.0.0",
    "mocha": "^11.7.5",
    "prettier": "3.8.4",
    "semver": "^7.7.3",
    "typescript": "^6.0.3",
    "yorkie": "^2.0.0"
  },
  "dependencies": {
    "@eslint/core": "^1.2.1",
    "@eslint/plugin-kit": "^0.7.2",
    "github-slugger": "^2.0.0",
    "mdast-util-from-markdown": "^2.0.2",
    "mdast-util-frontmatter": "^2.0.1",
    "mdast-util-gfm": "^3.1.0",
    "mdast-util-math": "^3.0.0",
    "micromark-extension-frontmatter": "^2.0.0",
    "micromark-extension-gfm": "^3.0.0",
    "micromark-extension-math": "^3.1.0",
    "micromark-util-normalize-identifier": "^2.0.1"
  },
  "engines": {
    "node": "^20.19.0 || ^22.13.0 || >=24"
  }
}
x p100644 LICENSE &랟+Kfݩo\d100644 README.md u~1K<[ڤWpDm40000 dist cad?#]~100644 package.json 8`F>SWazcm7x$# ObjectSchema Package

## Overview

A JavaScript object merge/validation utility where you can define a different merge and validation strategy for each key. This is helpful when you need to validate complex data structures and then merge them in a way that is more complex than `Object.assign()`. This is used in the [`@eslint/config-array`](https://npmjs.com/package/@eslint/config-array) package but can also be used on its own.

## Installation

For Node.js and compatible runtimes:

```shell
npm install @eslint/object-schema
# or
yarn add @eslint/object-schema
# or
pnpm install @eslint/object-schema
# or
bun add @eslint/object-schema
```

For Deno:

```shell
deno add @eslint/object-schema
```

## Usage

Import the `ObjectSchema` constructor:

```js
// using ESM
import { ObjectSchema } from "@eslint/object-schema";

// using CommonJS
const { ObjectSchema } = require("@eslint/object-schema");

const schema = new ObjectSchema({
	// define a definition for the "downloads" key
	downloads: {
		required: true,
		merge(value1 = 0, value2) {
			return value1 + value2;
		},
		validate(value) {
			if (typeof value !== "number") {
				throw new Error("Expected downloads to be a number.");
			}
		},
	},

	// define a strategy for the "versions" key
	versions: {
		required: true,
		merge(value1 = [], value2) {
			return value1.concat(value2);
		},
		validate(value) {
			if (!Array.isArray(value)) {
				throw new Error("Expected versions to be an array.");
			}
		},
	},
});

const record1 = {
	downloads: 25,
	versions: ["v1.0.0", "v1.1.0", "v1.2.0"],
};

const record2 = {
	downloads: 125,
	versions: ["v2.0.0", "v2.1.0", "v3.0.0"],
};

// make sure the records are valid
schema.validate(record1);
schema.validate(record2);

// merge together (schema.merge() accepts any number of objects)
const result = schema.merge(record1, record2);

// result looks like this:
// {
// 	downloads: 150,
// 	versions: ["v1.0.0", "v1.1.0", "v1.2.0", "v2.0.0", "v2.1.0", "v3.0.0"],
// }
```

## Tips and Tricks

### Named merge strategies

Instead of specifying a `merge()` method, you can specify one of the following strings to use a default merge strategy:

- `"assign"` - use `Object.assign()` to merge the two values into one object.
- `"overwrite"` - the second value always replaces the first.
- `"replace"` - the second value replaces the first if the second is not `undefined`.

For example:

```js
const schema = new ObjectSchema({
	name: {
		merge: "replace",
		validate() {},
	},
});
```

### Named validation strategies

Instead of specifying a `validate()` method, you can specify one of the following strings to use a default validation strategy:

- `"array"` - value must be an array.
- `"boolean"` - value must be a boolean.
- `"number"` - value must be a number.
- `"object"` - value must be a non-null object, including arrays and non-plain objects.
- `"object?"` - value must be an object or null, including arrays and non-plain objects.
- `"string"` - value must be a string.
- `"string!"` - value must be a non-empty string.

For example:

```js
const schema = new ObjectSchema({
	name: {
		merge: "replace",
		validate: "string",
	},
});
```

### Built-in strategy classes

The package also exports the built-in merge and validation strategies as two classes with static methods:

- `MergeStrategy` - built-in merge functions (`assign`, `overwrite`, `replace`).
- `ValidationStrategy` - built-in validation functions (`array`, `boolean`, `number`, `object`, `object?`, `string`, `string!`).

These are the same strategies used when you specify a strategy by name (for example, `merge: "replace"`). You can reference the functions directly if you prefer passing a function instead of a string:

```js
import {
	ObjectSchema,
	MergeStrategy,
	ValidationStrategy,
} from "@eslint/object-schema";

const schema = new ObjectSchema({
	name: {
		required: true,
		merge: MergeStrategy.replace,
		validate: ValidationStrategy["string!"],
	},
	options: {
		required: false,
		merge: MergeStrategy.assign,
		validate: ValidationStrategy["object?"],
	},
});
```

Note: Because `object?` and `string!` aren't valid identifiers, you must access them using bracket notation (for example, `ValidationStrategy["object?"]`).

### Subschemas

If you are defining a key that is, itself, an object, you can simplify the process by using a subschema. Instead of defining `merge()` and `validate()`, set a `schema` property that contains a schema definition, like this:

```js
const schema = new ObjectSchema({
	name: {
		schema: {
			first: {
				merge: "replace",
				validate: "string",
			},
			last: {
				merge: "replace",
				validate: "string",
			},
		},
	},
});

schema.validate({
	name: {
		first: "n",
		last: "z",
	},
});
```

### Remove Keys During Merge

If the merge strategy for a key returns `undefined`, then the key will not appear in the final object. For example:

```js
const schema = new ObjectSchema({
	date: {
		merge() {
			return undefined;
		},
		validate(value) {
			if (isNaN(Date.parse(value))) {
				throw new Error("Invalid date.");
			}
		},
	},
});

const object1 = { date: "5/5/2005" };
const object2 = { date: "6/6/2006" };

const result = schema.merge(object1, object2);

console.log("date" in result); // false
```

### Requiring Another Key Be Present

If you'd like the presence of one key to require the presence of another key, you can use the `requires` property to specify an array of other properties that any key requires. For example:

```js
const schema = new ObjectSchema({
	date: {
		merge() {
			return undefined;
		},
		validate(value) {
			if (isNaN(Date.parse(value))) {
				throw new Error("Invalid date.");
			}
		},
	},
	time: {
		requires: ["date"],
		merge(first, second) {
			return second;
		},
		validate(value) {
			// ...
		},
	},
});

// throws error: Key "time" requires keys "date".
schema.validate({
	time: "13:45",
});
```

In this example, even though `date` is an optional key, it is required to be present whenever `time` is present.

## License

Apache 2.0

<!-- NOTE: This section is autogenerated. Do not manually edit.-->
<!--sponsorsstart-->

## Sponsors

The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
to get your logo on our READMEs and [website](https://eslint.org/sponsors).

<h3>Platinum Sponsors</h3>
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a></p><h3>Gold Sponsors</h3>
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a></p><h3>Silver Sponsors</h3>
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/d472863/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/2d6c3b6/logo.png" alt="Liftoff" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" height="32"></a> <a href="https://www.crawljobs.com/"><img src="https://images.opencollective.com/crawljobs-poland/fa43a17/logo.png" alt="CrawlJobs" height="32"></a> <a href="#"><img src="https://images.opencollective.com/aeriusventilations-org/avatar.png" alt="aeriusventilation's Org" height="32"></a> <a href="https://depot.dev"><img src="https://images.opencollective.com/depot/39125a1/logo.png" alt="Depot" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="TestMu AI Open Source Office (Formerly LambdaTest)" height="32"></a></p>
<h3>Technology Sponsors</h3>
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
<!--sponsorsend-->
{:x< 40000 cjs įsIM(#40000 esm TPZBXxЗ1xq 100644 index.cjs >8tIxn=ZW100644 index.d.cts iibL-Һzu100644 types.cts L')kgZkqa(.x4'use strict';

/**
 * @fileoverview Merge Strategy
 */

//-----------------------------------------------------------------------------
// Class
//-----------------------------------------------------------------------------

/**
 * Container class for several different merge strategies.
 */
class MergeStrategy {
	/**
	 * Merges two keys by overwriting the first with the second.
	 * @template TValue1 The type of the value from the first object key.
	 * @template TValue2 The type of the value from the second object key.
	 * @param {TValue1} value1 The value from the first object key.
	 * @param {TValue2} value2 The value from the second object key.
	 * @returns {TValue2} The second value.
	 */
	static overwrite(value1, value2) {
		return value2;
	}

	/**
	 * Merges two keys by replacing the first with the second only if the
	 * second is defined.
	 * @template TValue1 The type of the value from the first object key.
	 * @template TValue2 The type of the value from the second object key.
	 * @param {TValue1} value1 The value from the first object key.
	 * @param {TValue2} value2 The value from the second object key.
	 * @returns {TValue1 | TValue2} The second value if it is defined.
	 */
	static replace(value1, value2) {
		if (typeof value2 !== "undefined") {
			return value2;
		}

		return value1;
	}

	/**
	 * Merges two properties by assigning properties from the second to the first.
	 * @template {Record<string | number | symbol, unknown> | undefined} TValue1 The type of the value from the first object key.
	 * @template {Record<string | number | symbol, unknown>} TValue2 The type of the value from the second object key.
	 * @param {TValue1} value1 The value from the first object key.
	 * @param {TValue2} value2 The value from the second object key.
	 * @returns {Omit<TValue1, keyof TValue2> & TValue2} A new object containing properties from both value1 and
	 *      value2.
	 */
	static assign(value1, value2) {
		return Object.assign({}, value1, value2);
	}
}

/**
 * @fileoverview Validation Strategy
 */

//-----------------------------------------------------------------------------
// Class
//-----------------------------------------------------------------------------

/**
 * Container class for several different validation strategies.
 */
class ValidationStrategy {
	/**
	 * Validates that a value is an array.
	 * @param {unknown} value The value to validate.
	 * @returns {void}
	 * @throws {TypeError} If the value is invalid.
	 */
	static array(value) {
		if (!Array.isArray(value)) {
			throw new TypeError("Expected an array.");
		}
	}

	/**
	 * Validates that a value is a boolean.
	 * @param {unknown} value The value to validate.
	 * @returns {void}
	 * @throws {TypeError} If the value is invalid.
	 */
	static boolean(value) {
		if (typeof value !== "boolean") {
			throw new TypeError("Expected a boolean.");
		}
	}

	/**
	 * Validates that a value is a number.
	 * @param {unknown} value The value to validate.
	 * @returns {void}
	 * @throws {TypeError} If the value is invalid.
	 */
	static number(value) {
		if (typeof value !== "number") {
			throw new TypeError("Expected a number.");
		}
	}

	/**
	 * Validates that a value is an object.
	 * @param {unknown} value The value to validate.
	 * @returns {void}
	 * @throws {TypeError} If the value is invalid.
	 */
	static object(value) {
		if (!value || typeof value !== "object") {
			throw new TypeError("Expected an object.");
		}
	}

	/**
	 * Validates that a value is an object or null.
	 * @param {unknown} value The value to validate.
	 * @returns {void}
	 * @throws {TypeError} If the value is invalid.
	 */
	static "object?"(value) {
		if (typeof value !== "object") {
			throw new TypeError("Expected an object or null.");
		}
	}

	/**
	 * Validates that a value is a string.
	 * @param {unknown} value The value to validate.
	 * @returns {void}
	 * @throws {TypeError} If the value is invalid.
	 */
	static string(value) {
		if (typeof value !== "string") {
			throw new TypeError("Expected a string.");
		}
	}

	/**
	 * Validates that a value is a non-empty string.
	 * @param {unknown} value The value to validate.
	 * @returns {void}
	 * @throws {TypeError} If the value is invalid.
	 */
	static "string!"(value) {
		if (typeof value !== "string" || value.length === 0) {
			throw new TypeError("Expected a non-empty string.");
		}
	}
}

/**
 * @fileoverview Object Schema
 */


//-----------------------------------------------------------------------------
// Types
//-----------------------------------------------------------------------------

/** @import * as $typests from "./types.ts"; */
/** @typedef {$typests.BuiltInMergeStrategy} BuiltInMergeStrategy */
/** @typedef {$typests.BuiltInValidationStrategy} BuiltInValidationStrategy */
/** @typedef {$typests.CustomMergeStrategy} CustomMergeStrategy */
/** @typedef {$typests.CustomValidationStrategy} CustomValidationStrategy */
/** @typedef {$typests.ObjectDefinition} ObjectDefinition */
/** @typedef {$typests.PropertyDefinition} PropertyDefinition */
/** @typedef {$typests.PropertyDefinitionWithSchema} PropertyDefinitionWithSchema */
/** @typedef {$typests.PropertyDefinitionWithStrategies} PropertyDefinitionWithStrategies */

//-----------------------------------------------------------------------------
// Private
//-----------------------------------------------------------------------------

/**
 * Validates a schema strategy.
 * @param {string} name The name of the key this strategy is for.
 * @param {PropertyDefinition} definition The strategy for the object key.
 * @returns {void}
 * @throws {TypeError} When the strategy is missing a name.
 * @throws {TypeError} When the strategy is missing a merge() method.
 * @throws {TypeError} When the strategy is missing a validate() method.
 */
function validateDefinition(name, definition) {
	let hasSchema = false;
	if (definition.schema) {
		if (typeof definition.schema === "object") {
			hasSchema = true;
		} else {
			throw new TypeError("Schema must be an object.");
		}
	}

	if (typeof definition.merge === "string") {
		if (!(definition.merge in MergeStrategy)) {
			throw new TypeError(
				`Definition for key "${name}" missing valid merge strategy.`,
			);
		}
	} else if (!hasSchema && typeof definition.merge !== "function") {
		throw new TypeError(
			`Definition for key "${name}" must have a merge property.`,
		);
	}

	if (typeof definition.validate === "string") {
		if (!(definition.validate in ValidationStrategy)) {
			throw new TypeError(
				`Definition for key "${name}" missing valid validation strategy.`,
			);
		}
	} else if (!hasSchema && typeof definition.validate !== "function") {
		throw new TypeError(
			`Definition for key "${name}" must have a validate() method.`,
		);
	}
}

//-----------------------------------------------------------------------------
// Errors
//-----------------------------------------------------------------------------

/**
 * Error when an unexpected key is found.
 */
class UnexpectedKeyError extends Error {
	/**
	 * Creates a new instance.
	 * @param {string} key The key that was unexpected.
	 */
	constructor(key) {
		super(`Unexpected key "${key}" found.`);
	}
}

/**
 * Error when a required key is missing.
 */
class MissingKeyError extends Error {
	/**
	 * Creates a new instance.
	 * @param {string} key The key that was missing.
	 */
	constructor(key) {
		super(`Missing required key "${key}".`);
	}
}

/**
 * Error when a key requires other keys that are missing.
 */
class MissingDependentKeysError extends Error {
	/**
	 * Creates a new instance.
	 * @param {string} key The key that was unexpected.
	 * @param {Array<string>} requiredKeys The keys that are required.
	 */
	constructor(key, requiredKeys) {
		super(`Key "${key}" requires keys "${requiredKeys.join('", "')}".`);
	}
}

/**
 * Wrapper error for errors occuring during a merge or validate operation.
 */
class WrapperError extends Error {
	/**
	 * Creates a new instance.
	 * @param {string} key The object key causing the error.
	 * @param {Error} source The source error.
	 */
	constructor(key, source) {
		super(`Key "${key}": ${source.message}`, { cause: source });

		// copy over custom properties that aren't represented
		for (const sourceKey of Object.keys(source)) {
			if (!(sourceKey in this)) {
				this[sourceKey] = source[sourceKey];
			}
		}
	}
}

//-----------------------------------------------------------------------------
// Main
//-----------------------------------------------------------------------------

/**
 * Represents an object validation/merging schema.
 */
class ObjectSchema {
	/**
	 * Track all definitions in the schema by key.
	 * @type {Map<string, PropertyDefinition>}
	 */
	#definitions = new Map();

	/**
	 * Separately track any keys that are required for faster validation.
	 * @type {Map<string, PropertyDefinition>}
	 */
	#requiredKeys = new Map();

	/**
	 * Creates a new instance.
	 * @param {ObjectDefinition} definitions The schema definitions.
	 * @throws {Error} When the definitions are missing or invalid.
	 */
	constructor(definitions) {
		if (!definitions) {
			throw new Error("Schema definitions missing.");
		}

		// add in all strategies
		for (const key of Object.keys(definitions)) {
			const definition = definitions[key];

			validateDefinition(key, definition);

			let normalizedDefinition = definition;

			// normalize merge and validate methods if subschema is present
			if (typeof normalizedDefinition.schema === "object") {
				const schema = new ObjectSchema(normalizedDefinition.schema);
				normalizedDefinition = {
					...normalizedDefinition,
					merge(first = {}, second = {}) {
						return schema.merge(first, second);
					},
					validate(value) {
						ValidationStrategy.object(value);
						schema.validate(value);
					},
				};
			}

			// normalize the merge method in case there's a string
			if (typeof normalizedDefinition.merge === "string") {
				normalizedDefinition = {
					...normalizedDefinition,
					merge: MergeStrategy[normalizedDefinition.merge],
				};
			}

			// normalize the validate method in case there's a string
			if (typeof normalizedDefinition.validate === "string") {
				normalizedDefinition = {
					...normalizedDefinition,
					validate: ValidationStrategy[normalizedDefinition.validate],
				};
			}

			this.#definitions.set(key, normalizedDefinition);

			if (normalizedDefinition.required) {
				this.#requiredKeys.set(key, normalizedDefinition);
			}
		}
	}

	/**
	 * Determines if a strategy has been registered for the given object key.
	 * @param {string} key The object key to find a strategy for.
	 * @returns {boolean} True if the key has a strategy registered, false if not.
	 */
	hasKey(key) {
		return this.#definitions.has(key);
	}

	/**
	 * Merges objects together to create a new object comprised of the keys
	 * of the all objects. Keys are merged based on the each key's merge
	 * strategy.
	 * @param {...Object} objects The objects to merge.
	 * @returns {Object} A new object with a mix of all objects' keys.
	 * @throws {TypeError} If any object is invalid.
	 */
	merge(...objects) {
		// double check arguments
		if (objects.length < 2) {
			throw new TypeError("merge() requires at least two arguments.");
		}

		if (
			objects.some(
				object => object === null || typeof object !== "object",
			)
		) {
			throw new TypeError("All arguments must be objects.");
		}

		return objects.reduce((result, object) => {
			this.validate(object);

			for (const [key, strategy] of this.#definitions) {
				try {
					if (key in result || key in object) {
						const merge = /** @type {Function} */ (strategy.merge);
						const value = merge.call(
							this,
							result[key],
							object[key],
						);
						if (value !== undefined) {
							result[key] = value;
						}
					}
				} catch (ex) {
					throw new WrapperError(key, ex);
				}
			}
			return result;
		}, {});
	}

	/**
	 * Validates an object's keys based on the validate strategy for each key.
	 * @param {Object} object The object to validate.
	 * @returns {void}
	 * @throws {Error} When the object is invalid.
	 */
	validate(object) {
		// check existing keys first
		for (const key of Object.keys(object)) {
			// check to see if the key is defined
			if (!this.hasKey(key)) {
				throw new UnexpectedKeyError(key);
			}

			// validate existing keys
			const definition = /** @type {PropertyDefinition} */ (
				this.#definitions.get(key)
			); // `definition` is guaranteed to exist since we check with `hasKey()` above.

			// first check to see if any other keys are required
			if (Array.isArray(definition.requires)) {
				if (
					!definition.requires.every(otherKey => otherKey in object)
				) {
					throw new MissingDependentKeysError(
						key,
						definition.requires,
					);
				}
			}

			// now apply remaining validation strategy
			try {
				const validate = /** @type {Function} */ (definition.validate);
				validate.call(definition, object[key]);
			} catch (ex) {
				throw new WrapperError(key, ex);
			}
		}

		// ensure required keys aren't missing
		for (const [key] of this.#requiredKeys) {
			if (!(key in object)) {
				throw new MissingKeyError(key);
			}
		}
	}
}

exports.MergeStrategy = MergeStrategy;
exports.ObjectSchema = ObjectSchema;
exports.ValidationStrategy = ValidationStrategy;
F`İx@export type BuiltInMergeStrategy = $typests.BuiltInMergeStrategy;
export type BuiltInValidationStrategy = $typests.BuiltInValidationStrategy;
export type CustomMergeStrategy = $typests.CustomMergeStrategy;
export type CustomValidationStrategy = $typests.CustomValidationStrategy;
export type ObjectDefinition = $typests.ObjectDefinition;
export type PropertyDefinition = $typests.PropertyDefinition;
export type PropertyDefinitionWithSchema = $typests.PropertyDefinitionWithSchema;
export type PropertyDefinitionWithStrategies = $typests.PropertyDefinitionWithStrategies;
/**
 * @fileoverview Merge Strategy
 */
/**
 * Container class for several different merge strategies.
 */
export class MergeStrategy {
    /**
     * Merges two keys by overwriting the first with the second.
     * @template TValue1 The type of the value from the first object key.
     * @template TValue2 The type of the value from the second object key.
     * @param {TValue1} value1 The value from the first object key.
     * @param {TValue2} value2 The value from the second object key.
     * @returns {TValue2} The second value.
     */
    static overwrite<TValue1, TValue2>(value1: TValue1, value2: TValue2): TValue2;
    /**
     * Merges two keys by replacing the first with the second only if the
     * second is defined.
     * @template TValue1 The type of the value from the first object key.
     * @template TValue2 The type of the value from the second object key.
     * @param {TValue1} value1 The value from the first object key.
     * @param {TValue2} value2 The value from the second object key.
     * @returns {TValue1 | TValue2} The second value if it is defined.
     */
    static replace<TValue1, TValue2>(value1: TValue1, value2: TValue2): TValue1 | TValue2;
    /**
     * Merges two properties by assigning properties from the second to the first.
     * @template {Record<string | number | symbol, unknown> | undefined} TValue1 The type of the value from the first object key.
     * @template {Record<string | number | symbol, unknown>} TValue2 The type of the value from the second object key.
     * @param {TValue1} value1 The value from the first object key.
     * @param {TValue2} value2 The value from the second object key.
     * @returns {Omit<TValue1, keyof TValue2> & TValue2} A new object containing properties from both value1 and
     *      value2.
     */
    static assign<TValue1 extends Record<string | number | symbol, unknown> | undefined, TValue2 extends Record<string | number | symbol, unknown>>(value1: TValue1, value2: TValue2): Omit<TValue1, keyof TValue2> & TValue2;
}
/**
 * Represents an object validation/merging schema.
 */
export class ObjectSchema {
    /**
     * Creates a new instance.
     * @param {ObjectDefinition} definitions The schema definitions.
     * @throws {Error} When the definitions are missing or invalid.
     */
    constructor(definitions: ObjectDefinition);
    /**
     * Determines if a strategy has been registered for the given object key.
     * @param {string} key The object key to find a strategy for.
     * @returns {boolean} True if the key has a strategy registered, false if not.
     */
    hasKey(key: string): boolean;
    /**
     * Merges objects together to create a new object comprised of the keys
     * of the all objects. Keys are merged based on the each key's merge
     * strategy.
     * @param {...Object} objects The objects to merge.
     * @returns {Object} A new object with a mix of all objects' keys.
     * @throws {TypeError} If any object is invalid.
     */
    merge(...objects: any[]): any;
    /**
     * Validates an object's keys based on the validate strategy for each key.
     * @param {Object} object The object to validate.
     * @returns {void}
     * @throws {Error} When the object is invalid.
     */
    validate(object: any): void;
    #private;
}
/**
 * @fileoverview Validation Strategy
 */
/**
 * Container class for several different validation strategies.
 */
export class ValidationStrategy {
    /**
     * Validates that a value is an array.
     * @param {unknown} value The value to validate.
     * @returns {void}
     * @throws {TypeError} If the value is invalid.
     */
    static array(value: unknown): void;
    /**
     * Validates that a value is a boolean.
     * @param {unknown} value The value to validate.
     * @returns {void}
     * @throws {TypeError} If the value is invalid.
     */
    static boolean(value: unknown): void;
    /**
     * Validates that a value is a number.
     * @param {unknown} value The value to validate.
     * @returns {void}
     * @throws {TypeError} If the value is invalid.
     */
    static number(value: unknown): void;
    /**
     * Validates that a value is an object.
     * @param {unknown} value The value to validate.
     * @returns {void}
     * @throws {TypeError} If the value is invalid.
     */
    static object(value: unknown): void;
    /**
     * Validates that a value is an object or null.
     * @param {unknown} value The value to validate.
     * @returns {void}
     * @throws {TypeError} If the value is invalid.
     */
    static "object?"(value: unknown): void;
    /**
     * Validates that a value is a string.
     * @param {unknown} value The value to validate.
     * @returns {void}
     * @throws {TypeError} If the value is invalid.
     */
    static string(value: unknown): void;
    /**
     * Validates that a value is a non-empty string.
     * @param {unknown} value The value to validate.
     * @returns {void}
     * @throws {TypeError} If the value is invalid.
     */
    static "string!"(value: unknown): void;
}
import type * as $typests from "./types.cts";
R?x	/**
 * @fileoverview Types for object-schema package.
 */

/**
 * Built-in validation strategies.
 */
export type BuiltInValidationStrategy =
	| "array"
	| "boolean"
	| "number"
	| "object"
	| "object?"
	| "string"
	| "string!";

/**
 * Built-in merge strategies.
 */
export type BuiltInMergeStrategy = "assign" | "overwrite" | "replace";

/**
 * Custom merge strategy.
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/eslint/rewrite/pull/90#discussion_r1687206213
export type CustomMergeStrategy = (target: any, source: any) => any;

/**
 * Custom validation strategy.
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- https://github.com/eslint/rewrite/pull/90#discussion_r1687206213
export type CustomValidationStrategy = (value: any) => void;

interface BasePropertyDefinition {
	/**
	 * Indicates if the property is required.
	 */
	required?: boolean;

	/**
	 * The other properties that must be present when this property is used.
	 */
	requires?: string[];
}

/**
 * Property definition that specifies explicit merge and validation strategies.
 * This form cannot include a `schema`.
 */
export interface PropertyDefinitionWithStrategies extends BasePropertyDefinition {
	/**
	 * The schema for the object value of this property.
	 */
	schema?: never;

	/**
	 * The strategy to merge the property.
	 */
	merge: BuiltInMergeStrategy | CustomMergeStrategy;

	/**
	 * The strategy to validate the property.
	 */
	validate: BuiltInValidationStrategy | CustomValidationStrategy;
}

/**
 * Property definition that uses a nested `schema`.
 * When `schema` is present, merge and validation strategies are optional.
 */
export interface PropertyDefinitionWithSchema extends BasePropertyDefinition {
	/**
	 * The schema for the object value of this property.
	 */
	schema: ObjectDefinition;

	/**
	 * The strategy to merge the property.
	 */
	merge?: BuiltInMergeStrategy | CustomMergeStrategy;

	/**
	 * The strategy to validate the property.
	 */
	validate?: BuiltInValidationStrategy | CustomValidationStrategy;
}

/**
 * Property definition.
 */
export type PropertyDefinition =
	| PropertyDefinitionWithStrategies
	| PropertyDefinitionWithSchema;

/**
 * Object definition.
 */
export type ObjectDefinition = Record<string, PropertyDefinition>;
.	x k100644 index.d.ts 0h0%8C6^100644 index.js \3x@d>100644 types.d.ts mCϟV+b5~O(100644 types.ts L')kgZkqa(" 5x?export type BuiltInMergeStrategy = $typests.BuiltInMergeStrategy;
export type BuiltInValidationStrategy = $typests.BuiltInValidationStrategy;
export type CustomMergeStrategy = $typests.CustomMergeStrategy;
export type CustomValidationStrategy = $typests.CustomValidationStrategy;
export type ObjectDefinition = $typests.ObjectDefinition;
export type PropertyDefinition = $typests.PropertyDefinition;
export type PropertyDefinitionWithSchema = $typests.PropertyDefinitionWithSchema;
export type PropertyDefinitionWithStrategies = $typests.PropertyDefinitionWithStrategies;
/**
 * @fileoverview Merge Strategy
 */
/**
 * Container class for several different merge strategies.
 */
export class MergeStrategy {
    /**
     * Merges two keys by overwriting the first with the second.
     * @template TValue1 The type of the value from the first object key.
     * @template TValue2 The type of the value from the second object key.
     * @param {TValue1} value1 The value from the first object key.
     * @param {TValue2} value2 The value from the second object key.
     * @returns {TValue2} The second value.
     */
    static overwrite<TValue1, TValue2>(value1: TValue1, value2: TValue2): TValue2;
    /**
     * Merges two keys by replacing the first with the second only if the
     * second is defined.
     * @template TValue1 The type of the value from the first object key.
     * @template TValue2 The type of the value from the second object key.
     * @param {TValue1} value1 The value from the first object key.
     * @param {TValue2} value2 The value from the second object key.
     * @returns {TValue1 | TValue2} The second value if it is defined.
     */
    static replace<TValue1, TValue2>(value1: TValue1, value2: TValue2): TValue1 | TValue2;
    /**
     * Merges two properties by assigning properties from the second to the first.
     * @template {Record<string | number | symbol, unknown> | undefined} TValue1 The type of the value from the first object key.
     * @template {Record<string | number | symbol, unknown>} TValue2 The type of the value from the second object key.
     * @param {TValue1} value1 The value from the first object key.
     * @param {TValue2} value2 The value from the second object key.
     * @returns {Omit<TValue1, keyof TValue2> & TValue2} A new object containing properties from both value1 and
     *      value2.
     */
    static assign<TValue1 extends Record<string | number | symbol, unknown> | undefined, TValue2 extends Record<string | number | symbol, unknown>>(value1: TValue1, value2: TValue2): Omit<TValue1, keyof TValue2> & TValue2;
}
/**
 * Represents an object validation/merging schema.
 */
export class ObjectSchema {
    /**
     * Creates a new instance.
     * @param {ObjectDefinition} definitions The schema definitions.
     * @throws {Error} When the definitions are missing or invalid.
     */
    constructor(definitions: ObjectDefinition);
    /**
     * Determines if a strategy has been registered for the given object key.
     * @param {string} key The object key to find a strategy for.
     * @returns {boolean} True if the key has a strategy registered, false if not.
     */
    hasKey(key: string): boolean;
    /**
     * Merges objects together to create a new object comprised of the keys
     * of the all objects. Keys are merged based on the each key's merge
     * strategy.
     * @param {...Object} objects The objects to merge.
     * @returns {Object} A new object with a mix of all objects' keys.
     * @throws {TypeError} If any object is invalid.
     */
    merge(...objects: any[]): any;
    /**
     * Validates an object's keys based on the validate strategy for each key.
     * @param {Object} object The object to validate.
     * @returns {void}
     * @throws {Error} When the object is invalid.
     */
    validate(object: any): void;
    #private;
}
/**
 * @fileoverview Validation Strategy
 */
/**
 * Container class for several different validation strategies.
 */
export class ValidationStrategy {
    /**
     * Validates that a value is an array.
     * @param {unknown} value The value to validate.
     * @returns {void}
     * @throws {TypeError} If the value is invalid.
     */
    static array(value: unknown): void;
    /**
     * Validates that a value is a boolean.
     * @param {unknown} value The value to validate.
     * @returns {void}
     * @throws {TypeError} If the value is invalid.
     */
    static boolean(value: unknown): void;
    /**
     * Validates that a value is a number.
     * @param {unknown} value The value to validate.
     * @returns {void}
     * @throws {TypeError} If the value is invalid.
     */
    static number(value: unknown): void;
    /**
     * Validates that a value is an object.
     * @param {unknown} value The value to validate.
     * @returns {void}
     * @throws {TypeError} If the value is invalid.
     */
    static object(value: unknown): void;
    /**
     * Validates that a value is an object or null.
     * @param {unknown} value The value to validate.
     * @returns {void}
     * @throws {TypeError} If the value is invalid.
     */
    static "object?"(value: unknown): void;
    /**
     * Validates that a value is a string.
     * @param {unknown} value The value to validate.
     * @returns {void}
     * @throws {TypeError} If the value is invalid.
     */
    static string(value: unknown): void;
    /**
     * Validates that a value is a non-empty string.
     * @param {unknown} value The value to validate.
     * @returns {void}
     * @throws {TypeError} If the value is invalid.
     */
    static "string!"(value: unknown): void;
}
import type * as $typests from "./types.ts";
~Qܾx3// @ts-self-types="./index.d.ts"
/**
 * @fileoverview Merge Strategy
 */

//-----------------------------------------------------------------------------
// Class
//-----------------------------------------------------------------------------

/**
 * Container class for several different merge strategies.
 */
class MergeStrategy {
	/**
	 * Merges two keys by overwriting the first with the second.
	 * @template TValue1 The type of the value from the first object key.
	 * @template TValue2 The type of the value from the second object key.
	 * @param {TValue1} value1 The value from the first object key.
	 * @param {TValue2} value2 The value from the second object key.
	 * @returns {TValue2} The second value.
	 */
	static overwrite(value1, value2) {
		return value2;
	}

	/**
	 * Merges two keys by replacing the first with the second only if the
	 * second is defined.
	 * @template TValue1 The type of the value from the first object key.
	 * @template TValue2 The type of the value from the second object key.
	 * @param {TValue1} value1 The value from the first object key.
	 * @param {TValue2} value2 The value from the second object key.
	 * @returns {TValue1 | TValue2} The second value if it is defined.
	 */
	static replace(value1, value2) {
		if (typeof value2 !== "undefined") {
			return value2;
		}

		return value1;
	}

	/**
	 * Merges two properties by assigning properties from the second to the first.
	 * @template {Record<string | number | symbol, unknown> | undefined} TValue1 The type of the value from the first object key.
	 * @template {Record<string | number | symbol, unknown>} TValue2 The type of the value from the second object key.
	 * @param {TValue1} value1 The value from the first object key.
	 * @param {TValue2} value2 The value from the second object key.
	 * @returns {Omit<TValue1, keyof TValue2> & TValue2} A new object containing properties from both value1 and
	 *      value2.
	 */
	static assign(value1, value2) {
		return Object.assign({}, value1, value2);
	}
}

/**
 * @fileoverview Validation Strategy
 */

//-----------------------------------------------------------------------------
// Class
//-----------------------------------------------------------------------------

/**
 * Container class for several different validation strategies.
 */
class ValidationStrategy {
	/**
	 * Validates that a value is an array.
	 * @param {unknown} value The value to validate.
	 * @returns {void}
	 * @throws {TypeError} If the value is invalid.
	 */
	static array(value) {
		if (!Array.isArray(value)) {
			throw new TypeError("Expected an array.");
		}
	}

	/**
	 * Validates that a value is a boolean.
	 * @param {unknown} value The value to validate.
	 * @returns {void}
	 * @throws {TypeError} If the value is invalid.
	 */
	static boolean(value) {
		if (typeof value !== "boolean") {
			throw new TypeError("Expected a boolean.");
		}
	}

	/**
	 * Validates that a value is a number.
	 * @param {unknown} value The value to validate.
	 * @returns {void}
	 * @throws {TypeError} If the value is invalid.
	 */
	static number(value) {
		if (typeof value !== "number") {
			throw new TypeError("Expected a number.");
		}
	}

	/**
	 * Validates that a value is an object.
	 * @param {unknown} value The value to validate.
	 * @returns {void}
	 * @throws {TypeError} If the value is invalid.
	 */
	static object(value) {
		if (!value || typeof value !== "object") {
			throw new TypeError("Expected an object.");
		}
	}

	/**
	 * Validates that a value is an object or null.
	 * @param {unknown} value The value to validate.
	 * @returns {void}
	 * @throws {TypeError} If the value is invalid.
	 */
	static "object?"(value) {
		if (typeof value !== "object") {
			throw new TypeError("Expected an object or null.");
		}
	}

	/**
	 * Validates that a value is a string.
	 * @param {unknown} value The value to validate.
	 * @returns {void}
	 * @throws {TypeError} If the value is invalid.
	 */
	static string(value) {
		if (typeof value !== "string") {
			throw new TypeError("Expected a string.");
		}
	}

	/**
	 * Validates that a value is a non-empty string.
	 * @param {unknown} value The value to validate.
	 * @returns {void}
	 * @throws {TypeError} If the value is invalid.
	 */
	static "string!"(value) {
		if (typeof value !== "string" || value.length === 0) {
			throw new TypeError("Expected a non-empty string.");
		}
	}
}

/**
 * @fileoverview Object Schema
 */


//-----------------------------------------------------------------------------
// Types
//-----------------------------------------------------------------------------

/** @import * as $typests from "./types.ts"; */
/** @typedef {$typests.BuiltInMergeStrategy} BuiltInMergeStrategy */
/** @typedef {$typests.BuiltInValidationStrategy} BuiltInValidationStrategy */
/** @typedef {$typests.CustomMergeStrategy} CustomMergeStrategy */
/** @typedef {$typests.CustomValidationStrategy} CustomValidationStrategy */
/** @typedef {$typests.ObjectDefinition} ObjectDefinition */
/** @typedef {$typests.PropertyDefinition} PropertyDefinition */
/** @typedef {$typests.PropertyDefinitionWithSchema} PropertyDefinitionWithSchema */
/** @typedef {$typests.PropertyDefinitionWithStrategies} PropertyDefinitionWithStrategies */

//-----------------------------------------------------------------------------
// Private
//-----------------------------------------------------------------------------

/**
 * Validates a schema strategy.
 * @param {string} name The name of the key this strategy is for.
 * @param {PropertyDefinition} definition The strategy for the object key.
 * @returns {void}
 * @throws {TypeError} When the strategy is missing a name.
 * @throws {TypeError} When the strategy is missing a merge() method.
 * @throws {TypeError} When the strategy is missing a validate() method.
 */
function validateDefinition(name, definition) {
	let hasSchema = false;
	if (definition.schema) {
		if (typeof definition.schema === "object") {
			hasSchema = true;
		} else {
			throw new TypeError("Schema must be an object.");
		}
	}

	if (typeof definition.merge === "string") {
		if (!(definition.merge in MergeStrategy)) {
			throw new TypeError(
				`Definition for key "${name}" missing valid merge strategy.`,
			);
		}
	} else if (!hasSchema && typeof definition.merge !== "function") {
		throw new TypeError(
			`Definition for key "${name}" must have a merge property.`,
		);
	}

	if (typeof definition.validate === "string") {
		if (!(definition.validate in ValidationStrategy)) {
			throw new TypeError(
				`Definition for key "${name}" missing valid validation strategy.`,
			);
		}
	} else if (!hasSchema && typeof definition.validate !== "function") {
		throw new TypeError(
			`Definition for key "${name}" must have a validate() method.`,
		);
	}
}

//-----------------------------------------------------------------------------
// Errors
//-----------------------------------------------------------------------------

/**
 * Error when an unexpected key is found.
 */
class UnexpectedKeyError extends Error {
	/**
	 * Creates a new instance.
	 * @param {string} key The key that was unexpected.
	 */
	constructor(key) {
		super(`Unexpected key "${key}" found.`);
	}
}

/**
 * Error when a required key is missing.
 */
class MissingKeyError extends Error {
	/**
	 * Creates a new instance.
	 * @param {string} key The key that was missing.
	 */
	constructor(key) {
		super(`Missing required key "${key}".`);
	}
}

/**
 * Error when a key requires other keys that are missing.
 */
class MissingDependentKeysError extends Error {
	/**
	 * Creates a new instance.
	 * @param {string} key The key that was unexpected.
	 * @param {Array<string>} requiredKeys The keys that are required.
	 */
	constructor(key, requiredKeys) {
		super(`Key "${key}" requires keys "${requiredKeys.join('", "')}".`);
	}
}

/**
 * Wrapper error for errors occuring during a merge or validate operation.
 */
class WrapperError extends Error {
	/**
	 * Creates a new instance.
	 * @param {string} key The object key causing the error.
	 * @param {Error} source The source error.
	 */
	constructor(key, source) {
		super(`Key "${key}": ${source.message}`, { cause: source });

		// copy over custom properties that aren't represented
		for (const sourceKey of Object.keys(source)) {
			if (!(sourceKey in this)) {
				this[sourceKey] = source[sourceKey];
			}
		}
	}
}

//-----------------------------------------------------------------------------
// Main
//-----------------------------------------------------------------------------

/**
 * Represents an object validation/merging schema.
 */
class ObjectSchema {
	/**
	 * Track all definitions in the schema by key.
	 * @type {Map<string, PropertyDefinition>}
	 */
	#definitions = new Map();

	/**
	 * Separately track any keys that are required for faster validation.
	 * @type {Map<string, PropertyDefinition>}
	 */
	#requiredKeys = new Map();

	/**
	 * Creates a new instance.
	 * @param {ObjectDefinition} definitions The schema definitions.
	 * @throws {Error} When the definitions are missing or invalid.
	 */
	constructor(definitions) {
		if (!definitions) {
			throw new Error("Schema definitions missing.");
		}

		// add in all strategies
		for (const key of Object.keys(definitions)) {
			const definition = definitions[key];

			validateDefinition(key, definition);

			let normalizedDefinition = definition;

			// normalize merge and validate methods if subschema is present
			if (typeof normalizedDefinition.schema === "object") {
				const schema = new ObjectSchema(normalizedDefinition.schema);
				normalizedDefinition = {
					...normalizedDefinition,
					merge(first = {}, second = {}) {
						return schema.merge(first, second);
					},
					validate(value) {
						ValidationStrategy.object(value);
						schema.validate(value);
					},
				};
			}

			// normalize the merge method in case there's a string
			if (typeof normalizedDefinition.merge === "string") {
				normalizedDefinition = {
					...normalizedDefinition,
					merge: MergeStrategy[normalizedDefinition.merge],
				};
			}

			// normalize the validate method in case there's a string
			if (typeof normalizedDefinition.validate === "string") {
				normalizedDefinition = {
					...normalizedDefinition,
					validate: ValidationStrategy[normalizedDefinition.validate],
				};
			}

			this.#definitions.set(key, normalizedDefinition);

			if (normalizedDefinition.required) {
				this.#requiredKeys.set(key, normalizedDefinition);
			}
		}
	}

	/**
	 * Determines if a strategy has been registered for the given object key.
	 * @param {string} key The object key to find a strategy for.
	 * @returns {boolean} True if the key has a strategy registered, false if not.
	 */
	hasKey(key) {
		return this.#definitions.has(key);
	}

	/**
	 * Merges objects together to create a new object comprised of the keys
	 * of the all objects. Keys are merged based on the each key's merge
	 * strategy.
	 * @param {...Object} objects The objects to merge.
	 * @returns {Object} A new object with a mix of all objects' keys.
	 * @throws {TypeError} If any object is invalid.
	 */
	merge(...objects) {
		// double check arguments
		if (objects.length < 2) {
			throw new TypeError("merge() requires at least two arguments.");
		}

		if (
			objects.some(
				object => object === null || typeof object !== "object",
			)
		) {
			throw new TypeError("All arguments must be objects.");
		}

		return objects.reduce((result, object) => {
			this.validate(object);

			for (const [key, strategy] of this.#definitions) {
				try {
					if (key in result || key in object) {
						const merge = /** @type {Function} */ (strategy.merge);
						const value = merge.call(
							this,
							result[key],
							object[key],
						);
						if (value !== undefined) {
							result[key] = value;
						}
					}
				} catch (ex) {
					throw new WrapperError(key, ex);
				}
			}
			return result;
		}, {});
	}

	/**
	 * Validates an object's keys based on the validate strategy for each key.
	 * @param {Object} object The object to validate.
	 * @returns {void}
	 * @throws {Error} When the object is invalid.
	 */
	validate(object) {
		// check existing keys first
		for (const key of Object.keys(object)) {
			// check to see if the key is defined
			if (!this.hasKey(key)) {
				throw new UnexpectedKeyError(key);
			}

			// validate existing keys
			const definition = /** @type {PropertyDefinition} */ (
				this.#definitions.get(key)
			); // `definition` is guaranteed to exist since we check with `hasKey()` above.

			// first check to see if any other keys are required
			if (Array.isArray(definition.requires)) {
				if (
					!definition.requires.every(otherKey => otherKey in object)
				) {
					throw new MissingDependentKeysError(
						key,
						definition.requires,
					);
				}
			}

			// now apply remaining validation strategy
			try {
				const validate = /** @type {Function} */ (definition.validate);
				validate.call(definition, object[key]);
			} catch (ex) {
				throw new WrapperError(key, ex);
			}
		}

		// ensure required keys aren't missing
		for (const [key] of this.#requiredKeys) {
			if (!(key in object)) {
				throw new MissingKeyError(key);
			}
		}
	}
}

export { MergeStrategy, ObjectSchema, ValidationStrategy };
P1N%xM/**
 * @fileoverview Types for object-schema package.
 */
/**
 * Built-in validation strategies.
 */
export type BuiltInValidationStrategy = "array" | "boolean" | "number" | "object" | "object?" | "string" | "string!";
/**
 * Built-in merge strategies.
 */
export type BuiltInMergeStrategy = "assign" | "overwrite" | "replace";
/**
 * Custom merge strategy.
 */
export type CustomMergeStrategy = (target: any, source: any) => any;
/**
 * Custom validation strategy.
 */
export type CustomValidationStrategy = (value: any) => void;
interface BasePropertyDefinition {
    /**
     * Indicates if the property is required.
     */
    required?: boolean;
    /**
     * The other properties that must be present when this property is used.
     */
    requires?: string[];
}
/**
 * Property definition that specifies explicit merge and validation strategies.
 * This form cannot include a `schema`.
 */
export interface PropertyDefinitionWithStrategies extends BasePropertyDefinition {
    /**
     * The schema for the object value of this property.
     */
    schema?: never;
    /**
     * The strategy to merge the property.
     */
    merge: BuiltInMergeStrategy | CustomMergeStrategy;
    /**
     * The strategy to validate the property.
     */
    validate: BuiltInValidationStrategy | CustomValidationStrategy;
}
/**
 * Property definition that uses a nested `schema`.
 * When `schema` is present, merge and validation strategies are optional.
 */
export interface PropertyDefinitionWithSchema extends BasePropertyDefinition {
    /**
     * The schema for the object value of this property.
     */
    schema: ObjectDefinition;
    /**
     * The strategy to merge the property.
     */
    merge?: BuiltInMergeStrategy | CustomMergeStrategy;
    /**
     * The strategy to validate the property.
     */
    validate?: BuiltInValidationStrategy | CustomValidationStrategy;
}
/**
 * Property definition.
 */
export type PropertyDefinition = PropertyDefinitionWithStrategies | PropertyDefinitionWithSchema;
/**
 * Object definition.
 */
export type ObjectDefinition = Record<string, PropertyDefinition>;
export {};
mx({
  "name": "@eslint/object-schema",
  "version": "3.0.5",
  "description": "An object schema merger/validator",
  "type": "module",
  "main": "dist/esm/index.js",
  "types": "dist/esm/index.d.ts",
  "exports": {
    "require": {
      "types": "./dist/cjs/index.d.cts",
      "default": "./dist/cjs/index.cjs"
    },
    "import": {
      "types": "./dist/esm/index.d.ts",
      "default": "./dist/esm/index.js"
    }
  },
  "files": [
    "dist"
  ],
  "publishConfig": {
    "access": "public"
  },
  "directories": {
    "test": "tests"
  },
  "scripts": {
    "build:dedupe-types": "node ../../tools/dedupe-types.js dist/cjs/index.cjs dist/esm/index.js",
    "build:cts": "node ../../tools/build-cts.js dist/esm/index.d.ts dist/cjs/index.d.cts",
    "build": "rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json && npm run build:cts",
    "lint:types": "attw --pack",
    "pretest": "npm run build",
    "test": "npm run test:types && npm run test:unit",
    "test:coverage": "c8 npm run test:unit",
    "test:jsr": "npx -y jsr@latest publish --dry-run",
    "test:types": "tsc -p tests/types/tsconfig.json",
    "test:unit": "mocha \"tests/**/*.test.js\""
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/eslint/rewrite.git",
    "directory": "packages/object-schema"
  },
  "keywords": [
    "object",
    "validation",
    "schema",
    "merge"
  ],
  "author": "Nicholas C. Zakas",
  "license": "Apache-2.0",
  "bugs": {
    "url": "https://github.com/eslint/rewrite/issues"
  },
  "homepage": "https://github.com/eslint/rewrite/tree/main/packages/object-schema#readme",
  "devDependencies": {
    "rollup-plugin-copy": "^3.5.0"
  },
  "engines": {
    "node": "^20.19.0 || ^22.13.0 || >=24"
  }
}
x p100644 LICENSE &랟+Kfݩo\d100644 README.md n-I40000 dist pZg'u100644 package.json kX! j1̚p:F;ȴx4.# ESLint Plugin Kit

## Description

A collection of utilities to help build ESLint plugins.

## Installation

For Node.js and compatible runtimes:

```shell
npm install @eslint/plugin-kit
# or
yarn add @eslint/plugin-kit
# or
pnpm install @eslint/plugin-kit
# or
bun add @eslint/plugin-kit
```

For Deno:

```shell
deno add @eslint/plugin-kit
```

## Usage

This package exports the following utilities:

- [`ConfigCommentParser`](#configcommentparser) - used to parse ESLint configuration comments (i.e., `/* eslint-disable rule */`)
- [`VisitNodeStep` and `CallMethodStep`](#visitnodestep-and-callmethodstep) - used to help implement `SourceCode#traverse()`
- [`Directive`](#directive) - used to help implement `SourceCode#getDisableDirectives()`
- [`TextSourceCodeBase`](#textsourcecodebase) - base class to help implement the `SourceCode` interface

### `ConfigCommentParser`

To use the `ConfigCommentParser` class, import it from the package and create a new instance, such as:

```js
import { ConfigCommentParser } from "@eslint/plugin-kit";

// create a new instance
const commentParser = new ConfigCommentParser();

// pass in a comment string without the comment delimiters
const directive = commentParser.parseDirective(
	"eslint-disable prefer-const, no-var -- I don't want to use these.",
);

// will be undefined when a directive can't be parsed
if (directive) {
	console.log(directive.label); // "eslint-disable"
	console.log(directive.value); // "prefer-const, no-var"
	console.log(directive.justification); // "I don't want to use these."
}
```

There are different styles of directive values that you'll need to parse separately to get the correct format:

```js
import { ConfigCommentParser } from "@eslint/plugin-kit";

// create a new instance
const commentParser = new ConfigCommentParser();

// list format
const list = commentParser.parseListConfig("prefer-const, no-var");
console.log(Object.entries(list)); // [["prefer-const", true], ["no-var", true]]

// string format
const strings = commentParser.parseStringConfig("foo:off, bar");
console.log(Object.entries(strings)); // [["foo", "off"], ["bar", null]]

// JSON-like config format
const jsonLike = commentParser.parseJSONLikeConfig(
	"radix:[error, always], prefer-const: warn",
);
console.log(Object.entries(jsonLike.config)); // [["radix", ["error", "always"]], ["prefer-const", "warn"]]
```

### `VisitNodeStep` and `CallMethodStep`

The `VisitNodeStep` and `CallMethodStep` classes represent steps in the traversal of source code. They implement the correct interfaces to return from the `SourceCode#traverse()` method.

The `VisitNodeStep` class is the more common of the two, where you are describing a visit to a particular node during the traversal. The constructor accepts three arguments:

- `target` - the node being visited. This is used to determine the method to call inside of a rule. For instance, if the node's type is `Literal` then ESLint will call a method named `Literal()` on the rule (if present).
- `phase` - either 1 for enter or 2 for exit.
- `args` - an array of arguments to pass into the visitor method of a rule.

For example:

```js
import { VisitNodeStep } from "@eslint/plugin-kit";

class MySourceCode {
	traverse() {
		const steps = [];

		for (const { node, parent, phase } of iterator(this.ast)) {
			steps.push(
				new VisitNodeStep({
					target: node,
					phase: phase === "enter" ? 1 : 2,
					args: [node, parent],
				}),
			);
		}

		return steps;
	}
}
```

The `CallMethodStep` class is less common and is used to tell ESLint to call a specific method on the rule. The constructor accepts two arguments:

- `target` - the name of the method to call, frequently beginning with `"on"` such as `"onCodePathStart"`.
- `args` - an array of arguments to pass to the method.

For example:

```js
import { VisitNodeStep, CallMethodStep } from "@eslint/plugin-kit";

class MySourceCode {
    traverse() {
        const steps = [];

        for (const { node, parent, phase } of iterator(this.ast)) {
            steps.push(
                new VisitNodeStep({
                    target: node,
                    phase: phase === "enter" ? 1 : 2,
                    args: [node, parent],
                }),
            );

            // call a method indicating how many times we've been through the loop
            steps.push(
                new CallMethodStep({
                    target: "onIteration",
                    args: [steps.length]
                });
            )
        }

        return steps;
    }
}
```

### `Directive`

The `Directive` class represents a disable directive in the source code and implements the `Directive` interface from `@eslint/core`. You can tell ESLint about disable directives using the `SourceCode#getDisableDirectives()` method, where part of the return value is an array of `Directive` objects. Here's an example:

```js
import { Directive, ConfigCommentParser } from "@eslint/plugin-kit";

class MySourceCode {
	getDisableDirectives() {
		const directives = [];
		const problems = [];
		const commentParser = new ConfigCommentParser();

		// read in the inline config nodes to check each one
		this.getInlineConfigNodes().forEach(comment => {
			// Step 1: Parse the directive
			const { label, value, justification } =
				commentParser.parseDirective(comment.value);

			// Step 2: Extract the directive value and create the `Directive` object
			switch (label) {
				case "eslint-disable":
				case "eslint-enable":
				case "eslint-disable-next-line":
				case "eslint-disable-line": {
					const directiveType = label.slice("eslint-".length);

					directives.push(
						new Directive({
							type: directiveType,
							node: comment,
							value,
							justification,
						}),
					);
				}

				// ignore any comments that don't begin with known labels
			}
		});

		return {
			directives,
			problems,
		};
	}
}
```

### `TextSourceCodeBase`

The `TextSourceCodeBase` class is intended to be a base class that has several of the common members found in `SourceCode` objects already implemented. Those members are:

- `lines` - an array of text lines that is created automatically when the constructor is called.
- `getLoc(nodeOrToken)` - gets the location of a node or token. Works for nodes that have the ESLint-style `loc` property and nodes that have the Unist-style [`position` property](https://github.com/syntax-tree/unist?tab=readme-ov-file#position). If you're using an AST with a different location format, you'll still need to implement this method yourself.
- `getLocFromIndex(index)` - Converts a source text index into a `{ line: number, column: number }` pair. (For this method to work, the root node should always cover the entire source code text, and the `getLoc()` method needs to be implemented correctly.)
- `getIndexFromLoc(loc)` - Converts a `{ line: number, column: number }` pair into a source text index. (For this method to work, the root node should always cover the entire source code text, and the `getLoc()` method needs to be implemented correctly.)
- `getRange(nodeOrToken)` - gets the range of a node or token within the source text. Works for nodes that have the ESLint-style `range` property and nodes that have the Unist-style [`position` property](https://github.com/syntax-tree/unist?tab=readme-ov-file#position). If you're using an AST with a different range format, you'll still need to implement this method yourself.
- `getText(node, beforeCount, afterCount)` - gets the source text for the given node that has range information attached. Optionally, can return additional characters before and after the given node. As long as `getRange()` is properly implemented, this method will just work.
- `getAncestors(node)` - returns the ancestry of the node. In order for this to work, you must implement the `getParent()` method yourself.

Here's an example:

```js
import { TextSourceCodeBase } from "@eslint/plugin-kit";

export class MySourceCode extends TextSourceCodeBase {
	#parents = new Map();

	constructor({ ast, text }) {
		super({ ast, text });
	}

	getParent(node) {
		return this.#parents.get(node);
	}

	traverse() {
		const steps = [];

		for (const { node, parent, phase } of iterator(this.ast)) {
			//save the parent information
			this.#parent.set(node, parent);

			steps.push(
				new VisitNodeStep({
					target: node,
					phase: phase === "enter" ? 1 : 2,
					args: [node, parent],
				}),
			);
		}

		return steps;
	}
}
```

In general, it's safe to collect the parent information during the `traverse()` method as `getParent()` and `getAncestor()` will only be called from rules once the AST has been traversed at least once.

## License

Apache 2.0

<!-- NOTE: This section is autogenerated. Do not manually edit.-->
<!--sponsorsstart-->

## Sponsors

The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
to get your logo on our READMEs and [website](https://eslint.org/sponsors).

<h3>Platinum Sponsors</h3>
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a></p><h3>Gold Sponsors</h3>
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a></p><h3>Silver Sponsors</h3>
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/d472863/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/2d6c3b6/logo.png" alt="Liftoff" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" height="32"></a> <a href="https://www.crawljobs.com/"><img src="https://images.opencollective.com/crawljobs-poland/fa43a17/logo.png" alt="CrawlJobs" height="32"></a> <a href="https://syntax.fm"><img src="https://github.com/syntaxfm.png" alt="Syntax" height="32"></a> <a href="https://depot.dev"><img src="https://images.opencollective.com/depot/39125a1/logo.png" alt="Depot" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://citadel.co.jp"><img src="https://avatars.githubusercontent.com/u/75781367" alt="Citadel AI" height="32"></a></p>
<h3>Technology Sponsors</h3>
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
<!--sponsorsend-->
7œx< 40000 cjs AfyW40000 esm ^]Tm]c'-Q	x g100644 index.cjs  `w띿}j100644 index.d.cts Boʴ"r˶100644 types.cts rۨjcJ100644 types.d.cts qĴ~ϺzԗԠBb+4CȰxe'use strict';

var levn = require('levn');

/**
 * @fileoverview Config Comment Parser
 * @author Nicholas C. Zakas
 */


//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------

/** @import * as $eslintcore from "@eslint/core"; */
/** @typedef {$eslintcore.RuleConfig} RuleConfig */
/** @typedef {$eslintcore.RulesConfig} RulesConfig */
/** @import * as $typests from "./types.ts"; */
/** @typedef {$typests.StringConfig} StringConfig */
/** @typedef {$typests.BooleanConfig} BooleanConfig */

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

const directivesPattern = /^([a-z]+(?:-[a-z]+)*)(?:\s|$)/u;
const validSeverities = new Set([0, 1, 2, "off", "warn", "error"]);

/**
 * Determines if the severity in the rule configuration is valid.
 * @param {RuleConfig} ruleConfig A rule's configuration.
 * @returns {boolean} `true` if the severity is valid, otherwise `false`.
 */
function isSeverityValid(ruleConfig) {
	const severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;
	return validSeverities.has(severity);
}

/**
 * Determines if all severities in the rules configuration are valid.
 * @param {RulesConfig} rulesConfig The rules configuration to check.
 * @returns {boolean} `true` if all severities are valid, otherwise `false`.
 */
function isEverySeverityValid(rulesConfig) {
	return Object.values(rulesConfig).every(isSeverityValid);
}

/**
 * Represents a directive comment.
 */
class DirectiveComment {
	/**
	 * The label of the directive, such as "eslint", "eslint-disable", etc.
	 * @type {string}
	 */
	label = "";

	/**
	 * The value of the directive (the string after the label).
	 * @type {string}
	 */
	value = "";

	/**
	 * The justification of the directive (the string after the --).
	 * @type {string}
	 */
	justification = "";

	/**
	 * Creates a new directive comment.
	 * @param {string} label The label of the directive.
	 * @param {string} value The value of the directive.
	 * @param {string} justification The justification of the directive.
	 */
	constructor(label, value, justification) {
		this.label = label;
		this.value = value;
		this.justification = justification;
	}
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

/**
 * Object to parse ESLint configuration comments.
 */
class ConfigCommentParser {
	/**
	 * Parses a list of "name:string_value" or/and "name" options divided by comma or
	 * whitespace. Used for "global" comments.
	 * @param {string} string The string to parse.
	 * @returns {StringConfig} Result map object of names and string values, or null values if no value was provided.
	 */
	parseStringConfig(string) {
		const items = /** @type {StringConfig} */ ({});

		// Collapse whitespace around `:` and `,` to make parsing easier
		const trimmedString = string
			.trim()
			.replace(/(?<!\s)\s*([:,])\s*/gu, "$1");

		trimmedString.split(/\s|,+/u).forEach(name => {
			if (!name) {
				return;
			}

			// value defaults to null (if not provided), e.g: "foo" => ["foo", null]
			const [key, value = null] = name.split(":");

			items[key] = value;
		});

		return items;
	}

	/**
	 * Parses a JSON-like config.
	 * @param {string} string The string to parse.
	 * @returns {({ok: true, config: RulesConfig}|{ok: false, error: {message: string}})} Result map object
	 */
	parseJSONLikeConfig(string) {
		// Parses a JSON-like comment by the same way as parsing CLI option.
		try {
			const items =
				/** @type {RulesConfig} */ (levn.parse("Object", string)) || {};

			/*
			 * When the configuration has any invalid severities, it should be completely
			 * ignored. This is because the configuration is not valid and should not be
			 * applied.
			 *
			 * For example, the following configuration is invalid:
			 *
			 *    "no-alert: 2 no-console: 2"
			 *
			 * This results in a configuration of { "no-alert": "2 no-console: 2" }, which is
			 * not valid. In this case, the configuration should be ignored.
			 */
			if (isEverySeverityValid(items)) {
				return {
					ok: true,
					config: items,
				};
			}
		} catch {
			// levn parsing error: ignore to parse the string by a fallback.
		}

		/*
		 * Optionator cannot parse commaless notations.
		 * But we are supporting that. So this is a fallback for that.
		 */
		const normalizedString = string
			.replace(/(?<![-a-zA-Z0-9/])([-a-zA-Z0-9/]+):/gu, '"$1":')
			.replace(/([\]0-9])\s+(?=")/u, "$1,");

		try {
			const items = JSON.parse(`{${normalizedString}}`);

			return {
				ok: true,
				config: items,
			};
		} catch (ex) {
			const errorMessage = ex instanceof Error ? ex.message : String(ex);

			return {
				ok: false,
				error: {
					message: `Failed to parse JSON from '${normalizedString}': ${errorMessage}`,
				},
			};
		}
	}

	/**
	 * Parses a config of values separated by comma.
	 * @param {string} string The string to parse.
	 * @returns {BooleanConfig} Result map of values and true values
	 */
	parseListConfig(string) {
		const items = /** @type {BooleanConfig} */ ({});

		string.split(",").forEach(name => {
			const trimmedName = name
				.trim()
				.replace(
					/^(?<quote>['"]?)(?<ruleId>.*)\k<quote>$/su,
					"$<ruleId>",
				);

			if (trimmedName) {
				items[trimmedName] = true;
			}
		});

		return items;
	}

	/**
	 * Extract the directive and the justification from a given directive comment and trim them.
	 * @param {string} value The comment text to extract.
	 * @returns {{directivePart: string, justificationPart: string}} The extracted directive and justification.
	 */
	#extractDirectiveComment(value) {
		const match = /\s-{2,}\s/u.exec(value);

		if (!match) {
			return { directivePart: value.trim(), justificationPart: "" };
		}

		const directive = value.slice(0, match.index).trim();
		const justification = value.slice(match.index + match[0].length).trim();

		return { directivePart: directive, justificationPart: justification };
	}

	/**
	 * Parses a directive comment into directive text and value.
	 * @param {string} string The string with the directive to be parsed.
	 * @returns {DirectiveComment|undefined} The parsed directive or `undefined` if the directive is invalid.
	 */
	parseDirective(string) {
		const { directivePart, justificationPart } =
			this.#extractDirectiveComment(string);
		const match = directivesPattern.exec(directivePart);

		if (!match) {
			return undefined;
		}

		const directiveText = match[1];
		const directiveValue = directivePart.slice(
			match.index + directiveText.length,
		);

		return new DirectiveComment(
			directiveText,
			directiveValue.trim(),
			justificationPart,
		);
	}
}

/**
 * @fileoverview A collection of helper classes for implementing `SourceCode`.
 * @author Nicholas C. Zakas
 */

/* eslint class-methods-use-this: off -- Required to complete interface. */

//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------

/** @typedef {$eslintcore.VisitTraversalStep} VisitTraversalStep */
/** @typedef {$eslintcore.CallTraversalStep} CallTraversalStep */
/** @typedef {$eslintcore.TraversalStep} TraversalStep */
/** @typedef {$eslintcore.SourceLocation} SourceLocation */
/** @typedef {$eslintcore.SourceLocationWithOffset} SourceLocationWithOffset */
/** @typedef {$eslintcore.SourceRange} SourceRange */
/** @typedef {$eslintcore.Directive} IDirective */
/** @typedef {$eslintcore.DirectiveType} DirectiveType */
/** @typedef {$eslintcore.SourceCodeBaseTypeOptions} SourceCodeBaseTypeOptions */
/**
 * @typedef {import("@eslint/core").TextSourceCode<Options>} TextSourceCode
 * @template {SourceCodeBaseTypeOptions} [Options=SourceCodeBaseTypeOptions]
 */
/** @typedef {$eslintcore.RuleVisitor} RuleVisitor */
/**
 * @typedef {import("./types.ts").CustomRuleVisitorWithExit<RuleVisitorType>} CustomRuleVisitorWithExit
 * @template {RuleVisitor} RuleVisitorType
 */
/** @typedef {$typests.CustomRuleTypeDefinitions} CustomRuleTypeDefinitions */
/**
 * @typedef {import("./types.ts").CustomRuleDefinitionType<LanguageSpecificOptions, Options>} CustomRuleDefinitionType
 * @template {Omit<import("@eslint/core").RuleDefinitionTypeOptions, keyof CustomRuleTypeDefinitions>} LanguageSpecificOptions
 * @template {Partial<CustomRuleTypeDefinitions>} Options
 */

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

/**
 * Determines if a node has ESTree-style loc information.
 * @param {object} node The node to check.
 * @returns {node is {loc:SourceLocation}} `true` if the node has ESTree-style loc information, `false` if not.
 */
function hasESTreeStyleLoc(node) {
	return "loc" in node;
}

/**
 * Determines if a node has position-style loc information.
 * @param {object} node The node to check.
 * @returns {node is {position:SourceLocation}} `true` if the node has position-style range information, `false` if not.
 */
function hasPosStyleLoc(node) {
	return "position" in node;
}

/**
 * Determines if a node has ESTree-style range information.
 * @param {object} node The node to check.
 * @returns {node is {range:SourceRange}} `true` if the node has ESTree-style range information, `false` if not.
 */
function hasESTreeStyleRange(node) {
	return "range" in node;
}

/**
 * Determines if a node has position-style range information.
 * @param {object} node The node to check.
 * @returns {node is {position:SourceLocationWithOffset}} `true` if the node has position-style range information, `false` if not.
 */
function hasPosStyleRange(node) {
	return "position" in node;
}

/**
 * Performs binary search to find the line number containing a given target index.
 * Returns the lower bound - the index of the first element greater than the target.
 * **Please note that the `lineStartIndices` should be sorted in ascending order**.
 * - Time Complexity: O(log n) - Significantly faster than linear search for large files.
 * @param {number[]} lineStartIndices Sorted array of line start indices.
 * @param {number} targetIndex The target index to find the line number for.
 * @returns {number} The line number for the target index.
 */
function findLineNumberBinarySearch(lineStartIndices, targetIndex) {
	let low = 0;
	let high = lineStartIndices.length - 1;

	while (low < high) {
		const mid = ((low + high) / 2) | 0; // Use bitwise OR to floor the division.

		if (targetIndex < lineStartIndices[mid]) {
			high = mid;
		} else {
			low = mid + 1;
		}
	}

	return low;
}

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * A class to represent a step in the traversal process where a node is visited.
 * @implements {VisitTraversalStep}
 */
class VisitNodeStep {
	/**
	 * The type of the step.
	 * @type {"visit"}
	 * @readonly
	 */
	type = "visit";

	/**
	 * The kind of the step. Represents the same data as the `type` property
	 * but it's a number for performance.
	 * @type {1}
	 * @readonly
	 */
	kind = 1;

	/**
	 * The target of the step.
	 * @type {object}
	 */
	target;

	/**
	 * The phase of the step.
	 * @type {1|2}
	 */
	phase;

	/**
	 * The arguments of the step.
	 * @type {Array<any>}
	 */
	args;

	/**
	 * Creates a new instance.
	 * @param {Object} options The options for the step.
	 * @param {object} options.target The target of the step.
	 * @param {1|2} options.phase The phase of the step.
	 * @param {Array<any>} options.args The arguments of the step.
	 */
	constructor({ target, phase, args }) {
		this.target = target;
		this.phase = phase;
		this.args = args;
	}
}

/**
 * A class to represent a step in the traversal process where a
 * method is called.
 * @implements {CallTraversalStep}
 */
class CallMethodStep {
	/**
	 * The type of the step.
	 * @type {"call"}
	 * @readonly
	 */
	type = "call";

	/**
	 * The kind of the step. Represents the same data as the `type` property
	 * but it's a number for performance.
	 * @type {2}
	 * @readonly
	 */
	kind = 2;

	/**
	 * The name of the method to call.
	 * @type {string}
	 */
	target;

	/**
	 * The arguments to pass to the method.
	 * @type {Array<any>}
	 */
	args;

	/**
	 * Creates a new instance.
	 * @param {Object} options The options for the step.
	 * @param {string} options.target The target of the step.
	 * @param {Array<any>} options.args The arguments of the step.
	 */
	constructor({ target, args }) {
		this.target = target;
		this.args = args;
	}
}

/**
 * A class to represent a directive comment.
 * @implements {IDirective}
 */
class Directive {
	/**
	 * The type of directive.
	 * @type {DirectiveType}
	 * @readonly
	 */
	type;

	/**
	 * The node representing the directive.
	 * @type {unknown}
	 * @readonly
	 */
	node;

	/**
	 * Everything after the "eslint-disable" portion of the directive,
	 * but before the "--" that indicates the justification.
	 * @type {string}
	 * @readonly
	 */
	value;

	/**
	 * The justification for the directive.
	 * @type {string}
	 * @readonly
	 */
	justification;

	/**
	 * Creates a new instance.
	 * @param {Object} options The options for the directive.
	 * @param {"disable"|"enable"|"disable-next-line"|"disable-line"} options.type The type of directive.
	 * @param {unknown} options.node The node representing the directive.
	 * @param {string} options.value The value of the directive.
	 * @param {string} options.justification The justification for the directive.
	 */
	constructor({ type, node, value, justification }) {
		this.type = type;
		this.node = node;
		this.value = value;
		this.justification = justification;
	}
}

/**
 * Source Code Base Object
 * @template {SourceCodeBaseTypeOptions & {RootNode: object, SyntaxElementWithLoc: object}} [Options=SourceCodeBaseTypeOptions & {RootNode: object, SyntaxElementWithLoc: object}]
 * @implements {TextSourceCode<Options>}
 */
class TextSourceCodeBase {
	/**
	 * The lines of text in the source code.
	 * @type {Array<string>}
	 */
	#lines = [];

	/**
	 * The indices of the start of each line in the source code.
	 * @type {Array<number>}
	 */
	#lineStartIndices = [0];

	/**
	 * The pattern to match lineEndings in the source code.
	 * @type {RegExp}
	 */
	#lineEndingPattern;

	/**
	 * The AST of the source code.
	 * @type {Options['RootNode']}
	 */
	ast;

	/**
	 * The text of the source code.
	 * @type {string}
	 */
	text;

	/**
	 * Creates a new instance.
	 * @param {Object} options The options for the instance.
	 * @param {string} options.text The source code text.
	 * @param {Options['RootNode']} options.ast The root AST node.
	 * @param {RegExp} [options.lineEndingPattern] The pattern to match lineEndings in the source code. Defaults to `/\r?\n/u`.
	 */
	constructor({ text, ast, lineEndingPattern = /\r?\n/u }) {
		this.ast = ast;
		this.text = text;
		// Remove the global(`g`) and sticky(`y`) flags from the `lineEndingPattern` to avoid issues with lastIndex.
		this.#lineEndingPattern = new RegExp(
			lineEndingPattern.source,
			lineEndingPattern.flags.replace(/[gy]/gu, ""),
		);
	}

	/**
	 * Finds the next line in the source text and updates `#lines` and `#lineStartIndices`.
	 * @param {string} text The text to search for the next line.
	 * @returns {boolean} `true` if a next line was found, `false` otherwise.
	 */
	#findNextLine(text) {
		const match = this.#lineEndingPattern.exec(text);

		if (!match) {
			return false;
		}

		this.#lines.push(text.slice(0, match.index));
		this.#lineStartIndices.push(
			(this.#lineStartIndices.at(-1) ?? 0) +
				match.index +
				match[0].length,
		);

		return true;
	}

	/**
	 * Ensures `#lines` is lazily calculated from the source text.
	 * @returns {void}
	 */
	#ensureLines() {
		// If `#lines` has already been calculated, do nothing.
		if (this.#lines.length === this.#lineStartIndices.length) {
			return;
		}

		while (
			this.#findNextLine(this.text.slice(this.#lineStartIndices.at(-1)))
		) {
			// Continue parsing until no more matches are found.
		}

		this.#lines.push(this.text.slice(this.#lineStartIndices.at(-1)));

		Object.freeze(this.#lines);
	}

	/**
	 * Ensures `#lineStartIndices` is lazily calculated up to the specified index.
	 * @param {number} index The index of a character in a file.
	 * @returns {void}
	 */
	#ensureLineStartIndicesFromIndex(index) {
		// If we've already parsed up to or beyond this index, do nothing.
		if (index <= (this.#lineStartIndices.at(-1) ?? 0)) {
			return;
		}

		while (
			index > (this.#lineStartIndices.at(-1) ?? 0) &&
			this.#findNextLine(this.text.slice(this.#lineStartIndices.at(-1)))
		) {
			// Continue parsing until no more matches are found.
		}
	}

	/**
	 * Ensures `#lineStartIndices` is lazily calculated up to the specified loc.
	 * @param {Object} loc A line/column location.
	 * @param {number} loc.line The line number of the location. (0 or 1-indexed based on language.)
	 * @param {number} lineStart The line number at which the parser starts counting.
	 * @returns {void}
	 */
	#ensureLineStartIndicesFromLoc(loc, lineStart) {
		// Calculate line indices up to the potentially next line, as it is needed for the follow‑up calculation.
		const nextLocLineIndex = loc.line - lineStart + 1;
		const lastCalculatedLineIndex = this.#lineStartIndices.length - 1;
		let additionalLinesNeeded = nextLocLineIndex - lastCalculatedLineIndex;

		// If we've already parsed up to or beyond this line, do nothing.
		if (additionalLinesNeeded <= 0) {
			return;
		}

		while (
			additionalLinesNeeded > 0 &&
			this.#findNextLine(this.text.slice(this.#lineStartIndices.at(-1)))
		) {
			// Continue parsing until no more matches are found or we have enough lines.
			additionalLinesNeeded -= 1;
		}
	}

	/**
	 * Returns the loc information for the given node or token.
	 * @param {Options['SyntaxElementWithLoc']} nodeOrToken The node or token to get the loc information for.
	 * @returns {SourceLocation} The loc information for the node or token.
	 * @throws {Error} If the node or token does not have loc information.
	 */
	getLoc(nodeOrToken) {
		if (hasESTreeStyleLoc(nodeOrToken)) {
			return nodeOrToken.loc;
		}

		if (hasPosStyleLoc(nodeOrToken)) {
			return nodeOrToken.position;
		}

		throw new Error(
			"Custom getLoc() method must be implemented in the subclass.",
		);
	}

	/**
	 * Converts a source text index into a `{ line: number, column: number }` pair.
	 * @param {number} index The index of a character in a file.
	 * @throws {TypeError|RangeError} If non-numeric index or index out of range.
	 * @returns {{line: number, column: number}} A `{ line: number, column: number }` location object with 0 or 1-indexed line and 0 or 1-indexed column based on language.
	 * @public
	 */
	getLocFromIndex(index) {
		if (typeof index !== "number") {
			throw new TypeError("Expected `index` to be a number.");
		}

		if (index < 0 || index > this.text.length) {
			throw new RangeError(
				`Index out of range (requested index ${index}, but source text has length ${this.text.length}).`,
			);
		}

		const {
			start: { line: lineStart, column: columnStart },
			end: { line: lineEnd, column: columnEnd },
		} = this.getLoc(this.ast);

		// If the index is at the start, return the start location of the root node.
		if (index === 0) {
			return {
				line: lineStart,
				column: columnStart,
			};
		}

		// If the index is `this.text.length`, return the location one "spot" past the last character of the file.
		if (index === this.text.length) {
			return {
				line: lineEnd,
				column: columnEnd,
			};
		}

		// Ensure `#lineStartIndices` are lazily calculated.
		this.#ensureLineStartIndicesFromIndex(index);

		/*
		 * To figure out which line `index` is on, determine the last place at which index could
		 * be inserted into `#lineStartIndices` to keep the list sorted.
		 */
		const lineNumber =
			(index >= (this.#lineStartIndices.at(-1) ?? 0)
				? this.#lineStartIndices.length
				: findLineNumberBinarySearch(this.#lineStartIndices, index)) -
			1 +
			lineStart;

		return {
			line: lineNumber,
			column:
				index -
				this.#lineStartIndices[lineNumber - lineStart] +
				columnStart,
		};
	}

	/**
	 * Converts a `{ line: number, column: number }` pair into a source text index.
	 * @param {Object} loc A line/column location.
	 * @param {number} loc.line The line number of the location. (0 or 1-indexed based on language.)
	 * @param {number} loc.column The column number of the location. (0 or 1-indexed based on language.)
	 * @throws {TypeError|RangeError} If `loc` is not an object with a numeric
	 * `line` and `column`, if the `line` is less than or equal to zero or
	 * the `line` or `column` is out of the expected range.
	 * @returns {number} The index of the line/column location in a file.
	 * @public
	 */
	getIndexFromLoc(loc) {
		if (
			loc === null ||
			typeof loc !== "object" ||
			typeof loc.line !== "number" ||
			typeof loc.column !== "number"
		) {
			throw new TypeError(
				"Expected `loc` to be an object with numeric `line` and `column` properties.",
			);
		}

		const {
			start: { line: lineStart, column: columnStart },
			end: { line: lineEnd, column: columnEnd },
		} = this.getLoc(this.ast);

		if (loc.line < lineStart || lineEnd < loc.line) {
			throw new RangeError(
				`Line number out of range (line ${loc.line} requested). Valid range: ${lineStart}-${lineEnd}`,
			);
		}

		// If the loc is at the start, return the start index of the root node.
		if (loc.line === lineStart && loc.column === columnStart) {
			return 0;
		}

		// If the loc is at the end, return the index one "spot" past the last character of the file.
		if (loc.line === lineEnd && loc.column === columnEnd) {
			return this.text.length;
		}

		// Ensure `#lineStartIndices` are lazily calculated.
		this.#ensureLineStartIndicesFromLoc(loc, lineStart);

		const isLastLine = loc.line === lineEnd;
		const lineStartIndex = this.#lineStartIndices[loc.line - lineStart];
		const lineEndIndex = isLastLine
			? this.text.length
			: this.#lineStartIndices[loc.line - lineStart + 1];
		const positionIndex = lineStartIndex + loc.column - columnStart;

		if (
			loc.column < columnStart ||
			(isLastLine && positionIndex > lineEndIndex) ||
			(!isLastLine && positionIndex >= lineEndIndex)
		) {
			throw new RangeError(
				`Column number out of range (column ${loc.column} requested). Valid range for line ${loc.line}: ${columnStart}-${lineEndIndex - lineStartIndex + columnStart + (isLastLine ? 0 : -1)}`,
			);
		}

		return positionIndex;
	}

	/**
	 * Returns the range information for the given node or token.
	 * @param {Options['SyntaxElementWithLoc']} nodeOrToken The node or token to get the range information for.
	 * @returns {SourceRange} The range information for the node or token.
	 * @throws {Error} If the node or token does not have range information.
	 */
	getRange(nodeOrToken) {
		if (hasESTreeStyleRange(nodeOrToken)) {
			return nodeOrToken.range;
		}

		if (hasPosStyleRange(nodeOrToken)) {
			return [
				nodeOrToken.position.start.offset,
				nodeOrToken.position.end.offset,
			];
		}

		throw new Error(
			"Custom getRange() method must be implemented in the subclass.",
		);
	}

	/* eslint-disable no-unused-vars -- Required to complete interface. */
	/**
	 * Returns the parent of the given node.
	 * @param {Options['SyntaxElementWithLoc']} node The node to get the parent of.
	 * @returns {Options['SyntaxElementWithLoc']|undefined} The parent of the node.
	 * @throws {Error} If the method is not implemented in the subclass.
	 */
	getParent(node) {
		throw new Error("Not implemented.");
	}
	/* eslint-enable no-unused-vars -- Required to complete interface. */

	/**
	 * Gets all the ancestors of a given node
	 * @param {Options['SyntaxElementWithLoc']} node The node
	 * @returns {Array<Options['SyntaxElementWithLoc']>} All the ancestor nodes in the AST, not including the provided node, starting
	 * from the root node at index 0 and going inwards to the parent node.
	 * @throws {TypeError} When `node` is missing.
	 */
	getAncestors(node) {
		if (!node) {
			throw new TypeError("Missing required argument: node.");
		}

		const ancestorsStartingAtParent = [];

		for (
			let ancestor = this.getParent(node);
			ancestor;
			ancestor = this.getParent(ancestor)
		) {
			ancestorsStartingAtParent.push(ancestor);
		}

		return ancestorsStartingAtParent.reverse();
	}

	/**
	 * Gets the source code for the given node.
	 * @param {Options['SyntaxElementWithLoc']} [node] The AST node to get the text for.
	 * @param {number} [beforeCount] The number of characters before the node to retrieve.
	 * @param {number} [afterCount] The number of characters after the node to retrieve.
	 * @returns {string} The text representing the AST node.
	 * @public
	 */
	getText(node, beforeCount, afterCount) {
		if (node) {
			const range = this.getRange(node);
			return this.text.slice(
				Math.max(range[0] - (beforeCount || 0), 0),
				range[1] + (afterCount || 0),
			);
		}
		return this.text;
	}

	/**
	 * Gets the entire source text split into an array of lines.
	 * @returns {Array<string>} The source text as an array of lines.
	 * @public
	 */
	get lines() {
		this.#ensureLines(); // Ensure `#lines` is lazily calculated.

		return this.#lines;
	}

	/**
	 * Traverse the source code and return the steps that were taken.
	 * @returns {Iterable<TraversalStep>} The steps that were taken while traversing the source code.
	 */
	traverse() {
		throw new Error("Not implemented.");
	}
}

exports.CallMethodStep = CallMethodStep;
exports.ConfigCommentParser = ConfigCommentParser;
exports.Directive = Directive;
exports.TextSourceCodeBase = TextSourceCodeBase;
exports.VisitNodeStep = VisitNodeStep;
xH1export type VisitTraversalStep = $eslintcore.VisitTraversalStep;
export type CallTraversalStep = $eslintcore.CallTraversalStep;
export type TraversalStep = $eslintcore.TraversalStep;
export type SourceLocation = $eslintcore.SourceLocation;
export type SourceLocationWithOffset = $eslintcore.SourceLocationWithOffset;
export type SourceRange = $eslintcore.SourceRange;
export type IDirective = $eslintcore.Directive;
export type DirectiveType = $eslintcore.DirectiveType;
export type SourceCodeBaseTypeOptions = $eslintcore.SourceCodeBaseTypeOptions;
export type TextSourceCode<Options extends SourceCodeBaseTypeOptions = $eslintcore.SourceCodeBaseTypeOptions> = import("@eslint/core").TextSourceCode<Options>;
export type RuleVisitor = $eslintcore.RuleVisitor;
export type CustomRuleVisitorWithExit<RuleVisitorType extends RuleVisitor> = import("./types.cts").CustomRuleVisitorWithExit<RuleVisitorType>;
export type CustomRuleTypeDefinitions = $typests.CustomRuleTypeDefinitions;
export type CustomRuleDefinitionType<LanguageSpecificOptions extends Omit<import("@eslint/core").RuleDefinitionTypeOptions, keyof CustomRuleTypeDefinitions>, Options extends Partial<CustomRuleTypeDefinitions>> = import("./types.cts").CustomRuleDefinitionType<LanguageSpecificOptions, Options>;
export type RuleConfig = $eslintcore.RuleConfig;
export type RulesConfig = $eslintcore.RulesConfig;
export type StringConfig = $typests.StringConfig;
export type BooleanConfig = $typests.BooleanConfig;
/**
 * A class to represent a step in the traversal process where a
 * method is called.
 * @implements {CallTraversalStep}
 */
export class CallMethodStep implements CallTraversalStep {
    /**
     * Creates a new instance.
     * @param {Object} options The options for the step.
     * @param {string} options.target The target of the step.
     * @param {Array<any>} options.args The arguments of the step.
     */
    constructor({ target, args }: {
        target: string;
        args: Array<any>;
    });
    /**
     * The type of the step.
     * @type {"call"}
     * @readonly
     */
    readonly type: "call";
    /**
     * The kind of the step. Represents the same data as the `type` property
     * but it's a number for performance.
     * @type {2}
     * @readonly
     */
    readonly kind: 2;
    /**
     * The name of the method to call.
     * @type {string}
     */
    target: string;
    /**
     * The arguments to pass to the method.
     * @type {Array<any>}
     */
    args: Array<any>;
}
/**
 * Object to parse ESLint configuration comments.
 */
export class ConfigCommentParser {
    /**
     * Parses a list of "name:string_value" or/and "name" options divided by comma or
     * whitespace. Used for "global" comments.
     * @param {string} string The string to parse.
     * @returns {StringConfig} Result map object of names and string values, or null values if no value was provided.
     */
    parseStringConfig(string: string): StringConfig;
    /**
     * Parses a JSON-like config.
     * @param {string} string The string to parse.
     * @returns {({ok: true, config: RulesConfig}|{ok: false, error: {message: string}})} Result map object
     */
    parseJSONLikeConfig(string: string): ({
        ok: true;
        config: RulesConfig;
    } | {
        ok: false;
        error: {
            message: string;
        };
    });
    /**
     * Parses a config of values separated by comma.
     * @param {string} string The string to parse.
     * @returns {BooleanConfig} Result map of values and true values
     */
    parseListConfig(string: string): BooleanConfig;
    /**
     * Parses a directive comment into directive text and value.
     * @param {string} string The string with the directive to be parsed.
     * @returns {DirectiveComment|undefined} The parsed directive or `undefined` if the directive is invalid.
     */
    parseDirective(string: string): DirectiveComment | undefined;
    #private;
}
/**
 * A class to represent a directive comment.
 * @implements {IDirective}
 */
export class Directive implements IDirective {
    /**
     * Creates a new instance.
     * @param {Object} options The options for the directive.
     * @param {"disable"|"enable"|"disable-next-line"|"disable-line"} options.type The type of directive.
     * @param {unknown} options.node The node representing the directive.
     * @param {string} options.value The value of the directive.
     * @param {string} options.justification The justification for the directive.
     */
    constructor({ type, node, value, justification }: {
        type: "disable" | "enable" | "disable-next-line" | "disable-line";
        node: unknown;
        value: string;
        justification: string;
    });
    /**
     * The type of directive.
     * @type {DirectiveType}
     * @readonly
     */
    readonly type: DirectiveType;
    /**
     * The node representing the directive.
     * @type {unknown}
     * @readonly
     */
    readonly node: unknown;
    /**
     * Everything after the "eslint-disable" portion of the directive,
     * but before the "--" that indicates the justification.
     * @type {string}
     * @readonly
     */
    readonly value: string;
    /**
     * The justification for the directive.
     * @type {string}
     * @readonly
     */
    readonly justification: string;
}
/**
 * Source Code Base Object
 * @template {SourceCodeBaseTypeOptions & {RootNode: object, SyntaxElementWithLoc: object}} [Options=SourceCodeBaseTypeOptions & {RootNode: object, SyntaxElementWithLoc: object}]
 * @implements {TextSourceCode<Options>}
 */
export class TextSourceCodeBase<Options extends SourceCodeBaseTypeOptions & {
    RootNode: object;
    SyntaxElementWithLoc: object;
} = $eslintcore.SourceCodeBaseTypeOptions & {
    RootNode: object;
    SyntaxElementWithLoc: object;
}> implements TextSourceCode<Options> {
    /**
     * Creates a new instance.
     * @param {Object} options The options for the instance.
     * @param {string} options.text The source code text.
     * @param {Options['RootNode']} options.ast The root AST node.
     * @param {RegExp} [options.lineEndingPattern] The pattern to match lineEndings in the source code. Defaults to `/\r?\n/u`.
     */
    constructor({ text, ast, lineEndingPattern }: {
        text: string;
        ast: Options["RootNode"];
        lineEndingPattern?: RegExp;
    });
    /**
     * The AST of the source code.
     * @type {Options['RootNode']}
     */
    ast: Options["RootNode"];
    /**
     * The text of the source code.
     * @type {string}
     */
    text: string;
    /**
     * Returns the loc information for the given node or token.
     * @param {Options['SyntaxElementWithLoc']} nodeOrToken The node or token to get the loc information for.
     * @returns {SourceLocation} The loc information for the node or token.
     * @throws {Error} If the node or token does not have loc information.
     */
    getLoc(nodeOrToken: Options["SyntaxElementWithLoc"]): SourceLocation;
    /**
     * Converts a source text index into a `{ line: number, column: number }` pair.
     * @param {number} index The index of a character in a file.
     * @throws {TypeError|RangeError} If non-numeric index or index out of range.
     * @returns {{line: number, column: number}} A `{ line: number, column: number }` location object with 0 or 1-indexed line and 0 or 1-indexed column based on language.
     * @public
     */
    public getLocFromIndex(index: number): {
        line: number;
        column: number;
    };
    /**
     * Converts a `{ line: number, column: number }` pair into a source text index.
     * @param {Object} loc A line/column location.
     * @param {number} loc.line The line number of the location. (0 or 1-indexed based on language.)
     * @param {number} loc.column The column number of the location. (0 or 1-indexed based on language.)
     * @throws {TypeError|RangeError} If `loc` is not an object with a numeric
     * `line` and `column`, if the `line` is less than or equal to zero or
     * the `line` or `column` is out of the expected range.
     * @returns {number} The index of the line/column location in a file.
     * @public
     */
    public getIndexFromLoc(loc: {
        line: number;
        column: number;
    }): number;
    /**
     * Returns the range information for the given node or token.
     * @param {Options['SyntaxElementWithLoc']} nodeOrToken The node or token to get the range information for.
     * @returns {SourceRange} The range information for the node or token.
     * @throws {Error} If the node or token does not have range information.
     */
    getRange(nodeOrToken: Options["SyntaxElementWithLoc"]): SourceRange;
    /**
     * Returns the parent of the given node.
     * @param {Options['SyntaxElementWithLoc']} node The node to get the parent of.
     * @returns {Options['SyntaxElementWithLoc']|undefined} The parent of the node.
     * @throws {Error} If the method is not implemented in the subclass.
     */
    getParent(node: Options["SyntaxElementWithLoc"]): Options["SyntaxElementWithLoc"] | undefined;
    /**
     * Gets all the ancestors of a given node
     * @param {Options['SyntaxElementWithLoc']} node The node
     * @returns {Array<Options['SyntaxElementWithLoc']>} All the ancestor nodes in the AST, not including the provided node, starting
     * from the root node at index 0 and going inwards to the parent node.
     * @throws {TypeError} When `node` is missing.
     */
    getAncestors(node: Options["SyntaxElementWithLoc"]): Array<Options["SyntaxElementWithLoc"]>;
    /**
     * Gets the source code for the given node.
     * @param {Options['SyntaxElementWithLoc']} [node] The AST node to get the text for.
     * @param {number} [beforeCount] The number of characters before the node to retrieve.
     * @param {number} [afterCount] The number of characters after the node to retrieve.
     * @returns {string} The text representing the AST node.
     * @public
     */
    public getText(node?: Options["SyntaxElementWithLoc"], beforeCount?: number, afterCount?: number): string;
    /**
     * Gets the entire source text split into an array of lines.
     * @returns {Array<string>} The source text as an array of lines.
     * @public
     */
    public get lines(): Array<string>;
    /**
     * Traverse the source code and return the steps that were taken.
     * @returns {Iterable<TraversalStep>} The steps that were taken while traversing the source code.
     */
    traverse(): Iterable<TraversalStep>;
    #private;
}
/**
 * A class to represent a step in the traversal process where a node is visited.
 * @implements {VisitTraversalStep}
 */
export class VisitNodeStep implements VisitTraversalStep {
    /**
     * Creates a new instance.
     * @param {Object} options The options for the step.
     * @param {object} options.target The target of the step.
     * @param {1|2} options.phase The phase of the step.
     * @param {Array<any>} options.args The arguments of the step.
     */
    constructor({ target, phase, args }: {
        target: object;
        phase: 1 | 2;
        args: Array<any>;
    });
    /**
     * The type of the step.
     * @type {"visit"}
     * @readonly
     */
    readonly type: "visit";
    /**
     * The kind of the step. Represents the same data as the `type` property
     * but it's a number for performance.
     * @type {1}
     * @readonly
     */
    readonly kind: 1;
    /**
     * The target of the step.
     * @type {object}
     */
    target: object;
    /**
     * The phase of the step.
     * @type {1|2}
     */
    phase: 1 | 2;
    /**
     * The arguments of the step.
     * @type {Array<any>}
     */
    args: Array<any>;
}
import type * as $eslintcore from "@eslint/core";
import type * as $typests from "./types.cts";
/**
 * Represents a directive comment.
 */
declare class DirectiveComment {
    /**
     * Creates a new directive comment.
     * @param {string} label The label of the directive.
     * @param {string} value The value of the directive.
     * @param {string} justification The justification of the directive.
     */
    constructor(label: string, value: string, justification: string);
    /**
     * The label of the directive, such as "eslint", "eslint-disable", etc.
     * @type {string}
     */
    label: string;
    /**
     * The value of the directive (the string after the label).
     * @type {string}
     */
    value: string;
    /**
     * The justification of the directive (the string after the --).
     * @type {string}
     */
    justification: string;
}
export {};
$Fx;/**
 * @fileoverview Types for the plugin-kit package.
 * @author Nicholas C. Zakas
 */

//------------------------------------------------------------------------------
// Imports
//------------------------------------------------------------------------------

import type {
	RuleDefinition,
	RuleDefinitionTypeOptions,
	RuleVisitor,
} from "@eslint/core";

//------------------------------------------------------------------------------
// Exports
//------------------------------------------------------------------------------

/**
 * Defaults for non-language-related `RuleDefinition` options.
 */
export interface CustomRuleTypeDefinitions {
	RuleOptions: unknown[];
	MessageIds: string;
	ExtRuleDocs: Record<string, unknown>;
}

/**
 * A helper type to define language specific specializations of the `RuleDefinition` type.
 *
 * @example
 * ```ts
 * type YourRuleDefinition<
 * 	Options extends Partial<CustomRuleTypeDefinitions> = {},
 * > = CustomRuleDefinitionType<
 * 	{
 * 		LangOptions: YourLanguageOptions;
 * 		Code: YourSourceCode;
 * 		Visitor: YourRuleVisitor;
 * 		Node: YourNode;
 * 	},
 * 	Options
 * >;
 * ```
 */
export type CustomRuleDefinitionType<
	LanguageSpecificOptions extends Omit<
		RuleDefinitionTypeOptions,
		keyof CustomRuleTypeDefinitions
	>,
	Options extends Partial<CustomRuleTypeDefinitions>,
> = RuleDefinition<
	// Language specific type options (non-configurable)
	LanguageSpecificOptions &
		Required<
			// Rule specific type options (custom)
			Options &
				// Rule specific type options (defaults)
				Omit<CustomRuleTypeDefinitions, keyof Options>
		>
>;

/**
 * Adds matching `:exit` selector properties for each key of a `RuleVisitor`.
 */
export type CustomRuleVisitorWithExit<RuleVisitorType extends RuleVisitor> = {
	[Key in keyof RuleVisitorType as
		| Key
		| `${Key & string}:exit`]: RuleVisitorType[Key];
};

/**
 * A map of names to string values, or `null` when no value is provided.
 */
export type StringConfig = Record<string, string | null>;

/**
 * A map of names to boolean flags.
 */
export type BooleanConfig = Record<string, boolean>;
0T'ux{`Types for the plugin-kit package.
 * @author Nicholas C. Zakas
 */
import type { RuleDefinition,5$, RuleVisitor } from "@eslint/core";9FCG:ݳh;bAdds matching `:exit` selector properties for each key of a `RuleVisitor`.
 */
export type CustomRuleVisitorWithExit<RuleVisitorType extends RuleVisitor> = {
    [Key in keyof RuleVisitorType as Key | `${Key & string}:exit`]: RuleVisitorType[Key];
};
/**h
 * A map of names to string values, or `null` when no value is provided.
 */
export type StringConfig =rk | null>;
/**
 * A map of names to boolean flags.
 */
export type BooleanConfig = Record<string, boolean>;
M	x k100644 index.d.ts jn5'3{XA!~tD100644 index.js ⺙&R/l񀤃e(100644 types.d.ts qĴ~ϺzԗԠBb+100644 types.ts rۨjcJ=xE1export type VisitTraversalStep = $eslintcore.VisitTraversalStep;
export type CallTraversalStep = $eslintcore.CallTraversalStep;
export type TraversalStep = $eslintcore.TraversalStep;
export type SourceLocation = $eslintcore.SourceLocation;
export type SourceLocationWithOffset = $eslintcore.SourceLocationWithOffset;
export type SourceRange = $eslintcore.SourceRange;
export type IDirective = $eslintcore.Directive;
export type DirectiveType = $eslintcore.DirectiveType;
export type SourceCodeBaseTypeOptions = $eslintcore.SourceCodeBaseTypeOptions;
export type TextSourceCode<Options extends SourceCodeBaseTypeOptions = $eslintcore.SourceCodeBaseTypeOptions> = import("@eslint/core").TextSourceCode<Options>;
export type RuleVisitor = $eslintcore.RuleVisitor;
export type CustomRuleVisitorWithExit<RuleVisitorType extends RuleVisitor> = import("./types.ts").CustomRuleVisitorWithExit<RuleVisitorType>;
export type CustomRuleTypeDefinitions = $typests.CustomRuleTypeDefinitions;
export type CustomRuleDefinitionType<LanguageSpecificOptions extends Omit<import("@eslint/core").RuleDefinitionTypeOptions, keyof CustomRuleTypeDefinitions>, Options extends Partial<CustomRuleTypeDefinitions>> = import("./types.ts").CustomRuleDefinitionType<LanguageSpecificOptions, Options>;
export type RuleConfig = $eslintcore.RuleConfig;
export type RulesConfig = $eslintcore.RulesConfig;
export type StringConfig = $typests.StringConfig;
export type BooleanConfig = $typests.BooleanConfig;
/**
 * A class to represent a step in the traversal process where a
 * method is called.
 * @implements {CallTraversalStep}
 */
export class CallMethodStep implements CallTraversalStep {
    /**
     * Creates a new instance.
     * @param {Object} options The options for the step.
     * @param {string} options.target The target of the step.
     * @param {Array<any>} options.args The arguments of the step.
     */
    constructor({ target, args }: {
        target: string;
        args: Array<any>;
    });
    /**
     * The type of the step.
     * @type {"call"}
     * @readonly
     */
    readonly type: "call";
    /**
     * The kind of the step. Represents the same data as the `type` property
     * but it's a number for performance.
     * @type {2}
     * @readonly
     */
    readonly kind: 2;
    /**
     * The name of the method to call.
     * @type {string}
     */
    target: string;
    /**
     * The arguments to pass to the method.
     * @type {Array<any>}
     */
    args: Array<any>;
}
/**
 * Object to parse ESLint configuration comments.
 */
export class ConfigCommentParser {
    /**
     * Parses a list of "name:string_value" or/and "name" options divided by comma or
     * whitespace. Used for "global" comments.
     * @param {string} string The string to parse.
     * @returns {StringConfig} Result map object of names and string values, or null values if no value was provided.
     */
    parseStringConfig(string: string): StringConfig;
    /**
     * Parses a JSON-like config.
     * @param {string} string The string to parse.
     * @returns {({ok: true, config: RulesConfig}|{ok: false, error: {message: string}})} Result map object
     */
    parseJSONLikeConfig(string: string): ({
        ok: true;
        config: RulesConfig;
    } | {
        ok: false;
        error: {
            message: string;
        };
    });
    /**
     * Parses a config of values separated by comma.
     * @param {string} string The string to parse.
     * @returns {BooleanConfig} Result map of values and true values
     */
    parseListConfig(string: string): BooleanConfig;
    /**
     * Parses a directive comment into directive text and value.
     * @param {string} string The string with the directive to be parsed.
     * @returns {DirectiveComment|undefined} The parsed directive or `undefined` if the directive is invalid.
     */
    parseDirective(string: string): DirectiveComment | undefined;
    #private;
}
/**
 * A class to represent a directive comment.
 * @implements {IDirective}
 */
export class Directive implements IDirective {
    /**
     * Creates a new instance.
     * @param {Object} options The options for the directive.
     * @param {"disable"|"enable"|"disable-next-line"|"disable-line"} options.type The type of directive.
     * @param {unknown} options.node The node representing the directive.
     * @param {string} options.value The value of the directive.
     * @param {string} options.justification The justification for the directive.
     */
    constructor({ type, node, value, justification }: {
        type: "disable" | "enable" | "disable-next-line" | "disable-line";
        node: unknown;
        value: string;
        justification: string;
    });
    /**
     * The type of directive.
     * @type {DirectiveType}
     * @readonly
     */
    readonly type: DirectiveType;
    /**
     * The node representing the directive.
     * @type {unknown}
     * @readonly
     */
    readonly node: unknown;
    /**
     * Everything after the "eslint-disable" portion of the directive,
     * but before the "--" that indicates the justification.
     * @type {string}
     * @readonly
     */
    readonly value: string;
    /**
     * The justification for the directive.
     * @type {string}
     * @readonly
     */
    readonly justification: string;
}
/**
 * Source Code Base Object
 * @template {SourceCodeBaseTypeOptions & {RootNode: object, SyntaxElementWithLoc: object}} [Options=SourceCodeBaseTypeOptions & {RootNode: object, SyntaxElementWithLoc: object}]
 * @implements {TextSourceCode<Options>}
 */
export class TextSourceCodeBase<Options extends SourceCodeBaseTypeOptions & {
    RootNode: object;
    SyntaxElementWithLoc: object;
} = $eslintcore.SourceCodeBaseTypeOptions & {
    RootNode: object;
    SyntaxElementWithLoc: object;
}> implements TextSourceCode<Options> {
    /**
     * Creates a new instance.
     * @param {Object} options The options for the instance.
     * @param {string} options.text The source code text.
     * @param {Options['RootNode']} options.ast The root AST node.
     * @param {RegExp} [options.lineEndingPattern] The pattern to match lineEndings in the source code. Defaults to `/\r?\n/u`.
     */
    constructor({ text, ast, lineEndingPattern }: {
        text: string;
        ast: Options["RootNode"];
        lineEndingPattern?: RegExp;
    });
    /**
     * The AST of the source code.
     * @type {Options['RootNode']}
     */
    ast: Options["RootNode"];
    /**
     * The text of the source code.
     * @type {string}
     */
    text: string;
    /**
     * Returns the loc information for the given node or token.
     * @param {Options['SyntaxElementWithLoc']} nodeOrToken The node or token to get the loc information for.
     * @returns {SourceLocation} The loc information for the node or token.
     * @throws {Error} If the node or token does not have loc information.
     */
    getLoc(nodeOrToken: Options["SyntaxElementWithLoc"]): SourceLocation;
    /**
     * Converts a source text index into a `{ line: number, column: number }` pair.
     * @param {number} index The index of a character in a file.
     * @throws {TypeError|RangeError} If non-numeric index or index out of range.
     * @returns {{line: number, column: number}} A `{ line: number, column: number }` location object with 0 or 1-indexed line and 0 or 1-indexed column based on language.
     * @public
     */
    public getLocFromIndex(index: number): {
        line: number;
        column: number;
    };
    /**
     * Converts a `{ line: number, column: number }` pair into a source text index.
     * @param {Object} loc A line/column location.
     * @param {number} loc.line The line number of the location. (0 or 1-indexed based on language.)
     * @param {number} loc.column The column number of the location. (0 or 1-indexed based on language.)
     * @throws {TypeError|RangeError} If `loc` is not an object with a numeric
     * `line` and `column`, if the `line` is less than or equal to zero or
     * the `line` or `column` is out of the expected range.
     * @returns {number} The index of the line/column location in a file.
     * @public
     */
    public getIndexFromLoc(loc: {
        line: number;
        column: number;
    }): number;
    /**
     * Returns the range information for the given node or token.
     * @param {Options['SyntaxElementWithLoc']} nodeOrToken The node or token to get the range information for.
     * @returns {SourceRange} The range information for the node or token.
     * @throws {Error} If the node or token does not have range information.
     */
    getRange(nodeOrToken: Options["SyntaxElementWithLoc"]): SourceRange;
    /**
     * Returns the parent of the given node.
     * @param {Options['SyntaxElementWithLoc']} node The node to get the parent of.
     * @returns {Options['SyntaxElementWithLoc']|undefined} The parent of the node.
     * @throws {Error} If the method is not implemented in the subclass.
     */
    getParent(node: Options["SyntaxElementWithLoc"]): Options["SyntaxElementWithLoc"] | undefined;
    /**
     * Gets all the ancestors of a given node
     * @param {Options['SyntaxElementWithLoc']} node The node
     * @returns {Array<Options['SyntaxElementWithLoc']>} All the ancestor nodes in the AST, not including the provided node, starting
     * from the root node at index 0 and going inwards to the parent node.
     * @throws {TypeError} When `node` is missing.
     */
    getAncestors(node: Options["SyntaxElementWithLoc"]): Array<Options["SyntaxElementWithLoc"]>;
    /**
     * Gets the source code for the given node.
     * @param {Options['SyntaxElementWithLoc']} [node] The AST node to get the text for.
     * @param {number} [beforeCount] The number of characters before the node to retrieve.
     * @param {number} [afterCount] The number of characters after the node to retrieve.
     * @returns {string} The text representing the AST node.
     * @public
     */
    public getText(node?: Options["SyntaxElementWithLoc"], beforeCount?: number, afterCount?: number): string;
    /**
     * Gets the entire source text split into an array of lines.
     * @returns {Array<string>} The source text as an array of lines.
     * @public
     */
    public get lines(): Array<string>;
    /**
     * Traverse the source code and return the steps that were taken.
     * @returns {Iterable<TraversalStep>} The steps that were taken while traversing the source code.
     */
    traverse(): Iterable<TraversalStep>;
    #private;
}
/**
 * A class to represent a step in the traversal process where a node is visited.
 * @implements {VisitTraversalStep}
 */
export class VisitNodeStep implements VisitTraversalStep {
    /**
     * Creates a new instance.
     * @param {Object} options The options for the step.
     * @param {object} options.target The target of the step.
     * @param {1|2} options.phase The phase of the step.
     * @param {Array<any>} options.args The arguments of the step.
     */
    constructor({ target, phase, args }: {
        target: object;
        phase: 1 | 2;
        args: Array<any>;
    });
    /**
     * The type of the step.
     * @type {"visit"}
     * @readonly
     */
    readonly type: "visit";
    /**
     * The kind of the step. Represents the same data as the `type` property
     * but it's a number for performance.
     * @type {1}
     * @readonly
     */
    readonly kind: 1;
    /**
     * The target of the step.
     * @type {object}
     */
    target: object;
    /**
     * The phase of the step.
     * @type {1|2}
     */
    phase: 1 | 2;
    /**
     * The arguments of the step.
     * @type {Array<any>}
     */
    args: Array<any>;
}
import type * as $eslintcore from "@eslint/core";
import type * as $typests from "./types.ts";
/**
 * Represents a directive comment.
 */
declare class DirectiveComment {
    /**
     * Creates a new directive comment.
     * @param {string} label The label of the directive.
     * @param {string} value The value of the directive.
     * @param {string} justification The justification of the directive.
     */
    constructor(label: string, value: string, justification: string);
    /**
     * The label of the directive, such as "eslint", "eslint-disable", etc.
     * @type {string}
     */
    label: string;
    /**
     * The value of the directive (the string after the label).
     * @type {string}
     */
    value: string;
    /**
     * The justification of the directive (the string after the --).
     * @type {string}
     */
    justification: string;
}
export {};
̺xze// @ts-self-types="./index.d.ts"
import levn from 'levn';

/**
 * @fileoverview Config Comment Parser
 * @author Nicholas C. Zakas
 */


//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------

/** @import * as $eslintcore from "@eslint/core"; */
/** @typedef {$eslintcore.RuleConfig} RuleConfig */
/** @typedef {$eslintcore.RulesConfig} RulesConfig */
/** @import * as $typests from "./types.ts"; */
/** @typedef {$typests.StringConfig} StringConfig */
/** @typedef {$typests.BooleanConfig} BooleanConfig */

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

const directivesPattern = /^([a-z]+(?:-[a-z]+)*)(?:\s|$)/u;
const validSeverities = new Set([0, 1, 2, "off", "warn", "error"]);

/**
 * Determines if the severity in the rule configuration is valid.
 * @param {RuleConfig} ruleConfig A rule's configuration.
 * @returns {boolean} `true` if the severity is valid, otherwise `false`.
 */
function isSeverityValid(ruleConfig) {
	const severity = Array.isArray(ruleConfig) ? ruleConfig[0] : ruleConfig;
	return validSeverities.has(severity);
}

/**
 * Determines if all severities in the rules configuration are valid.
 * @param {RulesConfig} rulesConfig The rules configuration to check.
 * @returns {boolean} `true` if all severities are valid, otherwise `false`.
 */
function isEverySeverityValid(rulesConfig) {
	return Object.values(rulesConfig).every(isSeverityValid);
}

/**
 * Represents a directive comment.
 */
class DirectiveComment {
	/**
	 * The label of the directive, such as "eslint", "eslint-disable", etc.
	 * @type {string}
	 */
	label = "";

	/**
	 * The value of the directive (the string after the label).
	 * @type {string}
	 */
	value = "";

	/**
	 * The justification of the directive (the string after the --).
	 * @type {string}
	 */
	justification = "";

	/**
	 * Creates a new directive comment.
	 * @param {string} label The label of the directive.
	 * @param {string} value The value of the directive.
	 * @param {string} justification The justification of the directive.
	 */
	constructor(label, value, justification) {
		this.label = label;
		this.value = value;
		this.justification = justification;
	}
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

/**
 * Object to parse ESLint configuration comments.
 */
class ConfigCommentParser {
	/**
	 * Parses a list of "name:string_value" or/and "name" options divided by comma or
	 * whitespace. Used for "global" comments.
	 * @param {string} string The string to parse.
	 * @returns {StringConfig} Result map object of names and string values, or null values if no value was provided.
	 */
	parseStringConfig(string) {
		const items = /** @type {StringConfig} */ ({});

		// Collapse whitespace around `:` and `,` to make parsing easier
		const trimmedString = string
			.trim()
			.replace(/(?<!\s)\s*([:,])\s*/gu, "$1");

		trimmedString.split(/\s|,+/u).forEach(name => {
			if (!name) {
				return;
			}

			// value defaults to null (if not provided), e.g: "foo" => ["foo", null]
			const [key, value = null] = name.split(":");

			items[key] = value;
		});

		return items;
	}

	/**
	 * Parses a JSON-like config.
	 * @param {string} string The string to parse.
	 * @returns {({ok: true, config: RulesConfig}|{ok: false, error: {message: string}})} Result map object
	 */
	parseJSONLikeConfig(string) {
		// Parses a JSON-like comment by the same way as parsing CLI option.
		try {
			const items =
				/** @type {RulesConfig} */ (levn.parse("Object", string)) || {};

			/*
			 * When the configuration has any invalid severities, it should be completely
			 * ignored. This is because the configuration is not valid and should not be
			 * applied.
			 *
			 * For example, the following configuration is invalid:
			 *
			 *    "no-alert: 2 no-console: 2"
			 *
			 * This results in a configuration of { "no-alert": "2 no-console: 2" }, which is
			 * not valid. In this case, the configuration should be ignored.
			 */
			if (isEverySeverityValid(items)) {
				return {
					ok: true,
					config: items,
				};
			}
		} catch {
			// levn parsing error: ignore to parse the string by a fallback.
		}

		/*
		 * Optionator cannot parse commaless notations.
		 * But we are supporting that. So this is a fallback for that.
		 */
		const normalizedString = string
			.replace(/(?<![-a-zA-Z0-9/])([-a-zA-Z0-9/]+):/gu, '"$1":')
			.replace(/([\]0-9])\s+(?=")/u, "$1,");

		try {
			const items = JSON.parse(`{${normalizedString}}`);

			return {
				ok: true,
				config: items,
			};
		} catch (ex) {
			const errorMessage = ex instanceof Error ? ex.message : String(ex);

			return {
				ok: false,
				error: {
					message: `Failed to parse JSON from '${normalizedString}': ${errorMessage}`,
				},
			};
		}
	}

	/**
	 * Parses a config of values separated by comma.
	 * @param {string} string The string to parse.
	 * @returns {BooleanConfig} Result map of values and true values
	 */
	parseListConfig(string) {
		const items = /** @type {BooleanConfig} */ ({});

		string.split(",").forEach(name => {
			const trimmedName = name
				.trim()
				.replace(
					/^(?<quote>['"]?)(?<ruleId>.*)\k<quote>$/su,
					"$<ruleId>",
				);

			if (trimmedName) {
				items[trimmedName] = true;
			}
		});

		return items;
	}

	/**
	 * Extract the directive and the justification from a given directive comment and trim them.
	 * @param {string} value The comment text to extract.
	 * @returns {{directivePart: string, justificationPart: string}} The extracted directive and justification.
	 */
	#extractDirectiveComment(value) {
		const match = /\s-{2,}\s/u.exec(value);

		if (!match) {
			return { directivePart: value.trim(), justificationPart: "" };
		}

		const directive = value.slice(0, match.index).trim();
		const justification = value.slice(match.index + match[0].length).trim();

		return { directivePart: directive, justificationPart: justification };
	}

	/**
	 * Parses a directive comment into directive text and value.
	 * @param {string} string The string with the directive to be parsed.
	 * @returns {DirectiveComment|undefined} The parsed directive or `undefined` if the directive is invalid.
	 */
	parseDirective(string) {
		const { directivePart, justificationPart } =
			this.#extractDirectiveComment(string);
		const match = directivesPattern.exec(directivePart);

		if (!match) {
			return undefined;
		}

		const directiveText = match[1];
		const directiveValue = directivePart.slice(
			match.index + directiveText.length,
		);

		return new DirectiveComment(
			directiveText,
			directiveValue.trim(),
			justificationPart,
		);
	}
}

/**
 * @fileoverview A collection of helper classes for implementing `SourceCode`.
 * @author Nicholas C. Zakas
 */

/* eslint class-methods-use-this: off -- Required to complete interface. */

//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------

/** @typedef {$eslintcore.VisitTraversalStep} VisitTraversalStep */
/** @typedef {$eslintcore.CallTraversalStep} CallTraversalStep */
/** @typedef {$eslintcore.TraversalStep} TraversalStep */
/** @typedef {$eslintcore.SourceLocation} SourceLocation */
/** @typedef {$eslintcore.SourceLocationWithOffset} SourceLocationWithOffset */
/** @typedef {$eslintcore.SourceRange} SourceRange */
/** @typedef {$eslintcore.Directive} IDirective */
/** @typedef {$eslintcore.DirectiveType} DirectiveType */
/** @typedef {$eslintcore.SourceCodeBaseTypeOptions} SourceCodeBaseTypeOptions */
/**
 * @typedef {import("@eslint/core").TextSourceCode<Options>} TextSourceCode
 * @template {SourceCodeBaseTypeOptions} [Options=SourceCodeBaseTypeOptions]
 */
/** @typedef {$eslintcore.RuleVisitor} RuleVisitor */
/**
 * @typedef {import("./types.ts").CustomRuleVisitorWithExit<RuleVisitorType>} CustomRuleVisitorWithExit
 * @template {RuleVisitor} RuleVisitorType
 */
/** @typedef {$typests.CustomRuleTypeDefinitions} CustomRuleTypeDefinitions */
/**
 * @typedef {import("./types.ts").CustomRuleDefinitionType<LanguageSpecificOptions, Options>} CustomRuleDefinitionType
 * @template {Omit<import("@eslint/core").RuleDefinitionTypeOptions, keyof CustomRuleTypeDefinitions>} LanguageSpecificOptions
 * @template {Partial<CustomRuleTypeDefinitions>} Options
 */

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

/**
 * Determines if a node has ESTree-style loc information.
 * @param {object} node The node to check.
 * @returns {node is {loc:SourceLocation}} `true` if the node has ESTree-style loc information, `false` if not.
 */
function hasESTreeStyleLoc(node) {
	return "loc" in node;
}

/**
 * Determines if a node has position-style loc information.
 * @param {object} node The node to check.
 * @returns {node is {position:SourceLocation}} `true` if the node has position-style range information, `false` if not.
 */
function hasPosStyleLoc(node) {
	return "position" in node;
}

/**
 * Determines if a node has ESTree-style range information.
 * @param {object} node The node to check.
 * @returns {node is {range:SourceRange}} `true` if the node has ESTree-style range information, `false` if not.
 */
function hasESTreeStyleRange(node) {
	return "range" in node;
}

/**
 * Determines if a node has position-style range information.
 * @param {object} node The node to check.
 * @returns {node is {position:SourceLocationWithOffset}} `true` if the node has position-style range information, `false` if not.
 */
function hasPosStyleRange(node) {
	return "position" in node;
}

/**
 * Performs binary search to find the line number containing a given target index.
 * Returns the lower bound - the index of the first element greater than the target.
 * **Please note that the `lineStartIndices` should be sorted in ascending order**.
 * - Time Complexity: O(log n) - Significantly faster than linear search for large files.
 * @param {number[]} lineStartIndices Sorted array of line start indices.
 * @param {number} targetIndex The target index to find the line number for.
 * @returns {number} The line number for the target index.
 */
function findLineNumberBinarySearch(lineStartIndices, targetIndex) {
	let low = 0;
	let high = lineStartIndices.length - 1;

	while (low < high) {
		const mid = ((low + high) / 2) | 0; // Use bitwise OR to floor the division.

		if (targetIndex < lineStartIndices[mid]) {
			high = mid;
		} else {
			low = mid + 1;
		}
	}

	return low;
}

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * A class to represent a step in the traversal process where a node is visited.
 * @implements {VisitTraversalStep}
 */
class VisitNodeStep {
	/**
	 * The type of the step.
	 * @type {"visit"}
	 * @readonly
	 */
	type = "visit";

	/**
	 * The kind of the step. Represents the same data as the `type` property
	 * but it's a number for performance.
	 * @type {1}
	 * @readonly
	 */
	kind = 1;

	/**
	 * The target of the step.
	 * @type {object}
	 */
	target;

	/**
	 * The phase of the step.
	 * @type {1|2}
	 */
	phase;

	/**
	 * The arguments of the step.
	 * @type {Array<any>}
	 */
	args;

	/**
	 * Creates a new instance.
	 * @param {Object} options The options for the step.
	 * @param {object} options.target The target of the step.
	 * @param {1|2} options.phase The phase of the step.
	 * @param {Array<any>} options.args The arguments of the step.
	 */
	constructor({ target, phase, args }) {
		this.target = target;
		this.phase = phase;
		this.args = args;
	}
}

/**
 * A class to represent a step in the traversal process where a
 * method is called.
 * @implements {CallTraversalStep}
 */
class CallMethodStep {
	/**
	 * The type of the step.
	 * @type {"call"}
	 * @readonly
	 */
	type = "call";

	/**
	 * The kind of the step. Represents the same data as the `type` property
	 * but it's a number for performance.
	 * @type {2}
	 * @readonly
	 */
	kind = 2;

	/**
	 * The name of the method to call.
	 * @type {string}
	 */
	target;

	/**
	 * The arguments to pass to the method.
	 * @type {Array<any>}
	 */
	args;

	/**
	 * Creates a new instance.
	 * @param {Object} options The options for the step.
	 * @param {string} options.target The target of the step.
	 * @param {Array<any>} options.args The arguments of the step.
	 */
	constructor({ target, args }) {
		this.target = target;
		this.args = args;
	}
}

/**
 * A class to represent a directive comment.
 * @implements {IDirective}
 */
class Directive {
	/**
	 * The type of directive.
	 * @type {DirectiveType}
	 * @readonly
	 */
	type;

	/**
	 * The node representing the directive.
	 * @type {unknown}
	 * @readonly
	 */
	node;

	/**
	 * Everything after the "eslint-disable" portion of the directive,
	 * but before the "--" that indicates the justification.
	 * @type {string}
	 * @readonly
	 */
	value;

	/**
	 * The justification for the directive.
	 * @type {string}
	 * @readonly
	 */
	justification;

	/**
	 * Creates a new instance.
	 * @param {Object} options The options for the directive.
	 * @param {"disable"|"enable"|"disable-next-line"|"disable-line"} options.type The type of directive.
	 * @param {unknown} options.node The node representing the directive.
	 * @param {string} options.value The value of the directive.
	 * @param {string} options.justification The justification for the directive.
	 */
	constructor({ type, node, value, justification }) {
		this.type = type;
		this.node = node;
		this.value = value;
		this.justification = justification;
	}
}

/**
 * Source Code Base Object
 * @template {SourceCodeBaseTypeOptions & {RootNode: object, SyntaxElementWithLoc: object}} [Options=SourceCodeBaseTypeOptions & {RootNode: object, SyntaxElementWithLoc: object}]
 * @implements {TextSourceCode<Options>}
 */
class TextSourceCodeBase {
	/**
	 * The lines of text in the source code.
	 * @type {Array<string>}
	 */
	#lines = [];

	/**
	 * The indices of the start of each line in the source code.
	 * @type {Array<number>}
	 */
	#lineStartIndices = [0];

	/**
	 * The pattern to match lineEndings in the source code.
	 * @type {RegExp}
	 */
	#lineEndingPattern;

	/**
	 * The AST of the source code.
	 * @type {Options['RootNode']}
	 */
	ast;

	/**
	 * The text of the source code.
	 * @type {string}
	 */
	text;

	/**
	 * Creates a new instance.
	 * @param {Object} options The options for the instance.
	 * @param {string} options.text The source code text.
	 * @param {Options['RootNode']} options.ast The root AST node.
	 * @param {RegExp} [options.lineEndingPattern] The pattern to match lineEndings in the source code. Defaults to `/\r?\n/u`.
	 */
	constructor({ text, ast, lineEndingPattern = /\r?\n/u }) {
		this.ast = ast;
		this.text = text;
		// Remove the global(`g`) and sticky(`y`) flags from the `lineEndingPattern` to avoid issues with lastIndex.
		this.#lineEndingPattern = new RegExp(
			lineEndingPattern.source,
			lineEndingPattern.flags.replace(/[gy]/gu, ""),
		);
	}

	/**
	 * Finds the next line in the source text and updates `#lines` and `#lineStartIndices`.
	 * @param {string} text The text to search for the next line.
	 * @returns {boolean} `true` if a next line was found, `false` otherwise.
	 */
	#findNextLine(text) {
		const match = this.#lineEndingPattern.exec(text);

		if (!match) {
			return false;
		}

		this.#lines.push(text.slice(0, match.index));
		this.#lineStartIndices.push(
			(this.#lineStartIndices.at(-1) ?? 0) +
				match.index +
				match[0].length,
		);

		return true;
	}

	/**
	 * Ensures `#lines` is lazily calculated from the source text.
	 * @returns {void}
	 */
	#ensureLines() {
		// If `#lines` has already been calculated, do nothing.
		if (this.#lines.length === this.#lineStartIndices.length) {
			return;
		}

		while (
			this.#findNextLine(this.text.slice(this.#lineStartIndices.at(-1)))
		) {
			// Continue parsing until no more matches are found.
		}

		this.#lines.push(this.text.slice(this.#lineStartIndices.at(-1)));

		Object.freeze(this.#lines);
	}

	/**
	 * Ensures `#lineStartIndices` is lazily calculated up to the specified index.
	 * @param {number} index The index of a character in a file.
	 * @returns {void}
	 */
	#ensureLineStartIndicesFromIndex(index) {
		// If we've already parsed up to or beyond this index, do nothing.
		if (index <= (this.#lineStartIndices.at(-1) ?? 0)) {
			return;
		}

		while (
			index > (this.#lineStartIndices.at(-1) ?? 0) &&
			this.#findNextLine(this.text.slice(this.#lineStartIndices.at(-1)))
		) {
			// Continue parsing until no more matches are found.
		}
	}

	/**
	 * Ensures `#lineStartIndices` is lazily calculated up to the specified loc.
	 * @param {Object} loc A line/column location.
	 * @param {number} loc.line The line number of the location. (0 or 1-indexed based on language.)
	 * @param {number} lineStart The line number at which the parser starts counting.
	 * @returns {void}
	 */
	#ensureLineStartIndicesFromLoc(loc, lineStart) {
		// Calculate line indices up to the potentially next line, as it is needed for the follow‑up calculation.
		const nextLocLineIndex = loc.line - lineStart + 1;
		const lastCalculatedLineIndex = this.#lineStartIndices.length - 1;
		let additionalLinesNeeded = nextLocLineIndex - lastCalculatedLineIndex;

		// If we've already parsed up to or beyond this line, do nothing.
		if (additionalLinesNeeded <= 0) {
			return;
		}

		while (
			additionalLinesNeeded > 0 &&
			this.#findNextLine(this.text.slice(this.#lineStartIndices.at(-1)))
		) {
			// Continue parsing until no more matches are found or we have enough lines.
			additionalLinesNeeded -= 1;
		}
	}

	/**
	 * Returns the loc information for the given node or token.
	 * @param {Options['SyntaxElementWithLoc']} nodeOrToken The node or token to get the loc information for.
	 * @returns {SourceLocation} The loc information for the node or token.
	 * @throws {Error} If the node or token does not have loc information.
	 */
	getLoc(nodeOrToken) {
		if (hasESTreeStyleLoc(nodeOrToken)) {
			return nodeOrToken.loc;
		}

		if (hasPosStyleLoc(nodeOrToken)) {
			return nodeOrToken.position;
		}

		throw new Error(
			"Custom getLoc() method must be implemented in the subclass.",
		);
	}

	/**
	 * Converts a source text index into a `{ line: number, column: number }` pair.
	 * @param {number} index The index of a character in a file.
	 * @throws {TypeError|RangeError} If non-numeric index or index out of range.
	 * @returns {{line: number, column: number}} A `{ line: number, column: number }` location object with 0 or 1-indexed line and 0 or 1-indexed column based on language.
	 * @public
	 */
	getLocFromIndex(index) {
		if (typeof index !== "number") {
			throw new TypeError("Expected `index` to be a number.");
		}

		if (index < 0 || index > this.text.length) {
			throw new RangeError(
				`Index out of range (requested index ${index}, but source text has length ${this.text.length}).`,
			);
		}

		const {
			start: { line: lineStart, column: columnStart },
			end: { line: lineEnd, column: columnEnd },
		} = this.getLoc(this.ast);

		// If the index is at the start, return the start location of the root node.
		if (index === 0) {
			return {
				line: lineStart,
				column: columnStart,
			};
		}

		// If the index is `this.text.length`, return the location one "spot" past the last character of the file.
		if (index === this.text.length) {
			return {
				line: lineEnd,
				column: columnEnd,
			};
		}

		// Ensure `#lineStartIndices` are lazily calculated.
		this.#ensureLineStartIndicesFromIndex(index);

		/*
		 * To figure out which line `index` is on, determine the last place at which index could
		 * be inserted into `#lineStartIndices` to keep the list sorted.
		 */
		const lineNumber =
			(index >= (this.#lineStartIndices.at(-1) ?? 0)
				? this.#lineStartIndices.length
				: findLineNumberBinarySearch(this.#lineStartIndices, index)) -
			1 +
			lineStart;

		return {
			line: lineNumber,
			column:
				index -
				this.#lineStartIndices[lineNumber - lineStart] +
				columnStart,
		};
	}

	/**
	 * Converts a `{ line: number, column: number }` pair into a source text index.
	 * @param {Object} loc A line/column location.
	 * @param {number} loc.line The line number of the location. (0 or 1-indexed based on language.)
	 * @param {number} loc.column The column number of the location. (0 or 1-indexed based on language.)
	 * @throws {TypeError|RangeError} If `loc` is not an object with a numeric
	 * `line` and `column`, if the `line` is less than or equal to zero or
	 * the `line` or `column` is out of the expected range.
	 * @returns {number} The index of the line/column location in a file.
	 * @public
	 */
	getIndexFromLoc(loc) {
		if (
			loc === null ||
			typeof loc !== "object" ||
			typeof loc.line !== "number" ||
			typeof loc.column !== "number"
		) {
			throw new TypeError(
				"Expected `loc` to be an object with numeric `line` and `column` properties.",
			);
		}

		const {
			start: { line: lineStart, column: columnStart },
			end: { line: lineEnd, column: columnEnd },
		} = this.getLoc(this.ast);

		if (loc.line < lineStart || lineEnd < loc.line) {
			throw new RangeError(
				`Line number out of range (line ${loc.line} requested). Valid range: ${lineStart}-${lineEnd}`,
			);
		}

		// If the loc is at the start, return the start index of the root node.
		if (loc.line === lineStart && loc.column === columnStart) {
			return 0;
		}

		// If the loc is at the end, return the index one "spot" past the last character of the file.
		if (loc.line === lineEnd && loc.column === columnEnd) {
			return this.text.length;
		}

		// Ensure `#lineStartIndices` are lazily calculated.
		this.#ensureLineStartIndicesFromLoc(loc, lineStart);

		const isLastLine = loc.line === lineEnd;
		const lineStartIndex = this.#lineStartIndices[loc.line - lineStart];
		const lineEndIndex = isLastLine
			? this.text.length
			: this.#lineStartIndices[loc.line - lineStart + 1];
		const positionIndex = lineStartIndex + loc.column - columnStart;

		if (
			loc.column < columnStart ||
			(isLastLine && positionIndex > lineEndIndex) ||
			(!isLastLine && positionIndex >= lineEndIndex)
		) {
			throw new RangeError(
				`Column number out of range (column ${loc.column} requested). Valid range for line ${loc.line}: ${columnStart}-${lineEndIndex - lineStartIndex + columnStart + (isLastLine ? 0 : -1)}`,
			);
		}

		return positionIndex;
	}

	/**
	 * Returns the range information for the given node or token.
	 * @param {Options['SyntaxElementWithLoc']} nodeOrToken The node or token to get the range information for.
	 * @returns {SourceRange} The range information for the node or token.
	 * @throws {Error} If the node or token does not have range information.
	 */
	getRange(nodeOrToken) {
		if (hasESTreeStyleRange(nodeOrToken)) {
			return nodeOrToken.range;
		}

		if (hasPosStyleRange(nodeOrToken)) {
			return [
				nodeOrToken.position.start.offset,
				nodeOrToken.position.end.offset,
			];
		}

		throw new Error(
			"Custom getRange() method must be implemented in the subclass.",
		);
	}

	/* eslint-disable no-unused-vars -- Required to complete interface. */
	/**
	 * Returns the parent of the given node.
	 * @param {Options['SyntaxElementWithLoc']} node The node to get the parent of.
	 * @returns {Options['SyntaxElementWithLoc']|undefined} The parent of the node.
	 * @throws {Error} If the method is not implemented in the subclass.
	 */
	getParent(node) {
		throw new Error("Not implemented.");
	}
	/* eslint-enable no-unused-vars -- Required to complete interface. */

	/**
	 * Gets all the ancestors of a given node
	 * @param {Options['SyntaxElementWithLoc']} node The node
	 * @returns {Array<Options['SyntaxElementWithLoc']>} All the ancestor nodes in the AST, not including the provided node, starting
	 * from the root node at index 0 and going inwards to the parent node.
	 * @throws {TypeError} When `node` is missing.
	 */
	getAncestors(node) {
		if (!node) {
			throw new TypeError("Missing required argument: node.");
		}

		const ancestorsStartingAtParent = [];

		for (
			let ancestor = this.getParent(node);
			ancestor;
			ancestor = this.getParent(ancestor)
		) {
			ancestorsStartingAtParent.push(ancestor);
		}

		return ancestorsStartingAtParent.reverse();
	}

	/**
	 * Gets the source code for the given node.
	 * @param {Options['SyntaxElementWithLoc']} [node] The AST node to get the text for.
	 * @param {number} [beforeCount] The number of characters before the node to retrieve.
	 * @param {number} [afterCount] The number of characters after the node to retrieve.
	 * @returns {string} The text representing the AST node.
	 * @public
	 */
	getText(node, beforeCount, afterCount) {
		if (node) {
			const range = this.getRange(node);
			return this.text.slice(
				Math.max(range[0] - (beforeCount || 0), 0),
				range[1] + (afterCount || 0),
			);
		}
		return this.text;
	}

	/**
	 * Gets the entire source text split into an array of lines.
	 * @returns {Array<string>} The source text as an array of lines.
	 * @public
	 */
	get lines() {
		this.#ensureLines(); // Ensure `#lines` is lazily calculated.

		return this.#lines;
	}

	/**
	 * Traverse the source code and return the steps that were taken.
	 * @returns {Iterable<TraversalStep>} The steps that were taken while traversing the source code.
	 */
	traverse() {
		throw new Error("Not implemented.");
	}
}

export { CallMethodStep, ConfigCommentParser, Directive, TextSourceCodeBase, VisitNodeStep };
Jvxe{
  "name": "@eslint/plugin-kit",
  "version": "0.7.2",
  "description": "Utilities for building ESLint plugins.",
  "author": "Nicholas C. Zakas",
  "type": "module",
  "main": "dist/esm/index.js",
  "types": "dist/esm/index.d.ts",
  "exports": {
    "require": {
      "types": "./dist/cjs/index.d.cts",
      "default": "./dist/cjs/index.cjs"
    },
    "import": {
      "types": "./dist/esm/index.d.ts",
      "default": "./dist/esm/index.js"
    }
  },
  "files": [
    "dist"
  ],
  "publishConfig": {
    "access": "public"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/eslint/rewrite.git",
    "directory": "packages/plugin-kit"
  },
  "bugs": {
    "url": "https://github.com/eslint/rewrite/issues"
  },
  "homepage": "https://github.com/eslint/rewrite/tree/main/packages/plugin-kit#readme",
  "scripts": {
    "build:dedupe-types": "node ../../tools/dedupe-types.js dist/cjs/index.cjs dist/esm/index.js",
    "build:cts": "node ../../tools/build-cts.js dist/esm/index.d.ts dist/cjs/index.d.cts && node -e \"fs.cpSync('dist/esm/types.d.ts', 'dist/cjs/types.d.cts')\"",
    "build": "rollup -c && npm run build:dedupe-types && tsc -p tsconfig.esm.json && npm run build:cts",
    "lint:types": "attw --pack",
    "pretest": "npm run build",
    "test": "npm run test:types && npm run test:unit",
    "test:coverage": "npm run build && c8 npm run test:unit",
    "test:jsr": "npx -y jsr@latest publish --dry-run",
    "test:types": "tsc -p tests/types/tsconfig.json",
    "test:unit": "mocha \"tests/**/*.test.js\""
  },
  "keywords": [
    "eslint",
    "eslintplugin",
    "eslint-plugin"
  ],
  "license": "Apache-2.0",
  "dependencies": {
    "@eslint/core": "^1.2.1",
    "levn": "^0.4.1"
  },
  "devDependencies": {
    "@types/levn": "^0.4.0",
    "rollup-plugin-copy": "^3.5.0"
  },
  "engines": {
    "node": "^20.19.0 || ^22.13.0 || >=24"
  }
}
u<5x^ 40000 core @!@dc840000 node fɪISgW 6g40000 types fP_xGՈ~c)̭
x R100644 LICENSE &랟+Kfݩo\d100644 README.md OMfq6940000 dist 3o(-U(100644 package.json j*]]
s;KI F&40000 src Z"Npțz.`nE9C[x# `@humanfs/core`

by [Nicholas C. Zakas](https://humanwhocodes.com)

If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate) or [nominate me](https://stars.github.com/nominate/) for a GitHub Star.

## Description

The core functionality for humanfs that is shared across all implementations for all runtimes. The contents of this package are intentionally runtime agnostic and are not intended to be used alone.

Currently, this package simply exports the `Hfs` class, which is an abstract base class intended to be inherited from in runtime-specific hfs packages (like `@humanfs/node`).

> [!WARNING]
> This project is **experimental** and may change significantly before v1.0.0. Use at your own caution and definitely not in production!

## Installation

### Node.js

Install using your favorite package manager for Node.js:

```shell
npm install @humanfs/core

# or

pnpm install @humanfs/core

# or

yarn add @humanfs/core

# or

bun install @humanfs/core
```

Then you can import the `Hfs` and `Path` classes like this:

```js
import { Hfs, Path } from "@humanfs/core";
```

### Deno

Install using [JSR](https://jsr.io):

```shell
deno add @humanfs/core

# or

jsr add @humanfs/core
```

Then you can import the `Hfs` class like this:

```js
import { Hfs, Path } from "@humanfs/core";
```

### Browser

It's recommended to import the minified version to save bandwidth:

```js
import { Hfs, Path } from "https://cdn.skypack.dev/@humanfs/core?min";
```

However, you can also import the unminified version for debugging purposes:

```js
import { Hfs, Path } from "https://cdn.skypack.dev/@humanfs/core";
```

## Usage

### `Hfs` Class

The `Hfs` class contains all of the basic functionality for an `Hfs` instance *without* a predefined impl. This class is mostly used for creating runtime-specific impls, such as `NodeHfs` and `DenoHfs`.

You can create your own instance by providing an `impl` directly:

```js
const hfs = new Hfs({ impl: { async text() {} }});
```

The specified `impl` becomes the base impl for the instance, meaning you can always reset back to it using `resetImpl()`.

You can also inherit from `Hfs` to create your own class with a preconfigured impl, such as:

```js
class MyHfs extends Hfs {
	constructor() {
		super({
			impl: myImpl
		});
	}
}
```

### `Path` Class

The `Path` class represents the path to a directory or file within a file system. It's an abstract representation that can be used even outside of traditional file systems where string paths might not make sense.

```js
const myPath = new Path(["dir", "subdir"]);
console.log(myPath.toString());		// "dir/subdir"

// add another step
myPath.push("file.txt");
console.log(myPath.toString());		// "dir/subdir/file.txt"

// get just the last step
console.log(myPath.name);			// "file.txt"

// change just the last step
myPath.name = "file.json";
console.log(myPath.name);			// "file.json"
console.log(myPath.toString());		// "dir/subdir/file.json"

// get the size of the path
console.log(myPath.size);			// 3

// remove the last step
myPath.pop();
console.log(myPath.toString());		// "dir/subdir"

// iterate over the steps
for (const step of myPath) {
	// do something
}

// create a new path from a string
const newPath = Path.fromString("/foo/bar");
```

## License

Apache 2.0
N"tqx E100644 errors.d.ts ȅ|{a<FT100644 fsx.d.ts 	:')fONw100644 hfs.d.ts i6@a8{!rp100644 index.d.ts 0i;ʢݫ100644 path.d.ts n)9[1*6$ХͩP1Sx5/**
 * @fileoverview Common error classes
 * @author Nicholas C. Zakas
 */
/**
 * Error thrown when a file or directory is not found.
 */
export class NotFoundError extends Error {
    /**
     * Creates a new instance.
     * @param {string} message The error message.
     */
    constructor(message: string);
    /**
     * Error code.
     * @type {string}
     */
    code: string;
}
/**
 * Error thrown when an operation is not permitted.
 */
export class PermissionError extends Error {
    /**
     * Creates a new instance.
     * @param {string} message The error message.
     */
    constructor(message: string);
    /**
     * Error code.
     * @type {string}
     */
    code: string;
}
/**
 * Error thrown when an operation is not allowed on a directory.
 */
export class DirectoryError extends Error {
    /**
     * Creates a new instance.
     * @param {string} message The error message.
     */
    constructor(message: string);
    /**
     * Error code.
     * @type {string}
     */
    code: string;
}
/**
 * Error thrown when a directory is not empty.
 */
export class NotEmptyError extends Error {
    /**
     * Creates a new instance.
     * @param {string} message The error message.
     */
    constructor(message: string);
    /**
     * Error code.
     * @type {string}
     */
    code: string;
}
7xd/**
 * @fileoverview The main file for the hfs package.
 * @author Nicholas C. Zakas
 */
/** @typedef{import("@humanfs/types").HfsImpl} HfsImpl */
/** @typedef{import("@humanfs/types").HfsDirectoryEntry} HfsDirectoryEntry */
/**
 * Error to represent when a method is missing on an impl.
 */
export class NoSuchMethodError extends Error {
    /**
     * Creates a new instance.
     * @param {string} methodName The name of the method that was missing.
     */
    constructor(methodName: string);
}
/**
 * Error to represent when an impl is already set.
 */
export class ImplAlreadySetError extends Error {
    /**
     * Creates a new instance.
     */
    constructor();
}
/**
 * A class representing a log entry.
 */
export class LogEntry {
    /**
     * Creates a new instance.
     * @param {string} type The type of log entry.
     * @param {any} [data] The data associated with the log entry.
     */
    constructor(type: string, data?: any);
    /**
     * The time at which the log entry was created.
     * @type {number}
     */
    timestamp: number;
    methodName: string;
    data: any;
    #private;
}
/**
 * A class representing a file system utility library.
 * @implements {HfsImpl}
 */
export class Hfs implements HfsImpl {
    /**
     * Creates a new instance.
     * @param {object} options The options for the instance.
     * @param {HfsImpl} options.impl The implementation to use.
     */
    constructor({ impl }: {
        impl: HfsImpl;
    });
    /**
     * Starts a new log with the given name.
     * @param {string} name The name of the log to start;
     * @returns {void}
     * @throws {Error} When the log already exists.
     * @throws {TypeError} When the name is not a non-empty string.
     */
    logStart(name: string): void;
    /**
     * Ends a log with the given name and returns the entries.
     * @param {string} name The name of the log to end.
     * @returns {Array<LogEntry>} The entries in the log.
     * @throws {Error} When the log does not exist.
     */
    logEnd(name: string): Array<LogEntry>;
    /**
     * Determines if the current implementation is the base implementation.
     * @returns {boolean} True if the current implementation is the base implementation.
     */
    isBaseImpl(): boolean;
    /**
     * Sets the implementation for this instance.
     * @param {object} impl The implementation to use.
     * @returns {void}
     */
    setImpl(impl: object): void;
    /**
     * Resets the implementation for this instance back to its original.
     * @returns {void}
     */
    resetImpl(): void;
    /**
     * Reads the given file and returns the contents as text. Assumes UTF-8 encoding.
     * @param {string} filePath The file to read.
     * @returns {Promise<string|undefined>} The contents of the file.
     * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
     * @throws {TypeError} When the file path is not a non-empty string.
     */
    text(filePath: string): Promise<string | undefined>;
    /**
     * Reads the given file and returns the contents as JSON. Assumes UTF-8 encoding.
     * @param {string} filePath The file to read.
     * @returns {Promise<any|undefined>} The contents of the file as JSON.
     * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
     * @throws {SyntaxError} When the file contents are not valid JSON.
     * @throws {TypeError} When the file path is not a non-empty string.
     */
    json(filePath: string): Promise<any | undefined>;
    /**
     * Reads the given file and returns the contents as an ArrayBuffer.
     * @param {string} filePath The file to read.
     * @returns {Promise<ArrayBuffer|undefined>} The contents of the file as an ArrayBuffer.
     * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
     * @throws {TypeError} When the file path is not a non-empty string.
     * @deprecated Use bytes() instead.
     */
    arrayBuffer(filePath: string): Promise<ArrayBuffer | undefined>;
    /**
     * Reads the given file and returns the contents as an Uint8Array.
     * @param {string} filePath The file to read.
     * @returns {Promise<Uint8Array|undefined>} The contents of the file as an Uint8Array.
     * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
     * @throws {TypeError} When the file path is not a non-empty string.
     */
    bytes(filePath: string): Promise<Uint8Array | undefined>;
    /**
     * Writes the given data to the given file. Creates any necessary directories along the way.
     * If the data is a string, UTF-8 encoding is used.
     * @param {string} filePath The file to write.
     * @param {any} contents The data to write.
     * @returns {Promise<void>} A promise that resolves when the file is written.
     * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
     * @throws {TypeError} When the file path is not a non-empty string.
     */
    write(filePath: string, contents: any): Promise<void>;
    /**
     * Determines if the given file exists.
     * @param {string} filePath The file to check.
     * @returns {Promise<boolean>} True if the file exists.
     * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
     * @throws {TypeError} When the file path is not a non-empty string.
     */
    isFile(filePath: string): Promise<boolean>;
    /**
     * Determines if the given directory exists.
     * @param {string} dirPath The directory to check.
     * @returns {Promise<boolean>} True if the directory exists.
     * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
     * @throws {TypeError} When the directory path is not a non-empty string.
     */
    isDirectory(dirPath: string): Promise<boolean>;
    /**
     * Creates the given directory.
     * @param {string} dirPath The directory to create.
     * @returns {Promise<void>} A promise that resolves when the directory is created.
     * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
     * @throws {TypeError} When the directory path is not a non-empty string.
     */
    createDirectory(dirPath: string): Promise<void>;
    /**
     * Deletes the given file.
     * @param {string} filePath The file to delete.
     * @returns {Promise<void>} A promise that resolves when the file is deleted.
     * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
     * @throws {TypeError} When the file path is not a non-empty string.
     */
    delete(filePath: string): Promise<void>;
    /**
     * Deletes the given directory.
     * @param {string} dirPath The directory to delete.
     * @returns {Promise<void>} A promise that resolves when the directory is deleted.
     * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
     * @throws {TypeError} When the directory path is not a non-empty string.
     */
    deleteAll(dirPath: string): Promise<void>;
    /**
     * Returns a list of directory entries for the given path.
     * @param {string} dirPath The path to the directory to read.
     * @returns {AsyncIterable<HfsDirectoryEntry>} A promise that resolves with the
     *   directory entries.
     * @throws {TypeError} If the directory path is not a string.
     * @throws {Error} If the directory cannot be read.
     */
    list(dirPath: string): AsyncIterable<HfsDirectoryEntry>;
    /**
     * Returns the size of the given file.
     * @param {string} filePath The path to the file to read.
     * @returns {Promise<number>} A promise that resolves with the size of the file.
     * @throws {TypeError} If the file path is not a string.
     * @throws {Error} If the file cannot be read.
     */
    size(filePath: string): Promise<number>;
    #private;
}
export type HfsImpl = import("@humanfs/types").HfsImpl;
export type HfsDirectoryEntry = import("@humanfs/types").HfsDirectoryEntry;
gƸx4'/**
 * Error to represent when a method is missing on an impl.
 */
export class NoSuchMethodError extends Error {
    /**
     * Creates a new instance.
     * @param {string} methodName The name of the method that was missing.
     */
    constructor(methodName: string);
}
/**
 * Error to represent when a method is not supported on an impl. This happens
 * when a method on `Hfs` is called with one name and the corresponding method
 * on the impl has a different name. (Example: `text()` and `bytes()`.)
 */
export class MethodNotSupportedError extends Error {
    /**
     * Creates a new instance.
     * @param {string} methodName The name of the method that was missing.
     */
    constructor(methodName: string);
}
/**
 * Error to represent when an impl is already set.
 */
export class ImplAlreadySetError extends Error {
    /**
     * Creates a new instance.
     */
    constructor();
}
/**
 * A class representing a log entry.
 */
export class LogEntry {
    /**
     * Creates a new instance.
     * @param {string} type The type of log entry.
     * @param {any} [data] The data associated with the log entry.
     */
    constructor(type: string, data?: any);
    /**
     * The type of log entry.
     * @type {string}
     */
    type: string;
    /**
     * The data associated with the log entry.
     * @type {any}
     */
    data: any;
    /**
     * The time at which the log entry was created.
     * @type {number}
     */
    timestamp: number;
}
/**
 * A class representing a file system utility library.
 * @implements {HfsImpl}
 */
export class Hfs implements HfsImpl {
    /**
     * Creates a new instance.
     * @param {object} options The options for the instance.
     * @param {HfsImpl} options.impl The implementation to use.
     */
    constructor({ impl }: {
        impl: HfsImpl;
    });
    /**
     * Starts a new log with the given name.
     * @param {string} name The name of the log to start;
     * @returns {void}
     * @throws {Error} When the log already exists.
     * @throws {TypeError} When the name is not a non-empty string.
     */
    logStart(name: string): void;
    /**
     * Ends a log with the given name and returns the entries.
     * @param {string} name The name of the log to end.
     * @returns {Array<LogEntry>} The entries in the log.
     * @throws {Error} When the log does not exist.
     */
    logEnd(name: string): Array<LogEntry>;
    /**
     * Determines if the current implementation is the base implementation.
     * @returns {boolean} True if the current implementation is the base implementation.
     */
    isBaseImpl(): boolean;
    /**
     * Sets the implementation for this instance.
     * @param {object} impl The implementation to use.
     * @returns {void}
     */
    setImpl(impl: object): void;
    /**
     * Resets the implementation for this instance back to its original.
     * @returns {void}
     */
    resetImpl(): void;
    /**
     * Reads the given file and returns the contents as text. Assumes UTF-8 encoding.
     * @param {string|URL} filePath The file to read.
     * @returns {Promise<string|undefined>} The contents of the file.
     * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
     * @throws {TypeError} When the file path is not a non-empty string.
     */
    text(filePath: string | URL): Promise<string | undefined>;
    /**
     * Reads the given file and returns the contents as JSON. Assumes UTF-8 encoding.
     * @param {string|URL} filePath The file to read.
     * @returns {Promise<any|undefined>} The contents of the file as JSON.
     * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
     * @throws {SyntaxError} When the file contents are not valid JSON.
     * @throws {TypeError} When the file path is not a non-empty string.
     */
    json(filePath: string | URL): Promise<any | undefined>;
    /**
     * Reads the given file and returns the contents as an ArrayBuffer.
     * @param {string|URL} filePath The file to read.
     * @returns {Promise<ArrayBuffer|undefined>} The contents of the file as an ArrayBuffer.
     * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
     * @throws {TypeError} When the file path is not a non-empty string.
     * @deprecated Use bytes() instead.
     */
    arrayBuffer(filePath: string | URL): Promise<ArrayBuffer | undefined>;
    /**
     * Reads the given file and returns the contents as an Uint8Array.
     * @param {string|URL} filePath The file to read.
     * @returns {Promise<Uint8Array|undefined>} The contents of the file as an Uint8Array.
     * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
     * @throws {TypeError} When the file path is not a non-empty string.
     */
    bytes(filePath: string | URL): Promise<Uint8Array | undefined>;
    /**
     * Writes the given data to the given file. Creates any necessary directories along the way.
     * If the data is a string, UTF-8 encoding is used.
     * @param {string|URL} filePath The file to write.
     * @param {string|ArrayBuffer|ArrayBufferView} contents The data to write.
     * @returns {Promise<void>} A promise that resolves when the file is written.
     * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
     * @throws {TypeError} When the file path is not a non-empty string.
     */
    write(filePath: string | URL, contents: string | ArrayBuffer | ArrayBufferView): Promise<void>;
    /**
     * Appends the given data to the given file. Creates any necessary directories along the way.
     * If the data is a string, UTF-8 encoding is used.
     * @param {string|URL} filePath The file to append to.
     * @param {string|ArrayBuffer|ArrayBufferView} contents The data to append.
     * @returns {Promise<void>} A promise that resolves when the file is appended to.
     * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
     * @throws {TypeError} When the file path is not a non-empty string.
     * @throws {TypeError} When the file contents are not a string or ArrayBuffer.
     * @throws {Error} When the file cannot be appended to.
     */
    append(filePath: string | URL, contents: string | ArrayBuffer | ArrayBufferView): Promise<void>;
    /**
     * Determines if the given file exists.
     * @param {string|URL} filePath The file to check.
     * @returns {Promise<boolean>} True if the file exists.
     * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
     * @throws {TypeError} When the file path is not a non-empty string.
     */
    isFile(filePath: string | URL): Promise<boolean>;
    /**
     * Determines if the given directory exists.
     * @param {string|URL} dirPath The directory to check.
     * @returns {Promise<boolean>} True if the directory exists.
     * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
     * @throws {TypeError} When the directory path is not a non-empty string.
     */
    isDirectory(dirPath: string | URL): Promise<boolean>;
    /**
     * Creates the given directory.
     * @param {string|URL} dirPath The directory to create.
     * @returns {Promise<void>} A promise that resolves when the directory is created.
     * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
     * @throws {TypeError} When the directory path is not a non-empty string.
     */
    createDirectory(dirPath: string | URL): Promise<void>;
    /**
     * Deletes the given file or empty directory.
     * @param {string|URL} filePath The file to delete.
     * @returns {Promise<boolean>} A promise that resolves when the file or
     *   directory is deleted, true if the file or directory is deleted, false
     *   if the file or directory does not exist.
     * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
     * @throws {TypeError} When the file path is not a non-empty string.
     */
    delete(filePath: string | URL): Promise<boolean>;
    /**
     * Deletes the given file or directory recursively.
     * @param {string|URL} dirPath The directory to delete.
     * @returns {Promise<boolean>} A promise that resolves when the file or
     *   directory is deleted, true if the file or directory is deleted, false
     *   if the file or directory does not exist.
     * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
     * @throws {TypeError} When the directory path is not a non-empty string.
     */
    deleteAll(dirPath: string | URL): Promise<boolean>;
    /**
     * Returns a list of directory entries for the given path.
     * @param {string|URL} dirPath The path to the directory to read.
     * @returns {AsyncIterable<HfsDirectoryEntry>} A promise that resolves with the
     *   directory entries.
     * @throws {TypeError} If the directory path is not a string or URL.
     * @throws {Error} If the directory cannot be read.
     */
    list(dirPath: string | URL): AsyncIterable<HfsDirectoryEntry>;
    /**
     * Walks a directory using a depth-first traversal and returns the entries
     * from the traversal.
     * @param {string|URL} dirPath The path to the directory to walk.
     * @param {Object} [options] The options for the walk.
     * @param {(entry:HfsWalkEntry) => Promise<boolean>|boolean} [options.directoryFilter] A filter function to determine
     * 	if a directory's entries should be included in the walk.
     * @param {(entry:HfsWalkEntry) => Promise<boolean>|boolean} [options.entryFilter] A filter function to determine if
     * 	an entry should be included in the walk.
     * @returns {AsyncIterable<HfsWalkEntry>} A promise that resolves with the
     * 	directory entries.
     * @throws {TypeError} If the directory path is not a string or URL.
     * @throws {Error} If the directory cannot be read.
     */
    walk(dirPath: string | URL, { directoryFilter, entryFilter }?: {
        directoryFilter?: (entry: HfsWalkEntry) => Promise<boolean> | boolean;
        entryFilter?: (entry: HfsWalkEntry) => Promise<boolean> | boolean;
    }): AsyncIterable<HfsWalkEntry>;
    /**
     * Returns the size of the given file.
     * @param {string|URL} filePath The path to the file to read.
     * @returns {Promise<number>} A promise that resolves with the size of the file.
     * @throws {TypeError} If the file path is not a string or URL.
     * @throws {Error} If the file cannot be read.
     */
    size(filePath: string | URL): Promise<number>;
    /**
     * Returns the last modified timestamp of the given file or directory.
     * @param {string|URL} fileOrDirPath The path to the file or directory.
     * @returns {Promise<Date|undefined>} A promise that resolves with the last modified date
     *  or undefined if the file or directory does not exist.
     * @throws {TypeError} If the path is not a string or URL.
     */
    lastModified(fileOrDirPath: string | URL): Promise<Date | undefined>;
    /**
     * Copys a file from one location to another.
     * @param {string|URL} source The path to the file to copy.
     * @param {string|URL} destination The path to the new file.
     * @returns {Promise<void>} A promise that resolves when the file is copied.
     * @throws {TypeError} If the file path is not a string or URL.
     * @throws {Error} If the file cannot be copied.
     */
    copy(source: string | URL, destination: string | URL): Promise<void>;
    /**
     * Copies a file or directory from one location to another.
     * @param {string|URL} source The path to the file or directory to copy.
     * @param {string|URL} destination The path to copy the file or directory to.
     * @returns {Promise<void>} A promise that resolves when the file or directory is
     * copied.
     * @throws {TypeError} If the directory path is not a string or URL.
     * @throws {Error} If the directory cannot be copied.
     */
    copyAll(source: string | URL, destination: string | URL): Promise<void>;
    /**
     * Moves a file from the source path to the destination path.
     * @param {string|URL} source The location of the file to move.
     * @param {string|URL} destination The destination of the file to move.
     * @returns {Promise<void>} A promise that resolves when the move is complete.
     * @throws {TypeError} If the file or directory paths are not strings.
     * @throws {Error} If the file or directory cannot be moved.
     */
    move(source: string | URL, destination: string | URL): Promise<void>;
    /**
     * Moves a file or directory from one location to another.
     * @param {string|URL} source The path to the file or directory to move.
     * @param {string|URL} destination The path to move the file or directory to.
     * @returns {Promise<void>} A promise that resolves when the file or directory is
     * moved.
     * @throws {TypeError} If the source is not a string or URL.
     * @throws {TypeError} If the destination is not a string or URL.
     * @throws {Error} If the file or directory cannot be moved.
     */
    moveAll(source: string | URL, destination: string | URL): Promise<void>;
    #private;
}
export type HfsImpl = import("@humanfs/types").HfsImpl;
export type HfsDirectoryEntry = import("@humanfs/types").HfsDirectoryEntry;
export type HfsWalkEntry = import("@humanfs/types").HfsWalkEntry;
1xx_ export { Hfs } from "./hfs.js";
export { Path } from "./path.js";
export * from "./errors.js";
Nɺx
export class Path {
    /**
     * Creates a new path based on the argument type. If the argument is a string,
     * it is assumed to be a file or directory path and is converted to a Path
     * instance. If the argument is a URL, it is assumed to be a file URL and is
     * converted to a Path instance. If the argument is a Path instance, it is
     * copied into a new Path instance. If the argument is an array, it is assumed
     * to be the steps of a path and is used to create a new Path instance.
     * @param {string|URL|Path|Array<string>} pathish The value to convert to a Path instance.
     * @returns {Path} A new Path instance.
     * @throws {TypeError} When pathish is not a string, URL, Path, or Array.
     * @throws {TypeError} When pathish is a string and is empty.
     */
    static from(pathish: string | URL | Path | Array<string>): Path;
    /**
     * Creates a new Path instance from a string.
     * @param {string} fileOrDirPath The file or directory path to convert.
     * @returns {Path} A new Path instance.
     * @deprecated Use Path.from() instead.
     */
    static fromString(fileOrDirPath: string): Path;
    /**
     * Creates a new Path instance from a URL.
     * @param {URL} url The URL to convert.
     * @returns {Path} A new Path instance.
     * @throws {TypeError} When url is not a URL instance.
     * @throws {TypeError} When url.pathname is empty.
     * @throws {TypeError} When url.protocol is not "file:".
     * @deprecated Use Path.from() instead.
     */
    static fromURL(url: URL): Path;
    /**
     * Creates a new instance.
     * @param {Iterable<string>} [steps] The steps to use for the path.
     * @throws {TypeError} When steps is not iterable.
     */
    constructor(steps?: Iterable<string>);
    /**
     * Adds steps to the end of the path.
     * @param  {...string} steps The steps to add to the path.
     * @returns {void}
     */
    push(...steps: string[]): void;
    /**
     * Removes the last step from the path.
     * @returns {string} The last step in the path.
     */
    pop(): string;
    /**
     * Returns an iterator for steps in the path.
     * @returns {IterableIterator<string>} An iterator for the steps in the path.
     */
    steps(): IterableIterator<string>;
    /**
     * Sets the name (the last step) of the path.
     * @type {string}
     */
    set name(value: string);
    /**
     * Retrieves the name (the last step) of the path.
     * @type {string}
     */
    get name(): string;
    /**
     * Retrieves the size of the path.
     * @type {number}
     */
    get size(): number;
    /**
     * Returns the path as a string.
     * @returns {string} The path as a string.
     */
    toString(): string;
    /**
     * Returns an iterator for the steps in the path.
     * @returns {IterableIterator<string>} An iterator for the steps in the path.
     */
    [Symbol.iterator](): IterableIterator<string>;
    #private;
}
export type HfsImpl = import("@humanfs/types").HfsImpl;
export type HfsDirectoryEntry = import("@humanfs/types").HfsDirectoryEntry;
ٸDxH{
  "name": "@humanfs/core",
  "version": "0.19.2",
  "description": "The core of the humanfs library.",
  "type": "module",
  "main": "dist/index.js",
  "types": "dist/index.d.ts",
  "exports": {
    "import": {
      "types": "./dist/index.d.ts",
      "default": "./src/index.js"
    }
  },
  "files": [
    "dist",
    "src"
  ],
  "scripts": {
    "build": "tsc",
    "prepare": "npm run build",
    "pretest": "npm run build",
    "test": "c8 mocha tests"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/humanwhocodes/humanfs.git"
  },
  "publishConfig": {
    "access": "public"
  },
  "keywords": [
    "filesystem",
    "fs",
    "hfs",
    "files"
  ],
  "author": "Nicholas C. Zakas",
  "license": "Apache-2.0",
  "bugs": {
    "url": "https://github.com/humanwhocodes/humanfs/issues"
  },
  "homepage": "https://github.com/humanwhocodes/humanfs#readme",
  "engines": {
    "node": ">=18.18.0"
  },
  "devDependencies": {
    "c8": "^9.0.0",
    "mocha": "^10.2.0",
    "typescript": "^5.2.2"
  },
  "dependencies": {
    "@humanfs/types": "^0.15.0"
  }
}
6x q100644 errors.js [ɏރ $<{/100644 hfs.js 81fM8v100644 index.js f-H
q)VwBcem'100644 path.js G	ijhC\\O7px /**
 * @fileoverview Common error classes
 * @author Nicholas C. Zakas
 */

/**
 * Error thrown when a file or directory is not found.
 */
export class NotFoundError extends Error {
	/**
	 * Name of the error class.
	 * @type {string}
	 */
	name = "NotFoundError";

	/**
	 * Error code.
	 * @type {string}
	 */
	code = "ENOENT";

	/**
	 * Creates a new instance.
	 * @param {string} message The error message.
	 */
	constructor(message) {
		super(`ENOENT: No such file or directory, ${message}`);
	}
}

/**
 * Error thrown when an operation is not permitted.
 */
export class PermissionError extends Error {
	/**
	 * Name of the error class.
	 * @type {string}
	 */
	name = "PermissionError";

	/**
	 * Error code.
	 * @type {string}
	 */
	code = "EPERM";

	/**
	 * Creates a new instance.
	 * @param {string} message The error message.
	 */
	constructor(message) {
		super(`EPERM: Operation not permitted, ${message}`);
	}
}

/**
 * Error thrown when an operation is not allowed on a directory.
 */

export class DirectoryError extends Error {
	/**
	 * Name of the error class.
	 * @type {string}
	 */
	name = "DirectoryError";

	/**
	 * Error code.
	 * @type {string}
	 */
	code = "EISDIR";

	/**
	 * Creates a new instance.
	 * @param {string} message The error message.
	 */
	constructor(message) {
		super(`EISDIR: Illegal operation on a directory, ${message}`);
	}
}

/**
 * Error thrown when a directory is not empty.
 */
export class NotEmptyError extends Error {
	/**
	 * Name of the error class.
	 * @type {string}
	 */
	name = "NotEmptyError";

	/**
	 * Error code.
	 * @type {string}
	 */
	code = "ENOTEMPTY";

	/**
	 * Creates a new instance.
	 * @param {string} message The error message.
	 */
	constructor(message) {
		super(`ENOTEMPTY: Directory not empty, ${message}`);
	}
}
,.VxVY/**
 * @fileoverview The main file for the humanfs package.
 * @author Nicholas C. Zakas
 */

/* global URL, TextDecoder, TextEncoder */

//-----------------------------------------------------------------------------
// Types
//-----------------------------------------------------------------------------

/** @typedef {import("@humanfs/types").HfsImpl} HfsImpl */
/** @typedef {import("@humanfs/types").HfsDirectoryEntry} HfsDirectoryEntry */
/** @typedef {import("@humanfs/types").HfsWalkEntry} HfsWalkEntry */

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

const decoder = new TextDecoder();
const encoder = new TextEncoder();

/**
 * Error to represent when a method is missing on an impl.
 */
export class NoSuchMethodError extends Error {
	/**
	 * Creates a new instance.
	 * @param {string} methodName The name of the method that was missing.
	 */
	constructor(methodName) {
		super(`Method "${methodName}" does not exist on impl.`);
	}
}

/**
 * Error to represent when a method is not supported on an impl. This happens
 * when a method on `Hfs` is called with one name and the corresponding method
 * on the impl has a different name. (Example: `text()` and `bytes()`.)
 */
export class MethodNotSupportedError extends Error {
	/**
	 * Creates a new instance.
	 * @param {string} methodName The name of the method that was missing.
	 */
	constructor(methodName) {
		super(`Method "${methodName}" is not supported on this impl.`);
	}
}

/**
 * Error to represent when an impl is already set.
 */
export class ImplAlreadySetError extends Error {
	/**
	 * Creates a new instance.
	 */
	constructor() {
		super(`Implementation already set.`);
	}
}

/**
 * Asserts that the given path is a valid file path.
 * @param {any} fileOrDirPath The path to check.
 * @returns {void}
 * @throws {TypeError} When the path is not a non-empty string.
 */
function assertValidFileOrDirPath(fileOrDirPath) {
	if (
		!fileOrDirPath ||
		(!(fileOrDirPath instanceof URL) && typeof fileOrDirPath !== "string")
	) {
		throw new TypeError("Path must be a non-empty string or URL.");
	}
}

/**
 * Asserts that the given file contents are valid.
 * @param {any} contents The contents to check.
 * @returns {void}
 * @throws {TypeError} When the contents are not a string or ArrayBuffer.
 */
function assertValidFileContents(contents) {
	if (
		typeof contents !== "string" &&
		!(contents instanceof ArrayBuffer) &&
		!ArrayBuffer.isView(contents)
	) {
		throw new TypeError(
			"File contents must be a string, ArrayBuffer, or ArrayBuffer view.",
		);
	}
}

/**
 * Converts the given contents to Uint8Array.
 * @param {any} contents The data to convert.
 * @returns {Uint8Array} The converted Uint8Array.
 * @throws {TypeError} When the contents are not a string or ArrayBuffer.
 */
function toUint8Array(contents) {
	if (contents instanceof Uint8Array) {
		return contents;
	}

	if (typeof contents === "string") {
		return encoder.encode(contents);
	}

	if (contents instanceof ArrayBuffer) {
		return new Uint8Array(contents);
	}

	if (ArrayBuffer.isView(contents)) {
		const bytes = contents.buffer.slice(
			contents.byteOffset,
			contents.byteOffset + contents.byteLength,
		);
		return new Uint8Array(bytes);
	}
	throw new TypeError(
		"Invalid contents type. Expected string or ArrayBuffer.",
	);
}

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * A class representing a log entry.
 */
export class LogEntry {
	/**
	 * The type of log entry.
	 * @type {string}
	 */
	type;

	/**
	 * The data associated with the log entry.
	 * @type {any}
	 */
	data;

	/**
	 * The time at which the log entry was created.
	 * @type {number}
	 */
	timestamp = Date.now();

	/**
	 * Creates a new instance.
	 * @param {string} type The type of log entry.
	 * @param {any} [data] The data associated with the log entry.
	 */
	constructor(type, data) {
		this.type = type;
		this.data = data;
	}
}

/**
 * A class representing a file system utility library.
 * @implements {HfsImpl}
 */
export class Hfs {
	/**
	 * The base implementation for this instance.
	 * @type {HfsImpl}
	 */
	#baseImpl;

	/**
	 * The current implementation for this instance.
	 * @type {HfsImpl}
	 */
	#impl;

	/**
	 * A map of log names to their corresponding entries.
	 * @type {Map<string,Array<LogEntry>>}
	 */
	#logs = new Map();

	/**
	 * Creates a new instance.
	 * @param {object} options The options for the instance.
	 * @param {HfsImpl} options.impl The implementation to use.
	 */
	constructor({ impl }) {
		this.#baseImpl = impl;
		this.#impl = impl;
	}

	/**
	 * Logs an entry onto all currently open logs.
	 * @param {string} methodName The name of the method being called.
	 * @param {...*} args The arguments to the method.
	 * @returns {void}
	 */
	#log(methodName, ...args) {
		for (const logs of this.#logs.values()) {
			logs.push(new LogEntry("call", { methodName, args }));
		}
	}

	/**
	 * Starts a new log with the given name.
	 * @param {string} name The name of the log to start;
	 * @returns {void}
	 * @throws {Error} When the log already exists.
	 * @throws {TypeError} When the name is not a non-empty string.
	 */
	logStart(name) {
		if (!name || typeof name !== "string") {
			throw new TypeError("Log name must be a non-empty string.");
		}

		if (this.#logs.has(name)) {
			throw new Error(`Log "${name}" already exists.`);
		}

		this.#logs.set(name, []);
	}

	/**
	 * Ends a log with the given name and returns the entries.
	 * @param {string} name The name of the log to end.
	 * @returns {Array<LogEntry>} The entries in the log.
	 * @throws {Error} When the log does not exist.
	 */
	logEnd(name) {
		if (this.#logs.has(name)) {
			const logs = this.#logs.get(name);
			this.#logs.delete(name);
			return logs;
		}

		throw new Error(`Log "${name}" does not exist.`);
	}

	/**
	 * Determines if the current implementation is the base implementation.
	 * @returns {boolean} True if the current implementation is the base implementation.
	 */
	isBaseImpl() {
		return this.#impl === this.#baseImpl;
	}

	/**
	 * Sets the implementation for this instance.
	 * @param {object} impl The implementation to use.
	 * @returns {void}
	 */
	setImpl(impl) {
		this.#log("implSet", impl);

		if (this.#impl !== this.#baseImpl) {
			throw new ImplAlreadySetError();
		}

		this.#impl = impl;
	}

	/**
	 * Resets the implementation for this instance back to its original.
	 * @returns {void}
	 */
	resetImpl() {
		this.#log("implReset");
		this.#impl = this.#baseImpl;
	}

	/**
	 * Asserts that the given method exists on the current implementation.
	 * @param {string} methodName The name of the method to check.
	 * @returns {void}
	 * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
	 */
	#assertImplMethod(methodName) {
		if (typeof this.#impl[methodName] !== "function") {
			throw new NoSuchMethodError(methodName);
		}
	}

	/**
	 * Asserts that the given method exists on the current implementation, and if not,
	 * throws an error with a different method name.
	 * @param {string} methodName The name of the method to check.
	 * @param {string} targetMethodName The name of the method that should be reported
	 *  as an error when methodName does not exist.
	 * @returns {void}
	 * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
	 */
	#assertImplMethodAlt(methodName, targetMethodName) {
		if (typeof this.#impl[methodName] !== "function") {
			throw new MethodNotSupportedError(targetMethodName);
		}
	}

	/**
	 * Calls the given method on the current implementation.
	 * @param {string} methodName The name of the method to call.
	 * @param {...any} args The arguments to the method.
	 * @returns {any} The return value from the method.
	 * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
	 */
	#callImplMethod(methodName, ...args) {
		this.#log(methodName, ...args);
		this.#assertImplMethod(methodName);
		return this.#impl[methodName](...args);
	}

	/**
	 * Calls the given method on the current implementation and doesn't log the call.
	 * @param {string} methodName The name of the method to call.
	 * @param {...any} args The arguments to the method.
	 * @returns {any} The return value from the method.
	 * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
	 */
	#callImplMethodWithoutLog(methodName, ...args) {
		this.#assertImplMethod(methodName);
		return this.#impl[methodName](...args);
	}

	/**
	 * Calls the given method on the current implementation but logs a different method name.
	 * @param {string} methodName The name of the method to call.
	 * @param {string} targetMethodName The name of the method to log.
	 * @param {...any} args The arguments to the method.
	 * @returns {any} The return value from the method.
	 * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
	 */
	#callImplMethodAlt(methodName, targetMethodName, ...args) {
		this.#log(targetMethodName, ...args);
		this.#assertImplMethodAlt(methodName, targetMethodName);
		return this.#impl[methodName](...args);
	}

	/**
	 * Reads the given file and returns the contents as text. Assumes UTF-8 encoding.
	 * @param {string|URL} filePath The file to read.
	 * @returns {Promise<string|undefined>} The contents of the file.
	 * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
	 * @throws {TypeError} When the file path is not a non-empty string.
	 */
	async text(filePath) {
		assertValidFileOrDirPath(filePath);

		const result = await this.#callImplMethodAlt("bytes", "text", filePath);
		return result ? decoder.decode(result) : undefined;
	}

	/**
	 * Reads the given file and returns the contents as JSON. Assumes UTF-8 encoding.
	 * @param {string|URL} filePath The file to read.
	 * @returns {Promise<any|undefined>} The contents of the file as JSON.
	 * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
	 * @throws {SyntaxError} When the file contents are not valid JSON.
	 * @throws {TypeError} When the file path is not a non-empty string.
	 */
	async json(filePath) {
		assertValidFileOrDirPath(filePath);

		const result = await this.#callImplMethodAlt("bytes", "json", filePath);
		return result ? JSON.parse(decoder.decode(result)) : undefined;
	}

	/**
	 * Reads the given file and returns the contents as an ArrayBuffer.
	 * @param {string|URL} filePath The file to read.
	 * @returns {Promise<ArrayBuffer|undefined>} The contents of the file as an ArrayBuffer.
	 * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
	 * @throws {TypeError} When the file path is not a non-empty string.
	 * @deprecated Use bytes() instead.
	 */
	async arrayBuffer(filePath) {
		assertValidFileOrDirPath(filePath);

		const result = await this.#callImplMethodAlt(
			"bytes",
			"arrayBuffer",
			filePath,
		);
		return result?.buffer;
	}

	/**
	 * Reads the given file and returns the contents as an Uint8Array.
	 * @param {string|URL} filePath The file to read.
	 * @returns {Promise<Uint8Array|undefined>} The contents of the file as an Uint8Array.
	 * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
	 * @throws {TypeError} When the file path is not a non-empty string.
	 */
	async bytes(filePath) {
		assertValidFileOrDirPath(filePath);
		return this.#callImplMethod("bytes", filePath);
	}

	/**
	 * Writes the given data to the given file. Creates any necessary directories along the way.
	 * If the data is a string, UTF-8 encoding is used.
	 * @param {string|URL} filePath The file to write.
	 * @param {string|ArrayBuffer|ArrayBufferView} contents The data to write.
	 * @returns {Promise<void>} A promise that resolves when the file is written.
	 * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
	 * @throws {TypeError} When the file path is not a non-empty string.
	 */
	async write(filePath, contents) {
		assertValidFileOrDirPath(filePath);
		assertValidFileContents(contents);
		this.#log("write", filePath, contents);

		let value = toUint8Array(contents);
		return this.#callImplMethodWithoutLog("write", filePath, value);
	}

	/**
	 * Appends the given data to the given file. Creates any necessary directories along the way.
	 * If the data is a string, UTF-8 encoding is used.
	 * @param {string|URL} filePath The file to append to.
	 * @param {string|ArrayBuffer|ArrayBufferView} contents The data to append.
	 * @returns {Promise<void>} A promise that resolves when the file is appended to.
	 * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
	 * @throws {TypeError} When the file path is not a non-empty string.
	 * @throws {TypeError} When the file contents are not a string or ArrayBuffer.
	 * @throws {Error} When the file cannot be appended to.
	 */
	async append(filePath, contents) {
		assertValidFileOrDirPath(filePath);
		assertValidFileContents(contents);
		this.#log("append", filePath, contents);

		let value = toUint8Array(contents);
		return this.#callImplMethodWithoutLog("append", filePath, value);
	}

	/**
	 * Determines if the given file exists.
	 * @param {string|URL} filePath The file to check.
	 * @returns {Promise<boolean>} True if the file exists.
	 * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
	 * @throws {TypeError} When the file path is not a non-empty string.
	 */
	async isFile(filePath) {
		assertValidFileOrDirPath(filePath);
		return this.#callImplMethod("isFile", filePath);
	}

	/**
	 * Determines if the given directory exists.
	 * @param {string|URL} dirPath The directory to check.
	 * @returns {Promise<boolean>} True if the directory exists.
	 * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
	 * @throws {TypeError} When the directory path is not a non-empty string.
	 */
	async isDirectory(dirPath) {
		assertValidFileOrDirPath(dirPath);
		return this.#callImplMethod("isDirectory", dirPath);
	}

	/**
	 * Creates the given directory.
	 * @param {string|URL} dirPath The directory to create.
	 * @returns {Promise<void>} A promise that resolves when the directory is created.
	 * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
	 * @throws {TypeError} When the directory path is not a non-empty string.
	 */
	async createDirectory(dirPath) {
		assertValidFileOrDirPath(dirPath);
		return this.#callImplMethod("createDirectory", dirPath);
	}

	/**
	 * Deletes the given file or empty directory.
	 * @param {string|URL} filePath The file to delete.
	 * @returns {Promise<boolean>} A promise that resolves when the file or
	 *   directory is deleted, true if the file or directory is deleted, false
	 *   if the file or directory does not exist.
	 * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
	 * @throws {TypeError} When the file path is not a non-empty string.
	 */
	async delete(filePath) {
		assertValidFileOrDirPath(filePath);
		return this.#callImplMethod("delete", filePath);
	}

	/**
	 * Deletes the given file or directory recursively.
	 * @param {string|URL} dirPath The directory to delete.
	 * @returns {Promise<boolean>} A promise that resolves when the file or
	 *   directory is deleted, true if the file or directory is deleted, false
	 *   if the file or directory does not exist.
	 * @throws {NoSuchMethodError} When the method does not exist on the current implementation.
	 * @throws {TypeError} When the directory path is not a non-empty string.
	 */
	async deleteAll(dirPath) {
		assertValidFileOrDirPath(dirPath);
		return this.#callImplMethod("deleteAll", dirPath);
	}

	/**
	 * Returns a list of directory entries for the given path.
	 * @param {string|URL} dirPath The path to the directory to read.
	 * @returns {AsyncIterable<HfsDirectoryEntry>} A promise that resolves with the
	 *   directory entries.
	 * @throws {TypeError} If the directory path is not a string or URL.
	 * @throws {Error} If the directory cannot be read.
	 */
	async *list(dirPath) {
		assertValidFileOrDirPath(dirPath);
		yield* await this.#callImplMethod("list", dirPath);
	}

	/**
	 * Walks a directory using a depth-first traversal and returns the entries
	 * from the traversal.
	 * @param {string|URL} dirPath The path to the directory to walk.
	 * @param {Object} [options] The options for the walk.
	 * @param {(entry:HfsWalkEntry) => Promise<boolean>|boolean} [options.directoryFilter] A filter function to determine
	 * 	if a directory's entries should be included in the walk.
	 * @param {(entry:HfsWalkEntry) => Promise<boolean>|boolean} [options.entryFilter] A filter function to determine if
	 * 	an entry should be included in the walk.
	 * @returns {AsyncIterable<HfsWalkEntry>} A promise that resolves with the
	 * 	directory entries.
	 * @throws {TypeError} If the directory path is not a string or URL.
	 * @throws {Error} If the directory cannot be read.
	 */
	async *walk(
		dirPath,
		{ directoryFilter = () => true, entryFilter = () => true } = {},
	) {
		assertValidFileOrDirPath(dirPath);
		this.#log("walk", dirPath, { directoryFilter, entryFilter });

		// inner function for recursion without additional logging
		const walk = async function* (
			dirPath,
			{ directoryFilter, entryFilter, parentPath = "", depth = 1 },
		) {
			let dirEntries;

			try {
				dirEntries = await this.#callImplMethodWithoutLog(
					"list",
					dirPath,
				);
			} catch (error) {
				// if the directory does not exist then return an empty array
				if (error.code === "ENOENT") {
					return;
				}

				// otherwise, rethrow the error
				throw error;
			}

			for await (const listEntry of dirEntries) {
				const walkEntry = {
					path: listEntry.name,
					depth,
					...listEntry,
				};

				if (parentPath) {
					walkEntry.path = `${parentPath}/${walkEntry.path}`;
				}

				// first emit the entry but only if the entry filter returns true
				let shouldEmitEntry = entryFilter(walkEntry);
				if (shouldEmitEntry.then) {
					shouldEmitEntry = await shouldEmitEntry;
				}

				if (shouldEmitEntry) {
					yield walkEntry;
				}

				// if it's a directory then yield the entry and walk the directory
				if (listEntry.isDirectory) {
					// if the directory filter returns false, skip the directory
					let shouldWalkDirectory = directoryFilter(walkEntry);
					if (shouldWalkDirectory.then) {
						shouldWalkDirectory = await shouldWalkDirectory;
					}

					if (!shouldWalkDirectory) {
						continue;
					}

					// make sure there's a trailing slash on the directory path before appending
					const directoryPath =
						dirPath instanceof URL
							? new URL(
									listEntry.name,
									dirPath.href.endsWith("/")
										? dirPath.href
										: `${dirPath.href}/`,
								)
							: `${dirPath.endsWith("/") ? dirPath : `${dirPath}/`}${listEntry.name}`;

					yield* walk(directoryPath, {
						directoryFilter,
						entryFilter,
						parentPath: walkEntry.path,
						depth: depth + 1,
					});
				}
			}
		}.bind(this);

		yield* walk(dirPath, { directoryFilter, entryFilter });
	}

	/**
	 * Returns the size of the given file.
	 * @param {string|URL} filePath The path to the file to read.
	 * @returns {Promise<number>} A promise that resolves with the size of the file.
	 * @throws {TypeError} If the file path is not a string or URL.
	 * @throws {Error} If the file cannot be read.
	 */
	async size(filePath) {
		assertValidFileOrDirPath(filePath);
		return this.#callImplMethod("size", filePath);
	}

	/**
	 * Returns the last modified timestamp of the given file or directory.
	 * @param {string|URL} fileOrDirPath The path to the file or directory.
	 * @returns {Promise<Date|undefined>} A promise that resolves with the last modified date
	 *  or undefined if the file or directory does not exist.
	 * @throws {TypeError} If the path is not a string or URL.
	 */
	async lastModified(fileOrDirPath) {
		assertValidFileOrDirPath(fileOrDirPath);
		return this.#callImplMethod("lastModified", fileOrDirPath);
	}

	/**
	 * Copys a file from one location to another.
	 * @param {string|URL} source The path to the file to copy.
	 * @param {string|URL} destination The path to the new file.
	 * @returns {Promise<void>} A promise that resolves when the file is copied.
	 * @throws {TypeError} If the file path is not a string or URL.
	 * @throws {Error} If the file cannot be copied.
	 */
	async copy(source, destination) {
		assertValidFileOrDirPath(source);
		assertValidFileOrDirPath(destination);
		return this.#callImplMethod("copy", source, destination);
	}

	/**
	 * Copies a file or directory from one location to another.
	 * @param {string|URL} source The path to the file or directory to copy.
	 * @param {string|URL} destination The path to copy the file or directory to.
	 * @returns {Promise<void>} A promise that resolves when the file or directory is
	 * copied.
	 * @throws {TypeError} If the directory path is not a string or URL.
	 * @throws {Error} If the directory cannot be copied.
	 */
	async copyAll(source, destination) {
		assertValidFileOrDirPath(source);
		assertValidFileOrDirPath(destination);
		return this.#callImplMethod("copyAll", source, destination);
	}

	/**
	 * Moves a file from the source path to the destination path.
	 * @param {string|URL} source The location of the file to move.
	 * @param {string|URL} destination The destination of the file to move.
	 * @returns {Promise<void>} A promise that resolves when the move is complete.
	 * @throws {TypeError} If the file or directory paths are not strings.
	 * @throws {Error} If the file or directory cannot be moved.
	 */
	async move(source, destination) {
		assertValidFileOrDirPath(source);
		assertValidFileOrDirPath(destination);
		return this.#callImplMethod("move", source, destination);
	}

	/**
	 * Moves a file or directory from one location to another.
	 * @param {string|URL} source The path to the file or directory to move.
	 * @param {string|URL} destination The path to move the file or directory to.
	 * @returns {Promise<void>} A promise that resolves when the file or directory is
	 * moved.
	 * @throws {TypeError} If the source is not a string or URL.
	 * @throws {TypeError} If the destination is not a string or URL.
	 * @throws {Error} If the file or directory cannot be moved.
	 */
	async moveAll(source, destination) {
		assertValidFileOrDirPath(source);
		assertValidFileOrDirPath(destination);
		return this.#callImplMethod("moveAll", source, destination);
	}
}
y}x M/**
 * @fileoverview API entrypoint for hfs/core
 * @author Nicholas C. Zakas
 */

export { Hfs } from "./hfs.js";
export { Path } from "./path.js";
export * from "./errors.js";
L9xq/**
 * @fileoverview The Path class.
 * @author Nicholas C. Zakas
 */

/* globals URL */

//-----------------------------------------------------------------------------
// Types
//-----------------------------------------------------------------------------

/** @typedef{import("@humanfs/types").HfsImpl} HfsImpl */
/** @typedef{import("@humanfs/types").HfsDirectoryEntry} HfsDirectoryEntry */

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

/**
 * Normalizes a path to use forward slashes.
 * @param {string} filePath The path to normalize.
 * @returns {string} The normalized path.
 */
function normalizePath(filePath) {
	let startIndex = 0;
	let endIndex = filePath.length;

	if (/[a-z]:\//i.test(filePath)) {
		startIndex = 3;
	}

	if (filePath.startsWith("./")) {
		startIndex = 2;
	}

	if (filePath.startsWith("/")) {
		startIndex = 1;
	}

	if (filePath.endsWith("/")) {
		endIndex = filePath.length - 1;
	}

	return filePath.slice(startIndex, endIndex).replace(/\\/g, "/");
}

/**
 * Asserts that the given name is a non-empty string, no equal to "." or "..",
 * and does not contain a forward slash or backslash.
 * @param {string} name The name to check.
 * @returns {void}
 * @throws {TypeError} When name is not valid.
 */
function assertValidName(name) {
	if (typeof name !== "string") {
		throw new TypeError("name must be a string");
	}

	if (!name) {
		throw new TypeError("name cannot be empty");
	}

	if (name === ".") {
		throw new TypeError(`name cannot be "."`);
	}

	if (name === "..") {
		throw new TypeError(`name cannot be ".."`);
	}

	if (name.includes("/") || name.includes("\\")) {
		throw new TypeError(
			`name cannot contain a slash or backslash: "${name}"`,
		);
	}
}

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

export class Path {
	/**
	 * The steps in the path.
	 * @type {Array<string>}
	 */
	#steps;

	/**
	 * Creates a new instance.
	 * @param {Iterable<string>} [steps] The steps to use for the path.
	 * @throws {TypeError} When steps is not iterable.
	 */
	constructor(steps = []) {
		if (typeof steps[Symbol.iterator] !== "function") {
			throw new TypeError("steps must be iterable");
		}

		this.#steps = [...steps];
		this.#steps.forEach(assertValidName);
	}

	/**
	 * Adds steps to the end of the path.
	 * @param  {...string} steps The steps to add to the path.
	 * @returns {void}
	 */
	push(...steps) {
		steps.forEach(assertValidName);
		this.#steps.push(...steps);
	}

	/**
	 * Removes the last step from the path.
	 * @returns {string} The last step in the path.
	 */
	pop() {
		return this.#steps.pop();
	}

	/**
	 * Returns an iterator for steps in the path.
	 * @returns {IterableIterator<string>} An iterator for the steps in the path.
	 */
	steps() {
		return this.#steps.values();
	}

	/**
	 * Returns an iterator for the steps in the path.
	 * @returns {IterableIterator<string>} An iterator for the steps in the path.
	 */
	[Symbol.iterator]() {
		return this.steps();
	}

	/**
	 * Retrieves the name (the last step) of the path.
	 * @type {string}
	 */
	get name() {
		return this.#steps[this.#steps.length - 1];
	}

	/**
	 * Sets the name (the last step) of the path.
	 * @type {string}
	 */
	set name(value) {
		assertValidName(value);
		this.#steps[this.#steps.length - 1] = value;
	}

	/**
	 * Retrieves the size of the path.
	 * @type {number}
	 */
	get size() {
		return this.#steps.length;
	}

	/**
	 * Returns the path as a string.
	 * @returns {string} The path as a string.
	 */
	toString() {
		return this.#steps.join("/");
	}

	/**
	 * Creates a new path based on the argument type. If the argument is a string,
	 * it is assumed to be a file or directory path and is converted to a Path
	 * instance. If the argument is a URL, it is assumed to be a file URL and is
	 * converted to a Path instance. If the argument is a Path instance, it is
	 * copied into a new Path instance. If the argument is an array, it is assumed
	 * to be the steps of a path and is used to create a new Path instance.
	 * @param {string|URL|Path|Array<string>} pathish The value to convert to a Path instance.
	 * @returns {Path} A new Path instance.
	 * @throws {TypeError} When pathish is not a string, URL, Path, or Array.
	 * @throws {TypeError} When pathish is a string and is empty.
	 */
	static from(pathish) {
		if (typeof pathish === "string") {
			if (!pathish) {
				throw new TypeError("argument cannot be empty");
			}

			return Path.fromString(pathish);
		}

		if (pathish instanceof URL) {
			return Path.fromURL(pathish);
		}

		if (pathish instanceof Path || Array.isArray(pathish)) {
			return new Path(pathish);
		}

		throw new TypeError("argument must be a string, URL, Path, or Array");
	}

	/**
	 * Creates a new Path instance from a string.
	 * @param {string} fileOrDirPath The file or directory path to convert.
	 * @returns {Path} A new Path instance.
	 * @deprecated Use Path.from() instead.
	 */
	static fromString(fileOrDirPath) {
		return new Path(normalizePath(fileOrDirPath).split("/"));
	}

	/**
	 * Creates a new Path instance from a URL.
	 * @param {URL} url The URL to convert.
	 * @returns {Path} A new Path instance.
	 * @throws {TypeError} When url is not a URL instance.
	 * @throws {TypeError} When url.pathname is empty.
	 * @throws {TypeError} When url.protocol is not "file:".
	 * @deprecated Use Path.from() instead.
	 */
	static fromURL(url) {
		if (!(url instanceof URL)) {
			throw new TypeError("url must be a URL instance");
		}

		if (!url.pathname || url.pathname === "/") {
			throw new TypeError("url.pathname cannot be empty");
		}

		if (url.protocol !== "file:") {
			throw new TypeError(`url.protocol must be "file:"`);
		}

		// Remove leading slash in pathname
		return new Path(normalizePath(url.pathname.slice(1)).split("/"));
	}
}
$;
x R100644 LICENSE &랟+Kfݩo\d100644 README.md GU&5$I40000 dist >.y{1%x100644 package.json mONQiAZ	v	40000 src -QF&`r f>yAxL# `@humanfs/node`

by [Nicholas C. Zakas](https://humanwhocodes.com)

If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate) or [nominate me](https://stars.github.com/nominate/) for a GitHub Star.

## Description

The `hfs` bindings for use in Node.js and Node.js-compatible runtimes.

> [!WARNING]
> This project is **experimental** and may change significantly before v1.0.0. Use at your own caution and definitely not in production!

## Installation

Install using your favorite package manager:

```shell
npm install @humanfs/node

# or

pnpm install @humanfs/node

# or

yarn add @humanfs/node

# or

bun install @humanfs/node
```

## Usage

The easiest way to use hfs in your project is to import the `hfs` object:

```js
import { hfs } from "@humanfs/node";
```

Then, you can use the API methods:

```js
// 1. Files

// read from a text file
const text = await hfs.text("file.txt");

// read from a JSON file
const json = await hfs.json("file.json");

// read raw bytes from a text file
const arrayBuffer = await hfs.arrayBuffer("file.txt");

// write text to a file
await hfs.write("file.txt", "Hello world!");

// write bytes to a file
await hfs.write("file.txt", new TextEncoder().encode("Hello world!"));

// append text to a file
await hfs.append("file.txt", "Hello world!");

// append bytes to a file
await hfs.append("file.txt", new TextEncoder().encode("Hello world!"));

// does the file exist?
const found = await hfs.isFile("file.txt");

// how big is the file?
const size = await hfs.size("file.txt");

// when was the file modified?
const mtime = await hfs.lastModified("file.txt");

// copy a file from one location to another
await hfs.copy("file.txt", "file-copy.txt");

// move a file from one location to another
await hfs.move("file.txt", "renamed.txt");

// delete a file
await hfs.delete("file.txt");

// 2. Directories

// create a directory
await hfs.createDirectory("dir");

// create a directory recursively
await hfs.createDirectory("dir/subdir");

// does the directory exist?
const dirFound = await hfs.isDirectory("dir");

// copy the entire directory
hfs.copyAll("from-dir", "to-dir");

// move the entire directory
hfs.moveAll("from-dir", "to-dir");

// delete a directory
await hfs.delete("dir");

// delete a non-empty directory
await hfs.deleteAll("dir");
```

If you'd like to create your own instance, import the `NodeHfs` constructor:

```js
import { NodeHfs } from "@humanfs/node";
import fsp from "fs/promises";

const hfs = new NodeHfs();

// optionally specify the fs/promises object to use
const hfs = new NodeHfs({ fsp });
```

If you'd like to use just the impl, import the `NodeHfsImpl` constructor:

```js
import { NodeHfsImpl } from "@humanfs/node";
import fsp from "fs/promises";

const hfs = new NodeHfsImpl();

// optionally specify the fs/promises object to use
const hfs = new NodeHfsImpl({ fsp });
```

## Errors Handled

* `ENOENT` - in most cases, these errors are handled silently.
* `ENFILE` and `EMFILE` - calls that result in these errors are retried for up to 60 seconds before giving up for good.

## License

Apache 2.0
%xx 100644 index.d.ts ↋|Ԗ100644 node-fsx.d.ts x ߁׮\f$eƒi100644 node-hfs.d.ts 2" _f-o!NFs1̴xD export * from "./node-hfs.js";
export { Hfs } from "@humanfs/core";
x?47/// <reference types="node" resolution-mode="require"/>`!the Node.js implementation of Hfs,NodeHfsImplT	[options]$.)Fsp} [options.fsp] The file system modulez#fsp }?: {
        fsp?: Fspa# string>3
Nith the contents of
     *     the file or undefined if the file doesn't exista}2ERangeError} If the file path is empty.
     * @throws {RangeError} IfA'bsolute.
     * @throws {RangeError} IfA$file.
     * @throws {RangeError} IfAreadableXa# JSON object>3object|undefineMith the contents of
     *    the file or undefined if the file doesn't existIf47)j
}( object$aV3}Mith the contents
     *    of the file or undefined if the file doesn't exist;j
}*sa%#03zMith the contents
     *    of the file or undefined if the file doesn't exist;j
}(rPa value to a file. If the value'JyP|ArrayBuffer|ArrayBufferView} contents The contents to write to the
     *   filqDfile is
     *  writte`}Owritten0&string | ArrayBuffer | ArrayBufferView1!Checks if a2O*=ith true if the
     *    file exists or false if it does not -operation fails with a code other than ENOENT:IChecks if a6N*Bith true if the
     *    directory exists or false if it does not -operation fails with a code other than ENOENTUa directory recursively!B%lU
     *   createdxVa file or empty0#	fileOrDiror directory to
     *  Jfile or}orO+or directory cannot beZor directory is not foundOrDira file or directory recursively!OrDiror directory to
     *  Jfile or}orO+or directory cannot beZ:or directory is not found.
     */
    deleteAll(fileOrDira file!&9	|undefineH=
     *  file in bytes or undefined if the file doesn't exist4UqNodeHfs extendY	[options]$.)Fsp} [options.fsp] The file system modulez#Afsp }?: {
        fsp?: Fsp;
    });
}
export const hfs: NodeHfs;export type Fsp = typeof nativeFsp;
export type Dirent = import("fs").Dirent;
import { Hfs } from "@humanfs/core";
import nativeFsp from "node:fs/promises";
jغxj /// <reference types="node" resolution-mode="require"/>
/**
 * A class representing the Node.js implementation of Hfs.
 * @implements {HfsImpl}
 */
export class NodeHfsImpl implements HfsImpl {
    /**
     * Creates a new instance.
     * @param {object} [options] The options for the instance.
     * @param {Fsp} [options.fsp] The file system module to use.
     */
    constructor({ fsp }?: {
        fsp?: Fsp;
    });
    /**
     * Reads a file and returns the contents as an Uint8Array.
     * @param {string|URL} filePath The path to the file to read.
     * @returns {Promise<Uint8Array|undefined>} A promise that resolves with the contents
     *    of the file or undefined if the file doesn't exist.
     * @throws {Error} If the file cannot be read.
     * @throws {TypeError} If the file path is not a string.
     */
    bytes(filePath: string | URL): Promise<Uint8Array | undefined>;
    /**
     * Writes a value to a file. If the value is a string, UTF-8 encoding is used.
     * @param {string|URL} filePath The path to the file to write.
     * @param {Uint8Array} contents The contents to write to the
     *   file.
     * @returns {Promise<void>} A promise that resolves when the file is
     *  written.
     * @throws {TypeError} If the file path is not a string.
     * @throws {Error} If the file cannot be written.
     */
    write(filePath: string | URL, contents: Uint8Array): Promise<void>;
    /**
     * Appends a value to a file. If the value is a string, UTF-8 encoding is used.
     * @param {string|URL} filePath The path to the file to append to.
     * @param {Uint8Array} contents The contents to append to the
     *  file.
     * @returns {Promise<void>} A promise that resolves when the file is
     * written.
     * @throws {TypeError} If the file path is not a string.
     * @throws {Error} If the file cannot be appended to.
     */
    append(filePath: string | URL, contents: Uint8Array): Promise<void>;
    /**
     * Checks if a file exists.
     * @param {string|URL} filePath The path to the file to check.
     * @returns {Promise<boolean>} A promise that resolves with true if the
     *    file exists or false if it does not.
     * @throws {Error} If the operation fails with a code other than ENOENT.
     */
    isFile(filePath: string | URL): Promise<boolean>;
    /**
     * Checks if a directory exists.
     * @param {string|URL} dirPath The path to the directory to check.
     * @returns {Promise<boolean>} A promise that resolves with true if the
     *    directory exists or false if it does not.
     * @throws {Error} If the operation fails with a code other than ENOENT.
     */
    isDirectory(dirPath: string | URL): Promise<boolean>;
    /**
     * Creates a directory recursively.
     * @param {string|URL} dirPath The path to the directory to create.
     * @returns {Promise<void>} A promise that resolves when the directory is
     *   created.
     */
    createDirectory(dirPath: string | URL): Promise<void>;
    /**
     * Deletes a file or empty directory.
     * @param {string|URL} fileOrDirPath The path to the file or directory to
     *   delete.
     * @returns {Promise<boolean>} A promise that resolves when the file or
     *   directory is deleted, true if the file or directory is deleted, false
     *   if the file or directory does not exist.
     * @throws {TypeError} If the file or directory path is not a string.
     * @throws {Error} If the file or directory cannot be deleted.
     */
    delete(fileOrDirPath: string | URL): Promise<boolean>;
    /**
     * Deletes a file or directory recursively.
     * @param {string|URL} fileOrDirPath The path to the file or directory to
     *   delete.
     * @returns {Promise<boolean>} A promise that resolves when the file or
     *   directory is deleted, true if the file or directory is deleted, false
     *   if the file or directory does not exist.
     * @throws {TypeError} If the file or directory path is not a string.
     * @throws {Error} If the file or directory cannot be deleted.
     */
    deleteAll(fileOrDirPath: string | URL): Promise<boolean>;
    /**
     * Returns a list of directory entries for the given path.
     * @param {string|URL} dirPath The path to the directory to read.
     * @returns {AsyncIterable<HfsDirectoryEntry>} A promise that resolves with the
     *   directory entries.
     * @throws {TypeError} If the directory path is not a string.
     * @throws {Error} If the directory cannot be read.
     */
    list(dirPath: string | URL): AsyncIterable<HfsDirectoryEntry>;
    /**
     * Returns the size of a file. This method handles ENOENT errors
     * and returns undefined in that case.
     * @param {string|URL} filePath The path to the file to read.
     * @returns {Promise<number|undefined>} A promise that resolves with the size of the
     *  file in bytes or undefined if the file doesn't exist.
     */
    size(filePath: string | URL): Promise<number | undefined>;
    /**
     * Returns the last modified date of a file or directory. This method handles ENOENT errors
     * and returns undefined in that case.
     * @param {string|URL} fileOrDirPath The path to the file to read.
     * @returns {Promise<Date|undefined>} A promise that resolves with the last modified
     * date of the file or directory, or undefined if the file doesn't exist.
     */
    lastModified(fileOrDirPath: string | URL): Promise<Date | undefined>;
    /**
     * Copies a file from one location to another.
     * @param {string|URL} source The path to the file to copy.
     * @param {string|URL} destination The path to copy the file to.
     * @returns {Promise<void>} A promise that resolves when the file is copied.
     * @throws {Error} If the source file does not exist.
     * @throws {Error} If the source file is a directory.
     * @throws {Error} If the destination file is a directory.
     */
    copy(source: string | URL, destination: string | URL): Promise<void>;
    /**
     * Copies a file or directory from one location to another.
     * @param {string|URL} source The path to the file or directory to copy.
     * @param {string|URL} destination The path to copy the file or directory to.
     * @returns {Promise<void>} A promise that resolves when the file or directory is
     * copied.
     * @throws {Error} If the source file or directory does not exist.
     * @throws {Error} If the destination file or directory is a directory.
     */
    copyAll(source: string | URL, destination: string | URL): Promise<void>;
    /**
     * Moves a file from the source path to the destination path.
     * @param {string|URL} source The location of the file to move.
     * @param {string|URL} destination The destination of the file to move.
     * @returns {Promise<void>} A promise that resolves when the move is complete.
     * @throws {TypeError} If the file paths are not strings.
     * @throws {Error} If the file cannot be moved.
     */
    move(source: string | URL, destination: string | URL): Promise<void>;
    /**
     * Moves a file or directory from the source path to the destination path.
     * @param {string|URL} source The location of the file or directory to move.
     * @param {string|URL} destination The destination of the file or directory to move.
     * @returns {Promise<void>} A promise that resolves when the move is complete.
     * @throws {TypeError} If the file paths are not strings.
     * @throws {Error} If the file or directory cannot be moved.
     */
    moveAll(source: string | URL, destination: string | URL): Promise<void>;
    #private;
}
/**
 * A class representing a file system utility library.
 * @implements {HfsImpl}
 */
export class NodeHfs extends Hfs implements HfsImpl {
    /**
     * Creates a new instance.
     * @param {object} [options] The options for the instance.
     * @param {Fsp} [options.fsp] The file system module to use.
     */
    constructor({ fsp }?: {
        fsp?: Fsp;
    });
}
export const hfs: NodeHfs;
export type HfsImpl = import("@humanfs/types").HfsImpl;
export type HfsDirectoryEntry = import("@humanfs/types").HfsDirectoryEntry;
export type Fsp = typeof nativeFsp;
export type Dirent = import("fs").Dirent;
import { Hfs } from "@humanfs/core";
import nativeFsp from "node:fs/promises";
淥(Nx{
  "name": "@humanfs/node",
  "version": "0.16.8",
  "description": "The Node.js bindings of the humanfs library.",
  "type": "module",
  "main": "dist/index.js",
  "types": "dist/index.d.ts",
  "exports": {
    "import": {
      "types": "./dist/index.d.ts",
      "default": "./src/index.js"
    }
  },
  "files": [
    "dist",
    "src"
  ],
  "scripts": {
    "build": "tsc",
    "prepare": "npm run build",
    "pretest": "npm run build",
    "test": "mocha ./tests/"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/humanwhocodes/humanfs.git",
    "directory": "packages/node"
  },
  "publishConfig": {
    "access": "public"
  },
  "keywords": [
    "filesystem",
    "fs",
    "hfs",
    "files"
  ],
  "author": "Nicholas C. Zakas",
  "license": "Apache-2.0",
  "bugs": {
    "url": "https://github.com/humanwhocodes/humanfs/issues"
  },
  "homepage": "https://github.com/humanwhocodes/humanfs#readme",
  "engines": {
    "node": ">=18.18.0"
  },
  "devDependencies": {
    "@types/node": "^20.9.4",
    "@humanfs/test": "^0.15.0",
    "mocha": "^10.2.0",
    "typescript": "^5.2.2"
  },
  "dependencies": {
    "@humanwhocodes/retry": "^0.4.0",
    "@humanfs/core": "^0.19.2",
    "@humanfs/types": "^0.15.0"
  }
}
dxK 100644 index.js mUrBҔH/100644 node-hfs.js  -9LtC
x U/**
 * @fileoverview This file exports everything for this package.
 * @author Nicholas C. Zakas
 */

export * from "./node-hfs.js";
export { Hfs } from "@humanfs/core";
<8x4M/**
 * @fileoverview The main file for the hfs package.
 * @author Nicholas C. Zakas
 */
/* global Buffer:readonly, URL */

//-----------------------------------------------------------------------------
// Types
//-----------------------------------------------------------------------------

/** @typedef {import("@humanfs/types").HfsImpl} HfsImpl */
/** @typedef {import("@humanfs/types").HfsDirectoryEntry} HfsDirectoryEntry */
/** @typedef {import("node:fs/promises")} Fsp */
/** @typedef {import("fs").Dirent} Dirent */

//-----------------------------------------------------------------------------
// Imports
//-----------------------------------------------------------------------------

import { Hfs } from "@humanfs/core";
import path from "node:path";
import { Retrier } from "@humanwhocodes/retry";
import nativeFsp from "node:fs/promises";
import { fileURLToPath } from "node:url";

//-----------------------------------------------------------------------------
// Constants
//-----------------------------------------------------------------------------

const RETRY_ERROR_CODES = new Set(["ENFILE", "EMFILE"]);

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

/**
 * A class representing a directory entry.
 * @implements {HfsDirectoryEntry}
 */
class NodeHfsDirectoryEntry {
	/**
	 * The name of the directory entry.
	 * @type {string}
	 */
	name;

	/**
	 * True if the entry is a file.
	 * @type {boolean}
	 */
	isFile;

	/**
	 * True if the entry is a directory.
	 * @type {boolean}
	 */
	isDirectory;

	/**
	 * True if the entry is a symbolic link.
	 * @type {boolean}
	 */
	isSymlink;

	/**
	 * Creates a new instance.
	 * @param {Dirent} dirent The directory entry to wrap.
	 */
	constructor(dirent) {
		this.name = dirent.name;
		this.isFile = dirent.isFile();
		this.isDirectory = dirent.isDirectory();
		this.isSymlink = dirent.isSymbolicLink();
	}
}

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * A class representing the Node.js implementation of Hfs.
 * @implements {HfsImpl}
 */
export class NodeHfsImpl {
	/**
	 * The file system module to use.
	 * @type {Fsp}
	 */
	#fsp;

	/**
	 * The retryer object used for retrying operations.
	 * @type {Retrier}
	 */
	#retrier;

	/**
	 * Creates a new instance.
	 * @param {object} [options] The options for the instance.
	 * @param {Fsp} [options.fsp] The file system module to use.
	 */
	constructor({ fsp = nativeFsp } = {}) {
		this.#fsp = fsp;
		this.#retrier = new Retrier(error => RETRY_ERROR_CODES.has(error.code));
	}

	/**
	 * Reads a file and returns the contents as an Uint8Array.
	 * @param {string|URL} filePath The path to the file to read.
	 * @returns {Promise<Uint8Array|undefined>} A promise that resolves with the contents
	 *    of the file or undefined if the file doesn't exist.
	 * @throws {Error} If the file cannot be read.
	 * @throws {TypeError} If the file path is not a string.
	 */
	bytes(filePath) {
		return this.#retrier
			.retry(() => this.#fsp.readFile(filePath))
			.then(buffer => new Uint8Array(buffer.buffer))
			.catch(error => {
				if (error.code === "ENOENT") {
					return undefined;
				}

				throw error;
			});
	}

	/**
	 * Writes a value to a file. If the value is a string, UTF-8 encoding is used.
	 * @param {string|URL} filePath The path to the file to write.
	 * @param {Uint8Array} contents The contents to write to the
	 *   file.
	 * @returns {Promise<void>} A promise that resolves when the file is
	 *  written.
	 * @throws {TypeError} If the file path is not a string.
	 * @throws {Error} If the file cannot be written.
	 */
	async write(filePath, contents) {
		const value = Buffer.from(contents);

		return this.#retrier
			.retry(() => this.#fsp.writeFile(filePath, value))
			.catch(error => {
				// the directory may not exist, so create it
				if (error.code === "ENOENT") {
					const dirPath = path.dirname(
						filePath instanceof URL
							? fileURLToPath(filePath)
							: filePath,
					);

					return this.#fsp
						.mkdir(dirPath, { recursive: true })
						.then(() => this.#fsp.writeFile(filePath, value));
				}

				throw error;
			});
	}

	/**
	 * Appends a value to a file. If the value is a string, UTF-8 encoding is used.
	 * @param {string|URL} filePath The path to the file to append to.
	 * @param {Uint8Array} contents The contents to append to the
	 *  file.
	 * @returns {Promise<void>} A promise that resolves when the file is
	 * written.
	 * @throws {TypeError} If the file path is not a string.
	 * @throws {Error} If the file cannot be appended to.
	 */
	async append(filePath, contents) {
		const value = Buffer.from(contents);

		return this.#retrier
			.retry(() => this.#fsp.appendFile(filePath, value))
			.catch(error => {
				// the directory may not exist, so create it
				if (error.code === "ENOENT") {
					const dirPath = path.dirname(
						filePath instanceof URL
							? fileURLToPath(filePath)
							: filePath,
					);

					return this.#fsp
						.mkdir(dirPath, { recursive: true })
						.then(() => this.#fsp.appendFile(filePath, value));
				}

				throw error;
			});
	}

	/**
	 * Checks if a file exists.
	 * @param {string|URL} filePath The path to the file to check.
	 * @returns {Promise<boolean>} A promise that resolves with true if the
	 *    file exists or false if it does not.
	 * @throws {Error} If the operation fails with a code other than ENOENT.
	 */
	isFile(filePath) {
		return this.#fsp
			.stat(filePath)
			.then(stat => stat.isFile())
			.catch(error => {
				if (error.code === "ENOENT") {
					return false;
				}

				throw error;
			});
	}

	/**
	 * Checks if a directory exists.
	 * @param {string|URL} dirPath The path to the directory to check.
	 * @returns {Promise<boolean>} A promise that resolves with true if the
	 *    directory exists or false if it does not.
	 * @throws {Error} If the operation fails with a code other than ENOENT.
	 */
	isDirectory(dirPath) {
		return this.#fsp
			.stat(dirPath)
			.then(stat => stat.isDirectory())
			.catch(error => {
				if (error.code === "ENOENT") {
					return false;
				}

				throw error;
			});
	}

	/**
	 * Creates a directory recursively.
	 * @param {string|URL} dirPath The path to the directory to create.
	 * @returns {Promise<void>} A promise that resolves when the directory is
	 *   created.
	 */
	async createDirectory(dirPath) {
		await this.#fsp.mkdir(dirPath, { recursive: true });
	}

	/**
	 * Deletes a file or empty directory.
	 * @param {string|URL} fileOrDirPath The path to the file or directory to
	 *   delete.
	 * @returns {Promise<boolean>} A promise that resolves when the file or
	 *   directory is deleted, true if the file or directory is deleted, false
	 *   if the file or directory does not exist.
	 * @throws {TypeError} If the file or directory path is not a string.
	 * @throws {Error} If the file or directory cannot be deleted.
	 */
	delete(fileOrDirPath) {
		return this.#fsp
			.rm(fileOrDirPath)
			.then(() => true)
			.catch(error => {
				if (error.code === "ERR_FS_EISDIR") {
					return this.#fsp.rmdir(fileOrDirPath).then(() => true);
				}

				if (error.code === "ENOENT") {
					return false;
				}

				throw error;
			});
	}

	/**
	 * Deletes a file or directory recursively.
	 * @param {string|URL} fileOrDirPath The path to the file or directory to
	 *   delete.
	 * @returns {Promise<boolean>} A promise that resolves when the file or
	 *   directory is deleted, true if the file or directory is deleted, false
	 *   if the file or directory does not exist.
	 * @throws {TypeError} If the file or directory path is not a string.
	 * @throws {Error} If the file or directory cannot be deleted.
	 */
	deleteAll(fileOrDirPath) {
		return this.#fsp
			.rm(fileOrDirPath, { recursive: true })
			.then(() => true)
			.catch(error => {
				if (error.code === "ENOENT") {
					return false;
				}

				throw error;
			});
	}

	/**
	 * Returns a list of directory entries for the given path.
	 * @param {string|URL} dirPath The path to the directory to read.
	 * @returns {AsyncIterable<HfsDirectoryEntry>} A promise that resolves with the
	 *   directory entries.
	 * @throws {TypeError} If the directory path is not a string.
	 * @throws {Error} If the directory cannot be read.
	 */
	async *list(dirPath) {
		const entries = await this.#fsp.readdir(dirPath, {
			withFileTypes: true,
		});

		for (const entry of entries) {
			yield new NodeHfsDirectoryEntry(entry);
		}
	}

	/**
	 * Returns the size of a file. This method handles ENOENT errors
	 * and returns undefined in that case.
	 * @param {string|URL} filePath The path to the file to read.
	 * @returns {Promise<number|undefined>} A promise that resolves with the size of the
	 *  file in bytes or undefined if the file doesn't exist.
	 */
	size(filePath) {
		return this.#fsp
			.stat(filePath)
			.then(stat => stat.size)
			.catch(error => {
				if (error.code === "ENOENT") {
					return undefined;
				}

				throw error;
			});
	}

	/**
	 * Returns the last modified date of a file or directory. This method handles ENOENT errors
	 * and returns undefined in that case.
	 * @param {string|URL} fileOrDirPath The path to the file to read.
	 * @returns {Promise<Date|undefined>} A promise that resolves with the last modified
	 * date of the file or directory, or undefined if the file doesn't exist.
	 */
	lastModified(fileOrDirPath) {
		return this.#fsp
			.stat(fileOrDirPath)
			.then(stat => stat.mtime)
			.catch(error => {
				if (error.code === "ENOENT") {
					return undefined;
				}

				throw error;
			});
	}

	/**
	 * Copies a file from one location to another.
	 * @param {string|URL} source The path to the file to copy.
	 * @param {string|URL} destination The path to copy the file to.
	 * @returns {Promise<void>} A promise that resolves when the file is copied.
	 * @throws {Error} If the source file does not exist.
	 * @throws {Error} If the source file is a directory.
	 * @throws {Error} If the destination file is a directory.
	 */
	async copy(source, destination) {
		const stat = await this.#fsp.lstat(source);
		if (stat.isSymbolicLink()) {
			const target = await this.#fsp.readlink(source);
			return this.#fsp.symlink(target, destination);
		}
		return this.#fsp.copyFile(source, destination);
	}

	/**
	 * Copies a file or directory from one location to another.
	 * @param {string|URL} source The path to the file or directory to copy.
	 * @param {string|URL} destination The path to copy the file or directory to.
	 * @returns {Promise<void>} A promise that resolves when the file or directory is
	 * copied.
	 * @throws {Error} If the source file or directory does not exist.
	 * @throws {Error} If the destination file or directory is a directory.
	 */
	async copyAll(source, destination) {
		// for files use copy() and exit
		if (await this.isFile(source)) {
			return this.copy(source, destination);
		}

		const sourceStr =
			source instanceof URL ? fileURLToPath(source) : source;

		const destinationStr =
			destination instanceof URL
				? fileURLToPath(destination)
				: destination;

		// for directories, create the destination directory and copy each entry
		await this.createDirectory(destination);

		for await (const entry of this.list(source)) {
			const fromEntryPath = path.join(sourceStr, entry.name);
			const toEntryPath = path.join(destinationStr, entry.name);

			if (entry.isSymlink) {
				const target = await this.#fsp.readlink(fromEntryPath);
				await this.#fsp.symlink(target, toEntryPath);
			} else if (entry.isDirectory) {
				await this.copyAll(fromEntryPath, toEntryPath);
			} else {
				await this.copy(fromEntryPath, toEntryPath);
			}
		}
	}

	/**
	 * Moves a file from the source path to the destination path.
	 * @param {string|URL} source The location of the file to move.
	 * @param {string|URL} destination The destination of the file to move.
	 * @returns {Promise<void>} A promise that resolves when the move is complete.
	 * @throws {TypeError} If the file paths are not strings.
	 * @throws {Error} If the file cannot be moved.
	 */
	move(source, destination) {
		return this.#fsp.stat(source).then(stat => {
			if (stat.isDirectory()) {
				throw new Error(
					`EISDIR: illegal operation on a directory, move '${source}' -> '${destination}'`,
				);
			}

			return this.#fsp.rename(source, destination);
		});
	}

	/**
	 * Moves a file or directory from the source path to the destination path.
	 * @param {string|URL} source The location of the file or directory to move.
	 * @param {string|URL} destination The destination of the file or directory to move.
	 * @returns {Promise<void>} A promise that resolves when the move is complete.
	 * @throws {TypeError} If the file paths are not strings.
	 * @throws {Error} If the file or directory cannot be moved.
	 */
	async moveAll(source, destination) {
		return this.#fsp.rename(source, destination);
	}
}

/**
 * A class representing a file system utility library.
 * @implements {HfsImpl}
 */
export class NodeHfs extends Hfs {
	/**
	 * Creates a new instance.
	 * @param {object} [options] The options for the instance.
	 * @param {Fsp} [options.fsp] The file system module to use.
	 */
	constructor({ fsp } = {}) {
		super({ impl: new NodeHfsImpl({ fsp }) });
	}
}

export const hfs = new NodeHfs();
@yx C100644 CHANGELOG.md %^'#;ui100644 README.md zGovh)pHiA@2100644 package.json ^Tl8hR040000 src qrurG`yZ(100644 tsconfig.json "N*\^ex$|#FK籰x# Changelog

## [0.15.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.14.0...types-v0.15.0) (2024-09-09)


### Features

* Add depth to HfsWalkEntry ([#130](https://github.com/humanwhocodes/humanfs/issues/130)) ([a633452](https://github.com/humanwhocodes/humanfs/commit/a63345260562b798e73c2ea63612e6fe95ac400d))

## [0.14.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.13.0...types-v0.14.0) (2024-06-12)


### Features

* Implement Hfs#walk() method ([#119](https://github.com/humanwhocodes/humanfs/issues/119)) ([2aeade0](https://github.com/humanwhocodes/humanfs/commit/2aeade0ffbef886103dc38d16694e9b63191a8df))

## [0.13.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.12.0...types-v0.13.0) (2024-03-20)


### ⚠ BREAKING CHANGES

* delete/deleteAll should not throw on ENOENT ([#105](https://github.com/humanwhocodes/humanfs/issues/105))

### Features

* delete/deleteAll should not throw on ENOENT ([#105](https://github.com/humanwhocodes/humanfs/issues/105)) ([b508df1](https://github.com/humanwhocodes/humanfs/commit/b508df19845f7a914895c13cfe47707c0cd1a7c7))

## [0.12.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.11.0...types-v0.12.0) (2024-02-27)


### Features

* impl write() method only needs to handle Uint8Arrays ([#92](https://github.com/humanwhocodes/humanfs/issues/92)) ([68bcfb5](https://github.com/humanwhocodes/humanfs/commit/68bcfb59a6684b184c55f97536aad730636299b5))

## [0.11.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.10.0...types-v0.11.0) (2024-02-23)


### Features

* Impls only need bytes() method to read data ([#90](https://github.com/humanwhocodes/humanfs/issues/90)) ([c0c3b36](https://github.com/humanwhocodes/humanfs/commit/c0c3b36413c8d10e63a94ad1cc6a5cead7b52e88))

## [0.10.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.9.0...types-v0.10.0) (2024-02-16)


### ⚠ BREAKING CHANGES

* Rewrite MemoryHfsImpl to support lastModified() ([#87](https://github.com/humanwhocodes/humanfs/issues/87))

### Features

* Add lastModified() method ([#84](https://github.com/humanwhocodes/humanfs/issues/84)) ([9cbcd03](https://github.com/humanwhocodes/humanfs/commit/9cbcd03c86e4c1bed5985e10da6ab452e8c2b44c))
* Rewrite MemoryHfsImpl to support lastModified() ([#87](https://github.com/humanwhocodes/humanfs/issues/87)) ([84e9812](https://github.com/humanwhocodes/humanfs/commit/84e98129e48acb3f2ea067b0ea745d591e8d8b91))

## [0.9.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.8.0...types-v0.9.0) (2024-02-14)


### Features

* Add append() method ([#82](https://github.com/humanwhocodes/humanfs/issues/82)) ([ab7b978](https://github.com/humanwhocodes/humanfs/commit/ab7b978ff3be84dc3fd2fd4d6fa1131dfdec8134))
* Add move() and moveAll() methods ([#80](https://github.com/humanwhocodes/humanfs/issues/80)) ([85f100b](https://github.com/humanwhocodes/humanfs/commit/85f100b721c99b920b307779548c2a043e7e18b5))

## [0.8.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.7.0...types-v0.8.0) (2024-02-09)


### Features

* Add copyAll() method ([#77](https://github.com/humanwhocodes/humanfs/issues/77)) ([3c0852a](https://github.com/humanwhocodes/humanfs/commit/3c0852af99cb835b3941f58fdc2206e7b1179e21))

## [0.7.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.6.0...types-v0.7.0) (2024-02-08)


### Features

* Add copy() method ([#69](https://github.com/humanwhocodes/humanfs/issues/69)) ([f252bac](https://github.com/humanwhocodes/humanfs/commit/f252bac6692a5b5c973ee3c696f5190caa5f12c7))

## [0.6.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.5.1...types-v0.6.0) (2024-02-07)


### Features

* Allow URL file and directory paths ([#62](https://github.com/humanwhocodes/humanfs/issues/62)) ([a767e37](https://github.com/humanwhocodes/humanfs/commit/a767e372287b1556c4c9e8bdb26c23ff81866f99))

## [0.5.1](https://github.com/humanwhocodes/humanfs/compare/types-v0.5.0...types-v0.5.1) (2024-01-31)


### Bug Fixes

* Order of exports and engines in package.json ([66204c2](https://github.com/humanwhocodes/humanfs/commit/66204c24bc2dd02380aa2fb3c5769ca2cf5238a7)), closes [#61](https://github.com/humanwhocodes/humanfs/issues/61)

## [0.5.0](https://github.com/humanwhocodes/humanfs/compare/types-v0.4.0...types-v0.5.0) (2024-01-30)


### ⚠ BREAKING CHANGES

* Rename fsx -> humanfs ([#56](https://github.com/humanwhocodes/humanfs/issues/56))

### Features

* Rename fsx -&gt; humanfs ([#56](https://github.com/humanwhocodes/humanfs/issues/56)) ([f5dc533](https://github.com/humanwhocodes/humanfs/commit/f5dc533c8a46d45afd7aad602af39a6074f8a07b))

## [0.4.0](https://github.com/humanwhocodes/fsx/compare/fsx-types-v0.3.0...fsx-types-v0.4.0) (2024-01-27)


### Features

* New size() method ([#51](https://github.com/humanwhocodes/fsx/issues/51)) ([ffd12e6](https://github.com/humanwhocodes/fsx/commit/ffd12e6b0db318320dd5a9dbb8eb248106d60afa))

## [0.3.0](https://github.com/humanwhocodes/fsx/compare/fsx-types-v0.2.0...fsx-types-v0.3.0) (2024-01-23)


### ⚠ BREAKING CHANGES

* Safer delete(); new deleteAll() method ([#37](https://github.com/humanwhocodes/fsx/issues/37))

### Features

* Safer delete(); new deleteAll() method ([#37](https://github.com/humanwhocodes/fsx/issues/37)) ([2e85142](https://github.com/humanwhocodes/fsx/commit/2e85142e34bdc3cc18e18aa0b051cc9007fca4b8))
* write() to accept ArrayBuffer views as file contents ([1fd5517](https://github.com/humanwhocodes/fsx/commit/1fd55174a528ef3dcbabc154347006bec799f3f9))


### Bug Fixes

* **types:** Ensure FsxImpl methods also return undefined ([14eadc6](https://github.com/humanwhocodes/fsx/commit/14eadc66b19e40d7406a166e019004d9888075d3)), closes [#32](https://github.com/humanwhocodes/fsx/issues/32)

## [0.2.0](https://github.com/humanwhocodes/fsx/compare/fsx-types-v0.1.0...fsx-types-v0.2.0) (2024-01-19)


### Features

* Add list() method ([#25](https://github.com/humanwhocodes/fsx/issues/25)) ([dad841b](https://github.com/humanwhocodes/fsx/commit/dad841b7c9f5312996ff23db9be36774af985157))

## [0.1.0](https://github.com/humanwhocodes/fsx/compare/fsx-types-v0.0.3...fsx-types-v0.1.0) (2024-01-18)


### Features

* Add bytes() method, deprecate arrayBuffer() ([718c9c8](https://github.com/humanwhocodes/fsx/commit/718c9c84a0a1dcaef3cc032c882b1308e9cb3273))

## [0.0.3](https://github.com/humanwhocodes/fsx/compare/fsx-types-v0.0.2...fsx-types-v0.0.3) (2024-01-16)


### Bug Fixes

* Ensure isFile/isDirectory rethrow non-ENOENT errors. ([d31ee56](https://github.com/humanwhocodes/fsx/commit/d31ee56788e898cbc1fc0d6a54d1551f9b17cd45)), closes [#14](https://github.com/humanwhocodes/fsx/issues/14)

## [0.0.2](https://github.com/humanwhocodes/fsx/compare/fsx-types-v0.0.1...fsx-types-v0.0.2) (2024-01-06)

### Bug Fixes

-   **docs:** Correct package names in READMEs ([6c552ac](https://github.com/humanwhocodes/fsx/commit/6c552ac74542a245cdc2675101858da022336a1a))
nx# `@humanfs/types`

by [Nicholas C. Zakas](https://humanwhocodes.com)

If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate) or [nominate me](https://stars.github.com/nominate/) for a GitHub Star.

## Description

Additional type definitions for humanfs. These are used primarily to share type definitions across packages because there is no easy way to export imported type definitions using JavaScript and JSDoc.

## License

Apache 2.0
3Oվ6xn{
  "name": "@humanfs/types",
  "version": "0.15.0",
  "description": "The TypeScript types for the hfs project.",
  "type": "module",
  "types": "src/hfs-types.ts",
  "exports": {
    ".": {
      "types": "./src/hfs-types.ts"
    },
    "./package.json": "./package.json"
  },
  "scripts": {
    "build": "tsc",
    "prepare": "npm run build"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/humanwhocodes/humanfs.git"
  },
  "publishConfig": {
    "access": "public"
  },
  "keywords": [
    "filesystem",
    "fs",
    "hfs",
    "files"
  ],
  "author": "Nicholas C. Zakas",
  "license": "Apache-2.0",
  "bugs": {
    "url": "https://github.com/humanwhocodes/humanfs/issues"
  },
  "homepage": "https://github.com/humanwhocodes/humanfs#readme",
  "engines": {
    "node": ">=18.18.0"
  },
  "devDependencies": {
    "typescript": "^5.2.2"
  }
}
H x( 100644 hfs-types.ts 	a|Ef{ tU71 "x/**
 * @fileoverview The types file for the hfs package.
 * @author Nicholas C. Zakas
 */

//------------------------------------------------------------------------------
// HfsImpl
//------------------------------------------------------------------------------

export interface HfsImpl {

	/**
	 * Reads the given file and returns the contents as an Uint8Array.
	 * @param filePath The file to read.
	 * @returns The contents of the file as a Uint8Array or undefined if the file is empty.
	 */
	bytes?(filePath: string|URL): Promise<Uint8Array|undefined>;

	/**
	 * Writes the given data to the given file. For text, assumes UTF-8 encoding.
	 * @param filePath The file to write to.
	 * @param data The data to write.
	 * @returns A promise that resolves when the file is written.
	 * @throws {Error} If the file cannot be written.
	 */
	write?(filePath: string|URL, data: Uint8Array): Promise<void>;

	/**
	 * Appends the given data to the given file. For text, assumes UTF-8 encoding.
	 * @param filePath The file to append to.
	 * @param data The data to append.
	 * @returns A promise that resolves when the file is written.
	 * @throws {Error} If the file cannot be written.
	 */
	append?(filePath: string|URL, data: Uint8Array): Promise<void>;

	/**
	 * Checks if the given file exists.
	 * @param filePath The file to check.
	 * @returns True if the file exists, false if not.
	 * @throws {Error} If the operation fails with a code other than ENOENT.
	 */
	isFile?(filePath: string|URL): Promise<boolean>;

	/**
	 * Checks if the given directory exists.
	 * @param dirPath The directory to check.
	 * @returns True if the directory exists, false if not.
	 * @throws {Error} If the operation fails with a code other than ENOENT.
	 */
	isDirectory?(dirPath: string|URL): Promise<boolean>;

	/**
	 * Creates the given directory, including any necessary parents.
	 * @param dirPath The directory to create.
	 * @returns A promise that resolves when the directory is created.
	 * @throws {Error} If the directory cannot be created.
	 */
	createDirectory?(dirPath: string|URL): Promise<void>;

	/**
	 * Deletes the given file or empty directory.
	 * @param fileOrDirPath The file or directory to delete.
	 * @returns A promise that resolves when the file or directory is deleted,
	 * 	true if the file or directory was deleted, false if it did not exist.
	 * @throws {Error} If the file or directory cannot be deleted.
	 */
	delete?(fileOrDirPath: string|URL): Promise<boolean>;

	/**
	 * Deletes the given file or directory recursively.
	 * @param fileOrDirPath The file or directory to delete.
	 * @returns A promise that resolves when the file or directory is deleted,
	 * 	true if the file or directory was deleted, false if it did not exist.
	 * @throws {Error} If the file or directory cannot be deleted.
	 */
	deleteAll?(fileOrDirPath: string|URL): Promise<boolean>;

	/**
	 * Returns a list of directory entries for the given path.
	 * @param dirPath The path to the directory to read.
	 * @returns A promise that resolves with the
	 *   directory entries.
	 * @throws {TypeError} If the directory path is not a string.
	 * @throws {Error} If the directory cannot be read.
	 */
	list?(dirPath: string|URL): AsyncIterable<HfsDirectoryEntry>;

	/**
	 * Returns the size of the given file.
	 * @param filePath The path to the file to check.
	 * @returns A promise that resolves with the size of the file in bytes or
	 * 		undefined if the file does not exist.
	 * @throws {Error} If the file cannot be read.
	 */
	size?(filePath: string|URL): Promise<number|undefined>;

	/**
	 * Returns the last modified date of the given file or directory.
	 * @param fileOrDirPath The path to the file or directory to check.
	 * @returns A promise that resolves with the last modified date of the file or
	 * 		directory, undefined if the file does not exist.
	 * @throws {Error} If the file or directory cannot be read.
	 */
	lastModified?(fileOrDirPath: string|URL): Promise<Date|undefined>;

	/**
	 * Copies the file from the source path to the destination path.
	 * @param source The source file to copy.
	 * @param destination The destination file to copy to.
	 * @returns A promise that resolves when the file is copied.
	 * @throws {Error} If the file cannot be copied.
	 */
	copy?(source: string|URL, destination: string|URL): Promise<void>;

	/**
	 * Copies a file or directory from one location to another.
	 * @param source The path to the file or directory to copy.
	 * @param destination The path to copy the file or directory to.
	 * @returns A promise that resolves when the file or directory is
	 * copied.
	 * @throws {Error} If the source file or directory does not exist.
	 * @throws {Error} If the source cannot be read.
	 */
	copyAll?(source: string|URL, destination: string|URL): Promise<void>;

	/**
	 * Moves a file from the source path to the destination path.
	 * @param source The location of the file to move.
	 * @param destination The destination of the file to move.
	 * @returns A promise that resolves when the file is moved.
	 * @throws {Error} If the source is a directory.
	 * @throws {Error} If the file cannot be moved.
	 */
	move?(source: string|URL, destination: string|URL): Promise<void>;

	/**
	 * Moves a file or directory from one location to another.
	 * @param source The path to the file or directory to move.
	 * @param destination The path to move the file or directory to.
	 * @returns A promise that resolves when the file or directory is
	 * moved.
	 * @throws {Error} If the source file or directory does not exist.
	 * @throws {Error} If the source cannot be read.
	 */
	moveAll?(source: string|URL, destination: string|URL): Promise<void>;
}

//------------------------------------------------------------------------------
// HfsDirectoryEntry
//------------------------------------------------------------------------------

export interface HfsDirectoryEntry {

	/**
	 * The name of the file or directory.
	 */
	name: string;

	/**
	 * True if the entry is a directory, false if not.
	 */
	isDirectory: boolean;

	/**
	 * True if the entry is a file, false if not.
	 */
	isFile: boolean;

	/**
	 * True if the entry is a symbolic link, false if not.
	 */
	isSymlink: boolean;

}

//------------------------------------------------------------------------------
// HfsWalkEntry
//------------------------------------------------------------------------------

export interface HfsWalkEntry extends HfsDirectoryEntry {

	/**
	 * The path of the entry relative to the directory that was walked.
	 */
	path: string;

	/**
	 * The depth of the entry in the directory tree from the directory that was walked.
	 */
	depth: number;
}
ex{
  "files": ["src/hfs-types.ts"],
  "compilerOptions": {
    "declaration": true,
    "emitDeclarationOnly": true,
    "allowJs": true,
    "checkJs": true,
    "outDir": "dist",
    "target": "ES2022",
    "moduleResolution": "NodeNext",
    "module": "NodeNext"
  }
}
Oªxj 40000 module-importer RYѬM0x\Y8.40000 momoa RXiC=e?v40000 retry `s׾uNC5HI-٥x *100644 CHANGELOG.md D*]Ϻl!/IJh100644 LICENSE &랟+Kfݩo\d100644 README.md =z%m&40000 dist ^߬?>tasàe100644 package.json 󄻗Pö S40000 src 1%hll}oT!x# Changelog

## [1.0.1](https://github.com/humanwhocodes/module-importer/compare/v1.0.0...v1.0.1) (2022-08-18)


### Bug Fixes

* Ensure CommonJS mode works correctly. ([cf54a0b](https://github.com/humanwhocodes/module-importer/commit/cf54a0b998085066fbe1776dd0b4cacd808cc192)), closes [#6](https://github.com/humanwhocodes/module-importer/issues/6)

## 1.0.0 (2022-08-17)


### Features

* Implement ModuleImporter ([3ce4e82](https://www.github.com/humanwhocodes/module-importer/commit/3ce4e820c30c114e787bfed00a0966ac4772f563))
ڣx,# ModuleImporter

by [Nicholas C. Zakas](https://humanwhocodes.com)

If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate).

## Description

A utility for seamlessly importing modules in Node.js regardless if they are CommonJS or ESM format. Under the hood, this uses `import()` and relies on Node.js's CommonJS compatibility to work correctly. This ensures that the correct locations and formats are used for CommonJS so you can call one method and not worry about any compatibility issues.

The problem with the default `import()` is that it always resolves relative to the file location in which it is called. If you want to resolve from a different location, you need to jump through a few hoops to achieve that. This package makes it easy to both resolve and import modules from any directory.

## Usage

### Node.js

Install using [npm][npm] or [yarn][yarn]:

```
npm install @humanwhocodes/module-importer

# or

yarn add @humanwhocodes/module-importer
```

Import into your Node.js project:

```js
// CommonJS
const { ModuleImporter } = require("@humanwhocodes/module-importer");

// ESM
import { ModuleImporter } from "@humanwhocodes/module-importer";
```

### Bun

Install using this command:

```
bun add @humanwhocodes/module-importer
```

Import into your Bun project:

```js
import { ModuleImporter } from "@humanwhocodes/module-importer";
```

## API

After importing, create a new instance of `ModuleImporter` to start emitting events:

```js
// cwd can be omitted to use process.cwd()
const importer = new ModuleImporter(cwd);

// you can resolve the location of any package
const location = importer.resolve("./some-file.cjs");

// you can also import directly
const module = importer.import("./some-file.cjs");
```

For both `resolve()` and `import()`, you can pass in package names and filenames.

## Developer Setup

1. Fork the repository
2. Clone your fork
3. Run `npm install` to setup dependencies
4. Run `npm test` to run tests

## License

Apache 2.0

[npm]: https://npmjs.com/
[yarn]: https://yarnpkg.com/
 x A100644 module-importer.cjs wa>&w}SW100644 module-importer.d.cts m8hϾ~qI100644 module-importer.d.ts I
$edҙk|ze100644 module-importer.js &R+<	:N8 !YM5xV'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var module$1 = require('module');
var url = require('url');
var path = require('path');

/**
 * @fileoverview Universal module importer
 */

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

const __filename$1 = url.fileURLToPath((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('module-importer.cjs', document.baseURI).href)));
const __dirname$1 = path.dirname(__filename$1);
const require$1 = module$1.createRequire(__dirname$1 + "/");
const { ModuleImporter } = require$1("./module-importer.cjs");

exports.ModuleImporter = ModuleImporter;
8xqexport class ModuleImporter {
    /**
     * Creates a new instance.
     * @param {string} [cwd] The current working directory to resolve from.
     */
    constructor(cwd?: string);
    /**
     * The base directory from which paths should be resolved.
     * @type {string}
     */
    cwd: string;
    /**
     * Resolves a module based on its name or location.
     * @param {string} specifier Either an npm package name or
     *      relative file path.
     * @returns {string|undefined} The location of the import.
     * @throws {Error} If specifier cannot be located.
     */
    resolve(specifier: string): string | undefined;
    /**
     * Imports a module based on its name or location.
     * @param {string} specifier Either an npm package name or
     *      relative file path.
     * @returns {Promise<object>} The module's object.
     */
    import(specifier: string): Promise<object>;
}
C*!LxS export { ModuleImporter };
import { ModuleImporter } from "./module-importer.cjs";
~-x"/**
 * @fileoverview Universal module importer
 */

//-----------------------------------------------------------------------------
// Imports
//-----------------------------------------------------------------------------

import { createRequire } from "module";
import { fileURLToPath } from "url";
import { dirname } from "path";

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const require = createRequire(__dirname + "/");
const { ModuleImporter } = require("./module-importer.cjs");

export { ModuleImporter };
8jx/ 'module' 'url'+	'path';

<l$8]x-{
  "name": "@humanwhocodes/module-importer",
  "version": "1.0.1",
  "description": "Universal module importer for Node.js",
  "main": "src/module-importer.cjs",
  "module": "src/module-importer.js",
  "type": "module",
  "types": "dist/module-importer.d.ts",
  "exports": {
    "require": "./src/module-importer.cjs",
    "import": "./src/module-importer.js"
  },
  "files": [
    "dist",
    "src"
  ],
  "publishConfig": {
    "access": "public"
  },
  "gitHooks": {
    "pre-commit": "lint-staged"
  },
  "lint-staged": {
    "*.js": [
      "eslint --fix"
    ]
  },
  "funding": {
    "type": "github",
    "url": "https://github.com/sponsors/nzakas"
  },
  "scripts": {
    "build": "rollup -c && tsc",
    "prepare": "npm run build",
    "lint": "eslint src/ tests/",
    "test:unit": "c8 mocha tests/module-importer.test.js",
    "test:build": "node tests/pkg.test.cjs && node tests/pkg.test.mjs",
    "test": "npm run test:unit && npm run test:build"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/humanwhocodes/module-importer.git"
  },
  "keywords": [
    "modules",
    "esm",
    "commonjs"
  ],
  "engines": {
    "node": ">=12.22"
  },
  "author": "Nicholas C. Zaks",
  "license": "Apache-2.0",
  "devDependencies": {
    "@types/node": "^18.7.6",
    "c8": "7.12.0",
    "chai": "4.3.6",
    "eslint": "8.22.0",
    "lint-staged": "13.0.3",
    "mocha": "9.2.2",
    "rollup": "2.78.0",
    "typescript": "4.7.4",
    "yorkie": "2.0.0"
  }
}
x] 100644 module-importer.cjs >	^e

!LWN100644 module-importer.js FṈ>	P%yx
/**
 * @fileoverview Universal module importer
 */

//-----------------------------------------------------------------------------
// Imports
//-----------------------------------------------------------------------------

const { createRequire } = require("module");
const { pathToFileURL }  = require("url");

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

const SLASHES = new Set(["/", "\\"]);

/**
 * Normalizes directories to have a trailing slash.
 * Resolve is pretty finicky -- if the directory name doesn't have
 * a trailing slash then it tries to look in the parent directory.
 * i.e., if the directory is "/usr/nzakas/foo" it will start the 
 * search in /usr/nzakas. However, if the directory is "/user/nzakas/foo/",
 * then it will start the search in /user/nzakas/foo.
 * @param {string} directory The directory to check. 
 * @returns {string} The normalized directory.
 */
function normalizeDirectory(directory) {
    if (!SLASHES.has(directory[directory.length-1])) {
        return directory + "/";
    }

    return directory;
}

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * Class for importing both CommonJS and ESM modules in Node.js.
 */
exports.ModuleImporter = class ModuleImporter {

    /**
     * Creates a new instance.
     * @param {string} [cwd] The current working directory to resolve from. 
     */
    constructor(cwd = process.cwd()) {

        /**
         * The base directory from which paths should be resolved.
         * @type {string}
         */
        this.cwd = normalizeDirectory(cwd);
    }

    /**
     * Resolves a module based on its name or location.
     * @param {string} specifier Either an npm package name or
     *      relative file path.
     * @returns {string|undefined} The location of the import.
     * @throws {Error} If specifier cannot be located.
     */
    resolve(specifier) {
        const require = createRequire(this.cwd);
        return require.resolve(specifier);
    }

    /**
     * Imports a module based on its name or location.
     * @param {string} specifier Either an npm package name or
     *      relative file path.
     * @returns {Promise<object>} The module's object.
     */
    import(specifier) {
        const location = this.resolve(specifier);
        return import(pathToFileURL(location).href);
    }

}
Wgxl 100644 README.md >=.\#
40000 dist g1YZ}~&Y
R\AN100644 package.json ߇7)f]ݺR)#zy:)x^&# Momoa JSON

by [Nicholas C. Zakas](https://humanwhocodes.com)

If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate).

## About

Momoa is a general purpose JSON utility toolkit, containing:

* A **tokenizer** that allows you to separate a JSON string into its component parts.
* A ECMA-404 compliant **parser** that produces an abstract syntax tree (AST) representing everything inside of a JSON string.
* A **traverser** that visits an AST produced by the parser in order.
* A **printer** that can convert an AST produced by the parser back into a valid JSON string.

## Background

JavaScript defines the `JSON` object with methods for both parsing strings into objects and converting objects into JSON-formatted strings. In most cases, this is exactly what you need and should use without question. However, these methods aren't useful for more fine-grained analysis of JSON structures. For instance, you'll never know if a JSON object contains two properties with the same names because `JSON.parse()` will ignore the first one and return the value of the second. A tool like Momoa comes in handy when you want to know not just the result of JSON parsing, but exactly what is contained in the original JSON string.

## Usage

### Node.js

Install using [npm][npm] or [yarn][yarn]:

```
npm install @humanwhocodes/momoa

# or

yarn add @humanwhocodes/momoa
```

Import into your Node.js project:

```js
// CommonJS
const { parse } = require("@humanwhocodes/momoa");

// ESM
import { parse } from "@humanwhocodes/momoa";
```

### Deno

Import into your Deno project:

```js
import { parse } from "https://cdn.skypack.dev/@humanwhocodes/momoa?dts";
```

### Bun

Install using this command:

```
bun add @humanwhocodes/momoa
```

Import into your Bun project:

```js
import { parse } from "@humanwhocodes/momoa";
```

### Browser

It's recommended to import the minified version to save bandwidth:

```js
import { parse } from "https://cdn.skypack.dev/@humanwhocodes/momoa?min";
```

However, you can also import the unminified version for debugging purposes:

```js
import { parse } from "https://cdn.skypack.dev/@humanwhocodes/momoa";
```

## API

### Parsing 

To parse a JSON string into an AST, use the `parse()` function:

```js
const { parse } = require("@humanwhocodes/momoa");

const ast = parse(some_json_string);
```

The `parse()` function accepts a second argument, which is an options object that may contain one or more of the following properties:

* `mode` (default: `"json"`) - specify the parsing mode. Possible options are `"json"`, `"jsonc"` (JSON with comments), and `"json5"`.
* `ranges` (default: `false`) - set to `true` if you want each node to also have a `range` property, which is an array containing the start and stop index for the syntax within the source string.
* `tokens` - set to `true` to return a `tokens` property on the root node containing all of the tokens used to parse the code. If `mode` is `"jsonc"` or `"json5"`, then the tokens include comment tokens.
* `allowTrailingCommas` - set to `true` to allow trailing commas in arrays and objects in `"json"` and `"jsonc"` modes. This option is ignored in JSON5 mode.

Here's an example of passing options:

```js
const { parse } = require("@humanwhocodes/momoa");

const ast = parse(some_json_string, {
    mode: "jsonc",
    ranges: true,
    tokens: true
});

// root now has a range array
console.dir(ast.range);

// root now has a tokens array
console.dir(ast.tokens);
```

### Tokenizing 

To produce JSON tokens from a string, use the `tokenize()` function:

```js
const { tokenize } = require("@humanwhocodes/momoa");
const json = "{\"foo\":\"bar\"}";

for (const token of tokenize(json)) {
    console.log("Token type is", token.type);

    const start = token.loc.start.offset;
    const end = token.loc.end.offset;
    console.log("Token value is", json.slice(start, end));
}
```

The `tokenize()` function accepts a second parameter, which is an options object that may contain one or more of the following properties:

* `mode` (default: `"json"`) - specify the parsing mode. Possible options are `"json"`, `"jsonc"` (JSON with comments), and `"json5"`.
* `ranges` (default: `false`) - set to `true` if you want each token to also have a `range` property, which is an array containing the start and stop index for the syntax within the source string.

### Traversing

There are two ways to traverse an AST: iteration and traditional traversal.

#### Iterating

Iteration uses a generator function to create an iterator over the AST:

```js
const { parse, iterator } = require("@humanwhocodes/momoa");

const ast = parse(some_json_string);

for (const { node, parent, phase } of iterator(ast)) {
    console.log(node.type);
    console.log(phase); // "enter" or "exit"
}
```

Each step of the iterator returns an object with three properties:

1. `node` - the node that the traversal is currently visiting
1. `parent` - the parent node of `node`
1. `phase` - a string indicating the phase of traversal (`"enter"` when first visiting the node, `"exit"` when leaving the node)

You can also filter the iterator by passing in a filter function. For instance, if you only want steps to be returned in the `"enter"` phase, you can do this:

```js
const { parse, iterator } = require("@humanwhocodes/momoa");

const ast = parse(some_json_string);

for (const { node } of iterator(ast, ({ phase }) => phase === "enter")) {
    console.log(node.type);
}
```

#### Traversing

Traversing uses a function that accepts an object with `enter` and `exit` properties:

```js
const { parse, traverse } = require("@humanwhocodes/momoa");

const ast = parse(some_json_string);

traverse(ast, {
    enter(node, parent) {
        console.log("Entering", node.type);
    },
    exit(node, parent) {
        console.log("Exiting", node.type);
    }
});
```

## Evaluating

To convert an AST into the JavaScript value it represents, use the `evaluate()` function:

```js
const { parse, evaluate } = require("@humanwhocodes/momoa");

// same as JSON.parse(some_json_string)
const ast = parse(some_json_string);
const value = evaluate(ast);
```

In this example, `value` is the same result you would get from calling `JSON.parse(some_json_string)` (`ast` is the intermediate format representing the syntax).

### Printing

To convert an AST back into a JSON string, use the `print()` function:

```js
const { parse, print } = require("@humanwhocodes/momoa");

const ast = parse(some_json_string);
const text = print(ast);
```

**Note:** The printed AST will not produce the same result as the original JSON text as the AST does not preserve whitespace.

You can modify the output of the `print()` function by passing in an object with an `indent` option specifying the number of spaces to use for indentation. When the `indent` option is passed, the text produced will automatically have newlines insert after each `{`, `}`, `[`, `]`, and `,` characters.

```js
const { parse, print } = require("@humanwhocodes/momoa");

const ast = parse(some_json_string);
const text = print(ast, { indent: 4 });
```

### Visitor Keys

Momoa also exports a map of traversable properties in AST nodes that is helpful if you'd like to traverse an AST manually. This is a map where the keys are the `type` property of each AST node and the values are an array of property names to traverse.

```js
const { visitorKeys } = require("@humanwhocodes/momoa");

console.log(visitorKeys.get("Document")); // "body"
```

## Development

To work on Momoa, you'll need:

* [Git](https://git-scm.com/)
* [Node.js](https://nodejs.org)

Make sure both are installed by visiting the links and following the instructions to install.

Now you're ready to clone the repository:

```bash
git clone https://github.com/humanwhocodes/momoa.git
```

Then, enter the directory and install the dependencies:

```bash
cd momoa/js
npm install
```

After that, you can run the tests via:

```bash
npm test
```

**Note:** Momoa builds itself into a single file for deployment. The `npm test` command automatically rebuilds Momoa into that single file whenever it is run. If you are testing in a different way, then you may need to manually rebuild using the `npm run build` command.

## Acknowledgements

This project takes inspiration (but not code) from a number of other projects:

* [`Esprima`](https://esprima.org) inspired the package interface and AST format.
* [`json-to-ast`](https://github.com/vtrushin/json-to-ast) inspired the AST format.
* [`parseJson.js`](https://gist.github.com/rgrove/5cc64db4b9ae8c946401b230ba9d2451) inspired me by showing writing a parser isn't all that hard.

## License

Apache 2.0

## Frequently Asked Questions

### What does "Momoa" even mean?

Momoa is the last name of American actor [Jason Momoa](https://en.wikipedia.org/wiki/Jason_Momoa). Because "JSON" is pronounced "Jason", I wanted a name that played off of this fact. The most obvious choice would have been something related to [Jason and the Argonauts](https://en.wikipedia.org/wiki/Jason_and_the_Argonauts_(1963_film)), as this movie is referenced in the [JSON specification](https://ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf) directly. However, both "Argo" and "Argonaut" were already used for open source projects. When I did a search for "Jason" online, Jason Momoa was the first result that came up. He always plays badass characters so it seemed to fit.

### Why support comments in JSON?

There are a number of programs that allow C-style comments in JSON files, most notably, configuration files for [Visual Studio Code](https://code.visualstudio.com). As there seems to be a need for this functionality, I decided to add it out-of-the-box.

[npm]: https://npmjs.com/
[yarn]: https://yarnpkg.com/
<{H`x100644 momoa.cjs +rXDkz}&100644 momoa.d.cts oglLoW5ɼ*x:L100644 momoa.d.ts Ԫs`?SFN)100644 momoa.js pyܩ'Gb&B9R100644 typedefs.d.cts \EFnjJ~100644 typedefs.d.ts \EFnjJ~100644 typedefs.ts +f.^Zd
;p#.x   'use strict';

/**
 * @fileoverview Character codes.
 * @author Nicholas C. Zakas
 */

const CHAR_0 = 48;          // 0
const CHAR_1 = 49;          // 1
const CHAR_9 = 57;          // 9
const CHAR_BACKSLASH = 92;  // \
const CHAR_DOLLAR = 36;     // $
const CHAR_DOT = 46;        // .
const CHAR_DOUBLE_QUOTE = 34; // "
const CHAR_LOWER_A = 97;    // a
const CHAR_LOWER_E = 101;         // e
const CHAR_LOWER_F = 102;   // f
const CHAR_LOWER_N = 110;   // n
const CHAR_LOWER_T = 116;   // t
const CHAR_LOWER_U = 117;   // u
const CHAR_LOWER_X = 120;   // x
const CHAR_LOWER_Z = 122;   // z
const CHAR_MINUS = 45;      // -
const CHAR_NEWLINE = 10;    // newline
const CHAR_PLUS = 43;       // +
const CHAR_RETURN = 13;     // return
const CHAR_SINGLE_QUOTE = 39; // '
const CHAR_SLASH = 47;      // /
const CHAR_SPACE = 32;      // space
const CHAR_TAB = 9;         // tab
const CHAR_UNDERSCORE = 95; // _
const CHAR_UPPER_A = 65;    // A
const CHAR_UPPER_E = 69;          // E
const CHAR_UPPER_F = 70;    // F
const CHAR_UPPER_N = 78;    // N
const CHAR_UPPER_X = 88;    // X
const CHAR_UPPER_Z = 90;    // Z
const CHAR_LOWER_B = 98;    // b
const CHAR_LOWER_R = 114;   // r
const CHAR_LOWER_V = 118;   // v
const CHAR_LINE_SEPARATOR = 0x2028;
const CHAR_PARAGRAPH_SEPARATOR = 0x2029;
const CHAR_UPPER_I = 73;    // I
const CHAR_STAR = 42;       // *
const CHAR_VTAB = 11;            // U+000B Vertical tab
const CHAR_FORM_FEED = 12;       // U+000C Form feed
const CHAR_NBSP = 160;           // U+00A0 Non-breaking space
const CHAR_BOM = 65279;          // U+FEFF
const CHAR_NON_BREAKING_SPACE = 160;
const CHAR_EN_QUAD = 8192;
const CHAR_EM_QUAD = 8193;
const CHAR_EN_SPACE = 8194;
const CHAR_EM_SPACE = 8195;
const CHAR_THREE_PER_EM_SPACE = 8196;
const CHAR_FOUR_PER_EM_SPACE = 8197;
const CHAR_SIX_PER_EM_SPACE = 8198;
const CHAR_FIGURE_SPACE = 8199;
const CHAR_PUNCTUATION_SPACE = 8200;
const CHAR_THIN_SPACE = 8201;
const CHAR_HAIR_SPACE = 8202;
const CHAR_NARROW_NO_BREAK_SPACE = 8239;
const CHAR_MEDIUM_MATHEMATICAL_SPACE = 8287;
const CHAR_IDEOGRAPHIC_SPACE = 12288;

/**
 * @fileoverview JSON syntax helpers
 * @author Nicholas C. Zakas
 */


//-----------------------------------------------------------------------------
// Types
//-----------------------------------------------------------------------------

/** @typedef {import("./typedefs.js").TokenType} TokenType */

//-----------------------------------------------------------------------------
// Predefined Tokens
//-----------------------------------------------------------------------------

const LBRACKET = "[";
const RBRACKET = "]";
const LBRACE = "{";
const RBRACE = "}";
const COLON = ":";
const COMMA = ",";

const TRUE = "true";
const FALSE = "false";
const NULL = "null";
const NAN$1 = "NaN";
const INFINITY$1 = "Infinity";
const QUOTE = "\"";

const escapeToChar = new Map([
    [CHAR_DOUBLE_QUOTE, QUOTE],
    [CHAR_BACKSLASH, "\\"],
    [CHAR_SLASH, "/"],
    [CHAR_LOWER_B, "\b"],
    [CHAR_LOWER_N, "\n"],
    [CHAR_LOWER_F, "\f"],
    [CHAR_LOWER_R, "\r"],
    [CHAR_LOWER_T, "\t"]
]);

const json5EscapeToChar = new Map([
    ...escapeToChar,
    [CHAR_LOWER_V, "\v"],
    [CHAR_0, "\0"]
]);

const charToEscape = new Map([
    [QUOTE, QUOTE],
    ["\\", "\\"],
    ["/", "/"],
    ["\b", "b"],
    ["\n", "n"],
    ["\f", "f"],
    ["\r", "r"],
    ["\t", "t"]
]);

const json5CharToEscape = new Map([
    ...charToEscape,
    ["\v", "v"],
    ["\0", "0"],
    ["\u2028", "u2028"],
    ["\u2029", "u2029"]
]);

/** @type {Map<string,TokenType>} */
const knownTokenTypes = new Map([
    [LBRACKET, "LBracket"],
    [RBRACKET, "RBracket"],
    [LBRACE, "LBrace"],
    [RBRACE, "RBrace"],
    [COLON, "Colon"],
    [COMMA, "Comma"],
    [TRUE, "Boolean"],
    [FALSE, "Boolean"],
    [NULL, "Null"]
]);

/** @type {Map<string,TokenType>} */
const knownJSON5TokenTypes = new Map([
    ...knownTokenTypes,
    [NAN$1, "Number"],
    [INFINITY$1, "Number"]
]);

// JSON5
const json5LineTerminators = new Set([
    CHAR_NEWLINE,
    CHAR_RETURN,
    CHAR_LINE_SEPARATOR,
    CHAR_PARAGRAPH_SEPARATOR
]);

/**
 * @fileoverview JSON tokenization/parsing errors
 * @author Nicholas C. Zakas
 */

//-----------------------------------------------------------------------------
// Typedefs
//-----------------------------------------------------------------------------

/** @typedef {import("./typedefs.js").Location} Location */
/** @typedef {import("./typedefs.js").Token} Token */

//-----------------------------------------------------------------------------
// Errors
//-----------------------------------------------------------------------------

/**
 * Base class that attaches location to an error.
 */
class ErrorWithLocation extends Error {

    /**
     * Creates a new instance.
     * @param {string} message The error message to report. 
     * @param {Location} loc The location information for the error.
     */
    constructor(message, { line, column, offset }) {
        super(`${ message } (${ line }:${ column})`);

        /**
         * The line on which the error occurred.
         * @type {number}
         */
        this.line = line;

        /**
         * The column on which the error occurred.
         * @type {number}
         */
        this.column = column;
        
        /**
         * The index into the string where the error occurred.
         * @type {number}
         */
        this.offset = offset;
    }

}

/**
 * Error thrown when an unexpected character is found during tokenizing.
 */
class UnexpectedChar extends ErrorWithLocation {

    /**
     * Creates a new instance.
     * @param {number} unexpected The character that was found.
     * @param {Location} loc The location information for the found character.
     */
    constructor(unexpected, loc) {
        super(`Unexpected character '${ String.fromCharCode(unexpected) }' found.`, loc);
    }
}

/**
 * Error thrown when an unexpected identifier is found during tokenizing.
 */
class UnexpectedIdentifier extends ErrorWithLocation {

    /**
     * Creates a new instance.
     * @param {string} unexpected The character that was found.
     * @param {Location} loc The location information for the found character.
     */
    constructor(unexpected, loc) {
        super(`Unexpected identifier '${ unexpected }' found.`, loc);
    }
}

/**
 * Error thrown when an unexpected token is found during parsing.
 */
class UnexpectedToken extends ErrorWithLocation {

    /**
     * Creates a new instance.
     * @param {Token} token The token that was found. 
     */
    constructor(token) {
        super(`Unexpected token ${ token.type } found.`, token.loc.start);
    }
}

/**
 * Error thrown when the end of input is found where it isn't expected.
 */
class UnexpectedEOF extends ErrorWithLocation {

    /**
     * Creates a new instance.
     * @param {Location} loc The location information for the found character.
     */
    constructor(loc) {
        super("Unexpected end of input found.", loc);
    }
}

/*
 * The following is extracted from https://github.com/json5/json5/
 *
 * MIT License
 * 
 * Copyright (c) 2012-2018 Aseem Kishore, and others.
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

const ID_Start = /[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\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\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2160-\u2188\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-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\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uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
// eslint-disable-next-line no-misleading-character-class
const ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u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F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\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\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-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\uD804[\uDC00-\uDC46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40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E4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/;

/**
 * @fileoverview A charactor code reader.
 * @author Nicholas C. Zakas
 */

//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------

/** @typedef {import("./typedefs.js").Location} Location */

//-----------------------------------------------------------------------------
// Data
//-----------------------------------------------------------------------------

const CHAR_CR = 13; // \r
const CHAR_LF = 10; // \n

//-----------------------------------------------------------------------------
// CharCodeReader
//-----------------------------------------------------------------------------

/**
 * A reader that reads character codes from a string.
 */
class CharCodeReader {

    /**
     * The text to read from.
     * @type {string}
     */
    #text = "";

    /**
     * The current line number.
     * @type {number}
     */
    #line = 1;

    /**
     * The current column number.
     * @type {number}
     */
    #column = 0;

    /**
     * The current offset in the text.
     * @type {number}
     */
    #offset = -1;

    /**
     * Whether the last character read was a new line.
     * @type {boolean}
     */
    #newLine = false;

    /**
     * The last character code read.
     * @type {number}
     */
    #last = -1;

    /**
     * Whether the reader has ended.
     * @type {boolean}
     */
    #ended = false;

    /**
     * Creates a new instance.
     * @param {string} text The text to read from
     */
    constructor(text) {
        this.#text = text;
    }

    /**
     * Ends the reader.
     * @returns {void}
     */
    #end() {
        if (this.#ended) {
            return;
        }

        this.#column++;
        this.#offset++;
        this.#last = -1;
        this.#ended = true;
    }

    /**
     * Returns the current position of the reader.
     * @returns {Location} An object with line, column, and offset properties.
     */
    locate() {
        return {
            line: this.#line,
            column: this.#column,
            offset: this.#offset
        };
    }

    /**
     * Reads the next character code in the text.
     * @returns {number} The next character code, or -1 if there are no more characters.
     */
    next() {
        if (this.#offset >= this.#text.length - 1) {
            this.#end();
            return -1;
        }

        this.#offset++;
        const charCode = this.#text.charCodeAt(this.#offset);

        if (this.#newLine) {
            this.#line++;
            this.#column = 1;
            this.#newLine = false;
        } else {
            this.#column++;
        }

        if (charCode === CHAR_CR) {
            this.#newLine = true;

            // if we already see a \r, just ignore upcoming \n
            if (this.peek() === CHAR_LF) {
                this.#offset++;
            }
        } else if (charCode === CHAR_LF) {
            this.#newLine = true;
        }

        this.#last = charCode;

        return charCode;
    }

    /**
     * Peeks at the next character code in the text.
     * @returns {number} The next character code, or -1 if there are no more characters.
     */
    peek() {
        if (this.#offset === this.#text.length - 1) {
            return -1;
        }

        return this.#text.charCodeAt(this.#offset + 1);
    }

    /**
     * Determines if the next character code in the text matches a specific character code.
     * @param {(number) => boolean} fn A function to call on the next character.
     * @returns {boolean} True if the next character code matches, false if not.
     */ 
    match(fn) {
        if (fn(this.peek())) {
            this.next();
            return true;
        }

        return false;
    }

    /**
     * Returns the last character code read.
     * @returns {number} The last character code read.
     */
    current() {
        return this.#last;
    }


}

/**
 * @fileoverview JSON tokenizer
 * @author Nicholas C. Zakas
 */


//-----------------------------------------------------------------------------
// Typedefs
//-----------------------------------------------------------------------------

/** @typedef {import("./typedefs.js").Location} Location */
/** @typedef {import("./typedefs.js").Range} Range */
/** @typedef {import("./typedefs.js").Token} Token */
/** @typedef {import("./typedefs.js").TokenType} TokenType */
/** @typedef {import("./typedefs.js").TokenizeOptions} TokenizeOptions */

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

const INFINITY = "Infinity";
const NAN = "NaN";

const keywordStarts = new Set([CHAR_LOWER_T, CHAR_LOWER_F, CHAR_LOWER_N]);
const whitespace = new Set([CHAR_SPACE, CHAR_TAB, CHAR_NEWLINE, CHAR_RETURN]);
const json5Whitespace = new Set([
    ...whitespace,
    CHAR_VTAB,
    CHAR_FORM_FEED,
    CHAR_NBSP,
    CHAR_LINE_SEPARATOR,
    CHAR_PARAGRAPH_SEPARATOR,
    CHAR_BOM,
    CHAR_NON_BREAKING_SPACE,
    CHAR_EN_QUAD,
    CHAR_EM_QUAD,
    CHAR_EN_SPACE,
    CHAR_EM_SPACE,
    CHAR_THREE_PER_EM_SPACE,
    CHAR_FOUR_PER_EM_SPACE,
    CHAR_SIX_PER_EM_SPACE,
    CHAR_FIGURE_SPACE,
    CHAR_PUNCTUATION_SPACE,
    CHAR_THIN_SPACE,
    CHAR_HAIR_SPACE,
    CHAR_NARROW_NO_BREAK_SPACE,
    CHAR_MEDIUM_MATHEMATICAL_SPACE,
    CHAR_IDEOGRAPHIC_SPACE,
]);


/** @type {TokenizeOptions} */
const DEFAULT_OPTIONS$1 = {
    mode: "json",
    ranges: false
};

const jsonKeywords = new Set(["true", "false", "null"]);

const tt = {
    EOF: 0,
    Number: 1,
    String: 2,
    Boolean: 3,
    Null: 4,
    NaN: 5,
    Infinity: 6,
    Identifier: 7,
    Colon: 20,
    LBrace: 21,
    RBrace: 22,
    LBracket: 23,
    RBracket: 24,
    Comma: 25,
    LineComment: 40,
    BlockComment: 41
};


// #region Helpers


/**
 * Determines if a given character is a decimal digit.
 * @param {number} c The character to check.
 * @returns {boolean} `true` if the character is a digit.
 */
function isDigit(c) {
    return c >= CHAR_0 && c <= CHAR_9;
}

/**
 * Determines if a given character is a hexadecimal digit.
 * @param {number} c The character to check.
 * @returns {boolean} `true` if the character is a hexadecimal digit.
 */
function isHexDigit(c) {
    return isDigit(c) ||
        c >= CHAR_UPPER_A && c <= CHAR_UPPER_F ||
        c >= CHAR_LOWER_A && c <= CHAR_LOWER_F;
}

/**
 * Determines if a given character is a positive digit (1-9).
 * @param {number} c The character to check.
 * @returns {boolean} `true` if the character is a positive digit.
 */
function isPositiveDigit(c) {
    return c >= CHAR_1 && c <= CHAR_9;
}

/**
 * Determines if a given character is the start of a keyword.
 * @param {number} c The character to check.
 * @returns {boolean} `true` if the character is the start of a keyword.
 */
function isKeywordStart(c) {
    return keywordStarts.has(c);
}

/**
 * Determines if a given character is the start of a number.
 * @param {number} c The character to check.
 * @returns {boolean} `true` if the character is the start of a number.
 */
function isNumberStart(c) {
    return isDigit(c) || c === CHAR_DOT || c === CHAR_MINUS;
}

/**
 * Determines if a given character is the start of a JSON5 number.
 * @param {number} c The character to check.
 * @returns {boolean} `true` if the character is the start of a JSON5 number.
 */
function isJSON5NumberStart(c) {
    return isNumberStart(c) || c === CHAR_PLUS;
}

/**
 * Determines if a given character is the start of a string.
 * @param {number} c The character to check.
 * @param {boolean} json5 `true` if JSON5 mode is enabled.
 * @returns {boolean} `true` if the character is the start of a string.
 */
function isStringStart(c, json5) {
    return c === CHAR_DOUBLE_QUOTE || (json5 && c === CHAR_SINGLE_QUOTE);
}

/**
 * Tests that a given character is a valid first character of a
 * JSON5 identifier
 * @param {number} c The character to check.
 * @returns {boolean} `true` if the character is a valid first character. 
 */
function isJSON5IdentifierStart(c) {

    // test simple cases first

    if (c === CHAR_DOLLAR || c === CHAR_UNDERSCORE || c === CHAR_BACKSLASH) {
        return true;
    }

    if (c >= CHAR_LOWER_A && c <= CHAR_LOWER_Z || c >= CHAR_UPPER_A && c <= CHAR_UPPER_Z) {
        return true;
    }

    if (c === 0x200C || c === 0x200D) {
        return true;
    }
    
    const ct = String.fromCharCode(c);
    return ID_Start.test(ct);
}

/**
 * Tests that a given character is a valid part of a JSON5 identifier.
 * @param {number} c The character to check.
 * @returns {boolean} `true` if the character is a valid part of an identifier.
 */
function isJSON5IdentifierPart(c) {

    // fast path for simple cases
    if (isJSON5IdentifierStart(c) || isDigit(c)) {
        return true;
    }

    const ct = String.fromCharCode(c);
    return ID_Continue.test(ct);
}


// #endregion

class Tokenizer {

    /**
     * Options for the tokenizer.
     * @type {TokenizeOptions}
     */
    #options;

    /**
     * The source text to tokenize.
     * @type {string}
     */
    #text;

    /**
     * The reader for the source text.
     * @type {CharCodeReader}
     */
    #reader;

    /**
     * Indicates if the tokenizer is in JSON5 mode.
     * @type {boolean}
     */
    #json5;

    /**
     * Indicates if comments are allowed.
     * @type {boolean}
     */
    #allowComments;

    /**
     * Indicates if ranges should be included in the tokens.
     * @type {boolean}
     */
    #ranges;

    /**
     * The last token type read.
     * @type {Token}
     */
    #token;

    /**
     * Determines if a character is an escaped character.
     * @type {(c:number) => boolean}
     */
    #isEscapedCharacter;

    /**
     * Determines if a character is a JSON5 line terminator.
     * @type {(c:number) => boolean}
     */
    #isJSON5LineTerminator;


    /**
     * Determines if a character is a JSON5 hex escape.
     * @type {(c:number) => boolean}
     */
    #isJSON5HexEscape;

    /**
     * Determines if a character is whitespace.
     * @type {(c:number) => boolean}
     */
    #isWhitespace;

    /**
     * Creates a new instance of the tokenizer.
     * @param {string} text The source text
     * @param {TokenizeOptions} [options] Options for the tokenizer.
     */ 
    constructor(text, options) {
        this.#text = text;
        this.#options = {
            ...DEFAULT_OPTIONS$1,
            ...options
        };

        this.#reader = new CharCodeReader(text);
        this.#json5 = this.#options.mode === "json5";
        this.#allowComments = this.#options.mode !== "json";
        this.#ranges = this.#options.ranges;

        // TODO: Clean this up
        this.#isEscapedCharacter = this.#json5 ? json5EscapeToChar.has.bind(json5EscapeToChar) : escapeToChar.has.bind(escapeToChar);
        this.#isJSON5LineTerminator = this.#json5 ? json5LineTerminators.has.bind(json5LineTerminators) : () => false;
        this.#isJSON5HexEscape = this.#json5 ? c => c === CHAR_LOWER_X : () => false;
        this.#isWhitespace = this.#json5 ? json5Whitespace.has.bind(json5Whitespace) : whitespace.has.bind(whitespace);
    }

    // #region Errors

    /**
     * Convenience function for throwing unexpected character errors.
     * @param {number} c The unexpected character.
     * @param {Location} [loc] The location of the unexpected character.
     * @returns {never}
     * @throws {UnexpectedChar} always.
     */
    #unexpected(c, loc = this.#reader.locate()) {
        throw new UnexpectedChar(c, loc);
    }

    /**
     * Convenience function for throwing unexpected identifier errors.
     * @param {string} identifier The unexpected identifier.
     * @param {Location} [loc] The location of the unexpected identifier.
     * @returns {never}
     * @throws {UnexpectedIdentifier} always.
     */
    #unexpectedIdentifier(identifier, loc = this.#reader.locate()) {
        throw new UnexpectedIdentifier(identifier, loc);
    }

    /**
    * Convenience function for throwing unexpected EOF errors.
    * @returns {never}
    * @throws {UnexpectedEOF} always.
    */
    #unexpectedEOF() {
        throw new UnexpectedEOF(this.#reader.locate());
    }

    // #endregion

    // #region Helpers

    /**
     * Creates a new token.
     * @param {TokenType} tokenType The type of token to create.
     * @param {number} length The length of the token.
     * @param {Location} startLoc The start location for the token.
     * @param {Location} [endLoc] The end location for the token.
     * @returns {Token} The token.
     */
    #createToken(tokenType, length, startLoc, endLoc) {

        const endOffset = startLoc.offset + length;

        let range = this.#options.ranges ? {
            range: /** @type {Range} */ ([startLoc.offset, endOffset])
        } : undefined;

        return {
            type: tokenType,
            loc: {
                start: startLoc,
                end: endLoc || {
                    line: startLoc.line,
                    column: startLoc.column + length,
                    offset: endOffset
                }
            },
            ...range
        };        
    }

    /**
     * Reads in a specific number of hex digits.
     * @param {number} count The number of hex digits to read.
     * @returns {string} The hex digits read.
     */
    #readHexDigits(count) {
        let value = "";
        let c;

        for (let i = 0; i < count; i++) {
            c = this.#reader.peek();
            if (isHexDigit(c)) {
                this.#reader.next();
                value += String.fromCharCode(c);
                continue;
            }

            this.#unexpected(c);
        }

        return value;
    }

    /**
     * Reads in a JSON5 identifier. Also used for JSON but we validate
     * the identifier later.
     * @param {number} c The first character of the identifier.
     * @returns {string} The identifier read.
     * @throws {UnexpectedChar} when the identifier cannot be read.
     */
    #readIdentifier(c) {
        let value = "";

        do {

            value += String.fromCharCode(c);

            if (c === CHAR_BACKSLASH) {

                c = this.#reader.next();

                if (c !== CHAR_LOWER_U) {
                    this.#unexpected(c);
                }

                value += String.fromCharCode(c);

                const hexDigits = this.#readHexDigits(4);

                // check for a valid character code
                const charCode = parseInt(hexDigits, 16);

                if (value.length === 2 && !isJSON5IdentifierStart(charCode)) {
                    const loc = this.#reader.locate();
                    this.#unexpected(CHAR_BACKSLASH, { line: loc.line, column: loc.column - 5, offset: loc.offset - 5 });
                } else if (!isJSON5IdentifierPart(charCode)) {
                    const loc = this.#reader.locate();
                    this.#unexpected(charCode, { line: loc.line, column: loc.column - 5, offset: loc.offset - 5 });
                }

                value += hexDigits;
            }

            c = this.#reader.peek();

            if (!isJSON5IdentifierPart(c)) {
                break;
            }

            this.#reader.next();

        } while (true);  // eslint-disable-line no-constant-condition

        return value;
    }

    /**
     * Reads in a string. Works for both JSON and JSON5.
     * @param {number} c The first character of the string (either " or ').
     * @returns {number} The length of the string.
     * @throws {UnexpectedChar} when the string cannot be read.
     * @throws {UnexpectedEOF} when EOF is reached before the string is finalized.
     */
    #readString(c) {
        
        const delimiter = c;
        let length = 1;
        c = this.#reader.peek();

        while (c !== -1 && c !== delimiter) {

            this.#reader.next();
            length++;

            // escapes
            if (c === CHAR_BACKSLASH) {
                c = this.#reader.peek();

                if (this.#isEscapedCharacter(c) || this.#isJSON5LineTerminator(c)) {
                    this.#reader.next();
                    length++;
                } else if (c === CHAR_LOWER_U) {
                    this.#reader.next();
                    length++;

                    const result = this.#readHexDigits(4);
                    length += result.length;
                } else if (this.#isJSON5HexEscape(c)) {
                    this.#reader.next();
                    length++;

                    // hex escapes: \xHH
                    const result = this.#readHexDigits(2);
                    length += result.length;
                } else if (this.#json5) {  // JSON doesn't allow anything else
                    this.#reader.next();
                    length++;
                } else {
                    this.#unexpected(c);
                }
            }

            c = this.#reader.peek();
        }

        if (c === -1) {
            this.#reader.next();
            this.#unexpectedEOF();
        }

        // c is the delimiter
        this.#reader.next();
        length++;

        return length;
    
    
    }

    /**
     * Reads a number. Works for both JSON and JSON5.
     * @param {number} c The first character of the number.
     * @returns {number} The length of the number.
     * @throws {UnexpectedChar} when the number cannot be read.
     * @throws {UnexpectedEOF} when EOF is reached before the number is finalized.
     */
    #readNumber(c) {
        
        // we've already read the first character
        let length = 1;

        // JSON number may start with a minus but not a plus
        // JSON5 allows a plus.
        if (c === CHAR_MINUS || this.#json5 && c === CHAR_PLUS) {
            
            c = this.#reader.peek();
            
            /*
            * JSON5 allows Infinity or NaN preceded by a sign.
            * This blocks handles +Infinity, -Infinity, +NaN, and -NaN.
            * Standalone Infinity and NaN are handled in `readJSON5Identifier()`
            */
            if (this.#json5) {

                if (c === CHAR_UPPER_I || c === CHAR_UPPER_N) {
                    this.#reader.next();
                    const identifier = this.#readIdentifier(c);

                    if (identifier !== INFINITY && identifier !== NAN) {
                        this.#unexpected(c);
                    }

                    return length + identifier.length;
                }
            }

            // Next digit cannot be zero
            if (!isDigit(c)) {
                this.#unexpected(c);
            }

            // if we made it here, we need to continue on, so register the character
            this.#reader.next();
            length++;
        }

        /*
        * In JSON, a zero must be followed by a decimal point or nothing.
        * In JSON5, a zero can additionally be followed by an `x` indicating
        * that it's a hexadecimal number.
        */
        if (c === CHAR_0) {

            // c = this.#reader.next();
            // length++;
            c = this.#reader.peek();

            // check for a hex number
            if (this.#json5 && (c === CHAR_LOWER_X || c === CHAR_UPPER_X)) {

                this.#reader.next();
                length++;

                c = this.#reader.peek();

                if (!isHexDigit(c)) {
                    this.#reader.next();
                    this.#unexpected(c);
                }

                do {
                    this.#reader.next();
                    length++;
                    c = this.#reader.peek();
                } while (isHexDigit(c));

            } else if (isDigit(c)) {
                this.#unexpected(c);
            }

        } else {

            // JSON5 allows leading decimal points
            if (!this.#json5 || c !== CHAR_DOT) {
                if (!isPositiveDigit(c)) {
                    this.#unexpected(c);
                }

                c = this.#reader.peek();

                while (isDigit(c)) {
                    this.#reader.next();
                    length++;
                    c = this.#reader.peek();
                }
            }
        }

        /*
        * In JSON, a decimal point must be followed by at least one digit.
        * In JSON5, a decimal point need not be followed by any digits.
        */
        if (c === CHAR_DOT) {
                                
            let digitCount = -1;
            this.#reader.next();
            length++;
            digitCount++;

            c = this.#reader.peek();

            while (isDigit(c)) {
                this.#reader.next();
                length++;
                digitCount++;
                c = this.#reader.peek();
            }

            if (!this.#json5 && digitCount === 0) {
                this.#reader.next();
                if (c) {
                    this.#unexpected(c);
                } else {
                    this.#unexpectedEOF();
                }
            }
        }

        // Exponent is always last
        if (c === CHAR_LOWER_E || c === CHAR_UPPER_E) {

            this.#reader.next();
            length++;
            c = this.#reader.peek();

            if (c === CHAR_PLUS || c === CHAR_MINUS) {
                this.#reader.next();
                length++;
                c = this.#reader.peek();
            }

            /*
            * Must always have a digit in this position to avoid:
            * 5e
            * 12E+
            * 42e-
            */
            if (c === -1) {
                this.#reader.next();
                this.#unexpectedEOF();
            }

            if (!isDigit(c)) {
                this.#reader.next();
                this.#unexpected(c);
            }

            while (isDigit(c)) {
                this.#reader.next();
                length++;
                c = this.#reader.peek();
            }
        }

        return length;
    }

    /**
     * Reads a comment. Works for both JSON and JSON5.
     * @param {number} c The first character of the comment.
     * @returns {{length: number, multiline: boolean}} The length of the comment, and whether the comment is multi-line.
     * @throws {UnexpectedChar} when the comment cannot be read.
     * @throws {UnexpectedEOF} when EOF is reached before the comment is finalized.
     */ 
    #readComment(c) {
        
        let length = 1;

        // next character determines single- or multi-line
        c = this.#reader.peek();

        // single-line comments
        if (c === CHAR_SLASH) {
            
            do {
                this.#reader.next();
                length += 1;
                c = this.#reader.peek();
            } while (c > -1 && c !== CHAR_RETURN && c !== CHAR_NEWLINE);

            return { length, multiline: false };
        }

        // multi-line comments
        if (c === CHAR_STAR) {

            this.#reader.next();
            length += 1;

            while (c > -1) {
                c = this.#reader.peek();

                // check for end of comment
                if (c === CHAR_STAR) {
                    this.#reader.next();
                    length += 1;
                    c = this.#reader.peek();
                    
                    //end of comment
                    if (c === CHAR_SLASH) {
                        this.#reader.next();
                        length += 1;

                        return { length, multiline: true };
                    }
                } else {
                    this.#reader.next();
                    length += 1;
                }
            }

            this.#reader.next();
            this.#unexpectedEOF();
            
        }

        // if we've made it here, there's an invalid character
        this.#reader.next();
        this.#unexpected(c);        
    }
    // #endregion

    /**
     * Returns the next token in the source text.
     * @returns {number} The code for the next token.
     */
    next() {

        let c = this.#reader.next();

        while (this.#isWhitespace(c)) {
            c = this.#reader.next();
        }

        if (c === -1) {
            return tt.EOF;
        }

        const start = this.#reader.locate();
        const ct = String.fromCharCode(c);

        // check for JSON5 syntax only
        if (this.#json5) {
                
            if (knownJSON5TokenTypes.has(ct)) {
                this.#token = this.#createToken(knownJSON5TokenTypes.get(ct), 1, start);
            } else if (isJSON5IdentifierStart(c)) {
                const value = this.#readIdentifier(c);

                if (knownJSON5TokenTypes.has(value)) {
                    this.#token = this.#createToken(knownJSON5TokenTypes.get(value), value.length, start);
                } else {
                    this.#token = this.#createToken("Identifier", value.length, start);
                }
            } else if (isJSON5NumberStart(c)) {
                const result = this.#readNumber(c);
                this.#token = this.#createToken("Number", result, start);
            } else if (isStringStart(c, this.#json5)) {
                const result = this.#readString(c);
                const lastCharLoc = this.#reader.locate();
                this.#token = this.#createToken("String", result, start, {
                    line: lastCharLoc.line,
                    column: lastCharLoc.column + 1,
                    offset: lastCharLoc.offset + 1
                });
            } else if (c === CHAR_SLASH && this.#allowComments) {
                const result = this.#readComment(c);
                const lastCharLoc = this.#reader.locate();
                this.#token = this.#createToken(!result.multiline ? "LineComment" : "BlockComment", result.length, start, {
                    line: lastCharLoc.line,
                    column: lastCharLoc.column + 1,
                    offset: lastCharLoc.offset + 1
                });
            } else {
                this.#unexpected(c);
            }

        } else {

            // check for JSON/JSONC syntax only
            if (knownTokenTypes.has(ct)) {
                this.#token = this.#createToken(knownTokenTypes.get(ct), 1, start);
            } else if (isKeywordStart(c)) {
                const value = this.#readIdentifier(c);

                if (!jsonKeywords.has(value)) {
                    this.#unexpectedIdentifier(value, start);
                }

                this.#token = this.#createToken(knownTokenTypes.get(value), value.length, start);
            } else if (isNumberStart(c)) {
                const result = this.#readNumber(c);
                this.#token = this.#createToken("Number", result, start);
            } else if (isStringStart(c, this.#json5)) {
                const result = this.#readString(c);
                this.#token = this.#createToken("String", result, start);
            } else if (c === CHAR_SLASH && this.#allowComments) {
                const result = this.#readComment(c);
                const lastCharLoc = this.#reader.locate();
                this.#token = this.#createToken(!result.multiline ? "LineComment" : "BlockComment", result.length, start, {
                    line: lastCharLoc.line,
                    column: lastCharLoc.column + 1,
                    offset: lastCharLoc.offset + 1
                });
            } else {
                this.#unexpected(c);
            }
        }
        return tt[this.#token.type];
    }

    /**
     * Returns the current token in the source text.
     * @returns {Token} The current token.
     */
    get token() {
        return this.#token;
    }
}

//-----------------------------------------------------------------------------
// Main
//-----------------------------------------------------------------------------

/**
 * Creates an iterator over the tokens representing the source text.
 * @param {string} text The source text to tokenize.
 * @param {TokenizeOptions} [options] Options for doing the tokenization.
 * @returns {Array<Token>} An iterator over the tokens. 
 */
function tokenize(text, options) {

    const tokenizer = new Tokenizer(text, options);
    const tokens = [];

    while (tokenizer.next() !== tt.EOF) {
        tokens.push(tokenizer.token);
    }

    return tokens;

}

/**
 * @fileoverview  JSON AST types
 * @author Nicholas C. Zakas
 */

//-----------------------------------------------------------------------------
// Typedefs
//-----------------------------------------------------------------------------

/** @typedef {import("./typedefs.js").Location} Location */
/** @typedef {import("./typedefs.js").LocationRange} LocationRange */
/** @typedef {import("./typedefs.js").NodeParts} NodeParts */
/** @typedef {import("./typedefs.js").DocumentNode} DocumentNode */
/** @typedef {import("./typedefs.js").StringNode} StringNode */
/** @typedef {import("./typedefs.js").NumberNode} NumberNode */
/** @typedef {import("./typedefs.js").BooleanNode} BooleanNode */
/** @typedef {import("./typedefs.js").MemberNode} MemberNode */
/** @typedef {import("./typedefs.js").ObjectNode} ObjectNode */
/** @typedef {import("./typedefs.js").ElementNode} ElementNode */
/** @typedef {import("./typedefs.js").ArrayNode} ArrayNode */
/** @typedef {import("./typedefs.js").NullNode} NullNode */
/** @typedef {import("./typedefs.js").ValueNode} ValueNode */
/** @typedef {import("./typedefs.js").IdentifierNode} IdentifierNode */
/** @typedef {import("./typedefs.js").NaNNode} NaNNode */
/** @typedef {import("./typedefs.js").InfinityNode} InfinityNode */
/** @typedef {import("./typedefs.js").Sign} Sign */

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

const types = {

    /**
     * Creates a document node.
     * @param {ValueNode} body The body of the document.
     * @param {NodeParts} parts Additional properties for the node. 
     * @returns {DocumentNode} The document node.
     */
    document(body, parts = {}) {
        return {
            type: "Document",
            body,
            loc: parts.loc,
            ...parts
        };
    },

    /**
     * Creates a string node.
     * @param {string} value The value for the string.
     * @param {NodeParts} parts Additional properties for the node. 
     * @returns {StringNode} The string node.
     */
    string(value, parts = {}) {
        return {
            type: "String",
            value,
            loc: parts.loc,
            ...parts
        };
    },

    /**
     * Creates a number node.
     * @param {number} value The value for the number.
     * @param {NodeParts} parts Additional properties for the node. 
     * @returns {NumberNode} The number node.
     */
    number(value, parts = {}) {
        return {
            type: "Number",
            value,
            loc: parts.loc,
            ...parts
        };
    },

    /**
     * Creates a boolean node.
     * @param {boolean} value The value for the boolean.
     * @param {NodeParts} parts Additional properties for the node. 
     * @returns {BooleanNode} The boolean node.
     */
    boolean(value, parts = {}) {
        return {
            type: "Boolean",
            value,
            loc: parts.loc,
            ...parts
        };
    },

    /**
     * Creates a null node.
     * @param {NodeParts} parts Additional properties for the node. 
     * @returns {NullNode} The null node.
     */
    null(parts = {}) {
        return {
            type: "Null",
            loc: parts.loc,
            ...parts
        };
    },

    /**
     * Creates an array node.
     * @param {Array<ElementNode>} elements The elements to add.
     * @param {NodeParts} parts Additional properties for the node. 
     * @returns {ArrayNode} The array node.
     */
    array(elements, parts = {}) {
        return {
            type: "Array",
            elements,
            loc: parts.loc,
            ...parts
        };
    },

    /**
     * Creates an element node.
     * @param {ValueNode} value The value for the element.
     * @param {NodeParts} parts Additional properties for the node. 
     * @returns {ElementNode} The element node.
     */
    element(value, parts = {}) {
        return {
            type: "Element",
            value,
            loc: parts.loc,
            ...parts
        };
    },

    /**
     * Creates an object node.
     * @param {Array<MemberNode>} members The members to add.
     * @param {NodeParts} parts Additional properties for the node. 
     * @returns {ObjectNode} The object node.
     */
    object(members, parts = {}) {
        return {
            type: "Object",
            members,
            loc: parts.loc,
            ...parts
        };
    },

    /**
     * Creates a member node.
     * @param {StringNode|IdentifierNode} name The name for the member.
     * @param {ValueNode} value The value for the member.
     * @param {NodeParts} parts Additional properties for the node. 
     * @returns {MemberNode} The member node.
     */
    member(name, value, parts = {}) {
        return {
            type: "Member",
            name,
            value,
            loc: parts.loc,
            ...parts
        };
    },

    /**
     * Creates an identifier node.
     * @param {string} name The name for the identifier.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {IdentifierNode} The identifier node.
     */
    identifier(name, parts = {}) {
        return {
            type: "Identifier",
            name,
            loc: parts.loc,
            ...parts
        };
    },

    /**
     * Creates a NaN node.
     * @param {Sign} sign The sign for the Infinity.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {NaNNode} The NaN node.
     */ 
    nan(sign = "", parts = {}) {
        return {
            type: "NaN",
            sign,
            loc: parts.loc,
            ...parts
        };
    },

    /**
     * Creates an Infinity node.
     * @param {Sign} sign The sign for the Infinity.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {InfinityNode} The Infinity node.
     */
    infinity(sign = "", parts = {}) {
        return {
            type: "Infinity",
            sign,
            loc: parts.loc,
            ...parts
        };
    },

};

/**
 * @fileoverview JSON parser
 * @author Nicholas C. Zakas
 */


//-----------------------------------------------------------------------------
// Typedefs
//-----------------------------------------------------------------------------

/** @typedef {import("./typedefs.js").Location} Location */
/** @typedef {import("./typedefs.js").Token} Token */
/** @typedef {import("./typedefs.js").TokenType} TokenType */
/** @typedef {import("./typedefs.js").Node} Node */
/** @typedef {import("./typedefs.js").Mode} Mode */
/** @typedef {import("./typedefs.js").ParseOptions} ParseOptions */
/** @typedef {import("./typedefs.js").DocumentNode} DocumentNode */
/** @typedef {import("./typedefs.js").StringNode} StringNode */
/** @typedef {import("./typedefs.js").NumberNode} NumberNode */
/** @typedef {import("./typedefs.js").BooleanNode} BooleanNode */
/** @typedef {import("./typedefs.js").MemberNode} MemberNode */
/** @typedef {import("./typedefs.js").ObjectNode} ObjectNode */
/** @typedef {import("./typedefs.js").ElementNode} ElementNode */
/** @typedef {import("./typedefs.js").ArrayNode} ArrayNode */
/** @typedef {import("./typedefs.js").NullNode} NullNode */
/** @typedef {import("./typedefs.js").IdentifierNode} IdentifierNode */
/** @typedef {import("./typedefs.js").NaNNode} NaNNode */
/** @typedef {import("./typedefs.js").InfinityNode} InfinityNode */
/** @typedef {import("./typedefs.js").Sign} Sign */
/** @typedef {import("./typedefs.js").ValueNode} ValueNode */

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

/** @type {ParseOptions} */
const DEFAULT_OPTIONS = {
    mode: "json",
    ranges: false,
    tokens: false,
    allowTrailingCommas: false
};

const UNICODE_SEQUENCE = /\\u[\da-fA-F]{4}/gu;

/**
 * Normalizes a JSON5 identifier by converting Unicode escape sequences into
 * their corresponding characters.
 * @param {string} identifier The identifier to normalize.
 * @returns {string} The normalized identifier.
 */
function normalizeIdentifier(identifier) {
    return identifier.replace(UNICODE_SEQUENCE, unicodeEscape => {
        return String.fromCharCode(parseInt(unicodeEscape.slice(2), 16));
    });
}

/**
 * Calculates the location at the end of the given text.
 * @param {string} text The text to calculate the end location for.
 * @returns {Location} The location at the end of the text.
 */
function getEndLocation(text) {
    let line = 1;
    let column = 1;
    
    for (let i = 0; i < text.length; i++) {
        const char = text[i];
        if (char === "\n") {
            line++;
            column = 1;
        } else if (char === "\r") {
            // Handle \r\n as a single line ending
            if (text[i + 1] === "\n") {
                i++; // Skip the \n
            }
            line++;
            column = 1;
        } else {
            column++;
        }
    }
    
    return {
        line,
        column,
        offset: text.length
    };
}

/**
 * Converts a JSON-encoded string into a JavaScript string, interpreting each
 * escape sequence.
 * @param {string} value The text for the token.
 * @param {Token} token The string token to convert into a JavaScript string.
 * @param {boolean} json5 `true` if parsing JSON5, `false` otherwise.
 * @returns {string} A JavaScript string.
 */
function getStringValue(value, token, json5 = false) {
    
    let result = "";
    let escapeIndex = value.indexOf("\\");
    let lastIndex = 0;

    // While there are escapes, interpret them to build up the result
    while (escapeIndex >= 0) {

        // append the text that happened before the escape
        result += value.slice(lastIndex, escapeIndex);

        // get the character immediately after the \
        const escapeChar = value.charAt(escapeIndex + 1);
        const escapeCharCode = escapeChar.charCodeAt(0);
        
        // check for the non-Unicode escape sequences first
        if (json5 && json5EscapeToChar.has(escapeCharCode)) {
            result += json5EscapeToChar.get(escapeCharCode);
            lastIndex = escapeIndex + 2;
        } else if (escapeToChar.has(escapeCharCode)) {
            result += escapeToChar.get(escapeCharCode);
            lastIndex = escapeIndex + 2;
        } else if (escapeChar === "u") {
            const hexCode = value.slice(escapeIndex + 2, escapeIndex + 6);
            if (hexCode.length < 4 || /[^0-9a-f]/i.test(hexCode)) {
                throw new ErrorWithLocation(
                    `Invalid unicode escape \\u${ hexCode}.`,
                    {
                        line: token.loc.start.line,
                        column: token.loc.start.column + escapeIndex,
                        offset: token.loc.start.offset + escapeIndex
                    }
                );
            }

            result += String.fromCharCode(parseInt(hexCode, 16));
            lastIndex = escapeIndex + 6;
        } else if (json5 && escapeChar === "x") {
            const hexCode = value.slice(escapeIndex + 2, escapeIndex + 4);
            if (hexCode.length < 2 || /[^0-9a-f]/i.test(hexCode)) {
                throw new ErrorWithLocation(
                    `Invalid hex escape \\x${ hexCode}.`,
                    {
                        line: token.loc.start.line,
                        column: token.loc.start.column + escapeIndex,
                        offset: token.loc.start.offset + escapeIndex
                    }
                );
            }

            result += String.fromCharCode(parseInt(hexCode, 16));
            lastIndex = escapeIndex + 4;
        } else if (json5 && json5LineTerminators.has(escapeCharCode)) {
            lastIndex = escapeIndex + 2;

            // we also need to skip \n after a \r
            if (escapeChar === "\r" && value.charAt(lastIndex) === "\n") {
                lastIndex++;
            }
            
        } else {
            // all characters can be escaped in JSON5
            if (json5) {
                result += escapeChar;
                lastIndex = escapeIndex + 2;
            } else {
                throw new ErrorWithLocation(
                    `Invalid escape \\${ escapeChar }.`,
                    {
                        line: token.loc.start.line,
                        column: token.loc.start.column + escapeIndex,
                        offset: token.loc.start.offset + escapeIndex
                    }
                );
            }
        }

        // find the next escape sequence
        escapeIndex = value.indexOf("\\", lastIndex);
    }

    // get the last segment of the string value
    result += value.slice(lastIndex);

    return result;
}

/**
 * Gets the JavaScript value represented by a JSON token.
 * @param {string} value The text value of the token.
 * @param {Token} token The JSON token to get a value for.
 * @param {boolean} jsonsm5 `true` if parsing JSON5, `false` otherwise.
 * @returns {string|boolean|number} A number, string, or boolean.
 * @throws {TypeError} If an unknown token type is found. 
 */
function getLiteralValue(value, token, json5 = false) {
    switch (token.type) {
        case "Boolean":
            return value === "true";
            
        case "Number":
            if (json5) {

                /*
                 * Numbers like -0x1 are converted to NaN by Number(), so we need
                 * to handle them separately. Rather than checking for -0x, we can
                 * just check if the first character is a minus sign. The same for
                 * checking for +0x.
                 */

                if (value.charCodeAt(0) === 45) { // 45 is the char code for '-'
                    return -Number(value.slice(1));
                }

                if (value.charCodeAt(0) === 43) { // 43 is the char code for '+'
                    return Number(value.slice(1));
                }
            }
            return Number(value);

        case "String":
            return getStringValue(value.slice(1, -1), token, json5);

        default:
            throw new TypeError(`Unknown token type "${token.type}.`);
    }
}

//-----------------------------------------------------------------------------
// Main Function
//-----------------------------------------------------------------------------

/**
 * 
 * @param {string} text The text to parse.
 * @param {ParseOptions} [options] The options object.
 * @returns {DocumentNode} The AST representing the parsed JSON.
 * @throws {Error} When there is a parsing error. 
 */
function parse(text, options) {

    options = Object.freeze({
        ...DEFAULT_OPTIONS,
        ...options
    });

    const tokens = [];
    const tokenizer = new Tokenizer(text, {
        mode: options.mode,
        ranges: options.ranges
    });

    const json5 = options.mode === "json5";
    const allowTrailingCommas = options.allowTrailingCommas || json5;

    /**
     * Returns the next token knowing there are no comments.
     * @returns {number} The next token type or 0 if no next token.
     */
    function nextNoComments() {
        const nextType = tokenizer.next();

        if (nextType && options.tokens) {
            tokens.push(tokenizer.token);
        }
        return nextType;
    }
    
    /**
     * Returns the next token knowing there are comments to skip.
     * @returns {number} The next token type or 0 if no next token.
     */
    function nextSkipComments() {
        const nextType = tokenizer.next();
        if (nextType && options.tokens) {
            tokens.push(tokenizer.token);
        }

        if (nextType >= tt.LineComment) {
            return nextSkipComments();
        }

        return nextType;

    }

    // determine correct way to evaluate tokens based on presence of comments
    const next = options.mode === "json" ? nextNoComments : nextSkipComments;

    /**
     * Asserts a token has the given type.
     * @param {number} token The token to check.
     * @param {number} type The token type.
     * @throws {UnexpectedToken} If the token type isn't expected.
     * @returns {void}
     */
    function assertTokenType(token, type) {
        if (token !== type) {
            throw new UnexpectedToken(tokenizer.token);
        }
    }

    /**
     * Asserts a token has one of the given types.
     * @param {number} token The token to check.
     * @param {number[]} types The token types.
     * @returns {void}
     * @throws {UnexpectedToken} If the token type isn't expected.
     */ 
    function assertTokenTypes(token, types) {
        if (!types.includes(token)) {
            throw new UnexpectedToken(tokenizer.token);
        }
    }

    /**
     * Creates a range only if ranges are specified.
     * @param {Location} start The start offset for the range.
     * @param {Location} end The end offset for the range.
     * @returns {{range:[number,number]}|undefined} An object with a 
     */
    function createRange(start, end) {
        // @ts-ignore tsc incorrect - options might be undefined
        return options.ranges ? {
            range: [start.offset, end.offset]
        } : undefined;
    }

    /**
     * Creates a node for a string, boolean, or number.
     * @param {number} tokenType The token representing the literal. 
     * @returns {StringNode|NumberNode|BooleanNode} The node representing
     *      the value.
     */
    function createLiteralNode(tokenType) {
        const token = tokenizer.token;
        const range = createRange(token.loc.start, token.loc.end);
        const value = getLiteralValue(
            text.slice(token.loc.start.offset, token.loc.end.offset),
            token,
            json5
        );
        const loc = {
            start: {
                ...token.loc.start
            },
            end: {
                ...token.loc.end
            }
        };
        const parts = { loc, ...range };

        switch (tokenType) {
            case tt.String:
                return types.string(/** @type {string} */ (value), parts);

            case tt.Number:
                return types.number(/** @type {number} */ (value), parts);
                
            case tt.Boolean:
                return types.boolean(/** @type {boolean} */ (value), parts);

            default:
                throw new TypeError(`Unknown token type ${token.type}.`);
        }
    }

    /**
     * Creates a node for a JSON5 identifier.
     * @param {Token} token The token representing the identifer. 
     * @returns {NaNNode|InfinityNode|IdentifierNode} The node representing
     *      the value.
     */
    function createJSON5IdentifierNode(token) {
        const range = createRange(token.loc.start, token.loc.end);
        const identifier = text.slice(token.loc.start.offset, token.loc.end.offset);
        const loc = {
            start: {
                ...token.loc.start
            },
            end: {
                ...token.loc.end
            }
        };
        const parts = { loc, ...range };

        // Check for NaN or Infinity
        if (token.type !== "Identifier") {

            let sign = "";

            // check if the first character in the token is a plus or minus
            if (identifier[0] === "+" || identifier[0] === "-") {
                sign = identifier[0];
            }

            // check if the token is NaN or Infinity
            return types[identifier.includes("NaN") ? "nan" : "infinity"](/** @type {Sign} */ (sign), parts);
        }
        return types.identifier(normalizeIdentifier(identifier), parts);
    }

    /**
     * Creates a node for a null.
     * @param {Token} token The token representing null. 
     * @returns {NullNode} The node representing null.
     */
    function createNullNode(token) {
        const range = createRange(token.loc.start, token.loc.end);

        return types.null({
            loc: {
                start: {
                    ...token.loc.start
                },
                end: {
                    ...token.loc.end
                }
            },
            ...range
        });
    }


    /**
     * Parses a property in an object.
     * @param {number} tokenType The token representing the property.
     * @returns {MemberNode} The node representing the property.
     * @throws {UnexpectedToken} When an unexpected token is found.
     * @throws {UnexpectedEOF} When the end of the file is reached.
     */
    function parseProperty(tokenType) {

        if (json5) {
            assertTokenTypes(tokenType, [tt.String, tt.Identifier, tt.Number]);
        } else {
            assertTokenType(tokenType, tt.String);
        }

        const token = tokenizer.token;

        // check for -NaN, +NaN, -Infinity, +Infinity, and any number
        if (json5 && tokenType === tt.Number && /[+\-0-9]/.test(text[token.loc.start.offset])) {
            throw new UnexpectedToken(token);
        }

        // TODO: Clean this up a bit
        let key = tokenType === tt.String
            ? /** @type {StringNode} */ (createLiteralNode(tokenType))
            : /** @type {IdentifierNode|NaNNode|InfinityNode} */ (createJSON5IdentifierNode(token));

        // in JSON5, need to check for NaN and Infinity and create identifier nodes
        if (json5 && (key.type === "NaN" || key.type === "Infinity")) {

            // NaN and Infinity cannot be signed and be a property key
            if (key.sign !== "") {
                throw new UnexpectedToken(tokenizer.token);
            }

            key = types.identifier(key.type, { loc: key.loc, ...createRange(key.loc.start, key.loc.end) });
        }

        tokenType = next();
        assertTokenType(tokenType, tt.Colon);
        const value = parseValue();
        const range = createRange(key.loc.start, value.loc.end);

        return types.member(
            /** @type {StringNode|IdentifierNode} */ (key),
            /** @type {ValueNode} */ (value),
            {
                loc: {
                    start: {
                        ...key.loc.start
                    },
                    end: {
                        ...value.loc.end
                    }
                },
                ...range
            }
        );
    }

    /**
     * Parses an object literal.
     * @param {number} firstTokenType The first token type in the object.
     * @returns {ObjectNode} The object node.
     * @throws {UnexpectedEOF} When the end of the file is reached.
     * @throws {UnexpectedToken} When an unexpected token is found.
     */
    function parseObject(firstTokenType) {

        // The first token must be a { or else it's an error
        assertTokenType(firstTokenType, tt.LBrace);

        const firstToken = tokenizer.token;
        const members = [];
        let tokenType = next();

        if (tokenType !== tt.RBrace) {
            do {
    
                // add the value into the array
                members.push(parseProperty(tokenType));
    
                tokenType = next();

                if (!tokenType) {
                    throw new UnexpectedEOF(members[members.length-1].loc.end);
                }
    
                if (tokenType === tt.Comma) {
                    tokenType = next();

                    /*
                      * Trailing commas.
                      * So we need to check if the token is a comma,
                      * and if so, then we need to check if the next
                      * token is a RBrace. If it is, then we need to
                      * break out of the loop.
                      */
                    if (allowTrailingCommas && tokenType === tt.RBrace) {
                        break;
                    }                      
                } else {
                    break;
                }
            } while (tokenType);
        }

        assertTokenType(tokenType, tt.RBrace);
        const lastToken = tokenizer.token;
        const range = createRange(firstToken.loc.start, lastToken.loc.end);

        return types.object(members, {
            loc: {
                start: {
                    ...firstToken.loc.start
                },
                end: {
                    ...lastToken.loc.end
                }
            },
            ...range
        });

    }

    /**
     * Parses an array literal.
     * @param {number} firstTokenType The first token in the array.
     * @returns {ArrayNode} The array node.
     * @throws {UnexpectedToken} When an unexpected token is found.
     * @throws {UnexpectedEOF} When the end of the file is reached.
     */
    function parseArray(firstTokenType) {

        // The first token must be a [ or else it's an error
        assertTokenType(firstTokenType, tt.LBracket);

        const firstToken = tokenizer.token;
        const elements = [];
        let tokenType = next();
        
        if (tokenType !== tt.RBracket) {

            do {

                // add the value into the array
                const value = parseValue(tokenType);

                elements.push(types.element(
                    /** @type {ValueNode} */ (value),
                    { loc: value.loc }
                ));

                tokenType = next();
              
                if (tokenType === tt.Comma) {
                    tokenType = next();

                    /*
                      * Trailing commas.
                      * So we need to check if the token is a comma,
                      * and if so, then we need to check if the next
                      * token is a RBracket. If it is, then we need to
                      * break out of the loop.
                      */
                    if (allowTrailingCommas && tokenType === tt.RBracket) {
                        break;
                    }                    
                } else {
                    break;
                }
            } while (tokenType);
        }

        assertTokenType(tokenType, tt.RBracket);

        const lastToken = tokenizer.token;
        const range = createRange(firstToken.loc.start, lastToken.loc.end);

        return types.array(elements, {
            loc: {
                start: {
                    ...firstToken.loc.start
                },
                end: {
                    ...lastToken.loc.end
                }
            },
            ...range
        });

    }

    /**
     * Parses a JSON value.
     * @param {number} [tokenType] The token type to parse.
     * @returns {ValueNode|IdentifierNode} The node representing the value.
     */
    function parseValue(tokenType) {

        tokenType = tokenType ?? next();
        const token = tokenizer.token;
        
        switch (tokenType) {
            case tt.String:
            case tt.Boolean:
                return createLiteralNode(tokenType);

            case tt.Number:
                if (json5) {
                    let tokenText = text.slice(token.loc.start.offset, token.loc.end.offset);
                    if (tokenText[0] === "+" || tokenText[0] === "-") {
                        tokenText = tokenText.slice(1);
                    }

                    if (tokenText === "NaN" || tokenText === "Infinity") {
                        return createJSON5IdentifierNode(token);
                    }
                }
                return createLiteralNode(tokenType);

            case tt.Null:
                return createNullNode(token);

            case tt.LBrace:
                return parseObject(tokenType);

            case tt.LBracket:
                return parseArray(tokenType);

            default:
                throw new UnexpectedToken(token);
        }

    }

    
    const docBody = parseValue();
    
    const unexpectedToken = next();
    if (unexpectedToken) {
        throw new UnexpectedToken(tokenizer.token);
    }
    
    
    const textEndLocation = getEndLocation(text);
    const docParts = {
        loc: {
            start: {
                line: 1,
                column: 1,
                offset: 0
            },
            end: {
                ...textEndLocation
            }
        }
    };
    
    if (options.tokens) {
        docParts.tokens = tokens;
    }

    if (options.ranges) {
        docParts.range = [
            docParts.loc.start.offset,
            docParts.loc.end.offset
        ];
    }

    return types.document(/** @type {ValueNode} */ (docBody), docParts);
}

/**
 * @fileoverview Traversal approaches for Momoa JSON AST.
 * @author Nicholas C. Zakas
 */

//-----------------------------------------------------------------------------
// Typedefs
//-----------------------------------------------------------------------------

/** @typedef {import("./typedefs.js").Node} Node */
/** @typedef {import("./typedefs.js").TraversalPhase} TraversalPhase */
/**
 * @typedef {Object} TraversalVisitor
 * @property {(node: Node, parent?: Node) => void} [enter]
 * @property {(node: Node, parent?: Node) => void} [exit]
 */

//-----------------------------------------------------------------------------
// Data
//-----------------------------------------------------------------------------

const childKeys = new Map([
    ["Document", ["body"]],
    ["Object", ["members"]],
    ["Member", ["name", "value"]],
    ["Element", ["value"]],
    ["Array", ["elements"]],
    ["String", []],
    ["Number", []],
    ["Boolean", []],
    ["Null", []],
    ["NaN", []],
    ["Infinity", []],
    ["Identifier", []],
]);

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

/**
 * Determines if a given value is an object.
 * @param {*} value The value to check.
 * @returns {boolean} True if the value is an object, false if not. 
 */
function isObject(value) {
    return value && (typeof value === "object");
}

/**
 * Determines if a given value is an AST node.
 * @param {*} value The value to check.
 * @returns {boolean} True if the value is a node, false if not. 
 */
function isNode(value) {
    return isObject(value) && (typeof value.type === "string");
}

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * Traverses an AST from the given node.
 * @param {Node} root The node to traverse from 
 * @param {TraversalVisitor} visitor An object with an `enter` and `exit` method. 
 */
function traverse(root, visitor) {

    /**
     * Recursively visits a node.
     * @param {Node} node The node to visit.
     * @param {Node} [parent] The parent of the node to visit.
     * @returns {void}
     */
    function visitNode(node, parent) {

        if (typeof visitor.enter === "function") {
            visitor.enter(node, parent);
        }

        for (const key of childKeys.get(node.type)) {
            const value = node[key];

            if (isObject(value)) {
                if (Array.isArray(value)) {
                    value.forEach(child => visitNode(child, node));
                } else if (isNode(value)) {
                    visitNode(value, node);
                }
            }
        }

        if (typeof visitor.exit === "function") {
            visitor.exit(node, parent);
        }
    }

    visitNode(root);
}

/**
 * @callback FilterPredicate
 * @param {{node: Node, parent?: Node, phase: TraversalPhase}} item
 * @param {number} index
 * @param {Array<{node: Node, parent?: Node, phase: TraversalPhase}>} array
 * @returns {boolean}
 */

/**
 * Creates an iterator over the given AST.
 * @param {Node} root The root AST node to traverse. 
 * @param {FilterPredicate} [filter] A filter function to determine which steps to
 *      return;
 * @returns {IterableIterator<{node: Node, parent?: Node, phase: TraversalPhase}>} An iterator over the AST.  
 */
function iterator(root, filter = () => true) {

    /** @type {Array<{node: Node, parent?: Node, phase: TraversalPhase}>} */
    const traversal = [];

    traverse(root, {
        enter(node, parent) {
            traversal.push({ node, parent, phase: "enter" });
        },
        exit(node, parent) {
            traversal.push({ node, parent, phase: "exit" });
        }
    });

    return traversal.filter(filter).values();
}

/**
 * @fileoverview Evaluator for Momoa AST.
 * @author Nicholas C. Zakas
 */

//-----------------------------------------------------------------------------
// Typedefs
//-----------------------------------------------------------------------------

/** @typedef {import("./typedefs.js").Node} Node */
/** @typedef {import("./typedefs.js").NodeParts} NodeParts */
/** @typedef {import("./typedefs.js").DocumentNode} DocumentNode */
/** @typedef {import("./typedefs.js").StringNode} StringNode */
/** @typedef {import("./typedefs.js").NumberNode} NumberNode */
/** @typedef {import("./typedefs.js").BooleanNode} BooleanNode */
/** @typedef {import("./typedefs.js").MemberNode} MemberNode */
/** @typedef {import("./typedefs.js").ObjectNode} ObjectNode */
/** @typedef {import("./typedefs.js").ElementNode} ElementNode */
/** @typedef {import("./typedefs.js").ArrayNode} ArrayNode */
/** @typedef {import("./typedefs.js").NullNode} NullNode */
/** @typedef {import("./typedefs.js").AnyNode} AnyNode */
/** @typedef {import("./typedefs.js").JSONValue} JSONValue */

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * Evaluates a Momoa AST node into a JavaScript value.
 * @param {AnyNode} node The node to interpet.
 * @returns {JSONValue} The JavaScript value for the node. 
 */
function evaluate(node) {
    switch (node.type) {
        case "String":
            return node.value;

        case "Number":
            return node.value;

        case "Boolean":
            return node.value;

        case "Null":
            return null;

        case "NaN":
            return NaN;
        
        case "Infinity":
            return node.sign === "-" ? -Infinity : Infinity;

        case "Identifier":
            return node.name;

        case "Array": {
            // const arrayNode = /** @type {ArrayNode} */ (node);
            return node.elements.map(element => evaluate(element.value));
        }

        case "Object": {

            /** @type {{[property: string]: JSONValue}} */
            const object = {};

            node.members.forEach(member => {
                object[/** @type {string} */ (evaluate(member.name))] = evaluate(member.value);
            });    

            return object;
        }    

        case "Document": {
            return evaluate(node.body);
        }

        case "Element":
            throw new Error("Cannot evaluate array element outside of an array.");

        case "Member":
            throw new Error("Cannot evaluate object member outside of an object.");

        default:
            // @ts-ignore tsc doesn't know about the type property here?
            throw new Error(`Unknown node type ${ node.type }.`);
    }
}

/**
 * @fileoverview Printer for Momoa AST.
 * @author Nicholas C. Zakas
 */


//-----------------------------------------------------------------------------
// Typedefs
//-----------------------------------------------------------------------------

/** @typedef {import("./typedefs.js").Location} Location */
/** @typedef {import("./typedefs.js").AnyNode} AnyNode */
/** @typedef {import("./typedefs.js").BooleanNode} BooleanNode */
/** @typedef {import("./typedefs.js").NumberNode} NumberNode */
/** @typedef {import("./typedefs.js").NullNode} NullNode */
/** @typedef {import("./typedefs.js").NaNNode} NaNNode */
/** @typedef {import("./typedefs.js").InfinityNode} InfinityNode */
/** @typedef {import("./typedefs.js").StringNode} StringNode */
/** @typedef {import("./typedefs.js").IdentifierNode} IdentifierNode */
/** @typedef {import("./typedefs.js").ObjectNode} ObjectNode */
/** @typedef {import("./typedefs.js").ArrayNode} ArrayNode */
/** @typedef {import("./typedefs.js").MemberNode} MemberNode */

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

/**
 * Prints the string representation of a Boolean node.
 * @param {BooleanNode} node The node to print.
 * @returns {string} The boolean value.
 */
function printBoolean(node) {
    return node.value ? "true" : "false";
}

/**
 * Prints the string representation of a null node.
 * @returns {string} The string "null".
 */
function printNull() {
    return "null";
}

/**
 * Prints the string representation of a number node.
 * @param {NumberNode} node The node to print.
 * @returns {string} The number value.
 */
function printNumber(node) {
    return node.value.toString();
}

/**
 * Prints the string representation of a NaN node.
 * @returns {string} The string "NaN".
 */
function printNaN() {
    return "NaN";
}

/**
 * Prints the string representation of an Infinity node.
 * @param {InfinityNode} node The node to print.
 * @returns {string} The string "Infinity" or "-Infinity".
 */
function printInfinity(node) {
    return node.sign + "Infinity";
}

/**
 * Prints the string representation of a string node.
 * @param {StringNode} node The node to print.
 * @returns {string} The string value.
 */
function printString(node) {

    let result = "\"";

    // escape all characters that need escaping
    for (const c of node.value) {

        const newChar = json5CharToEscape.get(c);

        if (newChar) {
            result += "\\" + newChar;
            continue;
        }

        // if it's a double quote, escape it
        if (c === "\"") {
            result += "\\\"";
            continue;
        }

        // if it's a control character, escape it
        if (c < " " || c === "\u007F") {
            const hex = c.codePointAt(0).toString(16).toUpperCase();
            result += `\\u${"0000".substring(hex.length)}${hex}`;
            continue;
        }

        // otherwise, just add the character
        result += c;

    }
    
    return result + "\"";
}

/**
 * Prints the string representation of an identifier node.
 * @param {IdentifierNode} node The node to print.
 * @returns {string} The identifier name.
 */
function printIdentifier(node) {
    return node.name;
}

/**
 * Prints the string representation of an array node.
 * @param {ArrayNode} node The node to print.
 * @param {string} indent The string to use for indentation.
 * @param {number} indentLevel The current level of indentation.
 * @returns {string} The array value.
 */
function printArray(node, indent, indentLevel) {
    const newLine = indent ? "\n" : "";
    const indentString = indent.repeat(indentLevel);
    const elementIndentString = indent.repeat(indentLevel + 1);

    return `[${newLine}${
        node.elements.map(element =>
            `${elementIndentString}${printValue(element.value, indent, indentLevel + 1)}`
        ).join(`,${newLine}`)
    }${newLine}${indentString}]`;
}

/**
 * Prints the string representation of a member node.
 * @param {MemberNode} node The node to print.
 * @param {string} indent The string to use for indentation.
 * @param {number} indentLevel The current level of indentation.
 * @returns {string} The member value.
 */
function printMember(node, indent, indentLevel) {
    const space = indent ? " " : "";
    return `${printValue(node.name, indent, indentLevel)}:${space}${printValue(node.value, indent, indentLevel + 1)}`;
}

/**
 * Prints the string representation of an object node.
 * @param {ObjectNode} node The node to print.
 * @param {string} indent The string to use for indentation.
 * @param {number} indentLevel The current level of indentation.
 * @returns {string} The object value.
 */
function printObject(node, indent, indentLevel) {
    const newLine = indent ? "\n" : "";
    const indentString = indent.repeat(indentLevel);
    const memberIndentString = indent.repeat(indentLevel + 1);

    return `{${newLine}${
        node.members.map(member => 
            `${memberIndentString}${printMember(member, indent, indentLevel)}`
        ).join(`,${newLine}`)
    }${newLine}${indentString}}`;
}

/**
 * Prints the string representation of a node.
 * @param {AnyNode} node The node to print.
 * @param {string} indentString The string to use for indentation.
 * @param {number} indentLevel The current level of indentation.
 * @returns {string} The string representation of the node.
 * @throws {TypeError} If the node type is unknown.

 */
function printValue(node, indentString, indentLevel) {
    switch (node.type) {
        case "String":
            return printString(node);
        case "Number":
            return printNumber(node);
        case "Boolean":
            return printBoolean(node);
        case "Null":
            return printNull();
        case "NaN":
            return printNaN();
        case "Infinity":
            return printInfinity(node);
        case "Identifier":
            return printIdentifier(node);
        case "Array":
            return printArray(node, indentString, indentLevel);
        case "Object":
            return printObject(node, indentString, indentLevel);
        case "Document":
            return printValue(node.body, indentString, indentLevel);
        default:
            throw new TypeError(`Unknown node type: ${node.type}`);
    }
}


//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * Converts a Momoa AST back into a JSON string.
 * @param {AnyNode} node The node to print.
 * @param {Object} options Options for the print.
 * @param {number} [options.indent=0] The number of spaces to indent each line. If
 *      greater than 0, then newlines and indents will be added to output. 
 * @returns {string} The JSON representation of the AST.
 */
function print(node, { indent = 0 } = {}) {

    const indentLevel = 0;
    const indentString = " ".repeat(indent);

    return printValue(node, indentString, indentLevel);
}

exports.evaluate = evaluate;
exports.iterator = iterator;
exports.parse = parse;
exports.print = print;
exports.tokenize = tokenize;
exports.traverse = traverse;
exports.types = types;
exports.visitorKeys = childKeys;
 Mx(!export type FilterPredicate = (item: {
    node: Node;
    parent?: Node;
    phase: TraversalPhase;
}, index: number, array: Array<{
    node: Node;
    parent?: Node;
    phase: TraversalPhase;
}>) => boolean;
export type AnyNode = import("./typedefs.cjs").AnyNode;
export type JSONValue = import("./typedefs.cjs").JSONValue;
export type TokenType = import("./typedefs.cjs").TokenType;
export type Location = import("./typedefs.cjs").Location;
export type Token = import("./typedefs.cjs").Token;
export type Range = import("./typedefs.cjs").Range;
export type TokenizeOptions = import("./typedefs.cjs").TokenizeOptions;
export type LocationRange = import("./typedefs.cjs").LocationRange;
export type NodeParts = import("./typedefs.cjs").NodeParts;
export type DocumentNode = import("./typedefs.cjs").DocumentNode;
export type StringNode = import("./typedefs.cjs").StringNode;
export type NumberNode = import("./typedefs.cjs").NumberNode;
export type BooleanNode = import("./typedefs.cjs").BooleanNode;
export type MemberNode = import("./typedefs.cjs").MemberNode;
export type ObjectNode = import("./typedefs.cjs").ObjectNode;
export type ElementNode = import("./typedefs.cjs").ElementNode;
export type ArrayNode = import("./typedefs.cjs").ArrayNode;
export type NullNode = import("./typedefs.cjs").NullNode;
export type ValueNode = import("./typedefs.cjs").ValueNode;
export type IdentifierNode = import("./typedefs.cjs").IdentifierNode;
export type NaNNode = import("./typedefs.cjs").NaNNode;
export type InfinityNode = import("./typedefs.cjs").InfinityNode;
export type Sign = import("./typedefs.cjs").Sign;
export type Node = import("./typedefs.cjs").Node;
export type Mode = import("./typedefs.cjs").Mode;
export type ParseOptions = import("./typedefs.cjs").ParseOptions;
export type TraversalPhase = import("./typedefs.cjs").TraversalPhase;
export type TraversalVisitor = {
    enter?: (node: Node, parent?: Node) => void;
    exit?: (node: Node, parent?: Node) => void;
};
/**
 * @fileoverview Evaluator for Momoa AST.
 * @author Nicholas C. Zakas
 */
/** @typedef {import("./typedefs.cjs").AnyNode} AnyNode */
/** @typedef {import("./typedefs.cjs").JSONValue} JSONValue */
/**
 * Evaluates a Momoa AST node into a JavaScript value.
 * @param {AnyNode} node The node to interpet.
 * @returns {JSONValue} The JavaScript value for the node.
 */
export function evaluate(node: AnyNode): JSONValue;
/**
 * @callback FilterPredicate
 * @param {{node: Node, parent?: Node, phase: TraversalPhase}} item
 * @param {number} index
 * @param {Array<{node: Node, parent?: Node, phase: TraversalPhase}>} array
 * @returns {boolean}
 */
/**
 * Creates an iterator over the given AST.
 * @param {Node} root The root AST node to traverse.
 * @param {FilterPredicate} [filter] A filter function to determine which steps to
 *      return;
 * @returns {IterableIterator<{node: Node, parent?: Node, phase: TraversalPhase}>} An iterator over the AST.
 */
export function iterator(root: Node, filter?: FilterPredicate): IterableIterator<{
    node: Node;
    parent?: Node;
    phase: TraversalPhase;
}>;
/**
 *
 * @param {string} text The text to parse.
 * @param {ParseOptions} [options] The options object.
 * @returns {DocumentNode} The AST representing the parsed JSON.
 * @throws {Error} When there is a parsing error.
 */
export function parse(text: string, options?: ParseOptions): DocumentNode;
/**
 * Converts a Momoa AST back into a JSON string.
 * @param {AnyNode} node The node to print.
 * @param {Object} options Options for the print.
 * @param {number} [options.indent=0] The number of spaces to indent each line. If
 *      greater than 0, then newlines and indents will be added to output.
 * @returns {string} The JSON representation of the AST.
 */
export function print(node: AnyNode, { indent }?: {
    indent?: number;
}): string;
/**
 * Creates an iterator over the tokens representing the source text.
 * @param {string} text The source text to tokenize.
 * @param {TokenizeOptions} [options] Options for doing the tokenization.
 * @returns {Array<Token>} An iterator over the tokens.
 */
export function tokenize(text: string, options?: TokenizeOptions): Array<Token>;
/**
 * Traverses an AST from the given node.
 * @param {Node} root The node to traverse from
 * @param {TraversalVisitor} visitor An object with an `enter` and `exit` method.
 */
export function traverse(root: Node, visitor: TraversalVisitor): void;
export namespace types {
    /**
     * Creates a document node.
     * @param {ValueNode} body The body of the document.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {DocumentNode} The document node.
     */
    export function document(body: ValueNode, parts?: NodeParts): DocumentNode;
    /**
     * Creates a string node.
     * @param {string} value The value for the string.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {StringNode} The string node.
     */
    export function string(value: string, parts?: NodeParts): StringNode;
    /**
     * Creates a number node.
     * @param {number} value The value for the number.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {NumberNode} The number node.
     */
    export function number(value: number, parts?: NodeParts): NumberNode;
    /**
     * Creates a boolean node.
     * @param {boolean} value The value for the boolean.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {BooleanNode} The boolean node.
     */
    export function boolean(value: boolean, parts?: NodeParts): BooleanNode;
    /**
     * Creates a null node.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {NullNode} The null node.
     */
    function _null(parts?: NodeParts): NullNode;
    export { _null as null };
    /**
     * Creates an array node.
     * @param {Array<ElementNode>} elements The elements to add.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {ArrayNode} The array node.
     */
    export function array(elements: Array<ElementNode>, parts?: NodeParts): ArrayNode;
    /**
     * Creates an element node.
     * @param {ValueNode} value The value for the element.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {ElementNode} The element node.
     */
    export function element(value: ValueNode, parts?: NodeParts): ElementNode;
    /**
     * Creates an object node.
     * @param {Array<MemberNode>} members The members to add.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {ObjectNode} The object node.
     */
    export function object(members: Array<MemberNode>, parts?: NodeParts): ObjectNode;
    /**
     * Creates a member node.
     * @param {StringNode|IdentifierNode} name The name for the member.
     * @param {ValueNode} value The value for the member.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {MemberNode} The member node.
     */
    export function member(name: StringNode | IdentifierNode, value: ValueNode, parts?: NodeParts): MemberNode;
    /**
     * Creates an identifier node.
     * @param {string} name The name for the identifier.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {IdentifierNode} The identifier node.
     */
    export function identifier(name: string, parts?: NodeParts): IdentifierNode;
    /**
     * Creates a NaN node.
     * @param {Sign} sign The sign for the Infinity.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {NaNNode} The NaN node.
     */
    export function nan(sign?: Sign, parts?: NodeParts): NaNNode;
    /**
     * Creates an Infinity node.
     * @param {Sign} sign The sign for the Infinity.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {InfinityNode} The Infinity node.
     */
    export function infinity(sign?: Sign, parts?: NodeParts): InfinityNode;
}
/**
 * @fileoverview Traversal approaches for Momoa JSON AST.
 * @author Nicholas C. Zakas
 */
/** @typedef {import("./typedefs.cjs").TraversalPhase} TraversalPhase */
/**
 * @typedef {Object} TraversalVisitor
 * @property {(node: Node, parent?: Node) => void} [enter]
 * @property {(node: Node, parent?: Node) => void} [exit]
 */
declare const childKeys: Map<string, string[]>;
export { childKeys as visitorKeys };
hx
!export type FilterPredicate = (item: {
    node: Node;
    parent?: Node;
    phase: TraversalPhase;
}, index: number, array: Array<{
    node: Node;
    parent?: Node;
    phase: TraversalPhase;
}>) => boolean;
export type AnyNode = import("./typedefs.js").AnyNode;
export type JSONValue = import("./typedefs.js").JSONValue;
export type TokenType = import("./typedefs.js").TokenType;
export type Location = import("./typedefs.js").Location;
export type Token = import("./typedefs.js").Token;
export type Range = import("./typedefs.js").Range;
export type TokenizeOptions = import("./typedefs.js").TokenizeOptions;
export type LocationRange = import("./typedefs.js").LocationRange;
export type NodeParts = import("./typedefs.js").NodeParts;
export type DocumentNode = import("./typedefs.js").DocumentNode;
export type StringNode = import("./typedefs.js").StringNode;
export type NumberNode = import("./typedefs.js").NumberNode;
export type BooleanNode = import("./typedefs.js").BooleanNode;
export type MemberNode = import("./typedefs.js").MemberNode;
export type ObjectNode = import("./typedefs.js").ObjectNode;
export type ElementNode = import("./typedefs.js").ElementNode;
export type ArrayNode = import("./typedefs.js").ArrayNode;
export type NullNode = import("./typedefs.js").NullNode;
export type ValueNode = import("./typedefs.js").ValueNode;
export type IdentifierNode = import("./typedefs.js").IdentifierNode;
export type NaNNode = import("./typedefs.js").NaNNode;
export type InfinityNode = import("./typedefs.js").InfinityNode;
export type Sign = import("./typedefs.js").Sign;
export type Node = import("./typedefs.js").Node;
export type Mode = import("./typedefs.js").Mode;
export type ParseOptions = import("./typedefs.js").ParseOptions;
export type TraversalPhase = import("./typedefs.js").TraversalPhase;
export type TraversalVisitor = {
    enter?: (node: Node, parent?: Node) => void;
    exit?: (node: Node, parent?: Node) => void;
};
/**
 * @fileoverview Evaluator for Momoa AST.
 * @author Nicholas C. Zakas
 */
/** @typedef {import("./typedefs.js").AnyNode} AnyNode */
/** @typedef {import("./typedefs.js").JSONValue} JSONValue */
/**
 * Evaluates a Momoa AST node into a JavaScript value.
 * @param {AnyNode} node The node to interpet.
 * @returns {JSONValue} The JavaScript value for the node.
 */
export function evaluate(node: AnyNode): JSONValue;
/**
 * @callback FilterPredicate
 * @param {{node: Node, parent?: Node, phase: TraversalPhase}} item
 * @param {number} index
 * @param {Array<{node: Node, parent?: Node, phase: TraversalPhase}>} array
 * @returns {boolean}
 */
/**
 * Creates an iterator over the given AST.
 * @param {Node} root The root AST node to traverse.
 * @param {FilterPredicate} [filter] A filter function to determine which steps to
 *      return;
 * @returns {IterableIterator<{node: Node, parent?: Node, phase: TraversalPhase}>} An iterator over the AST.
 */
export function iterator(root: Node, filter?: FilterPredicate): IterableIterator<{
    node: Node;
    parent?: Node;
    phase: TraversalPhase;
}>;
/**
 *
 * @param {string} text The text to parse.
 * @param {ParseOptions} [options] The options object.
 * @returns {DocumentNode} The AST representing the parsed JSON.
 * @throws {Error} When there is a parsing error.
 */
export function parse(text: string, options?: ParseOptions): DocumentNode;
/**
 * Converts a Momoa AST back into a JSON string.
 * @param {AnyNode} node The node to print.
 * @param {Object} options Options for the print.
 * @param {number} [options.indent=0] The number of spaces to indent each line. If
 *      greater than 0, then newlines and indents will be added to output.
 * @returns {string} The JSON representation of the AST.
 */
export function print(node: AnyNode, { indent }?: {
    indent?: number;
}): string;
/**
 * Creates an iterator over the tokens representing the source text.
 * @param {string} text The source text to tokenize.
 * @param {TokenizeOptions} [options] Options for doing the tokenization.
 * @returns {Array<Token>} An iterator over the tokens.
 */
export function tokenize(text: string, options?: TokenizeOptions): Array<Token>;
/**
 * Traverses an AST from the given node.
 * @param {Node} root The node to traverse from
 * @param {TraversalVisitor} visitor An object with an `enter` and `exit` method.
 */
export function traverse(root: Node, visitor: TraversalVisitor): void;
export namespace types {
    /**
     * Creates a document node.
     * @param {ValueNode} body The body of the document.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {DocumentNode} The document node.
     */
    export function document(body: ValueNode, parts?: NodeParts): DocumentNode;
    /**
     * Creates a string node.
     * @param {string} value The value for the string.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {StringNode} The string node.
     */
    export function string(value: string, parts?: NodeParts): StringNode;
    /**
     * Creates a number node.
     * @param {number} value The value for the number.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {NumberNode} The number node.
     */
    export function number(value: number, parts?: NodeParts): NumberNode;
    /**
     * Creates a boolean node.
     * @param {boolean} value The value for the boolean.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {BooleanNode} The boolean node.
     */
    export function boolean(value: boolean, parts?: NodeParts): BooleanNode;
    /**
     * Creates a null node.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {NullNode} The null node.
     */
    function _null(parts?: NodeParts): NullNode;
    export { _null as null };
    /**
     * Creates an array node.
     * @param {Array<ElementNode>} elements The elements to add.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {ArrayNode} The array node.
     */
    export function array(elements: Array<ElementNode>, parts?: NodeParts): ArrayNode;
    /**
     * Creates an element node.
     * @param {ValueNode} value The value for the element.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {ElementNode} The element node.
     */
    export function element(value: ValueNode, parts?: NodeParts): ElementNode;
    /**
     * Creates an object node.
     * @param {Array<MemberNode>} members The members to add.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {ObjectNode} The object node.
     */
    export function object(members: Array<MemberNode>, parts?: NodeParts): ObjectNode;
    /**
     * Creates a member node.
     * @param {StringNode|IdentifierNode} name The name for the member.
     * @param {ValueNode} value The value for the member.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {MemberNode} The member node.
     */
    export function member(name: StringNode | IdentifierNode, value: ValueNode, parts?: NodeParts): MemberNode;
    /**
     * Creates an identifier node.
     * @param {string} name The name for the identifier.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {IdentifierNode} The identifier node.
     */
    export function identifier(name: string, parts?: NodeParts): IdentifierNode;
    /**
     * Creates a NaN node.
     * @param {Sign} sign The sign for the Infinity.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {NaNNode} The NaN node.
     */
    export function nan(sign?: Sign, parts?: NodeParts): NaNNode;
    /**
     * Creates an Infinity node.
     * @param {Sign} sign The sign for the Infinity.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {InfinityNode} The Infinity node.
     */
    export function infinity(sign?: Sign, parts?: NodeParts): InfinityNode;
}
/**
 * @fileoverview Traversal approaches for Momoa JSON AST.
 * @author Nicholas C. Zakas
 */
/** @typedef {import("./typedefs.js").TraversalPhase} TraversalPhase */
/**
 * @typedef {Object} TraversalVisitor
 * @property {(node: Node, parent?: Node) => void} [enter]
 * @property {(node: Node, parent?: Node) => void} [exit]
 */
declare const childKeys: Map<string, string[]>;
export { childKeys as visitorKeys };
e[,x   /**
 * @fileoverview Character codes.
 * @author Nicholas C. Zakas
 */

const CHAR_0 = 48;          // 0
const CHAR_1 = 49;          // 1
const CHAR_9 = 57;          // 9
const CHAR_BACKSLASH = 92;  // \
const CHAR_DOLLAR = 36;     // $
const CHAR_DOT = 46;        // .
const CHAR_DOUBLE_QUOTE = 34; // "
const CHAR_LOWER_A = 97;    // a
const CHAR_LOWER_E = 101;         // e
const CHAR_LOWER_F = 102;   // f
const CHAR_LOWER_N = 110;   // n
const CHAR_LOWER_T = 116;   // t
const CHAR_LOWER_U = 117;   // u
const CHAR_LOWER_X = 120;   // x
const CHAR_LOWER_Z = 122;   // z
const CHAR_MINUS = 45;      // -
const CHAR_NEWLINE = 10;    // newline
const CHAR_PLUS = 43;       // +
const CHAR_RETURN = 13;     // return
const CHAR_SINGLE_QUOTE = 39; // '
const CHAR_SLASH = 47;      // /
const CHAR_SPACE = 32;      // space
const CHAR_TAB = 9;         // tab
const CHAR_UNDERSCORE = 95; // _
const CHAR_UPPER_A = 65;    // A
const CHAR_UPPER_E = 69;          // E
const CHAR_UPPER_F = 70;    // F
const CHAR_UPPER_N = 78;    // N
const CHAR_UPPER_X = 88;    // X
const CHAR_UPPER_Z = 90;    // Z
const CHAR_LOWER_B = 98;    // b
const CHAR_LOWER_R = 114;   // r
const CHAR_LOWER_V = 118;   // v
const CHAR_LINE_SEPARATOR = 0x2028;
const CHAR_PARAGRAPH_SEPARATOR = 0x2029;
const CHAR_UPPER_I = 73;    // I
const CHAR_STAR = 42;       // *
const CHAR_VTAB = 11;            // U+000B Vertical tab
const CHAR_FORM_FEED = 12;       // U+000C Form feed
const CHAR_NBSP = 160;           // U+00A0 Non-breaking space
const CHAR_BOM = 65279;          // U+FEFF
const CHAR_NON_BREAKING_SPACE = 160;
const CHAR_EN_QUAD = 8192;
const CHAR_EM_QUAD = 8193;
const CHAR_EN_SPACE = 8194;
const CHAR_EM_SPACE = 8195;
const CHAR_THREE_PER_EM_SPACE = 8196;
const CHAR_FOUR_PER_EM_SPACE = 8197;
const CHAR_SIX_PER_EM_SPACE = 8198;
const CHAR_FIGURE_SPACE = 8199;
const CHAR_PUNCTUATION_SPACE = 8200;
const CHAR_THIN_SPACE = 8201;
const CHAR_HAIR_SPACE = 8202;
const CHAR_NARROW_NO_BREAK_SPACE = 8239;
const CHAR_MEDIUM_MATHEMATICAL_SPACE = 8287;
const CHAR_IDEOGRAPHIC_SPACE = 12288;

/**
 * @fileoverview JSON syntax helpers
 * @author Nicholas C. Zakas
 */


//-----------------------------------------------------------------------------
// Types
//-----------------------------------------------------------------------------

/** @typedef {import("./typedefs.js").TokenType} TokenType */

//-----------------------------------------------------------------------------
// Predefined Tokens
//-----------------------------------------------------------------------------

const LBRACKET = "[";
const RBRACKET = "]";
const LBRACE = "{";
const RBRACE = "}";
const COLON = ":";
const COMMA = ",";

const TRUE = "true";
const FALSE = "false";
const NULL = "null";
const NAN$1 = "NaN";
const INFINITY$1 = "Infinity";
const QUOTE = "\"";

const escapeToChar = new Map([
    [CHAR_DOUBLE_QUOTE, QUOTE],
    [CHAR_BACKSLASH, "\\"],
    [CHAR_SLASH, "/"],
    [CHAR_LOWER_B, "\b"],
    [CHAR_LOWER_N, "\n"],
    [CHAR_LOWER_F, "\f"],
    [CHAR_LOWER_R, "\r"],
    [CHAR_LOWER_T, "\t"]
]);

const json5EscapeToChar = new Map([
    ...escapeToChar,
    [CHAR_LOWER_V, "\v"],
    [CHAR_0, "\0"]
]);

const charToEscape = new Map([
    [QUOTE, QUOTE],
    ["\\", "\\"],
    ["/", "/"],
    ["\b", "b"],
    ["\n", "n"],
    ["\f", "f"],
    ["\r", "r"],
    ["\t", "t"]
]);

const json5CharToEscape = new Map([
    ...charToEscape,
    ["\v", "v"],
    ["\0", "0"],
    ["\u2028", "u2028"],
    ["\u2029", "u2029"]
]);

/** @type {Map<string,TokenType>} */
const knownTokenTypes = new Map([
    [LBRACKET, "LBracket"],
    [RBRACKET, "RBracket"],
    [LBRACE, "LBrace"],
    [RBRACE, "RBrace"],
    [COLON, "Colon"],
    [COMMA, "Comma"],
    [TRUE, "Boolean"],
    [FALSE, "Boolean"],
    [NULL, "Null"]
]);

/** @type {Map<string,TokenType>} */
const knownJSON5TokenTypes = new Map([
    ...knownTokenTypes,
    [NAN$1, "Number"],
    [INFINITY$1, "Number"]
]);

// JSON5
const json5LineTerminators = new Set([
    CHAR_NEWLINE,
    CHAR_RETURN,
    CHAR_LINE_SEPARATOR,
    CHAR_PARAGRAPH_SEPARATOR
]);

/**
 * @fileoverview JSON tokenization/parsing errors
 * @author Nicholas C. Zakas
 */

//-----------------------------------------------------------------------------
// Typedefs
//-----------------------------------------------------------------------------

/** @typedef {import("./typedefs.js").Location} Location */
/** @typedef {import("./typedefs.js").Token} Token */

//-----------------------------------------------------------------------------
// Errors
//-----------------------------------------------------------------------------

/**
 * Base class that attaches location to an error.
 */
class ErrorWithLocation extends Error {

    /**
     * Creates a new instance.
     * @param {string} message The error message to report. 
     * @param {Location} loc The location information for the error.
     */
    constructor(message, { line, column, offset }) {
        super(`${ message } (${ line }:${ column})`);

        /**
         * The line on which the error occurred.
         * @type {number}
         */
        this.line = line;

        /**
         * The column on which the error occurred.
         * @type {number}
         */
        this.column = column;
        
        /**
         * The index into the string where the error occurred.
         * @type {number}
         */
        this.offset = offset;
    }

}

/**
 * Error thrown when an unexpected character is found during tokenizing.
 */
class UnexpectedChar extends ErrorWithLocation {

    /**
     * Creates a new instance.
     * @param {number} unexpected The character that was found.
     * @param {Location} loc The location information for the found character.
     */
    constructor(unexpected, loc) {
        super(`Unexpected character '${ String.fromCharCode(unexpected) }' found.`, loc);
    }
}

/**
 * Error thrown when an unexpected identifier is found during tokenizing.
 */
class UnexpectedIdentifier extends ErrorWithLocation {

    /**
     * Creates a new instance.
     * @param {string} unexpected The character that was found.
     * @param {Location} loc The location information for the found character.
     */
    constructor(unexpected, loc) {
        super(`Unexpected identifier '${ unexpected }' found.`, loc);
    }
}

/**
 * Error thrown when an unexpected token is found during parsing.
 */
class UnexpectedToken extends ErrorWithLocation {

    /**
     * Creates a new instance.
     * @param {Token} token The token that was found. 
     */
    constructor(token) {
        super(`Unexpected token ${ token.type } found.`, token.loc.start);
    }
}

/**
 * Error thrown when the end of input is found where it isn't expected.
 */
class UnexpectedEOF extends ErrorWithLocation {

    /**
     * Creates a new instance.
     * @param {Location} loc The location information for the found character.
     */
    constructor(loc) {
        super("Unexpected end of input found.", loc);
    }
}

/*
 * The following is extracted from https://github.com/json5/json5/
 *
 * MIT License
 * 
 * Copyright (c) 2012-2018 Aseem Kishore, and others.
 * 
 * Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 * 
 * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 * 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

const ID_Start = /[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\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\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2160-\u2188\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-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42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\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]/;
// eslint-disable-next-line no-misleading-character-class
const ID_Continue = /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u09FC\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9-\u0AFF\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\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F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF9\u1D00-\u1DF9\u1DFB-\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\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312E\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEA\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB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46\uDC66-\uDC6F\uDC7F-\uDCBA\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD00-\uDD34\uDD36-\uDD3F\uDD50-\uDD73\uDD76\uDD80-\uDDC4\uDDCA-\uDDCC\uDDD0-\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE37\uDE3E\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDE00-\uDE3E\uDE47\uDE50-\uDE83\uDE86-\uDE99\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD36\uDD3A\uDD3C\uDD3D\uDD3F-\uDD47\uDD50-\uDD59]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\u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F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uDB40[\uDD00-\uDDEF]/;

/**
 * @fileoverview A charactor code reader.
 * @author Nicholas C. Zakas
 */

//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------


//-----------------------------------------------------------------------------
// Data
//-----------------------------------------------------------------------------

const CHAR_CR = 13; // \r
const CHAR_LF = 10; // \n

//-----------------------------------------------------------------------------
// CharCodeReader
//-----------------------------------------------------------------------------

/**
 * A reader that reads character codes from a string.
 */
class CharCodeReader {

    /**
     * The text to read from.
     * @type {string}
     */
    #text = "";

    /**
     * The current line number.
     * @type {number}
     */
    #line = 1;

    /**
     * The current column number.
     * @type {number}
     */
    #column = 0;

    /**
     * The current offset in the text.
     * @type {number}
     */
    #offset = -1;

    /**
     * Whether the last character read was a new line.
     * @type {boolean}
     */
    #newLine = false;

    /**
     * The last character code read.
     * @type {number}
     */
    #last = -1;

    /**
     * Whether the reader has ended.
     * @type {boolean}
     */
    #ended = false;

    /**
     * Creates a new instance.
     * @param {string} text The text to read from
     */
    constructor(text) {
        this.#text = text;
    }

    /**
     * Ends the reader.
     * @returns {void}
     */
    #end() {
        if (this.#ended) {
            return;
        }

        this.#column++;
        this.#offset++;
        this.#last = -1;
        this.#ended = true;
    }

    /**
     * Returns the current position of the reader.
     * @returns {Location} An object with line, column, and offset properties.
     */
    locate() {
        return {
            line: this.#line,
            column: this.#column,
            offset: this.#offset
        };
    }

    /**
     * Reads the next character code in the text.
     * @returns {number} The next character code, or -1 if there are no more characters.
     */
    next() {
        if (this.#offset >= this.#text.length - 1) {
            this.#end();
            return -1;
        }

        this.#offset++;
        const charCode = this.#text.charCodeAt(this.#offset);

        if (this.#newLine) {
            this.#line++;
            this.#column = 1;
            this.#newLine = false;
        } else {
            this.#column++;
        }

        if (charCode === CHAR_CR) {
            this.#newLine = true;

            // if we already see a \r, just ignore upcoming \n
            if (this.peek() === CHAR_LF) {
                this.#offset++;
            }
        } else if (charCode === CHAR_LF) {
            this.#newLine = true;
        }

        this.#last = charCode;

        return charCode;
    }

    /**
     * Peeks at the next character code in the text.
     * @returns {number} The next character code, or -1 if there are no more characters.
     */
    peek() {
        if (this.#offset === this.#text.length - 1) {
            return -1;
        }

        return this.#text.charCodeAt(this.#offset + 1);
    }

    /**
     * Determines if the next character code in the text matches a specific character code.
     * @param {(number) => boolean} fn A function to call on the next character.
     * @returns {boolean} True if the next character code matches, false if not.
     */ 
    match(fn) {
        if (fn(this.peek())) {
            this.next();
            return true;
        }

        return false;
    }

    /**
     * Returns the last character code read.
     * @returns {number} The last character code read.
     */
    current() {
        return this.#last;
    }


}

/**
 * @fileoverview JSON tokenizer
 * @author Nicholas C. Zakas
 */


//-----------------------------------------------------------------------------
// Typedefs
//-----------------------------------------------------------------------------

/** @typedef {import("./typedefs.js").Range} Range */
/** @typedef {import("./typedefs.js").TokenizeOptions} TokenizeOptions */

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

const INFINITY = "Infinity";
const NAN = "NaN";

const keywordStarts = new Set([CHAR_LOWER_T, CHAR_LOWER_F, CHAR_LOWER_N]);
const whitespace = new Set([CHAR_SPACE, CHAR_TAB, CHAR_NEWLINE, CHAR_RETURN]);
const json5Whitespace = new Set([
    ...whitespace,
    CHAR_VTAB,
    CHAR_FORM_FEED,
    CHAR_NBSP,
    CHAR_LINE_SEPARATOR,
    CHAR_PARAGRAPH_SEPARATOR,
    CHAR_BOM,
    CHAR_NON_BREAKING_SPACE,
    CHAR_EN_QUAD,
    CHAR_EM_QUAD,
    CHAR_EN_SPACE,
    CHAR_EM_SPACE,
    CHAR_THREE_PER_EM_SPACE,
    CHAR_FOUR_PER_EM_SPACE,
    CHAR_SIX_PER_EM_SPACE,
    CHAR_FIGURE_SPACE,
    CHAR_PUNCTUATION_SPACE,
    CHAR_THIN_SPACE,
    CHAR_HAIR_SPACE,
    CHAR_NARROW_NO_BREAK_SPACE,
    CHAR_MEDIUM_MATHEMATICAL_SPACE,
    CHAR_IDEOGRAPHIC_SPACE,
]);


/** @type {TokenizeOptions} */
const DEFAULT_OPTIONS$1 = {
    mode: "json",
    ranges: false
};

const jsonKeywords = new Set(["true", "false", "null"]);

const tt = {
    EOF: 0,
    Number: 1,
    String: 2,
    Boolean: 3,
    Null: 4,
    NaN: 5,
    Infinity: 6,
    Identifier: 7,
    Colon: 20,
    LBrace: 21,
    RBrace: 22,
    LBracket: 23,
    RBracket: 24,
    Comma: 25,
    LineComment: 40,
    BlockComment: 41
};


// #region Helpers


/**
 * Determines if a given character is a decimal digit.
 * @param {number} c The character to check.
 * @returns {boolean} `true` if the character is a digit.
 */
function isDigit(c) {
    return c >= CHAR_0 && c <= CHAR_9;
}

/**
 * Determines if a given character is a hexadecimal digit.
 * @param {number} c The character to check.
 * @returns {boolean} `true` if the character is a hexadecimal digit.
 */
function isHexDigit(c) {
    return isDigit(c) ||
        c >= CHAR_UPPER_A && c <= CHAR_UPPER_F ||
        c >= CHAR_LOWER_A && c <= CHAR_LOWER_F;
}

/**
 * Determines if a given character is a positive digit (1-9).
 * @param {number} c The character to check.
 * @returns {boolean} `true` if the character is a positive digit.
 */
function isPositiveDigit(c) {
    return c >= CHAR_1 && c <= CHAR_9;
}

/**
 * Determines if a given character is the start of a keyword.
 * @param {number} c The character to check.
 * @returns {boolean} `true` if the character is the start of a keyword.
 */
function isKeywordStart(c) {
    return keywordStarts.has(c);
}

/**
 * Determines if a given character is the start of a number.
 * @param {number} c The character to check.
 * @returns {boolean} `true` if the character is the start of a number.
 */
function isNumberStart(c) {
    return isDigit(c) || c === CHAR_DOT || c === CHAR_MINUS;
}

/**
 * Determines if a given character is the start of a JSON5 number.
 * @param {number} c The character to check.
 * @returns {boolean} `true` if the character is the start of a JSON5 number.
 */
function isJSON5NumberStart(c) {
    return isNumberStart(c) || c === CHAR_PLUS;
}

/**
 * Determines if a given character is the start of a string.
 * @param {number} c The character to check.
 * @param {boolean} json5 `true` if JSON5 mode is enabled.
 * @returns {boolean} `true` if the character is the start of a string.
 */
function isStringStart(c, json5) {
    return c === CHAR_DOUBLE_QUOTE || (json5 && c === CHAR_SINGLE_QUOTE);
}

/**
 * Tests that a given character is a valid first character of a
 * JSON5 identifier
 * @param {number} c The character to check.
 * @returns {boolean} `true` if the character is a valid first character. 
 */
function isJSON5IdentifierStart(c) {

    // test simple cases first

    if (c === CHAR_DOLLAR || c === CHAR_UNDERSCORE || c === CHAR_BACKSLASH) {
        return true;
    }

    if (c >= CHAR_LOWER_A && c <= CHAR_LOWER_Z || c >= CHAR_UPPER_A && c <= CHAR_UPPER_Z) {
        return true;
    }

    if (c === 0x200C || c === 0x200D) {
        return true;
    }
    
    const ct = String.fromCharCode(c);
    return ID_Start.test(ct);
}

/**
 * Tests that a given character is a valid part of a JSON5 identifier.
 * @param {number} c The character to check.
 * @returns {boolean} `true` if the character is a valid part of an identifier.
 */
function isJSON5IdentifierPart(c) {

    // fast path for simple cases
    if (isJSON5IdentifierStart(c) || isDigit(c)) {
        return true;
    }

    const ct = String.fromCharCode(c);
    return ID_Continue.test(ct);
}


// #endregion

class Tokenizer {

    /**
     * Options for the tokenizer.
     * @type {TokenizeOptions}
     */
    #options;

    /**
     * The source text to tokenize.
     * @type {string}
     */
    #text;

    /**
     * The reader for the source text.
     * @type {CharCodeReader}
     */
    #reader;

    /**
     * Indicates if the tokenizer is in JSON5 mode.
     * @type {boolean}
     */
    #json5;

    /**
     * Indicates if comments are allowed.
     * @type {boolean}
     */
    #allowComments;

    /**
     * Indicates if ranges should be included in the tokens.
     * @type {boolean}
     */
    #ranges;

    /**
     * The last token type read.
     * @type {Token}
     */
    #token;

    /**
     * Determines if a character is an escaped character.
     * @type {(c:number) => boolean}
     */
    #isEscapedCharacter;

    /**
     * Determines if a character is a JSON5 line terminator.
     * @type {(c:number) => boolean}
     */
    #isJSON5LineTerminator;


    /**
     * Determines if a character is a JSON5 hex escape.
     * @type {(c:number) => boolean}
     */
    #isJSON5HexEscape;

    /**
     * Determines if a character is whitespace.
     * @type {(c:number) => boolean}
     */
    #isWhitespace;

    /**
     * Creates a new instance of the tokenizer.
     * @param {string} text The source text
     * @param {TokenizeOptions} [options] Options for the tokenizer.
     */ 
    constructor(text, options) {
        this.#text = text;
        this.#options = {
            ...DEFAULT_OPTIONS$1,
            ...options
        };

        this.#reader = new CharCodeReader(text);
        this.#json5 = this.#options.mode === "json5";
        this.#allowComments = this.#options.mode !== "json";
        this.#ranges = this.#options.ranges;

        // TODO: Clean this up
        this.#isEscapedCharacter = this.#json5 ? json5EscapeToChar.has.bind(json5EscapeToChar) : escapeToChar.has.bind(escapeToChar);
        this.#isJSON5LineTerminator = this.#json5 ? json5LineTerminators.has.bind(json5LineTerminators) : () => false;
        this.#isJSON5HexEscape = this.#json5 ? c => c === CHAR_LOWER_X : () => false;
        this.#isWhitespace = this.#json5 ? json5Whitespace.has.bind(json5Whitespace) : whitespace.has.bind(whitespace);
    }

    // #region Errors

    /**
     * Convenience function for throwing unexpected character errors.
     * @param {number} c The unexpected character.
     * @param {Location} [loc] The location of the unexpected character.
     * @returns {never}
     * @throws {UnexpectedChar} always.
     */
    #unexpected(c, loc = this.#reader.locate()) {
        throw new UnexpectedChar(c, loc);
    }

    /**
     * Convenience function for throwing unexpected identifier errors.
     * @param {string} identifier The unexpected identifier.
     * @param {Location} [loc] The location of the unexpected identifier.
     * @returns {never}
     * @throws {UnexpectedIdentifier} always.
     */
    #unexpectedIdentifier(identifier, loc = this.#reader.locate()) {
        throw new UnexpectedIdentifier(identifier, loc);
    }

    /**
    * Convenience function for throwing unexpected EOF errors.
    * @returns {never}
    * @throws {UnexpectedEOF} always.
    */
    #unexpectedEOF() {
        throw new UnexpectedEOF(this.#reader.locate());
    }

    // #endregion

    // #region Helpers

    /**
     * Creates a new token.
     * @param {TokenType} tokenType The type of token to create.
     * @param {number} length The length of the token.
     * @param {Location} startLoc The start location for the token.
     * @param {Location} [endLoc] The end location for the token.
     * @returns {Token} The token.
     */
    #createToken(tokenType, length, startLoc, endLoc) {

        const endOffset = startLoc.offset + length;

        let range = this.#options.ranges ? {
            range: /** @type {Range} */ ([startLoc.offset, endOffset])
        } : undefined;

        return {
            type: tokenType,
            loc: {
                start: startLoc,
                end: endLoc || {
                    line: startLoc.line,
                    column: startLoc.column + length,
                    offset: endOffset
                }
            },
            ...range
        };        
    }

    /**
     * Reads in a specific number of hex digits.
     * @param {number} count The number of hex digits to read.
     * @returns {string} The hex digits read.
     */
    #readHexDigits(count) {
        let value = "";
        let c;

        for (let i = 0; i < count; i++) {
            c = this.#reader.peek();
            if (isHexDigit(c)) {
                this.#reader.next();
                value += String.fromCharCode(c);
                continue;
            }

            this.#unexpected(c);
        }

        return value;
    }

    /**
     * Reads in a JSON5 identifier. Also used for JSON but we validate
     * the identifier later.
     * @param {number} c The first character of the identifier.
     * @returns {string} The identifier read.
     * @throws {UnexpectedChar} when the identifier cannot be read.
     */
    #readIdentifier(c) {
        let value = "";

        do {

            value += String.fromCharCode(c);

            if (c === CHAR_BACKSLASH) {

                c = this.#reader.next();

                if (c !== CHAR_LOWER_U) {
                    this.#unexpected(c);
                }

                value += String.fromCharCode(c);

                const hexDigits = this.#readHexDigits(4);

                // check for a valid character code
                const charCode = parseInt(hexDigits, 16);

                if (value.length === 2 && !isJSON5IdentifierStart(charCode)) {
                    const loc = this.#reader.locate();
                    this.#unexpected(CHAR_BACKSLASH, { line: loc.line, column: loc.column - 5, offset: loc.offset - 5 });
                } else if (!isJSON5IdentifierPart(charCode)) {
                    const loc = this.#reader.locate();
                    this.#unexpected(charCode, { line: loc.line, column: loc.column - 5, offset: loc.offset - 5 });
                }

                value += hexDigits;
            }

            c = this.#reader.peek();

            if (!isJSON5IdentifierPart(c)) {
                break;
            }

            this.#reader.next();

        } while (true);  // eslint-disable-line no-constant-condition

        return value;
    }

    /**
     * Reads in a string. Works for both JSON and JSON5.
     * @param {number} c The first character of the string (either " or ').
     * @returns {number} The length of the string.
     * @throws {UnexpectedChar} when the string cannot be read.
     * @throws {UnexpectedEOF} when EOF is reached before the string is finalized.
     */
    #readString(c) {
        
        const delimiter = c;
        let length = 1;
        c = this.#reader.peek();

        while (c !== -1 && c !== delimiter) {

            this.#reader.next();
            length++;

            // escapes
            if (c === CHAR_BACKSLASH) {
                c = this.#reader.peek();

                if (this.#isEscapedCharacter(c) || this.#isJSON5LineTerminator(c)) {
                    this.#reader.next();
                    length++;
                } else if (c === CHAR_LOWER_U) {
                    this.#reader.next();
                    length++;

                    const result = this.#readHexDigits(4);
                    length += result.length;
                } else if (this.#isJSON5HexEscape(c)) {
                    this.#reader.next();
                    length++;

                    // hex escapes: \xHH
                    const result = this.#readHexDigits(2);
                    length += result.length;
                } else if (this.#json5) {  // JSON doesn't allow anything else
                    this.#reader.next();
                    length++;
                } else {
                    this.#unexpected(c);
                }
            }

            c = this.#reader.peek();
        }

        if (c === -1) {
            this.#reader.next();
            this.#unexpectedEOF();
        }

        // c is the delimiter
        this.#reader.next();
        length++;

        return length;
    
    
    }

    /**
     * Reads a number. Works for both JSON and JSON5.
     * @param {number} c The first character of the number.
     * @returns {number} The length of the number.
     * @throws {UnexpectedChar} when the number cannot be read.
     * @throws {UnexpectedEOF} when EOF is reached before the number is finalized.
     */
    #readNumber(c) {
        
        // we've already read the first character
        let length = 1;

        // JSON number may start with a minus but not a plus
        // JSON5 allows a plus.
        if (c === CHAR_MINUS || this.#json5 && c === CHAR_PLUS) {
            
            c = this.#reader.peek();
            
            /*
            * JSON5 allows Infinity or NaN preceded by a sign.
            * This blocks handles +Infinity, -Infinity, +NaN, and -NaN.
            * Standalone Infinity and NaN are handled in `readJSON5Identifier()`
            */
            if (this.#json5) {

                if (c === CHAR_UPPER_I || c === CHAR_UPPER_N) {
                    this.#reader.next();
                    const identifier = this.#readIdentifier(c);

                    if (identifier !== INFINITY && identifier !== NAN) {
                        this.#unexpected(c);
                    }

                    return length + identifier.length;
                }
            }

            // Next digit cannot be zero
            if (!isDigit(c)) {
                this.#unexpected(c);
            }

            // if we made it here, we need to continue on, so register the character
            this.#reader.next();
            length++;
        }

        /*
        * In JSON, a zero must be followed by a decimal point or nothing.
        * In JSON5, a zero can additionally be followed by an `x` indicating
        * that it's a hexadecimal number.
        */
        if (c === CHAR_0) {

            // c = this.#reader.next();
            // length++;
            c = this.#reader.peek();

            // check for a hex number
            if (this.#json5 && (c === CHAR_LOWER_X || c === CHAR_UPPER_X)) {

                this.#reader.next();
                length++;

                c = this.#reader.peek();

                if (!isHexDigit(c)) {
                    this.#reader.next();
                    this.#unexpected(c);
                }

                do {
                    this.#reader.next();
                    length++;
                    c = this.#reader.peek();
                } while (isHexDigit(c));

            } else if (isDigit(c)) {
                this.#unexpected(c);
            }

        } else {

            // JSON5 allows leading decimal points
            if (!this.#json5 || c !== CHAR_DOT) {
                if (!isPositiveDigit(c)) {
                    this.#unexpected(c);
                }

                c = this.#reader.peek();

                while (isDigit(c)) {
                    this.#reader.next();
                    length++;
                    c = this.#reader.peek();
                }
            }
        }

        /*
        * In JSON, a decimal point must be followed by at least one digit.
        * In JSON5, a decimal point need not be followed by any digits.
        */
        if (c === CHAR_DOT) {
                                
            let digitCount = -1;
            this.#reader.next();
            length++;
            digitCount++;

            c = this.#reader.peek();

            while (isDigit(c)) {
                this.#reader.next();
                length++;
                digitCount++;
                c = this.#reader.peek();
            }

            if (!this.#json5 && digitCount === 0) {
                this.#reader.next();
                if (c) {
                    this.#unexpected(c);
                } else {
                    this.#unexpectedEOF();
                }
            }
        }

        // Exponent is always last
        if (c === CHAR_LOWER_E || c === CHAR_UPPER_E) {

            this.#reader.next();
            length++;
            c = this.#reader.peek();

            if (c === CHAR_PLUS || c === CHAR_MINUS) {
                this.#reader.next();
                length++;
                c = this.#reader.peek();
            }

            /*
            * Must always have a digit in this position to avoid:
            * 5e
            * 12E+
            * 42e-
            */
            if (c === -1) {
                this.#reader.next();
                this.#unexpectedEOF();
            }

            if (!isDigit(c)) {
                this.#reader.next();
                this.#unexpected(c);
            }

            while (isDigit(c)) {
                this.#reader.next();
                length++;
                c = this.#reader.peek();
            }
        }

        return length;
    }

    /**
     * Reads a comment. Works for both JSON and JSON5.
     * @param {number} c The first character of the comment.
     * @returns {{length: number, multiline: boolean}} The length of the comment, and whether the comment is multi-line.
     * @throws {UnexpectedChar} when the comment cannot be read.
     * @throws {UnexpectedEOF} when EOF is reached before the comment is finalized.
     */ 
    #readComment(c) {
        
        let length = 1;

        // next character determines single- or multi-line
        c = this.#reader.peek();

        // single-line comments
        if (c === CHAR_SLASH) {
            
            do {
                this.#reader.next();
                length += 1;
                c = this.#reader.peek();
            } while (c > -1 && c !== CHAR_RETURN && c !== CHAR_NEWLINE);

            return { length, multiline: false };
        }

        // multi-line comments
        if (c === CHAR_STAR) {

            this.#reader.next();
            length += 1;

            while (c > -1) {
                c = this.#reader.peek();

                // check for end of comment
                if (c === CHAR_STAR) {
                    this.#reader.next();
                    length += 1;
                    c = this.#reader.peek();
                    
                    //end of comment
                    if (c === CHAR_SLASH) {
                        this.#reader.next();
                        length += 1;

                        return { length, multiline: true };
                    }
                } else {
                    this.#reader.next();
                    length += 1;
                }
            }

            this.#reader.next();
            this.#unexpectedEOF();
            
        }

        // if we've made it here, there's an invalid character
        this.#reader.next();
        this.#unexpected(c);        
    }
    // #endregion

    /**
     * Returns the next token in the source text.
     * @returns {number} The code for the next token.
     */
    next() {

        let c = this.#reader.next();

        while (this.#isWhitespace(c)) {
            c = this.#reader.next();
        }

        if (c === -1) {
            return tt.EOF;
        }

        const start = this.#reader.locate();
        const ct = String.fromCharCode(c);

        // check for JSON5 syntax only
        if (this.#json5) {
                
            if (knownJSON5TokenTypes.has(ct)) {
                this.#token = this.#createToken(knownJSON5TokenTypes.get(ct), 1, start);
            } else if (isJSON5IdentifierStart(c)) {
                const value = this.#readIdentifier(c);

                if (knownJSON5TokenTypes.has(value)) {
                    this.#token = this.#createToken(knownJSON5TokenTypes.get(value), value.length, start);
                } else {
                    this.#token = this.#createToken("Identifier", value.length, start);
                }
            } else if (isJSON5NumberStart(c)) {
                const result = this.#readNumber(c);
                this.#token = this.#createToken("Number", result, start);
            } else if (isStringStart(c, this.#json5)) {
                const result = this.#readString(c);
                const lastCharLoc = this.#reader.locate();
                this.#token = this.#createToken("String", result, start, {
                    line: lastCharLoc.line,
                    column: lastCharLoc.column + 1,
                    offset: lastCharLoc.offset + 1
                });
            } else if (c === CHAR_SLASH && this.#allowComments) {
                const result = this.#readComment(c);
                const lastCharLoc = this.#reader.locate();
                this.#token = this.#createToken(!result.multiline ? "LineComment" : "BlockComment", result.length, start, {
                    line: lastCharLoc.line,
                    column: lastCharLoc.column + 1,
                    offset: lastCharLoc.offset + 1
                });
            } else {
                this.#unexpected(c);
            }

        } else {

            // check for JSON/JSONC syntax only
            if (knownTokenTypes.has(ct)) {
                this.#token = this.#createToken(knownTokenTypes.get(ct), 1, start);
            } else if (isKeywordStart(c)) {
                const value = this.#readIdentifier(c);

                if (!jsonKeywords.has(value)) {
                    this.#unexpectedIdentifier(value, start);
                }

                this.#token = this.#createToken(knownTokenTypes.get(value), value.length, start);
            } else if (isNumberStart(c)) {
                const result = this.#readNumber(c);
                this.#token = this.#createToken("Number", result, start);
            } else if (isStringStart(c, this.#json5)) {
                const result = this.#readString(c);
                this.#token = this.#createToken("String", result, start);
            } else if (c === CHAR_SLASH && this.#allowComments) {
                const result = this.#readComment(c);
                const lastCharLoc = this.#reader.locate();
                this.#token = this.#createToken(!result.multiline ? "LineComment" : "BlockComment", result.length, start, {
                    line: lastCharLoc.line,
                    column: lastCharLoc.column + 1,
                    offset: lastCharLoc.offset + 1
                });
            } else {
                this.#unexpected(c);
            }
        }
        return tt[this.#token.type];
    }

    /**
     * Returns the current token in the source text.
     * @returns {Token} The current token.
     */
    get token() {
        return this.#token;
    }
}

//-----------------------------------------------------------------------------
// Main
//-----------------------------------------------------------------------------

/**
 * Creates an iterator over the tokens representing the source text.
 * @param {string} text The source text to tokenize.
 * @param {TokenizeOptions} [options] Options for doing the tokenization.
 * @returns {Array<Token>} An iterator over the tokens. 
 */
function tokenize(text, options) {

    const tokenizer = new Tokenizer(text, options);
    const tokens = [];

    while (tokenizer.next() !== tt.EOF) {
        tokens.push(tokenizer.token);
    }

    return tokens;

}

/**
 * @fileoverview  JSON AST types
 * @author Nicholas C. Zakas
 */

//-----------------------------------------------------------------------------
// Typedefs
//-----------------------------------------------------------------------------

/** @typedef {import("./typedefs.js").LocationRange} LocationRange */
/** @typedef {import("./typedefs.js").NodeParts} NodeParts */
/** @typedef {import("./typedefs.js").DocumentNode} DocumentNode */
/** @typedef {import("./typedefs.js").StringNode} StringNode */
/** @typedef {import("./typedefs.js").NumberNode} NumberNode */
/** @typedef {import("./typedefs.js").BooleanNode} BooleanNode */
/** @typedef {import("./typedefs.js").MemberNode} MemberNode */
/** @typedef {import("./typedefs.js").ObjectNode} ObjectNode */
/** @typedef {import("./typedefs.js").ElementNode} ElementNode */
/** @typedef {import("./typedefs.js").ArrayNode} ArrayNode */
/** @typedef {import("./typedefs.js").NullNode} NullNode */
/** @typedef {import("./typedefs.js").ValueNode} ValueNode */
/** @typedef {import("./typedefs.js").IdentifierNode} IdentifierNode */
/** @typedef {import("./typedefs.js").NaNNode} NaNNode */
/** @typedef {import("./typedefs.js").InfinityNode} InfinityNode */
/** @typedef {import("./typedefs.js").Sign} Sign */

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

const types = {

    /**
     * Creates a document node.
     * @param {ValueNode} body The body of the document.
     * @param {NodeParts} parts Additional properties for the node. 
     * @returns {DocumentNode} The document node.
     */
    document(body, parts = {}) {
        return {
            type: "Document",
            body,
            loc: parts.loc,
            ...parts
        };
    },

    /**
     * Creates a string node.
     * @param {string} value The value for the string.
     * @param {NodeParts} parts Additional properties for the node. 
     * @returns {StringNode} The string node.
     */
    string(value, parts = {}) {
        return {
            type: "String",
            value,
            loc: parts.loc,
            ...parts
        };
    },

    /**
     * Creates a number node.
     * @param {number} value The value for the number.
     * @param {NodeParts} parts Additional properties for the node. 
     * @returns {NumberNode} The number node.
     */
    number(value, parts = {}) {
        return {
            type: "Number",
            value,
            loc: parts.loc,
            ...parts
        };
    },

    /**
     * Creates a boolean node.
     * @param {boolean} value The value for the boolean.
     * @param {NodeParts} parts Additional properties for the node. 
     * @returns {BooleanNode} The boolean node.
     */
    boolean(value, parts = {}) {
        return {
            type: "Boolean",
            value,
            loc: parts.loc,
            ...parts
        };
    },

    /**
     * Creates a null node.
     * @param {NodeParts} parts Additional properties for the node. 
     * @returns {NullNode} The null node.
     */
    null(parts = {}) {
        return {
            type: "Null",
            loc: parts.loc,
            ...parts
        };
    },

    /**
     * Creates an array node.
     * @param {Array<ElementNode>} elements The elements to add.
     * @param {NodeParts} parts Additional properties for the node. 
     * @returns {ArrayNode} The array node.
     */
    array(elements, parts = {}) {
        return {
            type: "Array",
            elements,
            loc: parts.loc,
            ...parts
        };
    },

    /**
     * Creates an element node.
     * @param {ValueNode} value The value for the element.
     * @param {NodeParts} parts Additional properties for the node. 
     * @returns {ElementNode} The element node.
     */
    element(value, parts = {}) {
        return {
            type: "Element",
            value,
            loc: parts.loc,
            ...parts
        };
    },

    /**
     * Creates an object node.
     * @param {Array<MemberNode>} members The members to add.
     * @param {NodeParts} parts Additional properties for the node. 
     * @returns {ObjectNode} The object node.
     */
    object(members, parts = {}) {
        return {
            type: "Object",
            members,
            loc: parts.loc,
            ...parts
        };
    },

    /**
     * Creates a member node.
     * @param {StringNode|IdentifierNode} name The name for the member.
     * @param {ValueNode} value The value for the member.
     * @param {NodeParts} parts Additional properties for the node. 
     * @returns {MemberNode} The member node.
     */
    member(name, value, parts = {}) {
        return {
            type: "Member",
            name,
            value,
            loc: parts.loc,
            ...parts
        };
    },

    /**
     * Creates an identifier node.
     * @param {string} name The name for the identifier.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {IdentifierNode} The identifier node.
     */
    identifier(name, parts = {}) {
        return {
            type: "Identifier",
            name,
            loc: parts.loc,
            ...parts
        };
    },

    /**
     * Creates a NaN node.
     * @param {Sign} sign The sign for the Infinity.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {NaNNode} The NaN node.
     */ 
    nan(sign = "", parts = {}) {
        return {
            type: "NaN",
            sign,
            loc: parts.loc,
            ...parts
        };
    },

    /**
     * Creates an Infinity node.
     * @param {Sign} sign The sign for the Infinity.
     * @param {NodeParts} parts Additional properties for the node.
     * @returns {InfinityNode} The Infinity node.
     */
    infinity(sign = "", parts = {}) {
        return {
            type: "Infinity",
            sign,
            loc: parts.loc,
            ...parts
        };
    },

};

/**
 * @fileoverview JSON parser
 * @author Nicholas C. Zakas
 */


//-----------------------------------------------------------------------------
// Typedefs
//-----------------------------------------------------------------------------

/** @typedef {import("./typedefs.js").Node} Node */
/** @typedef {import("./typedefs.js").Mode} Mode */
/** @typedef {import("./typedefs.js").ParseOptions} ParseOptions */

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

/** @type {ParseOptions} */
const DEFAULT_OPTIONS = {
    mode: "json",
    ranges: false,
    tokens: false,
    allowTrailingCommas: false
};

const UNICODE_SEQUENCE = /\\u[\da-fA-F]{4}/gu;

/**
 * Normalizes a JSON5 identifier by converting Unicode escape sequences into
 * their corresponding characters.
 * @param {string} identifier The identifier to normalize.
 * @returns {string} The normalized identifier.
 */
function normalizeIdentifier(identifier) {
    return identifier.replace(UNICODE_SEQUENCE, unicodeEscape => {
        return String.fromCharCode(parseInt(unicodeEscape.slice(2), 16));
    });
}

/**
 * Calculates the location at the end of the given text.
 * @param {string} text The text to calculate the end location for.
 * @returns {Location} The location at the end of the text.
 */
function getEndLocation(text) {
    let line = 1;
    let column = 1;
    
    for (let i = 0; i < text.length; i++) {
        const char = text[i];
        if (char === "\n") {
            line++;
            column = 1;
        } else if (char === "\r") {
            // Handle \r\n as a single line ending
            if (text[i + 1] === "\n") {
                i++; // Skip the \n
            }
            line++;
            column = 1;
        } else {
            column++;
        }
    }
    
    return {
        line,
        column,
        offset: text.length
    };
}

/**
 * Converts a JSON-encoded string into a JavaScript string, interpreting each
 * escape sequence.
 * @param {string} value The text for the token.
 * @param {Token} token The string token to convert into a JavaScript string.
 * @param {boolean} json5 `true` if parsing JSON5, `false` otherwise.
 * @returns {string} A JavaScript string.
 */
function getStringValue(value, token, json5 = false) {
    
    let result = "";
    let escapeIndex = value.indexOf("\\");
    let lastIndex = 0;

    // While there are escapes, interpret them to build up the result
    while (escapeIndex >= 0) {

        // append the text that happened before the escape
        result += value.slice(lastIndex, escapeIndex);

        // get the character immediately after the \
        const escapeChar = value.charAt(escapeIndex + 1);
        const escapeCharCode = escapeChar.charCodeAt(0);
        
        // check for the non-Unicode escape sequences first
        if (json5 && json5EscapeToChar.has(escapeCharCode)) {
            result += json5EscapeToChar.get(escapeCharCode);
            lastIndex = escapeIndex + 2;
        } else if (escapeToChar.has(escapeCharCode)) {
            result += escapeToChar.get(escapeCharCode);
            lastIndex = escapeIndex + 2;
        } else if (escapeChar === "u") {
            const hexCode = value.slice(escapeIndex + 2, escapeIndex + 6);
            if (hexCode.length < 4 || /[^0-9a-f]/i.test(hexCode)) {
                throw new ErrorWithLocation(
                    `Invalid unicode escape \\u${ hexCode}.`,
                    {
                        line: token.loc.start.line,
                        column: token.loc.start.column + escapeIndex,
                        offset: token.loc.start.offset + escapeIndex
                    }
                );
            }

            result += String.fromCharCode(parseInt(hexCode, 16));
            lastIndex = escapeIndex + 6;
        } else if (json5 && escapeChar === "x") {
            const hexCode = value.slice(escapeIndex + 2, escapeIndex + 4);
            if (hexCode.length < 2 || /[^0-9a-f]/i.test(hexCode)) {
                throw new ErrorWithLocation(
                    `Invalid hex escape \\x${ hexCode}.`,
                    {
                        line: token.loc.start.line,
                        column: token.loc.start.column + escapeIndex,
                        offset: token.loc.start.offset + escapeIndex
                    }
                );
            }

            result += String.fromCharCode(parseInt(hexCode, 16));
            lastIndex = escapeIndex + 4;
        } else if (json5 && json5LineTerminators.has(escapeCharCode)) {
            lastIndex = escapeIndex + 2;

            // we also need to skip \n after a \r
            if (escapeChar === "\r" && value.charAt(lastIndex) === "\n") {
                lastIndex++;
            }
            
        } else {
            // all characters can be escaped in JSON5
            if (json5) {
                result += escapeChar;
                lastIndex = escapeIndex + 2;
            } else {
                throw new ErrorWithLocation(
                    `Invalid escape \\${ escapeChar }.`,
                    {
                        line: token.loc.start.line,
                        column: token.loc.start.column + escapeIndex,
                        offset: token.loc.start.offset + escapeIndex
                    }
                );
            }
        }

        // find the next escape sequence
        escapeIndex = value.indexOf("\\", lastIndex);
    }

    // get the last segment of the string value
    result += value.slice(lastIndex);

    return result;
}

/**
 * Gets the JavaScript value represented by a JSON token.
 * @param {string} value The text value of the token.
 * @param {Token} token The JSON token to get a value for.
 * @param {boolean} json5 `true` if parsing JSON5, `false` otherwise.
 * @returns {string|boolean|number} A number, string, or boolean.
 * @throws {TypeError} If an unknown token type is found. 
 */
function getLiteralValue(value, token, json5 = false) {
    switch (token.type) {
        case "Boolean":
            return value === "true";
            
        case "Number":
            if (json5) {

                /*
                 * Numbers like -0x1 are converted to NaN by Number(), so we need
                 * to handle them separately. Rather than checking for -0x, we can
                 * just check if the first character is a minus sign. The same for
                 * checking for +0x.
                 */

                if (value.charCodeAt(0) === 45) { // 45 is the char code for '-'
                    return -Number(value.slice(1));
                }

                if (value.charCodeAt(0) === 43) { // 43 is the char code for '+'
                    return Number(value.slice(1));
                }
            }
            return Number(value);

        case "String":
            return getStringValue(value.slice(1, -1), token, json5);

        default:
            throw new TypeError(`Unknown token type "${token.type}.`);
    }
}

//-----------------------------------------------------------------------------
// Main Function
//--------------------------------g&---------------------------------------------

/**
 * 
 * @param {string} text The text to parse.
 * @param {ParseOptions} [options] The options object.
 * @returns {DocumentNode} The AST representing the parsed JSON.
 * @throws {Error} When there is a parsing error. 
 */
function parse(text, options) {

    options = Object.freeze({
        ...DEFAULT_OPTIONS,
        ...options
    });

    const tokens = [];
    const tokenizer = new Tokenizer(text, {
        mode: options.mode,
        ranges: options.ranges
    });

    const json5 = options.mode === "json5";
    const allowTrailingCommas = options.allowTrailingCommas || json5;

    /**
     * Returns the next token knowing there are no comments.
     * @returns {number} The next token type or 0 if no next token.
     */
    function nextNoComments() {
        const nextType = tokenizer.next();

        if (nextType && options.tokens) {
            tokens.push(tokenizer.token);
        }
        return nextType;
    }
    
    /**
     * Returns the next token knowing there are comments to skip.
     * @returns {number} The next token type or 0 if no next token.
     */
    function nextSkipComments() {
        const nextType = tokenizer.next();
        if (nextType && options.tokens) {
            tokens.push(tokenizer.token);
        }

        if (nextType >= tt.LineComment) {
            return nextSkipComments();
        }

        return nextType;

    }

    // determine correct way to evaluate tokens based on presence of comments
    const next = options.mode === "json" ? nextNoComments : nextSkipComments;

    /**
     * Asserts a token has the given type.
     * @param {number} token The token to check.
     * @param {number} type The token type.
     * @throws {UnexpectedToken} If the token type isn't expected.
     * @returns {void}
     */
    function assertTokenType(token, type) {
        if (token !== type) {
            throw new UnexpectedToken(tokenizer.token);
        }
    }

    /**
     * Asserts a token has one of the given types.
     * @param {number} token The token to check.
     * @param {number[]} types The token types.
     * @returns {void}
     * @throws {UnexpectedToken} If the token type isn't expected.
     */ 
    function assertTokenTypes(token, types) {
        if (!types.includes(token)) {
            throw new UnexpectedToken(tokenizer.token);
        }
    }

    /**
     * Creates a range only if ranges are specified.
     * @param {Location} start The start offset for the range.
     * @param {Location} end The end offset for the range.
     * @returns {{range:[number,number]}|undefined} An object with a 
     */
    function createRange(start, end) {
        // @ts-ignore tsc incorrect - options might be undefined
        return options.ranges ? {
            range: [start.offset, end.offset]
        } : undefined;
    }

    /**
     * Creates a node for a string, boolean, or number.
     * @param {number} tokenType The token representing the literal. 
     * @returns {StringNode|NumberNode|BooleanNode} The node representing
     *      the value.
     */
    function createLiteralNode(tokenType) {
        const token = tokenizer.token;
        const range = createRange(token.loc.start, token.loc.end);
        const value = getLiteralValue(
            text.slice(token.loc.start.offset, token.loc.end.offset),
            token,
            json5
        );
        const loc = {
            start: {
                ...token.loc.start
            },
            end: {
                ...token.loc.end
            }
        };
        const parts = { loc, ...range };

        switch (tokenType) {
            case tt.String:
                return types.string(/** @type {string} */ (value), parts);

            case tt.Number:
                return types.number(/** @type {number} */ (value), parts);
                
            case tt.Boolean:
                return types.boolean(/** @type {boolean} */ (value), parts);

            default:
                throw new TypeError(`Unknown token type ${token.type}.`);
        }
    }

    /**
     * Creates a node for a JSON5 identifier.
     * @param {Token} token The token representing the identifer. 
     * @returns {NaNNode|InfinityNode|IdentifierNode} The node representing
     *      the value.
     */
    function createJSON5IdentifierNode(token) {
        const range = createRange(token.loc.start, token.loc.end);
        const identifier = text.slice(token.loc.start.offset, token.loc.end.offset);
        const loc = {
            start: {
                ...token.loc.start
            },
            end: {
                ...token.loc.end
            }
        };
        const parts = { loc, ...range };

        // Check for NaN or Infinity
        if (token.type !== "Identifier") {

            let sign = "";

            // check if the first character in the token is a plus or minus
            if (identifier[0] === "+" || identifier[0] === "-") {
                sign = identifier[0];
            }

            // check if the token is NaN or Infinity
            return types[identifier.includes("NaN") ? "nan" : "infinity"](/** @type {Sign} */ (sign), parts);
        }
        return types.identifier(normalizeIdentifier(identifier), parts);
    }

    /**
     * Creates a node for a null.
     * @param {Token} token The token representing null. 
     * @returns {NullNode} The node representing null.
     */
    function createNullNode(token) {
        const range = createRange(token.loc.start, token.loc.end);

        return types.null({
            loc: {
                start: {
                    ...token.loc.start
                },
                end: {
                    ...token.loc.end
                }
            },
            ...range
        });
    }


    /**
     * Parses a property in an object.
     * @param {number} tokenType The token representing the property.
     * @returns {MemberNode} The node representing the property.
     * @throws {UnexpectedToken} When an unexpected token is found.
     * @throws {UnexpectedEOF} When the end of the file is reached.
     */
    function parseProperty(tokenType) {

        if (json5) {
            assertTokenTypes(tokenType, [tt.String, tt.Identifier, tt.Number]);
        } else {
            assertTokenType(tokenType, tt.String);
        }

        const token = tokenizer.token;

        // check for -NaN, +NaN, -Infinity, +Infinity, and any number
        if (json5 && tokenType === tt.Number && /[+\-0-9]/.test(text[token.loc.start.offset])) {
            throw new UnexpectedToken(token);
        }

        // TODO: Clean this up a bit
        let key = tokenType === tt.String
            ? /** @type {StringNode} */ (createLiteralNode(tokenType))
            : /** @type {IdentifierNode|NaNNode|InfinityNode} */ (createJSON5IdentifierNode(token));

        // in JSON5, need to check for NaN and Infinity and create identifier nodes
        if (json5 && (key.type === "NaN" || key.type === "Infinity")) {

            // NaN and Infinity cannot be signed and be a property key
            if (key.sign !== "") {
                throw new UnexpectedToken(tokenizer.token);
            }

            key = types.identifier(key.type, { loc: key.loc, ...createRange(key.loc.start, key.loc.end) });
        }

        tokenType = next();
        assertTokenType(tokenType, tt.Colon);
        const value = parseValue();
        const range = createRange(key.loc.start, value.loc.end);

        return types.member(
            /** @type {StringNode|IdentifierNode} */ (key),
            /** @type {ValueNode} */ (value),
            {
                loc: {
                    start: {
                        ...key.loc.start
                    },
                    end: {
                        ...value.loc.end
                    }
                },
                ...range
            }
        );
    }

    /**
     * Parses an object literal.
     * @param {number} firstTokenType The first token type in the object.
     * @returns {ObjectNode} The object node.
     * @throws {UnexpectedEOF} When the end of the file is reached.
     * @throws {UnexpectedToken} When an unexpected token is found.
     */
    function parseObject(firstTokenType) {

        // The first token must be a { or else it's an error
        assertTokenType(firstTokenType, tt.LBrace);

        const firstToken = tokenizer.token;
        const members = [];
        let tokenType = next();

        if (tokenType !== tt.RBrace) {
            do {
    
                // add the value into the array
                members.push(parseProperty(tokenType));
    
                tokenType = next();

                if (!tokenType) {
                    throw new UnexpectedEOF(members[members.length-1].loc.end);
                }
    
                if (tokenType === tt.Comma) {
                    tokenType = next();

                    /*
                      * Trailing commas.
                      * So we need to check if the token is a comma,
                      * and if so, then we need to check if the next
                      * token is a RBrace. If it is, then we need to
                      * break out of the loop.
                      */
                    if (allowTrailingCommas && tokenType === tt.RBrace) {
                        break;
                    }                      
                } else {
                    break;
                }
            } while (tokenType);
        }

        assertTokenType(tokenType, tt.RBrace);
        const lastToken = tokenizer.token;
        const range = createRange(firstToken.loc.start, lastToken.loc.end);

        return types.object(members, {
            loc: {
                start: {
                    ...firstToken.loc.start
                },
                end: {
                    ...lastToken.loc.end
                }
            },
            ...range
        });

    }

    /**
     * Parses an array literal.
     * @param {number} firstTokenType The first token in the array.
     * @returns {ArrayNode} The array node.
     * @throws {UnexpectedToken} When an unexpected token is found.
     * @throws {UnexpectedEOF} When the end of the file is reached.
     */
    function parseArray(firstTokenType) {

        // The first token must be a [ or else it's an error
        assertTokenType(firstTokenType, tt.LBracket);

        const firstToken = tokenizer.token;
        const elements = [];
        let tokenType = next();
        
        if (tokenType !== tt.RBracket) {

            do {

                // add the value into the array
                const value = parseValue(tokenType);

                elements.push(types.element(
                    /** @type {ValueNode} */ (value),
                    { loc: value.loc }
                ));

                tokenType = next();
              
                if (tokenType === tt.Comma) {
                    tokenType = next();

                    /*
                      * Trailing commas.
                      * So we need to check if the token is a comma,
                      * and if so, then we need to check if the next
                      * token is a RBracket. If it is, then we need to
                      * break out of the loop.
                      */
                    if (allowTrailingCommas && tokenType === tt.RBracket) {
                        break;
                    }                    
                } else {
                    break;
                }
            } while (tokenType);
        }

        assertTokenType(tokenType, tt.RBracket);

        const lastToken = tokenizer.token;
        const range = createRange(firstToken.loc.start, lastToken.loc.end);

        return types.array(elements, {
            loc: {
                start: {
                    ...firstToken.loc.start
                },
                end: {
                    ...lastToken.loc.end
                }
            },
            ...range
        });

    }

    /**
     * Parses a JSON value.
     * @param {number} [tokenType] The token type to parse.
     * @returns {ValueNode|IdentifierNode} The node representing the value.
     */
    function parseValue(tokenType) {

        tokenType = tokenType ?? next();
        const token = tokenizer.token;
        
        switch (tokenType) {
            case tt.String:
            case tt.Boolean:
                return createLiteralNode(tokenType);

            case tt.Number:
                if (json5) {
                    let tokenText = text.slice(token.loc.start.offset, token.loc.end.offset);
                    if (tokenText[0] === "+" || tokenText[0] === "-") {
                        tokenText = tokenText.slice(1);
                    }

                    if (tokenText === "NaN" || tokenText === "Infinity") {
                        return createJSON5IdentifierNode(token);
                    }
                }
                return createLiteralNode(tokenType);

            case tt.Null:
                return createNullNode(token);

            case tt.LBrace:
                return parseObject(tokenType);

            case tt.LBracket:
                return parseArray(tokenType);

            default:
                throw new UnexpectedToken(token);
        }

    }

    
    const docBody = parseValue();
    
    const unexpectedToken = next();
    if (unexpectedToken) {
        throw new UnexpectedToken(tokenizer.token);
    }
    
    
    const textEndLocation = getEndLocation(text);
    const docParts = {
        loc: {
            start: {
                line: 1,
                column: 1,
                offset: 0
            },
            end: {
                ...textEndLocation
            }
        }
    };
    
    if (options.tokens) {
        docParts.tokens = tokens;
    }

    if (options.ranges) {
        docParts.range = [
            docParts.loc.start.offset,
            docParts.loc.end.offset
        ];
    }

    return types.document(/** @type {ValueNode} */ (docBody), docParts);
}

/**
 * @fileoverview Traversal approaches for Momoa JSON AST.
 * @author Nicholas C. Zakas
 */

//-----------------------------------------------------------------------------
// Typedefs
//-----------------------------------------------------------------------------

/** @typedef {import("./typedefs.js").TraversalPhase} TraversalPhase */
/**
 * @typedef {Object} TraversalVisitor
 * @property {(node: Node, parent?: Node) => void} [enter]
 * @property {(node: Node, parent?: Node) => void} [exit]
 */

//-----------------------------------------------------------------------------
// Data
//-----------------------------------------------------------------------------

const childKeys = new Map([
    ["Document", ["body"]],
    ["Object", ["members"]],
    ["Member", ["name", "value"]],
    ["Element", ["value"]],
    ["Array", ["elements"]],
    ["String", []],
    ["Number", []],
    ["Boolean", []],
    ["Null", []],
    ["NaN", []],
    ["Infinity", []],
    ["Identifier", []],
]);

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

/**
 * Determines if a given value is an object.
 * @param {*} value The value to check.
 * @returns {boolean} True if the value is an object, false if not. 
 */
function isObject(value) {
    return value && (typeof value === "object");
}

/**
 * Determines if a given value is an AST node.
 * @param {*} value The value to check.
 * @returns {boolean} True if the value is a node, false if not. 
 */
function isNode(value) {
    return isObject(value) && (typeof value.type === "string");
}

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * Traverses an AST from the given node.
 * @param {Node} root The node to traverse from 
 * @param {TraversalVisitor} visitor An object with an `enter` and `exit` method. 
 */
function traverse(root, visitor) {

    /**
     * Recursively visits a node.
     * @param {Node} node The node to visit.
     * @param {Node} [parent] The parent of the node to visit.
     * @returns {void}
     */
    function visitNode(node, parent) {

        if (typeof visitor.enter === "function") {
            visitor.enter(node, parent);
        }

        for (const key of childKeys.get(node.type)) {
            const value = node[key];

            if (isObject(value)) {
                if (Array.isArray(value)) {
                    value.forEach(child => visitNode(child, node));
                } else if (isNode(value)) {
                    visitNode(value, node);
                }
            }
        }

        if (typeof visitor.exit === "function") {
            visitor.exit(node, parent);
        }
    }

    visitNode(root);
}

/**
 * @callback FilterPredicate
 * @param {{node: Node, parent?: Node, phase: TraversalPhase}} item
 * @param {number} index
 * @param {Array<{node: Node, parent?: Node, phase: TraversalPhase}>} array
 * @returns {boolean}
 */

/**
 * Creates an iterator over the given AST.
 * @param {Node} root The root AST node to traverse. 
 * @param {FilterPredicate} [filter] A filter function to determine which steps to
 *      return;
 * @returns {IterableIterator<{node: Node, parent?: Node, phase: TraversalPhase}>} An iterator over the AST.  
 */
function iterator(root, filter = () => true) {

    /** @type {Array<{node: Node, parent?: Node, phase: TraversalPhase}>} */
    const traversal = [];

    traverse(root, {
        enter(node, parent) {
            traversal.push({ node, parent, phase: "enter" });
        },
        exit(node, parent) {
            traversal.push({ node, parent, phase: "exit" });
        }
    });

    return traversal.filter(filter).values();
}

/**
 * @fileoverview Evaluator for Momoa AST.
 * @author Nicholas C. Zakas
 */

//-----------------------------------------------------------------------------
// Typedefs
//-----------------------------------------------------------------------------

/** @typedef {import("./typedefs.js").AnyNode} AnyNode */
/** @typedef {import("./typedefs.js").JSONValue} JSONValue */

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * Evaluates a Momoa AST node into a JavaScript value.
 * @param {AnyNode} node The node to interpet.
 * @returns {JSONValue} The JavaScript value for the node. 
 */
function evaluate(node) {
    switch (node.type) {
        case "String":
            return node.value;

        case "Number":
            return node.value;

        case "Boolean":
            return node.value;

        case "Null":
            return null;

        case "NaN":
            return NaN;
        
        case "Infinity":
            return node.sign === "-" ? -Infinity : Infinity;

        case "Identifier":
            return node.name;

        case "Array": {
            // const arrayNode = /** @type {ArrayNode} */ (node);
            return node.elements.map(element => evaluate(element.value));
        }

        case "Object": {

            /** @type {{[property: string]: JSONValue}} */
            const object = {};

            node.members.forEach(member => {
                object[/** @type {string} */ (evaluate(member.name))] = evaluate(member.value);
            });    

            return object;
        }    

        case "Document": {
            return evaluate(node.body);
        }

        case "Element":
            throw new Error("Cannot evaluate array element outside of an array.");

        case "Member":
            throw new Error("Cannot evaluate object member outside of an object.");

        default:
            // @ts-ignore tsc doesn't know about the type property here?
            throw new Error(`Unknown node type ${ node.type }.`);
    }
}

/**
 * @fileoverview Printer for Momoa AST.
 * @author Nicholas C. Zakas
 */


//-----------------------------------------------------------------------------
// Typedefs
//-----------------------------------------------------------------------------


//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

/**
 * Prints the string representation of a Boolean node.
 * @param {BooleanNode} node The node to print.
 * @returns {string} The boolean value.
 */
function printBoolean(node) {
    return node.value ? "true" : "false";
}

/**
 * Prints the string representation of a null node.
 * @returns {string} The string "null".
 */
function printNull() {
    return "null";
}

/**
 * Prints the string representation of a number node.
 * @param {NumberNode} node The node to print.
 * @returns {string} The number value.
 */
function printNumber(node) {
    return node.value.toString();
}

/**
 * Prints the string representation of a NaN node.
 * @returns {string} The string "NaN".
 */
function printNaN() {
    return "NaN";
}

/**
 * Prints the string representation of an Infinity node.
 * @param {InfinityNode} node The node to print.
 * @returns {string} The string "Infinity" or "-Infinity".
 */
function printInfinity(node) {
    return node.sign + "Infinity";
}

/**
 * Prints the string representation of a string node.
 * @param {StringNode} node The node to print.
 * @returns {string} The string value.
 */
function printString(node) {

    let result = "\"";

    // escape all characters that need escaping
    for (const c of node.value) {

        const newChar = json5CharToEscape.get(c);

        if (newChar) {
            result += "\\" + newChar;
            continue;
        }

        // if it's a double quote, escape it
        if (c === "\"") {
            result += "\\\"";
            continue;
        }

        // if it's a control character, escape it
        if (c < " " || c === "\u007F") {
            const hex = c.codePointAt(0).toString(16).toUpperCase();
            result += `\\u${"0000".substring(hex.length)}${hex}`;
            continue;
        }

        // otherwise, just add the character
        result += c;

    }
    
    return result + "\"";
}

/**
 * Prints the string representation of an identifier node.
 * @param {IdentifierNode} node The node to print.
 * @returns {string} The identifier name.
 */
function printIdentifier(node) {
    return node.name;
}

/**
 * Prints the string representation of an array node.
 * @param {ArrayNode} node The node to print.
 * @param {string} indent The string to use for indentation.
 * @param {number} indentLevel The current level of indentation.
 * @returns {string} The array value.
 */
function printArray(node, indent, indentLevel) {
    const newLine = indent ? "\n" : "";
    const indentString = indent.repeat(indentLevel);
    const elementIndentString = indent.repeat(indentLevel + 1);

    return `[${newLine}${
        node.elements.map(element =>
            `${elementIndentString}${printValue(element.value, indent, indentLevel + 1)}`
        ).join(`,${newLine}`)
    }${newLine}${indentString}]`;
}

/**
 * Prints the string representation of a member node.
 * @param {MemberNode} node The node to print.
 * @param {string} indent The string to use for indentation.
 * @param {number} indentLevel The current level of indentation.
 * @returns {string} The member value.
 */
function printMember(node, indent, indentLevel) {
    const space = indent ? " " : "";
    return `${printValue(node.name, indent, indentLevel)}:${space}${printValue(node.value, indent, indentLevel + 1)}`;
}

/**
 * Prints the string representation of an object node.
 * @param {ObjectNode} node The node to print.
 * @param {string} indent The string to use for indentation.
 * @param {number} indentLevel The current level of indentation.
 * @returns {string} The object value.
 */
function printObject(node, indent, indentLevel) {
    const newLine = indent ? "\n" : "";
    const indentString = indent.repeat(indentLevel);
    const memberIndentString = indent.repeat(indentLevel + 1);

    return `{${newLine}${
        node.members.map(member => 
            `${memberIndentString}${printMember(member, indent, indentLevel)}`
        ).join(`,${newLine}`)
    }${newLine}${indentString}}`;
}

/**
 * Prints the string representation of a node.
 * @param {AnyNode} node The node to print.
 * @param {string} indentString The string to use for indentation.
 * @param {number} indentLevel The current level of indentation.
 * @returns {string} The string representation of the node.
 * @throws {TypeError} If the node type is unknown.

 */
function printValue(node, indentString, indentLevel) {
    switch (node.type) {
        case "String":
            return printString(node);
        case "Number":
            return printNumber(node);
        case "Boolean":
            return printBoolean(node);
        case "Null":
            return printNull();
        case "NaN":
            return printNaN();
        case "Infinity":
            return printInfinity(node);
        case "Identifier":
            return printIdentifier(node);
        case "Array":
            return printArray(node, indentString, indentLevel);
        case "Object":
            return printObject(node, indentString, indentLevel);
        case "Document":
            return printValue(node.body, indentString, indentLevel);
        default:
            throw new TypeError(`Unknown node type: ${node.type}`);
    }
}


//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * Converts a Momoa AST back into a JSON string.
 * @param {AnyNode} node The node to print.
 * @param {Object} options Options for the print.
 * @param {number} [options.indent=0] The number of spaces to indent each line. If
 *      greater than 0, then newlines and indents will be added to output. 
 * @returns {string} The JSON representation of the AST.
 */
function print(node, { indent = 0 } = {}) {

    const indentLevel = 0;
    const indentString = " ".repeat(indent);

    return printValue(node, indentString, indentLevel);
}

export { evaluate, iterator, parse, print, tokenize, traverse, types, childKeys as visitorKeys };
"Իxd/**
 * @fileoverview Type definitions for the Momoa JSON parser.
 * @author Nicholas C. Zakas
 */
/**
 * The mode that Momoa runs in:
 * - "json" for regular JSON
 * - "jsonc" for JSON with C-style comments
 */
export type Mode = "json" | "jsonc" | "json5";
/**
 * The phase of the traversal step.
 */
export type TraversalPhase = "enter" | "exit";
/**
 * The type of a JSON5 Infinity or NaN value.
 * - "+" for positive Infinity or postive NaN
 * - "-" for negative Infinity or negative NaN
 * - "" for Infinity or NaN without a sign
 */
export type Sign = "+" | "-" | "";
/**
 * Tokenization options.
 */
export interface TokenizeOptions {
    /**
     * The mode to tokenize in.
     */
    readonly mode?: Mode;
    /**
     * When true, includes the `range` key on each token.
     */
    readonly ranges?: boolean;
}
/**
 * Parse options.
 */
export interface ParseOptions {
    /**
     * The mode to parse in.
     */
    readonly mode?: Mode;
    /**
     * When true, includes the `range` key on each node and token.
     */
    readonly ranges?: boolean;
    /**
     * When true, includes the `tokens` key on the document node containing
     * all of the tokens used during parsing.
     */
    readonly tokens?: boolean;
    /**
     * When true, allows trailing commas in arrays and objects. Defaults to
     * false for JSON and JSONC modes, and true for JSON5 mode.
     */
    readonly allowTrailingCommas?: boolean;
}
export interface Node {
    type: string;
    loc: LocationRange;
    range?: Range;
}
/**
 * The root node of a JSON document.
 */
export interface DocumentNode extends Node {
    type: "Document";
    body: ValueNode;
    tokens?: Array<Token>;
}
export interface NullNode extends Node {
    type: "Null";
}
interface LiteralNode<T> extends Node {
    value: T;
}
/**
 * Represents a JSON5 NaN value.
 */
export interface NaNNode extends Node {
    type: "NaN";
    sign: Sign;
}
/**
 * Represents a JSON5 Infinity value.
 */
export interface InfinityNode extends Node {
    type: "Infinity";
    sign: Sign;
}
/**
 * Represents a JSON identifier.
 */
export interface IdentifierNode extends Node {
    type: "Identifier";
    name: string;
}
/**
 * Represents a JSON string.
 */
export interface StringNode extends LiteralNode<string> {
    type: "String";
}
/**
 * Represents a JSON number.
 */
export interface NumberNode extends LiteralNode<number> {
    type: "Number";
}
/**
 * Represents a JSON boolean.
 */
export interface BooleanNode extends LiteralNode<boolean> {
    type: "Boolean";
}
/**
 * Represents an element of a JSON array.
 */
export interface ElementNode extends Node {
    type: "Element";
    value: ValueNode;
}
/**
 * Represents a JSON array.
 */
export interface ArrayNode extends Node {
    type: "Array";
    elements: Array<ElementNode>;
}
/**
 * Represents a member of a JSON object.
 */
export interface MemberNode extends Node {
    type: "Member";
    name: StringNode | IdentifierNode;
    value: ValueNode;
}
/**
 * Represents a JSON object.
 */
export interface ObjectNode extends Node {
    type: "Object";
    members: Array<MemberNode>;
}
/**
 * Any node that represents a JSON value.
 */
export type ValueNode = ArrayNode | ObjectNode | BooleanNode | StringNode | NumberNode | NullNode | NaNNode | InfinityNode;
/**
 * Any node that represents the container for a JSON value.
 */
export type ContainerNode = DocumentNode | MemberNode | ElementNode;
/**
 * Any node that represents a JSON5 extension.
 */
export type JSON5ExtensionNode = NaNNode | InfinityNode | IdentifierNode;
/**
 * Any valid AST node.
 */
export type AnyNode = ValueNode | ContainerNode | JSON5ExtensionNode;
/**
 * Additional information about an AST node.
 */
export interface NodeParts {
    loc?: LocationRange;
    range?: Range;
}
/**
 * Values that can be represented in JSON.
 */
export type JSONValue = Array<JSONValue> | boolean | number | string | {
    [property: string]: JSONValue;
} | null;
/**
 * A token used to during JSON parsing.
 */
export interface Token {
    type: TokenType;
    loc: LocationRange;
    range?: Range;
}
/**
 * The type of token.
 */
export type TokenType = "Number" | "String" | "Boolean" | "Colon" | "LBrace" | "RBrace" | "RBracket" | "LBracket" | "Comma" | "Null" | "LineComment" | "BlockComment" | "NaN" | "Infinity" | "Identifier";
/**
 * The start and stop location for a token or node inside the source text.
 */
export interface LocationRange {
    start: Location;
    end: Location;
}
/**
 * A cursor location inside the source text.
 */
export interface Location {
    line: number;
    column: number;
    offset: number;
}
/**
 * The start and stop offset for a given node or token inside the source text.
 */
export type Range = [number, number];
export {};
dx;/**
 * @fileoverview Type definitions for the Momoa JSON parser.
 * @author Nicholas C. Zakas
 */

//-----------------------------------------------------------------------------
// Options
//-----------------------------------------------------------------------------

/**
 * The mode that Momoa runs in:
 * - "json" for regular JSON
 * - "jsonc" for JSON with C-style comments
 */
export type Mode = "json" | "jsonc" | "json5";

/**
 * The phase of the traversal step.
 */
export type TraversalPhase = "enter" | "exit";

/**
 * The type of a JSON5 Infinity or NaN value.
 * - "+" for positive Infinity or postive NaN
 * - "-" for negative Infinity or negative NaN
 * - "" for Infinity or NaN without a sign
 */
export type Sign = "+" | "-" | "";

/**
 * Tokenization options.
 */
export interface TokenizeOptions {

    /**
     * The mode to tokenize in.
     */
    readonly mode?: Mode;

    /**
     * When true, includes the `range` key on each token.
     */
    readonly ranges?: boolean;
}

/**
 * Parse options.
 */
export interface ParseOptions {

    /**
     * The mode to parse in.
     */
    readonly mode?: Mode;

    /**
     * When true, includes the `range` key on each node and token.
     */
    readonly ranges?: boolean;

    /**
     * When true, includes the `tokens` key on the document node containing
     * all of the tokens used during parsing.
     */
    readonly tokens?: boolean;

    /**
     * When true, allows trailing commas in arrays and objects. Defaults to
     * false for JSON and JSONC modes, and true for JSON5 mode.
     */
    readonly allowTrailingCommas?: boolean;
}

//-----------------------------------------------------------------------------
// Nodes
//-----------------------------------------------------------------------------

export interface Node {
    type: string;
    loc: LocationRange;
    range?: Range;
}

/**
 * The root node of a JSON document.
 */
export interface DocumentNode extends Node {
    type: "Document";
    body: ValueNode;
    tokens?: Array<Token>;
}

export interface NullNode extends Node {
    type: "Null";
}

interface LiteralNode<T> extends Node {
    value: T;
}

/**
 * Represents a JSON5 NaN value.
 */
export interface NaNNode extends Node {
    type: "NaN";
    sign: Sign;
}

/**
 * Represents a JSON5 Infinity value.
 */
export interface InfinityNode extends Node {
    type: "Infinity";
    sign: Sign;
}

/**
 * Represents a JSON identifier.
 */
export interface IdentifierNode extends Node {
    type: "Identifier";
    name: string;
}

/**
 * Represents a JSON string.
 */
export interface StringNode extends LiteralNode<string> {
    type: "String";
}

/**
 * Represents a JSON number.
 */
export interface NumberNode extends LiteralNode<number> {
    type: "Number";
}

/**
 * Represents a JSON boolean.
 */
export interface BooleanNode extends LiteralNode<boolean> {
    type: "Boolean";
}

/**
 * Represents an element of a JSON array.
 */
export interface ElementNode extends Node {
    type: "Element";
    value: ValueNode;
}

/**
 * Represents a JSON array.
 */
export interface ArrayNode extends Node {
    type: "Array";
    elements: Array<ElementNode>;
}

/**
 * Represents a member of a JSON object.
 */
export interface MemberNode extends Node {
    type: "Member";
    name: StringNode | IdentifierNode;
    value: ValueNode;
}

/**
 * Represents a JSON object.
 */
export interface ObjectNode extends Node {
    type: "Object";
    members: Array<MemberNode>;
}

/**
 * Any node that represents a JSON value.
 */
export type ValueNode = ArrayNode | ObjectNode | 
    BooleanNode | StringNode | NumberNode | NullNode |
    NaNNode | InfinityNode;

/**
 * Any node that represents the container for a JSON value.
 */
export type ContainerNode = DocumentNode | MemberNode | ElementNode;

/**
 * Any node that represents a JSON5 extension.
 */
export type JSON5ExtensionNode = NaNNode | InfinityNode | IdentifierNode;

/**
 * Any valid AST node.
 */
export type AnyNode = ValueNode | ContainerNode | JSON5ExtensionNode;

/**
 * Additional information about an AST node.
 */
export interface NodeParts {
    loc?: LocationRange;
    range?: Range;
}

//-----------------------------------------------------------------------------
// Values
//-----------------------------------------------------------------------------

/**
 * Values that can be represented in JSON.
 */
export type JSONValue =
    | Array<JSONValue>
    | boolean
    | number
    | string
    | { [property: string]: JSONValue }
    | null;

//-----------------------------------------------------------------------------
// Tokens
//-----------------------------------------------------------------------------

/**
 * A token used to during JSON parsing.
 */
export interface Token {
    type: TokenType;
    loc: LocationRange;
    range?: Range;
}

/**
 * The type of token.
 */
export type TokenType = "Number" | "String" | "Boolean" | "Colon" | "LBrace" |
    "RBrace" | "RBracket" | "LBracket" | "Comma" | "Null" | "LineComment" |
    "BlockComment" | "NaN" | "Infinity" | "Identifier";

//-----------------------------------------------------------------------------
// Location Related
//-----------------------------------------------------------------------------

/**
 * The start and stop location for a token or node inside the source text.
 */
export interface LocationRange {
    start: Location;
    end: Location;
}

/**
 * A cursor location inside the source text.
 */
export interface Location {
    line: number;
    column: number;
    offset: number;
}

/**
 * The start and stop offset for a given node or token inside the source text.
 */
export type Range = [number, number];
.ѷx7{
  "name": "@humanwhocodes/momoa",
  "version": "3.3.10",
  "description": "JSON AST parser, tokenizer, printer, traverser.",
  "author": "Nicholas C. Zakas",
  "type": "module",
  "main": "dist/momoa.cjs",
  "module": "dist/momoa.js",
  "types": "dist/momoa.d.ts",
  "exports": {
    ".": {
      "require": {
        "types": "./dist/momoa.d.cts",
        "default": "./dist/momoa.cjs"
      },
      "import": {
        "types": "./dist/momoa.d.ts",
        "default": "./dist/momoa.js"
      }
    }
  },
  "files": [
    "dist"
  ],
  "repository": {
    "type": "git",
    "url": "git+https://github.com/humanwhocodes/momoa.git"
  },
  "bugs": {
    "url": "https://github.com/humanwhocodes/momoa/issues"
  },
  "homepage": "https://github.com/humanwhocodes/momoa#readme",
  "scripts": {
    "build": "rollup -c && npm run fixup && tsc -p tsconfig.build.json && npm run copy-dts && npm run build-dcts",
    "copy-dts": "node -e \"fs.copyFileSync('dist/momoa.d.ts', 'dist/momoa.d.cts')\"",
    "build-dcts": "node tools/update-cts-references.js",
    "fixup": "node tools/strip-typedef-aliases.js",
    "lint": "eslint *.js src/*.js tests/*.js",
    "perf": "npm run build && node tools/perf.js",
    "regen": "npm run build && node tools/regenerate-test-data.js",
    "prepare": "npm run build",
    "pretest": "npm run build",
    "test": "mocha tests/*.test.js && npm run test:types",
    "test:types": "tsc --noEmit --project tests/types/tsconfig.json",
    "test:attw": "attw --pack"
  },
  "keywords": [
    "json",
    "ast",
    "json tree",
    "abstract syntax tree"
  ],
  "license": "Apache-2.0",
  "engines": {
    "node": ">=18"
  },
  "devDependencies": {
    "@arethetypeswrong/cli": "^0.17.4",
    "beautify-benchmark": "0.2.4",
    "benchmark": "2.1.4",
    "chai": "^4.3.7",
    "eslint": "8.57.1",
    "esm": "3.2.25",
    "json-to-ast": "2.1.0",
    "json5": "^2.2.3",
    "mocha": "^11.0.0",
    "npm-run-all2": "^7.0.0",
    "rollup": "^4.19.0",
    "rollup-plugin-copy": "^3.4.0",
    "rollup-plugin-dts": "^6.1.1",
    "sinon": "^19.0.0",
    "typescript": "^5.7.2"
  }
}
_x p100644 LICENSE &랟+Kfݩo\d100644 README.md Ǥqќ邩_40000 dist D)%]1D+100644 package.json ߎ7oCdxf̞p:	xT# Retry utility

by [Nicholas C. Zakas](https://humanwhocodes.com)

If you find this useful, please consider supporting my work with a [donation](https://humanwhocodes.com/donate) or [nominate me](https://stars.github.com/nominate/) for a GitHub Star.

## Description

A utility for retrying failed async JavaScript calls based on the error returned.

## Usage

### Node.js

Install using [npm][npm] or [yarn][yarn]:

```
npm install @humanwhocodes/retry

# or

yarn add @humanwhocodes/retry
```

Import into your Node.js project:

```js
// CommonJS
const { Retrier } = require("@humanwhocodes/retry");

// ESM
import { Retrier } from "@humanwhocodes/retry";
```

### Deno

Install using [JSR](https://jsr.io):

```shell
deno add @humanwhocodes/retry

#or

jsr add @humanwhocodes/retry
```

Then import into your Deno project:

```js
import { Retrier } from "@humanwhocodes/retry";
```

### Bun

Install using this command:

```
bun add @humanwhocodes/retry
```

Import into your Bun project:

```js
import { Retrier } from "@humanwhocodes/retry";
```

### Browser

It's recommended to import the minified version to save bandwidth:

```js
import { Retrier } from "https://cdn.skypack.dev/@humanwhocodes/retry?min";
```

However, you can also import the unminified version for debugging purposes:

```js
import { Retrier } from "https://cdn.skypack.dev/@humanwhocodes/retry";
```

## API

After importing, create a new instance of `Retrier` and specify the function to run on the error. This function should return `true` if you want the call retried and `false` if not.

```js
// this instance will retry if the specific error code is found
const retrier = new Retrier(error => {
    return error.code === "ENFILE" || error.code === "EMFILE";
});
```

Then, call the `retry()` method around the function you'd like to retry, such as:

```js
import fs from "fs/promises";

const retrier = new Retrier(error => {
    return error.code === "ENFILE" || error.code === "EMFILE";
});

const text = await retrier.retry(() => fs.readFile("README.md", "utf8"));
```

The `retry()` method will either pass through the result on success or wait and retry on failure. Any error that isn't caught by the retrier is automatically rejected so the end result is a transparent passing through of both success and failure.

### Setting a Timeout

You can control how long a task will attempt to retry before giving up by passing the `timeout` option to the `Retrier` constructor. By default, the timeout is one minute.

```js
import fs from "fs/promises";

const retrier = new Retrier(error => {
    return error.code === "ENFILE" || error.code === "EMFILE";
}, { timeout: 100_000 });

const text = await retrier.retry(() => fs.readFile("README.md", "utf8"));
```

When a call times out, it rejects the first error that was received from calling the function.

### Setting a Concurrency Limit

When processing a large number of function calls, you can limit the number of concurrent function calls by passing the `concurrency` option to the `Retrier` constructor. By default, `concurrency` is 1000.

```js
import fs from "fs/promises";

const retrier = new Retrier(error => {
    return error.code === "ENFILE" || error.code === "EMFILE";
}, { concurrency: 100 });

const filenames = getFilenames();
const contents = await Promise.all(
    filenames.map(filename => retrier.retry(() => fs.readFile(filename, "utf8"))
);
```

### Aborting with `AbortSignal`

You can also pass an `AbortSignal` to cancel a retry:

```js
import fs from "fs/promises";

const controller = new AbortController();
const retrier = new Retrier(error => {
    return error.code === "ENFILE" || error.code === "EMFILE";
});

const text = await retrier.retry(
    () => fs.readFile("README.md", "utf8"),
    { signal: controller.signal }
);
```

## Developer Setup

1. Fork the repository
2. Clone your fork
3. Run `npm install` to setup dependencies
4. Run `npm test` to run tests

### Debug Output

Enable debugging output by setting the `DEBUG` environment variable to `"@hwc/retry"` before running.

## License

Apache 2.0

## Prior Art

This utility is inspired by, and contains code from [`graceful-fs`](https://github.com/isaacs/node-graceful-fs).

[npm]: https://npmjs.com/
[yarn]: https://yarnpkg.com/
[x 100644 retrier.cjs c^VGꗏ>K+100644 retrier.d.cts -805/0Q6100644 retrier.d.ts -805/0Q6100644 retrier.js )rxv|n100644 retrier.min.js 7`eϧ?c0Jm100644 retrier.mjs \vsg@B@="6Rх}f]	x59'use strict';

/**
 * @fileoverview A utility for retrying failed async method calls.
 */

/* global setTimeout, clearTimeout */

//-----------------------------------------------------------------------------
// Constants
//-----------------------------------------------------------------------------

const MAX_TASK_TIMEOUT = 60000;
const MAX_TASK_DELAY = 100;
const MAX_CONCURRENCY = 1000;

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

/**
 * Logs a message to the console if the DEBUG environment variable is set.
 * @param {string} message The message to log.
 * @returns {void}
 */
function debug(message) {
    if (globalThis?.process?.env.DEBUG === "@hwc/retry") {
        console.debug(message);
    }
}

/*
 * The following logic has been extracted from graceful-fs.
 *
 * The ISC License
 *
 * Copyright (c) 2011-2023 Isaac Z. Schlueter, Ben Noordhuis, and Contributors
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
 * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

/**
 * Checks if it is time to retry a task based on the timestamp and last attempt time.
 * @param {RetryTask} task The task to check.
 * @param {number} maxDelay The maximum delay for the queue.
 * @returns {boolean} true if it is time to retry, false otherwise.
 */
function isTimeToRetry(task, maxDelay) {
    const timeSinceLastAttempt = Date.now() - task.lastAttempt;
    const timeSinceStart = Math.max(task.lastAttempt - task.timestamp, 1);
    const desiredDelay = Math.min(timeSinceStart * 1.2, maxDelay);

    return timeSinceLastAttempt >= desiredDelay;
}

/**
 * Checks if it is time to bail out based on the given timestamp.
 * @param {RetryTask} task The task to check.
 * @param {number} timeout The timeout for the queue.
 * @returns {boolean} true if it is time to bail, false otherwise.
 */
function isTimeToBail(task, timeout) {
    return task.age > timeout;
}

/**
 * Creates a new promise with resolve and reject functions.
 * @returns {{promise:Promise<any>, resolve:(value:any) => any, reject: (value:any) => any}} A new promise.
 */
function createPromise() {
    if (Promise.withResolvers) {
        return Promise.withResolvers();
    }

    let resolve, reject;

    const promise = new Promise((res, rej) => {
        resolve = res;
        reject = rej;
    });

    if (resolve === undefined || reject === undefined) {
        throw new Error("Promise executor did not initialize resolve or reject.");
    }

    return { promise, resolve, reject };
}


/**
 * A class to represent a task in the retry queue.
 */
class RetryTask {

    /**
     * The unique ID for the task.
     * @type {string}
     */
    id = Math.random().toString(36).slice(2);

    /**
     * The function to call.
     * @type {Function}
     */
    fn;

    /**
     * The error that was thrown.
     * @type {Error}
     */
    error;
    
    /**
     * The timestamp of the task.
     * @type {number}
     */
    timestamp = Date.now();

    /**
     * The timestamp of the last attempt.
     * @type {number}
     */
    lastAttempt = this.timestamp;

    /**
     * The resolve function for the promise.
     * @type {Function}
     */
    resolve;

    /**
     * The reject function for the promise.
     * @type {Function}
     */
    reject;

    /**
     * The AbortSignal to monitor for cancellation.
     * @type {AbortSignal|undefined}
     */
    signal;

    /**
     * Creates a new instance.
     * @param {Function} fn The function to call.
     * @param {Error} error The error that was thrown.
     * @param {Function} resolve The resolve function for the promise.
     * @param {Function} reject The reject function for the promise.
     * @param {AbortSignal|undefined} signal The AbortSignal to monitor for cancellation.
     */
    constructor(fn, error, resolve, reject, signal) {
        this.fn = fn;
        this.error = error;
        this.timestamp = Date.now();
        this.lastAttempt = Date.now();
        this.resolve = resolve;
        this.reject = reject;
        this.signal = signal;
    }
    
    /**
     * Gets the age of the task.
     * @returns {number} The age of the task in milliseconds.
     * @readonly
     */
    get age() {
        return Date.now() - this.timestamp;
    }
}

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * A class that manages a queue of retry jobs.
 */
class Retrier {

    /**
     * Represents the queue for processing tasks.
     * @type {Array<RetryTask>}
     */
    #retrying = [];

    /**
     * Represents the queue for pending tasks.
     * @type {Array<Function>}
     */
    #pending = [];

    /**
     * The number of tasks currently being processed.
     * @type {number}
     */
    #working = 0;

    /**
     * The timeout for the queue.
     * @type {number}
     */
    #timeout;

    /**
     * The maximum delay for the queue.
     * @type {number}
     */
    #maxDelay;

    /**
     * The setTimeout() timer ID.
     * @type {NodeJS.Timeout|undefined}
     */
    #timerId;

    /**
     * The function to call.
     * @type {Function}
     */
    #check;

    /**
     * The maximum number of concurrent tasks.
     * @type {number}
     */
    #concurrency;

    /**
     * Creates a new instance.
     * @param {Function} check The function to call.
     * @param {object} [options] The options for the instance.
     * @param {number} [options.timeout] The timeout for the queue.
     * @param {number} [options.maxDelay] The maximum delay for the queue.
     * @param {number} [options.concurrency] The maximum number of concurrent tasks.
     */
    constructor(check, { timeout = MAX_TASK_TIMEOUT, maxDelay = MAX_TASK_DELAY, concurrency = MAX_CONCURRENCY } = {}) {

        if (typeof check !== "function") {
            throw new Error("Missing function to check errors");
        }

        this.#check = check;
        this.#timeout = timeout;
        this.#maxDelay = maxDelay;
        this.#concurrency = concurrency;
    }

    /**
     * Gets the number of tasks waiting to be retried.
     * @returns {number} The number of tasks in the retry queue.
     */
    get retrying() {
        return this.#retrying.length;
    }

    /**
     * Gets the number of tasks waiting to be processed in the pending queue.
     * @returns {number} The number of tasks in the pending queue.
     */
    get pending() {
        return this.#pending.length;
    }

    /**
     * Gets the number of tasks currently being processed.
     * @returns {number} The number of tasks currently being processed.
     */
    get working() {
        return this.#working;
    }

    /**
     * Calls the function and retries if it fails.
     * @param {Function} fn The function to call.
     * @param {Object} options The options for the job.
     * @param {AbortSignal} [options.signal] The AbortSignal to monitor for cancellation.
     * @param {Promise<any>} options.promise The promise to return when the function settles.
     * @param {Function} options.resolve The resolve function for the promise.
     * @param {Function} options.reject The reject function for the promise.
     * @returns {Promise<any>} A promise that resolves when the function is
     * called successfully.
     */
    #call(fn, { signal, promise, resolve, reject }) {

        let result;

        try {
            result = fn();
        } catch (/** @type {any} */ error) {
            reject(new Error(`Synchronous error: ${error.message}`, { cause: error }));
            return promise;
        }

        // if the result is not a promise then reject an error
        if (!result || typeof result.then !== "function") {
            reject(new Error("Result is not a promise."));
            return promise;
        }

        this.#working++;
        promise.finally(() => {
            this.#working--;
            this.#processPending();
        })
        // `promise.finally` creates a new promise that may be rejected, so it must be handled.
            .catch(() => { });

        // call the original function and catch any ENFILE or EMFILE errors
        Promise.resolve(result)
            .then(value => {
                debug("Function called successfully without retry.");
                resolve(value);
            })
            .catch(error => {
                if (!this.#check(error)) {
                    reject(error);
                    return;
                }

                const task = new RetryTask(fn, error, resolve, reject, signal);
                
                debug(`Function failed, queuing for retry with task ${task.id}.`);
                this.#retrying.push(task);

                signal?.addEventListener("abort", () => {
                    debug(`Task ${task.id} was aborted due to AbortSignal.`);
                    reject(signal.reason);
                });

                this.#processQueue();
            });
        
        return promise;
    }

    /**
     * Adds a new retry job to the queue.
     * @template {(...args: unknown[]) => Promise<unknown>} Func
     * @template {Awaited<ReturnType<Func>>} RetVal
     * @param {Func} fn The function to call.
     * @param {object} [options] The options for the job.
     * @param {AbortSignal} [options.signal] The AbortSignal to monitor for cancellation.
     * @returns {Promise<RetVal>} A promise that resolves when the queue is processed.
     */
    retry(fn, { signal } = {}) {

        signal?.throwIfAborted();

        const { promise, resolve, reject } = createPromise();

        this.#pending.push(() => this.#call(fn, { signal, promise, resolve, reject }));
        this.#processPending();
        
        return promise;
    }


    /**
     * Processes the pending queue and the retry queue.
     * @returns {void}
     */
    #processAll() {
        if (this.pending) {
            this.#processPending();
        }

        if (this.retrying) {
            this.#processQueue();
        }
    }

    /**
     * Processes the pending queue to see which tasks can be started.
     * @returns {void}
     */
    #processPending() {

        debug(`Processing pending tasks: ${this.pending} pending, ${this.working} working.`);

        const available = this.#concurrency - this.working;

        if (available <= 0) {
            return;
        }

        const count = Math.min(this.pending, available);

        for (let i = 0; i < count; i++) {
            const task = this.#pending.shift();
            task?.();
        }

        debug(`Processed pending tasks: ${this.pending} pending, ${this.working} working.`);
    }

    /**
     * Processes the queue.
     * @returns {void}
     */
    #processQueue() {
        // clear any timer because we're going to check right now
        clearTimeout(this.#timerId);
        this.#timerId = undefined;

        debug(`Processing retry queue: ${this.retrying} retrying, ${this.working} working.`);

        const processAgain = () => {
            this.#timerId = setTimeout(() => this.#processAll(), 0);
        };

        // if there's nothing in the queue, we're done
        const task = this.#retrying.shift();
        if (!task) {
            debug("Queue is empty, exiting.");

            if (this.pending) {
                processAgain();
            }
            return;
        }

        // if it's time to bail, then bail
        if (isTimeToBail(task, this.#timeout)) {
            debug(`Task ${task.id} was abandoned due to timeout.`);
            task.reject(task.error);
            processAgain();
            return;
        }

        // if it's not time to retry, then wait and try again
        if (!isTimeToRetry(task, this.#maxDelay)) {
            debug(`Task ${task.id} is not ready to retry, skipping.`);
            this.#retrying.push(task);
            processAgain();
            return;
        }

        // otherwise, try again
        task.lastAttempt = Date.now();
        
        // Promise.resolve needed in case it's a thenable but not a Promise
        Promise.resolve(task.fn())
            // @ts-ignore because we know it's any
            .then(result => {
                debug(`Task ${task.id} succeeded after ${task.age}ms.`);
                task.resolve(result);
            })

            // @ts-ignore because we know it's any
            .catch(error => {
                if (!this.#check(error)) {
                    debug(`Task ${task.id} failed with non-retryable error: ${error.message}.`);
                    task.reject(error);
                    return;
                }

                // update the task timestamp and push to back of queue to try again
                task.lastAttempt = Date.now();
                this.#retrying.push(task);
                debug(`Task ${task.id} failed, requeueing to try again.`);
            })
            .finally(() => {
                this.#processAll();
            });
    }
}

exports.Retrier = Retrier;
{+vxa/**
 * A class that manages a queue of retry jobs.
 */
export class Retrier {
    /**
     * Creates a new instance.
     * @param {Function} check The function to call.
     * @param {object} [options] The options for the instance.
     * @param {number} [options.timeout] The timeout for the queue.
     * @param {number} [options.maxDelay] The maximum delay for the queue.
     * @param {number} [options.concurrency] The maximum number of concurrent tasks.
     */
    constructor(check: Function, { timeout, maxDelay, concurrency }?: {
        timeout?: number | undefined;
        maxDelay?: number | undefined;
        concurrency?: number | undefined;
    } | undefined);
    /**
     * Gets the number of tasks waiting to be retried.
     * @returns {number} The number of tasks in the retry queue.
     */
    get retrying(): number;
    /**
     * Gets the number of tasks waiting to be processed in the pending queue.
     * @returns {number} The number of tasks in the pending queue.
     */
    get pending(): number;
    /**
     * Gets the number of tasks currently being processed.
     * @returns {number} The number of tasks currently being processed.
     */
    get working(): number;
    /**
     * Adds a new retry job to the queue.
     * @template {(...args: unknown[]) => Promise<unknown>} Func
     * @template {Awaited<ReturnType<Func>>} RetVal
     * @param {Func} fn The function to call.
     * @param {object} [options] The options for the job.
     * @param {AbortSignal} [options.signal] The AbortSignal to monitor for cancellation.
     * @returns {Promise<RetVal>} A promise that resolves when the queue is processed.
     */
    retry<Func extends (...args: unknown[]) => Promise<unknown>, RetVal extends Awaited<ReturnType<Func>>>(fn: Func, { signal }?: {
        signal?: AbortSignal | undefined;
    } | undefined): Promise<RetVal>;
    #private;
}
5fx5,// @ts-self-types="./retrier.d.ts"
/**
 * @fileoverview A utility for retrying failed async method calls.
 */

/* global setTimeout, clearTimeout */

//-----------------------------------------------------------------------------
// Constants
//-----------------------------------------------------------------------------

const MAX_TASK_TIMEOUT = 60000;
const MAX_TASK_DELAY = 100;
const MAX_CONCURRENCY = 1000;

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

/**
 * Logs a message to the console if the DEBUG environment variable is set.
 * @param {string} message The message to log.
 * @returns {void}
 */
function debug(message) {
    if (globalThis?.process?.env.DEBUG === "@hwc/retry") {
        console.debug(message);
    }
}

/*
 * The following logic has been extracted from graceful-fs.
 *
 * The ISC License
 *
 * Copyright (c) 2011-2023 Isaac Z. Schlueter, Ben Noordhuis, and Contributors
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
 * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

/**
 * Checks if it is time to retry a task based on the timestamp and last attempt time.
 * @param {RetryTask} task The task to check.
 * @param {number} maxDelay The maximum delay for the queue.
 * @returns {boolean} true if it is time to retry, false otherwise.
 */
function isTimeToRetry(task, maxDelay) {
    const timeSinceLastAttempt = Date.now() - task.lastAttempt;
    const timeSinceStart = Math.max(task.lastAttempt - task.timestamp, 1);
    const desiredDelay = Math.min(timeSinceStart * 1.2, maxDelay);

    return timeSinceLastAttempt >= desiredDelay;
}

/**
 * Checks if it is time to bail out based on the given timestamp.
 * @param {RetryTask} task The task to check.
 * @param {number} timeout The timeout for the queue.
 * @returns {boolean} true if it is time to bail, false otherwise.
 */
function isTimeToBail(task, timeout) {
    return task.age > timeout;
}

/**
 * Creates a new promise with resolve and reject functions.
 * @returns {{promise:Promise<any>, resolve:(value:any) => any, reject: (value:any) => any}} A new promise.
 */
function createPromise() {
    if (Promise.withResolvers) {
        return Promise.withResolvers();
    }

    let resolve, reject;

    const promise = new Promise((res, rej) => {
        resolve = res;
        reject = rej;
    });

    if (resolve === undefined || reject === undefined) {
        throw new Error("Promise executor did not initialize resolve or reject.");
    }

    return { promise, resolve, reject };
}


/**
 * A class to represent a task in the retry queue.
 */
class RetryTask {

    /**
     * The unique ID for the task.
     * @type {string}
     */
    id = Math.random().toString(36).slice(2);

    /**
     * The function to call.
     * @type {Function}
     */
    fn;

    /**
     * The error that was thrown.
     * @type {Error}
     */
    error;
    
    /**
     * The timestamp of the task.
     * @type {number}
     */
    timestamp = Date.now();

    /**
     * The timestamp of the last attempt.
     * @type {number}
     */
    lastAttempt = this.timestamp;

    /**
     * The resolve function for the promise.
     * @type {Function}
     */
    resolve;

    /**
     * The reject function for the promise.
     * @type {Function}
     */
    reject;

    /**
     * The AbortSignal to monitor for cancellation.
     * @type {AbortSignal|undefined}
     */
    signal;

    /**
     * Creates a new instance.
     * @param {Function} fn The function to call.
     * @param {Error} error The error that was thrown.
     * @param {Function} resolve The resolve function for the promise.
     * @param {Function} reject The reject function for the promise.
     * @param {AbortSignal|undefined} signal The AbortSignal to monitor for cancellation.
     */
    constructor(fn, error, resolve, reject, signal) {
        this.fn = fn;
        this.error = error;
        this.timestamp = Date.now();
        this.lastAttempt = Date.now();
        this.resolve = resolve;
        this.reject = reject;
        this.signal = signal;
    }
    
    /**
     * Gets the age of the task.
     * @returns {number} The age of the task in milliseconds.
     * @readonly
     */
    get age() {
        return Date.now() - this.timestamp;
    }
}

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * A class that manages a queue of retry jobs.
 */
class Retrier {

    /**
     * Represents the queue for processing tasks.
     * @type {Array<RetryTask>}
     */
    #retrying = [];

    /**
     * Represents the queue for pending tasks.
     * @type {Array<Function>}
     */
    #pending = [];

    /**
     * The number of tasks currently being processed.
     * @type {number}
     */
    #working = 0;

    /**
     * The timeout for the queue.
     * @type {number}
     */
    #timeout;

    /**
     * The maximum delay for the queue.
     * @type {number}
     */
    #maxDelay;

    /**
     * The setTimeout() timer ID.
     * @type {NodeJS.Timeout|undefined}
     */
    #timerId;

    /**
     * The function to call.
     * @type {Function}
     */
    #check;

    /**
     * The maximum number of concurrent tasks.
     * @type {number}
     */
    #concurrency;

    /**
     * Creates a new instance.
     * @param {Function} check The function to call.
     * @param {object} [options] The options for the instance.
     * @param {number} [options.timeout] The timeout for the queue.
     * @param {number} [options.maxDelay] The maximum delay for the queue.
     * @param {number} [options.concurrency] The maximum number of concurrent tasks.
     */
    constructor(check, { timeout = MAX_TASK_TIMEOUT, maxDelay = MAX_TASK_DELAY, concurrency = MAX_CONCURRENCY } = {}) {

        if (typeof check !== "function") {
            throw new Error("Missing function to check errors");
        }

        this.#check = check;
        this.#timeout = timeout;
        this.#maxDelay = maxDelay;
        this.#concurrency = concurrency;
    }

    /**
     * Gets the number of tasks waiting to be retried.
     * @returns {number} The number of tasks in the retry queue.
     */
    get retrying() {
        return this.#retrying.length;
    }

    /**
     * Gets the number of tasks waiting to be processed in the pending queue.
     * @returns {number} The number of tasks in the pending queue.
     */
    get pending() {
        return this.#pending.length;
    }

    /**
     * Gets the number of tasks currently being processed.
     * @returns {number} The number of tasks currently being processed.
     */
    get working() {
        return this.#working;
    }

    /**
     * Calls the function and retries if it fails.
     * @param {Function} fn The function to call.
     * @param {Object} options The options for the job.
     * @param {AbortSignal} [options.signal] The AbortSignal to monitor for cancellation.
     * @param {Promise<any>} options.promise The promise to return when the function settles.
     * @param {Function} options.resolve The resolve function for the promise.
     * @param {Function} options.reject The reject function for the promise.
     * @returns {Promise<any>} A promise that resolves when the function is
     * called successfully.
     */
    #call(fn, { signal, promise, resolve, reject }) {

        let result;

        try {
            result = fn();
        } catch (/** @type {any} */ error) {
            reject(new Error(`Synchronous error: ${error.message}`, { cause: error }));
            return promise;
        }

        // if the result is not a promise then reject an error
        if (!result || typeof result.then !== "function") {
            reject(new Error("Result is not a promise."));
            return promise;
        }

        this.#working++;
        promise.finally(() => {
            this.#working--;
            this.#processPending();
        })
        // `promise.finally` creates a new promise that may be rejected, so it must be handled.
            .catch(() => { });

        // call the original function and catch any ENFILE or EMFILE errors
        Promise.resolve(result)
            .then(value => {
                debug("Function called successfully without retry.");
                resolve(value);
            })
            .catch(error => {
                if (!this.#check(error)) {
                    reject(error);
                    return;
                }

                const task = new RetryTask(fn, error, resolve, reject, signal);
                
                debug(`Function failed, queuing for retry with task ${task.id}.`);
                this.#retrying.push(task);

                signal?.addEventListener("abort", () => {
                    debug(`Task ${task.id} was aborted due to AbortSignal.`);
                    reject(signal.reason);
                });

                this.#processQueue();
            });
        
        return promise;
    }

    /**
     * Adds a new retry job to the queue.
     * @template {(...args: unknown[]) => Promise<unknown>} Func
     * @template {Awaited<ReturnType<Func>>} RetVal
     * @param {Func} fn The function to call.
     * @param {object} [options] The options for the job.
     * @param {AbortSignal} [options.signal] The AbortSignal to monitor for cancellation.
     * @returns {Promise<RetVal>} A promise that resolves when the queue is processed.
     */
    retry(fn, { signal } = {}) {

        signal?.throwIfAborted();

        const { promise, resolve, reject } = createPromise();

        this.#pending.push(() => this.#call(fn, { signal, promise, resolve, reject }));
        this.#processPending();
        
        return promise;
    }


    /**
     * Processes the pending queue and the retry queue.
     * @returns {void}
     */
    #processAll() {
        if (this.pending) {
            this.#processPending();
        }

        if (this.retrying) {
            this.#processQueue();
        }
    }

    /**
     * Processes the pending queue to see which tasks can be started.
     * @returns {void}
     */
    #processPending() {

        debug(`Processing pending tasks: ${this.pending} pending, ${this.working} working.`);

        const available = this.#concurrency - this.working;

        if (available <= 0) {
            return;
        }

        const count = Math.min(this.pending, available);

        for (let i = 0; i < count; i++) {
            const task = this.#pending.shift();
            task?.();
        }

        debug(`Processed pending tasks: ${this.pending} pending, ${this.working} working.`);
    }

    /**
     * Processes the queue.
     * @returns {void}
     */
    #processQueue() {
        // clear any timer because we're going to check right now
        clearTimeout(this.#timerId);
        this.#timerId = undefined;

        debug(`Processing retry queue: ${this.retrying} retrying, ${this.working} working.`);

        const processAgain = () => {
            this.#timerId = setTimeout(() => this.#processAll(), 0);
        };

        // if there's nothing in the queue, we're done
        const task = this.#retrying.shift();
        if (!task) {
            debug("Queue is empty, exiting.");

            if (this.pending) {
                processAgain();
            }
            return;
        }

        // if it's time to bail, then bail
        if (isTimeToBail(task, this.#timeout)) {
            debug(`Task ${task.id} was abandoned due to timeout.`);
            task.reject(task.error);
            processAgain();
            return;
        }

        // if it's not time to retry, then wait and try again
        if (!isTimeToRetry(task, this.#maxDelay)) {
            debug(`Task ${task.id} is not ready to retry, skipping.`);
            this.#retrying.push(task);
            processAgain();
            return;
        }

        // otherwise, try again
        task.lastAttempt = Date.now();
        
        // Promise.resolve needed in case it's a thenable but not a Promise
        Promise.resolve(task.fn())
            // @ts-ignore because we know it's any
            .then(result => {
                debug(`Task ${task.id} succeeded after ${task.age}ms.`);
                task.resolve(result);
            })

            // @ts-ignore because we know it's any
            .catch(error => {
                if (!this.#check(error)) {
                    debug(`Task ${task.id} failed with non-retryable error: ${error.message}.`);
                    task.reject(error);
                    return;
                }

                // update the task timestamp and push to back of queue to try again
                task.lastAttempt = Date.now();
                this.#retrying.push(task);
                debug(`Task ${task.id} failed, requeueing to try again.`);
            })
            .finally(() => {
                this.#processAll();
            });
    }
}

export { Retrier };
#Oxfunction e(e){"@hwc/retry"===globalThis?.process?.env.DEBUG&&console.debug(e)}class RetryTask{id=Math.random().toString(36).slice(2);fn;error;timestamp=Date.now();lastAttempt=this.timestamp;resolve;reject;signal;constructor(e,t,r,i,s){this.fn=e,this.error=t,this.timestamp=Date.now(),this.lastAttempt=Date.now(),this.resolve=r,this.reject=i,this.signal=s}get age(){return Date.now()-this.timestamp}}class Retrier{#e=[];#t=[];#r=0;#i;#s;#n;#o;#c;constructor(e,{timeout:t=6e4,maxDelay:r=100,concurrency:i=1e3}={}){if("function"!=typeof e)throw new Error("Missing function to check errors");this.#o=e,this.#i=t,this.#s=r,this.#c=i}get retrying(){return this.#e.length}get pending(){return this.#t.length}get working(){return this.#r}#a(t,{signal:r,promise:i,resolve:s,reject:n}){let o;try{o=t()}catch(e){return n(new Error(`Synchronous error: ${e.message}`,{cause:e})),i}return o&&"function"==typeof o.then?(this.#r++,i.finally((()=>{this.#r--,this.#h()})).catch((()=>{})),Promise.resolve(o).then((t=>{e("Function called successfully without retry."),s(t)})).catch((i=>{if(!this.#o(i))return void n(i);const o=new RetryTask(t,i,s,n,r);e(`Function failed, queuing for retry with task ${o.id}.`),this.#e.push(o),r?.addEventListener("abort",(()=>{e(`Task ${o.id} was aborted due to AbortSignal.`),n(r.reason)})),this.#g()})),i):(n(new Error("Result is not a promise.")),i)}retry(e,{signal:t}={}){t?.throwIfAborted();const{promise:r,resolve:i,reject:s}=function(){if(Promise.withResolvers)return Promise.withResolvers();let e,t;const r=new Promise(((r,i)=>{e=r,t=i}));if(void 0===e||void 0===t)throw new Error("Promise executor did not initialize resolve or reject.");return{promise:r,resolve:e,reject:t}}();return this.#t.push((()=>this.#a(e,{signal:t,promise:r,resolve:i,reject:s}))),this.#h(),r}#u(){this.pending&&this.#h(),this.retrying&&this.#g()}#h(){e(`Processing pending tasks: ${this.pending} pending, ${this.working} working.`);const t=this.#c-this.working;if(t<=0)return;const r=Math.min(this.pending,t);for(let e=0;e<r;e++){const e=this.#t.shift();e?.()}e(`Processed pending tasks: ${this.pending} pending, ${this.working} working.`)}#g(){clearTimeout(this.#n),this.#n=void 0,e(`Processing retry queue: ${this.retrying} retrying, ${this.working} working.`);const t=()=>{this.#n=setTimeout((()=>this.#u()),0)},r=this.#e.shift();return r?function(e,t){return e.age>t}(r,this.#i)?(e(`Task ${r.id} was abandoned due to timeout.`),r.reject(r.error),void t()):function(e,t){const r=Date.now()-e.lastAttempt,i=Math.max(e.lastAttempt-e.timestamp,1);return r>=Math.min(1.2*i,t)}(r,this.#s)?(r.lastAttempt=Date.now(),void Promise.resolve(r.fn()).then((t=>{e(`Task ${r.id} succeeded after ${r.age}ms.`),r.resolve(t)})).catch((t=>{if(!this.#o(t))return e(`Task ${r.id} failed with non-retryable error: ${t.message}.`),void r.reject(t);r.lastAttempt=Date.now(),this.#e.push(r),e(`Task ${r.id} failed, requeueing to try again.`)})).finally((()=>{this.#u()}))):(e(`Task ${r.id} is not ready to retry, skipping.`),this.#e.push(r),void t()):(e("Queue is empty, exiting."),void(this.pending&&t()))}}export{Retrier};
Dx5O/**
 * @fileoverview A utility for retrying failed async method calls.
 */

/* global setTimeout, clearTimeout */

//-----------------------------------------------------------------------------
// Constants
//-----------------------------------------------------------------------------

const MAX_TASK_TIMEOUT = 60000;
const MAX_TASK_DELAY = 100;
const MAX_CONCURRENCY = 1000;

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

/**
 * Logs a message to the console if the DEBUG environment variable is set.
 * @param {string} message The message to log.
 * @returns {void}
 */
function debug(message) {
    if (globalThis?.process?.env.DEBUG === "@hwc/retry") {
        console.debug(message);
    }
}

/*
 * The following logic has been extracted from graceful-fs.
 *
 * The ISC License
 *
 * Copyright (c) 2011-2023 Isaac Z. Schlueter, Ben Noordhuis, and Contributors
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
 * IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 */

/**
 * Checks if it is time to retry a task based on the timestamp and last attempt time.
 * @param {RetryTask} task The task to check.
 * @param {number} maxDelay The maximum delay for the queue.
 * @returns {boolean} true if it is time to retry, false otherwise.
 */
function isTimeToRetry(task, maxDelay) {
    const timeSinceLastAttempt = Date.now() - task.lastAttempt;
    const timeSinceStart = Math.max(task.lastAttempt - task.timestamp, 1);
    const desiredDelay = Math.min(timeSinceStart * 1.2, maxDelay);

    return timeSinceLastAttempt >= desiredDelay;
}

/**
 * Checks if it is time to bail out based on the given timestamp.
 * @param {RetryTask} task The task to check.
 * @param {number} timeout The timeout for the queue.
 * @returns {boolean} true if it is time to bail, false otherwise.
 */
function isTimeToBail(task, timeout) {
    return task.age > timeout;
}

/**
 * Creates a new promise with resolve and reject functions.
 * @returns {{promise:Promise<any>, resolve:(value:any) => any, reject: (value:any) => any}} A new promise.
 */
function createPromise() {
    if (Promise.withResolvers) {
        return Promise.withResolvers();
    }

    let resolve, reject;

    const promise = new Promise((res, rej) => {
        resolve = res;
        reject = rej;
    });

    if (resolve === undefined || reject === undefined) {
        throw new Error("Promise executor did not initialize resolve or reject.");
    }

    return { promise, resolve, reject };
}


/**
 * A class to represent a task in the retry queue.
 */
class RetryTask {

    /**
     * The unique ID for the task.
     * @type {string}
     */
    id = Math.random().toString(36).slice(2);

    /**
     * The function to call.
     * @type {Function}
     */
    fn;

    /**
     * The error that was thrown.
     * @type {Error}
     */
    error;
    
    /**
     * The timestamp of the task.
     * @type {number}
     */
    timestamp = Date.now();

    /**
     * The timestamp of the last attempt.
     * @type {number}
     */
    lastAttempt = this.timestamp;

    /**
     * The resolve function for the promise.
     * @type {Function}
     */
    resolve;

    /**
     * The reject function for the promise.
     * @type {Function}
     */
    reject;

    /**
     * The AbortSignal to monitor for cancellation.
     * @type {AbortSignal|undefined}
     */
    signal;

    /**
     * Creates a new instance.
     * @param {Function} fn The function to call.
     * @param {Error} error The error that was thrown.
     * @param {Function} resolve The resolve function for the promise.
     * @param {Function} reject The reject function for the promise.
     * @param {AbortSignal|undefined} signal The AbortSignal to monitor for cancellation.
     */
    constructor(fn, error, resolve, reject, signal) {
        this.fn = fn;
        this.error = error;
        this.timestamp = Date.now();
        this.lastAttempt = Date.now();
        this.resolve = resolve;
        this.reject = reject;
        this.signal = signal;
    }
    
    /**
     * Gets the age of the task.
     * @returns {number} The age of the task in milliseconds.
     * @readonly
     */
    get age() {
        return Date.now() - this.timestamp;
    }
}

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * A class that manages a queue of retry jobs.
 */
class Retrier {

    /**
     * Represents the queue for processing tasks.
     * @type {Array<RetryTask>}
     */
    #retrying = [];

    /**
     * Represents the queue for pending tasks.
     * @type {Array<Function>}
     */
    #pending = [];

    /**
     * The number of tasks currently being processed.
     * @type {number}
     */
    #working = 0;

    /**
     * The timeout for the queue.
     * @type {number}
     */
    #timeout;

    /**
     * The maximum delay for the queue.
     * @type {number}
     */
    #maxDelay;

    /**
     * The setTimeout() timer ID.
     * @type {NodeJS.Timeout|undefined}
     */
    #timerId;

    /**
     * The function to call.
     * @type {Function}
     */
    #check;

    /**
     * The maximum number of concurrent tasks.
     * @type {number}
     */
    #concurrency;

    /**
     * Creates a new instance.
     * @param {Function} check The function to call.
     * @param {object} [options] The options for the instance.
     * @param {number} [options.timeout] The timeout for the queue.
     * @param {number} [options.maxDelay] The maximum delay for the queue.
     * @param {number} [options.concurrency] The maximum number of concurrent tasks.
     */
    constructor(check, { timeout = MAX_TASK_TIMEOUT, maxDelay = MAX_TASK_DELAY, concurrency = MAX_CONCURRENCY } = {}) {

        if (typeof check !== "function") {
            throw new Error("Missing function to check errors");
        }

        this.#check = check;
        this.#timeout = timeout;
        this.#maxDelay = maxDelay;
        this.#concurrency = concurrency;
    }

    /**
     * Gets the number of tasks waiting to be retried.
     * @returns {number} The number of tasks in the retry queue.
     */
    get retrying() {
        return this.#retrying.length;
    }

    /**
     * Gets the number of tasks waiting to be processed in the pending queue.
     * @returns {number} The number of tasks in the pending queue.
     */
    get pending() {
        return this.#pending.length;
    }

    /**
     * Gets the number of tasks currently being processed.
     * @returns {number} The number of tasks currently being processed.
     */
    get working() {
        return this.#working;
    }

    /**
     * Calls the function and retries if it fails.
     * @param {Function} fn The function to call.
     * @param {Object} options The options for the job.
     * @param {AbortSignal} [options.signal] The AbortSignal to monitor for cancellation.
     * @param {Promise<any>} options.promise The promise to return when the function settles.
     * @param {Function} options.resolve The resolve function for the promise.
     * @param {Function} options.reject The reject function for the promise.
     * @returns {Promise<any>} A promise that resolves when the function is
     * called successfully.
     */
    #call(fn, { signal, promise, resolve, reject }) {

        let result;

        try {
            result = fn();
        } catch (/** @type {any} */ error) {
            reject(new Error(`Synchronous error: ${error.message}`, { cause: error }));
            return promise;
        }

        // if the result is not a promise then reject an error
        if (!result || typeof result.then !== "function") {
            reject(new Error("Result is not a promise."));
            return promise;
        }

        this.#working++;
        promise.finally(() => {
            this.#working--;
            this.#processPending();
        })
        // `promise.finally` creates a new promise that may be rejected, so it must be handled.
            .catch(() => { });

        // call the original function and catch any ENFILE or EMFILE errors
        Promise.resolve(result)
            .then(value => {
                debug("Function called successfully without retry.");
                resolve(value);
            })
            .catch(error => {
                if (!this.#check(error)) {
                    reject(error);
                    return;
                }

                const task = new RetryTask(fn, error, resolve, reject, signal);
                
                debug(`Function failed, queuing for retry with task ${task.id}.`);
                this.#retrying.push(task);

                signal?.addEventListener("abort", () => {
                    debug(`Task ${task.id} was aborted due to AbortSignal.`);
                    reject(signal.reason);
                });

                this.#processQueue();
            });
        
        return promise;
    }

    /**
     * Adds a new retry job to the queue.
     * @template {(...args: unknown[]) => Promise<unknown>} Func
     * @template {Awaited<ReturnType<Func>>} RetVal
     * @param {Func} fn The function to call.
     * @param {object} [options] The options for the job.
     * @param {AbortSignal} [options.signal] The AbortSignal to monitor for cancellation.
     * @returns {Promise<RetVal>} A promise that resolves when the queue is processed.
     */
    retry(fn, { signal } = {}) {

        signal?.throwIfAborted();

        const { promise, resolve, reject } = createPromise();

        this.#pending.push(() => this.#call(fn, { signal, promise, resolve, reject }));
        this.#processPending();
        
        return promise;
    }


    /**
     * Processes the pending queue and the retry queue.
     * @returns {void}
     */
    #processAll() {
        if (this.pending) {
            this.#processPending();
        }

        if (this.retrying) {
            this.#processQueue();
        }
    }

    /**
     * Processes the pending queue to see which tasks can be started.
     * @returns {void}
     */
    #processPending() {

        debug(`Processing pending tasks: ${this.pending} pending, ${this.working} working.`);

        const available = this.#concurrency - this.working;

        if (available <= 0) {
            return;
        }

        const count = Math.min(this.pending, available);

        for (let i = 0; i < count; i++) {
            const task = this.#pending.shift();
            task?.();
        }

        debug(`Processed pending tasks: ${this.pending} pending, ${this.working} working.`);
    }

    /**
     * Processes the queue.
     * @returns {void}
     */
    #processQueue() {
        // clear any timer because we're going to check right now
        clearTimeout(this.#timerId);
        this.#timerId = undefined;

        debug(`Processing retry queue: ${this.retrying} retrying, ${this.working} working.`);

        const processAgain = () => {
            this.#timerId = setTimeout(() => this.#processAll(), 0);
        };

        // if there's nothing in the queue, we're done
        const task = this.#retrying.shift();
        if (!task) {
            debug("Queue is empty, exiting.");

            if (this.pending) {
                processAgain();
            }
            return;
        }

        // if it's time to bail, then bail
        if (isTimeToBail(task, this.#timeout)) {
            debug(`Task ${task.id} was abandoned due to timeout.`);
            task.reject(task.error);
            processAgain();
            return;
        }

        // if it's not time to retry, then wait and try again
        if (!isTimeToRetry(task, this.#maxDelay)) {
            debug(`Task ${task.id} is not ready to retry, skipping.`);
            this.#retrying.push(task);
            processAgain();
            return;
        }

        // otherwise, try again
        task.lastAttempt = Date.now();
        
        // Promise.resolve needed in case it's a thenable but not a Promise
        Promise.resolve(task.fn())
            // @ts-ignore because we know it's any
            .then(result => {
                debug(`Task ${task.id} succeeded after ${task.age}ms.`);
                task.resolve(result);
            })

            // @ts-ignore because we know it's any
            .catch(error => {
                if (!this.#check(error)) {
                    debug(`Task ${task.id} failed with non-retryable error: ${error.message}.`);
                    task.reject(error);
                    return;
                }

                // update the task timestamp and push to back of queue to try again
                task.lastAttempt = Date.now();
                this.#retrying.push(task);
                debug(`Task ${task.id} failed, requeueing to try again.`);
            })
            .finally(() => {
                this.#processAll();
            });
    }
}

export { Retrier };
fÿwx}{
  "name": "@humanwhocodes/retry",
  "version": "0.4.3",
  "description": "A utility to retry failed async methods.",
  "type": "module",
  "main": "dist/retrier.cjs",
  "module": "dist/retrier.js",
  "types": "dist/retrier.d.ts",
  "exports": {
    "require": {
      "types": "./dist/retrier.d.cts",
      "default": "./dist/retrier.cjs"
    },
    "import": {
      "types": "./dist/retrier.d.ts",
      "default": "./dist/retrier.js"
    }
  },
  "files": [
    "dist"
  ],
  "engines": {
    "node": ">=18.18"
  },
  "publishConfig": {
    "access": "public"
  },
  "gitHooks": {
    "pre-commit": "lint-staged"
  },
  "lint-staged": {
    "*.js": [
      "eslint --fix"
    ]
  },
  "funding": {
    "type": "github",
    "url": "https://github.com/sponsors/nzakas"
  },
  "scripts": {
    "build:cts-types": "node -e \"fs.copyFileSync('dist/retrier.d.ts', 'dist/retrier.d.cts')\"",
    "build": "rollup -c && tsc && npm run build:cts-types",
    "prepare": "npm run build",
    "lint": "eslint src/ tests/",
    "pretest": "npm run build",
    "test:unit": "mocha tests/retrier.test.js",
    "test:build": "node tests/pkg.test.cjs && node tests/pkg.test.mjs",
    "test:jsr": "npx jsr@latest publish --dry-run",
    "test:emfile": "node tools/check-emfile-handling.js",
    "test": "npm run test:unit && npm run test:build"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/humanwhocodes/retry.git"
  },
  "keywords": [
    "nodejs",
    "retry",
    "async",
    "promises"
  ],
  "author": "Nicholas C. Zaks",
  "license": "Apache-2.0",
  "devDependencies": {
    "@eslint/js": "^8.49.0",
    "@rollup/plugin-terser": "0.4.4",
    "@tsconfig/node16": "^16.1.1",
    "@types/mocha": "^10.0.3",
    "@types/node": "20.12.6",
    "eslint": "^8.21.0",
    "lint-staged": "15.2.1",
    "mocha": "^10.3.0",
    "rollup": "3.29.4",
    "typescript": "5.4.4",
    "yorkie": "2.0.0"
  }
}
C(x'40000 debug !/	Uܸ~Qnxb40000 esrecurse 7:OJԭY
'b@+I0<40000 estree q(.(䰊Ɩ40000 hast MKeL<( K40000 json-schema \&_j +B40000 katex 1{Ny"_X(5@ݲ40000 mdast  < 4$<ǋ40000 ms V. ~6;40000 unist />\^O<wg[ ⻲,v	x i100644 LICENSE z&{$Q{+%z100644 README.md ,|>Y !6?}3100644 index.d.ts 8vi:zr`J 6100644 package.json C3#.oҜ0ol7Mx*Copyright (c) 2012, 2013 Thorsten Lorenz <thlorenz@gmx.de>
Copyright (c) 2012 James Halliday <mail@substack.net>
Copyright (c) 2009 Thomas Robinson <280north.com>

This software is released under the MIT license:

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
ώbx.	?    MIT License

    Copyright (c) Microsoft Corporation.

    L
    of &J
    in tI
    to F
    copies of ;
    furnished to do so, b&    O    1    K    SH
    FITNESS C
    AUTHORS OR ;
    LIABILITY, WHETHER B:
    OUT OF OR IN @
    SOFTWARE
M
xE# Installation
> `npm install --save @types/debug`

# Summary
This package contains type definitions for debug (https://github.com/debug-js/debug).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/debug.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/debug/index.d.ts)
````ts
declare var debug: debug.Debug & { debug: debug.Debug; default: debug.Debug };

export = debug;
export as namespace debug;

declare namespace debug {
    interface Debug {
        (namespace: string): Debugger;
        coerce: (val: any) => any;
        disable: () => string;
        enable: (namespaces: string) => void;
        enabled: (namespaces: string) => boolean;
        formatArgs: (this: Debugger, args: any[]) => void;
        log: (...args: any[]) => any;
        selectColor: (namespace: string) => string | number;
        humanize: typeof import("ms");

        names: string[];
        skips: string[];

        formatters: Formatters;

        inspectOpts?: {
            hideDate?: boolean | number | null;
            colors?: boolean | number | null;
            depth?: boolean | number | null;
            showHidden?: boolean | number | null;
        };
    }

    type IDebug = Debug;

    interface Formatters {
        [formatter: string]: (v: any) => string;
    }

    type IDebugger = Debugger;

    interface Debugger {
        (formatter: any, ...args: any[]): void;

        color: string;
        diff: number;
        enabled: boolean;
        log: (...args: any[]) => any;
        namespace: string;
        destroy: () => boolean;
        extend: (namespace: string, delimiter?: string) => Debugger;
    }
}

````

### Additional Details
 * Last updated: Thu, 19 Mar 2026 06:47:22 GMT
 * Dependencies: [@types/ms](https://npmjs.com/package/@types/ms)

# Credits
These definitions were written by [Seon-Wook Park](https://github.com/swook), [Gal Talmor](https://github.com/galtalmor), [John McLaughlin](https://github.com/zamb3zi), [Brasten Sager](https://github.com/brasten), [Nicolas Penin](https://github.com/npenin), [Kristian Brünn](https://github.com/kristianmitk), and [Caleb Gregory](https://github.com/calebgregory).
NTxBdeclare var debug: debug.Debug & { debug: debug.Debug; default: debug.Debug };

export = debug;
export as namespace debug;

declare namespace debug {
    interface Debug {
        (namespace: string): Debugger;
        coerce: (val: any) => any;
        disable: () => string;
        enable: (namespaces: string) => void;
        enabled: (namespaces: string) => boolean;
        formatArgs: (this: Debugger, args: any[]) => void;
        log: (...args: any[]) => any;
        selectColor: (namespace: string) => string | number;
        humanize: typeof import("ms");

        names: string[];
        skips: string[];

        formatters: Formatters;

        inspectOpts?: {
            hideDate?: boolean | number | null;
            colors?: boolean | number | null;
            depth?: boolean | number | null;
            showHidden?: boolean | number | null;
        };
    }

    type IDebug = Debug;

    interface Formatters {
        [formatter: string]: (v: any) => string;
    }

    type IDebugger = Debugger;

    interface Debugger {
        (formatter: any, ...args: any[]): void;

        color: string;
        diff: number;
        enabled: boolean;
        log: (...args: any[]) => any;
        namespace: string;
        destroy: () => boolean;
        extend: (namespace: string, delimiter?: string) => Debugger;
    }
}
lx5{
    "name": "@types/debug",
    "version": "4.1.13",
    "description": "TypeScript definitions for debug",
    "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/debug",
    "license": "MIT",
    "contributors": [
        {
            "name": "Seon-Wook Park",
            "githubUsername": "swook",
            "url": "https://github.com/swook"
        },
        {
            "name": "Gal Talmor",
            "githubUsername": "galtalmor",
            "url": "https://github.com/galtalmor"
        },
        {
            "name": "John McLaughlin",
            "githubUsername": "zamb3zi",
            "url": "https://github.com/zamb3zi"
        },
        {
            "name": "Brasten Sager",
            "githubUsername": "brasten",
            "url": "https://github.com/brasten"
        },
        {
            "name": "Nicolas Penin",
            "githubUsername": "npenin",
            "url": "https://github.com/npenin"
        },
        {
            "name": "Kristian Brünn",
            "githubUsername": "kristianmitk",
            "url": "https://github.com/kristianmitk"
        },
        {
            "name": "Caleb Gregory",
            "githubUsername": "calebgregory",
            "url": "https://github.com/calebgregory"
        }
    ],
    "main": "",
    "types": "index.d.ts",
    "repository": {
        "type": "git",
        "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
        "directory": "types/debug"
    },
    "scripts": {},
    "dependencies": {
        "@types/ms": "*"
    },
    "peerDependencies": {},
    "typesPublisherContentHash": "1c506e100366b85350ff1c28c9cf4cc09e9a07275546bb050993c241c9821cd9",
    "typeScriptVersion": "5.2"
}	x i100644 LICENSE z&{$Q{+%z100644 README.md ZFD[
zZ100644 index.d.ts ?#`XN6k{dj100644 package.json [R^0!fM*`g;7&{xL# Installation
> `npm install --save @types/esrecurse`

# Summary
This package contains type definitions for esrecurse (https://github.com/estools/esrecurse).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/esrecurse.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/esrecurse/index.d.ts)
````ts
/**
 * Options for the Visitor constructor and visit function.
 */
interface VisitorOptions {
    /**
     * Fallback strategy for unknown node types.
     * @default 'iteration'
     */
    fallback?: "iteration" | ((node: any) => string[]);

    /**
     * Custom keys for child nodes by node type.
     * @default {}
     */
    childVisitorKeys?: Record<string, string[]>;
}

/**
 * A visitor class for recursively traversing ECMAScript AST.
 */
declare class Visitor {
    /**
     * Creates a new Visitor instance.
     * @param options Configuration options for the visitor.
     */
    constructor(visitor?: Visitor | null, options?: VisitorOptions | null);

    /**
     * Visits a node, invoking the appropriate handler.
     * @param node The AST node to visit.
     */
    visit(node: any): void;

    /**
     * Visits the children of a node based on childVisitorKeys.
     * @param node The AST node whose children to visit.
     */
    visitChildren(node: any): void;
}

/**
 * Visits an AST node with the specified visitor.
 * @param ast The AST node to traverse.
 * @param visitor A visitor instance or visitor object.
 * @param options Configuration options for the traversal.
 */
declare function visit(
    ast: any,
    visitor?: Visitor | Record<string, (node: any) => void> | null,
    options?: VisitorOptions,
): void;

export { visit, Visitor, type VisitorOptions };

````

### Additional Details
 * Last updated: Sat, 19 Jul 2025 03:47:05 GMT
 * Dependencies: none

# Credits
These definitions were written by [Jimmy Leung](https://github.com/hkleungai).
1Wxq/**
 * Options for the Visitor constructor and visit function.
 */
interface VisitorOptions {
    /**
     * Fallback strategy for unknown node types.
     * @default 'iteration'
     */
    fallback?: "iteration" | ((node: any) => string[]);

    /**
     * Custom keys for child nodes by node type.
     * @default {}
     */
    childVisitorKeys?: Record<string, string[]>;
}

/**
 * A visitor class for recursively traversing ECMAScript AST.
 */
declare class Visitor {
    /**
     * Creates a new Visitor instance.
     * @param options Configuration options for the visitor.
     */
    constructor(visitor?: Visitor | null, options?: VisitorOptions | null);

    /**
     * Visits a node, invoking the appropriate handler.
     * @param node The AST node to visit.
     */
    visit(node: any): void;

    /**
     * Visits the children of a node based on childVisitorKeys.
     * @param node The AST node whose children to visit.
     */
    visitChildren(node: any): void;
}

/**
 * Visits an AST node with the specified visitor.
 * @param ast The AST node to traverse.
 * @param visitor A visitor instance or visitor object.
 * @param options Configuration options for the traversal.
 */
declare function visit(
    ast: any,
    visitor?: Visitor | Record<string, (node: any) => void> | null,
    options?: VisitorOptions,
): void;

export { visit, Visitor, type VisitorOptions };
33x7{
    "name": "@types/esrecurse",
    "version": "4.3.1",
    "description": "TypeScript definitions for esrecurse",
    "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/esrecurse",
    "license": "MIT",
    "contributors": [
        {
            "name": "Jimmy Leung",
            "githubUsername": "hkleungai",
            "url": "https://github.com/hkleungai"
        }
    ],
    "main": "",
    "types": "index.d.ts",
    "repository": {
        "type": "git",
        "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
        "directory": "types/esrecurse"
    },
    "scripts": {},
    "dependencies": {},
    "peerDependencies": {},
    "typesPublisherContentHash": "0e4ed7e0fe84b6879532ce29fdfe397c1fc205d0c9dbc17172b64f3016ae0065",
    "typeScriptVersion": "5.1"
}4x D100644 LICENSE z&{$Q{+%z100644 README.md  >vqhCO100644 flow.d.ts  Z#'5=</100644 index.d.ts }JoBa>SIRbr100644 package.json 6z]&j\H@
b}ADxD# Installation
> `npm install --save @types/estree`

# Summary
This package contains type definitions for estree (https://github.com/estree/estree).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/estree.

### Additional Details
 * Last updated: Wed, 06 May 2026 21:01:00 GMT
 * Dependencies: none

# Credits
These definitions were written by [RReverser](https://github.com/RReverser).
bᱬx>declare namespace ESTree {
    interface FlowTypeAnnotation extends Node {}

    interface FlowBaseTypeAnnotation extends FlowTypeAnnotation {}

    interface FlowLiteralTypeAnnotation extends FlowTypeAnnotation, Literal {}

    interface FlowDeclaration extends Declaration {}

    interface AnyTypeAnnotation extends FlowBaseTypeAnnotation {}

    interface ArrayTypeAnnotation extends FlowTypeAnnotation {
        elementType: FlowTypeAnnotation;
    }

    interface BooleanLiteralTypeAnnotation extends FlowLiteralTypeAnnotation {}

    interface BooleanTypeAnnotation extends FlowBaseTypeAnnotation {}

    interface ClassImplements extends Node {
        id: Identifier;
        typeParameters?: TypeParameterInstantiation | null;
    }

    interface ClassProperty {
        key: Expression;
        value?: Expression | null;
        typeAnnotation?: TypeAnnotation | null;
        computed: boolean;
        static: boolean;
    }

    interface DeclareClass extends FlowDeclaration {
        id: Identifier;
        typeParameters?: TypeParameterDeclaration | null;
        body: ObjectTypeAnnotation;
        extends: InterfaceExtends[];
    }

    interface DeclareFunction extends FlowDeclaration {
        id: Identifier;
    }

    interface DeclareModule extends FlowDeclaration {
        id: Literal | Identifier;
        body: BlockStatement;
    }

    interface DeclareVariable extends FlowDeclaration {
        id: Identifier;
    }

    interface FunctionTypeAnnotation extends FlowTypeAnnotation {
        params: FunctionTypeParam[];
        returnType: FlowTypeAnnotation;
        rest?: FunctionTypeParam | null;
        typeParameters?: TypeParameterDeclaration | null;
    }

    interface FunctionTypeParam {
        name: Identifier;
        typeAnnotation: FlowTypeAnnotation;
        optional: boolean;
    }

    interface GenericTypeAnnotation extends FlowTypeAnnotation {
        id: Identifier | QualifiedTypeIdentifier;
        typeParameters?: TypeParameterInstantiation | null;
    }

    interface InterfaceExtends extends Node {
        id: Identifier | QualifiedTypeIdentifier;
        typeParameters?: TypeParameterInstantiation | null;
    }

    interface InterfaceDeclaration extends FlowDeclaration {
        id: Identifier;
        typeParameters?: TypeParameterDeclaration | null;
        extends: InterfaceExtends[];
        body: ObjectTypeAnnotation;
    }

    interface IntersectionTypeAnnotation extends FlowTypeAnnotation {
        types: FlowTypeAnnotation[];
    }

    interface MixedTypeAnnotation extends FlowBaseTypeAnnotation {}

    interface NullableTypeAnnotation extends FlowTypeAnnotation {
        typeAnnotation: TypeAnnotation;
    }

    interface NumberLiteralTypeAnnotation extends FlowLiteralTypeAnnotation {}

    interface NumberTypeAnnotation extends FlowBaseTypeAnnotation {}

    interface StringLiteralTypeAnnotation extends FlowLiteralTypeAnnotation {}

    interface StringTypeAnnotation extends FlowBaseTypeAnnotation {}

    interface TupleTypeAnnotation extends FlowTypeAnnotation {
        types: FlowTypeAnnotation[];
    }

    interface TypeofTypeAnnotation extends FlowTypeAnnotation {
        argument: FlowTypeAnnotation;
    }

    interface TypeAlias extends FlowDeclaration {
        id: Identifier;
        typeParameters?: TypeParameterDeclaration | null;
        right: FlowTypeAnnotation;
    }

    interface TypeAnnotation extends Node {
        typeAnnotation: FlowTypeAnnotation;
    }

    interface TypeCastExpression extends Expression {
        expression: Expression;
        typeAnnotation: TypeAnnotation;
    }

    interface TypeParameterDeclaration extends Node {
        params: Identifier[];
    }

    interface TypeParameterInstantiation extends Node {
        params: FlowTypeAnnotation[];
    }

    interface ObjectTypeAnnotation extends FlowTypeAnnotation {
        properties: ObjectTypeProperty[];
        indexers: ObjectTypeIndexer[];
        callProperties: ObjectTypeCallProperty[];
    }

    interface ObjectTypeCallProperty extends Node {
        value: FunctionTypeAnnotation;
        static: boolean;
    }

    interface ObjectTypeIndexer extends Node {
        id: Identifier;
        key: FlowTypeAnnotation;
        value: FlowTypeAnnotation;
        static: boolean;
    }

    interface ObjectTypeProperty extends Node {
        key: Expression;
        value: FlowTypeAnnotation;
        optional: boolean;
        static: boolean;
    }

    interface QualifiedTypeIdentifier extends Node {
        qualification: Identifier | QualifiedTypeIdentifier;
        id: Identifier;
    }

    interface UnionTypeAnnotation extends FlowTypeAnnotation {
        types: FlowTypeAnnotation[];
    }

    interface VoidTypeAnnotation extends FlowBaseTypeAnnotation {}
}
6D	xI// This definition file follows a somewhat unusual format. ESTree allows
// runtime type checks based on the `type` parameter. In order to explain this
// to typescript we want to use discriminated union types:
// https://github.com/Microsoft/TypeScript/pull/9163
//
// For ESTree this is a bit tricky because the high level interfaces like
// Node or Function are pulling double duty. We want to pass common fields down
// to the interfaces that extend them (like Identifier or
// ArrowFunctionExpression), but you can't extend a type union or enforce
// common fields on them. So we've split the high level interfaces into two
// types, a base type which passes down inherited fields, and a type union of
// all types which extend the base type. Only the type union is exported, and
// the union is how other types refer to the collection of inheriting types.
//
// This makes the definitions file here somewhat more difficult to maintain,
// but it has the notable advantage of making ESTree much easier to use as
// an end user.

export interface BaseNodeWithoutComments {
    // Every leaf interface that extends BaseNode must specify a type property.
    // The type property should be a string literal. For example, Identifier
    // has: `type: "Identifier"`
    type: string;
    loc?: SourceLocation | null | undefined;
    range?: [number, number] | undefined;
}

export interface BaseNode extends BaseNodeWithoutComments {
    leadingComments?: Comment[] | undefined;
    trailingComments?: Comment[] | undefined;
}

export interface NodeMap {
    AssignmentProperty: AssignmentProperty;
    CatchClause: CatchClause;
    Class: Class;
    ClassBody: ClassBody;
    Expression: Expression;
    Function: Function;
    Identifier: Identifier;
    Literal: Literal;
    MethodDefinition: MethodDefinition;
    ModuleDeclaration: ModuleDeclaration;
    ModuleSpecifier: ModuleSpecifier;
    Pattern: Pattern;
    PrivateIdentifier: PrivateIdentifier;
    Program: Program;
    Property: Property;
    PropertyDefinition: PropertyDefinition;
    SpreadElement: SpreadElement;
    Statement: Statement;
    Super: Super;
    SwitchCase: SwitchCase;
    TemplateElement: TemplateElement;
    VariableDeclarator: VariableDeclarator;
}

export type Node = NodeMap[keyof NodeMap];

export interface Comment extends BaseNodeWithoutComments {
    type: "Line" | "Block";
    value: string;
}

export interface SourceLocation {
    source?: string | null | undefined;
    start: Position;
    end: Position;
}

export interface Position {
    /** >= 1 */
    line: number;
    /** >= 0 */
    column: number;
}

export interface Program extends BaseNode {
    type: "Program";
    sourceType: "script" | "module";
    body: Array<Directive | Statement | ModuleDeclaration>;
    comments?: Comment[] | undefined;
}

export interface Directive extends BaseNode {
    type: "ExpressionStatement";
    expression: Literal;
    directive: string;
}

export interface BaseFunction extends BaseNode {
    params: Pattern[];
    generator?: boolean | undefined;
    async?: boolean | undefined;
    // The body is either BlockStatement or Expression because arrow functions
    // can have a body that's either. FunctionDeclarations and
    // FunctionExpressions have only BlockStatement bodies.
    body: BlockStatement | Expression;
}

export type Function = FunctionDeclaration | FunctionExpression | ArrowFunctionExpression;

export type Statement =
    | ExpressionStatement
    | BlockStatement
    | StaticBlock
    | EmptyStatement
    | DebuggerStatement
    | WithStatement
    | ReturnStatement
    | LabeledStatement
    | BreakStatement
    | ContinueStatement
    | IfStatement
    | SwitchStatement
    | ThrowStatement
    | TryStatement
    | WhileStatement
    | DoWhileStatement
    | ForStatement
    | ForInStatement
    | ForOfStatement
    | Declaration;

export interface BaseStatement extends BaseNode {}

export interface EmptyStatement extends BaseStatement {
    type: "EmptyStatement";
}

export interface BlockStatement extends BaseStatement {
    type: "BlockStatement";
    body: Statement[];
    innerComments?: Comment[] | undefined;
}

export interface StaticBlock extends Omit<BlockStatement, "type"> {
    type: "StaticBlock";
}

export interface ExpressionStatement extends BaseStatement {
    type: "ExpressionStatement";
    expression: Expression;
}

export interface IfStatement extends BaseStatement {
    type: "IfStatement";
    test: Expression;
    consequent: Statement;
    alternate?: Statement | null | undefined;
}

export interface LabeledStatement extends BaseStatement {
    type: "LabeledStatement";
    label: Identifier;
    body: Statement;
}

export interface BreakStatement extends BaseStatement {
    type: "BreakStatement";
    label?: Identifier | null | undefined;
}

export interface ContinueStatement extends BaseStatement {
    type: "ContinueStatement";
    label?: Identifier | null | undefined;
}

export interface WithStatement extends BaseStatement {
    type: "WithStatement";
    object: Expression;
    body: Statement;
}

export interface SwitchStatement extends BaseStatement {
    type: "SwitchStatement";
    discriminant: Expression;
    cases: SwitchCase[];
}

export interface ReturnStatement extends BaseStatement {
    type: "ReturnStatement";
    argument?: Expression | null | undefined;
}

export interface ThrowStatement extends BaseStatement {
    type: "ThrowStatement";
    argument: Expression;
}

export interface TryStatement extends BaseStatement {
    type: "TryStatement";
    block: BlockStatement;
    handler?: CatchClause | null | undefined;
    finalizer?: BlockStatement | null | undefined;
}

export interface WhileStatement extends BaseStatement {
    type: "WhileStatement";
    test: Expression;
    body: Statement;
}

export interface DoWhileStatement extends BaseStatement {
    type: "DoWhileStatement";
    body: Statement;
    test: Expression;
}

export interface ForStatement extends BaseStatement {
    type: "ForStatement";
    init?: VariableDeclaration | Expression | null | undefined;
    test?: Expression | null | undefined;
    update?: Expression | null | undefined;
    body: Statement;
}

export interface BaseForXStatement extends BaseStatement {
    left: VariableDeclaration | Pattern;
    right: Expression;
    body: Statement;
}

export interface ForInStatement extends BaseForXStatement {
    type: "ForInStatement";
}

export interface DebuggerStatement extends BaseStatement {
    type: "DebuggerStatement";
}

export type Declaration = FunctionDeclaration | VariableDeclaration | ClassDeclaration;

export interface BaseDeclaration extends BaseStatement {}

export interface MaybeNamedFunctionDeclaration extends BaseFunction, BaseDeclaration {
    type: "FunctionDeclaration";
    /** It is null when a function declaration is a part of the `export default function` statement */
    id: Identifier | null;
    body: BlockStatement;
}

export interface FunctionDeclaration extends MaybeNamedFunctionDeclaration {
    id: Identifier;
}

export interface VariableDeclaration extends BaseDeclaration {
    type: "VariableDeclaration";
    declarations: VariableDeclarator[];
    kind: "var" | "let" | "const" | "using" | "await using";
}

export interface VariableDeclarator extends BaseNode {
    type: "VariableDeclarator";
    id: Pattern;
    init?: Expression | null | undefined;
}

export interface ExpressionMap {
    ArrayExpression: ArrayExpression;
    ArrowFunctionExpression: ArrowFunctionExpression;
    AssignmentExpression: AssignmentExpression;
    AwaitExpression: AwaitExpression;
    BinaryExpression: BinaryExpression;
    CallExpression: CallExpression;
    ChainExpression: ChainExpression;
    ClassExpression: ClassExpression;
    ConditionalExpression: ConditionalExpression;
    FunctionExpression: FunctionExpression;
    Identifier: Identifier;
    ImportExpression: ImportExpression;
    Literal: Literal;
    LogicalExpression: LogicalExpression;
    MemberExpression: MemberExpression;
    MetaProperty: MetaProperty;
    NewExpression: NewExpression;
    ObjectExpression: ObjectExpression;
    SequenceExpression: SequenceExpression;
    TaggedTemplateExpression: TaggedTemplateExpression;
    TemplateLiteral: TemplateLiteral;
    ThisExpression: ThisExpression;
    UnaryExpression: UnaryExpression;
    UpdateExpression: UpdateExpression;
    YieldExpression: YieldExpression;
}

export type Expression = ExpressionMap[keyof ExpressionMap];

export interface BaseExpression extends BaseNode {}

export type ChainElement = SimpleCallExpression | MemberExpression;

export interface ChainExpression extends BaseExpression {
    type: "ChainExpression";
    expression: ChainElement;
}

export interface ThisExpression extends BaseExpression {
    type: "ThisExpression";
}

export interface ArrayExpression extends BaseExpression {
    type: "ArrayExpression";
    elements: Array<Expression | SpreadElement | null>;
}

export interface ObjectExpression extends BaseExpression {
    type: "ObjectExpression";
    properties: Array<Property | SpreadElement>;
}

export interface PrivateIdentifier extends BaseNode {
    type: "PrivateIdentifier";
    name: string;
}

export interface Property extends BaseNode {
    type: "Property";
    key: Expression;
    value: Expression | Pattern; // Could be an AssignmentProperty
    kind: "init" | "get" | "set";
    method: boolean;
    shorthand: boolean;
    computed: boolean;
}

export interface PropertyDefinition extends BaseNode {
    type: "PropertyDefinition";
    key: Expression | PrivateIdentifier;
    value?: Expression | null | undefined;
    computed: boolean;
    static: boolean;
}

export interface FunctionExpression extends BaseFunction, BaseExpression {
    id?: Identifier | null | undefined;
    type: "FunctionExpression";
    body: BlockStatement;
}

export interface SequenceExpression extends BaseExpression {
    type: "SequenceExpression";
    expressions: Expression[];
}

export interface UnaryExpression extends BaseExpression {
    type: "UnaryExpression";
    operator: UnaryOperator;
    prefix: true;
    argument: Expression;
}

export interface BinaryExpression extends BaseExpression {
    type: "BinaryExpression";
    operator: BinaryOperator;
    left: Expression | PrivateIdentifier;
    right: Expression;
}

export interface AssignmentExpression extends BaseExpression {
    type: "AssignmentExpression";
    operator: AssignmentOperator;
    left: Pattern | MemberExpression;
    right: Expression;
}

export interface UpdateExpression extends BaseExpression {
    type: "UpdateExpression";
    operator: UpdateOperator;
    argument: Expression;
    prefix: boolean;
}

export interface LogicalExpression extends BaseExpression {
    type: "LogicalExpression";
    operator: LogicalOperator;
    left: Expression;
    right: Expression;
}

export interface ConditionalExpression extends BaseExpression {
    type: "ConditionalExpression";
    test: Expression;
    alternate: Expression;
    consequent: Expression;
}

export interface BaseCallExpression extends BaseExpression {
    callee: Expression | Super;
    arguments: Array<Expression | SpreadElement>;
}
export type CallExpression = SimpleCallExpression | NewExpression;

export interface SimpleCallExpression extends BaseCallExpression {
    type: "CallExpression";
    optional: boolean;
}

export interface NewExpression extends BaseCallExpression {
    type: "NewExpression";
}

export interface MemberExpression extends BaseExpression, BasePattern {
    type: "MemberExpression";
    object: Expression | Super;
    property: Expression | PrivateIdentifier;
    computed: boolean;
    optional: boolean;
}

export type Pattern = Identifier | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | MemberExpression;

export interface BasePattern extends BaseNode {}

export interface SwitchCase extends BaseNode {
    type: "SwitchCase";
    test?: Expression | null | undefined;
    consequent: Statement[];
}

export interface CatchClause extends BaseNode {
    type: "CatchClause";
    param: Pattern | null;
    body: BlockStatement;
}

export interface Identifier extends BaseNode, BaseExpression, BasePattern {
    type: "Identifier";
    name: string;
}

export type Literal = SimpleLiteral | RegExpLiteral | BigIntLiteral;

export interface SimpleLiteral extends BaseNode, BaseExpression {
    type: "Literal";
    value: string | boolean | number | null;
    raw?: string | undefined;
}

export interface RegExpLiteral extends BaseNode, BaseExpression {
    type: "Literal";
    value?: RegExp | null | undefined;
    regex: {
        pattern: string;
        flags: string;
    };
    raw?: string | undefined;
}

export interface BigIntLiteral extends BaseNode, BaseExpression {
    type: "Literal";
    value?: bigint | null | undefined;
    bigint: string;
    raw?: string | undefined;
}

export type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";

export type BinaryOperator =
    | "=="
    | "!="
    | "==="
    | "!=="
    | "<"
    | "<="
    | ">"
    | ">="
    | "<<"
    | ">>"
    | ">>>"
    | "+"
    | "-"
    | "*"
    | "/"
    | "%"
    | "**"
    | "|"
    | "^"
    | "&"
    | "in"
    | "instanceof";

export type LogicalOperator = "||" | "&&" | "??";

export type AssignmentOperator =
    | "="
    | "+="
    | "-="
    | "*="
    | "/="
    | "%="
    | "**="
    | "<<="
    | ">>="
    | ">>>="
    | "|="
    | "^="
    | "&="
    | "||="
    | "&&="
    | "??=";

export type UpdateOperator = "++" | "--";

export interface ForOfStatement extends BaseForXStatement {
    type: "ForOfStatement";
    await: boolean;
}

export interface Super extends BaseNode {
    type: "Super";
}

export interface SpreadElement extends BaseNode {
    type: "SpreadElement";
    argument: Expression;
}

export interface ArrowFunctionExpression extends BaseExpression, BaseFunction {
    type: "ArrowFunctionExpression";
    expression: boolean;
    body: BlockStatement | Expression;
}

export interface YieldExpression extends BaseExpression {
    type: "YieldExpression";
    argument?: Expression | null | undefined;
    delegate: boolean;
}

export interface TemplateLiteral extends BaseExpression {
    type: "TemplateLiteral";
    quasis: TemplateElement[];
    expressions: Expression[];
}

export interface TaggedTemplateExpression extends BaseExpression {
    type: "TaggedTemplateExpression";
    tag: Expression;
    quasi: TemplateLiteral;
}

export interface TemplateElement extends BaseNode {
    type: "TemplateElement";
    tail: boolean;
    value: {
        /** It is null when the template literal is tagged and the text has an invalid escape (e.g. - tag`\unicode and \u{55}`) */
        cooked?: string | null | undefined;
        raw: string;
    };
}

export interface AssignmentProperty extends Property {
    value: Pattern;
    kind: "init";
    method: boolean; // false
}

export interface ObjectPattern extends BasePattern {
    type: "ObjectPattern";
    properties: Array<AssignmentProperty | RestElement>;
}

export interface ArrayPattern extends BasePattern {
    type: "ArrayPattern";
    elements: Array<Pattern | null>;
}

export interface RestElement extends BasePattern {
    type: "RestElement";
    argument: Pattern;
}

export interface AssignmentPattern extends BasePattern {
    type: "AssignmentPattern";
    left: Pattern;
    right: Expression;
}

export type Class = ClassDeclaration | ClassExpression;
export interface BaseClass extends BaseNode {
    superClass?: Expression | null | undefined;
    body: ClassBody;
}

export interface ClassBody extends BaseNode {
    type: "ClassBody";
    body: Array<MethodDefinition | PropertyDefinition | StaticBlock>;
}

export interface MethodDefinition extends BaseNode {
    type: "MethodDefinition";
    key: Expression | PrivateIdentifier;
    value: FunctionExpression;
    kind: "constructor" | "method" | "get" | "set";
    computed: boolean;
    static: boolean;
}

export interface MaybeNamedClassDeclaration extends BaseClass, BaseDeclaration {
    type: "ClassDeclaration";
    /** It is null when a class declaration is a part of the `export default class` statement */
    id: Identifier | null;
}

export interface ClassDeclaration extends MaybeNamedClassDeclaration {
    id: Identifier;
}

export interface ClassExpression extends BaseClass, BaseExpression {
    type: "ClassExpression";
    id?: Identifier | null | undefined;
}

export interface MetaProperty extends BaseExpression {
    type: "MetaProperty";
    meta: Identifier;
    property: Identifier;
}

export type ModuleDeclaration =
    | ImportDeclaration
    | ExportNamedDeclaration
    | ExportDefaultDeclaration
    | ExportAllDeclaration;
export interface BaseModuleDeclaration extends BaseNode {}

export type ModuleSpecifier = ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier;
export interface BaseModuleSpecifier extends BaseNode {
    local: Identifier;
}

export interface ImportDeclaration extends BaseModuleDeclaration {
    type: "ImportDeclaration";
    specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>;
    attributes: ImportAttribute[];
    source: Literal;
}

export interface ImportSpecifier extends BaseModuleSpecifier {
    type: "ImportSpecifier";
    imported: Identifier | Literal;
}

export interface ImportAttribute extends BaseNode {
    type: "ImportAttribute";
    key: Identifier | Literal;
    value: Literal;
}

export interface ImportExpression extends BaseExpression {
    type: "ImportExpression";
    source: Expression;
    options?: Expression | null | undefined;
}

export interface ImportDefaultSpecifier extends BaseModuleSpecifier {
    type: "ImportDefaultSpecifier";
}

export interface ImportNamespaceSpecifier extends BaseModuleSpecifier {
    type: "ImportNamespaceSpecifier";
}

export interface ExportNamedDeclaration extends BaseModuleDeclaration {
    type: "ExportNamedDeclaration";
    declaration?: Declaration | null | undefined;
    specifiers: ExportSpecifier[];
    attributes: ImportAttribute[];
    source?: Literal | null | undefined;
}

export interface ExportSpecifier extends Omit<BaseModuleSpecifier, "local"> {
    type: "ExportSpecifier";
    local: Identifier | Literal;
    exported: Identifier | Literal;
}

export interface ExportDefaultDeclaration extends BaseModuleDeclaration {
    type: "ExportDefaultDeclaration";
    declaration: MaybeNamedFunctionDeclaration | MaybeNamedClassDeclaration | Expression;
}

export interface ExportAllDeclaration extends BaseModuleDeclaration {
    type: "ExportAllDeclaration";
    exported: Identifier | Literal | null;
    attributes: ImportAttribute[];
    source: Literal;
}

export interface AwaitExpression extends BaseExpression {
    type: "AwaitExpression";
    argument: Expression;
}
AE93x={
    "name": "@types/estree",
    "version": "1.0.9",
    "description": "TypeScript definitions for estree",
    "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/estree",
    "license": "MIT",
    "contributors": [
        {
            "name": "RReverser",
            "githubUsername": "RReverser",
            "url": "https://github.com/RReverser"
        }
    ],
    "main": "",
    "types": "index.d.ts",
    "repository": {
        "type": "git",
        "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
        "directory": "types/estree"
    },
    "scripts": {},
    "dependencies": {},
    "peerDependencies": {},
    "typesPublisherContentHash": "db16da859cb0bee641414117047a4becba2e9f39d3e14a6745f887c47ef68482",
    "typeScriptVersion": "5.3",
    "nonNpm": true
}|	x i100644 LICENSE z&{$Q{+%z100644 README.md _&Lq.`
eM100644 index.d.ts ª4daFSӚnw\100644 package.json ?]w+OqnT_w9jul7$+xL# Installation
> `npm install --save @types/mdast`

# Summary
This package contains type definitions for mdast (https://github.com/syntax-tree/mdast).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/mdast.

### Additional Details
 * Last updated: Tue, 14 May 2024 07:35:36 GMT
 * Dependencies: [@types/unist](https://npmjs.com/package/@types/unist)

# Credits
These definitions were written by [Christian Murphy](https://github.com/ChristianMurphy), [Jun Lu](https://github.com/lujun2), [Remco Haszing](https://github.com/remcohaszing), [Titus Wormer](https://github.com/wooorm), and [Remco Haszing](https://github.com/remcohaszing).
	@x c,h.;hast `syntax-tree/hoh/hu, 09 Jul 2026 11:00:13I{lukeggchapman_lukeggchapman), [Junyoung Choiokt33r),:/, andQ*.
0`x|,import type { Data as UnistData, Literal as UnistLiteral, Node as UnistNode, Parent as UnistParent } from "unist";

// ## Interfaces

/**
 * Info associated with hast nodes by the ecosystem.
 *
 * This space is guaranteed to never be specified by unist or hast.
 * But you can use it in utilities and plugins to store data.
 *
 * This type can be augmented to register custom data.
 * For example:
 *
 * ```ts
 * declare module 'hast' {
 *   interface Data {
 *     // `someNode.data.myId` is typed as `number | undefined`
 *     myId?: number | undefined
 *   }
 * }
 * ```
 */
export interface Data extends UnistData {}

/**
 * Info associated with an element.
 */
export interface Properties {
    abbr?: string | undefined;
    about?: Array<string> | undefined;
    accentHeight?: number | string | undefined;
    accept?: Array<string> | undefined;
    acceptCharset?: Array<string> | undefined;
    accessKey?: Array<string> | undefined;
    accumulate?: string | undefined;
    action?: string | undefined;
    additive?: string | undefined;
    align?: string | undefined;
    alignmentBaseline?: string | undefined;
    aLink?: string | undefined;
    allow?: string | undefined;
    allowFullScreen?: boolean | string | undefined;
    allowPaymentRequest?: boolean | string | undefined;
    allowTransparency?: string | undefined;
    allowUserMedia?: boolean | string | undefined;
    alpha?: boolean | string | undefined;
    alphabetic?: number | string | undefined;
    alt?: string | undefined;
    amplitude?: number | string | undefined;
    arabicForm?: string | undefined;
    archive?: Array<string> | undefined;
    ariaActiveDescendant?: string | undefined;
    ariaAtomic?: "false" | "true" | (string & {}) | undefined;
    ariaAutoComplete?: string | undefined;
    ariaBusy?: "false" | "true" | (string & {}) | undefined;
    ariaChecked?: "false" | "true" | (string & {}) | undefined;
    ariaColCount?: number | string | undefined;
    ariaColIndex?: number | string | undefined;
    ariaColSpan?: number | string | undefined;
    ariaControls?: Array<string> | undefined;
    ariaCurrent?: string | undefined;
    ariaDescribedBy?: Array<string> | undefined;
    ariaDetails?: string | undefined;
    ariaDisabled?: "false" | "true" | (string & {}) | undefined;
    ariaDropEffect?: Array<string> | undefined;
    ariaErrorMessage?: string | undefined;
    ariaExpanded?: "false" | "true" | (string & {}) | undefined;
    ariaFlowTo?: Array<string> | undefined;
    ariaGrabbed?: "false" | "true" | (string & {}) | undefined;
    ariaHasPopup?: string | undefined;
    ariaHidden?: "false" | "true" | (string & {}) | undefined;
    ariaInvalid?: string | undefined;
    ariaKeyShortcuts?: string | undefined;
    ariaLabel?: string | undefined;
    ariaLabelledBy?: Array<string> | undefined;
    ariaLevel?: number | string | undefined;
    ariaLive?: string | undefined;
    ariaModal?: "false" | "true" | (string & {}) | undefined;
    ariaMultiLine?: "false" | "true" | (string & {}) | undefined;
    ariaMultiSelectable?: "false" | "true" | (string & {}) | undefined;
    ariaOrientation?: string | undefined;
    ariaOwns?: Array<string> | undefined;
    ariaPlaceholder?: string | undefined;
    ariaPosInSet?: number | string | undefined;
    ariaPressed?: "false" | "true" | (string & {}) | undefined;
    ariaReadOnly?: "false" | "true" | (string & {}) | undefined;
    ariaRelevant?: string | undefined;
    ariaRequired?: "false" | "true" | (string & {}) | undefined;
    ariaRoleDescription?: Array<string> | undefined;
    ariaRowCount?: number | string | undefined;
    ariaRowIndex?: number | string | undefined;
    ariaRowSpan?: number | string | undefined;
    ariaSelected?: "false" | "true" | (string & {}) | undefined;
    ariaSetSize?: number | string | undefined;
    ariaSort?: string | undefined;
    ariaValueMax?: number | string | undefined;
    ariaValueMin?: number | string | undefined;
    ariaValueNow?: number | string | undefined;
    ariaValueText?: string | undefined;
    as?: string | undefined;
    ascent?: number | string | undefined;
    async?: boolean | string | undefined;
    attributeName?: string | undefined;
    attributeType?: string | undefined;
    autoCapitalize?: string | undefined;
    autoComplete?: Array<string> | undefined;
    autoCorrect?: string | undefined;
    autoFocus?: boolean | string | undefined;
    autoPlay?: boolean | string | undefined;
    autoSave?: string | undefined;
    axis?: string | undefined;
    azimuth?: number | string | undefined;
    background?: string | undefined;
    bandwidth?: string | undefined;
    baseFrequency?: string | undefined;
    baselineShift?: string | undefined;
    baseProfile?: string | undefined;
    bbox?: string | undefined;
    begin?: string | undefined;
    bgColor?: string | undefined;
    bias?: number | string | undefined;
    blocking?: Array<string> | undefined;
    border?: number | string | undefined;
    borderColor?: string | undefined;
    bottomMargin?: number | string | undefined;
    by?: string | undefined;
    calcMode?: string | undefined;
    capHeight?: number | string | undefined;
    capture?: string | undefined;
    cellPadding?: string | undefined;
    cellSpacing?: string | undefined;
    char?: string | undefined;
    charOff?: string | undefined;
    charSet?: string | undefined;
    checked?: boolean | string | undefined;
    cite?: string | undefined;
    classId?: string | undefined;
    className?: Array<string> | undefined;
    clear?: string | undefined;
    clip?: string | undefined;
    clipPath?: string | undefined;
    clipPathUnits?: string | undefined;
    clipRule?: string | undefined;
    closedBy?: string | undefined;
    code?: string | undefined;
    codeBase?: string | undefined;
    codeType?: string | undefined;
    color?: string | undefined;
    colorInterpolation?: string | undefined;
    colorInterpolationFilters?: string | undefined;
    colorProfile?: string | undefined;
    colorRendering?: string | undefined;
    colorSpace?: string | undefined;
    cols?: number | string | undefined;
    colSpan?: number | string | undefined;
    command?: string | undefined;
    commandFor?: string | undefined;
    compact?: boolean | string | undefined;
    content?: string | undefined;
    contentEditable?: "false" | "true" | (string & {}) | undefined;
    contentScriptType?: string | undefined;
    contentStyleType?: string | undefined;
    controls?: boolean | string | undefined;
    controlsList?: Array<string> | undefined;
    coords?: Array<number | string> | undefined;
    credentialless?: boolean | string | undefined;
    crossOrigin?: string | undefined;
    cursor?: string | undefined;
    cx?: string | undefined;
    cy?: string | undefined;
    d?: string | undefined;
    data?: string | undefined;
    dataType?: string | undefined;
    dateTime?: string | undefined;
    declare?: boolean | string | undefined;
    decoding?: string | undefined;
    default?: boolean | string | undefined;
    defaultAction?: string | undefined;
    defer?: boolean | string | undefined;
    descent?: number | string | undefined;
    diffuseConstant?: number | string | undefined;
    dir?: string | undefined;
    direction?: string | undefined;
    dirName?: string | undefined;
    disabled?: boolean | string | undefined;
    disablePictureInPicture?: boolean | string | undefined;
    disableRemotePlayback?: boolean | string | undefined;
    display?: string | undefined;
    divisor?: number | string | undefined;
    dominantBaseline?: string | undefined;
    download?: boolean | string | undefined;
    draggable?: "false" | "true" | (string & {}) | undefined;
    dur?: string | undefined;
    dx?: string | undefined;
    dy?: string | undefined;
    edgeMode?: string | undefined;
    editable?: string | undefined;
    elevation?: number | string | undefined;
    enableBackground?: string | undefined;
    encType?: string | undefined;
    end?: string | undefined;
    enterKeyHint?: string | undefined;
    event?: string | undefined;
    exponent?: number | string | undefined;
    exportParts?: Array<string> | undefined;
    externalResourcesRequired?: string | undefined;
    face?: string | undefined;
    fetchPriority?: string | undefined;
    fill?: string | undefined;
    fillOpacity?: number | string | undefined;
    fillRule?: string | undefined;
    filter?: string | undefined;
    filterRes?: string | undefined;
    filterUnits?: string | undefined;
    floodColor?: string | undefined;
    floodOpacity?: string | undefined;
    focusable?: string | undefined;
    focusHighlight?: string | undefined;
    fontFamily?: string | undefined;
    fontSize?: string | undefined;
    fontSizeAdjust?: string | undefined;
    fontStretch?: string | undefined;
    fontStyle?: string | undefined;
    fontVariant?: string | undefined;
    fontWeight?: string | undefined;
    form?: string | undefined;
    formAction?: string | undefined;
    format?: string | undefined;
    formEncType?: string | undefined;
    formMethod?: string | undefined;
    formNoValidate?: boolean | string | undefined;
    formTarget?: string | undefined;
    fr?: string | undefined;
    frame?: string | undefined;
    frameBorder?: string | undefined;
    from?: string | undefined;
    fx?: string | undefined;
    fy?: string | undefined;
    g1?: Array<string> | undefined;
    g2?: Array<string> | undefined;
    glyphName?: Array<string> | undefined;
    glyphOrientationHorizontal?: string | undefined;
    glyphOrientationVertical?: string | undefined;
    glyphRef?: string | undefined;
    gradientTransform?: string | undefined;
    gradientUnits?: string | undefined;
    handler?: string | undefined;
    hanging?: number | string | undefined;
    hatchContentUnits?: string | undefined;
    hatchUnits?: string | undefined;
    headers?: Array<string> | undefined;
    height?: number | string | undefined;
    hidden?: boolean | string | undefined;
    high?: number | string | undefined;
    horizAdvX?: number | string | undefined;
    horizOriginX?: number | string | undefined;
    horizOriginY?: number | string | undefined;
    href?: string | undefined;
    hrefLang?: string | undefined;
    hSpace?: number | string | undefined;
    htmlFor?: Array<string> | undefined;
    httpEquiv?: Array<string> | undefined;
    id?: string | undefined;
    ideographic?: number | string | undefined;
    imageRendering?: string | undefined;
    imageSizes?: string | undefined;
    imageSrcSet?: string | undefined;
    in?: string | undefined;
    in2?: string | undefined;
    inert?: boolean | string | undefined;
    initialVisibility?: string | undefined;
    inputMode?: string | undefined;
    integrity?: string | undefined;
    intercept?: number | string | undefined;
    is?: string | undefined;
    isMap?: boolean | string | undefined;
    itemId?: string | undefined;
    itemProp?: Array<string> | undefined;
    itemRef?: Array<string> | undefined;
    itemScope?: boolean | string | undefined;
    itemType?: Array<string> | undefined;
    k?: number | string | undefined;
    k1?: number | string | undefined;
    k2?: number | string | undefined;
    k3?: number | string | undefined;
    k4?: number | string | undefined;
    kernelMatrix?: Array<string> | undefined;
    kernelUnitLength?: string | undefined;
    kerning?: string | undefined;
    keyPoints?: string | undefined;
    keySplines?: string | undefined;
    keyTimes?: string | undefined;
    kind?: string | undefined;
    label?: string | undefined;
    lang?: string | undefined;
    language?: string | undefined;
    leftMargin?: number | string | undefined;
    lengthAdjust?: string | undefined;
    letterSpacing?: string | undefined;
    lightingColor?: string | undefined;
    limitingConeAngle?: number | string | undefined;
    link?: string | undefined;
    list?: string | undefined;
    loading?: string | undefined;
    local?: string | undefined;
    longDesc?: string | undefined;
    loop?: boolean | string | undefined;
    low?: number | string | undefined;
    lowSrc?: string | undefined;
    manifest?: string | undefined;
    marginHeight?: number | string | undefined;
    marginWidth?: number | string | undefined;
    markerEnd?: string | undefined;
    markerHeight?: string | undefined;
    markerMid?: string | undefined;
    markerStart?: string | undefined;
    markerUnits?: string | undefined;
    markerWidth?: string | undefined;
    mask?: string | undefined;
    maskContentUnits?: string | undefined;
    maskType?: string | undefined;
    maskUnits?: string | undefined;
    mathematical?: string | undefined;
    max?: string | undefined;
    maxLength?: number | string | undefined;
    media?: string | undefined;
    mediaCharacterEncoding?: string | undefined;
    mediaContentEncodings?: string | undefined;
    mediaSize?: number | string | undefined;
    mediaTime?: string | undefined;
    method?: string | undefined;
    min?: string | undefined;
    minLength?: number | string | undefined;
    mode?: string | undefined;
    multiple?: boolean | string | undefined;
    muted?: boolean | string | undefined;
    name?: string | undefined;
    navDown?: string | undefined;
    navDownLeft?: string | undefined;
    navDownRight?: string | undefined;
    navLeft?: string | undefined;
    navNext?: string | undefined;
    navPrev?: string | undefined;
    navRight?: string | undefined;
    navUp?: string | undefined;
    navUpLeft?: string | undefined;
    navUpRight?: string | undefined;
    noHref?: boolean | string | undefined;
    noModule?: boolean | string | undefined;
    nonce?: string | undefined;
    noResize?: boolean | string | undefined;
    noShade?: boolean | string | undefined;
    noValidate?: boolean | string | undefined;
    noWrap?: boolean | string | undefined;
    numOctaves?: string | undefined;
    object?: string | undefined;
    observer?: string | undefined;
    offset?: string | undefined;
    onAbort?: string | undefined;
    onActivate?: string | undefined;
    onAfterPrint?: string | undefined;
    onAuxClick?: string | undefined;
    onBeforeMatch?: string | undefined;
    onBeforePrint?: string | undefined;
    onBeforeToggle?: string | undefined;
    onBeforeUnload?: string | undefined;
    onBegin?: string | undefined;
    onBlur?: string | undefined;
    onCancel?: string | undefined;
    onCanPlay?: string | undefined;
    onCanPlayThrough?: string | undefined;
    onChange?: string | undefined;
    onClick?: string | undefined;
    onClose?: string | undefined;
    onContextLost?: string | undefined;
    onContextMenu?: string | undefined;
    onContextRestored?: string | undefined;
    onCopy?: string | undefined;
    onCueChange?: string | undefined;
    onCut?: string | undefined;
    onDblClick?: string | undefined;
    onDrag?: string | undefined;
    onDragEnd?: string | undefined;
    onDragEnter?: string | undefined;
    onDragExit?: string | undefined;
    onDragLeave?: string | undefined;
    onDragOver?: string | undefined;
    onDragStart?: string | undefined;
    onDrop?: string | undefined;
    onDurationChange?: string | undefined;
    onEmptied?: string | undefined;
    onEnd?: string | undefined;
    onEnded?: string | undefined;
    onError?: string | undefined;
    onFocus?: string | undefined;
    onFocusIn?: string | undefined;
    onFocusOut?: string | undefined;
    onFormData?: string | undefined;
    onHashChange?: string | undefined;
    onInput?: string | undefined;
    onInvalid?: string | undefined;
    onKeyDown?: string | undefined;
    onKeyPress?: string | undefined;
    onKeyUp?: string | undefined;
    onLanguageChange?: string | undefined;
    onLoad?: string | undefined;
    onLoadedData?: string | undefined;
    onLoadedMetadata?: string | undefined;
    onLoadEnd?: string | undefined;
    onLoadStart?: string | undefined;
    onMessage?: string | undefined;
    onMessageError?: string | undefined;
    onMouseDown?: string | undefined;
    onMouseEnter?: string | undefined;
    onMouseLeave?: string | undefined;
    onMouseMove?: string | undefined;
    onMouseOut?: string | undefined;
    onMouseOver?: string | undefined;
    onMouseUp?: string | undefined;
    onMouseWheel?: string | undefined;
    onOffline?: string | undefined;
    onOnline?: string | undefined;
    onPageHide?: string | undefined;
    onPageShow?: string | undefined;
    onPaste?: string | undefined;
    onPause?: string | undefined;
    onPlay?: string | undefined;
    onPlaying?: string | undefined;
    onPopState?: string | undefined;
    onProgress?: string | undefined;
    onRateChange?: string | undefined;
    onRejectionHandled?: string | undefined;
    onRepeat?: string | undefined;
    onReset?: string | undefined;
    onResize?: string | undefined;
    onScroll?: string | undefined;
    onScrollEnd?: string | undefined;
    onSecurityPolicyViolation?: string | undefined;
    onSeeked?: string | undefined;
    onSeeking?: string | undefined;
    onSelect?: string | undefined;
    onShow?: string | undefined;
    onSlotChange?: string | undefined;
    onStalled?: string | undefined;
    onStorage?: string | undefined;
    onSubmit?: string | undefined;
    onSuspend?: string | undefined;
    onTimeUpdate?: string | undefined;
    onToggle?: string | undefined;
    onUnhandledRejection?: string | undefined;
    onUnload?: string | undefined;
    onVolumeChange?: string | undefined;
    onWaiting?: string | undefined;
    onWheel?: string | undefined;
    onZoom?: string | undefined;
    opacity?: string | undefined;
    open?: boolean | string | undefined;
    operator?: string | undefined;
    optimum?: number | string | undefined;
    order?: string | undefined;
    orient?: string | undefined;
    orientation?: string | undefined;
    origin?: string | undefined;
    overflow?: string | undefined;
    overlay?: string | undefined;
    overlinePosition?: number | string | undefined;
    overlineThickness?: number | string | undefined;
    paintOrder?: string | undefined;
    panose1?: string | undefined;
    part?: Array<string> | undefined;
    path?: string | undefined;
    pathLength?: number | string | undefined;
    pattern?: string | undefined;
    patternContentUnits?: string | undefined;
    patternTransform?: string | undefined;
    patternUnits?: string | undefined;
    phase?: string | undefined;
    ping?: Array<string> | undefined;
    pitch?: string | undefined;
    placeholder?: string | undefined;
    playbackOrder?: string | undefined;
    playsInline?: boolean | string | undefined;
    pointerEvents?: string | undefined;
    points?: string | undefined;
    pointsAtX?: number | string | undefined;
    pointsAtY?: number | string | undefined;
    pointsAtZ?: number | string | undefined;
    popover?: string | undefined;
    popoverTarget?: string | undefined;
    popoverTargetAction?: string | undefined;
    poster?: string | undefined;
    prefix?: string | undefined;
    preload?: string | undefined;
    preserveAlpha?: string | undefined;
    preserveAspectRatio?: string | undefined;
    primitiveUnits?: string | undefined;
    profile?: string | undefined;
    prompt?: string | undefined;
    propagate?: string | undefined;
    property?: string | Array<string> | undefined;
    r?: string | undefined;
    radius?: string | undefined;
    readOnly?: boolean | string | undefined;
    referrerPolicy?: string | undefined;
    refX?: string | undefined;
    refY?: string | undefined;
    rel?: Array<string> | undefined;
    renderingIntent?: string | undefined;
    repeatCount?: string | undefined;
    repeatDur?: string | undefined;
    required?: boolean | string | undefined;
    requiredExtensions?: Array<string> | undefined;
    requiredFeatures?: Array<string> | undefined;
    requiredFonts?: Array<string> | undefined;
    requiredFormats?: Array<string> | undefined;
    resource?: string | undefined;
    restart?: string | undefined;
    result?: string | undefined;
    results?: number | string | undefined;
    rev?: string | Array<string> | undefined;
    reversed?: boolean | string | undefined;
    rightMargin?: number | string | undefined;
    role?: string | undefined;
    rotate?: string | undefined;
    rows?: number | string | undefined;
    rowSpan?: number | string | undefined;
    rules?: string | undefined;
    rx?: string | undefined;
    ry?: string | undefined;
    sandbox?: Array<string> | undefined;
    scale?: string | undefined;
    scheme?: string | undefined;
    scope?: string | undefined;
    scoped?: boolean | string | undefined;
    scrolling?: "false" | "true" | (string & {}) | undefined;
    seamless?: boolean | string | undefined;
    security?: string | undefined;
    seed?: string | undefined;
    selected?: boolean | string | undefined;
    shadowRootClonable?: boolean | string | undefined;
    shadowRootCustomElementRegistry?: boolean | string | undefined;
    shadowRootDelegatesFocus?: boolean | string | undefined;
    shadowRootMode?: string | undefined;
    shadowRootSerializable?: boolean | string | undefined;
    shape?: string | undefined;
    shapeRendering?: string | undefined;
    side?: string | undefined;
    size?: number | string | undefined;
    sizes?: string | undefined;
    slope?: string | undefined;
    slot?: string | undefined;
    snapshotTime?: string | undefined;
    spacing?: string | undefined;
    span?: number | string | undefined;
    specularConstant?: number | string | undefined;
    specularExponent?: number | string | undefined;
    spellCheck?: "false" | "true" | (string & {}) | undefined;
    spreadMethod?: string | undefined;
    src?: string | undefined;
    srcDoc?: string | undefined;
    srcLang?: string | undefined;
    srcSet?: string | undefined;
    standby?: string | undefined;
    start?: number | string | undefined;
    startOffset?: string | undefined;
    stdDeviation?: string | undefined;
    stemh?: string | undefined;
    stemv?: string | undefined;
    step?: string | undefined;
    stitchTiles?: string | undefined;
    stopColor?: string | undefined;
    stopOpacity?: string | undefined;
    strikethroughPosition?: number | string | undefined;
    strikethroughThickness?: number | string | undefined;
    string?: string | undefined;
    stroke?: string | undefined;
    strokeDashArray?: Array<string> | undefined;
    strokeDashOffset?: string | undefined;
    strokeLineCap?: string | undefined;
    strokeLineJoin?: string | undefined;
    strokeMiterLimit?: number | string | undefined;
    strokeOpacity?: number | string | undefined;
    strokeWidth?: string | undefined;
    style?: string | undefined;
    summary?: string | undefined;
    surfaceScale?: number | string | undefined;
    syncBehavior?: string | undefined;
    syncBehaviorDefault?: string | undefined;
    syncMaster?: string | undefined;
    syncTolerance?: string | undefined;
    syncToleranceDefault?: string | undefined;
    systemLanguage?: Array<string> | undefined;
    tabIndex?: number | string | undefined;
    tableValues?: string | undefined;
    target?: string | undefined;
    targetX?: number | string | undefined;
    targetY?: number | string | undefined;
    text?: string | undefined;
    textAnchor?: string | undefined;
    textDecoration?: string | undefined;
    textLength?: string | undefined;
    textRendering?: string | undefined;
    timelineBegin?: string | undefined;
    title?: string | undefined;
    to?: string | undefined;
    topMargin?: number | string | undefined;
    transform?: string | undefined;
    transformBehavior?: string | undefined;
    transformOrigin?: string | undefined;
    translate?: string | undefined;
    type?: string | undefined;
    typeMustMatch?: boolean | string | undefined;
    typeOf?: Array<string> | undefined;
    u1?: string | undefined;
    u2?: string | undefined;
    underlinePosition?: number | string | undefined;
    underlineThickness?: number | string | undefined;
    unicode?: string | undefined;
    unicodeBidi?: string | undefined;
    unicodeRange?: string | undefined;
    unitsPerEm?: number | string | undefined;
    unselectable?: string | undefined;
    useMap?: string | undefined;
    vAlign?: string | undefined;
    vAlphabetic?: number | string | undefined;
    value?: "false" | "true" | (string & {}) | undefined;
    values?: string | undefined;
    valueType?: string | undefined;
    vectorEffect?: string | undefined;
    version?: string | undefined;
    vertAdvY?: number | string | undefined;
    vertOriginX?: number | string | undefined;
    vertOriginY?: number | string | undefined;
    vHanging?: number | string | undefined;
    vIdeographic?: number | string | undefined;
    viewBox?: string | undefined;
    viewTarget?: string | undefined;
    visibility?: string | undefined;
    vLink?: string | undefined;
    vMathematical?: number | string | undefined;
    vSpace?: number | string | undefined;
    width?: number | string | undefined;
    widths?: string | undefined;
    wordSpacing?: string | undefined;
    wrap?: string | undefined;
    writingMode?: string | undefined;
    writingSuggestions?: string | undefined;
    x?: string | undefined;
    x1?: string | undefined;
    x2?: string | undefined;
    xChannelSelector?: string | undefined;
    xHeight?: number | string | undefined;
    xLinkActuate?: string | undefined;
    xLinkArcRole?: string | undefined;
    xLinkHref?: string | undefined;
    xLinkRole?: string | undefined;
    xLinkShow?: string | undefined;
    xLinkTitle?: string | undefined;
    xLinkType?: string | undefined;
    xmlBase?: string | undefined;
    xmlLang?: string | undefined;
    xmlns?: string | undefined;
    xmlnsXLink?: string | undefined;
    xmlSpace?: string | undefined;
    y?: string | undefined;
    y1?: string | undefined;
    y2?: string | undefined;
    yChannelSelector?: string | undefined;
    z?: string | undefined;
    zoomAndPan?: string | undefined;
    [PropertyName: string]: boolean | number | string | null | undefined | Array<string | number>;
}

// ## Content maps

/**
 * Union of registered hast nodes that can occur in {@link Element}.
 *
 * To register mote custom hast nodes, add them to {@link ElementContentMap}.
 * They will be automatically added here.
 */
export type ElementContent = ElementContentMap[keyof ElementContentMap];

/**
 * Registry of all hast nodes that can occur as children of {@link Element}.
 *
 * For a union of all {@link Element} children, see {@link ElementContent}.
 */
export interface ElementContentMap {
    comment: Comment;
    element: Element;
    text: Text;
}

/**
 * Union of registered hast nodes that can occur in {@link Root}.
 *
 * To register custom hast nodes, add them to {@link RootContentMap}.
 * They will be automatically added here.
 */
export type RootContent = RootContentMap[keyof RootContentMap];

/**
 * Registry of all hast nodes that can occur as children of {@link Root}.
 *
 * > 👉 **Note**: {@link Root} does not need to be an entire document.
 * > it can also be a fragment.
 *
 * For a union of all {@link Root} children, see {@link RootContent}.
 */
export interface RootContentMap {
    comment: Comment;
    doctype: Doctype;
    element: Element;
    text: Text;
}

// ### Special content types

/**
 * Union of registered hast nodes that can occur in {@link Root}.
 *
 * @deprecated Use {@link RootContent} instead.
 */
export type Content = RootContent;

/**
 * Union of registered hast literals.
 *
 * To register custom hast nodes, add them to {@link RootContentMap} and other
 * places where relevant.
 * They will be automatically added here.
 */
export type Literals = Extract<Nodes, UnistLiteral>;

/**
 * Union of registered hast nodes.
 *
 * To register custom hast nodes, add them to {@link RootContentMap} and other
 * places where relevant.
 * They will be automatically added here.
 */
export type Nodes = Root | RootContent;

/**
 * Union of registered hast parents.
 *
 * To register custom hast nodes, add them to {@link RootContentMap} and other
 * places where relevant.
 * They will be automatically added here.
 */
export type Parents = Extract<Nodes, UnistParent>;

// ## Abstract nodes

/**
 * Abstract hast node.
 *
 * This interface is supposed to be extended.
 * If you can use {@link Literal} or {@link Parent}, you should.
 * But for example in HTML, a `Doctype` is neither literal nor parent, but
 * still a node.
 *
 * To register custom hast nodes, add them to {@link RootContentMap} and other
 * places where relevant (such as {@link ElementContentMap}).
 *
 * For a union of all registered hast nodes, see {@link Nodes}.
 */
export interface Node extends UnistNode {
    /**
     * Info from the ecosystem.
     */
    data?: Data | undefined;
}

/**
 * Abstract hast node that contains the smallest possible value.
 *
 * This interface is supposed to be extended if you make custom hast nodes.
 *
 * For a union of all registered hast literals, see {@link Literals}.
 */
export interface Literal extends Node {
    /**
     * Plain-text value.
     */
    value: string;
}

/**
 * Abstract hast node that contains other hast nodes (*children*).
 *
 * This interface is supposed to be extended if you make custom hast nodes.
 *
 * For a union of all registered hast parents, see {@link Parents}.
 */
export interface Parent extends Node {
    /**
     * List of children.
     */
    children: RootContent[];
}

// ## Concrete nodes

/**
 * HTML comment.
 */
export interface Comment extends Literal {
    /**
     * Node type of HTML comments in hast.
     */
    type: "comment";
    /**
     * Data associated with the comment.
     */
    data?: CommentData | undefined;
}

/**
 * Info associated with hast comments by the ecosystem.
 */
export interface CommentData extends Data {}

/**
 * HTML document type.
 */
export interface Doctype extends UnistNode {
    /**
     * Node type of HTML document types in hast.
     */
    type: "doctype";
    /**
     * Data associated with the doctype.
     */
    data?: DoctypeData | undefined;
}

/**
 * Info associated with hast doctypes by the ecosystem.
 */
export interface DoctypeData extends Data {}

/**
 * HTML element.
 */
export interface Element extends Parent {
    /**
     * Node type of elements.
     */
    type: "element";
    /**
     * Tag name (such as `'body'`) of the element.
     */
    tagName: string;
    /**
     * Info associated with the element.
     */
    properties: Properties;
    /**
     * Children of element.
     */
    children: ElementContent[];
    /**
     * When the `tagName` field is `'template'`, a `content` field can be
     * present.
     */
    content?: Root | undefined;
    /**
     * Data associated with the element.
     */
    data?: ElementData | undefined;
}

/**
 * Info associated with hast elements by the ecosystem.
 */
export interface ElementData extends Data {}

/**
 * Document fragment or a whole document.
 *
 * Should be used as the root of a tree and must not be used as a child.
 *
 * Can also be used as the value for the content field on a `'template'` element.
 */
export interface Root extends Parent {
    /**
     * Node type of hast root.
     */
    type: "root";
    /**
     * Children of root.
     */
    children: RootContent[];
    /**
     * Data associated with the hast root.
     */
    data?: RootData | undefined;
}

/**
 * Info associated with hast root nodes by the ecosystem.
 */
export interface RootData extends Data {}

/**
 * HTML character data (plain text).
 */
export interface Text extends Literal {
    /**
     * Node type of HTML character data (plain text) in hast.
     */
    type: "text";
    /**
     * Data associated with the text.
     */
    data?: TextData | undefined;
}

/**
 * Info associated with hast texts by the ecosystem.
 */
export interface TextData extends Data {}
[xK{
    "name": "@types/hast",
    "version": "3.0.5",
    "description": "TypeScript definitions for hast",
    "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/hast",
    "license": "MIT",
    "contributors": [
        {
            "name": "lukeggchapman",
            "githubUsername": "lukeggchapman",
            "url": "https://github.com/lukeggchapman"
        },
        {
            "name": "Junyoung Choi",
            "githubUsername": "rokt33r",
            "url": "https://github.com/rokt33r"
        },
        {
            "name": "Christian Murphy",
            "githubUsername": "ChristianMurphy",
            "url": "https://github.com/ChristianMurphy"
        },
        {
            "name": "Remco Haszing",
            "githubUsername": "remcohaszing",
            "url": "https://github.com/remcohaszing"
        },
        {
            "name": "Titus Wormer",
            "githubUsername": "wooorm",
            "url": "https://github.com/wooorm"
        }
    ],
    "main": "",
    "types": "index.d.ts",
    "repository": {
        "type": "git",
        "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
        "directory": "types/hast"
    },
    "scripts": {},
    "dependencies": {
        "@types/unist": "*"
    },
    "peerDependencies": {},
    "typesPublisherContentHash": "7c853a7c57790776fc3d5f6a721e61b09901a7222feadc4c561ddf607e7b29fc",
    "typeScriptVersion": "5.6"
}ߦ	x i100644 LICENSE z&{$Q{+%z100644 README.md B]7u0[a}74100644 index.d.ts 陴5
sbke#bw100644 package.json <AF<˕ꪦ/j99%x_# Installation
> `npm install --save @types/json-schema`

# Summary
This package contains type definitions for json-schema (https://github.com/kriszyp/json-schema).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-schema.

### Additional Details
 * Last updated: Tue, 07 Nov 2023 03:09:37 GMT
 * Dependencies: none

# Credits
These definitions were written by [Boris Cherny](https://github.com/bcherny), [Lucian Buzzo](https://github.com/lucianbuzzo), [Roland Groza](https://github.com/rolandjitsu), and [Jason Kwok](https://github.com/JasonHK).
弃x<pÏ// ==================================================================================================
// JSON Schema Draft 04
// ==================================================================================================

/**
 * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.1
 */
export type JSONSchema4TypeName =
    | "string" //
    | "number"
    | "integer"
    | "boolean"
    | "object"
    | "array"
    | "null"
    | "any";

/**
 * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-3.5
 */
export type JSONSchema4Type =
    | string //
    | number
    | boolean
    | JSONSchema4Object
    | JSONSchema4Array
    | null;

// Workaround for infinite type recursion
export interface JSONSchema4Object {
    [key: string]: JSONSchema4Type;
}

// Workaround for infinite type recursion
// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
export interface JSONSchema4Array extends Array<JSONSchema4Type> {}

/**
 * Meta schema
 *
 * Recommended values:
 * - 'http://json-schema.org/schema#'
 * - 'http://json-schema.org/hyper-schema#'
 * - 'http://json-schema.org/draft-04/schema#'
 * - 'http://json-schema.org/draft-04/hyper-schema#'
 * - 'http://json-schema.org/draft-03/schema#'
 * - 'http://json-schema.org/draft-03/hyper-schema#'
 *
 * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
 */
export type JSONSchema4Version = string;

/**
 * JSON Schema V4
 * @see https://tools.ietf.org/html/draft-zyp-json-schema-04
 */
export interface JSONSchema4 {
    id?: string | undefined;
    $ref?: string | undefined;
    $schema?: JSONSchema4Version | undefined;

    /**
     * This attribute is a string that provides a short description of the
     * instance property.
     *
     * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.21
     */
    title?: string | undefined;

    /**
     * This attribute is a string that provides a full description of the of
     * purpose the instance property.
     *
     * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.22
     */
    description?: string | undefined;

    default?: JSONSchema4Type | undefined;
    multipleOf?: number | undefined;
    maximum?: number | undefined;
    exclusiveMaximum?: boolean | undefined;
    minimum?: number | undefined;
    exclusiveMinimum?: boolean | undefined;
    maxLength?: number | undefined;
    minLength?: number | undefined;
    pattern?: string | undefined;

    /**
     * May only be defined when "items" is defined, and is a tuple of JSONSchemas.
     *
     * This provides a definition for additional items in an array instance
     * when tuple definitions of the items is provided.  This can be false
     * to indicate additional items in the array are not allowed, or it can
     * be a schema that defines the schema of the additional items.
     *
     * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.6
     */
    additionalItems?: boolean | JSONSchema4 | undefined;

    /**
     * This attribute defines the allowed items in an instance array, and
     * MUST be a schema or an array of schemas.  The default value is an
     * empty schema which allows any value for items in the instance array.
     *
     * When this attribute value is a schema and the instance value is an
     * array, then all the items in the array MUST be valid according to the
     * schema.
     *
     * When this attribute value is an array of schemas and the instance
     * value is an array, each position in the instance array MUST conform
     * to the schema in the corresponding position for this array.  This
     * called tuple typing.  When tuple typing is used, additional items are
     * allowed, disallowed, or constrained by the "additionalItems"
     * (Section 5.6) attribute using the same rules as
     * "additionalProperties" (Section 5.4) for objects.
     *
     * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.5
     */
    items?: JSONSchema4 | JSONSchema4[] | undefined;

    maxItems?: number | undefined;
    minItems?: number | undefined;
    uniqueItems?: boolean | undefined;
    maxProperties?: number | undefined;
    minProperties?: number | undefined;

    /**
     * This attribute indicates if the instance must have a value, and not
     * be undefined. This is false by default, making the instance
     * optional.
     *
     * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.7
     */
    required?: boolean | string[] | undefined;

    /**
     * This attribute defines a schema for all properties that are not
     * explicitly defined in an object type definition. If specified, the
     * value MUST be a schema or a boolean. If false is provided, no
     * additional properties are allowed beyond the properties defined in
     * the schema. The default value is an empty schema which allows any
     * value for additional properties.
     *
     * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.4
     */
    additionalProperties?: boolean | JSONSchema4 | undefined;

    definitions?: {
        [k: string]: JSONSchema4;
    } | undefined;

    /**
     * This attribute is an object with property definitions that define the
     * valid values of instance object property values. When the instance
     * value is an object, the property values of the instance object MUST
     * conform to the property definitions in this object. In this object,
     * each property definition's value MUST be a schema, and the property's
     * name MUST be the name of the instance property that it defines.  The
     * instance property value MUST be valid according to the schema from
     * the property definition. Properties are considered unordered, the
     * order of the instance properties MAY be in any order.
     *
     * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.2
     */
    properties?: {
        [k: string]: JSONSchema4;
    } | undefined;

    /**
     * This attribute is an object that defines the schema for a set of
     * property names of an object instance. The name of each property of
     * this attribute's object is a regular expression pattern in the ECMA
     * 262/Perl 5 format, while the value is a schema. If the pattern
     * matches the name of a property on the instance object, the value of
     * the instance's property MUST be valid against the pattern name's
     * schema value.
     *
     * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.3
     */
    patternProperties?: {
        [k: string]: JSONSchema4;
    } | undefined;
    dependencies?: {
        [k: string]: JSONSchema4 | string[];
    } | undefined;

    /**
     * This provides an enumeration of all possible values that are valid
     * for the instance property. This MUST be an array, and each item in
     * the array represents a possible value for the instance value. If
     * this attribute is defined, the instance value MUST be one of the
     * values in the array in order for the schema to be valid.
     *
     * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.19
     */
    enum?: JSONSchema4Type[] | undefined;

    /**
     * A single type, or a union of simple types
     */
    type?: JSONSchema4TypeName | JSONSchema4TypeName[] | undefined;

    allOf?: JSONSchema4[] | undefined;
    anyOf?: JSONSchema4[] | undefined;
    oneOf?: JSONSchema4[] | undefined;
    not?: JSONSchema4 | undefined;

    /**
     * The value of this property MUST be another schema which will provide
     * a base schema which the current schema will inherit from.  The
     * inheritance rules are such that any instance that is valid according
     * to the current schema MUST be valid according to the referenced
     * schema.  This MAY also be an array, in which case, the instance MUST
     * be valid for all the schemas in the array.  A schema that extends
     * another schema MAY define additional attributes, constrain existing
     * attributes, or add other constraints.
     *
     * Conceptually, the behavior of extends can be seen as validating an
     * instance against all constraints in the extending schema as well as
     * the extended schema(s).
     *
     * @see https://tools.ietf.org/html/draft-zyp-json-schema-03#section-5.26
     */
    extends?: string | string[] | undefined;

    /**
     * @see https://tools.ietf.org/html/draft-zyp-json-schema-04#section-5.6
     */
    [k: string]: any;

    format?: string | undefined;
}

// ==================================================================================================
// JSON Schema Draft 06
// ==================================================================================================

export type JSONSchema6TypeName =
    | "string" //
    | "number"
    | "integer"
    | "boolean"
    | "object"
    | "array"
    | "null"
    | "any";

export type JSONSchema6Type =
    | string //
    | number
    | boolean
    | JSONSchema6Object
    | JSONSchema6Array
    | null;

// Workaround for infinite type recursion
export interface JSONSchema6Object {
    [key: string]: JSONSchema6Type;
}

// Workaround for infinite type recursion
// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
export interface JSONSchema6Array extends Array<JSONSchema6Type> {}

/**
 * Meta schema
 *
 * Recommended values:
 * - 'http://json-schema.org/schema#'
 * - 'http://json-schema.org/hyper-schema#'
 * - 'http://json-schema.org/draft-06/schema#'
 * - 'http://json-schema.org/draft-06/hyper-schema#'
 *
 * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
 */
export type JSONSchema6Version = string;

/**
 * JSON Schema V6
 * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01
 */
export type JSONSchema6Definition = JSONSchema6 | boolean;
export interface JSONSchema6 {
    $id?: string | undefined;
    $ref?: string | undefined;
    $schema?: JSONSchema6Version | undefined;

    /**
     * Must be strictly greater than 0.
     * A numeric instance is valid only if division by this keyword's value results in an integer.
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.1
     */
    multipleOf?: number | undefined;

    /**
     * Representing an inclusive upper limit for a numeric instance.
     * This keyword validates only if the instance is less than or exactly equal to "maximum".
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.2
     */
    maximum?: number | undefined;

    /**
     * Representing an exclusive upper limit for a numeric instance.
     * This keyword validates only if the instance is strictly less than (not equal to) to "exclusiveMaximum".
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.3
     */
    exclusiveMaximum?: number | undefined;

    /**
     * Representing an inclusive lower limit for a numeric instance.
     * This keyword validates only if the instance is greater than or exactly equal to "minimum".
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.4
     */
    minimum?: number | undefined;

    /**
     * Representing an exclusive lower limit for a numeric instance.
     * This keyword validates only if the instance is strictly greater than (not equal to) to "exclusiveMinimum".
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.5
     */
    exclusiveMinimum?: number | undefined;

    /**
     * Must be a non-negative integer.
     * A string instance is valid against this keyword if its length is less than, or equal to, the value of this keyword.
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.6
     */
    maxLength?: number | undefined;

    /**
     * Must be a non-negative integer.
     * A string instance is valid against this keyword if its length is greater than, or equal to, the value of this keyword.
     * Omitting this keyword has the same behavior as a value of 0.
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.7
     */
    minLength?: number | undefined;

    /**
     * Should be a valid regular expression, according to the ECMA 262 regular expression dialect.
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.8
     */
    pattern?: string | undefined;

    /**
     * This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself.
     * Omitting this keyword has the same behavior as an empty schema.
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.9
     */
    items?: JSONSchema6Definition | JSONSchema6Definition[] | undefined;

    /**
     * This keyword determines how child instances validate for arrays, and does not directly validate the immediate instance itself.
     * If "items" is an array of schemas, validation succeeds if every instance element
     * at a position greater than the size of "items" validates against "additionalItems".
     * Otherwise, "additionalItems" MUST be ignored, as the "items" schema
     * (possibly the default value of an empty schema) is applied to all elements.
     * Omitting this keyword has the same behavior as an empty schema.
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.10
     */
    additionalItems?: JSONSchema6Definition | undefined;

    /**
     * Must be a non-negative integer.
     * An array instance is valid against "maxItems" if its size is less than, or equal to, the value of this keyword.
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.11
     */
    maxItems?: number | undefined;

    /**
     * Must be a non-negative integer.
     * An array instance is valid against "maxItems" if its size is greater than, or equal to, the value of this keyword.
     * Omitting this keyword has the same behavior as a value of 0.
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.12
     */
    minItems?: number | undefined;

    /**
     * If this keyword has boolean value false, the instance validates successfully.
     * If it has boolean value true, the instance validates successfully if all of its elements are unique.
     * Omitting this keyword has the same behavior as a value of false.
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.13
     */
    uniqueItems?: boolean | undefined;

    /**
     * An array instance is valid against "contains" if at least one of its elements is valid against the given schema.
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.14
     */
    contains?: JSONSchema6Definition | undefined;

    /**
     * Must be a non-negative integer.
     * An object instance is valid against "maxProperties" if its number of properties is less than, or equal to, the value of this keyword.
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.15
     */
    maxProperties?: number | undefined;

    /**
     * Must be a non-negative integer.
     * An object instance is valid against "maxProperties" if its number of properties is greater than,
     * or equal to, the value of this keyword.
     * Omitting this keyword has the same behavior as a value of 0.
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.16
     */
    minProperties?: number | undefined;

    /**
     * Elements of this array must be unique.
     * An object instance is valid against this keyword if every item in the array is the name of a property in the instance.
     * Omitting this keyword has the same behavior as an empty array.
     *
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.17
     */
    required?: string[] | undefined;

    /**
     * This keyword determines how child instances validate for objects, and does not directly validate the immediate instance itself.
     * Validation succeeds if, for each name that appears in both the instance and as a name within this keyword's value,
     * the child instance for that name successfully validates against the corresponding schema.
     * Omitting this keyword has the same behavior as an empty object.
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.18
     */
    properties?: {
        [k: string]: JSONSchema6Definition;
    } | undefined;

    /**
     * This attribute is an object that defines the schema for a set of property names of an object instance.
     * The name of each property of this attribute's object is a regular expression pattern in the ECMA 262, while the value is a schema.
     * If the pattern matches the name of a property on the instance object, the value of the instance's property
     * MUST be valid against the pattern name's schema value.
     * Omitting this keyword has the same behavior as an empty object.
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.19
     */
    patternProperties?: {
        [k: string]: JSONSchema6Definition;
    } | undefined;

    /**
     * This attribute defines a schema for all properties that are not explicitly defined in an object type definition.
     * If specified, the value MUST be a schema or a boolean.
     * If false is provided, no additional properties are allowed beyond the properties defined in the schema.
     * The default value is an empty schema which allows any value for additional properties.
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.20
     */
    additionalProperties?: JSONSchema6Definition | undefined;

    /**
     * This keyword specifies rules that are evaluated if the instance is an object and contains a certain property.
     * Each property specifies a dependency.
     * If the dependency value is an array, each element in the array must be unique.
     * Omitting this keyword has the same behavior as an empty object.
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.21
     */
    dependencies?: {
        [k: string]: JSONSchema6Definition | string[];
    } | undefined;

    /**
     * Takes a schema which validates the names of all properties rather than their values.
     * Note the property name that the schema is testing will always be a string.
     * Omitting this keyword has the same behavior as an empty schema.
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.22
     */
    propertyNames?: JSONSchema6Definition | undefined;

    /**
     * This provides an enumeration of all possible values that are valid
     * for the instance property. This MUST be an array, and each item in
     * the array represents a possible value for the instance value. If
     * this attribute is defined, the instance value MUST be one of the
     * values in the array in order for the schema to be valid.
     *
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.23
     */
    enum?: JSONSchema6Type[] | undefined;

    /**
     * More readable form of a one-element "enum"
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.24
     */
    const?: JSONSchema6Type | undefined;

    /**
     * A single type, or a union of simple types
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.25
     */
    type?: JSONSchema6TypeName | JSONSchema6TypeName[] | undefined;

    /**
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.26
     */
    allOf?: JSONSchema6Definition[] | undefined;

    /**
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.27
     */
    anyOf?: JSONSchema6Definition[] | undefined;

    /**
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.28
     */
    oneOf?: JSONSchema6Definition[] | undefined;

    /**
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-6.29
     */
    not?: JSONSchema6Definition | undefined;

    /**
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.1
     */
    definitions?: {
        [k: string]: JSONSchema6Definition;
    } | undefined;

    /**
     * This attribute is a string that provides a short description of the instance property.
     *
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2
     */
    title?: string | undefined;

    /**
     * This attribute is a string that provides a full description of the of purpose the instance property.
     *
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.2
     */
    description?: string | undefined;

    /**
     * This keyword can be used to supply a default JSON value associated with a particular schema.
     * It is RECOMMENDED that a default value be valid against the associated schema.
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.3
     */
    default?: JSONSchema6Type | undefined;

    /**
     * Array of examples with no validation effect the value of "default" is usable as an example without repeating it under this keyword
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-7.4
     */
    examples?: JSONSchema6Type[] | undefined;

    /**
     * @see https://tools.ietf.org/html/draft-wright-json-schema-validation-01#section-8
     */
    format?: string | undefined;
}

// ==================================================================================================
// JSON Schema Draft 07
// ==================================================================================================
// https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
// --------------------------------------------------------------------------------------------------

/**
 * Primitive type
 * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
 */
export type JSONSchema7TypeName =
    | "string" //
    | "number"
    | "integer"
    | "boolean"
    | "object"
    | "array"
    | "null";

/**
 * Primitive type
 * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1.1
 */
export type JSONSchema7Type =
    | string //
    | number
    | boolean
    | JSONSchema7Object
    | JSONSchema7Array
    | null;

// Workaround for infinite type recursion
export interface JSONSchema7Object {
    [key: string]: JSONSchema7Type;
}

// Workaround for infinite type recursion
// https://github.com/Microsoft/TypeScript/issues/3496#issuecomment-128553540
export interface JSONSchema7Array extends Array<JSONSchema7Type> {}

/**
 * Meta schema
 *
 * Recommended values:
 * - 'http://json-schema.org/schema#'
 * - 'http://json-schema.org/hyper-schema#'
 * - 'http://json-schema.org/draft-07/schema#'
 * - 'http://json-schema.org/draft-07/hyper-schema#'
 *
 * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-5
 */
export type JSONSchema7Version = string;

/**
 * JSON Schema v7
 * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01
 */
export type JSONSchema7Definition = JSONSchema7 | boolean;
export interface JSONSchema7 {
    $id?: string | undefined;
    $ref?: string | undefined;
    $schema?: JSONSchema7Version | undefined;
    $comment?: string | undefined;

    /**
     * @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-00#section-8.2.4
     * @see https://datatracker.ietf.org/doc/html/draft-bhutton-json-schema-validation-00#appendix-A
     */
    $defs?: {
        [key: string]: JSONSchema7Definition;
    } | undefined;

    /**
     * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.1
     */
    type?: JSONSchema7TypeName | JSONSchema7TypeName[] | undefined;
    enum?: JSONSchema7Type[] | undefined;
    const?: JSONSchema7Type | undefined;

    /**
     * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.2
     */
    multipleOf?: number | undefined;
    maximum?: number | undefined;
    exclusiveMaximum?: number | undefined;
    minimum?: number | undefined;
    exclusiveMinimum?: number | undefined;

    /**
     * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.3
     */
    maxLength?: number | undefined;
    minLength?: number | undefined;
    pattern?: string | undefined;

    /**
     * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.4
     */
    items?: JSONSchema7Definition | JSONSchema7Definition[] | undefined;
    additionalItems?: JSONSchema7Definition | undefined;
    maxItems?: number | undefined;
    minItems?: number | undefined;
    uniqueItems?: boolean | undefined;
    contains?: JSONSchema7Definition | undefined;

    /**
     * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.5
     */
    maxProperties?: number | undefined;
    minProperties?: number | undefined;
    required?: string[] | undefined;
    properties?: {
        [key: string]: JSONSchema7Definition;
    } | undefined;
    patternProperties?: {
        [key: string]: JSONSchema7Definition;
    } | undefined;
    additionalProperties?: JSONSchema7Definition | undefined;
    dependencies?: {
        [key: string]: JSONSchema7Definition | string[];
    } | undefined;
    propertyNames?: JSONSchema7Definition | undefined;

    /**
     * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.6
     */
    if?: JSONSchema7Definition | undefined;
    then?: JSONSchema7Definition | undefined;
    else?: JSONSchema7Definition | undefined;

    /**
     * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-6.7
     */
    allOf?: JSONSchema7Definition[] | undefined;
    anyOf?: JSONSchema7Definition[] | undefined;
    oneOf?: JSONSchema7Definition[] | undefined;
    not?: JSONSchema7Definition | undefined;

    /**
     * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-7
     */
    format?: string | undefined;

    /**
     * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-8
     */
    contentMediaType?: string | undefined;
    contentEncoding?: string | undefined;

    /**
     * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-9
     */
    definitions?: {
        [key: string]: JSONSchema7Definition;
    } | undefined;

    /**
     * @see https://tools.ietf.org/html/draft-handrews-json-schema-validation-01#section-10
     */
    title?: string | undefined;
    description?: string | undefined;
    default?: JSONSchema7Type | undefined;
    readOnly?: boolean | undefined;
    writeOnly?: boolean | undefined;
    examples?: JSONSchema7Type | undefined;
}

export interface ValidationResult {
    valid: boolean;
    errors: ValidationError[];
}

export interface ValidationError {
    property: string;
    message: string;
}

/**
 * To use the validator call JSONSchema.validate with an instance object and an optional schema object.
 * If a schema is provided, it will be used to validate. If the instance object refers to a schema (self-validating),
 * that schema will be used to validate and the schema parameter is not necessary (if both exist,
 * both validations will occur).
 */
export function validate(instance: {}, schema: JSONSchema4 | JSONSchema6 | JSONSchema7): ValidationResult;

/**
 * The checkPropertyChange method will check to see if an value can legally be in property with the given schema
 * This is slightly different than the validate method in that it will fail if the schema is readonly and it will
 * not check for self-validation, it is assumed that the passed in value is already internally valid.
 */
export function checkPropertyChange(
    value: any,
    schema: JSONSchema4 | JSONSchema6 | JSONSchema7,
    property: string,
): ValidationResult;

/**
 * This checks to ensure that the result is valid and will throw an appropriate error message if it is not.
 */
export function mustBeValid(result: ValidationResult): void;
'WٵNx{
    "name": "@types/json-schema",
    "version": "7.0.15",
    "description": "TypeScript definitions for json-schema",
    "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/json-schema",
    "license": "MIT",
    "contributors": [
        {
            "name": "Boris Cherny",
            "githubUsername": "bcherny",
            "url": "https://github.com/bcherny"
        },
        {
            "name": "Lucian Buzzo",
            "githubUsername": "lucianbuzzo",
            "url": "https://github.com/lucianbuzzo"
        },
        {
            "name": "Roland Groza",
            "githubUsername": "rolandjitsu",
            "url": "https://github.com/rolandjitsu"
        },
        {
            "name": "Jason Kwok",
            "githubUsername": "JasonHK",
            "url": "https://github.com/JasonHK"
        }
    ],
    "main": "",
    "types": "index.d.ts",
    "repository": {
        "type": "git",
        "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
        "directory": "types/json-schema"
    },
    "scripts": {},
    "dependencies": {},
    "typesPublisherContentHash": "79984fd70cd25c3f7d72b84368778c763c89728ea0073832d745d4691b705257",
    "typeScriptVersion": "4.5"
}\x G100644 LICENSE z&{$Q{+%z100644 README.md jrAm?6n40000 contrib x2fϑIҞC<S100644 index.d.ts Y!W!7<\fRv100644 package.json S,mH{76Z@G+&xn# Installation
> `npm install --save @types/katex`

# Summary
This package contains type definitions for katex (http://khan.github.io/KaTeX/).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/katex.

### Additional Details
 * Last updated: Sat, 10 Jan 2026 00:47:09 GMT
 * Dependencies: none

# Credits
These definitions were written by [Kevin Nguyen](https://github.com/knguyen0125), [bLue](https://github.com/dreamerblue), [Sebastian Weigand](https://github.com/s-weigand), [sapphi-red](https://github.com/sapphi-red), and [Stefaans](https://github.com/Stefaans).
Ex, 100644 auto-render.d.ts ];(nc|gdN!ximport { KatexOptions } from "../index.js";

declare namespace renderMathInElement {
    interface RenderMathInElementSpecificOptionsDelimiters {
        /**
         * A string which starts the math expression (i.e. the left delimiter)
         */
        left: string;
        /**
         * A string which ends the math expression (i.e. the right delimiter)
         */
        right: string;
        /**
         * A boolean of whether the math in the expression should be rendered in display mode or not
         */
        display: boolean;
    }

    interface RenderMathInElementSpecificOptions {
        /**
         * A list of delimiters to look for math
         *
         * @default [
         *   {left: "$$", right: "$$", display: true},
         *   {left: "\\(", right: "\\)", display: false},
         *   {left: "\\[", right: "\\]", display: true}
         * ]
         */
        delimiters?: readonly RenderMathInElementSpecificOptionsDelimiters[] | undefined;
        /**
         * A list of DOM node types to ignore when recursing through
         *
         * @default ["script", "noscript", "style", "textarea", "pre", "code"]
         */
        ignoredTags?: ReadonlyArray<keyof HTMLElementTagNameMap> | undefined;
        /**
         * A list of DOM node class names to ignore when recursing through
         *
         * @default []
         */
        ignoredClasses?: string[] | undefined;

        /**
         * A callback method returning a message and an error stack in case of an critical error during rendering
         * @param msg Message generated by KaTeX
         * @param err Caught error
         *
         * @default console.error
         */
        errorCallback?(msg: string, err: Error): void;
    }

    /**
     * renderMathInElement options contain KaTeX render options and renderMathInElement specific options
     */
    type RenderMathInElementOptions = KatexOptions & RenderMathInElementSpecificOptions;
}

/**
 * Auto-render TeX expressions in HTML element
 * @param elem HTML element to auto-render
 * @param options Render options
 */
declare function renderMathInElement(elem: HTMLElement, options?: renderMathInElement.RenderMathInElementOptions): void;

export = renderMathInElement;
export as namespace renderMathInElement;
 m괙xkexport interface TrustContext {
    command: string;
    url: string;
    protocol: string;
}

/** Documentation: https://katex.org/docs/options.html */
export interface KatexOptions {
    /**
     * If `true`, math will be rendered in display mode
     * (math in display style and center math on page)
     *
     * If `false`, math will be rendered in inline mode
     * @default false
     */
    displayMode?: boolean | undefined;
    /**
     * Determines the markup language of the output. The valid choices are:
     * - `html`: Outputs KaTeX in HTML only.
     * - `mathml`: Outputs KaTeX in MathML only.
     * - `htmlAndMathml`: Outputs HTML for visual rendering
     *   and includes MathML for accessibility.
     *
     * @default 'htmlAndMathml'
     */
    output?: "html" | "mathml" | "htmlAndMathml" | undefined;
    /**
     * If `true`, display math has \tags rendered on the left
     * instead of the right, like \usepackage[leqno]{amsmath} in LaTeX.
     *
     * @default false
     */
    leqno?: boolean | undefined;
    /**
     * If `true`, display math renders flush left with a 2em left margin,
     * like \documentclass[fleqn] in LaTeX with the amsmath package.
     *
     * @default false
     */
    fleqn?: boolean | undefined;
    /**
     * If `true`, KaTeX will throw a `ParseError` when
     * it encounters an unsupported command or invalid LaTex
     *
     * If `false`, KaTeX will render unsupported commands as
     * text, and render invalid LaTeX as its source code with
     * hover text giving the error, in color given by errorColor
     * @default true
     */
    throwOnError?: boolean | undefined;
    /**
     * A Color string given in format `#XXX` or `#XXXXXX`
     */
    errorColor?: string | undefined;
    /**
     * A collection of custom macros.
     *
     * See `src/macros.js` for its usage
     */
    macros?: any;
    /**
     * Specifies a minimum thickness, in ems, for fraction lines,
     * \sqrt top lines, {array} vertical lines, \hline, \hdashline,
     * \underline, \overline, and the borders of \fbox, \boxed, and
     * \fcolorbox.
     */
    minRuleThickness?: number | undefined;
    /**
     * If `true`, `\color` will work like LaTeX's `\textcolor`
     * and takes 2 arguments
     *
     * If `false`, `\color` will work like LaTeX's `\color`
     * and takes 1 argument
     *
     * In both cases, `\textcolor` works as in LaTeX
     *
     * @default false
     */
    colorIsTextColor?: boolean | undefined;
    /**
     * All user-specified sizes will be caped to `maxSize` ems
     *
     * If set to Infinity, users can make elements and space
     * arbitrarily large
     *
     * @default Infinity
     */
    maxSize?: number | undefined;
    /**
     * Limit the number of macro expansions to specified number
     *
     * If set to `Infinity`, marco expander will try to fully expand
     * as in LaTex
     *
     * @default 1000
     */
    maxExpand?: number | undefined;
    /**
     * If `false` or `"ignore"`, allow features that make
     * writing in LaTex convenient but not supported by LaTex
     *
     * If `true` or `"error"`, throw an error for such transgressions
     *
     * If `"warn"`, warn about behavior via `console.warn`
     *
     * @default "warn"
     */
    strict?: boolean | string | Function | undefined;
    /**
     * If `false` (do not trust input), prevent any commands that could enable adverse behavior, rendering them instead in errorColor.
     *
     * If `true` (trust input), allow all such commands.
     *
     * @default false
     */
    trust?: boolean | ((context: TrustContext) => boolean) | undefined;
    /**
     * Place KaTeX code in the global group.
     *
     * @default false
     */
    globalGroup?: boolean | undefined;
}

/**
 * KaTeX error, usually during parsing.
 */
export class ParseError implements Error {
    constructor(message: string, lexer: any, position: number);

    name: string;
    message: string;
    position: number;
}

/**
 * Renders a TeX expression into the specified DOM element
 * @param tex A TeX expression
 * @param element The DOM element to render into
 * @param options KaTeX options
 */
export function render(tex: string, element: HTMLElement, options?: KatexOptions): void;

/**
 * Renders a TeX expression into an HTML string
 * @param tex A TeX expression
 * @param options KaTeX options
 */
export function renderToString(tex: string, options?: KatexOptions): string;

export as namespace katex;
-*(xukatex",
    "version": "0.16.822katexhYkatexNKevin Nguye#knguyen0125O*knguyen0125,bLue "dreamerblueO*dreamerblue,Sebastian Weigand "	s-weigandO*	s-weigand,
sapphi-red "
sapphi-redO*
sapphi-red,Stefaans "StefaansO*Stefaanskatex1,9@843b74923cb5d38471fb372b663c3c3c10e8f5d383d24b56a11f1e3d2d122e5a2"
}K3vx	x i100644 LICENSE z&{$Q{+%z100644 README.md Rv}Dij
FqqM100644 index.d.ts #ujJ%؅^@7?RS100644 package.json {Ъ	WQ1W8x0fϙimport type { Data as UnistData, Literal as UnistLiteral, Node as UnistNode, Parent as UnistParent } from "unist";

// ## Enumeration

/**
 * How phrasing content is aligned
 * ({@link https://drafts.csswg.org/css-text/ | [CSSTEXT]}).
 *
 * * `'left'`: See the
 *   {@link https://drafts.csswg.org/css-text/#valdef-text-align-left | left}
 *   value of the `text-align` CSS property
 * * `'right'`: See the
 *   {@link https://drafts.csswg.org/css-text/#valdef-text-align-right | right}
 *   value of the `text-align` CSS property
 * * `'center'`: See the
 *   {@link https://drafts.csswg.org/css-text/#valdef-text-align-center | center}
 *   value of the `text-align` CSS property
 * * `null`: phrasing content is aligned as defined by the host environment
 *
 * Used in GFM tables.
 */
export type AlignType = "center" | "left" | "right" | null;

/**
 * Explicitness of a reference.
 *
 * `'shortcut'`: the reference is implicit, its identifier inferred from its
 *   content
 * `'collapsed'`: the reference is explicit, its identifier inferred from its
 *   content
 * `'full'`: the reference is explicit, its identifier explicitly set
 */
export type ReferenceType = "shortcut" | "collapsed" | "full";

// ## Mixin

/**
 * Node with a fallback.
 */
export interface Alternative {
    /**
     * Equivalent content for environments that cannot represent the node as
     * intended.
     */
    alt?: string | null | undefined;
}

/**
 * Internal relation from one node to another.
 *
 * Whether the value of `identifier` is expected to be a unique identifier or
 * not depends on the type of node including the Association.
 * An example of this is that they should be unique on {@link Definition},
 * whereas multiple {@link LinkReference}s can be non-unique to be associated
 * with one definition.
 */
export interface Association {
    /**
     * Relation of association.
     *
     * `identifier` is a source value: character escapes and character
     * references are not parsed.
     *
     * It can match another node.
     *
     * Its value must be normalized.
     * To normalize a value, collapse markdown whitespace (`[\t\n\r ]+`) to a space,
     * trim the optional initial and/or final space, and perform Unicode-aware
     * case-folding.
     */
    identifier: string;

    /**
     * Relation of association, in parsed form.
     *
     * `label` is a `string` value: it works just like `title` on {@link Link}
     * or a `lang` on {@link Code}: character escapes and character references
     * are parsed.
     *
     * It can match another node.
     */
    label?: string | null | undefined;
}

/**
 * Marker that is associated to another node.
 */
export interface Reference extends Association {
    /**
     * Explicitness of the reference.
     */
    referenceType: ReferenceType;
}

/**
 * Reference to resource.
 */
export interface Resource {
    /**
     * URL to the referenced resource.
     */
    url: string;
    /**
     * Advisory information for the resource, such as would be appropriate for
     * a tooltip.
     */
    title?: string | null | undefined;
}

// ## Interfaces

/**
 * Info associated with mdast nodes by the ecosystem.
 *
 * This space is guaranteed to never be specified by unist or mdast.
 * But you can use it in utilities and plugins to store data.
 *
 * This type can be augmented to register custom data.
 * For example:
 *
 * ```ts
 * declare module 'mdast' {
 *   interface Data {
 *     // `someNode.data.myId` is typed as `number | undefined`
 *     myId?: number | undefined
 *   }
 * }
 * ```
 */
export interface Data extends UnistData {}

// ## Content maps

/**
 * Union of registered mdast nodes that can occur where block content is
 * expected.
 *
 * To register custom mdast nodes, add them to {@link BlockContentMap}.
 * They will be automatically added here.
 */
export type BlockContent = BlockContentMap[keyof BlockContentMap];

/**
 * Registry of all mdast nodes that can occur where {@link BlockContent} is
 * expected.
 *
 * This interface can be augmented to register custom node types:
 *
 * ```ts
 * declare module 'mdast' {
 *   interface BlockContentMap {
 *     // Allow using MDX ESM nodes defined by `remark-mdx`.
 *     mdxjsEsm: MdxjsEsm;
 *   }
 * }
 * ```
 *
 * For a union of all block content, see {@link RootContent}.
 */
export interface BlockContentMap {
    blockquote: Blockquote;
    code: Code;
    heading: Heading;
    html: Html;
    list: List;
    paragraph: Paragraph;
    table: Table;
    thematicBreak: ThematicBreak;
}

/**
 * Union of registered mdast nodes that can occur where definition content is
 * expected.
 *
 * To register custom mdast nodes, add them to {@link DefinitionContentMap}.
 * They will be automatically added here.
 */
export type DefinitionContent = DefinitionContentMap[keyof DefinitionContentMap];

/**
 * Registry of all mdast nodes that can occur where {@link DefinitionContent}
 * is expected.
 *
 * This interface can be augmented to register custom node types:
 *
 * ```ts
 * declare module 'mdast' {
 *   interface DefinitionContentMap {
 *     custom: Custom;
 *   }
 * }
 * ```
 *
 * For a union of all definition content, see {@link RootContent}.
 */
export interface DefinitionContentMap {
    definition: Definition;
    footnoteDefinition: FootnoteDefinition;
}

/**
 * Union of registered mdast nodes that can occur where frontmatter content is
 * expected.
 *
 * To register custom mdast nodes, add them to {@link FrontmatterContentMap}.
 * They will be automatically added here.
 */
export type FrontmatterContent = FrontmatterContentMap[keyof FrontmatterContentMap];

/**
 * Registry of all mdast nodes that can occur where {@link FrontmatterContent}
 * is expected.
 *
 * This interface can be augmented to register custom node types:
 *
 * ```ts
 * declare module 'mdast' {
 *   interface FrontmatterContentMap {
 *     // Allow using toml nodes defined by `remark-frontmatter`.
 *     toml: TOML;
 *   }
 * }
 * ```
 *
 * For a union of all frontmatter content, see {@link RootContent}.
 */
export interface FrontmatterContentMap {
    yaml: Yaml;
}

/**
 * Union of registered mdast nodes that can occur where list content is
 * expected.
 *
 * To register custom mdast nodes, add them to {@link ListContentMap}.
 * They will be automatically added here.
 */
export type ListContent = ListContentMap[keyof ListContentMap];

/**
 * Registry of all mdast nodes that can occur where {@link ListContent}
 * is expected.
 *
 * This interface can be augmented to register custom node types:
 *
 * ```ts
 * declare module 'mdast' {
 *   interface ListContentMap {
 *     custom: Custom;
 *   }
 * }
 * ```
 *
 * For a union of all list content, see {@link RootContent}.
 */
export interface ListContentMap {
    listItem: ListItem;
}

/**
 * Union of registered mdast nodes that can occur where phrasing content is
 * expected.
 *
 * To register custom mdast nodes, add them to {@link PhrasingContentMap}.
 * They will be automatically added here.
 */
export type PhrasingContent = PhrasingContentMap[keyof PhrasingContentMap];

/**
 * Registry of all mdast nodes that can occur where {@link PhrasingContent}
 * is expected.
 *
 * This interface can be augmented to register custom node types:
 *
 * ```ts
 * declare module 'mdast' {
 *   interface PhrasingContentMap {
 *     // Allow using MDX JSX (text) nodes defined by `remark-mdx`.
 *     mdxJsxTextElement: MDXJSXTextElement;
 *   }
 * }
 * ```
 *
 * For a union of all phrasing content, see {@link RootContent}.
 */
export interface PhrasingContentMap {
    break: Break;
    delete: Delete;
    emphasis: Emphasis;
    footnoteReference: FootnoteReference;
    html: Html;
    image: Image;
    imageReference: ImageReference;
    inlineCode: InlineCode;
    link: Link;
    linkReference: LinkReference;
    strong: Strong;
    text: Text;
}

/**
 * Union of registered mdast nodes that can occur in {@link Root}.
 *
 * To register custom mdast nodes, add them to {@link RootContentMap}.
 * They will be automatically added here.
 */
export type RootContent = RootContentMap[keyof RootContentMap];

/**
 * Registry of all mdast nodes that can occur as children of {@link Root}.
 *
 * > **Note**: {@link Root} does not need to be an entire document.
 * > it can also be a fragment.
 *
 * This interface can be augmented to register custom node types:
 *
 * ```ts
 * declare module 'mdast' {
 *   interface RootContentMap {
 *     // Allow using toml nodes defined by `remark-frontmatter`.
 *     toml: TOML;
 *   }
 * }
 * ```
 *
 * For a union of all {@link Root} children, see {@link RootContent}.
 */
export interface RootContentMap {
    blockquote: Blockquote;
    break: Break;
    code: Code;
    definition: Definition;
    delete: Delete;
    emphasis: Emphasis;
    footnoteDefinition: FootnoteDefinition;
    footnoteReference: FootnoteReference;
    heading: Heading;
    html: Html;
    image: Image;
    imageReference: ImageReference;
    inlineCode: InlineCode;
    link: Link;
    linkReference: LinkReference;
    list: List;
    listItem: ListItem;
    paragraph: Paragraph;
    strong: Strong;
    table: Table;
    tableCell: TableCell;
    tableRow: TableRow;
    text: Text;
    thematicBreak: ThematicBreak;
    yaml: Yaml;
}

/**
 * Union of registered mdast nodes that can occur where row content is
 * expected.
 *
 * To register custom mdast nodes, add them to {@link RowContentMap}.
 * They will be automatically added here.
 */
export type RowContent = RowContentMap[keyof RowContentMap];

/**
 * Registry of all mdast nodes that can occur where {@link RowContent}
 * is expected.
 *
 * This interface can be augmented to register custom node types:
 *
 * ```ts
 * declare module 'mdast' {
 *   interface RowContentMap {
 *     custom: Custom;
 *   }
 * }
 * ```
 *
 * For a union of all row content, see {@link RootContent}.
 */
export interface RowContentMap {
    tableCell: TableCell;
}

/**
 * Union of registered mdast nodes that can occur where table content is
 * expected.
 *
 * To register custom mdast nodes, add them to {@link TableContentMap}.
 * They will be automatically added here.
 */
export type TableContent = TableContentMap[keyof TableContentMap];

/**
 * Registry of all mdast nodes that can occur where {@link TableContent}
 * is expected.
 *
 * This interface can be augmented to register custom node types:
 *
 * ```ts
 * declare module 'mdast' {
 *   interface TableContentMap {
 *     custom: Custom;
 *   }
 * }
 * ```
 *
 * For a union of all table content, see {@link RootContent}.
 */
export interface TableContentMap {
    tableRow: TableRow;
}

// ### Special content types

/**
 * Union of registered mdast nodes that can occur in {@link Root}.
 *
 * @deprecated Use {@link RootContent} instead.
 */
export type Content = RootContent;

/**
 * Union of registered mdast literals.
 *
 * To register custom mdast nodes, add them to {@link RootContentMap} and other
 * places where relevant.
 * They will be automatically added here.
 */
export type Literals = Extract<Nodes, UnistLiteral>;

/**
 * Union of registered mdast nodes.
 *
 * To register custom mdast nodes, add them to {@link RootContentMap} and other
 * places where relevant.
 * They will be automatically added here.
 */
export type Nodes = Root | RootContent;

/**
 * Union of registered mdast parents.
 *
 * To register custom mdast nodes, add them to {@link RootContentMap} and other
 * places where relevant.
 * They will be automatically added here.
 */
export type Parents = Extract<Nodes, UnistParent>;

/**
 * Union of registered mdast nodes that can occur at the top of the document.
 *
 * To register custom mdast nodes, add them to {@link BlockContent},
 * {@link FrontmatterContent}, or {@link DefinitionContent}.
 * They will be automatically added here.
 */
export type TopLevelContent = BlockContent | FrontmatterContent | DefinitionContent;

// ## Abstract nodes

/**
 * Abstract mdast node that contains the smallest possible value.
 *
 * This interface is supposed to be extended if you make custom mdast nodes.
 *
 * For a union of all registered mdast literals, see {@link Literals}.
 */
export interface Literal extends Node {
    /**
     * Plain-text value.
     */
    value: string;
}

/**
 * Abstract mdast node.
 *
 * This interface is supposed to be extended.
 * If you can use {@link Literal} or {@link Parent}, you should.
 * But for example in markdown, a thematic break (`***`) is neither literal nor
 * parent, but still a node.
 *
 * To register custom mdast nodes, add them to {@link RootContentMap} and other
 * places where relevant (such as {@link ElementContentMap}).
 *
 * For a union of all registered mdast nodes, see {@link Nodes}.
 */
export interface Node extends UnistNode {
    /**
     * Info from the ecosystem.
     */
    data?: Data | undefined;
}

/**
 * Abstract mdast node that contains other mdast nodes (*children*).
 *
 * This interface is supposed to be extended if you make custom mdast nodes.
 *
 * For a union of all registered mdast parents, see {@link Parents}.
 */
export interface Parent extends Node {
    /**
     * List of children.
     */
    children: RootContent[];
}

// ## Concrete nodes

/**
 * Markdown block quote.
 */
export interface Blockquote extends Parent {
    /**
     * Node type of mdast block quote.
     */
    type: "blockquote";
    /**
     * Children of block quote.
     */
    children: Array<BlockContent | DefinitionContent>;
    /**
     * Data associated with the mdast block quote.
     */
    data?: BlockquoteData | undefined;
}

/**
 * Info associated with mdast block quote nodes by the ecosystem.
 */
export interface BlockquoteData extends Data {}

/**
 * Markdown break.
 */
export interface Break extends Node {
    /**
     * Node type of mdast break.
     */
    type: "break";
    /**
     * Data associated with the mdast break.
     */
    data?: BreakData | undefined;
}

/**
 * Info associated with mdast break nodes by the ecosystem.
 */
export interface BreakData extends Data {}

/**
 * Markdown code (flow) (block).
 */
export interface Code extends Literal {
    /**
     * Node type of mdast code (flow).
     */
    type: "code";
    /**
     * Language of computer code being marked up.
     */
    lang?: string | null | undefined;
    /**
     * Custom information relating to the node.
     *
     * If the lang field is present, a meta field can be present.
     */
    meta?: string | null | undefined;
    /**
     * Data associated with the mdast code (flow).
     */
    data?: CodeData | undefined;
}

/**
 * Info associated with mdast code (flow) (block) nodes by the ecosystem.
 */
export interface CodeData extends Data {}

/**
 * Markdown definition.
 */
export interface Definition extends Node, Association, Resource {
    /**
     * Node type of mdast definition.
     */
    type: "definition";
    /**
     * Data associated with the mdast definition.
     */
    data?: DefinitionData | undefined;
}

/**
 * Info associated with mdast definition nodes by the ecosystem.
 */
export interface DefinitionData extends Data {}

/**
 * Markdown GFM delete (strikethrough).
 */
export interface Delete extends Parent {
    /**
     * Node type of mdast GFM delete.
     */
    type: "delete";
    /**
     * Children of GFM delete.
     */
    children: PhrasingContent[];
    /**
     * Data associated with the mdast GFM delete.
     */
    data?: DeleteData | undefined;
}

/**
 * Info associated with mdast GFM delete nodes by the ecosystem.
 */
export interface DeleteData extends Data {}

/**
 * Markdown emphasis.
 */
export interface Emphasis extends Parent {
    /**
     * Node type of mdast emphasis.
     */
    type: "emphasis";
    /**
     * Children of emphasis.
     */
    children: PhrasingContent[];
    /**
     * Data associated with the mdast emphasis.
     */
    data?: EmphasisData | undefined;
}

/**
 * Info associated with mdast emphasis nodes by the ecosystem.
 */
export interface EmphasisData extends Data {}

/**
 * Markdown GFM footnote definition.
 */
export interface FootnoteDefinition extends Parent, Association {
    /**
     * Node type of mdast GFM footnote definition.
     */
    type: "footnoteDefinition";
    /**
     * Children of GFM footnote definition.
     */
    children: Array<BlockContent | DefinitionContent>;
    /**
     * Data associated with the mdast GFM footnote definition.
     */
    data?: FootnoteDefinitionData | undefined;
}

/**
 * Info associated with mdast GFM footnote definition nodes by the ecosystem.
 */
export interface FootnoteDefinitionData extends Data {}

/**
 * Markdown GFM footnote reference.
 */
export interface FootnoteReference extends Association, Node {
    /**
     * Node type of mdast GFM footnote reference.
     */
    type: "footnoteReference";
    /**
     * Data associated with the mdast GFM footnote reference.
     */
    data?: FootnoteReferenceData | undefined;
}

/**
 * Info associated with mdast GFM footnote reference nodes by the ecosystem.
 */
export interface FootnoteReferenceData extends Data {}

/**
 * Markdown heading.
 */
export interface Heading extends Parent {
    /**
     * Node type of mdast heading.
     */
    type: "heading";
    /**
     * Heading rank.
     *
     * A value of `1` is said to be the highest rank and `6` the lowest.
     */
    depth: 1 | 2 | 3 | 4 | 5 | 6;
    /**
     * Children of heading.
     */
    children: PhrasingContent[];
    /**
     * Data associated with the mdast heading.
     */
    data?: HeadingData | undefined;
}

/**
 * Info associated with mdast heading nodes by the ecosystem.
 */
export interface HeadingData extends Data {}

/**
 * Markdown HTML.
 */
export interface Html extends Literal {
    /**
     * Node type of mdast HTML.
     */
    type: "html";
    /**
     * Data associated with the mdast HTML.
     */
    data?: HtmlData | undefined;
}

/**
 * Info associated with mdast HTML nodes by the ecosystem.
 */
export interface HtmlData extends Data {}

/**
 * Old name of `Html` node.
 *
 * @deprecated
 *   Please use `Html` instead.
 */
export type HTML = Html;

/**
 * Markdown image.
 */
export interface Image extends Alternative, Node, Resource {
    /**
     * Node type of mdast image.
     */
    type: "image";
    /**
     * Data associated with the mdast image.
     */
    data?: ImageData | undefined;
}

/**
 * Info associated with mdast image nodes by the ecosystem.
 */
export interface ImageData extends Data {}

/**
 * Markdown image reference.
 */
export interface ImageReference extends Alternative, Node, Reference {
    /**
     * Node type of mdast image reference.
     */
    type: "imageReference";
    /**
     * Data associated with the mdast image reference.
     */
    data?: ImageReferenceData | undefined;
}

/**
 * Info associated with mdast image reference nodes by the ecosystem.
 */
export interface ImageReferenceData extends Data {}

/**
 * Markdown code (text) (inline).
 */
export interface InlineCode extends Literal {
    /**
     * Node type of mdast code (text).
     */
    type: "inlineCode";
    /**
     * Data associated with the mdast code (text).
     */
    data?: InlineCodeData | undefined;
}

/**
 * Info associated with mdast code (text) (inline) nodes by the ecosystem.
 */
export interface InlineCodeData extends Data {}

/**
 * Markdown link.
 */
export interface Link extends Parent, Resource {
    /**
     * Node type of mdast link.
     */
    type: "link";
    /**
     * Children of link.
     */
    children: PhrasingContent[];
    /**
     * Data associated with the mdast link.
     */
    data?: LinkData | undefined;
}

/**
 * Info associated with mdast link nodes by the ecosystem.
 */
export interface LinkData extends Data {}

/**
 * Markdown link reference.
 */
export interface LinkReference extends Parent, Reference {
    /**
     * Node type of mdast link reference.
     */
    type: "linkReference";
    /**
     * Children of link reference.
     */
    children: PhrasingContent[];
    /**
     * Data associated with the mdast link reference.
     */
    data?: LinkReferenceData | undefined;
}

/**
 * Info associated with mdast link reference nodes by the ecosystem.
 */
export interface LinkReferenceData extends Data {}

/**
 * Markdown list.
 */
export interface List extends Parent {
    /**
     * Node type of mdast list.
     */
    type: "list";
    /**
     * Whether the items have been intentionally ordered (when `true`), or that
     * the order of items is not important (when `false` or not present).
     */
    ordered?: boolean | null | undefined;
    /**
     * The starting number of the list, when the `ordered` field is `true`.
     */
    start?: number | null | undefined;
    /**
     * Whether one or more of the children are separated with a blank line from
     * its siblings (when `true`), or not (when `false` or not present).
     */
    spread?: boolean | null | undefined;
    /**
     * Children of list.
     */
    children: ListContent[];
    /**
     * Data associated with the mdast list.
     */
    data?: ListData | undefined;
}

/**
 * Info associated with mdast list nodes by the ecosystem.
 */
export interface ListData extends Data {}

/**
 * Markdown list item.
 */
export interface ListItem extends Parent {
    /**
     * Node type of mdast list item.
     */
    type: "listItem";
    /**
     * Whether the item is a tasklist item (when `boolean`).
     *
     * When `true`, the item is complete.
     * When `false`, the item is incomplete.
     */
    checked?: boolean | null | undefined;
    /**
     * Whether one or more of the children are separated with a blank line from
     * its siblings (when `true`), or not (when `false` or not present).
     */
    spread?: boolean | null | undefined;
    /**
     * Children of list item.
     */
    children: Array<BlockContent | DefinitionContent>;
    /**
     * Data associated with the mdast list item.
     */
    data?: ListItemData | undefined;
}

/**
 * Info associated with mdast list item nodes by the ecosystem.
 */
export interface ListItemData extends Data {}

/**
 * Markdown paragraph.
 */
export interface Paragraph extends Parent {
    /**
     * Node type of mdast paragraph.
     */
    type: "paragraph";
    /**
     * Children of paragraph.
     */
    children: PhrasingContent[];
    /**
     * Data associated with the mdast paragraph.
     */
    data?: ParagraphData | undefined;
}

/**
 * Info associated with mdast paragraph nodes by the ecosystem.
 */
export interface ParagraphData extends Data {}

/**
 * Document fragment or a whole document.
 *
 * Should be used as the root of a tree and must not be used as a child.
 */
export interface Root extends Parent {
    /**
     * Node type of mdast root.
     */
    type: "root";
    /**
     * Data associated with the mdast root.
     */
    data?: RootData | undefined;
}

/**
 * Info associated with mdast root nodes by the ecosystem.
 */
export interface RootData extends Data {}

/**
 * Markdown strong.
 */
export interface Strong extends Parent {
    /**
     * Node type of mdast strong.
     */
    type: "strong";
    /**
     * Children of strong.
     */
    children: PhrasingContent[];
    /**
     * Data associated with the mdast strong.
     */
    data?: StrongData | undefined;
}

/**
 * Info associated with mdast strong nodes by the ecosystem.
 */
export interface StrongData extends Data {}

/**
 * Markdown GFM table.
 */
export interface Table extends Parent {
    /**
     * Node type of mdast GFM table.
     */
    type: "table";
    /**
     * How cells in columns are aligned.
     */
    align?: AlignType[] | null | undefined;
    /**
     * Children of GFM table.
     */
    children: TableContent[];
    /**
     * Data associated with the mdast GFM table.
     */
    data?: TableData | undefined;
}

/**
 * Info associated with mdast GFM table nodes by the ecosystem.
 */
export interface TableData extends Data {}

/**
 * Markdown GFM table row.
 */
export interface TableRow extends Parent {
    /**
     * Node type of mdast GFM table row.
     */
    type: "tableRow";
    /**
     * Children of GFM table row.
     */
    children: RowContent[];
    /**
     * Data associated with the mdast GFM table row.
     */
    data?: TableRowData | undefined;
}

/**
 * Info associated with mdast GFM table row nodes by the ecosystem.
 */
export interface TableRowData extends Data {}

/**
 * Markdown GFM table cell.
 */
export interface TableCell extends Parent {
    /**
     * Node type of mdast GFM table cell.
     */
    type: "tableCell";
    /**
     * Children of GFM table cell.
     */
    children: PhrasingContent[];
    /**
     * Data associated with the mdast GFM table cell.
     */
    data?: TableCellData | undefined;
}

/**
 * Info associated with mdast GFM table cell nodes by the ecosystem.
 */
export interface TableCellData extends Data {}

/**
 * Markdown text.
 */
export interface Text extends Literal {
    /**
     * Node type of mdast text.
     */
    type: "text";
    /**
     * Data associated with the mdast text.
     */
    data?: TextData | undefined;
}

/**
 * Info associated with mdast text nodes by the ecosystem.
 */
export interface TextData extends Data {}

/**
 * Markdown thematic break (horizontal rule).
 */
export interface ThematicBreak extends Node {
    /**
     * Node type of mdast thematic break.
     */
    type: "thematicBreak";
    /**
     * Data associated with the mdast thematic break.
     */
    data?: ThematicBreakData | undefined;
}

/**
 * Info associated with mdast thematic break nodes by the ecosystem.
 */
export interface ThematicBreakData extends Data {}

/**
 * Markdown YAML.
 */
export interface Yaml extends Literal {
    /**
     * Node type of mdast YAML.
     */
    type: "yaml";
    /**
     * Data associated with the mdast YAML.
     */
    data?: YamlData | undefined;
}

/**
 * Info associated with mdast YAML nodes by the ecosystem.
 */
export interface YamlData extends Data {}

/**
 * Old name of `Yaml` node.
 *
 * @deprecated
 *   Please use `Yaml` instead.
 */
export type YAML = Yaml;
Ex Kmdast",
    "version": "4.0.422mde\mdQEJun Lu $jun2O,jun28md]4@1599d3ca45533e9d9248231c90843306b49c07fe13ad94ebf7345da44d8fd4bd4.7"
}Oa5?	x i100644 LICENSE z&{$Q{+%z100644 README.md tFm2SUM/t100644 index.d.ts .6N/#100644 package.json T}ʑq<3% 4xsx4# Installation
> `npm install --save @types/ms`

# Summary
This package contains type definitions for ms (https://github.com/vercel/ms).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ms.
## [index.d.ts](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ms/index.d.ts)
````ts
/**
 * Short/Long format for `value`.
 *
 * @param {Number} value
 * @param {{long: boolean}} options
 * @return {String}
 */
declare function ms(value: number, options?: { long: boolean }): string;

/**
 * Parse the given `value` and return milliseconds.
 *
 * @param {ms.StringValue} value
 * @return {Number}
 */
declare function ms(value: ms.StringValue): number;

declare namespace ms {
    // Unit, UnitAnyCase, and StringValue are backported from ms@3
    // https://github.com/vercel/ms/blob/8b5923d1d86c84a9f6aba8022d416dcf2361aa8d/src/index.ts

    type Unit =
        | "Years"
        | "Year"
        | "Yrs"
        | "Yr"
        | "Y"
        | "Weeks"
        | "Week"
        | "W"
        | "Days"
        | "Day"
        | "D"
        | "Hours"
        | "Hour"
        | "Hrs"
        | "Hr"
        | "H"
        | "Minutes"
        | "Minute"
        | "Mins"
        | "Min"
        | "M"
        | "Seconds"
        | "Second"
        | "Secs"
        | "Sec"
        | "s"
        | "Milliseconds"
        | "Millisecond"
        | "Msecs"
        | "Msec"
        | "Ms";

    type UnitAnyCase = Unit | Uppercase<Unit> | Lowercase<Unit>;

    type StringValue =
        | `${number}`
        | `${number}${UnitAnyCase}`
        | `${number} ${UnitAnyCase}`;
}

export = ms;

````

### Additional Details
 * Last updated: Thu, 16 Jan 2025 21:02:45 GMT
 * Dependencies: none

# Credits
These definitions were written by [Zhiyuan Wang](https://github.com/danny8002).
#Qx/**
 * Short/Long format for `value`.
 *
 * @param {Number} value
 * @param {{long: boolean}} options
 * @return {String}
 */
declare function ms(value: number, options?: { long: boolean }): string;

/**
 * Parse the given `value` and return milliseconds.
 *
 * @param {ms.StringValue} value
 * @return {Number}
 */
declare function ms(value: ms.StringValue): number;

declare namespace ms {
    // Unit, UnitAnyCase, and StringValue are backported from ms@3
    // https://github.com/vercel/ms/blob/8b5923d1d86c84a9f6aba8022d416dcf2361aa8d/src/index.ts

    type Unit =
        | "Years"
        | "Year"
        | "Yrs"
        | "Yr"
        | "Y"
        | "Weeks"
        | "Week"
        | "W"
        | "Days"
        | "Day"
        | "D"
        | "Hours"
        | "Hour"
        | "Hrs"
        | "Hr"
        | "H"
        | "Minutes"
        | "Minute"
        | "Mins"
        | "Min"
        | "M"
        | "Seconds"
        | "Second"
        | "Secs"
        | "Sec"
        | "s"
        | "Milliseconds"
        | "Millisecond"
        | "Msecs"
        | "Msec"
        | "Ms";

    type UnitAnyCase = Unit | Uppercase<Unit> | Lowercase<Unit>;

    type StringValue =
        | `${number}`
        | `${number}${UnitAnyCase}`
        | `${number} ${UnitAnyCase}`;
}

export = ms;
jh1x{
    "name": "@types/ms",
    "version": "2.1.0",
    "description": "TypeScript definitions for ms",
    "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/ms",
    "license": "MIT",
    "contributors": [
        {
            "name": "Zhiyuan Wang",
            "githubUsername": "danny8002",
            "url": "https://github.com/danny8002"
        }
    ],
    "main": "",
    "types": "index.d.ts",
    "repository": {
        "type": "git",
        "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
        "directory": "types/ms"
    },
    "scripts": {},
    "dependencies": {},
    "peerDependencies": {},
    "typesPublisherContentHash": "2c8651ce1714fdc6bcbc0f262c93a790f1d127fb1c2dc8edbb583decef56fd39",
    "typeScriptVersion": "5.0"
}L	x i100644 LICENSE z&{$Q{+%z100644 README.md ;<{r9؜}100644 index.d.ts Q=⬱Ȍ&8B.100644 package.json 	-"zicX;0/x# Installation
> `npm install --save @types/unist`

# Summary
This package contains type definitions for unist (https://github.com/syntax-tree/unist).

# Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist.

### Additional Details
 * Last updated: Thu, 15 Aug 2024 02:18:53 GMT
 * Dependencies: none

# Credits
These definitions were written by [bizen241](https://github.com/bizen241), [Jun Lu](https://github.com/lujun2), [Hernan Rajchert](https://github.com/hrajchert), [Titus Wormer](https://github.com/wooorm), [Junyoung Choi](https://github.com/rokt33r), [Ben Moon](https://github.com/GuiltyDolphin), [JounQin](https://github.com/JounQin), and [Remco Haszing](https://github.com/remcohaszing).
G6x	// ## Interfaces

/**
 * Info associated with nodes by the ecosystem.
 *
 * This space is guaranteed to never be specified by unist or specifications
 * implementing unist.
 * But you can use it in utilities and plugins to store data.
 *
 * This type can be augmented to register custom data.
 * For example:
 *
 * ```ts
 * declare module 'unist' {
 *   interface Data {
 *     // `someNode.data.myId` is typed as `number | undefined`
 *     myId?: number | undefined
 *   }
 * }
 * ```
 */
export interface Data {}

/**
 * One place in a source file.
 */
export interface Point {
    /**
     * Line in a source file (1-indexed integer).
     */
    line: number;

    /**
     * Column in a source file (1-indexed integer).
     */
    column: number;
    /**
     * Character in a source file (0-indexed integer).
     */
    offset?: number | undefined;
}

/**
 * Position of a node in a source document.
 *
 * A position is a range between two points.
 */
export interface Position {
    /**
     * Place of the first character of the parsed source region.
     */
    start: Point;

    /**
     * Place of the first character after the parsed source region.
     */
    end: Point;
}

// ## Abstract nodes

/**
 * Abstract unist node that contains the smallest possible value.
 *
 * This interface is supposed to be extended.
 *
 * For example, in HTML, a `text` node is a leaf that contains text.
 */
export interface Literal extends Node {
    /**
     * Plain value.
     */
    value: unknown;
}

/**
 * Abstract unist node.
 *
 * The syntactic unit in unist syntax trees are called nodes.
 *
 * This interface is supposed to be extended.
 * If you can use {@link Literal} or {@link Parent}, you should.
 * But for example in markdown, a `thematicBreak` (`***`), is neither literal
 * nor parent, but still a node.
 */
export interface Node {
    /**
     * Node type.
     */
    type: string;

    /**
     * Info from the ecosystem.
     */
    data?: Data | undefined;

    /**
     * Position of a node in a source document.
     *
     * Nodes that are generated (not in the original source document) must not
     * have a position.
     */
    position?: Position | undefined;
}

/**
 * Abstract unist node that contains other nodes (*children*).
 *
 * This interface is supposed to be extended.
 *
 * For example, in XML, an element is a parent of different things, such as
 * comments, text, and further elements.
 */
export interface Parent extends Node {
    /**
     * List of children.
     */
    children: Node[];
}
Uðqx{
    "name": "@types/unist",
    "version": "3.0.3",
    "description": "TypeScript definitions for unist",
    "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/unist",
    "license": "MIT",
    "contributors": [
        {
            "name": "bizen241",
            "githubUsername": "bizen241",
            "url": "https://github.com/bizen241"
        },
        {
            "name": "Jun Lu",
            "githubUsername": "lujun2",
            "url": "https://github.com/lujun2"
        },
        {
            "name": "Hernan Rajchert",
            "githubUsername": "hrajchert",
            "url": "https://github.com/hrajchert"
        },
        {
            "name": "Titus Wormer",
            "githubUsername": "wooorm",
            "url": "https://github.com/wooorm"
        },
        {
            "name": "Junyoung Choi",
            "githubUsername": "rokt33r",
            "url": "https://github.com/rokt33r"
        },
        {
            "name": "Ben Moon",
            "githubUsername": "GuiltyDolphin",
            "url": "https://github.com/GuiltyDolphin"
        },
        {
            "name": "JounQin",
            "githubUsername": "JounQin",
            "url": "https://github.com/JounQin"
        },
        {
            "name": "Remco Haszing",
            "githubUsername": "remcohaszing",
            "url": "https://github.com/remcohaszing"
        }
    ],
    "main": "",
    "types": "index.d.ts",
    "repository": {
        "type": "git",
        "url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git",
        "directory": "types/unist"
    },
    "scripts": {},
    "dependencies": {},
    "typesPublisherContentHash": "7f3d5ce8d56003f3583a5317f98d444bdc99910c7b486c6b10af4f38694e61fe",
    "typeScriptVersion": "4.8"
}yoЮx !100644 LICENSE i]K+$Q;k:h100644 README.md 1|:ĥSN͢~};̏100644 index.d.ts {|Ph`rDXoi100644 index.js  N	@3Y1M`PbsW_100644 package.json mޜ0ĭH	[100644 xhtml.js R Չs8SPDxDCopyright (c) Ben Briggs <beneb.info@gmail.com> (http://beneb.info)

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
b]2Qx+Copyright (C) 2012-2017 by Ingvar StepanyanC= obtaining a copy
- 
 4	
to use, 5{ Software is
, K included in
Bt EXPRESS OR
4 OF MERCHANTABILITY,
$ 0&
AUTHORS OR COPYRIGHT l1
LIABILITY, < FROM,
7! OTHER DEALINGS IN
THE SOFTWARE.
"R#xxv# Acorn-JSX

[![Build Status](https://travis-ci.org/acornjs/acorn-jsx.svg?branch=master)](https://travis-ci.org/acornjs/acorn-jsx)
[![NPM version](https://img.shields.io/npm/v/acorn-jsx.svg)](https://www.npmjs.org/package/acorn-jsx)

This is plugin for [Acorn](http://marijnhaverbeke.nl/acorn/) - a tiny, fast JavaScript parser, written completely in JavaScript.

It was created as an experimental alternative, faster [React.js JSX](http://facebook.github.io/react/docs/jsx-in-depth.html) parser. Later, it replaced the [official parser](https://github.com/facebookarchive/esprima) and these days is used by many prominent development tools.

## Transpiler

Please note that this tool only parses source code to JSX AST, which is useful for various language tools and services. If you want to transpile your code to regular ES5-compliant JavaScript with source map, check out [Babel](https://babeljs.io/) and [Buble](https://buble.surge.sh/) transpilers which use `acorn-jsx` under the hood.

## Usage

Requiring this module provides you with an Acorn plugin that you can use like this:

```javascript
var acorn = require("acorn");
var jsx = require("acorn-jsx");
acorn.Parser.extend(jsx()).parse("my(<jsx/>, 'code');");
```

Note that official spec doesn't support mix of XML namespaces and object-style access in tag names (#27) like in `<namespace:Object.Property />`, so it was deprecated in `acorn-jsx@3.0`. If you still want to opt-in to support of such constructions, you can pass the following option:

```javascript
acorn.Parser.extend(jsx({ allowNamespacedObjects: true }))
```

Also, since most apps use pure React transformer, a new option was introduced that allows to prohibit namespaces completely:

```javascript
acorn.Parser.extend(jsx({ allowNamespaces: false }))
```

Note that by default `allowNamespaces` is enabled for spec compliancy.

## License

This plugin is issued under the [MIT license](./LICENSE).

ximport { Parser } from 'acorn' 

declare const jsx: (options?: jsx.Options) => (BaseParser: typeof Parser) => typeof Parser;

declare namespace jsx {
  interface Options {
    allowNamespacedObjects?: boolean;
    allowNamespaces?: boolean;
  }
}

export = jsx;
4Xx=,'use strict';

const XHTMLEntities = require('./xhtml');

const hexNumber = /^[\da-fA-F]+$/;
const decimalNumber = /^\d+$/;

// The map to `acorn-jsx` tokens from `acorn` namespace objects.
const acornJsxMap = new WeakMap();

// Get the original tokens for the given `acorn` namespace object.
function getJsxTokens(acorn) {
  acorn = acorn.Parser.acorn || acorn;
  let acornJsx = acornJsxMap.get(acorn);
  if (!acornJsx) {
    const tt = acorn.tokTypes;
    const TokContext = acorn.TokContext;
    const TokenType = acorn.TokenType;
    const tc_oTag = new TokContext('<tag', false);
    const tc_cTag = new TokContext('</tag', false);
    const tc_expr = new TokContext('<tag>...</tag>', true, true);
    const tokContexts = {
      tc_oTag: tc_oTag,
      tc_cTag: tc_cTag,
      tc_expr: tc_expr
    };
    const tokTypes = {
      jsxName: new TokenType('jsxName'),
      jsxText: new TokenType('jsxText', {beforeExpr: true}),
      jsxTagStart: new TokenType('jsxTagStart', {startsExpr: true}),
      jsxTagEnd: new TokenType('jsxTagEnd')
    };

    tokTypes.jsxTagStart.updateContext = function() {
      this.context.push(tc_expr); // treat as beginning of JSX expression
      this.context.push(tc_oTag); // start opening tag context
      this.exprAllowed = false;
    };
    tokTypes.jsxTagEnd.updateContext = function(prevType) {
      let out = this.context.pop();
      if (out === tc_oTag && prevType === tt.slash || out === tc_cTag) {
        this.context.pop();
        this.exprAllowed = this.curContext() === tc_expr;
      } else {
        this.exprAllowed = true;
      }
    };

    acornJsx = { tokContexts: tokContexts, tokTypes: tokTypes };
    acornJsxMap.set(acorn, acornJsx);
  }

  return acornJsx;
}

// Transforms JSX element name to string.

function getQualifiedJSXName(object) {
  if (!object)
    return object;

  if (object.type === 'JSXIdentifier')
    return object.name;

  if (object.type === 'JSXNamespacedName')
    return object.namespace.name + ':' + object.name.name;

  if (object.type === 'JSXMemberExpression')
    return getQualifiedJSXName(object.object) + '.' +
    getQualifiedJSXName(object.property);
}

module.exports = function(options) {
  options = options || {};
  return function(Parser) {
    return plugin({
      allowNamespaces: options.allowNamespaces !== false,
      allowNamespacedObjects: !!options.allowNamespacedObjects
    }, Parser);
  };
};

// This is `tokTypes` of the peer dep.
// This can be different instances from the actual `tokTypes` this plugin uses.
Object.defineProperty(module.exports, "tokTypes", {
  get: function get_tokTypes() {
    return getJsxTokens(require("acorn")).tokTypes;
  },
  configurable: true,
  enumerable: true
});

function plugin(options, Parser) {
  const acorn = Parser.acorn || require("acorn");
  const acornJsx = getJsxTokens(acorn);
  const tt = acorn.tokTypes;
  const tok = acornJsx.tokTypes;
  const tokContexts = acorn.tokContexts;
  const tc_oTag = acornJsx.tokContexts.tc_oTag;
  const tc_cTag = acornJsx.tokContexts.tc_cTag;
  const tc_expr = acornJsx.tokContexts.tc_expr;
  const isNewLine = acorn.isNewLine;
  const isIdentifierStart = acorn.isIdentifierStart;
  const isIdentifierChar = acorn.isIdentifierChar;

  return class extends Parser {
    // Expose actual `tokTypes` and `tokContexts` to other plugins.
    static get acornJsx() {
      return acornJsx;
    }

    // Reads inline JSX contents token.
    jsx_readToken() {
      let out = '', chunkStart = this.pos;
      for (;;) {
        if (this.pos >= this.input.length)
          this.raise(this.start, 'Unterminated JSX contents');
        let ch = this.input.charCodeAt(this.pos);

        switch (ch) {
        case 60: // '<'
        case 123: // '{'
          if (this.pos === this.start) {
            if (ch === 60 && this.exprAllowed) {
              ++this.pos;
              return this.finishToken(tok.jsxTagStart);
            }
            return this.getTokenFromCode(ch);
          }
          out += this.input.slice(chunkStart, this.pos);
          return this.finishToken(tok.jsxText, out);

        case 38: // '&'
          out += this.input.slice(chunkStart, this.pos);
          out += this.jsx_readEntity();
          chunkStart = this.pos;
          break;

        case 62: // '>'
        case 125: // '}'
          this.raise(
            this.pos,
            "Unexpected token `" + this.input[this.pos] + "`. Did you mean `" +
              (ch === 62 ? "&gt;" : "&rbrace;") + "` or " + "`{\"" + this.input[this.pos] + "\"}" + "`?"
          );

        default:
          if (isNewLine(ch)) {
            out += this.input.slice(chunkStart, this.pos);
            out += this.jsx_readNewLine(true);
            chunkStart = this.pos;
          } else {
            ++this.pos;
          }
        }
      }
    }

    jsx_readNewLine(normalizeCRLF) {
      let ch = this.input.charCodeAt(this.pos);
      let out;
      ++this.pos;
      if (ch === 13 && this.input.charCodeAt(this.pos) === 10) {
        ++this.pos;
        out = normalizeCRLF ? '\n' : '\r\n';
      } else {
        out = String.fromCharCode(ch);
      }
      if (this.options.locations) {
        ++this.curLine;
        this.lineStart = this.pos;
      }

      return out;
    }

    jsx_readString(quote) {
      let out = '', chunkStart = ++this.pos;
      for (;;) {
        if (this.pos >= this.input.length)
          this.raise(this.start, 'Unterminated string constant');
        let ch = this.input.charCodeAt(this.pos);
        if (ch === quote) break;
        if (ch === 38) { // '&'
          out += this.input.slice(chunkStart, this.pos);
          out += this.jsx_readEntity();
          chunkStart = this.pos;
        } else if (isNewLine(ch)) {
          out += this.input.slice(chunkStart, this.pos);
          out += this.jsx_readNewLine(false);
          chunkStart = this.pos;
        } else {
          ++this.pos;
        }
      }
      out += this.input.slice(chunkStart, this.pos++);
      return this.finishToken(tt.string, out);
    }

    jsx_readEntity() {
      let str = '', count = 0, entity;
      let ch = this.input[this.pos];
      if (ch !== '&')
        this.raise(this.pos, 'Entity must start with an ampersand');
      let startPos = ++this.pos;
      while (this.pos < this.input.length && count++ < 10) {
        ch = this.input[this.pos++];
        if (ch === ';') {
          if (str[0] === '#') {
            if (str[1] === 'x') {
              str = str.substr(2);
              if (hexNumber.test(str))
                entity = String.fromCharCode(parseInt(str, 16));
            } else {
              str = str.substr(1);
              if (decimalNumber.test(str))
                entity = String.fromCharCode(parseInt(str, 10));
            }
          } else {
            entity = XHTMLEntities[str];
          }
          break;
        }
        str += ch;
      }
      if (!entity) {
        this.pos = startPos;
        return '&';
      }
      return entity;
    }

    // Read a JSX identifier (valid tag or attribute name).
    //
    // Optimized version since JSX identifiers can't contain
    // escape characters and so can be read as single slice.
    // Also assumes that first character was already checked
    // by isIdentifierStart in readToken.

    jsx_readWord() {
      let ch, start = this.pos;
      do {
        ch = this.input.charCodeAt(++this.pos);
      } while (isIdentifierChar(ch) || ch === 45); // '-'
      return this.finishToken(tok.jsxName, this.input.slice(start, this.pos));
    }

    // Parse next token as JSX identifier

    jsx_parseIdentifier() {
      let node = this.startNode();
      if (this.type === tok.jsxName)
        node.name = this.value;
      else if (this.type.keyword)
        node.name = this.type.keyword;
      else
        this.unexpected();
      this.next();
      return this.finishNode(node, 'JSXIdentifier');
    }

    // Parse namespaced identifier.

    jsx_parseNamespacedName() {
      let startPos = this.start, startLoc = this.startLoc;
      let name = this.jsx_parseIdentifier();
      if (!options.allowNamespaces || !this.eat(tt.colon)) return name;
      var node = this.startNodeAt(startPos, startLoc);
      node.namespace = name;
      node.name = this.jsx_parseIdentifier();
      return this.finishNode(node, 'JSXNamespacedName');
    }

    // Parses element name in any form - namespaced, member
    // or single identifier.

    jsx_parseElementName() {
      if (this.type === tok.jsxTagEnd) return '';
      let startPos = this.start, startLoc = this.startLoc;
      let node = this.jsx_parseNamespacedName();
      if (this.type === tt.dot && node.type === 'JSXNamespacedName' && !options.allowNamespacedObjects) {
        this.unexpected();
      }
      while (this.eat(tt.dot)) {
        let newNode = this.startNodeAt(startPos, startLoc);
        newNode.object = node;
        newNode.property = this.jsx_parseIdentifier();
        node = this.finishNode(newNode, 'JSXMemberExpression');
      }
      return node;
    }

    // Parses any type of JSX attribute value.

    jsx_parseAttributeValue() {
      switch (this.type) {
      case tt.braceL:
        let node = this.jsx_parseExpressionContainer();
        if (node.expression.type === 'JSXEmptyExpression')
          this.raise(node.start, 'JSX attributes must only be assigned a non-empty expression');
        return node;

      case tok.jsxTagStart:
      case tt.string:
        return this.parseExprAtom();

      default:
        this.raise(this.start, 'JSX value should be either an expression or a quoted JSX text');
      }
    }

    // JSXEmptyExpression is unique type since it doesn't actually parse anything,
    // and so it should start at the end of last read token (left brace) and finish
    // at the beginning of the next one (right brace).

    jsx_parseEmptyExpression() {
      let node = this.startNodeAt(this.lastTokEnd, this.lastTokEndLoc);
      return this.finishNodeAt(node, 'JSXEmptyExpression', this.start, this.startLoc);
    }

    // Parses JSX expression enclosed into curly brackets.

    jsx_parseExpressionContainer() {
      let node = this.startNode();
      this.next();
      node.expression = this.type === tt.braceR
        ? this.jsx_parseEmptyExpression()
        : this.parseExpression();
      this.expect(tt.braceR);
      return this.finishNode(node, 'JSXExpressionContainer');
    }

    // Parses following JSX attribute name-value pair.

    jsx_parseAttribute() {
      let node = this.startNode();
      if (this.eat(tt.braceL)) {
        this.expect(tt.ellipsis);
        node.argument = this.parseMaybeAssign();
        this.expect(tt.braceR);
        return this.finishNode(node, 'JSXSpreadAttribute');
      }
      node.name = this.jsx_parseNamespacedName();
      node.value = this.eat(tt.eq) ? this.jsx_parseAttributeValue() : null;
      return this.finishNode(node, 'JSXAttribute');
    }

    // Parses JSX opening tag starting after '<'.

    jsx_parseOpeningElementAt(startPos, startLoc) {
      let node = this.startNodeAt(startPos, startLoc);
      node.attributes = [];
      let nodeName = this.jsx_parseElementName();
      if (nodeName) node.name = nodeName;
      while (this.type !== tt.slash && this.type !== tok.jsxTagEnd)
        node.attributes.push(this.jsx_parseAttribute());
      node.selfClosing = this.eat(tt.slash);
      this.expect(tok.jsxTagEnd);
      return this.finishNode(node, nodeName ? 'JSXOpeningElement' : 'JSXOpeningFragment');
    }

    // Parses JSX closing tag starting after '</'.

    jsx_parseClosingElementAt(startPos, startLoc) {
      let node = this.startNodeAt(startPos, startLoc);
      let nodeName = this.jsx_parseElementName();
      if (nodeName) node.name = nodeName;
      this.expect(tok.jsxTagEnd);
      return this.finishNode(node, nodeName ? 'JSXClosingElement' : 'JSXClosingFragment');
    }

    // Parses entire JSX element, including it's opening tag
    // (starting after '<'), attributes, contents and closing tag.

    jsx_parseElementAt(startPos, startLoc) {
      let node = this.startNodeAt(startPos, startLoc);
      let children = [];
      let openingElement = this.jsx_parseOpeningElementAt(startPos, startLoc);
      let closingElement = null;

      if (!openingElement.selfClosing) {
        contents: for (;;) {
          switch (this.type) {
          case tok.jsxTagStart:
            startPos = this.start; startLoc = this.startLoc;
            this.next();
            if (this.eat(tt.slash)) {
              closingElement = this.jsx_parseClosingElementAt(startPos, startLoc);
              break contents;
            }
            children.push(this.jsx_parseElementAt(startPos, startLoc));
            break;

          case tok.jsxText:
            children.push(this.parseExprAtom());
            break;

          case tt.braceL:
            children.push(this.jsx_parseExpressionContainer());
            break;

          default:
            this.unexpected();
          }
        }
        if (getQualifiedJSXName(closingElement.name) !== getQualifiedJSXName(openingElement.name)) {
          this.raise(
            closingElement.start,
            'Expected corresponding JSX closing tag for <' + getQualifiedJSXName(openingElement.name) + '>');
        }
      }
      let fragmentOrElement = openingElement.name ? 'Element' : 'Fragment';

      node['opening' + fragmentOrElement] = openingElement;
      node['closing' + fragmentOrElement] = closingElement;
      node.children = children;
      if (this.type === tt.relational && this.value === "<") {
        this.raise(this.start, "Adjacent JSX elements must be wrapped in an enclosing tag");
      }
      return this.finishNode(node, 'JSX' + fragmentOrElement);
    }

    // Parse JSX text

    jsx_parseText() {
      let node = this.parseLiteral(this.value);
      node.type = "JSXText";
      return node;
    }

    // Parses entire JSX element from current position.

    jsx_parseElement() {
      let startPos = this.start, startLoc = this.startLoc;
      this.next();
      return this.jsx_parseElementAt(startPos, startLoc);
    }

    parseExprAtom(refShortHandDefaultPos) {
      if (this.type === tok.jsxText)
        return this.jsx_parseText();
      else if (this.type === tok.jsxTagStart)
        return this.jsx_parseElement();
      else
        return super.parseExprAtom(refShortHandDefaultPos);
    }

    readToken(code) {
      let context = this.curContext();

      if (context === tc_expr) return this.jsx_readToken();

      if (context === tc_oTag || context === tc_cTag) {
        if (isIdentifierStart(code)) return this.jsx_readWord();

        if (code == 62) {
          ++this.pos;
          return this.finishToken(tok.jsxTagEnd);
        }

        if ((code === 34 || code === 39) && context == tc_oTag)
          return this.jsx_readString(code);
      }

      if (code === 60 && this.exprAllowed && this.input.charCodeAt(this.pos + 1) !== 33) {
        ++this.pos;
        return this.finishToken(tok.jsxTagStart);
      }
      return super.readToken(code);
    }

    updateContext(prevType) {
      if (this.type == tt.braceL) {
        var curContext = this.curContext();
        if (curContext == tc_oTag) this.context.push(tokContexts.b_expr);
        else if (curContext == tc_expr) this.context.push(tokContexts.b_tmpl);
        else super.updateContext(prevType);
        this.exprAllowed = true;
      } else if (this.type === tt.slash && prevType === tok.jsxTagStart) {
        this.context.length -= 2; // do not consider JSX expr -> JSX open tag -> ... anymore
        this.context.push(tc_cTag); // reconsider as closing tag context
        this.exprAllowed = false;
      } else {
        return super.updateContext(prevType);
      }
    }
  };
}
n[0$xE{
  "name": "acorn-jsx",
  "description": "Modern, fast React.js JSX parser",
  "homepage": "https://github.com/acornjs/acorn-jsx",
  "version": "5.3.2",
  "maintainers": [
    {
      "name": "Ingvar Stepanyan",
      "email": "me@rreverser.com",
      "web": "http://rreverser.com/"
    }
  ],
  "repository": {
    "type": "git",
    "url": "https://github.com/acornjs/acorn-jsx"
  },
  "license": "MIT",
  "scripts": {
    "test": "node test/run.js"
  },
  "peerDependencies": {
    "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"
  },
  "devDependencies": {
    "acorn": "^8.0.1"
  }
}
xnmodule.exports = {
  quot: '\u0022',
  amp: '&',
  apos: '\u0027',
  lt: '<',
  gt: '>',
  nbsp: '\u00A0',
  iexcl: '\u00A1',
  cent: '\u00A2',
  pound: '\u00A3',
  curren: '\u00A4',
  yen: '\u00A5',
  brvbar: '\u00A6',
  sect: '\u00A7',
  uml: '\u00A8',
  copy: '\u00A9',
  ordf: '\u00AA',
  laquo: '\u00AB',
  not: '\u00AC',
  shy: '\u00AD',
  reg: '\u00AE',
  macr: '\u00AF',
  deg: '\u00B0',
  plusmn: '\u00B1',
  sup2: '\u00B2',
  sup3: '\u00B3',
  acute: '\u00B4',
  micro: '\u00B5',
  para: '\u00B6',
  middot: '\u00B7',
  cedil: '\u00B8',
  sup1: '\u00B9',
  ordm: '\u00BA',
  raquo: '\u00BB',
  frac14: '\u00BC',
  frac12: '\u00BD',
  frac34: '\u00BE',
  iquest: '\u00BF',
  Agrave: '\u00C0',
  Aacute: '\u00C1',
  Acirc: '\u00C2',
  Atilde: '\u00C3',
  Auml: '\u00C4',
  Aring: '\u00C5',
  AElig: '\u00C6',
  Ccedil: '\u00C7',
  Egrave: '\u00C8',
  Eacute: '\u00C9',
  Ecirc: '\u00CA',
  Euml: '\u00CB',
  Igrave: '\u00CC',
  Iacute: '\u00CD',
  Icirc: '\u00CE',
  Iuml: '\u00CF',
  ETH: '\u00D0',
  Ntilde: '\u00D1',
  Ograve: '\u00D2',
  Oacute: '\u00D3',
  Ocirc: '\u00D4',
  Otilde: '\u00D5',
  Ouml: '\u00D6',
  times: '\u00D7',
  Oslash: '\u00D8',
  Ugrave: '\u00D9',
  Uacute: '\u00DA',
  Ucirc: '\u00DB',
  Uuml: '\u00DC',
  Yacute: '\u00DD',
  THORN: '\u00DE',
  szlig: '\u00DF',
  agrave: '\u00E0',
  aacute: '\u00E1',
  acirc: '\u00E2',
  atilde: '\u00E3',
  auml: '\u00E4',
  aring: '\u00E5',
  aelig: '\u00E6',
  ccedil: '\u00E7',
  egrave: '\u00E8',
  eacute: '\u00E9',
  ecirc: '\u00EA',
  euml: '\u00EB',
  igrave: '\u00EC',
  iacute: '\u00ED',
  icirc: '\u00EE',
  iuml: '\u00EF',
  eth: '\u00F0',
  ntilde: '\u00F1',
  ograve: '\u00F2',
  oacute: '\u00F3',
  ocirc: '\u00F4',
  otilde: '\u00F5',
  ouml: '\u00F6',
  divide: '\u00F7',
  oslash: '\u00F8',
  ugrave: '\u00F9',
  uacute: '\u00FA',
  ucirc: '\u00FB',
  uuml: '\u00FC',
  yacute: '\u00FD',
  thorn: '\u00FE',
  yuml: '\u00FF',
  OElig: '\u0152',
  oelig: '\u0153',
  Scaron: '\u0160',
  scaron: '\u0161',
  Yuml: '\u0178',
  fnof: '\u0192',
  circ: '\u02C6',
  tilde: '\u02DC',
  Alpha: '\u0391',
  Beta: '\u0392',
  Gamma: '\u0393',
  Delta: '\u0394',
  Epsilon: '\u0395',
  Zeta: '\u0396',
  Eta: '\u0397',
  Theta: '\u0398',
  Iota: '\u0399',
  Kappa: '\u039A',
  Lambda: '\u039B',
  Mu: '\u039C',
  Nu: '\u039D',
  Xi: '\u039E',
  Omicron: '\u039F',
  Pi: '\u03A0',
  Rho: '\u03A1',
  Sigma: '\u03A3',
  Tau: '\u03A4',
  Upsilon: '\u03A5',
  Phi: '\u03A6',
  Chi: '\u03A7',
  Psi: '\u03A8',
  Omega: '\u03A9',
  alpha: '\u03B1',
  beta: '\u03B2',
  gamma: '\u03B3',
  delta: '\u03B4',
  epsilon: '\u03B5',
  zeta: '\u03B6',
  eta: '\u03B7',
  theta: '\u03B8',
  iota: '\u03B9',
  kappa: '\u03BA',
  lambda: '\u03BB',
  mu: '\u03BC',
  nu: '\u03BD',
  xi: '\u03BE',
  omicron: '\u03BF',
  pi: '\u03C0',
  rho: '\u03C1',
  sigmaf: '\u03C2',
  sigma: '\u03C3',
  tau: '\u03C4',
  upsilon: '\u03C5',
  phi: '\u03C6',
  chi: '\u03C7',
  psi: '\u03C8',
  omega: '\u03C9',
  thetasym: '\u03D1',
  upsih: '\u03D2',
  piv: '\u03D6',
  ensp: '\u2002',
  emsp: '\u2003',
  thinsp: '\u2009',
  zwnj: '\u200C',
  zwj: '\u200D',
  lrm: '\u200E',
  rlm: '\u200F',
  ndash: '\u2013',
  mdash: '\u2014',
  lsquo: '\u2018',
  rsquo: '\u2019',
  sbquo: '\u201A',
  ldquo: '\u201C',
  rdquo: '\u201D',
  bdquo: '\u201E',
  dagger: '\u2020',
  Dagger: '\u2021',
  bull: '\u2022',
  hellip: '\u2026',
  permil: '\u2030',
  prime: '\u2032',
  Prime: '\u2033',
  lsaquo: '\u2039',
  rsaquo: '\u203A',
  oline: '\u203E',
  frasl: '\u2044',
  euro: '\u20AC',
  image: '\u2111',
  weierp: '\u2118',
  real: '\u211C',
  trade: '\u2122',
  alefsym: '\u2135',
  larr: '\u2190',
  uarr: '\u2191',
  rarr: '\u2192',
  darr: '\u2193',
  harr: '\u2194',
  crarr: '\u21B5',
  lArr: '\u21D0',
  uArr: '\u21D1',
  rArr: '\u21D2',
  dArr: '\u21D3',
  hArr: '\u21D4',
  forall: '\u2200',
  part: '\u2202',
  exist: '\u2203',
  empty: '\u2205',
  nabla: '\u2207',
  isin: '\u2208',
  notin: '\u2209',
  ni: '\u220B',
  prod: '\u220F',
  sum: '\u2211',
  minus: '\u2212',
  lowast: '\u2217',
  radic: '\u221A',
  prop: '\u221D',
  infin: '\u221E',
  ang: '\u2220',
  and: '\u2227',
  or: '\u2228',
  cap: '\u2229',
  cup: '\u222A',
  'int': '\u222B',
  there4: '\u2234',
  sim: '\u223C',
  cong: '\u2245',
  asymp: '\u2248',
  ne: '\u2260',
  equiv: '\u2261',
  le: '\u2264',
  ge: '\u2265',
  sub: '\u2282',
  sup: '\u2283',
  nsub: '\u2284',
  sube: '\u2286',
  supe: '\u2287',
  oplus: '\u2295',
  otimes: '\u2297',
  perp: '\u22A5',
  sdot: '\u22C5',
  lceil: '\u2308',
  rceil: '\u2309',
  lfloor: '\u230A',
  rfloor: '\u230B',
  lang: '\u2329',
  rang: '\u232A',
  loz: '\u25CA',
  spades: '\u2660',
  clubs: '\u2663',
  hearts: '\u2665',
  diams: '\u2666'
};
25x *100644 CHANGELOG.md ^L-EιLd3/f100644 LICENSE qc^}[79Hb 100644 README.md T2mBj/ܩf740000 bin VWV40000 dist oB;%Y:4fT100644 package.json [Jfv2Q6)cO7x_## 8.18.0 (2026-07-28)

### New features

The new `startLocation` option can now be used to tell the parser the line and column the parse starts at (mostly useful with `parseExpressionAt`).

### Bug fixes

Reject uses of `**` with a non-parenthesized arrow function as left-hand side.

Avoid computing the start line in `parseExpressionAt` when locations aren't used.

## 8.17.0 (2026-06-11)

### New features

The new `strict` option can be used to start script sources in strict mode.

### Bug fixes

Fix a number of corner case bugs when `using` or `await using` appear in `for` loop specs.

Disallow `new super()` expressions.

Don't allow the conditional in a ternary expression to be a (naked) arrow function.

## 8.16.0 (2026-02-19)

### New features

The `sourceType` option can now be set to `"commonjs"` to have the parser treat the top level scope as a function scope.

Add support for Unicode 17.

### Bug fixes

Don't recognize `await using` as contextual keywords when followed directly by a backslash.

Fix an issue where the parser would allow `return` statements in `static` blocks when `allowReturnOutsideFunction` was enabled.

Properly reject `using` declarations that appear directly in `switch` or `for` head scopes.

Fix some corner case issues in the recognition of `using` syntax.

## 8.15.0 (2025-06-08)

### New features

Support `using` and `await using` syntax.

The `AnyNode` type is now defined in such a way that plugins can extend it.

### Bug fixes

Fix an issue where the `bigint` property of literal nodes for non-decimal bigints had the wrong format.

The `acorn` CLI tool no longer crashes when emitting a tree that contains a bigint.

## 8.14.1 (2025-03-05)

### Bug fixes

Fix an issue where `await` expressions in class field initializers were inappropriately allowed.

Properly allow await inside an async arrow function inside a class field initializer.

Mention the source file name in syntax error messages when given.

Properly add an empty `attributes` property to every form of `ExportNamedDeclaration`.

## 8.14.0 (2024-10-27)

### New features

Support ES2025 import attributes.

Support ES2025 RegExp modifiers.

### Bug fixes

Support some missing Unicode properties.

## 8.13.0 (2024-10-16)

### New features

Upgrade to Unicode 16.0.

## 8.12.1 (2024-07-03)

### Bug fixes

Fix a regression that caused Acorn to no longer run on Node versions <8.10.

## 8.12.0 (2024-06-14)

### New features

Support ES2025 duplicate capture group names in regular expressions.

### Bug fixes

Include `VariableDeclarator` in the `AnyNode` type so that walker objects can refer to it without getting a type error.

Properly raise a parse error for invalid `for`/`of` statements using `async` as binding name.

Properly recognize \"use strict\" when preceded by a string with an escaped newline.

Mark the `Parser` constructor as protected, not private, so plugins can extend it without type errors.

Fix a bug where some invalid `delete` expressions were let through when the operand was parenthesized and `preserveParens` was enabled.

Properly normalize line endings in raw strings of invalid template tokens.

Properly track line numbers for escaped newlines in strings.

Fix a bug that broke line number accounting after a template literal with invalid escape sequences.

## 8.11.3 (2023-12-29)

### Bug fixes

Add `Function` and `Class` to the `AggregateType` type, so that they can be used in walkers without raising a type error.

Make sure `onToken` get an `import` keyword token when parsing `import.meta`.

Fix a bug where `.loc.start` could be undefined for `new.target` `meta` nodes.

## 8.11.2 (2023-10-27)

### Bug fixes

Fix a bug that caused regular expressions after colon tokens to not be properly tokenized in some circumstances.

## 8.11.1 (2023-10-26)

### Bug fixes

Fix a regression where `onToken` would receive 'name' tokens for 'new' keyword tokens.

## 8.11.0 (2023-10-26)

### Bug fixes

Fix an issue where tokenizing (without parsing) an object literal with a property named `class` or `function` could, in some circumstance, put the tokenizer into an invalid state.

Fix an issue where a slash after a call to a propery named the same as some keywords would be tokenized as a regular expression.

### New features

Upgrade to Unicode 15.1.

Use a set of new, much more precise, TypeScript types.

## 8.10.0 (2023-07-05)

### New features

Add a `checkPrivateFields` option that disables strict checking of private property use.

## 8.9.0 (2023-06-16)

### Bug fixes

Forbid dynamic import after `new`, even when part of a member expression.

### New features

Add Unicode properties for ES2023.

Add support for the `v` flag to regular expressions.

## 8.8.2 (2023-01-23)

### Bug fixes

Fix a bug that caused `allowHashBang` to be set to false when not provided, even with `ecmaVersion >= 14`.

Fix an exception when passing no option object to `parse` or `new Parser`.

Fix incorrect parse error on `if (0) let\n[astral identifier char]`.

## 8.8.1 (2022-10-24)

### Bug fixes

Make type for `Comment` compatible with estree types.

## 8.8.0 (2022-07-21)

### Bug fixes

Allow parentheses around spread args in destructuring object assignment.

Fix an issue where the tree contained `directive` properties in when parsing with a language version that doesn't support them.

### New features

Support hashbang comments by default in ECMAScript 2023 and later.

## 8.7.1 (2021-04-26)

### Bug fixes

Stop handling `"use strict"` directives in ECMAScript versions before 5.

Fix an issue where duplicate quoted export names in `export *` syntax were incorrectly checked.

Add missing type for `tokTypes`.

## 8.7.0 (2021-12-27)

### New features

Support quoted export names.

Upgrade to Unicode 14.

Add support for Unicode 13 properties in regular expressions.

### Bug fixes

Use a loop to find line breaks, because the existing regexp search would overrun the end of the searched range and waste a lot of time in minified code.

## 8.6.0 (2021-11-18)

### Bug fixes

Fix a bug where an object literal with multiple `__proto__` properties would incorrectly be accepted if a later property value held an assigment.

### New features

Support class private fields with the `in` operator.

## 8.5.0 (2021-09-06)

### Bug fixes

Improve context-dependent tokenization in a number of corner cases.

Fix location tracking after a 0x2028 or 0x2029 character in a string literal (which before did not increase the line number).

Fix an issue where arrow function bodies in for loop context would inappropriately consume `in` operators.

Fix wrong end locations stored on SequenceExpression nodes.

Implement restriction that `for`/`of` loop LHS can't start with `let`.

### New features

Add support for ES2022 class static blocks.

Allow multiple input files to be passed to the CLI tool.

## 8.4.1 (2021-06-24)

### Bug fixes

Fix a bug where `allowAwaitOutsideFunction` would allow `await` in class field initializers, and setting `ecmaVersion` to 13 or higher would allow top-level await in non-module sources.

## 8.4.0 (2021-06-11)

### New features

A new option, `allowSuperOutsideMethod`, can be used to suppress the error when `super` is used in the wrong context.

## 8.3.0 (2021-05-31)

### New features

Default `allowAwaitOutsideFunction` to true for ECMAScript 2022 an higher.

Add support for the `d` ([indices](https://github.com/tc39/proposal-regexp-match-indices)) regexp flag.

## 8.2.4 (2021-05-04)

### Bug fixes

Fix spec conformity in corner case 'for await (async of ...)'.

## 8.2.3 (2021-05-04)

### Bug fixes

Fix an issue where the library couldn't parse 'for (async of ...)'.

Fix a bug in UTF-16 decoding that would read characters incorrectly in some circumstances.

## 8.2.2 (2021-04-29)

### Bug fixes

Fix a bug where a class field initialized to an async arrow function wouldn't allow await inside it. Same issue existed for generator arrow functions with yield.

## 8.2.1 (2021-04-24)

### Bug fixes

Fix a regression introduced in 8.2.0 where static or async class methods with keyword names fail to parse.

## 8.2.0 (2021-04-24)

### New features

Add support for ES2022 class fields and private methods.

## 8.1.1 (2021-04-12)

### Various

Stop shipping source maps in the NPM package.

## 8.1.0 (2021-03-09)

### Bug fixes

Fix a spurious error in nested destructuring arrays.

### New features

Expose `allowAwaitOutsideFunction` in CLI interface.

Make `allowImportExportAnywhere` also apply to `import.meta`.

## 8.0.5 (2021-01-25)

### Bug fixes

Adjust package.json to work with Node 12.16.0 and 13.0-13.6.

## 8.0.4 (2020-10-05)

### Bug fixes

Make `await x ** y` an error, following the spec.

Fix potentially exponential regular expression.

## 8.0.3 (2020-10-02)

### Bug fixes

Fix a wasteful loop during `Parser` creation when setting `ecmaVersion` to `"latest"`.

## 8.0.2 (2020-09-30)

### Bug fixes

Make the TypeScript types reflect the current allowed values for `ecmaVersion`.

Fix another regexp/division tokenizer issue.

## 8.0.1 (2020-08-12)

### Bug fixes

Provide the correct value in the `version` export.

## 8.0.0 (2020-08-12)

### Bug fixes

Disallow expressions like `(a = b) = c`.

Make non-octal escape sequences a syntax error in strict mode.

### New features

The package can now be loaded directly as an ECMAScript module in node 13+.

Update to the set of Unicode properties from ES2021.

### Breaking changes

The `ecmaVersion` option is now required. For the moment, omitting it will still work with a warning, but that will change in a future release.

Some changes to method signatures that may be used by plugins.

## 7.4.0 (2020-08-03)

### New features

Add support for logical assignment operators.

Add support for numeric separators.

## 7.3.1 (2020-06-11)

### Bug fixes

Make the string in the `version` export match the actual library version.

## 7.3.0 (2020-06-11)

### Bug fixes

Fix a bug that caused parsing of object patterns with a property named `set` that had a default value to fail.

### New features

Add support for optional chaining (`?.`).

## 7.2.0 (2020-05-09)

### Bug fixes

Fix precedence issue in parsing of async arrow functions.

### New features

Add support for nullish coalescing.

Add support for `import.meta`.

Support `export * as ...` syntax.

Upgrade to Unicode 13.

## 6.4.1 (2020-03-09)

### Bug fixes

More carefully check for valid UTF16 surrogate pairs in regexp validator.

## 7.1.1 (2020-03-01)

### Bug fixes

Treat `\8` and `\9` as invalid escapes in template strings.

Allow unicode escapes in property names that are keywords.

Don't error on an exponential operator expression as argument to `await`.

More carefully check for valid UTF16 surrogate pairs in regexp validator.

## 7.1.0 (2019-09-24)

### Bug fixes

Disallow trailing object literal commas when ecmaVersion is less than 5.

### New features

Add a static `acorn` property to the `Parser` class that contains the entire module interface, to allow plugins to access the instance of the library that they are acting on.

## 7.0.0 (2019-08-13)

### Breaking changes

Changes the node format for dynamic imports to use the `ImportExpression` node type, as defined in [ESTree](https://github.com/estree/estree/blob/master/es2020.md#importexpression).

Makes 10 (ES2019) the default value for the `ecmaVersion` option.

## 6.3.0 (2019-08-12)

### New features

`sourceType: "module"` can now be used even when `ecmaVersion` is less than 6, to parse module-style code that otherwise conforms to an older standard.

## 6.2.1 (2019-07-21)

### Bug fixes

Fix bug causing Acorn to treat some characters as identifier characters that shouldn't be treated as such.

Fix issue where setting the `allowReserved` option to `"never"` allowed reserved words in some circumstances.

## 6.2.0 (2019-07-04)

### Bug fixes

Improve valid assignment checking in `for`/`in` and `for`/`of` loops.

Disallow binding `let` in patterns.

### New features

Support bigint syntax with `ecmaVersion` >= 11.

Support dynamic `import` syntax with `ecmaVersion` >= 11.

Upgrade to Unicode version 12.

## 6.1.1 (2019-02-27)

### Bug fixes

Fix bug that caused parsing default exports of with names to fail.

## 6.1.0 (2019-02-08)

### Bug fixes

Fix scope checking when redefining a `var` as a lexical binding.

### New features

Split up `parseSubscripts` to use an internal `parseSubscript` method to make it easier to extend with plugins.

## 6.0.7 (2019-02-04)

### Bug fixes

Check that exported bindings are defined.

Don't treat `\u180e` as a whitespace character.

Check for duplicate parameter names in methods.

Don't allow shorthand properties when they are generators or async methods.

Forbid binding `await` in async arrow function's parameter list.

## 6.0.6 (2019-01-30)

### Bug fixes

The content of class declarations and expressions is now always parsed in strict mode.

Don't allow `let` or `const` to bind the variable name `let`.

Treat class declarations as lexical.

Don't allow a generator function declaration as the sole body of an `if` or `else`.

Ignore `"use strict"` when after an empty statement.

Allow string line continuations with special line terminator characters.

Treat `for` bodies as part of the `for` scope when checking for conflicting bindings.

Fix bug with parsing `yield` in a `for` loop initializer.

Implement special cases around scope checking for functions.

## 6.0.5 (2019-01-02)

### Bug fixes

Fix TypeScript type for `Parser.extend` and add `allowAwaitOutsideFunction` to options type.

Don't treat `let` as a keyword when the next token is `{` on the next line.

Fix bug that broke checking for parentheses around an object pattern in a destructuring assignment when `preserveParens` was on.

## 6.0.4 (2018-11-05)

### Bug fixes

Further improvements to tokenizing regular expressions in corner cases.

## 6.0.3 (2018-11-04)

### Bug fixes

Fix bug in tokenizing an expression-less return followed by a function followed by a regular expression.

Remove stray symlink in the package tarball.

## 6.0.2 (2018-09-26)

### Bug fixes

Fix bug where default expressions could fail to parse inside an object destructuring assignment expression.

## 6.0.1 (2018-09-14)

### Bug fixes

Fix wrong value in `version` export.

## 6.0.0 (2018-09-14)

### Bug fixes

Better handle variable-redefinition checks for catch bindings and functions directly under if statements.

Forbid `new.target` in top-level arrow functions.

Fix issue with parsing a regexp after `yield` in some contexts.

### New features

The package now comes with TypeScript definitions.

### Breaking changes

The default value of the `ecmaVersion` option is now 9 (2018).

Plugins work differently, and will have to be rewritten to work with this version.

The loose parser and walker have been moved into separate packages (`acorn-loose` and `acorn-walk`).

## 5.7.3 (2018-09-10)

### Bug fixes

Fix failure to tokenize regexps after expressions like `x.of`.

Better error message for unterminated template literals.

## 5.7.2 (2018-08-24)

### Bug fixes

Properly handle `allowAwaitOutsideFunction` in for statements.

Treat function declarations at the top level of modules like let bindings.

Don't allow async function declarations as the only statement under a label.

## 5.7.0 (2018-06-15)

### New features

Upgraded to Unicode 11.

## 5.6.0 (2018-05-31)

### New features

Allow U+2028 and U+2029 in string when ECMAVersion >= 10.

Allow binding-less catch statements when ECMAVersion >= 10.

Add `allowAwaitOutsideFunction` option for parsing top-level `await`.

## 5.5.3 (2018-03-08)

### Bug fixes

A _second_ republish of the code in 5.5.1, this time with yarn, to hopefully get valid timestamps.

## 5.5.2 (2018-03-08)

### Bug fixes

A republish of the code in 5.5.1 in an attempt to solve an issue with the file timestamps in the npm package being 0.

## 5.5.1 (2018-03-06)

### Bug fixes

Fix misleading error message for octal escapes in template strings.

## 5.5.0 (2018-02-27)

### New features

The identifier character categorization is now based on Unicode version 10.

Acorn will now validate the content of regular expressions, including new ES9 features.

## 5.4.0 (2018-02-01)

### Bug fixes

Disallow duplicate or escaped flags on regular expressions.

Disallow octal escapes in strings in strict mode.

### New features

Add support for async iteration.

Add support for object spread and rest.

## 5.3.0 (2017-12-28)

### Bug fixes

Fix parsing of floating point literals with leading zeroes in loose mode.

Allow duplicate property names in object patterns.

Don't allow static class methods named `prototype`.

Disallow async functions directly under `if` or `else`.

Parse right-hand-side of `for`/`of` as an assignment expression.

Stricter parsing of `for`/`in`.

Don't allow unicode escapes in contextual keywords.

### New features

Parsing class members was factored into smaller methods to allow plugins to hook into it.

## 5.2.1 (2017-10-30)

### Bug fixes

Fix a token context corruption bug.

## 5.2.0 (2017-10-30)

### Bug fixes

Fix token context tracking for `class` and `function` in property-name position.

Make sure `%*` isn't parsed as a valid operator.

Allow shorthand properties `get` and `set` to be followed by default values.

Disallow `super` when not in callee or object position.

### New features

Support [`directive` property](https://github.com/estree/estree/compare/b3de58c9997504d6fba04b72f76e6dd1619ee4eb...1da8e603237144f44710360f8feb7a9977e905e0) on directive expression statements.

## 5.1.2 (2017-09-04)

### Bug fixes

Disable parsing of legacy HTML-style comments in modules.

Fix parsing of async methods whose names are keywords.

## 5.1.1 (2017-07-06)

### Bug fixes

Fix problem with disambiguating regexp and division after a class.

## 5.1.0 (2017-07-05)

### Bug fixes

Fix tokenizing of regexps in an object-desctructuring `for`/`of` loop and after `yield`.

Parse zero-prefixed numbers with non-octal digits as decimal.

Allow object/array patterns in rest parameters.

Don't error when `yield` is used as a property name.

Allow `async` as a shorthand object property.

### New features

Implement the [template literal revision proposal](https://github.com/tc39/proposal-template-literal-revision) for ES9.

## 5.0.3 (2017-04-01)

### Bug fixes

Fix spurious duplicate variable definition errors for named functions.

## 5.0.2 (2017-03-30)

### Bug fixes

A binary operator after a parenthesized arrow expression is no longer incorrectly treated as an error.

## 5.0.0 (2017-03-28)

### Bug fixes

Raise an error for duplicated lexical bindings.

Fix spurious error when an assignement expression occurred after a spread expression.

Accept regular expressions after `of` (in `for`/`of`), `yield` (in a generator), and braced arrow functions.

Allow labels in front or `var` declarations, even in strict mode.

### Breaking changes

Parse declarations following `export default` as declaration nodes, not expressions. This means that class and function declarations nodes can now have `null` as their `id`.

## 4.0.11 (2017-02-07)

### Bug fixes

Allow all forms of member expressions to be parenthesized as lvalue.

## 4.0.10 (2017-02-07)

### Bug fixes

Don't expect semicolons after default-exported functions or classes, even when they are expressions.

Check for use of `'use strict'` directives in non-simple parameter functions, even when already in strict mode.

## 4.0.9 (2017-02-06)

### Bug fixes

Fix incorrect error raised for parenthesized simple assignment targets, so that `(x) = 1` parses again.

## 4.0.8 (2017-02-03)

### Bug fixes

Solve spurious parenthesized pattern errors by temporarily erring on the side of accepting programs that our delayed errors don't handle correctly yet.

## 4.0.7 (2017-02-02)

### Bug fixes

Accept invalidly rejected code like `(x).y = 2` again.

Don't raise an error when a function _inside_ strict code has a non-simple parameter list.

## 4.0.6 (2017-02-02)

### Bug fixes

Fix exponential behavior (manifesting itself as a complete hang for even relatively small source files) introduced by the new 'use strict' check.

## 4.0.5 (2017-02-02)

### Bug fixes

Disallow parenthesized pattern expressions.

Allow keywords as export names.

Don't allow the `async` keyword to be parenthesized.

Properly raise an error when a keyword contains a character escape.

Allow `"use strict"` to appear after other string literal expressions.

Disallow labeled declarations.

## 4.0.4 (2016-12-19)

### Bug fixes

Fix crash when `export` was followed by a keyword that can't be
exported.

## 4.0.3 (2016-08-16)

### Bug fixes

Allow regular function declarations inside single-statement `if` branches in loose mode. Forbid them entirely in strict mode.

Properly parse properties named `async` in ES2017 mode.

Fix bug where reserved words were broken in ES2017 mode.

## 4.0.2 (2016-08-11)

### Bug fixes

Don't ignore period or 'e' characters after octal numbers.

Fix broken parsing for call expressions in default parameter values of arrow functions.

## 4.0.1 (2016-08-08)

### Bug fixes

Fix false positives in duplicated export name errors.

## 4.0.0 (2016-08-07)

### Breaking changes

The default `ecmaVersion` option value is now 7.

A number of internal method signatures changed, so plugins might need to be updated.

### Bug fixes

The parser now raises errors on duplicated export names.

`arguments` and `eval` can now be used in shorthand properties.

Duplicate parameter names in non-simple argument lists now always produce an error.

### New features

The `ecmaVersion` option now also accepts year-style version numbers
(2015, etc).

Support for `async`/`await` syntax when `ecmaVersion` is >= 8.

Support for trailing commas in call expressions when `ecmaVersion` is >= 8.

## 3.3.0 (2016-07-25)

### Bug fixes

Fix bug in tokenizing of regexp operator after a function declaration.

Fix parser crash when parsing an array pattern with a hole.

### New features

Implement check against complex argument lists in functions that enable strict mode in ES7.

## 3.2.0 (2016-06-07)

### Bug fixes

Improve handling of lack of unicode regexp support in host
environment.

Properly reject shorthand properties whose name is a keyword.

### New features

Visitors created with `visit.make` now have their base as _prototype_, rather than copying properties into a fresh object.

## 3.1.0 (2016-04-18)

### Bug fixes

Properly tokenize the division operator directly after a function expression.

Allow trailing comma in destructuring arrays.

## 3.0.4 (2016-02-25)

### Fixes

Allow update expressions as left-hand-side of the ES7 exponential operator.

## 3.0.2 (2016-02-10)

### Fixes

Fix bug that accidentally made `undefined` a reserved word when parsing ES7.

## 3.0.0 (2016-02-10)

### Breaking changes

The default value of the `ecmaVersion` option is now 6 (used to be 5).

Support for comprehension syntax (which was dropped from the draft spec) has been removed.

### Fixes

`let` and `yield` are now “contextual keywords”, meaning you can mostly use them as identifiers in ES5 non-strict code.

A parenthesized class or function expression after `export default` is now parsed correctly.

### New features

When `ecmaVersion` is set to 7, Acorn will parse the exponentiation operator (`**`).

The identifier character ranges are now based on Unicode 8.0.0.

Plugins can now override the `raiseRecoverable` method to override the way non-critical errors are handled.

## 2.7.0 (2016-01-04)

### Fixes

Stop allowing rest parameters in setters.

Disallow `y` rexexp flag in ES5.

Disallow `\00` and `\000` escapes in strict mode.

Raise an error when an import name is a reserved word.

## 2.6.2 (2015-11-10)

### Fixes

Don't crash when no options object is passed.

## 2.6.0 (2015-11-09)

### Fixes

Add `await` as a reserved word in module sources.

Disallow `yield` in a parameter default value for a generator.

Forbid using a comma after a rest pattern in an array destructuring.

### New features

Support parsing stdin in command-line tool.

## 2.5.0 (2015-10-27)

### Fixes

Fix tokenizer support in the command-line tool.

Stop allowing `new.target` outside of functions.

Remove legacy `guard` and `guardedHandler` properties from try nodes.

Stop allowing multiple `__proto__` properties on an object literal in strict mode.

Don't allow rest parameters to be non-identifier patterns.

Check for duplicate paramter names in arrow functions.
(xx0JMIT License

Copyright (C) 2012-2022 by various contributors (see AUTHORS)= obtaining a copy
l- 
in the Software without 4	
to use, { Software is
, K included in
t EXPRESS OR
4 
$ 
&
1 F1
LIABILITY, < FROM,
7! OTHER DEALINGS IN
THE SOFTWARE.
Yx-# Acorn

A tiny, fast JavaScript parser written in JavaScript.

## Community

Acorn is open source software released under an
[MIT license](https://github.com/acornjs/acorn/blob/master/acorn/LICENSE).

You are welcome to
[report bugs](https://github.com/acornjs/acorn/issues) or create pull
requests on [github](https://github.com/acornjs/acorn).

## Installation

The easiest way to install acorn is from [`npm`](https://www.npmjs.com/):

```sh
npm install acorn
```

Alternately, you can download the source and build acorn yourself:

```sh
git clone https://github.com/acornjs/acorn.git
cd acorn
npm install
```
## Importing acorn

ESM as well as CommonJS is supported for all 3: `acorn`, `acorn-walk` and `acorn-loose`.

ESM example for `acorn`:

```js
import * as acorn from "acorn"
```

CommonJS example for `acorn`:

```js
let acorn = require("acorn")
```

ESM is preferred, as it allows better editor auto-completions by offering TypeScript support.
For this reason, following examples will use ESM imports.

## Interface

**parse**`(input, options)` is the main interface to the library. The
`input` parameter is a string, `options` must be an object setting
some of the options listed below. The return value will be an abstract
syntax tree object as specified by the [ESTree
spec](https://github.com/estree/estree).

```javascript
import * as acorn from "acorn"
console.log(acorn.parse("1 + 1", {ecmaVersion: 2020}))
```

When encountering a syntax error, the parser will raise a
`SyntaxError` object with a meaningful message. The error object will
have a `pos` property that indicates the string offset at which the
error occurred, and a `loc` object that contains a `{line, column}`
object referring to that same position.

Options are provided by in a second argument, which should be an
object containing any of these fields (only `ecmaVersion` is
required):

- **ecmaVersion**: Indicates the ECMAScript version to parse. Can be a
  number, either in year (`2022`) or plain version number (`6`) form,
  or `"latest"` (the latest the library supports). This influences
  support for strict mode, the set of reserved words, and support for
  new syntax features.

  **NOTE**: Only 'stage 4' (finalized) ECMAScript features are being
  implemented by Acorn. Other proposed new features must be
  implemented through plugins.

- **sourceType**: Indicate the mode the code should be parsed in. Can be
  either `"script"`, `"module"` or `"commonjs"`. This influences global strict mode
  and parsing of `import` and `export` declarations.

  **NOTE**: If set to `"module"`, then static `import` / `export` syntax
  will be valid, even if `ecmaVersion` is less than 6. If set to `"commonjs"`,
  it is the same as `"script"` except that the top-level scope behaves like a function.

- **strict**: When set to true, enable strict parsing mode even if
  `sourceType` is `"script"`.

- **onInsertedSemicolon**: If given a callback, that callback will be
  called whenever a missing semicolon is inserted by the parser. The
  callback will be given the character offset of the point where the
  semicolon is inserted as argument, and if `locations` is on, also a
  `{line, column}` object representing this position.

- **onTrailingComma**: Like `onInsertedSemicolon`, but for trailing
  commas.

- **allowReserved**: If `false`, using a reserved word will generate
  an error. Defaults to `true` for `ecmaVersion` 3, `false` for higher
  versions. When given the value `"never"`, reserved words and
  keywords can also not be used as property names (as in Internet
  Explorer's old parser).

- **allowReturnOutsideFunction**: By default, a return statement at
  the top level raises an error. Set this to `true` to accept such
  code.

- **allowImportExportEverywhere**: By default, `import` and `export`
  declarations can only appear at a program's top level. Setting this
  option to `true` allows them anywhere where a statement is allowed,
  and also allows `import.meta` expressions to appear in scripts
  (when `sourceType` is not `"module"`).

- **allowAwaitOutsideFunction**: If `false`, `await` expressions can
  only appear inside `async` functions. Defaults to `true` in modules
  for `ecmaVersion` 2022 and later, `false` for lower versions.
  Setting this option to `true` allows to have top-level `await`
  expressions. They are still not allowed in non-`async` functions,
  though. Setting this option to `true` is not allowed when `sourceType: "commonjs"`.

- **allowSuperOutsideMethod**: By default, `super` outside a method
  raises an error. Set this to `true` to accept such code.

- **allowHashBang**: When this is enabled, if the code starts with the
  characters `#!` (as in a shellscript), the first line will be
  treated as a comment. Defaults to true when `ecmaVersion` >= 2023.

- **checkPrivateFields**: By default, the parser will verify that
  private properties are only used in places where they are valid and
  have been declared. Set this to false to turn such checks off.

- **locations**: When `true`, each node has a `loc` object attached
  with `start` and `end` subobjects, each of which contains the
  one-based line and zero-based column numbers in `{line, column}`
  form. Default is `false`.

- **startLocation**: An optional `{line, column}` object to use for
  the start of the parse. This is mostly useful when using
  `parseExpressionAt` with `locations: true`, to prevent the parser
  from having to determine the line position at the start position.

- **onToken**: If a function is passed for this option, each found
  token will be passed in same format as tokens returned from
  `tokenizer().getToken()`.

  If array is passed, each found token is pushed to it.

  Note that you are not allowed to call the parser from the
  callback—that will corrupt its internal state.

- **onComment**: If a function is passed for this option, whenever a
  comment is encountered the function will be called with the
  following parameters:

  - `block`: `true` if the comment is a block comment, false if it
    is a line comment.
  - `text`: The content of the comment.
  - `start`: Character offset of the start of the comment.
  - `end`: Character offset of the end of the comment.

  When the `locations` options is on, the `{line, column}` locations
  of the comment’s start and end are passed as two additional
  parameters.

  If array is passed for this option, each found comment is pushed
  to it as object in Esprima format:

  ```javascript
  {
    "type": "Line" | "Block",
    "value": "comment text",
    "start": Number,
    "end": Number,
    // If `locations` option is on:
    "loc": {
      "start": {line: Number, column: Number}
      "end": {line: Number, column: Number}
    },
    // If `ranges` option is on:
    "range": [Number, Number]
  }
  ```

  Note that you are not allowed to call the parser from the
  callback—that will corrupt its internal state.

- **ranges**: Nodes have their start and end characters offsets
  recorded in `start` and `end` properties (directly on the node,
  rather than the `loc` object, which holds line/column data. To also
  add a
  [semi-standardized](https://bugzilla.mozilla.org/show_bug.cgi?id=745678)
  `range` property holding a `[start, end]` array with the same
  numbers, set the `ranges` option to `true`.

- **program**: It is possible to parse multiple files into a single
  AST by passing the tree produced by parsing the first file as the
  `program` option in subsequent parses. This will add the toplevel
  forms of the parsed file to the "Program" (top) node of an existing
  parse tree.

- **sourceFile**: When the `locations` option is `true`, you can pass
  this option to add a `source` attribute in every node’s `loc`
  object. Note that the contents of this option are not examined or
  processed in any way; you are free to use whatever format you
  choose.

- **directSourceFile**: Like `sourceFile`, but a `sourceFile` property
  will be added (regardless of the `location` option) directly to the
  nodes, rather than the `loc` object.

- **preserveParens**: If this option is `true`, parenthesized expressions
  are represented by (non-standard) `ParenthesizedExpression` nodes
  that have a single `expression` property containing the expression
  inside parentheses.

**parseExpressionAt**`(input, offset, options)` will parse a single
expression in a string, and return its AST. It will not complain if
there is more of the string left after the expression.

**tokenizer**`(input, options)` returns an object with a `getToken`
method that can be called repeatedly to get the next token, a `{start,
end, type, value}` object (with added `loc` property when the
`locations` option is enabled and `range` property when the `ranges`
option is enabled). When the token's type is `tokTypes.eof`, you
should stop calling the method, since it will keep returning that same
token forever.

Note that tokenizing JavaScript without parsing it is, in modern
versions of the language, not really possible due to the way syntax is
overloaded in ways that can only be disambiguated by the parse
context. This package applies a bunch of heuristics to try and do a
reasonable job, but you are advised to use `parse` with the `onToken`
option instead of this.

In ES6 environment, returned result can be used as any other
protocol-compliant iterable:

```javascript
for (let token of acorn.tokenizer(str)) {
  // iterate over the tokens
}

// transform code to array of tokens:
var tokens = [...acorn.tokenizer(str)]
```

**tokTypes** holds an object mapping names to the token type objects
that end up in the `type` properties of tokens.

**getLineInfo**`(input, offset)` can be used to get a `{line,
column}` object for a given program string and offset.

### The `Parser` class

Instances of the **`Parser`** class contain all the state and logic
that drives a parse. It has static methods `parse`,
`parseExpressionAt`, and `tokenizer` that match the top-level
functions by the same name.

When extending the parser with plugins, you need to call these methods
on the extended version of the class. To extend a parser with plugins,
you can use its static `extend` method.

```javascript
var acorn = require("acorn")
var jsx = require("acorn-jsx")
var JSXParser = acorn.Parser.extend(jsx())
JSXParser.parse("foo(<bar/>)", {ecmaVersion: 2020})
```

The `extend` method takes any number of plugin values, and returns a
new `Parser` class that includes the extra parser logic provided by
the plugins.

## Command line interface

The `bin/acorn` utility can be used to parse a file from the command
line. It accepts as arguments its input file and the following
options:

- `--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|--ecma10`: Sets the ECMAScript version
  to parse. Default is version 9.

- `--module`: Sets the parsing mode to `"module"`. Is set to `"script"` otherwise.

- `--locations`: Attaches a "loc" object to each node with "start" and
  "end" subobjects, each of which contains the one-based line and
  zero-based column numbers in `{line, column}` form.

- `--allow-hash-bang`: If the code starts with the characters #! (as
  in a shellscript), the first line will be treated as a comment.

- `--allow-await-outside-function`: Allows top-level `await` expressions.
  See the `allowAwaitOutsideFunction` option for more information.

- `--compact`: No whitespace is used in the AST output.

- `--silent`: Do not output the AST, just return the exit status.

- `--help`: Print the usage information and quit.

The utility spits out the syntax tree as JSON data.

## Existing plugins

 - [`acorn-jsx`](https://github.com/RReverser/acorn-jsx): Parse [Facebook JSX syntax extensions](https://github.com/facebook/jsx)
kx! 100644 acorn >$'0FLɵx< #!/usr/bin/env node
"use strict"

require("../dist/bin.js")
U*x G100644 acorn.d.mts 8KR)`t100644 acorn.d.ts 8KR)`t100644 acorn.js ʔQlqo"݅=R5~100644 acorn.mjs ?Oߘ)w100644 bin.js ٹ1B;D;u:mM
xWAexport interface Node {
  start: number
  end: number
  type: string
  range?: [number, number]
  loc?: SourceLocation | null
}

export interface SourceLocation {
  source?: string | null
  start: Position
  end: Position
}

export interface Position {
  /** 1-based */
  line: number
  /** 0-based */
  column: number
}

export interface Identifier extends Node {
  type: "Identifier"
  name: string
}

export interface Literal extends Node {
  type: "Literal"
  value?: string | boolean | null | number | RegExp | bigint
  raw?: string
  regex?: {
    pattern: string
    flags: string
  }
  bigint?: string
}

export interface Program extends Node {
  type: "Program"
  body: Array<Statement | ModuleDeclaration>
  sourceType: "script" | "module"
}

export interface Function extends Node {
  id?: Identifier | null
  params: Array<Pattern>
  body: BlockStatement | Expression
  generator: boolean
  expression: boolean
  async: boolean
}

export interface ExpressionStatement extends Node {
  type: "ExpressionStatement"
  expression: Expression | Literal
  directive?: string
}

export interface BlockStatement extends Node {
  type: "BlockStatement"
  body: Array<Statement>
}

export interface EmptyStatement extends Node {
  type: "EmptyStatement"
}

export interface DebuggerStatement extends Node {
  type: "DebuggerStatement"
}

export interface WithStatement extends Node {
  type: "WithStatement"
  object: Expression
  body: Statement
}

export interface ReturnStatement extends Node {
  type: "ReturnStatement"
  argument?: Expression | null
}

export interface LabeledStatement extends Node {
  type: "LabeledStatement"
  label: Identifier
  body: Statement
}

export interface BreakStatement extends Node {
  type: "BreakStatement"
  label?: Identifier | null
}

export interface ContinueStatement extends Node {
  type: "ContinueStatement"
  label?: Identifier | null
}

export interface IfStatement extends Node {
  type: "IfStatement"
  test: Expression
  consequent: Statement
  alternate?: Statement | null
}

export interface SwitchStatement extends Node {
  type: "SwitchStatement"
  discriminant: Expression
  cases: Array<SwitchCase>
}

export interface SwitchCase extends Node {
  type: "SwitchCase"
  test?: Expression | null
  consequent: Array<Statement>
}

export interface ThrowStatement extends Node {
  type: "ThrowStatement"
  argument: Expression
}

export interface TryStatement extends Node {
  type: "TryStatement"
  block: BlockStatement
  handler?: CatchClause | null
  finalizer?: BlockStatement | null
}

export interface CatchClause extends Node {
  type: "CatchClause"
  param?: Pattern | null
  body: BlockStatement
}

export interface WhileStatement extends Node {
  type: "WhileStatement"
  test: Expression
  body: Statement
}

export interface DoWhileStatement extends Node {
  type: "DoWhileStatement"
  body: Statement
  test: Expression
}

export interface ForStatement extends Node {
  type: "ForStatement"
  init?: VariableDeclaration | Expression | null
  test?: Expression | null
  update?: Expression | null
  body: Statement
}

export interface ForInStatement extends Node {
  type: "ForInStatement"
  left: VariableDeclaration | Pattern
  right: Expression
  body: Statement
}

export interface FunctionDeclaration extends Function {
  type: "FunctionDeclaration"
  id: Identifier
  body: BlockStatement
}

export interface VariableDeclaration extends Node {
  type: "VariableDeclaration"
  declarations: Array<VariableDeclarator>
  kind: "var" | "let" | "const" | "using" | "await using"
}

export interface VariableDeclarator extends Node {
  type: "VariableDeclarator"
  id: Pattern
  init?: Expression | null
}

export interface ThisExpression extends Node {
  type: "ThisExpression"
}

export interface ArrayExpression extends Node {
  type: "ArrayExpression"
  elements: Array<Expression | SpreadElement | null>
}

export interface ObjectExpression extends Node {
  type: "ObjectExpression"
  properties: Array<Property | SpreadElement>
}

export interface Property extends Node {
  type: "Property"
  key: Expression
  value: Expression
  kind: "init" | "get" | "set"
  method: boolean
  shorthand: boolean
  computed: boolean
}

export interface FunctionExpression extends Function {
  type: "FunctionExpression"
  body: BlockStatement
}

export interface UnaryExpression extends Node {
  type: "UnaryExpression"
  operator: UnaryOperator
  prefix: boolean
  argument: Expression
}

export type UnaryOperator = "-" | "+" | "!" | "~" | "typeof" | "void" | "delete"

export interface UpdateExpression extends Node {
  type: "UpdateExpression"
  operator: UpdateOperator
  argument: Expression
  prefix: boolean
}

export type UpdateOperator = "++" | "--"

export interface BinaryExpression extends Node {
  type: "BinaryExpression"
  operator: BinaryOperator
  left: Expression | PrivateIdentifier
  right: Expression
}

export type BinaryOperator = "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "|" | "^" | "&" | "in" | "instanceof" | "**"

export interface AssignmentExpression extends Node {
  type: "AssignmentExpression"
  operator: AssignmentOperator
  left: Pattern
  right: Expression
}

export type AssignmentOperator = "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "**=" | "||=" | "&&=" | "??="

export interface LogicalExpression extends Node {
  type: "LogicalExpression"
  operator: LogicalOperator
  left: Expression
  right: Expression
}

export type LogicalOperator = "||" | "&&" | "??"

export interface MemberExpression extends Node {
  type: "MemberExpression"
  object: Expression | Super
  property: Expression | PrivateIdentifier
  computed: boolean
  optional: boolean
}

export interface ConditionalExpression extends Node {
  type: "ConditionalExpression"
  test: Expression
  alternate: Expression
  consequent: Expression
}

export interface CallExpression extends Node {
  type: "CallExpression"
  callee: Expression | Super
  arguments: Array<Expression | SpreadElement>
  optional: boolean
}

export interface NewExpression extends Node {
  type: "NewExpression"
  callee: Expression
  arguments: Array<Expression | SpreadElement>
}

export interface SequenceExpression extends Node {
  type: "SequenceExpression"
  expressions: Array<Expression>
}

export interface ForOfStatement extends Node {
  type: "ForOfStatement"
  left: VariableDeclaration | Pattern
  right: Expression
  body: Statement
  await: boolean
}

export interface Super extends Node {
  type: "Super"
}

export interface SpreadElement extends Node {
  type: "SpreadElement"
  argument: Expression
}

export interface ArrowFunctionExpression extends Function {
  type: "ArrowFunctionExpression"
}

export interface YieldExpression extends Node {
  type: "YieldExpression"
  argument?: Expression | null
  delegate: boolean
}

export interface TemplateLiteral extends Node {
  type: "TemplateLiteral"
  quasis: Array<TemplateElement>
  expressions: Array<Expression>
}

export interface TaggedTemplateExpression extends Node {
  type: "TaggedTemplateExpression"
  tag: Expression
  quasi: TemplateLiteral
}

export interface TemplateElement extends Node {
  type: "TemplateElement"
  tail: boolean
  value: {
    cooked?: string | null
    raw: string
  }
}

export interface AssignmentProperty extends Node {
  type: "Property"
  key: Expression
  value: Pattern
  kind: "init"
  method: false
  shorthand: boolean
  computed: boolean
}

export interface ObjectPattern extends Node {
  type: "ObjectPattern"
  properties: Array<AssignmentProperty | RestElement>
}

export interface ArrayPattern extends Node {
  type: "ArrayPattern"
  elements: Array<Pattern | null>
}

export interface RestElement extends Node {
  type: "RestElement"
  argument: Pattern
}

export interface AssignmentPattern extends Node {
  type: "AssignmentPattern"
  left: Pattern
  right: Expression
}

export interface Class extends Node {
  id?: Identifier | null
  superClass?: Expression | null
  body: ClassBody
}

export interface ClassBody extends Node {
  type: "ClassBody"
  body: Array<MethodDefinition | PropertyDefinition | StaticBlock>
}

export interface MethodDefinition extends Node {
  type: "MethodDefinition"
  key: Expression | PrivateIdentifier
  value: FunctionExpression
  kind: "constructor" | "method" | "get" | "set"
  computed: boolean
  static: boolean
}

export interface ClassDeclaration extends Class {
  type: "ClassDeclaration"
  id: Identifier
}

export interface ClassExpression extends Class {
  type: "ClassExpression"
}

export interface MetaProperty extends Node {
  type: "MetaProperty"
  meta: Identifier
  property: Identifier
}

export interface ImportDeclaration extends Node {
  type: "ImportDeclaration"
  specifiers: Array<ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier>
  source: Literal
  attributes: Array<ImportAttribute>
}

export interface ImportSpecifier extends Node {
  type: "ImportSpecifier"
  imported: Identifier | Literal
  local: Identifier
}

export interface ImportDefaultSpecifier extends Node {
  type: "ImportDefaultSpecifier"
  local: Identifier
}

export interface ImportNamespaceSpecifier extends Node {
  type: "ImportNamespaceSpecifier"
  local: Identifier
}

export interface ImportAttribute extends Node {
  type: "ImportAttribute"
  key: Identifier | Literal
  value: Literal
}

export interface ExportNamedDeclaration extends Node {
  type: "ExportNamedDeclaration"
  declaration?: Declaration | null
  specifiers: Array<ExportSpecifier>
  source?: Literal | null
  attributes: Array<ImportAttribute>
}

export interface ExportSpecifier extends Node {
  type: "ExportSpecifier"
  exported: Identifier | Literal
  local: Identifier | Literal
}

export interface AnonymousFunctionDeclaration extends Function {
  type: "FunctionDeclaration"
  id: null
  body: BlockStatement
}

export interface AnonymousClassDeclaration extends Class {
  type: "ClassDeclaration"
  id: null
}

export interface ExportDefaultDeclaration extends Node {
  type: "ExportDefaultDeclaration"
  declaration: AnonymousFunctionDeclaration | FunctionDeclaration | AnonymousClassDeclaration | ClassDeclaration | Expression
}

export interface ExportAllDeclaration extends Node {
  type: "ExportAllDeclaration"
  source: Literal
  exported?: Identifier | Literal | null
  attributes: Array<ImportAttribute>
}

export interface AwaitExpression extends Node {
  type: "AwaitExpression"
  argument: Expression
}

export interface ChainExpression extends Node {
  type: "ChainExpression"
  expression: MemberExpression | CallExpression
}

export interface ImportExpression extends Node {
  type: "ImportExpression"
  source: Expression
  options: Expression | null
}

export interface ParenthesizedExpression extends Node {
  type: "ParenthesizedExpression"
  expression: Expression
}

export interface PropertyDefinition extends Node {
  type: "PropertyDefinition"
  key: Expression | PrivateIdentifier
  value?: Expression | null
  computed: boolean
  static: boolean
}

export interface PrivateIdentifier extends Node {
  type: "PrivateIdentifier"
  name: string
}

export interface StaticBlock extends Node {
  type: "StaticBlock"
  body: Array<Statement>
}

export type Statement = 
| ExpressionStatement
| BlockStatement
| EmptyStatement
| DebuggerStatement
| WithStatement
| ReturnStatement
| LabeledStatement
| BreakStatement
| ContinueStatement
| IfStatement
| SwitchStatement
| ThrowStatement
| TryStatement
| WhileStatement
| DoWhileStatement
| ForStatement
| ForInStatement
| ForOfStatement
| Declaration

export type Declaration = 
| FunctionDeclaration
| VariableDeclaration
| ClassDeclaration

export type Expression = 
| Identifier
| Literal
| ThisExpression
| ArrayExpression
| ObjectExpression
| FunctionExpression
| UnaryExpression
| UpdateExpression
| BinaryExpression
| AssignmentExpression
| LogicalExpression
| MemberExpression
| ConditionalExpression
| CallExpression
| NewExpression
| SequenceExpression
| ArrowFunctionExpression
| YieldExpression
| TemplateLiteral
| TaggedTemplateExpression
| ClassExpression
| MetaProperty
| AwaitExpression
| ChainExpression
| ImportExpression
| ParenthesizedExpression

export type Pattern = 
| Identifier
| MemberExpression
| ObjectPattern
| ArrayPattern
| RestElement
| AssignmentPattern

export type ModuleDeclaration = 
| ImportDeclaration
| ExportNamedDeclaration
| ExportDefaultDeclaration
| ExportAllDeclaration

/**
  * This interface is only used for defining {@link AnyNode}.
  * It exists so that it can be extended by plugins:
  *
  * @example
  * ```typescript
  * declare module 'acorn' {
  *   interface NodeTypes {
  *     pluginName: FirstNode | SecondNode | ThirdNode | ... | LastNode
  *   }
  * }
  * ```
  */
interface NodeTypes {
  core: Statement | Expression | Declaration | ModuleDeclaration | Literal | Program | SwitchCase | CatchClause | Property | Super | SpreadElement | TemplateElement | AssignmentProperty | ObjectPattern | ArrayPattern | RestElement | AssignmentPattern | ClassBody | MethodDefinition | MetaProperty | ImportAttribute | ImportSpecifier | ImportDefaultSpecifier | ImportNamespaceSpecifier | ExportSpecifier | AnonymousFunctionDeclaration | AnonymousClassDeclaration | PropertyDefinition | PrivateIdentifier | StaticBlock | VariableDeclarator
}

export type AnyNode = NodeTypes[keyof NodeTypes]

export function parse(input: string, options: Options): Program

export function parseExpressionAt(input: string, pos: number, options: Options): Expression

export function tokenizer(input: string, options: Options): {
  getToken(): Token
  [Symbol.iterator](): Iterator<Token>
}

export type ecmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | 2026 | "latest"

export interface Options {
  /**
   * `ecmaVersion` indicates the ECMAScript version to parse. Can be a
   * number, either in year (`2022`) or plain version number (`6`) form,
   * or `"latest"` (the latest the library supports). This influences
   * support for strict mode, the set of reserved words, and support for
   * new syntax features.
   */
  ecmaVersion: ecmaVersion

  /**
   * `sourceType` indicates the mode the code should be parsed in.
   * Can be either `"script"`, `"module"` or `"commonjs"`. This influences global
   * strict mode and parsing of `import` and `export` declarations.
   */
  sourceType?: "script" | "module" | "commonjs"

  /**
   * When set to true, enable strict parsing mode even if `sourceType`
   * is `"script"`.
   */
  strict?: boolean

  /**
   * a callback that will be called when a semicolon is automatically inserted.
   * @param lastTokEnd the position of the comma as an offset
   * @param lastTokEndLoc location if {@link locations} is enabled
   */
  onInsertedSemicolon?: (lastTokEnd: number, lastTokEndLoc?: Position) => void

  /**
   * similar to `onInsertedSemicolon`, but for trailing commas
   * @param lastTokEnd the position of the comma as an offset
   * @param lastTokEndLoc location if `locations` is enabled
   */
  onTrailingComma?: (lastTokEnd: number, lastTokEndLoc?: Position) => void

  /**
   * By default, reserved words are only enforced if ecmaVersion >= 5.
   * Set `allowReserved` to a boolean value to explicitly turn this on
   * an off. When this option has the value "never", reserved words
   * and keywords can also not be used as property names.
   */
  allowReserved?: boolean | "never"

  /** 
   * When enabled, a return at the top level is not considered an error.
   */
  allowReturnOutsideFunction?: boolean

  /**
   * When enabled, import/export statements are not constrained to
   * appearing at the top of the program, and an import.meta expression
   * in a script isn't considered an error.
   */
  allowImportExportEverywhere?: boolean

  /**
   * By default, `await` identifiers are allowed to appear at the top-level scope only if {@link ecmaVersion} >= 2022.
   * When enabled, await identifiers are allowed to appear at the top-level scope,
   * but they are still not allowed in non-async functions.
   */
  allowAwaitOutsideFunction?: boolean

  /**
   * When enabled, super identifiers are not constrained to
   * appearing in methods and do not raise an error when they appear elsewhere.
   */
  allowSuperOutsideMethod?: boolean

  /**
   * When enabled, hashbang directive in the beginning of file is
   * allowed and treated as a line comment. Enabled by default when
   * {@link ecmaVersion} >= 2023.
   */
  allowHashBang?: boolean

  /**
   * By default, the parser will verify that private properties are
   * only used in places where they are valid and have been declared.
   * Set this to false to turn such checks off.
   */
  checkPrivateFields?: boolean

  /**
   * When `locations` is on, `loc` properties holding objects with
   * `start` and `end` properties as {@link Position} objects will be attached to the
   * nodes.
   */
  locations?: boolean

  /**
   * Pass an optional `{line, column}` object to use for the start of
   * the parse. This is mostly useful when using `parseExpressionAt`
   * with `locations: true`, to prevent the parser from having to
   * determine the line position at the start position.
   */
  startLocation?: {line: number, column: number}

  /**
   * a callback that will cause Acorn to call that export function with object in the same
   * format as tokens returned from `tokenizer().getToken()`. Note
   * that you are not allowed to call the parser from the
   * callback—that will corrupt its internal state.
   */
  onToken?: ((token: Token) => void) | Token[]


  /**
   * This takes a export function or an array.
   * 
   * When a export function is passed, Acorn will call that export function with `(block, text, start,
   * end)` parameters whenever a comment is skipped. `block` is a
   * boolean indicating whether this is a block (`/* *\/`) comment,
   * `text` is the content of the comment, and `start` and `end` are
   * character offsets that denote the start and end of the comment.
   * When the {@link locations} option is on, two more parameters are
   * passed, the full locations of {@link Position} export type of the start and
   * end of the comments.
   * 
   * When a array is passed, each found comment of {@link Comment} export type is pushed to the array.
   * 
   * Note that you are not allowed to call the
   * parser from the callback—that will corrupt its internal state.
   */
  onComment?: ((
    isBlock: boolean, text: string, start: number, end: number, startLoc?: Position,
    endLoc?: Position
  ) => void) | Comment[]

  /**
   * Nodes have their start and end characters offsets recorded in
   * `start` and `end` properties (directly on the node, rather than
   * the `loc` object, which holds line/column data. To also add a
   * [semi-standardized][range] `range` property holding a `[start,
   * end]` array with the same numbers, set the `ranges` option to
   * `true`.
   */
  ranges?: boolean

  /**
   * It is possible to parse multiple files into a single AST by
   * passing the tree produced by parsing the first file as
   * `program` option in subsequent parses. This will add the
   * toplevel forms of the parsed file to the `Program` (top) node
   * of an existing parse tree.
   */
  program?: Node

  /**
   * When {@link locations} is on, you can pass this to record the source
   * file in every node's `loc` object.
   */
  sourceFile?: string

  /**
   * This value, if given, is stored in every node, whether {@link locations} is on or off.
   */
  directSourceFile?: string

  /**
   * When enabled, parenthesized expressions are represented by
   * (non-standard) ParenthesizedExpression nodes
   */
  preserveParens?: boolean
}
  
export class Parser {
  options: Options
  input: string
  
  protected constructor(options: Options, input: string, startPos?: number)
  parse(): Program
  
  static parse(input: string, options: Options): Program
  static parseExpressionAt(input: string, pos: number, options: Options): Expression
  static tokenizer(input: string, options: Options): {
    getToken(): Token
    [Symbol.iterator](): Iterator<Token>
  }
  static extend(...plugins: ((BaseParser: typeof Parser) => typeof Parser)[]): typeof Parser
}

export const defaultOptions: Options

export function getLineInfo(input: string, offset: number): Position

export class TokenType {
  label: string
  keyword: string | undefined
}

export const tokTypes: {
  num: TokenType
  regexp: TokenType
  string: TokenType
  name: TokenType
  privateId: TokenType
  eof: TokenType

  bracketL: TokenType
  bracketR: TokenType
  braceL: TokenType
  braceR: TokenType
  parenL: TokenType
  parenR: TokenType
  comma: TokenType
  semi: TokenType
  colon: TokenType
  dot: TokenType
  question: TokenType
  questionDot: TokenType
  arrow: TokenType
  template: TokenType
  invalidTemplate: TokenType
  ellipsis: TokenType
  backQuote: TokenType
  dollarBraceL: TokenType

  eq: TokenType
  assign: TokenType
  incDec: TokenType
  prefix: TokenType
  logicalOR: TokenType
  logicalAND: TokenType
  bitwiseOR: TokenType
  bitwiseXOR: TokenType
  bitwiseAND: TokenType
  equality: TokenType
  relational: TokenType
  bitShift: TokenType
  plusMin: TokenType
  modulo: TokenType
  star: TokenType
  slash: TokenType
  starstar: TokenType
  coalesce: TokenType

  _break: TokenType
  _case: TokenType
  _catch: TokenType
  _continue: TokenType
  _debugger: TokenType
  _default: TokenType
  _do: TokenType
  _else: TokenType
  _finally: TokenType
  _for: TokenType
  _function: TokenType
  _if: TokenType
  _return: TokenType
  _switch: TokenType
  _throw: TokenType
  _try: TokenType
  _var: TokenType
  _const: TokenType
  _while: TokenType
  _with: TokenType
  _new: TokenType
  _this: TokenType
  _super: TokenType
  _class: TokenType
  _extends: TokenType
  _export: TokenType
  _import: TokenType
  _null: TokenType
  _true: TokenType
  _false: TokenType
  _in: TokenType
  _instanceof: TokenType
  _typeof: TokenType
  _void: TokenType
  _delete: TokenType
}

export interface Comment {
  type: "Line" | "Block"
  value: string
  start: number
  end: number
  loc?: SourceLocation
  range?: [number, number]
}

export class Token {
  type: TokenType
  start: number
  end: number
  loc?: SourceLocation
  range?: [number, number]
}

export const version: string
f.ްwx   (function (global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
  typeof define === 'function' && define.amd ? define(['exports'], factory) :
  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.acorn = {}));
})(this, (function (exports) { 'use strict';

  // This file was generated. Do not modify manually!
  var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 78, 5, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 199, 7, 137, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 55, 9, 266, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 233, 0, 3, 0, 8, 1, 6, 0, 475, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];

  // This file was generated. Do not modify manually!
  var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 7, 25, 39, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 5, 57, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 24, 43, 261, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 33, 24, 3, 24, 45, 74, 6, 0, 67, 12, 65, 1, 2, 0, 15, 4, 10, 7381, 42, 31, 98, 114, 8702, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 208, 30, 2, 2, 2, 1, 2, 6, 3, 4, 10, 1, 225, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4381, 3, 5773, 3, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 8489];

  // This file was generated. Do not modify manually!
  var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0897-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1add\u1ae0-\u1aeb\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\u30fb\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f\uff65";

  // This file was generated. Do not modify manually!
  var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088f\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5c\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdc-\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c8a\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7dc\ua7f1-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";

  // These are a run-length and offset encoded representation of the
  // >0xffff code points that are a valid part of identifiers. The
  // offset starts at 0x10000, and each pair of numbers represents an
  // offset to the next range, and then a size of the range.

  // Reserved word lists for various dialects of the language

  var reservedWords = {
    3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
    5: "class enum extends super const export import",
    6: "enum",
    strict: "implements interface let package private protected public static yield",
    strictBind: "eval arguments"
  };

  // And the keywords

  var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this";

  var keywords$1 = {
    5: ecma5AndLessKeywords,
    "5module": ecma5AndLessKeywords + " export import",
    6: ecma5AndLessKeywords + " const class extends export import super"
  };

  var keywordRelationalOperator = /^in(stanceof)?$/;

  // ## Character categories

  var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
  var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");

  // This has a complexity linear to the value of the code. The
  // assumption is that looking up astral identifier characters is
  // rare.
  function isInAstralSet(code, set) {
    var pos = 0x10000;
    for (var i = 0; i < set.length; i += 2) {
      pos += set[i];
      if (pos > code) { return false }
      pos += set[i + 1];
      if (pos >= code) { return true }
    }
    return false
  }

  // Test whether a given character code starts an identifier.

  function isIdentifierStart(code, astral) {
    if (code < 65) { return code === 36 }
    if (code < 91) { return true }
    if (code < 97) { return code === 95 }
    if (code < 123) { return true }
    if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) }
    if (astral === false) { return false }
    return isInAstralSet(code, astralIdentifierStartCodes)
  }

  // Test whether a given character is part of an identifier.

  function isIdentifierChar(code, astral) {
    if (code < 48) { return code === 36 }
    if (code < 58) { return true }
    if (code < 65) { return false }
    if (code < 91) { return true }
    if (code < 97) { return code === 95 }
    if (code < 123) { return true }
    if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }
    if (astral === false) { return false }
    return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)
  }

  // ## Token types

  // The assignment of fine-grained, information-carrying type objects
  // allows the tokenizer to store the information it has about a
  // token in a way that is very cheap for the parser to look up.

  // All token type variables start with an underscore, to make them
  // easy to recognize.

  // The `beforeExpr` property is used to disambiguate between regular
  // expressions and divisions. It is set on all token types that can
  // be followed by an expression (thus, a slash after them would be a
  // regular expression).
  //
  // The `startsExpr` property is used to check if the token ends a
  // `yield` expression. It is set on all token types that either can
  // directly start an expression (like a quotation mark) or can
  // continue an expression (like the body of a string).
  //
  // `isLoop` marks a keyword as starting a loop, which is important
  // to know when parsing a label, in order to allow or disallow
  // continue jumps to that label.

  var TokenType = function TokenType(label, conf) {
    if ( conf === void 0 ) conf = {};

    this.label = label;
    this.keyword = conf.keyword;
    this.beforeExpr = !!conf.beforeExpr;
    this.startsExpr = !!conf.startsExpr;
    this.isLoop = !!conf.isLoop;
    this.isAssign = !!conf.isAssign;
    this.prefix = !!conf.prefix;
    this.postfix = !!conf.postfix;
    this.binop = conf.binop || null;
    this.updateContext = null;
  };

  function binop(name, prec) {
    return new TokenType(name, {beforeExpr: true, binop: prec})
  }
  var beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true};

  // Map keyword names to token types.

  var keywords = {};

  // Succinct definitions of keyword token types
  function kw(name, options) {
    if ( options === void 0 ) options = {};

    options.keyword = name;
    return keywords[name] = new TokenType(name, options)
  }

  var types$1 = {
    num: new TokenType("num", startsExpr),
    regexp: new TokenType("regexp", startsExpr),
    string: new TokenType("string", startsExpr),
    name: new TokenType("name", startsExpr),
    privateId: new TokenType("privateId", startsExpr),
    eof: new TokenType("eof"),

    // Punctuation token types.
    bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}),
    bracketR: new TokenType("]"),
    braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}),
    braceR: new TokenType("}"),
    parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}),
    parenR: new TokenType(")"),
    comma: new TokenType(",", beforeExpr),
    semi: new TokenType(";", beforeExpr),
    colon: new TokenType(":", beforeExpr),
    dot: new TokenType("."),
    question: new TokenType("?", beforeExpr),
    questionDot: new TokenType("?."),
    arrow: new TokenType("=>", beforeExpr),
    template: new TokenType("template"),
    invalidTemplate: new TokenType("invalidTemplate"),
    ellipsis: new TokenType("...", beforeExpr),
    backQuote: new TokenType("`", startsExpr),
    dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}),

    // Operators. These carry several kinds of properties to help the
    // parser use them properly (the presence of these properties is
    // what categorizes them as operators).
    //
    // `binop`, when present, specifies that this operator is a binary
    // operator, and will refer to its precedence.
    //
    // `prefix` and `postfix` mark the operator as a prefix or postfix
    // unary operator.
    //
    // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as
    // binary operators with a very low precedence, that should result
    // in AssignmentExpression nodes.

    eq: new TokenType("=", {beforeExpr: true, isAssign: true}),
    assign: new TokenType("_=", {beforeExpr: true, isAssign: true}),
    incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}),
    prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}),
    logicalOR: binop("||", 1),
    logicalAND: binop("&&", 2),
    bitwiseOR: binop("|", 3),
    bitwiseXOR: binop("^", 4),
    bitwiseAND: binop("&", 5),
    equality: binop("==/!=/===/!==", 6),
    relational: binop("</>/<=/>=", 7),
    bitShift: binop("<</>>/>>>", 8),
    plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}),
    modulo: binop("%", 10),
    star: binop("*", 10),
    slash: binop("/", 10),
    starstar: new TokenType("**", {beforeExpr: true}),
    coalesce: binop("??", 1),

    // Keyword token types.
    _break: kw("break"),
    _case: kw("case", beforeExpr),
    _catch: kw("catch"),
    _continue: kw("continue"),
    _debugger: kw("debugger"),
    _default: kw("default", beforeExpr),
    _do: kw("do", {isLoop: true, beforeExpr: true}),
    _else: kw("else", beforeExpr),
    _finally: kw("finally"),
    _for: kw("for", {isLoop: true}),
    _function: kw("function", startsExpr),
    _if: kw("if"),
    _return: kw("return", beforeExpr),
    _switch: kw("switch"),
    _throw: kw("throw", beforeExpr),
    _try: kw("try"),
    _var: kw("var"),
    _const: kw("const"),
    _while: kw("while", {isLoop: true}),
    _with: kw("with"),
    _new: kw("new", {beforeExpr: true, startsExpr: true}),
    _this: kw("this", startsExpr),
    _super: kw("super", startsExpr),
    _class: kw("class", startsExpr),
    _extends: kw("extends", beforeExpr),
    _export: kw("export"),
    _import: kw("import", startsExpr),
    _null: kw("null", startsExpr),
    _true: kw("true", startsExpr),
    _false: kw("false", startsExpr),
    _in: kw("in", {beforeExpr: true, binop: 7}),
    _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}),
    _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}),
    _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}),
    _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true})
  };

  // Matches a whole line break (where CRLF is considered a single
  // line break). Used to count lines.

  var lineBreak = /\r\n?|\n|\u2028|\u2029/;
  var lineBreakG = new RegExp(lineBreak.source, "g");

  function isNewLine(code) {
    return code === 10 || code === 13 || code === 0x2028 || code === 0x2029
  }

  function nextLineBreak(code, from, end) {
    if ( end === void 0 ) end = code.length;

    for (var i = from; i < end; i++) {
      var next = code.charCodeAt(i);
      if (isNewLine(next))
        { return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1 }
    }
    return -1
  }

  var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;

  var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;

  var ref = Object.prototype;
  var hasOwnProperty = ref.hasOwnProperty;
  var toString = ref.toString;

  var hasOwn = Object.hasOwn || (function (obj, propName) { return (
    hasOwnProperty.call(obj, propName)
  ); });

  var isArray = Array.isArray || (function (obj) { return (
    toString.call(obj) === "[object Array]"
  ); });

  var regexpCache = Object.create(null);

  function wordsRegexp(words) {
    return regexpCache[words] || (regexpCache[words] = new RegExp("^(?:" + words.replace(/ /g, "|") + ")$"))
  }

  function codePointToString(code) {
    // UTF-16 Decoding
    if (code <= 0xFFFF) { return String.fromCharCode(code) }
    code -= 0x10000;
    return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00)
  }

  var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/;

  // These are used when `options.locations` is on, for the
  // `startLoc` and `endLoc` properties.

  var Position = function Position(line, col) {
    this.line = line;
    this.column = col;
  };

  Position.prototype.offset = function offset (n) {
    return new Position(this.line, this.column + n)
  };

  var SourceLocation = function SourceLocation(p, start, end) {
    this.start = start;
    this.end = end;
    if (p.sourceFile !== null) { this.source = p.sourceFile; }
  };

  // The `getLineInfo` function is mostly useful when the
  // `locations` option is off (for performance reasons) and you
  // want to find the line/column position for a given character
  // offset. `input` should be the code string that the offset refers
  // into.

  function getLineInfo(input, offset) {
    for (var line = 1, cur = 0;;) {
      var nextBreak = nextLineBreak(input, cur, offset);
      if (nextBreak < 0) { return new Position(line, offset - cur) }
      ++line;
      cur = nextBreak;
    }
  }

  // A second argument must be given to configure the parser process.
  // These options are recognized (only `ecmaVersion` is required):

  var defaultOptions = {
    // `ecmaVersion` indicates the ECMAScript version to parse. Must be
    // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10
    // (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"`
    // (the latest version the library supports). This influences
    // support for strict mode, the set of reserved words, and support
    // for new syntax features.
    ecmaVersion: null,
    // `sourceType` indicates the mode the code should be parsed in.
    // Can be either `"script"`, `"module"` or `"commonjs"`. This influences global
    // strict mode and parsing of `import` and `export` declarations.
    sourceType: "script",
    // When set to true, enable strict parsing mode even if `sourceType`
    // is `"script"`.
    strict: false,
    // `onInsertedSemicolon` can be a callback that will be called when
    // a semicolon is automatically inserted. It will be passed the
    // position of the inserted semicolon as an offset, and if
    // `locations` is enabled, it is given the location as a `{line,
    // column}` object as second argument.
    onInsertedSemicolon: null,
    // `onTrailingComma` is similar to `onInsertedSemicolon`, but for
    // trailing commas.
    onTrailingComma: null,
    // By default, reserved words are only enforced if ecmaVersion >= 5.
    // Set `allowReserved` to a boolean value to explicitly turn this on
    // an off. When this option has the value "never", reserved words
    // and keywords can also not be used as property names.
    allowReserved: null,
    // When enabled, a return at the top level is not considered an
    // error.
    allowReturnOutsideFunction: false,
    // When enabled, import/export statements are not constrained to
    // appearing at the top of the program, and an import.meta expression
    // in a script isn't considered an error.
    allowImportExportEverywhere: false,
    // By default, await identifiers are allowed to appear at the top-level scope only if ecmaVersion >= 2022.
    // When enabled, await identifiers are allowed to appear at the top-level scope,
    // but they are still not allowed in non-async functions.
    allowAwaitOutsideFunction: null,
    // When enabled, super identifiers are not constrained to
    // appearing in methods and do not raise an error when they appear elsewhere.
    allowSuperOutsideMethod: null,
    // When enabled, hashbang directive in the beginning of file is
    // allowed and treated as a line comment. Enabled by default when
    // `ecmaVersion` >= 2023.
    allowHashBang: false,
    // By default, the parser will verify that private properties are
    // only used in places where they are valid and have been declared.
    // Set this to false to turn such checks off.
    checkPrivateFields: true,
    // When `locations` is on, `loc` properties holding objects with
    // `start` and `end` properties in `{line, column}` form (with
    // line being 1-based and column 0-based) will be attached to the
    // nodes.
    locations: false,
    // Pass an optional `{line, column}` object to use for the start of
    // the parse. This is mostly useful when using `parseExpressionAt`
    // with `locations: true`, to prevent the parser from having to
    // determine the line position at the start position.
    startLocation: null,
    // A function can be passed as `onToken` option, which will
    // cause Acorn to call that function with object in the same
    // format as tokens returned from `tokenizer().getToken()`. Note
    // that you are not allowed to call the parser from the
    // callback—that will corrupt its internal state.
    onToken: null,
    // A function can be passed as `onComment` option, which will
    // cause Acorn to call that function with `(block, text, start,
    // end)` parameters whenever a comment is skipped. `block` is a
    // boolean indicating whether this is a block (`/* */`) comment,
    // `text` is the content of the comment, and `start` and `end` are
    // character offsets that denote the start and end of the comment.
    // When the `locations` option is on, two more parameters are
    // passed, the full `{line, column}` locations of the start and
    // end of the comments. Note that you are not allowed to call the
    // parser from the callback—that will corrupt its internal state.
    // When this option has an array as value, objects representing the
    // comments are pushed to it.
    onComment: null,
    // Nodes have their start and end characters offsets recorded in
    // `start` and `end` properties (directly on the node, rather than
    // the `loc` object, which holds line/column data. To also add a
    // [semi-standardized][range] `range` property holding a `[start,
    // end]` array with the same numbers, set the `ranges` option to
    // `true`.
    //
    // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678
    ranges: false,
    // It is possible to parse multiple files into a single AST by
    // passing the tree produced by parsing the first file as
    // `program` option in subsequent parses. This will add the
    // toplevel forms of the parsed file to the `Program` (top) node
    // of an existing parse tree.
    program: null,
    // When `locations` is on, you can pass this to record the source
    // file in every node's `loc` object.
    sourceFile: null,
    // This value, if given, is stored in every node, whether
    // `locations` is on or off.
    directSourceFile: null,
    // When enabled, parenthesized expressions are represented by
    // (non-standard) ParenthesizedExpression nodes
    preserveParens: false
  };

  // Interpret and default an options object

  var warnedAboutEcmaVersion = false;

  function getOptions(opts) {
    var options = {};

    for (var opt in defaultOptions)
      { options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; }

    if (options.ecmaVersion === "latest") {
      options.ecmaVersion = 1e8;
    } else if (options.ecmaVersion == null) {
      if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) {
        warnedAboutEcmaVersion = true;
        console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.");
      }
      options.ecmaVersion = 11;
    } else if (options.ecmaVersion >= 2015) {
      options.ecmaVersion -= 2009;
    }

    if (options.allowReserved == null)
      { options.allowReserved = options.ecmaVersion < 5; }

    if (!opts || opts.allowHashBang == null)
      { options.allowHashBang = options.ecmaVersion >= 14; }

    if (isArray(options.onToken)) {
      var tokens = options.onToken;
      options.onToken = function (token) { return tokens.push(token); };
    }
    if (isArray(options.onComment))
      { options.onComment = pushComment(options, options.onComment); }

    if (options.sourceType === "commonjs" && options.allowAwaitOutsideFunction)
      { throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs") }

    return options
  }

  function pushComment(options, array) {
    return function(block, text, start, end, startLoc, endLoc) {
      var comment = {
        type: block ? "Block" : "Line",
        value: text,
        start: start,
        end: end
      };
      if (options.locations)
        { comment.loc = new SourceLocation(this, startLoc, endLoc); }
      if (options.ranges)
        { comment.range = [start, end]; }
      array.push(comment);
    }
  }

  // Each scope gets a bitset that may contain these flags
  var
      SCOPE_TOP = 1,
      SCOPE_FUNCTION = 2,
      SCOPE_ASYNC = 4,
      SCOPE_GENERATOR = 8,
      SCOPE_ARROW = 16,
      SCOPE_SIMPLE_CATCH = 32,
      SCOPE_SUPER = 64,
      SCOPE_DIRECT_SUPER = 128,
      SCOPE_CLASS_STATIC_BLOCK = 256,
      SCOPE_CLASS_FIELD_INIT = 512,
      SCOPE_SWITCH = 1024,
      SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;

  function functionFlags(async, generator) {
    return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0)
  }

  // Used in checkLVal* and declareName to determine the type of a binding
  var
      BIND_NONE = 0, // Not a binding
      BIND_VAR = 1, // Var-style binding
      BIND_LEXICAL = 2, // Let- or const-style binding
      BIND_FUNCTION = 3, // Function declaration
      BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding
      BIND_OUTSIDE = 5; // Special case for function names as bound inside the function

  var Parser = function Parser(options, input, startPos) {
    this.options = options = getOptions(options);
    this.sourceFile = options.sourceFile;
    this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]);
    var reserved = "";
    if (options.allowReserved !== true) {
      reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3];
      if (options.sourceType === "module") { reserved += " await"; }
    }
    this.reservedWords = wordsRegexp(reserved);
    var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict;
    this.reservedWordsStrict = wordsRegexp(reservedStrict);
    this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind);
    this.input = String(input);

    // Used to signal to callers of `readWord1` whether the word
    // contained any escape sequences. This is needed because words with
    // escape sequences must not be interpreted as keywords.
    this.containsEsc = false;

    // Set up token state

    // The current position of the tokenizer in the input.
    this.pos = startPos || 0;
    this.curLine = 1;
    if (options.startLocation) {
      this.lineStart = this.pos - options.startLocation.column;
      this.curLine = options.startLocation.line;
    } else if (startPos) {
      this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1;
      if (this.options.locations)
        { this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; }
    } else {
      this.lineStart = 0;
    }

    // Properties of the current token:
    // Its type
    this.type = types$1.eof;
    // For tokens that include more information than their type, the value
    this.value = null;
    // Its start and end offset
    this.start = this.end = this.pos;
    // And, if locations are used, the {line, column} object
    // corresponding to those offsets
    this.startLoc = this.endLoc = this.curPosition();

    // Position information for the previous token
    this.lastTokEndLoc = this.lastTokStartLoc = null;
    this.lastTokStart = this.lastTokEnd = this.pos;

    // The context stack is used to superficially track syntactic
    // context to predict whether a regular expression is allowed in a
    // given position.
    this.context = this.initialContext();
    this.exprAllowed = true;

    // Figure out if it's a module code.
    this.inModule = options.sourceType === "module";
    this.strict = this.inModule || options.strict === true || this.strictDirective(this.pos);

    // Used to signify the start of a potential arrow function
    this.potentialArrowAt = -1;
    this.potentialArrowInForAwait = false;

    // Positions to delayed-check that yield/await does not exist in default parameters.
    this.yieldPos = this.awaitPos = this.awaitIdentPos = 0;
    // Labels in scope.
    this.labels = [];
    // Thus-far undefined exports.
    this.undefinedExports = Object.create(null);

    // If enabled, skip leading hashbang line.
    if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!")
      { this.skipLineComment(2); }

    // Scope tracking for duplicate variable names (see scope.js)
    this.scopeStack = [];
    this.enterScope(
      this.options.sourceType === "commonjs"
        // In commonjs, the top-level scope behaves like a function scope
        ? SCOPE_FUNCTION
        : SCOPE_TOP
    );

    // For RegExp validation
    this.regexpState = null;

    // The stack of private names.
    // Each element has two properties: 'declared' and 'used'.
    // When it exited from the outermost class definition, all used private names must be declared.
    this.privateNameStack = [];
  };

  var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },canAwait: { configurable: true },allowReturn: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },allowNewDotTarget: { configurable: true },allowUsing: { configurable: true },inClassStaticBlock: { configurable: true } };

  Parser.prototype.parse = function parse () {
      var this$1$1 = this;

    var node = this.options.program || this.startNode();
    this.nextToken();
    return this.catchStackOverflow(function () { return this$1$1.parseTopLevel(node); })
  };

  prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 };

  prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 };

  prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 };

  prototypeAccessors.canAwait.get = function () {
    for (var i = this.scopeStack.length - 1; i >= 0; i--) {
      var ref = this.scopeStack[i];
        var flags = ref.flags;
      if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT)) { return false }
      if (flags & SCOPE_FUNCTION) { return (flags & SCOPE_ASYNC) > 0 }
    }
    return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction
  };

  prototypeAccessors.allowReturn.get = function () {
    if (this.inFunction) { return true }
    if (this.options.allowReturnOutsideFunction && this.currentVarScope().flags & SCOPE_TOP) { return true }
    return false
  };

  prototypeAccessors.allowSuper.get = function () {
    var ref = this.currentThisScope();
      var flags = ref.flags;
    return (flags & SCOPE_SUPER) > 0 || this.options.allowSuperOutsideMethod
  };

  prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 };

  prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) };

  prototypeAccessors.allowNewDotTarget.get = function () {
    for (var i = this.scopeStack.length - 1; i >= 0; i--) {
      var ref = this.scopeStack[i];
        var flags = ref.flags;
      if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT) ||
          ((flags & SCOPE_FUNCTION) && !(flags & SCOPE_ARROW))) { return true }
    }
    return false
  };

  prototypeAccessors.allowUsing.get = function () {
    var ref = this.currentScope();
      var flags = ref.flags;
    if (flags & SCOPE_SWITCH) { return false }
    if (!this.inModule && flags & SCOPE_TOP) { return false }
    return true
  };

  prototypeAccessors.inClassStaticBlock.get = function () {
    return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0
  };

  Parser.extend = function extend () {
      var plugins = [], len = arguments.length;
      while ( len-- ) plugins[ len ] = arguments[ len ];

    var cls = this;
    for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); }
    return cls
  };

  Parser.parse = function parse (input, options) {
    return new this(options, input).parse()
  };

  Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) {
    var parser = new this(options, input, pos);
    parser.nextToken();
    return parser.parseExpression()
  };

  Parser.tokenizer = function tokenizer (input, options) {
    return new this(options, input)
  };

  Object.defineProperties( Parser.prototype, prototypeAccessors );

  var pp$9 = Parser.prototype;

  // ## Parser utilities

  var literal = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
  pp$9.strictDirective = function(start) {
    if (this.options.ecmaVersion < 5) { return false }
    for (;;) {
      // Try to find string literal.
      skipWhiteSpace.lastIndex = start;
      start += skipWhiteSpace.exec(this.input)[0].length;
      var match = literal.exec(this.input.slice(start));
      if (!match) { return false }
      if ((match[1] || match[2]) === "use strict") {
        skipWhiteSpace.lastIndex = start + match[0].length;
        var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length;
        var next = this.input.charAt(end);
        return next === ";" || next === "}" ||
          (lineBreak.test(spaceAfter[0]) &&
           !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "="))
      }
      start += match[0].length;

      // Skip semicolon, if any.
      skipWhiteSpace.lastIndex = start;
      start += skipWhiteSpace.exec(this.input)[0].length;
      if (this.input[start] === ";")
        { start++; }
    }
  };

  // Predicate that tests whether the next token is of the given
  // type, and if yes, consumes it as a side effect.

  pp$9.eat = function(type) {
    if (this.type === type) {
      this.next();
      return true
    } else {
      return false
    }
  };

  // Tests whether parsed token is a contextual keyword.

  pp$9.isContextual = function(name) {
    return this.type === types$1.name && this.value === name && !this.containsEsc
  };

  // Consumes contextual keyword if possible.

  pp$9.eatContextual = function(name) {
    if (!this.isContextual(name)) { return false }
    this.next();
    return true
  };

  pp$9.catchStackOverflow = function(f) {
    try {
      return f()
    } catch (e) {
      if (e instanceof Error && (/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message) || /\btoo much recursion\b/i.test(e.message)))
        { this.raise(this.start, "Not enough stack space to parse input"); }
      else
        { throw e }
    }
  };

  // Asserts that following token is given contextual keyword.

  pp$9.expectContextual = function(name) {
    if (!this.eatContextual(name)) { this.unexpected(); }
  };

  // Test whether a semicolon can be inserted at the current position.

  pp$9.canInsertSemicolon = function() {
    return this.type === types$1.eof ||
      this.type === types$1.braceR ||
      lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
  };

  pp$9.insertSemicolon = function() {
    if (this.canInsertSemicolon()) {
      if (this.options.onInsertedSemicolon)
        { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); }
      return true
    }
  };

  // Consume a semicolon, or, failing that, see if we are allowed to
  // pretend that there is a semicolon at this position.

  pp$9.semicolon = function() {
    if (!this.eat(types$1.semi) && !this.insertSemicolon()) { this.unexpected(); }
  };

  pp$9.afterTrailingComma = function(tokType, notNext) {
    if (this.type === tokType) {
      if (this.options.onTrailingComma)
        { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); }
      if (!notNext)
        { this.next(); }
      return true
    }
  };

  // Expect a token of a given type. If found, consume it, otherwise,
  // raise an unexpected token error.

  pp$9.expect = function(type) {
    this.eat(type) || this.unexpected();
  };

  // Raise an unexpected token error.

  pp$9.unexpected = function(pos) {
    this.raise(pos != null ? pos : this.start, "Unexpected token");
  };

  var DestructuringErrors = function DestructuringErrors() {
    this.shorthandAssign =
    this.trailingComma =
    this.parenthesizedAssign =
    this.parenthesizedBind =
    this.doubleProto =
      -1;
  };

  pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) {
    if (!refDestructuringErrors) { return }
    if (refDestructuringErrors.trailingComma > -1)
      { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); }
    var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind;
    if (parens > -1) { this.raiseRecoverable(parens, isAssign ? "Assigning to rvalue" : "Parenthesized pattern"); }
  };

  pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) {
    if (!refDestructuringErrors) { return false }
    var shorthandAssign = refDestructuringErrors.shorthandAssign;
    var doubleProto = refDestructuringErrors.doubleProto;
    if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 }
    if (shorthandAssign >= 0)
      { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); }
    if (doubleProto >= 0)
      { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); }
  };

  pp$9.checkYieldAwaitInDefaultParams = function() {
    if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos))
      { this.raise(this.yieldPos, "Yield expression cannot be a default value"); }
    if (this.awaitPos)
      { this.raise(this.awaitPos, "Await expression cannot be a default value"); }
  };

  pp$9.isSimpleAssignTarget = function(expr) {
    if (expr.type === "ParenthesizedExpression")
      { return this.isSimpleAssignTarget(expr.expression) }
    return expr.type === "Identifier" || expr.type === "MemberExpression"
  };

  var pp$8 = Parser.prototype;

  // ### Statement parsing

  // Parse a program. Initializes the parser, reads any number of
  // statements, and wraps them in a Program node.  Optionally takes a
  // `program` argument.  If present, the statements will be appended
  // to its body instead of creating a new node.

  pp$8.parseTopLevel = function(node) {
    var exports$1 = Object.create(null);
    if (!node.body) { node.body = []; }
    while (this.type !== types$1.eof) {
      var stmt = this.parseStatement(null, true, exports$1);
      node.body.push(stmt);
    }
    if (this.inModule)
      { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1)
        {
          var name = list[i];

          this.raiseRecoverable(this.undefinedExports[name].start, ("Export '" + name + "' is not defined"));
        } }
    this.adaptDirectivePrologue(node.body);
    this.next();
    node.sourceType = this.options.sourceType === "commonjs" ? "script" : this.options.sourceType;
    return this.finishNode(node, "Program")
  };

  var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"};

  pp$8.isLet = function(context) {
    if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false }
    skipWhiteSpace.lastIndex = this.pos;
    var skip = skipWhiteSpace.exec(this.input);
    var next = this.pos + skip[0].length, nextCh = this.fullCharCodeAt(next);
    // For ambiguous cases, determine if a LexicalDeclaration (or only a
    // Statement) is allowed here. If context is not empty then only a Statement
    // is allowed. However, `let [` is an explicit negative lookahead for
    // ExpressionStatement, so special-case it first.
    if (nextCh === 91 || nextCh === 92) { return true } // '[', '\'
    if (context) { return false }

    if (nextCh === 123) { return true } // '{'
    if (isIdentifierStart(nextCh)) {
      var start = next;
      do { next += nextCh <= 0xffff ? 1 : 2; }
      while (isIdentifierChar(nextCh = this.fullCharCodeAt(next)))
      if (nextCh === 92) { return true }
      var ident = this.input.slice(start, next);
      if (!keywordRelationalOperator.test(ident)) { return true }
    }
    return false
  };

  // check 'async [no LineTerminator here] function'
  // - 'async /*foo*/ function' is OK.
  // - 'async /*\n*/ function' is invalid.
  pp$8.isAsyncFunction = function() {
    if (this.options.ecmaVersion < 8 || !this.isContextual("async"))
      { return false }

    skipWhiteSpace.lastIndex = this.pos;
    var skip = skipWhiteSpace.exec(this.input);
    var next = this.pos + skip[0].length, after;
    return !lineBreak.test(this.input.slice(this.pos, next)) &&
      this.input.slice(next, next + 8) === "function" &&
      (next + 8 === this.input.length ||
       !(isIdentifierChar(after = this.fullCharCodeAt(next + 8)) || after === 92 /* '\' */))
  };

  pp$8.isUsingKeyword = function(isAwaitUsing, isFor) {
    if (this.options.ecmaVersion < 17 || !this.isContextual(isAwaitUsing ? "await" : "using"))
      { return false }

    skipWhiteSpace.lastIndex = this.pos;
    var skip = skipWhiteSpace.exec(this.input);
    var next = this.pos + skip[0].length;

    if (lineBreak.test(this.input.slice(this.pos, next))) { return false }

    if (isAwaitUsing) {
      var usingEndPos = next + 5 /* using */, after;
      if (this.input.slice(next, usingEndPos) !== "using" ||
        usingEndPos === this.input.length ||
        isIdentifierChar(after = this.fullCharCodeAt(usingEndPos)) ||
        after === 92 /* '\' */
      ) { return false }

      skipWhiteSpace.lastIndex = usingEndPos;
      var skipAfterUsing = skipWhiteSpace.exec(this.input);
      next = usingEndPos + skipAfterUsing[0].length;
      if (skipAfterUsing && lineBreak.test(this.input.slice(usingEndPos, next))) { return false }
    }

    var ch = this.fullCharCodeAt(next);
    if (!isIdentifierStart(ch) && ch !== 92 /* '\' */) { return false }
    var idStart = next;
    do { next += ch <= 0xffff ? 1 : 2; }
    while (isIdentifierChar(ch = this.fullCharCodeAt(next)))
    if (ch === 92) { return true }
    var id = this.input.slice(idStart, next);
    if (keywordRelationalOperator.test(id)) { return false }
    if (isFor && !isAwaitUsing && id === "of") {
      // Look ahead for using declaration with initializer, i.e., `for (using of = ...)`
      skipWhiteSpace.lastIndex = next;
      var skipAfterOf = skipWhiteSpace.exec(this.input);
      next = next + skipAfterOf[0].length;
      if (this.input.charCodeAt(next) !== 61 /* '=' */ ||
        // Check for ==, === and => operators
        (ch = this.input.charCodeAt(next + 1)) === 61 /* '=' */ || ch === 62 /* '>' */) {
        return false
      }
    }
    return true
  };

  pp$8.isAwaitUsing = function(isFor) {
    return this.isUsingKeyword(true, isFor)
  };

  pp$8.isUsing = function(isFor) {
    return this.isUsingKeyword(false, isFor)
  };

  // Parse a single statement.
  //
  // If expecting a statement and finding a slash operator, parse a
  // regular expression literal. This is to handle cases like
  // `if (foo) /blah/.exec(foo)`, where looking at the previous token
  // does not help.

  pp$8.parseStatement = function(context, topLevel, exports$1) {
    var starttype = this.type, node = this.startNode(), kind;

    if (this.isLet(context)) {
      starttype = types$1._var;
      kind = "let";
    }

    // Most types of statements are recognized by the keyword they
    // start with. Many are trivial to parse, some require a bit of
    // complexity.

    switch (starttype) {
    case types$1._break: case types$1._continue: return this.parseBreakContinueStatement(node, starttype.keyword)
    case types$1._debugger: return this.parseDebuggerStatement(node)
    case types$1._do: return this.parseDoStatement(node)
    case types$1._for: return this.parseForStatement(node)
    case types$1._function:
      // Function as sole body of either an if statement or a labeled statement
      // works, but not when it is part of a labeled statement that is the sole
      // body of an if statement.
      if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); }
      return this.parseFunctionStatement(node, false, !context)
    case types$1._class:
      if (context) { this.unexpected(); }
      return this.parseClass(node, true)
    case types$1._if: return this.parseIfStatement(node)
    case types$1._return: return this.parseReturnStatement(node)
    case types$1._switch: return this.parseSwitchStatement(node)
    case types$1._throw: return this.parseThrowStatement(node)
    case types$1._try: return this.parseTryStatement(node)
    case types$1._const: case types$1._var:
      kind = kind || this.value;
      if (context && kind !== "var") { this.unexpected(); }
      return this.parseVarStatement(node, kind)
    case types$1._while: return this.parseWhileStatement(node)
    case types$1._with: return this.parseWithStatement(node)
    case types$1.braceL: return this.parseBlock(true, node)
    case types$1.semi: return this.parseEmptyStatement(node)
    case types$1._export:
    case types$1._import:
      if (this.options.ecmaVersion > 10 && starttype === types$1._import) {
        skipWhiteSpace.lastIndex = this.pos;
        var skip = skipWhiteSpace.exec(this.input);
        var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
        if (nextCh === 40 || nextCh === 46) // '(' or '.'
          { return this.parseExpressionStatement(node, this.parseExpression()) }
      }

      if (!this.options.allowImportExportEverywhere) {
        if (!topLevel)
          { this.raise(this.start, "'import' and 'export' may only appear at the top level"); }
        if (!this.inModule)
          { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); }
      }
      return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports$1)

      // If the statement does not start with a statement keyword or a
      // brace, it's an ExpressionStatement or LabeledStatement. We
      // simply start parsing an expression, and afterwards, if the
      // next token is a colon and the expression was a simple
      // Identifier node, we switch to interpreting it as a label.
    default:
      if (this.isAsyncFunction()) {
        if (context) { this.unexpected(); }
        this.next();
        return this.parseFunctionStatement(node, true, !context)
      }

      var usingKind = this.isAwaitUsing(false) ? "await using" : this.isUsing(false) ? "using" : null;
      if (usingKind) {
        if (!this.allowUsing) {
          this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");
        }
        if (context) {
          // Cases like `for (;;) using x = ...;`, `if (true) await using x = ...;`, etc. are not allowed.
          this.raise(this.start, "Using declaration is not allowed in single-statement positions");
        }
        if (usingKind === "await using") {
          if (!this.canAwait) {
            this.raise(this.start, "Await using cannot appear outside of async function");
          }
          this.next();
        }
        this.next();
        this.parseVar(node, false, usingKind);
        this.semicolon();
        return this.finishNode(node, "VariableDeclaration")
      }

      var maybeName = this.value, expr = this.parseExpression();
      if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon))
        { return this.parseLabeledStatement(node, maybeName, expr, context) }
      else { return this.parseExpressionStatement(node, expr) }
    }
  };

  pp$8.parseBreakContinueStatement = function(node, keyword) {
    var isBreak = keyword === "break";
    this.next();
    if (this.eat(types$1.semi) || this.insertSemicolon()) { node.label = null; }
    else if (this.type !== types$1.name) { this.unexpected(); }
    else {
      node.label = this.parseIdent();
      this.semicolon();
    }

    // Verify that there is an actual destination to break or
    // continue to.
    var i = 0;
    for (; i < this.labels.length; ++i) {
      var lab = this.labels[i];
      if (node.label == null || lab.name === node.label.name) {
        if (lab.kind != null && (isBreak || lab.kind === "loop")) { break }
        if (node.label && isBreak) { break }
      }
    }
    if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); }
    return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement")
  };

  pp$8.parseDebuggerStatement = function(node) {
    this.next();
    this.semicolon();
    return this.finishNode(node, "DebuggerStatement")
  };

  pp$8.parseDoStatement = function(node) {
    this.next();
    this.labels.push(loopLabel);
    node.body = this.parseStatement("do");
    this.labels.pop();
    this.expect(types$1._while);
    node.test = this.parseParenExpression();
    if (this.options.ecmaVersion >= 6)
      { this.eat(types$1.semi); }
    else
      { this.semicolon(); }
    return this.finishNode(node, "DoWhileStatement")
  };

  // Disambiguating between a `for` and a `for`/`in` or `for`/`of`
  // loop is non-trivial. Basically, we have to parse the init `var`
  // statement or expression, disallowing the `in` operator (see
  // the second parameter to `parseExpression`), and then check
  // whether the next token is `in` or `of`. When there is no init
  // part (semicolon immediately after the opening parenthesis), it
  // is a regular `for` loop.

  pp$8.parseForStatement = function(node) {
    this.next();
    var awaitAt = (this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await")) ? this.lastTokStart : -1;
    this.labels.push(loopLabel);
    this.enterScope(0);
    this.expect(types$1.parenL);
    if (this.type === types$1.semi) {
      if (awaitAt > -1) { this.unexpected(awaitAt); }
      return this.parseFor(node, null)
    }
    var isLet = this.isLet();
    if (this.type === types$1._var || this.type === types$1._const || isLet) {
      var init$1 = this.startNode(), kind = isLet ? "let" : this.value;
      this.next();
      this.parseVar(init$1, true, kind);
      this.finishNode(init$1, "VariableDeclaration");
      return this.parseForAfterInit(node, init$1, awaitAt)
    }
    var startsWithLet = this.isContextual("let"), isForOf = false;

    var usingKind = this.isUsing(true) ? "using" : this.isAwaitUsing(true) ? "await using" : null;
    if (usingKind) {
      var init$2 = this.startNode();
      this.next();
      if (usingKind === "await using") {
        if (!this.canAwait) {
          this.raise(this.start, "Await using cannot appear outside of async function");
        }
        this.next();
      }
      this.parseVar(init$2, true, usingKind);
      this.finishNode(init$2, "VariableDeclaration");
      return this.parseForAfterInit(node, init$2, awaitAt)
    }
    var containsEsc = this.containsEsc;
    var refDestructuringErrors = new DestructuringErrors;
    var initPos = this.start;
    var init = awaitAt > -1
      ? this.parseExprSubscripts(refDestructuringErrors, "await")
      : this.parseExpression(true, refDestructuringErrors);
    if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
      if (awaitAt > -1) { // implies `ecmaVersion >= 9` (see declaration of awaitAt)
        if (this.type === types$1._in) { this.unexpected(awaitAt); }
        node.await = true;
      } else if (isForOf && this.options.ecmaVersion >= 8) {
        if (init.start === initPos && !containsEsc && init.type === "Identifier" && init.name === "async") { this.unexpected(); }
        else if (this.options.ecmaVersion >= 9) { node.await = false; }
      }
      if (startsWithLet && isForOf) { this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'."); }
      this.toAssignable(init, false, refDestructuringErrors);
      this.checkLValPattern(init);
      return this.parseForIn(node, init)
    } else {
      this.checkExpressionErrors(refDestructuringErrors, true);
    }
    if (awaitAt > -1) { this.unexpected(awaitAt); }
    return this.parseFor(node, init)
  };

  // Helper method to parse for loop after variable initialization
  pp$8.parseForAfterInit = function(node, init, awaitAt) {
    if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init.declarations.length === 1) {
      if (this.type === types$1._in) {
        if ((init.kind === "using" || init.kind === "await using") && !init.declarations[0].init) {
          this.raise(this.start, "Using declaration is not allowed in for-in loops");
        }
        if (this.options.ecmaVersion >= 9 && awaitAt > -1) { this.unexpected(awaitAt); }
      } else if (this.options.ecmaVersion >= 9) { node.await = awaitAt > -1; }
      return this.parseForIn(node, init)
    }
    if (awaitAt > -1) { this.unexpected(awaitAt); }
    return this.parseFor(node, init)
  };

  pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) {
    this.next();
    return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync)
  };

  pp$8.parseIfStatement = function(node) {
    this.next();
    node.test = this.parseParenExpression();
    // allow function declarations in branches, but only in non-strict mode
    node.consequent = this.parseStatement("if");
    node.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null;
    return this.finishNode(node, "IfStatement")
  };

  pp$8.parseReturnStatement = function(node) {
    if (!this.allowReturn)
      { this.raise(this.start, "'return' outside of function"); }
    this.next();

    // In `return` (and `break`/`continue`), the keywords with
    // optional arguments, we eagerly look for a semicolon or the
    // possibility to insert one.

    if (this.eat(types$1.semi) || this.insertSemicolon()) { node.argument = null; }
    else { node.argument = this.parseExpression(); this.semicolon(); }
    return this.finishNode(node, "ReturnStatement")
  };

  pp$8.parseSwitchStatement = function(node) {
    this.next();
    node.discriminant = this.parseParenExpression();
    node.cases = [];
    this.expect(types$1.braceL);
    this.labels.push(switchLabel);
    this.enterScope(SCOPE_SWITCH);

    // Statements under must be grouped (by label) in SwitchCase
    // nodes. `cur` is used to keep the node that we are currently
    // adding statements to.

    var cur;
    for (var sawDefault = false; this.type !== types$1.braceR;) {
      if (this.type === types$1._case || this.type === types$1._default) {
        var isCase = this.type === types$1._case;
        if (cur) { this.finishNode(cur, "SwitchCase"); }
        node.cases.push(cur = this.startNode());
        cur.consequent = [];
        this.next();
        if (isCase) {
          cur.test = this.parseExpression();
        } else {
          if (sawDefault) { this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); }
          sawDefault = true;
          cur.test = null;
        }
        this.expect(types$1.colon);
      } else {
        if (!cur) { this.unexpected(); }
        cur.consequent.push(this.parseStatement(null));
      }
    }
    this.exitScope();
    if (cur) { this.finishNode(cur, "SwitchCase"); }
    this.next(); // Closing brace
    this.labels.pop();
    return this.finishNode(node, "SwitchStatement")
  };

  pp$8.parseThrowStatement = function(node) {
    this.next();
    if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start)))
      { this.raise(this.lastTokEnd, "Illegal newline after throw"); }
    node.argument = this.parseExpression();
    this.semicolon();
    return this.finishNode(node, "ThrowStatement")
  };

  // Reused empty array added for node fields that are always empty.

  var empty$1 = [];

  pp$8.parseCatchClauseParam = function() {
    var param = this.parseBindingAtom();
    var simple = param.type === "Identifier";
    this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0);
    this.checkLValPattern(param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL);
    this.expect(types$1.parenR);

    return param
  };

  pp$8.parseTryStatement = function(node) {
    this.next();
    node.block = this.parseBlock();
    node.handler = null;
    if (this.type === types$1._catch) {
      var clause = this.startNode();
      this.next();
      if (this.eat(types$1.parenL)) {
        clause.param = this.parseCatchClauseParam();
      } else {
        if (this.options.ecmaVersion < 10) { this.unexpected(); }
        clause.param = null;
        this.enterScope(0);
      }
      clause.body = this.parseBlock(false);
      this.exitScope();
      node.handler = this.finishNode(clause, "CatchClause");
    }
    node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null;
    if (!node.handler && !node.finalizer)
      { this.raise(node.start, "Missing catch or finally clause"); }
    return this.finishNode(node, "TryStatement")
  };

  pp$8.parseVarStatement = function(node, kind, allowMissingInitializer) {
    this.next();
    this.parseVar(node, false, kind, allowMissingInitializer);
    this.semicolon();
    return this.finishNode(node, "VariableDeclaration")
  };

  pp$8.parseWhileStatement = function(node) {
    this.next();
    node.test = this.parseParenExpression();
    this.labels.push(loopLabel);
    node.body = this.parseStatement("while");
    this.labels.pop();
    return this.finishNode(node, "WhileStatement")
  };

  pp$8.parseWithStatement = function(node) {
    if (this.strict) { this.raise(this.start, "'with' in strict mode"); }
    this.next();
    node.object = this.parseParenExpression();
    node.body = this.parseStatement("with");
    return this.finishNode(node, "WithStatement")
  };

  pp$8.parseEmptyStatement = function(node) {
    this.next();
    return this.finishNode(node, "EmptyStatement")
  };

  pp$8.parseLabeledStatement = function(node, maybeName, expr, context) {
    for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1)
      {
      var label = list[i$1];

      if (label.name === maybeName)
        { this.raise(expr.start, "Label '" + maybeName + "' is already declared");
    } }
    var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null;
    for (var i = this.labels.length - 1; i >= 0; i--) {
      var label$1 = this.labels[i];
      if (label$1.statementStart === node.start) {
        // Update information about previous labels on this node
        label$1.statementStart = this.start;
        label$1.kind = kind;
      } else { break }
    }
    this.labels.push({name: maybeName, kind: kind, statementStart: this.start});
    node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label");
    this.labels.pop();
    node.label = expr;
    return this.finishNode(node, "LabeledStatement")
  };

  pp$8.parseExpressionStatement = function(node, expr) {
    node.expression = expr;
    this.semicolon();
    return this.finishNode(node, "ExpressionStatement")
  };

  // Parse a semicolon-enclosed block of statements, handling `"use
  // strict"` declarations when `allowSt   rict` is true (used for
  // function bodies).

  pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) {
    if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true;
    if ( node === void 0 ) node = this.startNode();

    node.body = [];
    this.expect(types$1.braceL);
    if (createNewLexicalScope) { this.enterScope(0); }
    while (this.type !== types$1.braceR) {
      var stmt = this.parseStatement(null);
      node.body.push(stmt);
    }
    if (exitStrict) { this.strict = false; }
    this.next();
    if (createNewLexicalScope) { this.exitScope(); }
    return this.finishNode(node, "BlockStatement")
  };

  // Parse a regular `for` loop. The disambiguation code in
  // `parseStatement` will already have parsed the init statement or
  // expression.

  pp$8.parseFor = function(node, init) {
    node.init = init;
    this.expect(types$1.semi);
    node.test = this.type === types$1.semi ? null : this.parseExpression();
    this.expect(types$1.semi);
    node.update = this.type === types$1.parenR ? null : this.parseExpression();
    this.expect(types$1.parenR);
    node.body = this.parseStatement("for");
    this.exitScope();
    this.labels.pop();
    return this.finishNode(node, "ForStatement")
  };

  // Parse a `for`/`in` and `for`/`of` loop, which are almost
  // same from parser's perspective.

  pp$8.parseForIn = function(node, init) {
    var isForIn = this.type === types$1._in;
    this.next();

    if (
      init.type === "VariableDeclaration" &&
      init.declarations[0].init != null &&
      (
        !isForIn ||
        this.options.ecmaVersion < 8 ||
        this.strict ||
        init.kind !== "var" ||
        init.declarations[0].id.type !== "Identifier"
      )
    ) {
      this.raise(
        init.start,
        ((isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer")
      );
    }
    node.left = init;
    node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();
    this.expect(types$1.parenR);
    node.body = this.parseStatement("for");
    this.exitScope();
    this.labels.pop();
    return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement")
  };

  // Parse a list of variable declarations.

  pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) {
    node.declarations = [];
    node.kind = kind;
    for (;;) {
      var decl = this.startNode();
      this.parseVarId(decl, kind);
      if (this.eat(types$1.eq)) {
        decl.init = this.parseMaybeAssign(isFor);
      } else if (!allowMissingInitializer && kind === "const" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) {
        this.unexpected();
      } else if (!allowMissingInitializer && (kind === "using" || kind === "await using") && this.options.ecmaVersion >= 17 && this.type !== types$1._in && !this.isContextual("of")) {
        this.raise(this.lastTokEnd, ("Missing initializer in " + kind + " declaration"));
      } else if (!allowMissingInitializer && decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) {
        this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value");
      } else {
        decl.init = null;
      }
      node.declarations.push(this.finishNode(decl, "VariableDeclarator"));
      if (!this.eat(types$1.comma)) { break }
    }
    return node
  };

  pp$8.parseVarId = function(decl, kind) {
    decl.id = kind === "using" || kind === "await using"
      ? this.parseIdent()
      : this.parseBindingAtom();

    this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false);
  };

  var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4;

  // Parse a function declaration or literal (depending on the
  // `statement & FUNC_STATEMENT`).

  // Remove `allowExpressionBody` for 7.0.0, as it is only called with false
  pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) {
    this.initFunction(node);
    if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {
      if (this.type === types$1.star && (statement & FUNC_HANGING_STATEMENT))
        { this.unexpected(); }
      node.generator = this.eat(types$1.star);
    }
    if (this.options.ecmaVersion >= 8)
      { node.async = !!isAsync; }

    if (statement & FUNC_STATEMENT) {
      node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types$1.name ? null : this.parseIdent();
      if (node.id && !(statement & FUNC_HANGING_STATEMENT))
        // If it is a regular function declaration in sloppy mode, then it is
        // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding
        // mode depends on properties of the current scope (see
        // treatFunctionsAsVar).
        { this.checkLValSimple(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); }
    }

    var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
    this.yieldPos = 0;
    this.awaitPos = 0;
    this.awaitIdentPos = 0;
    this.enterScope(functionFlags(node.async, node.generator));

    if (!(statement & FUNC_STATEMENT))
      { node.id = this.type === types$1.name ? this.parseIdent() : null; }

    this.parseFunctionParams(node);
    this.parseFunctionBody(node, allowExpressionBody, false, forInit);

    this.yieldPos = oldYieldPos;
    this.awaitPos = oldAwaitPos;
    this.awaitIdentPos = oldAwaitIdentPos;
    return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression")
  };

  pp$8.parseFunctionParams = function(node) {
    this.expect(types$1.parenL);
    node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);
    this.checkYieldAwaitInDefaultParams();
  };

  // Parse a class declaration or literal (depending on the
  // `isStatement` parameter).

  pp$8.parseClass = function(node, isStatement) {
    this.next();

    // ecma-262 14.6 Class Definitions
    // A class definition is always strict mode code.
    var oldStrict = this.strict;
    this.strict = true;

    this.parseClassId(node, isStatement);
    this.parseClassSuper(node);
    var privateNameMap = this.enterClassBody();
    var classBody = this.startNode();
    var hadConstructor = false;
    classBody.body = [];
    this.expect(types$1.braceL);
    while (this.type !== types$1.braceR) {
      var element = this.parseClassElement(node.superClass !== null);
      if (element) {
        classBody.body.push(element);
        if (element.type === "MethodDefinition" && element.kind === "constructor") {
          if (hadConstructor) { this.raiseRecoverable(element.start, "Duplicate constructor in the same class"); }
          hadConstructor = true;
        } else if (element.key && element.key.type === "PrivateIdentifier" && isPrivateNameConflicted(privateNameMap, element)) {
          this.raiseRecoverable(element.key.start, ("Identifier '#" + (element.key.name) + "' has already been declared"));
        }
      }
    }
    this.strict = oldStrict;
    this.next();
    node.body = this.finishNode(classBody, "ClassBody");
    this.exitClassBody();
    return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression")
  };

  pp$8.parseClassElement = function(constructorAllowsSuper) {
    if (this.eat(types$1.semi)) { return null }

    var ecmaVersion = this.options.ecmaVersion;
    var node = this.startNode();
    var keyName = "";
    var isGenerator = false;
    var isAsync = false;
    var kind = "method";
    var isStatic = false;

    if (this.eatContextual("static")) {
      // Parse static init block
      if (ecmaVersion >= 13 && this.eat(types$1.braceL)) {
        this.parseClassStaticBlock(node);
        return node
      }
      if (this.isClassElementNameStart() || this.type === types$1.star) {
        isStatic = true;
      } else {
        keyName = "static";
      }
    }
    node.static = isStatic;
    if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) {
      if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) {
        isAsync = true;
      } else {
        keyName = "async";
      }
    }
    if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) {
      isGenerator = true;
    }
    if (!keyName && !isAsync && !isGenerator) {
      var lastValue = this.value;
      if (this.eatContextual("get") || this.eatContextual("set")) {
        if (this.isClassElementNameStart()) {
          kind = lastValue;
        } else {
          keyName = lastValue;
        }
      }
    }

    // Parse element name
    if (keyName) {
      // 'async', 'get', 'set', or 'static' were not a keyword contextually.
      // The last token is any of those. Make it the element name.
      node.computed = false;
      node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc);
      node.key.name = keyName;
      this.finishNode(node.key, "Identifier");
    } else {
      this.parseClassElementName(node);
    }

    // Parse element value
    if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) {
      var isConstructor = !node.static && checkKeyName(node, "constructor");
      var allowsDirectSuper = isConstructor && constructorAllowsSuper;
      // Couldn't move this check into the 'parseClassMethod' method for backward compatibility.
      if (isConstructor && kind !== "method") { this.raise(node.key.start, "Constructor can't have get/set modifier"); }
      node.kind = isConstructor ? "constructor" : kind;
      this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper);
    } else {
      this.parseClassField(node);
    }

    return node
  };

  pp$8.isClassElementNameStart = function() {
    return (
      this.type === types$1.name ||
      this.type === types$1.privateId ||
      this.type === types$1.num ||
      this.type === types$1.string ||
      this.type === types$1.bracketL ||
      this.type.keyword
    )
  };

  pp$8.parseClassElementName = function(element) {
    if (this.type === types$1.privateId) {
      if (this.value === "constructor") {
        this.raise(this.start, "Classes can't have an element named '#constructor'");
      }
      element.computed = false;
      element.key = this.parsePrivateIdent();
    } else {
      this.parsePropertyName(element);
    }
  };

  pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {
    // Check key and flags
    var key = method.key;
    if (method.kind === "constructor") {
      if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); }
      if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); }
    } else if (method.static && checkKeyName(method, "prototype")) {
      this.raise(key.start, "Classes may not have a static property named prototype");
    }

    // Parse value
    var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper);

    // Check value
    if (method.kind === "get" && value.params.length !== 0)
      { this.raiseRecoverable(value.start, "getter should have no params"); }
    if (method.kind === "set" && value.params.length !== 1)
      { this.raiseRecoverable(value.start, "setter should have exactly one param"); }
    if (method.kind === "set" && value.params[0].type === "RestElement")
      { this.raiseRecoverable(value.params[0].start, "Setter cannot use rest params"); }

    return this.finishNode(method, "MethodDefinition")
  };

  pp$8.parseClassField = function(field) {
    if (checkKeyName(field, "constructor")) {
      this.raise(field.key.start, "Classes can't have a field named 'constructor'");
    } else if (field.static && checkKeyName(field, "prototype")) {
      this.raise(field.key.start, "Classes can't have a static field named 'prototype'");
    }

    if (this.eat(types$1.eq)) {
      // To raise SyntaxError if 'arguments' exists in the initializer.
      this.enterScope(SCOPE_CLASS_FIELD_INIT | SCOPE_SUPER);
      field.value = this.parseMaybeAssign();
      this.exitScope();
    } else {
      field.value = null;
    }
    this.semicolon();

    return this.finishNode(field, "PropertyDefinition")
  };

  pp$8.parseClassStaticBlock = function(node) {
    node.body = [];

    var oldLabels = this.labels;
    this.labels = [];
    this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER);
    while (this.type !== types$1.braceR) {
      var stmt = this.parseStatement(null);
      node.body.push(stmt);
    }
    this.next();
    this.exitScope();
    this.labels = oldLabels;

    return this.finishNode(node, "StaticBlock")
  };

  pp$8.parseClassId = function(node, isStatement) {
    if (this.type === types$1.name) {
      node.id = this.parseIdent();
      if (isStatement)
        { this.checkLValSimple(node.id, BIND_LEXICAL, false); }
    } else {
      if (isStatement === true)
        { this.unexpected(); }
      node.id = null;
    }
  };

  pp$8.parseClassSuper = function(node) {
    node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(null, false) : null;
  };

  pp$8.enterClassBody = function() {
    var element = {declared: Object.create(null), used: []};
    this.privateNameStack.push(element);
    return element.declared
  };

  pp$8.exitClassBody = function() {
    var ref = this.privateNameStack.pop();
    var declared = ref.declared;
    var used = ref.used;
    if (!this.options.checkPrivateFields) { return }
    var len = this.privateNameStack.length;
    var parent = len === 0 ? null : this.privateNameStack[len - 1];
    for (var i = 0; i < used.length; ++i) {
      var id = used[i];
      if (!hasOwn(declared, id.name)) {
        if (parent) {
          parent.used.push(id);
        } else {
          this.raiseRecoverable(id.start, ("Private field '#" + (id.name) + "' must be declared in an enclosing class"));
        }
      }
    }
  };

  function isPrivateNameConflicted(privateNameMap, element) {
    var name = element.key.name;
    var curr = privateNameMap[name];

    var next = "true";
    if (element.type === "MethodDefinition" && (element.kind === "get" || element.kind === "set")) {
      next = (element.static ? "s" : "i") + element.kind;
    }

    // `class { get #a(){}; static set #a(_){} }` is also conflict.
    if (
      curr === "iget" && next === "iset" ||
      curr === "iset" && next === "iget" ||
      curr === "sget" && next === "sset" ||
      curr === "sset" && next === "sget"
    ) {
      privateNameMap[name] = "true";
      return false
    } else if (!curr) {
      privateNameMap[name] = next;
      return false
    } else {
      return true
    }
  }

  function checkKeyName(node, name) {
    var computed = node.computed;
    var key = node.key;
    return !computed && (
      key.type === "Identifier" && key.name === name ||
      key.type === "Literal" && key.value === name
    )
  }

  // Parses module export declaration.

  pp$8.parseExportAllDeclaration = function(node, exports$1) {
    if (this.options.ecmaVersion >= 11) {
      if (this.eatContextual("as")) {
        node.exported = this.parseModuleExportName();
        this.checkExport(exports$1, node.exported, this.lastTokStart);
      } else {
        node.exported = null;
      }
    }
    this.expectContextual("from");
    if (this.type !== types$1.string) { this.unexpected(); }
    node.source = this.parseExprAtom();
    if (this.options.ecmaVersion >= 16)
      { node.attributes = this.parseWithClause(); }
    this.semicolon();
    return this.finishNode(node, "ExportAllDeclaration")
  };

  pp$8.parseExport = function(node, exports$1) {
    this.next();
    // export * from '...'
    if (this.eat(types$1.star)) {
      return this.parseExportAllDeclaration(node, exports$1)
    }
    if (this.eat(types$1._default)) { // export default ...
      this.checkExport(exports$1, "default", this.lastTokStart);
      node.declaration = this.parseExportDefaultDeclaration();
      return this.finishNode(node, "ExportDefaultDeclaration")
    }
    // export var|const|let|function|class ...
    if (this.shouldParseExportStatement()) {
      node.declaration = this.parseExportDeclaration(node);
      if (node.declaration.type === "VariableDeclaration")
        { this.checkVariableExport(exports$1, node.declaration.declarations); }
      else
        { this.checkExport(exports$1, node.declaration.id, node.declaration.id.start); }
      node.specifiers = [];
      node.source = null;
      if (this.options.ecmaVersion >= 16)
        { node.attributes = []; }
    } else { // export { x, y as z } [from '...']
      node.declaration = null;
      node.specifiers = this.parseExportSpecifiers(exports$1);
      if (this.eatContextual("from")) {
        if (this.type !== types$1.string) { this.unexpected(); }
        node.source = this.parseExprAtom();
        if (this.options.ecmaVersion >= 16)
          { node.attributes = this.parseWithClause(); }
      } else {
        for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
          // check for keywords used as local names
          var spec = list[i];

          this.checkUnreserved(spec.local);
          // check if export is defined
          this.checkLocalExport(spec.local);

          if (spec.local.type === "Literal") {
            this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`.");
          }
        }

        node.source = null;
        if (this.options.ecmaVersion >= 16)
          { node.attributes = []; }
      }
      this.semicolon();
    }
    return this.finishNode(node, "ExportNamedDeclaration")
  };

  pp$8.parseExportDeclaration = function(node) {
    return this.parseStatement(null)
  };

  pp$8.parseExportDefaultDeclaration = function() {
    var isAsync;
    if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) {
      var fNode = this.startNode();
      this.next();
      if (isAsync) { this.next(); }
      return this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync)
    } else if (this.type === types$1._class) {
      var cNode = this.startNode();
      return this.parseClass(cNode, "nullableID")
    } else {
      var declaration = this.parseMaybeAssign();
      this.semicolon();
      return declaration
    }
  };

  pp$8.checkExport = function(exports$1, name, pos) {
    if (!exports$1) { return }
    if (typeof name !== "string")
      { name = name.type === "Identifier" ? name.name : name.value; }
    if (hasOwn(exports$1, name))
      { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); }
    exports$1[name] = true;
  };

  pp$8.checkPatternExport = function(exports$1, pat) {
    var type = pat.type;
    if (type === "Identifier")
      { this.checkExport(exports$1, pat, pat.start); }
    else if (type === "ObjectPattern")
      { for (var i = 0, list = pat.properties; i < list.length; i += 1)
        {
          var prop = list[i];

          this.checkPatternExport(exports$1, prop);
        } }
    else if (type === "ArrayPattern")
      { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {
        var elt = list$1[i$1];

          if (elt) { this.checkPatternExport(exports$1, elt); }
      } }
    else if (type === "Property")
      { this.checkPatternExport(exports$1, pat.value); }
    else if (type === "AssignmentPattern")
      { this.checkPatternExport(exports$1, pat.left); }
    else if (type === "RestElement")
      { this.checkPatternExport(exports$1, pat.argument); }
  };

  pp$8.checkVariableExport = function(exports$1, decls) {
    if (!exports$1) { return }
    for (var i = 0, list = decls; i < list.length; i += 1)
      {
      var decl = list[i];

      this.checkPatternExport(exports$1, decl.id);
    }
  };

  pp$8.shouldParseExportStatement = function() {
    return this.type.keyword === "var" ||
      this.type.keyword === "const" ||
      this.type.keyword === "class" ||
      this.type.keyword === "function" ||
      this.isLet() ||
      this.isAsyncFunction()
  };

  // Parses a comma-separated list of module exports.

  pp$8.parseExportSpecifier = function(exports$1) {
    var node = this.startNode();
    node.local = this.parseModuleExportName();

    node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
    this.checkExport(
      exports$1,
      node.exported,
      node.exported.start
    );

    return this.finishNode(node, "ExportSpecifier")
  };

  pp$8.parseExportSpecifiers = function(exports$1) {
    var nodes = [], first = true;
    // export { x, y as z } [from '...']
    this.expect(types$1.braceL);
    while (!this.eat(types$1.braceR)) {
      if (!first) {
        this.expect(types$1.comma);
        if (this.afterTrailingComma(types$1.braceR)) { break }
      } else { first = false; }

      nodes.push(this.parseExportSpecifier(exports$1));
    }
    return nodes
  };

  // Parses import declaration.

  pp$8.parseImport = function(node) {
    this.next();

    // import '...'
    if (this.type === types$1.string) {
      node.specifiers = empty$1;
      node.source = this.parseExprAtom();
    } else {
      node.specifiers = this.parseImportSpecifiers();
      this.expectContextual("from");
      node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected();
    }
    if (this.options.ecmaVersion >= 16)
      { node.attributes = this.parseWithClause(); }
    this.semicolon();
    return this.finishNode(node, "ImportDeclaration")
  };

  // Parses a comma-separated list of module imports.

  pp$8.parseImportSpecifier = function() {
    var node = this.startNode();
    node.imported = this.parseModuleExportName();

    if (this.eatContextual("as")) {
      node.local = this.parseIdent();
    } else {
      this.checkUnreserved(node.imported);
      node.local = node.imported;
    }
    this.checkLValSimple(node.local, BIND_LEXICAL);

    return this.finishNode(node, "ImportSpecifier")
  };

  pp$8.parseImportDefaultSpecifier = function() {
    // import defaultObj, { x, y as z } from '...'
    var node = this.startNode();
    node.local = this.parseIdent();
    this.checkLValSimple(node.local, BIND_LEXICAL);
    return this.finishNode(node, "ImportDefaultSpecifier")
  };

  pp$8.parseImportNamespaceSpecifier = function() {
    var node = this.startNode();
    this.next();
    this.expectContextual("as");
    node.local = this.parseIdent();
    this.checkLValSimple(node.local, BIND_LEXICAL);
    return this.finishNode(node, "ImportNamespaceSpecifier")
  };

  pp$8.parseImportSpecifiers = function() {
    var nodes = [], first = true;
    if (this.type === types$1.name) {
      nodes.push(this.parseImportDefaultSpecifier());
      if (!this.eat(types$1.comma)) { return nodes }
    }
    if (this.type === types$1.star) {
      nodes.push(this.parseImportNamespaceSpecifier());
      return nodes
    }
    this.expect(types$1.braceL);
    while (!this.eat(types$1.braceR)) {
      if (!first) {
        this.expect(types$1.comma);
        if (this.afterTrailingComma(types$1.braceR)) { break }
      } else { first = false; }

      nodes.push(this.parseImportSpecifier());
    }
    return nodes
  };

  pp$8.parseWithClause = function() {
    var nodes = [];
    if (!this.eat(types$1._with)) {
      return nodes
    }
    this.expect(types$1.braceL);
    var attributeKeys = {};
    var first = true;
    while (!this.eat(types$1.braceR)) {
      if (!first) {
        this.expect(types$1.comma);
        if (this.afterTrailingComma(types$1.braceR)) { break }
      } else { first = false; }

      var attr = this.parseImportAttribute();
      var keyName = attr.key.type === "Identifier" ? attr.key.name : attr.key.value;
      if (hasOwn(attributeKeys, keyName))
        { this.raiseRecoverable(attr.key.start, "Duplicate attribute key '" + keyName + "'"); }
      attributeKeys[keyName] = true;
      nodes.push(attr);
    }
    return nodes
  };

  pp$8.parseImportAttribute = function() {
    var node = this.startNode();
    node.key = this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
    this.expect(types$1.colon);
    if (this.type !== types$1.string) {
      this.unexpected();
    }
    node.value = this.parseExprAtom();
    return this.finishNode(node, "ImportAttribute")
  };

  pp$8.parseModuleExportName = function() {
    if (this.options.ecmaVersion >= 13 && this.type === types$1.string) {
      var stringLiteral = this.parseLiteral(this.value);
      if (loneSurrogate.test(stringLiteral.value)) {
        this.raise(stringLiteral.start, "An export name cannot include a lone surrogate.");
      }
      return stringLiteral
    }
    return this.parseIdent(true)
  };

  // Set `ExpressionStatement#directive` property for directive prologues.
  pp$8.adaptDirectivePrologue = function(statements) {
    for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {
      statements[i].directive = statements[i].expression.raw.slice(1, -1);
    }
  };
  pp$8.isDirectiveCandidate = function(statement) {
    return (
      this.options.ecmaVersion >= 5 &&
      statement.type === "ExpressionStatement" &&
      statement.expression.type === "Literal" &&
      typeof statement.expression.value === "string" &&
      // Reject parenthesized strings.
      (this.input[statement.start] === "\"" || this.input[statement.start] === "'")
    )
  };

  var pp$7 = Parser.prototype;

  // Convert existing expression atom to assignable pattern
  // if possible.

  pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) {
    if (this.options.ecmaVersion >= 6 && node) {
      switch (node.type) {
      case "Identifier":
        if (this.inAsync && node.name === "await")
          { this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); }
        break

      case "ObjectPattern":
      case "ArrayPattern":
      case "AssignmentPattern":
      case "RestElement":
        break

      case "ObjectExpression":
        node.type = "ObjectPattern";
        if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
        for (var i = 0, list = node.properties; i < list.length; i += 1) {
          var prop = list[i];

        this.toAssignable(prop, isBinding);
          // Early error:
          //   AssignmentRestProperty[Yield, Await] :
          //     `...` DestructuringAssignmentTarget[Yield, Await]
          //
          //   It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|.
          if (
            prop.type === "RestElement" &&
            (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")
          ) {
            this.raise(prop.argument.start, "Unexpected token");
          }
        }
        break

      case "Property":
        // AssignmentProperty has type === "Property"
        if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); }
        this.toAssignable(node.value, isBinding);
        break

      case "ArrayExpression":
        node.type = "ArrayPattern";
        if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
        this.toAssignableList(node.elements, isBinding);
        break

      case "SpreadElement":
        node.type = "RestElement";
        this.toAssignable(node.argument, isBinding);
        if (node.argument.type === "AssignmentPattern")
          { this.raise(node.argument.start, "Rest elements cannot have a default value"); }
        break

      case "AssignmentExpression":
        if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); }
        node.type = "AssignmentPattern";
        delete node.operator;
        this.toAssignable(node.left, isBinding);
        break

      case "ParenthesizedExpression":
        this.toAssignable(node.expression, isBinding, refDestructuringErrors);
        break

      case "ChainExpression":
        this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side");
        break

      case "MemberExpression":
        if (!isBinding) { break }

      default:
        this.raise(node.start, "Assigning to rvalue");
      }
    } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
    return node
  };

  // Convert list of expression atoms to binding list.

  pp$7.toAssignableList = function(exprList, isBinding) {
    var end = exprList.length;
    for (var i = 0; i < end; i++) {
      var elt = exprList[i];
      if (elt) { this.toAssignable(elt, isBinding); }
    }
    if (end) {
      var last = exprList[end - 1];
      if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier")
        { this.unexpected(last.argument.start); }
    }
    return exprList
  };

  // Parses spread element.

  pp$7.parseSpread = function(refDestructuringErrors) {
    var node = this.startNode();
    this.next();
    node.argument = this.parseMaybeAssign(false, refDestructuringErrors);
    return this.finishNode(node, "SpreadElement")
  };

  pp$7.parseRestBinding = function() {
    var node = this.startNode();
    this.next();

    // RestElement inside of a function parameter must be an identifier
    if (this.options.ecmaVersion === 6 && this.type !== types$1.name)
      { this.unexpected(); }

    node.argument = this.parseBindingAtom();

    return this.finishNode(node, "RestElement")
  };

  // Parses lvalue (assignable) atom.

  pp$7.parseBindingAtom = function() {
    if (this.options.ecmaVersion >= 6) {
      switch (this.type) {
      case types$1.bracketL:
        var node = this.startNode();
        this.next();
        node.elements = this.parseBindingList(types$1.bracketR, true, true);
        return this.finishNode(node, "ArrayPattern")

      case types$1.braceL:
        return this.parseObj(true)
      }
    }
    return this.parseIdent()
  };

  pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma, allowModifiers) {
    var elts = [], first = true;
    while (!this.eat(close)) {
      if (first) { first = false; }
      else { this.expect(types$1.comma); }
      if (allowEmpty && this.type === types$1.comma) {
        elts.push(null);
      } else if (allowTrailingComma && this.afterTrailingComma(close)) {
        break
      } else if (this.type === types$1.ellipsis) {
        var rest = this.parseRestBinding();
        this.parseBindingListItem(rest);
        elts.push(rest);
        if (this.type === types$1.comma) { this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"); }
        this.expect(close);
        break
      } else {
        elts.push(this.parseAssignableListItem(allowModifiers));
      }
    }
    return elts
  };

  pp$7.parseAssignableListItem = function(allowModifiers) {
    var elem = this.parseMaybeDefault(this.start, this.startLoc);
    this.parseBindingListItem(elem);
    return elem
  };

  pp$7.parseBindingListItem = function(param) {
    return param
  };

  // Parses assignment pattern around given atom if possible.

  pp$7.parseMaybeDefault = function(startPos, startLoc, left) {
    left = left || this.parseBindingAtom();
    if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { return left }
    var node = this.startNodeAt(startPos, startLoc);
    node.left = left;
    node.right = this.parseMaybeAssign();
    return this.finishNode(node, "AssignmentPattern")
  };

  // The following three functions all verify that a node is an lvalue —
  // something that can be bound, or assigned to. In order to do so, they perform
  // a variety of checks:
  //
  // - Check that none of the bound/assigned-to identifiers are reserved words.
  // - Record name declarations for bindings in the appropriate scope.
  // - Check duplicate argument names, if checkClashes is set.
  //
  // If a complex binding pattern is encountered (e.g., object and array
  // destructuring), the entire pattern is recursively checked.
  //
  // There are three versions of checkLVal*() appropriate for different
  // circumstances:
  //
  // - checkLValSimple() shall be used if the syntactic construct supports
  //   nothing other than identifiers and member expressions. Parenthesized
  //   expressions are also correctly handled. This is generally appropriate for
  //   constructs for which the spec says
  //
  //   > It is a Syntax Error if AssignmentTargetType of [the production] is not
  //   > simple.
  //
  //   It is also appropriate for checking if an identifier is valid and not
  //   defined elsewhere, like import declarations or function/class identifiers.
  //
  //   Examples where this is used include:
  //     a += …;
  //     import a from '…';
  //   where a is the node to be checked.
  //
  // - checkLValPattern() shall be used if the syntactic construct supports
  //   anything checkLValSimple() supports, as well as object and array
  //   destructuring patterns. This is generally appropriate for constructs for
  //   which the spec says
  //
  //   > It is a Syntax Error if [the production] is neither an ObjectLiteral nor
  //   > an ArrayLiteral and AssignmentTargetType of [the production] is not
  //   > simple.
  //
  //   Examples where this is used include:
  //     (a = …);
  //     const a = …;
  //     try { … } catch (a) { … }
  //   where a is the node to be checked.
  //
  // - checkLValInnerPattern() shall be used if the syntactic construct supports
  //   anything checkLValPattern() supports, as well as default assignment
  //   patterns, rest elements, and other constructs that may appear within an
  //   object or array destructuring pattern.
  //
  //   As a special case, function parameters also use checkLValInnerPattern(),
  //   as they also support defaults and rest constructs.
  //
  // These functions deliberately support both assignment and binding constructs,
  // as the logic for both is exceedingly similar. If the node is the target of
  // an assignment, then bindingType should be set to BIND_NONE. Otherwise, it
  // should be set to the appropriate BIND_* constant, like BIND_VAR or
  // BIND_LEXICAL.
  //
  // If the function is called with a non-BIND_NONE bindingType, then
  // additionally a checkClashes object may be specified to allow checking for
  // duplicate argument names. checkClashes is ignored if the provided construct
  // is an assignment (i.e., bindingType is BIND_NONE).

  pp$7.checkLValSimple = function(expr, bindingType, checkClashes) {
    if ( bindingType === void 0 ) bindingType = BIND_NONE;

    var isBind = bindingType !== BIND_NONE;

    switch (expr.type) {
    case "Identifier":
      if (this.strict && this.reservedWordsStrictBind.test(expr.name))
        { this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); }
      if (isBind) {
        if (bindingType === BIND_LEXICAL && expr.name === "let")
          { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); }
        if (checkClashes) {
          if (hasOwn(checkClashes, expr.name))
            { this.raiseRecoverable(expr.start, "Argument name clash"); }
          checkClashes[expr.name] = true;
        }
        if (bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); }
      }
      break

    case "ChainExpression":
      this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side");
      break

    case "MemberExpression":
      if (isBind) { this.raiseRecoverable(expr.start, "Binding member expression"); }
      break

    case "ParenthesizedExpression":
      if (isBind) { this.raiseRecoverable(expr.start, "Binding parenthesized expression"); }
      return this.checkLValSimple(expr.expression, bindingType, checkClashes)

    default:
      this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue");
    }
  };

  pp$7.checkLValPattern = function(expr, bindingType, checkClashes) {
    if ( bindingType === void 0 ) bindingType = BIND_NONE;

    switch (expr.type) {
    case "ObjectPattern":
      for (var i = 0, list = expr.properties; i < list.length; i += 1) {
        var prop = list[i];

      this.checkLValInnerPattern(prop, bindingType, checkClashes);
      }
      break

    case "ArrayPattern":
      for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) {
        var elem = list$1[i$1];

      if (elem) { this.checkLValInnerPattern(elem, bindingType, checkClashes); }
      }
      break

    default:
      this.checkLValSimple(expr, bindingType, checkClashes);
    }
  };

  pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) {
    if ( bindingType === void 0 ) bindingType = BIND_NONE;

    switch (expr.type) {
    case "Property":
      // AssignmentProperty has type === "Property"
      this.checkLValInnerPattern(expr.value, bindingType, checkClashes);
      break

    case "AssignmentPattern":
      this.checkLValPattern(expr.left, bindingType, checkClashes);
      break

    case "RestElement":
      this.checkLValPattern(expr.argument, bindingType, checkClashes);
      break

    default:
      this.checkLValPattern(expr, bindingType, checkClashes);
    }
  };

  // The algorithm used to determine whether a regexp can appear at a
  // given point in the program is loosely based on sweet.js' approach.
  // See https://github.com/mozilla/sweet.js/wiki/design


  var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) {
    this.token = token;
    this.isExpr = !!isExpr;
    this.preserveSpace = !!preserveSpace;
    this.override = override;
    this.generator = !!generator;
  };

  var types = {
    b_stat: new TokContext("{", false),
    b_expr: new TokContext("{", true),
    b_tmpl: new TokContext("${", false),
    p_stat: new TokContext("(", false),
    p_expr: new TokContext("(", true),
    q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }),
    f_stat: new TokContext("function", false),
    f_expr: new TokContext("function", true),
    f_expr_gen: new TokContext("function", true, false, null, true),
    f_gen: new TokContext("function", false, false, null, true)
  };

  var pp$6 = Parser.prototype;

  pp$6.initialContext = function() {
    return [types.b_stat]
  };

  pp$6.curContext = function() {
    return this.context[this.context.length - 1]
  };

  pp$6.braceIsBlock = function(prevType) {
    var parent = this.curContext();
    if (parent === types.f_expr || parent === types.f_stat)
      { return true }
    if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr))
      { return !parent.isExpr }

    // The check for `tt.name && exprAllowed` detects whether we are
    // after a `yield` or `of` construct. See the `updateContext` for
    // `tt.name`.
    if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed)
      { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }
    if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow)
      { return true }
    if (prevType === types$1.braceL)
      { return parent === types.b_stat }
    if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name)
      { return false }
    return !this.exprAllowed
  };

  pp$6.inGeneratorContext = function() {
    for (var i = this.context.length - 1; i >= 1; i--) {
      var context = this.context[i];
      if (context.token === "function")
        { return context.generator }
    }
    return false
  };

  pp$6.updateContext = function(prevType) {
    var update, type = this.type;
    if (type.keyword && prevType === types$1.dot)
      { this.exprAllowed = false; }
    else if (update = type.updateContext)
      { update.call(this, prevType); }
    else
      { this.exprAllowed = type.beforeExpr; }
  };

  // Used to handle edge cases when token context could not be inferred correctly during tokenization phase

  pp$6.overrideContext = function(tokenCtx) {
    if (this.curContext() !== tokenCtx) {
      this.context[this.context.length - 1] = tokenCtx;
    }
  };

  // Token-specific context update code

  types$1.parenR.updateContext = types$1.braceR.updateContext = function() {
    if (this.context.length === 1) {
      this.exprAllowed = true;
      return
    }
    var out = this.context.pop();
    if (out === types.b_stat && this.curContext().token === "function") {
      out = this.context.pop();
    }
    this.exprAllowed = !out.isExpr;
  };

  types$1.braceL.updateContext = function(prevType) {
    this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr);
    this.exprAllowed = true;
  };

  types$1.dollarBraceL.updateContext = function() {
    this.context.push(types.b_tmpl);
    this.exprAllowed = true;
  };

  types$1.parenL.updateContext = function(prevType) {
    var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while;
    this.context.push(statementParens ? types.p_stat : types.p_expr);
    this.exprAllowed = true;
  };

  types$1.incDec.updateContext = function() {
    // tokExprAllowed stays unchanged
  };

  types$1._function.updateContext = types$1._class.updateContext = function(prevType) {
    if (prevType.beforeExpr && prevType !== types$1._else &&
        !(prevType === types$1.semi && this.curContext() !== types.p_stat) &&
        !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&
        !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat))
      { this.context.push(types.f_expr); }
    else
      { this.context.push(types.f_stat); }
    this.exprAllowed = false;
  };

  types$1.colon.updateContext = function() {
    if (this.curContext().token === "function") { this.context.pop(); }
    this.exprAllowed = true;
  };

  types$1.backQuote.updateContext = function() {
    if (this.curContext() === types.q_tmpl)
      { this.context.pop(); }
    else
      { this.context.push(types.q_tmpl); }
    this.exprAllowed = false;
  };

  types$1.star.updateContext = function(prevType) {
    if (prevType === types$1._function) {
      var index = this.context.length - 1;
      if (this.context[index] === types.f_expr)
        { this.context[index] = types.f_expr_gen; }
      else
        { this.context[index] = types.f_gen; }
    }
    this.exprAllowed = true;
  };

  types$1.name.updateContext = function(prevType) {
    var allowed = false;
    if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) {
      if (this.value === "of" && !this.exprAllowed ||
          this.value === "yield" && this.inGeneratorContext())
        { allowed = true; }
    }
    this.exprAllowed = allowed;
  };

  // A recursive descent parser operates by defining functions for all
  // syntactic elements, and recursively calling those, each function
  // advancing the input stream and returning an AST node. Precedence
  // of constructs (for example, the fact that `!x[1]` means `!(x[1])`
  // instead of `(!x)[1]` is handled by the fact that the parser
  // function that parses unary prefix operators is called first, and
  // in turn calls the function that parses `[]` subscripts — that
  // way, it'll receive the node for `x[1]` already parsed, and wraps
  // *that* in the unary operator node.
  //
  // Acorn uses an [operator precedence parser][opp] to handle binary
  // operator precedence, because it is much more compact than using
  // the technique outlined above, which uses different, nesting
  // functions to specify precedence, for all of the ten binary
  // precedence levels that JavaScript defines.
  //
  // [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser


  var pp$5 = Parser.prototype;

  // Check if property name clashes with already added.
  // Object/class getters and setters are not allowed to clash —
  // either with each other or with an init property — and in
  // strict mode, init properties are also not allowed to be repeated.

  pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) {
    if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement")
      { return }
    if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand))
      { return }
    var key = prop.key;
    var name;
    switch (key.type) {
    case "Identifier": name = key.name; break
    case "Literal": name = String(key.value); break
    default: return
    }
    var kind = prop.kind;
    if (this.options.ecmaVersion >= 6) {
      if (name === "__proto__" && kind === "init") {
        if (propHash.proto) {
          if (refDestructuringErrors) {
            if (refDestructuringErrors.doubleProto < 0) {
              refDestructuringErrors.doubleProto = key.start;
            }
          } else {
            this.raiseRecoverable(key.start, "Redefinition of __proto__ property");
          }
        }
        propHash.proto = true;
      }
      return
    }
    name = "$" + name;
    var other = propHash[name];
    if (other) {
      var redefinition;
      if (kind === "init") {
        redefinition = this.strict && other.init || other.get || other.set;
      } else {
        redefinition = other.init || other[kind];
      }
      if (redefinition)
        { this.raiseRecoverable(key.start, "Redefinition of property"); }
    } else {
      other = propHash[name] = {
        init: false,
        get: false,
        set: false
      };
    }
    other[kind] = true;
  };

  // ### Expression parsing

  // These nest, from the most general expression type at the top to
  // 'atomic', nondivisible expression types at the bottom. Most of
  // the functions will simply let the function(s) below them parse,
  // and, *if* the syntactic construct they handle is present, wrap
  // the AST node that the inner parser gave them in another node.

  // Parse a full expression. The optional arguments are used to
  // forbid the `in` operator (in for loops initalization expressions)
  // and provide reference for storing '=' operator inside shorthand
  // property assignment in contexts where both object expression
  // and object pattern might appear (so it's possible to raise
  // delayed syntax error at correct position).

  pp$5.parseExpression = function(forInit, refDestructuringErrors) {
    var this$1$1 = this;

    return this.catchStackOverflow(function () {
      var startPos = this$1$1.start, startLoc = this$1$1.startLoc;
      var expr = this$1$1.parseMaybeAssign(forInit, refDestructuringErrors);
      if (this$1$1.type === types$1.comma) {
        var node = this$1$1.startNodeAt(startPos, startLoc);
        node.expressions = [expr];
        while (this$1$1.eat(types$1.comma)) { node.expressions.push(this$1$1.parseMaybeAssign(forInit, refDestructuringErrors)); }
        return this$1$1.finishNode(node, "SequenceExpression")
      }
      return expr
    })
  };

  // Parse an assignment expression. This includes applications of
  // operators like `+=`.

  pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) {
    if (this.isContextual("yield")) {
      if (this.inGenerator) { return this.parseYield(forInit) }
      // The tokenizer will assume an expression is allowed after
      // `yield`, but this isn't that kind of yield
      else { this.exprAllowed = false; }
    }

    var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1;
    if (refDestructuringErrors) {
      oldParenAssign = refDestructuringErrors.parenthesizedAssign;
      oldTrailingComma = refDestructuringErrors.trailingComma;
      oldDoubleProto = refDestructuringErrors.doubleProto;
      refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1;
    } else {
      refDestructuringErrors = new DestructuringErrors;
      ownDestructuringErrors = true;
    }

    var startPos = this.start, startLoc = this.startLoc;
    if (this.type === types$1.parenL || this.type === types$1.name) {
      this.potentialArrowAt = this.start;
      this.potentialArrowInForAwait = forInit === "await";
    }
    var left = this.parseMaybeConditional(forInit, refDestructuringErrors);
    if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); }
    if (this.type.isAssign) {
      var node = this.startNodeAt(startPos, startLoc);
      node.operator = this.value;
      if (this.type === types$1.eq)
        { left = this.toAssignable(left, false, refDestructuringErrors); }
      if (!ownDestructuringErrors) {
        refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1;
      }
      if (refDestructuringErrors.shorthandAssign >= left.start)
        { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly
      if (this.type === types$1.eq)
        { this.checkLValPattern(left); }
      else
        { this.checkLValSimple(left); }
      node.left = left;
      this.next();
      node.right = this.parseMaybeAssign(forInit);
      if (oldDoubleProto > -1) { refDestructuringErrors.doubleProto = oldDoubleProto; }
      return this.finishNode(node, "AssignmentExpression")
    } else {
      if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); }
    }
    if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; }
    if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; }
    return left
  };

  // Parse a ternary conditional (`?:`) operator.

  pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) {
    var startPos = this.start, startLoc = this.startLoc;
    var expr = this.parseExprOps(forInit, refDestructuringErrors);
    if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
    if (!(expr.type === "ArrowFunctionExpression" && expr.start === startPos) && this.eat(types$1.question)) {
      var node = this.startNodeAt(startPos, startLoc);
      node.test = expr;
      node.consequent = this.parseMaybeAssign();
      this.expect(types$1.colon);
      node.alternate = this.parseMaybeAssign(forInit);
      return this.finishNode(node, "ConditionalExpression")
    }
    return expr
  };

  // Start the precedence parser.

  pp$5.parseExprOps = function(forInit, refDestructuringErrors) {
    var startPos = this.start, startLoc = this.startLoc;
    var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit);
    if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
    return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit)
  };

  // Parse binary operators with the operator precedence parsing
  // algorithm. `left` is the left-hand side of the operator.
  // `minPrec` provides context that allows the function to stop and
  // defer further parser to one of its callers when it encounters an
  // operator that has a lower precedence than the set it is parsing.

  pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) {
    var prec = this.type.binop;
    if (prec != null && (!forInit || this.type !== types$1._in)) {
      if (prec > minPrec) {
        var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND;
        var coalesce = this.type === types$1.coalesce;
        if (coalesce) {
          // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions.
          // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error.
          prec = types$1.logicalAND.binop;
        }
        var op = this.value;
        this.next();
        var startPos = this.start, startLoc = this.startLoc;
        var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit);
        var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce);
        if ((logical && this.type === types$1.coalesce) || (coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND))) {
          this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");
        }
        return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit)
      }
    }
    return left
  };

  pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) {
    if (right.type === "PrivateIdentifier") { this.raise(right.start, "Private identifier can only be left side of binary expression"); }
    var node = this.startNodeAt(startPos, startLoc);
    node.left = left;
    node.operator = op;
    node.right = right;
    return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression")
  };

  // Parse unary operators, both prefix and postfix.

  pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) {
    var startPos = this.start, startLoc = this.startLoc, expr;
    if (this.isContextual("await") && this.canAwait) {
      expr = this.parseAwait(forInit);
      sawUnary = true;
    } else if (this.type.prefix) {
      var node = this.startNode(), update = this.type === types$1.incDec;
      node.operator = this.value;
      node.prefix = true;
      this.next();
      node.argument = this.parseMaybeUnary(null, true, update, forInit);
      this.checkExpressionErrors(refDestructuringErrors, true);
      if (update) { this.checkLValSimple(node.argument); }
      else if (this.strict && node.operator === "delete" && isLocalVariableAccess(node.argument))
        { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); }
      else if (node.operator === "delete" && isPrivateFieldAccess(node.argument))
        { this.raiseRecoverable(node.start, "Private fields can not be deleted"); }
      else { sawUnary = true; }
      expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
    } else if (!sawUnary && this.type === types$1.privateId) {
      if ((forInit || this.privateNameStack.length === 0) && this.options.checkPrivateFields) { this.unexpected(); }
      expr = this.parsePrivateIdent();
      // only could be private fields in 'in', such as #x in obj
      if (this.type !== types$1._in) { this.unexpected(); }
    } else {
      expr = this.parseExprSubscripts(refDestructuringErrors, forInit);
      if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
      while (this.type.postfix && !this.canInsertSemicolon()) {
        var node$1 = this.startNodeAt(startPos, startLoc);
        node$1.operator = this.value;
        node$1.prefix = false;
        node$1.argument = expr;
        this.checkLValSimple(expr);
        this.next();
        expr = this.finishNode(node$1, "UpdateExpression");
      }
    }

    if (!incDec && !(expr.type === "ArrowFunctionExpression" && expr.start === startPos) && this.eat(types$1.starstar)) {
      if (sawUnary)
        { this.unexpected(this.lastTokStart); }
      else
        { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false) }
    } else {
      return expr
    }
  };

  function isLocalVariableAccess(node) {
    return (
      node.type === "Identifier" ||
      node.type === "ParenthesizedExpression" && isLocalVariableAccess(node.expression)
    )
  }

  function isPrivateFieldAccess(node) {
    return (
      node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" ||
      node.type === "ChainExpression" && isPrivateFieldAccess(node.expression) ||
      node.type === "ParenthesizedExpression" && isPrivateFieldAccess(node.expression)
    )
  }

  // Parse call, dot, and `[]`-subscript expressions.

  pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) {
    var startPos = this.start, startLoc = this.startLoc;
    var expr = this.parseExprAtom(refDestructuringErrors, forInit);
    if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")")
      { return expr }
    var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit);
    if (refDestructuringErrors && result.type === "MemberExpression") {
      if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; }
      if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; }
      if (refDestructuringErrors.trailingComma >= result.start) { refDestructuringErrors.trailingComma = -1; }
    }
    return result
  };

  pp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) {
    var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" &&
        this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 &&
        this.potentialArrowAt === base.start;
    var optionalChained = false;

    while (true) {
      var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit);

      if (element.optional) { optionalChained = true; }
      if (element === base || element.type === "ArrowFunctionExpression") {
        if (optionalChained) {
          var chainNode = this.startNodeAt(startPos, startLoc);
          chainNode.expression = element;
          element = this.finishNode(chainNode, "ChainExpression");
        }
        return element
      }

      base = element;
    }
  };

  pp$5.shouldParseAsyncArrow = function() {
    return !this.canInsertSemicolon() && this.eat(types$1.arrow)
  };

  pp$5.parseSubscriptAsyncArrow = function(startPos, startLoc, exprList, forInit) {
    return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit)
  };

  pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) {
    var optionalSupported = this.options.ecmaVersion >= 11;
    var optional = optionalSupported && this.eat(types$1.questionDot);
    if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); }

    var computed = this.eat(types$1.bracketL);
    if (computed || (optional && this.type !== types$1.parenL && this.type !== types$1.backQuote) || this.eat(types$1.dot)) {
      var node = this.startNodeAt(startPos, startLoc);
      node.object = base;
      if (computed) {
        node.property = this.parseExpression();
        this.expect(types$1.bracketR);
      } else if (this.type === types$1.privateId && base.type !== "Super") {
        node.property = this.parsePrivateIdent();
      } else {
        node.property = this.parseIdent(this.options.allowReserved !== "never");
      }
      node.computed = !!computed;
      if (optionalSupported) {
        node.optional = optional;
      }
      base = this.finishNode(node, "MemberExpression");
    } else if (!noCalls && this.eat(types$1.parenL)) {
      var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
      this.yieldPos = 0;
      this.awaitPos = 0;
      this.awaitIdentPos = 0;
      var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors);
      if (maybeAsyncArrow && !optional && this.shouldParseAsyncArrow()) {
        this.checkPatternErrors(refDestructuringErrors, false);
        this.checkYieldAwaitInDefaultParams();
        if (this.awaitIdentPos > 0)
          { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); }
        this.yieldPos = oldYieldPos;
        this.awaitPos = oldAwaitPos;
        this.awaitIdentPos = oldAwaitIdentPos;
        return this.parseSubscriptAsyncArrow(startPos, startLoc, exprList, forInit)
      }
      this.checkExpressionErrors(refDestructuringErrors, true);
      this.yieldPos = oldYieldPos || this.yieldPos;
      this.awaitPos = oldAwaitPos || this.awaitPos;
      this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos;
      var node$1 = this.startNodeAt(startPos, startLoc);
      node$1.callee = base;
      node$1.arguments = exprList;
      if (optionalSupported) {
        node$1.optional = optional;
      }
      base = this.finishNode(node$1, "CallExpression");
    } else if (this.type === types$1.backQuote) {
      if (optional || optionalChained) {
        this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
      }
      var node$2 = this.startNodeAt(startPos, startLoc);
      node$2.tag = base;
      node$2.quasi = this.parseTemplate({isTagged: true});
      base = this.finishNode(node$2, "TaggedTemplateExpression");
    }
    return base
  };

  // Parse an atomic expression — either a single token that is an
  // expression, an expression started by a keyword like `function` or
  // `new`, or an expression wrapped in punctuation like `()`, `[]`,
  // or `{}`.

  pp$5.parseExprAtom = function(refDestructuringErrors, forInit, forNew) {
    // If a division operator appears in an expression position, the
    // tokenizer got confused, and we force it to read a regexp instead.
    if (this.type === types$1.slash) { this.readRegexp(); }

    var node, canBeArrow = this.potentialArrowAt === this.start;
    switch (this.type) {
    case types$1._super:
      if (!this.allowSuper)
        { this.raise(this.start, "'super' keyword outside a method"); }
      node = this.startNode();
      this.next();
      if (this.type === types$1.parenL && !this.allowDirectSuper)
        { this.raise(node.start, "super() call outside constructor of a subclass"); }
      // The `super` keyword can appear at below:
      // SuperProperty:
      //     super [ Expression ]
      //     super . IdentifierName
      // SuperCall:
      //     super ( Arguments )
      if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL)
        { this.unexpected(); }
      return this.finishNode(node, "Super")

    case types$1._this:
      node = this.startNode();
      this.next();
      return this.finishNode(node, "ThisExpression")

    case types$1.name:
      var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc;
      var id = this.parseIdent(false);
      if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types$1._function)) {
        this.overrideContext(types.f_expr);
        return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit)
      }
      if (canBeArrow && !this.canInsertSemicolon()) {
        if (this.eat(types$1.arrow))
          { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit) }
        if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types$1.name && !containsEsc &&
            (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) {
          id = this.parseIdent(false);
          if (this.canInsertSemicolon() || !this.eat(types$1.arrow))
            { this.unexpected(); }
          return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit)
        }
      }
      return id

    case types$1.regexp:
      var value = this.value;
      node = this.parseLiteral(value.value);
      node.regex = {pattern: value.pattern, flags: value.flags};
      return node

    case types$1.num: case types$1.string:
      return this.parseLiteral(this.value)

    case types$1._null: case types$1._true: case types$1._false:
      node = this.startNode();
      node.value = this.type === types$1._null ? null : this.type === types$1._true;
      node.raw = this.type.keyword;
      this.next();
      return this.finishNode(node, "Literal")

    case types$1.parenL:
      var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit);
      if (refDestructuringErrors) {
        if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr))
          { refDestructuringErrors.parenthesizedAssign = start; }
        if (refDestructuringErrors.parenthesizedBind < 0)
          { refDestructuringErrors.parenthesizedBind = start; }
      }
      return expr

    case types$1.bracketL:
      node = this.startNode();
      this.next();
      node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors);
      return this.finishNode(node, "ArrayE   xpression")

    case types$1.braceL:
      this.overrideContext(types.b_expr);
      return this.parseObj(false, refDestructuringErrors)

    case types$1._function:
      node = this.startNode();
      this.next();
      return this.parseFunction(node, 0)

    case types$1._class:
      return this.parseClass(this.startNode(), false)

    case types$1._new:
      return this.parseNew()

    case types$1.backQuote:
      return this.parseTemplate()

    case types$1._import:
      if (this.options.ecmaVersion >= 11) {
        return this.parseExprImport(forNew)
      } else {
        return this.unexpected()
      }

    default:
      return this.parseExprAtomDefault()
    }
  };

  pp$5.parseExprAtomDefault = function() {
    this.unexpected();
  };

  pp$5.parseExprImport = function(forNew) {
    var node = this.startNode();

    // Consume `import` as an identifier for `import.meta`.
    // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`.
    if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); }
    this.next();

    if (this.type === types$1.parenL && !forNew) {
      return this.parseDynamicImport(node)
    } else if (this.type === types$1.dot) {
      var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
      meta.name = "import";
      node.meta = this.finishNode(meta, "Identifier");
      return this.parseImportMeta(node)
    } else {
      this.unexpected();
    }
  };

  pp$5.parseDynamicImport = function(node) {
    this.next(); // skip `(`

    // Parse node.source.
    node.source = this.parseMaybeAssign();

    if (this.options.ecmaVersion >= 16) {
      if (!this.eat(types$1.parenR)) {
        this.expect(types$1.comma);
        if (!this.afterTrailingComma(types$1.parenR)) {
          node.options = this.parseMaybeAssign();
          if (!this.eat(types$1.parenR)) {
            this.expect(types$1.comma);
            if (!this.afterTrailingComma(types$1.parenR)) {
              this.unexpected();
            }
          }
        } else {
          node.options = null;
        }
      } else {
        node.options = null;
      }
    } else {
      // Verify ending.
      if (!this.eat(types$1.parenR)) {
        var errorPos = this.start;
        if (this.eat(types$1.comma) && this.eat(types$1.parenR)) {
          this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()");
        } else {
          this.unexpected(errorPos);
        }
      }
    }

    return this.finishNode(node, "ImportExpression")
  };

  pp$5.parseImportMeta = function(node) {
    this.next(); // skip `.`

    var containsEsc = this.containsEsc;
    node.property = this.parseIdent(true);

    if (node.property.name !== "meta")
      { this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); }
    if (containsEsc)
      { this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); }
    if (this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere)
      { this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); }

    return this.finishNode(node, "MetaProperty")
  };

  pp$5.parseLiteral = function(value) {
    var node = this.startNode();
    node.value = value;
    node.raw = this.input.slice(this.start, this.end);
    if (node.raw.charCodeAt(node.raw.length - 1) === 110)
      { node.bigint = node.value != null ? node.value.toString() : node.raw.slice(0, -1).replace(/_/g, ""); }
    this.next();
    return this.finishNode(node, "Literal")
  };

  pp$5.parseParenExpression = function() {
    this.expect(types$1.parenL);
    var val = this.parseExpression();
    this.expect(types$1.parenR);
    return val
  };

  pp$5.shouldParseArrow = function(exprList) {
    return !this.canInsertSemicolon()
  };

  pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) {
    var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8;
    if (this.options.ecmaVersion >= 6) {
      this.next();

      var innerStartPos = this.start, innerStartLoc = this.startLoc;
      var exprList = [], first = true, lastIsComma = false;
      var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart;
      this.yieldPos = 0;
      this.awaitPos = 0;
      // Do not save awaitIdentPos to allow checking awaits nested in parameters
      while (this.type !== types$1.parenR) {
        first ? first = false : this.expect(types$1.comma);
        if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) {
          lastIsComma = true;
          break
        } else if (this.type === types$1.ellipsis) {
          spreadStart = this.start;
          exprList.push(this.parseParenItem(this.parseRestBinding()));
          if (this.type === types$1.comma) {
            this.raiseRecoverable(
              this.start,
              "Comma is not permitted after the rest element"
            );
          }
          break
        } else {
          exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem));
        }
      }
      var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc;
      this.expect(types$1.parenR);

      if (canBeArrow && this.shouldParseArrow(exprList) && this.eat(types$1.arrow)) {
        this.checkPatternErrors(refDestructuringErrors, false);
        this.checkYieldAwaitInDefaultParams();
        this.yieldPos = oldYieldPos;
        this.awaitPos = oldAwaitPos;
        return this.parseParenArrowList(startPos, startLoc, exprList, forInit)
      }

      if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); }
      if (spreadStart) { this.unexpected(spreadStart); }
      this.checkExpressionErrors(refDestructuringErrors, true);
      this.yieldPos = oldYieldPos || this.yieldPos;
      this.awaitPos = oldAwaitPos || this.awaitPos;

      if (exprList.length > 1) {
        val = this.startNodeAt(innerStartPos, innerStartLoc);
        val.expressions = exprList;
        this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc);
      } else {
        val = exprList[0];
      }
    } else {
      val = this.parseParenExpression();
    }

    if (this.options.preserveParens) {
      var par = this.startNodeAt(startPos, startLoc);
      par.expression = val;
      return this.finishNode(par, "ParenthesizedExpression")
    } else {
      return val
    }
  };

  pp$5.parseParenItem = function(item) {
    return item
  };

  pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) {
    return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit)
  };

  // New's precedence is slightly tricky. It must allow its argument to
  // be a `[]` or dot subscript expression, but not a call — at least,
  // not without wrapping it in parentheses. Thus, it uses the noCalls
  // argument to parseSubscripts to prevent it from consuming the
  // argument list.

  var empty = [];

  pp$5.parseNew = function() {
    if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); }
    var node = this.startNode();
    this.next();
    if (this.options.ecmaVersion >= 6 && this.type === types$1.dot) {
      var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
      meta.name = "new";
      node.meta = this.finishNode(meta, "Identifier");
      this.next();
      var containsEsc = this.containsEsc;
      node.property = this.parseIdent(true);
      if (node.property.name !== "target")
        { this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); }
      if (containsEsc)
        { this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); }
      if (!this.allowNewDotTarget)
        { this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block"); }
      return this.finishNode(node, "MetaProperty")
    }
    var startPos = this.start, startLoc = this.startLoc;
    node.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), startPos, startLoc, true, false);
    if (node.callee.type === "Super")
      { this.raiseRecoverable(startPos, "Invalid use of 'super'"); }
    if (this.eat(types$1.parenL)) { node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); }
    else { node.arguments = empty; }
    return this.finishNode(node, "NewExpression")
  };

  // Parse template expression.

  pp$5.parseTemplateElement = function(ref) {
    var isTagged = ref.isTagged;

    var elem = this.startNode();
    if (this.type === types$1.invalidTemplate) {
      if (!isTagged) {
        this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal");
      }
      elem.value = {
        raw: this.value.replace(/\r\n?/g, "\n"),
        cooked: null
      };
    } else {
      elem.value = {
        raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"),
        cooked: this.value
      };
    }
    this.next();
    elem.tail = this.type === types$1.backQuote;
    return this.finishNode(elem, "TemplateElement")
  };

  pp$5.parseTemplate = function(ref) {
    if ( ref === void 0 ) ref = {};
    var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false;

    var node = this.startNode();
    this.next();
    node.expressions = [];
    var curElt = this.parseTemplateElement({isTagged: isTagged});
    node.quasis = [curElt];
    while (!curElt.tail) {
      if (this.type === types$1.eof) { this.raise(this.pos, "Unterminated template literal"); }
      this.expect(types$1.dollarBraceL);
      node.expressions.push(this.parseExpression());
      this.expect(types$1.braceR);
      node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged}));
    }
    this.next();
    return this.finishNode(node, "TemplateLiteral")
  };

  pp$5.isAsyncProp = function(prop) {
    return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" &&
      (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types$1.star)) &&
      !lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
  };

  // Parse an object literal or binding pattern.

  pp$5.parseObj = function(isPattern, refDestructuringErrors) {
    var node = this.startNode(), first = true, propHash = {};
    node.properties = [];
    this.next();
    while (!this.eat(types$1.braceR)) {
      if (!first) {
        this.expect(types$1.comma);
        if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { break }
      } else { first = false; }

      var prop = this.parseProperty(isPattern, refDestructuringErrors);
      if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); }
      node.properties.push(prop);
    }
    return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression")
  };

  pp$5.parseProperty = function(isPattern, refDestructuringErrors) {
    var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc;
    if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) {
      if (isPattern) {
        prop.argument = this.parseIdent(false);
        if (this.type === types$1.comma) {
          this.raiseRecoverable(this.start, "Comma is not permitted after the rest element");
        }
        return this.finishNode(prop, "RestElement")
      }
      // Parse argument.
      prop.argument = this.parseMaybeAssign(false, refDestructuringErrors);
      // To disallow trailing comma via `this.toAssignable()`.
      if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {
        refDestructuringErrors.trailingComma = this.start;
      }
      // Finish
      return this.finishNode(prop, "SpreadElement")
    }
    if (this.options.ecmaVersion >= 6) {
      prop.method = false;
      prop.shorthand = false;
      if (isPattern || refDestructuringErrors) {
        startPos = this.start;
        startLoc = this.startLoc;
      }
      if (!isPattern)
        { isGenerator = this.eat(types$1.star); }
    }
    var containsEsc = this.containsEsc;
    this.parsePropertyName(prop);
    if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) {
      isAsync = true;
      isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star);
      this.parsePropertyName(prop);
    } else {
      isAsync = false;
    }
    this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc);
    return this.finishNode(prop, "Property")
  };

  pp$5.parseGetterSetter = function(prop) {
    var kind = prop.key.name;
    this.parsePropertyName(prop);
    prop.value = this.parseMethod(false);
    prop.kind = kind;
    var paramCount = prop.kind === "get" ? 0 : 1;
    if (prop.value.params.length !== paramCount) {
      var start = prop.value.start;
      if (prop.kind === "get")
        { this.raiseRecoverable(start, "getter should have no params"); }
      else
        { this.raiseRecoverable(start, "setter should have exactly one param"); }
    } else {
      if (prop.kind === "set" && prop.value.params[0].type === "RestElement")
        { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); }
    }
  };

  pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {
    if ((isGenerator || isAsync) && this.type === types$1.colon)
      { this.unexpected(); }

    if (this.eat(types$1.colon)) {
      prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors);
      prop.kind = "init";
    } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) {
      if (isPattern) { this.unexpected(); }
      prop.method = true;
      prop.value = this.parseMethod(isGenerator, isAsync);
      prop.kind = "init";
    } else if (!isPattern && !containsEsc &&
               this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" &&
               (prop.key.name === "get" || prop.key.name === "set") &&
               (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) {
      if (isGenerator || isAsync) { this.unexpected(); }
      this.parseGetterSetter(prop);
    } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") {
      if (isGenerator || isAsync) { this.unexpected(); }
      this.checkUnreserved(prop.key);
      if (prop.key.name === "await" && !this.awaitIdentPos)
        { this.awaitIdentPos = startPos; }
      if (isPattern) {
        prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
      } else if (this.type === types$1.eq && refDestructuringErrors) {
        if (refDestructuringErrors.shorthandAssign < 0)
          { refDestructuringErrors.shorthandAssign = this.start; }
        prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
      } else {
        prop.value = this.copyNode(prop.key);
      }
      prop.kind = "init";
      prop.shorthand = true;
    } else { this.unexpected(); }
  };

  pp$5.parsePropertyName = function(prop) {
    if (this.options.ecmaVersion >= 6) {
      if (this.eat(types$1.bracketL)) {
        prop.computed = true;
        prop.key = this.parseMaybeAssign();
        this.expect(types$1.bracketR);
        return prop.key
      } else {
        prop.computed = false;
      }
    }
    return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never")
  };

  // Initialize empty function node.

  pp$5.initFunction = function(node) {
    node.id = null;
    if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; }
    if (this.options.ecmaVersion >= 8) { node.async = false; }
  };

  // Parse object or class method.

  pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {
    var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;

    this.initFunction(node);
    if (this.options.ecmaVersion >= 6)
      { node.generator = isGenerator; }
    if (this.options.ecmaVersion >= 8)
      { node.async = !!isAsync; }

    this.yieldPos = 0;
    this.awaitPos = 0;
    this.awaitIdentPos = 0;
    this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));

    this.expect(types$1.parenL);
    node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);
    this.checkYieldAwaitInDefaultParams();
    this.parseFunctionBody(node, false, true, false);

    this.yieldPos = oldYieldPos;
    this.awaitPos = oldAwaitPos;
    this.awaitIdentPos = oldAwaitIdentPos;
    return this.finishNode(node, "FunctionExpression")
  };

  // Parse arrow function expression with given parameters.

  pp$5.parseArrowExpression = function(node, params, isAsync, forInit) {
    var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;

    this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW);
    this.initFunction(node);
    if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; }

    this.yieldPos = 0;
    this.awaitPos = 0;
    this.awaitIdentPos = 0;

    node.params = this.toAssignableList(params, true);
    this.parseFunctionBody(node, true, false, forInit);

    this.yieldPos = oldYieldPos;
    this.awaitPos = oldAwaitPos;
    this.awaitIdentPos = oldAwaitIdentPos;
    return this.finishNode(node, "ArrowFunctionExpression")
  };

  // Parse function body and check parameters.

  pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {
    var isExpression = isArrowFunction && this.type !== types$1.braceL;
    var oldStrict = this.strict, useStrict = false;

    if (isExpression) {
      node.body = this.parseMaybeAssign(forInit);
      node.expression = true;
      this.checkParams(node, false);
    } else {
      var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params);
      if (!oldStrict || nonSimple) {
        useStrict = this.strictDirective(this.end);
        // If this is a strict mode function, verify that argument names
        // are not repeated, and it does not try to bind the words `eval`
        // or `arguments`.
        if (useStrict && nonSimple)
          { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); }
      }
      // Start a new scope with regard to labels and the `inFunction`
      // flag (restore them to their old value afterwards).
      var oldLabels = this.labels;
      this.labels = [];
      if (useStrict) { this.strict = true; }

      // Add the params to varDeclaredNames to ensure that an error is thrown
      // if a let/const declaration in the function clashes with one of the params.
      this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params));
      // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'
      if (this.strict && node.id) { this.checkLValSimple(node.id, BIND_OUTSIDE); }
      node.body = this.parseBlock(false, undefined, useStrict && !oldStrict);
      node.expression = false;
      this.adaptDirectivePrologue(node.body.body);
      this.labels = oldLabels;
    }
    this.exitScope();
  };

  pp$5.isSimpleParamList = function(params) {
    for (var i = 0, list = params; i < list.length; i += 1)
      {
      var param = list[i];

      if (param.type !== "Identifier") { return false
    } }
    return true
  };

  // Checks function params for various disallowed patterns such as using "eval"
  // or "arguments" and duplicate parameters.

  pp$5.checkParams = function(node, allowDuplicates) {
    var nameHash = Object.create(null);
    for (var i = 0, list = node.params; i < list.length; i += 1)
      {
      var param = list[i];

      this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash);
    }
  };

  // Parses a comma-separated list of expressions, and returns them as
  // an array. `close` is the token type that ends the list, and
  // `allowEmpty` can be turned on to allow subsequent commas with
  // nothing in between them to be parsed as `null` (which is needed
  // for array literals).

  pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {
    var elts = [], first = true;
    while (!this.eat(close)) {
      if (!first) {
        this.expect(types$1.comma);
        if (allowTrailingComma && this.afterTrailingComma(close)) { break }
      } else { first = false; }

      var elt = (void 0);
      if (allowEmpty && this.type === types$1.comma)
        { elt = null; }
      else if (this.type === types$1.ellipsis) {
        elt = this.parseSpread(refDestructuringErrors);
        if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0)
          { refDestructuringErrors.trailingComma = this.start; }
      } else {
        elt = this.parseMaybeAssign(false, refDestructuringErrors);
      }
      elts.push(elt);
    }
    return elts
  };

  pp$5.checkUnreserved = function(ref) {
    var start = ref.start;
    var end = ref.end;
    var name = ref.name;

    if (this.inGenerator && name === "yield")
      { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); }
    if (this.inAsync && name === "await")
      { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); }
    if (!(this.currentThisScope().flags & SCOPE_VAR) && name === "arguments")
      { this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer"); }
    if (this.inClassStaticBlock && (name === "arguments" || name === "await"))
      { this.raise(start, ("Cannot use " + name + " in class static initialization block")); }
    if (this.keywords.test(name))
      { this.raise(start, ("Unexpected keyword '" + name + "'")); }
    if (this.options.ecmaVersion < 6 &&
      this.input.slice(start, end).indexOf("\\") !== -1) { return }
    var re = this.strict ? this.reservedWordsStrict : this.reservedWords;
    if (re.test(name)) {
      if (!this.inAsync && name === "await")
        { this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); }
      this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved"));
    }
  };

  // Parse the next token as an identifier. If `liberal` is true (used
  // when parsing properties), it will also convert keywords into
  // identifiers.

  pp$5.parseIdent = function(liberal) {
    var node = this.parseIdentNode();
    this.next(!!liberal);
    this.finishNode(node, "Identifier");
    if (!liberal) {
      this.checkUnreserved(node);
      if (node.name === "await" && !this.awaitIdentPos)
        { this.awaitIdentPos = node.start; }
    }
    return node
  };

  pp$5.parseIdentNode = function() {
    var node = this.startNode();
    if (this.type === types$1.name) {
      node.name = this.value;
    } else if (this.type.keyword) {
      node.name = this.type.keyword;

      // To fix https://github.com/acornjs/acorn/issues/575
      // `class` and `function` keywords push new context into this.context.
      // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name.
      // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword
      if ((node.name === "class" || node.name === "function") &&
        (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {
        this.context.pop();
      }
      this.type = types$1.name;
    } else {
      this.unexpected();
    }
    return node
  };

  pp$5.parsePrivateIdent = function() {
    var node = this.startNode();
    if (this.type === types$1.privateId) {
      node.name = this.value;
    } else {
      this.unexpected();
    }
    this.next();
    this.finishNode(node, "PrivateIdentifier");

    // For validating existence
    if (this.options.checkPrivateFields) {
      if (this.privateNameStack.length === 0) {
        this.raise(node.start, ("Private field '#" + (node.name) + "' must be declared in an enclosing class"));
      } else {
        this.privateNameStack[this.privateNameStack.length - 1].used.push(node);
      }
    }

    return node
  };

  // Parses yield expression inside generator.

  pp$5.parseYield = function(forInit) {
    if (!this.yieldPos) { this.yieldPos = this.start; }

    var node = this.startNode();
    this.next();
    if (this.type === types$1.semi || this.canInsertSemicolon() || (this.type !== types$1.star && !this.type.startsExpr)) {
      node.delegate = false;
      node.argument = null;
    } else {
      node.delegate = this.eat(types$1.star);
      node.argument = this.parseMaybeAssign(forInit);
    }
    return this.finishNode(node, "YieldExpression")
  };

  pp$5.parseAwait = function(forInit) {
    if (!this.awaitPos) { this.awaitPos = this.start; }

    var node = this.startNode();
    this.next();
    node.argument = this.parseMaybeUnary(null, true, false, forInit);
    return this.finishNode(node, "AwaitExpression")
  };

  var pp$4 = Parser.prototype;

  // This function is used to raise exceptions on parse errors. It
  // takes an offset integer (into the current `input`) to indicate
  // the location of the error, attaches the position to the end
  // of the error message, and then raises a `SyntaxError` with that
  // message.

  pp$4.raise = function(pos, message) {
    var loc = getLineInfo(this.input, pos);
    message += " (" + loc.line + ":" + loc.column + ")";
    if (this.sourceFile) {
      message += " in " + this.sourceFile;
    }
    var err = new SyntaxError(message);
    err.pos = pos; err.loc = loc; err.raisedAt = this.pos;
    throw err
  };

  pp$4.raiseRecoverable = pp$4.raise;

  pp$4.curPosition = function() {
    if (this.options.locations) {
      return new Position(this.curLine, this.pos - this.lineStart)
    }
  };

  var pp$3 = Parser.prototype;

  var Scope = function Scope(flags) {
    this.flags = flags;
    // A list of var-declared names in the current lexical scope
    this.var = [];
    // A list of lexically-declared names in the current lexical scope
    this.lexical = [];
    // A list of lexically-declared FunctionDeclaration names in the current lexical scope
    this.functions = [];
  };

  // The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.

  pp$3.enterScope = function(flags) {
    this.scopeStack.push(new Scope(flags));
  };

  pp$3.exitScope = function() {
    this.scopeStack.pop();
  };

  // The spec says:
  // > At the top level of a function, or script, function declarations are
  // > treated like var declarations rather than like lexical declarations.
  pp$3.treatFunctionsAsVarInScope = function(scope) {
    return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP)
  };

  pp$3.declareName = function(name, bindingType, pos) {
    var redeclared = false;
    if (bindingType === BIND_LEXICAL) {
      var scope = this.currentScope();
      redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1;
      scope.lexical.push(name);
      if (this.inModule && (scope.flags & SCOPE_TOP))
        { delete this.undefinedExports[name]; }
    } else if (bindingType === BIND_SIMPLE_CATCH) {
      var scope$1 = this.currentScope();
      scope$1.lexical.push(name);
    } else if (bindingType === BIND_FUNCTION) {
      var scope$2 = this.currentScope();
      if (this.treatFunctionsAsVar)
        { redeclared = scope$2.lexical.indexOf(name) > -1; }
      else
        { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; }
      scope$2.functions.push(name);
    } else {
      for (var i = this.scopeStack.length - 1; i >= 0; --i) {
        var scope$3 = this.scopeStack[i];
        if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) ||
            !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) {
          redeclared = true;
          break
        }
        scope$3.var.push(name);
        if (this.inModule && (scope$3.flags & SCOPE_TOP))
          { delete this.undefinedExports[name]; }
        if (scope$3.flags & SCOPE_VAR) { break }
      }
    }
    if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); }
  };

  pp$3.checkLocalExport = function(id) {
    // scope.functions must be empty as Module code is always strict.
    if (this.scopeStack[0].lexical.indexOf(id.name) === -1 &&
        this.scopeStack[0].var.indexOf(id.name) === -1) {
      this.undefinedExports[id.name] = id;
    }
  };

  pp$3.currentScope = function() {
    return this.scopeStack[this.scopeStack.length - 1]
  };

  pp$3.currentVarScope = function() {
    for (var i = this.scopeStack.length - 1;; i--) {
      var scope = this.scopeStack[i];
      if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK)) { return scope }
    }
  };

  // Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`.
  pp$3.currentThisScope = function() {
    for (var i = this.scopeStack.length - 1;; i--) {
      var scope = this.scopeStack[i];
      if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK) &&
          !(scope.flags & SCOPE_ARROW)) { return scope }
    }
  };

  var Node = function Node(parser, pos, loc) {
    this.type = "";
    this.start = pos;
    this.end = 0;
    if (parser.options.locations)
      { this.loc = new SourceLocation(parser, loc); }
    if (parser.options.directSourceFile)
      { this.sourceFile = parser.options.directSourceFile; }
    if (parser.options.ranges)
      { this.range = [pos, 0]; }
  };

  // Start an AST node, attaching a start offset.

  var pp$2 = Parser.prototype;

  pp$2.startNode = function() {
    return new Node(this, this.start, this.startLoc)
  };

  pp$2.startNodeAt = function(pos, loc) {
    return new Node(this, pos, loc)
  };

  // Finish an AST node, adding `type` and `end` properties.

  function finishNodeAt(node, type, pos, loc) {
    node.type = type;
    node.end = pos;
    if (this.options.locations)
      { node.loc.end = loc; }
    if (this.options.ranges)
      { node.range[1] = pos; }
    return node
  }

  pp$2.finishNode = function(node, type) {
    return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc)
  };

  // Finish node at given position

  pp$2.finishNodeAt = function(node, type, pos, loc) {
    return finishNodeAt.call(this, node, type, pos, loc)
  };

  pp$2.copyNode = function(node) {
    var newNode = new Node(this, node.start, this.startLoc);
    for (var prop in node) { newNode[prop] = node[prop]; }
    return newNode
  };

  // This file was generated by "bin/generate-unicode-script-values.js". Do not modify manually!
  var scriptValuesAddedInUnicode = "Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz";

  // This file contains Unicode properties extracted from the ECMAScript specification.
  // The lists are extracted like so:
  // $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText)

  // #table-binary-unicode-properties
  var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS";
  var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic";
  var ecma11BinaryProperties = ecma10BinaryProperties;
  var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict";
  var ecma13BinaryProperties = ecma12BinaryProperties;
  var ecma14BinaryProperties = ecma13BinaryProperties;

  var unicodeBinaryProperties = {
    9: ecma9BinaryProperties,
    10: ecma10BinaryProperties,
    11: ecma11BinaryProperties,
    12: ecma12BinaryProperties,
    13: ecma13BinaryProperties,
    14: ecma14BinaryProperties
  };

  // #table-binary-unicode-properties-of-strings
  var ecma14BinaryPropertiesOfStrings = "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji";

  var unicodeBinaryPropertiesOfStrings = {
    9: "",
    10: "",
    11: "",
    12: "",
    13: "",
    14: ecma14BinaryPropertiesOfStrings
  };

  // #table-unicode-general-category-values
  var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu";

  // #table-unicode-script-values
  var ecma9ScriptValues = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb";
  var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd";
  var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
  var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
  var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith";
  var ecma14ScriptValues = ecma13ScriptValues + " " + scriptValuesAddedInUnicode;

  var unicodeScriptValues = {
    9: ecma9ScriptValues,
    10: ecma10ScriptValues,
    11: ecma11ScriptValues,
    12: ecma12ScriptValues,
    13: ecma13ScriptValues,
    14: ecma14ScriptValues
  };

  var data = {};
  function buildUnicodeData(ecmaVersion) {
    var d = data[ecmaVersion] = {
      binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues),
      binaryOfStrings: wordsRegexp(unicodeBinaryPropertiesOfStrings[ecmaVersion]),
      nonBinary: {
        General_Category: wordsRegexp(unicodeGeneralCategoryValues),
        Script: wordsRegexp(unicodeScriptValues[ecmaVersion])
      }
    };
    d.nonBinary.Script_Extensions = d.nonBinary.Script;

    d.nonBinary.gc = d.nonBinary.General_Category;
    d.nonBinary.sc = d.nonBinary.Script;
    d.nonBinary.scx = d.nonBinary.Script_Extensions;
  }

  for (var i = 0, list = [9, 10, 11, 12, 13, 14]; i < list.length; i += 1) {
    var ecmaVersion = list[i];

    buildUnicodeData(ecmaVersion);
  }

  var pp$1 = Parser.prototype;

  // Track disjunction structure to determine whether a duplicate
  // capture group name is allowed because it is in a separate branch.
  var BranchID = function BranchID(parent, base) {
    // Parent disjunction branch
    this.parent = parent;
    // Identifies this set of sibling branches
    this.base = base || this;
  };

  BranchID.prototype.separatedFrom = function separatedFrom (alt) {
    // A branch is separate from another branch if they or any of
    // their parents are siblings in a given disjunction
    for (var self = this; self; self = self.parent) {
      for (var other = alt; other; other = other.parent) {
        if (self.base === other.base && self !== other) { return true }
      }
    }
    return false
  };

  BranchID.prototype.sibling = function sibling () {
    return new BranchID(this.parent, this.base)
  };

  var RegExpValidationState = function RegExpValidationState(parser) {
    this.parser = parser;
    this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "") + (parser.options.ecmaVersion >= 15 ? "v" : "");
    this.unicodeProperties = data[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion];
    this.source = "";
    this.flags = "";
    this.start = 0;
    this.switchU = false;
    this.switchV = false;
    this.switchN = false;
    this.pos = 0;
    this.lastIntValue = 0;
    this.lastStringValue = "";
    this.lastAssertionIsQuantifiable = false;
    this.numCapturingParens = 0;
    this.maxBackReference = 0;
    this.groupNames = Object.create(null);
    this.backReferenceNames = [];
    this.branchID = null;
  };

  RegExpValidationState.prototype.reset = function reset (start, pattern, flags) {
    var unicodeSets = flags.indexOf("v") !== -1;
    var unicode = flags.indexOf("u") !== -1;
    this.start = start | 0;
    this.source = pattern + "";
    this.flags = flags;
    if (unicodeSets && this.parser.options.ecmaVersion >= 15) {
      this.switchU = true;
      this.switchV = true;
      this.switchN = true;
    } else {
      this.switchU = unicode && this.parser.options.ecmaVersion >= 6;
      this.switchV = false;
      this.switchN = unicode && this.parser.options.ecmaVersion >= 9;
    }
  };

  RegExpValidationState.prototype.raise = function raise (message) {
    this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message));
  };

  // If u flag is given, this returns the code point at the index (it combines a surrogate pair).
  // Otherwise, this returns the code unit of the index (can be a part of a surrogate pair).
  RegExpValidationState.prototype.at = function at (i, forceU) {
      if ( forceU === void 0 ) forceU = false;

    var s = this.source;
    var l = s.length;
    if (i >= l) {
      return -1
    }
    var c = s.charCodeAt(i);
    if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {
      return c
    }
    var next = s.charCodeAt(i + 1);
    return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c
  };

  RegExpValidationState.prototype.nextIndex = function nextIndex (i, forceU) {
      if ( forceU === void 0 ) forceU = false;

    var s = this.source;
    var l = s.length;
    if (i >= l) {
      return l
    }
    var c = s.charCodeAt(i), next;
    if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l ||
        (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) {
      return i + 1
    }
    return i + 2
  };

  RegExpValidationState.prototype.current = function current (forceU) {
      if ( forceU === void 0 ) forceU = false;

    return this.at(this.pos, forceU)
  };

  RegExpValidationState.prototype.lookahead = function lookahead (forceU) {
      if ( forceU === void 0 ) forceU = false;

    return this.at(this.nextIndex(this.pos, forceU), forceU)
  };

  RegExpValidationState.prototype.advance = function advance (forceU) {
      if ( forceU === void 0 ) forceU = false;

    this.pos = this.nextIndex(this.pos, forceU);
  };

  RegExpValidationState.prototype.eat = function eat (ch, forceU) {
      if ( forceU === void 0 ) forceU = false;

    if (this.current(forceU) === ch) {
      this.advance(forceU);
      return true
    }
    return false
  };

  RegExpValidationState.prototype.eatChars = function eatChars (chs, forceU) {
      if ( forceU === void 0 ) forceU = false;

    var pos = this.pos;
    for (var i = 0, list = chs; i < list.length; i += 1) {
      var ch = list[i];

        var current = this.at(pos, forceU);
      if (current === -1 || current !== ch) {
        return false
      }
      pos = this.nextIndex(pos, forceU);
    }
    this.pos = pos;
    return true
  };

  /**
   * Validate the flags part of a given RegExpLiteral.
   *
   * @param {RegExpValidationState} state The state to validate RegExp.
   * @returns {void}
   */
  pp$1.validateRegExpFlags = function(state) {
    var validFlags = state.validFlags;
    var flags = state.flags;

    var u = false;
    var v = false;

    for (var i = 0; i < flags.length; i++) {
      var flag = flags.charAt(i);
      if (validFlags.indexOf(flag) === -1) {
        this.raise(state.start, "Invalid regular expression flag");
      }
      if (flags.indexOf(flag, i + 1) > -1) {
        this.raise(state.start, "Duplicate regular expression flag");
      }
      if (flag === "u") { u = true; }
      if (flag === "v") { v = true; }
    }
    if (this.options.ecmaVersion >= 15 && u && v) {
      this.raise(state.start, "Invalid regular expression flag");
    }
  };

  function hasProp(obj) {
    for (var _ in obj) { return true }
    return false
  }

  /**
   * Validate the pattern part of a given RegExpLiteral.
   *
   * @param {RegExpValidationState} state The state to validate RegExp.
   * @returns {void}
   */
  pp$1.validateRegExpPattern = function(state) {
    this.regexp_pattern(state);

    // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of
    // parsing contains a |GroupName|, reparse with the goal symbol
    // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*
    // exception if _P_ did not conform to the grammar, if any elements of _P_
    // were not matched by the parse, or if any Early Error conditions exist.
    if (!state.switchN && this.options.ecmaVersion >= 9 && hasProp(state.groupNames)) {
      state.switchN = true;
      this.regexp_pattern(state);
    }
  };

  // https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern
  pp$1.regexp_pattern = function(state) {
    state.pos = 0;
    state.lastIntValue = 0;
    state.lastStringValue = "";
    state.lastAssertionIsQuantifiable = false;
    state.numCapturingParens = 0;
    state.maxBackReference = 0;
    state.groupNames = Object.create(null);
    state.backReferenceNames.length = 0;
    state.branchID = null;

    this.regexp_disjunction(state);

    if (state.pos !== state.source.length) {
      // Make the same messages as V8.
      if (state.eat(0x29 /* ) */)) {
        state.raise("Unmatched ')'");
      }
      if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) {
        state.raise("Lone quantifier brackets");
      }
    }
    if (state.maxBackReference > state.numCapturingParens) {
      state.raise("Invalid escape");
    }
    for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {
      var name = list[i];

      if (!state.groupNames[name]) {
        state.raise("Invalid named capture referenced");
      }
    }
  };

  // https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction
  pp$1.regexp_disjunction = function(state) {
    var trackDisjunction = this.options.ecmaVersion >= 16;
    if (trackDisjunction) { state.branchID = new BranchID(state.branchID, null); }
    this.regexp_alternative(state);
    while (state.eat(0x7C /* | */)) {
      if (trackDisjunction) { state.branchID = state.branchID.sibling(); }
      this.regexp_alternative(state);
    }
    if (trackDisjunction) { state.branchID = state.branchID.parent; }

    // Make the same message as V8.
    if (this.regexp_eatQuantifier(state, true)) {
      state.raise("Nothing to repeat");
    }
    if (state.eat(0x7B /* { */)) {
      state.raise("Lone quantifier brackets");
    }
  };

  // https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative
  pp$1.regexp_alternative = function(state) {
    while (state.pos < state.source.length && this.regexp_eatTerm(state)) {}
  };

  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term
  pp$1.regexp_eatTerm = function(state) {
    if (this.regexp_eatAssertion(state)) {
      // Handle `QuantifiableAssertion Quantifier` alternative.
      // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion
      // is a QuantifiableAssertion.
      if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) {
        // Make the same message as V8.
        if (state.switchU) {
          state.raise("Invalid quantifier");
        }
      }
      return true
    }

    if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) {
      this.regexp_eatQuantifier(state);
      return true
    }

    return false
  };

  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion
  pp$1.regexp_eatAssertion = function(state) {
    var start = state.pos;
    state.lastAssertionIsQuantifiable = false;

    // ^, $
    if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) {
      return true
    }

    // \b \B
    if (state.eat(0x5C /* \ */)) {
      if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) {
        return true
      }
      state.pos = start;
    }

    // Lookahead / Lookbehind
    if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) {
      var lookbehind = false;
      if (this.options.ecmaVersion >= 9) {
        lookbehind = state.eat(0x3C /* < */);
      }
      if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) {
        this.regexp_disjunction(state);
        if (!state.eat(0x29 /* ) */)) {
          state.raise("Unterminated group");
        }
        state.lastAssertionIsQuantifiable = !lookbehind;
        return true
      }
    }

    state.pos = start;
    return false
  };

  // https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier
  pp$1.regexp_eatQuantifier = function(state, noError) {
    if ( noError === void 0 ) noError = false;

    if (this.regexp_eatQuantifierPrefix(state, noError)) {
      state.eat(0x3F /* ? */);
      return true
    }
    return false
  };

  // https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix
  pp$1.regexp_eatQuantifierPrefix = function(state, noError) {
    return (
      state.eat(0x2A /* * */) ||
      state.eat(0x2B /* + */) ||
      state.eat(0x3F /* ? */) ||
      this.regexp_eatBracedQuantifier(state, noError)
    )
  };
  pp$1.regexp_eatBracedQuantifier = function(state, noError) {
    var start = state.pos;
    if (state.eat(0x7B /* { */)) {
      var min = 0, max = -1;
      if (this.regexp_eatDecimalDigits(state)) {
        min = state.lastIntValue;
        if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) {
          max = state.lastIntValue;
        }
        if (state.eat(0x7D /* } */)) {
          // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term
          if (max !== -1 && max < min && !noError) {
            state.raise("numbers out of order in {} quantifier");
          }
          return true
        }
      }
      if (state.switchU && !noError) {
        state.raise("Incomplete quantifier");
      }
      state.pos = start;
    }
    return false
  };

  // https://www.ecma-international.org/ecma-262/8.0/#prod-Atom
  pp$1.regexp_eatAtom = function(state) {
    return (
      this.regexp_eatPatternCharacters(state) ||
      state.eat(0x2E /* . */) ||
      this.regexp_eatReverseSolidusAtomEscape(state) ||
      this.regexp_eatCharacterClass(state) ||
      this.regexp_eatUncapturingGroup(state) ||
      this.regexp_eatCapturingGroup(state)
    )
  };
  pp$1.regexp_eatReverseSolidusAtomEscape = function(state) {
    var start = state.pos;
    if (state.eat(0x5C /* \ */)) {
      if (this.regexp_eatAtomEscape(state)) {
        return true
      }
      state.pos = start;
    }
    return false
  };
  pp$1.regexp_eatUncapturingGroup = function(state) {
    var start = state.pos;
    if (state.eat(0x28 /* ( */)) {
      if (state.eat(0x3F /* ? */)) {
        if (this.options.ecmaVersion >= 16) {
          var addModifiers = this.regexp_eatModifiers(state);
          var hasHyphen = state.eat(0x2D /* - */);
          if (addModifiers || hasHyphen) {
            for (var i = 0; i < addModifiers.length; i++) {
              var modifier = addModifiers.charAt(i);
              if (addModifiers.indexOf(modifier, i + 1) > -1) {
                state.raise("Duplicate regular expression modifiers");
              }
            }
            if (hasHyphen) {
              var removeModifiers = this.regexp_eatModifiers(state);
              if (!addModifiers && !removeModifiers && state.current() === 0x3A /* : */) {
                state.raise("Invalid regular expression modifiers");
              }
              for (var i$1 = 0; i$1 < removeModifiers.length; i$1++) {
                var modifier$1 = removeModifiers.charAt(i$1);
                if (
                  removeModifiers.indexOf(modifier$1, i$1 + 1) > -1 ||
                  addModifiers.indexOf(modifier$1) > -1
                ) {
                  state.raise("Duplicate regular expression modifiers");
                }
              }
            }
          }
        }
        if (state.eat(0x3A /* : */)) {
          this.regexp_disjunction(state);
          if (state.eat(0x29 /* ) */)) {
            return true
          }
          state.raise("Unterminated group");
        }
      }
      state.pos = start;
    }
    return false
  };
  pp$1.regexp_eatCapturingGroup = function(state) {
    if (state.eat(0x28 /* ( */)) {
      if (this.options.ecmaVersion >= 9) {
        this.regexp_groupSpecifier(state);
      } else if (state.current() === 0x3F /* ? */) {
        state.raise("Invalid group");
      }
      this.regexp_disjunction(state);
      if (state.eat(0x29 /* ) */)) {
        state.numCapturingParens += 1;
        return true
      }
      state.raise("Unterminated group");
    }
    return false
  };
  // RegularExpressionModifiers ::
  //   [empty]
  //   RegularExpressionModifiers RegularExpressionModifier
  pp$1.regexp_eatModifiers = function(state) {
    var modifiers = "";
    var ch = 0;
    while ((ch = state.current()) !== -1 && isRegularExpressionModifier(ch)) {
      modifiers += codePointToString(ch);
      state.advance();
    }
    return modifiers
  };
  // RegularExpressionModifier :: one of
  //   `i` `m` `s`
  function isRegularExpressionModifier(ch) {
    return ch === 0x69 /* i */ || ch === 0x6d /* m */ || ch === 0x73 /* s */
  }

  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom
  pp$1.regexp_eatExtendedAtom = function(state) {
    return (
      state.eat(0x2E /* . */) ||
      this.regexp_eatReverseSolidusAtomEscape(state) ||
      this.regexp_eatCharacterClass(state) ||
      this.regexp_eatUncapturingGroup(state) ||
      this.regexp_eatCapturingGroup(state) ||
      this.regexp_eatInvalidBracedQuantifier(state) ||
      this.regexp_eatExtendedPatternCharacter(state)
    )
  };

  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier
  pp$1.regexp_eatInvalidBracedQuantifier = function(state) {
    if (this.regexp_eatBracedQuantifier(state, true)) {
      state.raise("Nothing to repeat");
    }
    return false
  };

  // https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter
  pp$1.regexp_eatSyntaxCharacter = function(state) {
    var ch = state.current();
    if (isSyntaxCharacter(ch)) {
      state.lastIntValue = ch;
      state.advance();
      return true
    }
    return false
  };
  function isSyntaxCharacter(ch) {
    return (
      ch === 0x24 /* $ */ ||
      ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ ||
      ch === 0x2E /* . */ ||
      ch === 0x3F /* ? */ ||
      ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ ||
      ch >= 0x7B /* { */ && ch <= 0x7D /* } */
    )
  }

  // https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter
  // But eat eager.
  pp$1.regexp_eatPatternCharacters = function(state) {
    var start = state.pos;
    var ch = 0;
    while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) {
      state.advance();
    }
    return state.pos !== start
  };

  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter
  pp$1.regexp_eatExtendedPatternCharacter = function(state) {
    var ch = state.current();
    if (
      ch !== -1 &&
      ch !== 0x24 /* $ */ &&
      !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) &&
      ch !== 0x2E /* . */ &&
      ch !== 0x3F /* ? */ &&
      ch !== 0x5B /* [ */ &&
      ch !== 0x5E /* ^ */ &&
      ch !== 0x7C /* | */
    ) {
      state.advance();
      return true
    }
    return false
  };

  // GroupSpecifier ::
  //   [empty]
  //   `?` GroupName
  pp$1.regexp_groupSpecifier = function(state) {
    if (state.eat(0x3F /* ? */)) {
      if (!this.regexp_eatGroupName(state)) { state.raise("Invalid group"); }
      var trackDisjunction = this.options.ecmaVersion >= 16;
      var known = state.groupNames[state.lastStringValue];
      if (known) {
        if (trackDisjunction) {
          for (var i = 0, list = known; i < list.length; i += 1) {
            var altID = list[i];

            if (!altID.separatedFrom(state.branchID))
              { state.raise("Duplicate capture group name"); }
          }
        } else {
          state.raise("Duplicate capture group name");
        }
      }
      if (trackDisjunction) {
        (known || (state.groupNames[state.lastStringValue] = [])).push(state.branchID);
      } else {
        state.groupNames[state.lastStringValue] = true;
      }
    }
  };

  // GroupName ::
  //   `<` RegExpIdentifierName `>`
  // Note: this updates `state.lastStringValue` property with the eaten name.
  pp$1.regexp_eatGroupName = function(state) {
    state.lastStringValue = "";
    if (state.eat(0x3C /* < */)) {
      if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) {
        return true
      }
      state.raise("Invalid capture group name");
    }
    return false
  };

  // RegExpIdentifierName ::
  //   RegExpIdentifierStart
  //   RegExpIdentifierName RegExpIdentifierPart
  // Note: this updates `state.lastStringValue` property with the eaten name.
  pp$1.regexp_eatRegExpIdentifierName = function(state) {
    state.lastStringValue = "";
    if (this.regexp_eatRegExpIdentifierStart(state)) {
      state.lastStringValue += codePointToString(state.lastIntValue);
      while (this.regexp_eatRegExpIdentifierPart(state)) {
        state.lastStringValue += codePointToString(state.lastIntValue);
      }
      return true
    }
    return false
  };

  // RegExpIdentifierStart ::
  //   UnicodeIDStart
  //   `$`
  //   `_`
  //   `\` RegExpUnicodeEscapeSequence[+U]
  pp$1.regexp_eatRegExpIdentifierStart = function(state) {
    var start = state.pos;
    var forceU = this.options.ecmaVersion >= 11;
    var ch = state.current(forceU);
    state.advance(forceU);

    if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
      ch = state.lastIntValue;
    }
    if (isRegExpIdentifierStart(ch)) {
      state.lastIntValue = ch;
      return true
    }

    state.pos = start;
    return false
  };
  function isRegExpIdentifierStart(ch) {
    return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */
  }

  // RegExpIdentifierPart ::
  //   UnicodeIDContinue
  //   `$`
  //   `_`
  //   `\` RegExpUnicodeEscapeSequence[+U]
  //   <ZWNJ>
  //   <ZWJ>
  pp$1.regexp_eatRegExpIdentifierPart = function(state) {
    var start = state.pos;
    var forceU = this.options.ecmaVersion >= 11;
    var ch = state.current(forceU);
    state.advance(forceU);

    if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
      ch = state.lastIntValue;
    }
    if (isRegExpIdentifierPart(ch)) {
      state.lastIntValue = ch;
      return true
    }

    state.pos = start;
    return false
  };
  function isRegExpIdentifierPart(ch) {
    return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* <ZWNJ> */ || ch === 0x200D /* <ZWJ> */
  }

  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape
  pp$1.regexp_eatAtomEscape = function(state) {
    if (
      this.regexp_eatBackReference(state) ||
      this.regexp_eatCharacterClassEscape(state) ||
      this.regexp_eatCharacterEscape(state) ||
      (state.switchN && this.regexp_eatKGroupName(state))
    ) {
      return true
    }
    if (state.switchU) {
      // Make the same message as V8.
      if (state.current() === 0x63 /* c */) {
        state.raise("Invalid unicode escape");
      }
      state.raise("Invalid escape");
    }
    return false
  };
  pp$1.regexp_eatBackReference = function(state) {
    var start = state.pos;
    if (this.regexp_eatDecimalEscape(state)) {
      var n = state.lastIntValue;
      if (state.switchU) {
        // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape
        if (n > state.maxBackReference) {
          state.maxBackReference = n;
        }
        return true
      }
      if (n <= state.numCapturingParens) {
        return true
      }
      state.pos = start;
    }
    return false
  };
  pp$1.regexp_eatKGroupName = function(state) {
    if (state.eat(0x6B /* k */)) {
      if (this.regexp_eatGroupName(state)) {
        state.backReferenceNames.push(state.lastStringValue);
        return true
      }
      state.raise("Invalid named reference");
    }
    return false
  };

  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape
  pp$1.regexp_eatCharacterEscape = function(state) {
    return (
      this.regexp_eatControlEscape(state) ||
      this.regexp_eatCControlLetter(state) ||
      this.regexp_eatZero(state) ||
      this.regexp_eatHexEscapeSequence(state) ||
      this.regexp_eatRegExpUnicodeEscapeSequence(state, false) ||
      (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) ||
      this.regexp_eatIdentityEscape(state)
    )
  };
  pp$1.regexp_eatCControlLetter = function(state) {
    var start = state.pos;
    if (state.eat(0x63 /* c */)) {
      if (this.regexp_eatControlLetter(state)) {
        return true
      }
      state.pos = start;
    }
    return false
  };
  pp$1.regexp_eatZero = function(state) {
    if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) {
      state.lastIntValue = 0;
      state.advance();
      return true
    }
    return false
  };

  // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape
  pp$1.regexp_eatControlEscape = function(state) {
    var ch = state.current();
    if (ch === 0x74 /* t */) {
      state.lastIntValue = 0x09; /* \t */
      state.advance();
      return true
    }
    if (ch === 0x6E /* n */) {
      state.lastIntValue = 0x0A; /* \n */
      state.advance();
      return true
    }
    if (ch === 0x76 /* v */) {
      state.lastIntValue = 0x0B; /* \v */
      state.advance();
      return true
    }
    if (ch === 0x66 /* f */) {
      state.lastIntValue = 0x0C; /* \f */
      state.advance();
      return true
    }
    if (ch === 0x72 /* r */) {
      state.lastIntValue = 0x0D; /* \r */
      state.advance();
      return true
    }
    return false
  };

  // https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter
  pp$1.regexp_eatControlLetter = function(state) {
    var ch = state.current();
    if (isControlLetter(ch)) {
      state.lastIntValue = ch % 0x20;
      state.advance();
      return true
    }
    return false
  };
  function isControlLetter(ch) {
    return (
      (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) ||
      (ch >= 0x61 /* a */ && ch <= 0x7A /* z */)
    )
  }

  // https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence
  pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) {
    if ( forceU === void 0 ) forceU = false;

    var start = state.pos;
    var switchU = forceU || state.switchU;

    if (state.eat(0x75 /* u */)) {
      if (this.regexp_eatFixedHexDigits(state, 4)) {
        var lead = state.lastIntValue;
        if (switchU && lead >= 0xD800 && lead <= 0xDBFF) {
          var leadSurrogateEnd = state.pos;
          if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) {
            var trail = state.lastIntValue;
            if (trail >= 0xDC00 && trail <= 0xDFFF) {
              state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;
              return true
            }
          }
          state.pos = leadSurrogateEnd;
          state.lastIntValue = lead;
        }
        return true
      }
      if (
        switchU &&
        state.eat(0x7B /* { */) &&
        this.regexp_eatHexDigits(state) &&
        state.eat(0x7D /* } */) &&
        isValidUnicode(state.lastIntValue)
      ) {
        return true
      }
      if (switchU) {
        state.raise("Invalid unicode escape");
      }
      state.pos = start;
    }

    return false
  };
  function isValidUnicode(ch) {
    return ch >= 0 && ch <= 0x10FFFF
  }

  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape
  pp$1.regexp_eatIdentityEscape = function(state) {
    if (state.switchU) {
      if (this.regexp_eatSyntaxCharacter(state)) {
        return true
      }
      if (state.eat(0x2F /* / */)) {
        state.lastIntValue = 0x2F; /* / */
        return true
      }
      return false
    }

    var ch = state.current();
    if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) {
      state.lastIntValue = ch;
      state.advance();
      return true
    }

    return false
  };

  // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape
  pp$1.regexp_eatDecimalEscape = function(state) {
    state.lastIntValue = 0;
    var ch = state.current();
    if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) {
      do {
        state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);
        staBte.advance();
      } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */)
      return true
    }
    return false
  };

  // Return values used by character set parsing methods, needed to
  // forbid negation of sets that can match strings.
  var CharSetNone = 0; // Nothing parsed
  var CharSetOk = 1; // Construct parsed, cannot contain strings
  var CharSetString = 2; // Construct parsed, can contain strings

  // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape
  pp$1.regexp_eatCharacterClassEscape = function(state) {
    var ch = state.current();

    if (isCharacterClassEscape(ch)) {
      state.lastIntValue = -1;
      state.advance();
      return CharSetOk
    }

    var negate = false;
    if (
      state.switchU &&
      this.options.ecmaVersion >= 9 &&
      ((negate = ch === 0x50 /* P */) || ch === 0x70 /* p */)
    ) {
      state.lastIntValue = -1;
      state.advance();
      var result;
      if (
        state.eat(0x7B /* { */) &&
        (result = this.regexp_eatUnicodePropertyValueExpression(state)) &&
        state.eat(0x7D /* } */)
      ) {
        if (negate && result === CharSetString) { state.raise("Invalid property name"); }
        return result
      }
      state.raise("Invalid property name");
    }

    return CharSetNone
  };

  function isCharacterClassEscape(ch) {
    return (
      ch === 0x64 /* d */ ||
      ch === 0x44 /* D */ ||
      ch === 0x73 /* s */ ||
      ch === 0x53 /* S */ ||
      ch === 0x77 /* w */ ||
      ch === 0x57 /* W */
    )
  }

  // UnicodePropertyValueExpression ::
  //   UnicodePropertyName `=` UnicodePropertyValue
  //   LoneUnicodePropertyNameOrValue
  pp$1.regexp_eatUnicodePropertyValueExpression = function(state) {
    var start = state.pos;

    // UnicodePropertyName `=` UnicodePropertyValue
    if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) {
      var name = state.lastStringValue;
      if (this.regexp_eatUnicodePropertyValue(state)) {
        var value = state.lastStringValue;
        this.regexp_validateUnicodePropertyNameAndValue(state, name, value);
        return CharSetOk
      }
    }
    state.pos = start;

    // LoneUnicodePropertyNameOrValue
    if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {
      var nameOrValue = state.lastStringValue;
      return this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue)
    }
    return CharSetNone
  };

  pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {
    if (!hasOwn(state.unicodeProperties.nonBinary, name))
      { state.raise("Invalid property name"); }
    if (!state.unicodeProperties.nonBinary[name].test(value))
      { state.raise("Invalid property value"); }
  };

  pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {
    if (state.unicodeProperties.binary.test(nameOrValue)) { return CharSetOk }
    if (state.switchV && state.unicodeProperties.binaryOfStrings.test(nameOrValue)) { return CharSetString }
    state.raise("Invalid property name");
  };

  // UnicodePropertyName ::
  //   UnicodePropertyNameCharacters
  pp$1.regexp_eatUnicodePropertyName = function(state) {
    var ch = 0;
    state.lastStringValue = "";
    while (isUnicodePropertyNameCharacter(ch = state.current())) {
      state.lastStringValue += codePointToString(ch);
      state.advance();
    }
    return state.lastStringValue !== ""
  };

  function isUnicodePropertyNameCharacter(ch) {
    return isControlLetter(ch) || ch === 0x5F /* _ */
  }

  // UnicodePropertyValue ::
  //   UnicodePropertyValueCharacters
  pp$1.regexp_eatUnicodePropertyValue = function(state) {
    var ch = 0;
    state.lastStringValue = "";
    while (isUnicodePropertyValueCharacter(ch = state.current())) {
      state.lastStringValue += codePointToString(ch);
      state.advance();
    }
    return state.lastStringValue !== ""
  };
  function isUnicodePropertyValueCharacter(ch) {
    return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch)
  }

  // LoneUnicodePropertyNameOrValue ::
  //   UnicodePropertyValueCharacters
  pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {
    return this.regexp_eatUnicodePropertyValue(state)
  };

  // https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass
  pp$1.regexp_eatCharacterClass = function(state) {
    if (state.eat(0x5B /* [ */)) {
      var negate = state.eat(0x5E /* ^ */);
      var result = this.regexp_classContents(state);
      if (!state.eat(0x5D /* ] */))
        { state.raise("Unterminated character class"); }
      if (negate && result === CharSetString)
        { state.raise("Negated character class may contain strings"); }
      return true
    }
    return false
  };

  // https://tc39.es/ecma262/#prod-ClassContents
  // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges
  pp$1.regexp_classContents = function(state) {
    if (state.current() === 0x5D /* ] */) { return CharSetOk }
    if (state.switchV) { return this.regexp_classSetExpression(state) }
    this.regexp_nonEmptyClassRanges(state);
    return CharSetOk
  };

  // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges
  // https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash
  pp$1.regexp_nonEmptyClassRanges = function(state) {
    while (this.regexp_eatClassAtom(state)) {
      var left = state.lastIntValue;
      if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) {
        var right = state.lastIntValue;
        if (state.switchU && (left === -1 || right === -1)) {
          state.raise("Invalid character class");
        }
        if (left !== -1 && right !== -1 && left > right) {
          state.raise("Range out of order in character class");
        }
      }
    }
  };

  // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom
  // https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash
  pp$1.regexp_eatClassAtom = function(state) {
    var start = state.pos;

    if (state.eat(0x5C /* \ */)) {
      if (this.regexp_eatClassEscape(state)) {
        return true
      }
      if (state.switchU) {
        // Make the same message as V8.
        var ch$1 = state.current();
        if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) {
          state.raise("Invalid class escape");
        }
        state.raise("Invalid escape");
      }
      state.pos = start;
    }

    var ch = state.current();
    if (ch !== 0x5D /* ] */) {
      state.lastIntValue = ch;
      state.advance();
      return true
    }

    return false
  };

  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape
  pp$1.regexp_eatClassEscape = function(state) {
    var start = state.pos;

    if (state.eat(0x62 /* b */)) {
      state.lastIntValue = 0x08; /* <BS> */
      return true
    }

    if (state.switchU && state.eat(0x2D /* - */)) {
      state.lastIntValue = 0x2D; /* - */
      return true
    }

    if (!state.switchU && state.eat(0x63 /* c */)) {
      if (this.regexp_eatClassControlLetter(state)) {
        return true
      }
      state.pos = start;
    }

    return (
      this.regexp_eatCharacterClassEscape(state) ||
      this.regexp_eatCharacterEscape(state)
    )
  };

  // https://tc39.es/ecma262/#prod-ClassSetExpression
  // https://tc39.es/ecma262/#prod-ClassUnion
  // https://tc39.es/ecma262/#prod-ClassIntersection
  // https://tc39.es/ecma262/#prod-ClassSubtraction
  pp$1.regexp_classSetExpression = function(state) {
    var result = CharSetOk, subResult;
    if (this.regexp_eatClassSetRange(state)) ; else if (subResult = this.regexp_eatClassSetOperand(state)) {
      if (subResult === CharSetString) { result = CharSetString; }
      // https://tc39.es/ecma262/#prod-ClassIntersection
      var start = state.pos;
      while (state.eatChars([0x26, 0x26] /* && */)) {
        if (
          state.current() !== 0x26 /* & */ &&
          (subResult = this.regexp_eatClassSetOperand(state))
        ) {
          if (subResult !== CharSetString) { result = CharSetOk; }
          continue
        }
        state.raise("Invalid character in character class");
      }
      if (start !== state.pos) { return result }
      // https://tc39.es/ecma262/#prod-ClassSubtraction
      while (state.eatChars([0x2D, 0x2D] /* -- */)) {
        if (this.regexp_eatClassSetOperand(state)) { continue }
        state.raise("Invalid character in character class");
      }
      if (start !== state.pos) { return result }
    } else {
      state.raise("Invalid character in character class");
    }
    // https://tc39.es/ecma262/#prod-ClassUnion
    for (;;) {
      if (this.regexp_eatClassSetRange(state)) { continue }
      subResult = this.regexp_eatClassSetOperand(state);
      if (!subResult) { return result }
      if (subResult === CharSetString) { result = CharSetString; }
    }
  };

  // https://tc39.es/ecma262/#prod-ClassSetRange
  pp$1.regexp_eatClassSetRange = function(state) {
    var start = state.pos;
    if (this.regexp_eatClassSetCharacter(state)) {
      var left = state.lastIntValue;
      if (state.eat(0x2D /* - */) && this.regexp_eatClassSetCharacter(state)) {
        var right = state.lastIntValue;
        if (left !== -1 && right !== -1 && left > right) {
          state.raise("Range out of order in character class");
        }
        return true
      }
      state.pos = start;
    }
    return false
  };

  // https://tc39.es/ecma262/#prod-ClassSetOperand
  pp$1.regexp_eatClassSetOperand = function(state) {
    if (this.regexp_eatClassSetCharacter(state)) { return CharSetOk }
    return this.regexp_eatClassStringDisjunction(state) || this.regexp_eatNestedClass(state)
  };

  // https://tc39.es/ecma262/#prod-NestedClass
  pp$1.regexp_eatNestedClass = function(state) {
    var start = state.pos;
    if (state.eat(0x5B /* [ */)) {
      var negate = state.eat(0x5E /* ^ */);
      var result = this.regexp_classContents(state);
      if (state.eat(0x5D /* ] */)) {
        if (negate && result === CharSetString) {
          state.raise("Negated character class may contain strings");
        }
        return result
      }
      state.pos = start;
    }
    if (state.eat(0x5C /* \ */)) {
      var result$1 = this.regexp_eatCharacterClassEscape(state);
      if (result$1) {
        return result$1
      }
      state.pos = start;
    }
    return null
  };

  // https://tc39.es/ecma262/#prod-ClassStringDisjunction
  pp$1.regexp_eatClassStringDisjunction = function(state) {
    var start = state.pos;
    if (state.eatChars([0x5C, 0x71] /* \q */)) {
      if (state.eat(0x7B /* { */)) {
        var result = this.regexp_classStringDisjunctionContents(state);
        if (state.eat(0x7D /* } */)) {
          return result
        }
      } else {
        // Make the same message as V8.
        state.raise("Invalid escape");
      }
      state.pos = start;
    }
    return null
  };

  // https://tc39.es/ecma262/#prod-ClassStringDisjunctionContents
  pp$1.regexp_classStringDisjunctionContents = function(state) {
    var result = this.regexp_classString(state);
    while (state.eat(0x7C /* | */)) {
      if (this.regexp_classString(state) === CharSetString) { result = CharSetString; }
    }
    return result
  };

  // https://tc39.es/ecma262/#prod-ClassString
  // https://tc39.es/ecma262/#prod-NonEmptyClassString
  pp$1.regexp_classString = function(state) {
    var count = 0;
    while (this.regexp_eatClassSetCharacter(state)) { count++; }
    return count === 1 ? CharSetOk : CharSetString
  };

  // https://tc39.es/ecma262/#prod-ClassSetCharacter
  pp$1.regexp_eatClassSetCharacter = function(state) {
    var start = state.pos;
    if (state.eat(0x5C /* \ */)) {
      if (
        this.regexp_eatCharacterEscape(state) ||
        this.regexp_eatClassSetReservedPunctuator(state)
      ) {
        return true
      }
      if (state.eat(0x62 /* b */)) {
        state.lastIntValue = 0x08; /* <BS> */
        return true
      }
      state.pos = start;
      return false
    }
    var ch = state.current();
    if (ch < 0 || ch === state.lookahead() && isClassSetReservedDoublePunctuatorCharacter(ch)) { return false }
    if (isClassSetSyntaxCharacter(ch)) { return false }
    state.advance();
    state.lastIntValue = ch;
    return true
  };

  // https://tc39.es/ecma262/#prod-ClassSetReservedDoublePunctuator
  function isClassSetReservedDoublePunctuatorCharacter(ch) {
    return (
      ch === 0x21 /* ! */ ||
      ch >= 0x23 /* # */ && ch <= 0x26 /* & */ ||
      ch >= 0x2A /* * */ && ch <= 0x2C /* , */ ||
      ch === 0x2E /* . */ ||
      ch >= 0x3A /* : */ && ch <= 0x40 /* @ */ ||
      ch === 0x5E /* ^ */ ||
      ch === 0x60 /* ` */ ||
      ch === 0x7E /* ~ */
    )
  }

  // https://tc39.es/ecma262/#prod-ClassSetSyntaxCharacter
  function isClassSetSyntaxCharacter(ch) {
    return (
      ch === 0x28 /* ( */ ||
      ch === 0x29 /* ) */ ||
      ch === 0x2D /* - */ ||
      ch === 0x2F /* / */ ||
      ch >= 0x5B /* [ */ && ch <= 0x5D /* ] */ ||
      ch >= 0x7B /* { */ && ch <= 0x7D /* } */
    )
  }

  // https://tc39.es/ecma262/#prod-ClassSetReservedPunctuator
  pp$1.regexp_eatClassSetReservedPunctuator = function(state) {
    var ch = state.current();
    if (isClassSetReservedPunctuator(ch)) {
      state.lastIntValue = ch;
      state.advance();
      return true
    }
    return false
  };

  // https://tc39.es/ecma262/#prod-ClassSetReservedPunctuator
  function isClassSetReservedPunctuator(ch) {
    return (
      ch === 0x21 /* ! */ ||
      ch === 0x23 /* # */ ||
      ch === 0x25 /* % */ ||
      ch === 0x26 /* & */ ||
      ch === 0x2C /* , */ ||
      ch === 0x2D /* - */ ||
      ch >= 0x3A /* : */ && ch <= 0x3E /* > */ ||
      ch === 0x40 /* @ */ ||
      ch === 0x60 /* ` */ ||
      ch === 0x7E /* ~ */
    )
  }

  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter
  pp$1.regexp_eatClassControlLetter = function(state) {
    var ch = state.current();
    if (isDecimalDigit(ch) || ch === 0x5F /* _ */) {
      state.lastIntValue = ch % 0x20;
      state.advance();
      return true
    }
    return false
  };

  // https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence
  pp$1.regexp_eatHexEscapeSequence = function(state) {
    var start = state.pos;
    if (state.eat(0x78 /* x */)) {
      if (this.regexp_eatFixedHexDigits(state, 2)) {
        return true
      }
      if (state.switchU) {
        state.raise("Invalid escape");
      }
      state.pos = start;
    }
    return false
  };

  // https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits
  pp$1.regexp_eatDecimalDigits = function(state) {
    var start = state.pos;
    var ch = 0;
    state.lastIntValue = 0;
    while (isDecimalDigit(ch = state.current())) {
      state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);
      state.advance();
    }
    return state.pos !== start
  };
  function isDecimalDigit(ch) {
    return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */
  }

  // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits
  pp$1.regexp_eatHexDigits = function(state) {
    var start = state.pos;
    var ch = 0;
    state.lastIntValue = 0;
    while (isHexDigit(ch = state.current())) {
      state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);
      state.advance();
    }
    return state.pos !== start
  };
  function isHexDigit(ch) {
    return (
      (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) ||
      (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) ||
      (ch >= 0x61 /* a */ && ch <= 0x66 /* f */)
    )
  }
  function hexToInt(ch) {
    if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) {
      return 10 + (ch - 0x41 /* A */)
    }
    if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) {
      return 10 + (ch - 0x61 /* a */)
    }
    return ch - 0x30 /* 0 */
  }

  // https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence
  // Allows only 0-377(octal) i.e. 0-255(decimal).
  pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) {
    if (this.regexp_eatOctalDigit(state)) {
      var n1 = state.lastIntValue;
      if (this.regexp_eatOctalDigit(state)) {
        var n2 = state.lastIntValue;
        if (n1 <= 3 && this.regexp_eatOctalDigit(state)) {
          state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue;
        } else {
          state.lastIntValue = n1 * 8 + n2;
        }
      } else {
        state.lastIntValue = n1;
      }
      return true
    }
    return false
  };

  // https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit
  pp$1.regexp_eatOctalDigit = function(state) {
    var ch = state.current();
    if (isOctalDigit(ch)) {
      state.lastIntValue = ch - 0x30; /* 0 */
      state.advance();
      return true
    }
    state.lastIntValue = 0;
    return false
  };
  function isOctalDigit(ch) {
    return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */
  }

  // https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits
  // https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit
  // And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence
  pp$1.regexp_eatFixedHexDigits = function(state, length) {
    var start = state.pos;
    state.lastIntValue = 0;
    for (var i = 0; i < length; ++i) {
      var ch = state.current();
      if (!isHexDigit(ch)) {
        state.pos = start;
        return false
      }
      state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);
      state.advance();
    }
    return true
  };

  // Object type used to represent tokens. Note that normally, tokens
  // simply exist as properties on the parser object. This is only
  // used for the onToken callback and the external tokenizer.

  var Token = function Token(p) {
    this.type = p.type;
    this.value = p.value;
    this.start = p.start;
    this.end = p.end;
    if (p.options.locations)
      { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); }
    if (p.options.ranges)
      { this.range = [p.start, p.end]; }
  };

  // ## Tokenizer

  var pp = Parser.prototype;

  // Move to the next token

  pp.next = function(ignoreEscapeSequenceInKeyword) {
    if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc)
      { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); }
    if (this.options.onToken)
      { this.options.onToken(new Token(this)); }

    this.lastTokEnd = this.end;
    this.lastTokStart = this.start;
    this.lastTokEndLoc = this.endLoc;
    this.lastTokStartLoc = this.startLoc;
    this.nextToken();
  };

  pp.getToken = function() {
    this.next();
    return new Token(this)
  };

  // If we're in an ES6 environment, make parsers iterable
  if (typeof Symbol !== "undefined")
    { pp[Symbol.iterator] = function() {
      var this$1$1 = this;

      return {
        next: function () {
          var token = this$1$1.getToken();
          return {
            done: token.type === types$1.eof,
            value: token
          }
        }
      }
    }; }

  // Toggle strict mode. Re-reads the next number or string to please
  // pedantic tests (`"use strict"; 010;` should fail).

  // Read a single token, updating the parser object's token-related
  // properties.

  pp.nextToken = function() {
    var curContext = this.curContext();
    if (!curContext || !curContext.preserveSpace) { this.skipSpace(); }

    this.start = this.pos;
    if (this.options.locations) { this.startLoc = this.curPosition(); }
    if (this.pos >= this.input.length) { return this.finishToken(types$1.eof) }

    if (curContext.override) { return curContext.override(this) }
    else { this.readToken(this.fullCharCodeAtPos()); }
  };

  pp.readToken = function(code) {
    // Identifier or keyword. '\uXXXX' sequences are allowed in
    // identifiers, so '\' also dispatches to that.
    if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */)
      { return this.readWord() }

    return this.getTokenFromCode(code)
  };

  pp.fullCharCodeAt = function(pos) {
    var code = this.input.charCodeAt(pos);
    if (code <= 0xd7ff || code >= 0xdc00) { return code }
    var next = this.input.charCodeAt(pos + 1);
    return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00
  };

  pp.fullCharCodeAtPos = function() {
    return this.fullCharCodeAt(this.pos)
  };

  pp.skipBlockComment = function() {
    var startLoc = this.options.onComment && this.curPosition();
    var start = this.pos, end = this.input.indexOf("*/", this.pos += 2);
    if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); }
    this.pos = end + 2;
    if (this.options.locations) {
      for (var nextBreak = (void 0), pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) {
        ++this.curLine;
        pos = this.lineStart = nextBreak;
      }
    }
    if (this.options.onComment)
      { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos,
                             startLoc, this.curPosition()); }
  };

  pp.skipLineComment = function(startSkip) {
    var start = this.pos;
    var startLoc = this.options.onComment && this.curPosition();
    var ch = this.input.charCodeAt(this.pos += startSkip);
    while (this.pos < this.input.length && !isNewLine(ch)) {
      ch = this.input.charCodeAt(++this.pos);
    }
    if (this.options.onComment)
      { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos,
                             startLoc, this.curPosition()); }
  };

  // Called at the start of the parse and after every token. Skips
  // whitespace and comments, and.

  pp.skipSpace = function() {
    loop: while (this.pos < this.input.length) {
      var ch = this.input.charCodeAt(this.pos);
      switch (ch) {
      case 32: case 160: // ' '
        ++this.pos;
        break
      case 13:
        if (this.input.charCodeAt(this.pos + 1) === 10) {
          ++this.pos;
        }
      case 10: case 8232: case 8233:
        ++this.pos;
        if (this.options.locations) {
          ++this.curLine;
          this.lineStart = this.pos;
        }
        break
      case 47: // '/'
        switch (this.input.charCodeAt(this.pos + 1)) {
        case 42: // '*'
          this.skipBlockComment();
          break
        case 47:
          this.skipLineComment(2);
          break
        default:
          break loop
        }
        break
      default:
        if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {
          ++this.pos;
        } else {
          break loop
        }
      }
    }
  };

  // Called at the end of every token. Sets `end`, `val`, and
  // maintains `context` and `exprAllowed`, and skips the space after
  // the token, so that the next one's `start` will point at the
  // right position.

  pp.finishToken = function(type, val) {
    this.end = this.pos;
    if (this.options.locations) { this.endLoc = this.curPosition(); }
    var prevType = this.type;
    this.type = type;
    this.value = val;

    this.updateContext(prevType);
  };

  // ### Token reading

  // This is the function that is called to fetch the next token. It
  // is somewhat obscure, because it works in character codes rather
  // than characters, and because operator parsing has been inlined
  // into it.
  //
  // All in the name of speed.
  //
  pp.readToken_dot = function() {
    var next = this.input.charCodeAt(this.pos + 1);
    if (next >= 48 && next <= 57) { return this.readNumber(true) }
    var next2 = this.input.charCodeAt(this.pos + 2);
    if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.'
      this.pos += 3;
      return this.finishToken(types$1.ellipsis)
    } else {
      ++this.pos;
      return this.finishToken(types$1.dot)
    }
  };

  pp.readToken_slash = function() { // '/'
    var next = this.input.charCodeAt(this.pos + 1);
    if (this.exprAllowed) { ++this.pos; return this.readRegexp() }
    if (next === 61) { return this.finishOp(types$1.assign, 2) }
    return this.finishOp(types$1.slash, 1)
  };

  pp.readToken_mult_modulo_exp = function(code) { // '%*'
    var next = this.input.charCodeAt(this.pos + 1);
    var size = 1;
    var tokentype = code === 42 ? types$1.star : types$1.modulo;

    // exponentiation operator ** and **=
    if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) {
      ++size;
      tokentype = types$1.starstar;
      next = this.input.charCodeAt(this.pos + 2);
    }

    if (next === 61) { return this.finishOp(types$1.assign, size + 1) }
    return this.finishOp(tokentype, size)
  };

  pp.readToken_pipe_amp = function(code) { // '|&'
    var next = this.input.charCodeAt(this.pos + 1);
    if (next === code) {
      if (this.options.ecmaVersion >= 12) {
        var next2 = this.input.charCodeAt(this.pos + 2);
        if (next2 === 61) { return this.finishOp(types$1.assign, 3) }
      }
      return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2)
    }
    if (next === 61) { return this.finishOp(types$1.assign, 2) }
    return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1)
  };

  pp.readToken_caret = function() { // '^'
    var next = this.input.charCodeAt(this.pos + 1);
    if (next === 61) { return this.finishOp(types$1.assign, 2) }
    return this.finishOp(types$1.bitwiseXOR, 1)
  };

  pp.readToken_plus_min = function(code) { // '+-'
    var next = this.input.charCodeAt(this.pos + 1);
    if (next === code) {
      if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 &&
          (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) {
        // A `-->` line comment
        this.skipLineComment(3);
        this.skipSpace();
        return this.nextToken()
      }
      return this.finishOp(types$1.incDec, 2)
    }
    if (next === 61) { return this.finishOp(types$1.assign, 2) }
    return this.finishOp(types$1.plusMin, 1)
  };

  pp.readToken_lt_gt = function(code) { // '<>'
    var next = this.input.charCodeAt(this.pos + 1);
    var size = 1;
    if (next === code) {
      size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;
      if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) }
      return this.finishOp(types$1.bitShift, size)
    }
    if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&
        this.input.charCodeAt(this.pos + 3) === 45) {
      // `<!--`, an XML-style comment that should be interpreted as a line comment
      this.skipLineComment(4);
      this.skipSpace();
      return this.nextToken()
    }
    if (next === 61) { size = 2; }
    return this.finishOp(types$1.relational, size)
  };

  pp.readToken_eq_excl = function(code) { // '=!'
    var next = this.input.charCodeAt(this.pos + 1);
    if (next === 61) { return this.finishOp(types$1.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) }
    if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { // '=>'
      this.pos += 2;
      return this.finishToken(types$1.arrow)
    }
    return this.finishOp(code === 61 ? types$1.eq : types$1.prefix, 1)
  };

  pp.readToken_question = function() { // '?'
    var ecmaVersion = this.options.ecmaVersion;
    if (ecmaVersion >= 11) {
      var next = this.input.charCodeAt(this.pos + 1);
      if (next === 46) {
        var next2 = this.input.charCodeAt(this.pos + 2);
        if (next2 < 48 || next2 > 57) { return this.finishOp(types$1.questionDot, 2) }
      }
      if (next === 63) {
        if (ecmaVersion >= 12) {
          var next2$1 = this.input.charCodeAt(this.pos + 2);
          if (next2$1 === 61) { return this.finishOp(types$1.assign, 3) }
        }
        return this.finishOp(types$1.coalesce, 2)
      }
    }
    return this.finishOp(types$1.question, 1)
  };

  pp.readToken_numberSign = function() { // '#'
    var ecmaVersion = this.options.ecmaVersion;
    var code = 35; // '#'
    if (ecmaVersion >= 13) {
      ++this.pos;
      code = this.fullCharCodeAtPos();
      if (isIdentifierStart(code, true) || code === 92 /* '\' */) {
        return this.finishToken(types$1.privateId, this.readWord1())
      }
    }

    this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'");
  };

  pp.getTokenFromCode = function(code) {
    switch (code) {
    // The interpretation of a dot depends on whether it is followed
    // by a digit or another two dots.
    case 46: // '.'
      return this.readToken_dot()

    // Punctuation tokens.
    case 40: ++this.pos; return this.finishToken(types$1.parenL)
    case 41: ++this.pos; return this.finishToken(types$1.parenR)
    case 59: ++this.pos; return this.finishToken(types$1.semi)
    case 44: ++this.pos; return this.finishToken(types$1.comma)
    case 91: ++this.pos; return this.finishToken(types$1.bracketL)
    case 93: ++this.pos; return this.finishToken(types$1.bracketR)
    case 123: ++this.pos; return this.finishToken(types$1.braceL)
    case 125: ++this.pos; return this.finishToken(types$1.braceR)
    case 58: ++this.pos; return this.finishToken(types$1.colon)

    case 96: // '`'
      if (this.options.ecmaVersion < 6) { break }
      ++this.pos;
      return this.finishToken(types$1.backQuote)

    case 48: // '0'
      var next = this.input.charCodeAt(this.pos + 1);
      if (next === 120 || next === 88) { return this.readRadixNumber(16) } // '0x', '0X' - hex number
      if (this.options.ecmaVersion >= 6) {
        if (next === 111 || next === 79) { return this.readRadixNumber(8) } // '0o', '0O' - octal number
        if (next === 98 || next === 66) { return this.readRadixNumber(2) } // '0b', '0B' - binary number
      }

    // Anything else beginning with a digit is an integer, octal
    // number, or float.
    case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: // 1-9
      return this.readNumber(false)

    // Quotes produce strings.
    case 34: case 39: // '"', "'"
      return this.readString(code)

    // Operators are parsed inline in tiny state machines. '=' (61) is
    // often referred to. `finishOp` simply skips the amount of
    // characters it is given as second argument, and returns a token
    // of the type given by its first argument.
    case 47: // '/'
      return this.readToken_slash()

    case 37: case 42: // '%*'
      return this.readToken_mult_modulo_exp(code)

    case 124: case 38: // '|&'
      return this.readToken_pipe_amp(code)

    case 94: // '^'
      return this.readToken_caret()

    case 43: case 45: // '+-'
      return this.readToken_plus_min(code)

    case 60: case 62: // '<>'
      return this.readToken_lt_gt(code)

    case 61: case 33: // '=!'
      return this.readToken_eq_excl(code)

    case 63: // '?'
      return this.readToken_question()

    case 126: // '~'
      return this.finishOp(types$1.prefix, 1)

    case 35: // '#'
      return this.readToken_numberSign()
    }

    this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'");
  };

  pp.finishOp = function(type, size) {
    var str = this.input.slice(this.pos, this.pos + size);
    this.pos += size;
    return this.finishToken(type, str)
  };

  pp.readRegexp = function() {
    var escaped, inClass, start = this.pos;
    for (;;) {
      if (this.pos >= this.input.length) { this.raise(start, "Unterminated regular expression"); }
      var ch = this.input.charAt(this.pos);
      if (lineBreak.test(ch)) { this.raise(start, "Unterminated regular expression"); }
      if (!escaped) {
        if (ch === "[") { inClass = true; }
        else if (ch === "]" && inClass) { inClass = false; }
        else if (ch === "/" && !inClass) { break }
        escaped = ch === "\\";
      } else { escaped = false; }
      ++this.pos;
    }
    var pattern = this.input.slice(start, this.pos);
    ++this.pos;
    var flagsStart = this.pos;
    var flags = this.readWord1();
    if (this.containsEsc) { this.unexpected(flagsStart); }

    // Validate pattern
    var state = this.regexpState || (this.regexpState = new RegExpValidationState(this));
    state.reset(start, pattern, flags);
    this.validateRegExpFlags(state);
    this.validateRegExpPattern(state);

    // Create Literal#value property value.
    var value = null;
    try {
      value = new RegExp(pattern, flags);
    } catch (e) {
      // ESTree requires null if it failed to instantiate RegExp object.
      // https://github.com/estree/estree/blob/a27003adf4fd7bfad44de9cef372a2eacd527b1c/es5.md#regexpliteral
    }

    return this.finishToken(types$1.regexp, {pattern: pattern, flags: flags, value: value})
  };

  // Read an integer in the given radix. Return null if zero digits
  // were read, the integer value otherwise. When `len` is given, this
  // will return `null` unless the integer has exactly `len` digits.

  pp.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) {
    // `len` is used for character escape sequences. In that case, disallow separators.
    var allowSeparators = this.options.ecmaVersion >= 12 && len === undefined;

    // `maybeLegacyOctalNumericLiteral` is true if it doesn't have prefix (0x,0o,0b)
    // and isn't fraction part nor exponent part. In that case, if the first digit
    // is zero then disallow separators.
    var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48;

    var start = this.pos, total = 0, lastCode = 0;
    for (var i = 0, e = len == null ? Infinity : len; i < e; ++i, ++this.pos) {
      var code = this.input.charCodeAt(this.pos), val = (void 0);

      if (allowSeparators && code === 95) {
        if (isLegacyOctalNumericLiteral) { this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"); }
        if (lastCode === 95) { this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"); }
        if (i === 0) { this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"); }
        lastCode = code;
        continue
      }

      if (code >= 97) { val = code - 97 + 10; } // a
      else if (code >= 65) { val = code - 65 + 10; } // A
      else if (code >= 48 && code <= 57) { val = code - 48; } // 0-9
      else { val = Infinity; }
      if (val >= radix) { break }
      lastCode = code;
      total = total * radix + val;
    }

    if (allowSeparators && lastCode === 95) { this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"); }
    if (this.pos === start || len != null && this.pos - start !== len) { return null }

    return total
  };

  function stringToNumber(str, isLegacyOctalNumericLiteral) {
    if (isLegacyOctalNumericLiteral) {
      return parseInt(str, 8)
    }

    // `parseFloat(value)` stops parsing at the first numeric separator then returns a wrong value.
    return parseFloat(str.replace(/_/g, ""))
  }

  function stringToBigInt(str) {
    if (typeof BigInt !== "function") {
      return null
    }

    // `BigInt(value)` throws syntax error if the string contains numeric separators.
    return BigInt(str.replace(/_/g, ""))
  }

  pp.readRadixNumber = function(radix) {
    var start = this.pos;
    this.pos += 2; // 0x
    var val = this.readInt(radix);
    if (val == null) { this.raise(this.start + 2, "Expected number in radix " + radix); }
    if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) {
      val = stringToBigInt(this.input.slice(start, this.pos));
      ++this.pos;
    } else if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
    return this.finishToken(types$1.num, val)
  };

  // Read an integer, octal integer, or floating-point number.

  pp.readNumber = function(startsWithDot) {
    var start = this.pos;
    if (!startsWithDot && this.readInt(10, undefined, true) === null) { this.raise(start, "Invalid number"); }
    var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48;
    if (octal && this.strict) { this.raise(start, "Invalid number"); }
    var next = this.input.charCodeAt(this.pos);
    if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) {
      var val$1 = stringToBigInt(this.input.slice(start, this.pos));
      ++this.pos;
      if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
      return this.finishToken(types$1.num, val$1)
    }
    if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; }
    if (next === 46 && !octal) { // '.'
      ++this.pos;
      this.readInt(10);
      next = this.input.charCodeAt(this.pos);
    }
    if ((next === 69 || next === 101) && !octal) { // 'eE'
      next = this.input.charCodeAt(++this.pos);
      if (next === 43 || next === 45) { ++this.pos; } // '+-'
      if (this.readInt(10) === null) { this.raise(start, "Invalid number"); }
    }
    if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }

    var val = stringToNumber(this.input.slice(start, this.pos), octal);
    return this.finishToken(types$1.num, val)
  };

  // Read a string value, interpreting backslash-escapes.

  pp.readCodePoint = function() {
    var ch = this.input.charCodeAt(this.pos), code;

    if (ch === 123) { // '{'
      if (this.options.ecmaVersion < 6) { this.unexpected(); }
      var codePos = ++this.pos;
      code = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos);
      ++this.pos;
      if (code > 0x10FFFF) { this.invalidStringToken(codePos, "Code point out of bounds"); }
    } else {
      code = this.readHexChar(4);
    }
    return code
  };

  pp.readString = function(quote) {
    var out = "", chunkStart = ++this.pos;
    for (;;) {
      if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated string constant"); }
      var ch = this.input.charCodeAt(this.pos);
      if (ch === quote) { break }
      if (ch === 92) { // '\'
        out += this.input.slice(chunkStart, this.pos);
        out += this.readEscapedChar(false);
        chunkStart = this.pos;
      } else if (ch === 0x2028 || ch === 0x2029) {
        if (this.options.ecmaVersion < 10) { this.raise(this.start, "Unterminated string constant"); }
        ++this.pos;
        if (this.options.locations) {
          this.curLine++;
          this.lineStart = this.pos;
        }
      } else {
        if (isNewLine(ch)) { this.raise(this.start, "Unterminated string constant"); }
        ++this.pos;
      }
    }
    out += this.input.slice(chunkStart, this.pos++);
    return this.finishToken(types$1.string, out)
  };

  // Reads template string tokens.

  var INVALID_TEMPLATE_ESCAPE_ERROR = {};

  pp.tryReadTemplateToken = function() {
    this.inTemplateElement = true;
    try {
      this.readTmplToken();
    } catch (err) {
      if (err === INVALID_TEMPLATE_ESCAPE_ERROR) {
        this.readInvalidTemplateToken();
      } else {
        throw err
      }
    }

    this.inTemplateElement = false;
  };

  pp.invalidStringToken = function(position, message) {
    if (this.inTemplateElement && this.options.ecmaVersion >= 9) {
      throw INVALID_TEMPLATE_ESCAPE_ERROR
    } else {
      this.raise(position, message);
    }
  };

  pp.readTmplToken = function() {
    var out = "", chunkStart = this.pos;
    for (;;) {
      if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated template"); }
      var ch = this.input.charCodeAt(this.pos);
      if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { // '`', '${'
        if (this.pos === this.start && (this.type === types$1.template || this.type === types$1.invalidTemplate)) {
          if (ch === 36) {
            this.pos += 2;
            return this.finishToken(types$1.dollarBraceL)
          } else {
            ++this.pos;
            return this.finishToken(types$1.backQuote)
          }
        }
        out += this.input.slice(chunkStart, this.pos);
        return this.finishToken(types$1.template, out)
      }
      if (ch === 92) { // '\'
        out += this.input.slice(chunkStart, this.pos);
        out += this.readEscapedChar(true);
        chunkStart = this.pos;
      } else if (isNewLine(ch)) {
        out += this.input.slice(chunkStart, this.pos);
        ++this.pos;
        switch (ch) {
        case 13:
          if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; }
        case 10:
          out += "\n";
          break
        default:
          out += String.fromCharCode(ch);
          break
        }
        if (this.options.locations) {
          ++this.curLine;
          this.lineStart = this.pos;
        }
        chunkStart = this.pos;
      } else {
        ++this.pos;
      }
    }
  };

  // Reads a template token to search for the end, without validating any escape sequences
  pp.readInvalidTemplateToken = function() {
    for (; this.pos < this.input.length; this.pos++) {
      switch (this.input[this.pos]) {
      case "\\":
        ++this.pos;
        break

      case "$":
        if (this.input[this.pos + 1] !== "{") { break }
        // fall through
      case "`":
        return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos))

      case "\r":
        if (this.input[this.pos + 1] === "\n") { ++this.pos; }
        // fall through
      case "\n": case "\u2028": case "\u2029":
        ++this.curLine;
        this.lineStart = this.pos + 1;
        break
      }
    }
    this.raise(this.start, "Unterminated template");
  };

  // Used to read escaped characters

  pp.readEscapedChar = function(inTemplate) {
    var ch = this.input.charCodeAt(++this.pos);
    ++this.pos;
    switch (ch) {
    case 110: return "\n" // 'n' -> '\n'
    case 114: return "\r" // 'r' -> '\r'
    case 120: return String.fromCharCode(this.readHexChar(2)) // 'x'
    case 117: return codePointToString(this.readCodePoint()) // 'u'
    case 116: return "\t" // 't' -> '\t'
    case 98: return "\b" // 'b' -> '\b'
    case 118: return "\u000b" // 'v' -> '\u000b'
    case 102: return "\f" // 'f' -> '\f'
    case 13: if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; } // '\r\n'
    case 10: // ' \n'
      if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }
      return ""
    case 56:
    case 57:
      if (this.strict) {
        this.invalidStringToken(
          this.pos - 1,
          "Invalid escape sequence"
        );
      }
      if (inTemplate) {
        var codePos = this.pos - 1;

        this.invalidStringToken(
          codePos,
          "Invalid escape sequence in template string"
        );
      }
    default:
      if (ch >= 48 && ch <= 55) {
        var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0];
        var octal = parseInt(octalStr, 8);
        if (octal > 255) {
          octalStr = octalStr.slice(0, -1);
          octal = parseInt(octalStr, 8);
        }
        this.pos += octalStr.length - 1;
        ch = this.input.charCodeAt(this.pos);
        if ((octalStr !== "0" || ch === 56 || ch === 57) && (this.strict || inTemplate)) {
          this.invalidStringToken(
            this.pos - 1 - octalStr.length,
            inTemplate
              ? "Octal literal in template string"
              : "Octal literal in strict mode"
          );
        }
        return String.fromCharCode(octal)
      }
      if (isNewLine(ch)) {
        // Unicode new line characters after \ get removed from output in both
        // template literals and strings
        if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }
        return ""
      }
      return String.fromCharCode(ch)
    }
  };

  // Used to read character escape sequences ('\x', '\u', '\U').

  pp.readHexChar = function(len) {
    var codePos = this.pos;
    var n = this.readInt(16, len);
    if (n === null) { this.invalidStringToken(codePos, "Bad character escape sequence"); }
    return n
  };

  // Read an identifier, and return it as a string. Sets `this.containsEsc`
  // to whether the word contained a '\u' escape.
  //
  // Incrementally adds only escaped chars, adding other chunks as-is
  // as a micro-optimization.

  pp.readWord1 = function() {
    this.containsEsc = false;
    var word = "", first = true, chunkStart = this.pos;
    var astral = this.options.ecmaVersion >= 6;
    while (this.pos < this.input.length) {
      var ch = this.fullCharCodeAtPos();
      if (isIdentifierChar(ch, astral)) {
        this.pos += ch <= 0xffff ? 1 : 2;
      } else if (ch === 92) { // "\"
        this.containsEsc = true;
        word += this.input.slice(chunkStart, this.pos);
        var escStart = this.pos;
        if (this.input.charCodeAt(++this.pos) !== 117) // "u"
          { this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"); }
        ++this.pos;
        var esc = this.readCodePoint();
        if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral))
          { this.invalidStringToken(escStart, "Invalid Unicode escape"); }
        word += codePointToString(esc);
        chunkStart = this.pos;
      } else {
        break
      }
      first = false;
    }
    return word + this.input.slice(chunkStart, this.pos)
  };

  // Read an identifier or keyword token. Will check for reserved
  // words when necessary.

  pp.readWord = function() {
    var word = this.readWord1();
    var type = types$1.name;
    if (this.keywords.test(word)) {
      type = keywords[word];
    }
    return this.finishToken(type, word)
  };

  // Acorn is a tiny, fast JavaScript parser written in JavaScript.
  //
  // Acorn was written by Marijn Haverbeke, Ingvar Stepanyan, and
  // various contributors and released under an MIT license.
  //
  // Git repositories for Acorn are available at
  //
  //     http://marijnhaverbeke.nl/git/acorn
  //     https://github.com/acornjs/acorn.git
  //
  // Please use the [github bug tracker][ghbt] to report issues.
  //
  // [ghbt]: https://github.com/acornjs/acorn/issues


  var version = "8.18.0";

  Parser.acorn = {
    Parser: Parser,
    version: version,
    defaultOptions: defaultOptions,
    Position: Position,
    SourceLocation: SourceLocation,
    getLineInfo: getLineInfo,
    Node: Node,
    TokenType: TokenType,
    tokTypes: types$1,
    keywordTypes: keywords,
    TokContext: TokContext,
    tokContexts: types,
    isIdentifierChar: isIdentifierChar,
    isIdentifierStart: isIdentifierStart,
    Token: Token,
    isNewLine: isNewLine,
    lineBreak: lineBreak,
    lineBreakG: lineBreakG,
    nonASCIIwhitespace: nonASCIIwhitespace
  };

  // The main exported interface (under `self.acorn` when in the
  // browser) is a `parse` function that takes a code string and returns
  // an abstract syntax tree as specified by the [ESTree spec][estree].
  //
  // [estree]: https://github.com/estree/estree

  function parse(input, options) {
    return Parser.parse(input, options)
  }

  // This function tries to parse a single expression at a given
  // offset in a string. Useful for parsing mixed-language formats
  // that embed JavaScript expressions.

  function parseExpressionAt(input, pos, options) {
    return Parser.parseExpressionAt(input, pos, options)
  }

  // Acorn is organized as a tokenizer and a recursive-descent parser.
  // The `tokenizer` export provides an interface to the tokenizer.

  function tokenizer(input, options) {
    return Parser.tokenizer(input, options)
  }

  exports.Node = Node;
  exports.Parser = Parser;
  exports.Position = Position;
  exports.SourceLocation = SourceLocation;
  exports.TokContext = TokContext;
  exports.Token = Token;
  exports.TokenType = TokenType;
  exports.defaultOptions = defaultOptions;
  exports.getLineInfo = getLineInfo;
  exports.isIdentifierChar = isIdentifierChar;
  exports.isIdentifierStart = isIdentifierStart;
  exports.isNewLine = isNewLine;
  exports.keywordTypes = keywords;
  exports.lineBreak = lineBreak;
  exports.lineBreakG = lineBreakG;
  exports.nonASCIIwhitespace = nonASCIIwhitespace;
  exports.parse = parse;
  exports.parseExpressionAt = parseExpressionAt;
  exports.tokContexts = types;
  exports.tokTypes = types$1;
  exports.tokenizer = tokenizer;
  exports.version = version;

}));
jqx   // This file was generated. Do not modify manually!
var astralIdentifierCodes = [509, 0, 227, 0, 150, 4, 294, 9, 1368, 2, 2, 1, 6, 3, 41, 2, 5, 0, 166, 1, 574, 3, 9, 9, 7, 9, 32, 4, 318, 1, 78, 5, 71, 10, 50, 3, 123, 2, 54, 14, 32, 10, 3, 1, 11, 3, 46, 10, 8, 0, 46, 9, 7, 2, 37, 13, 2, 9, 6, 1, 45, 0, 13, 2, 49, 13, 9, 3, 2, 11, 83, 11, 7, 0, 3, 0, 158, 11, 6, 9, 7, 3, 56, 1, 2, 6, 3, 1, 3, 2, 10, 0, 11, 1, 3, 6, 4, 4, 68, 8, 2, 0, 3, 0, 2, 3, 2, 4, 2, 0, 15, 1, 83, 17, 10, 9, 5, 0, 82, 19, 13, 9, 214, 6, 3, 8, 28, 1, 83, 16, 16, 9, 82, 12, 9, 9, 7, 19, 58, 14, 5, 9, 243, 14, 166, 9, 71, 5, 2, 1, 3, 3, 2, 0, 2, 1, 13, 9, 120, 6, 3, 6, 4, 0, 29, 9, 41, 6, 2, 3, 9, 0, 10, 10, 47, 15, 199, 7, 137, 9, 54, 7, 2, 7, 17, 9, 57, 21, 2, 13, 123, 5, 4, 0, 2, 1, 2, 6, 2, 0, 9, 9, 49, 4, 2, 1, 2, 4, 9, 9, 55, 9, 266, 3, 10, 1, 2, 0, 49, 6, 4, 4, 14, 10, 5350, 0, 7, 14, 11465, 27, 2343, 9, 87, 9, 39, 4, 60, 6, 26, 9, 535, 9, 470, 0, 2, 54, 8, 3, 82, 0, 12, 1, 19628, 1, 4178, 9, 519, 45, 3, 22, 543, 4, 4, 5, 9, 7, 3, 6, 31, 3, 149, 2, 1418, 49, 513, 54, 5, 49, 9, 0, 15, 0, 23, 4, 2, 14, 1361, 6, 2, 16, 3, 6, 2, 1, 2, 4, 101, 0, 161, 6, 10, 9, 357, 0, 62, 13, 499, 13, 245, 1, 2, 9, 233, 0, 3, 0, 8, 1, 6, 0, 475, 6, 110, 6, 6, 9, 4759, 9, 787719, 239];

// This file was generated. Do not modify manually!
var astralIdentifierStartCodes = [0, 11, 2, 25, 2, 18, 2, 1, 2, 14, 3, 13, 35, 122, 70, 52, 268, 28, 4, 48, 48, 31, 14, 29, 6, 37, 11, 29, 3, 35, 5, 7, 2, 4, 43, 157, 19, 35, 5, 35, 5, 39, 9, 51, 13, 10, 2, 14, 2, 6, 2, 1, 2, 10, 2, 14, 2, 6, 2, 1, 4, 51, 13, 310, 10, 21, 11, 7, 25, 5, 2, 41, 2, 8, 70, 5, 3, 0, 2, 43, 2, 1, 4, 0, 3, 22, 11, 22, 10, 30, 66, 18, 2, 1, 11, 21, 11, 25, 7, 25, 39, 55, 7, 1, 65, 0, 16, 3, 2, 2, 2, 28, 43, 28, 4, 28, 36, 7, 2, 27, 28, 53, 11, 21, 11, 18, 14, 17, 111, 72, 56, 50, 14, 50, 14, 35, 39, 27, 10, 22, 251, 41, 7, 1, 17, 5, 57, 28, 11, 0, 9, 21, 43, 17, 47, 20, 28, 22, 13, 52, 58, 1, 3, 0, 14, 44, 33, 24, 27, 35, 30, 0, 3, 0, 9, 34, 4, 0, 13, 47, 15, 3, 22, 0, 2, 0, 36, 17, 2, 24, 20, 1, 64, 6, 2, 0, 2, 3, 2, 14, 2, 9, 8, 46, 39, 7, 3, 1, 3, 21, 2, 6, 2, 1, 2, 4, 4, 0, 19, 0, 13, 4, 31, 9, 2, 0, 3, 0, 2, 37, 2, 0, 26, 0, 2, 0, 45, 52, 19, 3, 21, 2, 31, 47, 21, 1, 2, 0, 185, 46, 42, 3, 37, 47, 21, 0, 60, 42, 14, 0, 72, 26, 38, 6, 186, 43, 117, 63, 32, 7, 3, 0, 3, 7, 2, 1, 2, 23, 16, 0, 2, 0, 95, 7, 3, 38, 17, 0, 2, 0, 29, 0, 11, 39, 8, 0, 22, 0, 12, 45, 20, 0, 19, 72, 200, 32, 32, 8, 2, 36, 18, 0, 50, 29, 113, 6, 2, 1, 2, 37, 22, 0, 26, 5, 2, 1, 2, 31, 15, 0, 24, 43, 261, 18, 16, 0, 2, 12, 2, 33, 125, 0, 80, 921, 103, 110, 18, 195, 2637, 96, 16, 1071, 18, 5, 26, 3994, 6, 582, 6842, 29, 1763, 568, 8, 30, 18, 78, 18, 29, 19, 47, 17, 3, 32, 20, 6, 18, 433, 44, 212, 63, 33, 24, 3, 24, 45, 74, 6, 0, 67, 12, 65, 1, 2, 0, 15, 4, 10, 7381, 42, 31, 98, 114, 8702, 3, 2, 6, 2, 1, 2, 290, 16, 0, 30, 2, 3, 0, 15, 3, 9, 395, 2309, 106, 6, 12, 4, 8, 8, 9, 5991, 84, 2, 70, 2, 1, 3, 0, 3, 1, 3, 3, 2, 11, 2, 0, 2, 6, 2, 64, 2, 3, 3, 7, 2, 6, 2, 27, 2, 3, 2, 4, 2, 0, 4, 6, 2, 339, 3, 24, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 30, 2, 24, 2, 7, 1845, 30, 7, 5, 262, 61, 147, 44, 11, 6, 17, 0, 322, 29, 19, 43, 485, 27, 229, 29, 3, 0, 208, 30, 2, 2, 2, 1, 2, 6, 3, 4, 10, 1, 225, 6, 2, 3, 2, 1, 2, 14, 2, 196, 60, 67, 8, 0, 1205, 3, 2, 26, 2, 1, 2, 0, 3, 0, 2, 9, 2, 3, 2, 0, 2, 0, 7, 0, 5, 0, 2, 0, 2, 0, 2, 2, 2, 1, 2, 0, 3, 0, 2, 0, 2, 0, 2, 0, 2, 0, 2, 1, 2, 0, 3, 3, 2, 6, 2, 3, 2, 3, 2, 0, 2, 9, 2, 16, 6, 2, 2, 4, 2, 16, 4421, 42719, 33, 4381, 3, 5773, 3, 7472, 16, 621, 2467, 541, 1507, 4938, 6, 8489];

// This file was generated. Do not modify manually!
var nonASCIIidentifierChars = "\u200c\u200d\xb7\u0300-\u036f\u0387\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u07fd\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u0897-\u089f\u08ca-\u08e1\u08e3-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u09fe\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0afa-\u0aff\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b55-\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c00-\u0c04\u0c3c\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c81-\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0cf3\u0d00-\u0d03\u0d3b\u0d3c\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d81-\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0de6-\u0def\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0ebc\u0ec8-\u0ece\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u180f-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19d0-\u19da\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1ab0-\u1abd\u1abf-\u1add\u1ae0-\u1aeb\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf4\u1cf7-\u1cf9\u1dc0-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\u30fb\ua620-\ua629\ua66f\ua674-\ua67d\ua69e\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua82c\ua880\ua881\ua8b4-\ua8c5\ua8d0-\ua8d9\ua8e0-\ua8f1\ua8ff-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\ua9e5\ua9f0-\ua9f9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b-\uaa7d\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe2f\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f\uff65";

// This file was generated. Do not modify manually!
var nonASCIIidentifierStartChars = "\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u037f\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u052f\u0531-\u0556\u0559\u0560-\u0588\u05d0-\u05ea\u05ef-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u0860-\u086a\u0870-\u0887\u0889-\u088f\u08a0-\u08c9\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u09fc\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0af9\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c39\u0c3d\u0c58-\u0c5a\u0c5c\u0c5d\u0c60\u0c61\u0c80\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cdc-\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d04-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d54-\u0d56\u0d5f-\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e86-\u0e8a\u0e8c-\u0ea3\u0ea5\u0ea7-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f5\u13f8-\u13fd\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f8\u1700-\u1711\u171f-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1878\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191e\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19b0-\u19c9\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4c\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1c80-\u1c8a\u1c90-\u1cba\u1cbd-\u1cbf\u1ce9-\u1cec\u1cee-\u1cf3\u1cf5\u1cf6\u1cfa\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2118-\u211d\u2124\u2126\u2128\u212a-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309b-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312f\u3131-\u318e\u31a0-\u31bf\u31f0-\u31ff\u3400-\u4dbf\u4e00-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua69d\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua7dc\ua7f1-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua8fd\ua8fe\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\ua9e0-\ua9e4\ua9e6-\ua9ef\ua9fa-\ua9fe\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa7e-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uab30-\uab5a\uab5c-\uab69\uab70-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc";

// These are a run-length and offset encoded representation of the
// >0xffff code points that are a valid part of identifiers. The
// offset starts at 0x10000, and each pair of numbers represents an
// offset to the next range, and then a size of the range.

// Reserved word lists for various dialects of the language

var reservedWords = {
  3: "abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",
  5: "class enum extends super const export import",
  6: "enum",
  strict: "implements interface let package private protected public static yield",
  strictBind: "eval arguments"
};

// And the keywords

var ecma5AndLessKeywords = "break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this";

var keywords$1 = {
  5: ecma5AndLessKeywords,
  "5module": ecma5AndLessKeywords + " export import",
  6: ecma5AndLessKeywords + " const class extends export import super"
};

var keywordRelationalOperator = /^in(stanceof)?$/;

// ## Character categories

var nonASCIIidentifierStart = new RegExp("[" + nonASCIIidentifierStartChars + "]");
var nonASCIIidentifier = new RegExp("[" + nonASCIIidentifierStartChars + nonASCIIidentifierChars + "]");

// This has a complexity linear to the value of the code. The
// assumption is that looking up astral identifier characters is
// rare.
function isInAstralSet(code, set) {
  var pos = 0x10000;
  for (var i = 0; i < set.length; i += 2) {
    pos += set[i];
    if (pos > code) { return false }
    pos += set[i + 1];
    if (pos >= code) { return true }
  }
  return false
}

// Test whether a given character code starts an identifier.

function isIdentifierStart(code, astral) {
  if (code < 65) { return code === 36 }
  if (code < 91) { return true }
  if (code < 97) { return code === 95 }
  if (code < 123) { return true }
  if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifierStart.test(String.fromCharCode(code)) }
  if (astral === false) { return false }
  return isInAstralSet(code, astralIdentifierStartCodes)
}

// Test whether a given character is part of an identifier.

function isIdentifierChar(code, astral) {
  if (code < 48) { return code === 36 }
  if (code < 58) { return true }
  if (code < 65) { return false }
  if (code < 91) { return true }
  if (code < 97) { return code === 95 }
  if (code < 123) { return true }
  if (code <= 0xffff) { return code >= 0xaa && nonASCIIidentifier.test(String.fromCharCode(code)) }
  if (astral === false) { return false }
  return isInAstralSet(code, astralIdentifierStartCodes) || isInAstralSet(code, astralIdentifierCodes)
}

// ## Token types

// The assignment of fine-grained, information-carrying type objects
// allows the tokenizer to store the information it has about a
// token in a way that is very cheap for the parser to look up.

// All token type variables start with an underscore, to make them
// easy to recognize.

// The `beforeExpr` property is used to disambiguate between regular
// expressions and divisions. It is set on all token types that can
// be followed by an expression (thus, a slash after them would be a
// regular expression).
//
// The `startsExpr` property is used to check if the token ends a
// `yield` expression. It is set on all token types that either can
// directly start an expression (like a quotation mark) or can
// continue an expression (like the body of a string).
//
// `isLoop` marks a keyword as starting a loop, which is important
// to know when parsing a label, in order to allow or disallow
// continue jumps to that label.

var TokenType = function TokenType(label, conf) {
  if ( conf === void 0 ) conf = {};

  this.label = label;
  this.keyword = conf.keyword;
  this.beforeExpr = !!conf.beforeExpr;
  this.startsExpr = !!conf.startsExpr;
  this.isLoop = !!conf.isLoop;
  this.isAssign = !!conf.isAssign;
  this.prefix = !!conf.prefix;
  this.postfix = !!conf.postfix;
  this.binop = conf.binop || null;
  this.updateContext = null;
};

function binop(name, prec) {
  return new TokenType(name, {beforeExpr: true, binop: prec})
}
var beforeExpr = {beforeExpr: true}, startsExpr = {startsExpr: true};

// Map keyword names to token types.

var keywords = {};

// Succinct definitions of keyword token types
function kw(name, options) {
  if ( options === void 0 ) options = {};

  options.keyword = name;
  return keywords[name] = new TokenType(name, options)
}

var types$1 = {
  num: new TokenType("num", startsExpr),
  regexp: new TokenType("regexp", startsExpr),
  string: new TokenType("string", startsExpr),
  name: new TokenType("name", startsExpr),
  privateId: new TokenType("privateId", startsExpr),
  eof: new TokenType("eof"),

  // Punctuation token types.
  bracketL: new TokenType("[", {beforeExpr: true, startsExpr: true}),
  bracketR: new TokenType("]"),
  braceL: new TokenType("{", {beforeExpr: true, startsExpr: true}),
  braceR: new TokenType("}"),
  parenL: new TokenType("(", {beforeExpr: true, startsExpr: true}),
  parenR: new TokenType(")"),
  comma: new TokenType(",", beforeExpr),
  semi: new TokenType(";", beforeExpr),
  colon: new TokenType(":", beforeExpr),
  dot: new TokenType("."),
  question: new TokenType("?", beforeExpr),
  questionDot: new TokenType("?."),
  arrow: new TokenType("=>", beforeExpr),
  template: new TokenType("template"),
  invalidTemplate: new TokenType("invalidTemplate"),
  ellipsis: new TokenType("...", beforeExpr),
  backQuote: new TokenType("`", startsExpr),
  dollarBraceL: new TokenType("${", {beforeExpr: true, startsExpr: true}),

  // Operators. These carry several kinds of properties to help the
  // parser use them properly (the presence of these properties is
  // what categorizes them as operators).
  //
  // `binop`, when present, specifies that this operator is a binary
  // operator, and will refer to its precedence.
  //
  // `prefix` and `postfix` mark the operator as a prefix or postfix
  // unary operator.
  //
  // `isAssign` marks all of `=`, `+=`, `-=` etcetera, which act as
  // binary operators with a very low precedence, that should result
  // in AssignmentExpression nodes.

  eq: new TokenType("=", {beforeExpr: true, isAssign: true}),
  assign: new TokenType("_=", {beforeExpr: true, isAssign: true}),
  incDec: new TokenType("++/--", {prefix: true, postfix: true, startsExpr: true}),
  prefix: new TokenType("!/~", {beforeExpr: true, prefix: true, startsExpr: true}),
  logicalOR: binop("||", 1),
  logicalAND: binop("&&", 2),
  bitwiseOR: binop("|", 3),
  bitwiseXOR: binop("^", 4),
  bitwiseAND: binop("&", 5),
  equality: binop("==/!=/===/!==", 6),
  relational: binop("</>/<=/>=", 7),
  bitShift: binop("<</>>/>>>", 8),
  plusMin: new TokenType("+/-", {beforeExpr: true, binop: 9, prefix: true, startsExpr: true}),
  modulo: binop("%", 10),
  star: binop("*", 10),
  slash: binop("/", 10),
  starstar: new TokenType("**", {beforeExpr: true}),
  coalesce: binop("??", 1),

  // Keyword token types.
  _break: kw("break"),
  _case: kw("case", beforeExpr),
  _catch: kw("catch"),
  _continue: kw("continue"),
  _debugger: kw("debugger"),
  _default: kw("default", beforeExpr),
  _do: kw("do", {isLoop: true, beforeExpr: true}),
  _else: kw("else", beforeExpr),
  _finally: kw("finally"),
  _for: kw("for", {isLoop: true}),
  _function: kw("function", startsExpr),
  _if: kw("if"),
  _return: kw("return", beforeExpr),
  _switch: kw("switch"),
  _throw: kw("throw", beforeExpr),
  _try: kw("try"),
  _var: kw("var"),
  _const: kw("const"),
  _while: kw("while", {isLoop: true}),
  _with: kw("with"),
  _new: kw("new", {beforeExpr: true, startsExpr: true}),
  _this: kw("this", startsExpr),
  _super: kw("super", startsExpr),
  _class: kw("class", startsExpr),
  _extends: kw("extends", beforeExpr),
  _export: kw("export"),
  _import: kw("import", startsExpr),
  _null: kw("null", startsExpr),
  _true: kw("true", startsExpr),
  _false: kw("false", startsExpr),
  _in: kw("in", {beforeExpr: true, binop: 7}),
  _instanceof: kw("instanceof", {beforeExpr: true, binop: 7}),
  _typeof: kw("typeof", {beforeExpr: true, prefix: true, startsExpr: true}),
  _void: kw("void", {beforeExpr: true, prefix: true, startsExpr: true}),
  _delete: kw("delete", {beforeExpr: true, prefix: true, startsExpr: true})
};

// Matches a whole line break (where CRLF is considered a single
// line break). Used to count lines.

var lineBreak = /\r\n?|\n|\u2028|\u2029/;
var lineBreakG = new RegExp(lineBreak.source, "g");

function isNewLine(code) {
  return code === 10 || code === 13 || code === 0x2028 || code === 0x2029
}

function nextLineBreak(code, from, end) {
  if ( end === void 0 ) end = code.length;

  for (var i = from; i < end; i++) {
    var next = code.charCodeAt(i);
    if (isNewLine(next))
      { return i < end - 1 && next === 13 && code.charCodeAt(i + 1) === 10 ? i + 2 : i + 1 }
  }
  return -1
}

var nonASCIIwhitespace = /[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/;

var skipWhiteSpace = /(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g;

var ref = Object.prototype;
var hasOwnProperty = ref.hasOwnProperty;
var toString = ref.toString;

var hasOwn = Object.hasOwn || (function (obj, propName) { return (
  hasOwnProperty.call(obj, propName)
); });

var isArray = Array.isArray || (function (obj) { return (
  toString.call(obj) === "[object Array]"
); });

var regexpCache = Object.create(null);

function wordsRegexp(words) {
  return regexpCache[words] || (regexpCache[words] = new RegExp("^(?:" + words.replace(/ /g, "|") + ")$"))
}

function codePointToString(code) {
  // UTF-16 Decoding
  if (code <= 0xFFFF) { return String.fromCharCode(code) }
  code -= 0x10000;
  return String.fromCharCode((code >> 10) + 0xD800, (code & 1023) + 0xDC00)
}

var loneSurrogate = /(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/;

// These are used when `options.locations` is on, for the
// `startLoc` and `endLoc` properties.

var Position = function Position(line, col) {
  this.line = line;
  this.column = col;
};

Position.prototype.offset = function offset (n) {
  return new Position(this.line, this.column + n)
};

var SourceLocation = function SourceLocation(p, start, end) {
  this.start = start;
  this.end = end;
  if (p.sourceFile !== null) { this.source = p.sourceFile; }
};

// The `getLineInfo` function is mostly useful when the
// `locations` option is off (for performance reasons) and you
// want to find the line/column position for a given character
// offset. `input` should be the code string that the offset refers
// into.

function getLineInfo(input, offset) {
  for (var line = 1, cur = 0;;) {
    var nextBreak = nextLineBreak(input, cur, offset);
    if (nextBreak < 0) { return new Position(line, offset - cur) }
    ++line;
    cur = nextBreak;
  }
}

// A second argument must be given to configure the parser process.
// These options are recognized (only `ecmaVersion` is required):

var defaultOptions = {
  // `ecmaVersion` indicates the ECMAScript version to parse. Must be
  // either 3, 5, 6 (or 2015), 7 (2016), 8 (2017), 9 (2018), 10
  // (2019), 11 (2020), 12 (2021), 13 (2022), 14 (2023), or `"latest"`
  // (the latest version the library supports). This influences
  // support for strict mode, the set of reserved words, and support
  // for new syntax features.
  ecmaVersion: null,
  // `sourceType` indicates the mode the code should be parsed in.
  // Can be either `"script"`, `"module"` or `"commonjs"`. This influences global
  // strict mode and parsing of `import` and `export` declarations.
  sourceType: "script",
  // When set to true, enable strict parsing mode even if `sourceType`
  // is `"script"`.
  strict: false,
  // `onInsertedSemicolon` can be a callback that will be called when
  // a semicolon is automatically inserted. It will be passed the
  // position of the inserted semicolon as an offset, and if
  // `locations` is enabled, it is given the location as a `{line,
  // column}` object as second argument.
  onInsertedSemicolon: null,
  // `onTrailingComma` is similar to `onInsertedSemicolon`, but for
  // trailing commas.
  onTrailingComma: null,
  // By default, reserved words are only enforced if ecmaVersion >= 5.
  // Set `allowReserved` to a boolean value to explicitly turn this on
  // an off. When this option has the value "never", reserved words
  // and keywords can also not be used as property names.
  allowReserved: null,
  // When enabled, a return at the top level is not considered an
  // error.
  allowReturnOutsideFunction: false,
  // When enabled, import/export statements are not constrained to
  // appearing at the top of the program, and an import.meta expression
  // in a script isn't considered an error.
  allowImportExportEverywhere: false,
  // By default, await identifiers are allowed to appear at the top-level scope only if ecmaVersion >= 2022.
  // When enabled, await identifiers are allowed to appear at the top-level scope,
  // but they are still not allowed in non-async functions.
  allowAwaitOutsideFunction: null,
  // When enabled, super identifiers are not constrained to
  // appearing in methods and do not raise an error when they appear elsewhere.
  allowSuperOutsideMethod: null,
  // When enabled, hashbang directive in the beginning of file is
  // allowed and treated as a line comment. Enabled by default when
  // `ecmaVersion` >= 2023.
  allowHashBang: false,
  // By default, the parser will verify that private properties are
  // only used in places where they are valid and have been declared.
  // Set this to false to turn such checks off.
  checkPrivateFields: true,
  // When `locations` is on, `loc` properties holding objects with
  // `start` and `end` properties in `{line, column}` form (with
  // line being 1-based and column 0-based) will be attached to the
  // nodes.
  locations: false,
  // Pass an optional `{line, column}` object to use for the start of
  // the parse. This is mostly useful when using `parseExpressionAt`
  // with `locations: true`, to prevent the parser from having to
  // determine the line position at the start position.
  startLocation: null,
  // A function can be passed as `onToken` option, which will
  // cause Acorn to call that function with object in the same
  // format as tokens returned from `tokenizer().getToken()`. Note
  // that you are not allowed to call the parser from the
  // callback—that will corrupt its internal state.
  onToken: null,
  // A function can be passed as `onComment` option, which will
  // cause Acorn to call that function with `(block, text, start,
  // end)` parameters whenever a comment is skipped. `block` is a
  // boolean indicating whether this is a block (`/* */`) comment,
  // `text` is the content of the comment, and `start` and `end` are
  // character offsets that denote the start and end of the comment.
  // When the `locations` option is on, two more parameters are
  // passed, the full `{line, column}` locations of the start and
  // end of the comments. Note that you are not allowed to call the
  // parser from the callback—that will corrupt its internal state.
  // When this option has an array as value, objects representing the
  // comments are pushed to it.
  onComment: null,
  // Nodes have their start and end characters offsets recorded in
  // `start` and `end` properties (directly on the node, rather than
  // the `loc` object, which holds line/column data. To also add a
  // [semi-standardized][range] `range` property holding a `[start,
  // end]` array with the same numbers, set the `ranges` option to
  // `true`.
  //
  // [range]: https://bugzilla.mozilla.org/show_bug.cgi?id=745678
  ranges: false,
  // It is possible to parse multiple files into a single AST by
  // passing the tree produced by parsing the first file as
  // `program` option in subsequent parses. This will add the
  // toplevel forms of the parsed file to the `Program` (top) node
  // of an existing parse tree.
  program: null,
  // When `locations` is on, you can pass this to record the source
  // file in every node's `loc` object.
  sourceFile: null,
  // This value, if given, is stored in every node, whether
  // `locations` is on or off.
  directSourceFile: null,
  // When enabled, parenthesized expressions are represented by
  // (non-standard) ParenthesizedExpression nodes
  preserveParens: false
};

// Interpret and default an options object

var warnedAboutEcmaVersion = false;

function getOptions(opts) {
  var options = {};

  for (var opt in defaultOptions)
    { options[opt] = opts && hasOwn(opts, opt) ? opts[opt] : defaultOptions[opt]; }

  if (options.ecmaVersion === "latest") {
    options.ecmaVersion = 1e8;
  } else if (options.ecmaVersion == null) {
    if (!warnedAboutEcmaVersion && typeof console === "object" && console.warn) {
      warnedAboutEcmaVersion = true;
      console.warn("Since Acorn 8.0.0, options.ecmaVersion is required.\nDefaulting to 2020, but this will stop working in the future.");
    }
    options.ecmaVersion = 11;
  } else if (options.ecmaVersion >= 2015) {
    options.ecmaVersion -= 2009;
  }

  if (options.allowReserved == null)
    { options.allowReserved = options.ecmaVersion < 5; }

  if (!opts || opts.allowHashBang == null)
    { options.allowHashBang = options.ecmaVersion >= 14; }

  if (isArray(options.onToken)) {
    var tokens = options.onToken;
    options.onToken = function (token) { return tokens.push(token); };
  }
  if (isArray(options.onComment))
    { options.onComment = pushComment(options, options.onComment); }

  if (options.sourceType === "commonjs" && options.allowAwaitOutsideFunction)
    { throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs") }

  return options
}

function pushComment(options, array) {
  return function(block, text, start, end, startLoc, endLoc) {
    var comment = {
      type: block ? "Block" : "Line",
      value: text,
      start: start,
      end: end
    };
    if (options.locations)
      { comment.loc = new SourceLocation(this, startLoc, endLoc); }
    if (options.ranges)
      { comment.range = [start, end]; }
    array.push(comment);
  }
}

// Each scope gets a bitset that may contain these flags
var
    SCOPE_TOP = 1,
    SCOPE_FUNCTION = 2,
    SCOPE_ASYNC = 4,
    SCOPE_GENERATOR = 8,
    SCOPE_ARROW = 16,
    SCOPE_SIMPLE_CATCH = 32,
    SCOPE_SUPER = 64,
    SCOPE_DIRECT_SUPER = 128,
    SCOPE_CLASS_STATIC_BLOCK = 256,
    SCOPE_CLASS_FIELD_INIT = 512,
    SCOPE_SWITCH = 1024,
    SCOPE_VAR = SCOPE_TOP | SCOPE_FUNCTION | SCOPE_CLASS_STATIC_BLOCK;

function functionFlags(async, generator) {
  return SCOPE_FUNCTION | (async ? SCOPE_ASYNC : 0) | (generator ? SCOPE_GENERATOR : 0)
}

// Used in checkLVal* and declareName to determine the type of a binding
var
    BIND_NONE = 0, // Not a binding
    BIND_VAR = 1, // Var-style binding
    BIND_LEXICAL = 2, // Let- or const-style binding
    BIND_FUNCTION = 3, // Function declaration
    BIND_SIMPLE_CATCH = 4, // Simple (identifier pattern) catch binding
    BIND_OUTSIDE = 5; // Special case for function names as bound inside the function

var Parser = function Parser(options, input, startPos) {
  this.options = options = getOptions(options);
  this.sourceFile = options.sourceFile;
  this.keywords = wordsRegexp(keywords$1[options.ecmaVersion >= 6 ? 6 : options.sourceType === "module" ? "5module" : 5]);
  var reserved = "";
  if (options.allowReserved !== true) {
    reserved = reservedWords[options.ecmaVersion >= 6 ? 6 : options.ecmaVersion === 5 ? 5 : 3];
    if (options.sourceType === "module") { reserved += " await"; }
  }
  this.reservedWords = wordsRegexp(reserved);
  var reservedStrict = (reserved ? reserved + " " : "") + reservedWords.strict;
  this.reservedWordsStrict = wordsRegexp(reservedStrict);
  this.reservedWordsStrictBind = wordsRegexp(reservedStrict + " " + reservedWords.strictBind);
  this.input = String(input);

  // Used to signal to callers of `readWord1` whether the word
  // contained any escape sequences. This is needed because words with
  // escape sequences must not be interpreted as keywords.
  this.containsEsc = false;

  // Set up token state

  // The current position of the tokenizer in the input.
  this.pos = startPos || 0;
  this.curLine = 1;
  if (options.startLocation) {
    this.lineStart = this.pos - options.startLocation.column;
    this.curLine = options.startLocation.line;
  } else if (startPos) {
    this.lineStart = this.input.lastIndexOf("\n", startPos - 1) + 1;
    if (this.options.locations)
      { this.curLine = this.input.slice(0, this.lineStart).split(lineBreak).length; }
  } else {
    this.lineStart = 0;
  }

  // Properties of the current token:
  // Its type
  this.type = types$1.eof;
  // For tokens that include more information than their type, the value
  this.value = null;
  // Its start and end offset
  this.start = this.end = this.pos;
  // And, if locations are used, the {line, column} object
  // corresponding to those offsets
  this.startLoc = this.endLoc = this.curPosition();

  // Position information for the previous token
  this.lastTokEndLoc = this.lastTokStartLoc = null;
  this.lastTokStart = this.lastTokEnd = this.pos;

  // The context stack is used to superficially track syntactic
  // context to predict whether a regular expression is allowed in a
  // given position.
  this.context = this.initialContext();
  this.exprAllowed = true;

  // Figure out if it's a module code.
  this.inModule = options.sourceType === "module";
  this.strict = this.inModule || options.strict === true || this.strictDirective(this.pos);

  // Used to signify the start of a potential arrow function
  this.potentialArrowAt = -1;
  this.potentialArrowInForAwait = false;

  // Positions to delayed-check that yield/await does not exist in default parameters.
  this.yieldPos = this.awaitPos = this.awaitIdentPos = 0;
  // Labels in scope.
  this.labels = [];
  // Thus-far undefined exports.
  this.undefinedExports = Object.create(null);

  // If enabled, skip leading hashbang line.
  if (this.pos === 0 && options.allowHashBang && this.input.slice(0, 2) === "#!")
    { this.skipLineComment(2); }

  // Scope tracking for duplicate variable names (see scope.js)
  this.scopeStack = [];
  this.enterScope(
    this.options.sourceType === "commonjs"
      // In commonjs, the top-level scope behaves like a function scope
      ? SCOPE_FUNCTION
      : SCOPE_TOP
  );

  // For RegExp validation
  this.regexpState = null;

  // The stack of private names.
  // Each element has two properties: 'declared' and 'used'.
  // When it exited from the outermost class definition, all used private names must be declared.
  this.privateNameStack = [];
};

var prototypeAccessors = { inFunction: { configurable: true },inGenerator: { configurable: true },inAsync: { configurable: true },canAwait: { configurable: true },allowReturn: { configurable: true },allowSuper: { configurable: true },allowDirectSuper: { configurable: true },treatFunctionsAsVar: { configurable: true },allowNewDotTarget: { configurable: true },allowUsing: { configurable: true },inClassStaticBlock: { configurable: true } };

Parser.prototype.parse = function parse () {
    var this$1$1 = this;

  var node = this.options.program || this.startNode();
  this.nextToken();
  return this.catchStackOverflow(function () { return this$1$1.parseTopLevel(node); })
};

prototypeAccessors.inFunction.get = function () { return (this.currentVarScope().flags & SCOPE_FUNCTION) > 0 };

prototypeAccessors.inGenerator.get = function () { return (this.currentVarScope().flags & SCOPE_GENERATOR) > 0 };

prototypeAccessors.inAsync.get = function () { return (this.currentVarScope().flags & SCOPE_ASYNC) > 0 };

prototypeAccessors.canAwait.get = function () {
  for (var i = this.scopeStack.length - 1; i >= 0; i--) {
    var ref = this.scopeStack[i];
      var flags = ref.flags;
    if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT)) { return false }
    if (flags & SCOPE_FUNCTION) { return (flags & SCOPE_ASYNC) > 0 }
  }
  return (this.inModule && this.options.ecmaVersion >= 13) || this.options.allowAwaitOutsideFunction
};

prototypeAccessors.allowReturn.get = function () {
  if (this.inFunction) { return true }
  if (this.options.allowReturnOutsideFunction && this.currentVarScope().flags & SCOPE_TOP) { return true }
  return false
};

prototypeAccessors.allowSuper.get = function () {
  var ref = this.currentThisScope();
    var flags = ref.flags;
  return (flags & SCOPE_SUPER) > 0 || this.options.allowSuperOutsideMethod
};

prototypeAccessors.allowDirectSuper.get = function () { return (this.currentThisScope().flags & SCOPE_DIRECT_SUPER) > 0 };

prototypeAccessors.treatFunctionsAsVar.get = function () { return this.treatFunctionsAsVarInScope(this.currentScope()) };

prototypeAccessors.allowNewDotTarget.get = function () {
  for (var i = this.scopeStack.length - 1; i >= 0; i--) {
    var ref = this.scopeStack[i];
      var flags = ref.flags;
    if (flags & (SCOPE_CLASS_STATIC_BLOCK | SCOPE_CLASS_FIELD_INIT) ||
        ((flags & SCOPE_FUNCTION) && !(flags & SCOPE_ARROW))) { return true }
  }
  return false
};

prototypeAccessors.allowUsing.get = function () {
  var ref = this.currentScope();
    var flags = ref.flags;
  if (flags & SCOPE_SWITCH) { return false }
  if (!this.inModule && flags & SCOPE_TOP) { return false }
  return true
};

prototypeAccessors.inClassStaticBlock.get = function () {
  return (this.currentVarScope().flags & SCOPE_CLASS_STATIC_BLOCK) > 0
};

Parser.extend = function extend () {
    var plugins = [], len = arguments.length;
    while ( len-- ) plugins[ len ] = arguments[ len ];

  var cls = this;
  for (var i = 0; i < plugins.length; i++) { cls = plugins[i](cls); }
  return cls
};

Parser.parse = function parse (input, options) {
  return new this(options, input).parse()
};

Parser.parseExpressionAt = function parseExpressionAt (input, pos, options) {
  var parser = new this(options, input, pos);
  parser.nextToken();
  return parser.parseExpression()
};

Parser.tokenizer = function tokenizer (input, options) {
  return new this(options, input)
};

Object.defineProperties( Parser.prototype, prototypeAccessors );

var pp$9 = Parser.prototype;

// ## Parser utilities

var literal = /^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;
pp$9.strictDirective = function(start) {
  if (this.options.ecmaVersion < 5) { return false }
  for (;;) {
    // Try to find string literal.
    skipWhiteSpace.lastIndex = start;
    start += skipWhiteSpace.exec(this.input)[0].length;
    var match = literal.exec(this.input.slice(start));
    if (!match) { return false }
    if ((match[1] || match[2]) === "use strict") {
      skipWhiteSpace.lastIndex = start + match[0].length;
      var spaceAfter = skipWhiteSpace.exec(this.input), end = spaceAfter.index + spaceAfter[0].length;
      var next = this.input.charAt(end);
      return next === ";" || next === "}" ||
        (lineBreak.test(spaceAfter[0]) &&
         !(/[(`.[+\-/*%<>=,?^&]/.test(next) || next === "!" && this.input.charAt(end + 1) === "="))
    }
    start += match[0].length;

    // Skip semicolon, if any.
    skipWhiteSpace.lastIndex = start;
    start += skipWhiteSpace.exec(this.input)[0].length;
    if (this.input[start] === ";")
      { start++; }
  }
};

// Predicate that tests whether the next token is of the given
// type, and if yes, consumes it as a side effect.

pp$9.eat = function(type) {
  if (this.type === type) {
    this.next();
    return true
  } else {
    return false
  }
};

// Tests whether parsed token is a contextual keyword.

pp$9.isContextual = function(name) {
  return this.type === types$1.name && this.value === name && !this.containsEsc
};

// Consumes contextual keyword if possible.

pp$9.eatContextual = function(name) {
  if (!this.isContextual(name)) { return false }
  this.next();
  return true
};

pp$9.catchStackOverflow = function(f) {
  try {
    return f()
  } catch (e) {
    if (e instanceof Error && (/\bstack\b.*\b(exceeded|overflow)\b/i.test(e.message) || /\btoo much recursion\b/i.test(e.message)))
      { this.raise(this.start, "Not enough stack space to parse input"); }
    else
      { throw e }
  }
};

// Asserts that following token is given contextual keyword.

pp$9.expectContextual = function(name) {
  if (!this.eatContextual(name)) { this.unexpected(); }
};

// Test whether a semicolon can be inserted at the current position.

pp$9.canInsertSemicolon = function() {
  return this.type === types$1.eof ||
    this.type === types$1.braceR ||
    lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
};

pp$9.insertSemicolon = function() {
  if (this.canInsertSemicolon()) {
    if (this.options.onInsertedSemicolon)
      { this.options.onInsertedSemicolon(this.lastTokEnd, this.lastTokEndLoc); }
    return true
  }
};

// Consume a semicolon, or, failing that, see if we are allowed to
// pretend that there is a semicolon at this position.

pp$9.semicolon = function() {
  if (!this.eat(types$1.semi) && !this.insertSemicolon()) { this.unexpected(); }
};

pp$9.afterTrailingComma = function(tokType, notNext) {
  if (this.type === tokType) {
    if (this.options.onTrailingComma)
      { this.options.onTrailingComma(this.lastTokStart, this.lastTokStartLoc); }
    if (!notNext)
      { this.next(); }
    return true
  }
};

// Expect a token of a given type. If found, consume it, otherwise,
// raise an unexpected token error.

pp$9.expect = function(type) {
  this.eat(type) || this.unexpected();
};

// Raise an unexpected token error.

pp$9.unexpected = function(pos) {
  this.raise(pos != null ? pos : this.start, "Unexpected token");
};

var DestructuringErrors = function DestructuringErrors() {
  this.shorthandAssign =
  this.trailingComma =
  this.parenthesizedAssign =
  this.parenthesizedBind =
  this.doubleProto =
    -1;
};

pp$9.checkPatternErrors = function(refDestructuringErrors, isAssign) {
  if (!refDestructuringErrors) { return }
  if (refDestructuringErrors.trailingComma > -1)
    { this.raiseRecoverable(refDestructuringErrors.trailingComma, "Comma is not permitted after the rest element"); }
  var parens = isAssign ? refDestructuringErrors.parenthesizedAssign : refDestructuringErrors.parenthesizedBind;
  if (parens > -1) { this.raiseRecoverable(parens, isAssign ? "Assigning to rvalue" : "Parenthesized pattern"); }
};

pp$9.checkExpressionErrors = function(refDestructuringErrors, andThrow) {
  if (!refDestructuringErrors) { return false }
  var shorthandAssign = refDestructuringErrors.shorthandAssign;
  var doubleProto = refDestructuringErrors.doubleProto;
  if (!andThrow) { return shorthandAssign >= 0 || doubleProto >= 0 }
  if (shorthandAssign >= 0)
    { this.raise(shorthandAssign, "Shorthand property assignments are valid only in destructuring patterns"); }
  if (doubleProto >= 0)
    { this.raiseRecoverable(doubleProto, "Redefinition of __proto__ property"); }
};

pp$9.checkYieldAwaitInDefaultParams = function() {
  if (this.yieldPos && (!this.awaitPos || this.yieldPos < this.awaitPos))
    { this.raise(this.yieldPos, "Yield expression cannot be a default value"); }
  if (this.awaitPos)
    { this.raise(this.awaitPos, "Await expression cannot be a default value"); }
};

pp$9.isSimpleAssignTarget = function(expr) {
  if (expr.type === "ParenthesizedExpression")
    { return this.isSimpleAssignTarget(expr.expression) }
  return expr.type === "Identifier" || expr.type === "MemberExpression"
};

var pp$8 = Parser.prototype;

// ### Statement parsing

// Parse a program. Initializes the parser, reads any number of
// statements, and wraps them in a Program node.  Optionally takes a
// `program` argument.  If present, the statements will be appended
// to its body instead of creating a new node.

pp$8.parseTopLevel = function(node) {
  var exports$1 = Object.create(null);
  if (!node.body) { node.body = []; }
  while (this.type !== types$1.eof) {
    var stmt = this.parseStatement(null, true, exports$1);
    node.body.push(stmt);
  }
  if (this.inModule)
    { for (var i = 0, list = Object.keys(this.undefinedExports); i < list.length; i += 1)
      {
        var name = list[i];

        this.raiseRecoverable(this.undefinedExports[name].start, ("Export '" + name + "' is not defined"));
      } }
  this.adaptDirectivePrologue(node.body);
  this.next();
  node.sourceType = this.options.sourceType === "commonjs" ? "script" : this.options.sourceType;
  return this.finishNode(node, "Program")
};

var loopLabel = {kind: "loop"}, switchLabel = {kind: "switch"};

pp$8.isLet = function(context) {
  if (this.options.ecmaVersion < 6 || !this.isContextual("let")) { return false }
  skipWhiteSpace.lastIndex = this.pos;
  var skip = skipWhiteSpace.exec(this.input);
  var next = this.pos + skip[0].length, nextCh = this.fullCharCodeAt(next);
  // For ambiguous cases, determine if a LexicalDeclaration (or only a
  // Statement) is allowed here. If context is not empty then only a Statement
  // is allowed. However, `let [` is an explicit negative lookahead for
  // ExpressionStatement, so special-case it first.
  if (nextCh === 91 || nextCh === 92) { return true } // '[', '\'
  if (context) { return false }

  if (nextCh === 123) { return true } // '{'
  if (isIdentifierStart(nextCh)) {
    var start = next;
    do { next += nextCh <= 0xffff ? 1 : 2; }
    while (isIdentifierChar(nextCh = this.fullCharCodeAt(next)))
    if (nextCh === 92) { return true }
    var ident = this.input.slice(start, next);
    if (!keywordRelationalOperator.test(ident)) { return true }
  }
  return false
};

// check 'async [no LineTerminator here] function'
// - 'async /*foo*/ function' is OK.
// - 'async /*\n*/ function' is invalid.
pp$8.isAsyncFunction = function() {
  if (this.options.ecmaVersion < 8 || !this.isContextual("async"))
    { return false }

  skipWhiteSpace.lastIndex = this.pos;
  var skip = skipWhiteSpace.exec(this.input);
  var next = this.pos + skip[0].length, after;
  return !lineBreak.test(this.input.slice(this.pos, next)) &&
    this.input.slice(next, next + 8) === "function" &&
    (next + 8 === this.input.length ||
     !(isIdentifierChar(after = this.fullCharCodeAt(next + 8)) || after === 92 /* '\' */))
};

pp$8.isUsingKeyword = function(isAwaitUsing, isFor) {
  if (this.options.ecmaVersion < 17 || !this.isContextual(isAwaitUsing ? "await" : "using"))
    { return false }

  skipWhiteSpace.lastIndex = this.pos;
  var skip = skipWhiteSpace.exec(this.input);
  var next = this.pos + skip[0].length;

  if (lineBreak.test(this.input.slice(this.pos, next))) { return false }

  if (isAwaitUsing) {
    var usingEndPos = next + 5 /* using */, after;
    if (this.input.slice(next, usingEndPos) !== "using" ||
      usingEndPos === this.input.length ||
      isIdentifierChar(after = this.fullCharCodeAt(usingEndPos)) ||
      after === 92 /* '\' */
    ) { return false }

    skipWhiteSpace.lastIndex = usingEndPos;
    var skipAfterUsing = skipWhiteSpace.exec(this.input);
    next = usingEndPos + skipAfterUsing[0].length;
    if (skipAfterUsing && lineBreak.test(this.input.slice(usingEndPos, next))) { return false }
  }

  var ch = this.fullCharCodeAt(next);
  if (!isIdentifierStart(ch) && ch !== 92 /* '\' */) { return false }
  var idStart = next;
  do { next += ch <= 0xffff ? 1 : 2; }
  while (isIdentifierChar(ch = this.fullCharCodeAt(next)))
  if (ch === 92) { return true }
  var id = this.input.slice(idStart, next);
  if (keywordRelationalOperator.test(id)) { return false }
  if (isFor && !isAwaitUsing && id === "of") {
    // Look ahead for using declaration with initializer, i.e., `for (using of = ...)`
    skipWhiteSpace.lastIndex = next;
    var skipAfterOf = skipWhiteSpace.exec(this.input);
    next = next + skipAfterOf[0].length;
    if (this.input.charCodeAt(next) !== 61 /* '=' */ ||
      // Check for ==, === and => operators
      (ch = this.input.charCodeAt(next + 1)) === 61 /* '=' */ || ch === 62 /* '>' */) {
      return false
    }
  }
  return true
};

pp$8.isAwaitUsing = function(isFor) {
  return this.isUsingKeyword(true, isFor)
};

pp$8.isUsing = function(isFor) {
  return this.isUsingKeyword(false, isFor)
};

// Parse a single statement.
//
// If expecting a statement and finding a slash operator, parse a
// regular expression literal. This is to handle cases like
// `if (foo) /blah/.exec(foo)`, where looking at the previous token
// does not help.

pp$8.parseStatement = function(context, topLevel, exports$1) {
  var starttype = this.type, node = this.startNode(), kind;

  if (this.isLet(context)) {
    starttype = types$1._var;
    kind = "let";
  }

  // Most types of statements are recognized by the keyword they
  // start with. Many are trivial to parse, some require a bit of
  // complexity.

  switch (starttype) {
  case types$1._break: case types$1._continue: return this.parseBreakContinueStatement(node, starttype.keyword)
  case types$1._debugger: return this.parseDebuggerStatement(node)
  case types$1._do: return this.parseDoStatement(node)
  case types$1._for: return this.parseForStatement(node)
  case types$1._function:
    // Function as sole body of either an if statement or a labeled statement
    // works, but not when it is part of a labeled statement that is the sole
    // body of an if statement.
    if ((context && (this.strict || context !== "if" && context !== "label")) && this.options.ecmaVersion >= 6) { this.unexpected(); }
    return this.parseFunctionStatement(node, false, !context)
  case types$1._class:
    if (context) { this.unexpected(); }
    return this.parseClass(node, true)
  case types$1._if: return this.parseIfStatement(node)
  case types$1._return: return this.parseReturnStatement(node)
  case types$1._switch: return this.parseSwitchStatement(node)
  case types$1._throw: return this.parseThrowStatement(node)
  case types$1._try: return this.parseTryStatement(node)
  case types$1._const: case types$1._var:
    kind = kind || this.value;
    if (context && kind !== "var") { this.unexpected(); }
    return this.parseVarStatement(node, kind)
  case types$1._while: return this.parseWhileStatement(node)
  case types$1._with: return this.parseWithStatement(node)
  case types$1.braceL: return this.parseBlock(true, node)
  case types$1.semi: return this.parseEmptyStatement(node)
  case types$1._export:
  case types$1._import:
    if (this.options.ecmaVersion > 10 && starttype === types$1._import) {
      skipWhiteSpace.lastIndex = this.pos;
      var skip = skipWhiteSpace.exec(this.input);
      var next = this.pos + skip[0].length, nextCh = this.input.charCodeAt(next);
      if (nextCh === 40 || nextCh === 46) // '(' or '.'
        { return this.parseExpressionStatement(node, this.parseExpression()) }
    }

    if (!this.options.allowImportExportEverywhere) {
      if (!topLevel)
        { this.raise(this.start, "'import' and 'export' may only appear at the top level"); }
      if (!this.inModule)
        { this.raise(this.start, "'import' and 'export' may appear only with 'sourceType: module'"); }
    }
    return starttype === types$1._import ? this.parseImport(node) : this.parseExport(node, exports$1)

    // If the statement does not start with a statement keyword or a
    // brace, it's an ExpressionStatement or LabeledStatement. We
    // simply start parsing an expression, and afterwards, if the
    // next token is a colon and the expression was a simple
    // Identifier node, we switch to interpreting it as a label.
  default:
    if (this.isAsyncFunction()) {
      if (context) { this.unexpected(); }
      this.next();
      return this.parseFunctionStatement(node, true, !context)
    }

    var usingKind = this.isAwaitUsing(false) ? "await using" : this.isUsing(false) ? "using" : null;
    if (usingKind) {
      if (!this.allowUsing) {
        this.raise(this.start, "Using declaration cannot appear in the top level when source type is `script` or in the bare case statement");
      }
      if (context) {
        // Cases like `for (;;) using x = ...;`, `if (true) await using x = ...;`, etc. are not allowed.
        this.raise(this.start, "Using declaration is not allowed in single-statement positions");
      }
      if (usingKind === "await using") {
        if (!this.canAwait) {
          this.raise(this.start, "Await using cannot appear outside of async function");
        }
        this.next();
      }
      this.next();
      this.parseVar(node, false, usingKind);
      this.semicolon();
      return this.finishNode(node, "VariableDeclaration")
    }

    var maybeName = this.value, expr = this.parseExpression();
    if (starttype === types$1.name && expr.type === "Identifier" && this.eat(types$1.colon))
      { return this.parseLabeledStatement(node, maybeName, expr, context) }
    else { return this.parseExpressionStatement(node, expr) }
  }
};

pp$8.parseBreakContinueStatement = function(node, keyword) {
  var isBreak = keyword === "break";
  this.next();
  if (this.eat(types$1.semi) || this.insertSemicolon()) { node.label = null; }
  else if (this.type !== types$1.name) { this.unexpected(); }
  else {
    node.label = this.parseIdent();
    this.semicolon();
  }

  // Verify that there is an actual destination to break or
  // continue to.
  var i = 0;
  for (; i < this.labels.length; ++i) {
    var lab = this.labels[i];
    if (node.label == null || lab.name === node.label.name) {
      if (lab.kind != null && (isBreak || lab.kind === "loop")) { break }
      if (node.label && isBreak) { break }
    }
  }
  if (i === this.labels.length) { this.raise(node.start, "Unsyntactic " + keyword); }
  return this.finishNode(node, isBreak ? "BreakStatement" : "ContinueStatement")
};

pp$8.parseDebuggerStatement = function(node) {
  this.next();
  this.semicolon();
  return this.finishNode(node, "DebuggerStatement")
};

pp$8.parseDoStatement = function(node) {
  this.next();
  this.labels.push(loopLabel);
  node.body = this.parseStatement("do");
  this.labels.pop();
  this.expect(types$1._while);
  node.test = this.parseParenExpression();
  if (this.options.ecmaVersion >= 6)
    { this.eat(types$1.semi); }
  else
    { this.semicolon(); }
  return this.finishNode(node, "DoWhileStatement")
};

// Disambiguating between a `for` and a `for`/`in` or `for`/`of`
// loop is non-trivial. Basically, we have to parse the init `var`
// statement or expression, disallowing the `in` operator (see
// the second parameter to `parseExpression`), and then check
// whether the next token is `in` or `of`. When there is no init
// part (semicolon immediately after the opening parenthesis), it
// is a regular `for` loop.

pp$8.parseForStatement = function(node) {
  this.next();
  var awaitAt = (this.options.ecmaVersion >= 9 && this.canAwait && this.eatContextual("await")) ? this.lastTokStart : -1;
  this.labels.push(loopLabel);
  this.enterScope(0);
  this.expect(types$1.parenL);
  if (this.type === types$1.semi) {
    if (awaitAt > -1) { this.unexpected(awaitAt); }
    return this.parseFor(node, null)
  }
  var isLet = this.isLet();
  if (this.type === types$1._var || this.type === types$1._const || isLet) {
    var init$1 = this.startNode(), kind = isLet ? "let" : this.value;
    this.next();
    this.parseVar(init$1, true, kind);
    this.finishNode(init$1, "VariableDeclaration");
    return this.parseForAfterInit(node, init$1, awaitAt)
  }
  var startsWithLet = this.isContextual("let"), isForOf = false;

  var usingKind = this.isUsing(true) ? "using" : this.isAwaitUsing(true) ? "await using" : null;
  if (usingKind) {
    var init$2 = this.startNode();
    this.next();
    if (usingKind === "await using") {
      if (!this.canAwait) {
        this.raise(this.start, "Await using cannot appear outside of async function");
      }
      this.next();
    }
    this.parseVar(init$2, true, usingKind);
    this.finishNode(init$2, "VariableDeclaration");
    return this.parseForAfterInit(node, init$2, awaitAt)
  }
  var containsEsc = this.containsEsc;
  var refDestructuringErrors = new DestructuringErrors;
  var initPos = this.start;
  var init = awaitAt > -1
    ? this.parseExprSubscripts(refDestructuringErrors, "await")
    : this.parseExpression(true, refDestructuringErrors);
  if (this.type === types$1._in || (isForOf = this.options.ecmaVersion >= 6 && this.isContextual("of"))) {
    if (awaitAt > -1) { // implies `ecmaVersion >= 9` (see declaration of awaitAt)
      if (this.type === types$1._in) { this.unexpected(awaitAt); }
      node.await = true;
    } else if (isForOf && this.options.ecmaVersion >= 8) {
      if (init.start === initPos && !containsEsc && init.type === "Identifier" && init.name === "async") { this.unexpected(); }
      else if (this.options.ecmaVersion >= 9) { node.await = false; }
    }
    if (startsWithLet && isForOf) { this.raise(init.start, "The left-hand side of a for-of loop may not start with 'let'."); }
    this.toAssignable(init, false, refDestructuringErrors);
    this.checkLValPattern(init);
    return this.parseForIn(node, init)
  } else {
    this.checkExpressionErrors(refDestructuringErrors, true);
  }
  if (awaitAt > -1) { this.unexpected(awaitAt); }
  return this.parseFor(node, init)
};

// Helper method to parse for loop after variable initialization
pp$8.parseForAfterInit = function(node, init, awaitAt) {
  if ((this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of"))) && init.declarations.length === 1) {
    if (this.type === types$1._in) {
      if ((init.kind === "using" || init.kind === "await using") && !init.declarations[0].init) {
        this.raise(this.start, "Using declaration is not allowed in for-in loops");
      }
      if (this.options.ecmaVersion >= 9 && awaitAt > -1) { this.unexpected(awaitAt); }
    } else if (this.options.ecmaVersion >= 9) { node.await = awaitAt > -1; }
    return this.parseForIn(node, init)
  }
  if (awaitAt > -1) { this.unexpected(awaitAt); }
  return this.parseFor(node, init)
};

pp$8.parseFunctionStatement = function(node, isAsync, declarationPosition) {
  this.next();
  return this.parseFunction(node, FUNC_STATEMENT | (declarationPosition ? 0 : FUNC_HANGING_STATEMENT), false, isAsync)
};

pp$8.parseIfStatement = function(node) {
  this.next();
  node.test = this.parseParenExpression();
  // allow function declarations in branches, but only in non-strict mode
  node.consequent = this.parseStatement("if");
  node.alternate = this.eat(types$1._else) ? this.parseStatement("if") : null;
  return this.finishNode(node, "IfStatement")
};

pp$8.parseReturnStatement = function(node) {
  if (!this.allowReturn)
    { this.raise(this.start, "'return' outside of function"); }
  this.next();

  // In `return` (and `break`/`continue`), the keywords with
  // optional arguments, we eagerly look for a semicolon or the
  // possibility to insert one.

  if (this.eat(types$1.semi) || this.insertSemicolon()) { node.argument = null; }
  else { node.argument = this.parseExpression(); this.semicolon(); }
  return this.finishNode(node, "ReturnStatement")
};

pp$8.parseSwitchStatement = function(node) {
  this.next();
  node.discriminant = this.parseParenExpression();
  node.cases = [];
  this.expect(types$1.braceL);
  this.labels.push(switchLabel);
  this.enterScope(SCOPE_SWITCH);

  // Statements under must be grouped (by label) in SwitchCase
  // nodes. `cur` is used to keep the node that we are currently
  // adding statements to.

  var cur;
  for (var sawDefault = false; this.type !== types$1.braceR;) {
    if (this.type === types$1._case || this.type === types$1._default) {
      var isCase = this.type === types$1._case;
      if (cur) { this.finishNode(cur, "SwitchCase"); }
      node.cases.push(cur = this.startNode());
      cur.consequent = [];
      this.next();
      if (isCase) {
        cur.test = this.parseExpression();
      } else {
        if (sawDefault) { this.raiseRecoverable(this.lastTokStart, "Multiple default clauses"); }
        sawDefault = true;
        cur.test = null;
      }
      this.expect(types$1.colon);
    } else {
      if (!cur) { this.unexpected(); }
      cur.consequent.push(this.parseStatement(null));
    }
  }
  this.exitScope();
  if (cur) { this.finishNode(cur, "SwitchCase"); }
  this.next(); // Closing brace
  this.labels.pop();
  return this.finishNode(node, "SwitchStatement")
};

pp$8.parseThrowStatement = function(node) {
  this.next();
  if (lineBreak.test(this.input.slice(this.lastTokEnd, this.start)))
    { this.raise(this.lastTokEnd, "Illegal newline after throw"); }
  node.argument = this.parseExpression();
  this.semicolon();
  return this.finishNode(node, "ThrowStatement")
};

// Reused empty array added for node fields that are always empty.

var empty$1 = [];

pp$8.parseCatchClauseParam = function() {
  var param = this.parseBindingAtom();
  var simple = param.type === "Identifier";
  this.enterScope(simple ? SCOPE_SIMPLE_CATCH : 0);
  this.checkLValPattern(param, simple ? BIND_SIMPLE_CATCH : BIND_LEXICAL);
  this.expect(types$1.parenR);

  return param
};

pp$8.parseTryStatement = function(node) {
  this.next();
  node.block = this.parseBlock();
  node.handler = null;
  if (this.type === types$1._catch) {
    var clause = this.startNode();
    this.next();
    if (this.eat(types$1.parenL)) {
      clause.param = this.parseCatchClauseParam();
    } else {
      if (this.options.ecmaVersion < 10) { this.unexpected(); }
      clause.param = null;
      this.enterScope(0);
    }
    clause.body = this.parseBlock(false);
    this.exitScope();
    node.handler = this.finishNode(clause, "CatchClause");
  }
  node.finalizer = this.eat(types$1._finally) ? this.parseBlock() : null;
  if (!node.handler && !node.finalizer)
    { this.raise(node.start, "Missing catch or finally clause"); }
  return this.finishNode(node, "TryStatement")
};

pp$8.parseVarStatement = function(node, kind, allowMissingInitializer) {
  this.next();
  this.parseVar(node, false, kind, allowMissingInitializer);
  this.semicolon();
  return this.finishNode(node, "VariableDeclaration")
};

pp$8.parseWhileStatement = function(node) {
  this.next();
  node.test = this.parseParenExpression();
  this.labels.push(loopLabel);
  node.body = this.parseStatement("while");
  this.labels.pop();
  return this.finishNode(node, "WhileStatement")
};

pp$8.parseWithStatement = function(node) {
  if (this.strict) { this.raise(this.start, "'with' in strict mode"); }
  this.next();
  node.object = this.parseParenExpression();
  node.body = this.parseStatement("with");
  return this.finishNode(node, "WithStatement")
};

pp$8.parseEmptyStatement = function(node) {
  this.next();
  return this.finishNode(node, "EmptyStatement")
};

pp$8.parseLabeledStatement = function(node, maybeName, expr, context) {
  for (var i$1 = 0, list = this.labels; i$1 < list.length; i$1 += 1)
    {
    var label = list[i$1];

    if (label.name === maybeName)
      { this.raise(expr.start, "Label '" + maybeName + "' is already declared");
  } }
  var kind = this.type.isLoop ? "loop" : this.type === types$1._switch ? "switch" : null;
  for (var i = this.labels.length - 1; i >= 0; i--) {
    var label$1 = this.labels[i];
    if (label$1.statementStart === node.start) {
      // Update information about previous labels on this node
      label$1.statementStart = this.start;
      label$1.kind = kind;
    } else { break }
  }
  this.labels.push({name: maybeName, kind: kind, statementStart: this.start});
  node.body = this.parseStatement(context ? context.indexOf("label") === -1 ? context + "label" : context : "label");
  this.labels.pop();
  node.label = expr;
  return this.finishNode(node, "LabeledStatement")
};

pp$8.parseExpressionStatement = function(node, expr) {
  node.expression = expr;
  this.semicolon();
  return this.finishNode(node, "ExpressionStatement")
};

// Parse a semicolon-enclosed block of statements, handling `"use
// strict"` declarations when `allowStrict` is true (used for
// function bodies).

pp$8.parseBlock = function(createNewLexicalScope, node, exitStrict) {
  if ( createNewLexicalScope === void 0 ) createNewLexicalScope = true;
  if ( node === void 0 ) node = this.startNode();

  node.body = [];
  this.expect(types$1.braceL);
  if (createNewLexicalScope) { this.enterScope(0); }
  while (this.type !== types$1.braceR) {
    var stmt = this.parseStatement(null);
    node.body.push(stmt);
  }
  if (exitStrict) { this.strict = false; }
  this.next();
  if (createNewLexicalScope) { this.exitScope(); }
  return this.finishNode(node, "BlockStatement")
};

// Parse a regular `for` loop. The disambiguation code in
// `parseStatement` will already have parsed the init statement or
// expression.

pp$8.parseFor = function(node, init) {
  node.init = init;
  this.expect(types$1.semi);
  node.test = this.type === types$1.semi ? null : this.parseExpression();
  this.expect(types$1.semi);
  node.update = this.type === types$1.parenR ? null : this.parseExpression();
  this.expect(types$1.parenR);
  node.body = this.parseStatement("for");
  this.exitScope();
  this.labels.pop();
  return this.finishNode(node, "ForStatement")
};

// Parse a `for`/`in` and `for`/`of` loop, which are almost
// same from parser's perspective.

pp$8.parseForIn = function(node, init) {
  var isForIn = this.type === types$1._in;
  this.next();

  if (
    init.type === "VariableDeclaration" &&
    init.declarations[0].init != null &&
    (
      !isForIn ||
      this.options.ecmaVersion < 8 ||
      this.strict ||
      init.kind !== "var" ||
      init.declarations[0].id.type !== "Identifier"
    )
  ) {
    this.raise(
      init.start,
      ((isForIn ? "for-in" : "for-of") + " loop variable declaration may not have an initializer")
    );
  }
  node.left = init;
  node.right = isForIn ? this.parseExpression() : this.parseMaybeAssign();
  this.expect(types$1.parenR);
  node.body = this.parseStatement("for");
  this.exitScope();
  this.labels.pop();
  return this.finishNode(node, isForIn ? "ForInStatement" : "ForOfStatement")
};

// Parse a list of variable declarations.

pp$8.parseVar = function(node, isFor, kind, allowMissingInitializer) {
  node.declarations = [];
  node.kind = kind;
  for (;;) {
    var decl = this.startNode();
    this.parseVarId(decl, kind);
    if (this.eat(types$1.eq)) {
      decl.init = this.parseMaybeAssign(isFor);
    } else if (!allowMissingInitializer && kind === "const" && !(this.type === types$1._in || (this.options.ecmaVersion >= 6 && this.isContextual("of")))) {
      this.unexpected();
    } else if (!allowMissingInitializer && (kind === "using" || kind === "await using") && this.options.ecmaVersion >= 17 && this.type !== types$1._in && !this.is   Contextual("of")) {
      this.raise(this.lastTokEnd, ("Missing initializer in " + kind + " declaration"));
    } else if (!allowMissingInitializer && decl.id.type !== "Identifier" && !(isFor && (this.type === types$1._in || this.isContextual("of")))) {
      this.raise(this.lastTokEnd, "Complex binding patterns require an initialization value");
    } else {
      decl.init = null;
    }
    node.declarations.push(this.finishNode(decl, "VariableDeclarator"));
    if (!this.eat(types$1.comma)) { break }
  }
  return node
};

pp$8.parseVarId = function(decl, kind) {
  decl.id = kind === "using" || kind === "await using"
    ? this.parseIdent()
    : this.parseBindingAtom();

  this.checkLValPattern(decl.id, kind === "var" ? BIND_VAR : BIND_LEXICAL, false);
};

var FUNC_STATEMENT = 1, FUNC_HANGING_STATEMENT = 2, FUNC_NULLABLE_ID = 4;

// Parse a function declaration or literal (depending on the
// `statement & FUNC_STATEMENT`).

// Remove `allowExpressionBody` for 7.0.0, as it is only called with false
pp$8.parseFunction = function(node, statement, allowExpressionBody, isAsync, forInit) {
  this.initFunction(node);
  if (this.options.ecmaVersion >= 9 || this.options.ecmaVersion >= 6 && !isAsync) {
    if (this.type === types$1.star && (statement & FUNC_HANGING_STATEMENT))
      { this.unexpected(); }
    node.generator = this.eat(types$1.star);
  }
  if (this.options.ecmaVersion >= 8)
    { node.async = !!isAsync; }

  if (statement & FUNC_STATEMENT) {
    node.id = (statement & FUNC_NULLABLE_ID) && this.type !== types$1.name ? null : this.parseIdent();
    if (node.id && !(statement & FUNC_HANGING_STATEMENT))
      // If it is a regular function declaration in sloppy mode, then it is
      // subject to Annex B semantics (BIND_FUNCTION). Otherwise, the binding
      // mode depends on properties of the current scope (see
      // treatFunctionsAsVar).
      { this.checkLValSimple(node.id, (this.strict || node.generator || node.async) ? this.treatFunctionsAsVar ? BIND_VAR : BIND_LEXICAL : BIND_FUNCTION); }
  }

  var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
  this.yieldPos = 0;
  this.awaitPos = 0;
  this.awaitIdentPos = 0;
  this.enterScope(functionFlags(node.async, node.generator));

  if (!(statement & FUNC_STATEMENT))
    { node.id = this.type === types$1.name ? this.parseIdent() : null; }

  this.parseFunctionParams(node);
  this.parseFunctionBody(node, allowExpressionBody, false, forInit);

  this.yieldPos = oldYieldPos;
  this.awaitPos = oldAwaitPos;
  this.awaitIdentPos = oldAwaitIdentPos;
  return this.finishNode(node, (statement & FUNC_STATEMENT) ? "FunctionDeclaration" : "FunctionExpression")
};

pp$8.parseFunctionParams = function(node) {
  this.expect(types$1.parenL);
  node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);
  this.checkYieldAwaitInDefaultParams();
};

// Parse a class declaration or literal (depending on the
// `isStatement` parameter).

pp$8.parseClass = function(node, isStatement) {
  this.next();

  // ecma-262 14.6 Class Definitions
  // A class definition is always strict mode code.
  var oldStrict = this.strict;
  this.strict = true;

  this.parseClassId(node, isStatement);
  this.parseClassSuper(node);
  var privateNameMap = this.enterClassBody();
  var classBody = this.startNode();
  var hadConstructor = false;
  classBody.body = [];
  this.expect(types$1.braceL);
  while (this.type !== types$1.braceR) {
    var element = this.parseClassElement(node.superClass !== null);
    if (element) {
      classBody.body.push(element);
      if (element.type === "MethodDefinition" && element.kind === "constructor") {
        if (hadConstructor) { this.raiseRecoverable(element.start, "Duplicate constructor in the same class"); }
        hadConstructor = true;
      } else if (element.key && element.key.type === "PrivateIdentifier" && isPrivateNameConflicted(privateNameMap, element)) {
        this.raiseRecoverable(element.key.start, ("Identifier '#" + (element.key.name) + "' has already been declared"));
      }
    }
  }
  this.strict = oldStrict;
  this.next();
  node.body = this.finishNode(classBody, "ClassBody");
  this.exitClassBody();
  return this.finishNode(node, isStatement ? "ClassDeclaration" : "ClassExpression")
};

pp$8.parseClassElement = function(constructorAllowsSuper) {
  if (this.eat(types$1.semi)) { return null }

  var ecmaVersion = this.options.ecmaVersion;
  var node = this.startNode();
  var keyName = "";
  var isGenerator = false;
  var isAsync = false;
  var kind = "method";
  var isStatic = false;

  if (this.eatContextual("static")) {
    // Parse static init block
    if (ecmaVersion >= 13 && this.eat(types$1.braceL)) {
      this.parseClassStaticBlock(node);
      return node
    }
    if (this.isClassElementNameStart() || this.type === types$1.star) {
      isStatic = true;
    } else {
      keyName = "static";
    }
  }
  node.static = isStatic;
  if (!keyName && ecmaVersion >= 8 && this.eatContextual("async")) {
    if ((this.isClassElementNameStart() || this.type === types$1.star) && !this.canInsertSemicolon()) {
      isAsync = true;
    } else {
      keyName = "async";
    }
  }
  if (!keyName && (ecmaVersion >= 9 || !isAsync) && this.eat(types$1.star)) {
    isGenerator = true;
  }
  if (!keyName && !isAsync && !isGenerator) {
    var lastValue = this.value;
    if (this.eatContextual("get") || this.eatContextual("set")) {
      if (this.isClassElementNameStart()) {
        kind = lastValue;
      } else {
        keyName = lastValue;
      }
    }
  }

  // Parse element name
  if (keyName) {
    // 'async', 'get', 'set', or 'static' were not a keyword contextually.
    // The last token is any of those. Make it the element name.
    node.computed = false;
    node.key = this.startNodeAt(this.lastTokStart, this.lastTokStartLoc);
    node.key.name = keyName;
    this.finishNode(node.key, "Identifier");
  } else {
    this.parseClassElementName(node);
  }

  // Parse element value
  if (ecmaVersion < 13 || this.type === types$1.parenL || kind !== "method" || isGenerator || isAsync) {
    var isConstructor = !node.static && checkKeyName(node, "constructor");
    var allowsDirectSuper = isConstructor && constructorAllowsSuper;
    // Couldn't move this check into the 'parseClassMethod' method for backward compatibility.
    if (isConstructor && kind !== "method") { this.raise(node.key.start, "Constructor can't have get/set modifier"); }
    node.kind = isConstructor ? "constructor" : kind;
    this.parseClassMethod(node, isGenerator, isAsync, allowsDirectSuper);
  } else {
    this.parseClassField(node);
  }

  return node
};

pp$8.isClassElementNameStart = function() {
  return (
    this.type === types$1.name ||
    this.type === types$1.privateId ||
    this.type === types$1.num ||
    this.type === types$1.string ||
    this.type === types$1.bracketL ||
    this.type.keyword
  )
};

pp$8.parseClassElementName = function(element) {
  if (this.type === types$1.privateId) {
    if (this.value === "constructor") {
      this.raise(this.start, "Classes can't have an element named '#constructor'");
    }
    element.computed = false;
    element.key = this.parsePrivateIdent();
  } else {
    this.parsePropertyName(element);
  }
};

pp$8.parseClassMethod = function(method, isGenerator, isAsync, allowsDirectSuper) {
  // Check key and flags
  var key = method.key;
  if (method.kind === "constructor") {
    if (isGenerator) { this.raise(key.start, "Constructor can't be a generator"); }
    if (isAsync) { this.raise(key.start, "Constructor can't be an async method"); }
  } else if (method.static && checkKeyName(method, "prototype")) {
    this.raise(key.start, "Classes may not have a static property named prototype");
  }

  // Parse value
  var value = method.value = this.parseMethod(isGenerator, isAsync, allowsDirectSuper);

  // Check value
  if (method.kind === "get" && value.params.length !== 0)
    { this.raiseRecoverable(value.start, "getter should have no params"); }
  if (method.kind === "set" && value.params.length !== 1)
    { this.raiseRecoverable(value.start, "setter should have exactly one param"); }
  if (method.kind === "set" && value.params[0].type === "RestElement")
    { this.raiseRecoverable(value.params[0].start, "Setter cannot use rest params"); }

  return this.finishNode(method, "MethodDefinition")
};

pp$8.parseClassField = function(field) {
  if (checkKeyName(field, "constructor")) {
    this.raise(field.key.start, "Classes can't have a field named 'constructor'");
  } else if (field.static && checkKeyName(field, "prototype")) {
    this.raise(field.key.start, "Classes can't have a static field named 'prototype'");
  }

  if (this.eat(types$1.eq)) {
    // To raise SyntaxError if 'arguments' exists in the initializer.
    this.enterScope(SCOPE_CLASS_FIELD_INIT | SCOPE_SUPER);
    field.value = this.parseMaybeAssign();
    this.exitScope();
  } else {
    field.value = null;
  }
  this.semicolon();

  return this.finishNode(field, "PropertyDefinition")
};

pp$8.parseClassStaticBlock = function(node) {
  node.body = [];

  var oldLabels = this.labels;
  this.labels = [];
  this.enterScope(SCOPE_CLASS_STATIC_BLOCK | SCOPE_SUPER);
  while (this.type !== types$1.braceR) {
    var stmt = this.parseStatement(null);
    node.body.push(stmt);
  }
  this.next();
  this.exitScope();
  this.labels = oldLabels;

  return this.finishNode(node, "StaticBlock")
};

pp$8.parseClassId = function(node, isStatement) {
  if (this.type === types$1.name) {
    node.id = this.parseIdent();
    if (isStatement)
      { this.checkLValSimple(node.id, BIND_LEXICAL, false); }
  } else {
    if (isStatement === true)
      { this.unexpected(); }
    node.id = null;
  }
};

pp$8.parseClassSuper = function(node) {
  node.superClass = this.eat(types$1._extends) ? this.parseExprSubscripts(null, false) : null;
};

pp$8.enterClassBody = function() {
  var element = {declared: Object.create(null), used: []};
  this.privateNameStack.push(element);
  return element.declared
};

pp$8.exitClassBody = function() {
  var ref = this.privateNameStack.pop();
  var declared = ref.declared;
  var used = ref.used;
  if (!this.options.checkPrivateFields) { return }
  var len = this.privateNameStack.length;
  var parent = len === 0 ? null : this.privateNameStack[len - 1];
  for (var i = 0; i < used.length; ++i) {
    var id = used[i];
    if (!hasOwn(declared, id.name)) {
      if (parent) {
        parent.used.push(id);
      } else {
        this.raiseRecoverable(id.start, ("Private field '#" + (id.name) + "' must be declared in an enclosing class"));
      }
    }
  }
};

function isPrivateNameConflicted(privateNameMap, element) {
  var name = element.key.name;
  var curr = privateNameMap[name];

  var next = "true";
  if (element.type === "MethodDefinition" && (element.kind === "get" || element.kind === "set")) {
    next = (element.static ? "s" : "i") + element.kind;
  }

  // `class { get #a(){}; static set #a(_){} }` is also conflict.
  if (
    curr === "iget" && next === "iset" ||
    curr === "iset" && next === "iget" ||
    curr === "sget" && next === "sset" ||
    curr === "sset" && next === "sget"
  ) {
    privateNameMap[name] = "true";
    return false
  } else if (!curr) {
    privateNameMap[name] = next;
    return false
  } else {
    return true
  }
}

function checkKeyName(node, name) {
  var computed = node.computed;
  var key = node.key;
  return !computed && (
    key.type === "Identifier" && key.name === name ||
    key.type === "Literal" && key.value === name
  )
}

// Parses module export declaration.

pp$8.parseExportAllDeclaration = function(node, exports$1) {
  if (this.options.ecmaVersion >= 11) {
    if (this.eatContextual("as")) {
      node.exported = this.parseModuleExportName();
      this.checkExport(exports$1, node.exported, this.lastTokStart);
    } else {
      node.exported = null;
    }
  }
  this.expectContextual("from");
  if (this.type !== types$1.string) { this.unexpected(); }
  node.source = this.parseExprAtom();
  if (this.options.ecmaVersion >= 16)
    { node.attributes = this.parseWithClause(); }
  this.semicolon();
  return this.finishNode(node, "ExportAllDeclaration")
};

pp$8.parseExport = function(node, exports$1) {
  this.next();
  // export * from '...'
  if (this.eat(types$1.star)) {
    return this.parseExportAllDeclaration(node, exports$1)
  }
  if (this.eat(types$1._default)) { // export default ...
    this.checkExport(exports$1, "default", this.lastTokStart);
    node.declaration = this.parseExportDefaultDeclaration();
    return this.finishNode(node, "ExportDefaultDeclaration")
  }
  // export var|const|let|function|class ...
  if (this.shouldParseExportStatement()) {
    node.declaration = this.parseExportDeclaration(node);
    if (node.declaration.type === "VariableDeclaration")
      { this.checkVariableExport(exports$1, node.declaration.declarations); }
    else
      { this.checkExport(exports$1, node.declaration.id, node.declaration.id.start); }
    node.specifiers = [];
    node.source = null;
    if (this.options.ecmaVersion >= 16)
      { node.attributes = []; }
  } else { // export { x, y as z } [from '...']
    node.declaration = null;
    node.specifiers = this.parseExportSpecifiers(exports$1);
    if (this.eatContextual("from")) {
      if (this.type !== types$1.string) { this.unexpected(); }
      node.source = this.parseExprAtom();
      if (this.options.ecmaVersion >= 16)
        { node.attributes = this.parseWithClause(); }
    } else {
      for (var i = 0, list = node.specifiers; i < list.length; i += 1) {
        // check for keywords used as local names
        var spec = list[i];

        this.checkUnreserved(spec.local);
        // check if export is defined
        this.checkLocalExport(spec.local);

        if (spec.local.type === "Literal") {
          this.raise(spec.local.start, "A string literal cannot be used as an exported binding without `from`.");
        }
      }

      node.source = null;
      if (this.options.ecmaVersion >= 16)
        { node.attributes = []; }
    }
    this.semicolon();
  }
  return this.finishNode(node, "ExportNamedDeclaration")
};

pp$8.parseExportDeclaration = function(node) {
  return this.parseStatement(null)
};

pp$8.parseExportDefaultDeclaration = function() {
  var isAsync;
  if (this.type === types$1._function || (isAsync = this.isAsyncFunction())) {
    var fNode = this.startNode();
    this.next();
    if (isAsync) { this.next(); }
    return this.parseFunction(fNode, FUNC_STATEMENT | FUNC_NULLABLE_ID, false, isAsync)
  } else if (this.type === types$1._class) {
    var cNode = this.startNode();
    return this.parseClass(cNode, "nullableID")
  } else {
    var declaration = this.parseMaybeAssign();
    this.semicolon();
    return declaration
  }
};

pp$8.checkExport = function(exports$1, name, pos) {
  if (!exports$1) { return }
  if (typeof name !== "string")
    { name = name.type === "Identifier" ? name.name : name.value; }
  if (hasOwn(exports$1, name))
    { this.raiseRecoverable(pos, "Duplicate export '" + name + "'"); }
  exports$1[name] = true;
};

pp$8.checkPatternExport = function(exports$1, pat) {
  var type = pat.type;
  if (type === "Identifier")
    { this.checkExport(exports$1, pat, pat.start); }
  else if (type === "ObjectPattern")
    { for (var i = 0, list = pat.properties; i < list.length; i += 1)
      {
        var prop = list[i];

        this.checkPatternExport(exports$1, prop);
      } }
  else if (type === "ArrayPattern")
    { for (var i$1 = 0, list$1 = pat.elements; i$1 < list$1.length; i$1 += 1) {
      var elt = list$1[i$1];

        if (elt) { this.checkPatternExport(exports$1, elt); }
    } }
  else if (type === "Property")
    { this.checkPatternExport(exports$1, pat.value); }
  else if (type === "AssignmentPattern")
    { this.checkPatternExport(exports$1, pat.left); }
  else if (type === "RestElement")
    { this.checkPatternExport(exports$1, pat.argument); }
};

pp$8.checkVariableExport = function(exports$1, decls) {
  if (!exports$1) { return }
  for (var i = 0, list = decls; i < list.length; i += 1)
    {
    var decl = list[i];

    this.checkPatternExport(exports$1, decl.id);
  }
};

pp$8.shouldParseExportStatement = function() {
  return this.type.keyword === "var" ||
    this.type.keyword === "const" ||
    this.type.keyword === "class" ||
    this.type.keyword === "function" ||
    this.isLet() ||
    this.isAsyncFunction()
};

// Parses a comma-separated list of module exports.

pp$8.parseExportSpecifier = function(exports$1) {
  var node = this.startNode();
  node.local = this.parseModuleExportName();

  node.exported = this.eatContextual("as") ? this.parseModuleExportName() : node.local;
  this.checkExport(
    exports$1,
    node.exported,
    node.exported.start
  );

  return this.finishNode(node, "ExportSpecifier")
};

pp$8.parseExportSpecifiers = function(exports$1) {
  var nodes = [], first = true;
  // export { x, y as z } [from '...']
  this.expect(types$1.braceL);
  while (!this.eat(types$1.braceR)) {
    if (!first) {
      this.expect(types$1.comma);
      if (this.afterTrailingComma(types$1.braceR)) { break }
    } else { first = false; }

    nodes.push(this.parseExportSpecifier(exports$1));
  }
  return nodes
};

// Parses import declaration.

pp$8.parseImport = function(node) {
  this.next();

  // import '...'
  if (this.type === types$1.string) {
    node.specifiers = empty$1;
    node.source = this.parseExprAtom();
  } else {
    node.specifiers = this.parseImportSpecifiers();
    this.expectContextual("from");
    node.source = this.type === types$1.string ? this.parseExprAtom() : this.unexpected();
  }
  if (this.options.ecmaVersion >= 16)
    { node.attributes = this.parseWithClause(); }
  this.semicolon();
  return this.finishNode(node, "ImportDeclaration")
};

// Parses a comma-separated list of module imports.

pp$8.parseImportSpecifier = function() {
  var node = this.startNode();
  node.imported = this.parseModuleExportName();

  if (this.eatContextual("as")) {
    node.local = this.parseIdent();
  } else {
    this.checkUnreserved(node.imported);
    node.local = node.imported;
  }
  this.checkLValSimple(node.local, BIND_LEXICAL);

  return this.finishNode(node, "ImportSpecifier")
};

pp$8.parseImportDefaultSpecifier = function() {
  // import defaultObj, { x, y as z } from '...'
  var node = this.startNode();
  node.local = this.parseIdent();
  this.checkLValSimple(node.local, BIND_LEXICAL);
  return this.finishNode(node, "ImportDefaultSpecifier")
};

pp$8.parseImportNamespaceSpecifier = function() {
  var node = this.startNode();
  this.next();
  this.expectContextual("as");
  node.local = this.parseIdent();
  this.checkLValSimple(node.local, BIND_LEXICAL);
  return this.finishNode(node, "ImportNamespaceSpecifier")
};

pp$8.parseImportSpecifiers = function() {
  var nodes = [], first = true;
  if (this.type === types$1.name) {
    nodes.push(this.parseImportDefaultSpecifier());
    if (!this.eat(types$1.comma)) { return nodes }
  }
  if (this.type === types$1.star) {
    nodes.push(this.parseImportNamespaceSpecifier());
    return nodes
  }
  this.expect(types$1.braceL);
  while (!this.eat(types$1.braceR)) {
    if (!first) {
      this.expect(types$1.comma);
      if (this.afterTrailingComma(types$1.braceR)) { break }
    } else { first = false; }

    nodes.push(this.parseImportSpecifier());
  }
  return nodes
};

pp$8.parseWithClause = function() {
  var nodes = [];
  if (!this.eat(types$1._with)) {
    return nodes
  }
  this.expect(types$1.braceL);
  var attributeKeys = {};
  var first = true;
  while (!this.eat(types$1.braceR)) {
    if (!first) {
      this.expect(types$1.comma);
      if (this.afterTrailingComma(types$1.braceR)) { break }
    } else { first = false; }

    var attr = this.parseImportAttribute();
    var keyName = attr.key.type === "Identifier" ? attr.key.name : attr.key.value;
    if (hasOwn(attributeKeys, keyName))
      { this.raiseRecoverable(attr.key.start, "Duplicate attribute key '" + keyName + "'"); }
    attributeKeys[keyName] = true;
    nodes.push(attr);
  }
  return nodes
};

pp$8.parseImportAttribute = function() {
  var node = this.startNode();
  node.key = this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never");
  this.expect(types$1.colon);
  if (this.type !== types$1.string) {
    this.unexpected();
  }
  node.value = this.parseExprAtom();
  return this.finishNode(node, "ImportAttribute")
};

pp$8.parseModuleExportName = function() {
  if (this.options.ecmaVersion >= 13 && this.type === types$1.string) {
    var stringLiteral = this.parseLiteral(this.value);
    if (loneSurrogate.test(stringLiteral.value)) {
      this.raise(stringLiteral.start, "An export name cannot include a lone surrogate.");
    }
    return stringLiteral
  }
  return this.parseIdent(true)
};

// Set `ExpressionStatement#directive` property for directive prologues.
pp$8.adaptDirectivePrologue = function(statements) {
  for (var i = 0; i < statements.length && this.isDirectiveCandidate(statements[i]); ++i) {
    statements[i].directive = statements[i].expression.raw.slice(1, -1);
  }
};
pp$8.isDirectiveCandidate = function(statement) {
  return (
    this.options.ecmaVersion >= 5 &&
    statement.type === "ExpressionStatement" &&
    statement.expression.type === "Literal" &&
    typeof statement.expression.value === "string" &&
    // Reject parenthesized strings.
    (this.input[statement.start] === "\"" || this.input[statement.start] === "'")
  )
};

var pp$7 = Parser.prototype;

// Convert existing expression atom to assignable pattern
// if possible.

pp$7.toAssignable = function(node, isBinding, refDestructuringErrors) {
  if (this.options.ecmaVersion >= 6 && node) {
    switch (node.type) {
    case "Identifier":
      if (this.inAsync && node.name === "await")
        { this.raise(node.start, "Cannot use 'await' as identifier inside an async function"); }
      break

    case "ObjectPattern":
    case "ArrayPattern":
    case "AssignmentPattern":
    case "RestElement":
      break

    case "ObjectExpression":
      node.type = "ObjectPattern";
      if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
      for (var i = 0, list = node.properties; i < list.length; i += 1) {
        var prop = list[i];

      this.toAssignable(prop, isBinding);
        // Early error:
        //   AssignmentRestProperty[Yield, Await] :
        //     `...` DestructuringAssignmentTarget[Yield, Await]
        //
        //   It is a Syntax Error if |DestructuringAssignmentTarget| is an |ArrayLiteral| or an |ObjectLiteral|.
        if (
          prop.type === "RestElement" &&
          (prop.argument.type === "ArrayPattern" || prop.argument.type === "ObjectPattern")
        ) {
          this.raise(prop.argument.start, "Unexpected token");
        }
      }
      break

    case "Property":
      // AssignmentProperty has type === "Property"
      if (node.kind !== "init") { this.raise(node.key.start, "Object pattern can't contain getter or setter"); }
      this.toAssignable(node.value, isBinding);
      break

    case "ArrayExpression":
      node.type = "ArrayPattern";
      if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
      this.toAssignableList(node.elements, isBinding);
      break

    case "SpreadElement":
      node.type = "RestElement";
      this.toAssignable(node.argument, isBinding);
      if (node.argument.type === "AssignmentPattern")
        { this.raise(node.argument.start, "Rest elements cannot have a default value"); }
      break

    case "AssignmentExpression":
      if (node.operator !== "=") { this.raise(node.left.end, "Only '=' operator can be used for specifying default value."); }
      node.type = "AssignmentPattern";
      delete node.operator;
      this.toAssignable(node.left, isBinding);
      break

    case "ParenthesizedExpression":
      this.toAssignable(node.expression, isBinding, refDestructuringErrors);
      break

    case "ChainExpression":
      this.raiseRecoverable(node.start, "Optional chaining cannot appear in left-hand side");
      break

    case "MemberExpression":
      if (!isBinding) { break }

    default:
      this.raise(node.start, "Assigning to rvalue");
    }
  } else if (refDestructuringErrors) { this.checkPatternErrors(refDestructuringErrors, true); }
  return node
};

// Convert list of expression atoms to binding list.

pp$7.toAssignableList = function(exprList, isBinding) {
  var end = exprList.length;
  for (var i = 0; i < end; i++) {
    var elt = exprList[i];
    if (elt) { this.toAssignable(elt, isBinding); }
  }
  if (end) {
    var last = exprList[end - 1];
    if (this.options.ecmaVersion === 6 && isBinding && last && last.type === "RestElement" && last.argument.type !== "Identifier")
      { this.unexpected(last.argument.start); }
  }
  return exprList
};

// Parses spread element.

pp$7.parseSpread = function(refDestructuringErrors) {
  var node = this.startNode();
  this.next();
  node.argument = this.parseMaybeAssign(false, refDestructuringErrors);
  return this.finishNode(node, "SpreadElement")
};

pp$7.parseRestBinding = function() {
  var node = this.startNode();
  this.next();

  // RestElement inside of a function parameter must be an identifier
  if (this.options.ecmaVersion === 6 && this.type !== types$1.name)
    { this.unexpected(); }

  node.argument = this.parseBindingAtom();

  return this.finishNode(node, "RestElement")
};

// Parses lvalue (assignable) atom.

pp$7.parseBindingAtom = function() {
  if (this.options.ecmaVersion >= 6) {
    switch (this.type) {
    case types$1.bracketL:
      var node = this.startNode();
      this.next();
      node.elements = this.parseBindingList(types$1.bracketR, true, true);
      return this.finishNode(node, "ArrayPattern")

    case types$1.braceL:
      return this.parseObj(true)
    }
  }
  return this.parseIdent()
};

pp$7.parseBindingList = function(close, allowEmpty, allowTrailingComma, allowModifiers) {
  var elts = [], first = true;
  while (!this.eat(close)) {
    if (first) { first = false; }
    else { this.expect(types$1.comma); }
    if (allowEmpty && this.type === types$1.comma) {
      elts.push(null);
    } else if (allowTrailingComma && this.afterTrailingComma(close)) {
      break
    } else if (this.type === types$1.ellipsis) {
      var rest = this.parseRestBinding();
      this.parseBindingListItem(rest);
      elts.push(rest);
      if (this.type === types$1.comma) { this.raiseRecoverable(this.start, "Comma is not permitted after the rest element"); }
      this.expect(close);
      break
    } else {
      elts.push(this.parseAssignableListItem(allowModifiers));
    }
  }
  return elts
};

pp$7.parseAssignableListItem = function(allowModifiers) {
  var elem = this.parseMaybeDefault(this.start, this.startLoc);
  this.parseBindingListItem(elem);
  return elem
};

pp$7.parseBindingListItem = function(param) {
  return param
};

// Parses assignment pattern around given atom if possible.

pp$7.parseMaybeDefault = function(startPos, startLoc, left) {
  left = left || this.parseBindingAtom();
  if (this.options.ecmaVersion < 6 || !this.eat(types$1.eq)) { return left }
  var node = this.startNodeAt(startPos, startLoc);
  node.left = left;
  node.right = this.parseMaybeAssign();
  return this.finishNode(node, "AssignmentPattern")
};

// The following three functions all verify that a node is an lvalue —
// something that can be bound, or assigned to. In order to do so, they perform
// a variety of checks:
//
// - Check that none of the bound/assigned-to identifiers are reserved words.
// - Record name declarations for bindings in the appropriate scope.
// - Check duplicate argument names, if checkClashes is set.
//
// If a complex binding pattern is encountered (e.g., object and array
// destructuring), the entire pattern is recursively checked.
//
// There are three versions of checkLVal*() appropriate for different
// circumstances:
//
// - checkLValSimple() shall be used if the syntactic construct supports
//   nothing other than identifiers and member expressions. Parenthesized
//   expressions are also correctly handled. This is generally appropriate for
//   constructs for which the spec says
//
//   > It is a Syntax Error if AssignmentTargetType of [the production] is not
//   > simple.
//
//   It is also appropriate for checking if an identifier is valid and not
//   defined elsewhere, like import declarations or function/class identifiers.
//
//   Examples where this is used include:
//     a += …;
//     import a from '…';
//   where a is the node to be checked.
//
// - checkLValPattern() shall be used if the syntactic construct supports
//   anything checkLValSimple() supports, as well as object and array
//   destructuring patterns. This is generally appropriate for constructs for
//   which the spec says
//
//   > It is a Syntax Error if [the production] is neither an ObjectLiteral nor
//   > an ArrayLiteral and AssignmentTargetType of [the production] is not
//   > simple.
//
//   Examples where this is used include:
//     (a = …);
//     const a = …;
//     try { … } catch (a) { … }
//   where a is the node to be checked.
//
// - checkLValInnerPattern() shall be used if the syntactic construct supports
//   anything checkLValPattern() supports, as well as default assignment
//   patterns, rest elements, and other constructs that may appear within an
//   object or array destructuring pattern.
//
//   As a special case, function parameters also use checkLValInnerPattern(),
//   as they also support defaults and rest constructs.
//
// These functions deliberately support both assignment and binding constructs,
// as the logic for both is exceedingly similar. If the node is the target of
// an assignment, then bindingType should be set to BIND_NONE. Otherwise, it
// should be set to the appropriate BIND_* constant, like BIND_VAR or
// BIND_LEXICAL.
//
// If the function is called with a non-BIND_NONE bindingType, then
// additionally a checkClashes object may be specified to allow checking for
// duplicate argument names. checkClashes is ignored if the provided construct
// is an assignment (i.e., bindingType is BIND_NONE).

pp$7.checkLValSimple = function(expr, bindingType, checkClashes) {
  if ( bindingType === void 0 ) bindingType = BIND_NONE;

  var isBind = bindingType !== BIND_NONE;

  switch (expr.type) {
  case "Identifier":
    if (this.strict && this.reservedWordsStrictBind.test(expr.name))
      { this.raiseRecoverable(expr.start, (isBind ? "Binding " : "Assigning to ") + expr.name + " in strict mode"); }
    if (isBind) {
      if (bindingType === BIND_LEXICAL && expr.name === "let")
        { this.raiseRecoverable(expr.start, "let is disallowed as a lexically bound name"); }
      if (checkClashes) {
        if (hasOwn(checkClashes, expr.name))
          { this.raiseRecoverable(expr.start, "Argument name clash"); }
        checkClashes[expr.name] = true;
      }
      if (bindingType !== BIND_OUTSIDE) { this.declareName(expr.name, bindingType, expr.start); }
    }
    break

  case "ChainExpression":
    this.raiseRecoverable(expr.start, "Optional chaining cannot appear in left-hand side");
    break

  case "MemberExpression":
    if (isBind) { this.raiseRecoverable(expr.start, "Binding member expression"); }
    break

  case "ParenthesizedExpression":
    if (isBind) { this.raiseRecoverable(expr.start, "Binding parenthesized expression"); }
    return this.checkLValSimple(expr.expression, bindingType, checkClashes)

  default:
    this.raise(expr.start, (isBind ? "Binding" : "Assigning to") + " rvalue");
  }
};

pp$7.checkLValPattern = function(expr, bindingType, checkClashes) {
  if ( bindingType === void 0 ) bindingType = BIND_NONE;

  switch (expr.type) {
  case "ObjectPattern":
    for (var i = 0, list = expr.properties; i < list.length; i += 1) {
      var prop = list[i];

    this.checkLValInnerPattern(prop, bindingType, checkClashes);
    }
    break

  case "ArrayPattern":
    for (var i$1 = 0, list$1 = expr.elements; i$1 < list$1.length; i$1 += 1) {
      var elem = list$1[i$1];

    if (elem) { this.checkLValInnerPattern(elem, bindingType, checkClashes); }
    }
    break

  default:
    this.checkLValSimple(expr, bindingType, checkClashes);
  }
};

pp$7.checkLValInnerPattern = function(expr, bindingType, checkClashes) {
  if ( bindingType === void 0 ) bindingType = BIND_NONE;

  switch (expr.type) {
  case "Property":
    // AssignmentProperty has type === "Property"
    this.checkLValInnerPattern(expr.value, bindingType, checkClashes);
    break

  case "AssignmentPattern":
    this.checkLValPattern(expr.left, bindingType, checkClashes);
    break

  case "RestElement":
    this.checkLValPattern(expr.argument, bindingType, checkClashes);
    break

  default:
    this.checkLValPattern(expr, bindingType, checkClashes);
  }
};

// The algorithm used to determine whether a regexp can appear at a
// given point in the program is loosely based on sweet.js' approach.
// See https://github.com/mozilla/sweet.js/wiki/design


var TokContext = function TokContext(token, isExpr, preserveSpace, override, generator) {
  this.token = token;
  this.isExpr = !!isExpr;
  this.preserveSpace = !!preserveSpace;
  this.override = override;
  this.generator = !!generator;
};

var types = {
  b_stat: new TokContext("{", false),
  b_expr: new TokContext("{", true),
  b_tmpl: new TokContext("${", false),
  p_stat: new TokContext("(", false),
  p_expr: new TokContext("(", true),
  q_tmpl: new TokContext("`", true, true, function (p) { return p.tryReadTemplateToken(); }),
  f_stat: new TokContext("function", false),
  f_expr: new TokContext("function", true),
  f_expr_gen: new TokContext("function", true, false, null, true),
  f_gen: new TokContext("function", false, false, null, true)
};

var pp$6 = Parser.prototype;

pp$6.initialContext = function() {
  return [types.b_stat]
};

pp$6.curContext = function() {
  return this.context[this.context.length - 1]
};

pp$6.braceIsBlock = function(prevType) {
  var parent = this.curContext();
  if (parent === types.f_expr || parent === types.f_stat)
    { return true }
  if (prevType === types$1.colon && (parent === types.b_stat || parent === types.b_expr))
    { return !parent.isExpr }

  // The check for `tt.name && exprAllowed` detects whether we are
  // after a `yield` or `of` construct. See the `updateContext` for
  // `tt.name`.
  if (prevType === types$1._return || prevType === types$1.name && this.exprAllowed)
    { return lineBreak.test(this.input.slice(this.lastTokEnd, this.start)) }
  if (prevType === types$1._else || prevType === types$1.semi || prevType === types$1.eof || prevType === types$1.parenR || prevType === types$1.arrow)
    { return true }
  if (prevType === types$1.braceL)
    { return parent === types.b_stat }
  if (prevType === types$1._var || prevType === types$1._const || prevType === types$1.name)
    { return false }
  return !this.exprAllowed
};

pp$6.inGeneratorContext = function() {
  for (var i = this.context.length - 1; i >= 1; i--) {
    var context = this.context[i];
    if (context.token === "function")
      { return context.generator }
  }
  return false
};

pp$6.updateContext = function(prevType) {
  var update, type = this.type;
  if (type.keyword && prevType === types$1.dot)
    { this.exprAllowed = false; }
  else if (update = type.updateContext)
    { update.call(this, prevType); }
  else
    { this.exprAllowed = type.beforeExpr; }
};

// Used to handle edge cases when token context could not be inferred correctly during tokenization phase

pp$6.overrideContext = function(tokenCtx) {
  if (this.curContext() !== tokenCtx) {
    this.context[this.context.length - 1] = tokenCtx;
  }
};

// Token-specific context update code

types$1.parenR.updateContext = types$1.braceR.updateContext = function() {
  if (this.context.length === 1) {
    this.exprAllowed = true;
    return
  }
  var out = this.context.pop();
  if (out === types.b_stat && this.curContext().token === "function") {
    out = this.context.pop();
  }
  this.exprAllowed = !out.isExpr;
};

types$1.braceL.updateContext = function(prevType) {
  this.context.push(this.braceIsBlock(prevType) ? types.b_stat : types.b_expr);
  this.exprAllowed = true;
};

types$1.dollarBraceL.updateContext = function() {
  this.context.push(types.b_tmpl);
  this.exprAllowed = true;
};

types$1.parenL.updateContext = function(prevType) {
  var statementParens = prevType === types$1._if || prevType === types$1._for || prevType === types$1._with || prevType === types$1._while;
  this.context.push(statementParens ? types.p_stat : types.p_expr);
  this.exprAllowed = true;
};

types$1.incDec.updateContext = function() {
  // tokExprAllowed stays unchanged
};

types$1._function.updateContext = types$1._class.updateContext = function(prevType) {
  if (prevType.beforeExpr && prevType !== types$1._else &&
      !(prevType === types$1.semi && this.curContext() !== types.p_stat) &&
      !(prevType === types$1._return && lineBreak.test(this.input.slice(this.lastTokEnd, this.start))) &&
      !((prevType === types$1.colon || prevType === types$1.braceL) && this.curContext() === types.b_stat))
    { this.context.push(types.f_expr); }
  else
    { this.context.push(types.f_stat); }
  this.exprAllowed = false;
};

types$1.colon.updateContext = function() {
  if (this.curContext().token === "function") { this.context.pop(); }
  this.exprAllowed = true;
};

types$1.backQuote.updateContext = function() {
  if (this.curContext() === types.q_tmpl)
    { this.context.pop(); }
  else
    { this.context.push(types.q_tmpl); }
  this.exprAllowed = false;
};

types$1.star.updateContext = function(prevType) {
  if (prevType === types$1._function) {
    var index = this.context.length - 1;
    if (this.context[index] === types.f_expr)
      { this.context[index] = types.f_expr_gen; }
    else
      { this.context[index] = types.f_gen; }
  }
  this.exprAllowed = true;
};

types$1.name.updateContext = function(prevType) {
  var allowed = false;
  if (this.options.ecmaVersion >= 6 && prevType !== types$1.dot) {
    if (this.value === "of" && !this.exprAllowed ||
        this.value === "yield" && this.inGeneratorContext())
      { allowed = true; }
  }
  this.exprAllowed = allowed;
};

// A recursive descent parser operates by defining functions for all
// syntactic elements, and recursively calling those, each function
// advancing the input stream and returning an AST node. Precedence
// of constructs (for example, the fact that `!x[1]` means `!(x[1])`
// instead of `(!x)[1]` is handled by the fact that the parser
// function that parses unary prefix operators is called first, and
// in turn calls the function that parses `[]` subscripts — that
// way, it'll receive the node for `x[1]` already parsed, and wraps
// *that* in the unary operator node.
//
// Acorn uses an [operator precedence parser][opp] to handle binary
// operator precedence, because it is much more compact than using
// the technique outlined above, which uses different, nesting
// functions to specify precedence, for all of the ten binary
// precedence levels that JavaScript defines.
//
// [opp]: http://en.wikipedia.org/wiki/Operator-precedence_parser


var pp$5 = Parser.prototype;

// Check if property name clashes with already added.
// Object/class getters and setters are not allowed to clash —
// either with each other or with an init property — and in
// strict mode, init properties are also not allowed to be repeated.

pp$5.checkPropClash = function(prop, propHash, refDestructuringErrors) {
  if (this.options.ecmaVersion >= 9 && prop.type === "SpreadElement")
    { return }
  if (this.options.ecmaVersion >= 6 && (prop.computed || prop.method || prop.shorthand))
    { return }
  var key = prop.key;
  var name;
  switch (key.type) {
  case "Identifier": name = key.name; break
  case "Literal": name = String(key.value); break
  default: return
  }
  var kind = prop.kind;
  if (this.options.ecmaVersion >= 6) {
    if (name === "__proto__" && kind === "init") {
      if (propHash.proto) {
        if (refDestructuringErrors) {
          if (refDestructuringErrors.doubleProto < 0) {
            refDestructuringErrors.doubleProto = key.start;
          }
        } else {
          this.raiseRecoverable(key.start, "Redefinition of __proto__ property");
        }
      }
      propHash.proto = true;
    }
    return
  }
  name = "$" + name;
  var other = propHash[name];
  if (other) {
    var redefinition;
    if (kind === "init") {
      redefinition = this.strict && other.init || other.get || other.set;
    } else {
      redefinition = other.init || other[kind];
    }
    if (redefinition)
      { this.raiseRecoverable(key.start, "Redefinition of property"); }
  } else {
    other = propHash[name] = {
      init: false,
      get: false,
      set: false
    };
  }
  other[kind] = true;
};

// ### Expression parsing

// These nest, from the most general expression type at the top to
// 'atomic', nondivisible expression types at the bottom. Most of
// the functions will simply let the function(s) below them parse,
// and, *if* the syntactic construct they handle is present, wrap
// the AST node that the inner parser gave them in another node.

// Parse a full expression. The optional arguments are used to
// forbid the `in` operator (in for loops initalization expressions)
// and provide reference for storing '=' operator inside shorthand
// property assignment in contexts where both object expression
// and object pattern might appear (so it's possible to raise
// delayed syntax error at correct position).

pp$5.parseExpression = function(forInit, refDestructuringErrors) {
  var this$1$1 = this;

  return this.catchStackOverflow(function () {
    var startPos = this$1$1.start, startLoc = this$1$1.startLoc;
    var expr = this$1$1.parseMaybeAssign(forInit, refDestructuringErrors);
    if (this$1$1.type === types$1.comma) {
      var node = this$1$1.startNodeAt(startPos, startLoc);
      node.expressions = [expr];
      while (this$1$1.eat(types$1.comma)) { node.expressions.push(this$1$1.parseMaybeAssign(forInit, refDestructuringErrors)); }
      return this$1$1.finishNode(node, "SequenceExpression")
    }
    return expr
  })
};

// Parse an assignment expression. This includes applications of
// operators like `+=`.

pp$5.parseMaybeAssign = function(forInit, refDestructuringErrors, afterLeftParse) {
  if (this.isContextual("yield")) {
    if (this.inGenerator) { return this.parseYield(forInit) }
    // The tokenizer will assume an expression is allowed after
    // `yield`, but this isn't that kind of yield
    else { this.exprAllowed = false; }
  }

  var ownDestructuringErrors = false, oldParenAssign = -1, oldTrailingComma = -1, oldDoubleProto = -1;
  if (refDestructuringErrors) {
    oldParenAssign = refDestructuringErrors.parenthesizedAssign;
    oldTrailingComma = refDestructuringErrors.trailingComma;
    oldDoubleProto = refDestructuringErrors.doubleProto;
    refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = -1;
  } else {
    refDestructuringErrors = new DestructuringErrors;
    ownDestructuringErrors = true;
  }

  var startPos = this.start, startLoc = this.startLoc;
  if (this.type === types$1.parenL || this.type === types$1.name) {
    this.potentialArrowAt = this.start;
    this.potentialArrowInForAwait = forInit === "await";
  }
  var left = this.parseMaybeConditional(forInit, refDestructuringErrors);
  if (afterLeftParse) { left = afterLeftParse.call(this, left, startPos, startLoc); }
  if (this.type.isAssign) {
    var node = this.startNodeAt(startPos, startLoc);
    node.operator = this.value;
    if (this.type === types$1.eq)
      { left = this.toAssignable(left, false, refDestructuringErrors); }
    if (!ownDestructuringErrors) {
      refDestructuringErrors.parenthesizedAssign = refDestructuringErrors.trailingComma = refDestructuringErrors.doubleProto = -1;
    }
    if (refDestructuringErrors.shorthandAssign >= left.start)
      { refDestructuringErrors.shorthandAssign = -1; } // reset because shorthand default was used correctly
    if (this.type === types$1.eq)
      { this.checkLValPattern(left); }
    else
      { this.checkLValSimple(left); }
    node.left = left;
    this.next();
    node.right = this.parseMaybeAssign(forInit);
    if (oldDoubleProto > -1) { refDestructuringErrors.doubleProto = oldDoubleProto; }
    return this.finishNode(node, "AssignmentExpression")
  } else {
    if (ownDestructuringErrors) { this.checkExpressionErrors(refDestructuringErrors, true); }
  }
  if (oldParenAssign > -1) { refDestructuringErrors.parenthesizedAssign = oldParenAssign; }
  if (oldTrailingComma > -1) { refDestructuringErrors.trailingComma = oldTrailingComma; }
  return left
};

// Parse a ternary conditional (`?:`) operator.

pp$5.parseMaybeConditional = function(forInit, refDestructuringErrors) {
  var startPos = this.start, startLoc = this.startLoc;
  var expr = this.parseExprOps(forInit, refDestructuringErrors);
  if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
  if (!(expr.type === "ArrowFunctionExpression" && expr.start === startPos) && this.eat(types$1.question)) {
    var node = this.startNodeAt(startPos, startLoc);
    node.test = expr;
    node.consequent = this.parseMaybeAssign();
    this.expect(types$1.colon);
    node.alternate = this.parseMaybeAssign(forInit);
    return this.finishNode(node, "ConditionalExpression")
  }
  return expr
};

// Start the precedence parser.

pp$5.parseExprOps = function(forInit, refDestructuringErrors) {
  var startPos = this.start, startLoc = this.startLoc;
  var expr = this.parseMaybeUnary(refDestructuringErrors, false, false, forInit);
  if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
  return expr.start === startPos && expr.type === "ArrowFunctionExpression" ? expr : this.parseExprOp(expr, startPos, startLoc, -1, forInit)
};

// Parse binary operators with the operator precedence parsing
// algorithm. `left` is the left-hand side of the operator.
// `minPrec` provides context that allows the function to stop and
// defer further parser to one of its callers when it encounters an
// operator that has a lower precedence than the set it is parsing.

pp$5.parseExprOp = function(left, leftStartPos, leftStartLoc, minPrec, forInit) {
  var prec = this.type.binop;
  if (prec != null && (!forInit || this.type !== types$1._in)) {
    if (prec > minPrec) {
      var logical = this.type === types$1.logicalOR || this.type === types$1.logicalAND;
      var coalesce = this.type === types$1.coalesce;
      if (coalesce) {
        // Handle the precedence of `tt.coalesce` as equal to the range of logical expressions.
        // In other words, `node.right` shouldn't contain logical expressions in order to check the mixed error.
        prec = types$1.logicalAND.binop;
      }
      var op = this.value;
      this.next();
      var startPos = this.start, startLoc = this.startLoc;
      var right = this.parseExprOp(this.parseMaybeUnary(null, false, false, forInit), startPos, startLoc, prec, forInit);
      var node = this.buildBinary(leftStartPos, leftStartLoc, left, right, op, logical || coalesce);
      if ((logical && this.type === types$1.coalesce) || (coalesce && (this.type === types$1.logicalOR || this.type === types$1.logicalAND))) {
        this.raiseRecoverable(this.start, "Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses");
      }
      return this.parseExprOp(node, leftStartPos, leftStartLoc, minPrec, forInit)
    }
  }
  return left
};

pp$5.buildBinary = function(startPos, startLoc, left, right, op, logical) {
  if (right.type === "PrivateIdentifier") { this.raise(right.start, "Private identifier can only be left side of binary expression"); }
  var node = this.startNodeAt(startPos, startLoc);
  node.left = left;
  node.operator = op;
  node.right = right;
  return this.finishNode(node, logical ? "LogicalExpression" : "BinaryExpression")
};

// Parse unary operators, both prefix and postfix.

pp$5.parseMaybeUnary = function(refDestructuringErrors, sawUnary, incDec, forInit) {
  var startPos = this.start, startLoc = this.startLoc, expr;
  if (this.isContextual("await") && this.canAwait) {
    expr = this.parseAwait(forInit);
    sawUnary = true;
  } else if (this.type.prefix) {
    var node = this.startNode(), update = this.type === types$1.incDec;
    node.operator = this.value;
    node.prefix = true;
    this.next();
    node.argument = this.parseMaybeUnary(null, true, update, forInit);
    this.checkExpressionErrors(refDestructuringErrors, true);
    if (update) { this.checkLValSimple(node.argument); }
    else if (this.strict && node.operator === "delete" && isLocalVariableAccess(node.argument))
      { this.raiseRecoverable(node.start, "Deleting local variable in strict mode"); }
    else if (node.operator === "delete" && isPrivateFieldAccess(node.argument))
      { this.raiseRecoverable(node.start, "Private fields can not be deleted"); }
    else { sawUnary = true; }
    expr = this.finishNode(node, update ? "UpdateExpression" : "UnaryExpression");
  } else if (!sawUnary && this.type === types$1.privateId) {
    if ((forInit || this.privateNameStack.length === 0) && this.options.checkPrivateFields) { this.unexpected(); }
    expr = this.parsePrivateIdent();
    // only could be private fields in 'in', such as #x in obj
    if (this.type !== types$1._in) { this.unexpected(); }
  } else {
    expr = this.parseExprSubscripts(refDestructuringErrors, forInit);
    if (this.checkExpressionErrors(refDestructuringErrors)) { return expr }
    while (this.type.postfix && !this.canInsertSemicolon()) {
      var node$1 = this.startNodeAt(startPos, startLoc);
      node$1.operator = this.value;
      node$1.prefix = false;
      node$1.argument = expr;
      this.checkLValSimple(expr);
      this.next();
      expr = this.finishNode(node$1, "UpdateExpression");
    }
  }

  if (!incDec && !(expr.type === "ArrowFunctionExpression" && expr.start === startPos) && this.eat(types$1.starstar)) {
    if (sawUnary)
      { this.unexpected(this.lastTokStart); }
    else
      { return this.buildBinary(startPos, startLoc, expr, this.parseMaybeUnary(null, false, false, forInit), "**", false) }
  } else {
    return expr
  }
};

function isLocalVariableAccess(node) {
  return (
    node.type === "Identifier" ||
    node.type === "ParenthesizedExpression" && isLocalVariableAccess(node.expression)
  )
}

function isPrivateFieldAccess(node) {
  return (
    node.type === "MemberExpression" && node.property.type === "PrivateIdentifier" ||
    node.type === "ChainExpression" && isPrivateFieldAccess(node.expression) ||
    node.type === "ParenthesizedExpression" && isPrivateFieldAccess(node.expression)
  )
}

// Parse call, dot, and `[]`-subscript expressions.

pp$5.parseExprSubscripts = function(refDestructuringErrors, forInit) {
  var startPos = this.start, startLoc = this.startLoc;
  var expr = this.parseExprAtom(refDestructuringErrors, forInit);
  if (expr.type === "ArrowFunctionExpression" && this.input.slice(this.lastTokStart, this.lastTokEnd) !== ")")
    { return expr }
  var result = this.parseSubscripts(expr, startPos, startLoc, false, forInit);
  if (refDestructuringErrors && result.type === "MemberExpression") {
    if (refDestructuringErrors.parenthesizedAssign >= result.start) { refDestructuringErrors.parenthesizedAssign = -1; }
    if (refDestructuringErrors.parenthesizedBind >= result.start) { refDestructuringErrors.parenthesizedBind = -1; }
    if (refDestructuringErrors.trailingComma >= result.start) { refDestructuringErrors.trailingComma = -1; }
  }
  return result
};

pp$5.parseSubscripts = function(base, startPos, startLoc, noCalls, forInit) {
  var maybeAsyncArrow = this.options.ecmaVersion >= 8 && base.type === "Identifier" && base.name === "async" &&
      this.lastTokEnd === base.end && !this.canInsertSemicolon() && base.end - base.start === 5 &&
      this.potentialArrowAt === base.start;
  var optionalChained = false;

  while (true) {
    var element = this.parseSubscript(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit);

    if (element.optional) { optionalChained = true; }
    if (element === base || element.type === "ArrowFunctionExpression") {
      if (optionalChained) {
        var chainNode = this.startNodeAt(startPos, startLoc);
        chainNode.expression = element;
        element = this.finishNode(chainNode, "ChainExpression");
      }
      return element
    }

    base = element;
  }
};

pp$5.shouldParseAsyncArrow = function() {
  return !this.canInsertSemicolon() && this.eat(types$1.arrow)
};

pp$5.parseSubscriptAsyncArrow = function(startPos, startLoc, exprList, forInit) {
  return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, true, forInit)
};

pp$5.parseSubscript = function(base, startPos, startLoc, noCalls, maybeAsyncArrow, optionalChained, forInit) {
  var optionalSupported = this.options.ecmaVersion >= 11;
  var optional = optionalSupported && this.eat(types$1.questionDot);
  if (noCalls && optional) { this.raise(this.lastTokStart, "Optional chaining cannot appear in the callee of new expressions"); }

  var computed = this.eat(types$1.bracketL);
  if (computed || (optional && this.type !== types$1.parenL && this.type !== types$1.backQuote) || this.eat(types$1.dot)) {
    var node = this.startNodeAt(startPos, startLoc);
    node.object = base;
    if (computed) {
      node.property = this.parseExpression();
      this.expect(types$1.bracketR);
    } else if (this.type === types$1.privateId && base.type !== "Super") {
      node.property = this.parsePrivateIdent();
    } else {
      node.property = this.parseIdent(this.options.allowReserved !== "never");
    }
    node.computed = !!computed;
    if (optionalSupported) {
      node.optional = optional;
    }
    base = this.finishNode(node, "MemberExpression");
  } else if (!noCalls && this.eat(types$1.parenL)) {
    var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;
    this.yieldPos = 0;
    this.awaitPos = 0;
    this.awaitIdentPos = 0;
    var exprList = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false, refDestructuringErrors);
    if (maybeAsyncArrow && !optional && this.shouldParseAsyncArrow()) {
      this.checkPatternErrors(refDestructuringErrors, false);
      this.checkYieldAwaitInDefaultParams();
      if (this.awaitIdentPos > 0)
        { this.raise(this.awaitIdentPos, "Cannot use 'await' as identifier inside an async function"); }
      this.yieldPos = oldYieldPos;
      this.awaitPos = oldAwaitPos;
      this.awaitIdentPos = oldAwaitIdentPos;
      return this.parseSubscriptAsyncArrow(startPos, startLoc, exprList, forInit)
    }
    this.checkExpressionErrors(refDestructuringErrors, true);
    this.yieldPos = oldYieldPos || this.yieldPos;
    this.awaitPos = oldAwaitPos || this.awaitPos;
    this.awaitIdentPos = oldAwaitIdentPos || this.awaitIdentPos;
    var node$1 = this.startNodeAt(startPos, startLoc);
    node$1.callee = base;
    node$1.arguments = exprList;
    if (optionalSupported) {
      node$1.optional = optional;
    }
    base = this.finishNode(node$1, "CallExpression");
  } else if (this.type === types$1.backQuote) {
    if (optional || optionalChained) {
      this.raise(this.start, "Optional chaining cannot appear in the tag of tagged template expressions");
    }
    var node$2 = this.startNodeAt(startPos, startLoc);
    node$2.tag = base;
    node$2.quasi = this.parseTemplate({isTagged: true});
    base = this.finishNode(node$2, "TaggedTemplateExpression");
  }
  return base
};

// Parse an atomic expression — either a single token that is an
// expression, an expression started by a keyword like `function` or
// `new`, or an expression wrapped in punctuation like `()`, `[]`,
// or `{}`.

pp$5.parseExprAtom = function(refDestructuringErrors, forInit, forNew) {
  // If a division operator appears in an expression position, the
  // tokenizer got confused, and we force it to read a regexp instead.
  if (this.type === types$1.slash) { this.readRegexp(); }

  var node, canBeArrow = this.potentialArrowAt === this.start;
  switch (this.type) {
  case types$1._super:
    if (!this.allowSuper)
      { this.raise(this.start, "'super' keyword outside a method"); }
    node = this.startNode();
    this.next();
    if (this.type === types$1.parenL && !this.allowDirectSuper)
      { this.raise(node.start, "super() call outside constructor of a subclass"); }
    // The `super` keyword can appear at below:
    // SuperProperty:
    //     super [ Expression ]
    //     super . IdentifierName
    // SuperCall:
    //     super ( Arguments )
    if (this.type !== types$1.dot && this.type !== types$1.bracketL && this.type !== types$1.parenL)
      { this.unexpected(); }
    return this.finishNode(node, "Super")

  case types$1._this:
    node = this.startNode();
    this.next();
    return this.finishNode(node, "ThisExpression")

  case types$1.name:
    var startPos = this.start, startLoc = this.startLoc, containsEsc = this.containsEsc;
    var id = this.parseIdent(false);
    if (this.options.ecmaVersion >= 8 && !containsEsc && id.name === "async" && !this.canInsertSemicolon() && this.eat(types$1._function)) {
      this.overrideContext(types.f_expr);
      return this.parseFunction(this.startNodeAt(startPos, startLoc), 0, false, true, forInit)
    }
    if (canBeArrow && !this.canInsertSemicolon()) {
      if (this.eat(types$1.arrow))
        { return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], false, forInit) }
      if (this.options.ecmaVersion >= 8 && id.name === "async" && this.type === types$1.name && !containsEsc &&
          (!this.potentialArrowInForAwait || this.value !== "of" || this.containsEsc)) {
        id = this.parseIdent(false);
        if (this.canInsertSemicolon() || !this.eat(types$1.arrow))
          { this.unexpected(); }
        return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), [id], true, forInit)
      }
    }
    return id

  case types$1.regexp:
    var value = this.value;
    node = this.parseLiteral(value.value);
    node.regex = {pattern: value.pattern, flags: value.flags};
    return node

  case types$1.num: case types$1.string:
    return this.parseLiteral(this.value)

  case types$1._null: case types$1._true: case types$1._false:
    node = this.startNode();
    node.value = this.type === types$1._null ? null : this.type === types$1._true;
    node.raw = this.type.keyword;
    this.next();
    return this.finishNode(node, "Literal")

  case types$1.parenL:
    var start = this.start, expr = this.parseParenAndDistinguishExpression(canBeArrow, forInit);
    if (refDestructuringErrors) {
      if (refDestructuringErrors.parenthesizedAssign < 0 && !this.isSimpleAssignTarget(expr))
        { refDestructuringErrors.parenthesizedAssign = start; }
      if (refDestructuringErrors.parenthesizedBind < 0)
        { refDestructuringErrors.parenthesizedBind = start; }
    }
    return expr

  case types$1.bracketL:
    node = this.startNode();
    this.next();
    node.elements = this.parseExprList(types$1.bracketR, true, true, refDestructuringErrors);
    return this.finishNode(node, "ArrayExpression")

  case types$1.braceL:
    this.overrideContext(types.b_expr);
    return this.parseObj(false, refDestructuringErrors)

  case types$1._function:
    node = this.startNode();
    this.next();
    return this.parseFunction(node, 0)

  case types$1._class:
    return this.parseClass(this.startNode(), false)

  case types$1._new:
    return this.parseNew()

  case types$1.backQuote:
    return this.parseTemplate()

  case types$1._import:
    if (this.options.ecmaVersion >= 11) {
      return this.parseExprImport(forNew)
    } else {
      return this.unexpected()
    }

  default:
    return this.parseExprAtomDefault()
  }
};

pp$5.parseExprAtomDefault = function() {
  this.unexpected();
};

pp$5.parseExprImport = function(forNew) {
  var node = this.startNode();

  // Consume `import` as an identifier for `import.meta`.
  // Because `this.parseIdent(true)` doesn't check escape sequences, it needs the check of `this.containsEsc`.
  if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword import"); }
  this.next();

  if (this.type === types$1.parenL && !forNew) {
    return this.parseDynamicImport(node)
  } else if (this.type === types$1.dot) {
    var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
    meta.name = "import";
    node.meta = this.finishNode(meta, "Identifier");
    return this.parseImportMeta(node)
  } else {
    this.unexpected();
  }
};

pp$5.parseDynamicImport = function(node) {
  this.next(); // skip `(`

  // Parse node.source.
  node.source = this.parseMaybeAssign();

  if (this.options.ecmaVersion >= 16) {
    if (!this.eat(types$1.parenR)) {
      this.expect(types$1.comma);
      if (!this.afterTrailingComma(types$1.parenR)) {
        node.options = this.parseMaybeAssign();
        if (!this.eat(types$1.parenR)) {
          this.expect(types$1.comma);
          if (!this.afterTrailingComma(types$1.parenR)) {
            this.unexpected();
          }
        }
      } else {
        node.options = null;
      }
    } else {
      node.options = null;
    }
  } else {
    // Verify ending.
    if (!this.eat(types$1.parenR)) {
      var errorPos = this.start;
      if (this.eat(types$1.comma) && this.eat(types$1.parenR)) {
        this.raiseRecoverable(errorPos, "Trailing comma is not allowed in import()");
      } else {
        this.unexpected(errorPos);
      }
    }
  }

  return this.finishNode(node, "ImportExpression")
};

pp$5.parseImportMeta = function(node) {
  this.next(); // skip `.`

  var containsEsc = this.containsEsc;
  node.property = this.parseIdent(true);

  if (node.property.name !== "meta")
    { this.raiseRecoverable(node.property.start, "The only valid meta property for import is 'import.meta'"); }
  if (containsEsc)
    { this.raiseRecoverable(node.start, "'import.meta' must not contain escaped characters"); }
  if (this.options.sourceType !== "module" && !this.options.allowImportExportEverywhere)
    { this.raiseRecoverable(node.start, "Cannot use 'import.meta' outside a module"); }

  return this.finishNode(node, "MetaProperty")
};

pp$5.parseLiteral = function(value) {
  var node = this.startNode();
  node.value = value;
  node.raw = this.input.slice(this.start, this.end);
  if (node.raw.charCodeAt(node.raw.length - 1) === 110)
    { node.bigint = node.value != null ? node.value.toString() : node.raw.slice(0, -1).replace(/_/g, ""); }
  this.next();
  return this.finishNode(node, "Literal")
};

pp$5.parseParenExpression = function() {
  this.expect(types$1.parenL);
  var val = this.parseExpression();
  this.expect(types$1.parenR);
  return val
};

pp$5.shouldParseArrow = function(exprList) {
  return !this.canInsertSemicolon()
};

pp$5.parseParenAndDistinguishExpression = function(canBeArrow, forInit) {
  var startPos = this.start, startLoc = this.startLoc, val, allowTrailingComma = this.options.ecmaVersion >= 8;
  if (this.options.ecmaVersion >= 6) {
    this.next();

    var innerStartPos = this.start, innerStartLoc = this.startLoc;
    var exprList = [], first = true, lastIsComma = false;
    var refDestructuringErrors = new DestructuringErrors, oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, spreadStart;
    this.yieldPos = 0;
    this.awaitPos = 0;
    // Do not save awaitIdentPos to allow checking awaits nested in parameters
    while (this.type !== types$1.parenR) {
      first ? first = false : this.expect(types$1.comma);
      if (allowTrailingComma && this.afterTrailingComma(types$1.parenR, true)) {
        lastIsComma = true;
        break
      } else if (this.type === types$1.ellipsis) {
        spreadStart = this.start;
        exprList.push(this.parseParenItem(this.parseRestBinding()));
        if (this.type === types$1.comma) {
          this.raiseRecoverable(
            this.start,
            "Comma is not permitted after the rest element"
          );
        }
        break
      } else {
        exprList.push(this.parseMaybeAssign(false, refDestructuringErrors, this.parseParenItem));
      }
    }
    var innerEndPos = this.lastTokEnd, innerEndLoc = this.lastTokEndLoc;
    this.expect(types$1.parenR);

    if (canBeArrow && this.shouldParseArrow(exprList) && this.eat(types$1.arrow)) {
      this.checkPatternErrors(refDestructuringErrors, false);
      this.checkYieldAwaitInDefaultParams();
      this.yieldPos = oldYieldPos;
      this.awaitPos = oldAwaitPos;
      return this.parseParenArrowList(startPos, startLoc, exprList, forInit)
    }

    if (!exprList.length || lastIsComma) { this.unexpected(this.lastTokStart); }
    if (spreadStart) { this.unexpected(spreadStart); }
    this.checkExpressionErrors(refDestructuringErrors, true);
    this.yieldPos = oldYieldPos || this.yieldPos;
    this.awaitPos = oldAwaitPos || this.awaitPos;

       if (exprList.length > 1) {
      val = this.startNodeAt(innerStartPos, innerStartLoc);
      val.expressions = exprList;
      this.finishNodeAt(val, "SequenceExpression", innerEndPos, innerEndLoc);
    } else {
      val = exprList[0];
    }
  } else {
    val = this.parseParenExpression();
  }

  if (this.options.preserveParens) {
    var par = this.startNodeAt(startPos, startLoc);
    par.expression = val;
    return this.finishNode(par, "ParenthesizedExpression")
  } else {
    return val
  }
};

pp$5.parseParenItem = function(item) {
  return item
};

pp$5.parseParenArrowList = function(startPos, startLoc, exprList, forInit) {
  return this.parseArrowExpression(this.startNodeAt(startPos, startLoc), exprList, false, forInit)
};

// New's precedence is slightly tricky. It must allow its argument to
// be a `[]` or dot subscript expression, but not a call — at least,
// not without wrapping it in parentheses. Thus, it uses the noCalls
// argument to parseSubscripts to prevent it from consuming the
// argument list.

var empty = [];

pp$5.parseNew = function() {
  if (this.containsEsc) { this.raiseRecoverable(this.start, "Escape sequence in keyword new"); }
  var node = this.startNode();
  this.next();
  if (this.options.ecmaVersion >= 6 && this.type === types$1.dot) {
    var meta = this.startNodeAt(node.start, node.loc && node.loc.start);
    meta.name = "new";
    node.meta = this.finishNode(meta, "Identifier");
    this.next();
    var containsEsc = this.containsEsc;
    node.property = this.parseIdent(true);
    if (node.property.name !== "target")
      { this.raiseRecoverable(node.property.start, "The only valid meta property for new is 'new.target'"); }
    if (containsEsc)
      { this.raiseRecoverable(node.start, "'new.target' must not contain escaped characters"); }
    if (!this.allowNewDotTarget)
      { this.raiseRecoverable(node.start, "'new.target' can only be used in functions and class static block"); }
    return this.finishNode(node, "MetaProperty")
  }
  var startPos = this.start, startLoc = this.startLoc;
  node.callee = this.parseSubscripts(this.parseExprAtom(null, false, true), startPos, startLoc, true, false);
  if (node.callee.type === "Super")
    { this.raiseRecoverable(startPos, "Invalid use of 'super'"); }
  if (this.eat(types$1.parenL)) { node.arguments = this.parseExprList(types$1.parenR, this.options.ecmaVersion >= 8, false); }
  else { node.arguments = empty; }
  return this.finishNode(node, "NewExpression")
};

// Parse template expression.

pp$5.parseTemplateElement = function(ref) {
  var isTagged = ref.isTagged;

  var elem = this.startNode();
  if (this.type === types$1.invalidTemplate) {
    if (!isTagged) {
      this.raiseRecoverable(this.start, "Bad escape sequence in untagged template literal");
    }
    elem.value = {
      raw: this.value.replace(/\r\n?/g, "\n"),
      cooked: null
    };
  } else {
    elem.value = {
      raw: this.input.slice(this.start, this.end).replace(/\r\n?/g, "\n"),
      cooked: this.value
    };
  }
  this.next();
  elem.tail = this.type === types$1.backQuote;
  return this.finishNode(elem, "TemplateElement")
};

pp$5.parseTemplate = function(ref) {
  if ( ref === void 0 ) ref = {};
  var isTagged = ref.isTagged; if ( isTagged === void 0 ) isTagged = false;

  var node = this.startNode();
  this.next();
  node.expressions = [];
  var curElt = this.parseTemplateElement({isTagged: isTagged});
  node.quasis = [curElt];
  while (!curElt.tail) {
    if (this.type === types$1.eof) { this.raise(this.pos, "Unterminated template literal"); }
    this.expect(types$1.dollarBraceL);
    node.expressions.push(this.parseExpression());
    this.expect(types$1.braceR);
    node.quasis.push(curElt = this.parseTemplateElement({isTagged: isTagged}));
  }
  this.next();
  return this.finishNode(node, "TemplateLiteral")
};

pp$5.isAsyncProp = function(prop) {
  return !prop.computed && prop.key.type === "Identifier" && prop.key.name === "async" &&
    (this.type === types$1.name || this.type === types$1.num || this.type === types$1.string || this.type === types$1.bracketL || this.type.keyword || (this.options.ecmaVersion >= 9 && this.type === types$1.star)) &&
    !lineBreak.test(this.input.slice(this.lastTokEnd, this.start))
};

// Parse an object literal or binding pattern.

pp$5.parseObj = function(isPattern, refDestructuringErrors) {
  var node = this.startNode(), first = true, propHash = {};
  node.properties = [];
  this.next();
  while (!this.eat(types$1.braceR)) {
    if (!first) {
      this.expect(types$1.comma);
      if (this.options.ecmaVersion >= 5 && this.afterTrailingComma(types$1.braceR)) { break }
    } else { first = false; }

    var prop = this.parseProperty(isPattern, refDestructuringErrors);
    if (!isPattern) { this.checkPropClash(prop, propHash, refDestructuringErrors); }
    node.properties.push(prop);
  }
  return this.finishNode(node, isPattern ? "ObjectPattern" : "ObjectExpression")
};

pp$5.parseProperty = function(isPattern, refDestructuringErrors) {
  var prop = this.startNode(), isGenerator, isAsync, startPos, startLoc;
  if (this.options.ecmaVersion >= 9 && this.eat(types$1.ellipsis)) {
    if (isPattern) {
      prop.argument = this.parseIdent(false);
      if (this.type === types$1.comma) {
        this.raiseRecoverable(this.start, "Comma is not permitted after the rest element");
      }
      return this.finishNode(prop, "RestElement")
    }
    // Parse argument.
    prop.argument = this.parseMaybeAssign(false, refDestructuringErrors);
    // To disallow trailing comma via `this.toAssignable()`.
    if (this.type === types$1.comma && refDestructuringErrors && refDestructuringErrors.trailingComma < 0) {
      refDestructuringErrors.trailingComma = this.start;
    }
    // Finish
    return this.finishNode(prop, "SpreadElement")
  }
  if (this.options.ecmaVersion >= 6) {
    prop.method = false;
    prop.shorthand = false;
    if (isPattern || refDestructuringErrors) {
      startPos = this.start;
      startLoc = this.startLoc;
    }
    if (!isPattern)
      { isGenerator = this.eat(types$1.star); }
  }
  var containsEsc = this.containsEsc;
  this.parsePropertyName(prop);
  if (!isPattern && !containsEsc && this.options.ecmaVersion >= 8 && !isGenerator && this.isAsyncProp(prop)) {
    isAsync = true;
    isGenerator = this.options.ecmaVersion >= 9 && this.eat(types$1.star);
    this.parsePropertyName(prop);
  } else {
    isAsync = false;
  }
  this.parsePropertyValue(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc);
  return this.finishNode(prop, "Property")
};

pp$5.parseGetterSetter = function(prop) {
  var kind = prop.key.name;
  this.parsePropertyName(prop);
  prop.value = this.parseMethod(false);
  prop.kind = kind;
  var paramCount = prop.kind === "get" ? 0 : 1;
  if (prop.value.params.length !== paramCount) {
    var start = prop.value.start;
    if (prop.kind === "get")
      { this.raiseRecoverable(start, "getter should have no params"); }
    else
      { this.raiseRecoverable(start, "setter should have exactly one param"); }
  } else {
    if (prop.kind === "set" && prop.value.params[0].type === "RestElement")
      { this.raiseRecoverable(prop.value.params[0].start, "Setter cannot use rest params"); }
  }
};

pp$5.parsePropertyValue = function(prop, isPattern, isGenerator, isAsync, startPos, startLoc, refDestructuringErrors, containsEsc) {
  if ((isGenerator || isAsync) && this.type === types$1.colon)
    { this.unexpected(); }

  if (this.eat(types$1.colon)) {
    prop.value = isPattern ? this.parseMaybeDefault(this.start, this.startLoc) : this.parseMaybeAssign(false, refDestructuringErrors);
    prop.kind = "init";
  } else if (this.options.ecmaVersion >= 6 && this.type === types$1.parenL) {
    if (isPattern) { this.unexpected(); }
    prop.method = true;
    prop.value = this.parseMethod(isGenerator, isAsync);
    prop.kind = "init";
  } else if (!isPattern && !containsEsc &&
             this.options.ecmaVersion >= 5 && !prop.computed && prop.key.type === "Identifier" &&
             (prop.key.name === "get" || prop.key.name === "set") &&
             (this.type !== types$1.comma && this.type !== types$1.braceR && this.type !== types$1.eq)) {
    if (isGenerator || isAsync) { this.unexpected(); }
    this.parseGetterSetter(prop);
  } else if (this.options.ecmaVersion >= 6 && !prop.computed && prop.key.type === "Identifier") {
    if (isGenerator || isAsync) { this.unexpected(); }
    this.checkUnreserved(prop.key);
    if (prop.key.name === "await" && !this.awaitIdentPos)
      { this.awaitIdentPos = startPos; }
    if (isPattern) {
      prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
    } else if (this.type === types$1.eq && refDestructuringErrors) {
      if (refDestructuringErrors.shorthandAssign < 0)
        { refDestructuringErrors.shorthandAssign = this.start; }
      prop.value = this.parseMaybeDefault(startPos, startLoc, this.copyNode(prop.key));
    } else {
      prop.value = this.copyNode(prop.key);
    }
    prop.kind = "init";
    prop.shorthand = true;
  } else { this.unexpected(); }
};

pp$5.parsePropertyName = function(prop) {
  if (this.options.ecmaVersion >= 6) {
    if (this.eat(types$1.bracketL)) {
      prop.computed = true;
      prop.key = this.parseMaybeAssign();
      this.expect(types$1.bracketR);
      return prop.key
    } else {
      prop.computed = false;
    }
  }
  return prop.key = this.type === types$1.num || this.type === types$1.string ? this.parseExprAtom() : this.parseIdent(this.options.allowReserved !== "never")
};

// Initialize empty function node.

pp$5.initFunction = function(node) {
  node.id = null;
  if (this.options.ecmaVersion >= 6) { node.generator = node.expression = false; }
  if (this.options.ecmaVersion >= 8) { node.async = false; }
};

// Parse object or class method.

pp$5.parseMethod = function(isGenerator, isAsync, allowDirectSuper) {
  var node = this.startNode(), oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;

  this.initFunction(node);
  if (this.options.ecmaVersion >= 6)
    { node.generator = isGenerator; }
  if (this.options.ecmaVersion >= 8)
    { node.async = !!isAsync; }

  this.yieldPos = 0;
  this.awaitPos = 0;
  this.awaitIdentPos = 0;
  this.enterScope(functionFlags(isAsync, node.generator) | SCOPE_SUPER | (allowDirectSuper ? SCOPE_DIRECT_SUPER : 0));

  this.expect(types$1.parenL);
  node.params = this.parseBindingList(types$1.parenR, false, this.options.ecmaVersion >= 8);
  this.checkYieldAwaitInDefaultParams();
  this.parseFunctionBody(node, false, true, false);

  this.yieldPos = oldYieldPos;
  this.awaitPos = oldAwaitPos;
  this.awaitIdentPos = oldAwaitIdentPos;
  return this.finishNode(node, "FunctionExpression")
};

// Parse arrow function expression with given parameters.

pp$5.parseArrowExpression = function(node, params, isAsync, forInit) {
  var oldYieldPos = this.yieldPos, oldAwaitPos = this.awaitPos, oldAwaitIdentPos = this.awaitIdentPos;

  this.enterScope(functionFlags(isAsync, false) | SCOPE_ARROW);
  this.initFunction(node);
  if (this.options.ecmaVersion >= 8) { node.async = !!isAsync; }

  this.yieldPos = 0;
  this.awaitPos = 0;
  this.awaitIdentPos = 0;

  node.params = this.toAssignableList(params, true);
  this.parseFunctionBody(node, true, false, forInit);

  this.yieldPos = oldYieldPos;
  this.awaitPos = oldAwaitPos;
  this.awaitIdentPos = oldAwaitIdentPos;
  return this.finishNode(node, "ArrowFunctionExpression")
};

// Parse function body and check parameters.

pp$5.parseFunctionBody = function(node, isArrowFunction, isMethod, forInit) {
  var isExpression = isArrowFunction && this.type !== types$1.braceL;
  var oldStrict = this.strict, useStrict = false;

  if (isExpression) {
    node.body = this.parseMaybeAssign(forInit);
    node.expression = true;
    this.checkParams(node, false);
  } else {
    var nonSimple = this.options.ecmaVersion >= 7 && !this.isSimpleParamList(node.params);
    if (!oldStrict || nonSimple) {
      useStrict = this.strictDirective(this.end);
      // If this is a strict mode function, verify that argument names
      // are not repeated, and it does not try to bind the words `eval`
      // or `arguments`.
      if (useStrict && nonSimple)
        { this.raiseRecoverable(node.start, "Illegal 'use strict' directive in function with non-simple parameter list"); }
    }
    // Start a new scope with regard to labels and the `inFunction`
    // flag (restore them to their old value afterwards).
    var oldLabels = this.labels;
    this.labels = [];
    if (useStrict) { this.strict = true; }

    // Add the params to varDeclaredNames to ensure that an error is thrown
    // if a let/const declaration in the function clashes with one of the params.
    this.checkParams(node, !oldStrict && !useStrict && !isArrowFunction && !isMethod && this.isSimpleParamList(node.params));
    // Ensure the function name isn't a forbidden identifier in strict mode, e.g. 'eval'
    if (this.strict && node.id) { this.checkLValSimple(node.id, BIND_OUTSIDE); }
    node.body = this.parseBlock(false, undefined, useStrict && !oldStrict);
    node.expression = false;
    this.adaptDirectivePrologue(node.body.body);
    this.labels = oldLabels;
  }
  this.exitScope();
};

pp$5.isSimpleParamList = function(params) {
  for (var i = 0, list = params; i < list.length; i += 1)
    {
    var param = list[i];

    if (param.type !== "Identifier") { return false
  } }
  return true
};

// Checks function params for various disallowed patterns such as using "eval"
// or "arguments" and duplicate parameters.

pp$5.checkParams = function(node, allowDuplicates) {
  var nameHash = Object.create(null);
  for (var i = 0, list = node.params; i < list.length; i += 1)
    {
    var param = list[i];

    this.checkLValInnerPattern(param, BIND_VAR, allowDuplicates ? null : nameHash);
  }
};

// Parses a comma-separated list of expressions, and returns them as
// an array. `close` is the token type that ends the list, and
// `allowEmpty` can be turned on to allow subsequent commas with
// nothing in between them to be parsed as `null` (which is needed
// for array literals).

pp$5.parseExprList = function(close, allowTrailingComma, allowEmpty, refDestructuringErrors) {
  var elts = [], first = true;
  while (!this.eat(close)) {
    if (!first) {
      this.expect(types$1.comma);
      if (allowTrailingComma && this.afterTrailingComma(close)) { break }
    } else { first = false; }

    var elt = (void 0);
    if (allowEmpty && this.type === types$1.comma)
      { elt = null; }
    else if (this.type === types$1.ellipsis) {
      elt = this.parseSpread(refDestructuringErrors);
      if (refDestructuringErrors && this.type === types$1.comma && refDestructuringErrors.trailingComma < 0)
        { refDestructuringErrors.trailingComma = this.start; }
    } else {
      elt = this.parseMaybeAssign(false, refDestructuringErrors);
    }
    elts.push(elt);
  }
  return elts
};

pp$5.checkUnreserved = function(ref) {
  var start = ref.start;
  var end = ref.end;
  var name = ref.name;

  if (this.inGenerator && name === "yield")
    { this.raiseRecoverable(start, "Cannot use 'yield' as identifier inside a generator"); }
  if (this.inAsync && name === "await")
    { this.raiseRecoverable(start, "Cannot use 'await' as identifier inside an async function"); }
  if (!(this.currentThisScope().flags & SCOPE_VAR) && name === "arguments")
    { this.raiseRecoverable(start, "Cannot use 'arguments' in class field initializer"); }
  if (this.inClassStaticBlock && (name === "arguments" || name === "await"))
    { this.raise(start, ("Cannot use " + name + " in class static initialization block")); }
  if (this.keywords.test(name))
    { this.raise(start, ("Unexpected keyword '" + name + "'")); }
  if (this.options.ecmaVersion < 6 &&
    this.input.slice(start, end).indexOf("\\") !== -1) { return }
  var re = this.strict ? this.reservedWordsStrict : this.reservedWords;
  if (re.test(name)) {
    if (!this.inAsync && name === "await")
      { this.raiseRecoverable(start, "Cannot use keyword 'await' outside an async function"); }
    this.raiseRecoverable(start, ("The keyword '" + name + "' is reserved"));
  }
};

// Parse the next token as an identifier. If `liberal` is true (used
// when parsing properties), it will also convert keywords into
// identifiers.

pp$5.parseIdent = function(liberal) {
  var node = this.parseIdentNode();
  this.next(!!liberal);
  this.finishNode(node, "Identifier");
  if (!liberal) {
    this.checkUnreserved(node);
    if (node.name === "await" && !this.awaitIdentPos)
      { this.awaitIdentPos = node.start; }
  }
  return node
};

pp$5.parseIdentNode = function() {
  var node = this.startNode();
  if (this.type === types$1.name) {
    node.name = this.value;
  } else if (this.type.keyword) {
    node.name = this.type.keyword;

    // To fix https://github.com/acornjs/acorn/issues/575
    // `class` and `function` keywords push new context into this.context.
    // But there is no chance to pop the context if the keyword is consumed as an identifier such as a property name.
    // If the previous token is a dot, this does not apply because the context-managing code already ignored the keyword
    if ((node.name === "class" || node.name === "function") &&
      (this.lastTokEnd !== this.lastTokStart + 1 || this.input.charCodeAt(this.lastTokStart) !== 46)) {
      this.context.pop();
    }
    this.type = types$1.name;
  } else {
    this.unexpected();
  }
  return node
};

pp$5.parsePrivateIdent = function() {
  var node = this.startNode();
  if (this.type === types$1.privateId) {
    node.name = this.value;
  } else {
    this.unexpected();
  }
  this.next();
  this.finishNode(node, "PrivateIdentifier");

  // For validating existence
  if (this.options.checkPrivateFields) {
    if (this.privateNameStack.length === 0) {
      this.raise(node.start, ("Private field '#" + (node.name) + "' must be declared in an enclosing class"));
    } else {
      this.privateNameStack[this.privateNameStack.length - 1].used.push(node);
    }
  }

  return node
};

// Parses yield expression inside generator.

pp$5.parseYield = function(forInit) {
  if (!this.yieldPos) { this.yieldPos = this.start; }

  var node = this.startNode();
  this.next();
  if (this.type === types$1.semi || this.canInsertSemicolon() || (this.type !== types$1.star && !this.type.startsExpr)) {
    node.delegate = false;
    node.argument = null;
  } else {
    node.delegate = this.eat(types$1.star);
    node.argument = this.parseMaybeAssign(forInit);
  }
  return this.finishNode(node, "YieldExpression")
};

pp$5.parseAwait = function(forInit) {
  if (!this.awaitPos) { this.awaitPos = this.start; }

  var node = this.startNode();
  this.next();
  node.argument = this.parseMaybeUnary(null, true, false, forInit);
  return this.finishNode(node, "AwaitExpression")
};

var pp$4 = Parser.prototype;

// This function is used to raise exceptions on parse errors. It
// takes an offset integer (into the current `input`) to indicate
// the location of the error, attaches the position to the end
// of the error message, and then raises a `SyntaxError` with that
// message.

pp$4.raise = function(pos, message) {
  var loc = getLineInfo(this.input, pos);
  message += " (" + loc.line + ":" + loc.column + ")";
  if (this.sourceFile) {
    message += " in " + this.sourceFile;
  }
  var err = new SyntaxError(message);
  err.pos = pos; err.loc = loc; err.raisedAt = this.pos;
  throw err
};

pp$4.raiseRecoverable = pp$4.raise;

pp$4.curPosition = function() {
  if (this.options.locations) {
    return new Position(this.curLine, this.pos - this.lineStart)
  }
};

var pp$3 = Parser.prototype;

var Scope = function Scope(flags) {
  this.flags = flags;
  // A list of var-declared names in the current lexical scope
  this.var = [];
  // A list of lexically-declared names in the current lexical scope
  this.lexical = [];
  // A list of lexically-declared FunctionDeclaration names in the current lexical scope
  this.functions = [];
};

// The functions in this module keep track of declared variables in the current scope in order to detect duplicate variable names.

pp$3.enterScope = function(flags) {
  this.scopeStack.push(new Scope(flags));
};

pp$3.exitScope = function() {
  this.scopeStack.pop();
};

// The spec says:
// > At the top level of a function, or script, function declarations are
// > treated like var declarations rather than like lexical declarations.
pp$3.treatFunctionsAsVarInScope = function(scope) {
  return (scope.flags & SCOPE_FUNCTION) || !this.inModule && (scope.flags & SCOPE_TOP)
};

pp$3.declareName = function(name, bindingType, pos) {
  var redeclared = false;
  if (bindingType === BIND_LEXICAL) {
    var scope = this.currentScope();
    redeclared = scope.lexical.indexOf(name) > -1 || scope.functions.indexOf(name) > -1 || scope.var.indexOf(name) > -1;
    scope.lexical.push(name);
    if (this.inModule && (scope.flags & SCOPE_TOP))
      { delete this.undefinedExports[name]; }
  } else if (bindingType === BIND_SIMPLE_CATCH) {
    var scope$1 = this.currentScope();
    scope$1.lexical.push(name);
  } else if (bindingType === BIND_FUNCTION) {
    var scope$2 = this.currentScope();
    if (this.treatFunctionsAsVar)
      { redeclared = scope$2.lexical.indexOf(name) > -1; }
    else
      { redeclared = scope$2.lexical.indexOf(name) > -1 || scope$2.var.indexOf(name) > -1; }
    scope$2.functions.push(name);
  } else {
    for (var i = this.scopeStack.length - 1; i >= 0; --i) {
      var scope$3 = this.scopeStack[i];
      if (scope$3.lexical.indexOf(name) > -1 && !((scope$3.flags & SCOPE_SIMPLE_CATCH) && scope$3.lexical[0] === name) ||
          !this.treatFunctionsAsVarInScope(scope$3) && scope$3.functions.indexOf(name) > -1) {
        redeclared = true;
        break
      }
      scope$3.var.push(name);
      if (this.inModule && (scope$3.flags & SCOPE_TOP))
        { delete this.undefinedExports[name]; }
      if (scope$3.flags & SCOPE_VAR) { break }
    }
  }
  if (redeclared) { this.raiseRecoverable(pos, ("Identifier '" + name + "' has already been declared")); }
};

pp$3.checkLocalExport = function(id) {
  // scope.functions must be empty as Module code is always strict.
  if (this.scopeStack[0].lexical.indexOf(id.name) === -1 &&
      this.scopeStack[0].var.indexOf(id.name) === -1) {
    this.undefinedExports[id.name] = id;
  }
};

pp$3.currentScope = function() {
  return this.scopeStack[this.scopeStack.length - 1]
};

pp$3.currentVarScope = function() {
  for (var i = this.scopeStack.length - 1;; i--) {
    var scope = this.scopeStack[i];
    if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK)) { return scope }
  }
};

// Could be useful for `this`, `new.target`, `super()`, `super.property`, and `super[property]`.
pp$3.currentThisScope = function() {
  for (var i = this.scopeStack.length - 1;; i--) {
    var scope = this.scopeStack[i];
    if (scope.flags & (SCOPE_VAR | SCOPE_CLASS_FIELD_INIT | SCOPE_CLASS_STATIC_BLOCK) &&
        !(scope.flags & SCOPE_ARROW)) { return scope }
  }
};

var Node = function Node(parser, pos, loc) {
  this.type = "";
  this.start = pos;
  this.end = 0;
  if (parser.options.locations)
    { this.loc = new SourceLocation(parser, loc); }
  if (parser.options.directSourceFile)
    { this.sourceFile = parser.options.directSourceFile; }
  if (parser.options.ranges)
    { this.range = [pos, 0]; }
};

// Start an AST node, attaching a start offset.

var pp$2 = Parser.prototype;

pp$2.startNode = function() {
  return new Node(this, this.start, this.startLoc)
};

pp$2.startNodeAt = function(pos, loc) {
  return new Node(this, pos, loc)
};

// Finish an AST node, adding `type` and `end` properties.

function finishNodeAt(node, type, pos, loc) {
  node.type = type;
  node.end = pos;
  if (this.options.locations)
    { node.loc.end = loc; }
  if (this.options.ranges)
    { node.range[1] = pos; }
  return node
}

pp$2.finishNode = function(node, type) {
  return finishNodeAt.call(this, node, type, this.lastTokEnd, this.lastTokEndLoc)
};

// Finish node at given position

pp$2.finishNodeAt = function(node, type, pos, loc) {
  return finishNodeAt.call(this, node, type, pos, loc)
};

pp$2.copyNode = function(node) {
  var newNode = new Node(this, node.start, this.startLoc);
  for (var prop in node) { newNode[prop] = node[prop]; }
  return newNode
};

// This file was generated by "bin/generate-unicode-script-values.js". Do not modify manually!
var scriptValuesAddedInUnicode = "Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz";

// This file contains Unicode properties extracted from the ECMAScript specification.
// The lists are extracted like so:
// $$('#table-binary-unicode-properties > figure > table > tbody > tr > td:nth-child(1) code').map(el => el.innerText)

// #table-binary-unicode-properties
var ecma9BinaryProperties = "ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS";
var ecma10BinaryProperties = ecma9BinaryProperties + " Extended_Pictographic";
var ecma11BinaryProperties = ecma10BinaryProperties;
var ecma12BinaryProperties = ecma11BinaryProperties + " EBase EComp EMod EPres ExtPict";
var ecma13BinaryProperties = ecma12BinaryProperties;
var ecma14BinaryProperties = ecma13BinaryProperties;

var unicodeBinaryProperties = {
  9: ecma9BinaryProperties,
  10: ecma10BinaryProperties,
  11: ecma11BinaryProperties,
  12: ecma12BinaryProperties,
  13: ecma13BinaryProperties,
  14: ecma14BinaryProperties
};

// #table-binary-unicode-properties-of-strings
var ecma14BinaryPropertiesOfStrings = "Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji";

var unicodeBinaryPropertiesOfStrings = {
  9: "",
  10: "",
  11: "",
  12: "",
  13: "",
  14: ecma14BinaryPropertiesOfStrings
};

// #table-unicode-general-category-values
var unicodeGeneralCategoryValues = "Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu";

// #table-unicode-script-values
var ecma9ScriptValues = "Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb";
var ecma10ScriptValues = ecma9ScriptValues + " Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd";
var ecma11ScriptValues = ecma10ScriptValues + " Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho";
var ecma12ScriptValues = ecma11ScriptValues + " Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi";
var ecma13ScriptValues = ecma12ScriptValues + " Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith";
var ecma14ScriptValues = ecma13ScriptValues + " " + scriptValuesAddedInUnicode;

var unicodeScriptValues = {
  9: ecma9ScriptValues,
  10: ecma10ScriptValues,
  11: ecma11ScriptValues,
  12: ecma12ScriptValues,
  13: ecma13ScriptValues,
  14: ecma14ScriptValues
};

var data = {};
function buildUnicodeData(ecmaVersion) {
  var d = data[ecmaVersion] = {
    binary: wordsRegexp(unicodeBinaryProperties[ecmaVersion] + " " + unicodeGeneralCategoryValues),
    binaryOfStrings: wordsRegexp(unicodeBinaryPropertiesOfStrings[ecmaVersion]),
    nonBinary: {
      General_Category: wordsRegexp(unicodeGeneralCategoryValues),
      Script: wordsRegexp(unicodeScriptValues[ecmaVersion])
    }
  };
  d.nonBinary.Script_Extensions = d.nonBinary.Script;

  d.nonBinary.gc = d.nonBinary.General_Category;
  d.nonBinary.sc = d.nonBinary.Script;
  d.nonBinary.scx = d.nonBinary.Script_Extensions;
}

for (var i = 0, list = [9, 10, 11, 12, 13, 14]; i < list.length; i += 1) {
  var ecmaVersion = list[i];

  buildUnicodeData(ecmaVersion);
}

var pp$1 = Parser.prototype;

// Track disjunction structure to determine whether a duplicate
// capture group name is allowed because it is in a separate branch.
var BranchID = function BranchID(parent, base) {
  // Parent disjunction branch
  this.parent = parent;
  // Identifies this set of sibling branches
  this.base = base || this;
};

BranchID.prototype.separatedFrom = function separatedFrom (alt) {
  // A branch is separate from another branch if they or any of
  // their parents are siblings in a given disjunction
  for (var self = this; self; self = self.parent) {
    for (var other = alt; other; other = other.parent) {
      if (self.base === other.base && self !== other) { return true }
    }
  }
  return false
};

BranchID.prototype.sibling = function sibling () {
  return new BranchID(this.parent, this.base)
};

var RegExpValidationState = function RegExpValidationState(parser) {
  this.parser = parser;
  this.validFlags = "gim" + (parser.options.ecmaVersion >= 6 ? "uy" : "") + (parser.options.ecmaVersion >= 9 ? "s" : "") + (parser.options.ecmaVersion >= 13 ? "d" : "") + (parser.options.ecmaVersion >= 15 ? "v" : "");
  this.unicodeProperties = data[parser.options.ecmaVersion >= 14 ? 14 : parser.options.ecmaVersion];
  this.source = "";
  this.flags = "";
  this.start = 0;
  this.switchU = false;
  this.switchV = false;
  this.switchN = false;
  this.pos = 0;
  this.lastIntValue = 0;
  this.lastStringValue = "";
  this.lastAssertionIsQuantifiable = false;
  this.numCapturingParens = 0;
  this.maxBackReference = 0;
  this.groupNames = Object.create(null);
  this.backReferenceNames = [];
  this.branchID = null;
};

RegExpValidationState.prototype.reset = function reset (start, pattern, flags) {
  var unicodeSets = flags.indexOf("v") !== -1;
  var unicode = flags.indexOf("u") !== -1;
  this.start = start | 0;
  this.source = pattern + "";
  this.flags = flags;
  if (unicodeSets && this.parser.options.ecmaVersion >= 15) {
    this.switchU = true;
    this.switchV = true;
    this.switchN = true;
  } else {
    this.switchU = unicode && this.parser.options.ecmaVersion >= 6;
    this.switchV = false;
    this.switchN = unicode && this.parser.options.ecmaVersion >= 9;
  }
};

RegExpValidationState.prototype.raise = function raise (message) {
  this.parser.raiseRecoverable(this.start, ("Invalid regular expression: /" + (this.source) + "/: " + message));
};

// If u flag is given, this returns the code point at the index (it combines a surrogate pair).
// Otherwise, this returns the code unit of the index (can be a part of a surrogate pair).
RegExpValidationState.prototype.at = function at (i, forceU) {
    if ( forceU === void 0 ) forceU = false;

  var s = this.source;
  var l = s.length;
  if (i >= l) {
    return -1
  }
  var c = s.charCodeAt(i);
  if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l) {
    return c
  }
  var next = s.charCodeAt(i + 1);
  return next >= 0xDC00 && next <= 0xDFFF ? (c << 10) + next - 0x35FDC00 : c
};

RegExpValidationState.prototype.nextIndex = function nextIndex (i, forceU) {
    if ( forceU === void 0 ) forceU = false;

  var s = this.source;
  var l = s.length;
  if (i >= l) {
    return l
  }
  var c = s.charCodeAt(i), next;
  if (!(forceU || this.switchU) || c <= 0xD7FF || c >= 0xE000 || i + 1 >= l ||
      (next = s.charCodeAt(i + 1)) < 0xDC00 || next > 0xDFFF) {
    return i + 1
  }
  return i + 2
};

RegExpValidationState.prototype.current = function current (forceU) {
    if ( forceU === void 0 ) forceU = false;

  return this.at(this.pos, forceU)
};

RegExpValidationState.prototype.lookahead = function lookahead (forceU) {
    if ( forceU === void 0 ) forceU = false;

  return this.at(this.nextIndex(this.pos, forceU), forceU)
};

RegExpValidationState.prototype.advance = function advance (forceU) {
    if ( forceU === void 0 ) forceU = false;

  this.pos = this.nextIndex(this.pos, forceU);
};

RegExpValidationState.prototype.eat = function eat (ch, forceU) {
    if ( forceU === void 0 ) forceU = false;

  if (this.current(forceU) === ch) {
    this.advance(forceU);
    return true
  }
  return false
};

RegExpValidationState.prototype.eatChars = function eatChars (chs, forceU) {
    if ( forceU === void 0 ) forceU = false;

  var pos = this.pos;
  for (var i = 0, list = chs; i < list.length; i += 1) {
    var ch = list[i];

      var current = this.at(pos, forceU);
    if (current === -1 || current !== ch) {
      return false
    }
    pos = this.nextIndex(pos, forceU);
  }
  this.pos = pos;
  return true
};

/**
 * Validate the flags part of a given RegExpLiteral.
 *
 * @param {RegExpValidationState} state The state to validate RegExp.
 * @returns {void}
 */
pp$1.validateRegExpFlags = function(state) {
  var validFlags = state.validFlags;
  var flags = state.flags;

  var u = false;
  var v = false;

  for (var i = 0; i < flags.length; i++) {
    var flag = flags.charAt(i);
    if (validFlags.indexOf(flag) === -1) {
      this.raise(state.start, "Invalid regular expression flag");
    }
    if (flags.indexOf(flag, i + 1) > -1) {
      this.raise(state.start, "Duplicate regular expression flag");
    }
    if (flag === "u") { u = true; }
    if (flag === "v") { v = true; }
  }
  if (this.options.ecmaVersion >= 15 && u && v) {
    this.raise(state.start, "Invalid regular expression flag");
  }
};

function hasProp(obj) {
  for (var _ in obj) { return true }
  return false
}

/**
 * Validate the pattern part of a given RegExpLiteral.
 *
 * @param {RegExpValidationState} state The state to validate RegExp.
 * @returns {void}
 */
pp$1.validateRegExpPattern = function(state) {
  this.regexp_pattern(state);

  // The goal symbol for the parse is |Pattern[~U, ~N]|. If the result of
  // parsing contains a |GroupName|, reparse with the goal symbol
  // |Pattern[~U, +N]| and use this result instead. Throw a *SyntaxError*
  // exception if _P_ did not conform to the grammar, if any elements of _P_
  // were not matched by the parse, or if any Early Error conditions exist.
  if (!state.switchN && this.options.ecmaVersion >= 9 && hasProp(state.groupNames)) {
    state.switchN = true;
    this.regexp_pattern(state);
  }
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-Pattern
pp$1.regexp_pattern = function(state) {
  state.pos = 0;
  state.lastIntValue = 0;
  state.lastStringValue = "";
  state.lastAssertionIsQuantifiable = false;
  state.numCapturingParens = 0;
  state.maxBackReference = 0;
  state.groupNames = Object.create(null);
  state.backReferenceNames.length = 0;
  state.branchID = null;

  this.regexp_disjunction(state);

  if (state.pos !== state.source.length) {
    // Make the same messages as V8.
    if (state.eat(0x29 /* ) */)) {
      state.raise("Unmatched ')'");
    }
    if (state.eat(0x5D /* ] */) || state.eat(0x7D /* } */)) {
      state.raise("Lone quantifier brackets");
    }
  }
  if (state.maxBackReference > state.numCapturingParens) {
    state.raise("Invalid escape");
  }
  for (var i = 0, list = state.backReferenceNames; i < list.length; i += 1) {
    var name = list[i];

    if (!state.groupNames[name]) {
      state.raise("Invalid named capture referenced");
    }
  }
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-Disjunction
pp$1.regexp_disjunction = function(state) {
  var trackDisjunction = this.options.ecmaVersion >= 16;
  if (trackDisjunction) { state.branchID = new BranchID(state.branchID, null); }
  this.regexp_alternative(state);
  while (state.eat(0x7C /* | */)) {
    if (trackDisjunction) { state.branchID = state.branchID.sibling(); }
    this.regexp_alternative(state);
  }
  if (trackDisjunction) { state.branchID = state.branchID.parent; }

  // Make the same message as V8.
  if (this.regexp_eatQuantifier(state, true)) {
    state.raise("Nothing to repeat");
  }
  if (state.eat(0x7B /* { */)) {
    state.raise("Lone quantifier brackets");
  }
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-Alternative
pp$1.regexp_alternative = function(state) {
  while (state.pos < state.source.length && this.regexp_eatTerm(state)) {}
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Term
pp$1.regexp_eatTerm = function(state) {
  if (this.regexp_eatAssertion(state)) {
    // Handle `QuantifiableAssertion Quantifier` alternative.
    // `state.lastAssertionIsQuantifiable` is true if the last eaten Assertion
    // is a QuantifiableAssertion.
    if (state.lastAssertionIsQuantifiable && this.regexp_eatQuantifier(state)) {
      // Make the same message as V8.
      if (state.switchU) {
        state.raise("Invalid quantifier");
      }
    }
    return true
  }

  if (state.switchU ? this.regexp_eatAtom(state) : this.regexp_eatExtendedAtom(state)) {
    this.regexp_eatQuantifier(state);
    return true
  }

  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-Assertion
pp$1.regexp_eatAssertion = function(state) {
  var start = state.pos;
  state.lastAssertionIsQuantifiable = false;

  // ^, $
  if (state.eat(0x5E /* ^ */) || state.eat(0x24 /* $ */)) {
    return true
  }

  // \b \B
  if (state.eat(0x5C /* \ */)) {
    if (state.eat(0x42 /* B */) || state.eat(0x62 /* b */)) {
      return true
    }
    state.pos = start;
  }

  // Lookahead / Lookbehind
  if (state.eat(0x28 /* ( */) && state.eat(0x3F /* ? */)) {
    var lookbehind = false;
    if (this.options.ecmaVersion >= 9) {
      lookbehind = state.eat(0x3C /* < */);
    }
    if (state.eat(0x3D /* = */) || state.eat(0x21 /* ! */)) {
      this.regexp_disjunction(state);
      if (!state.eat(0x29 /* ) */)) {
        state.raise("Unterminated group");
      }
      state.lastAssertionIsQuantifiable = !lookbehind;
      return true
    }
  }

  state.pos = start;
  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-Quantifier
pp$1.regexp_eatQuantifier = function(state, noError) {
  if ( noError === void 0 ) noError = false;

  if (this.regexp_eatQuantifierPrefix(state, noError)) {
    state.eat(0x3F /* ? */);
    return true
  }
  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-QuantifierPrefix
pp$1.regexp_eatQuantifierPrefix = function(state, noError) {
  return (
    state.eat(0x2A /* * */) ||
    state.eat(0x2B /* + */) ||
    state.eat(0x3F /* ? */) ||
    this.regexp_eatBracedQuantifier(state, noError)
  )
};
pp$1.regexp_eatBracedQuantifier = function(state, noError) {
  var start = state.pos;
  if (state.eat(0x7B /* { */)) {
    var min = 0, max = -1;
    if (this.regexp_eatDecimalDigits(state)) {
      min = state.lastIntValue;
      if (state.eat(0x2C /* , */) && this.regexp_eatDecimalDigits(state)) {
        max = state.lastIntValue;
      }
      if (state.eat(0x7D /* } */)) {
        // SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-term
        if (max !== -1 && max < min && !noError) {
          state.raise("numbers out of order in {} quantifier");
        }
        return true
      }
    }
    if (state.switchU && !noError) {
      state.raise("Incomplete quantifier");
    }
    state.pos = start;
  }
  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-Atom
pp$1.regexp_eatAtom = function(state) {
  return (
    this.regexp_eatPatternCharacters(state) ||
    state.eat(0x2E /* . */) ||
    this.regexp_eatReverseSolidusAtomEscape(state) ||
    this.regexp_eatCharacterClass(state) ||
    this.regexp_eatUncapturingGroup(state) ||
    this.regexp_eatCapturingGroup(state)
  )
};
pp$1.regexp_eatReverseSolidusAtomEscape = function(state) {
  var start = state.pos;
  if (state.eat(0x5C /* \ */)) {
    if (this.regexp_eatAtomEscape(state)) {
      return true
    }
    state.pos = start;
  }
  return false
};
pp$1.regexp_eatUncapturingGroup = function(state) {
  var start = state.pos;
  if (state.eat(0x28 /* ( */)) {
    if (state.eat(0x3F /* ? */)) {
      if (this.options.ecmaVersion >= 16) {
        var addModifiers = this.regexp_eatModifiers(state);
        var hasHyphen = state.eat(0x2D /* - */);
        if (addModifiers || hasHyphen) {
          for (var i = 0; i < addModifiers.length; i++) {
            var modifier = addModifiers.charAt(i);
            if (addModifiers.indexOf(modifier, i + 1) > -1) {
              state.raise("Duplicate regular expression modifiers");
            }
          }
          if (hasHyphen) {
            var removeModifiers = this.regexp_eatModifiers(state);
            if (!addModifiers && !removeModifiers && state.current() === 0x3A /* : */) {
              state.raise("Invalid regular expression modifiers");
            }
            for (var i$1 = 0; i$1 < removeModifiers.length; i$1++) {
              var modifier$1 = removeModifiers.charAt(i$1);
              if (
                removeModifiers.indexOf(modifier$1, i$1 + 1) > -1 ||
                addModifiers.indexOf(modifier$1) > -1
              ) {
                state.raise("Duplicate regular expression modifiers");
              }
            }
          }
        }
      }
      if (state.eat(0x3A /* : */)) {
        this.regexp_disjunction(state);
        if (state.eat(0x29 /* ) */)) {
          return true
        }
        state.raise("Unterminated group");
      }
    }
    state.pos = start;
  }
  return false
};
pp$1.regexp_eatCapturingGroup = function(state) {
  if (state.eat(0x28 /* ( */)) {
    if (this.options.ecmaVersion >= 9) {
      this.regexp_groupSpecifier(state);
    } else if (state.current() === 0x3F /* ? */) {
      state.raise("Invalid group");
    }
    this.regexp_disjunction(state);
    if (state.eat(0x29 /* ) */)) {
      state.numCapturingParens += 1;
      return true
    }
    state.raise("Unterminated group");
  }
  return false
};
// RegularExpressionModifiers ::
//   [empty]
//   RegularExpressionModifiers RegularExpressionModifier
pp$1.regexp_eatModifiers = function(state) {
  var modifiers = "";
  var ch = 0;
  while ((ch = state.current()) !== -1 && isRegularExpressionModifier(ch)) {
    modifiers += codePointToString(ch);
    state.advance();
  }
  return modifiers
};
// RegularExpressionModifier :: one of
//   `i` `m` `s`
function isRegularExpressionModifier(ch) {
  return ch === 0x69 /* i */ || ch === 0x6d /* m */ || ch === 0x73 /* s */
}

// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedAtom
pp$1.regexp_eatExtendedAtom = function(state) {
  return (
    state.eat(0x2E /* . */) ||
    this.regexp_eatReverseSolidusAtomEscape(state) ||
    this.regexp_eatCharacterClass(state) ||
    this.regexp_eatUncapturingGroup(state) ||
    this.regexp_eatCapturingGroup(state) ||
    this.regexp_eatInvalidBracedQuantifier(state) ||
    this.regexp_eatExtendedPatternCharacter(state)
  )
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-InvalidBracedQuantifier
pp$1.regexp_eatInvalidBracedQuantifier = function(state) {
  if (this.regexp_eatBracedQuantifier(state, true)) {
    state.raise("Nothing to repeat");
  }
  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-SyntaxCharacter
pp$1.regexp_eatSyntaxCharacter = function(state) {
  var ch = state.current();
  if (isSyntaxCharacter(ch)) {
    state.lastIntValue = ch;
    state.advance();
    return true
  }
  return false
};
function isSyntaxCharacter(ch) {
  return (
    ch === 0x24 /* $ */ ||
    ch >= 0x28 /* ( */ && ch <= 0x2B /* + */ ||
    ch === 0x2E /* . */ ||
    ch === 0x3F /* ? */ ||
    ch >= 0x5B /* [ */ && ch <= 0x5E /* ^ */ ||
    ch >= 0x7B /* { */ && ch <= 0x7D /* } */
  )
}

// https://www.ecma-international.org/ecma-262/8.0/#prod-PatternCharacter
// But eat eager.
pp$1.regexp_eatPatternCharacters = function(state) {
  var start = state.pos;
  var ch = 0;
  while ((ch = state.current()) !== -1 && !isSyntaxCharacter(ch)) {
    state.advance();
  }
  return state.pos !== start
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ExtendedPatternCharacter
pp$1.regexp_eatExtendedPatternCharacter = function(state) {
  var ch = state.current();
  if (
    ch !== -1 &&
    ch !== 0x24 /* $ */ &&
    !(ch >= 0x28 /* ( */ && ch <= 0x2B /* + */) &&
    ch !== 0x2E /* . */ &&
    ch !== 0x3F /* ? */ &&
    ch !== 0x5B /* [ */ &&
    ch !== 0x5E /* ^ */ &&
    ch !== 0x7C /* | */
  ) {
    state.advance();
    return true
  }
  return false
};

// GroupSpecifier ::
//   [empty]
//   `?` GroupName
pp$1.regexp_groupSpecifier = function(state) {
  if (state.eat(0x3F /* ? */)) {
    if (!this.regexp_eatGroupName(state)) { state.raise("Invalid group"); }
    var trackDisjunction = this.options.ecmaVersion >= 16;
    var known = state.groupNames[state.lastStringValue];
    if (known) {
      if (trackDisjunction) {
        for (var i = 0, list = known; i < list.length; i += 1) {
          var altID = list[i];

          if (!altID.separatedFrom(state.branchID))
            { state.raise("Duplicate capture group name"); }
        }
      } else {
        state.raise("Duplicate capture group name");
      }
    }
    if (trackDisjunction) {
      (known || (state.groupNames[state.lastStringValue] = [])).push(state.branchID);
    } else {
      state.groupNames[state.lastStringValue] = true;
    }
  }
};

// GroupName ::
//   `<` RegExpIdentifierName `>`
// Note: this updates `state.lastStringValue` property with the eaten name.
pp$1.regexp_eatGroupName = function(state) {
  state.lastStringValue = "";
  if (state.eat(0x3C /* < */)) {
    if (this.regexp_eatRegExpIdentifierName(state) && state.eat(0x3E /* > */)) {
      return true
    }
    state.raise("Invalid capture group name");
  }
  return false
};

// RegExpIdentifierName ::
//   RegExpIdentifierStart
//   RegExpIdentifierName RegExpIdentifierPart
// Note: this updates `state.lastStringValue` property with the eaten name.
pp$1.regexp_eatRegExpIdentifierName = function(state) {
  state.lastStringValue = "";
  if (this.regexp_eatRegExpIdentifierStart(state)) {
    state.lastStringValue += codePointToString(state.lastIntValue);
    while (this.regexp_eatRegExpIdentifierPart(state)) {
      state.lastStringValue += codePointToString(state.lastIntValue);
    }
    return true
  }
  return false
};

// RegExpIdentifierStart ::
//   UnicodeIDStart
//   `$`
//   `_`
//   `\` RegExpUnicodeEscapeSequence[+U]
pp$1.regexp_eatRegExpIdentifierStart = function(state) {
  var start = state.pos;
  var forceU = this.options.ecmaVersion >= 11;
  var ch = state.current(forceU);
  state.advance(forceU);

  if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
    ch = state.lastIntValue;
  }
  if (isRegExpIdentifierStart(ch)) {
    state.lastIntValue = ch;
    return true
  }

  state.pos = start;
  return false
};
function isRegExpIdentifierStart(ch) {
  return isIdentifierStart(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */
}

// RegExpIdentifierPart ::
//   UnicodeIDContinue
//   `$`
//   `_`
//   `\` RegExpUnicodeEscapeSequence[+U]
//   <ZWNJ>
//   <ZWJ>
pp$1.regexp_eatRegExpIdentifierPart = function(state) {
  var start = state.pos;
  var forceU = this.options.ecmaVersion >= 11;
  var ch = state.current(forceU);
  state.advance(forceU);

  if (ch === 0x5C /* \ */ && this.regexp_eatRegExpUnicodeEscapeSequence(state, forceU)) {
    ch = state.lastIntValue;
  }
  if (isRegExpIdentifierPart(ch)) {
    state.lastIntValue = ch;
    return true
  }

  state.pos = start;
  return false
};
function isRegExpIdentifierPart(ch) {
  return isIdentifierChar(ch, true) || ch === 0x24 /* $ */ || ch === 0x5F /* _ */ || ch === 0x200C /* <ZWNJ> */ || ch === 0x200D /* <ZWJ> */
}

// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-AtomEscape
pp$1.regexp_eatAtomEscape = function(state) {
  if (
    this.regexp_eatBackReference(state) ||
    this.regexp_eatCharacterClassEscape(state) ||
    this.regexp_eatCharacterEscape(state) ||
    (state.switchN && this.regexp_eatKGroupName(state))
  ) {
    return true
  }
  if (state.switchU) {
    // Make the same message as V8.
    if (state.current() === 0x63 /* c */) {
      state.raise("Invalid unicode escape");
    }
    state.raise("Invalid escape");
  }
  return false
};
pp$1.regexp_eatBackReference = function(state) {
  var start = state.pos;
  if (this.regexp_eatDecimalEscape(state)) {
    var n = state.lastIntValue;
    if (state.switchU) {
      // For SyntaxError in https://www.ecma-international.org/ecma-262/8.0/#sec-atomescape
      if (n > state.maxBackReference) {
        state.maxBackReference = n;
      }
      return true
    }
    if (n <= state.numCapturingParens) {
      return true
    }
    state.pos = start;
  }
  return false
};
pp$1.regexp_eatKGroupName = function(state) {
  if (state.eat(0x6B /* k */)) {
    if (this.regexp_eatGroupName(state)) {
      state.backReferenceNames.push(state.lastStringValue);
      return true
    }
    state.raise("Invalid named reference");
  }
  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-CharacterEscape
pp$1.regexp_eatCharacterEscape = function(state) {
  return (
    this.regexp_eatControlEscape(state) ||
    this.regexp_eatCControlLetter(state) ||
    this.regexp_eatZero(state) ||
    this.regexp_eatHexEscapeSequence(state) ||
    this.regexp_eatRegExpUnicodeEscapeSequence(state, false) ||
    (!state.switchU && this.regexp_eatLegacyOctalEscapeSequence(state)) ||
    this.regexp_eatIdentityEscape(state)
  )
};
pp$1.regexp_eatCControlLetter = function(state) {
  var start = state.pos;
  if (state.eat(0x63 /* c */)) {
    if (this.regexp_eatControlLetter(state)) {
      return true
    }
    state.pos = start;
  }
  return false
};
pp$1.regexp_eatZero = function(state) {
  if (state.current() === 0x30 /* 0 */ && !isDecimalDigit(state.lookahead())) {
    state.lastIntValue = 0;
    state.advance();
    return true
  }
  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlEscape
pp$1.regexp_eatControlEscape = function(state) {
  var ch = state.current();
  if (ch === 0x74 /* t */) {
    state.lastIntValue = 0x09; /* \t */
    state.advance();
    return true
  }
  if (ch === 0x6E /* n */) {
    state.lastIntValue = 0x0A; /* \n */
    state.advance();
    return true
  }
  if (ch === 0x76 /* v */) {
    state.lastIntValue = 0x0B; /* \v */
    state.advance();
    return true
  }
  if (ch === 0x66 /* f */) {
    state.lastIntValue = 0x0C; /* \f */
    state.advance();
    return true
  }
  if (ch === 0x72 /* r */) {
    state.lastIntValue = 0x0D; /* \r */
    state.advance();
    return true
  }
  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-ControlLetter
pp$1.regexp_eatControlLetter = function(state) {
  var ch = state.current();
  if (isControlLetter(ch)) {
    state.lastIntValue = ch % 0x20;
    state.advance();
    return true
  }
  return false
};
function isControlLetter(ch) {
  return (
    (ch >= 0x41 /* A */ && ch <= 0x5A /* Z */) ||
    (ch >= 0x61 /* a */ && ch <= 0x7A /* z */)
  )
}

// https://www.ecma-international.org/ecma-262/8.0/#prod-RegExpUnicodeEscapeSequence
pp$1.regexp_eatRegExpUnicodeEscapeSequence = function(state, forceU) {
  if ( forceU === void 0 ) forceU = false;

  var start = state.pos;
  var switchU = forceU || state.switchU;

  if (state.eat(0x75 /* u */)) {
    if (this.regexp_eatFixedHexDigits(state, 4)) {
      var lead = state.lastIntValue;
      if (switchU && lead >= 0xD800 && lead <= 0xDBFF) {
        var leadSurrogateEnd = state.pos;
        if (state.eat(0x5C /* \ */) && state.eat(0x75 /* u */) && this.regexp_eatFixedHexDigits(state, 4)) {
          var trail = state.lastIntValue;
          if (trail >= 0xDC00 && trail <= 0xDFFF) {
            state.lastIntValue = (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;
            return true
          }
        }
        state.pos = leadSurrogateEnd;
        state.lastIntValue = lead;
      }
      return true
    }
    if (
      switchU &&
      state.eat(0x7B /* { */) &&
      this.regexp_eatHexDigits(state) &&
      state.eat(0x7D /* } */) &&
      isValidUnicode(state.lastIntValue)
    ) {
      return true
    }
    if (switchU) {
      state.raise("Invalid unicode escape");
    }
    state.pos = start;
  }

  return false
};
function isValidUnicode(ch) {
  return ch >= 0 && ch <= 0x10FFFF
}

// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-IdentityEscape
pp$1.regexp_eatIdentityEscape = function(state) {
  if (state.switchU) {
    if (this.regexp_eatSyntaxCharacter(state)) {
      return true
    }
    if (state.eat(0x2F /* / */)) {
      state.lastIntValue = 0x2F; /* / */
      return true
    }
    return false
  }

  var ch = state.current();
  if (ch !== 0x63 /* c */ && (!state.switchN || ch !== 0x6B /* k */)) {
    state.lastIntValue = ch;
    state.advance();
    return true
  }

  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalEscape
pp$1.regexp_eatDecimalEscape = function(state) {
  state.lastIntValue = 0;
  var ch = state.current();
  if (ch >= 0x31 /* 1 */ && ch <= 0x39 /* 9 */) {
    do {
      state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);
      state.advance();
    } while ((ch = state.current()) >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */)
    return true
  }
  return false
};

// Return values used by character set parsing methods, needed to
// forbid negation of sets that can match strings.
var CharSetNone = 0; // Nothing parsed
var CharSetOk = 1; // Construct parsed, cannot contain strings
var CharSetString = 2; // Construct parsed, can contain strings

// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClassEscape
pp$1.regexp_eatCharacterClassEscape = function(state) {
  var ch = state.current();

  if (isCharacterClassEscape(ch)) {
    state.lastIntValue = -1;
    state.advance();
    return CharSetOk
  }

  var negate = false;
  if (
    state.switchU &&
    this.options.ecmaVersion >= 9 &&
    ((negate = ch === 0x50 /* P */) || ch === 0x70 /* p */)
  ) {
    state.lastIntValue = -1;
    state.advance();
    var result;
    if (
      state.eat(0x7B /* { */) &&
      (result = this.regexp_eatUnicodePropertyValueExpression(state)) &&
      state.eat(0x7D /* } */)
    ) {
      if (negate && result === CharSetString) { state.raise("Invalid property name"); }
      return result
    }
    state.raise("Invalid property name");
  }

  return CharSetNone
};

function isCharacterClassEscape(ch) {
  return (
    ch === 0x64 /* d */ ||
    ch === 0x44 /* D */ ||
    ch === 0x73 /* s */ ||
    ch === 0x53 /* S */ ||
    ch === 0x77 /* w */ ||
    ch === 0x57 /* W */
  )
}

// UnicodePropertyValueExpression ::
//   UnicodePropertyName `=` UnicodePropertyValue
//   LoneUnicodePropertyNameOrValue
pp$1.regexp_eatUnicodePropertyValueExpression = function(state) {
  var start = state.pos;

  // UnicodePropertyName `=` UnicodePropertyValue
  if (this.regexp_eatUnicodePropertyName(state) && state.eat(0x3D /* = */)) {
    var name = state.lastStringValue;
    if (this.regexp_eatUnicodePropertyValue(state)) {
      var value = state.lastStringValue;
      this.regexp_validateUnicodePropertyNameAndValue(state, name, value);
      return CharSetOk
    }
  }
  state.pos = start;

  // LoneUnicodePropertyNameOrValue
  if (this.regexp_eatLoneUnicodePropertyNameOrValue(state)) {
    var nameOrValue = state.lastStringValue;
    return this.regexp_validateUnicodePropertyNameOrValue(state, nameOrValue)
  }
  return CharSetNone
};

pp$1.regexp_validateUnicodePropertyNameAndValue = function(state, name, value) {
  if (!hasOwn(state.unicodeProperties.nonBinary, name))
    { state.raise("Invalid property name"); }
  if (!state.unicodeProperties.nonBinary[name].test(value))
    { state.raise("Invalid property value"); }
};

pp$1.regexp_validateUnicodePropertyNameOrValue = function(state, nameOrValue) {
  if (state.unicodeProperties.binary.test(nameOrValue)) { return CharSetOk }
  if (state.switchV && state.unicodeProperties.binaryOfStrings.test(nameOrValue)) { return CharSetString }
  state.raise("Invalid property name");
};

// UnicodePropertyName ::
//   UnicodePropertyNameCharacters
pp$1.regexp_eatUnicodePropertyName = function(state) {
  var ch = 0;
  state.lastStringValue = "";
  while (isUnicodePropertyNameCharacter(ch = state.current())) {
    state.lastStringValue += codePointToString(ch);
    state.advance();
  }
  return state.lastStringValue !== ""
};

function isUnicodePropertyNameCharacter(ch) {
  return isControlLetter(ch) || ch === 0x5F /* _ */
}

// UnicodePropertyValue ::
//   UnicodePropertyValueCharacters
pp$1.regexp_eatUnicodePropertyValue = function(state) {
  var ch = 0;
  state.lastStringValue = "";
  while (isUnicodePropertyValueCharacter(ch = state.current())) {
    state.lastStringValue += codePointToString(ch);
    state.advance();
  }
  return state.lastStringValue !== ""
};
function isUnicodePropertyValueCharacter(ch) {
  return isUnicodePropertyNameCharacter(ch) || isDecimalDigit(ch)
}

// LoneUnicodePropertyNameOrValue ::
//   UnicodePropertyValueCharacters
pp$1.regexp_eatLoneUnicodePropertyNameOrValue = function(state) {
  return this.regexp_eatUnicodePropertyValue(state)
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-CharacterClass
pp$1.regexp_eatCharacterClass = function(state) {
  if (state.eat(0x5B /* [ */)) {
    var negate = state.eat(0x5E /* ^ */);
    var result = this.regexp_classContents(state);
    if (!state.eat(0x5D /* ] */))
      { state.raise("Unterminated character class"); }
    if (negate && result === CharSetString)
      { state.raise("Negated character class may contain strings"); }
    return true
  }
  return false
};

// https://tc39.es/ecma262/#prod-ClassContents
// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassRanges
pp$1.regexp_classContents = function(state) {
  if (state.current() === 0x5D /* ] */) { return CharSetOk }
  if (state.switchV) { return this.regexp_classSetExpression(state) }
  this.regexp_nonEmptyClassRanges(state);
  return CharSetOk
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRanges
// https://www.ecma-international.org/ecma-262/8.0/#prod-NonemptyClassRangesNoDash
pp$1.regexp_nonEmptyClassRanges = function(state) {
  while (this.regexp_eatClassAtom(state)) {
    var left = state.lastIntValue;
    if (state.eat(0x2D /* - */) && this.regexp_eatClassAtom(state)) {
      var right = state.lastIntValue;
      if (state.switchU && (left === -1 || right === -1)) {
        state.raise("Invalid character class");
      }
      if (left !== -1 && right !== -1 && left > right) {
        state.raise("Range out of order in character class");
      }
    }
  }
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtom
// https://www.ecma-international.org/ecma-262/8.0/#prod-ClassAtomNoDash
pp$1.regexp_eatClassAtom = function(state) {
  var start = state.pos;

  if (state.eat(0x5C /* \ */)) {
    if (this.regexp_eatClassEscape(state)) {
      return true
    }
    if (state.switchU) {
      // Make the same message as V8.
      var ch$1 = state.current();
      if (ch$1 === 0x63 /* c */ || isOctalDigit(ch$1)) {
        state.raise("Invalid class escape");
      }
      state.raise("Invalid escape");
    }
    state.pos = start;
  }

  var ch = state.current();
  if (ch !== 0x5D /* ] */) {
    state.lastIntValue = ch;
    state.advance();
    return true
  }

  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassEscape
pp$1.regexp_eatClassEscape = function(state) {
  var start = state.pos;

  if (state.eat(0x62 /* b */)) {
    state.lastIntValue = 0x08; /* <BS> */
    return true
  }

  if (state.switchU && state.eat(0x2D /* - */)) {
    state.lastIntValue = 0x2D; /* - */
    return true
  }

  if (!state.switchU && state.eat(0x63 /* c */)) {
    if (this.regexp_eatClassControlLetter(state)) {
      return true
    }
    state.pos = start;
  }

  return (
    this.regexp_eatCharacterClassEscape(state) ||
    this.regexp_eatCharacterEscape(state)
  )
};

// https://tc39.es/ecma262/#prod-ClassSetExpression
// https://tc39.es/ecma262/#prod-ClassUnion
// https://tc39.es/ecma262/#prod-ClassIntersection
// https://tc39.es/ecma262/#prod-ClassSubtraction
pp$1.regexp_classSetExpression = function(state) {
  var result = CharSetOk, subResult;
  if (this.regexp_eatClassSetRange(state)) ; else if (subResult = this.regexp_eatClassSetOperand(state)) {
    if (subResult === CharSetString) { result = CharSetString; }
    // https://tc39.es/ecma262/#prod-ClassIntersection
    var start = state.pos;
    while (state.eatChars([0x26, 0x26] /* && */)) {
      if (
        state.current() !== 0x26 /* & */ &&
        (subResult = this.regexp_eatClassSetOperand(state))
      ) {
        if (subResult !== CharSetString) { result = CharSetOk; }
        continue
      }
      state.raise("Invalid character in character class");
    }
    if (start !== state.pos) { return result }
    // https://tc39.es/ecma262/#prod-ClassSubtraction
    while (state.eatChars([0x2D, 0x2D] /* -- */)) {
      if (this.regexp_eatClassSetOperand(state)) { continue }
      state.raise("Invalid character in character class");
    }
    if (start !== state.pos) { return result }
  } else {
    state.raise("Invalid character in character class");
  }
  // https://tc39.es/ecma262/#prod-ClassUnion
  for (;;) {
    if (this.regexp_eatClassSetRange(state)) { continue }
    subResult = this.regexp_eatClassSetOperand(state);
    if (!subResult) { return result }
    if (subResult === CharSetString) { result = CharSetString; }
  }
};

// https://tc39.es/ecma262/#prod-ClassSetRange
pp$1.regexp_eatClassSetRange = function(state) {
  var start = state.pos;
  if (this.regexp_eatClassSetCharacter(state)) {
    var left = state.lastIntValue;
    if (state.eat(0x2D /* - */) && this.regexp_eatClassSetCharacter(state)) {
      var right = state.lastIntValue;
      if (left !== -1 && right !== -1 && left > right) {
        state.raise("Range out of order in character class");
      }
      return true
    }
    state.pos = start;
  }
  retuXprn false
};

// https://tc39.es/ecma262/#prod-ClassSetOperand
pp$1.regexp_eatClassSetOperand = function(state) {
  if (this.regexp_eatClassSetCharacter(state)) { return CharSetOk }
  return this.regexp_eatClassStringDisjunction(state) || this.regexp_eatNestedClass(state)
};

// https://tc39.es/ecma262/#prod-NestedClass
pp$1.regexp_eatNestedClass = function(state) {
  var start = state.pos;
  if (state.eat(0x5B /* [ */)) {
    var negate = state.eat(0x5E /* ^ */);
    var result = this.regexp_classContents(state);
    if (state.eat(0x5D /* ] */)) {
      if (negate && result === CharSetString) {
        state.raise("Negated character class may contain strings");
      }
      return result
    }
    state.pos = start;
  }
  if (state.eat(0x5C /* \ */)) {
    var result$1 = this.regexp_eatCharacterClassEscape(state);
    if (result$1) {
      return result$1
    }
    state.pos = start;
  }
  return null
};

// https://tc39.es/ecma262/#prod-ClassStringDisjunction
pp$1.regexp_eatClassStringDisjunction = function(state) {
  var start = state.pos;
  if (state.eatChars([0x5C, 0x71] /* \q */)) {
    if (state.eat(0x7B /* { */)) {
      var result = this.regexp_classStringDisjunctionContents(state);
      if (state.eat(0x7D /* } */)) {
        return result
      }
    } else {
      // Make the same message as V8.
      state.raise("Invalid escape");
    }
    state.pos = start;
  }
  return null
};

// https://tc39.es/ecma262/#prod-ClassStringDisjunctionContents
pp$1.regexp_classStringDisjunctionContents = function(state) {
  var result = this.regexp_classString(state);
  while (state.eat(0x7C /* | */)) {
    if (this.regexp_classString(state) === CharSetString) { result = CharSetString; }
  }
  return result
};

// https://tc39.es/ecma262/#prod-ClassString
// https://tc39.es/ecma262/#prod-NonEmptyClassString
pp$1.regexp_classString = function(state) {
  var count = 0;
  while (this.regexp_eatClassSetCharacter(state)) { count++; }
  return count === 1 ? CharSetOk : CharSetString
};

// https://tc39.es/ecma262/#prod-ClassSetCharacter
pp$1.regexp_eatClassSetCharacter = function(state) {
  var start = state.pos;
  if (state.eat(0x5C /* \ */)) {
    if (
      this.regexp_eatCharacterEscape(state) ||
      this.regexp_eatClassSetReservedPunctuator(state)
    ) {
      return true
    }
    if (state.eat(0x62 /* b */)) {
      state.lastIntValue = 0x08; /* <BS> */
      return true
    }
    state.pos = start;
    return false
  }
  var ch = state.current();
  if (ch < 0 || ch === state.lookahead() && isClassSetReservedDoublePunctuatorCharacter(ch)) { return false }
  if (isClassSetSyntaxCharacter(ch)) { return false }
  state.advance();
  state.lastIntValue = ch;
  return true
};

// https://tc39.es/ecma262/#prod-ClassSetReservedDoublePunctuator
function isClassSetReservedDoublePunctuatorCharacter(ch) {
  return (
    ch === 0x21 /* ! */ ||
    ch >= 0x23 /* # */ && ch <= 0x26 /* & */ ||
    ch >= 0x2A /* * */ && ch <= 0x2C /* , */ ||
    ch === 0x2E /* . */ ||
    ch >= 0x3A /* : */ && ch <= 0x40 /* @ */ ||
    ch === 0x5E /* ^ */ ||
    ch === 0x60 /* ` */ ||
    ch === 0x7E /* ~ */
  )
}

// https://tc39.es/ecma262/#prod-ClassSetSyntaxCharacter
function isClassSetSyntaxCharacter(ch) {
  return (
    ch === 0x28 /* ( */ ||
    ch === 0x29 /* ) */ ||
    ch === 0x2D /* - */ ||
    ch === 0x2F /* / */ ||
    ch >= 0x5B /* [ */ && ch <= 0x5D /* ] */ ||
    ch >= 0x7B /* { */ && ch <= 0x7D /* } */
  )
}

// https://tc39.es/ecma262/#prod-ClassSetReservedPunctuator
pp$1.regexp_eatClassSetReservedPunctuator = function(state) {
  var ch = state.current();
  if (isClassSetReservedPunctuator(ch)) {
    state.lastIntValue = ch;
    state.advance();
    return true
  }
  return false
};

// https://tc39.es/ecma262/#prod-ClassSetReservedPunctuator
function isClassSetReservedPunctuator(ch) {
  return (
    ch === 0x21 /* ! */ ||
    ch === 0x23 /* # */ ||
    ch === 0x25 /* % */ ||
    ch === 0x26 /* & */ ||
    ch === 0x2C /* , */ ||
    ch === 0x2D /* - */ ||
    ch >= 0x3A /* : */ && ch <= 0x3E /* > */ ||
    ch === 0x40 /* @ */ ||
    ch === 0x60 /* ` */ ||
    ch === 0x7E /* ~ */
  )
}

// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-ClassControlLetter
pp$1.regexp_eatClassControlLetter = function(state) {
  var ch = state.current();
  if (isDecimalDigit(ch) || ch === 0x5F /* _ */) {
    state.lastIntValue = ch % 0x20;
    state.advance();
    return true
  }
  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence
pp$1.regexp_eatHexEscapeSequence = function(state) {
  var start = state.pos;
  if (state.eat(0x78 /* x */)) {
    if (this.regexp_eatFixedHexDigits(state, 2)) {
      return true
    }
    if (state.switchU) {
      state.raise("Invalid escape");
    }
    state.pos = start;
  }
  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-DecimalDigits
pp$1.regexp_eatDecimalDigits = function(state) {
  var start = state.pos;
  var ch = 0;
  state.lastIntValue = 0;
  while (isDecimalDigit(ch = state.current())) {
    state.lastIntValue = 10 * state.lastIntValue + (ch - 0x30 /* 0 */);
    state.advance();
  }
  return state.pos !== start
};
function isDecimalDigit(ch) {
  return ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */
}

// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigits
pp$1.regexp_eatHexDigits = function(state) {
  var start = state.pos;
  var ch = 0;
  state.lastIntValue = 0;
  while (isHexDigit(ch = state.current())) {
    state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);
    state.advance();
  }
  return state.pos !== start
};
function isHexDigit(ch) {
  return (
    (ch >= 0x30 /* 0 */ && ch <= 0x39 /* 9 */) ||
    (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) ||
    (ch >= 0x61 /* a */ && ch <= 0x66 /* f */)
  )
}
function hexToInt(ch) {
  if (ch >= 0x41 /* A */ && ch <= 0x46 /* F */) {
    return 10 + (ch - 0x41 /* A */)
  }
  if (ch >= 0x61 /* a */ && ch <= 0x66 /* f */) {
    return 10 + (ch - 0x61 /* a */)
  }
  return ch - 0x30 /* 0 */
}

// https://www.ecma-international.org/ecma-262/8.0/#prod-annexB-LegacyOctalEscapeSequence
// Allows only 0-377(octal) i.e. 0-255(decimal).
pp$1.regexp_eatLegacyOctalEscapeSequence = function(state) {
  if (this.regexp_eatOctalDigit(state)) {
    var n1 = state.lastIntValue;
    if (this.regexp_eatOctalDigit(state)) {
      var n2 = state.lastIntValue;
      if (n1 <= 3 && this.regexp_eatOctalDigit(state)) {
        state.lastIntValue = n1 * 64 + n2 * 8 + state.lastIntValue;
      } else {
        state.lastIntValue = n1 * 8 + n2;
      }
    } else {
      state.lastIntValue = n1;
    }
    return true
  }
  return false
};

// https://www.ecma-international.org/ecma-262/8.0/#prod-OctalDigit
pp$1.regexp_eatOctalDigit = function(state) {
  var ch = state.current();
  if (isOctalDigit(ch)) {
    state.lastIntValue = ch - 0x30; /* 0 */
    state.advance();
    return true
  }
  state.lastIntValue = 0;
  return false
};
function isOctalDigit(ch) {
  return ch >= 0x30 /* 0 */ && ch <= 0x37 /* 7 */
}

// https://www.ecma-international.org/ecma-262/8.0/#prod-Hex4Digits
// https://www.ecma-international.org/ecma-262/8.0/#prod-HexDigit
// And HexDigit HexDigit in https://www.ecma-international.org/ecma-262/8.0/#prod-HexEscapeSequence
pp$1.regexp_eatFixedHexDigits = function(state, length) {
  var start = state.pos;
  state.lastIntValue = 0;
  for (var i = 0; i < length; ++i) {
    var ch = state.current();
    if (!isHexDigit(ch)) {
      state.pos = start;
      return false
    }
    state.lastIntValue = 16 * state.lastIntValue + hexToInt(ch);
    state.advance();
  }
  return true
};

// Object type used to represent tokens. Note that normally, tokens
// simply exist as properties on the parser object. This is only
// used for the onToken callback and the external tokenizer.

var Token = function Token(p) {
  this.type = p.type;
  this.value = p.value;
  this.start = p.start;
  this.end = p.end;
  if (p.options.locations)
    { this.loc = new SourceLocation(p, p.startLoc, p.endLoc); }
  if (p.options.ranges)
    { this.range = [p.start, p.end]; }
};

// ## Tokenizer

var pp = Parser.prototype;

// Move to the next token

pp.next = function(ignoreEscapeSequenceInKeyword) {
  if (!ignoreEscapeSequenceInKeyword && this.type.keyword && this.containsEsc)
    { this.raiseRecoverable(this.start, "Escape sequence in keyword " + this.type.keyword); }
  if (this.options.onToken)
    { this.options.onToken(new Token(this)); }

  this.lastTokEnd = this.end;
  this.lastTokStart = this.start;
  this.lastTokEndLoc = this.endLoc;
  this.lastTokStartLoc = this.startLoc;
  this.nextToken();
};

pp.getToken = function() {
  this.next();
  return new Token(this)
};

// If we're in an ES6 environment, make parsers iterable
if (typeof Symbol !== "undefined")
  { pp[Symbol.iterator] = function() {
    var this$1$1 = this;

    return {
      next: function () {
        var token = this$1$1.getToken();
        return {
          done: token.type === types$1.eof,
          value: token
        }
      }
    }
  }; }

// Toggle strict mode. Re-reads the next number or string to please
// pedantic tests (`"use strict"; 010;` should fail).

// Read a single token, updating the parser object's token-related
// properties.

pp.nextToken = function() {
  var curContext = this.curContext();
  if (!curContext || !curContext.preserveSpace) { this.skipSpace(); }

  this.start = this.pos;
  if (this.options.locations) { this.startLoc = this.curPosition(); }
  if (this.pos >= this.input.length) { return this.finishToken(types$1.eof) }

  if (curContext.override) { return curContext.override(this) }
  else { this.readToken(this.fullCharCodeAtPos()); }
};

pp.readToken = function(code) {
  // Identifier or keyword. '\uXXXX' sequences are allowed in
  // identifiers, so '\' also dispatches to that.
  if (isIdentifierStart(code, this.options.ecmaVersion >= 6) || code === 92 /* '\' */)
    { return this.readWord() }

  return this.getTokenFromCode(code)
};

pp.fullCharCodeAt = function(pos) {
  var code = this.input.charCodeAt(pos);
  if (code <= 0xd7ff || code >= 0xdc00) { return code }
  var next = this.input.charCodeAt(pos + 1);
  return next <= 0xdbff || next >= 0xe000 ? code : (code << 10) + next - 0x35fdc00
};

pp.fullCharCodeAtPos = function() {
  return this.fullCharCodeAt(this.pos)
};

pp.skipBlockComment = function() {
  var startLoc = this.options.onComment && this.curPosition();
  var start = this.pos, end = this.input.indexOf("*/", this.pos += 2);
  if (end === -1) { this.raise(this.pos - 2, "Unterminated comment"); }
  this.pos = end + 2;
  if (this.options.locations) {
    for (var nextBreak = (void 0), pos = start; (nextBreak = nextLineBreak(this.input, pos, this.pos)) > -1;) {
      ++this.curLine;
      pos = this.lineStart = nextBreak;
    }
  }
  if (this.options.onComment)
    { this.options.onComment(true, this.input.slice(start + 2, end), start, this.pos,
                           startLoc, this.curPosition()); }
};

pp.skipLineComment = function(startSkip) {
  var start = this.pos;
  var startLoc = this.options.onComment && this.curPosition();
  var ch = this.input.charCodeAt(this.pos += startSkip);
  while (this.pos < this.input.length && !isNewLine(ch)) {
    ch = this.input.charCodeAt(++this.pos);
  }
  if (this.options.onComment)
    { this.options.onComment(false, this.input.slice(start + startSkip, this.pos), start, this.pos,
                           startLoc, this.curPosition()); }
};

// Called at the start of the parse and after every token. Skips
// whitespace and comments, and.

pp.skipSpace = function() {
  loop: while (this.pos < this.input.length) {
    var ch = this.input.charCodeAt(this.pos);
    switch (ch) {
    case 32: case 160: // ' '
      ++this.pos;
      break
    case 13:
      if (this.input.charCodeAt(this.pos + 1) === 10) {
        ++this.pos;
      }
    case 10: case 8232: case 8233:
      ++this.pos;
      if (this.options.locations) {
        ++this.curLine;
        this.lineStart = this.pos;
      }
      break
    case 47: // '/'
      switch (this.input.charCodeAt(this.pos + 1)) {
      case 42: // '*'
        this.skipBlockComment();
        break
      case 47:
        this.skipLineComment(2);
        break
      default:
        break loop
      }
      break
    default:
      if (ch > 8 && ch < 14 || ch >= 5760 && nonASCIIwhitespace.test(String.fromCharCode(ch))) {
        ++this.pos;
      } else {
        break loop
      }
    }
  }
};

// Called at the end of every token. Sets `end`, `val`, and
// maintains `context` and `exprAllowed`, and skips the space after
// the token, so that the next one's `start` will point at the
// right position.

pp.finishToken = function(type, val) {
  this.end = this.pos;
  if (this.options.locations) { this.endLoc = this.curPosition(); }
  var prevType = this.type;
  this.type = type;
  this.value = val;

  this.updateContext(prevType);
};

// ### Token reading

// This is the function that is called to fetch the next token. It
// is somewhat obscure, because it works in character codes rather
// than characters, and because operator parsing has been inlined
// into it.
//
// All in the name of speed.
//
pp.readToken_dot = function() {
  var next = this.input.charCodeAt(this.pos + 1);
  if (next >= 48 && next <= 57) { return this.readNumber(true) }
  var next2 = this.input.charCodeAt(this.pos + 2);
  if (this.options.ecmaVersion >= 6 && next === 46 && next2 === 46) { // 46 = dot '.'
    this.pos += 3;
    return this.finishToken(types$1.ellipsis)
  } else {
    ++this.pos;
    return this.finishToken(types$1.dot)
  }
};

pp.readToken_slash = function() { // '/'
  var next = this.input.charCodeAt(this.pos + 1);
  if (this.exprAllowed) { ++this.pos; return this.readRegexp() }
  if (next === 61) { return this.finishOp(types$1.assign, 2) }
  return this.finishOp(types$1.slash, 1)
};

pp.readToken_mult_modulo_exp = function(code) { // '%*'
  var next = this.input.charCodeAt(this.pos + 1);
  var size = 1;
  var tokentype = code === 42 ? types$1.star : types$1.modulo;

  // exponentiation operator ** and **=
  if (this.options.ecmaVersion >= 7 && code === 42 && next === 42) {
    ++size;
    tokentype = types$1.starstar;
    next = this.input.charCodeAt(this.pos + 2);
  }

  if (next === 61) { return this.finishOp(types$1.assign, size + 1) }
  return this.finishOp(tokentype, size)
};

pp.readToken_pipe_amp = function(code) { // '|&'
  var next = this.input.charCodeAt(this.pos + 1);
  if (next === code) {
    if (this.options.ecmaVersion >= 12) {
      var next2 = this.input.charCodeAt(this.pos + 2);
      if (next2 === 61) { return this.finishOp(types$1.assign, 3) }
    }
    return this.finishOp(code === 124 ? types$1.logicalOR : types$1.logicalAND, 2)
  }
  if (next === 61) { return this.finishOp(types$1.assign, 2) }
  return this.finishOp(code === 124 ? types$1.bitwiseOR : types$1.bitwiseAND, 1)
};

pp.readToken_caret = function() { // '^'
  var next = this.input.charCodeAt(this.pos + 1);
  if (next === 61) { return this.finishOp(types$1.assign, 2) }
  return this.finishOp(types$1.bitwiseXOR, 1)
};

pp.readToken_plus_min = function(code) { // '+-'
  var next = this.input.charCodeAt(this.pos + 1);
  if (next === code) {
    if (next === 45 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 62 &&
        (this.lastTokEnd === 0 || lineBreak.test(this.input.slice(this.lastTokEnd, this.pos)))) {
      // A `-->` line comment
      this.skipLineComment(3);
      this.skipSpace();
      return this.nextToken()
    }
    return this.finishOp(types$1.incDec, 2)
  }
  if (next === 61) { return this.finishOp(types$1.assign, 2) }
  return this.finishOp(types$1.plusMin, 1)
};

pp.readToken_lt_gt = function(code) { // '<>'
  var next = this.input.charCodeAt(this.pos + 1);
  var size = 1;
  if (next === code) {
    size = code === 62 && this.input.charCodeAt(this.pos + 2) === 62 ? 3 : 2;
    if (this.input.charCodeAt(this.pos + size) === 61) { return this.finishOp(types$1.assign, size + 1) }
    return this.finishOp(types$1.bitShift, size)
  }
  if (next === 33 && code === 60 && !this.inModule && this.input.charCodeAt(this.pos + 2) === 45 &&
      this.input.charCodeAt(this.pos + 3) === 45) {
    // `<!--`, an XML-style comment that should be interpreted as a line comment
    this.skipLineComment(4);
    this.skipSpace();
    return this.nextToken()
  }
  if (next === 61) { size = 2; }
  return this.finishOp(types$1.relational, size)
};

pp.readToken_eq_excl = function(code) { // '=!'
  var next = this.input.charCodeAt(this.pos + 1);
  if (next === 61) { return this.finishOp(types$1.equality, this.input.charCodeAt(this.pos + 2) === 61 ? 3 : 2) }
  if (code === 61 && next === 62 && this.options.ecmaVersion >= 6) { // '=>'
    this.pos += 2;
    return this.finishToken(types$1.arrow)
  }
  return this.finishOp(code === 61 ? types$1.eq : types$1.prefix, 1)
};

pp.readToken_question = function() { // '?'
  var ecmaVersion = this.options.ecmaVersion;
  if (ecmaVersion >= 11) {
    var next = this.input.charCodeAt(this.pos + 1);
    if (next === 46) {
      var next2 = this.input.charCodeAt(this.pos + 2);
      if (next2 < 48 || next2 > 57) { return this.finishOp(types$1.questionDot, 2) }
    }
    if (next === 63) {
      if (ecmaVersion >= 12) {
        var next2$1 = this.input.charCodeAt(this.pos + 2);
        if (next2$1 === 61) { return this.finishOp(types$1.assign, 3) }
      }
      return this.finishOp(types$1.coalesce, 2)
    }
  }
  return this.finishOp(types$1.question, 1)
};

pp.readToken_numberSign = function() { // '#'
  var ecmaVersion = this.options.ecmaVersion;
  var code = 35; // '#'
  if (ecmaVersion >= 13) {
    ++this.pos;
    code = this.fullCharCodeAtPos();
    if (isIdentifierStart(code, true) || code === 92 /* '\' */) {
      return this.finishToken(types$1.privateId, this.readWord1())
    }
  }

  this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'");
};

pp.getTokenFromCode = function(code) {
  switch (code) {
  // The interpretation of a dot depends on whether it is followed
  // by a digit or another two dots.
  case 46: // '.'
    return this.readToken_dot()

  // Punctuation tokens.
  case 40: ++this.pos; return this.finishToken(types$1.parenL)
  case 41: ++this.pos; return this.finishToken(types$1.parenR)
  case 59: ++this.pos; return this.finishToken(types$1.semi)
  case 44: ++this.pos; return this.finishToken(types$1.comma)
  case 91: ++this.pos; return this.finishToken(types$1.bracketL)
  case 93: ++this.pos; return this.finishToken(types$1.bracketR)
  case 123: ++this.pos; return this.finishToken(types$1.braceL)
  case 125: ++this.pos; return this.finishToken(types$1.braceR)
  case 58: ++this.pos; return this.finishToken(types$1.colon)

  case 96: // '`'
    if (this.options.ecmaVersion < 6) { break }
    ++this.pos;
    return this.finishToken(types$1.backQuote)

  case 48: // '0'
    var next = this.input.charCodeAt(this.pos + 1);
    if (next === 120 || next === 88) { return this.readRadixNumber(16) } // '0x', '0X' - hex number
    if (this.options.ecmaVersion >= 6) {
      if (next === 111 || next === 79) { return this.readRadixNumber(8) } // '0o', '0O' - octal number
      if (next === 98 || next === 66) { return this.readRadixNumber(2) } // '0b', '0B' - binary number
    }

  // Anything else beginning with a digit is an integer, octal
  // number, or float.
  case 49: case 50: case 51: case 52: case 53: case 54: case 55: case 56: case 57: // 1-9
    return this.readNumber(false)

  // Quotes produce strings.
  case 34: case 39: // '"', "'"
    return this.readString(code)

  // Operators are parsed inline in tiny state machines. '=' (61) is
  // often referred to. `finishOp` simply skips the amount of
  // characters it is given as second argument, and returns a token
  // of the type given by its first argument.
  case 47: // '/'
    return this.readToken_slash()

  case 37: case 42: // '%*'
    return this.readToken_mult_modulo_exp(code)

  case 124: case 38: // '|&'
    return this.readToken_pipe_amp(code)

  case 94: // '^'
    return this.readToken_caret()

  case 43: case 45: // '+-'
    return this.readToken_plus_min(code)

  case 60: case 62: // '<>'
    return this.readToken_lt_gt(code)

  case 61: case 33: // '=!'
    return this.readToken_eq_excl(code)

  case 63: // '?'
    return this.readToken_question()

  case 126: // '~'
    return this.finishOp(types$1.prefix, 1)

  case 35: // '#'
    return this.readToken_numberSign()
  }

  this.raise(this.pos, "Unexpected character '" + codePointToString(code) + "'");
};

pp.finishOp = function(type, size) {
  var str = this.input.slice(this.pos, this.pos + size);
  this.pos += size;
  return this.finishToken(type, str)
};

pp.readRegexp = function() {
  var escaped, inClass, start = this.pos;
  for (;;) {
    if (this.pos >= this.input.length) { this.raise(start, "Unterminated regular expression"); }
    var ch = this.input.charAt(this.pos);
    if (lineBreak.test(ch)) { this.raise(start, "Unterminated regular expression"); }
    if (!escaped) {
      if (ch === "[") { inClass = true; }
      else if (ch === "]" && inClass) { inClass = false; }
      else if (ch === "/" && !inClass) { break }
      escaped = ch === "\\";
    } else { escaped = false; }
    ++this.pos;
  }
  var pattern = this.input.slice(start, this.pos);
  ++this.pos;
  var flagsStart = this.pos;
  var flags = this.readWord1();
  if (this.containsEsc) { this.unexpected(flagsStart); }

  // Validate pattern
  var state = this.regexpState || (this.regexpState = new RegExpValidationState(this));
  state.reset(start, pattern, flags);
  this.validateRegExpFlags(state);
  this.validateRegExpPattern(state);

  // Create Literal#value property value.
  var value = null;
  try {
    value = new RegExp(pattern, flags);
  } catch (e) {
    // ESTree requires null if it failed to instantiate RegExp object.
    // https://github.com/estree/estree/blob/a27003adf4fd7bfad44de9cef372a2eacd527b1c/es5.md#regexpliteral
  }

  return this.finishToken(types$1.regexp, {pattern: pattern, flags: flags, value: value})
};

// Read an integer in the given radix. Return null if zero digits
// were read, the integer value otherwise. When `len` is given, this
// will return `null` unless the integer has exactly `len` digits.

pp.readInt = function(radix, len, maybeLegacyOctalNumericLiteral) {
  // `len` is used for character escape sequences. In that case, disallow separators.
  var allowSeparators = this.options.ecmaVersion >= 12 && len === undefined;

  // `maybeLegacyOctalNumericLiteral` is true if it doesn't have prefix (0x,0o,0b)
  // and isn't fraction part nor exponent part. In that case, if the first digit
  // is zero then disallow separators.
  var isLegacyOctalNumericLiteral = maybeLegacyOctalNumericLiteral && this.input.charCodeAt(this.pos) === 48;

  var start = this.pos, total = 0, lastCode = 0;
  for (var i = 0, e = len == null ? Infinity : len; i < e; ++i, ++this.pos) {
    var code = this.input.charCodeAt(this.pos), val = (void 0);

    if (allowSeparators && code === 95) {
      if (isLegacyOctalNumericLiteral) { this.raiseRecoverable(this.pos, "Numeric separator is not allowed in legacy octal numeric literals"); }
      if (lastCode === 95) { this.raiseRecoverable(this.pos, "Numeric separator must be exactly one underscore"); }
      if (i === 0) { this.raiseRecoverable(this.pos, "Numeric separator is not allowed at the first of digits"); }
      lastCode = code;
      continue
    }

    if (code >= 97) { val = code - 97 + 10; } // a
    else if (code >= 65) { val = code - 65 + 10; } // A
    else if (code >= 48 && code <= 57) { val = code - 48; } // 0-9
    else { val = Infinity; }
    if (val >= radix) { break }
    lastCode = code;
    total = total * radix + val;
  }

  if (allowSeparators && lastCode === 95) { this.raiseRecoverable(this.pos - 1, "Numeric separator is not allowed at the last of digits"); }
  if (this.pos === start || len != null && this.pos - start !== len) { return null }

  return total
};

function stringToNumber(str, isLegacyOctalNumericLiteral) {
  if (isLegacyOctalNumericLiteral) {
    return parseInt(str, 8)
  }

  // `parseFloat(value)` stops parsing at the first numeric separator then returns a wrong value.
  return parseFloat(str.replace(/_/g, ""))
}

function stringToBigInt(str) {
  if (typeof BigInt !== "function") {
    return null
  }

  // `BigInt(value)` throws syntax error if the string contains numeric separators.
  return BigInt(str.replace(/_/g, ""))
}

pp.readRadixNumber = function(radix) {
  var start = this.pos;
  this.pos += 2; // 0x
  var val = this.readInt(radix);
  if (val == null) { this.raise(this.start + 2, "Expected number in radix " + radix); }
  if (this.options.ecmaVersion >= 11 && this.input.charCodeAt(this.pos) === 110) {
    val = stringToBigInt(this.input.slice(start, this.pos));
    ++this.pos;
  } else if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
  return this.finishToken(types$1.num, val)
};

// Read an integer, octal integer, or floating-point number.

pp.readNumber = function(startsWithDot) {
  var start = this.pos;
  if (!startsWithDot && this.readInt(10, undefined, true) === null) { this.raise(start, "Invalid number"); }
  var octal = this.pos - start >= 2 && this.input.charCodeAt(start) === 48;
  if (octal && this.strict) { this.raise(start, "Invalid number"); }
  var next = this.input.charCodeAt(this.pos);
  if (!octal && !startsWithDot && this.options.ecmaVersion >= 11 && next === 110) {
    var val$1 = stringToBigInt(this.input.slice(start, this.pos));
    ++this.pos;
    if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }
    return this.finishToken(types$1.num, val$1)
  }
  if (octal && /[89]/.test(this.input.slice(start, this.pos))) { octal = false; }
  if (next === 46 && !octal) { // '.'
    ++this.pos;
    this.readInt(10);
    next = this.input.charCodeAt(this.pos);
  }
  if ((next === 69 || next === 101) && !octal) { // 'eE'
    next = this.input.charCodeAt(++this.pos);
    if (next === 43 || next === 45) { ++this.pos; } // '+-'
    if (this.readInt(10) === null) { this.raise(start, "Invalid number"); }
  }
  if (isIdentifierStart(this.fullCharCodeAtPos())) { this.raise(this.pos, "Identifier directly after number"); }

  var val = stringToNumber(this.input.slice(start, this.pos), octal);
  return this.finishToken(types$1.num, val)
};

// Read a string value, interpreting backslash-escapes.

pp.readCodePoint = function() {
  var ch = this.input.charCodeAt(this.pos), code;

  if (ch === 123) { // '{'
    if (this.options.ecmaVersion < 6) { this.unexpected(); }
    var codePos = ++this.pos;
    code = this.readHexChar(this.input.indexOf("}", this.pos) - this.pos);
    ++this.pos;
    if (code > 0x10FFFF) { this.invalidStringToken(codePos, "Code point out of bounds"); }
  } else {
    code = this.readHexChar(4);
  }
  return code
};

pp.readString = function(quote) {
  var out = "", chunkStart = ++this.pos;
  for (;;) {
    if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated string constant"); }
    var ch = this.input.charCodeAt(this.pos);
    if (ch === quote) { break }
    if (ch === 92) { // '\'
      out += this.input.slice(chunkStart, this.pos);
      out += this.readEscapedChar(false);
      chunkStart = this.pos;
    } else if (ch === 0x2028 || ch === 0x2029) {
      if (this.options.ecmaVersion < 10) { this.raise(this.start, "Unterminated string constant"); }
      ++this.pos;
      if (this.options.locations) {
        this.curLine++;
        this.lineStart = this.pos;
      }
    } else {
      if (isNewLine(ch)) { this.raise(this.start, "Unterminated string constant"); }
      ++this.pos;
    }
  }
  out += this.input.slice(chunkStart, this.pos++);
  return this.finishToken(types$1.string, out)
};

// Reads template string tokens.

var INVALID_TEMPLATE_ESCAPE_ERROR = {};

pp.tryReadTemplateToken = function() {
  this.inTemplateElement = true;
  try {
    this.readTmplToken();
  } catch (err) {
    if (err === INVALID_TEMPLATE_ESCAPE_ERROR) {
      this.readInvalidTemplateToken();
    } else {
      throw err
    }
  }

  this.inTemplateElement = false;
};

pp.invalidStringToken = function(position, message) {
  if (this.inTemplateElement && this.options.ecmaVersion >= 9) {
    throw INVALID_TEMPLATE_ESCAPE_ERROR
  } else {
    this.raise(position, message);
  }
};

pp.readTmplToken = function() {
  var out = "", chunkStart = this.pos;
  for (;;) {
    if (this.pos >= this.input.length) { this.raise(this.start, "Unterminated template"); }
    var ch = this.input.charCodeAt(this.pos);
    if (ch === 96 || ch === 36 && this.input.charCodeAt(this.pos + 1) === 123) { // '`', '${'
      if (this.pos === this.start && (this.type === types$1.template || this.type === types$1.invalidTemplate)) {
        if (ch === 36) {
          this.pos += 2;
          return this.finishToken(types$1.dollarBraceL)
        } else {
          ++this.pos;
          return this.finishToken(types$1.backQuote)
        }
      }
      out += this.input.slice(chunkStart, this.pos);
      return this.finishToken(types$1.template, out)
    }
    if (ch === 92) { // '\'
      out += this.input.slice(chunkStart, this.pos);
      out += this.readEscapedChar(true);
      chunkStart = this.pos;
    } else if (isNewLine(ch)) {
      out += this.input.slice(chunkStart, this.pos);
      ++this.pos;
      switch (ch) {
      case 13:
        if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; }
      case 10:
        out += "\n";
        break
      default:
        out += String.fromCharCode(ch);
        break
      }
      if (this.options.locations) {
        ++this.curLine;
        this.lineStart = this.pos;
      }
      chunkStart = this.pos;
    } else {
      ++this.pos;
    }
  }
};

// Reads a template token to search for the end, without validating any escape sequences
pp.readInvalidTemplateToken = function() {
  for (; this.pos < this.input.length; this.pos++) {
    switch (this.input[this.pos]) {
    case "\\":
      ++this.pos;
      break

    case "$":
      if (this.input[this.pos + 1] !== "{") { break }
      // fall through
    case "`":
      return this.finishToken(types$1.invalidTemplate, this.input.slice(this.start, this.pos))

    case "\r":
      if (this.input[this.pos + 1] === "\n") { ++this.pos; }
      // fall through
    case "\n": case "\u2028": case "\u2029":
      ++this.curLine;
      this.lineStart = this.pos + 1;
      break
    }
  }
  this.raise(this.start, "Unterminated template");
};

// Used to read escaped characters

pp.readEscapedChar = function(inTemplate) {
  var ch = this.input.charCodeAt(++this.pos);
  ++this.pos;
  switch (ch) {
  case 110: return "\n" // 'n' -> '\n'
  case 114: return "\r" // 'r' -> '\r'
  case 120: return String.fromCharCode(this.readHexChar(2)) // 'x'
  case 117: return codePointToString(this.readCodePoint()) // 'u'
  case 116: return "\t" // 't' -> '\t'
  case 98: return "\b" // 'b' -> '\b'
  case 118: return "\u000b" // 'v' -> '\u000b'
  case 102: return "\f" // 'f' -> '\f'
  case 13: if (this.input.charCodeAt(this.pos) === 10) { ++this.pos; } // '\r\n'
  case 10: // ' \n'
    if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }
    return ""
  case 56:
  case 57:
    if (this.strict) {
      this.invalidStringToken(
        this.pos - 1,
        "Invalid escape sequence"
      );
    }
    if (inTemplate) {
      var codePos = this.pos - 1;

      this.invalidStringToken(
        codePos,
        "Invalid escape sequence in template string"
      );
    }
  default:
    if (ch >= 48 && ch <= 55) {
      var octalStr = this.input.substr(this.pos - 1, 3).match(/^[0-7]+/)[0];
      var octal = parseInt(octalStr, 8);
      if (octal > 255) {
        octalStr = octalStr.slice(0, -1);
        octal = parseInt(octalStr, 8);
      }
      this.pos += octalStr.length - 1;
      ch = this.input.charCodeAt(this.pos);
      if ((octalStr !== "0" || ch === 56 || ch === 57) && (this.strict || inTemplate)) {
        this.invalidStringToken(
          this.pos - 1 - octalStr.length,
          inTemplate
            ? "Octal literal in template string"
            : "Octal literal in strict mode"
        );
      }
      return String.fromCharCode(octal)
    }
    if (isNewLine(ch)) {
      // Unicode new line characters after \ get removed from output in both
      // template literals and strings
      if (this.options.locations) { this.lineStart = this.pos; ++this.curLine; }
      return ""
    }
    return String.fromCharCode(ch)
  }
};

// Used to read character escape sequences ('\x', '\u', '\U').

pp.readHexChar = function(len) {
  var codePos = this.pos;
  var n = this.readInt(16, len);
  if (n === null) { this.invalidStringToken(codePos, "Bad character escape sequence"); }
  return n
};

// Read an identifier, and return it as a string. Sets `this.containsEsc`
// to whether the word contained a '\u' escape.
//
// Incrementally adds only escaped chars, adding other chunks as-is
// as a micro-optimization.

pp.readWord1 = function() {
  this.containsEsc = false;
  var word = "", first = true, chunkStart = this.pos;
  var astral = this.options.ecmaVersion >= 6;
  while (this.pos < this.input.length) {
    var ch = this.fullCharCodeAtPos();
    if (isIdentifierChar(ch, astral)) {
      this.pos += ch <= 0xffff ? 1 : 2;
    } else if (ch === 92) { // "\"
      this.containsEsc = true;
      word += this.input.slice(chunkStart, this.pos);
      var escStart = this.pos;
      if (this.input.charCodeAt(++this.pos) !== 117) // "u"
        { this.invalidStringToken(this.pos, "Expecting Unicode escape sequence \\uXXXX"); }
      ++this.pos;
      var esc = this.readCodePoint();
      if (!(first ? isIdentifierStart : isIdentifierChar)(esc, astral))
        { this.invalidStringToken(escStart, "Invalid Unicode escape"); }
      word += codePointToString(esc);
      chunkStart = this.pos;
    } else {
      break
    }
    first = false;
  }
  return word + this.input.slice(chunkStart, this.pos)
};

// Read an identifier or keyword token. Will check for reserved
// words when necessary.

pp.readWord = function() {
  var word = this.readWord1();
  var type = types$1.name;
  if (this.keywords.test(word)) {
    type = keywords[word];
  }
  return this.finishToken(type, word)
};

// Acorn is a tiny, fast JavaScript parser written in JavaScript.
//
// Acorn was written by Marijn Haverbeke, Ingvar Stepanyan, and
// various contributors and released under an MIT license.
//
// Git repositories for Acorn are available at
//
//     http://marijnhaverbeke.nl/git/acorn
//     https://github.com/acornjs/acorn.git
//
// Please use the [github bug tracker][ghbt] to report issues.
//
// [ghbt]: https://github.com/acornjs/acorn/issues


var version = "8.18.0";

Parser.acorn = {
  Parser: Parser,
  version: version,
  defaultOptions: defaultOptions,
  Position: Position,
  SourceLocation: SourceLocation,
  getLineInfo: getLineInfo,
  Node: Node,
  TokenType: TokenType,
  tokTypes: types$1,
  keywordTypes: keywords,
  TokContext: TokContext,
  tokContexts: types,
  isIdentifierChar: isIdentifierChar,
  isIdentifierStart: isIdentifierStart,
  Token: Token,
  isNewLine: isNewLine,
  lineBreak: lineBreak,
  lineBreakG: lineBreakG,
  nonASCIIwhitespace: nonASCIIwhitespace
};

// The main exported interface (under `self.acorn` when in the
// browser) is a `parse` function that takes a code string and returns
// an abstract syntax tree as specified by the [ESTree spec][estree].
//
// [estree]: https://github.com/estree/estree

function parse(input, options) {
  return Parser.parse(input, options)
}

// This function tries to parse a single expression at a given
// offset in a string. Useful for parsing mixed-language formats
// that embed JavaScript expressions.

function parseExpressionAt(input, pos, options) {
  return Parser.parseExpressionAt(input, pos, options)
}

// Acorn is organized as a tokenizer and a recursive-descent parser.
// The `tokenizer` export provides an interface to the tokenizer.

function tokenizer(input, options) {
  return Parser.tokenizer(input, options)
}

export { Node, Parser, Position, SourceLocation, TokContext, Token, TokenType, defaultOptions, getLineInfo, isIdentifierChar, isIdentifierStart, isNewLine, keywords as keywordTypes, lineBreak, lineBreakG, nonASCIIwhitespace, parse, parseExpressionAt, types as tokContexts, types$1 as tokTypes, tokenizer, version };
_x'use strict';

var path = require('path');
var fs = require('fs');
var acorn = require('./acorn.js');

function _interopNamespaceDefault(e) {
  var n = Object.create(null);
  if (e) {
    Object.keys(e).forEach(function (k) {
      if (k !== 'default') {
        var d = Object.getOwnPropertyDescriptor(e, k);
        Object.defineProperty(n, k, d.get ? d : {
          enumerable: true,
          get: function () { return e[k]; }
        });
      }
    });
  }
  n.default = e;
  return Object.freeze(n);
}

var acorn__namespace = /*#__PURE__*/_interopNamespaceDefault(acorn);

var inputFilePaths = [], forceFileName = false, fileMode = false, silent = false, compact = false, tokenize = false;
var options = {};

function help(status) {
  var print = (status === 0) ? console.log : console.error;
  print("usage: " + path.basename(process.argv[1]) + " [--ecma3|--ecma5|--ecma6|--ecma7|--ecma8|--ecma9|...|--ecma2015|--ecma2016|--ecma2017|--ecma2018|...]");
  print("        [--tokenize] [--locations] [--allow-hash-bang] [--allow-await-outside-function] [--compact] [--silent] [--module] [--help] [--] [<infile>...]");
  process.exit(status);
}

for (var i = 2; i < process.argv.length; ++i) {
  var arg = process.argv[i];
  if (arg[0] !== "-" || arg === "-") { inputFilePaths.push(arg); }
  else if (arg === "--") {
    inputFilePaths.push.apply(inputFilePaths, process.argv.slice(i + 1));
    forceFileName = true;
    break
  } else if (arg === "--locations") { options.locations = true; }
  else if (arg === "--allow-hash-bang") { options.allowHashBang = true; }
  else if (arg === "--allow-await-outside-function") { options.allowAwaitOutsideFunction = true; }
  else if (arg === "--silent") { silent = true; }
  else if (arg === "--compact") { compact = true; }
  else if (arg === "--help") { help(0); }
  else if (arg === "--tokenize") { tokenize = true; }
  else if (arg === "--module") { options.sourceType = "module"; }
  else {
    var match = arg.match(/^--ecma(\d+)$/);
    if (match)
      { options.ecmaVersion = +match[1]; }
    else
      { help(1); }
  }
}

function run(codeList) {
  var result = [], fileIdx = 0;
  try {
    codeList.forEach(function (code, idx) {
      fileIdx = idx;
      if (!tokenize) {
        result = acorn__namespace.parse(code, options);
        options.program = result;
      } else {
        var tokenizer = acorn__namespace.tokenizer(code, options), token;
        do {
          token = tokenizer.getToken();
          result.push(token);
        } while (token.type !== acorn__namespace.tokTypes.eof)
      }
    });
  } catch (e) {
    console.error(fileMode ? e.message.replace(/\(\d+:\d+\)$/, function (m) { return m.slice(0, 1) + inputFilePaths[fileIdx] + " " + m.slice(1); }) : e.message);
    process.exit(1);
  }
  if (!silent) { console.log(JSON.stringify(result, function (_, value) { return typeof value === "bigint" ? null : value; }, compact ? null : 2)); }
}

if (fileMode = inputFilePaths.length && (forceFileName || !inputFilePaths.includes("-") || inputFilePaths.length !== 1)) {
  run(inputFilePaths.map(function (path) { return fs.readFileSync(path, "utf8"); }));
} else {
  var code = "";
  process.stdin.resume();
  process.stdin.on("data", function (chunk) { return code += chunk; });
  process.stdin.on("end", function () { return run([code]); });
}
	Bx+{
  "name": "acorn",
  "description": "ECMAScript parser",
  "homepage": "https://github.com/acornjs/acorn",
  "main": "dist/acorn.js",
  "types": "dist/acorn.d.ts",
  "module": "dist/acorn.mjs",
  "exports": {
    ".": [
      {
        "import": "./dist/acorn.mjs",
        "require": "./dist/acorn.js",
        "default": "./dist/acorn.js"
      },
      "./dist/acorn.js"
    ],
    "./package.json": "./package.json"
  },
  "version": "8.18.0",
  "engines": {
    "node": ">=0.4.0"
  },
  "maintainers": [
    {
      "name": "Marijn Haverbeke",
      "email": "marijn@haverbeke.berlin",
      "web": "https://marijnhaverbeke.nl"
    },
    {
      "name": "Ingvar Stepanyan",
      "email": "me@rreverser.com",
      "web": "https://rreverser.com/"
    },
    {
      "name": "Adrian Heine",
      "web": "http://adrianheine.de"
    }
  ],
  "repository": {
    "type": "git",
    "url": "git+https://github.com/acornjs/acorn.git"
  },
  "license": "MIT",
  "scripts": {
    "prepare": "cd ..; npm run build:main"
  },
  "bin": {
    "acorn": "bin/acorn"
  }
}
|)Ƭx 100644 .tonic_example.js -MQaEC100644 LICENSE qxh9*^100644 README.md ez1La(z40000 dist ћrWSgx}V40000 lib i}df	ja}100644 package.json Yl+v)Uz40000 scripts #e;#8sj0	cxHvar Ajv = require('ajv');
var ajv = new Ajv({allErrors: true});

var schema = {
  "properties": {
    "foo": { "type": "string" },
    "bar": { "type": "number", "maximum": 3 }
  }
};

var validate = ajv.compile(schema);

test({"foo": "abc", "bar": 2});
test({"foo": 2, "bar": 4});

function test(data) {
  var valid = validate(data);
  if (valid) console.log('Valid!');
  else console.log('Invalid: ' + ajv.errorsText(validate.errors));
}ۅ*x   <img align="right" alt="Ajv logo" width="160" src="https://ajv.js.org/images/ajv_logo.png">

# Ajv: Another JSON Schema Validator

The fastest JSON Schema validator for Node.js and browser. Supports draft-04/06/07.

[![Build Status](https://travis-ci.org/ajv-validator/ajv.svg?branch=master)](https://travis-ci.org/ajv-validator/ajv)
[![npm](https://img.shields.io/npm/v/ajv.svg)](https://www.npmjs.com/package/ajv)
[![npm (beta)](https://img.shields.io/npm/v/ajv/beta)](https://www.npmjs.com/package/ajv/v/7.0.0-beta.4)
[![npm downloads](https://img.shields.io/npm/dm/ajv.svg)](https://www.npmjs.com/package/ajv)
[![Coverage Status](https://coveralls.io/repos/github/ajv-validator/ajv/badge.svg?branch=master)](https://coveralls.io/github/ajv-validator/ajv?branch=master)
[![Gitter](https://img.shields.io/gitter/room/ajv-validator/ajv.svg)](https://gitter.im/ajv-validator/ajv)
[![GitHub Sponsors](https://img.shields.io/badge/$-sponsors-brightgreen)](https://github.com/sponsors/epoberezkin)


## Ajv v7 beta is released

[Ajv version 7 (beta)](https://github.com/ajv-validator/ajv/tree/v7-beta) is released with these changes:

- support of JSON Schema draft-2019-09 features: [`unevaluatedProperties`](./json-schema.md#unevaluatedproperties) and [`unevaluatedItems`](./json-schema.md#unevaluateditems), [dynamic recursive references](./validation.md#extending-recursive-schemas) and other [additional keywords](./json-schema.md#json-schema-draft-2019-09).
- to reduce the mistakes in JSON schemas and unexpected validation results, [strict mode](./docs/strict-mode.md) is added - it prohibits ignored or ambiguous JSON Schema elements.
- to make code injection from untrusted schemas impossible, [code generation](./docs/codegen.md) is fully re-written to be safe and to allow code optimization (compiled schema code size is reduced by more than 10%).
- to simplify Ajv extensions, the new keyword API that is used by pre-defined keywords is available to user-defined keywords - it is much easier to define any keywords now, especially with subschemas. [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package was updated to use the new API (in [v4.0.0-beta.0](https://github.com/ajv-validator/ajv-keywords/releases/tag/v4.0.0-beta.0))
- schemas are compiled to ES6 code (ES5 code generation is also supported with an option).
- to improve reliability and maintainability the code is migrated to TypeScript.

**Please note**:

- the support for JSON-Schema draft-04 is removed - if you have schemas using "id" attributes you have to replace them with "\$id" (or continue using version 6 that will be supported until 02/28/2021).
- all formats are separated to ajv-formats package - they have to be explicitely added if you use them.

See [release notes](https://github.com/ajv-validator/ajv/releases/tag/v7.0.0-beta.0) for the details.

To install the new version:

```bash
npm install ajv@beta
```

See [Getting started with v7](https://github.com/ajv-validator/ajv/tree/v7-beta#usage) for code example.


## Mozilla MOSS grant and OpenJS Foundation

[<img src="https://www.poberezkin.com/images/mozilla.png" width="240" height="68">](https://www.mozilla.org/en-US/moss/) &nbsp;&nbsp;&nbsp; [<img src="https://www.poberezkin.com/images/openjs.png" width="220" height="68">](https://openjsf.org/blog/2020/08/14/ajv-joins-openjs-foundation-as-an-incubation-project/)

Ajv has been awarded a grant from Mozilla’s [Open Source Support (MOSS) program](https://www.mozilla.org/en-US/moss/) in the “Foundational Technology” track! It will sponsor the development of Ajv support of [JSON Schema version 2019-09](https://tools.ietf.org/html/draft-handrews-json-schema-02) and of [JSON Type Definition](https://tools.ietf.org/html/draft-ucarion-json-type-definition-04).

Ajv also joined [OpenJS Foundation](https://openjsf.org/) – having this support will help ensure the longevity and stability of Ajv for all its users.

This [blog post](https://www.poberezkin.com/posts/2020-08-14-ajv-json-validator-mozilla-open-source-grant-openjs-foundation.html) has more details.

I am looking for the long term maintainers of Ajv – working with [ReadySet](https://www.thereadyset.co/), also sponsored by Mozilla, to establish clear guidelines for the role of a "maintainer" and the contribution standards, and to encourage a wider, more inclusive, contribution from the community.


## Please [sponsor Ajv development](https://github.com/sponsors/epoberezkin)

Since I asked to support Ajv development 40 people and 6 organizations contributed via GitHub and OpenCollective - this support helped receiving the MOSS grant!

Your continuing support is very important - the funds will be used to develop and maintain Ajv once the next major version is released.

Please sponsor Ajv via:
- [GitHub sponsors page](https://github.com/sponsors/epoberezkin) (GitHub will match it)
- [Ajv Open Collective️](https://opencollective.com/ajv)

Thank you.


#### Open Collective sponsors

<a href="https://opencollective.com/ajv"><img src="https://opencollective.com/ajv/individuals.svg?width=890"></a>

<a href="https://opencollective.com/ajv/organization/0/website"><img src="https://opencollective.com/ajv/organization/0/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/1/website"><img src="https://opencollective.com/ajv/organization/1/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/2/website"><img src="https://opencollective.com/ajv/organization/2/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/3/website"><img src="https://opencollective.com/ajv/organization/3/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/4/website"><img src="https://opencollective.com/ajv/organization/4/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/5/website"><img src="https://opencollective.com/ajv/organization/5/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/6/website"><img src="https://opencollective.com/ajv/organization/6/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/7/website"><img src="https://opencollective.com/ajv/organization/7/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/8/website"><img src="https://opencollective.com/ajv/organization/8/avatar.svg"></a>
<a href="https://opencollective.com/ajv/organization/9/website"><img src="https://opencollective.com/ajv/organization/9/avatar.svg"></a>


## Using version 6

[JSON Schema draft-07](http://json-schema.org/latest/json-schema-validation.html) is published.

[Ajv version 6.0.0](https://github.com/ajv-validator/ajv/releases/tag/v6.0.0) that supports draft-07 is released. It may require either migrating your schemas or updating your code (to continue using draft-04 and v5 schemas, draft-06 schemas will be supported without changes).

__Please note__: To use Ajv with draft-06 schemas you need to explicitly add the meta-schema to the validator instance:

```javascript
ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-06.json'));
```

To use Ajv with draft-04 schemas in addition to explicitly adding meta-schema you also need to use option schemaId:

```javascript
var ajv = new Ajv({schemaId: 'id'});
// If you want to use both draft-04 and draft-06/07 schemas:
// var ajv = new Ajv({schemaId: 'auto'});
ajv.addMetaSchema(require('ajv/lib/refs/json-schema-draft-04.json'));
```


## Contents

- [Performance](#performance)
- [Features](#features)
- [Getting started](#getting-started)
- [Frequently Asked Questions](https://github.com/ajv-validator/ajv/blob/master/FAQ.md)
- [Using in browser](#using-in-browser)
  - [Ajv and Content Security Policies (CSP)](#ajv-and-content-security-policies-csp)
- [Command line interface](#command-line-interface)
- Validation
  - [Keywords](#validation-keywords)
  - [Annotation keywords](#annotation-keywords)
  - [Formats](#formats)
  - [Combining schemas with $ref](#ref)
  - [$data reference](#data-reference)
  - NEW: [$merge and $patch keywords](#merge-and-patch-keywords)
  - [Defining custom keywords](#defining-custom-keywords)
  - [Asynchronous schema compilation](#asynchronous-schema-compilation)
  - [Asynchronous validation](#asynchronous-validation)
- [Security considerations](#security-considerations)
  - [Security contact](#security-contact)
  - [Untrusted schemas](#untrusted-schemas)
  - [Circular references in objects](#circular-references-in-javascript-objects)
  - [Trusted schemas](#security-risks-of-trusted-schemas)
  - [ReDoS attack](#redos-attack)
- Modifying data during validation
  - [Filtering data](#filtering-data)
  - [Assigning defaults](#assigning-defaults)
  - [Coercing data types](#coercing-data-types)
- API
  - [Methods](#api)
  - [Options](#options)
  - [Validation errors](#validation-errors)
- [Plugins](#plugins)
- [Related packages](#related-packages)
- [Some packages using Ajv](#some-packages-using-ajv)
- [Tests, Contributing, Changes history](#tests)
- [Support, Code of conduct, License](#open-source-software-support)


## Performance

Ajv generates code using [doT templates](https://github.com/olado/doT) to turn JSON Schemas into super-fast validation functions that are efficient for v8 optimization.

Currently Ajv is the fastest and the most standard compliant validator according to these benchmarks:

- [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark) - 50% faster than the second place
- [jsck benchmark](https://github.com/pandastrike/jsck#benchmarks) - 20-190% faster
- [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html)
- [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html)


Performance of different validators by [json-schema-benchmark](https://github.com/ebdrup/json-schema-benchmark):

[![performance](https://chart.googleapis.com/chart?chxt=x,y&cht=bhs&chco=76A4FB&chls=2.0&chbh=32,4,1&chs=600x416&chxl=-1:|djv|ajv|json-schema-validator-generator|jsen|is-my-json-valid|themis|z-schema|jsck|skeemas|json-schema-library|tv4&chd=t:100,98,72.1,66.8,50.1,15.1,6.1,3.8,1.2,0.7,0.2)](https://github.com/ebdrup/json-schema-benchmark/blob/master/README.md#performance)


## Features

- Ajv implements full JSON Schema [draft-06/07](http://json-schema.org/) and draft-04 standards:
  - all validation keywords (see [JSON Schema validation keywords](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md))
  - full support of remote refs (remote schemas have to be added with `addSchema` or compiled to be available)
  - support of circular references between schemas
  - correct string lengths for strings with unicode pairs (can be turned off)
  - [formats](#formats) defined by JSON Schema draft-07 standard and custom formats (can be turned off)
  - [validates schemas against meta-schema](#api-validateschema)
- supports [browsers](#using-in-browser) and Node.js 0.10-14.x
- [asynchronous loading](#asynchronous-schema-compilation) of referenced schemas during compilation
- "All errors" validation mode with [option allErrors](#options)
- [error messages with parameters](#validation-errors) describing error reasons to allow creating custom error messages
- i18n error messages support with [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) package
- [filtering data](#filtering-data) from additional properties
- [assigning defaults](#assigning-defaults) to missing properties and items
- [coercing data](#coercing-data-types) to the types specified in `type` keywords
- [custom keywords](#defining-custom-keywords)
- draft-06/07 keywords `const`, `contains`, `propertyNames` and `if/then/else`
- draft-06 boolean schemas (`true`/`false` as a schema to always pass/fail).
- keywords `switch`, `patternRequired`, `formatMaximum` / `formatMinimum` and `formatExclusiveMaximum` / `formatExclusiveMinimum` from [JSON Schema extension proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) with [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package
- [$data reference](#data-reference) to use values from the validated data as values for the schema keywords
- [asynchronous validation](#asynchronous-validation) of custom formats and keywords


## Install

```
npm install ajv
```


## <a name="usage"></a>Getting started

Try it in the Node.js REPL: https://tonicdev.com/npm/ajv


The fastest validation call:

```javascript
// Node.js require:
var Ajv = require('ajv');
// or ESM/TypeScript import
import Ajv from 'ajv';

var ajv = new Ajv(); // options can be passed, e.g. {allErrors: true}
var validate = ajv.compile(schema);
var valid = validate(data);
if (!valid) console.log(validate.errors);
```

or with less code

```javascript
// ...
var valid = ajv.validate(schema, data);
if (!valid) console.log(ajv.errors);
// ...
```

or

```javascript
// ...
var valid = ajv.addSchema(schema, 'mySchema')
               .validate('mySchema', data);
if (!valid) console.log(ajv.errorsText());
// ...
```

See [API](#api) and [Options](#options) for more details.

Ajv compiles schemas to functions and caches them in all cases (using schema serialized with [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) or a custom function as a key), so that the next time the same schema is used (not necessarily the same object instance) it won't be compiled again.

The best performance is achieved when using compiled functions returned by `compile` or `getSchema` methods (there is no additional function call).

__Please note__: every time a validation function or `ajv.validate` are called `errors` property is overwritten. You need to copy `errors` array reference to another variable if you want to use it later (e.g., in the callback). See [Validation errors](#validation-errors)

__Note for TypeScript users__: `ajv` provides its own TypeScript declarations
out of the box, so you don't need to install the deprecated `@types/ajv`
module.


## Using in browser

You can require Ajv directly from the code you browserify - in this case Ajv will be a part of your bundle.

If you need to use Ajv in several bundles you can create a separate UMD bundle using `npm run bundle` script (thanks to [siddo420](https://github.com/siddo420)).

Then you need to load Ajv in the browser:
```html
<script src="ajv.min.js"></script>
```

This bundle can be used with different module systems; it creates global `Ajv` if no module system is found.

The browser bundle is available on [cdnjs](https://cdnjs.com/libraries/ajv).

Ajv is tested with these browsers:

[![Sauce Test Status](https://saucelabs.com/browser-matrix/epoberezkin.svg)](https://saucelabs.com/u/epoberezkin)

__Please note__: some frameworks, e.g. Dojo, may redefine global require in such way that is not compatible with CommonJS module format. In such case Ajv bundle has to be loaded before the framework and then you can use global Ajv (see issue [#234](https://github.com/ajv-validator/ajv/issues/234)).


### Ajv and Content Security Policies (CSP)

If you're using Ajv to compile a schema (the typical use) in a browser document that is loaded with a Content Security Policy (CSP), that policy will require a `script-src` directive that includes the value `'unsafe-eval'`.
:warning: NOTE, however, that `unsafe-eval` is NOT recommended in a secure CSP[[1]](https://developer.chrome.com/extensions/contentSecurityPolicy#relaxing-eval), as it has the potential to open the document to cross-site scripting (XSS) attacks.

In order to make use of Ajv without easing your CSP, you can [pre-compile a schema using the CLI](https://github.com/ajv-validator/ajv-cli#compile-schemas). This will transpile the schema JSON into a JavaScript file that exports a `validate` function that works simlarly to a schema compiled at runtime.

Note that pre-compilation of schemas is performed using [ajv-pack](https://github.com/ajv-validator/ajv-pack) and there are [some limitations to the schema features it can compile](https://github.com/ajv-validator/ajv-pack#limitations). A successfully pre-compiled schema is equivalent to the same schema compiled at runtime.


## Command line interface

CLI is available as a separate npm package [ajv-cli](https://github.com/ajv-validator/ajv-cli). It supports:

- compiling JSON Schemas to test their validity
- BETA: generating standalone module exporting a validation function to be used without Ajv (using [ajv-pack](https://github.com/ajv-validator/ajv-pack))
- migrate schemas to draft-07 (using [json-schema-migrate](https://github.com/epoberezkin/json-schema-migrate))
- validating data file(s) against JSON Schema
- testing expected validity of data against JSON Schema
- referenced schemas
- custom meta-schemas
- files in JSON, JSON5, YAML, and JavaScript format
- all Ajv options
- reporting changes in data after validation in [JSON-patch](https://tools.ietf.org/html/rfc6902) format


## Validation keywords

Ajv supports all validation keywords from draft-07 of JSON Schema standard:

- [type](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#type)
- [for numbers](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-numbers) - maximum, minimum, exclusiveMaximum, exclusiveMinimum, multipleOf
- [for strings](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-strings) - maxLength, minLength, pattern, format
- [for arrays](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-arrays) - maxItems, minItems, uniqueItems, items, additionalItems, [contains](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#contains)
- [for objects](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-objects) - maxProperties, minProperties, required, properties, patternProperties, additionalProperties, dependencies, [propertyNames](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#propertynames)
- [for all types](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#keywords-for-all-types) - enum, [const](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#const)
- [compound keywords](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#compound-keywords) - not, oneOf, anyOf, allOf, [if/then/else](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#ifthenelse)

With [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package Ajv also supports validation keywords from [JSON Schema extension proposals](https://github.com/json-schema/json-schema/wiki/v5-Proposals) for JSON Schema standard:

- [patternRequired](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#patternrequired-proposed) - like `required` but with patterns that some property should match.
- [formatMaximum, formatMinimum, formatExclusiveMaximum, formatExclusiveMinimum](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md#formatmaximum--formatminimum-and-exclusiveformatmaximum--exclusiveformatminimum-proposed) - setting limits for date, time, etc.

See [JSON Schema validation keywords](https://github.com/ajv-validator/ajv/blob/master/KEYWORDS.md) for more details.


## Annotation keywords

JSON Schema specification defines several annotation keywords that describe schema itself but do not perform any validation.

- `title` and `description`: information about the data represented by that schema
- `$comment` (NEW in draft-07): information for developers. With option `$comment` Ajv logs or passes the comment string to the user-supplied function. See [Options](#options).
- `default`: a default value of the data instance, see [Assigning defaults](#assigning-defaults).
- `examples` (NEW in draft-06): an array of data instances. Ajv does not check the validity of these instances against the schema.
- `readOnly` and `writeOnly` (NEW in draft-07): marks data-instance as read-only or write-only in relation to the source of the data (database, api, etc.).
- `contentEncoding`: [RFC 2045](https://tools.ietf.org/html/rfc2045#section-6.1 ), e.g., "base64".
- `contentMediaType`: [RFC 2046](https://tools.ietf.org/html/rfc2046), e.g., "image/png".

__Please note__:  Ajv does not implement validation of the keywords `examples`, `contentEncoding` and `contentMediaType` but it reserves them. If you want to create a plugin that implements some of them, it should remove these keywords from the instance.


## Formats

Ajv implements formats defined by JSON Schema specification and several other formats. It is recommended NOT to use "format" keyword implementations with untrusted data, as they use potentially unsafe regular expressions - see [ReDoS attack](#redos-attack).

__Please note__: if you need to use "format" keyword to validate untrusted data, you MUST assess their suitability and safety for your validation scenarios.

The following formats are implemented for string validation with "format" keyword:

- _date_: full-date according to [RFC3339](http://tools.ietf.org/html/rfc3339#section-5.6).
- _time_: time with optional time-zone.
- _date-time_: date-time from the same source (time-zone is mandatory). `date`, `time` and `date-time` validate ranges in `full` mode and only regexp in `fast` mode (see [options](#options)).
- _uri_: full URI.
- _uri-reference_: URI reference, including full and relative URIs.
- _uri-template_: URI template according to [RFC6570](https://tools.ietf.org/html/rfc6570)
- _url_ (deprecated): [URL record](https://url.spec.whatwg.org/#concept-url).
- _email_: email address.
- _hostname_: host name according to [RFC1034](http://tools.ietf.org/html/rfc1034#section-3.5).
- _ipv4_: IP address v4.
- _ipv6_: IP address v6.
- _regex_: tests whether a string is a valid regular expression by passing it to RegExp constructor.
- _uuid_: Universally Unique IDentifier according to [RFC4122](http://tools.ietf.org/html/rfc4122).
- _json-pointer_: JSON-pointer according to [RFC6901](https://tools.ietf.org/html/rfc6901).
- _relative-json-pointer_: relative JSON-pointer according to [this draft](http://tools.ietf.org/html/draft-luff-relative-json-pointer-00).

__Please note__: JSON Schema draft-07 also defines formats `iri`, `iri-reference`, `idn-hostname` and `idn-email` for URLs, hostnames and emails with international characters. Ajv does not implement these formats. If you create Ajv plugin that implements them please make a PR to mention this plugin here.

There are two modes of format validation: `fast` and `full`. This mode affects formats `date`, `time`, `date-time`, `uri`, `uri-reference`, and `email`. See [Options](#options) for details.

You can add additional formats and replace any of the formats above using [addFormat](#api-addformat) method.

The option `unknownFormats` allows changing the default behaviour when an unknown format is encountered. In this case Ajv can either fail schema compilation (default) or ignore it (default in versions before 5.0.0). You also can allow specific format(s) that will be ignored. See [Options](#options) for details.

You can find regular expressions used for format validation and the sources that were used in [formats.js](https://github.com/ajv-validator/ajv/blob/master/lib/compile/formats.js).


## <a name="ref"></a>Combining schemas with $ref

You can structure your validation logic across multiple schema files and have schemas reference each other using `$ref` keyword.

Example:

```javascript
var schema = {
  "$id": "http://example.com/schemas/schema.json",
  "type": "object",
  "properties": {
    "foo": { "$ref": "defs.json#/definitions/int" },
    "bar": { "$ref": "defs.json#/definitions/str" }
  }
};

var defsSchema = {
  "$id": "http://example.com/schemas/defs.json",
  "definitions": {
    "int": { "type": "integer" },
    "str": { "type": "string" }
  }
};
```

Now to compile your schema you can either pass all schemas to Ajv instance:

```javascript
var ajv = new Ajv({schemas: [schema, defsSchema]});
var validate = ajv.getSchema('http://example.com/schemas/schema.json');
```

or use `addSchema` method:

```javascript
var ajv = new Ajv;
var validate = ajv.addSchema(defsSchema)
                  .compile(schema);
```

See [Options](#options) and [addSchema](#api) method.

__Please note__:
- `$ref` is resolved as the uri-reference using schema $id as the base URI (see the example).
- References can be recursive (and mutually recursive) to implement the schemas for different data structures (such as linked lists, trees, graphs, etc.).
- You don't have to host your schema files at the URIs that you use as schema $id. These URIs are only used to identify the schemas, and according to JSON Schema specification validators should not expect to be able to download the schemas from these URIs.
- The actual location of the schema file in the file system is not used.
- You can pass the identifier of the schema as the second parameter of `addSchema` method or as a property name in `schemas` option. This identifier can be used instead of (or in addition to) schema $id.
- You cannot have the same $id (or the schema identifier) used for more than one schema - the exception will be thrown.
- You can implement dynamic resolution of the referenced schemas using `compileAsync` method. In this way you can store schemas in any system (files, web, database, etc.) and reference them without explicitly adding to Ajv instance. See [Asynchronous schema compilation](#asynchronous-schema-compilation).


## $data reference

With `$data` option you can use values from the validated data as the values for the schema keywords. See [proposal](https://github.com/json-schema-org/json-schema-spec/issues/51) for more information about how it works.

`$data` reference is supported in the keywords: const, enum, format, maximum/minimum, exclusiveMaximum / exclusiveMinimum, maxLength / minLength, maxItems / minItems, maxProperties / minProperties, formatMaximum / formatMinimum, formatExclusiveMaximum / formatExclusiveMinimum, multipleOf, pattern, required, uniqueItems.

The value of "$data" should be a [JSON-pointer](https://tools.ietf.org/html/rfc6901) to the data (the root is always the top level data object, even if the $data reference is inside a referenced subschema) or a [relative JSON-pointer](http://tools.ietf.org/html/draft-luff-relative-json-pointer-00) (it is relative to the current point in data; if the $data reference is inside a referenced subschema it cannot point to the data outside of the root level for this subschema).

Examples.

This schema requires that the value in property `smaller` is less or equal than the value in the property larger:

```javascript
var ajv = new Ajv({$data: true});

var schema = {
  "properties": {
    "smaller": {
      "type": "number",
      "maximum": { "$data": "1/larger" }
    },
    "larger": { "type": "number" }
  }
};

var validData = {
  smaller: 5,
  larger: 7
};

ajv.validate(schema, validData); // true
```

This schema requires that the properties have the same format as their field names:

```javascript
var schema = {
  "additionalProperties": {
    "type": "string",
    "format": { "$data": "0#" }
  }
};

var validData = {
  'date-time': '1963-06-19T08:30:06.283185Z',
  email: 'joe.bloggs@example.com'
}
```

`$data` reference is resolved safely - it won't throw even if some property is undefined. If `$data` resolves to `undefined` the validation succeeds (with the exclusion of `const` keyword). If `$data` resolves to incorrect type (e.g. not "number" for maximum keyword) the validation fails.


## $merge and $patch keywords

With the package [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) you can use the keywords `$merge` and `$patch` that allow extending JSON Schemas with patches using formats [JSON Merge Patch (RFC 7396)](https://tools.ietf.org/html/rfc7396) and [JSON Patch (RFC 6902)](https://tools.ietf.org/html/rfc6902).

To add keywords `$merge` and `$patch` to Ajv instance use this code:

```javascript
require('ajv-merge-patch')(ajv);
```

Examples.

Using `$merge`:

```json
{
  "$merge": {
    "source": {
      "type": "object",
      "properties": { "p": { "type": "string" } },
      "additionalProperties": false
    },
    "with": {
      "properties": { "q": { "type": "number" } }
    }
  }
}
```

Using `$patch`:

```json
{
  "$patch": {
    "source": {
      "type": "object",
      "properties": { "p": { "type": "string" } },
      "additionalProperties": false
    },
    "with": [
      { "op": "add", "path": "/properties/q", "value": { "type": "number" } }
    ]
  }
}
```

The schemas above are equivalent to this schema:

```json
{
  "type": "object",
  "properties": {
    "p": { "type": "string" },
    "q": { "type": "number" }
  },
  "additionalProperties": false
}
```

The properties `source` and `with` in the keywords `$merge` and `$patch` can use absolute or relative `$ref` to point to other schemas previously added to the Ajv instance or to the fragments of the current schema.

See the package [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) for more information.


## Defining custom keywords

The advantages of using custom keywords are:

- allow creating validation scenarios that cannot be expressed using JSON Schema
- simplify your schemas
- help bringing a bigger part of the validation logic to your schemas
- make your schemas more expressive, less verbose and closer to your application domain
- implement custom data processors that modify your data (`modifying` option MUST be used in keyword definition) and/or create side effects while the data is being validated

If a keyword is used only for side-effects and its validation result is pre-defined, use option `valid: true/false` in keyword definition to simplify both generated code (no error handling in case of `valid: true`) and your keyword functions (no need to return any validation result).

The concerns you have to be aware of when extending JSON Schema standard with custom keywords are the portability and understanding of your schemas. You will have to support these custom keywords on other platforms and to properly document these keywords so that everybody can understand them in your schemas.

You can define custom keywords with [addKeyword](#api-addkeyword) method. Keywords are defined on the `ajv` instance level - new instances will not have previously defined keywords.

Ajv allows defining keywords with:
- validation function
- compilation function
- macro function
- inline compilation function that should return code (as string) that will be inlined in the currently compiled schema.

Example. `range` and `exclusiveRange` keywords using compiled schema:

```javascript
ajv.addKeyword('range', {
  type: 'number',
  compile: function (sch, parentSchema) {
    var min = sch[0];
    var max = sch[1];

    return parentSchema.exclusiveRange === true
            ? function (data) { return data > min && data < max; }
            : function (data) { return data >= min && data <= max; }
  }
});

var schema = { "range": [2, 4], "exclusiveRange": true };
var validate = ajv.compile(schema);
console.log(validate(2.01)); // true
console.log(validate(3.99)); // true
console.log(validate(2)); // false
console.log(validate(4)); // false
```

Several custom keywords (typeof, instanceof, range and propertyNames) are defined in [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package - they can be used for your schemas and as a starting point for your own custom keywords.

See [Defining custom keywords](https://github.com/ajv-validator/ajv/blob/master/CUSTOM.md) for more details.


## Asynchronous schema compilation

During asynchronous compilation remote references are loaded using supplied function. See `compileAsync` [method](#api-compileAsync) and `loadSchema` [option](#options).

Example:

```javascript
var ajv = new Ajv({ loadSchema: loadSchema });

ajv.compileAsync(schema).then(function (validate) {
  var valid = validate(data);
  // ...
});

function loadSchema(uri) {
  return request.json(uri).then(function (res) {
    if (res.statusCode >= 400)
      throw new Error('Loading error: ' + res.statusCode);
    return res.body;
  });
}
```

__Please note__: [Option](#options) `missingRefs` should NOT be set to `"ignore"` or `"fail"` for asynchronous compilation to work.


## Asynchronous validation

Example in Node.js REPL: https://tonicdev.com/esp/ajv-asynchronous-validation

You can define custom formats and keywords that perform validation asynchronously by accessing database or some other service. You should add `async: true` in the keyword or format definition (see [addFormat](#api-addformat), [addKeyword](#api-addkeyword) and [Defining custom keywords](#defining-custom-keywords)).

If your schema uses asynchronous formats/keywords or refers to some schema that contains them it should have `"$async": true` keyword so that Ajv can compile it correctly. If asynchronous format/keyword or reference to asynchronous schema is used in the schema without `$async` keyword Ajv will throw an exception during schema compilation.

__Please note__: all asynchronous subschemas that are referenced from the current or other schemas should have `"$async": true` keyword as well, otherwise the schema compilation will fail.

Validation function for an asynchronous custom format/keyword should return a promise that resolves with `true` or `false` (or rejects with `new Ajv.ValidationError(errors)` if you want to return custom errors from the keyword function).

Ajv compiles asynchronous schemas to [es7 async functions](http://tc39.github.io/ecmascript-asyncawait/) that can optionally be transpiled with [nodent](https://github.com/MatAtBread/nodent). Async functions are supported in Node.js 7+ and all modern browsers. You can also supply any other transpiler as a function via `processCode` option. See [Options](#options).

The compiled validation function has `$async: true` property (if the schema is asynchronous), so you can differentiate these functions if you are using both synchronous and asynchronous schemas.

Validation result will be a promise that resolves with validated data or rejects with an exception `Ajv.ValidationError` that contains the array of validation errors in `errors` property.


Example:

```javascript
var ajv = new Ajv;
// require('ajv-async')(ajv);

ajv.addKeyword('idExists', {
  async: true,
  type: 'number',
  validate: checkIdExists
});


function checkIdExists(schema, data) {
  return knex(schema.table)
  .select('id')
  .where('id', data)
  .then(function (rows) {
    return !!rows.length; // true if record is found
  });
}

var schema = {
  "$async": true,
  "properties": {
    "userId": {
      "type": "integer",
      "idExists": { "table": "users" }
    },
    "postId": {
      "type": "integer",
      "idExists": { "table": "posts" }
    }
  }
};

var validate = ajv.compile(schema);

validate({ userId: 1, postId: 19 })
.then(function (data) {
  console.log('Data is valid', data); // { userId: 1, postId: 19 }
})
.catch(function (err) {
  if (!(err instanceof Ajv.ValidationError)) throw err;
  // data is invalid
  console.log('Validation errors:', err.errors);
});
```

### Using transpilers with asynchronous validation functions.

[ajv-async](https://github.com/ajv-validator/ajv-async) uses [nodent](https://github.com/MatAtBread/nodent) to transpile async functions. To use another transpiler you should separately install it (or load its bundle in the browser).


#### Using nodent

```javascript
var ajv = new Ajv;
require('ajv-async')(ajv);
// in the browser if you want to load ajv-async bundle separately you can:
// window.ajvAsync(ajv);
var validate = ajv.compile(schema); // transpiled es7 async function
validate(data).then(successFunc).catch(errorFunc);
```


#### Using other transpilers

```javascript
var ajv = new Ajv({ processCode: transpileFunc });
var validate = ajv.compile(schema); // transpiled es7 async function
validate(data).then(successFunc).catch(errorFunc);
```

See [Options](#options).


## Security considerations

JSON Schema, if properly used, can replace data sanitisation. It doesn't replace other API security considerations. It also introduces additional security aspects to consider.


##### Security contact

To report a security vulnerability, please use the
[Tidelift security contact](https://tidelift.com/security).
Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerabilities via GitHub issues.


##### Untrusted schemas

Ajv treats JSON schemas as trusted as your application code. This security model is based on the most common use case, when the schemas are static and bundled together with the application.

If your schemas are received from untrusted sources (or generated from untrusted data) there are several scenarios you need to prevent:
- compiling schemas can cause stack overflow (if they are too deep)
- compiling schemas can be slow (e.g. [#557](https://github.com/ajv-validator/ajv/issues/557))
- validating certain data can be slow

It is difficult to predict all the scenarios, but at the very least it may help to limit the size of untrusted schemas (e.g. limit JSON string length) and also the maximum schema object depth (that can be high for relatively small JSON strings). You also may want to mitigate slow regular expressions in `pattern` and `patternProperties` keywords.

Regardless the measures you take, using untrusted schemas increases security risks.


##### Circular references in JavaScript objects

Ajv does not support schemas and validated data that have circular references in objects. See [issue #802](https://github.com/ajv-validator/ajv/issues/802).

An attempt to compile such schemas or validate such data would cause stack overflow (or will not complete in case of asynchronous validation). Depending on the parser you use, untrusted data can lead to circular references.


##### Security risks of trusted schemas

Some keywords in JSON Schemas can lead to very slow validation for certain data. These keywords include (but may be not limited to):

- `pattern` and `format` for large strings - in some cases using `maxLength` can help mitigate it, but certain regular expressions can lead to exponential validation time even with relatively short strings (see [ReDoS attack](#redos-attack)).
- `patternProperties` for large property names - use `propertyNames` to mitigate, but some regular expressions can have exponential evaluation time as well.
- `uniqueItems` for large non-scalar arrays - use `maxItems` to mitigate

__Please note__: The suggestions above to prevent slow validation would only work if you do NOT use `allErrors: true` in production code (using it would continue validation after validation errors).

You can validate your JSON schemas against [this meta-schema](https://github.com/ajv-validator/ajv/blob/master/lib/refs/json-schema-secure.json) to check that these recommendations are followed:

```javascript
const isSchemaSecure = ajv.compile(require('ajv/lib/refs/json-schema-secure.json'));

const schema1 = {format: 'email'};
isSchemaSecure(schema1); // false

const schema2 = {format: 'email', maxLength: MAX_LENGTH};
isSchemaSecure(schema2); // true
```

__Please note__: following all these recommendation is not a guarantee that validation of untrusted data is safe - it can still lead to some undesirable results.


##### Content Security Policies (CSP)
See [Ajv and Content Security Policies (CSP)](#ajv-and-content-security-policies-csp)


## ReDoS attack

Certain regular expressions can lead to the exponential evaluation time even with relatively short strings.

Please assess the regular expressions you use in the schemas on their vulnerability to this attack - see [safe-regex](https://github.com/substack/safe-regex), for example.

__Please note__: some formats that Ajv implements use [regular expressions](https://github.com/ajv-validator/ajv/blob/master/lib/compile/formats.js) that can be vulnerable to ReDoS attack, so if you use Ajv to validate data from untrusted sources __it is strongly recommended__ to consider the following:

- making assessment of "format" implementations in Ajv.
- using `format: 'fast'` option that simplifies some of the regular expressions (although it does not guarantee that they are safe).
- replacing format implementations provided by Ajv with your own implementations of "format" keyword that either uses different regular expressions or another approach to format validation. Please see [addFormat](#api-addformat) method.
- disabling format validation by ignoring "format" keyword with option `format: false`

Whatever mitigation you choose, please assume all formats provided by Ajv as potentially unsafe and make your own assessment of their suitability for your validation scenarios.


## Filtering data

With [option `removeAdditional`](#options) (added by [andyscott](https://github.com/andyscott)) you can filter data during the validation.

This option modifies original data.

Example:

```javascript
var ajv = new Ajv({ removeAdditional: true });
var schema = {
  "additionalProperties": false,
  "properties": {
    "foo": { "type": "number" },
    "bar": {
      "additionalProperties": { "type": "number" },
      "properties": {
        "baz": { "type": "string" }
      }
    }
  }
}

var data = {
  "foo": 0,
  "additional1": 1, // will be removed; `additionalProperties` == false
  "bar": {
    "baz": "abc",
    "additional2": 2 // will NOT be removed; `additionalProperties` != false
  },
}

var validate = ajv.compile(schema);

console.log(validate(data)); // true
console.log(data); // { "foo": 0, "bar": { "baz": "abc", "additional2": 2 }
```

If `removeAdditional` option in the example above were `"all"` then both `additional1` and `additional2` properties would have been removed.

If the option were `"failing"` then property `additional1` would have been removed regardless of its value and property `additional2` would have been removed only if its value were failing the schema in the inner `additionalProperties` (so in the example above it would have stayed because it passes the schema, but any non-number would have been removed).

__Please note__: If you use `removeAdditional` option with `additionalProperties` keyword inside `anyOf`/`oneOf` keywords your validation can fail with this schema, for example:

```json
{
  "type": "object",
  "oneOf": [
    {
      "properties": {
        "foo": { "type": "string" }
      },
      "required": [ "foo" ],
      "additionalProperties": false
    },
    {
      "properties": {
        "bar": { "type": "integer" }
      },
      "required": [ "bar" ],
      "additionalProperties": false
    }
  ]
}
```

The intention of the schema above is to allow objects with either the string property "foo" or the integer property "bar", but not with both and not with any other properties.

With the option `removeAdditional: true` the validation will pass for the object `{ "foo": "abc"}` but will fail for the object `{"bar": 1}`. It happens because while the first subschema in `oneOf` is validated, the property `bar` is removed because it is an additional property according to the standard (because it is not included in `properties` keyword in the same schema).

While this behaviour is unexpected (issues [#129](https://github.com/ajv-validator/ajv/issues/129), [#134](https://github.com/ajv-validator/ajv/issues/134)), it is correct. To have the expected behaviour (both objects are allowed and additional properties are removed) the schema has to be refactored in this way:

```json
{
  "type": "object",
  "properties": {
    "foo": { "type": "string" },
    "bar": { "type": "integer" }
  },
  "additionalProperties": false,
  "oneOf": [
    { "required": [ "foo" ] },
    { "required": [ "bar" ] }
  ]
}
```

The schema above is also more efficient - it will compile into a faster function.


## Assigning defaults

With [option `useDefaults`](#options) Ajv will assign values from `default` keyword in the schemas of `properties` and `items` (when it is the array of schemas) to the missing properties and items.

With the option value `"empty"` properties and items equal to `null` or `""` (empty string) will be considered missing and assigned defaults.

This option modifies original data.

__Please note__: the default value is inserted in the generated validation code as a literal, so the value inserted in the data will be the deep clone of the default in the schema.


Example 1 (`default` in `properties`):

```javascript
var ajv = new Ajv({ useDefaults: true });
var schema = {
  "type": "object",
  "properties": {
    "foo": { "type": "number" },
    "bar": { "type": "string", "default": "baz" }
  },
  "required": [ "foo", "bar" ]
};

var data = { "foo": 1 };

var validate = ajv.compile(schema);

console.log(validate(data)); // true
console.log(data); // { "foo": 1, "bar": "baz" }
```

Example 2 (`default` in `items`):

```javascript
var schema = {
  "type": "array",
  "items": [
    { "type": "number" },
    { "type": "string", "default": "foo" }
  ]
}

var data = [ 1 ];

var validate = ajv.compile(schema);

console.log(validate(data)); // true
console.log(data); // [ 1, "foo" ]
```

`default` keywords in other cases are ignored:

- not in `properties` or `items` subschemas
- in schemas inside `anyOf`, `oneOf` and `not` (see [#42](https://github.com/ajv-validator/ajv/issues/42))
- in `if` subschema of `switch` keyword
- in schemas generated by custom macro keywords

The [`strictDefaults` option](#options) customizes Ajv's behavior for the defaults that Ajv ignores (`true` raises an error, and `"log"` outputs a warning).


## Coercing data types

When you are validating user inputs all your data properties are usually strings. The option `coerceTypes` allows you to have your data types coerced to the types specified in your schema `type` keywords, both to pass the validation and to use the correctly typed data afterwards.

This option modifies original data.

__Please note__: if you pass a scalar value to the validating function its type will be coerced and it will pass the validation, but the value of the variable you pass won't be updated because scalars are passed by value.


Example 1:

```javascript
var ajv = new Ajv({ coerceTypes: true });
var schema = {
  "type": "object",
  "properties": {
    "foo": { "type": "number" },
    "bar": { "type": "boolean" }
  },
  "required": [ "foo", "bar" ]
};

var data = { "foo": "1", "bar": "false" };

var validate = ajv.compile(schema);

console.log(validate(data)); // true
console.log(data); // { "foo": 1, "bar": false }
```

Example 2 (array coercions):

```javascript
var ajv = new Ajv({ coerceTypes: 'array' });
var schema = {
  "properties": {
    "foo": { "type": "array", "items": { "type": "number" } },
    "bar": { "type": "boolean" }
  }
};

var data = { "foo": "1", "bar": ["false"] };

var validate = ajv.compile(schema);

console.log(validate(data)); // true
console.log(data); // { "foo": [1], "bar": false }
```

The coercion rules, as you can see from the example, are different from JavaScript both to validate user input as expected and to have the coercion reversible (to correctly validate cases where different types are defined in subschemas of "anyOf" and other compound keywords).

See [Coercion rules](https://github.com/ajv-validator/ajv/blob/master/COERCION.md) for details.


## API

##### new Ajv(Object options) -&gt; Object

Create Ajv instance.


##### .compile(Object schema) -&gt; Function&lt;Object data&gt;

Generate validating function and cache the compiled schema for future use.

Validating function returns a boolean value. This function has properties `errors` and `schema`. Errors encountered during the last validation are assigned to `errors` property (it is assigned `null` if there was no errors). `schema` property contains the reference to the original schema.

The schema passed to this method will be validated against meta-schema unless `validateSchema` option is false. If schema is invalid, an error will be thrown. See [options](#options).


##### <a name="api-compileAsync"></a>.compileAsync(Object schema [, Boolean meta] [, Function callback]) -&gt; Promise

Asynchronous version of `compile` method that loads missing remote schemas using asynchronous function in `options.loadSchema`. This function returns a Promise that resolves to a validation function. An optional callback passed to `compileAsync` will be called with 2 parameters: error (or null) and validating function. The returned promise will reject (and the callback will be called with an error) when:

- missing schema can't be loaded (`loadSchema` returns a Promise that rejects).
- a schema containing a missing reference is loaded, but the reference cannot be resolved.
- schema (or some loaded/referenced schema) is invalid.

The function compiles schema and loads the first missing schema (or meta-schema) until all missing schemas are loaded.

You can asynchronously compile meta-schema by passing `true` as the second parameter.

See example in [Asynchronous compilation](#asynchronous-schema-compilation).


##### .validate(Object schema|String key|String ref, data) -&gt; Boolean

Validate data using passed schema (it will be compiled and cached).

Instead of the schema you can use the key that was previously passed to `addSchema`, the schema id if it was present in the schema or any previously resolved reference.

Validation errors will be available in the `errors` property of Ajv instance (`null` if there were no errors).

__Please note__: every time this method is called the errors are overwritten so you need to copy them to another variable if you want to use them later.

If the schema is asynchronous (has `$async` keyword on the top level) this method returns a Promise. See [Asynchronous validation](#asynchronous-validation).


##### .addSchema(Array&lt;Object&gt;|Object schema [, String key]) -&gt; Ajv

Add schema(s) to validator instance. This method does not compile schemas (but it still validates them). Because of that dependencies can be added in any order and circular dependencies are supported. It also prevents unnecessary compilation of schemas that are containers for other schemas but not used as a whole.

Array of schemas can be passed (schemas should have ids), the second parameter will be ignored.

Key can be passed that can be used to reference the schema and will be used as the schema id if there is no id inside the schema. If the key is not passed, the schema id will be used as the key.


Once the schema is added, it (and all the references inside it) can be referenced in other schemas and used to validate data.

Although `addSchema` does not compile schemas, explicit compilation is not required - the schema will be compiled when it is used first time.

By default the schema is validated against meta-schema before it is added, and if the schema does not pass validation the exception is thrown. This behaviour is controlled by `validateSchema` option.

__Please note__: Ajv uses the [method chaining syntax](https://en.wikipedia.org/wiki/Method_chaining) for all methods with the prefix `add*` and `remove*`.
This allows you to do nice things like the following.

```javascript
var validate = new Ajv().addSchema(schema).addFormat(name, regex).getSchema(uri);
```

##### .addMetaSchema(Array&lt;Object&gt;|Object schema [, String key]) -&gt; Ajv

Adds meta schema(s) that can be used to validate other schemas. That function should be used instead of `addSchema` because there may be instance options that would compile a meta schema incorrectly (at the moment it is `removeAdditional` option).

There is no need to explicitly add draft-07 meta schema (http://json-schema.org/draft-07/schema) - it is added by default, unless option `meta` is set to `false`. You only need to use it if you have a changed meta-schema that you want to use to validate your schemas. See `validateSchema`.


##### <a name="api-validateschema"></a>.validateSchema(Object schema) -&gt; Boolean

Validates schema. This method should be used to validate schemas rather than `validate` due to the inconsistency of `uri` format in JSON Schema standard.

By default this method is called automatically when the schema is added, so you rarely need to use it directly.

If schema doesn't have `$schema` property, it is validated against draft 6 meta-schema (option `meta` should not be false).

If schema has `$schema` property, then the schema with this id (that should be previously added) is used to validate passed schema.

Errors will be available at `ajv.errors`.


##### .getSchema(String key) -&gt; Function&lt;Object data&gt;

Retrieve compiled schema previously added with `addSchema` by the key passed to `addSchema` or by its full reference (id). The returned validating function has `schema` property with the reference to the original schema.


##### .removeSchema([Object schema|String key|String ref|RegExp pattern]) -&gt; Ajv

Remove added/cached schema. Even if schema is referenced by other schemas it can be safely removed as dependent schemas have local references.

Schema can be removed using:
- key passed to `addSchema`
- it's full reference (id)
- RegExp that should match schema id or key (meta-schemas won't be removed)
- actual schema object that will be stable-stringified to remove schema from cache

If no parameter is passed all schemas but meta-schemas will be removed and the cache will be cleared.


##### <a name="api-addformat"></a>.addFormat(String name, String|RegExp|Function|Object format) -&gt; Ajv

Add custom format to validate strings or numbers. It can also be used to replace pre-defined formats for Ajv instance.

Strings are converted to RegExp.

Function should return validation result as `true` or `false`.

If object is passed it should have properties `validate`, `compare` and `async`:

- _validate_: a string, RegExp or a function as described above.
- _compare_: an optional comparison function that accepts two strings and compares them according to the format meaning. This function is used with keywords `formatMaximum`/`formatMinimum` (defined in [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) package). It should return `1` if the first value is bigger than the second value, `-1` if it is smaller and `0` if it is equal.
- _async_: an optional `true` value if `validate` is an asynchronous function; in this case it should return a promise that resolves with a value `true` or `false`.
- _type_: an optional type of data that the format applies to. It can be `"string"` (default) or `"number"` (see https://github.com/ajv-validator/ajv/issues/291#issuecomment-259923858). If the type of data is different, the validation will pass.

Custom formats can be also added via `formats` option.


##### <a name="api-addkeyword"></a>.addKeyword(String keyword, Object definition) -&gt; Ajv

Add custom validation keyword to Ajv instance.

Keyword should be different from all standard JSON Schema keywords and different from previously defined keywords. There is no way to redefine keywords or to remove keyword definition from the instance.

Keyword must start with a letter, `_` or `$`, and may continue with letters, numbers, `_`, `$`, or `-`.
It is recommended to use an application-specific prefix for keywords to avoid current and future name collisions.

Example Keywords:
- `"xyz-example"`: valid, and uses prefix for the xyz project to avoid name collisions.
- `"example"`: valid, but not recommended as it could collide with future versions of JSON Schema etc.
- `"3-example"`: invalid as numbers are not allowed to be the first character in a keyword

Keyword definition is an object with the following properties:

- _type_: optional string or array of strings with data type(s) that the keyword applies to. If not present, the keyword will apply to all types.
- _validate_: validating function
- _compile_: compiling function
- _macro_: macro function
- _inline_: compiling function that returns code (as string)
- _schema_: an optional `false` value used with "validate" keyword to not pass schema
- _metaSchema_: an optional meta-schema for keyword schema
- _dependencies_: an optional list of properties that must be present in the parent schema - it will be checked during schema compilation
- _modifying_: `true` MUST be passed if keyword modifies data
- _statements_: `true` can be passed in case inline keyword generates statements (as opposed to expression)
- _valid_: pass `true`/`false` to pre-define validation result, the result returned from validation function will be ignored. This option cannot be used with macro keywords.
- _$data_: an optional `true` value to support [$data reference](#data-reference) as the value of custom keyword. The reference will be resolved at validation time. If the keyword has meta-schema it would be extended to allow $data and it will be used to validate the resolved value. Supporting $data reference requires that keyword has validating function (as the only option or in addition to compile, macro or inline function).
- _async_: an optional `true` value if the validation function is asynchronous (whether it is compiled or passed in _validate_ property); in this case it should return a promise that resolves with a value `true` or `false`. This option is ignored in case of "macro" and "inline" keywords.
- _errors_: an optional boolean or string `"full"` indicating whether keyword returns errors. If this property is not set Ajv will determine if the errors were set in case of failed validation.

_compile_, _macro_ and _inline_ are mutually exclusive, only one should be used at a time. _validate_ can be used separately or in addition to them to support $data reference.

__Please note__: If the keyword is validating data type that is different from the type(s) in its definition, the validation function will not be called (and expanded macro will not be used), so there is no need to check for data type inside validation function or inside schema returned by macro function (unless you want to enforce a specific type and for some reason do not want to use a separate `type` keyword for that). In the same way as standard keywords work, if the keyword does not apply to the data type being validated, the validation of this keyword will succeed.

See [Defining custom keywords](#defining-custom-keywords) for more details.


##### .getKeyword(String keyword) -&gt; Object|Boolean

Returns custom keyword definition, `true` for pre-defined keywords and `false` if the keyword is unknown.


##### .removeKeyword(String keyword) -&gt; Ajv

Removes custom or pre-defined keyword so you can redefine them.

While this method can be used to extend pre-defined keywords, it can also be used to completely change their meaning - it may lead to unexpected results.

__Please note__: schemas compiled before the keyword is removed will continue to work without changes. To recompile schemas use `removeSchema` method and compile them again.


##### .errorsText([Array&lt;Object&gt; errors [, Object options]]) -&gt; String

Returns the text with all errors in a String.

Options can have properties `separator` (string used to separate errors, ", " by default) and `dataVar` (the variable name that dataPaths are prefixed with, "data" by default).


## Options

Defaults:

```javascript
{
  // validation and reporting options:
  $data:            false,
  allErrors:        false,
  verbose:          false,
  $comment:         false, // NEW in Ajv version 6.0
  jsonPointers:     false,
  uniqueItems:      true,
  unicode:          true,
  nullable:         false,
  format:           'fast',
  formats:          {},
  unknownFormats:   true,
  schemas:          {},
  logger:           undefined,
  // referenced schema options:
  schemaId:         '$id',
  missingRefs:      true,
  extendRefs:       'ignore', // recommended 'fail'
  loadSchema:       undefined, // function(uri: string): Promise {}
  // options to modify validated data:
  removeAdditional: false,
  useDefaults:      false,
  coerceTypes:      false,
  // strict mode options
  strictDefaults:   false,
  strictKeywords:   false,
  strictNumbers:    false,
  // asynchronous validation options:
  transpile:        undefined, // requires ajv-async package
  // advanced options:
  meta:             true,
  validateSchema:   true,
  addUsedSchema:    true,
  inlineRefs:       true,
  passContext:      false,
  loopRequired:     Infinity,
  ownProperties:    false,
  multipleOfPrecision: false,
  errorDataPath:    'object', // deprecated
  messages:         true,
  sourceCode:       false,
  processCode:      undefined, // function (str: string, schema: object): string {}
  cache:            new Cache,
  serialize:        undefined,
  regExp:           undefined // custom RegExp engine
}
```

##### Validation and reporting options

- _$data_: support [$data references](#data-reference). Draft 6 meta-schema that is added by default will be extended to allow them. If you want to use another meta-schema you need to use $dataMetaSchema method to add support for $data reference. See [API](#api).
- _allErrors_: check all rules collecting all errors. Default is to return after the first error.
- _verbose_: include the reference to the part of the schema (`schema` and `parentSchema`) and validated data in errors (false by default).
- _$comment_ (NEW in Ajv version 6.0): log or pass the value of `$comment` keyword to a function. Option values:
  - `false` (default): ignore $comment keyword.
  - `true`: log the keyword value to console.
  - function: pass the keyword value, its schema path and root schema to the specified function
- _jsonPointers_: set `dataPath` property of errors using [JSON Pointers](https://tools.ietf.org/html/rfc6901) instead of JavaScript property access notation.
- _uniqueItems_: validate `uniqueItems` keyword (true by default).
- _unicode_: calculate correct length of strings with unicode pairs (true by default). Pass `false` to use `.length` of strings that is faster, but gives "incorrect" lengths of strings with unicode pairs - each unicode pair is counted as two characters.
- _nullable_: support keyword "nullable" from [Open API 3 specification](https://swagger.io/docs/specification/data-models/data-types/).
- _format_: formats validation mode. Option values:
  - `"fast"` (default) - simplified and fast validation (see [Formats](#formats) for details of which formats are available and affected by this option).
  - `"full"` - more restrictive and slow validation. E.g., 25:00:00 and 2015/14/33 will be invalid time and date in 'full' mode but it will be valid in 'fast' mode.
  - `false` - ignore all format keywords.
- _formats_: an object with custom formats. Keys and values will be passed to `addFormat` method.
- _keywords_: an object with custom keywords. Keys and values will be passed to `addKeyword` method.
- _unknownFormats_: handling of unknown formats. Option values:
  - `true` (default) - if an unknown format is encountered the exception is thrown during schema compilation. If `format` keyword value is [$data reference](#data-reference) and it is unknown the validation will fail.
  - `[String]` - an array of unknown format names that will be ignored. This option can be used to allow usage of third party schemas with format(s) for which you don't have definitions, but still fail if another unknown format is used. If `format` keyword value is [$data reference](#data-reference) and it is not in this array the validation will fail.
  - `"ignore"` - to log warning during schema compilation and always pass validation (the default behaviour in versions before 5.0.0). This option is not recommended, as it allows to mistype format name and it won't be validated without any error message. This behaviour is required by JSON Schema specification.
- _schemas_: an array or object of schemas that will be added to the instance. In case you pass the array the schemas must have IDs in them. When the object is passed the method `addSchema(value, key)` will be called for each schema in this object.
- _logger_: sets the logging method. Default is the global `console` object that should have methods `log`, `warn` and `error`. See [Error logging](#error-logging). Option values:
  - custom logger - it should have methods `log`, `warn` and `error`. If any of these methods is missing an exception will be thrown.
  - `false` - logging is disabled.


##### Referenced schema options

- _schemaId_: this option defines which keywords are used as schema URI. Option value:
  - `"$id"` (default) - only use `$id` keyword as schema URI (as specified in JSON Schema draft-06/07), ignore `id` keyword (if it is present a warning will be logged).
  - `"id"` - only use `id` keyword as schema URI (as specified in JSON Schema draft-04), ignore `$id` keyword (if it is present a warning will be logged).
  - `"auto"` - use both `$id` and `id` keywords as schema URI. If both are present (in the same schema object) and different the exception will be thrown during schema compilation.
- _missingRefs_: handling of missing referenced schemas. Option values:
  - `true` (default) - if the reference cannot be resolved during compilation the exception is thrown. The thrown error has properties `missingRef` (with hash fragment) and `missingSchema` (without it). Both properties are resolved relative to the current base id (usually schema id, unless it was substituted).
  - `"ignore"` - to log error during compilati]Son and always pass validation.
  - `"fail"` - to log error and successfully compile schema but fail validation if this rule is checked.
- _extendRefs_: validation of other keywords when `$ref` is present in the schema. Option values:
  - `"ignore"` (default) - when `$ref` is used other keywords are ignored (as per [JSON Reference](https://tools.ietf.org/html/draft-pbryan-zyp-json-ref-03#section-3) standard). A warning will be logged during the schema compilation.
  - `"fail"` (recommended) - if other validation keywords are used together with `$ref` the exception will be thrown when the schema is compiled. This option is recommended to make sure schema has no keywords that are ignored, which can be confusing.
  - `true` - validate all keywords in the schemas with `$ref` (the default behaviour in versions before 5.0.0).
- _loadSchema_: asynchronous function that will be used to load remote schemas when `compileAsync` [method](#api-compileAsync) is used and some reference is missing (option `missingRefs` should NOT be 'fail' or 'ignore'). This function should accept remote schema uri as a parameter and return a Promise that resolves to a schema. See example in [Asynchronous compilation](#asynchronous-schema-compilation).


##### Options to modify validated data

- _removeAdditional_: remove additional properties - see example in [Filtering data](#filtering-data). This option is not used if schema is added with `addMetaSchema` method. Option values:
  - `false` (default) - not to remove additional properties
  - `"all"` - all additional properties are removed, regardless of `additionalProperties` keyword in schema (and no validation is made for them).
  - `true` - only additional properties with `additionalProperties` keyword equal to `false` are removed.
  - `"failing"` - additional properties that fail schema validation will be removed (where `additionalProperties` keyword is `false` or schema).
- _useDefaults_: replace missing or undefined properties and items with the values from corresponding `default` keywords. Default behaviour is to ignore `default` keywords. This option is not used if schema is added with `addMetaSchema` method. See examples in [Assigning defaults](#assigning-defaults). Option values:
  - `false` (default) - do not use defaults
  - `true` - insert defaults by value (object literal is used).
  - `"empty"` - in addition to missing or undefined, use defaults for properties and items that are equal to `null` or `""` (an empty string).
  - `"shared"` (deprecated) - insert defaults by reference. If the default is an object, it will be shared by all instances of validated data. If you modify the inserted default in the validated data, it will be modified in the schema as well.
- _coerceTypes_: change data type of data to match `type` keyword. See the example in [Coercing data types](#coercing-data-types) and [coercion rules](https://github.com/ajv-validator/ajv/blob/master/COERCION.md). Option values:
  - `false` (default) - no type coercion.
  - `true` - coerce scalar data types.
  - `"array"` - in addition to coercions between scalar types, coerce scalar data to an array with one element and vice versa (as required by the schema).


##### Strict mode options

- _strictDefaults_: report ignored `default` keywords in schemas. Option values:
  - `false` (default) - ignored defaults are not reported
  - `true` - if an ignored default is present, throw an error
  - `"log"` - if an ignored default is present, log warning
- _strictKeywords_: report unknown keywords in schemas. Option values:
  - `false` (default) - unknown keywords are not reported
  - `true` - if an unknown keyword is present, throw an error
  - `"log"` - if an unknown keyword is present, log warning
- _strictNumbers_: validate numbers strictly, failing validation for NaN and Infinity. Option values:
  - `false` (default) - NaN or Infinity will pass validation for numeric types
  - `true` - NaN or Infinity will not pass validation for numeric types

##### Asynchronous validation options

- _transpile_: Requires [ajv-async](https://github.com/ajv-validator/ajv-async) package. It determines whether Ajv transpiles compiled asynchronous validation function. Option values:
  - `undefined` (default) - transpile with [nodent](https://github.com/MatAtBread/nodent) if async functions are not supported.
  - `true` - always transpile with nodent.
  - `false` - do not transpile; if async functions are not supported an exception will be thrown.


##### Advanced options

- _meta_: add [meta-schema](http://json-schema.org/documentation.html) so it can be used by other schemas (true by default). If an object is passed, it will be used as the default meta-schema for schemas that have no `$schema` keyword. This default meta-schema MUST have `$schema` keyword.
- _validateSchema_: validate added/compiled schemas against meta-schema (true by default). `$schema` property in the schema can be http://json-schema.org/draft-07/schema or absent (draft-07 meta-schema will be used) or can be a reference to the schema previously added with `addMetaSchema` method. Option values:
  - `true` (default) -  if the validation fails, throw the exception.
  - `"log"` - if the validation fails, log error.
  - `false` - skip schema validation.
- _addUsedSchema_: by default methods `compile` and `validate` add schemas to the instance if they have `$id` (or `id`) property that doesn't start with "#". If `$id` is present and it is not unique the exception will be thrown. Set this option to `false` to skip adding schemas to the instance and the `$id` uniqueness check when these methods are used. This option does not affect `addSchema` method.
- _inlineRefs_: Affects compilation of referenced schemas. Option values:
  - `true` (default) - the referenced schemas that don't have refs in them are inlined, regardless of their size - that substantially improves performance at the cost of the bigger size of compiled schema functions.
  - `false` - to not inline referenced schemas (they will be compiled as separate functions).
  - integer number - to limit the maximum number of keywords of the schema that will be inlined.
- _passContext_: pass validation context to custom keyword functions. If this option is `true` and you pass some context to the compiled validation function with `validate.call(context, data)`, the `context` will be available as `this` in your custom keywords. By default `this` is Ajv instance.
- _loopRequired_: by default `required` keyword is compiled into a single expression (or a sequence of statements in `allErrors` mode). In case of a very large number of properties in this keyword it may result in a very big validation function. Pass integer to set the number of properties above which `required` keyword will be validated in a loop - smaller validation function size but also worse performance.
- _ownProperties_: by default Ajv iterates over all enumerable object properties; when this option is `true` only own enumerable object properties (i.e. found directly on the object rather than on its prototype) are iterated. Contributed by @mbroadst.
- _multipleOfPrecision_: by default `multipleOf` keyword is validated by comparing the result of division with parseInt() of that result. It works for dividers that are bigger than 1. For small dividers such as 0.01 the result of the division is usually not integer (even when it should be integer, see issue [#84](https://github.com/ajv-validator/ajv/issues/84)). If you need to use fractional dividers set this option to some positive integer N to have `multipleOf` validated using this formula: `Math.abs(Math.round(division) - division) < 1e-N` (it is slower but allows for float arithmetics deviations).
- _errorDataPath_ (deprecated): set `dataPath` to point to 'object' (default) or to 'property' when validating keywords `required`, `additionalProperties` and `dependencies`.
- _messages_: Include human-readable messages in errors. `true` by default. `false` can be passed when custom messages are used (e.g. with [ajv-i18n](https://github.com/ajv-validator/ajv-i18n)).
- _sourceCode_: add `sourceCode` property to validating function (for debugging; this code can be different from the result of toString call).
- _processCode_: an optional function to process generated code before it is passed to Function constructor. It can be used to either beautify (the validating function is generated without line-breaks) or to transpile code. Starting from version 5.0.0 this option replaced options:
  - `beautify` that formatted the generated function using [js-beautify](https://github.com/beautify-web/js-beautify). If you want to beautify the generated code pass a function calling `require('js-beautify').js_beautify` as `processCode: code => js_beautify(code)`.
  - `transpile` that transpiled asynchronous validation function. You can still use `transpile` option with [ajv-async](https://github.com/ajv-validator/ajv-async) package. See [Asynchronous validation](#asynchronous-validation) for more information.
- _cache_: an optional instance of cache to store compiled schemas using stable-stringified schema as a key. For example, set-associative cache [sacjs](https://github.com/epoberezkin/sacjs) can be used. If not passed then a simple hash is used which is good enough for the common use case (a limited number of statically defined schemas). Cache should have methods `put(key, value)`, `get(key)`, `del(key)` and `clear()`.
- _serialize_: an optional function to serialize schema to cache key. Pass `false` to use schema itself as a key (e.g., if WeakMap used as a cache). By default [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used.
- _regExp_: an optional function to create RegExp objects. This allows using a custom RegExp engine (e.g., [RE2](https://github.com/uhop/node-re2)) to mitigate ReDoS attacks. The function must have the signature `(pattern: string) => RegExpLike` where `RegExpLike` is an object with a `test(string) => boolean` method. Example with RE2:
  ```javascript
  var ajv = new Ajv({regExp: require('re2')});
  ```
  By default (`undefined`), native `RegExp` constructor is used.


## Validation errors

In case of validation failure, Ajv assigns the array of errors to `errors` property of validation function (or to `errors` property of Ajv instance when `validate` or `validateSchema` methods were called). In case of [asynchronous validation](#asynchronous-validation), the returned promise is rejected with exception `Ajv.ValidationError` that has `errors` property.


### Error objects

Each error is an object with the following properties:

- _keyword_: validation keyword.
- _dataPath_: the path to the part of the data that was validated. By default `dataPath` uses JavaScript property access notation (e.g., `".prop[1].subProp"`). When the option `jsonPointers` is true (see [Options](#options)) `dataPath` will be set using JSON pointer standard (e.g., `"/prop/1/subProp"`).
- _schemaPath_: the path (JSON-pointer as a URI fragment) to the schema of the keyword that failed validation.
- _params_: the object with the additional information about error that can be used to create custom error messages (e.g., using [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) package). See below for parameters set by all keywords.
- _message_: the standard error message (can be excluded with option `messages` set to false).
- _schema_: the schema of the keyword (added with `verbose` option).
- _parentSchema_: the schema containing the keyword (added with `verbose` option)
- _data_: the data validated by the keyword (added with `verbose` option).

__Please note__: `propertyNames` keyword schema validation errors have an additional property `propertyName`, `dataPath` points to the object. After schema validation for each property name, if it is invalid an additional error is added with the property `keyword` equal to `"propertyNames"`.


### Error parameters

Properties of `params` object in errors depend on the keyword that failed validation.

- `maxItems`, `minItems`, `maxLength`, `minLength`, `maxProperties`, `minProperties` - property `limit` (number, the schema of the keyword).
- `additionalItems` - property `limit` (the maximum number of allowed items in case when `items` keyword is an array of schemas and `additionalItems` is false).
- `additionalProperties` - property `additionalProperty` (the property not used in `properties` and `patternProperties` keywords).
- `dependencies` - properties:
  - `property` (dependent property),
  - `missingProperty` (required missing dependency - only the first one is reported currently)
  - `deps` (required dependencies, comma separated list as a string),
  - `depsCount` (the number of required dependencies).
- `format` - property `format` (the schema of the keyword).
- `maximum`, `minimum` - properties:
  - `limit` (number, the schema of the keyword),
  - `exclusive` (boolean, the schema of `exclusiveMaximum` or `exclusiveMinimum`),
  - `comparison` (string, comparison operation to compare the data to the limit, with the data on the left and the limit on the right; can be "<", "<=", ">", ">=")
- `multipleOf` - property `multipleOf` (the schema of the keyword)
- `pattern` - property `pattern` (the schema of the keyword)
- `required` - property `missingProperty` (required property that is missing).
- `propertyNames` - property `propertyName` (an invalid property name).
- `patternRequired` (in ajv-keywords) - property `missingPattern` (required pattern that did not match any property).
- `type` - property `type` (required type(s), a string, can be a comma-separated list)
- `uniqueItems` - properties `i` and `j` (indices of duplicate items).
- `const` - property `allowedValue` pointing to the value (the schema of the keyword).
- `enum` - property `allowedValues` pointing to the array of values (the schema of the keyword).
- `$ref` - property `ref` with the referenced schema URI.
- `oneOf` - property `passingSchemas` (array of indices of passing schemas, null if no schema passes).
- custom keywords (in case keyword definition doesn't create errors) - property `keyword` (the keyword name).


### Error logging

Using the `logger` option when initiallizing Ajv will allow you to define custom logging. Here you can build upon the exisiting logging. The use of other logging packages is supported as long as the package or its associated wrapper exposes the required methods. If any of the required methods are missing an exception will be thrown.
- **Required Methods**: `log`, `warn`, `error`

```javascript
var otherLogger = new OtherLogger();
var ajv = new Ajv({
  logger: {
    log: console.log.bind(console),
    warn: function warn() {
      otherLogger.logWarn.apply(otherLogger, arguments);
    },
    error: function error() {
      otherLogger.logError.apply(otherLogger, arguments);
      console.error.apply(console, arguments);
    }
  }
});
```


## Plugins

Ajv can be extended with plugins that add custom keywords, formats or functions to process generated code. When such plugin is published as npm package it is recommended that it follows these conventions:

- it exports a function
- this function accepts ajv instance as the first parameter and returns the same instance to allow chaining
- this function can accept an optional configuration as the second parameter

If you have published a useful plugin please submit a PR to add it to the next section.


## Related packages

- [ajv-async](https://github.com/ajv-validator/ajv-async) - plugin to configure async validation mode
- [ajv-bsontype](https://github.com/BoLaMN/ajv-bsontype) - plugin to validate mongodb's bsonType formats
- [ajv-cli](https://github.com/jessedc/ajv-cli) - command line interface
- [ajv-errors](https://github.com/ajv-validator/ajv-errors) - plugin for custom error messages
- [ajv-i18n](https://github.com/ajv-validator/ajv-i18n) - internationalised error messages
- [ajv-istanbul](https://github.com/ajv-validator/ajv-istanbul) - plugin to instrument generated validation code to measure test coverage of your schemas
- [ajv-keywords](https://github.com/ajv-validator/ajv-keywords) - plugin with custom validation keywords (select, typeof, etc.)
- [ajv-merge-patch](https://github.com/ajv-validator/ajv-merge-patch) - plugin with keywords $merge and $patch
- [ajv-pack](https://github.com/ajv-validator/ajv-pack) - produces a compact module exporting validation functions
- [ajv-formats-draft2019](https://github.com/luzlab/ajv-formats-draft2019) - format validators for draft2019 that aren't already included in ajv (ie. `idn-hostname`, `idn-email`, `iri`, `iri-reference` and `duration`).

## Some packages using Ajv

- [webpack](https://github.com/webpack/webpack) - a module bundler. Its main purpose is to bundle JavaScript files for usage in a browser
- [jsonscript-js](https://github.com/JSONScript/jsonscript-js) - the interpreter for [JSONScript](http://www.jsonscript.org) - scripted processing of existing endpoints and services
- [osprey-method-handler](https://github.com/mulesoft-labs/osprey-method-handler) - Express middleware for validating requests and responses based on a RAML method object, used in [osprey](https://github.com/mulesoft/osprey) - validating API proxy generated from a RAML definition
- [har-validator](https://github.com/ahmadnassri/har-validator) - HTTP Archive (HAR) validator
- [jsoneditor](https://github.com/josdejong/jsoneditor) - a web-based tool to view, edit, format, and validate JSON http://jsoneditoronline.org
- [JSON Schema Lint](https://github.com/nickcmaynard/jsonschemalint) - a web tool to validate JSON/YAML document against a single JSON Schema http://jsonschemalint.com
- [objection](https://github.com/vincit/objection.js) - SQL-friendly ORM for Node.js
- [table](https://github.com/gajus/table) - formats data into a string table
- [ripple-lib](https://github.com/ripple/ripple-lib) - a JavaScript API for interacting with [Ripple](https://ripple.com) in Node.js and the browser
- [restbase](https://github.com/wikimedia/restbase) - distributed storage with REST API & dispatcher for backend services built to provide a low-latency & high-throughput API for Wikipedia / Wikimedia content
- [hippie-swagger](https://github.com/CacheControl/hippie-swagger) - [Hippie](https://github.com/vesln/hippie) wrapper that provides end to end API testing with swagger validation
- [react-form-controlled](https://github.com/seeden/react-form-controlled) - React controlled form components with validation
- [rabbitmq-schema](https://github.com/tjmehta/rabbitmq-schema) - a schema definition module for RabbitMQ graphs and messages
- [@query/schema](https://www.npmjs.com/package/@query/schema) - stream filtering with a URI-safe query syntax parsing to JSON Schema
- [chai-ajv-json-schema](https://github.com/peon374/chai-ajv-json-schema) - chai plugin to us JSON Schema with expect in mocha tests
- [grunt-jsonschema-ajv](https://github.com/SignpostMarv/grunt-jsonschema-ajv) - Grunt plugin for validating files against JSON Schema
- [extract-text-webpack-plugin](https://github.com/webpack-contrib/extract-text-webpack-plugin) - extract text from bundle into a file
- [electron-builder](https://github.com/electron-userland/electron-builder) - a solution to package and build a ready for distribution Electron app
- [addons-linter](https://github.com/mozilla/addons-linter) - Mozilla Add-ons Linter
- [gh-pages-generator](https://github.com/epoberezkin/gh-pages-generator) - multi-page site generator converting markdown files to GitHub pages
- [ESLint](https://github.com/eslint/eslint) - the pluggable linting utility for JavaScript and JSX
- [Spectral](https://github.com/stoplightio/spectral) - the customizable linting utility for JSON/YAML, OpenAPI, AsyncAPI, and JSON Schema


## Tests

```
npm install
git submodule update --init
npm test
```

## Contributing

All validation functions are generated using doT templates in [dot](https://github.com/ajv-validator/ajv/tree/master/lib/dot) folder. Templates are precompiled so doT is not a run-time dependency.

`npm run build` - compiles templates to [dotjs](https://github.com/ajv-validator/ajv/tree/master/lib/dotjs) folder.

`npm run watch` - automatically compiles templates when files in dot folder change

Please see [Contributing guidelines](https://github.com/ajv-validator/ajv/blob/master/CONTRIBUTING.md)


## Changes history

See https://github.com/ajv-validator/ajv/releases

__Please note__: [Changes in version 7.0.0-beta](https://github.com/ajv-validator/ajv/releases/tag/v7.0.0-beta.0)

[Version 6.0.0](https://github.com/ajv-validator/ajv/releases/tag/v6.0.0).

## Code of conduct

Please review and follow the [Code of conduct](https://github.com/ajv-validator/ajv/blob/master/CODE_OF_CONDUCT.md).

Please report any unacceptable behaviour to ajv.validator@gmail.com - it will be reviewed by the project team.


## Open-source software support

Ajv is a part of [Tidelift subscription](https://tidelift.com/subscription/pkg/npm-ajv?utm_source=npm-ajv&utm_medium=referral&utm_campaign=readme) - it provides a centralised support to open-source software users, in addition to the support provided by software maintainers.


## License

[MIT](https://github.com/ajv-validator/ajv/blob/master/LICENSE)
$7xy 100644 ajv.bundle.js 2CIXz%i~q100644 ajv.min.js ȠfJF+la100644 ajv.min.js.map x=v.CٖWyfR.|/x   (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Ajv = f()}})(function(){var define,module,exports;return (function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
'use strict';


var Cache = module.exports = function Cache() {
  this._cache = {};
};


Cache.prototype.put = function Cache_put(key, value) {
  this._cache[key] = value;
};


Cache.prototype.get = function Cache_get(key) {
  return this._cache[key];
};


Cache.prototype.del = function Cache_del(key) {
  delete this._cache[key];
};


Cache.prototype.clear = function Cache_clear() {
  this._cache = {};
};

},{}],2:[function(require,module,exports){
'use strict';

var MissingRefError = require('./error_classes').MissingRef;

module.exports = compileAsync;


/**
 * Creates validating function for passed schema with asynchronous loading of missing schemas.
 * `loadSchema` option should be a function that accepts schema uri and returns promise that resolves with the schema.
 * @this  Ajv
 * @param {Object}   schema schema object
 * @param {Boolean}  meta optional true to compile meta-schema; this parameter can be skipped
 * @param {Function} callback an optional node-style callback, it is called with 2 parameters: error (or null) and validating function.
 * @return {Promise} promise that resolves with a validating function.
 */
function compileAsync(schema, meta, callback) {
  /* eslint no-shadow: 0 */
  /* global Promise */
  /* jshint validthis: true */
  var self = this;
  if (typeof this._opts.loadSchema != 'function')
    throw new Error('options.loadSchema should be a function');

  if (typeof meta == 'function') {
    callback = meta;
    meta = undefined;
  }

  var p = loadMetaSchemaOf(schema).then(function () {
    var schemaObj = self._addSchema(schema, undefined, meta);
    return schemaObj.validate || _compileAsync(schemaObj);
  });

  if (callback) {
    p.then(
      function(v) { callback(null, v); },
      callback
    );
  }

  return p;


  function loadMetaSchemaOf(sch) {
    var $schema = sch.$schema;
    return $schema && !self.getSchema($schema)
            ? compileAsync.call(self, { $ref: $schema }, true)
            : Promise.resolve();
  }


  function _compileAsync(schemaObj) {
    try { return self._compile(schemaObj); }
    catch(e) {
      if (e instanceof MissingRefError) return loadMissingSchema(e);
      throw e;
    }


    function loadMissingSchema(e) {
      var ref = e.missingSchema;
      if (added(ref)) throw new Error('Schema ' + ref + ' is loaded but ' + e.missingRef + ' cannot be resolved');

      var schemaPromise = self._loadingSchemas[ref];
      if (!schemaPromise) {
        schemaPromise = self._loadingSchemas[ref] = self._opts.loadSchema(ref);
        schemaPromise.then(removePromise, removePromise);
      }

      return schemaPromise.then(function (sch) {
        if (!added(ref)) {
          return loadMetaSchemaOf(sch).then(function () {
            if (!added(ref)) self.addSchema(sch, ref, undefined, meta);
          });
        }
      }).then(function() {
        return _compileAsync(schemaObj);
      });

      function removePromise() {
        delete self._loadingSchemas[ref];
      }

      function added(ref) {
        return self._refs[ref] || self._schemas[ref];
      }
    }
  }
}

},{"./error_classes":3}],3:[function(require,module,exports){
'use strict';

var resolve = require('./resolve');

module.exports = {
  Validation: errorSubclass(ValidationError),
  MissingRef: errorSubclass(MissingRefError)
};


function ValidationError(errors) {
  this.message = 'validation failed';
  this.errors = errors;
  this.ajv = this.validation = true;
}


MissingRefError.message = function (baseId, ref) {
  return 'can\'t resolve reference ' + ref + ' from id ' + baseId;
};


function MissingRefError(baseId, ref, message) {
  this.message = message || MissingRefError.message(baseId, ref);
  this.missingRef = resolve.url(baseId, ref);
  this.missingSchema = resolve.normalizeId(resolve.fullPath(this.missingRef));
}


function errorSubclass(Subclass) {
  Subclass.prototype = Object.create(Error.prototype);
  Subclass.prototype.constructor = Subclass;
  return Subclass;
}

},{"./resolve":6}],4:[function(require,module,exports){
'use strict';

var util = require('./util');

var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
var DAYS = [0,31,28,31,30,31,30,31,31,30,31,30,31];
var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;
var HOSTNAME = /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i;
var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4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[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;
// uri-template: https://tools.ietf.org/html/rfc6570
var URITEMPLATE = /^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i;
// For the source: https://gist.github.com/dperini/729294
// For test cases: https://mathiasbynens.be/demo/url-regex
// @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983.
// var URL = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu;
var URL = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i;
var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;
var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/;
var JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;
var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;


module.exports = formats;

function formats(mode) {
  mode = mode == 'full' ? 'full' : 'fast';
  return util.copy(formats[mode]);
}


formats.fast = {
  // date: http://tools.ietf.org/html/rfc3339#section-5.6
  date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/,
  // date-time: http://tools.ietf.org/html/rfc3339#section-5.6
  time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,
  'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,
  // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js
  uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,
  'uri-reference': /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
  'uri-template': URITEMPLATE,
  url: URL,
  // email (sources from jsen validator):
  // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363
  // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')
  email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,
  hostname: HOSTNAME,
  // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html
  ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
  // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses
  ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,
  regex: regex,
  // uuid: http://tools.ietf.org/html/rfc4122
  uuid: UUID,
  // JSON-pointer: https://tools.ietf.org/html/rfc6901
  // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A
  'json-pointer': JSON_POINTER,
  'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT,
  // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00
  'relative-json-pointer': RELATIVE_JSON_POINTER
};


formats.full = {
  date: date,
  time: time,
  'date-time': date_time,
  uri: uri,
  'uri-reference': URIREF,
  'uri-template': URITEMPLATE,
  url: URL,
  email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
  hostname: HOSTNAME,
  ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
  ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,
  regex: regex,
  uuid: UUID,
  'json-pointer': JSON_POINTER,
  'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT,
  'relative-json-pointer': RELATIVE_JSON_POINTER
};


function isLeapYear(year) {
  // https://tools.ietf.org/html/rfc3339#appendix-C
  return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
}


function date(str) {
  // full-date from http://tools.ietf.org/html/rfc3339#section-5.6
  var matches = str.match(DATE);
  if (!matches) return false;

  var year = +matches[1];
  var month = +matches[2];
  var day = +matches[3];

  return month >= 1 && month <= 12 && day >= 1 &&
          day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]);
}


function time(str, full) {
  var matches = str.match(TIME);
  if (!matches) return false;

  var hour = matches[1];
  var minute = matches[2];
  var second = matches[3];
  var timeZone = matches[5];
  return ((hour <= 23 && minute <= 59 && second <= 59) ||
          (hour == 23 && minute == 59 && second == 60)) &&
         (!full || timeZone);
}


var DATE_TIME_SEPARATOR = /t|\s/i;
function date_time(str) {
  // http://tools.ietf.org/html/rfc3339#section-5.6
  var dateTime = str.split(DATE_TIME_SEPARATOR);
  return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true);
}


var NOT_URI_FRAGMENT = /\/|:/;
function uri(str) {
  // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "."
  return NOT_URI_FRAGMENT.test(str) && URI.test(str);
}


var Z_ANCHOR = /[^\\]\\Z/;
function regex(str) {
  if (Z_ANCHOR.test(str)) return false;
  try {
    new RegExp(str);
    return true;
  } catch(e) {
    return false;
  }
}

},{"./util":10}],5:[function(require,module,exports){
'use strict';

var resolve = require('./resolve')
  , util = require('./util')
  , errorClasses = require('./error_classes')
  , stableStringify = require('fast-json-stable-stringify');

var validateGenerator = require('../dotjs/validate');

/**
 * Functions below are used inside compiled validations function
 */

var ucs2length = util.ucs2length;
var equal = require('fast-deep-equal');

// this error is thrown by async schemas to return validation errors via exception
var ValidationError = errorClasses.Validation;

module.exports = compile;


/**
 * Compiles schema to validation function
 * @this   Ajv
 * @param  {Object} schema schema object
 * @param  {Object} root object with information about the root schema for this schema
 * @param  {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution
 * @param  {String} baseId base ID for IDs in the schema
 * @return {Function} validation function
 */
function compile(schema, root, localRefs, baseId) {
  /* jshint validthis: true, evil: true */
  /* eslint no-shadow: 0 */
  var self = this
    , opts = this._opts
    , refVal = [ undefined ]
    , refs = {}
    , patterns = []
    , patternsHash = {}
    , defaults = []
    , defaultsHash = {}
    , customRules = [];

  function patternCode(i, patterns) {
    var regExpCode = opts.regExp ? 'regExp' : 'new RegExp';
    return 'var pattern' + i + ' = ' + regExpCode + '(' + util.toQuotedString(patterns[i]) + ');';
  }

  root = root || { schema: schema, refVal: refVal, refs: refs };

  var c = checkCompiling.call(this, schema, root, baseId);
  var compilation = this._compilations[c.index];
  if (c.compiling) return (compilation.callValidate = callValidate);

  var formats = this._formats;
  var RULES = this.RULES;

  try {
    var v = localCompile(schema, root, localRefs, baseId);
    compilation.validate = v;
    var cv = compilation.callValidate;
    if (cv) {
      cv.schema = v.schema;
      cv.errors = null;
      cv.refs = v.refs;
      cv.refVal = v.refVal;
      cv.root = v.root;
      cv.$async = v.$async;
      if (opts.sourceCode) cv.source = v.source;
    }
    return v;
  } finally {
    endCompiling.call(this, schema, root, baseId);
  }

  /* @this   {*} - custom context, see passContext option */
  function callValidate() {
    /* jshint validthis: true */
    var validate = compilation.validate;
    var result = validate.apply(this, arguments);
    callValidate.errors = validate.errors;
    return result;
  }

  function localCompile(_schema, _root, localRefs, baseId) {
    var isRoot = !_root || (_root && _root.schema == _schema);
    if (_root.schema != root.schema)
      return compile.call(self, _schema, _root, localRefs, baseId);

    var $async = _schema.$async === true;

    var sourceCode = validateGenerator({
      isTop: true,
      schema: _schema,
      isRoot: isRoot,
      baseId: baseId,
      root: _root,
      schemaPath: '',
      errSchemaPath: '#',
      errorPath: '""',
      MissingRefError: errorClasses.MissingRef,
      RULES: RULES,
      validate: validateGenerator,
      util: util,
      resolve: resolve,
      resolveRef: resolveRef,
      usePattern: usePattern,
      useDefault: useDefault,
      useCustomRule: useCustomRule,
      opts: opts,
      formats: formats,
      logger: self.logger,
      self: self
    });

    sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode)
                   + vars(defaults, defaultCode) + vars(customRules, customRuleCode)
                   + sourceCode;

    if (opts.processCode) sourceCode = opts.processCode(sourceCode, _schema);
    // console.log('\n\n\n *** \n', JSON.stringify(sourceCode));
    var validate;
    try {
      var makeValidate = new Function(
        'self',
        'RULES',
        'formats',
        'root',
        'refVal',
        'defaults',
        'customRules',
        'equal',
        'ucs2length',
        'ValidationError',
        'regExp',
        sourceCode
      );

      validate = makeValidate(
        self,
        RULES,
        formats,
        root,
        refVal,
        defaults,
        customRules,
        equal,
        ucs2length,
        ValidationError,
        opts.regExp
      );

      refVal[0] = validate;
    } catch(e) {
      self.logger.error('Error compiling schema, function code:', sourceCode);
      throw e;
    }

    validate.schema = _schema;
    validate.errors = null;
    validate.refs = refs;
    validate.refVal = refVal;
    validate.root = isRoot ? validate : _root;
    if ($async) validate.$async = true;
    if (opts.sourceCode === true) {
      validate.source = {
        code: sourceCode,
        patterns: patterns,
        defaults: defaults
      };
    }

    return validate;
  }

  function resolveRef(baseId, ref, isRoot) {
    ref = resolve.url(baseId, ref);
    var refIndex = refs[ref];
    var _refVal, refCode;
    if (refIndex !== undefined) {
      _refVal = refVal[refIndex];
      refCode = 'refVal[' + refIndex + ']';
      return resolvedRef(_refVal, refCode);
    }
    if (!isRoot && root.refs) {
      var rootRefId = root.refs[ref];
      if (rootRefId !== undefined) {
        _refVal = root.refVal[rootRefId];
        refCode = addLocalRef(ref, _refVal);
        return resolvedRef(_refVal, refCode);
      }
    }

    refCode = addLocalRef(ref);
    var v = resolve.call(self, localCompile, root, ref);
    if (v === undefined) {
      var localSchema = localRefs && localRefs[ref];
      if (localSchema) {
        v = resolve.inlineRef(localSchema, opts.inlineRefs)
            ? localSchema
            : compile.call(self, localSchema, root, localRefs, baseId);
      }
    }

    if (v === undefined) {
      removeLocalRef(ref);
    } else {
      replaceLocalRef(ref, v);
      return resolvedRef(v, refCode);
    }
  }

  function addLocalRef(ref, v) {
    var refId = refVal.length;
    refVal[refId] = v;
    refs[ref] = refId;
    return 'refVal' + refId;
  }

  function removeLocalRef(ref) {
    delete refs[ref];
  }

  function replaceLocalRef(ref, v) {
    var refId = refs[ref];
    refVal[refId] = v;
  }

  function resolvedRef(refVal, code) {
    return typeof refVal == 'object' || typeof refVal == 'boolean'
            ? { code: code, schema: refVal, inline: true }
            : { code: code, $async: refVal && !!refVal.$async };
  }

  function usePattern(regexStr) {
    var index = patternsHash[regexStr];
    if (index === undefined) {
      index = patternsHash[regexStr] = patterns.length;
      patterns[index] = regexStr;
    }
    return 'pattern' + index;
  }

  function useDefault(value) {
    switch (typeof value) {
      case 'boolean':
      case 'number':
        return '' + value;
      case 'string':
        return util.toQuotedString(value);
      case 'object':
        if (value === null) return 'null';
        var valueStr = stableStringify(value);
        var index = defaultsHash[valueStr];
        if (index === undefined) {
          index = defaultsHash[valueStr] = defaults.length;
          defaults[index] = value;
        }
        return 'default' + index;
    }
  }

  function useCustomRule(rule, schema, parentSchema, it) {
    if (self._opts.validateSchema !== false) {
      var deps = rule.definition.dependencies;
      if (deps && !deps.every(function(keyword) {
        return Object.prototype.hasOwnProperty.call(parentSchema, keyword);
      }))
        throw new Error('parent schema must have all required keywords: ' + deps.join(','));

      var validateSchema = rule.definition.validateSchema;
      if (validateSchema) {
        var valid = validateSchema(schema);
        if (!valid) {
          var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors);
          if (self._opts.validateSchema == 'log') self.logger.error(message);
          else throw new Error(message);
        }
      }
    }

    var compile = rule.definition.compile
      , inline = rule.definition.inline
      , macro = rule.definition.macro;

    var validate;
    if (compile) {
      validate = compile.call(self, schema, parentSchema, it);
    } else if (macro) {
      validate = macro.call(self, schema, parentSchema, it);
      if (opts.validateSchema !== false) self.validateSchema(validate, true);
    } else if (inline) {
      validate = inline.call(self, it, rule.keyword, schema, parentSchema);
    } else {
      validate = rule.definition.validate;
      if (!validate) return;
    }

    if (validate === undefined)
      throw new Error('custom keyword "' + rule.keyword + '"failed to compile');

    var index = customRules.length;
    customRules[index] = validate;

    return {
      code: 'customRule' + index,
      validate: validate
    };
  }
}


/**
 * Checks if the schema is currently compiled
 * @this   Ajv
 * @param  {Object} schema schema to compile
 * @param  {Object} root root object
 * @param  {String} baseId base schema ID
 * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean)
 */
function checkCompiling(schema, root, baseId) {
  /* jshint validthis: true */
  var index = compIndex.call(this, schema, root, baseId);
  if (index >= 0) return { index: index, compiling: true };
  index = this._compilations.length;
  this._compilations[index] = {
    schema: schema,
    root: root,
    baseId: baseId
  };
  return { index: index, compiling: false };
}


/**
 * Removes the schema from the currently compiled list
 * @this   Ajv
 * @param  {Object} schema schema to compile
 * @param  {Object} root root object
 * @param  {String} baseId base schema ID
 */
function endCompiling(schema, root, baseId) {
  /* jshint validthis: true */
  var i = compIndex.call(this, schema, root, baseId);
  if (i >= 0) this._compilations.splice(i, 1);
}


/**
 * Index of schema compilation in the currently compiled list
 * @this   Ajv
 * @param  {Object} schema schema to compile
 * @param  {Object} root root object
 * @param  {String} baseId base schema ID
 * @return {Integer} compilation index
 */
function compIndex(schema, root, baseId) {
  /* jshint validthis: true */
  for (var i=0; i<this._compilations.length; i++) {
    var c = this._compilations[i];
    if (c.schema == schema && c.root == root && c.baseId == baseId) return i;
  }
  return -1;
}


function defaultCode(i) {
  return 'var default' + i + ' = defaults[' + i + '];';
}


function refValCode(i, refVal) {
  return refVal[i] === undefined ? '' : 'var refVal' + i + ' = refVal[' + i + '];';
}


function customRuleCode(i) {
  return 'var customRule' + i + ' = customRules[' + i + '];';
}


function vars(arr, statement) {
  if (!arr.length) return '';
  var code = '';
  for (var i=0; i<arr.length; i++)
    code += statement(i, arr);
  return code;
}

},{"../dotjs/validate":38,"./error_classes":3,"./resolve":6,"./util":10,"fast-deep-equal":42,"fast-json-stable-stringify":43}],6:[function(require,module,exports){
'use strict';

var URI = require('uri-js')
  , equal = require('fast-deep-equal')
  , util = require('./util')
  , SchemaObject = require('./schema_obj')
  , traverse = require('json-schema-traverse');

module.exports = resolve;

resolve.normalizeId = normalizeId;
resolve.fullPath = getFullPath;
resolve.url = resolveUrl;
resolve.ids = resolveIds;
resolve.inlineRef = inlineRef;
resolve.schema = resolveSchema;

/**
 * [resolve and compile the references ($ref)]
 * @this   Ajv
 * @param  {Function} compile reference to schema compilation funciton (localCompile)
 * @param  {Object} root object with information about the root schema for the current schema
 * @param  {String} ref reference to resolve
 * @return {Object|Function} schema object (if the schema can be inlined) or validation function
 */
function resolve(compile, root, ref) {
  /* jshint validthis: true */
  var refVal = this._refs[ref];
  if (typeof refVal == 'string') {
    if (this._refs[refVal]) refVal = this._refs[refVal];
    else return resolve.call(this, compile, root, refVal);
  }

  refVal = refVal || this._schemas[ref];
  if (refVal instanceof SchemaObject) {
    return inlineRef(refVal.schema, this._opts.inlineRefs)
            ? refVal.schema
            : refVal.validate || this._compile(refVal);
  }

  var res = resolveSchema.call(this, root, ref);
  var schema, v, baseId;
  if (res) {
    schema = res.schema;
    root = res.root;
    baseId = res.baseId;
  }

  if (schema instanceof SchemaObject) {
    v = schema.validate || compile.call(this, schema.schema, root, undefined, baseId);
  } else if (schema !== undefined) {
    v = inlineRef(schema, this._opts.inlineRefs)
        ? schema
        : compile.call(this, schema, root, undefined, baseId);
  }

  return v;
}


/**
 * Resolve schema, its root and baseId
 * @this Ajv
 * @param  {Object} root root object with properties schema, refVal, refs
 * @param  {String} ref  reference to resolve
 * @return {Object} object with properties schema, root, baseId
 */
function resolveSchema(root, ref) {
  /* jshint validthis: true */
  var p = URI.parse(ref)
    , refPath = _getFullPath(p)
    , baseId = getFullPath(this._getId(root.schema));
  if (Object.keys(root.schema).length === 0 || refPath !== baseId) {
    var id = normalizeId(refPath);
    var refVal = this._refs[id];
    if (typeof refVal == 'string') {
      return resolveRecursive.call(this, root, refVal, p);
    } else if (refVal instanceof SchemaObject) {
      if (!refVal.validate) this._compile(refVal);
      root = refVal;
    } else {
      refVal = this._schemas[id];
      if (refVal instanceof SchemaObject) {
        if (!refVal.validate) this._compile(refVal);
        if (id == normalizeId(ref))
          return { schema: refVal, root: root, baseId: baseId };
        root = refVal;
      } else {
        return;
      }
    }
    if (!root.schema) return;
    baseId = getFullPath(this._getId(root.schema));
  }
  return getJsonPointer.call(this, p, baseId, root.schema, root);
}


/* @this Ajv */
function resolveRecursive(root, ref, parsedRef) {
  /* jshint validthis: true */
  var res = resolveSchema.call(this, root, ref);
  if (res) {
    var schema = res.schema;
    var baseId = res.baseId;
    root = res.root;
    var id = this._getId(schema);
    if (id) baseId = resolveUrl(baseId, id);
    return getJsonPointer.call(this, parsedRef, baseId, schema, root);
  }
}


var PREVENT_SCOPE_CHANGE = util.toHash(['properties', 'patternProperties', 'enum', 'dependencies', 'definitions']);
/* @this Ajv */
function getJsonPointer(parsedRef, baseId, schema, root) {
  /* jshint validthis: true */
  parsedRef.fragment = parsedRef.fragment || '';
  if (parsedRef.fragment.slice(0,1) != '/') return;
  var parts = parsedRef.fragment.split('/');

  for (var i = 1; i < parts.length; i++) {
    var part = parts[i];
    if (part) {
      part = util.unescapeFragment(part);
      schema = schema[part];
      if (schema === undefined) break;
      var id;
      if (!PREVENT_SCOPE_CHANGE[part]) {
        id = this._getId(schema);
        if (id) baseId = resolveUrl(baseId, id);
        if (schema.$ref) {
          var $ref = resolveUrl(baseId, schema.$ref);
          var res = resolveSchema.call(this, root, $ref);
          if (res) {
            schema = res.schema;
            root = res.root;
            baseId = res.baseId;
          }
        }
      }
    }
  }
  if (schema !== undefined && schema !== root.schema)
    return { schema: schema, root: root, baseId: baseId };
}


var SIMPLE_INLINED = util.toHash([
  'type', 'format', 'pattern',
  'maxLength', 'minLength',
  'maxProperties', 'minProperties',
  'maxItems', 'minItems',
  'maximum', 'minimum',
  'uniqueItems', 'multipleOf',
  'required', 'enum'
]);
function inlineRef(schema, limit) {
  if (limit === false) return false;
  if (limit === undefined || limit === true) return checkNoRef(schema);
  else if (limit) return countKeys(schema) <= limit;
}


function checkNoRef(schema) {
  var item;
  if (Array.isArray(schema)) {
    for (var i=0; i<schema.length; i++) {
      item = schema[i];
      if (typeof item == 'object' && !checkNoRef(item)) return false;
    }
  } else {
    for (var key in schema) {
      if (key == '$ref') return false;
      item = schema[key];
      if (typeof item == 'object' && !checkNoRef(item)) return false;
    }
  }
  return true;
}


function countKeys(schema) {
  var count = 0, item;
  if (Array.isArray(schema)) {
    for (var i=0; i<schema.length; i++) {
      item = schema[i];
      if (typeof item == 'object') count += countKeys(item);
      if (count == Infinity) return Infinity;
    }
  } else {
    for (var key in schema) {
      if (key == '$ref') return Infinity;
      if (SIMPLE_INLINED[key]) {
        count++;
      } else {
        item = schema[key];
        if (typeof item == 'object') count += countKeys(item) + 1;
        if (count == Infinity) return Infinity;
      }
    }
  }
  return count;
}


function getFullPath(id, normalize) {
  if (normalize !== false) id = normalizeId(id);
  var p = URI.parse(id);
  return _getFullPath(p);
}


function _getFullPath(p) {
  return URI.serialize(p).split('#')[0] + '#';
}


var TRAILING_SLASH_HASH = /#\/?$/;
function normalizeId(id) {
  return id ? id.replace(TRAILING_SLASH_HASH, '') : '';
}


function resolveUrl(baseId, id) {
  id = normalizeId(id);
  return URI.resolve(baseId, id);
}


/* @this Ajv */
function resolveIds(schema) {
  var schemaId = normalizeId(this._getId(schema));
  var baseIds = {'': schemaId};
  var fullPaths = {'': getFullPath(schemaId, false)};
  var localRefs = {};
  var self = this;

  traverse(schema, {allKeys: true}, function(sch, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
    if (jsonPtr === '') return;
    var id = self._getId(sch);
    var baseId = baseIds[parentJsonPtr];
    var fullPath = fullPaths[parentJsonPtr] + '/' + parentKeyword;
    if (keyIndex !== undefined)
      fullPath += '/' + (typeof keyIndex == 'number' ? keyIndex : util.escapeFragment(keyIndex));

    if (typeof id == 'string') {
      id = baseId = normalizeId(baseId ? URI.resolve(baseId, id) : id);

      var refVal = self._refs[id];
      if (typeof refVal == 'string') refVal = self._refs[refVal];
      if (refVal && refVal.schema) {
        if (!equal(sch, refVal.schema))
          throw new Error('id "' + id + '" resolves to more than one schema');
      } else if (id != normalizeId(fullPath)) {
        if (id[0] == '#') {
          if (localRefs[id] && !equal(sch, localRefs[id]))
            throw new Error('id "' + id + '" resolves to more than one schema');
          localRefs[id] = sch;
        } else {
          self._refs[id] = fullPath;
        }
      }
    }
    baseIds[jsonPtr] = baseId;
    fullPaths[jsonPtr] = fullPath;
  });

  return localRefs;
}

},{"./schema_obj":8,"./util":10,"fast-deep-equal":42,"json-schema-traverse":44,"uri-js":45}],7:[function(require,module,exports){
'use strict';

var ruleModules = require('../dotjs')
  , toHash = require('./util').toHash;

module.exports = function rules() {
  var RULES = [
    { type: 'number',
      rules: [ { 'maximum': ['exclusiveMaximum'] },
               { 'minimum': ['exclusiveMinimum'] }, 'multipleOf', 'format'] },
    { type: 'string',
      rules: [ 'maxLength', 'minLength', 'pattern', 'format' ] },
    { type: 'array',
      rules: [ 'maxItems', 'minItems', 'items', 'contains', 'uniqueItems' ] },
    { type: 'object',
      rules: [ 'maxProperties', 'minProperties', 'required', 'dependencies', 'propertyNames',
               { 'properties': ['additionalProperties', 'patternProperties'] } ] },
    { rules: [ '$ref', 'const', 'enum', 'not', 'anyOf', 'oneOf', 'allOf', 'if' ] }
  ];

  var ALL = [ 'type', '$comment' ];
  var KEYWORDS = [
    '$schema', '$id', 'id', '$data', '$async', 'title',
    'description', 'default', 'definitions',
    'examples', 'readOnly', 'writeOnly',
    'contentMediaType', 'contentEncoding',
    'additionalItems', 'then', 'else'
  ];
  var TYPES = [ 'number', 'integer', 'string', 'array', 'object', 'boolean', 'null' ];
  RULES.all = toHash(ALL);
  RULES.types = toHash(TYPES);

  RULES.forEach(function (group) {
    group.rules = group.rules.map(function (keyword) {
      var implKeywords;
      if (typeof keyword == 'object') {
        var key = Object.keys(keyword)[0];
        implKeywords = keyword[key];
        keyword = key;
        implKeywords.forEach(function (k) {
          ALL.push(k);
          RULES.all[k] = true;
        });
      }
      ALL.push(keyword);
      var rule = RULES.all[keyword] = {
        keyword: keyword,
        code: ruleModules[keyword],
        implements: implKeywords
      };
      return rule;
    });

    RULES.all.$comment = {
      keyword: '$comment',
      code: ruleModules.$comment
    };

    if (group.type) RULES.types[group.type] = group;
  });

  RULES.keywords = toHash(ALL.concat(KEYWORDS));
  RULES.custom = {};

  return RULES;
};

},{"../dotjs":27,"./util":10}],8:[function(require,module,exports){
'use strict';

var util = require('./util');

module.exports = SchemaObject;

function SchemaObject(obj) {
  util.copy(obj, this);
}

},{"./util":10}],9:[function(require,module,exports){
'use strict';

// https://mathiasbynens.be/notes/javascript-encoding
// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode
module.exports = function ucs2length(str) {
  var length = 0
    , len = str.length
    , pos = 0
    , value;
  while (pos < len) {
    length++;
    value = str.charCodeAt(pos++);
    if (value >= 0xD800 && value <= 0xDBFF && pos < len) {
      // high surrogate, and there is a next character
      value = str.charCodeAt(pos);
      if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate
    }
  }
  return length;
};

},{}],10:[function(require,module,exports){
'use strict';


module.exports = {
  copy: copy,
  checkDataType: checkDataType,
  checkDataTypes: checkDataTypes,
  coerceToTypes: coerceToTypes,
  toHash: toHash,
  getProperty: getProperty,
  escapeQuotes: escapeQuotes,
  equal: require('fast-deep-equal'),
  ucs2length: require('./ucs2length'),
  varOccurences: varOccurences,
  varReplace: varReplace,
  schemaHasRules: schemaHasRules,
  schemaHasRulesExcept: schemaHasRulesExcept,
  schemaUnknownRules: schemaUnknownRules,
  toQuotedString: toQuotedString,
  getPathExpr: getPathExpr,
  getPath: getPath,
  getData: getData,
  unescapeFragment: unescapeFragment,
  unescapeJsonPointer: unescapeJsonPointer,
  escapeFragment: escapeFragment,
  escapeJsonPointer: escapeJsonPointer
};


function copy(o, to) {
  to = to || {};
  for (var key in o) to[key] = o[key];
  return to;
}


function checkDataType(dataType, data, strictNumbers, negate) {
  var EQUAL = negate ? ' !== ' : ' === '
    , AND = negate ? ' || ' : ' && '
    , OK = negate ? '!' : ''
    , NOT = negate ? '' : '!';
  switch (dataType) {
    case 'null': return data + EQUAL + 'null';
    case 'array': return OK + 'Array.isArray(' + data + ')';
    case 'object': return '(' + OK + data + AND +
                          'typeof ' + data + EQUAL + '"object"' + AND +
                          NOT + 'Array.isArray(' + data + '))';
    case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND +
                           NOT + '(' + data + ' % 1)' +
                           AND + data + EQUAL + data +
                           (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')';
    case 'number': return '(typeof ' + data + EQUAL + '"' + dataType + '"' +
                          (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')';
    default: return 'typeof ' + data + EQUAL + '"' + dataType + '"';
  }
}


function checkDataTypes(dataTypes, data, strictNumbers) {
  switch (dataTypes.length) {
    case 1: return checkDataType(dataTypes[0], data, strictNumbers, true);
    default:
      var code = '';
      var types = toHash(dataTypes);
      if (types.array && types.object) {
        code = types.null ? '(': '(!' + data + ' || ';
        code += 'typeof ' + data + ' !== "object")';
        delete types.null;
        delete types.array;
        delete types.object;
      }
      if (types.number) delete types.integer;
      for (var t in types)
        code += (code ? ' && ' : '' ) + checkDataType(t, data, strictNumbers, true);

      return code;
  }
}


var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]);
function coerceToTypes(optionCoerceTypes, dataTypes) {
  if (Array.isArray(dataTypes)) {
    var types = [];
    for (var i=0; i<dataTypes.length; i++) {
      var t = dataTypes[i];
      if (COERCE_TO_TYPES[t]) types[types.length] = t;
      else if (optionCoerceTypes === 'array' && t === 'array') types[types.length] = t;
    }
    if (types.length) return types;
  } else if (COERCE_TO_TYPES[dataTypes]) {
    return [dataTypes];
  } else if (optionCoerceTypes === 'array' && dataTypes === 'array') {
    return ['array'];
  }
}


function toHash(arr) {
  var hash = {};
  for (var i=0; i<arr.length; i++) hash[arr[i]] = true;
  return hash;
}


var IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
var SINGLE_QUOTE = /'|\\/g;
function getProperty(key) {
  return typeof key == 'number'
          ? '[' + key + ']'
          : IDENTIFIER.test(key)
            ? '.' + key
            : "['" + escapeQuotes(key) + "']";
}


function escapeQuotes(str) {
  return str.replace(SINGLE_QUOTE, '\\$&')
            .replace(/\n/g, '\\n')
            .replace(/\r/g, '\\r')
            .replace(/\f/g, '\\f')
            .replace(/\t/g, '\\t');
}


function varOccurences(str, dataVar) {
  dataVar += '[^0-9]';
  var matches = str.match(new RegExp(dataVar, 'g'));
  return matches ? matches.length : 0;
}


function varReplace(str, dataVar, expr) {
  dataVar += '([^0-9])';
  expr = expr.replace(/\$/g, '$$$$');
  return str.replace(new RegExp(dataVar, 'g'), expr + '$1');
}


function schemaHasRules(schema, rules) {
  if (typeof schema == 'boolean') return !schema;
  for (var key in schema) if (rules[key]) return true;
}


function schemaHasRulesExcept(schema, rules, exceptKeyword) {
  if (typeof schema == 'boolean') return !schema && exceptKeyword != 'not';
  for (var key in schema) if (key != exceptKeyword && rules[key]) return true;
}


function schemaUnknownRules(schema, rules) {
  if (typeof schema == 'boolean') return;
  for (var key in schema) if (!rules[key]) return key;
}


function toQuotedString(str) {
  return '\'' + escapeQuotes(str) + '\'';
}


function getPathExpr(currentPath, expr, jsonPointers, isNumber) {
  var path = jsonPointers // false by default
              ? '\'/\' + ' + expr + (isNumber ? '' : '.replace(/~/g, \'~0\').replace(/\\//g, \'~1\')')
              : (isNumber ? '\'[\' + ' + expr + ' + \']\'' : '\'[\\\'\' + ' + expr + ' + \'\\\']\'');
  return joinPaths(currentPath, path);
}


function getPath(currentPath, prop, jsonPointers) {
  var path = jsonPointers // false by default
              ? toQuotedString('/' + escapeJsonPointer(prop))
              : toQuotedString(getProperty(prop));
  return joinPaths(currentPath, path);
}


var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
function getData($data, lvl, paths) {
  var up, jsonPointer, data, matches;
  if ($data === '') return 'rootData';
  if ($data[0] == '/') {
    if (!JSON_POINTER.test($data)) throw new Error('Invalid JSON-pointer: ' + $data);
    jsonPointer = $data;
    data = 'rootData';
  } else {
    matches = $data.match(RELATIVE_JSON_POINTER);
    if (!matches) throw new Error('Invalid JSON-pointer: ' + $data);
    up = +matches[1];
    jsonPointer = matches[2];
    if (jsonPointer == '#') {
      if (up >= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl);
      return paths[lvl - up];
    }

    if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl);
    data = 'data' + ((lvl - up) || '');
    if (!jsonPointer) return data;
  }

  var expr = data;
  var segments = jsonPointer.split('/');
  for (var i=0; i<segments.length; i++) {
    var segment = segments[i];
    if (segment) {
      data += getProperty(unescapeJsonPointer(segment));
      expr += ' && ' + data;
    }
  }
  return expr;
}


function joinPaths (a, b) {
  if (a == '""') return b;
  return (a + ' + ' + b).replace(/([^\\])' \+ '/g, '$1');
}


function unescapeFragment(str) {
  return unescapeJsonPointer(decodeURIComponent(str));
}


function escapeFragment(str) {
  return encodeURIComponent(escapeJsonPointer(str));
}


function escapeJsonPointer(str) {
  return str.replace(/~/g, '~0').replace(/\//g, '~1');
}


function unescapeJsonPointer(str) {
  return str.replace(/~1/g, '/').replace(/~0/g, '~');
}

},{"./ucs2length":9,"fast-deep-equal":42}],11:[function(require,module,exports){
'use strict';

var KEYWORDS = [
  'multipleOf',
  'maximum',
  'exclusiveMaximum',
  'minimum',
  'exclusiveMinimum',
  'maxLength',
  'minLength',
  'pattern',
  'additionalItems',
  'maxItems',
  'minItems',
  'uniqueItems',
  'maxProperties',
  'minProperties',
  'required',
  'additionalProperties',
  'enum',
  'format',
  'const'
];

module.exports = function (metaSchema, keywordsJsonPointers) {
  for (var i=0; i<keywordsJsonPointers.length; i++) {
    metaSchema = JSON.parse(JSON.stringify(metaSchema));
    var segments = keywordsJsonPointers[i].split('/');
    var keywords = metaSchema;
    var j;
    for (j=1; j<segments.length; j++)
      keywords = keywords[segments[j]];

    for (j=0; j<KEYWORDS.length; j++) {
      var key = KEYWORDS[j];
      var schema = keywords[key];
      if (schema) {
        keywords[key] = {
          anyOf: [
            schema,
            { $ref: 'https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#' }
          ]
        };
      }
    }
  }

  return metaSchema;
};

},{}],12:[function(require,module,exports){
'use strict';

var metaSchema = require('./refs/json-schema-draft-07.json');

module.exports = {
  $id: 'https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js',
  definitions: {
    simpleTypes: metaSchema.definitions.simpleTypes
  },
  type: 'object',
  dependencies: {
    schema: ['validate'],
    $data: ['validate'],
    statements: ['inline'],
    valid: {not: {required: ['macro']}}
  },
  properties: {
    type: metaSchema.properties.type,
    schema: {type: 'boolean'},
    statements: {type: 'boolean'},
    dependencies: {
      type: 'array',
      items: {type: 'string'}
    },
    metaSchema: {type: 'object'},
    modifying: {type: 'boolean'},
    valid: {type: 'boolean'},
    $data: {type: 'boolean'},
    async: {type: 'boolean'},
    errors: {
      anyOf: [
        {type: 'boolean'},
        {const: 'full'}
      ]
    }
  }
};

},{"./refs/json-schema-draft-07.json":41}],13:[function(require,module,exports){
'use strict';
module.exports = function generate__limit(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $errorKeyword;
  var $data = 'data' + ($dataLvl || '');
  var $isData = it.opts.$data && $schema && $schema.$data,
    $schemaValue;
  if ($isData) {
    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
    $schemaValue = 'schema' + $lvl;
  } else {
    $schemaValue = $schema;
  }
  var $isMax = $keyword == 'maximum',
    $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum',
    $schemaExcl = it.schema[$exclusiveKeyword],
    $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data,
    $op = $isMax ? '<' : '>',
    $notOp = $isMax ? '>' : '<',
    $errorKeyword = undefined;
  if (!($isData || typeof $schema == 'number' || $schema === undefined)) {
    throw new Error($keyword + ' must be number');
  }
  if (!($isDataExcl || $schemaExcl === undefined || typeof $schemaExcl == 'number' || typeof $schemaExcl == 'boolean')) {
    throw new Error($exclusiveKeyword + ' must be number or boolean');
  }
  if ($isDataExcl) {
    var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr),
      $exclusive = 'exclusive' + $lvl,
      $exclType = 'exclType' + $lvl,
      $exclIsNumber = 'exclIsNumber' + $lvl,
      $opExpr = 'op' + $lvl,
      $opStr = '\' + ' + $opExpr + ' + \'';
    out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; ';
    $schemaValueExcl = 'schemaExcl' + $lvl;
    out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \'boolean\' && ' + ($exclType) + ' != \'undefined\' && ' + ($exclType) + ' != \'number\') { ';
    var $errorKeyword = $exclusiveKeyword;
    var $$outStack = $$outStack || [];
    $$outStack.push(out);
    out = ''; /* istanbul ignore else */
    if (it.createErrors !== false) {
      out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
      if (it.opts.messages !== false) {
        out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' ';
      }
      if (it.opts.verbose) {
        out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
      }
      out += ' } ';
    } else {
      out += ' {} ';
    }
    var __err = out;
    out = $$outStack.pop();
    if (!it.compositeRule && $breakOnError) {
      /* istanbul ignore if */
      if (it.async) {
        out += ' throw new ValidationError([' + (__err) + ']); ';
      } else {
        out += ' validate.errors = [' + (__err) + ']; return false; ';
      }
    } else {
      out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
    }
    out += ' } else if ( ';
    if ($isData) {
      out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
    }
    out += ' ' + ($exclType) + ' == \'number\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\'; ';
    if ($schema === undefined) {
      $errorKeyword = $exclusiveKeyword;
      $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;
      $schemaValue = $schemaValueExcl;
      $isData = $isDataExcl;
    }
  } else {
    var $exclIsNumber = typeof $schemaExcl == 'number',
      $opStr = $op;
    if ($exclIsNumber && $isData) {
      var $opExpr = '\'' + $opStr + '\'';
      out += ' if ( ';
      if ($isData) {
        out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
      }
      out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { ';
    } else {
      if ($exclIsNumber && $schema === undefined) {
        $exclusive = true;
        $errorKeyword = $exclusiveKeyword;
        $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;
        $schemaValue = $schemaExcl;
        $notOp += '=';
      } else {
        if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema);
        if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) {
          $exclusive = true;
          $errorKeyword = $exclusiveKeyword;
          $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;
          $notOp += '=';
        } else {
          $exclusive = false;
          $opStr += '=';
        }
      }
      var $opExpr = '\'' + $opStr + '\'';
      out += ' if ( ';
      if ($isData) {
        out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
      }
      out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { ';
    }
  }
  $errorKeyword = $errorKeyword || $keyword;
  var $$outStack = $$outStack || [];
  $$outStack.push(out);
  out = ''; /* istanbul ignore else */
  if (it.createErrors !== false) {
    out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } ';
    if (it.opts.messages !== false) {
      out += ' , message: \'should be ' + ($opStr) + ' ';
      if ($isData) {
        out += '\' + ' + ($schemaValue);
      } else {
        out += '' + ($schemaValue) + '\'';
      }
    }
    if (it.opts.verbose) {
      out += ' , schema:  ';
      if ($isData) {
        out += 'validate.schema' + ($schemaPath);
      } else {
        out += '' + ($schema);
      }
      out += '         , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
    }
    out += ' } ';
  } else {
    out += ' {} ';
  }
  var __err = out;
  out = $$outStack.pop();
  if (!it.compositeRule && $breakOnError) {
    /* istanbul ignore if */
    if (it.async) {
      out += ' throw new ValidationError([' + (__err) + ']); ';
    } else {
      out += ' validate.errors = [' + (__err) + ']; return false; ';
    }
  } else {
    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  }
  out += ' } ';
  if ($breakOnError) {
    out += ' else { ';
  }
  return out;
}

},{}],14:[function(require,module,exports){
'use strict';
module.exports = function generate__limitItems(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $errorKeyword;
  var $data = 'data' + ($dataLvl || '');
  var $isData = it.opts.$data && $schema && $schema.$data,
    $schemaValue;
  if ($isData) {
    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
    $schemaValue = 'schema' + $lvl;
  } else {
    $schemaValue = $schema;
  }
  if (!($isData || typeof $schema == 'number')) {
    throw new Error($keyword + ' must be number');
  }
  var $op = $keyword == 'maxItems' ? '>' : '<';
  out += 'if ( ';
  if ($isData) {
    out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
  }
  out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { ';
  var $errorKeyword = $keyword;
  var $$outStack = $$outStack || [];
  $$outStack.push(out);
  out = ''; /* istanbul ignore else */
  if (it.createErrors !== false) {
    out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';
    if (it.opts.messages !== false) {
      out += ' , message: \'should NOT have ';
      if ($keyword == 'maxItems') {
        out += 'more';
      } else {
        out += 'fewer';
      }
      out += ' than ';
      if ($isData) {
        out += '\' + ' + ($schemaValue) + ' + \'';
      } else {
        out += '' + ($schema);
      }
      out += ' items\' ';
    }
    if (it.opts.verbose) {
      out += ' , schema:  ';
      if ($isData) {
        out += 'validate.schema' + ($schemaPath);
      } else {
        out += '' + ($schema);
      }
      out += '         , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
    }
    out += ' } ';
  } else {
    out += ' {} ';
  }
  var __err = out;
  out = $$outStack.pop();
  if (!it.compositeRule && $breakOnError) {
    /* istanbul ignore if */
    if (it.async) {
      out += ' throw new ValidationError([' + (__err) + ']); ';
    } else {
      out += ' validate.errors = [' + (__err) + ']; return false; ';
    }
  } else {
    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  }
  out += '} ';
  if ($breakOnError) {
    out += ' else { ';
  }
  return out;
}

},{}],15:[function(require,module,exports){
'use strict';
module.exports = function generate__limitLength(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $errorKeyword;
  var $data = 'data' + ($dataLvl || '');
  var $isData = it.opts.$data && $schema && $schema.$data,
    $schemaValue;
  if ($isData) {
    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
    $schemaValue = 'schema' + $lvl;
  } else {
    $schemaValue = $schema;
  }
  if (!($isData || typeof $schema == 'number')) {
    throw new Error($keyword + ' must be number');
  }
  var $op = $keyword == 'maxLength' ? '>' : '<';
  out += 'if ( ';
  if ($isData) {
    out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
  }
  if (it.opts.unicode === false) {
    out += ' ' + ($data) + '.length ';
  } else {
    out += ' ucs2length(' + ($data) + ') ';
  }
  out += ' ' + ($op) + ' ' + ($schemaValue) + ') { ';
  var $errorKeyword = $keyword;
  var $$outStack = $$outStack || [];
  $$outStack.push(out);
  out = ''; /* istanbul ignore else */
  if (it.createErrors !== false) {
    out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';
    if (it.opts.messages !== false) {
      out += ' , message: \'should NOT be ';
      if ($keyword == 'maxLength') {
        out += 'longer';
      } else {
        out += 'shorter';
      }
      out += ' than ';
      if ($isData) {
        out += '\' + ' + ($schemaValue) + ' + \'';
      } else {
        out += '' + ($schema);
      }
      out += ' characters\' ';
    }
    if (it.opts.verbose) {
      out += ' , schema:  ';
      if ($isData) {
        out += 'validate.schema' + ($schemaPath);
      } else {
        out += '' + ($schema);
      }
      out += '         , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
    }
    out += ' } ';
  } else {
    out += ' {} ';
  }
  var __err = out;
  out = $$outStack.pop();
  if (!it.compositeRule && $breakOnError) {
    /* istanbul ignore if */
    if (it.async) {
      out += ' throw new ValidationError([' + (__err) + ']); ';
    } else {
      out += ' validate.errors = [' + (__err) + ']; return false; ';
    }
  } else {
    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  }
  out += '} ';
  if ($breakOnError) {
    out += ' else { ';
  }
  return out;
}

},{}],16:[function(require,module,exports){
'use strict';
module.exports = function generate__limitProperties(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $errorKeyword;
  var $data = 'data' + ($dataLvl || '');
  var $isData = it.opts.$data && $schema && $schema.$data,
    $schemaValue;
  if ($isData) {
    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
    $schemaValue = 'schema' + $lvl;
  } else {
    $schemaValue = $schema;
  }
  if (!($isData || typeof $schema == 'number')) {
    throw new Error($keyword + ' must be number');
  }
  var $op = $keyword == 'maxProperties' ? '>' : '<';
  out += 'if ( ';
  if ($isData) {
    out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
  }
  out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { ';
  var $errorKeyword = $keyword;
  var $$outStack = $$outStack || [];
  $$outStack.push(out);
  out = ''; /* istanbul ignore else */
  if (it.createErrors !== false) {
    out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';
    if (it.opts.messages !== false) {
      out += ' , message: \'should NOT have ';
      if ($keyword == 'maxProperties') {
        out += 'more';
      } else {
        out += 'fewer';
      }
      out += ' than ';
      if ($isData) {
        out += '\' + ' + ($schemaValue) + ' + \'';
      } else {
        out += '' + ($schema);
      }
      out += ' properties\' ';
    }
    if (it.opts.verbose) {
      out += ' , schema:  ';
      if ($isData) {
        out += 'validate.schema' + ($schemaPath);
      } else {
        out += '' + ($schema);
      }
      out += '         , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
    }
    out += ' } ';
  } else {
    out += ' {} ';
  }
  var __err = out;
  out = $$outStack.pop();
  if (!it.compositeRule && $breakOnError) {
    /* istanbul ignore if */
    if (it.async) {
      out += ' throw new ValidationError([' + (__err) + ']); ';
    } else {
      out += ' validate.errors = [' + (__err) + ']; return false; ';
    }
  } else {
    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  }
  out += '} ';
  if ($breakOnError) {
    out += ' else { ';
  }
  return out;
}

},{}],17:[function(require,module,exports){
'use strict';
module.exports = function generate_allOf(it, $keyword, $ruleType) {
  var out = ' ';
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $it = it.util.copy(it);
  var $closingBraces = '';
  $it.level++;
  var $nextValid = 'valid' + $it.level;
  var $currentBaseId = $it.baseId,
    $allSchemasEmpty = true;
  var arr1 = $schema;
  if (arr1) {
    var $sch, $i = -1,
      l1 = arr1.length - 1;
    while ($i < l1) {
      $sch = arr1[$i += 1];
      if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
        $allSchemasEmpty = false;
        $it.schema = $sch;
        $it.schemaPath = $schemaPath + '[' + $i + ']';
        $it.errSchemaPath = $errSchemaPath + '/' + $i;
        out += '  ' + (it.validate($it)) + ' ';
        $it.baseId = $currentBaseId;
        if ($breakOnError) {
          out += ' if (' + ($nextValid) + ') { ';
          $closingBraces += '}';
        }
      }
    }
  }
  if ($breakOnError) {
    if ($allSchemasEmpty) {
      out += ' if (true) { ';
    } else {
      out += ' ' + ($closingBraces.slice(0, -1)) + ' ';
    }
  }
  return out;
}

},{}],18:[function(require,module,exports){
'use strict';
module.exports = function generate_anyOf(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  va   r $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $valid = 'valid' + $lvl;
  var $errs = 'errs__' + $lvl;
  var $it = it.util.copy(it);
  var $closingBraces = '';
  $it.level++;
  var $nextValid = 'valid' + $it.level;
  var $noEmptySchema = $schema.every(function($sch) {
    return (it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all));
  });
  if ($noEmptySchema) {
    var $currentBaseId = $it.baseId;
    out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false;  ';
    var $wasComposite = it.compositeRule;
    it.compositeRule = $it.compositeRule = true;
    var arr1 = $schema;
    if (arr1) {
      var $sch, $i = -1,
        l1 = arr1.length - 1;
      while ($i < l1) {
        $sch = arr1[$i += 1];
        $it.schema = $sch;
        $it.schemaPath = $schemaPath + '[' + $i + ']';
        $it.errSchemaPath = $errSchemaPath + '/' + $i;
        out += '  ' + (it.validate($it)) + ' ';
        $it.baseId = $currentBaseId;
        out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { ';
        $closingBraces += '}';
      }
    }
    it.compositeRule = $it.compositeRule = $wasComposite;
    out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') {   var err =   '; /* istanbul ignore else */
    if (it.createErrors !== false) {
      out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
      if (it.opts.messages !== false) {
        out += ' , message: \'should match some schema in anyOf\' ';
      }
      if (it.opts.verbose) {
        out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
      }
      out += ' } ';
    } else {
      out += ' {} ';
    }
    out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
    if (!it.compositeRule && $breakOnError) {
      /* istanbul ignore if */
      if (it.async) {
        out += ' throw new ValidationError(vErrors); ';
      } else {
        out += ' validate.errors = vErrors; return false; ';
      }
    }
    out += ' } else {  errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';
    if (it.opts.allErrors) {
      out += ' } ';
    }
  } else {
    if ($breakOnError) {
      out += ' if (true) { ';
    }
  }
  return out;
}

},{}],19:[function(require,module,exports){
'use strict';
module.exports = function generate_comment(it, $keyword, $ruleType) {
  var out = ' ';
  var $schema = it.schema[$keyword];
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $comment = it.util.toQuotedString($schema);
  if (it.opts.$comment === true) {
    out += ' console.log(' + ($comment) + ');';
  } else if (typeof it.opts.$comment == 'function') {
    out += ' self._opts.$comment(' + ($comment) + ', ' + (it.util.toQuotedString($errSchemaPath)) + ', validate.root.schema);';
  }
  return out;
}

},{}],20:[function(require,module,exports){
'use strict';
module.exports = function generate_const(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $valid = 'valid' + $lvl;
  var $isData = it.opts.$data && $schema && $schema.$data,
    $schemaValue;
  if ($isData) {
    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
    $schemaValue = 'schema' + $lvl;
  } else {
    $schemaValue = $schema;
  }
  if (!$isData) {
    out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';';
  }
  out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') {   ';
  var $$outStack = $$outStack || [];
  $$outStack.push(out);
  out = ''; /* istanbul ignore else */
  if (it.createErrors !== false) {
    out += ' { keyword: \'' + ('const') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValue: schema' + ($lvl) + ' } ';
    if (it.opts.messages !== false) {
      out += ' , message: \'should be equal to constant\' ';
    }
    if (it.opts.verbose) {
      out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
    }
    out += ' } ';
  } else {
    out += ' {} ';
  }
  var __err = out;
  out = $$outStack.pop();
  if (!it.compositeRule && $breakOnError) {
    /* istanbul ignore if */
    if (it.async) {
      out += ' throw new ValidationError([' + (__err) + ']); ';
    } else {
      out += ' validate.errors = [' + (__err) + ']; return false; ';
    }
  } else {
    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  }
  out += ' }';
  if ($breakOnError) {
    out += ' else { ';
  }
  return out;
}

},{}],21:[function(require,module,exports){
'use strict';
module.exports = function generate_contains(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $valid = 'valid' + $lvl;
  var $errs = 'errs__' + $lvl;
  var $it = it.util.copy(it);
  var $closingBraces = '';
  $it.level++;
  var $nextValid = 'valid' + $it.level;
  var $idx = 'i' + $lvl,
    $dataNxt = $it.dataLevel = it.dataLevel + 1,
    $nextData = 'data' + $dataNxt,
    $currentBaseId = it.baseId,
    $nonEmptySchema = (it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all));
  out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';
  if ($nonEmptySchema) {
    var $wasComposite = it.compositeRule;
    it.compositeRule = $it.compositeRule = true;
    $it.schema = $schema;
    $it.schemaPath = $schemaPath;
    $it.errSchemaPath = $errSchemaPath;
    out += ' var ' + ($nextValid) + ' = false; for (var ' + ($idx) + ' = 0; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';
    $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);
    var $passData = $data + '[' + $idx + ']';
    $it.dataPathArr[$dataNxt] = $idx;
    var $code = it.validate($it);
    $it.baseId = $currentBaseId;
    if (it.util.varOccurences($code, $nextData) < 2) {
      out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
    } else {
      out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
    }
    out += ' if (' + ($nextValid) + ') break; }  ';
    it.compositeRule = $it.compositeRule = $wasComposite;
    out += ' ' + ($closingBraces) + ' if (!' + ($nextValid) + ') {';
  } else {
    out += ' if (' + ($data) + '.length == 0) {';
  }
  var $$outStack = $$outStack || [];
  $$outStack.push(out);
  out = ''; /* istanbul ignore else */
  if (it.createErrors !== false) {
    out += ' { keyword: \'' + ('contains') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
    if (it.opts.messages !== false) {
      out += ' , message: \'should contain a valid item\' ';
    }
    if (it.opts.verbose) {
      out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
    }
    out += ' } ';
  } else {
    out += ' {} ';
  }
  var __err = out;
  out = $$outStack.pop();
  if (!it.compositeRule && $breakOnError) {
    /* istanbul ignore if */
    if (it.async) {
      out += ' throw new ValidationError([' + (__err) + ']); ';
    } else {
      out += ' validate.errors = [' + (__err) + ']; return false; ';
    }
  } else {
    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  }
  out += ' } else { ';
  if ($nonEmptySchema) {
    out += '  errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';
  }
  if (it.opts.allErrors) {
    out += ' } ';
  }
  return out;
}

},{}],22:[function(require,module,exports){
'use strict';
module.exports = function generate_custom(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $errorKeyword;
  var $data = 'data' + ($dataLvl || '');
  var $valid = 'valid' + $lvl;
  var $errs = 'errs__' + $lvl;
  var $isData = it.opts.$data && $schema && $schema.$data,
    $schemaValue;
  if ($isData) {
    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
    $schemaValue = 'schema' + $lvl;
  } else {
    $schemaValue = $schema;
  }
  var $rule = this,
    $definition = 'definition' + $lvl,
    $rDef = $rule.definition,
    $closingBraces = '';
  var $compile, $inline, $macro, $ruleValidate, $validateCode;
  if ($isData && $rDef.$data) {
    $validateCode = 'keywordValidate' + $lvl;
    var $validateSchema = $rDef.validateSchema;
    out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;';
  } else {
    $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it);
    if (!$ruleValidate) return;
    $schemaValue = 'validate.schema' + $schemaPath;
    $validateCode = $ruleValidate.code;
    $compile = $rDef.compile;
    $inline = $rDef.inline;
    $macro = $rDef.macro;
  }
  var $ruleErrs = $validateCode + '.errors',
    $i = 'i' + $lvl,
    $ruleErr = 'ruleErr' + $lvl,
    $asyncKeyword = $rDef.async;
  if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema');
  if (!($inline || $macro)) {
    out += '' + ($ruleErrs) + ' = null;';
  }
  out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';
  if ($isData && $rDef.$data) {
    $closingBraces += '}';
    out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { ';
    if ($validateSchema) {
      $closingBraces += '}';
      out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { ';
    }
  }
  if ($inline) {
    if ($rDef.statements) {
      out += ' ' + ($ruleValidate.validate) + ' ';
    } else {
      out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; ';
    }
  } else if ($macro) {
    var $it = it.util.copy(it);
    var $closingBraces = '';
    $it.level++;
    var $nextValid = 'valid' + $it.level;
    $it.schema = $ruleValidate.validate;
    $it.schemaPath = '';
    var $wasComposite = it.compositeRule;
    it.compositeRule = $it.compositeRule = true;
    var $code = it.validate($it).replace(/validate\.schema/g, $validateCode);
    it.compositeRule = $it.compositeRule = $wasComposite;
    out += ' ' + ($code);
  } else {
    var $$outStack = $$outStack || [];
    $$outStack.push(out);
    out = '';
    out += '  ' + ($validateCode) + '.call( ';
    if (it.opts.passContext) {
      out += 'this';
    } else {
      out += 'self';
    }
    if ($compile || $rDef.schema === false) {
      out += ' , ' + ($data) + ' ';
    } else {
      out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' ';
    }
    out += ' , (dataPath || \'\')';
    if (it.errorPath != '""') {
      out += ' + ' + (it.errorPath);
    }
    var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',
      $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';
    out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData )  ';
    var def_callRuleValidate = out;
    out = $$outStack.pop();
    if ($rDef.errors === false) {
      out += ' ' + ($valid) + ' = ';
      if ($asyncKeyword) {
        out += 'await ';
      }
      out += '' + (def_callRuleValidate) + '; ';
    } else {
      if ($asyncKeyword) {
        $ruleErrs = 'customErrors' + $lvl;
        out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = await ' + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } ';
      } else {
        out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; ';
      }
    }
  }
  if ($rDef.modifying) {
    out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];';
  }
  out += '' + ($closingBraces);
  if ($rDef.valid) {
    if ($breakOnError) {
      out += ' if (true) { ';
    }
  } else {
    out += ' if ( ';
    if ($rDef.valid === undefined) {
      out += ' !';
      if ($macro) {
        out += '' + ($nextValid);
      } else {
        out += '' + ($valid);
      }
    } else {
      out += ' ' + (!$rDef.valid) + ' ';
    }
    out += ') { ';
    $errorKeyword = $rule.keyword;
    var $$outStack = $$outStack || [];
    $$outStack.push(out);
    out = '';
    var $$outStack = $$outStack || [];
    $$outStack.push(out);
    out = ''; /* istanbul ignore else */
    if (it.createErrors !== false) {
      out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } ';
      if (it.opts.messages !== false) {
        out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' ';
      }
      if (it.opts.verbose) {
        out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
      }
      out += ' } ';
    } else {
      out += ' {} ';
    }
    var __err = out;
    out = $$outStack.pop();
    if (!it.compositeRule && $breakOnError) {
      /* istanbul ignore if */
      if (it.async) {
        out += ' throw new ValidationError([' + (__err) + ']); ';
      } else {
        out += ' validate.errors = [' + (__err) + ']; return false; ';
      }
    } else {
      out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
    }
    var def_customError = out;
    out = $$outStack.pop();
    if ($inline) {
      if ($rDef.errors) {
        if ($rDef.errors != 'full') {
          out += '  for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; } ';
          if (it.opts.verbose) {
            out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';
          }
          out += ' } ';
        }
      } else {
        if ($rDef.errors === false) {
          out += ' ' + (def_customError) + ' ';
        } else {
          out += ' if (' + ($errs) + ' == errors) { ' + (def_customError) + ' } else {  for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; } ';
          if (it.opts.verbose) {
            out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';
          }
          out += ' } } ';
        }
      }
    } else if ($macro) {
      out += '   var err =   '; /* istanbul ignore else */
      if (it.createErrors !== false) {
        out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } ';
        if (it.opts.messages !== false) {
          out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' ';
        }
        if (it.opts.verbose) {
          out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
        }
        out += ' } ';
      } else {
        out += ' {} ';
      }
      out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
      if (!it.compositeRule && $breakOnError) {
        /* istanbul ignore if */
        if (it.async) {
          out += ' throw new ValidationError(vErrors); ';
        } else {
          out += ' validate.errors = vErrors; return false; ';
        }
      }
    } else {
      if ($rDef.errors === false) {
        out += ' ' + (def_customError) + ' ';
      } else {
        out += ' if (Array.isArray(' + ($ruleErrs) + ')) { if (vErrors === null) vErrors = ' + ($ruleErrs) + '; else vErrors = vErrors.concat(' + ($ruleErrs) + '); errors = vErrors.length;  for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + ';  ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '";  ';
        if (it.opts.verbose) {
          out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';
        }
        out += ' } } else { ' + (def_customError) + ' } ';
      }
    }
    out += ' } ';
    if ($breakOnError) {
      out += ' else { ';
    }
  }
  return out;
}

},{}],23:[function(require,module,exports){
'use strict';
module.exports = function generate_dependencies(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $errs = 'errs__' + $lvl;
  var $it = it.util.copy(it);
  var $closingBraces = '';
  $it.level++;
  var $nextValid = 'valid' + $it.level;
  var $schemaDeps = {},
    $propertyDeps = {},
    $ownProperties = it.opts.ownProperties;
  for ($property in $schema) {
    if ($property == '__proto__') continue;
    var $sch = $schema[$property];
    var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps;
    $deps[$property] = $sch;
  }
  out += 'var ' + ($errs) + ' = errors;';
  var $currentErrorPath = it.errorPath;
  out += 'var missing' + ($lvl) + ';';
  for (var $property in $propertyDeps) {
    $deps = $propertyDeps[$property];
    if ($deps.length) {
      out += ' if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined ';
      if ($ownProperties) {
        out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') ';
      }
      if ($breakOnError) {
        out += ' && ( ';
        var arr1 = $deps;
        if (arr1) {
          var $propertyKey, $i = -1,
            l1 = arr1.length - 1;
          while ($i < l1) {
            $propertyKey = arr1[$i += 1];
            if ($i) {
              out += ' || ';
            }
            var $prop = it.util.getProperty($propertyKey),
              $useData = $data + $prop;
            out += ' ( ( ' + ($useData) + ' === undefined ';
            if ($ownProperties) {
              out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
            }
            out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) ';
          }
        }
        out += ')) {  ';
        var $propertyPath = 'missing' + $lvl,
          $missingProperty = '\' + ' + $propertyPath + ' + \'';
        if (it.opts._errorDataPathProperty) {
          it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath;
        }
        var $$outStack = $$outStack || [];
        $$outStack.push(out);
        out = ''; /* istanbul ignore else */
        if (it.createErrors !== false) {
          out += ' { keyword: \'' + ('dependencies') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \'' + (it.util.escapeQuotes($property)) + '\', missingProperty: \'' + ($missingProperty) + '\', depsCount: ' + ($deps.length) + ', deps: \'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", "))) + '\' } ';
          if (it.opts.messages !== false) {
            out += ' , message: \'should have ';
            if ($deps.length == 1) {
              out += 'property ' + (it.util.escapeQuotes($deps[0]));
            } else {
              out += 'properties ' + (it.util.escapeQuotes($deps.join(", ")));
            }
            out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\' ';
          }
          if (it.opts.verbose) {
            out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
          }
          out += ' } ';
        } else {
          out += ' {} ';
        }
        var __err = out;
        out = $$outStack.pop();
        if (!it.compositeRule && $breakOnError) {
          /* istanbul ignore if */
          if (it.async) {
            out += ' throw new ValidationError([' + (__err) + ']); ';
          } else {
            out += ' validate.errors = [' + (__err) + ']; return false; ';
          }
        } else {
          out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
        }
      } else {
        out += ' ) { ';
        var arr2 = $deps;
        if (arr2) {
          var $propertyKey, i2 = -1,
            l2 = arr2.length - 1;
          while (i2 < l2) {
            $propertyKey = arr2[i2 += 1];
            var $prop = it.util.getProperty($propertyKey),
              $missingProperty = it.util.escapeQuotes($propertyKey),
              $useData = $data + $prop;
            if (it.opts._errorDataPathProperty) {
              it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
            }
            out += ' if ( ' + ($useData) + ' === undefined ';
            if ($ownProperties) {
              out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
            }
            out += ') {  var err =   '; /* istanbul ignore else */
            if (it.createErrors !== false) {
              out += ' { keyword: \'' + ('dependencies') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \'' + (it.util.escapeQuotes($property)) + '\', missingProperty: \'' + ($missingProperty) + '\', depsCount: ' + ($deps.length) + ', deps: \'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", "))) + '\' } ';
              if (it.opts.messages !== false) {
                out += ' , message: \'should have ';
                if ($deps.length == 1) {
                  out += 'property ' + (it.util.escapeQuotes($deps[0]));
                } else {
                  out += 'properties ' + (it.util.escapeQuotes($deps.join(", ")));
                }
                out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\' ';
              }
              if (it.opts.verbose) {
                out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
              }
              out += ' } ';
            } else {
              out += ' {} ';
            }
            out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ';
          }
        }
      }
      out += ' }   ';
      if ($breakOnError) {
        $closingBraces += '}';
        out += ' else { ';
      }
    }
  }
  it.errorPath = $currentErrorPath;
  var $currentBaseId = $it.baseId;
  for (var $property in $schemaDeps) {
    var $sch = $schemaDeps[$property];
    if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
      out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined ';
      if ($ownProperties) {
        out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') ';
      }
      out += ') { ';
      $it.schema = $sch;
      $it.schemaPath = $schemaPath + it.util.getProperty($property);
      $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property);
      out += '  ' + (it.validate($it)) + ' ';
      $it.baseId = $currentBaseId;
      out += ' }  ';
      if ($breakOnError) {
        out += ' if (' + ($nextValid) + ') { ';
        $closingBraces += '}';
      }
    }
  }
  if ($breakOnError) {
    out += '   ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
  }
  return out;
}

},{}],24:[function(require,module,exports){
'use strict';
module.exports = function generate_enum(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $valid = 'valid' + $lvl;
  var $isData = it.opts.$data && $schema && $schema.$data,
    $schemaValue;
  if ($isData) {
    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
    $schemaValue = 'schema' + $lvl;
  } else {
    $schemaValue = $schema;
  }
  var $i = 'i' + $lvl,
    $vSchema = 'schema' + $lvl;
  if (!$isData) {
    out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + ';';
  }
  out += 'var ' + ($valid) + ';';
  if ($isData) {
    out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {';
  }
  out += '' + ($valid) + ' = false;for (var ' + ($i) + '=0; ' + ($i) + '<' + ($vSchema) + '.length; ' + ($i) + '++) if (equal(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + '])) { ' + ($valid) + ' = true; break; }';
  if ($isData) {
    out += '  }  ';
  }
  out += ' if (!' + ($valid) + ') {   ';
  var $$outStack = $$outStack || [];
  $$outStack.push(out);
  out = ''; /* istanbul ignore else */
  if (it.createErrors !== false) {
    out += ' { keyword: \'' + ('enum') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValues: schema' + ($lvl) + ' } ';
    if (it.opts.messages !== false) {
      out += ' , message: \'should be equal to one of the allowed values\' ';
    }
    if (it.opts.verbose) {
      out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
    }
    out += ' } ';
  } else {
    out += ' {} ';
  }
  var __err = out;
  out = $$outStack.pop();
  if (!it.compositeRule && $breakOnError) {
    /* istanbul ignore if */
    if (it.async) {
      out += ' throw new ValidationError([' + (__err) + ']); ';
    } else {
      out += ' validate.errors = [' + (__err) + ']; return false; ';
    }
  } else {
    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  }
  out += ' }';
  if ($breakOnError) {
    out += ' else { ';
  }
  return out;
}

},{}],25:[function(require,module,exports){
'use strict';
module.exports = function generate_format(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  if (it.opts.format === false) {
    if ($breakOnError) {
      out += ' if (true) { ';
    }
    return out;
  }
  var $isData = it.opts.$data && $schema && $schema.$data,
    $schemaValue;
  if ($isData) {
    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
    $schemaValue = 'schema' + $lvl;
  } else {
    $schemaValue = $schema;
  }
  var $unknownFormats = it.opts.unknownFormats,
    $allowUnknown = Array.isArray($unknownFormats);
  if ($isData) {
    var $format = 'format' + $lvl,
      $isObject = 'isObject' + $lvl,
      $formatType = 'formatType' + $lvl;
    out += ' var ' + ($format) + ' = formats[' + ($schemaValue) + ']; var ' + ($isObject) + ' = typeof ' + ($format) + ' == \'object\' && !(' + ($format) + ' instanceof RegExp) && ' + ($format) + '.validate; var ' + ($formatType) + ' = ' + ($isObject) + ' && ' + ($format) + '.type || \'string\'; if (' + ($isObject) + ') { ';
    if (it.async) {
      out += ' var async' + ($lvl) + ' = ' + ($format) + '.async; ';
    }
    out += ' ' + ($format) + ' = ' + ($format) + '.validate; } if (  ';
    if ($isData) {
      out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || ';
    }
    out += ' (';
    if ($unknownFormats != 'ignore') {
      out += ' (' + ($schemaValue) + ' && !' + ($format) + ' ';
      if ($allowUnknown) {
        out += ' && self._opts.unknownFormats.indexOf(' + ($schemaValue) + ') == -1 ';
      }
      out += ') || ';
    }
    out += ' (' + ($format) + ' && ' + ($formatType) + ' == \'' + ($ruleType) + '\' && !(typeof ' + ($format) + ' == \'function\' ? ';
    if (it.async) {
      out += ' (async' + ($lvl) + ' ? await ' + ($format) + '(' + ($data) + ') : ' + ($format) + '(' + ($data) + ')) ';
    } else {
      out += ' ' + ($format) + '(' + ($data) + ') ';
    }
    out += ' : ' + ($format) + '.test(' + ($data) + '))))) {';
  } else {
    var $format = it.formats[$schema];
    if (!$format) {
      if ($unknownFormats == 'ignore') {
        it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"');
        if ($breakOnError) {
          out += ' if (true) { ';
        }
        return out;
      } else if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) {
        if ($breakOnError) {
          out += ' if (true) { ';
        }
        return out;
      } else {
        throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"');
      }
    }
    var $isObject = typeof $format == 'object' && !($format instanceof RegExp) && $format.validate;
    var $formatType = $isObject && $format.type || 'string';
    if ($isObject) {
      var $async = $format.async === true;
      $format = $format.validate;
    }
    if ($formatType != $ruleType) {
      if ($breakOnError) {
        out += ' if (true) { ';
      }
      return out;
    }
    if ($async) {
      if (!it.async) throw new Error('async format in sync schema');
      var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate';
      out += ' if (!(await ' + ($formatRef) + '(' + ($data) + '))) { ';
    } else {
      out += ' if (! ';
      var $formatRef = 'formats' + it.util.getProperty($schema);
      if ($isObject) $formatRef += '.validate';
      if (typeof $format == 'function') {
        out += ' ' + ($formatRef) + '(' + ($data) + ') ';
      } else {
        out += ' ' + ($formatRef) + '.test(' + ($data) + ') ';
      }
      out += ') { ';
    }
  }
  var $$outStack = $$outStack || [];
  $$outStack.push(out);
  out = ''; /* istanbul ignore else */
  if (it.createErrors !== false) {
    out += ' { keyword: \'' + ('format') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { format:  ';
    if ($isData) {
      out += '' + ($schemaValue);
    } else {
      out += '' + (it.util.toQuotedString($schema));
    }
    out += '  } ';
    if (it.opts.messages !== false) {
      out += ' , message: \'should match format "';
      if ($isData) {
        out += '\' + ' + ($schemaValue) + ' + \'';
      } else {
        out += '' + (it.util.escapeQuotes($schema));
      }
      out += '"\' ';
    }
    if (it.opts.verbose) {
      out += ' , schema:  ';
      if ($isData) {
        out += 'validate.schema' + ($schemaPath);
      } else {
        out += '' + (it.util.toQuotedString($schema));
      }
      out += '         , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
    }
    out += ' } ';
  } else {
    out += ' {} ';
  }
  var __err = out;
  out = $$outStack.pop();
  if (!it.compositeRule && $breakOnError) {
    /* istanbul ignore if */
    if (it.async) {
      out += ' throw new ValidationError([' + (__err) + ']); ';
    } else {
      out += ' validate.errors = [' + (__err) + ']; return false; ';
    }
  } else {
    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  }
  out += ' } ';
  if ($breakOnError) {
    out += ' else { ';
  }
  return out;
}

},{}],26:[function(require,module,exports){
'use strict';
module.exports = function generate_if(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $valid = 'valid' + $lvl;
  var $errs = 'errs__' + $lvl;
  var $it = it.util.copy(it);
  $it.level++;
  var $nextValid = 'valid' + $it.level;
  var $thenSch = it.schema['then'],
    $elseSch = it.schema['else'],
    $thenPresent = $thenSch !== undefined && (it.opts.strictKeywords ? (typeof $thenSch == 'object' && Object.keys($thenSch).length > 0) || $thenSch === false : it.util.schemaHasRules($thenSch, it.RULES.all)),
    $elsePresent = $elseSch !== undefined && (it.opts.strictKeywords ? (typeof $elseSch == 'object' && Object.keys($elseSch).length > 0) || $elseSch === false : it.util.schemaHasRules($elseSch, it.RULES.all)),
    $currentBaseId = $it.baseId;
  if ($thenPresent || $elsePresent) {
    var $ifClause;
    $it.createErrors = false;
    $it.schema = $schema;
    $it.schemaPath = $schemaPath;
    $it.errSchemaPath = $errSchemaPath;
    out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = true;  ';
    var $wasComposite = it.compositeRule;
    it.compositeRule = $it.compositeRule = true;
    out += '  ' + (it.validate($it)) + ' ';
    $it.baseId = $currentBaseId;
    $it.createErrors = true;
    out += '  errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }  ';
    it.compositeRule = $it.compositeRule = $wasComposite;
    if ($thenPresent) {
      out += ' if (' + ($nextValid) + ') {  ';
      $it.schema = it.schema['then'];
      $it.schemaPath = it.schemaPath + '.then';
      $it.errSchemaPath = it.errSchemaPath + '/then';
      out += '  ' + (it.validate($it)) + ' ';
      $it.baseId = $currentBaseId;
      out += ' ' + ($valid) + ' = ' + ($nextValid) + '; ';
      if ($thenPresent && $elsePresent) {
        $ifClause = 'ifClause' + $lvl;
        out += ' var ' + ($ifClause) + ' = \'then\'; ';
      } else {
        $ifClause = '\'then\'';
      }
      out += ' } ';
      if ($elsePresent) {
        out += ' else { ';
      }
    } else {
      out += ' if (!' + ($nextValid) + ') { ';
    }
    if ($elsePresent) {
      $it.schema = it.schema['else'];
      $it.schemaPath = it.schemaPath + '.else';
      $it.errSchemaPath = it.errSchemaPath + '/else';
      out += '  ' + (it.validate($it)) + ' ';
      $it.baseId = $currentBaseId;
      out += ' ' + ($valid) + ' = ' + ($nextValid) + '; ';
      if ($thenPresent && $elsePresent) {
        $ifClause = 'ifClause' + $lvl;
        out += ' var ' + ($ifClause) + ' = \'else\'; ';
      } else {
        $ifClause = '\'else\'';
      }
      out += ' } ';
    }
    out += ' if (!' + ($valid) + ') {   var err =   '; /* istanbul ignore else */
    if (it.createErrors !== false) {
      out += ' { keyword: \'' + ('if') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { failingKeyword: ' + ($ifClause) + ' } ';
      if (it.opts.messages !== false) {
        out += ' , message: \'should match "\' + ' + ($ifClause) + ' + \'" schema\' ';
      }
      if (it.opts.verbose) {
        out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
      }
      out += ' } ';
    } else {
      out += ' {} ';
    }
    out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
    if (!it.compositeRule && $breakOnError) {
      /* istanbul ignore if */
      if (it.async) {
        out += ' throw new ValidationError(vErrors); ';
      } else {
        out += ' validate.errors = vErrors; return false; ';
      }
    }
    out += ' }   ';
    if ($breakOnError) {
      out += ' else { ';
    }
  } else {
    if ($breakOnError) {
      out += ' if (true) { ';
    }
  }
  return out;
}

},{}],27:[function(require,module,exports){
'use strict';

//all requires must be explicit because browserify won't work with dynamic requires
module.exports = {
  '$ref': require('./ref'),
  allOf: require('./allOf'),
  anyOf: require('./anyOf'),
  '$comment': require('./comment'),
  const: require('./const'),
  contains: require('./contains'),
  dependencies: require('./dependencies'),
  'enum': require('./enum'),
  format: require('./format'),
  'if': require('./if'),
  items: require('./items'),
  maximum: require('./_limit'),
  minimum: require('./_limit'),
  maxItems: require('./_limitItems'),
  minItems: require('./_limitItems'),
  maxLength: require('./_limitLength'),
  minLength: require('./_limitLength'),
  maxProperties: require('./_limitProperties'),
  minProperties: require('./_limitProperties'),
  multipleOf: require('./multipleOf'),
  not: require('./not'),
  oneOf: require('./oneOf'),
  pattern: require('./pattern'),
  properties: require('./properties'),
  propertyNames: require('./propertyNames'),
  required: require('./required'),
  uniqueItems: require('./uniqueItems'),
  validate: require('./validate')
};

},{"./_limit":13,"./_limitItems":14,"./_limitLength":15,"./_limitProperties":16,"./allOf":17,"./anyOf":18,"./comment":19,"./const":20,"./contains":21,"./dependencies":23,"./enum":24,"./format":25,"./if":26,"./items":28,"./multipleOf":29,"./not":30,"./oneOf":31,"./pattern":32,"./properties":33,"./propertyNames":34,"./ref":35,"./required":36,"./uniqueItems":37,"./validate":38}],28:[function(require,module,exports){
'use strict';
module.exports = function generate_items(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $valid = 'valid' + $lvl;
  var $errs = 'errs__' + $lvl;
  var $it = it.util.copy(it);
  var $closingBraces = '';
  $it.level++;
  var $nextValid = 'valid' + $it.level;
  var $idx = 'i' + $lvl,
    $dataNxt = $it.dataLevel = it.dataLevel + 1,
    $nextData = 'data' + $dataNxt,
    $currentBaseId = it.baseId;
  out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';
  if (Array.isArray($schema)) {
    var $additionalItems = it.schema.additionalItems;
    if ($additionalItems === false) {
      out += ' ' + ($valid) + ' = ' + ($data) + '.length <= ' + ($schema.length) + '; ';
      var $currErrSchemaPath = $errSchemaPath;
      $errSchemaPath = it.errSchemaPath + '/additionalItems';
      out += '  if (!' + ($valid) + ') {   ';
      var $$outStack = $$outStack || [];
      $$outStack.push(out);
      out = ''; /* istanbul ignore else */
      if (it.createErrors !== false) {
        out += ' { keyword: \'' + ('additionalItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schema.length) + ' } ';
        if (it.opts.messages !== false) {
          out += ' , message: \'should NOT have more than ' + ($schema.length) + ' items\' ';
        }
        if (it.opts.verbose) {
          out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
        }
        out += ' } ';
      } else {
        out += ' {} ';
      }
      var __err = out;
      out = $$outStack.pop();
      if (!it.compositeRule && $breakOnError) {
        /* istanbul ignore if */
        if (it.async) {
          out += ' throw new ValidationError([' + (__err) + ']); ';
        } else {
          out += ' validate.errors = [' + (__err) + ']; return false; ';
        }
      } else {
        out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
      }
      out += ' } ';
      $errSchemaPath = $currErrSchemaPath;
      if ($breakOnError) {
        $closingBraces += '}';
        out += ' else { ';
      }
    }
    var arr1 = $schema;
    if (arr1) {
      var $sch, $i = -1,
        l1 = arr1.length - 1;
      while ($i < l1) {
        $sch = arr1[$i += 1];
        if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
          out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { ';
          var $passData = $data + '[' + $i + ']';
          $it.schema = $sch;
          $it.schemaPath = $schemaPath + '[' + $i + ']';
          $it.errSchemaPath = $errSchemaPath + '/' + $i;
          $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true);
          $it.dataPathArr[$dataNxt] = $i;
          var $code = it.validate($it);
          $it.baseId = $currentBaseId;
          if (it.util.varOccurences($code, $nextData) < 2) {
            out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
          } else {
            out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
          }
          out += ' }  ';
          if ($breakOnError) {
            out += ' if (' + ($nextValid) + ') { ';
            $closingBraces += '}';
          }
        }
      }
    }
    if (typeof $additionalItems == 'object' && (it.opts.strictKeywords ? (typeof $additionalItems == 'object' && Object.keys($additionalItems).length > 0) || $additionalItems === false : it.util.schemaHasRules($additionalItems, it.RULES.all))) {
      $it.schema = $additionalItems;
      $it.schemaPath = it.schemaPath + '.additionalItems';
      $it.errSchemaPath = it.errSchemaPath + '/additionalItems';
      out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') {  for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';
      $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);
      var $passData = $data + '[' + $idx + ']';
      $it.dataPathArr[$dataNxt] = $idx;
      var $code = it.validate($it);
      $it.baseId = $currentBaseId;
      if (it.util.varOccurences($code, $nextData) < 2) {
        out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
      } else {
        out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
      }
      if ($breakOnError) {
        out += ' if (!' + ($nextValid) + ') break; ';
      }
      out += ' } }  ';
      if ($breakOnError) {
        out += ' if (' + ($nextValid) + ') { ';
        $closingBraces += '}';
      }
    }
  } else if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {
    $it.schema = $schema;
    $it.schemaPath = $schemaPath;
    $it.errSchemaPath = $errSchemaPath;
    out += '  for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';
    $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);
    var $passData = $data + '[' + $idx + ']';
    $it.dataPathArr[$dataNxt] = $idx;
    var $code = it.validate($it);
    $it.baseId = $currentBaseId;
    if (it.util.varOccurences($code, $nextData) < 2) {
      out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
    } else {
      out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
    }
    if ($breakOnError) {
      out += ' if (!' + ($nextValid) + ') break; ';
    }
    out += ' }';
  }
  if ($breakOnError) {
    out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
  }
  return out;
}

},{}],29:[function(require,module,exports){
'use strict';
module.exports = function generate_multipleOf(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $isData = it.opts.$data && $schema && $schema.$data,
    $schemaValue;
  if ($isData) {
    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
    $schemaValue = 'schema' + $lvl;
  } else {
    $schemaValue = $schema;
  }
  if (!($isData || typeof $schema == 'number')) {
    throw new Error($keyword + ' must be number');
  }
  out += 'var division' + ($lvl) + ';if (';
  if ($isData) {
    out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || ';
  }
  out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', ';
  if (it.opts.multipleOfPrecision) {
    out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' ';
  } else {
    out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') ';
  }
  out += ' ) ';
  if ($isData) {
    out += '  )  ';
  }
  out += ' ) {   ';
  var $$outStack = $$outStack || [];
  $$outStack.push(out);
  out = ''; /* istanbul ignore else */
  if (it.createErrors !== false) {
    out += ' { keyword: \'' + ('multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } ';
    if (it.opts.messages !== false) {
      out += ' , message: \'should be multiple of ';
      if ($isData) {
        out += '\' + ' + ($schemaValue);
      } else {
        out += '' + ($schemaValue) + '\'';
      }
    }
    if (it.opts.verbose) {
      out += ' , schema:  ';
      if ($isData) {
        out += 'validate.schema' + ($schemaPath);
      } else {
        out += '' + ($schema);
      }
      out += '         , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
    }
    out += ' } ';
  } else {
    out += ' {} ';
  }
  var __err = out;
  out = $$outStack.pop();
  if (!it.compositeRule && $breakOnError) {
    /* istanbul ignore if */
    if (it.async) {
      out += ' throw new ValidationError([' + (__err) + ']); ';
    } else {
      out += ' validate.errors = [' + (__err) + ']; return false; ';
    }
  } else {
    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  }
  out += '} ';
  if ($breakOnError) {
    out += ' else { ';
  }
  return out;
}

},{}],30:[function(require,module,exports){
'use strict';
module.exports = function generate_not(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $errs = 'errs__' + $lvl;
  var $it = it.util.copy(it);
  $it.level++;
  var $nextValid = 'valid' + $it.level;
  if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {
    $it.schema = $schema;
    $it.schemaPath = $schemaPath;
    $it.errSchemaPath = $errSchemaPath;
    out += ' var ' + ($errs) + ' = errors;  ';
    var $wasComposite = it.compositeRule;
    it.compositeRule = $it.compositeRule = true;
    $it.createErrors = false;
    var $allErrorsOption;
    if ($it.opts.allErrors) {
      $allErrorsOption = $it.opts.allErrors;
      $it.opts.allErrors = false;
    }
    out += ' ' + (it.validate($it)) + ' ';
    $it.createErrors = true;
    if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption;
    it.compositeRule = $it.compositeRule = $wasComposite;
    out += ' if (' + ($nextValid) + ') {   ';
    var $$outStack = $$outStack || [];
    $$outStack.push(out);
    out = ''; /* istanbul ignore else */
    if (it.createErrors !== false) {
      out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
      if (it.opts.messages !== false) {
        out += ' , message: \'should NOT be valid\' ';
      }
      if (it.opts.verbose) {
        out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
      }
      out += ' } ';
    } else {
      out += ' {} ';
    }
    var __err = out;
    out = $$outStack.pop();
    if (!it.compositeRule && $breakOnError) {
      /* istanbul ignore if */
      if (it.async) {
        out += ' throw new ValidationError([' + (__err) + ']); ';
      } else {
        out += ' validate.errors = [' + (__err) + ']; return false; ';
      }
    } else {
      out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
    }
    out += ' } else {  errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';
    if (it.opts.allErrors) {
      out += ' } ';
    }
  } else {
    out += '  var err =   '; /* istanbul ignore else */
    if (it.createErrors !== false) {
      out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
      if (it.opts.messages !== false) {
        out += ' , message: \'should NOT be valid\' ';
      }
      if (it.opts.verbose) {
        out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
      }
      out += ' } ';
    } else {
      out += ' {} ';
    }
    out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
    if ($breakOnError) {
      out += ' if (false) { ';
    }
  }
  return out;
}

},{}],31:[function(require,module,exports){
'use strict';
module.exports = function generate_oneOf(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $valid = 'valid' + $lvl;
  var $errs = 'errs__' + $lvl;
  var $it = it.util.copy(it);
  var $closingBraces = '';
  $it.level++;
  var $nextValid = 'valid' + $it.level;
  var $currentBaseId = $it.baseId,
    $prevValid = 'prevValid' + $lvl,
    $passingSchemas = 'passingSchemas' + $lvl;
  out += 'var ' + ($errs) + ' = errors , ' + ($prevValid) + ' = false , ' + ($valid) + ' = false , ' + ($passingSchemas) + ' = null; ';
  var $wasComposite = it.compositeRule;
  it.compositeRule = $it.compositeRule = true;
  var arr1 = $schema;
  if (arr1) {
    var $sch, $i = -1,
      l1 = arr1.length - 1;
    while ($i < l1) {
      $sch = arr1[$i += 1];
      if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
        $it.schema = $sch;
        $it.schemaPath = $schemaPath + '[' + $i + ']';
        $it.errSchemaPath = $errSchemaPath + '/' + $i;
        out += '  ' + (it.validate($it)) + ' ';
        $it.baseId = $currentBaseId;
      } else {
        out += ' var ' + ($nextValid) + ' = true; ';
      }
      if ($i) {
        out += ' if (' + ($nextValid) + ' && ' + ($prevValid) + ') { ' + ($valid) + ' = false; ' + ($passingSchemas) + ' = [' + ($passingSchemas) + ', ' + ($i) + ']; } else { ';
        $closingBraces += '}';
      }
      out += ' if (' + ($nextValid) + ') { ' + ($valid) + ' = ' + ($prevValid) + ' = true; ' + ($passingSchemas) + ' = ' + ($i) + '; }';
    }
  }
  it.compositeRule = $it.compositeRule = $wasComposite;
  out += '' + ($closingBraces) + 'if (!' + ($valid) + ') {   var err =   '; /* istanbul ignore else */
  if (it.createErrors !== false) {
    out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { passingSchemas: ' + ($passingSchemas) + ' } ';
    if (it.opts.messages !== false) {
      out += ' , message: \'should match exactly one schema in oneOf\' ';
    }
    if (it.opts.verbose) {
      out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
    }
    out += ' } ';
  } else {
    out += ' {} ';
  }
  out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  if (!it.compositeRule && $breakOnError) {
    /* istanbul ignore if */
    if (it.async) {
      out += ' throw new ValidationError(vErrors); ';
    } else {
      out += ' validate.errors = vErrors; return false; ';
    }
  }
  out += '} else {  errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }';
  if (it.opts.allErrors) {
    out += ' } ';
  }
  return out;
}

},{}],32:[function(require,module,exports){
'use strict';
module.exports = function generate_pattern(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $valid = 'valid' + $lvl;
  var $isData = it.opts.$data && $schema && $schema.$data,
    $schemaValue;
  if ($isData) {
    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
    $schemaValue = 'schema' + $lvl;
  } else {
    $schemaValue = $schema;
  }
  var $regExpCode = it.opts.regExp ? 'regExp' : 'new RegExp';
  if ($isData) {
    out += ' var ' + ($valid) + ' = true; try { ' + ($valid) + ' = ' + ($regExpCode) + '(' + ($schemaValue) + ').test(' + ($data) + '); } catch(e) { ' + ($valid) + ' = false; } if ( ';
    if ($isData) {
      out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || ';
    }
    out += ' !' + ($valid) + ') {';
  } else {
    var $regexp = it.usePattern($schema);
    out += ' if ( ';
    if ($isData) {
      out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || ';
    }
    out += ' !' + ($regexp) + '.test(' + ($data) + ') ) {';
  }
  var $$outStack = $$outStack || [];
  $$outStack.push(out);
  out = ''; /* istanbul ignore else */
  if (it.createErrors !== false) {
    out += ' { keyword: \'' + ('pattern') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern:  ';
    if ($isData) {
      out += '' + ($schemaValue);
    } else {
      out += '' + (it.util.toQuotedString($schema));
    }
    out += '  } ';
    if (it.opts.messages !== false) {
      out += ' , message: \'should match pattern "';
      if ($isData) {
        out += '\' + ' + ($schemaValue) + ' + \'';
      } else {
        out += '' + (it.util.escapeQuotes($schema));
      }
      out += '"\' ';
    }
    if (it.opts.verbose) {
      out += ' , schema:  ';
      if ($isData) {
        out += 'validate.schema' + ($schemaPath);
      } else {
        out += '' + (it.util.toQuotedString($schema));
      }
      out += '         , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
    }
    out += ' } ';
  } else {
    out += ' {} ';
  }
  var __err = out;
  out = $$outStack.pop();
  if (!it.compositeRule && $breakOnError) {
    /* istanbul ignore if */
    if (it.async) {
      out += ' throw new ValidationError([' + (__err) + ']); ';
    } else {
      out += ' validate.errors = [' + (__err) + ']; return false; ';
    }
  } else {
    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  }
  out += '} ';
  if ($breakOnError) {
    out += ' else { ';
  }
  return out;
}

},{}],33:[function(require,module,exports){
'use strict';
module.exports = function generate_properties(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $errs = 'errs__' + $lvl;
  var $it = it.util.copy(it);
  var $closingBraces = '';
  $it.level++;
  var $nextValid = 'valid' + $it.level;
  var $key = 'key' + $lvl,
    $idx = 'idx' + $lvl,
    $dataNxt = $it.dataLevel = it.dataLevel + 1,
    $nextData = 'data' + $dataNxt,
    $dataProperties = 'dataProperties' + $lvl;
  var $schemaKeys = Object.keys($schema || {}).filter(notProto),
    $pProperties = it.schema.patternProperties || {},
    $pPropertyKeys = Object.keys($pProperties).filter(notProto),
    $aProperties = it.schema.additionalProperties,
    $someProperties = $schemaKeys.length || $pPropertyKeys.length,
    $noAdditional = $aProperties === false,
    $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length,
    $removeAdditional = it.opts.removeAdditional,
    $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional,
    $ownProperties = it.opts.ownProperties,
    $currentBaseId = it.baseId;
  var $required = it.schema.required;
  if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) {
    var $requiredHash = it.util.toHash($required);
  }

  function notProto(p) {
    return p !== '__proto__';
  }
  out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;';
  if ($ownProperties) {
    out += ' var ' + ($dataProperties) + ' = undefined;';
  }
  if ($checkAdditional) {
    if ($ownProperties) {
      out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';
    } else {
      out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';
    }
    if ($someProperties) {
      out += ' var isAdditional' + ($lvl) + ' = !(false ';
      if ($schemaKeys.length) {
        if ($schemaKeys.length > 8) {
          out += ' || validate.schema' + ($schemaPath) + '.hasOwnProperty(' + ($key) + ') ';
        } else {
          var arr1 = $schemaKeys;
          if (arr1) {
            var $propertyKey, i1 = -1,
              l1 = arr1.length - 1;
            while (i1 < l1) {
              $propertyKey = arr1[i1 += 1];
              out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' ';
            }
          }
        }
      }
      if ($pPropertyKeys.length) {
        var arr2 = $pPropertyKeys;
        if (arr2) {
          var $pProperty, $i = -1,
            l2 = arr2.length - 1;
          while ($i < l2) {
            $pProperty = arr2[$i += 1];
            out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') ';
          }
        }
      }
      out += ' ); if (isAdditional' + ($lvl) + ') { ';
    }
    if ($removeAdditional == 'all') {
      out += ' delete ' + ($data) + '[' + ($key) + ']; ';
    } else {
      var $currentErrorPath = it.errorPath;
      var $additionalProperty = '\' + ' + $key + ' + \'';
      if (it.opts._errorDataPathProperty) {
        it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
      }
      if ($noAdditional) {
        if ($removeAdditional) {
          out += ' delete ' + ($data) + '[' + ($key) + ']; ';
        } else {
          out += ' ' + ($nextValid) + ' = false; ';
          var $currErrSchemaPath = $errSchemaPath;
          $errSchemaPath = it.errSchemaPath + '/additionalProperties';
          var $$outStack = $$outStack || [];
          $$outStack.push(out);
          out = ''; /* istanbul ignore else */
          if (it.createErrors !== false) {
            out += ' { keyword: \'' + ('additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } ';
            if (it.opts.messages !== false) {
              out += ' , message: \'';
              if (it.opts._errorDataPathProperty) {
                out += 'is an invalid additional property';
              } else {
                out += 'should NOT have additional properties';
              }
              out += '\' ';
            }
            if (it.opts.verbose) {
              out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
            }
            out += ' } ';
          } else {
            out += ' {} ';
          }
          var __err = out;
          out = $$outStack.pop();
          if (!it.compositeRule && $breakOnError) {
            /* istanbul ignore if */
            if (it.async) {
              out += ' throw new ValidationError([' + (__err) + ']); ';
            } else {
              out += ' validate.errors = [' + (__err) + ']; return false; ';
            }
          } else {
            out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
          }
          $errSchemaPath = $currErrSchemaPath;
          if ($breakOnError) {
            out += ' break; ';
          }
        }
      } else if ($additionalIsSchema) {
        if ($removeAdditional == 'failing') {
          out += ' var ' + ($errs) + ' = errors;  ';
          var $wasComposite = it.compositeRule;
          it.compositeRule = $it.compositeRule = true;
          $it.schema = $aProperties;
          $it.schemaPath = it.schemaPath + '.additionalProperties';
          $it.errSchemaPath = it.errSchemaPath + '/additionalProperties';
          $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
          var $passData = $data + '[' + $key + ']';
          $it.dataPathArr[$dataNxt] = $key;
          var $code = it.validate($it);
             $it.baseId = $currentBaseId;
          if (it.util.varOccurences($code, $nextData) < 2) {
            out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
          } else {
            out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
          }
          out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; }  ';
          it.compositeRule = $it.compositeRule = $wasComposite;
        } else {
          $it.schema = $aProperties;
          $it.schemaPath = it.schemaPath + '.additionalProperties';
          $it.errSchemaPath = it.errSchemaPath + '/additionalProperties';
          $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
          var $passData = $data + '[' + $key + ']';
          $it.dataPathArr[$dataNxt] = $key;
          var $code = it.validate($it);
          $it.baseId = $currentBaseId;
          if (it.util.varOccurences($code, $nextData) < 2) {
            out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
          } else {
            out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
          }
          if ($breakOnError) {
            out += ' if (!' + ($nextValid) + ') break; ';
          }
        }
      }
      it.errorPath = $currentErrorPath;
    }
    if ($someProperties) {
      out += ' } ';
    }
    out += ' }  ';
    if ($breakOnError) {
      out += ' if (' + ($nextValid) + ') { ';
      $closingBraces += '}';
    }
  }
  var $useDefaults = it.opts.useDefaults && !it.compositeRule;
  if ($schemaKeys.length) {
    var arr3 = $schemaKeys;
    if (arr3) {
      var $propertyKey, i3 = -1,
        l3 = arr3.length - 1;
      while (i3 < l3) {
        $propertyKey = arr3[i3 += 1];
        var $sch = $schema[$propertyKey];
        if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
          var $prop = it.util.getProperty($propertyKey),
            $passData = $data + $prop,
            $hasDefault = $useDefaults && $sch.default !== undefined;
          $it.schema = $sch;
          $it.schemaPath = $schemaPath + $prop;
          $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey);
          $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers);
          $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey);
          var $code = it.validate($it);
          $it.baseId = $currentBaseId;
          if (it.util.varOccurences($code, $nextData) < 2) {
            $code = it.util.varReplace($code, $nextData, $passData);
            var $useData = $passData;
          } else {
            var $useData = $nextData;
            out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ';
          }
          if ($hasDefault) {
            out += ' ' + ($code) + ' ';
          } else {
            if ($requiredHash && $requiredHash[$propertyKey]) {
              out += ' if ( ' + ($useData) + ' === undefined ';
              if ($ownProperties) {
                out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
              }
              out += ') { ' + ($nextValid) + ' = false; ';
              var $currentErrorPath = it.errorPath,
                $currErrSchemaPath = $errSchemaPath,
                $missingProperty = it.util.escapeQuotes($propertyKey);
              if (it.opts._errorDataPathProperty) {
                it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
              }
              $errSchemaPath = it.errSchemaPath + '/required';
              var $$outStack = $$outStack || [];
              $$outStack.push(out);
              out = ''; /* istanbul ignore else */
              if (it.createErrors !== false) {
                out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
                if (it.opts.messages !== false) {
                  out += ' , message: \'';
                  if (it.opts._errorDataPathProperty) {
                    out += 'is a required property';
                  } else {
                    out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
                  }
                  out += '\' ';
                }
                if (it.opts.verbose) {
                  out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
                }
                out += ' } ';
              } else {
                out += ' {} ';
              }
              var __err = out;
              out = $$outStack.pop();
              if (!it.compositeRule && $breakOnError) {
                /* istanbul ignore if */
                if (it.async) {
                  out += ' throw new ValidationError([' + (__err) + ']); ';
                } else {
                  out += ' validate.errors = [' + (__err) + ']; return false; ';
                }
              } else {
                out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
              }
              $errSchemaPath = $currErrSchemaPath;
              it.errorPath = $currentErrorPath;
              out += ' } else { ';
            } else {
              if ($breakOnError) {
                out += ' if ( ' + ($useData) + ' === undefined ';
                if ($ownProperties) {
                  out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
                }
                out += ') { ' + ($nextValid) + ' = true; } else { ';
              } else {
                out += ' if (' + ($useData) + ' !== undefined ';
                if ($ownProperties) {
                  out += ' &&   Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
                }
                out += ' ) { ';
              }
            }
            out += ' ' + ($code) + ' } ';
          }
        }
        if ($breakOnError) {
          out += ' if (' + ($nextValid) + ') { ';
          $closingBraces += '}';
        }
      }
    }
  }
  if ($pPropertyKeys.length) {
    var arr4 = $pPropertyKeys;
    if (arr4) {
      var $pProperty, i4 = -1,
        l4 = arr4.length - 1;
      while (i4 < l4) {
        $pProperty = arr4[i4 += 1];
        var $sch = $pProperties[$pProperty];
        if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
          $it.schema = $sch;
          $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty);
          $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty);
          if ($ownProperties) {
            out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';
          } else {
            out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';
          }
          out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { ';
          $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
          var $passData = $data + '[' + $key + ']';
          $it.dataPathArr[$dataNxt] = $key;
          var $code = it.validate($it);
          $it.baseId = $currentBaseId;
          if (it.util.varOccurences($code, $nextData) < 2) {
            out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
          } else {
            out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
          }
          if ($breakOnError) {
            out += ' if (!' + ($nextValid) + ') break; ';
          }
          out += ' } ';
          if ($breakOnError) {
            out += ' else ' + ($nextValid) + ' = true; ';
          }
          out += ' }  ';
          if ($breakOnError) {
            out += ' if (' + ($nextValid) + ') { ';
            $closingBraces += '}';
          }
        }
      }
    }
  }
  if ($breakOnError) {
    out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
  }
  return out;
}

},{}],34:[function(require,module,exports){
'use strict';
module.exports = function generate_propertyNames(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $errs = 'errs__' + $lvl;
  var $it = it.util.copy(it);
  var $closingBraces = '';
  $it.level++;
  var $nextValid = 'valid' + $it.level;
  out += 'var ' + ($errs) + ' = errors;';
  if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {
    $it.schema = $schema;
    $it.schemaPath = $schemaPath;
    $it.errSchemaPath = $errSchemaPath;
    var $key = 'key' + $lvl,
      $idx = 'idx' + $lvl,
      $i = 'i' + $lvl,
      $invalidName = '\' + ' + $key + ' + \'',
      $dataNxt = $it.dataLevel = it.dataLevel + 1,
      $nextData = 'data' + $dataNxt,
      $dataProperties = 'dataProperties' + $lvl,
      $ownProperties = it.opts.ownProperties,
      $currentBaseId = it.baseId;
    if ($ownProperties) {
      out += ' var ' + ($dataProperties) + ' = undefined; ';
    }
    if ($ownProperties) {
      out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';
    } else {
      out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';
    }
    out += ' var startErrs' + ($lvl) + ' = errors; ';
    var $passData = $key;
    var $wasComposite = it.compositeRule;
    it.compositeRule = $it.compositeRule = true;
    var $code = it.validate($it);
    $it.baseId = $currentBaseId;
    if (it.util.varOccurences($code, $nextData) < 2) {
      out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
    } else {
      out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
    }
    it.compositeRule = $it.compositeRule = $wasComposite;
    out += ' if (!' + ($nextValid) + ') { for (var ' + ($i) + '=startErrs' + ($lvl) + '; ' + ($i) + '<errors; ' + ($i) + '++) { vErrors[' + ($i) + '].propertyName = ' + ($key) + '; }   var err =   '; /* istanbul ignore else */
    if (it.createErrors !== false) {
      out += ' { keyword: \'' + ('propertyNames') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { propertyName: \'' + ($invalidName) + '\' } ';
      if (it.opts.messages !== false) {
        out += ' , message: \'property name \\\'' + ($invalidName) + '\\\' is invalid\' ';
      }
      if (it.opts.verbose) {
        out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
      }
      out += ' } ';
    } else {
      out += ' {} ';
    }
    out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
    if (!it.compositeRule && $breakOnError) {
      /* istanbul ignore if */
      if (it.async) {
        out += ' throw new ValidationError(vErrors); ';
      } else {
        out += ' validate.errors = vErrors; return false; ';
      }
    }
    if ($breakOnError) {
      out += ' break; ';
    }
    out += ' } }';
  }
  if ($breakOnError) {
    out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
  }
  return out;
}

},{}],35:[function(require,module,exports){
'use strict';
module.exports = function generate_ref(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $valid = 'valid' + $lvl;
  var $async, $refCode;
  if ($schema == '#' || $schema == '#/') {
    if (it.isRoot) {
      $async = it.async;
      $refCode = 'validate';
    } else {
      $async = it.root.schema.$async === true;
      $refCode = 'root.refVal[0]';
    }
  } else {
    var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot);
    if ($refVal === undefined) {
      var $message = it.MissingRefError.message(it.baseId, $schema);
      if (it.opts.missingRefs == 'fail') {
        it.logger.error($message);
        var $$outStack = $$outStack || [];
        $$outStack.push(out);
        out = ''; /* istanbul ignore else */
        if (it.createErrors !== false) {
          out += ' { keyword: \'' + ('$ref') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { ref: \'' + (it.util.escapeQuotes($schema)) + '\' } ';
          if (it.opts.messages !== false) {
            out += ' , message: \'can\\\'t resolve reference ' + (it.util.escapeQuotes($schema)) + '\' ';
          }
          if (it.opts.verbose) {
            out += ' , schema: ' + (it.util.toQuotedString($schema)) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
          }
          out += ' } ';
        } else {
          out += ' {} ';
        }
        var __err = out;
        out = $$outStack.pop();
        if (!it.compositeRule && $breakOnError) {
          /* istanbul ignore if */
          if (it.async) {
            out += ' throw new ValidationError([' + (__err) + ']); ';
          } else {
            out += ' validate.errors = [' + (__err) + ']; return false; ';
          }
        } else {
          out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
        }
        if ($breakOnError) {
          out += ' if (false) { ';
        }
      } else if (it.opts.missingRefs == 'ignore') {
        it.logger.warn($message);
        if ($breakOnError) {
          out += ' if (true) { ';
        }
      } else {
        throw new it.MissingRefError(it.baseId, $schema, $message);
      }
    } else if ($refVal.inline) {
      var $it = it.util.copy(it);
      $it.level++;
      var $nextValid = 'valid' + $it.level;
      $it.schema = $refVal.schema;
      $it.schemaPath = '';
      $it.errSchemaPath = $schema;
      var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code);
      out += ' ' + ($code) + ' ';
      if ($breakOnError) {
        out += ' if (' + ($nextValid) + ') { ';
      }
    } else {
      $async = $refVal.$async === true || (it.async && $refVal.$async !== false);
      $refCode = $refVal.code;
    }
  }
  if ($refCode) {
    var $$outStack = $$outStack || [];
    $$outStack.push(out);
    out = '';
    if (it.opts.passContext) {
      out += ' ' + ($refCode) + '.call(this, ';
    } else {
      out += ' ' + ($refCode) + '( ';
    }
    out += ' ' + ($data) + ', (dataPath || \'\')';
    if (it.errorPath != '""') {
      out += ' + ' + (it.errorPath);
    }
    var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',
      $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';
    out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ', rootData)  ';
    var __callValidate = out;
    out = $$outStack.pop();
    if ($async) {
      if (!it.async) throw new Error('async schema referenced by sync schema');
      if ($breakOnError) {
        out += ' var ' + ($valid) + '; ';
      }
      out += ' try { await ' + (__callValidate) + '; ';
      if ($breakOnError) {
        out += ' ' + ($valid) + ' = true; ';
      }
      out += ' } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ';
      if ($breakOnError) {
        out += ' ' + ($valid) + ' = false; ';
      }
      out += ' } ';
      if ($breakOnError) {
        out += ' if (' + ($valid) + ') { ';
      }
    } else {
      out += ' if (!' + (__callValidate) + ') { if (vErrors === null) vErrors = ' + ($refCode) + '.errors; else vErrors = vErrors.concat(' + ($refCode) + '.errors); errors = vErrors.length; } ';
      if ($breakOnError) {
        out += ' else { ';
      }
    }
  }
  return out;
}

},{}],36:[function(require,module,exports){
'use strict';
module.exports = function generate_required(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $valid = 'valid' + $lvl;
  var $isData = it.opts.$data && $schema && $schema.$data,
    $schemaValue;
  if ($isData) {
    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
    $schemaValue = 'schema' + $lvl;
  } else {
    $schemaValue = $schema;
  }
  var $vSchema = 'schema' + $lvl;
  if (!$isData) {
    if ($schema.length < it.opts.loopRequired && it.schema.properties && Object.keys(it.schema.properties).length) {
      var $required = [];
      var arr1 = $schema;
      if (arr1) {
        var $property, i1 = -1,
          l1 = arr1.length - 1;
        while (i1 < l1) {
          $property = arr1[i1 += 1];
          var $propertySch = it.schema.properties[$property];
          if (!($propertySch && (it.opts.strictKeywords ? (typeof $propertySch == 'object' && Object.keys($propertySch).length > 0) || $propertySch === false : it.util.schemaHasRules($propertySch, it.RULES.all)))) {
            $required[$required.length] = $property;
          }
        }
      }
    } else {
      var $required = $schema;
    }
  }
  if ($isData || $required.length) {
    var $currentErrorPath = it.errorPath,
      $loopRequired = $isData || $required.length >= it.opts.loopRequired,
      $ownProperties = it.opts.ownProperties;
    if ($breakOnError) {
      out += ' var missing' + ($lvl) + '; ';
      if ($loopRequired) {
        if (!$isData) {
          out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';
        }
        var $i = 'i' + $lvl,
          $propertyPath = 'schema' + $lvl + '[' + $i + ']',
          $missingProperty = '\' + ' + $propertyPath + ' + \'';
        if (it.opts._errorDataPathProperty) {
          it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);
        }
        out += ' var ' + ($valid) + ' = true; ';
        if ($isData) {
          out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {';
        }
        out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined ';
        if ($ownProperties) {
          out += ' &&   Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';
        }
        out += '; if (!' + ($valid) + ') break; } ';
        if ($isData) {
          out += '  }  ';
        }
        out += '  if (!' + ($valid) + ') {   ';
        var $$outStack = $$outStack || [];
        $$outStack.push(out);
        out = ''; /* istanbul ignore else */
        if (it.createErrors !== false) {
          out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
          if (it.opts.messages !== false) {
            out += ' , message: \'';
            if (it.opts._errorDataPathProperty) {
              out += 'is a required property';
            } else {
              out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
            }
            out += '\' ';
          }
          if (it.opts.verbose) {
            out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
          }
          out += ' } ';
        } else {
          out += ' {} ';
        }
        var __err = out;
        out = $$outStack.pop();
        if (!it.compositeRule && $breakOnError) {
          /* istanbul ignore if */
          if (it.async) {
            out += ' throw new ValidationError([' + (__err) + ']); ';
          } else {
            out += ' validate.errors = [' + (__err) + ']; return false; ';
          }
        } else {
          out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
        }
        out += ' } else { ';
      } else {
        out += ' if ( ';
        var arr2 = $required;
        if (arr2) {
          var $propertyKey, $i = -1,
            l2 = arr2.length - 1;
          while ($i < l2) {
            $propertyKey = arr2[$i += 1];
            if ($i) {
              out += ' || ';
            }
            var $prop = it.util.getProperty($propertyKey),
              $useData = $data + $prop;
            out += ' ( ( ' + ($useData) + ' === undefined ';
            if ($ownProperties) {
              out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
            }
            out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) ';
          }
        }
        out += ') {  ';
        var $propertyPath = 'missing' + $lvl,
          $missingProperty = '\' + ' + $propertyPath + ' + \'';
        if (it.opts._errorDataPathProperty) {
          it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath;
        }
        var $$outStack = $$outStack || [];
        $$outStack.push(out);
        out = ''; /* istanbul ignore else */
        if (it.createErrors !== false) {
          out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
          if (it.opts.messages !== false) {
            out += ' , message: \'';
            if (it.opts._errorDataPathProperty) {
              out += 'is a required property';
            } else {
              out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
            }
            out += '\' ';
          }
          if (it.opts.verbose) {
            out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
          }
          out += ' } ';
        } else {
          out += ' {} ';
        }
        var __err = out;
        out = $$outStack.pop();
        if (!it.compositeRule && $breakOnError) {
          /* istanbul ignore if */
          if (it.async) {
            out += ' throw new ValidationError([' + (__err) + ']); ';
          } else {
            out += ' validate.errors = [' + (__err) + ']; return false; ';
          }
        } else {
          out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
        }
        out += ' } else { ';
      }
    } else {
      if ($loopRequired) {
        if (!$isData) {
          out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';
        }
        var $i = 'i' + $lvl,
          $propertyPath = 'schema' + $lvl + '[' + $i + ']',
          $missingProperty = '\' + ' + $propertyPath + ' + \'';
        if (it.opts._errorDataPathProperty) {
          it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);
        }
        if ($isData) {
          out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) {  var err =   '; /* istanbul ignore else */
          if (it.createErrors !== false) {
            out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
            if (it.opts.messages !== false) {
              out += ' , message: \'';
              if (it.opts._errorDataPathProperty) {
                out += 'is a required property';
              } else {
                out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
              }
              out += '\' ';
            }
            if (it.opts.verbose) {
              out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
            }
            out += ' } ';
          } else {
            out += ' {} ';
          }
          out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { ';
        }
        out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined ';
        if ($ownProperties) {
          out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';
        }
        out += ') {  var err =   '; /* istanbul ignore else */
        if (it.createErrors !== false) {
          out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
          if (it.opts.messages !== false) {
            out += ' , message: \'';
            if (it.opts._errorDataPathProperty) {
              out += 'is a required property';
            } else {
              out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
            }
            out += '\' ';
          }
          if (it.opts.verbose) {
            out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
          }
          out += ' } ';
        } else {
          out += ' {} ';
        }
        out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ';
        if ($isData) {
          out += '  }  ';
        }
      } else {
        var arr3 = $required;
        if (arr3) {
          var $propertyKey, i3 = -1,
            l3 = arr3.length - 1;
          while (i3 < l3) {
            $propertyKey = arr3[i3 += 1];
            var $prop = it.util.getProperty($propertyKey),
              $missingProperty = it.util.escapeQuotes($propertyKey),
              $useData = $data + $prop;
            if (it.opts._errorDataPathProperty) {
              it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
            }
            out += ' if ( ' + ($useData) + ' === undefined ';
            if ($ownProperties) {
              out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
            }
            out += ') {  var err =   '; /* istanbul ignore else */
            if (it.createErrors !== false) {
              out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
              if (it.opts.messages !== false) {
                out += ' , message: \'';
                if (it.opts._errorDataPathProperty) {
                  out += 'is a required property';
                } else {
                  out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
                }
                out += '\' ';
              }
              if (it.opts.verbose) {
                out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
              }
              out += ' } ';
            } else {
              out += ' {} ';
            }
            out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ';
          }
        }
      }
    }
    it.errorPath = $currentErrorPath;
  } else if ($breakOnError) {
    out += ' if (true) {';
  }
  return out;
}

},{}],37:[function(require,module,exports){
'use strict';
module.exports = function generate_uniqueItems(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $valid = 'valid' + $lvl;
  var $isData = it.opts.$data && $schema && $schema.$data,
    $schemaValue;
  if ($isData) {
    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
    $schemaValue = 'schema' + $lvl;
  } else {
    $schemaValue = $schema;
  }
  if (($schema || $isData) && it.opts.uniqueItems !== false) {
    if ($isData) {
      out += ' var ' + ($valid) + '; if (' + ($schemaValue) + ' === false || ' + ($schemaValue) + ' === undefined) ' + ($valid) + ' = true; else if (typeof ' + ($schemaValue) + ' != \'boolean\') ' + ($valid) + ' = false; else { ';
    }
    out += ' var i = ' + ($data) + '.length , ' + ($valid) + ' = true , j; if (i > 1) { ';
    var $itemType = it.schema.items && it.schema.items.type,
      $typeIsArray = Array.isArray($itemType);
    if (!$itemType || $itemType == 'object' || $itemType == 'array' || ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0))) {
      out += ' outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' + ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } } ';
    } else {
      out += ' var itemIndices = {}, item; for (;i--;) { var item = ' + ($data) + '[i]; ';
      var $method = 'checkDataType' + ($typeIsArray ? 's' : '');
      out += ' if (' + (it.util[$method]($itemType, 'item', it.opts.strictNumbers, true)) + ') continue; ';
      if ($typeIsArray) {
        out += ' if (typeof item == \'string\') item = \'"\' + item; ';
      }
      out += ' if (typeof itemIndices[item] == \'number\') { ' + ($valid) + ' = false; j = itemIndices[item]; break; } itemIndices[item] = i; } ';
    }
    out += ' } ';
    if ($isData) {
      out += '  }  ';
    }
    out += ' if (!' + ($valid) + ') {   ';
    var $$outStack = $$outStack || [];
    $$outStack.push(out);
    out = ''; /* istanbul ignore else */
    if (it.createErrors !== false) {
      out += ' { keyword: \'' + ('uniqueItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { i: i, j: j } ';
      if (it.opts.messages !== false) {
        out += ' , message: \'should NOT have duplicate items (items ## \' + j + \' and \' + i + \' are identical)\' ';
      }
      if (it.opts.verbose) {
        out += ' , schema:  ';
        if ($isData) {
          out += 'validate.schema' + ($schemaPath);
        } else {
          out += '' + ($schema);
        }
        out += '         , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
      }
      out += ' } ';
    } else {
      out += ' {} ';
    }
    var __err = out;
    out = $$outStack.pop();
    if (!it.compositeRule && $breakOnError) {
      /* istanbul ignore if */
      if (it.async) {
        out += ' throw new ValidationError([' + (__err) + ']); ';
      } else {
        out += ' validate.errors = [' + (__err) + ']; return false; ';
      }
    } else {
      out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
    }
    out += ' } ';
    if ($breakOnError) {
      out += ' else { ';
    }
  } else {
    if ($breakOnError) {
      out += ' if (true) { ';
    }
  }
  return out;
}

},{}],38:[function(require,module,exports){
'use strict';
module.exports = function generate_validate(it, $keyword, $ruleType) {
  var out = '';
  var $async = it.schema.$async === true,
    $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'),
    $id = it.self._getId(it.schema);
  if (it.opts.strictKeywords) {
    var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords);
    if ($unknownKwd) {
      var $keywordsMsg = 'unknown keyword: ' + $unknownKwd;
      if (it.opts.strictKeywords === 'log') it.logger.warn($keywordsMsg);
      else throw new Error($keywordsMsg);
    }
  }
  if (it.isTop) {
    out += ' var validate = ';
    if ($async) {
      it.async = true;
      out += 'async ';
    }
    out += 'function(data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; ';
    if ($id && (it.opts.sourceCode || it.opts.processCode)) {
      out += ' ' + ('/\*# sourceURL=' + $id + ' */') + ' ';
    }
  }
  if (typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref)) {
    var $keyword = 'false schema';
    var $lvl = it.level;
    var $dataLvl = it.dataLevel;
    var $schema = it.schema[$keyword];
    var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
    var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
    var $breakOnError = !it.opts.allErrors;
    var $errorKeyword;
    var $data = 'data' + ($dataLvl || '');
    var $valid = 'valid' + $lvl;
    if (it.schema === false) {
      if (it.isTop) {
        $breakOnError = true;
      } else {
        out += ' var ' + ($valid) + ' = false; ';
      }
      var $$outStack = $$outStack || [];
      $$outStack.push(out);
      out = ''; /* istanbul ignore else */
      if (it.createErrors !== false) {
        out += ' { keyword: \'' + ($errorKeyword || 'false schema') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
        if (it.opts.messages !== false) {
          out += ' , message: \'boolean schema is false\' ';
        }
        if (it.opts.verbose) {
          out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
        }
        out += ' } ';
      } else {
        out += ' {} ';
      }
      var __err = out;
      out = $$outStack.pop();
      if (!it.compositeRule && $breakOnError) {
        /* istanbul ignore if */
        if (it.async) {
          out += ' throw new ValidationError([' + (__err) + ']); ';
        } else {
          out += ' validate.errors = [' + (__err) + ']; return false; ';
        }
      } else {
        out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
      }
    } else {
      if (it.isTop) {
        if ($async) {
          out += ' return data; ';
        } else {
          out += ' validate.errors = null; return true; ';
        }
      } else {
        out += ' var ' + ($valid) + ' = true; ';
      }
    }
    if (it.isTop) {
      out += ' }; return validate; ';
    }
    return out;
  }
  if (it.isTop) {
    var $top = it.isTop,
      $lvl = it.level = 0,
      $dataLvl = it.dataLevel = 0,
      $data = 'data';
    it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema));
    it.baseId = it.baseId || it.rootId;
    delete it.isTop;
    it.dataPathArr = [""];
    if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) {
      var $defaultMsg = 'default is ignored in the schema root';
      if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);
      else throw new Error($defaultMsg);
    }
    out += ' var vErrors = null; ';
    out += ' var errors = 0;     ';
    out += ' if (rootData === undefined) rootData = data; ';
  } else {
    var $lvl = it.level,
      $dataLvl = it.dataLevel,
      $data = 'data' + ($dataLvl || '');
    if ($id) it.baseId = it.resolve.url(it.baseId, $id);
    if ($async && !it.async) throw new Error('async schema in sync schema');
    out += ' var errs_' + ($lvl) + ' = errors;';
  }
  var $valid = 'valid' + $lvl,
    $breakOnError = !it.opts.allErrors,
    $closingBraces1 = '',
    $closingBraces2 = '';
  var $errorKeyword;
  var $typeSchema = it.schema.type,
    $typeIsArray = Array.isArray($typeSchema);
  if ($typeSchema && it.opts.nullable && it.schema.nullable === true) {
    if ($typeIsArray) {
      if ($typeSchema.indexOf('null') == -1) $typeSchema = $typeSchema.concat('null');
    } else if ($typeSchema != 'null') {
      $typeSchema = [$typeSchema, 'null'];
      $typeIsArray = true;
    }
  }
  if ($typeIsArray && $typeSchema.length == 1) {
    $typeSchema = $typeSchema[0];
    $typeIsArray = false;
  }
  if (it.schema.$ref && $refKeywords) {
    if (it.opts.extendRefs == 'fail') {
      throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)');
    } else if (it.opts.extendRefs !== true) {
      $refKeywords = false;
      it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"');
    }
  }
  if (it.schema.$comment && it.opts.$comment) {
    out += ' ' + (it.RULES.all.$comment.code(it, '$comment'));
  }
  if ($typeSchema) {
    if (it.opts.coerceTypes) {
      var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema);
    }
    var $rulesGroup = it.RULES.types[$typeSchema];
    if ($coerceToTypes || $typeIsArray || $rulesGroup === true || ($rulesGroup && !$shouldUseGroup($rulesGroup))) {
      var $schemaPath = it.schemaPath + '.type',
        $errSchemaPath = it.errSchemaPath + '/type';
      var $schemaPath = it.schemaPath + '.type',
        $errSchemaPath = it.errSchemaPath + '/type',
        $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType';
      out += ' if (' + (it.util[$method]($typeSchema, $data, it.opts.strictNumbers, true)) + ') { ';
      if ($coerceToTypes) {
        var $dataType = 'dataType' + $lvl,
          $coerced = 'coerced' + $lvl;
        out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; var ' + ($coerced) + ' = undefined; ';
        if (it.opts.coerceTypes == 'array') {
          out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ') && ' + ($data) + '.length == 1) { ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; if (' + (it.util.checkDataType(it.schema.type, $data, it.opts.strictNumbers)) + ') ' + ($coerced) + ' = ' + ($data) + '; } ';
        }
        out += ' if (' + ($coerced) + ' !== undefined) ; ';
        var arr1 = $coerceToTypes;
        if (arr1) {
          var $type, $i = -1,
            l1 = arr1.length - 1;
          while ($i < l1) {
            $type = arr1[$i += 1];
            if ($type == 'string') {
              out += ' else if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; ';
            } else if ($type == 'number' || $type == 'integer') {
              out += ' else if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' ';
              if ($type == 'integer') {
                out += ' && !(' + ($data) + ' % 1)';
              }
              out += ')) ' + ($coerced) + ' = +' + ($data) + '; ';
            } else if ($type == 'boolean') {
              out += ' else if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; ';
            } else if ($type == 'null') {
              out += ' else if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; ';
            } else if (it.opts.coerceTypes == 'array' && $type == 'array') {
              out += ' else if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; ';
            }
          }
        }
        out += ' else {   ';
        var $$outStack = $$outStack || [];
        $$outStack.push(out);
        out = ''; /* istanbul ignore else */
        if (it.createErrors !== false) {
          out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \'';
          if ($typeIsArray) {
            out += '' + ($typeSchema.join(","));
          } else {
            out += '' + ($typeSchema);
          }
          out += '\' } ';
          if (it.opts.messages !== false) {
            out += ' , message: \'should be ';
            if ($typeIsArray) {
              out += '' + ($typeSchema.join(","));
            } else {
              out += '' + ($typeSchema);
            }
            out += '\' ';
          }
          if (it.opts.verbose) {
            out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
          }
          out += ' } ';
        } else {
          out += ' {} ';
        }
        var __err = out;
        out = $$outStack.pop();
        if (!it.compositeRule && $breakOnError) {
          /* istanbul ignore if */
          if (it.async) {
            out += ' throw new ValidationError([' + (__err) + ']); ';
          } else {
            out += ' validate.errors = [' + (__err) + ']; return false; ';
          }
        } else {
          out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
        }
        out += ' } if (' + ($coerced) + ' !== undefined) {  ';
        var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',
          $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';
        out += ' ' + ($data) + ' = ' + ($coerced) + '; ';
        if (!$dataLvl) {
          out += 'if (' + ($parentData) + ' !== undefined)';
        }
        out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } ';
      } else {
        var $$outStack = $$outStack || [];
        $$outStack.push(out);
        out = ''; /* istanbul ignore else */
        if (it.createErrors !== false) {
          out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \'';
          if ($typeIsArray) {
            out += '' + ($typeSchema.join(","));
          } else {
            out += '' + ($typeSchema);
          }
          out += '\' } ';
          if (it.opts.messages !== false) {
            out += ' , message: \'should be ';
            if ($typeIsArray) {
              out += '' + ($typeSchema.join(","));
            } else {
              out += '' + ($typeSchema);
            }
            out += '\' ';
          }
          if (it.opts.verbose) {
            out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
          }
          out += ' } ';
        } else {
          out += ' {} ';
        }
        var __err = out;
        out = $$outStack.pop();
        if (!it.compositeRule && $breakOnError) {
          /* istanbul ignore if */
          if (it.async) {
            out += ' throw new ValidationError([' + (__err) + ']); ';
          } else {
            out += ' validate.errors = [' + (__err) + ']; return false; ';
          }
        } else {
          out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
        }
      }
      out += ' } ';
    }
  }
  if (it.schema.$ref && !$refKeywords) {
    out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' ';
    if ($breakOnError) {
      out += ' } if (errors === ';
      if ($top) {
        out += '0';
      } else {
        out += 'errs_' + ($lvl);
      }
      out += ') { ';
      $closingBraces2 += '}';
    }
  } else {
    var arr2 = it.RULES;
    if (arr2) {
      var $rulesGroup, i2 = -1,
        l2 = arr2.length - 1;
      while (i2 < l2) {
        $rulesGroup = arr2[i2 += 1];
        if ($shouldUseGroup($rulesGroup)) {
          if ($rulesGroup.type) {
            out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data, it.opts.strictNumbers)) + ') { ';
          }
          if (it.opts.useDefaults) {
            if ($rulesGroup.type == 'object' && it.schema.properties) {
              var $schema = it.schema.properties,
                $schemaKeys = Object.keys($schema);
              var arr3 = $schemaKeys;
              if (arr3) {
                var $propertyKey, i3 = -1,
                  l3 = arr3.length - 1;
                while (i3 < l3) {
                  $propertyKey = arr3[i3 += 1];
                  var $sch = $schema[$propertyKey];
                  if ($sch.default !== undefined) {
                    var $passData = $data + it.util.getProperty($propertyKey);
                    if (it.compositeRule) {
                      if (it.opts.strictDefaults) {
                        var $defaultMsg = 'default is ignored for: ' + $passData;
                        if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);
                        else throw new Error($defaultMsg);
                      }
                    } else {
                      out += ' if (' + ($passData) + ' === undefined ';
                      if (it.opts.useDefaults == 'empty') {
                        out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' ';
                      }
                      out += ' ) ' + ($passData) + ' = ';
                      if (it.opts.useDefaults == 'shared') {
                        out += ' ' + (it.useDefault($sch.default)) + ' ';
                      } else {
                        out += ' ' + (JSON.stringify($sch.default)) + ' ';
                      }
                      out += '; ';
                    }
                  }
                }
              }
            } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) {
              var arr4 = it.schema.items;
              if (arr4) {
                var $sch, $i = -1,
                  l4 = arr4.length - 1;
                while ($i < l4) {
                  $sch = arr4[$i += 1];
                  if ($sch.default !== undefined) {
                    var $passData = $data + '[' + $i + ']';
                    if (it.compositeRule) {
                      if (it.opts.strictDefaults) {
                        var $defaultMsg = 'default is ignored for: ' + $passData;
                        if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);
                        else throw new Error($defaultMsg);
                      }
                    } else {
                      out += ' if (' + ($passData) + ' === undefined ';
                      if (it.opts.useDefaults == 'empty') {
                        out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' ';
                      }
                      out += ' ) ' + ($passData) + ' = ';
                      if (it.opts.useDefaults == 'shared') {
                        out += ' ' + (it.useDefault($sch.default)) + ' ';
                      } else {
                        out += ' ' + (JSON.stringify($sch.default)) + ' ';
                      }
                      out += '; ';
                    }
                  }
                }
              }
            }
          }
          var arr5 = $rulesGroup.rules;
          if (arr5) {
            var $rule, i5 = -1,
              l5 = arr5.length - 1;
            while (i5 < l5) {
              $rule = arr5[i5 += 1];
              if ($shouldUseRule($rule)) {
                var $code = $rule.code(it, $rule.keyword, $rulesGroup.type);
                if ($code) {
                  out += ' ' + ($code) + ' ';
                  if ($breakOnError) {
                    $closingBraces1 += '}';
                  }
                }
              }
            }
          }
          if ($breakOnError) {
            out += ' ' + ($closingBraces1) + ' ';
            $closingBraces1 = '';
          }
          if ($rulesGroup.type) {
            out += ' } ';
            if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) {
              out += ' else { ';
              var $schemaPath = it.schemaPath + '.type',
                $errSchemaPath = it.errSchemaPath + '/type';
              var $$outStack = $$outStack || [];
              $$outStack.push(out);
              out = ''; /* istanbul ignore else */
              if (it.createErrors !== false) {
                out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \'';
                if ($typeIsArray) {
                  out += '' + ($typeSchema.join(","));
                } else {
                  out += '' + ($typeSchema);
                }
                out += '\' } ';
                if (it.opts.messages !== false) {
                  out += ' , message: \'should be ';
                  if ($typeIsArray) {
                    out += '' + ($typeSchema.join(","));
                  } else {
                    out += '' + ($typeSchema);
                  }
                  out += '\' ';
                }
                if (it.opts.verbose) {
                  out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
                }
                out += ' } ';
              } else {
                out += ' {} ';
              }
              var __err = out;
              out = $$outStack.pop();
              if (!it.compositeRule && $breakOnError) {
                /* istanbul ignore if */
                if (it.async) {
                  out += ' throw new ValidationError([' + (__err) + ']); ';
                } else {
                  out += ' validate.errors = [' + (__err) + ']; return false; ';
                }
              } else {
                out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
              }
              out += ' } ';
            }
          }
          if ($breakOnError) {
            out += ' if (errors === ';
            if ($top) {
              out += '0';
            } else {
              out += 'errs_' + ($lvl);
            }
            out += ') { ';
            $closingBraces2 += '}';
          }
        }
      }
    }
  }
  if ($breakOnError) {
    out += ' ' + ($closingBraces2) + ' ';
  }
  if ($top) {
    if ($async) {
      out += ' if (errors === 0) return data;           ';
      out += ' else throw new ValidationError(vErrors); ';
    } else {
      out += ' validate.errors = vErrors; ';
      out += ' return errors === 0;       ';
    }
    out += ' }; return validate;';
  } else {
    out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';';
  }

  function $shouldUseGroup($rulesGroup) {
    var rules = $rulesGroup.rules;
    for (var i = 0; i < rules.length; i++)
      if ($shouldUseRule(rules[i])) return true;
  }

  function $shouldUseRule($rule) {
    return it.schema[$rule.keyword] !== undefined || ($rule.implements && $ruleImplementsSomeKeyword($rule));
  }

  function $ruleImplementsSomeKeyword($rule) {
    var impl = $rule.implements;
    for (var i = 0; i < impl.length; i++)
      if (it.schema[impl[i]] !== undefined) return true;
  }
  return out;
}

},{}],39:[function(require,module,exports){
'use strict';

var IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i;
var customRuleCode = require('./dotjs/custom');
var definitionSchema = require('./definition_schema');

module.exports = {
  add: addKeyword,
  get: getKeyword,
  remove: removeKeyword,
  validate: validateKeyword
};


/**
 * Define custom keyword
 * @this  Ajv
 * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords).
 * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`.
 * @return {Ajv} this for method chaining
 */
function addKeyword(keyword, definition) {
  /* jshint validthis: true */
  /* eslint no-shadow: 0 */
  var RULES = this.RULES;
  if (RULES.keywords[keyword])
    throw new Error('Keyword ' + keyword + ' is already defined');

  if (!IDENTIFIER.test(keyword))
    throw new Error('Keyword ' + keyword + ' is not a valid identifier');

  if (definition) {
    this.validateKeyword(definition, true);

    var dataType = definition.type;
    if (Array.isArray(dataType)) {
      for (var i=0; i<dataType.length; i++)
        _addRule(keyword, dataType[i], definition);
    } else {
      _addRule(keyword, dataType, definition);
    }

    var metaSchema = definition.metaSchema;
    if (metaSchema) {
      if (definition.$data && this._opts.$data) {
        metaSchema = {
          anyOf: [
            metaSchema,
            { '$ref': 'https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#' }
          ]
        };
      }
      definition.validateSchema = this.compile(metaSchema, true);
    }
  }

  RULES.keywords[keyword] = RULES.all[keyword] = true;


  function _addRule(keyword, dataType, definition) {
    var ruleGroup;
    for (var i=0; i<RULES.length; i++) {
      var rg = RULES[i];
      if (rg.type == dataType) {
        ruleGroup = rg;
        break;
      }
    }

    if (!ruleGroup) {
      ruleGroup = { type: dataType, rules: [] };
      RULES.push(ruleGroup);
    }

    var rule = {
      keyword: keyword,
      definition: definition,
      custom: true,
      code: customRuleCode,
      implements: definition.implements
    };
    ruleGroup.rules.push(rule);
    RULES.custom[keyword] = rule;
  }

  return this;
}


/**
 * Get keyword
 * @this  Ajv
 * @param {String} keyword pre-defined or custom keyword.
 * @return {Object|Boolean} custom keyword definition, `true` if it is a predefined keyword, `false` otherwise.
 */
function getKeyword(keyword) {
  /* jshint validthis: true */
  var rule = this.RULES.custom[keyword];
  return rule ? rule.definition : this.RULES.keywords[keyword] || false;
}


/**
 * Remove keyword
 * @this  Ajv
 * @param {String} keyword pre-defined or custom keyword.
 * @return {Ajv} this for method chaining
 */
function removeKeyword(keyword) {
  /* jshint validthis: true */
  var RULES = this.RULES;
  delete RULES.keywords[keyword];
  delete RULES.all[keyword];
  delete RULES.custom[keyword];
  for (var i=0; i<RULES.length; i++) {
    var rules = RULES[i].rules;
    for (var j=0; j<rules.length; j++) {
      if (rules[j].keyword == keyword) {
        rules.splice(j, 1);
        break;
      }
    }
  }
  return this;
}


/**
 * Validate keyword definition
 * @this  Ajv
 * @param {Object} definition keyword definition object.
 * @param {Boolean} throwError true to throw exception if definition is invalid
 * @return {boolean} validation result
 */
function validateKeyword(definition, throwError) {
  validateKeyword.errors = null;
  var v = this._validateKeyword = this._validateKeyword
                                  || this.compile(definitionSchema, true);

  if (v(definition)) return true;
  validateKeyword.errors = v.errors;
  if (throwError)
    throw new Error('custom keyword definition is invalid: '  + this.errorsText(v.errors));
  else
    return false;
}

},{"./definition_schema":12,"./dotjs/custom":22}],40:[function(require,module,exports){
module.exports={
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
    "description": "Meta-schema for $data reference (JSON Schema extension proposal)",
    "type": "object",
    "required": [ "$data" ],
    "properties": {
        "$data": {
            "type": "string",
            "anyOf": [
                { "format": "relative-json-pointer" }, 
                { "format": "json-pointer" }
            ]
        }
    },
    "additionalProperties": false
}

},{}],41:[function(require,module,exports){
module.exports={
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "http://json-schema.org/draft-07/schema#",
    "title": "Core schema meta-schema",
    "definitions": {
        "schemaArray": {
            "type": "array",
            "minItems": 1,
            "items": { "$ref": "#" }
        },
        "nonNegativeInteger": {
            "type": "integer",
            "minimum": 0
        },
        "nonNegativeIntegerDefault0": {
            "allOf": [
                { "$ref": "#/definitions/nonNegativeInteger" },
                { "default": 0 }
            ]
        },
        "simpleTypes": {
            "enum": [
                "array",
                "boolean",
                "integer",
                "null",
                "number",
                "object",
                "string"
            ]
        },
        "stringArray": {
            "type": "array",
            "items": { "type": "string" },
            "uniqueItems": true,
            "default": []
        }
    },
    "type": ["object", "boolean"],
    "properties": {
        "$id": {
            "type": "string",
            "format": "uri-reference"
        },
        "$schema": {
            "type": "string",
            "format": "uri"
        },
        "$ref": {
            "type": "string",
            "format": "uri-reference"
        },
        "$comment": {
            "type": "string"
        },
        "title": {
            "type": "string"
        },
        "description": {
            "type": "string"
        },
        "default": true,
        "readOnly": {
            "type": "boolean",
            "default": false
        },
        "examples": {
            "type": "array",
            "items": true
        },
        "multipleOf": {
            "type": "number",
            "exclusiveMinimum": 0
        },
        "maximum": {
            "type": "number"
        },
        "exclusiveMaximum": {
            "type": "number"
        },
        "minimum": {
            "type": "number"
        },
        "exclusiveMinimum": {
            "type": "number"
        },
        "maxLength": { "$ref": "#/definitions/nonNegativeInteger" },
        "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
        "pattern": {
            "type": "string",
            "format": "regex"
        },
        "additionalItems": { "$ref": "#" },
        "items": {
            "anyOf": [
                { "$ref": "#" },
                { "$ref": "#/definitions/schemaArray" }
            ],
            "default": true
        },
        "maxItems": { "$ref": "#/definitions/nonNegativeInteger" },
        "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
        "uniqueItems": {
            "type": "boolean",
            "default": false
        },
        "contains": { "$ref": "#" },
        "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" },
        "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
        "required": { "$ref": "#/definitions/stringArray" },
        "additionalProperties": { "$ref": "#" },
        "definitions": {
            "type": "object",
            "additionalProperties": { "$ref": "#" },
            "default": {}
        },
        "properties": {
            "type": "object",
            "additionalProperties": { "$ref": "#" },
            "default": {}
        },
        "patternProperties": {
            "type": "object",
            "additionalProperties": { "$ref": "#" },
            "propertyNames": { "format": "regex" },
            "default": {}
        },
        "dependencies": {
            "type": "object",
            "additionalProperties": {
                "anyOf": [
                    { "$ref": "#" },
                    { "$ref": "#/definitions/stringArray" }
                ]
            }
        },
        "propertyNames": { "$ref": "#" },
        "const": true,
        "enum": {
            "type": "array",
            "items": true,
            "minItems": 1,
            "uniqueItems": true
        },
        "type": {
            "anyOf": [
                { "$ref": "#/definitions/simpleTypes" },
                {
                    "type": "array",
                    "items": { "$ref": "#/definitions/simpleTypes" },
                    "minItems": 1,
                    "uniqueItems": true
                }
            ]
        },
        "format": { "type": "string" },
        "contentMediaType": { "type": "string" },
        "contentEncoding": { "type": "string" },
        "if": {"$ref": "#"},
        "then": {"$ref": "#"},
        "else": {"$ref": "#"},
        "allOf": { "$ref": "#/definitions/schemaArray" },
        "anyOf": { "$ref": "#/definitions/schemaArray" },
        "oneOf": { "$ref": "#/definitions/schemaArray" },
        "not": { "$ref": "#" }
    },
    "default": true
}

},{}],42:[function(require,module,exports){
'use strict';

// do not edit .js files directly - edit src/index.jst



module.exports = function equal(a, b) {
  if (a === b) return true;

  if (a && b && typeof a == 'object' && typeof b == 'object') {
    if (a.constructor !== b.constructor) return false;

    var length, i, keys;
    if (Array.isArray(a)) {
      length = a.length;
      if (length != b.length) return false;
      for (i = length; i-- !== 0;)
        if (!equal(a[i], b[i])) return false;
      return true;
    }



    if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
    if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
    if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();

    keys = Object.keys(a);
    length = keys.length;
    if (length !== Object.keys(b).length) return false;

    for (i = length; i-- !== 0;)
      if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;

    for (i = length; i-- !== 0;) {
      var key = keys[i];

      if (!equal(a[key], b[key])) return false;
    }

    return true;
  }

  // true if both NaN, false otherwise
  return a!==a && b!==b;
};

},{}],43:[function(require,module,exports){
'use strict';

module.exports = function (data, opts) {
    if (!opts) opts = {};
    if (typeof opts === 'function') opts = { cmp: opts };
    var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;

    var cmp = opts.cmp && (function (f) {
        return function (node) {
            return function (a, b) {
                var aobj = { key: a, value: node[a] };
                var bobj = { key: b, value: node[b] };
                return f(aobj, bobj);
            };
        };
    })(opts.cmp);

    var seen = [];
    return (function stringify (node) {
        if (node && node.toJSON && typeof node.toJSON === 'function') {
            node = node.toJSON();
        }

        if (node === undefined) return;
        if (typeof node == 'number') return isFinite(node) ? '' + node : 'null';
        if (typeof node !== 'object') return JSON.stringify(node);

        var i, out;
        if (Array.isArray(node)) {
            out = '[';
            for (i = 0; i < node.length; i++) {
                if (i) out += ',';
                out += stringify(node[i]) || 'null';
            }
            return out + ']';
        }

        if (node === nu   ll) return 'null';

        if (seen.indexOf(node) !== -1) {
            if (cycles) return JSON.stringify('__cycle__');
            throw new TypeError('Converting circular structure to JSON');
        }

        var seenIndex = seen.push(node) - 1;
        var keys = Object.keys(node).sort(cmp && cmp(node));
        out = '';
        for (i = 0; i < keys.length; i++) {
            var key = keys[i];
            var value = stringify(node[key]);

            if (!value) continue;
            if (out) out += ',';
            out += JSON.stringify(key) + ':' + value;
        }
        seen.splice(seenIndex, 1);
        return '{' + out + '}';
    })(data);
};

},{}],44:[function(require,module,exports){
'use strict';

var traverse = module.exports = function (schema, opts, cb) {
  // Legacy support for v0.3.1 and earlier.
  if (typeof opts == 'function') {
    cb = opts;
    opts = {};
  }

  cb = opts.cb || cb;
  var pre = (typeof cb == 'function') ? cb : cb.pre || function() {};
  var post = cb.post || function() {};

  _traverse(opts, pre, post, schema, '', schema);
};


traverse.keywords = {
  additionalItems: true,
  items: true,
  contains: true,
  additionalProperties: true,
  propertyNames: true,
  not: true
};

traverse.arrayKeywords = {
  items: true,
  allOf: true,
  anyOf: true,
  oneOf: true
};

traverse.propsKeywords = {
  definitions: true,
  properties: true,
  patternProperties: true,
  dependencies: true
};

traverse.skipKeywords = {
  default: true,
  enum: true,
  const: true,
  required: true,
  maximum: true,
  minimum: true,
  exclusiveMaximum: true,
  exclusiveMinimum: true,
  multipleOf: true,
  maxLength: true,
  minLength: true,
  pattern: true,
  format: true,
  maxItems: true,
  minItems: true,
  uniqueItems: true,
  maxProperties: true,
  minProperties: true
};


function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
  if (schema && typeof schema == 'object' && !Array.isArray(schema)) {
    pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
    for (var key in schema) {
      var sch = schema[key];
      if (Array.isArray(sch)) {
        if (key in traverse.arrayKeywords) {
          for (var i=0; i<sch.length; i++)
            _traverse(opts, pre, post, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i);
        }
      } else if (key in traverse.propsKeywords) {
        if (sch && typeof sch == 'object') {
          for (var prop in sch)
            _traverse(opts, pre, post, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);
        }
      } else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) {
        _traverse(opts, pre, post, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema);
      }
    }
    post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
  }
}


function escapeJsonPtr(str) {
  return str.replace(/~/g, '~0').replace(/\//g, '~1');
}

},{}],45:[function(require,module,exports){
/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
(function (global, factory) {
	typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
	typeof define === 'function' && define.amd ? define(['exports'], factory) :
	(factory((global.URI = global.URI || {})));
}(this, (function (exports) { 'use strict';

function merge() {
    for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) {
        sets[_key] = arguments[_key];
    }

    if (sets.length > 1) {
        sets[0] = sets[0].slice(0, -1);
        var xl = sets.length - 1;
        for (var x = 1; x < xl; ++x) {
            sets[x] = sets[x].slice(1, -1);
        }
        sets[xl] = sets[xl].slice(1);
        return sets.join('');
    } else {
        return sets[0];
    }
}
function subexp(str) {
    return "(?:" + str + ")";
}
function typeOf(o) {
    return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase();
}
function toUpperCase(str) {
    return str.toUpperCase();
}
function toArray(obj) {
    return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : [];
}
function assign(target, source) {
    var obj = target;
    if (source) {
        for (var key in source) {
            obj[key] = source[key];
        }
    }
    return obj;
}

function buildExps(isIRI) {
    var ALPHA$$ = "[A-Za-z]",
        CR$ = "[\\x0D]",
        DIGIT$$ = "[0-9]",
        DQUOTE$$ = "[\\x22]",
        HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"),
        //case-insensitive
    LF$$ = "[\\x0A]",
        SP$$ = "[\\x20]",
        PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)),
        //expanded
    GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]",
        SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",
        RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),
        UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]",
        //subset, excludes bidi control characters
    IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]",
        //subset
    UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$),
        SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"),
        USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"),
        DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$),
        DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$),
        //relaxed parsing rules
    IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$),
        H16$ = subexp(HEXDIG$$ + "{1,4}"),
        LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$),
        IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$),
        //                           6( h16 ":" ) ls32
    IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$),
        //                      "::" 5( h16 ":" ) ls32
    IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$),
        //[               h16 ] "::" 4( h16 ":" ) ls32
    IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$),
        //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
    IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$),
        //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
    IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$),
        //[ *3( h16 ":" ) h16 ] "::"    h16 ":"   ls32
    IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$),
        //[ *4( h16 ":" ) h16 ] "::"              ls32
    IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$),
        //[ *5( h16 ":" ) h16 ] "::"              h16
    IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"),
        //[ *6( h16 ":" ) h16 ] "::"
    IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")),
        ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"),
        //RFC 6874
    IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$),
        //RFC 6874
    IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$),
        //RFC 6874, with relaxed parsing rules
    IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"),
        IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"),
        //RFC 6874
    REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"),
        HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$),
        PORT$ = subexp(DIGIT$$ + "*"),
        AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"),
        PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")),
        SEGMENT$ = subexp(PCHAR$ + "*"),
        SEGMENT_NZ$ = subexp(PCHAR$ + "+"),
        SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"),
        PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"),
        PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"),
        //simplified
    PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$),
        //simplified
    PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$),
        //simplified
    PATH_EMPTY$ = "(?!" + PCHAR$ + ")",
        PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$),
        QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"),
        FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"),
        HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$),
        URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"),
        RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$),
        RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"),
        URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$),
        ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"),
        GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$",
        RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$",
        ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$",
        SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$",
        AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$";
    return {
        NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"),
        NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
        NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
        NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
        NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
        NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"),
        NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"),
        ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"),
        UNRESERVED: new RegExp(UNRESERVED$$, "g"),
        OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"),
        PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"),
        IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"),
        IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules
    };
}
var URI_PROTOCOL = buildExps(false);

var IRI_PROTOCOL = buildExps(true);

var slicedToArray = function () {
  function sliceIterator(arr, i) {
    var _arr = [];
    var _n = true;
    var _d = false;
    var _e = undefined;

    try {
      for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
        _arr.push(_s.value);

        if (i && _arr.length === i) break;
      }
    } catch (err) {
      _d = true;
      _e = err;
    } finally {
      try {
        if (!_n && _i["return"]) _i["return"]();
      } finally {
        if (_d) throw _e;
      }
    }

    return _arr;
  }

  return function (arr, i) {
    if (Array.isArray(arr)) {
      return arr;
    } else if (Symbol.iterator in Object(arr)) {
      return sliceIterator(arr, i);
    } else {
      throw new TypeError("Invalid attempt to destructure non-iterable instance");
    }
  };
}();













var toConsumableArray = function (arr) {
  if (Array.isArray(arr)) {
    for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];

    return arr2;
  } else {
    return Array.from(arr);
  }
};

/** Highest positive signed 32-bit float value */

var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1

/** Bootstring parameters */
var base = 36;
var tMin = 1;
var tMax = 26;
var skew = 38;
var damp = 700;
var initialBias = 72;
var initialN = 128; // 0x80
var delimiter = '-'; // '\x2D'

/** Regular expressions */
var regexPunycode = /^xn--/;
var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars
var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators

/** Error messages */
var errors = {
	'overflow': 'Overflow: input needs wider integers to process',
	'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
	'invalid-input': 'Invalid input'
};

/** Convenience shortcuts */
var baseMinusTMin = base - tMin;
var floor = Math.floor;
var stringFromCharCode = String.fromCharCode;

/*--------------------------------------------------------------------------*/

/**
 * A generic error utility function.
 * @private
 * @param {String} type The error type.
 * @returns {Error} Throws a `RangeError` with the applicable error message.
 */
function error$1(type) {
	throw new RangeError(errors[type]);
}

/**
 * A generic `Array#map` utility function.
 * @private
 * @param {Array} array The array to iterate over.
 * @param {Function} callback The function that gets called for every array
 * item.
 * @returns {Array} A new array of values returned by the callback function.
 */
function map(array, fn) {
	var result = [];
	var length = array.length;
	while (length--) {
		result[length] = fn(array[length]);
	}
	return result;
}

/**
 * A simple `Array#map`-like wrapper to work with domain name strings or email
 * addresses.
 * @private
 * @param {String} domain The domain name or email address.
 * @param {Function} callback The function that gets called for every
 * character.
 * @returns {Array} A new string of characters returned by the callback
 * function.
 */
function mapDomain(string, fn) {
	var parts = string.split('@');
	var result = '';
	if (parts.length > 1) {
		// In email addresses, only the domain name should be punycoded. Leave
		// the local part (i.e. everything up to `@`) intact.
		result = parts[0] + '@';
		string = parts[1];
	}
	// Avoid `split(regex)` for IE8 compatibility. See #17.
	string = string.replace(regexSeparators, '\x2E');
	var labels = string.split('.');
	var encoded = map(labels, fn).join('.');
	return result + encoded;
}

/**
 * Creates an array containing the numeric code points of each Unicode
 * character in the string. While JavaScript uses UCS-2 internally,
 * this function will convert a pair of surrogate halves (each of which
 * UCS-2 exposes as separate characters) into a single code point,
 * matching UTF-16.
 * @see `punycode.ucs2.encode`
 * @see <https://mathiasbynens.be/notes/javascript-encoding>
 * @memberOf punycode.ucs2
 * @name decode
 * @param {String} string The Unicode input string (UCS-2).
 * @returns {Array} The new array of code points.
 */
function ucs2decode(string) {
	var output = [];
	var counter = 0;
	var length = string.length;
	while (counter < length) {
		var value = string.charCodeAt(counter++);
		if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
			// It's a high surrogate, and there is a next character.
			var extra = string.charCodeAt(counter++);
			if ((extra & 0xFC00) == 0xDC00) {
				// Low surrogate.
				output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
			} else {
				// It's an unmatched surrogate; only append this code unit, in case the
				// next code unit is the high surrogate of a surrogate pair.
				output.push(value);
				counter--;
			}
		} else {
			output.push(value);
		}
	}
	return output;
}

/**
 * Creates a string based on an array of numeric code points.
 * @see `punycode.ucs2.decode`
 * @memberOf punycode.ucs2
 * @name encode
 * @param {Array} codePoints The array of numeric code points.
 * @returns {String} The new Unicode string (UCS-2).
 */
var ucs2encode = function ucs2encode(array) {
	return String.fromCodePoint.apply(String, toConsumableArray(array));
};

/**
 * Converts a basic code point into a digit/integer.
 * @see `digitToBasic()`
 * @private
 * @param {Number} codePoint The basic numeric code point value.
 * @returns {Number} The numeric value of a basic code point (for use in
 * representing integers) in the range `0` to `base - 1`, or `base` if
 * the code point does not represent a value.
 */
var basicToDigit = function basicToDigit(codePoint) {
	if (codePoint - 0x30 < 0x0A) {
		return codePoint - 0x16;
	}
	if (codePoint - 0x41 < 0x1A) {
		return codePoint - 0x41;
	}
	if (codePoint - 0x61 < 0x1A) {
		return codePoint - 0x61;
	}
	return base;
};

/**
 * Converts a digit/integer into a basic code point.
 * @see `basicToDigit()`
 * @private
 * @param {Number} digit The numeric value of a basic code point.
 * @returns {Number} The basic code point whose value (when used for
 * representing integers) is `digit`, which needs to be in the range
 * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
 * used; else, the lowercase form is used. The behavior is undefined
 * if `flag` is non-zero and `digit` has no uppercase form.
 */
var digitToBasic = function digitToBasic(digit, flag) {
	//  0..25 map to ASCII a..z or A..Z
	// 26..35 map to ASCII 0..9
	return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
};

/**
 * Bias adaptation function as per section 3.4 of RFC 3492.
 * https://tools.ietf.org/html/rfc3492#section-3.4
 * @private
 */
var adapt = function adapt(delta, numPoints, firstTime) {
	var k = 0;
	delta = firstTime ? floor(delta / damp) : delta >> 1;
	delta += floor(delta / numPoints);
	for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) {
		delta = floor(delta / baseMinusTMin);
	}
	return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
};

/**
 * Converts a Punycode string of ASCII-only symbols to a string of Unicode
 * symbols.
 * @memberOf punycode
 * @param {String} input The Punycode string of ASCII-only symbols.
 * @returns {String} The resulting string of Unicode symbols.
 */
var decode = function decode(input) {
	// Don't use UCS-2.
	var output = [];
	var inputLength = input.length;
	var i = 0;
	var n = initialN;
	var bias = initialBias;

	// Handle the basic code points: let `basic` be the number of input code
	// points before the last delimiter, or `0` if there is none, then copy
	// the first basic code points to the output.

	var basic = input.lastIndexOf(delimiter);
	if (basic < 0) {
		basic = 0;
	}

	for (var j = 0; j < basic; ++j) {
		// if it's not a basic code point
		if (input.charCodeAt(j) >= 0x80) {
			error$1('not-basic');
		}
		output.push(input.charCodeAt(j));
	}

	// Main decoding loop: start just after the last delimiter if any basic code
	// points were copied; start at the beginning otherwise.

	for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{

		// `index` is the index of the next character to be consumed.
		// Decode a generalized variable-length integer into `delta`,
		// which gets added to `i`. The overflow checking is easier
		// if we increase `i` as we go, then subtract off its starting
		// value at the end to obtain `delta`.
		var oldi = i;
		for (var w = 1, k = base;; /* no condition */k += base) {

			if (index >= inputLength) {
				error$1('invalid-input');
			}

			var digit = basicToDigit(input.charCodeAt(index++));

			if (digit >= base || digit > floor((maxInt - i) / w)) {
				error$1('overflow');
			}

			i += digit * w;
			var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;

			if (digit < t) {
				break;
			}

			var baseMinusT = base - t;
			if (w > floor(maxInt / baseMinusT)) {
				error$1('overflow');
			}

			w *= baseMinusT;
		}

		var out = output.length + 1;
		bias = adapt(i - oldi, out, oldi == 0);

		// `i` was supposed to wrap around from `out` to `0`,
		// incrementing `n` each time, so we'll fix that now:
		if (floor(i / out) > maxInt - n) {
			error$1('overflow');
		}

		n += floor(i / out);
		i %= out;

		// Insert `n` at position `i` of the output.
		output.splice(i++, 0, n);
	}

	return String.fromCodePoint.apply(String, output);
};

/**
 * Converts a string of Unicode symbols (e.g. a domain name label) to a
 * Punycode string of ASCII-only symbols.
 * @memberOf punycode
 * @param {String} input The string of Unicode symbols.
 * @returns {String} The resulting Punycode string of ASCII-only symbols.
 */
var encode = function encode(input) {
	var output = [];

	// Convert the input in UCS-2 to an array of Unicode code points.
	input = ucs2decode(input);

	// Cache the length.
	var inputLength = input.length;

	// Initialize the state.
	var n = initialN;
	var delta = 0;
	var bias = initialBias;

	// Handle the basic code points.
	var _iteratorNormalCompletion = true;
	var _didIteratorError = false;
	var _iteratorError = undefined;

	try {
		for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
			var _currentValue2 = _step.value;

			if (_currentValue2 < 0x80) {
				output.push(stringFromCharCode(_currentValue2));
			}
		}
	} catch (err) {
		_didIteratorError = true;
		_iteratorError = err;
	} finally {
		try {
			if (!_iteratorNormalCompletion && _iterator.return) {
				_iterator.return();
			}
		} finally {
			if (_didIteratorError) {
				throw _iteratorError;
			}
		}
	}

	var basicLength = output.length;
	var handledCPCount = basicLength;

	// `handledCPCount` is the number of code points that have been handled;
	// `basicLength` is the number of basic code points.

	// Finish the basic string with a delimiter unless it's empty.
	if (basicLength) {
		output.push(delimiter);
	}

	// Main encoding loop:
	while (handledCPCount < inputLength) {

		// All non-basic code points < n have been handled already. Find the next
		// larger one:
		var m = maxInt;
		var _iteratorNormalCompletion2 = true;
		var _didIteratorError2 = false;
		var _iteratorError2 = undefined;

		try {
			for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
				var currentValue = _step2.value;

				if (currentValue >= n && currentValue < m) {
					m = currentValue;
				}
			}

			// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
			// but guard against overflow.
		} catch (err) {
			_didIteratorError2 = true;
			_iteratorError2 = err;
		} finally {
			try {
				if (!_iteratorNormalCompletion2 && _iterator2.return) {
					_iterator2.return();
				}
			} finally {
				if (_didIteratorError2) {
					throw _iteratorError2;
				}
			}
		}

		var handledCPCountPlusOne = handledCPCount + 1;
		if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
			error$1('overflow');
		}

		delta += (m - n) * handledCPCountPlusOne;
		n = m;

		var _iteratorNormalCompletion3 = true;
		var _didIteratorError3 = false;
		var _iteratorError3 = undefined;

		try {
			for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
				var _currentValue = _step3.value;

				if (_currentValue < n && ++delta > maxInt) {
					error$1('overflow');
				}
				if (_currentValue == n) {
					// Represent delta as a generalized variable-length integer.
					var q = delta;
					for (var k = base;; /* no condition */k += base) {
						var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
						if (q < t) {
							break;
						}
						var qMinusT = q - t;
						var baseMinusT = base - t;
						output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)));
						q = floor(qMinusT / baseMinusT);
					}

					output.push(stringFromCharCode(digitToBasic(q, 0)));
					bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
					delta = 0;
					++handledCPCount;
				}
			}
		} catch (err) {
			_didIteratorError3 = true;
			_iteratorError3 = err;
		} finally {
			try {
				if (!_iteratorNormalCompletion3 && _iterator3.return) {
					_iterator3.return();
				}
			} finally {
				if (_didIteratorError3) {
					throw _iteratorError3;
				}
			}
		}

		++delta;
		++n;
	}
	return output.join('');
};

/**
 * Converts a Punycode string representing a domain name or an email address
 * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
 * it doesn't matter if you call it on a string that has already been
 * converted to Unicode.
 * @memberOf punycode
 * @param {String} input The Punycoded domain name or email address to
 * convert to Unicode.
 * @returns {String} The Unicode representation of the given Punycode
 * string.
 */
var toUnicode = function toUnicode(input) {
	return mapDomain(input, function (string) {
		return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
	});
};

/**
 * Converts a Unicode string representing a domain name or an email address to
 * Punycode. Only the non-ASCII parts of the domain name will be converted,
 * i.e. it doesn't matter if you call it with a domain that's already in
 * ASCII.
 * @memberOf punycode
 * @param {String} input The domain name or email address to convert, as a
 * Unicode string.
 * @returns {String} The Punycode representation of the given domain name or
 * email address.
 */
var toASCII = function toASCII(input) {
	return mapDomain(input, function (string) {
		return regexNonASCII.test(string) ? 'xn--' + encode(string) : string;
	});
};

/*--------------------------------------------------------------------------*/

/** Define the public API */
var punycode = {
	/**
  * A string representing the current Punycode.js version number.
  * @memberOf punycode
  * @type String
  */
	'version': '2.1.0',
	/**
  * An object of methods to convert from JavaScript's internal character
  * representation (UCS-2) to Unicode code points, and back.
  * @see <https://mathiasbynens.be/notes/javascript-encoding>
  * @memberOf punycode
  * @type Object
  */
	'ucs2': {
		'decode': ucs2decode,
		'encode': ucs2encode
	},
	'decode': decode,
	'encode': encode,
	'toASCII': toASCII,
	'toUnicode': toUnicode
};

/**
 * URI.js
 *
 * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.
 * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
 * @see http://github.com/garycourt/uri-js
 */
/**
 * Copyright 2011 Gary Court. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification, are
 * permitted provided that the following conditions are met:
 *
 *    1. Redistributions of source code must retain the above copyright notice, this list of
 *       conditions and the following disclaimer.
 *
 *    2. Redistributions in binary form must reproduce the above copyright notice, this list
 *       of conditions and the following disclaimer in the documentation and/or other materials
 *       provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * The views and conclusions contained in the software and documentation are those of the
 * authors and should not be interpreted as representing official policies, either expressed
 * or implied, of Gary Court.
 */
var SCHEMES = {};
function pctEncChar(chr) {
    var c = chr.charCodeAt(0);
    var e = void 0;
    if (c < 16) e = "%0" + c.toString(16).toUpperCase();else if (c < 128) e = "%" + c.toString(16).toUpperCase();else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();
    return e;
}
function pctDecChars(str) {
    var newStr = "";
    var i = 0;
    var il = str.length;
    while (i < il) {
        var c = parseInt(str.substr(i + 1, 2), 16);
        if (c < 128) {
            newStr += String.fromCharCode(c);
            i += 3;
        } else if (c >= 194 && c < 224) {
            if (il - i >= 6) {
                var c2 = parseInt(str.substr(i + 4, 2), 16);
                newStr += String.fromCharCode((c & 31) << 6 | c2 & 63);
            } else {
                newStr += str.substr(i, 6);
            }
            i += 6;
        } else if (c >= 224) {
            if (il - i >= 9) {
                var _c = parseInt(str.substr(i + 4, 2), 16);
                var c3 = parseInt(str.substr(i + 7, 2), 16);
                newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63);
            } else {
                newStr += str.substr(i, 9);
            }
            i += 9;
        } else {
            newStr += str.substr(i, 3);
            i += 3;
        }
    }
    return newStr;
}
function _normalizeComponentEncoding(components, protocol) {
    function decodeUnreserved(str) {
        var decStr = pctDecChars(str);
        return !decStr.match(protocol.UNRESERVED) ? str : decStr;
    }
    if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, "");
    if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
    if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
    if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
    if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
    if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
    return components;
}

function _stripLeadingZeros(str) {
    return str.replace(/^0*(.*)/, "$1") || "0";
}
function _normalizeIPv4(host, protocol) {
    var matches = host.match(protocol.IPV4ADDRESS) || [];

    var _matches = slicedToArray(matches, 2),
        address = _matches[1];

    if (address) {
        return address.split(".").map(_stripLeadingZeros).join(".");
    } else {
        return host;
    }
}
function _normalizeIPv6(host, protocol) {
    var matches = host.match(protocol.IPV6ADDRESS) || [];

    var _matches2 = slicedToArray(matches, 3),
        address = _matches2[1],
        zone = _matches2[2];

    if (address) {
        var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(),
            _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2),
            last = _address$toLowerCase$2[0],
            first = _address$toLowerCase$2[1];

        var firstFields = first ? first.split(":").map(_stripLeadingZeros) : [];
        var lastFields = last.split(":").map(_stripLeadingZeros);
        var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);
        var fieldCount = isLastFieldIPv4Address ? 7 : 8;
        var lastFieldsStart = lastFields.length - fieldCount;
        var fields = Array(fieldCount);
        for (var x = 0; x < fieldCount; ++x) {
            fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';
        }
        if (isLastFieldIPv4Address) {
            fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);
        }
        var allZeroFields = fields.reduce(function (acc, field, index) {
            if (!field || field === "0") {
                var lastLongest = acc[acc.length - 1];
                if (lastLongest && lastLongest.index + lastLongest.length === index) {
                    lastLongest.length++;
                } else {
                    acc.push({ index: index, length: 1 });
                }
            }
            return acc;
        }, []);
        var longestZeroFields = allZeroFields.sort(function (a, b) {
            return b.length - a.length;
        })[0];
        var newHost = void 0;
        if (longestZeroFields && longestZeroFields.length > 1) {
            var newFirst = fields.slice(0, longestZeroFields.index);
            var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);
            newHost = newFirst.join(":") + "::" + newLast.join(":");
        } else {
            newHost = fields.join(":");
        }
        if (zone) {
            newHost += "%" + zone;
        }
        return newHost;
    } else {
        return host;
    }
}
var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;
var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined;
function parse(uriString) {
    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

    var components = {};
    var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
    if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString;
    var matches = uriString.match(URI_PARSE);
    if (matches) {
        if (NO_MATCH_IS_UNDEFINED) {
            //store each component
            components.scheme = matches[1];
            components.userinfo = matches[3];
            components.host = matches[4];
            components.port = parseInt(matches[5], 10);
            components.path = matches[6] || "";
            components.query = matches[7];
            components.fragment = matches[8];
            //fix port number
            if (isNaN(components.port)) {
                components.port = matches[5];
            }
        } else {
            //IE FIX for improper RegExp matching
            //store each component
            components.scheme = matches[1] || undefined;
            components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined;
            components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined;
            components.port = parseInt(matches[5], 10);
            components.path = matches[6] || "";
            components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined;
            components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined;
            //fix port number
            if (isNaN(components.port)) {
                components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined;
            }
        }
        if (components.host) {
            //normalize IP hosts
            components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);
        }
        //determine reference type
        if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {
            components.reference = "same-document";
        } else if (components.scheme === undefined) {
            components.reference = "relative";
        } else if (components.fragment === undefined) {
            components.reference = "absolute";
        } else {
            components.reference = "uri";
        }
        //check for reference errors
        if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) {
            components.error = components.error || "URI is not a " + options.reference + " reference.";
        }
        //find scheme handler
        var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
        //check if scheme can't handle IRIs
        if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
            //if host component is a domain name
            if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) {
                //convert Unicode IDN -> ASCII IDN
                try {
                    components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());
                } catch (e) {
                    components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e;
                }
            }
            //convert IRI -> URI
            _normalizeComponentEncoding(components, URI_PROTOCOL);
        } else {
            //normalize encodings
            _normalizeComponentEncoding(components, protocol);
        }
        //perform scheme specific parsing
        if (schemeHandler && schemeHandler.parse) {
            schemeHandler.parse(components, options);
        }
    } else {
        components.error = components.error || "URI can not be parsed.";
    }
    return components;
}

function _recomposeAuthority(components, options) {
    var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
    var uriTokens = [];
    if (components.userinfo !== undefined) {
        uriTokens.push(components.userinfo);
        uriTokens.push("@");
    }
    if (components.host !== undefined) {
        //normalize IP hosts, add brackets and escape zone separator for IPv6
        uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) {
            return "[" + $1 + ($2 ? "%25" + $2 : "") + "]";
        }));
    }
    if (typeof components.port === "number" || typeof components.port === "string") {
        uriTokens.push(":");
        uriTokens.push(String(components.port));
    }
    return uriTokens.length ? uriTokens.join("") : undefined;
}

var RDS1 = /^\.\.?\//;
var RDS2 = /^\/\.(\/|$)/;
var RDS3 = /^\/\.\.(\/|$)/;
var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/;
function removeDotSegments(input) {
    var output = [];
    while (input.length) {
        if (input.match(RDS1)) {
            input = input.replace(RDS1, "");
        } else if (input.match(RDS2)) {
            input = input.replace(RDS2, "/");
        } else if (input.match(RDS3)) {
            input = input.replace(RDS3, "/");
            output.pop();
        } else if (input === "." || input === "..") {
            input = "";
        } else {
            var im = input.match(RDS5);
            if (im) {
                var s = im[0];
                input = input.slice(s.length);
                output.push(s);
            } else {
                throw new Error("Unexpected dot segment condition");
            }
        }
    }
    return output.join("");
}

function serialize(components) {
    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

    var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL;
    var uriTokens = [];
    //find scheme handler
    var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
    //perform scheme specific serialization
    if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);
    if (components.host) {
        //if host component is an IPv6 address
        if (protocol.IPV6ADDRESS.test(components.host)) {}
        //TODO: normalize IPv6 address as per RFC 5952

        //if host component is a domain name
        else if (options.domainHost || schemeHandler && schemeHandler.domainHost) {
                //convert IDN via punycode
                try {
                    components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host);
                } catch (e) {
                    components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
                }
            }
    }
    //normalize encoding
    _normalizeComponentEncoding(components, protocol);
    if (options.reference !== "suffix" && components.scheme) {
        uriTokens.push(components.scheme);
        uriTokens.push(":");
    }
    var authority = _recomposeAuthority(components, options);
    if (authority !== undefined) {
        if (options.reference !== "suffix") {
            uriTokens.push("//");
        }
        uriTokens.push(authority);
        if (components.path && components.path.charAt(0) !== "/") {
            uriTokens.push("/");
        }
    }
    if (components.path !== undefined) {
        var s = components.path;
        if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
            s = removeDotSegments(s);
        }
        if (authority === undefined) {
            s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//"
        }
        uriTokens.push(s);
    }
    if (components.query !== undefined) {
        uriTokens.push("?");
        uriTokens.push(components.query);
    }
    if (components.fragment !== undefined) {
        uriTokens.push("#");
        uriTokens.push(components.fragment);
    }
    return uriTokens.join(""); //merge tokens into a string
}

function resolveComponents(base, relative) {
    var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
    var skipNormalization = arguments[3];

    var target = {};
    if (!skipNormalization) {
        base = parse(serialize(base, options), options); //normalize base components
        relative = parse(serialize(relative, options), options); //normalize relative components
    }
    options = options || {};
    if (!options.tolerant && relative.scheme) {
        target.scheme = relative.scheme;
        //target.authority = relative.authority;
        target.userinfo = relative.userinfo;
        target.host = relative.host;
        target.port = relative.port;
        target.path = removeDotSegments(relative.path || "");
        target.query = relative.query;
    } else {
        if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {
            //target.authority = relative.authority;
            target.userinfo = relative.userinfo;
            target.host = relative.host;
            target.port = relative.port;
            target.path = removeDotSegments(relative.path || "");
            target.query = relative.query;
        } else {
            if (!relative.path) {
                target.path = base.path;
                if (relative.query !== undefined) {
                    target.query = relative.query;
                } else {
                    target.query = base.query;
                }
            } else {
                if (relative.path.charAt(0) === "/") {
                    target.path = removeDotSegments(relative.path);
                } else {
                    if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
                        target.path = "/" + relative.path;
                    } else if (!base.path) {
                        target.path = relative.path;
                    } else {
                        target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
                    }
                    target.path = removeDotSegments(target.path);
                }
                target.query = relative.query;
            }
            //target.authority = base.authority;
            target.userinfo = base.userinfo;
            target.host = base.host;
            target.port = base.port;
        }
        target.scheme = base.scheme;
    }
    target.fragment = relative.fragment;
    return target;
}

function resolve(baseURI, relativeURI, options) {
    var schemelessOptions = assign({ scheme: 'null' }, options);
    return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
}

function normalize(uri, options) {
    if (typeof uri === "string") {
        uri = serialize(parse(uri, options), options);
    } else if (typeOf(uri) === "object") {
        uri = parse(serialize(uri, options), options);
    }
    return uri;
}

function equal(uriA, uriB, options) {
    if (typeof uriA === "string") {
        uriA = serialize(parse(uriA, options), options);
    } else if (typeOf(uriA) === "object") {
        uriA = serialize(uriA, options);
    }
    if (typeof uriB === "string") {
        uriB = serialize(parse(uriB, options), options);
    } else if (typeOf(uriB) === "object") {
        uriB = serialize(uriB, options);
    }
    return uriA === uriB;
}

function escapeComponent(str, options) {
    return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar);
}

function unescapeComponent(str, options) {
    return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars);
}

var handler = {
    scheme: "http",
    domainHost: true,
    parse: function parse(components, options) {
        //report missing host
        if (!components.host) {
            components.error = components.error || "HTTP URIs must have a host.";
        }
        return components;
    },
    serialize: function serialize(components, options) {
        var secure = String(components.scheme).toLowerCase() === "https";
        //normalize the default port
        if (components.port === (secure ? 443 : 80) || components.port === "") {
            components.port = undefined;
        }
        //normalize the empty path
        if (!components.path) {
            components.path = "/";
        }
        //NOTE: We do not parse query strings for HTTP URIs
        //as WWW Form Url Encoded query strings are part of the HTML4+ spec,
        //and not the HTTP spec.
        return components;
    }
};

var handler$1 = {
    scheme: "https",
    domainHost: handler.domainHost,
    parse: handler.parse,
    serialize: handler.serialize
};

function isSecure(wsComponents) {
    return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
}
//RFC 6455
var handler$2 = {
    scheme: "ws",
    domainHost: true,
    parse: function parse(components, options) {
        var wsComponents = components;
        //indicate if the secure flag is set
        wsComponents.secure = isSecure(wsComponents);
        //construct resouce name
        wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');
        wsComponents.path = undefined;
        wsComponents.query = undefined;
        return wsComponents;
    },
    serialize: function serialize(wsComponents, options) {
        //normalize the default port
        if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
            wsComponents.port = undefined;
        }
        //ensure scheme matches secure flag
        if (typeof wsComponents.secure === 'boolean') {
            wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws';
            wsComponents.secure = undefined;
        }
        //reconstruct path from resource name
        if (wsComponents.resourceName) {
            var _wsComponents$resourc = wsComponents.resourceName.split('?'),
                _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2),
                path = _wsComponents$resourc2[0],
                query = _wsComponents$resourc2[1];

            wsComponents.path = path && path !== '/' ? path : undefined;
            wsComponents.query = query;
            wsComponents.resourceName = undefined;
        }
        //forbid fragment component
        wsComponents.fragment = undefined;
        return wsComponents;
    }
};

var handler$3 = {
    scheme: "wss",
    domainHost: handler$2.domainHost,
    parse: handler$2.parse,
    serialize: handler$2.serialize
};

var O = {};
var isIRI = true;
//RFC 3986
var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]";
var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive
var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded
//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =
//const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]";
//const WSP$$ = "[\\x20\\x09]";
//const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]";  //(%d1-8 / %d11-12 / %d14-31 / %d127)
//const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$);  //%d33 / %d35-91 / %d93-126 / obs-qtext
//const VCHAR$$ = "[\\x21-\\x7E]";
//const WSP$$ = "[\\x20\\x09]";
//const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$));  //%d0 / CR / LF / obs-qtext
//const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+");
//const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$);
//const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"');
var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";
var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";
var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]");
var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";
var UNRESERVED = new RegExp(UNRESERVED$$, "g");
var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g");
var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g");
var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g");
var NOT_HFVALUE = NOT_HFNAME;
function decodeUnreserved(str) {
    var decStr = pctDecChars(str);
    return !decStr.match(UNRESERVED) ? str : decStr;
}
var handler$4 = {
    scheme: "mailto",
    parse: function parse$$1(components, options) {
        var mailtoComponents = components;
        var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : [];
        mailtoComponents.path = undefined;
        if (mailtoComponents.query) {
            var unknownHeaders = false;
            var headers = {};
            var hfields = mailtoComponents.query.split("&");
            for (var x = 0, xl = hfields.length; x < xl; ++x) {
                var hfield = hfields[x].split("=");
                switch (hfield[0]) {
                    case "to":
                        var toAddrs = hfield[1].split(",");
                        for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) {
                            to.push(toAddrs[_x]);
                        }
                        break;
                    case "subject":
                        mailtoComponents.subject = unescapeComponent(hfield[1], options);
                        break;
                    case "body":
                        mailtoComponents.body = unescapeComponent(hfield[1], options);
                        break;
                    default:
                        unknownHeaders = true;
                        headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);
                        break;
                }
            }
            if (unknownHeaders) mailtoComponents.headers = headers;
        }
        mailtoComponents.query = undefined;
        for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) {
            var addr = to[_x2].split("@");
            addr[0] = unescapeComponent(addr[0]);
            if (!options.unicodeSupport) {
                //convert Unicode IDN -> ASCII IDN
                try {
                    addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());
                } catch (e) {
                    mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e;
                }
            } else {
                addr[1] = unescapeComponent(addr[1], options).toLowerCase();
            }
            to[_x2] = addr.join("@");
        }
        return mailtoComponents;
    },
    serialize: function serialize$$1(mailtoComponents, options) {
        var components = mailtoComponents;
        var to = toArray(mailtoComponents.to);
        if (to) {
            for (var x = 0, xl = to.length; x < xl; ++x) {
                var toAddr = String(to[x]);
                var atIdx = toAddr.lastIndexOf("@");
                var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);
                var domain = toAddr.slice(atIdx + 1);
                //convert IDN via punycode
                try {
                    domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain);
                } catch (e) {
                    components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
                }
                to[x] = localPart + "@" + domain;
            }
            components.path = to.join(",");
        }
        var headers = mailtoComponents.headers = mailtoComponents.headers || {};
        if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject;
        if (mailtoComponents.body) headers["body"] = mailtoComponents.body;
        var fields = [];
        for (var name in headers) {
            if (headers[name] !== O[name]) {
                fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar));
            }
        }
        if (fields.length) {
            components.query = fields.join("&");
        }
        return components;
    }
};

var URN_PARSE = /^([^\:]+)\:(.*)/;
//RFC 2141
var handler$5 = {
    scheme: "urn",
    parse: function parse$$1(components, options) {
        var matches = components.path && components.path.match(URN_PARSE);
        var urnComponents = components;
        if (matches) {
            var scheme = options.scheme || urnComponents.scheme || "urn";
            var nid = matches[1].toLowerCase();
            var nss = matches[2];
            var urnScheme = scheme + ":" + (options.nid || nid);
            var schemeHandler = SCHEMES[urnScheme];
            urnComponents.nid = nid;
            urnComponents.nss = nss;
            urnComponents.path = undefined;
            if (schemeHandler) {
                urnComponents = schemeHandler.parse(urnComponents, options);
            }
        } else {
            urnComponents.error = urnComponents.error || "URN can not be parsed.";
        }
        return urnComponents;
    },
    serialize: function serialize$$1(urnComponents, options) {
        var scheme = options.scheme || urnComponents.scheme || "urn";
        var nid = urnComponents.nid;
        var urnScheme = scheme + ":" + (options.nid || nid);
        var schemeHandler = SCHEMES[urnScheme];
        if (schemeHandler) {
            urnComponents = schemeHandler.serialize(urnComponents, options);
        }
        var uriComponents = urnComponents;
        var nss = urnComponents.nss;
        uriComponents.path = (nid || options.nid) + ":" + nss;
        return uriComponents;
    }
};

var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
//RFC 4122
var handler$6 = {
    scheme: "urn:uuid",
    parse: function parse(urnComponents, options) {
        var uuidComponents = urnComponents;
        uuidComponents.uuid = uuidComponents.nss;
        uuidComponents.nss = undefined;
        if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {
            uuidComponents.error = uuidComponents.error || "UUID is not valid.";
        }
        return uuidComponents;
    },
    serialize: function serialize(uuidComponents, options) {
        var urnComponents = uuidComponents;
        //normalize UUID
        urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
        return urnComponents;
    }
};

SCHEMES[handler.scheme] = handler;
SCHEMES[handler$1.scheme] = handler$1;
SCHEMES[handler$2.scheme] = handler$2;
SCHEMES[handler$3.scheme] = handler$3;
SCHEMES[handler$4.scheme] = handler$4;
SCHEMES[handler$5.scheme] = handler$5;
SCHEMES[handler$6.scheme] = handler$6;

exports.SCHEMES = SCHEMES;
exports.pctEncChar = pctEncChar;
exports.pctDecChars = pctDecChars;
exports.parse = parse;
exports.removeDotSegments = removeDotSegments;
exports.serialize = serialize;
exports.resolveComponents = resolveComponents;
exports.resolve = resolve;
exports.normalize = normalize;
exports.equal = equal;
exports.escapeComponent = escapeComponent;
exports.unescapeComponent = unescapeComponent;

Object.defineProperty(exports, '__esModule', { value: true });

})));


},{}],"ajv":[function(require,module,exports){
'use strict';

var compileSchema = require('./compile')
  , resolve = require('./compile/resolve')
  , Cache = require('./cache')
  , SchemaObject = require('./compile/schema_obj')
  , stableStringify = require('fast-json-stable-stringify')
  , formats = require('./compile/formats')
  , rules = require('./compile/rules')
  , $dataMetaSchema = require('./data')
  , util = require('./compile/util');

module.exports = Ajv;

Ajv.prototype.validate = validate;
Ajv.prototype.compile = compile;
Ajv.prototype.addSchema = addSchema;
Ajv.prototype.addMetaSchema = addMetaSchema;
Ajv.prototype.validateSchema = validateSchema;
Ajv.prototype.getSchema = getSchema;
Ajv.prototype.removeSchema = removeSchema;
Ajv.prototype.addFormat = addFormat;
Ajv.prototype.errorsText = errorsText;

Ajv.prototype._addSchema = _addSchema;
Ajv.prototype._compile = _compile;

Ajv.prototype.compileAsync = require('./compile/async');
var customKeyword = require('./keyword');
Ajv.prototype.addKeyword = customKeyword.add;
Ajv.prototype.getKeyword = customKeyword.get;
Ajv.prototype.removeKeyword = customKeyword.remove;
Ajv.prototype.validateKeyword = customKeyword.validate;

var errorClasses = require('./compile/error_classes');
Ajv.ValidationError = errorClasses.Validation;
Ajv.MissingRefError = errorClasses.MissingRef;
Ajv.$dataMetaSchema = $dataMetaSchema;

var META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema';

var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes', 'strictDefaults' ];
var META_SUPPORT_DATA = ['/properties'];

/**
 * Creates validator instance.
 * Usage: `Ajv(opts)`
 * @param {Object} opts optional options
 * @return {Object} ajv instance
 */
function Ajv(opts) {
  if (!(this instanceof Ajv)) return new Ajv(opts);
  opts = this._opts = util.copy(opts) || {};
  setLogger(this);
  this._schemas = {};
  this._refs = {};
  this._fragments = {};
  this._formats = formats(opts.format);

  this._cache = opts.cache || new Cache;
  this._loadingSchemas = {};
  this._compilations = [];
  this.RULES = rules();
  this._getId = chooseGetId(opts);

  opts.loopRequired = opts.loopRequired || Infinity;
  if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true;
  if (opts.serialize === undefined) opts.serialize = stableStringify;
  this._metaOpts = getMetaSchemaOptions(this);

  if (opts.formats) addInitialFormats(this);
  if (opts.keywords) addInitialKeywords(this);
  addDefaultMetaSchema(this);
  if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta);
  if (opts.nullable) this.addKeyword('nullable', {metaSchema: {type: 'boolean'}});
  addInitialSchemas(this);
}



/**
 * Validate data using schema
 * Schema will be compiled and cached (using serialized JSON as key. [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize.
 * @this   Ajv
 * @param  {String|Object} schemaKeyRef key, ref or schema object
 * @param  {Any} data to be validated
 * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`).
 */
function validate(schemaKeyRef, data) {
  var v;
  if (typeof schemaKeyRef == 'string') {
    v = this.getSchema(schemaKeyRef);
    if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"');
  } else {
    var schemaObj = this._addSchema(schemaKeyRef);
    v = schemaObj.validate || this._compile(schemaObj);
  }

  var valid = v(data);
  if (v.$async !== true) this.errors = v.errors;
  return valid;
}


/**
 * Create validating function for passed schema.
 * @this   Ajv
 * @param  {Object} schema schema object
 * @param  {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords.
 * @return {Function} validating function
 */
function compile(schema, _meta) {
  var schemaObj = this._addSchema(schema, undefined, _meta);
  return schemaObj.validate || this._compile(schemaObj);
}


/**
 * Adds schema to the instance.
 * @this   Ajv
 * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored.
 * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.
 * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead.
 * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.
 * @return {Ajv} this for method chaining
 */
function addSchema(schema, key, _skipValidation, _meta) {
  if (Array.isArray(schema)){
    for (var i=0; i<schema.length; i++) this.addSchema(schema[i], undefined, _skipValidation, _meta);
    return this;
  }
  var id = this._getId(schema);
  if (id !== undefined && typeof id != 'string')
    throw new Error('schema id must be string');
  key = resolve.normalizeId(key || id);
  checkUnique(this, key);
  this._schemas[key] = this._addSchema(schema, _skipValidation, _meD+ta, true);
  return this;
}


/**
 * Add schema that will be used to validate other schemas
 * options in META_IGNORE_OPTIONS are alway set to false
 * @this   Ajv
 * @param {Object} schema schema object
 * @param {String} key optional schema key
 * @param {Boolean} skipValidation true to skip schema validation, can be used to override validateSchema option for meta-schema
 * @return {Ajv} this for method chaining
 */
function addMetaSchema(schema, key, skipValidation) {
  this.addSchema(schema, key, skipValidation, true);
  return this;
}


/**
 * Validate schema
 * @this   Ajv
 * @param {Object} schema schema to validate
 * @param {Boolean} throwOrLogError pass true to throw (or log) an error if invalid
 * @return {Boolean} true if schema is valid
 */
function validateSchema(schema, throwOrLogError) {
  var $schema = schema.$schema;
  if ($schema !== undefined && typeof $schema != 'string')
    throw new Error('$schema must be a string');
  $schema = $schema || this._opts.defaultMeta || defaultMeta(this);
  if (!$schema) {
    this.logger.warn('meta-schema not available');
    this.errors = null;
    return true;
  }
  var valid = this.validate($schema, schema);
  if (!valid && throwOrLogError) {
    var message = 'schema is invalid: ' + this.errorsText();
    if (this._opts.validateSchema == 'log') this.logger.error(message);
    else throw new Error(message);
  }
  return valid;
}


function defaultMeta(self) {
  var meta = self._opts.meta;
  self._opts.defaultMeta = typeof meta == 'object'
                            ? self._getId(meta) || meta
                            : self.getSchema(META_SCHEMA_ID)
                              ? META_SCHEMA_ID
                              : undefined;
  return self._opts.defaultMeta;
}


/**
 * Get compiled schema from the instance by `key` or `ref`.
 * @this   Ajv
 * @param  {String} keyRef `key` that was passed to `addSchema` or full schema reference (`schema.id` or resolved id).
 * @return {Function} schema validating function (with property `schema`).
 */
function getSchema(keyRef) {
  var schemaObj = _getSchemaObj(this, keyRef);
  switch (typeof schemaObj) {
    case 'object': return schemaObj.validate || this._compile(schemaObj);
    case 'string': return this.getSchema(schemaObj);
    case 'undefined': return _getSchemaFragment(this, keyRef);
  }
}


function _getSchemaFragment(self, ref) {
  var res = resolve.schema.call(self, { schema: {} }, ref);
  if (res) {
    var schema = res.schema
      , root = res.root
      , baseId = res.baseId;
    var v = compileSchema.call(self, schema, root, undefined, baseId);
    self._fragments[ref] = new SchemaObject({
      ref: ref,
      fragment: true,
      schema: schema,
      root: root,
      baseId: baseId,
      validate: v
    });
    return v;
  }
}


function _getSchemaObj(self, keyRef) {
  keyRef = resolve.normalizeId(keyRef);
  return self._schemas[keyRef] || self._refs[keyRef] || self._fragments[keyRef];
}


/**
 * Remove cached schema(s).
 * If no parameter is passed all schemas but meta-schemas are removed.
 * If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
 * Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
 * @this   Ajv
 * @param  {String|Object|RegExp} schemaKeyRef key, ref, pattern to match key/ref or schema object
 * @return {Ajv} this for method chaining
 */
function removeSchema(schemaKeyRef) {
  if (schemaKeyRef instanceof RegExp) {
    _removeAllSchemas(this, this._schemas, schemaKeyRef);
    _removeAllSchemas(this, this._refs, schemaKeyRef);
    return this;
  }
  switch (typeof schemaKeyRef) {
    case 'undefined':
      _removeAllSchemas(this, this._schemas);
      _removeAllSchemas(this, this._refs);
      this._cache.clear();
      return this;
    case 'string':
      var schemaObj = _getSchemaObj(this, schemaKeyRef);
      if (schemaObj) this._cache.del(schemaObj.cacheKey);
      delete this._schemas[schemaKeyRef];
      delete this._refs[schemaKeyRef];
      return this;
    case 'object':
      var serialize = this._opts.serialize;
      var cacheKey = serialize ? serialize(schemaKeyRef) : schemaKeyRef;
      this._cache.del(cacheKey);
      var id = this._getId(schemaKeyRef);
      if (id) {
        id = resolve.normalizeId(id);
        delete this._schemas[id];
        delete this._refs[id];
      }
  }
  return this;
}


function _removeAllSchemas(self, schemas, regex) {
  for (var keyRef in schemas) {
    var schemaObj = schemas[keyRef];
    if (!schemaObj.meta && (!regex || regex.test(keyRef))) {
      self._cache.del(schemaObj.cacheKey);
      delete schemas[keyRef];
    }
  }
}


/* @this   Ajv */
function _addSchema(schema, skipValidation, meta, shouldAddSchema) {
  if (typeof schema != 'object' && typeof schema != 'boolean')
    throw new Error('schema should be object or boolean');
  var serialize = this._opts.serialize;
  var cacheKey = serialize ? serialize(schema) : schema;
  var cached = this._cache.get(cacheKey);
  if (cached) return cached;

  shouldAddSchema = shouldAddSchema || this._opts.addUsedSchema !== false;

  var id = resolve.normalizeId(this._getId(schema));
  if (id && shouldAddSchema) checkUnique(this, id);

  var willValidate = this._opts.validateSchema !== false && !skipValidation;
  var recursiveMeta;
  if (willValidate && !(recursiveMeta = id && id == resolve.normalizeId(schema.$schema)))
    this.validateSchema(schema, true);

  var localRefs = resolve.ids.call(this, schema);

  var schemaObj = new SchemaObject({
    id: id,
    schema: schema,
    localRefs: localRefs,
    cacheKey: cacheKey,
    meta: meta
  });

  if (id[0] != '#' && shouldAddSchema) this._refs[id] = schemaObj;
  this._cache.put(cacheKey, schemaObj);

  if (willValidate && recursiveMeta) this.validateSchema(schema, true);

  return schemaObj;
}


/* @this   Ajv */
function _compile(schemaObj, root) {
  if (schemaObj.compiling) {
    schemaObj.validate = callValidate;
    callValidate.schema = schemaObj.schema;
    callValidate.errors = null;
    callValidate.root = root ? root : callValidate;
    if (schemaObj.schema.$async === true)
      callValidate.$async = true;
    return callValidate;
  }
  schemaObj.compiling = true;

  var currentOpts;
  if (schemaObj.meta) {
    currentOpts = this._opts;
    this._opts = this._metaOpts;
  }

  var v;
  try { v = compileSchema.call(this, schemaObj.schema, root, schemaObj.localRefs); }
  catch(e) {
    delete schemaObj.validate;
    throw e;
  }
  finally {
    schemaObj.compiling = false;
    if (schemaObj.meta) this._opts = currentOpts;
  }

  schemaObj.validate = v;
  schemaObj.refs = v.refs;
  schemaObj.refVal = v.refVal;
  schemaObj.root = v.root;
  return v;


  /* @this   {*} - custom context, see passContext option */
  function callValidate() {
    /* jshint validthis: true */
    var _validate = schemaObj.validate;
    var result = _validate.apply(this, arguments);
    callValidate.errors = _validate.errors;
    return result;
  }
}


function chooseGetId(opts) {
  switch (opts.schemaId) {
    case 'auto': return _get$IdOrId;
    case 'id': return _getId;
    default: return _get$Id;
  }
}

/* @this   Ajv */
function _getId(schema) {
  if (schema.$id) this.logger.warn('schema $id ignored', schema.$id);
  return schema.id;
}

/* @this   Ajv */
function _get$Id(schema) {
  if (schema.id) this.logger.warn('schema id ignored', schema.id);
  return schema.$id;
}


function _get$IdOrId(schema) {
  if (schema.$id && schema.id && schema.$id != schema.id)
    throw new Error('schema $id is different from id');
  return schema.$id || schema.id;
}


/**
 * Convert array of error message objects to string
 * @this   Ajv
 * @param  {Array<Object>} errors optional array of validation errors, if not passed errors from the instance are used.
 * @param  {Object} options optional options with properties `separator` and `dataVar`.
 * @return {String} human readable string with all errors descriptions
 */
function errorsText(errors, options) {
  errors = errors || this.errors;
  if (!errors) return 'No errors';
  options = options || {};
  var separator = options.separator === undefined ? ', ' : options.separator;
  var dataVar = options.dataVar === undefined ? 'data' : options.dataVar;

  var text = '';
  for (var i=0; i<errors.length; i++) {
    var e = errors[i];
    if (e) text += dataVar + e.dataPath + ' ' + e.message + separator;
  }
  return text.slice(0, -separator.length);
}


/**
 * Add custom format
 * @this   Ajv
 * @param {String} name format name
 * @param {String|RegExp|Function} format string is converted to RegExp; function should return boolean (true when valid)
 * @return {Ajv} this for method chaining
 */
function addFormat(name, format) {
  if (typeof format == 'string') format = new RegExp(format);
  this._formats[name] = format;
  return this;
}


function addDefaultMetaSchema(self) {
  var $dataSchema;
  if (self._opts.$data) {
    $dataSchema = require('./refs/data.json');
    self.addMetaSchema($dataSchema, $dataSchema.$id, true);
  }
  if (self._opts.meta === false) return;
  var metaSchema = require('./refs/json-schema-draft-07.json');
  if (self._opts.$data) metaSchema = $dataMetaSchema(metaSchema, META_SUPPORT_DATA);
  self.addMetaSchema(metaSchema, META_SCHEMA_ID, true);
  self._refs['http://json-schema.org/schema'] = META_SCHEMA_ID;
}


function addInitialSchemas(self) {
  var optsSchemas = self._opts.schemas;
  if (!optsSchemas) return;
  if (Array.isArray(optsSchemas)) self.addSchema(optsSchemas);
  else for (var key in optsSchemas) self.addSchema(optsSchemas[key], key);
}


function addInitialFormats(self) {
  for (var name in self._opts.formats) {
    var format = self._opts.formats[name];
    self.addFormat(name, format);
  }
}


function addInitialKeywords(self) {
  for (var name in self._opts.keywords) {
    var keyword = self._opts.keywords[name];
    self.addKeyword(name, keyword);
  }
}


function checkUnique(self, id) {
  if (self._schemas[id] || self._refs[id])
    throw new Error('schema with key or id "' + id + '" already exists');
}


function getMetaSchemaOptions(self) {
  var metaOpts = util.copy(self._opts);
  for (var i=0; i<META_IGNORE_OPTIONS.length; i++)
    delete metaOpts[META_IGNORE_OPTIONS[i]];
  return metaOpts;
}


function setLogger(self) {
  var logger = self._opts.logger;
  if (logger === false) {
    self.logger = {log: noop, warn: noop, error: noop};
  } else {
    if (logger === undefined) logger = console;
    if (!(typeof logger == 'object' && logger.log && logger.warn && logger.error))
      throw new Error('logger must implement log, warn and error methods');
    self.logger = logger;
  }
}


function noop() {}

},{"./cache":1,"./compile":5,"./compile/async":2,"./compile/error_classes":3,"./compile/formats":4,"./compile/resolve":6,"./compile/rules":7,"./compile/schema_obj":8,"./compile/util":10,"./data":11,"./keyword":39,"./refs/data.json":40,"./refs/json-schema-draft-07.json":41,"fast-json-stable-stringify":43}]},{},[])("ajv")
});
V:x   /* ajv 6.14.0: Another JSON Schema Validator */
(e=>{"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self,e())})(function(){return function a(s,o,i){function n(r,e){if(!o[r]){if(!s[r]){var t="function"==typeof require&&require;if(!e&&t)return t(r,!0);if(l)return l(r,!0);throw(e=new Error("Cannot find module '"+r+"'")).code="MODULE_NOT_FOUND",e}t=o[r]={exports:{}},s[r][0].call(t.exports,function(e){return n(s[r][1][e]||e)},t,t.exports,a,s,o,i)}return o[r].exports}for(var l="function"==typeof require&&require,e=0;e<i.length;e++)n(i[e]);return n}({1:[function(e,r,t){r=r.exports=function(){this._cache={}};r.prototype.put=function(e,r){this._cache[e]=r},r.prototype.get=function(e){return this._cache[e]},r.prototype.del=function(e){delete this._cache[e]},r.prototype.clear=function(){this._cache={}}},{}],2:[function(e,r,t){var a=e("./error_classes").MissingRef;function s(r,i,t){var n=this;if("function"!=typeof this._opts.loadSchema)throw new Error("options.loadSchema should be a function");"function"==typeof i&&(t=i,i=void 0);var e=l(r).then(function(){var e=n._addSchema(r,void 0,i);return e.validate||function s(o){try{return n._compile(o)}catch(e){if(e instanceof a)return r(e);throw e}function r(e){var r=e.missingSchema;if(a(r))throw new Error("Schema "+r+" is loaded but "+e.missingRef+" cannot be resolved");e=n._loadingSchemas[r];return e||(e=n._loadingSchemas[r]=n._opts.loadSchema(r)).then(t,t),e.then(function(e){if(!a(r))return l(e).then(function(){a(r)||n.addSchema(e,r,void 0,i)})}).then(function(){return s(o)});function t(){delete n._loadingSchemas[r]}function a(e){return n._refs[e]||n._schemas[e]}}}(e)});return t&&e.then(function(e){t(null,e)},t),e;function l(e){e=e.$schema;return e&&!n.getSchema(e)?s.call(n,{$ref:e},!0):Promise.resolve()}}r.exports=s},{"./error_classes":3}],3:[function(e,r,t){var a=e("./resolve");function s(e,r,t){this.message=t||s.message(e,r),this.missingRef=a.url(e,r),this.missingSchema=a.normalizeId(a.fullPath(this.missingRef))}function o(e){return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e}r.exports={Validation:o(function(e){this.message="validation failed",this.errors=e,this.ajv=this.validation=!0}),MissingRef:o(s)},s.message=function(e,r){return"can't resolve reference "+r+" from id "+e}},{"./resolve":6}],4:[function(e,r,t){var a=e("./util"),s=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31],i=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,e=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,n=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d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0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,u=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,h=/^(?:\/(?:[^~/]|~0|~1)*)*$/,d=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,p=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function f(e){return a.copy(f[e="full"==e?"full":"fast"])}function m(e){var r,t,e=e.match(s);return!!e&&(t=+e[3],1<=(r=+e[2]))&&r<=12&&1<=t&&t<=(2!=r||(t=+e[1])%4!=0||t%100==0&&t%400!=0?o[r]:29)}function v(e,r){var t,a,s,e=e.match(i);return!!e&&(a=e[2],s=e[3],(t=e[1])<=23&&a<=59&&s<=59||23==t&&59==a&&60==s)&&(!r||e[5])}(r.exports=f).fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":l,url:c,email:/^[a-z0-9.!#$%&'*+/=?^_`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,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:E,uuid:u,"json-pointer":h,"json-pointer-uri-fragment":d,"relative-json-pointer":p},f.full={date:m,time:v,"date-time":function(e){e=e.split(y);return 2==e.length&&m(e[0])&&v(e[1],!0)},uri:function(e){return g.test(e)&&n.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]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:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:E,uuid:u,"json-pointer":h,"json-pointer-uri-fragment":d,"relative-json-pointer":p};var y=/t|\s/i;var g=/\/|:/;var P=/[^\\]\\Z/;function E(e){if(P.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},{"./util":10}],5:[function(e,r,t){var $=e("./resolve"),j=e("./util"),D=e("./error_classes"),O=e("fast-json-stable-stringify"),I=e("../dotjs/validate"),A=j.ucs2length,k=e("fast-deep-equal"),C=D.Validation;function L(e,i,n,r){var l=this,c=this._opts,u=[void 0],h={},d=[],t={},p=[],a={},f=[];function m(e,r){return"var pattern"+e+" = "+(c.regExp?"regExp":"new RegExp")+"("+j.toQuotedString(r[e])+");"}i=i||{schema:e,refVal:u,refs:h};var s=function(e,r,t){var a=N.call(this,e,r,t);return 0<=a?{index:a,compiling:!0}:(this._compilations[a=this._compilations.length]={schema:e,root:r,baseId:t},{index:a,compiling:!1})}.call(this,e,i,r),o=this._compilations[s.index];if(s.compiling)return o.callValidate=E;var v=this._formats,y=this.RULES;try{var g=w(e,i,n,r),P=(o.validate=g,o.callValidate);return P&&(P.schema=g.schema,P.errors=null,P.refs=g.refs,P.refVal=g.refVal,P.root=g.root,P.$async=g.$async,c.sourceCode)&&(P.source=g.source),g}finally{!function(e,r,t){e=N.call(this,e,r,t);0<=e&&this._compilations.splice(e,1)}.call(this,e,i,r)}function E(){var e=o.validate,r=e.apply(this,arguments);return E.errors=e.errors,r}function w(e,r,t,a){var s=!r||r.schema==e;if(r.schema!=i.schema)return L.call(l,e,r,t,a);t=!0===e.$async,a=I({isTop:!0,schema:e,isRoot:s,baseId:a,root:r,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:D.MissingRef,RULES:y,validate:I,util:j,resolve:$,resolveRef:b,usePattern:F,useDefault:x,useCustomRule:R,opts:c,formats:v,logger:l.logger,self:l}),a=Q(u,q)+Q(d,m)+Q(p,z)+Q(f,T)+a;c.processCode&&(a=c.processCode(a,e));try{var o=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError","regExp",a)(l,y,v,i,u,p,f,k,A,C,c.regExp);u[0]=o}catch(e){throw l.logger.error("Error compiling schema, function code:",a),e}return o.schema=e,o.errors=null,o.refs=h,o.refVal=u,o.root=s?o:r,t&&(o.$async=!0),!0===c.sourceCode&&(o.source={code:a,patterns:d,defaults:p}),o}function b(e,r,t){r=$.url(e,r);var a=h[r];if(void 0!==a)return _(s=u[a],o="refVal["+a+"]");if(!t&&i.refs){a=i.refs[r];if(void 0!==a)return _(s=i.refVal[a],o=S(r,s))}var s,o=S(r),t=$.call(l,w,i,r);if(void 0!==(t=void 0===t&&(a=n&&n[r])?$.inlineRef(a,c.inlineRefs)?a:L.call(l,a,i,n,e):t))return s=t,u[h[r]]=s,_(t,o);delete h[r]}function S(e,r){var t=u.length;return u[t]=r,"refVal"+(h[e]=t)}function _(e,r){return"object"==typeof e||"boolean"==typeof e?{code:r,schema:e,inline:!0}:{code:r,$async:e&&!!e.$async}}function F(e){var r=t[e];return void 0===r&&(r=t[e]=d.length,d[r]=e),"pattern"+r}function x(e){switch(typeof e){case"boolean":case"number":return""+e;case"string":return j.toQuotedString(e);case"object":var r,t;return null===e?"null":(r=O(e),void 0===(t=a[r])&&(t=a[r]=p.length,p[t]=e),"default"+t)}}function R(e,r,t,a){if(!1!==l._opts.validateSchema){var s=e.definition.dependencies;if(s&&!s.every(function(e){return Object.prototype.hasOwnProperty.call(t,e)}))throw new Error("parent schema must have all required keywords: "+s.join(","));s=e.definition.validateSchema;if(s)if(!s(r)){s="keyword schema is invalid: "+l.errorsText(s.errors);if("log"!=l._opts.validateSchema)throw new Error(s);l.logger.error(s)}}var o,s=e.definition.compile,i=e.definition.inline,n=e.definition.macro;if(s)o=s.call(l,r,t,a);else if(n)o=n.call(l,r,t,a),!1!==c.validateSchema&&l.validateSchema(o,!0);else if(i)o=i.call(l,a,e.keyword,r,t);else if(!(o=e.definition.validate))return;if(void 0===o)throw new Error('custom keyword "'+e.keyword+'"failed to compile');s=f.length;return{code:"customRule"+s,validate:f[s]=o}}}function N(e,r,t){for(var a=0;a<this._compilations.length;a++){var s=this._compilations[a];if(s.schema==e&&s.root==r&&s.baseId==t)return a}return-1}function z(e){return"var default"+e+" = defaults["+e+"];"}function q(e,r){return void 0===r[e]?"":"var refVal"+e+" = refVal["+e+"];"}function T(e){return"var customRule"+e+" = customRules["+e+"];"}function Q(e,r){if(!e.length)return"";for(var t="",a=0;a<e.length;a++)t+=r(a,e);return t}r.exports=L},{"../dotjs/validate":38,"./error_classes":3,"./resolve":6,"./util":10,"fast-deep-equal":42,"fast-json-stable-stringify":43}],6:[function(e,r,t){var p=e("uri-js"),f=e("fast-deep-equal"),m=e("./util"),n=e("./schema_obj"),a=e("json-schema-traverse");function l(e,r,t){var a,s,o,i=this._refs[t];if("string"==typeof i){if(!this._refs[i])return l.call(this,e,r,i);i=this._refs[i]}return(i=i||this._schemas[t])instanceof n?d(i.schema,this._opts.inlineRefs)?i.schema:i.validate||this._compile(i):((i=c.call(this,r,t))&&(a=i.schema,r=i.root,o=i.baseId),a instanceof n?s=a.validate||e.call(this,a.schema,r,void 0,o):void 0!==a&&(s=d(a,this._opts.inlineRefs)?a:e.call(this,a,r,void 0,o)),s)}function c(e,r){var t=p.parse(r),a=y(t),s=v(this._getId(e.schema));if(0===Object.keys(e.schema).length||a!==s){var a=g(a),o=this._refs[a];if("string"==typeof o)return function(e,r,t){r=c.call(this,e,r);{var a,s;if(r)return a=r.baseId,e=r.root,(s=this._getId(r=r.schema))&&(a=P(a,s)),i.call(this,t,a,r,e)}}.call(this,e,o,t);if(o instanceof n)o.validate||this._compile(o);else{if(!((o=this._schemas[a])instanceof n))return;if(o.validate||this._compile(o),a==g(r))return{schema:o,root:e,baseId:s}}if(!(e=o).schema)return;s=v(this._getId(e.schema))}return i.call(this,t,s,e.schema,e)}(r.exports=l).normalizeId=g,l.fullPath=v,l.url=P,l.ids=function(e){var r=g(this._getId(e)),c={"":r},u={"":v(r,!1)},h={},d=this;return a(e,{allKeys:!0},function(e,r,t,a,s,o,i){if(""!==r){var n=d._getId(e),l=c[a],a=u[a]+"/"+s;if(void 0!==i&&(a+="/"+("number"==typeof i?i:m.escapeFragment(i))),"string"==typeof n){n=l=g(l?p.resolve(l,n):n),s=d._refs[n];if((s="string"==typeof s?d._refs[s]:s)&&s.schema){if(!f(e,s.schema))throw new Error('id "'+n+'" resolves to more than one schema')}else if(n!=g(a))if("#"==n[0]){if(h[n]&&!f(e,h[n]))throw new Error('id "'+n+'" resolves to more than one schema');h[n]=e}else d._refs[n]=a}c[r]=l,u[r]=a}}),h},l.inlineRef=d,l.schema=c;var u=m.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function i(e,r,t,a){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var s=e.fragment.split("/"),o=1;o<s.length;o++){var i=s[o];if(i){if(void 0===(t=t[i=m.unescapeFragment(i)]))break;u[i]||((i=this._getId(t))&&(r=P(r,i)),t.$ref&&(i=P(r,t.$ref),i=c.call(this,a,i))&&(t=i.schema,a=i.root,r=i.baseId))}}return void 0!==t&&t!==a.schema?{schema:t,root:a,baseId:r}:void 0}}var h=m.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function d(e,r){return!1!==r&&(void 0===r||!0===r?function e(r){var t;if(Array.isArray(r)){for(var a=0;a<r.length;a++)if("object"==typeof(t=r[a])&&!e(t))return!1}else for(var s in r){if("$ref"==s)return!1;if("object"==typeof(t=r[s])&&!e(t))return!1}return!0}(e):r?function e(r){var t,a=0;if(Array.isArray(r)){for(var s=0;s<r.length;s++)if("object"==typeof(t=r[s])&&(a+=e(t)),a==1/0)return 1/0}else for(var o in r){if("$ref"==o)return 1/0;if(h[o])a++;else if("object"==typeof(t=r[o])&&(a+=e(t)+1),a==1/0)return 1/0}return a}(e)<=r:void 0)}function v(e,r){return!1!==r&&(e=g(e)),y(p.parse(e))}function y(e){return p.serialize(e).split("#")[0]+"#"}var s=/#\/?$/;function g(e){return e?e.replace(s,""):""}function P(e,r){return r=g(r),p.resolve(e,r)}},{"./schema_obj":8,"./util":10,"fast-deep-equal":42,"json-schema-traverse":44,"uri-js":45}],7:[function(e,r,t){var o=e("../dotjs"),i=e("./util").toHash;r.exports=function(){var a=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],s=["type","$comment"];return a.all=i(s),a.types=i(["number","integer","string","array","object","boolean","null"]),a.forEach(function(e){e.rules=e.rules.map(function(e){var r,t;return"object"==typeof e&&(t=e[r=Object.keys(e)[0]],e=r,t.forEach(function(e){s.push(e),a.all[e]=!0})),s.push(e),a.all[e]={keyword:e,code:o[e],implements:t}}),a.all.$comment={keyword:"$comment",code:o.$comment},e.type&&(a.types[e.type]=e)}),a.keywords=i(s.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),a.custom={},a}},{"../dotjs":27,"./util":10}],8:[function(e,r,t){var a=e("./util");r.exports=function(e){a.copy(e,this)}},{"./util":10}],9:[function(e,r,t){r.exports=function(e){for(var r,t=0,a=e.length,s=0;s<a;)t++,55296<=(r=e.charCodeAt(s++))&&r<=56319&&s<a&&56320==(64512&e.charCodeAt(s))&&s++;return t}},{}],10:[function(e,r,t){function o(e,r,t,a){var s=a?" !== ":" === ",o=a?" || ":" && ",i=a?"!":"",n=a?"":"!";switch(e){case"null":return r+s+"null";case"array":return i+"Array.isArray("+r+")";case"object":return"("+i+r+o+"typeof "+r+s+'"object"'+o+n+"Array.isArray("+r+"))";case"integer":return"(typeof "+r+s+'"number"'+o+n+"("+r+" % 1)"+o+r+s+r+(t?o+i+"isFinite("+r+")":"")+")";case"number":return"(typeof "+r+s+'"'+e+'"'+(t?o+i+"isFinite("+r+")":"")+")";default:return"typeof "+r+s+'"'+e+'"'}}r.exports={copy:function(e,r){for(var t in r=r||{},e)r[t]=e[t];return r},checkDataType:o,checkDataTypes:function(e,r,t){{if(1===e.length)return o(e[0],r,t,!0);var a,s="",e=n(e);for(a in e.array&&e.object&&(s=e.null?"(":"(!"+r+" || ",s+="typeof "+r+' !== "object")',delete e.null,delete e.array,delete e.object),e.number&&delete e.integer,e)s+=(s?" && ":"")+o(a,r,t,!0);return s}},coerceToTypes:function(e,r){{if(!Array.isArray(r))return i[r]?[r]:"array"===e&&"array"===r?["array"]:void 0;for(var t=[],a=0;a<r.length;a++){var s=r[a];(i[s]||"array"===e&&"array"===s)&&(t[t.length]=s)}return t.length?t:void 0}},toHash:n,getProperty:u,escapeQuotes:l,equal:e("fast-deep-equal"),ucs2length:e("./ucs2length"),varOccurences:function(e,r){r+="[^0-9]";e=e.match(new RegExp(r,"g"));return e?e.length:0},varReplace:function(e,r,t){return r+="([^0-9])",t=t.replace(/\$/g,"$$$$"),e.replace(new RegExp(r,"g"),t+"$1")},schemaHasRules:function(e,r){if("boolean"==typeof e)return!e;for(var t in e)if(r[t])return!0},schemaHasRulesExcept:function(e,r,t){if("boolean"==typeof e)return!e&&"not"!=t;for(var a in e)if(a!=t&&r[a])return!0},schemaUnknownRules:function(e,r){if("boolean"!=typeof e)for(var t in e)if(!r[t])return t},toQuotedString:c,getPathExpr:function(e,r,t,a){return p(e,t?"'/' + "+r+(a?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):a?"'[' + "+r+" + ']'":"'[\\'' + "+r+" + '\\']'")},getPath:function(e,r,t){t=c(t?"/"+f(r):u(r));return p(e,t)},getData:function(e,r,t){var a,s,o;if(""===e)return"rootData";if("/"==e[0]){if(!h.test(e))throw new Error("Invalid JSON-pointer: "+e);a=e,s="rootData"}else{if(!(o=e.match(d)))throw new Error("Invalid JSON-pointer: "+e);if(e=+o[1],"#"==(a=o[2])){if(r<=e)throw new Error("Cannot access property/index "+e+" levels up, current level is "+r);return t[r-e]}if(r<e)throw new Error("Cannot access data "+e+" levels up, current level is "+r);if(s="data"+(r-e||""),!a)return s}for(var i=s,n=a.split("/"),l=0;l<n.length;l++){var c=n[l];c&&(s+=u(m(c)),i+=" && "+s)}return i},unescapeFragment:function(e){return m(decodeURIComponent(e))},unescapeJsonPointer:m,escapeFragment:function(e){return encodeURIComponent(f(e))},escapeJsonPointer:f};var i=n(["string","number","integer","boolean","null"]);function n(e){for(var r={},t=0;t<e.length;t++)r[e[t]]=!0;return r}var a=/^[a-z$_][a-z$_0-9]*$/i,s=/'|\\/g;function u(e){return"number"==typeof e?"["+e+"]":a.test(e)?"."+e:"['"+l(e)+"']"}function l(e){return e.replace(s,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function c(e){return"'"+l(e)+"'"}var h=/^\/(?:[^~]|~0|~1)*$/,d=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function p(e,r){return'""'==e?r:(e+" + "+r).replace(/([^\\])' \+ '/g,"$1")}function f(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}function m(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}},{"./ucs2length":9,"fast-deep-equal":42}],11:[function(e,r,t){var l=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];r.exports=function(e,r){for(var t=0;t<r.length;t++){e=JSON.parse(JSON.stringify(e));for(var a=r[t].split("/"),s=e,o=1;o<a.length;o++)s=s[a[o]];for(o=0;o<l.length;o++){var i=l[o],n=s[i];n&&(s[i]={anyOf:[n,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return e}},{}],12:[function(e,r,t){e=e("./refs/json-schema-draft-07.json");r.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:e.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:e.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}},{"./refs/json-schema-draft-07.json":41}],13:[function(e,r,t){r.exports=function(e,r,t){var a,s,o,i,n,l=" ",c=e.level,u=e.dataLevel,h=e.schema[r],d=e.schemaPath+e.util.getProperty(r),p=e.errSchemaPath+"/"+r,f=!e.opts.allErrors,m="data"+(u||""),v=e.opts.$data&&h&&h.$data,y=v?(l+=" var schema"+c+" = "+e.util.getData(h.$data,u,e.dataPathArr)+"; ","schema"+c):h,g="maximum"==r,P=g?"exclusiveMaximum":"exclusiveMinimum",E=e.schema[P],w=e.opts.$data&&E&&E.$data,b=g?"<":">",S=g?">":"<",_=void 0;if(!v&&"number"!=typeof h&&void 0!==h)throw new Error(r+" must be number");if(!w&&void 0!==E&&"number"!=typeof E&&"boolean"!=typeof E)throw new Error(P+" must be number or boolean");w?(u=e.util.getData(E.$data,u,e.dataPathArr),o="exclIsNumber"+c,i="' + "+(n="op"+c)+" + '",_=P,(F=F||[]).push(l=l+(" var schemaExcl"+c+" = "+u+"; ")+(" var "+(a="exclusive"+c)+"; var "+(s="exclType"+c)+" = typeof "+(u="schemaExcl"+c)+"; if ("+s+" != 'boolean' && "+s+" != 'undefined' && "+s+" != 'number') { ")),l="",!1!==e.createErrors?(l+=" { keyword: '"+(_||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: {} ",!1!==e.opts.messages&&(l+=" , message: '"+P+" should be boolean' "),e.opts.verbose&&(l+=" , schema: validate.schema"+d+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),l+=" } "):l+=" {} ",x=l,l=(l=F.pop())+(!e.compositeRule&&f?e.async?" throw new ValidationError(["+x+"]); ":" validate.errors = ["+x+"]; return false; ":" var err = "+x+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ")+" } else if ( ",v&&(l+=" ("+y+" !== undefined && typeof "+y+" != 'number') || "),l+=" "+s+" == 'number' ? ( ("+a+" = "+y+" === undefined || "+u+" "+b+"= "+y+") ? "+m+" "+S+"= "+u+" : "+m+" "+S+" "+y+" ) : ( ("+a+" = "+u+" === true) ? "+m+" "+S+"= "+y+" : "+m+" "+S+" "+y+" ) || "+m+" !== "+m+") { var op"+c+" = "+a+" ? '"+b+"' : '"+b+"='; ",void 0===h&&(p=e.errSchemaPath+"/"+(_=P),y=u,v=w)):(i=b,(o="number"==typeof E)&&v?(n="'"+i+"'",l+=" if ( ",v&&(l+=" ("+y+" !== undefined && typeof "+y+" != 'number') || "),l+=" ( "+y+" === undefined || "+E+" "+b+"= "+y+" ? "+m+" "+S+"= "+E+" : "+m+" "+S+" "+y+" ) || "+m+" !== "+m+") { "):(o&&void 0===h?(a=!0,p=e.errSchemaPath+"/"+(_=P),y=E,S+="="):(o&&(y=Math[g?"min":"max"](E,h)),E===(!o||y)?(a=!0,p=e.errSchemaPath+"/"+(_=P),S+="="):(a=!1,i+="=")),n="'"+i+"'",l+=" if ( ",v&&(l+=" ("+y+" !== undefined && typeof "+y+" != 'number') || "),l+=" "+m+" "+S+" "+y+" || "+m+" !== "+m+") { ")),_=_||r;(F=F||[]).push(l),l="",!1!==e.createErrors?(l+=" { keyword: '"+(_||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(p)+" , params: { comparison: "+n+", limit: "+y+", exclusive: "+a+" } ",!1!==e.opts.messages&&(l=l+" , message: 'should be "+i+" "+(v?"' + "+y:y+"'")),e.opts.verbose&&(l=(l+=" , schema:  ")+(v?"validate.schema"+d:""+h)+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+m+" "),l+=" } "):l+=" {} ";var F,x=l;return l=(l=F.pop())+(!e.compositeRule&&f?e.async?" throw new ValidationError(["+x+"]); ":" validate.errors = ["+x+"]; return false; ":" var err = "+x+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ")+" } ",f&&(l+=" else { "),l}},{}],14:[function(e,r,t){r.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,h="data"+(i||""),d=e.opts.$data&&n&&n.$data,i=d?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ","schema"+o):n;if(d||"number"==typeof n)return s+="if ( ",d&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),(o=[]).push(s+=" "+h+".length "+("maxItems"==(a=r)?">":"<")+" "+i+") { "),s="",!1!==e.createErrors?(s+=" { keyword: '"+(a||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(s=(s=(s+=" , message: 'should NOT have ")+("maxItems"==r?"more":"fewer")+" than ")+(d?"' + "+i+" + '":""+n)+" items' "),e.opts.verbose&&(s=(s+=" , schema:  ")+(d?"validate.schema"+l:""+n)+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",a=s,s=(s=o.pop())+(!e.compositeRule&&u?e.async?" throw new ValidationError(["+a+"]); ":" validate.errors = ["+a+"]; return false; ":" var err = "+a+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ")+"} ",u&&(s+=" else { "),s;throw new Error(r+" must be number")}},{}],15:[function(e,r,t){r.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,h="data"+(i||""),d=e.opts.$data&&n&&n.$data,i=d?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ","schema"+o):n;if(d||"number"==typeof n)return s+="if ( ",d&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),(o=[]).push(s=s+(!1===e.opts.unicode?" "+h+".length ":" ucs2length("+h+") ")+(" "+("maxLength"==(a=r)?">":"<")+" "+i+") { ")),s="",!1!==e.createErrors?(s+=" { keyword: '"+(a||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(s=(s=(s+=" , message: 'should NOT be ")+("maxLength"==r?"longer":"shorter")+" than ")+(d?"' + "+i+" + '":""+n)+" characters' "),e.opts.verbose&&(s=(s+=" , schema:  ")+(d?"validate.schema"+l:""+n)+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",a=s,s=(s=o.pop())+(!e.compositeRule&&u?e.async?" throw new ValidationError(["+a+"]); ":" validate.errors = ["+a+"]; return false; ":" var err = "+a+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ")+"} ",u&&(s+=" else { "),s;throw new Error(r+" must be number")}},{}],16:[function(e,r,t){r.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,h="data"+(i||""),d=e.opts.$data&&n&&n.$data,i=d?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ","schema"+o):n;if(d||"number"==typeof n)return s+="if ( ",d&&(s+=" ("+i+" !== undefined && typeof "+i+" != 'number') || "),(o=[]).push(s+=" Object.keys("+h+").length "+("maxProperties"==(a=r)?">":"<")+" "+i+") { "),s="",!1!==e.createErrors?(s+=" { keyword: '"+(a||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { limit: "+i+" } ",!1!==e.opts.messages&&(s=(s=(s+=" , message: 'should NOT have ")+("maxProperties"==r?"more":"fewer")+" than ")+(d?"' + "+i+" + '":""+n)+" properties' "),e.opts.verbose&&(s=(s+=" , schema:  ")+(d?"validate.schema"+l:""+n)+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",a=s,s=(s=o.pop())+(!e.compositeRule&&u?e.async?" throw new ValidationError(["+a+"]); ":" validate.errors = ["+a+"]; return false; ":" var err = "+a+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ")+"} ",u&&(s+=" else { "),s;throw new Error(r+" must be number")}},{}],17:[function(e,r,t){r.exports=function(e,r,t){var a=" ",s=e.schema[r],o=e.schemaPath+e.util.getProperty(r),i=e.errSchemaPath+"/"+r,n=!e.opts.allErrors,l=e.util.copy(e),c="",u=(l.level++,"valid"+l.level),h=l.baseId,d=!0,p=s;if(p)for(var f,m=-1,v=p.length-1;m<v;)f=p[m+=1],(e.opts.strictKeywords?"object"==typeof f&&0<Object.keys(f).length||!1===f:e.util.schemaHasRules(f,e.RULES.all))&&(d=!1,l.schema=f,l.schemaPath=o+"["+m+"]",l.errSchemaPath=i+"/"+m,a+="  "+e.validate(l)+" ",l.baseId=h,n)&&(a+=" if ("+u+") { ",c+="}");return n&&(a+=d?" if (true) { ":" "+c.slice(0,-1)+" "),a}},{}],18:[function(e,r,t){r.exports=function(r,e,t){var a=" ",s=r.level,o=r.dataLevel,i=r.schema[e],n=r.schemaPath+r.util.getProperty(e),l=r.errSchemaPath+"/"+e,e=!r.opts.allErrors,o="data"+(o||""),c="valid"+s,s="errs__"+s,u=r.util.copy(r),h="",d=(u.level++,"valid"+u.level);if(i.every(function(e){return r.opts.strictKeywords?"object"==typeof e&&0<Object.keys(e).length||!1===e:r.util.schemaHasRules(e,r.RULES.all)})){var p=u.baseId,f=(a+=" var "+s+" = errors; var "+c+" = false;  ",r.compositeRule),m=(r.compositeRule=u.compositeRule=!0,i);if(m)for(var v,y=-1,g=m.length-1;y<g;)v=m[y+=1],u.schema=v,u.schemaPath=n+"["+y+"]",u.errSchemaPath=l+"/"+y,a+="  "+r.validate(u)+" ",u.baseId=p,a+=" "+c+" = "+c+" || "+d+"; if (!"+c+") { ",h+="}";r.compositeRule=u.compositeRule=f,a+=" "+h+" if (!"+c+") {   var err =   ",!1!==r.createErrors?(a+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+r.errorPath+" , schemaPath: "+r.util.toQuotedString(l)+" , params: {} ",!1!==r.opts.messages&&(a+=" , message: 'should match some schema in anyOf' "),r.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+r.schemaPath+" , data: "+o+" "),a+=" } "):a+=" {} ",a+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!r.compositeRule&&e&&(a+=r.async?" throw new ValidationError(vErrors); ":" validate.errors = vErrors; return false; "),a+=" } else {  errors = "+s+"; if (vErrors !== null) { if ("+s+") vErrors.length = "+s+"; else vErrors = null; } ",r.opts.allErrors&&(a+=" } ")}else e&&(a+=" if (true) { ");return a}},{}],19:[function(e,r,t){r.exports=function(e,r,t){var a=" ",s=e.errSchemaPath+"/"+r,r=e.util.toQuotedString(e.schema[r]);return!0===e.opts.$comment?a+=" console.log("+r+");":"function"==typeof e.opts.$comment&&(a+=" self._opts.$comment("+r+", "+e.util.toQuotedString(s)+", validate.root.schema);"),a}},{}],20:[function(e,r,t){r.exports=function(e,r,t){var a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),r=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(o||""),u="valid"+s,h=e.opts.$data&&i&&i.$data,i=(h&&(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; "),h||(a+=" var schema"+s+" = validate.schema"+n+";"),[]),o=(i.push(a+="var "+u+" = equal("+c+", schema"+s+"); if (!"+u+") {   "),a="",!1!==e.createErrors?(a+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(r)+" , params: { allowedValue: schema"+s+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be equal to constant' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a);return a=(a=i.pop())+(!e.compositeRule&&l?e.async?" throw new ValidationError(["+o+"]); ":" validate.errors = ["+o+"]; return false; ":" var err = "+o+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ")+" }",l&&(a+=" else { "),a}},{}],21:[function(e,r,t){r.exports=function(e,r,t){var a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),r=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,o="data"+(o||""),c="valid"+s,u="errs__"+s,h=e.util.copy(e),d=(h.level++,"valid"+h.level),s="i"+s,p=h.dataLevel=e.dataLevel+1,f="data"+p,m=e.baseId,v=e.opts.strictKeywords?"object"==typeof i&&0<Object.keys(i).length||!1===i:e.util.schemaHasRules(i,e.RULES.all),s=(a+="var "+u+" = errors;var "+c+";",v?(c=e.compositeRule,e.compositeRule=h.compositeRule=!0,h.schema=i,h.schemaPath=n,h.errSchemaPath=r,a+=" var "+d+" = false; for (var "+s+" = 0; "+s+" < "+o+".length; "+s+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,s,e.opts.jsonPointers,!0),i=o+"["+s+"]",h.dataPathArr[p]=s,p=e.validate(h),h.baseId=m,e.util.varOccurences(p,f)<2?a+=" "+e.util.varReplace(p,f,i)+" ":a+=" var "+f+" = "+i+"; "+p+" ",a+=" if ("+d+") break; }  ",e.compositeRule=h.compositeRule=c,a+="  if (!"+d+") {"):a+=" if ("+o+".length == 0) {",[]),m=(s.push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(r)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: 'should contain a valid item' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+o+" "),a+=" } "):a+=" {} ",a);return a=(a=s.pop())+(!e.compositeRule&&l?e.async?" throw new ValidationError(["+m+"]); ":" validate.errors = ["+m+"]; return false; ":" var err = "+m+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ")+" } else { ",v&&(a+="  errors = "+u+"; if (vErrors !== null) { if ("+u+") vErrors.length = "+u+"; else vErrors = null; } "),e.opts.allErrors&&(a+=" } "),a}},{}],22:[function(e,r,t){r.exports=function(e,r,t){var a,s,o,i=" ",n=e.level,l=e.dataLevel,c=e.schema[r],u=e.schemaPath+e.util.getProperty(r),h=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,p="data"+(l||""),f="valid"+n,m="errs__"+n,v=e.opts.$data&&c&&c.$data,y=v?(i+=" var schema"+n+" = "+e.util.getData(c.$data,l,e.dataPathArr)+"; ","schema"+n):c,g=this,P="definition"+n,E=g.definition,w="";if(v&&E.$data){var b="keywordValidate"+n,S=E.validateSchema;i+=" var "+P+" = RULES.custom['"+r+"'].definition; var "+b+" = "+P+".validate;"}else{if(!(R=e.useCustomRule(g,c,e.schema,e)))return;y="validate.schema"+u,b=R.code,a=E.compile,s=E.inline,o=E.macro}var _,F,x,R,$,r=b+".errors",c="i"+n,j="ruleErr"+n,D=E.async;if(D&&!e.async)throw new Error("async keyword in sync schema");return s||o||(i+=r+" = null;"),i+="var "+m+" = errors;var "+f+";",v&&E.$data&&(w+="}",i+=" if ("+y+" === undefined) { "+f+" = true; } else { ",S)&&(w+="}",i+=" "+f+" = "+P+".validateSchema("+y+"); if ("+f+") { "),s?i+=E.statements?" "+R.validate+" ":" "+f+" = "+R.validate+"; ":o?(w="",(v=e.util.copy(e)).level++,_="valid"+v.level,v.schema=R.validate,v.schemaPath="",S=e.compositeRule,e.compositeRule=v.compositeRule=!0,P=e.validate(v).replace(/validate\.schema/g,b),e.compositeRule=v.compositeRule=S,i+=" "+P):(($=$||[]).push(i),i=(i=(i="")+"  "+b+".call( "+(e.opts.passContext?"this":"self"))+(a||!1===E.schema?" , "+p+" ":" , "+y+" , "+p+" , validate.schema"+e.schemaPath+" ")+" , (dataPath || '')",'""'!=e.errorPath&&(i+=" + "+e.errorPath),R=i+=" , "+(F=l?"data"+(l-1||""):"parentData")+" , "+(x=l?e.dataPathArr[l]:"parentDataProperty")+" , rootData )  ",i=$.pop(),!1===E.errors?(i+=" "+f+" = ",D&&(i+="await "),i+=R+"; "):i+=D?" var "+(r="customErrors"+n)+" = null; try { "+f+" = await "+R+"; } catch (e) { "+f+" = false; if (e instanceof ValidationError) "+r+" = e.errors; else throw e; } ":" "+r+" = null; "+f+" = "+R+"; "),E.modifying&&(i+=" if ("+F+") "+p+" = "+F+"["+x+"];"),i+=""+w,E.valid?d&&(i+=" if (true) { "):(i+=" if ( ",void 0===E.valid?i=i+" !"+(o?""+_:f):i+=" "+!E.valid+" ",v=g.keyword,($=$||[]).push(i+=") { "),($=$||[]).push(i=""),i="",!1!==e.createErrors?(i+=" { keyword: '"+(v||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { keyword: '"+g.keyword+"' } ",!1!==e.opts.messages&&(i+=" , message: 'should pass \""+g.keyword+"\" keyword validation' "),e.opts.verbose&&(i+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ",S=i,i=$.pop(),P=i+=!e.compositeRule&&d?e.async?" throw new ValidationError(["+S+"]); ":" validate.errors = ["+S+"]; return false; ":" var err = "+S+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i=$.pop(),s?E.errors?"full"!=E.errors&&(i+="  for (var "+c+"="+m+"; "+c+"<errors; "+c+"++) { var "+j+" = vErrors["+c+"]; if ("+j+".dataPath === undefined) "+j+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+j+".schemaPath === undefined) { "+j+'.schemaPath = "'+h+'"; } ',e.opts.verbose&&(i+=" "+j+".schema = "+y+"; "+j+".data = "+p+"; "),i+=" } "):!1===E.errors?i+=" "+P+" ":(i+=" if ("+m+" == errors) { "+P+" } else {  for (var "+c+"="+m+"; "+c+"<errors; "+c+"++) { var "+j+" = vErrors["+c+"]; if ("+j+".dataPath === undefined) "+j+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+j+".schemaPath === undefined) { "+j+'.schemaPath = "'+h+'"; } ',e.opts.verbose&&(i+=" "+j+".schema = "+y+"; "+j+".data = "+p+"; "),i+=" } } "):o?(i+="   var err =   ",!1!==e.createErrors?(i+=" { keyword: '"+(v||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { keyword: '"+g.keyword+"' } ",!1!==e.opts.messages&&(i+=" , message: 'should pass \""+g.keyword+"\" keyword validation' "),e.opts.verbose&&(i+=" , schema: validate.schema"+u+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ",i+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&d&&(i+=e.async?" throw new ValidationError(vErrors); ":" validate.errors = vErrors; return false; ")):!1===E.errors?i+=" "+P+" ":(i+=" if (Array.isArray("+r+")) { if (vErrors === null) vErrors = "+r+"; else vErrors = vErrors.concat("+r+"); errors = vErrors.length;  for (var "+c+"="+m+"; "+c+"<errors; "+c+"++) { var "+j+" = vErrors["+c+"]; if ("+j+".dataPath === undefined) "+j+".dataPath = (dataPath || '') + "+e.errorPath+";  "+j+'.schemaPath = "'+h+'";  ',e.opts.verbose&&(i+=" "+j+".schema = "+y+"; "+j+".data = "+p+"; "),i+=" } } else { "+P+" } "),i+=" } ",d&&(i+=" else { ")),i}},{}],23:[function(e,r,t){r.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,h="data"+(i||""),r="errs__"+o,d=e.util.copy(e),p="",f=(d.level++,"valid"+d.level),m={},v={},y=e.opts.ownProperties;for(O in n)"__proto__"!=O&&(A=n[O],(a=Array.isArray(A)?v:m)[O]=A);var g=e.errorPath;for(O in s=s+("var "+r+" = errors;")+("var missing"+o+";"),v)if((a=v[O]).length){if(s+=" if ( "+h+e.util.getProperty(O)+" !== undefined ",y&&(s+=" && Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(O)+"') "),u){s+=" && ( ";var P=a;if(P)for(var E=-1,w=P.length-1;E<w;)x=P[E+=1],E&&(s+=" || "),s+=" ( ( "+(D=h+(j=e.util.getProperty(x)))+" === undefined ",y&&(s+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(x)+"') "),s+=") && (missing"+o+" = "+e.util.toQuotedString(e.opts.jsonPointers?x:j)+") ) ";s+=")) {  ";var b="missing"+o,S="' + "+b+" + '",_=(e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(g,b,!0):g+" + "+b),_||[]),b=(_.push(s),s="",!1!==e.createErrors?(s+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { property: '"+e.util.escapeQuotes(O)+"', missingProperty: '"+S+"', depsCount: "+a.length+", deps: '"+e.util.escapeQuotes(1==a.length?a[0]:a.join(", "))+"' } ",!1!==e.opts.messages&&(s=(s=(s+=" , message: 'should have ")+(1==a.length?"property "+e.util.escapeQuotes(a[0]):"properties "+e.util.escapeQuotes(a.join(", "))))+" when property "+e.util.escapeQuotes(O)+" is present' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",s),s=_.pop();s+=!e.compositeRule&&u?e.async?" throw new ValidationError(["+b+"]); ":" validate.errors = ["+b+"]; return false; ":" var err = "+b+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{s+=" ) { ";var F=a;if(F)for(var x,R=-1,$=F.length-1;R<$;){x=F[R+=1];var j=e.util.getProperty(x),S=e.util.escapeQuotes(x),D=h+j;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(g,x,e.opts.jsonPointers)),s+=" if ( "+D+" === undefined ",y&&(s+=" || ! Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(x)+"') "),s+=") {  var err =   ",!1!==e.createErrors?(s+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { property: '"+e.util.escapeQuotes(O)+"', missingProperty: '"+S+"', depsCount: "+a.length+", deps: '"+e.util.escapeQuotes(1==a.length?a[0]:a.join(", "))+"' } ",!1!==e.opts.messages&&(s=(s=(s+=" , message: 'should have ")+(1==a.length?"property "+e.util.escapeQuotes(a[0]):"properties "+e.util.escapeQuotes(a.join(", "))))+" when property "+e.util.escapeQuotes(O)+" is present' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+h+" "),s+=" } "):s+=" {} ",s+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}s+=" }   ",u&&(p+="}",s+=" else { ")}e.errorPath=g;var O,I=d.baseId;for(O in m){var A=m[O];(e.opts.strictKeywords?"object"==typeof A&&0<Object.keys(A).length||!1===A:e.util.schemaHasRules(A,e.RULES.all))&&(s+=" "+f+" = true; if ( "+h+e.util.getProperty(O)+" !== undefined ",y&&(s+=" && Object.prototype.hasOwnProperty.call("+h+", '"+e.util.escapeQuotes(O)+"') "),s+=") { ",d.schema=A,d.schemaPath=l+e.util.getProperty(O),d.errSchemaPath=c+"/"+e.util.escapeFragment(O),s+="  "+e.validate(d)+" ",d.baseId=I,s+=" }  ",u)&&(s+=" if ("+f+") { ",p+="}")}return u&&(s+="   "+p+" if ("+r+" == errors) {"),s}},{}],24:[function(e,r,t){r.exports=function(e,r,t){var a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),r=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(o||""),u="valid"+s,h=e.opts.$data&&i&&i.$data,i=(h&&(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; "),"i"+s),o="schema"+s,o=(h||(a+=" var "+o+" = validate.schema"+n+";"),a+="var "+u+";",h&&(a+=" if (schema"+s+" === undefined) "+u+" = true; else if (!Array.isArray(schema"+s+")) "+u+" = false; else {"),a+=u+" = false;for (var "+i+"=0; "+i+"<"+o+".length; "+i+"++) if (equal("+c+", "+o+"["+i+"])) { "+u+" = true; break; }",h&&(a+="  }  "),[]),i=(o.push(a+=" if (!"+u+") {   "),a="",!1!==e.createErrors?(a+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(r)+" , params: { allowedValues: schema"+s+" } ",!1!==e.opts.messages&&(a+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a);return a=(a=o.pop())+(!e.compositeRule&&l?e.async?" throw new ValidationError(["+i+"]); ":" validate.errors = ["+i+"]; return false; ":" var err = "+i+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ")+" }",l&&(a+=" else { "),a}},{}],25:[function(e,r,t){r.exports=function(e,r,t){var a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),r=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(o||"");if(!1===e.opts.format)l&&(a+=" if (true) { ");else{var u,h=e.opts.$data&&i&&i.$data,o=h?(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+s):i,d=e.opts.unknownFormats,p=Array.isArray(d);if(h)a+=" var "+(u="format"+s)+" = formats["+o+"]; var "+(f="isObject"+s)+" = typeof "+u+" == 'object' && !("+u+" instanceof RegExp) && "+u+".validate; var "+(v="formatType"+s)+" = "+f+" && "+u+".type || 'string'; if ("+f+") { ",e.async&&(a+=" var async"+s+" = "+u+".async; "),a+=" "+u+" = "+u+".validate; } if (  ",h&&(a+=" ("+o+" !== undefined && typeof "+o+" != 'string') || "),a+=" (","ignore"!=d&&(a+=" ("+o+" && !"+u+" ",p&&(a+=" && self._opts.unknownFormats.indexOf("+o+") == -1 "),a+=") || "),a=(a+=" ("+u+" && "+v+" == '"+t+"' && !(typeof "+u+" == 'function' ? ")+(e.async?" (async"+s+" ? await "+u+"("+c+") : "+u+"("+c+")) ":" "+u+"("+c+") ")+(" : "+u+".test("+c+"))))) {");else{if(!(u=e.formats[i])){if("ignore"==d)return e.logger.warn('unknown format "'+i+'" ignored in schema at path "'+e.errSchemaPath+'"'),l&&(a+=" if (true) { "),a;if(p&&0<=d.indexOf(i))return l&&(a+=" if (true) { "),a;throw new Error('unknown format "'+i+'" is used in schema at path "'+e.errSchemaPath+'"')}var f,m,v=(f="object"==typeof u&&!(u instanceof RegExp)&&u.validate)&&u.type||"string";if(f&&(m=!0===u.async,u=u.validate),v!=t)return l&&(a+=" if (true) { "),a;if(m){if(!e.async)throw new Error("async format in sync schema");a+=" if (!(await "+(y="formats"+e.util.getProperty(i)+".validate")+"("+c+"))) { "}else{a+=" if (! ";var y="formats"+e.util.getProperty(i);f&&(y+=".validate"),a=a+("function"==typeof u?" "+y+"("+c+") ":" "+y+".test("+c+") ")+") { "}}s=[],p=(s.push(a),a="",!1!==e.createErrors?(a=(a+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(r)+" , params: { format:  ")+(h?""+o:""+e.util.toQuotedString(i))+"  } ",!1!==e.opts.messages&&(a=(a+=" , message: 'should match format \"")+(h?"' + "+o+" + '":""+e.util.escapeQuotes(i))+"\"' "),e.opts.verbose&&(a=(a=(a+=" , schema:  ")+(h?"validate.schema"+n:""+e.util.toQuotedString(i)))+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a);a=(a=s.pop())+(!e.compositeRule&&l?e.async?" throw new ValidationError(["+p+"]); ":" validate.errors = ["+p+"]; return false; ":" var err = "+p+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ")+" } ",l&&(a+=" else { ")}return a}},{}],26:[function(e,r,t){r.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),r=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,i="data"+(i||""),u="valid"+o,h="errs__"+o,d=e.util.copy(e),p=(d.level++,"valid"+d.level),f=e.schema.then,m=e.schema.else,f=void 0!==f&&(e.opts.strictKeywords?"object"==typeof f&&0<Object.keys(f).length||!1===f:e.util.schemaHasRules(f,e.RULES.all)),m=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&0<Object.keys(m).length||!1===m:e.util.schemaHasRules(m,e.RULES.all)),v=d.baseId;return f||m?(d.createErrors=!1,d.schema=n,d.schemaPath=l,d.errSchemaPath=r,s+=" var "+h+" = errors; var "+u+" = true;  ",n=e.compositeRule,e.compositeRule=d.compositeRule=!0,s+="  "+e.validate(d)+" ",d.baseId=v,d.createErrors=!0,s+="  errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; }  ",e.compositeRule=d.compositeRule=n,f?(s+=" if ("+p+") {  ",d.schema=e.schema.then,d.schemaPath=e.schemaPath+".then",d.errSchemaPath=e.errSchemaPath+"/then",s+="  "+e.validate(d)+" ",d.baseId=v,s+=" "+u+" = "+p+"; ",f&&m?s+=" var "+(a="ifClause"+o)+" = 'then'; ":a="'then'",s+=" } ",m&&(s+=" else { ")):s+=" if (!"+p+") { ",m&&(d.schema=e.schema.else,d.schemaPath=e.schemaPath+".else",d.errSchemaPath=e.errSchemaPath+"/else",s+="  "+e.validate(d)+" ",d.baseId=v,s+=" "+u+" = "+p+"; ",f&&m?s+=" var "+(a="ifClause"+o)+" = 'else'; ":a="'else'",s+=" } "),s+=" if (!"+u+") {   var err =   ",!1!==e.createErrors?(s+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(r)+" , params: { failingKeyword: "+a+" } ",!1!==e.opts.messages&&(s+=" , message: 'should match \"' + "+a+" + '\" schema' "),e.opts.verbose&&(s+=" , schema: validate.schema"+l+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+i+" "),s+=" } "):s+=" {} ",s+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&c&&(s+=e.async?" throw new ValidationError(vErrors); ":" validate.errors = vErrors; return false; "),s+=" }   ",c&&(s+=" else { ")):c&&(s+=" if (true) { "),s}},{}],27:[function(e,r,t){r.exports={$ref:e("./ref"),allOf:e("./allOf"),anyOf:e("./anyOf"),$comment:e("./comment"),const:e("./const"),contains:e("./contains"),dependencies:e("./dependencies"),enum:e("./enum"),format:e("./format"),if:e("./if"),items:e("./items"),maximum:e("./_limit"),minimum:e("./_limit"),maxItems:e("./_limitItems"),minItems:e("./_limitItems"),maxLength:e("./_limitLength"),minLength:e("./_limitLength"),maxProperties:e("./_limitProperties"),minProperties:e("./_limitProperties"),multipleOf:e("./multipleOf"),not:e("./not"),oneOf:e("./oneOf"),pattern:e("./pattern"),properties:e("./properties"),propertyNames:e("./propertyNames"),required:e("./required"),uniqueItems:e("./uniqueItems"),validate:e("./validate")}},{"./_limit":13,"./_limitItems":14,"./_limitLength":15,"./_limitProperties":16,"./allOf":17,"./anyOf":18,"./comment":19,"./const":20,"./contains":21,"./dependencies":23,"./enum":24,"./format":25,"./if":26,"./items":28,"./multipleOf":29,"./not":30,"./oneOf":31,"./pattern":32,"./properties":33,"./propertyNames":34,"./ref":35,"./required":36,"./uniqueItems":37,"./validate":38}],28:[function(e,r,t){r.exports=function(e,r,t){var a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u="data"+(o||""),r="valid"+s,o="errs__"+s,h=e.util.copy(e),d="",p=(h.level++,"valid"+h.level),s="i"+s,f=h.dataLevel=e.dataLevel+1,m="data"+f,v=e.baseId;if(a+="var "+o+" = errors;var "+r+";",Array.isArray(i)){var y,g,P=e.schema.additionalItems,E=(!1===P&&(y=l,l=e.errSchemaPath+"/additionalItems",(g=g||[]).push(a=a+(" "+r+" = "+u+".length <= "+i.length+"; ")+("  if (!"+r+") {   ")),a="",!1!==e.createErrors?(a+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { limit: "+i.length+" } ",!1!==e.opts.messages&&(a+=" , message: 'should NOT have more than "+i.length+" items' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",r=a,a=(a=g.pop())+(!e.compositeRule&&c?e.async?" throw new ValidationError(["+r+"]); ":" validate.errors = ["+r+"]; return false; ":" var err = "+r+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ")+" } ",l=y,c)&&(d+="}",a+=" else { "),i);if(E)for(var w=-1,b=E.length-1;w<b;){var S,_,F=E[w+=1];(e.opts.strictKeywords?"object"==typeof F&&0<Object.keys(F).length||!1===F:e.util.schemaHasRules(F,e.RULES.all))&&(a+=" "+p+" = true; if ("+u+".length > "+w+") { ",S=u+"["+w+"]",h.schema=F,h.schemaPath=n+"["+w+"]",h.errSchemaPath=l+"/"+w,h.errorPath=e.util.getPathExpr(e.errorPath,w,e.opts.jsonPointers,!0),h.dataPathArr[f]=w,_=e.validate(h),h.baseId=v,e.util.varOccurences(_,m)<2?a+=" "+e.util.varReplace(_,m,S)+" ":a+=" var "+m+" = "+S+"; "+_+" ",a+=" }  ",c)&&(a+=" if ("+p+") { ",d+="}")}"object"==typeof P&&(e.opts.strictKeywords?"object"==typeof P&&0<Object.keys(P).length||!1===P:e.util.schemaHasRules(P,e.RULES.all))&&(h.schema=P,h.schemaPath=e.schemaPath+".additionalItems",h.errSchemaPath=e.errSchemaPath+"/additionalItems",a+=" "+p+" = true; if ("+u+".length > "+i.length+") {  for (var "+s+" = "+i.length+"; "+s+" < "+u+".length; "+s+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,s,e.opts.jsonPointers,!0),S=u+"["+s+"]",h.dataPathArr[f]=s,_=e.validate(h),h.baseId=v,e.util.varOccurences(_,m)<2?a+=" "+e.util.varReplace(_,m,S)+" ":a+=" var "+m+" = "+S+"; "+_+" ",c&&(a+=" if (!"+p+") break; "),a+=" } }  ",c)&&(a+=" if ("+p+") { ",d+="}")}else(e.opts.strictKeywords?"object"==typeof i&&0<Object.keys(i).length||!1===i:e.util.schemaHasRules(i,e.RULES.all))&&(h.schema=i,h.schemaPath=n,h.errSchemaPath=l,a+="  for (var "+s+" = 0; "+s+" < "+u+".length; "+s+"++) { ",h.errorPath=e.util.getPathExpr(e.errorPath,s,e.opts.jsonPointers,!0),S=u+"["+s+"]",h.dataPathArr[f]=s,_=e.validate(h),h.baseId=v,e.util.varOccurences(_,m)<2?a+=" "+e.util.varReplace(_,m,S)+" ":a+=" var "+m+" = "+S+"; "+_+" ",c&&(a+=" if (!"+p+") break; "),a+=" }");return c&&(a+=" "+d+" if ("+o+" == errors) {"),a}},{}],29:[function(e,r,t){r.exports=function(e,r,t){var a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u="data"+(o||""),h=e.opts.$data&&i&&i.$data,o=h?(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+s):i;if(!h&&"number"!=typeof i)throw new Error(r+" must be number");a+="var division"+s+";if (",h&&(a+=" "+o+" !== undefined && ( typeof "+o+" != 'number' || "),a=(a+=" (division"+s+" = "+u+" / "+o+", ")+(e.opts.multipleOfPrecision?" Math.abs(Math.round(division"+s+") - division"+s+") > 1e-"+e.opts.multipleOfPrecision+" ":" division"+s+" !== parseInt(division"+s+") ")+" ) ",h&&(a+="  )  ");r=[],r.push(a+=" ) {   "),a="",!1!==e.createErrors?(a+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { multipleOf: "+o+" } ",!1!==e.opts.messages&&(a=a+" , message: 'should be multiple of "+(h?"' + "+o:o+"'")),e.opts.verbose&&(a=(a+=" , schema:  ")+(h?"validate.schema"+n:""+i)+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),a+=" } "):a+=" {} ",s=a;return a=(a=r.pop())+(!e.compositeRule&&c?e.async?" throw new ValidationError(["+s+"]); ":" validate.errors = ["+s+"]; return false; ":" var err = "+s+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ")+"} ",c&&(a+=" else { "),a}},{}],30:[function(e,r,t){r.exports=function(e,r,t){var a,s,o=" ",i=e.level,n=e.dataLevel,l=e.schema[r],c=e.schemaPath+e.util.getProperty(r),r=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,n="data"+(n||""),i="errs__"+i,h=e.util.copy(e),d=(h.level++,"valid"+h.level);return(e.opts.strictKeywords?"object"==typeof l&&0<Object.keys(l).length||!1===l:e.util.schemaHasRules(l,e.RULES.all))?(h.schema=l,h.schemaPath=c,h.errSchemaPath=r,o+=" var "+i+" = errors;  ",l=e.compositeRule,e.compositeRule=h.compositeRule=!0,h.createErrors=!1,h.opts.allErrors&&(s=h.opts.allErrors,h.opts.allErrors=!1),o+=" "+e.validate(h)+" ",h.createErrors=!0,s&&(h.opts.allErrors=s),e.compositeRule=h.compositeRule=l,(a=a||[]).push(o+=" if ("+d+") {   "),o="",!1!==e.createErrors?(o+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(r)+" , params: {} ",!1!==e.opts.messages&&(o+=" , message: 'should NOT be valid' "),e.opts.verbose&&(o+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+n+" "),o+=" } "):o+=" {} ",s=o,o=(o=a.pop())+(!e.compositeRule&&u?e.async?" throw new ValidationError(["+s+"]); ":" validate.errors = ["+s+"]; return false; ":" var err = "+s+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ")+" } else {  errors = "+i+"; if (vErrors !== null) { if ("+i+") vErrors.length = "+i+"; else vErrors = null; } ",e.opts.allErrors&&(o+=" } ")):(o+="  var err =   ",!1!==e.createErrors?(o+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(r)+" , params: {} ",!1!==e.opts.messages&&(o+=" , message: 'should NOT be valid' "),e.opts.verbose&&(o+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+n+" "),o+=" } "):o+=" {} ",o+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(o+=" if (false) { ")),o}},{}],31:[function(e,r,t){r.exports=function(e,r,t){var a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,r=!e.opts.allErrors,o="data"+(o||""),c="valid"+s,u="errs__"+s,h=e.util.copy(e),d="",p=(h.level++,"valid"+h.level),f=h.baseId,m="prevValid"+s,v="passingSchemas"+s,s=(a+="var "+u+" = errors , "+m+" = false , "+c+" = false , "+v+" = null; ",e.compositeRule),y=(e.compositeRule=h.compositeRule=!0,i);if(y)for(var g,P=-1,E=y.length-1;P<E;)g=y[P+=1],(e.opts.strictKeywords?"object"==typeof g&&0<Object.keys(g).length||!1===g:e.util.schemaHasRules(g,e.RULES.all))?(h.schema=g,h.schemaPath=n+"["+P+"]",h.errSchemaPath=l+"/"+P,a+="  "+e.validate(h)+" ",h.baseId=f):a+=" var "+p+" = true; ",P&&(a+=" if ("+p+" && "+m+") { "+c+" = false; "+v+" = ["+v+", "+P+"]; } else { ",d+="}"),a+=" if ("+p+") { "+c+" = "+m+" = true; "+v+" = "+P+"; }";return e.compositeRule=h.compositeRule=s,a+=d+"if (!"+c+") {   var err =   ",!1!==e.createErrors?(a+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { passingSchemas: "+v+" } ",!1!==e.opts.messages&&(a+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+o+" "),a+=" } "):a+=" {} ",a+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&r&&(a+=e.async?" throw new ValidationError(vErrors); ":" validate.errors = vErrors; return false; "),a+="} else {  errors = "+u+"; if (vErrors !== null) { if ("+u+") vErrors.length = "+u+"; else vErrors = null; }",e.opts.allErrors&&(a+=" } "),a}},{}],32:[function(e,r,t){r.exports=function(e,r,t){var a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),r=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(o||""),u="valid"+s,h=e.opts.$data&&i&&i.$data,o=h?(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; ","schema"+s):i,s=(h?(a+=" var "+u+" = true; try { "+u+" = "+(e.opts.regExp?"regExp":"new RegExp")+"("+o+").test("+c+"); } catch(e) { "+u+" = false; } if ( ",h&&(a+=" ("+o+" !== undefined && typeof "+o+" != 'string') || "),a+=" !"+u+") {"):(a+=" if ( ",h&&(a+=" ("+o+" !== undefined && typeof "+o+" != 'string') || "),a+=" !"+e.usePattern(i)+".test("+c+") ) {"),[]),u=(s.push(a),a="",!1!==e.createErrors?(a=(a+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(r)+" , params: { pattern:  ")+(h?""+o:""+e.util.toQuotedString(i))+"  } ",!1!==e.opts.messages&&(a=(a+=" , message: 'should match pattern \"")+(h?"' + "+o+" + '":""+e.util.escapeQuotes(i))+"\"' "),e.opts.verbose&&(a=(a=(a+=" , schema:  ")+(h?"validate.schema"+n:""+e.util.toQuotedString(i)))+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a);return a=(a=s.pop())+(!e.compositeRule&&l?e.async?" throw new ValidationError(["+u+"]); ":" validate.errors = ["+u+"]; return false; ":" var err = "+u+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ")+"} ",l&&(a+=" else { "),a}},{}],33:[function(e,r,t){r.exports=function(e,r,L){var t,a=" ",s=e.level,o=e.dataLevel,N=e.schema[r],i=e.schemaPath+e.util.getProperty(r),n=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(o||""),r="errs__"+s,u=e.util.copy(e),h="",d=(u.level++,"valid"+u.level),p="key"+s,f="idx"+s,m=u.dataLevel=e.dataLevel+1,v="data"+m,y="dataProperties"+s,o=Object.keys(N||{}).filter(V),z=e.schema.patternProperties||{},g=Object.keys(z).filter(V),P=e.schema.additionalProperties,q=o.length||g.length,T=!1===P,Q="object"==typeof P&&Object.keys(P).length,E=e.opts.removeAdditional,w=T||Q||E,b=e.opts.ownProperties,S=e.baseId,_=e.schema.required;function V(e){return"__proto__"!==e}if(_&&(!e.opts.$data||!_.$data)&&_.length<e.opts.loopRequired&&(t=e.util.toHash(_)),a+="var "+r+" = errors;var "+d+" = true;",b&&(a+=" var "+y+" = undefined;"),w){if(a+=b?" "+y+" = "+y+" || Object.keys("+c+"); for (var "+f+"=0; "+f+"<"+y+".length; "+f+"++) { var "+p+" = "+y+"["+f+"]; ":" for (var "+p+" in "+c+") { ",q){if(a+=" var isAdditional"+s+" = !(false ",o.length)if(8<o.length)a+=" || validate.schema"+i+".hasOwnProperty("+p+") ";else{var U=o;if(U)for(var H=-1,M=U.length-1;H<M;)F=U[H+=1],a+=" || "+p+" == "+e.util.toQuotedString(F)+" "}if(g.length){var K=g;if(K)for(var B=-1,J=K.length-1;B<J;)A=K[B+=1],a+=" || "+e.usePattern(A)+".test("+p+") "}a+=" ); if (isAdditional"+s+") { "}"all"==E?a+=" delete "+c+"["+p+"]; ":(R=e.errorPath,_="' + "+p+" + '",e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,p,e.opts.jsonPointers)),T?E?a+=" delete "+c+"["+p+"]; ":($=n,n=e.errSchemaPath+"/additionalProperties",(D=D||[]).push(a+=" "+d+" = false; "),a="",!1!==e.createErrors?(a+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { additionalProperty: '"+_+"' } ",!1!==e.opts.messages&&(a=(a+=" , message: '")+(e.opts._errorDataPathProperty?"is an invalid additional property":"should NOT have additional properties")+"' "),e.opts.verbose&&(a+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",O=a,a=D.pop(),a+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+O+"]); ":" validate.errors = ["+O+"]; return false; ":" var err = "+O+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n=$,l&&(a+=" break; ")):Q&&("failing"==E?(a+=" var "+r+" = errors;  ",w=e.compositeRule,e.compositeRule=u.compositeRule=!0,u.schema=P,u.schemaPath=e.schemaPath+".additionalProperties",u.errSchemaPath=e.errSchemaPath+"/additionalProperties",u.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,p,e.opts.jsonPointers),k=c+"["+p+"]",u.dataPathArr[m]=p,C=e.validate(u),u.baseId=S,e.util.varOccurences(C,v)<2?a+=" "+e.util.varReplace(C,v,k)+" ":a+=" var "+v+" = "+k+"; "+C+" ",a+=" if (!"+d+") { errors = "+r+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+c+"["+p+"]; }  ",e.compositeRule=u.compositeRule=w):(u.schema=P,u.schemaPath=e.schemaPath+".additionalProperties",u.errSchemaPath=e.errSchemaPath+"/additionalPropej-rties",u.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,p,e.opts.jsonPointers),k=c+"["+p+"]",u.dataPathArr[m]=p,C=e.validate(u),u.baseId=S,e.util.varOccurences(C,v)<2?a+=" "+e.util.varReplace(C,v,k)+" ":a+=" var "+v+" = "+k+"; "+C+" ",l&&(a+=" if (!"+d+") break; "))),e.errorPath=R),q&&(a+=" } "),a+=" }  ",l&&(a+=" if ("+d+") { ",h+="}")}var Z=e.opts.useDefaults&&!e.compositeRule;if(o.length){var G=o;if(G)for(var F,Y=-1,W=G.length-1;Y<W;){var X,x,R,$,j,D,O,I=N[F=G[Y+=1]];(e.opts.strictKeywords?"object"==typeof I&&0<Object.keys(I).length||!1===I:e.util.schemaHasRules(I,e.RULES.all))&&(k=c+(j=e.util.getProperty(F)),X=Z&&void 0!==I.default,u.schema=I,u.schemaPath=i+j,u.errSchemaPath=n+"/"+e.util.escapeFragment(F),u.errorPath=e.util.getPath(e.errorPath,F,e.opts.jsonPointers),u.dataPathArr[m]=e.util.toQuotedString(F),C=e.validate(u),u.baseId=S,e.util.varOccurences(C,v)<2?(C=e.util.varReplace(C,v,k),x=k):a+=" var "+(x=v)+" = "+k+"; ",X?a+=" "+C+" ":(t&&t[F]?(a+=" if ( "+x+" === undefined ",b&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(F)+"') "),a+=") { "+d+" = false; ",R=e.errorPath,$=n,j=e.util.escapeQuotes(F),e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(R,F,e.opts.jsonPointers)),n=e.errSchemaPath+"/required",(D=D||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(n)+" , params: { missingProperty: '"+j+"' } ",!1!==e.opts.messages&&(a=(a+=" , message: '")+(e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+j+"\\'")+"' "),e.opts.verbose&&(a+=" , schema: validate.schema"+i+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",O=a,a=D.pop(),a+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+O+"]); ":" validate.errors = ["+O+"]; return false; ":" var err = "+O+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n=$,e.errorPath=R,a+=" } else { "):l?(a+=" if ( "+x+" === undefined ",b&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(F)+"') "),a+=") { "+d+" = true; } else { "):(a+=" if ("+x+" !== undefined ",b&&(a+=" &&   Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes(F)+"') "),a+=" ) { "),a+=" "+C+" } ")),l&&(a+=" if ("+d+") { ",h+="}")}}if(g.length){var ee=g;if(ee)for(var A,re=-1,te=ee.length-1;re<te;){var k,C,I=z[A=ee[re+=1]];(e.opts.strictKeywords?"object"==typeof I&&0<Object.keys(I).length||!1===I:e.util.schemaHasRules(I,e.RULES.all))&&(u.schema=I,u.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(A),u.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(A),a=(a+=b?" "+y+" = "+y+" || Object.keys("+c+"); for (var "+f+"=0; "+f+"<"+y+".length; "+f+"++) { var "+p+" = "+y+"["+f+"]; ":" for (var "+p+" in "+c+") { ")+" if ("+e.usePattern(A)+".test("+p+")) { ",u.errorPath=e.util.getPathExpr(e.errorPath,p,e.opts.jsonPointers),k=c+"["+p+"]",u.dataPathArr[m]=p,C=e.validate(u),u.baseId=S,e.util.varOccurences(C,v)<2?a+=" "+e.util.varReplace(C,v,k)+" ":a+=" var "+v+" = "+k+"; "+C+" ",l&&(a+=" if (!"+d+") break; "),a+=" } ",l&&(a+=" else "+d+" = true; "),a+=" }  ",l)&&(a+=" if ("+d+") { ",h+="}")}}return l&&(a+=" "+h+" if ("+r+" == errors) {"),a}},{}],34:[function(e,r,t){r.exports=function(e,r,t){var a,s,o,i,n,l,c,u=" ",h=e.level,d=e.dataLevel,p=e.schema[r],f=e.schemaPath+e.util.getProperty(r),r=e.errSchemaPath+"/"+r,m=!e.opts.allErrors,d="data"+(d||""),v="errs__"+h,y=e.util.copy(e),g=(y.level++,"valid"+y.level);return u+="var "+v+" = errors;",(e.opts.strictKeywords?"object"==typeof p&&0<Object.keys(p).length||!1===p:e.util.schemaHasRules(p,e.RULES.all))&&(y.schema=p,y.schemaPath=f,y.errSchemaPath=r,p="idx"+h,s="i"+h,o="' + "+(a="key"+h)+" + '",i="data"+(y.dataLevel=e.dataLevel+1),c="dataProperties"+h,n=e.baseId,(l=e.opts.ownProperties)&&(u+=" var "+c+" = undefined; "),u=u+(l?" "+c+" = "+c+" || Object.keys("+d+"); for (var "+p+"=0; "+p+"<"+c+".length; "+p+"++) { var "+a+" = "+c+"["+p+"]; ":" for (var "+a+" in "+d+") { ")+" var startErrs"+h+" = errors; ",l=a,c=e.compositeRule,e.compositeRule=y.compositeRule=!0,p=e.validate(y),y.baseId=n,e.util.varOccurences(p,i)<2?u+=" "+e.util.varReplace(p,i,l)+" ":u+=" var "+i+" = "+l+"; "+p+" ",e.compositeRule=y.compositeRule=c,u+=" if (!"+g+") { for (var "+s+"=startErrs"+h+"; "+s+"<errors; "+s+"++) { vErrors["+s+"].propertyName = "+a+"; }   var err =   ",!1!==e.createErrors?(u+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(r)+" , params: { propertyName: '"+o+"' } ",!1!==e.opts.messages&&(u+=" , message: 'property name \\'"+o+"\\' is invalid' "),e.opts.verbose&&(u+=" , schema: validate.schema"+f+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),u+=" } "):u+=" {} ",u+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&m&&(u+=e.async?" throw new ValidationError(vErrors); ":" validate.errors = vErrors; return false; "),m&&(u+=" break; "),u+=" } }"),m&&(u+="  if ("+v+" == errors) {"),u}},{}],35:[function(e,r,t){r.exports=function(e,r,t){var a,s,o=" ",i=e.dataLevel,n=e.schema[r],r=e.errSchemaPath+"/"+r,l=!e.opts.allErrors,c="data"+(i||""),u="valid"+e.level;if("#"==n||"#/"==n)s=e.isRoot?(a=e.async,"validate"):(a=!0===e.root.schema.$async,"root.refVal[0]");else{var h=e.resolveRef(e.baseId,n,e.isRoot);if(void 0===h){var d=e.MissingRefError.message(e.baseId,n);if("fail"==e.opts.missingRefs){e.logger.error(d);(p=p||[]).push(o),o="",!1!==e.createErrors?(o+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(r)+" , params: { ref: '"+e.util.escapeQuotes(n)+"' } ",!1!==e.opts.messages&&(o+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(n)+"' "),e.opts.verbose&&(o+=" , schema: "+e.util.toQuotedString(n)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),o+=" } "):o+=" {} ";r=o,o=p.pop();o+=!e.compositeRule&&l?e.async?" throw new ValidationError(["+r+"]); ":" validate.errors = ["+r+"]; return false; ":" var err = "+r+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",l&&(o+=" if (false) { ")}else{if("ignore"!=e.opts.missingRefs)throw new e.MissingRefError(e.baseId,n,d);e.logger.warn(d),l&&(o+=" if (true) { ")}}else h.inline?((r=e.util.copy(e)).level++,d="valid"+r.level,r.schema=h.schema,r.schemaPath="",r.errSchemaPath=n,o+=" "+e.validate(r).replace(/validate\.schema/g,h.code)+" ",l&&(o+=" if ("+d+") { ")):(a=!0===h.$async||e.async&&!1!==h.$async,s=h.code)}if(s){(p=p||[]).push(o),o=(o="")+(e.opts.passContext?" "+s+".call(this, ":" "+s+"( ")+(" "+c+", (dataPath || '')"),'""'!=e.errorPath&&(o+=" + "+e.errorPath);var p,n=i?"data"+(i-1||""):"parentData",r=o+=" , "+n+" , "+(i?e.dataPathArr[i]:"parentDataProperty")+", rootData)  ";if(o=p.pop(),a){if(!e.async)throw new Error("async schema referenced by sync schema");l&&(o+=" var "+u+"; "),o+=" try { await "+r+"; ",l&&(o+=" "+u+" = true; "),o+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",l&&(o+=" "+u+" = false; "),o+=" } ",l&&(o+=" if ("+u+") { ")}else o+=" if (!"+r+") { if (vErrors === null) vErrors = "+s+".errors; else vErrors = vErrors.concat("+s+".errors); errors = vErrors.length; } ",l&&(o+=" else { ")}return o}},{}],36:[function(e,r,t){r.exports=function(e,r,t){var a=" ",s=e.level,o=e.dataLevel,i=e.schema[r],n=e.schemaPath+e.util.getProperty(r),l=e.errSchemaPath+"/"+r,r=!e.opts.allErrors,c="data"+(o||""),u="valid"+s,h=e.opts.$data&&i&&i.$data,o=(h&&(a+=" var schema"+s+" = "+e.util.getData(i.$data,o,e.dataPathArr)+"; "),"schema"+s);if(!h)if(i.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var d=[],p=i;if(p)for(var f=-1,m=p.length-1;f<m;){var v=p[f+=1],y=e.schema.properties[v];y&&(e.opts.strictKeywords?"object"==typeof y&&0<Object.keys(y).length||!1===y:e.util.schemaHasRules(y,e.RULES.all))||(d[d.length]=v)}}else d=i;if(h||d.length){var g=e.errorPath,i=h||e.opts.loopRequired<=d.length,P=e.opts.ownProperties;if(r){if(a+=" var missing"+s+"; ",i){h||(a+=" var "+o+" = validate.schema"+n+"; ");var E="' + "+(x="schema"+s+"["+(S="i"+s)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(g,x,e.opts.jsonPointers)),a+=" var "+u+" = true; ",h&&(a+=" if (schema"+s+" === undefined) "+u+" = true; else if (!Array.isArray(schema"+s+")) "+u+" = false; else {"),a+=" for (var "+S+" = 0; "+S+" < "+o+".length; "+S+"++) { "+u+" = "+c+"["+o+"["+S+"]] !== undefined ",P&&(a+=" &&   Object.prototype.hasOwnProperty.call("+c+", "+o+"["+S+"]) "),a+="; if (!"+u+") break; } ",h&&(a+="  }  ");(F=F||[]).push(a+="  if (!"+u+") {   "),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+E+"' } ",!1!==e.opts.messages&&(a=(a+=" , message: '")+(e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+E+"\\'")+"' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var w=a}else{a+=" if ( ";var b=d;if(b)for(var S=-1,_=b.length-1;S<_;)$=b[S+=1],S&&(a+=" || "),a+=" ( ( "+(I=c+(O=e.util.getProperty($)))+" === undefined ",P&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes($)+"') "),a+=") && (missing"+s+" = "+e.util.toQuotedString(e.opts.jsonPointers?$:O)+") ) ";a+=") {  ";E="' + "+(x="missing"+s)+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(g,x,!0):g+" + "+x);(F=F||[]).push(a),a="",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+E+"' } ",!1!==e.opts.messages&&(a=(a+=" , message: '")+(e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+E+"\\'")+"' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var F,w=a}a=(a=F.pop())+(!e.compositeRule&&r?e.async?" throw new ValidationError(["+w+"]); ":" validate.errors = ["+w+"]; return false; ":" var err = "+w+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ")+" } else { "}else if(i){h||(a+=" var "+o+" = validate.schema"+n+"; ");var x,E="' + "+(x="schema"+s+"["+(S="i"+s)+"]")+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(g,x,e.opts.jsonPointers)),h&&(a+=" if ("+o+" && !Array.isArray("+o+")) {  var err =   ",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+E+"' } ",!1!==e.opts.messages&&(a=(a+=" , message: '")+(e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+E+"\\'")+"' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+o+" !== undefined) { "),a+=" for (var "+S+" = 0; "+S+" < "+o+".length; "+S+"++) { if ("+c+"["+o+"["+S+"]] === undefined ",P&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", "+o+"["+S+"]) "),a+=") {  var err =   ",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+E+"' } ",!1!==e.opts.messages&&(a=(a+=" , message: '")+(e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+E+"\\'")+"' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",h&&(a+="  }  ")}else{var R=d;if(R)for(var $,j=-1,D=R.length-1;j<D;){$=R[j+=1];var O=e.util.getProperty($),E=e.util.escapeQuotes($),I=c+O;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(g,$,e.opts.jsonPointers)),a+=" if ( "+I+" === undefined ",P&&(a+=" || ! Object.prototype.hasOwnProperty.call("+c+", '"+e.util.escapeQuotes($)+"') "),a+=") {  var err =   ",!1!==e.createErrors?(a+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(l)+" , params: { missingProperty: '"+E+"' } ",!1!==e.opts.messages&&(a=(a+=" , message: '")+(e.opts._errorDataPathProperty?"is a required property":"should have required property \\'"+E+"\\'")+"' "),e.opts.verbose&&(a+=" , schema: validate.schema"+n+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ",a+=";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=g}else r&&(a+=" if (true) {");return a}},{}],37:[function(e,r,t){r.exports=function(e,r,t){var a,s=" ",o=e.level,i=e.dataLevel,n=e.schema[r],l=e.schemaPath+e.util.getProperty(r),r=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u="data"+(i||""),h="valid"+o,d=e.opts.$data&&n&&n.$data,i=d?(s+=" var schema"+o+" = "+e.util.getData(n.$data,i,e.dataPathArr)+"; ","schema"+o):n;return(n||d)&&!1!==e.opts.uniqueItems?(d&&(s+=" var "+h+"; if ("+i+" === false || "+i+" === undefined) "+h+" = true; else if (typeof "+i+" != 'boolean') "+h+" = false; else { "),s+=" var i = "+u+".length , "+h+" = true , j; if (i > 1) { ",o=e.schema.items&&e.schema.items.type,i=Array.isArray(o),!o||"object"==o||"array"==o||i&&(0<=o.indexOf("object")||0<=o.indexOf("array"))?s+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+u+"[i], "+u+"[j])) { "+h+" = false; break outer; } } } ":(s=(s+=" var itemIndices = {}, item; for (;i--;) { var item = "+u+"[i]; ")+" if ("+e.util["checkDataType"+(i?"s":"")](o,"item",e.opts.strictNumbers,!0)+") continue; ",i&&(s+=" if (typeof item == 'string') item = '\"' + item; "),s+=" if (typeof itemIndices[item] == 'number') { "+h+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "),s+=" } ",d&&(s+="  }  "),(a=a||[]).push(s+=" if (!"+h+") {   "),s="",!1!==e.createErrors?(s+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(r)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(s+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(s=(s+=" , schema:  ")+(d?"validate.schema"+l:""+n)+"         , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),s+=" } "):s+=" {} ",o=s,s=(s=a.pop())+(!e.compositeRule&&c?e.async?" throw new ValidationError(["+o+"]); ":" validate.errors = ["+o+"]; return false; ":" var err = "+o+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ")+" } ",c&&(s+=" else { ")):c&&(s+=" if (true) { "),s}},{}],38:[function(e,r,t){r.exports=function(a,e,L){var r="",t=!0===a.schema.$async,s=a.util.schemaHasRulesExcept(a.schema,a.RULES.all,"$ref"),o=a.self._getId(a.schema);if(a.opts.strictKeywords){var i=a.util.schemaUnknownRules(a.schema,a.RULES.keywords);if(i){i="unknown keyword: "+i;if("log"!==a.opts.strictKeywords)throw new Error(i);a.logger.warn(i)}}if(a.isTop&&(r+=" var validate = ",t&&(a.async=!0,r+="async "),r+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",o)&&(a.opts.sourceCode||a.opts.processCode)&&(r+=" /*# sourceURL="+o+" */ "),"boolean"==typeof a.schema||!s&&!a.schema.$ref)l=a.level,c=a.dataLevel,j=a.schema[e="false schema"],E=a.schemaPath+a.util.getProperty(e),w=a.errSchemaPath+"/"+e,p=!a.opts.allErrors,u="data"+(c||""),d="valid"+l,!1===a.schema?(a.isTop?p=!0:r+=" var "+d+" = false; ",(k=k||[]).push(r),r="",!1!==a.createErrors?(r+=" { keyword: 'false schema' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(w)+" , params: {} ",!1!==a.opts.messages&&(r+=" , message: 'boolean schema is false' "),a.opts.verbose&&(r+=" , schema: false , parentSchema: validate.schema"+a.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ",R=r,r=k.pop(),r+=!a.compositeRule&&p?a.async?" throw new ValidationError(["+R+"]); ":" validate.errors = ["+R+"]; return false; ":" var err = "+R+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "):r+=a.isTop?t?" return data; ":" validate.errors = null; return true; ":" var "+d+" = true; ",a.isTop&&(r+=" }; return validate; ");else{if(a.isTop){var n=a.isTop,l=a.level=0,c=a.dataLevel=0,u="data";if(a.rootId=a.resolve.fullPath(a.self._getId(a.root.schema)),a.baseId=a.baseId||a.rootId,delete a.isTop,a.dataPathArr=[""],void 0!==a.schema.default&&a.opts.useDefaults&&a.opts.strictDefaults){var h="default is ignored in the schema root";if("log"!==a.opts.strictDefaults)throw new Error(h);a.logger.warn(h)}r=(r+=" var vErrors = null; ")+" var errors = 0;     "+" if (rootData === undefined) rootData = data; "}else{l=a.level,u="data"+((c=a.dataLevel)||"");if(o&&(a.baseId=a.resolve.url(a.baseId,o)),t&&!a.async)throw new Error("async schema in sync schema");r+=" var errs_"+l+" = errors;"}var d="valid"+l,p=!a.opts.allErrors,f="",m="",v=a.schema.type,y=Array.isArray(v);if(v&&a.opts.nullable&&!0===a.schema.nullable&&(y?-1==v.indexOf("null")&&(v=v.concat("null")):"null"!=v&&(v=[v,"null"],y=!0)),y&&1==v.length&&(v=v[0],y=!1),a.schema.$ref&&s){if("fail"==a.opts.extendRefs)throw new Error('$ref: validation keywords used in schema at path "'+a.errSchemaPath+'" (see option extendRefs)');!0!==a.opts.extendRefs&&(s=!1,a.logger.warn('$ref: keywords ignored in schema at path "'+a.errSchemaPath+'"'))}if(a.schema.$comment&&a.opts.$comment&&(r+=" "+a.RULES.all.$comment.code(a,"$comment")),v){a.opts.coerceTypes&&(g=a.util.coerceToTypes(a.opts.coerceTypes,v));var g,P=a.RULES.types[v];if(g||y||!0===P||P&&!B(P)){var E=a.schemaPath+".type",w=a.errSchemaPath+"/type",E=a.schemaPath+".type",w=a.errSchemaPath+"/type";if(r+=" if ("+a.util[y?"checkDataTypes":"checkDataType"](v,u,a.opts.strictNumbers,!0)+") { ",g){var b="dataType"+l,S="coerced"+l,_=(r+=" var "+b+" = typeof "+u+"; var "+S+" = undefined; ","array"==a.opts.coerceTypes&&(r+=" if ("+b+" == 'object' && Array.isArray("+u+") && "+u+".length == 1) { "+u+" = "+u+"[0]; "+b+" = typeof "+u+"; if ("+a.util.checkDataType(a.schema.type,u,a.opts.strictNumbers)+") "+S+" = "+u+"; } "),r+=" if ("+S+" !== undefined) ; ",g);if(_)for(var F,x=-1,N=_.length-1;x<N;)"string"==(F=_[x+=1])?r+=" else if ("+b+" == 'number' || "+b+" == 'boolean') "+S+" = '' + "+u+"; else if ("+u+" === null) "+S+" = ''; ":"number"==F||"integer"==F?(r+=" else if ("+b+" == 'boolean' || "+u+" === null || ("+b+" == 'string' && "+u+" && "+u+" == +"+u+" ","integer"==F&&(r+=" && !("+u+" % 1)"),r+=")) "+S+" = +"+u+"; "):"boolean"==F?r+=" else if ("+u+" === 'false' || "+u+" === 0 || "+u+" === null) "+S+" = false; else if ("+u+" === 'true' || "+u+" === 1) "+S+" = true; ":"null"==F?r+=" else if ("+u+" === '' || "+u+" === 0 || "+u+" === false) "+S+" = null; ":"array"==a.opts.coerceTypes&&"array"==F&&(r+=" else if ("+b+" == 'string' || "+b+" == 'number' || "+b+" == 'boolean' || "+u+" == null) "+S+" = ["+u+"]; ");(k=k||[]).push(r+=" else {   "),r="",!1!==a.createErrors?(r=(r+=" { keyword: 'type' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(w)+" , params: { type: '")+(y?""+v.join(","):""+v)+"' } ",!1!==a.opts.messages&&(r=(r+=" , message: 'should be ")+(y?""+v.join(","):""+v)+"' "),a.opts.verbose&&(r+=" , schema: validate.schema"+E+" , parentSchema: validate.schema"+a.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ";var R=r,i=(r=k.pop(),c?"data"+(c-1||""):"parentData");r=(r+=!a.compositeRule&&p?a.async?" throw new ValidationError(["+R+"]); ":" validate.errors = ["+R+"]; return false; ":" var err = "+R+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ")+(" } if ("+S+" !== undefined) {  ")+(" "+u+" = "+S+"; "),c||(r+="if ("+i+" !== undefined)"),r+=" "+i+"["+(c?a.dataPathArr[c]:"parentDataProperty")+"] = "+S+"; } "}else{R=((k=k||[]).push(r),r="",!1!==a.createErrors?(r=(r+=" { keyword: 'type' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(w)+" , params: { type: '")+(y?""+v.join(","):""+v)+"' } ",!1!==a.opts.messages&&(r=(r+=" , message: 'should be ")+(y?""+v.join(","):""+v)+"' "),a.opts.verbose&&(r+=" , schema: validate.schema"+E+" , parentSchema: validate.schema"+a.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ",r);r=k.pop(),r+=!a.compositeRule&&p?a.async?" throw new ValidationError(["+R+"]); ":" validate.errors = ["+R+"]; return false; ":" var err = "+R+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}r+=" } "}}if(a.schema.$ref&&!s)r+=" "+a.RULES.all.$ref.code(a,"$ref")+" ",p&&(r=(r+=" } if (errors === ")+(n?"0":"errs_"+l)+") { ",m+="}");else{var $=a.RULES;if($)for(var z=-1,q=$.length-1;z<q;)if(B(P=$[z+=1])){if(P.type&&(r+=" if ("+a.util.checkDataType(P.type,u,a.opts.strictNumbers)+") { "),a.opts.useDefaults)if("object"==P.type&&a.schema.properties){var j=a.schema.properties,D=Object.keys(j);if(D)for(var T,Q=-1,V=D.length-1;Q<V;)if(void 0!==(A=j[T=D[Q+=1]]).default){var O=u+a.util.getProperty(T);if(a.compositeRule){if(a.opts.strictDefaults){h="default is ignored for: "+O;if("log"!==a.opts.strictDefaults)throw new Error(h);a.logger.warn(h)}}else r+=" if ("+O+" === undefined ","empty"==a.opts.useDefaults&&(r+=" || "+O+" === null || "+O+" === '' "),r=(r+=" ) "+O+" = ")+("shared"==a.opts.useDefaults?" "+a.useDefault(A.default)+" ":" "+JSON.stringify(A.default)+" ")+"; "}}else if("array"==P.type&&Array.isArray(a.schema.items)){var I=a.schema.items;if(I)for(var A,x=-1,U=I.length-1;x<U;)if(void 0!==(A=I[x+=1]).default){O=u+"["+x+"]";if(a.compositeRule){if(a.opts.strictDefaults){h="default is ignored for: "+O;if("log"!==a.opts.strictDefaults)throw new Error(h);a.logger.warn(h)}}else r+=" if ("+O+" === undefined ","empty"==a.opts.useDefaults&&(r+=" || "+O+" === null || "+O+" === '' "),r=(r+=" ) "+O+" = ")+("shared"==a.opts.useDefaults?" "+a.useDefault(A.default)+" ":" "+JSON.stringify(A.default)+" ")+"; "}}var k,H=P.rules;if(H)for(var C,M=-1,K=H.length-1;M<K;)J(C=H[M+=1])&&(C=C.code(a,C.keyword,P.type))&&(r+=" "+C+" ",p)&&(f+="}");p&&(r+=" "+f+" ",f=""),P.type&&(r+=" } ",v)&&v===P.type&&!g&&(E=a.schemaPath+".type",w=a.errSchemaPath+"/type",(k=k||[]).push(r+=" else { "),r="",!1!==a.createErrors?(r=(r+=" { keyword: 'type' , dataPath: (dataPath || '') + "+a.errorPath+" , schemaPath: "+a.util.toQuotedString(w)+" , params: { type: '")+(y?""+v.join(","):""+v)+"' } ",!1!==a.opts.messages&&(r=(r+=" , message: 'should be ")+(y?""+v.join(","):""+v)+"' "),a.opts.verbose&&(r+=" , schema: validate.schema"+E+" , parentSchema: validate.schema"+a.schemaPath+" , data: "+u+" "),r+=" } "):r+=" {} ",R=r,r=(r=k.pop())+(!a.compositeRule&&p?a.async?" throw new ValidationError(["+R+"]); ":" validate.errors = ["+R+"]; return false; ":" var err = "+R+";  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ")+" } "),p&&(r=(r+=" if (errors === ")+(n?"0":"errs_"+l)+") { ",m+="}")}}p&&(r+=" "+m+" "),n?r=r+(t?" if (errors === 0) return data;            else throw new ValidationError(vErrors); ":" validate.errors = vErrors;  return errors === 0;       ")+" }; return validate;":r+=" var "+d+" = errors === errs_"+l+";"}return r;function B(e){for(var r=e.rules,t=0;t<r.length;t++)if(J(r[t]))return 1}function J(e){return void 0!==a.schema[e.keyword]||e.implements&&(e=>{for(var r=e.implements,t=0;t<r.length;t++)if(void 0!==a.schema[r[t]])return 1})(e)}}},{}],39:[function(e,r,t){var n=/^[a-z_$][a-z0-9_$-]*$/i,l=e("./dotjs/custom"),a=e("./definition_schema");function s(e,r){s.errors=null;var t=this._validateKeyword=this._validateKeyword||this.compile(a,!0);if(t(e))return!0;if(s.errors=t.errors,r)throw new Error("custom keyword definition is invalid: "+this.errorsText(t.errors));return!1}r.exports={add:function(e,r){var i=this.RULES;if(i.keywords[e])throw new Error("Keyword "+e+" is already defined");if(!n.test(e))throw new Error("Keyword "+e+" is not a valid identifier");if(r){this.validateKeyword(r,!0);var t=r.type;if(Array.isArray(t))for(var a=0;a<t.length;a++)o(e,t[a],r);else o(e,t,r);var s=r.metaSchema;s&&(r.validateSchema=this.compile(s=r.$data&&this._opts.$data?{anyOf:[s,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}:s,!0))}function o(e,r,t){for(var a,s=0;s<i.length;s++){var o=i[s];if(o.type==r){a=o;break}}a||i.push(a={type:r,rules:[]});t={keyword:e,definition:t,custom:!0,code:l,implements:t.implements};a.rules.push(t),i.custom[e]=t}return i.keywords[e]=i.all[e]=!0,this},get:function(e){var r=this.RULES.custom[e];return r?r.definition:this.RULES.keywords[e]||!1},remove:function(e){var r=this.RULES;delete r.keywords[e],delete r.all[e],delete r.custom[e];for(var t=0;t<r.length;t++)for(var a=r[t].rules,s=0;s<a.length;s++)if(a[s].keyword==e){a.splice(s,1);break}return this},validate:s}},{"./definition_schema":12,"./dotjs/custom":22}],40:[function(e,r,t){r.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}},{}],41:[function(e,r,t){r.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}},{}],42:[function(e,r,t){r.exports=function e(r,t){if(r===t)return!0;if(r&&t&&"object"==typeof r&&"object"==typeof t){if(r.constructor!==t.constructor)return!1;var a,s,o;if(Array.isArray(r)){if((a=r.length)!=t.length)return!1;for(s=a;0!=s--;)if(!e(r[s],t[s]))return!1}else{if(r.constructor===RegExp)return r.source===t.source&&r.flags===t.flags;if(r.valueOf!==Object.prototype.valueOf)return r.valueOf()===t.valueOf();if(r.toString!==Object.prototype.toString)return r.toString()===t.toString();if((a=(o=Object.keys(r)).length)!==Object.keys(t).length)return!1;for(s=a;0!=s--;)if(!Object.prototype.hasOwnProperty.call(t,o[s]))return!1;for(s=a;0!=s--;){var i=o[s];if(!e(r[i],t[i]))return!1}}return!0}return r!=r&&t!=t}},{}],43:[function(e,r,t){r.exports=function(e,r){var a,l="boolean"==typeof(r="function"==typeof(r=r||{})?{cmp:r}:r).cycles&&r.cycles,c=r.cmp&&(a=r.cmp,function(t){return function(e,r){return a({key:e,value:t[e]},{key:r,value:t[r]})}}),u=[];return function e(r){if(void 0!==(r=r&&r.toJSON&&"function"==typeof r.toJSON?r.toJSON():r)){if("number"==typeof r)return isFinite(r)?""+r:"null";if("object"!=typeof r)return JSON.stringify(r);if(Array.isArray(r)){for(s="[",o=0;o<r.length;o++)o&&(s+=","),s+=e(r[o])||"null";return s+"]"}if(null===r)return"null";if(-1!==u.indexOf(r)){if(l)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}for(var t=u.push(r)-1,a=Object.keys(r).sort(c&&c(r)),s="",o=0;o<a.length;o++){var i=a[o],n=e(r[i]);n&&(s&&(s+=","),s+=JSON.stringify(i)+":"+n)}return u.splice(t,1),"{"+s+"}"}}(e)}},{}],44:[function(e,r,t){var m=r.exports=function(e,r,t){"function"==typeof r&&(t=r,r={}),function e(r,t,a,s,o,i,n,l,c,u){if(s&&"object"==typeof s&&!Array.isArray(s)){for(var h in t(s,o,i,n,l,c,u),s){var d=s[h];if(Array.isArray(d)){if(h in m.arrayKeywords)for(var p=0;p<d.length;p++)e(r,t,a,d[p],o+"/"+h+"/"+p,i,o,h,s,p)}else if(h in m.propsKeywords){if(d&&"object"==typeof d)for(var f in d)e(r,t,a,d[f],o+"/"+h+"/"+v(f),i,o,h,s,f)}else(h in m.keywords||r.allKeys&&!(h in m.skipKeywords))&&e(r,t,a,d,o+"/"+h,i,o,h,s)}a(s,o,i,n,l,c,u)}}(r,"function"==typeof(t=r.cb||t)?t:t.pre||function(){},t.post||function(){},e,"",e)};function v(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}m.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0},m.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},m.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},m.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},{}],45:[function(e,r,t){var a;a=this,function(e){function g(){for(var e=arguments.length,r=Array(e),t=0;t<e;t++)r[t]=arguments[t];if(1<r.length){r[0]=r[0].slice(0,-1);for(var a=r.length-1,s=1;s<a;++s)r[s]=r[s].slice(1,-1);return r[a]=r[a].slice(1),r.join("")}return r[0]}function P(e){return"(?:"+e+")"}function a(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function p(e){return e.toUpperCase()}function r(e){var r="[A-Za-z]",t="[0-9]",a=g(t,"[A-Fa-f]"),s=P(P("%[EFef]"+a+"%"+a+a+"%"+a+a)+"|"+P("%[89A-Fa-f]"+a+"%"+a+a)+"|"+P("%"+a+a)),o="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",i=g("[\\:\\/\\?\\#\\[\\]\\@]",o),n=e?"[\\uE000-\\uF8FF]":"[]",e=g(r,t,"[\\-\\.\\_\\~]",e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]"),l=(P(r+g(r,t,"[\\+\\-\\.]")+"*"),P(P(s+"|"+g(e,o,"[\\:]"))+"*"),P("(?:25[0-5])|(?:2[0-4][0-9])|(?:1[0-9][0-9])|(?:0?[1-9][0-9])|0?0?"+t)),l=P(l+"\\."+l+"\\."+l+"\\."+l),c=P(a+"{1,4}"),u=P(P(c+"\\:"+c)+"|"+l),h=P(P(c+"\\:")+"{6}"+u),d=P("\\:\\:"+P(c+"\\:")+"{5}"+u),p=P(P(c)+"?\\:\\:"+P(c+"\\:")+"{4}"+u),f=P(P(P(c+"\\:")+"{0,1}"+c)+"?\\:\\:"+P(c+"\\:")+"{3}"+u),m=P(P(P(c+"\\:")+"{0,2}"+c)+"?\\:\\:"+P(c+"\\:")+"{2}"+u),v=P(P(P(c+"\\:")+"{0,3}"+c)+"?\\:\\:"+c+"\\:"+u),u=P(P(P(c+"\\:")+"{0,4}"+c)+"?\\:\\:"+u),y=P(P(P(c+"\\:")+"{0,5}"+c)+"?\\:\\:"+c),c=P(P(P(c+"\\:")+"{0,6}"+c)+"?\\:\\:"),h=P([h,d,p,f,m,v,u,y,c].join("|")),d=P(P(e+"|"+s)+"+"),p=(P("[vV]"+a+"+\\."+g(e,o,"[\\:]")+"+"),P(P(s+"|"+g(e,o))+"*"),P(s+"|"+g(e,o,"[\\:\\@]")));P(P(s+"|"+g(e,o,"[\\@]"))+"+"),P(P(p+"|"+g("[\\/\\?]",n))+"*");return{NOT_SCHEME:new RegExp(g("[^]",r,t,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(g("[^\\%\\:]",e,o),"g"),NOT_HOST:new RegExp(g("[^\\%\\[\\]\\:]",e,o),"g"),NOT_PATH:new RegExp(g("[^\\%\\/\\:\\@]",e,o),"g"),NOT_PATH_NOSCHEME:new RegExp(g("[^\\%\\/\\@]",e,o),"g"),NOT_QUERY:new RegExp(g("[^\\%]",e,o,"[\\:\\@\\/\\?]",n),"g"),NOT_FRAGMENT:new RegExp(g("[^\\%]",e,o,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(g("[^]",e,o),"g"),UNRESERVED:new RegExp(e,"g"),OTHER_CHARS:new RegExp(g("[^\\%]",e,i),"g"),PCT_ENCODED:new RegExp(s,"g"),IPV4ADDRESS:new RegExp("^("+l+")$"),IPV6ADDRESS:new RegExp("^\\[?("+h+")"+P(P("\\%25|\\%(?!"+a+"{2})")+"("+d+")")+"?\\]?$")}}var n=r(!1),l=r(!0),h=function(e,r){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e)){var t=r,a=[],s=!0,r=!1,o=void 0;try{for(var i,n=e[Symbol.iterator]();!(s=(i=n.next()).done)&&(a.push(i.value),!t||a.length!==t);s=!0);}catch(e){r=!0,o=e}finally{try{!s&&n.return&&n.return()}finally{if(r)throw o}}return a}throw new TypeError("Invalid attempt to destructure non-iterable instance")},O=2147483647,I=36,A=26,$=38,j=700,D=/^xn--/,q=/[^\0-\x7E]/,T=/[\x2E\u3002\uFF0E\uFF61]/g,Q={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},s=I-1,k=Math.floor,C=String.fromCharCode;function L(e){throw new RangeError(Q[e])}function t(e,r){var t=e.split("@"),a="",t=(1<t.length&&(a=t[0]+"@",e=t[1]),(e=e.replace(T,".")).split("."));return a+((e,r)=>{for(var t=[],a=e.length;a--;)t[a]=r(e[a]);return t})(t,r).join(".")}function V(e){for(var r=[],t=0,a=e.length;t<a;){var s,o=e.charCodeAt(t++);55296<=o&&o<=56319&&t<a?56320==(64512&(s=e.charCodeAt(t++)))?r.push(((1023&o)<<10)+(1023&s)+65536):(r.push(o),t--):r.push(o)}return r}function N(e,r){return e+22+75*(e<26)-((0!=r)<<5)}function z(e,r,t){var a=0;for(e=t?k(e/j):e>>1,e+=k(e/r);s*A>>1<e;a+=I)e=k(e/s);return k(a+(s+1)*e/(e+$))}function U(e){var r=[],t=e.length,a=0,s=128,o=72,i=e.lastIndexOf("-");i<0&&(i=0);for(var n=0;n<i;++n)128<=e.charCodeAt(n)&&L("not-basic"),r.push(e.charCodeAt(n));for(var l=0<i?i+1:0;l<t;){for(var c=a,u=1,h=I;;h+=I){t<=l&&L("invalid-input");var d=(d=e.charCodeAt(l++))-48<10?d-22:d-65<26?d-65:d-97<26?d-97:I,p=((I<=d||d>k((O-a)/u))&&L("overflow"),a+=d*u,h<=o?1:o+A<=h?A:h-o);if(d<p)break;d=I-p;u>k(O/d)&&L("overflow"),u*=d}var f=r.length+1,o=z(a-c,f,0==c);k(a/f)>O-s&&L("overflow"),s+=k(a/f),a%=f,r.splice(a++,0,s)}return String.fromCodePoint.apply(String,r)}function H(e){var r=[],t=(e=V(e)).length,a=128,s=0,o=72,i=!0,n=!1,l=void 0;try{for(var c,u=e[Symbol.iterator]();!(i=(c=u.next()).done);i=!0){var h=c.value;h<128&&r.push(C(h))}}catch(e){n=!0,l=e}finally{try{!i&&u.return&&u.return()}finally{if(n)throw l}}var d=r.length,p=d;for(d&&r.push("-");p<t;){var f=O,m=!0,v=!1,y=void 0;try{for(var g,P=e[Symbol.iterator]();!(m=(g=P.next()).done);m=!0){var E=g.value;a<=E&&E<f&&(f=E)}}catch(e){v=!0,y=e}finally{try{!m&&P.return&&P.return()}finally{if(v)throw y}}var w=p+1,b=(f-a>k((O-s)/w)&&L("overflow"),s+=(f-a)*w,a=f,!0),v=!1,y=void 0;try{for(var S,_=e[Symbol.iterator]();!(b=(S=_.next()).done);b=!0){var F=S.value;if(F<a&&++s>O&&L("overflow"),F==a){for(var x=s,R=I;;R+=I){var $=R<=o?1:o+A<=R?A:R-o;if(x<$)break;var j=x-$,D=I-$;r.push(C(N($+j%D,0))),x=k(j/D)}r.push(C(N(x,0))),o=z(s,w,p==d),s=0,++p}}}catch(e){v=!0,y=e}finally{try{!b&&_.return&&_.return()}finally{if(v)throw y}}++s,++a}return r.join("")}var v=function(e){return t(e,function(e){return q.test(e)?"xn--"+H(e):e})},M=function(e){return t(e,function(e){return D.test(e)?U(e.slice(4).toLowerCase()):e})},c={};function f(e){e=e.charCodeAt(0);return e<16?"%0"+e.toString(16).toUpperCase():e<128?"%"+e.toString(16).toUpperCase():e<2048?"%"+(e>>6|192).toString(16).toUpperCase()+"%"+(63&e|128).toString(16).toUpperCase():"%"+(e>>12|224).toString(16).toUpperCase()+"%"+(e>>6&63|128).toString(16).toUpperCase()+"%"+(63&e|128).toString(16).toUpperCase()}function u(e){for(var r="",t=0,a=e.length;t<a;){var s,o,i=parseInt(e.substr(t+1,2),16);i<128?(r+=String.fromCharCode(i),t+=3):194<=i&&i<224?(6<=a-t?(s=parseInt(e.substr(t+4,2),16),r+=String.fromCharCode((31&i)<<6|63&s)):r+=e.substr(t,6),t+=6):224<=i?(9<=a-t?(s=parseInt(e.substr(t+4,2),16),o=parseInt(e.substr(t+7,2),16),r+=String.fromCharCode((15&i)<<12|(63&s)<<6|63&o)):r+=e.substr(t,9),t+=9):(r+=e.substr(t,3),t+=3)}return r}function d(e,t){function r(e){var r=u(e);return r.match(t.UNRESERVED)?r:e}e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,f).replace(t.PCT_ENCODED,p)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,f).replace(t.PCT_ENCODED,p)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,f).replace(t.PCT_ENCODED,p)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,f).replace(t.PCT_ENCODED,p)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,f).replace(t.PCT_ENCODED,p))}function m(e){return e.replace(/^0*(.*)/,"$1")||"0"}function y(e,r){r=e.match(r.IPV4ADDRESS)||[],r=h(r,2)[1];return r?r.split(".").map(m).join("."):e}function K(e,r){var t=e.match(r.IPV6ADDRESS)||[],t=h(t,3),a=t[1],t=t[2];if(a){for(var a=a.toLowerCase().split("::").reverse(),a=h(a,2),s=a[0],a=a[1],o=a?a.split(":").map(m):[],i=s.split(":").map(m),a=r.IPV4ADDRESS.test(i[i.length-1]),n=a?7:8,l=i.length-n,c=Array(n),u=0;u<n;++u)c[u]=o[u]||i[l+u]||"";a&&(c[n-1]=y(c[n-1],r));var s=c.reduce(function(e,r,t){return r&&"0"!==r||((r=e[e.length-1])&&r.index+r.length===t?r.length++:e.push({index:t,length:1})),e},[]).sort(function(e,r){return r.length-e.length})[0],a=void 0;return a=s&&1<s.length?(r=c.slice(0,s.index),s=c.slice(s.index+s.length),r.join(":")+"::"+s.join(":")):c.join(":"),t&&(a+="%"+t),a}return e}var B=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,J=void 0==="".match(/(){0}/)[1];function o(e){var r=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},t={},a=!1!==r.iri?l:n,s=(e="suffix"===r.reference?(r.scheme?r.scheme+":":"")+"//"+e:e).match(B);if(s){J?(t.scheme=s[1],t.userinfo=s[3],t.host=s[4],t.port=parseInt(s[5],10),t.path=s[6]||"",t.query=s[7],t.fragment=s[8],isNaN(t.port)&&(t.port=s[5])):(t.scheme=s[1]||void 0,t.userinfo=-1!==e.indexOf("@")?s[3]:void 0,t.host=-1!==e.indexOf("//")?s[4]:void 0,t.port=parseInt(s[5],10),t.path=s[6]||"",t.query=-1!==e.indexOf("?")?s[7]:void 0,t.fragment=-1!==e.indexOf("#")?s[8]:void 0,isNaN(t.port)&&(t.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?s[4]:void 0)),t.host&&(t.host=K(y(t.host,a),a)),t.reference=void 0!==t.scheme||void 0!==t.userinfo||void 0!==t.host||void 0!==t.port||t.path||void 0!==t.query?void 0===t.scheme?"relative":void 0===t.fragment?"absolute":"uri":"same-document",r.reference&&"suffix"!==r.reference&&r.reference!==t.reference&&(t.error=t.error||"URI is not a "+r.reference+" reference.");e=c[(r.scheme||t.scheme||"").toLowerCase()];if(r.unicodeSupport||e&&e.unicodeSupport)d(t,a);else{if(t.host&&(r.domainHost||e&&e.domainHost))try{t.host=v(t.host.replace(a.PCT_ENCODED,u).toLowerCase())}catch(e){t.error=t.error||"Host's domain name can not be converted to ASCII via punycode: "+e}d(t,n)}e&&e.parse&&e.parse(t,r)}else t.error=t.error||"URI can not be parsed.";return t}var Z=/^\.\.?\//,G=/^\/\.(\/|$)/,Y=/^\/\.\.(\/|$)/,W=/^\/?(?:.|\n)*?(?=\/|$)/;function E(e){for(var r=[];e.length;)if(e.match(Z))e=e.replace(Z,"");else if(e.match(G))e=e.replace(G,"/");else if(e.match(Y))e=e.replace(Y,"/"),r.pop();else if("."===e||".."===e)e="";else{var t=e.match(W);if(!t)throw new Error("Unexpected dot segment condition");t=t[0];e=e.slice(t.length),r.push(t)}return r.join("")}function i(r){var t=1<arguments.length&&void 0!==arguments[1]?arguments[1]:{},e=t.iri?l:n,a=[],s=c[(t.scheme||r.scheme||"").toLowerCase()];if(s&&s.serialize&&s.serialize(r,t),r.host&&!e.IPV6ADDRESS.test(r.host)&&(t.domainHost||s&&s.domainHost))try{r.host=t.iri?M(r.host):v(r.host.replace(e.PCT_ENCODED,u).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}d(r,e),"suffix"!==t.reference&&r.scheme&&(a.push(r.scheme),a.push(":"));e=!1!==(e=t).iri?l:n,o=[],void 0!==(i=r).userinfo&&(o.push(i.userinfo),o.push("@")),void 0!==i.host&&o.push(K(y(String(i.host),e),e).replace(e.IPV6ADDRESS,function(e,r,t){return"["+r+(t?"%25"+t:"")+"]"})),"number"!=typeof i.port&&"string"!=typeof i.port||(o.push(":"),o.push(String(i.port)));var o,i,e=o.length?o.join(""):void 0;return void 0!==e&&("suffix"!==t.reference&&a.push("//"),a.push(e),r.path)&&"/"!==r.path.charAt(0)&&a.push("/"),void 0!==r.path&&(i=r.path,t.absolutePath||s&&s.absolutePath||(i=E(i)),void 0===e&&(i=i.replace(/^\/\//,"/%2F")),a.push(i)),void 0!==r.query&&(a.push("?"),a.push(r.query)),void 0!==r.fragment&&(a.push("#"),a.push(r.fragment)),a.join("")}function X(e,r){var t=2<arguments.length&&void 0!==arguments[2]?arguments[2]:{},a={};return arguments[3]||(e=o(i(e,t),t),r=o(i(r,t),t)),!(t||{}).tolerant&&r.scheme?(a.scheme=r.scheme,a.userinfo=r.userinfo,a.host=r.host,a.port=r.port,a.path=E(r.path||""),a.query=r.query):(void 0!==r.userinfo||void 0!==r.host||void 0!==r.port?(a.userinfo=r.userinfo,a.host=r.host,a.port=r.port,a.path=E(r.path||""),a.query=r.query):(r.path?("/"===r.path.charAt(0)?a.path=E(r.path):(a.path=void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:r.path:"/"+r.path,a.path=E(a.path)),a.query=r.query):(a.path=e.path,a.query=(void 0!==r.query?r:e).query),a.userinfo=e.userinfo,a.host=e.host,a.port=e.port),a.scheme=e.scheme),a.fragment=r.fragment,a}function w(e,r){return e&&e.toString().replace((r&&r.iri?l:n).PCT_ENCODED,u)}var b={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var t="https"===String(e.scheme).toLowerCase();return e.port!==(t?443:80)&&""!==e.port||(e.port=void 0),e.path||(e.path="/"),e}},ee={scheme:"https",domainHost:b.domainHost,parse:b.parse,serialize:b.serialize};function re(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var S={scheme:"ws",domainHost:!0,parse:function(e,r){return e.secure=re(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e,r){var t,a;return e.port!==(re(e)?443:80)&&""!==e.port||(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName&&(t=e.resourceName.split("?"),a=(t=h(t,2))[1],e.path=(t=t[0])&&"/"!==t?t:void 0,e.query=a,e.resourceName=void 0),e.fragment=void 0,e}},te={scheme:"wss",domainHost:S.domainHost,parse:S.parse,serialize:S.serialize},ae={},_="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",F=g("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),se=new RegExp(_,"g"),x=new RegExp("(?:(?:%[EFef][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f])|(?:%[89A-Fa-f][0-9A-Fa-f]%[0-9A-Fa-f][0-9A-Fa-f])|(?:%[0-9A-Fa-f][0-9A-Fa-f]))","g"),oe=new RegExp(g("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',F),"g"),ie=new RegExp(g("[^]",_,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ne=ie;function R(e){var r=u(e);return r.match(se)?r:e}var F={scheme:"mailto",parse:function(e,r){var t=e,a=t.to=t.path?t.path.split(","):[];if(t.path=void 0,t.query){for(var s=!1,o={},i=t.query.split("&"),n=0,l=i.length;n<l;++n){var c=i[n].split("=");switch(c[0]){case"to":for(var u=c[1].split(","),h=0,d=u.length;h<d;++h)a.push(u[h]);break;case"subject":t.subject=w(c[1],r);break;case"body":t.body=w(c[1],r);break;default:s=!0,o[w(c[0],r)]=w(c[1],r)}}s&&(t.headers=o)}t.query=void 0;for(var p=0,f=a.length;p<f;++p){var m=a[p].split("@");if(m[0]=w(m[0]),r.unicodeSupport)m[1]=w(m[1],r).toLowerCase();else try{m[1]=v(w(m[1],r).toLowerCase())}catch(e){t.error=t.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}a[p]=m.join("@")}return t},serialize:function(e,r){var t,a=e,s=null!=(t=e.to)?t instanceof Array?t:"number"!=typeof t.length||t.split||t.setInterval||t.call?[t]:Array.prototype.slice.call(t):[];if(s){for(var o=0,i=s.length;o<i;++o){var n=String(s[o]),l=n.lastIndexOf("@"),c=n.slice(0,l).replace(x,R).replace(x,p).replace(oe,f),n=n.slice(l+1);try{n=r.iri?M(n):v(w(n,r).toLowerCase())}catch(e){a.error=a.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+e}s[o]=c+"@"+n}a.path=s.join(",")}var u,h=e.headers=e.headers||{},d=(e.subject&&(h.subject=e.subject),e.body&&(h.body=e.body),[]);for(u in h)h[u]!==ae[u]&&d.push(u.replace(x,R).replace(x,p).replace(ie,f)+"="+h[u].replace(x,R).replace(x,p).replace(ne,f));return d.length&&(a.query=d.join("&")),a}},le=/^([^\:]+)\:(.*)/,_={scheme:"urn",parse:function(e,r){var t,a,s=e.path&&e.path.match(le);return s?(a=r.scheme||e.scheme||"urn",t=s[1].toLowerCase(),s=s[2],a=c[a+":"+(r.nid||t)],e.nid=t,e.nss=s,e.path=void 0,a&&(e=a.parse(e,r))):e.error=e.error||"URN can not be parsed.",e},serialize:function(e,r){var t=e.nid,a=c[(r.scheme||e.scheme||"urn")+":"+(r.nid||t)],a=e=a?a.serialize(e,r):e;return a.path=(t||r.nid)+":"+e.nss,a}},ce=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,ue={scheme:"urn:uuid",parse:function(e,r){return e.uuid=e.nss,e.nss=void 0,r.tolerant||e.uuid&&e.uuid.match(ce)||(e.error=e.error||"UUID is not valid."),e},serialize:function(e,r){var t=e;return t.nss=(e.uuid||"").toLowerCase(),t}};c[b.scheme]=b,c[ee.scheme]=ee,c[S.scheme]=S,c[te.scheme]=te,c[F.scheme]=F,c[_.scheme]=_,c[ue.scheme]=ue,e.SCHEMES=c,e.pctEncChar=f,e.pctDecChars=u,e.parse=o,e.removeDotSegments=E,e.serialize=i,e.resolveComponents=X,e.resolve=function(e,r,t){return t=((e,r)=>{var t=e;if(r)for(var a in r)t[a]=r[a];return t})({scheme:"null"},t),i(X(o(e,t),o(r,t),t,!0),t)},e.normalize=function(e,r){return"string"==typeof e?e=i(o(e,r),r):"object"===a(e)&&(e=o(i(e,r),r)),e},e.equal=function(e,r,t){return"string"==typeof e?e=i(o(e,t),t):"object"===a(e)&&(e=i(e,t)),"string"==typeof r?r=i(o(r,t),t):"object"===a(r)&&(r=i(r,t)),e===r},e.escapeComponent=function(e,r){return e&&e.toString().replace((r&&r.iri?l:n).ESCAPE,f)},e.unescapeComponent=w,Object.defineProperty(e,"__esModule",{value:!0})}("object"==typeof t&&void 0!==r?t:a.URI=a.URI||{})},{}],ajv:[function(h,e,r){var i=h("./compile"),l=h("./compile/resolve"),d=h("./cache"),c=h("./compile/schema_obj"),p=h("fast-json-stable-stringify"),f=h("./compile/formats"),m=h("./compile/rules"),v=h("./data"),y=h("./compile/util"),e=((e.exports=w).prototype.validate=function(e,r){var t;if("string"==typeof e){if(!(t=this.getSchema(e)))throw new Error('no schema with key or ref "'+e+'"')}else{e=this._addSchema(e);t=e.validate||this._compile(e)}e=t(r);!0!==t.$async&&(this.errors=t.errors);return e},w.prototype.compile=function(e,r){e=this._addSchema(e,void 0,r);return e.validate||this._compile(e)},w.prototype.addSchema=function(e,r,t,a){if(Array.isArray(e))for(var s=0;s<e.length;s++)this.addSchema(e[s],void 0,t,a);else{var o=this._getId(e);if(void 0!==o&&"string"!=typeof o)throw new Error("schema id must be string");u(this,r=l.normalizeId(r||o)),this._schemas[r]=this._addSchema(e,t,a,!0)}return this},w.prototype.addMetaSchema=function(e,r,t){return this.addSchema(e,r,t,!0),this},w.prototype.validateSchema=function(e,r){var t=e.$schema;if(void 0!==t&&"string"!=typeof t)throw new Error("$schema must be a string");if(!(t=t||this._opts.defaultMeta||(e=>{var r=e._opts.meta;return e._opts.defaultMeta="object"==typeof r?e._getId(r)||r:e.getSchema(g)?g:void 0,e._opts.defaultMeta})(this)))return this.logger.warn("meta-schema not available"),!(this.errors=null);t=this.validate(t,e);if(!t&&r){e="schema is invalid: "+this.errorsText();if("log"!=this._opts.validateSchema)throw new Error(e);this.logger.error(e)}return t},w.prototype.getSchema=function(e){var r=t(this,e);switch(typeof r){case"object":return r.validate||this._compile(r);case"string":return this.getSchema(r);case"undefined":return((e,r)=>{var t,a,s,o=l.schema.call(e,{schema:{}},r);if(o)return s=i.call(e,t=o.schema,a=o.root,void 0,o=o.baseId),e._fragments[r]=new c({ref:r,fragment:!0,schema:t,root:a,baseId:o,validate:s}),s})(this,e)}},w.prototype.removeSchema=function(e){if(e instanceof RegExp)a(this,this._schemas,e),a(this,this._refs,e);else switch(typeof e){case"undefined":return a(this,this._schemas),a(this,this._refs),this._cache.clear(),this;case"string":var r=t(this,e);return r&&this._cache.del(r.cacheKey),delete this._schemas[e],delete this._refs[e],this;case"object":r=this._opts.serialize,r=r?r(e):e,r=(this._cache.del(r),this._getId(e));r&&(r=l.normalizeId(r),delete this._schemas[r],delete this._refs[r])}return this},w.prototype.addFormat=function(e,r){"string"==typeof r&&(r=new RegExp(r));return this._formats[e]=r,this},w.prototype.errorsText=function(e,r){if(!(e=e||this.errors))return"No errors";for(var t=void 0===(r=r||{}).separator?", ":r.separator,a=void 0===r.dataVar?"data":r.dataVar,s="",o=0;o<e.length;o++){var i=e[o];i&&(s+=a+i.dataPath+" "+i.message+t)}return s.slice(0,-t.length)},w.prototype._addSchema=function(e,r,t,a){if("object"!=typeof e&&"boolean"!=typeof e)throw new Error("schema should be object or boolean");var s=this._opts.serialize,s=s?s(e):e,o=this._cache.get(s);if(o)return o;a=a||!1!==this._opts.addUsedSchema;o=l.normalizeId(this._getId(e));o&&a&&u(this,o);var i,r=!1!==this._opts.validateSchema&&!r;r&&!(i=o&&o==l.normalizeId(e.$schema))&&this.validateSchema(e,!0);var n=l.ids.call(this,e),n=new c({id:o,schema:e,localRefs:n,cacheKey:s,meta:t});"#"!=o[0]&&a&&(this._refs[o]=n);this._cache.put(s,n),r&&i&&this.validateSchema(e,!0);return n},w.prototype._compile=function(t,e){if(t.compiling)return(t.validate=s).schema=t.schema,s.errors=null,s.root=e||s,!0===t.schema.$async&&(s.$async=!0),s;var r,a;t.compiling=!0,t.meta&&(r=this._opts,this._opts=this._metaOpts);try{a=i.call(this,t.schema,e,t.localRefs)}catch(e){throw delete t.validate,e}finally{t.compiling=!1,t.meta&&(this._opts=r)}return t.validate=a,t.refs=a.refs,t.refVal=a.refVal,t.root=a.root,a;function s(){var e=t.validate,r=e.apply(this,arguments);return s.errors=e.errors,r}},w.prototype.compileAsync=h("./compile/async"),h("./keyword")),e=(w.prototype.addKeyword=e.add,w.prototype.getKeyword=e.get,w.prototype.removeKeyword=e.remove,w.prototype.validateKeyword=e.validate,h("./compile/error_classes")),g=(w.ValidationError=e.Validation,w.MissingRefError=e.MissingRef,w.$dataMetaSchema=v,"http://json-schema.org/draft-07/schema"),P=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],E=["/properties"];function w(e){if(!(this instanceof w))return new w(e);e=this._opts=y.copy(e)||{};var r=this,t=r._opts.logger;if(!1===t)r.logger={log:F,warn:F,error:F};else{if(!("object"==typeof(t=void 0===t?console:t)&&t.log&&t.warn&&t.error))throw new Error("logger must implement log, warn and error methods");r.logger=t}if(this._schemas={},this._refs={},this._fragments={},this._formats=f(e.format),this._cache=e.cache||new d,this._loadingSchemas={},this._compilations=[],this.RULES=m(),this._getId=(e=>{switch(e.schemaId){case"auto":return _;case"id":return b;default:return S}})(e),e.loopRequired=e.loopRequired||1/0,"property"==e.errorDataPath&&(e._errorDataPathProperty=!0),void 0===e.serialize&&(e.serialize=p),this._metaOpts=(e=>{for(var r=y.copy(e._opts),t=0;t<P.length;t++)delete r[P[t]];return r})(this),e.formats){var a,s=this;for(a in s._opts.formats)s.addFormat(a,s._opts.formats[a])}if(e.keywords){var o,i=this;for(o in i._opts.keywords)i.addKeyword(o,i._opts.keywords[o])}var n,r=this,l=(r._opts.$data&&(n=h("./refs/data.json"),r.addMetaSchema(n,n.$id,!0)),!1!==r._opts.meta&&(n=h("./refs/json-schema-draft-07.json"),r._opts.$data&&(n=v(n,E)),r.addMetaSchema(n,g,!0),r._refs["http://json-schema.org/schema"]=g),"object"==typeof e.meta&&this.addMetaSchema(e.meta),e.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),this),c=l._opts.schemas;if(c)if(Array.isArray(c))l.addSchema(c);else for(var u in c)l.addSchema(c[u],u)}function t(e,r){return r=l.normalizeId(r),e._schemas[r]||e._refs[r]||e._fragments[r]}function a(e,r,t){for(var a in r){var s=r[a];s.meta||t&&!t.test(a)||(e._cache.del(s.cacheKey),delete r[a])}}function b(e){return e.$id&&this.logger.warn("schema $id ignored",e.$id),e.id}function S(e){return e.id&&this.logger.warn("schema id ignored",e.id),e.$id}function _(e){if(e.$id&&e.id&&e.$id!=e.id)throw new Error("schema $id is different from id");return e.$id||e.id}function u(e,r){if(e._schemas[r]||e._refs[r])throw new Error('schema with key or id "'+r+'" already exists')}function F(){}},{"./cache":1,"./compile":5,"./compile/async":2,"./compile/error_classes":3,"./compile/formats":4,"./compile/resolve":6,"./compile/rules":7,"./compile/schema_obj":8,"./compile/util":10,"./data":11,"./keyword":39,"./refs/data.json":40,"./refs/json-schema-draft-07.json":41,"fast-json-stable-stringify":43}]},{},[])("ajv")});
//# sourceMappingURL=ajv.min.js.mapRHx   {"version":3,"file":"ajv.min.js","sources":["0"],"names":["f","exports","module","define","amd","window","global","self","r","e","n","t","o","i","c","require","u","a","Error","code","p","call","length","1","Cache","this","_cache","prototype","put","key","value","get","del","clear","2","MissingRefError","MissingRef","compileAsync","schema","meta","callback","_opts","loadSchema","undefined","loadMetaSchemaOf","then","schemaObj","_addSchema","validate","_compileAsync","_compile","loadMissingSchema","ref","missingSchema","added","missingRef","schemaPromise","_loadingSchemas","removePromise","sch","addSchema","_refs","_schemas","v","$schema","getSchema","$ref","Promise","resolve","./error_classes","3","baseId","message","url","normalizeId","fullPath","errorSubclass","Subclass","Object","create","constructor","Validation","errors","ajv","validation","./resolve","4","util","DATE","DAYS","TIME","HOSTNAME","URI","URITEMPLATE","URL","UUID","JSON_POINTER","JSON_POINTER_URI_FRAGMENT","RELATIVE_JSON_POINTER","formats","mode","copy","date","str","month","year","matches","match","day","time","full","hour","minute","second","fast","date-time","uri","uri-reference","uri-template","email","hostname","ipv4","ipv6","regex","uuid","json-pointer","json-pointer-uri-fragment","relative-json-pointer","dateTime","split","DATE_TIME_SEPARATOR","NOT_URI_FRAGMENT","test","Z_ANCHOR","RegExp","./util","5","errorClasses","stableStringify","validateGenerator","ucs2length","equal","ValidationError","compile","root","localRefs","opts","refVal","refs","patterns","patternsHash","defaults","defaultsHash","customRules","patternCode","regExp","toQuotedString","index","compIndex","compiling","_compilations","compilation","callValidate","_formats","RULES","localCompile","cv","$async","sourceCode","source","endCompiling","splice","result","apply","arguments","_schema","_root","isRoot","isTop","schemaPath","errSchemaPath","errorPath","resolveRef","usePattern","useDefault","useCustomRule","logger","vars","refValCode","defaultCode","customRuleCode","processCode","Function","error","refIndex","resolvedRef","_refVal","refCode","rootRefId","addLocalRef","localSchema","inlineRef","inlineRefs","refId","inline","regexStr","valueStr","rule","parentSchema","it","validateSchema","deps","definition","dependencies","every","keyword","hasOwnProperty","join","errorsText","macro","arr","statement","../dotjs/validate","fast-deep-equal","fast-json-stable-stringify","6","SchemaObject","traverse","res","resolveSchema","parse","refPath","_getFullPath","getFullPath","_getId","keys","id","parsedRef","resolveUrl","getJsonPointer","ids","schemaId","baseIds","","fullPaths","allKeys","jsonPtr","rootSchema","parentJsonPtr","parentKeyword","keyIndex","escapeFragment","PREVENT_SCOPE_CHANGE","toHash","fragment","slice","parts","part","unescapeFragment","SIMPLE_INLINED","limit","checkNoRef","item","Array","isArray","countKeys","count","Infinity","normalize","serialize","TRAILING_SLASH_HASH","replace","./schema_obj","json-schema-traverse","uri-js","7","ruleModules","type","rules","maximum","minimum","properties","ALL","all","types","forEach","group","map","implKeywords","k","push","implements","$comment","keywords","concat","custom","../dotjs","8","obj","9","len","pos","charCodeAt","10","checkDataType","dataType","data","strictNumbers","negate","EQUAL","AND","OK","NOT","to","checkDataTypes","dataTypes","array","object","null","number","integer","coerceToTypes","optionCoerceTypes","COERCE_TO_TYPES","getProperty","escapeQuotes","varOccurences","dataVar","varReplace","expr","schemaHasRules","schemaHasRulesExcept","exceptKeyword","schemaUnknownRules","getPathExpr","currentPath","jsonPointers","isNumber","joinPaths","getPath","prop","path","escapeJsonPointer","getData","$data","lvl","paths","jsonPointer","up","segments","segment","unescapeJsonPointer","decodeURIComponent","encodeURIComponent","hash","IDENTIFIER","SINGLE_QUOTE","b","./ucs2length","11","KEYWORDS","metaSchema","keywordsJsonPointers","JSON","stringify","j","anyOf","12","$id","definitions","simpleTypes","statements","valid","not","required","items","modifying","async","const","./refs/json-schema-draft-07.json","13","$keyword","$ruleType","$exclusive","$exclType","$exclIsNumber","$opStr","$opExpr","out","$lvl","level","$dataLvl","dataLevel","$schemaPath","$errSchemaPath","$breakOnError","allErrors","$isData","$schemaValue","dataPathArr","$isMax","$exclusiveKeyword","$schemaExcl","$isDataExcl","$op","$notOp","$errorKeyword","$schemaValueExcl","$$outStack","createErrors","messages","verbose","__err","pop","compositeRule","Math","14","15","unicode","16","17","$it","$closingBraces","$nextValid","$currentBaseId","$allSchemasEmpty","arr1","$sch","$i","l1","strictKeywords","18","$valid","$errs","$wasComposite","19","20","21","$idx","$dataNxt","$nextData","$nonEmptySchema","$passData","$code","22","$compile","$inline","$macro","$rule","$definition","$rDef","$validateCode","$validateSchema","$ruleValidate","$parentData","$parentDataProperty","def_callRuleValidate","$ruleErrs","$ruleErr","$asyncKeyword","passContext","def_customError","23","$deps","$schemaDeps","$propertyDeps","$ownProperties","ownProperties","$property","$currentErrorPath","$propertyKey","$prop","$propertyPath","$missingProperty","_errorDataPathProperty","arr2","i2","l2","$useData","24","$vSchema","25","format","$format","$unknownFormats","unknownFormats","$allowUnknown","warn","indexOf","$isObject","$formatType","$formatRef","26","$ifClause","$thenSch","$elseSch","$thenPresent","$elsePresent","27","allOf","contains","enum","if","maxItems","minItems","maxLength","minLength","maxProperties","minProperties","multipleOf","oneOf","pattern","propertyNames","uniqueItems","./_limit","./_limitItems","./_limitLength","./_limitProperties","./allOf","./anyOf","./comment","./const","./contains","./dependencies","./enum","./format","./if","./items","./multipleOf","./not","./oneOf","./pattern","./properties","./propertyNames","./ref","./required","./uniqueItems","./validate","28","$currErrSchemaPath","$additionalItems","additionalItems","29","multipleOfPrecision","30","$allErrorsOption","31","$prevValid","$passingSchemas","32","33","$requiredHash","$key","$dataProperties","$schemaKeys","filter","notProto","$pProperties","patternProperties","$pPropertyKeys","$aProperties","additionalProperties","$someProperties","$noAdditional","$additionalIsSchema","$removeAdditional","removeAdditional","$checkAdditional","$required","loopRequired","i1","$pProperty","$additionalProperty","$useDefaults","useDefaults","arr3","i3","l3","$hasDefault","default","arr4","i4","l4","34","$invalidName","35","$refCode","$refVal","$message","missingRefs","__callValidate","36","$propertySch","$loopRequired","37","$itemType","$typeIsArray","38","$refKeywords","$unknownKwd","$keywordsMsg","$top","rootId","strictDefaults","$defaultMsg","$closingBraces1","$closingBraces2","$typeSchema","nullable","extendRefs","coerceTypes","$coerceToTypes","$rulesGroup","$shouldUseGroup","$dataType","$coerced","$type","arr5","i5","l5","$shouldUseRule","impl","39","definitionSchema","validateKeyword","throwError","_validateKeyword","add","_addRule","ruleGroup","rg","remove","./definition_schema","./dotjs/custom","40","description","41","title","schemaArray","nonNegativeInteger","nonNegativeIntegerDefault0","stringArray","readOnly","examples","exclusiveMinimum","exclusiveMaximum","contentMediaType","contentEncoding","else","42","flags","valueOf","toString","43","cycles","cmp","node","seen","toJSON","isFinite","TypeError","seenIndex","sort","44","cb","_traverse","pre","post","arrayKeywords","propsKeywords","escapeJsonPtr","skipKeywords","45","merge","_len","sets","_key","xl","x","subexp","typeOf","shift","toLowerCase","toUpperCase","buildExps","isIRI","ALPHA$$","DIGIT$$","HEXDIG$$","PCT_ENCODED$","SUB_DELIMS$$","RESERVED$$","IPRIVATE$$","UNRESERVED$$","DEC_OCTET_RELAXED$","IPV4ADDRESS$","H16$","LS32$","IPV6ADDRESS1$","IPV6ADDRESS2$","IPV6ADDRESS3$","IPV6ADDRESS4$","IPV6ADDRESS5$","IPV6ADDRESS6$","IPV6ADDRESS7$","IPV6ADDRESS8$","IPV6ADDRESS9$","IPV6ADDRESS$","ZONEID$","PCHAR$","NOT_SCHEME","NOT_USERINFO","NOT_HOST","NOT_PATH","NOT_PATH_NOSCHEME","NOT_QUERY","NOT_FRAGMENT","ESCAPE","UNRESERVED","OTHER_CHARS","PCT_ENCODED","IPV4ADDRESS","IPV6ADDRESS","URI_PROTOCOL","IRI_PROTOCOL","slicedToArray","Symbol","iterator","sliceIterator","_arr","_n","_d","_e","_s","_i","next","done","err","maxInt","base","tMax","skew","damp","regexPunycode","regexNonASCII","regexSeparators","overflow","not-basic","invalid-input","baseMinusTMin","floor","stringFromCharCode","String","fromCharCode","error$1","RangeError","mapDomain","string","fn","labels","ucs2decode","output","counter","extra","digitToBasic","digit","flag","adapt","delta","numPoints","firstTime","decode","input","inputLength","bias","basic","lastIndexOf","oldi","w","codePoint","baseMinusT","fromCodePoint","encode","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_step","_iterator","_currentValue2","return","basicLength","handledCPCount","m","_iteratorNormalCompletion2","_didIteratorError2","_iteratorError2","_step2","_iterator2","currentValue","handledCPCountPlusOne","_iteratorNormalCompletion3","_didIteratorError3","_iteratorError3","_step3","_iterator3","_currentValue","q","qMinusT","punycode","SCHEMES","pctEncChar","chr","pctDecChars","newStr","il","_c","c3","parseInt","substr","c2","_normalizeComponentEncoding","components","protocol","decodeUnreserved","decStr","scheme","userinfo","host","query","_stripLeadingZeros","_normalizeIPv4","address","_normalizeIPv6","_matches2","zone","_address$toLowerCase$","reverse","_address$toLowerCase$2","last","first","firstFields","lastFields","isLastFieldIPv4Address","fieldCount","lastFieldsStart","fields","longestZeroFields","reduce","acc","field","lastLongest","newHost","newFirst","newLast","URI_PARSE","NO_MATCH_IS_UNDEFINED","uriString","options","iri","reference","port","isNaN","schemeHandler","unicodeSupport","domainHost","RDS1","RDS2","RDS3","RDS5","removeDotSegments","im","s","uriTokens","_","$1","$2","authority","charAt","absolutePath","resolveComponents","relative","target","tolerant","unescapeComponent","handler","secure","handler$1","isSecure","wsComponents","handler$2","resourceName","_wsComponents$resourc","_wsComponents$resourc2","handler$3","O","VCHAR$$","NOT_LOCAL_PART","NOT_HFNAME","NOT_HFVALUE","handler$4","mailtoComponents","unknownHeaders","headers","hfields","hfield","toAddrs","_x","_xl","subject","body","_x2","_xl2","addr","setInterval","toAddr","atIdx","localPart","domain","name","URN_PARSE","handler$5","nid","urnComponents","nss","uriComponents","handler$6","uuidComponents","baseURI","relativeURI","schemelessOptions","uriA","uriB","escapeComponent","defineProperty","compileSchema","$dataMetaSchema","customKeyword","Ajv","schemaKeyRef","_meta","_skipValidation","checkUnique","addMetaSchema","skipValidation","throwOrLogError","defaultMeta","META_SCHEMA_ID","keyRef","_getSchemaObj","_fragments","removeSchema","_removeAllSchemas","cacheKey","addFormat","separator","text","dataPath","shouldAddSchema","cached","addUsedSchema","recursiveMeta","willValidate","currentOpts","_metaOpts","_validate","addKeyword","getKeyword","removeKeyword","META_IGNORE_OPTIONS","META_SUPPORT_DATA","setLogger","log","noop","console","cache","_get$IdOrId","_get$Id","errorDataPath","metaOpts","addInitialFormats","addInitialKeywords","addDefaultMetaSchema","$dataSchema","optsSchemas","schemas","./cache","./compile","./compile/async","./compile/error_classes","./compile/formats","./compile/resolve","./compile/rules","./compile/schema_obj","./compile/util","./data","./keyword","./refs/data.json"],"mappings":";CAAUA,IAAuB,UAAjB,OAAOC,SAAoC,aAAhB,OAAOC,OAAsBA,OAAOD,QAAQD,EAAE,EAA0B,YAAhB,OAAOG,QAAqBA,OAAOC,IAAKD,OAAO,GAAGH,CAAC,GAAgC,aAAhB,OAAOK,OAAwBA,OAA+B,aAAhB,OAAOC,OAAwBA,OAA6B,aAAd,OAAOC,MAA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?xϨ100644 definition_schema.js Flkȗj40000 dot &+>籊דW40000 dotjs brt{(rY100644 keyword.js ښ-Ykk,'b40000 refs +~K֭eF
J&x4declare var ajv: {
  (options?: ajv.Options): ajv.Ajv;
  new(options?: ajv.Options): ajv.Ajv;
  ValidationError: typeof AjvErrors.ValidationError;
  MissingRefError: typeof AjvErrors.MissingRefError;
  $dataMetaSchema: object;
}

declare namespace AjvErrors {
  class ValidationError extends Error {
    constructor(errors: Array<ajv.ErrorObject>);

    message: string;
    errors: Array<ajv.ErrorObject>;
    ajv: true;
    validation: true;
  }

  class MissingRefError extends Error {
    constructor(baseId: string, ref: string, message?: string);
    static message: (baseId: string, ref: string) => string;

    message: string;
    missingRef: string;
    missingSchema: string;
  }
}

declare namespace ajv {
  type ValidationError = AjvErrors.ValidationError;

  type MissingRefError = AjvErrors.MissingRefError;

  interface Ajv {
    /**
    * Validate data using schema
    * Schema will be compiled and cached (using serialized JSON as key, [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize by default).
    * @param  {string|object|Boolean} schemaKeyRef key, ref or schema object
    * @param  {Any} data to be validated
    * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`).
    */
    validate(schemaKeyRef: object | string | boolean, data: any): boolean | PromiseLike<any>;
    /**
    * Create validating function for passed schema.
    * @param  {object|Boolean} schema schema object
    * @return {Function} validating function
    */
    compile(schema: object | boolean): ValidateFunction;
    /**
    * Creates validating function for passed schema with asynchronous loading of missing schemas.
    * `loadSchema` option should be a function that accepts schema uri and node-style callback.
    * @this  Ajv
    * @param {object|Boolean} schema schema object
    * @param {Boolean} meta optional true to compile meta-schema; this parameter can be skipped
    * @param {Function} callback optional node-style callback, it is always called with 2 parameters: error (or null) and validating function.
    * @return {PromiseLike<ValidateFunction>} validating function
    */
    compileAsync(schema: object | boolean, meta?: Boolean, callback?: (err: Error, validate: ValidateFunction) => any): PromiseLike<ValidateFunction>;
    /**
    * Adds schema to the instance.
    * @param {object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored.
    * @param {string} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.
    * @return {Ajv} this for method chaining
    */
    addSchema(schema: Array<object> | object, key?: string): Ajv;
    /**
    * Add schema that will be used to validate other schemas
    * options in META_IGNORE_OPTIONS are alway set to false
    * @param {object} schema schema object
    * @param {string} key optional schema key
    * @return {Ajv} this for method chaining
    */
    addMetaSchema(schema: object, key?: string): Ajv;
    /**
    * Validate schema
    * @param {object|Boolean} schema schema to validate
    * @return {Boolean} true if schema is valid
    */
    validateSchema(schema: object | boolean): boolean;
    /**
    * Get compiled schema from the instance by `key` or `ref`.
    * @param  {string} keyRef `key` that was passed to `addSchema` or full schema reference (`schema.id` or resolved id).
    * @return {Function} schema validating function (with property `schema`). Returns undefined if keyRef can't be resolved to an existing schema.
    */
    getSchema(keyRef: string): ValidateFunction | undefined;
    /**
    * Remove cached schema(s).
    * If no parameter is passed all schemas but meta-schemas are removed.
    * If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
    * Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
    * @param  {string|object|RegExp|Boolean} schemaKeyRef key, ref, pattern to match key/ref or schema object
    * @return {Ajv} this for method chaining
    */
    removeSchema(schemaKeyRef?: object | string | RegExp | boolean): Ajv;
    /**
    * Add custom format
    * @param {string} name format name
    * @param {string|RegExp|Function} format string is converted to RegExp; function should return boolean (true when valid)
    * @return {Ajv} this for method chaining
    */
    addFormat(name: string, format: FormatValidator | FormatDefinition): Ajv;
    /**
    * Define custom keyword
    * @this  Ajv
    * @param {string} keyword custom keyword, should be a valid identifier, should be different from all standard, custom and macro keywords.
    * @param {object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`.
    * @return {Ajv} this for method chaining
    */
    addKeyword(keyword: string, definition: KeywordDefinition): Ajv;
    /**
    * Get keyword definition
    * @this  Ajv
    * @param {string} keyword pre-defined or custom keyword.
    * @return {object|Boolean} custom keyword definition, `true` if it is a predefined keyword, `false` otherwise.
    */
    getKeyword(keyword: string): object | boolean;
    /**
    * Remove keyword
    * @this  Ajv
    * @param {string} keyword pre-defined or custom keyword.
    * @return {Ajv} this for method chaining
    */
    removeKeyword(keyword: string): Ajv;
    /**
    * Validate keyword
    * @this  Ajv
    * @param {object} definition keyword definition object
    * @param {boolean} throwError true to throw exception if definition is invalid
    * @return {boolean} validation result
    */
    validateKeyword(definition: KeywordDefinition, throwError: boolean): boolean;
    /**
    * Convert array of error message objects to string
    * @param  {Array<object>} errors optional array of validation errors, if not passed errors from the instance are used.
    * @param  {object} options optional options with properties `separator` and `dataVar`.
    * @return {string} human readable string with all errors descriptions
    */
    errorsText(errors?: Array<ErrorObject> | null, options?: ErrorsTextOptions): string;
    errors?: Array<ErrorObject> | null;
    _opts: Options;
  }

  interface CustomLogger {
    log(...args: any[]): any;
    warn(...args: any[]): any;
    error(...args: any[]): any;
  }

  interface ValidateFunction {
    (
      data: any,
      dataPath?: string,
      parentData?: object | Array<any>,
      parentDataProperty?: string | number,
      rootData?: object | Array<any>
    ): boolean | PromiseLike<any>;
    schema?: object | boolean;
    errors?: null | Array<ErrorObject>;
    refs?: object;
    refVal?: Array<any>;
    root?: ValidateFunction | object;
    $async?: true;
    source?: object;
  }

  interface Options {
    $data?: boolean;
    allErrors?: boolean;
    verbose?: boolean;
    jsonPointers?: boolean;
    uniqueItems?: boolean;
    unicode?: boolean;
    format?: false | string;
    formats?: object;
    keywords?: object;
    unknownFormats?: true | string[] | 'ignore';
    schemas?: Array<object> | object;
    schemaId?: '$id' | 'id' | 'auto';
    missingRefs?: true | 'ignore' | 'fail';
    extendRefs?: true | 'ignore' | 'fail';
    loadSchema?: (uri: string, cb?: (err: Error, schema: object) => void) => PromiseLike<object | boolean>;
    removeAdditional?: boolean | 'all' | 'failing';
    useDefaults?: boolean | 'empty' | 'shared';
    coerceTypes?: boolean | 'array';
    strictDefaults?: boolean | 'log';
    strictKeywords?: boolean | 'log';
    strictNumbers?: boolean;
    async?: boolean | string;
    transpile?: string | ((code: string) => string);
    meta?: boolean | object;
    validateSchema?: boolean | 'log';
    addUsedSchema?: boolean;
    inlineRefs?: boolean | number;
    passContext?: boolean;
    loopRequired?: number;
    ownProperties?: boolean;
    multipleOfPrecision?: boolean | number;
    errorDataPath?: string,
    messages?: boolean;
    sourceCode?: boolean;
    processCode?: (code: string, schema: object) => string;
    cache?: object;
    logger?: CustomLogger | false;
    nullable?: boolean;
    serialize?: ((schema: object | boolean) => any) | false;
    regExp?: (pattern: string) => RegExpLike;
  }

  interface RegExpLike {
    test: (s: string) => boolean;
  }

  type FormatValidator = string | RegExp | ((data: string) => boolean | PromiseLike<any>);
  type NumberFormatValidator = ((data: number) => boolean | PromiseLike<any>);

  interface NumberFormatDefinition {
    type: "number",
    validate: NumberFormatValidator;
    compare?: (data1: number, data2: number) => number;
    async?: boolean;
  }

  interface StringFormatDefinition {
    type?: "string",
    validate: FormatValidator;
    compare?: (data1: string, data2: string) => number;
    async?: boolean;
  }

  type FormatDefinition = NumberFormatDefinition | StringFormatDefinition;

  interface KeywordDefinition {
    type?: string | Array<string>;
    async?: boolean;
    $data?: boolean;
    errors?: boolean | string;
    metaSchema?: object;
    // schema: false makes validate not to expect schema (ValidateFunction)
    schema?: boolean;
    statements?: boolean;
    dependencies?: Array<string>;
    modifying?: boolean;
    valid?: boolean;
    // one and only one of the following properties should be present
    validate?: SchemaValidateFunction | ValidateFunction;
    compile?: (schema: any, parentSchema: object, it: CompilationContext) => ValidateFunction;
    macro?: (schema: any, parentSchema: object, it: CompilationContext) => object | boolean;
    inline?: (it: CompilationContext, keyword: string, schema: any, parentSchema: object) => string;
  }

  interface CompilationContext {
    level: number;
    dataLevel: number;
    dataPathArr: string[];
    schema: any;
    schemaPath: string;
    baseId: string;
    async: boolean;
    opts: Options;
    formats: {
      [index: string]: FormatDefinition | undefined;
    };
    keywords: {
      [index: string]: KeywordDefinition | undefined;
    };
    compositeRule: boolean;
    validate: (schema: object) => boolean;
    util: {
      copy(obj: any, target?: any): any;
      toHash(source: string[]): { [index: string]: true | undefined };
      equal(obj: any, target: any): boolean;
      getProperty(str: string): string;
      schemaHasRules(schema: object, rules: any): string;
      escapeQuotes(str: string): string;
      toQuotedString(str: string): string;
      getData(jsonPointer: string, dataLevel: number, paths: string[]): string;
      escapeJsonPointer(str: string): string;
      unescapeJsonPointer(str: string): string;
      escapeFragment(str: string): string;
      unescapeFragment(str: string): string;
    };
    self: Ajv;
  }

  interface SchemaValidateFunction {
    (
      schema: any,
      data: any,
      parentSchema?: object,
      dataPath?: string,
      parentData?: object | Array<any>,
      parentDataProperty?: string | number,
      rootData?: object | Array<any>
    ): boolean | PromiseLike<any>;
    errors?: Array<ErrorObject>;
  }

  interface ErrorsTextOptions {
    separator?: string;
    dataVar?: string;
  }

  interface ErrorObject {
    keyword: string;
    dataPath: string;
    schemaPath: string;
    params: ErrorParameters;
    // Added to validation errors of propertyNames keyword schema
    propertyName?: string;
    // Excluded if messages set to false.
    message?: string;
    // These are added with the `verbose` option.
    schema?: any;
    parentSchema?: object;
    data?: any;
  }

  type ErrorParameters = RefParams | LimitParams | AdditionalPropertiesParams |
    DependenciesParams | FormatParams | ComparisonParams |
    MultipleOfParams | PatternParams | RequiredParams |
    TypeParams | UniqueItemsParams | CustomParams |
    PatternRequiredParams | PropertyNamesParams |
    IfParams | SwitchParams | NoParams | EnumParams;

  interface RefParams {
    ref: string;
  }

  interface LimitParams {
    limit: number;
  }

  interface AdditionalPropertiesParams {
    additionalProperty: string;
  }

  interface DependenciesParams {
    property: string;
    missingProperty: string;
    depsCount: number;
    deps: string;
  }

  interface FormatParams {
    format: string
  }

  interface ComparisonParams {
    comparison: string;
    limit: number | string;
    exclusive: boolean;
  }

  interface MultipleOfParams {
    multipleOf: number;
  }

  interface PatternParams {
    pattern: string;
  }

  interface RequiredParams {
    missingProperty: string;
  }

  interface TypeParams {
    type: string;
  }

  interface UniqueItemsParams {
    i: number;
    j: number;
  }

  interface CustomParams {
    keyword: string;
  }

  interface PatternRequiredParams {
    missingPattern: string;
  }

  interface PropertyNamesParams {
    propertyName: string;
  }

  interface IfParams {
    failingKeyword: string;
  }

  interface SwitchParams {
    caseIndex: number;
  }

  interface NoParams { }

  interface EnumParams {
    allowedValues: Array<any>;
  }
}

export = ajv;
@Bwx="'use strict';

var compileSchema = require('./compile')
  , resolve = require('./compile/resolve')
  , Cache = require('./cache')
  , SchemaObject = require('./compile/schema_obj')
  , stableStringify = require('fast-json-stable-stringify')
  , formats = require('./compile/formats')
  , rules = require('./compile/rules')
  , $dataMetaSchema = require('./data')
  , util = require('./compile/util');

module.exports = Ajv;

Ajv.prototype.validate = validate;
Ajv.prototype.compile = compile;
Ajv.prototype.addSchema = addSchema;
Ajv.prototype.addMetaSchema = addMetaSchema;
Ajv.prototype.validateSchema = validateSchema;
Ajv.prototype.getSchema = getSchema;
Ajv.prototype.removeSchema = removeSchema;
Ajv.prototype.addFormat = addFormat;
Ajv.prototype.errorsText = errorsText;

Ajv.prototype._addSchema = _addSchema;
Ajv.prototype._compile = _compile;

Ajv.prototype.compileAsync = require('./compile/async');
var customKeyword = require('./keyword');
Ajv.prototype.addKeyword = customKeyword.add;
Ajv.prototype.getKeyword = customKeyword.get;
Ajv.prototype.removeKeyword = customKeyword.remove;
Ajv.prototype.validateKeyword = customKeyword.validate;

var errorClasses = require('./compile/error_classes');
Ajv.ValidationError = errorClasses.Validation;
Ajv.MissingRefError = errorClasses.MissingRef;
Ajv.$dataMetaSchema = $dataMetaSchema;

var META_SCHEMA_ID = 'http://json-schema.org/draft-07/schema';

var META_IGNORE_OPTIONS = [ 'removeAdditional', 'useDefaults', 'coerceTypes', 'strictDefaults' ];
var META_SUPPORT_DATA = ['/properties'];

/**
 * Creates validator instance.
 * Usage: `Ajv(opts)`
 * @param {Object} opts optional options
 * @return {Object} ajv instance
 */
function Ajv(opts) {
  if (!(this instanceof Ajv)) return new Ajv(opts);
  opts = this._opts = util.copy(opts) || {};
  setLogger(this);
  this._schemas = {};
  this._refs = {};
  this._fragments = {};
  this._formats = formats(opts.format);

  this._cache = opts.cache || new Cache;
  this._loadingSchemas = {};
  this._compilations = [];
  this.RULES = rules();
  this._getId = chooseGetId(opts);

  opts.loopRequired = opts.loopRequired || Infinity;
  if (opts.errorDataPath == 'property') opts._errorDataPathProperty = true;
  if (opts.serialize === undefined) opts.serialize = stableStringify;
  this._metaOpts = getMetaSchemaOptions(this);

  if (opts.formats) addInitialFormats(this);
  if (opts.keywords) addInitialKeywords(this);
  addDefaultMetaSchema(this);
  if (typeof opts.meta == 'object') this.addMetaSchema(opts.meta);
  if (opts.nullable) this.addKeyword('nullable', {metaSchema: {type: 'boolean'}});
  addInitialSchemas(this);
}



/**
 * Validate data using schema
 * Schema will be compiled and cached (using serialized JSON as key. [fast-json-stable-stringify](https://github.com/epoberezkin/fast-json-stable-stringify) is used to serialize.
 * @this   Ajv
 * @param  {String|Object} schemaKeyRef key, ref or schema object
 * @param  {Any} data to be validated
 * @return {Boolean} validation result. Errors from the last validation will be available in `ajv.errors` (and also in compiled schema: `schema.errors`).
 */
function validate(schemaKeyRef, data) {
  var v;
  if (typeof schemaKeyRef == 'string') {
    v = this.getSchema(schemaKeyRef);
    if (!v) throw new Error('no schema with key or ref "' + schemaKeyRef + '"');
  } else {
    var schemaObj = this._addSchema(schemaKeyRef);
    v = schemaObj.validate || this._compile(schemaObj);
  }

  var valid = v(data);
  if (v.$async !== true) this.errors = v.errors;
  return valid;
}


/**
 * Create validating function for passed schema.
 * @this   Ajv
 * @param  {Object} schema schema object
 * @param  {Boolean} _meta true if schema is a meta-schema. Used internally to compile meta schemas of custom keywords.
 * @return {Function} validating function
 */
function compile(schema, _meta) {
  var schemaObj = this._addSchema(schema, undefined, _meta);
  return schemaObj.validate || this._compile(schemaObj);
}


/**
 * Adds schema to the instance.
 * @this   Ajv
 * @param {Object|Array} schema schema or array of schemas. If array is passed, `key` and other parameters will be ignored.
 * @param {String} key Optional schema key. Can be passed to `validate` method instead of schema object or id/ref. One schema per instance can have empty `id` and `key`.
 * @param {Boolean} _skipValidation true to skip schema validation. Used internally, option validateSchema should be used instead.
 * @param {Boolean} _meta true if schema is a meta-schema. Used internally, addMetaSchema should be used instead.
 * @return {Ajv} this for method chaining
 */
function addSchema(schema, key, _skipValidation, _meta) {
  if (Array.isArray(schema)){
    for (var i=0; i<schema.length; i++) this.addSchema(schema[i], undefined, _skipValidation, _meta);
    return this;
  }
  var id = this._getId(schema);
  if (id !== undefined && typeof id != 'string')
    throw new Error('schema id must be string');
  key = resolve.normalizeId(key || id);
  checkUnique(this, key);
  this._schemas[key] = this._addSchema(schema, _skipValidation, _meta, true);
  return this;
}


/**
 * Add schema that will be used to validate other schemas
 * options in META_IGNORE_OPTIONS are alway set to false
 * @this   Ajv
 * @param {Object} schema schema object
 * @param {String} key optional schema key
 * @param {Boolean} skipValidation true to skip schema validation, can be used to override validateSchema option for meta-schema
 * @return {Ajv} this for method chaining
 */
function addMetaSchema(schema, key, skipValidation) {
  this.addSchema(schema, key, skipValidation, true);
  return this;
}


/**
 * Validate schema
 * @this   Ajv
 * @param {Object} schema schema to validate
 * @param {Boolean} throwOrLogError pass true to throw (or log) an error if invalid
 * @return {Boolean} true if schema is valid
 */
function validateSchema(schema, throwOrLogError) {
  var $schema = schema.$schema;
  if ($schema !== undefined && typeof $schema != 'string')
    throw new Error('$schema must be a string');
  $schema = $schema || this._opts.defaultMeta || defaultMeta(this);
  if (!$schema) {
    this.logger.warn('meta-schema not available');
    this.errors = null;
    return true;
  }
  var valid = this.validate($schema, schema);
  if (!valid && throwOrLogError) {
    var message = 'schema is invalid: ' + this.errorsText();
    if (this._opts.validateSchema == 'log') this.logger.error(message);
    else throw new Error(message);
  }
  return valid;
}


function defaultMeta(self) {
  var meta = self._opts.meta;
  self._opts.defaultMeta = typeof meta == 'object'
                            ? self._getId(meta) || meta
                            : self.getSchema(META_SCHEMA_ID)
                              ? META_SCHEMA_ID
                              : undefined;
  return self._opts.defaultMeta;
}


/**
 * Get compiled schema from the instance by `key` or `ref`.
 * @this   Ajv
 * @param  {String} keyRef `key` that was passed to `addSchema` or full schema reference (`schema.id` or resolved id).
 * @return {Function} schema validating function (with property `schema`).
 */
function getSchema(keyRef) {
  var schemaObj = _getSchemaObj(this, keyRef);
  switch (typeof schemaObj) {
    case 'object': return schemaObj.validate || this._compile(schemaObj);
    case 'string': return this.getSchema(schemaObj);
    case 'undefined': return _getSchemaFragment(this, keyRef);
  }
}


function _getSchemaFragment(self, ref) {
  var res = resolve.schema.call(self, { schema: {} }, ref);
  if (res) {
    var schema = res.schema
      , root = res.root
      , baseId = res.baseId;
    var v = compileSchema.call(self, schema, root, undefined, baseId);
    self._fragments[ref] = new SchemaObject({
      ref: ref,
      fragment: true,
      schema: schema,
      root: root,
      baseId: baseId,
      validate: v
    });
    return v;
  }
}


function _getSchemaObj(self, keyRef) {
  keyRef = resolve.normalizeId(keyRef);
  return self._schemas[keyRef] || self._refs[keyRef] || self._fragments[keyRef];
}


/**
 * Remove cached schema(s).
 * If no parameter is passed all schemas but meta-schemas are removed.
 * If RegExp is passed all schemas with key/id matching pattern but meta-schemas are removed.
 * Even if schema is referenced by other schemas it still can be removed as other schemas have local references.
 * @this   Ajv
 * @param  {String|Object|RegExp} schemaKeyRef key, ref, pattern to match key/ref or schema object
 * @return {Ajv} this for method chaining
 */
function removeSchema(schemaKeyRef) {
  if (schemaKeyRef instanceof RegExp) {
    _removeAllSchemas(this, this._schemas, schemaKeyRef);
    _removeAllSchemas(this, this._refs, schemaKeyRef);
    return this;
  }
  switch (typeof schemaKeyRef) {
    case 'undefined':
      _removeAllSchemas(this, this._schemas);
      _removeAllSchemas(this, this._refs);
      this._cache.clear();
      return this;
    case 'string':
      var schemaObj = _getSchemaObj(this, schemaKeyRef);
      if (schemaObj) this._cache.del(schemaObj.cacheKey);
      delete this._schemas[schemaKeyRef];
      delete this._refs[schemaKeyRef];
      return this;
    case 'object':
      var serialize = this._opts.serialize;
      var cacheKey = serialize ? serialize(schemaKeyRef) : schemaKeyRef;
      this._cache.del(cacheKey);
      var id = this._getId(schemaKeyRef);
      if (id) {
        id = resolve.normalizeId(id);
        delete this._schemas[id];
        delete this._refs[id];
      }
  }
  return this;
}


function _removeAllSchemas(self, schemas, regex) {
  for (var keyRef in schemas) {
    var schemaObj = schemas[keyRef];
    if (!schemaObj.meta && (!regex || regex.test(keyRef))) {
      self._cache.del(schemaObj.cacheKey);
      delete schemas[keyRef];
    }
  }
}


/* @this   Ajv */
function _addSchema(schema, skipValidation, meta, shouldAddSchema) {
  if (typeof schema != 'object' && typeof schema != 'boolean')
    throw new Error('schema should be object or boolean');
  var serialize = this._opts.serialize;
  var cacheKey = serialize ? serialize(schema) : schema;
  var cached = this._cache.get(cacheKey);
  if (cached) return cached;

  shouldAddSchema = shouldAddSchema || this._opts.addUsedSchema !== false;

  var id = resolve.normalizeId(this._getId(schema));
  if (id && shouldAddSchema) checkUnique(this, id);

  var willValidate = this._opts.validateSchema !== false && !skipValidation;
  var recursiveMeta;
  if (willValidate && !(recursiveMeta = id && id == resolve.normalizeId(schema.$schema)))
    this.validateSchema(schema, true);

  var localRefs = resolve.ids.call(this, schema);

  var schemaObj = new SchemaObject({
    id: id,
    schema: schema,
    localRefs: localRefs,
    cacheKey: cacheKey,
    meta: meta
  });

  if (id[0] != '#' && shouldAddSchema) this._refs[id] = schemaObj;
  this._cache.put(cacheKey, schemaObj);

  if (willValidate && recursiveMeta) this.validateSchema(schema, true);

  return schemaObj;
}


/* @this   Ajv */
function _compile(schemaObj, root) {
  if (schemaObj.compiling) {
    schemaObj.validate = callValidate;
    callValidate.schema = schemaObj.schema;
    callValidate.errors = null;
    callValidate.root = root ? root : callValidate;
    if (schemaObj.schema.$async === true)
      callValidate.$async = true;
    return callValidate;
  }
  schemaObj.compiling = true;

  var currentOpts;
  if (schemaObj.meta) {
    currentOpts = this._opts;
    this._opts = this._metaOpts;
  }

  var v;
  try { v = compileSchema.call(this, schemaObj.schema, root, schemaObj.localRefs); }
  catch(e) {
    delete schemaObj.validate;
    throw e;
  }
  finally {
    schemaObj.compiling = false;
    if (schemaObj.meta) this._opts = currentOpts;
  }

  schemaObj.validate = v;
  schemaObj.refs = v.refs;
  schemaObj.refVal = v.refVal;
  schemaObj.root = v.root;
  return v;


  /* @this   {*} - custom context, see passContext option */
  function callValidate() {
    /* jshint validthis: true */
    var _validate = schemaObj.validate;
    var result = _validate.apply(this, arguments);
    callValidate.errors = _validate.errors;
    return result;
  }
}


function chooseGetId(opts) {
  switch (opts.schemaId) {
    case 'auto': return _get$IdOrId;
    case 'id': return _getId;
    default: return _get$Id;
  }
}

/* @this   Ajv */
function _getId(schema) {
  if (schema.$id) this.logger.warn('schema $id ignored', schema.$id);
  return schema.id;
}

/* @this   Ajv */
function _get$Id(schema) {
  if (schema.id) this.logger.warn('schema id ignored', schema.id);
  return schema.$id;
}


function _get$IdOrId(schema) {
  if (schema.$id && schema.id && schema.$id != schema.id)
    throw new Error('schema $id is different from id');
  return schema.$id || schema.id;
}


/**
 * Convert array of error message objects to string
 * @this   Ajv
 * @param  {Array<Object>} errors optional array of validation errors, if not passed errors from the instance are used.
 * @param  {Object} options optional options with properties `separator` and `dataVar`.
 * @return {String} human readable string with all errors descriptions
 */
function errorsText(errors, options) {
  errors = errors || this.errors;
  if (!errors) return 'No errors';
  options = options || {};
  var separator = options.separator === undefined ? ', ' : options.separator;
  var dataVar = options.dataVar === undefined ? 'data' : options.dataVar;

  var text = '';
  for (var i=0; i<errors.length; i++) {
    var e = errors[i];
    if (e) text += dataVar + e.dataPath + ' ' + e.message + separator;
  }
  return text.slice(0, -separator.length);
}


/**
 * Add custom format
 * @this   Ajv
 * @param {String} name format name
 * @param {String|RegExp|Function} format string is converted to RegExp; function should return boolean (true when valid)
 * @return {Ajv} this for method chaining
 */
function addFormat(name, format) {
  if (typeof format == 'string') format = new RegExp(format);
  this._formats[name] = format;
  return this;
}


function addDefaultMetaSchema(self) {
  var $dataSchema;
  if (self._opts.$data) {
    $dataSchema = require('./refs/data.json');
    self.addMetaSchema($dataSchema, $dataSchema.$id, true);
  }
  if (self._opts.meta === false) return;
  var metaSchema = require('./refs/json-schema-draft-07.json');
  if (self._opts.$data) metaSchema = $dataMetaSchema(metaSchema, META_SUPPORT_DATA);
  self.addMetaSchema(metaSchema, META_SCHEMA_ID, true);
  self._refs['http://json-schema.org/schema'] = META_SCHEMA_ID;
}


function addInitialSchemas(self) {
  var optsSchemas = self._opts.schemas;
  if (!optsSchemas) return;
  if (Array.isArray(optsSchemas)) self.addSchema(optsSchemas);
  else for (var key in optsSchemas) self.addSchema(optsSchemas[key], key);
}


function addInitialFormats(self) {
  for (var name in self._opts.formats) {
    var format = self._opts.formats[name];
    self.addFormat(name, format);
  }
}


function addInitialKeywords(self) {
  for (var name in self._opts.keywords) {
    var keyword = self._opts.keywords[name];
    self.addKeyword(name, keyword);
  }
}


function checkUnique(self, id) {
  if (self._schemas[id] || self._refs[id])
    throw new Error('schema with key or id "' + id + '" already exists');
}


function getMetaSchemaOptions(self) {
  var metaOpts = util.copy(self._opts);
  for (var i=0; i<META_IGNORE_OPTIONS.length; i++)
    delete metaOpts[META_IGNORE_OPTIONS[i]];
  return metaOpts;
}


function setLogger(self) {
  var logger = self._opts.logger;
  if (logger === false) {
    self.logger = {log: noop, warn: noop, error: noop};
  } else {
    if (logger === undefined) logger = console;
    if (!(typeof logger == 'object' && logger.log && logger.warn && logger.error))
      throw new Error('logger must implement log, warn and error methods');
    self.logger = logger;
  }
}


function noop() {}
D/xf'use strict';


var Cache = module.exports = function Cache() {
  this._cache = {};
};


Cache.prototype.put = function Cache_put(key, value) {
  this._cache[key] = value;
};


Cache.prototype.get = function Cache_get(key) {
  return this._cache[key];
};


Cache.prototype.del = function Cache_del(key) {
  delete this._cache[key];
};


Cache.prototype.clear = function Cache_clear() {
  this._cache = {};
};
uޭx}100644 async.js j0+bt"]Qm100644 equal.js ¬AI![F100644 error_classes.js ㏧^k}y3=/p100644 formats.js sFwO}gC100644 index.js 24יY+x9<100644 resolve.js f鶦Css<100644 rules.js Z/r'dmk100644 schema_obj.js ;F1Uk'b|
)B100644 ucs2length.js ѓ ?G100644 util.js W#yQst[tB?xT
'use strict';

var MissingRefError = require('./error_classes').MissingRef;

module.exports = compileAsync;


/**
 * Creates validating function for passed schema with asynchronous loading of missing schemas.
 * `loadSchema` option should be a function that accepts schema uri and returns promise that resolves with the schema.
 * @this  Ajv
 * @param {Object}   schema schema object
 * @param {Boolean}  meta optional true to compile meta-schema; this parameter can be skipped
 * @param {Function} callback an optional node-style callback, it is called with 2 parameters: error (or null) and validating function.
 * @return {Promise} promise that resolves with a validating function.
 */
function compileAsync(schema, meta, callback) {
  /* eslint no-shadow: 0 */
  /* global Promise */
  /* jshint validthis: true */
  var self = this;
  if (typeof this._opts.loadSchema != 'function')
    throw new Error('options.loadSchema should be a function');

  if (typeof meta == 'function') {
    callback = meta;
    meta = undefined;
  }

  var p = loadMetaSchemaOf(schema).then(function () {
    var schemaObj = self._addSchema(schema, undefined, meta);
    return schemaObj.validate || _compileAsync(schemaObj);
  });

  if (callback) {
    p.then(
      function(v) { callback(null, v); },
      callback
    );
  }

  return p;


  function loadMetaSchemaOf(sch) {
    var $schema = sch.$schema;
    return $schema && !self.getSchema($schema)
            ? compileAsync.call(self, { $ref: $schema }, true)
            : Promise.resolve();
  }


  function _compileAsync(schemaObj) {
    try { return self._compile(schemaObj); }
    catch(e) {
      if (e instanceof MissingRefError) return loadMissingSchema(e);
      throw e;
    }


    function loadMissingSchema(e) {
      var ref = e.missingSchema;
      if (added(ref)) throw new Error('Schema ' + ref + ' is loaded but ' + e.missingRef + ' cannot be resolved');

      var schemaPromise = self._loadingSchemas[ref];
      if (!schemaPromise) {
        schemaPromise = self._loadingSchemas[ref] = self._opts.loadSchema(ref);
        schemaPromise.then(removePromise, removePromise);
      }

      return schemaPromise.then(function (sch) {
        if (!added(ref)) {
          return loadMetaSchemaOf(sch).then(function () {
            if (!added(ref)) self.addSchema(sch, ref, undefined, meta);
          });
        }
      }).then(function() {
        return _compileAsync(schemaObj);
      });

      function removePromise() {
        delete self._loadingSchemas[ref];
      }

      function added(ref) {
        return self._refs[ref] || self._schemas[ref];
      }
    }
  }
}
YNx O'use strict';

// do NOT remove this file - it would break pre-compiled schemas
// https://github.com/ajv-validator/ajv/issues/889
module.exports = require('fast-deep-equal');
7<3x<'use strict';

var resolve = require('./resolve');

module.exports = {
  Validation: errorSubclass(ValidationError),
  MissingRef: errorSubclass(MissingRefError)
};


function ValidationError(errors) {
  this.message = 'validation failed';
  this.errors = errors;
  this.ajv = this.validation = true;
}


MissingRefError.message = function (baseId, ref) {
  return 'can\'t resolve reference ' + ref + ' from id ' + baseId;
};


function MissingRefError(baseId, ref, message) {
  this.message = message || MissingRefError.message(baseId, ref);
  this.missingRef = resolve.url(baseId, ref);
  this.missingSchema = resolve.normalizeId(resolve.fullPath(this.missingRef));
}


function errorSubclass(Subclass) {
  Subclass.prototype = Object.create(Error.prototype);
  Subclass.prototype.constructor = Subclass;
  return Subclass;
}
GLxF/'use strict';

var util = require('./util');

var DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
var DAYS = [0,31,28,31,30,31,30,31,31,30,31,30,31];
var TIME = /^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;
var HOSTNAME = /^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i;
var URI = /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-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-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i;
// For the source: https://gist.github.com/dperini/729294
// For test cases: https://mathiasbynens.be/demo/url-regex
// @todo Delete current URL in favour of the commented out URL rule when this issue is fixed https://github.com/eslint/eslint/issues/7983.
// var URL = /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu;
var URL = /^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i;
var UUID = /^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i;
var JSON_POINTER = /^(?:\/(?:[^~/]|~0|~1)*)*$/;
var JSON_POINTER_URI_FRAGMENT = /^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i;
var RELATIVE_JSON_POINTER = /^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;


module.exports = formats;

function formats(mode) {
  mode = mode == 'full' ? 'full' : 'fast';
  return util.copy(formats[mode], Object.create(null));
}


formats.fast = {
  // date: http://tools.ietf.org/html/rfc3339#section-5.6
  date: /^\d\d\d\d-[0-1]\d-[0-3]\d$/,
  // date-time: http://tools.ietf.org/html/rfc3339#section-5.6
  time: /^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,
  'date-time': /^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,
  // uri: https://github.com/mafintosh/is-my-json-valid/blob/master/formats.js
  uri: /^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,
  'uri-reference': /^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,
  'uri-template': URITEMPLATE,
  url: URL,
  // email (sources from jsen validator):
  // http://stackoverflow.com/questions/201323/using-a-regular-expression-to-validate-an-email-address#answer-8829363
  // http://www.w3.org/TR/html5/forms.html#valid-e-mail-address (search for 'willful violation')
  email: /^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,
  hostname: HOSTNAME,
  // optimized https://www.safaribooksonline.com/library/view/regular-expressions-cookbook/9780596802837/ch07s16.html
  ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
  // optimized http://stackoverflow.com/questions/53497/regular-expression-that-matches-valid-ipv6-addresses
  ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,
  regex: regex,
  // uuid: http://tools.ietf.org/html/rfc4122
  uuid: UUID,
  // JSON-pointer: https://tools.ietf.org/html/rfc6901
  // uri fragment: https://tools.ietf.org/html/rfc3986#appendix-A
  'json-pointer': JSON_POINTER,
  'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT,
  // relative JSON-pointer: http://tools.ietf.org/html/draft-luff-relative-json-pointer-00
  'relative-json-pointer': RELATIVE_JSON_POINTER
};


formats.full = {
  date: date,
  time: time,
  'date-time': date_time,
  uri: uri,
  'uri-reference': URIREF,
  'uri-template': URITEMPLATE,
  url: URL,
  email: /^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,
  hostname: HOSTNAME,
  ipv4: /^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,
  ipv6: /^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1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uid: UUID,
  'json-pointer': JSON_POINTER,
  'json-pointer-uri-fragment': JSON_POINTER_URI_FRAGMENT,
  'relative-json-pointer': RELATIVE_JSON_POINTER
};


function isLeapYear(year) {
  // https://tools.ietf.org/html/rfc3339#appendix-C
  return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
}


function date(str) {
  // full-date from http://tools.ietf.org/html/rfc3339#section-5.6
  var matches = str.match(DATE);
  if (!matches) return false;

  var year = +matches[1];
  var month = +matches[2];
  var day = +matches[3];

  return month >= 1 && month <= 12 && day >= 1 &&
          day <= (month == 2 && isLeapYear(year) ? 29 : DAYS[month]);
}


function time(str, full) {
  var matches = str.match(TIME);
  if (!matches) return false;

  var hour = matches[1];
  var minute = matches[2];
  var second = matches[3];
  var timeZone = matches[5];
  return ((hour <= 23 && minute <= 59 && second <= 59) ||
          (hour == 23 && minute == 59 && second == 60)) &&
         (!full || timeZone);
}


var DATE_TIME_SEPARATOR = /t|\s/i;
function date_time(str) {
  // http://tools.ietf.org/html/rfc3339#section-5.6
  var dateTime = str.split(DATE_TIME_SEPARATOR);
  return dateTime.length == 2 && date(dateTime[0]) && time(dateTime[1], true);
}


var NOT_URI_FRAGMENT = /\/|:/;
function uri(str) {
  // http://jmrware.com/articles/2009/uri_regexp/URI_regex.html + optional protocol + required "."
  return NOT_URI_FRAGMENT.test(str) && URI.test(str);
}


var Z_ANCHOR = /[^\\]\\Z/;
function regex(str) {
  if (Z_ANCHOR.test(str)) return false;
  try {
    new RegExp(str);
    return true;
  } catch(e) {
    return false;
  }
}
'ٷx7*'use strict';

var resolve = require('./resolve')
  , util = require('./util')
  , errorClasses = require('./error_classes')
  , stableStringify = require('fast-json-stable-stringify');

var validateGenerator = require('../dotjs/validate');

/**
 * Functions below are used inside compiled validations function
 */

var ucs2length = util.ucs2length;
var equal = require('fast-deep-equal');

// this error is thrown by async schemas to return validation errors via exception
var ValidationError = errorClasses.Validation;

module.exports = compile;


/**
 * Compiles schema to validation function
 * @this   Ajv
 * @param  {Object} schema schema object
 * @param  {Object} root object with information about the root schema for this schema
 * @param  {Object} localRefs the hash of local references inside the schema (created by resolve.id), used for inline resolution
 * @param  {String} baseId base ID for IDs in the schema
 * @return {Function} validation function
 */
function compile(schema, root, localRefs, baseId) {
  /* jshint validthis: true, evil: true */
  /* eslint no-shadow: 0 */
  var self = this
    , opts = this._opts
    , refVal = [ undefined ]
    , refs = {}
    , patterns = []
    , patternsHash = {}
    , defaults = []
    , defaultsHash = {}
    , customRules = [];

  function patternCode(i, patterns) {
    var regExpCode = opts.regExp ? 'regExp' : 'new RegExp';
    return 'var pattern' + i + ' = ' + regExpCode + '(' + util.toQuotedString(patterns[i]) + ');';
  }

  root = root || { schema: schema, refVal: refVal, refs: refs };

  var c = checkCompiling.call(this, schema, root, baseId);
  var compilation = this._compilations[c.index];
  if (c.compiling) return (compilation.callValidate = callValidate);

  var formats = this._formats;
  var RULES = this.RULES;

  try {
    var v = localCompile(schema, root, localRefs, baseId);
    compilation.validate = v;
    var cv = compilation.callValidate;
    if (cv) {
      cv.schema = v.schema;
      cv.errors = null;
      cv.refs = v.refs;
      cv.refVal = v.refVal;
      cv.root = v.root;
      cv.$async = v.$async;
      if (opts.sourceCode) cv.source = v.source;
    }
    return v;
  } finally {
    endCompiling.call(this, schema, root, baseId);
  }

  /* @this   {*} - custom context, see passContext option */
  function callValidate() {
    /* jshint validthis: true */
    var validate = compilation.validate;
    var result = validate.apply(this, arguments);
    callValidate.errors = validate.errors;
    return result;
  }

  function localCompile(_schema, _root, localRefs, baseId) {
    var isRoot = !_root || (_root && _root.schema == _schema);
    if (_root.schema != root.schema)
      return compile.call(self, _schema, _root, localRefs, baseId);

    var $async = _schema.$async === true;

    var sourceCode = validateGenerator({
      isTop: true,
      schema: _schema,
      isRoot: isRoot,
      baseId: baseId,
      root: _root,
      schemaPath: '',
      errSchemaPath: '#',
      errorPath: '""',
      MissingRefError: errorClasses.MissingRef,
      RULES: RULES,
      validate: validateGenerator,
      util: util,
      resolve: resolve,
      resolveRef: resolveRef,
      usePattern: usePattern,
      useDefault: useDefault,
      useCustomRule: useCustomRule,
      opts: opts,
      formats: formats,
      logger: self.logger,
      self: self
    });

    sourceCode = vars(refVal, refValCode) + vars(patterns, patternCode)
                   + vars(defaults, defaultCode) + vars(customRules, customRuleCode)
                   + sourceCode;

    if (opts.processCode) sourceCode = opts.processCode(sourceCode, _schema);
    // console.log('\n\n\n *** \n', JSON.stringify(sourceCode));
    var validate;
    try {
      var makeValidate = new Function(
        'self',
        'RULES',
        'formats',
        'root',
        'refVal',
        'defaults',
        'customRules',
        'equal',
        'ucs2length',
        'ValidationError',
        'regExp',
        sourceCode
      );

      validate = makeValidate(
        self,
        RULES,
        formats,
        root,
        refVal,
        defaults,
        customRules,
        equal,
        ucs2length,
        ValidationError,
        opts.regExp
      );

      refVal[0] = validate;
    } catch(e) {
      self.logger.error('Error compiling schema, function code:', sourceCode);
      throw e;
    }

    validate.schema = _schema;
    validate.errors = null;
    validate.refs = refs;
    validate.refVal = refVal;
    validate.root = isRoot ? validate : _root;
    if ($async) validate.$async = true;
    if (opts.sourceCode === true) {
      validate.source = {
        code: sourceCode,
        patterns: patterns,
        defaults: defaults
      };
    }

    return validate;
  }

  function resolveRef(baseId, ref, isRoot) {
    ref = resolve.url(baseId, ref);
    var refIndex = refs[ref];
    var _refVal, refCode;
    if (refIndex !== undefined) {
      _refVal = refVal[refIndex];
      refCode = 'refVal[' + refIndex + ']';
      return resolvedRef(_refVal, refCode);
    }
    if (!isRoot && root.refs) {
      var rootRefId = root.refs[ref];
      if (rootRefId !== undefined) {
        _refVal = root.refVal[rootRefId];
        refCode = addLocalRef(ref, _refVal);
        return resolvedRef(_refVal, refCode);
      }
    }

    refCode = addLocalRef(ref);
    var v = resolve.call(self, localCompile, root, ref);
    if (v === undefined) {
      var localSchema = localRefs && localRefs[ref];
      if (localSchema) {
        v = resolve.inlineRef(localSchema, opts.inlineRefs)
            ? localSchema
            : compile.call(self, localSchema, root, localRefs, baseId);
      }
    }

    if (v === undefined) {
      removeLocalRef(ref);
    } else {
      replaceLocalRef(ref, v);
      return resolvedRef(v, refCode);
    }
  }

  function addLocalRef(ref, v) {
    var refId = refVal.length;
    refVal[refId] = v;
    refs[ref] = refId;
    return 'refVal' + refId;
  }

  function removeLocalRef(ref) {
    delete refs[ref];
  }

  function replaceLocalRef(ref, v) {
    var refId = refs[ref];
    refVal[refId] = v;
  }

  function resolvedRef(refVal, code) {
    return typeof refVal == 'object' || typeof refVal == 'boolean'
            ? { code: code, schema: refVal, inline: true }
            : { code: code, $async: refVal && !!refVal.$async };
  }

  function usePattern(regexStr) {
    var index = patternsHash[regexStr];
    if (index === undefined) {
      index = patternsHash[regexStr] = patterns.length;
      patterns[index] = regexStr;
    }
    return 'pattern' + index;
  }

  function useDefault(value) {
    switch (typeof value) {
      case 'boolean':
      case 'number':
        return '' + value;
      case 'string':
        return util.toQuotedString(value);
      case 'object':
        if (value === null) return 'null';
        var valueStr = stableStringify(value);
        var index = defaultsHash[valueStr];
        if (index === undefined) {
          index = defaultsHash[valueStr] = defaults.length;
          defaults[index] = value;
        }
        return 'default' + index;
    }
  }

  function useCustomRule(rule, schema, parentSchema, it) {
    if (self._opts.validateSchema !== false) {
      var deps = rule.definition.dependencies;
      if (deps && !deps.every(function(keyword) {
        return Object.prototype.hasOwnProperty.call(parentSchema, keyword);
      }))
        throw new Error('parent schema must have all required keywords: ' + deps.join(','));

      var validateSchema = rule.definition.validateSchema;
      if (validateSchema) {
        var valid = validateSchema(schema);
        if (!valid) {
          var message = 'keyword schema is invalid: ' + self.errorsText(validateSchema.errors);
          if (self._opts.validateSchema == 'log') self.logger.error(message);
          else throw new Error(message);
        }
      }
    }

    var compile = rule.definition.compile
      , inline = rule.definition.inline
      , macro = rule.definition.macro;

    var validate;
    if (compile) {
      validate = compile.call(self, schema, parentSchema, it);
    } else if (macro) {
      validate = macro.call(self, schema, parentSchema, it);
      if (opts.validateSchema !== false) self.validateSchema(validate, true);
    } else if (inline) {
      validate = inline.call(self, it, rule.keyword, schema, parentSchema);
    } else {
      validate = rule.definition.validate;
      if (!validate) return;
    }

    if (validate === undefined)
      throw new Error('custom keyword "' + rule.keyword + '"failed to compile');

    var index = customRules.length;
    customRules[index] = validate;

    return {
      code: 'customRule' + index,
      validate: validate
    };
  }
}


/**
 * Checks if the schema is currently compiled
 * @this   Ajv
 * @param  {Object} schema schema to compile
 * @param  {Object} root root object
 * @param  {String} baseId base schema ID
 * @return {Object} object with properties "index" (compilation index) and "compiling" (boolean)
 */
function checkCompiling(schema, root, baseId) {
  /* jshint validthis: true */
  var index = compIndex.call(this, schema, root, baseId);
  if (index >= 0) return { index: index, compiling: true };
  index = this._compilations.length;
  this._compilations[index] = {
    schema: schema,
    root: root,
    baseId: baseId
  };
  return { index: index, compiling: false };
}


/**
 * Removes the schema from the currently compiled list
 * @this   Ajv
 * @param  {Object} schema schema to compile
 * @param  {Object} root root object
 * @param  {String} baseId base schema ID
 */
function endCompiling(schema, root, baseId) {
  /* jshint validthis: true */
  var i = compIndex.call(this, schema, root, baseId);
  if (i >= 0) this._compilations.splice(i, 1);
}


/**
 * Index of schema compilation in the currently compiled list
 * @this   Ajv
 * @param  {Object} schema schema to compile
 * @param  {Object} root root object
 * @param  {String} baseId base schema ID
 * @return {Integer} compilation index
 */
function compIndex(schema, root, baseId) {
  /* jshint validthis: true */
  for (var i=0; i<this._compilations.length; i++) {
    var c = this._compilations[i];
    if (c.schema == schema && c.root == root && c.baseId == baseId) return i;
  }
  return -1;
}


function defaultCode(i) {
  return 'var default' + i + ' = defaults[' + i + '];';
}


function refValCode(i, refVal) {
  return refVal[i] === undefined ? '' : 'var refVal' + i + ' = refVal[' + i + '];';
}


function customRuleCode(i) {
  return 'var customRule' + i + ' = customRules[' + i + '];';
}


function vars(arr, statement) {
  if (!arr.length) return '';
  var code = '';
  for (var i=0; i<arr.length; i++)
    code += statement(i, arr);
  return code;
}
'xX'use strict';

var URI = require('uri-js')
  , equal = require('fast-deep-equal')
  , util = require('./util')
  , SchemaObject = require('./schema_obj')
  , traverse = require('json-schema-traverse');

module.exports = resolve;

resolve.normalizeId = normalizeId;
resolve.fullPath = getFullPath;
resolve.url = resolveUrl;
resolve.ids = resolveIds;
resolve.inlineRef = inlineRef;
resolve.schema = resolveSchema;

/**
 * [resolve and compile the references ($ref)]
 * @this   Ajv
 * @param  {Function} compile reference to schema compilation funciton (localCompile)
 * @param  {Object} root object with information about the root schema for the current schema
 * @param  {String} ref reference to resolve
 * @return {Object|Function} schema object (if the schema can be inlined) or validation function
 */
function resolve(compile, root, ref) {
  /* jshint validthis: true */
  var refVal = this._refs[ref];
  if (typeof refVal == 'string') {
    if (this._refs[refVal]) refVal = this._refs[refVal];
    else return resolve.call(this, compile, root, refVal);
  }

  refVal = refVal || this._schemas[ref];
  if (refVal instanceof SchemaObject) {
    return inlineRef(refVal.schema, this._opts.inlineRefs)
            ? refVal.schema
            : refVal.validate || this._compile(refVal);
  }

  var res = resolveSchema.call(this, root, ref);
  var schema, v, baseId;
  if (res) {
    schema = res.schema;
    root = res.root;
    baseId = res.baseId;
  }

  if (schema instanceof SchemaObject) {
    v = schema.validate || compile.call(this, schema.schema, root, undefined, baseId);
  } else if (schema !== undefined) {
    v = inlineRef(schema, this._opts.inlineRefs)
        ? schema
        : compile.call(this, schema, root, undefined, baseId);
  }

  return v;
}


/**
 * Resolve schema, its root and baseId
 * @this Ajv
 * @param  {Object} root root object with properties schema, refVal, refs
 * @param  {String} ref  reference to resolve
 * @return {Object} object with properties schema, root, baseId
 */
function resolveSchema(root, ref) {
  /* jshint validthis: true */
  var p = URI.parse(ref)
    , refPath = _getFullPath(p)
    , baseId = getFullPath(this._getId(root.schema));
  if (Object.keys(root.schema).length === 0 || refPath !== baseId) {
    var id = normalizeId(refPath);
    var refVal = this._refs[id];
    if (typeof refVal == 'string') {
      return resolveRecursive.call(this, root, refVal, p);
    } else if (refVal instanceof SchemaObject) {
      if (!refVal.validate) this._compile(refVal);
      root = refVal;
    } else {
      refVal = this._schemas[id];
      if (refVal instanceof SchemaObject) {
        if (!refVal.validate) this._compile(refVal);
        if (id == normalizeId(ref))
          return { schema: refVal, root: root, baseId: baseId };
        root = refVal;
      } else {
        return;
      }
    }
    if (!root.schema) return;
    baseId = getFullPath(this._getId(root.schema));
  }
  return getJsonPointer.call(this, p, baseId, root.schema, root);
}


/* @this Ajv */
function resolveRecursive(root, ref, parsedRef) {
  /* jshint validthis: true */
  var res = resolveSchema.call(this, root, ref);
  if (res) {
    var schema = res.schema;
    var baseId = res.baseId;
    root = res.root;
    var id = this._getId(schema);
    if (id) baseId = resolveUrl(baseId, id);
    return getJsonPointer.call(this, parsedRef, baseId, schema, root);
  }
}


var PREVENT_SCOPE_CHANGE = util.toHash(['properties', 'patternProperties', 'enum', 'dependencies', 'definitions']);
/* @this Ajv */
function getJsonPointer(parsedRef, baseId, schema, root) {
  /* jshint validthis: true */
  parsedRef.fragment = parsedRef.fragment || '';
  if (parsedRef.fragment.slice(0,1) != '/') return;
  var parts = parsedRef.fragment.split('/');

  for (var i = 1; i < parts.length; i++) {
    var part = parts[i];
    if (part) {
      part = util.unescapeFragment(part);
      schema = schema[part];
      if (schema === undefined) break;
      var id;
      if (!PREVENT_SCOPE_CHANGE[part]) {
        id = this._getId(schema);
        if (id) baseId = resolveUrl(baseId, id);
        if (schema.$ref) {
          var $ref = resolveUrl(baseId, schema.$ref);
          var res = resolveSchema.call(this, root, $ref);
          if (res) {
            schema = res.schema;
            root = res.root;
            baseId = res.baseId;
          }
        }
      }
    }
  }
  if (schema !== undefined && schema !== root.schema)
    return { schema: schema, root: root, baseId: baseId };
}


var SIMPLE_INLINED = util.toHash([
  'type', 'format', 'pattern',
  'maxLength', 'minLength',
  'maxProperties', 'minProperties',
  'maxItems', 'minItems',
  'maximum', 'minimum',
  'uniqueItems', 'multipleOf',
  'required', 'enum'
]);
function inlineRef(schema, limit) {
  if (limit === false) return false;
  if (limit === undefined || limit === true) return checkNoRef(schema);
  else if (limit) return countKeys(schema) <= limit;
}


function checkNoRef(schema) {
  var item;
  if (Array.isArray(schema)) {
    for (var i=0; i<schema.length; i++) {
      item = schema[i];
      if (typeof item == 'object' && !checkNoRef(item)) return false;
    }
  } else {
    for (var key in schema) {
      if (key == '$ref') return false;
      item = schema[key];
      if (typeof item == 'object' && !checkNoRef(item)) return false;
    }
  }
  return true;
}


function countKeys(schema) {
  var count = 0, item;
  if (Array.isArray(schema)) {
    for (var i=0; i<schema.length; i++) {
      item = schema[i];
      if (typeof item == 'object') count += countKeys(item);
      if (count == Infinity) return Infinity;
    }
  } else {
    for (var key in schema) {
      if (key == '$ref') return Infinity;
      if (SIMPLE_INLINED[key]) {
        count++;
      } else {
        item = schema[key];
        if (typeof item == 'object') count += countKeys(item) + 1;
        if (count == Infinity) return Infinity;
      }
    }
  }
  return count;
}


function getFullPath(id, normalize) {
  if (normalize !== false) id = normalizeId(id);
  var p = URI.parse(id);
  return _getFullPath(p);
}


function _getFullPath(p) {
  return URI.serialize(p).split('#')[0] + '#';
}


var TRAILING_SLASH_HASH = /#\/?$/;
function normalizeId(id) {
  return id ? id.replace(TRAILING_SLASH_HASH, '') : '';
}


function resolveUrl(baseId, id) {
  id = normalizeId(id);
  return URI.resolve(baseId, id);
}


/* @this Ajv */
function resolveIds(schema) {
  var schemaId = normalizeId(this._getId(schema));
  var baseIds = {'': schemaId};
  var fullPaths = {'': getFullPath(schemaId, false)};
  var localRefs = {};
  var self = this;

  traverse(schema, {allKeys: true}, function(sch, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
    if (jsonPtr === '') return;
    var id = self._getId(sch);
    var baseId = baseIds[parentJsonPtr];
    var fullPath = fullPaths[parentJsonPtr] + '/' + parentKeyword;
    if (keyIndex !== undefined)
      fullPath += '/' + (typeof keyIndex == 'number' ? keyIndex : util.escapeFragment(keyIndex));

    if (typeof id == 'string') {
      id = baseId = normalizeId(baseId ? URI.resolve(baseId, id) : id);

      var refVal = self._refs[id];
      if (typeof refVal == 'string') refVal = self._refs[refVal];
      if (refVal && refVal.schema) {
        if (!equal(sch, refVal.schema))
          throw new Error('id "' + id + '" resolves to more than one schema');
      } else if (id != normalizeId(fullPath)) {
        if (id[0] == '#') {
          if (localRefs[id] && !equal(sch, localRefs[id]))
            throw new Error('id "' + id + '" resolves to more than one schema');
          localRefs[id] = sch;
        } else {
          self._refs[id] = fullPath;
        }
      }
    }
    baseIds[jsonPtr] = baseId;
    fullPaths[jsonPtr] = fullPath;
  });

  return localRefs;
}
"~x'use strict';

var ruleModules = require('../dotjs')
  , toHash = require('./util').toHash;

module.exports = function rules() {
  var RULES = [
    { type: 'number',
      rules: [ { 'maximum': ['exclusiveMaximum'] },
               { 'minimum': ['exclusiveMinimum'] }, 'multipleOf', 'format'] },
    { type: 'string',
      rules: [ 'maxLength', 'minLength', 'pattern', 'format' ] },
    { type: 'array',
      rules: [ 'maxItems', 'minItems', 'items', 'contains', 'uniqueItems' ] },
    { type: 'object',
      rules: [ 'maxProperties', 'minProperties', 'required', 'dependencies', 'propertyNames',
               { 'properties': ['additionalProperties', 'patternProperties'] } ] },
    { rules: [ '$ref', 'const', 'enum', 'not', 'anyOf', 'oneOf', 'allOf', 'if' ] }
  ];

  var ALL = [ 'type', '$comment' ];
  var KEYWORDS = [
    '$schema', '$id', 'id', '$data', '$async', 'title',
    'description', 'default', 'definitions',
    'examples', 'readOnly', 'writeOnly',
    'contentMediaType', 'contentEncoding',
    'additionalItems', 'then', 'else'
  ];
  var TYPES = [ 'number', 'integer', 'string', 'array', 'object', 'boolean', 'null' ];
  RULES.all = toHash(ALL);
  RULES.types = toHash(TYPES);

  RULES.forEach(function (group) {
    group.rules = group.rules.map(function (keyword) {
      var implKeywords;
      if (typeof keyword == 'object') {
        var key = Object.keys(keyword)[0];
        implKeywords = keyword[key];
        keyword = key;
        implKeywords.forEach(function (k) {
          ALL.push(k);
          RULES.all[k] = true;
        });
      }
      ALL.push(keyword);
      var rule = RULES.all[keyword] = {
        keyword: keyword,
        code: ruleModules[keyword],
        implements: implKeywords
      };
      return rule;
    });

    RULES.all.$comment = {
      keyword: '$comment',
      code: ruleModules.$comment
    };

    if (group.type) RULES.types[group.type] = group;
  });

  RULES.keywords = toHash(ALL.concat(KEYWORDS));
  RULES.custom = {};

  return RULES;
};
s]	x z'use strict';

var util = require('./util');

module.exports = SchemaObject;

function SchemaObject(obj) {
  util.copy(obj, this);
}
,-"x.'use strict';

// https://mathiasbynens.be/notes/javascript-encoding
// https://github.com/bestiejs/punycode.js - punycode.ucs2.decode
module.exports = function ucs2length(str) {
  var length = 0
    , len = str.length
    , pos = 0
    , value;
  while (pos < len) {
    length++;
    value = str.charCodeAt(pos++);
    if (value >= 0xD800 && value <= 0xDBFF && pos < len) {
      // high surrogate, and there is a next character
      value = str.charCodeAt(pos);
      if ((value & 0xFC00) == 0xDC00) pos++; // low surrogate
    }
  }
  return length;
};
@x>'use strict';


module.exports = {
  copy: copy,
  checkDataType: checkDataType,
  checkDataTypes: checkDataTypes,
  coerceToTypes: coerceToTypes,
  toHash: toHash,
  getProperty: getProperty,
  escapeQuotes: escapeQuotes,
  equal: require('fast-deep-equal'),
  ucs2length: require('./ucs2length'),
  varOccurences: varOccurences,
  varReplace: varReplace,
  schemaHasRules: schemaHasRules,
  schemaHasRulesExcept: schemaHasRulesExcept,
  schemaUnknownRules: schemaUnknownRules,
  toQuotedString: toQuotedString,
  getPathExpr: getPathExpr,
  getPath: getPath,
  getData: getData,
  unescapeFragment: unescapeFragment,
  unescapeJsonPointer: unescapeJsonPointer,
  escapeFragment: escapeFragment,
  escapeJsonPointer: escapeJsonPointer
};


function copy(o, to) {
  to = to || {};
  for (var key in o) to[key] = o[key];
  return to;
}


function checkDataType(dataType, data, strictNumbers, negate) {
  var EQUAL = negate ? ' !== ' : ' === '
    , AND = negate ? ' || ' : ' && '
    , OK = negate ? '!' : ''
    , NOT = negate ? '' : '!';
  switch (dataType) {
    case 'null': return data + EQUAL + 'null';
    case 'array': return OK + 'Array.isArray(' + data + ')';
    case 'object': return '(' + OK + data + AND +
                          'typeof ' + data + EQUAL + '"object"' + AND +
                          NOT + 'Array.isArray(' + data + '))';
    case 'integer': return '(typeof ' + data + EQUAL + '"number"' + AND +
                           NOT + '(' + data + ' % 1)' +
                           AND + data + EQUAL + data +
                           (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')';
    case 'number': return '(typeof ' + data + EQUAL + '"' + dataType + '"' +
                          (strictNumbers ? (AND + OK + 'isFinite(' + data + ')') : '') + ')';
    default: return 'typeof ' + data + EQUAL + '"' + dataType + '"';
  }
}


function checkDataTypes(dataTypes, data, strictNumbers) {
  switch (dataTypes.length) {
    case 1: return checkDataType(dataTypes[0], data, strictNumbers, true);
    default:
      var code = '';
      var types = toHash(dataTypes);
      if (types.array && types.object) {
        code = types.null ? '(': '(!' + data + ' || ';
        code += 'typeof ' + data + ' !== "object")';
        delete types.null;
        delete types.array;
        delete types.object;
      }
      if (types.number) delete types.integer;
      for (var t in types)
        code += (code ? ' && ' : '' ) + checkDataType(t, data, strictNumbers, true);

      return code;
  }
}


var COERCE_TO_TYPES = toHash([ 'string', 'number', 'integer', 'boolean', 'null' ]);
function coerceToTypes(optionCoerceTypes, dataTypes) {
  if (Array.isArray(dataTypes)) {
    var types = [];
    for (var i=0; i<dataTypes.length; i++) {
      var t = dataTypes[i];
      if (COERCE_TO_TYPES[t]) types[types.length] = t;
      else if (optionCoerceTypes === 'array' && t === 'array') types[types.length] = t;
    }
    if (types.length) return types;
  } else if (COERCE_TO_TYPES[dataTypes]) {
    return [dataTypes];
  } else if (optionCoerceTypes === 'array' && dataTypes === 'array') {
    return ['array'];
  }
}


function toHash(arr) {
  var hash = {};
  for (var i=0; i<arr.length; i++) hash[arr[i]] = true;
  return hash;
}


var IDENTIFIER = /^[a-z$_][a-z$_0-9]*$/i;
var SINGLE_QUOTE = /'|\\/g;
function getProperty(key) {
  return typeof key == 'number'
          ? '[' + key + ']'
          : IDENTIFIER.test(key)
            ? '.' + key
            : "['" + escapeQuotes(key) + "']";
}


function escapeQuotes(str) {
  return str.replace(SINGLE_QUOTE, '\\$&')
            .replace(/\n/g, '\\n')
            .replace(/\r/g, '\\r')
            .replace(/\f/g, '\\f')
            .replace(/\t/g, '\\t');
}


function varOccurences(str, dataVar) {
  dataVar += '[^0-9]';
  var matches = str.match(new RegExp(dataVar, 'g'));
  return matches ? matches.length : 0;
}


function varReplace(str, dataVar, expr) {
  dataVar += '([^0-9])';
  expr = expr.replace(/\$/g, '$$$$');
  return str.replace(new RegExp(dataVar, 'g'), expr + '$1');
}


function schemaHasRules(schema, rules) {
  if (typeof schema == 'boolean') return !schema;
  for (var key in schema) if (rules[key]) return true;
}


function schemaHasRulesExcept(schema, rules, exceptKeyword) {
  if (typeof schema == 'boolean') return !schema && exceptKeyword != 'not';
  for (var key in schema) if (key != exceptKeyword && rules[key]) return true;
}


function schemaUnknownRules(schema, rules) {
  if (typeof schema == 'boolean') return;
  for (var key in schema) if (!rules[key]) return key;
}


function toQuotedString(str) {
  return '\'' + escapeQuotes(str) + '\'';
}


function getPathExpr(currentPath, expr, jsonPointers, isNumber) {
  var path = jsonPointers // false by default
              ? '\'/\' + ' + expr + (isNumber ? '' : '.replace(/~/g, \'~0\').replace(/\\//g, \'~1\')')
              : (isNumber ? '\'[\' + ' + expr + ' + \']\'' : '\'[\\\'\' + ' + expr + ' + \'\\\']\'');
  return joinPaths(currentPath, path);
}


function getPath(currentPath, prop, jsonPointers) {
  var path = jsonPointers // false by default
              ? toQuotedString('/' + escapeJsonPointer(prop))
              : toQuotedString(getProperty(prop));
  return joinPaths(currentPath, path);
}


var JSON_POINTER = /^\/(?:[^~]|~0|~1)*$/;
var RELATIVE_JSON_POINTER = /^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;
function getData($data, lvl, paths) {
  var up, jsonPointer, data, matches;
  if ($data === '') return 'rootData';
  if ($data[0] == '/') {
    if (!JSON_POINTER.test($data)) throw new Error('Invalid JSON-pointer: ' + $data);
    jsonPointer = $data;
    data = 'rootData';
  } else {
    matches = $data.match(RELATIVE_JSON_POINTER);
    if (!matches) throw new Error('Invalid JSON-pointer: ' + $data);
    up = +matches[1];
    jsonPointer = matches[2];
    if (jsonPointer == '#') {
      if (up >= lvl) throw new Error('Cannot access property/index ' + up + ' levels up, current level is ' + lvl);
      return paths[lvl - up];
    }

    if (up > lvl) throw new Error('Cannot access data ' + up + ' levels up, current level is ' + lvl);
    data = 'data' + ((lvl - up) || '');
    if (!jsonPointer) return data;
  }

  var expr = data;
  var segments = jsonPointer.split('/');
  for (var i=0; i<segments.length; i++) {
    var segment = segments[i];
    if (segment) {
      data += getProperty(unescapeJsonPointer(segment));
      expr += ' && ' + data;
    }
  }
  return expr;
}


function joinPaths (a, b) {
  if (a == '""') return b;
  return (a + ' + ' + b).replace(/([^\\])' \+ '/g, '$1');
}


function unescapeFragment(str) {
  return unescapeJsonPointer(decodeURIComponent(str));
}


function escapeFragment(str) {
  return encodeURIComponent(escapeJsonPointer(str));
}


function escapeJsonPointer(str) {
  return str.replace(/~/g, '~0').replace(/\//g, '~1');
}


function unescapeJsonPointer(str) {
  return str.replace(/~1/g, '/').replace(/~0/g, '~');
}
R4Ax'use strict';

var KEYWORDS = [
  'multipleOf',
  'maximum',
  'exclusiveMaximum',
  'minimum',
  'exclusiveMinimum',
  'maxLength',
  'minLength',
  'pattern',
  'additionalItems',
  'maxItems',
  'minItems',
  'uniqueItems',
  'maxProperties',
  'minProperties',
  'required',
  'additionalProperties',
  'enum',
  'format',
  'const'
];

module.exports = function (metaSchema, keywordsJsonPointers) {
  for (var i=0; i<keywordsJsonPointers.length; i++) {
    metaSchema = JSON.parse(JSON.stringify(metaSchema));
    var segments = keywordsJsonPointers[i].split('/');
    var keywords = metaSchema;
    var j;
    for (j=1; j<segments.length; j++)
      keywords = keywords[segments[j]];

    for (j=0; j<KEYWORDS.length; j++) {
      var key = KEYWORDS[j];
      var schema = keywords[key];
      if (schema) {
        keywords[key] = {
          anyOf: [
            schema,
            { $ref: 'https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#' }
          ]
        };
      }
    }
  }

  return metaSchema;
};
M@K6xh'use strict';

var metaSchema = require('./refs/json-schema-draft-07.json');

module.exports = {
  $id: 'https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js',
  definitions: {
    simpleTypes: metaSchema.definitions.simpleTypes
  },
  type: 'object',
  dependencies: {
    schema: ['validate'],
    $data: ['validate'],
    statements: ['inline'],
    valid: {not: {required: ['macro']}}
  },
  properties: {
    type: metaSchema.properties.type,
    schema: {type: 'boolean'},
    statements: {type: 'boolean'},
    dependencies: {
      type: 'array',
      items: {type: 'string'}
    },
    metaSchema: {type: 'object'},
    modifying: {type: 'boolean'},
    valid: {type: 'boolean'},
    $data: {type: 'boolean'},
    async: {type: 'boolean'},
    errors: {
      anyOf: [
        {type: 'boolean'},
        {const: 'full'}
      ]
    }
  }
};

͢Jx]100644 _limit.jst R"_1hd:ǲ&100644 _limitItems.jst t)vd!Bw,~100644 _limitLength.jst (\f.-;nXh5f^ 100644 _limitProperties.jst QQB%:"100644 allOf.jst x/-5
*pI100644 anyOf.jst ꐞ(#7R{100644 coerce.def Gj%+b;100644 comment.jst Y\k[[(5xO+100644 const.jst *)m9r)͂100644 contains.jst Mɖt΃ͳ 1k-b100644 custom.jst K_AP{V`XP100644 defaults.def D(TI6nDTa100644 definitions.def p6Ұ80#R'3100644 dependencies.jst 쎹S6!B=n100644 enum.jst 5|.ZˑmMe/100644 errors.def \WRېzpqGt100644 format.jst 7Mi~C3cw100644 if.jst a$ZjEC>100644 items.jst 2nꌰ! p}?T100644 missing.def ;nt;S9.
100644 multipleOf.jst mVbc>$B~100644 not.jst 1@Rf|f#100644 oneOf.jst ,nկVB<yQoQ^100644 pattern.jst xʪ,@8100644 properties.jst \빱. ͊Jqԧ100644 propertyNames.jst V̯ĵSc*100644 ref.jst %>5By1Reڰ100644 required.jst ^KNw*Gڙ100644 uniqueItems.jst 曃}
YȜٝΐ100644 validate.jst 2~q>x@@Ccx\{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.$data }}

{{## def.setExclusiveLimit:
  $exclusive = true;
  $errorKeyword = $exclusiveKeyword;
  $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;
#}}

{{
  var $isMax = $keyword == 'maximum'
    , $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum'
    , $schemaExcl = it.schema[$exclusiveKeyword]
    , $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data
    , $op = $isMax ? '<' : '>'
    , $notOp = $isMax ? '>' : '<'
    , $errorKeyword = undefined;

  if (!($isData || typeof $schema == 'number' || $schema === undefined)) {
    throw new Error($keyword + ' must be number');
  }
  if (!($isDataExcl || $schemaExcl === undefined
                    || typeof $schemaExcl == 'number'
                    || typeof $schemaExcl == 'boolean')) {
    throw new Error($exclusiveKeyword + ' must be number or boolean');
  }
}}

{{? $isDataExcl }}
  {{
    var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr)
      , $exclusive = 'exclusive' + $lvl
      , $exclType = 'exclType' + $lvl
      , $exclIsNumber = 'exclIsNumber' + $lvl
      , $opExpr = 'op' + $lvl
      , $opStr = '\' + ' + $opExpr + ' + \'';
  }}
  var schemaExcl{{=$lvl}} = {{=$schemaValueExcl}};
  {{ $schemaValueExcl = 'schemaExcl' + $lvl; }}

  var {{=$exclusive}};
  var {{=$exclType}} = typeof {{=$schemaValueExcl}};
  if ({{=$exclType}} != 'boolean' && {{=$exclType}} != 'undefined' && {{=$exclType}} != 'number') {
    {{ var $errorKeyword = $exclusiveKeyword; }}
    {{# def.error:'_exclusiveLimit' }}
  } else if ({{# def.$dataNotType:'number' }}
            {{=$exclType}} == 'number'
              ? (
                  ({{=$exclusive}} = {{=$schemaValue}} === undefined || {{=$schemaValueExcl}} {{=$op}}= {{=$schemaValue}})
                    ? {{=$data}} {{=$notOp}}= {{=$schemaValueExcl}}
                    : {{=$data}} {{=$notOp}} {{=$schemaValue}}
                )
              : (
                  ({{=$exclusive}} = {{=$schemaValueExcl}} === true)
                    ? {{=$data}} {{=$notOp}}= {{=$schemaValue}}
                    : {{=$data}} {{=$notOp}} {{=$schemaValue}}
                )
            || {{=$data}} !== {{=$data}}) {
    var op{{=$lvl}} = {{=$exclusive}} ? '{{=$op}}' : '{{=$op}}=';
    {{
      if ($schema === undefined) {
        $errorKeyword = $exclusiveKeyword;
        $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;
        $schemaValue = $schemaValueExcl;
        $isData = $isDataExcl;
      }
    }}
{{??}}
  {{
    var $exclIsNumber = typeof $schemaExcl == 'number'
      , $opStr = $op;  /*used in error*/
  }}

  {{? $exclIsNumber && $isData }}
    {{ var $opExpr = '\'' + $opStr + '\''; /*used in error*/ }}
    if ({{# def.$dataNotType:'number' }}
        ( {{=$schemaValue}} === undefined
          || {{=$schemaExcl}} {{=$op}}= {{=$schemaValue}}
            ? {{=$data}} {{=$notOp}}= {{=$schemaExcl}}
            : {{=$data}} {{=$notOp}} {{=$schemaValue}} )
        || {{=$data}} !== {{=$data}}) {
  {{??}}
    {{
      if ($exclIsNumber && $schema === undefined) {
          {{# def.setExclusiveLimit }}
          $schemaValue = $schemaExcl;
          $notOp += '=';
      } else {
        if ($exclIsNumber)
          $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema);

        if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) {
          {{# def.setExclusiveLimit }}
          $notOp += '=';
        } else {
          $exclusive = false;
          $opStr += '=';
        }
      }

      var $opExpr = '\'' + $opStr + '\''; /*used in error*/
    }}

    if ({{# def.$dataNotType:'number' }}
        {{=$data}} {{=$notOp}} {{=$schemaValue}}
        || {{=$data}} !== {{=$data}}) {
  {{?}}
{{?}}
    {{ $errorKeyword = $errorKeyword || $keyword; }}
    {{# def.error:'_limit' }}
  } {{? $breakOnError }} else { {{?}}
_Oxa{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.$data }}

{{# def.numberKeyword }}

{{ var $op = $keyword == 'maxItems' ? '>' : '<'; }}
if ({{# def.$dataNotType:'number' }} {{=$data}}.length {{=$op}} {{=$schemaValue}}) {
  {{ var $errorKeyword = $keyword; }}
  {{# def.error:'_limitItems' }}
} {{? $breakOnError }} else { {{?}}
xxf{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.$data }}

{{# def.numberKeyword }}

{{ var $op = $keyword == 'maxLength' ? '>' : '<'; }}
if ({{# def.$dataNotType:'number' }} {{# def.strLength }} {{=$op}} {{=$schemaValue}}) {
  {{ var $errorKeyword = $keyword; }}
  {{# def.error:'_limitLength' }}
} {{? $breakOnError }} else { {{?}}
!yxx{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.$data }}

{{# def.numberKeyword }}

{{ var $op = $keyword == 'maxProperties' ? '>' : '<'; }}
if ({{# def.$dataNotType:'number' }} Object.keys({{=$data}}).length {{=$op}} {{=$schemaValue}}) {
  {{ var $errorKeyword = $keyword; }}
  {{# def.error:'_limitProperties' }}
} {{? $breakOnError }} else { {{?}}
&xa{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.setupNextLevel }}

{{
  var $currentBaseId = $it.baseId
    , $allSchemasEmpty = true;
}}

{{~ $schema:$sch:$i }}
  {{? {{# def.nonEmptySchema:$sch }} }}
    {{
      $allSchemasEmpty = false;
      $it.schema = $sch;
      $it.schemaPath = $schemaPath + '[' + $i + ']';
      $it.errSchemaPath = $errSchemaPath + '/' + $i;
    }}

    {{# def.insertSubschemaCode }}

    {{# def.ifResultValid }}
  {{?}}
{{~}}

{{? $breakOnError }}
  {{? $allSchemasEmpty }}
    if (true) {
  {{??}}
    {{= $closingBraces.slice(0,-1) }}
  {{?}}
{{?}}
9xf{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.setupNextLevel }}

{{
  var $noEmptySchema = $schema.every(function($sch) {
    return {{# def.nonEmptySchema:$sch }};
  });
}}
{{? $noEmptySchema }}
  {{ var $currentBaseId = $it.baseId; }}
  var {{=$errs}} = errors;
  var {{=$valid}} = false;

  {{# def.setCompositeRule }}

  {{~ $schema:$sch:$i }}
    {{
      $it.schema = $sch;
      $it.schemaPath = $schemaPath + '[' + $i + ']';
      $it.errSchemaPath = $errSchemaPath + '/' + $i;
    }}

    {{# def.insertSubschemaCode }}

    {{=$valid}} = {{=$valid}} || {{=$nextValid}};

    if (!{{=$valid}}) {
    {{ $closingBraces += '}'; }}
  {{~}}

  {{# def.resetCompositeRule }}

  {{= $closingBraces }}

  if (!{{=$valid}}) {
    {{# def.extraError:'anyOf' }}
  } else {
    {{# def.resetErrors }}
  {{? it.opts.allErrors }} } {{?}}
{{??}}
  {{? $breakOnError }}
    if (true) {
  {{?}}
{{?}}
=&{xD{{## def.coerceType:
  {{
    var $dataType = 'dataType' + $lvl
      , $coerced = 'coerced' + $lvl;
  }}
  var {{=$dataType}} = typeof {{=$data}};
  var {{=$coerced}} = undefined;

  {{? it.opts.coerceTypes == 'array' }}
    if ({{=$dataType}} == 'object' && Array.isArray({{=$data}}) && {{=$data}}.length == 1) {
      {{=$data}} = {{=$data}}[0];
      {{=$dataType}} = typeof {{=$data}};
      if ({{=it.util.checkDataType(it.schema.type, $data, it.opts.strictNumbers)}}) {{=$coerced}} = {{=$data}};
    }
  {{?}}

  if ({{=$coerced}} !== undefined) ;
  {{~ $coerceToTypes:$type:$i }}
    {{? $type == 'string' }}
      else if ({{=$dataType}} == 'number' || {{=$dataType}} == 'boolean')
        {{=$coerced}} = '' + {{=$data}};
      else if ({{=$data}} === null) {{=$coerced}} = '';
    {{?? $type == 'number' || $type == 'integer' }}
      else if ({{=$dataType}} == 'boolean' || {{=$data}} === null
          || ({{=$dataType}} == 'string' && {{=$data}} && {{=$data}} == +{{=$data}}
          {{? $type == 'integer' }} && !({{=$data}} % 1){{?}}))
        {{=$coerced}} = +{{=$data}};
    {{?? $type == 'boolean' }}
      else if ({{=$data}} === 'false' || {{=$data}} === 0 || {{=$data}} === null)
        {{=$coerced}} = false;
      else if ({{=$data}} === 'true' || {{=$data}} === 1)
        {{=$coerced}} = true;
    {{?? $type == 'null' }}
      else if ({{=$data}} === '' || {{=$data}} === 0 || {{=$data}} === false)
        {{=$coerced}} = null;
    {{?? it.opts.coerceTypes == 'array' && $type == 'array' }}
      else if ({{=$dataType}} == 'string' || {{=$dataType}} == 'number' || {{=$dataType}} == 'boolean' || {{=$data}} == null)
        {{=$coerced}} = [{{=$data}}];
    {{?}}
  {{~}}
  else {
    {{# def.error:'type' }}
  }

  if ({{=$coerced}} !== undefined) {
    {{# def.setParentData }}
    {{=$data}} = {{=$coerced}};
    {{? !$dataLvl }}if ({{=$parentData}} !== undefined){{?}}
      {{=$parentData}}[{{=$parentDataProperty}}] = {{=$coerced}};
  }
#}}
gĲxB{{# def.definitions }}
{{# def.setupKeyword }}

{{ var $comment = it.util.toQuotedString($schema); }}
{{? it.opts.$comment === true }}
  console.log({{=$comment}});
{{?? typeof it.opts.$comment == 'function' }}
  self._opts.$comment({{=$comment}}, {{=it.util.toQuotedString($errSchemaPath)}}, validate.root.schema);
{{?}}
rx{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.$data }}

{{? !$isData }}
  var schema{{=$lvl}} = validate.schema{{=$schemaPath}};
{{?}}
var {{=$valid}} = equal({{=$data}}, schema{{=$lvl}});
{{# def.checkError:'const' }}
{{? $breakOnError }} else { {{?}}
%wbɴJx[{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.setupNextLevel }}


{{
  var $idx = 'i' + $lvl
    , $dataNxt = $it.dataLevel = it.dataLevel + 1
    , $nextData = 'data' + $dataNxt
    , $currentBaseId = it.baseId
    , $nonEmptySchema = {{# def.nonEmptySchema:$schema }};
}}

var {{=$errs}} = errors;
var {{=$valid}};

{{? $nonEmptySchema }}
  {{# def.setCompositeRule }}

  {{
    $it.schema = $schema;
    $it.schemaPath = $schemaPath;
    $it.errSchemaPath = $errSchemaPath;
  }}

  var {{=$nextValid}} = false;

  for (var {{=$idx}} = 0; {{=$idx}} < {{=$data}}.length; {{=$idx}}++) {
    {{
      $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);
      var $passData = $data + '[' + $idx + ']';
      $it.dataPathArr[$dataNxt] = $idx;
    }}

    {{# def.generateSubschemaCode }}
    {{# def.optimizeValidate }}

    if ({{=$nextValid}}) break;
  }

  {{# def.resetCompositeRule }}
  {{= $closingBraces }}

  if (!{{=$nextValid}}) {
{{??}}
  if ({{=$data}}.length == 0) {
{{?}}

    {{# def.error:'contains' }}
  } else {
    {{? $nonEmptySchema }}
      {{# def.resetErrors }}
    {{?}}
  {{? it.opts.allErrors }} } {{?}}
Fz(xQ{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.$data }}

{{
  var $rule = this
    , $definition = 'definition' + $lvl
    , $rDef = $rule.definition
    , $closingBraces = '';
  var $validate = $rDef.validate;
  var $compile, $inline, $macro, $ruleValidate, $validateCode;
}}

{{? $isData && $rDef.$data }}
  {{
    $validateCode = 'keywordValidate' + $lvl;
    var $validateSchema = $rDef.validateSchema;
  }}
  var {{=$definition}} = RULES.custom['{{=$keyword}}'].definition;
  var {{=$validateCode}} = {{=$definition}}.validate;
{{??}}
  {{
    $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it);
    if (!$ruleValidate) return;
    $schemaValue = 'validate.schema' + $schemaPath;
    $validateCode = $ruleValidate.code;
    $compile = $rDef.compile;
    $inline = $rDef.inline;
    $macro = $rDef.macro;
  }}
{{?}}

{{
  var $ruleErrs = $validateCode + '.errors'
    , $i = 'i' + $lvl
    , $ruleErr = 'ruleErr' + $lvl
    , $asyncKeyword = $rDef.async;

  if ($asyncKeyword && !it.async)
    throw new Error('async keyword in sync schema');
}}


{{? !($inline || $macro) }}{{=$ruleErrs}} = null;{{?}}
var {{=$errs}} = errors;
var {{=$valid}};

{{## def.callRuleValidate:
  {{=$validateCode}}.call(
    {{? it.opts.passContext }}this{{??}}self{{?}}
    {{? $compile || $rDef.schema === false }}
      , {{=$data}}
    {{??}}
      , {{=$schemaValue}}
      , {{=$data}}
      , validate.schema{{=it.schemaPath}}
    {{?}}
    , {{# def.dataPath }}
    {{# def.passParentData }}
    , rootData
  )
#}}

{{## def.extendErrors:_inline:
  for (var {{=$i}}={{=$errs}}; {{=$i}}<errors; {{=$i}}++) {
    var {{=$ruleErr}} = vErrors[{{=$i}}];
    if ({{=$ruleErr}}.dataPath === undefined)
      {{=$ruleErr}}.dataPath = (dataPath || '') + {{= it.errorPath }};
    {{# _inline ? 'if (\{\{=$ruleErr\}\}.schemaPath === undefined) {' : '' }}
      {{=$ruleErr}}.schemaPath = "{{=$errSchemaPath}}";
    {{# _inline ? '}' : '' }}
    {{? it.opts.verbose }}
      {{=$ruleErr}}.schema = {{=$schemaValue}};
      {{=$ruleErr}}.data = {{=$data}};
    {{?}}
  }
#}}


{{? $isData && $rDef.$data }}
  {{ $closingBraces += '}'; }}
  if ({{=$schemaValue}} === undefined) {
    {{=$valid}} = true;
  } else {
  {{? $validateSchema }}
    {{ $closingBraces += '}'; }}
    {{=$valid}} = {{=$definition}}.validateSchema({{=$schemaValue}});
    if ({{=$valid}}) {
  {{?}}
{{?}}

{{? $inline }}
  {{? $rDef.statements }}
    {{= $ruleValidate.validate }}
  {{??}}
    {{=$valid}} = {{= $ruleValidate.validate }};
  {{?}}
{{?? $macro }}
  {{# def.setupNextLevel }}
  {{
    $it.schema = $ruleValidate.validate;
    $it.schemaPath = '';
  }}
  {{# def.setCompositeRule }}
  {{ var $code = it.validate($it).replace(/validate\.schema/g, $validateCode); }}
  {{# def.resetCompositeRule }}
  {{= $code }}
{{??}}
  {{# def.beginDefOut}}
    {{# def.callRuleValidate }}
  {{# def.storeDefOut:def_callRuleValidate }}

  {{? $rDef.errors === false }}
    {{=$valid}} = {{? $asyncKeyword }}await {{?}}{{= def_callRuleValidate }};
  {{??}}
    {{? $asyncKeyword }}
      {{ $ruleErrs = 'customErrors' + $lvl; }}
      var {{=$ruleErrs}} = null;
      try {
        {{=$valid}} = await {{= def_callRuleValidate }};
      } catch (e) {
        {{=$valid}} = false;
        if (e instanceof ValidationError) {{=$ruleErrs}} = e.errors;
        else throw e;
      }
    {{??}}
      {{=$ruleErrs}} = null;
      {{=$valid}} = {{= def_callRuleValidate }};
    {{?}}
  {{?}}
{{?}}

{{? $rDef.modifying }}
  if ({{=$parentData}}) {{=$data}} = {{=$parentData}}[{{=$parentDataProperty}}];
{{?}}

{{= $closingBraces }}

{{## def.notValidationResult:
  {{? $rDef.valid === undefined }}
    !{{? $macro }}{{=$nextValid}}{{??}}{{=$valid}}{{?}}
  {{??}}
    {{= !$rDef.valid }}
  {{?}}
#}}

{{? $rDef.valid }}
  {{? $breakOnError }} if (true) { {{?}}
{{??}}
  if ({{# def.notValidationResult }}) {
    {{ $errorKeyword = $rule.keyword; }}
    {{# def.beginDefOut}}
      {{# def.error:'custom' }}
    {{# def.storeDefOut:def_customError }}

    {{? $inline }}
      {{? $rDef.errors }}
        {{? $rDef.errors != 'full' }}
          {{# def.extendErrors:true }}
        {{?}}
      {{??}}
        {{? $rDef.errors === false}}
          {{= def_customError }}
        {{??}}
          if ({{=$errs}} == errors) {
            {{= def_customError }}
          } else {
            {{# def.extendErrors:true }}
          }
        {{?}}
      {{?}}
    {{?? $macro }}
      {{# def.extraError:'custom' }}
    {{??}}
      {{? $rDef.errors === false}}
        {{= def_customError }}
      {{??}}
        if (Array.isArray({{=$ruleErrs}})) {
          if (vErrors === null) vErrors = {{=$ruleErrs}};
          else vErrors = vErrors.concat({{=$ruleErrs}});
          errors = vErrors.length;
          {{# def.extendErrors:false }}
        } else {
          {{= def_customError }}
        }
      {{?}}
    {{?}}

  } {{? $breakOnError }} else { {{?}}
{{?}}
Px{{## def.assignDefault:
  {{? it.compositeRule }}
    {{
      if (it.opts.strictDefaults) {
        var $defaultMsg = 'default is ignored for: ' + $passData;
        if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);
        else throw new Error($defaultMsg);
      }
    }}
  {{??}}
    if ({{=$passData}} === undefined
      {{? it.opts.useDefaults == 'empty' }}
        || {{=$passData}} === null
        || {{=$passData}} === ''
      {{?}}
    )
      {{=$passData}} = {{? it.opts.useDefaults == 'shared' }}
                         {{= it.useDefault($sch.default) }}
                       {{??}}
                         {{= JSON.stringify($sch.default) }}
                       {{?}};
  {{?}}
#}}


{{## def.defaultProperties:
  {{
    var $schema = it.schema.properties
      , $schemaKeys = Object.keys($schema); }}
  {{~ $schemaKeys:$propertyKey }}
    {{ var $sch = $schema[$propertyKey]; }}
    {{? $sch.default !== undefined }}
      {{ var $passData = $data + it.util.getProperty($propertyKey); }}
      {{# def.assignDefault }}
    {{?}}
  {{~}}
#}}


{{## def.defaultItems:
  {{~ it.schema.items:$sch:$i }}
    {{? $sch.default !== undefined }}
      {{ var $passData = $data + '[' + $i + ']'; }}
      {{# def.assignDefault }}
    {{?}}
  {{~}}
#}}
KxI{{## def.setupKeyword:
  {{
    var $lvl = it.level;
    var $dataLvl = it.dataLevel;
    var $schema = it.schema[$keyword];
    var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
    var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
    var $breakOnError = !it.opts.allErrors;
    var $errorKeyword;

    var $data = 'data' + ($dataLvl || '');
    var $valid = 'valid' + $lvl;
    var $errs = 'errs__' + $lvl;
  }}
#}}


{{## def.setCompositeRule:
  {{
    var $wasComposite = it.compositeRule;
    it.compositeRule = $it.compositeRule = true;
  }}
#}}


{{## def.resetCompositeRule:
  {{ it.compositeRule = $it.compositeRule = $wasComposite; }}
#}}


{{## def.setupNextLevel:
  {{
    var $it = it.util.copy(it);
    var $closingBraces = '';
    $it.level++;
    var $nextValid = 'valid' + $it.level;
  }}
#}}


{{## def.ifValid:
  {{? $breakOnError }}
    if ({{=$valid}}) {
    {{ $closingBraces += '}'; }}
  {{?}}
#}}


{{## def.ifResultValid:
  {{? $breakOnError }}
    if ({{=$nextValid}}) {
    {{ $closingBraces += '}'; }}
  {{?}}
#}}


{{## def.elseIfValid:
  {{? $breakOnError }}
    {{ $closingBraces += '}'; }}
    else {
  {{?}}
#}}


{{## def.nonEmptySchema:_schema:
  (it.opts.strictKeywords
    ? (typeof _schema == 'object' && Object.keys(_schema).length > 0)
      || _schema === false
    : it.util.schemaHasRules(_schema, it.RULES.all))
#}}


{{## def.strLength:
  {{? it.opts.unicode === false }}
    {{=$data}}.length
  {{??}}
    ucs2length({{=$data}})
  {{?}}
#}}


{{## def.willOptimize:
  it.util.varOccurences($code, $nextData) < 2
#}}


{{## def.generateSubschemaCode:
  {{
    var $code = it.validate($it);
    $it.baseId = $currentBaseId;
  }}
#}}


{{## def.insertSubschemaCode:
  {{= it.validate($it) }}
  {{ $it.baseId = $currentBaseId; }}
#}}


{{## def._optimizeValidate:
  it.util.varReplace($code, $nextData, $passData)
#}}


{{## def.optimizeValidate:
  {{? {{# def.willOptimize}} }}
    {{= {{# def._optimizeValidate }} }}
  {{??}}
    var {{=$nextData}} = {{=$passData}};
    {{= $code }}
  {{?}}
#}}


{{## def.$data:
  {{
    var $isData = it.opts.$data && $schema && $schema.$data
      , $schemaValue;
  }}
  {{? $isData }}
    var schema{{=$lvl}} = {{= it.util.getData($schema.$data, $dataLvl, it.dataPathArr) }};
    {{ $schemaValue = 'schema' + $lvl; }}
  {{??}}
    {{ $schemaValue = $schema; }}
  {{?}}
#}}


{{## def.$dataNotType:_type:
  {{?$isData}} ({{=$schemaValue}} !== undefined && typeof {{=$schemaValue}} != _type) || {{?}}
#}}


{{## def.check$dataIsArray:
  if (schema{{=$lvl}} === undefined) {{=$valid}} = true;
  else if (!Array.isArray(schema{{=$lvl}})) {{=$valid}} = false;
  else {
#}}


{{## def.numberKeyword:
  {{? !($isData || typeof $schema == 'number') }}
    {{ throw new Error($keyword + ' must be number'); }}
  {{?}}
#}}


{{## def.beginDefOut:
  {{
    var $$outStack = $$outStack || [];
    $$outStack.push(out);
    out = '';
  }}
#}}


{{## def.storeDefOut:_variable:
  {{
    var _variable = out;
    out = $$outStack.pop();
  }}
#}}


{{## def.dataPath:(dataPath || ''){{? it.errorPath != '""'}} + {{= it.errorPath }}{{?}}#}}

{{## def.setParentData:
  {{
    var $parentData = $dataLvl ? 'data' + (($dataLvl-1)||'') : 'parentData'
      , $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';
  }}
#}}

{{## def.passParentData:
  {{# def.setParentData }}
  , {{= $parentData }}
  , {{= $parentDataProperty }}
#}}


{{## def.iterateProperties:
  {{? $ownProperties }}
    {{=$dataProperties}} = {{=$dataProperties}} || Object.keys({{=$data}});
    for (var {{=$idx}}=0; {{=$idx}}<{{=$dataProperties}}.length; {{=$idx}}++) {
      var {{=$key}} = {{=$dataProperties}}[{{=$idx}}];
  {{??}}
    for (var {{=$key}} in {{=$data}}) {
  {{?}}
#}}


{{## def.noPropertyInData:
  {{=$useData}} === undefined
  {{? $ownProperties }}
    || !{{# def.isOwnProperty }}
  {{?}}
#}}


{{## def.isOwnProperty:
  Object.prototype.hasOwnProperty.call({{=$data}}, '{{=it.util.escapeQuotes($propertyKey)}}')
#}}
TdqtxL{{# def.definitions }}
{{# def.errors }}
{{# def.missing }}
{{# def.setupKeyword }}
{{# def.setupNextLevel }}


{{## def.propertyInData:
  {{=$data}}{{= it.util.getProperty($property) }} !== undefined
  {{? $ownProperties }}
    && Object.prototype.hasOwnProperty.call({{=$data}}, '{{=it.util.escapeQuotes($property)}}')
  {{?}}
#}}


{{
  var $schemaDeps = {}
    , $propertyDeps = {}
    , $ownProperties = it.opts.ownProperties;

  for ($property in $schema) {
    if ($property == '__proto__') continue;
    var $sch = $schema[$property];
    var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps;
    $deps[$property] = $sch;
  }
}}

var {{=$errs}} = errors;

{{ var $currentErrorPath = it.errorPath; }}

var missing{{=$lvl}};
{{ for (var $property in $propertyDeps) { }}
  {{ $deps = $propertyDeps[$property]; }}
  {{? $deps.length }}
    if ({{# def.propertyInData }}
      {{? $breakOnError }}
          && ({{# def.checkMissingProperty:$deps }})) {
          {{# def.errorMissingProperty:'dependencies' }}
      {{??}}
        ) {
          {{~ $deps:$propertyKey }}
            {{# def.allErrorsMissingProperty:'dependencies' }}
          {{~}}
      {{?}}
    } {{# def.elseIfValid }}
  {{?}}
{{ } }}

{{
  it.errorPath = $currentErrorPath;
  var $currentBaseId = $it.baseId;
}}


{{ for (var $property in $schemaDeps) { }}
  {{ var $sch = $schemaDeps[$property]; }}
  {{? {{# def.nonEmptySchema:$sch }} }}
    {{=$nextValid}} = true;

    if ({{# def.propertyInData }}) {
      {{ 
        $it.schema = $sch;
        $it.schemaPath = $schemaPath + it.util.getProperty($property);
        $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property);
      }}

      {{# def.insertSubschemaCode }}
    }

    {{# def.ifResultValid }}
  {{?}}
{{ } }}

{{? $breakOnError }} 
  {{= $closingBraces }}
  if ({{=$errs}} == errors) {
{{?}}
\"x({{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.$data }}

{{
  var $i = 'i' + $lvl
    , $vSchema = 'schema' + $lvl;
}}

{{? !$isData }}
  var {{=$vSchema}} = validate.schema{{=$schemaPath}};
{{?}}
var {{=$valid}};

{{?$isData}}{{# def.check$dataIsArray }}{{?}}

{{=$valid}} = false;

for (var {{=$i}}=0; {{=$i}}<{{=$vSchema}}.length; {{=$i}}++)
  if (equal({{=$data}}, {{=$vSchema}}[{{=$i}}])) {
    {{=$valid}} = true;
    break;
  }

{{? $isData }}  }  {{?}}

{{# def.checkError:'enum' }}

{{? $breakOnError }} else { {{?}}
惶QxZ {{# def.definitions }}

{{## def._error:_rule:
  {{ 'istanbul ignore else'; }}
  {{? it.createErrors !== false }}
    {
      keyword: '{{= $errorKeyword || _rule }}'
      , dataPath: (dataPath || '') + {{= it.errorPath }}
      , schemaPath: {{=it.util.toQuotedString($errSchemaPath)}}
      , params: {{# def._errorParams[_rule] }}
      {{? it.opts.messages !== false }}
        , message: {{# def._errorMessages[_rule] }}
      {{?}}
      {{? it.opts.verbose }}
        , schema: {{# def._errorSchemas[_rule] }}
        , parentSchema: validate.schema{{=it.schemaPath}}
        , data: {{=$data}}
      {{?}}
    }
  {{??}}
    {}
  {{?}}
#}}


{{## def._addError:_rule:
  if (vErrors === null) vErrors = [err];
  else vErrors.push(err);
  errors++;
#}}


{{## def.addError:_rule:
  var err = {{# def._error:_rule }};
  {{# def._addError:_rule }}
#}}


{{## def.error:_rule:
  {{# def.beginDefOut}}
    {{# def._error:_rule }}
  {{# def.storeDefOut:__err }}

  {{? !it.compositeRule && $breakOnError }}
    {{ 'istanbul ignore if'; }}
    {{? it.async }}
      throw new ValidationError([{{=__err}}]);
    {{??}}
      validate.errors = [{{=__err}}];
      return false;
    {{?}}
  {{??}}
    var err = {{=__err}};
    {{# def._addError:_rule }}
  {{?}}
#}}


{{## def.extraError:_rule:
  {{# def.addError:_rule}}
  {{? !it.compositeRule && $breakOnError }}
    {{ 'istanbul ignore if'; }}
    {{? it.async }}
      throw new ValidationError(vErrors);
    {{??}}
      validate.errors = vErrors;
      return false;
    {{?}}
  {{?}}
#}}


{{## def.checkError:_rule:
  if (!{{=$valid}}) {
    {{# def.error:_rule }}
  }
#}}


{{## def.resetErrors:
  errors = {{=$errs}};
  if (vErrors !== null) {
    if ({{=$errs}}) vErrors.length = {{=$errs}};
    else vErrors = null;
  }
#}}


{{## def.concatSchema:{{?$isData}}' + {{=$schemaValue}} + '{{??}}{{=$schema}}{{?}}#}}
{{## def.appendSchema:{{?$isData}}' + {{=$schemaValue}}{{??}}{{=$schemaValue}}'{{?}}#}}
{{## def.concatSchemaEQ:{{?$isData}}' + {{=$schemaValue}} + '{{??}}{{=it.util.escapeQuotes($schema)}}{{?}}#}}

{{## def._errorMessages = {
  'false schema':  "'boolean schema is false'",
  $ref:            "'can\\\'t resolve reference {{=it.util.escapeQuotes($schema)}}'",
  additionalItems: "'should NOT have more than {{=$schema.length}} items'",
  additionalProperties: "'{{? it.opts._errorDataPathProperty }}is an invalid additional property{{??}}should NOT have additional properties{{?}}'",
  anyOf:           "'should match some schema in anyOf'",
  const:           "'should be equal to constant'",
  contains:        "'should contain a valid item'",
  dependencies:    "'should have {{? $deps.length == 1 }}property {{= it.util.escapeQuotes($deps[0]) }}{{??}}properties {{= it.util.escapeQuotes($deps.join(\", \")) }}{{?}} when property {{= it.util.escapeQuotes($property) }} is present'",
  'enum':          "'should be equal to one of the allowed values'",
  format:          "'should match format \"{{#def.concatSchemaEQ}}\"'",
  'if':            "'should match \"' + {{=$ifClause}} + '\" schema'",
  _limit:          "'should be {{=$opStr}} {{#def.appendSchema}}",
  _exclusiveLimit: "'{{=$exclusiveKeyword}} should be boolean'",
  _limitItems:     "'should NOT have {{?$keyword=='maxItems'}}more{{??}}fewer{{?}} than {{#def.concatSchema}} items'",
  _limitLength:    "'should NOT be {{?$keyword=='maxLength'}}longer{{??}}shorter{{?}} than {{#def.concatSchema}} characters'",
  _limitProperties:"'should NOT have {{?$keyword=='maxProperties'}}more{{??}}fewer{{?}} than {{#def.concatSchema}} properties'",
  multipleOf:      "'should be multiple of {{#def.appendSchema}}",
  not:             "'should NOT be valid'",
  oneOf:           "'should match exactly one schema in oneOf'",
  pattern:         "'should match pattern \"{{#def.concatSchemaEQ}}\"'",
  propertyNames:   "'property name \\'{{=$invalidName}}\\' is invalid'",
  required:        "'{{? it.opts._errorDataPathProperty }}is a required property{{??}}should have required property \\'{{=$missingProperty}}\\'{{?}}'",
  type:            "'should be {{? $typeIsArray }}{{= $typeSchema.join(\",\") }}{{??}}{{=$typeSchema}}{{?}}'",
  uniqueItems:     "'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)'",
  custom:          "'should pass \"{{=$rule.keyword}}\" keyword validation'",
  patternRequired: "'should have property matching pattern \\'{{=$missingPattern}}\\''",
  switch:          "'should pass \"switch\" keyword validation'",
  _formatLimit:    "'should be {{=$opStr}} \"{{#def.concatSchemaEQ}}\"'",
  _formatExclusiveLimit: "'{{=$exclusiveKeyword}} should be boolean'"
} #}}


{{## def.schemaRefOrVal: {{?$isData}}validate.schema{{=$schemaPath}}{{??}}{{=$schema}}{{?}} #}}
{{## def.schemaRefOrQS: {{?$isData}}validate.schema{{=$schemaPath}}{{??}}{{=it.util.toQuotedString($schema)}}{{?}} #}}

{{## def._errorSchemas = {
  'false schema':  "false",
  $ref:            "{{=it.util.toQuotedString($schema)}}",
  additionalItems: "false",
  additionalProperties: "false",
  anyOf:           "validate.schema{{=$schemaPath}}",
  const:           "validate.schema{{=$schemaPath}}",
  contains:        "validate.schema{{=$schemaPath}}",
  dependencies:    "validate.schema{{=$schemaPath}}",
  'enum':          "validate.schema{{=$schemaPath}}",
  format:          "{{#def.schemaRefOrQS}}",
  'if':            "validate.schema{{=$schemaPath}}",
  _limit:          "{{#def.schemaRefOrVal}}",
  _exclusiveLimit: "validate.schema{{=$schemaPath}}",
  _limitItems:     "{{#def.schemaRefOrVal}}",
  _limitLength:    "{{#def.schemaRefOrVal}}",
  _limitProperties:"{{#def.schemaRefOrVal}}",
  multipleOf:      "{{#def.schemaRefOrVal}}",
  not:             "validate.schema{{=$schemaPath}}",
  oneOf:           "validate.schema{{=$schemaPath}}",
  pattern:         "{{#def.schemaRefOrQS}}",
  propertyNames:   "validate.schema{{=$schemaPath}}",
  required:        "validate.schema{{=$schemaPath}}",
  type:            "validate.schema{{=$schemaPath}}",
  uniqueItems:     "{{#def.schemaRefOrVal}}",
  custom:          "validate.schema{{=$schemaPath}}",
  patternRequired: "validate.schema{{=$schemaPath}}",
  switch:          "validate.schema{{=$schemaPath}}",
  _formatLimit:    "{{#def.schemaRefOrQS}}",
  _formatExclusiveLimit: "validate.schema{{=$schemaPath}}"
} #}}


{{## def.schemaValueQS: {{?$isData}}{{=$schemaValue}}{{??}}{{=it.util.toQuotedString($schema)}}{{?}} #}}

{{## def._errorParams = {
  'false schema':  "{}",
  $ref:            "{ ref: '{{=it.util.escapeQuotes($schema)}}' }",
  additionalItems: "{ limit: {{=$schema.length}} }",
  additionalProperties: "{ additionalProperty: '{{=$additionalProperty}}' }",
  anyOf:           "{}",
  const:           "{ allowedValue: schema{{=$lvl}} }",
  contains:        "{}",
  dependencies:    "{ property: '{{= it.util.escapeQuotes($property) }}', missingProperty: '{{=$missingProperty}}', depsCount: {{=$deps.length}}, deps: '{{= it.util.escapeQuotes($deps.length==1 ? $deps[0] : $deps.join(\", \")) }}' }",
  'enum':          "{ allowedValues: schema{{=$lvl}} }",
  format:          "{ format: {{#def.schemaValueQS}} }",
  'if':            "{ failingKeyword: {{=$ifClause}} }",
  _limit:          "{ comparison: {{=$opExpr}}, limit: {{=$schemaValue}}, exclusive: {{=$exclusive}} }",
  _exclusiveLimit: "{}",
  _limitItems:     "{ limit: {{=$schemaValue}} }",
  _limitLength:    "{ limit: {{=$schemaValue}} }",
  _limitProperties:"{ limit: {{=$schemaValue}} }",
  multipleOf:      "{ multipleOf: {{=$schemaValue}} }",
  not:             "{}",
  oneOf:           "{ passingSchemas: {{=$passingSchemas}} }",
  pattern:         "{ pattern: {{#def.schemaValueQS}} }",
  propertyNames:   "{ propertyName: '{{=$invalidName}}' }",
  required:        "{ missingProperty: '{{=$missingProperty}}' }",
  type:            "{ type: '{{? $typeIsArray }}{{= $typeSchema.join(\",\") }}{{??}}{{=$typeSchema}}{{?}}' }",
  uniqueItems:     "{ i: i, j: j }",
  custom:          "{ keyword: '{{=$rule.keyword}}' }",
  patternRequired: "{ missingPattern: '{{=$missingPattern}}' }",
  switch:          "{ caseIndex: {{=$caseIndex}} }",
  _formatLimit:    "{ comparison: {{=$opExpr}}, limit: {{#def.schemaValueQS}}, exclusive: {{=$exclusive}} }",
  _formatExclusiveLimit: "{}"
} #}}
x@{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}

{{## def.skipFormat:
  {{? $breakOnError }} if (true) { {{?}}
  {{ return out; }}
#}}

{{? it.opts.format === false }}{{# def.skipFormat }}{{?}}


{{# def.$data }}


{{## def.$dataCheckFormat:
  {{# def.$dataNotType:'string' }}
  ({{? $unknownFormats != 'ignore' }}
     ({{=$schemaValue}} && !{{=$format}}
      {{? $allowUnknown }}
        && self._opts.unknownFormats.indexOf({{=$schemaValue}}) == -1
      {{?}}) ||
   {{?}}
   ({{=$format}} && {{=$formatType}} == '{{=$ruleType}}'
                 && !(typeof {{=$format}} == 'function'
                     ? {{? it.async}}
                        (async{{=$lvl}} ? await {{=$format}}({{=$data}}) : {{=$format}}({{=$data}}))
                       {{??}}
                        {{=$format}}({{=$data}})
                       {{?}}
                     : {{=$format}}.test({{=$data}}))))
#}}

{{## def.checkFormat:
  {{
    var $formatRef = 'formats' + it.util.getProperty($schema);
    if ($isObject) $formatRef += '.validate';
  }}
  {{? typeof $format == 'function' }}
    {{=$formatRef}}({{=$data}})
  {{??}}
    {{=$formatRef}}.test({{=$data}})
  {{?}}
#}}


{{
  var $unknownFormats = it.opts.unknownFormats
    , $allowUnknown = Array.isArray($unknownFormats);
}}

{{? $isData }}
  {{
    var $format = 'format' + $lvl
      , $isObject = 'isObject' + $lvl
      , $formatType = 'formatType' + $lvl;
  }}
  var {{=$format}} = formats[{{=$schemaValue}}];
  var {{=$isObject}} = typeof {{=$format}} == 'object'
                        && !({{=$format}} instanceof RegExp)
                        && {{=$format}}.validate;
  var {{=$formatType}} = {{=$isObject}} && {{=$format}}.type || 'string';
  if ({{=$isObject}}) {
    {{? it.async}}
      var async{{=$lvl}} = {{=$format}}.async;
    {{?}}
    {{=$format}} = {{=$format}}.validate;
  }
  if ({{# def.$dataCheckFormat }}) {
{{??}}
  {{ var $format = it.formats[$schema]; }}
  {{? !$format }}
    {{? $unknownFormats == 'ignore' }}
      {{ it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"'); }}
      {{# def.skipFormat }}
    {{?? $allowUnknown && $unknownFormats.indexOf($schema) >= 0 }}
      {{# def.skipFormat }}
    {{??}}
      {{ throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"'); }}
    {{?}}
  {{?}}
  {{
    var $isObject = typeof $format == 'object'
                    && !($format instanceof RegExp)
                    && $format.validate;
    var $formatType = $isObject && $format.type || 'string';
    if ($isObject) {
      var $async = $format.async === true;
      $format = $format.validate;
    }
  }}
  {{? $formatType != $ruleType }}
    {{# def.skipFormat }}
  {{?}}
  {{? $async }}
    {{
      if (!it.async) throw new Error('async format in sync schema');
      var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate';
    }}
    if (!(await {{=$formatRef}}({{=$data}}))) {
  {{??}}
    if (!{{# def.checkFormat }}) {
  {{?}}
{{?}}
    {{# def.error:'format' }}
  } {{? $breakOnError }} else { {{?}}
nGexR{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.setupNextLevel }}


{{## def.validateIfClause:_clause:
  {{
    $it.schema = it.schema['_clause'];
    $it.schemaPath = it.schemaPath + '._clause';
    $it.errSchemaPath = it.errSchemaPath + '/_clause';
  }}
  {{# def.insertSubschemaCode }}
  {{=$valid}} = {{=$nextValid}};
  {{? $thenPresent && $elsePresent }}
    {{ $ifClause = 'ifClause' + $lvl; }}
    var {{=$ifClause}} = '_clause';
  {{??}}
    {{ $ifClause = '\'_clause\''; }}
  {{?}}
#}}

{{
  var $thenSch = it.schema['then']
    , $elseSch = it.schema['else']
    , $thenPresent = $thenSch !== undefined && {{# def.nonEmptySchema:$thenSch }}
    , $elsePresent = $elseSch !== undefined && {{# def.nonEmptySchema:$elseSch }}
    , $currentBaseId = $it.baseId;
}}

{{? $thenPresent || $elsePresent }}
  {{
    var $ifClause;
    $it.createErrors = false;
    $it.schema = $schema;
    $it.schemaPath = $schemaPath;
    $it.errSchemaPath = $errSchemaPath;
  }}
  var {{=$errs}} = errors;
  var {{=$valid}} = true;

  {{# def.setCompositeRule }}
  {{# def.insertSubschemaCode }}
  {{ $it.createErrors = true; }}
  {{# def.resetErrors }}
  {{# def.resetCompositeRule }}

  {{? $thenPresent }}
    if ({{=$nextValid}}) {
      {{# def.validateIfClause:then }}
    }
    {{? $elsePresent }}
      else {
    {{?}}
  {{??}}
    if (!{{=$nextValid}}) {
  {{?}}

  {{? $elsePresent }}
      {{# def.validateIfClause:else }}
    }
  {{?}}

  if (!{{=$valid}}) {
    {{# def.extraError:'if' }}
  } 
  {{? $breakOnError }} else { {{?}}
{{??}}
  {{? $breakOnError }}
    if (true) {
  {{?}}
{{?}}

LKx2
{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.setupNextLevel }}


{{## def.validateItems:startFrom:
  for (var {{=$idx}} = {{=startFrom}}; {{=$idx}} < {{=$data}}.length; {{=$idx}}++) {
    {{
      $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);
      var $passData = $data + '[' + $idx + ']';
      $it.dataPathArr[$dataNxt] = $idx;
    }}

    {{# def.generateSubschemaCode }}
    {{# def.optimizeValidate }}

    {{? $breakOnError }}
      if (!{{=$nextValid}}) break;
    {{?}}
  }
#}}

{{
  var $idx = 'i' + $lvl
    , $dataNxt = $it.dataLevel = it.dataLevel + 1
    , $nextData = 'data' + $dataNxt
    , $currentBaseId = it.baseId;
}}

var {{=$errs}} = errors;
var {{=$valid}};

{{? Array.isArray($schema) }}
  {{ /* 'items' is an array of schemas */}}
  {{ var $additionalItems = it.schema.additionalItems; }}
  {{? $additionalItems === false }}
    {{=$valid}} = {{=$data}}.length <= {{= $schema.length }};
    {{
      var $currErrSchemaPath = $errSchemaPath;
      $errSchemaPath = it.errSchemaPath + '/additionalItems';      
    }}
    {{# def.checkError:'additionalItems' }}
    {{ $errSchemaPath = $currErrSchemaPath; }}
    {{# def.elseIfValid}}
  {{?}}

  {{~ $schema:$sch:$i }}
    {{? {{# def.nonEmptySchema:$sch }} }}
      {{=$nextValid}} = true;

      if ({{=$data}}.length > {{=$i}}) {
        {{
          var $passData = $data + '[' + $i + ']';
          $it.schema = $sch;
          $it.schemaPath = $schemaPath + '[' + $i + ']';
          $it.errSchemaPath = $errSchemaPath + '/' + $i;
          $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true);
          $it.dataPathArr[$dataNxt] = $i;
        }}

        {{# def.generateSubschemaCode }}
        {{# def.optimizeValidate }}
      }

      {{# def.ifResultValid }}
    {{?}}
  {{~}}

  {{? typeof $additionalItems == 'object' && {{# def.nonEmptySchema:$additionalItems }} }}
    {{
      $it.schema = $additionalItems;
      $it.schemaPath = it.schemaPath + '.additionalItems';
      $it.errSchemaPath = it.errSchemaPath + '/additionalItems';
    }}
    {{=$nextValid}} = true;

    if ({{=$data}}.length > {{= $schema.length }}) {
      {{# def.validateItems: $schema.length }}
    }

    {{# def.ifResultValid }}
  {{?}}

{{?? {{# def.nonEmptySchema:$schema }} }}
  {{ /* 'items' is a single schema */}}
  {{
    $it.schema = $schema;
    $it.schemaPath = $schemaPath;
    $it.errSchemaPath = $errSchemaPath;
  }}
  {{# def.validateItems: 0 }}
{{?}}

{{? $breakOnError }}
  {{= $closingBraces }}
  if ({{=$errs}} == errors) {
{{?}}
fW/JxU{{## def.checkMissingProperty:_properties:
  {{~ _properties:$propertyKey:$i }}
    {{?$i}} || {{?}}
    {{
      var $prop = it.util.getProperty($propertyKey)
        , $useData = $data + $prop;
    }}
    ( ({{# def.noPropertyInData }}) && (missing{{=$lvl}} = {{= it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop) }}) )
  {{~}}
#}}


{{## def.errorMissingProperty:_error:
  {{
    var $propertyPath = 'missing' + $lvl
      , $missingProperty = '\' + ' + $propertyPath + ' + \'';
    if (it.opts._errorDataPathProperty) {
      it.errorPath = it.opts.jsonPointers
                      ? it.util.getPathExpr($currentErrorPath,  $propertyPath, true)
                      : $currentErrorPath + ' + ' + $propertyPath;
    }
  }}
  {{# def.error:_error }}
#}}


{{## def.allErrorsMissingProperty:_error:
  {{
    var $prop = it.util.getProperty($propertyKey)
      , $missingProperty = it.util.escapeQuotes($propertyKey)
      , $useData = $data + $prop;
    if (it.opts._errorDataPathProperty) {
      it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
    }
  }}
  if ({{# def.noPropertyInData }}) {
    {{# def.addError:_error }}
  }
#}}
~ (x{{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.$data }}

{{# def.numberKeyword }}

var division{{=$lvl}};
if ({{?$isData}}
      {{=$schemaValue}} !== undefined && (
      typeof {{=$schemaValue}} != 'number' ||
    {{?}}
      (division{{=$lvl}} = {{=$data}} / {{=$schemaValue}},
      {{? it.opts.multipleOfPrecision }}
        Math.abs(Math.round(division{{=$lvl}}) - division{{=$lvl}}) > 1e-{{=it.opts.multipleOfPrecision}}
      {{??}}
        division{{=$lvl}} !== parseInt(division{{=$lvl}})
      {{?}}
      )
    {{?$isData}}  )  {{?}} ) {
  {{# def.error:'multipleOf' }}
} {{? $breakOnError }} else { {{?}}
5x]{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.setupNextLevel }}

{{? {{# def.nonEmptySchema:$schema }} }}
  {{
    $it.schema = $schema;
    $it.schemaPath = $schemaPath;
    $it.errSchemaPath = $errSchemaPath;
  }}

  var {{=$errs}} = errors;

  {{# def.setCompositeRule }}

  {{
    $it.createErrors = false;
    var $allErrorsOption;
    if ($it.opts.allErrors) {
      $allErrorsOption = $it.opts.allErrors;
      $it.opts.allErrors = false;
    }
  }}
  {{= it.validate($it) }}
  {{
    $it.createErrors = true;
    if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption;
  }}

  {{# def.resetCompositeRule }}

  if ({{=$nextValid}}) {
    {{# def.error:'not' }}
  } else {
    {{# def.resetErrors }}
  {{? it.opts.allErrors }} } {{?}}
{{??}}
  {{# def.addError:'not' }}
  {{? $breakOnError}}
    if (false) {
  {{?}}
{{?}}
kEGx~{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.setupNextLevel }}

{{
  var $currentBaseId = $it.baseId
    , $prevValid = 'prevValid' + $lvl
    , $passingSchemas = 'passingSchemas' + $lvl;
}}

var {{=$errs}} = errors
  , {{=$prevValid}} = false
  , {{=$valid}} = false
  , {{=$passingSchemas}} = null;

{{# def.setCompositeRule }}

{{~ $schema:$sch:$i }}
  {{? {{# def.nonEmptySchema:$sch }} }}
    {{
      $it.schema = $sch;
      $it.schemaPath = $schemaPath + '[' + $i + ']';
      $it.errSchemaPath = $errSchemaPath + '/' + $i;
    }}

    {{# def.insertSubschemaCode }}
  {{??}}
    var {{=$nextValid}} = true;
  {{?}}

  {{? $i }}
    if ({{=$nextValid}} && {{=$prevValid}}) {
      {{=$valid}} = false;
      {{=$passingSchemas}} = [{{=$passingSchemas}}, {{=$i}}];
    } else {
    {{ $closingBraces += '}'; }}
  {{?}}

    if ({{=$nextValid}}) {
      {{=$valid}} = {{=$prevValid}} = true;
      {{=$passingSchemas}} = {{=$i}};
    }
{{~}}

{{# def.resetCompositeRule }}

{{= $closingBraces }}

if (!{{=$valid}}) {
  {{# def.extraError:'oneOf' }}
} else {
  {{# def.resetErrors }}
{{? it.opts.allErrors }} } {{?}}
ͲoͰ$x@{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.$data }}

{{
  var $regExpCode = it.opts.regExp ? 'regExp' : 'new RegExp';
}}

{{? $isData }}
  var {{=$valid}} = true;
  try {
    {{=$valid}} = {{=$regExpCode}}({{=$schemaValue}}).test({{=$data}});
  } catch(e) {
    {{=$valid}} = false;
  }
  if ({{# def.$dataNotType:'string' }} !{{=$valid}}) {
{{??}}
  {{
    var $regexp = it.usePattern($schema);
  }}
  if ({{# def.$dataNotType:'string' }} !{{=$regexp}}.test({{=$data}}) ) {
{{?}}
  {{# def.error:'pattern' }}
} {{? $breakOnError }} else { {{?}}
iJx-{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.setupNextLevel }}


{{## def.validateAdditional:
  {{ /* additionalProperties is schema */
    $it.schema = $aProperties;
    $it.schemaPath = it.schemaPath + '.additionalProperties';
    $it.errSchemaPath = it.errSchemaPath + '/additionalProperties';
    $it.errorPath = it.opts._errorDataPathProperty
                    ? it.errorPath
                    : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
    var $passData = $data + '[' + $key + ']';
    $it.dataPathArr[$dataNxt] = $key;
  }}

  {{# def.generateSubschemaCode }}
  {{# def.optimizeValidate }}
#}}


{{
  var $key = 'key' + $lvl
    , $idx = 'idx' + $lvl
    , $dataNxt = $it.dataLevel = it.dataLevel + 1
    , $nextData = 'data' + $dataNxt
    , $dataProperties = 'dataProperties' + $lvl;

  var $schemaKeys = Object.keys($schema || {}).filter(notProto)
    , $pProperties = it.schema.patternProperties || {}
    , $pPropertyKeys = Object.keys($pProperties).filter(notProto)
    , $aProperties = it.schema.additionalProperties
    , $someProperties = $schemaKeys.length || $pPropertyKeys.length
    , $noAdditional = $aProperties === false
    , $additionalIsSchema = typeof $aProperties == 'object'
                              && Object.keys($aProperties).length
    , $removeAdditional = it.opts.removeAdditional
    , $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional
    , $ownProperties = it.opts.ownProperties
    , $currentBaseId = it.baseId;

  var $required = it.schema.required;
  if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) {
    var $requiredHash = it.util.toHash($required);
  }

  function notProto(p) { return p !== '__proto__'; }
}}


var {{=$errs}} = errors;
var {{=$nextValid}} = true;
{{? $ownProperties }}
  var {{=$dataProperties}} = undefined;
{{?}}

{{? $checkAdditional }}
  {{# def.iterateProperties }}
    {{? $someProperties }}
      var isAdditional{{=$lvl}} = !(false
        {{? $schemaKeys.length }}
          {{? $schemaKeys.length > 8 }}
            || validate.schema{{=$schemaPath}}.hasOwnProperty({{=$key}})
          {{??}}
            {{~ $schemaKeys:$propertyKey }}
              || {{=$key}} == {{= it.util.toQuotedString($propertyKey) }}
            {{~}}
          {{?}}
        {{?}}
        {{? $pPropertyKeys.length }}
          {{~ $pPropertyKeys:$pProperty:$i }}
            || {{= it.usePattern($pProperty) }}.test({{=$key}})
          {{~}}
        {{?}}
      );

      if (isAdditional{{=$lvl}}) {
    {{?}}
    {{? $removeAdditional == 'all' }}
      delete {{=$data}}[{{=$key}}];
    {{??}}
      {{
        var $currentErrorPath = it.errorPath;
        var $additionalProperty = '\' + ' + $key + ' + \'';
        if (it.opts._errorDataPathProperty) {
          it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
        }
      }}
      {{? $noAdditional }}
        {{? $removeAdditional }}
          delete {{=$data}}[{{=$key}}];
        {{??}}
          {{=$nextValid}} = false;
          {{
            var $currErrSchemaPath = $errSchemaPath;
            $errSchemaPath = it.errSchemaPath + '/additionalProperties';
          }}
          {{# def.error:'additionalProperties' }}
          {{ $errSchemaPath = $currErrSchemaPath; }}
          {{? $breakOnError }} break; {{?}}
        {{?}}
      {{?? $additionalIsSchema }}
        {{? $removeAdditional == 'failing' }}
          var {{=$errs}} = errors;
          {{# def.setCompositeRule }}

          {{# def.validateAdditional }}

          if (!{{=$nextValid}}) {
            errors = {{=$errs}};
            if (validate.errors !== null) {
              if (errors) validate.errors.length = errors;
              else validate.errors = null;
            }
            delete {{=$data}}[{{=$key}}];
          }

          {{# def.resetCompositeRule }}
        {{??}}
          {{# def.validateAdditional }}
          {{? $breakOnError }} if (!{{=$nextValid}}) break; {{?}}
        {{?}}
      {{?}}
      {{ it.errorPath = $currentErrorPath; }}
    {{?}}
    {{? $someProperties }}
      }
    {{?}}
  }

  {{# def.ifResultValid }}
{{?}}

{{ var $useDefaults = it.opts.useDefaults && !it.compositeRule; }}

{{? $schemaKeys.length }}
  {{~ $schemaKeys:$propertyKey }}
    {{ var $sch = $schema[$propertyKey]; }}

    {{? {{# def.nonEmptySchema:$sch}} }}
      {{
        var $prop = it.util.getProperty($propertyKey)
          , $passData = $data + $prop
          , $hasDefault = $useDefaults && $sch.default !== undefined;
        $it.schema = $sch;
        $it.schemaPath = $schemaPath + $prop;
        $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey);
        $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers);
        $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey);
      }}

      {{# def.generateSubschemaCode }}

      {{? {{# def.willOptimize }} }}
        {{
          $code = {{# def._optimizeValidate }};
          var $useData = $passData;
        }}
      {{??}}
        {{ var $useData = $nextData; }}
        var {{=$nextData}} = {{=$passData}};
      {{?}}

      {{? $hasDefault }}
        {{= $code }}
      {{??}}
        {{? $requiredHash && $requiredHash[$propertyKey] }}
          if ({{# def.noPropertyInData }}) {
            {{=$nextValid}} = false;
            {{
              var $currentErrorPath = it.errorPath
                , $currErrSchemaPath = $errSchemaPath
                , $missingProperty = it.util.escapeQuotes($propertyKey);
              if (it.opts._errorDataPathProperty) {
                it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
              }
              $errSchemaPath = it.errSchemaPath + '/required';
            }}
            {{# def.error:'required' }}
            {{ $errSchemaPath = $currErrSchemaPath; }}
            {{ it.errorPath = $currentErrorPath; }}
          } else {
        {{??}}
          {{? $breakOnError }}
            if ({{# def.noPropertyInData }}) {
              {{=$nextValid}} = true;
            } else {
          {{??}}
            if ({{=$useData}} !== undefined
              {{? $ownProperties }}
                && {{# def.isOwnProperty }}
              {{?}}
            ) {
          {{?}}
        {{?}}

          {{= $code }}
        }
      {{?}}  {{ /* $hasDefault */ }}
    {{?}} {{ /* def.nonEmptySchema */ }}

    {{# def.ifResultValid }}
  {{~}}
{{?}}

{{? $pPropertyKeys.length }}
  {{~ $pPropertyKeys:$pProperty }}
    {{ var $sch = $pProperties[$pProperty]; }}

    {{? {{# def.nonEmptySchema:$sch}} }}
      {{
        $it.schema = $sch;
        $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty);
        $it.errSchemaPath = it.errSchemaPath + '/patternProperties/'
                                             + it.util.escapeFragment($pProperty);
      }}

      {{# def.iterateProperties }}
        if ({{= it.usePattern($pProperty) }}.test({{=$key}})) {
          {{
            $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
            var $passData = $data + '[' + $key + ']';
            $it.dataPathArr[$dataNxt] = $key;
          }}

          {{# def.generateSubschemaCode }}
          {{# def.optimizeValidate }}

          {{? $breakOnError }} if (!{{=$nextValid}}) break; {{?}}
        }
        {{? $breakOnError }} else {{=$nextValid}} = true; {{?}}
      }

      {{# def.ifResultValid }}
    {{?}} {{ /* def.nonEmptySchema */ }}
  {{~}}
{{?}}


{{? $breakOnError }}
  {{= $closingBraces }}
  if ({{=$errs}} == errors) {
{{?}}
v&Px{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.setupNextLevel }}

var {{=$errs}} = errors;

{{? {{# def.nonEmptySchema:$schema }} }}
  {{
    $it.schema = $schema;
    $it.schemaPath = $schemaPath;
    $it.errSchemaPath = $errSchemaPath;
  }}

  {{
    var $key = 'key' + $lvl
      , $idx = 'idx' + $lvl
      , $i = 'i' + $lvl
      , $invalidName = '\' + ' + $key + ' + \''
      , $dataNxt = $it.dataLevel = it.dataLevel + 1
      , $nextData = 'data' + $dataNxt
      , $dataProperties = 'dataProperties' + $lvl
      , $ownProperties = it.opts.ownProperties
      , $currentBaseId = it.baseId;
  }}

  {{? $ownProperties }}
    var {{=$dataProperties}} = undefined;
  {{?}}
  {{# def.iterateProperties }}
    var startErrs{{=$lvl}} = errors;

    {{ var $passData = $key; }}
    {{# def.setCompositeRule }}
    {{# def.generateSubschemaCode }}
    {{# def.optimizeValidate }}
    {{# def.resetCompositeRule }}

    if (!{{=$nextValid}}) {
      for (var {{=$i}}=startErrs{{=$lvl}}; {{=$i}}<errors; {{=$i}}++) {
        vErrors[{{=$i}}].propertyName = {{=$key}};
      }
      {{# def.extraError:'propertyNames' }}
      {{? $breakOnError }} break; {{?}}
    }
  }
{{?}}

{{? $breakOnError }}
  {{= $closingBraces }}
  if ({{=$errs}} == errors) {
{{?}}
$SFx	i{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}

{{## def._validateRef:_v:
  {{? it.opts.passContext }}
    {{=_v}}.call(this,
  {{??}}
    {{=_v}}(
  {{?}}
    {{=$data}}, {{# def.dataPath }}{{# def.passParentData }}, rootData)
#}}

{{ var $async, $refCode; }}
{{? $schema == '#' || $schema == '#/' }}
  {{
    if (it.isRoot) {
      $async = it.async;
      $refCode = 'validate';
    } else {
      $async = it.root.schema.$async === true;
      $refCode = 'root.refVal[0]';
    }
  }}
{{??}}
  {{ var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot); }}
  {{? $refVal === undefined }}
    {{ var $message = it.MissingRefError.message(it.baseId, $schema); }}
    {{? it.opts.missingRefs == 'fail' }}
      {{ it.logger.error($message); }}
      {{# def.error:'$ref' }}
      {{? $breakOnError }} if (false) { {{?}}
    {{?? it.opts.missingRefs == 'ignore' }}
      {{ it.logger.warn($message); }}
      {{? $breakOnError }} if (true) { {{?}}
    {{??}}
      {{ throw new it.MissingRefError(it.baseId, $schema, $message); }}
    {{?}}
  {{?? $refVal.inline }}
    {{# def.setupNextLevel }}
    {{
      $it.schema = $refVal.schema;
      $it.schemaPath = '';
      $it.errSchemaPath = $schema;
    }}
    {{ var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code); }}
    {{= $code }}
    {{? $breakOnError}}
      if ({{=$nextValid}}) {
    {{?}}
  {{??}}
    {{
      $async = $refVal.$async === true || (it.async && $refVal.$async !== false);
      $refCode = $refVal.code;
    }}
  {{?}}
{{?}}

{{? $refCode }}
  {{# def.beginDefOut}}
    {{# def._validateRef:$refCode }}
  {{# def.storeDefOut:__callValidate }}

  {{? $async }}
    {{ if (!it.async) throw new Error('async schema referenced by sync schema'); }}
    {{? $breakOnError }} var {{=$valid}}; {{?}}
    try {
      await {{=__callValidate}};
      {{? $breakOnError }} {{=$valid}} = true; {{?}}
    } catch (e) {
      if (!(e instanceof ValidationError)) throw e;
      if (vErrors === null) vErrors = e.errors;
      else vErrors = vErrors.concat(e.errors);
      errors = vErrors.length;
      {{? $breakOnError }} {{=$valid}} = false; {{?}}
    }
    {{? $breakOnError }} if ({{=$valid}}) { {{?}}
  {{??}}
    if (!{{=__callValidate}}) {
      if (vErrors === null) vErrors = {{=$refCode}}.errors;
      else vErrors = vErrors.concat({{=$refCode}}.errors);
      errors = vErrors.length;
    } {{? $breakOnError }} else { {{?}}
  {{?}}
{{?}}
n'Դx4{{# def.definitions }}
{{# def.errors }}
{{# def.missing }}
{{# def.setupKeyword }}
{{# def.$data }}

{{ var $vSchema = 'schema' + $lvl; }}

{{## def.setupLoop:
  {{? !$isData }}
    var {{=$vSchema}} = validate.schema{{=$schemaPath}};
  {{?}}

  {{
    var $i = 'i' + $lvl
      , $propertyPath = 'schema' + $lvl + '[' + $i + ']'
      , $missingProperty = '\' + ' + $propertyPath + ' + \'';
    if (it.opts._errorDataPathProperty) {
      it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);
    }
  }}
#}}


{{## def.isRequiredOwnProperty:
  Object.prototype.hasOwnProperty.call({{=$data}}, {{=$vSchema}}[{{=$i}}])
#}}


{{? !$isData }}
  {{? $schema.length < it.opts.loopRequired &&
      it.schema.properties && Object.keys(it.schema.properties).length }}
    {{ var $required = []; }}
    {{~ $schema:$property }}
      {{ var $propertySch = it.schema.properties[$property]; }}
      {{? !($propertySch && {{# def.nonEmptySchema:$propertySch}}) }}
        {{ $required[$required.length] = $property; }}
      {{?}}
    {{~}}
  {{??}}
    {{ var $required = $schema; }}
  {{?}}
{{?}}


{{? $isData || $required.length }}
  {{
    var $currentErrorPath = it.errorPath
      , $loopRequired = $isData || $required.length >= it.opts.loopRequired
      , $ownProperties = it.opts.ownProperties;
  }}

  {{? $breakOnError }}
    var missing{{=$lvl}};
    {{? $loopRequired }}
      {{# def.setupLoop }}
      var {{=$valid}} = true;

      {{?$isData}}{{# def.check$dataIsArray }}{{?}}

      for (var {{=$i}} = 0; {{=$i}} < {{=$vSchema}}.length; {{=$i}}++) {
        {{=$valid}} = {{=$data}}[{{=$vSchema}}[{{=$i}}]] !== undefined
                      {{? $ownProperties }}
                        && {{# def.isRequiredOwnProperty }}
                      {{?}};
        if (!{{=$valid}}) break;
      }

      {{? $isData }}  }  {{?}}

      {{# def.checkError:'required' }}
      else {
    {{??}}
      if ({{# def.checkMissingProperty:$required }}) {
        {{# def.errorMissingProperty:'required' }}
      } else {
    {{?}}
  {{??}}
    {{? $loopRequired }}
      {{# def.setupLoop }}
      {{? $isData }}
        if ({{=$vSchema}} && !Array.isArray({{=$vSchema}})) {
          {{# def.addError:'required' }}
        } else if ({{=$vSchema}} !== undefined) {
      {{?}}

      for (var {{=$i}} = 0; {{=$i}} < {{=$vSchema}}.length; {{=$i}}++) {
        if ({{=$data}}[{{=$vSchema}}[{{=$i}}]] === undefined
            {{? $ownProperties }}
              || !{{# def.isRequiredOwnProperty }}
            {{?}}) {
          {{# def.addError:'required' }}
        }
      }

      {{? $isData }}  }  {{?}}
    {{??}}
      {{~ $required:$propertyKey }}
        {{# def.allErrorsMissingProperty:'required' }}
      {{~}}
    {{?}}
  {{?}}

  {{ it.errorPath = $currentErrorPath; }}

{{?? $breakOnError }}
  if (true) {
{{?}}
5~߰jx_{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.$data }}


{{? ($schema || $isData) && it.opts.uniqueItems !== false }}
  {{? $isData }}
    var {{=$valid}};
    if ({{=$schemaValue}} === false || {{=$schemaValue}} === undefined)
      {{=$valid}} = true;
    else if (typeof {{=$schemaValue}} != 'boolean')
      {{=$valid}} = false;
    else {
  {{?}}

  var i = {{=$data}}.length
    , {{=$valid}} = true
    , j;
  if (i > 1) {
    {{
      var $itemType = it.schema.items && it.schema.items.type
        , $typeIsArray = Array.isArray($itemType);
    }}
    {{? !$itemType || $itemType == 'object' || $itemType == 'array' ||
        ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0)) }}
      outer:
      for (;i--;) {
        for (j = i; j--;) {
          if (equal({{=$data}}[i], {{=$data}}[j])) {
            {{=$valid}} = false;
            break outer;
          }
        }
      }
    {{??}}
      var itemIndices = {}, item;
      for (;i--;) {
        var item = {{=$data}}[i];
        {{ var $method = 'checkDataType' + ($typeIsArray ? 's' : ''); }}
        if ({{= it.util[$method]($itemType, 'item', it.opts.strictNumbers, true) }}) continue;
        {{? $typeIsArray}}
          if (typeof item == 'string') item = '"' + item;
        {{?}}
        if (typeof itemIndices[item] == 'number') {
          {{=$valid}} = false;
          j = itemIndices[item];
          break;
        }
        itemIndices[item] = i;
      }
    {{?}}
  }

  {{? $isData }}  }  {{?}}

  if (!{{=$valid}}) {
    {{# def.error:'uniqueItems' }}
  } {{? $breakOnError }} else { {{?}}
{{??}}
  {{? $breakOnError }} if (true) { {{?}}
{{?}}
~0x%{{# def.definitions }}
{{# def.errors }}
{{# def.defaults }}
{{# def.coerce }}

{{ /**
    * schema compilation (render) time:
    * it = { schema, RULES, _validate, opts }
    * it.validate - this template function,
    *   it is used recursively to generate code for subschemas
    *
    * runtime:
    * "validate" is a variable name to which this function will be assigned
    * validateRef etc. are defined in the parent scope in index.js
    */ }}

{{
  var $async = it.schema.$async === true
    , $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref')
    , $id = it.self._getId(it.schema);
}}

{{
  if (it.opts.strictKeywords) {
    var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords);
    if ($unknownKwd) {
      var $keywordsMsg = 'unknown keyword: ' + $unknownKwd;
      if (it.opts.strictKeywords === 'log') it.logger.warn($keywordsMsg);
      else throw new Error($keywordsMsg);
    }
  }
}}

{{? it.isTop }}
  var validate = {{?$async}}{{it.async = true;}}async {{?}}function(data, dataPath, parentData, parentDataProperty, rootData) {
    'use strict';
    {{? $id && (it.opts.sourceCode || it.opts.processCode) }}
      {{= '/\*# sourceURL=' + $id + ' */' }}
    {{?}}
{{?}}

{{? typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref) }}
  {{ var $keyword = 'false schema'; }}
  {{# def.setupKeyword }}
  {{? it.schema === false}}
    {{? it.isTop}}
      {{ $breakOnError = true; }}
    {{??}}
      var {{=$valid}} = false;
    {{?}}
    {{# def.error:'false schema' }}
  {{??}}
    {{? it.isTop}}
      {{? $async }}
        return data;
      {{??}}
        validate.errors = null;
        return true;
      {{?}}
    {{??}}
      var {{=$valid}} = true;
    {{?}}
  {{?}}

  {{? it.isTop}}
    };
    return validate;
  {{?}}

  {{ return out; }}
{{?}}


{{? it.isTop }}
  {{
    var $top = it.isTop
      , $lvl = it.level = 0
      , $dataLvl = it.dataLevel = 0
      , $data = 'data';
    it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema));
    it.baseId = it.baseId || it.rootId;
    delete it.isTop;

    it.dataPathArr = [""];

    if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) {
      var $defaultMsg = 'default is ignored in the schema root';
      if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);
      else throw new Error($defaultMsg);
    }
  }}

  var vErrors = null; {{ /* don't edit, used in replace */ }}
  var errors = 0;     {{ /* don't edit, used in replace */ }}
  if (rootData === undefined) rootData = data; {{ /* don't edit, used in replace */ }}
{{??}}
  {{
    var $lvl = it.level
      , $dataLvl = it.dataLevel
      , $data = 'data' + ($dataLvl || '');

    if ($id) it.baseId = it.resolve.url(it.baseId, $id);

    if ($async && !it.async) throw new Error('async schema in sync schema');
  }}

  var errs_{{=$lvl}} = errors;
{{?}}

{{
  var $valid = 'valid' + $lvl
    , $breakOnError = !it.opts.allErrors
    , $closingBraces1 = ''
    , $closingBraces2 = '';

  var $errorKeyword;
  var $typeSchema = it.schema.type
    , $typeIsArray = Array.isArray($typeSchema);

  if ($typeSchema && it.opts.nullable && it.schema.nullable === true) {
    if ($typeIsArray) {
      if ($typeSchema.indexOf('null') == -1)
        $typeSchema = $typeSchema.concat('null');
    } else if ($typeSchema != 'null') {
      $typeSchema = [$typeSchema, 'null'];
      $typeIsArray = true;
    }
  }

  if ($typeIsArray && $typeSchema.length == 1) {
    $typeSchema = $typeSchema[0];
    $typeIsArray = false;
  }
}}

{{## def.checkType:
  {{
    var $schemaPath = it.schemaPath + '.type'
      , $errSchemaPath = it.errSchemaPath + '/type'
      , $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType';
  }}

  if ({{= it.util[$method]($typeSchema, $data, it.opts.strictNumbers, true) }}) {
#}}

{{? it.schema.$ref && $refKeywords }}
  {{? it.opts.extendRefs == 'fail' }}
    {{ throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)'); }}
  {{?? it.opts.extendRefs !== true }}
    {{
      $refKeywords = false;
      it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"');
    }}
  {{?}}
{{?}}

{{? it.schema.$comment && it.opts.$comment }}
  {{= it.RULES.all.$comment.code(it, '$comment') }}
{{?}}

{{? $typeSchema }}
  {{? it.opts.coerceTypes }}
    {{ var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema); }}
  {{?}}

  {{ var $rulesGroup = it.RULES.types[$typeSchema]; }}
  {{? $coerceToTypes || $typeIsArray || $rulesGroup === true ||
    ($rulesGroup && !$shouldUseGroup($rulesGroup)) }}
    {{
      var $schemaPath = it.schemaPath + '.type'
        , $errSchemaPath = it.errSchemaPath + '/type';
    }}
    {{# def.checkType }}
      {{? $coerceToTypes }}
        {{# def.coerceType }}
      {{??}}
        {{# def.error:'type' }}
      {{?}}
    }
  {{?}}
{{?}}


{{? it.schema.$ref && !$refKeywords }}
  {{= it.RULES.all.$ref.code(it, '$ref') }}
  {{? $breakOnError }}
    }
    if (errors === {{?$top}}0{{??}}errs_{{=$lvl}}{{?}}) {
    {{ $closingBraces2 += '}'; }}
  {{?}}
{{??}}
  {{~ it.RULES:$rulesGroup }}
    {{? $shouldUseGroup($rulesGroup) }}
      {{? $rulesGroup.type }}
        if ({{= it.util.checkDataType($rulesGroup.type, $data, it.opts.strictNumbers) }}) {
      {{?}}
        {{? it.opts.useDefaults }}
          {{? $rulesGroup.type == 'object' && it.schema.properties }}
            {{# def.defaultProperties }}
          {{?? $rulesGroup.type == 'array' && Array.isArray(it.schema.items) }}
            {{# def.defaultItems }}
          {{?}}
        {{?}}
        {{~ $rulesGroup.rules:$rule }}
          {{? $shouldUseRule($rule) }}
            {{ var $code = $rule.code(it, $rule.keyword, $rulesGroup.type); }}
            {{? $code }}
              {{= $code }}
              {{? $breakOnError }}
                {{ $closingBraces1 += '}'; }}
              {{?}}
            {{?}}
          {{?}}
        {{~}}
        {{? $breakOnError }}
          {{= $closingBraces1 }}
          {{ $closingBraces1 = ''; }}
        {{?}}
      {{? $rulesGroup.type }}
        }
        {{? $typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes }}
          else {
            {{
              var $schemaPath = it.schemaPath + '.type'
                , $errSchemaPath = it.errSchemaPath + '/type';
            }}
            {{# def.error:'type' }}
          }
        {{?}}
      {{?}}

      {{? $breakOnError }}
        if (errors === {{?$top}}0{{??}}errs_{{=$lvl}}{{?}}) {
        {{ $closingBraces2 += '}'; }}
      {{?}}
    {{?}}
  {{~}}
{{?}}

{{? $breakOnError }} {{= $closingBraces2 }} {{?}}

{{? $top }}
    {{? $async }}
      if (errors === 0) return data;           {{ /* don't edit, used in replace */ }}
      else throw new ValidationError(vErrors); {{ /* don't edit, used in replace */ }}
    {{??}}
      validate.errors = vErrors; {{ /* don't edit, used in replace */ }}
      return errors === 0;       {{ /* don't edit, used in replace */ }}
    {{?}}
  };

  return validate;
{{??}}
  var {{=$valid}} = errors === errs_{{=$lvl}};
{{?}}

{{
  function $shouldUseGroup($rulesGroup) {
    var rules = $rulesGroup.rules;
    for (var i=0; i < rules.length; i++)
      if ($shouldUseRule(rules[i]))
        return true;
  }

  function $shouldUseRule($rule) {
    return it.schema[$rule.keyword] !== undefined ||
           ($rule.implements && $ruleImplementsSomeKeyword($rule));
  }

  function $ruleImplementsSomeKeyword($rule) {
    var impl = $rule.implements;
    for (var i=0; i < impl.length; i++)
      if (it.schema[impl[i]] !== undefined)
        return true;
  }
}}
 M@x100644 README.md MHFcЏ4R|R100644 _limit.js ˎ*	:&z100644 _limitItems.js Y
z-5Zm100644 _limitLength.js ?o4g$<3~#W100644 _limitProperties.js 2uZвԼMԿ8fO100644 allOf.js .K No	100644 anyOf.js  +[KJJ2,100644 comment.js fJ"H.54X100644 const.js PiaX>HW100644 contains.js }v0	:$|&Z100644 custom.js ApFT8=~100644 dependencies.js 䂔r|}EJu100644 enum.js XSrڴj)hb100644 format.js ͚V63hP100644 if.js zSmVDg100644 index.js /gȜqY100644 items.js }FT
ձUL100644 multipleOf.js d#h6100644 not.js x[q)<)Q*A100644 oneOf.js UK*s`"0.-T100644 pattern.js ~.;p;ٻ/S100644 properties.js ^Tx	ѷFS_j\~100644 propertyNames.js *TEI_$`?{100644 ref.js BxPfPHt\B100644 required.js >=R9
i+X1&100644 uniqueItems.js 6#3 <<u[100644 validate.js K%*fGo!	x jThese files are compiled dot templates from dot folder.

Do NOT edit them directly, edit the templates and run `npm run build` from main ajv folder.
4x'use strict';
module.exports = function generate__limit(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $errorKeyword;
  var $data = 'data' + ($dataLvl || '');
  var $isData = it.opts.$data && $schema && $schema.$data,
    $schemaValue;
  if ($isData) {
    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
    $schemaValue = 'schema' + $lvl;
  } else {
    $schemaValue = $schema;
  }
  var $isMax = $keyword == 'maximum',
    $exclusiveKeyword = $isMax ? 'exclusiveMaximum' : 'exclusiveMinimum',
    $schemaExcl = it.schema[$exclusiveKeyword],
    $isDataExcl = it.opts.$data && $schemaExcl && $schemaExcl.$data,
    $op = $isMax ? '<' : '>',
    $notOp = $isMax ? '>' : '<',
    $errorKeyword = undefined;
  if (!($isData || typeof $schema == 'number' || $schema === undefined)) {
    throw new Error($keyword + ' must be number');
  }
  if (!($isDataExcl || $schemaExcl === undefined || typeof $schemaExcl == 'number' || typeof $schemaExcl == 'boolean')) {
    throw new Error($exclusiveKeyword + ' must be number or boolean');
  }
  if ($isDataExcl) {
    var $schemaValueExcl = it.util.getData($schemaExcl.$data, $dataLvl, it.dataPathArr),
      $exclusive = 'exclusive' + $lvl,
      $exclType = 'exclType' + $lvl,
      $exclIsNumber = 'exclIsNumber' + $lvl,
      $opExpr = 'op' + $lvl,
      $opStr = '\' + ' + $opExpr + ' + \'';
    out += ' var schemaExcl' + ($lvl) + ' = ' + ($schemaValueExcl) + '; ';
    $schemaValueExcl = 'schemaExcl' + $lvl;
    out += ' var ' + ($exclusive) + '; var ' + ($exclType) + ' = typeof ' + ($schemaValueExcl) + '; if (' + ($exclType) + ' != \'boolean\' && ' + ($exclType) + ' != \'undefined\' && ' + ($exclType) + ' != \'number\') { ';
    var $errorKeyword = $exclusiveKeyword;
    var $$outStack = $$outStack || [];
    $$outStack.push(out);
    out = ''; /* istanbul ignore else */
    if (it.createErrors !== false) {
      out += ' { keyword: \'' + ($errorKeyword || '_exclusiveLimit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
      if (it.opts.messages !== false) {
        out += ' , message: \'' + ($exclusiveKeyword) + ' should be boolean\' ';
      }
      if (it.opts.verbose) {
        out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
      }
      out += ' } ';
    } else {
      out += ' {} ';
    }
    var __err = out;
    out = $$outStack.pop();
    if (!it.compositeRule && $breakOnError) {
      /* istanbul ignore if */
      if (it.async) {
        out += ' throw new ValidationError([' + (__err) + ']); ';
      } else {
        out += ' validate.errors = [' + (__err) + ']; return false; ';
      }
    } else {
      out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
    }
    out += ' } else if ( ';
    if ($isData) {
      out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
    }
    out += ' ' + ($exclType) + ' == \'number\' ? ( (' + ($exclusive) + ' = ' + ($schemaValue) + ' === undefined || ' + ($schemaValueExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ') ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValueExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) : ( (' + ($exclusive) + ' = ' + ($schemaValueExcl) + ' === true) ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaValue) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { var op' + ($lvl) + ' = ' + ($exclusive) + ' ? \'' + ($op) + '\' : \'' + ($op) + '=\'; ';
    if ($schema === undefined) {
      $errorKeyword = $exclusiveKeyword;
      $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;
      $schemaValue = $schemaValueExcl;
      $isData = $isDataExcl;
    }
  } else {
    var $exclIsNumber = typeof $schemaExcl == 'number',
      $opStr = $op;
    if ($exclIsNumber && $isData) {
      var $opExpr = '\'' + $opStr + '\'';
      out += ' if ( ';
      if ($isData) {
        out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
      }
      out += ' ( ' + ($schemaValue) + ' === undefined || ' + ($schemaExcl) + ' ' + ($op) + '= ' + ($schemaValue) + ' ? ' + ($data) + ' ' + ($notOp) + '= ' + ($schemaExcl) + ' : ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' ) || ' + ($data) + ' !== ' + ($data) + ') { ';
    } else {
      if ($exclIsNumber && $schema === undefined) {
        $exclusive = true;
        $errorKeyword = $exclusiveKeyword;
        $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;
        $schemaValue = $schemaExcl;
        $notOp += '=';
      } else {
        if ($exclIsNumber) $schemaValue = Math[$isMax ? 'min' : 'max']($schemaExcl, $schema);
        if ($schemaExcl === ($exclIsNumber ? $schemaValue : true)) {
          $exclusive = true;
          $errorKeyword = $exclusiveKeyword;
          $errSchemaPath = it.errSchemaPath + '/' + $exclusiveKeyword;
          $notOp += '=';
        } else {
          $exclusive = false;
          $opStr += '=';
        }
      }
      var $opExpr = '\'' + $opStr + '\'';
      out += ' if ( ';
      if ($isData) {
        out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
      }
      out += ' ' + ($data) + ' ' + ($notOp) + ' ' + ($schemaValue) + ' || ' + ($data) + ' !== ' + ($data) + ') { ';
    }
  }
  $errorKeyword = $errorKeyword || $keyword;
  var $$outStack = $$outStack || [];
  $$outStack.push(out);
  out = ''; /* istanbul ignore else */
  if (it.createErrors !== false) {
    out += ' { keyword: \'' + ($errorKeyword || '_limit') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { comparison: ' + ($opExpr) + ', limit: ' + ($schemaValue) + ', exclusive: ' + ($exclusive) + ' } ';
    if (it.opts.messages !== false) {
      out += ' , message: \'should be ' + ($opStr) + ' ';
      if ($isData) {
        out += '\' + ' + ($schemaValue);
      } else {
        out += '' + ($schemaValue) + '\'';
      }
    }
    if (it.opts.verbose) {
      out += ' , schema:  ';
      if ($isData) {
        out += 'validate.schema' + ($schemaPath);
      } else {
        out += '' + ($schema);
      }
      out += '         , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
    }
    out += ' } ';
  } else {
    out += ' {} ';
  }
  var __err = out;
  out = $$outStack.pop();
  if (!it.compositeRule && $breakOnError) {
    /* istanbul ignore if */
    if (it.async) {
      out += ' throw new ValidationError([' + (__err) + ']); ';
    } else {
      out += ' validate.errors = [' + (__err) + ']; return false; ';
    }
  } else {
    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  }
  out += ' } ';
  if ($breakOnError) {
    out += ' else { ';
  }
  return out;
}
|!x
o'use strict';
module.exports = function generate__limitItems(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $errorKeyword;
  var $data = 'data' + ($dataLvl || '');
  var $isData = it.opts.$data && $schema && $schema.$data,
    $schemaValue;
  if ($isData) {
    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
    $schemaValue = 'schema' + $lvl;
  } else {
    $schemaValue = $schema;
  }
  if (!($isData || typeof $schema == 'number')) {
    throw new Error($keyword + ' must be number');
  }
  var $op = $keyword == 'maxItems' ? '>' : '<';
  out += 'if ( ';
  if ($isData) {
    out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
  }
  out += ' ' + ($data) + '.length ' + ($op) + ' ' + ($schemaValue) + ') { ';
  var $errorKeyword = $keyword;
  var $$outStack = $$outStack || [];
  $$outStack.push(out);
  out = ''; /* istanbul ignore else */
  if (it.createErrors !== false) {
    out += ' { keyword: \'' + ($errorKeyword || '_limitItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';
    if (it.opts.messages !== false) {
      out += ' , message: \'should NOT have ';
      if ($keyword == 'maxItems') {
        out += 'more';
      } else {
        out += 'fewer';
      }
      out += ' than ';
      if ($isData) {
        out += '\' + ' + ($schemaValue) + ' + \'';
      } else {
        out += '' + ($schema);
      }
      out += ' items\' ';
    }
    if (it.opts.verbose) {
      out += ' , schema:  ';
      if ($isData) {
        out += 'validate.schema' + ($schemaPath);
      } else {
        out += '' + ($schema);
      }
      out += '         , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
    }
    out += ' } ';
  } else {
    out += ' {} ';
  }
  var __err = out;
  out = $$outStack.pop();
  if (!it.compositeRule && $breakOnError) {
    /* istanbul ignore if */
    if (it.async) {
      out += ' throw new ValidationError([' + (__err) + ']); ';
    } else {
      out += ' validate.errors = [' + (__err) + ']; return false; ';
    }
  } else {
    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  }
  out += '} ';
  if ($breakOnError) {
    out += ' else { ';
  }
  return out;
}
0Ṱx	'use strict';
module.exports = function generate__limitLength(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $errorKeyword;
  var $data = 'data' + ($dataLvl || '');
  var $isData = it.opts.$data && $schema && $schema.$data,
    $schemaValue;
  if ($isData) {
    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
    $schemaValue = 'schema' + $lvl;
  } else {
    $schemaValue = $schema;
  }
  if (!($isData || typeof $schema == 'number')) {
    throw new Error($keyword + ' must be number');
  }
  var $op = $keyword == 'maxLength' ? '>' : '<';
  out += 'if ( ';
  if ($isData) {
    out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
  }
  if (it.opts.unicode === false) {
    out += ' ' + ($data) + '.length ';
  } else {
    out += ' ucs2length(' + ($data) + ') ';
  }
  out += ' ' + ($op) + ' ' + ($schemaValue) + ') { ';
  var $errorKeyword = $keyword;
  var $$outStack = $$outStack || [];
  $$outStack.push(out);
  out = ''; /* istanbul ignore else */
  if (it.createErrors !== false) {
    out += ' { keyword: \'' + ($errorKeyword || '_limitLength') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';
    if (it.opts.messages !== false) {
      out += ' , message: \'should NOT be ';
      if ($keyword == 'maxLength') {
        out += 'longer';
      } else {
        out += 'shorter';
      }
      out += ' than ';
      if ($isData) {
        out += '\' + ' + ($schemaValue) + ' + \'';
      } else {
        out += '' + ($schema);
      }
      out += ' characters\' ';
    }
    if (it.opts.verbose) {
      out += ' , schema:  ';
      if ($isData) {
        out += 'validate.schema' + ($schemaPath);
      } else {
        out += '' + ($schema);
      }
      out += '         , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
    }
    out += ' } ';
  } else {
    out += ' {} ';
  }
  var __err = out;
  out = $$outStack.pop();
  if (!it.compositeRule && $breakOnError) {
    /* istanbul ignore if */
    if (it.async) {
      out += ' throw new ValidationError([' + (__err) + ']); ';
    } else {
      out += ' validate.errors = [' + (__err) + ']; return false; ';
    }
  } else {
    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  }
  out += '} ';
  if ($breakOnError) {
    out += ' else { ';
  }
  return out;
}
$Lx
I'use strict';
module.exports = function generate__limitProperties(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $errorKeyword;
  var $data = 'data' + ($dataLvl || '');
  var $isData = it.opts.$data && $schema && $schema.$data,
    $schemaValue;
  if ($isData) {
    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
    $schemaValue = 'schema' + $lvl;
  } else {
    $schemaValue = $schema;
  }
  if (!($isData || typeof $schema == 'number')) {
    throw new Error($keyword + ' must be number');
  }
  var $op = $keyword == 'maxProperties' ? '>' : '<';
  out += 'if ( ';
  if ($isData) {
    out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'number\') || ';
  }
  out += ' Object.keys(' + ($data) + ').length ' + ($op) + ' ' + ($schemaValue) + ') { ';
  var $errorKeyword = $keyword;
  var $$outStack = $$outStack || [];
  $$outStack.push(out);
  out = ''; /* istanbul ignore else */
  if (it.createErrors !== false) {
    out += ' { keyword: \'' + ($errorKeyword || '_limitProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schemaValue) + ' } ';
    if (it.opts.messages !== false) {
      out += ' , message: \'should NOT have ';
      if ($keyword == 'maxProperties') {
        out += 'more';
      } else {
        out += 'fewer';
      }
      out += ' than ';
      if ($isData) {
        out += '\' + ' + ($schemaValue) + ' + \'';
      } else {
        out += '' + ($schema);
      }
      out += ' properties\' ';
    }
    if (it.opts.verbose) {
      out += ' , schema:  ';
      if ($isData) {
        out += 'validate.schema' + ($schemaPath);
      } else {
        out += '' + ($schema);
      }
      out += '         , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
    }
    out += ' } ';
  } else {
    out += ' {} ';
  }
  var __err = out;
  out = $$outStack.pop();
  if (!it.compositeRule && $breakOnError) {
    /* istanbul ignore if */
    if (it.async) {
      out += ' throw new ValidationError([' + (__err) + ']); ';
    } else {
      out += ' validate.errors = [' + (__err) + ']; return false; ';
    }
  } else {
    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  }
  out += '} ';
  if ($breakOnError) {
    out += ' else { ';
  }
  return out;
}
`JTxE'use strict';
module.exports = function generate_allOf(it, $keyword, $ruleType) {
  var out = ' ';
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $it = it.util.copy(it);
  var $closingBraces = '';
  $it.level++;
  var $nextValid = 'valid' + $it.level;
  var $currentBaseId = $it.baseId,
    $allSchemasEmpty = true;
  var arr1 = $schema;
  if (arr1) {
    var $sch, $i = -1,
      l1 = arr1.length - 1;
    while ($i < l1) {
      $sch = arr1[$i += 1];
      if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
        $allSchemasEmpty = false;
        $it.schema = $sch;
        $it.schemaPath = $schemaPath + '[' + $i + ']';
        $it.errSchemaPath = $errSchemaPath + '/' + $i;
        out += '  ' + (it.validate($it)) + ' ';
        $it.baseId = $currentBaseId;
        if ($breakOnError) {
          out += ' if (' + ($nextValid) + ') { ';
          $closingBraces += '}';
        }
      }
    }
  }
  if ($breakOnError) {
    if ($allSchemasEmpty) {
      out += ' if (true) { ';
    } else {
      out += ' ' + ($closingBraces.slice(0, -1)) + ' ';
    }
  }
  return out;
}
!xm'use strict';
module.exports = function generate_anyOf(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $valid = 'valid' + $lvl;
  var $errs = 'errs__' + $lvl;
  var $it = it.util.copy(it);
  var $closingBraces = '';
  $it.level++;
  var $nextValid = 'valid' + $it.level;
  var $noEmptySchema = $schema.every(function($sch) {
    return (it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all));
  });
  if ($noEmptySchema) {
    var $currentBaseId = $it.baseId;
    out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = false;  ';
    var $wasComposite = it.compositeRule;
    it.compositeRule = $it.compositeRule = true;
    var arr1 = $schema;
    if (arr1) {
      var $sch, $i = -1,
        l1 = arr1.length - 1;
      while ($i < l1) {
        $sch = arr1[$i += 1];
        $it.schema = $sch;
        $it.schemaPath = $schemaPath + '[' + $i + ']';
        $it.errSchemaPath = $errSchemaPath + '/' + $i;
        out += '  ' + (it.validate($it)) + ' ';
        $it.baseId = $currentBaseId;
        out += ' ' + ($valid) + ' = ' + ($valid) + ' || ' + ($nextValid) + '; if (!' + ($valid) + ') { ';
        $closingBraces += '}';
      }
    }
    it.compositeRule = $it.compositeRule = $wasComposite;
    out += ' ' + ($closingBraces) + ' if (!' + ($valid) + ') {   var err =   '; /* istanbul ignore else */
    if (it.createErrors !== false) {
      out += ' { keyword: \'' + ('anyOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
      if (it.opts.messages !== false) {
        out += ' , message: \'should match some schema in anyOf\' ';
      }
      if (it.opts.verbose) {
        out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
      }
      out += ' } ';
    } else {
      out += ' {} ';
    }
    out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
    if (!it.compositeRule && $breakOnError) {
      /* istanbul ignore if */
      if (it.async) {
        out += ' throw new ValidationError(vErrors); ';
      } else {
        out += ' validate.errors = vErrors; return false; ';
      }
    }
    out += ' } else {  errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';
    if (it.opts.allErrors) {
      out += ' } ';
    }
  } else {
    if ($breakOnError) {
      out += ' if (true) { ';
    }
  }
  return out;
}
J#x='use strict';
module.exports = function generate_comment(it, $keyword, $ruleType) {
  var out = ' ';
  var $schema = it.schema[$keyword];
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $comment = it.util.toQuotedString($schema);
  if (it.opts.$comment === true) {
    out += ' console.log(' + ($comment) + ');';
  } else if (typeof it.opts.$comment == 'function') {
    out += ' self._opts.$comment(' + ($comment) + ', ' + (it.util.toQuotedString($errSchemaPath)) + ', validate.root.schema);';
  }
  return out;
}
-(xA'use strict';
module.exports = function generate_const(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $valid = 'valid' + $lvl;
  var $isData = it.opts.$data && $schema && $schema.$data,
    $schemaValue;
  if ($isData) {
    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
    $schemaValue = 'schema' + $lvl;
  } else {
    $schemaValue = $schema;
  }
  if (!$isData) {
    out += ' var schema' + ($lvl) + ' = validate.schema' + ($schemaPath) + ';';
  }
  out += 'var ' + ($valid) + ' = equal(' + ($data) + ', schema' + ($lvl) + '); if (!' + ($valid) + ') {   ';
  var $$outStack = $$outStack || [];
  $$outStack.push(out);
  out = ''; /* istanbul ignore else */
  if (it.createErrors !== false) {
    out += ' { keyword: \'' + ('const') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValue: schema' + ($lvl) + ' } ';
    if (it.opts.messages !== false) {
      out += ' , message: \'should be equal to constant\' ';
    }
    if (it.opts.verbose) {
      out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
    }
    out += ' } ';
  } else {
    out += ' {} ';
  }
  var __err = out;
  out = $$outStack.pop();
  if (!it.compositeRule && $breakOnError) {
    /* istanbul ignore if */
    if (it.async) {
      out += ' throw new ValidationError([' + (__err) + ']); ';
    } else {
      out += ' validate.errors = [' + (__err) + ']; return false; ';
    }
  } else {
    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  }
  out += ' }';
  if ($breakOnError) {
    out += ' else { ';
  }
  return out;
}
 kܺx*'use strict';
module.exports = function generate_contains(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $valid = 'valid' + $lvl;
  var $errs = 'errs__' + $lvl;
  var $it = it.util.copy(it);
  var $closingBraces = '';
  $it.level++;
  var $nextValid = 'valid' + $it.level;
  var $idx = 'i' + $lvl,
    $dataNxt = $it.dataLevel = it.dataLevel + 1,
    $nextData = 'data' + $dataNxt,
    $currentBaseId = it.baseId,
    $nonEmptySchema = (it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all));
  out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';
  if ($nonEmptySchema) {
    var $wasComposite = it.compositeRule;
    it.compositeRule = $it.compositeRule = true;
    $it.schema = $schema;
    $it.schemaPath = $schemaPath;
    $it.errSchemaPath = $errSchemaPath;
    out += ' var ' + ($nextValid) + ' = false; for (var ' + ($idx) + ' = 0; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';
    $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);
    var $passData = $data + '[' + $idx + ']';
    $it.dataPathArr[$dataNxt] = $idx;
    var $code = it.validate($it);
    $it.baseId = $currentBaseId;
    if (it.util.varOccurences($code, $nextData) < 2) {
      out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
    } else {
      out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
    }
    out += ' if (' + ($nextValid) + ') break; }  ';
    it.compositeRule = $it.compositeRule = $wasComposite;
    out += ' ' + ($closingBraces) + ' if (!' + ($nextValid) + ') {';
  } else {
    out += ' if (' + ($data) + '.length == 0) {';
  }
  var $$outStack = $$outStack || [];
  $$outStack.push(out);
  out = ''; /* istanbul ignore else */
  if (it.createErrors !== false) {
    out += ' { keyword: \'' + ('contains') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
    if (it.opts.messages !== false) {
      out += ' , message: \'should contain a valid item\' ';
    }
    if (it.opts.verbose) {
      out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
    }
    out += ' } ';
  } else {
    out += ' {} ';
  }
  var __err = out;
  out = $$outStack.pop();
  if (!it.compositeRule && $breakOnError) {
    /* istanbul ignore if */
    if (it.async) {
      out += ' throw new ValidationError([' + (__err) + ']); ';
    } else {
      out += ' validate.errors = [' + (__err) + ']; return false; ';
    }
  } else {
    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  }
  out += ' } else { ';
  if ($nonEmptySchema) {
    out += '  errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';
  }
  if (it.opts.allErrors) {
    out += ' } ';
  }
  return out;
}
Kߠx*&'use strict';
module.exports = function generate_custom(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $errorKeyword;
  var $data = 'data' + ($dataLvl || '');
  var $valid = 'valid' + $lvl;
  var $errs = 'errs__' + $lvl;
  var $isData = it.opts.$data && $schema && $schema.$data,
    $schemaValue;
  if ($isData) {
    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
    $schemaValue = 'schema' + $lvl;
  } else {
    $schemaValue = $schema;
  }
  var $rule = this,
    $definition = 'definition' + $lvl,
    $rDef = $rule.definition,
    $closingBraces = '';
  var $compile, $inline, $macro, $ruleValidate, $validateCode;
  if ($isData && $rDef.$data) {
    $validateCode = 'keywordValidate' + $lvl;
    var $validateSchema = $rDef.validateSchema;
    out += ' var ' + ($definition) + ' = RULES.custom[\'' + ($keyword) + '\'].definition; var ' + ($validateCode) + ' = ' + ($definition) + '.validate;';
  } else {
    $ruleValidate = it.useCustomRule($rule, $schema, it.schema, it);
    if (!$ruleValidate) return;
    $schemaValue = 'validate.schema' + $schemaPath;
    $validateCode = $ruleValidate.code;
    $compile = $rDef.compile;
    $inline = $rDef.inline;
    $macro = $rDef.macro;
  }
  var $ruleErrs = $validateCode + '.errors',
    $i = 'i' + $lvl,
    $ruleErr = 'ruleErr' + $lvl,
    $asyncKeyword = $rDef.async;
  if ($asyncKeyword && !it.async) throw new Error('async keyword in sync schema');
  if (!($inline || $macro)) {
    out += '' + ($ruleErrs) + ' = null;';
  }
  out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';
  if ($isData && $rDef.$data) {
    $closingBraces += '}';
    out += ' if (' + ($schemaValue) + ' === undefined) { ' + ($valid) + ' = true; } else { ';
    if ($validateSchema) {
      $closingBraces += '}';
      out += ' ' + ($valid) + ' = ' + ($definition) + '.validateSchema(' + ($schemaValue) + '); if (' + ($valid) + ') { ';
    }
  }
  if ($inline) {
    if ($rDef.statements) {
      out += ' ' + ($ruleValidate.validate) + ' ';
    } else {
      out += ' ' + ($valid) + ' = ' + ($ruleValidate.validate) + '; ';
    }
  } else if ($macro) {
    var $it = it.util.copy(it);
    var $closingBraces = '';
    $it.level++;
    var $nextValid = 'valid' + $it.level;
    $it.schema = $ruleValidate.validate;
    $it.schemaPath = '';
    var $wasComposite = it.compositeRule;
    it.compositeRule = $it.compositeRule = true;
    var $code = it.validate($it).replace(/validate\.schema/g, $validateCode);
    it.compositeRule = $it.compositeRule = $wasComposite;
    out += ' ' + ($code);
  } else {
    var $$outStack = $$outStack || [];
    $$outStack.push(out);
    out = '';
    out += '  ' + ($validateCode) + '.call( ';
    if (it.opts.passContext) {
      out += 'this';
    } else {
      out += 'self';
    }
    if ($compile || $rDef.schema === false) {
      out += ' , ' + ($data) + ' ';
    } else {
      out += ' , ' + ($schemaValue) + ' , ' + ($data) + ' , validate.schema' + (it.schemaPath) + ' ';
    }
    out += ' , (dataPath || \'\')';
    if (it.errorPath != '""') {
      out += ' + ' + (it.errorPath);
    }
    var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',
      $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';
    out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ' , rootData )  ';
    var def_callRuleValidate = out;
    out = $$outStack.pop();
    if ($rDef.errors === false) {
      out += ' ' + ($valid) + ' = ';
      if ($asyncKeyword) {
        out += 'await ';
      }
      out += '' + (def_callRuleValidate) + '; ';
    } else {
      if ($asyncKeyword) {
        $ruleErrs = 'customErrors' + $lvl;
        out += ' var ' + ($ruleErrs) + ' = null; try { ' + ($valid) + ' = await ' + (def_callRuleValidate) + '; } catch (e) { ' + ($valid) + ' = false; if (e instanceof ValidationError) ' + ($ruleErrs) + ' = e.errors; else throw e; } ';
      } else {
        out += ' ' + ($ruleErrs) + ' = null; ' + ($valid) + ' = ' + (def_callRuleValidate) + '; ';
      }
    }
  }
  if ($rDef.modifying) {
    out += ' if (' + ($parentData) + ') ' + ($data) + ' = ' + ($parentData) + '[' + ($parentDataProperty) + '];';
  }
  out += '' + ($closingBraces);
  if ($rDef.valid) {
    if ($breakOnError) {
      out += ' if (true) { ';
    }
  } else {
    out += ' if ( ';
    if ($rDef.valid === undefined) {
      out += ' !';
      if ($macro) {
        out += '' + ($nextValid);
      } else {
        out += '' + ($valid);
      }
    } else {
      out += ' ' + (!$rDef.valid) + ' ';
    }
    out += ') { ';
    $errorKeyword = $rule.keyword;
    var $$outStack = $$outStack || [];
    $$outStack.push(out);
    out = '';
    var $$outStack = $$outStack || [];
    $$outStack.push(out);
    out = ''; /* istanbul ignore else */
    if (it.createErrors !== false) {
      out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } ';
      if (it.opts.messages !== false) {
        out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' ';
      }
      if (it.opts.verbose) {
        out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
      }
      out += ' } ';
    } else {
      out += ' {} ';
    }
    var __err = out;
    out = $$outStack.pop();
    if (!it.compositeRule && $breakOnError) {
      /* istanbul ignore if */
      if (it.async) {
        out += ' throw new ValidationError([' + (__err) + ']); ';
      } else {
        out += ' validate.errors = [' + (__err) + ']; return false; ';
      }
    } else {
      out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
    }
    var def_customError = out;
    out = $$outStack.pop();
    if ($inline) {
      if ($rDef.errors) {
        if ($rDef.errors != 'full') {
          out += '  for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; } ';
          if (it.opts.verbose) {
            out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';
          }
          out += ' } ';
        }
      } else {
        if ($rDef.errors === false) {
          out += ' ' + (def_customError) + ' ';
        } else {
          out += ' if (' + ($errs) + ' == errors) { ' + (def_customError) + ' } else {  for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + '; if (' + ($ruleErr) + '.schemaPath === undefined) { ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '"; } ';
          if (it.opts.verbose) {
            out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';
          }
          out += ' } } ';
        }
      }
    } else if ($macro) {
      out += '   var err =   '; /* istanbul ignore else */
      if (it.createErrors !== false) {
        out += ' { keyword: \'' + ($errorKeyword || 'custom') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { keyword: \'' + ($rule.keyword) + '\' } ';
        if (it.opts.messages !== false) {
          out += ' , message: \'should pass "' + ($rule.keyword) + '" keyword validation\' ';
        }
        if (it.opts.verbose) {
          out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
        }
        out += ' } ';
      } else {
        out += ' {} ';
      }
      out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
      if (!it.compositeRule && $breakOnError) {
        /* istanbul ignore if */
        if (it.async) {
          out += ' throw new ValidationError(vErrors); ';
        } else {
          out += ' validate.errors = vErrors; return false; ';
        }
      }
    } else {
      if ($rDef.errors === false) {
        out += ' ' + (def_customError) + ' ';
      } else {
        out += ' if (Array.isArray(' + ($ruleErrs) + ')) { if (vErrors === null) vErrors = ' + ($ruleErrs) + '; else vErrors = vErrors.concat(' + ($ruleErrs) + '); errors = vErrors.length;  for (var ' + ($i) + '=' + ($errs) + '; ' + ($i) + '<errors; ' + ($i) + '++) { var ' + ($ruleErr) + ' = vErrors[' + ($i) + ']; if (' + ($ruleErr) + '.dataPath === undefined) ' + ($ruleErr) + '.dataPath = (dataPath || \'\') + ' + (it.errorPath) + ';  ' + ($ruleErr) + '.schemaPath = "' + ($errSchemaPath) + '";  ';
        if (it.opts.verbose) {
          out += ' ' + ($ruleErr) + '.schema = ' + ($schemaValue) + '; ' + ($ruleErr) + '.data = ' + ($data) + '; ';
        }
        out += ' } } else { ' + (def_customError) + ' } ';
      }
    }
    out += ' } ';
    if ($breakOnError) {
      out += ' else { ';
    }
  }
  return out;
}
wox('use strict';
module.exports = function generate_dependencies(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $errs = 'errs__' + $lvl;
  var $it = it.util.copy(it);
  var $closingBraces = '';
  $it.level++;
  var $nextValid = 'valid' + $it.level;
  var $schemaDeps = {},
    $propertyDeps = {},
    $ownProperties = it.opts.ownProperties;
  for ($property in $schema) {
    if ($property == '__proto__') continue;
    var $sch = $schema[$property];
    var $deps = Array.isArray($sch) ? $propertyDeps : $schemaDeps;
    $deps[$property] = $sch;
  }
  out += 'var ' + ($errs) + ' = errors;';
  var $currentErrorPath = it.errorPath;
  out += 'var missing' + ($lvl) + ';';
  for (var $property in $propertyDeps) {
    $deps = $propertyDeps[$property];
    if ($deps.length) {
      out += ' if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined ';
      if ($ownProperties) {
        out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') ';
      }
      if ($breakOnError) {
        out += ' && ( ';
        var arr1 = $deps;
        if (arr1) {
          var $propertyKey, $i = -1,
            l1 = arr1.length - 1;
          while ($i < l1) {
            $propertyKey = arr1[$i += 1];
            if ($i) {
              out += ' || ';
            }
            var $prop = it.util.getProperty($propertyKey),
              $useData = $data + $prop;
            out += ' ( ( ' + ($useData) + ' === undefined ';
            if ($ownProperties) {
              out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
            }
            out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) ';
          }
        }
        out += ')) {  ';
        var $propertyPath = 'missing' + $lvl,
          $missingProperty = '\' + ' + $propertyPath + ' + \'';
        if (it.opts._errorDataPathProperty) {
          it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath;
        }
        var $$outStack = $$outStack || [];
        $$outStack.push(out);
        out = ''; /* istanbul ignore else */
        if (it.createErrors !== false) {
          out += ' { keyword: \'' + ('dependencies') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \'' + (it.util.escapeQuotes($property)) + '\', missingProperty: \'' + ($missingProperty) + '\', depsCount: ' + ($deps.length) + ', deps: \'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", "))) + '\' } ';
          if (it.opts.messages !== false) {
            out += ' , message: \'should have ';
            if ($deps.length == 1) {
              out += 'property ' + (it.util.escapeQuotes($deps[0]));
            } else {
              out += 'properties ' + (it.util.escapeQuotes($deps.join(", ")));
            }
            out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\' ';
          }
          if (it.opts.verbose) {
            out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
          }
          out += ' } ';
        } else {
          out += ' {} ';
        }
        var __err = out;
        out = $$outStack.pop();
        if (!it.compositeRule && $breakOnError) {
          /* istanbul ignore if */
          if (it.async) {
            out += ' throw new ValidationError([' + (__err) + ']); ';
          } else {
            out += ' validate.errors = [' + (__err) + ']; return false; ';
          }
        } else {
          out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
        }
      } else {
        out += ' ) { ';
        var arr2 = $deps;
        if (arr2) {
          var $propertyKey, i2 = -1,
            l2 = arr2.length - 1;
          while (i2 < l2) {
            $propertyKey = arr2[i2 += 1];
            var $prop = it.util.getProperty($propertyKey),
              $missingProperty = it.util.escapeQuotes($propertyKey),
              $useData = $data + $prop;
            if (it.opts._errorDataPathProperty) {
              it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
            }
            out += ' if ( ' + ($useData) + ' === undefined ';
            if ($ownProperties) {
              out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
            }
            out += ') {  var err =   '; /* istanbul ignore else */
            if (it.createErrors !== false) {
              out += ' { keyword: \'' + ('dependencies') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { property: \'' + (it.util.escapeQuotes($property)) + '\', missingProperty: \'' + ($missingProperty) + '\', depsCount: ' + ($deps.length) + ', deps: \'' + (it.util.escapeQuotes($deps.length == 1 ? $deps[0] : $deps.join(", "))) + '\' } ';
              if (it.opts.messages !== false) {
                out += ' , message: \'should have ';
                if ($deps.length == 1) {
                  out += 'property ' + (it.util.escapeQuotes($deps[0]));
                } else {
                  out += 'properties ' + (it.util.escapeQuotes($deps.join(", ")));
                }
                out += ' when property ' + (it.util.escapeQuotes($property)) + ' is present\' ';
              }
              if (it.opts.verbose) {
                out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
              }
              out += ' } ';
            } else {
              out += ' {} ';
            }
            out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ';
          }
        }
      }
      out += ' }   ';
      if ($breakOnError) {
        $closingBraces += '}';
        out += ' else { ';
      }
    }
  }
  it.errorPath = $currentErrorPath;
  var $currentBaseId = $it.baseId;
  for (var $property in $schemaDeps) {
    var $sch = $schemaDeps[$property];
    if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
      out += ' ' + ($nextValid) + ' = true; if ( ' + ($data) + (it.util.getProperty($property)) + ' !== undefined ';
      if ($ownProperties) {
        out += ' && Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($property)) + '\') ';
      }
      out += ') { ';
      $it.schema = $sch;
      $it.schemaPath = $schemaPath + it.util.getProperty($property);
      $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($property);
      out += '  ' + (it.validate($it)) + ' ';
      $it.baseId = $currentBaseId;
      out += ' }  ';
      if ($breakOnError) {
        out += ' if (' + ($nextValid) + ') { ';
        $closingBraces += '}';
      }
    }
  }
  if ($breakOnError) {
    out += '   ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
  }
  return out;
}
mx
'use strict';
module.exports = function generate_enum(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $valid = 'valid' + $lvl;
  var $isData = it.opts.$data && $schema && $schema.$data,
    $schemaValue;
  if ($isData) {
    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
    $schemaValue = 'schema' + $lvl;
  } else {
    $schemaValue = $schema;
  }
  var $i = 'i' + $lvl,
    $vSchema = 'schema' + $lvl;
  if (!$isData) {
    out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + ';';
  }
  out += 'var ' + ($valid) + ';';
  if ($isData) {
    out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {';
  }
  out += '' + ($valid) + ' = false;for (var ' + ($i) + '=0; ' + ($i) + '<' + ($vSchema) + '.length; ' + ($i) + '++) if (equal(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + '])) { ' + ($valid) + ' = true; break; }';
  if ($isData) {
    out += '  }  ';
  }
  out += ' if (!' + ($valid) + ') {   ';
  var $$outStack = $$outStack || [];
  $$outStack.push(out);
  out = ''; /* istanbul ignore else */
  if (it.createErrors !== false) {
    out += ' { keyword: \'' + ('enum') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { allowedValues: schema' + ($lvl) + ' } ';
    if (it.opts.messages !== false) {
      out += ' , message: \'should be equal to one of the allowed values\' ';
    }
    if (it.opts.verbose) {
      out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
    }
    out += ' } ';
  } else {
    out += ' {} ';
  }
  var __err = out;
  out = $$outStack.pop();
  if (!it.compositeRule && $breakOnError) {
    /* istanbul ignore if */
    if (it.async) {
      out += ' throw new ValidationError([' + (__err) + ']); ';
    } else {
      out += ' validate.errors = [' + (__err) + ']; return false; ';
    }
  } else {
    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  }
  out += ' }';
  if ($breakOnError) {
    out += ' else { ';
  }
  return out;
}
Y㗽xB'use strict';
module.exports = function generate_format(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  if (it.opts.format === false) {
    if ($breakOnError) {
      out += ' if (true) { ';
    }
    return out;
  }
  var $isData = it.opts.$data && $schema && $schema.$data,
    $schemaValue;
  if ($isData) {
    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
    $schemaValue = 'schema' + $lvl;
  } else {
    $schemaValue = $schema;
  }
  var $unknownFormats = it.opts.unknownFormats,
    $allowUnknown = Array.isArray($unknownFormats);
  if ($isData) {
    var $format = 'format' + $lvl,
      $isObject = 'isObject' + $lvl,
      $formatType = 'formatType' + $lvl;
    out += ' var ' + ($format) + ' = formats[' + ($schemaValue) + ']; var ' + ($isObject) + ' = typeof ' + ($format) + ' == \'object\' && !(' + ($format) + ' instanceof RegExp) && ' + ($format) + '.validate; var ' + ($formatType) + ' = ' + ($isObject) + ' && ' + ($format) + '.type || \'string\'; if (' + ($isObject) + ') { ';
    if (it.async) {
      out += ' var async' + ($lvl) + ' = ' + ($format) + '.async; ';
    }
    out += ' ' + ($format) + ' = ' + ($format) + '.validate; } if (  ';
    if ($isData) {
      out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || ';
    }
    out += ' (';
    if ($unknownFormats != 'ignore') {
      out += ' (' + ($schemaValue) + ' && !' + ($format) + ' ';
      if ($allowUnknown) {
        out += ' && self._opts.unknownFormats.indexOf(' + ($schemaValue) + ') == -1 ';
      }
      out += ') || ';
    }
    out += ' (' + ($format) + ' && ' + ($formatType) + ' == \'' + ($ruleType) + '\' && !(typeof ' + ($format) + ' == \'function\' ? ';
    if (it.async) {
      out += ' (async' + ($lvl) + ' ? await ' + ($format) + '(' + ($data) + ') : ' + ($format) + '(' + ($data) + ')) ';
    } else {
      out += ' ' + ($format) + '(' + ($data) + ') ';
    }
    out += ' : ' + ($format) + '.test(' + ($data) + '))))) {';
  } else {
    var $format = it.formats[$schema];
    if (!$format) {
      if ($unknownFormats == 'ignore') {
        it.logger.warn('unknown format "' + $schema + '" ignored in schema at path "' + it.errSchemaPath + '"');
        if ($breakOnError) {
          out += ' if (true) { ';
        }
        return out;
      } else if ($allowUnknown && $unknownFormats.indexOf($schema) >= 0) {
        if ($breakOnError) {
          out += ' if (true) { ';
        }
        return out;
      } else {
        throw new Error('unknown format "' + $schema + '" is used in schema at path "' + it.errSchemaPath + '"');
      }
    }
    var $isObject = typeof $format == 'object' && !($format instanceof RegExp) && $format.validate;
    var $formatType = $isObject && $format.type || 'string';
    if ($isObject) {
      var $async = $format.async === true;
      $format = $format.validate;
    }
    if ($formatType != $ruleType) {
      if ($breakOnError) {
        out += ' if (true) { ';
      }
      return out;
    }
    if ($async) {
      if (!it.async) throw new Error('async format in sync schema');
      var $formatRef = 'formats' + it.util.getProperty($schema) + '.validate';
      out += ' if (!(await ' + ($formatRef) + '(' + ($data) + '))) { ';
    } else {
      out += ' if (! ';
      var $formatRef = 'formats' + it.util.getProperty($schema);
      if ($isObject) $formatRef += '.validate';
      if (typeof $format == 'function') {
        out += ' ' + ($formatRef) + '(' + ($data) + ') ';
      } else {
        out += ' ' + ($formatRef) + '.test(' + ($data) + ') ';
      }
      out += ') { ';
    }
  }
  var $$outStack = $$outStack || [];
  $$outStack.push(out);
  out = ''; /* istanbul ignore else */
  if (it.createErrors !== false) {
    out += ' { keyword: \'' + ('format') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { format:  ';
    if ($isData) {
      out += '' + ($schemaValue);
    } else {
      out += '' + (it.util.toQuotedString($schema));
    }
    out += '  } ';
    if (it.opts.messages !== false) {
      out += ' , message: \'should match format "';
      if ($isData) {
        out += '\' + ' + ($schemaValue) + ' + \'';
      } else {
        out += '' + (it.util.escapeQuotes($schema));
      }
      out += '"\' ';
    }
    if (it.opts.verbose) {
      out += ' , schema:  ';
      if ($isData) {
        out += 'validate.schema' + ($schemaPath);
      } else {
        out += '' + (it.util.toQuotedString($schema));
      }
      out += '         , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
    }
    out += ' } ';
  } else {
    out += ' {} ';
  }
  var __err = out;
  out = $$outStack.pop();
  if (!it.compositeRule && $breakOnError) {
    /* istanbul ignore if */
    if (it.async) {
      out += ' throw new ValidationError([' + (__err) + ']); ';
    } else {
      out += ' validate.errors = [' + (__err) + ']; return false; ';
    }
  } else {
    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  }
  out += ' } ';
  if ($breakOnError) {
    out += ' else { ';
  }
  return out;
}
W,/x?'use strict';
module.exports = function generate_if(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $valid = 'valid' + $lvl;
  var $errs = 'errs__' + $lvl;
  var $it = it.util.copy(it);
  $it.level++;
  var $nextValid = 'valid' + $it.level;
  var $thenSch = it.schema['then'],
    $elseSch = it.schema['else'],
    $thenPresent = $thenSch !== undefined && (it.opts.strictKeywords ? (typeof $thenSch == 'object' && Object.keys($thenSch).length > 0) || $thenSch === false : it.util.schemaHasRules($thenSch, it.RULES.all)),
    $elsePresent = $elseSch !== undefined && (it.opts.strictKeywords ? (typeof $elseSch == 'object' && Object.keys($elseSch).length > 0) || $elseSch === false : it.util.schemaHasRules($elseSch, it.RULES.all)),
    $currentBaseId = $it.baseId;
  if ($thenPresent || $elsePresent) {
    var $ifClause;
    $it.createErrors = false;
    $it.schema = $schema;
    $it.schemaPath = $schemaPath;
    $it.errSchemaPath = $errSchemaPath;
    out += ' var ' + ($errs) + ' = errors; var ' + ($valid) + ' = true;  ';
    var $wasComposite = it.compositeRule;
    it.compositeRule = $it.compositeRule = true;
    out += '  ' + (it.validate($it)) + ' ';
    $it.baseId = $currentBaseId;
    $it.createErrors = true;
    out += '  errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }  ';
    it.compositeRule = $it.compositeRule = $wasComposite;
    if ($thenPresent) {
      out += ' if (' + ($nextValid) + ') {  ';
      $it.schema = it.schema['then'];
      $it.schemaPath = it.schemaPath + '.then';
      $it.errSchemaPath = it.errSchemaPath + '/then';
      out += '  ' + (it.validate($it)) + ' ';
      $it.baseId = $currentBaseId;
      out += ' ' + ($valid) + ' = ' + ($nextValid) + '; ';
      if ($thenPresent && $elsePresent) {
        $ifClause = 'ifClause' + $lvl;
        out += ' var ' + ($ifClause) + ' = \'then\'; ';
      } else {
        $ifClause = '\'then\'';
      }
      out += ' } ';
      if ($elsePresent) {
        out += ' else { ';
      }
    } else {
      out += ' if (!' + ($nextValid) + ') { ';
    }
    if ($elsePresent) {
      $it.schema = it.schema['else'];
      $it.schemaPath = it.schemaPath + '.else';
      $it.errSchemaPath = it.errSchemaPath + '/else';
      out += '  ' + (it.validate($it)) + ' ';
      $it.baseId = $currentBaseId;
      out += ' ' + ($valid) + ' = ' + ($nextValid) + '; ';
      if ($thenPresent && $elsePresent) {
        $ifClause = 'ifClause' + $lvl;
        out += ' var ' + ($ifClause) + ' = \'else\'; ';
      } else {
        $ifClause = '\'else\'';
      }
      out += ' } ';
    }
    out += ' if (!' + ($valid) + ') {   var err =   '; /* istanbul ignore else */
    if (it.createErrors !== false) {
      out += ' { keyword: \'' + ('if') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { failingKeyword: ' + ($ifClause) + ' } ';
      if (it.opts.messages !== false) {
        out += ' , message: \'should match "\' + ' + ($ifClause) + ' + \'" schema\' ';
      }
      if (it.opts.verbose) {
        out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
      }
      out += ' } ';
    } else {
      out += ' {} ';
    }
    out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
    if (!it.compositeRule && $breakOnError) {
      /* istanbul ignore if */
      if (it.async) {
        out += ' throw new ValidationError(vErrors); ';
      } else {
        out += ' validate.errors = vErrors; return false; ';
      }
    }
    out += ' }   ';
    if ($breakOnError) {
      out += ' else { ';
    }
  } else {
    if ($breakOnError) {
      out += ' if (true) { ';
    }
  }
  return out;
}
DxL'use strict';

//all requires must be explicit because browserify won't work with dynamic requires
module.exports = {
  '$ref': require('./ref'),
  allOf: require('./allOf'),
  anyOf: require('./anyOf'),
  '$comment': require('./comment'),
  const: require('./const'),
  contains: require('./contains'),
  dependencies: require('./dependencies'),
  'enum': require('./enum'),
  format: require('./format'),
  'if': require('./if'),
  items: require('./items'),
  maximum: require('./_limit'),
  minimum: require('./_limit'),
  maxItems: require('./_limitItems'),
  minItems: require('./_limitItems'),
  maxLength: require('./_limitLength'),
  minLength: require('./_limitLength'),
  maxProperties: require('./_limitProperties'),
  minProperties: require('./_limitProperties'),
  multipleOf: require('./multipleOf'),
  not: require('./not'),
  oneOf: require('./oneOf'),
  pattern: require('./pattern'),
  properties: require('./properties'),
  propertyNames: require('./propertyNames'),
  required: require('./required'),
  uniqueItems: require('./uniqueItems'),
  validate: require('./validate')
};
hxF'use strict';
module.exports = function generate_items(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $valid = 'valid' + $lvl;
  var $errs = 'errs__' + $lvl;
  var $it = it.util.copy(it);
  var $closingBraces = '';
  $it.level++;
  var $nextValid = 'valid' + $it.level;
  var $idx = 'i' + $lvl,
    $dataNxt = $it.dataLevel = it.dataLevel + 1,
    $nextData = 'data' + $dataNxt,
    $currentBaseId = it.baseId;
  out += 'var ' + ($errs) + ' = errors;var ' + ($valid) + ';';
  if (Array.isArray($schema)) {
    var $additionalItems = it.schema.additionalItems;
    if ($additionalItems === false) {
      out += ' ' + ($valid) + ' = ' + ($data) + '.length <= ' + ($schema.length) + '; ';
      var $currErrSchemaPath = $errSchemaPath;
      $errSchemaPath = it.errSchemaPath + '/additionalItems';
      out += '  if (!' + ($valid) + ') {   ';
      var $$outStack = $$outStack || [];
      $$outStack.push(out);
      out = ''; /* istanbul ignore else */
      if (it.createErrors !== false) {
        out += ' { keyword: \'' + ('additionalItems') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { limit: ' + ($schema.length) + ' } ';
        if (it.opts.messages !== false) {
          out += ' , message: \'should NOT have more than ' + ($schema.length) + ' items\' ';
        }
        if (it.opts.verbose) {
          out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
        }
        out += ' } ';
      } else {
        out += ' {} ';
      }
      var __err = out;
      out = $$outStack.pop();
      if (!it.compositeRule && $breakOnError) {
        /* istanbul ignore if */
        if (it.async) {
          out += ' throw new ValidationError([' + (__err) + ']); ';
        } else {
          out += ' validate.errors = [' + (__err) + ']; return false; ';
        }
      } else {
        out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
      }
      out += ' } ';
      $errSchemaPath = $currErrSchemaPath;
      if ($breakOnError) {
        $closingBraces += '}';
        out += ' else { ';
      }
    }
    var arr1 = $schema;
    if (arr1) {
      var $sch, $i = -1,
        l1 = arr1.length - 1;
      while ($i < l1) {
        $sch = arr1[$i += 1];
        if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
          out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($i) + ') { ';
          var $passData = $data + '[' + $i + ']';
          $it.schema = $sch;
          $it.schemaPath = $schemaPath + '[' + $i + ']';
          $it.errSchemaPath = $errSchemaPath + '/' + $i;
          $it.errorPath = it.util.getPathExpr(it.errorPath, $i, it.opts.jsonPointers, true);
          $it.dataPathArr[$dataNxt] = $i;
          var $code = it.validate($it);
          $it.baseId = $currentBaseId;
          if (it.util.varOccurences($code, $nextData) < 2) {
            out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
          } else {
            out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
          }
          out += ' }  ';
          if ($breakOnError) {
            out += ' if (' + ($nextValid) + ') { ';
            $closingBraces += '}';
          }
        }
      }
    }
    if (typeof $additionalItems == 'object' && (it.opts.strictKeywords ? (typeof $additionalItems == 'object' && Object.keys($additionalItems).length > 0) || $additionalItems === false : it.util.schemaHasRules($additionalItems, it.RULES.all))) {
      $it.schema = $additionalItems;
      $it.schemaPath = it.schemaPath + '.additionalItems';
      $it.errSchemaPath = it.errSchemaPath + '/additionalItems';
      out += ' ' + ($nextValid) + ' = true; if (' + ($data) + '.length > ' + ($schema.length) + ') {  for (var ' + ($idx) + ' = ' + ($schema.length) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';
      $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);
      var $passData = $data + '[' + $idx + ']';
      $it.dataPathArr[$dataNxt] = $idx;
      var $code = it.validate($it);
      $it.baseId = $currentBaseId;
      if (it.util.varOccurences($code, $nextData) < 2) {
        out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
      } else {
        out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
      }
      if ($breakOnError) {
        out += ' if (!' + ($nextValid) + ') break; ';
      }
      out += ' } }  ';
      if ($breakOnError) {
        out += ' if (' + ($nextValid) + ') { ';
        $closingBraces += '}';
      }
    }
  } else if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {
    $it.schema = $schema;
    $it.schemaPath = $schemaPath;
    $it.errSchemaPath = $errSchemaPath;
    out += '  for (var ' + ($idx) + ' = ' + (0) + '; ' + ($idx) + ' < ' + ($data) + '.length; ' + ($idx) + '++) { ';
    $it.errorPath = it.util.getPathExpr(it.errorPath, $idx, it.opts.jsonPointers, true);
    var $passData = $data + '[' + $idx + ']';
    $it.dataPathArr[$dataNxt] = $idx;
    var $code = it.validate($it);
    $it.baseId = $currentBaseId;
    if (it.util.varOccurences($code, $nextData) < 2) {
      out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
    } else {
      out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
    }
    if ($breakOnError) {
      out += ' if (!' + ($nextValid) + ') break; ';
    }
    out += ' }';
  }
  if ($breakOnError) {
    out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
  }
  return out;
}
7#x
'use strict';
module.exports = function generate_multipleOf(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $isData = it.opts.$data && $schema && $schema.$data,
    $schemaValue;
  if ($isData) {
    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
    $schemaValue = 'schema' + $lvl;
  } else {
    $schemaValue = $schema;
  }
  if (!($isData || typeof $schema == 'number')) {
    throw new Error($keyword + ' must be number');
  }
  out += 'var division' + ($lvl) + ';if (';
  if ($isData) {
    out += ' ' + ($schemaValue) + ' !== undefined && ( typeof ' + ($schemaValue) + ' != \'number\' || ';
  }
  out += ' (division' + ($lvl) + ' = ' + ($data) + ' / ' + ($schemaValue) + ', ';
  if (it.opts.multipleOfPrecision) {
    out += ' Math.abs(Math.round(division' + ($lvl) + ') - division' + ($lvl) + ') > 1e-' + (it.opts.multipleOfPrecision) + ' ';
  } else {
    out += ' division' + ($lvl) + ' !== parseInt(division' + ($lvl) + ') ';
  }
  out += ' ) ';
  if ($isData) {
    out += '  )  ';
  }
  out += ' ) {   ';
  var $$outStack = $$outStack || [];
  $$outStack.push(out);
  out = ''; /* istanbul ignore else */
  if (it.createErrors !== false) {
    out += ' { keyword: \'' + ('multipleOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { multipleOf: ' + ($schemaValue) + ' } ';
    if (it.opts.messages !== false) {
      out += ' , message: \'should be multiple of ';
      if ($isData) {
        out += '\' + ' + ($schemaValue);
      } else {
        out += '' + ($schemaValue) + '\'';
      }
    }
    if (it.opts.verbose) {
      out += ' , schema:  ';
      if ($isData) {
        out += 'validate.schema' + ($schemaPath);
      } else {
        out += '' + ($schema);
      }
      out += '         , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
    }
    out += ' } ';
  } else {
    out += ' {} ';
  }
  var __err = out;
  out = $$outStack.pop();
  if (!it.compositeRule && $breakOnError) {
    /* istanbul ignore if */
    if (it.async) {
      out += ' throw new ValidationError([' + (__err) + ']); ';
    } else {
      out += ' validate.errors = [' + (__err) + ']; return false; ';
    }
  } else {
    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  }
  out += '} ';
  if ($breakOnError) {
    out += ' else { ';
  }
  return out;
}
ù!x{'use strict';
module.exports = function generate_not(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $errs = 'errs__' + $lvl;
  var $it = it.util.copy(it);
  $it.level++;
  var $nextValid = 'valid' + $it.level;
  if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {
    $it.schema = $schema;
    $it.schemaPath = $schemaPath;
    $it.errSchemaPath = $errSchemaPath;
    out += ' var ' + ($errs) + ' = errors;  ';
    var $wasComposite = it.compositeRule;
    it.compositeRule = $it.compositeRule = true;
    $it.createErrors = false;
    var $allErrorsOption;
    if ($it.opts.allErrors) {
      $allErrorsOption = $it.opts.allErrors;
      $it.opts.allErrors = false;
    }
    out += ' ' + (it.validate($it)) + ' ';
    $it.createErrors = true;
    if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption;
    it.compositeRule = $it.compositeRule = $wasComposite;
    out += ' if (' + ($nextValid) + ') {   ';
    var $$outStack = $$outStack || [];
    $$outStack.push(out);
    out = ''; /* istanbul ignore else */
    if (it.createErrors !== false) {
      out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
      if (it.opts.messages !== false) {
        out += ' , message: \'should NOT be valid\' ';
      }
      if (it.opts.verbose) {
        out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
      }
      out += ' } ';
    } else {
      out += ' {} ';
    }
    var __err = out;
    out = $$outStack.pop();
    if (!it.compositeRule && $breakOnError) {
      /* istanbul ignore if */
      if (it.async) {
        out += ' throw new ValidationError([' + (__err) + ']); ';
      } else {
        out += ' validate.errors = [' + (__err) + ']; return false; ';
      }
    } else {
      out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
    }
    out += ' } else {  errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';
    if (it.opts.allErrors) {
      out += ' } ';
    }
  } else {
    out += '  var err =   '; /* istanbul ignore else */
    if (it.createErrors !== false) {
      out += ' { keyword: \'' + ('not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
      if (it.opts.messages !== false) {
        out += ' , message: \'should NOT be valid\' ';
      }
      if (it.opts.verbose) {
        out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
      }
      out += ' } ';
    } else {
      out += ' {} ';
    }
    out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
    if ($breakOnError) {
      out += ' if (false) { ';
    }
  }
  return out;
}
xt'use strict';
module.exports = function generate_oneOf(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $valid = 'valid' + $lvl;
  var $errs = 'errs__' + $lvl;
  var $it = it.util.copy(it);
  var $closingBraces = '';
  $it.level++;
  var $nextValid = 'valid' + $it.level;
  var $currentBaseId = $it.baseId,
    $prevValid = 'prevValid' + $lvl,
    $passingSchemas = 'passingSchemas' + $lvl;
  out += 'var ' + ($errs) + ' = errors , ' + ($prevValid) + ' = false , ' + ($valid) + ' = false , ' + ($passingSchemas) + ' = null; ';
  var $wasComposite = it.compositeRule;
  it.compositeRule = $it.compositeRule = true;
  var arr1 = $schema;
  if (arr1) {
    var $sch, $i = -1,
      l1 = arr1.length - 1;
    while ($i < l1) {
      $sch = arr1[$i += 1];
      if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
        $it.schema = $sch;
        $it.schemaPath = $schemaPath + '[' + $i + ']';
        $it.errSchemaPath = $errSchemaPath + '/' + $i;
        out += '  ' + (it.validate($it)) + ' ';
        $it.baseId = $currentBaseId;
      } else {
        out += ' var ' + ($nextValid) + ' = true; ';
      }
      if ($i) {
        out += ' if (' + ($nextValid) + ' && ' + ($prevValid) + ') { ' + ($valid) + ' = false; ' + ($passingSchemas) + ' = [' + ($passingSchemas) + ', ' + ($i) + ']; } else { ';
        $closingBraces += '}';
      }
      out += ' if (' + ($nextValid) + ') { ' + ($valid) + ' = ' + ($prevValid) + ' = true; ' + ($passingSchemas) + ' = ' + ($i) + '; }';
    }
  }
  it.compositeRule = $it.compositeRule = $wasComposite;
  out += '' + ($closingBraces) + 'if (!' + ($valid) + ') {   var err =   '; /* istanbul ignore else */
  if (it.createErrors !== false) {
    out += ' { keyword: \'' + ('oneOf') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { passingSchemas: ' + ($passingSchemas) + ' } ';
    if (it.opts.messages !== false) {
      out += ' , message: \'should match exactly one schema in oneOf\' ';
    }
    if (it.opts.verbose) {
      out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
    }
    out += ' } ';
  } else {
    out += ' {} ';
  }
  out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  if (!it.compositeRule && $breakOnError) {
    /* istanbul ignore if */
    if (it.async) {
      out += ' throw new ValidationError(vErrors); ';
    } else {
      out += ' validate.errors = vErrors; return false; ';
    }
  }
  out += '} else {  errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; }';
  if (it.opts.allErrors) {
    out += ' } ';
  }
  return out;
}
x.'use strict';
module.exports = function generate_pattern(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $valid = 'valid' + $lvl;
  var $isData = it.opts.$data && $schema && $schema.$data,
    $schemaValue;
  if ($isData) {
    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
    $schemaValue = 'schema' + $lvl;
  } else {
    $schemaValue = $schema;
  }
  var $regExpCode = it.opts.regExp ? 'regExp' : 'new RegExp';
  if ($isData) {
    out += ' var ' + ($valid) + ' = true; try { ' + ($valid) + ' = ' + ($regExpCode) + '(' + ($schemaValue) + ').test(' + ($data) + '); } catch(e) { ' + ($valid) + ' = false; } if ( ';
    if ($isData) {
      out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || ';
    }
    out += ' !' + ($valid) + ') {';
  } else {
    var $regexp = it.usePattern($schema);
    out += ' if ( ';
    if ($isData) {
      out += ' (' + ($schemaValue) + ' !== undefined && typeof ' + ($schemaValue) + ' != \'string\') || ';
    }
    out += ' !' + ($regexp) + '.test(' + ($data) + ') ) {';
  }
  var $$outStack = $$outStack || [];
  $$outStack.push(out);
  out = ''; /* istanbul ignore else */
  if (it.createErrors !== false) {
    out += ' { keyword: \'' + ('pattern') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { pattern:  ';
    if ($isData) {
      out += '' + ($schemaValue);
    } else {
      out += '' + (it.util.toQuotedString($schema));
    }
    out += '  } ';
    if (it.opts.messages !== false) {
      out += ' , message: \'should match pattern "';
      if ($isData) {
        out += '\' + ' + ($schemaValue) + ' + \'';
      } else {
        out += '' + (it.util.escapeQuotes($schema));
      }
      out += '"\' ';
    }
    if (it.opts.verbose) {
      out += ' , schema:  ';
      if ($isData) {
        out += 'validate.schema' + ($schemaPath);
      } else {
        out += '' + (it.util.toQuotedString($schema));
      }
      out += '         , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
    }
    out += ' } ';
  } else {
    out += ' {} ';
  }
  var __err = out;
  out = $$outStack.pop();
  if (!it.compositeRule && $breakOnError) {
    /* istanbul ignore if */
    if (it.async) {
      out += ' throw new ValidationError([' + (__err) + ']); ';
    } else {
      out += ' validate.errors = [' + (__err) + ']; return false; ';
    }
  } else {
    out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  }
  out += '} ';
  if ($breakOnError) {
    out += ' else { ';
  }
  return out;
}
Ux;'use strict';
module.exports = function generate_properties(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $errs = 'errs__' + $lvl;
  var $it = it.util.copy(it);
  var $closingBraces = '';
  $it.level++;
  var $nextValid = 'valid' + $it.level;
  var $key = 'key' + $lvl,
    $idx = 'idx' + $lvl,
    $dataNxt = $it.dataLevel = it.dataLevel + 1,
    $nextData = 'data' + $dataNxt,
    $dataProperties = 'dataProperties' + $lvl;
  var $schemaKeys = Object.keys($schema || {}).filter(notProto),
    $pProperties = it.schema.patternProperties || {},
    $pPropertyKeys = Object.keys($pProperties).filter(notProto),
    $aProperties = it.schema.additionalProperties,
    $someProperties = $schemaKeys.length || $pPropertyKeys.length,
    $noAdditional = $aProperties === false,
    $additionalIsSchema = typeof $aProperties == 'object' && Object.keys($aProperties).length,
    $removeAdditional = it.opts.removeAdditional,
    $checkAdditional = $noAdditional || $additionalIsSchema || $removeAdditional,
    $ownProperties = it.opts.ownProperties,
    $currentBaseId = it.baseId;
  var $required = it.schema.required;
  if ($required && !(it.opts.$data && $required.$data) && $required.length < it.opts.loopRequired) {
    var $requiredHash = it.util.toHash($required);
  }

  function notProto(p) {
    return p !== '__proto__';
  }
  out += 'var ' + ($errs) + ' = errors;var ' + ($nextValid) + ' = true;';
  if ($ownProperties) {
    out += ' var ' + ($dataProperties) + ' = undefined;';
  }
  if ($checkAdditional) {
    if ($ownProperties) {
      out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';
    } else {
      out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';
    }
    if ($someProperties) {
      out += ' var isAdditional' + ($lvl) + ' = !(false ';
      if ($schemaKeys.length) {
        if ($schemaKeys.length > 8) {
          out += ' || validate.schema' + ($schemaPath) + '.hasOwnProperty(' + ($key) + ') ';
        } else {
          var arr1 = $schemaKeys;
          if (arr1) {
            var $propertyKey, i1 = -1,
              l1 = arr1.length - 1;
            while (i1 < l1) {
              $propertyKey = arr1[i1 += 1];
              out += ' || ' + ($key) + ' == ' + (it.util.toQuotedString($propertyKey)) + ' ';
            }
          }
        }
      }
      if ($pPropertyKeys.length) {
        var arr2 = $pPropertyKeys;
        if (arr2) {
          var $pProperty, $i = -1,
            l2 = arr2.length - 1;
          while ($i < l2) {
            $pProperty = arr2[$i += 1];
            out += ' || ' + (it.usePattern($pProperty)) + '.test(' + ($key) + ') ';
          }
        }
      }
      out += ' ); if (isAdditional' + ($lvl) + ') { ';
    }
    if ($removeAdditional == 'all') {
      out += ' delete ' + ($data) + '[' + ($key) + ']; ';
    } else {
      var $currentErrorPath = it.errorPath;
      var $additionalProperty = '\' + ' + $key + ' + \'';
      if (it.opts._errorDataPathProperty) {
        it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
      }
      if ($noAdditional) {
        if ($removeAdditional) {
          out += ' delete ' + ($data) + '[' + ($key) + ']; ';
        } else {
          out += ' ' + ($nextValid) + ' = false; ';
          var $currErrSchemaPath = $errSchemaPath;
          $errSchemaPath = it.errSchemaPath + '/additionalProperties';
          var $$outStack = $$outStack || [];
          $$outStack.push(out);
          out = ''; /* istanbul ignore else */
          if (it.createErrors !== false) {
            out += ' { keyword: \'' + ('additionalProperties') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { additionalProperty: \'' + ($additionalProperty) + '\' } ';
            if (it.opts.messages !== false) {
              out += ' , message: \'';
              if (it.opts._errorDataPathProperty) {
                out += 'is an invalid additional property';
              } else {
                out += 'should NOT have additional properties';
              }
              out += '\' ';
            }
            if (it.opts.verbose) {
              out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
            }
            out += ' } ';
          } else {
            out += ' {} ';
          }
          var __err = out;
          out = $$outStack.pop();
          if (!it.compositeRule && $breakOnError) {
            /* istanbul ignore if */
            if (it.async) {
              out += ' throw new ValidationError([' + (__err) + ']); ';
            } else {
              out += ' validate.errors = [' + (__err) + ']; return false; ';
            }
          } else {
            out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
          }
          $errSchemaPath = $currErrSchemaPath;
          if ($breakOnError) {
            out += ' break; ';
          }
        }
      } else if ($additionalIsSchema) {
        if ($removeAdditional == 'failing') {
          out += ' var ' + ($errs) + ' = errors;  ';
          var $wasComposite = it.compositeRule;
          it.compositeRule = $it.compositeRule = true;
          $it.schema = $aProperties;
          $it.schemaPath = it.schemaPath + '.additionalProperties';
          $it.errSchemaPath = it.errSchemaPath + '/additionalProperties';
          $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
          var $passData = $data + '[' + $key + ']';
          $it.dataPathArr[$dataNxt] = $key;
          var $code = it.validate($it);
          $it.baseId = $currentBaseId;
          if (it.util.varOccurences($code, $nextData) < 2) {
            out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
          } else {
            out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
          }
          out += ' if (!' + ($nextValid) + ') { errors = ' + ($errs) + '; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete ' + ($data) + '[' + ($key) + ']; }  ';
          it.compositeRule = $it.compositeRule = $wasComposite;
        } else {
          $it.schema = $aProperties;
          $it.schemaPath = it.schemaPath + '.additionalProperties';
          $it.errSchemaPath = it.errSchemaPath + '/additionalProperties';
          $it.errorPath = it.opts._errorDataPathProperty ? it.errorPath : it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
          var $passData = $data + '[' + $key + ']';
          $it.dataPathArr[$dataNxt] = $key;
          var $code = it.validate($it);
          $it.baseId = $currentBaseId;
          if (it.util.varOccurences($code, $nextData) < 2) {
            out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
          } else {
            out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
          }
          if ($breakOnError) {
            out += ' if (!' + ($nextValid) + ') break; ';
          }
        }
      }
      it.errorPath = $currentErrorPath;
    }
    if ($someProperties) {
      out += ' } ';
    }
    out += ' }  ';
    if ($breakOnError) {
      out += ' if (' + ($nextValid) + ') { ';
      $closingBraces += '}';
    }
  }
  var $useDefaults = it.opts.useDefaults && !it.compositeRule;
  if ($schemaKeys.length) {
    var arr3 = $schemaKeys;
    if (arr3) {
      var $propertyKey, i3 = -1,
        l3 = arr3.length - 1;
      while (i3 < l3) {
        $propertyKey = arr3[i3 += 1];
        var $sch = $schema[$propertyKey];
        if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
          var $prop = it.util.getProperty($propertyKey),
            $passData = $data + $prop,
            $hasDefault = $useDefaults && $sch.default !== undefined;
          $it.schema = $sch;
          $it.schemaPath = $schemaPath + $prop;
          $it.errSchemaPath = $errSchemaPath + '/' + it.util.escapeFragment($propertyKey);
          $it.errorPath = it.util.getPath(it.errorPath, $propertyKey, it.opts.jsonPointers);
          $it.dataPathArr[$dataNxt] = it.util.toQuotedString($propertyKey);
          var $code = it.validate($it);
          $it.baseId = $currentBaseId;
          if (it.util.varOccurences($code, $nextData) < 2) {
            $code = it.util.varReplace($code, $nextData, $passData);
            var $useData = $passData;
          } else {
            var $useData = $nextData;
            out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ';
          }
          if ($hasDefault) {
            out += ' ' + ($code) + ' ';
          } else {
            if ($requiredHash && $requiredHash[$propertyKey]) {
              out += ' if ( ' + ($useData) + ' === undefined ';
              if ($ownProperties) {
                out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
              }
              out += ') { ' + ($nextValid) + ' = false; ';
              var $currentErrorPath = it.errorPath,
                $currErrSchemaPath = $errSchemaPath,
                $missingProperty = it.util.escapeQuotes($propertyKey);
              if (it.opts._errorDataPathProperty) {
                it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
              }
              $errSchemaPath = it.errSchemaPath + '/required';
              var $$outStack = $$outStack || [];
              $$outStack.push(out);
              out = ''; /* istanbul ignore else */
              if (it.createErrors !== false) {
                out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
                if (it.opts.messages !== false) {
                  out += ' , message: \'';
                  if (it.opts._errorDataPathProperty) {
                    out += 'is a required property';
                  } else {
                    out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
                  }
                  out += '\' ';
                }
                if (it.opts.verbose) {
                  out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
                }
                out += ' } ';
              } else {
                out += ' {} ';
              }
              var __err = out;
              out = $$outStack.pop();
              if (!it.compositeRule && $breakOnError) {
                /* istanbul ignore if */
                if (it.async) {
                  out += ' throw new ValidationError([' + (__err) + ']); ';
                } else {
                  out += ' validate.errors = [' + (__err) + ']; return false; ';
                }
              } else {
                out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
              }
              $errSchemaPath = $currErrSchemaPath;
              it.errorPath = $currentErrorPath;
              out += ' } else { ';
            } else {
              if ($breakOnError) {
                out += ' if ( ' + ($useData) + ' === undefined ';
                if ($ownProperties) {
                  out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
                }
                out += ') { ' + ($nextValid) + ' = true; } else { ';
              } else {
                out += ' if (' + ($useData) + ' !== undefined ';
                if ($ownProperties) {
                  out += ' &&   Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
                }
                out += ' ) { ';
              }
            }
            out += ' ' + ($code) + ' } ';
          }
        }
        if ($breakOnError) {
          out += ' if (' + ($nextValid) + ') { ';
          $closingBraces += '}';
        }
      }
    }
  }
  if ($pPropertyKeys.length) {
    var arr4 = $pPropertyKeys;
    if (arr4) {
      var $pProperty, i4 = -1,
        l4 = arr4.length - 1;
      while (i4 < l4) {
        $pProperty = arr4[i4 += 1];
        var $sch = $pProperties[$pProperty];
        if ((it.opts.strictKeywords ? (typeof $sch == 'object' && Object.keys($sch).length > 0) || $sch === false : it.util.schemaHasRules($sch, it.RULES.all))) {
          $it.schema = $sch;
          $it.schemaPath = it.schemaPath + '.patternProperties' + it.util.getProperty($pProperty);
          $it.errSchemaPath = it.errSchemaPath + '/patternProperties/' + it.util.escapeFragment($pProperty);
          if ($ownProperties) {
            out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';
          } else {
            out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';
          }
          out += ' if (' + (it.usePattern($pProperty)) + '.test(' + ($key) + ')) { ';
          $it.errorPath = it.util.getPathExpr(it.errorPath, $key, it.opts.jsonPointers);
          var $passData = $data + '[' + $key + ']';
          $it.dataPathArr[$dataNxt] = $key;
          var $code = it.validate($it);
          $it.baseId = $currentBaseId;
          if (it.util.varOccurences($code, $nextData) < 2) {
            out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
          } else {
            out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
          }
          if ($breakOnError) {
            out += ' if (!' + ($nextValid) + ') break; ';
          }
          out += ' } ';
          if ($breakOnError) {
            out += ' else ' + ($nextValid) + ' = true; ';
          }
          out += ' }  ';
          if ($breakOnError) {
            out += ' if (' + ($nextValid) + ') { ';
            $closingBraces += '}';
          }
        }
      }
    }
  }
  if ($breakOnError) {
    out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
  }
  return out;
}
A(x'use strict';
module.exports = function generate_propertyNames(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $errs = 'errs__' + $lvl;
  var $it = it.util.copy(it);
  var $closingBraces = '';
  $it.level++;
  var $nextValid = 'valid' + $it.level;
  out += 'var ' + ($errs) + ' = errors;';
  if ((it.opts.strictKeywords ? (typeof $schema == 'object' && Object.keys($schema).length > 0) || $schema === false : it.util.schemaHasRules($schema, it.RULES.all))) {
    $it.schema = $schema;
    $it.schemaPath = $schemaPath;
    $it.errSchemaPath = $errSchemaPath;
    var $key = 'key' + $lvl,
      $idx = 'idx' + $lvl,
      $i = 'i' + $lvl,
      $invalidName = '\' + ' + $key + ' + \'',
      $dataNxt = $it.dataLevel = it.dataLevel + 1,
      $nextData = 'data' + $dataNxt,
      $dataProperties = 'dataProperties' + $lvl,
      $ownProperties = it.opts.ownProperties,
      $currentBaseId = it.baseId;
    if ($ownProperties) {
      out += ' var ' + ($dataProperties) + ' = undefined; ';
    }
    if ($ownProperties) {
      out += ' ' + ($dataProperties) + ' = ' + ($dataProperties) + ' || Object.keys(' + ($data) + '); for (var ' + ($idx) + '=0; ' + ($idx) + '<' + ($dataProperties) + '.length; ' + ($idx) + '++) { var ' + ($key) + ' = ' + ($dataProperties) + '[' + ($idx) + ']; ';
    } else {
      out += ' for (var ' + ($key) + ' in ' + ($data) + ') { ';
    }
    out += ' var startErrs' + ($lvl) + ' = errors; ';
    var $passData = $key;
    var $wasComposite = it.compositeRule;
    it.compositeRule = $it.compositeRule = true;
    var $code = it.validate($it);
    $it.baseId = $currentBaseId;
    if (it.util.varOccurences($code, $nextData) < 2) {
      out += ' ' + (it.util.varReplace($code, $nextData, $passData)) + ' ';
    } else {
      out += ' var ' + ($nextData) + ' = ' + ($passData) + '; ' + ($code) + ' ';
    }
    it.compositeRule = $it.compositeRule = $wasComposite;
    out += ' if (!' + ($nextValid) + ') { for (var ' + ($i) + '=startErrs' + ($lvl) + '; ' + ($i) + '<errors; ' + ($i) + '++) { vErrors[' + ($i) + '].propertyName = ' + ($key) + '; }   var err =   '; /* istanbul ignore else */
    if (it.createErrors !== false) {
      out += ' { keyword: \'' + ('propertyNames') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { propertyName: \'' + ($invalidName) + '\' } ';
      if (it.opts.messages !== false) {
        out += ' , message: \'property name \\\'' + ($invalidName) + '\\\' is invalid\' ';
      }
      if (it.opts.verbose) {
        out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
      }
      out += ' } ';
    } else {
      out += ' {} ';
    }
    out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
    if (!it.compositeRule && $breakOnError) {
      /* istanbul ignore if */
      if (it.async) {
        out += ' throw new ValidationError(vErrors); ';
      } else {
        out += ' validate.errors = vErrors; return false; ';
      }
    }
    if ($breakOnError) {
      out += ' break; ';
    }
    out += ' } }';
  }
  if ($breakOnError) {
    out += ' ' + ($closingBraces) + ' if (' + ($errs) + ' == errors) {';
  }
  return out;
}

4xg'use strict';
module.exports = function generate_ref(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $valid = 'valid' + $lvl;
  var $async, $refCode;
  if ($schema == '#' || $schema == '#/') {
    if (it.isRoot) {
      $async = it.async;
      $refCode = 'validate';
    } else {
      $async = it.root.schema.$async === true;
      $refCode = 'root.refVal[0]';
    }
  } else {
    var $refVal = it.resolveRef(it.baseId, $schema, it.isRoot);
    if ($refVal === undefined) {
      var $message = it.MissingRefError.message(it.baseId, $schema);
      if (it.opts.missingRefs == 'fail') {
        it.logger.error($message);
        var $$outStack = $$outStack || [];
        $$outStack.push(out);
        out = ''; /* istanbul ignore else */
        if (it.createErrors !== false) {
          out += ' { keyword: \'' + ('$ref') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { ref: \'' + (it.util.escapeQuotes($schema)) + '\' } ';
          if (it.opts.messages !== false) {
            out += ' , message: \'can\\\'t resolve reference ' + (it.util.escapeQuotes($schema)) + '\' ';
          }
          if (it.opts.verbose) {
            out += ' , schema: ' + (it.util.toQuotedString($schema)) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
          }
          out += ' } ';
        } else {
          out += ' {} ';
        }
        var __err = out;
        out = $$outStack.pop();
        if (!it.compositeRule && $breakOnError) {
          /* istanbul ignore if */
          if (it.async) {
            out += ' throw new ValidationError([' + (__err) + ']); ';
          } else {
            out += ' validate.errors = [' + (__err) + ']; return false; ';
          }
        } else {
          out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
        }
        if ($breakOnError) {
          out += ' if (false) { ';
        }
      } else if (it.opts.missingRefs == 'ignore') {
        it.logger.warn($message);
        if ($breakOnError) {
          out += ' if (true) { ';
        }
      } else {
        throw new it.MissingRefError(it.baseId, $schema, $message);
      }
    } else if ($refVal.inline) {
      var $it = it.util.copy(it);
      $it.level++;
      var $nextValid = 'valid' + $it.level;
      $it.schema = $refVal.schema;
      $it.schemaPath = '';
      $it.errSchemaPath = $schema;
      var $code = it.validate($it).replace(/validate\.schema/g, $refVal.code);
      out += ' ' + ($code) + ' ';
      if ($breakOnError) {
        out += ' if (' + ($nextValid) + ') { ';
      }
    } else {
      $async = $refVal.$async === true || (it.async && $refVal.$async !== false);
      $refCode = $refVal.code;
    }
  }
  if ($refCode) {
    var $$outStack = $$outStack || [];
    $$outStack.push(out);
    out = '';
    if (it.opts.passContext) {
      out += ' ' + ($refCode) + '.call(this, ';
    } else {
      out += ' ' + ($refCode) + '( ';
    }
    out += ' ' + ($data) + ', (dataPath || \'\')';
    if (it.errorPath != '""') {
      out += ' + ' + (it.errorPath);
    }
    var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',
      $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';
    out += ' , ' + ($parentData) + ' , ' + ($parentDataProperty) + ', rootData)  ';
    var __callValidate = out;
    out = $$outStack.pop();
    if ($async) {
      if (!it.async) throw new Error('async schema referenced by sync schema');
      if ($breakOnError) {
        out += ' var ' + ($valid) + '; ';
      }
      out += ' try { await ' + (__callValidate) + '; ';
      if ($breakOnError) {
        out += ' ' + ($valid) + ' = true; ';
      }
      out += ' } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ';
      if ($breakOnError) {
        out += ' ' + ($valid) + ' = false; ';
      }
      out += ' } ';
      if ($breakOnError) {
        out += ' if (' + ($valid) + ') { ';
      }
    } else {
      out += ' if (!' + (__callValidate) + ') { if (vErrors === null) vErrors = ' + ($refCode) + '.errors; else vErrors = vErrors.concat(' + ($refCode) + '.errors); errors = vErrors.length; } ';
      if ($breakOnError) {
        out += ' else { ';
      }
    }
  }
  return out;
}
(xk0'use strict';
module.exports = function generate_required(it, $keyword, $ruleType) {
  var out = ' ';
  var $lvl = it.level;
  var $dataLvl = it.dataLevel;
  var $schema = it.schema[$keyword];
  var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  var $breakOnError = !it.opts.allErrors;
  var $data = 'data' + ($dataLvl || '');
  var $valid = 'valid' + $lvl;
  var $isData = it.opts.$data && $schema && $schema.$data,
    $schemaValue;
  if ($isData) {
    out += ' var schema' + ($lvl) + ' = ' + (it.util.getData($schema.$data, $dataLvl, it.dataPathArr)) + '; ';
    $schemaValue = 'schema' + $lvl;
  } else {
    $schemaValue = $schema;
  }
  var $vSchema = 'schema' + $lvl;
  if (!$isData) {
    if ($schema.length < it.opts.loopRequired && it.schema.properties && Object.keys(it.schema.properties).length) {
      var $required = [];
      var arr1 = $schema;
      if (arr1) {
        var $property, i1 = -1,
          l1 = arr1.length - 1;
        while (i1 < l1) {
          $property = arr1[i1 += 1];
          var $propertySch = it.schema.properties[$property];
          if (!($propertySch && (it.opts.strictKeywords ? (typeof $propertySch == 'object' && Object.keys($propertySch).length > 0) || $propertySch === false : it.util.schemaHasRules($propertySch, it.RULES.all)))) {
            $required[$required.length] = $property;
          }
        }
      }
    } else {
      var $required = $schema;
    }
  }
  if ($isData || $required.length) {
    var $currentErrorPath = it.errorPath,
      $loopRequired = $isData || $required.length >= it.opts.loopRequired,
      $ownProperties = it.opts.ownProperties;
    if ($breakOnError) {
      out += ' var missing' + ($lvl) + '; ';
      if ($loopRequired) {
        if (!$isData) {
          out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';
        }
        var $i = 'i' + $lvl,
          $propertyPath = 'schema' + $lvl + '[' + $i + ']',
          $missingProperty = '\' + ' + $propertyPath + ' + \'';
        if (it.opts._errorDataPathProperty) {
          it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);
        }
        out += ' var ' + ($valid) + ' = true; ';
        if ($isData) {
          out += ' if (schema' + ($lvl) + ' === undefined) ' + ($valid) + ' = true; else if (!Array.isArray(schema' + ($lvl) + ')) ' + ($valid) + ' = false; else {';
        }
        out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { ' + ($valid) + ' = ' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] !== undefined ';
        if ($ownProperties) {
          out += ' &&   Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';
        }
        out += '; if (!' + ($valid) + ') break; } ';
        if ($isData) {
          out += '  }  ';
        }
        out += '  if (!' + ($valid) + ') {   ';
        var $$outStack = $$outStack || [];
        $$outStack.push(out);
        out = ''; /* istanbul ignore else */
        if (it.createErrors !== false) {
          out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
          if (it.opts.messages !== false) {
            out += ' , message: \'';
            if (it.opts._errorDataPathProperty) {
              out += 'is a required property';
            } else {
              out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
            }
            out += '\' ';
          }
          if (it.opts.verbose) {
            out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
          }
          out += ' } ';
        } else {
          out += ' {} ';
        }
        var __err = out;
        out = $$outStack.pop();
        if (!it.compositeRule && $breakOnError) {
          /* istanbul ignore if */
          if (it.async) {
            out += ' throw new ValidationError([' + (__err) + ']); ';
          } else {
            out += ' validate.errors = [' + (__err) + ']; return false; ';
          }
        } else {
          out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
        }
        out += ' } else { ';
      } else {
        out += ' if ( ';
        var arr2 = $required;
        if (arr2) {
          var $propertyKey, $i = -1,
            l2 = arr2.length - 1;
          while ($i < l2) {
            $propertyKey = arr2[$i += 1];
            if ($i) {
              out += ' || ';
            }
            var $prop = it.util.getProperty($propertyKey),
              $useData = $data + $prop;
            out += ' ( ( ' + ($useData) + ' === undefined ';
            if ($ownProperties) {
              out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
            }
            out += ') && (missing' + ($lvl) + ' = ' + (it.util.toQuotedString(it.opts.jsonPointers ? $propertyKey : $prop)) + ') ) ';
          }
        }
        out += ') {  ';
        var $propertyPath = 'missing' + $lvl,
          $missingProperty = '\' + ' + $propertyPath + ' + \'';
        if (it.opts._errorDataPathProperty) {
          it.errorPath = it.opts.jsonPointers ? it.util.getPathExpr($currentErrorPath, $propertyPath, true) : $currentErrorPath + ' + ' + $propertyPath;
        }
        var $$outStack = $$outStack || [];
        $$outStack.push(out);
        out = ''; /* istanbul ignore else */
        if (it.createErrors !== false) {
          out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
          if (it.opts.messages !== false) {
            out += ' , message: \'';
            if (it.opts._errorDataPathProperty) {
              out += 'is a required property';
            } else {
              out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
            }
            out += '\' ';
          }
          if (it.opts.verbose) {
            out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
          }
          out += ' } ';
        } else {
          out += ' {} ';
        }
        var __err = out;
        out = $$outStack.pop();
        if (!it.compositeRule && $breakOnError) {
          /* istanbul ignore if */
          if (it.async) {
            out += ' throw new ValidationError([' + (__err) + ']); ';
          } else {
            out += ' validate.errors = [' + (__err) + ']; return false; ';
          }
        } else {
          out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
        }
        out += ' } else { ';
      }
    } else {
      if ($loopRequired) {
        if (!$isData) {
          out += ' var ' + ($vSchema) + ' = validate.schema' + ($schemaPath) + '; ';
        }
        var $i = 'i' + $lvl,
          $propertyPath = 'schema' + $lvl + '[' + $i + ']',
          $missingProperty = '\' + ' + $propertyPath + ' + \'';
        if (it.opts._errorDataPathProperty) {
          it.errorPath = it.util.getPathExpr($currentErrorPath, $propertyPath, it.opts.jsonPointers);
        }
        if ($isData) {
          out += ' if (' + ($vSchema) + ' && !Array.isArray(' + ($vSchema) + ')) {  var err =   '; /* istanbul ignore else */
          if (it.createErrors !== false) {
            out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
            if (it.opts.messages !== false) {
              out += ' , message: \'';
              if (it.opts._errorDataPathProperty) {
                out += 'is a required property';
              } else {
                out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
              }
              out += '\' ';
            }
            if (it.opts.verbose) {
              out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
            }
            out += ' } ';
          } else {
            out += ' {} ';
          }
          out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if (' + ($vSchema) + ' !== undefined) { ';
        }
        out += ' for (var ' + ($i) + ' = 0; ' + ($i) + ' < ' + ($vSchema) + '.length; ' + ($i) + '++) { if (' + ($data) + '[' + ($vSchema) + '[' + ($i) + ']] === undefined ';
        if ($ownProperties) {
          out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', ' + ($vSchema) + '[' + ($i) + ']) ';
        }
        out += ') {  var err =   '; /* istanbul ignore else */
        if (it.createErrors !== false) {
          out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
          if (it.opts.messages !== false) {
            out += ' , message: \'';
            if (it.opts._errorDataPathProperty) {
              out += 'is a required property';
            } else {
              out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
            }
            out += '\' ';
          }
          if (it.opts.verbose) {
            out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
          }
          out += ' } ';
        } else {
          out += ' {} ';
        }
        out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ';
        if ($isData) {
          out += '  }  ';
        }
      } else {
        var arr3 = $required;
        if (arr3) {
          var $propertyKey, i3 = -1,
            l3 = arr3.length - 1;
          while (i3 < l3) {
            $propertyKey = arr3[i3 += 1];
            var $prop = it.util.getProperty($propertyKey),
              $missingProperty = it.util.escapeQuotes($propertyKey),
              $useData = $data + $prop;
            if (it.opts._errorDataPathProperty) {
              it.errorPath = it.util.getPath($currentErrorPath, $propertyKey, it.opts.jsonPointers);
            }
            out += ' if ( ' + ($useData) + ' === undefined ';
            if ($ownProperties) {
              out += ' || ! Object.prototype.hasOwnProperty.call(' + ($data) + ', \'' + (it.util.escapeQuotes($propertyKey)) + '\') ';
            }
            out += ') {  var err =   '; /* istanbul ignore else */
            if (it.createErrors !== false) {
              out += ' { keyword: \'' + ('required') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { missingProperty: \'' + ($missingProperty) + '\' } ';
              if (it.opts.messages !== false) {
                out += ' , message: \'';
                if (it.opts._errorDataPathProperty) {
                  out += 'is a required property';
                } else {
                  out += 'should have required property \\\'' + ($missingProperty) + '\\\'';
                }
                out += '\' ';
              }
              if (it.opts.verbose) {
                out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
              }
              out += ' } ';
            } else {
              out += ' {} ';
            }
            out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } ';
          }
        }
      }
    }
    it.errorPath = $currentErrorPath;
  } else if ($breakOnError) {
    out += ' if (true) {';
  }
  return out;
}

ox1unique7;)valid = 'valid' + $lvl$;($schema || $isData) && it.opts.uniqueItems !== false) {
  p%  out += ' var ' + ($valid) + '; if (=== false ||7=== undefined) ' + ($valid) + ' = true; else if (typeof!= \'boolean\') ' + ($valid) + ' = false; else { ';
    }
    out += ' var i = ' + ($data) + '.length , ' + ($valid) + ' = true , j; if (i > 1) { ';
    var $itemType = it.schema.items && it.schema.items.type,
      $typeIsArray = Array.isArray($itemType);
    if (!$itemType || $itemType == 'object' || $itemType == 'array' || ($typeIsArray && ($itemType.indexOf('object') >= 0 || $itemType.indexOf('array') >= 0))) {
      out += ' outer: for (;i--;) { for (j = i; j--;) { if (equal(' + ($data) + '[i], ' +@ ($data) + '[j])) { ' + ($valid) + ' = false; break outer; } } }_	"r itemIndices = {}, item; for (;i--;) { var item = ' + ($data) + '[i]; ';
      var $method = 'checkDataType' + ($typeIsArray ? 's' : '');
      out += ' if (' + (it.util[$method]($itemType, 'item', it.opts.strictNumbers, true)) + ') continue; ';
      iXf ($typeIsArray) {
        out += ' if (typeof item == \'string\') item = \'"\' + item; if (typeof itemIndices[item] == \'number\') { ' + ($valid) + ' = false; j = itemIndices[item]; break; } itemIndices[item] = i; }[pE  out += '  }  ';
    }
    out += ' if (!' + ($valid) + ') {   ';
  [')'$  out += ' { keyword: \'' + ('uniquei: i, j: j } ';
  ,(Tduplicate items (items ## \' + j + \' and \' + i + \' are identical)\' ';
      }
  A!`p6  }
  m}_	 #{} ';
    }
    var __err = out;
  0  /* istanbul ignore if */
  	'	@~	;  }
    } else {
  	waN
  out += ' else {	P
4  out += ' if (true) { ';
    }
  }
  return out;
}
!X	x2Nͱ'use strict';
module.exports = function generate_validate(it, $keyword, $ruleType) {
  var out = '';
  var $async = it.schema.$async === true,
    $refKeywords = it.util.schemaHasRulesExcept(it.schema, it.RULES.all, '$ref'),
    $id = it.self._getId(it.schema);
  if (it.opts.strictKeywords) {
    var $unknownKwd = it.util.schemaUnknownRules(it.schema, it.RULES.keywords);
    if ($unknownKwd) {
      var $keywordsMsg = 'unknown keyword: ' + $unknownKwd;
      if (it.opts.strictKeywords === 'log') it.logger.warn($keywordsMsg);
      else throw new Error($keywordsMsg);
    }
  }
  if (it.isTop) {
    out += ' var validate = ';
    if ($async) {
      it.async = true;
      out += 'async ';
    }
    out += 'function(data, dataPath, parentData, parentDataProperty, rootData) { \'use strict\'; ';
    if ($id && (it.opts.sourceCode || it.opts.processCode)) {
      out += ' ' + ('/\*# sourceURL=' + $id + ' */') + ' ';
    }
  }
  if (typeof it.schema == 'boolean' || !($refKeywords || it.schema.$ref)) {
    var $keyword = 'false schema';
    var $lvl = it.level;
    var $dataLvl = it.dataLevel;
    var $schema = it.schema[$keyword];
    var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
    var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
    var $breakOnError = !it.opts.allErrors;
    var $errorKeyword;
    var $data = 'data' + ($dataLvl || '');
    var $valid = 'valid' + $lvl;
    if (it.schema === false) {
      if (it.isTop) {
        $breakOnError = true;
      } else {
        out += ' var ' + ($valid) + ' = false; ';
      }
      var $$outStack = $$outStack || [];
      $$outStack.push(out);
      out = ''; /* istanbul ignore else */
      if (it.createErrors !== false) {
        out += ' { keyword: \'' + ($errorKeyword || 'false schema') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
        if (it.opts.messages !== false) {
          out += ' , message: \'boolean schema is false\' ';
        }
        if (it.opts.verbose) {
          out += ' , schema: false , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
        }
        out += ' } ';
      } else {
        out += ' {} ';
      }
      var __err = out;
      out = $$outStack.pop();
      if (!it.compositeRule && $breakOnError) {
        /* istanbul ignore if */
        if (it.async) {
          out += ' throw new ValidationError([' + (__err) + ']); ';
        } else {
          out += ' validate.errors = [' + (__err) + ']; return false; ';
        }
      } else {
        out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
      }
    } else {
      if (it.isTop) {
        if ($async) {
          out += ' return data; ';
        } else {
          out += ' validate.errors = null; return true; ';
        }
      } else {
        out += ' var ' + ($valid) + ' = true; ';
      }
    }
    if (it.isTop) {
      out += ' }; return validate; ';
    }
    return out;
  }
  if (it.isTop) {
    var $top = it.isTop,
      $lvl = it.level = 0,
      $dataLvl = it.dataLevel = 0,
      $data = 'data';
    it.rootId = it.resolve.fullPath(it.self._getId(it.root.schema));
    it.baseId = it.baseId || it.rootId;
    delete it.isTop;
    it.dataPathArr = [""];
    if (it.schema.default !== undefined && it.opts.useDefaults && it.opts.strictDefaults) {
      var $defaultMsg = 'default is ignored in the schema root';
      if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);
      else throw new Error($defaultMsg);
    }
    out += ' var vErrors = null; ';
    out += ' var errors = 0;     ';
    out += ' if (rootData === undefined) rootData = data; ';
  } else {
    var $lvl = it.level,
      $dataLvl = it.dataLevel,
      $data = 'data' + ($dataLvl || '');
    if ($id) it.baseId = it.resolve.url(it.baseId, $id);
    if ($async && !it.async) throw new Error('async schema in sync schema');
    out += ' var errs_' + ($lvl) + ' = errors;';
  }
  var $valid = 'valid' + $lvl,
    $breakOnError = !it.opts.allErrors,
    $closingBraces1 = '',
    $closingBraces2 = '';
  var $errorKeyword;
  var $typeSchema = it.schema.type,
    $typeIsArray = Array.isArray($typeSchema);
  if ($typeSchema && it.opts.nullable && it.schema.nullable === true) {
    if ($typeIsArray) {
      if ($typeSchema.indexOf('null') == -1) $typeSchema = $typeSchema.concat('null');
    } else if ($typeSchema != 'null') {
      $typeSchema = [$typeSchema, 'null'];
      $typeIsArray = true;
    }
  }
  if ($typeIsArray && $typeSchema.length == 1) {
    $typeSchema = $typeSchema[0];
    $typeIsArray = false;
  }
  if (it.schema.$ref && $refKeywords) {
    if (it.opts.extendRefs == 'fail') {
      throw new Error('$ref: validation keywords used in schema at path "' + it.errSchemaPath + '" (see option extendRefs)');
    } else if (it.opts.extendRefs !== true) {
      $refKeywords = false;
      it.logger.warn('$ref: keywords ignored in schema at path "' + it.errSchemaPath + '"');
    }
  }
  if (it.schema.$comment && it.opts.$comment) {
    out += ' ' + (it.RULES.all.$comment.code(it, '$comment'));
  }
  if ($typeSchema) {
    if (it.opts.coerceTypes) {
      var $coerceToTypes = it.util.coerceToTypes(it.opts.coerceTypes, $typeSchema);
    }
    var $rulesGroup = it.RULES.types[$typeSchema];
    if ($coerceToTypes || $typeIsArray || $rulesGroup === true || ($rulesGroup && !$shouldUseGroup($rulesGroup))) {
      var $schemaPath = it.schemaPath + '.type',
        $errSchemaPath = it.errSchemaPath + '/type';
      var $schemaPath = it.schemaPath + '.type',
        $errSchemaPath = it.errSchemaPath + '/type',
        $method = $typeIsArray ? 'checkDataTypes' : 'checkDataType';
      out += ' if (' + (it.util[$method]($typeSchema, $data, it.opts.strictNumbers, true)) + ') { ';
      if ($coerceToTypes) {
        var $dataType = 'dataType' + $lvl,
          $coerced = 'coerced' + $lvl;
        out += ' var ' + ($dataType) + ' = typeof ' + ($data) + '; var ' + ($coerced) + ' = undefined; ';
        if (it.opts.coerceTypes == 'array') {
          out += ' if (' + ($dataType) + ' == \'object\' && Array.isArray(' + ($data) + ') && ' + ($data) + '.length == 1) { ' + ($data) + ' = ' + ($data) + '[0]; ' + ($dataType) + ' = typeof ' + ($data) + '; if (' + (it.util.checkDataType(it.schema.type, $data, it.opts.strictNumbers)) + ') ' + ($coerced) + ' = ' + ($data) + '; } ';
        }
        out += ' if (' + ($coerced) + ' !== undefined) ; ';
        var arr1 = $coerceToTypes;
        if (arr1) {
          var $type, $i = -1,
            l1 = arr1.length - 1;
          while ($i < l1) {
            $type = arr1[$i += 1];
            if ($type == 'string') {
              out += ' else if (' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\') ' + ($coerced) + ' = \'\' + ' + ($data) + '; else if (' + ($data) + ' === null) ' + ($coerced) + ' = \'\'; ';
            } else if ($type == 'number' || $type == 'integer') {
              out += ' else if (' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' === null || (' + ($dataType) + ' == \'string\' && ' + ($data) + ' && ' + ($data) + ' == +' + ($data) + ' ';
              if ($type == 'integer') {
                out += ' && !(' + ($data) + ' % 1)';
              }
              out += ')) ' + ($coerced) + ' = +' + ($data) + '; ';
            } else if ($type == 'boolean') {
              out += ' else if (' + ($data) + ' === \'false\' || ' + ($data) + ' === 0 || ' + ($data) + ' === null) ' + ($coerced) + ' = false; else if (' + ($data) + ' === \'true\' || ' + ($data) + ' === 1) ' + ($coerced) + ' = true; ';
            } else if ($type == 'null') {
              out += ' else if (' + ($data) + ' === \'\' || ' + ($data) + ' === 0 || ' + ($data) + ' === false) ' + ($coerced) + ' = null; ';
            } else if (it.opts.coerceTypes == 'array' && $type == 'array') {
              out += ' else if (' + ($dataType) + ' == \'string\' || ' + ($dataType) + ' == \'number\' || ' + ($dataType) + ' == \'boolean\' || ' + ($data) + ' == null) ' + ($coerced) + ' = [' + ($data) + ']; ';
            }
          }
        }
        out += ' else {   ';
        var $$outStack = $$outStack || [];
        $$outStack.push(out);
        out = ''; /* istanbul ignore else */
        if (it.createErrors !== false) {
          out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \'';
          if ($typeIsArray) {
            out += '' + ($typeSchema.join(","));
          } else {
            out += '' + ($typeSchema);
          }
          out += '\' } ';
          if (it.opts.messages !== false) {
            out += ' , message: \'should be ';
            if ($typeIsArray) {
              out += '' + ($typeSchema.join(","));
            } else {
              out += '' + ($typeSchema);
            }
            out += '\' ';
          }
          if (it.opts.verbose) {
            out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
          }
          out += ' } ';
        } else {
          out += ' {} ';
        }
        var __err = out;
        out = $$outStack.pop();
        if (!it.compositeRule && $breakOnError) {
          /* istanbul ignore if */
          if (it.async) {
            out += ' throw new ValidationError([' + (__err) + ']); ';
          } else {
            out += ' validate.errors = [' + (__err) + ']; return false; ';
          }
        } else {
          out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
        }
        out += ' } if (' + ($coerced) + ' !== undefined) {  ';
        var $parentData = $dataLvl ? 'data' + (($dataLvl - 1) || '') : 'parentData',
          $parentDataProperty = $dataLvl ? it.dataPathArr[$dataLvl] : 'parentDataProperty';
        out += ' ' + ($data) + ' = ' + ($coerced) + '; ';
        if (!$dataLvl) {
          out += 'if (' + ($parentData) + ' !== undefined)';
        }
        out += ' ' + ($parentData) + '[' + ($parentDataProperty) + '] = ' + ($coerced) + '; } ';
      } else {
        var $$outStack = $$outStack || [];
        $$outStack.push(out);
        out = ''; /* istanbul ignore else */
        if (it.createErrors !== false) {
          out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \'';
          if ($typeIsArray) {
            out += '' + ($typeSchema.join(","));
          } else {
            out += '' + ($typeSchema);
          }
          out += '\' } ';
          if (it.opts.messages !== false) {
            out += ' , message: \'should be ';
            if ($typeIsArray) {
              out += '' + ($typeSchema.join(","));
            } else {
              out += '' + ($typeSchema);
            }
            out += '\' ';
          }
          if (it.opts.verbose) {
            out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
          }
          out += ' } ';
        } else {
          out += ' {} ';
        }
        var __err = out;
        out = $$outStack.pop();
        if (!it.compositeRule && $breakOnError) {
          /* istanbul ignore if */
          if (it.async) {
            out += ' throw new ValidationError([' + (__err) + ']); ';
          } else {
            out += ' validate.errors = [' + (__err) + ']; return false; ';
          }
        } else {
          out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
        }
      }
      out += ' } ';
    }
  }
  if (it.schema.$ref && !$refKeywords) {
    out += ' ' + (it.RULES.all.$ref.code(it, '$ref')) + ' ';
    if ($breakOnError) {
      out += ' } if (errors === ';
      if ($top) {
        out += '0';
      } else {
        out += 'errs_' + ($lvl);
      }
      out += ') { ';
      $closingBraces2 += '}';
    }
  } else {
    var arr2 = it.RULES;
    if (arr2) {
      var $rulesGroup, i2 = -1,
        l2 = arr2.length - 1;
      while (i2 < l2) {
        $rulesGroup = arr2[i2 += 1];
        if ($shouldUseGroup($rulesGroup)) {
          if ($rulesGroup.type) {
            out += ' if (' + (it.util.checkDataType($rulesGroup.type, $data, it.opts.strictNumbers)) + ') { ';
          }
          if (it.opts.useDefaults) {
            if ($rulesGroup.type == 'object' && it.schema.properties) {
              var $schema = it.schema.properties,
                $schemaKeys = Object.keys($schema);
              var arr3 = $schemaKeys;
              if (arr3) {
                var $propertyKey, i3 = -1,
                  l3 = arr3.length - 1;
                while (i3 < l3) {
                  $propertyKey = arr3[i3 += 1];
                  var $sch = $schema[$propertyKey];
                  if ($sch.default !== undefined) {
                    var $passData = $data + it.util.getProperty($propertyKey);
                    if (it.compositeRule) {
                      if (it.opts.strictDefaults) {
                        var $defaultMsg = 'default is ignored for: ' + $passData;
                        if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);
                        else throw new Error($defaultMsg);
                      }
                    } else {
                      out += ' if (' + ($passData) + ' === undefined ';
                      if (it.opts.useDefaults == 'empty') {
                        out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' ';
                      }
                      out += ' ) ' + ($passData) + ' = ';
                      if (it.opts.useDefaults == 'shared') {
                        out += ' ' + (it.useDefault($sch.default)) + ' ';
                      } else {
                        out += ' ' + (JSON.stringify($sch.default)) + ' ';
                      }
                      out += '; ';
                    }
                  }
                }
              }
            } else if ($rulesGroup.type == 'array' && Array.isArray(it.schema.items)) {
              var arr4 = it.schema.items;
              if (arr4) {
                var $sch, $i = -1,
                  l4 = arr4.length - 1;
                while ($i < l4) {
                  $sch = arr4[$i += 1];
                  if ($sch.default !== undefined) {
                    var $passData = $data + '[' + $i + ']';
                    if (it.compositeRule) {
                      if (it.opts.strictDefaults) {
                        var $defaultMsg = 'default is ignored for: ' + $passData;
                        if (it.opts.strictDefaults === 'log') it.logger.warn($defaultMsg);
                        else throw new Error($defaultMsg);
                      }
                    } else {
                      out += ' if (' + ($passData) + ' === undefined ';
                      if (it.opts.useDefaults == 'empty') {
                        out += ' || ' + ($passData) + ' === null || ' + ($passData) + ' === \'\' ';
                      }
                      out += ' ) ' + ($passData) + ' = ';
                      if (it.opts.useDefaults == 'shared') {
                        out += ' ' + (it.useDefault($sch.default)) + ' ';
                      } else {
                        out += ' ' + (JSON.stringify($sch.default)) + ' ';
                      }
                      out += '; ';
                    }
                  }
                }
              }
            }
          }
          var arr5 = $rulesGroup.rules;
          if (arr5) {
            var $rule, i5 = -1,
              l5 = arr5.length - 1;
            while (i5 < l5) {
              $rule = arr5[i5 += 1];
              if ($shouldUseRule($rule)) {
                var $code = $rule.code(it, $rule.keyword, $rulesGroup.type);
                if ($code) {
                  out += ' ' + ($code) + ' ';
                  if ($breakOnError) {
                    $closingBraces1 += '}';
                  }
                }
              }
            }
          }
          if ($breakOnError) {
            out += ' ' + ($closingBraces1) + ' ';
            $closingBraces1 = '';
          }
          if ($rulesGroup.type) {
            out += ' } ';
            if ($typeSchema && $typeSchema === $rulesGroup.type && !$coerceToTypes) {
              out += ' else { ';
              var $schemaPath = it.schemaPath + '.type',
                $errSchemaPath = it.errSchemaPath + '/type';
              var $$outStack = $$outStack || [];
              $$outStack.push(out);
              out = ''; /* istanbul ignore else */
              if (it.createErrors !== false) {
                out += ' { keyword: \'' + ($errorKeyword || 'type') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: { type: \'';
                if ($typeIsArray) {
                  out += '' + ($typeSchema.join(","));
                } else {
                  out += '' + ($typeSchema);
                }
                out += '\' } ';
                if (it.opts.messages !== false) {
                  out += ' , message: \'should be ';
                  if ($typeIsArray) {
                    out += '' + ($typeSchema.join(","));
                  } else {
                    out += '' + ($typeSchema);
                  }
                  out += '\' ';
                }
                if (it.opts.verbose) {
                  out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
                }
                out += ' } ';
              } else {
                out += ' {} ';
              }
              var __err = out;
              out = $$outStack.pop();
              if (!it.compositeRule && $breakOnError) {
                /* istanbul ignore if */
                if (it.async) {
                  out += ' throw new ValidationError([' + (__err) + ']); ';
                } else {
                  out += ' validate.errors = [' + (__err) + ']; return false; ';
                }
              } else {
                out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
              }
              out += ' } ';
            }
          }
          if ($breakOnError) {
            out += ' if (errors === ';
            if ($top) {
              out += '0';
            } else {
              out += 'errs_' + ($lvl);
            }
            out += ') { ';
            $closingBraces2 += '}';
          }
        }
      }
    }
  }
  if ($breakOnError) {
    out += ' ' + ($closingBraces2) + ' ';
  }
  if ($top) {
    if ($async) {
      out += ' if (errors === 0) return data;           ';
      out += ' else throw new ValidationError(vErrors); ';
    } else {
      out += ' validate.errors = vErrors; ';
      out += ' return errors === 0;       ';
    }
    out += ' }; return validate;';
  } else {
    out += ' var ' + ($valid) + ' = errors === errs_' + ($lvl) + ';';
  }

  function $shouldUseGroup($rulesGroup) {
    var rules = $rulesGroup.rules;
    for (var i = 0; i < rules.length; i++)
      if ($shouldUseRule(rules[i])) return true;
  }

  function $shouldUseRule($rule) {
    return it.schema[$rule.keyword] !== undefined || ($rule.implements && $ruleImplementsSomeKeyword($rule));
  }

  function $ruleImplementsSomeKeyword($rule) {
    var impl = $rule.implements;
    for (var i = 0; i < impl.length; i++)
      if (it.schema[impl[i]] !== undefined) return true;
  }
  return out;
}
j!xG'use strict';

var IDENTIFIER = /^[a-z_$][a-z0-9_$-]*$/i;
var customRuleCode = require('./dotjs/custom');
var definitionSchema = require('./definition_schema');

module.exports = {
  add: addKeyword,
  get: getKeyword,
  remove: removeKeyword,
  validate: validateKeyword
};


/**
 * Define custom keyword
 * @this  Ajv
 * @param {String} keyword custom keyword, should be unique (including different from all standard, custom and macro keywords).
 * @param {Object} definition keyword definition object with properties `type` (type(s) which the keyword applies to), `validate` or `compile`.
 * @return {Ajv} this for method chaining
 */
function addKeyword(keyword, definition) {
  /* jshint validthis: true */
  /* eslint no-shadow: 0 */
  var RULES = this.RULES;
  if (RULES.keywords[keyword])
    throw new Error('Keyword ' + keyword + ' is already defined');

  if (!IDENTIFIER.test(keyword))
    throw new Error('Keyword ' + keyword + ' is not a valid identifier');

  if (definition) {
    this.validateKeyword(definition, true);

    var dataType = definition.type;
    if (Array.isArray(dataType)) {
      for (var i=0; i<dataType.length; i++)
        _addRule(keyword, dataType[i], definition);
    } else {
      _addRule(keyword, dataType, definition);
    }

    var metaSchema = definition.metaSchema;
    if (metaSchema) {
      if (definition.$data && this._opts.$data) {
        metaSchema = {
          anyOf: [
            metaSchema,
            { '$ref': 'https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#' }
          ]
        };
      }
      definition.validateSchema = this.compile(metaSchema, true);
    }
  }

  RULES.keywords[keyword] = RULES.all[keyword] = true;


  function _addRule(keyword, dataType, definition) {
    var ruleGroup;
    for (var i=0; i<RULES.length; i++) {
      var rg = RULES[i];
      if (rg.type == dataType) {
        ruleGroup = rg;
        break;
      }
    }

    if (!ruleGroup) {
      ruleGroup = { type: dataType, rules: [] };
      RULES.push(ruleGroup);
    }

    var rule = {
      keyword: keyword,
      definition: definition,
      custom: true,
      code: customRuleCode,
      implements: definition.implements
    };
    ruleGroup.rules.push(rule);
    RULES.custom[keyword] = rule;
  }

  return this;
}


/**
 * Get keyword
 * @this  Ajv
 * @param {String} keyword pre-defined or custom keyword.
 * @return {Object|Boolean} custom keyword definition, `true` if it is a predefined keyword, `false` otherwise.
 */
function getKeyword(keyword) {
  /* jshint validthis: true */
  var rule = this.RULES.custom[keyword];
  return rule ? rule.definition : this.RULES.keywords[keyword] || false;
}


/**
 * Remove keyword
 * @this  Ajv
 * @param {String} keyword pre-defined or custom keyword.
 * @return {Ajv} this for method chaining
 */
function removeKeyword(keyword) {
  /* jshint validthis: true */
  var RULES = this.RULES;
  delete RULES.keywords[keyword];
  delete RULES.all[keyword];
  delete RULES.custom[keyword];
  for (var i=0; i<RULES.length; i++) {
    var rules = RULES[i].rules;
    for (var j=0; j<rules.length; j++) {
      if (rules[j].keyword == keyword) {
        rules.splice(j, 1);
        break;
      }
    }
  }
  return this;
}


/**
 * Validate keyword definition
 * @this  Ajv
 * @param {Object} definition keyword definition object.
 * @param {Boolean} throwError true to throw exception if definition is invalid
 * @return {boolean} validation result
 */
function validateKeyword(definition, throwError) {
  validateKeyword.errors = null;
  var v = this._validateKeyword = this._validateKeyword
                                  || this.compile(definitionSchema, true);

  if (v(definition)) return true;
  validateKeyword.errors = v.errors;
  if (throwError)
    throw new Error('custom keyword definition is invalid: '  + this.errorsText(v.errors));
  else
    return false;
}
룧x 100644 data.json dŶЊXF100644 json-schema-draft-04.json t>88_
[˯ɑ6100644 json-schema-draft-06.json VV$r@H|<5%100644 json-schema-draft-07.json [6'E<I100644 json-schema-secure.json zGff:ܯ^kB_i"x'{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",
    "description": "Meta-schema for $data reference (JSON Schema extension proposal)",
    "type": "object",
    "required": [ "$data" ],
    "properties": {
        "$data": {
            "type": "string",
            "anyOf": [
                { "format": "relative-json-pointer" }, 
                { "format": "json-pointer" }
            ]
        }
    },
    "additionalProperties": false
}
\x{
    "id": "http://json-schema.org/draft-04/schema#",
    "$schema": "http://json-schema.org/draft-04/schema#",
    "description": "Core schema meta-schema",
    "definitions": {
        "schemaArray": {
            "type": "array",
            "minItems": 1,
            "items": { "$ref": "#" }
        },
        "positiveInteger": {
            "type": "integer",
            "minimum": 0
        },
        "positiveIntegerDefault0": {
            "allOf": [ { "$ref": "#/definitions/positiveInteger" }, { "default": 0 } ]
        },
        "simpleTypes": {
            "enum": [ "array", "boolean", "integer", "null", "number", "object", "string" ]
        },
        "stringArray": {
            "type": "array",
            "items": { "type": "string" },
            "minItems": 1,
            "uniqueItems": true
        }
    },
    "type": "object",
    "properties": {
        "id": {
            "type": "string"
        },
        "$schema": {
            "type": "string"
        },
        "title": {
            "type": "string"
        },
        "description": {
            "type": "string"
        },
        "default": {},
        "multipleOf": {
            "type": "number",
            "minimum": 0,
            "exclusiveMinimum": true
        },
        "maximum": {
            "type": "number"
        },
        "exclusiveMaximum": {
            "type": "boolean",
            "default": false
        },
        "minimum": {
            "type": "number"
        },
        "exclusiveMinimum": {
            "type": "boolean",
            "default": false
        },
        "maxLength": { "$ref": "#/definitions/positiveInteger" },
        "minLength": { "$ref": "#/definitions/positiveIntegerDefault0" },
        "pattern": {
            "type": "string",
            "format": "regex"
        },
        "additionalItems": {
            "anyOf": [
                { "type": "boolean" },
                { "$ref": "#" }
            ],
            "default": {}
        },
        "items": {
            "anyOf": [
                { "$ref": "#" },
                { "$ref": "#/definitions/schemaArray" }
            ],
            "default": {}
        },
        "maxItems": { "$ref": "#/definitions/positiveInteger" },
        "minItems": { "$ref": "#/definitions/positiveIntegerDefault0" },
        "uniqueItems": {
            "type": "boolean",
            "default": false
        },
        "maxProperties": { "$ref": "#/definitions/positiveInteger" },
        "minProperties": { "$ref": "#/definitions/positiveIntegerDefault0" },
        "required": { "$ref": "#/definitions/stringArray" },
        "additionalProperties": {
            "anyOf": [
                { "type": "boolean" },
                { "$ref": "#" }
            ],
            "default": {}
        },
        "definitions": {
            "type": "object",
            "additionalProperties": { "$ref": "#" },
            "default": {}
        },
        "properties": {
            "type": "object",
            "additionalProperties": { "$ref": "#" },
            "default": {}
        },
        "patternProperties": {
            "type": "object",
            "additionalProperties": { "$ref": "#" },
            "default": {}
        },
        "dependencies": {
            "type": "object",
            "additionalProperties": {
                "anyOf": [
                    { "$ref": "#" },
                    { "$ref": "#/definitions/stringArray" }
                ]
            }
        },
        "enum": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true
        },
        "type": {
            "anyOf": [
                { "$ref": "#/definitions/simpleTypes" },
                {
                    "type": "array",
                    "items": { "$ref": "#/definitions/simpleTypes" },
                    "minItems": 1,
                    "uniqueItems": true
                }
            ]
        },
        "format": { "type": "string" },
        "allOf": { "$ref": "#/definitions/schemaArray" },
        "anyOf": { "$ref": "#/definitions/schemaArray" },
        "oneOf": { "$ref": "#/definitions/schemaArray" },
        "not": { "$ref": "#" }
    },
    "dependencies": {
        "exclusiveMaximum": [ "maximum" ],
        "exclusiveMinimum": [ "minimum" ]
    },
    "default": {}
}
=Rx{
    "$schema": "http://json-schema.org/draft-07/schema#",
    "$id": "http://json-schema.org/draft-07/schema#",
    "title": "Core schema meta-schema",
    "definitions": {
        "schemaArray": {
            "type": "array",
            "minItems": 1,
            "items": { "$ref": "#" }
        },
        "nonNegativeInteger": {
            "type": "integer",
            "minimum": 0
        },
        "nonNegativeIntegerDefault0": {
            "allOf": [
                { "$ref": "#/definitions/nonNegativeInteger" },
                { "default": 0 }
            ]
        },
        "simpleTypes": {
            "enum": [
                "array",
                "boolean",
                "integer",
                "null",
                "number",
                "object",
                "string"
            ]
        },
        "stringArray": {
            "type": "array",
            "items": { "type": "string" },
            "uniqueItems": true,
            "default": []
        }
    },
    "type": ["object", "boolean"],
    "properties": {
        "$id": {
            "type": "string",
            "format": "uri-reference"
        },
        "$schema": {
            "type": "string",
            "format": "uri"
        },
        "$ref": {
            "type": "string",
            "format": "uri-reference"
        },
        "$comment": {
            "type": "string"
        },
        "title": {
            "type": "string"
        },
        "description": {
            "type": "string"
        },
        "default": true,
        "readOnly": {
            "type": "boolean",
            "default": false
        },
        "examples": {
            "type": "array",
            "items": true
        },
        "multipleOf": {
            "type": "number",
            "exclusiveMinimum": 0
        },
        "maximum": {
            "type": "number"
        },
        "exclusiveMaximum": {
            "type": "number"
        },
        "minimum": {
            "type": "number"
        },
        "exclusiveMinimum": {
            "type": "number"
        },
        "maxLength": { "$ref": "#/definitions/nonNegativeInteger" },
        "minLength": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
        "pattern": {
            "type": "string",
            "format": "regex"
        },
        "additionalItems": { "$ref": "#" },
        "items": {
            "anyOf": [
                { "$ref": "#" },
                { "$ref": "#/definitions/schemaArray" }
            ],
            "default": true
        },
        "maxItems": { "$ref": "#/definitions/nonNegativeInteger" },
        "minItems": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
        "uniqueItems": {
            "type": "boolean",
            "default": false
        },
        "contains": { "$ref": "#" },
        "maxProperties": { "$ref": "#/definitions/nonNegativeInteger" },
        "minProperties": { "$ref": "#/definitions/nonNegativeIntegerDefault0" },
        "required": { "$ref": "#/definitions/stringArray" },
        "additionalProperties": { "$ref": "#" },
        "definitions": {
            "type": "object",
            "additionalProperties": { "$ref": "#" },
            "default": {}
        },
        "properties": {
            "type": "object",
            "additionalProperties": { "$ref": "#" },
            "default": {}
        },
        "patternProperties": {
            "type": "object",
            "additionalProperties": { "$ref": "#" },
            "propertyNames": { "format": "regex" },
            "default": {}
        },
        "dependencies": {
            "type": "object",
            "additionalProperties": {
                "anyOf": [
                    { "$ref": "#" },
                    { "$ref": "#/definitions/stringArray" }
                ]
            }
        },
        "propertyNames": { "$ref": "#" },
        "const": true,
        "enum": {
            "type": "array",
            "items": true,
            "minItems": 1,
            "uniqueItems": true
        },
        "type": {
            "anyOf": [
                { "$ref": "#/definitions/simpleTypes" },
                {
                    "type": "array",
                    "items": { "$ref": "#/definitions/simpleTypes" },
                    "minItems": 1,
                    "uniqueItems": true
                }
            ]
        },
        "format": { "type": "string" },
        "contentMediaType": { "type": "string" },
        "contentEncoding": { "type": "string" },
        "if": {"$ref": "#"},
        "then": {"$ref": "#"},
        "else": {"$ref": "#"},
        "allOf": { "$ref": "#/definitions/schemaArray" },
        "anyOf": { "$ref": "#/definitions/schemaArray" },
        "oneOf": { "$ref": "#/definitions/schemaArray" },
        "not": { "$ref": "#" }
    },
    "default": true
}
VxW &"06156g{tK{}@#


7{}X>.{}
}
Dx
{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/json-schema-secure.json#",
  "title": "Meta-schema for the security assessment of JSON Schemas",
  "description": "If a JSON Schema fails validation against this meta-schema, it may be unsafe to validate untrusted data",
  "definitions": {
    "schemaArray": {
      "type": "array",
      "minItems": 1,
      "items": {"$ref": "#"}
    }
  },
  "dependencies": {
    "patternProperties": {
      "description": "prevent slow validation of large property names",
      "required": ["propertyNames"],
      "properties": {
        "propertyNames": {
          "required": ["maxLength"]
        }
      }
    },
    "uniqueItems": {
      "description": "prevent slow validation of large non-scalar arrays",
      "if": {
        "properties": {
          "uniqueItems": {"const": true},
          "items": {
            "properties": {
              "type": {
                "anyOf": [
                  {
                    "enum": ["object", "array"]
                  },
                  {
                    "type": "array",
                    "contains": {"enum": ["object", "array"]}
                  }
                ]
              }
            }
          }
        }
      },
      "then": {
        "required": ["maxItems"]
      }
    },
    "pattern": {
      "description": "prevent slow pattern matching of large strings",
      "required": ["maxLength"]
    },
    "format": {
      "description": "prevent slow format validation of large strings",
      "required": ["maxLength"]
    }
  },
  "properties": {
    "additionalItems": {"$ref": "#"},
    "additionalProperties": {"$ref": "#"},
    "dependencies": {
      "additionalProperties": {
        "anyOf": [
          {"type": "array"},
          {"$ref": "#"}
        ]
      }
    },
    "items": {
      "anyOf": [
        {"$ref": "#"},
        {"$ref": "#/definitions/schemaArray"}
      ]
    },
    "definitions": {
      "additionalProperties": {"$ref": "#"}
    },
    "patternProperties": {
      "additionalProperties": {"$ref": "#"}
    },
    "properties": {
      "additionalProperties": {"$ref": "#"}
    },
    "if": {"$ref": "#"},
    "then": {"$ref": "#"},
    "else": {"$ref": "#"},
    "allOf": {"$ref": "#/definitions/schemaArray"},
    "anyOf": {"$ref": "#/definitions/schemaArray"},
    "oneOf": {"$ref": "#/definitions/schemaArray"},
    "not": {"$ref": "#"},
    "contains": {"$ref": "#"},
    "propertyNames": {"$ref": "#"}
  }
}
YxF{
  "name": "ajv",
  "version": "6.15.0",
  "description": "Another JSON Schema Validator",
  "main": "lib/ajv.js",
  "typings": "lib/ajv.d.ts",
  "files": [
    "lib/",
    "dist/",
    "scripts/",
    "LICENSE",
    ".tonic_example.js"
  ],
  "scripts": {
    "eslint": "eslint lib/{compile/,}*.js spec/{**/,}*.js scripts --ignore-pattern spec/JSON-Schema-Test-Suite",
    "jshint": "jshint lib/{compile/,}*.js",
    "lint": "npm run jshint && npm run eslint",
    "test-spec": "mocha spec/{**/,}*.spec.js -R spec",
    "test-fast": "AJV_FAST_TEST=true npm run test-spec",
    "test-debug": "npm run test-spec -- --inspect-brk",
    "test-cov": "nyc npm run test-spec",
    "test-ts": "tsc --target ES5 --noImplicitAny --noEmit spec/typescript/index.ts",
    "bundle": "del-cli dist && node ./scripts/bundle.js . Ajv pure_getters",
    "bundle-beautify": "node ./scripts/bundle.js js-beautify",
    "build": "del-cli lib/dotjs/*.js \"!lib/dotjs/index.js\" && node scripts/compile-dots.js",
    "test-karma": "karma start",
    "test-browser": "del-cli .browser && npm run bundle && scripts/prepare-tests && npm run test-karma",
    "test-all": "npm run test-cov && if-node-version 10 npm run test-browser",
    "test": "npm run lint && npm run build && npm run test-all",
    "prepublish": "npm run build && npm run bundle",
    "watch": "watch \"npm run build\" ./lib/dot"
  },
  "nyc": {
    "exclude": [
      "**/spec/**",
      "node_modules"
    ],
    "reporter": [
      "lcov",
      "text-summary"
    ]
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/ajv-validator/ajv.git"
  },
  "keywords": [
    "JSON",
    "schema",
    "validator",
    "validation",
    "jsonschema",
    "json-schema",
    "json-schema-validator",
    "json-schema-validation"
  ],
  "author": "Evgeny Poberezkin",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/ajv-validator/ajv/issues"
  },
  "homepage": "https://github.com/ajv-validator/ajv",
  "tonicExampleFilename": ".tonic_example.js",
  "dependencies": {
    "fast-deep-equal": "^3.1.1",
    "fast-json-stable-stringify": "^2.0.0",
    "json-schema-traverse": "^0.4.1",
    "uri-js": "^4.2.2"
  },
  "devDependencies": {
    "ajv-async": "^1.0.0",
    "bluebird": "^3.5.3",
    "brfs": "^2.0.0",
    "browserify": "^16.2.0",
    "chai": "^4.0.1",
    "coveralls": "^3.0.1",
    "del-cli": "^3.0.0",
    "dot": "^1.0.3",
    "eslint": "^7.3.1",
    "gh-pages-generator": "^0.2.3",
    "glob": "^7.0.0",
    "if-node-version": "^1.0.0",
    "js-beautify": "^1.7.3",
    "jshint": "^2.10.2",
    "json-schema-test": "^2.0.0",
    "karma": "^5.0.0",
    "karma-chrome-launcher": "^3.0.0",
    "karma-mocha": "^2.0.0",
    "karma-sauce-launcher": "^4.1.3",
    "mocha": "^8.0.1",
    "nyc": "^15.0.0",
    "pre-commit": "^1.1.1",
    "re2": "^1.21.4",
    "require-globify": "^1.3.0",
    "typescript": "^3.9.5",
    "uglify-js": "^3.6.9",
    "watch": "^1.0.0"
  },
  "collective": {
    "type": "opencollective",
    "url": "https://opencollective.com/ajv"
  },
  "funding": {
    "type": "github",
    "url": "https://github.com/sponsors/epoberezkin"
  }
}
/<x100644 .eslintrc.yml I=}1-By/WqbP100644 bundle.js でbo881[ˢ100644 compile-dots.js Z!9b&ĕ,:D?100644 info w& 7)'100644 prepare-tests hG1 >Q'yW100644 publish-built-version W7- Yk9>H:$ר100644 travis-gh-pages bfwF=sx> rules:
  no-console: 0
  no-empty: [2, allowEmptyCatch: true]
zpx'use strict';

var fs = require('fs')
  , path = require('path')
  , browserify = require('browserify')
  , uglify = require('uglify-js');

var pkg = process.argv[2]
  , standalone = process.argv[3]
  , compress = process.argv[4];

var packageDir = path.join(__dirname, '..');
if (pkg != '.') packageDir = path.join(packageDir, 'node_modules', pkg);

var json = require(path.join(packageDir, 'package.json'));

var distDir = path.join(__dirname, '..', 'dist');
if (!fs.existsSync(distDir)) fs.mkdirSync(distDir);

var bOpts = {};
if (standalone) bOpts.standalone = standalone;

browserify(bOpts)
.require(path.join(packageDir, json.main), {expose: json.name})
.bundle(function (err, buf) {
  if (err) {
    console.error('browserify error:', err);
    process.exit(1);
  }

  var outputFile = path.join(distDir, json.name);
  var uglifyOpts = {
    warnings: true,
    compress: {},
    output: {
      preamble: '/* ' + json.name + ' ' + json.version + ': ' + json.description + ' */'
    }
  };
  if (compress) {
    var compressOpts = compress.split(',');
    for (var i=0, il = compressOpts.length; i<il; ++i) {
      var pair = compressOpts[i].split('=');
      uglifyOpts.compress[pair[0]] = pair.length < 1 || pair[1] != 'false';
    }
  }
  if (standalone) {
    uglifyOpts.sourceMap = {
      filename: json.name + '.min.js',
      url: json.name + '.min.js.map'
    };
  }

  var result = uglify.minify(buf.toString(), uglifyOpts);
  fs.writeFileSync(outputFile + '.min.js', result.code);
  if (result.map) fs.writeFileSync(outputFile + '.min.js.map', result.map);
  if (standalone) fs.writeFileSync(outputFile + '.bundle.js', buf);
  if (result.warnings) {
    for (var j=0, jl = result.warnings.length; j<jl; ++j)
      console.warn('UglifyJS warning:', result.warnings[j]);
  }
});
E>x	//compile doT templates to js functions
'use strict';

var glob = require('glob')
  , fs = require('fs')
  , path = require('path')
  , doT = require('dot')
  , beautify = require('js-beautify').js_beautify;

var defsRootPath = process.argv[2] || path.join(__dirname, '../lib');

var defs = {};
var defFiles = glob.sync('./dot/**/*.def', { cwd: defsRootPath });
defFiles.forEach(function (f) {
  var name = path.basename(f, '.def');
  defs[name] = fs.readFileSync(path.join(defsRootPath, f));
});

var filesRootPath = process.argv[3] || path.join(__dirname, '../lib');
var files = glob.sync('./dot/**/*.jst', { cwd: filesRootPath });

var dotjsPath = path.join(filesRootPath, './dotjs');
try { fs.mkdirSync(dotjsPath); } catch(e) {}

console.log('\n\nCompiling:');

var FUNCTION_NAME = /function\s+anonymous\s*\(it[^)]*\)\s*{/;
var OUT_EMPTY_STRING = /out\s*\+=\s*'\s*';/g;
var ISTANBUL = /'(istanbul[^']+)';/g;
var ERROR_KEYWORD = /\$errorKeyword/g;
var ERROR_KEYWORD_OR = /\$errorKeyword\s+\|\|/g;
var VARS = [
  '$errs', '$valid', '$lvl', '$data', '$dataLvl',
  '$errorKeyword', '$closingBraces', '$schemaPath',
  '$validate'
];

files.forEach(function (f) {
  var keyword = path.basename(f, '.jst');
  var targetPath = path.join(dotjsPath, keyword + '.js');
  var template = fs.readFileSync(path.join(filesRootPath, f));
  var code = doT.compile(template, defs);
  code = code.toString()
             .replace(OUT_EMPTY_STRING, '')
             .replace(FUNCTION_NAME, 'function generate_' + keyword + '(it, $keyword, $ruleType) {')
             .replace(ISTANBUL, '/* $1 */');
  removeAlwaysFalsyInOr();
  VARS.forEach(removeUnusedVar);
  code = "'use strict';\nmodule.exports = " + code;
  code = beautify(code, { indent_size: 2 }) + '\n';
  fs.writeFileSync(targetPath, code);
  console.log('compiled', keyword);

  function removeUnusedVar(v) {
    v = v.replace(/\$/g, '\\$$');
    var regexp = new RegExp(v + '[^A-Za-z0-9_$]', 'g');
    var count = occurrences(regexp);
    if (count == 1) {
      regexp = new RegExp('var\\s+' + v + '\\s*=[^;]+;|var\\s+' + v + ';');
      code = code.replace(regexp, '');
    }
  }

  function removeAlwaysFalsyInOr() {
    var countUsed = occurrences(ERROR_KEYWORD);
    var countOr = occurrences(ERROR_KEYWORD_OR);
    if (countUsed == countOr + 1) code = code.replace(ERROR_KEYWORD_OR, '');
  }

  function occurrences(regexp) {
    return (code.match(regexp) || []).length;
  }
});
Nx!#!/usr/bin/env node

'use strict';

var fs = require('fs');
var name = process.argv[2] || '.';
var property = process.argv[3] || 'version';
if (name != '.') name = 'node_modules/' + name;
var json = JSON.parse(fs.readFileSync(name + '/package.json', 'utf8'));
console.log(json[property]);
^x#!/usr/bin/env sh

set -e

mkdir -p .browser

echo
echo Preparing browser tests:

find spec -type f -name '*.spec.js' | \
xargs -I {} sh -c \
'export f="{}"; echo $f; browserify $f -t require-globify -t brfs -x ajv -u buffer -o $(echo $f | sed -e "s/spec/.browser/");'
V$4xJ#!/usr/bin/env bash

set -e

if [[ -n $TRAVIS_TAG && $TRAVIS_JOB_NUMBER =~ ".3" ]]; then
  echo "About to publish $TRAVIS_TAG to ajv-dist..."

  git config user.email "$GIT_USER_EMAIL"
  git config user.name "$GIT_USER_NAME"

  git clone https://${GITHUB_TOKEN}@github.com/ajv-validator/ajv-dist.git ../ajv-dist

  rm -rf ../ajv-dist/dist
  mkdir ../ajv-dist/dist
  cp ./dist/ajv.* ../ajv-dist/dist
  cat bower.json | sed 's/"name": "ajv"/"name": "ajv-dist"/' > ../ajv-dist/bower.json
  cd ../ajv-dist

  if [[ `git status --porcelain` ]]; then
    echo "Changes detected. Updating master branch..."
    git add -A
    git commit -m "updated by travis build #$TRAVIS_BUILD_NUMBER"
    git push --quiet origin master > /dev/null 2>&1
  fi

  echo "Publishing tag..."

  git tag $TRAVIS_TAG
  git push --tags > /dev/null 2>&1

  echo "Done"
fi
~G6xj#!/usr/bin/env bash

set -e

if [[ "$TRAVIS_BRANCH" == "master" && "$TRAVIS_PULL_REQUEST" == "false" && $TRAVIS_JOB_NUMBER =~ ".3" ]]; then
  git diff --name-only $TRAVIS_COMMIT_RANGE | grep -qE '\.md$|^LICENSE$|travis-gh-pages$' && {
    rm -rf ../gh-pages
    git clone -b gh-pages --single-branch https://${GITHUB_TOKEN}@github.com/ajv-validator/ajv.git ../gh-pages
    mkdir -p ../gh-pages/_source
    cp *.md ../gh-pages/_source
    cp LICENSE ../gh-pages/_source
    currentDir=$(pwd)
    cd ../gh-pages
    $currentDir/node_modules/.bin/gh-pages-generator
    # remove logo from README
    sed -i -E "s/<img[^>]+ajv_logo[^>]+>//" index.md
    git config user.email "$GIT_USER_EMAIL"
    git config user.name "$GIT_USER_NAME"
    git add .
    git commit -am "updated by travis build #$TRAVIS_BUILD_NUMBER"
    git push --quiet origin gh-pages > /dev/null 2>&1
  }
fi
	-	x m100644 LICENSE.md a̒Rr{100644 README.md 7s2CxޛǊ^deR40000 dist WIԕN4н100644 package.json H8ж}1ۮTK0/#?RHx|(MIT)

Original code Copyright Julian Gruber <julian@juliangruber.com>

Port to TypeScript Copyright Isaac Z. Schlueter <i@izs.me>

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
BtAlx3# balanced-match

Match balanced string pairs, like `{` and `}` or `<b>` and
`</b>`. Supports regular expressions as well!

## Example

Get the first matching pair of braces:

```js
import { balanced } from 'balanced-match'

console.log(balanced('{', '}', 'pre{in{nested}}post'))
console.log(balanced('{', '}', 'pre{first}between{second}post'))
console.log(
  balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre  {   in{nest}   }  post'),
)
```

The matches are:

```bash
$ node example.js
{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }
{ start: 3,
  end: 9,
  pre: 'pre',
  body: 'first',
  post: 'between{second}post' }
{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' }
```

## API

### const m = balanced(a, b, str)

For the first non-nested matching pair of `a` and `b` in `str`, return an
object with those keys:

- **start** the index of the first match of `a`
- **end** the index of the matching `b`
- **pre** the preamble, `a` and `b` not included
- **body** the match, `a` and `b` not included
- **post** the postscript, `a` and `b` not included

If there's no match, `undefined` will be returned.

If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`.

### const r = balanced.range(a, b, str)

For the first non-nested matching pair of `a` and `b` in `str`, return an
array with indexes: `[ <a index>, <b index> ]`.

If there's no match, `undefined` will be returned.

If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`.
a(=xA 40000 commonjs |+DZXco?40000 esm .~VXlE?x ;100644 index.d.ts /`*$O100644 index.d.ts.map cv,w{ׯK.V100644 index.js S}[=!J]q2100644 index.js.map Gʝ3Zn8ڴ
+100644 package.json [9-UI
qkj;lJxNexport declare const balanced: (a: string | RegExp, b: string | RegExp, str: string) => false | {
    start: number;
    end: number;
    pre: string;
    body: string;
    post: string;
} | undefined;
export declare const range: (a: string, b: string, str: string) => undefined | [number, number];
//# sourceMappingURL=index.d.ts.map>oBxC{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,GAAG,MAAM,EAClB,GAAG,MAAM,GAAG,MAAM,EAClB,KAAK,MAAM;;;;;;aAgBZ,CAAA;AAOD,eAAO,MAAM,KAAK,GAChB,GAAG,MAAM,EACT,GAAG,MAAM,EACT,KAAK,MAAM,KACV,SAAS,GAAG,CAAC,MAAM,EAAE,MAAM,CA2C7B,CAAA"}	Yox"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.range = exports.balanced = void 0;
const balanced = (a, b, str) => {
    const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
    const mb = b instanceof RegExp ? maybeMatch(b, str) : b;
    const r = ma !== null && mb != null && (0, exports.range)(ma, mb, str);
    return (r && {
        start: r[0],
        end: r[1],
        pre: str.slice(0, r[0]),
        body: str.slice(r[0] + ma.length, r[1]),
        post: str.slice(r[1] + mb.length),
    });
};
exports.balanced = balanced;
const maybeMatch = (reg, str) => {
    const m = str.match(reg);
    return m ? m[0] : null;
};
const range = (a, b, str) => {
    let begs, beg, left, right = undefined, result;
    let ai = str.indexOf(a);
    let bi = str.indexOf(b, ai + 1);
    let i = ai;
    if (ai >= 0 && bi > 0) {
        if (a === b) {
            return [ai, bi];
        }
        begs = [];
        left = str.length;
        while (i >= 0 && !result) {
            if (i === ai) {
                begs.push(i);
                ai = str.indexOf(a, i + 1);
            }
            else if (begs.length === 1) {
                const r = begs.pop();
                if (r !== undefined)
                    result = [r, bi];
            }
            else {
                beg = begs.pop();
                if (beg !== undefined && beg < left) {
                    left = beg;
                    right = bi;
                }
                bi = str.indexOf(b, i + 1);
            }
            i = ai < bi && ai >= 0 ? ai : bi;
        }
        if (begs.length && right !== undefined) {
            result = [left, right];
        }
    }
    return result;
};
exports.range = range;
//# sourceMappingURL=index.js.mapǽx]{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAO,MAAM,QAAQ,GAAG,CACtB,CAAkB,EAClB,CAAkB,EAClB,GAAW,EACX,EAAE;IACF,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACvD,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAEvD,MAAM,CAAC,GAAG,EAAE,KAAK,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,IAAA,aAAK,EAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAA;IAEzD,OAAO,CACL,CAAC,IAAI;QACH,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;QACX,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACT,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,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AAE,EAAE,CAAC;gBACb,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;gBACZ,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;YAC5B,CAAC;iBAAM,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;gBACpB,IAAI,CAAC,KAAK,SAAS;oBAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;YACvC,CAAC;iBAAM,CAAC;gBACN,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;gBAChB,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,GAAG,IAAI,EAAE,CAAC;oBACpC,IAAI,GAAG,GAAG,CAAA;oBACV,KAAK,GAAG,EAAE,CAAA;gBACZ,CAAC;gBAED,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;YAC5B,CAAC;YAED,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QAClC,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA;AA/CY,QAAA,KAAK,SA+CjB","sourcesContent":["export const balanced = (\n  a: string | RegExp,\n  b: string | RegExp,\n  str: string,\n) => {\n  const ma = a instanceof RegExp ? maybeMatch(a, str) : a\n  const mb = b instanceof RegExp ? maybeMatch(b, str) : b\n\n  const r = ma !== null && mb != null && range(ma, mb, str)\n\n  return (\n    r && {\n      start: r[0],\n      end: r[1],\n      pre: str.slice(0, r[0]),\n      body: str.slice(r[0] + ma.length, r[1]),\n      post: str.slice(r[1] + mb.length),\n    }\n  )\n}\n\nconst maybeMatch = (reg: RegExp, str: string) => {\n  const m = str.match(reg)\n  return m ? m[0] : null\n}\n\nexport const range = (\n  a: string,\n  b: string,\n  str: string,\n): undefined | [number, number] => {\n  let begs: number[],\n    beg: number | undefined,\n    left: number,\n    right: number | undefined = undefined,\n    result: undefined | [number, number]\n  let ai = str.indexOf(a)\n  let bi = str.indexOf(b, ai + 1)\n  let i = ai\n\n  if (ai >= 0 && bi > 0) {\n    if (a === b) {\n      return [ai, bi]\n    }\n    begs = []\n    left = str.length\n\n    while (i >= 0 && !result) {\n      if (i === ai) {\n        begs.push(i)\n        ai = str.indexOf(a, i + 1)\n      } else if (begs.length === 1) {\n        const r = begs.pop()\n        if (r !== undefined) result = [r, bi]\n      } else {\n        beg = begs.pop()\n        if (beg !== undefined && beg < left) {\n          left = beg\n          right = bi\n        }\n\n        bi = str.indexOf(b, i + 1)\n      }\n\n      i = ai < bi && ai >= 0 ? ai : bi\n    }\n\n    if (begs.length && right !== undefined) {\n      result = [left, right]\n    }\n  }\n\n  return result\n}\n"]}nXzйx {
  "type": "commonjs"
}
]uax ;100644 index.d.ts /`*$O100644 index.d.ts.map cv,w{ׯK.V100644 index.js  gmB100644 index.js.map v)2GV5T^t>c100644 package.json =U~5 JPVMdxHexport const balanced = (a, b, str) => {
    const ma = a instanceof RegExp ? maybeMatch(a, str) : a;
    const mb = b instanceof RegExp ? maybeMatch(b, str) : b;
    const r = ma !== null && mb != null && range(ma, mb, str);
    return (r && {
        start: r[0],
        end: r[1],
        pre: str.slice(0, r[0]),
        body: str.slice(r[0] + ma.length, r[1]),
        post: str.slice(r[1] + mb.length),
    });
};
const maybeMatch = (reg, str) => {
    const m = str.match(reg);
    return m ? m[0] : null;
};
export const range = (a, b, str) => {
    let begs, beg, left, right = undefined, result;
    let ai = str.indexOf(a);
    let bi = str.indexOf(b, ai + 1);
    let i = ai;
    if (ai >= 0 && bi > 0) {
        if (a === b) {
            return [ai, bi];
        }
        begs = [];
        left = str.length;
        while (i >= 0 && !result) {
            if (i === ai) {
                begs.push(i);
                ai = str.indexOf(a, i + 1);
            }
            else if (begs.length === 1) {
                const r = begs.pop();
                if (r !== undefined)
                    result = [r, bi];
            }
            else {
                beg = begs.pop();
                if (beg !== undefined && beg < left) {
                    left = beg;
                    right = bi;
                }
                bi = str.indexOf(b, i + 1);
            }
            i = ai < bi && ai >= 0 ? ai : bi;
        }
        if (begs.length && right !== undefined) {
            result = [left, right];
        }
    }
    return result;
};
//# sourceMappingURL=index.js.mapﻃx;{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,CACtB,CAAkB,EAClB,CAAkB,EAClB,GAAW,EACX,EAAE;IACF,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IACvD,MAAM,EAAE,GAAG,CAAC,YAAY,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAA;IAEvD,MAAM,CAAC,GAAG,EAAE,KAAK,IAAI,IAAI,EAAE,IAAI,IAAI,IAAI,KAAK,CAAC,EAAE,EAAE,EAAE,EAAE,GAAG,CAAC,CAAA;IAEzD,OAAO,CACL,CAAC,IAAI;QACH,KAAK,EAAE,CAAC,CAAC,CAAC,CAAC;QACX,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QACT,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;QACvB,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC,CAAC,CA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IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;gBAC7B,MAAM,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;gBACpB,IAAI,CAAC,KAAK,SAAS;oBAAE,MAAM,GAAG,CAAC,CAAC,EAAE,EAAE,CAAC,CAAA;YACvC,CAAC;iBAAM,CAAC;gBACN,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAA;gBAChB,IAAI,GAAG,KAAK,SAAS,IAAI,GAAG,GAAG,IAAI,EAAE,CAAC;oBACpC,IAAI,GAAG,GAAG,CAAA;oBACV,KAAK,GAAG,EAAE,CAAA;gBACZ,CAAC;gBAED,EAAE,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAA;YAC5B,CAAC;YAED,CAAC,GAAG,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAA;QAClC,CAAC;QAED,IAAI,IAAI,CAAC,MAAM,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;YACvC,MAAM,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;QACxB,CAAC;IACH,CAAC;IAED,OAAO,MAAM,CAAA;AACf,CAAC,CAAA","sourcesContent":["export const balanced = (\n  a: string | RegExp,\n  b: string | RegExp,\n  str: string,\n) => {\n  const ma = a instanceof RegExp ? maybeMatch(a, str) : a\n  const mb = b instanceof RegExp ? maybeMatch(b, str) : b\n\n  const r = ma !== null && mb != null && range(ma, mb, str)\n\n  return (\n    r && {\n      start: r[0],\n      end: r[1],\n      pre: str.slice(0, r[0]),\n      body: str.slice(r[0] + ma.length, r[1]),\n      post: str.slice(r[1] + mb.length),\n    }\n  )\n}\n\nconst maybeMatch = (reg: RegExp, str: string) => {\n  const m = str.match(reg)\n  return m ? m[0] : null\n}\n\nexport const range = (\n  a: string,\n  b: string,\n  str: string,\n): undefined | [number, number] => {\n  let begs: number[],\n    beg: number | undefined,\n    left: number,\n    right: number | undefined = undefined,\n    result: undefined | [number, number]\n  let ai = str.indexOf(a)\n  let bi = str.indexOf(b, ai + 1)\n  let i = ai\n\n  if (ai >= 0 && bi > 0) {\n    if (a === b) {\n      return [ai, bi]\n    }\n    begs = []\n    left = str.length\n\n    while (i >= 0 && !result) {\n      if (i === ai) {\n        begs.push(i)\n        ai = str.indexOf(a, i + 1)\n      } else if (begs.length === 1) {\n        const r = begs.pop()\n        if (r !== undefined) result = [r, bi]\n      } else {\n        beg = begs.pop()\n        if (beg !== undefined && beg < left) {\n          left = beg\n          right = bi\n        }\n\n        bi = str.indexOf(b, i + 1)\n      }\n\n      i = ai < bi && ai >= 0 ? ai : bi\n    }\n\n    if (begs.length && right !== undefined) {\n      result = [left, right]\n    }\n  }\n\n  return result\n}\n"]}fqMx {
  "type": "module"
}
M-cx<{
  "name": "balanced-match",
  "description": "Match balanced character pairs, like \"{\" and \"}\"",
  "version": "4.0.4",
  "files": [
    "dist"
  ],
  "repository": {
    "type": "git",
    "url": "git://github.com/juliangruber/balanced-match.git"
  },
  "exports": {
    "./package.json": "./package.json",
    ".": {
      "import": {
        "types": "./dist/esm/index.d.ts",
        "default": "./dist/esm/index.js"
      },
      "require": {
        "types": "./dist/commonjs/index.d.ts",
        "default": "./dist/commonjs/index.js"
      }
    }
  },
  "type": "module",
  "scripts": {
    "preversion": "npm test",
    "postversion": "npm publish",
    "prepublishOnly": "git push origin --follow-tags",
    "prepare": "tshy",
    "pretest": "npm run prepare",
    "presnap": "npm run prepare",
    "test": "tap",
    "snap": "tap",
    "format": "prettier --write .",
    "benchmark": "node benchmark/index.js",
    "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts"
  },
  "devDependencies": {
    "@types/brace-expansion": "^1.1.2",
    "@types/node": "^25.2.1",
    "mkdirp": "^3.0.1",
    "prettier": "^3.3.2",
    "tap": "^21.6.2",
    "tshy": "^3.0.2",
    "typedoc": "^0.28.5"
  },
  "keywords": [
    "match",
    "regexp",
    "test",
    "balanced",
    "parse"
  ],
  "license": "MIT",
  "engines": {
    "node": "18 || 20 || >=22"
  },
  "tshy": {
    "exports": {
      "./package.json": "./package.json",
      ".": "./src/index.ts"
    }
  },
  "main": "./dist/commonjs/index.js",
  "types": "./dist/commonjs/index.d.ts",
  "module": "./dist/esm/index.js"
}
xq 100644 README.md ^PH;N}
xG?P]100644 index.js ċn6%ڟ100644 package.json x3
rr'Ix09 syN#+!)(xp#boolbase
This very simple module provides two basic functions, one that always returns true (`trueFunc`) and one that always returns false (`falseFunc`).

###WTF?

By having only a single instance of these functions around, it's possible to do some nice optimizations. Eg. [`CSSselect`](https://github.com/fb55/CSSselect) uses these functions to determine whether a selector won't match any elements. If that's the case, the DOM doesn't even have to be touched.

###And why is this a separate module?

I'm trying to modularize `CSSselect` and most modules depend on these functions. IMHO, having a separate module is the easiest solution to this problem.茽x} module.exports = {
	trueFunc: function trueFunc(){
		return true;
	},
	falseFunc: function falseFunc(){
		return false;
	}
};L*"x&{
  "name": "boolbase",
  "version": "1.0.0",
  "description": "two functions: One that returns true, one that returns false",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/fb55/boolbase"
  },
  "keywords": [
    "boolean",
    "function"
  ],
  "author": "Felix Boehm <me@feedic.com>",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/fb55/boolbase/issues"
  },
  "homepage": "https://github.com/fb55/boolbase"
}
F֯x p100644 LICENSE F\AG29G-R100644 README.md :γz线# Rt40000 dist  _95v100644 package.json Cv@QCKkxH"p: 5SxiMIT License

Copyright Julian Gruber <julian@juliangruber.com>

TypeScript port Copyright Isaac Z. Schlueter <i@izs.me>

Permis%5 obtaining a copy
l- 
in the Software without 4	
to use, { Software is
, K included in all
 p EXPRESS OR
4 
$ 
&
1 F1
LIABILITY, < FROM,
7! OTHER DEALINGS IN THE
SOFTWARE.
2pϷx
(# brace-expansion

[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html),
as known from sh/bash, in JavaScript.

[![CI](https://github.com/juliangruber/brace-expansion/actions/workflows/ci.yml/badge.svg)](https://github.com/juliangruber/brace-expansion/actions/workflows/ci.yml)
[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion)

## Example

```js
import { expand } from 'brace-expansion'

expand('file-{a,b,c}.jpg')
// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']

expand('-v{,,}')
// => ['-v', '-v', '-v']

expand('file{0..2}.jpg')
// => ['file0.jpg', 'file1.jpg', 'file2.jpg']

expand('file-{a..c}.jpg')
// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']

expand('file{2..0}.jpg')
// => ['file2.jpg', 'file1.jpg', 'file0.jpg']

expand('file{0..4..2}.jpg')
// => ['file0.jpg', 'file2.jpg', 'file4.jpg']

expand('file-{a..e..2}.jpg')
// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg']

expand('file{00..10..5}.jpg')
// => ['file00.jpg', 'file05.jpg', 'file10.jpg']

expand('{{A..C},{a..c}}')
// => ['A', 'B', 'C', 'a', 'b', 'c']

expand('ppp{,config,oe{,conf}}')
// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf']
```

## API

```js
import { expand } from 'brace-expansion'
```

### const expanded = expand(str, [options])

Return an array of all possible and valid expansions of `str`. If
none are found, `[str]` is returned.

The `options` object can provide a `max` value to cap the number
of expansions allowed. This is limited to `100_000` by default,
to prevent DoS attacks.

```js
const expansions = expand('{1..100}'.repeat(5), {
  max: 100,
})
// expansions.length will be 100, not 100^5
```

The `options` object can also provide a `maxLength` value to cap the
total number of characters across all expansions. This is limited to
`4_000_000` by default, to prevent memory exhaustion from inputs whose
result count stays under `max` while each result grows very long.

```js
const expansions = expand('{a,b}'.repeat(1500), {
  maxLength: 10_000,
})
```

Valid expansions are:

```js
;/^(.*,)+(.+)?$/
// {a,b,...}
```

A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`.

```js
;/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
// {x..y[..incr]}
```

A numeric sequence from `x` to `y` inclusive, with optional increment.
If `x` or `y` start with a leading `0`, all the numbers will be padded
to have equal length. Negative numbers and backwards iteration work too.

```js
;/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
// {x..y[..incr]}
```

An alphabetic sequence from `x` to `y` inclusive, with optional increment.
`x` and `y` must be exactly one character, and if given, `incr` must be a
number.

For compatibility reasons, the string `${` is not eligible for brace expansion.
5>xA 40000 commonjs jDz{s:5\ߎ40000 esm hqւˆ+Ecʐx ;100644 index.d.ts ޝF%5s;߅100644 index.d.ts.map XD-=)`o{100644 index.js k#{+K$/100644 index.js.map e8`b혳0)ă100644 package.json [9-UI
qkj;rPx0export declare const EXPANSION_MAX = 100000;
export declare const EXPANSION_MAX_LENGTH = 4000000;
export type BraceExpansionOptions = {
    max?: number;
    maxLength?: number;
};
export declare function expand(str: string, options?: BraceExpansionOptions): string[];
//# sourceMappingURL=index.d.ts.mapfxQ{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAkBA,eAAO,MAAM,aAAa,SAAU,CAAA;AAYpC,eAAO,MAAM,oBAAoB,UAAY,CAAA;AAwD7C,MAAM,MAAM,qBAAqB,GAAG;IAClC,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB,CAAA;AAED,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,GAAE,qBAA0B,YAkBtE"}M^඾x+"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.EXPANSION_MAX_LENGTH = exports.EXPANSION_MAX = void 0;
exports.expand = expand;
const balanced_match_1 = require("balanced-match");
const escSlash = '\0SLASH' + Math.random() + '\0';
const escOpen = '\0OPEN' + Math.random() + '\0';
const escClose = '\0CLOSE' + Math.random() + '\0';
const escComma = '\0COMMA' + Math.random() + '\0';
const escPeriod = '\0PERIOD' + Math.random() + '\0';
const escSlashPattern = new RegExp(escSlash, 'g');
const escOpenPattern = new RegExp(escOpen, 'g');
const escClosePattern = new RegExp(escClose, 'g');
const escCommaPattern = new RegExp(escComma, 'g');
const escPeriodPattern = new RegExp(escPeriod, 'g');
const slashPattern = /\\\\/g;
const openPattern = /\\{/g;
const closePattern = /\\}/g;
const commaPattern = /\\,/g;
const periodPattern = /\\\./g;
exports.EXPANSION_MAX = 100_000;
// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An
// input like `'{a,b}'.repeat(1500)` stays under that count - its output is
// truncated to 100k results - while making every result ~1500 characters
// long. The result set, and the intermediate arrays built while combining
// brace sets, then grow large enough to exhaust memory and crash the process
// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of
// characters the accumulator may hold at any point, so memory stays flat no
// matter how many brace groups are chained. The limit sits well above any
// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M
// characters) so legitimate input is unaffected.
exports.EXPANSION_MAX_LENGTH = 4_000_000;
function numeric(str) {
    return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
}
function escapeBraces(str) {
    return str
        .replace(slashPattern, escSlash)
        .replace(openPattern, escOpen)
        .replace(closePattern, escClose)
        .replace(commaPattern, escComma)
        .replace(periodPattern, escPeriod);
}
function unescapeBraces(str) {
    return str
        .replace(escSlashPattern, '\\')
        .replace(escOpenPattern, '{')
        .replace(escClosePattern, '}')
        .replace(escCommaPattern, ',')
        .replace(escPeriodPattern, '.');
}
/**
 * Basically just str.split(","), but handling cases
 * where we have nested braced sections, which should be
 * treated as individual members, like {a,{b,c},d}
 */
function parseCommaParts(str) {
    if (!str) {
        return [''];
    }
    const parts = [];
    const m = (0, balanced_match_1.balanced)('{', '}', str);
    if (!m) {
        return str.split(',');
    }
    const { pre, body, post } = m;
    const p = pre.split(',');
    p[p.length - 1] += '{' + body + '}';
    const postParts = parseCommaParts(post);
    if (post.length) {
        ;
        p[p.length - 1] += postParts.shift();
        p.push.apply(p, postParts);
    }
    parts.push.apply(parts, p);
    return parts;
}
function expand(str, options = {}) {
    if (!str) {
        return [];
    }
    const { max = exports.EXPANSION_MAX, maxLength = exports.EXPANSION_MAX_LENGTH } = options;
    // I don't know why Bash 4.3 does this, but it does.
    // Anything starting with {} will have the first two bytes preserved
    // but *only* at the top level, so {},a}b will not expand to anything,
    // but a{},b}c will be expanded to [a}c,abc].
    // One could argue that this is a bug in Bash, but since the goal of
    // this module is to match Bash's rules, we escape a leading {}
    if (str.slice(0, 2) === '{}') {
        str = '\\{\\}' + str.slice(2);
    }
    return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces);
}
function embrace(str) {
    return '{' + str + '}';
}
function isPadded(el) {
    return /^-?0\d/.test(el);
}
function lte(i, y) {
    return i <= y;
}
function gte(i, y) {
    return i >= y;
}
// Build `{ acc[a] + pre + values[v] }` for every combination, capping the
// number of results at `max` and the total number of characters at `maxLength`.
// This is the one place output grows, so bounding it here keeps the single
// accumulator - and therefore memory - flat regardless of how many brace groups
// are combined (CVE-2026-14257).
function combine(acc, pre, values, max, maxLength, dropEmpties) {
    const out = [];
    let length = 0;
    for (let a = 0; a < acc.length; a++) {
        for (let v = 0; v < values.length; v++) {
            if (out.length >= max)
                return out;
            const expansion = acc[a] + pre + values[v];
            // Bash drops empty results at the top level. Skip them before they count
            // against `max`, so `max` bounds the number of *kept* results.
            if (dropEmpties && !expansion)
                continue;
            if (length + expansion.length > maxLength)
                return out;
            out.push(expansion);
            length += expansion.length;
        }
    }
    return out;
}
// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`)
// sequence body.
function expandSequence(body, isAlphaSequence, max, maxLength) {
    const n = body.split(/\.\./);
    const N = [];
    // A sequence body always splits into two or three parts, but the compiler
    // can't know that.
    /* c8 ignore start */
    if (n[0] === undefined || n[1] === undefined) {
        return N;
    }
    /* c8 ignore stop */
    const x = numeric(n[0]);
    const y = numeric(n[1]);
    const width = Math.max(n[0].length, n[1].length);
    let incr = n.length === 3 && n[2] !== undefined ?
        Math.max(Math.abs(numeric(n[2])), 1)
        : 1;
    let test = lte;
    const reverse = y < x;
    if (reverse) {
        incr *= -1;
        test = gte;
    }
    const pad = n.some(isPadded);
    let length = 0;
    for (let i = x; test(i, y) && N.length < max; i += incr) {
        let c;
        if (isAlphaSequence) {
            c = String.fromCharCode(i);
            if (c === '\\') {
                c = '';
            }
        }
        else {
            c = String(i);
            if (pad) {
                const need = width - c.length;
                if (need > 0) {
                    const z = new Array(need + 1).join('0');
                    if (i < 0) {
                        c = '-' + z + c.slice(1);
                    }
                    else {
                        c = z + c;
                    }
                }
            }
        }
        if (length + c.length > maxLength)
            break;
        N.push(c);
        length += c.length;
    }
    return N;
}
function expand_(str, max, maxLength, isTop) {
    // Consume the string's top-level brace groups left to right, threading a
    // running set of combined prefixes (`acc`). Expanding the tail iteratively -
    // rather than recursing on `m.post` once per group - keeps the native stack
    // depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no
    // longer overflow the stack, and leaves a single accumulator whose size
    // `maxLength` bounds directly (CVE-2026-14257).
    let acc = [''];
    // Bash drops empty results, but only when the *first* top-level group is a
    // comma set - a sequence like `{a..\}` may legitimately yield ''. The drop
    // is on the final strings, so it is applied to whichever `combine` produces
    // them (the one with no brace set left in the tail).
    let dropEmpties = false;
    let firstGroup = true;
    for (;;) {
        const m = (0, balanced_match_1.balanced)('{', '}', str);
        // No brace set left: the rest of the string is literal.
        if (!m) {
            return combine(acc, str, [''], max, maxLength, dropEmpties);
        }
        // no need to expand pre, since it is guaranteed to be free of brace-sets
        const pre = m.pre;
        if (/\$$/.test(pre)) {
            acc = combine(acc, pre + '{' + m.body + '}', [''], max, maxLength, dropEmpties && !m.post.length);
            firstGroup = false;
            if (!m.post.length)
                break;
            str = m.post;
            continue;
        }
        const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
        const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
        const isSequence = isNumericSequence || isAlphaSequence;
        const isOptions = m.body.indexOf(',') >= 0;
        if (!isSequence && !isOptions) {
            // {a},b}
            if (m.post.match(/,(?!,).*\}/)) {
                str = m.pre + '{' + m.body + escClose + m.post;
                isTop = true;
                continue;
            }
            // Nothing here expands, so the whole remaining string is literal.
            return combine(acc, pre + '{' + m.body + '}' + m.post, [''], max, maxLength, dropEmpties);
        }
        if (firstGroup) {
            dropEmpties = isTop && !isSequence;
            firstGroup = false;
        }
        let values;
        if (isSequence) {
            values = expandSequence(m.body, isAlphaSequence, max, maxLength);
        }
        else {
            let n = parseCommaParts(m.body);
            if (n.length === 1 && n[0] !== undefined) {
                // x{{a,b}}y ==> x{a}y x{b}y
                n = expand_(n[0], max, maxLength, false).map(embrace);
                //XXX is this necessary? Can't seem to hit it in tests.
                /* c8 ignore start */
                if (n.length === 1) {
                    acc = combine(acc, pre + n[0], [''], max, maxLength, dropEmpties && !m.post.length);
                    if (!m.post.length)
                        break;
                    str = m.post;
                    continue;
                }
                /* c8 ignore stop */
            }
            // Values that `combine` is going to drop as empty produce no result, so
            // they must not count against `max` - otherwise `{a,,b}` with `max: 2`
            // would stop at `['a', '']` and yield one result instead of two. Skipping
            // them outright keeps `values` bounded while leaving `max` a bound on
            // *kept* results.
            let dropsEmpties = dropEmpties && !m.post.length && !pre;
            for (let d = 0; dropsEmpties && d < acc.length; d++) {
                if (acc[d]) {
                    dropsEmpties = false;
                }
            }
            values = [];
            let valuesLength = 0;
            outer: for (let j = 0; j < n.length; j++) {
                const expanded = expand_(n[j], max, maxLength, false);
                for (let k = 0; k < expanded.length; k++) {
                    const v = expanded[k];
                    if (dropsEmpties && !v)
                        continue;
                    if (values.length >= max || valuesLength + v.length > maxLength) {
                        break outer;
                    }
                    values.push(v);
                    valuesLength += v.length;
                }
            }
        }
        acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length);
        if (!m.post.length)
            break;
        str = m.post;
    }
    return acc;
}
//# sourceMappingURL=index.js.mapЇ
xKQ{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AA2FA,wBAkBC;AA7GD,mDAAyC;AAEzC,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AAC/C,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,SAAS,GAAG,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACnD,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AAC/C,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,gBAAgB,GAAG,IAAI,MAAM,CAAC,SAAS,EAAE,GAAG,CAAC,CAAA;AACnD,MAAM,YAAY,GAAG,OAAO,CAAA;AAC5B,MAAM,WAAW,GAAG,MAAM,CAAA;AAC1B,MAAM,YAAY,GAAG,MAAM,CAAA;AAC3B,MAAM,YAAY,GAAG,MAAM,CAAA;AAC3B,MAAM,aAAa,GAAG,OAAO,CAAA;AAEhB,QAAA,aAAa,GAAG,OAAO,CAAA;AAEpC,4EAA4E;AAC5E,2EAA2E;AAC3E,yEAAyE;AACzE,0EAA0E;AAC1E,6EAA6E;AAC7E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,CAAA;oBAC/B,IAAI,YAAY,IAAI,CAAC,CAAC;wBAAE,SAAQ;oBAChC,IAAI,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,YAAY,GAAG,CAAC,CAAC,MAAM,GAAG,SAAS,EAAE,CAAC;wBAChE,MAAM,KAAK,CAAA;oBACb,CAAC;oBACD,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;oBACd,YAAY,IAAI,CAAC,CAAC,MAAM,CAAA;gBAC1B,CAAC;YACH,CAAC;QACH,CAAC;QAED,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,WAAW,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC9E,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM;YAAE,MAAK;QACzB,GAAG,GAAG,CAAC,CAAC,IAAI,CAAA;IACd,CAAC;IAED,OAAO,GAAG,CAAA;AACZ,CAAC","sourcesContent":["import { balanced } from 'balanced-match'\n\nconst escSlash = '\\0SLASH' + Math.random() + '\\0'\nconst escOpen = '\\0OPEN' + Math.random() + '\\0'\nconst escClose = '\\0CLOSE' + Math.random() + '\\0'\nconst escComma = '\\0COMMA' + Math.random() + '\\0'\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0'\nconst escSlashPattern = new RegExp(escSlash, 'g')\nconst escOpenPattern = new RegExp(escOpen, 'g')\nconst escClosePattern = new RegExp(escClose, 'g')\nconst escCommaPattern = new RegExp(escComma, 'g')\nconst escPeriodPattern = new RegExp(escPeriod, 'g')\nconst slashPattern = /\\\\\\\\/g\nconst openPattern = /\\\\{/g\nconst closePattern = /\\\\}/g\nconst commaPattern = /\\\\,/g\nconst periodPattern = /\\\\\\./g\n\nexport const EXPANSION_MAX = 100_000\n\n// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An\n// input like `'{a,b}'.repeat(1500)` stays under that count - its output is\n// truncated to 100k results - while making every result ~1500 characters\n// long. The result set, and the intermediate arrays built while combining\n// brace sets, then grow large enough to exhaust memory and crash the process\n// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of\n// characters the accumulator may hold at any point, so memory stays flat no\n// matter how many brace groups are chained. The limit sits well above any\n// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M\n// characters) so legitimate input is unaffected.\nexport const EXPANSION_MAX_LENGTH = 4_000_000\n\nfunction numeric(str: string) {\n  return !isNaN(str as any) ? parseInt(str, 10) : str.charCodeAt(0)\n}\n\nfunction escapeBraces(str: string) {\n  return str\n    .replace(slashPattern, escSlash)\n    .replace(openPattern, escOpen)\n    .replace(closePattern, escClose)\n    .replace(commaPattern, escComma)\n    .replace(periodPattern, escPeriod)\n}\n\nfunction unescapeBraces(str: string) {\n  return str\n    .replace(escSlashPattern, '\\\\')\n    .replace(escOpenPattern, '{')\n    .replace(escClosePattern, '}')\n    .replace(escCommaPattern, ',')\n    .replace(escPeriodPattern, '.')\n}\n\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str: string) {\n  if (!str) {\n    return ['']\n  }\n\n  const parts: string[] = []\n  const m = balanced('{', '}', str)\n\n  if (!m) {\n    return str.split(',')\n  }\n\n  const { pre, body, post } = m\n  const p = pre.split(',')\n\n  p[p.length - 1] += '{' + body + '}'\n  const postParts = parseCommaParts(post)\n  if (post.length) {\n    ;(p[p.length - 1] as string) += postParts.shift()\n    p.push.apply(p, postParts)\n  }\n\n  parts.push.apply(parts, p)\n\n  return parts\n}\n\nexport type BraceExpansionOptions = {\n  max?: number\n  maxLength?: number\n}\n\nexport function expand(str: string, options: BraceExpansionOptions = {}) {\n  if (!str) {\n    return []\n  }\n\n  const { max = EXPANSION_MAX, maxLength = EXPANSION_MAX_LENGTH } = options\n\n  // I don't know why Bash 4.3 does this, but it does.\n  // Anything starting with {} will have the first two bytes preserved\n  // but *only* at the top level, so {},a}b will not expand to anything,\n  // but a{},b}c will be expanded to [a}c,abc].\n  // One could argue that this is a bug in Bash, but since the goal of\n  // this module is to match Bash's rules, we escape a leading {}\n  if (str.slice(0, 2) === '{}') {\n    str = '\\\\{\\\\}' + str.slice(2)\n  }\n\n  return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces)\n}\n\nfunction embrace(str: string) {\n  return '{' + str + '}'\n}\n\nfunction isPadded(el: string) {\n  return /^-?0\\d/.test(el)\n}\n\nfunction lte(i: number, y: number) {\n  return i <= y\n}\n\nfunction gte(i: number, y: number) {\n  return i >= y\n}\n\n// Build `{ acc[a] + pre + values[v] }` for every combination, capping the\n// number of results at `max` and the total number of characters at `maxLength`.\n// This is the one place output grows, so bounding it here keeps the single\n// accumulator - and therefore memory - flat regardless of how many brace groups\n// are combined (CVE-2026-14257).\nfunction combine(\n  acc: string[],\n  pre: string,\n  values: string[],\n  max: number,\n  maxLength: number,\n  dropEmpties: boolean,\n): string[] {\n  const out: string[] = []\n  let length = 0\n  for (let a = 0; a < acc.length; a++) {\n    for (let v = 0; v < values.length; v++) {\n      if (out.length >= max) return out\n      const expansion = (acc[a] as string) + pre + values[v]\n      // Bash drops empty results at the top level. Skip them before they count\n      // against `max`, so `max` bounds the number of *kept* results.\n      if (dropEmpties && !expansion) continue\n      if (length + expansion.length > maxLength) return out\n      out.push(expansion)\n      length += expansion.length\n    }\n  }\n  return out\n}\n\n// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`)\n// sequence body.\nfunction expandSequence(\n  body: string,\n  isAlphaSequence: boolean,\n  max: number,\n  maxLength: number,\n): string[] {\n  const n = body.split(/\\.\\./)\n  const N: string[] = []\n  // A sequence body always splits into two or three parts, but the compiler\n  // can't know that.\n  /* c8 ignore start */\n  if (n[0] === undefined || n[1] === undefined) {\n    return N\n  }\n  /* c8 ignore stop */\n  const x = numeric(n[0])\n  const y = numeric(n[1])\n  const width = Math.max(n[0].length, n[1].length)\n  let incr =\n    n.length === 3 && n[2] !== undefined ?\n      Math.max(Math.abs(numeric(n[2])), 1)\n    : 1\n  let test = lte\n  const reverse = y < x\n  if (reverse) {\n    incr *= -1\n    test = gte\n  }\n  const pad = n.some(isPadded)\n\n  let length = 0\n  for (let i = x; test(i, y) && N.length < max; i += incr) {\n    let c\n    if (isAlphaSequence) {\n      c = String.fromCharCode(i)\n      if (c === '\\\\') {\n        c = ''\n      }\n    } else {\n      c = String(i)\n      if (pad) {\n        const need = width - c.length\n        if (need > 0) {\n          const z = new Array(need + 1).join('0')\n          if (i < 0) {\n            c = '-' + z + c.slice(1)\n          } else {\n            c = z + c\n          }\n        }\n      }\n    }\n    if (length + c.length > maxLength) break\n    N.push(c)\n    length += c.length\n  }\n  return N\n}\n\nfunction expand_(\n  str: string,\n  max: number,\n  maxLength: number,\n  isTop: boolean,\n): string[] {\n  // Consume the string's top-level brace groups left to right, threading a\n  // running set of combined prefixes (`acc`). Expanding the tail iteratively -\n  // rather than recursing on `m.post` once per group - keeps the native stack\n  // depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no\n  // longer overflow the stack, and leaves a single accumulator whose size\n  // `maxLength` bounds directly (CVE-2026-14257).\n  let acc: string[] = ['']\n\n  // Bash drops empty results, but only when the *first* top-level group is a\n  // comma set - a sequence like `{a..\\}` may legitimately yield ''. The drop\n  // is on the final strings, so it is applied to whichever `combine` produces\n  // them (the one with no brace set left in the tail).\n  let dropEmpties = false\n  let firstGroup = true\n\n  for (;;) {\n    const m = balanced('{', '}', str)\n\n    // No brace set left: the rest of the string is literal.\n    if (!m) {\n      return combine(acc, str, [''], max, maxLength, dropEmpties)\n    }\n\n    // no need to expand pre, since it is guaranteed to be free of brace-sets\n    const pre = m.pre\n\n    if (/\\$$/.test(pre)) {\n      acc = combine(\n        acc,\n        pre + '{' + m.body + '}',\n        [''],\n        max,\n        maxLength,\n        dropEmpties && !m.post.length,\n      )\n      firstGroup = false\n      if (!m.post.length) break\n      str = m.post\n      continue\n    }\n\n    const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body)\n    const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(\n      m.body,\n    )\n    const isSequence = isNumericSequence || isAlphaSequence\n    const isOptions = m.body.indexOf(',') >= 0\n    if (!isSequence && !isOptions) {\n      // {a},b}\n      if (m.post.match(/,(?!,).*\\}/)) {\n        str = m.pre + '{' + m.body + escClose + m.post\n        isTop = true\n        continue\n      }\n      // Nothing here expands, so the whole remaining string is literal.\n      return combine(\n        acc,\n        pre + '{' + m.body + '}' + m.post,\n        [''],\n        max,\n        maxLength,\n        dropEmpties,\n      )\n    }\n\n    if (firstGroup) {\n      dropEmpties = isTop && !isSequence\n      firstGroup = false\n    }\n\n    let values: string[]\n    if (isSequence) {\n      values = expandSequence(m.body, isAlphaSequence, max, maxLength)\n    } else {\n      let n = parseCommaParts(m.body)\n      if (n.length === 1 && n[0] !== undefined) {\n        // x{{a,b}}y ==> x{a}y x{b}y\n        n = expand_(n[0], max, maxLength, false).map(embrace)\n        //XXX is this necessary? Can't seem to hit it in tests.\n        /* c8 ignore start */\n        if (n.length === 1) {\n          acc = combine(\n            acc,\n            pre + n[0],\n            [''],\n            max,\n            maxLength,\n            dropEmpties && !m.post.length,\n          )\n          if (!m.post.length) break\n          str = m.post\n          continue\n        }\n        /* c8 ignore stop */\n      }\n\n      // Values that `combine` is going to drop as empty produce no result, so\n      // they must not count against `max` - otherwise `{a,,b}` with `max: 2`\n      // would stop at `['a', '']` and yield one result instead of two. Skipping\n      // them outright keeps `values` bounded while leaving `max` a bound on\n      // *kept* results.\n      let dropsEmpties = dropEmpties && !m.post.length && !pre\n      for (let d = 0; dropsEmpties && d < acc.length; d++) {\n        if (acc[d]) {\n          dropsEmpties = false\n        }\n      }\n\n      values = []\n      let valuesLength = 0\n      outer: for (let j = 0; j < n.length; j++) {\n        const expanded = expand_(n[j] as string, max, maxLength, false)\n        for (let k = 0; k < expanded.length; k++) {\n          const v = expanded[k] as string\n          if (dropsEmpties && !v) continue\n          if (values.length >= max || valuesLength + v.length > maxLength) {\n            break outer\n          }\n          values.push(v)\n          valuesLength += v.length\n        }\n      }\n    }\n\n    acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length)\n    if (!m.post.length) break\n    str = m.post\n  }\n\n  return acc\n}\n"]}7x ;100644 index.d.ts ޝF%5s;߅100644 index.d.ts.map XD-=)`o{100644 index.js hp) zS100644 index.js.map 4Z)0烪{)100644 package.json =U~5 JPV㚖P)x+import { balanced } from 'balanced-match';
const escSlash = '\0SLASH' + Math.random() + '\0';
const escOpen = '\0OPEN' + Math.random() + '\0';
const escClose = '\0CLOSE' + Math.random() + '\0';
const escComma = '\0COMMA' + Math.random() + '\0';
const escPeriod = '\0PERIOD' + Math.random() + '\0';
const escSlashPattern = new RegExp(escSlash, 'g');
const escOpenPattern = new RegExp(escOpen, 'g');
const escClosePattern = new RegExp(escClose, 'g');
const escCommaPattern = new RegExp(escComma, 'g');
const escPeriodPattern = new RegExp(escPeriod, 'g');
const slashPattern = /\\\\/g;
const openPattern = /\\{/g;
const closePattern = /\\}/g;
const commaPattern = /\\,/g;
const periodPattern = /\\\./g;
export const EXPANSION_MAX = 100_000;
// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An
// input like `'{a,b}'.repeat(1500)` stays under that count - its output is
// truncated to 100k results - while making every result ~1500 characters
// long. The result set, and the intermediate arrays built while combining
// brace sets, then grow large enough to exhaust memory and crash the process
// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of
// characters the accumulator may hold at any point, so memory stays flat no
// matter how many brace groups are chained. The limit sits well above any
// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M
// characters) so legitimate input is unaffected.
export const EXPANSION_MAX_LENGTH = 4_000_000;
function numeric(str) {
    return !isNaN(str) ? parseInt(str, 10) : str.charCodeAt(0);
}
function escapeBraces(str) {
    return str
        .replace(slashPattern, escSlash)
        .replace(openPattern, escOpen)
        .replace(closePattern, escClose)
        .replace(commaPattern, escComma)
        .replace(periodPattern, escPeriod);
}
function unescapeBraces(str) {
    return str
        .replace(escSlashPattern, '\\')
        .replace(escOpenPattern, '{')
        .replace(escClosePattern, '}')
        .replace(escCommaPattern, ',')
        .replace(escPeriodPattern, '.');
}
/**
 * Basically just str.split(","), but handling cases
 * where we have nested braced sections, which should be
 * treated as individual members, like {a,{b,c},d}
 */
function parseCommaParts(str) {
    if (!str) {
        return [''];
    }
    const parts = [];
    const m = balanced('{', '}', str);
    if (!m) {
        return str.split(',');
    }
    const { pre, body, post } = m;
    const p = pre.split(',');
    p[p.length - 1] += '{' + body + '}';
    const postParts = parseCommaParts(post);
    if (post.length) {
        ;
        p[p.length - 1] += postParts.shift();
        p.push.apply(p, postParts);
    }
    parts.push.apply(parts, p);
    return parts;
}
export function expand(str, options = {}) {
    if (!str) {
        return [];
    }
    const { max = EXPANSION_MAX, maxLength = EXPANSION_MAX_LENGTH } = options;
    // I don't know why Bash 4.3 does this, but it does.
    // Anything starting with {} will have the first two bytes preserved
    // but *only* at the top level, so {},a}b will not expand to anything,
    // but a{},b}c will be expanded to [a}c,abc].
    // One could argue that this is a bug in Bash, but since the goal of
    // this module is to match Bash's rules, we escape a leading {}
    if (str.slice(0, 2) === '{}') {
        str = '\\{\\}' + str.slice(2);
    }
    return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces);
}
function embrace(str) {
    return '{' + str + '}';
}
function isPadded(el) {
    return /^-?0\d/.test(el);
}
function lte(i, y) {
    return i <= y;
}
function gte(i, y) {
    return i >= y;
}
// Build `{ acc[a] + pre + values[v] }` for every combination, capping the
// number of results at `max` and the total number of characters at `maxLength`.
// This is the one place output grows, so bounding it here keeps the single
// accumulator - and therefore memory - flat regardless of how many brace groups
// are combined (CVE-2026-14257).
function combine(acc, pre, values, max, maxLength, dropEmpties) {
    const out = [];
    let length = 0;
    for (let a = 0; a < acc.length; a++) {
        for (let v = 0; v < values.length; v++) {
            if (out.length >= max)
                return out;
            const expansion = acc[a] + pre + values[v];
            // Bash drops empty results at the top level. Skip them before they count
            // against `max`, so `max` bounds the number of *kept* results.
            if (dropEmpties && !expansion)
                continue;
            if (length + expansion.length > maxLength)
                return out;
            out.push(expansion);
            length += expansion.length;
        }
    }
    return out;
}
// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`)
// sequence body.
function expandSequence(body, isAlphaSequence, max, maxLength) {
    const n = body.split(/\.\./);
    const N = [];
    // A sequence body always splits into two or three parts, but the compiler
    // can't know that.
    /* c8 ignore start */
    if (n[0] === undefined || n[1] === undefined) {
        return N;
    }
    /* c8 ignore stop */
    const x = numeric(n[0]);
    const y = numeric(n[1]);
    const width = Math.max(n[0].length, n[1].length);
    let incr = n.length === 3 && n[2] !== undefined ?
        Math.max(Math.abs(numeric(n[2])), 1)
        : 1;
    let test = lte;
    const reverse = y < x;
    if (reverse) {
        incr *= -1;
        test = gte;
    }
    const pad = n.some(isPadded);
    let length = 0;
    for (let i = x; test(i, y) && N.length < max; i += incr) {
        let c;
        if (isAlphaSequence) {
            c = String.fromCharCode(i);
            if (c === '\\') {
                c = '';
            }
        }
        else {
            c = String(i);
            if (pad) {
                const need = width - c.length;
                if (need > 0) {
                    const z = new Array(need + 1).join('0');
                    if (i < 0) {
                        c = '-' + z + c.slice(1);
                    }
                    else {
                        c = z + c;
                    }
                }
            }
        }
        if (length + c.length > maxLength)
            break;
        N.push(c);
        length += c.length;
    }
    return N;
}
function expand_(str, max, maxLength, isTop) {
    // Consume the string's top-level brace groups left to right, threading a
    // running set of combined prefixes (`acc`). Expanding the tail iteratively -
    // rather than recursing on `m.post` once per group - keeps the native stack
    // depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no
    // longer overflow the stack, and leaves a single accumulator whose size
    // `maxLength` bounds directly (CVE-2026-14257).
    let acc = [''];
    // Bash drops empty results, but only when the *first* top-level group is a
    // comma set - a sequence like `{a..\}` may legitimately yield ''. The drop
    // is on the final strings, so it is applied to whichever `combine` produces
    // them (the one with no brace set left in the tail).
    let dropEmpties = false;
    let firstGroup = true;
    for (;;) {
        const m = balanced('{', '}', str);
        // No brace set left: the rest of the string is literal.
        if (!m) {
            return combine(acc, str, [''], max, maxLength, dropEmpties);
        }
        // no need to expand pre, since it is guaranteed to be free of brace-sets
        const pre = m.pre;
        if (/\$$/.test(pre)) {
            acc = combine(acc, pre + '{' + m.body + '}', [''], max, maxLength, dropEmpties && !m.post.length);
            firstGroup = false;
            if (!m.post.length)
                break;
            str = m.post;
            continue;
        }
        const isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
        const isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
        const isSequence = isNumericSequence || isAlphaSequence;
        const isOptions = m.body.indexOf(',') >= 0;
        if (!isSequence && !isOptions) {
            // {a},b}
            if (m.post.match(/,(?!,).*\}/)) {
                str = m.pre + '{' + m.body + escClose + m.post;
                isTop = true;
                continue;
            }
            // Nothing here expands, so the whole remaining string is literal.
            return combine(acc, pre + '{' + m.body + '}' + m.post, [''], max, maxLength, dropEmpties);
        }
        if (firstGroup) {
            dropEmpties = isTop && !isSequence;
            firstGroup = false;
        }
        let values;
        if (isSequence) {
            values = expandSequence(m.body, isAlphaSequence, max, maxLength);
        }
        else {
            let n = parseCommaParts(m.body);
            if (n.length === 1 && n[0] !== undefined) {
                // x{{a,b}}y ==> x{a}y x{b}y
                n = expand_(n[0], max, maxLength, false).map(embrace);
                //XXX is this necessary? Can't seem to hit it in tests.
                /* c8 ignore start */
                if (n.length === 1) {
                    acc = combine(acc, pre + n[0], [''], max, maxLength, dropEmpties && !m.post.length);
                    if (!m.post.length)
                        break;
                    str = m.post;
                    continue;
                }
                /* c8 ignore stop */
            }
            // Values that `combine` is going to drop as empty produce no result, so
            // they must not count against `max` - otherwise `{a,,b}` with `max: 2`
            // would stop at `['a', '']` and yield one result instead of two. Skipping
            // them outright keeps `values` bounded while leaving `max` a bound on
            // *kept* results.
            let dropsEmpties = dropEmpties && !m.post.length && !pre;
            for (let d = 0; dropsEmpties && d < acc.length; d++) {
                if (acc[d]) {
                    dropsEmpties = false;
                }
            }
            values = [];
            let valuesLength = 0;
            outer: for (let j = 0; j < n.length; j++) {
                const expanded = expand_(n[j], max, maxLength, false);
                for (let k = 0; k < expanded.length; k++) {
                    const v = expanded[k];
                    if (dropsEmpties && !v)
                        continue;
                    if (values.length >= max || valuesLength + v.length > maxLength) {
                        break outer;
                    }
                    values.push(v);
                    valuesLength += v.length;
                }
            }
        }
        acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length);
        if (!m.post.length)
            break;
        str = m.post;
    }
    return acc;
}
//# sourceMappingURL=index.js.map9
xcQ{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAA;AAEzC,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,OAAO,GAAG,QAAQ,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AAC/C,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,QAAQ,GAAG,SAAS,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACjD,MAAM,SAAS,GAAG,UAAU,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,IAAI,CAAA;AACnD,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,cAAc,GAAG,IAAI,MAAM,CAAC,OAAO,EAAE,GAAG,CAAC,CAAA;AAC/C,MAAM,eAAe,GAAG,IAAI,MAAM,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAA;AACjD,MAAM,e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ACH,CAAC;YAED,MAAM,GAAG,EAAE,CAAA;YACX,IAAI,YAAY,GAAG,CAAC,CAAA;YACpB,KAAK,EAAE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;gBACzC,MAAM,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC,CAAW,EAAE,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,CAAA;gBAC/D,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;oBACzC,MAAM,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAW,CAAA;oBAC/B,IAAI,YAAY,IAAI,CAAC,CAAC;wBAAE,SAAQ;oBAChC,IAAI,MAAM,CAAC,MAAM,IAAI,GAAG,IAAI,YAAY,GAAG,CAAC,CAAC,MAAM,GAAG,SAAS,EAAE,CAAC;wBAChE,MAAM,KAAK,CAAA;oBACb,CAAC;oBACD,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;oBACd,YAAY,IAAI,CAAC,CAAC,MAAM,CAAA;gBAC1B,CAAC;YACH,CAAC;QACH,CAAC;QAED,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,SAAS,EAAE,WAAW,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAA;QAC9E,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM;YAAE,MAAK;QACzB,GAAG,GAAG,CAAC,CAAC,IAAI,CAAA;IACd,CAAC;IAED,OAAO,GAAG,CAAA;AACZ,CAAC","sourcesContent":["import { balanced } from 'balanced-match'\n\nconst escSlash = '\\0SLASH' + Math.random() + '\\0'\nconst escOpen = '\\0OPEN' + Math.random() + '\\0'\nconst escClose = '\\0CLOSE' + Math.random() + '\\0'\nconst escComma = '\\0COMMA' + Math.random() + '\\0'\nconst escPeriod = '\\0PERIOD' + Math.random() + '\\0'\nconst escSlashPattern = new RegExp(escSlash, 'g')\nconst escOpenPattern = new RegExp(escOpen, 'g')\nconst escClosePattern = new RegExp(escClose, 'g')\nconst escCommaPattern = new RegExp(escComma, 'g')\nconst escPeriodPattern = new RegExp(escPeriod, 'g')\nconst slashPattern = /\\\\\\\\/g\nconst openPattern = /\\\\{/g\nconst closePattern = /\\\\}/g\nconst commaPattern = /\\\\,/g\nconst periodPattern = /\\\\\\./g\n\nexport const EXPANSION_MAX = 100_000\n\n// `EXPANSION_MAX` caps the *number* of expansions, but not their length. An\n// input like `'{a,b}'.repeat(1500)` stays under that count - its output is\n// truncated to 100k results - while making every result ~1500 characters\n// long. The result set, and the intermediate arrays built while combining\n// brace sets, then grow large enough to exhaust memory and crash the process\n// (CVE-2026-14257). `EXPANSION_MAX_LENGTH` bounds the total number of\n// characters the accumulator may hold at any point, so memory stays flat no\n// matter how many brace groups are chained. The limit sits well above any\n// realistic expansion (100k results hitting `EXPANSION_MAX` measure ~1M\n// characters) so legitimate input is unaffected.\nexport const EXPANSION_MAX_LENGTH = 4_000_000\n\nfunction numeric(str: string) {\n  return !isNaN(str as any) ? parseInt(str, 10) : str.charCodeAt(0)\n}\n\nfunction escapeBraces(str: string) {\n  return str\n    .replace(slashPattern, escSlash)\n    .replace(openPattern, escOpen)\n    .replace(closePattern, escClose)\n    .replace(commaPattern, escComma)\n    .replace(periodPattern, escPeriod)\n}\n\nfunction unescapeBraces(str: string) {\n  return str\n    .replace(escSlashPattern, '\\\\')\n    .replace(escOpenPattern, '{')\n    .replace(escClosePattern, '}')\n    .replace(escCommaPattern, ',')\n    .replace(escPeriodPattern, '.')\n}\n\n/**\n * Basically just str.split(\",\"), but handling cases\n * where we have nested braced sections, which should be\n * treated as individual members, like {a,{b,c},d}\n */\nfunction parseCommaParts(str: string) {\n  if (!str) {\n    return ['']\n  }\n\n  const parts: string[] = []\n  const m = balanced('{', '}', str)\n\n  if (!m) {\n    return str.split(',')\n  }\n\n  const { pre, body, post } = m\n  const p = pre.split(',')\n\n  p[p.length - 1] += '{' + body + '}'\n  const postParts = parseCommaParts(post)\n  if (post.length) {\n    ;(p[p.length - 1] as string) += postParts.shift()\n    p.push.apply(p, postParts)\n  }\n\n  parts.push.apply(parts, p)\n\n  return parts\n}\n\nexport type BraceExpansionOptions = {\n  max?: number\n  maxLength?: number\n}\n\nexport function expand(str: string, options: BraceExpansionOptions = {}) {\n  if (!str) {\n    return []\n  }\n\n  const { max = EXPANSION_MAX, maxLength = EXPANSION_MAX_LENGTH } = options\n\n  // I don't know why Bash 4.3 does this, but it does.\n  // Anything starting with {} will have the first two bytes preserved\n  // but *only* at the top level, so {},a}b will not expand to anything,\n  // but a{},b}c will be expanded to [a}c,abc].\n  // One could argue that this is a bug in Bash, but since the goal of\n  // this module is to match Bash's rules, we escape a leading {}\n  if (str.slice(0, 2) === '{}') {\n    str = '\\\\{\\\\}' + str.slice(2)\n  }\n\n  return expand_(escapeBraces(str), max, maxLength, true).map(unescapeBraces)\n}\n\nfunction embrace(str: string) {\n  return '{' + str + '}'\n}\n\nfunction isPadded(el: string) {\n  return /^-?0\\d/.test(el)\n}\n\nfunction lte(i: number, y: number) {\n  return i <= y\n}\n\nfunction gte(i: number, y: number) {\n  return i >= y\n}\n\n// Build `{ acc[a] + pre + values[v] }` for every combination, capping the\n// number of results at `max` and the total number of characters at `maxLength`.\n// This is the one place output grows, so bounding it here keeps the single\n// accumulator - and therefore memory - flat regardless of how many brace groups\n// are combined (CVE-2026-14257).\nfunction combine(\n  acc: string[],\n  pre: string,\n  values: string[],\n  max: number,\n  maxLength: number,\n  dropEmpties: boolean,\n): string[] {\n  const out: string[] = []\n  let length = 0\n  for (let a = 0; a < acc.length; a++) {\n    for (let v = 0; v < values.length; v++) {\n      if (out.length >= max) return out\n      const expansion = (acc[a] as string) + pre + values[v]\n      // Bash drops empty results at the top level. Skip them before they count\n      // against `max`, so `max` bounds the number of *kept* results.\n      if (dropEmpties && !expansion) continue\n      if (length + expansion.length > maxLength) return out\n      out.push(expansion)\n      length += expansion.length\n    }\n  }\n  return out\n}\n\n// The expansion values of a single numeric (`1..5`) or alphabetic (`a..e..2`)\n// sequence body.\nfunction expandSequence(\n  body: string,\n  isAlphaSequence: boolean,\n  max: number,\n  maxLength: number,\n): string[] {\n  const n = body.split(/\\.\\./)\n  const N: string[] = []\n  // A sequence body always splits into two or three parts, but the compiler\n  // can't know that.\n  /* c8 ignore start */\n  if (n[0] === undefined || n[1] === undefined) {\n    return N\n  }\n  /* c8 ignore stop */\n  const x = numeric(n[0])\n  const y = numeric(n[1])\n  const width = Math.max(n[0].length, n[1].length)\n  let incr =\n    n.length === 3 && n[2] !== undefined ?\n      Math.max(Math.abs(numeric(n[2])), 1)\n    : 1\n  let test = lte\n  const reverse = y < x\n  if (reverse) {\n    incr *= -1\n    test = gte\n  }\n  const pad = n.some(isPadded)\n\n  let length = 0\n  for (let i = x; test(i, y) && N.length < max; i += incr) {\n    let c\n    if (isAlphaSequence) {\n      c = String.fromCharCode(i)\n      if (c === '\\\\') {\n        c = ''\n      }\n    } else {\n      c = String(i)\n      if (pad) {\n        const need = width - c.length\n        if (need > 0) {\n          const z = new Array(need + 1).join('0')\n          if (i < 0) {\n            c = '-' + z + c.slice(1)\n          } else {\n            c = z + c\n          }\n        }\n      }\n    }\n    if (length + c.length > maxLength) break\n    N.push(c)\n    length += c.length\n  }\n  return N\n}\n\nfunction expand_(\n  str: string,\n  max: number,\n  maxLength: number,\n  isTop: boolean,\n): string[] {\n  // Consume the string's top-level brace groups left to right, threading a\n  // running set of combined prefixes (`acc`). Expanding the tail iteratively -\n  // rather than recursing on `m.post` once per group - keeps the native stack\n  // depth constant, so deeply chained input (`'{a,b}'.repeat(3000)`) can no\n  // longer overflow the stack, and leaves a single accumulator whose size\n  // `maxLength` bounds directly (CVE-2026-14257).\n  let acc: string[] = ['']\n\n  // Bash drops empty results, but only when the *first* top-level group is a\n  // comma set - a sequence like `{a..\\}` may legitimately yield ''. The drop\n  // is on the final strings, so it is applied to whichever `combine` produces\n  // them (the one with no brace set left in the tail).\n  let dropEmpties = false\n  let firstGroup = true\n\n  for (;;) {\n    const m = balanced('{', '}', str)\n\n    // No brace set left: the rest of the string is literal.\n    if (!m) {\n      return combine(acc, str, [''], max, maxLength, dropEmpties)\n    }\n\n    // no need to expand pre, since it is guaranteed to be free of brace-sets\n    const pre = m.pre\n\n    if (/\\$$/.test(pre)) {\n      acc = combine(\n        acc,\n        pre + '{' + m.body + '}',\n        [''],\n        max,\n        maxLength,\n        dropEmpties && !m.post.length,\n      )\n      firstGroup = false\n      if (!m.post.length) break\n      str = m.post\n      continue\n    }\n\n    const isNumericSequence = /^-?\\d+\\.\\.-?\\d+(?:\\.\\.-?\\d+)?$/.test(m.body)\n    const isAlphaSequence = /^[a-zA-Z]\\.\\.[a-zA-Z](?:\\.\\.-?\\d+)?$/.test(\n      m.body,\n    )\n    const isSequence = isNumericSequence || isAlphaSequence\n    const isOptions = m.body.indexOf(',') >= 0\n    if (!isSequence && !isOptions) {\n      // {a},b}\n      if (m.post.match(/,(?!,).*\\}/)) {\n        str = m.pre + '{' + m.body + escClose + m.post\n        isTop = true\n        continue\n      }\n      // Nothing here expands, so the whole remaining string is literal.\n      return combine(\n        acc,\n        pre + '{' + m.body + '}' + m.post,\n        [''],\n        max,\n        maxLength,\n        dropEmpties,\n      )\n    }\n\n    if (firstGroup) {\n      dropEmpties = isTop && !isSequence\n      firstGroup = false\n    }\n\n    let values: string[]\n    if (isSequence) {\n      values = expandSequence(m.body, isAlphaSequence, max, maxLength)\n    } else {\n      let n = parseCommaParts(m.body)\n      if (n.length === 1 && n[0] !== undefined) {\n        // x{{a,b}}y ==> x{a}y x{b}y\n        n = expand_(n[0], max, maxLength, false).map(embrace)\n        //XXX is this necessary? Can't seem to hit it in tests.\n        /* c8 ignore start */\n        if (n.length === 1) {\n          acc = combine(\n            acc,\n            pre + n[0],\n            [''],\n            max,\n            maxLength,\n            dropEmpties && !m.post.length,\n          )\n          if (!m.post.length) break\n          str = m.post\n          continue\n        }\n        /* c8 ignore stop */\n      }\n\n      // Values that `combine` is going to drop as empty produce no result, so\n      // they must not count against `max` - otherwise `{a,,b}` with `max: 2`\n      // would stop at `['a', '']` and yield one result instead of two. Skipping\n      // them outright keeps `values` bounded while leaving `max` a bound on\n      // *kept* results.\n      let dropsEmpties = dropEmpties && !m.post.length && !pre\n      for (let d = 0; dropsEmpties && d < acc.length; d++) {\n        if (acc[d]) {\n          dropsEmpties = false\n        }\n      }\n\n      values = []\n      let valuesLength = 0\n      outer: for (let j = 0; j < n.length; j++) {\n        const expanded = expand_(n[j] as string, max, maxLength, false)\n        for (let k = 0; k < expanded.length; k++) {\n          const v = expanded[k] as string\n          if (dropsEmpties && !v) continue\n          if (values.length >= max || valuesLength + v.length > maxLength) {\n            break outer\n          }\n          values.push(v)\n          valuesLength += v.length\n        }\n      }\n    }\n\n    acc = combine(acc, pre, values, max, maxLength, dropEmpties && !m.post.length)\n    if (!m.post.length) break\n    str = m.post\n  }\n\n  return acc\n}\n"]}ئ`x{
  "name": "brace-expansion",
  "description": "Brace expansion as known from sh/bash",
  "version": "5.0.9",
  "files": [
    "dist"
  ],
  "exports": {
    "./package.json": "./package.json",
    ".": {
      "import": {
        "types": "./dist/esm/index.d.ts",
        "default": "./dist/esm/index.js"
      },
      "require": {
        "types": "./dist/commonjs/index.d.ts",
        "default": "./dist/commonjs/index.js"
      }
    }
  },
  "type": "module",
  "scripts": {
    "preversion": "npm test",
    "postversion": "npm publish",
    "prepublishOnly": "git push origin --follow-tags",
    "prepare": "tshy",
    "pretest": "npm run prepare",
    "presnap": "npm run prepare",
    "test": "tap",
    "snap": "tap",
    "format": "prettier --write .",
    "benchmark": "node benchmark/index.js",
    "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts"
  },
  "devDependencies": {
    "@types/brace-expansion": "^1.1.2",
    "@types/node": "^25.2.1",
    "mkdirp": "^3.0.1",
    "prettier": "^3.3.2",
    "tap": "^21.6.2",
    "tshy": "^3.0.2",
    "typedoc": "^0.28.5"
  },
  "dependencies": {
    "balanced-match": "^4.0.2"
  },
  "license": "MIT",
  "engines": {
    "node": "20 || >=22"
  },
  "tshy": {
    "exports": {
      "./package.json": "./package.json",
      ".": "./src/index.ts"
    }
  },
  "main": "./dist/commonjs/index.js",
  "types": "./dist/commonjs/index.d.ts",
  "module": "./dist/esm/index.js",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/juliangruber/brace-expansion.git"
  }
}
nVx E100644 index.d.ts Fl#У78100644 index.js mHA6HٞZh߂q100644 license 2<tD?U100644 package.json g'Ҵ:A $100644 readme.md TyO8lֵzȯe4L0xS/**
 * Count how often a character (or substring) is used in a string.
 *
 * @param {string} value
 *   Value to search in.
 * @param {string} character
 *   Character (or substring) to look for.
 * @return {number}
 *   Number of times `character` occurred in `value`.
 */
export function ccount(value: string, character: string): number
(r2&xk/**
 * Count how often a character (or substring) is used in a string.
 *
 * @param {string} value
 *   Value to search in.
 * @param {string} character
 *   Character (or substring) to look for.
 * @return {number}
 *   Number of times `character` occurred in `value`.
 */
export function ccount(value, character) {
  const source = String(value)

  if (typeof character !== 'string') {
    throw new TypeError('Expected character')
  }

  let count = 0
  let index = source.indexOf(character)

  while (index !== -1) {
    count++
    index = source.indexOf(character, index + character.length)
  }

  return count
}
tȵExUMIT License

Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
hebx KJ(The MIT License)

Copyright (c) 2015 Titus Wormer <tituswormer@gmail.com>TG
?
'Software'9
 C
dB
E
Y
GZ'AS IS'
B
F
RD
D
A
7.4ܲxx}{
  "name": "fault",
  "version": "2.0.1",
  "description": "Functional errors with formatted output",
  "license": "MIT",
  "keywords": [
    "error",
    "exception",
    "printf",
    "sprintf",
    "vsprintf",
    "format",
    "string"
  ],
  "repository": "wooorm/fault",
  "bugs": "https://github.com/wooorm/fault/issues",
  "funding": {
    "type": "github",
    "url": "https://github.com/sponsors/wooorm"
  },
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "sideEffects": false,
  "type": "module",
  "main": "index.js",
  "types": "index.d.ts",
  "files": [
    "index.d.ts",
    "index.js"
  ],
  "dependencies": {
    "format": "^0.2.0"
  },
  "devDependencies": {
    "@types/tape": "^4.0.0",
    "c8": "^7.0.0",
    "prettier": "^2.0.0",
    "remark-cli": "^10.0.0",
    "remark-preset-wooorm": "^9.0.0",
    "rimraf": "^3.0.0",
    "tape": "^5.0.0",
    "type-coverage": "^2.0.0",
    "typescript": "^4.0.0",
    "xo": "^0.46.0"
  },
  "scripts": {
    "prepublishOnly": "npm run build && npm run format",
    "build": "rimraf \"*.d.ts\" && tsc && type-coverage",
    "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
    "test-api": "node --conditions development test.js",
    "test-coverage": "c8 --check-coverage --branches 100 --functions 100 --lines 100 --statements 100 --reporter lcov npm run test-api",
    "test": "npm run build && npm run format && npm run test-coverage"
  },
  "prettier": {
    "tabWidth": 2,
    "useTabs": false,
    "singleQuote": true,
    "bracketSpacing": false,
    "semi": false,
    "trailingComma": "none"
  },
  "xo": {
    "prettier": true
  },
  "remarkConfig": {
    "plugins": [
      "preset-wooorm"
    ]
  },
  "typeCoverage": {
    "atLeast": 100,
    "detail": true,
    "strict": true,
    "ignoreCatch": true
  }
}
0.%	x c{
  "name": "ccoun,>Count how often a character (or substring) is used in a stringd,"character",
    "count",
    "charccoun)ccoun?	y2xx# ccount

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]

Count how often a character (or substring) is used in a string.

## Contents

*   [What is this?](#what-is-this)
*   [When should I use this?](#when-should-i-use-this)
*   [Install](#install)
*   [Use](#use)
*   [API](#api)
    *   [`ccount(value, character)`](#ccountvalue-character)
*   [Types](#types)
*   [Compatibility](#compatibility)
*   [Security](#security)
*   [Related](#related)
*   [Contribute](#contribute)
*   [License](#license)

## What is this?

This package is a small utility that helps you find how frequently a substring
occurs in another string.

## When should I use this?

I find this particularly useful when generating code, for example, when building
a string that can either be double or single quoted.
I use this utility to choose single quotes when double quotes are used more
frequently, and double quotes otherwise.

## Install

This package is [ESM only][esm].
In Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]:

```sh
npm install ccount
```

In Deno with [Skypack][]:

```js
import {ccount} from 'https://cdn.skypack.dev/ccount@2?dts'
```

In browsers with [Skypack][]:

```html
<script type="module">
  import {ccount} from 'https://cdn.skypack.dev/ccount@2?min'
</script>
```

## Use

```js
import {ccount} from 'ccount'

ccount('foo(bar(baz)', '(') // => 2
ccount('foo(bar(baz)', ')') // => 1
```

## API

This package exports the following identifier: `ccount`.
There is no default export.

### `ccount(value, character)`

Count how often a character (or substring) is used in a string.

###### Parameters

*   `value` (`string`)
    — value to search in
*   `character` (`string`)
    — character (or substring) to look for

###### Returns

`number` — number of times `character` occurred in `value`.

## Types

This package is fully typed with [TypeScript][].

## Compatibility

This package is at least compatible with all maintained versions of Node.js.
As of now, that is Node.js 12.20+, 14.14+, and 16.0+.
It also works in Deno and modern browsers.

## Security

This package is safe.

## Related

*   [`wooorm/longest-streak`](https://github.com/wooorm/longest-streak)
    — count of longest repeating streak of `character` in `value`
*   [`wooorm/direction`](https://github.com/wooorm/direction)
    — detect directionality: left-to-right, right-to-left, or neutral

## Contribute

Yes please!
See [How to Contribute to Open Source][contribute].

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/wooorm/ccount/workflows/main/badge.svg

[build]: https://github.com/wooorm/ccount/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/ccount.svg

[coverage]: https://codecov.io/github/wooorm/ccount

[downloads-badge]: https://img.shields.io/npm/dm/ccount.svg

[downloads]: https://www.npmjs.com/package/ccount

[size-badge]: https://img.shields.io/bundlephobia/minzip/ccount.svg

[size]: https://bundlephobia.com/result?p=ccount

[npm]: https://docs.npmjs.com/cli/install

[skypack]: https://www.skypack.dev

[license]: license

[author]: https://wooorm.com

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[typescript]: https://www.typescriptlang.org

[contribute]: https://opensource.guide/how-to-contribute/
Hx E100644 index.d.ts ~e?߾)8ze|˞{100644 index.js "MK\< 100644 license 2<tD?U100644 package.json 09c$U3</uZ100644 readme.md BzUUR>إʽv3Jx u/**
 * Map of named character references.
 *
 * @type {Record<string, string>}
 */
export const characterEntities: Record<string, string>
-N.ᾝxޑ!n/**
 * Map of named character references.
 *
 * @type {Record<string, string>}
 */
export const characterEntities = {
  AElig: 'Æ',
  AMP: '&',
  Aacute: 'Á',
  Abreve: 'Ă',
  Acirc: 'Â',
  Acy: 'А',
  Afr: '𝔄',
  Agrave: 'À',
  Alpha: 'Α',
  Amacr: 'Ā',
  And: '⩓',
  Aogon: 'Ą',
  Aopf: '𝔸',
  ApplyFunction: '⁡',
  Aring: 'Å',
  Ascr: '𝒜',
  Assign: '≔',
  Atilde: 'Ã',
  Auml: 'Ä',
  Backslash: '∖',
  Barv: '⫧',
  Barwed: '⌆',
  Bcy: 'Б',
  Because: '∵',
  Bernoullis: 'ℬ',
  Beta: 'Β',
  Bfr: '𝔅',
  Bopf: '𝔹',
  Breve: '˘',
  Bscr: 'ℬ',
  Bumpeq: '≎',
  CHcy: 'Ч',
  COPY: '©',
  Cacute: 'Ć',
  Cap: '⋒',
  CapitalDifferentialD: 'ⅅ',
  Cayleys: 'ℭ',
  Ccaron: 'Č',
  Ccedil: 'Ç',
  Ccirc: 'Ĉ',
  Cconint: '∰',
  Cdot: 'Ċ',
  Cedilla: '¸',
  CenterDot: '·',
  Cfr: 'ℭ',
  Chi: 'Χ',
  CircleDot: '⊙',
  CircleMinus: '⊖',
  CirclePlus: '⊕',
  CircleTimes: '⊗',
  ClockwiseContourIntegral: '∲',
  CloseCurlyDoubleQuote: '”',
  CloseCurlyQuote: '’',
  Colon: '∷',
  Colone: '⩴',
  Congruent: '≡',
  Conint: '∯',
  ContourIntegral: '∮',
  Copf: 'ℂ',
  Coproduct: '∐',
  CounterClockwiseContourIntegral: '∳',
  Cross: '⨯',
  Cscr: '𝒞',
  Cup: '⋓',
  CupCap: '≍',
  DD: 'ⅅ',
  DDotrahd: '⤑',
  DJcy: 'Ђ',
  DScy: 'Ѕ',
  DZcy: 'Џ',
  Dagger: '‡',
  Darr: '↡',
  Dashv: '⫤',
  Dcaron: 'Ď',
  Dcy: 'Д',
  Del: '∇',
  Delta: 'Δ',
  Dfr: '𝔇',
  DiacriticalAcute: '´',
  DiacriticalDot: '˙',
  DiacriticalDoubleAcute: '˝',
  DiacriticalGrave: '`',
  DiacriticalTilde: '˜',
  Diamond: '⋄',
  DifferentialD: 'ⅆ',
  Dopf: '𝔻',
  Dot: '¨',
  DotDot: '⃜',
  DotEqual: '≐',
  DoubleContourIntegral: '∯',
  DoubleDot: '¨',
  DoubleDownArrow: '⇓',
  DoubleLeftArrow: '⇐',
  DoubleLeftRightArrow: '⇔',
  DoubleLeftTee: '⫤',
  DoubleLongLeftArrow: '⟸',
  DoubleLongLeftRightArrow: '⟺',
  DoubleLongRightArrow: '⟹',
  DoubleRightArrow: '⇒',
  DoubleRightTee: '⊨',
  DoubleUpArrow: '⇑',
  DoubleUpDownArrow: '⇕',
  DoubleVerticalBar: '∥',
  DownArrow: '↓',
  DownArrowBar: '⤓',
  DownArrowUpArrow: '⇵',
  DownBreve: '̑',
  DownLeftRightVector: '⥐',
  DownLeftTeeVector: '⥞',
  DownLeftVector: '↽',
  DownLeftVectorBar: '⥖',
  DownRightTeeVector: '⥟',
  DownRightVector: '⇁',
  DownRightVectorBar: '⥗',
  DownTee: '⊤',
  DownTeeArrow: '↧',
  Downarrow: '⇓',
  Dscr: '𝒟',
  Dstrok: 'Đ',
  ENG: 'Ŋ',
  ETH: 'Ð',
  Eacute: 'É',
  Ecaron: 'Ě',
  Ecirc: 'Ê',
  Ecy: 'Э',
  Edot: 'Ė',
  Efr: '𝔈',
  Egrave: 'È',
  Element: '∈',
  Emacr: 'Ē',
  EmptySmallSquare: '◻',
  EmptyVerySmallSquare: '▫',
  Eogon: 'Ę',
  Eopf: '𝔼',
  Epsilon: 'Ε',
  Equal: '⩵',
  EqualTilde: '≂',
  Equilibrium: '⇌',
  Escr: 'ℰ',
  Esim: '⩳',
  Eta: 'Η',
  Euml: 'Ë',
  Exists: '∃',
  ExponentialE: 'ⅇ',
  Fcy: 'Ф',
  Ffr: '𝔉',
  FilledSmallSquare: '◼',
  FilledVerySmallSquare: '▪',
  Fopf: '𝔽',
  ForAll: '∀',
  Fouriertrf: 'ℱ',
  Fscr: 'ℱ',
  GJcy: 'Ѓ',
  GT: '>',
  Gamma: 'Γ',
  Gammad: 'Ϝ',
  Gbreve: 'Ğ',
  Gcedil: 'Ģ',
  Gcirc: 'Ĝ',
  Gcy: 'Г',
  Gdot: 'Ġ',
  Gfr: '𝔊',
  Gg: '⋙',
  Gopf: '𝔾',
  GreaterEqual: '≥',
  GreaterEqualLess: '⋛',
  GreaterFullEqual: '≧',
  GreaterGreater: '⪢',
  GreaterLess: '≷',
  GreaterSlantEqual: '⩾',
  GreaterTilde: '≳',
  Gscr: '𝒢',
  Gt: '≫',
  HARDcy: 'Ъ',
  Hacek: 'ˇ',
  Hat: '^',
  Hcirc: 'Ĥ',
  Hfr: 'ℌ',
  HilbertSpace: 'ℋ',
  Hopf: 'ℍ',
  HorizontalLine: '─',
  Hscr: 'ℋ',
  Hstrok: 'Ħ',
  HumpDownHump: '≎',
  HumpEqual: '≏',
  IEcy: 'Е',
  IJlig: 'Ĳ',
  IOcy: 'Ё',
  Iacute: 'Í',
  Icirc: 'Î',
  Icy: 'И',
  Idot: 'İ',
  Ifr: 'ℑ',
  Igrave: 'Ì',
  Im: 'ℑ',
  Imacr: 'Ī',
  ImaginaryI: 'ⅈ',
  Implies: '⇒',
  Int: '∬',
  Integral: '∫',
  Intersection: '⋂',
  InvisibleComma: '⁣',
  InvisibleTimes: '⁢',
  Iogon: 'Į',
  Iopf: '𝕀',
  Iota: 'Ι',
  Iscr: 'ℐ',
  Itilde: 'Ĩ',
  Iukcy: 'І',
  Iuml: 'Ï',
  Jcirc: 'Ĵ',
  Jcy: 'Й',
  Jfr: '𝔍',
  Jopf: '𝕁',
  Jscr: '𝒥',
  Jsercy: 'Ј',
  Jukcy: 'Є',
  KHcy: 'Х',
  KJcy: 'Ќ',
  Kappa: 'Κ',
  Kcedil: 'Ķ',
  Kcy: 'К',
  Kfr: '𝔎',
  Kopf: '𝕂',
  Kscr: '𝒦',
  LJcy: 'Љ',
  LT: '<',
  Lacute: 'Ĺ',
  Lambda: 'Λ',
  Lang: '⟪',
  Laplacetrf: 'ℒ',
  Larr: '↞',
  Lcaron: 'Ľ',
  Lcedil: 'Ļ',
  Lcy: 'Л',
  LeftAngleBracket: '⟨',
  LeftArrow: '←',
  LeftArrowBar: '⇤',
  LeftArrowRightArrow: '⇆',
  LeftCeiling: '⌈',
  LeftDoubleBracket: '⟦',
  LeftDownTeeVector: '⥡',
  LeftDownVector: '⇃',
  LeftDownVectorBar: '⥙',
  LeftFloor: '⌊',
  LeftRightArrow: '↔',
  LeftRightVector: '⥎',
  LeftTee: '⊣',
  LeftTeeArrow: '↤',
  LeftTeeVector: '⥚',
  LeftTriangle: '⊲',
  LeftTriangleBar: '⧏',
  LeftTriangleEqual: '⊴',
  LeftUpDownVector: '⥑',
  LeftUpTeeVector: '⥠',
  LeftUpVector: '↿',
  LeftUpVectorBar: '⥘',
  LeftVector: '↼',
  LeftVectorBar: '⥒',
  Leftarrow: '⇐',
  Leftrightarrow: '⇔',
  LessEqualGreater: '⋚',
  LessFullEqual: '≦',
  LessGreater: '≶',
  LessLess: '⪡',
  LessSlantEqual: '⩽',
  LessTilde: '≲',
  Lfr: '𝔏',
  Ll: '⋘',
  Lleftarrow: '⇚',
  Lmidot: 'Ŀ',
  LongLeftArrow: '⟵',
  LongLeftRightArrow: '⟷',
  LongRightArrow: '⟶',
  Longleftarrow: '⟸',
  Longleftrightarrow: '⟺',
  Longrightarrow: '⟹',
  Lopf: '𝕃',
  LowerLeftArrow: '↙',
  LowerRightArrow: '↘',
  Lscr: 'ℒ',
  Lsh: '↰',
  Lstrok: 'Ł',
  Lt: '≪',
  Map: '⤅',
  Mcy: 'М',
  MediumSpace: ' ',
  Mellintrf: 'ℳ',
  Mfr: '𝔐',
  MinusPlus: '∓',
  Mopf: '𝕄',
  Mscr: 'ℳ',
  Mu: 'Μ',
  NJcy: 'Њ',
  Nacute: 'Ń',
  Ncaron: 'Ň',
  Ncedil: 'Ņ',
  Ncy: 'Н',
  NegativeMediumSpace: '​',
  NegativeThickSpace: '​',
  NegativeThinSpace: '​',
  NegativeVeryThinSpace: '​',
  NestedGreaterGreater: '≫',
  NestedLessLess: '≪',
  NewLine: '\n',
  Nfr: '𝔑',
  NoBreak: '⁠',
  NonBreakingSpace: ' ',
  Nopf: 'ℕ',
  Not: '⫬',
  NotCongruent: '≢',
  NotCupCap: '≭',
  NotDoubleVerticalBar: '∦',
  NotElement: '∉',
  NotEqual: '≠',
  NotEqualTilde: '≂̸',
  NotExists: '∄',
  NotGreater: '≯',
  NotGreaterEqual: '≱',
  NotGreaterFullEqual: '≧̸',
  NotGreaterGreater: '≫̸',
  NotGreaterLess: '≹',
  NotGreaterSlantEqual: '⩾̸',
  NotGreaterTilde: '≵',
  NotHumpDownHump: '≎̸',
  NotHumpEqual: '≏̸',
  NotLeftTriangle: '⋪',
  NotLeftTriangleBar: '⧏̸',
  NotLeftTriangleEqual: '⋬',
  NotLess: '≮',
  NotLessEqual: '≰',
  NotLessGreater: '≸',
  NotLessLess: '≪̸',
  NotLessSlantEqual: '⩽̸',
  NotLessTilde: '≴',
  NotNestedGreaterGreater: '⪢̸',
  NotNestedLessLess: '⪡̸',
  NotPrecedes: '⊀',
  NotPrecedesEqual: '⪯̸',
  NotPrecedesSlantEqual: '⋠',
  NotReverseElement: '∌',
  NotRightTriangle: '⋫',
  NotRightTriangleBar: '⧐̸',
  NotRightTriangleEqual: '⋭',
  NotSquareSubset: '⊏̸',
  NotSquareSubsetEqual: '⋢',
  NotSquareSuperset: '⊐̸',
  NotSquareSupersetEqual: '⋣',
  NotSubset: '⊂⃒',
  NotSubsetEqual: '⊈',
  NotSucceeds: '⊁',
  NotSucceedsEqual: '⪰̸',
  NotSucceedsSlantEqual: '⋡',
  NotSucceedsTilde: '≿̸',
  NotSuperset: '⊃⃒',
  NotSupersetEqual: '⊉',
  NotTilde: '≁',
  NotTildeEqual: '≄',
  NotTildeFullEqual: '≇',
  NotTildeTilde: '≉',
  NotVerticalBar: '∤',
  Nscr: '𝒩',
  Ntilde: 'Ñ',
  Nu: 'Ν',
  OElig: 'Œ',
  Oacute: 'Ó',
  Ocirc: 'Ô',
  Ocy: 'О',
  Odblac: 'Ő',
  Ofr: '𝔒',
  Ograve: 'Ò',
  Omacr: 'Ō',
  Omega: 'Ω',
  Omicron: 'Ο',
  Oopf: '𝕆',
  OpenCurlyDoubleQuote: '“',
  OpenCurlyQuote: '‘',
  Or: '⩔',
  Oscr: '𝒪',
  Oslash: 'Ø',
  Otilde: 'Õ',
  Otimes: '⨷',
  Ouml: 'Ö',
  OverBar: '‾',
  OverBrace: '⏞',
  OverBracket: '⎴',
  OverParenthesis: '⏜',
  PartialD: '∂',
  Pcy: 'П',
  Pfr: '𝔓',
  Phi: 'Φ',
  Pi: 'Π',
  PlusMinus: '±',
  Poincareplane: 'ℌ',
  Popf: 'ℙ',
  Pr: '⪻',
  Precedes: '≺',
  PrecedesEqual: '⪯',
  PrecedesSlantEqual: '≼',
  PrecedesTilde: '≾',
  Prime: '″',
  Product: '∏',
  Proportion: '∷',
  Proportional: '∝',
  Pscr: '𝒫',
  Psi: 'Ψ',
  QUOT: '"',
  Qfr: '𝔔',
  Qopf: 'ℚ',
  Qscr: '𝒬',
  RBarr: '⤐',
  REG: '®',
  Racute: 'Ŕ',
  Rang: '⟫',
  Rarr: '↠',
  Rarrtl: '⤖',
  Rcaron: 'Ř',
  Rcedil: 'Ŗ',
  Rcy: 'Р',
  Re: 'ℜ',
  ReverseElement: '∋',
  ReverseEquilibrium: '⇋',
  ReverseUpEquilibrium: '⥯',
  Rfr: 'ℜ',
  Rho: 'Ρ',
  RightAngleBracket: '⟩',
  RightArrow: '→',
  RightArrowBar: '⇥',
  RightArrowLeftArrow: '⇄',
  RightCeiling: '⌉',
  RightDoubleBracket: '⟧',
  RightDownTeeVector: '⥝',
  RightDownVector: '⇂',
  RightDownVectorBar: '⥕',
  RightFloor: '⌋',
  RightTee: '⊢',
  RightTeeArrow: '↦',
  RightTeeVector: '⥛',
  RightTriangle: '⊳',
  RightTriangleBar: '⧐',
  RightTriangleEqual: '⊵',
  RightUpDownVector: '⥏',
  RightUpTeeVector: '⥜',
  RightUpVector: '↾',
  RightUpVectorBar: '⥔',
  RightVector: '⇀',
  RightVectorBar: '⥓',
  Rightarrow: '⇒',
  Ropf: 'ℝ',
  RoundImplies: '⥰',
  Rrightarrow: '⇛',
  Rscr: 'ℛ',
  Rsh: '↱',
  RuleDelayed: '⧴',
  SHCHcy: 'Щ',
  SHcy: 'Ш',
  SOFTcy: 'Ь',
  Sacute: 'Ś',
  Sc: '⪼',
  Scaron: 'Š',
  Scedil: 'Ş',
  Scirc: 'Ŝ',
  Scy: 'С',
  Sfr: '𝔖',
  ShortDownArrow: '↓',
  ShortLeftArrow: '←',
  ShortRightArrow: '→',
  ShortUpArrow: '↑',
  Sigma: 'Σ',
  SmallCircle: '∘',
  Sopf: '𝕊',
  Sqrt: '√',
  Square: '□',
  SquareIntersection: '⊓',
  SquareSubset: '⊏',
  SquareSubsetEqual: '⊑',
  SquareSuperset: '⊐',
  SquareSupersetEqual: '⊒',
  SquareUnion: '⊔',
  Sscr: '𝒮',
  Star: '⋆',
  Sub: '⋐',
  Subset: '⋐',
  SubsetEqual: '⊆',
  Succeeds: '≻',
  SucceedsEqual: '⪰',
  SucceedsSlantEqual: '≽',
  SucceedsTilde: '≿',
  SuchThat: '∋',
  Sum: '∑',
  Sup: '⋑',
  Superset: '⊃',
  SupersetEqual: '⊇',
  Supset: '⋑',
  THORN: 'Þ',
  TRADE: '™',
  TSHcy: 'Ћ',
  TScy: 'Ц',
  Tab: '\t',
  Tau: 'Τ',
  Tcaron: 'Ť',
  Tcedil: 'Ţ',
  Tcy: 'Т',
  Tfr: '𝔗',
  Therefore: '∴',
  Theta: 'Θ',
  ThickSpace: '  ',
  ThinSpace: ' ',
  Tilde: '∼',
  TildeEqual: '≃',
  TildeFullEqual: '≅',
  TildeTilde: '≈',
  Topf: '𝕋',
  TripleDot: '⃛',
  Tscr: '𝒯',
  Tstrok: 'Ŧ',
  Uacute: 'Ú',
  Uarr: '↟',
  Uarrocir: '⥉',
  Ubrcy: 'Ў',
  Ubreve: 'Ŭ',
  Ucirc: 'Û',
  Ucy: 'У',
  Udblac: 'Ű',
  Ufr: '𝔘',
  Ugrave: 'Ù',
  Umacr: 'Ū',
  UnderBar: '_',
  UnderBrace: '⏟',
  UnderBracket: '⎵',
  UnderParenthesis: '⏝',
  Union: '⋃',
  UnionPlus: '⊎',
  Uogon: 'Ų',
  Uopf: '𝕌',
  UpArrow: '↑',
  UpArrowBar: '⤒',
  UpArrowDownArrow: '⇅',
  UpDownArrow: '↕',
  UpEquilibrium: '⥮',
  UpTee: '⊥',
  UpTeeArrow: '↥',
  Uparrow: '⇑',
  Updownarrow: '⇕',
  UpperLeftArrow: '↖',
  UpperRightArrow: '↗',
  Upsi: 'ϒ',
  Upsilon: 'Υ',
  Uring: 'Ů',
  Uscr: '𝒰',
  Utilde: 'Ũ',
  Uuml: 'Ü',
  VDash: '⊫',
  Vbar: '⫫',
  Vcy: 'В',
  Vdash: '⊩',
  Vdashl: '⫦',
  Vee: '⋁',
  Verbar: '‖',
  Vert: '‖',
  VerticalBar: '∣',
  VerticalLine: '|',
  VerticalSeparator: '❘',
  VerticalTilde: '≀',
  VeryThinSpace: ' ',
  Vfr: '𝔙',
  Vopf: '𝕍',
  Vscr: '𝒱',
  Vvdash: '⊪',
  Wcirc: 'Ŵ',
  Wedge: '⋀',
  Wfr: '𝔚',
  Wopf: '𝕎',
  Wscr: '𝒲',
  Xfr: '𝔛',
  Xi: 'Ξ',
  Xopf: '𝕏',
  Xscr: '𝒳',
  YAcy: 'Я',
  YIcy: 'Ї',
  YUcy: 'Ю',
  Yacute: 'Ý',
  Ycirc: 'Ŷ',
  Ycy: 'Ы',
  Yfr: '𝔜',
  Yopf: '𝕐',
  Yscr: '𝒴',
  Yuml: 'Ÿ',
  ZHcy: 'Ж',
  Zacute: 'Ź',
  Zcaron: 'Ž',
  Zcy: 'З',
  Zdot: 'Ż',
  ZeroWidthSpace: '​',
  Zeta: 'Ζ',
  Zfr: 'ℨ',
  Zopf: 'ℤ',
  Zscr: '𝒵',
  aacute: 'á',
  abreve: 'ă',
  ac: '∾',
  acE: '∾̳',
  acd: '∿',
  acirc: 'â',
  acute: '´',
  acy: 'а',
  aelig: 'æ',
  af: '⁡',
  afr: '𝔞',
  agrave: 'à',
  alefsym: 'ℵ',
  aleph: 'ℵ',
  alpha: 'α',
  amacr: 'ā',
  amalg: '⨿',
  amp: '&',
  and: '∧',
  andand: '⩕',
  andd: '⩜',
  andslope: '⩘',
  andv: '⩚',
  ang: '∠',
  ange: '⦤',
  angle: '∠',
  angmsd: '∡',
  angmsdaa: '⦨',
  angmsdab: '⦩',
  angmsdac: '⦪',
  angmsdad: '⦫',
  angmsdae: '⦬',
  angmsdaf: '⦭',
  angmsdag: '⦮',
  angmsdah: '⦯',
  angrt: '∟',
  angrtvb: '⊾',
  angrtvbd: '⦝',
  angsph: '∢',
  angst: 'Å',
  angzarr: '⍼',
  aogon: 'ą',
  aopf: '𝕒',
  ap: '≈',
  apE: '⩰',
  apacir: '⩯',
  ape: '≊',
  apid: '≋',
  apos: "'",
  approx: '≈',
  approxeq: '≊',
  aring: 'å',
  ascr: '𝒶',
  ast: '*',
  asymp: '≈',
  asympeq: '≍',
  atilde: 'ã',
  auml: 'ä',
  awconint: '∳',
  awint: '⨑',
  bNot: '⫭',
  backcong: '≌',
  backepsilon: '϶',
  backprime: '‵',
  backsim: '∽',
  backsimeq: '⋍',
  barvee: '⊽',
  barwed: '⌅',
  barwedge: '⌅',
  bbrk: '⎵',
  bbrktbrk: '⎶',
  bcong: '≌',
  bcy: 'б',
  bdquo: '„',
  becaus: '∵',
  because: '∵',
  bemptyv: '⦰',
  bepsi: '϶',
  bernou: 'ℬ',
  beta: 'β',
  beth: 'ℶ',
  between: '≬',
  bfr: '𝔟',
  bigcap: '⋂',
  bigcirc: '◯',
  bigcup: '⋃',
  bigodot: '⨀',
  bigoplus: '⨁',
  bigotimes: '⨂',
  bigsqcup: '⨆',
  bigstar: '★',
  bigtriangledown: '▽',
  bigtriangleup: '△',
  biguplus: '⨄',
  bigvee: '⋁',
  bigwedge: '⋀',
  bkarow: '⤍',
  blacklozenge: '⧫',
  blacksquare: '▪',
  blacktriangle: '▴',
  blacktriangledown: '▾',
  blacktriangleleft: '◂',
  blacktriangleright: '▸',
  blank: '␣',
  blk12: '▒',
  blk14: '░',
  blk34: '▓',
  block: '█',
  bne: '=⃥',
  bnequiv: '≡⃥',
  bnot: '⌐',
  bopf: '𝕓',
  bot: '⊥',
  bottom: '⊥',
  bowtie: '⋈',
  boxDL: '╗',
  boxDR: '╔',
  boxDl: '╖',
  boxDr: '╓',
  boxH: '═',
  boxHD: '╦',
  boxHU: '╩',
  boxHd: '╤',
  boxHu: '╧',
  boxUL: '╝',
  boxUR: '╚',
  boxUl: '╜',
  boxUr: '╙',
  boxV: '║',
  boxVH: '╬',
  boxVL: '╣',
  boxVR: '╠',
  boxVh: '╫',
  boxVl: '╢',
  boxVr: '╟',
  boxbox: '⧉',
  boxdL: '╕',
  boxdR: '╒',
  boxdl: '┐',
  boxdr: '┌',
  boxh: '─',
  boxhD: '╥',
  boxhU: '╨',
  boxhd: '┬',
  boxhu: '┴',
  boxminus: '⊟',
  boxplus: '⊞',
  boxtimes: '⊠',
  boxuL: '╛',
  boxuR: '╘',
  boxul: '┘',
  boxur: '└',
  boxv: '│',
  boxvH: '╪',
  boxvL: '╡',
  boxvR: '╞',
  boxvh: '┼',
  boxvl: '┤',
  boxvr: '├',
  bprime: '‵',
  breve: '˘',
  brvbar: '¦',
  bscr: '𝒷',
  bsemi: '⁏',
  bsim: '∽',
  bsime: '⋍',
  bsol: '\\',
  bsolb: '⧅',
  bsolhsub: '⟈',
  bull: '•',
  bullet: '•',
  bump: '≎',
  bumpE: '⪮',
  bumpe: '≏',
  bumpeq: '≏',
  cacute: 'ć',
  cap: '∩',
  capand: '⩄',
  capbrcup: '⩉',
  capcap: '⩋',
  capcup: '⩇',
  capdot: '⩀',
  caps: '∩︀',
  caret: '⁁',
  caron: 'ˇ',
  ccaps: '⩍',
  ccaron: 'č',
  ccedil: 'ç',
  ccirc: 'ĉ',
  ccups: '⩌',
  ccupssm: '⩐',
  cdot: 'ċ',
  cedil: '¸',
  cemptyv: '⦲',
  cent: '¢',
  centerdot: '·',
  cfr: '𝔠',
  chcy: 'ч',
  check: '✓',
  checkmark: '✓',
  chi: 'χ',
  cir: '○',
  cirE: '⧃',
  circ: 'ˆ',
  circeq: '≗',
  circlearrowleft: '↺',
  circlearrowright: '↻',
  circledR: '®',
  circledS: 'Ⓢ',
  circledast: '⊛',
  circledcirc: '⊚',
  circleddash: '⊝',
  cire: '≗',
  cirfnint: '⨐',
  cirmid: '⫯',
  cirscir: '⧂',
  clubs: '♣',
  clubsuit: '♣',
  colon: ':',
  colone: '≔',
  coloneq: '≔',
  comma: ',',
  commat: '@',
  comp: '∁',
  compfn: '∘',
  complement: '∁',
  complexes: 'ℂ',
  cong: '≅',
  congdot: '⩭',
  conint: '∮',
  copf: '𝕔',
  coprod: '∐',
  copy: '©',
  copysr: '℗',
  crarr: '↵',
  cross: '✗',
  cscr: '𝒸',
  csub: '⫏',
  csube: '⫑',
  csup: '⫐',
  csupe: '⫒',
  ctdot: '⋯',
  cudarrl: '⤸',
  cudarrr: '⤵',
  cuepr: '⋞',
  cuesc: '⋟',
  cularr: '↶',
  cularrp: '⤽',
  cup: '∪',
  cupbrcap: '⩈',
  cupcap: '⩆',
  cupcup: '⩊',
  cupdot: '⊍',
  cupor: '⩅',
  cups: '∪︀',
  curarr: '↷',
  curarrm: '⤼',
  curlyeqprec: '⋞',
  curlyeqsucc: '⋟',
  curlyvee: '⋎',
  curlywedge: '⋏',
  curren: '¤',
  curvearrowleft: '↶',
  curvearrowright: '↷',
  cuvee: '⋎',
  cuwed: '⋏',
  cwconint: '∲',
  cwint: '∱',
  cylcty: '⌭',
  dArr: '⇓',
  dHar: '⥥',
  dagger: '†',
  daleth: 'ℸ',
  darr: '↓',
  dash: '‐',
  dashv: '⊣',
  dbkarow: '⤏',
  dblac: '˝',
  dcaron: 'ď',
  dcy: 'д',
  dd: 'ⅆ',
  ddagger: '‡',
  ddarr: '⇊',
  ddotseq: '⩷',
  deg: '°',
  delta: 'δ',
  demptyv: '⦱',
  dfisht: '⥿',
  dfr: '𝔡',
  dharl: '⇃',
  dharr: '⇂',
  diam: '⋄',
  diamond: '⋄',
  diamondsuit: '♦',
  diams: '♦',
  die: '¨',
  digamma: 'ϝ',
  disin: '⋲',
  div: '÷',
  divide: '÷',
  divideontimes: '⋇',
  divonx: '⋇',
  djcy: 'ђ',
  dlcorn: '⌞',
  dlcrop: '⌍',
  dollar: '$',
  dopf: '𝕕',
  dot: '˙',
  doteq: '≐',
  doteqdot: '≑',
  dotminus: '∸',
  dotplus: '∔',
  dotsquare: '⊡',
  doublebarwedge: '⌆',
  downarrow: '↓',
  downdownarrows: '⇊',
  downharpoonleft: '⇃',
  downharpoonright: '⇂',
  drbkarow: '⤐',
  drcorn: '⌟',
  drcrop: '⌌',
  dscr: '𝒹',
  dscy: 'ѕ',
  dsol: '⧶',
  dstrok: 'đ',
  dtdot: '⋱',
  dtri: '▿',
  dtrif: '▾',
  duarr: '⇵',
  duhar: '⥯',
  dwangle: '⦦',
  dzcy: 'џ',
  dzigrarr: '⟿',
  eDDot: '⩷',
  eDot: '≑',
  eacute: 'é',
  easter: '⩮',
  ecaron: 'ě',
  ecir: '≖',
  ecirc: 'ê',
  ecolon: '≕',
  ecy: 'э',
  edot: 'ė',
  ee: 'ⅇ',
  efDot: '≒',
  efr: '𝔢',
  eg: '⪚',
  egrave: 'è',
  egs: '⪖',
  egsdot: '⪘',
  el: '⪙',
  elinters: '⏧',
  ell: 'ℓ',
  els: '⪕',
  elsdot: '⪗',
  emacr: 'ē',
  empty: '∅',
  emptyset: '∅',
  emptyv: '∅',
  emsp13: ' ',
  emsp14: ' ',
  emsp: ' ',
  eng: 'ŋ',
  ensp: ' ',
  eogon: 'ę',
  eopf: '𝕖',
  epar: '⋕',
  eparsl: '⧣',
  eplus: '⩱',
  epsi: 'ε',
  epsilon: 'ε',
  epsiv: 'ϵ',
  eqcirc: '≖',
  eqcolon: '≕',
  eqsim: '≂',
  eqslantgtr: '⪖',
  eqslantless: '⪕',
  equals: '=',
  equest: '≟',
  equiv: '≡',
  equivDD: '⩸',
  eqvparsl: '⧥',
  erDot: '≓',
  erarr: '⥱',
  escr: 'ℯ',
  esdot: '≐',
  esim: '≂',
  eta: 'η',
  eth: 'ð',
  euml: 'ë',
  euro: '€',
  excl: '!',
  exist: '∃',
  expectation: 'ℰ',
  exponentiale: 'ⅇ',
  fallingdotseq: '≒',
  fcy: 'ф',
  female: '♀',
  ffilig: 'ﬃ',
  fflig: 'ﬀ',
  ffllig: 'ﬄ',
  ffr: '𝔣',
  filig: 'ﬁ',
  fjlig: 'fj',
  flat: '♭',
  fllig: 'ﬂ',
  fltns: '▱',
  fnof: 'ƒ',
  fopf: '𝕗',
  forall: '∀',
  fork: '⋔',
  forkv: '⫙',
  fpartint: '⨍',
  frac12: '½',
  frac13: '⅓',
  frac14: '¼',
  frac15: '⅕',
  frac16: '⅙',
  frac18: '⅛',
  frac23: '⅔',
  frac25: '⅖',
  frac34: '¾',
  frac35: '⅗',
  frac38: '⅜',
  frac45: '⅘',
  frac56: '⅚',
  frac58: '⅝',
  frac78: '⅞',
  frasl: '⁄',
  frown: '⌢',
  fscr: '𝒻',
  gE: '≧',
  gEl: '⪌',
  gacute: 'ǵ',
  gamma: 'γ',
  gammad: 'ϝ',
  gap: '⪆',
  gbreve: 'ğ',
  gcirc: 'ĝ',
  gcy: 'г',
  gdot: 'ġ',
  ge: '≥',
  gel: '⋛',
  geq: '≥',
  geqq: '≧',
  geqslant: '⩾',
  ges: '⩾',
  gescc: '⪩',
  gesdot: '⪀',
  gesdoto: '⪂',
  gesdotol: '⪄',
  gesl: '⋛︀',
  gesles: '⪔',
  gfr: '𝔤',
  gg: '≫',
  ggg: '⋙',
  gimel: 'ℷ',
  gjcy: 'ѓ',
  gl: '≷',
  glE: '⪒',
  gla: '⪥',
  glj: '⪤',
  gnE: '≩',
  gnap: '⪊',
  gnapprox: '⪊',
  gne: '⪈',
  gneq: '⪈',
  gneqq: '≩',
  gnsim: '⋧',
  gopf: '𝕘',
  grave: '`',
  gscr: 'ℊ',
  gsim: '≳',
  gsime: '⪎',
  gsiml: '⪐',
  gt: '>',
  gtcc: '⪧',
  gtcir: '⩺',
  gtdot: '⋗',
  gtlPar: '⦕',
  gtquest: '⩼',
  gtrapprox: '⪆',
  gtrarr: '⥸',
  gtrdot: '⋗',
  gtreqless: '⋛',
  gtreqqless: '⪌',
  gtrless: '≷',
  gtrsim: '≳',
  gvertneqq: '≩︀',
  gvnE: '≩︀',
  hArr: '⇔',
  hairsp: ' ',
  half: '½',
  hamilt: 'ℋ',
  hardcy: 'ъ',
  harr: '↔',
  harrcir: '⥈',
  harrw: '↭',
  hbar: 'ℏ',
  hcirc: 'ĥ',
  hearts: '♥',
  heartsuit: '♥',
  hellip: '…',
  hercon: '⊹',
  hfr: '𝔥',
  hksearow: '⤥',
  hkswarow: '⤦',
  hoarr: '⇿',
  homtht: '∻',
  hookleftarrow: '↩',
  hookrightarrow: '↪',
  hopf: '𝕙',
  horbar: '―',
  hscr: '𝒽',
  hslash: 'ℏ',
  hstrok: 'ħ',
  hybull: '⁃',
  hyphen: '‐',
  iacute: 'í',
  ic: '⁣',
  icirc: 'î',
  icy: 'и',
  iecy: 'е',
  iexcl: '¡',
  iff: '⇔',
  ifr: '𝔦',
  igrave: 'ì',
  ii: 'ⅈ',
  iiiint: '⨌',
  iiint: '∭',
  iinfin: '⧜',
  iiota: '℩',
  ijlig: 'ĳ',
  imacr: 'ī',
  image: 'ℑ',
  imagline: 'ℐ',
  imagpart: 'ℑ',
  imath: 'ı',
  imof: '⊷',
  imped: 'Ƶ',
  in: '∈',
  incare: '℅',
  infin: '∞',
  infintie: '⧝',
  inodot: 'ı',
  int: '∫',
  intcal: '⊺',
  integers: 'ℤ',
  intercal: '⊺',
  intlarhk: '⨗',
  intprod: '⨼',
  iocy: 'ё',
  iogon: 'į',
  iopf: '𝕚',
  iota: 'ι',
  iprod: '⨼',
  iquest: '¿',
  iscr: '𝒾',
  isin: '∈',
  isinE: '⋹',
  isindot: '⋵',
  isins: '⋴',
  isinsv: '⋳',
  isinv: '∈',
  it: '⁢',
  itilde: 'ĩ',
  iukcy: 'і',
  iuml: 'ï',
  jcirc: 'ĵ',
  jcy: 'й',
  jfr: '𝔧',
  jmath: 'ȷ',
  jopf: '𝕛',
  jscr: '𝒿',
  jsercy: 'ј',
  jukcy: 'є',
  kappa: 'κ',
  kappav: 'ϰ',
  kcedil: 'ķ',
  kcy: 'к',
  kfr: '𝔨',
  kgreen: 'ĸ',
  khcy: 'х',
  kjcy: 'ќ',
  kopf: '𝕜',
  kscr: '𝓀',
  lAarr: '⇚',
  lArr: '⇐',
  lAtail: '⤛',
  lBarr: '⤎',
  lE: '≦',
  lEg: '⪋',
  lHar: '⥢',
  lacute: 'ĺ',
  laemptyv: '⦴',
  lagran: 'ℒ',
  lambda: 'λ',
  lang: '⟨',
  langd: '⦑',
  langle: '⟨',
  lap: '⪅',
  laquo: '«',
  larr: '←',
  larrb: '⇤',
  larrbfs: '⤟',
  larrfs: '⤝',
  larrhk: '↩',
  larrlp: '↫',
  larrpl: '⤹',
  larrsim: '⥳',
  larrtl: '↢',
  lat: '⪫',
  latail: '⤙',
  late: '⪭',
  lates: '⪭︀',
  lbarr: '⤌',
  lbbrk: '❲',
  lbrace: '{',
  lbrack: '[',
  lbrke: '⦋',
  lbrksld: '⦏',
  lbrkslu: '⦍',
  lcaron: 'ľ',
  lcedil: 'ļ',
  lceil: '⌈',
  lcub: '{',
  lcy: 'л',
  ldca: '⤶',
  ldquo: '“',
  ldquor: '„',
  ldrdhar: '⥧',
  ldrushar: '⥋',
  ldsh: '↲',
  le: '≤',
  leftarrow: '←',
  leftarrowtail: '↢',
  leftharpoondown: '↽',
  leftharpoonup: '↼',
  leftleftarrows: '⇇',
  leftrightarrow: '↔',
  leftrightarrows: '⇆',
  leftrightharpoons: '⇋',
  leftrightsquigarrow: '↭',
  leftthreetimes: '⋋',
  leg: '⋚',
  leq: '≤',
  leqq: '≦',
  leqslant: '⩽',
  les: '⩽',
  lescc: '⪨',
  lesdot: '⩿',
  lesdoto: '⪁',
  lesdotor: '⪃',
  lesg: '⋚︀',
  lesges: '⪓',
  lessapprox: '⪅',
  lessdot: '⋖',
  lesseqgtr: '⋚',
  lesseqqgtr: '⪋',
  lessgtr: '≶',
  lesssim: '≲',
  lfisht: '⥼',
  lfloor: '⌊',
  lfr: '𝔩',
  lg: '≶',
  lgE: '⪑',
  lhard: '↽',
  lharu: '↼',
  lharul: '⥪',
  lhblk: '▄',
  ljcy: 'љ',
  ll: '≪',
  llarr: '⇇',
  llcorner: '⌞',
  llhard: '⥫',
  lltri: '◺',
  lmidot: 'ŀ',
  lmoust: '⎰',
  lmoustache: '⎰',
  lnE: '≨',
  lnap: '⪉',
  lnapprox: '⪉',
  lne: '⪇',
  lneq: '⪇',
  lneqq: '≨',
  lnsim: '⋦',
  loang: '⟬',
  loarr: '⇽',
  lobrk: '⟦',
  longleftarrow: '⟵',
  longleftrightarrow: '⟷',
  longmapsto: '⟼',
  longrightarrow: '⟶',
  looparrowleft: '↫',
  looparrowright: '↬',
  lopar: '⦅',
  lopf: '𝕝',
  loplus: '⨭',
  lotimes: '⨴',
  lowast: '∗',
  lowbar: '_',
  loz: '◊',
  lozenge: '◊',
  lozf: '⧫',
  lpar: '(',
  lparlt: '⦓',
  lrarr: '⇆',
  lrcorner: '⌟',
  lrhar: '⇋',
  lrhard: '⥭',
  lrm: '‎',
  lrtri: '⊿',
  lsaquo: '‹',
  lscr: '𝓁',
  lsh: '↰',
  lsim: '≲',
  lsime: '⪍',
  lsimg: '⪏',
  lsqb: '[',
  lsquo: '‘',
  lsquor: '‚',
  lstrok: 'ł',
  lt: '<',
  ltcc: '⪦',
  ltcir: '⩹',
  ltdot: '⋖',
  lthree: '⋋',
  ltimes: '⋉',
  ltlarr: '⥶',
  ltquest: '⩻',
  ltrPar: '⦖',
  ltri: '◃',
  ltrie: '⊴',
  ltrif: '◂',
  lurdshar: '⥊',
  luruhar: '⥦',
  lvertneqq: '≨︀',
  lvnE: '≨︀',
  mDDot: '∺',
  macr: '¯',
  male: '♂',
  malt: '✠',
  maltese: '✠',
  map: '↦',
  mapsto: '↦',
  mapstodown: '↧',
  mapstoleft: '↤',
  mapstoup: '↥',
  marker: '▮',
  mcomma: '⨩',
  mcy: 'м',
  mdash: '—',
  measuredangle: '∡',
  mfr: '𝔪',
  mho: '℧',
  micro: 'µ',
  mid: '∣',
  midast: '*',
  midcir: '⫰',
  middot: '·',
  minus: '−',
  minusb: '⊟',
  minusd: '∸',
  minusdu: '⨪',
  mlcp: '⫛',
  mldr: '…',
  mnplus: '∓',
  models: '⊧',
  mopf: '𝕞',
  mp: '∓',
  mscr: '𝓂',
  mstpos: '∾',
  mu: 'μ',
  multimap: '⊸',
  mumap: '⊸',
  nGg: '⋙̸',
  nGt: '≫⃒',
  nGtv: '≫̸',
  nLeftarrow: '⇍',
  nLeftrightarrow: '⇎',
  nLl: '⋘̸',
  nLt: '≪⃒',
  nLtv: '≪̸',
  nRightarrow: '⇏',
  nVDash: '⊯',
  nVdash: '⊮',
  nabla: '∇',
  nacute: 'ń',
  nang: '∠⃒',
  nap: '≉',
  napE: '⩰̸',
  napid: '≋̸',
  napos: 'ŉ',
  napprox: '≉',
  natur: '♮',
  natural: '♮',
  naturals: 'ℕ',
  nbsp: ' ',
  nbump: '≎̸',
  nbumpe: '≏̸',
  ncap: '⩃',
  ncaron: 'ň',
  ncedil: 'ņ',
  ncong: '≇',
  ncongdot: '⩭̸',
  ncup: '⩂',
  ncy: 'н',
  ndash: '–',
  ne: '≠',
  neArr: '⇗',
  nearhk: '⤤',
  nearr: '↗',
  nearrow: '↗',
  nedot: '≐̸',
  nequiv: '≢',
  nesear: '⤨',
  nesim: '≂̸',
  nexist: '∄',
  nexists: '∄',
  nfr: '𝔫',
  ngE: '≧̸',
  nge: '≱',
  ngeq: '≱',
  ngeqq: '≧̸',
  ngeqslant: '⩾̸',
  nges: '⩾̸',
  ngsim: '≵',
  ngt: '≯',
  ngtr: '≯',
  nhArr: '⇎',
  nharr: '↮',
  nhpar: '⫲',
  ni: '∋',
  nis: '⋼',
  nisd: '⋺',
  niv: '∋',
  njcy: 'њ',
  nlArr: '⇍',
  nlE: '≦̸',
  nlarr: '↚',
  nldr: '‥',
  nle: '≰',
  nleftarrow: '↚',
  nleftrightarrow: '↮',
  nleq: '≰',
  nleqq: '≦̸',
  nleqslant: '⩽̸',
  nles: '⩽̸',
  nless: '≮',
  nlsim: '≴',
  nlt: '≮',
  nltri: '⋪',
  nltrie: '⋬',
  nmid: '∤',
  nopf: '𝕟',
  not: '¬',
  notin: '∉',
  notinE: '⋹̸',
  notindot: '⋵̸',
  notinva: '∉',
  notinvb: '⋷',
  notinvc: '⋶',
  notni: '∌',
  notniva: '∌',
  notnivb: '⋾',
  notnivc: '⋽',
  npar: '∦',
  nparallel: '∦',
  nparsl: '⫽⃥',
  npart: '∂̸',
  npolint: '⨔',
  npr: '⊀',
  nprcue: '⋠',
  npre: '⪯̸',
  nprec: '⊀',
  npreceq: '⪯̸',
  nrArr: '⇏',
  nrarr: '↛',
  nrarrc: '⤳̸',
  nrarrw: '↝̸',
  nrightarrow: '↛',
  nrtri: '⋫',
  nrtrie: '⋭',
  nsc: '⊁',
  nsccue: '⋡',
  nsce: '⪰̸',
  nscr: '𝓃',
  nshortmid: '∤',
  nshortparallel: '∦',
  nsim: '≁',
  nsime: '≄',
  nsimeq: '≄',
  nsmid: '∤',
  nspar: '∦',
  nsqsube: '⋢',
  nsqsupe: '⋣',
  nsub: '⊄',
  nsubE: '⫅̸',
  nsube: '⊈',
  nsubset: '⊂⃒',
  nsubseteq: '⊈',
  nsubseteqq: '⫅̸',
  nsucc: '⊁',
  nsucceq: '⪰̸',
  nsup: '⊅',
  nsupE: '⫆̸',
  nsupe: '⊉',
  nsupset: '⊃⃒',
  nsupseteq: '⊉',
  nsupseteqq: '⫆̸',
  ntgl: '≹',
  ntilde: 'ñ',
  ntlg: '≸',
  ntriangleleft: '⋪',
  ntrianglelefteq: '⋬',
  ntriangleright: '⋫',
  ntrianglerighteq: '⋭',
  nu: 'ν',
  num: '#',
  numero: '№',
  numsp: ' ',
  nvDash: '⊭',
  nvHarr: '⤄',
  nvap: '≍⃒',
  nvdash: '⊬',
  nvge: '≥⃒',
  nvgt: '>⃒',
  nvinfin: '⧞',
  nvlArr: '⤂',
  nvle: '≤⃒',
  nvlt: '<⃒',
  nvltrie: '⊴⃒',
  nvrArr: '⤃',
  nvrtrie: '⊵⃒',
  nvsim: '∼⃒',
  nwArr: '⇖',
  nwarhk: '⤣',
  nwarr: '↖',
  nwarrow: '↖',
  nwnear: '⤧',
  oS: 'Ⓢ',
  oacute: 'ó',
  oast: '⊛',
  ocir: '⊚',
  ocirc: 'ô',
  ocy: 'о',
  odash: '⊝',
  odblac: 'ő',
  odiv: '⨸',
  odot: '⊙',
  odsold: '⦼',
  oelig: 'œ',
  ofcir: '⦿',
  ofr: '𝔬',
  ogon: '˛',
  ograve: 'ò',
  ogt: '⧁',
  ohbar: '⦵',
  ohm: 'Ω',
  oint: '∮',
  olarr: '↺',
  olcir: '⦾',
  olcross: '⦻',
  oline: '‾',
  olt: '⧀',
  omacr: 'ō',
  omega: 'ω',
  omicron: 'ο',
  omid: '⦶',
  ominus: '⊖',
  oopf: '𝕠',
  opar: '⦷',
  operp: '⦹',
  oplus: '⊕',
  or: '∨',
  orarr: '↻',
  ord: '⩝',
  order: 'ℴ',
  orderof: 'ℴ',
  ordf: 'ª',
  ordm: 'º',
  origof: '⊶',
  oror: '⩖',
  orslope: '⩗',
  orv: '⩛',
  oscr: 'ℴ',
  oslash: 'ø',
  osol: '⊘',
  otilde: 'õ',
  otimes: '⊗',
  otimesas: '⨶',
  ouml: 'ö',
  ovbar: '⌽',
  par: '∥',
  para: '¶',
  parallel: '∥',
  parsim: '⫳',
  parsl: '⫽',
  part: '∂',
  pcy: 'п',
  percnt: '%',
  period: '.',
  permil: '‰',
  perp: '⊥',
  pertenk: '‱',
  pfr: '𝔭',
  phi: 'φ',
  phiv: 'ϕ',
  phmmat: 'ℳ',
  phone: '☎',
  pi: 'π',
  pitchfork: '⋔',
  piv: 'ϖ',
  planck: 'ℏ',
  planckh: 'ℎ',
  plankv: 'ℏ',
  plus: '+',
  plusacir: '⨣',
  plusb: '⊞',
  pluscir: '⨢',
  plusdo: '∔',
  plusdu: '⨥',
  pluse: '⩲',
  plusmn: '±',
  plussim: '⨦',
  plustwo: '⨧',
  pm: '±',
  pointint: '⨕',
  popf: '𝕡',
  pound: '£',
  pr: '≺',
  prE: '⪳',
  prap: '⪷',
  prcue: '≼',
  pre: '⪯',
  prec: '≺',
  precapprox: '⪷',
  preccurlyeq: '≼',
  preceq: '⪯',
  precnapprox: '⪹',
  precneqq: '⪵',
  precnsim: '⋨',
  precsim: '≾',
  prime: '′',
  primes: 'ℙ',
  prnE: '⪵',
  prnap: '⪹',
  prnsim: '⋨',
  prod: '∏',
  profalar: '⌮',
  profline: '⌒',
  profsurf: '⌓',
  prop: '∝',
  propto: '∝',
  prsim: '≾',
  prurel: '⊰',
  pscr: '𝓅',
  psi: 'ψ',
  puncsp: ' ',
  qfr: '𝔮',
  qint: '⨌',
  qopf: '𝕢',
  qprime: '⁗',
  qscr: '𝓆',
  quaternions: 'ℍ',
  quatint: '⨖',
  quest: '?',
  questeq: '≟',
  quot: '"',
  rAarr: '⇛',
  rArr: '⇒',
  rAtail: '⤜',
  rBarr: '⤏',
  rHar: '⥤',
  race: '∽̱',
  racute: 'ŕ',
  radic: '√',
  raemptyv: '⦳',
  rang: '⟩',
  rangd: '⦒',
  range: '⦥',
  rangle: '⟩',
  raquo: '»',
  rarr: '→',
  rarrap: '⥵',
  rarrb: '⇥',
  rarrbfs: '⤠',
  rarrc: '⤳',
  rarrfs: '⤞',
  rarrhk: '↪',
  rarrlp: '↬',
  rarrpl: '⥅',
  rarrsim: '⥴',
  rarrtl: '↣',
  rarrw: '↝',
  ratail: '⤚',
  ratio: '∶',
  rationals: 'ℚ',
  rbarr: '⤍',
  rbbrk: '❳',
  rbrace: '}',
  rbrack: ']',
  rbrke: '⦌',
  rbrksld: '⦎',
  rbrkslu: '⦐',
  rcaron: 'ř',
  rcedil: 'ŗ',
  rceil: '⌉',
  rcub: '}',
  rcy: 'р',
  rdca: '⤷',
  rdldhar: '⥩',
  rdquo: '”',
  rdquor: '”',
  rdsh: '↳',
  real: 'ℜ',
  realine: 'ℛ',
  realpart: 'ℜ',
  reals: 'ℝ',
  rect: '▭',
  reg: '®',
  rfisht: '⥽',
  rfloor: '⌋',
  rfr: '𝔯',
  rhard: '⇁',
  rharu: '⇀',
  rharul: '⥬',
  rho: 'ρ',
  rhov: 'ϱ',
  rightarrow: '→',
  rightarrowtail: '↣',
  rightharpoondown: '⇁',
  rightharpoonup: '⇀',
  rightleftarrows: '⇄',
  rightleftharpoons: '⇌',
  rightrightarrows: '⇉',
  rightsquigarrow: '↝',
  rightthreetimes: '⋌',
  ring: '˚',
  risingdotseq: '≓',
  rlarr: '⇄',
  rlhar: '⇌',
  rlm: '‏',
  rmoust: '⎱',
  rmoustache: '⎱',
  rnmid: '⫮',
  roang: '⟭',
  roarr: '⇾',
  robrk: '⟧',
  ropar: '⦆',
  ropf: '𝕣',
  roplus: '⨮',
  rotimes: '⨵',
  rpar: ')',
  rpargt: '⦔',
  rppolint: '⨒',
  rrarr: '⇉',
  rsaquo: '›',
  rscr: '𝓇',
  rsh: '↱',
  rsqb: ']',
  rsquo: '’',
  rsquor: '’',
  rthree: '⋌',
  rtimes: '⋊',
  rtri: '▹',
  rtrie: '⊵',
  rtrif: '▸',
  rtriltri: '⧎',
  ruluhar: '⥨',
  rx: '℞',
  sacute: 'ś',
  sbquo: '‚',
  sc: '≻',
  scE: '⪴',
  scap: '⪸',
  scaron: 'š',
  sccue: '≽',
  sce: '⪰',
  scedil: 'ş',
  scirc: 'ŝ',
  scnE: '⪶',
  scnap: '⪺',
  scnsim: '⋩',
  scpolint: '⨓',
  scsim: '≿',
  scy: 'с',
  sdot: '⋅',
  sdotb: '⊡',
  sdote: '⩦',
  seArr: '⇘',
  searhk: '⤥',
  searr: '↘',
  searrow: '↘',
  sect: '§',
  semi: ';',
  seswar: '⤩',
  setminus: '∖',
  setmn: '∖',
  sext: '✶',
  sfr: '𝔰',
  sfrown: '⌢',
  sharp: '♯',
  shchcy: 'щ',
  shcy: 'ш',
  shortmid: '∣',
  shortparallel: '∥',
  shy: '­',
  sigma: 'σ',
  sigmaf: 'ς',
  sigmav: 'ς',
  sim: '∼',
  simdot: '⩪',
  sime: '≃',
  simeq: '≃',
  simg: '⪞',
  simgE: '⪠',
  siml: '⪝',
  simlE: '⪟',
  simne: '≆',
  simplus: '⨤',
  simrarr: '⥲',
  slarr: '←',
  smallsetminus: '∖',
  smashp: '⨳',
  smeparsl: '⧤',
  smid: '∣',
  smile: '⌣',
  smt: '⪪',
  smte: '⪬',
  smtes: '⪬︀',
  softcy: 'ь',
  sol: '/',
  solb: '⧄',
  solbar: '⌿',
  sopf: '𝕤',
  spades: '♠',
  spadesuit: '♠',
  spar: '∥',
  sqcap: '⊓',
  sqcaps: '⊓︀',
  sqcup: '⊔',
  sqcups: '⊔︀',
  sqsub: '⊏',
  sqsube: '⊑',
  sqsubset: '⊏',
  sqsubseteq: '⊑',
  sqsup: '⊐',
  sqsupe: '⊒',
  sqsupset: '⊐',
  sqsupseteq: '⊒',
  squ: '□',
  square: '□',
  squarf: '▪',
  squf: '▪',
  srarr: '→',
  sscr: '𝓈',
  ssetmn: '∖',
  ssmile: '⌣',
  sstarf: '⋆',
  star: '☆',
  starf: '★',
  straightepsilon: 'ϵ',
  straightphi: 'ϕ',
  strns: '¯',
  sub: '⊂',
  subE: '⫅',
  subdot: '⪽',
  sube: '⊆',
  subedot: '⫃',
  submult: '⫁',
  subnE: '⫋',
  subne: '⊊',
  subplus: '⪿',
  subrarr: '⥹',
  subset: '⊂',
  subseteq: '⊆',
  subseteqq: '⫅',
  subsetneq: '⊊',
  subsetneqq: '⫋',
  subsim: '⫇',
  subsub: '⫕',
  subsup: '⫓',
  succ: '≻',
  succapprox: '⪸',
  succcurlyeq: '≽',
  succeq: '⪰',
  succnapprox: '⪺',
  succneqq: '⪶',
  succnsim: '⋩',
  succsim: '≿',
  sum: '∑',
  sung: '♪',
  sup1: '¹',
  sup2: '²',
  sup3: '³',
  sup: '⊃',
  supE: '⫆',
  supdot: '⪾',
  supdsub: '⫘',
  supe: '⊇',
  supedot: '⫄',
  suphsol: '⟉',
  suphsub: '⫗',
  suplarr: '⥻',
  supmult: '⫂',
  supnE: '⫌',
  supne: '⊋',
  supplus: '⫀',
  supset: '⊃',
  supseteq: '⊇',
  supseteqq: '⫆',
  supsetneq: '⊋',
  supsetneqq: '⫌',
  supsim: '⫈',
  supsub: '⫔',
  supsup: '⫖',
  swArr: '⇙',
  swarhk: '⤦',
  swarr: '↙',
  swarrow: '↙',
  swnwar: '⤪',
  szlig: 'ß',
  target: '⌖',
  tau: 'τ',
  tbrk: '⎴',
  tcaron: 'ť',
  tcedil: 'ţ',
  tcy: 'т',
  tdot: '⃛',
  telrec: '⌕',
  tfr: '𝔱',
  there4: '∴',
  therefore: '∴',
  theta: 'θ',
  thetasym: 'ϑ',
  thetav: 'ϑ',
  thickapprox: '≈',
  thicksim: '∼',
  thinsp: ' ',
  thkap: '≈',
  thksim: '∼',
  thorn: 'þ',
  tilde: '˜',
  times: '×',
  timesb: '⊠',
  timesbar: '⨱',
  timesd: '⨰',
  tint: '∭',
  toea: '⤨',
  top: '⊤',
  topbot: '⌶',
  topcir: '⫱',
  topf: '𝕥',
  topfork: '⫚',
  tosa: '⤩',
  tprime: '‴',
  trade: '™',
  triangle: '▵',
  triangledown: '▿',
  triangleleft: '◃',
  trianglelefteq: '⊴',
  triangleq: '≜',
  triangleright: '▹',
  trianglerighteq: '⊵',
  tridot: '◬',
  trie: '≜',
  triminus: '⨺',
  triplus: '⨹',
  trisb: '⧍',
  tritime: '⨻',
  trpezium: '⏢',
  tscr: '𝓉',
  tscy: 'ц',
  tshcy: 'ћ',
  tstrok: 'ŧ',
  twixt: '≬',
  twoheadleftarrow: '↞',
  twoheadrightarrow: '↠',
  uArr: '⇑',
  uHar: '⥣',
  uacute: 'ú',
  uarr: '↑',
  ubrcy: 'ў',
  ubreve: 'ŭ',
  ucirc: 'û',
  ucy: 'у',
  udarr: '⇅',
  udblac: 'ű',
  udhar: '⥮',
  ufisht: '⥾',
  ufr: '𝔲',
  ugrave: 'ù',
  uharl: '↿',
  uharr: '↾',
  uhblk: '▀',
  ulcorn: '⌜',
  ulcorner: '⌜',
  ulcrop: '⌏',
  ultri: '◸',
  umacr: 'ū',
  uml: '¨',
  uogon: 'ų',
  uopf: '𝕦',
  uparrow: '↑',
  updownarrow: '↕',
  upharpoonleft: '↿',
  upharpoonright: '↾',
  uplus: '⊎',
  upsi: 'υ',
  upsih: 'ϒ',
  upsilon: 'υ',
  upuparrows: '⇈',
  urcorn: '⌝',
  urcorner: '⌝',
  urcrop: '⌎',
  uring: 'ů',
  urtri: '◹',
  uscr: '𝓊',
  utdot: '⋰',
  utilde: 'ũ',
  utri: '▵',
  utrif: '▴',
  uuarr: '⇈',
  uuml: 'ü',
  uwangle: '⦧',
  vArr: '⇕',
  vBar: '⫨',
  vBarv: '⫩',
  vDash: '⊨',
  vangrt: '⦜',
  varepsilon: 'ϵ',
  varkappa: 'ϰ',
  varnothing: '∅',
  varphi: 'ϕ',
  varpi: 'ϖ',
  varpropto: '∝',
  varr: '↕',
  varrho: 'ϱ',
  varsigma: 'ς',
  varsubsetneq: '⊊︀',
  varsubsetneqq: '⫋︀',
  varsupsetneq: '⊋︀',
  varsupsetneqq: '⫌︀',
  vartheta: 'ϑ',
  vartriangleleft: '⊲',
  vartriangleright: '⊳',
  vcy: 'в',
  vdash: '⊢',
  vee: '∨',
  veebar: '⊻',
  veeeq: '≚',
  vellip: '⋮',
  verbar: '|',
  vert: '|',
  vfr: '𝔳',
  vltri: '⊲',
  vnsub: '⊂⃒',
  vnsup: '⊃⃒',
  vopf: '𝕧',
  vprop: '∝',
  vrtri: '⊳',
  vscr: '𝓋',
  vsubnE: '⫋︀',
  vsubne: '⊊︀',
  vsupnE: '⫌︀',
  vsupne: '⊋︀',
  vzigzag: '⦚',
  wcirc: 'ŵ',
  wedbar: '⩟',
  wedge: '∧',
  wedgeq: '≙',
  weierp: '℘',
  wfr: '𝔴',
  wopf: '𝕨',
  wp: '℘',
  wr: '≀',
  wreath: '≀',
  wscr: '𝓌',
  xcap: '⋂',
  xcirc: '◯',
  xcup: '⋃',
  xdtri: '▽',
  xfr: '𝔵',
  xhArr: '⟺',
  xharr: '⟷',
  xi: 'ξ',
  xlArr: '⟸',
  xlarr: '⟵',
  xmap: '⟼',
  xnis: '⋻',
  xodot: '⨀',
  xopf: '𝕩',
  xoplus: '⨁',
  xotime: '⨂',
  xrArr: '⟹',
  xrarr: '⟶',
  xscr: '𝓍',
  xsqcup: '⨆',
  xuplus: '⨄',
  xutri: '△',
  xvee: '⋁',
  xwedge: '⋀',
  yacute: 'ý',
  yacy: 'я',
  ycirc: 'ŷ',
  ycy: 'ы',
  yen: '¥',
  yfr: '𝔶',
  yicy: 'ї',
  yopf: '𝕪',
  yscr: '𝓎',
  yucy: 'ю',
  yuml: 'ÿ',
  zacute: 'ź',
  zcaron: 'ž',
  zcy: 'з',
  zdot: 'ż',
  zeetrf: 'ℨ',
  zeta: 'ζ',
  zfr: '𝔷',
  zhcy: 'ж',
  zigrarr: '⇝',
  zopf: '𝕫',
  zscr: '𝓏',
  zwj: '‍',
  zwnj: '‌'
}
m<x	a{
  "name": "micromark-extension-frontmatter",
  "version": "2.0.0",
  "description": "micromark extension to support frontmatter (YAML, TOML, etc)",
  "license": "MIT",
  "keywords": [
    "micromark",
    "micromark-extension",
    "frontmatter",
    "yaml",
    "toml",
    "gfm",
    "markdown",
    "unified"
  ],
  "repository": "micromark/micromark-extension-frontmatter",
  "bugs": "https://github.com/micromark/micromark-extension-frontmatter/issues",
  "funding": {
    "type": "opencollective",
    "url": "https://opencollective.com/unified"
  },
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "sideEffects": false,
  "type": "module",
  "files": [
    "dev/",
    "lib/",
    "index.d.ts",
    "index.js"
  ],
  "exports": {
    "development": "./dev/index.js",
    "default": "./index.js"
  },
  "dependencies": {
    "fault": "^2.0.0",
    "micromark-util-character": "^2.0.0",
    "micromark-util-symbol": "^2.0.0",
    "micromark-util-types": "^2.0.0"
  },
  "devDependencies": {
    "@types/node": "^20.0.0",
    "c8": "^8.0.0",
    "micromark": "^4.0.0",
    "micromark-build": "^2.0.0",
    "prettier": "^2.0.0",
    "remark-cli": "^11.0.0",
    "remark-preset-wooorm": "^9.0.0",
    "type-coverage": "^2.0.0",
    "typescript": "^5.0.0",
    "xo": "^0.54.0"
  },
  "scripts": {
    "prepack": "npm run build && npm run format",
    "build": "tsc --build --clean && tsc --build && type-coverage && micromark-build",
    "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
    "test-api-dev": "node --conditions development test/index.js",
    "test-api-prod": "node --conditions production test/index.js",
    "test-api": "npm run test-api-dev && npm run test-api-prod",
    "test-coverage": "c8 --100 --reporter lcov npm run test-api",
    "test": "npm run build && npm run format && npm run test-coverage"
  },
  "prettier": {
    "bracketSpacing": false,
    "semi": false,
    "singleQuote": true,
    "tabWidth": 2,
    "trailingComma": "none",
    "useTabs": false
  },
  "remarkConfig": {
    "plugins": [
      "remark-preset-wooorm"
    ]
  },
  "typeCoverage": {
    "atLeast": 100,
    "detail": true,
    "ignoreCatch": true,
    "strict": true
  },
  "xo": {
    "prettier": true,
    "rules": {
      "unicorn/no-this-assignment": "off",
      "unicorn/prefer-code-point": "off"
    }
  }
}
6,xa{
  "name": "character-entities",
  "version": "2.0.2",
  "description": "Map of named character references",
  "license": "MIThtml",
    "entity",
    "entities",
    "character",
    "reference",
    "name",
    "replacement"
  ],
  "repository": "wooorm/character-entitiesy!wooorm/character-entities&7github",
    "url": "https://github.com/sponsors/wooorm(8main": "index.js",
  "types": "index.d.ts",
  "files": [!*F  tape": "^4.0.0",
    "bail": "^2q7.0.0",
    "concat-stream<02"rimraf": "^3.0.0",
    "tape": "^5:4.0.0",
    "xo": "^0.50p,generate": "node build",
    "prepublishOnlyo#)rimraf \"*.d.ts\" && tsc && type-coverage\s!.js!Gcheck-coverage --branches 100 --functions 100 --lines 100 --statements ?<generate && 5tabWidth": 2,
    "useTabs(0#		$O2[
  }
}
]ùx6# character-entities

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]

Map of named character references.

## Contents

*   [What is this?](#what-is-this)
*   [When should I use this?](#when-should-i-use-this)
*   [Install](#install)
*   [Use](#use)
*   [API](#api)
    *   [characterEntities](#characterentities)
*   [Types](#types)
*   [Compatibility](#compatibility)
*   [Security](#security)
*   [Related](#related)
*   [Contribute](#contribute)
*   [License](#license)

## What is this?

This is a map of named character references in HTML (latest) to the characters
they represent.

## When should I use this?

Maybe when you’re writing an HTML parser or minifier, but otherwise probably
never!
Even then, it might be better to use [`parse-entities`][parse-entities] or
[`stringify-entities`][stringify-entities].

## Install

This package is [ESM only][esm].
In Node.js (version 12.20+, 14.14+, 16.0+, 18.0+), install with [npm][]:

```sh
npm install character-entities
```

In Deno with [`esm.sh`][esmsh]:

```js
import {characterEntities} from 'https://esm.sh/character-entities@2'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {characterEntities} from 'https://esm.sh/character-entities@2?bundle'
</script>
```

## Use

```js
import {characterEntities} from 'character-entities'

console.log(characterEntities.AElig) // => 'Æ'
console.log(characterEntities.aelig) // => 'æ'
console.log(characterEntities.amp) // => '&'
```

## API

This package exports the identifier `characterEntities`.
There is no default export.

### characterEntities

Mapping between (case-sensitive) character entity names to replacements.
See [`html.spec.whatwg.org`][html] for more info.

## Types

This package is fully typed with [TypeScript][].

## Compatibility

This package is at least compatible with all maintained versions of Node.js.
As of now, that is Node.js 12.20+, 14.14+, 16.0+, and 18.0+.
It also works in Deno and modern browsers.

## Security

This package is safe.

## Related

*   [`wooorm/parse-entities`](https://github.com/wooorm/parse-entities)
    — parse (decode) character references
*   [`wooorm/stringify-entities`](https://github.com/wooorm/stringify-entities)
    — serialize (encode) character references
*   [`wooorm/character-entities-html4`](https://github.com/wooorm/character-entities-html4)
    — info on named character references in HTML 4
*   [`character-reference-invalid`](https://github.com/wooorm/character-reference-invalid)
    — info on invalid numeric character references
*   [`character-entities-legacy`](https://github.com/wooorm/character-entities-legacy)
    — info on legacy named character references

## Contribute

Yes please!
See [How to Contribute to Open Source][contribute].

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/wooorm/character-entities/workflows/main/badge.svg

[build]: https://github.com/wooorm/character-entities/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/character-entities.svg

[coverage]: https://codecov.io/github/wooorm/character-entities

[downloads-badge]: https://img.shields.io/npm/dm/character-entities.svg

[downloads]: https://www.npmjs.com/package/character-entities

[size-badge]: https://img.shields.io/bundlephobia/minzip/character-entities.svg

[size]: https://bundlephobia.com/result?p=character-entities

[npm]: https://docs.npmjs.com/cli/install

[esmsh]: https://esm.sh

[license]: license

[author]: https://wooorm.com

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[typescript]: https://www.typescriptlang.org

[contribute]: https://opensource.guide/how-to-contribute/

[parse-entities]: https://github.com/wooorm/parse-entities

[stringify-entities]: https://github.com/wooorm/stringify-entities

[html]: https://html.spec.whatwg.org/multipage/syntax.html#named-character-references
Nx'100644 LICENSE EiQle100644 Readme.md *Pt*m
a-100644 esm.mjs kk͟u9100644 index.js uc zL]P~40000 lib ]MW=(g0ɢ²)^紿100644 package-support.json Np@&>8`1Ӣ<QQ100644 package.json 8K.pa40000 typings ZI&WgWfj#|r'xXI(The MIT License)

Copyright (c) 2011 TJ Holowaychuk <tj@vision-media.ca>= obtaining
e4 files (the
'Software'" restriction, including
% 
-# Q
p *
the following 'AS IS'q_ OF
5 NONINFRINGEMENT.
* HOLDERS BE LIABLE FOR ANY
`" !
TORT OR OTHERWISE, ARISING &
SOFTWARE OR THE USE OR  {eFx4q# Commander.js

[![Build Status](https://github.com/tj/commander.js/workflows/build/badge.svg)](https://github.com/tj/commander.js/actions?query=workflow%3A%22build%22)
[![NPM Version](http://img.shields.io/npm/v/commander.svg?style=flat)](https://www.npmjs.org/package/commander)
[![NPM Downloads](https://img.shields.io/npm/dm/commander.svg?style=flat)](https://npmcharts.com/compare/commander?minimal=true)
[![Install Size](https://packagephobia.now.sh/badge?p=commander)](https://packagephobia.now.sh/result?p=commander)

The complete solution for [node.js](http://nodejs.org) command-line interfaces.

Read this in other languages: English | [简体中文](./Readme_zh-CN.md)

- [Commander.js](#commanderjs)
  - [Installation](#installation)
  - [Declaring _program_ variable](#declaring-program-variable)
  - [Options](#options)
    - [Common option types, boolean and value](#common-option-types-boolean-and-value)
    - [Default option value](#default-option-value)
    - [Other option types, negatable boolean and boolean|value](#other-option-types-negatable-boolean-and-booleanvalue)
    - [Required option](#required-option)
    - [Variadic option](#variadic-option)
    - [Version option](#version-option)
    - [More configuration](#more-configuration)
    - [Custom option processing](#custom-option-processing)
  - [Commands](#commands)
    - [Command-arguments](#command-arguments)
      - [More configuration](#more-configuration-1)
      - [Custom argument processing](#custom-argument-processing)
    - [Action handler](#action-handler)
    - [Stand-alone executable (sub)commands](#stand-alone-executable-subcommands)
    - [Life cycle hooks](#life-cycle-hooks)
  - [Automated help](#automated-help)
    - [Custom help](#custom-help)
    - [Display help after errors](#display-help-after-errors)
    - [Display help from code](#display-help-from-code)
    - [.usage and .name](#usage-and-name)
    - [.helpOption(flags, description)](#helpoptionflags-description)
    - [.addHelpCommand()](#addhelpcommand)
    - [More configuration](#more-configuration-2)
  - [Custom event listeners](#custom-event-listeners)
  - [Bits and pieces](#bits-and-pieces)
    - [.parse() and .parseAsync()](#parse-and-parseasync)
    - [Parsing Configuration](#parsing-configuration)
    - [Legacy options as properties](#legacy-options-as-properties)
    - [TypeScript](#typescript)
    - [createCommand()](#createcommand)
    - [Node options such as `--harmony`](#node-options-such-as---harmony)
    - [Debugging stand-alone executable subcommands](#debugging-stand-alone-executable-subcommands)
    - [Override exit and output handling](#override-exit-and-output-handling)
    - [Additional documentation](#additional-documentation)
  - [Examples](#examples)
  - [Support](#support)
    - [Commander for enterprise](#commander-for-enterprise)

For information about terms used in this document see: [terminology](./docs/terminology.md)

## Installation

```bash
npm install commander
```

## Declaring _program_ variable

Commander exports a global object which is convenient for quick programs.
This is used in the examples in this README for brevity.

```js
const { program } = require('commander');
program.version('0.0.1');
```

For larger programs which may use commander in multiple ways, including unit testing, it is better to create a local Command object to use.

```js
const { Command } = require('commander');
const program = new Command();
program.version('0.0.1');
```

For named imports in ECMAScript modules, import from `commander/esm.mjs`.

```js
// index.mjs
import { Command } from 'commander/esm.mjs';
const program = new Command();
```

And in TypeScript:

```ts
// index.ts
import { Command } from 'commander';
const program = new Command();
```

## Options

Options are defined with the `.option()` method, also serving as documentation for the options. Each option can have a short flag (single character) and a long name, separated by a comma or space or vertical bar ('|').

The parsed options can be accessed by calling `.opts()` on a `Command` object, and are passed to the action handler.
(You can also use `.getOptionValue()` and `.setOptionValue()` to work with a single option value,
and `.getOptionValueSource()` and `.setOptionValueWithSource()` when it matters where the option value came from.)

Multi-word options such as "--template-engine" are camel-cased, becoming `program.opts().templateEngine` etc.

Multiple short flags may optionally be combined in a single argument following the dash: boolean flags, followed by a single option taking a value (possibly followed by the value).
For example `-a -b -p 80` may be written as `-ab -p80` or even `-abp80`.

You can use `--` to indicate the end of the options, and any remaining arguments will be used without being interpreted.

By default options on the command line are not positional, and can be specified before or after other arguments.

### Common option types, boolean and value

The two most used option types are a boolean option, and an option which takes its value
from the following argument (declared with angle brackets like `--expect <value>`). Both are `undefined` unless specified on command line.

Example file: [options-common.js](./examples/options-common.js)

```js
program
  .option('-d, --debug', 'output extra debugging')
  .option('-s, --small', 'small pizza size')
  .option('-p, --pizza-type <type>', 'flavour of pizza');

program.parse(process.argv);

const options = program.opts();
if (options.debug) console.log(options);
console.log('pizza details:');
if (options.small) console.log('- small pizza size');
if (options.pizzaType) console.log(`- ${options.pizzaType}`);
```

```bash
$ pizza-options -p
error: option '-p, --pizza-type <type>' argument missing
$ pizza-options -d -s -p vegetarian
{ debug: true, small: true, pizzaType: 'vegetarian' }
pizza details:
- small pizza size
- vegetarian
$ pizza-options --pizza-type=cheese
pizza details:
- cheese
```

`program.parse(arguments)` processes the arguments, leaving any args not consumed by the program options in the `program.args` array. The parameter is optional and defaults to `process.argv`.

### Default option value

You can specify a default value for an option which takes a value.

Example file: [options-defaults.js](./examples/options-defaults.js)

```js
program
  .option('-c, --cheese <type>', 'add the specified type of cheese', 'blue');

program.parse();

console.log(`cheese: ${program.opts().cheese}`);
```

```bash
$ pizza-options
cheese: blue
$ pizza-options --cheese stilton
cheese: stilton
```

### Other option types, negatable boolean and boolean|value

You can define a boolean option long name with a leading `no-` to set the option value to false when used.
Defined alone this also makes the option true by default.

If you define `--foo` first, adding `--no-foo` does not change the default value from what it would
otherwise be. You can specify a default boolean value for a boolean option and it can be overridden on command line.

Example file: [options-negatable.js](./examples/options-negatable.js)

```js
program
  .option('--no-sauce', 'Remove sauce')
  .option('--cheese <flavour>', 'cheese flavour', 'mozzarella')
  .option('--no-cheese', 'plain with no cheese')
  .parse();

const options = program.opts();
const sauceStr = options.sauce ? 'sauce' : 'no sauce';
const cheeseStr = (options.cheese === false) ? 'no cheese' : `${options.cheese} cheese`;
console.log(`You ordered a pizza with ${sauceStr} and ${cheeseStr}`);
```

```bash
$ pizza-options
You ordered a pizza with sauce and mozzarella cheese
$ pizza-options --sauce
error: unknown option '--sauce'
$ pizza-options --cheese=blue
You ordered a pizza with sauce and blue cheese
$ pizza-options --no-sauce --no-cheese
You ordered a pizza with no sauce and no cheese
```

You can specify an option which may be used as a boolean option but may optionally take an option-argument
(declared with square brackets like `--optional [value]`).

Example file: [options-boolean-or-value.js](./examples/options-boolean-or-value.js)

```js
program
  .option('-c, --cheese [type]', 'Add cheese with optional type');

program.parse(process.argv);

const options = program.opts();
if (options.cheese === undefined) console.log('no cheese');
else if (options.cheese === true) console.log('add cheese');
else console.log(`add cheese type ${options.cheese}`);
```

```bash
$ pizza-options
no cheese
$ pizza-options --cheese
add cheese
$ pizza-options --cheese mozzarella
add cheese type mozzarella
```

For information about possible ambiguous cases, see [options taking varying arguments](./docs/options-taking-varying-arguments.md).

### Required option

You may specify a required (mandatory) option using `.requiredOption`. The option must have a value after parsing, usually specified on the command line, or perhaps from a default value (say from environment). The method is otherwise the same as `.option` in format, taking flags and description, and optional default value or custom processing.

Example file: [options-required.js](./examples/options-required.js)

```js
program
  .requiredOption('-c, --cheese <type>', 'pizza must have cheese');

program.parse();
```

```bash
$ pizza
error: required option '-c, --cheese <type>' not specified
```

### Variadic option

You may make an option variadic by appending `...` to the value placeholder when declaring the option. On the command line you
can then specify multiple option-arguments, and the parsed option value will be an array. The extra arguments
are read until the first argument starting with a dash. The special argument `--` stops option processing entirely. If a value
is specified in the same argument as the option then no further values are read.

Example file: [options-variadic.js](./examples/options-variadic.js)

```js
program
  .option('-n, --number <numbers...>', 'specify numbers')
  .option('-l, --letter [letters...]', 'specify letters');

program.parse();

console.log('Options: ', program.opts());
console.log('Remaining arguments: ', program.args);
```

```bash
$ collect -n 1 2 3 --letter a b c
Options:  { number: [ '1', '2', '3' ], letter: [ 'a', 'b', 'c' ] }
Remaining arguments:  []
$ collect --letter=A -n80 operand
Options:  { number: [ '80' ], letter: [ 'A' ] }
Remaining arguments:  [ 'operand' ]
$ collect --letter -n 1 -n 2 3 -- operand
Options:  { number: [ '1', '2', '3' ], letter: true }
Remaining arguments:  [ 'operand' ]
```

For information about possible ambiguous cases, see [options taking varying arguments](./docs/options-taking-varying-arguments.md).

### Version option

The optional `version` method adds handling for displaying the command version. The default option flags are `-V` and `--version`, and when present the command prints the version number and exits.

```js
program.version('0.0.1');
```

```bash
$ ./examples/pizza -V
0.0.1
```

You may change the flags and description by passing additional parameters to the `version` method, using
the same syntax for flags as the `option` method.

```js
program.version('0.0.1', '-v, --vers', 'output the current version');
```

### More configuration

You can add most options using the `.option()` method, but there are some additional features available
by constructing an `Option` explicitly for less common cases.

Example files: [options-extra.js](./examples/options-extra.js), [options-env.js](./examples/options-env.js)

```js
program
  .addOption(new Option('-s, --secret').hideHelp())
  .addOption(new Option('-t, --timeout <delay>', 'timeout in seconds').default(60, 'one minute'))
  .addOption(new Option('-d, --drink <size>', 'drink size').choices(['small', 'medium', 'large']))
  .addOption(new Option('-p, --port <number>', 'port number').env('PORT'));
```

```bash
$ extra --help
Usage: help [options]

Options:
  -t, --timeout <delay>  timeout in seconds (default: one minute)
  -d, --drink <size>     drink cup size (choices: "small", "medium", "large")
  -p, --port <number>    port number (env: PORT)
  -h, --help             display help for command

$ extra --drink huge
error: option '-d, --drink <size>' argument 'huge' is invalid. Allowed choices are small, medium, large.

$ PORT=80 extra 
Options:  { timeout: 60, port: '80' }
```

### Custom option processing

You may specify a function to do custom processing of option-arguments. The callback function receives two parameters,
the user specified option-argument and the previous value for the option. It returns the new value for the option.

This allows you to coerce the option-argument to the desired type, or accumulate values, or do entirely custom processing.

You can optionally specify the default/starting value for the option after the function parameter.

Example file: [options-custom-processing.js](./examples/options-custom-processing.js)

```js
function myParseInt(value, dummyPrevious) {
  // parseInt takes a string and a radix
  const parsedValue = parseInt(value, 10);
  if (isNaN(parsedValue)) {
    throw new commander.InvalidArgumentError('Not a number.');
  }
  return parsedValue;
}

function increaseVerbosity(dummyValue, previous) {
  return previous + 1;
}

function collect(value, previous) {
  return previous.concat([value]);
}

function commaSeparatedList(value, dummyPrevious) {
  return value.split(',');
}

program
  .option('-f, --float <number>', 'float argument', parseFloat)
  .option('-i, --integer <number>', 'integer argument', myParseInt)
  .option('-v, --verbose', 'verbosity that can be increased', increaseVerbosity, 0)
  .option('-c, --collect <value>', 'repeatable value', collect, [])
  .option('-l, --list <items>', 'comma separated list', commaSeparatedList)
;

program.parse();

const options = program.opts();
if (options.float !== undefined) console.log(`float: ${options.float}`);
if (options.integer !== undefined) console.log(`integer: ${options.integer}`);
if (options.verbose > 0) console.log(`verbosity: ${options.verbose}`);
if (options.collect.length > 0) console.log(options.collect);
if (options.list !== undefined) console.log(options.list);
```

```bash
$ custom -f 1e2
float: 100
$ custom --integer 2
integer: 2
$ custom -v -v -v
verbose: 3
$ custom -c a -c b -c c
[ 'a', 'b', 'c' ]
$ custom --list x,y,z
[ 'x', 'y', 'z' ]
```

## Commands

You can specify (sub)commands using `.command()` or `.addCommand()`. There are two ways these can be implemented: using an action handler attached to the command, or as a stand-alone executable file (described in more detail later). The subcommands may be nested ([example](./examples/nestedCommands.js)).

In the first parameter to `.command()` you specify the command name. You may append the command-arguments after the command name, or specify them separately using `.argument()`. The arguments may be `<required>` or `[optional]`, and the last argument may also be `variadic...`.

You can use `.addCommand()` to add an already configured subcommand to the program.

For example:

```js
// Command implemented using action handler (description is supplied separately to `.command`)
// Returns new command for configuring.
program
  .command('clone <source> [destination]')
  .description('clone a repository into a newly created directory')
  .action((source, destination) => {
    console.log('clone command called');
  });

// Command implemented using stand-alone executable file, indicated by adding description as second parameter to `.command`.
// Returns `this` for adding more commands.
program
  .command('start <service>', 'start named service')
  .command('stop [service]', 'stop named service, or all if no name supplied');

// Command prepared separately.
// Returns `this` for adding more commands.
program
  .addCommand(build.makeBuildCommand());
```

Configuration options can be passed with the call to `.command()` and `.addCommand()`. Specifying `hidden: true` will
remove the command from the generated help output. Specifying `isDefault: true` will run the subcommand if no other
subcommand is specified ([example](./examples/defaultCommand.js)).

### Command-arguments

For subcommands, you can specify the argument syntax in the call to `.command()` (as shown above). This
is the only method usable for subcommands implemented using a stand-alone executable, but for other subcommands
you can instead use the following method.

To configure a command, you can use `.argument()` to specify each expected command-argument.
You supply the argument name and an optional description. The argument may be `<required>` or `[optional]`.
You can specify a default value for an optional command-argument.

Example file: [argument.js](./examples/argument.js)

```js
program
  .version('0.1.0')
  .argument('<username>', 'user to login')
  .argument('[password]', 'password for user, if required', 'no password given')
  .action((username, password) => {
    console.log('username:', username);
    console.log('password:', password);
  });
```

 The last argument of a command can be variadic, and only the last argument.  To make an argument variadic you
 append `...` to the argument name. A variadic argument is passed to the action handler as an array. For example:

```js
program
  .version('0.1.0')
  .command('rmdir')
  .argument('<dirs...>')
  .action(function (dirs) {
    dirs.forEach((dir) => {
      console.log('rmdir %s', dir);
    });
  });
```

There is a convenience method to add multiple arguments at once, but without descriptions:

```js
program
  .arguments('<username> <password>');
```

#### More configuration

There are some additional features available by constructing an `Argument` explicitly for less common cases.

Example file: [arguments-extra.js](./examples/arguments-extra.js)

```js
program
  .addArgument(new commander.Argument('<drink-size>', 'drink cup size').choices(['small', 'medium', 'large']))
  .addArgument(new commander.Argument('[timeout]', 'timeout in seconds').default(60, 'one minute'))
```

#### Custom argument processing

You may specify a function to do custom processing of command-arguments (like for option-arguments).
The callback function receives two parameters, the user specified command-argument and the previous value for the argument.
It returns the new value for the argument.

The processed argument values are passed to the action handler, and saved as `.processedArgs`.

You can optionally specify the default/starting value for the argument after the function parameter.

Example file: [arguments-custom-processing.js](./examples/arguments-custom-processing.js)

```js
program
  .command('add')
  .argument('<first>', 'integer argument', myParseInt)
  .argument('[second]', 'integer argument', myParseInt, 1000)
  .action((first, second) => {
    console.log(`${first} + ${second} = ${first + second}`);
  })
;
```

### Action handler

The action handler gets passed a parameter for each command-argument you declared, and two additional parameters
which are the parsed options and the command object itself.

Example file: [thank.js](./examples/thank.js)

```js
program
  .argument('<name>')
  .option('-t, --title <honorific>', 'title to use before name')
  .option('-d, --debug', 'display some debugging')
  .action((name, options, command) => {
    if (options.debug) {
      console.error('Called %s with options %o', command.name(), options);
    }
    const title = options.title ? `${options.title} ` : '';
    console.log(`Thank-you ${title}${name}`);
  });
```

You may supply an `async` action handler, in which case you call `.parseAsync` rather than `.parse`.

```js
async function run() { /* code goes here */ }

async function main() {
  program
    .command('run')
    .action(run);
  await program.parseAsync(process.argv);
}
```

A command's options and arguments on the command line are validated when the command is used. Any unknown options or missing arguments will be reported as an error. You can suppress the unknown option checks with `.allowUnknownOption()`. By default it is not an error to
pass more arguments than declared, but you can make this an error with `.allowExcessArguments(false)`.

### Stand-alone executable (sub)commands

When `.command()` is invoked with a description argument, this tells Commander that you're going to use stand-alone executables for subcommands.
Commander will search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-subcommand`, like `pm-install`, `pm-search`.
You can specify a custom name with the `executableFile` configuration option.

You handle the options for an executable (sub)command in the executable, and don't declare them at the top-level.

Example file: [pm](./examples/pm)

```js
program
  .version('0.1.0')
  .command('install [name]', 'install one or more packages')
  .command('search [query]', 'search with optional query')
  .command('update', 'update installed packages', { executableFile: 'myUpdateSubCommand' })
  .command('list', 'list packages installed', { isDefault: true });

program.parse(process.argv);
```

If the program is designed to be installed globally, make sure the executables have proper modes, like `755`.

### Life cycle hooks

You can add callback hooks to a command for life cycle events.

Example file: [hook.js](./examples/hook.js)

```js
program
  .option('-t, --trace', 'display trace statements for commands')
  .hook('preAction', (thisCommand, actionCommand) => {
    if (thisCommand.opts().trace) {
      console.log(`About to call action handler for subcommand: ${actionCommand.name()}`);
      console.log('arguments: %O', actionCommand.args);
      console.log('options: %o', actionCommand.opts());
    }
  });
```

The callback hook can be `async`, in which case you call `.parseAsync` rather than `.parse`. You can add multiple hooks per event.

The supported events are:

- `preAction`: called before action handler for this command and its subcommands
- `postAction`: called after action handler for this command and its subcommands

The hook is passed the command it was added to, and the command running the action handler.

## Automated help

The help information is auto-generated based on the information commander already knows about your program. The default
help option is `-h,--help`.

Example file: [pizza](./examples/pizza)

```bash
$ node ./examples/pizza --help
Usage: pizza [options]

An application for pizza ordering

Options:
  -p, --peppers        Add peppers
  -c, --cheese <type>  Add the specified type of cheese (default: "marble")
  -C, --no-cheese      You do not want any cheese
  -h, --help           display help for command
```

A `help` command is added by default if your command has subcommands. It can be used alone, or with a subcommand name to show
further help for the subcommand. These are effectively the same if the `shell` program has implicit help:

```bash
shell help
shell --help

shell help spawn
shell spawn --help
```

### Custom help

You can add extra text to be displayed along with the built-in help.

Example file: [custom-help](./examples/custom-help)

```js
program
  .option('-f, --foo', 'enable some foo');

program.addHelpText('after', `

Example call:
  $ custom-help --help`);
```

Yields the following help output:

```Text
Usage: custom-help [options]

Options:
  -f, --foo   enable some foo
  -h, --help  display help for command

Example call:
  $ custom-help --help
```

The positions in order displayed are:

- `beforeAll`: add to the program for a global banner or header
- `before`: display extra information before built-in help
- `after`: display extra information after built-in help
- `afterAll`: add to the program for a global footer (epilog)

The positions "beforeAll" and "afterAll" apply to the command and all its subcommands.

The second parameter can be a string, or a function returning a string. The function is passed a context object for your convenience. The properties are:

- error: a boolean for whether the help is being displayed due to a usage error
- command: the Command which is displaying the help

### Display help after errors

The default behaviour for usage errors is to just display a short error message.
You can change the behaviour to show the full help or a custom help message after an error.

```js
program.showHelpAfterError();
// or
program.showHelpAfterError('(add --help for additional information)');
```

```sh
$ pizza --unknown
error: unknown option '--unknown'
(add --help for additional information)
```

You can also show suggestions after an error for an unknown command or option.

```js
program.showSuggestionAfterError();
```

```sh
$ pizza --hepl
error: unknown option '--hepl'
(Did you mean --help?)
```

### Display help from code

`.help()`: display help information and exit immediately. You can optionally pass `{ error: true }` to display on stderr and exit with an error status.

`.outputHelp()`: output help information without exiting. You can optionally pass `{ error: true }` to display on stderr.

`.helpInformation()`: get the built-in command help information as a string for processing or displaying yourself.

### .usage and .name

These allow you to customise the usage description in the first line of the help. The name is otherwise
deduced from the (full) program arguments. Given:

```js
program
  .name("my-command")
  .usage("[global options] command")
```

The help will start with:

```Text
Usage: my-command [global options] command
```

### .helpOption(flags, description)

By default every command has a help option. Override the default help flags and description. Pass false to disable the built-in help option.

```js
program
  .helpOption('-e, --HELP', 'read more information');
```

### .addHelpCommand()

A help command is added by default if your command has subcommands. You can explicitly turn on or off the implicit help command with `.addHelpCommand()` and `.addHelpCommand(false)`.

You can both turn on and customise the help command by supplying the name and description:

```js
program.addHelpCommand('assist [command]', 'show assistance');
```

### More configuration

The built-in help is formatted using the Help class.
You can configure the Help behaviour by modifying data properties and methods using `.configureHelp()`, or by subclassing using `.createHelp()` if you prefer.

The data properties are:

- `helpWidth`: specify the wrap width, useful for unit tests
- `sortSubcommands`: sort the subcommands alphabetically
- `sortOptions`: sort the options alphabetically

There are methods getting the visible lists of arguments, options, and subcommands. There are methods for formatting the items in the lists, with each item having a _term_ and _description_. Take a look at `.formatHelp()` to see how they are used.

Example file: [configure-help.js](./examples/configure-help.js)

```js
program.configureHelp({
  sortSubcommands: true,
  subcommandTerm: (cmd) => cmd.name() // Just show the name, instead of short usage.
});
```

## Custom event listeners

You can execute custom actions by listening to command and option events.

```js
program.on('option:verbose', function () {
  process.env.VERBOSE = this.opts().verbose;
});
```

## Bits and pieces

### .parse() and .parseAsync()

The first argument to `.parse` is the array of strings to parse. You may omit the parameter to implicitly use `process.argv`.

If the arguments follow different conventions than node you can pass a `from` option in the second parameter:

- 'node': default, `argv[0]` is the application and `argv[1]` is the script being run, with user parameters after that
- 'electron': `argv[1]` varies depending on whether the electron application is packaged
- 'user': all of the arguments from the user

For example:

```js
program.parse(process.argv); // Explicit, node conventions
program.parse(); // Implicit, and auto-detect electron
program.parse(['-f', 'filename'], { from: 'user' });
```

### Parsing Configuration

If the default parsing does not suit your needs, there are some behaviours to support other usage patterns.

By default program options are recognised before and after subcommands. To only look for program options before subcommands, use `.enablePositionalOptions()`. This lets you use
an option for a different purpose in subcommands.

Example file: [positional-options.js](./examples/positional-options.js)

With positional options, the `-b` is a program option in the first line and a subcommand option in the second line:

```sh
program -b subcommand
program subcommand -b
```

By default options are recognised before and after command-arguments. To only process options that come
before the command-arguments, use `.passThroughOptions()`. This lets you pass the  arguments and following options through to another program
without needing to use `--` to end the option processing.
To use pass through options in a subcommand, the program needs to enable positional options.

Example file: [pass-through-options.js](./examples/pass-through-options.js)

With pass through options, the `--port=80` is a program option in the first line and passed through as a command-argument in the second line:

```sh
program --port=80 arg
program arg --port=80
```

By default the option processing shows an error for an unknown option. To have an unknown option treated as an ordinary command-argument and continue looking for options, use `.allowUnknownOption()`. This lets you mix known and unknown options.

By default the argument processing does not display an error for more command-arguments than expected.
To display an error for excess arguments, use`.allowExcessArguments(false)`.

### Legacy options as properties

Before Commander 7, the option values were stored as properties on the command.
This was convenient to code but the downside was possible clashes with
existing properties of `Command`. You can revert to the old behaviour to run unmodified legacy code by using `.storeOptionsAsProperties()`.

```js
program
  .storeOptionsAsProperties()
  .option('-d, --debug')
  .action((commandAndOptions) => {
    if (commandAndOptions.debug) {
      console.error(`Called ${commandAndOptions.name()}`);
    }
  });
```

### TypeScript

If you use `ts-node` and  stand-alone executable subcommands written as `.ts` files, you need to call your program through node to get the subcommands called correctly. e.g.

```bash
node -r ts-node/register pm.ts
```

### createCommand()

This factory function creates a new command. It is exported and may be used instead of using `new`, like:

```js
const { createCommand } = require('commander');
const program = createCommand();
```

`createCommand` is also a method of the Command object, and creates a new command rather than a subcommand. This gets used internally
when creating subcommands using `.command()`, and you may override it to
customise the new subcommand (example file [custom-command-class.js](./examples/custom-command-class.js)).

### Node options such as `--harmony`

You can enable `--harmony` option in two ways:

- Use `#! /usr/bin/env node --harmony` in the subcommands scripts. (Note Windows does not support this pattern.)
- Use the `--harmony` option when call the command, like `node --harmony examples/pm publish`. The `--harmony` option will be preserved when spawning subcommand process.

### Debugging stand-alone executable subcommands

An executable subcommand is launched as a separate child process.

If you are using the node inspector for [debugging](https://nodejs.org/en/docs/guides/debugging-getting-started/) executable subcommands using `node --inspect` et al,
the inspector port is incremented by 1 for the spawned subcommand.

If you are using VSCode to debug executable subcommands you need to set the `"autoAttachChildProcesses": true` flag in your launch.json configuration.

### Override exit and output handling

By default Commander calls `process.exit` when it detects errors, or after displaying the help or version. You can override
this behaviour and optionally supply a callback. The default override throws a `CommanderError`.

The override callback is passed a `CommanderError` with properties `exitCode` number, `code` string, and `message`. The default override behaviour is to throw the error, except for async handling of executable subcommand completion which carries on. The normal display of error messages or version or help
is not affected by the override which is called after the display.

```js
program.exitOverride();

try {
  program.parse(process.argv);
} catch (err) {
  // custom processing...
}
```

By default Commander is configured for a command-line application and writes to stdout and stderr.
You can modify this behaviour for custom applications. In addition, you can modify the display of error messages.

Example file: [configure-output.js](./examples/configure-output.js)

```js
function errorColor(str) {
  // Add ANSI escape codes to display text in red.
  return `\x1b[31m${str}\x1b[0m`;
}

program
  .configureOutput({
    // Visibly override write routines as example!
    writeOut: (str) => process.stdout.write(`[OUT] ${str}`),
    writeErr: (str) => process.stdout.write(`[ERR] ${str}`),
    // Highlight errors in color.
    outputError: (str, write) => write(errorColor(str))
  });
```

### Additional documentation

There is more information available about:

- [deprecated](./docs/deprecated.md) features still supported for backwards compatibility
- [options taking varying arguments](./docs/options-taking-varying-arguments.md)

## Examples

In a single command program, you might not need an action handler.

Example file: [pizza](./examples/pizza)

```js
const { program } = require('commander');

program
  .description('An application for pizza ordering')
  .option('-p, --peppers', 'Add peppers')
  .option('-c, --cheese <type>', 'Add the specified type of cheese', 'marble')
  .option('-C, --no-cheese', 'You do not want any cheese');

program.parse();

const options = program.opts();
console.log('you ordered a pizza with:');
if (options.peppers) console.log('  - peppers');
const cheese = !options.cheese ? 'no' : options.cheese;
console.log('  - %s cheese', cheese);
```

In a multi-command program, you will have action handlers for each command (or stand-alone executables for the commands).

Example file: [deploy](./examples/deploy)

```js
const { Command } = require('commander');
const program = new Command();

program
  .version('0.0.1')
  .option('-c, --config <path>', 'set config path', './deploy.conf');

program
  .command('setup [env]')
  .description('run setup commands for all envs')
  .option('-s, --setup_mode <mode>', 'Which setup mode to use', 'normal')
  .action((env, options) => {
    env = env || 'all';
    console.log('read config from %s', program.opts().config);
    console.log('setup for %s env(s) with %s mode', env, options.setup_mode);
  });

program
  .command('exec <script>')
  .alias('ex')
  .description('execute the given remote cmd')
  .option('-e, --exec_mode <mode>', 'Which exec mode to use', 'fast')
  .action((script, options) => {
    console.log('read config from %s', program.opts().config);
    console.log('exec "%s" using %s mode and config %s', script, options.exec_mode, program.opts().config);
  }).addHelpText('after', `
Examples:
  $ deploy exec sequential
  $ deploy exec async`
  );

program.parse(process.argv);
```

More samples can be found in the [examples](https://github.com/tj/commander.js/tree/master/examples) directory.

## Support

The current version of Commander is fully supported on Long Term Support versions of node, and requires at least node v12.
(For older versions of node, use an older version of Commander. Commander version 2.x has the widest support.)

The main forum for free and community support is the project [Issues](https://github.com/tj/commander.js/issues) on GitHub.

### Commander for enterprise

Available as part of the Tidelift Subscription

The maintainers of Commander and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-commander?utm_source=npm-commander&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
cexx import commander from './index.js';

// wrapper to provide named exports for ESM.
export const {
  program,
  createCommand,
  createArgument,
  createOption,
  CommanderError,
  InvalidArgumentError,
  Command,
  Argument,
  Option,
  Help
} = commander;
U1xconst { Argument } = require('./lib/argument.js');
const { Command } = require('./lib/command.js');
const { CommanderError, InvalidArgumentError } = require('./lib/error.js');
const { Help } = require('./lib/help.js');
const { Option } = require('./lib/option.js');

// @ts-check

/**
 * Expose the root command.
 */

exports = module.exports = new Command();
exports.program = exports; // More explicit access to global command.
// Implicit export of createArgument, createCommand, and createOption.

/**
 * Expose classes
 */

exports.Argument = Argument;
exports.Command = Command;
exports.CommanderError = CommanderError;
exports.Help = Help;
exports.InvalidArgumentError = InvalidArgumentError;
exports.InvalidOptionArgumentError = InvalidArgumentError; // Deprecated
exports.Option = Option;
ssx 100644 argument.js ATi	uӦcRIZql100644 command.js GVZF!==\100644 error.js wx1ŉҭ|100644 help.js !u+%;]S="d100644 option.js .@rpi<=100644 suggestSimilar.js @f2=qJ[J5]Ex\const { InvalidArgumentError } = require('./error.js');

// @ts-check

class Argument {
  /**
   * Initialize a new command argument with the given name and description.
   * The default is that the argument is required, and you can explicitly
   * indicate this with <> around the name. Put [] around the name for an optional argument.
   *
   * @param {string} name
   * @param {string} [description]
   */

  constructor(name, description) {
    this.description = description || '';
    this.variadic = false;
    this.parseArg = undefined;
    this.defaultValue = undefined;
    this.defaultValueDescription = undefined;
    this.argChoices = undefined;

    switch (name[0]) {
      case '<': // e.g. <required>
        this.required = true;
        this._name = name.slice(1, -1);
        break;
      case '[': // e.g. [optional]
        this.required = false;
        this._name = name.slice(1, -1);
        break;
      default:
        this.required = true;
        this._name = name;
        break;
    }

    if (this._name.length > 3 && this._name.slice(-3) === '...') {
      this.variadic = true;
      this._name = this._name.slice(0, -3);
    }
  }

  /**
   * Return argument name.
   *
   * @return {string}
   */

  name() {
    return this._name;
  };

  /**
   * @api private
   */

  _concatValue(value, previous) {
    if (previous === this.defaultValue || !Array.isArray(previous)) {
      return [value];
    }

    return previous.concat(value);
  }

  /**
   * Set the default value, and optionally supply the description to be displayed in the help.
   *
   * @param {any} value
   * @param {string} [description]
   * @return {Argument}
   */

  default(value, description) {
    this.defaultValue = value;
    this.defaultValueDescription = description;
    return this;
  };

  /**
   * Set the custom handler for processing CLI command arguments into argument values.
   *
   * @param {Function} [fn]
   * @return {Argument}
   */

  argParser(fn) {
    this.parseArg = fn;
    return this;
  };

  /**
   * Only allow option value to be one of choices.
   *
   * @param {string[]} values
   * @return {Argument}
   */

  choices(values) {
    this.argChoices = values;
    this.parseArg = (arg, previous) => {
      if (!values.includes(arg)) {
        throw new InvalidArgumentError(`Allowed choices are ${values.join(', ')}.`);
      }
      if (this.variadic) {
        return this._concatValue(arg, previous);
      }
      return arg;
    };
    return this;
  };

  /**
   * Make option-argument required.
   */
  argRequired() {
    this.required = true;
    return this;
  }

  /**
   * Make option-argument optional.
   */
  argOptional() {
    this.required = false;
    return this;
  }
}

/**
 * Takes an argument and returns its human readable equivalent for help usage.
 *
 * @param {Argument} arg
 * @return {string}
 * @api private
 */

function humanReadableArgName(arg) {
  const nameOutput = arg.name() + (arg.variadic === true ? '...' : '');

  return arg.required
    ? '<' + nameOutput + '>'
    : '[' + nameOutput + ']';
}

exports.Argument = Argument;
exports.humanReadableArgName = humanReadableArgName;
^ѥxgconst EventEmitter = require('events').EventEmitter;
const childProcess = require('child_process');
const path = require('path');
const fs = require('fs');

const { Argument, humanReadableArgName } = require('./argument.js');
const { CommanderError } = require('./error.js');
const { Help } = require('./help.js');
const { Option, splitOptionFlags } = require('./option.js');
const { suggestSimilar } = require('./suggestSimilar');

// @ts-check

class Command extends EventEmitter {
  /**
   * Initialize a new `Command`.
   *
   * @param {string} [name]
   */

  constructor(name) {
    super();
    /** @type {Command[]} */
    this.commands = [];
    /** @type {Option[]} */
    this.options = [];
    this.parent = null;
    this._allowUnknownOption = false;
    this._allowExcessArguments = true;
    /** @type {Argument[]} */
    this._args = [];
    /** @type {string[]} */
    this.args = []; // cli args with options removed
    this.rawArgs = [];
    this.processedArgs = []; // like .args but after custom processing and collecting variadic
    this._scriptPath = null;
    this._name = name || '';
    this._optionValues = {};
    this._optionValueSources = {}; // default < config < env < cli
    this._storeOptionsAsProperties = false;
    this._actionHandler = null;
    this._executableHandler = false;
    this._executableFile = null; // custom name for executable
    this._defaultCommandName = null;
    this._exitCallback = null;
    this._aliases = [];
    this._combineFlagAndOptionalValue = true;
    this._description = '';
    this._argsDescription = undefined; // legacy
    this._enablePositionalOptions = false;
    this._passThroughOptions = false;
    this._lifeCycleHooks = {}; // a hash of arrays
    /** @type {boolean | string} */
    this._showHelpAfterError = false;
    this._showSuggestionAfterError = false;

    // see .configureOutput() for docs
    this._outputConfiguration = {
      writeOut: (str) => process.stdout.write(str),
      writeErr: (str) => process.stderr.write(str),
      getOutHelpWidth: () => process.stdout.isTTY ? process.stdout.columns : undefined,
      getErrHelpWidth: () => process.stderr.isTTY ? process.stderr.columns : undefined,
      outputError: (str, write) => write(str)
    };

    this._hidden = false;
    this._hasHelpOption = true;
    this._helpFlags = '-h, --help';
    this._helpDescription = 'display help for command';
    this._helpShortFlag = '-h';
    this._helpLongFlag = '--help';
    this._addImplicitHelpCommand = undefined; // Deliberately undefined, not decided whether true or false
    this._helpCommandName = 'help';
    this._helpCommandnameAndArgs = 'help [command]';
    this._helpCommandDescription = 'display help for command';
    this._helpConfiguration = {};
  }

  /**
   * Copy settings that are useful to have in common across root command and subcommands.
   *
   * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)
   *
   * @param {Command} sourceCommand
   * @return {Command} returns `this` for executable command
   */
  copyInheritedSettings(sourceCommand) {
    this._outputConfiguration = sourceCommand._outputConfiguration;
    this._hasHelpOption = sourceCommand._hasHelpOption;
    this._helpFlags = sourceCommand._helpFlags;
    this._helpDescription = sourceCommand._helpDescription;
    this._helpShortFlag = sourceCommand._helpShortFlag;
    this._helpLongFlag = sourceCommand._helpLongFlag;
    this._helpCommandName = sourceCommand._helpCommandName;
    this._helpCommandnameAndArgs = sourceCommand._helpCommandnameAndArgs;
    this._helpCommandDescription = sourceCommand._helpCommandDescription;
    this._helpConfiguration = sourceCommand._helpConfiguration;
    this._exitCallback = sourceCommand._exitCallback;
    this._storeOptionsAsProperties = sourceCommand._storeOptionsAsProperties;
    this._combineFlagAndOptionalValue = sourceCommand._combineFlagAndOptionalValue;
    this._allowExcessArguments = sourceCommand._allowExcessArguments;
    this._enablePositionalOptions = sourceCommand._enablePositionalOptions;
    this._showHelpAfterError = sourceCommand._showHelpAfterError;
    this._showSuggestionAfterError = sourceCommand._showSuggestionAfterError;

    return this;
  }

  /**
   * Define a command.
   *
   * There are two styles of command: pay attention to where to put the description.
   *
   * @example
   * // Command implemented using action handler (description is supplied separately to `.command`)
   * program
   *   .command('clone <source> [destination]')
   *   .description('clone a repository into a newly created directory')
   *   .action((source, destination) => {
   *     console.log('clone command called');
   *   });
   *
   * // Command implemented using separate executable file (description is second parameter to `.command`)
   * program
   *   .command('start <service>', 'start named service')
   *   .command('stop [service]', 'stop named service, or all if no name supplied');
   *
   * @param {string} nameAndArgs - command name and arguments, args are `<required>` or `[optional]` and last may also be `variadic...`
   * @param {Object|string} [actionOptsOrExecDesc] - configuration options (for action), or description (for executable)
   * @param {Object} [execOpts] - configuration options (for executable)
   * @return {Command} returns new command for action handler, or `this` for executable command
   */

  command(nameAndArgs, actionOptsOrExecDesc, execOpts) {
    let desc = actionOptsOrExecDesc;
    let opts = execOpts;
    if (typeof desc === 'object' && desc !== null) {
      opts = desc;
      desc = null;
    }
    opts = opts || {};
    const [, name, args] = nameAndArgs.match(/([^ ]+) *(.*)/);

    const cmd = this.createCommand(name);
    if (desc) {
      cmd.description(desc);
      cmd._executableHandler = true;
    }
    if (opts.isDefault) this._defaultCommandName = cmd._name;
    cmd._hidden = !!(opts.noHelp || opts.hidden); // noHelp is deprecated old name for hidden
    cmd._executableFile = opts.executableFile || null; // Custom name for executable file, set missing to null to match constructor
    if (args) cmd.arguments(args);
    this.commands.push(cmd);
    cmd.parent = this;
    cmd.copyInheritedSettings(this);

    if (desc) return this;
    return cmd;
  };

  /**
   * Factory routine to create a new unattached command.
   *
   * See .command() for creating an attached subcommand, which uses this routine to
   * create the command. You can override createCommand to customise subcommands.
   *
   * @param {string} [name]
   * @return {Command} new command
   */

  createCommand(name) {
    return new Command(name);
  };

  /**
   * You can customise the help with a subclass of Help by overriding createHelp,
   * or by overriding Help properties using configureHelp().
   *
   * @return {Help}
   */

  createHelp() {
    return Object.assign(new Help(), this.configureHelp());
  };

  /**
   * You can customise the help by overriding Help properties using configureHelp(),
   * or with a subclass of Help by overriding createHelp().
   *
   * @param {Object} [configuration] - configuration options
   * @return {Command|Object} `this` command for chaining, or stored configuration
   */

  configureHelp(configuration) {
    if (configuration === undefined) return this._helpConfiguration;

    this._helpConfiguration = configuration;
    return this;
  }

  /**
   * The default output goes to stdout and stderr. You can customise this for special
   * applications. You can also customise the display of errors by overriding outputError.
   *
   * The configuration properties are all functions:
   *
   *     // functions to change where being written, stdout and stderr
   *     writeOut(str)
   *     writeErr(str)
   *     // matching functions to specify width for wrapping help
   *     getOutHelpWidth()
   *     getErrHelpWidth()
   *     // functions based on what is being written out
   *     outputError(str, write) // used for displaying errors, and not used for displaying help
   *
   * @param {Object} [configuration] - configuration options
   * @return {Command|Object} `this` command for chaining, or stored configuration
   */

  configureOutput(configuration) {
    if (configuration === undefined) return this._outputConfiguration;

    Object.assign(this._outputConfiguration, configuration);
    return this;
  }

  /**
   * Display the help or a custom message after an error occurs.
   *
   * @param {boolean|string} [displayHelp]
   * @return {Command} `this` command for chaining
   */
  showHelpAfterError(displayHelp = true) {
    if (typeof displayHelp !== 'string') displayHelp = !!displayHelp;
    this._showHelpAfterError = displayHelp;
    return this;
  }

  /**
   * Display suggestion of similar commands for unknown commands, or options for unknown options.
   *
   * @param {boolean} [displaySuggestion]
   * @return {Command} `this` command for chaining
   */
  showSuggestionAfterError(displaySuggestion = true) {
    this._showSuggestionAfterError = !!displaySuggestion;
    return this;
  }

  /**
   * Add a prepared subcommand.
   *
   * See .command() for creating an attached subcommand which inherits settings from its parent.
   *
   * @param {Command} cmd - new subcommand
   * @param {Object} [opts] - configuration options
   * @return {Command} `this` command for chaining
   */

  addCommand(cmd, opts) {
    if (!cmd._name) throw new Error('Command passed to .addCommand() must have a name');

    // To keep things simple, block automatic name generation for deeply nested executables.
    // Fail fast and detect when adding rather than later when parsing.
    function checkExplicitNames(commandArray) {
      commandArray.forEach((cmd) => {
        if (cmd._executableHandler && !cmd._executableFile) {
          throw new Error(`Must specify executableFile for deeply nested executable: ${cmd.name()}`);
        }
        checkExplicitNames(cmd.commands);
      });
    }
    checkExplicitNames(cmd.commands);

    opts = opts || {};
    if (opts.isDefault) this._defaultCommandName = cmd._name;
    if (opts.noHelp || opts.hidden) cmd._hidden = true; // modifying passed command due to existing implementation

    this.commands.push(cmd);
    cmd.parent = this;
    return this;
  };

  /**
   * Factory routine to create a new unattached argument.
   *
   * See .argument() for creating an attached argument, which uses this routine to
   * create the argument. You can override createArgument to return a custom argument.
   *
   * @param {string} name
   * @param {string} [description]
   * @return {Argument} new argument
   */

  createArgument(name, description) {
    return new Argument(name, description);
  };

  /**
   * Define argument syntax for command.
   *
   * The default is that the argument is required, and you can explicitly
   * indicate this with <> around the name. Put [] around the name for an optional argument.
   *
   * @example
   * program.argument('<input-file>');
   * program.argument('[output-file]');
   *
   * @param {string} name
   * @param {string} [description]
   * @param {Function|*} [fn] - custom argument processing function
   * @param {*} [defaultValue]
   * @return {Command} `this` command for chaining
   */
  argument(name, description, fn, defaultValue) {
    const argument = this.createArgument(name, description);
    if (typeof fn === 'function') {
      argument.default(defaultValue).argParser(fn);
    } else {
      argument.default(fn);
    }
    this.addArgument(argument);
    return this;
  }

  /**
   * Define argument syntax for command, adding multiple at once (without descriptions).
   *
   * See also .argument().
   *
   * @example
   * program.arguments('<cmd> [env]');
   *
   * @param {string} names
   * @return {Command} `this` command for chaining
   */

  arguments(names) {
    names.split(/ +/).forEach((detail) => {
      this.argument(detail);
    });
    return this;
  };

  /**
   * Define argument syntax for command, adding a prepared argument.
   *
   * @param {Argument} argument
   * @return {Command} `this` command for chaining
   */
  addArgument(argument) {
    const previousArgument = this._args.slice(-1)[0];
    if (previousArgument && previousArgument.variadic) {
      throw new Error(`only the last argument can be variadic '${previousArgument.name()}'`);
    }
    if (argument.required && argument.defaultValue !== undefined && argument.parseArg === undefined) {
      throw new Error(`a default value for a required argument is never used: '${argument.name()}'`);
    }
    this._args.push(argument);
    return this;
  }

  /**
   * Override default decision whether to add implicit help command.
   *
   *    addHelpCommand() // force on
   *    addHelpCommand(false); // force off
   *    addHelpCommand('help [cmd]', 'display help for [cmd]'); // force on with custom details
   *
   * @return {Command} `this` command for chaining
   */

  addHelpCommand(enableOrNameAndArgs, description) {
    if (enableOrNameAndArgs === false) {
      this._addImplicitHelpCommand = false;
    } else {
      this._addImplicitHelpCommand = true;
      if (typeof enableOrNameAndArgs === 'string') {
        this._helpCommandName = enableOrNameAndArgs.split(' ')[0];
        this._helpCommandnameAndArgs = enableOrNameAndArgs;
      }
      this._helpCommandDescription = description || this._helpCommandDescription;
    }
    return this;
  };

  /**
   * @return {boolean}
   * @api private
   */

  _hasImplicitHelpCommand() {
    if (this._addImplicitHelpCommand === undefined) {
      return this.commands.length && !this._actionHandler && !this._findCommand('help');
    }
    return this._addImplicitHelpCommand;
  };

  /**
   * Add hook for life cycle event.
   *
   * @param {string} event
   * @param {Function} listener
   * @return {Command} `this` command for chaining
   */

  hook(event, listener) {
    const allowedValues = ['preAction', 'postAction'];
    if (!allowedValues.includes(event)) {
      throw new Error(`Unexpected value for event passed to hook : '${event}'.
Expecting one of '${allowedValues.join("', '")}'`);
    }
    if (this._lifeCycleHooks[event]) {
      this._lifeCycleHooks[event].push(listener);
    } else {
      this._lifeCycleHooks[event] = [listener];
    }
    return this;
  }

  /**
   * Register callback to use as replacement for calling process.exit.
   *
   * @param {Function} [fn] optional callback which will be passed a CommanderError, defaults to throwing
   * @return {Command} `this` command for chaining
   */

  exitOverride(fn) {
    if (fn) {
      this._exitCallback = fn;
    } else {
      this._exitCallback = (err) => {
        if (err.code !== 'commander.executeSubCommandAsync') {
          throw err;
        } else {
          // Async callback from spawn events, not useful to throw.
        }
      };
    }
    return this;
  };

  /**
   * Call process.exit, and _exitCallback if defined.
   *
   * @param {number} exitCode exit code for using with process.exit
   * @param {string} code an id string representing the error
   * @param {string} message human-readable description of the error
   * @return never
   * @api private
   */

  _exit(exitCode, code, message) {
    if (this._exitCallback) {
      this._exitCallback(new CommanderError(exitCode, code, message));
      // Expecting this line is not reached.
    }
    process.exit(exitCode);
  };

  /**
   * Register callback `fn` for the command.
   *
   * @example
   * program
   *   .command('serve')
   *   .description('start service')
   *   .action(function() {
   *      // do work here
   *   });
   *
   * @param {Function} fn
   * @return {Command} `this` command for chaining
   */

  action(fn) {
    const listener = (args) => {
      // The .action callback takes an extra parameter which is the command or options.
      const expectedArgsCount = this._args.length;
      const actionArgs = args.slice(0, expectedArgsCount);
      if (this._storeOptionsAsProperties) {
        actionArgs[expectedArgsCount] = this; // backwards compatible "options"
      } else {
        actionArgs[expectedArgsCount] = this.opts();
      }
      actionArgs.push(this);

      return fn.apply(this, actionArgs);
    };
    this._actionHandler = listener;
    return this;
  };

  /**
   * Factory routine to create a new unattached option.
   *
   * See .option() for creating an attached option, which uses this routine to
   * create the option. You can override createOption to return a custom option.
   *
   * @param {string} flags
   * @param {string} [description]
   * @return {Option} new option
   */

  createOption(flags, description) {
    return new Option(flags, description);
  };

  /**
   * Add an option.
   *
   * @param {Option} option
   * @return {Command} `this` command for chaining
   */
  addOption(option) {
    const oname = option.name();
    const name = option.attributeName();

    let defaultValue = option.defaultValue;

    // preassign default value for --no-*, [optional], <required>, or plain flag if boolean value
    if (option.negate || option.optional || option.required || typeof defaultValue === 'boolean') {
      // when --no-foo we make sure default is true, unless a --foo option is already defined
      if (option.negate) {
        const positiveLongFlag = option.long.replace(/^--no-/, '--');
        defaultValue = this._findOption(positiveLongFlag) ? this.getOptionValue(name) : true;
      }
      // preassign only if we have a default
      if (defaultValue !== undefined) {
        this.setOptionValueWithSource(name, defaultValue, 'default');
      }
    }

    // register the option
    this.options.push(option);

    // handler for cli and env supplied values
    const handleOptionValue = (val, invalidValueMessage, valueSource) => {
      // Note: using closure to access lots of lexical scoped variables.
      const oldValue = this.getOptionValue(name);

      // custom processing
      if (val !== null && option.parseArg) {
        try {
          val = option.parseArg(val, oldValue === undefined ? defaultValue : oldValue);
        } catch (err) {
          if (err.code === 'commander.invalidArgument') {
            const message = `${invalidValueMessage} ${err.message}`;
            this._displayError(err.exitCode, err.code, message);
          }
          throw err;
        }
      } else if (val !== null && option.variadic) {
        val = option._concatValue(val, oldValue);
      }

      // unassigned or boolean value
      if (typeof oldValue === 'boolean' || typeof oldValue === 'undefined') {
        // if no value, negate false, and we have a default, then use it!
        if (val == null) {
          this.setOptionValueWithSource(name, option.negate ? false : defaultValue || true, valueSource);
        } else {
          this.setOptionValueWithSource(name, val, valueSource);
        }
      } else if (val !== null) {
        // reassign
        this.setOptionValueWithSource(name, option.negate ? false : val, valueSource);
      }
    };

    this.on('option:' + oname, (val) => {
      const invalidValueMessage = `error: option '${option.flags}' argument '${val}' is invalid.`;
      handleOptionValue(val, invalidValueMessage, 'cli');
    });

    if (option.envVar) {
      this.on('optionEnv:' + oname, (val) => {
        const invalidValueMessage = `error: option '${option.flags}' value '${val}' from env '${option.envVar}' is invalid.`;
        handleOptionValue(val, invalidValueMessage, 'env');
      });
    }

    return this;
  }

  /**
   * Internal implementation shared by .option() and .requiredOption()
   *
   * @api private
   */
  _optionEx(config, flags, description, fn, defaultValue) {
    const option = this.createOption(flags, description);
    option.makeOptionMandatory(!!config.mandatory);
    if (typeof fn === 'function') {
      option.default(defaultValue).argParser(fn);
    } else if (fn instanceof RegExp) {
      // deprecated
      const regex = fn;
      fn = (val, def) => {
        const m = regex.exec(val);
        return m ? m[0] : def;
      };
      option.default(defaultValue).argParser(fn);
    } else {
      option.default(fn);
    }

    return this.addOption(option);
  }

  /**
   * Define option with `flags`, `description` and optional
   * coercion `fn`.
   *
   * The `flags` string contains the short and/or long flags,
   * separated by comma, a pipe or space. The following are all valid
   * all will output this way when `--help` is used.
   *
   *     "-p, --pepper"
   *     "-p|--pepper"
   *     "-p --pepper"
   *
   * @example
   * // simple boolean defaulting to undefined
   * program.option('-p, --pepper', 'add pepper');
   *
   * program.pepper
   * // => undefined
   *
   * --pepper
   * program.pepper
   * // => true
   *
   * // simple boolean defaulting to true (unless non-negated option is also defined)
   * program.option('-C, --no-cheese', 'remove cheese');
   *
   * program.cheese
   * // => true
   *
   * --no-cheese
   * program.cheese
   * // => false
   *
   * // required argument
   * program.option('-C, --chdir <path>', 'change the working directory');
   *
   * --chdir /tmp
   * program.chdir
   * // => "/tmp"
   *
   * // optional argument
   * program.option('-c, --cheese [type]', 'add cheese [marble]');
   *
   * @param {string} flags
   * @param {string} [description]
   * @param {Function|*} [fn] - custom option processing function or default value
   * @param {*} [defaultValue]
   * @return {Command} `this` command for chaining
   */

  option(flags, description, fn, defaultValue) {
    return this._optionEx({}, flags, description, fn, defaultValue);
  };

  /**
  * Add a required option which must have a value after parsing. This usually means
  * the option must be specified on the command line. (Otherwise the same as .option().)
  *
  * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.
  *
  * @param {string} flags
  * @param {string} [description]
  * @param {Function|*} [fn] - custom option processing function or default value
  * @param {*} [defaultValue]
  * @return {Command} `this` command for chaining
  */

  requiredOption(flags, description, fn, defaultValue) {
    return this._optionEx({ mandatory: true }, flags, description, fn, defaultValue);
  };

  /**
   * Alter parsing of short flags with optional values.
   *
   * @example
   * // for `.option('-f,--flag [value]'):
   * program.combineFlagAndOptionalValue(true);  // `-f80` is treated like `--flag=80`, this is the default behaviour
   * program.combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`
   *
   * @param {Boolean} [combine=true] - if `true` or omitted, an optional value can be specified directly after the flag.
   */
  combineFlagAndOptionalValue(combine = true) {
    this._combineFlagAndOptionalValue = !!combine;
    return this;
  };

  /**
   * Allow unknown options on the command line.
   *
   * @param {Boolean} [allowUnknown=true] - if `true` or omitted, no error will be thrown
   * for unknown options.
   */
  allowUnknownOption(allowUnknown = true) {
    this._allowUnknownOption = !!allowUnknown;
    return this;
  };

  /**
   * Allow excess command-arguments on the command line. Pass false to make excess arguments an error.
   *
   * @param {Boolean} [allowExcess=true] - if `true` or omitted, no error will be thrown
   * for excess arguments.
   */
  allowExcessArguments(allowExcess = true) {
    this._allowExcessArguments = !!allowExcess;
    return this;
  };

  /**
   * Enable positional options. Positional means global options are specified before subcommands which lets
   * subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.
   * The default behaviour is non-positional and global options may appear anywhere on the command line.
   *
   * @param {Boolean} [positional=true]
   */
  enablePositionalOptions(positional = true) {
    this._enablePositionalOptions = !!positional;
    return this;
  };

  /**
   * Pass through options that come after command-arguments rather than treat them as command-options,
   * so actual command-options come before command-arguments. Turning this on for a subcommand requires
   * positional options to have been enabled on the program (parent commands).
   * The default behaviour is non-positional and options may appear before or after command-arguments.
   *
   * @param {Boolean} [passThrough=true]
   * for unknown options.
   */
  passThroughOptions(passThrough = true) {
    this._passThroughOptions = !!passThrough;
    if (!!this.parent && passThrough && !this.parent._enablePositionalOptions) {
      throw new Error('passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)');
    }
    return this;
  };

  /**
    * Whether to store option values as properties on command object,
    * or store separately (specify false). In both cases the option values can be accessed using .opts().
    *
    * @param {boolean} [storeAsProperties=true]
    * @return {Command} `this` command for chaining
    */

  storeOptionsAsProperties(storeAsProperties = true) {
    this._storeOptionsAsProperties = !!storeAsProperties;
    if (this.options.length) {
      throw new Error('call .storeOptionsAsProperties() before adding options');
    }
    return this;
  };

  /**
   * Retrieve option value.
   *
   * @param {string} key
   * @return {Object} value
   */

  getOptionValue(key) {
    if (this._storeOptionsAsProperties) {
      return this[key];
    }
    return this._optionValues[key];
  };

  /**
   * Store option value.
   *
   * @param {string} key
   * @param {Object} value
   * @return {Command} `this` command for chaining
   */

  setOptionValue(key, value) {
    if (this._storeOptionsAsProperties) {
      this[key] = value;
    } else {
      this._optionValues[key] = value;
    }
    return this;
  };

  /**
   * Store option value and where the value came from.
    *
    * @param {string} key
    * @param {Object} value
    * @param {string} source - expected values are default/config/env/cli
    * @return {Command} `this` command for chaining
    */

  setOptionValueWithSource(key, value, source) {
    this.setOptionValue(key, value);
    this._optionValueSources[key] = source;
    return this;
  }

  /**
    * Get source of option value.
    * Expected values are default | config | env | cli
    *
    * @param {string} key
    * @return {string}
    */

  getOptionValueSource(key) {
    return this._optionValueSources[key];
  };

  /**
   * Get user arguments implied or explicit arguments.
   * Side-effects: set _scriptPath if args included application, and use that to set implicit command name.
   *
   * @api private
   */

  _prepareUserArgs(argv, parseOptions) {
    if (argv !== undefined && !Array.isArray(argv)) {
      throw new Error('first parameter to parse must be array or undefined');
    }
    parseOptions = parseOptions || {};

    // Default to using process.argv
    if (argv === undefined) {
      argv = process.argv;
      // @ts-ignore: unknown property
      if (process.versions && process.versions.electron) {
        parseOptions.from = 'electron';
      }
    }
    this.rawArgs = argv.slice();

    // make it a little easier for callers by supporting various argv conventions
    let userArgs;
    switch (parseOptions.from) {
      case undefined:
      case 'node':
        this._scriptPath = argv[1];
        userArgs = argv.slice(2);
        break;
      case 'electron':
        // @ts-ignore: unknown property
        if (process.defaultApp) {
          this._scriptPath = argv[1];
          userArgs = argv.slice(2);
        } else {
          userArgs = argv.slice(1);
        }
        break;
      case 'user':
        userArgs = argv.slice(0);
        break;
      default:
        throw new Error(`unexpected parse option { from: '${parseOptions.from}' }`);
    }
    if (!this._scriptPath && require.main) {
      this._scriptPath = require.main.filename;
    }

    // Guess name, used in usage in help.
    this._name = this._name || (this._scriptPath && path.basename(this._scriptPath, path.extname(this._scriptPath)));

    return userArgs;
  }

  /**
   * Parse `argv`, setting options and invoking commands when defined.
   *
   * The default expectation is that the arguments are from node and have the application as argv[0]
   * and the script being run in argv[1], with user parameters after that.
   *
   * @example
   * program.parse(process.argv);
   * program.parse(); // implicitly use process.argv and auto-detect node vs electron conventions
   * program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
   *
   * @param {string[]} [argv] - optional, defaults to process.argv
   * @param {Object} [parseOptions] - optionally specify style of options with from: node/user/electron
   * @param {string} [parseOptions.from] - where the args are from: 'node', 'user', 'electron'
   * @return {Command} `this` command for chaining
   */

  parse(argv, parseOptions) {
    const userArgs = this._prepareUserArgs(argv, parseOptions);
    this._parseCommand([], userArgs);

    return this;
  };

  /**
   * Parse `argv`, setting options and invoking commands when defined.
   *
   * Use parseAsync instead of parse if any of your action handlers are async. Returns a Promise.
   *
   * The default expectation is that the arguments are from node and have the application as argv[0]
   * and the script being run in argv[1], with user parameters after that.
   *
   * @example
   * await program.parseAsync(process.argv);
   * await program.parseAsync(); // implicitly use process.argv and auto-detect node vs electron conventions
   * await program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
   *
   * @param {string[]} [argv]
   * @param {Object} [parseOptions]
   * @param {string} parseOptions.from - where the args are from: 'node', 'user', 'electron'
   * @return {Promise}
   */

  async parseAsync(argv, parseOptions) {
    const userArgs = this._prepareUserArgs(argv, parseOptions);
    await this._parseCommand([], userArgs);

    return this;
  };

  /**
   * Execute a sub-command executable.
   *
   * @api private
   */

  _executeSubCommand(subcommand, args) {
    args = args.slice();
    let launchWithNode = false; // Use node for source targets so do not need to get permissions correct, and on Windows.
    const sourceExt = ['.js', '.ts', '.tsx', '.mjs', '.cjs'];

    // Not checking for help first. Unlikely to have mandatory and executable, and can't robustly test for help flags in external command.
    this._checkForMissingMandatoryOptions();

    // Want the entry script as the reference for command name and directory for searching for other files.
    let scriptPath = this._scriptPath;
    // Fallback in case not set, due to how Command created or called.
    if (!scriptPath && require.main) {
      scriptPath = require.main.filename;
    }

    let baseDir;
    try {
      const resolvedLink = fs.realpathSync(scriptPath);
      baseDir = path.dirname(resolvedLink);
    } catch (e) {
      baseDir = '.'; // dummy, probably not going to find executable!
    }

    // name of the subcommand, like `pm-install`
    let bin = path.basename(scriptPath, path.extname(scriptPath)) + '-' + subcommand._name;
    if (subcommand._executableFile) {
      bin = subcommand._executableFile;
    }

    const localBin = path.join(baseDir, bin);
    if (fs.existsSync(localBin)) {
      // prefer local `./<bin>` to bin in the $PATH
      bin = localBin;
    } else {
      // Look for source files.
      sourceExt.forEach((ext) => {
        if (fs.existsSync(`${localBin}${ext}`)) {
          bin = `${localBin}${ext}`;
        }
      });
    }
    launchWithNode = sourceExt.includes(path.extname(bin));

    let proc;
    if (process.platform !== 'win32') {
      if (launchWithNode) {
        args.unshift(bin);
        // add executable arguments to spawn
        args = incrementNodeInspectorPort(process.execArgv).concat(args);

        proc = childProcess.spawn(process.argv[0], args, { stdio: 'inherit' });
      } else {
        proc = childProcess.spawn(bin, args, { stdio: 'inherit' });
      }
    } else {
      args.unshift(bin);
      // add executable arguments to spawn
      args = incrementNodeInspectorPort(process.execArgv).concat(args);
      proc = childProcess.spawn(process.execPath, args, { stdio: 'inherit' });
    }

    const signals = ['SIGUSR1', 'SIGUSR2', 'SIGTERM', 'SIGINT', 'SIGHUP'];
    signals.forEach((signal) => {
      // @ts-ignore
      process.on(signal, () => {
        if (proc.killed === false && proc.exitCode === null) {
          proc.kill(signal);
        }
      });
    });

    // By default terminate process when spawned process terminates.
    // Suppressing the exit if exitCallback defined is a bit messy and of limited use, but does allow process to stay running!
    const exitCallback = this._exitCallback;
    if (!exitCallback) {
      proc.on('close', process.exit.bind(process));
    } else {
      proc.on('close', () => {
        exitCallback(new CommanderError(process.exitCode || 0, 'commander.executeSubCommandAsync', '(close)'));
      });
    }
    proc.on('error', (err) => {
      // @ts-ignore
      if (err.code === 'ENOENT') {
        const executableMissing = `'${bin}' does not exist
 - if '${subcommand._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
 - if the default executable name is not suitable, use the executableFile option to supply a custom name`;
        throw new Error(executableMissing);
      // @ts-ignore
      } else if (err.code === 'EACCES') {
        throw new Error(`'${bin}' not executable`);
      }
      if (!exitCallback) {
        process.exit(1);
      } else {
        const wrappedError = new CommanderError(1, 'commander.executeSubCommandAsync', '(error)');
        wrappedError.nestedError = err;
        exitCallback(wrappedError);
      }
    });

    // Store the reference to the child process
    this.runningCommand = proc;
  };

  /**
   * @api private
   */

  _dispatchSubcommand(commandName, operands, unknown) {
    const subCommand = this._findCommand(commandName);
    if (!subCommand) this.help({ error: true });

    if (subCommand._executableHandler) {
      this._executeSubCommand(subCommand, operands.concat(unknown));
    } else {
      return subCommand._parseCommand(operands, unknown);
    }
  };

  /**
   * Check this.args against expected this._args.
   *
   * @api private
   */

  _checkNumberOfArguments() {
    // too few
    this._args.forEach((arg, i) => {
      if (arg.required && this.args[i] == null) {
        this.missingArgument(arg.name());
      }
    });
    // too many
    if (this._args.length > 0 && this._args[this._args.length - 1].variadic) {
      return;
    }
    if (this.args.length > this._args.length) {
      this._excessArguments(this.args);
    }
  };

  /**
   * Process this.args using this._args and save as this.processedArgs!
   *
   * @api private
   */

  _processArguments() {
    const myParseArg = (argument, value, previous) => {
      // Extra processing for nice error message on parsing failure.
      let parsedValue = value;
      if (value !== null && argument.parseArg) {
        try {
          parsedValue = argument.parseArg(value, previous);
        } catch (err) {
          if (err.code === 'commander.invalidArgument') {
            const message = `error: command-argument value '${value}' is invalid for argument '${argument.name()}'. ${err.message}`;
            this._displayError(err.exitCode, err.code, message);
          }
          throw err;
        }
      }
      return parsedValue;
    };

    this._checkNumberOfArguments();

    const processedArgs = [];
    this._args.forEach((declaredArg, index) => {
      let value = declaredArg.defaultValue;
      if (declaredArg.variadic) {
        // Collect together remaining arguments for passing together as an array.
        if (index < this.args.length) {
          value = this.args.slice(index);
          if (declaredArg.parseArg) {
            value = value.reduce((processed, v) => {
              return myParseArg(declaredArg, v, processed);
            }, declaredArg.defaultValue);
          }
        } else if (value === undefined) {
          value = [];
        }
      } else if (index < this.args.length) {
        value = this.args[index];
        if (declaredArg.parseArg) {
          value = myParseArg(declaredArg, value, declaredArg.defaultValue);
        }
      }
      processedArgs[index] = value;
    });
    this.processedArgs = processedArgs;
  }

  /**
   * Once we have a promise we chain, but call synchronously until then.
   *
   * @param {Promise|undefined} promise
   * @param {Function} fn
   * @return {Promise|undefined}
   * @api private
   */

  _chainOrCall(promise, fn) {
    // thenable
    if (promise && promise.then && typeof promise.then === 'function') {
      // already have a promise, chain callback
      return promise.then(() => fn());
    }
    // callback might return a promise
    return fn();
  }

  /**
   *
   * @param {Promise|undefined} promise
   * @param {string} event
   * @return {Promise|undefined}
   * @api private
   */

  _chainOrCallHooks(promise, event) {
    let result = promise;
    const hooks = [];
    getCommandAndParents(this)
      .reverse()
      .filter(cmd => cmd._lifeCycleHooks[event] !== undefined)
      .forEach(hookedCommand => {
        hookedCommand._lifeCycleHooks[event].forEach((callback) => {
          hooks.push({ hookedCommand, callback });
        });
      });
    if (event === 'postAction') {
      hooks.reverse();
    }

    hooks.forEach((hookDetail) => {
      result = this._chainOrCall(result, () => {
        return hookDetail.callback(hookDetail.hookedCommand, this);
      });
    });
    return result;
  }

  /**
   * Process arguments in context of this command.
   * Returns action result, in case it is a promise.
   *
   * @api private
   */

  _parseCommand(operands, unknown) {
    const parsed = this.parseOptions(unknown);
    this._parseOptionsEnv(); // after cli, so parseArg not called on both cli and env
    operands = operands.concat(parsed.operands);
    unknown = parsed.unknown;
    this.args = operands.concat(unknown);

    if (operands && this._findCommand(operands[0])) {
      return this._dispatchSubcommand(operands[0], operands.slice(1), unknown);
    }
    if (this._hasImplicitHelpCommand() && operands[0] === this._helpCommandName) {
      if (operands.length === 1) {
        this.help();
      }
      return this._dispatchSubcommand(operands[1], [], [this._helpLongFlag]);
    }
    if (this._defaultCommandName) {
      outputHelpIfRequested(this, unknown); // Run the help for default command from parent rather than passing to default command
      return this._dispatchSubcommand(this._defaultCommandName, operands, unknown);
    }
    if (this.commands.length && this.args.length === 0 && !this._actionHandler && !this._defaultCommandName) {
      // probably missing subcommand and no handler, user needs help (and exit)
      this.help({ error: true });
    }

    outputHelpIfRequested(this, parsed.unknown);
    this._checkForMissingMandatoryOptions();

    // We do not always call this check to avoid masking a "better" error, like unknown command.
    const checkForUnknownOptions = () => {
      if (parsed.unknown.length > 0) {
        this.unknownOption(parsed.unknown[0]);
      }
    };

    const commandEvent = `command:${this.name()}`;
    if (this._actionHandler) {
      checkForUnknownOptions();
      this._processArguments();

      let actionResult;
      actionResult = this._chainOrCallHooks(actionResult, 'preAction');
      actionResult = this._chainOrCall(actionResult, () => this._actionHandler(this.processedArgs));
      if (this.parent) this.parent.emit(commandEvent, operands, unknown); // legacy
      actionResult = this._chainOrCallHooks(actionResult, 'postAction');
      return actionResult;
    }
    if (this.parent && this.parent.listenerCount(commandEvent)) {
      checkForUnknownOptions();
      this._processArguments();
      this.parent.emit(commandEvent, operands, unknown); // legacy
    } else if (operands.length) {
      if (this._findCommand('*')) { // legacy default command
        return this._dispatchSubcommand('*', operands, unknown);
      }
      if (this.listenerCount('command:*')) {
        // skip option check, emit event for possible misspelling suggestion
        this.emit('command:*', operands, unknown);
      } else if (this.commands.length) {
        this.unknownCommand();
      } else {
        checkForUnknownOptions();
        this._processArguments();
      }
    } else if (this.commands.length) {
      checkForUnknownOptions();
      // This command has subcommands and nothing hooked up at this level, so display help (and exit).
      this.help({ error: true });
    } else {
      checkForUnknownOptions();
      this._processArguments();
      // fall through for caller to handle after calling .parse()
    }
  };

  /**
   * Find matching command.
   *
   * @api private
   */
  _findCommand(name) {
    if (!name) return undefined;
    return this.commands.find(cmd => cmd._name === name || cmd._aliases.includes(name));
  };

  /**
   * Return an option matching `arg` if any.
   *
   * @param {string} arg
   * @return {Option}
   * @api private
   */

  _findOption(arg) {
    return this.options.find(option => option.is(arg));
  };

  /**
   * Display an error message if a mandatory option does not have a value.
   * Lazy calling after checking for help flags from leaf subcommand.
   *
   * @api private
   */

  _checkForMissingMandatoryOptions() {
    // Walk up hierarchy so can call in subcommand after checking for displaying help.
    for (let cmd = this; cmd; cmd = cmd.parent) {
      cmd.options.forEach((anOption) => {
        if (anOption.mandatory && (cmd.getOptionValue(anOption.attributeName()) === undefined)) {
          cmd.missingMandatoryOptionValue(anOption);
        }
      });
    }
  };

  /**
   * Parse options from `argv` removing known options,
   * and return argv split into operands and unknown arguments.
   *
   * Examples:
   *
   *     argv => operands, unknown
   *     --known kkk op => [op], []
   *     op --known kkk => [op], []
   *     sub --unknown uuu op => [sub], [--unknown uuu op]
   *     sub -- --unknown uuu op => [sub --unknown uuu op], []
   *
   * @param {String[]} argv
   * @return {{operands: String[], unknown: String[]}}
   */

  parseOptions(argv) {
    const operands = []; // operands, not options or values
    const unknown = []; // first unknown option and remaining unknown args
    let dest = operands;
    const args = argv.slice();

    function maybeOption(arg) {
      return arg.length > 1 && arg[0] === '-';
    }

    // parse options
    let activeVariadicOption = null;
    while (args.length) {
      const arg = args.shift();

      // literal
      if (arg === '--') {
        if (dest === unknown) dest.push(arg);
        dest.push(...args);
        break;
      }

      if (activeVariadicOption && !maybeOption(arg)) {
        this.emit(`option:${activeVariadicOption.name()}`, arg);
        continue;
      }
      activeVariadicOption = null;

      if (maybeOption(arg)) {
        const option = this._findOption(arg);
        // recognised option, call listener to assign value with possible custom processing
        if (option) {
          if (option.required) {
            const value = args.shift();
            if (value === undefined) this.optionMissingArgument(option);
            this.emit(`option:${option.name()}`, value);
          } else if (option.optional) {
            let value = null;
            // historical behaviour is optional value is following arg unless an option
            if (args.length > 0 && !maybeOption(args[0])) {
              value = args.shift();
            }
            this.emit(`option:${option.name()}`, value);
          } else { // boolean flag
            this.emit(`option:${option.name()}`);
          }
          activeVariadicOption = option.variadic ? option : null;
          continue;
        }
      }

      // Look for combo options following single dash, eat first one if known.
      if (arg.length > 2 && arg[0] === '-' && arg[1] !== '-') {
        const option = this._findOption(`-${arg[1]}`);
        if (option) {
          if (option.required || (option.optional && this._combineFlagAndOptionalValue)) {
            // option with value following in same argument
            this.emit(`option:${option.name()}`, arg.slice(2));
          } else {
            // boolean option, emit and put back remainder of arg for further processing
            this.emit(`option:${option.name()}`);
            args.unshift(`-${arg.slice(2)}`);
          }
          continue;
        }
      }

      // Look for known long flag with value, like --foo=bar
      if (/^--[^=]+=/.test(arg)) {
        const index = arg.indexOf('=');
        const option = this._findOption(arg.slice(0, index));
        if (option && (option.required || option.optional)) {
          this.emit(`option:${option.name()}`, arg.slice(index + 1));
          continue;
        }
      }

      // Not a recognised option by this command.
      // Might be a command-argument, or subcommand option, or unknown option, or help command or option.

      // An unknown option means further arguments also classified as unknown so can be reprocessed by subcommands.
      if (maybeOption(arg)) {
        dest = unknown;
      }

      // If using positionalOptions, stop processing our options at subcommand.
      if ((this._enablePositionalOptions || this._passThroughOptions) && operands.length === 0 && unknown.length === 0) {
        if (this._findCommand(arg)) {
          operands.push(arg);
          if (args.length > 0) unknown.push(...args);
          break;
        } else if (arg === this._helpCommandName && this._hasImplicitHelpCommand()) {
          operands.push(arg);
          if (args.length > 0) operands.push(...args);
          break;
        } else if (this._defaultCommandName) {
          unknown.push(arg);
          if (args.length > 0) unknown.push(...args);
          break;
        }
      }

      // If using passThroughOptions, stop processing options at first command-argument.
      if (this._passThroughOptions) {
        dest.push(arg);
        if (args.length > 0) dest.push(...args);
        break;
      }

      // add arg
      dest.push(arg);
    }

    return { operands, unknown };
  };

  /**
   * Return an object containing options as key-value pairs
   *
   * @return {Object}
   */
  opts() {
    if (this._storeOptionsAsProperties) {
      // Preserve original behaviour so backwards compatible when still using properties
      const result = {};
      const len = this.options.length;

      for (let i = 0; i < len; i++) {
        const key = this.options[i].attributeName();
        result[key] = key === this._versionOptionName ? this._version : this[key];
      }
      return result;
    }

    return this._optionValues;
  };

  /**
   * Internal bottleneck for handling of parsing errors.
   *
   * @api private
   */
  _displayError(exitCode, code, message) {
    this._outputConfiguration.outputError(`${message}\n`, this._outputConfiguration.writeErr);
    if (typeof this._showHelpAfterError === 'string') {
      this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`);
    } else if (this._showHelpAfterError) {
      this._outputConfiguration.writeErr('\n');
      this.outputHelp({ error: true });
    }
    this._exit(exitCode, code, message);
  }

  /**
   * Apply any option related environment variables, if option does
   * not have a value from cli or client code.
   *
   * @api private
   */
  _parseOptionsEnv() {
    this.options.forEach((option) => {
      if (option.envVar && option.envVar in process.env) {
        const optionKey = option.attributeName();
        // Priority check. Do not overwrite cli or options from unknown source (client-code).
        if (this.getOptionValue(optionKey) === undefined || ['default', 'config', 'env'].includes(this.getOptionValueSource(optionKey))) {
          if (option.required || option.optional) { // option can take a value
            // keep very simple, optional always takes value
            this.emit(`optionEnv:${option.name()}`, process.env[option.envVar]);
          } else { // boolean
            // keep very simple, only care that envVar defined and not the value
            this.emit(`optionEnv:${option.name()}`);
          }
        }
      }
    });
  }

  /**
   * Argument `name` is missing.
   *
   * @param {string} name
   * @api private
   */

  missingArgument(name) {
    const message = `error: missing required argument '${name}'`;
    this._displayError(1, 'commander.missingArgument', message);
  };

  /**
   * `Option` is missing an argument.
   *
   * @param {Option} option
   * @api private
   */

  optionMissingArgument(option) {
    const message = `error: option '${option.flags}' argument missing`;
    this._displayError(1, 'commander.optionMissingArgument', message);
  };

  /**
   * `Option` does not have a value, and is a mandatory option.
   *
   * @param {Option} option
   * @api private
   */

  missingMandatoryOptionValue(option) {
    const message = `error: required option '${option.flags}' not specified`;
    this._displayError(1, 'commander.missingMandatoryOptionValue', message);
  };

  /**
   * Unknown option `flag`.
   *
   * @param {string} flag
   * @api private
   */

  unknownOption(flag) {
    if (this._allowUnknownOption) return;
    let suggestion = '';

    if (flag.startsWith('--') && this._showSuggestionAfterError) {
      // Looping to pick up the global options too
      let candidateFlags = [];
      let command = this;
      do {
        const moreFlags = command.createHelp().visibleOptions(command)
          .filter(option => option.long)
          .map(option => option.long);
        candidateFlags = candidateFlags.concat(moreFlags);
        command = command.parent;
      } while (command && !command._enablePositionalOptions);
      suggestion = suggestSimilar(flag, candidateFlags);
    }

    const message = `error: unknown option '${flag}'${suggestion}`;
    this._displayError(1, 'commander.unknownOption', message);
  };

  /**
   * Excess arguments, more than expected.
   *
   * @param {string[]} receivedArgs
   * @api private
   */

  _excessArguments(receivedArgs) {
    if (this._allowExcessArguments) return;

    const expected = this._args.length;
    const s = (expected === 1) ? '' : 's';
    const forSubcommand = this.parent ? ` for '${this.name()}'` : '';
    const message = `error: too many arguments${forSubcommand}. Expected ${expected} argument${s} but got ${receivedArgs.length}.`;
    this._displayError(1, 'commander.excessArguments', message);
  };

  /**
   * Unknown command.
   *
   * @api private
   */

  unknownCommand() {
    const unknownName = this.args[0];
    let suggestion = '';

    if (this._showSuggestionAfterError) {
      const candidateNames = [];
      this.createHelp().visibleCommands(this).forEach((command) => {
        candidateNames.push(command.name());
        // just visible alias
        if (command.alias()) candidateNames.push(command.alias());
      });
      suggestion = suggestSimilar(unknownName, candidateNames);
    }

    const message = `error: unknown command '${unknownName}'${suggestion}`;
    this._displayError(1, 'commander.unknownCommand', message);
  };

  /**
   * Set the program version to `str`.
   *
   * This method auto-registers the "-V, --version" flag
   * which will print the version number when passed.
   *
   * You can optionally supply the  flags and description to override the defaults.
   *
   * @param {string} str
   * @param {string} [flags]
   * @param {string} [description]
   * @return {this | string} `this` command for chaining, or version string if no arguments
   */

  version(str, flags, description) {
    if (str === undefined) return this._version;
    this._version = str;
    flags = flags || '-V, --version';
    description = description || 'output the version number';
    const versionOption = this.createOption(flags, description);
    this._versionOptionName = versionOption.attributeName();
    this.options.push(versionOption);
    this.on('option:' + versionOption.name(), () => {
      this._outputConfiguration.writeOut(`${str}\n`);
      this._exit(0, 'commander.version', str);
    });
    return this;
  };

  /**
   * Set the description to `str`.
   *
   * @param {string} [str]
   * @param {Object} [argsDescription]
   * @return {string|Command}
   */
  description(str, argsDescription) {
    if (str === undefined && argsDescription === undefined) return this._description;
    this._description = str;
    if (argsDescription) {
      this._argsDescription = argsDescription;
    }
    return this;
  };

  /**
   * Set an alias for the command.
   *
   * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.
   *
   * @param {string} [alias]
   * @return {string|Command}
   */

  alias(alias) {
    if (alias === undefined) return this._aliases[0]; // just return first, for backwards compatibility

    /** @type {Command} */
    let command = this;
    if (this.commands.length !== 0 && this.commands[this.commands.length - 1]._executableHandler) {
      // assume adding alias for last added executable subcommand, rather than this
      command = this.commands[this.commands.length - 1];
    }

    if (alias === command._name) throw new Error('Command alias can\'t be the same as its name');

    command._aliases.push(alias);
    return this;
  };

  /**
   * Set aliases for the command.
   *
   * Only the first alias is shown in the auto-generated help.
   *
   * @param {string[]} [aliases]
   * @return {string[]|Command}
   */

  aliases(aliases) {
    // Getter for the array of aliases is the main reason for having aliases() in addition to alias().
    if (aliases === undefined) return this._aliases;

    aliases.forEach((alias) => this.alias(alias));
    return this;
  };

  /**
   * Set / get the command usage `str`.
   *
   * @param {string} [str]
   * @return {String|Command}
   */

  usage(str) {
    if (str === undefined) {
      if (this._usage) return this._usage;

      const args = this._args.map((arg) => {
        return humanReadableArgName(arg);
      });
      return [].concat(
        (this.options.length || this._hasHelpOption ? '[options]' : []),
        (this.commands.length ? '[command]' : []),
        (this._args.length ? args : [])
      ).join(' ');
    }

    this._usage = str;
    return this;
  };

  /**
   * Get or set the name of the command
   *
   * @param {string} [str]
   * @return {string|Command}
   */

  name(str) {
    if (str === undefined) return this._name;
    this._name = str;
    return this;
  };

  /**
   * Return program help documentation.
   *
   * @param {{ error: boolean }} [contextOptions] - pass {error:true} to wrap for stderr instead of stdout
   * @return {string}
   */

  helpInformation(contextOptions) {
    const helper = this.createHelp();
    if (helper.helpWidth === undefined) {
      helper.helpWidth = (contextOptions && contextOptions.error) ? this._outputConfiguration.getErrHelpWidth() : this._outputConfiguration.getOutHelpWidth();
    }
    return helper.formatHelp(this, helper);
  };

  /**
   * @api private
   */

  _getHelpContext(contextOptions) {
    contextOptions = contextOptions || {};
    const context = { error: !!contextOptions.error };
    let write;
    if (context.error) {
      write = (arg) => this._outputConfiguration.writeErr(arg);
    } else {
      write = (arg) => this._outputConfiguration.writeOut(arg);
    }
    context.write = contextOptions.write || write;
    context.command = this;
    return context;
  }

  /**
   * Output help information for this command.
   *
   * Outputs built-in help, and custom text added using `.addHelpText()`.
   *
   * @param {{ error: boolean } | Function} [contextOptions] - pass {error:true} to write to stderr instead of stdout
   */

  outputHelp(contextOptions) {
    let deprecatedCallback;
    if (typeof contextOptions === 'function') {
      deprecatedCallback = contextOptions;
      contextOptions = undefined;
    }
    const context = this._getHelpContext(contextOptions);

    getCommandAndParents(this).reverse().forEach(command => command.emit('beforeAllHelp', context));
    this.emit('beforeHelp', context);

    let helpInformation = this.helpInformation(context);
    if (deprecatedCallback) {
      helpInformation = deprecatedCallback(helpInformation);
      if (typeof helpInformation !== 'string' && !Buffer.isBuffer(helpInformation)) {
        throw new Error('outputHelp callback must return a string or a Buffer');
      }
    }
    context.write(helpInformation);

    this.emit(this._helpLongFlag); // deprecated
    this.emit('afterHelp', context);
    getCommandAndParents(this).forEach(command => command.emit('afterAllHelp', context));
  };

  /**
   * You can pass in flags and a description to override the help
   * flags and help description for your command. Pass in false to
   * disable the built-in help option.
   *
   * @param {string | boolean} [flags]
   * @param {string} [description]
   * @return {Command} `this` command for chaining
   */

  helpOption(flags, description) {
    if (typeof flags === 'boolean') {
      this._hasHelpOption = flags;
      return this;
    }
    this._helpFlags = flags || this._helpFlags;
    this._helpDescription = description || this._helpDescription;

    const helpFlags = splitOptionFlags(this._helpFlags);
    this._helpShortFlag = helpFlags.shortFlag;
    this._helpLongFlag = helpFlags.longFlag;

    return this;
  };

  /**
   * Output help information and exit.
   *
   * Outputs built-in help, and custom text added using `.addHelpText()`.
   *
   * @param {{ error: boolean }} [contextOptions] - pass {error:true} to write to stderr instead of stdout
   */

  help(contextOptions) {
    this.outputHelp(contextOptions);
    let exitCode = process.exitCode || 0;
    if (exitCode === 0 && contextOptions && typeof contextOptions !== 'function' && contextOptions.error) {
      exitCode = 1;
    }
    // message: do not have all displayed text available so only passing placeholder.
    this._exit(exitCode, 'commander.help', '(outputHelp)');
  };

  /**
   * Add additional text to be displayed with the built-in help.
   *
   * Position is 'before' or 'after' to affect just this command,
   * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.
   *
   * @param {string} position - before or after built-in help
   * @param {string | Function} text - string to add, or a function returning a string
   * @return {Command} `this` command for chaining
   */
  addHelpText(position, text) {
    const allowedValues = ['beforeAll', 'before', 'after', 'afterAll'];
    if (!allowedValues.includes(position)) {
      throw new Error(`Unexpected value for position to addHelpText.
Expecting one of '${allowedValues.join("', '")}'`);
    }
    const helpEvent = `${position}Help`;
    this.on(helpEvent, (context) => {
      let helpStr;
      if (typeof text === 'function') {
        helpStr = text({ error: context.error, command: context.command });
      } else {
        helpStr = text;
      }
      // Ignore falsy value when nothing to output.
      if (helpStr) {
        context.write(`${helpStr}\n`);
      }
    });
    return this;
  }
};

/**
 * Output help information if help flags specified
 *
 * @param {Command} cmd - command to output help for
 * @param {Array} args - array of options to search for help flags
 * @api private
 */

function outputHelpIfRequested(cmd, args) {
  const helpOption = cmd._hasHelpOption && args.find(arg => arg === cmd._helpLongFlag || arg === cmd._helpShortFlag);
  if (helpOption) {
    cmd.outputHelp();
    // (Do not have all displayed text available so only passing placeholder.)
    cmd._exit(0, 'commander.helpDisplayed', '(outputHelp)');
  }
}

/**
 * Scan arguments and increment port number for inspect calls (to avoid conflicts when spawning new command).
 *
 * @param {string[]} args - array of arguments from node.execArgv
 * @returns {string[]}
 * @api private
 */

function incrementNodeInspectorPort(args) {
  // Testing for these options:
  //  --inspect[=[host:]port]
  //  --inspect-brk[=[host:]port]
  //  --inspect-port=[host:]port
  return args.map((arg) => {
    if (!arg.startsWith('--inspect')) {
      return arg;
    }
    let debugOption;
    let debugHost = '127.0.0.1';
    let debugPort = '9229';
    let match;
    if ((match = arg.match(/^(--inspect(-brk)?)$/)) !== null) {
      // e.g. --inspect
      debugOption = match[1];
    } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+)$/)) !== null) {
      debugOption = match[1];
      if (/^\d+$/.test(match[3])) {
        // e.g. --inspect=1234
        debugPort = match[3];
      } else {
        // e.g. --inspect=localhost
        debugHost = match[3];
      }
    } else if ((match = arg.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/)) !== null) {
      // e.g. --inspect=localhost:1234
      debugOption = match[1];
      debugHost = match[3];
      debugPort = match[4];
    }

    if (debugOption && debugPort !== '0') {
      return `${debugOption}=${debugHost}:${parseInt(debugPort) + 1}`;
    }
    return arg;
  });
}

/**
 * @param {Command} startCommand
 * @returns {Command[]}
 * @api private
 */

function getCommandAndParents(startCommand) {
  const result = [];
  for (let command = startCommand; command; command = command.parent) {
    result.push(command);
  }
  return result;
}

exports.Command = Command;
+Mx'// @ts-check

/**
 * CommanderError class
 * @class
 */
class CommanderError extends Error {
  /**
   * Constructs the CommanderError class
   * @param {number} exitCode suggested exit code which could be used with process.exit
   * @param {string} code an id string representing the error
   * @param {string} message human-readable description of the error
   * @constructor
   */
  constructor(exitCode, code, message) {
    super(message);
    // properly capture stack trace in Node.js
    Error.captureStackTrace(this, this.constructor);
    this.name = this.constructor.name;
    this.code = code;
    this.exitCode = exitCode;
    this.nestedError = undefined;
  }
}

/**
 * InvalidArgumentError class
 * @class
 */
class InvalidArgumentError extends CommanderError {
  /**
   * Constructs the InvalidArgumentError class
   * @param {string} [message] explanation of why argument is invalid
   * @constructor
   */
  constructor(message) {
    super(1, 'commander.invalidArgument', message);
    // properly capture stack trace in Node.js
    Error.captureStackTrace(this, this.constructor);
    this.name = this.constructor.name;
  }
}

exports.CommanderError = CommanderError;
exports.InvalidArgumentError = InvalidArgumentError;
bxq.const { humanReadableArgName } = require('./argument.js');

/**
 * TypeScript import types for JSDoc, used by Visual Studio Code IntelliSense and `npm run typescript-checkJS`
 * https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#import-types
 * @typedef { import("./argument.js").Argument } Argument
 * @typedef { import("./command.js").Command } Command
 * @typedef { import("./option.js").Option } Option
 */

// @ts-check

// Although this is a class, methods are static in style to allow override using subclass or just functions.
class Help {
  constructor() {
    this.helpWidth = undefined;
    this.sortSubcommands = false;
    this.sortOptions = false;
  }

  /**
   * Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one.
   *
   * @param {Command} cmd
   * @returns {Command[]}
   */

  visibleCommands(cmd) {
    const visibleCommands = cmd.commands.filter(cmd => !cmd._hidden);
    if (cmd._hasImplicitHelpCommand()) {
      // Create a command matching the implicit help command.
      const [, helpName, helpArgs] = cmd._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/);
      const helpCommand = cmd.createCommand(helpName)
        .helpOption(false);
      helpCommand.description(cmd._helpCommandDescription);
      if (helpArgs) helpCommand.arguments(helpArgs);
      visibleCommands.push(helpCommand);
    }
    if (this.sortSubcommands) {
      visibleCommands.sort((a, b) => {
        // @ts-ignore: overloaded return type
        return a.name().localeCompare(b.name());
      });
    }
    return visibleCommands;
  }

  /**
   * Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one.
   *
   * @param {Command} cmd
   * @returns {Option[]}
   */

  visibleOptions(cmd) {
    const visibleOptions = cmd.options.filter((option) => !option.hidden);
    // Implicit help
    const showShortHelpFlag = cmd._hasHelpOption && cmd._helpShortFlag && !cmd._findOption(cmd._helpShortFlag);
    const showLongHelpFlag = cmd._hasHelpOption && !cmd._findOption(cmd._helpLongFlag);
    if (showShortHelpFlag || showLongHelpFlag) {
      let helpOption;
      if (!showShortHelpFlag) {
        helpOption = cmd.createOption(cmd._helpLongFlag, cmd._helpDescription);
      } else if (!showLongHelpFlag) {
        helpOption = cmd.createOption(cmd._helpShortFlag, cmd._helpDescription);
      } else {
        helpOption = cmd.createOption(cmd._helpFlags, cmd._helpDescription);
      }
      visibleOptions.push(helpOption);
    }
    if (this.sortOptions) {
      const getSortKey = (option) => {
        // WYSIWYG for order displayed in help with short before long, no special handling for negated.
        return option.short ? option.short.replace(/^-/, '') : option.long.replace(/^--/, '');
      };
      visibleOptions.sort((a, b) => {
        return getSortKey(a).localeCompare(getSortKey(b));
      });
    }
    return visibleOptions;
  }

  /**
   * Get an array of the arguments if any have a description.
   *
   * @param {Command} cmd
   * @returns {Argument[]}
   */

  visibleArguments(cmd) {
    // Side effect! Apply the legacy descriptions before the arguments are displayed.
    if (cmd._argsDescription) {
      cmd._args.forEach(argument => {
        argument.description = argument.description || cmd._argsDescription[argument.name()] || '';
      });
    }

    // If there are any arguments with a description then return all the arguments.
    if (cmd._args.find(argument => argument.description)) {
      return cmd._args;
    };
    return [];
  }

  /**
   * Get the command term to show in the list of subcommands.
   *
   * @param {Command} cmd
   * @returns {string}
   */

  subcommandTerm(cmd) {
    // Legacy. Ignores custom usage string, and nested commands.
    const args = cmd._args.map(arg => humanReadableArgName(arg)).join(' ');
    return cmd._name +
      (cmd._aliases[0] ? '|' + cmd._aliases[0] : '') +
      (cmd.options.length ? ' [options]' : '') + // simplistic check for non-help option
      (args ? ' ' + args : '');
  }

  /**
   * Get the option term to show in the list of options.
   *
   * @param {Option} option
   * @returns {string}
   */

  optionTerm(option) {
    return option.flags;
  }

  /**
   * Get the argument term to show in the list of arguments.
   *
   * @param {Argument} argument
   * @returns {string}
   */

  argumentTerm(argument) {
    return argument.name();
  }

  /**
   * Get the longest command term length.
   *
   * @param {Command} cmd
   * @param {Help} helper
   * @returns {number}
   */

  longestSubcommandTermLength(cmd, helper) {
    return helper.visibleCommands(cmd).reduce((max, command) => {
      return Math.max(max, helper.subcommandTerm(command).length);
    }, 0);
  };

  /**
   * Get the longest option term length.
   *
   * @param {Command} cmd
   * @param {Help} helper
   * @returns {number}
   */

  longestOptionTermLength(cmd, helper) {
    return helper.visibleOptions(cmd).reduce((max, option) => {
      return Math.max(max, helper.optionTerm(option).length);
    }, 0);
  };

  /**
   * Get the longest argument term length.
   *
   * @param {Command} cmd
   * @param {Help} helper
   * @returns {number}
   */

  longestArgumentTermLength(cmd, helper) {
    return helper.visibleArguments(cmd).reduce((max, argument) => {
      return Math.max(max, helper.argumentTerm(argument).length);
    }, 0);
  };

  /**
   * Get the command usage to be displayed at the top of the built-in help.
   *
   * @param {Command} cmd
   * @returns {string}
   */

  commandUsage(cmd) {
    // Usage
    let cmdName = cmd._name;
    if (cmd._aliases[0]) {
      cmdName = cmdName + '|' + cmd._aliases[0];
    }
    let parentCmdNames = '';
    for (let parentCmd = cmd.parent; parentCmd; parentCmd = parentCmd.parent) {
      parentCmdNames = parentCmd.name() + ' ' + parentCmdNames;
    }
    return parentCmdNames + cmdName + ' ' + cmd.usage();
  }

  /**
   * Get the description for the command.
   *
   * @param {Command} cmd
   * @returns {string}
   */

  commandDescription(cmd) {
    // @ts-ignore: overloaded return type
    return cmd.description();
  }

  /**
   * Get the command description to show in the list of subcommands.
   *
   * @param {Command} cmd
   * @returns {string}
   */

  subcommandDescription(cmd) {
    // @ts-ignore: overloaded return type
    return cmd.description();
  }

  /**
   * Get the option description to show in the list of options.
   *
   * @param {Option} option
   * @return {string}
   */

  optionDescription(option) {
    const extraInfo = [];
    // Some of these do not make sense for negated boolean and suppress for backwards compatibility.

    if (option.argChoices && !option.negate) {
      extraInfo.push(
        // use stringify to match the display of the default value
        `choices: ${option.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`);
    }
    if (option.defaultValue !== undefined && !option.negate) {
      extraInfo.push(`default: ${option.defaultValueDescription || JSON.stringify(option.defaultValue)}`);
    }
    if (option.envVar !== undefined) {
      extraInfo.push(`env: ${option.envVar}`);
    }
    if (extraInfo.length > 0) {
      return `${option.description} (${extraInfo.join(', ')})`;
    }

    return option.description;
  };

  /**
   * Get the argument description to show in the list of arguments.
   *
   * @param {Argument} argument
   * @return {string}
   */

  argumentDescription(argument) {
    const extraInfo = [];
    if (argument.argChoices) {
      extraInfo.push(
        // use stringify to match the display of the default value
        `choices: ${argument.argChoices.map((choice) => JSON.stringify(choice)).join(', ')}`);
    }
    if (argument.defaultValue !== undefined) {
      extraInfo.push(`default: ${argument.defaultValueDescription || JSON.stringify(argument.defaultValue)}`);
    }
    if (extraInfo.length > 0) {
      const extraDescripton = `(${extraInfo.join(', ')})`;
      if (argument.description) {
        return `${argument.description} ${extraDescripton}`;
      }
      return extraDescripton;
    }
    return argument.description;
  }

  /**
   * Generate the built-in help text.
   *
   * @param {Command} cmd
   * @param {Help} helper
   * @returns {string}
   */

  formatHelp(cmd, helper) {
    const termWidth = helper.padWidth(cmd, helper);
    const helpWidth = helper.helpWidth || 80;
    const itemIndentWidth = 2;
    const itemSeparatorWidth = 2; // between term and description
    function formatItem(term, description) {
      if (description) {
        const fullText = `${term.padEnd(termWidth + itemSeparatorWidth)}${description}`;
        return helper.wrap(fullText, helpWidth - itemIndentWidth, termWidth + itemSeparatorWidth);
      }
      return term;
    };
    function formatList(textArray) {
      return textArray.join('\n').replace(/^/gm, ' '.repeat(itemIndentWidth));
    }

    // Usage
    let output = [`Usage: ${helper.commandUsage(cmd)}`, ''];

    // Description
    const commandDescription = helper.commandDescription(cmd);
    if (commandDescription.length > 0) {
      output = output.concat([commandDescription, '']);
    }

    // Arguments
    const argumentList = helper.visibleArguments(cmd).map((argument) => {
      return formatItem(helper.argumentTerm(argument), helper.argumentDescription(argument));
    });
    if (argumentList.length > 0) {
      output = output.concat(['Arguments:', formatList(argumentList), '']);
    }

    // Options
    const optionList = helper.visibleOptions(cmd).map((option) => {
      return formatItem(helper.optionTerm(option), helper.optionDescription(option));
    });
    if (optionList.length > 0) {
      output = output.concat(['Options:', formatList(optionList), '']);
    }

    // Commands
    const commandList = helper.visibleCommands(cmd).map((cmd) => {
      return formatItem(helper.subcommandTerm(cmd), helper.subcommandDescription(cmd));
    });
    if (commandList.length > 0) {
      output = output.concat(['Commands:', formatList(commandList), '']);
    }

    return output.join('\n');
  }

  /**
   * Calculate the pad width from the maximum term length.
   *
   * @param {Command} cmd
   * @param {Help} helper
   * @returns {number}
   */

  padWidth(cmd, helper) {
    return Math.max(
      helper.longestOptionTermLength(cmd, helper),
      helper.longestSubcommandTermLength(cmd, helper),
      helper.longestArgumentTermLength(cmd, helper)
    );
  };

  /**
   * Wrap the given string to width characters per line, with lines after the first indented.
   * Do not wrap if insufficient room for wrapping (minColumnWidth), or string is manually formatted.
   *
   * @param {string} str
   * @param {number} width
   * @param {number} indent
   * @param {number} [minColumnWidth=40]
   * @return {string}
   *
   */

  wrap(str, width, indent, minColumnWidth = 40) {
    // Detect manually wrapped and indented strings by searching for line breaks
    // followed by multiple spaces/tabs.
    if (str.match(/[\n]\s+/)) return str;
    // Do not wrap if not enough room for a wrapped column of text (as could end up with a word per line).
    const columnWidth = width - indent;
    if (columnWidth < minColumnWidth) return str;

    const leadingStr = str.substr(0, indent);
    const columnText = str.substr(indent);

    const indentString = ' '.repeat(indent);
    const regex = new RegExp('.{1,' + (columnWidth - 1) + '}([\\s\u200B]|$)|[^\\s\u200B]+?([\\s\u200B]|$)', 'g');
    const lines = columnText.match(regex) || [];
    return leadingStr + lines.map((line, i) => {
      if (line.slice(-1) === '\n') {
        line = line.slice(0, line.length - 1);
      }
      return ((i > 0) ? indentString : '') + line.trimRight();
    }).join('\n');
  }
}

exports.Help = Help;
}33xconst { InvalidArgumentError } = require('./error.js');

// @ts-check

class Option {
  /**
   * Initialize a new `Option` with the given `flags` and `description`.
   *
   * @param {string} flags
   * @param {string} [description]
   */

  constructor(flags, description) {
    this.flags = flags;
    this.description = description || '';

    this.required = flags.includes('<'); // A value must be supplied when the option is specified.
    this.optional = flags.includes('['); // A value is optional when the option is specified.
    // variadic test ignores <value,...> et al which might be used to describe custom splitting of single argument
    this.variadic = /\w\.\.\.[>\]]$/.test(flags); // The option can take multiple values.
    this.mandatory = false; // The option must have a value after parsing, which usually means it must be specified on command line.
    const optionFlags = splitOptionFlags(flags);
    this.short = optionFlags.shortFlag;
    this.long = optionFlags.longFlag;
    this.negate = false;
    if (this.long) {
      this.negate = this.long.startsWith('--no-');
    }
    this.defaultValue = undefined;
    this.defaultValueDescription = undefined;
    this.envVar = undefined;
    this.parseArg = undefined;
    this.hidden = false;
    this.argChoices = undefined;
  }

  /**
   * Set the default value, and optionally supply the description to be displayed in the help.
   *
   * @param {any} value
   * @param {string} [description]
   * @return {Option}
   */

  default(value, description) {
    this.defaultValue = value;
    this.defaultValueDescription = description;
    return this;
  };

  /**
   * Set environment variable to check for option value.
   * Priority order of option values is default < env < cli
   *
   * @param {string} name
   * @return {Option}
   */

  env(name) {
    this.envVar = name;
    return this;
  };

  /**
   * Set the custom handler for processing CLI option arguments into option values.
   *
   * @param {Function} [fn]
   * @return {Option}
   */

  argParser(fn) {
    this.parseArg = fn;
    return this;
  };

  /**
   * Whether the option is mandatory and must have a value after parsing.
   *
   * @param {boolean} [mandatory=true]
   * @return {Option}
   */

  makeOptionMandatory(mandatory = true) {
    this.mandatory = !!mandatory;
    return this;
  };

  /**
   * Hide option in help.
   *
   * @param {boolean} [hide=true]
   * @return {Option}
   */

  hideHelp(hide = true) {
    this.hidden = !!hide;
    return this;
  };

  /**
   * @api private
   */

  _concatValue(value, previous) {
    if (previous === this.defaultValue || !Array.isArray(previous)) {
      return [value];
    }

    return previous.concat(value);
  }

  /**
   * Only allow option value to be one of choices.
   *
   * @param {string[]} values
   * @return {Option}
   */

  choices(values) {
    this.argChoices = values;
    this.parseArg = (arg, previous) => {
      if (!values.includes(arg)) {
        throw new InvalidArgumentError(`Allowed choices are ${values.join(', ')}.`);
      }
      if (this.variadic) {
        return this._concatValue(arg, previous);
      }
      return arg;
    };
    return this;
  };

  /**
   * Return option name.
   *
   * @return {string}
   */

  name() {
    if (this.long) {
      return this.long.replace(/^--/, '');
    }
    return this.short.replace(/^-/, '');
  };

  /**
   * Return option name, in a camelcase format that can be used
   * as a object attribute key.
   *
   * @return {string}
   * @api private
   */

  attributeName() {
    return camelcase(this.name().replace(/^no-/, ''));
  };

  /**
   * Check if `arg` matches the short or long flag.
   *
   * @param {string} arg
   * @return {boolean}
   * @api private
   */

  is(arg) {
    return this.short === arg || this.long === arg;
  };
}

/**
 * Convert string from kebab-case to camelCase.
 *
 * @param {string} str
 * @return {string}
 * @api private
 */

function camelcase(str) {
  return str.split('-').reduce((str, word) => {
    return str + word[0].toUpperCase() + word.slice(1);
  });
}

/**
 * Split the short and long flag out of something like '-m,--mixed <value>'
 *
 * @api private
 */

function splitOptionFlags(flags) {
  let shortFlag;
  let longFlag;
  // Use original very loose parsing to maintain backwards compatibility for now,
  // which allowed for example unintended `-sw, --short-word` [sic].
  const flagParts = flags.split(/[ |,]+/);
  if (flagParts.length > 1 && !/^[[<]/.test(flagParts[1])) shortFlag = flagParts.shift();
  longFlag = flagParts.shift();
  // Add support for lone short flag without significantly changing parsing!
  if (!shortFlag && /^-[^-]$/.test(longFlag)) {
    shortFlag = longFlag;
    longFlag = undefined;
  }
  return { shortFlag, longFlag };
}

exports.Option = Option;
exports.splitOptionFlags = splitOptionFlags;
 x
2const maxDistance = 3;

function editDistance(a, b) {
  // https://en.wikipedia.org/wiki/Damerau–Levenshtein_distance
  // Calculating optimal string alignment distance, no substring is edited more than once.
  // (Simple implementation.)

  // Quick early exit, return worst case.
  if (Math.abs(a.length - b.length) > maxDistance) return Math.max(a.length, b.length);

  // distance between prefix substrings of a and b
  const d = [];

  // pure deletions turn a into empty string
  for (let i = 0; i <= a.length; i++) {
    d[i] = [i];
  }
  // pure insertions turn empty string into b
  for (let j = 0; j <= b.length; j++) {
    d[0][j] = j;
  }

  // fill matrix
  for (let j = 1; j <= b.length; j++) {
    for (let i = 1; i <= a.length; i++) {
      let cost = 1;
      if (a[i - 1] === b[j - 1]) {
        cost = 0;
      } else {
        cost = 1;
      }
      d[i][j] = Math.min(
        d[i - 1][j] + 1, // deletion
        d[i][j - 1] + 1, // insertion
        d[i - 1][j - 1] + cost // substitution
      );
      // transposition
      if (i > 1 && j > 1 && a[i - 1] === b[j - 2] && a[i - 2] === b[j - 1]) {
        d[i][j] = Math.min(d[i][j], d[i - 2][j - 2] + 1);
      }
    }
  }

  return d[a.length][b.length];
}

/**
 * Find close matches, restricted to same number of edits.
 *
 * @param {string} word
 * @param {string[]} candidates
 * @returns {string}
 */

function suggestSimilar(word, candidates) {
  if (!candidates || candidates.length === 0) return '';
  // remove possible duplicates
  candidates = Array.from(new Set(candidates));

  const searchingOptions = word.startsWith('--');
  if (searchingOptions) {
    word = word.slice(2);
    candidates = candidates.map(candidate => candidate.slice(2));
  }

  let similar = [];
  let bestDistance = maxDistance;
  const minSimilarity = 0.4;
  candidates.forEach((candidate) => {
    if (candidate.length <= 1) return; // no one character guesses

    const distance = editDistance(word, candidate);
    const length = Math.max(word.length, candidate.length);
    const similarity = (length - distance) / length;
    if (similarity > minSimilarity) {
      if (distance < bestDistance) {
        // better edit distance, throw away previous worse matches
        bestDistance = distance;
        similar = [candidate];
      } else if (distance === bestDistance) {
        similar.push(candidate);
      }
    }
  });

  similar.sort((a, b) => a.localeCompare(b));
  if (searchingOptions) {
    similar = similar.map(candidate => `--${candidate}`);
  }

  if (similar.length > 1) {
    return `\n(Did you mean one of ${similar.join(', ')}?)`;
  }
  if (similar.length === 1) {
    return `\n(Did you mean ${similar[0]}?)`;
  }
  return '';
}

exports.suggestSimilar = suggestSimilar;
+Sηx {
  "versions": [
    {
      "version": "*",
      "target": {
        "node": "supported"
      },
      "response": {
        "type": "time-permitting"
      },
      "backing": {
        "npm-funding": true
      }
    }
  ]
}
`9/px{
  "name": "commander",
  "version": "8.3.0",
  "description": "the complete solution for node.js command-line programs",
  "keywords": [
    "commander",
    "command",
    "option",
    "parser",
    "cli",
    "argument",
    "args",
    "argv"
  ],
  "author": "TJ Holowaychuk <tj@vision-media.ca>",
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "https://github.com/tj/commander.js.git"
  },
  "scripts": {
    "lint": "eslint index.js esm.mjs \"lib/*.js\" \"tests/**/*.js\"",
    "typescript-lint": "eslint typings/*.ts tests/*.ts",
    "test": "jest && npm run test-typings",
    "test-esm": "node --experimental-modules ./tests/esm-imports-test.mjs",
    "test-typings": "tsd",
    "typescript-checkJS": "tsc --allowJS --checkJS index.js lib/*.js --noEmit",
    "test-all": "npm run test && npm run lint && npm run typescript-lint && npm run typescript-checkJS && npm run test-esm"
  },
  "main": "./index.js",
  "files": [
    "index.js",
    "lib/*.js",
    "esm.mjs",
    "typings/index.d.ts",
    "package-support.json"
  ],
  "type": "commonjs",
  "dependencies": {},
  "devDependencies": {
    "@types/jest": "^26.0.23",
    "@types/node": "^14.17.3",
    "@typescript-eslint/eslint-plugin": "^4.27.0",
    "@typescript-eslint/parser": "^4.27.0",
    "eslint": "^7.29.0",
    "eslint-config-standard": "^16.0.3",
    "eslint-plugin-jest": "^24.3.6",
    "jest": "^27.0.4",
    "standard": "^16.0.3",
    "ts-jest": "^27.0.3",
    "tsd": "^0.17.0",
    "typescript": "^4.3.4"
  },
  "types": "typings/index.d.ts",
  "jest": {
    "testEnvironment": "node",
    "collectCoverage": true,
    "transform": {
      "^.+\\.tsx?$": "ts-jest"
    },
    "testPathIgnorePatterns": [
      "/node_modules/"
    ]
  },
  "engines": {
    "node": ">= 12"
  },
  "support": true
}
˦x& 100644 index.d.ts x2K{\PG/=lcxE_// Type definitions for commander
// Original definitions by: Alan Agius <https://github.com/alan-agius4>, Marcelo Dezem <https://github.com/mdezem>, vvakame <https://github.com/vvakame>, Jules Randolph <https://github.com/sveinburne>

// Using method rather than property for method-signature-style, to document method overloads separately. Allow either.
/* eslint-disable @typescript-eslint/method-signature-style */
/* eslint-disable @typescript-eslint/no-explicit-any */

export class CommanderError extends Error {
  code: string;
  exitCode: number;
  message: string;
  nestedError?: string;

  /**
   * Constructs the CommanderError class
   * @param exitCode - suggested exit code which could be used with process.exit
   * @param code - an id string representing the error
   * @param message - human-readable description of the error
   * @constructor
   */
  constructor(exitCode: number, code: string, message: string);
}

export class InvalidArgumentError extends CommanderError {
  /**
   * Constructs the InvalidArgumentError class
   * @param message - explanation of why argument is invalid
   * @constructor
   */
  constructor(message: string);
}
export { InvalidArgumentError as InvalidOptionArgumentError }; // deprecated old name

export class Argument {
  description: string;
  required: boolean;
  variadic: boolean;

  /**
   * Initialize a new command argument with the given name and description.
   * The default is that the argument is required, and you can explicitly
   * indicate this with <> around the name. Put [] around the name for an optional argument.
   */
  constructor(arg: string, description?: string);

  /**
   * Return argument name.
   */
  name(): string;

  /**
   * Set the default value, and optionally supply the description to be displayed in the help.
   */
  default(value: unknown, description?: string): this;

  /**
   * Set the custom handler for processing CLI command arguments into argument values.
   */
  argParser<T>(fn: (value: string, previous: T) => T): this;

  /**
   * Only allow argument value to be one of choices.
   */
  choices(values: string[]): this;

  /**
   * Make option-argument required.
   */
  argRequired(): this;

  /**
   * Make option-argument optional.
   */
  argOptional(): this;
  }

export class Option {
  flags: string;
  description: string;

  required: boolean; // A value must be supplied when the option is specified.
  optional: boolean; // A value is optional when the option is specified.
  variadic: boolean;
  mandatory: boolean; // The option must have a value after parsing, which usually means it must be specified on command line.
  optionFlags: string;
  short?: string;
  long?: string;
  negate: boolean;
  defaultValue?: any;
  defaultValueDescription?: string;
  parseArg?: <T>(value: string, previous: T) => T;
  hidden: boolean;
  argChoices?: string[];

  constructor(flags: string, description?: string);

  /**
   * Set the default value, and optionally supply the description to be displayed in the help.
   */
  default(value: unknown, description?: string): this;

  /**
   * Set environment variable to check for option value.
   * Priority order of option values is default < env < cli
   */
  env(name: string): this;

  /**
   * Calculate the full description, including defaultValue etc.
   */
  fullDescription(): string;

  /**
   * Set the custom handler for processing CLI option arguments into option values.
   */
  argParser<T>(fn: (value: string, previous: T) => T): this;

  /**
   * Whether the option is mandatory and must have a value after parsing.
   */
  makeOptionMandatory(mandatory?: boolean): this;

  /**
   * Hide option in help.
   */
  hideHelp(hide?: boolean): this;

  /**
   * Only allow option value to be one of choices.
   */
  choices(values: string[]): this;

  /**
   * Return option name.
   */
  name(): string;

  /**
   * Return option name, in a camelcase format that can be used
   * as a object attribute key.
   */
  attributeName(): string;
}

export class Help {
  /** output helpWidth, long lines are wrapped to fit */
  helpWidth?: number;
  sortSubcommands: boolean;
  sortOptions: boolean;

  constructor();

  /** Get the command term to show in the list of subcommands. */
  subcommandTerm(cmd: Command): string;
  /** Get the command description to show in the list of subcommands. */
  subcommandDescription(cmd: Command): string;
  /** Get the option term to show in the list of options. */
  optionTerm(option: Option): string;
  /** Get the option description to show in the list of options. */
  optionDescription(option: Option): string;
  /** Get the argument term to show in the list of arguments. */
  argumentTerm(argument: Argument): string;
  /** Get the argument description to show in the list of arguments. */
  argumentDescription(argument: Argument): string;

  /** Get the command usage to be displayed at the top of the built-in help. */
  commandUsage(cmd: Command): string;
  /** Get the description for the command. */
  commandDescription(cmd: Command): string;

  /** Get an array of the visible subcommands. Includes a placeholder for the implicit help command, if there is one. */
  visibleCommands(cmd: Command): Command[];
  /** Get an array of the visible options. Includes a placeholder for the implicit help option, if there is one. */
  visibleOptions(cmd: Command): Option[];
  /** Get an array of the arguments which have descriptions. */
  visibleArguments(cmd: Command): Argument[];

  /** Get the longest command term length. */
  longestSubcommandTermLength(cmd: Command, helper: Help): number;
  /** Get the longest option term length. */
  longestOptionTermLength(cmd: Command, helper: Help): number;
  /** Get the longest argument term length. */
  longestArgumentTermLength(cmd: Command, helper: Help): number;
  /** Calculate the pad width from the maximum term length. */
  padWidth(cmd: Command, helper: Help): number;

  /**
   * Wrap the given string to width characters per line, with lines after the first indented.
   * Do not wrap if insufficient room for wrapping (minColumnWidth), or string is manually formatted.
   */
  wrap(str: string, width: number, indent: number, minColumnWidth?: number): string;

  /** Generate the built-in help text. */
  formatHelp(cmd: Command, helper: Help): string;
}
export type HelpConfiguration = Partial<Help>;

export interface ParseOptions {
  from: 'node' | 'electron' | 'user';
}
export interface HelpContext { // optional parameter for .help() and .outputHelp()
  error: boolean;
}
export interface AddHelpTextContext { // passed to text function used with .addHelpText()
  error: boolean;
  command: Command;
}
export interface OutputConfiguration {
  writeOut?(str: string): void;
  writeErr?(str: string): void;
  getOutHelpWidth?(): number;
  getErrHelpWidth?(): number;
  outputError?(str: string, write: (str: string) => void): void;

}

export type AddHelpTextPosition = 'beforeAll' | 'before' | 'after' | 'afterAll';
export type HookEvent = 'preAction' | 'postAction';
export type OptionValueSource = 'default' | 'env' | 'config' | 'cli';

export interface OptionValues {
  [key: string]: any;
}

export class Command {
  args: string[];
  processedArgs: any[];
  commands: Command[];
  parent: Command | null;

  constructor(name?: string);

  /**
   * Set the program version to `str`.
   *
   * This method auto-registers the "-V, --version" flag
   * which will print the version number when passed.
   *
   * You can optionally supply the  flags and description to override the defaults.
   */
  version(str: string, flags?: string, description?: string): this;

  /**
   * Define a command, implemented using an action handler.
   *
   * @remarks
   * The command description is supplied using `.description`, not as a parameter to `.command`.
   *
   * @example
   * ```ts
   * program
   *   .command('clone <source> [destination]')
   *   .description('clone a repository into a newly created directory')
   *   .action((source, destination) => {
   *     console.log('clone command called');
   *   });
   * ```
   *
   * @param nameAndArgs - command name and arguments, args are  `<required>` or `[optional]` and last may also be `variadic...`
   * @param opts - configuration options
   * @returns new command
   */
  command(nameAndArgs: string, opts?: CommandOptions): ReturnType<this['createCommand']>;
  /**
   * Define a command, implemented in a separate executable file.
   *
   * @remarks
   * The command description is supplied as the second parameter to `.command`.
   *
   * @example
   * ```ts
   *  program
   *    .command('start <service>', 'start named service')
   *    .command('stop [service]', 'stop named service, or all if no name supplied');
   * ```
   *
   * @param nameAndArgs - command name and arguments, args are  `<required>` or `[optional]` and last may also be `variadic...`
   * @param description - description of executable command
   * @param opts - configuration options
   * @returns `this` command for chaining
   */
  command(nameAndArgs: string, description: string, opts?: ExecutableCommandOptions): this;

  /**
   * Factory routine to create a new unattached command.
   *
   * See .command() for creating an attached subcommand, which uses this routine to
   * create the command. You can override createCommand to customise subcommands.
   */
  createCommand(name?: string): Command;

  /**
   * Add a prepared subcommand.
   *
   * See .command() for creating an attached subcommand which inherits settings from its parent.
   *
   * @returns `this` command for chaining
   */
  addCommand(cmd: Command, opts?: CommandOptions): this;

  /**
   * Factory routine to create a new unattached argument.
   *
   * See .argument() for creating an attached argument, which uses this routine to
   * create the argument. You can override createArgument to return a custom argument.
   */
  createArgument(name: string, description?: string): Argument;

  /**
   * Define argument syntax for command.
   *
   * The default is that the argument is required, and you can explicitly
   * indicate this with <> around the name. Put [] around the name for an optional argument.
   *
   * @example
   * ```
   * program.argument('<input-file>');
   * program.argument('[output-file]');
   * ```
   *
   * @returns `this` command for chaining
   */
    argument<T>(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): this;
    argument(name: string, description?: string, defaultValue?: unknown): this;

  /**
   * Define argument syntax for command, adding a prepared argument.
   *
   * @returns `this` command for chaining
   */
  addArgument(arg: Argument): this;

  /**
   * Define argument syntax for command, adding multiple at once (without descriptions).
   *
   * See also .argument().
   *
   * @example
   * ```
   * program.arguments('<cmd> [env]');
   * ```
   *
   * @returns `this` command for chaining
   */
  arguments(names: string): this;

  /**
   * Override default decision whether to add implicit help command.
   *
   * @example
   * ```
   * addHelpCommand() // force on
   * addHelpCommand(false); // force off
   * addHelpCommand('help [cmd]', 'display help for [cmd]'); // force on with custom details
   * ```
   *
   * @returns `this` command for chaining
   */
  addHelpCommand(enableOrNameAndArgs?: string | boolean, description?: string): this;

  /**
   * Add hook for life cycle event.
   */
  hook(event: HookEvent, listener: (thisCommand: Command, actionCommand: Command) => void | Promise<void>): this;

  /**
   * Register callback to use as replacement for calling process.exit.
   */
  exitOverride(callback?: (err: CommanderError) => never|void): this;

  /**
   * You can customise the help with a subclass of Help by overriding createHelp,
   * or by overriding Help properties using configureHelp().
   */
  createHelp(): Help;

  /**
   * You can customise the help by overriding Help properties using configureHelp(),
   * or with a subclass of Help by overriding createHelp().
   */
  configureHelp(configuration: HelpConfiguration): this;
  /** Get configuration */
  configureHelp(): HelpConfiguration;

  /**
   * The default output goes to stdout and stderr. You can customise this for special
   * applications. You can also customise the display of errors by overriding outputError.
   *
   * The configuration properties are all functions:
   * ```
   * // functions to change where being written, stdout and stderr
   * writeOut(str)
   * writeErr(str)
   * // matching functions to specify width for wrapping help
   * getOutHelpWidth()
   * getErrHelpWidth()
   * // functions based on what is being written out
   * outputError(str, write) // used for displaying errors, and not used for displaying help
   * ```
   */
  configureOutput(configuration: OutputConfiguration): this;
  /** Get configuration */
  configureOutput(): OutputConfiguration;

  /**
   * Copy settings that are useful to have in common across root command and subcommands.
   *
   * (Used internally when adding a command using `.command()` so subcommands inherit parent settings.)
   */
  copyInheritedSettings(sourceCommand: Command): this;

  /**
   * Display the help or a custom message after an error occurs.
   */
  showHelpAfterError(displayHelp?: boolean | string): this;

  /**
   * Display suggestion of similar commands for unknown commands, or options for unknown options.
   */
  showSuggestionAfterError(displaySuggestion?: boolean): this;

   /**
   * Register callback `fn` for the command.
   *
   * @example
   * ```
   * program
   *   .command('serve')
   *   .description('start service')
   *   .action(function() {
   *     // do work here
   *   });
   * ```
   *
   * @returns `this` command for chaining
   */
  action(fn: (...args: any[]) => void | Promise<void>): this;

  /**
   * Define option with `flags`, `description` and optional
   * coercion `fn`.
   *
   * The `flags` string contains the short and/or long flags,
   * separated by comma, a pipe or space. The following are all valid
   * all will output this way when `--help` is used.
   *
   *     "-p, --pepper"
   *     "-p|--pepper"
   *     "-p --pepper"
   *
   * @example
   * ```
   * // simple boolean defaulting to false
   *  program.option('-p, --pepper', 'add pepper');
   *
   *  --pepper
   *  program.pepper
   *  // => Boolean
   *
   *  // simple boolean defaulting to true
   *  program.option('-C, --no-cheese', 'remove cheese');
   *
   *  program.cheese
   *  // => true
   *
   *  --no-cheese
   *  program.cheese
   *  // => false
   *
   *  // required argument
   *  program.option('-C, --chdir <path>', 'change the working directory');
   *
   *  --chdir /tmp
   *  program.chdir
   *  // => "/tmp"
   *
   *  // optional argument
   *  program.option('-c, --cheese [type]', 'add cheese [marble]');
   * ```
   *
   * @returns `this` command for chaining
   */
  option(flags: string, description?: string, defaultValue?: string | boolean): this;
  option<T>(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): this;
  /** @deprecated since v7, instead use choices or a custom function */
  option(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean): this;

  /**
   * Define a required option, which must have a value after parsing. This usually means
   * the option must be specified on the command line. (Otherwise the same as .option().)
   *
   * The `flags` string contains the short and/or long flags, separated by comma, a pipe or space.
   */
  requiredOption(flags: string, description?: string, defaultValue?: string | boolean): this;
  requiredOption<T>(flags: string, description: string, fn: (value: string, previous: T) => T, defaultValue?: T): this;
  /** @deprecated since v7, instead use choices or a custom function */
  requiredOption(flags: string, description: string, regexp: RegExp, defaultValue?: string | boolean): this;

  /**
   * Factory routine to create a new unattached option.
   *
   * See .option() for creating an attached option, which uses this routine to
   * create the option. You can override createOption to return a custom option.
   */

  createOption(flags: string, description?: string): Option;

  /**
   * Add a prepared Option.
   *
   * See .option() and .requiredOption() for creating and attaching an option in a single call.
   */
  addOption(option: Option): this;

  /**
   * Whether to store option values as properties on command object,
   * or store separately (specify false). In both cases the option values can be accessed using .opts().
   *
   * @returns `this` command for chaining
   */
  storeOptionsAsProperties<T extends OptionValues>(): this & T;
  storeOptionsAsProperties<T extends OptionValues>(storeAsProperties: true): this & T;
  storeOptionsAsProperties(storeAsProperties?: boolean): this;

  /**
   * Retrieve option value.
   */
  getOptionValue(key: string): any;

  /**
   * Store option value.
   */
  setOptionValue(key: string, value: unknown): this;

  /**
   * Store option value and where the value came from.
   */
  setOptionValueWithSource(key: string, value: unknown, source: OptionValueSource): this;

  /**
   * Retrieve option value source.
   */
  getOptionValueSource(key: string): OptionValueSource;

   /**
   * Alter parsing of short flags with optional values.
   *
   * @example
   * ```
   * // for `.option('-f,--flag [value]'):
   * .combineFlagAndOptionalValue(true)  // `-f80` is treated like `--flag=80`, this is the default behaviour
   * .combineFlagAndOptionalValue(false) // `-fb` is treated like `-f -b`
   * ```
   *
   * @returns `this` command for chaining
   */
  combineFlagAndOptionalValue(combine?: boolean): this;

  /**
   * Allow unknown options on the command line.
   *
   * @returns `this` command for chaining
   */
  allowUnknownOption(allowUnknown?: boolean): this;

  /**
   * Allow excess command-arguments on the command line. Pass false to make excess arguments an error.
   *
   * @returns `this` command for chaining
   */
  allowExcessArguments(allowExcess?: boolean): this;

  /**
   * Enable positional options. Positional means global options are specified before subcommands which lets
   * subcommands reuse the same option names, and also enables subcommands to turn on passThroughOptions.
   *
   * The default behaviour is non-positional and global options may appear anywhere on the command line.
   *
   * @returns `this` command for chaining
   */
  enablePositionalOptions(positional?: boolean): this;

  /**
   * Pass through options that come after command-arguments rather than treat them as command-options,
   * so actual command-options come before command-arguments. Turning this on for a subcommand requires
   * positional options to have been enabled on the program (parent commands).
   *
   * The default behaviour is non-positional and options may appear before or after command-arguments.
   *
   * @returns `this` command for chaining
   */
  passThroughOptions(passThrough?: boolean): this;

  /**
   * Parse `argv`, setting options and invoking commands when defined.
   *
   * The default expectation is that the arguments are from node and have the application as argv[0]
   * and the script being run in argv[1], with user parameters after that.
   *
   * @example
   * ```
   * program.parse(process.argv);
   * program.parse(); // implicitly use process.argv and auto-detect node vs electron conventions
   * program.parse(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
   * ```
   *
   * @returns `this` command for chaining
   */
  parse(argv?: string[], options?: ParseOptions): this;

  /**
   * Parse `argv`, setting options and invoking commands when defined.
   *
   * Use parseAsync instead of parse if any of your action handlers are async. Returns a Promise.
   *
   * The default expectation is that the arguments are from node and have the application as argv[0]
   * and the script being run in argv[1], with user parameters after that.
   *
   * @example
   * ```
   * program.parseAsync(process.argv);
   * program.parseAsync(); // implicitly use process.argv and auto-detect node vs electron conventions
   * program.parseAsync(my-args, { from: 'user' }); // just user supplied arguments, nothing special about argv[0]
   * ```
   *
   * @returns Promise
   */
  parseAsync(argv?: string[], options?: ParseOptions): Promise<this>;

  /**
   * Parse options from `argv` removing known options,
   * and return argv split into operands and unknown arguments.
   *
   *     argv => operands, unknown
   *     --known kkk op => [op], []
   *     op --known kkk => [op], []
   *     sub --unknown uuu op => [sub], [--unknown uuu op]
   *     sub -- --unknown uuu op => [sub --unknown uuu op], []
   */
  parseOptions(argv: string[]): ParseOptionsResult;

  /**
   * Return an object containing options as key-value pairs
   */
  opts<T extends OptionValues>(): T;

  /**
   * Set the description.
   *
   * @returns `this` command for chaining
   */

  description(str: string): this;
  /** @deprecated since v8, instead use .argument to add command argument with description */
  description(str: string, argsDescription: {[argName: string]: string}): this;
  /**
   * Get the description.
   */
  description(): string;

  /**
   * Set an alias for the command.
   *
   * You may call more than once to add multiple aliases. Only the first alias is shown in the auto-generated help.
   *
   * @returns `this` command for chaining
   */
  alias(alias: string): this;
  /**
   * Get alias for the command.
   */
  alias(): string;

  /**
   * Set aliases for the command.
   *
   * Only the first alias is shown in the auto-generated help.
   *
   * @returns `this` command for chaining
   */
  aliases(aliases: string[]): this;
  /**
   * Get aliases for the command.
   */
  aliases(): string[];

  /**
   * Set the command usage.
   *
   * @returns `this` command for chaining
   */
  usage(str: string): this;
  /**
   * Get the command usage.
   */
  usage(): string;

  /**
   * Set the name of the command.
   *
   * @returns `this` command for chaining
   */
  name(str: string): this;
  /**
   * Get the name of the command.
   */
  name(): string;

  /**
   * Output help information for this command.
   *
   * Outputs built-in help, and custom text added using `.addHelpText()`.
   *
   */
  outputHelp(context?: HelpContext): void;
  /** @deprecated since v7 */
  outputHelp(cb?: (str: string) => string): void;

  /**
   * Return command help documentation.
   */
  helpInformation(context?: HelpContext): string;

  /**
   * You can pass in flags and a description to override the help
   * flags and help description for your command. Pass in false
   * to disable the built-in help option.
   */
  helpOption(flags?: string | boolean, description?: string): this;

  /**
   * Output help information and exit.
   *
   * Outputs built-in help, and custom text added using `.addHelpText()`.
   */
  help(context?: HelpContext): never;
  /** @deprecated since v7 */
  help(cb?: (str: string) => string): never;

  /**
   * Add additional text to be displayed with the built-in help.
   *
   * Position is 'before' or 'after' to affect just this command,
   * and 'beforeAll' or 'afterAll' to affect this command and all its subcommands.
   */
  addHelpText(position: AddHelpTextPosition, text: string): this;
  addHelpText(position: AddHelpTextPosition, text: (context: AddHelpTextContext) => string): this;

  /**
   * Add a listener (callback) for when events occur. (Implemented using EventEmitter.)
   */
  on(event: string | symbol, listener: (...args: any[]) => void): this;
}

export interface CommandOptions {
  hidden?: boolean;
  isDefault?: boolean;
  /** @deprecated since v7, replaced by hidden */
  noHelp?: boolean;
}
export interface ExecutableCommandOptions extends CommandOptions {
  executableFile?: string;
}

export interface ParseOptionsResult {
  operands: string[];
  unknown: string[];
}

export function createCommand(name?: string): Command;
export function createOption(flags: string, description?: string): Option;
export function createArgument(name: string, description?: string): Argument;

export const program: Command;
(Nx M100644 LICENSE Qڞf Q100644 README.md %+Q⟸-100644 index.js U	t,P
fP740000 lib iv3v6YXIC100644 package.json $L JkI XHwxN ((8 Made With MOXY Lda <hello@moxy.studio>@
all C
THE SOFTWARE.
.+x# cross-spawn

[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Build status][appveyor-image]][appveyor-url]

[npm-url]:https://npmjs.org/package/cross-spawn
[downloads-image]:https://img.shields.io/npm/dm/cross-spawn.svg
[npm-image]:https://img.shields.io/npm/v/cross-spawn.svg
[ci-url]:https://github.com/moxystudio/node-cross-spawn/actions/workflows/ci.yaml
[ci-image]:https://github.com/moxystudio/node-cross-spawn/actions/workflows/ci.yaml/badge.svg
[appveyor-url]:https://ci.appveyor.com/project/satazor/node-cross-spawn
[appveyor-image]:https://img.shields.io/appveyor/ci/satazor/node-cross-spawn/master.svg

A cross platform solution to node's spawn and spawnSync.

## Installation

Node.js version 8 and up:
`$ npm install cross-spawn`

Node.js version 7 and under:
`$ npm install cross-spawn@6`

## Why

Node has issues when using spawn on Windows:

- It ignores [PATHEXT](https://github.com/joyent/node/issues/2318)
- It does not support [shebangs](https://en.wikipedia.org/wiki/Shebang_(Unix))
- Has problems running commands with [spaces](https://github.com/nodejs/node/issues/7367)
- Has problems running commands with posix relative paths (e.g.: `./my-folder/my-executable`)
- Has an [issue](https://github.com/moxystudio/node-cross-spawn/issues/82) with command shims (files in `node_modules/.bin/`), where arguments with quotes and parenthesis would result in [invalid syntax error](https://github.com/moxystudio/node-cross-spawn/blob/e77b8f22a416db46b6196767bcd35601d7e11d54/test/index.test.js#L149)
- No `options.shell` support on node `<v4.8`

All these issues are handled correctly by `cross-spawn`.
There are some known modules, such as [win-spawn](https://github.com/ForbesLindesay/win-spawn), that try to solve this but they are either broken or provide faulty escaping of shell arguments.


## Usage

Exactly the same way as node's [`spawn`](https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options) or [`spawnSync`](https://nodejs.org/api/child_process.html#child_process_child_process_spawnsync_command_args_options), so it's a drop in replacement.


```js
const spawn = require('cross-spawn');

// Spawn NPM asynchronously
const child = spawn('npm', ['list', '-g', '-depth', '0'], { stdio: 'inherit' });

// Spawn NPM synchronously
const result = spawn.sync('npm', ['list', '-g', '-depth', '0'], { stdio: 'inherit' });
```


## Caveats

### Using `options.shell` as an alternative to `cross-spawn`

Starting from node `v4.8`, `spawn` has a `shell` option that allows you run commands from within a shell. This new option solves
the [PATHEXT](https://github.com/joyent/node/issues/2318) issue but:

- It's not supported in node `<v4.8`
- You must manually escape the command and arguments which is very error prone, specially when passing user input
- There are a lot of other unresolved issues from the [Why](#why) section that you must take into account

If you are using the `shell` option to spawn a command in a cross platform way, consider using `cross-spawn` instead. You have been warned.

### `options.shell` support

While `cross-spawn` adds support for `options.shell` in node `<v4.8`, all of its enhancements are disabled.

This mimics the Node.js behavior. More specifically, the command and its arguments will not be automatically escaped nor shebang support will be offered. This is by design because if you are using `options.shell` you are probably targeting a specific platform anyway and you don't want things to get into your way.

### Shebangs support

While `cross-spawn` handles shebangs on Windows, its support is limited. More specifically, it just supports `#!/usr/bin/env <program>` where `<program>` must not contain any arguments.   
If you would like to have the shebang support improved, feel free to contribute via a pull-request.

Remember to always test your code on Windows!


## Tests

`$ npm test`   
`$ npm test -- --watch` during development


## License

Released under the [MIT License](https://www.opensource.org/licenses/mit-license.php).
ùJxW'use strict';

const cp = require('child_process');
const parse = require('./lib/parse');
const enoent = require('./lib/enoent');

function spawn(command, args, options) {
    // Parse the arguments
    const parsed = parse(command, args, options);

    // Spawn the child process
    const spawned = cp.spawn(parsed.command, parsed.args, parsed.options);

    // Hook into child process "exit" event to emit an error if the command
    // does not exists, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
    enoent.hookChildProcess(spawned, parsed);

    return spawned;
}

function spawnSync(command, args, options) {
    // Parse the arguments
    const parsed = parse(command, args, options);

    // Spawn the child process
    const result = cp.spawnSync(parsed.command, parsed.args, parsed.options);

    // Analyze if the command does not exist, see: https://github.com/IndigoUnited/node-cross-spawn/issues/16
    result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);

    return result;
}

module.exports = spawn;
module.exports.spawn = spawn;
module.exports.sync = spawnSync;

module.exports._parse = parse;
module.exports._enoent = enoent;
	xh 100644 enoent.js 3Gi?@B3100644 parse.js )Gt^NY40000 util ^_n?,w )x[x@'use strict';

const isWin = process.platform === 'win32';

function notFoundError(original, syscall) {
    return Object.assign(new Error(`${syscall} ${original.command} ENOENT`), {
        code: 'ENOENT',
        errno: 'ENOENT',
        syscall: `${syscall} ${original.command}`,
        path: original.command,
        spawnargs: original.args,
    });
}

function hookChildProcess(cp, parsed) {
    if (!isWin) {
        return;
    }

    const originalEmit = cp.emit;

    cp.emit = function (name, arg1) {
        // If emitting "exit" event and exit code is 1, we need to check if
        // the command exists and emit an "error" instead
        // See https://github.com/IndigoUnited/node-cross-spawn/issues/16
        if (name === 'exit') {
            const err = verifyENOENT(arg1, parsed);

            if (err) {
                return originalEmit.call(cp, 'error', err);
            }
        }

        return originalEmit.apply(cp, arguments); // eslint-disable-line prefer-rest-params
    };
}

function verifyENOENT(status, parsed) {
    if (isWin && status === 1 && !parsed.file) {
        return notFoundError(parsed.original, 'spawn');
    }

    return null;
}

function verifyENOENTSync(status, parsed) {
    if (isWin && status === 1 && !parsed.file) {
        return notFoundError(parsed.original, 'spawnSync');
    }

    return null;
}

module.exports = {
    hookChildProcess,
    verifyENOENT,
    verifyENOENTSync,
    notFoundError,
};
*Ĺx'use strict';

const path = require('path');
const resolveCommand = require('./util/resolveCommand');
const escape = require('./util/escape');
const readShebang = require('./util/readShebang');

const isWin = process.platform === 'win32';
const isExecutableRegExp = /\.(?:com|exe)$/i;
const isCmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;

function detectShebang(parsed) {
    parsed.file = resolveCommand(parsed);

    const shebang = parsed.file && readShebang(parsed.file);

    if (shebang) {
        parsed.args.unshift(parsed.file);
        parsed.command = shebang;

        return resolveCommand(parsed);
    }

    return parsed.file;
}

function parseNonShell(parsed) {
    if (!isWin) {
        return parsed;
    }

    // Detect & add support for shebangs
    const commandFile = detectShebang(parsed);

    // We don't need a shell if the command filename is an executable
    const needsShell = !isExecutableRegExp.test(commandFile);

    // If a shell is required, use cmd.exe and take care of escaping everything correctly
    // Note that `forceShell` is an hidden option used only in tests
    if (parsed.options.forceShell || needsShell) {
        // Need to double escape meta chars if the command is a cmd-shim located in `node_modules/.bin/`
        // The cmd-shim simply calls execute the package bin file with NodeJS, proxying any argument
        // Because the escape of metachars with ^ gets interpreted when the cmd.exe is first called,
        // we need to double escape them
        const needsDoubleEscapeMetaChars = isCmdShimRegExp.test(commandFile);

        // Normalize posix paths into OS compatible paths (e.g.: foo/bar -> foo\bar)
        // This is necessary otherwise it will always fail with ENOENT in those cases
        parsed.command = path.normalize(parsed.command);

        // Escape command & arguments
        parsed.command = escape.command(parsed.command);
        parsed.args = parsed.args.map((arg) => escape.argument(arg, needsDoubleEscapeMetaChars));

        const shellCommand = [parsed.command].concat(parsed.args).join(' ');

        parsed.args = ['/d', '/s', '/c', `"${shellCommand}"`];
        parsed.command = process.env.comspec || 'cmd.exe';
        parsed.options.windowsVerbatimArguments = true; // Tell node's spawn that the arguments are already escaped
    }

    return parsed;
}

function parse(command, args, options) {
    // Normalize arguments, similar to nodejs
    if (args && !Array.isArray(args)) {
        options = args;
        args = null;
    }

    args = args ? args.slice(0) : []; // Clone array to avoid changing the original
    options = Object.assign({}, options); // Clone object to avoid changing the original

    // Build our parsed object
    const parsed = {
        command,
        args,
        options,
        file: undefined,
        original: {
            command,
            args,
        },
    };

    // Delegate further parsing to shell or non-shell
    return options.shell ? parsed : parseNonShell(parsed);
}

module.exports = parse;
٬x| 100644 escape.js {\5QtTfQ100644 readShebang.js ^s?&#eB+100644 resolveCommand.js yrEPQʚ#*31Vxg'use strict';

// See http://www.robvanderwoude.com/escapechars.php
const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;

function escapeCommand(arg) {
    // Escape meta chars
    arg = arg.replace(metaCharsRegExp, '^$1');

    return arg;
}

function escapeArgument(arg, doubleEscapeMetaChars) {
    // Convert to string
    arg = `${arg}`;

    // Algorithm below is based on https://qntm.org/cmd
    // It's slightly altered to disable JS backtracking to avoid hanging on specially crafted input
    // Please see https://github.com/moxystudio/node-cross-spawn/pull/160 for more information

    // Sequence of backslashes followed by a double quote:
    // double up all the backslashes and escape the double quote
    arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');

    // Sequence of backslashes followed by the end of the string
    // (which will become a double quote later):
    // double up all the backslashes
    arg = arg.replace(/(?=(\\+?)?)\1$/, '$1$1');

    // All other backslashes occur literally

    // Quote the whole thing:
    arg = `"${arg}"`;

    // Escape meta chars
    arg = arg.replace(metaCharsRegExp, '^$1');

    // Double escape meta chars if necessary
    if (doubleEscapeMetaChars) {
        arg = arg.replace(metaCharsRegExp, '^$1');
    }

    return arg;
}

module.exports.command = escapeCommand;
module.exports.argument = escapeArgument;
_"x%'use strict';

const fs = require('fs');
const shebangCommand = require('shebang-command');

function readShebang(command) {
    // Read the first 150 bytes from the file
    const size = 150;
    const buffer = Buffer.alloc(size);

    let fd;

    try {
        fd = fs.openSync(command, 'r');
        fs.readSync(fd, buffer, 0, size, 0);
        fs.closeSync(fd);
    } catch (e) { /* Empty */ }

    // Attempt to extract shebang (null is returned if not a shebang)
    return shebangCommand(buffer.toString());
}

module.exports = readShebang;
تax'use strict';

const path = require('path');
const which = require('which');
const getPathKey = require('path-key');

function resolveCommandAttempt(parsed, withoutPathExt) {
    const env = parsed.options.env || process.env;
    const cwd = process.cwd();
    const hasCustomCwd = parsed.options.cwd != null;
    // Worker threads do not have process.chdir()
    const shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined && !process.chdir.disabled;

    // If a custom `cwd` was specified, we need to change the process cwd
    // because `which` will do stat calls but does not support a custom cwd
    if (shouldSwitchCwd) {
        try {
            process.chdir(parsed.options.cwd);
        } catch (err) {
            /* Empty */
        }
    }

    let resolved;

    try {
        resolved = which.sync(parsed.command, {
            path: env[getPathKey({ env })],
            pathExt: withoutPathExt ? path.delimiter : undefined,
        });
    } catch (e) {
        /* Empty */
    } finally {
        if (shouldSwitchCwd) {
            process.chdir(cwd);
        }
    }

    // If we successfully resolved, ensure that an absolute path is returned
    // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
    if (resolved) {
        resolved = path.resolve(hasCustomCwd ? parsed.options.cwd : '', resolved);
    }

    return resolved;
}

function resolveCommand(parsed) {
    return resolveCommandAttempt(parsed) || resolveCommandAttempt(parsed, true);
}

module.exports = resolveCommand;
Aķgxw{
  "name": "cross-spawn",
  "version": "7.0.6",
  "description": "Cross platform child_process#spawn and child_process#spawnSync",
  "keywords": [
    "spawn",
    "spawnSync",
    "windows",
    "cross-platform",
    "path-ext",
    "shebang",
    "cmd",
    "execute"
  ],
  "author": "André Cruz <andre@moxy.studio>",
  "homepage": "https://github.com/moxystudio/node-cross-spawn",
  "repository": {
    "type": "git",
    "url": "git@github.com:moxystudio/node-cross-spawn.git"
  },
  "license": "MIT",
  "main": "index.js",
  "files": [
    "lib"
  ],
  "scripts": {
    "lint": "eslint .",
    "test": "jest --env node --coverage",
    "prerelease": "npm t && npm run lint",
    "release": "standard-version",
    "postrelease": "git push --follow-tags origin HEAD && npm publish"
  },
  "husky": {
    "hooks": {
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
      "pre-commit": "lint-staged"
    }
  },
  "lint-staged": {
    "*.js": [
      "eslint --fix",
      "git add"
    ]
  },
  "commitlint": {
    "extends": [
      "@commitlint/config-conventional"
    ]
  },
  "dependencies": {
    "path-key": "^3.1.0",
    "shebang-command": "^2.0.0",
    "which": "^2.0.1"
  },
  "devDependencies": {
    "@commitlint/cli": "^8.1.0",
    "@commitlint/config-conventional": "^8.1.0",
    "babel-core": "^6.26.3",
    "babel-jest": "^24.9.0",
    "babel-preset-moxy": "^3.1.0",
    "eslint": "^5.16.0",
    "eslint-config-moxy": "^7.1.0",
    "husky": "^3.0.5",
    "jest": "^24.9.0",
    "lint-staged": "^9.2.5",
    "mkdirp": "^0.5.1",
    "rimraf": "^3.0.0",
    "standard-version": "^9.5.0"
  },
  "engines": {
    "node": ">= 8"
  }
}
Ѥx &100644 LICENSE-MIT.txt 
~p݃,ٛڗ wb100644 README.md Xඹ< \]"n40000 bin RL}iBT>X+100644 cssesc.js 	(VgVZb0b40000 man kǎ@`냅ȚYu100644 package.json l܃k9yVWCx5Copyright Mathias Bynens <https://mathiasbynens.be/>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
YxF# cssesc [![Build status](https://travis-ci.org/mathiasbynens/cssesc.svg?branch=master)](https://travis-ci.org/mathiasbynens/cssesc) [![Code coverage status](https://img.shields.io/codecov/c/github/mathiasbynens/cssesc.svg)](https://codecov.io/gh/mathiasbynens/cssesc)

A JavaScript library for escaping CSS strings and identifiers while generating the shortest possible ASCII-only output.

This is a JavaScript library for [escaping text for use in CSS strings or identifiers](https://mathiasbynens.be/notes/css-escapes) while generating the shortest possible valid ASCII-only output. [Here’s an online demo.](https://mothereff.in/css-escapes)

[A polyfill for the CSSOM `CSS.escape()` method is available in a separate repository.](https://mths.be/cssescape) (In comparison, _cssesc_ is much more powerful.)

Feel free to fork if you see possible improvements!

## Installation

Via [npm](https://www.npmjs.com/):

```bash
npm install cssesc
```

In a browser:

```html
<script src="cssesc.js"></script>
```

In [Node.js](https://nodejs.org/):

```js
const cssesc = require('cssesc');
```

In Ruby using [the `ruby-cssesc` wrapper gem](https://github.com/borodean/ruby-cssesc):

```bash
gem install ruby-cssesc
```

```ruby
require 'ruby-cssesc'
CSSEsc.escape('I ♥ Ruby', is_identifier: true)
```

In Sass using [`sassy-escape`](https://github.com/borodean/sassy-escape):

```bash
gem install sassy-escape
```

```scss
body {
  content: escape('I ♥ Sass', $is-identifier: true);
}
```

## API

### `cssesc(value, options)`

This function takes a value and returns an escaped version of the value where any characters that are not printable ASCII symbols are escaped using the shortest possible (but valid) [escape sequences for use in CSS strings or identifiers](https://mathiasbynens.be/notes/css-escapes).

```js
cssesc('Ich ♥ Bücher');
// → 'Ich \\2665  B\\FC cher'

cssesc('foo 𝌆 bar');
// → 'foo \\1D306  bar'
```

By default, `cssesc` returns a string that can be used as part of a CSS string. If the target is a CSS identifier rather than a CSS string, use the `isIdentifier: true` setting (see below).

The optional `options` argument accepts an object with the following options:

#### `isIdentifier`

The default value for the `isIdentifier` option is `false`. This means that the input text will be escaped for use in a CSS string literal. If you want to use the result as a CSS identifier instead (in a selector, for example), set this option to `true`.

```js
cssesc('123a2b');
// → '123a2b'

cssesc('123a2b', {
  'isIdentifier': true
});
// → '\\31 23a2b'
```

#### `quotes`

The default value for the `quotes` option is `'single'`. This means that any occurences of `'` in the input text will be escaped as `\'`, so that the output can be used in a CSS string literal wrapped in single quotes.

```js
cssesc('Lorem ipsum "dolor" sit \'amet\' etc.');
// → 'Lorem ipsum "dolor" sit \\\'amet\\\' etc.'
// → "Lorem ipsum \"dolor\" sit \\'amet\\' etc."

cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', {
  'quotes': 'single'
});
// → 'Lorem ipsum "dolor" sit \\\'amet\\\' etc.'
// → "Lorem ipsum \"dolor\" sit \\'amet\\' etc."
```

If you want to use the output as part of a CSS string literal wrapped in double quotes, set the `quotes` option to `'double'`.

```js
cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', {
  'quotes': 'double'
});
// → 'Lorem ipsum \\"dolor\\" sit \'amet\' etc.'
// → "Lorem ipsum \\\"dolor\\\" sit 'amet' etc."
```

#### `wrap`

The `wrap` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, the output will be a valid CSS string literal wrapped in quotes. The type of quotes can be specified through the `quotes` setting.

```js
cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', {
  'quotes': 'single',
  'wrap': true
});
// → '\'Lorem ipsum "dolor" sit \\\'amet\\\' etc.\''
// → "\'Lorem ipsum \"dolor\" sit \\\'amet\\\' etc.\'"

cssesc('Lorem ipsum "dolor" sit \'amet\' etc.', {
  'quotes': 'double',
  'wrap': true
});
// → '"Lorem ipsum \\"dolor\\" sit \'amet\' etc."'
// → "\"Lorem ipsum \\\"dolor\\\" sit \'amet\' etc.\""
```

#### `escapeEverything`

The `escapeEverything` option takes a boolean value (`true` or `false`), and defaults to `false` (disabled). When enabled, all the symbols in the output will be escaped, even printable ASCII symbols.

```js
cssesc('lolwat"foo\'bar', {
  'escapeEverything': true
});
// → '\\6C\\6F\\6C\\77\\61\\74\\"\\66\\6F\\6F\\\'\\62\\61\\72'
// → "\\6C\\6F\\6C\\77\\61\\74\\\"\\66\\6F\\6F\\'\\62\\61\\72"
```

#### Overriding the default options globally

The global default settings can be overridden by modifying the `css.options` object. This saves you from passing in an `options` object for every call to `encode` if you want to use the non-default setting.

```js
// Read the global default setting for `escapeEverything`:
cssesc.options.escapeEverything;
// → `false` by default

// Override the global default setting for `escapeEverything`:
cssesc.options.escapeEverything = true;

// Using the global default setting for `escapeEverything`, which is now `true`:
cssesc('foo © bar ≠ baz 𝌆 qux');
// → '\\66\\6F\\6F\\ \\A9\\ \\62\\61\\72\\ \\2260\\ \\62\\61\\7A\\ \\1D306\\ \\71\\75\\78'
```

### `cssesc.version`

A string representing the semantic version number.

### Using the `cssesc` binary

To use the `cssesc` binary in your shell, simply install cssesc globally using npm:

```bash
npm install -g cssesc
```

After that you will be able to escape text for use in CSS strings or identifiers from the command line:

```bash
$ cssesc 'föo ♥ bår 𝌆 baz'
f\F6o \2665  b\E5r \1D306  baz
```

If the output needs to be a CSS identifier rather than part of a string literal, use the `-i`/`--identifier` option:

```bash
$ cssesc --identifier 'föo ♥ bår 𝌆 baz'
f\F6o\ \2665\ b\E5r\ \1D306\ baz
```

See `cssesc --help` for the full list of options.

## Support

This library supports the Node.js and browser versions mentioned in [`.babelrc`](https://github.com/mathiasbynens/cssesc/blob/master/.babelrc). For a version that supports a wider variety of legacy browsers and environments out-of-the-box, [see v0.1.0](https://github.com/mathiasbynens/cssesc/releases/tag/v0.1.0).

## Author

| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |
|---|
| [Mathias Bynens](https://mathiasbynens.be/) |

## License

This library is available under the [MIT](https://mths.be/mit) license.
Bx" 100644 cssesc O uIl.<ZP.x#!/usr/bin/env node
const fs = require('fs');
const cssesc = require('../cssesc.js');
const strings = process.argv.splice(2);
const stdin = process.stdin;
const options = {};
const log = console.log;

const main = function() {
	const option = strings[0];

	if (/^(?:-h|--help|undefined)$/.test(option)) {
		log(
			'cssesc v%s - https://mths.be/cssesc',
			cssesc.version
		);
		log([
			'\nUsage:\n',
			'\tcssesc [string]',
			'\tcssesc [-i | --identifier] [string]',
			'\tcssesc [-s | --single-quotes] [string]',
			'\tcssesc [-d | --double-quotes] [string]',
			'\tcssesc [-w | --wrap] [string]',
			'\tcssesc [-e | --escape-everything] [string]',
			'\tcssesc [-v | --version]',
			'\tcssesc [-h | --help]',
			'\nExamples:\n',
			'\tcssesc \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'',
			'\tcssesc --identifier \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'',
			'\tcssesc --escape-everything \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'',
			'\tcssesc --double-quotes --wrap \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\'',
			'\techo \'f\xF6o \u2665 b\xE5r \uD834\uDF06 baz\' | cssesc'
		].join('\n'));
		return process.exit(1);
	}

	if (/^(?:-v|--version)$/.test(option)) {
		log('v%s', cssesc.version);
		return process.exit(1);
	}

	strings.forEach(function(string) {
		// Process options
		if (/^(?:-i|--identifier)$/.test(string)) {
			options.isIdentifier = true;
			return;
		}
		if (/^(?:-s|--single-quotes)$/.test(string)) {
			options.quotes = 'single';
			return;
		}
		if (/^(?:-d|--double-quotes)$/.test(string)) {
			options.quotes = 'double';
			return;
		}
		if (/^(?:-w|--wrap)$/.test(string)) {
			options.wrap = true;
			return;
		}
		if (/^(?:-e|--escape-everything)$/.test(string)) {
			options.escapeEverything = true;
			return;
		}

		// Process string(s)
		let result;
		try {
			result = cssesc(string, options);
			log(result);
		} catch (exception) {
			log(exception.message + '\n');
			log('Error: failed to escape.');
			log('If you think this is a bug in cssesc, please report it:');
			log('https://github.com/mathiasbynens/cssesc/issues/new');
			log(
				'\nStack trace using cssesc@%s:\n',
				cssesc.version
			);
			log(exception.stack);
			return process.exit(1);
		}
	});
	// Return with exit status 0 outside of the `forEach` loop, in case
	// multiple strings were passed in.
	return process.exit(0);

};

if (stdin.isTTY) {
	// handle shell arguments
	main();
} else {
	let timeout;
	// Either the script is called from within a non-TTY context, or `stdin`
	// content is being piped in.
	if (!process.stdout.isTTY) {
		// The script was called from a non-TTY context. This is a rather uncommon
		// use case we don’t actively support. However, we don’t want the script
		// to wait forever in such cases, so…
		timeout = setTimeout(function() {
			// …if no piped data arrived after a whole minute, handle shell
			// arguments instead.
			main();
		}, 60000);
	}
	let data = '';
	stdin.on('data', function(chunk) {
		clearTimeout(timeout);
		data += chunk;
	});
	stdin.on('end', function() {
		strings.push(data.trim());
		main();
	});
	stdin.resume();
}
`)xE/*! https://mths.be/cssesc v3.0.0 by @mathias */
'use strict';

var object = {};
var hasOwnProperty = object.hasOwnProperty;
var merge = function merge(options, defaults) {
	if (!options) {
		return defaults;
	}
	var result = {};
	for (var key in defaults) {
		// `if (defaults.hasOwnProperty(key) { … }` is not needed here, since
		// only recognized option names are used.
		result[key] = hasOwnProperty.call(options, key) ? options[key] : defaults[key];
	}
	return result;
};

var regexAnySingleEscape = /[ -,\.\/:-@\[-\^`\{-~]/;
var regexSingleEscape = /[ -,\.\/:-@\[\]\^`\{-~]/;
var regexAlwaysEscape = /['"\\]/;
var regexExcessiveSpaces = /(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g;

// https://mathiasbynens.be/notes/css-escapes#css
var cssesc = function cssesc(string, options) {
	options = merge(options, cssesc.options);
	if (options.quotes != 'single' && options.quotes != 'double') {
		options.quotes = 'single';
	}
	var quote = options.quotes == 'double' ? '"' : '\'';
	var isIdentifier = options.isIdentifier;

	var firstChar = string.charAt(0);
	var output = '';
	var counter = 0;
	var length = string.length;
	while (counter < length) {
		var character = string.charAt(counter++);
		var codePoint = character.charCodeAt();
		var value = void 0;
		// If it’s not a printable ASCII character…
		if (codePoint < 0x20 || codePoint > 0x7E) {
			if (codePoint >= 0xD800 && codePoint <= 0xDBFF && counter < length) {
				// It’s a high surrogate, and there is a next character.
				var extra = string.charCodeAt(counter++);
				if ((extra & 0xFC00) == 0xDC00) {
					// next character is low surrogate
					codePoint = ((codePoint & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000;
				} else {
					// It’s an unmatched surrogate; only append this code unit, in case
					// the next code unit is the high surrogate of a surrogate pair.
					counter--;
				}
			}
			value = '\\' + codePoint.toString(16).toUpperCase() + ' ';
		} else {
			if (options.escapeEverything) {
				if (regexAnySingleEscape.test(character)) {
					value = '\\' + character;
				} else {
					value = '\\' + codePoint.toString(16).toUpperCase() + ' ';
				}
			} else if (/[\t\n\f\r\x0B]/.test(character)) {
				value = '\\' + codePoint.toString(16).toUpperCase() + ' ';
			} else if (character == '\\' || !isIdentifier && (character == '"' && quote == character || character == '\'' && quote == character) || isIdentifier && regexSingleEscape.test(character)) {
				value = '\\' + character;
			} else {
				value = character;
			}
		}
		output += value;
	}

	if (isIdentifier) {
		if (/^-[-\d]/.test(output)) {
			output = '\\-' + output.slice(1);
		} else if (/\d/.test(firstChar)) {
			output = '\\3' + firstChar + ' ' + output.slice(1);
		}
	}

	// Remove spaces after `\HEX` escapes that are not followed by a hex digit,
	// since they’re redundant. Note that this is only possible if the escape
	// sequence isn’t preceded by an odd number of backslashes.
	output = output.replace(regexExcessiveSpaces, function ($0, $1, $2) {
		if ($1 && $1.length % 2) {
			// It’s not safe to remove the space, so don’t.
			return $0;
		}
		// Strip the space.
		return ($1 || '') + $2;
	});

	if (!isIdentifier && options.wrap) {
		return quote + output + quote;
	}
	return output;
};

// Expose default options (so they can be overridden globally).
cssesc.options = {
	'escapeEverything': false,
	'isIdentifier': false,
	'quotes': 'single',
	'wrap': false
};

cssesc.version = '3.0.0';

module.exports = cssesc;
JWx$ 100644 cssesc.1 mT6gm@JŖUzxZ.Dd August 9, 2013
.Dt cssesc 1
.Sh NAME
.Nm cssesc
.Nd escape text for use in CSS string literals or identifiers
.Sh SYNOPSIS
.Nm
.Op Fl i | -identifier Ar string
.br
.Op Fl s | -single-quotes Ar string
.br
.Op Fl d | -double-quotes Ar string
.br
.Op Fl w | -wrap Ar string
.br
.Op Fl e | -escape-everything Ar string
.br
.Op Fl v | -version
.br
.Op Fl h | -help
.Sh DESCRIPTION
.Nm
escapes strings for use in CSS string literals or identifiers while generating the shortest possible valid ASCII-only output.
.Sh OPTIONS
.Bl -ohang -offset
.It Sy "-s, --single-quotes"
Escape any occurences of ' in the input string as \\', so that the output can be used in a CSS string literal wrapped in single quotes.
.It Sy "-d, --double-quotes"
Escape any occurences of " in the input string as \\", so that the output can be used in a CSS string literal wrapped in double quotes.
.It Sy "-w, --wrap"
Make sure the output is a valid CSS string literal wrapped in quotes. The type of quotes can be specified using the
.Ar -s | --single-quotes
or
.Ar -d | --double-quotes
settings.
.It Sy "-e, --escape-everything"
Escape all the symbols in the output, even printable ASCII symbols.
.It Sy "-v, --version"
Print cssesc's version.
.It Sy "-h, --help"
Show the help screen.
.El
.Sh EXIT STATUS
The
.Nm cssesc
utility exits with one of the following values:
.Pp
.Bl -tag -width flag -compact
.It Li 0
.Nm
successfully escaped the given text and printed the result.
.It Li 1
.Nm
wasn't instructed to escape anything (for example, the
.Ar --help
flag was set); or, an error occurred.
.El
.Sh EXAMPLES
.Bl -ohang -offset
.It Sy "cssesc 'foo bar baz'"
Print an escaped version of the given text.
.It Sy echo\ 'foo bar baz'\ |\ cssesc
Print an escaped version of the text that gets piped in.
.El
.Sh BUGS
cssesc's bug tracker is located at <https://github.com/mathiasbynens/cssesc/issues>.
.Sh AUTHOR
Mathias Bynens <https://mathiasbynens.be/>
.Sh WWW
<https://mths.be/cssesc>
L񎬴Nx{
  "name": "cssesc",
  "version": "3.0.0",
  "description": "A JavaScript library for escaping CSS strings and identifiers while generating the shortest possible ASCII-only output.",
  "homepage": "https://mths.be/cssesc",
  "engines": {
    "node": ">=4"
  },
  "main": "cssesc.js",
  "bin": "bin/cssesc",
  "man": "man/cssesc.1",
  "keywords": [
    "css",
    "escape",
    "identifier",
    "string",
    "tool"
  ],
  "license": "MIT",
  "author": {
    "name": "Mathias Bynens",
    "url": "https://mathiasbynens.be/"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/mathiasbynens/cssesc.git"
  },
  "bugs": "https://github.com/mathiasbynens/cssesc/issues",
  "files": [
    "LICENSE-MIT.txt",
    "cssesc.js",
    "bin/",
    "man/"
  ],
  "scripts": {
    "build": "grunt template && babel cssesc.js -o cssesc.js",
    "test": "mocha tests",
    "cover": "istanbul cover --report html node_modules/.bin/_mocha tests -- -u exports -R spec"
  },
  "devDependencies": {
    "babel-cli": "^6.26.0",
    "babel-preset-env": "^1.6.1",
    "codecov": "^1.0.1",
    "grunt": "^1.0.1",
    "grunt-template": "^1.0.0",
    "istanbul": "^0.4.4",
    "mocha": "^2.5.3",
    "regenerate": "^1.2.1",
    "requirejs": "^2.1.16"
  }
}
ix q100644 LICENSE  bk`qټ
n100644 README.md IBG^8Sy100644 package.json R=
IBO8Q40000 src σxj&jѬ_į;+x	(The MIT License)

Copyright (c) 2014-2017 TJ Holowaychuk <tj@vision-media.ca>
Copyright (c) 2018-2021 Josh Junon

Permission iC this software
4('Software'), to deal in t!
* :
and/or sell copies of  copies or substantial
4'AS IS'(* IMPLIED, INCLUDING BUT NOT
n5 -"
IN NO EVENT SHALL THE AUTHORS OR F	
WHETHER BG CONNECTION WITH THE
7
s
xcV# debug
[![OpenCollective](https://opencollective.com/debug/backers/badge.svg)](#backers)
[![OpenCollective](https://opencollective.com/debug/sponsors/badge.svg)](#sponsors)

<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">

A tiny JavaScript debugging utility modelled after Node.js core's debugging
technique. Works in Node.js and web browsers.

## Installation

```bash
$ npm install debug
```

## Usage

`debug` exposes a function; simply pass this function the name of your module, and it will return a decorated version of `console.error` for you to pass debug statements to. This will allow you to toggle the debug output for different parts of your module as well as the module as a whole.

Example [_app.js_](./examples/node/app.js):

```js
var debug = require('debug')('http')
  , http = require('http')
  , name = 'My App';

// fake app

debug('booting %o', name);

http.createServer(function(req, res){
  debug(req.method + ' ' + req.url);
  res.end('hello\n');
}).listen(3000, function(){
  debug('listening');
});

// fake worker of some kind

require('./worker');
```

Example [_worker.js_](./examples/node/worker.js):

```js
var a = require('debug')('worker:a')
  , b = require('debug')('worker:b');

function work() {
  a('doing lots of uninteresting work');
  setTimeout(work, Math.random() * 1000);
}

work();

function workb() {
  b('doing some work');
  setTimeout(workb, Math.random() * 2000);
}

workb();
```

The `DEBUG` environment variable is then used to enable these based on space or
comma-delimited names.

Here are some examples:

<img width="647" alt="screen shot 2017-08-08 at 12 53 04 pm" src="https://user-images.githubusercontent.com/71256/29091703-a6302cdc-7c38-11e7-8304-7c0b3bc600cd.png">
<img width="647" alt="screen shot 2017-08-08 at 12 53 38 pm" src="https://user-images.githubusercontent.com/71256/29091700-a62a6888-7c38-11e7-800b-db911291ca2b.png">
<img width="647" alt="screen shot 2017-08-08 at 12 53 25 pm" src="https://user-images.githubusercontent.com/71256/29091701-a62ea114-7c38-11e7-826a-2692bedca740.png">

#### Windows command prompt notes

##### CMD

On Windows the environment variable is set using the `set` command.

```cmd
set DEBUG=*,-not_this
```

Example:

```cmd
set DEBUG=* & node app.js
```

##### PowerShell (VS Code default)

PowerShell uses different syntax to set environment variables.

```cmd
$env:DEBUG = "*,-not_this"
```

Example:

```cmd
$env:DEBUG='app';node app.js
```

Then, run the program to be debugged as usual.

npm script example:
```js
  "windowsDebug": "@powershell -Command $env:DEBUG='*';node app.js",
```

## Namespace Colors

Every debug instance has a color generated for it based on its namespace name.
This helps when visually parsing the debug output to identify which debug instance
a debug line belongs to.

#### Node.js

In Node.js, colors are enabled when stderr is a TTY. You also _should_ install
the [`supports-color`](https://npmjs.org/supports-color) module alongside debug,
otherwise debug will only use a small handful of basic colors.

<img width="521" src="https://user-images.githubusercontent.com/71256/29092181-47f6a9e6-7c3a-11e7-9a14-1928d8a711cd.png">

#### Web Browser

Colors are also enabled on "Web Inspectors" that understand the `%c` formatting
option. These are WebKit web inspectors, Firefox ([since version
31](https://hacks.mozilla.org/2014/05/editable-box-model-multiple-selection-sublime-text-keys-much-more-firefox-developer-tools-episode-31/))
and the Firebug plugin for Firefox (any version).

<img width="524" src="https://user-images.githubusercontent.com/71256/29092033-b65f9f2e-7c39-11e7-8e32-f6f0d8e865c1.png">


## Millisecond diff

When actively developing an application it can be useful to see when the time spent between one `debug()` call and the next. Suppose for example you invoke `debug()` before requesting a resource, and after as well, the "+NNNms" will show you how much time was spent between calls.

<img width="647" src="https://user-images.githubusercontent.com/71256/29091486-fa38524c-7c37-11e7-895f-e7ec8e1039b6.png">

When stdout is not a TTY, `Date#toISOString()` is used, making it more useful for logging the debug information as shown below:

<img width="647" src="https://user-images.githubusercontent.com/71256/29091956-6bd78372-7c39-11e7-8c55-c948396d6edd.png">


## Conventions

If you're using this in one or more of your libraries, you _should_ use the name of your library so that developers may toggle debugging as desired without guessing names. If you have more than one debuggers you _should_ prefix them with your library name and use ":" to separate features. For example "bodyParser" from Connect would then be "connect:bodyParser".  If you append a "*" to the end of your name, it will always be enabled regardless of the setting of the DEBUG environment variable.  You can then use it for normal output as well as debug output.

## Wildcards

The `*` character may be used as a wildcard. Suppose for example your library has
debuggers named "connect:bodyParser", "connect:compress", "connect:session",
instead of listing all three with
`DEBUG=connect:bodyParser,connect:compress,connect:session`, you may simply do
`DEBUG=connect:*`, or to run everything using this module simply use `DEBUG=*`.

You can also exclude specific debuggers by prefixing them with a "-" character.
For example, `DEBUG=*,-connect:*` would include all debuggers except those
starting with "connect:".

## Environment Variables

When running through Node.js, you can set a few environment variables that will
change the behavior of the debug logging:

| Name      | Purpose                                         |
|-----------|-------------------------------------------------|
| `DEBUG`   | Enables/disables specific debugging namespaces. |
| `DEBUG_HIDE_DATE` | Hide date from debug output (non-TTY).  |
| `DEBUG_COLORS`| Whether or not to use colors in the debug output. |
| `DEBUG_DEPTH` | Object inspection depth.                    |
| `DEBUG_SHOW_HIDDEN` | Shows hidden properties on inspected objects. |


__Note:__ The environment variables beginning with `DEBUG_` end up being
converted into an Options object that gets used with `%o`/`%O` formatters.
See the Node.js documentation for
[`util.inspect()`](https://nodejs.org/api/util.html#util_util_inspect_object_options)
for the complete list.

## Formatters

Debug uses [printf-style](https://wikipedia.org/wiki/Printf_format_string) formatting.
Below are the officially supported formatters:

| Formatter | Representation |
|-----------|----------------|
| `%O`      | Pretty-print an Object on multiple lines. |
| `%o`      | Pretty-print an Object all on a single line. |
| `%s`      | String. |
| `%d`      | Number (both integer and float). |
| `%j`      | JSON. Replaced with the string '[Circular]' if the argument contains circular references. |
| `%%`      | Single percent sign ('%'). This does not consume an argument. |


### Custom formatters

You can add custom formatters by extending the `debug.formatters` object.
For example, if you wanted to add support for rendering a Buffer as hex with
`%h`, you could do something like:

```js
const createDebug = require('debug')
createDebug.formatters.h = (v) => {
  return v.toString('hex')
}

// …elsewhere
const debug = createDebug('foo')
debug('this is hex: %h', new Buffer('hello world'))
//   foo this is hex: 68656c6c6f20776f726c6421 +0ms
```


## Browser Support

You can build a browser-ready script using [browserify](https://github.com/substack/node-browserify),
or just use the [browserify-as-a-service](https://wzrd.in/) [build](https://wzrd.in/standalone/debug@latest),
if you don't want to build it yourself.

Debug's enable state is currently persisted by `localStorage`.
Consider the situation shown below where you have `worker:a` and `worker:b`,
and wish to debug both. You can enable this using `localStorage.debug`:

```js
localStorage.debug = 'worker:*'
```

And then refresh the page.

```js
a = debug('worker:a');
b = debug('worker:b');

setInterval(function(){
  a('doing some work');
}, 1000);

setInterval(function(){
  b('doing some work');
}, 1200);
```

In Chromium-based web browsers (e.g. Brave, Chrome, and Electron), the JavaScript console will—by default—only show messages logged by `debug` if the "Verbose" log level is _enabled_.

<img width="647" src="https://user-images.githubusercontent.com/7143133/152083257-29034707-c42c-4959-8add-3cee850e6fcf.png">

## Output streams

  By default `debug` will log to stderr, however this can be configured per-namespace by overriding the `log` method:

Example [_stdout.js_](./examples/node/stdout.js):

```js
var debug = require('debug');
var error = debug('app:error');

// by default stderr is used
error('goes to stderr!');

var log = debug('app:log');
// set this namespace to log via console.log
log.log = console.log.bind(console); // don't forget to bind to console!
log('goes to stdout');
error('still goes to stderr!');

// set all output to go via console.info
// overrides all per-namespace log settings
debug.log = console.info.bind(console);
error('now goes to stdout via console.info');
log('still goes to stdout, but via console.info now');
```

## Extend
You can simply extend debugger 
```js
const log = require('debug')('auth');

//creates new debug instance with extended namespace
const logSign = log.extend('sign');
const logLogin = log.extend('login');

log('hello'); // auth hello
logSign('hello'); //auth:sign hello
logLogin('hello'); //auth:login hello
```

## Set dynamically

You can also enable debug dynamically by calling the `enable()` method :

```js
let debug = require('debug');

console.log(1, debug.enabled('test'));

debug.enable('test');
console.log(2, debug.enabled('test'));

debug.disable();
console.log(3, debug.enabled('test'));

```

print :   
```
1 false
2 true
3 false
```

Usage :  
`enable(namespaces)`  
`namespaces` can include modes separated by a colon and wildcards.
   
Note that calling `enable()` completely overrides previously set DEBUG variable : 

```
$ DEBUG=foo node -e 'var dbg = require("debug"); dbg.enable("bar"); console.log(dbg.enabled("foo"))'
=> false
```

`disable()`

Will disable all namespaces. The functions returns the namespaces currently
enabled (and skipped). This can be useful if you want to disable debugging
temporarily without knowing what was enabled to begin with.

For example:

```js
let debug = require('debug');
debug.enable('foo:*,-foo:bar');
let namespaces = debug.disable();
debug.enable(namespaces);
```

Note: There is no guarantee that the string will be identical to the initial
enable string, but semantically they will be identical.

## Checking whether a debug target is enabled

After you've created a debug instance, you can determine whether or not it is
enabled by checking the `enabled` property:

```javascript
const debug = require('debug')('http');

if (debug.enabled) {
  // do stuff...
}
```

You can also manually toggle this property to force the debug instance to be
enabled or disabled.

## Usage in child processes

Due to the way `debug` detects if the output is a TTY or not, colors are not shown in child processes when `stderr` is piped. A solution is to pass the `DEBUG_COLORS=1` environment variable to the child process.  
For example:

```javascript
worker = fork(WORKER_WRAP_PATH, [workerPath], {
  stdio: [
    /* stdin: */ 0,
    /* stdout: */ 'pipe',
    /* stderr: */ 'pipe',
    'ipc',
  ],
  env: Object.assign({}, process.env, {
    DEBUG_COLORS: 1 // without this settings, colors won't be shown
  }),
});

worker.stderr.pipe(process.stderr, { end: false });
```


## Authors

 - TJ Holowaychuk
 - Nathan Rajlich
 - Andrew Rhyne
 - Josh Junon

## Backers

Support us with a monthly donation and help us continue our activities. [[Become a backer](https://opencollective.com/debug#backer)]

<a href="https://opencollective.com/debug/backer/0/website" target="_blank"><img src="https://opencollective.com/debug/backer/0/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/1/website" target="_blank"><img src="https://opencollective.com/debug/backer/1/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/2/website" target="_blank"><img src="https://opencollective.com/debug/backer/2/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/3/website" target="_blank"><img src="https://opencollective.com/debug/backer/3/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/4/website" target="_blank"><img src="https://opencollective.com/debug/backer/4/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/5/website" target="_blank"><img src="https://opencollective.com/debug/backer/5/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/6/website" target="_blank"><img src="https://opencollective.com/debug/backer/6/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/7/website" target="_blank"><img src="https://opencollective.com/debug/backer/7/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/8/website" target="_blank"><img src="https://opencollective.com/debug/backer/8/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/9/website" target="_blank"><img src="https://opencollective.com/debug/backer/9/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/10/website" target="_blank"><img src="https://opencollective.com/debug/backer/10/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/11/website" target="_blank"><img src="https://opencollective.com/debug/backer/11/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/12/website" target="_blank"><img src="https://opencollective.com/debug/backer/12/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/13/website" target="_blank"><img src="https://opencollective.com/debug/backer/13/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/14/website" target="_blank"><img src="https://opencollective.com/debug/backer/14/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/15/website" target="_blank"><img src="https://opencollective.com/debug/backer/15/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/16/website" target="_blank"><img src="https://opencollective.com/debug/backer/16/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/17/website" target="_blank"><img src="https://opencollective.com/debug/backer/17/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/18/website" target="_blank"><img src="https://opencollective.com/debug/backer/18/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/19/website" target="_blank"><img src="https://opencollective.com/debug/backer/19/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/20/website" target="_blank"><img src="https://opencollective.com/debug/backer/20/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/21/website" target="_blank"><img src="https://opencollective.com/debug/backer/21/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/22/website" target="_blank"><img src="https://opencollective.com/debug/backer/22/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/23/website" target="_blank"><img src="https://opencollective.com/debug/backer/23/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/24/website" target="_blank"><img src="https://opencollective.com/debug/backer/24/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/25/website" target="_blank"><img src="https://opencollective.com/debug/backer/25/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/26/website" target="_blank"><img src="https://opencollective.com/debug/backer/26/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/27/website" target="_blank"><img src="https://opencollective.com/debug/backer/27/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/28/website" target="_blank"><img src="https://opencollective.com/debug/backer/28/avatar.svg"></a>
<a href="https://opencollective.com/debug/backer/29/website" target="_blank"><img src="https://opencollective.com/debug/backer/29/avatar.svg"></a>


## Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site. [[Become a sponsor](https://opencollective.com/debug#sponsor)]

<a href="https://opencollective.com/debug/sponsor/0/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/0/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/1/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/1/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/2/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/2/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/3/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/3/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/4/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/4/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/5/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/5/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/6/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/6/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/7/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/7/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/8/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/8/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/9/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/9/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/10/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/10/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/11/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/11/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/12/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/12/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/13/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/13/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/14/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/14/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/15/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/15/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/16/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/16/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/17/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/17/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/18/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/18/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/19/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/19/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/20/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/20/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/21/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/21/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/22/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/22/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/23/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/23/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/24/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/24/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/25/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/25/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/26/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/26/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/27/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/27/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/28/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/28/avatar.svg"></a>
<a href="https://opencollective.com/debug/sponsor/29/website" target="_blank"><img src="https://opencollective.com/debug/sponsor/29/avatar.svg"></a>

## License

(The MIT License)

Copyright (c) 2014-2017 TJ Holowaychuk &lt;tj@vision-media.ca&gt;
Copyright (c) 2018-2021 Josh Junon

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 \x8{
  "name": "debug",
  "version": "4.4.3",
  "repository": {
    "type": "git",
    "url": "git://github.com/debug-js/debug.git"
  },
  "description": "Lightweight debugging utility for Node.js and the browser",
  "keywords": [
    "debug",
    "log",
    "debugger"
  ],
  "files": [
    "src",
    "LICENSE",
    "README.md"
  ],
  "author": "Josh Junon (https://github.com/qix-)",
  "contributors": [
    "TJ Holowaychuk <tj@vision-media.ca>",
    "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io)",
    "Andrew Rhyne <rhyneandrew@gmail.com>"
  ],
  "license": "MIT",
  "scripts": {
    "lint": "xo",
    "test": "npm run test:node && npm run test:browser && npm run lint",
    "test:node": "mocha test.js test.node.js",
    "test:browser": "karma start --single-run",
    "test:coverage": "cat ./coverage/lcov.info | coveralls"
  },
  "dependencies": {
    "ms": "^2.1.3"
  },
  "devDependencies": {
    "brfs": "^2.0.1",
    "browserify": "^16.2.3",
    "coveralls": "^3.0.2",
    "karma": "^3.1.4",
    "karma-browserify": "^6.0.0",
    "karma-chrome-launcher": "^2.2.0",
    "karma-mocha": "^1.3.0",
    "mocha": "^5.2.0",
    "mocha-lcov-reporter": "^1.2.0",
    "sinon": "^14.0.0",
    "xo": "^0.23.0"
  },
  "peerDependenciesMeta": {
    "supports-color": {
      "optional": true
    }
  },
  "main": "./src/index.js",
  "browser": "./src/browser.js",
  "engines": {
    "node": ">=6.0"
  },
  "xo": {
    "rules": {
      "import/extensions": "off"
    }
  }
}
 ģ	x m100644 browser.js YE} +4Am|100644 common.js xr#$y*As100644 index.js LWY.vEcmț100644 node.js qU`ʏcSn(^:x(/* eslint-env browser */

/**
 * This is the web browser implementation of `debug()`.
 */

exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
exports.storage = localstorage();
exports.destroy = (() => {
	let warned = false;

	return () => {
		if (!warned) {
			warned = true;
			console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
		}
	};
})();

/**
 * Colors.
 */

exports.colors = [
	'#0000CC',
	'#0000FF',
	'#0033CC',
	'#0033FF',
	'#0066CC',
	'#0066FF',
	'#0099CC',
	'#0099FF',
	'#00CC00',
	'#00CC33',
	'#00CC66',
	'#00CC99',
	'#00CCCC',
	'#00CCFF',
	'#3300CC',
	'#3300FF',
	'#3333CC',
	'#3333FF',
	'#3366CC',
	'#3366FF',
	'#3399CC',
	'#3399FF',
	'#33CC00',
	'#33CC33',
	'#33CC66',
	'#33CC99',
	'#33CCCC',
	'#33CCFF',
	'#6600CC',
	'#6600FF',
	'#6633CC',
	'#6633FF',
	'#66CC00',
	'#66CC33',
	'#9900CC',
	'#9900FF',
	'#9933CC',
	'#9933FF',
	'#99CC00',
	'#99CC33',
	'#CC0000',
	'#CC0033',
	'#CC0066',
	'#CC0099',
	'#CC00CC',
	'#CC00FF',
	'#CC3300',
	'#CC3333',
	'#CC3366',
	'#CC3399',
	'#CC33CC',
	'#CC33FF',
	'#CC6600',
	'#CC6633',
	'#CC9900',
	'#CC9933',
	'#CCCC00',
	'#CCCC33',
	'#FF0000',
	'#FF0033',
	'#FF0066',
	'#FF0099',
	'#FF00CC',
	'#FF00FF',
	'#FF3300',
	'#FF3333',
	'#FF3366',
	'#FF3399',
	'#FF33CC',
	'#FF33FF',
	'#FF6600',
	'#FF6633',
	'#FF9900',
	'#FF9933',
	'#FFCC00',
	'#FFCC33'
];

/**
 * Currently only WebKit-based Web Inspectors, Firefox >= v31,
 * and the Firebug extension (any Firefox version) are known
 * to support "%c" CSS customizations.
 *
 * TODO: add a `localStorage` variable to explicitly enable/disable colors
 */

// eslint-disable-next-line complexity
function useColors() {
	// NB: In an Electron preload script, document will be defined but not fully
	// initialized. Since we know we're in Chrome, we'll just detect this case
	// explicitly
	if (typeof window !== 'undefined' && window.process && (window.process.type === 'renderer' || window.process.__nwjs)) {
		return true;
	}

	// Internet Explorer and Edge do not support colors.
	if (typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)) {
		return false;
	}

	let m;

	// Is webkit? http://stackoverflow.com/a/16459606/376773
	// document is undefined in react-native: https://github.com/facebook/react-native/pull/1632
	// eslint-disable-next-line no-return-assign
	return (typeof document !== 'undefined' && document.documentElement && document.documentElement.style && document.documentElement.style.WebkitAppearance) ||
		// Is firebug? http://stackoverflow.com/a/398120/376773
		(typeof window !== 'undefined' && window.console && (window.console.firebug || (window.console.exception && window.console.table))) ||
		// Is firefox >= v31?
		// https://developer.mozilla.org/en-US/docs/Tools/Web_Console#Styling_messages
		(typeof navigator !== 'undefined' && navigator.userAgent && (m = navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)) && parseInt(m[1], 10) >= 31) ||
		// Double check webkit in userAgent just in case we are in a worker
		(typeof navigator !== 'undefined' && navigator.userAgent && navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/));
}

/**
 * Colorize log arguments if enabled.
 *
 * @api public
 */

function formatArgs(args) {
	args[0] = (this.useColors ? '%c' : '') +
		this.namespace +
		(this.useColors ? ' %c' : ' ') +
		args[0] +
		(this.useColors ? '%c ' : ' ') +
		'+' + module.exports.humanize(this.diff);

	if (!this.useColors) {
		return;
	}

	const c = 'color: ' + this.color;
	args.splice(1, 0, c, 'color: inherit');

	// The final "%c" is somewhat tricky, because there could be other
	// arguments passed either before or after the %c, so we need to
	// figure out the correct index to insert the CSS into
	let index = 0;
	let lastC = 0;
	args[0].replace(/%[a-zA-Z%]/g, match => {
		if (match === '%%') {
			return;
		}
		index++;
		if (match === '%c') {
			// We only are interested in the *last* %c
			// (the user may have provided their own)
			lastC = index;
		}
	});

	args.splice(lastC, 0, c);
}

/**
 * Invokes `console.debug()` when available.
 * No-op when `console.debug` is not a "function".
 * If `console.debug` is not available, falls back
 * to `console.log`.
 *
 * @api public
 */
exports.log = console.debug || console.log || (() => {});

/**
 * Save `namespaces`.
 *
 * @param {String} namespaces
 * @api private
 */
function save(namespaces) {
	try {
		if (namespaces) {
			exports.storage.setItem('debug', namespaces);
		} else {
			exports.storage.removeItem('debug');
		}
	} catch (error) {
		// Swallow
		// XXX (@Qix-) should we be logging these?
	}
}

/**
 * Load `namespaces`.
 *
 * @return {String} returns the previously persisted debug modes
 * @api private
 */
function load() {
	let r;
	try {
		r = exports.storage.getItem('debug') || exports.storage.getItem('DEBUG') ;
	} catch (error) {
		// Swallow
		// XXX (@Qix-) should we be logging these?
	}

	// If debug isn't set in LS, and we're in Electron, try to load $DEBUG
	if (!r && typeof process !== 'undefined' && 'env' in process) {
		r = process.env.DEBUG;
	}

	return r;
}

/**
 * Localstorage attempts to return the localstorage.
 *
 * This is necessary because safari throws
 * when a user disables cookies/localstorage
 * and you attempt to access it.
 *
 * @return {LocalStorage}
 * @api private
 */

function localstorage() {
	try {
		// TVMLKit (Apple TV JS Runtime) does not have a window object, just localStorage in the global context
		// The Browser also has localStorage in the global context.
		return localStorage;
	} catch (error) {
		// Swallow
		// XXX (@Qix-) should we be logging these?
	}
}

module.exports = require('./common')(exports);

const {formatters} = module.exports;

/**
 * Map %j to `JSON.stringify()`, since no Web Inspectors do that by default.
 */

formatters.j = function (v) {
	try {
		return JSON.stringify(v);
	} catch (error) {
		return '[UnexpectedJSONParseError]: ' + error.message;
	}
};
0-x
/**
 * This is the common logic for both the Node.js and web browser
 * implementations of `debug()`.
 */

function setup(env) {
	createDebug.debug = createDebug;
	createDebug.default = createDebug;
	createDebug.coerce = coerce;
	createDebug.disable = disable;
	createDebug.enable = enable;
	createDebug.enabled = enabled;
	createDebug.humanize = require('ms');
	createDebug.destroy = destroy;

	Object.keys(env).forEach(key => {
		createDebug[key] = env[key];
	});

	/**
	* The currently active debug mode names, and names to skip.
	*/

	createDebug.names = [];
	createDebug.skips = [];

	/**
	* Map of special "%n" handling functions, for the debug "format" argument.
	*
	* Valid key names are a single, lower or upper-case letter, i.e. "n" and "N".
	*/
	createDebug.formatters = {};

	/**
	* Selects a color for a debug namespace
	* @param {String} namespace The namespace string for the debug instance to be colored
	* @return {Number|String} An ANSI color code for the given namespace
	* @api private
	*/
	function selectColor(namespace) {
		let hash = 0;

		for (let i = 0; i < namespace.length; i++) {
			hash = ((hash << 5) - hash) + namespace.charCodeAt(i);
			hash |= 0; // Convert to 32bit integer
		}

		return createDebug.colors[Math.abs(hash) % createDebug.colors.length];
	}
	createDebug.selectColor = selectColor;

	/**
	* Create a debugger with the given `namespace`.
	*
	* @param {String} namespace
	* @return {Function}
	* @api public
	*/
	function createDebug(namespace) {
		let prevTime;
		let enableOverride = null;
		let namespacesCache;
		let enabledCache;

		function debug(...args) {
			// Disabled?
			if (!debug.enabled) {
				return;
			}

			const self = debug;

			// Set `diff` timestamp
			const curr = Number(new Date());
			const ms = curr - (prevTime || curr);
			self.diff = ms;
			self.prev = prevTime;
			self.curr = curr;
			prevTime = curr;

			args[0] = createDebug.coerce(args[0]);

			if (typeof args[0] !== 'string') {
				// Anything else let's inspect with %O
				args.unshift('%O');
			}

			// Apply any `formatters` transformations
			let index = 0;
			args[0] = args[0].replace(/%([a-zA-Z%])/g, (match, format) => {
				// If we encounter an escaped % then don't increase the array index
				if (match === '%%') {
					return '%';
				}
				index++;
				const formatter = createDebug.formatters[format];
				if (typeof formatter === 'function') {
					const val = args[index];
					match = formatter.call(self, val);

					// Now we need to remove `args[index]` since it's inlined in the `format`
					args.splice(index, 1);
					index--;
				}
				return match;
			});

			// Apply env-specific formatting (colors, etc.)
			createDebug.formatArgs.call(self, args);

			const logFn = self.log || createDebug.log;
			logFn.apply(self, args);
		}

		debug.namespace = namespace;
		debug.useColors = createDebug.useColors();
		debug.color = createDebug.selectColor(namespace);
		debug.extend = extend;
		debug.destroy = createDebug.destroy; // XXX Temporary. Will be removed in the next major release.

		Object.defineProperty(debug, 'enabled', {
			enumerable: true,
			configurable: false,
			get: () => {
				if (enableOverride !== null) {
					return enableOverride;
				}
				if (namespacesCache !== createDebug.namespaces) {
					namespacesCache = createDebug.namespaces;
					enabledCache = createDebug.enabled(namespace);
				}

				return enabledCache;
			},
			set: v => {
				enableOverride = v;
			}
		});

		// Env-specific initialization logic for debug instances
		if (typeof createDebug.init === 'function') {
			createDebug.init(debug);
		}

		return debug;
	}

	function extend(namespace, delimiter) {
		const newDebug = createDebug(this.namespace + (typeof delimiter === 'undefined' ? ':' : delimiter) + namespace);
		newDebug.log = this.log;
		return newDebug;
	}

	/**
	* Enables a debug mode by namespaces. This can include modes
	* separated by a colon and wildcards.
	*
	* @param {String} namespaces
	* @api public
	*/
	function enable(namespaces) {
		createDebug.save(namespaces);
		createDebug.namespaces = namespaces;

		createDebug.names = [];
		createDebug.skips = [];

		const split = (typeof namespaces === 'string' ? namespaces : '')
			.trim()
			.replace(/\s+/g, ',')
			.split(',')
			.filter(Boolean);

		for (const ns of split) {
			if (ns[0] === '-') {
				createDebug.skips.push(ns.slice(1));
			} else {
				createDebug.names.push(ns);
			}
		}
	}

	/**
	 * Checks if the given string matches a namespace template, honoring
	 * asterisks as wildcards.
	 *
	 * @param {String} search
	 * @param {String} template
	 * @return {Boolean}
	 */
	function matchesTemplate(search, template) {
		let searchIndex = 0;
		let templateIndex = 0;
		let starIndex = -1;
		let matchIndex = 0;

		while (searchIndex < search.length) {
			if (templateIndex < template.length && (template[templateIndex] === search[searchIndex] || template[templateIndex] === '*')) {
				// Match character or proceed with wildcard
				if (template[templateIndex] === '*') {
					starIndex = templateIndex;
					matchIndex = searchIndex;
					templateIndex++; // Skip the '*'
				} else {
					searchIndex++;
					templateIndex++;
				}
			} else if (starIndex !== -1) { // eslint-disable-line no-negated-condition
				// Backtrack to the last '*' and try to match more characters
				templateIndex = starIndex + 1;
				matchIndex++;
				searchIndex = matchIndex;
			} else {
				return false; // No match
			}
		}

		// Handle trailing '*' in template
		while (templateIndex < template.length && template[templateIndex] === '*') {
			templateIndex++;
		}

		return templateIndex === template.length;
	}

	/**
	* Disable debug output.
	*
	* @return {String} namespaces
	* @api public
	*/
	function disable() {
		const namespaces = [
			...createDebug.names,
			...createDebug.skips.map(namespace => '-' + namespace)
		].join(',');
		createDebug.enable('');
		return namespaces;
	}

	/**
	* Returns true if the given mode name is enabled, false otherwise.
	*
	* @param {String} name
	* @return {Boolean}
	* @api public
	*/
	function enabled(name) {
		for (const skip of createDebug.skips) {
			if (matchesTemplate(name, skip)) {
				return false;
			}
		}

		for (const ns of createDebug.names) {
			if (matchesTemplate(name, ns)) {
				return true;
			}
		}

		return false;
	}

	/**
	* Coerce `val`.
	*
	* @param {Mixed} val
	* @return {Mixed}
	* @api private
	*/
	function coerce(val) {
		if (val instanceof Error) {
			return val.stack || val.message;
		}
		return val;
	}

	/**
	* XXX DO NOT USE. This is a temporary stub function.
	* XXX It WILL be removed in the next major release.
	*/
	function destroy() {
		console.warn('Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.');
	}

	createDebug.enable(createDebug.load());

	return createDebug;
}

module.exports = setup;
bxx:/**
 * Detect Electron renderer / nwjs process, which is node, but we should
 * treat as a browser.
 */

if (typeof process === 'undefined' || process.type === 'renderer' || process.browser === true || process.__nwjs) {
	module.exports = require('./browser.js');
} else {
	module.exports = require('./node.js');
}
ioxx/**
 * Module dependencies.
 */

const tty = require('tty');
const util = require('util');

/**
 * This is the Node.js implementation of `debug()`.
 */

exports.init = init;
exports.log = log;
exports.formatArgs = formatArgs;
exports.save = save;
exports.load = load;
exports.useColors = useColors;
exports.destroy = util.deprecate(
	() => {},
	'Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.'
);

/**
 * Colors.
 */

exports.colors = [6, 2, 3, 4, 5, 1];

try {
	// Optional dependency (as in, doesn't need to be installed, NOT like optionalDependencies in package.json)
	// eslint-disable-next-line import/no-extraneous-dependencies
	const supportsColor = require('supports-color');

	if (supportsColor && (supportsColor.stderr || supportsColor).level >= 2) {
		exports.colors = [
			20,
			21,
			26,
			27,
			32,
			33,
			38,
			39,
			40,
			41,
			42,
			43,
			44,
			45,
			56,
			57,
			62,
			63,
			68,
			69,
			74,
			75,
			76,
			77,
			78,
			79,
			80,
			81,
			92,
			93,
			98,
			99,
			112,
			113,
			128,
			129,
			134,
			135,
			148,
			149,
			160,
			161,
			162,
			163,
			164,
			165,
			166,
			167,
			168,
			169,
			170,
			171,
			172,
			173,
			178,
			179,
			184,
			185,
			196,
			197,
			198,
			199,
			200,
			201,
			202,
			203,
			204,
			205,
			206,
			207,
			208,
			209,
			214,
			215,
			220,
			221
		];
	}
} catch (error) {
	// Swallow - we only care if `supports-color` is available; it doesn't have to be.
}

/**
 * Build up the default `inspectOpts` object from the environment variables.
 *
 *   $ DEBUG_COLORS=no DEBUG_DEPTH=10 DEBUG_SHOW_HIDDEN=enabled node script.js
 */

exports.inspectOpts = Object.keys(process.env).filter(key => {
	return /^debug_/i.test(key);
}).reduce((obj, key) => {
	// Camel-case
	const prop = key
		.substring(6)
		.toLowerCase()
		.replace(/_([a-z])/g, (_, k) => {
			return k.toUpperCase();
		});

	// Coerce string value into JS value
	let val = process.env[key];
	if (/^(yes|on|true|enabled)$/i.test(val)) {
		val = true;
	} else if (/^(no|off|false|disabled)$/i.test(val)) {
		val = false;
	} else if (val === 'null') {
		val = null;
	} else {
		val = Number(val);
	}

	obj[prop] = val;
	return obj;
}, {});

/**
 * Is stdout a TTY? Colored output is enabled when `true`.
 */

function useColors() {
	return 'colors' in exports.inspectOpts ?
		Boolean(exports.inspectOpts.colors) :
		tty.isatty(process.stderr.fd);
}

/**
 * Adds ANSI color escape codes if enabled.
 *
 * @api public
 */

function formatArgs(args) {
	const {namespace: name, useColors} = this;

	if (useColors) {
		const c = this.color;
		const colorCode = '\u001B[3' + (c < 8 ? c : '8;5;' + c);
		const prefix = `  ${colorCode};1m${name} \u001B[0m`;

		args[0] = prefix + args[0].split('\n').join('\n' + prefix);
		args.push(colorCode + 'm+' + module.exports.humanize(this.diff) + '\u001B[0m');
	} else {
		args[0] = getDate() + name + ' ' + args[0];
	}
}

function getDate() {
	if (exports.inspectOpts.hideDate) {
		return '';
	}
	return new Date().toISOString() + ' ';
}

/**
 * Invokes `util.formatWithOptions()` with the specified arguments and writes to stderr.
 */

function log(...args) {
	return process.stderr.write(util.formatWithOptions(exports.inspectOpts, ...args) + '\n');
}

/**
 * Save `namespaces`.
 *
 * @param {String} namespaces
 * @api private
 */
function save(namespaces) {
	if (namespaces) {
		process.env.DEBUG = namespaces;
	} else {
		// If you set a process.env field to null or undefined, it gets cast to the
		// string 'null' or 'undefined'. Just delete instead.
		delete process.env.DEBUG;
	}
}

/**
 * Load `namespaces`.
 *
 * @return {String} returns the previously persisted debug modes
 * @api private
 */

function load() {
	return process.env.DEBUG;
}

/**
 * Init logic for `debug` instances.
 *
 * Create a new `inspectOpts` object in case `useColors` is set
 * differently for a particular `debug` instance.
 */

function init(debug) {
	debug.inspectOpts = {};

	const keys = Object.keys(exports.inspectOpts);
	for (let i = 0; i < keys.length; i++) {
		debug.inspectOpts[keys[i]] = exports.inspectOpts[keys[i]];
	}
}

module.exports = require('./common')(exports);

const {formatters} = module.exports;

/**
 * Map %o to `util.inspect()`, all on a single line.
 */

formatters.o = function (v) {
	this.inspectOpts.colors = this.useColors;
	return util.inspect(v, this.inspectOpts)
		.split('\n')
		.map(str => str.trim())
		.join(' ');
};

/**
 * Map %O to `util.inspect()`, allowing multiple lines if needed.
 */

formatters.O = function (v) {
	this.inspectOpts.colors = this.useColors;
	return util.inspect(v, this.inspectOpts);
};
mxd100644 index.d.ts K>GIˡI100644 index.d.ts.map [2t3FZr100644 index.dom.d.ts ?BX&rF]n=100644 index.dom.d.ts.map \S\>5׸k=100644 index.dom.js G~Mlb60Rg+/]100644 index.js *(%'pu:\100644 license Zbv8f,Q)100644 package.json z'q;Y#100644 readme.md sQh*ё HG|̳x/**
 * Decode a single character reference (without the `&` or `;`).
 * You probably only need this when you’re building parsers yourself that follow
 * different rules compared to HTML.
 * This is optimized to be tiny in browsers.
 *
 * @param {string} value
 *   `notin` (named), `#123` (deci), `#x123` (hexa).
 * @returns {string|false}
 *   Decoded reference.
 */
export function decodeNamedCharacterReference(value: string): string | false;
//# sourceMappingURL=index.d.ts.maph6	x b{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAKA;;;;;;;;;;GAUG;AACH,qDALW,MAAM,GAEJ,MAAM,GAAC,KAAK,CAKxB"}X/Ax L/**
 * @param {string} value
 * @returns {string | false}
 */
export function decodeNamedCharacterReference(value: string): string | false;
//# sourceMappingURL=index.dom.d.ts.mapS>Ͽ	x `{"version":3,"file":"index.dom.d.ts","sourceRoot":"","sources":["index.dom.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH,qDAHW,MAAM,GACJ,MAAM,GAAG,KAAK,CAuB1B"}0@x/// <reference lib="dom" />

/* global document */

const element = document.createElement('i')

/**
 * @param {string} value
 * @returns {string | false}
 */
export function decodeNamedCharacterReference(value) {
  const characterReference = '&' + value + ';'
  element.innerHTML = characterReference
  const character = element.textContent

  // Some named character references do not require the closing semicolon
  // (`&not`, for instance), which leads to situations where parsing the assumed
  // named reference of `&notit;` will result in the string `¬it;`.
  // When we encounter a trailing semicolon after parsing, and the character
  // reference to decode was not a semicolon (`&semi;`), we can assume that the
  // matching was not complete.
  if (
    character.charCodeAt(character.length - 1) === 59 /* `;` */ &&
    value !== 'semi'
  ) {
    return false
  }

  // If the decoded string is equal to the input, the character reference was
  // not valid.
  return character === characterReference ? false : character
}
LY'xzimport {characterEntities} from 'character-entities'

// To do: next major: use `Object.hasOwn`.
const own = {}.hasOwnProperty

/**
 * Decode a single character reference (without the `&` or `;`).
 * You probably only need this when you’re building parsers yourself that follow
 * different rules compared to HTML.
 * This is optimized to be tiny in browsers.
 *
 * @param {string} value
 *   `notin` (named), `#123` (deci), `#x123` (hexa).
 * @returns {string|false}
 *   Decoded reference.
 */
export function decodeNamedCharacterReference(value) {
  return own.call(characterEntities, value) ? characterEntities[value] : false
}
U
x PE(The MIT License)

Copyright (c) Titus Wormer <tituswormer@gmail.com>TG
?
'Software'9
 C
dB
E
Y
GZ'AS IS'
B
F
RD
D
A
7k3껑x	{
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "bugs": "https://github.com/wooorm/decode-named-character-reference/issues",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "dependencies": {
    "character-entities": "^2.0.0"
  },
  "description": "Decode named character references",
  "devDependencies": {
    "@types/node": "^25.0.0",
    "c8": "^10.0.0",
    "prettier": "^3.0.0",
    "remark-cli": "^12.0.0",
    "remark-preset-wooorm": "^11.0.0",
    "type-coverage": "^2.0.0",
    "typescript": "^5.0.0",
    "xo": "^1.0.0"
  },
  "exports": {
    "convex": "./index.js",
    "deno": "./index.js",
    "edge-light": "./index.js",
    "react-native": "./index.js",
    "worker": "./index.js",
    "workerd": "./index.js",
    "browser": "./index.dom.js",
    "default": "./index.js"
  },
  "files": [
    "index.d.ts.map",
    "index.d.ts",
    "index.dom.d.ts.map",
    "index.dom.d.ts",
    "index.dom.js",
    "index.js"
  ],
  "funding": {
    "type": "github",
    "url": "https://github.com/sponsors/wooorm"
  },
  "keywords": [
    "character",
    "decode",
    "named",
    "references"
  ],
  "license": "MIT",
  "main#": "to do: next major: remove field",
  "main": "index.js",
  "name": "decode-named-character-reference",
  "prettier": {
    "bracketSpacing": false,
    "semi": false,
    "singleQuote": true,
    "tabWidth": 2,
    "trailingComma": "none",
    "useTabs": false
  },
  "remarkConfig": {
    "plugins": [
      "remark-preset-wooorm"
    ]
  },
  "repository": "wooorm/decode-named-character-reference",
  "scripts": {
    "build": "tsc --build --clean && tsc --build && type-coverage",
    "format": "remark --frail --output --quiet -- . && prettier --log-level warn --write -- . && xo --fix",
    "test-api": "node --conditions development test.js",
    "test-coverage": "c8 --100 --reporter lcov -- npm run test-api",
    "test": "npm run build && npm run format && npm run test-coverage"
  },
  "sideEffects": false,
  "typeCoverage": {
    "atLeast": 100,
    "ignoreCatch": true
  },
  "types#": "to do: next major: remove field",
  "types": "index.d.ts",
  "type": "module",
  "version": "1.3.0",
  "xo": {
    "prettier": true,
    "rules": {
      "unicorn/prefer-code-point": "off"
    },
    "space": true
  }
}
۪x|# decode-named-character-reference

[![Build Status][build-badge]][build]
[![Coverage Status][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]

Decode named character references.

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`decodeNamedCharacterReference(value)`](#decodenamedcharacterreferencevalue)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)

## What is this?

A workaround for webpack.

## When should I use this?

Never use this.
Use [`parse-entities`][parse-entities].
It uses this.

## Install

This package is [ESM only][esm].
In Node.js (version 14.14+, 16.0+), install with [npm][]:

```sh
npm install decode-named-character-reference
```

In Deno with [`esm.sh`][esmsh]:

```js
import {decodeNamedCharacterReference} from 'https://esm.sh/decode-named-character-reference@1'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {decodeNamedCharacterReference} from 'https://esm.sh/decode-named-character-reference@1?bundle'
</script>
```

## Use

```js
import {decodeNamedCharacterReference} from 'decode-named-character-reference'

decodeNamedCharacterReference('amp') //=> '&'
```

## API

This package exports the identifier `decodeNamedCharacterReference`.
There is no default export.

### `decodeNamedCharacterReference(value)`

Again, use [`parse-entities`][parse-entities].

## Types

This package is fully typed with [TypeScript][].
It exports no additional types.

## Compatibility

This package is at least compatible with all maintained versions of Node.js.
As of now, that is Node.js 14.14+ and 16.0+.
It also works in Deno and modern browsers.

## Security

This package is safe.

## Related

* [`parse-entities`][parse-entities]
  — parse (decode) HTML character references

## Contribute

Yes please!
See [How to Contribute to Open Source][contribute].

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[author]: https://wooorm.com

[build]: https://github.com/wooorm/decode-named-character-reference/actions

[build-badge]: https://github.com/wooorm/decode-named-character-reference/workflows/main/badge.svg

[contribute]: https://opensource.guide/how-to-contribute/

[coverage]: https://codecov.io/github/wooorm/decode-named-character-reference

[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/decode-named-character-reference.svg

[downloads]: https://www.npmjs.com/package/decode-named-character-reference

[downloads-badge]: https://img.shields.io/npm/dm/decode-named-character-reference.svg

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[license]: license

[npm]: https://docs.npmjs.com/cli/install

[parse-entities]: https://github.com/wooorm/parse-entities

[size]: https://bundlephobia.com/result?p=decode-named-character-reference

[size-badge]: https://img.shields.io/bundlephobia/minzip/decode-named-character-reference.svg

[typescript]: https://www.typescriptlang.org
"cx100644 .travis.yml X7}~L0Aje100644 LICENSE Ï?a#ޔmm100644 README.markdown i;#eڤ340000 example /== Si0PV&+p100644 index.js PoySIa1>N޶\100644 package.json -xs&ʘi58:40000 test on(5!&p)ex4 language: node_js
node_js:
  - 0.6
  - 0.8
  - 0.10
/_Zx\deep-is
==========

Node's `assert.deepEqual() algorithm` as a standalone module. Exactly like
[deep-equal](https://github.com/substack/node-deep-equal) except for the fact that `deepEqual(NaN, NaN) === true`.

This module is around [5 times faster](https://gist.github.com/2790507)
than wrapping `assert.deepEqual()` in a `try/catch`.

[![browser support](http://ci.testling.com/thlorenz/deep-is.png)](http://ci.testling.com/thlorenz/deep-is)

[![build status](https://secure.travis-ci.org/thlorenz/deep-is.png)](http://travis-ci.org/thlorenz/deep-is)

example
=======

``` js
var equal = require('deep-is');
console.dir([
    equal(
        { a : [ 2, 3 ], b : [ 4 ] },
        { a : [ 2, 3 ], b : [ 4 ] }
    ),
    equal(
        { x : 5, y : [6] },
        { x : 5, y : 6 }
    )
]);
```

methods
=======

var deepIs = require('deep-is')

deepIs(a, b)
---------------

Compare objects `a` and `b`, returning whether they are equal according to a
recursive equality algorithm.

install
=======

With [npm](http://npmjs.org) do:

```
npm install deep-is
```

test
====

With [npm](http://npmjs.org) do:

```
npm test
```

license
=======

Copyright (c) 2012, 2013 Thorsten Lorenz <thlorenz@gmx.de>
Copyright (c) 2012 James Halliday <mail@substack.net>

Derived largely from node's assert module, which has the copyright statement:

Copyright (c) 2009 Thomas Robinson <280north.com>

Released under the MIT license, see LICENSE for details.
69x" 100644 cmp.js gKܼ.cy\bQhkx 0var equal = require('../');
console.dir([
    equal(
        { a : [ 2, 3 ], b : [ 4 ] },
        { a : [ 2, 3 ], b : [ 4 ] }
    ),
    equal(
        { x : 5, y : [6] },
        { x : 5, y : 6 }
    )
]);
.Ix var pSlice = Array.prototype.slice;
var Object_keys = typeof Object.keys === 'function'
    ? Object.keys
    : function (obj) {
        var keys = [];
        for (var key in obj) keys.push(key);
        return keys;
    }
;

var deepEqual = module.exports = function (actual, expected) {
  // enforce Object.is +0 !== -0
  if (actual === 0 && expected === 0) {
    return areZerosEqual(actual, expected);

  // 7.1. All identical values are equivalent, as determined by ===.
  } else if (actual === expected) {
    return true;

  } else if (actual instanceof Date && expected instanceof Date) {
    return actual.getTime() === expected.getTime();

  } else if (isNumberNaN(actual)) {
    return isNumberNaN(expected);

  // 7.3. Other pairs that do not both pass typeof value == 'object',
  // equivalence is determined by ==.
  } else if (typeof actual != 'object' && typeof expected != 'object') {
    return actual == expected;

  // 7.4. For all other Object pairs, including Array objects, equivalence is
  // determined by having the same number of owned properties (as verified
  // with Object.prototype.hasOwnProperty.call), the same set of keys
  // (although not necessarily the same order), equivalent values for every
  // corresponding key, and an identical 'prototype' property. Note: this
  // accounts for both named and indexed properties on Arrays.
  } else {
    return objEquiv(actual, expected);
  }
};

function isUndefinedOrNull(value) {
  return value === null || value === undefined;
}

function isArguments(object) {
  return Object.prototype.toString.call(object) == '[object Arguments]';
}

function isNumberNaN(value) {
  // NaN === NaN -> false
  return typeof value == 'number' && value !== value;
}

function areZerosEqual(zeroA, zeroB) {
  // (1 / +0|0) -> Infinity, but (1 / -0) -> -Infinity and (Infinity !== -Infinity)
  return (1 / zeroA) === (1 / zeroB);
}

function objEquiv(a, b) {
  if (isUndefinedOrNull(a) || isUndefinedOrNull(b))
    return false;

  // an identical 'prototype' property.
  if (a.prototype !== b.prototype) return false;
  //~~~I've managed to break Object.keys through screwy arguments passing.
  //   Converting to array solves the problem.
  if (isArguments(a)) {
    if (!isArguments(b)) {
      return false;
    }
    a = pSlice.call(a);
    b = pSlice.call(b);
    return deepEqual(a, b);
  }
  try {
    var ka = Object_keys(a),
        kb = Object_keys(b),
        key, i;
  } catch (e) {//happens when one is a string literal and the other isn't
    return false;
  }
  // having the same number of owned properties (keys incorporates
  // hasOwnProperty)
  if (ka.length != kb.length)
    return false;
  //the same set of keys (although not necessarily the same order),
  ka.sort();
  kb.sort();
  //~~~cheap key test
  for (i = ka.length - 1; i >= 0; i--) {
    if (ka[i] != kb[i])
      return false;
  }
  //equivalent values for every corresponding key, and
  //~~~possibly expensive deep test
  for (i = ka.length - 1; i >= 0; i--) {
    key = ka[i];
    if (!deepEqual(a[key], b[key])) return false;
  }
  return true;
}
䉹;xF{
  "name": "deep-is",
  "version": "0.1.4",
  "description": "node's assert.deepEqual algorithm except for NaN being equal to NaN",
  "main": "index.js",
  "directories": {
    "lib": ".",
    "example": "example",
    "test": "test"
  },
  "scripts": {
    "test": "tape test/*.js"
  },
  "devDependencies": {
    "tape": "~1.0.2"
  },
  "repository": {
    "type": "git",
    "url": "http://github.com/thlorenz/deep-is.git"
  },
  "keywords": [
    "equality",
    "equal",
    "compare"
  ],
  "author": {
    "name": "Thorsten Lorenz",
    "email": "thlorenz@gmx.de",
    "url": "http://thlorenz.com"
  },
  "license": "MIT",
  "testling": {
    "files": "test/*.js",
    "browsers": {
      "ie": [
        6,
        7,
        8,
        9
      ],
      "ff": [
        3.5,
        10,
        15
      ],
      "chrome": [
        10,
        22
      ],
      "safari": [
        5.1
      ],
      "opera": [
        12
      ]
    }
  }
}
絛xo 100644 NaN.js ݪZw<0۴k100644 cmp.js 0q4*f.ѯ100644 neg-vs-pos-0.js &jwW4|S[fo,wxIvar test = require('tape');
var equal = require('../');

test('NaN and 0 values', function (t) {
    t.ok(equal(NaN, NaN));
    t.notOk(equal(0, NaN));
    t.ok(equal(0, 0));
    t.notOk(equal(0, 1));
    t.end();
});


test('nested NaN values', function (t) {
    t.ok(equal([ NaN, 1, NaN ], [ NaN, 1, NaN ]));
    t.end();
});
\xAvar test = require('tape');
var equal = require('../');

test('equal', function (t) {
    t.ok(equal(
        { a : [ 2, 3 ], b : [ 4 ] },
        { a : [ 2, 3 ], b : [ 4 ] }
    ));
    t.end();
});

test('not equal', function (t) {
    t.notOk(equal(
        { x : 5, y : [6] },
        { x : 5, y : 6 }
    ));
    t.end();
});

test('nested nulls', function (t) {
    t.ok(equal([ null, null, null ], [ null, null, null ]));
    t.end();
});
cvxWvar test = require('tape');
var equal = require('../');

test('0 values', function (t) {
    t.ok(equal( 0,  0), ' 0 ===  0');
    t.ok(equal( 0, +0), ' 0 === +0');
    t.ok(equal(+0, +0), '+0 === +0');
    t.ok(equal(-0, -0), '-0 === -0');

    t.notOk(equal(-0,  0), '-0 !==  0');
    t.notOk(equal(-0, +0), '-0 !== +0');

    t.end();
});

Sjx +40000 dist _ǧ԰Fz+100644 index.d.ts c9JWWb100644 license oXʎ	I040000 lite |ru*U<`t100644 package.json XjZxx100644 readme.md 4u,1z'އD[Wxq 100644 index.js |.z@EIvݯn100644 index.min.js I< -%rl&ӀUC100644 index.mjs б:a'A~٩ZĠl-xxwvar has = Object.prototype.hasOwnProperty;

function find(iter, tar, key) {
	for (key of iter.keys()) {
		if (dequal(key, tar)) return key;
	}
}

function dequal(foo, bar) {
	var ctor, len, tmp;
	if (foo === bar) return true;

	if (foo && bar && (ctor=foo.constructor) === bar.constructor) {
		if (ctor === Date) return foo.getTime() === bar.getTime();
		if (ctor === RegExp) return foo.toString() === bar.toString();

		if (ctor === Array) {
			if ((len=foo.length) === bar.length) {
				while (len-- && dequal(foo[len], bar[len]));
			}
			return len === -1;
		}

		if (ctor === Set) {
			if (foo.size !== bar.size) {
				return false;
			}
			for (len of foo) {
				tmp = len;
				if (tmp && typeof tmp === 'object') {
					tmp = find(bar, tmp);
					if (!tmp) return false;
				}
				if (!bar.has(tmp)) return false;
			}
			return true;
		}

		if (ctor === Map) {
			if (foo.size !== bar.size) {
				return false;
			}
			for (len of foo) {
				tmp = len[0];
				if (tmp && typeof tmp === 'object') {
					tmp = find(bar, tmp);
					if (!tmp) return false;
				}
				if (!dequal(len[1], bar.get(tmp))) {
					return false;
				}
			}
			return true;
		}

		if (ctor === ArrayBuffer) {
			foo = new Uint8Array(foo);
			bar = new Uint8Array(bar);
		} else if (ctor === DataView) {
			if ((len=foo.byteLength) === bar.byteLength) {
				while (len-- && foo.getInt8(len) === bar.getInt8(len));
			}
			return len === -1;
		}

		if (ArrayBuffer.isView(foo)) {
			if ((len=foo.byteLength) === bar.byteLength) {
				while (len-- && foo[len] === bar[len]);
			}
			return len === -1;
		}

		if (!ctor || typeof foo === 'object') {
			len = 0;
			for (ctor in foo) {
				if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
				if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
			}
			return Object.keys(bar).length === len;
		}
	}

	return foo !== foo && bar !== bar;
}

exports.dequal = dequal;#-Nx!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.dequal={})}(this,(function(e){var t=Object.prototype.hasOwnProperty;function r(e,t,r){for(r of e.keys())if(n(r,t))return r}function n(e,f){var i,o,u;if(e===f)return!0;if(e&&f&&(i=e.constructor)===f.constructor){if(i===Date)return e.getTime()===f.getTime();if(i===RegExp)return e.toString()===f.toString();if(i===Array){if((o=e.length)===f.length)for(;o--&&n(e[o],f[o]););return-1===o}if(i===Set){if(e.size!==f.size)return!1;for(o of e){if((u=o)&&"object"==typeof u&&!(u=r(f,u)))return!1;if(!f.has(u))return!1}return!0}if(i===Map){if(e.size!==f.size)return!1;for(o of e){if((u=o[0])&&"object"==typeof u&&!(u=r(f,u)))return!1;if(!n(o[1],f.get(u)))return!1}return!0}if(i===ArrayBuffer)e=new Uint8Array(e),f=new Uint8Array(f);else if(i===DataView){if((o=e.byteLength)===f.byteLength)for(;o--&&e.getInt8(o)===f.getInt8(o););return-1===o}if(ArrayBuffer.isView(e)){if((o=e.byteLength)===f.byteLength)for(;o--&&e[o]===f[o];);return-1===o}if(!i||"object"==typeof e){for(i in o=0,e){if(t.call(e,i)&&++o&&!t.call(f,i))return!1;if(!(i in f)||!n(e[i],f[i]))return!1}return Object.keys(f).length===o}}return e!=e&&f!=f}e.dequal=n}));,wxvvar has = Object.prototype.hasOwnProperty;

function find(iter, tar, key) {
	for (key of iter.keys()) {
		if (dequal(key, tar)) return key;
	}
}

export function dequal(foo, bar) {
	var ctor, len, tmp;
	if (foo === bar) return true;

	if (foo && bar && (ctor=foo.constructor) === bar.constructor) {
		if (ctor === Date) return foo.getTime() === bar.getTime();
		if (ctor === RegExp) return foo.toString() === bar.toString();

		if (ctor === Array) {
			if ((len=foo.length) === bar.length) {
				while (len-- && dequal(foo[len], bar[len]));
			}
			return len === -1;
		}

		if (ctor === Set) {
			if (foo.size !== bar.size) {
				return false;
			}
			for (len of foo) {
				tmp = len;
				if (tmp && typeof tmp === 'object') {
					tmp = find(bar, tmp);
					if (!tmp) return false;
				}
				if (!bar.has(tmp)) return false;
			}
			return true;
		}

		if (ctor === Map) {
			if (foo.size !== bar.size) {
				return false;
			}
			for (len of foo) {
				tmp = len[0];
				if (tmp && typeof tmp === 'object') {
					tmp = find(bar, tmp);
					if (!tmp) return false;
				}
				if (!dequal(len[1], bar.get(tmp))) {
					return false;
				}
			}
			return true;
		}

		if (ctor === ArrayBuffer) {
			foo = new Uint8Array(foo);
			bar = new Uint8Array(bar);
		} else if (ctor === DataView) {
			if ((len=foo.byteLength) === bar.byteLength) {
				while (len-- && foo.getInt8(len) === bar.getInt8(len));
			}
			return len === -1;
		}

		if (ArrayBuffer.isView(foo)) {
			if ((len=foo.byteLength) === bar.byteLength) {
				while (len-- && foo[len] === bar[len]);
			}
			return len === -1;
		}

		if (!ctor || typeof foo === 'object') {
			len = 0;
			for (ctor in foo) {
				if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
				if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
			}
			return Object.keys(bar).length === len;
		}
	}

	return foo !== foo && bar !== bar;
}
{'x4 export function dequal(foo: any, bar: any): boolean;#
1x STThe MIT License (MIT)

Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeedOS
M
L
>I
E

S
H
K
hF
M
I
THE SOFTWARE.
3ڧ	x h100644 index.d.ts c9JWWb100644 index.js >pik岃2100644 index.min.js .U6hH7MfG100644 index.mjs X t̶.:ҡ9}2x"var has = Object.prototype.hasOwnProperty;

function dequal(foo, bar) {
	var ctor, len;
	if (foo === bar) return true;

	if (foo && bar && (ctor=foo.constructor) === bar.constructor) {
		if (ctor === Date) return foo.getTime() === bar.getTime();
		if (ctor === RegExp) return foo.toString() === bar.toString();

		if (ctor === Array) {
			if ((len=foo.length) === bar.length) {
				while (len-- && dequal(foo[len], bar[len]));
			}
			return len === -1;
		}

		if (!ctor || typeof foo === 'object') {
			len = 0;
			for (ctor in foo) {
				if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
				if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
			}
			return Object.keys(bar).length === len;
		}
	}

	return foo !== foo && bar !== bar;
}

exports.dequal = dequal;O)xm!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t(e.dequal={})}(this,(function(e){var t=Object.prototype.hasOwnProperty;e.dequal=function e(r,n){var o,i;if(r===n)return!0;if(r&&n&&(o=r.constructor)===n.constructor){if(o===Date)return r.getTime()===n.getTime();if(o===RegExp)return r.toString()===n.toString();if(o===Array){if((i=r.length)===n.length)for(;i--&&e(r[i],n[i]););return-1===i}if(!o||"object"==typeof r){for(o in i=0,r){if(t.call(r,o)&&++i&&!t.call(n,o))return!1;if(!(o in n)||!e(r[o],n[o]))return!1}return Object.keys(n).length===i}}return r!=r&&n!=n}}));J21xvar has = Object.prototype.hasOwnProperty;

export function dequal(foo, bar) {
	var ctor, len;
	if (foo === bar) return true;

	if (foo && bar && (ctor=foo.constructor) === bar.constructor) {
		if (ctor === Date) return foo.getTime() === bar.getTime();
		if (ctor === RegExp) return foo.toString() === bar.toString();

		if (ctor === Array) {
			if ((len=foo.length) === bar.length) {
				while (len-- && dequal(foo[len], bar[len]));
			}
			return len === -1;
		}

		if (!ctor || typeof foo === 'object') {
			len = 0;
			for (ctor in foo) {
				if (has.call(foo, ctor) && ++len && !has.call(bar, ctor)) return false;
				if (!(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return false;
			}
			return Object.keys(bar).length === len;
		}
	}

	return foo !== foo && bar !== bar;
}
	KxJ{
  "name": "dequal",
  "version": "2.0.3",
  "repository": "lukeed/dequal",
  "description": "A tiny (304B to 489B) utility for check for deep equality",
  "unpkg": "dist/index.min.js",
  "module": "dist/index.mjs",
  "main": "dist/index.js",
  "types": "index.d.ts",
  "license": "MIT",
  "author": {
    "name": "Luke Edwards",
    "email": "luke.edwards05@gmail.com",
    "url": "https://lukeed.com"
  },
  "engines": {
    "node": ">=6"
  },
  "scripts": {
    "build": "bundt",
    "pretest": "npm run build",
    "postbuild": "echo \"lite\" | xargs -n1 cp -v index.d.ts",
    "test": "uvu -r esm test"
  },
  "files": [
    "*.d.ts",
    "dist",
    "lite"
  ],
  "exports": {
    ".": {
      "types": "./index.d.ts",
      "import": "./dist/index.mjs",
      "require": "./dist/index.js"
    },
    "./lite": {
      "types": "./index.d.ts",
      "import": "./lite/index.mjs",
      "require": "./lite/index.js"
    },
    "./package.json": "./package.json"
  },
  "modes": {
    "lite": "src/lite.js",
    "default": "src/index.js"
  },
  "keywords": [
    "deep",
    "deep-equal",
    "equality"
  ],
  "devDependencies": {
    "bundt": "1.0.2",
    "esm": "3.2.25",
    "uvu": "0.3.2"
  }
}
K쾖xn# dequal [![CI](https://github.com/lukeed/dequal/workflows/CI/badge.svg)](https://github.com/lukeed/dequal/actions)

> A tiny (304B to 489B) utility to check for deep equality

This module supports comparison of all types, including `Function`, `RegExp`, `Date`, `Set`, `Map`, `TypedArray`s, `DataView`, `null`, `undefined`, and `NaN` values. Complex values (eg, Objects, Arrays, Sets, Maps, etc) are traversed recursively.

> **Important:**
> * key order **within Objects** does not matter
> * value order **within Arrays** _does_ matter
> * values **within Sets and Maps** use value equality
> * keys **within Maps** use value equality


## Install

```
$ npm install --save dequal
```

## Modes

There are two "versions" of `dequal` available:

#### `dequal`
> **Size (gzip):** 489 bytes<br>
> **Availability:** [CommonJS](https://unpkg.com/dequal/dist/index.js), [ES Module](https://unpkg.com/dequal/dist/index.mjs), [UMD](https://unpkg.com/dequal/dist/index.min.js)

#### `dequal/lite`
> **Size (gzip):** 304 bytes<br>
> **Availability:** [CommonJS](https://unpkg.com/dequal/lite/index.js), [ES Module](https://unpkg.com/dequal/lite/index.mjs)

|  | IE9+ | Number | String | Date | RegExp | Object | Array | Class | Set | Map | ArrayBuffer | [TypedArray](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray#TypedArray_objects) | [DataView](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView) |
|-|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|
| `dequal` | :x: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `dequal/lite` | :+1: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :white_check_mark: | :x: | :x: | :x: | :x: | :x: |

> <sup>**Note:** Table scrolls horizontally!</sup>

## Usage

```js
import { dequal } from 'dequal';

dequal(1, 1); //=> true
dequal({}, {}); //=> true
dequal('foo', 'foo'); //=> true
dequal([1, 2, 3], [1, 2, 3]); //=> true
dequal(dequal, dequal); //=> true
dequal(/foo/, /foo/); //=> true
dequal(null, null); //=> true
dequal(NaN, NaN); //=> true
dequal([], []); //=> true
dequal(
  [{ a:1 }, [{ b:{ c:[1] } }]],
  [{ a:1 }, [{ b:{ c:[1] } }]]
); //=> true

dequal(1, '1'); //=> false
dequal(null, undefined); //=> false
dequal({ a:1, b:[2,3] }, { a:1, b:[2,5] }); //=> false
dequal(/foo/i, /bar/g); //=> false
```

## API

### dequal(foo, bar)
Returns: `Boolean`

Both `foo` and `bar` can be of any type.<br>
A `Boolean` is returned indicating if the two were deeply equal.


## Benchmarks

> Running Node v10.13.0

The benchmarks can be found in the [`/bench`](/bench) directory. They are separated into two categories:

* `basic` – compares an object comprised of `String`, `Number`, `Date`, `Array`, and `Object` values.
* `complex` – like `basic`, but adds `RegExp`, `Map`, `Set`, and `Uint8Array` values.

> **Note:** Only candidates that pass validation step(s) are listed. <br>For example, `fast-deep-equal/es6` handles `Set` and `Map` values, but uses _referential equality_ while those listed use _value equality_.

```
Load times:
  assert             0.109ms
  util               0.006ms
  fast-deep-equal    0.479ms
  lodash/isequal    22.826ms
  nano-equal         0.417ms
  dequal             0.396ms
  dequal/lite        0.264ms

Benchmark :: basic
  assert.deepStrictEqual  x    325,262 ops/sec ±0.57% (94 runs sampled)
  util.isDeepStrictEqual  x    318,812 ops/sec ±0.87% (94 runs sampled)
  fast-deep-equal         x  1,332,393 ops/sec ±0.36% (93 runs sampled)
  lodash.isEqual          x    269,129 ops/sec ±0.59% (95 runs sampled)
  nano-equal              x  1,122,053 ops/sec ±0.36% (96 runs sampled)
  dequal/lite             x  1,700,972 ops/sec ±0.31% (94 runs sampled)
  dequal                  x  1,698,972 ops/sec ±0.63% (97 runs sampled)

Benchmark :: complex
  assert.deepStrictEqual  x    124,518 ops/sec ±0.64% (96 runs sampled)
  util.isDeepStrictEqual  x    125,113 ops/sec ±0.24% (96 runs sampled)
  lodash.isEqual          x     58,677 ops/sec ±0.49% (96 runs sampled)
  dequal                  x    345,386 ops/sec ±0.27% (96 runs sampled)
```

## License

MIT © [Luke Edwards](https://lukeed.com)
xƮx q40000 lib |$Y߆zgjƾA100644 license Z{q&q&Zu100644 package.json ՊǮ+0!Kv;100644 readme.md 0	!S/K:6x| 100644 default.js #bVp]BfH100644 development.d.ts ?nk Z#{TG100644 development.js ~?V4d(%c@|8/x zexport function deprecate(fn) {
  return fn
}

export function equal() {}

export function ok() {}

export function unreachable() {}
g.ວxz
/**
 * Wrap a function or class to show a deprecation message when first called.
 *
 * > 👉 **Important**: only shows a message when the `development` condition is
 * > used, does nothing in production.
 *
 * When the resulting wrapped `fn` is called, emits a warning once to
 * `console.error` (`stderr`).
 * If a code is given, one warning message will be emitted in total per code.
 *
 * @template {Function} T
 *   Function or class kind.
 * @param {T} fn
 *   Function or class.
 * @param {string} message
 *   Message explaining deprecation.
 * @param {string | null | undefined} [code]
 *   Deprecation identifier (optional); deprecation messages will be generated
 *   only once per code.
 * @returns {T}
 *   Wrapped `fn`.
 */
export function deprecate<T extends Function>(
  fn: T,
  message: string,
  code?: string | null | undefined
): T
/**
 * Assert deep strict equivalence.
 *
 * > 👉 **Important**: only asserts when the `development` condition is used,
 * > does nothing in production.
 *
 * @template {unknown} T
 *   Expected kind.
 * @param {unknown} actual
 *   Value.
 * @param {T} expected
 *   Baseline.
 * @param {Error | string | null | undefined} [message]
 *   Message for assertion error (default: `'Expected values to be deeply equal'`).
 * @returns {asserts actual is T}
 *   Nothing; throws when `actual` is not deep strict equal to `expected`.
 * @throws {AssertionError}
 *   Throws when `actual` is not deep strict equal to `expected`.
 */
export function equal<T extends unknown>(
  actual: unknown,
  expected: T,
  message?: Error | string | null | undefined
): asserts actual is T
/**
 * Assert if `value` is truthy.
 *
 * > 👉 **Important**: only asserts when the `development` condition is used,
 * > does nothing in production.
 *
 * @param {unknown} value
 *   Value to assert.
 * @param {Error | string | null | undefined} [message]
 *   Message for assertion error (default: `'Expected value to be truthy'`).
 * @returns {asserts value}
 *   Nothing; throws when `value` is falsey.
 * @throws {AssertionError}
 *   Throws when `value` is falsey.
 */
export function ok(
  value: unknown,
  message?: Error | string | null | undefined
): asserts value
/**
 * Assert that a code path never happens.
 *
 * > 👉 **Important**: only asserts when the `development` condition is used,
 * > does nothing in production.
 *
 * @param {Error | string | null | undefined} [message]
 *   Message for assertion error (default: `'Unreachable'`).
 * @returns {never}
 *   Nothing; always throws.
 * @throws {AssertionError}
 *   Throws when `value` is falsey.
 */
export function unreachable(message?: Error | string | null | undefined): never
Ī4ximport {dequal} from 'dequal'

/**
 * @type {Set<string>}
 */
const codesWarned = new Set()

class AssertionError extends Error {
  name = /** @type {const} */ ('Assertion')
  code = /** @type {const} */ ('ERR_ASSERTION')

  /**
   * Create an assertion error.
   *
   * @param {string} message
   *   Message explaining error.
   * @param {unknown} actual
   *   Value.
   * @param {unknown} expected
   *   Baseline.
   * @param {string} operator
   *   Name of equality operation.
   * @param {boolean} generated
   *   Whether `message` is a custom message or not
   * @returns
   *   Instance.
   */
  // eslint-disable-next-line max-params
  constructor(message, actual, expected, operator, generated) {
    super(message)

    if (Error.captureStackTrace) {
      Error.captureStackTrace(this, this.constructor)
    }

    /**
     * @type {unknown}
     */
    this.actual = actual

    /**
     * @type {unknown}
     */
    this.expected = expected

    /**
     * @type {boolean}
     */
    this.generated = generated

    /**
     * @type {string}
     */
    this.operator = operator
  }
}

class DeprecationError extends Error {
  name = /** @type {const} */ ('DeprecationWarning')

  /**
   * Create a deprecation message.
   *
   * @param {string} message
   *   Message explaining deprecation.
   * @param {string | undefined} code
   *   Deprecation identifier; deprecation messages will be generated only once per code.
   * @returns
   *   Instance.
   */
  constructor(message, code) {
    super(message)

    /**
     * @type {string | undefined}
     */
    this.code = code
  }
}

/**
 * Wrap a function or class to show a deprecation message when first called.
 *
 * > 👉 **Important**: only shows a message when the `development` condition is
 * > used, does nothing in production.
 *
 * When the resulting wrapped `fn` is called, emits a warning once to
 * `console.error` (`stderr`).
 * If a code is given, one warning message will be emitted in total per code.
 *
 * @template {Function} T
 *   Function or class kind.
 * @param {T} fn
 *   Function or class.
 * @param {string} message
 *   Message explaining deprecation.
 * @param {string | null | undefined} [code]
 *   Deprecation identifier (optional); deprecation messages will be generated
 *   only once per code.
 * @returns {T}
 *   Wrapped `fn`.
 */
export function deprecate(fn, message, code) {
  let warned = false

  // The wrapper will keep the same prototype as fn to maintain prototype chain
  Object.setPrototypeOf(deprecated, fn)

  // @ts-expect-error: it’s perfect, typescript…
  return deprecated

  /**
   * @this {unknown}
   * @param  {...Array<unknown>} args
   * @returns {unknown}
   */
  function deprecated(...args) {
    if (!warned) {
      warned = true

      if (typeof code === 'string' && codesWarned.has(code)) {
        // Empty.
      } else {
        console.error(new DeprecationError(message, code || undefined))

        if (typeof code === 'string') codesWarned.add(code)
      }
    }

    return new.target
      ? Reflect.construct(fn, args, new.target)
      : Reflect.apply(fn, this, args)
  }
}

/**
 * Assert deep strict equivalence.
 *
 * > 👉 **Important**: only asserts when the `development` condition is used,
 * > does nothing in production.
 *
 * @template {unknown} T
 *   Expected kind.
 * @param {unknown} actual
 *   Value.
 * @param {T} expected
 *   Baseline.
 * @param {Error | string | null | undefined} [message]
 *   Message for assertion error (default: `'Expected values to be deeply equal'`).
 * @returns {asserts actual is T}
 *   Nothing; throws when `actual` is not deep strict equal to `expected`.
 * @throws {AssertionError}
 *   Throws when `actual` is not deep strict equal to `expected`.
 */
export function equal(actual, expected, message) {
  assert(
    dequal(actual, expected),
    actual,
    expected,
    'equal',
    'Expected values to be deeply equal',
    message
  )
}

/**
 * Assert if `value` is truthy.
 *
 * > 👉 **Important**: only asserts when the `development` condition is used,
 * > does nothing in production.
 *
 * @param {unknown} value
 *   Value to assert.
 * @param {Error | string | null | undefined} [message]
 *   Message for assertion error (default: `'Expected value to be truthy'`).
 * @returns {asserts value}
 *   Nothing; throws when `value` is falsey.
 * @throws {AssertionError}
 *   Throws when `value` is falsey.
 */
export function ok(value, message) {
  assert(
    Boolean(value),
    false,
    true,
    'ok',
    'Expected value to be truthy',
    message
  )
}

/**
 * Assert that a code path never happens.
 *
 * > 👉 **Important**: only asserts when the `development` condition is used,
 * > does nothing in production.
 *
 * @param {Error | string | null | undefined} [message]
 *   Message for assertion error (default: `'Unreachable'`).
 * @returns {never}
 *   Nothing; always throws.
 * @throws {AssertionError}
 *   Throws when `value` is falsey.
 */
export function unreachable(message) {
  assert(false, false, true, 'ok', 'Unreachable', message)
}

/**
 * @param {boolean} bool
 *   Whether to skip this operation.
 * @param {unknown} actual
 *   Actual value.
 * @param {unknown} expected
 *   Expected value.
 * @param {string} operator
 *   Operator.
 * @param {string} defaultMessage
 *   Default message for operation.
 * @param {Error | string | null | undefined} userMessage
 *   User-provided message.
 * @returns {asserts bool}
 *   Nothing; throws when falsey.
 */
// eslint-disable-next-line max-params
function assert(bool, actual, expected, operator, defaultMessage, userMessage) {
  if (!bool) {
    throw userMessage instanceof Error
      ? userMessage
      : new AssertionError(
          userMessage || defaultMessage,
          actual,
          expected,
          operator,
          !userMessage
        )
  }
}
G2hrx KJ(The MIT License)

Copyright (c) 2023 Titus Wormer <tituswormer@gmail.com>TG
?
'Software'9
 C
dB
E
Y
GZ'AS IS'
B
F
RD
D
A
7-4+xO'{
  "name": "devlop",
  "version": "1.1@.Do things in development and nothing otherwise,^assert",
    "deprecate",
    "develop",
    "development"
  ],
  "repository": "wooorm/devlopy!wooorm/devlop&7github",
    "url": "https://github.com/sponsors/wooorm(exports": {
    "types": "./lib/development.d.ts",
    "development": "./lib/development.js",
    "default": "./lib/default.js"!
  },
  "files": [
    "lib/"
  ]dequal2.Nrollup/plugin-node-resolve": "^15.1.0",
    "@rollup/plugin-terser": "^0.4.3",Y8esbuild": "^0.188`elopmentn&<-development.js",
    "test-api-default": "node test-default+$elopment && npm run test-api-default!
  }
}
p߲x'}# devlop

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]

Some tools to make developing easier while not including code in production.

## Contents

*   [What is this?](#what-is-this)
*   [When should I use this?](#when-should-i-use-this)
*   [Install](#install)
*   [Use](#use)
*   [API](#api)
    *   [`deprecate(fn, message[, code])`](#deprecatefn-message-code)
    *   [`equal(actual, expected[, message])`](#equalactual-expected-message)
    *   [`ok(value[, message])`](#okvalue-message)
    *   [`unreachable(message?)`](#unreachablemessage)
*   [Types](#types)
*   [Compatibility](#compatibility)
*   [Security](#security)
*   [Related](#related)
*   [Contribute](#contribute)
*   [License](#license)

## What is this?

This package lets you do things in development that are free in production.
It contains useful `assert` functions and a `deprecate` function that are
useful when developing JavaScript packages while being small in production.

If you know Rust, you might know how nice having a
[`debug_assert!`][rust-debug-assert] is.
This is that, and a bit more.
For more on why they’re nice, see
[“Rust’s Two Kinds of ‘Assert’ Make for Better Code”][rust-two-kinds]

## When should I use this?

Many JavaScript programs do not use assertions at all (perhaps because they’re
typed and so assume type safety) or include lots of code to throw errors when
users do weird things (weighing down production code).
This package hopes to improve the sitation by making assertions free and
deprecations cheap.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install devlop
```

In Deno with [`esm.sh`][esmsh]:

```js
import {deprecate, equal, ok, unreachable} from 'https://esm.sh/devlop@1'
// For development code:
// import {deprecate, equal, ok} from 'https://esm.sh/devlop@1?conditions=development'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {deprecate, equal, ok, unreachable} from 'https://esm.sh/devlop@1?bundle'
  // For development code:
  // import {deprecate, equal, ok} from 'https://esm.sh/devlop@1?bundle&conditions=development'
</script>
```

## Use

Say we have a small ponyfill for the ES5 `String#includes` function.
It’s deprecated, because folks can use `String#includes` nowadays.
It’s nicely typed so users should be able to figure out what to pass but we
include assertions to show nicer errors when they get it wrong.

`example/string-includes.js`:

```js
import {deprecate, ok} from 'devlop'

export const stringIncludes = deprecate(
  includes,
  'Since ES5, please use `String#includes` itself.'
)

/**
 * @deprecated
 *   Since ES5, please use `String#includes` itself.
 * @param {string} value
 *   Value to search in.
 * @param {string} search
 *   Value to search for.
 * @param {number | undefined} [position=0]
 *   Position to search from (default: `0`).
 * @returns {boolean}
 *   Whether the searched for value exists in the searched value after position.
 */
function includes(value, search, position) {
  ok(typeof value === 'string', 'expected string for `value`')
  ok(typeof search === 'string', 'expected string for `search`')
  ok(position === undefined || typeof position === 'number', 'expected number')
  ok(
    position === undefined ||
      (typeof position === 'number' &&
        !(/* #__PURE__ */ Number.isNaN(position))),
    'expected number'
  )
  // eslint-disable-next-line unicorn/prefer-includes
  return value.indexOf(search, position || 0) !== -1
}
```

`example/index.js`:

```js
import {stringIncludes} from './example-includes.js'

console.log(stringIncludes('blue whale', 'dolphin')) //=> false
console.log(stringIncludes('blue whale', 'whale')) //=> true
```

Say we’d bundle that in development with [`esbuild`][esbuild] and check the
gzip size ([`gzip-size-cli`][gzip-size-cli]), we’d get 1.02 kB of code:

```sh
$ esbuild example/index.js --bundle --conditions=development --format=esm --minify --target=es2022 | gzip-size
1.02 kB
```

But because `devlop` is light in production we’d get:

```sh
$ esbuild example/index.js --bundle --format=esm --minify --target=es2022 | gzip-size
169 B
```

The bundle looks as follows:

```js
function u(n){return n}var r=u(c,"Since ES5, please use `String#includes` itself.");function c(n,t,e){return n.indexOf(t,e||0)!==-1}console.log(r("blue whale","dolphin"));console.log(r("blue whale","whale"));
```

It depends a bit on which bundler and minifier you use how small the code is:
esbuild keeps the unused message parameter to the `deprecate` function around
and does not know `Number.isNaN` can be dropped without a `/* #__PURE__ */`
annotation.

[`rollup`][rollup] with [`@rollup/plugin-node-resolve`][node-resolve]
and [`@rollup/plugin-terser`][terser] performs even better:

```sh
$ rollup example/index.js -p node-resolve -p terser | gzip-size
118 B
```

The bundle looks as follows:

```js
const l=function(l,e,o){return-1!==l.indexOf(e,o||0)};console.log(l("blue whale","dolphin")),console.log(l("blue whale","whale"));
```

Rollup doesn’t need the `/* #__PURE__ */` comment either!

## API

This package exports the identifiers [`deprecate`][api-deprecate],
[`equal`][api-equal], [`ok`][api-ok], and [`unreachable`][api-unreachable].
There is no default export.

The export map supports the [`development` condition][node-condition].
Run `node --conditions development module.js` to get dev code.
Without this condition, no-ops are loaded.

### `deprecate(fn, message[, code])`

Wrap a function or class to show a deprecation message when first called.

> 👉 **Important**: only shows a message when the `development` condition is
> used, does nothing in production.

When the resulting wrapped `fn` is called, emits a warning once to
`console.error` (`stderr`).
If a code is given, one warning message will be emitted in total per code.

###### Parameters

*   `fn` (`Function`)
    — function or class
*   `message` (`string`)
    — message explaining deprecation
*   `code` (`string`, optional)
    — deprecation identifier (optional); deprecation messages will be generated
    only once per code

###### Returns

Wrapped `fn`.

### `equal(actual, expected[, message])`

Assert deep strict equivalence.

> 👉 **Important**: only asserts when the `development` condition is used, does
> nothing in production.

###### Parameters

*   `actual` (`unknown`)
    — value
*   `expected` (`unknown`)
    — baseline
*   `message` (`Error` or `string`, default: `'Expected values to be deeply
    equal'`)
    — message for assertion error

###### Returns

Nothing (`undefined`).

###### Throws

Throws (`AssertionError`) when `actual` is not deep strict equal to `expected`.

### `ok(value[, message])`

Assert if `value` is truthy.

> 👉 **Important**: only asserts when the `development` condition is used, does
> nothing in production.

###### Parameters

*   `actual` (`unknown`)
    — value to assert
*   `message` (`Error` or `string`, default: `'Expected value to be truthy'`)
    — message for assertion error

###### Returns

Nothing (`undefined`).

###### Throws

Throws (`AssertionError`) when `value` is falsey.

### `unreachable(message?)`

Assert that a code path never happens.

> 👉 **Important**: only asserts when the `development` condition is used,
> does nothing in production.

###### Parameters

*   `message` (`Error` or `string`, default: `'Unreachable'`)
    — message for assertion error

###### Returns

Never (`never`).

###### Throws

Throws (`AssertionError`), always.

## Types

This package is fully typed with [TypeScript][].
It exports no additional types.

## Compatibility

This project is compatible with maintained versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line, `devlop@^1`,
compatible with Node.js 16.

## Security

This package is safe.

## Related

*   [`babel-plugin-unassert`](https://github.com/unassert-js/babel-plugin-unassert)
    — encourage reliable programming with assertions while compiling them away
    in production (can remove arbitrary `assert` modules, works regardless of
    conditions, so has to be configured by the end user)

## Contribute

Yes please!
See [How to Contribute to Open Source][contribute].

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definition -->

[build-badge]: https://github.com/wooorm/devlop/workflows/main/badge.svg

[build]: https://github.com/wooorm/devlop/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/devlop.svg

[coverage]: https://codecov.io/github/wooorm/devlop

[downloads-badge]: https://img.shields.io/npm/dm/devlop.svg

[downloads]: https://www.npmjs.com/package/devlop

[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=devlop

[size]: https://bundlejs.com/?q=devlop

[npm]: https://docs.npmjs.com/cli/install

[esmsh]: https://esm.sh

[license]: license

[author]: https://wooorm.com

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[typescript]: https://www.typescriptlang.org

[contribute]: https://opensource.guide/how-to-contribute/

[node-condition]: https://nodejs.org/api/packages.html#packages_resolving_user_conditions

[rust-debug-assert]: https://doc.rust-lang.org/std/macro.debug_assert.html

[rust-two-kinds]: https://tratt.net/laurie/blog/2023/rusts_two_kinds_of_assert_make_for_better_code.html

[esbuild]: https://esbuild.github.io

[gzip-size-cli]: https://github.com/sindresorhus/gzip-size-cli/tree/main

[rollup]: https://rollupjs.org

[node-resolve]: https://github.com/rollup/plugins/tree/master/packages/node-resolve

[terser]: https://github.com/rollup/plugins/tree/master/packages/terser#readme

[api-deprecate]: #deprecatefn-message-code

[api-equal]: #equalactual-expected-message

[api-ok]: #okvalue-message

[api-unreachable]: #unreachablemessage
Q,x E100644 index.d.ts }4HE	`cKk100644 index.js 8|VvD}&`Y^100644 license |JW?z100644 package.json JK,o	zwOMD100644 readme.md )E#oz'A9.Kx,/**
Escape RegExp special characters.

You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character class.

@example
```
import escapeStringRegexp = require('escape-string-regexp');

const escapedString = escapeStringRegexp('How much $ for a 🦄?');
//=> 'How much \\$ for a 🦄\\?'

new RegExp(escapedString);
```
*/
declare const escapeStringRegexp: (string: string) => string;

export = escapeStringRegexp;
x*export default function escapeStringRegexp(string) {
	if (typeof string !== 'string') {
		throw new TypeError('Expected a string');
	}

	// Escape characters with special meaning either inside or outside character sets.
	// Use a simple backslash escape when it’s always valid, and a `\xnn` escape when the simpler form would be disallowed by Unicode patterns’ stricter grammar.
	return string
		.replace(/[|\\{}()[\]^$+*?.]/g, '\\$&')
		.replace(/-/g, '\\x2d');
}
pbx? )'use strict';

module.exports = string =>2\unnnn$;
ǥ]x Chttps://CI]s*xQ{
	"name": "escape-string-regexp",
	"version": "4.0.0",
	"description": "Escape RegExp special characters",
	"license": "MIT",
	"repository": "sindresorhus/escape-string-regexp",
	"funding": "https://github.com/sponsors/sindresorhus",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "https://sindresorhus.com"
	},
	"engines": {
		"node": ">=10"
	},
	"scripts": {
		"test": "xo && ava && tsd"
	},
	"files": [
		"index.js",
		"index.d.ts"
	],
	"keywords": [
		"escape",
		"regex",
		"regexp",
		"regular",
		"expression",
		"string",
		"special",
		"characters"
	],
	"devDependencies": {
		"ava": "^1.4.1",
		"tsd": "^0.11.0",
		"xo": "^0.28.3"
	}
}
qQBx## escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp)

> Escape RegExp special characters

## Install

```
$ npm install escape-string-regexp
```

## Usage

```js
const escapeStringRegexp = require('escape-string-regexp');

const escapedString = escapeStringRegexp('How much $ for a 🦄?');
//=> 'How much \\$ for a 🦄\\?'

new RegExp(escapedString);
```

You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character class.

---

<div align="center">
	<b>
		<a href="https://tidelift.com/subscription/pkg/npm-escape-string-regexp?utm_source=npm-escape-string-regexp&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
	</b>
	<br>
	<sub>
		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
	</sub>
</div>
wDx p100644 LICENSE o\aO0;e(Qs100644 README.md RC cJO'Axu40000 dist 5	5100644 package.json 5u=>SvwS+[K4Bx/MIT License

Copyright (c) 2017 Toru Nagashima

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
U9x3# eslint-plugin-vue

[![NPM version](https://img.shields.io/npm/v/eslint-plugin-vue.svg?style=flat)](https://npmjs.org/package/eslint-plugin-vue)
[![NPM downloads](https://img.shields.io/npm/dm/eslint-plugin-vue.svg?style=flat)](https://npmjs.org/package/eslint-plugin-vue)
[![CI](https://img.shields.io/github/actions/workflow/status/vuejs/eslint-plugin-vue/CI.yml?style=flat&label=CI)](https://github.com/vuejs/eslint-plugin-vue/actions/workflows/CI.yml)
[![License](https://img.shields.io/github/license/vuejs/eslint-plugin-vue.svg?style=flat)](https://github.com/vuejs/eslint-plugin-vue/blob/master/LICENSE)

> Official ESLint plugin for Vue.js

## :book: Documentation

Please refer to the [official website](https://eslint.vuejs.org).

## :anchor: Versioning Policy

This plugin follows [Semantic Versioning].
However, please note that we do not follow [ESLint's Semantic Versioning Policy].
In minor version releases, this plugin may change the sharable configs provided by the plugin or the default behavior of the plugin's rules in order to add features to the plugin. Because we want to add many features to the plugin soon, so that users can easily take advantage of new features in Vue and Nuxt.

According to our policy, any minor update may report more linting errors than the previous release. As such, we recommend using the [tilde (`~`)](https://semver.npmjs.com/#syntax-examples) in `package.json` to guarantee the results of your builds.

[Semantic Versioning]: https://semver.org/
[ESLint's Semantic Versioning Policy]: https://github.com/eslint/eslint#semantic-versioning-policy

## :newspaper: Releases

This project uses [GitHub Releases](https://github.com/vuejs/eslint-plugin-vue/releases).

## :beers: Contribution Guide

Contributing is welcome! See the [ESLint Vue Plugin Developer Guide](https://eslint.vuejs.org/developer-guide).

### Working With Rules

Be sure to read the [official ESLint guide](https://eslint.org/docs/developer-guide/working-with-rules) before you start writing a new rule.

To see what an abstract syntax tree (AST) of your code looks like, you may use [AST Explorer](https://astexplorer.net). After opening [AST Explorer](https://astexplorer.net), select `Vue` as the syntax and [`vue-eslint-parser`](https://github.com/vuejs/vue-eslint-parser) as the parser.

The default JavaScript parser must be replaced because [Vue.js single file components](https://vuejs.org/guide/scaling-up/sfc.html) are not plain JavaScript, but a custom file format. [`vue-eslint-parser`](https://github.com/vuejs/vue-eslint-parser) is a replacement parser that generates an enhanced AST with nodes that represent specific parts of the template syntax, as well as the contents of the `<script>` tag.

To learn more about certain nodes in a produced AST, see the [ESTree project page](https://github.com/estree/estree) and the [vue-eslint-parser AST documentation](https://github.com/vuejs/vue-eslint-parser/blob/master/docs/ast.md).

[`vue-eslint-parser`](https://github.com/vuejs/vue-eslint-parser) provides a few useful parser services to help traverse the produced AST and access template tokens:

- `context.parserServices.defineTemplateBodyVisitor(visitor, scriptVisitor)`
- `context.parserServices.getTemplateBodyTokenStore()`

Check out an [example rule](https://github.com/vuejs/eslint-plugin-vue/blob/master/lib/rules/mustache-interpolation-spacing.js) to see usage of these services.

Be aware that depending on the code samples you write in tests, the `RuleTester` parser property must be set accordingly (this can be done on a test by test basis). See an [example here](https://github.com/vuejs/eslint-plugin-vue/blob/master/tests/lib/rules/attribute-hyphenation.test.ts#L17).

If you're stuck, remember there are many rules available for reference. If you can't find the right solution, don't hesitate to reach out in [issues](https://github.com/vuejs/eslint-plugin-vue/issues) – we're happy to help!

## :lock: License

See the [LICENSE](./LICENSE) file for license rights and limitations (MIT).
Wx?40000 _virtual 6bfK{{)#40000 configs (+HBk3I100644 eslint-typegen.d.ts (Hb%aDOA100644 index.d.ts e;FDׁ4Mˠ100644 index.js !$ dZ2o100644 meta.js oɴcá
hK X[100644 package.js a*6cex{/100644 plugin.js h-aaLca1e100644 processor.js @ݰI%hg100644 removed-rules.js \-߄5{40000 rules Ǌ☢aJ\<40000 utils Փ1ʚ}̰qJFx$ 40000 _rolldown SkSK4N<Ԍȥ"3Ȧx& 100644 runtime.js \TKZޢ zdAQ1Hxt//#region \0rolldown/runtime.js
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
var __copyProps = (to, from, except, desc) => {
	if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
		key = keys[i];
		if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
			get: ((k) => from[k]).bind(null, key),
			enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
		});
	}
	return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
	value: mod,
	enumerable: true
}) : target, mod));
//#endregion
exports.__commonJSMin = __commonJSMin;
exports.__toESM = __toESM;
y*x]100644 base.js ˸2oȅcy6B5\>p7N40000 flat K Q(=5R100644 index.js ~o@&K^ОW100644 no-layout-rules.js (D
O1VVx100644 vue2-essential.js ݹ9Fr*tK100644 vue2-recommended-error.js G~@3KE%n#100644 vue2-recommended.js {	yL>p<>.y100644 vue2-strongly-recommended-error.js ośWZ;UT100644 vue2-strongly-recommended.js 23%g%*cFzr6B100644 vue3-essential.js AЖ/UnPw6d"100644 vue3-recommended-error.js $a@[qƔZ"Z100644 vue3-recommended.js m.ξcd1U100644 vue3-strongly-recommended-error.js Ol	!5H100644 vue3-strongly-recommended.js Qܱٵ=YXt0aðx`//#region lib/configs/base.ts
var base_default = {
	parserOptions: {
		ecmaVersion: "latest",
		sourceType: "module"
	},
	plugins: ["vue"],
	rules: {
		"vue/comment-directive": "error",
		"vue/jsx-uses-vars": "error"
	},
	overrides: [{
		files: "*.vue",
		parser: require.resolve("vue-eslint-parser")
	}]
};
//#endregion
module.exports = base_default;
Xs #x1100644 base.js ܒX(/0Jދ100644 vue2-essential.js 68!eI?mx
wZ100644 vue2-recommended-error.js ʄJI%!e100644 vue2-recommended.js :+FYl0100644 vue2-strongly-recommended-error.js /'Ԅ8aVY100644 vue2-strongly-recommended.js #/J uˎ100644 vue3-essential.js 桞A0"ԐtAN100644 vue3-recommended-error.js 7Vwux,jcØ*k100644 vue3-recommended.js eX{>fhFA100644 vue3-strongly-recommended-error.js Qfd
11100644 vue3-strongly-recommended.js uaQUpEYxL1xconst require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_plugin = require("../../plugin.js");
let vue_eslint_parser = require("vue-eslint-parser");
vue_eslint_parser = require_runtime.__toESM(vue_eslint_parser);
//#region lib/configs/flat/base.ts
var base_default = [{
	name: "vue/base/setup",
	plugins: { get vue() {
		return require_plugin.default;
	} },
	languageOptions: { sourceType: "module" }
}, {
	name: "vue/base/setup-for-vue",
	files: ["*.vue", "**/*.vue"],
	plugins: { get vue() {
		return require_plugin.default;
	} },
	languageOptions: {
		parser: vue_eslint_parser.default,
		sourceType: "module"
	},
	rules: {
		"vue/comment-directive": "error",
		"vue/jsx-uses-vars": "error"
	},
	processor: "vue/vue"
}];
//#endregion
module.exports = base_default;
zx,//#region lib/configs/flat/vue3-essential.ts
var vue3_essential_default = [...require("./base.js"), {
	name: "vue/essential/rules",
	rules: {
		"vue/multi-word-component-names": "error",
		"vue/no-arrow-functions-in-watch": "error",
		"vue/no-async-in-computed-properties": "error",
		"vue/no-child-content": "error",
		"vue/no-computed-properties-in-data": "error",
		"vue/no-deprecated-data-object-declaration": "error",
		"vue/no-deprecated-delete-set": "error",
		"vue/no-deprecated-destroyed-lifecycle": "error",
		"vue/no-deprecated-dollar-listeners-api": "error",
		"vue/no-deprecated-dollar-scopedslots-api": "error",
		"vue/no-deprecated-events-api": "error",
		"vue/no-deprecated-filter": "error",
		"vue/no-deprecated-functional-template": "error",
		"vue/no-deprecated-html-element-is": "error",
		"vue/no-deprecated-inline-template": "error",
		"vue/no-deprecated-model-definition": "error",
		"vue/no-deprecated-props-default-this": "error",
		"vue/no-deprecated-router-link-tag-prop": "error",
		"vue/no-deprecated-scope-attribute": "error",
		"vue/no-deprecated-slot-attribute": "error",
		"vue/no-deprecated-slot-scope-attribute": "error",
		"vue/no-deprecated-v-bind-sync": "error",
		"vue/no-deprecated-v-is": "error",
		"vue/no-deprecated-v-on-native-modifier": "error",
		"vue/no-deprecated-v-on-number-modifiers": "error",
		"vue/no-deprecated-vue-config-keycodes": "error",
		"vue/no-dupe-keys": "error",
		"vue/no-dupe-v-else-if": "error",
		"vue/no-duplicate-attributes": "error",
		"vue/no-export-in-script-setup": "error",
		"vue/no-expose-after-await": "error",
		"vue/no-lifecycle-after-await": "error",
		"vue/no-mutating-props": "error",
		"vue/no-parsing-error": "error",
		"vue/no-ref-as-operand": "error",
		"vue/no-reserved-component-names": "error",
		"vue/no-reserved-keys": "error",
		"vue/no-reserved-props": "error",
		"vue/no-shared-component-data": "error",
		"vue/no-side-effects-in-computed-properties": "error",
		"vue/no-template-key": "error",
		"vue/no-textarea-mustache": "error",
		"vue/no-unused-components": "error",
		"vue/no-unused-vars": "error",
		"vue/no-use-computed-property-like-method": "error",
		"vue/no-use-v-if-with-v-for": "error",
		"vue/no-useless-template-attributes": "error",
		"vue/no-v-for-template-key-on-child": "error",
		"vue/no-v-text-v-html-on-component": "error",
		"vue/no-watch-after-await": "error",
		"vue/prefer-import-from-vue": "error",
		"vue/require-component-is": "error",
		"vue/require-prop-type-constructor": "error",
		"vue/require-render-return": "error",
		"vue/require-slots-as-functions": "error",
		"vue/require-toggle-inside-transition": "error",
		"vue/require-v-for-key": "error",
		"vue/require-valid-default-prop": "error",
		"vue/return-in-computed-property": "error",
		"vue/return-in-emits-validator": "error",
		"vue/use-v-on-exact": "error",
		"vue/valid-attribute-name": "error",
		"vue/valid-define-emits": "error",
		"vue/valid-define-options": "error",
		"vue/valid-define-props": "error",
		"vue/valid-next-tick": "error",
		"vue/valid-template-root": "error",
		"vue/valid-v-bind": "error",
		"vue/valid-v-cloak": "error",
		"vue/valid-v-else-if": "error",
		"vue/valid-v-else": "error",
		"vue/valid-v-for": "error",
		"vue/valid-v-html": "error",
		"vue/valid-v-if": "error",
		"vue/valid-v-is": "error",
		"vue/valid-v-memo": "error",
		"vue/valid-v-model": "error",
		"vue/valid-v-on": "error",
		"vue/valid-v-once": "error",
		"vue/valid-v-pre": "error",
		"vue/valid-v-show": "error",
		"vue/valid-v-slot": "error",
		"vue/valid-v-text": "error"
	}
}];
//#endregion
module.exports = vue3_essential_default;
y:x 5225=vue2-rcustom-modifiers-on-v-modelmultiple!h["error", { vueVersion: 2 }]?v-model-argum/	-	f
m# N ړ(2_essential_default;
D"x+//#region lib/configs/flat/vue2-recommended-error.ts
var vue2_recommended_error_default = [...require("./vue2-strongly-recommended-error.js"), {
	name: "vue/vue2-recommended-error/rules",
	rules: {
		"vue/attributes-order": "error",
		"vue/block-order": "error",
		"vue/no-lone-template": "error",
		"vue/no-multiple-slot-args": "error",
		"vue/no-required-prop-with-default": "error",
		"vue/no-v-html": "error",
		"vue/order-in-components": "error",
		"vue/this-in-template": "error"
	}
}];
//#endregion
module.exports = vue2_recommended_error_default;
W# x//#region lib/configs/flat/vue2-recommended.ts
var vue2_recommended_default = [...require("./vue2-strongly-recommended.js"), {
	name: "vue/vue2-recommended/rules",
	rules: {
		"vue/attributes-order": "warn",
		"vue/block-order": "warn",
		"vue/no-lone-template": "warn",
		"vue/no-multiple-slot-args": "warn",
		"vue/no-required-prop-with-default": "warn",
		"vue/no-v-html": "warn",
		"vue/order-in-components": "warn",
		"vue/this-in-template": "warn"
	}
}];
//#endregion
module.exports = vue2_recommended_default;
|Sx?//#region lib/configs/flat/vue3-strongly-recommended-error.ts
var vue3_strongly_recommended_error_default = [...require("./vue3-essential.js"), {
	name: "vue/strongly-recommended-error/rules",
	rules: {
		"vue/attribute-hyphenation": "error",
		"vue/component-definition-name-casing": "error",
		"vue/first-attribute-linebreak": "error",
		"vue/html-closing-bracket-newline": "error",
		"vue/html-closing-bracket-spacing": "error",
		"vue/html-end-tags": "error",
		"vue/html-indent": "error",
		"vue/html-quotes": "error",
		"vue/html-self-closing": "error",
		"vue/max-attributes-per-line": "error",
		"vue/multiline-html-element-content-newline": "error",
		"vue/mustache-interpolation-spacing": "error",
		"vue/no-multi-spaces": "error",
		"vue/no-spaces-around-equal-signs-in-attribute": "error",
		"vue/no-template-shadow": "error",
		"vue/one-component-per-file": "error",
		"vue/prop-name-casing": "error",
		"vue/require-default-prop": "error",
		"vue/require-explicit-emits": "error",
		"vue/require-prop-types": "error",
		"vue/singleline-html-element-content-newline": "error",
		"vue/v-bind-style": "error",
		"vue/v-on-event-hyphenation": [
			"error",
			"always",
			{ autofix: true }
		],
		"vue/v-on-style": "error",
		"vue/v-slot-style": "error"
	}
}];
//#endregion
module.exports = vue3_strongly_recommended_error_default;
xPLx3 
	2&2#i2vue2{W2%TPx//#region lib/configs/flat/vue3-strongly-recommended.ts
var vue3_strongly_recommended_default = [...require("./vue3-essential.js"), {
	name: "vue/strongly-recommended/rules",
	rules: {
		"vue/attribute-hyphenation": "warn",
		"vue/component-definition-name-casing": "warn",
		"vue/first-attribute-linebreak": "warn",
		"vue/html-closing-bracket-newline": "warn",
		"vue/html-closing-bracket-spacing": "warn",
		"vue/html-end-tags": "warn",
		"vue/html-indent": "warn",
		"vue/html-quotes": "warn",
		"vue/html-self-closing": "warn",
		"vue/max-attributes-per-line": "warn",
		"vue/multiline-html-element-content-newline": "warn",
		"vue/mustache-interpolation-spacing": "warn",
		"vue/no-multi-spaces": "warn",
		"vue/no-spaces-around-equal-signs-in-attribute": "warn",
		"vue/no-template-shadow": "warn",
		"vue/one-component-per-file": "warn",
		"vue/prop-name-casing": "warn",
		"vue/require-default-prop": "warn",
		"vue/require-explicit-emits": "warn",
		"vue/require-prop-types": "warn",
		"vue/singleline-html-element-content-newline": "warn",
		"vue/v-bind-style": "warn",
		"vue/v-on-event-hyphenation": [
			"warn",
			"always",
			{ autofix: true }
		],
		"vue/v-on-style": "warn",
		"vue/v-slot-style": "warn"
	}
}];
//#endregion
module.exports = vue3_strongly_recommended_default;
mxL 
	2 2@2$2-essential.js"), {
	name: "vue/vue2xU2@;
tNx# 33W3m0l3	Hx 337)3a*^3Pbx///#region lib/configs/index.ts
const configs = {
	base: require("./base.js"),
	"vue2-essential": require("./vue2-essential.js"),
	"vue2-strongly-recommended": require("./vue2-strongly-recommended.js"),
	"vue2-strongly-recommended-error": require("./vue2-strongly-recommended-error.js"),
	"vue2-recommended": require("./vue2-recommended.js"),
	"vue2-recommended-error": require("./vue2-recommended-error.js"),
	essential: require("./vue3-essential.js"),
	"strongly-recommended": require("./vue3-strongly-recommended.js"),
	"strongly-recommended-error": require("./vue3-strongly-recommended-error.js"),
	recommended: require("./vue3-recommended.js"),
	"recommended-error": require("./vue3-recommended-error.js"),
	"flat/base": require("./flat/base.js"),
	"flat/vue2-essential": require("./flat/vue2-essential.js"),
	"flat/vue2-strongly-recommended": require("./flat/vue2-strongly-recommended.js"),
	"flat/vue2-strongly-recommended-error": require("./flat/vue2-strongly-recommended-error.js"),
	"flat/vue2-recommended": require("./flat/vue2-recommended.js"),
	"flat/vue2-recommended-error": require("./flat/vue2-recommended-error.js"),
	"flat/essential": require("./flat/vue3-essential.js"),
	"flat/strongly-recommended": require("./flat/vue3-strongly-recommended.js"),
	"flat/strongly-recommended-error": require("./flat/vue3-strongly-recommended-error.js"),
	"flat/recommended": require("./flat/vue3-recommended.js"),
	"flat/recommended-error": require("./flat/vue3-recommended-error.js"),
	"no-layout-rules": require("./no-layout-rules.js")
};
//#endregion
module.exports = configs;
L!\uxR//#region lib/configs/no-layout-rules.ts
var no_layout_rules_default = { rules: {
	"vue/array-bracket-newline": "off",
	"vue/array-bracket-spacing": "off",
	"vue/array-element-newline": "off",
	"vue/arrow-spacing": "off",
	"vue/block-spacing": "off",
	"vue/block-tag-newline": "off",
	"vue/brace-style": "off",
	"vue/comma-dangle": "off",
	"vue/comma-spacing": "off",
	"vue/comma-style": "off",
	"vue/define-macros-order": "off",
	"vue/dot-location": "off",
	"vue/first-attribute-linebreak": "off",
	"vue/func-call-spacing": "off",
	"vue/html-closing-bracket-newline": "off",
	"vue/html-closing-bracket-spacing": "off",
	"vue/html-comment-content-newline": "off",
	"vue/html-comment-content-spacing": "off",
	"vue/html-comment-indent": "off",
	"vue/html-indent": "off",
	"vue/html-quotes": "off",
	"vue/html-self-closing": "off",
	"vue/key-spacing": "off",
	"vue/keyword-spacing": "off",
	"vue/max-attributes-per-line": "off",
	"vue/max-len": "off",
	"vue/multiline-html-element-content-newline": "off",
	"vue/multiline-ternary": "off",
	"vue/mustache-interpolation-spacing": "off",
	"vue/new-line-between-multi-line-property": "off",
	"vue/no-extra-parens": "off",
	"vue/no-multi-spaces": "off",
	"vue/no-spaces-around-equal-signs-in-attribute": "off",
	"vue/object-curly-newline": "off",
	"vue/object-curly-spacing": "off",
	"vue/object-property-newline": "off",
	"vue/operator-linebreak": "off",
	"vue/padding-line-between-blocks": "off",
	"vue/padding-line-between-tags": "off",
	"vue/padding-lines-in-component-definition": "off",
	"vue/quote-props": "off",
	"vue/script-indent": "off",
	"vue/singleline-html-element-content-newline": "off",
	"vue/space-in-parens": "off",
	"vue/space-infix-ops": "off",
	"vue/space-unary-ops": "off",
	"vue/template-curly-spacing": "off",
	"vue/v-for-delimiter-style": "off"
} };
//#endregion
module.exports = no_layout_rules_default;
i\xvue2;2_essential_default = {
	extends: require.resolve("./base")custom-modifiers-on-v-modelmultiple!h["error", { vueVersion: 2 }]?v-model-argum/	-	f
m# N ړ(˓#2_essential_default;
YYx2 ?{
	extends: require.resolvd$")0@YNbx2 3{
	extends: require.resolvX")(:#x] 
	vue2&2#2 = {
	extends: require.resolve("./vue2-essential")
{3#2%b`ox[ 
vue2 2@ /{
	extends: require.resolve("./vue2-essential")x1#2@;
Dx7 /%{
	extends: require.resolve("./base")q86wxO vue33& = {
	extends: require.resolve("./vue3m")0#3`x^ vue3;3_recommended_default = {
	extends: require.resolve("./vue3a")(#3,xxA 

Q/{
	extends: require.resolve("./vue3-essential")6Ip3:xA 
	E/{
	extends: require.resolve("./vue3-essential")Ce*x   /* eslint-disable */
/* prettier-ignore */
import type { Linter } from 'eslint'

export interface RuleOptions {
  /**
   * Enforce linebreaks after opening and before closing array brackets in `<template>`
   * @see https://eslint.vuejs.org/rules/array-bracket-newline.html
   */
  'vue/array-bracket-newline'?: Linter.RuleEntry<VueArrayBracketNewline>
  /**
   * Enforce consistent spacing inside array brackets in `<template>`
   * @see https://eslint.vuejs.org/rules/array-bracket-spacing.html
   */
  'vue/array-bracket-spacing'?: Linter.RuleEntry<VueArrayBracketSpacing>
  /**
   * Enforce line breaks after each array element in `<template>`
   * @see https://eslint.vuejs.org/rules/array-element-newline.html
   */
  'vue/array-element-newline'?: Linter.RuleEntry<VueArrayElementNewline>
  /**
   * Enforce consistent spacing before and after the arrow in arrow functions in `<template>`
   * @see https://eslint.vuejs.org/rules/arrow-spacing.html
   */
  'vue/arrow-spacing'?: Linter.RuleEntry<VueArrowSpacing>
  /**
   * enforce attribute naming style on custom components in template
   * @see https://eslint.vuejs.org/rules/attribute-hyphenation.html
   */
  'vue/attribute-hyphenation'?: Linter.RuleEntry<VueAttributeHyphenation>
  /**
   * enforce order of attributes
   * @see https://eslint.vuejs.org/rules/attributes-order.html
   */
  'vue/attributes-order'?: Linter.RuleEntry<VueAttributesOrder>
  /**
   * disallow use other than available `lang`
   * @see https://eslint.vuejs.org/rules/block-lang.html
   */
  'vue/block-lang'?: Linter.RuleEntry<VueBlockLang>
  /**
   * enforce order of component top-level elements
   * @see https://eslint.vuejs.org/rules/block-order.html
   */
  'vue/block-order'?: Linter.RuleEntry<VueBlockOrder>
  /**
   * Disallow or enforce spaces inside of blocks after opening block and before closing block in `<template>`
   * @see https://eslint.vuejs.org/rules/block-spacing.html
   */
  'vue/block-spacing'?: Linter.RuleEntry<VueBlockSpacing>
  /**
   * enforce line breaks after opening and before closing block-level tags
   * @see https://eslint.vuejs.org/rules/block-tag-newline.html
   */
  'vue/block-tag-newline'?: Linter.RuleEntry<VueBlockTagNewline>
  /**
   * Enforce consistent brace style for blocks in `<template>`
   * @see https://eslint.vuejs.org/rules/brace-style.html
   */
  'vue/brace-style'?: Linter.RuleEntry<VueBraceStyle>
  /**
   * Enforce camelcase naming convention in `<template>`
   * @see https://eslint.vuejs.org/rules/camelcase.html
   */
  'vue/camelcase'?: Linter.RuleEntry<VueCamelcase>
  /**
   * Require or disallow trailing commas in `<template>`
   * @see https://eslint.vuejs.org/rules/comma-dangle.html
   */
  'vue/comma-dangle'?: Linter.RuleEntry<VueCommaDangle>
  /**
   * Enforce consistent spacing before and after commas in `<template>`
   * @see https://eslint.vuejs.org/rules/comma-spacing.html
   */
  'vue/comma-spacing'?: Linter.RuleEntry<VueCommaSpacing>
  /**
   * Enforce consistent comma style in `<template>`
   * @see https://eslint.vuejs.org/rules/comma-style.html
   */
  'vue/comma-style'?: Linter.RuleEntry<VueCommaStyle>
  /**
   * support comment-directives in `<template>`
   * @see https://eslint.vuejs.org/rules/comment-directive.html
   */
  'vue/comment-directive'?: Linter.RuleEntry<VueCommentDirective>
  /**
   * enforce component API style
   * @see https://eslint.vuejs.org/rules/component-api-style.html
   */
  'vue/component-api-style'?: Linter.RuleEntry<VueComponentApiStyle>
  /**
   * enforce specific casing for component definition name
   * @see https://eslint.vuejs.org/rules/component-definition-name-casing.html
   */
  'vue/component-definition-name-casing'?: Linter.RuleEntry<VueComponentDefinitionNameCasing>
  /**
   * enforce specific casing for the component naming style in template
   * @see https://eslint.vuejs.org/rules/component-name-in-template-casing.html
   */
  'vue/component-name-in-template-casing'?: Linter.RuleEntry<VueComponentNameInTemplateCasing>
  /**
   * enforce the casing of component name in `components` options
   * @see https://eslint.vuejs.org/rules/component-options-name-casing.html
   */
  'vue/component-options-name-casing'?: Linter.RuleEntry<VueComponentOptionsNameCasing>
  /**
   * enforce specific casing for custom event name
   * @see https://eslint.vuejs.org/rules/custom-event-name-casing.html
   */
  'vue/custom-event-name-casing'?: Linter.RuleEntry<VueCustomEventNameCasing>
  /**
   * enforce declaration style of `defineEmits`
   * @see https://eslint.vuejs.org/rules/define-emits-declaration.html
   */
  'vue/define-emits-declaration'?: Linter.RuleEntry<VueDefineEmitsDeclaration>
  /**
   * enforce order of compiler macros (`defineProps`, `defineEmits`, etc.)
   * @see https://eslint.vuejs.org/rules/define-macros-order.html
   */
  'vue/define-macros-order'?: Linter.RuleEntry<VueDefineMacrosOrder>
  /**
   * enforce declaration style of `defineProps`
   * @see https://eslint.vuejs.org/rules/define-props-declaration.html
   */
  'vue/define-props-declaration'?: Linter.RuleEntry<VueDefinePropsDeclaration>
  /**
   * enforce consistent style for props destructuring
   * @see https://eslint.vuejs.org/rules/define-props-destructuring.html
   */
  'vue/define-props-destructuring'?: Linter.RuleEntry<VueDefinePropsDestructuring>
  /**
   * Enforce consistent newlines before and after dots in `<template>`
   * @see https://eslint.vuejs.org/rules/dot-location.html
   */
  'vue/dot-location'?: Linter.RuleEntry<VueDotLocation>
  /**
   * Enforce dot notation whenever possible in `<template>`
   * @see https://eslint.vuejs.org/rules/dot-notation.html
   */
  'vue/dot-notation'?: Linter.RuleEntry<VueDotNotation>
  /**
   * enforce or forbid the use of the `scoped` and `module` attributes in SFC top level style tags
   * @see https://eslint.vuejs.org/rules/enforce-style-attribute.html
   */
  'vue/enforce-style-attribute'?: Linter.RuleEntry<VueEnforceStyleAttribute>
  /**
   * Require the use of `===` and `!==` in `<template>`
   * @see https://eslint.vuejs.org/rules/eqeqeq.html
   */
  'vue/eqeqeq'?: Linter.RuleEntry<VueEqeqeq>
  /**
   * enforce the location of first attribute
   * @see https://eslint.vuejs.org/rules/first-attribute-linebreak.html
   */
  'vue/first-attribute-linebreak'?: Linter.RuleEntry<VueFirstAttributeLinebreak>
  /**
   * Require or disallow spacing between function identifiers and their invocations in `<template>`
   * @see https://eslint.vuejs.org/rules/func-call-spacing.html
   */
  'vue/func-call-spacing'?: Linter.RuleEntry<VueFuncCallSpacing>
  /**
   * disallow usage of button without an explicit type attribute
   * @see https://eslint.vuejs.org/rules/html-button-has-type.html
   */
  'vue/html-button-has-type'?: Linter.RuleEntry<VueHtmlButtonHasType>
  /**
   * require or disallow a line break before tag's closing brackets
   * @see https://eslint.vuejs.org/rules/html-closing-bracket-newline.html
   */
  'vue/html-closing-bracket-newline'?: Linter.RuleEntry<VueHtmlClosingBracketNewline>
  /**
   * require or disallow a space before tag's closing brackets
   * @see https://eslint.vuejs.org/rules/html-closing-bracket-spacing.html
   */
  'vue/html-closing-bracket-spacing'?: Linter.RuleEntry<VueHtmlClosingBracketSpacing>
  /**
   * enforce unified line break in HTML comments
   * @see https://eslint.vuejs.org/rules/html-comment-content-newline.html
   */
  'vue/html-comment-content-newline'?: Linter.RuleEntry<VueHtmlCommentContentNewline>
  /**
   * enforce unified spacing in HTML comments
   * @see https://eslint.vuejs.org/rules/html-comment-content-spacing.html
   */
  'vue/html-comment-content-spacing'?: Linter.RuleEntry<VueHtmlCommentContentSpacing>
  /**
   * enforce consistent indentation in HTML comments
   * @see https://eslint.vuejs.org/rules/html-comment-indent.html
   */
  'vue/html-comment-indent'?: Linter.RuleEntry<VueHtmlCommentIndent>
  /**
   * enforce end tag style
   * @see https://eslint.vuejs.org/rules/html-end-tags.html
   */
  'vue/html-end-tags'?: Linter.RuleEntry<[]>
  /**
   * enforce consistent indentation in `<template>`
   * @see https://eslint.vuejs.org/rules/html-indent.html
   */
  'vue/html-indent'?: Linter.RuleEntry<VueHtmlIndent>
  /**
   * enforce quotes style of HTML attributes
   * @see https://eslint.vuejs.org/rules/html-quotes.html
   */
  'vue/html-quotes'?: Linter.RuleEntry<VueHtmlQuotes>
  /**
   * enforce self-closing style
   * @see https://eslint.vuejs.org/rules/html-self-closing.html
   */
  'vue/html-self-closing'?: Linter.RuleEntry<VueHtmlSelfClosing>
  /**
   * prevent variables used in JSX to be marked as unused
   * @see https://eslint.vuejs.org/rules/jsx-uses-vars.html
   */
  'vue/jsx-uses-vars'?: Linter.RuleEntry<[]>
  /**
   * Enforce consistent spacing between property names and type annotations in types and interfaces in `<template>`
   * @see https://eslint.vuejs.org/rules/key-spacing.html
   */
  'vue/key-spacing'?: Linter.RuleEntry<VueKeySpacing>
  /**
   * Enforce consistent spacing before and after keywords in `<template>`
   * @see https://eslint.vuejs.org/rules/keyword-spacing.html
   */
  'vue/keyword-spacing'?: Linter.RuleEntry<VueKeywordSpacing>
  /**
   * require component name property to match its file name
   * @see https://eslint.vuejs.org/rules/match-component-file-name.html
   */
  'vue/match-component-file-name'?: Linter.RuleEntry<VueMatchComponentFileName>
  /**
   * require the registered component name to match the imported component name
   * @see https://eslint.vuejs.org/rules/match-component-import-name.html
   */
  'vue/match-component-import-name'?: Linter.RuleEntry<[]>
  /**
   * enforce the maximum number of attributes per line
   * @see https://eslint.vuejs.org/rules/max-attributes-per-line.html
   */
  'vue/max-attributes-per-line'?: Linter.RuleEntry<VueMaxAttributesPerLine>
  /**
   * enforce a maximum line length in `.vue` files
   * @see https://eslint.vuejs.org/rules/max-len.html
   */
  'vue/max-len'?: Linter.RuleEntry<VueMaxLen>
  /**
   * enforce maximum number of lines in Vue SFC blocks
   * @see https://eslint.vuejs.org/rules/max-lines-per-block.html
   */
  'vue/max-lines-per-block'?: Linter.RuleEntry<VueMaxLinesPerBlock>
  /**
   * enforce maximum number of props in Vue component
   * @see https://eslint.vuejs.org/rules/max-props.html
   */
  'vue/max-props'?: Linter.RuleEntry<VueMaxProps>
  /**
   * enforce maximum depth of template
   * @see https://eslint.vuejs.org/rules/max-template-depth.html
   */
  'vue/max-template-depth'?: Linter.RuleEntry<VueMaxTemplateDepth>
  /**
   * require component names to be always multi-word
   * @see https://eslint.vuejs.org/rules/multi-word-component-names.html
   */
  'vue/multi-word-component-names'?: Linter.RuleEntry<VueMultiWordComponentNames>
  /**
   * require a line break before and after the contents of a multiline element
   * @see https://eslint.vuejs.org/rules/multiline-html-element-content-newline.html
   */
  'vue/multiline-html-element-content-newline'?: Linter.RuleEntry<VueMultilineHtmlElementContentNewline>
  /**
   * Enforce newlines between operands of ternary expressions in `<template>`
   * @see https://eslint.vuejs.org/rules/multiline-ternary.html
   */
  'vue/multiline-ternary'?: Linter.RuleEntry<VueMultilineTernary>
  /**
   * enforce unified spacing in mustache interpolations
   * @see https://eslint.vuejs.org/rules/mustache-interpolation-spacing.html
   */
  'vue/mustache-interpolation-spacing'?: Linter.RuleEntry<VueMustacheInterpolationSpacing>
  /**
   * enforce new lines between multi-line properties in Vue components
   * @see https://eslint.vuejs.org/rules/new-line-between-multi-line-property.html
   */
  'vue/new-line-between-multi-line-property'?: Linter.RuleEntry<VueNewLineBetweenMultiLineProperty>
  /**
   * enforce Promise or callback style in `nextTick`
   * @see https://eslint.vuejs.org/rules/next-tick-style.html
   */
  'vue/next-tick-style'?: Linter.RuleEntry<VueNextTickStyle>
  /**
   * disallow using arrow functions to define watcher
   * @see https://eslint.vuejs.org/rules/no-arrow-functions-in-watch.html
   */
  'vue/no-arrow-functions-in-watch'?: Linter.RuleEntry<[]>
  /**
   * disallow asynchronous actions in computed properties
   * @see https://eslint.vuejs.org/rules/no-async-in-computed-properties.html
   */
  'vue/no-async-in-computed-properties'?: Linter.RuleEntry<VueNoAsyncInComputedProperties>
  /**
   * disallow the use of bare strings in `<template>`
   * @see https://eslint.vuejs.org/rules/no-bare-strings-in-template.html
   */
  'vue/no-bare-strings-in-template'?: Linter.RuleEntry<VueNoBareStringsInTemplate>
  /**
   * disallow boolean defaults
   * @see https://eslint.vuejs.org/rules/no-boolean-default.html
   */
  'vue/no-boolean-default'?: Linter.RuleEntry<VueNoBooleanDefault>
  /**
   * disallow element's child contents which would be overwritten by a directive like `v-html` or `v-text`
   * @see https://eslint.vuejs.org/rules/no-child-content.html
   */
  'vue/no-child-content'?: Linter.RuleEntry<VueNoChildContent>
  /**
   * disallow accessing computed properties in `data`
   * @see https://eslint.vuejs.org/rules/no-computed-properties-in-data.html
   */
  'vue/no-computed-properties-in-data'?: Linter.RuleEntry<[]>
  /**
   * Disallow the use of `console` in `<template>`
   * @see https://eslint.vuejs.org/rules/no-console.html
   */
  'vue/no-console'?: Linter.RuleEntry<VueNoConsole>
  /**
   * Disallow constant expressions in conditions in `<template>`
   * @see https://eslint.vuejs.org/rules/no-constant-condition.html
   */
  'vue/no-constant-condition'?: Linter.RuleEntry<VueNoConstantCondition>
  /**
   * disallow custom modifiers on v-model used on the component
   * @see https://eslint.vuejs.org/rules/no-custom-modifiers-on-v-model.html
   */
  'vue/no-custom-modifiers-on-v-model'?: Linter.RuleEntry<[]>
  /**
   * disallow using deprecated object declaration on data (in Vue.js 3.0.0+)
   * @see https://eslint.vuejs.org/rules/no-deprecated-data-object-declaration.html
   */
  'vue/no-deprecated-data-object-declaration'?: Linter.RuleEntry<[]>
  /**
   * disallow using deprecated `$delete` and `$set` (in Vue.js 3.0.0+)
   * @see https://eslint.vuejs.org/rules/no-deprecated-delete-set.html
   */
  'vue/no-deprecated-delete-set'?: Linter.RuleEntry<[]>
  /**
   * disallow using deprecated `destroyed` and `beforeDestroy` lifecycle hooks (in Vue.js 3.0.0+)
   * @see https://eslint.vuejs.org/rules/no-deprecated-destroyed-lifecycle.html
   */
  'vue/no-deprecated-destroyed-lifecycle'?: Linter.RuleEntry<[]>
  /**
   * disallow using deprecated `$listeners` (in Vue.js 3.0.0+)
   * @see https://eslint.vuejs.org/rules/no-deprecated-dollar-listeners-api.html
   */
  'vue/no-deprecated-dollar-listeners-api'?: Linter.RuleEntry<[]>
  /**
   * disallow using deprecated `$scopedSlots` (in Vue.js 3.0.0+)
   * @see https://eslint.vuejs.org/rules/no-deprecated-dollar-scopedslots-api.html
   */
  'vue/no-deprecated-dollar-scopedslots-api'?: Linter.RuleEntry<[]>
  /**
   * disallow using deprecated events api (in Vue.js 3.0.0+)
   * @see https://eslint.vuejs.org/rules/no-deprecated-events-api.html
   */
  'vue/no-deprecated-events-api'?: Linter.RuleEntry<[]>
  /**
   * disallow using deprecated filters syntax (in Vue.js 3.0.0+)
   * @see https://eslint.vuejs.org/rules/no-deprecated-filter.html
   */
  'vue/no-deprecated-filter'?: Linter.RuleEntry<[]>
  /**
   * disallow using deprecated the `functional` template (in Vue.js 3.0.0+)
   * @see https://eslint.vuejs.org/rules/no-deprecated-functional-template.html
   */
  'vue/no-deprecated-functional-template'?: Linter.RuleEntry<[]>
  /**
   * disallow using deprecated the `is` attribute on HTML elements (in Vue.js 3.0.0+)
   * @see https://eslint.vuejs.org/rules/no-deprecated-html-element-is.html
   */
  'vue/no-deprecated-html-element-is'?: Linter.RuleEntry<[]>
  /**
   * disallow using deprecated `inline-template` attribute (in Vue.js 3.0.0+)
   * @see https://eslint.vuejs.org/rules/no-deprecated-inline-template.html
   */
  'vue/no-deprecated-inline-template'?: Linter.RuleEntry<[]>
  /**
   * disallow deprecated `model` definition (in Vue.js 3.0.0+)
   * @see https://eslint.vuejs.org/rules/no-deprecated-model-definition.html
   */
  'vue/no-deprecated-model-definition'?: Linter.RuleEntry<VueNoDeprecatedModelDefinition>
  /**
   * disallow deprecated `this` access in props default function (in Vue.js 3.0.0+)
   * @see https://eslint.vuejs.org/rules/no-deprecated-props-default-this.html
   */
  'vue/no-deprecated-props-default-this'?: Linter.RuleEntry<[]>
  /**
   * disallow using deprecated `tag` property on `RouterLink` (in Vue.js 3.0.0+)
   * @see https://eslint.vuejs.org/rules/no-deprecated-router-link-tag-prop.html
   */
  'vue/no-deprecated-router-link-tag-prop'?: Linter.RuleEntry<VueNoDeprecatedRouterLinkTagProp>
  /**
   * disallow deprecated `scope` attribute (in Vue.js 2.5.0+)
   * @see https://eslint.vuejs.org/rules/no-deprecated-scope-attribute.html
   */
  'vue/no-deprecated-scope-attribute'?: Linter.RuleEntry<[]>
  /**
   * disallow deprecated `slot` attribute (in Vue.js 2.6.0+)
   * @see https://eslint.vuejs.org/rules/no-deprecated-slot-attribute.html
   */
  'vue/no-deprecated-slot-attribute'?: Linter.RuleEntry<VueNoDeprecatedSlotAttribute>
  /**
   * disallow deprecated `slot-scope` attribute (in Vue.js 2.6.0+)
   * @see https://eslint.vuejs.org/rules/no-deprecated-slot-scope-attribute.html
   */
  'vue/no-deprecated-slot-scope-attribute'?: Linter.RuleEntry<[]>
  /**
   * disallow use of deprecated `.sync` modifier on `v-bind` directive (in Vue.js 3.0.0+)
   * @see https://eslint.vuejs.org/rules/no-deprecated-v-bind-sync.html
   */
  'vue/no-deprecated-v-bind-sync'?: Linter.RuleEntry<[]>
  /**
   * disallow deprecated `v-is` directive (in Vue.js 3.1.0+)
   * @see https://eslint.vuejs.org/rules/no-deprecated-v-is.html
   */
  'vue/no-deprecated-v-is'?: Linter.RuleEntry<[]>
  /**
   * disallow using deprecated `.native` modifiers (in Vue.js 3.0.0+)
   * @see https://eslint.vuejs.org/rules/no-deprecated-v-on-native-modifier.html
   */
  'vue/no-deprecated-v-on-native-modifier'?: Linter.RuleEntry<[]>
  /**
   * disallow using deprecated number (keycode) modifiers (in Vue.js 3.0.0+)
   * @see https://eslint.vuejs.org/rules/no-deprecated-v-on-number-modifiers.html
   */
  'vue/no-deprecated-v-on-number-modifiers'?: Linter.RuleEntry<[]>
  /**
   * disallow using deprecated `Vue.config.keyCodes` (in Vue.js 3.0.0+)
   * @see https://eslint.vuejs.org/rules/no-deprecated-vue-config-keycodes.html
   */
  'vue/no-deprecated-vue-config-keycodes'?: Linter.RuleEntry<[]>
  /**
   * disallow duplication of field names
   * @see https://eslint.vuejs.org/rules/no-dupe-keys.html
   */
  'vue/no-dupe-keys'?: Linter.RuleEntry<VueNoDupeKeys>
  /**
   * disallow duplicate conditions in `v-if` / `v-else-if` chains
   * @see https://eslint.vuejs.org/rules/no-dupe-v-else-if.html
   */
  'vue/no-dupe-v-else-if'?: Linter.RuleEntry<[]>
  /**
   * enforce `inheritAttrs` to be set to `false` when using `v-bind="$attrs"`
   * @see https://eslint.vuejs.org/rules/no-duplicate-attr-inheritance.html
   */
  'vue/no-duplicate-attr-inheritance'?: Linter.RuleEntry<VueNoDuplicateAttrInheritance>
  /**
   * disallow duplication of attributes
   * @see https://eslint.vuejs.org/rules/no-duplicate-attributes.html
   */
  'vue/no-duplicate-attributes'?: Linter.RuleEntry<VueNoDuplicateAttributes>
  /**
   * disallow duplication of class names in class attributes
   * @see https://eslint.vuejs.org/rules/no-duplicate-class-names.html
   */
  'vue/no-duplicate-class-names'?: Linter.RuleEntry<[]>
  /**
   * disallow the `<template>` `<script>` `<style>` block to be empty
   * @see https://eslint.vuejs.org/rules/no-empty-component-block.html
   */
  'vue/no-empty-component-block'?: Linter.RuleEntry<[]>
  /**
   * Disallow empty destructuring patterns in `<template>`
   * @see https://eslint.vuejs.org/rules/no-empty-pattern.html
   */
  'vue/no-empty-pattern'?: Linter.RuleEntry<VueNoEmptyPattern>
  /**
   * disallow `export` in `<script setup>`
   * @see https://eslint.vuejs.org/rules/no-export-in-script-setup.html
   */
  'vue/no-export-in-script-setup'?: Linter.RuleEntry<[]>
  /**
   * disallow asynchronously registered `expose`
   * @see https://eslint.vuejs.org/rules/no-expose-after-await.html
   */
  'vue/no-expose-after-await'?: Linter.RuleEntry<[]>
  /**
   * Disallow unnecessary parentheses in `<template>`
   * @see https://eslint.vuejs.org/rules/no-extra-parens.html
   */
  'vue/no-extra-parens'?: Linter.RuleEntry<VueNoExtraParens>
  /**
   * Disallow shorthand type conversions in `<template>`
   * @see https://eslint.vuejs.org/rules/no-implicit-coercion.html
   */
  'vue/no-implicit-coercion'?: Linter.RuleEntry<VueNoImplicitCoercion>
  /**
   * disallow importing Vue compiler macros
   * @see https://eslint.vuejs.org/rules/no-import-compiler-macros.html
   */
  'vue/no-import-compiler-macros'?: Linter.RuleEntry<[]>
  /**
   * disallow irregular whitespace in `.vue` files
   * @see https://eslint.vuejs.org/rules/no-irregular-whitespace.html
   */
  'vue/no-irregular-whitespace'?: Linter.RuleEntry<VueNoIrregularWhitespace>
  /**
   * disallow asynchronously registered lifecycle hooks
   * @see https://eslint.vuejs.org/rules/no-lifecycle-after-await.html
   */
  'vue/no-lifecycle-after-await'?: Linter.RuleEntry<[]>
  /**
   * disallow object, array, and function literals in template
   * @see https://eslint.vuejs.org/rules/no-literals-in-template.html
   */
  'vue/no-literals-in-template'?: Linter.RuleEntry<VueNoLiteralsInTemplate>
  /**
   * disallow unnecessary `<template>`
   * @see https://eslint.vuejs.org/rules/no-lone-template.html
   */
  'vue/no-lone-template'?: Linter.RuleEntry<VueNoLoneTemplate>
  /**
   * Disallow literal numbers that lose precision in `<template>`
   * @see https://eslint.vuejs.org/rules/no-loss-of-precision.html
   */
  'vue/no-loss-of-precision'?: Linter.RuleEntry<[]>
  /**
   * disallow multiple spaces
   * @see https://eslint.vuejs.org/rules/no-multi-spaces.html
   */
  'vue/no-multi-spaces'?: Linter.RuleEntry<VueNoMultiSpaces>
  /**
   * disallow passing multiple objects in an array to class
   * @see https://eslint.vuejs.org/rules/no-multiple-objects-in-class.html
   */
  'vue/no-multiple-objects-in-class'?: Linter.RuleEntry<[]>
  /**
   * disallow passing multiple arguments to scoped slots
   * @see https://eslint.vuejs.org/rules/no-multiple-slot-args.html
   */
  'vue/no-multiple-slot-args'?: Linter.RuleEntry<[]>
  /**
   * disallow adding multiple root nodes to the template
   * @see https://eslint.vuejs.org/rules/no-multiple-template-root.html
   */
  'vue/no-multiple-template-root'?: Linter.RuleEntry<VueNoMultipleTemplateRoot>
  /**
   * disallow mutation of component props
   * @see https://eslint.vuejs.org/rules/no-mutating-props.html
   */
  'vue/no-mutating-props'?: Linter.RuleEntry<VueNoMutatingProps>
  /**
   * Disallow negated conditions in `<template>`
   * @see https://eslint.vuejs.org/rules/no-negated-condition.html
   */
  'vue/no-negated-condition'?: Linter.RuleEntry<[]>
  /**
   * disallow negated conditions in v-if/v-else
   * @see https://eslint.vuejs.org/rules/no-negated-v-if-condition.html
   */
  'vue/no-negated-v-if-condition'?: Linter.RuleEntry<[]>
  /**
   * disallow parsing errors in `<template>`
   * @see https://eslint.vuejs.org/rules/no-parsing-error.html
   */
  'vue/no-parsing-error'?: Linter.RuleEntry<VueNoParsingError>
  /**
   * disallow a potential typo in your component property
   * @see https://eslint.vuejs.org/rules/no-potential-component-option-typo.html
   */
  'vue/no-potential-component-option-typo'?: Linter.RuleEntry<VueNoPotentialComponentOptionTypo>
  /**
   * disallow use of value wrapped by `ref()` (Composition API) as an operand
   * @see https://eslint.vuejs.org/rules/no-ref-as-operand.html
   */
  'vue/no-ref-as-operand'?: Linter.RuleEntry<[]>
  /**
   * disallow usages of ref objects that can lead to loss of reactivity
   * @see https://eslint.vuejs.org/rules/no-ref-object-reactivity-loss.html
   */
  'vue/no-ref-object-reactivity-loss'?: Linter.RuleEntry<[]>
  /**
   * enforce props with default values to be optional
   * @see https://eslint.vuejs.org/rules/no-required-prop-with-default.html
   */
  'vue/no-required-prop-with-default'?: Linter.RuleEntry<VueNoRequiredPropWithDefault>
  /**
   * disallow the use of reserved names in component definitions
   * @see https://eslint.vuejs.org/rules/no-reserved-component-names.html
   */
  'vue/no-reserved-component-names'?: Linter.RuleEntry<VueNoReservedComponentNames>
  /**
   * disallow overwriting reserved keys
   * @see https://eslint.vuejs.org/rules/no-reserved-keys.html
   */
  'vue/no-reserved-keys'?: Linter.RuleEntry<VueNoReservedKeys>
  /**
   * disallow reserved names in props
   * @see https://eslint.vuejs.org/rules/no-reserved-props.html
   */
  'vue/no-reserved-props'?: Linter.RuleEntry<VueNoReservedProps>
  /**
   * disallow specific block
   * @see https://eslint.vuejs.org/rules/no-restricted-block.html
   */
  'vue/no-restricted-block'?: Linter.RuleEntry<VueNoRestrictedBlock>
  /**
   * disallow asynchronously called restricted methods
   * @see https://eslint.vuejs.org/rules/no-restricted-call-after-await.html
   */
  'vue/no-restricted-call-after-await'?: Linter.RuleEntry<VueNoRestrictedCallAfterAwait>
  /**
   * disallow specific classes in Vue components
   * @see https://eslint.vuejs.org/rules/no-restricted-class.html
   */
  'vue/no-restricted-class'?: Linter.RuleEntry<VueNoRestrictedClass>
  /**
   * disallow specific component names
   * @see https://eslint.vuejs.org/rules/no-restricted-component-names.html
   */
  'vue/no-restricted-component-names'?: Linter.RuleEntry<VueNoRestrictedComponentNames>
  /**
   * disallow specific component option
   * @see https://eslint.vuejs.org/rules/no-restricted-component-options.html
   */
  'vue/no-restricted-component-options'?: Linter.RuleEntry<VueNoRestrictedComponentOptions>
  /**
   * disallow specific custom event
   * @see https://eslint.vuejs.org/rules/no-restricted-custom-event.html
   */
  'vue/no-restricted-custom-event'?: Linter.RuleEntry<VueNoRestrictedCustomEvent>
  /**
   * disallow specific elements
   * @see https://eslint.vuejs.org/rules/no-restricted-html-elements.html
   */
  'vue/no-restricted-html-elements'?: Linter.RuleEntry<VueNoRestrictedHtmlElements>
  /**
   * disallow specific props
   * @see https://eslint.vuejs.org/rules/no-restricted-props.html
   */
  'vue/no-restricted-props'?: Linter.RuleEntry<VueNoRestrictedProps>
  /**
   * disallow specific attribute
   * @see https://eslint.vuejs.org/rules/no-restricted-static-attribute.html
   */
  'vue/no-restricted-static-attribute'?: Linter.RuleEntry<VueNoRestrictedStaticAttribute>
  /**
   * Disallow specified syntax in `<template>`
   * @see https://eslint.vuejs.org/rules/no-restricted-syntax.html
   */
  'vue/no-restricted-syntax'?: Linter.RuleEntry<VueNoRestrictedSyntax>
  /**
   * disallow specific argument in `v-bind`
   * @see https://eslint.vuejs.org/rules/no-restricted-v-bind.html
   */
  'vue/no-restricted-v-bind'?: Linter.RuleEntry<VueNoRestrictedVBind>
  /**
   * disallow specific argument in `v-on`
   * @see https://eslint.vuejs.org/rules/no-restricted-v-on.html
   */
  'vue/no-restricted-v-on'?: Linter.RuleEntry<VueNoRestrictedVOn>
  /**
   * disallow `v-if` directives on root element
   * @see https://eslint.vuejs.org/rules/no-root-v-if.html
   */
  'vue/no-root-v-if'?: Linter.RuleEntry<[]>
  /**
   * disallow usages that lose the reactivity of `props` passed to `setup`
   * @see https://eslint.vuejs.org/rules/no-setup-props-reactivity-loss.html
   */
  'vue/no-setup-props-reactivity-loss'?: Linter.RuleEntry<[]>
  /**
   * enforce component's data property to be a function
   * @see https://eslint.vuejs.org/rules/no-shared-component-data.html
   */
  'vue/no-shared-component-data'?: Linter.RuleEntry<[]>
  /**
   * disallow side effects in computed properties
   * @see https://eslint.vuejs.org/rules/no-side-effects-in-computed-properties.html
   */
  'vue/no-side-effects-in-computed-properties'?: Linter.RuleEntry<[]>
  /**
   * disallow spaces around equal signs in attribute
   * @see https://eslint.vuejs.org/rules/no-spaces-around-equal-signs-in-attribute.html
   */
  'vue/no-spaces-around-equal-signs-in-attribute'?: Linter.RuleEntry<[]>
  /**
   * Disallow sparse arrays in `<template>`
   * @see https://eslint.vuejs.org/rules/no-sparse-arrays.html
   */
  'vue/no-sparse-arrays'?: Linter.RuleEntry<[]>
  /**
   * disallow static inline `style` attributes
   * @see https://eslint.vuejs.org/rules/no-static-inline-styles.html
   */
  'vue/no-static-inline-styles'?: Linter.RuleEntry<VueNoStaticInlineStyles>
  /**
   * disallow `key` attribute on `<template>`
   * @see https://eslint.vuejs.org/rules/no-template-key.html
   */
  'vue/no-template-key'?: Linter.RuleEntry<[]>
  /**
   * disallow variable declarations from shadowing variables declared in the outer scope
   * @see https://eslint.vuejs.org/rules/no-template-shadow.html
   */
  'vue/no-template-shadow'?: Linter.RuleEntry<VueNoTemplateShadow>
  /**
   * disallow target="_blank" attribute without rel="noopener noreferrer"
   * @see https://eslint.vuejs.org/rules/no-template-target-blank.html
   */
  'vue/no-template-target-blank'?: Linter.RuleEntry<VueNoTemplateTargetBlank>
  /**
   * disallow mustaches in `<textarea>`
   * @see https://eslint.vuejs.org/rules/no-textarea-mustache.html
   */
  'vue/no-textarea-mustache'?: Linter.RuleEntry<[]>
  /**
   * disallow `this` usage in a `beforeRouteEnter` method
   * @see https://eslint.vuejs.org/rules/no-this-in-before-route-enter.html
   */
  'vue/no-this-in-before-route-enter'?: Linter.RuleEntry<[]>
  /**
   * disallow use of undefined components in `<template>`
   * @see https://eslint.vuejs.org/rules/no-undef-components.html
   */
  'vue/no-undef-components'?: Linter.RuleEntry<VueNoUndefComponents>
  /**
   * disallow use of undefined custom directives
   * @see https://eslint.vuejs.org/rules/no-undef-directives.html
   */
  'vue/no-undef-directives'?: Linter.RuleEntry<VueNoUndefDirectives>
  /**
   * disallow undefined properties
   * @see https://eslint.vuejs.org/rules/no-undef-properties.html
   */
  'vue/no-undef-properties'?: Linter.RuleEntry<VueNoUndefProperties>
  /**
   * disallow unsupported Vue.js syntax on the specified version
   * @see https://eslint.vuejs.org/rules/no-unsupported-features.html
   */
  'vue/no-unsupported-features'?: Linter.RuleEntry<VueNoUnsupportedFeatures>
  /**
   * disallow registering components that are not used inside templates
   * @see https://eslint.vuejs.org/rules/no-unused-components.html
   */
  'vue/no-unused-components'?: Linter.RuleEntry<VueNoUnusedComponents>
  /**
   * disallow unused emit declarations
   * @see https://eslint.vuejs.org/rules/no-unused-emit-declarations.html
   */
  'vue/no-unused-emit-declarations'?: Linter.RuleEntry<[]>
  /**
   * disallow unused properties
   * @see https://eslint.vuejs.org/rules/no-unused-properties.html
   */
  'vue/no-unused-properties'?: Linter.RuleEntry<VueNoUnusedProperties>
  /**
   * disallow unused refs
   * @see https://eslint.vuejs.org/rules/no-unused-refs.html
   */
  'vue/no-unused-refs'?: Linter.RuleEntry<[]>
  /**
   * disallow unused variable definitions of v-for directives or scope attributes
   * @see https://eslint.vuejs.org/rules/no-unused-vars.html
   */
  'vue/no-unused-vars'?: Linter.RuleEntry<VueNoUnusedVars>
  /**
   * disallow use computed property like method
   * @see https://eslint.vuejs.org/rules/no-use-computed-property-like-method.html
   */
  'vue/no-use-computed-property-like-method'?: Linter.RuleEntry<[]>
  /**
   * disallow using `v-else-if`/`v-else` on the same element as `v-for`
   * @see https://eslint.vuejs.org/rules/no-use-v-else-with-v-for.html
   */
  'vue/no-use-v-else-with-v-for'?: Linter.RuleEntry<[]>
  /**
   * disallow using `v-if` on the same element as `v-for`
   * @see https://eslint.vuejs.org/rules/no-use-v-if-with-v-for.html
   */
  'vue/no-use-v-if-with-v-for'?: Linter.RuleEntry<VueNoUseVIfWithVFor>
  /**
   * Disallow unnecessary concatenation of literals or template literals in `<template>`
   * @see https://eslint.vuejs.org/rules/no-useless-concat.html
   */
  'vue/no-useless-concat'?: Linter.RuleEntry<[]>
  /**
   * disallow unnecessary mustache interpolations
   * @see https://eslint.vuejs.org/rules/no-useless-mustaches.html
   */
  'vue/no-useless-mustaches'?: Linter.RuleEntry<VueNoUselessMustaches>
  /**
   * disallow useless attribute on `<template>`
   * @see https://eslint.vuejs.org/rules/no-useless-template-attributes.html
   */
  'vue/no-useless-template-attributes'?: Linter.RuleEntry<[]>
  /**
   * disallow unnecessary `v-bind` directives
   * @see https://eslint.vuejs.org/rules/no-useless-v-bind.html
   */
  'vue/no-useless-v-bind'?: Linter.RuleEntry<VueNoUselessVBind>
  /**
   * disallow `key` attribute on `<template v-for>`
   * @see https://eslint.vuejs.org/rules/no-v-for-template-key.html
   * @deprecated
   */
  'vue/no-v-for-template-key'?: Linter.RuleEntry<[]>
  /**
   * disallow key of `<template v-for>` placed on child elements
   * @see https://eslint.vuejs.org/rules/no-v-for-template-key-on-child.html
   */
  'vue/no-v-for-template-key-on-child'?: Linter.RuleEntry<[]>
  /**
   * disallow use of v-html to prevent XSS attack
   * @see https://eslint.vuejs.org/rules/no-v-html.html
   */
  'vue/no-v-html'?: Linter.RuleEntry<VueNoVHtml>
  /**
   * disallow adding an argument to `v-model` used in custom component
   * @see https://eslint.vuejs.org/rules/no-v-model-argument.html
   * @deprecated
   */
  'vue/no-v-model-argument'?: Linter.RuleEntry<[]>
  /**
   * disallow use of v-text
   * @see https://eslint.vuejs.org/rules/no-v-text.html
   */
  'vue/no-v-text'?: Linter.RuleEntry<[]>
  /**
   * disallow v-text / v-html on component
   * @see https://eslint.vuejs.org/rules/no-v-text-v-html-on-component.html
   */
  'vue/no-v-text-v-html-on-component'?: Linter.RuleEntry<VueNoVTextVHtmlOnComponent>
  /**
   * disallow asynchronously registered `watch`
   * @see https://eslint.vuejs.org/rules/no-watch-after-await.html
   */
  'vue/no-watch-after-await'?: Linter.RuleEntry<[]>
  /**
   * Enforce consistent line breaks after opening and before closing braces in `<template>`
   * @see https://eslint.vuejs.org/rules/object-curly-newline.html
   */
  'vue/object-curly-newline'?: Linter.RuleEntry<VueObjectCurlyNewline>
  /**
   * Enforce consistent spacing inside braces in `<template>`
   * @see https://eslint.vuejs.org/rules/object-curly-spacing.html
   */
  'vue/object-curly-spacing'?: Linter.RuleEntry<VueObjectCurlySpacing>
  /**
   * Enforce placing object properties on separate lines in `<template>`
   * @see https://eslint.vuejs.org/rules/object-property-newline.html
   */
  'vue/object-property-newline'?: Linter.RuleEntry<VueObjectPropertyNewline>
  /**
   * Require or disallow method and property shorthand syntax for object literals in `<template>`
   * @see https://eslint.vuejs.org/rules/object-shorthand.html
   */
  'vue/object-shorthand'?: Linter.RuleEntry<VueObjectShorthand>
  /**
   * enforce that each component should be in its own file
   * @see https://eslint.vuejs.org/rules/one-component-per-file.html
   */
  'vue/one-component-per-file'?: Linter.RuleEntry<[]>
  /**
   * Enforce consistent linebreak style for operators in `<template>`
   * @see https://eslint.vuejs.org/rules/operator-linebreak.html
   */
  'vue/operator-linebreak'?: Linter.RuleEntry<VueOperatorLinebreak>
  /**
   * enforce order of properties in components
   * @see https://eslint.vuejs.org/rules/order-in-components.html
   */
  'vue/order-in-components'?: Linter.RuleEntry<VueOrderInComponents>
  /**
   * require or disallow padding lines between blocks
   * @see https://eslint.vuejs.org/rules/padding-line-between-blocks.html
   */
  'vue/padding-line-between-blocks'?: Linter.RuleEntry<VuePaddingLineBetweenBlocks>
  /**
   * require or disallow newlines between sibling tags in template
   * @see https://eslint.vuejs.org/rules/padding-line-between-tags.html
   */
  'vue/padding-line-between-tags'?: Linter.RuleEntry<VuePaddingLineBetweenTags>
  /**
   * require or disallow padding lines in component definition
   * @see https://eslint.vuejs.org/rules/padding-lines-in-component-definition.html
   */
  'vue/padding-lines-in-component-definition'?: Linter.RuleEntry<VuePaddingLinesInComponentDefinition>
  /**
   * enforce use of `defineOptions` instead of default export
   * @see https://eslint.vuejs.org/rules/prefer-define-options.html
   */
  'vue/prefer-define-options'?: Linter.RuleEntry<[]>
  /**
   * enforce import from 'vue' instead of import from '@vue/*'
   * @see https://eslint.vuejs.org/rules/prefer-import-from-vue.html
   */
  'vue/prefer-import-from-vue'?: Linter.RuleEntry<[]>
  /**
   * enforce `Boolean` comes first in component prop types
   * @see https://eslint.vuejs.org/rules/prefer-prop-type-boolean-first.html
   */
  'vue/prefer-prop-type-boolean-first'?: Linter.RuleEntry<[]>
  /**
   * require static class names in template to be in a separate `class` attribute
   * @see https://eslint.vuejs.org/rules/prefer-separate-static-class.html
   */
  'vue/prefer-separate-static-class'?: Linter.RuleEntry<[]>
  /**
   * enforce passing a single argument to custom event emissions
   * @see https://eslint.vuejs.org/rules/prefer-single-event-payload.html
   */
  'vue/prefer-single-event-payload'?: Linter.RuleEntry<[]>
  /**
   * Require template literals instead of string concatenation in `<template>`
   * @see https://eslint.vuejs.org/rules/prefer-template.html
   */
  'vue/prefer-template'?: Linter.RuleEntry<[]>
  /**
   * require shorthand form attribute when `v-bind` value is `true`
   * @see https://eslint.vuejs.org/rules/prefer-true-attribute-shorthand.html
   */
  'vue/prefer-true-attribute-shorthand'?: Linter.RuleEntry<VuePreferTrueAttributeShorthand>
  /**
   * require using `useTemplateRef` instead of `ref`/`shallowRef` for template refs
   * @see https://eslint.vuejs.org/rules/prefer-use-template-ref.html
   */
  'vue/prefer-use-template-ref'?: Linter.RuleEntry<[]>
  /**
   * enforce using `v-model` instead of `:prop`/`@update:prop` pair
   * @see https://eslint.vuejs.org/rules/prefer-v-model.html
   */
  'vue/prefer-v-model'?: Linter.RuleEntry<[]>
  /**
   * enforce specific casing for the Prop name in Vue components
   * @see https://eslint.vuejs.org/rules/prop-name-casing.html
   */
  'vue/prop-name-casing'?: Linter.RuleEntry<VuePropNameCasing>
  /**
   * Require quotes around object literal, type literal, interfaces and enums property names in `<template>`
   * @see https://eslint.vuejs.org/rules/quote-props.html
   */
  'vue/quote-props'?: Linter.RuleEntry<VueQuoteProps>
  /**
   * require `v-bind:is` of `<component>` elements
   * @see https://eslint.vuejs.org/rules/require-component-is.html
   */
  'vue/require-component-is'?: Linter.RuleEntry<[]>
  /**
   * require components to be the default export
   * @see https://eslint.vuejs.org/rules/require-default-export.html
   */
  'vue/require-default-export'?: Linter.RuleEntry<[]>
  /**
   * require default value for props
   * @see https://eslint.vuejs.org/rules/require-default-prop.html
   */
  'vue/require-default-prop'?: Linter.RuleEntry<[]>
  /**
   * require the component to be directly exported
   * @see https://eslint.vuejs.org/rules/require-direct-export.html
   */
  'vue/require-direct-export'?: Linter.RuleEntry<VueRequireDirectExport>
  /**
   * require type definitions in emits
   * @see https://eslint.vuejs.org/rules/require-emit-validator.html
   */
  'vue/require-emit-validator'?: Linter.RuleEntry<[]>
  /**
   * require `emits` option with name triggered by `$emit()`
   * @see https://eslint.vuejs.org/rules/require-explicit-emits.html
   */
  'vue/require-explicit-emits'?: Linter.RuleEntry<VueRequireExplicitEmits>
  /**
   * require slots to be explicitly defined
   * @see https://eslint.vuejs.org/rules/require-explicit-slots.html
   */
  'vue/require-explicit-slots'?: Linter.RuleEntry<[]>
  /**
   * require declare public properties using `expose`
   * @see https://eslint.vuejs.org/rules/require-expose.html
   */
  'vue/require-expose'?: Linter.RuleEntry<[]>
  /**
   * require a certain macro variable name
   * @see https://eslint.vuejs.org/rules/require-macro-variable-name.html
   */
  'vue/require-macro-variable-name'?: Linter.RuleEntry<VueRequireMacroVariableName>
  /**
   * require a name property in Vue components
   * @see https://eslint.vuejs.org/rules/require-name-property.html
   */
  'vue/require-name-property'?: Linter.RuleEntry<[]>
  /**
   * require props to have a comment
   * @see https://eslint.vuejs.org/rules/require-prop-comment.html
   */
  'vue/require-prop-comment'?: Linter.RuleEntry<VueRequirePropComment>
  /**
   * require prop type to be a constructor
   * @see https://eslint.vuejs.org/rules/require-prop-type-constructor.html
   */
  'vue/require-prop-type-constructor'?: Linter.RuleEntry<[]>
  /**
   * require type definitions in props
   * @see https://eslint.vuejs.org/rules/require-prop-types.html
   */
  'vue/require-prop-types'?: Linter.RuleEntry<[]>
  /**
   * enforce render function to always return value
   * @see https://eslint.vuejs.org/rules/require-render-return.html
   */
  'vue/require-render-return'?: Linter.RuleEntry<[]>
  /**
   * enforce properties of `$slots` to be used as a function
   * @see https://eslint.vuejs.org/rules/require-slots-as-functions.html
   */
  'vue/require-slots-as-functions'?: Linter.RuleEntry<[]>
  /**
   * require control the display of the content inside `<transition>`
   * @see https://eslint.vuejs.org/rules/require-toggle-inside-transition.html
   */
  'vue/require-toggle-inside-transition'?: Linter.RuleEntry<VueRequireToggleInsideTransition>
  /**
   * enforce adding type declarations to object props
   * @see https://eslint.vuejs.org/rules/require-typed-object-prop.html
   */
  'vue/require-typed-object-prop'?: Linter.RuleEntry<[]>
  /**
   * require `ref` and `shallowRef` functions to be strongly typed
   * @see https://eslint.vuejs.org/rules/require-typed-ref.html
   */
  'vue/require-typed-ref'?: Linter.RuleEntry<[]>
  /**
   * require `v-bind:key` with `v-for` directives
   * @see https://eslint.vuejs.org/rules/require-v-for-key.html
   */
  'vue/require-v-for-key'?: Linter.RuleEntry<[]>
  /**
   * enforce props default values to be valid
   * @see https://eslint.vuejs.org/rules/require-valid-default-prop.html
   */
  'vue/require-valid-default-prop'?: Linter.RuleEntry<[]>
  /**
   * enforce using only specific component names
   * @see https://eslint.vuejs.org/rules/restricted-component-names.html
   */
  'vue/restricted-component-names'?: Linter.RuleEntry<VueRestrictedComponentNames>
  /**
   * enforce that a return statement is present in computed property
   * @see https://eslint.vuejs.org/rules/return-in-computed-property.html
   */
  'vue/return-in-computed-property'?: Linter.RuleEntry<VueReturnInComputedProperty>
  /**
   * enforce that a return statement is present in emits validator
   * @see https://eslint.vuejs.org/rules/return-in-emits-validator.html
   */
  'vue/return-in-emits-validator'?: Linter.RuleEntry<[]>
  /**
   * enforce consistent indentation in `<script>`
   * @see https://eslint.vuejs.org/rules/script-indent.html
   */
  'vue/script-indent'?: Linter.RuleEntry<VueScriptIndent>
  /**
   * require a line break before and after the contents of a singleline element
   * @see https://eslint.vuejs.org/rules/singleline-html-element-content-newline.html
   */
  'vue/singleline-html-element-content-newline'?: Linter.RuleEntry<VueSinglelineHtmlElementContentNewline>
  /**
   * enforce specific casing for slot names
   * @see https://eslint.vuejs.org/rules/slot-name-casing.html
   */
  'vue/slot-name-casing'?: Linter.RuleEntry<VueSlotNameCasing>
  /**
   * enforce sort-keys in a manner that is compatible with order-in-components
   * @see https://eslint.vuejs.org/rules/sort-keys.html
   */
  'vue/sort-keys'?: Linter.RuleEntry<VueSortKeys>
  /**
   * Enforce consistent spacing inside parentheses in `<template>`
   * @see https://eslint.vuejs.org/rules/space-in-parens.html
   */
  'vue/space-in-parens'?: Linter.RuleEntry<VueSpaceInParens>
  /**
   * Require spacing around infix operators in `<template>`
   * @see https://eslint.vuejs.org/rules/space-infix-ops.html
   */
  'vue/space-infix-ops'?: Linter.RuleEntry<VueSpaceInfixOps>
  /**
   * Enforce consistent spacing before or after unary operators in `<template>`
   * @see https://eslint.vuejs.org/rules/space-unary-ops.html
   */
  'vue/space-unary-ops'?: Linter.RuleEntry<VueSpaceUnaryOps>
  /**
   * enforce static class names order
   * @see https://eslint.vuejs.org/rules/static-class-names-order.html
   */
  'vue/static-class-names-order'?: Linter.RuleEntry<[]>
  /**
   * Require or disallow spacing around embedded expressions of template strings in `<template>`
   * @see https://eslint.vuejs.org/rules/template-curly-spacing.html
   */
  'vue/template-curly-spacing'?: Linter.RuleEntry<VueTemplateCurlySpacing>
  /**
   * disallow usage of `this` in template
   * @see https://eslint.vuejs.org/rules/this-in-template.html
   */
  'vue/this-in-template'?: Linter.RuleEntry<VueThisInTemplate>
  /**
   * enforce usage of `exact` modifier on `v-on`
   * @see https://eslint.vuejs.org/rules/use-v-on-exact.html
   */
  'vue/use-v-on-exact'?: Linter.RuleEntry<[]>
  /**
   * enforce `v-bind` directive style
   * @see https://eslint.vuejs.org/rules/v-bind-style.html
   */
  'vue/v-bind-style'?: Linter.RuleEntry<VueVBindStyle>
  /**
   * enforce `v-for` directive's delimiter style
   * @see https://eslint.vuejs.org/rules/v-for-delimiter-style.html
   */
  'vue/v-for-delimiter-style'?: Linter.RuleEntry<VueVForDelimiterStyle>
  /**
   * require key attribute for conditionally rendered repeated components
   * @see https://eslint.vuejs.org/rules/v-if-else-key.html
   */
  'vue/v-if-else-key'?: Linter.RuleEntry<[]>
  /**
   * enforce v-on event naming style on custom components in template
   * @see https://eslint.vuejs.org/rules/v-on-event-hyphenation.html
   */
  'vue/v-on-event-hyphenation'?: Linter.RuleEntry<VueVOnEventHyphenation>
  /**
   * enforce writing style for handlers in `v-on` directives
   * @see https://eslint.vuejs.org/rules/v-on-handler-style.html
   */
  'vue/v-on-handler-style'?: Linter.RuleEntry<VueVOnHandlerStyle>
  /**
   * enforce `v-on` directive style
   * @see https://eslint.vuejs.org/rules/v-on-style.html
   */
  'vue/v-on-style'?: Linter.RuleEntry<VueVOnStyle>
  /**
   * enforce `v-slot` directive style
   * @see https://eslint.vuejs.org/rules/v-slot-style.html
   */
  'vue/v-slot-style'?: Linter.RuleEntry<VueVSlotStyle>
  /**
   * require valid attribute names
   * @see https://eslint.vuejs.org/rules/valid-attribute-name.html
   */
  'vue/valid-attribute-name'?: Linter.RuleEntry<[]>
  /**
   * enforce valid `defineEmits` compiler macro
   * @see https://eslint.vuejs.org/rules/valid-define-emits.html
   */
  'vue/valid-define-emits'?: Linter.RuleEntry<[]>
  /**
   * enforce valid `defineOptions` compiler macro
   * @see https://eslint.vuejs.org/rules/valid-define-options.html
   */
  'vue/valid-define-options'?: Linter.RuleEntry<[]>
  /**
   * enforce valid `defineProps` compiler macro
   * @see https://eslint.vuejs.org/rules/valid-define-props.html
   */
  'vue/valid-define-props'?: Linter.RuleEntry<[]>
  /**
   * require valid keys in model option
   * @see https://eslint.vuejs.org/rules/valid-model-definition.html
   * @deprecated
   */
  'vue/valid-model-definition'?: Linter.RuleEntry<[]>
  /**
   * enforce valid `nextTick` function calls
   * @see https://eslint.vuejs.org/rules/valid-next-tick.html
   */
  'vue/valid-next-tick'?: Linter.RuleEntry<[]>
  /**
   * enforce valid template root
   * @see https://eslint.vuejs.org/rules/valid-template-root.html
   */
  'vue/valid-template-root'?: Linter.RuleEntry<[]>
  /**
   * enforce valid `v-bind` directives
   * @see https://eslint.vuejs.org/rules/valid-v-bind.html
   */
  'vue/valid-v-bind'?: Linter.RuleEntry<[]>
  /**
   * enforce valid `.sync` modifier on `v-bind` directives
   * @see https://eslint.vuejs.org/rules/valid-v-bind-sync.html
   * @deprecated
   */
  'vue/valid-v-bind-sync'?: Linter.RuleEntry<[]>
  /**
   * enforce valid `v-cloak` directives
   * @see https://eslint.vuejs.org/rules/valid-v-cloak.html
   */
  'vue/valid-v-cloak'?: Linter.RuleEntry<[]>
  /**
   * enforce valid `v-else` directives
   * @see https://eslint.vuejs.org/rules/valid-v-else.html
   */
  'vue/valid-v-else'?: Linter.RuleEntry<[]>
  /**
   * enforce valid `v-else-if` directives
   * @see https://eslint.vuejs.org/rules/valid-v-else-if.html
   */
  'vue/valid-v-else-if'?: Linter.RuleEntry<[]>
  /**
   * enforce valid `v-for` directives
   * @see https://eslint.vuejs.org/rules/valid-v-for.html
   */
  'vue/valid-v-for'?: Linter.RuleEntry<VueValidVFor>
  /**
   * enforce valid `v-html` directives
   * @see https://eslint.vuejs.org/rules/valid-v-html.html
   */
  'vue/valid-v-html'?: Linter.RuleEntry<[]>
  /**
   * enforce valid `v-if` directives
   * @see https://eslint.vuejs.org/rules/valid-v-if.html
   */
  'vue/valid-v-if'?: Linter.RuleEntry<[]>
  /**
   * enforce valid `v-is` directives
   * @see https://eslint.vuejs.org/rules/valid-v-is.html
   */
  'vue/valid-v-is'?: Linter.RuleEntry<[]>
  /**
   * enforce valid `v-memo` directives
   * @see https://eslint.vuejs.org/rules/valid-v-memo.html
   */
  'vue/valid-v-memo'?: Linter.RuleEntry<[]>
  /**
   * enforce valid `v-model` directives
   * @see https://eslint.vuejs.org/rules/valid-v-model.html
   */
  'vue/valid-v-model'?: Linter.RuleEntry<[]>
  /**
   * enforce valid `v-on` directives
   * @see https://eslint.vuejs.org/rules/valid-v-on.html
   */
  'vue/valid-v-on'?: Linter.RuleEntry<VueValidVOn>
  /**
   * enforce valid `v-once` directives
   * @see https://eslint.vuejs.org/rules/valid-v-once.html
   */
  'vue/valid-v-once'?: Linter.RuleEntry<[]>
  /**
   * enforce valid `v-pre` directives
   * @see https://eslint.vuejs.org/rules/valid-v-pre.html
   */
  'vue/valid-v-pre'?: Linter.RuleEntry<[]>
  /**
   * enforce valid `v-show` directives
   * @see https://eslint.vuejs.org/rules/valid-v-show.html
   */
  'vue/valid-v-show'?: Linter.RuleEntry<[]>
  /**
   * enforce valid `v-slot` directives
   * @see https://eslint.vuejs.org/rules/valid-v-slot.html
   */
  'vue/valid-v-slot'?: Linter.RuleEntry<VueValidVSlot>
  /**
   * enforce valid `v-text` directives
   * @see https://eslint.vuejs.org/rules/valid-v-text.html
   */
  'vue/valid-v-text'?: Linter.RuleEntry<[]>
}

/* ======= Declarations ======= */
// ----- vue/array-bracket-newline -----
type VueArrayBracketNewline = []|[(("always" | "never" | "consistent") | {
  multiline?: boolean
  minItems?: (number | null)
})]
// ----- vue/array-bracket-spacing -----
type VueArrayBracketSpacing = []|[("always" | "never")]|[("always" | "never"), {
  singleValue?: boolean
  objectsInArrays?: boolean
  arraysInArrays?: boolean
}]
// ----- vue/array-element-newline -----
type VueArrayElementNewline = []|[(_VueArrayElementNewlineBasicConfig | {
  ArrayExpression?: _VueArrayElementNewlineBasicConfig
  ArrayPattern?: _VueArrayElementNewlineBasicConfig
})]
type _VueArrayElementNewlineBasicConfig = (("always" | "never" | "consistent") | {
  consistent?: boolean
  multiline?: boolean
  minItems?: (number | null)
})
// ----- vue/arrow-spacing -----
type VueArrowSpacing = []|[{
  before?: boolean
  after?: boolean
}]
// ----- vue/attribute-hyphenation -----
type VueAttributeHyphenation = []|[("always" | "never")]|[("always" | "never"), {
  ignore?: (string & {
    [k: string]: unknown | undefined
  } & {
    [k: string]: unknown | undefined
  })[]
  ignoreTags?: string[]
}]
// ----- vue/attributes-order -----
type VueAttributesOrder = []|[{
  order?: (("DEFINITION" | "LIST_RENDERING" | "CONDITIONALS" | "RENDER_MODIFIERS" | "GLOBAL" | "UNIQUE" | "SLOT" | "TWO_WAY_BINDING" | "OTHER_DIRECTIVES" | "OTHER_ATTR" | "ATTR_STATIC" | "ATTR_DYNAMIC" | "ATTR_SHORTHAND_BOOL" | "EVENTS" | "CONTENT") | ("DEFINITION" | "LIST_RENDERING" | "CONDITIONALS" | "RENDER_MODIFIERS" | "GLOBAL" | "UNIQUE" | "SLOT" | "TWO_WAY_BINDING" | "OTHER_DIRECTIVES" | "OTHER_ATTR" | "ATTR_STATIC" | "ATTR_DYNAMIC" | "ATTR_SHORTHAND_BOOL" | "EVENTS" | "CONTENT")[])[]
  alphabetical?: boolean
  sortLineLength?: boolean
  ignoreVBindObject?: boolean
}]
// ----- vue/block-lang -----
type VueBlockLang = []|[{
  [k: string]: {
    lang?: (string | string[])
    allowNoLang?: boolean
  }
}]
// ----- vue/block-order -----
type VueBlockOrder = []|[{
  order?: (string | string[])[]
}]
// ----- vue/block-spacing -----
type VueBlockSpacing = []|[("always" | "never")]
// ----- vue/block-tag-newline -----
type VueBlockTagNewline = []|[{
  singleline?: ("always" | "never" | "consistent" | "ignore")
  multiline?: ("always" | "never" | "consistent" | "ignore")
  maxEmptyLines?: number
  blocks?: {
    [k: string]: {
      singleline?: ("always" | "never" | "consistent" | "ignore")
      multiline?: ("always" | "never" | "consistent" | "ignore")
      maxEmptyLines?: number
    }
  }
}]
// ----- vue/brace-style -----
type VueBraceStyle = []|[("1tbs" | "stroustrup" | "allman")]|[("1tbs" | "stroustrup" | "allman"), {
  allowSingleLine?: boolean
}]
// ----- vue/camelcase -----
type VueCamelcase = []|[{
  ignoreDestructuring?: boolean
  ignoreImports?: boolean
  ignoreGlobals?: boolean
  properties?: ("always" | "never")
  
  allow?: string[]
}]
// ----- vue/comma-dangle -----
type VueCommaDangle = []|[(_VueCommaDangleValue | {
  arrays?: _VueCommaDangleValueWithIgnore
  objects?: _VueCommaDangleValueWithIgnore
  imports?: _VueCommaDangleValueWithIgnore
  exports?: _VueCommaDangleValueWithIgnore
  functions?: _VueCommaDangleValueWithIgnore
  importAttributes?: _VueCommaDangleValueWithIgnore
  dynamicImports?: _VueCommaDangleValueWithIgnore
  enums?: _VueCommaDangleValueWithIgnore
  generics?: _VueCommaDangleValueWithIgnore
  tuples?: _VueCommaDangleValueWithIgnore
})]
type _VueCommaDangleValue = ("always-multiline" | "always" | "never" | "only-multiline")
type _VueCommaDangleValueWithIgnore = ("always-multiline" | "always" | "never" | "only-multiline" | "ignore")
// ----- vue/comma-spacing -----
type VueCommaSpacing = []|[{
  before?: boolean
  after?: boolean
}]
// ----- vue/comma-style -----
type VueCommaStyle = []|[("first" | "last")]|[("first" | "last"), {
  exceptions?: {
    [k: string]: boolean | undefined
  }
}]
// ----- vue/comment-directive -----
type VueCommentDirective = []|[{
  reportUnusedDisableDirectives?: boolean
}]
// ----- vue/component-api-style -----
type VueComponentApiStyle = []|[[("script-setup" | "composition" | "composition-vue2" | "options"), ...(("script-setup" | "composition" | "composition-vue2" | "options"))[]]]
// ----- vue/component-definition-name-casing -----
type VueComponentDefinitionNameCasing = []|[("PascalCase" | "kebab-case")]
// ----- vue/component-name-in-template-casing -----
type VueComponentNameInTemplateCasing = []|[("PascalCase" | "kebab-case")]|[("PascalCase" | "kebab-case"), {
  globals?: string[]
  ignores?: string[]
  registeredComponentsOnly?: boolean
}]
// ----- vue/component-options-name-casing -----
type VueComponentOptionsNameCasing = []|[("camelCase" | "kebab-case" | "PascalCase")]
// ----- vue/custom-event-name-casing -----
type VueCustomEventNameCasing = []|[("kebab-case" | "camelCase")]|[("kebab-case" | "camelCase"), {
  ignores?: string[]
}]
// ----- vue/define-emits-declaration -----
type VueDefineEmitsDeclaration = []|[("type-based" | "type-literal" | "runtime")]
// ----- vue/define-macros-order -----
type VueDefineMacrosOrder = []|[{
  order?: string[]
  defineExposeLast?: boolean
}]
// ----- vue/define-props-declaration -----
type VueDefinePropsDeclaration = []|[("type-based" | "runtime")]
// ----- vue/define-props-destructuring -----
type VueDefinePropsDestructuring = []|[{
  destructure?: ("only-when-assigned" | "always" | "never")
}]
// ----- vue/dot-location -----
type VueDotLocation = []|[("object" | "property")]
// ----- vue/dot-notation -----
type VueDotNotation = []|[{
  allowKeywords?: boolean
  allowPattern?: string
}]
// ----- vue/enforce-style-attribute -----
type VueEnforceStyleAttribute = []|[{
  
  allow?: [("plain" | "scoped" | "module"), ...(("plain" | "scoped" | "module"))[]]
}]
// ----- vue/eqeqeq -----
type VueEqeqeq = ([]|["always"]|["always", {
  null?: ("always" | "never" | "ignore")
}] | []|[("smart" | "allow-null")])
// ----- vue/first-attribute-linebreak -----
type VueFirstAttributeLinebreak = []|[{
  multiline?: ("below" | "beside" | "ignore")
  singleline?: ("below" | "beside" | "ignore")
}]
// ----- vue/func-call-spacing -----
type VueFuncCallSpacing = ([]|["never"] | []|["always"]|["always", {
  allowNewlines?: boolean
  optionalChain?: {
    before?: boolean
    after?: boolean
  }
}])
// ----- vue/html-button-has-type -----
type VueHtmlButtonHasType = []|[{
  button?: boolean
  submit?: boolean
  reset?: boolean
}]
// ----- vue/html-closing-bracket-newline -----
type VueHtmlClosingBracketNewline = []|[{
  singleline?: ("always" | "never")
  multiline?: ("always" | "never")
  selfClosingTag?: {
    singleline?: ("always" | "never")
    multiline?: ("always" | "never")
  }
}]
// ----- vue/html-closing-bracket-spacing -----
type VueHtmlClosingBracketSpacing = []|[{
  startTag?: ("always" | "never")
  endTag?: ("always" | "never")
  selfClosingTag?: ("always" | "never")
}]
// ----- vue/html-comment-content-newline -----
type VueHtmlCommentContentNewline = []|[(("always" | "never") | {
  singleline?: ("always" | "never" | "ignore")
  multiline?: ("always" | "never" | "ignore")
})]|[(("always" | "never") | {
  singleline?: ("always" | "never" | "ignore")
  multiline?: ("always" | "never" | "ignore")
}), {
  exceptions?: string[]
}]
// ----- vue/html-comment-content-spacing -----
type VueHtmlCommentContentSpacing = []|[("always" | "never")]|[("always" | "never"), {
  exceptions?: string[]
}]
// ----- vue/html-comment-indent -----
type VueHtmlCommentIndent = []|[(number | "tab")]
// ----- vue/html-indent -----
type VueHtmlIndent = []|[(number | "tab")]|[(number | "tab"), {
  attribute?: number
  baseIndent?: number
  closeBracket?: (number | {
    startTag?: number
    endTag?: number
    selfClosingTag?: number
  })
  switchCase?: number
  alignAttributesVertically?: boolean
  ignores?: (string & {
    [k: string]: unknown | undefined
  } & {
    [k: string]: unknown | undefined
  })[]
}]
// ----- vue/html-quotes -----
type VueHtmlQuotes = []|[("double" | "single")]|[("double" | "single"), {
  avoidEscape?: boolean
}]
// ----- vue/html-self-closing -----
type VueHtmlSelfClosing = []|[{
  html?: {
    normal?: _VueHtmlSelfClosingOptionValue
    void?: _VueHtmlSelfClosingOptionValue
    component?: _VueHtmlSelfClosingOptionValue
  }
  svg?: _VueHtmlSelfClosingOptionValue
  math?: _VueHtmlSelfClosingOptionValue
}]
type _VueHtmlSelfClosingOptionValue = ("always" | "never" | "any")
// ----- vue/key-spacing -----
type VueKeySpacing = []|[({
  align?: (("colon" | "value") | {
    mode?: ("strict" | "minimum")
    on?: ("colon" | "value")
    beforeColon?: boolean
    afterColon?: boolean
  })
  mode?: ("strict" | "minimum")
  beforeColon?: boolean
  afterColon?: boolean
  ignoredNodes?: ("ObjectExpression" | "ObjectPattern" | "ImportDeclaration" | "ExportNamedDeclaration" | "ExportAllDeclaration" | "TSTypeLiteral" | "TSInterfaceBody" | "ClassBody")[]
} | {
  singleLine?: {
    mode?: ("strict" | "minimum")
    beforeColon?: boolean
    afterColon?: boolean
  }
  multiLine?: {
    align?: (("colon" | "value") | {
      mode?: ("strict" | "minimum")
      on?: ("colon" | "value")
      beforeColon?: boolean
      afterColon?: boolean
    })
    mode?: ("strict" | "minimum")
    beforeColon?: boolean
    afterColon?: boolean
  }
} | {
  singleLine?: {
    mode?: ("strict" | "minimum")
    beforeColon?: boolean
    afterColon?: boolean
  }
  multiLine?: {
    mode?: ("strict" | "minimum")
    beforeColon?: boolean
    afterColon?: boolean
  }
  align?: {
    mode?: ("strict" | "minimum")
    on?: ("colon" | "value")
    beforeColon?: boolean
    afterColon?: boolean
  }
})]
// ----- vue/keyword-spacing -----
type VueKeywordSpacing = []|[{
  before?: boolean
  after?: boolean
  overrides?: {
    abstract?: {
      before?: boolean
      after?: boolean
    }
    boolean?: {
      before?: boolean
      after?: boolean
    }
    break?: {
      before?: boolean
      after?: boolean
    }
    byte?: {
      before?: boolean
      after?: boolean
    }
    case?: {
      before?: boolean
      after?: boolean
    }
    catch?: {
      before?: boolean
      after?: boolean
    }
    char?: {
      before?: boolean
      after?: boolean
    }
    class?: {
      before?: boolean
      after?: boolean
    }
    const?: {
      before?: boolean
      after?: boolean
    }
    continue?: {
      before?: boolean
      after?: boolean
    }
    debugger?: {
      before?: boolean
      after?: boolean
    }
    default?: {
      before?: boolean
      after?: boolean
    }
    delete?: {
      before?: boolean
      after?: boolean
    }
    do?: {
      before?: boolean
      after?: boolean
    }
    double?: {
      before?: boolean
      after?: boolean
    }
    else?: {
      before?: boolean
      after?: boolean
    }
    enum?: {
      before?: boolean
      after?: boolean
    }
    export?: {
      before?: boolean
      after?: boolean
    }
    extends?: {
      before?: boolean
      after?: boolean
    }
    false?: {
      before?: boolean
      after?: boolean
    }
    final?: {
      before?: boolean
      after?: boolean
    }
    finally?: {
      before?: boolean
      after?: boolean
    }
    float?: {
      before?: boolean
      after?: boolean
    }
    for?: {
      before?: boolean
      after?: boolean
    }
    function?: {
      before?: boolean
      after?: boolean
    }
    goto?: {
      before?: boolean
      after?: boolean
    }
    if?: {
      before?: boolean
      after?: boolean
    }
    implements?: {
      before?: boolean
      after?: boolean
    }
    import?: {
      before?: boolean
      after?: boolean
    }
    in?: {
      before?: boolean
      after?: boolean
    }
    instanceof?: {
      before?: boolean
      after?: boolean
    }
    int?: {
      before?: boolean
      after?: boolean
    }
    interface?: {
      before?: boolean
      after?: boolean
    }
    long?: {
      before?: boolean
      after?: boolean
    }
    native?: {
      before?: boolean
      after?: boolean
    }
    new?: {
      before?: boolean
      after?: boolean
    }
    null?: {
      before?: boolean
      after?: boolean
    }
    package?: {
      before?: boolean
      after?: boolean
    }
    private?: {
      before?: boolean
      after?: boolean
    }
    protected?: {
      before?: boolean
      after?: boolean
    }
    public?: {
      before?: boolean
      after?: boolean
    }
    return?: {
      before?: boolean
      after?: boolean
    }
    short?: {
      before?: boolean
      after?: boolean
    }
    static?: {
      before?: boolean
      after?: boolean
    }
    super?: {
      before?: boolean
      after?: boolean
    }
    switch?: {
      before?: boolean
      after?: boolean
    }
    synchronized?: {
      before?: boolean
      after?: boolean
    }
    this?: {
      before?: boolean
      after?: boolean
    }
    throw?: {
      before?: boolean
      after?: boolean
    }
    throws?: {
      before?: boolean
      after?: boolean
    }
    transient?: {
      before?: boolean
      after?: boolean
    }
    true?: {
      before?: boolean
      after?: boolean
    }
    try?: {
      before?: boolean
      after?: boolean
    }
    typeof?: {
      before?: boolean
      after?: boolean
    }
    var?: {
      before?: boolean
      after?: boolean
    }
    void?: {
      before?: boolean
      after?: boolean
    }
    volatile?: {
      before?: boolean
      after?: boolean
    }
    while?: {
      before?: boolean
      after?: boolean
    }
    with?: {
      before?: boolean
      after?: boolean
    }
    arguments?: {
      before?: boolean
      after?: boolean
    }
    as?: {
      before?: boolean
      after?: boolean
    }
    async?: {
      before?: boolean
      after?: boolean
    }
    await?: {
      before?: boolean
      after?: boolean
    }
    eval?: {
      before?: boolean
      after?: boolean
    }
    from?: {
      before?: boolean
      after?: boolean
    }
    get?: {
      before?: boolean
      after?: boolean
    }
    let?: {
      before?: boolean
      after?: boolean
    }
    of?: {
      before?: boolean
      after?: boolean
    }
    set?: {
      before?: boolean
      after?: boolean
    }
    type?: {
      before?: boolean
      after?: boolean
    }
    using?: {
      before?: boolean
      after?: boolean
    }
    yield?: {
      before?: boolean
      after?: boolean
    }
    accessor?: {
      before?: boolean
      after?: boolean
    }
    satisfies?: {
      before?: boolean
      after?: boolean
    }
  }
}]
// ----- vue/match-component-f"Tݫile-name -----
type VueMatchComponentFileName = []|[{
  extensions?: string[]
  shouldMatchCase?: boolean
}]
// ----- vue/max-attributes-per-line -----
type VueMaxAttributesPerLine = []|[{
  singleline?: (number | {
    max?: number
  })
  multiline?: (number | {
    max?: number
  })
}]
// ----- vue/max-len -----
type VueMaxLen = []|[({
  code?: number
  template?: number
  comments?: number
  tabWidth?: number
  ignorePattern?: string
  ignoreComments?: boolean
  ignoreTrailingComments?: boolean
  ignoreUrls?: boolean
  ignoreStrings?: boolean
  ignoreTemplateLiterals?: boolean
  ignoreRegExpLiterals?: boolean
  ignoreHTMLAttributeValues?: boolean
  ignoreHTMLTextContents?: boolean
} | number)]|[({
  code?: number
  template?: number
  comments?: number
  tabWidth?: number
  ignorePattern?: string
  ignoreComments?: boolean
  ignoreTrailingComments?: boolean
  ignoreUrls?: boolean
  ignoreStrings?: boolean
  ignoreTemplateLiterals?: boolean
  ignoreRegExpLiterals?: boolean
  ignoreHTMLAttributeValues?: boolean
  ignoreHTMLTextContents?: boolean
} | number), ({
  code?: number
  template?: number
  comments?: number
  tabWidth?: number
  ignorePattern?: string
  ignoreComments?: boolean
  ignoreTrailingComments?: boolean
  ignoreUrls?: boolean
  ignoreStrings?: boolean
  ignoreTemplateLiterals?: boolean
  ignoreRegExpLiterals?: boolean
  ignoreHTMLAttributeValues?: boolean
  ignoreHTMLTextContents?: boolean
} | number)]|[({
  code?: number
  template?: number
  comments?: number
  tabWidth?: number
  ignorePattern?: string
  ignoreComments?: boolean
  ignoreTrailingComments?: boolean
  ignoreUrls?: boolean
  ignoreStrings?: boolean
  ignoreTemplateLiterals?: boolean
  ignoreRegExpLiterals?: boolean
  ignoreHTMLAttributeValues?: boolean
  ignoreHTMLTextContents?: boolean
} | number), ({
  code?: number
  template?: number
  comments?: number
  tabWidth?: number
  ignorePattern?: string
  ignoreComments?: boolean
  ignoreTrailingComments?: boolean
  ignoreUrls?: boolean
  ignoreStrings?: boolean
  ignoreTemplateLiterals?: boolean
  ignoreRegExpLiterals?: boolean
  ignoreHTMLAttributeValues?: boolean
  ignoreHTMLTextContents?: boolean
} | number), {
  code?: number
  template?: number
  comments?: number
  tabWidth?: number
  ignorePattern?: string
  ignoreComments?: boolean
  ignoreTrailingComments?: boolean
  ignoreUrls?: boolean
  ignoreStrings?: boolean
  ignoreTemplateLiterals?: boolean
  ignoreRegExpLiterals?: boolean
  ignoreHTMLAttributeValues?: boolean
  ignoreHTMLTextContents?: boolean
}]
// ----- vue/max-lines-per-block -----
type VueMaxLinesPerBlock = []|[{
  style?: number
  template?: number
  script?: number
  skipBlankLines?: boolean
}]
// ----- vue/max-props -----
type VueMaxProps = []|[{
  maxProps?: number
}]
// ----- vue/max-template-depth -----
type VueMaxTemplateDepth = []|[{
  maxDepth?: number
}]
// ----- vue/multi-word-component-names -----
type VueMultiWordComponentNames = []|[{
  ignores?: string[]
}]
// ----- vue/multiline-html-element-content-newline -----
type VueMultilineHtmlElementContentNewline = []|[{
  ignoreWhenEmpty?: boolean
  ignores?: string[]
  allowEmptyLines?: boolean
}]
// ----- vue/multiline-ternary -----
type VueMultilineTernary = []|[("always" | "always-multiline" | "never")]|[("always" | "always-multiline" | "never"), {
  ignoreJSX?: boolean
}]
// ----- vue/mustache-interpolation-spacing -----
type VueMustacheInterpolationSpacing = []|[("always" | "never")]
// ----- vue/new-line-between-multi-line-property -----
type VueNewLineBetweenMultiLineProperty = []|[{
  minLineOfMultilineProperty?: number
}]
// ----- vue/next-tick-style -----
type VueNextTickStyle = []|[("promise" | "callback")]
// ----- vue/no-async-in-computed-properties -----
type VueNoAsyncInComputedProperties = []|[{
  ignoredObjectNames?: string[]
}]
// ----- vue/no-bare-strings-in-template -----
type VueNoBareStringsInTemplate = []|[{
  allowlist?: string[]
  attributes?: {
    [k: string]: string[]
  }
  directives?: string[]
}]
// ----- vue/no-boolean-default -----
type VueNoBooleanDefault = []|[("default-false" | "no-default")]
// ----- vue/no-child-content -----
type VueNoChildContent = []|[{
  
  additionalDirectives: [string, ...(string)[]]
}]
// ----- vue/no-console -----
type VueNoConsole = []|[{
  
  allow?: [string, ...(string)[]]
}]
// ----- vue/no-constant-condition -----
type VueNoConstantCondition = []|[{
  checkLoops?: ("all" | "allExceptWhileTrue" | "none" | true | false)
}]
// ----- vue/no-deprecated-model-definition -----
type VueNoDeprecatedModelDefinition = []|[{
  allowVue3Compat?: boolean
}]
// ----- vue/no-deprecated-router-link-tag-prop -----
type VueNoDeprecatedRouterLinkTagProp = []|[{
  
  components?: [string, ...(string)[]]
}]
// ----- vue/no-deprecated-slot-attribute -----
type VueNoDeprecatedSlotAttribute = []|[{
  ignore?: string[]
  ignoreParents?: string[]
}]
// ----- vue/no-dupe-keys -----
type VueNoDupeKeys = []|[{
  groups?: unknown[]
}]
// ----- vue/no-duplicate-attr-inheritance -----
type VueNoDuplicateAttrInheritance = []|[{
  checkMultiRootNodes?: boolean
}]
// ----- vue/no-duplicate-attributes -----
type VueNoDuplicateAttributes = []|[{
  allowCoexistClass?: boolean
  allowCoexistStyle?: boolean
}]
// ----- vue/no-empty-pattern -----
type VueNoEmptyPattern = []|[{
  allowObjectPatternsAsParameters?: boolean
}]
// ----- vue/no-extra-parens -----
type VueNoExtraParens = ([]|["functions"] | []|["all"]|["all", {
  conditionalAssign?: boolean
  ternaryOperandBinaryExpressions?: boolean
  nestedBinaryExpressions?: boolean
  returnAssign?: boolean
  ignoreJSX?: ("none" | "all" | "single-line" | "multi-line")
  enforceForArrowConditionals?: boolean
  enforceForSequenceExpressions?: boolean
  enforceForNewInMemberExpressions?: boolean
  enforceForFunctionPrototypeMethods?: boolean
  allowParensAfterCommentPattern?: string
  nestedConditionalExpressions?: boolean
  allowNodesInSpreadElement?: {
    ConditionalExpression?: boolean
    LogicalExpression?: boolean
    AwaitExpression?: boolean
  }
  ignoredNodes?: string[]
}])
// ----- vue/no-implicit-coercion -----
type VueNoImplicitCoercion = []|[{
  boolean?: boolean
  number?: boolean
  string?: boolean
  disallowTemplateShorthand?: boolean
  allow?: ("~" | "!!" | "+" | "- -" | "-" | "*")[]
}]
// ----- vue/no-irregular-whitespace -----
type VueNoIrregularWhitespace = []|[{
  skipComments?: boolean
  skipStrings?: boolean
  skipTemplates?: boolean
  skipRegExps?: boolean
  skipHTMLAttributeValues?: boolean
  skipHTMLTextContents?: boolean
}]
// ----- vue/no-literals-in-template -----
type VueNoLiteralsInTemplate = []|[{
  ignores?: string[]
}]
// ----- vue/no-lone-template -----
type VueNoLoneTemplate = []|[{
  ignoreAccessible?: boolean
}]
// ----- vue/no-multi-spaces -----
type VueNoMultiSpaces = []|[{
  ignoreProperties?: boolean
  ignoreEOLComments?: boolean
}]
// ----- vue/no-multiple-template-root -----
type VueNoMultipleTemplateRoot = []|[{
  disallowComments?: boolean
}]
// ----- vue/no-mutating-props -----
type VueNoMutatingProps = []|[{
  shallowOnly?: boolean
}]
// ----- vue/no-parsing-error -----
type VueNoParsingError = []|[{
  "abrupt-closing-of-empty-comment"?: boolean
  "absence-of-digits-in-numeric-character-reference"?: boolean
  "cdata-in-html-content"?: boolean
  "character-reference-outside-unicode-range"?: boolean
  "control-character-in-input-stream"?: boolean
  "control-character-reference"?: boolean
  "eof-before-tag-name"?: boolean
  "eof-in-cdata"?: boolean
  "eof-in-comment"?: boolean
  "eof-in-tag"?: boolean
  "incorrectly-closed-comment"?: boolean
  "incorrectly-opened-comment"?: boolean
  "invalid-first-character-of-tag-name"?: boolean
  "missing-attribute-value"?: boolean
  "missing-end-tag-name"?: boolean
  "missing-semicolon-after-character-reference"?: boolean
  "missing-whitespace-between-attributes"?: boolean
  "nested-comment"?: boolean
  "noncharacter-character-reference"?: boolean
  "noncharacter-in-input-stream"?: boolean
  "null-character-reference"?: boolean
  "surrogate-character-reference"?: boolean
  "surrogate-in-input-stream"?: boolean
  "unexpected-character-in-attribute-name"?: boolean
  "unexpected-character-in-unquoted-attribute-value"?: boolean
  "unexpected-equals-sign-before-attribute-name"?: boolean
  "unexpected-null-character"?: boolean
  "unexpected-question-mark-instead-of-tag-name"?: boolean
  "unexpected-solidus-in-tag"?: boolean
  "unknown-named-character-reference"?: boolean
  "end-tag-with-attributes"?: boolean
  "duplicate-attribute"?: boolean
  "end-tag-with-trailing-solidus"?: boolean
  "non-void-html-element-start-tag-with-trailing-solidus"?: boolean
  "x-invalid-end-tag"?: boolean
  "x-invalid-namespace"?: boolean
}]
// ----- vue/no-potential-component-option-typo -----
type VueNoPotentialComponentOptionTypo = []|[{
  
  presets?: ("all" | "vue" | "vue-router" | "nuxt")[]
  
  custom?: string[]
  threshold?: number
}]
// ----- vue/no-required-prop-with-default -----
type VueNoRequiredPropWithDefault = []|[{
  autofix?: boolean
}]
// ----- vue/no-reserved-component-names -----
type VueNoReservedComponentNames = []|[{
  disallowVueBuiltInComponents?: boolean
  disallowVue3BuiltInComponents?: boolean
  htmlElementCaseSensitive?: boolean
}]
// ----- vue/no-reserved-keys -----
type VueNoReservedKeys = []|[{
  reserved?: unknown[]
  groups?: unknown[]
}]
// ----- vue/no-reserved-props -----
type VueNoReservedProps = []|[{
  vueVersion?: (2 | 3)
}]
// ----- vue/no-restricted-block -----
type VueNoRestrictedBlock = (string | {
  element: string
  message?: string
})[]
// ----- vue/no-restricted-call-after-await -----
type VueNoRestrictedCallAfterAwait = {
  module: string
  path?: (string | string[])
  message?: string
}[]
// ----- vue/no-restricted-class -----
type VueNoRestrictedClass = string[]
// ----- vue/no-restricted-component-names -----
type VueNoRestrictedComponentNames = (string | {
  name: string
  message?: string
  suggest?: string
})[]
// ----- vue/no-restricted-component-options -----
type VueNoRestrictedComponentOptions = (string | string[] | {
  name: (string | string[])
  message?: string
})[]
// ----- vue/no-restricted-custom-event -----
type VueNoRestrictedCustomEvent = (string | {
  event: string
  message?: string
  suggest?: string
})[]
// ----- vue/no-restricted-html-elements -----
type VueNoRestrictedHtmlElements = (string | {
  element: (string | string[])
  message?: string
})[]
// ----- vue/no-restricted-props -----
type VueNoRestrictedProps = (string | {
  name: string
  message?: string
  suggest?: string
})[]
// ----- vue/no-restricted-static-attribute -----
type VueNoRestrictedStaticAttribute = (string | {
  key: string
  value?: (string | true)
  element?: string
  message?: string
})[]
// ----- vue/no-restricted-syntax -----
type VueNoRestrictedSyntax = (string | {
  selector: string
  message?: string
})[]
// ----- vue/no-restricted-v-bind -----
type VueNoRestrictedVBind = ((string | null) | {
  argument: (string | null)
  modifiers?: ("prop" | "camel" | "sync" | "attr")[]
  element?: string
  message?: string
})[]
// ----- vue/no-restricted-v-on -----
type VueNoRestrictedVOn = ((string | null) | {
  argument: (string | null)
  element?: string
  message?: string
  
  modifiers?: [("prevent" | "stop" | "capture" | "self" | "once" | "passive"), ...(("prevent" | "stop" | "capture" | "self" | "once" | "passive"))[]]
})[]
// ----- vue/no-static-inline-styles -----
type VueNoStaticInlineStyles = []|[{
  allowBinding?: boolean
}]
// ----- vue/no-template-shadow -----
type VueNoTemplateShadow = []|[{
  allow?: string[]
}]
// ----- vue/no-template-target-blank -----
type VueNoTemplateTargetBlank = []|[{
  allowReferrer?: boolean
  enforceDynamicLinks?: ("always" | "never")
}]
// ----- vue/no-undef-components -----
type VueNoUndefComponents = []|[{
  ignorePatterns?: unknown[]
}]
// ----- vue/no-undef-directives -----
type VueNoUndefDirectives = []|[{
  ignore?: string[]
}]
// ----- vue/no-undef-properties -----
type VueNoUndefProperties = []|[{
  ignores?: string[]
}]
// ----- vue/no-unsupported-features -----
type VueNoUnsupportedFeatures = []|[{
  version?: string
  ignores?: ("slot-scope-attribute" | "dynamic-directive-arguments" | "v-slot" | "script-setup" | "style-css-vars-injection" | "v-model-argument" | "v-model-custom-modifiers" | "v-is" | "is-attribute-with-vue-prefix" | "v-memo" | "v-bind-prop-modifier-shorthand" | "v-bind-attr-modifier" | "define-options" | "define-slots" | "define-model" | "v-bind-same-name-shorthand")[]
}]
// ----- vue/no-unused-components -----
type VueNoUnusedComponents = []|[{
  ignoreWhenBindingPresent?: boolean
}]
// ----- vue/no-unused-properties -----
type VueNoUnusedProperties = []|[{
  groups?: ("props" | "data" | "asyncData" | "computed" | "methods" | "setup" | "inject")[]
  deepData?: boolean
  ignorePublicMembers?: boolean
  unreferencedOptions?: ("unknownMemberAsUnreferenced" | "returnAsUnreferenced")[]
}]
// ----- vue/no-unused-vars -----
type VueNoUnusedVars = []|[{
  ignorePattern?: string
}]
// ----- vue/no-use-v-if-with-v-for -----
type VueNoUseVIfWithVFor = []|[{
  allowUsingIterationVar?: boolean
}]
// ----- vue/no-useless-mustaches -----
type VueNoUselessMustaches = []|[{
  ignoreIncludesComment?: boolean
  ignoreStringEscape?: boolean
}]
// ----- vue/no-useless-v-bind -----
type VueNoUselessVBind = []|[{
  ignoreIncludesComment?: boolean
  ignoreStringEscape?: boolean
}]
// ----- vue/no-v-html -----
type VueNoVHtml = []|[{
  ignorePattern?: string
}]
// ----- vue/no-v-text-v-html-on-component -----
type VueNoVTextVHtmlOnComponent = []|[{
  allow?: string[]
  ignoreElementNamespaces?: boolean
}]
// ----- vue/object-curly-newline -----
type VueObjectCurlyNewline = []|[((("always" | "never") | {
  multiline?: boolean
  minProperties?: number
  consistent?: boolean
}) | {
  ObjectExpression?: (("always" | "never") | {
    multiline?: boolean
    minProperties?: number
    consistent?: boolean
  })
  ObjectPattern?: (("always" | "never") | {
    multiline?: boolean
    minProperties?: number
    consistent?: boolean
  })
  ImportDeclaration?: (("always" | "never") | {
    multiline?: boolean
    minProperties?: number
    consistent?: boolean
  })
  ExportDeclaration?: (("always" | "never") | {
    multiline?: boolean
    minProperties?: number
    consistent?: boolean
  })
  TSTypeLiteral?: (("always" | "never") | {
    multiline?: boolean
    minProperties?: number
    consistent?: boolean
  })
  TSInterfaceBody?: (("always" | "never") | {
    multiline?: boolean
    minProperties?: number
    consistent?: boolean
  })
  TSEnumBody?: (("always" | "never") | {
    multiline?: boolean
    minProperties?: number
    consistent?: boolean
  })
})]
// ----- vue/object-curly-spacing -----
type VueObjectCurlySpacing = []|[("always" | "never")]|[("always" | "never"), {
  arraysInObjects?: boolean
  objectsInObjects?: boolean
  overrides?: {
    ObjectPattern?: ("always" | "never")
    ObjectExpression?: ("always" | "never")
    ImportDeclaration?: ("always" | "never")
    ImportAttributes?: ("always" | "never")
    ExportNamedDeclaration?: ("always" | "never")
    ExportAllDeclaration?: ("always" | "never")
    TSMappedType?: ("always" | "never")
    TSTypeLiteral?: ("always" | "never")
    TSInterfaceBody?: ("always" | "never")
    TSEnumBody?: ("always" | "never")
  }
  emptyObjects?: ("ignore" | "always" | "never")
}]
// ----- vue/object-property-newline -----
type VueObjectPropertyNewline = []|[{
  allowAllPropertiesOnSameLine?: boolean
}]
// ----- vue/object-shorthand -----
type VueObjectShorthand = ([]|[("always" | "methods" | "properties" | "never" | "consistent" | "consistent-as-needed")] | []|[("always" | "methods" | "properties")]|[("always" | "methods" | "properties"), {
  avoidQuotes?: boolean
}] | []|[("always" | "methods")]|[("always" | "methods"), {
  ignoreConstructors?: boolean
  methodsIgnorePattern?: string
  avoidQuotes?: boolean
  avoidExplicitReturnArrows?: boolean
}])
// ----- vue/operator-linebreak -----
type VueOperatorLinebreak = []|[(("after" | "before" | "none") | null)]|[(("after" | "before" | "none") | null), {
  overrides?: {
    [k: string]: ("after" | "before" | "none" | "ignore") | undefined
  }
}]
// ----- vue/order-in-components -----
type VueOrderInComponents = []|[{
  order?: unknown[]
}]
// ----- vue/padding-line-between-blocks -----
type VuePaddingLineBetweenBlocks = []|[("never" | "always")]
// ----- vue/padding-line-between-tags -----
type VuePaddingLineBetweenTags = []|[{
  blankLine: ("always" | "never" | "consistent")
  prev: string
  next: string
}[]]
// ----- vue/padding-lines-in-component-definition -----
type VuePaddingLinesInComponentDefinition = []|[(("always" | "never") | {
  betweenOptions?: ("never" | "always" | "ignore")
  withinOption?: (("never" | "always" | "ignore") | {
    [k: string]: (("never" | "always" | "ignore") | {
      betweenItems?: ("never" | "always" | "ignore")
      withinEach?: ("never" | "always" | "ignore")
    })
  })
  groupSingleLineProperties?: boolean
})]
// ----- vue/prefer-true-attribute-shorthand -----
type VuePreferTrueAttributeShorthand = []|[("always" | "never")]|[("always" | "never"), {
  except?: string[]
}]
// ----- vue/prop-name-casing -----
type VuePropNameCasing = []|[("camelCase" | "snake_case")]|[("camelCase" | "snake_case"), {
  ignoreProps?: string[]
}]
// ----- vue/quote-props -----
type VueQuoteProps = ([]|[("always" | "as-needed" | "consistent" | "consistent-as-needed")] | []|[("always" | "as-needed" | "consistent" | "consistent-as-needed")]|[("always" | "as-needed" | "consistent" | "consistent-as-needed"), {
  keywords?: boolean
  unnecessary?: boolean
  numbers?: boolean
}])
// ----- vue/require-direct-export -----
type VueRequireDirectExport = []|[{
  disallowFunctionalComponentFunction?: boolean
}]
// ----- vue/require-explicit-emits -----
type VueRequireExplicitEmits = []|[{
  allowProps?: boolean
}]
// ----- vue/require-macro-variable-name -----
type VueRequireMacroVariableName = []|[{
  defineProps?: string
  defineEmits?: string
  defineSlots?: string
  useSlots?: string
  useAttrs?: string
}]
// ----- vue/require-prop-comment -----
type VueRequirePropComment = []|[{
  type?: ("JSDoc" | "line" | "block" | "any")
}]
// ----- vue/require-toggle-inside-transition -----
type VueRequireToggleInsideTransition = []|[{
  additionalDirectives?: string[]
}]
// ----- vue/restricted-component-names -----
type VueRestrictedComponentNames = []|[{
  allow?: string[]
}]
// ----- vue/return-in-computed-property -----
type VueReturnInComputedProperty = []|[{
  treatUndefinedAsUnspecified?: boolean
}]
// ----- vue/script-indent -----
type VueScriptIndent = []|[(number | "tab")]|[(number | "tab"), {
  baseIndent?: number
  switchCase?: number
  ignores?: (string & {
    [k: string]: unknown | undefined
  } & {
    [k: string]: unknown | undefined
  })[]
}]
// ----- vue/singleline-html-element-content-newline -----
type VueSinglelineHtmlElementContentNewline = []|[{
  ignoreWhenNoAttributes?: boolean
  ignoreWhenEmpty?: boolean
  ignores?: string[]
  externalIgnores?: string[]
}]
// ----- vue/slot-name-casing -----
type VueSlotNameCasing = []|[("camelCase" | "kebab-case" | "singleword")]
// ----- vue/sort-keys -----
type VueSortKeys = []|[("asc" | "desc")]|[("asc" | "desc"), {
  caseSensitive?: boolean
  ignoreChildrenOf?: unknown[]
  ignoreGrandchildrenOf?: unknown[]
  minKeys?: number
  natural?: boolean
  allowLineSeparatedGroups?: boolean
}]
// ----- vue/space-in-parens -----
type VueSpaceInParens = []|[("always" | "never")]|[("always" | "never"), {
  exceptions?: ("{}" | "[]" | "()" | "empty")[]
}]
// ----- vue/space-infix-ops -----
type VueSpaceInfixOps = []|[{
  int32Hint?: boolean
  ignoreTypes?: boolean
}]
// ----- vue/space-unary-ops -----
type VueSpaceUnaryOps = []|[{
  words?: boolean
  nonwords?: boolean
  overrides?: {
    [k: string]: boolean | undefined
  }
}]
// ----- vue/template-curly-spacing -----
type VueTemplateCurlySpacing = []|[("always" | "never")]
// ----- vue/this-in-template -----
type VueThisInTemplate = []|[("always" | "never")]
// ----- vue/v-bind-style -----
type VueVBindStyle = []|[("shorthand" | "longform")]|[("shorthand" | "longform"), {
  sameNameShorthand?: ("always" | "never" | "ignore")
}]
// ----- vue/v-for-delimiter-style -----
type VueVForDelimiterStyle = []|[("in" | "of")]
// ----- vue/v-on-event-hyphenation -----
type VueVOnEventHyphenation = []|[("always" | "never")]|[("always" | "never"), {
  autofix?: boolean
  ignore?: (string & {
    [k: string]: unknown | undefined
  } & {
    [k: string]: unknown | undefined
  })[]
  ignoreTags?: string[]
}]
// ----- vue/v-on-handler-style -----
type VueVOnHandlerStyle = []|[(("inline" | "inline-function") | ["method", ("inline" | "inline-function")])]|[(("inline" | "inline-function") | ["method", ("inline" | "inline-function")]), {
  ignoreIncludesComment?: boolean
}]
// ----- vue/v-on-style -----
type VueVOnStyle = []|[("shorthand" | "longform")]
// ----- vue/v-slot-style -----
type VueVSlotStyle = []|[(("shorthand" | "longform") | {
  atComponent?: ("shorthand" | "longform" | "v-slot")
  default?: ("shorthand" | "longform" | "v-slot")
  named?: ("shorthand" | "longform")
})]
// ----- vue/valid-v-for -----
type VueValidVFor = []|[{
  allowEmptyAlias?: boolean
}]
// ----- vue/valid-v-on -----
type VueValidVOn = []|[{
  modifiers?: unknown[]
}]
// ----- vue/valid-v-slot -----
type VueValidVSlot = []|[{
  allowModifiers?: boolean
}]l,Sx5/// <reference path="./eslint-typegen.d.ts" />
import type { Linter } from 'eslint'

declare const vue: {
  meta: any
  configs: {
    base: Linter.LegacyConfig

    'vue2-essential': Linter.LegacyConfig
    'vue2-strongly-recommended': Linter.LegacyConfig
    'vue2-strongly-recommended-error': Linter.LegacyConfig
    'vue2-recommended': Linter.LegacyConfig
    'vue2-recommended-error': Linter.LegacyConfig

    essential: Linter.LegacyConfig
    'strongly-recommended': Linter.LegacyConfig
    'strongly-recommended-error': Linter.LegacyConfig
    recommended: Linter.LegacyConfig
    'recommended-error': Linter.LegacyConfig

    'flat/base': Linter.FlatConfig[]

    'flat/vue2-essential': Linter.FlatConfig[]
    'flat/vue2-strongly-recommended': Linter.FlatConfig[]
    'flat/vue2-strongly-recommended-error': Linter.FlatConfig[]
    'flat/vue2-recommended': Linter.FlatConfig[]
    'flat/vue2-recommended-error': Linter.FlatConfig[]

    'flat/essential': Linter.FlatConfig[]
    'flat/strongly-recommended': Linter.FlatConfig[]
    'flat/strongly-recommended-error': Linter.FlatConfig[]
    'flat/recommended': Linter.FlatConfig[]
    'flat/recommended-error': Linter.FlatConfig[]

    'no-layout-rules': Linter.LegacyConfig
  }
  rules: Record<string, any>
  processors: {
    '.vue': any
    vue: any
  }
}

export = vue
Ąxconst require_plugin = require("./plugin.js");
const require_configs_index = require("./configs/index.js");
//#region lib/index.ts
var lib_default = Object.assign(require_plugin.default, { configs: require_configs_index });
//#endregion
module.exports = lib_default;
B_x 4const require_package = require("./package.js");
//#region lib/meta.ts
var meta_default = {
	name: require_package.name,
	version: require_package.version
};
//#endregion
exports.default = meta_default;
WG|x-//#region package.json
var name = "eslint-plugin-vue";
var version = "10.10.0";
//#endregion
Object.defineProperty(exports, "name", {
	enumerable: true,
	get: function() {
		return name;
	}
});
Object.defineProperty(exports, "version", {
	enumerable: true,
	get: function() {
		return version;
	}
});
1cxLconst require_runtime = require("./_virtual/_rolldown/runtime.js");
const require_meta = require("./meta.js");
const require_processor = require("./processor.js");
const require_array_bracket_newline$1 = require("./rules/array-bracket-newline.js");
const require_array_bracket_spacing$1 = require("./rules/array-bracket-spacing.js");
const require_array_element_newline$1 = require("./rules/array-element-newline.js");
const require_arrow_spacing$1 = require("./rules/arrow-spacing.js");
const require_attribute_hyphenation = require("./rules/attribute-hyphenation.js");
const require_attributes_order$1 = require("./rules/attributes-order.js");
const require_block_lang$1 = require("./rules/block-lang.js");
const require_block_order = require("./rules/block-order.js");
const require_block_spacing$1 = require("./rules/block-spacing.js");
const require_block_tag_newline$1 = require("./rules/block-tag-newline.js");
const require_brace_style$1 = require("./rules/brace-style.js");
const require_camelcase$1 = require("./rules/camelcase.js");
const require_comma_dangle$1 = require("./rules/comma-dangle.js");
const require_comma_spacing$1 = require("./rules/comma-spacing.js");
const require_comma_style$1 = require("./rules/comma-style.js");
const require_comment_directive$1 = require("./rules/comment-directive.js");
const require_component_api_style$1 = require("./rules/component-api-style.js");
const require_component_definition_name_casing = require("./rules/component-definition-name-casing.js");
const require_component_name_in_template_casing = require("./rules/component-name-in-template-casing.js");
const require_component_options_name_casing = require("./rules/component-options-name-casing.js");
const require_custom_event_name_casing = require("./rules/custom-event-name-casing.js");
const require_define_emits_declaration$1 = require("./rules/define-emits-declaration.js");
const require_define_macros_order$1 = require("./rules/define-macros-order.js");
const require_define_props_declaration$1 = require("./rules/define-props-declaration.js");
const require_define_props_destructuring$1 = require("./rules/define-props-destructuring.js");
const require_dot_location$1 = require("./rules/dot-location.js");
const require_dot_notation$1 = require("./rules/dot-notation.js");
const require_enforce_style_attribute$1 = require("./rules/enforce-style-attribute.js");
const require_eqeqeq$1 = require("./rules/eqeqeq.js");
const require_first_attribute_linebreak$1 = require("./rules/first-attribute-linebreak.js");
const require_func_call_spacing$1 = require("./rules/func-call-spacing.js");
const require_html_button_has_type$1 = require("./rules/html-button-has-type.js");
const require_html_closing_bracket_newline$1 = require("./rules/html-closing-bracket-newline.js");
const require_html_closing_bracket_spacing$1 = require("./rules/html-closing-bracket-spacing.js");
const require_html_comment_content_newline = require("./rules/html-comment-content-newline.js");
const require_html_comment_content_spacing = require("./rules/html-comment-content-spacing.js");
const require_html_comment_indent = require("./rules/html-comment-indent.js");
const require_html_end_tags$1 = require("./rules/html-end-tags.js");
const require_html_indent = require("./rules/html-indent.js");
const require_html_quotes$1 = require("./rules/html-quotes.js");
const require_html_self_closing = require("./rules/html-self-closing.js");
const require_jsx_uses_vars$1 = require("./rules/jsx-uses-vars.js");
const require_key_spacing$1 = require("./rules/key-spacing.js");
const require_keyword_spacing$1 = require("./rules/keyword-spacing.js");
const require_match_component_file_name = require("./rules/match-component-file-name.js");
const require_match_component_import_name = require("./rules/match-component-import-name.js");
const require_max_attributes_per_line$1 = require("./rules/max-attributes-per-line.js");
const require_max_len$1 = require("./rules/max-len.js");
const require_max_lines_per_block$1 = require("./rules/max-lines-per-block.js");
const require_max_props$1 = require("./rules/max-props.js");
const require_max_template_depth$1 = require("./rules/max-template-depth.js");
const require_multi_word_component_names = require("./rules/multi-word-component-names.js");
const require_multiline_html_element_content_newline = require("./rules/multiline-html-element-content-newline.js");
const require_multiline_ternary$1 = require("./rules/multiline-ternary.js");
const require_mustache_interpolation_spacing$1 = require("./rules/mustache-interpolation-spacing.js");
const require_new_line_between_multi_line_property$1 = require("./rules/new-line-between-multi-line-property.js");
const require_next_tick_style$1 = require("./rules/next-tick-style.js");
const require_no_arrow_functions_in_watch$1 = require("./rules/no-arrow-functions-in-watch.js");
const require_no_async_in_computed_properties$1 = require("./rules/no-async-in-computed-properties.js");
const require_no_bare_strings_in_template = require("./rules/no-bare-strings-in-template.js");
const require_no_boolean_default$1 = require("./rules/no-boolean-default.js");
const require_no_child_content$1 = require("./rules/no-child-content.js");
const require_no_computed_properties_in_data$1 = require("./rules/no-computed-properties-in-data.js");
const require_no_console$1 = require("./rules/no-console.js");
const require_no_constant_condition$1 = require("./rules/no-constant-condition.js");
const require_no_custom_modifiers_on_v_model$1 = require("./rules/no-custom-modifiers-on-v-model.js");
const require_no_deprecated_data_object_declaration$1 = require("./rules/no-deprecated-data-object-declaration.js");
const require_no_deprecated_delete_set$1 = require("./rules/no-deprecated-delete-set.js");
const require_no_deprecated_destroyed_lifecycle$1 = require("./rules/no-deprecated-destroyed-lifecycle.js");
const require_no_deprecated_dollar_listeners_api$1 = require("./rules/no-deprecated-dollar-listeners-api.js");
const require_no_deprecated_dollar_scopedslots_api$1 = require("./rules/no-deprecated-dollar-scopedslots-api.js");
const require_no_deprecated_events_api$1 = require("./rules/no-deprecated-events-api.js");
const require_no_deprecated_filter$1 = require("./rules/no-deprecated-filter.js");
const require_no_deprecated_functional_template$1 = require("./rules/no-deprecated-functional-template.js");
const require_no_deprecated_html_element_is$1 = require("./rules/no-deprecated-html-element-is.js");
const require_no_deprecated_inline_template$1 = require("./rules/no-deprecated-inline-template.js");
const require_no_deprecated_model_definition$1 = require("./rules/no-deprecated-model-definition.js");
const require_no_deprecated_props_default_this$1 = require("./rules/no-deprecated-props-default-this.js");
const require_no_deprecated_router_link_tag_prop = require("./rules/no-deprecated-router-link-tag-prop.js");
const require_no_deprecated_scope_attribute$1 = require("./rules/no-deprecated-scope-attribute.js");
const require_no_deprecated_slot_attribute = require("./rules/no-deprecated-slot-attribute.js");
const require_no_deprecated_slot_scope_attribute$1 = require("./rules/no-deprecated-slot-scope-attribute.js");
const require_no_deprecated_v_bind_sync$1 = require("./rules/no-deprecated-v-bind-sync.js");
const require_no_deprecated_v_is$1 = require("./rules/no-deprecated-v-is.js");
const require_no_deprecated_v_on_native_modifier$1 = require("./rules/no-deprecated-v-on-native-modifier.js");
const require_no_deprecated_v_on_number_modifiers = require("./rules/no-deprecated-v-on-number-modifiers.js");
const require_no_deprecated_vue_config_keycodes$1 = require("./rules/no-deprecated-vue-config-keycodes.js");
const require_no_dupe_keys$1 = require("./rules/no-dupe-keys.js");
const require_no_dupe_v_else_if$1 = require("./rules/no-dupe-v-else-if.js");
const require_no_duplicate_attr_inheritance$1 = require("./rules/no-duplicate-attr-inheritance.js");
const require_no_duplicate_attributes$1 = require("./rules/no-duplicate-attributes.js");
const require_no_duplicate_class_names$1 = require("./rules/no-duplicate-class-names.js");
const require_no_empty_component_block$1 = require("./rules/no-empty-component-block.js");
const require_no_empty_pattern$1 = require("./rules/no-empty-pattern.js");
const require_no_export_in_script_setup$1 = require("./rules/no-export-in-script-setup.js");
const require_no_expose_after_await$1 = require("./rules/no-expose-after-await.js");
const require_no_extra_parens = require("./rules/no-extra-parens.js");
const require_no_implicit_coercion$1 = require("./rules/no-implicit-coercion.js");
const require_no_import_compiler_macros$1 = require("./rules/no-import-compiler-macros.js");
const require_no_irregular_whitespace$1 = require("./rules/no-irregular-whitespace.js");
const require_no_lifecycle_after_await$1 = require("./rules/no-lifecycle-after-await.js");
const require_no_literals_in_template = require("./rules/no-literals-in-template.js");
const require_no_lone_template$1 = require("./rules/no-lone-template.js");
const require_no_loss_of_precision$1 = require("./rules/no-loss-of-precision.js");
const require_no_multi_spaces$1 = require("./rules/no-multi-spaces.js");
const require_no_multiple_objects_in_class$1 = require("./rules/no-multiple-objects-in-class.js");
const require_no_multiple_slot_args$1 = require("./rules/no-multiple-slot-args.js");
const require_no_multiple_template_root$1 = require("./rules/no-multiple-template-root.js");
const require_no_mutating_props$1 = require("./rules/no-mutating-props.js");
const require_no_negated_condition$1 = require("./rules/no-negated-condition.js");
const require_no_negated_v_if_condition$1 = require("./rules/no-negated-v-if-condition.js");
const require_no_parsing_error$1 = require("./rules/no-parsing-error.js");
const require_no_potential_component_option_typo$1 = require("./rules/no-potential-component-option-typo.js");
const require_no_ref_as_operand = require("./rules/no-ref-as-operand.js");
const require_no_ref_object_reactivity_loss = require("./rules/no-ref-object-reactivity-loss.js");
const require_no_required_prop_with_default$1 = require("./rules/no-required-prop-with-default.js");
const require_no_reserved_component_names = require("./rules/no-reserved-component-names.js");
const require_no_reserved_keys$1 = require("./rules/no-reserved-keys.js");
const require_no_reserved_props = require("./rules/no-reserved-props.js");
const require_no_restricted_block = require("./rules/no-restricted-block.js");
const require_no_restricted_call_after_await$1 = require("./rules/no-restricted-call-after-await.js");
const require_no_restricted_class = require("./rules/no-restricted-class.js");
const require_no_restricted_component_names = require("./rules/no-restricted-component-names.js");
const require_no_restricted_component_options = require("./rules/no-restricted-component-options.js");
const require_no_restricted_custom_event = require("./rules/no-restricted-custom-event.js");
const require_no_restricted_html_elements$1 = require("./rules/no-restricted-html-elements.js");
const require_no_restricted_props = require("./rules/no-restricted-props.js");
const require_no_restricted_static_attribute = require("./rules/no-restricted-static-attribute.js");
const require_no_restricted_syntax$1 = require("./rules/no-restricted-syntax.js");
const require_no_restricted_v_bind = require("./rules/no-restricted-v-bind.js");
const require_no_restricted_v_on = require("./rules/no-restricted-v-on.js");
const require_no_root_v_if$1 = require("./rules/no-root-v-if.js");
const require_no_setup_props_reactivity_loss$1 = require("./rules/no-setup-props-reactivity-loss.js");
const require_no_shared_component_data$1 = require("./rules/no-shared-component-data.js");
const require_no_side_effects_in_computed_properties$1 = require("./rules/no-side-effects-in-computed-properties.js");
const require_no_spaces_around_equal_signs_in_attribute$1 = require("./rules/no-spaces-around-equal-signs-in-attribute.js");
const require_no_sparse_arrays$1 = require("./rules/no-sparse-arrays.js");
const require_no_static_inline_styles$1 = require("./rules/no-static-inline-styles.js");
const require_no_template_key$1 = require("./rules/no-template-key.js");
const require_no_template_shadow$1 = require("./rules/no-template-shadow.js");
const require_no_template_target_blank$1 = require("./rules/no-template-target-blank.js");
const require_no_textarea_mustache$1 = require("./rules/no-textarea-mustache.js");
const require_no_this_in_before_route_enter$1 = require("./rules/no-this-in-before-route-enter.js");
const require_no_undef_components = require("./rules/no-undef-components.js");
const require_no_undef_directives = require("./rules/no-undef-directives.js");
const require_no_undef_properties = require("./rules/no-undef-properties.js");
const require_no_unsupported_features = require("./rules/no-unsupported-features.js");
const require_no_unused_components = require("./rules/no-unused-components.js");
const require_no_unused_emit_declarations$1 = require("./rules/no-unused-emit-declarations.js");
const require_no_unused_properties = require("./rules/no-unused-properties.js");
const require_no_unused_refs$1 = require("./rules/no-unused-refs.js");
const require_no_unused_vars$1 = require("./rules/no-unused-vars.js");
const require_no_use_computed_property_like_method$1 = require("./rules/no-use-computed-property-like-method.js");
const require_no_use_v_else_with_v_for$1 = require("./rules/no-use-v-else-with-v-for.js");
const require_no_use_v_if_with_v_for$1 = require("./rules/no-use-v-if-with-v-for.js");
const require_no_useless_concat$1 = require("./rules/no-useless-concat.js");
const require_no_useless_mustaches$1 = require("./rules/no-useless-mustaches.js");
const require_no_useless_template_attributes$1 = require("./rules/no-useless-template-attributes.js");
const require_no_useless_v_bind$1 = require("./rules/no-useless-v-bind.js");
const require_no_v_for_template_key_on_child$1 = require("./rules/no-v-for-template-key-on-child.js");
const require_no_v_for_template_key$1 = require("./rules/no-v-for-template-key.js");
const require_no_v_html$1 = require("./rules/no-v-html.js");
const require_no_v_model_argument$1 = require("./rules/no-v-model-argument.js");
const require_no_v_text_v_html_on_component = require("./rules/no-v-text-v-html-on-component.js");
const require_no_v_text$1 = require("./rules/no-v-text.js");
const require_no_watch_after_await$1 = require("./rules/no-watch-after-await.js");
const require_object_curly_newline$1 = require("./rules/object-curly-newline.js");
const require_object_curly_spacing$1 = require("./rules/object-curly-spacing.js");
const require_object_property_newline$1 = require("./rules/object-property-newline.js");
const require_object_shorthand$1 = require("./rules/object-shorthand.js");
const require_one_component_per_file$1 = require("./rules/one-component-per-file.js");
const require_operator_linebreak$1 = require("./rules/operator-linebreak.js");
const require_order_in_components$1 = require("./rules/order-in-components.js");
const require_padding_line_between_blocks$1 = require("./rules/padding-line-between-blocks.js");
const require_padding_line_between_tags$1 = require("./rules/padding-line-between-tags.js");
const require_padding_lines_in_component_definition$1 = require("./rules/padding-lines-in-component-definition.js");
const require_prefer_define_options$1 = require("./rules/prefer-define-options.js");
const require_prefer_import_from_vue$1 = require("./rules/prefer-import-from-vue.js");
const require_prefer_prop_type_boolean_first$1 = require("./rules/prefer-prop-type-boolean-first.js");
const require_prefer_separate_static_class$1 = require("./rules/prefer-separate-static-class.js");
const require_prefer_single_event_payload = require("./rules/prefer-single-event-payload.js");
const require_prefer_template$1 = require("./rules/prefer-template.js");
const require_prefer_true_attribute_shorthand = require("./rules/prefer-true-attribute-shorthand.js");
const require_prefer_use_template_ref$1 = require("./rules/prefer-use-template-ref.js");
const require_prefer_v_model = require("./rules/prefer-v-model.js");
const require_prop_name_casing = require("./rules/prop-name-casing.js");
const require_quote_props$1 = require("./rules/quote-props.js");
const require_require_component_is$1 = require("./rules/require-component-is.js");
const require_require_default_export$1 = require("./rules/require-default-export.js");
const require_require_default_prop$1 = require("./rules/require-default-prop.js");
const require_require_direct_export$1 = require("./rules/require-direct-export.js");
const require_require_emit_validator$1 = require("./rules/require-emit-validator.js");
const require_require_explicit_emits = require("./rules/require-explicit-emits.js");
const require_require_explicit_slots$1 = require("./rules/require-explicit-slots.js");
const require_require_expose$1 = require("./rules/require-expose.js");
const require_require_macro_variable_name$1 = require("./rules/require-macro-variable-name.js");
const require_require_name_property$1 = require("./rules/require-name-property.js");
const require_require_prop_comment = require("./rules/require-prop-comment.js");
const require_require_prop_type_constructor$1 = require("./rules/require-prop-type-constructor.js");
const require_require_prop_types$1 = require("./rules/require-prop-types.js");
const require_require_render_return$1 = require("./rules/require-render-return.js");
const require_require_slots_as_functions$1 = require("./rules/require-slots-as-functions.js");
const require_require_toggle_inside_transition$1 = require("./rules/require-toggle-inside-transition.js");
const require_require_typed_object_prop$1 = require("./rules/require-typed-object-prop.js");
const require_require_typed_ref = require("./rules/require-typed-ref.js");
const require_require_v_for_key$1 = require("./rules/require-v-for-key.js");
const require_require_valid_default_prop = require("./rules/require-valid-default-prop.js");
const require_restricted_component_names = require("./rules/restricted-component-names.js");
const require_return_in_computed_property$1 = require("./rules/return-in-computed-property.js");
const require_return_in_emits_validator$1 = require("./rules/return-in-emits-validator.js");
const require_script_indent = require("./rules/script-indent.js");
const require_singleline_html_element_content_newline = require("./rules/singleline-html-element-content-newline.js");
const require_slot_name_casing = require("./rules/slot-name-casing.js");
const require_sort_keys$1 = require("./rules/sort-keys.js");
const require_space_in_parens$1 = require("./rules/space-in-parens.js");
const require_space_infix_ops$1 = require("./rules/space-infix-ops.js");
const require_space_unary_ops$1 = require("./rules/space-unary-ops.js");
const require_static_class_names_order$1 = require("./rules/static-class-names-order.js");
const require_template_curly_spacing$1 = require("./rules/template-curly-spacing.js");
const require_this_in_template$1 = require("./rules/this-in-template.js");
const require_use_v_on_exact$1 = require("./rules/use-v-on-exact.js");
const require_v_bind_style = require("./rules/v-bind-style.js");
const require_v_for_delimiter_style$1 = require("./rules/v-for-delimiter-style.js");
const require_v_if_else_key = require("./rules/v-if-else-key.js");
const require_v_on_event_hyphenation = require("./rules/v-on-event-hyphenation.js");
const require_v_on_handler_style$1 = require("./rules/v-on-handler-style.js");
const require_v_on_style$1 = require("./rules/v-on-style.js");
const require_v_slot_style = require("./rules/v-slot-style.js");
const require_valid_attribute_name$1 = require("./rules/valid-attribute-name.js");
const require_valid_define_emits$1 = require("./rules/valid-define-emits.js");
const require_valid_define_options$1 = require("./rules/valid-define-options.js");
const require_valid_define_props$1 = require("./rules/valid-define-props.js");
const require_valid_model_definition$1 = require("./rules/valid-model-definition.js");
const require_valid_next_tick$1 = require("./rules/valid-next-tick.js");
const require_valid_template_root$1 = require("./rules/valid-template-root.js");
const require_valid_v_bind_sync$1 = require("./rules/valid-v-bind-sync.js");
const require_valid_v_bind$1 = require("./rules/valid-v-bind.js");
const require_valid_v_cloak$1 = require("./rules/valid-v-cloak.js");
const require_valid_v_else_if$1 = require("./rules/valid-v-else-if.js");
const require_valid_v_else$1 = require("./rules/valid-v-else.js");
const require_valid_v_for$1 = require("./rules/valid-v-for.js");
const require_valid_v_html$1 = require("./rules/valid-v-html.js");
const require_valid_v_if$1 = require("./rules/valid-v-if.js");
const require_valid_v_is$1 = require("./rules/valid-v-is.js");
const require_valid_v_memo$1 = require("./rules/valid-v-memo.js");
const require_valid_v_model$1 = require("./rules/valid-v-model.js");
const require_valid_v_on$1 = require("./rules/valid-v-on.js");
const require_valid_v_once$1 = require("./rules/valid-v-once.js");
const require_valid_v_pre$1 = require("./rules/valid-v-pre.js");
const require_valid_v_show$1 = require("./rules/valid-v-show.js");
const require_valid_v_slot$1 = require("./rules/valid-v-slot.js");
const require_valid_v_text$1 = require("./rules/valid-v-text.js");
//#region lib/plugin.ts
var import_array_bracket_newline = /* @__PURE__ */ require_runtime.__toESM(require_array_bracket_newline$1.default);
var import_array_bracket_spacing = /* @__PURE__ */ require_runtime.__toESM(require_array_bracket_spacing$1.default);
var import_array_element_newline = /* @__PURE__ */ require_runtime.__toESM(require_array_element_newline$1.default);
var import_arrow_spacing = /* @__PURE__ */ require_runtime.__toESM(require_arrow_spacing$1.default);
var import_attributes_order = /* @__PURE__ */ require_runtime.__toESM(require_attributes_order$1.default);
var import_block_lang = /* @__PURE__ */ require_runtime.__toESM(require_block_lang$1.default);
var import_block_spacing = /* @__PURE__ */ require_runtime.__toESM(require_block_spacing$1.default);
var import_block_tag_newline = /* @__PURE__ */ require_runtime.__toESM(require_block_tag_newline$1.default);
var import_brace_style = /* @__PURE__ */ require_runtime.__toESM(require_brace_style$1.default);
var import_camelcase = /* @__PURE__ */ require_runtime.__toESM(require_camelcase$1.default);
var import_comma_dangle = /* @__PURE__ */ require_runtime.__toESM(require_comma_dangle$1.default);
var import_comma_spacing = /* @__PURE__ */ require_runtime.__toESM(require_comma_spacing$1.default);
var import_comma_style = /* @__PURE__ */ require_runtime.__toESM(require_comma_style$1.default);
var import_comment_directive = /* @__PURE__ */ require_runtime.__toESM(require_comment_directive$1.default);
var import_component_api_style = /* @__PURE__ */ require_runtime.__toESM(require_component_api_style$1.default);
var import_define_emits_declaration = /* @__PURE__ */ require_runtime.__toESM(require_define_emits_declaration$1.default);
var import_define_macros_order = /* @__PURE__ */ require_runtime.__toESM(require_define_macros_order$1.default);
var import_define_props_declaration = /* @__PURE__ */ require_runtime.__toESM(require_define_props_declaration$1.default);
var import_define_props_destructuring = /* @__PURE__ */ require_runtime.__toESM(require_define_props_destructuring$1.default);
var import_dot_location = /* @__PURE__ */ require_runtime.__toESM(require_dot_location$1.default);
var import_dot_notation = /* @__PURE__ */ require_runtime.__toESM(require_dot_notation$1.default);
var import_enforce_style_attribute = /* @__PURE__ */ require_runtime.__toESM(require_enforce_style_attribute$1.default);
var import_eqeqeq = /* @__PURE__ */ require_runtime.__toESM(require_eqeqeq$1.default);
var import_first_attribute_linebreak = /* @__PURE__ */ require_runtime.__toESM(require_first_attribute_linebreak$1.default);
var import_func_call_spacing = /* @__PURE__ */ require_runtime.__toESM(require_func_call_spacing$1.default);
var import_html_button_has_type = /* @__PURE__ */ require_runtime.__toESM(require_html_button_has_type$1.default);
var import_html_closing_bracket_newline = /* @__PURE__ */ require_runtime.__toESM(require_html_closing_bracket_newline$1.default);
var import_html_closing_bracket_spacing = /* @__PURE__ */ require_runtime.__toESM(require_html_closing_bracket_spacing$1.default);
var import_html_end_tags = /* @__PURE__ */ require_runtime.__toESM(require_html_end_tags$1.default);
var import_html_quotes = /* @__PURE__ */ require_runtime.__toESM(require_html_quotes$1.default);
var import_jsx_uses_vars = /* @__PURE__ */ require_runtime.__toESM(require_jsx_uses_vars$1.default);
var import_key_spacing = /* @__PURE__ */ require_runtime.__toESM(require_key_spacing$1.default);
var import_keyword_spacing = /* @__PURE__ */ require_runtime.__toESM(require_keyword_spacing$1.default);
var import_max_attributes_per_line = /* @__PURE__ */ require_runtime.__toESM(require_max_attributes_per_line$1.default);
var import_max_len = /* @__PURE__ */ require_runtime.__toESM(require_max_len$1.default);
var import_max_lines_per_block = /* @__PURE__ */ require_runtime.__toESM(require_max_lines_per_block$1.default);
var import_max_props = /* @__PURE__ */ require_runtime.__toESM(require_max_props$1.default);
var import_max_template_depth = /* @__PURE__ */ require_runtime.__toESM(require_max_template_depth$1.default);
var import_multiline_ternary = /* @__PURE__ */ require_runtime.__toESM(require_multiline_ternary$1.default);
var import_mustache_interpolation_spacing = /* @__PURE__ */ require_runtime.__toESM(require_mustache_interpolation_spacing$1.default);
var import_new_line_between_multi_line_property = /* @__PURE__ */ require_runtime.__toESM(require_new_line_between_multi_line_property$1.default);
var import_next_tick_style = /* @__PURE__ */ require_runtime.__toESM(require_next_tick_style$1.default);
var import_no_arrow_functions_in_watch = /* @__PURE__ */ require_runtime.__toESM(require_no_arrow_functions_in_watch$1.default);
var import_no_async_in_computed_properties = /* @__PURE__ */ require_runtime.__toESM(require_no_async_in_computed_properties$1.default);
var import_no_boolean_default = /* @__PURE__ */ require_runtime.__toESM(require_no_boolean_default$1.default);
var import_no_child_content = /* @__PURE__ */ require_runtime.__toESM(require_no_child_content$1.default);
var import_no_computed_properties_in_data = /* @__PURE__ */ require_runtime.__toESM(require_no_computed_properties_in_data$1.default);
var import_no_console = /* @__PURE__ */ require_runtime.__toESM(require_no_console$1.default);
var import_no_constant_condition = /* @__PURE__ */ require_runtime.__toESM(require_no_constant_condition$1.default);
var import_no_custom_modifiers_on_v_model = /* @__PURE__ */ require_runtime.__toESM(require_no_custom_modifiers_on_v_model$1.default);
var import_no_deprecated_data_object_declaration = /* @__PURE__ */ require_runtime.__toESM(require_no_deprecated_data_object_declaration$1.default);
var import_no_deprecated_delete_set = /* @__PURE__ */ require_runtime.__toESM(require_no_deprecated_delete_set$1.default);
var import_no_deprecated_destroyed_lifecycle = /* @__PURE__ */ require_runtime.__toESM(require_no_deprecated_destroyed_lifecycle$1.default);
var import_no_deprecated_dollar_listeners_api = /* @__PURE__ */ require_runtime.__toESM(require_no_deprecated_dollar_listeners_api$1.default);
var import_no_deprecated_dollar_scopedslots_api = /* @__PURE__ */ require_runtime.__toESM(require_no_deprecated_dollar_scopedslots_api$1.default);
var import_no_deprecated_events_api = /* @__PURE__ */ require_runtime.__toESM(require_no_deprecated_events_api$1.default);
var import_no_deprecated_filter = /* @__PURE__ */ require_runtime.__toESM(require_no_deprecated_filter$1.default);
var import_no_deprecated_functional_template = /* @__PURE__ */ require_runtime.__toESM(require_no_deprecated_functional_template$1.default);
var import_no_deprecated_html_element_is = /* @__PURE__ */ require_runtime.__toESM(require_no_deprecated_html_element_is$1.default);
var import_no_deprecated_inline_template = /* @__PURE__ */ require_runtime.__toESM(require_no_deprecated_inline_template$1.default);
var import_no_deprecated_model_definition = /* @__PURE__ */ require_runtime.__toESM(require_no_deprecated_model_definition$1.default);
var import_no_deprecated_props_default_this = /* @__PURE__ */ require_runtime.__toESM(require_no_deprecated_props_default_this$1.default);
var import_no_deprecated_scope_attribute = /* @__PURE__ */ require_runtime.__toESM(require_no_deprecated_scope_attribute$1.default);
var import_no_deprecated_slot_scope_attribute = /* @__PURE__ */ require_runtime.__toESM(require_no_deprecated_slot_scope_attribute$1.default);
var import_no_deprecated_v_bind_sync = /* @__PURE__ */ require_runtime.__toESM(require_no_deprecated_v_bind_sync$1.default);
var import_no_deprecated_v_is = /* @__PURE__ */ require_runtime.__toESM(require_no_deprecated_v_is$1.default);
var import_no_deprecated_v_on_native_modifier = /* @__PURE__ */ require_runtime.__toESM(require_no_deprecated_v_on_native_modifier$1.default);
var import_no_deprecated_vue_config_keycodes = /* @__PURE__ */ require_runtime.__toESM(require_no_deprecated_vue_config_keycodes$1.default);
var import_no_dupe_keys = /* @__PURE__ */ require_runtime.__toESM(require_no_dupe_keys$1.default);
var import_no_dupe_v_else_if = /* @__PURE__ */ require_runtime.__toESM(require_no_dupe_v_else_if$1.default);
var import_no_duplicate_attr_inheritance = /* @__PURE__ */ require_runtime.__toESM(require_no_duplicate_attr_inheritance$1.default);
var import_no_duplicate_attributes = /* @__PURE__ */ require_runtime.__toESM(require_no_duplicate_attributes$1.default);
var import_no_duplicate_class_names = /* @__PURE__ */ require_runtime.__toESM(require_no_duplicate_class_names$1.default);
var import_no_empty_component_block = /* @__PURE__ */ require_runtime.__toESM(require_no_empty_component_block$1.default);
var import_no_empty_pattern = /* @__PURE__ */ require_runtime.__toESM(require_no_empty_pattern$1.default);
var import_no_export_in_script_setup = /* @__PURE__ */ require_runtime.__toESM(require_no_export_in_script_setup$1.default);
var import_no_expose_after_await = /* @__PURE__ */ require_runtime.__toESM(require_no_expose_after_await$1.default);
var import_no_implicit_coercion = /* @__PURE__ */ require_runtime.__toESM(require_no_implicit_coercion$1.default);
var import_no_import_compiler_macros = /* @__PURE__ */ require_runtime.__toESM(require_no_import_compiler_macros$1.default);
var import_no_irregular_whitespace = /* @__PURE__ */ require_runtime.__toESM(require_no_irregular_whitespace$1.default);
var import_no_lifecycle_after_await = /* @__PURE__ */ require_runtime.__toESM(require_no_lifecycle_after_await$1.default);
var import_no_lone_template = /* @__PURE__ */ require_runtime.__toESM(require_no_lone_template$1.default);
var import_no_loss_of_precision = /* @__PURE__ */ require_runtime.__toESM(require_no_loss_of_precision$1.default);
var import_no_multi_spaces = /* @__PURE__ */ require_runtime.__toESM(require_no_multi_spaces$1.default);
var import_no_multiple_objects_in_class = /* @__PURE__ */ require_runtime.__toESM(require_no_multiple_objects_in_class$1.default);
var import_no_multiple_slot_args = /* @__PURE__ */ require_runtime.__toESM(require_no_multiple_slot_args$1.default);
var import_no_multiple_template_root = /* @__PURE__ */ require_runtime.__toESM(require_no_multiple_template_root$1.default);
var import_no_mutating_props = /* @__PURE__ */ require_runtime.__toESM(require_no_mutating_props$1.default);
var import_no_negated_condition = /* @__PURE__ */ require_runtime.__toESM(require_no_negated_condition$1.default);
var import_no_negated_v_if_condition = /* @__PURE__ */ require_runtime.__toESM(require_no_negated_v_if_condition$1.default);
var import_no_parsing_error = /* @__PURE__ */ require_runtime.__toESM(require_no_parsing_error$1.default);
var import_no_potential_component_option_typo = /* @__PURE__ */ require_runtime.__toESM(require_no_potential_component_option_typo$1.default);
var import_no_required_prop_with_default = /* @__PURE__ */ require_runtime.__toESM(require_no_required_prop_with_default$1.default);
var import_no_reserved_keys = /* @__PURE__ */ require_runtime.__toESM(require_no_reserved_keys$1.default);
var import_no_restricted_call_after_await = /* @__PURE__ */ require_runtime.__toESM(require_no_restricted_call_after_await$1.default);
var import_no_restricted_html_elements = /* @__PURE__ */ require_runtime.__toESM(require_no_restricted_html_elements$1.default);
var import_no_restricted_syntax = /* @__PURE__ */ require_runtime.__toESM(require_no_restricted_syntax$1.default);
var import_no_root_v_if = /* @__PURE__ */ require_runtime.__toESM(require_no_root_v_if$1.default);
var import_no_setup_props_reactivity_loss = /* @__PURE__ */ require_runtime.__toESM(require_no_setup_props_reactivity_loss$1.default);
var import_no_shared_component_data = /* @__PURE__ */ require_runtime.__toESM(require_no_shared_component_data$1.default);
var import_no_side_effects_in_computed_properties = /* @__PURE__ */ require_runtime.__toESM(require_no_side_effects_in_computed_properties$1.default);
var import_no_spaces_around_equal_signs_in_attribute = /* @__PURE__ */ require_runtime.__toESM(require_no_spaces_around_equal_signs_in_attribute$1.default);
var import_no_sparse_arrays = /* @__PURE__ */ require_runtime.__toESM(require_no_sparse_arrays$1.default);
var import_no_static_inline_styles = /* @__PURE__ */ require_runtime.__toESM(require_no_static_inline_styles$1.default);
var import_no_template_key = /* @__PURE__ */ require_runtime.__toESM(require_no_template_key$1.default);
var import_no_template_shadow = /* @__PURE__ */ require_runtime.__toESM(require_no_template_shadow$1.default);
var import_no_template_target_blank = /* @__PURE__ */ require_runtime.__toESM(require_no_template_target_blank$1.default);
var import_no_textarea_mustache = /* @__PURE__ */ require_runtime.__toESM(require_no_textarea_mustache$1.default);
var import_no_this_in_before_route_enter = /* @__PURE__ */ require_runtime.__toESM(require_no_this_in_before_route_enter$1.default);
var import_no_unused_emit_declarations = /* @__PURE__ */ require_runtime.__toESM(require_no_unused_emit_declarations$1.default);
var import_no_unused_refs = /* @__PURE__ */ require_runtime.__toESM(require_no_unused_refs$1.default);
var import_no_unused_vars = /* @__PURE__ */ require_runtime.__toESM(require_no_unused_vars$1.default);
var import_no_use_computed_property_like_method = /* @__PURE__ */ require_runtime.__toESM(require_no_use_computed_property_like_method$1.default);
var import_no_use_v_else_with_v_for = /* @__PURE__ */ require_runtime.__toESM(require_no_use_v_else_with_v_for$1.default);
var import_no_use_v_if_with_v_for = /* @__PURE__ */ require_runtime.__toESM(require_no_use_v_if_with_v_for$1.default);
var import_no_useless_concat = /* @__PURE__ */ require_runtime.__toESM(require_no_useless_concat$1.default);
var import_no_useless_mustaches = /* @__PURE__ */ require_runtime.__toESM(require_no_useless_mustaches$1.default);
var import_no_useless_template_attributes = /* @__PURE__ */ require_runtime.__toESM(require_no_useless_template_attributes$1.default);
var import_no_useless_v_bind = /* @__PURE__ */ require_runtime.__toESM(require_no_useless_v_bind$1.default);
var import_no_v_for_template_key_on_child = /* @__PURE__ */ require_runtime.__toESM(require_no_v_for_template_key_on_child$1.default);
var import_no_v_for_template_key = /* @__PURE__ */ require_runtime.__toESM(require_no_v_for_template_key$1.default);
var import_no_v_html = /* @__PURE__ */ require_runtime.__toESM(require_no_v_html$1.default);
var import_no_v_model_argument = /* @__PURE__ */ require_runtime.__toESM(require_no_v_model_argument$1.default);
var import_no_v_text = /* @__PURE__ */ require_runtime.__toESM(require_no_v_text$1.default);
var import_no_watch_after_await = /* @__PURE__ */ require_runtime.__toESM(require_no_watch_after_await$1.default);
var import_object_curly_newline = /* @__PURE__ */ require_runtime.__toESM(require_object_curly_newline$1.default);
var import_object_curly_spacing = /* @__PURE__ */ require_runtime.__toESM(require_object_curly_spacing$1.default);
var import_object_property_newline = /* @__PURE__ */ require_runtime.__toESM(require_object_property_newline$1.default);
var import_object_shorthand = /* @__PURE__ */ require_runtime.__toESM(require_object_shorthand$1.default);
var import_one_component_per_file = /* @__PURE__ */ require_runtime.__toESM(require_one_component_per_file$1.default);
var import_operator_linebreak = /* @__PURE__ */ require_runtime.__toESM(require_operator_linebreak$1.default);
var import_order_in_components = /* @__PURE__ */ require_runtime.__toESM(require_order_in_components$1.default);
var import_padding_line_between_blocks = /* @__PURE__ */ require_runtime.__toESM(require_padding_line_between_blocks$1.default);
var import_padding_line_between_tags = /* @__PURE__ */ require_runtime.__toESM(require_padding_line_between_tags$1.default);
var import_padding_lines_in_component_definition = /* @__PURE__ */ require_runtime.__toESM(require_padding_lines_in_component_definition$1.default);
var import_prefer_define_options = /* @__PURE__ */ require_runtime.__toESM(require_prefer_define_options$1.default);
var import_prefer_import_from_vue = /* @__PURE__ */ require_runtime.__toESM(require_prefer_import_from_vue$1.default);
var import_prefer_prop_type_boolean_first = /* @__PURE__ */ require_runtime.__toESM(require_prefer_prop_type_boolean_first$1.default);
var import_prefer_separate_static_class = /* @__PURE__ */ require_runtime.__toESM(require_prefer_separate_static_class$1.default);
var import_prefer_template = /* @__PURE__ */ require_runtime.__toESM(require_prefer_template$1.default);
var import_prefer_use_template_ref = /* @__PURE__ */ require_runtime.__toESM(require_prefer_use_template_ref$1.default);
var import_quote_props = /* @__PURE__ */ require_runtime.__toESM(require_quote_props$1.default);
var import_require_component_is = /* @__PURE__ */ require_runtime.__toESM(require_require_component_is$1.default);
var import_require_default_export = /* @__PURE__ */ require_runtime.__toESM(require_require_default_export$1.default);
var import_require_default_prop = /* @__PURE__ */ require_runtime.__toESM(require_require_default_prop$1.default);
var import_require_direct_export = /* @__PURE__ */ require_runtime.__toESM(require_require_direct_export$1.default);
var import_require_emit_validator = /* @__PURE__ */ require_runtime.__toESM(require_require_emit_validator$1.default);
var import_require_explicit_slots = /* @__PURE__ */ require_runtime.__toESM(require_require_explicit_slots$1.default);
var import_require_expose = /* @__PURE__ */ require_runtime.__toESM(require_require_expose$1.default);
var import_require_macro_variable_name = /* @__PURE__ */ require_runtime.__toESM(require_require_macro_variable_name$1.default);
var import_require_name_property = /* @__PURE__ */ require_runtime.__toESM(require_require_name_property$1.default);
var import_require_prop_type_constructor = /* @__PURE__ */ require_runtime.__toESM(require_require_prop_type_constructor$1.default);
var import_require_prop_types = /* @__PURE__ */ require_runtime.__toESM(require_require_prop_types$1.default);
var import_require_render_return = /* @__PURE__ */ require_runtime.__toESM(require_require_render_return$1.default);
var import_require_slots_as_functions = /* @__PURE__ */ require_runtime.__toESM(require_require_slots_as_functions$1.default);
var import_require_toggle_inside_transition = /* @__PURE__ */ require_runtime.__toESM(require_require_toggle_inside_transition$1.default);
var import_require_typed_object_prop = /* @__PURE__ */ require_runtime.__toESM(require_require_typed_object_prop$1.default);
var import_require_v_for_key = /* @__PURE__ */ require_runtime.__toESM(require_require_v_for_key$1.default);
var import_return_in_computed_property = /* @__PURE__ */ require_runtime.__toESM(require_return_in_computed_property$1.default);
var import_return_in_emits_validator = /* @__PURE__ */ require_runtime.__toESM(require_return_in_emits_validator$1.default);
var import_sort_keys = /* @__PURE__ */ require_runtime.__toESM(require_sort_keys$1.default);
var import_space_in_parens = /* @__PURE__ */ require_runtime.__toESM(require_space_in_parens$1.default);
var import_space_infix_ops = /* @__PURE__ */ require_runtime.__toESM(require_space_infix_ops$1.default);
var import_space_unary_ops = /* @__PURE__ */ require_runtime.__toESM(require_space_unary_ops$1.default);
var import_static_class_names_order = /* @__PURE__ */ require_runtime.__toESM(require_static_class_names_order$1.default);
var import_template_curly_spacing = /* @__PURE__ */ require_runtime.__toESM(require_template_curly_spacing$1.default);
var import_this_in_template = /* @__PURE__ */ require_runtime.__toESM(require_this_in_template$1.default);
var import_use_v_on_exact = /* @__PURE__ */ require_runtime.__toESM(require_use_v_on_exact$1.default);
var import_v_for_delimiter_style = /* @__PURE__ */ require_runtime.__toESM(require_v_for_delimiter_style$1.default);
var import_v_on_handler_style = /* @__PURE__ */ require_runtime.__toESM(require_v_on_handler_style$1.default);
var import_v_on_style = /* @__PURE__ */ require_runtime.__toESM(require_v_on_style$1.default);
var import_valid_attribute_name = /* @__PURE__ */ require_runtime.__toESM(require_valid_attribute_name$1.default);
var import_valid_define_emits = /* @__PURE__ */ require_runtime.__toESM(require_valid_define_emits$1.default);
var import_valid_define_options = /* @__PURE__ */ require_runtime.__toESM(require_valid_define_options$1.default);
var import_valid_define_props = /* @__PURE__ */ require_runtime.__toESM(require_valid_define_props$1.default);
var import_valid_model_definition = /* @__PURE__ */ require_runtime.__toESM(require_valid_model_definition$1.default);
var import_valid_next_tick = /* @__PURE__ */ require_runtime.__toESM(require_valid_next_tick$1.default);
var import_valid_template_root = /* @__PURE__ */ require_runtime.__toESM(require_valid_template_root$1.default);
var import_valid_v_bind_sync = /* @__PURE__ */ require_runtime.__toESM(require_valid_v_bind_sync$1.default);
var import_valid_v_bind = /* @__PURE__ */ require_runtime.__toESM(require_valid_v_bind$1.default);
var import_valid_v_cloak = /* @__PURE__ */ require_runtime.__toESM(require_valid_v_cloak$1.default);
var import_valid_v_else_if = /* @__PURE__ */ require_runtime.__toESM(require_valid_v_else_if$1.default);
var import_valid_v_else = /* @__PURE__ */ require_runtime.__toESM(require_valid_v_else$1.default);
var import_valid_v_for = /* @__PURE__ */ require_runtime.__toESM(require_valid_v_for$1.default);
var import_valid_v_html = /* @__PURE__ */ require_runtime.__toESM(require_valid_v_html$1.default);
var import_valid_v_if = /* @__PURE__ */ require_runtime.__toESM(require_valid_v_if$1.default);
var import_valid_v_is = /* @__PURE__ */ require_runtime.__toESM(require_valid_v_is$1.default);
var import_valid_v_memo = /* @__PURE__ */ require_runtime.__toESM(require_valid_v_memo$1.default);
var import_valid_v_model = /* @__PURE__ */ require_runtime.__toESM(require_valid_v_model$1.default);
var import_valid_v_on = /* @__PURE__ */ require_runtime.__toESM(require_valid_v_on$1.default);
var import_valid_v_once = /* @__PURE__ */ require_runtime.__toESM(require_valid_v_once$1.default);
var import_valid_v_pre = /* @__PURE__ */ require_runtime.__toESM(require_valid_v_pre$1.default);
var import_valid_v_show = /* @__PURE__ */ require_runtime.__toESM(require_valid_v_show$1.default);
var import_valid_v_slot = /* @__PURE__ */ require_runtime.__toESM(require_valid_v_slot$1.default);
var import_valid_v_text = /* @__PURE__ */ require_runtime.__toESM(require_valid_v_text$1.default);
var plugin_default = {
	meta: require_meta.default,
	rules: {
		"array-bracket-newline": import_array_bracket_newline.default,
		"array-bracket-spacing": import_array_bracket_spacing.default,
		"array-element-newline": import_array_element_newline.default,
		"arrow-spacing": import_arrow_spacing.default,
		"attribute-hyphenation": require_attribute_hyphenation.default,
		"attributes-order": import_attributes_order.default,
		"block-lang": import_block_lang.default,
		"block-order": require_block_order.default,
		"block-spacing": import_block_spacing.default,
		"block-tag-newline": import_block_tag_newline.default,
		"brace-style": import_brace_style.default,
		camelcase: import_camelcase.default,
		"comma-dangle": import_comma_dangle.default,
		"comma-spacing": import_comma_spacing.default,
		"comma-style": import_comma_style.default,
		"comment-directive": import_comment_directive.default,
		"component-api-style": import_component_api_style.default,
		"component-definition-name-casing": require_component_definition_name_casing.default,
		"component-name-in-template-casing": require_component_name_in_template_casing.default,
		"component-options-name-casing": require_component_options_name_casing.default,
		"custom-event-name-casing": require_custom_event_name_casing.default,
		"define-emits-declaration": import_define_emits_declaration.default,
		"define-macros-order": import_define_macros_order.default,
		"define-props-declaration": import_define_props_declaration.default,
		"define-props-destructuring": import_define_props_destructuring.default,
		"dot-location": import_dot_location.default,
		"dot-notation": import_dot_notation.default,
		"enforce-style-attribute": import_enforce_style_attribute.default,
		eqeqeq: import_eqeqeq.default,
		"first-attribute-linebreak": import_first_attribute_linebreak.default,
		"func-call-spacing": import_func_call_spacing.default,
		"html-button-has-type": import_html_button_has_type.default,
		"html-closing-bracket-newline": import_html_closing_bracket_newline.default,
		"html-closing-bracket-spacing": import_html_closing_bracket_spacing.default,
		"html-comment-content-newline": require_html_comment_content_newline.default,
		"html-comment-content-spacing": require_html_comment_content_spacing.default,
		"html-comment-indent": require_html_comment_indent.default,
		"html-end-tags": import_html_end_tags.default,
		"html-indent": require_html_indent.default,
		"html-quotes": import_html_quotes.default,
		"html-self-closing": require_html_self_closing.default,
		"jsx-uses-vars": import_jsx_uses_vars.default,
		"key-spacing": import_key_spacing.default,
		"keyword-spacing": import_keyword_spacing.default,
		"match-component-file-name": require_match_component_file_name.default,
		"match-component-import-name": require_match_component_import_name.default,
		"max-attributes-per-line": import_max_attributes_per_line.default,
		"max-len": import_max_len.default,
		"max-lines-per-block": import_max_lines_per_block.default,
		"max-props": import_max_props.default,
		"max-template-depth": import_max_template_depth.default,
		"multi-word-component-names": require_multi_word_component_names.default,
		"multiline-html-element-content-newline": require_multiline_html_element_content_newline.default,
		"multiline-ternary": import_multiline_ternary.default,
		"mustache-interpolation-spacing": import_mustache_interpolation_spacing.default,
		"new-line-between-multi-line-property": import_new_line_between_multi_line_property.default,
		"next-tick-style": import_next_tick_style.default,
		"no-arrow-functions-in-watch": import_no_arrow_functions_in_watch.default,
		"no-async-in-computed-properties": import_no_async_in_computed_properties.default,
		"no-bare-strings-in-template": require_no_bare_strings_in_template.default,
		"no-boolean-default": import_no_boolean_default.default,
		"no-child-content": import_no_child_content.default,
		"no-computed-properties-in-data": import_no_computed_properties_in_data.default,
		"no-console": import_no_console.default,
		"no-constant-condition": import_no_constant_condition.default,
		"no-custom-modifiers-on-v-model": import_no_custom_modifiers_on_v_model.default,
		"no-deprecated-data-object-declaration": import_no_deprecated_data_object_declaration.default,
		"no-deprecated-delete-set": import_no_deprecated_delete_set.default,
		"no-deprecated-destroyed-lifecycle": import_no_deprecated_destroyed_lifecycle.default,
		"no-deprecated-dollar-listeners-api": import_no_deprecated_dollar_listeners_api.default,
		"no-deprecated-dollar-scopedslots-api": import_no_deprecated_dollar_scopedslots_api.default,
		"no-deprecated-events-api": import_no_deprecated_events_api.default,
		"no-deprecated-filter": import_no_deprecated_filter.default,
		"no-deprecated-functional-template": import_no_deprecated_functional_template.default,
		"no-deprecated-html-element-is": import_no_deprecated_html_element_is.default,
		"no-deprecated-inline-template": import_no_deprecated_inline_template.default,
		"no-deprecated-model-definition": import_no_deprecated_model_definition.default,
		"no-deprecated-props-default-this": import_no_deprecated_props_default_this.default,
		"no-deprecated-router-link-tag-prop": require_no_deprecated_router_link_tag_prop.default,
		"no-deprecated-scope-attribute": import_no_deprecated_scope_attribute.default,
		"no-deprecated-slot-attribute": require_no_deprecated_slot_attribute.default,
		"no-deprecated-slot-scope-attribute": import_no_deprecated_slot_scope_attribute.default,
		"no-deprecated-v-bind-sync": import_no_deprecated_v_bind_sync.default,
		"no-deprecated-v-is": import_no_deprecated_v_is.default,
		"no-deprecated-v-on-native-modifier": import_no_deprecated_v_on_native_modifier.default,
		"no-deprecated-v-on-number-modifiers": require_no_deprecated_v_on_number_modifiers.default,
		"no-deprecated-vue-config-keycodes": import_no_deprecated_vue_config_keycodes.default,
		"no-dupe-keys": import_no_dupe_keys.default,
		"no-dupe-v-else-if": import_no_dupe_v_else_if.default,
		"no-duplicate-attr-inheritance": import_no_duplicate_attr_inheritance.default,
		"no-duplicate-attributes": import_no_duplicate_attributes.default,
		"no-duplicate-class-names": import_no_duplicate_class_names.default,
		"no-empty-component-block": import_no_empty_component_block.default,
		"no-empty-pattern": import_no_empty_pattern.default,
		"no-export-in-script-setup": import_no_export_in_script_setup.default,
		"no-expose-after-await": import_no_expose_after_await.default,
		"no-extra-parens": require_no_extra_parens.default,
		"no-implicit-coercion": import_no_implicit_coercion.default,
		"no-import-compiler-macros": import_no_import_compiler_macros.default,
		"no-irregular-whitespace": import_no_irregular_whitespace.default,
		"no-lifecycle-after-await": import_no_lifecycle_after_await.default,
		"no-literals-in-template": require_no_literals_in_template.default,
		"no-lone-template": import_no_lone_template.default,
		"no-loss-of-precision": import_no_loss_of_precision.default,
		"no-multi-spaces": import_no_multi_spaces.default,
		"no-multiple-objects-in-class": import_no_multiple_objects_in_class.default,
		"no-multiple-slot-args": import_no_multiple_slot_args.default,
		"no-multiple-template-root": import_no_multiple_template_root.default,
		"no-mutating-props": import_no_mutating_props.default,
		"no-negated-condition": import_no_negated_condition.default,
		"no-negated-v-if-condition": import_no_negated_v_if_condition.default,
		"no-parsing-error": import_no_parsing_error.default,
		"no-potential-component-option-typo": import_no_potential_component_option_typo.default,
		"no-ref-as-operand": require_no_ref_as_operand.default,
		"no-ref-object-reactivity-loss": require_no_ref_object_reactivity_loss.default,
		"no-required-prop-with-default": import_no_required_prop_with_default.default,
		"no-reserved-component-names": require_no_reserved_component_names.default,
		"no-reserved-keys": import_no_reserved_keys.default,
		"no-reserved-props": require_no_reserved_props.default,
		"no-restricted-block": require_no_restricted_block.default,
		"no-restricted-call-after-await": import_no_restricted_call_after_await.default,
		"no-restricted-class": require_no_restricted_class.default,
		"no-restricted-component-names": require_no_restricted_component_names.default,
		"no-restricted-component-options": require_no_restricted_component_options.default,
		"no-restricted-custom-event": require_no_restricted_custom_event.default,
		"no-restricted-html-elements": import_no_restricted_html_elements.default,
		"no-restricted-props": require_no_restricted_props.default,
		"no-restricted-static-attribute": require_no_restricted_static_attribute.default,
		"no-restricted-syntax": import_no_restricted_syntax.default,
		"no-restricted-v-bind": require_no_restricted_v_bind.default,
		"no-restricted-v-on": require_no_restricted_v_on.default,
		"no-root-v-if": import_no_root_v_if.default,
		"no-setup-props-reactivity-loss": import_no_setup_props_reactivity_loss.default,
		"no-shared-component-data": import_no_shared_component_data.default,
		"no-side-effects-in-computed-properties": import_no_side_effects_in_computed_properties.default,
		"no-spaces-around-equal-signs-in-attribute": import_no_spaces_around_equal_signs_in_attribute.default,
		"no-sparse-arrays": import_no_sparse_arrays.default,
		"no-static-inline-styles": import_no_static_inline_styles.default,
		"no-template-key": import_no_template_key.default,
		"no-template-shadow": import_no_template_shadow.default,
		"no-template-target-blank": import_no_template_target_blank.default,
		"no-textarea-mustache": import_no_textarea_mustache.default,
		"no-this-in-before-route-enter": import_no_this_in_before_route_enter.default,
		"no-undef-components": require_no_undef_components.default,
		"no-undef-directives": require_no_undef_directives.default,
		"no-undef-properties": require_no_undef_properties.default,
		"no-unsupported-features": require_no_unsupported_features.default,
		"no-unused-components": require_no_unused_components.default,
		"no-unused-emit-declarations": import_no_unused_emit_declarations.default,
		"no-unused-properties": require_no_unused_properties.default,
		"no-unused-refs": import_no_unused_refs.default,
		"no-unused-vars": import_no_unused_vars.default,
		"no-use-computed-property-like-method": import_no_use_computed_property_like_method.default,
		"no-use-v-else-with-v-for": import_no_use_v_else_with_v_for.default,
		"no-use-v-if-with-v-for": import_no_use_v_if_with_v_for.default,
		"no-useless-concat": import_no_useless_concat.default,
		"no-useless-mustaches": import_no_useless_mustaches.default,
		"no-useless-template-attributes": import_no_useless_template_attributes.default,
		"no-useless-v-bind": import_no_useless_v_bind.default,
		"no-v-for-template-key-on-child": import_no_v_for_template_key_on_child.default,
		"no-v-for-template-key": import_no_v_for_template_key.default,
		"no-v-html": import_no_v_html.default,
		"no-v-model-argument": import_no_v_model_argument.default,
		"no-v-text-v-html-on-component": require_no_v_text_v_html_on_component.default,
		"no-v-text": import_no_v_text.default,
		"no-watch-after-await": import_no_watch_after_await.default,
		"object-curly-newline": import_object_curly_newline.default,
		"object-curly-spacing": import_object_curly_spacing.default,
		"object-property-newline": import_object_property_newline.default,
		"object-shorthand": import_object_shorthand.default,
		"one-component-per-file": import_one_component_per_file.default,
		"operator-linebreak": import_operator_linebreak.default,
		"order-in-components": import_order_in_components.default,
		"padding-line-between-blocks": import_padding_line_between_blocks.default,
		"padding-line-between-tags": import_padding_line_between_tags.default,
		"padding-lines-in-component-definition": import_padding_lines_in_component_definition.default,
		"prefer-define-options": import_prefer_define_options.default,
		"prefer-import-from-vue": import_prefer_import_from_vue.default,
		"prefer-prop-type-boolean-first": import_prefer_prop_type_boolean_first.default,
		"prefer-separate-static-class": import_prefer_separate_static_class.default,
		"prefer-single-event-payload": require_prefer_single_event_payload.default,
		"prefer-template": import_prefer_template.default,
		"prefer-true-attribute-shorthand": require_prefer_true_attribute_shorthand.default,
		"prefer-use-template-ref": import_prefer_use_template_ref.default,
		"prefer-v-model": require_prefer_v_model.default,
		"prop-name-casing": require_prop_name_casing.default,
		"quote-props": import_quote_props.default,
		"require-component-is": import_require_component_is.default,
		"require-default-export": import_require_default_export.default,
		"require-default-prop": import_require_default_prop.default,
		"require-direct-export": import_require_direct_export.default,
		"require-emit-validator": import_require_emit_validator.default,
		"require-explicit-emits": require_require_explicit_emits.default,
		"require-explicit-slots": import_require_explicit_slots.default,
		"require-expose": import_require_expose.default,
		"require-macro-variable-name": import_require_macro_variable_name.default,
		"require-name-property": import_require_name_property.default,
		"require-prop-comment": require_require_prop_comment.default,
		"require-prop-type-constructor": import_require_prop_type_constructor.default,
		"require-prop-types": import_require_prop_types.default,
		"require-render-return": import_require_render_return.default,
		"require-slots-as-functions": import_require_slots_as_functions.default,
		"require-toggle-inside-transition": import_require_toggle_inside_transition.default,
		"require-typed-object-prop": import_require_typed_object_prop.default,
		"require-typed-ref": require_require_typed_ref.default,
		"require-v-for-key": import_require_v_for_key.default,
		"require-valid-default-prop": require_require_valid_default_prop.default,
		"restricted-component-names": require_restricted_component_names.default,
		"return-in-computed-property": import_return_in_computed_property.default,
		"return-in-emits-validator": import_return_in_emits_validator.default,
		"script-indent": require_script_indent.default,
		"singleline-html-element-content-newline": require_singleline_html_element_content_newline.default,
		"slot-name-casing": require_slot_name_casing.default,
		"sort-keys": import_sort_keys.default,
		"space-in-parens": import_space_in_parens.default,
		"space-infix-ops": import_space_infix_ops.default,
		"space-unary-ops": import_space_unary_ops.default,
		"static-class-names-order": import_static_class_names_order.default,
		"template-curly-spacing": import_template_curly_spacing.default,
		"this-in-template": import_this_in_template.default,
		"use-v-on-exact": import_use_v_on_exact.default,
		"v-bind-style": require_v_bind_style.default,
		"v-for-delimiter-style": import_v_for_delimiter_style.default,
		"v-if-else-key": require_v_if_else_key.default,
		"v-on-event-hyphenation": require_v_on_event_hyphenation.default,
		"v-on-handler-style": import_v_on_handler_style.default,
		"v-on-style": import_v_on_style.default,
		"v-slot-style": require_v_slot_style.default,
		"valid-attribute-name": import_valid_attribute_name.default,
		"valid-define-emits": import_valid_define_emits.default,
		"valid-define-options": import_valid_define_options.default,
		"valid-define-props": import_valid_define_props.default,
		"valid-model-definition": import_valid_model_definition.default,
		"valid-next-tick": import_valid_next_tick.default,
		"valid-template-root": import_valid_template_root.default,
		"valid-v-bind-sync": import_valid_v_bind_sync.default,
		"valid-v-bind": import_valid_v_bind.default,
		"valid-v-cloak": import_valid_v_cloak.default,
		"valid-v-else-if": import_valid_v_else_if.default,
		"valid-v-else": import_valid_v_else.default,
		"valid-v-for": import_valid_v_for.default,
		"valid-v-html": import_valid_v_html.default,
		"valid-v-if": import_valid_v_if.default,
		"valid-v-is": import_valid_v_is.default,
		"valid-v-memo": import_valid_v_memo.default,
		"valid-v-model": import_valid_v_model.default,
		"valid-v-on": import_valid_v_on.default,
		"valid-v-once": import_valid_v_once.default,
		"valid-v-pre": import_valid_v_pre.default,
		"valid-v-show": import_valid_v_show.default,
		"valid-v-slot": import_valid_v_slot.default,
		"valid-v-text": import_valid_v_text.default
	},
	processors: {
		".vue": require_processor.default,
		vue: require_processor.default
	}
};
//#endregion
exports.default = plugin_default;
Եx://#region lib/processor.ts
var processor_default = {
	preprocess(code) {
		return [code];
	},
	postprocess(messages) {
		const state = {
			block: {
				disableAllKeys: /* @__PURE__ */ new Set(),
				disableRuleKeys: /* @__PURE__ */ new Map()
			},
			line: {
				disableAllKeys: /* @__PURE__ */ new Set(),
				disableRuleKeys: /* @__PURE__ */ new Map()
			}
		};
		const usedDisableDirectiveKeys = [];
		const unusedDisableDirectiveReports = /* @__PURE__ */ new Map();
		const filteredMessages = messages[0].filter((message) => {
			if (message.ruleId === "vue/comment-directive") {
				const directiveType = message.messageId;
				const data = message.message.split(" ");
				switch (directiveType) {
					case "disableBlock":
						state.block.disableAllKeys.add(data[1]);
						break;
					case "disableLine":
						state.line.disableAllKeys.add(data[1]);
						break;
					case "enableBlock":
						state.block.disableAllKeys.clear();
						break;
					case "enableLine":
						state.line.disableAllKeys.clear();
						break;
					case "disableBlockRule":
						addDisableRule(state.block.disableRuleKeys, data[1], data[2]);
						break;
					case "disableLineRule":
						addDisableRule(state.line.disableRuleKeys, data[1], data[2]);
						break;
					case "enableBlockRule":
						state.block.disableRuleKeys.delete(data[1]);
						break;
					case "enableLineRule":
						state.line.disableRuleKeys.delete(data[1]);
						break;
					case "clear":
						state.block.disableAllKeys.clear();
						state.block.disableRuleKeys.clear();
						state.line.disableAllKeys.clear();
						state.line.disableRuleKeys.clear();
						break;
					default:
						unusedDisableDirectiveReports.set(messageToKey(message), message);
						break;
				}
				return false;
			}
			const disableDirectiveKeys = [];
			if (state.block.disableAllKeys.size > 0) disableDirectiveKeys.push(...state.block.disableAllKeys);
			if (state.line.disableAllKeys.size > 0) disableDirectiveKeys.push(...state.line.disableAllKeys);
			if (message.ruleId) {
				const block = state.block.disableRuleKeys.get(message.ruleId);
				if (block) disableDirectiveKeys.push(...block);
				const line = state.line.disableRuleKeys.get(message.ruleId);
				if (line) disableDirectiveKeys.push(...line);
			}
			if (disableDirectiveKeys.length > 0) {
				usedDisableDirectiveKeys.push(...disableDirectiveKeys);
				return false;
			}
			return true;
		});
		if (unusedDisableDirectiveReports.size > 0) {
			for (const key of usedDisableDirectiveKeys) unusedDisableDirectiveReports.delete(key);
			filteredMessages.push(...unusedDisableDirectiveReports.values());
			filteredMessages.sort(compareLocations);
		}
		return filteredMessages;
	},
	supportsAutofix: true,
	meta: require("./meta.js").default
};
function addDisableRule(disableRuleKeys, rule, key) {
	let keys = disableRuleKeys.get(rule);
	if (keys) keys.push(key);
	else {
		keys = [key];
		disableRuleKeys.set(rule, keys);
	}
}
function messageToKey(message) {
	return `line:${message.line},column${message.column - 1}`;
}
/**
* Compares the locations of two objects in a source file
* @param itemA The first object
* @param itemB The second object
* @returns A value less than 1 if itemA appears before itemB in the source file, greater than 1 if
* itemA appears after itemB in the source file, or 0 if itemA and itemB have the same location.
*/
function compareLocations(itemA, itemB) {
	return itemA.line - itemB.line || itemA.column - itemB.column;
}
//#endregion
exports.default = processor_default;
Bfqx'use strict'

/**
 * @typedef {object} RemovedRule
 * @property {string} ruleName
 * @property {string[]} replacedBy
 * @property {string} deprecatedInVersion
 * @property {string} removedInVersion
 */

/** @type {RemovedRule[]} */
module.exports = [
  {
    ruleName: 'component-tags-order',
    replacedBy: ['block-order'],
    deprecatedInVersion: 'v9.16.0',
    removedInVersion: 'v10.0.0'
  },
  {
    ruleName: 'experimental-script-setup-vars',
    replacedBy: [],
    deprecatedInVersion: 'v7.13.0',
    removedInVersion: 'v9.0.0'
  },
  {
    ruleName: 'name-property-casing',
    replacedBy: ['component-definition-name-casing'],
    deprecatedInVersion: 'v7.0.0',
    removedInVersion: 'v9.0.0'
  },
  {
    ruleName: 'no-confusing-v-for-v-if',
    replacedBy: ['no-use-v-if-with-v-for'],
    deprecatedInVersion: 'v5.0.0',
    removedInVersion: 'v9.0.0'
  },
  {
    ruleName: 'no-invalid-model-keys',
    replacedBy: ['valid-model-definition'],
    deprecatedInVersion: 'v9.0.0',
    removedInVersion: 'v10.0.0'
  },
  {
    ruleName: 'no-ref-object-destructure',
    replacedBy: ['no-ref-object-reactivity-loss'],
    deprecatedInVersion: 'v9.17.0',
    removedInVersion: 'v10.0.0'
  },
  {
    ruleName: 'no-setup-props-destructure',
    replacedBy: ['no-setup-props-reactivity-loss'],
    deprecatedInVersion: 'v9.17.0',
    removedInVersion: 'v10.0.0'
  },
  {
    ruleName: 'no-unregistered-components',
    replacedBy: ['no-undef-components'],
    deprecatedInVersion: 'v8.4.0',
    removedInVersion: 'v9.0.0'
  },
  {
    ruleName: 'script-setup-uses-vars',
    replacedBy: [],
    deprecatedInVersion: 'v9.0.0',
    removedInVersion: 'v10.0.0'
  },
  {
    ruleName: 'v-on-function-call',
    replacedBy: ['v-on-handler-style'],
    deprecatedInVersion: 'v9.7.0',
    removedInVersion: 'v10.0.0'
  }
]
;xh3100644 array-bracket-newline.js &<.XѴ^rWn100644 array-bracket-spacing.js iDitѠe100644 array-element-newline.js 1,"-T42 100644 arrow-spacing.js 9wR~DьF100644 attribute-hyphenation.js `F_i{*g՚Ȼ章弬100644 attributes-order.js `{rzYo100644 block-lang.js ؔSP(M100644 block-order.js Zd}}F+A#$
0p#v100644 block-spacing.js [T;F_ݢ1100644 block-tag-newline.js 0mLc?IRu?100644 brace-style.js 5Y5`#"r&o11V100644 camelcase.js }j͓%
\n100644 comma-dangle.js |nu
,SLlu100644 comma-spacing.js kj 8% '>W;100644 comma-style.js abhxǡ8K c'ng7100644 comment-directive.js g kD$1'100644 component-api-style.js =.xttc.R100644 component-definition-name-casing.js N
|p6100644 component-name-in-template-casing.js f5{:df [100644 component-options-name-casing.js 5|t100644 custom-event-name-casing.js {^Z0k}QCv100644 define-emits-declaration.js 3<Fnqz@4~߈100644 define-macros-order.js ,Zо3uol100644 define-props-declaration.js "ii/EKUzڲ`̭100644 define-props-destructuring.js 4_J:?100644 dot-location.js ޾[xؐř5100644 dot-notation.js |ޏ}އα)100644 enforce-style-attribute.js .>RMߵ[_bC100644 eqeqeq.js /Y/	G=G:>100644 first-attribute-linebreak.js J@R_$;100644 func-call-spacing.js 5̾.dX3~;^100644 html-button-has-type.js ВS܄~9a@6100644 html-closing-bracket-newline.js %K&FȽmEu
2k100644 html-closing-bracket-spacing.js 9`y`Eee100644 html-comment-content-newline.js |LR#UJ&-100644 html-comment-content-spacing.js `()AeFa|	8100644 html-comment-indent.js sj4n$!100644 html-end-tags.js ua-Dh٨uo100644 html-indent.js >W.jle;100644 html-quotes.js ~&<1ɯo100644 html-self-closing.js EC/PK\100644 jsx-uses-vars.js _P(KNg100644 key-spacing.js 0ʊB(Ѧ"2rU100644 keyword-spacing.js 62Nz:? 100644 match-component-file-name.js ":>=Rj9Z|100644 match-component-import-name.js {,p!Nm] Ô100644 max-attributes-per-line.js wDԻmhO100644 max-len.js 7,RVm1S6W	100644 max-lines-per-block.js Ri'gĺ100644 max-props.js &PrT6e"R8100644 max-template-depth.js d2 &yT}100644 multi-word-component-names.js 0P ]>zJ0b%"\100644 multiline-html-element-content-newline.js O+g,UZ100644 multiline-ternary.js 0AR3l)100644 mustache-interpolation-spacing.js ]ٜ7
啄100644 new-line-between-multi-line-property.js tJdmgD\100644 next-tick-style.js 
zNhAV100644 no-arrow-functions-in-watch.js I(25Zp(;ID100644 no-async-in-computed-properties.js {ߣreL9G100644 no-bare-strings-in-template.js Ӟ\xօoZc=100644 no-boolean-default.js +ǯUr Qur
100644 no-child-content.js ﯨ)ye$& W%100644 no-computed-properties-in-data.js S2м*&sݬ	qS100644 no-console.js PE2W1100644 no-constant-condition.js :A)Pj̆100644 no-custom-modifiers-on-v-model.js |' R۸ג3q100644 no-deprecated-data-object-declaration.js X ~CI׏,zSWH-100644 no-deprecated-delete-set.js 461bECܘ;)100644 no-deprecated-destroyed-lifecycle.js JÏnc}b1ز6100644 no-deprecated-dollar-listeners-api.js bS+zRMC wnC100644 no-deprecated-dollar-scopedslots-api.js e]omBS= URt7~100644 no-deprecated-events-api.js ئ&I&\_100644 no-deprecated-filter.js 6BC>d$%;100644 no-deprecated-functional-template.js 	GFBJW5٣=A'100644 no-deprecated-html-element-is.js cHB&.b	x100644 no-deprecated-inline-template.js  HSj;N>Ѣ$B100644 no-deprecated-model-definition.js &|Ak̲\ 100644 no-deprecated-props-default-this.js r%HPݪ@{_100644 no-deprecated-router-link-tag-prop.js |UBDыOKx100644 no-deprecated-scope-attribute.js f8%G$,V>8100644 no-deprecated-slot-attribute.js ;`҇sGZ100644 no-deprecated-slot-scope-attribute.js +V,VdtdC*100644 no-deprecated-v-bind-sync.js q ^pCp100644 no-deprecated-v-is.js iD0Vp1au5100644 no-deprecated-v-on-native-modifier.js +^>'4lI)w100644 no-deprecated-v-on-number-modifiers.js xd7A%%i100644 no-deprecated-vue-config-keycodes.js ozՑ	O)s100644 no-dupe-keys.js }}GVYUbG}L100644 no-dupe-v-else-if.js 8.cYn1M7!100644 no-duplicate-attr-inheritance.js T|nIȺC+100644 no-duplicate-attributes.js 
uOb)[^ 100644 no-duplicate-class-names.js -P2w%"d100644 no-empty-component-block.js gVyH,}`3졇}100644 no-empty-pattern.js bԧWF	x؀100644 no-export-in-script-setup.js wX%ь-;100644 no-expose-after-await.js I ylwa100644 no-extra-parens.js ܥ+8N'Ҹ{7100644 no-implicit-coercion.js ѐ7'#i|#,0'100644 no-import-compiler-macros.js ٽ#cneP 100644 no-irregular-whitespace.js T$fַ/cS100644 no-lifecycle-after-await.js \A,&AkI100644 no-literals-in-template.js - ܸeEd100644 no-lone-template.js 29ղXNk1100644 no-loss-of-precision.js 8'NOStȢ'100644 no-multi-spaces.js f5eq-g,W01F100644 no-multiple-objects-in-class.js S@ƀJjI,100644 no-multiple-slot-args.js #k?@!AHBB100644 no-multiple-template-root.js \!DV70R100644 no-mutating-props.js ԭ3=Psg2ǁ[Z100644 no-negated-condition.js vW>D/4F_g{s/100644 no-negated-v-if-condition.js YZwua,=ai,100644 no-parsing-error.js q)PdJ{s&9PV100644 no-potential-component-option-typo.js y+u[!qd/ M?100644 no-ref-as-operand.js %Ly100644 no-ref-object-reactivity-loss.js @M:>100644 no-required-prop-with-default.js Bu5	dpv=d100644 no-reserved-component-names.js )
E1100644 no-reserved-keys.js F]lAgᏝL100644 no-reserved-props.js 7^ɻwuup'100644 no-restricted-block.js UA@D7>Cu100644 no-restricted-call-after-await.js  [@im Lj100644 no-restricted-class.js 0DRo9(\M100644 no-restricted-component-names.js 3E{z{S`m31*T100644 no-restricted-component-options.js D8^%"zF100644 no-restricted-custom-event.js 	lߏWRfO&nB100644 no-restricted-html-elements.js U-:Z.B$4Th100644 no-restricted-props.js Fmr>"?[6i[100644 no-restricted-static-attribute.js hη$n2qfu100644 no-restricted-syntax.js .	#ǤGuh,100644 no-restricted-v-bind.js xIxfI`03100644 no-restricted-v-on.js +Y
JWq
b100644 no-root-v-if.js  E16H100644 no-setup-props-reactivity-loss.js i/1v㨉100644 no-shared-component-data.js j9V/PgȞ\fxKv7100644 no-side-effects-in-computed-properties.js k0{u_ҰPP^\F100644 no-spaces-around-equal-signs-in-attribute.js .)9#)4F4]@100644 no-sparse-arrays.js ;6G^100644 no-static-inline-styles.js tYuKV%7\x}100644 no-template-key.js !j]5[6\Z100644 no-template-shadow.js |B&19FTyŇ100644 no-template-target-blank.js 4h[┓9=% 100644 no-textarea-mustache.js n{e&b100644 no-this-in-before-route-enter.js kf㞄]R-100644 no-undef-components.js JVːBYO*D100644 no-undef-directives.js ͉J 
K<rr100644 no-undef-properties.js fOp#Icf9άϸ-*/100644 no-unsupported-features.js MD1100644 no-unused-components.js lh^TqC~100644 no-unused-emit-declarations.js {(UW Go_q100644 no-unused-properties.js qxòzd100644 no-unused-refs.js lkMbJlmFG N100644 no-unused-vars.js +|=v蝲dJ M100644 no-use-computed-property-like-method.js (-3|@R100644 no-use-v-else-with-v-for.js ۽F
.:mNZ}ev100644 no-use-v-if-with-v-for.js v:e#	_nt100644 no-useless-concat.js $znh~HZ#y100644 no-useless-mustaches.js g<bԦM@wL\r100644 no-useless-template-attributes.js 9L9m]i>0k}_100644 no-useless-v-bind.js H~J_mF#ڹ^-[100644 no-v-for-template-key-on-child.js KBh؀T100644 no-v-for-template-key.js aɀg&$Sc)100644 no-v-html.js 1GO~\3-|F(100644 no-v-model-argument.js u끁
2Q~5;w100644 no-v-text-v-html-on-component.js xY0Rl	100644 no-v-text.js lz]/O! O"M.100644 no-watch-after-await.js R<u	 |kv100644 object-curly-newline.js /X@|4)100644 object-curly-spacing.js .5-m޽100644 object-property-newline.js nM*;|Kzi- 100644 object-shorthand.js y}AL\Sq(:84!100644 one-component-per-file.js ±|"'j8100644 operator-linebreak.js $54ò100644 order-in-components.js b33/d=Gk,100644 padding-line-between-blocks.js wvGHǆnIJz100644 padding-line-between-tags.js 93mB񂆢H4˰QVs100644 padding-lines-in-component-definition.js o-cLr(A.OI3\100644 prefer-define-options.js ~UyRwdK"ljzK100644 prefer-import-from-vue.js  x#&CTHw$-}100644 prefer-prop-type-boolean-first.js H6$Á100644 prefer-separate-static-class.js Bb_)EWM:100644 prefer-single-event-payload.js lR	I,]q4100644 prefer-template.js :UgW$Ɛr@Y;S100644 prefer-true-attribute-shorthand.js :PPLlJ U100644 prefer-use-template-ref.js !;Ұ5[l-f100644 prefer-v-model.js fUkT^@u100644 prop-name-casing.js uHAYiPfQ100644 quote-props.js oPy6Y^	>- 100644 require-component-is.js ߂D`-l$K'Ik;100644 require-default-export.js KMc{!o[; 100644 require-default-prop.js &R}y"v#100644 require-direct-export.js ڟiUp]*K|kH100644 require-emit-validator.js .EgZ-'	100644 require-explicit-emits.js p׆î1llpv100644 require-explicit-slots.js U or7a][3:jo100644 require-expose.js fM9bҠ:Ὁ100644 require-macro-variable-name.js C5&NAsϞݿki100644 require-name-property.js _p#-fxW7100644 require-prop-comment.js oQ ٻו	O	100644 require-prop-type-constructor.js [uğR G92tPV100644 require-prop-types.js k/cuf0l%ϐ100644 require-render-return.js ˅?M9U100644 require-slots-as-functions.js DdlMI100644 require-toggle-inside-transition.js 
bB@#6100644 require-typed-object-prop.js ȪؐE(Լ0\Us.'N100644 require-typed-ref.js ԙI%}Br0"I<100644 require-v-for-key.js H/|B&!100644 require-valid-default-prop.js , k`qsŝK0100644 restricted-component-names.js Vj7e~˛1$aEL100644 return-in-computed-property.js KPS@<[cǗv100644 return-in-emits-validator.js gC⤢ 100644 script-indent.js {&
^=i/pͷy3&100644 singleline-html-element-content-newline.js K!RXPↂJ\100644 slot-name-casing.js ׃DeL100644 sort-keys.js 5QgeSkx:з100644 space-in-parens.js vB|xg}\ǈ4100644 space-infix-ops.js SZ8iGTH݂100644 space-unary-ops.js 6SY#@[#ܻ100644 static-class-names-order.js L_#fW40000 syntaxes |6}w{\100644 template-curly-spacing.js #qNzKue!9100644 this-in-template.js WhC9èd@100644 use-v-on-exact.js (uYsc100644 v-bind-style.js hd5-100644 v-for-delimiter-style.js a2{*8`i_TꍻH&100644 v-if-else-key.js  
w=Ua&F100644 v-on-event-hyphenation.js -DzxEg|/f100644 v-on-handler-style.js 
vD
q;"100644 v-on-style.js >qq^	T100644 v-slot-style.js 2 (ݣ<)E100644 valid-attribute-name.js ًbYsѵz$EO100644 valid-define-emits.js g#zAq
!\X4%3X100644 valid-define-options.js x]#]Kg@
100644 valid-define-props.js pyV&KhX*W100644 valid-model-definition.js 8uEo>100644 valid-next-tick.js v~yͅG$W^100644 valid-template-root.js sa4ԁu100644 valid-v-bind-sync.js Pʝ%IPYͥE#;100644 valid-v-bind.js 	>x
0>!o}}P100644 valid-v-cloak.js @[E&^X)H;71100644 valid-v-else-if.js zμ
@Fw&100644 valid-v-else.js Kq~t˺100644 valid-v-for.js `A[M100644 valid-v-html.js &fj$hW5\v100644 valid-v-if.js / iߩZn>|100644 valid-v-is.js ˍ@)9e!100644 valid-v-memo.js ~kLP
Ikb%q100644 valid-v-model.js \SED4bT,100644 valid-v-on.js X1i*O%(=KU100644 valid-v-once.js '9>NO^100644 valid-v-pre.js !i߬]"+'*100644 valid-v-show.js gc@<7_$9=X100644 valid-v-slot.js {G-i0M'jz100644 valid-v-text.js Nwꝉ*x3՜p|boxF"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/html-closing-bracket-newline.js
/**
* @author Toru Nagashima
* @copyright 2016 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_html_closing_bracket_newline = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @param {number} lineBreaks
	*/
	function getPhrase(lineBreaks) {
		switch (lineBreaks) {
			case 0: return "no line breaks";
			case 1: return "1 line break";
			default: return `${lineBreaks} line breaks`;
		}
	}
	/**
	* @typedef LineBreakBehavior
	* @type {('always'|'never')}
	*/
	/**
	* @typedef LineType
	* @type {('singleline'|'multiline')}
	*/
	/**
	* @typedef RuleOptions
	* @type {object}
	* @property {LineBreakBehavior} singleline - The behavior for single line tags.
	* @property {LineBreakBehavior} multiline - The behavior for multiline tags.
	* @property {object} selfClosingTag
	* @property {LineBreakBehavior} selfClosingTag.singleline - The behavior for single line self closing tags.
	* @property {LineBreakBehavior} selfClosingTag.multiline - The behavior for multiline self closing tags.
	*/
	/**
	* @param {VStartTag | VEndTag} node - The node representing a start or end tag.
	* @param {RuleOptions} options - The options for line breaks.
	* @param {LineType} type - The type of line break.
	* @returns {number} - The expected line breaks.
	*/
	function getExpectedLineBreaks(node, options, type) {
		if (node.type === "VStartTag" && node.selfClosing && options.selfClosingTag && options.selfClosingTag[type]) return options.selfClosingTag[type] === "always" ? 1 : 0;
		return options[type] === "always" ? 1 : 0;
	}
	module.exports = {
		meta: {
			type: "layout",
			docs: {
				description: "require or disallow a line break before tag's closing brackets",
				categories: ["vue3-strongly-recommended", "vue2-strongly-recommended"],
				url: "https://eslint.vuejs.org/rules/html-closing-bracket-newline.html"
			},
			fixable: "whitespace",
			schema: [{
				type: "object",
				properties: {
					singleline: { enum: ["always", "never"] },
					multiline: { enum: ["always", "never"] },
					selfClosingTag: {
						type: "object",
						properties: {
							singleline: { enum: ["always", "never"] },
							multiline: { enum: ["always", "never"] }
						},
						additionalProperties: false,
						minProperties: 1
					}
				},
				additionalProperties: false
			}],
			messages: { expectedBeforeClosingBracket: "Expected {{expected}} before closing bracket, but {{actual}} found." }
		},
		/** @param {RuleContext} context */
		create(context) {
			const options = Object.assign({}, {
				singleline: "never",
				multiline: "always"
			}, context.options[0] || {});
			const sourceCode = context.sourceCode;
			const template = sourceCode.parserServices.getTemplateBodyTokenStore && sourceCode.parserServices.getTemplateBodyTokenStore();
			return utils.defineDocumentVisitor(context, { 
			/** @param {VStartTag | VEndTag} node */
"VStartTag, VEndTag"(node) {
				const closingBracketToken = template.getLastToken(node);
				if (closingBracketToken.type !== "HTMLSelfClosingTagClose" && closingBracketToken.type !== "HTMLTagClose") return;
				const prevToken = template.getTokenBefore(closingBracketToken);
				const type = node.loc.start.line === prevToken.loc.end.line ? "singleline" : "multiline";
				const expectedLineBreaks = getExpectedLineBreaks(node, options, type);
				const actualLineBreaks = closingBracketToken.loc.start.line - prevToken.loc.end.line;
				if (actualLineBreaks !== expectedLineBreaks) context.report({
					node,
					loc: {
						start: prevToken.loc.end,
						end: closingBracketToken.loc.start
					},
					messageId: "expectedBeforeClosingBracket",
					data: {
						expected: getPhrase(expectedLineBreaks),
						actual: getPhrase(actualLineBreaks)
					},
					fix(fixer) {
						/** @type {Range} */
						const range = [prevToken.range[1], closingBracketToken.range[0]];
						const text = "\n".repeat(expectedLineBreaks);
						return fixer.replaceTextRange(range, text);
					}
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_html_closing_bracket_newline();
	}
});
AxTx %"array"Yosuke Ota
*/
var require_arraya`{ wrapStylisticOrCoreRule } = require_index.default;
	module.exports = wrapStylisticOrCoreRule("array-bracket-newline", { skipDynamicArguments: true })warray+Pxw"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/html-closing-bracket-spacing.js
/**
* @author Toru Nagashima <https://github.com/mysticatea>
*/
var require_html_closing_bracket_spacing = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef { {startTag?:"always"|"never",endTag?:"always"|"never",selfClosingTag?:"always"|"never"} } Options
	*/
	/**
	* Normalize options.
	* @param {Options} options The options user configured.
	* @param {ParserServices.TokenStore} tokens The token store of template body.
	* @returns {Options & { detectType: (node: VStartTag | VEndTag) => 'never' | 'always' | null }} The normalized options.
	*/
	function parseOptions(options, tokens) {
		const opts = Object.assign({
			startTag: "never",
			endTag: "never",
			selfClosingTag: "always"
		}, options);
		return Object.assign(opts, { 
		/**
		* @param {VStartTag | VEndTag} node
		* @returns {'never' | 'always' | null}
		*/
detectType(node) {
			const openType = tokens.getFirstToken(node).type;
			const closeType = tokens.getLastToken(node).type;
			if (openType === "HTMLEndTagOpen" && closeType === "HTMLTagClose") return opts.endTag;
			if (openType === "HTMLTagOpen" && closeType === "HTMLTagClose") return opts.startTag;
			if (openType === "HTMLTagOpen" && closeType === "HTMLSelfClosingTagClose") return opts.selfClosingTag;
			return null;
		} });
	}
	module.exports = {
		meta: {
			type: "layout",
			docs: {
				description: "require or disallow a space before tag's closing brackets",
				categories: ["vue3-strongly-recommended", "vue2-strongly-recommended"],
				url: "https://eslint.vuejs.org/rules/html-closing-bracket-spacing.html"
			},
			fixable: "whitespace",
			schema: [{
				type: "object",
				properties: {
					startTag: { enum: ["always", "never"] },
					endTag: { enum: ["always", "never"] },
					selfClosingTag: { enum: ["always", "never"] }
				},
				additionalProperties: false
			}],
			messages: {
				missing: "Expected a space before '{{bracket}}', but not found.",
				unexpected: "Expected no space before '{{bracket}}', but found."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const sourceCode = context.sourceCode;
			const tokens = sourceCode.parserServices.getTemplateBodyTokenStore && sourceCode.parserServices.getTemplateBodyTokenStore();
			const options = parseOptions(context.options[0], tokens);
			return utils.defineDocumentVisitor(context, { 
			/** @param {VStartTag | VEndTag} node */
"VStartTag, VEndTag"(node) {
				const type = options.detectType(node);
				const lastToken = tokens.getLastToken(node);
				const prevToken = tokens.getLastToken(node, 1);
				if (type == null || prevToken == null || prevToken.loc.end.line !== lastToken.loc.start.line) return;
				const hasSpace = prevToken.range[1] !== lastToken.range[0];
				if (type === "always" && !hasSpace) context.report({
					node,
					loc: lastToken.loc,
					messageId: "missing",
					data: { bracket: sourceCode.getText(lastToken) },
					fix: (fixer) => fixer.insertTextBefore(lastToken, " ")
				});
				else if (type === "never" && hasSpace) context.report({
					node,
					loc: {
						start: prevToken.loc.end,
						end: lastToken.loc.end
					},
					messageId: "unexpected",
					data: { bracket: sourceCode.getText(lastToken) },
					fix: (fixer) => fixer.removeRange([prevToken.range[1], lastToken.range[0]])
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_html_closing_bracket_spacing();
	}
});
Пx /array0
*/
var require_array`{ wrapStylisticOrCoreRule } = require_index.default;
	module.exports = wrapStylisticOrCoreRule("array-bracket-spacing", { skipDynamicArguments: true })warraymyLݼ&xl"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/array-element-newline.js
/**
* @author alshyra
*/
var require_array_element_newline = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapStylisticOrCoreRule } = require_index.default;
	module.exports = wrapStylisticOrCoreRule("array-element-newline", { skipDynamicArguments: true });
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_array_element_newline();
	}
});
:<"x/"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/arrow-spacing.js
/**
* @author Yosuke Ota
*/
var require_arrow_spacing = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapStylisticOrCoreRule } = require_index.default;
	module.exports = wrapStylisticOrCoreRule("arrow-spacing");
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_arrow_spacing();
	}
});
t~xxCconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
const require_regexp = require("../utils/regexp.js");
//#region lib/rules/v-on-event-hyphenation.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
var v_on_event_hyphenation_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "enforce v-on event naming style on custom components in template",
			categories: ["vue3-strongly-recommended"],
			url: "https://eslint.vuejs.org/rules/v-on-event-hyphenation.html",
			defaultOptions: { vue3: ["always", { autofix: true }] }
		},
		fixable: "code",
		schema: [{ enum: ["always", "never"] }, {
			type: "object",
			properties: {
				autofix: { type: "boolean" },
				ignore: {
					type: "array",
					items: { allOf: [
						{ type: "string" },
						{ not: {
							type: "string",
							pattern: ":exit$"
						} },
						{ not: {
							type: "string",
							pattern: String.raw`^\s*$`
						} }
					] },
					uniqueItems: true,
					additionalItems: false
				},
				ignoreTags: {
					type: "array",
					items: { type: "string" },
					uniqueItems: true,
					additionalItems: false
				}
			},
			additionalProperties: false
		}],
		messages: {
			mustBeHyphenated: "v-on event '{{text}}' must be hyphenated.",
			cannotBeHyphenated: "v-on event '{{text}}' can't be hyphenated."
		}
	},
	create(context) {
		const sourceCode = context.sourceCode;
		const option = context.options[0];
		const optionsPayload = context.options[1];
		const shouldUseHyphenated = option !== "never";
		const ignoredAttributes = optionsPayload && optionsPayload.ignore || [];
		const isIgnoredTag = require_regexp.toRegExpGroupMatcher(optionsPayload?.ignoreTags);
		const shouldAutofix = Boolean(optionsPayload && optionsPayload.autofix);
		const caseConverter = require_casing.getConverter(shouldUseHyphenated ? "kebab-case" : "camelCase");
		function reportIssue(node, argument, name) {
			const text = sourceCode.getText(node.key);
			context.report({
				node: node.key,
				loc: node.loc,
				messageId: shouldUseHyphenated ? "mustBeHyphenated" : "cannotBeHyphenated",
				data: { text },
				fix: shouldAutofix && !name.includes("_") ? (fixer) => fixer.replaceText(argument, caseConverter(name)) : null
			});
		}
		function isIgnoredAttribute(value) {
			if (ignoredAttributes.some((attr) => value.includes(attr))) return true;
			return shouldUseHyphenated ? value.toLowerCase() === value : !/-/.test(value);
		}
		return import_utils.default.defineTemplateBodyVisitor(context, { "VAttribute[directive=true][key.name.name='on']"(node) {
			const element = node.parent.parent;
			if (!import_utils.default.isCustomComponent(element) || isIgnoredTag(element.rawName)) return;
			if (!node.key.argument || node.key.argument.type !== "VIdentifier") return;
			const name = node.key.argument.rawName;
			if (!name || isIgnoredAttribute(name)) return;
			reportIssue(node, node.key.argument, name);
		} });
	}
};
//#endregion
exports.default = v_on_event_hyphenation_default;
AQxUconst require_svg_attributes_weird_case = require("../utils/svg-attributes-weird-case	attributecfunction getAttributeName(node) {
	if (!node.directive) return node.key.rawName;
	if ((node.key.name.name === "bind" || node.keIy.name.name === "model") && node.key.argument && node.key.argument.type =Pyreturn null;
}
var attributet[	attribute\, "vue2Aattribute-hyphenation.html"mG	AttributeP:	AttributesIgnoredTagNameLe[
			"data-",
			"aria-",
			"slot-scope",
			...require_svg_attributes_weird_case.default
		];
		if @"7ignore) ignoredAttributes.push(...optionsPayload.ignorei-Exac[(fixer) => {
					if (text.includes("_")) return null;
					if (text.endsWith(".sync")) return null;
					if (/^[A-Z]/.test(namne)) return null;
					return fixer.replaceText(node.key, text.replace(name, () => caseConverter(name)));
				}A	
VAttribute
h.&& element.name !== "slot" || isIgnoredTagNamem,getAttributeName(node);
			if (name === null<3attribute_hyphenation_default;
?axt-"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/attributes-order.js
/**
* @fileoverview enforce ordering of attributes
* @author Erin Depew
*/
var require_attributes_order = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef { VDirective & { key: VDirectiveKey & { name: VIdentifier & { name: 'bind' } } } } VBindDirective
	*/
	const ATTRS = {
		DEFINITION: "DEFINITION",
		LIST_RENDERING: "LIST_RENDERING",
		CONDITIONALS: "CONDITIONALS",
		RENDER_MODIFIERS: "RENDER_MODIFIERS",
		GLOBAL: "GLOBAL",
		UNIQUE: "UNIQUE",
		SLOT: "SLOT",
		TWO_WAY_BINDING: "TWO_WAY_BINDING",
		OTHER_DIRECTIVES: "OTHER_DIRECTIVES",
		OTHER_ATTR: "OTHER_ATTR",
		ATTR_STATIC: "ATTR_STATIC",
		ATTR_DYNAMIC: "ATTR_DYNAMIC",
		ATTR_SHORTHAND_BOOL: "ATTR_SHORTHAND_BOOL",
		EVENTS: "EVENTS",
		CONTENT: "CONTENT"
	};
	/**
	* Check whether the given attribute is `v-bind` directive.
	* @param {VAttribute | VDirective | undefined | null} node
	* @returns { node is VBindDirective }
	*/
	function isVBind(node) {
		return Boolean(node && node.directive && node.key.name.name === "bind");
	}
	/**
	* Check whether the given attribute is `v-model` directive.
	* @param {VAttribute | VDirective | undefined | null} node
	* @returns { node is VDirective }
	*/
	function isVModel(node) {
		return Boolean(node && node.directive && node.key.name.name === "model");
	}
	/**
	* Check whether the given attribute is plain attribute.
	* @param {VAttribute | VDirective | undefined | null} node
	* @returns { node is VAttribute }
	*/
	function isVAttribute(node) {
		return Boolean(node && !node.directive);
	}
	/**
	* Check whether the given attribute is plain attribute, `v-bind` directive or `v-model` directive.
	* @param {VAttribute | VDirective | undefined | null} node
	* @returns { node is VAttribute }
	*/
	function isVAttributeOrVBindOrVModel(node) {
		return isVAttribute(node) || isVBind(node) || isVModel(node);
	}
	/**
	* Check whether the given attribute is `v-bind="..."` directive.
	* @param {VAttribute | VDirective | undefined | null} node
	* @returns { node is VBindDirective }
	*/
	function isVBindObject(node) {
		return isVBind(node) && node.key.argument == null;
	}
	/**
	* Check whether the given attribute is a shorthand boolean like `selected`.
	* @param {VAttribute | VDirective | undefined | null} node
	* @returns { node is VAttribute }
	*/
	function isVShorthandBoolean(node) {
		return isVAttribute(node) && !node.value;
	}
	/**
	* @param {VAttribute | VDirective} attribute
	* @param {SourceCode} sourceCode
	*/
	function getAttributeName(attribute, sourceCode) {
		if (attribute.directive) {
			if (isVBind(attribute)) return attribute.key.argument ? sourceCode.getText(attribute.key.argument) : "";
			return getDirectiveKeyName(attribute.key, sourceCode);
		}
		return attribute.key.name;
	}
	/**
	* @param {VDirectiveKey} directiveKey
	* @param {SourceCode} sourceCode
	*/
	function getDirectiveKeyName(directiveKey, sourceCode) {
		let text = `v-${directiveKey.name.name}`;
		if (directiveKey.argument) text += `:${sourceCode.getText(directiveKey.argument)}`;
		for (const modifier of directiveKey.modifiers) text += `.${modifier.name}`;
		return text;
	}
	/**
	* @param {VAttribute | VDirective} attribute
	*/
	function getAttributeType(attribute) {
		let propName;
		if (attribute.directive) {
			if (!isVBind(attribute)) switch (attribute.key.name.name) {
				case "for": return ATTRS.LIST_RENDERING;
				case "if":
				case "else-if":
				case "else":
				case "show":
				case "cloak": return ATTRS.CONDITIONALS;
				case "pre":
				case "once": return ATTRS.RENDER_MODIFIERS;
				case "model": return ATTRS.TWO_WAY_BINDING;
				case "on": return ATTRS.EVENTS;
				case "html":
				case "text": return ATTRS.CONTENT;
				case "slot": return ATTRS.SLOT;
				case "is": return ATTRS.DEFINITION;
				default: return ATTRS.OTHER_DIRECTIVES;
			}
			propName = attribute.key.argument && attribute.key.argument.type === "VIdentifier" ? attribute.key.argument.rawName : "";
		} else propName = attribute.key.name;
		switch (propName) {
			case "is": return ATTRS.DEFINITION;
			case "id": return ATTRS.GLOBAL;
			case "ref":
			case "key": return ATTRS.UNIQUE;
			case "slot":
			case "slot-scope": return ATTRS.SLOT;
			default:
				if (isVBind(attribute)) return ATTRS.ATTR_DYNAMIC;
				if (isVShorthandBoolean(attribute)) return ATTRS.ATTR_SHORTHAND_BOOL;
				return ATTRS.ATTR_STATIC;
		}
	}
	/**
	* @param {VAttribute | VDirective} attribute
	* @param { { [key: string]: number } } attributePosition
	* @returns {number | null} If the value is null, the order is omitted. Do not force the order.
	*/
	function getPosition(attribute, attributePosition) {
		return attributePosition[getAttributeType(attribute)] ?? null;
	}
	/**
	* @param {VAttribute | VDirective} prevNode
	* @param {VAttribute | VDirective} currNode
	* @param {SourceCode} sourceCode
	*/
	function isAlphabetical(prevNode, currNode, sourceCode) {
		const prevName = getAttributeName(prevNode, sourceCode);
		const currName = getAttributeName(currNode, sourceCode);
		if (prevName === currName) return isVBind(prevNode) <= isVBind(currNode);
		return prevName < currName;
	}
	/**
	* @param {RuleContext} context - The rule context.
	* @returns {RuleListener} AST event handlers.
	*/
	function create(context) {
		const sourceCode = context.sourceCode;
		const otherAttrs = [
			ATTRS.ATTR_DYNAMIC,
			ATTRS.ATTR_STATIC,
			ATTRS.ATTR_SHORTHAND_BOOL
		];
		let attributeOrder = [
			ATTRS.DEFINITION,
			ATTRS.LIST_RENDERING,
			ATTRS.CONDITIONALS,
			ATTRS.RENDER_MODIFIERS,
			ATTRS.GLOBAL,
			[ATTRS.UNIQUE, ATTRS.SLOT],
			ATTRS.TWO_WAY_BINDING,
			ATTRS.OTHER_DIRECTIVES,
			otherAttrs,
			ATTRS.EVENTS,
			ATTRS.CONTENT
		];
		if (context.options[0] && context.options[0].order) {
			attributeOrder = [...context.options[0].order];
			for (const item of attributeOrder.flat()) if (item === ATTRS.OTHER_ATTR) {
				for (const attribute of attributeOrder.flat()) if (otherAttrs.includes(attribute)) throw new Error(`Value "${ATTRS.OTHER_ATTR}" is not allowed with "${attribute}".`);
			}
			for (const [index, item] of attributeOrder.entries()) if (item === ATTRS.OTHER_ATTR) attributeOrder[index] = otherAttrs;
			else if (Array.isArray(item) && item.includes(ATTRS.OTHER_ATTR)) {
				const attributes = item.filter((i) => i !== ATTRS.OTHER_ATTR);
				attributes.push(...otherAttrs);
				attributeOrder[index] = attributes;
			}
		}
		const shouldSortAlphabetical = Boolean(context.options[0] && context.options[0].alphabetical);
		const shouldSortLineLength = Boolean(context.options[0] && context.options[0].sortLineLength);
		const shouldIgnoreVBindObject = Boolean(context.options[0] && context.options[0].ignoreVBindObject);
		/** @type { { [key: string]: number } } */
		const attributePosition = {};
		for (const [i, item] of attributeOrder.entries()) if (Array.isArray(item)) for (const attr of item) attributePosition[attr] = i;
		else attributePosition[item] = i;
		/**
		* @param {VAttribute | VDirective} node
		* @param {VAttribute | VDirective} previousNode
		*/
		function reportIssue(node, previousNode) {
			const currentNode = sourceCode.getText(node.key);
			const prevNode = sourceCode.getText(previousNode.key);
			context.report({
				node,
				messageId: "expectedOrder",
				data: {
					currentNode,
					prevNode
				},
				fix(fixer) {
					const attributes = node.parent.attributes;
					/** @type { (node: VAttribute | VDirective | undefined) => boolean } */
					let isMoveUp;
					if (isVBindObject(node)) isMoveUp = isVAttributeOrVBindOrVModel;
					else if (isVAttributeOrVBindOrVModel(node)) isMoveUp = isVBindObject;
					else isMoveUp = () => false;
					const previousNodes = attributes.slice(attributes.indexOf(previousNode), attributes.indexOf(node));
					const moveNodes = [node];
					for (const node of previousNodes) if (isMoveUp(node)) moveNodes.unshift(node);
					else moveNodes.push(node);
					return moveNodes.map((moveNode, index) => {
						const text = sourceCode.getText(moveNode);
						return fixer.replaceText(previousNodes[index] || node, text);
					});
				}
			});
		}
		return utils.defineTemplateBodyVisitor(context, { VStartTag(node) {
			const attributeAndPositions = getAttributeAndPositionList(node);
			if (attributeAndPositions.length <= 1) return;
			let { attr: previousNode, position: previousPosition } = attributeAndPositions[0];
			for (let index = 1; index < attributeAndPositions.length; index++) {
				const { attr, position } = attributeAndPositions[index];
				let isValid = previousPosition <= position;
				if (isValid && previousPosition === position) {
					let isSortedByLength = false;
					if (shouldSortLineLength) {
						const prevText = sourceCode.getText(previousNode);
						const currText = sourceCode.getText(attr);
						if (prevText.length !== currText.length) {
							isValid = prevText.length < currText.length;
							isSortedByLength = true;
						}
					}
					if (shouldSortAlphabetical && !isSortedByLength) isValid = isAlphabetical(previousNode, attr, sourceCode);
				}
				if (isValid) {
					previousNode = attr;
					previousPosition = position;
				} else reportIssue(attr, previousNode);
			}
		} });
		/**
		* @param {VStartTag} node
		* @returns { { attr: ( VAttribute | VDirective ), position: number }[] }
		*/
		function getAttributeAndPositionList(node) {
			const attributes = node.attributes.filter((node, index, attributes) => {
				if (shouldIgnoreVBindObject && isVBindObject(node)) return false;
				return !isVBindObject(node) || !isVAttributeOrVBindOrVModel(attributes[index - 1]) && !isVAttributeOrVBindOrVModel(attributes[index + 1]);
			});
			const results = [];
			for (const [index, attr] of attributes.entries()) {
				const position = getPositionFromAttrIndex(index);
				if (position == null) continue;
				results.push({
					attr,
					position
				});
			}
			return results;
			/**
			* @param {number} index
			* @returns {number | null}
			*/
			function getPositionFromAttrIndex(index) {
				const node = attributes[index];
				if (isVBindObject(node)) {
					const len = attributes.length;
					for (let nextIndex = index + 1; nextIndex < len; nextIndex++) {
						const next = attributes[nextIndex];
						if (isVAttributeOrVBindOrVModel(next) && !isVBindObject(next)) return getPositionFromAttrIndex(nextIndex);
					}
				}
				return getPosition(node, attributePosition);
			}
		}
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "enforce order of attributes",
				categories: ["vue3-recommended", "vue2-recommended"],
				url: "https://eslint.vuejs.org/rules/attributes-order.html"
			},
			fixable: "code",
			schema: [{
				type: "object",
				properties: {
					order: {
						type: "array",
						items: { oneOf: [{ enum: Object.values(ATTRS) }, {
							type: "array",
							items: {
								enum: Object.values(ATTRS),
								uniqueItems: true,
								additionalItems: false
							}
						}] },
						uniqueItems: true,
						additionalItems: false
					},
					alphabetical: { type: "boolean" },
					sortLineLength: { type: "boolean" },
					ignoreVBindObject: { type: "boolean" }
				},
				additionalProperties: false
			}],
			messages: { expectedOrder: `Attribute "{{currentNode}}" should go before "{{prevNode}}".` }
		},
		create
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_attributes_order();
	}
});
9
xv"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/block-lang.js
/**
* @fileoverview Disallow use other than available `lang`
* @author Yosuke Ota
*/
var require_block_lang = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef {object} BlockOptions
	* @property {Set<string>} lang
	* @property {boolean} allowNoLang
	*/
	/**
	* @typedef { { [element: string]: BlockOptions | undefined } } Options
	*/
	/**
	* @typedef {object} UserBlockOptions
	* @property {string[] | string} [lang]
	* @property {boolean} [allowNoLang]
	*/
	/**
	* @typedef { { [element: string]: UserBlockOptions | undefined } } UserOptions
	*/
	/**
	* https://vuejs.github.io/vetur/guide/highlighting.html
	* <template lang="html"></template>
	* <style lang="css"></style>
	* <script lang="js"><\/script>
	* <script lang="javascript"><\/script>
	* @type {Record<string, string[] | undefined>}
	*/
	const DEFAULT_LANGUAGES = {
		template: ["html"],
		style: ["css"],
		script: ["js", "javascript"]
	};
	/**
	* @param {NonNullable<BlockOptions['lang']>} lang
	*/
	function getAllowsLangPhrase(lang) {
		const langs = [...lang].map((s) => `'${s}'`);
		switch (langs.length) {
			case 1: return langs[0];
			default: return `${langs.slice(0, -1).join(", ")}, and ${langs.at(-1)}`;
		}
	}
	/**
	* Normalizes a given option.
	* @param {string} blockName The block name.
	* @param {UserBlockOptions} option An option to parse.
	* @returns {BlockOptions} Normalized option.
	*/
	function normalizeOption(blockName, option) {
		/** @type {Set<string>} */
		let lang;
		if (Array.isArray(option.lang)) lang = new Set(option.lang);
		else if (typeof option.lang === "string") lang = /* @__PURE__ */ new Set([option.lang]);
		else lang = /* @__PURE__ */ new Set();
		let hasDefault = false;
		const defaultLanguages = DEFAULT_LANGUAGES[blockName] || [];
		for (const def of defaultLanguages) {
			if (!lang.has(def)) continue;
			lang.delete(def);
			hasDefault = true;
		}
		if (lang.size === 0) return {
			lang,
			allowNoLang: true
		};
		return {
			lang,
			allowNoLang: hasDefault || Boolean(option.allowNoLang)
		};
	}
	/**
	* Normalizes a given options.
	* @param { UserOptions } options An option to parse.
	* @returns {Options} Normalized option.
	*/
	function normalizeOptions(options) {
		if (!options) return {};
		/** @type {Options} */
		const normalized = {};
		for (const [blockName, value] of Object.entries(options)) if (value) normalized[blockName] = normalizeOption(blockName, value);
		return normalized;
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow use other than available `lang`",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/block-lang.html"
			},
			schema: [{
				type: "object",
				patternProperties: { "^(?:\\S+)$": { oneOf: [{
					type: "object",
					properties: {
						lang: { oneOf: [{ type: "string" }, {
							type: "array",
							items: { type: "string" },
							uniqueItems: true,
							additionalItems: false
						}] },
						allowNoLang: { type: "boolean" }
					},
					additionalProperties: false
				}] } },
				minProperties: 1,
				additionalProperties: false
			}],
			messages: {
				expected: "Only {{allows}} can be used for the 'lang' attribute of '<{{tag}}>'.",
				missing: "The 'lang' attribute of '<{{tag}}>' is missing.",
				unexpected: "Do not specify the 'lang' attribute of '<{{tag}}>'.",
				useOrNot: "Only {{allows}} can be used for the 'lang' attribute of '<{{tag}}>'. Or, not specifying the 'lang' attribute is allowed.",
				unexpectedDefault: "Do not explicitly specify the default language for the 'lang' attribute of '<{{tag}}>'."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const options = normalizeOptions(context.options[0] || {
				script: { allowNoLang: true },
				template: { allowNoLang: true },
				style: { allowNoLang: true }
			});
			if (Object.keys(options).length === 0) return {};
			/**
			* @param {VElement} element
			* @returns {void}
			*/
			function verify(element) {
				const tag = element.name;
				const option = options[tag];
				if (!option) return;
				const lang = utils.getAttribute(element, "lang");
				if (lang == null || lang.value == null) {
					if (!option.allowNoLang) context.report({
						node: element.startTag,
						messageId: "missing",
						data: { tag }
					});
					return;
				}
				if (!option.lang.has(lang.value.value)) {
					let messageId;
					if (!option.allowNoLang) messageId = "expected";
					else if (option.lang.size === 0) messageId = (DEFAULT_LANGUAGES[tag] || []).includes(lang.value.value) ? "unexpectedDefault" : "unexpected";
					else messageId = "useOrNot";
					context.report({
						node: lang,
						messageId,
						data: {
							tag,
							allows: getAllowsLangPhrase(option.lang)
						}
					});
				}
			}
			return utils.defineDocumentVisitor(context, { "VDocumentFragment > VElement": verify });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_block_lang();
	}
});
qqzwxconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_selector = require("../utils/selector.js");
//#region lib/rules/block-order.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
const DEFAULT_ORDER = Object.freeze([["script", "template"], "style"]);
function getAttributeString(element) {
	return element.startTag.attributes.map((attribute) => {
		if (attribute.value && attribute.value.type !== "VLiteral") return "";
		return `${attribute.key.name}${attribute.value && attribute.value.value ? `=${attribute.value.value}` : ""}`;
	}).join(" ");
}
var block_order_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "enforce order of component top-level elements",
			categories: ["vue3-recommended", "vue2-recommended"],
			url: "https://eslint.vuejs.org/rules/block-order.html"
		},
		fixable: "code",
		schema: [{
			type: "object",
			properties: { order: {
				type: "array",
				items: { oneOf: [{ type: "string" }, {
					type: "array",
					items: { type: "string" },
					uniqueItems: true
				}] },
				uniqueItems: true,
				additionalItems: false
			} },
			additionalProperties: false
		}],
		messages: { unexpected: "'<{{elementName}}{{elementAttributes}}>' should be above '<{{firstUnorderedName}}{{firstUnorderedAttributes}}>' on line {{line}}." }
	},
	create(context) {
		const orders = [];
		const orderOptions = context.options[0] && context.options[0].order || DEFAULT_ORDER;
		for (const [index, selectorOrSelectors] of orderOptions.entries()) if (Array.isArray(selectorOrSelectors)) for (const selector of selectorOrSelectors) orders.push({
			selectorText: selector,
			selector: require_selector.parseSelector(selector, context),
			index
		});
		else orders.push({
			selectorText: selectorOrSelectors,
			selector: require_selector.parseSelector(selectorOrSelectors, context),
			index
		});
		function getOrderElement(element) {
			return orders.find((o) => o.selector.test(element));
		}
		const sourceCode = context.sourceCode;
		const documentFragment = sourceCode.parserServices.getDocumentFragment && sourceCode.parserServices.getDocumentFragment();
		function getTopLevelHTMLElements() {
			if (documentFragment) return documentFragment.children.filter(import_utils.default.isVElement);
			return [];
		}
		return { Program(node) {
			if (import_utils.default.hasInvalidEOF(node)) return;
			const elements = getTopLevelHTMLElements();
			const elementsWithOrder = elements.flatMap((element) => {
				const order = getOrderElement(element);
				return order ? [{
					order,
					element
				}] : [];
			});
			for (const [index, elementWithOrders] of elementsWithOrder.entries()) {
				const { order: expected, element } = elementWithOrders;
				const firstUnordered = elementsWithOrder.slice(0, index).filter(({ order }) => expected.index < order.index).sort((e1, e2) => e1.order.index - e2.order.index)[0];
				if (firstUnordered) {
					const firstUnorderedAttributes = getAttributeString(firstUnordered.element);
					const elementAttributes = getAttributeString(element);
					context.report({
						node: element,
						loc: element.loc,
						messageId: "unexpected",
						data: {
							elementName: element.name,
							elementAttributes: elementAttributes ? ` ${elementAttributes}` : "",
							firstUnorderedName: firstUnordered.element.name,
							firstUnorderedAttributes: firstUnorderedAttributes ? ` ${firstUnorderedAttributes}` : "",
							line: firstUnordered.element.loc.start.line
						},
						*fix(fixer) {
							const fixedElements = elements.flatMap((it) => {
								if (it === firstUnordered.element) return [element, it];
								if (it === element) return [];
								return [it];
							});
							for (let i = elements.length - 1; i >= 0; i--) if (elements[i] !== fixedElements[i]) yield fixer.replaceTextRange(elements[i].range, sourceCode.text.slice(...fixedElements[i].range));
						}
					});
				}
			}
		} };
	}
};
//#endregion
exports.default = block_order_default;
WuB$xO"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/block-spacing.js
/**
* @author Yosuke Ota
*/
var require_block_spacing = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapStylisticOrCoreRule } = require_index.default;
	module.exports = wrapStylisticOrCoreRule("block-spacing", { skipDynamicArguments: true });
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_block_spacing();
	}
});
ȶx&#"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/block-tag-newline.js
/**
* @fileoverview Enforce line breaks style after opening and before closing block-level tags.
* @author Yosuke Ota
*/
var require_block_tag_newline = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef { 'always' | 'never' | 'consistent' | 'ignore' } OptionType
	* @typedef { { singleline?: OptionType, multiline?: OptionType, maxEmptyLines?: number } } ContentsOptions
	* @typedef { ContentsOptions & { blocks?: { [element: string]: ContentsOptions } } } Options
	* @typedef { Required<ContentsOptions> } ArgsOptions
	*/
	/**
	* @param {string} text Source code as a string.
	* @returns {number}
	*/
	function getLinebreakCount(text) {
		return text.split(/\r\n|[\r\n\u{2028}\u{2029}]/gu).length - 1;
	}
	/**
	* @param {number} lineBreaks
	*/
	function getPhrase(lineBreaks) {
		switch (lineBreaks) {
			case 1: return "1 line break";
			default: return `${lineBreaks} line breaks`;
		}
	}
	const ENUM_OPTIONS = { enum: [
		"always",
		"never",
		"consistent",
		"ignore"
	] };
	module.exports = {
		meta: {
			type: "layout",
			docs: {
				description: "enforce line breaks after opening and before closing block-level tags",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/block-tag-newline.html"
			},
			fixable: "whitespace",
			schema: [{
				type: "object",
				properties: {
					singleline: ENUM_OPTIONS,
					multiline: ENUM_OPTIONS,
					maxEmptyLines: {
						type: "number",
						minimum: 0
					},
					blocks: {
						type: "object",
						patternProperties: { "^(?:\\S+)$": {
							type: "object",
							properties: {
								singleline: ENUM_OPTIONS,
								multiline: ENUM_OPTIONS,
								maxEmptyLines: {
									type: "number",
									minimum: 0
								}
							},
							additionalProperties: false
						} },
						additionalProperties: false
					}
				},
				additionalProperties: false
			}],
			messages: {
				unexpectedOpeningLinebreak: "There should be no line break after '<{{tag}}>'.",
				expectedOpeningLinebreak: "Expected {{expected}} after '<{{tag}}>', but {{actual}} found.",
				expectedClosingLinebreak: "Expected {{expected}}  before '</{{tag}}>', but {{actual}} found.",
				missingOpeningLinebreak: "A line break is required after '<{{tag}}>'.",
				missingClosingLinebreak: "A line break is required before '</{{tag}}>'."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const sourceCode = context.sourceCode;
			const df = sourceCode.parserServices.getDocumentFragment && sourceCode.parserServices.getDocumentFragment();
			if (!df) return {};
			/**
			* @param {VStartTag} startTag
			* @param {string} beforeText
			* @param {number} beforeLinebreakCount
			* @param {'always' | 'never'} beforeOption
			* @param {number} maxEmptyLines
			* @returns {void}
			*/
			function verifyBeforeSpaces(startTag, beforeText, beforeLinebreakCount, beforeOption, maxEmptyLines) {
				if (beforeOption === "always") {
					if (beforeLinebreakCount === 0) context.report({
						loc: {
							start: startTag.loc.end,
							end: startTag.loc.end
						},
						messageId: "missingOpeningLinebreak",
						data: { tag: startTag.parent.name },
						fix(fixer) {
							return fixer.insertTextAfter(startTag, "\n");
						}
					});
					else if (maxEmptyLines < beforeLinebreakCount - 1) context.report({
						loc: {
							start: startTag.loc.end,
							end: sourceCode.getLocFromIndex(startTag.range[1] + beforeText.length)
						},
						messageId: "expectedOpeningLinebreak",
						data: {
							tag: startTag.parent.name,
							expected: getPhrase(maxEmptyLines + 1),
							actual: getPhrase(beforeLinebreakCount)
						},
						fix(fixer) {
							return fixer.replaceTextRange([startTag.range[1], startTag.range[1] + beforeText.length], "\n".repeat(maxEmptyLines + 1));
						}
					});
				} else if (beforeLinebreakCount > 0) context.report({
					loc: {
						start: startTag.loc.end,
						end: sourceCode.getLocFromIndex(startTag.range[1] + beforeText.length)
					},
					messageId: "unexpectedOpeningLinebreak",
					data: { tag: startTag.parent.name },
					fix(fixer) {
						return fixer.removeRange([startTag.range[1], startTag.range[1] + beforeText.length]);
					}
				});
			}
			/**
			* @param {VEndTag} endTag
			* @param {string} afterText
			* @param {number} afterLinebreakCount
			* @param {'always' | 'never'} afterOption
			* @param {number} maxEmptyLines
			* @returns {void}
			*/
			function verifyAfterSpaces(endTag, afterText, afterLinebreakCount, afterOption, maxEmptyLines) {
				if (afterOption === "always") {
					if (afterLinebreakCount === 0) context.report({
						loc: {
							start: endTag.loc.start,
							end: endTag.loc.start
						},
						messageId: "missingClosingLinebreak",
						data: { tag: endTag.parent.name },
						fix(fixer) {
							return fixer.insertTextBefore(endTag, "\n");
						}
					});
					else if (maxEmptyLines < afterLinebreakCount - 1) context.report({
						loc: {
							start: sourceCode.getLocFromIndex(endTag.range[0] - afterText.length),
							end: endTag.loc.start
						},
						messageId: "expectedClosingLinebreak",
						data: {
							tag: endTag.parent.name,
							expected: getPhrase(maxEmptyLines + 1),
							actual: getPhrase(afterLinebreakCount)
						},
						fix(fixer) {
							return fixer.replaceTextRange([endTag.range[0] - afterText.length, endTag.range[0]], "\n".repeat(maxEmptyLines + 1));
						}
					});
				} else if (afterLinebreakCount > 0) context.report({
					loc: {
						start: sourceCode.getLocFromIndex(endTag.range[0] - afterText.length),
						end: endTag.loc.start
					},
					messageId: "unexpectedOpeningLinebreak",
					data: { tag: endTag.parent.name },
					fix(fixer) {
						return fixer.removeRange([endTag.range[0] - afterText.length, endTag.range[0]]);
					}
				});
			}
			/**
			* @param {VElement} element
			* @param {ArgsOptions} options
			* @returns {void}
			*/
			function verifyElement(element, options) {
				const { startTag, endTag } = element;
				if (startTag.selfClosing || endTag == null) return;
				const text = sourceCode.text.slice(startTag.range[1], endTag.range[0]);
				if (!text.trim()) return;
				const option = options.multiline !== options.singleline && /[\n\r\u{2028}\u{2029}]/u.test(text.trim()) ? options.multiline : options.singleline;
				if (option === "ignore") return;
				const beforeText = /^\s*/u.exec(text)[0];
				const afterText = /\s*$/u.exec(text)[0];
				const beforeLinebreakCount = getLinebreakCount(beforeText);
				const afterLinebreakCount = getLinebreakCount(afterText);
				/** @type {'always' | 'never'} */
				let beforeOption;
				/** @type {'always' | 'never'} */
				let afterOption;
				if (option === "always" || option === "never") {
					beforeOption = option;
					afterOption = option;
				} else {
					if (beforeLinebreakCount > 0 === afterLinebreakCount > 0) return;
					beforeOption = "always";
					afterOption = "always";
				}
				verifyBeforeSpaces(startTag, beforeText, beforeLinebreakCount, beforeOption, options.maxEmptyLines);
				verifyAfterSpaces(endTag, afterText, afterLinebreakCount, afterOption, options.maxEmptyLines);
			}
			/**
			* Normalizes a given option value.
			* @param { Options | undefined } option An option value to parse.
			* @returns { (element: VElement) => void } Verify function.
			*/
			function normalizeOptionValue(option) {
				if (!option) return normalizeOptionValue({});
				/** @type {ContentsOptions} */
				const contentsOptions = option;
				/** @type {ArgsOptions} */
				const options = {
					singleline: contentsOptions.singleline || "consistent",
					multiline: contentsOptions.multiline || "always",
					maxEmptyLines: contentsOptions.maxEmptyLines || 0
				};
				const { blocks } = option;
				if (!blocks) return (element) => verifyElement(element, options);
				return (element) => {
					const { name } = element;
					const elementsOptions = blocks[name];
					if (elementsOptions) normalizeOptionValue({
						singleline: elementsOptions.singleline || options.singleline,
						multiline: elementsOptions.multiline || options.multiline,
						maxEmptyLines: elementsOptions.maxEmptyLines ?? options.maxEmptyLines
					})(element);
					else verifyElement(element, options);
				};
			}
			const documentFragment = df;
			const verify = normalizeOptionValue(context.options[0]);
			return utils.defineTemplateBodyVisitor(context, {}, { 
			/** @param {Program} node */
Program(node) {
				if (utils.hasInvalidEOF(node)) return;
				for (const element of documentFragment.children) if (utils.isVElement(element)) verify(element);
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_block_tag_newline();
	}
});
VU$xG"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/brace-style.js
/**
* @author Yosuke Ota
*/
var require_brace_style = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapStylisticOrCoreRule } = require_index.default;
	module.exports = wrapStylisticOrCoreRule("brace-style", { skipDynamicArguments: true });
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_brace_style();
	}
});
! x	"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/camelcase.js
/**
* @author Yosuke Ota
*/
var require_camelcase = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapCoreRule } = require_index.default;
	module.exports = wrapCoreRule("camelcase");
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_camelcase();
	}
});
W"x+"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/comma-dangle.js
/**
* @author Yosuke Ota
*/
var require_comma_dangle = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapStylisticOrCoreRule } = require_index.default;
	module.exports = wrapStylisticOrCoreRule("comma-dangle");
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_comma_dangle();
	}
});
(xr"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/comma-spacing.js
/**
* @author Yosuke Ota
*/
var require_comma_spacing = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapStylisticOrCoreRule } = require_index.default;
	module.exports = wrapStylisticOrCoreRule("comma-spacing", {
		skipDynamicArguments: true,
		skipDynamicArgumentsReport: true,
		applyDocument: true
	});
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_comma_spacing();
	}
});
▲-x-"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/comma-style.js
/**
* @author Yosuke Ota
*/
var require_comma_style = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapStylisticOrCoreRule } = require_index.default;
	module.exports = wrapStylisticOrCoreRule("comma-style", { create(_context, { baseHandlers }) {
		return { VSlotScopeExpression(node) {
			if (baseHandlers.FunctionExpression) baseHandlers.FunctionExpression(node);
		} };
	} });
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_comma_style();
	}
});
?x',"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/comment-directive.js
/**
* @author Toru Nagashima <https://github.com/mysticatea>
*/
var require_comment_directive = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef {object} RuleAndLocation
	* @property {string} RuleAndLocation.ruleId
	* @property {number} RuleAndLocation.index
	* @property {string} [RuleAndLocation.key]
	*/
	const COMMENT_DIRECTIVE_B = /^\s*(eslint-(?:en|dis)able)(?:\s+|$)/;
	const COMMENT_DIRECTIVE_L = /^\s*(eslint-disable(?:-next)?-line)(?:\s+|$)/;
	/**
	* Remove the ignored part from a given directive comment and trim it.
	* @param {string} value The comment text to strip.
	* @returns {string} The stripped text.
	*/
	function stripDirectiveComment(value) {
		return value.split(/\s-{2,}\s/u, 1)[0];
	}
	/**
	* Parse a given comment.
	* @param {RegExp} pattern The RegExp pattern to parse.
	* @param {string} comment The comment value to parse.
	* @returns {({type:string,rules:RuleAndLocation[]})|null} The parsing result.
	*/
	function parse(pattern, comment) {
		const text = stripDirectiveComment(comment);
		const match = pattern.exec(text);
		if (match == null) return null;
		const type = match[1];
		/** @type {RuleAndLocation[]} */
		const rules = [];
		const rulesRe = /([^\s,]+)[\s,]*/g;
		let startIndex = match[0].length;
		rulesRe.lastIndex = startIndex;
		let res;
		while (res = rulesRe.exec(text)) {
			const ruleId = res[1].trim();
			rules.push({
				ruleId,
				index: startIndex
			});
			startIndex = rulesRe.lastIndex;
		}
		return {
			type,
			rules
		};
	}
	/**
	* Enable rules.
	* @param {RuleContext} context The rule context.
	* @param {{line:number,column:number}} loc The location information to enable.
	* @param { 'block' | 'line' } group The group to enable.
	* @param {string | null} rule The rule ID to enable.
	* @returns {void}
	*/
	function enable(context, loc, group, rule) {
		if (rule) context.report({
			loc,
			messageId: group === "block" ? "enableBlockRule" : "enableLineRule",
			data: { rule }
		});
		else context.report({
			loc,
			messageId: group === "block" ? "enableBlock" : "enableLine"
		});
	}
	/**
	* Disable rules.
	* @param {RuleContext} context The rule context.
	* @param {{line:number,column:number}} loc The location information to disable.
	* @param { 'block' | 'line' } group The group to disable.
	* @param {string | null} rule The rule ID to disable.
	* @param {string} key The disable directive key.
	* @returns {void}
	*/
	function disable(context, loc, group, rule, key) {
		if (rule) context.report({
			loc,
			messageId: group === "block" ? "disableBlockRule" : "disableLineRule",
			data: {
				rule,
				key
			}
		});
		else context.report({
			loc,
			messageId: group === "block" ? "disableBlock" : "disableLine",
			data: { key }
		});
	}
	/**
	* Process a given comment token.
	* If the comment is `eslint-disable` or `eslint-enable` then it reports the comment.
	* @param {RuleContext} context The rule context.
	* @param {Token} comment The comment token to process.
	* @param {boolean} reportUnusedDisableDirectives To report unused eslint-disable comments.
	* @returns {void}
	*/
	function processBlock(context, comment, reportUnusedDisableDirectives) {
		const parsed = parse(COMMENT_DIRECTIVE_B, comment.value);
		if (parsed === null) return;
		if (parsed.type === "eslint-disable") if (parsed.rules.length > 0) {
			const rules = reportUnusedDisableDirectives ? reportUnusedRules(context, comment, parsed.type, parsed.rules) : parsed.rules;
			for (const rule of rules) disable(context, comment.loc.start, "block", rule.ruleId, rule.key || "*");
		} else {
			const key = reportUnusedDisableDirectives ? reportUnused(context, comment, parsed.type) : "";
			disable(context, comment.loc.start, "block", null, key);
		}
		else if (parsed.rules.length > 0) for (const rule of parsed.rules) enable(context, comment.loc.start, "block", rule.ruleId);
		else enable(context, comment.loc.start, "block", null);
	}
	/**
	* Process a given comment token.
	* If the comment is `eslint-disable-line` or `eslint-disable-next-line` then it reports the comment.
	* @param {RuleContext} context The rule context.
	* @param {Token} comment The comment token to process.
	* @param {boolean} reportUnusedDisableDirectives To report unused eslint-disable comments.
	* @returns {void}
	*/
	function processLine(context, comment, reportUnusedDisableDirectives) {
		const parsed = parse(COMMENT_DIRECTIVE_L, comment.value);
		if (parsed != null && comment.loc.start.line === comment.loc.end.line) {
			const line = comment.loc.start.line + (parsed.type === "eslint-disable-line" ? 0 : 1);
			const column = -1;
			if (parsed.rules.length > 0) {
				const rules = reportUnusedDisableDirectives ? reportUnusedRules(context, comment, parsed.type, parsed.rules) : parsed.rules;
				for (const rule of rules) {
					disable(context, {
						line,
						column
					}, "line", rule.ruleId, rule.key || "");
					enable(context, {
						line: line + 1,
						column
					}, "line", rule.ruleId);
				}
			} else {
				const key = reportUnusedDisableDirectives ? reportUnused(context, comment, parsed.type) : "";
				disable(context, {
					line,
					column
				}, "line", null, key);
				enable(context, {
					line: line + 1,
					column
				}, "line", null);
			}
		}
	}
	/**
	* Reports unused disable directive.
	* Do not check the use of directives here. Filter the directives used with postprocess.
	* @param {RuleContext} context The rule context.
	* @param {Token} comment The comment token to report.
	* @param {string} kind The comment directive kind.
	* @returns {string} The report key
	*/
	function reportUnused(context, comment, kind) {
		const loc = comment.loc;
		context.report({
			loc,
			messageId: "unused",
			data: { kind }
		});
		return locToKey(loc.start);
	}
	/**
	* Reports unused disable directive rules.
	* Do not check the use of directives here. Filter the directives used with postprocess.
	* @param {RuleContext} context The rule context.
	* @param {Token} comment The comment token to report.
	* @param {string} kind The comment directive kind.
	* @param {RuleAndLocation[]} rules To report rule.
	* @returns { { ruleId: string, key: string }[] }
	*/
	function reportUnusedRules(context, comment, kind, rules) {
		const sourceCode = context.sourceCode;
		const commentStart = comment.range[0] + 4;
		return rules.map((rule) => {
			const start = sourceCode.getLocFromIndex(commentStart + rule.index);
			const end = sourceCode.getLocFromIndex(commentStart + rule.index + rule.ruleId.length);
			context.report({
				loc: {
					start,
					end
				},
				messageId: "unusedRule",
				data: {
					rule: rule.ruleId,
					kind
				}
			});
			return {
				ruleId: rule.ruleId,
				key: locToKey(start)
			};
		});
	}
	/**
	* Gets the key of location
	* @param {Position} location The location
	* @returns {string} The key
	*/
	function locToKey(location) {
		return `line:${location.line},column${location.column}`;
	}
	/**
	* Extracts the top-level elements in document fragment.
	* @param {VDocumentFragment} documentFragment The document fragment.
	* @returns {VElement[]} The top-level elements
	*/
	function extractTopLevelHTMLElements(documentFragment) {
		return documentFragment.children.filter(utils.isVElement);
	}
	/**
	* Extracts the top-level comments in document fragment.
	* @param {VDocumentFragment} documentFragment The document fragment.
	* @returns {Token[]} The top-level comments
	*/
	function extractTopLevelDocumentFragmentComments(documentFragment) {
		const elements = extractTopLevelHTMLElements(documentFragment);
		return documentFragment.comments.filter((comment) => elements.every((element) => comment.range[1] <= element.range[0] || element.range[1] <= comment.range[0]));
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "support comment-directives in `<template>`",
				categories: ["base"],
				url: "https://eslint.vuejs.org/rules/comment-directive.html"
			},
			schema: [{
				type: "object",
				properties: { reportUnusedDisableDirectives: { type: "boolean" } },
				additionalProperties: false
			}],
			messages: {
				disableBlock: "--block {{key}}",
				enableBlock: "++block",
				disableLine: "--line {{key}}",
				enableLine: "++line",
				disableBlockRule: "-block {{rule}} {{key}}",
				enableBlockRule: "+block {{rule}}",
				disableLineRule: "-line {{rule}} {{key}}",
				enableLineRule: "+line {{rule}}",
				clear: "clear",
				unused: "Unused {{kind}} directive (no problems were reported).",
				unusedRule: "Unused {{kind}} directive (no problems were reported from '{{rule}}')."
			}
		},
		/**
		* @param {RuleContext} context - The rule context.
		* @returns {RuleListener} AST event handlers.
		*/
		create(context) {
			/** @type {boolean} */
			const reportUnusedDisableDirectives = (context.options[0] || {}).reportUnusedDisableDirectives;
			const sourceCode = context.sourceCode;
			const documentFragment = sourceCode.parserServices.getDocumentFragment && sourceCode.parserServices.getDocumentFragment();
			return { Program(node) {
				if (node.templateBody) {
					for (const comment of node.templateBody.comments) {
						processBlock(context, comment, reportUnusedDisableDirectives);
						processLine(context, comment, reportUnusedDisableDirectives);
					}
					context.report({
						loc: node.templateBody.loc.end,
						messageId: "clear"
					});
				}
				if (documentFragment) {
					for (const comment of extractTopLevelDocumentFragmentComments(documentFragment)) {
						processBlock(context, comment, reportUnusedDisableDirectives);
						processLine(context, comment, reportUnusedDisableDirectives);
					}
					for (const element of extractTopLevelHTMLElements(documentFragment)) context.report({
						loc: element.loc.end,
						messageId: "clear"
					});
				}
			} };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_comment_directive();
	}
});
 ݳx"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/component-api-style.js
/**
* @author Yosuke Ota <https://github.com/ota-meshi>
* See LICENSE file in root directory for full license.
*/
var require_component_api_style = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef { 'script-setup' | 'composition' | 'composition-vue2' | 'options' } PreferOption
	*
	* @typedef {PreferOption[]} UserPreferOption
	*
	* @typedef {object} NormalizeOptions
	* @property {object} allowsSFC
	* @property {boolean} [allowsSFC.scriptSetup]
	* @property {boolean} [allowsSFC.composition]
	* @property {boolean} [allowsSFC.compositionVue2]
	* @property {boolean} [allowsSFC.options]
	* @property {object} allowsOther
	* @property {boolean} [allowsOther.composition]
	* @property {boolean} [allowsOther.compositionVue2]
	* @property {boolean} [allowsOther.options]
	*/
	/** @type {PreferOption[]} */
	const STYLE_OPTIONS = [
		"script-setup",
		"composition",
		"composition-vue2",
		"options"
	];
	/**
	* @param {NormalizeOptions} opts
	* @param {PreferOption} prefer
	*/
	function applyPreferOption(opts, prefer) {
		switch (prefer) {
			case "script-setup":
				opts.allowsSFC.scriptSetup = true;
				break;
			case "composition":
				opts.allowsSFC.composition = true;
				opts.allowsOther.composition = true;
				break;
			case "composition-vue2":
				opts.allowsSFC.compositionVue2 = true;
				opts.allowsOther.compositionVue2 = true;
				break;
			case "options":
				opts.allowsSFC.options = true;
				opts.allowsOther.options = true;
				break;
		}
	}
	/**
	* Normalize options.
	* @param {any[]} options The options user configured.
	* @returns {NormalizeOptions} The normalized options.
	*/
	function parseOptions(options) {
		/** @type {NormalizeOptions} */
		const opts = {
			allowsSFC: {},
			allowsOther: {}
		};
		/** @type {UserPreferOption} */
		const preferOptions = options[0] || ["script-setup", "composition"];
		for (const prefer of preferOptions) applyPreferOption(opts, prefer);
		if (!opts.allowsOther.composition && !opts.allowsOther.compositionVue2 && !opts.allowsOther.options) {
			opts.allowsOther.composition = true;
			opts.allowsOther.compositionVue2 = true;
			opts.allowsOther.options = true;
		}
		return opts;
	}
	const OPTIONS_API_OPTIONS = /* @__PURE__ */ new Set([
		"mixins",
		"extends",
		"data",
		"computed",
		"methods",
		"watch",
		"provide",
		"inject",
		"beforeCreate",
		"created",
		"beforeMount",
		"mounted",
		"beforeUpdate",
		"updated",
		"activated",
		"deactivated",
		"beforeDestroy",
		"beforeUnmount",
		"destroyed",
		"unmounted",
		"render",
		"renderTracked",
		"renderTriggered",
		"errorCaptured",
		"expose"
	]);
	const COMPOSITION_API_OPTIONS = /* @__PURE__ */ new Set(["setup"]);
	const COMPOSITION_API_VUE2_OPTIONS = /* @__PURE__ */ new Set([
		"setup",
		"render",
		"renderTracked",
		"renderTriggered"
	]);
	const LIFECYCLE_HOOK_OPTIONS = /* @__PURE__ */ new Set([
		"beforeCreate",
		"created",
		"beforeMount",
		"mounted",
		"beforeUpdate",
		"updated",
		"activated",
		"deactivated",
		"beforeDestroy",
		"beforeUnmount",
		"destroyed",
		"unmounted",
		"renderTracked",
		"renderTriggered",
		"errorCaptured"
	]);
	/**
	* @typedef { 'script-setup' | 'composition' | 'options' } ApiStyle
	*/
	/**
	* @param {object} allowsOpt
	* @param {boolean} [allowsOpt.scriptSetup]
	* @param {boolean} [allowsOpt.composition]
	* @param {boolean} [allowsOpt.compositionVue2]
	* @param {boolean} [allowsOpt.options]
	*/
	function buildAllowedPhrase(allowsOpt) {
		const phrases = [];
		if (allowsOpt.scriptSetup) phrases.push("`<script setup>`");
		if (allowsOpt.composition) phrases.push("Composition API");
		if (allowsOpt.compositionVue2) phrases.push("Composition API (Vue 2)");
		if (allowsOpt.options) phrases.push("Options API");
		return phrases.length > 2 ? `${phrases.slice(0, -1).join(", ")} or ${phrases.at(-1)}` : phrases.join(" or ");
	}
	/**
	* @param {object} allowsOpt
	* @param {boolean} [allowsOpt.scriptSetup]
	* @param {boolean} [allowsOpt.composition]
	* @param {boolean} [allowsOpt.compositionVue2]
	* @param {boolean} [allowsOpt.options]
	*/
	function isPreferScriptSetup(allowsOpt) {
		return allowsOpt.scriptSetup && !allowsOpt.composition && !allowsOpt.compositionVue2 && !allowsOpt.options;
	}
	/**
	* @param {string} name
	*/
	function buildOptionPhrase(name) {
		if (LIFECYCLE_HOOK_OPTIONS.has(name)) return `\`${name}\` lifecycle hook`;
		return name === "setup" || name === "render" ? `\`${name}\` function` : `\`${name}\` option`;
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "enforce component API style",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/component-api-style.html"
			},
			fixable: null,
			schema: [{
				type: "array",
				items: {
					enum: STYLE_OPTIONS,
					uniqueItems: true,
					additionalItems: false
				},
				minItems: 1
			}],
			messages: {
				disallowScriptSetup: "`<script setup>` is not allowed in your project. Use {{allowedApis}} instead.",
				disallowComponentOption: "{{disallowedApi}} is not allowed in your project. {{optionPhrase}} is part of the {{disallowedApi}}. Use {{allowedApis}} instead.",
				disallowComponentOptionPreferScriptSetup: "{{disallowedApi}} is not allowed in your project. Use `<script setup>` instead."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const options = parseOptions(context.options);
			return utils.compositingVisitors({ Program() {
				if (options.allowsSFC.scriptSetup) return;
				const scriptSetup = utils.getScriptSetupElement(context);
				if (scriptSetup) context.report({
					node: scriptSetup.startTag,
					messageId: "disallowScriptSetup",
					data: { allowedApis: buildAllowedPhrase(options.allowsSFC) }
				});
			} }, utils.defineVueVisitor(context, { onVueObjectEnter(node) {
				const allows = utils.isSFCObject(context, node) ? options.allowsSFC : options.allowsOther;
				if ((allows.composition || allows.compositionVue2) && allows.options) return;
				const apis = [
					{
						allow: allows.composition,
						options: COMPOSITION_API_OPTIONS,
						apiName: "Composition API"
					},
					{
						allow: allows.options,
						options: OPTIONS_API_OPTIONS,
						apiName: "Options API"
					},
					{
						allow: allows.compositionVue2,
						options: COMPOSITION_API_VUE2_OPTIONS,
						apiName: "Composition API (Vue 2)"
					}
				];
				for (const prop of node.properties) {
					if (prop.type !== "Property") continue;
					const name = utils.getStaticPropertyName(prop);
					if (!name) continue;
					const disallowApi = apis.every((api) => !(api.allow && api.options.has(name))) && apis.find((api) => !api.allow && api.options.has(name));
					if (disallowApi) context.report({
						node: prop.key,
						messageId: isPreferScriptSetup(allows) ? "disallowComponentOptionPreferScriptSetup" : "disallowComponentOption",
						data: {
							disallowedApi: disallowApi.apiName,
							optionPhrase: buildOptionPhrase(name),
							allowedApis: buildAllowedPhrase(allows)
						}
					});
				}
			} }));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_component_api_style();
	}
});
Kcxx
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
//#region lib/rules/component-definition-name-casing.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
const allowedCaseOptions = ["PascalCase", "kebab-case"];
function canConvert(node) {
	return node.type === "Literal" || node.type === "TemplateLiteral" && node.expressions.length === 0 && node.quasis.length === 1;
}
var component_definition_name_casing_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "enforce specific casing for component definition name",
			categories: ["vue3-strongly-recommended", "vue2-strongly-recommended"],
			url: "https://eslint.vuejs.org/rules/component-definition-name-casing.html"
		},
		fixable: "code",
		schema: [{ enum: allowedCaseOptions }],
		messages: { incorrectCase: "Property name \"{{value}}\" is not {{caseType}}." }
	},
	create(context) {
		const options = context.options[0];
		const caseType = allowedCaseOptions.includes(options) ? options : "PascalCase";
		function convertName(node) {
			let nodeValue;
			let range;
			if (node.type === "TemplateLiteral") {
				const quasis = node.quasis[0];
				nodeValue = quasis.value.cooked;
				range = quasis.range;
			} else {
				nodeValue = String(node.value);
				range = node.range;
			}
			if (!require_casing.getChecker(caseType)(nodeValue)) context.report({
				node,
				messageId: "incorrectCase",
				data: {
					value: nodeValue,
					caseType
				},
				fix: (fixer) => fixer.replaceTextRange([range[0] + 1, range[1] - 1], require_casing.getExactConverter(caseType)(nodeValue))
			});
		}
		return import_utils.default.compositingVisitors(import_utils.default.executeOnCallVueComponent(context, (node) => {
			if (node.arguments.length !== 2) return;
			const argument = node.arguments[0];
			if (canConvert(argument)) convertName(argument);
		}), import_utils.default.executeOnVue(context, (obj) => {
			const node = import_utils.default.findProperty(obj, "name");
			if (!node) return;
			if (!canConvert(node.value)) return;
			convertName(node.value);
		}), import_utils.default.defineScriptSetupVisitor(context, { onDefineOptionsEnter(node) {
			if (node.arguments.length === 0) return;
			const define = node.arguments[0];
			if (define.type !== "ObjectExpression") return;
			const nameNode = import_utils.default.findProperty(define, "name");
			if (!nameNode) return;
			if (!canConvert(nameNode.value)) return;
			convertName(nameNode.value);
		} }));
	}
};
//#endregion
exports.default = component_definition_name_casing_default;
<xhconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
const require_regexp = require("../utils/regexp.js");
//#region lib/rules/component-name-in-template-casing.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
const allowedCaseOptions = ["PascalCase", "kebab-case"];
const defaultCase = "PascalCase";
/**
* Checks whether the given variable is the type-only import object.
*/
function isTypeOnlyImport(variable) {
	if (variable.defs.length === 0) return false;
	return variable.defs.every((def) => {
		if (def.type !== "ImportBinding") return false;
		if (def.parent.importKind === "type") return true;
		return def.node.type === "ImportSpecifier" && def.node.importKind === "type";
	});
}
var component_name_in_template_casing_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "enforce specific casing for the component naming style in template",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/component-name-in-template-casing.html"
		},
		fixable: "code",
		schema: [{ enum: allowedCaseOptions }, {
			type: "object",
			properties: {
				globals: {
					type: "array",
					items: { type: "string" },
					uniqueItems: true
				},
				ignores: {
					type: "array",
					items: { type: "string" },
					uniqueItems: true,
					additionalItems: false
				},
				registeredComponentsOnly: { type: "boolean" }
			},
			additionalProperties: false
		}],
		messages: { incorrectCase: "Component name \"{{name}}\" is not {{caseType}}." }
	},
	create(context) {
		const caseOption = context.options[0];
		const options = context.options[1] || {};
		const caseType = allowedCaseOptions.includes(caseOption) ? caseOption : defaultCase;
		const isIgnored = require_regexp.toRegExpGroupMatcher(options.ignores);
		const globalStrings = [];
		const globalPatterns = [];
		const globals = options.globals || [];
		for (const global of globals) if (require_regexp.isRegExp(global)) globalPatterns.push(global);
		else globalStrings.push(global);
		const isGlobalPattern = require_regexp.toRegExpGroupMatcher(globalPatterns);
		const shouldCheckRegisteredComponentsOnly = options.registeredComponentsOnly !== false;
		const sourceCode = context.sourceCode;
		const tokens = sourceCode.parserServices.getTemplateBodyTokenStore && sourceCode.parserServices.getTemplateBodyTokenStore();
		const registeredComponents = new Set(globalStrings.map(require_casing.pascalCase));
		if (import_utils.default.isScriptSetup(context)) {
			const globalScope = context.sourceCode.scopeManager.globalScope;
			if (globalScope) {
				const moduleScope = globalScope.childScopes.find((scope) => scope.type === "module");
				const moduleVariables = moduleScope && moduleScope.variables || [];
				for (const variable of moduleVariables) if (!isTypeOnlyImport(variable)) registeredComponents.add(variable.name);
			}
		}
		/**
		* Checks whether the given node is the verification target node.
		*/
		function isVerifyTarget(node) {
			if (isIgnored(node.rawName)) return false;
			if (!import_utils.default.isHtmlElementNode(node) && !import_utils.default.isSvgElementNode(node) && !import_utils.default.isMathElementNode(node) || import_utils.default.isHtmlWellKnownElementName(node.rawName) || import_utils.default.isSvgWellKnownElementName(node.rawName) || import_utils.default.isMathWellKnownElementName(node.rawName) || import_utils.default.isVueBuiltInElementName(node.rawName)) return false;
			if (!shouldCheckRegisteredComponentsOnly) return true;
			return registeredComponents.has(require_casing.pascalCase(node.rawName)) || isGlobalPattern(node.rawName);
		}
		let hasInvalidEOF = false;
		return import_utils.default.defineTemplateBodyVisitor(context, { VElement(node) {
			if (hasInvalidEOF) return;
			if (!isVerifyTarget(node)) return;
			const name = node.rawName;
			if (!require_casing.getChecker(caseType)(name)) {
				const startTag = node.startTag;
				const open = tokens.getFirstToken(startTag);
				const casingName = require_casing.getExactConverter(caseType)(name);
				context.report({
					node: open,
					loc: open.loc,
					messageId: "incorrectCase",
					data: {
						name,
						caseType
					},
					*fix(fixer) {
						yield fixer.replaceText(open, `<${casingName}`);
						const endTag = node.endTag;
						if (endTag) {
							const endTagOpen = tokens.getFirstToken(endTag);
							yield fixer.replaceText(endTagOpen, `</${casingName}`);
						}
					}
				});
			}
		} }, {
			Program(node) {
				hasInvalidEOF = import_utils.default.hasInvalidEOF(node);
			},
			...shouldCheckRegisteredComponentsOnly ? import_utils.default.executeOnVue(context, (obj) => {
				for (const n of import_utils.default.getRegisteredComponents(obj)) registeredComponents.add(n.name);
			}) : {}
		});
	}
};
//#endregion
exports.default = component_name_in_template_casing_default;
WزxB
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
//#region lib/rules/component-options-name-casing.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
function getOptionsComponentName(node) {
	if (node.type === "Identifier") return node.name;
	if (node.type === "Literal") return typeof node.value === "string" ? node.value : null;
	return null;
}
var component_options_name_casing_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "enforce the casing of component name in `components` options",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/component-options-name-casing.html"
		},
		fixable: "code",
		hasSuggestions: true,
		schema: [{ enum: require_casing.allowedCaseOptions }],
		messages: {
			caseNotMatched: "Component name \"{{component}}\" is not {{caseType}}.",
			possibleRenaming: "Rename component name to be in {{caseType}}."
		}
	},
	create(context) {
		const caseType = context.options[0] || "PascalCase";
		const canAutoFix = caseType === "PascalCase";
		const checkCase = require_casing.getChecker(caseType);
		const convert = require_casing.getConverter(caseType);
		return import_utils.default.executeOnVue(context, (obj) => {
			const node = import_utils.default.findProperty(obj, "components");
			if (!node || node.value.type !== "ObjectExpression") return;
			for (const property of node.value.properties) {
				if (property.type !== "Property") continue;
				const name = getOptionsComponentName(property.key);
				if (!name || checkCase(name)) continue;
				context.report({
					node: property.key,
					messageId: "caseNotMatched",
					data: {
						component: name,
						caseType
					},
					fix: canAutoFix ? (fixer) => {
						const converted = convert(name);
						return property.shorthand ? fixer.replaceText(property, `${converted}: ${name}`) : fixer.replaceText(property.key, converted);
					} : void 0,
					suggest: canAutoFix ? void 0 : [{
						messageId: "possibleRenaming",
						data: { caseType },
						fix: (fixer) => {
							const converted = convert(name);
							if (caseType === "kebab-case") return property.shorthand ? fixer.replaceText(property, `'${converted}': ${name}`) : fixer.replaceText(property.key, `'${converted}'`);
							return property.shorthand ? fixer.replaceText(property, `${converted}: ${name}`) : fixer.replaceText(property.key, converted);
						}
					}]
				});
			}
		});
	}
};
//#endregion
exports.default = component_options_name_casing_default;
nhx#const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
const require_regexp = require("../utils/regexp.js");
let _eslint_community_eslint_utils = require("@eslint-community/eslint-utils");
//#region lib/rules/custom-event-name-casing.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
const ALLOWED_CASE_OPTIONS = ["kebab-case", "camelCase"];
const DEFAULT_CASE = "camelCase";
/**
* Get the name param node from the given CallExpression
*/
function getNameParamNode(node) {
	const nameLiteralNode = node.arguments[0];
	if (nameLiteralNode && import_utils.default.isStringLiteral(nameLiteralNode)) {
		const name = import_utils.default.getStringLiteralValue(nameLiteralNode);
		if (name != null) return {
			name,
			loc: nameLiteralNode.loc
		};
	}
	return null;
}
/**
* Get the callee member node from the given CallExpression
*/
function getCalleeMemberNode(node) {
	const callee = import_utils.default.skipChainExpression(node.callee);
	if (callee.type === "MemberExpression") {
		const name = import_utils.default.getStaticPropertyName(callee);
		if (name) return {
			name,
			member: callee
		};
	}
	return null;
}
var custom_event_name_casing_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "enforce specific casing for custom event name",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/custom-event-name-casing.html"
		},
		fixable: null,
		schema: [{ enum: ALLOWED_CASE_OPTIONS }, {
			type: "object",
			properties: { ignores: {
				type: "array",
				items: { type: "string" },
				uniqueItems: true,
				additionalItems: false
			} },
			additionalProperties: false
		}],
		messages: { unexpected: "Custom event name '{{name}}' must be {{caseType}}." }
	},
	create(context) {
		const setupContexts = /* @__PURE__ */ new Map();
		let emitParamName = "";
		const caseType = context.options[0] || DEFAULT_CASE;
		const objectOption = context.options[1] || {};
		const caseChecker = require_casing.getChecker(caseType);
		const isIgnored = require_regexp.toRegExpGroupMatcher(objectOption.ignores);
		/**
		* Check whether the given event name is valid.
		*/
		function isValidEventName(name) {
			return name.split(":").every(caseChecker);
		}
		function verify(nameWithLoc) {
			const name = nameWithLoc.name;
			if (isValidEventName(name) || isIgnored(name)) return;
			context.report({
				loc: nameWithLoc.loc,
				messageId: "unexpected",
				data: {
					name,
					caseType
				}
			});
		}
		const programNode = context.sourceCode.ast;
		const callVisitor = { CallExpression(node, info) {
			const nameWithLoc = getNameParamNode(node);
			if (!nameWithLoc) return;
			const setupContext = setupContexts.get(info ? info.node : programNode);
			if (setupContext) {
				const { contextReferenceIds, emitReferenceIds } = setupContext;
				if (node.callee.type === "Identifier" && emitReferenceIds.has(node.callee)) verify(nameWithLoc);
				else {
					const emit = getCalleeMemberNode(node);
					if (emit && emit.name === "emit" && emit.member.object.type === "Identifier" && contextReferenceIds.has(emit.member.object)) verify(nameWithLoc);
				}
			}
		} };
		return import_utils.default.defineTemplateBodyVisitor(context, { CallExpression(node) {
			const callee = node.callee;
			const nameWithLoc = getNameParamNode(node);
			if (!nameWithLoc) return;
			if (callee.type === "Identifier" && (callee.name === "$emit" || callee.name === emitParamName)) verify(nameWithLoc);
		} }, import_utils.default.compositingVisitors(import_utils.default.defineScriptSetupVisitor(context, {
			onDefineEmitsEnter(node) {
				if (!node.parent || node.parent.type !== "VariableDeclarator" || node.parent.init !== node) return;
				const emitParam = node.parent.id;
				if (emitParam.type !== "Identifier") return;
				emitParamName = emitParam.name;
				const variable = (0, _eslint_community_eslint_utils.findVariable)(import_utils.default.getScope(context, emitParam), emitParam);
				if (!variable) return;
				const emitReferenceIds = /* @__PURE__ */ new Set();
				for (const reference of variable.references) emitReferenceIds.add(reference.identifier);
				setupContexts.set(programNode, {
					contextReferenceIds: /* @__PURE__ */ new Set(),
					emitReferenceIds
				});
			},
			...callVisitor
		}), import_utils.default.defineVueVisitor(context, {
			onSetupFunctionEnter(node, { node: vueNode }) {
				const contextParam = import_utils.default.skipDefaultParamValue(node.params[1]);
				if (!contextParam) return;
				if (contextParam.type === "RestElement" || contextParam.type === "ArrayPattern") return;
				const contextReferenceIds = /* @__PURE__ */ new Set();
				const emitReferenceIds = /* @__PURE__ */ new Set();
				if (contextParam.type === "ObjectPattern") {
					const emitProperty = import_utils.default.findAssignmentProperty(contextParam, "emit");
					if (!emitProperty || emitProperty.value.type !== "Identifier") return;
					const emitParam = emitProperty.value;
					const variable = (0, _eslint_community_eslint_utils.findVariable)(import_utils.default.getScope(context, emitParam), emitParam);
					if (!variable) return;
					for (const reference of variable.references) emitReferenceIds.add(reference.identifier);
				} else {
					const variable = (0, _eslint_community_eslint_utils.findVariable)(import_utils.default.getScope(context, contextParam), contextParam);
					if (!variable) return;
					for (const reference of variable.references) contextReferenceIds.add(reference.identifier);
				}
				setupContexts.set(vueNode, {
					contextReferenceIds,
					emitReferenceIds
				});
			},
			...callVisitor,
			onVueObjectExit(node) {
				setupContexts.delete(node);
			}
		}), { CallExpression(node) {
			const nameLiteralNode = getNameParamNode(node);
			if (!nameLiteralNode) return;
			const emit = getCalleeMemberNode(node);
			if (emit && emit.name === "$emit") verify(nameLiteralNode);
		} }));
	}
};
//#endregion
exports.default = custom_event_name_casing_default;
KMŷx
("use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/define-emits-declaration.js
/**
* @author Amorites
* See LICENSE file in root directory for full license.
*/
var require_define_emits_declaration = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef {import('@typescript-eslint/types').TSESTree.TypeNode} TypeNode
	*
	*/
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "enforce declaration style of `defineEmits`",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/define-emits-declaration.html"
			},
			fixable: null,
			schema: [{ enum: [
				"type-based",
				"type-literal",
				"runtime"
			] }],
			messages: {
				hasArg: "Use type based declaration instead of runtime declaration.",
				hasTypeArg: "Use runtime declaration instead of type based declaration.",
				hasTypeCallArg: "Use new type literal declaration instead of the old call signature declaration."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const scriptSetup = utils.getScriptSetupElement(context);
			if (!scriptSetup || !utils.hasAttribute(scriptSetup, "lang", "ts")) return {};
			const defineType = context.options[0] || "type-based";
			return utils.defineScriptSetupVisitor(context, { onDefineEmitsEnter(node) {
				switch (defineType) {
					case "type-based":
						if (node.arguments.length > 0) context.report({
							node,
							messageId: "hasArg"
						});
						break;
					case "type-literal":
						verifyTypeLiteral(node);
						break;
					case "runtime": {
						const typeArguments = "typeArguments" in node ? node.typeArguments : node.typeParameters;
						if (typeArguments && typeArguments.params.length > 0) context.report({
							node,
							messageId: "hasTypeArg"
						});
						break;
					}
				}
			} });
			/** @param {CallExpression} node */
			function verifyTypeLiteral(node) {
				if (node.arguments.length > 0) {
					context.report({
						node,
						messageId: "hasArg"
					});
					return;
				}
				const param = (node.typeArguments || node.typeParameters)?.params[0];
				if (!param) return;
				if (param.type === "TSTypeLiteral") {
					for (const memberNode of param.members) if (memberNode.type !== "TSPropertySignature") context.report({
						node: memberNode,
						messageId: "hasTypeCallArg"
					});
				} else if (param.type === "TSFunctionType") context.report({
					node: param,
					messageId: "hasTypeCallArg"
				});
			}
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_define_emits_declaration();
	}
});
ix(l"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/define-macros-order.js
/**
* @author Eduard Deisling
* See LICENSE file in root directory for full license.
*/
var require_define_macros_order = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const MACROS_EMITS = "defineEmits";
	const MACROS_PROPS = "defineProps";
	const MACROS_OPTIONS = "defineOptions";
	const MACROS_SLOTS = "defineSlots";
	const MACROS_MODEL = "defineModel";
	const MACROS_EXPOSE = "defineExpose";
	const KNOWN_MACROS = /* @__PURE__ */ new Set([
		MACROS_EMITS,
		MACROS_PROPS,
		MACROS_OPTIONS,
		MACROS_SLOTS,
		MACROS_MODEL,
		MACROS_EXPOSE
	]);
	const DEFAULT_ORDER = [MACROS_PROPS, MACROS_EMITS];
	/**
	* @param {VElement} scriptSetup
	* @param {ASTNode} node
	*/
	function isInScriptSetup(scriptSetup, node) {
		return scriptSetup.range[0] <= node.range[0] && node.range[1] <= scriptSetup.range[1];
	}
	/**
	* @param {ASTNode} node
	*/
	function isDeclareStatement(node) {
		return "declare" in node && node.declare === true;
	}
	/**
	* @param {ASTNode} node
	*/
	function isUseStrictStatement(node) {
		return node.type === "ExpressionStatement" && node.expression.type === "Literal" && node.expression.value === "use strict";
	}
	/**
	* Get an index of the first statement after imports and interfaces in order
	* to place defineEmits and defineProps before this statement
	* @param {VElement} scriptSetup
	* @param {Program} program
	*/
	function getTargetStatementPosition(scriptSetup, program) {
		const skipStatements = /* @__PURE__ */ new Set([
			"ImportDeclaration",
			"TSEnumDeclaration",
			"TSModuleDeclaration",
			"TSInterfaceDeclaration",
			"TSTypeAliasDeclaration",
			"DebuggerStatement",
			"EmptyStatement",
			"ExportNamedDeclaration"
		]);
		for (const [index, item] of program.body.entries()) if (isInScriptSetup(scriptSetup, item) && !skipStatements.has(item.type) && !isDeclareStatement(item) && !isUseStrictStatement(item)) return index;
		return -1;
	}
	/**
	* We need to handle cases like "const props = defineProps(...)"
	* Define macros must be used only on top, so we can look for "Program" type
	* inside node.parent.type
	* @param {CallExpression|ASTNode} node
	* @return {ASTNode}
	*/
	function getDefineMacrosStatement(node) {
		if (!node.parent) throw new Error("Node has no parent");
		if (node.parent.type === "Program") return node;
		return getDefineMacrosStatement(node.parent);
	}
	/** @param {RuleContext} context */
	function create(context) {
		const scriptSetup = utils.getScriptSetupElement(context);
		if (!scriptSetup) return {};
		const options = context.options;
		/** @type {[string, string]} */
		const order = options[0] && options[0].order || DEFAULT_ORDER;
		/** @type {boolean} */
		const defineExposeLast = options[0] && options[0].defineExposeLast || false;
		if (order.includes(MACROS_EXPOSE) && defineExposeLast) throw new Error("`defineExpose` macro can't be in the `order` array if `defineExposeLast` is true.");
		const sourceCode = context.sourceCode;
		/** @type {Map<string, ASTNode[]>} */
		const macrosNodes = /* @__PURE__ */ new Map();
		/** @type {ASTNode} */
		let defineExposeNode;
		return utils.compositingVisitors(utils.defineScriptSetupVisitor(context, {
			onDefinePropsExit(node) {
				macrosNodes.set(MACROS_PROPS, [getDefineMacrosStatement(node)]);
			},
			onDefineEmitsExit(node) {
				macrosNodes.set(MACROS_EMITS, [getDefineMacrosStatement(node)]);
			},
			onDefineOptionsExit(node) {
				macrosNodes.set(MACROS_OPTIONS, [getDefineMacrosStatement(node)]);
			},
			onDefineSlotsExit(node) {
				macrosNodes.set(MACROS_SLOTS, [getDefineMacrosStatement(node)]);
			},
			onDefineModelExit(node) {
				const currentModelMacros = macrosNodes.get(MACROS_MODEL) ?? [];
				currentModelMacros.push(getDefineMacrosStatement(node));
				macrosNodes.set(MACROS_MODEL, currentModelMacros);
			},
			onDefineExposeExit(node) {
				defineExposeNode = getDefineMacrosStatement(node);
			},
			/** @param {CallExpression} node */
			"Program > ExpressionStatement > CallExpression, Program > VariableDeclaration > VariableDeclarator > CallExpression"(node) {
				if (node.callee && node.callee.type === "Identifier" && order.includes(node.callee.name) && !KNOWN_MACROS.has(node.callee.name)) macrosNodes.set(node.callee.name, [getDefineMacrosStatement(node)]);
			}
		}), { "Program:exit"(program) {
			/**
			* @typedef {object} OrderedData
			* @property {string} name
			* @property {ASTNode} node
			*/
			const firstStatementIndex = getTargetStatementPosition(scriptSetup, program);
			const orderedList = order.flatMap((name) => {
				return (macrosNodes.get(name) ?? []).map((node) => ({
					name,
					node
				}));
			}).filter(
				/** @returns {data is OrderedData} */
				(data) => utils.isDef(data.node)
			);
			if (defineExposeLast) {
				const lastNode = program.body.at(-1);
				if (defineExposeNode && lastNode && lastNode !== defineExposeNode) reportExposeNotOnBottom(defineExposeNode, lastNode);
			}
			for (const [index, should] of orderedList.entries()) {
				const targetStatement = program.body[firstStatementIndex + index];
				if (should.node !== targetStatement) {
					let moveTargetNodes = orderedList.slice(index).map(({ node }) => node);
					const targetStatementIndex = moveTargetNodes.indexOf(targetStatement);
					if (targetStatementIndex !== -1) moveTargetNodes = moveTargetNodes.slice(0, targetStatementIndex);
					reportNotOnTop(should.name, moveTargetNodes, targetStatement);
					return;
				}
			}
		} });
		/**
		* @param {string} macro
		* @param {ASTNode[]} nodes
		* @param {ASTNode} before
		*/
		function reportNotOnTop(macro, nodes, before) {
			const beforeMacro = order.find((macroName) => (macrosNodes.get(macroName) ?? []).includes(before));
			const messageId = beforeMacro ? "macrosUnordered" : "macrosNotAtTop";
			const data = {
				macro,
				...beforeMacro ? { before: beforeMacro } : {}
			};
			context.report({
				node: nodes[0],
				loc: nodes[0].loc,
				messageId,
				data,
				*fix(fixer) {
					for (const node of nodes) yield* moveNodeBefore(fixer, node, before);
				}
			});
		}
		/**
		* @param {ASTNode} node
		* @param {ASTNode} lastNode
		*/
		function reportExposeNotOnBottom(node, lastNode) {
			context.report({
				node,
				loc: node.loc,
				messageId: "defineExposeNotTheLast",
				suggest: [{
					messageId: "putExposeAtTheLast",
					fix(fixer) {
						return moveNodeToLast(fixer, node, lastNode);
					}
				}]
			});
		}
		/**
		* Move all lines of "node" with its comments to after the "target"
		* @param {RuleFixer} fixer
		* @param {ASTNode} node
		* @param {ASTNode} target
		*/
		function moveNodeToLast(fixer, node, target) {
			const beforeNodeToken = sourceCode.getTokenBefore(node);
			const nodeComment = sourceCode.getTokenAfter(beforeNodeToken, { includeComments: true });
			const nextNodeComment = sourceCode.getTokenAfter(node, { includeComments: true });
			const cutStart = getLineStartIndex(nodeComment, beforeNodeToken);
			const cutEnd = getLineStartIndex(nextNodeComment, node);
			const textNode = sourceCode.getText(node, node.range[0] - beforeNodeToken.range[1]);
			return [fixer.insertTextAfter(target, textNode), fixer.removeRange([cutStart, cutEnd])];
		}
		/**
		* Move all lines of "node" with its comments to before the "target"
		* @param {RuleFixer} fixer
		* @param {ASTNode} node
		* @param {ASTNode} target
		*/
		function moveNodeBefore(fixer, node, target) {
			const beforeNodeToken = sourceCode.getTokenBefore(node);
			const nodeComment = sourceCode.getTokenAfter(beforeNodeToken, { includeComments: true });
			const nextNodeComment = sourceCode.getTokenAfter(node, { includeComments: true });
			const cutStart = getLineStartIndex(nodeComment, beforeNodeToken);
			const cutEnd = getLineStartIndex(nextNodeComment, node);
			const beforeTargetToken = sourceCode.getTokenBefore(target);
			const targetComment = sourceCode.getTokenAfter(beforeTargetToken, { includeComments: true });
			const insertText = getInsertText(sourceCode.getText(node, node.range[0] - nodeComment.range[0]), target);
			return [fixer.insertTextBefore(targetComment, insertText), fixer.removeRange([cutStart, cutEnd])];
		}
		/**
		* Get result text to insert
		* @param {string} textNode
		* @param {ASTNode} target
		*/
		function getInsertText(textNode, target) {
			const afterTargetComment = sourceCode.getTokenAfter(target, { includeComments: true });
			const afterText = sourceCode.text.slice(target.range[1], afterTargetComment.range[0]);
			const isInvalidResult = !textNode.endsWith(";") && !afterText.includes("\n");
			return textNode + afterText + (isInvalidResult ? ";" : "");
		}
		/**
		* Get position of the beginning of the token's line(or prevToken end if no line)
		* @param {ASTNode|Token} token
		* @param {ASTNode|Token} prevToken
		*/
		function getLineStartIndex(token, prevToken) {
			if (token.loc.start.line === prevToken.loc.end.line) return prevToken.range[1];
			return sourceCode.getIndexFromLoc({
				line: token.loc.start.line,
				column: 0
			});
		}
	}
	module.exports = {
		meta: {
			type: "layout",
			docs: {
				description: "enforce order of compiler macros (`defineProps`, `defineEmits`, etc.)",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/define-macros-order.html"
			},
			fixable: "code",
			hasSuggestions: true,
			schema: [{
				type: "object",
				properties: {
					order: {
						type: "array",
						items: {
							type: "string",
							minLength: 1
						},
						uniqueItems: true,
						additionalItems: false
					},
					defineExposeLast: { type: "boolean" }
				},
				additionalProperties: false
			}],
			messages: {
				macrosNotAtTop: "{{macro}} should be placed at the top of `<script setup>` (after any potential import statements or type definitions).",
				macrosUnordered: "{{macro}} should be above {{before}}.",
				defineExposeNotTheLast: "`defineExpose` should be the last statement in `<script setup>`.",
				putExposeAtTheLast: "Put `defineExpose` as the last statement in `<script setup>`."
			}
		},
		create
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_define_macros_order();
	}
});
9rx*"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/define-props-declaration.js
/**
* @author Amorites
* See LICENSE file in root directory for full license.
*/
var require_define_props_declaration = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "enforce declaration style of `defineProps`",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/define-props-declaration.html"
			},
			fixable: null,
			schema: [{ enum: ["type-based", "runtime"] }],
			messages: {
				hasArg: "Use type-based declaration instead of runtime declaration.",
				hasTypeArg: "Use runtime declaration instead of type-based declaration."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const scriptSetup = utils.getScriptSetupElement(context);
			if (!scriptSetup || !utils.hasAttribute(scriptSetup, "lang", "ts")) return {};
			const defineType = context.options[0] || "type-based";
			return utils.defineScriptSetupVisitor(context, { onDefinePropsEnter(node) {
				switch (defineType) {
					case "type-based":
						if (node.arguments.length > 0) context.report({
							node,
							messageId: "hasArg"
						});
						break;
					case "runtime": {
						const typeArguments = "typeArguments" in node ? node.typeArguments : node.typeParameters;
						if (typeArguments && typeArguments.params.length > 0) context.report({
							node,
							messageId: "hasTypeArg"
						});
						break;
					}
				}
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_define_props_declaration();
	}
});
)Ox"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/define-props-destructuring.js
/**
* @author Wayne Zhang
* See LICENSE file in root directory for full license.
*/
var require_define_props_destructuring = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "enforce consistent style for props destructuring",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/define-props-destructuring.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: { destructure: { enum: [
					"only-when-assigned",
					"always",
					"never"
				] } },
				additionalProperties: false
			}],
			messages: {
				preferDestructuring: "Prefer destructuring from `defineProps` directly.",
				avoidDestructuring: "Avoid destructuring from `defineProps`.",
				avoidWithDefaults: "Avoid using `withDefaults` with destructuring."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const destructurePreference = (context.options[0] || {}).destructure || "only-when-assigned";
			return utils.compositingVisitors(utils.defineScriptSetupVisitor(context, { onDefinePropsEnter(node, props) {
				if (!props.some((prop) => prop.propName || prop.type === "unknown" && prop.node)) return;
				const hasDestructure = utils.isUsingPropsDestructure(node);
				const hasWithDefaults = utils.hasWithDefaults(node);
				const hasAssigned = !!utils.getLeftOfDefineProps(node);
				if (destructurePreference === "never") {
					if (hasDestructure) context.report({
						node,
						messageId: "avoidDestructuring"
					});
					return;
				}
				if (!hasDestructure && (destructurePreference === "always" || hasAssigned)) {
					context.report({
						node,
						messageId: "preferDestructuring"
					});
					return;
				}
				if (hasWithDefaults) context.report({
					node: node.parent.callee,
					messageId: "avoidWithDefaults"
				});
			} }));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_define_props_destructuring();
	}
});
檻"x+"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/dot-location.js
/**
* @author Yosuke Ota
*/
var require_dot_location = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapStylisticOrCoreRule } = require_index.default;
	module.exports = wrapStylisticOrCoreRule("dot-location");
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_dot_location();
	}
});
$xD"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/dot-notation.js
/**
* @author Yosuke Ota
*/
var require_dot_notation = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapStylisticOrCoreRule } = require_index.default;
	module.exports = wrapStylisticOrCoreRule("dot-notation", { applyDocument: true });
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_dot_notation();
	}
});
	x"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/enforce-style-attribute.js
/**
* @author Mussin Benarbia
* See LICENSE file in root directory for full license.
*/
var require_enforce_style_attribute = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { isVElement } = require_index.default;
	/**
	* check whether a tag has the `scoped` attribute
	* @param {VElement} componentBlock
	*/
	function isScoped(componentBlock) {
		return componentBlock.startTag.attributes.some((attribute) => !attribute.directive && attribute.key.name === "scoped");
	}
	/**
	* check whether a tag has the `module` attribute
	* @param {VElement} componentBlock
	*/
	function isModule(componentBlock) {
		return componentBlock.startTag.attributes.some((attribute) => !attribute.directive && attribute.key.name === "module");
	}
	/**
	* check if a tag doesn't have either the `scoped` nor `module` attribute
	* @param {VElement} componentBlock
	*/
	function isPlain(componentBlock) {
		return !isScoped(componentBlock) && !isModule(componentBlock);
	}
	/** @param {RuleContext} context */
	function getUserDefinedAllowedAttrs(context) {
		if (context.options[0] && context.options[0].allow) return context.options[0].allow;
		return [];
	}
	const defaultAllowedAttrs = ["scoped"];
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "enforce or forbid the use of the `scoped` and `module` attributes in SFC top level style tags",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/enforce-style-attribute.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: { allow: {
					type: "array",
					minItems: 1,
					uniqueItems: true,
					items: {
						type: "string",
						enum: [
							"plain",
							"scoped",
							"module"
						]
					}
				} },
				additionalProperties: false
			}],
			messages: {
				notAllowedScoped: "The scoped attribute is not allowed. Allowed: {{ allowedAttrsString }}.",
				notAllowedModule: "The module attribute is not allowed. Allowed: {{ allowedAttrsString }}.",
				notAllowedPlain: "Plain <style> tags are not allowed. Allowed: {{ allowedAttrsString }}."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const sourceCode = context.sourceCode;
			if (!sourceCode.parserServices.getDocumentFragment) return {};
			const documentFragment = sourceCode.parserServices.getDocumentFragment();
			if (!documentFragment) return {};
			const topLevelStyleTags = documentFragment.children.filter(
				/** @returns {element is VElement} */
				(element) => isVElement(element) && element.rawName === "style"
			);
			if (topLevelStyleTags.length === 0) return {};
			const userDefinedAllowedAttrs = getUserDefinedAllowedAttrs(context);
			const allowedAttrs = userDefinedAllowedAttrs.length > 0 ? userDefinedAllowedAttrs : defaultAllowedAttrs;
			const allowsPlain = allowedAttrs.includes("plain");
			const allowsScoped = allowedAttrs.includes("scoped");
			const allowsModule = allowedAttrs.includes("module");
			const allowedAttrsString = [...allowedAttrs].sort((a, b) => a.localeCompare(b)).join(", ");
			return { Program() {
				for (const styleTag of topLevelStyleTags) {
					if (!allowsPlain && isPlain(styleTag)) {
						context.report({
							node: styleTag,
							messageId: "notAllowedPlain",
							data: { allowedAttrsString }
						});
						return;
					}
					if (!allowsScoped && isScoped(styleTag)) {
						context.report({
							node: styleTag,
							messageId: "notAllowedScoped",
							data: { allowedAttrsString }
						});
						return;
					}
					if (!allowsModule && isModule(styleTag)) {
						context.report({
							node: styleTag,
							messageId: "notAllowedModule",
							data: { allowedAttrsString }
						});
						return;
					}
				}
			} };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_enforce_style_attribute();
	}
});
"!x"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/eqeqeq.js
/**
* @author Toru Nagashima
*/
var require_eqeqeq = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapCoreRule } = require_index.default;
	module.exports = wrapCoreRule("eqeqeq", { applyDocument: true });
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_eqeqeq();
	}
});
Exk"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/first-attribute-linebreak.js
/**
* @fileoverview Enforce the location of first attribute
* @author Yosuke Ota
*/
var require_first_attribute_linebreak = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "layout",
			docs: {
				description: "enforce the location of first attribute",
				categories: ["vue3-strongly-recommended", "vue2-strongly-recommended"],
				url: "https://eslint.vuejs.org/rules/first-attribute-linebreak.html"
			},
			fixable: "whitespace",
			schema: [{
				type: "object",
				properties: {
					multiline: { enum: [
						"below",
						"beside",
						"ignore"
					] },
					singleline: { enum: [
						"below",
						"beside",
						"ignore"
					] }
				},
				additionalProperties: false
			}],
			messages: {
				expected: "Expected a linebreak before this attribute.",
				unexpected: "Expected no linebreak before this attribute."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			/** @type {"below" | "beside" | "ignore"} */
			const singleline = context.options[0] && context.options[0].singleline || "ignore";
			/** @type {"below" | "beside" | "ignore"} */
			const multiline = context.options[0] && context.options[0].multiline || "below";
			const sourceCode = context.sourceCode;
			const template = sourceCode.parserServices.getTemplateBodyTokenStore && sourceCode.parserServices.getTemplateBodyTokenStore();
			/**
			* Report attribute
			* @param {VAttribute | VDirective} firstAttribute
			* @param { "below" | "beside"} location
			*/
			function report(firstAttribute, location) {
				context.report({
					node: firstAttribute,
					messageId: location === "beside" ? "unexpected" : "expected",
					fix(fixer) {
						const prevToken = template.getTokenBefore(firstAttribute, { includeComments: true });
						return fixer.replaceTextRange([prevToken.range[1], firstAttribute.range[0]], location === "beside" ? " " : "\n");
					}
				});
			}
			return utils.defineTemplateBodyVisitor(context, { VStartTag(node) {
				const firstAttribute = node.attributes[0];
				const lastAttribute = node.attributes.at(-1);
				if (!firstAttribute || !lastAttribute) return;
				const location = firstAttribute.loc.start.line === lastAttribute.loc.end.line ? singleline : multiline;
				if (location === "ignore") return;
				if (location === "beside") {
					if (node.loc.start.line === firstAttribute.loc.start.line) return;
				} else if (node.loc.start.line < firstAttribute.loc.start.line) return;
				report(firstAttribute, location);
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_first_attribute_linebreak();
	}
});
Q,x7"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/func-call-spacing.js
/**
* @author Yosuke Ota
*/
var require_func_call_spacing = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapStylisticOrCoreRule } = require_index.default;
	module.exports = wrapStylisticOrCoreRule({
		core: "func-call-spacing",
		stylistic: "function-call-spacing",
		vue: "func-call-spacing"
	}, {
		skipDynamicArguments: true,
		applyDocument: true
	});
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_func_call_spacing();
	}
});
x^"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/html-button-has-type.js
/**
* @fileoverview Disallow usage of button without an explicit type attribute
* @author Jonathan Santerre <jonathan@santerre.dev>
*/
var require_html_button_has_type = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	*
	* @param {string} type
	* @returns {type is 'button' | 'submit' | 'reset'}
	*/
	function isButtonType(type) {
		return [
			"button",
			"submit",
			"reset"
		].includes(type);
	}
	const optionDefaults = {
		button: true,
		submit: true,
		reset: true
	};
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow usage of button without an explicit type attribute",
				categories: null,
				url: "https://eslint.vuejs.org/rules/html-button-has-type.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: {
					button: { type: "boolean" },
					submit: { type: "boolean" },
					reset: { type: "boolean" }
				},
				additionalProperties: false
			}],
			messages: {
				missingTypeAttribute: "Missing an explicit type attribute for button.",
				invalidTypeAttribute: "{{value}} is an invalid value for button type attribute.",
				forbiddenTypeAttribute: "{{value}} is a forbidden value for button type attribute.",
				emptyTypeAttribute: "A value must be set for button type attribute."
			}
		},
		/**
		* @param {RuleContext} context - The rule context.
		* @returns {RuleListener} AST event handlers.
		*/
		create(context) {
			/**
			* @typedef {object} Configuration
			* @property {boolean} button
			* @property {boolean} submit
			* @property {boolean} reset
			*/
			/** @type {Configuration} */
			const configuration = Object.assign({}, optionDefaults, context.options[0]);
			/**
			* @param {ASTNode} node
			* @param {string} messageId
			* @param {any} [data]
			*/
			function report(node, messageId, data) {
				context.report({
					node,
					messageId,
					data
				});
			}
			/**
			* @param {VAttribute} attribute
			*/
			function validateAttribute(attribute) {
				const value = attribute.value;
				if (!value || !value.value) {
					report(value || attribute, "emptyTypeAttribute");
					return;
				}
				const strValue = value.value;
				if (!isButtonType(strValue)) report(value, "invalidTypeAttribute", { value: strValue });
				else if (!configuration[strValue]) report(value, "forbiddenTypeAttribute", { value: strValue });
			}
			/**
			* @param {VDirective} directive
			*/
			function validateDirective(directive) {
				const value = directive.value;
				if (!value || !value.expression) report(value || directive, "emptyTypeAttribute");
			}
			return utils.defineTemplateBodyVisitor(context, { 
			/**
			* @param {VElement} node
			*/
"VElement[rawName='button']"(node) {
				const typeAttr = utils.getAttribute(node, "type");
				if (typeAttr) {
					validateAttribute(typeAttr);
					return;
				}
				const typeDir = utils.getDirective(node, "bind", "type");
				if (typeDir) {
					validateDirective(typeDir);
					return;
				}
				report(node.startTag, "missingTypeAttribute");
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_html_button_has_type();
	}
});
[ZJxGconst require_html_comments = require("../utils/html-comments.js");
//#region lib/rules/html-comment-content-newline.ts
function parseOption(param) {
	if (param && typeof param === "string") return {
		singleline: param,
		multiline: param
	};
	return Object.assign({
		singleline: "never",
		multiline: "always"
	}, param);
}
var html_comment_content_newline_default = {
	meta: {
		type: "layout",
		docs: {
			description: "enforce unified line break in HTML comments",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/html-comment-content-newline.html"
		},
		fixable: "whitespace",
		schema: [{ oneOf: [{ enum: ["always", "never"] }, {
			type: "object",
			properties: {
				singleline: { enum: [
					"always",
					"never",
					"ignore"
				] },
				multiline: { enum: [
					"always",
					"never",
					"ignore"
				] }
			},
			additionalProperties: false
		}] }, {
			type: "object",
			properties: { exceptions: {
				type: "array",
				items: { type: "string" }
			} },
			additionalProperties: false
		}],
		messages: {
			expectedAfterHTMLCommentOpen: "Expected line break after '<!--'.",
			expectedBeforeHTMLCommentOpen: "Expected line break before '-->'.",
			expectedAfterExceptionBlock: "Expected line break after exception block.",
			expectedBeforeExceptionBlock: "Expected line break before exception block.",
			unexpectedAfterHTMLCommentOpen: "Unexpected line breaks after '<!--'.",
			unexpectedBeforeHTMLCommentOpen: "Unexpected line breaks before '-->'."
		}
	},
	create(context) {
		const option = parseOption(context.options[0]);
		return require_html_comments.defineVisitor(context, context.options[1], (comment) => {
			const { value, openDecoration, closeDecoration } = comment;
			if (!value) return;
			const newlineType = (openDecoration ? openDecoration.loc.end : value.loc.start).line === (closeDecoration ? closeDecoration.loc.start : value.loc.end).line ? option.singleline : option.multiline;
			if (newlineType === "ignore") return;
			checkCommentOpen(comment, newlineType !== "never");
			checkCommentClose(comment, newlineType !== "never");
		});
		/**
		* Reports the newline before the contents of a given comment if it's invalid.
		*/
		function checkCommentOpen(comment, requiresNewline) {
			const { value, openDecoration, open } = comment;
			if (!value) return;
			const beforeToken = openDecoration || open;
			if (requiresNewline) {
				if (beforeToken.loc.end.line < value.loc.start.line) return;
				context.report({
					loc: {
						start: beforeToken.loc.end,
						end: value.loc.start
					},
					messageId: openDecoration ? "expectedAfterExceptionBlock" : "expectedAfterHTMLCommentOpen",
					fix: openDecoration ? void 0 : (fixer) => fixer.insertTextAfter(beforeToken, "\n")
				});
			} else {
				if (beforeToken.loc.end.line === value.loc.start.line) return;
				context.report({
					loc: {
						start: beforeToken.loc.end,
						end: value.loc.start
					},
					messageId: "unexpectedAfterHTMLCommentOpen",
					fix: (fixer) => fixer.replaceTextRange([beforeToken.range[1], value.range[0]], " ")
				});
			}
		}
		/**
		* Reports the space after the contents of a given comment if it's invalid.
		*/
		function checkCommentClose(comment, requiresNewline) {
			const { value, closeDecoration, close } = comment;
			if (!value) return;
			const afterToken = closeDecoration || close;
			if (requiresNewline) {
				if (value.loc.end.line < afterToken.loc.start.line) return;
				context.report({
					loc: {
						start: value.loc.end,
						end: afterToken.loc.start
					},
					messageId: closeDecoration ? "expectedBeforeExceptionBlock" : "expectedBeforeHTMLCommentOpen",
					fix: closeDecoration ? void 0 : (fixer) => fixer.insertTextBefore(afterToken, "\n")
				});
			} else {
				if (value.loc.end.line === afterToken.loc.start.line) return;
				context.report({
					loc: {
						start: value.loc.end,
						end: afterToken.loc.start
					},
					messageId: "unexpectedBeforeHTMLCommentOpen",
					fix: (fixer) => fixer.replaceTextRange([value.range[1], afterToken.range[0]], " ")
				});
			}
		}
	}
};
//#endregion
exports.default = html_comment_content_newline_default;
5`xgconst require_html_comments = require("../utils/html-comments.js");
//#region lib/rules/html-comment-content-spacing.ts
var html_comment_content_spacing_default = {
	meta: {
		type: "layout",
		docs: {
			description: "enforce unified spacing in HTML comments",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/html-comment-content-spacing.html"
		},
		fixable: "whitespace",
		schema: [{ enum: ["always", "never"] }, {
			type: "object",
			properties: { exceptions: {
				type: "array",
				items: { type: "string" }
			} },
			additionalProperties: false
		}],
		messages: {
			expectedAfterHTMLCommentOpen: "Expected space after '<!--'.",
			expectedBeforeHTMLCommentOpen: "Expected space before '-->'.",
			expectedAfterExceptionBlock: "Expected space after exception block.",
			expectedBeforeExceptionBlock: "Expected space before exception block.",
			unexpectedAfterHTMLCommentOpen: "Unexpected space after '<!--'.",
			unexpectedBeforeHTMLCommentOpen: "Unexpected space before '-->'."
		}
	},
	create(context) {
		const requiresSpace = context.options[0] !== "never";
		return require_html_comments.defineVisitor(context, context.options[1], (comment) => {
			checkCommentOpen(comment);
			checkCommentClose(comment);
		}, { includeDirectives: true });
		/**
		* Reports the space before the contents of a given comment if it's invalid.
		*/
		function checkCommentOpen(comment) {
			const { value, openDecoration, open } = comment;
			if (!value) return;
			const beforeToken = openDecoration || open;
			if (beforeToken.loc.end.line !== value.loc.start.line) return;
			if (requiresSpace) {
				if (beforeToken.range[1] < value.range[0]) return;
				context.report({
					loc: {
						start: beforeToken.loc.end,
						end: value.loc.start
					},
					messageId: openDecoration ? "expectedAfterExceptionBlock" : "expectedAfterHTMLCommentOpen",
					fix: openDecoration ? void 0 : (fixer) => fixer.insertTextAfter(beforeToken, " ")
				});
			} else {
				if (openDecoration) return;
				if (beforeToken.range[1] === value.range[0]) return;
				context.report({
					loc: {
						start: beforeToken.loc.end,
						end: value.loc.start
					},
					messageId: "unexpectedAfterHTMLCommentOpen",
					fix: (fixer) => fixer.removeRange([beforeToken.range[1], value.range[0]])
				});
			}
		}
		/**
		* Reports the space after the contents of a given comment if it's invalid.
		*/
		function checkCommentClose(comment) {
			const { value, closeDecoration, close } = comment;
			if (!value) return;
			const afterToken = closeDecoration || close;
			if (value.loc.end.line !== afterToken.loc.start.line) return;
			if (requiresSpace) {
				if (value.range[1] < afterToken.range[0]) return;
				context.report({
					loc: {
						start: value.loc.end,
						end: afterToken.loc.start
					},
					messageId: closeDecoration ? "expectedBeforeExceptionBlock" : "expectedBeforeHTMLCommentOpen",
					fix: closeDecoration ? void 0 : (fixer) => fixer.insertTextBefore(afterToken, " ")
				});
			} else {
				if (closeDecoration) return;
				if (value.range[1] === afterToken.range[0]) return;
				context.report({
					loc: {
						start: value.loc.end,
						end: afterToken.loc.start
					},
					messageId: "unexpectedBeforeHTMLCommentOpen",
					fix: (fixer) => fixer.removeRange([value.range[1], afterToken.range[0]])
				});
			}
		}
	}
};
//#endregion
exports.default = html_comment_content_spacing_default;
mKx-const require_html_comments = require("../utils/html-comments.js");
//#region lib/rules/html-comment-indent.ts
/**
* @author Yosuke ota
* See LICENSE file in root directory for full license.
*/
function parseOptions(type) {
	const ret = {
		indentChar: " ",
		indentSize: 2,
		indentText: ""
	};
	if (Number.isSafeInteger(type)) ret.indentSize = Number(type);
	else if (type === "tab") {
		ret.indentChar = "	";
		ret.indentSize = 1;
	}
	ret.indentText = ret.indentChar.repeat(ret.indentSize);
	return ret;
}
function toDisplay(s, unitChar) {
	if (s.length === 0 && unitChar) return `0 ${toUnit(unitChar)}s`;
	const char = s[0];
	if ((char === " " || char === "	") && [...s].every((c) => c === char)) return `${s.length} ${toUnit(char)}${s.length === 1 ? "" : "s"}`;
	return JSON.stringify(s);
}
function toUnit(char) {
	if (char === "	") return "tab";
	if (char === " ") return "space";
	return JSON.stringify(char);
}
var html_comment_indent_default = {
	meta: {
		type: "layout",
		docs: {
			description: "enforce consistent indentation in HTML comments",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/html-comment-indent.html"
		},
		fixable: "whitespace",
		schema: [{ oneOf: [{
			type: "integer",
			minimum: 0
		}, { enum: ["tab"] }] }],
		messages: {
			unexpectedBaseIndentation: "Expected base point indentation of {{expected}}, but found {{actual}}.",
			missingBaseIndentation: "Expected base point indentation of {{expected}}, but not found.",
			unexpectedIndentationCharacter: "Expected {{expected}} character, but found {{actual}} character.",
			unexpectedIndentation: "Expected indentation of {{expected}} but found {{actual}}.",
			unexpectedRelativeIndentation: "Expected relative indentation of {{expected}} but found {{actual}}."
		}
	},
	create(context) {
		const options = parseOptions(context.options[0]);
		const sourceCode = context.sourceCode;
		return require_html_comments.defineVisitor(context, null, (comment) => {
			const baseIndentText = getLineIndentText(comment.open.loc.start.line);
			let endLine;
			if (comment.value) {
				const startLine = comment.value.loc.start.line;
				endLine = comment.value.loc.end.line;
				const checkStartLine = comment.open.loc.end.line === startLine ? startLine + 1 : startLine;
				for (let line = checkStartLine; line <= endLine; line++) validateIndentForLine(line, baseIndentText, 1);
			} else endLine = comment.open.loc.end.line;
			if (endLine < comment.close.loc.start.line) validateIndentForLine(comment.close.loc.start.line, baseIndentText, 0);
		}, { includeDirectives: true });
		/**
		* Checks whether the given line is a blank line.
		*
		* @param line The number of line. Begins with 1.
		*/
		function isEmptyLine(line) {
			return !sourceCode.getLines()[line - 1].trim();
		}
		/**
		* Get the actual indentation of the given line.
		*
		* @param line The number of line. Begins with 1.
		*/
		function getLineIndentText(line) {
			const lineText = sourceCode.getLines()[line - 1];
			const charIndex = lineText.search(/\S/);
			return lineText.slice(0, charIndex);
		}
		/**
		* Define the function which fixes the problem.
		*/
		function defineFix(line, actualIndentText, expectedIndentText) {
			return (fixer) => {
				const start = sourceCode.getIndexFromLoc({
					line,
					column: 0
				});
				return fixer.replaceTextRange([start, start + actualIndentText.length], expectedIndentText);
			};
		}
		/**
		* Validate the indentation of a line.
		*
		* @param line The number of line. Begins with 1.
		*/
		function validateIndentForLine(line, baseIndentText, offset) {
			if (isEmptyLine(line)) return;
			const actualIndentText = getLineIndentText(line);
			const expectedOffsetIndentText = options.indentText.repeat(offset);
			const expectedIndentText = baseIndentText + expectedOffsetIndentText;
			if (baseIndentText && (actualIndentText.length < baseIndentText.length || !actualIndentText.startsWith(baseIndentText))) {
				context.report({
					loc: {
						start: {
							line,
							column: 0
						},
						end: {
							line,
							column: actualIndentText.length
						}
					},
					messageId: actualIndentText ? "unexpectedBaseIndentation" : "missingBaseIndentation",
					data: {
						expected: toDisplay(baseIndentText),
						actual: toDisplay(actualIndentText.slice(0, baseIndentText.length))
					},
					fix: defineFix(line, actualIndentText, expectedIndentText)
				});
				return;
			}
			const actualOffsetIndentText = actualIndentText.slice(baseIndentText.length);
			for (const [i, char] of [...actualOffsetIndentText].entries()) if (char !== options.indentChar) {
				context.report({
					loc: {
						start: {
							line,
							column: baseIndentText.length + i
						},
						end: {
							line,
							column: baseIndentText.length + i + 1
						}
					},
					messageId: "unexpectedIndentationCharacter",
					data: {
						expected: toUnit(options.indentChar),
						actual: toUnit(char)
					},
					fix: defineFix(line, actualIndentText, expectedIndentText)
				});
				return;
			}
			if (actualOffsetIndentText.length !== expectedOffsetIndentText.length) context.report({
				loc: {
					start: {
						line,
						column: baseIndentText.length
					},
					end: {
						line,
						column: actualIndentText.length
					}
				},
				messageId: baseIndentText ? "unexpectedRelativeIndentation" : "unexpectedIndentation",
				data: {
					expected: toDisplay(expectedOffsetIndentText, options.indentChar),
					actual: toDisplay(actualOffsetIndentText, options.indentChar)
				},
				fix: defineFix(line, actualIndentText, expectedIndentText)
			});
		}
	}
};
//#endregion
exports.default = html_comment_indent_default;
x1gxs"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/html-end-tags.js
/**
* @author Toru Nagashima
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_html_end_tags = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "enforce end tag style",
				categories: ["vue3-strongly-recommended", "vue2-strongly-recommended"],
				url: "https://eslint.vuejs.org/rules/html-end-tags.html"
			},
			fixable: "code",
			schema: [],
			messages: { missingEndTag: "'<{{name}}>' should have end tag." }
		},
		/** @param {RuleContext} context */
		create(context) {
			let hasInvalidEOF = false;
			return utils.defineTemplateBodyVisitor(context, { VElement(node) {
				if (hasInvalidEOF) return;
				const name = node.name;
				const isVoid = utils.isHtmlVoidElementName(name);
				const isSelfClosing = node.startTag.selfClosing;
				const hasEndTag = node.endTag != null;
				if (!isVoid && !hasEndTag && !isSelfClosing) context.report({
					node: node.startTag,
					loc: node.startTag.loc,
					messageId: "missingEndTag",
					data: { name },
					fix: (fixer) => fixer.insertTextAfter(node, `</${name}>`)
				});
			} }, { Program(node) {
				hasInvalidEOF = utils.hasInvalidEOF(node);
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_html_end_tags();
	}
});
CqxPconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_indent_common = require("../utils/indent-common.js");
//#region lib/rules/html-indent.ts
/**
* @author Toru Nagashima
* @copyright 2016 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
var html_indent_default = {
	create(context) {
		const sourceCode = context.sourceCode;
		const visitor = require_indent_common.defineVisitor(context, sourceCode.parserServices.getTemplateBodyTokenStore && sourceCode.parserServices.getTemplateBodyTokenStore(), { baseIndent: 1 });
		return import_utils.default.defineTemplateBodyVisitor(context, visitor);
	},
	meta: {
		type: "layout",
		docs: {
			description: "enforce consistent indentation in `<template>`",
			categories: ["vue3-strongly-recommended", "vue2-strongly-recommended"],
			url: "https://eslint.vuejs.org/rules/html-indent.html"
		},
		fixable: "whitespace",
		schema: [{ oneOf: [{
			type: "integer",
			minimum: 1
		}, { enum: ["tab"] }] }, {
			type: "object",
			properties: {
				attribute: {
					type: "integer",
					minimum: 0
				},
				baseIndent: {
					type: "integer",
					minimum: 0
				},
				closeBracket: { oneOf: [{
					type: "integer",
					minimum: 0
				}, {
					type: "object",
					properties: {
						startTag: {
							type: "integer",
							minimum: 0
						},
						endTag: {
							type: "integer",
							minimum: 0
						},
						selfClosingTag: {
							type: "integer",
							minimum: 0
						}
					},
					additionalProperties: false
				}] },
				switchCase: {
					type: "integer",
					minimum: 0
				},
				alignAttributesVertically: { type: "boolean" },
				ignores: {
					type: "array",
					items: { allOf: [
						{ type: "string" },
						{ not: {
							type: "string",
							pattern: ":exit$"
						} },
						{ not: {
							type: "string",
							pattern: String.raw`^\s*$`
						} }
					] },
					uniqueItems: true,
					additionalItems: false
				}
			},
			additionalProperties: false
		}]
	}
};
//#endregion
exports.default = html_indent_default;
YexU"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/html-quotes.js
/**
* @author Toru Nagashima
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_html_quotes = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "layout",
			docs: {
				description: "enforce quotes style of HTML attributes",
				categories: ["vue3-strongly-recommended", "vue2-strongly-recommended"],
				url: "https://eslint.vuejs.org/rules/html-quotes.html"
			},
			fixable: "code",
			schema: [{ enum: ["double", "single"] }, {
				type: "object",
				properties: { avoidEscape: { type: "boolean" } },
				additionalProperties: false
			}],
			messages: { expected: "Expected to be enclosed by {{kind}}." }
		},
		/** @param {RuleContext} context */
		create(context) {
			const sourceCode = context.sourceCode;
			const shouldUseDoubleQuotes = context.options[0] !== "single";
			const avoidEscape = context.options[1] && context.options[1].avoidEscape === true;
			const quoteChar = shouldUseDoubleQuotes ? "\"" : "'";
			const quoteName = shouldUseDoubleQuotes ? "double quotes" : "single quotes";
			/** @type {boolean} */
			let hasInvalidEOF;
			return utils.defineTemplateBodyVisitor(context, { "VAttribute[value!=null]"(node) {
				if (hasInvalidEOF) return;
				if (utils.isVBindSameNameShorthand(node)) return;
				const text = sourceCode.getText(node.value);
				const firstChar = text[0];
				if (firstChar !== quoteChar) {
					const isQuoted = firstChar === "'" || firstChar === "\"";
					if (avoidEscape && isQuoted) {
						if (text.slice(1, -1).includes(quoteChar)) return;
					}
					context.report({
						node: node.value,
						loc: node.value.loc,
						messageId: "expected",
						data: { kind: quoteName },
						fix(fixer) {
							const contentText = isQuoted ? text.slice(1, -1) : text;
							let shouldFixToDouble = shouldUseDoubleQuotes;
							if (avoidEscape && !isQuoted && contentText.includes(quoteChar)) shouldFixToDouble = shouldUseDoubleQuotes ? contentText.includes("'") : !contentText.includes("\"");
							const quotePattern = shouldFixToDouble ? /"/g : /'/g;
							const quoteEscaped = shouldFixToDouble ? "&quot;" : "&apos;";
							const fixQuoteChar = shouldFixToDouble ? "\"" : "'";
							const replacement = fixQuoteChar + contentText.replace(quotePattern, () => quoteEscaped) + fixQuoteChar;
							return fixer.replaceText(node.value, replacement);
						}
					});
				}
			} }, { Program(node) {
				hasInvalidEOF = utils.hasInvalidEOF(node);
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_html_quotes();
	}
});
廟xconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/html-self-closing.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
/**
* These strings wil be displayed in error messages.
*/
const ELEMENT_TYPE_MESSAGES = Object.freeze({
	NORMAL: "HTML elements",
	VOID: "HTML void elements",
	COMPONENT: "Vue.js custom components",
	SVG: "SVG elements",
	MATH: "MathML elements",
	UNKNOWN: "unknown elements"
});
/**
* Normalize the given options.
*/
function parseOptions(options) {
	return {
		NORMAL: options && options.html && options.html.normal || "always",
		VOID: options && options.html && options.html.void || "never",
		COMPONENT: options && options.html && options.html.component || "always",
		SVG: options && options.svg || "always",
		MATH: options && options.math || "always",
		UNKNOWN: null
	};
}
/**
* Get the elementType of the given element.
*/
function getElementType(node) {
	if (import_utils.default.isCustomComponent(node)) return "COMPONENT";
	if (import_utils.default.isHtmlElementNode(node)) {
		if (import_utils.default.isHtmlVoidElementName(node.name)) return "VOID";
		return "NORMAL";
	}
	if (import_utils.default.isSvgElementNode(node)) return "SVG";
	if (import_utils.default.isMathElementNode(node)) return "MATH";
	return "UNKNOWN";
}
/**
* Check whether the given element is empty or not.
* This ignores whitespaces, doesn't ignore comments.
*/
function isEmpty(node, sourceCode) {
	const start = node.startTag.range[1];
	const end = node.endTag == null ? node.range[1] : node.endTag.range[0];
	return sourceCode.text.slice(start, end).trim() === "";
}
var html_self_closing_default = {
	meta: {
		type: "layout",
		docs: {
			description: "enforce self-closing style",
			categories: ["vue3-strongly-recommended", "vue2-strongly-recommended"],
			url: "https://eslint.vuejs.org/rules/html-self-closing.html"
		},
		fixable: "code",
		schema: {
			definitions: { optionValue: { enum: [
				"always",
				"never",
				"any"
			] } },
			type: "array",
			items: [{
				type: "object",
				properties: {
					html: {
						type: "object",
						properties: {
							normal: { $ref: "#/definitions/optionValue" },
							void: { $ref: "#/definitions/optionValue" },
							component: { $ref: "#/definitions/optionValue" }
						},
						additionalProperties: false
					},
					svg: { $ref: "#/definitions/optionValue" },
					math: { $ref: "#/definitions/optionValue" }
				},
				additionalProperties: false
			}],
			maxItems: 1
		},
		messages: {
			requireSelfClosing: "Require self-closing on {{elementType}} (<{{name}}>).",
			disallowSelfClosing: "Disallow self-closing on {{elementType}} (<{{name}}/>)."
		}
	},
	create(context) {
		const sourceCode = context.sourceCode;
		const options = parseOptions(context.options[0]);
		let hasInvalidEOF = false;
		return import_utils.default.defineTemplateBodyVisitor(context, { VElement(node) {
			if (hasInvalidEOF || node.parent.type === "VDocumentFragment") return;
			const elementType = getElementType(node);
			const mode = options[elementType];
			if (mode === "always" && !node.startTag.selfClosing && isEmpty(node, sourceCode)) context.report({
				node: node.endTag || node,
				messageId: "requireSelfClosing",
				data: {
					elementType: ELEMENT_TYPE_MESSAGES[elementType],
					name: node.rawName
				},
				fix(fixer) {
					const close = sourceCode.parserServices.getTemplateBodyTokenStore().getLastToken(node.startTag);
					if (close.type !== "HTMLTagClose") return null;
					return fixer.replaceTextRange([close.range[0], node.range[1]], "/>");
				}
			});
			if (mode === "never" && node.startTag.selfClosing) context.report({
				node,
				loc: {
					start: {
						line: node.loc.end.line,
						column: node.loc.end.column - 2
					},
					end: node.loc.end
				},
				messageId: "disallowSelfClosing",
				data: {
					elementType: ELEMENT_TYPE_MESSAGES[elementType],
					name: node.rawName
				},
				fix(fixer) {
					const close = sourceCode.parserServices.getTemplateBodyTokenStore().getLastToken(node.startTag);
					if (close.type !== "HTMLSelfClosingTagClose") return null;
					if (elementType === "VOID") return fixer.replaceText(close, ">");
					const elementPart = sourceCode.text.slice(node.range[0], close.range[0]);
					return fixer.replaceText(node, `${elementPart}></${node.rawName}>`);
				}
			});
		} }, { Program(node) {
			hasInvalidEOF = import_utils.default.hasInvalidEOF(node);
		} });
	}
};
//#endregion
exports.default = html_self_closing_default;
Ux
"use strict";
//#region lib/rules/jsx-uses-vars.js
/**
The MIT License (MIT)

Copyright (c) 2014 Yannick Croissant

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
/**
* @fileoverview Prevent variables used in JSX to be marked as unused
* @author Yannick Croissant
*/
var require_jsx_uses_vars = /* @__PURE__ */ require("../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "prevent variables used in JSX to be marked as unused",
				categories: ["base"],
				url: "https://eslint.vuejs.org/rules/jsx-uses-vars.html"
			},
			schema: []
		},
		/**
		* @param {RuleContext} context - The rule context.
		* @returns {RuleListener} AST event handlers.
		*/
		create(context) {
			return { JSXOpeningElement(node) {
				let name;
				if (node.name.type === "JSXIdentifier") name = node.name.name;
				else if (node.name.type === "JSXMemberExpression") {
					let parent = node.name.object;
					while (parent.type === "JSXMemberExpression") parent = parent.object;
					name = parent.name;
				} else return;
				context.sourceCode.markVariableAsUsed(name, node);
			} };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_jsx_uses_vars();
	}
});
ܠ$xK"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/key-spacing.js
/**
* @author Toru Nagashima
*/
var require_key_spacing = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapStylisticOrCoreRule } = require_index.default;
	module.exports = wrapStylisticOrCoreRule("key-spacing", { skipDynamicArguments: true });
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_key_spacing();
	}
});
uO%xW"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/keyword-spacing.js
/**
* @author Yosuke Ota
*/
var require_keyword_spacing = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapStylisticOrCoreRule } = require_index.default;
	module.exports = wrapStylisticOrCoreRule("keyword-spacing", { skipDynamicArguments: true });
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_keyword_spacing();
	}
});
UѰxconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
let node_path = require("node:path");
node_path = require_runtime.__toESM(node_path);
//#region lib/rules/match-component-file-name.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
function canVerify(node) {
	return node.type === "Literal" || node.type === "TemplateLiteral" && node.expressions.length === 0 && node.quasis.length === 1;
}
var match_component_file_name_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "require component name property to match its file name",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/match-component-file-name.html"
		},
		fixable: null,
		hasSuggestions: true,
		schema: [{
			type: "object",
			properties: {
				extensions: {
					type: "array",
					items: { type: "string" },
					uniqueItems: true,
					additionalItems: false
				},
				shouldMatchCase: { type: "boolean" }
			},
			additionalProperties: false
		}],
		messages: { shouldMatchFileName: "Component name `{{name}}` should match file name `{{filename}}`." }
	},
	create(context) {
		const options = context.options[0];
		const shouldMatchCase = options && options.shouldMatchCase || false;
		const extensionsArray = options && options.extensions;
		const allowedExtensions = Array.isArray(extensionsArray) ? extensionsArray : ["jsx"];
		const extension = node_path.default.extname(context.filename);
		if (!allowedExtensions.includes(extension.replace(/^\./, ""))) return {};
		const filename = node_path.default.basename(context.filename, extension);
		const errors = [];
		let componentCount = 0;
		function compareNames(name, filename) {
			if (shouldMatchCase) return name === filename;
			return require_casing.pascalCase(name) === filename || require_casing.kebabCase(name) === filename;
		}
		function verifyName(node) {
			let name;
			if (node.type === "TemplateLiteral") name = node.quasis[0].value.cooked;
			else name = String(node.value);
			if (!compareNames(name, filename)) errors.push({
				node,
				messageId: "shouldMatchFileName",
				data: {
					filename,
					name
				},
				suggest: [{
					desc: "Rename component to match file name.",
					fix(fixer) {
						const quote = node.type === "TemplateLiteral" ? "`" : node.raw[0];
						return fixer.replaceText(node, `${quote}${filename}${quote}`);
					}
				}]
			});
		}
		return import_utils.default.compositingVisitors(import_utils.default.executeOnCallVueComponent(context, (node) => {
			if (node.arguments.length !== 2) return;
			const argument = node.arguments[0];
			if (canVerify(argument)) verifyName(argument);
		}), import_utils.default.executeOnVue(context, (object) => {
			const node = import_utils.default.findProperty(object, "name");
			componentCount++;
			if (!node) return;
			if (!canVerify(node.value)) return;
			verifyName(node.value);
		}), import_utils.default.defineScriptSetupVisitor(context, { onDefineOptionsEnter(node) {
			componentCount++;
			if (node.arguments.length === 0) return;
			const define = node.arguments[0];
			if (define.type !== "ObjectExpression") return;
			const nameNode = import_utils.default.findProperty(define, "name");
			if (!nameNode) return;
			if (!canVerify(nameNode.value)) return;
			verifyName(nameNode.value);
		} }), { "Program:exit"() {
			if (componentCount > 1) return;
			for (const error of errors) context.report(error);
		} });
	}
};
//#endregion
exports.default = match_component_file_name_default;
-үlx1const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
//#region lib/rules/match-component-import-name.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
function getExpectedNames(identifier) {
	return [require_casing.pascalCase(identifier.name), require_casing.kebabCase(identifier.name)];
}
var match_component_import_name_default = {
	meta: {
		type: "problem",
		docs: {
			description: "require the registered component name to match the imported component name",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/match-component-import-name.html"
		},
		fixable: null,
		schema: [],
		messages: { unexpected: "Component alias {{importedName}} should be one of: {{expectedName}}." }
	},
	create(context) {
		return import_utils.default.executeOnVueComponent(context, (obj) => {
			const components = import_utils.default.findProperty(obj, "components");
			if (!components || !components.value || components.value.type !== "ObjectExpression") return;
			for (const property of components.value.properties) {
				if (property.type === "SpreadElement" || property.value.type !== "Identifier" || property.computed === true) continue;
				const importedName = import_utils.default.getStaticPropertyName(property) || "";
				const expectedNames = getExpectedNames(property.value);
				if (!expectedNames.includes(importedName)) context.report({
					node: property,
					messageId: "unexpected",
					data: {
						importedName,
						expectedName: expectedNames.join(", ")
					}
				});
			}
		});
	}
};
//#endregion
exports.default = match_component_import_name_default;
$Vx"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/max-attributes-per-line.js
/**
* @fileoverview Define the number of attributes allows per line
* @author Filipa Lacerda
*/
var require_max_attributes_per_line = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @param {any} options
	*/
	function parseOptions(options) {
		const defaults = {
			singleline: 1,
			multiline: 1
		};
		if (options) {
			if (typeof options.singleline === "number") defaults.singleline = options.singleline;
			else if (typeof options.singleline === "object" && typeof options.singleline.max === "number") defaults.singleline = options.singleline.max;
			if (options.multiline) {
				if (typeof options.multiline === "number") defaults.multiline = options.multiline;
				else if (typeof options.multiline === "object" && typeof options.multiline.max === "number") defaults.multiline = options.multiline.max;
			}
		}
		return defaults;
	}
	/**
	* @param {(VDirective | VAttribute)[]} attributes
	*/
	function groupAttrsByLine(attributes) {
		const propsPerLine = [[attributes[0]]];
		for (let index = 1; index < attributes.length; index++) {
			const previous = attributes[index - 1];
			const current = attributes[index];
			if (previous.loc.end.line === current.loc.start.line) propsPerLine.at(-1).push(current);
			else propsPerLine.push([current]);
		}
		return propsPerLine;
	}
	module.exports = {
		meta: {
			type: "layout",
			docs: {
				description: "enforce the maximum number of attributes per line",
				categories: ["vue3-strongly-recommended", "vue2-strongly-recommended"],
				url: "https://eslint.vuejs.org/rules/max-attributes-per-line.html"
			},
			fixable: "whitespace",
			schema: [{
				type: "object",
				properties: {
					singleline: { oneOf: [{
						type: "number",
						minimum: 1
					}, {
						type: "object",
						properties: { max: {
							type: "number",
							minimum: 1
						} },
						additionalProperties: false
					}] },
					multiline: { oneOf: [{
						type: "number",
						minimum: 1
					}, {
						type: "object",
						properties: { max: {
							type: "number",
							minimum: 1
						} },
						additionalProperties: false
					}] }
				},
				additionalProperties: false
			}],
			messages: { shouldBeOnNewLine: "'{{name}}' should be on a new line." }
		},
		/** @param {RuleContext} context */
		create(context) {
			const sourceCode = context.sourceCode;
			const configuration = parseOptions(context.options[0]);
			const multilineMaximum = configuration.multiline;
			const singlelinemMaximum = configuration.singleline;
			const template = sourceCode.parserServices.getTemplateBodyTokenStore && sourceCode.parserServices.getTemplateBodyTokenStore();
			return utils.defineTemplateBodyVisitor(context, { VStartTag(node) {
				const numberOfAttributes = node.attributes.length;
				if (!numberOfAttributes) return;
				if (utils.isSingleLine(node) && numberOfAttributes > singlelinemMaximum) showErrors(node.attributes.slice(singlelinemMaximum));
				if (!utils.isSingleLine(node)) {
					for (const attrs of groupAttrsByLine(node.attributes)) if (attrs.length > multilineMaximum) showErrors(attrs.splice(multilineMaximum));
				}
			} });
			/**
			* @param {(VDirective | VAttribute)[]} attributes
			*/
			function showErrors(attributes) {
				for (const [i, prop] of attributes.entries()) context.report({
					node: prop,
					loc: prop.loc,
					messageId: "shouldBeOnNewLine",
					data: { name: sourceCode.getText(prop.key) },
					fix(fixer) {
						if (i !== 0) return null;
						/** @type {Range} */
						const range = [template.getTokenBefore(prop, { filter: (token) => token.type !== "HTMLWhitespace" }).range[1], prop.range[0]];
						return fixer.replaceTextRange(range, "\n");
					}
				});
			}
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_max_attributes_per_line();
	}
});
(VxO2"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/max-len.js
/**
* @author Yosuke Ota
* @fileoverview Rule to check for max length on a line of Vue file.
*/
var require_max_len = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const OPTIONS_SCHEMA = {
		type: "object",
		properties: {
			code: {
				type: "integer",
				minimum: 0
			},
			template: {
				type: "integer",
				minimum: 0
			},
			comments: {
				type: "integer",
				minimum: 0
			},
			tabWidth: {
				type: "integer",
				minimum: 0
			},
			ignorePattern: { type: "string" },
			ignoreComments: { type: "boolean" },
			ignoreTrailingComments: { type: "boolean" },
			ignoreUrls: { type: "boolean" },
			ignoreStrings: { type: "boolean" },
			ignoreTemplateLiterals: { type: "boolean" },
			ignoreRegExpLiterals: { type: "boolean" },
			ignoreHTMLAttributeValues: { type: "boolean" },
			ignoreHTMLTextContents: { type: "boolean" }
		},
		additionalProperties: false
	};
	const OPTIONS_OR_INTEGER_SCHEMA = { oneOf: [OPTIONS_SCHEMA, {
		type: "integer",
		minimum: 0
	}] };
	/**
	* Computes the length of a line that may contain tabs. The width of each
	* tab will be the number of spaces to the next tab stop.
	* @param {string} line The line.
	* @param {number} tabWidth The width of each tab stop in spaces.
	* @returns {number} The computed line length.
	* @private
	*/
	function computeLineLength(line, tabWidth) {
		let extraCharacterCount = 0;
		const re = /\t/gu;
		let ret;
		while (ret = re.exec(line)) {
			const totalOffset = ret.index + extraCharacterCount;
			const spaceCount = tabWidth - (tabWidth ? totalOffset % tabWidth : 0);
			extraCharacterCount += spaceCount - 1;
		}
		return [...line].length + extraCharacterCount;
	}
	/**
	* Tells if a given comment is trailing: it starts on the current line and
	* extends to or past the end of the current line.
	* @param {string} line The source line we want to check for a trailing comment on
	* @param {number} lineNumber The one-indexed line number for line
	* @param {Token | null} comment The comment to inspect
	* @returns {comment is Token} If the comment is trailing on the given line
	*/
	function isTrailingComment(line, lineNumber, comment) {
		return Boolean(comment && comment.loc.start.line === lineNumber && lineNumber <= comment.loc.end.line && (comment.loc.end.line > lineNumber || comment.loc.end.column === line.length));
	}
	/**
	* Tells if a comment encompasses the entire line.
	* @param {string} line The source line with a trailing comment
	* @param {number} lineNumber The one-indexed line number this is on
	* @param {Token | null} comment The comment to remove
	* @returns {boolean} If the comment covers the entire line
	*/
	function isFullLineComment(line, lineNumber, comment) {
		if (!comment) return false;
		const start = comment.loc.start;
		const end = comment.loc.end;
		const isFirstTokenOnLine = !line.slice(0, comment.loc.start.column).trim();
		return comment && (start.line < lineNumber || start.line === lineNumber && isFirstTokenOnLine) && (end.line > lineNumber || end.line === lineNumber && end.column === line.length);
	}
	/**
	* Gets the line after the comment and any remaining trailing whitespace is
	* stripped.
	* @param {string} line The source line with a trailing comment
	* @param {Token} comment The comment to remove
	* @returns {string} Line without comment and trailing whitepace
	*/
	function stripTrailingComment(line, comment) {
		return line.slice(0, comment.loc.start.column).replace(/\s+$/u, "");
	}
	/**
	* Group AST nodes by line number, both start and end.
	*
	* @param {Token[]} nodes the AST nodes in question
	* @returns { { [key: number]: Token[] } } the grouped nodes
	* @private
	*/
	function groupByLineNumber(nodes) {
		/** @type { { [key: number]: Token[] } } */
		const grouped = {};
		for (const node of nodes) for (let i = node.loc.start.line; i <= node.loc.end.line; ++i) {
			if (!Array.isArray(grouped[i])) grouped[i] = [];
			grouped[i].push(node);
		}
		return grouped;
	}
	module.exports = {
		meta: {
			type: "layout",
			docs: {
				description: "enforce a maximum line length in `.vue` files",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/max-len.html",
				extensionSource: {
					url: "https://eslint.org/docs/rules/max-len",
					name: "ESLint core"
				}
			},
			schema: [
				OPTIONS_OR_INTEGER_SCHEMA,
				OPTIONS_OR_INTEGER_SCHEMA,
				OPTIONS_SCHEMA
			],
			messages: {
				max: "This line has a length of {{lineLength}}. Maximum allowed is {{maxLength}}.",
				maxComment: "This line has a comment length of {{lineLength}}. Maximum allowed is {{maxCommentLength}}."
			}
		},
		/**
		* @param {RuleContext} context - The rule context.
		* @returns {RuleListener} AST event handlers.
		*/
		create(context) {
			const URL_REGEXP = /[^:/?#]:\/\/[^?#]/u;
			const sourceCode = context.sourceCode;
			/** @type {Token[]} */
			const tokens = [];
			/** @type {(HTMLComment | HTMLBogusComment | Comment)[]} */
			const comments = [];
			/** @type {VLiteral[]} */
			const htmlAttributeValues = [];
			const options = Object.assign({}, context.options.at(-1));
			if (typeof context.options[0] === "number") options.code = context.options[0];
			if (typeof context.options[1] === "number") options.tabWidth = context.options[1];
			/** @type {number} */
			const scriptMaxLength = typeof options.code === "number" ? options.code : 80;
			/** @type {number} */
			const tabWidth = typeof options.tabWidth === "number" ? options.tabWidth : 2;
			/** @type {number} */
			const templateMaxLength = typeof options.template === "number" ? options.template : scriptMaxLength;
			const shouldIgnoreComments = !!options.ignoreComments;
			const shouldIgnoreStrings = !!options.ignoreStrings;
			const shouldIgnoreTemplateLiterals = !!options.ignoreTemplateLiterals;
			const shouldIgnoreRegExpLiterals = !!options.ignoreRegExpLiterals;
			const shouldIgnoreTrailingComments = !!options.ignoreTrailingComments || !!options.ignoreComments;
			const shouldIgnoreUrls = !!options.ignoreUrls;
			const shouldIgnoreHTMLAttributeValues = !!options.ignoreHTMLAttributeValues;
			const shouldIgnoreHTMLTextContents = !!options.ignoreHTMLTextContents;
			/** @type {number} */
			const maxCommentLength = options.comments;
			/** @type {RegExp} */
			let ignorePattern = options.ignorePattern || null;
			if (ignorePattern) ignorePattern = new RegExp(ignorePattern, "u");
			/**
			* Retrieves an array containing all strings (" or ') in the source code.
			*
			* @returns {Token[]} An array of string nodes.
			*/
			function getAllStrings() {
				return tokens.filter((token) => token.type === "String" || token.type === "JSXText" && sourceCode.getNodeByRangeIndex(token.range[0] - 1).type === "JSXAttribute");
			}
			/**
			* Retrieves an array containing all template literals in the source code.
			*
			* @returns {Token[]} An array of template literal nodes.
			*/
			function getAllTemplateLiterals() {
				return tokens.filter((token) => token.type === "Template");
			}
			/**
			* Retrieves an array containing all RegExp literals in the source code.
			*
			* @returns {Token[]} An array of RegExp literal nodes.
			*/
			function getAllRegExpLiterals() {
				return tokens.filter((token) => token.type === "RegularExpression");
			}
			/**
			* Retrieves an array containing all HTML texts in the source code.
			*
			* @returns {Token[]} An array of HTML text nodes.
			*/
			function getAllHTMLTextContents() {
				return tokens.filter((token) => token.type === "HTMLText");
			}
			/**
			* Check the program for max length
			* @param {Program} node Node to examine
			* @returns {void}
			* @private
			*/
			function checkProgramForMaxLength(node) {
				const programNode = node;
				const templateBody = node.templateBody;
				const scriptTokens = sourceCode.ast.tokens;
				const scriptComments = sourceCode.getAllComments();
				if (sourceCode.parserServices.getTemplateBodyTokenStore && templateBody) {
					const templateTokens = sourceCode.parserServices.getTemplateBodyTokenStore().getTokens(templateBody, { includeComments: true });
					if (templateBody.range[0] < programNode.range[0]) tokens.push(...templateTokens, ...scriptTokens);
					else tokens.push(...scriptTokens, ...templateTokens);
				} else tokens.push(...scriptTokens);
				if (shouldIgnoreComments || maxCommentLength || shouldIgnoreTrailingComments) if (templateBody) if (templateBody.range[0] < programNode.range[0]) comments.push(...templateBody.comments, ...scriptComments);
				else comments.push(...scriptComments, ...templateBody.comments);
				else comments.push(...scriptComments);
				/** @type {Range | undefined} */
				let scriptLinesRange;
				if (scriptTokens.length > 0) scriptLinesRange = scriptComments.length > 0 ? [Math.min(scriptTokens[0].loc.start.line, scriptComments[0].loc.start.line), Math.max(
					/** @type {Token} */
					scriptTokens.at(-1).loc.end.line,
					/** @type {Comment} */
					scriptComments.at(-1).loc.end.line
				)] : [scriptTokens[0].loc.start.line, scriptTokens.at(-1).loc.end.line];
				else if (scriptComments.length > 0) scriptLinesRange = [scriptComments[0].loc.start.line, scriptComments.at(-1).loc.end.line];
				const templateLinesRange = templateBody && [templateBody.loc.start.line, templateBody.loc.end.line];
				const lines = sourceCode.lines;
				const stringsByLine = groupByLineNumber(getAllStrings());
				const templateLiteralsByLine = groupByLineNumber(getAllTemplateLiterals());
				const regExpLiteralsByLine = groupByLineNumber(getAllRegExpLiterals());
				const htmlAttributeValuesByLine = groupByLineNumber(htmlAttributeValues);
				const htmlTextContentsByLine = groupByLineNumber(getAllHTMLTextContents());
				const commentsByLine = groupByLineNumber(comments);
				for (const [i, line] of lines.entries()) {
					const lineNumber = i + 1;
					const inScript = scriptLinesRange && scriptLinesRange[0] <= lineNumber && lineNumber <= scriptLinesRange[1];
					const inTemplate = templateLinesRange && templateLinesRange[0] <= lineNumber && lineNumber <= templateLinesRange[1];
					if (!inScript && !inTemplate) continue;
					if (shouldIgnoreStrings && stringsByLine[lineNumber] || shouldIgnoreTemplateLiterals && templateLiteralsByLine[lineNumber] || shouldIgnoreRegExpLiterals && regExpLiteralsByLine[lineNumber] || shouldIgnoreHTMLAttributeValues && htmlAttributeValuesByLine[lineNumber] || shouldIgnoreHTMLTextContents && htmlTextContentsByLine[lineNumber]) continue;
					let isCommentLine = false;
					let textToMeasure;
					if (commentsByLine[lineNumber]) {
						const commentList = [...commentsByLine[lineNumber]];
						let comment = commentList.pop() || null;
						if (isFullLineComment(line, lineNumber, comment)) {
							isCommentLine = true;
							textToMeasure = line;
						} else if (shouldIgnoreTrailingComments && isTrailingComment(line, lineNumber, comment)) {
							textToMeasure = stripTrailingComment(line, comment);
							comment = commentList.pop() || null;
							while (isTrailingComment(textToMeasure, lineNumber, comment)) textToMeasure = stripTrailingComment(textToMeasure, comment);
						} else textToMeasure = line;
					} else textToMeasure = line;
					if (ignorePattern && ignorePattern.test(textToMeasure) || shouldIgnoreUrls && URL_REGEXP.test(textToMeasure) || isCommentLine && shouldIgnoreComments) continue;
					const maxLength = Math.max(inScript ? scriptMaxLength : 0, inTemplate ? templateMaxLength : 0);
					const lineLength = computeLineLength(textToMeasure, tabWidth);
					if (isCommentLine && maxCommentLength) {
						if (lineLength > maxCommentLength) context.report({
							node,
							loc: {
								start: {
									line: lineNumber,
									column: maxCommentLength
								},
								end: {
									line: lineNumber,
									column: lineLength
								}
							},
							messageId: "maxComment",
							data: {
								lineLength,
								maxCommentLength
							}
						});
					} else if (lineLength > maxLength) context.report({
						node,
						loc: {
							start: {
								line: lineNumber,
								column: maxLength
							},
							end: {
								line: lineNumber,
								column: lineLength
							}
						},
						messageId: "max",
						data: {
							lineLength,
							maxLength
						}
					});
				}
			}
			return utils.compositingVisitors(utils.defineTemplateBodyVisitor(context, { 
			/** @param {VLiteral} node */
"VAttribute[directive=false] > VLiteral"(node) {
				htmlAttributeValues.push(node);
			} }), { "Program:exit"(node) {
				checkProgramForMaxLength(node);
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_max_len();
	}
});
DW˹xI
"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/max-lines-per-block.js
/**
* @author lsdsjy
* @fileoverview Rule for checking the maximum number of lines in Vue SFC blocks.
*/
var require_max_lines_per_block = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { SourceCode } = require("eslint");
	const utils = require_index.default;
	/**
	* @param {string} text
	*/
	function isEmptyLine(text) {
		return !text.trim();
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce maximum number of lines in Vue SFC blocks",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/max-lines-per-block.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: {
					style: {
						type: "integer",
						minimum: 1
					},
					template: {
						type: "integer",
						minimum: 1
					},
					script: {
						type: "integer",
						minimum: 1
					},
					skipBlankLines: {
						type: "boolean",
						minimum: 0
					}
				},
				additionalProperties: false
			}],
			messages: { tooManyLines: "Block has too many lines ({{lineCount}}). Maximum allowed is {{limit}}." }
		},
		/** @param {RuleContext} context */
		create(context) {
			const option = context.options[0] || {};
			/**
			* @type {Record<string, number>}
			*/
			const limits = {
				template: option.template,
				script: option.script,
				style: option.style
			};
			const sourceCode = context.sourceCode;
			const documentFragment = sourceCode.parserServices.getDocumentFragment && sourceCode.parserServices.getDocumentFragment();
			function getTopLevelHTMLElements() {
				if (documentFragment) return documentFragment.children.filter(utils.isVElement);
				return [];
			}
			return { 
			/** @param {Program} node */
Program(node) {
				if (utils.hasInvalidEOF(node)) return;
				for (const block of getTopLevelHTMLElements()) {
					if (!limits[block.name]) continue;
					let lineCount = block.loc.end.line - block.loc.start.line - 1;
					if (option.skipBlankLines) {
						const lines = SourceCode.splitLines(sourceCode.getText(block));
						lineCount -= lines.filter(isEmptyLine).length;
					}
					if (lineCount > limits[block.name]) context.report({
						node: block,
						messageId: "tooManyLines",
						data: {
							limit: limits[block.name],
							lineCount
						}
					});
				}
			} };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_max_lines_per_block();
	}
});
n5xD"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/max-props.js
/**
* @author kevsommer Kevin Sommer
* See LICENSE file in root directory for full license.
*/
var require_max_props = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce maximum number of props in Vue component",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/max-props.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: { maxProps: {
					type: "integer",
					minimum: 1
				} },
				additionalProperties: false,
				minProperties: 1
			}],
			messages: { tooManyProps: "Component has too many props ({{propCount}}). Maximum allowed is {{limit}}." }
		},
		/** @param {RuleContext} context */
		create(context) {
			/** @type {Record<string, number>} */
			const option = context.options[0] || {};
			/**
			* @param {import('../utils').ComponentProp[]} props
			* @param {CallExpression | Property} node
			*/
			function checkMaxNumberOfProps(props, node) {
				const propCount = new Set(props.map((prop) => prop.propName)).size;
				if (propCount > option.maxProps && props[0].node) context.report({
					node,
					messageId: "tooManyProps",
					data: {
						propCount,
						limit: option.maxProps
					}
				});
			}
			return utils.compositingVisitors(utils.executeOnVue(context, (node) => {
				const propsNode = node.properties.find(
					/** @returns {p is Property} */
					(p) => p.type === "Property" && utils.getStaticPropertyName(p) === "props"
				);
				if (!propsNode) return;
				checkMaxNumberOfProps(utils.getComponentPropsFromOptions(node), propsNode);
			}), utils.defineScriptSetupVisitor(context, { onDefinePropsEnter(node, props) {
				checkMaxNumberOfProps(props, node);
			} }));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_max_props();
	}
});
Щ0mx."use strict";
//#region lib/rules/max-template-depth.js
/**
* @author kevsommer Kevin Sommer
* See LICENSE file in root directory for full license.
*/
var require_max_template_depth = /* @__PURE__ */ require("../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce maximum depth of template",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/max-template-depth.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: { maxDepth: {
					type: "integer",
					minimum: 1
				} },
				additionalProperties: false,
				minProperties: 1
			}],
			messages: { templateTooDeep: "Element is nested too deeply (depth of {{depth}}, maximum allowed is {{limit}})." }
		},
		/** @param {RuleContext} context */
		create(context) {
			const option = context.options[0] || {};
			/**
			* @param {VElement} element
			* @param {number} curDepth
			*/
			function checkMaxDepth(element, curDepth) {
				if (curDepth > option.maxDepth) context.report({
					node: element,
					messageId: "templateTooDeep",
					data: {
						depth: curDepth,
						limit: option.maxDepth
					}
				});
				if (!element.children) return;
				for (const child of element.children) if (child.type === "VElement") checkMaxDepth(child, curDepth + 1);
			}
			return { 
			/** @param {Program} program */
Program(program) {
				const element = program.templateBody;
				if (element == null) return;
				if (element.type !== "VElement") return;
				checkMaxDepth(element, 0);
			} };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_max_template_depth();
	}
});
^$xQconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
let node_path = require("node:path");
node_path = require_runtime.__toESM(node_path);
//#region lib/rules/multi-word-component-names.ts
/**
* @author Marton Csordas
* See LICENSE file in root directory for full license.
*/
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
var multi_word_component_names_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "require component names to be always multi-word",
			categories: ["vue3-essential", "vue2-essential"],
			url: "https://eslint.vuejs.org/rules/multi-word-component-names.html"
		},
		schema: [{
			type: "object",
			properties: { ignores: {
				type: "array",
				items: { type: "string" },
				uniqueItems: true,
				additionalItems: false
			} },
			additionalProperties: false
		}],
		messages: { unexpected: "Component name \"{{value}}\" should always be multi-word." }
	},
	create(context) {
		const ignores = /* @__PURE__ */ new Set(["App", "app"]);
		const optionIgnores = context.options[0] && context.options[0].ignores || [];
		for (const ignore of optionIgnores) {
			ignores.add(ignore);
			if (require_casing.isPascalCase(ignore)) ignores.add(require_casing.kebabCase(ignore));
		}
		let hasVue = import_utils.default.isScriptSetup(context);
		let hasName = false;
		/**
		* Returns true if the given component name is valid, otherwise false.
		* */
		function isValidComponentName(name) {
			if (ignores.has(name) || import_utils.default.VUE3_BUILTIN_COMPONENT_NAMES.has(name)) return true;
			return require_casing.kebabCase(name).split("-").length > 1;
		}
		function validateName(nameNode) {
			if (nameNode.type !== "Literal") return;
			const componentName = String(nameNode.value);
			if (!isValidComponentName(componentName)) context.report({
				node: nameNode,
				messageId: "unexpected",
				data: { value: componentName }
			});
		}
		return import_utils.default.compositingVisitors(import_utils.default.executeOnCallVueComponent(context, (node) => {
			hasVue = true;
			if (node.arguments.length !== 2) return;
			hasName = true;
			validateName(node.arguments[0]);
		}), import_utils.default.executeOnVue(context, (obj) => {
			hasVue = true;
			const node = import_utils.default.findProperty(obj, "name");
			if (!node) return;
			hasName = true;
			validateName(node.value);
		}), import_utils.default.defineScriptSetupVisitor(context, { onDefineOptionsEnter(node) {
			if (node.arguments.length === 0) return;
			const define = node.arguments[0];
			if (define.type !== "ObjectExpression") return;
			const nameNode = import_utils.default.findProperty(define, "name");
			if (!nameNode) return;
			hasName = true;
			validateName(nameNode.value);
		} }), { "Program:exit"(node) {
			if (hasName) return;
			if (!hasVue && node.body.length > 0) return;
			const fileName = context.filename;
			const componentName = node_path.default.basename(fileName, node_path.default.extname(fileName));
			if (import_utils.default.isVueFile(fileName) && !isValidComponentName(componentName)) context.report({
				messageId: "unexpected",
				data: { value: componentName },
				loc: {
					line: 1,
					column: 0
				}
			});
		} });
	}
};
//#endregion
exports.default = multi_word_component_names_default;
@jYx|const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
const require_inline_non_void_elements = require("../utils/inline-non-void-elements.js");
//#region lib/rules/multiline-html-element-content-newline.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
function isMultilineElement(element) {
	return element.loc.start.line < element.endTag.loc.start.line;
}
function parseOptions(options) {
	return Object.assign({
		ignores: [
			"pre",
			"textarea",
			...require_inline_non_void_elements.default
		],
		ignoreWhenEmpty: true,
		allowEmptyLines: false
	}, options);
}
function getPhrase(lineBreaks) {
	switch (lineBreaks) {
		case 0: return "no";
		default: return String(lineBreaks);
	}
}
/**
* Check whether the given element is empty or not.
* This ignores whitespaces, doesn't ignore comments.
*/
function isEmpty(node, sourceCode) {
	const start = node.startTag.range[1];
	const end = node.endTag.range[0];
	return sourceCode.text.slice(start, end).trim() === "";
}
var multiline_html_element_content_newline_default = {
	meta: {
		type: "layout",
		docs: {
			description: "require a line break before and after the contents of a multiline element",
			categories: ["vue3-strongly-recommended", "vue2-strongly-recommended"],
			url: "https://eslint.vuejs.org/rules/multiline-html-element-content-newline.html"
		},
		fixable: "whitespace",
		schema: [{
			type: "object",
			properties: {
				ignoreWhenEmpty: { type: "boolean" },
				ignores: {
					type: "array",
					items: { type: "string" },
					uniqueItems: true,
					additionalItems: false
				},
				allowEmptyLines: { type: "boolean" }
			},
			additionalProperties: false
		}],
		messages: {
			unexpectedAfterClosingBracket: "Expected 1 line break after opening tag (`<{{name}}>`), but {{actual}} line breaks found.",
			unexpectedBeforeOpeningBracket: "Expected 1 line break before closing tag (`</{{name}}>`), but {{actual}} line breaks found."
		}
	},
	create(context) {
		const options = parseOptions(context.options[0]);
		const ignores = options.ignores;
		const ignoreWhenEmpty = options.ignoreWhenEmpty;
		const allowEmptyLines = options.allowEmptyLines;
		const sourceCode = context.sourceCode;
		const template = sourceCode.parserServices.getTemplateBodyTokenStore && sourceCode.parserServices.getTemplateBodyTokenStore();
		let inIgnoreElement = null;
		function isIgnoredElement(node) {
			return ignores.includes(node.name) || ignores.includes(require_casing.pascalCase(node.rawName)) || ignores.includes(require_casing.kebabCase(node.rawName));
		}
		function isInvalidLineBreaks(lineBreaks) {
			return allowEmptyLines ? lineBreaks === 0 : lineBreaks !== 1;
		}
		return import_utils.default.defineTemplateBodyVisitor(context, {
			VElement(node) {
				if (inIgnoreElement) return;
				if (isIgnoredElement(node)) {
					inIgnoreElement = node;
					return;
				}
				if (node.startTag.selfClosing || !node.endTag) return;
				const element = node;
				if (!isMultilineElement(element)) return;
				const getTokenOption = {
					includeComments: true,
					filter: (token) => token.type !== "HTMLWhitespace"
				};
				if (ignoreWhenEmpty && element.children.length === 0 && template.getFirstTokensBetween(element.startTag, element.endTag, getTokenOption).length === 0) return;
				const contentFirst = template.getTokenAfter(element.startTag, getTokenOption);
				const contentLast = template.getTokenBefore(element.endTag, getTokenOption);
				const beforeLineBreaks = contentFirst.loc.start.line - element.startTag.loc.end.line;
				const afterLineBreaks = element.endTag.loc.start.line - contentLast.loc.end.line;
				if (isInvalidLineBreaks(beforeLineBreaks)) context.report({
					node: template.getLastToken(element.startTag),
					loc: {
						start: element.startTag.loc.end,
						end: contentFirst.loc.start
					},
					messageId: "unexpectedAfterClosingBracket",
					data: {
						name: element.rawName,
						actual: getPhrase(beforeLineBreaks)
					},
					fix(fixer) {
						const range = [element.startTag.range[1], contentFirst.range[0]];
						return fixer.replaceTextRange(range, "\n");
					}
				});
				if (isEmpty(element, sourceCode)) return;
				if (isInvalidLineBreaks(afterLineBreaks)) context.report({
					node: template.getFirstToken(element.endTag),
					loc: {
						start: contentLast.loc.end,
						end: element.endTag.loc.start
					},
					messageId: "unexpectedBeforeOpeningBracket",
					data: {
						name: element.name,
						actual: getPhrase(afterLineBreaks)
					},
					fix(fixer) {
						const range = [contentLast.range[1], element.endTag.range[0]];
						return fixer.replaceTextRange(range, "\n");
					}
				});
			},
			"VElement:exit"(node) {
				if (inIgnoreElement === node) inIgnoreElement = null;
			}
		});
	}
};
//#endregion
exports.default = multiline_html_element_content_newline_default;
y*xR"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/multiline-ternary.js
/**
* @author dev1437
* See LICENSE file in root directory for full license.
*/
var require_multiline_ternary = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapStylisticOrCoreRule } = require_index.default;
	module.exports = wrapStylisticOrCoreRule("multiline-ternary", {
		skipDynamicArguments: true,
		applyDocument: true
	});
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_multiline_ternary();
	}
});
HxL"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/mustache-interpolation-spacing.js
/**
* @fileoverview enforce unified spacing in mustache interpolations.
* @author Armano
*/
var require_mustache_interpolation_spacing = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "layout",
			docs: {
				description: "enforce unified spacing in mustache interpolations",
				categories: ["vue3-strongly-recommended", "vue2-strongly-recommended"],
				url: "https://eslint.vuejs.org/rules/mustache-interpolation-spacing.html"
			},
			fixable: "whitespace",
			schema: [{ enum: ["always", "never"] }],
			messages: {
				expectedSpaceAfter: "Expected 1 space after '{{', but not found.",
				expectedSpaceBefore: "Expected 1 space before '}}', but not found.",
				unexpectedSpaceAfter: "Expected no space after '{{', but found.",
				unexpectedSpaceBefore: "Expected no space before '}}', but found."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const options = context.options[0] || "always";
			const sourceCode = context.sourceCode;
			const template = sourceCode.parserServices.getTemplateBodyTokenStore && sourceCode.parserServices.getTemplateBodyTokenStore();
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VExpressionContainer} node */
"VExpressionContainer[expression!=null]"(node) {
				const openBrace = template.getFirstToken(node);
				const closeBrace = template.getLastToken(node);
				if (!openBrace || !closeBrace || openBrace.type !== "VExpressionStart" || closeBrace.type !== "VExpressionEnd") return;
				const firstToken = template.getTokenAfter(openBrace, { includeComments: true });
				const lastToken = template.getTokenBefore(closeBrace, { includeComments: true });
				if (options === "always") {
					if (openBrace.range[1] === firstToken.range[0]) context.report({
						node: openBrace,
						messageId: "expectedSpaceAfter",
						fix: (fixer) => fixer.insertTextAfter(openBrace, " ")
					});
					if (closeBrace.range[0] === lastToken.range[1]) context.report({
						node: closeBrace,
						messageId: "expectedSpaceBefore",
						fix: (fixer) => fixer.insertTextBefore(closeBrace, " ")
					});
				} else {
					if (openBrace.range[1] !== firstToken.range[0]) context.report({
						loc: {
							start: openBrace.loc.start,
							end: firstToken.loc.start
						},
						messageId: "unexpectedSpaceAfter",
						fix: (fixer) => fixer.removeRange([openBrace.range[1], firstToken.range[0]])
					});
					if (closeBrace.range[0] !== lastToken.range[1]) context.report({
						loc: {
							start: lastToken.loc.end,
							end: closeBrace.loc.end
						},
						messageId: "unexpectedSpaceBefore",
						fix: (fixer) => fixer.removeRange([lastToken.range[1], closeBrace.range[0]])
					});
				}
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_mustache_interpolation_spacing();
	}
});
x~"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/new-line-between-multi-line-property.js
/**
* @fileoverview Enforce new lines between multi-line properties in Vue components.
* @author IWANABETHATGUY
*/
var require_new_line_between_multi_line_property = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @param {Token} node
	*/
	function isComma(node) {
		return node.type === "Punctuator" && node.value === ",";
	}
	/**
	* Check whether the between given nodes has empty line.
	* @param {SourceCode} sourceCode
	* @param {ASTNode} pre
	* @param {ASTNode} cur
	*/
	function* iterateBetweenTokens(sourceCode, pre, cur) {
		yield sourceCode.getLastToken(pre);
		yield* sourceCode.getTokensBetween(pre, cur, { includeComments: true });
		yield sourceCode.getFirstToken(cur);
	}
	/**
	* Check whether the between given nodes has empty line.
	* @param {SourceCode} sourceCode
	* @param {ASTNode} pre
	* @param {ASTNode} cur
	*/
	function hasEmptyLine(sourceCode, pre, cur) {
		/** @type {Token|null} */
		let preToken = null;
		for (const token of iterateBetweenTokens(sourceCode, pre, cur)) {
			if (preToken && token.loc.start.line - preToken.loc.end.line >= 2) return true;
			preToken = token;
		}
		return false;
	}
	module.exports = {
		meta: {
			type: "layout",
			docs: {
				description: "enforce new lines between multi-line properties in Vue components",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/new-line-between-multi-line-property.html"
			},
			fixable: "whitespace",
			schema: [{
				type: "object",
				properties: { minLineOfMultilineProperty: {
					type: "number",
					minimum: 2
				} },
				additionalProperties: false
			}],
			messages: { missingEmptyLine: "Enforce new lines between multi-line properties in Vue components." }
		},
		/** @param {RuleContext} context */
		create(context) {
			const minLineOfMultilineProperty = context.options && context.options[0] && context.options[0].minLineOfMultilineProperty ? context.options[0].minLineOfMultilineProperty : 2;
			/** @type {CallExpression[]} */
			const callStack = [];
			const sourceCode = context.sourceCode;
			return Object.assign(utils.defineVueVisitor(context, {
				CallExpression(node) {
					callStack.push(node);
				},
				"CallExpression:exit"() {
					callStack.pop();
				},
				/**
				* @param {ObjectExpression} node
				*/
				ObjectExpression(node) {
					if (callStack.length > 0) return;
					const properties = node.properties;
					for (let i = 1; i < properties.length; i++) {
						const cur = properties[i];
						const pre = properties[i - 1];
						if (pre.loc.end.line - pre.loc.start.line + 1 < minLineOfMultilineProperty) continue;
						if (hasEmptyLine(sourceCode, pre, cur)) continue;
						context.report({
							node: pre,
							loc: {
								start: pre.loc.end,
								end: cur.loc.start
							},
							messageId: "missingEmptyLine",
							fix(fixer) {
								/** @type {Token|null} */
								let preToken = null;
								for (const token of iterateBetweenTokens(sourceCode, pre, cur)) {
									if (preToken && preToken.loc.end.line < token.loc.start.line) return fixer.insertTextAfter(preToken, "\n");
									preToken = token;
								}
								const commaToken = sourceCode.getTokenAfter(pre, isComma);
								return fixer.insertTextAfter(commaToken || pre, "\n\n");
							}
						});
					}
				}
			}));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_new_line_between_multi_line_property();
	}
});
똞Yxq"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/next-tick-style.js
/**
* @fileoverview enforce Promise or callback style in `nextTick`
* @author Flo Edelmann
* @copyright 2020 Flo Edelmann. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_next_tick_style = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const { findVariable } = require("@eslint-community/eslint-utils");
	/**
	* @param {Identifier} identifier
	* @param {RuleContext} context
	* @returns {CallExpression|undefined}
	*/
	function getVueNextTickCallExpression(identifier, context) {
		if (identifier.name === "$nextTick" && identifier.parent.type === "MemberExpression" && utils.isThis(identifier.parent.object, context) && identifier.parent.parent.type === "CallExpression" && identifier.parent.parent.callee === identifier.parent) return identifier.parent.parent;
		if (identifier.name === "nextTick" && identifier.parent.type === "MemberExpression" && identifier.parent.object.type === "Identifier" && identifier.parent.object.name === "Vue" && identifier.parent.parent.type === "CallExpression" && identifier.parent.parent.callee === identifier.parent) return identifier.parent.parent;
		if (identifier.parent.type === "CallExpression" && identifier.parent.callee === identifier) {
			const variable = findVariable(utils.getScope(context, identifier), identifier);
			if (variable != null && variable.defs.length === 1) {
				const def = variable.defs[0];
				if (def.type === "ImportBinding" && def.node.type === "ImportSpecifier" && def.node.imported.type === "Identifier" && def.node.imported.name === "nextTick" && def.node.parent.type === "ImportDeclaration" && def.node.parent.source.value === "vue") return identifier.parent;
			}
		}
	}
	/**
	* @param {CallExpression} callExpression
	* @returns {boolean}
	*/
	function isAwaitedPromise(callExpression) {
		return callExpression.parent.type === "AwaitExpression" || callExpression.parent.type === "MemberExpression" && callExpression.parent.property.type === "Identifier" && callExpression.parent.property.name === "then";
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "enforce Promise or callback style in `nextTick`",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/next-tick-style.html"
			},
			fixable: "code",
			schema: [{ enum: ["promise", "callback"] }],
			messages: {
				usePromise: "Use the Promise returned by `nextTick` instead of passing a callback function.",
				useCallback: "Pass a callback function to `nextTick` instead of using the returned Promise."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const preferredStyle = context.options[0] || "promise";
			return utils.defineVueVisitor(context, { 
			/** @param {Identifier} node */
Identifier(node) {
				const callExpression = getVueNextTickCallExpression(node, context);
				if (!callExpression) return;
				if (preferredStyle === "callback") {
					if (callExpression.arguments.length !== 1 || isAwaitedPromise(callExpression)) context.report({
						node,
						messageId: "useCallback"
					});
					return;
				}
				if (callExpression.arguments.length > 0 || !isAwaitedPromise(callExpression)) context.report({
					node,
					messageId: "usePromise",
					fix(fixer) {
						return fixer.insertTextAfter(node, "().then");
					}
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_next_tick_style();
	}
});
|`x"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-arrow-functions-in-watch.js
/**
* @author Sosuke Suzuki
*/
var require_no_arrow_functions_in_watch = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow using arrow functions to define watcher",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/no-arrow-functions-in-watch.html"
			},
			fixable: null,
			schema: [],
			messages: { noArrowFunctionsInWatch: "You should not use an arrow function to define a watcher." }
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.executeOnVue(context, (obj) => {
				const watchNode = utils.findProperty(obj, "watch");
				if (watchNode == null) return;
				const watchValue = watchNode.value;
				if (watchValue.type !== "ObjectExpression") return;
				for (const property of watchValue.properties) {
					if (property.type !== "Property") continue;
					for (const handler of utils.iterateWatchHandlerValues(property)) if (handler.type === "ArrowFunctionExpression") context.report({
						node: handler,
						messageId: "noArrowFunctionsInWatch"
					});
				}
			});
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_arrow_functions_in_watch();
	}
});
ix$o"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-async-in-computed-properties.js
/**
* @fileoverview Check if there are no asynchronous actions inside computed properties.
* @author Armano
*/
var require_no_async_in_computed_properties = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { ReferenceTracker } = require("@eslint-community/eslint-utils");
	const utils = require_index.default;
	/**
	* @typedef {import('../utils').VueObjectData} VueObjectData
	* @typedef {import('../utils').VueVisitor} VueVisitor
	* @typedef {import('../utils').ComponentComputedProperty} ComponentComputedProperty
	*/
	const PROMISE_FUNCTIONS = /* @__PURE__ */ new Set([
		"then",
		"catch",
		"finally"
	]);
	const PROMISE_METHODS = /* @__PURE__ */ new Set([
		"all",
		"allSettled",
		"any",
		"race",
		"reject",
		"resolve",
		"try",
		"withResolvers"
	]);
	const TIMED_FUNCTIONS = /* @__PURE__ */ new Set([
		"setTimeout",
		"setInterval",
		"setImmediate",
		"requestAnimationFrame"
	]);
	/**
	* @param {CallExpression} node
	*/
	function isTimedFunction(node) {
		const callee = utils.skipChainExpression(node.callee);
		return (callee.type === "Identifier" && TIMED_FUNCTIONS.has(callee.name) || callee.type === "MemberExpression" && callee.object.type === "Identifier" && callee.object.name === "window" && TIMED_FUNCTIONS.has(utils.getStaticPropertyName(callee) || "")) && node.arguments.length > 0;
	}
	/**
	* @param {*} node
	* @returns {*}
	*/
	function skipWrapper(node) {
		while (node && node.expression) node = node.expression;
		return node;
	}
	/**
	* Resolve a single step of the member expression chain walk.
	* @param {*} current
	* @returns {{ done: true, name: string | null } | { done: false, next: * }}
	*/
	function resolveRootObjectStep(current) {
		switch (current.type) {
			case "MemberExpression": return {
				done: false,
				next: skipWrapper(current.object)
			};
			case "CallExpression": {
				const calleeExpr = skipWrapper(current.callee);
				if (calleeExpr.type === "MemberExpression") return {
					done: false,
					next: skipWrapper(calleeExpr.object)
				};
				if (calleeExpr.type === "Identifier") return {
					done: true,
					name: calleeExpr.name
				};
				return {
					done: true,
					name: null
				};
			}
			case "Identifier": return {
				done: true,
				name: current.name
			};
			default: return {
				done: true,
				name: null
			};
		}
	}
	/**
	* Get the root object name from a member expression chain
	* @param {MemberExpression} memberExpr
	* @returns {string|null}
	*/
	function getRootObjectName(memberExpr) {
		let current = skipWrapper(memberExpr.object);
		while (current) {
			const step = resolveRootObjectStep(current);
			if (step.done) return step.name;
			current = step.next;
		}
		return null;
	}
	/**
	* @param {string} name
	* @param {*} callee
	* @returns {boolean}
	*/
	function isPromiseMethod(name, callee) {
		return PROMISE_FUNCTIONS.has(name) || callee.object.type === "Identifier" && callee.object.name === "Promise" && PROMISE_METHODS.has(name);
	}
	/**
	* @param {CallExpression} node
	* @param {Set<string>} ignoredObjectNames
	*/
	function isPromise(node, ignoredObjectNames) {
		const callee = utils.skipChainExpression(node.callee);
		if (callee.type === "MemberExpression") {
			const name = utils.getStaticPropertyName(callee);
			if (!name || !isPromiseMethod(name, callee)) return false;
			const rootObjectName = getRootObjectName(callee);
			return !rootObjectName || !ignoredObjectNames.has(rootObjectName);
		}
		return false;
	}
	/**
	* @param {CallExpression} node
	* @param {RuleContext} context
	*/
	function isNextTick(node, context) {
		const callee = utils.skipChainExpression(node.callee);
		if (callee.type === "MemberExpression") {
			const name = utils.getStaticPropertyName(callee);
			return utils.isThis(callee.object, context) && name === "$nextTick" || callee.object.type === "Identifier" && callee.object.name === "Vue" && name === "nextTick";
		}
		return false;
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow asynchronous actions in computed properties",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/no-async-in-computed-properties.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: { ignoredObjectNames: {
					type: "array",
					items: { type: "string" },
					uniqueItems: true,
					additionalItems: false
				} },
				additionalProperties: false
			}],
			messages: {
				unexpectedInFunction: "Unexpected {{expressionName}} in computed function.",
				unexpectedInProperty: "Unexpected {{expressionName}} in \"{{propertyName}}\" computed property."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const options = context.options[0] || {};
			const ignoredObjectNames = new Set(options.ignoredObjectNames || []);
			/** @type {Map<ObjectExpression, ComponentComputedProperty[]>} */
			const computedPropertiesMap = /* @__PURE__ */ new Map();
			/** @type {(FunctionExpression | ArrowFunctionExpression)[]} */
			const computedFunctionNodes = [];
			/**
			* @typedef {object} ScopeStack
			* @property {ScopeStack | null} upper
			* @property {BlockStatement | Expression} body
			*/
			/** @type {ScopeStack | null} */
			let scopeStack = null;
			const expressionTypes = {
				promise: "asynchronous action",
				nextTick: "asynchronous action",
				await: "await operator",
				async: "async function declaration",
				new: "Promise object",
				timed: "timed function"
			};
			/**
			* @param {FunctionExpression | FunctionDeclaration | ArrowFunctionExpression} node
			* @param {VueObjectData|undefined} [info]
			*/
			function onFunctionEnter(node, info) {
				if (node.async) verify(node, node.body, "async", info ? computedPropertiesMap.get(info.node) : null);
				scopeStack = {
					upper: scopeStack,
					body: node.body
				};
			}
			function onFunctionExit() {
				scopeStack &&= scopeStack.upper;
			}
			/**
			* @param {ESNode} node
			* @param {BlockStatement | Expression} targetBody
			* @param {keyof expressionTypes} type
			* @param {ComponentComputedProperty[]|undefined|null} computedProperties
			*/
			function verify(node, targetBody, type, computedProperties) {
				const properties = computedProperties || [];
				for (const cp of properties) if (cp.value && node.loc.start.line >= cp.value.loc.start.line && node.loc.end.line <= cp.value.loc.end.line && targetBody === cp.value) {
					context.report({
						node,
						messageId: "unexpectedInProperty",
						data: {
							expressionName: expressionTypes[type],
							propertyName: cp.key || "unknown"
						}
					});
					return;
				}
				for (const cf of computedFunctionNodes) if (node.loc.start.line >= cf.body.loc.start.line && node.loc.end.line <= cf.body.loc.end.line && targetBody === cf.body) {
					context.report({
						node,
						messageId: "unexpectedInFunction",
						data: { expressionName: expressionTypes[type] }
					});
					return;
				}
			}
			const nodeVisitor = {
				":function": onFunctionEnter,
				":function:exit": onFunctionExit,
				/**
				* @param {NewExpression} node
				* @param {VueObjectData|undefined} [info]
				*/
				NewExpression(node, info) {
					if (!scopeStack) return;
					if (node.callee.type === "Identifier" && node.callee.name === "Promise") verify(node, scopeStack.body, "new", info ? computedPropertiesMap.get(info.node) : null);
				},
				/**
				* @param {CallExpression} node
				* @param {VueObjectData|undefined} [info]
				*/
				CallExpression(node, info) {
					if (!scopeStack) return;
					if (isPromise(node, ignoredObjectNames)) verify(node, scopeStack.body, "promise", info ? computedPropertiesMap.get(info.node) : null);
					else if (isTimedFunction(node)) verify(node, scopeStack.body, "timed", info ? computedPropertiesMap.get(info.node) : null);
					else if (isNextTick(node, context)) verify(node, scopeStack.body, "nextTick", info ? computedPropertiesMap.get(info.node) : null);
				},
				/**
				* @param {AwaitExpression} node
				* @param {VueObjectData|undefined} [info]
				*/
				AwaitExpression(node, info) {
					if (!scopeStack) return;
					verify(node, scopeStack.body, "await", info ? computedPropertiesMap.get(info.node) : null);
				}
			};
			return utils.compositingVisitors({ 
			/** @param {Program} program */
Program(program) {
				const tracker = new ReferenceTracker(utils.getScope(context, program));
				const computedRefs = utils.iterateReferencesTraceMap(tracker, { computed: { [ReferenceTracker.CALL]: true } });
				for (const { node } of computedRefs) {
					if (node.type !== "CallExpression") continue;
					const getter = utils.getGetterBodyFromComputedFunction(node);
					if (getter) computedFunctionNodes.push(getter);
				}
			} }, utils.isScriptSetup(context) ? utils.defineScriptSetupVisitor(context, nodeVisitor) : utils.defineVueVisitor(context, {
				onVueObjectEnter(node) {
					computedPropertiesMap.set(node, utils.getComputedProperties(node));
				},
				...nodeVisitor
			}));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_async_in_computed_properties();
	}
});
)cx`const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
const require_regexp = require("../utils/regexp.js");
//#region lib/rules/no-bare-strings-in-template.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
const DEFAULT_ALLOWLIST = [
	"(",
	")",
	",",
	".",
	"&",
	"+",
	"-",
	"=",
	"*",
	"/",
	"#",
	"%",
	"!",
	"?",
	":",
	"[",
	"]",
	"{",
	"}",
	"<",
	">",
	"·",
	"•",
	"‐",
	"–",
	"—",
	"−",
	"|"
];
const DEFAULT_ATTRIBUTES = {
	"/.+/": [
		"title",
		"aria-label",
		"aria-placeholder",
		"aria-roledescription",
		"aria-valuetext"
	],
	input: ["placeholder"],
	img: ["alt"]
};
const DEFAULT_DIRECTIVES = ["v-text"];
/**
* Parse attributes option
*/
function parseTargetAttrs(options) {
	const result = {
		names: {},
		regexps: [],
		cache: {}
	};
	for (const [tagName, tagAttrs] of Object.entries(options)) {
		const attrs = new Set(tagAttrs);
		if (require_regexp.isRegExp(tagName)) result.regexps.push({
			name: require_regexp.toRegExp(tagName),
			attrs
		});
		else result.names[tagName] = attrs;
	}
	return result;
}
/**
* Get a string from given expression container node
*/
function getStringValue(value) {
	const expression = value.expression;
	if (!expression) return null;
	if (expression.type !== "Literal") return null;
	if (typeof expression.value === "string") return expression.value;
	return null;
}
var no_bare_strings_in_template_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "disallow the use of bare strings in `<template>`",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/no-bare-strings-in-template.html"
		},
		schema: [{
			type: "object",
			properties: {
				allowlist: {
					type: "array",
					items: { type: "string" },
					uniqueItems: true
				},
				attributes: {
					type: "object",
					patternProperties: { "^(?:\\S+|/.*/[a-z]*)$": {
						type: "array",
						items: { type: "string" },
						uniqueItems: true
					} },
					additionalProperties: false
				},
				directives: {
					type: "array",
					items: {
						type: "string",
						pattern: "^v-"
					},
					uniqueItems: true
				}
			},
			additionalProperties: false
		}],
		messages: {
			unexpected: "Unexpected non-translated string used.",
			unexpectedInAttr: "Unexpected non-translated string used in `{{attr}}`."
		}
	},
	create(context) {
		const opts = context.options[0] || {};
		const rawAllowlist = opts.allowlist || DEFAULT_ALLOWLIST;
		const attributes = parseTargetAttrs(opts.attributes || DEFAULT_ATTRIBUTES);
		const directives = opts.directives || DEFAULT_DIRECTIVES;
		const stringAllowlist = [];
		const regexAllowlist = [];
		for (const item of rawAllowlist) if (require_regexp.isRegExp(item)) regexAllowlist.push(require_regexp.toRegExp(item));
		else stringAllowlist.push(item);
		const allowlistRe = stringAllowlist.length > 0 ? new RegExp(stringAllowlist.map((w) => require_regexp.escape(w)).sort((a, b) => b.length - a.length).join("|"), "gu") : null;
		let elementStack = null;
		/**
		* Gets the bare string from given string
		*/
		function getBareString(str) {
			let result = str.trim();
			if (allowlistRe) result = result.replace(allowlistRe, "");
			for (const regex of regexAllowlist) {
				const flags = regex.flags.includes("g") ? regex.flags : `${regex.flags}g`;
				const globalRegex = new RegExp(regex.source, flags);
				result = result.replace(globalRegex, "");
			}
			return result.trim();
		}
		/**
		* Get the attribute to be verified from the element name.
		*/
		function getTargetAttrs(tagName) {
			if (attributes.cache[tagName]) return attributes.cache[tagName];
			const result = [];
			if (attributes.names[tagName]) result.push(...attributes.names[tagName]);
			for (const { name, attrs } of attributes.regexps) {
				name.lastIndex = 0;
				if (name.test(tagName)) result.push(...attrs);
			}
			if (require_casing.isKebabCase(tagName)) result.push(...getTargetAttrs(require_casing.pascalCase(tagName)));
			return attributes.cache[tagName] = new Set(result);
		}
		return import_utils.default.defineTemplateBodyVisitor(context, {
			VText(node) {
				if (getBareString(node.value)) context.report({
					node,
					messageId: "unexpected"
				});
			},
			VElement(node) {
				elementStack = {
					upper: elementStack,
					name: node.rawName,
					attrs: getTargetAttrs(node.rawName)
				};
			},
			"VElement:exit"() {
				elementStack &&= elementStack.upper;
			},
			VAttribute(node) {
				if (!node.value || !elementStack) return;
				if (node.directive === false) {
					if (!elementStack.attrs.has(node.key.rawName)) return;
					if (getBareString(node.value.value)) context.report({
						node: node.value,
						messageId: "unexpectedInAttr",
						data: { attr: node.key.rawName }
					});
				} else {
					const directive = `v-${node.key.name.name}`;
					if (!directives.includes(directive)) return;
					const str = getStringValue(node.value);
					if (str && getBareString(str)) context.report({
						node: node.value,
						messageId: "unexpectedInAttr",
						data: { attr: directive }
					});
				}
			}
		});
	}
};
//#endregion
exports.default = no_bare_strings_in_template_default;
͵xJ"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-boolean-default.js
/**
* @fileoverview Prevents boolean defaults from being set
* @author Hiroki Osame
*/
var require_no_boolean_default = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef {import('../utils').ComponentProp} ComponentProp
	* @typedef {import('../utils').ComponentObjectProp} ComponentObjectProp
	*/
	/**
	* @param {Expression|undefined} node
	*/
	function isBooleanIdentifier(node) {
		return Boolean(node && node.type === "Identifier" && node.name === "Boolean");
	}
	/**
	* Detects whether given prop node is a Boolean
	* @param {ComponentObjectProp} prop
	* @return {Boolean}
	*/
	function isBooleanProp(prop) {
		const value = utils.skipTSAsExpression(prop.value);
		return isBooleanIdentifier(value) || value.type === "ObjectExpression" && isBooleanIdentifier(utils.findProperty(value, "type")?.value);
	}
	/**
	* @param {ObjectExpression} propDefValue
	*/
	function getDefaultNode(propDefValue) {
		return utils.findProperty(propDefValue, "default");
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow boolean defaults",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/no-boolean-default.html"
			},
			fixable: null,
			schema: [{ enum: ["default-false", "no-default"] }],
			messages: {
				noBooleanDefault: "Boolean prop should not set a default (Vue defaults it to false).",
				defaultFalse: "Boolean prop should only be defaulted to false."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const booleanType = context.options[0] || "no-default";
			/**
			* @param {ComponentProp} prop
			* @param {(propName: string) => Expression[]} otherDefaultProvider
			*/
			function processProp(prop, otherDefaultProvider) {
				if (prop.type === "object") {
					if (!isBooleanProp(prop)) return;
					if (prop.value.type === "ObjectExpression") {
						const defaultNode = getDefaultNode(prop.value);
						if (defaultNode) verifyDefaultExpression(defaultNode.value);
					}
					if (prop.propName != null) for (const defaultNode of otherDefaultProvider(prop.propName)) verifyDefaultExpression(defaultNode);
				} else if (prop.type === "type") {
					if (prop.types.length !== 1 || prop.types[0] !== "Boolean") return;
					for (const defaultNode of otherDefaultProvider(prop.propName)) verifyDefaultExpression(defaultNode);
				}
			}
			/**
			* @param {ComponentProp[]} props
			* @param {(propName: string) => Expression[]} otherDefaultProvider
			*/
			function processProps(props, otherDefaultProvider) {
				for (const prop of props) processProp(prop, otherDefaultProvider);
			}
			/**
			* @param {Expression} defaultNode
			*/
			function verifyDefaultExpression(defaultNode) {
				switch (booleanType) {
					case "no-default":
						context.report({
							node: defaultNode,
							messageId: "noBooleanDefault"
						});
						break;
					case "default-false":
						if (defaultNode.type !== "Literal" || defaultNode.value !== false) context.report({
							node: defaultNode,
							messageId: "defaultFalse"
						});
						break;
				}
			}
			return utils.compositingVisitors(utils.executeOnVueComponent(context, (obj) => {
				processProps(utils.getComponentPropsFromOptions(obj), () => []);
			}), utils.defineScriptSetupVisitor(context, { onDefinePropsEnter(node, props) {
				const defaultsByWithDefaults = utils.getWithDefaultsPropExpressions(node);
				const defaultsByAssignmentPatterns = utils.getDefaultPropExpressionsForPropsDestructure(node);
				processProps(props, (propName) => [defaultsByWithDefaults[propName], defaultsByAssignmentPatterns[propName]?.expression].filter(utils.isDef));
			} }));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_boolean_default();
	}
});
Ԧ/[x&"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-child-content.js
/**
* @author Flo Edelmann
* See LICENSE file in root directory for full license.
*/
var require_no_child_content = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { defineTemplateBodyVisitor } = require_index.default;
	/**
	* @typedef {object} RuleOption
	* @property {string[]} additionalDirectives
	*/
	/**
	* @param {VNode | Token} node
	* @returns {boolean}
	*/
	function isWhitespaceTextNode(node) {
		return node.type === "VText" && node.value.trim() === "";
	}
	/**
	* @param {Position} pos1
	* @param {Position} pos2
	* @returns {'less' | 'equal' | 'greater'}
	*/
	function comparePositions(pos1, pos2) {
		if (pos1.line < pos2.line || pos1.line === pos2.line && pos1.column < pos2.column) return "less";
		if (pos1.line > pos2.line || pos1.line === pos2.line && pos1.column > pos2.column) return "greater";
		return "equal";
	}
	/**
	* @param {(VNode | Token)[]} nodes
	* @returns {SourceLocation | undefined}
	*/
	function getLocationRange(nodes) {
		/** @type {Position | undefined} */
		let start;
		/** @type {Position | undefined} */
		let end;
		for (const node of nodes) {
			if (!start || comparePositions(node.loc.start, start) === "less") start = node.loc.start;
			if (!end || comparePositions(node.loc.end, end) === "greater") end = node.loc.end;
		}
		if (start === void 0 || end === void 0) return;
		return {
			start,
			end
		};
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow element's child contents which would be overwritten by a directive like `v-html` or `v-text`",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/no-child-content.html"
			},
			fixable: null,
			hasSuggestions: true,
			schema: [{
				type: "object",
				additionalProperties: false,
				properties: { additionalDirectives: {
					type: "array",
					uniqueItems: true,
					minItems: 1,
					items: { type: "string" }
				} },
				required: ["additionalDirectives"]
			}],
			messages: {
				disallowedChildContent: "Child content is disallowed because it will be overwritten by the v-{{ directiveName }} directive.",
				removeChildContent: "Remove child content."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const directives = /* @__PURE__ */ new Set(["html", "text"]);
			/** @type {RuleOption | undefined} */
			const option = context.options[0];
			if (option !== void 0) for (const directive of option.additionalDirectives) directives.add(directive);
			return defineTemplateBodyVisitor(context, { 
			/** @param {VDirective} directiveNode */
"VAttribute[directive=true]"(directiveNode) {
				const directiveName = directiveNode.key.name.name;
				const elementNode = directiveNode.parent.parent;
				if (elementNode.endTag === null || !directives.has(directiveName)) return;
				const elementComments = context.sourceCode.parserServices.getTemplateBodyTokenStore().getTokensBetween(elementNode.startTag, elementNode.endTag, {
					includeComments: true,
					filter: (token) => token.type === "HTMLComment"
				});
				const childNodes = [...elementNode.children, ...elementComments];
				if (childNodes.some((childNode) => !isWhitespaceTextNode(childNode))) context.report({
					node: elementNode,
					loc: getLocationRange(childNodes),
					messageId: "disallowedChildContent",
					data: { directiveName },
					suggest: [{
						messageId: "removeChildContent",
						*fix(fixer) {
							for (const childNode of childNodes) yield fixer.remove(childNode);
						}
					}]
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_child_content();
	}
});
ݧxq"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-computed-properties-in-data.js
/**
* @author  Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_no_computed_properties_in_data = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef {import('../utils').VueObjectData} VueObjectData
	*/
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow accessing computed properties in `data`",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/no-computed-properties-in-data.html"
			},
			fixable: null,
			schema: [],
			messages: { cannotBeUsed: "The computed property cannot be used in `data()` because it is before initialization." }
		},
		/** @param {RuleContext} context */
		create(context) {
			/** @type {Map<ObjectExpression, {data: FunctionExpression | ArrowFunctionExpression, computedNames:Set<string>}>} */
			const contextMap = /* @__PURE__ */ new Map();
			/**
			* @typedef {object} ScopeStack
			* @property {ScopeStack | null} upper
			* @property {FunctionExpression | FunctionDeclaration | ArrowFunctionExpression} node
			*/
			/** @type {ScopeStack | null} */
			let scopeStack = null;
			return utils.compositingVisitors({
				/**
				* @param {FunctionExpression | FunctionDeclaration | ArrowFunctionExpression} node
				*/
				":function"(node) {
					scopeStack = {
						upper: scopeStack,
						node
					};
				},
				":function:exit"() {
					scopeStack &&= scopeStack.upper;
				}
			}, utils.defineVueVisitor(context, {
				onVueObjectEnter(node) {
					const dataProperty = utils.findProperty(node, "data");
					if (!dataProperty || dataProperty.value.type !== "FunctionExpression" && dataProperty.value.type !== "ArrowFunctionExpression") return;
					const computedNames = /* @__PURE__ */ new Set();
					const computedProperties = utils.iterateProperties(node, /* @__PURE__ */ new Set(["computed"]));
					for (const computed of computedProperties) computedNames.add(computed.name);
					contextMap.set(node, {
						data: dataProperty.value,
						computedNames
					});
				},
				/**
				* @param {MemberExpression} node
				* @param {VueObjectData} vueData
				*/
				MemberExpression(node, vueData) {
					if (!scopeStack || !utils.isThis(node.object, context)) return;
					const ctx = contextMap.get(vueData.node);
					if (!ctx || ctx.data !== scopeStack.node) return;
					const name = utils.getStaticPropertyName(node);
					if (!name || !ctx.computedNames.has(name)) return;
					context.report({
						node,
						messageId: "cannotBeUsed"
					});
				}
			}));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_computed_properties_in_data();
	}
});
4Yxj"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-console.js
/**
* @author ItMaga <https://github.com/ItMaga>
* See LICENSE file in root directory for full license.
*/
var require_no_console = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = utils.wrapCoreRule("no-console", {
		skipBaseHandlers: true,
		create(context) {
			const allowed = (context.options[0] || {}).allow || [];
			/**
			* Copied from the core rule `no-console`.
			* Checks whether the property name of the given MemberExpression node
			* is allowed by options or not.
			* @param {MemberExpression} node The MemberExpression node to check.
			* @returns {boolean} `true` if the property name of the node is allowed.
			*/
			function isAllowed(node) {
				const propertyName = utils.getStaticPropertyName(node);
				return propertyName && allowed.includes(propertyName);
			}
			return { MemberExpression(node) {
				if (node.object.type === "Identifier" && node.object.name === "console" && !isAllowed(node)) context.report({
					node: node.object,
					loc: node.object.loc,
					messageId: "unexpected"
				});
			} };
		}
	});
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_console();
	}
});
ٜ<x9"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-constant-condition.js
/**
* @author Flo Edelmann
*/
var require_no_constant_condition = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapCoreRule } = require_index.default;
	const conditionalDirectiveNames = /* @__PURE__ */ new Set([
		"v-show",
		"v-if",
		"v-else-if"
	]);
	module.exports = wrapCoreRule("no-constant-condition", { create(_context, { baseHandlers }) {
		return { VDirectiveKey(node) {
			if (conditionalDirectiveNames.has(`v-${node.name.name}`) && node.parent.value && node.parent.value.expression && baseHandlers.IfStatement) baseHandlers.IfStatement({ test: node.parent.value.expression });
		} };
	} });
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_constant_condition();
	}
});
Jжfxf"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-custom-modifiers-on-v-model.js
/**
* @author Przemyslaw Falowski (@przemkow)
* @fileoverview This rule checks whether v-model used on the component do not have custom modifiers
*/
var require_no_custom_modifiers_on_v_model = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const VALID_MODIFIERS = /* @__PURE__ */ new Set([
		"lazy",
		"number",
		"trim"
	]);
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow custom modifiers on v-model used on the component",
				categories: ["vue2-essential"],
				url: "https://eslint.vuejs.org/rules/no-custom-modifiers-on-v-model.html"
			},
			fixable: null,
			schema: [],
			messages: { notSupportedModifier: "'v-model' directives don't support the modifier '{{name}}'." }
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { "VAttribute[directive=true][key.name.name='model']"(node) {
				const element = node.parent.parent;
				if (utils.isCustomComponent(element)) {
					for (const modifier of node.key.modifiers) if (!VALID_MODIFIERS.has(modifier.name)) context.report({
						node,
						loc: node.loc,
						messageId: "notSupportedModifier",
						data: { name: modifier.name }
					});
				}
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_custom_modifiers_on_v_model();
	}
});
	x	Q"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-deprecated-data-object-declaration.js
/**
* @fileoverview disallow using deprecated object declaration on data
* @author yoyo930021
*/
var require_no_deprecated_data_object_declaration = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/** @param {Token} token */
	function isOpenParen(token) {
		return token.type === "Punctuator" && token.value === "(";
	}
	/** @param {Token} token */
	function isCloseParen(token) {
		return token.type === "Punctuator" && token.value === ")";
	}
	/**
	* @param {Expression} node
	* @param {SourceCode} sourceCode
	*/
	function getFirstAndLastTokens(node, sourceCode) {
		let first = sourceCode.getFirstToken(node);
		let last = sourceCode.getLastToken(node);
		while (true) {
			const prev = sourceCode.getTokenBefore(first);
			const next = sourceCode.getTokenAfter(last);
			if (isOpenParen(prev) && isCloseParen(next)) {
				first = prev;
				last = next;
			} else return {
				first,
				last
			};
		}
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow using deprecated object declaration on data (in Vue.js 3.0.0+)",
				categories: ["vue3-essential"],
				url: "https://eslint.vuejs.org/rules/no-deprecated-data-object-declaration.html"
			},
			fixable: "code",
			schema: [],
			messages: { objectDeclarationIsDeprecated: "Object declaration on 'data' property is deprecated. Using function declaration instead." }
		},
		/** @param {RuleContext} context */
		create(context) {
			const sourceCode = context.sourceCode;
			return utils.executeOnVue(context, (obj) => {
				const invalidData = utils.findProperty(obj, "data", (p) => p.value.type !== "FunctionExpression" && p.value.type !== "ArrowFunctionExpression" && p.value.type !== "Identifier");
				if (invalidData) context.report({
					node: invalidData,
					messageId: "objectDeclarationIsDeprecated",
					fix(fixer) {
						const tokens = getFirstAndLastTokens(invalidData.value, sourceCode);
						return [fixer.insertTextBefore(tokens.first, "function() {\nreturn "), fixer.insertTextAfter(tokens.last, ";\n}")];
					}
				});
			});
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_deprecated_data_object_declaration();
	}
});
U/NxS"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-deprecated-delete-set.js
/**
* @author Wayne Zhang
* See LICENSE file in root directory for full license.
*/
var require_no_deprecated_delete_set = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const { ReferenceTracker } = require("@eslint-community/eslint-utils");
	/**
	* @typedef {import('@eslint-community/eslint-utils').TYPES.TraceMap} TraceMap
	*/
	/** @type {TraceMap} */
	const deletedImportApisMap = {
		set: { [ReferenceTracker.CALL]: true },
		del: { [ReferenceTracker.CALL]: true }
	};
	const deprecatedApis = /* @__PURE__ */ new Set(["set", "delete"]);
	const deprecatedDollarApis = /* @__PURE__ */ new Set(["$set", "$delete"]);
	/**
	* @param {Expression|Super} node
	*/
	function isVue(node) {
		return node.type === "Identifier" && node.name === "Vue";
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow using deprecated `$delete` and `$set` (in Vue.js 3.0.0+)",
				categories: ["vue3-essential"],
				url: "https://eslint.vuejs.org/rules/no-deprecated-delete-set.html"
			},
			fixable: null,
			schema: [],
			messages: { deprecated: "The `$delete`, `$set` is deprecated." }
		},
		/** @param {RuleContext} context */
		create(context) {
			/**
			* @param {Identifier} identifier
			* @param {RuleContext} context
			* @returns {CallExpression|undefined}
			*/
			function getVueDeprecatedCallExpression(identifier, context) {
				if (deprecatedDollarApis.has(identifier.name) && identifier.parent.type === "MemberExpression" && utils.isThis(identifier.parent.object, context) && identifier.parent.parent.type === "CallExpression" && identifier.parent.parent.callee === identifier.parent) return identifier.parent.parent;
				if (deprecatedApis.has(identifier.name) && identifier.parent.type === "MemberExpression" && isVue(identifier.parent.object) && identifier.parent.parent.type === "CallExpression" && identifier.parent.parent.callee === identifier.parent) return identifier.parent.parent;
			}
			const nodeVisitor = { 
			/** @param {Identifier} node */
Identifier(node) {
				if (!getVueDeprecatedCallExpression(node, context)) return;
				context.report({
					node,
					messageId: "deprecated"
				});
			} };
			return utils.compositingVisitors(utils.defineVueVisitor(context, nodeVisitor), utils.defineScriptSetupVisitor(context, nodeVisitor), { 
			/** @param {Program} node */
Program(node) {
				const tracker = new ReferenceTracker(utils.getScope(context, node));
				const esmTraceMap = { vue: {
					[ReferenceTracker.ESM]: true,
					...deletedImportApisMap
				} };
				const cjsTraceMap = { vue: { ...deletedImportApisMap } };
				for (const { node } of [...tracker.iterateEsmReferences(esmTraceMap), ...tracker.iterateCjsReferences(cjsTraceMap)]) {
					const refNode = node;
					context.report({
						node: refNode.callee,
						messageId: "deprecated"
					});
				}
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_deprecated_delete_set();
	}
});
q[,x"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-deprecated-destroyed-lifecycle.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_no_deprecated_destroyed_lifecycle = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @param {RuleFixer} fixer
	* @param {Property} property
	* @param {string} newName
	*/
	function fix(fixer, property, newName) {
		if (property.computed) {
			if (property.key.type === "Literal" || property.key.type === "TemplateLiteral") return fixer.replaceTextRange([property.key.range[0] + 1, property.key.range[1] - 1], newName);
			return null;
		}
		if (property.shorthand) return fixer.insertTextBefore(property.key, `${newName}:`);
		return fixer.replaceText(property.key, newName);
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow using deprecated `destroyed` and `beforeDestroy` lifecycle hooks (in Vue.js 3.0.0+)",
				categories: ["vue3-essential"],
				url: "https://eslint.vuejs.org/rules/no-deprecated-destroyed-lifecycle.html"
			},
			fixable: "code",
			schema: [],
			messages: {
				deprecatedDestroyed: "The `destroyed` lifecycle hook is deprecated. Use `unmounted` instead.",
				deprecatedBeforeDestroy: "The `beforeDestroy` lifecycle hook is deprecated. Use `beforeUnmount` instead."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.executeOnVue(context, (obj) => {
				const destroyed = utils.findProperty(obj, "destroyed");
				if (destroyed) context.report({
					node: destroyed.key,
					messageId: "deprecatedDestroyed",
					fix(fixer) {
						return fix(fixer, destroyed, "unmounted");
					}
				});
				const beforeDestroy = utils.findProperty(obj, "beforeDestroy");
				if (beforeDestroy) context.report({
					node: beforeDestroy.key,
					messageId: "deprecatedBeforeDestroy",
					fix(fixer) {
						return fix(fixer, beforeDestroy, "beforeUnmount");
					}
				});
			});
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_deprecated_destroyed_lifecycle();
	}
});
7nx"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-deprecated-events-api.js
/**
* @fileoverview disallow using deprecated events api
* @author yoyo930021
*/
var require_no_deprecated_events_api = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow using deprecated events api (in Vue.js 3.0.0+)",
				categories: ["vue3-essential"],
				url: "https://eslint.vuejs.org/rules/no-deprecated-events-api.html"
			},
			fixable: null,
			schema: [],
			messages: { noDeprecatedEventsApi: "The Events api `$on`, `$off` `$once` is deprecated. Using external library instead, for example mitt." }
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineVueVisitor(context, { 
			/** @param {MemberExpression & ({parent: CallExpression} | {parent: ChainExpression & {parent: CallExpression}})} node */
"CallExpression > MemberExpression, CallExpression > ChainExpression > MemberExpression"(node) {
				const call = node.parent.type === "ChainExpression" ? node.parent.parent : node.parent;
				if (call.optional) return;
				if (utils.skipChainExpression(call.callee) !== node || ![
					"$on",
					"$off",
					"$once"
				].includes(utils.getStaticPropertyName(node) || "")) return;
				if (!utils.isThis(node.object, context)) return;
				context.report({
					node: node.property,
					messageId: "noDeprecatedEventsApi"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_deprecated_events_api();
	}
});
I.{xdollar-listeners-api.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_no_deprecated_dollar_listener'`$listeners`qdollar-listenerB+deprecated: "The `$listeners` is deprecatedBZTemplateBodyVisitor(context, { VExpressionContainer(node) {
				for (const reference of node.references) {
					if (reference.variable != null) continue;
					if (reference.id.name === "$listeners") context.report({
						node: reference.id,
						messag(eId: "deprecated"
					});
				}
			} },#MemberExpression(node) {
				if (node.property.type !== "Identifier" || node.property.name !== "$listeners") return;
				if (!ukdeprecated"
				});
			} })Kdollar_listeners_api();
	}
});
;%rx""use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-deprecated-dollar-scopedslots-api.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_no_deprecated_dollar_scopedslots_api = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow using deprecated `$scopedSlots` (in Vue.js 3.0.0+)",
				categories: ["vue3-essential"],
				url: "https://eslint.vuejs.org/rules/no-deprecated-dollar-scopedslots-api.html"
			},
			fixable: "code",
			schema: [],
			messages: { deprecated: "The `$scopedSlots` is deprecated." }
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { VExpressionContainer(node) {
				for (const reference of node.references) {
					if (reference.variable != null) continue;
					if (reference.id.name === "$scopedSlots") context.report({
						node: reference.id,
						messageId: "deprecated",
						fix(fixer) {
							return fixer.replaceText(reference.id, "$slots");
						}
					});
				}
			} }, utils.defineVueVisitor(context, { MemberExpression(node) {
				if (node.property.type !== "Identifier" || node.property.name !== "$scopedSlots") return;
				if (!utils.isThis(node.object, context)) return;
				context.report({
					node: node.property,
					messageId: "deprecated",
					fix(fixer) {
						return fixer.replaceText(node.property, "$slots");
					}
				});
			} }));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_deprecated_dollar_scopedslots_api();
	}
});
{OLJx\"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-deprecated-filter.js
/**
* @author Przemyslaw Falowski (@przemkow)
* @fileoverview disallow using deprecated filters syntax
*/
var require_no_deprecated_filter = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow using deprecated filters syntax (in Vue.js 3.0.0+)",
				categories: ["vue3-essential"],
				url: "https://eslint.vuejs.org/rules/no-deprecated-filter.html"
			},
			fixable: null,
			schema: [],
			messages: { noDeprecatedFilter: "Filters are deprecated." }
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { VFilterSequenceExpression(node) {
				context.report({
					node,
					loc: node.loc,
					messageId: "noDeprecatedFilter"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_deprecated_filter();
	}
});
ǉWxs"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-deprecated-functional-template.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_no_deprecated_functional_template = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow using deprecated the `functional` template (in Vue.js 3.0.0+)",
				categories: ["vue3-essential"],
				url: "https://eslint.vuejs.org/rules/no-deprecated-functional-template.html"
			},
			fixable: null,
			schema: [],
			messages: { unexpected: "The `functional` template are deprecated." }
		},
		/**
		* @param {RuleContext} context - The rule context.
		* @returns {RuleListener} AST event handlers.
		*/
		create(context) {
			return { Program(program) {
				const element = program.templateBody;
				if (element == null) return;
				const functional = utils.getAttribute(element, "functional");
				if (functional) context.report({
					node: functional,
					messageId: "unexpected"
				});
			} };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_deprecated_functional_template();
	}
});
dflxxs"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-deprecated-html-element-is.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_no_deprecated_html_element_is = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow using deprecated the `is` attribute on HTML elements (in Vue.js 3.0.0+)",
				categories: ["vue3-essential"],
				url: "https://eslint.vuejs.org/rules/no-deprecated-html-element-is.html"
			},
			fixable: null,
			schema: [],
			messages: { unexpected: "The `is` attribute on HTML element are deprecated." }
		},
		/** @param {RuleContext} context */
		create(context) {
			/** @param {VElement} node */
			function isValidElement(node) {
				return !utils.isHtmlWellKnownElementName(node.rawName) && !utils.isSvgWellKnownElementName(node.rawName) && !utils.isMathWellKnownElementName(node.rawName);
			}
			return utils.defineTemplateBodyVisitor(context, {
				/** @param {VDirective} node */
				"VAttribute[directive=true][key.name.name='bind'][key.argument.name='is']"(node) {
					if (isValidElement(node.parent.parent)) return;
					context.report({
						node,
						loc: node.loc,
						messageId: "unexpected"
					});
				},
				/** @param {VAttribute} node */
				"VAttribute[directive=false][key.name='is']"(node) {
					if (isValidElement(node.parent.parent)) return;
					if (node.value && node.value.value.startsWith("vue:")) return;
					context.report({
						node,
						loc: node.loc,
						messageId: "unexpected"
					});
				}
			});
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_deprecated_html_element_is();
	}
});
p*x<	"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-lone-template.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_no_lone_template = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const SPECIAL_TEMPLATE_DIRECTIVES = /* @__PURE__ */ new Set([
		"if",
		"else",
		"else-if",
		"for",
		"slot"
	]);
	/**
	* @param {VAttribute | VDirective} attr
	*/
	function getKeyName(attr) {
		if (attr.directive) {
			if (attr.key.name.name !== "bind") return null;
			if (!attr.key.argument || attr.key.argument.type === "VExpressionContainer") return null;
			return attr.key.argument.name;
		}
		return attr.key.name;
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow unnecessary `<template>`",
				categories: ["vue3-recommended", "vue2-recommended"],
				url: "https://eslint.vuejs.org/rules/no-lone-template.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: { ignoreAccessible: { type: "boolean" } },
				additionalProperties: false
			}],
			messages: { requireDirective: "`<template>` require directive." }
		},
		/** @param {RuleContext} context */
		create(context) {
			const shouldIgnoreAccessible = (context.options[0] || {}).ignoreAccessible === true;
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VStartTag} node */
"VElement[name='template'][parent.type='VElement'] > VStartTag"(node) {
				if (node.attributes.some((attr) => {
					if (attr.directive) {
						const directiveName = attr.key.name.name;
						if (SPECIAL_TEMPLATE_DIRECTIVES.has(directiveName)) return true;
						if (directiveName === "slot-scope") return true;
						if (directiveName === "scope") return true;
					}
					return getKeyName(attr) === "slot";
				})) return;
				if (shouldIgnoreAccessible && node.attributes.some((attr) => {
					const keyName = getKeyName(attr);
					return keyName === "id" || keyName === "ref";
				})) return;
				context.report({
					node,
					messageId: "requireDirective"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_lone_template();
	}
});
Jxe
deprecated-inliqdeprecated_inli{;X>sing deprecated `inline-template` attribute (in Vue.js 3.0.0+)	essential0deprecated-inli6?],
			messages: { unexpected: "`inline-template` are deprecatedGCbIdentifier} node */
"VAttribute[directive=false] > VIdentifier[rawName='inline-template']"(node) {O&*loc: node.loc,
					messageId: "unexpected%deprecated_inline_template();
	}
});
lx["use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-deprecated-model-definition.js
/**
* @author Flo Edelmann
* See LICENSE file in root directory for full license.
*/
var require_no_deprecated_model_definition = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const allowedPropNames = /* @__PURE__ */ new Set(["modelValue", "model-value"]);
	const allowedEventNames = /* @__PURE__ */ new Set(["update:modelValue", "update:model-value"]);
	/**
	* @param {ObjectExpression} node
	* @param {string} key
	* @returns {Literal | TemplateLiteral | undefined}
	*/
	function findPropertyValue(node, key) {
		const property = node.properties.find((property) => property.type === "Property" && property.key.type === "Identifier" && property.key.name === key);
		if (!property || property.type !== "Property" || !utils.isStringLiteral(property.value)) return;
		return property.value;
	}
	/**
	* @param {RuleFixer} fixer
	* @param {Literal | TemplateLiteral} node
	* @param {string} text
	*/
	function replaceLiteral(fixer, node, text) {
		return fixer.replaceTextRange([node.range[0] + 1, node.range[1] - 1], text);
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow deprecated `model` definition (in Vue.js 3.0.0+)",
				categories: ["vue3-essential"],
				url: "https://eslint.vuejs.org/rules/no-deprecated-model-definition.html"
			},
			fixable: null,
			hasSuggestions: true,
			schema: [{
				type: "object",
				additionalProperties: false,
				properties: { allowVue3Compat: { type: "boolean" } }
			}],
			messages: {
				deprecatedModel: "`model` definition is deprecated.",
				vue3Compat: "`model` definition is deprecated. You may use the Vue 3-compatible `modelValue`/`update:modelValue` though.",
				changeToModelValue: "Change to `modelValue`/`update:modelValue`.",
				changeToKebabModelValue: "Change to `model-value`/`update:model-value`."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const shouldAllowVue3Compat = Boolean(context.options[0]?.allowVue3Compat);
			return utils.executeOnVue(context, (obj) => {
				const modelProperty = utils.findProperty(obj, "model");
				if (!modelProperty || modelProperty.value.type !== "ObjectExpression") return;
				if (!shouldAllowVue3Compat) {
					context.report({
						node: modelProperty,
						messageId: "deprecatedModel"
					});
					return;
				}
				const propName = findPropertyValue(modelProperty.value, "prop");
				const eventName = findPropertyValue(modelProperty.value, "event");
				if (!propName || !eventName || !allowedPropNames.has(utils.getStringLiteralValue(propName, true) ?? "") || !allowedEventNames.has(utils.getStringLiteralValue(eventName, true) ?? "")) context.report({
					node: modelProperty,
					messageId: "vue3Compat",
					suggest: propName && eventName ? [{
						messageId: "changeToModelValue",
						*fix(fixer) {
							const newPropName = "modelValue";
							const newEventName = "update:modelValue";
							yield replaceLiteral(fixer, propName, newPropName);
							yield replaceLiteral(fixer, eventName, newEventName);
						}
					}, {
						messageId: "changeToKebabModelValue",
						*fix(fixer) {
							const newPropName = "model-value";
							const newEventName = "update:model-value";
							yield replaceLiteral(fixer, propName, newPropName);
							yield replaceLiteral(fixer, eventName, newEventName);
						}
					}] : []
				});
			});
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_deprecated_model_definition();
	}
});
 x!"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-deprecated-props-default-this.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_no_deprecated_props_default_this = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @param {Expression|SpreadElement|null} node
	*/
	function isFunctionIdentifier(node) {
		return node && node.type === "Identifier" && node.name === "Function";
	}
	/**
	* @param {Expression} node
	* @returns {boolean}
	*/
	function hasFunctionType(node) {
		if (isFunctionIdentifier(node)) return true;
		if (node.type === "ArrayExpression") return node.elements.some(isFunctionIdentifier);
		return false;
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow deprecated `this` access in props default function (in Vue.js 3.0.0+)",
				categories: ["vue3-essential"],
				url: "https://eslint.vuejs.org/rules/no-deprecated-props-default-this.html"
			},
			fixable: null,
			schema: [],
			messages: { deprecated: "Props default value factory functions no longer have access to `this`." }
		},
		/** @param {RuleContext} context */
		create(context) {
			/**
			* @typedef {object} ScopeStack
			* @property {ScopeStack | null} upper
			* @property {FunctionExpression | FunctionDeclaration} node
			* @property {boolean} propDefault
			*/
			/** @type {Set<FunctionExpression>} */
			const propsDefault = /* @__PURE__ */ new Set();
			/** @type {ScopeStack | null} */
			let scopeStack = null;
			/**
			* @param {FunctionExpression | FunctionDeclaration | ArrowFunctionExpression} node
			*/
			function onFunctionEnter(node) {
				if (node.type === "ArrowFunctionExpression") return;
				if (scopeStack) scopeStack = {
					upper: scopeStack,
					node,
					propDefault: false
				};
				else if (node.type === "FunctionExpression" && propsDefault.has(node)) scopeStack = {
					upper: scopeStack,
					node,
					propDefault: true
				};
			}
			/**
			* @param {FunctionExpression | FunctionDeclaration | ArrowFunctionExpression} node
			*/
			function onFunctionExit(node) {
				if (scopeStack && scopeStack.node === node) scopeStack = scopeStack.upper;
			}
			return utils.defineVueVisitor(context, {
				onVueObjectEnter(node) {
					for (const prop of utils.getComponentPropsFromOptions(node)) {
						if (prop.type !== "object") continue;
						if (prop.value.type !== "ObjectExpression") continue;
						const def = utils.findProperty(prop.value, "default");
						if (!def) continue;
						const type = utils.findProperty(prop.value, "type");
						if (type && hasFunctionType(type.value)) continue;
						if (def.value.type !== "FunctionExpression") continue;
						propsDefault.add(def.value);
					}
				},
				":function": onFunctionEnter,
				":function:exit": onFunctionExit,
				ThisExpression(node) {
					if (scopeStack && scopeStack.propDefault) context.report({
						node,
						messageId: "deprecated"
					});
				}
			});
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_deprecated_props_default_this();
	}
});
+&ھ|x1const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
//#region lib/rules/no-deprecated-router-link-tag-prop.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
function getComponentNames(context) {
	const components = context.options[0] && context.options[0].components ? context.options[0].components : ["RouterLink"];
	return new Set(components.flatMap((component) => [require_casing.kebabCase(component), require_casing.pascalCase(component)]));
}
var no_deprecated_router_link_tag_prop_default = {
	meta: {
		type: "problem",
		docs: {
			description: "disallow using deprecated `tag` property on `RouterLink` (in Vue.js 3.0.0+)",
			categories: ["vue3-essential"],
			url: "https://eslint.vuejs.org/rules/no-deprecated-router-link-tag-prop.html"
		},
		fixable: null,
		schema: [{
			type: "object",
			properties: { components: {
				type: "array",
				items: { type: "string" },
				uniqueItems: true,
				minItems: 1
			} },
			additionalProperties: false
		}],
		messages: { deprecated: "'tag' property on '{{element}}' component is deprecated. Use scoped slots instead." }
	},
	create(context) {
		const components = getComponentNames(context);
		return import_utils.default.defineTemplateBodyVisitor(context, { VElement(node) {
			if (!components.has(node.rawName)) return;
			let tagKey = null;
			const tagAttr = import_utils.default.getAttribute(node, "tag");
			if (tagAttr) tagKey = tagAttr.key;
			else {
				const directive = import_utils.default.getDirective(node, "bind", "tag");
				if (directive) {
					const arg = directive.key.argument;
					if (arg && arg.type === "VIdentifier") tagKey = arg;
				}
			}
			if (tagKey) context.report({
				node: tagKey,
				messageId: "deprecated",
				data: { element: node.rawName }
			});
		} });
	}
};
//#endregion
exports.default = no_deprecated_router_link_tag_prop_default;
`+Vxi"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_slot_scope_attribute$1 = require("./syntaxes/slot-scope-attribute.js");
//#region lib/rules/no-deprecated-slot-scope-attribute.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_no_deprecated_slot_scope_attribute = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const slotScopeAttribute = require_slot_scope_attribute$1.default;
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow deprecated `slot-scope` attribute (in Vue.js 2.6.0+)",
				categories: ["vue3-essential"],
				url: "https://eslint.vuejs.org/rules/no-deprecated-slot-scope-attribute.html"
			},
			fixable: "code",
			schema: [],
			messages: { forbiddenSlotScopeAttribute: "`slot-scope` are deprecated." }
		},
		/** @param {RuleContext} context */
		create(context) {
			const templateBodyVisitor = slotScopeAttribute.createTemplateBodyVisitor(context, { fixToUpgrade: true });
			return utils.defineTemplateBodyVisitor(context, templateBodyVisitor);
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_deprecated_slot_scope_attribute();
	}
});
w6vxq 

(8copeAttribute = require/5c>W"copeAttribute: "`scope` attributess,/sؓP*Oxconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_slot_attribute = require("./syntaxes/slot-attribute.js");
//#region lib/rules/no-deprecated-slot-attribute.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
var no_deprecated_slot_attribute_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "disallow deprecated `slot` attribute (in Vue.js 2.6.0+)",
			categories: ["vue3-essential"],
			url: "https://eslint.vuejs.org/rules/no-deprecated-slot-attribute.html"
		},
		fixable: "code",
		schema: [{
			type: "object",
			properties: {
				ignore: {
					type: "array",
					items: { type: "string" },
					uniqueItems: true
				},
				ignoreParents: {
					type: "array",
					items: { type: "string" },
					uniqueItems: true
				}
			},
			additionalProperties: false
		}],
		messages: { forbiddenSlotAttribute: "`slot` attributes are deprecated." }
	},
	create(context) {
		const templateBodyVisitor = require_slot_attribute.default.createTemplateBodyVisitor(context);
		return import_utils.default.defineTemplateBodyVisitor(context, templateBodyVisitor);
	}
};
//#endregion
exports.default = no_deprecated_slot_attribute_default;
ϫx("use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/valid-v-bind-sync.js
/**
* @fileoverview enforce valid `.sync` modifier on `v-bind` directives
* @author Yosuke Ota
*/
var require_valid_v_bind_sync = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* Check whether the given node is valid or not.
	* @param {VElement} node The element node to check.
	* @returns {boolean} `true` if the node is valid.
	*/
	function isValidElement(node) {
		return utils.isCustomComponent(node);
	}
	/**
	* Check whether the given node is a MemberExpression containing an optional chaining.
	* e.g.
	* - `a?.b`
	* - `a?.b.c`
	* @param {ASTNode} node The node to check.
	* @returns {boolean} `true` if the node is a MemberExpression containing an optional chaining.
	*/
	function isOptionalChainingMemberExpression(node) {
		return node.type === "ChainExpression" && node.expression.type === "MemberExpression";
	}
	/**
	* Check whether the given node can be LHS (left-hand side).
	* @param {ASTNode} node The node to check.
	* @returns {boolean} `true` if the node can be LHS.
	*/
	function isLhs(node) {
		return node.type === "Identifier" || node.type === "MemberExpression";
	}
	/**
	* Check whether the given node is a MemberExpression of a possibly null object.
	* e.g.
	* - `(a?.b).c`
	* - `(null).foo`
	* @param {ASTNode} node The node to check.
	* @returns {boolean} `true` if the node is a MemberExpression of a possibly null object.
	*/
	function maybeNullObjectMemberExpression(node) {
		if (node.type !== "MemberExpression") return false;
		const { object } = node;
		if (object.type === "ChainExpression") return true;
		if (object.type === "Literal" && object.value === null && !object.bigint) return true;
		if (object.type === "MemberExpression") return maybeNullObjectMemberExpression(object);
		return false;
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce valid `.sync` modifier on `v-bind` directives",
				categories: ["vue2-essential"],
				url: "https://eslint.vuejs.org/rules/valid-v-bind-sync.html"
			},
			fixable: null,
			deprecated: true,
			schema: [],
			messages: {
				unexpectedInvalidElement: "'.sync' modifiers aren't supported on <{{name}}> non Vue-components.",
				unexpectedOptionalChaining: "Optional chaining cannot appear in 'v-bind' with '.sync' modifiers.",
				unexpectedNonLhsExpression: "'.sync' modifiers require the attribute value which is valid as LHS.",
				unexpectedNullObject: "'.sync' modifier has potential null object property access.",
				unexpectedUpdateIterationVariable: "'.sync' modifiers cannot update the iteration variable '{{varName}}' itself."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VDirective} node */
"VAttribute[directive=true][key.name.name='bind']"(node) {
				if (!node.key.modifiers.map((mod) => mod.name).includes("sync")) return;
				const element = node.parent.parent;
				const name = element.name;
				if (!isValidElement(element)) context.report({
					node,
					messageId: "unexpectedInvalidElement",
					data: { name }
				});
				if (!node.value) return;
				const expression = node.value.expression;
				if (!expression) return;
				if (isOptionalChainingMemberExpression(expression)) context.report({
					node: expression,
					messageId: "unexpectedOptionalChaining"
				});
				else if (!isLhs(expression)) context.report({
					node: expression,
					messageId: "unexpectedNonLhsExpression"
				});
				else if (maybeNullObjectMemberExpression(expression)) context.report({
					node: expression,
					messageId: "unexpectedNullObject"
				});
				for (const reference of node.value.references) {
					const id = reference.id;
					if (id.parent.type !== "VExpressionContainer") continue;
					if (reference.variable) context.report({
						node: expression,
						messageId: "unexpectedUpdateIterationVariable",
						data: { varName: id.name }
					});
				}
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_valid_v_bind_sync();
	}
});
7/ex!no-deprecatePauthor Przemyslaw Falowski (@przemkow)
* @fileoverview Disallow use of deprecate(/ (in Vue.js 3.0.0+)
*/
var require_no_deprecate"}Ndisallow use of deprecate(, (in Vue.js 3.0.0+)",
				categories: ["vue3\7no-deprecate&"code" syncModifierIsDeprecated	G on 'v-bind' directive is deprecated. Use 'v-model:propName' instead." 
vC<,
					loc: node.loc,
					messageId: "syncModifierIsDeprecated",
					fix(fixer) {
						if (node.key.argument == null) return null;
						if (node.key.modifiers.length > 1) return null;
						const bindArgument = context.sourceCode.getText(node.key.arg[ument);
						return fixer.replaceText(node.key, `v-model:${bindArgument}`);
					}
				});4no_deprecateNx
"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/valid-v-is.js
/**
* @fileoverview enforce valid `v-is` directives
* @author Yosuke Ota
*/
var require_valid_v_is = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* Check whether the given node is valid or not.
	* @param {VElement} node The element node to check.
	* @returns {boolean} `true` if the node is valid.
	*/
	function isValidElement(node) {
		return !utils.isHtmlElementNode(node) || utils.isHtmlWellKnownElementName(node.rawName);
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce valid `v-is` directives",
				categories: ["vue3-essential"],
				url: "https://eslint.vuejs.org/rules/valid-v-is.html"
			},
			fixable: null,
			schema: [],
			messages: {
				unexpectedArgument: "'v-is' directives require no argument.",
				unexpectedModifier: "'v-is' directives require no modifier.",
				expectedValue: "'v-is' directives require that attribute value.",
				ownerMustBeHTMLElement: "'v-is' directive must be owned by a native HTML element, but '{{name}}' is not."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { "VAttribute[directive=true][key.name.name='is']"(node) {
				if (node.key.argument) context.report({
					node: node.key.argument,
					messageId: "unexpectedArgument"
				});
				const lastModifier = node.key.modifiers.at(-1);
				if (lastModifier) context.report({
					node,
					loc: {
						start: node.key.modifiers[0].loc.start,
						end: lastModifier.loc.end
					},
					messageId: "unexpectedModifier"
				});
				if (!node.value || utils.isEmptyValueDirective(node, context)) context.report({
					node,
					messageId: "expectedValue"
				});
				const element = node.parent.parent;
				if (!isValidElement(element)) {
					const name = element.name;
					context.report({
						node,
						messageId: "ownerMustBeHTMLElement",
						data: { name }
					});
				}
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_valid_v_is();
	}
});
]#x	/const require_v_is$1 = require("./syntaxes/v-isno-deprecated-v-is.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_no_deprecatev#const vIs = require_v_is$1.default;)
suggestion 7disallow deprecated `v-is` directive (in Vue.js 3.1.0+)	Pno-deprecate]B1 forbiddenVIs: "`v-is` directive is deprecated." D%const templateBodyVisitor = vIs.creat1);4templateBodyVisitor`no_deprecated_v_is();
	}
});
jܽWx}"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-deprecated-v-on-native-modifier.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_no_deprecated_v_on_native_modifier = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow using deprecated `.native` modifiers (in Vue.js 3.0.0+)",
				categories: ["vue3-essential"],
				url: "https://eslint.vuejs.org/rules/no-deprecated-v-on-native-modifier.html"
			},
			fixable: null,
			schema: [],
			messages: { deprecated: "'.native' modifier on 'v-on' directive is deprecated." }
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VIdentifier & {parent:VDirectiveKey} } node */
"VAttribute[directive=true][key.name.name='on'] > VDirectiveKey > VIdentifier[name='native']"(node) {
				if (!node.parent.modifiers.includes(node)) return;
				context.report({
					node,
					messageId: "deprecated"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_deprecated_v_on_native_modifier();
	}
});
nJ^xconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_keycode_to_key = require("../utils/keycode-to-key.js");
//#region lib/rules/no-deprecated-v-on-number-modifiers.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
var no_deprecated_v_on_number_modifiers_default = {
	meta: {
		type: "problem",
		docs: {
			description: "disallow using deprecated number (keycode) modifiers (in Vue.js 3.0.0+)",
			categories: ["vue3-essential"],
			url: "https://eslint.vuejs.org/rules/no-deprecated-v-on-number-modifiers.html"
		},
		fixable: "code",
		schema: [],
		messages: { numberModifierIsDeprecated: "'KeyboardEvent.keyCode' modifier on 'v-on' directive is deprecated. Using 'KeyboardEvent.key' instead." }
	},
	create(context) {
		return import_utils.default.defineTemplateBodyVisitor(context, { "VAttribute[directive=true][key.name.name='on'] > VDirectiveKey"(node) {
			const modifier = node.modifiers.find((mod) => Number.isSafeInteger(Number(mod.name)));
			if (!modifier) return;
			const keyCodes = Number(modifier.name);
			if (keyCodes > 9 || keyCodes < 0) context.report({
				node: modifier,
				messageId: "numberModifierIsDeprecated",
				fix(fixer) {
					const key = require_keycode_to_key.default[keyCodes];
					if (!key) return null;
					return fixer.replaceText(modifier, key);
				}
			});
		} });
	}
};
//#endregion
exports.default = no_deprecated_v_on_number_modifiers_default;
k7^x"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-deprecated-vue-config-keycodes.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_no_deprecated_vue_config_keycodes = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow using deprecated `Vue.config.keyCodes` (in Vue.js 3.0.0+)",
				categories: ["vue3-essential"],
				url: "https://eslint.vuejs.org/rules/no-deprecated-vue-config-keycodes.html"
			},
			fixable: null,
			schema: [],
			messages: { unexpected: "`Vue.config.keyCodes` are deprecated." }
		},
		/** @param {RuleContext} context */
		create(context) {
			return { 
			/** @param {MemberExpression} node */
"MemberExpression[property.type='Identifier'][property.name='keyCodes']"(node) {
				const config = utils.skipChainExpression(node.object);
				if (config.type !== "MemberExpression" || config.property.type !== "Identifier" || config.property.name !== "config" || config.object.type !== "Identifier" || config.object.name !== "Vue") return;
				context.report({
					node,
					messageId: "unexpected"
				});
			} };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_deprecated_vue_config_keycodes();
	}
});
_x"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-dupe-keys.js
/**
* @fileoverview Prevents duplication of field names.
* @author Armano
*/
var require_no_dupe_keys = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { findVariable } = require("@eslint-community/eslint-utils");
	const utils = require_index.default;
	/**
	* @typedef {import('../utils').GroupName} GroupName
	* @typedef {import('eslint').Scope.Variable} Variable
	* @typedef {import('../utils').ComponentProp} ComponentProp
	*/
	/** @type {GroupName[]} */
	const GROUP_NAMES = [
		"props",
		"computed",
		"data",
		"methods",
		"setup"
	];
	/**
	* Gets the props pattern node from given `defineProps()` node
	* @param {CallExpression} node
	* @returns {Pattern|null}
	*/
	function getPropsPattern(node) {
		let target = node;
		if (target.parent && target.parent.type === "CallExpression" && target.parent.arguments[0] === target && target.parent.callee.type === "Identifier" && target.parent.callee.name === "withDefaults") target = target.parent;
		if (!target.parent || target.parent.type !== "VariableDeclarator" || target.parent.init !== target) return null;
		return target.parent.id;
	}
	/**
	* Checks whether the initialization of the given variable declarator node contains one of the references.
	* @param {VariableDeclarator} node
	* @param {ESNode[]} references
	*/
	function isInsideInitializer(node, references) {
		const init = node.init;
		if (!init) return false;
		return references.some((id) => init.range[0] <= id.range[0] && id.range[1] <= init.range[1]);
	}
	/**
	* Collects all renamed props from a pattern
	* @param {Pattern | null} pattern - The destructuring pattern
	* @returns {Set<string>} - Set of prop names that have been renamed
	*/
	function collectRenamedProps(pattern) {
		const renamedProps = /* @__PURE__ */ new Set();
		if (!pattern || pattern.type !== "ObjectPattern") return renamedProps;
		for (const prop of pattern.properties) {
			if (prop.type !== "Property") continue;
			if (prop.key.type === "Identifier" && prop.value.type === "Identifier" && prop.key.name !== prop.value.name) renamedProps.add(prop.key.name);
		}
		return renamedProps;
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow duplication of field names",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/no-dupe-keys.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: { groups: { type: "array" } },
				additionalProperties: false
			}],
			messages: { duplicateKey: "Duplicate key '{{name}}'. May cause name collision in script or template tag." }
		},
		/** @param {RuleContext} context */
		create(context) {
			const options = context.options[0] || {};
			const groups = /* @__PURE__ */ new Set([...GROUP_NAMES, ...options.groups || []]);
			return utils.compositingVisitors(utils.executeOnVue(context, (obj) => {
				const properties = utils.iterateProperties(obj, groups);
				/** @type {Set<string>} */
				const usedNames = /* @__PURE__ */ new Set();
				for (const o of properties) {
					if (usedNames.has(o.name)) context.report({
						node: o.node,
						messageId: "duplicateKey",
						data: { name: o.name }
					});
					usedNames.add(o.name);
				}
			}), utils.defineScriptSetupVisitor(context, { onDefinePropsEnter(node, props) {
				const propsNode = getPropsPattern(node);
				const propReferences = [...propsNode ? extractReferences(propsNode) : [], node];
				const renamedProps = collectRenamedProps(propsNode);
				for (const prop of props) {
					if (!prop.propName) continue;
					if (renamedProps.has(prop.propName)) continue;
					const variable = findVariable(utils.getScope(context, node), prop.propName);
					if (!variable || variable.defs.length === 0) continue;
					if (variable.defs.some((def) => {
						if (def.type !== "Variable") return false;
						return isInsideInitializer(def.node, propReferences);
					})) continue;
					context.report({
						node: variable.defs[0].node,
						messageId: "duplicateKey",
						data: { name: prop.propName }
					});
				}
			} }));
			/**
			* Extracts references from the given node.
			* @param {Pattern} node
			* @returns {Identifier[]} References
			*/
			function extractReferences(node) {
				if (node.type === "Identifier") {
					const variable = findVariable(utils.getScope(context, node), node);
					if (!variable) return [];
					return variable.references.map((ref) => ref.identifier);
				}
				if (node.type === "ObjectPattern") return node.properties.flatMap((prop) => extractReferences(prop.type === "Property" ? prop.value : prop));
				if (node.type === "AssignmentPattern") return extractReferences(node.left);
				if (node.type === "RestElement") return extractReferences(node.argument);
				return [];
			}
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_dupe_keys();
	}
});
7xðx "use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-dupe-v-else-if.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_no_dupe_v_else_if = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef {NonNullable<VExpressionContainer['expression']>} VExpression
	*/
	/**
	* @typedef {object} OrOperands
	* @property {VExpression} OrOperands.node
	* @property {AndOperands[]} OrOperands.operands
	*
	* @typedef {object} AndOperands
	* @property {VExpression} AndOperands.node
	* @property {VExpression[]} AndOperands.operands
	*/
	/**
	* Splits the given node by the given logical operator.
	* @param {string} operator Logical operator `||` or `&&`.
	* @param {VExpression} node The node to split.
	* @returns {VExpression[]} Array of conditions that makes the node when joined by the operator.
	*/
	function splitByLogicalOperator(operator, node) {
		if (node.type === "LogicalExpression" && node.operator === operator) return [...splitByLogicalOperator(operator, node.left), ...splitByLogicalOperator(operator, node.right)];
		return [node];
	}
	/**
	* @param {VExpression} node
	*/
	function splitByOr(node) {
		return splitByLogicalOperator("||", node);
	}
	/**
	* @param {VExpression} node
	*/
	function splitByAnd(node) {
		return splitByLogicalOperator("&&", node);
	}
	/**
	* @param {VExpression} node
	* @returns {OrOperands}
	*/
	function buildOrOperands(node) {
		return {
			node,
			operands: splitByOr(node).map((orOperand) => {
				return {
					node: orOperand,
					operands: splitByAnd(orOperand)
				};
			})
		};
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow duplicate conditions in `v-if` / `v-else-if` chains",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/no-dupe-v-else-if.html"
			},
			fixable: null,
			schema: [],
			messages: { unexpected: "This branch can never execute. Its condition is a duplicate or covered by previous conditions in the `v-if` / `v-else-if` chain." }
		},
		/** @param {RuleContext} context */
		create(context) {
			const sourceCode = context.sourceCode;
			const tokenStore = sourceCode.parserServices.getTemplateBodyTokenStore && sourceCode.parserServices.getTemplateBodyTokenStore();
			/**
			* Determines whether the two given nodes are considered to be equal. In particular, given that the nodes
			* represent expressions in a boolean context, `||` and `&&` can be considered as commutative operators.
			* @param {VExpression} a First node.
			* @param {VExpression} b Second node.
			* @returns {boolean} `true` if the nodes are considered to be equal.
			*/
			function equal(a, b) {
				if (a.type !== b.type) return false;
				if (a.type === "LogicalExpression" && b.type === "LogicalExpression" && (a.operator === "||" || a.operator === "&&") && a.operator === b.operator) return equal(a.left, b.left) && equal(a.right, b.right) || equal(a.left, b.right) && equal(a.right, b.left);
				return utils.equalTokens(a, b, tokenStore);
			}
			/**
			* Determines whether the first given AndOperands is a subset of the second given AndOperands.
			*
			* e.g. A: (a && b), B: (a && b && c): B is a subset of A.
			*
			* @param {AndOperands} operandsA The AndOperands to compare from.
			* @param {AndOperands} operandsB The AndOperands to compare against.
			* @returns {boolean} `true` if the `andOperandsA` is a subset of the `andOperandsB`.
			*/
			function isSubset(operandsA, operandsB) {
				return operandsA.operands.every((operandA) => operandsB.operands.some((operandB) => equal(operandA, operandB)));
			}
			return utils.defineTemplateBodyVisitor(context, { "VAttribute[directive=true][key.name.name='else-if']"(node) {
				if (!node.value || !node.value.expression) return;
				const test = node.value.expression;
				const listToCheck = (test.type === "LogicalExpression" && test.operator === "&&" ? [...splitByAnd(test), test] : [test]).map(buildOrOperands);
				/** @type {VElement | null} */
				let current = node.parent.parent;
				while (current &&= utils.prevSibling(current)) {
					const vIf = utils.getDirective(current, "if");
					const currentTestDir = vIf || utils.getDirective(current, "else-if");
					if (!currentTestDir) return;
					if (currentTestDir.value && currentTestDir.value.expression) {
						const currentOrOperands = buildOrOperands(currentTestDir.value.expression);
						for (const condition of listToCheck) if ((condition.operands = condition.operands.filter((orOperand) => currentOrOperands.operands.every((currentOrOperand) => !isSubset(currentOrOperand, orOperand)))).length === 0) {
							context.report({
								node: condition.node,
								messageId: "unexpected"
							});
							return;
						}
					}
					if (vIf) return;
				}
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_dupe_v_else_if();
	}
});
xx"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-duplicate-attr-inheritance.js
/**
* @fileoverview Disable inheritAttrs when using v-bind="$attrs"
* @author Hiroki Osame
*/
var require_no_duplicate_attr_inheritance = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/** @param {VElement[]} elements */
	function isConditionalGroup(elements) {
		const firstElement = elements[0];
		const lastElement = elements.at(-1);
		if (!lastElement || elements.length < 2) return false;
		const inBetweenElements = elements.slice(1, -1);
		return utils.hasDirective(firstElement, "if") && (utils.hasDirective(lastElement, "else-if") || utils.hasDirective(lastElement, "else")) && inBetweenElements.every((element) => utils.hasDirective(element, "else-if"));
	}
	/** @param {VElement[]} elements */
	function isMultiRootNodes(elements) {
		return elements.length > 1 && !isConditionalGroup(elements);
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "enforce `inheritAttrs` to be set to `false` when using `v-bind=\"$attrs\"`",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/no-duplicate-attr-inheritance.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: { checkMultiRootNodes: { type: "boolean" } },
				additionalProperties: false
			}],
			messages: { noDuplicateAttrInheritance: "Set \"inheritAttrs\" to false." }
		},
		/** @param {RuleContext} context */
		create(context) {
			const shouldCheckMultiRootNodes = (context.options[0] || {}).checkMultiRootNodes === true;
			/** @type {Literal['value']} */
			let shouldInheritAttrs = true;
			/** @type {VReference[]} */
			const attrsRefs = [];
			/** @param {ObjectExpression} node */
			function processOptions(node) {
				const inheritAttrsProp = utils.findProperty(node, "inheritAttrs");
				if (inheritAttrsProp && inheritAttrsProp.value.type === "Literal") shouldInheritAttrs = inheritAttrsProp.value.value;
			}
			return utils.compositingVisitors(utils.executeOnVue(context, processOptions), utils.defineScriptSetupVisitor(context, { onDefineOptionsEnter(node) {
				if (node.arguments.length === 0) return;
				const define = node.arguments[0];
				if (define.type !== "ObjectExpression") return;
				processOptions(define);
			} }), utils.defineTemplateBodyVisitor(context, { 
			/** @param {VExpressionContainer} node */
"VAttribute[directive=true][key.name.name='bind'][key.argument=null] > VExpressionContainer"(node) {
				if (!shouldInheritAttrs) return;
				const reference = node.references.find((reference) => {
					if (reference.variable != null) return false;
					return reference.id.name === "$attrs";
				});
				if (reference) attrsRefs.push(reference);
			} }), { "Program:exit"(program) {
				const element = program.templateBody;
				if (element == null) return;
				const rootElements = element.children.filter(utils.isVElement);
				if (!shouldCheckMultiRootNodes && isMultiRootNodes(rootElements)) return;
				if (attrsRefs.length > 0) for (const attrsRef of attrsRefs) context.report({
					node: attrsRef.id,
					messageId: "noDuplicateAttrInheritance"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_duplicate_attr_inheritance();
	}
});
x1"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-duplicate-attributes.js
/**
* @author Toru Nagashima
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_no_duplicate_attributes = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* Get the name of the given attribute node.
	* @param {VAttribute | VDirective} attribute The attribute node to get.
	* @returns {string | null} The name of the attribute.
	*/
	function getName(attribute) {
		if (!attribute.directive) return attribute.key.name;
		if (attribute.key.name.name === "bind") return attribute.key.argument && attribute.key.argument.type === "VIdentifier" && attribute.key.argument.name || null;
		return null;
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow duplication of attributes",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/no-duplicate-attributes.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: {
					allowCoexistClass: { type: "boolean" },
					allowCoexistStyle: { type: "boolean" }
				},
				additionalProperties: false
			}],
			messages: { duplicateAttribute: "Duplicate attribute '{{name}}'." }
		},
		/** @param {RuleContext} context */
		create(context) {
			const options = context.options[0] || {};
			const shouldAllowCoexistStyle = options.allowCoexistStyle !== false;
			const shouldAllowCoexistClass = options.allowCoexistClass !== false;
			/** @type {Set<string>} */
			const directiveNames = /* @__PURE__ */ new Set();
			/** @type {Set<string>} */
			const attributeNames = /* @__PURE__ */ new Set();
			/**
			* @param {string} name
			* @param {boolean} isDirective
			*/
			function isDuplicate(name, isDirective) {
				if (shouldAllowCoexistStyle && name === "style" || shouldAllowCoexistClass && name === "class") return isDirective ? directiveNames.has(name) : attributeNames.has(name);
				return directiveNames.has(name) || attributeNames.has(name);
			}
			return utils.defineTemplateBodyVisitor(context, {
				VStartTag() {
					directiveNames.clear();
					attributeNames.clear();
				},
				VAttribute(node) {
					const name = getName(node);
					if (name == null) return;
					if (isDuplicate(name, node.directive)) context.report({
						node,
						loc: node.loc,
						messageId: "duplicateAttribute",
						data: { name }
					});
					if (node.directive) directiveNames.add(name);
					else attributeNames.add(name);
				}
			});
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_duplicate_attributes();
	}
});
$հx$"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-duplicate-class-names.js
/**
* @fileoverview disallow duplication of class names in class attributes
* @author Yizack Rangel
* See LICENSE file in root directory for full license.
*/
var require_no_duplicate_class_names = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @param {VDirective} node
	* @param {Expression} [expression]
	* @param {boolean} [isUnconditional=true] whether the expression is unconditional
	* @param {Expression} [parentExpr] parent expression for context
	* @return {IterableIterator<{ node: Literal | TemplateElement, isUnconditional: boolean, parentExpr?: Expression }>}
	*/
	function* extractClassNodes(node, expression, isUnconditional = true, parentExpr) {
		const nodeExpression = expression ?? node.value?.expression;
		if (!nodeExpression) return;
		switch (nodeExpression.type) {
			case "Literal":
				yield {
					node: nodeExpression,
					isUnconditional,
					parentExpr
				};
				break;
			case "ObjectExpression":
				for (const prop of nodeExpression.properties) if (prop.type === "Property" && prop.key?.type === "Literal" && typeof prop.key.value === "string") yield {
					node: prop.key,
					isUnconditional: false,
					parentExpr: nodeExpression
				};
				break;
			case "ArrayExpression":
				for (const element of nodeExpression.elements) {
					if (!element || element.type === "SpreadElement") continue;
					yield* extractClassNodes(node, element, isUnconditional, nodeExpression);
				}
				break;
			case "ConditionalExpression":
				yield* extractClassNodes(node, nodeExpression.consequent, false, nodeExpression);
				yield* extractClassNodes(node, nodeExpression.alternate, false, nodeExpression);
				break;
			case "TemplateLiteral":
				for (const quasi of nodeExpression.quasis) yield {
					node: quasi,
					isUnconditional,
					parentExpr: nodeExpression
				};
				for (const expr of nodeExpression.expressions) yield* extractClassNodes(node, expr, isUnconditional, nodeExpression);
				break;
			case "BinaryExpression":
				if (nodeExpression.operator === "+") {
					yield* extractClassNodes(node, nodeExpression.left, isUnconditional, nodeExpression);
					yield* extractClassNodes(node, nodeExpression.right, isUnconditional, nodeExpression);
				}
				break;
			case "LogicalExpression":
				yield* extractClassNodes(node, nodeExpression.left, isUnconditional, nodeExpression);
				yield* extractClassNodes(node, nodeExpression.right, false, nodeExpression);
				break;
		}
	}
	/**
	* @param {string} classList
	* @returns {string[]}
	*/
	function getClassNames(classList) {
		return classList.split(/\s+/).filter(Boolean);
	}
	/**
	* Append the given token to the last non-whitespace item in `kept`.
	* @param {string[]} kept
	* @param {string} token
	*/
	function appendToLastClassName(kept, token) {
		for (let j = kept.length - 1; j >= 0; j--) if (!/^\s+$/.test(kept[j])) {
			kept[j] = kept[j].split(/(\s+)/)[0] + token;
			return;
		}
	}
	/**
	* @param {string} raw - raw class names string including quotes
	* @returns {string}
	*/
	function removeDuplicateClassNames(raw) {
		const quote = raw[0];
		const inner = raw.slice(1, -1);
		const tokens = inner.split(/(\s+)/);
		/** @type {string[]} */
		const kept = [];
		const used = /* @__PURE__ */ new Set();
		for (let i = 0; i < tokens.length; i++) {
			const token = tokens[i];
			if (!token) continue;
			if (/^\s+$/.test(token)) if (kept.length > 0) kept[kept.length - 1] += token;
			else kept.push(token);
			else if (used.has(token)) {
				const nextToken = tokens[i + 1];
				if (kept.length > 0 && i + 1 < tokens.length && /^\s+$/.test(nextToken)) {
					appendToLastClassName(kept, nextToken);
					i++;
				}
			} else {
				kept.push(token);
				used.add(token);
			}
		}
		const hasTrailingSpace = /\s$/.test(inner);
		const lastItem = kept.at(-1);
		if (lastItem && !hasTrailingSpace) {
			if (!/^\s+$/.test(lastItem)) {
				const parts = lastItem.split(/(\s+)/);
				kept[kept.length - 1] = parts[0];
			}
		}
		return quote + kept.join("") + quote;
	}
	/** @param {VLiteral | Literal | TemplateElement | null} node */
	function getRawValue(node) {
		if (!node?.value) return null;
		return typeof node.value === "object" && "raw" in node.value ? node.value.raw : node.value;
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				url: "https://eslint.vuejs.org/rules/no-duplicate-class-names.html",
				description: "disallow duplication of class names in class attributes",
				categories: void 0
			},
			fixable: "code",
			schema: [],
			messages: { duplicateClassNames: "Duplicate class name{{plural}} {{names}}." }
		},
		/** @param {RuleContext} context */
		create: (context) => {
			/**
			* @param {VLiteral | Literal | TemplateElement | null} node
			*/
			function reportDuplicateClasses(node) {
				if (!node?.value) return;
				const classList = getRawValue(node);
				if (typeof classList !== "string") return;
				const classNames = getClassNames(classList);
				if (classNames.length <= 1) return;
				const seen = /* @__PURE__ */ new Set();
				const duplicates = /* @__PURE__ */ new Set();
				for (const className of classNames) if (seen.has(className)) duplicates.add(className);
				else seen.add(className);
				if (duplicates.size === 0) return;
				context.report({
					node,
					messageId: "duplicateClassNames",
					data: {
						names: [...duplicates].map((name) => `'${name}'`).join(", "),
						plural: duplicates.size > 1 ? "s" : ""
					},
					fix: (fixer) => {
						const raw = context.sourceCode.text.slice(node.range[0], node.range[1]);
						return fixer.replaceText(node, removeDuplicateClassNames(raw));
					}
				});
				return duplicates;
			}
			return utils.defineTemplateBodyVisitor(context, {
				/** @param {VAttribute} node */
				"VAttribute[directive=false][key.name='class'][value.type='VLiteral']"(node) {
					reportDuplicateClasses(node.value);
				},
				/** @param {VDirective} node */
				"VAttribute[directive=true][key.argument.name='class'][value.type='VExpressionContainer']"(node) {
					const parent = node.parent;
					const staticAttr = (parent.attributes || []).find((attr) => attr.key && attr.key.name === "class" && attr.value && attr.value.type === "VLiteral");
					/** @type {Set<string> | null} */
					const staticClasses = staticAttr && staticAttr.value && staticAttr.value.type === "VLiteral" ? new Set(getClassNames(String(staticAttr.value.value))) : null;
					/** @type {Set<string>} */
					const reported = /* @__PURE__ */ new Set();
					/** @type {Set<string>} */
					const duplicatesInExpression = /* @__PURE__ */ new Set();
					/** @type {Map<string, ASTNode>} */
					const seen = /* @__PURE__ */ new Map();
					/** @type {Map<string, {node: ASTNode, isUnconditional: boolean, parentExpr?: Expression}>} */
					const collected = /* @__PURE__ */ new Map();
					/**
					* @param {string} className
					* @param {Literal | TemplateElement} reportNode
					* @param {boolean} isUnconditional
					* @param {Expression} [parentExpr]
					*/
					function collectClassName(className, reportNode, isUnconditional, parentExpr) {
						if (reported.has(className)) return;
						const existing = collected.get(className);
						if (existing) {
							const isSameParent = parentExpr && existing.parentExpr === parentExpr && (parentExpr.type === "BinaryExpression" || parentExpr.type === "TemplateLiteral");
							if (existing.isUnconditional || isUnconditional || isSameParent) duplicatesInExpression.add(className);
						} else collected.set(className, {
							node: reportNode.parent,
							isUnconditional,
							parentExpr
						});
						if (isUnconditional) if (seen.has(className)) duplicatesInExpression.add(className);
						else seen.set(className, reportNode.parent);
					}
					const classNodes = extractClassNodes(node);
					for (const { node: reportNode, isUnconditional, parentExpr } of classNodes) {
						const reportedClasses = reportDuplicateClasses(reportNode);
						if (reportedClasses) for (const reportedClass of reportedClasses) reported.add(reportedClass);
						const classList = getRawValue(reportNode);
						if (typeof classList !== "string") continue;
						const classNames = getClassNames(classList);
						for (const className of classNames) collectClassName(className, reportNode, isUnconditional, parentExpr);
						if (staticClasses) {
							const intersection = classNames.filter((n) => staticClasses.has(n));
							if (intersection.length > 0 && parent) context.report({
								node: parent,
								messageId: "duplicateClassNames",
								data: {
									names: intersection.map((name) => `'${name}'`).join(", "),
									plural: intersection.length > 1 ? "s" : ""
								}
							});
						}
					}
					for (const className of duplicatesInExpression) {
						const reportNode = seen.get(className) || collected.get(className)?.node;
						if (reportNode) context.report({
							node: reportNode,
							messageId: "duplicateClassNames",
							data: {
								names: `'${className}'`,
								plural: ""
							}
						});
					}
				}
			});
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_duplicate_class_names();
	}
});
A,x
-"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-empty-component-block.js
/**
* @author tyankatsu <https://github.com/tyankatsu0105>
* See LICENSE file in root directory for full license.
*/
var require_no_empty_component_block = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { isVElement } = require_index.default;
	/**
	* check whether has attribute `src`
	* @param {VElement} componentBlock
	*/
	function hasAttributeSrc(componentBlock) {
		const hasAttribute = componentBlock.startTag.attributes.length > 0;
		const hasSrc = componentBlock.startTag.attributes.some((attribute) => !attribute.directive && attribute.key.name === "src" && attribute.value && attribute.value.value !== "");
		return hasAttribute && hasSrc;
	}
	/**
	* check whether value under the component block is only whitespaces or break lines
	* @param {VElement} componentBlock
	*/
	function isValueOnlyWhiteSpacesOrLineBreaks(componentBlock) {
		return componentBlock.children.length === 1 && componentBlock.children[0].type === "VText" && !componentBlock.children[0].value.trim();
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow the `<template>` `<script>` `<style>` block to be empty",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/no-empty-component-block.html"
			},
			fixable: "code",
			schema: [],
			messages: { unexpected: "`<{{ blockName }}>` is empty. Empty block is not allowed." }
		},
		/**
		* @param {RuleContext} context - The rule context.
		* @returns {RuleListener} AST event handlers.
		*/
		create(context) {
			const sourceCode = context.sourceCode;
			if (!sourceCode.parserServices.getDocumentFragment) return {};
			const documentFragment = sourceCode.parserServices.getDocumentFragment();
			if (!documentFragment) return {};
			const componentBlocks = documentFragment.children.filter(isVElement);
			return { Program() {
				for (const componentBlock of componentBlocks) {
					if (componentBlock.name !== "template" && componentBlock.name !== "script" && componentBlock.name !== "style") continue;
					if (hasAttributeSrc(componentBlock)) continue;
					if (isValueOnlyWhiteSpacesOrLineBreaks(componentBlock) || componentBlock.children.length === 0) context.report({
						node: componentBlock,
						loc: componentBlock.loc,
						messageId: "unexpected",
						data: { blockName: componentBlock.name },
						fix(fixer) {
							return fixer.remove(componentBlock);
						}
					});
				}
			} };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_empty_component_block();
	}
});
kv"x%"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-empty-pattern.js
/**
* @author Yosuke Ota
*/
var require_no_empty_pattern = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapCoreRule } = require_index.default;
	module.exports = wrapCoreRule("no-empty-pattern");
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_empty_pattern();
	}
});
ifx~"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-export-in-script-setup.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_no_export_in_script_setup = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef {import('@typescript-eslint/types').TSESTree.ExportAllDeclaration} TSESTreeExportAllDeclaration
	* @typedef {import('@typescript-eslint/types').TSESTree.ExportDefaultDeclaration} TSESTreeExportDefaultDeclaration
	* @typedef {import('@typescript-eslint/types').TSESTree.ExportNamedDeclaration} TSESTreeExportNamedDeclaration
	*/
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow `export` in `<script setup>`",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/no-export-in-script-setup.html"
			},
			fixable: null,
			schema: [],
			messages: { forbidden: "`<script setup>` cannot contain ES module exports." }
		},
		/** @param {RuleContext} context */
		create(context) {
			/**
			* @param {ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration} node
			* @param {SourceLocation} loc
			*/
			function verify(node, loc) {
				const tsNode = node;
				if (tsNode.exportKind === "type") return;
				if (tsNode.type === "ExportNamedDeclaration" && tsNode.specifiers.length > 0 && tsNode.specifiers.every((spec) => spec.exportKind === "type")) return;
				context.report({
					node,
					loc,
					messageId: "forbidden"
				});
			}
			return utils.defineScriptSetupVisitor(context, {
				ExportAllDeclaration: (node) => verify(node, node.loc),
				ExportDefaultDeclaration: (node) => verify(node, node.loc),
				ExportNamedDeclaration: (node) => {
					if (node.declaration) verify(node, context.sourceCode.getFirstToken(node).loc);
					else verify(node, node.loc);
				}
			});
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_export_in_script_setup();
	}
});
fTxI"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-expose-after-await.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_no_expose_after_await = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { findVariable } = require("@eslint-community/eslint-utils");
	const utils = require_index.default;
	/**
	* Get the callee member node from the given CallExpression
	* @param {CallExpression} node CallExpression
	*/
	function getCalleeMemberNode(node) {
		const callee = utils.skipChainExpression(node.callee);
		if (callee.type === "MemberExpression") {
			const name = utils.getStaticPropertyName(callee);
			if (name) return {
				name,
				member: callee
			};
		}
		return null;
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow asynchronously registered `expose`",
				categories: ["vue3-essential"],
				url: "https://eslint.vuejs.org/rules/no-expose-after-await.html"
			},
			fixable: null,
			schema: [],
			messages: { forbidden: "`{{name}}` is forbidden after an `await` expression." }
		},
		/** @param {RuleContext} context */
		create(context) {
			/**
			* @typedef {object} SetupScopeData
			* @property {boolean} afterAwait
			* @property {[number,number]} range
			* @property {(node: Identifier, callNode: CallExpression) => boolean} isExposeReferenceId
			* @property {(node: Identifier) => boolean} isContextReferenceId
			*/
			/**
			* @typedef {object} ScopeStack
			* @property {ScopeStack | null} upper
			* @property {FunctionDeclaration | FunctionExpression | ArrowFunctionExpression | Program} scopeNode
			*/
			/** @type {Map<FunctionDeclaration | FunctionExpression | ArrowFunctionExpression | Program, SetupScopeData>} */
			const setupScopes = /* @__PURE__ */ new Map();
			/** @type {ScopeStack | null} */
			let scopeStack = null;
			return utils.compositingVisitors({ 
			/**
			* @param {Program} node
			*/
Program(node) {
				scopeStack = {
					upper: scopeStack,
					scopeNode: node
				};
			} }, {
				/**
				* @param {FunctionExpression | FunctionDeclaration | ArrowFunctionExpression} node
				*/
				":function"(node) {
					scopeStack = {
						upper: scopeStack,
						scopeNode: node
					};
				},
				":function:exit"() {
					scopeStack &&= scopeStack.upper;
				},
				/** @param {AwaitExpression} node */
				AwaitExpression(node) {
					if (!scopeStack) return;
					const setupScope = setupScopes.get(scopeStack.scopeNode);
					if (!setupScope || !utils.inRange(setupScope.range, node)) return;
					setupScope.afterAwait = true;
				},
				/** @param {CallExpression} node */
				CallExpression(node) {
					if (!scopeStack) return;
					const setupScope = setupScopes.get(scopeStack.scopeNode);
					if (!setupScope || !setupScope.afterAwait || !utils.inRange(setupScope.range, node)) return;
					const { isContextReferenceId, isExposeReferenceId } = setupScope;
					if (node.callee.type === "Identifier" && isExposeReferenceId(node.callee, node)) context.report({
						node,
						messageId: "forbidden",
						data: { name: node.callee.name }
					});
					else {
						const expose = getCalleeMemberNode(node);
						if (expose && expose.name === "expose" && expose.member.object.type === "Identifier" && isContextReferenceId(expose.member.object)) context.report({
							node,
							messageId: "forbidden",
							data: { name: expose.name }
						});
					}
				}
			}, (() => {
				const scriptSetup = utils.getScriptSetupElement(context);
				if (!scriptSetup) return {};
				return { 
				/**
				* @param {Program} node
				*/
Program(node) {
					setupScopes.set(node, {
						afterAwait: false,
						range: scriptSetup.range,
						isExposeReferenceId: (id, callNode) => callNode.parent.type === "ExpressionStatement" && callNode.parent.parent === node && id.name === "defineExpose",
						isContextReferenceId: () => false
					});
				} };
			})(), utils.defineVueVisitor(context, {
				onSetupFunctionEnter(node) {
					const contextParam = node.params[1];
					if (!contextParam) return;
					if (contextParam.type === "RestElement") return;
					if (contextParam.type === "ArrayPattern") return;
					/** @type {Set<Identifier>} */
					const contextReferenceIds = /* @__PURE__ */ new Set();
					/** @type {Set<Identifier>} */
					const exposeReferenceIds = /* @__PURE__ */ new Set();
					if (contextParam.type === "ObjectPattern") {
						const exposeProperty = utils.findAssignmentProperty(contextParam, "expose");
						if (!exposeProperty) return;
						const exposeParam = exposeProperty.value;
						const variable = exposeParam.type === "Identifier" ? findVariable(utils.getScope(context, exposeParam), exposeParam) : null;
						if (!variable) return;
						for (const reference of variable.references) {
							if (!reference.isRead()) continue;
							exposeReferenceIds.add(reference.identifier);
						}
					} else if (contextParam.type === "Identifier") {
						const variable = findVariable(utils.getScope(context, contextParam), contextParam);
						if (!variable) return;
						for (const reference of variable.references) {
							if (!reference.isRead()) continue;
							contextReferenceIds.add(reference.identifier);
						}
					}
					setupScopes.set(node, {
						afterAwait: false,
						range: node.range,
						isExposeReferenceId: (id) => exposeReferenceIds.has(id),
						isContextReferenceId: (id) => contextReferenceIds.has(id)
					});
				},
				onSetupFunctionExit(node) {
					setupScopes.delete(node);
				}
			}));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_expose_after_await();
	}
});
))ڴxKconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_index$1 = require("../utils/style-variables/index.js");
let _eslint_community_eslint_utils = require("@eslint-community/eslint-utils");
var no_extra_parens_default = (/* @__PURE__ */ require_runtime.__toESM(require_index.default)).default.wrapStylisticOrCoreRule("no-extra-parens", {
	skipDynamicArguments: true,
	applyDocument: true,
	create: createForVueSyntax
});
/**
* Check whether the given token is a left parenthesis.
*/
function isLeftParen(token) {
	return token.type === "Punctuator" && token.value === "(";
}
/**
* Check whether the given token is a right parenthesis.
*/
function isRightParen(token) {
	return token.type === "Punctuator" && token.value === ")";
}
/**
* Check whether the given token is a left brace.
*/
function isLeftBrace(token) {
	return token.type === "Punctuator" && token.value === "{";
}
/**
* Check whether the given token is a right brace.
*/
function isRightBrace(token) {
	return token.type === "Punctuator" && token.value === "}";
}
/**
* Check whether the given token is a left bracket.
*/
function isLeftBracket(token) {
	return token.type === "Punctuator" && token.value === "[";
}
/**
* Check whether the given token is a right bracket.
*/
function isRightBracket(token) {
	return token.type === "Punctuator" && token.value === "]";
}
/**
* Determines if a given expression node is an IIFE
*/
function isIIFE(node) {
	return node.type === "CallExpression" && node.callee.type === "FunctionExpression";
}
function createForVueSyntax(context) {
	const sourceCode = context.sourceCode;
	if (!sourceCode.parserServices.getTemplateBodyTokenStore) return {};
	const tokenStore = sourceCode.parserServices.getTemplateBodyTokenStore();
	/**
	* Checks if the given node turns into a filter when unwraped.
	*/
	function isUnwrapChangeToFilter(expression) {
		let parenStack = null;
		for (const token of tokenStore.getTokens(expression)) {
			if (parenStack) {
				if (parenStack.isUpToken(token)) {
					parenStack = parenStack.upper;
					continue;
				}
			} else if (token.value === "|") return true;
			if (isLeftParen(token)) parenStack = {
				isUpToken: isRightParen,
				upper: parenStack
			};
			else if (isLeftBracket(token)) parenStack = {
				isUpToken: isRightBracket,
				upper: parenStack
			};
			else if (isLeftBrace(token)) parenStack = {
				isUpToken: isRightBrace,
				upper: parenStack
			};
		}
		return false;
	}
	/**
	* Checks if the given node is CSS v-bind() without quote.
	*/
	function isStyleVariableWithoutQuote(node, expression) {
		const styleVars = require_index$1.getStyleVariablesContext(context);
		if (!styleVars || !styleVars.vBinds.includes(node)) return false;
		const vBindToken = tokenStore.getFirstToken(node);
		return tokenStore.getTokensBetween(vBindToken, expression).every(isLeftParen);
	}
	function verify(node) {
		if (!node.expression) return;
		const expression = node.expression.type === "VFilterSequenceExpression" ? node.expression.expression : node.expression;
		if (!(0, _eslint_community_eslint_utils.isParenthesized)(expression, tokenStore)) return;
		if (!(0, _eslint_community_eslint_utils.isParenthesized)(2, expression, tokenStore)) {
			if (isIIFE(expression) && !(0, _eslint_community_eslint_utils.isParenthesized)(expression.callee, tokenStore)) return;
			if (isUnwrapChangeToFilter(expression)) return;
			if (isStyleVariableWithoutQuote(node, expression)) return;
		}
		report(expression);
	}
	/**
	* Report the node
	*/
	function report(node) {
		const sourceCode = context.sourceCode;
		const leftParenToken = tokenStore.getTokenBefore(node);
		const rightParenToken = tokenStore.getTokenAfter(node);
		context.report({
			node,
			loc: leftParenToken.loc,
			messageId: "unexpected",
			fix(fixer) {
				const parenthesizedSource = sourceCode.text.slice(leftParenToken.range[1], rightParenToken.range[0]);
				return fixer.replaceTextRange([leftParenToken.range[0], rightParenToken.range[1]], parenthesizedSource);
			}
		});
	}
	return {
		"VAttribute[directive=true][key.name.name='bind'] > VExpressionContainer": verify,
		"VElement > VExpressionContainer": verify
	};
}
//#endregion
exports.default = no_extra_parens_default;
r1(xy"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-implicit-coercion.js
/**
* @author lozinsky <https://github.com/lozinsky>
* See LICENSE file in root directory for full license.
*/
var require_no_implicit_coercion = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	module.exports = require_index.default.wrapCoreRule("no-implicit-coercion", { applyDocument: true });
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_implicit_coercion();
	}
});
KǴx
{"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-import-compiler-macros.js
/**
* @author Wayne Zhang
* See LICENSE file in root directory for full license.
*/
var require_no_import_compiler_macros = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const COMPILER_MACROS = /* @__PURE__ */ new Set([
		"defineProps",
		"defineEmits",
		"defineExpose",
		"withDefaults",
		"defineModel",
		"defineOptions",
		"defineSlots"
	]);
	const VUE_MODULES = /* @__PURE__ */ new Set([
		"@vue/runtime-core",
		"@vue/runtime-dom",
		"vue"
	]);
	/**
	* @param {Token} node
	*/
	function isComma(node) {
		return node.type === "Punctuator" && node.value === ",";
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow importing Vue compiler macros",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/no-import-compiler-macros.html"
			},
			fixable: "code",
			schema: [],
			messages: {
				noImportCompilerMacros: "'{{name}}' is a compiler macro and doesn't need to be imported.",
				onlyValidInScriptSetup: "'{{name}}' is a compiler macro and can only be used inside <script setup>."
			}
		},
		/**
		* @param {RuleContext} context
		* @returns {RuleListener}
		*/
		create(context) {
			const sourceCode = context.sourceCode;
			return { ImportDeclaration(node) {
				if (node.specifiers.length === 0 || !VUE_MODULES.has(node.source.value)) return;
				for (const specifier of node.specifiers) {
					if (specifier.type !== "ImportSpecifier" || !COMPILER_MACROS.has(specifier.imported.name)) continue;
					context.report({
						node: specifier,
						messageId: utils.isScriptSetup(context) ? "noImportCompilerMacros" : "onlyValidInScriptSetup",
						data: { name: specifier.imported.name },
						fix: (fixer) => {
							const isOnlySpecifier = node.specifiers.length === 1;
							const isLastSpecifier = specifier === node.specifiers.at(-1);
							if (isOnlySpecifier) return fixer.remove(node);
							if (isLastSpecifier) {
								const precedingComma = sourceCode.getTokenBefore(specifier, isComma);
								return fixer.removeRange([(precedingComma || specifier).range[0], specifier.range[1]]);
							}
							const subsequentComma = sourceCode.getTokenAfter(specifier, isComma);
							return fixer.removeRange([specifier.range[0], (subsequentComma || specifier).range[1]]);
						}
					});
				}
			} };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_import_compiler_macros();
	}
});
OP^rx""use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-irregular-whitespace.js
/**
* @author Yosuke Ota
* @fileoverview Rule to disalow whitespace that is not a tab or space, whitespace inside strings and comments are allowed
*/
var require_no_irregular_whitespace = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const ALL_IRREGULARS = /[\f\v\u{85}\u{FEFF}\u{A0}\u{1680}\u{180E}\u{2000}\u{2001}\u{2002}\u{2003}\u{2004}\u{2005}\u{2006}\u{2007}\u{2008}\u{2009}\u{200A}\u{200B}\u{202F}\u{205F}\u{3000}\u{2028}\u{2029}]/u;
	const IRREGULAR_WHITESPACE = /[\f\v\u{85}\u{FEFF}\u{A0}\u{1680}\u{180E}\u{2000}\u{2001}\u{2002}\u{2003}\u{2004}\u{2005}\u{2006}\u{2007}\u{2008}\u{2009}\u{200A}\u{200B}\u{202F}\u{205F}\u{3000}]+/gmu;
	const IRREGULAR_LINE_TERMINATORS = /[\u{2028}\u{2029}]/gmu;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow irregular whitespace in `.vue` files",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/no-irregular-whitespace.html",
				extensionSource: {
					url: "https://eslint.org/docs/rules/no-irregular-whitespace",
					name: "ESLint core"
				}
			},
			schema: [{
				type: "object",
				properties: {
					skipComments: { type: "boolean" },
					skipStrings: { type: "boolean" },
					skipTemplates: { type: "boolean" },
					skipRegExps: { type: "boolean" },
					skipHTMLAttributeValues: { type: "boolean" },
					skipHTMLTextContents: { type: "boolean" }
				},
				additionalProperties: false
			}],
			messages: { disallow: "Irregular whitespace not allowed." }
		},
		/**
		* @param {RuleContext} context - The rule context.
		* @returns {RuleListener} AST event handlers.
		*/
		create(context) {
			/** @type {{start: number, end: number}[]} */
			let errorIndices = [];
			const options = context.options[0] || {};
			const shouldSkipComments = !!options.skipComments;
			const shouldSkipStrings = options.skipStrings !== false;
			const shouldSkipRegExps = !!options.skipRegExps;
			const shouldSkipTemplates = !!options.skipTemplates;
			const shouldSkipHTMLAttributeValues = !!options.skipHTMLAttributeValues;
			const shouldSkipHTMLTextContents = !!options.skipHTMLTextContents;
			const sourceCode = context.sourceCode;
			/**
			* Removes errors that occur inside a string node
			* @param {ASTNode | Token} node to check for matching errors.
			* @returns {void}
			* @private
			*/
			function removeWhitespaceError(node) {
				const [startIndex, endIndex] = node.range;
				errorIndices = errorIndices.filter((error) => error.start < startIndex || endIndex <= error.start);
			}
			/**
			* Checks literal nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors
			* @param {Literal} node to check for matching errors.
			* @returns {void}
			* @private
			*/
			function removeInvalidNodeErrorsInLiteral(node) {
				const shouldCheckStrings = shouldSkipStrings && typeof node.value === "string";
				const shouldCheckRegExps = shouldSkipRegExps && Boolean(node.regex);
				if ((shouldCheckStrings || shouldCheckRegExps) && ALL_IRREGULARS.test(sourceCode.getText(node))) removeWhitespaceError(node);
			}
			/**
			* Checks template string literal nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors
			* @param {TemplateElement} node to check for matching errors.
			* @returns {void}
			* @private
			*/
			function removeInvalidNodeErrorsInTemplateLiteral(node) {
				if (ALL_IRREGULARS.test(node.value.raw)) removeWhitespaceError(node);
			}
			/**
			* Checks HTML attribute value nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors
			* @param {VLiteral} node to check for matching errors.
			* @returns {void}
			* @private
			*/
			function removeInvalidNodeErrorsInHTMLAttributeValue(node) {
				if (ALL_IRREGULARS.test(sourceCode.getText(node))) removeWhitespaceError(node);
			}
			/**
			* Checks HTML text content nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors
			* @param {VText} node to check for matching errors.
			* @returns {void}
			* @private
			*/
			function removeInvalidNodeErrorsInHTMLTextContent(node) {
				if (ALL_IRREGULARS.test(sourceCode.getText(node))) removeWhitespaceError(node);
			}
			/**
			* Checks comment nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors
			* @param {Comment | HTMLComment | HTMLBogusComment} node to check for matching errors.
			* @returns {void}
			* @private
			*/
			function removeInvalidNodeErrorsInComment(node) {
				if (ALL_IRREGULARS.test(node.value)) removeWhitespaceError(node);
			}
			/**
			* Checks the program source for irregular whitespaces and irregular line terminators
			* @returns {void}
			* @private
			*/
			function checkForIrregularWhitespace() {
				const source = sourceCode.getText();
				let match;
				while ((match = IRREGULAR_WHITESPACE.exec(source)) !== null) errorIndices.push({
					start: match.index,
					end: match.index + match[0].length
				});
				while ((match = IRREGULAR_LINE_TERMINATORS.exec(source)) !== null) errorIndices.push({
					start: match.index,
					end: match.index + match[0].length
				});
			}
			checkForIrregularWhitespace();
			if (errorIndices.length === 0) return {};
			const bodyVisitor = utils.defineTemplateBodyVisitor(context, {
				...shouldSkipHTMLAttributeValues ? { "VAttribute[directive=false] > VLiteral": removeInvalidNodeErrorsInHTMLAttributeValue } : {},
				...shouldSkipHTMLTextContents ? { VText: removeInvalidNodeErrorsInHTMLTextContent } : {},
				Literal: removeInvalidNodeErrorsInLiteral,
				...shouldSkipTemplates ? { TemplateElement: removeInvalidNodeErrorsInTemplateLiteral } : {}
			});
			return {
				...bodyVisitor,
				Literal: removeInvalidNodeErrorsInLiteral,
				...shouldSkipTemplates ? { TemplateElement: removeInvalidNodeErrorsInTemplateLiteral } : {},
				"Program:exit"(node) {
					if (bodyVisitor["Program:exit"]) bodyVisitor["Program:exit"](node);
					const templateBody = node.templateBody;
					if (shouldSkipComments) {
						for (const node of sourceCode.getAllComments()) removeInvalidNodeErrorsInComment(node);
						if (templateBody) for (const node of templateBody.comments) removeInvalidNodeErrorsInComment(node);
					}
					const [scriptStart, scriptEnd] = node.range;
					const [templateStart, templateEnd] = templateBody ? templateBody.range : [0, 0];
					errorIndices = errorIndices.filter((error) => scriptStart <= error.start && error.start < scriptEnd || templateStart <= error.start && error.start < templateEnd);
					for (const { start, end } of errorIndices) context.report({
						loc: {
							start: sourceCode.getLocFromIndex(start),
							end: sourceCode.getLocFromIndex(end)
						},
						messageId: "disallow"
					});
				}
			};
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_irregular_whitespace();
	}
});
>xz"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-restricted-call-after-await.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_no_restricted_call_after_await = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const fs = require("node:fs");
	const path = require("node:path");
	const { ReferenceTracker } = require("@eslint-community/eslint-utils");
	const utils = require_index.default;
	/**
	* @typedef {import('@eslint-community/eslint-utils').TYPES.TraceMap} TraceMap
	* @typedef {import('@eslint-community/eslint-utils').TYPES.TraceKind} TraceKind
	*/
	/**
	* @param {string} id
	*/
	function safeRequireResolve(id) {
		try {
			if (fs.statSync(id).isDirectory()) return require.resolve(id);
		} catch {}
		return id;
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow asynchronously called restricted methods",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/no-restricted-call-after-await.html"
			},
			fixable: null,
			schema: {
				type: "array",
				items: {
					type: "object",
					properties: {
						module: { type: "string" },
						path: { oneOf: [{ type: "string" }, {
							type: "array",
							items: { type: "string" }
						}] },
						message: {
							type: "string",
							minLength: 1
						}
					},
					required: ["module"],
					additionalProperties: false
				},
				uniqueItems: true,
				minItems: 0
			},
			messages: { restricted: "{{message}}" }
		},
		/** @param {RuleContext} context */
		create(context) {
			/**
			* @typedef {object} SetupScopeData
			* @property {boolean} afterAwait
			* @property {[number,number]} range
			*/
			/** @type {Map<ESNode, string>} */
			const restrictedCallNodes = /* @__PURE__ */ new Map();
			/** @type {Map<FunctionExpression | ArrowFunctionExpression | FunctionDeclaration, SetupScopeData>} */
			const setupScopes = /* @__PURE__ */ new Map();
			/**x
			* @typedef {object} ScopeStack
			* @property {ScopeStack | null} upper
			* @property {FunctionExpression | ArrowFunctionExpression | FunctionDeclaration} scopeNode
			*/
			/** @type {ScopeStack | null} */
			let scopeStack = null;
			/** @type {Record<string, string[]> | null} */
			let allLocalImports = null;
			/**
			* @param {Program} ast
			*/
			function getAllLocalImports(ast) {
				if (!allLocalImports) {
					allLocalImports = {};
					const dir = path.dirname(context.filename);
					for (const body of ast.body) {
						if (body.type !== "ImportDeclaration") continue;
						const source = String(body.source.value);
						if (!source.startsWith(".")) continue;
						const modulePath = safeRequireResolve(path.join(dir, source));
						allLocalImports[modulePath] ||= [];
						allLocalImports[modulePath].push(source);
					}
				}
				return allLocalImports;
			}
			/**
			* @param {string} moduleName
			* @param {Program} ast
			* @returns {string[]}
			*/
			function normalizeModules(moduleName, ast) {
				/** @type {string} */
				let modulePath;
				if (moduleName.startsWith(".")) modulePath = safeRequireResolve(path.join(context.cwd, moduleName));
				else if (path.isAbsolute(moduleName)) modulePath = safeRequireResolve(moduleName);
				else return [moduleName];
				return getAllLocalImports(ast)[modulePath] || [];
			}
			return utils.compositingVisitors({ 
			/** @param {Program} node */
Program(node) {
				const tracker = new ReferenceTracker(utils.getScope(context, node));
				for (const option of context.options) {
					const modules = normalizeModules(option.module, node);
					for (const module$1 of modules) {
						/** @type {TraceMap} */
						const traceMap = { [module$1]: { [ReferenceTracker.ESM]: true } };
						let local = traceMap[module$1];
						const paths = Array.isArray(option.path) ? option.path : [option.path || "default"];
						for (const path of paths) {
							local[path] ||= {};
							local = local[path];
						}
						local[ReferenceTracker.CALL] = true;
						const message = option.message || `\`${[`import("${module$1}")`, ...paths].join(".")}\` is forbidden after an \`await\` expression.`;
						for (const { node } of tracker.iterateEsmReferences(traceMap)) restrictedCallNodes.set(node, message);
					}
				}
			} }, utils.defineVueVisitor(context, {
				onSetupFunctionEnter(node) {
					setupScopes.set(node, {
						afterAwait: false,
						range: node.range
					});
				},
				/** @param {FunctionExpression | ArrowFunctionExpression | FunctionDeclaration} node */
				":function"(node) {
					scopeStack = {
						upper: scopeStack,
						scopeNode: node
					};
				},
				":function:exit"() {
					scopeStack &&= scopeStack.upper;
				},
				/** @param {AwaitExpression} node */
				AwaitExpression(node) {
					if (!scopeStack) return;
					const setupScope = setupScopes.get(scopeStack.scopeNode);
					if (!setupScope || !utils.inRange(setupScope.range, node)) return;
					setupScope.afterAwait = true;
				},
				/** @param {CallExpression} node */
				CallExpression(node) {
					if (!scopeStack) return;
					const setupScope = setupScopes.get(scopeStack.scopeNode);
					if (!setupScope || !setupScope.afterAwait || !utils.inRange(setupScope.range, node)) return;
					const message = restrictedCallNodes.get(node);
					if (message) context.report({
						node,
						messageId: "restricted",
						data: { message }
					});
				},
				onSetupFunctionExit(node) {
					setupScopes.delete(node);
				}
			}));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_restricted_call_after_await();
	}
});
vGxr,	lifecycler	lifecycle.\/
	const LIFECYCLE_HOOKS = [
		"onBeforeMount",
		"onBeforeUnmount",
		"onBeforeUpdate",
		"onErrorCaptured",
		"onMounted",
		"onRenderTracked",
		"onRenderTriggered",
		"onUnmounted",
		"onUpdated",
		"onActivated",
		"onDeactivated"
	];
	module.export\?registered lifecycle hooks",
				categories: ["vue3-essential"]$.	lifecyclea6Y[],
			messages: { forbidden: "Lifecycle hooks are forbidden after an `await` expression.UǓ2KDeclaration | !%et<ESNode>} */
			const lifecycleHookO /Set();
			/** @type {Map<FunctionDeclaration | N|3l<program */
Program(programEprogram));
 const traceMap = {};
				for (const lifecycleHook of LIFECYCLE_HOOKS) traceMap[lifecycleHook] = { [ReferenceTracker.CALL]: true };
Uutils.iterateReferencesTraceMap(tracker, traceMap)) lifecycleHookCallNodes.add(node);
				} node
				if (lifecycleHookCallNodes.has(node)) {
						if (node.arguments.length >= 2) return;
						context.report({
							node,
					)		messageId: "forbidden"
						});
					} lifecycle_after_await();
	}
});
5qxk	const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_regexp = require("../utils/regexp.js");
//#region lib/rules/no-literals-in-template.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
const EXPRESSION_TYPES = {
	ObjectExpression: "object",
	ArrayExpression: "array",
	FunctionExpression: "function",
	ArrowFunctionExpression: "arrow function"
};
var no_literals_in_template_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "disallow object, array, and function literals in template",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/no-literals-in-template.html"
		},
		fixable: null,
		schema: [{
			type: "object",
			properties: { ignores: {
				type: "array",
				items: { type: "string" },
				uniqueItems: true,
				additionalItems: false
			} },
			additionalProperties: false
		}],
		messages: { unexpected: "Unexpected {{type}} literal in template." }
	},
	create(context) {
		const isIgnored = require_regexp.toRegExpGroupMatcher((context.options[0] || {}).ignores);
		const upperElements = /* @__PURE__ */ new Set();
		/**
		* Checks whether the given node refers to a variable of the element.
		*/
		function hasReferenceUpperElementVariable(node) {
			for (const element of upperElements) for (const variable of element.variables) for (const reference of variable.references) {
				const { range } = reference.id;
				if (node.range[0] <= range[0] && range[1] <= node.range[1]) return true;
			}
			return false;
		}
		return import_utils.default.defineTemplateBodyVisitor(context, {
			VElement(node) {
				upperElements.add(node);
			},
			"VElement:exit"(node) {
				upperElements.delete(node);
			},
			"VAttribute[directive=true][key.name.name='bind']"(node) {
				const expression = node.value?.expression;
				const argumentName = node.key.argument?.type === "VIdentifier" ? node.key.argument.name : null;
				if (!expression || argumentName === "class" || argumentName === "style" || argumentName != null && isIgnored(argumentName)) return;
				const type = EXPRESSION_TYPES[expression.type];
				if (type && !hasReferenceUpperElementVariable(expression)) context.report({
					node: expression,
					messageId: "unexpected",
					data: { type }
				});
			}
		});
	}
};
//#endregion
exports.default = no_literals_in_template_default;
I!_&xj"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-loss-of-precision.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_no_loss_of_precision = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	module.exports = require_index.default.wrapCoreRule("no-loss-of-precision", { applyDocument: true });
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_loss_of_precision();
	}
});
9x@"use strict";
//#region lib/rules/no-multi-spaces.js
/**
* @fileoverview This rule warns about the usage of extra whitespaces between attributes
* @author Armano
*/
var require_no_multi_spaces = /* @__PURE__ */ require("../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	const path = require("node:path");
	/**
	* @param {RuleContext} context
	* @param {Token} node
	*/
	const isProperty = (context, node) => {
		const sourceCode = context.sourceCode;
		return node.type === "Punctuator" && sourceCode.getText(node) === ":";
	};
	module.exports = {
		meta: {
			type: "layout",
			docs: {
				description: "disallow multiple spaces",
				categories: ["vue3-strongly-recommended", "vue2-strongly-recommended"],
				url: "https://eslint.vuejs.org/rules/no-multi-spaces.html"
			},
			fixable: "whitespace",
			schema: [{
				type: "object",
				properties: {
					ignoreProperties: { type: "boolean" },
					ignoreEOLComments: { type: "boolean" }
				},
				additionalProperties: false
			}],
			messages: {
				multipleSpaces: "Multiple spaces found before '{{displayValue}}'.",
				useLatestParser: "Use the latest vue-eslint-parser. See also https://eslint.vuejs.org/user-guide/#what-is-the-use-the-latest-vue-eslint-parser-error."
			}
		},
		/**
		* @param {RuleContext} context - The rule context.
		* @returns {RuleListener} AST event handlers.
		*/
		create(context) {
			const options = context.options[0] || {};
			const shouldIgnoreProperties = options.ignoreProperties === true;
			const shouldIgnoreEOLComments = options.ignoreEOLComments === true;
			return { Program(node) {
				const sourceCode = context.sourceCode;
				if (sourceCode.parserServices.getTemplateBodyTokenStore == null) {
					const filename = context.filename;
					if (path.extname(filename) === ".vue") context.report({
						loc: {
							line: 1,
							column: 0
						},
						messageId: "useLatestParser"
					});
					return;
				}
				if (!node.templateBody) return;
				const tokenStore = sourceCode.parserServices.getTemplateBodyTokenStore();
				const tokens = tokenStore.getTokens(node.templateBody, { includeComments: true });
				let prevToken = tokens.shift();
				for (const token of tokens) {
					const spaces = token.range[0] - prevToken.range[1];
					let shouldIgnore = shouldIgnoreProperties && (isProperty(context, token) || isProperty(context, prevToken));
					if (!shouldIgnore && shouldIgnoreEOLComments && (token.type === "Line" || token.type === "Block")) {
						const nextToken = tokenStore.getTokenAfter(token, { includeComments: true });
						if (!nextToken || nextToken.loc.start.line > token.loc.end.line) shouldIgnore = true;
					}
					if (spaces > 1 && token.loc.start.line === prevToken.loc.start.line && !shouldIgnore) context.report({
						node: token,
						loc: {
							start: prevToken.loc.end,
							end: token.loc.start
						},
						messageId: "multipleSpaces",
						fix: (fixer) => fixer.replaceTextRange([prevToken.range[1], token.range[0]], " "),
						data: { displayValue: sourceCode.getText(token) }
					});
					prevToken = token;
				}
			} };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_multi_spaces();
	}
});
-ox"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-multiple-objects-in-class.js
/**
* @author tyankatsu <https://github.com/tyankatsu0105>
* See LICENSE file in root directory for full license.
*/
var require_no_multiple_objects_in_class = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { defineTemplateBodyVisitor } = require_index.default;
	/**
	* count ObjectExpression element
	* @param {VDirective & {value: VExpressionContainer & {expression: ArrayExpression}}} node
	* @return {number}
	*/
	function countObjectExpression(node) {
		return node.value.expression.elements.filter((element) => element && element.type === "ObjectExpression").length;
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow passing multiple objects in an array to class",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/no-multiple-objects-in-class.html"
			},
			fixable: null,
			schema: [],
			messages: { unexpected: "Unexpected multiple objects. Merge objects." }
		},
		/** @param {RuleContext} context */
		create(context) {
			return defineTemplateBodyVisitor(context, { 
			/** @param {VDirective & {value: VExpressionContainer & {expression: ArrayExpression}}} node */
"VAttribute[directive=true][key.argument.name=\"class\"][key.name.name=\"bind\"][value.expression.type=\"ArrayExpression\"]"(node) {
				if (countObjectExpression(node) > 1) context.report({
					node,
					loc: node.loc,
					messageId: "unexpected"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_multiple_objects_in_class();
	}
});
S^Fx&"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-multiple-slot-args.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_no_multiple_slot_args = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const { findVariable } = require("@eslint-community/eslint-utils");
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow passing multiple arguments to scoped slots",
				categories: ["vue3-recommended", "vue2-recommended"],
				url: "https://eslint.vuejs.org/rules/no-multiple-slot-args.html"
			},
			fixable: null,
			schema: [],
			messages: {
				unexpected: "Unexpected multiple arguments.",
				unexpectedSpread: "Unexpected spread argument."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			/**
			* Verify the given node
			* @param {MemberExpression | Identifier} node The node to verify
			*/
			function verify(node) {
				const parent = node.parent;
				if (parent.type === "VariableDeclarator" && parent.id.type === "Identifier") {
					verifyReferences(parent.id);
					return;
				}
				if (parent.type === "AssignmentExpression" && parent.right === node && parent.left.type === "Identifier") {
					verifyReferences(parent.left);
					return;
				}
				if (parent.type !== "CallExpression" || parent.arguments.includes(node)) return;
				if (parent.arguments.length === 0) return;
				if (parent.arguments.length > 1) context.report({
					node: parent.arguments[1],
					messageId: "unexpected"
				});
				if (parent.arguments[0].type === "SpreadElement") context.report({
					node: parent.arguments[0],
					messageId: "unexpectedSpread"
				});
			}
			/**
			* Verify the references of the given node.
			* @param {Identifier} node The node to verify
			*/
			function verifyReferences(node) {
				const variable = findVariable(utils.getScope(context, node), node);
				if (!variable) return;
				for (const reference of variable.references) {
					if (!reference.isRead()) continue;
					/** @type {Identifier} */
					const id = reference.identifier;
					verify(id);
				}
			}
			return utils.defineVueVisitor(context, { 
			/** @param {MemberExpression} node */
MemberExpression(node) {
				const object = utils.skipChainExpression(node.object);
				if (object.type !== "MemberExpression") return;
				const name = utils.getStaticPropertyName(object);
				if (!name || name !== "$slots" && name !== "$scopedSlots") return;
				if (!utils.isThis(object.object, context)) return;
				verify(node);
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_multiple_slot_args();
	}
});
͔x2"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-multiple-template-root.js
/**
* @fileoverview disallow adding multiple root nodes to the template
* @author Przemyslaw Falowski (@przemkow)
*/
var require_no_multiple_template_root = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow adding multiple root nodes to the template",
				categories: ["vue2-essential"],
				url: "https://eslint.vuejs.org/rules/no-multiple-template-root.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: { disallowComments: { type: "boolean" } },
				additionalProperties: false
			}],
			messages: {
				commentRoot: "The template root disallows comments.",
				multipleRoot: "The template root requires exactly one element.",
				textRoot: "The template root requires an element rather than texts.",
				disallowedElement: "The template root disallows '<{{name}}>' elements.",
				disallowedDirective: "The template root disallows 'v-for' directives."
			}
		},
		/**
		* @param {RuleContext} context - The rule context.
		* @returns {RuleListener} AST event handlers.
		*/
		create(context) {
			const disallowComments = (context.options[0] || {}).disallowComments;
			const sourceCode = context.sourceCode;
			return { Program(program) {
				const element = program.templateBody;
				if (element == null) return;
				const reportComments = element.comments.filter((comment) => utils.inRange(element, comment) && element.children.every((child) => !utils.inRange(child, comment)));
				if (disallowComments) for (const comment of reportComments) context.report({
					node: comment,
					loc: comment.loc,
					messageId: "commentRoot"
				});
				const rootElements = [];
				let extraText = null;
				let extraElement = null;
				let isVIf = false;
				for (const child of element.children) if (child.type === "VElement") if (rootElements.length === 0) {
					rootElements.push(child);
					isVIf = utils.hasDirective(child, "if");
				} else if (isVIf && utils.hasDirective(child, "else-if")) rootElements.push(child);
				else if (isVIf && utils.hasDirective(child, "else")) {
					rootElements.push(child);
					isVIf = false;
				} else extraElement = child;
				else if (sourceCode.getText(child).trim() !== "") extraText = child;
				if (extraText != null) context.report({
					node: extraText,
					loc: extraText.loc,
					messageId: "textRoot"
				});
				else if (extraElement == null) for (const element of rootElements) {
					const tag = element.startTag;
					const name = element.name;
					if (name === "template" || name === "slot") context.report({
						node: tag,
						loc: tag.loc,
						messageId: "disallowedElement",
						data: { name }
					});
					if (utils.hasDirective(element, "for")) context.report({
						node: tag,
						loc: tag.loc,
						messageId: "disallowedDirective"
					});
				}
				else context.report({
					node: extraElement,
					loc: extraElement.loc,
					messageId: "multipleRoot"
				});
			} };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_multiple_template_root();
	}
});
lw:Axd,"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-mutating-props.js
/**
* @fileoverview disallow mutation component props
* @author 2018 Armano
*/
var require_no_mutating_props = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	/**
	* @typedef {{name?: string, set: Set<string>}} PropsInfo
	*/
	const utils = require_index.default;
	const { findVariable } = require("@eslint-community/eslint-utils");
	const GLOBALS_WHITE_LISTED = /* @__PURE__ */ new Set([
		"Infinity",
		"undefined",
		"NaN",
		"isFinite",
		"isNaN",
		"parseFloat",
		"parseInt",
		"decodeURI",
		"decodeURIComponent",
		"encodeURI",
		"encodeURIComponent",
		"Math",
		"Number",
		"Date",
		"Array",
		"Object",
		"Boolean",
		"String",
		"RegExp",
		"Map",
		"Set",
		"JSON",
		"Intl",
		"BigInt"
	]);
	/**
	* @param {ASTNode} node
	* @returns {VExpressionContainer}
	*/
	function getVExpressionContainer(node) {
		let n = node;
		while (n.type !== "VExpressionContainer") n = n.parent;
		return n;
	}
	/**
	* @param {ASTNode} node
	* @returns {node is Identifier}
	*/
	function isVmReference(node) {
		if (node.type !== "Identifier") return false;
		const parent = node.parent;
		if (parent.type === "MemberExpression") {
			if (parent.property === node) return false;
		} else if (parent.type === "Property" && parent.key === node && !parent.computed) return false;
		const exprContainer = getVExpressionContainer(node);
		for (const reference of exprContainer.references) {
			if (reference.variable != null) continue;
			if (reference.id === node) return true;
		}
		return false;
	}
	/**
	* @param { object } options
	* @param { boolean } options.shallowOnly Enables mutating the value of a prop but leaving the reference the same
	*/
	function parseOptions(options) {
		return Object.assign({ shallowOnly: false }, options);
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow mutation of component props",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/no-mutating-props.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: { shallowOnly: { type: "boolean" } },
				additionalProperties: false
			}],
			messages: { unexpectedMutation: "Unexpected mutation of \"{{key}}\" prop." }
		},
		/** @param {RuleContext} context */
		create(context) {
			const { shallowOnly } = parseOptions(context.options[0]);
			/** @type {Map<ObjectExpression|CallExpression, PropsInfo>} */
			const propsMap = /* @__PURE__ */ new Map();
			/** @type { { type: 'export' | 'mark' | 'definition', object: ObjectExpression } | { type: 'setup', object: CallExpression } | null } */
			let vueObjectData = null;
			/**
			* @param {ASTNode} node
			* @param {string} name
			*/
			function report(node, name) {
				context.report({
					node,
					messageId: "unexpectedMutation",
					data: { key: name }
				});
			}
			/**
			* @param {MemberExpression|AssignmentProperty} node
			* @returns {string}
			*/
			function getPropertyNameText(node) {
				const name = utils.getStaticPropertyName(node);
				if (name) return name;
				if (node.computed) {
					const expr = node.type === "Property" ? node.key : node.property;
					return `[${context.sourceCode.getText(expr)}]`;
				}
				return "?unknown?";
			}
			/**
			* @param {MemberExpression|Identifier} props
			* @param {string} name
			* @param {boolean} isRootProps
			*/
			function verifyMutating(props, name, isRootProps = false) {
				const invalid = utils.findMutating(props);
				if (invalid && isShallowOnlyInvalid(invalid, isRootProps)) report(invalid.node, name);
			}
			/**
			* @param {Pattern} param
			* @param {string[]} path
			* @returns {Generator<{ node: Identifier, path: string[] }>}
			*/
			function* iteratePatternProperties(param, path) {
				if (!param) return;
				switch (param.type) {
					case "Identifier":
						yield {
							node: param,
							path
						};
						break;
					case "RestElement":
						yield* iteratePatternProperties(param.argument, path);
						break;
					case "AssignmentPattern":
						yield* iteratePatternProperties(param.left, path);
						break;
					case "ObjectPattern":
						for (const prop of param.properties) if (prop.type === "Property") {
							const name = getPropertyNameText(prop);
							yield* iteratePatternProperties(prop.value, [...path, name]);
						} else if (prop.type === "RestElement") yield* iteratePatternProperties(prop.argument, path);
						break;
					case "ArrayPattern":
						for (let index = 0; index < param.elements.length; index++) {
							const element = param.elements[index];
							if (element) yield* iteratePatternProperties(element, [...path, String(index)]);
						}
						break;
				}
			}
			/**
			* @param {Identifier} prop
			* @param {string[]} path
			*/
			function verifyPropVariable(prop, path) {
				const variable = findVariable(utils.getScope(context, prop), prop);
				if (!variable) return;
				for (const reference of variable.references) {
					if (!reference.isRead()) continue;
					const id = reference.identifier;
					const invalid = utils.findMutating(id);
					if (!invalid || !isShallowOnlyInvalid(invalid, path.length === 0)) continue;
					let name;
					if (path.length === 0) {
						if (invalid.pathNodes.length === 0) continue;
						const mem = invalid.pathNodes[0];
						name = getPropertyNameText(mem);
					} else {
						if (invalid.pathNodes.length === 0 && invalid.kind !== "call") continue;
						name = path[0];
					}
					report(invalid.node, name);
				}
			}
			function* extractDefineVariableNames() {
				const globalScope = context.sourceCode.scopeManager.globalScope;
				if (globalScope) {
					for (const variable of globalScope.variables) if (variable.defs.length > 0) yield variable.name;
					const moduleScope = globalScope.childScopes.find((scope) => scope.type === "module");
					const moduleVariables = moduleScope && moduleScope.variables || [];
					for (const variable of moduleVariables) if (variable.defs.length > 0) yield variable.name;
				}
			}
			/**
			* Is shallowOnly false or the prop reassigned
			* @param {Exclude<ReturnType<typeof utils.findMutating>, null>} invalid
			* @param {boolean} isRootProps
			* @return {boolean}
			*/
			function isShallowOnlyInvalid(invalid, isRootProps) {
				return !shallowOnly || invalid.pathNodes.length === (isRootProps ? 1 : 0) && ["assignment", "update"].includes(invalid.kind);
			}
			return utils.compositingVisitors({}, utils.defineScriptSetupVisitor(context, { onDefinePropsEnter(node, props) {
				const defineVariableNames = new Set(extractDefineVariableNames());
				const propsInfo = {
					name: "",
					set: new Set(props.map((p) => p.propName).filter(
						/**
						* @returns {propName is string}
						*/
						(propName) => utils.isDef(propName) && !GLOBALS_WHITE_LISTED.has(propName) && !defineVariableNames.has(propName)
					))
				};
				propsMap.set(node, propsInfo);
				vueObjectData = {
					type: "setup",
					object: node
				};
				let target = node;
				if (target.parent && target.parent.type === "CallExpression" && target.parent.arguments[0] === target && target.parent.callee.type === "Identifier" && target.parent.callee.name === "withDefaults") target = target.parent;
				if (!target.parent || target.parent.type !== "VariableDeclarator" || target.parent.init !== target) return;
				const patternProperties = iteratePatternProperties(target.parent.id, []);
				for (const { node: prop, path } of patternProperties) {
					if (path.length === 0) propsInfo.name = prop.name;
					else propsInfo.set.add(prop.name);
					verifyPropVariable(prop, path);
				}
			} }), utils.defineVueVisitor(context, {
				onVueObjectEnter(node) {
					propsMap.set(node, { set: new Set(utils.getComponentPropsFromOptions(node).map((p) => p.propName).filter(utils.isDef)) });
				},
				onVueObjectExit(node, { type }) {
					if ((!vueObjectData || vueObjectData.type !== "export" && vueObjectData.type !== "setup") && type !== "instance") vueObjectData = {
						type,
						object: node
					};
				},
				onSetupFunctionEnter(node) {
					const propsParam = node.params[0];
					if (!propsParam) return;
					if (propsParam.type === "RestElement" || propsParam.type === "ArrayPattern") return;
					const patternProperties = iteratePatternProperties(propsParam, []);
					for (const { node: prop, path } of patternProperties) verifyPropVariable(prop, path);
				},
				/** @param {(Identifier | ThisExpression) & { parent: MemberExpression } } node */
				"MemberExpression > :matches(Identifier, ThisExpression)"(node, { node: vueNode }) {
					if (!utils.isThis(node, context)) return;
					const mem = node.parent;
					if (mem.object !== node) return;
					const name = utils.getStaticPropertyName(mem);
					if (name && propsMap.get(vueNode).set.has(name)) verifyMutating(mem, name);
				}
			}), utils.defineTemplateBodyVisitor(context, {
				/** @param {ThisExpression & { parent: MemberExpression } } node */
				"VExpressionContainer MemberExpression > ThisExpression"(node) {
					if (!vueObjectData) return;
					const mem = node.parent;
					if (mem.object !== node) return;
					const name = utils.getStaticPropertyName(mem);
					if (name && propsMap.get(vueObjectData.object).set.has(name)) verifyMutating(mem, name);
				},
				/** @param {Identifier } node */
				"VExpressionContainer Identifier"(node) {
					if (!vueObjectData) return;
					if (!isVmReference(node)) return;
					const propsInfo = propsMap.get(vueObjectData.object);
					const isRootProps = !!node.name && propsInfo.name === node.name;
					const parent = node.parent;
					const name = isRootProps && parent.type === "MemberExpression" && utils.getStaticPropertyName(parent) || node.name;
					if (name && (propsInfo.set.has(name) || isRootProps)) verifyMutating(node, name, isRootProps);
				},
				/** @param {ESNode} node */
				"VAttribute[directive=true]:matches([key.name.name='model'], [key.name.name='bind']) VExpressionContainer > *"(node) {
					if (!vueObjectData) return;
					let attr = node.parent;
					while (attr && attr.type !== "VAttribute") attr = attr.parent;
					if (attr && attr.directive && attr.key.name.name === "bind" && attr.key.modifiers.every((mod) => mod.name !== "sync")) return;
					const propsInfo = propsMap.get(vueObjectData.object);
					const nodes = utils.getMemberChaining(node);
					const first = nodes[0];
					let name;
					if (isVmReference(first)) if (first.name === propsInfo.name) {
						if (shallowOnly && nodes.length > 2) return;
						name = nodes[1] && getPropertyNameText(nodes[1]) || first.name;
					} else {
						if (shallowOnly && nodes.length > 1) return;
						name = first.name;
						if (!name || !propsInfo.set.has(name)) return;
					}
					else if (first.type === "ThisExpression") {
						if (shallowOnly && nodes.length > 2) return;
						const mem = nodes[1];
						if (!mem) return;
						name = utils.getStaticPropertyName(mem);
						if (!name || !propsInfo.set.has(name)) return;
					} else return;
					report(node, name);
				}
			}));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_mutating_props();
	}
});
&(xy"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-negated-condition.js
/**
* @author Wayne Zhang
* See LICENSE file in root directory for full license.
*/
var require_no_negated_condition = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapCoreRule } = require_index.default;
	module.exports = wrapCoreRule("no-negated-condition", { applyDocument: true });
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_negated_condition();
	}
});
xL"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-negated-v-if-condition.js
/**
* @author Wayne Zhang
* See LICENSE file in root directory for full license.
*/
var require_no_negated_v_if_condition = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef { VDirective & { value: (VExpressionContainer & { expression: Expression | null } ) | null  } } VIfDirective
	*/
	/**
	* @param {Expression} expression
	* @returns {boolean}
	*/
	function isNegatedExpression(expression) {
		return expression.type === "UnaryExpression" && expression.operator === "!" || expression.type === "BinaryExpression" && (expression.operator === "!=" || expression.operator === "!==");
	}
	/**
	* @param {VElement} node
	* @returns {VElement|null}
	*/
	function getNextSibling(node) {
		if (!node.parent?.children) return null;
		const siblings = node.parent.children;
		const currentIndex = siblings.indexOf(node);
		for (let i = currentIndex + 1; i < siblings.length; i++) {
			const sibling = siblings[i];
			if (sibling.type === "VElement") return sibling;
		}
		return null;
	}
	/**
	* @param {VElement} element
	* @returns {boolean}
	*/
	function isDirectlyFollowedByElse(element) {
		const nextElement = getNextSibling(element);
		return nextElement ? utils.hasDirective(nextElement, "else") : false;
	}
	/**
	* @param {VElement} element
	*/
	function getDirective(element) {
		return element.startTag.attributes.find((attr) => attr.directive && attr.key.name && attr.key.name.name && [
			"if",
			"else-if",
			"else"
		].includes(attr.key.name.name));
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow negated conditions in v-if/v-else",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/no-negated-v-if-condition.html"
			},
			fixable: "code",
			schema: [],
			messages: { negatedCondition: "Unexpected negated condition in v-if with v-else." }
		},
		/** @param {RuleContext} context */
		create(context) {
			const sourceCode = context.sourceCode;
			const processedPairs = /* @__PURE__ */ new Set();
			/**
			* @param {Expression} expression
			* @returns {string}
			*/
			function getConvertedCondition(expression) {
				if (expression.type === "UnaryExpression" && expression.operator === "!") return sourceCode.text.slice(expression.range[0] + 1, expression.range[1]);
				if (expression.type === "BinaryExpression") {
					const left = sourceCode.getText(expression.left);
					const right = sourceCode.getText(expression.right);
					if (expression.operator === "!=") return `${left} == ${right}`;
					if (expression.operator === "!==") return `${left} === ${right}`;
				}
				return sourceCode.getText(expression);
			}
			/**
			* @param {VIfDirective} node
			*/
			function checkNegatedCondition(node) {
				if (!node.value?.expression) return;
				const expression = node.value.expression;
				const element = node.parent.parent;
				if (!isNegatedExpression(expression) || !isDirectlyFollowedByElse(element)) return;
				const elseElement = getNextSibling(element);
				if (!elseElement) return;
				const pairKey = `${element.range[0]}-${elseElement.range[0]}`;
				if (processedPairs.has(pairKey)) return;
				processedPairs.add(pairKey);
				context.report({
					node: expression,
					messageId: "negatedCondition",
					fix: (fixer) => swapElements(fixer, element, elseElement, expression)
				});
			}
			/**
			* @param {RuleFixer} fixer
			* @param {VElement} ifElement
			* @param {VElement} elseElement
			* @param {Expression} expression
			*/
			function* swapElements(fixer, ifElement, elseElement, expression) {
				const convertedCondition = getConvertedCondition(expression);
				const ifDir = getDirective(ifElement);
				const elseDir = getDirective(elseElement);
				if (!ifDir || !elseDir) return;
				const ifDirectiveName = ifDir.key.name.name;
				const ifText = sourceCode.text.slice(ifElement.range[0], ifElement.range[1]);
				const elseText = sourceCode.text.slice(elseElement.range[0], elseElement.range[1]);
				const newIfDirective = `v-${ifDirectiveName}="${convertedCondition}"`;
				const newIfText = elseText.slice(0, elseDir.range[0] - elseElement.range[0]) + newIfDirective + elseText.slice(elseDir.range[1] - elseElement.range[0]);
				const newElseText = ifText.slice(0, ifDir.range[0] - ifElement.range[0]) + "v-else" + ifText.slice(ifDir.range[1] - ifElement.range[0]);
				yield fixer.replaceTextRange(ifElement.range, newIfText);
				yield fixer.replaceTextRange(elseElement.range, newElseText);
			}
			return utils.defineTemplateBodyVisitor(context, {
				/** @param {VIfDirective} node */
				"VAttribute[directive=true][key.name.name='if']"(node) {
					checkNegatedCondition(node);
				},
				/** @param {VIfDirective} node */
				"VAttribute[directive=true][key.name.name='else-if']"(node) {
					checkNegatedCondition(node);
				}
			});
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_negated_v_if_condition();
	}
});
x["use strict";
//#region lib/rules/no-parsing-error.js
/**
* @author Toru Nagashima
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_no_parsing_error = /* @__PURE__ */ require("../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	const DEFAULT_OPTIONS = Object.freeze(Object.assign(Object.create(null), {
		"abrupt-closing-of-empty-comment": true,
		"absence-of-digits-in-numeric-character-reference": true,
		"cdata-in-html-content": true,
		"character-reference-outside-unicode-range": true,
		"control-character-in-input-stream": true,
		"control-character-reference": true,
		"eof-before-tag-name": true,
		"eof-in-cdata": true,
		"eof-in-comment": true,
		"eof-in-tag": true,
		"incorrectly-closed-comment": true,
		"incorrectly-opened-comment": true,
		"invalid-first-character-of-tag-name": true,
		"missing-attribute-value": true,
		"missing-end-tag-name": true,
		"missing-semicolon-after-character-reference": true,
		"missing-whitespace-between-attributes": true,
		"nested-comment": true,
		"noncharacter-character-reference": true,
		"noncharacter-in-input-stream": true,
		"null-character-reference": true,
		"surrogate-character-reference": true,
		"surrogate-in-input-stream": true,
		"unexpected-character-in-attribute-name": true,
		"unexpected-character-in-unquoted-attribute-value": true,
		"unexpected-equals-sign-before-attribute-name": true,
		"unexpected-null-character": true,
		"unexpected-question-mark-instead-of-tag-name": true,
		"unexpected-solidus-in-tag": true,
		"unknown-named-character-reference": true,
		"end-tag-with-attributes": true,
		"duplicate-attribute": true,
		"end-tag-with-trailing-solidus": true,
		"non-void-html-element-start-tag-with-trailing-solidus": false,
		"x-invalid-end-tag": true,
		"x-invalid-namespace": true
	}));
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow parsing errors in `<template>`",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/no-parsing-error.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: Object.fromEntries(Object.keys(DEFAULT_OPTIONS).map((code) => [code, { type: "boolean" }])),
				additionalProperties: false
			}],
			messages: { parsingError: "Parsing error: {{message}}." }
		},
		/**
		* @param {RuleContext} context - The rule context.
		* @returns {RuleListener} AST event handlers.
		*/
		create(context) {
			const options = Object.assign({}, DEFAULT_OPTIONS, context.options[0] || {});
			return { Program(program) {
				const node = program.templateBody;
				if (node == null || node.errors == null) return;
				for (const error of node.errors) {
					if (error.code && !options[error.code]) continue;
					context.report({
						node,
						loc: {
							line: error.lineNumber,
							column: error.column
						},
						messageId: "parsingError",
						data: { message: error.message.endsWith(".") ? error.message.slice(0, -1) : error.message }
					});
				}
			} };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_parsing_error();
	}
});
8%!xc"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_vue_component_options$1 = require("../utils/vue-component-options.js");
//#region lib/rules/no-potential-component-option-typo.js
/**
* @fileoverview detect if there is a potential typo in your component property
* @author IWANABETHATGUY
*/
var require_no_potential_component_option_typo = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const vueComponentOptions = require_vue_component_options$1.default;
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow a potential typo in your component property",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/no-potential-component-option-typo.html"
			},
			fixable: null,
			hasSuggestions: true,
			schema: [{
				type: "object",
				properties: {
					presets: {
						type: "array",
						items: {
							type: "string",
							enum: [
								"all",
								"vue",
								"vue-router",
								"nuxt"
							]
						},
						uniqueItems: true,
						minItems: 0
					},
					custom: {
						type: "array",
						minItems: 0,
						items: { type: "string" },
						uniqueItems: true
					},
					threshold: {
						type: "number",
						minimum: 1
					}
				},
				additionalProperties: false
			}],
			messages: { potentialTypo: `'{{name}}' may be a typo, which is similar to option [{{option}}].` }
		},
		/** @param {RuleContext} context */
		create(context) {
			const option = context.options[0] || {};
			const custom = option.custom || [];
			/** @type {('all' | 'vue' | 'vue-router' | 'nuxt')[]} */
			const presets = option.presets || ["vue"];
			const threshold = option.threshold || 1;
			/** @type {Set<string>} */
			const candidateOptionSet = new Set(custom);
			for (const preset of presets) if (preset === "all") for (const opts of Object.values(vueComponentOptions)) for (const opt of opts) candidateOptionSet.add(opt);
			else {
				const presetOptions = vueComponentOptions[preset];
				for (const opt of presetOptions) candidateOptionSet.add(opt);
			}
			const candidateOptionList = [...candidateOptionSet];
			if (candidateOptionList.length === 0) return {};
			return utils.executeOnVue(context, (obj) => {
				const componentInstanceOptions = obj.properties.map((p) => {
					if (p.type === "Property") {
						const name = utils.getStaticPropertyName(p);
						if (name != null) return {
							name,
							key: p.key
						};
					}
					return null;
				}).filter(utils.isDef);
				if (componentInstanceOptions.length === 0) return;
				for (const option of componentInstanceOptions) {
					const id = option.key;
					const name = option.name;
					if (candidateOptionSet.has(name)) continue;
					const potentialTypoList = candidateOptionList.map((o) => ({
						option: o,
						distance: utils.editDistance(o, name)
					})).filter(({ distance }) => distance <= threshold && distance > 0).sort((a, b) => a.distance - b.distance);
					if (potentialTypoList.length > 0) context.report({
						node: id,
						messageId: "potentialTypo",
						data: {
							name,
							option: potentialTypoList.map(({ option }) => option).join(",")
						},
						suggest: potentialTypoList.map(({ option }) => ({
							desc: `Replace property '${name}' to '${option}'`,
							fix(fixer) {
								return fixer.replaceText(id, option);
							}
						}))
					});
				}
			});
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_potential_component_option_typo();
	}
});
.vwxconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_ref_object_references = require("../utils/ref-object-references.js");
let _eslint_community_eslint_utils = require("@eslint-community/eslint-utils");
//#region lib/rules/no-ref-as-operand.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
/**
* Checks whether the given identifier reference has been initialized with a ref object.
*/
function isRefInit(data) {
	const init = data && data.variableDeclarator && data.variableDeclarator.init;
	if (!init) return false;
	return data.defineChain.includes(init);
}
/**
* Get the callee member node from the given CallExpression
*/
function getNameParamNode(node) {
	const nameLiteralNode = node.arguments[0];
	if (nameLiteralNode && import_utils.default.isStringLiteral(nameLiteralNode)) {
		const name = import_utils.default.getStringLiteralValue(nameLiteralNode);
		if (name != null) return {
			name,
			loc: nameLiteralNode.loc
		};
	}
	return null;
}
/**
* Get the callee member node from the given CallExpression
*/
function getCalleeMemberNode(node) {
	const callee = import_utils.default.skipChainExpression(node.callee);
	if (callee.type === "MemberExpression") {
		const name = import_utils.default.getStaticPropertyName(callee);
		if (name) return {
			name,
			member: callee
		};
	}
	return null;
}
var no_ref_as_operand_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "disallow use of value wrapped by `ref()` (Composition API) as an operand",
			categories: ["vue3-essential", "vue2-essential"],
			url: "https://eslint.vuejs.org/rules/no-ref-as-operand.html"
		},
		fixable: "code",
		schema: [],
		messages: { requireDotValue: "Must use `.value` to read or write the value wrapped by `{{method}}()`." }
	},
	create(context) {
		let refReferences;
		const setupContexts = /* @__PURE__ */ new Map();
		/**
		* Collect identifier id
		*/
		function collectReferenceIds(node, referenceIds) {
			const variable = (0, _eslint_community_eslint_utils.findVariable)(import_utils.default.getScope(context, node), node);
			if (!variable) return;
			for (const reference of variable.references) referenceIds.add(reference.identifier);
		}
		function reportIfRefWrapped(node) {
			const data = refReferences.get(node);
			if (!isRefInit(data)) return;
			context.report({
				node,
				messageId: "requireDotValue",
				data: { method: data.method },
				fix(fixer) {
					return fixer.insertTextAfter(node, ".value");
				}
			});
		}
		function reportWrappedIdentifiers(node) {
			const nodes = node.arguments.filter((node) => node.type === "Identifier");
			for (const node of nodes) reportIfRefWrapped(node);
		}
		const programNode = context.sourceCode.ast;
		const callVisitor = { CallExpression(node, info) {
			if (!getNameParamNode(node)) return;
			const setupContext = setupContexts.get(info ? info.node : programNode);
			if (!setupContext) return;
			const { contextReferenceIds, emitReferenceIds } = setupContext;
			if (node.callee.type === "Identifier" && emitReferenceIds.has(node.callee)) reportWrappedIdentifiers(node);
			else {
				const emit = getCalleeMemberNode(node);
				if (emit && emit.name === "emit" && emit.member.object.type === "Identifier" && contextReferenceIds.has(emit.member.object)) reportWrappedIdentifiers(node);
			}
		} };
		return import_utils.default.compositingVisitors({
			Program() {
				refReferences = require_ref_object_references.extractRefObjectReferences(context);
			},
			"IfStatement>Identifier"(node) {
				reportIfRefWrapped(node);
			},
			"SwitchStatement>Identifier"(node) {
				reportIfRefWrapped(node);
			},
			"UnaryExpression>Identifier"(node) {
				reportIfRefWrapped(node);
			},
			"UpdateExpression>Identifier"(node) {
				reportIfRefWrapped(node);
			},
			"BinaryExpression>Identifier"(node) {
				reportIfRefWrapped(node);
			},
			"AssignmentExpression>Identifier"(node) {
				if (node.parent.operator === "=" && node.parent.left !== node) return;
				reportIfRefWrapped(node);
			},
			"LogicalExpression>Identifier"(node) {
				if (node.parent.left !== node) return;
				const data = refReferences.get(node);
				if (!data || !data.variableDeclaration || data.variableDeclaration.kind !== "const") return;
				reportIfRefWrapped(node);
			},
			"ConditionalExpression>Identifier"(node) {
				if (node.parent.test !== node) return;
				reportIfRefWrapped(node);
			},
			":not(TaggedTemplateExpression)>TemplateLiteral>Identifier"(node) {
				reportIfRefWrapped(node);
			},
			"MemberExpression>Identifier"(node) {
				if (node.parent.object !== node) return;
				const name = import_utils.default.getStaticPropertyName(node.parent);
				if (name === "value" || name == null || name === "effect") return;
				reportIfRefWrapped(node);
			}
		}, import_utils.default.defineScriptSetupVisitor(context, {
			onDefineEmitsEnter(node) {
				if (!node.parent || node.parent.type !== "VariableDeclarator" || node.parent.init !== node) return;
				const emitParam = node.parent.id;
				if (emitParam.type !== "Identifier") return;
				const emitReferenceIds = /* @__PURE__ */ new Set();
				collectReferenceIds(emitParam, emitReferenceIds);
				setupContexts.set(programNode, {
					contextReferenceIds: /* @__PURE__ */ new Set(),
					emitReferenceIds
				});
			},
			...callVisitor
		}), import_utils.default.defineVueVisitor(context, {
			onSetupFunctionEnter(node, { node: vueNode }) {
				const contextParam = import_utils.default.skipDefaultParamValue(node.params[1]);
				if (!contextParam) return;
				if (contextParam.type === "RestElement" || contextParam.type === "ArrayPattern") return;
				const contextReferenceIds = /* @__PURE__ */ new Set();
				const emitReferenceIds = /* @__PURE__ */ new Set();
				if (contextParam.type === "ObjectPattern") {
					const emitProperty = import_utils.default.findAssignmentProperty(contextParam, "emit");
					if (!emitProperty || emitProperty.value.type !== "Identifier") return;
					collectReferenceIds(emitProperty.value, emitReferenceIds);
				} else collectReferenceIds(contextParam, contextReferenceIds);
				setupContexts.set(vueNode, {
					contextReferenceIds,
					emitReferenceIds
				});
			},
			...callVisitor,
			onVueObjectExit(node) {
				setupContexts.delete(node);
			}
		}));
	}
};
//#endregion
exports.default = no_ref_as_operand_default;
AOqx_const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_ref_object_references = require("../utils/ref-object-references.js");
//#region lib/rules/no-ref-object-reactivity-loss.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
/**
* Checks whether writing assigns a value to the given pattern.
*/
function isUpdate(node) {
	const parent = node.parent;
	if (parent.type === "UpdateExpression" && parent.argument === node) return true;
	if (parent.type === "AssignmentExpression" && parent.left === node) return true;
	if (parent.type === "Property" && parent.value === node || parent.type === "ArrayPattern" || parent.type === "ObjectPattern" && parent.properties.includes(node) || parent.type === "AssignmentPattern" && parent.left === node || parent.type === "RestElement" || parent.type === "MemberExpression" && parent.object === node) return isUpdate(parent);
	return false;
}
var no_ref_object_reactivity_loss_default = {
	meta: {
		type: "problem",
		docs: {
			description: "disallow usages of ref objects that can lead to loss of reactivity",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/no-ref-object-reactivity-loss.html"
		},
		fixable: null,
		schema: [],
		messages: {
			getValueInSameScope: "Getting a value from the ref object in the same scope will cause the value to lose reactivity.",
			getReactiveVariableInSameScope: "Getting a reactive variable in the same scope will cause the value to lose reactivity."
		}
	},
	create(context) {
		let scopeStack = {
			upper: null,
			node: context.sourceCode.ast
		};
		const scopes = /* @__PURE__ */ new Map();
		const refObjectReferences = require_ref_object_references.extractRefObjectReferences(context);
		const reactiveVariableReferences = require_ref_object_references.extractReactiveVariableReferences(context);
		/**
		* Verify the given ref object value. `refObj = ref(); refObj.value;`
		*/
		function verifyRefObjectValue(node) {
			const ref = refObjectReferences.get(node);
			if (!ref) return;
			if (scopes.get(ref.define) !== scopeStack) return;
			context.report({
				node,
				messageId: "getValueInSameScope"
			});
		}
		/**
		* Verify the given reactive variable. `refVal = $ref(); refVal;`
		*/
		function verifyReactiveVariable(node) {
			const ref = reactiveVariableReferences.get(node);
			if (!ref || ref.escape) return;
			if (scopes.get(ref.define) !== scopeStack) return;
			context.report({
				node,
				messageId: "getReactiveVariableInSameScope"
			});
		}
		return {
			":function"(node) {
				scopeStack = {
					upper: scopeStack,
					node
				};
			},
			":function:exit"() {
				scopeStack = scopeStack.upper || scopeStack;
			},
			CallExpression(node) {
				scopes.set(node, scopeStack);
			},
			/**
			* Check for `refObj.value`.
			*/
			"MemberExpression:exit"(node) {
				if (isUpdate(node)) return;
				if (import_utils.default.getStaticPropertyName(node) !== "value") return;
				verifyRefObjectValue(node.object);
			},
			/**
			* Check for `{value} = refObj`.
			*/
			"ObjectPattern:exit"(node) {
				if (!import_utils.default.findAssignmentProperty(node, "value")) return;
				verifyRefObjectValue(node);
			},
			/**
			* Check for reactive variable`.
			*/
			"Identifier:exit"(node) {
				if (isUpdate(node)) return;
				verifyReactiveVariable(node);
			}
		};
	}
};
//#endregion
exports.default = no_ref_object_reactivity_loss_default;
zxx)"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-required-prop-with-default.js
/**
* @author @neferqiqi
* See LICENSE file in root directory for full license.
*/
var require_no_required_prop_with_default = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef {import('../utils').ComponentTypeProp} ComponentTypeProp
	* @typedef {import('../utils').ComponentArrayProp} ComponentArrayProp
	* @typedef {import('../utils').ComponentObjectProp} ComponentObjectProp
	* @typedef {import('../utils').ComponentUnknownProp} ComponentUnknownProp
	* @typedef {import('../utils').ComponentProp} ComponentProp
	*/
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce props with default values to be optional",
				categories: ["vue2-recommended", "vue3-recommended"],
				url: "https://eslint.vuejs.org/rules/no-required-prop-with-default.html"
			},
			fixable: "code",
			hasSuggestions: true,
			schema: [{
				type: "object",
				properties: { autofix: { type: "boolean" } },
				additionalProperties: false
			}],
			messages: {
				requireOptional: `Prop "{{ key }}" should be optional.`,
				fixRequiredProp: `Change this prop to be optional.`
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			let canAutoFix = false;
			const option = context.options[0];
			if (option) canAutoFix = option.autofix;
			/**
			* @param {ComponentProp} prop
			* @param {Set<string>} [defaultProps]
			**/
			const handleObjectProp = (prop, defaultProps) => {
				if (prop.type === "object" && prop.propName && prop.value.type === "ObjectExpression" && (utils.findProperty(prop.value, "default") || defaultProps?.has(prop.propName))) {
					const requiredProperty = utils.findProperty(prop.value, "required");
					if (!requiredProperty) return;
					const requiredNode = requiredProperty.value;
					if (requiredNode && requiredNode.type === "Literal" && !!requiredNode.value) context.report({
						node: prop.node,
						loc: prop.node.loc,
						data: { key: prop.propName },
						messageId: "requireOptional",
						fix: canAutoFix ? (fixer) => fixer.replaceText(requiredNode, "false") : null,
						suggest: canAutoFix ? null : [{
							messageId: "fixRequiredProp",
							fix: (fixer) => fixer.replaceText(requiredNode, "false")
						}]
					});
				} else if (prop.type === "type" && defaultProps?.has(prop.propName) && prop.required) {
					if (prop.node.type === "TSMethodSignature" && (prop.node.kind === "get" || prop.node.kind === "set")) return;
					if (prop.node.computed) return;
					context.report({
						node: prop.node,
						loc: prop.node.loc,
						data: { key: prop.propName },
						messageId: "requireOptional",
						fix: canAutoFix ? (fixer) => fixer.insertTextAfter(prop.key, "?") : null,
						suggest: canAutoFix ? null : [{
							messageId: "fixRequiredProp",
							fix: (fixer) => fixer.insertTextAfter(prop.key, "?")
						}]
					});
				}
			};
			return utils.compositingVisitors(utils.defineVueVisitor(context, { onVueObjectEnter(node) {
				for (const prop of utils.getComponentPropsFromOptions(node)) handleObjectProp(prop);
			} }), utils.defineScriptSetupVisitor(context, { onDefinePropsEnter(node, props) {
				const defaultProps = /* @__PURE__ */ new Set([...Object.keys(utils.getWithDefaultsPropExpressions(node)), ...Object.keys(utils.getDefaultPropExpressionsForPropsDestructure(node))]);
				for (const prop of props) handleObjectProp(prop, defaultProps);
			} }));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_required_prop_with_default();
	}
});
Zɵx*const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_html_elements$1 = require("../utils/html-elements.js");
const require_svg_elements$1 = require("../utils/svg-elements.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
const require_deprecated_html_elements = require("../utils/deprecated-html-elements.js");
//#region lib/rules/no-reserved-component-names.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
var import_html_elements = /* @__PURE__ */ require_runtime.__toESM(require_html_elements$1.default);
var import_svg_elements = /* @__PURE__ */ require_runtime.__toESM(require_svg_elements$1.default);
const kebabCaseElements = [
	"annotation-xml",
	"color-profile",
	"font-face",
	"font-face-src",
	"font-face-uri",
	"font-face-format",
	"font-face-name",
	"missing-glyph"
];
function isLowercase(word) {
	return /^[a-z]*$/.test(word);
}
function canVerify(node) {
	return node.type === "Literal" || node.type === "TemplateLiteral" && node.expressions.length === 0 && node.quasis.length === 1;
}
function addAll(set, iterable) {
	for (const element of iterable) set.add(element);
}
var no_reserved_component_names_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "disallow the use of reserved names in component definitions",
			categories: ["vue3-essential", "vue2-essential"],
			url: "https://eslint.vuejs.org/rules/no-reserved-component-names.html"
		},
		fixable: null,
		schema: [{
			type: "object",
			properties: {
				disallowVueBuiltInComponents: { type: "boolean" },
				disallowVue3BuiltInComponents: { type: "boolean" },
				htmlElementCaseSensitive: { type: "boolean" }
			},
			additionalProperties: false
		}],
		messages: {
			reserved: "Name \"{{name}}\" is reserved.",
			reservedInHtml: "Name \"{{name}}\" is reserved in HTML.",
			reservedInVue: "Name \"{{name}}\" is reserved in Vue.js.",
			reservedInVue3: "Name \"{{name}}\" is reserved in Vue.js 3.x."
		}
	},
	create(context) {
		const options = context.options[0] || {};
		const shouldDisallowVueBuiltInComponents = options.disallowVueBuiltInComponents === true;
		const shouldDisallowVue3BuiltInComponents = options.disallowVue3BuiltInComponents === true;
		const isHtmlElementCaseSensitive = options.htmlElementCaseSensitive === true;
		const RESERVED_NAMES_IN_HTML = new Set(import_html_elements.default);
		const RESERVED_NAMES_IN_OTHERS = /* @__PURE__ */ new Set([
			...require_deprecated_html_elements.default,
			...kebabCaseElements,
			...import_svg_elements.default
		]);
		if (!isHtmlElementCaseSensitive) {
			addAll(RESERVED_NAMES_IN_HTML, import_html_elements.default.map(require_casing.capitalize));
			addAll(RESERVED_NAMES_IN_OTHERS, [
				...require_deprecated_html_elements.default.map(require_casing.capitalize),
				...kebabCaseElements.map(require_casing.pascalCase),
				...import_svg_elements.default.filter(isLowercase).map(require_casing.capitalize)
			]);
		}
		const reservedNames = /* @__PURE__ */ new Set([
			...RESERVED_NAMES_IN_HTML,
			...shouldDisallowVueBuiltInComponents ? import_utils.default.VUE2_BUILTIN_COMPONENT_NAMES : [],
			...shouldDisallowVue3BuiltInComponents ? import_utils.default.VUE3_BUILTIN_COMPONENT_NAMES : [],
			...RESERVED_NAMES_IN_OTHERS
		]);
		function getMessageId(name) {
			if (RESERVED_NAMES_IN_HTML.has(name)) return "reservedInHtml";
			if (import_utils.default.VUE2_BUILTIN_COMPONENT_NAMES.has(name)) return "reservedInVue";
			if (import_utils.default.VUE3_BUILTIN_COMPONENT_NAMES.has(name)) return "reservedInVue3";
			return "reserved";
		}
		function reportIfInvalid(node) {
			let name;
			if (node.type === "TemplateLiteral") name = node.quasis[0].value.cooked;
			else name = String(node.value);
			if (reservedNames.has(name)) report(node, name);
		}
		function report(node, name) {
			context.report({
				node,
				messageId: getMessageId(name),
				data: { name }
			});
		}
		return import_utils.default.compositingVisitors(import_utils.default.executeOnCallVueComponent(context, (node) => {
			if (node.arguments.length !== 2) return;
			const argument = node.arguments[0];
			if (canVerify(argument)) reportIfInvalid(argument);
		}), import_utils.default.executeOnVue(context, (obj) => {
			for (const { node, name } of import_utils.default.getRegisteredComponents(obj)) if (reservedNames.has(name)) report(node, name);
			const node = import_utils.default.findProperty(obj, "name");
			if (!node) return;
			if (!canVerify(node.value)) return;
			reportIfInvalid(node.value);
		}), import_utils.default.defineScriptSetupVisitor(context, { onDefineOptionsEnter(node) {
			if (node.arguments.length === 0) return;
			const define = node.arguments[0];
			if (define.type !== "ObjectExpression") return;
			const nameNode = import_utils.default.findProperty(define, "name");
			if (!nameNode) return;
			if (!canVerify(nameNode.value)) return;
			reportIfInvalid(nameNode.value);
		} }));
	}
};
//#endregion
exports.default = no_reserved_component_names_default;
#]x 
"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_vue_reserved$1 = require("../utils/vue-reserved.js");
//#region lib/rules/no-reserved-keys.js
/**
* @fileoverview Prevent overwrite reserved keys
* @author Armano
*/
var require_no_reserved_keys = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef {import('../utils').GroupName} GroupName
	*/
	const RESERVED_KEYS = require_vue_reserved$1.default;
	/** @type {GroupName[]} */
	const GROUP_NAMES = [
		"props",
		"computed",
		"data",
		"asyncData",
		"methods",
		"setup"
	];
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow overwriting reserved keys",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/no-reserved-keys.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: {
					reserved: { type: "array" },
					groups: { type: "array" }
				},
				additionalProperties: false
			}],
			messages: {
				reserved: "Key '{{name}}' is reserved.",
				startsWithUnderscore: "Keys starting with '_' are reserved in '{{name}}' group."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const options = context.options[0] || {};
			const reservedKeys = /* @__PURE__ */ new Set([...RESERVED_KEYS, ...options.reserved || []]);
			const groups = /* @__PURE__ */ new Set([...GROUP_NAMES, ...options.groups || []]);
			return utils.compositingVisitors(utils.defineScriptSetupVisitor(context, { onDefinePropsEnter(_node, props) {
				for (const prop of props) {
					if (!prop.propName || !reservedKeys.has(prop.propName)) continue;
					const { propName, node } = prop;
					context.report({
						node,
						messageId: "reserved",
						data: { name: propName }
					});
				}
			} }), utils.executeOnVue(context, (obj) => {
				const properties = utils.iterateProperties(obj, groups);
				for (const o of properties) if ((o.groupName === "data" || o.groupName === "asyncData") && o.name[0] === "_") context.report({
					node: o.node,
					messageId: "startsWithUnderscore",
					data: { name: o.name }
				});
				else if (reservedKeys.has(o.name)) context.report({
					node: o.node,
					messageId: "reserved",
					data: { name: o.name }
				});
			}));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_reserved_keys();
	}
});
+Olx8const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
//#region lib/rules/no-reserved-props.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
const RESERVED = {
	3: ["key", "ref"],
	2: [
		"key",
		"ref",
		"is",
		"slot",
		"slot-scope",
		"slotScope",
		"class",
		"style"
	]
};
var no_reserved_props_default = {
	meta: {
		type: "problem",
		docs: {
			description: "disallow reserved names in props",
			categories: ["vue3-essential", "vue2-essential"],
			url: "https://eslint.vuejs.org/rules/no-reserved-props.html",
			defaultOptions: { vue2: [{ vueVersion: 2 }] }
		},
		fixable: null,
		schema: [{
			type: "object",
			properties: { vueVersion: { enum: [2, 3] } },
			additionalProperties: false
		}],
		messages: { reserved: "'{{propName}}' is a reserved attribute and cannot be used as props." }
	},
	create(context) {
		const vueVersion = (context.options[0] || {}).vueVersion || 3;
		const reserved = new Set(RESERVED[vueVersion]);
		function processProps(props) {
			for (const prop of props) if (prop.propName != null && reserved.has(prop.propName)) context.report({
				node: prop.node,
				messageId: `reserved`,
				data: { propName: require_casing.kebabCase(prop.propName) }
			});
		}
		return import_utils.default.compositingVisitors(import_utils.default.defineScriptSetupVisitor(context, { onDefinePropsEnter(_node, props) {
			processProps(props);
		} }), import_utils.default.executeOnVue(context, (obj) => {
			processProps(import_utils.default.getComponentPropsFromOptions(obj));
		}));
	}
};
//#endregion
exports.default = no_reserved_props_default;
yDԵxzconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_regexp = require("../utils/regexp.js");
//#region lib/rules/no-restricted-block.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
function parseOption(option) {
	if (typeof option === "string") {
		const matcher = require_regexp.toRegExp(option, { remove: "g" });
		return { test(block) {
			return matcher.test(block.rawName);
		} };
	}
	const parsed = parseOption(option.element);
	parsed.message = option.message;
	return parsed;
}
function defaultMessage(block) {
	return `Using \`<${block.rawName}>\` is not allowed.`;
}
var no_restricted_block_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "disallow specific block",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/no-restricted-block.html"
		},
		fixable: null,
		schema: {
			type: "array",
			items: { oneOf: [{ type: "string" }, {
				type: "object",
				properties: {
					element: { type: "string" },
					message: {
						type: "string",
						minLength: 1
					}
				},
				required: ["element"],
				additionalProperties: false
			}] },
			uniqueItems: true,
			minItems: 0
		},
		messages: { restrictedBlock: "{{message}}" }
	},
	create(context) {
		const options = context.options.map(parseOption);
		const sourceCode = context.sourceCode;
		const documentFragment = sourceCode.parserServices.getDocumentFragment && sourceCode.parserServices.getDocumentFragment();
		function getTopLevelHTMLElements() {
			if (documentFragment) return documentFragment.children.filter(import_utils.default.isVElement);
			return [];
		}
		return { Program(node) {
			if (import_utils.default.hasInvalidEOF(node)) return;
			for (const block of getTopLevelHTMLElements()) {
				const option = options.find((option) => option.test(block));
				if (option) {
					const message = option.message || defaultMessage(block);
					context.report({
						node: block.startTag,
						messageId: "restrictedBlock",
						data: { message }
					});
				}
			}
		} };
	}
};
//#endregion
exports.default = no_restricted_block_default;
xGconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_regexp = require("../utils/regexp.js");
//#region lib/rules/no-restricted-class.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
const reportForbiddenClass = (className, node, context, isForbiddenClass) => {
	if (!isForbiddenClass(className)) return;
	const loc = (node.value || node).loc;
	context.report({
		node,
		loc,
		messageId: "forbiddenClass",
		data: { class: className }
	});
};
function* extractClassNames(node, isTextOnly) {
	if (node.type === "Literal") {
		yield* String(node.value).split(/\s+/).map((className) => ({
			className,
			reportNode: node
		}));
		return;
	}
	if (node.type === "TemplateLiteral") {
		for (const templateElement of node.quasis) yield* templateElement.value.cooked.split(/\s+/).map((className) => ({
			className,
			reportNode: templateElement
		}));
		for (const expr of node.expressions) yield* extractClassNames(expr, true);
		return;
	}
	if (node.type === "BinaryExpression") {
		if (node.operator !== "+") return;
		yield* extractClassNames(node.left, true);
		yield* extractClassNames(node.right, true);
		return;
	}
	if (isTextOnly) return;
	if (node.type === "ObjectExpression") {
		for (const prop of node.properties) {
			if (prop.type !== "Property") continue;
			const classNames = import_utils.default.getStaticPropertyName(prop);
			if (!classNames) continue;
			yield* classNames.split(/\s+/).map((className) => ({
				className,
				reportNode: prop.key
			}));
		}
		return;
	}
	if (node.type === "ArrayExpression") {
		for (const element of node.elements) {
			if (element == null) continue;
			if (element.type === "SpreadElement") continue;
			yield* extractClassNames(element);
		}
		return;
	}
}
var no_restricted_class_default = {
	meta: {
		type: "problem",
		docs: {
			description: "disallow specific classes in Vue components",
			url: "https://eslint.vuejs.org/rules/no-restricted-class.html",
			categories: void 0
		},
		fixable: null,
		schema: {
			type: "array",
			items: { type: "string" }
		},
		messages: { forbiddenClass: "'{{class}}' class is not allowed." }
	},
	create(context) {
		const { options = [] } = context;
		const isForbiddenClass = require_regexp.toRegExpGroupMatcher(options);
		return import_utils.default.defineTemplateBodyVisitor(context, {
			"VAttribute[directive=false][key.name=\"class\"][value!=null]"(node) {
				for (const className of node.value.value.split(/\s+/)) reportForbiddenClass(className, node, context, isForbiddenClass);
			},
			"VAttribute[directive=true][key.name.name='bind'][key.argument.name='class'] > VExpressionContainer.value"(node) {
				if (!node.expression) return;
				for (const { className, reportNode } of extractClassNames(node.expression)) reportForbiddenClass(className, reportNode, context, isForbiddenClass);
			}
		});
	}
};
//#endregion
exports.default = no_restricted_class_default;
ꂲx}const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
const require_regexp = require("../utils/regexp.js");
//#region lib/rules/no-restricted-component-names.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
function buildMatcher(str) {
	if (require_regexp.isRegExp(str)) {
		const regex = require_regexp.toRegExp(str, { remove: "g" });
		return (s) => regex.test(s);
	}
	return (s) => s === require_casing.pascalCase(str) || s === require_casing.kebabCase(str);
}
function parseOption(option) {
	if (typeof option === "string") return { test: buildMatcher(option) };
	const parsed = parseOption(option.name);
	parsed.message = option.message;
	parsed.suggest = option.suggest;
	return parsed;
}
function createSuggest(property, suggest) {
	if (!suggest) return [];
	return [{
		fix(fixer) {
			return fixer.replaceText(property.value, JSON.stringify(suggest));
		},
		messageId: "suggest",
		data: { suggest }
	}];
}
var no_restricted_component_names_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "disallow specific component names",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/no-restricted-component-names.html"
		},
		fixable: null,
		hasSuggestions: true,
		schema: {
			type: "array",
			items: { oneOf: [{ type: "string" }, {
				type: "object",
				properties: {
					name: { type: "string" },
					message: {
						type: "string",
						minLength: 1
					},
					suggest: { type: "string" }
				},
				required: ["name"],
				additionalProperties: false
			}] },
			uniqueItems: true,
			minItems: 0
		},
		messages: {
			disallow: "{{message}}",
			suggest: "Instead, change to `{{suggest}}`."
		}
	},
	create(context) {
		const options = context.options.map(parseOption);
		function verify(node) {
			const property = import_utils.default.findProperty(node, "name");
			if (!property) return;
			if (import_utils.default.getStaticPropertyName(property) === "name" && property.value.type === "Literal") {
				const componentName = property.value.value?.toString();
				if (!componentName) return;
				for (const option of options) if (option.test(componentName)) context.report({
					node: property.value,
					messageId: "disallow",
					data: { message: option.message || `Using component name \`${componentName}\` is not allowed.` },
					suggest: createSuggest(property, option.suggest)
				});
			}
		}
		return import_utils.default.compositingVisitors(import_utils.default.defineVueVisitor(context, { onVueObjectEnter(node) {
			verify(node);
		} }), import_utils.default.defineScriptSetupVisitor(context, { onDefineOptionsEnter(node) {
			const expression = node.arguments[0];
			if (expression.type === "ObjectExpression") verify(expression);
		} }));
	}
};
//#endregion
exports.default = no_restricted_component_names_default;
xconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_regexp = require("../utils/regexp.js");
//#region lib/rules/no-restricted-component-options.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
function parseOption(option) {
	if (typeof option === "string" || Array.isArray(option)) return parseOption({ name: option });
	const steps = [];
	const names = Array.isArray(option.name) ? option.name : [option.name];
	for (const name of names) if (name === "*") steps.push({ wildcard: true });
	else {
		const matcher = require_regexp.toRegExp(name, { remove: "g" });
		steps.push({ test: (value) => matcher.test(value) });
	}
	const message = option.message;
	return {
		test: buildTester(0),
		message
	};
	function buildTester(index) {
		const step = steps[index];
		const next = index + 1;
		const hasNext = steps.length > next;
		return (node) => {
			let keyName;
			if (step.wildcard) keyName = "*";
			else {
				if (node.type !== "Property") return null;
				const name = import_utils.default.getStaticPropertyName(node);
				if (!name || !step.test(name)) return null;
				keyName = name;
			}
			return {
				next: hasNext ? buildTester(next) : void 0,
				wildcard: step.wildcard,
				keyName
			};
		};
	}
}
function defaultMessage(path) {
	return `Using \`${path.join(".")}\` is not allowed.`;
}
var no_restricted_component_options_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "disallow specific component option",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/no-restricted-component-options.html"
		},
		fixable: null,
		schema: {
			type: "array",
			items: { oneOf: [
				{ type: "string" },
				{
					type: "array",
					items: { type: "string" }
				},
				{
					type: "object",
					properties: {
						name: { oneOf: [{ type: "string" }, {
							type: "array",
							items: { type: "string" }
						}] },
						message: {
							type: "string",
							minLength: 1
						}
					},
					required: ["name"],
					additionalProperties: false
				}
			] },
			uniqueItems: true,
			minItems: 0
		},
		messages: { restrictedOption: "{{message}}" }
	},
	create(context) {
		if (!context.options || context.options.length === 0) return {};
		const options = context.options.map(parseOption);
		return import_utils.default.compositingVisitors(import_utils.default.defineVueVisitor(context, { onVueObjectEnter(node) {
			for (const option of options) verify(node, option.test, option.message);
		} }), import_utils.default.defineScriptSetupVisitor(context, { onDefineOptionsEnter(node) {
			if (node.arguments.length === 0) return;
			const define = node.arguments[0];
			if (define.type !== "ObjectExpression") return;
			for (const option of options) verify(define, option.test, option.message);
		} }));
		function verify(node, test, customMessage, path = []) {
			for (const prop of node.properties) {
				const result = test(prop);
				if (!result) continue;
				if (result.next) {
					if (prop.type !== "Property" || prop.value.type !== "ObjectExpression") continue;
					verify(prop.value, result.next, customMessage, [...path, result.keyName]);
				} else {
					const message = customMessage || defaultMessage([...path, result.keyName]);
					context.report({
						node: prop.type === "Property" ? prop.key : prop,
						messageId: "restrictedOption",
						data: { message }
					});
				}
			}
		}
	}
};
//#endregion
exports.default = no_restricted_component_options_default;
{@x^const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_regexp = require("../utils/regexp.js");
let _eslint_community_eslint_utils = require("@eslint-community/eslint-utils");
//#region lib/rules/no-restricted-custom-event.ts
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
function parseOption(option) {
	if (typeof option === "string") {
		const matcher = require_regexp.toRegExp(option, { remove: "g" });
		return { test(name) {
			return matcher.test(name);
		} };
	}
	const parsed = parseOption(option.event);
	parsed.message = option.message;
	parsed.suggest = option.suggest;
	return parsed;
}
/**
* Get the name param node from the given CallExpression
*/
function getNameParamNode(node) {
	const nameLiteralNode = node.arguments[0];
	if (nameLiteralNode && import_utils.default.isStringLiteral(nameLiteralNode)) {
		const name = import_utils.default.getStringLiteralValue(nameLiteralNode);
		if (name != null) return {
			name,
			loc: nameLiteralNode.loc,
			range: nameLiteralNode.range
		};
	}
	return null;
}
/**
* Get the callee member node from the given CallExpression
*/
function getCalleeMemberNode(node) {
	const callee = import_utils.default.skipChainExpression(node.callee);
	if (callee.type === "MemberExpression") {
		const name = import_utils.default.getStaticPropertyName(callee);
		if (name) return {
			name,
			member: callee
		};
	}
	return null;
}
var no_restricted_custom_event_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "disallow specific custom event",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/no-restricted-custom-event.html"
		},
		fixable: null,
		hasSuggestions: true,
		schema: {
			type: "array",
			items: { oneOf: [{ type: ["string"] }, {
				type: "object",
				properties: {
					event: { type: "string" },
					message: {
						type: "string",
						minLength: 1
					},
					suggest: { type: "string" }
				},
				required: ["event"],
				additionalProperties: false
			}] },
			uniqueItems: true,
			minItems: 0
		},
		messages: {
			restrictedEvent: "{{message}}",
			instead: "Instead, change to `{{suggest}}`."
		}
	},
	create(context) {
		const setupContexts = /* @__PURE__ */ new Map();
		const options = context.options.map(parseOption);
		function verify(nameWithLoc) {
			const name = nameWithLoc.name;
			for (const option of options) if (option.test(name)) {
				const message = option.message || `Using \`${name}\` event is not allowed.`;
				context.report({
					loc: nameWithLoc.loc,
					messageId: "restrictedEvent",
					data: { message },
					suggest: option.suggest ? [{
						fix(fixer) {
							const sourceCode = context.sourceCode;
							return fixer.replaceTextRange(nameWithLoc.range, `${sourceCode.text[nameWithLoc.range[0]]}${JSON.stringify(option.suggest).slice(1, -1).replaceAll("'", String.raw`\'`)}${sourceCode.text[nameWithLoc.range[1] - 1]}`);
						},
						messageId: "instead",
						data: { suggest: option.suggest }
					}] : []
				});
				break;
			}
		}
		return import_utils.default.defineTemplateBodyVisitor(context, { CallExpression(node) {
			const callee = node.callee;
			const nameWithLoc = getNameParamNode(node);
			if (!nameWithLoc) return;
			if (callee.type === "Identifier" && callee.name === "$emit") verify(nameWithLoc);
		} }, import_utils.default.compositingVisitors(import_utils.default.defineVueVisitor(context, {
			onSetupFunctionEnter(node, { node: vueNode }) {
				const contextParam = import_utils.default.skipDefaultParamValue(node.params[1]);
				if (!contextParam) return;
				if (contextParam.type === "RestElement" || contextParam.type === "ArrayPattern") return;
				const contextReferenceIds = /* @__PURE__ */ new Set();
				const emitReferenceIds = /* @__PURE__ */ new Set();
				if (contextParam.type === "ObjectPattern") {
					const emitProperty = import_utils.default.findAssignmentProperty(contextParam, "emit");
					if (!emitProperty || emitProperty.value.type !== "Identifier") return;
					const emitParam = emitProperty.value;
					const variable = (0, _eslint_community_eslint_utils.findVariable)(import_utils.default.getScope(context, emitParam), emitParam);
					if (!variable) return;
					for (const reference of variable.references) emitReferenceIds.add(reference.identifier);
				} else {
					const variable = (0, _eslint_community_eslint_utils.findVariable)(import_utils.default.getScope(context, contextParam), contextParam);
					if (!variable) return;
					for (const reference of variable.references) contextReferenceIds.add(reference.identifier);
				}
				setupContexts.set(vueNode, {
					contextReferenceIds,
					emitReferenceIds
				});
			},
			CallExpression(node, { node: vueNode }) {
				const nameWithLoc = getNameParamNode(node);
				if (!nameWithLoc) return;
				const setupContext = setupContexts.get(vueNode);
				if (setupContext) {
					const { contextReferenceIds, emitReferenceIds } = setupContext;
					if (node.callee.type === "Identifier" && emitReferenceIds.has(node.callee)) verify(nameWithLoc);
					else {
						const emit = getCalleeMemberNode(node);
						if (emit && emit.name === "emit" && emit.member.object.type === "Identifier" && contextReferenceIds.has(emit.member.object)) verify(nameWithLoc);
					}
				}
			},
			onVueObjectExit(node) {
				setupContexts.delete(node);
			}
		}), { CallExpression(node) {
			const nameWithLoc = getNameParamNode(node);
			if (!nameWithLoc) return;
			const emit = getCalleeMemberNode(node);
			if (emit && emit.name === "$emit") verify(nameWithLoc);
		} }));
	}
};
//#endregion
exports.default = no_restricted_custom_event_default;
qWxg"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-restricted-html-elements.js
/**
* @author Doug Wade <douglas.b.wade@gmail.com>
*/
var require_no_restricted_html_elements = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow specific elements",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/no-restricted-html-elements.html"
			},
			fixable: null,
			schema: {
				type: "array",
				items: { oneOf: [{ type: "string" }, {
					type: "object",
					properties: {
						element: { oneOf: [{ type: "string" }, {
							type: "array",
							items: { type: "string" }
						}] },
						message: {
							type: "string",
							minLength: 1
						}
					},
					required: ["element"],
					additionalProperties: false
				}] },
				uniqueItems: true,
				minItems: 0
			},
			messages: {
				forbiddenElement: "Unexpected use of forbidden element {{name}}.",
				customMessage: "{{message}}"
			}
		},
		/**
		* @param {RuleContext} context - The rule context.
		* @returns {RuleListener} AST event handlers.
		*/
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { 
			/**
			* @param {VElement} node
			*/
VElement(node) {
				if (!utils.isHtmlElementNode(node) && !utils.isSvgElementNode(node) && !utils.isMathElementNode(node)) return;
				for (const option of context.options) {
					const restrictedItem = option.element || option;
					if ((Array.isArray(restrictedItem) ? restrictedItem : [restrictedItem]).includes(node.rawName)) {
						context.report({
							messageId: option.message ? "customMessage" : "forbiddenElement",
							data: {
								name: node.rawName,
								message: option.message
							},
							node: node.startTag
						});
						return;
					}
				}
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_restricted_html_elements();
	}
});
(xNconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_regexp = require("../utils/regexp.js");
//#region lib/rules/no-restricted-props.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
function parseOption(option) {
	if (typeof option === "string") {
		const matcher = require_regexp.toRegExp(option, { remove: "g" });
		return { test(name) {
			return matcher.test(name);
		} };
	}
	const parsed = parseOption(option.name);
	parsed.message = option.message;
	parsed.suggest = option.suggest;
	return parsed;
}
var no_restricted_props_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "disallow specific props",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/no-restricted-props.html"
		},
		fixable: null,
		hasSuggestions: true,
		schema: {
			type: "array",
			items: { oneOf: [{ type: ["string"] }, {
				type: "object",
				properties: {
					name: { type: "string" },
					message: {
						type: "string",
						minLength: 1
					},
					suggest: { type: "string" }
				},
				required: ["name"],
				additionalProperties: false
			}] },
			uniqueItems: true,
			minItems: 0
		},
		messages: {
			restrictedProp: "{{message}}",
			instead: "Instead, change to `{{suggest}}`."
		}
	},
	create(context) {
		const options = context.options.map(parseOption);
		function processProps(props, fixPropInOtherPlaces) {
			for (const prop of props) {
				if (!prop.propName) continue;
				const option = options.find((option) => option.test(prop.propName));
				if (option) {
					const message = option.message || `Using \`${prop.propName}\` props is not allowed.`;
					context.report({
						node: prop.type === "infer-type" ? prop.node : prop.key,
						messageId: "restrictedProp",
						data: { message },
						suggest: prop.type === "infer-type" ? null : createSuggest(prop.key, option, fixPropInOtherPlaces ? (fixer, replaceKeyText) => fixPropInOtherPlaces(fixer, prop.propName, replaceKeyText) : void 0)
					});
				}
			}
		}
		return import_utils.default.compositingVisitors(import_utils.default.defineScriptSetupVisitor(context, { onDefinePropsEnter(node, props) {
			processProps(props, fixPropInOtherPlaces);
			function fixPropInOtherPlaces(fixer, propName, replaceKeyText) {
				const propertyNodes = [];
				const withDefault = import_utils.default.getWithDefaultsProps(node)[propName];
				if (withDefault) propertyNodes.push(withDefault);
				const propDestructure = import_utils.default.getPropsDestructure(node)[propName];
				if (propDestructure) propertyNodes.push(propDestructure);
				return propertyNodes.map((propertyNode) => propertyNode.shorthand ? fixer.insertTextBefore(propertyNode.value, `${replaceKeyText}:`) : fixer.replaceText(propertyNode.key, replaceKeyText));
			}
		} }), import_utils.default.defineVueVisitor(context, { onVueObjectEnter(node) {
			processProps(import_utils.default.getComponentPropsFromOptions(node));
		} }));
	}
};
function createSuggest(node, option, fixPropInOtherPlaces) {
	if (!option.suggest) return [];
	let replaceText;
	if (node.type === "Literal" || node.type === "TemplateLiteral") replaceText = JSON.stringify(option.suggest);
	else if (node.type === "Identifier") replaceText = /^[a-z]\w*$/iu.test(option.suggest) ? option.suggest : JSON.stringify(option.suggest);
	else return [];
	return [{
		fix(fixer) {
			const fixes = [fixer.replaceText(node, replaceText)];
			if (fixPropInOtherPlaces) fixes.push(...fixPropInOtherPlaces(fixer, replaceText));
			return fixes.sort((a, b) => a.range[0] - b.range[0]);
		},
		messageId: "instead",
		data: { suggest: option.suggest }
	}];
}
//#endregion
exports.default = no_restricted_props_default;
v\x@const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_regexp = require("../utils/regexp.js");
//#region lib/rules/no-restricted-static-attribute.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
function parseOption(option) {
	if (typeof option === "string") {
		const matcher = require_regexp.toRegExp(option, { remove: "g" });
		return { test({ key }) {
			return matcher.test(key.rawName);
		} };
	}
	const parsed = parseOption(option.key);
	if (option.value) {
		const keyTest = parsed.test;
		if (option.value === true) parsed.test = (node) => {
			if (!keyTest(node)) return false;
			return node.value == null || node.value.value === node.key.rawName;
		};
		else {
			const valueMatcher = require_regexp.toRegExp(option.value, { remove: "g" });
			parsed.test = (node) => {
				if (!keyTest(node)) return false;
				return node.value != null && valueMatcher.test(node.value.value);
			};
		}
		parsed.useValue = true;
	}
	if (option.element) {
		const argTest = parsed.test;
		const tagMatcher = require_regexp.toRegExp(option.element, { remove: "g" });
		parsed.test = (node) => {
			if (!argTest(node)) return false;
			const element = node.parent.parent;
			return tagMatcher.test(element.rawName);
		};
		parsed.useElement = true;
	}
	parsed.message = option.message;
	return parsed;
}
function defaultMessage(node, option) {
	const key = node.key.rawName;
	let value = "";
	if (option.useValue) value = node.value == null ? "` set to `true" : `="${node.value.value}"`;
	const on = option.useElement ? ` on \`<${node.parent.parent.rawName}>\`` : "";
	return `Using \`${key + value}\`${on} is not allowed.`;
}
var no_restricted_static_attribute_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "disallow specific attribute",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/no-restricted-static-attribute.html"
		},
		fixable: null,
		schema: {
			type: "array",
			items: { oneOf: [{ type: "string" }, {
				type: "object",
				properties: {
					key: { type: "string" },
					value: { oneOf: [{ type: "string" }, { enum: [true] }] },
					element: { type: "string" },
					message: {
						type: "string",
						minLength: 1
					}
				},
				required: ["key"],
				additionalProperties: false
			}] },
			uniqueItems: true,
			minItems: 0
		},
		messages: { restrictedAttr: "{{message}}" }
	},
	create(context) {
		if (context.options.length === 0) return {};
		const options = context.options.map(parseOption);
		return import_utils.default.defineTemplateBodyVisitor(context, { "VAttribute[directive=false]"(node) {
			for (const option of options) if (option.test(node)) {
				const message = option.message || defaultMessage(node, option);
				context.report({
					node,
					messageId: "restrictedAttr",
					data: { message }
				});
				return;
			}
		} });
	}
};
//#endregion
exports.default = no_restricted_static_attribute_default;
7$xN"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-restricted-syntax.js
/**
* @author Yosuke Ota
*/
var require_no_restricted_syntax = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapCoreRule } = require_index.default;
	module.exports = wrapCoreRule("no-restricted-syntax", { applyDocument: true });
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_restricted_syntax();
	}
});
^5xhconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_regexp = require("../utils/regexp.js");
//#region lib/rules/no-restricted-v-bind.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
const DEFAULT_OPTIONS = [{
	argument: "/^v-/",
	message: "Using `:v-xxx` is not allowed. Instead, remove `:` and use it as directive."
}];
function parseOption(option) {
	if (typeof option === "string") {
		const matcher = require_regexp.toRegExp(option, { remove: "g" });
		return {
			test(key) {
				return Boolean(key.argument && key.argument.type === "VIdentifier" && matcher.test(key.argument.rawName));
			},
			modifiers: []
		};
	}
	if (option === null) return {
		test(key) {
			return key.argument === null;
		},
		modifiers: []
	};
	const parsed = parseOption(option.argument);
	if (option.modifiers) {
		const argTest = parsed.test;
		parsed.test = (key) => {
			if (!argTest(key)) return false;
			return option.modifiers.every((modName) => key.modifiers.some((mid) => mid.name === modName));
		};
		parsed.modifiers = option.modifiers;
	}
	if (option.element) {
		const argTest = parsed.test;
		const tagMatcher = require_regexp.toRegExp(option.element, { remove: "g" });
		parsed.test = (key) => {
			if (!argTest(key)) return false;
			const element = key.parent.parent.parent;
			return tagMatcher.test(element.rawName);
		};
		parsed.useElement = true;
	}
	parsed.message = option.message;
	return parsed;
}
function defaultMessage(key, option) {
	const vbind = key.name.rawName === ":" ? "" : "v-bind";
	const arg = key.argument != null && key.argument.type === "VIdentifier" ? `:${key.argument.rawName}` : "";
	const mod = option.modifiers.length > 0 ? `.${option.modifiers.join(".")}` : "";
	const on = option.useElement ? ` on \`<${key.parent.parent.parent.rawName}>\`` : "";
	return `Using \`${vbind + arg + mod}\`${on} is not allowed.`;
}
var no_restricted_v_bind_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "disallow specific argument in `v-bind`",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/no-restricted-v-bind.html"
		},
		fixable: null,
		schema: {
			type: "array",
			items: { oneOf: [{ type: ["string", "null"] }, {
				type: "object",
				properties: {
					argument: { type: ["string", "null"] },
					modifiers: {
						type: "array",
						items: {
							type: "string",
							enum: [
								"prop",
								"camel",
								"sync",
								"attr"
							]
						},
						uniqueItems: true
					},
					element: { type: "string" },
					message: {
						type: "string",
						minLength: 1
					}
				},
				required: ["argument"],
				additionalProperties: false
			}] },
			uniqueItems: true,
			minItems: 0
		},
		messages: { restrictedVBind: "{{message}}" }
	},
	create(context) {
		const options = (context.options.length === 0 ? DEFAULT_OPTIONS : context.options).map(parseOption);
		return import_utils.default.defineTemplateBodyVisitor(context, { "VAttribute[directive=true][key.name.name='bind'] > VDirectiveKey"(node) {
			for (const option of options) if (option.test(node)) {
				const message = option.message || defaultMessage(node, option);
				context.report({
					node,
					messageId: "restrictedVBind",
					data: { message }
				});
				return;
			}
		} });
	}
};
//#endregion
exports.default = no_restricted_v_bind_default;
BSxconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_regexp = require("../utils/regexp.js");
//#region lib/rules/no-restricted-v-on.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
function parseOption(option) {
	if (typeof option === "string") {
		const matcher = require_regexp.toRegExp(option, { remove: "g" });
		return { test(key) {
			return Boolean(key.argument && key.argument.type === "VIdentifier" && matcher.test(key.argument.rawName));
		} };
	}
	if (option === null) return { test(key) {
		return key.argument === null;
	} };
	const parsed = parseOption(option.argument);
	if (option.modifiers) {
		const argTest = parsed.test;
		parsed.test = (key) => {
			if (!argTest(key)) return false;
			return option.modifiers.every((modName) => key.modifiers.some((mid) => mid.name === modName));
		};
		parsed.modifiers = option.modifiers;
	}
	if (option.element) {
		const argTest = parsed.test;
		const tagMatcher = require_regexp.toRegExp(option.element, { remove: "g" });
		parsed.test = (key) => {
			if (!argTest(key)) return false;
			return tagMatcher.test(key.parent.parent.parent.rawName);
		};
		parsed.useElement = true;
	}
	parsed.message = option.message;
	return parsed;
}
function defaultMessage(key, option) {
	const von = key.name.rawName === "@" ? "" : "v-on";
	const arg = key.argument != null && key.argument.type === "VIdentifier" ? `${key.name.rawName === "@" ? "@" : ":"}${key.argument.rawName}` : "";
	const mod = option.modifiers != null && option.modifiers.length > 0 ? `.${option.modifiers.join(".")}` : "";
	const element = option.useElement ? `<${key.parent.parent.parent.rawName}>` : "element";
	return `Using \`${von + arg + mod}\` is not allowed on this ${element}.`;
}
var no_restricted_v_on_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "disallow specific argument in `v-on`",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/no-restricted-v-on.html"
		},
		fixable: null,
		schema: {
			type: "array",
			items: { oneOf: [{ type: ["string", "null"] }, {
				type: "object",
				properties: {
					argument: { type: ["string", "null"] },
					element: { type: "string" },
					message: {
						type: "string",
						minLength: 1
					},
					modifiers: {
						type: "array",
						items: {
							type: "string",
							enum: [
								"prevent",
								"stop",
								"capture",
								"self",
								"once",
								"passive"
							]
						},
						uniqueItems: true,
						minItems: 1
					}
				},
				required: ["argument"],
				additionalProperties: false
			}] },
			uniqueItems: true
		},
		messages: { restrictedVOn: "{{message}}" }
	},
	create(context) {
		if (context.options.length === 0) return {};
		const options = context.options.map(parseOption);
		return import_utils.default.defineTemplateBodyVisitor(context, { "VAttribute[directive=true][key.name.name='on'] > VDirectiveKey"(node) {
			for (const option of options) if (option.test(node)) {
				const message = option.message || defaultMessage(node, option);
				context.report({
					node,
					messageId: "restrictedVOn",
					data: { message }
				});
				return;
			}
		} });
	}
};
//#endregion
exports.default = no_restricted_v_on_default;
&Vxi"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-root-v-if.js
/**
* @author Perry Song
* @copyright 2023 Perry Song. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_no_root_v_if = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow `v-if` directives on root element",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/no-root-v-if.html"
			},
			fixable: null,
			schema: [],
			messages: { noRootVIf: "`v-if` should not be used on root element without `v-else`." }
		},
		/** @param {RuleContext} context */
		create(context) {
			return { 
			/** @param {Program} program */
Program(program) {
				const element = program.templateBody;
				if (element == null) return;
				const rootElements = element.children.filter(utils.isVElement);
				if (rootElements.length === 1 && utils.hasDirective(rootElements[0], "if")) context.report({
					node: element,
					loc: element.loc,
					messageId: "noRootVIf"
				});
			} };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_root_v_if();
	}
});
Gbx$6"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-setup-props-reactivity-loss.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_no_setup_props_reactivity_loss = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { findVariable } = require("@eslint-community/eslint-utils");
	const utils = require_index.default;
	/**
	* @typedef {'props'|'prop'} PropIdKind
	*    - `'props'`: A node is a container object that has props.
	*    - `'prop'`: A node is a variable with one prop.
	*/
	/**
	* @typedef {object} PropId
	* @property {Pattern} node
	* @property {PropIdKind} kind
	*/
	/**
	* Iterates over Prop identifiers by parsing the given pattern
	* in the left operand of defineProps().
	* @param {Pattern} node
	* @returns {IterableIterator<PropId>}
	*/
	function* iteratePropIds(node) {
		switch (node.type) {
			case "ObjectPattern":
				for (const prop of node.properties) yield prop.type === "Property" ? {
					node: unwrapAssignment(prop.value),
					kind: "prop"
				} : {
					node: unwrapAssignment(prop.argument),
					kind: "props"
				};
				break;
			default: yield {
				node: unwrapAssignment(node),
				kind: "props"
			};
		}
	}
	/**
	* @template {Pattern} T
	* @param {T} node
	* @returns {Pattern}
	*/
	function unwrapAssignment(node) {
		if (node.type === "AssignmentPattern") return node.left;
		return node;
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow usages that lose the reactivity of `props` passed to `setup`",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/no-setup-props-reactivity-loss.html"
			},
			fixable: null,
			schema: [],
			messages: {
				destructuring: "Destructuring the `props` will cause the value to lose reactivity.",
				getProperty: "Getting a value from the `props` in root scope of `{{scopeName}}` will cause the value to lose reactivity."
			}
		},
		/**
		* @param {RuleContext} context
		* @returns {RuleListener}
		**/
		create(context) {
			/**
			* @typedef {object} ScopePropsReferences
			* @property {object} refs
			* @property {Set<Identifier>} refs.props A set of references to container objects with multiple props.
			* @property {Set<Identifier>} refs.prop A set of references a variable with one property.
			* @property {string} scopeName
			*/
			/** @type {Map<FunctionDeclaration | FunctionExpression | ArrowFunctionExpression | Program, ScopePropsReferences>} */
			const setupScopePropsReferenceIds = /* @__PURE__ */ new Map();
			const wrapperExpressionTypes = /* @__PURE__ */ new Set(["ArrayExpression", "ObjectExpression"]);
			/**
			* @param {ESNode} node
			* @param {string} messageId
			* @param {string} scopeName
			*/
			function report(node, messageId, scopeName) {
				context.report({
					node,
					messageId,
					data: { scopeName }
				});
			}
			/**
			* @param {Pattern} left
			* @param {Expression | null} right
			* @param {ScopePropsReferences} propsReferences
			*/
			function verify(left, right, propsReferences) {
				if (!right) return;
				const rightNode = utils.skipChainExpression(right);
				if (wrapperExpressionTypes.has(rightNode.type) && isPropsMemberAccessed(rightNode, propsReferences)) {
					report(rightNode, "getProperty", propsReferences.scopeName);
					return;
				}
				/** @type {Expression | Super} */
				let expression = rightNode;
				while (expression.type === "MemberExpression") expression = utils.skipChainExpression(expression.object);
				/** @type {Expression[]} A list of expression nodes to verify */
				const expressions = [];
				switch (expression.type) {
					case "TemplateLiteral":
						expressions.push(...expression.expressions);
						break;
					case "ConditionalExpression":
						expressions.push(expression.test, expression.consequent, expression.alternate);
						break;
					case "Identifier":
						expressions.push(expression);
						break;
				}
				if ((left.type === "ArrayPattern" || left.type === "ObjectPattern") && expressions.some((expr) => expr.type === "Identifier" && propsReferences.refs.props.has(expr))) {
					report(left, "getProperty", propsReferences.scopeName);
					return;
				}
				const reportNode = expressions.find((expr) => isPropsMemberAccessed(expr, propsReferences));
				if (reportNode) report(reportNode, "getProperty", propsReferences.scopeName);
			}
			/**
			* @param {Expression | Super} node
			* @param {ScopePropsReferences} propsReferences
			*/
			function isPropsMemberAccessed(node, propsReferences) {
				for (const props of propsReferences.refs.props) {
					const isPropsInExpressionRange = utils.inRange(node.range, props);
					const isPropsMemberExpression = props.parent.type === "MemberExpression" && props.parent.object === props;
					if (isPropsInExpressionRange && isPropsMemberExpression) return true;
				}
				for (const prop of propsReferences.refs.prop) if (utils.inRange(node.range, prop)) return true;
				return false;
			}
			/**
			* @typedef {object} ScopeStack
			* @property {ScopeStack | null} upper
			* @property {FunctionDeclaration | FunctionExpression | ArrowFunctionExpression | Program} scopeNode
			*/
			/**
			* @type {ScopeStack | null}
			*/
			let scopeStack = null;
			/**
			* @param {PropId} propId
			* @param {FunctionDeclaration | FunctionExpression | ArrowFunctionExpression | Program} scopeNode
			* @param {import('eslint').Scope.Scope} currentScope
			* @param {string} scopeName
			*/
			function processPropId({ node, kind }, scopeNode, currentScope, scopeName) {
				if (node.type === "RestElement" || node.type === "AssignmentPattern" || node.type === "MemberExpression") return;
				if (node.type === "ArrayPattern" || node.type === "ObjectPattern") {
					report(node, "destructuring", scopeName);
					return;
				}
				const variable = findVariable(currentScope, node);
				if (!variable) return;
				let scopePropsReferences = setupScopePropsReferenceIds.get(scopeNode);
				if (!scopePropsReferences) {
					scopePropsReferences = {
						refs: {
							props: /* @__PURE__ */ new Set(),
							prop: /* @__PURE__ */ new Set()
						},
						scopeName
					};
					setupScopePropsReferenceIds.set(scopeNode, scopePropsReferences);
				}
				const propsReferenceIds = scopePropsReferences.refs[kind];
				for (const reference of variable.references) {
					if (reference.from !== currentScope) continue;
					if (!reference.isRead()) continue;
					propsReferenceIds.add(reference.identifier);
				}
			}
			return utils.compositingVisitors({
				/**
				* @param {FunctionExpression | FunctionDeclaration | ArrowFunctionExpression | Program} node
				*/
				"Program, :function"(node) {
					scopeStack = {
						upper: scopeStack,
						scopeNode: node
					};
				},
				/**
				* @param {FunctionExpression | FunctionDeclaration | ArrowFunctionExpression | Program} node
				*/
				"Program, :function:exit"(node) {
					scopeStack &&= scopeStack.upper;
					setupScopePropsReferenceIds.delete(node);
				},
				/**
				* @param {CallExpression} node
				*/
				CallExpression(node) {
					if (!scopeStack) return;
					const propsReferenceIds = setupScopePropsReferenceIds.get(scopeStack.scopeNode);
					if (!propsReferenceIds) return;
					if (isPropsMemberAccessed(node, propsReferenceIds)) report(node, "getProperty", propsReferenceIds.scopeName);
				},
				/**
				* @param {VariableDeclarator} node
				*/
				VariableDeclarator(node) {
					if (!scopeStack) return;
					const propsReferenceIds = setupScopePropsReferenceIds.get(scopeStack.scopeNode);
					if (!propsReferenceIds) return;
					verify(node.id, node.init, propsReferenceIds);
				},
				/**
				* @param {AssignmentExpression} node
				*/
				AssignmentExpression(node) {
					if (!scopeStack) return;
					const propsReferenceIds = setupScopePropsReferenceIds.get(scopeStack.scopeNode);
					if (!propsReferenceIds) return;
					verify(node.left, node.right, propsReferenceIds);
				}
			}, utils.defineScriptSetupVisitor(context, { onDefinePropsEnter(node) {
				let target = node;
				if (target.parent && target.parent.type === "CallExpression" && target.parent.arguments[0] === target && target.parent.callee.type === "Identifier" && target.parent.callee.name === "withDefaults") target = target.parent;
				if (!target.parent) return;
				/** @type {Pattern|null} */
				let id = null;
				if (target.parent.type === "VariableDeclarator") id = target.parent.init === target ? target.parent.id : null;
				else if (target.parent.type === "AssignmentExpression") id = target.parent.right === target ? target.parent.left : null;
				if (!id) return;
				const currentScope = utils.getScope(context, node);
				for (const propId of iteratePropIds(id)) processPropId(propId, context.sourceCode.ast, currentScope, "<script setup>");
			} }), utils.defineVueVisitor(context, { onSetupFunctionEnter(node) {
				const currentScope = utils.getScope(context, node);
				const propsParam = utils.skipDefaultParamValue(node.params[0]);
				if (!propsParam) return;
				processPropId({
					node: propsParam,
					kind: "props"
				}, node, currentScope, "setup()");
			} }));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_setup_props_reactivity_loss();
	}
});
](퓰xP	"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-shared-component-data.js
/**
* @fileoverview Enforces component's data property to be a function.
* @author Armano
*/
var require_no_shared_component_data = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/** @param {Token} token  */
	function isOpenParen(token) {
		return token.type === "Punctuator" && token.value === "(";
	}
	/** @param {Token} token  */
	function isCloseParen(token) {
		return token.type === "Punctuator" && token.value === ")";
	}
	/**
	* @param {Expression} node
	* @param {SourceCode} sourceCode
	*/
	function getFirstAndLastTokens(node, sourceCode) {
		let first = sourceCode.getFirstToken(node);
		let last = sourceCode.getLastToken(node);
		while (true) {
			const prev = sourceCode.getTokenBefore(first);
			const next = sourceCode.getTokenAfter(last);
			if (isOpenParen(prev) && isCloseParen(next)) {
				first = prev;
				last = next;
			} else return {
				first,
				last
			};
		}
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce component's data property to be a function",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/no-shared-component-data.html"
			},
			fixable: "code",
			schema: [],
			messages: { dataPropertyMustBeFunction: "`data` property in component must be a function." }
		},
		/** @param {RuleContext} context */
		create(context) {
			const sourceCode = context.sourceCode;
			return utils.executeOnVueComponent(context, (obj) => {
				const invalidData = utils.findProperty(obj, "data", (p) => p.value.type !== "FunctionExpression" && p.value.type !== "ArrowFunctionExpression" && p.value.type !== "Identifier");
				if (invalidData) context.report({
					node: invalidData,
					messageId: "dataPropertyMustBeFunction",
					fix(fixer) {
						const tokens = getFirstAndLastTokens(invalidData.value, sourceCode);
						return [fixer.insertTextBefore(tokens.first, "function() {\nreturn "), fixer.insertTextAfter(tokens.last, ";\n}")];
					}
				});
			});
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_shared_component_data();
	}
});
0#xi"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-side-effects-in-computed-properties.js
/**
* @fileoverview Don't introduce side effects in computed properties
* @author Michał Sajnóg
*/
var require_no_side_effects_in_computed_properties = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { ReferenceTracker, findVariable } = require("@eslint-community/eslint-utils");
	const utils = require_index.default;
	/**
	* @typedef {import('../utils').VueObjectData} VueObjectData
	* @typedef {import('../utils').VueVisitor} VueVisitor
	* @typedef {import('../utils').ComponentComputedProperty} ComponentComputedProperty
	*/
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow side effects in computed properties",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/no-side-effects-in-computed-properties.html"
			},
			fixable: null,
			schema: [],
			messages: {
				unexpectedSideEffectInFunction: "Unexpected side effect in computed function.",
				unexpectedSideEffectInProperty: "Unexpected side effect in \"{{key}}\" computed property."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			/** @type {Map<ObjectExpression, ComponentComputedProperty[]>} */
			const computedPropertiesMap = /* @__PURE__ */ new Map();
			/** @type {Array<FunctionExpression | ArrowFunctionExpression>} */
			const computedCallNodes = [];
			/** @type {[number, number][]} */
			const setupRanges = [];
			/**
			* @typedef {object} ScopeStack
			* @property {ScopeStack | null} upper
			* @property {BlockStatement | Expression | null} body
			*/
			/**
			* @type {ScopeStack | null}
			*/
			let scopeStack = null;
			/** @param {FunctionExpression | ArrowFunctionExpression | FunctionDeclaration} node */
			function onFunctionEnter(node) {
				scopeStack = {
					upper: scopeStack,
					body: node.body
				};
			}
			function onFunctionExit() {
				scopeStack &&= scopeStack.upper;
			}
			const nodeVisitor = {
				":function": onFunctionEnter,
				":function:exit": onFunctionExit,
				/**
				* @param {(Identifier | ThisExpression) & {parent: MemberExpression}} node
				* @param {VueObjectData|undefined} [info]
				*/
				"MemberExpression > :matches(Identifier, ThisExpression)"(node, info) {
					if (!scopeStack) return;
					const targetBody = scopeStack.body;
					const computedProperty = (info ? computedPropertiesMap.get(info.node) || [] : []).find((cp) => cp.value && cp.value.range[0] <= node.range[0] && node.range[1] <= cp.value.range[1] && targetBody === cp.value);
					if (computedProperty) {
						const mem = node.parent;
						if (mem.object !== node) return;
						const isThis = utils.isThis(node, context);
						const isVue = node.type === "Identifier" && node.name === "Vue";
						const invalid = mem.parent.type === "CallExpression" && mem.property.type === "Identifier" && (isThis && mem.property.name === "$set" || isVue && mem.property.name === "set") ? { node: mem.property } : isThis && utils.findMutating(mem);
						if (invalid) context.report({
							node: invalid.node,
							messageId: "unexpectedSideEffectInProperty",
							data: { key: computedProperty.key || "Unknown" }
						});
						return;
					}
					if (node.type === "ThisExpression") return;
					const computedFunction = computedCallNodes.find((c) => c.range[0] <= node.range[0] && node.range[1] <= c.range[1] && targetBody === c.body);
					if (!computedFunction) return;
					if (node.parent.object !== node) return;
					const variable = findVariable(utils.getScope(context, node), node);
					if (!variable || variable.defs.length !== 1) return;
					const def = variable.defs[0];
					if ([
						"ImplicitGlobalVariable",
						"TDZ",
						"ImportBinding"
					].includes(def.type)) return;
					if (!setupRanges.some(([start, end]) => start <= def.node.range[0] && def.node.range[1] <= end)) return;
					if (computedFunction.range[0] <= def.node.range[0] && def.node.range[1] <= computedFunction.range[1]) return;
					const invalid = utils.findMutating(node);
					if (invalid) context.report({
						node: invalid.node,
						messageId: "unexpectedSideEffectInFunction"
					});
				}
			};
			const scriptSetupNode = utils.getScriptSetupElement(context);
			if (scriptSetupNode) setupRanges.push(scriptSetupNode.range);
			return utils.compositingVisitors({ 
			/** @param {Program} program */
Program(program) {
				const tracker = new ReferenceTracker(utils.getScope(context, program));
				const computedRefs = utils.iterateReferencesTraceMap(tracker, { computed: { [ReferenceTracker.CALL]: true } });
				for (const { node } of computedRefs) {
					if (node.type !== "CallExpression") continue;
					const getterBody = utils.getGetterBodyFromComputedFunction(node);
					if (getterBody) computedCallNodes.push(getterBody);
				}
			} }, scriptSetupNode ? utils.defineScriptSetupVisitor(context, nodeVisitor) : utils.defineVueVisitor(context, {
				onVueObjectEnter(node) {
					computedPropertiesMap.set(node, utils.getComputedProperties(node));
				},
				onSetupFunctionEnter(node) {
					setupRanges.push(node.body.range);
				},
				...nodeVisitor
			}));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_side_effects_in_computed_properties();
	}
});
jx\"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-spaces-around-equal-signs-in-attribute.js
/**
* @author Yosuke Ota
* issue https://github.com/vuejs/eslint-plugin-vue/issues/460
*/
var require_no_spaces_around_equal_signs_in_attribute = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "layout",
			docs: {
				description: "disallow spaces around equal signs in attribute",
				categories: ["vue3-strongly-recommended", "vue2-strongly-recommended"],
				url: "https://eslint.vuejs.org/rules/no-spaces-around-equal-signs-in-attribute.html"
			},
			fixable: "whitespace",
			schema: [],
			messages: { unexpectedSpaces: "Unexpected spaces found around equal signs." }
		},
		/** @param {RuleContext} context */
		create(context) {
			const sourceCode = context.sourceCode;
			return utils.defineTemplateBodyVisitor(context, { VAttribute(node) {
				if (!node.value) return;
				/** @type {Range} */
				const range = [node.key.range[1], node.value.range[0]];
				const eqText = sourceCode.text.slice(range[0], range[1]);
				const expect = eqText.trim();
				if (eqText !== expect) context.report({
					node: node.key,
					loc: {
						start: node.key.loc.end,
						end: node.value.loc.start
					},
					messageId: "unexpectedSpaces",
					fix: (fixer) => fixer.replaceTextRange(range, expect)
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_spaces_around_equal_signs_in_attribute();
	}
});
^0"x%"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-sparse-arrays.js
/**
* @author Yosuke Ota
*/
var require_no_sparse_arrays = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapCoreRule } = require_index.default;
	module.exports = wrapCoreRule("no-sparse-arrays");
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_sparse_arrays();
	}
});
<2xg"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-static-inline-styles.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_no_static_inline_styles = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* Checks whether if the given property node is a static value.
	* @param {Property} prop property node to check
	* @returns {boolean} `true` if the given property node is a static value.
	*/
	function isStaticValue(prop) {
		return !prop.computed && prop.value.type === "Literal" && (prop.key.type === "Identifier" || prop.key.type === "Literal");
	}
	/**
	* Gets the static properties of a given expression node.
	* - If `SpreadElement` or computed property exists, it gets only the static properties before it.
	*   `:style="{ color: 'red', display: 'flex', ...spread, width: '16px' }"`
	*              ^^^^^^^^^^^^  ^^^^^^^^^^^^^^^
	* - If non-static object exists, it gets only the static properties up to that object.
	*   `:style="[ { color: 'red' }, { display: 'flex', color, width: '16px' }, { height: '16px' } ]"`
	*                ^^^^^^^^^^^^      ^^^^^^^^^^^^^^^         ^^^^^^^^^^^^^
	* - If all properties are static properties, it returns one root node.
	*   `:style="[ { color: 'red' }, { display: 'flex', width: '16px' } ]"`
	*    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	* @param {VDirective} node `:style` node to check
	* @returns {Property[] | [VDirective]} the static properties.
	*/
	function getReportNodes(node) {
		const { value } = node;
		if (!value) return [];
		const { expression } = value;
		if (!expression) return [];
		let elements;
		if (expression.type === "ObjectExpression") elements = [expression];
		else if (expression.type === "ArrayExpression") elements = expression.elements;
		else return [];
		const staticProperties = [];
		for (const element of elements) {
			if (!element) continue;
			if (element.type !== "ObjectExpression") return staticProperties;
			let isAllStatic = true;
			for (const prop of element.properties) {
				if (prop.type === "SpreadElement" || prop.computed) return staticProperties;
				if (isStaticValue(prop)) staticProperties.push(prop);
				else isAllStatic = false;
			}
			if (!isAllStatic) return staticProperties;
		}
		return [node];
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow static inline `style` attributes",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/no-static-inline-styles.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: { allowBinding: { type: "boolean" } },
				additionalProperties: false
			}],
			messages: {
				forbiddenStaticInlineStyle: "Static inline `style` are forbidden.",
				forbiddenStyleAttr: "`style` attributes are forbidden."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			/**
			* Reports if the value is static.
			* @param {VDirective} node `:style` node to check
			*/
			function verifyVBindStyle(node) {
				for (const n of getReportNodes(node)) context.report({
					node: n,
					messageId: "forbiddenStaticInlineStyle"
				});
			}
			/** @type {TemplateListener} */
			const visitor = { 
			/** @param {VAttribute} node */
"VAttribute[directive=false][key.name='style']"(node) {
				context.report({
					node,
					messageId: "forbiddenStyleAttr"
				});
			} };
			if (!context.options[0] || !context.options[0].allowBinding) visitor["VAttribute[directive=true][key.name.name='bind'][key.argument.name='style']"] = verifyVBindStyle;
			return utils.defineTemplateBodyVisitor(context, visitor);
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_static_inline_styles();
	}
});
?ZxS"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-template-key.js
/**
* @author Toru Nagashima
* @copyright 2016 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_no_template_key = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow `key` attribute on `<template>`",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/no-template-key.html"
			},
			fixable: null,
			schema: [],
			messages: { disallow: "'<template>' cannot be keyed. Place the key on real elements instead." }
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VElement} node */
"VElement[name='template']"(node) {
				const keyNode = utils.getAttribute(node, "key") || utils.getDirective(node, "bind", "key");
				if (keyNode) {
					if (utils.hasDirective(node, "for")) return;
					context.report({
						node: keyNode,
						loc: keyNode.loc,
						messageId: "disallow"
					});
				}
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_template_key();
	}
});
ZcYx
"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-template-shadow.js
/**
* @fileoverview Disallow variable declarations from shadowing variables declared in the outer scope.
* @author Armano
*/
var require_no_template_shadow = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef {import('../utils').GroupName} GroupName
	*/
	/** @type {GroupName[]} */
	const GROUP_NAMES = [
		"props",
		"computed",
		"data",
		"asyncData",
		"methods",
		"setup"
	];
	/**
	* @param {RuleContext} context
	* @param {string} variableName
	*/
	function isAllowedVarName(context, variableName) {
		if (context.options[0] && context.options[0].allow) return context.options[0].allow.includes(variableName);
		return false;
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow variable declarations from shadowing variables declared in the outer scope",
				categories: ["vue3-strongly-recommended", "vue2-strongly-recommended"],
				url: "https://eslint.vuejs.org/rules/no-template-shadow.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: { allow: {
					type: "array",
					items: { type: "string" },
					uniqueItems: true
				} },
				additionalProperties: false
			}],
			messages: { alreadyDeclaredInUpperScope: "Variable '{{name}}' is already declared in the upper scope." }
		},
		/** @param {RuleContext} context */
		create(context) {
			/** @type {Set<string>} */
			const jsVars = /* @__PURE__ */ new Set();
			/**
			* @typedef {object} ScopeStack
			* @property {ScopeStack | null} parent
			* @property {Identifier[]} nodes
			*/
			/** @type {ScopeStack | null} */
			let scopeStack = null;
			return utils.compositingVisitors(utils.isScriptSetup(context) ? { Program() {
				const globalScope = context.sourceCode.scopeManager.globalScope;
				if (!globalScope) return;
				for (const variable of globalScope.variables) if (variable.defs.length > 0) jsVars.add(variable.name);
				const moduleScope = globalScope.childScopes.find((scope) => scope.type === "module");
				if (!moduleScope) return;
				for (const variable of moduleScope.variables) if (variable.defs.length > 0) jsVars.add(variable.name);
			} } : {}, utils.defineScriptSetupVisitor(context, { onDefinePropsEnter(_node, props) {
				for (const prop of props) if (prop.propName) jsVars.add(prop.propName);
			} }), utils.executeOnVue(context, (obj) => {
				const properties = utils.iterateProperties(obj, new Set(GROUP_NAMES));
				for (const node of properties) jsVars.add(node.name);
			}), utils.defineTemplateBodyVisitor(context, {
				/** @param {VElement} node */
				VElement(node) {
					scopeStack = {
						parent: scopeStack,
						nodes: scopeStack ? [...scopeStack.nodes] : []
					};
					for (const variable of node.variables) {
						const varNode = variable.id;
						const name = varNode.name;
						if (isAllowedVarName(context, name)) continue;
						if (scopeStack.nodes.some((node) => node.name === name) || jsVars.has(name)) context.report({
							node: varNode,
							loc: varNode.loc,
							messageId: "alreadyDeclaredInUpperScope",
							data: { name }
						});
						else scopeStack.nodes.push(varNode);
					}
				},
				"VElement:exit"() {
					scopeStack &&= scopeStack.parent;
				}
			}));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_template_shadow();
	}
});
GLx["use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-template-target-blank.js
/**
* @fileoverview disallow target="_blank" attribute without rel="noopener noreferrer"
* @author Sosukesuzuki
*/
var require_no_template_target_blank = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/** @param {VAttribute} node */
	function isTargetBlank(node) {
		return node.key && node.key.name === "target" && node.value && node.value.value === "_blank";
	}
	/**
	* @param {VStartTag} node
	* @param {boolean} allowReferrer
	*/
	function hasSecureRel(node, allowReferrer) {
		return node.attributes.some((attr) => {
			if (attr.key && attr.key.name === "rel") {
				const tags = attr.value && attr.value.type === "VLiteral" && attr.value.value.toLowerCase().split(" ");
				return tags && tags.includes("noopener") && (allowReferrer || tags.includes("noreferrer"));
			}
			return false;
		});
	}
	/**
	* @param {VStartTag} node
	*/
	function hasExternalLink(node) {
		return node.attributes.some((attr) => attr.key && attr.key.name === "href" && attr.value && attr.value.type === "VLiteral" && /^(?:\w+:|\/\/)/.test(attr.value.value));
	}
	/**
	* @param {VStartTag} node
	*/
	function hasDynamicLink(node) {
		return node.attributes.some((attr) => attr.key && attr.key.type === "VDirectiveKey" && attr.key.name && attr.key.name.name === "bind" && attr.key.argument && attr.key.argument.type === "VIdentifier" && attr.key.argument.name === "href");
	}
	/**
	* @param {VAttribute} node
	* @returns {Rule.SuggestionReportDescriptor}
	*/
	function getSuggestion(node) {
		const relAttributeNode = node.parent.attributes.find((attribute) => attribute.key.name === "rel");
		if (relAttributeNode) return {
			desc: "Change `rel` attribute value to `noopener noreferrer`.",
			fix(fixer) {
				return fixer.replaceText(relAttributeNode, "rel=\"noopener noreferrer\"");
			}
		};
		return {
			desc: "Add `rel=\"noopener noreferrer\"`.",
			fix(fixer) {
				return fixer.insertTextAfter(node, " rel=\"noopener noreferrer\"");
			}
		};
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow target=\"_blank\" attribute without rel=\"noopener noreferrer\"",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/no-template-target-blank.html"
			},
			hasSuggestions: true,
			schema: [{
				type: "object",
				properties: {
					allowReferrer: { type: "boolean" },
					enforceDynamicLinks: { enum: ["always", "never"] }
				},
				additionalProperties: false
			}],
			messages: { missingRel: "Using target=\"_blank\" without rel=\"noopener noreferrer\" is a security risk." }
		},
		/**
		* Creates AST event handlers for no-template-target-blank
		*
		* @param {RuleContext} context - The rule context.
		* @returns {RuleListener} AST event handlers.
		*/
		create(context) {
			const configuration = context.options[0] || {};
			const allowReferrer = configuration.allowReferrer || false;
			const enforceDynamicLinks = configuration.enforceDynamicLinks || "always";
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VAttribute} node */
"VAttribute[directive=false]"(node) {
				if (!isTargetBlank(node) || hasSecureRel(node.parent, allowReferrer)) return;
				if (hasExternalLink(node.parent) || enforceDynamicLinks === "always" && hasDynamicLink(node.parent)) context.report({
					node,
					messageId: "missingRel",
					suggest: [getSuggestion(node)]
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_template_target_blank();
	}
});
zҨSx="use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-textarea-mustache.js
/**
* @author Toru Nagashima
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_no_textarea_mustache = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow mustaches in `<textarea>`",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/no-textarea-mustache.html"
			},
			fixable: null,
			schema: [],
			messages: { unexpected: "Unexpected mustache. Use 'v-model' instead." }
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VExpressionContainer} node */
"VElement[rawName='textarea'] VExpressionContainer"(node) {
				if (node.parent.type !== "VElement") return;
				context.report({
					node,
					loc: node.loc,
					messageId: "unexpected"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_textarea_mustache();
	}
});
{Ex	"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-this-in-before-route-enter.js
/**
* @fileoverview Don't use this in a beforeRouteEnter method
* @author Przemyslaw Jan Beigert
*/
var require_no_this_in_before_route_enter = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow `this` usage in a `beforeRouteEnter` method",
				categories: null,
				url: "https://eslint.vuejs.org/rules/no-this-in-before-route-enter.html"
			},
			fixable: null,
			schema: [],
			messages: { disallow: "'beforeRouteEnter' does NOT have access to `this` component instance. https://router.vuejs.org/guide/advanced/navigation-guards.html#in-component-guards." }
		},
		/** @param {RuleContext} context */
		create(context) {
			/**
			* @typedef {object} ScopeStack
			* @property {ScopeStack | null} upper
			* @property {FunctionExpression | FunctionDeclaration} node
			* @property {boolean} beforeRouteEnter
			*/
			/** @type {Set<FunctionExpression>} */
			const beforeRouteEnterFunctions = /* @__PURE__ */ new Set();
			/** @type {ScopeStack | null} */
			let scopeStack = null;
			/**
			* @param {FunctionExpression | FunctionDeclaration | ArrowFunctionExpression} node
			*/
			function onFunctionEnter(node) {
				if (node.type === "ArrowFunctionExpression") return;
				scopeStack = {
					upper: scopeStack,
					node,
					beforeRouteEnter: beforeRouteEnterFunctions.has(node)
				};
			}
			/**
			* @param {FunctionExpression | FunctionDeclaration | ArrowFunctionExpression} node
			*/
			function onFunctionExit(node) {
				if (scopeStack && scopeStack.node === node) scopeStack = scopeStack.upper;
			}
			return utils.defineVueVisitor(context, {
				onVueObjectEnter(node) {
					const beforeRouteEnter = utils.findProperty(node, "beforeRouteEnter");
					if (beforeRouteEnter && beforeRouteEnter.value.type === "FunctionExpression") beforeRouteEnterFunctions.add(beforeRouteEnter.value);
				},
				":function": onFunctionEnter,
				":function:exit": onFunctionExit,
				ThisExpression(node) {
					if (scopeStack && scopeStack.beforeRouteEnter) context.report({
						node,
						messageId: "disallow"
					});
				}
			});
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_this_in_before_route_enter();
	}
});
Gxzconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
let node_path = require("node:path");
node_path = require_runtime.__toESM(node_path);
//#region lib/rules/no-undef-components.ts
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
/**
* `casing.camelCase()` converts the beginning to lowercase,
* but does not convert the case of the beginning character when converting with Vue3.
* @see https://github.com/vuejs/core/blob/ae4b0783d78670b6e942ae2a4e3ec6efbbffa158/packages/shared/src/index.ts#L105
*/
function camelize(str) {
	return str.replaceAll(/-(\w)/g, (_, c) => c ? c.toUpperCase() : "");
}
var DefinedInSetupComponents = class {
	/**
	* Component names
	*/
	names = /* @__PURE__ */ new Set();
	addName(...names) {
		for (const name of names) this.names.add(name);
	}
	/**
	* @see https://github.com/vuejs/core/blob/ae4b0783d78670b6e942ae2a4e3ec6efbbffa158/packages/compiler-core/src/transforms/transformElement.ts#L334
	*/
	isDefinedComponent(rawName) {
		if (this.names.has(rawName)) return true;
		const camelName = camelize(rawName);
		if (this.names.has(camelName)) return true;
		const pascalName = require_casing.capitalize(camelName);
		if (this.names.has(pascalName)) return true;
		const dotIndex = rawName.indexOf(".");
		return dotIndex > 0 && this.isDefinedComponent(rawName.slice(0, dotIndex));
	}
};
var DefinedInOptionComponents = class {
	/**
	* Component names
	*/
	names = /* @__PURE__ */ new Set();
	/**
	* Component names, transformed to kebab-case
	*/
	kebabCaseNames = /* @__PURE__ */ new Set();
	addName(...names) {
		for (const name of names) {
			this.names.add(name);
			this.kebabCaseNames.add(require_casing.kebabCase(name));
		}
	}
	isDefinedComponent(rawName) {
		if (this.names.has(rawName)) return true;
		const kebabCaseName = require_casing.kebabCase(rawName);
		return this.kebabCaseNames.has(kebabCaseName) && !require_casing.isPascalCase(rawName);
	}
};
var no_undef_components_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "disallow use of undefined components in `<template>`",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/no-undef-components.html"
		},
		fixable: null,
		schema: [{
			type: "object",
			properties: { ignorePatterns: { type: "array" } },
			additionalProperties: false
		}],
		messages: {
			undef: "The '<{{name}}>' component has been used, but not defined.",
			typeOnly: "The '<{{name}}>' component has been used, but '{{name}}' only refers to a type."
		}
	},
	create(context) {
		const ignorePatterns = (context.options[0] || {}).ignorePatterns || [];
		/**
		* Check whether the given element name is a verify target or not.
		*/
		function isVerifyTargetComponent(rawName) {
			const kebabCaseName = require_casing.kebabCase(rawName);
			if (import_utils.default.isHtmlWellKnownElementName(rawName) || import_utils.default.isSvgWellKnownElementName(rawName) || import_utils.default.isMathWellKnownElementName(rawName) || import_utils.default.isBuiltInComponentName(kebabCaseName)) return false;
			const pascalCaseName = require_casing.pascalCase(rawName);
			return ignorePatterns.every((pattern) => {
				const regExp = new RegExp(pattern);
				return !regExp.test(rawName) && !regExp.test(kebabCaseName) && !regExp.test(pascalCaseName);
			});
		}
		let verifyName;
		let scriptVisitor = {};
		const templateBodyVisitor = {
			VElement(node) {
				if (!import_utils.default.isHtmlElementNode(node) && !import_utils.default.isSvgElementNode(node) && !import_utils.default.isMathElementNode(node)) return;
				verifyName(node.rawName, node.startTag);
			},
			"VAttribute[directive=false][key.name='is']"(node) {
				if (!node.value) return;
				const value = node.value.value.startsWith("vue:") ? node.value.value.slice(4) : node.value.value;
				verifyName(value, node);
			}
		};
		if (import_utils.default.isScriptSetup(context)) {
			const definedInSetupComponents = new DefinedInSetupComponents();
			const definedInOptionComponents = new DefinedInOptionComponents();
			const scriptTypeOnlyNames = /* @__PURE__ */ new Set();
			const globalScope = context.sourceCode.scopeManager.globalScope;
			if (globalScope) {
				for (const variable of globalScope.variables) definedInSetupComponents.addName(variable.name);
				const moduleScope = globalScope.childScopes.find((scope) => scope.type === "module");
				const moduleVariables = moduleScope && moduleScope.variables || [];
				for (const variable of moduleVariables) if (variable.isTypeVariable && !variable.isValueVariable || variable.defs.length > 0 && variable.defs.every((def) => {
					if (def.type !== "ImportBinding") return false;
					if (def.parent.importKind === "type") return true;
					return def.node.type === "ImportSpecifier" && def.node.importKind === "type";
				})) scriptTypeOnlyNames.add(variable.name);
				else definedInSetupComponents.addName(variable.name);
			}
			const fileName = context.filename;
			const selfComponentName = node_path.default.basename(fileName, node_path.default.extname(fileName));
			definedInSetupComponents.addName(selfComponentName);
			scriptVisitor = import_utils.default.defineVueVisitor(context, { onVueObjectEnter(node, { type }) {
				if (type !== "export") return;
				const nameProperty = import_utils.default.findProperty(node, "name");
				if (nameProperty && import_utils.default.isStringLiteral(nameProperty.value)) {
					const name = import_utils.default.getStringLiteralValue(nameProperty.value);
					if (name) definedInOptionComponents.addName(name);
				}
			} });
			verifyName = (rawName, reportNode) => {
				if (!isVerifyTargetComponent(rawName)) return;
				if (definedInSetupComponents.isDefinedComponent(rawName)) return;
				if (definedInOptionComponents.isDefinedComponent(rawName)) return;
				context.report({
					node: reportNode,
					messageId: scriptTypeOnlyNames.has(rawName) ? "typeOnly" : "undef",
					data: { name: rawName }
				});
			};
		} else {
			const definedInOptionComponents = new DefinedInOptionComponents();
			scriptVisitor = import_utils.default.executeOnVue(context, (obj) => {
				definedInOptionComponents.addName(...import_utils.default.getRegisteredComponents(obj).map(({ name }) => name));
				const nameProperty = import_utils.default.findProperty(obj, "name");
				if (nameProperty && import_utils.default.isStringLiteral(nameProperty.value)) {
					const name = import_utils.default.getStringLiteralValue(nameProperty.value);
					if (name) definedInOptionComponents.addName(name);
				}
			});
			verifyName = (rawName, reportNode) => {
				if (!isVerifyTargetComponent(rawName)) return;
				if (definedInOptionComponents.isDefinedComponent(rawName)) return;
				context.report({
					node: reportNode,
					messageId: "undef",
					data: { name: rawName }
				});
			};
			templateBodyVisitor["VAttribute[directive=true][key.name.name='bind'][key.argument.name='is'], VAttribute[directive=true][key.name.name='is']"] = (node) => {
				if (!node.value || node.value.type !== "VExpressionContainer" || !node.value.expression) return;
				if (node.value.expression.type === "Literal") verifyName(String(node.value.expression.value), node);
			};
		}
		return import_utils.default.defineTemplateBodyVisitor(context, templateBodyVisitor, scriptVisitor);
	}
};
//#endregion
exports.default = no_undef_components_default;
T㲒x"const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
const require_regexp = require("../utils/regexp.js");
//#region lib/rules/no-undef-directives.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
function getRegisteredDirectives(componentObject) {
	const directivesNode = componentObject.properties.find((p) => p.type === "Property" && import_utils.default.getStaticPropertyName(p) === "directives" && p.value.type === "ObjectExpression");
	if (!directivesNode || directivesNode.type !== "Property" || directivesNode.value.type !== "ObjectExpression") return [];
	return directivesNode.value.properties.flatMap((node) => {
		const name = node.type === "Property" ? import_utils.default.getStaticPropertyName(node) : null;
		return name ? [{
			node,
			name
		}] : [];
	});
}
function isDefinedInSetup(rawName, definedNames) {
	const variableName = `v${require_casing.capitalize(require_casing.camelCase(rawName))}`;
	return definedNames.has(variableName);
}
function isDefinedInOptions(rawName, definedNames) {
	const camelName = require_casing.camelCase(rawName);
	if (definedNames.has(rawName)) return true;
	for (const name of definedNames) {
		const lowercaseName = name.toLowerCase();
		if (name !== lowercaseName && lowercaseName === camelName.toLowerCase()) return true;
	}
	return false;
}
var no_undef_directives_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "disallow use of undefined custom directives",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/no-undef-directives.html"
		},
		fixable: null,
		schema: [{
			type: "object",
			properties: { ignore: {
				type: "array",
				items: { type: "string" },
				uniqueItems: true
			} },
			additionalProperties: false
		}],
		messages: { undef: "The 'v-{{name}}' directive has been used, but not defined." }
	},
	create(context) {
		const { ignore = [] } = context.options[0] || {};
		const isAnyIgnored = require_regexp.toRegExpGroupMatcher(ignore);
		/**
		* Check whether the given directive name is a verify target or not.
		*/
		function isVerifyTargetDirective(rawName) {
			const kebabName = require_casing.kebabCase(rawName);
			return !import_utils.default.isBuiltInDirectiveName(rawName) && !isAnyIgnored(rawName, kebabName);
		}
		function createTemplateBodyVisitor(isDefined) {
			return { "VAttribute[directive=true]"(node) {
				const name = node.key.name.name;
				if (import_utils.default.isBuiltInDirectiveName(name)) return;
				const rawName = node.key.name.rawName || name;
				if (isVerifyTargetDirective(rawName) && !isDefined(rawName)) context.report({
					node: node.key,
					messageId: "undef",
					data: { name: rawName }
				});
			} };
		}
		const definedInOptionDirectives = /* @__PURE__ */ new Set();
		if (import_utils.default.isScriptSetup(context)) {
			const definedInSetupDirectives = /* @__PURE__ */ new Set();
			const globalScope = context.sourceCode.scopeManager.globalScope;
			if (globalScope) {
				for (const variable of globalScope.variables) definedInSetupDirectives.add(variable.name);
				const moduleVariables = globalScope.childScopes.find((scope) => scope.type === "module")?.variables ?? [];
				for (const variable of moduleVariables) definedInSetupDirectives.add(variable.name);
			}
			const scriptVisitor = import_utils.default.defineVueVisitor(context, { onVueObjectEnter(node) {
				for (const directive of getRegisteredDirectives(node)) definedInOptionDirectives.add(directive.name);
			} });
			const templateBodyVisitor = createTemplateBodyVisitor((rawName) => isDefinedInSetup(rawName, definedInSetupDirectives) || isDefinedInOptions(rawName, definedInOptionDirectives));
			return import_utils.default.defineTemplateBodyVisitor(context, templateBodyVisitor, scriptVisitor);
		}
		const scriptVisitor = import_utils.default.executeOnVue(context, (obj) => {
			for (const directive of getRegisteredDirectives(obj)) definedInOptionDirectives.add(directive.name);
		});
		const templateBodyVisitor = createTemplateBodyVisitor((rawName) => isDefinedInOptions(rawName, definedInOptionDirectives));
		return import_utils.default.defineTemplateBodyVisitor(context, templateBodyVisitor, scriptVisitor);
	}
};
//#endregion
exports.default = no_undef_directives_default;
㊽x=rconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_index$1 = require("../utils/style-variables/index.js");
const require_property_references = require("../utils/property-references.js");
const require_comments = require("../utils/comments.js");
let _eslint_community_eslint_utils = require("@eslint-community/eslint-utils");
_eslint_community_eslint_utils = require_runtime.__toESM(_eslint_community_eslint_utils);
//#region lib/rules/no-unused-properties.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
const GROUP_PROPERTY = "props";
const GROUP_DATA = "data";
const GROUP_ASYNC_DATA = "asyncData";
const GROUP_COMPUTED_PROPERTY = "computed";
const GROUP_METHODS = "methods";
const GROUP_SETUP = "setup";
const GROUP_WATCHER = "watch";
const GROUP_EXPOSE = "expose";
const GROUP_INJECT = "inject";
const UNREFERENCED_UNKNOWN_MEMBER = "unknownMemberAsUnreferenced";
const UNREFERENCED_RETURN = "returnAsUnreferenced";
const PROPERTY_LABEL = {
	props: "property",
	data: "data",
	asyncData: "async data",
	computed: "computed property",
	methods: "method",
	setup: "property returned from `setup()`",
	inject: "inject",
	watch: "watch",
	provide: "provide",
	expose: "expose"
};
function findExpression(context, id) {
	const variable = import_utils.default.findVariableByIdentifier(context, id);
	if (!variable) return id;
	if (variable.defs.length === 1) {
		const def = variable.defs[0];
		if (def.type === "Variable" && def.parent.kind === "const" && def.node.init) {
			if (def.node.init.type === "Identifier") return findExpression(context, def.node.init);
			return def.node.init;
		}
	}
	return id;
}
/**
* Check if the given component property is marked as `@public` in JSDoc comments.
*/
function isPublicMember(property, sourceCode) {
	if (property.type === "object" && property.groupName !== "props") return isPublicProperty(property.property, sourceCode);
	return false;
}
/**
* Check if the given property node is marked as `@public` in JSDoc comments.
*/
function isPublicProperty(node, sourceCode) {
	const jsdoc = getJSDocFromProperty(node, sourceCode);
	if (jsdoc) return /(?:^|\s|\*)@public\b/u.test(jsdoc.value);
	return false;
}
/**
* Get the JSDoc comment for a given property node.
*/
function getJSDocFromProperty(node, sourceCode) {
	const jsdoc = findJSDocComment(node, sourceCode);
	if (jsdoc) return jsdoc;
	if (node.value.type === "FunctionExpression" || node.value.type === "ArrowFunctionExpression") return findJSDocComment(node.value, sourceCode);
	return null;
}
/**
* Finds a JSDoc comment for the given node.
*/
function findJSDocComment(node, sourceCode) {
	let currentNode = node;
	let tokenBefore = null;
	while (currentNode) {
		tokenBefore = sourceCode.getTokenBefore(currentNode, { includeComments: true });
		if (!tokenBefore || !_eslint_community_eslint_utils.default.isCommentToken(tokenBefore)) return null;
		if (tokenBefore.type === "Line") {
			currentNode = tokenBefore;
			continue;
		}
		break;
	}
	if (tokenBefore && require_comments.isJSDocComment(tokenBefore)) return tokenBefore;
	return null;
}
var no_unused_properties_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "disallow unused properties",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/no-unused-properties.html"
		},
		fixable: null,
		schema: [{
			type: "object",
			properties: {
				groups: {
					type: "array",
					items: { enum: [
						GROUP_PROPERTY,
						GROUP_DATA,
						GROUP_ASYNC_DATA,
						GROUP_COMPUTED_PROPERTY,
						GROUP_METHODS,
						GROUP_SETUP,
						GROUP_INJECT
					] },
					additionalItems: false,
					uniqueItems: true
				},
				deepData: { type: "boolean" },
				ignorePublicMembers: { type: "boolean" },
				unreferencedOptions: {
					type: "array",
					items: { enum: [UNREFERENCED_UNKNOWN_MEMBER, UNREFERENCED_RETURN] },
					additionalItems: false,
					uniqueItems: true
				}
			},
			additionalProperties: false
		}],
		messages: { unused: "'{{name}}' of {{group}} found, but never used." }
	},
	create(context) {
		const options = context.options[0] || {};
		const groups = new Set(options.groups || [GROUP_PROPERTY]);
		const shouldCheckDeepData = Boolean(options.deepData);
		const shouldIgnorePublicMembers = Boolean(options.ignorePublicMembers);
		const unreferencedOptions = new Set(options.unreferencedOptions || []);
		let propsReferencePattern = null;
		const propertyReferenceExtractor = require_property_references.definePropertyReferenceExtractor(context, {
			unknownMemberAsUnreferenced: unreferencedOptions.has(UNREFERENCED_UNKNOWN_MEMBER),
			returnAsUnreferenced: unreferencedOptions.has(UNREFERENCED_RETURN)
		});
		const templatePropertiesContainer = {
			propertyReferences: [],
			refNames: /* @__PURE__ */ new Set()
		};
		const vueComponentPropertiesContainerMap = /* @__PURE__ */ new Map();
		function getVueComponentPropertiesContainer(node) {
			let container = vueComponentPropertiesContainerMap.get(node);
			if (!container) {
				container = {
					properties: [],
					propertyReferences: [],
					propertyReferencesForProps: []
				};
				vueComponentPropertiesContainerMap.set(node, container);
			}
			return container;
		}
		function verifyDataOptionDeepProperties(segments, propertyValue, propertyReferences) {
			let targetExpr = propertyValue;
			if (targetExpr.type === "Identifier") targetExpr = findExpression(context, targetExpr);
			if (targetExpr.type === "ObjectExpression") for (const prop of targetExpr.properties) {
				if (prop.type !== "Property") continue;
				const name = import_utils.default.getStaticPropertyName(prop);
				if (name == null) continue;
				if (!propertyReferences.hasProperty(name, { unknownCallAsAny: true })) {
					context.report({
						node: prop.key,
						messageId: "unused",
						data: {
							group: PROPERTY_LABEL.data,
							name: [...segments, name].join(".")
						}
					});
					continue;
				}
				verifyDataOptionDeepProperties([...segments, name], prop.value, propertyReferences.getNest(name));
			}
		}
		/**
		* Report the given property if it is unused.
		*/
		function verifyPropertyUsage(property, propertyReferences, propertyReferencesForProps) {
			if (property.groupName === "props" && propertyReferencesForProps.hasProperty(property.name) || propertyReferences.hasProperty("$props")) return;
			if (property.groupName === "setup" && templatePropertiesContainer.refNames.has(property.name)) return;
			if (shouldIgnorePublicMembers && isPublicMember(property, context.sourceCode)) return;
			if (propertyReferences.hasProperty(property.name)) {
				if (shouldCheckDeepData && (property.groupName === "data" || property.groupName === "asyncData") && property.type === "object") verifyDataOptionDeepProperties([property.name], property.property.value, propertyReferences.getNest(property.name));
				return;
			}
			context.report({
				node: property.node,
				messageId: "unused",
				data: {
					group: PROPERTY_LABEL[property.groupName],
					name: property.name
				}
			});
		}
		/**
		* Report all unused properties.
		*/
		function reportUnusedProperties() {
			for (const container of vueComponentPropertiesContainerMap.values()) {
				const propertyReferences = require_property_references.mergePropertyReferences([...container.propertyReferences, ...templatePropertiesContainer.propertyReferences]);
				const propertyReferencesForProps = require_property_references.mergePropertyReferences(container.propertyReferencesForProps);
				for (const property of container.properties) verifyPropertyUsage(property, propertyReferences, propertyReferencesForProps);
			}
		}
		function getParentProperty(node) {
			if (!node.parent || node.parent.type !== "Property" || node.parent.value !== node) return null;
			const property = node.parent;
			if (!import_utils.default.isProperty(property)) return null;
			return property;
		}
		const scriptVisitor = import_utils.default.compositingVisitors(import_utils.default.defineScriptSetupVisitor(context, {
			onDefinePropsEnter(node, props) {
				if (!groups.has("props")) return;
				const container = getVueComponentPropertiesContainer(context.sourceCode.ast);
				for (const prop of props) {
					if (!prop.propName) continue;
					if (prop.type === "object") container.properties.push({
						type: prop.type,
						name: prop.propName,
						groupName: "props",
						node: prop.key,
						property: prop.node
					});
					else container.properties.push({
						type: prop.type,
						name: prop.propName,
						groupName: "props",
						node: prop.type === "infer-type" ? prop.node : prop.key
					});
				}
				let target = node;
				if (target.parent && target.parent.type === "CallExpression" && target.parent.arguments[0] === target && target.parent.callee.type === "Identifier" && target.parent.callee.name === "withDefaults") target = target.parent;
				if (!target.parent || target.parent.type !== "VariableDeclarator" || target.parent.init !== target) return;
				propsReferencePattern = target.parent.id;
				const propertyReferences = propertyReferenceExtractor.extractFromPattern(propsReferencePattern);
				container.propertyReferencesForProps.push(propertyReferences);
			},
			onDefineModelEnter(node, model) {
				if (!groups.has("props")) return;
				const container = getVueComponentPropertiesContainer(context.sourceCode.ast);
				if (node.parent && node.parent.type === "VariableDeclarator" && node.parent.init === node) {
					container.propertyReferences.push(propertyReferenceExtractor.extractFromName(model.name.modelName, model.name.node || node));
					return;
				}
				container.properties.push({
					type: "model",
					name: model.name.modelName,
					groupName: "props",
					node: model.name.node || node
				});
			}
		}), import_utils.default.defineVueVisitor(context, {
			CallExpression(node, vueData) {
				if (node.callee.type !== "Identifier") return;
				let groupName = null;
				if (/^mapMutations|mapActions$/u.test(node.callee.name)) groupName = "methods";
				else if (/^mapState|mapGetters|mapWritableState$/u.test(node.callee.name)) groupName = "computed";
				if (!groupName || node.arguments.length === 0) return;
				const arg = node.arguments.length === 2 ? node.arguments[1] : node.arguments[0];
				if (arg.type === "ObjectExpression") {
					const container = getVueComponentPropertiesContainer(vueData.node);
					for (const prop of arg.properties) {
						const name = prop.type === "SpreadElement" ? null : import_utils.default.getStaticPropertyName(prop);
						if (name) container.properties.push({
							type: "array",
							name,
							groupName,
							node: prop
						});
					}
				} else if (arg.type === "ArrayExpression") {
					const container = getVueComponentPropertiesContainer(vueData.node);
					for (const element of arg.elements) {
						if (!element || element.type !== "Literal" && element.type !== "TemplateLiteral") continue;
						const name = import_utils.default.getStringLiteralValue(element);
						if (name) container.properties.push({
							type: "array",
							name,
							groupName,
							node: element
						});
					}
				}
			},
			onVueObjectEnter(node, vueNode) {
				const container = getVueComponentPropertiesContainer(vueNode.node);
				const watchersAndExposes = import_utils.default.iterateProperties(node, /* @__PURE__ */ new Set([GROUP_WATCHER, GROUP_EXPOSE]));
				for (const watcherOrExpose of watchersAndExposes) if (watcherOrExpose.groupName === GROUP_WATCHER) {
					const watcher = watcherOrExpose;
					container.propertyReferences.push(propertyReferenceExtractor.extractFromPath(watcher.name, watcher.node));
					if (watcher.type === "object") {
						const property = watcher.property;
						if (property.kind === "init") for (const handlerValueNode of import_utils.default.iterateWatchHandlerValues(property)) container.propertyReferences.push(propertyReferenceExtractor.extractFromNameLiteral(handlerValueNode));
					}
				} else if (watcherOrExpose.groupName === GROUP_EXPOSE) {
					const expose = watcherOrExpose;
					container.propertyReferences.push(propertyReferenceExtractor.extractFromName(expose.name, expose.node));
				}
				container.properties.push(...import_utils.default.iterateProperties(node, groups));
			},
			"ObjectExpression > Property > :function[params.length>0]"(node, vueData) {
				const property = getParentProperty(node);
				if (!property) return;
				if (property.parent === vueData.node) {
					if (import_utils.default.getStaticPropertyName(property) !== "data") return;
				} else {
					const parentProperty = getParentProperty(property.parent);
					if (!parentProperty) return;
					if (parentProperty.parent === vueData.node) {
						if (import_utils.default.getStaticPropertyName(parentProperty) !== "computed") return;
					} else {
						const parentParentProperty = getParentProperty(parentProperty.parent);
						if (!parentParentProperty) return;
						if (parentParentProperty.parent === vueData.node) {
							if (import_utils.default.getStaticPropertyName(parentParentProperty) !== "computed" || import_utils.default.getStaticPropertyName(property) !== "get") return;
						} else return;
					}
				}
				const propertyReferences = propertyReferenceExtractor.extractFromFunctionParam(node, 0);
				getVueComponentPropertiesContainer(vueData.node).propertyReferences.push(propertyReferences);
			},
			onSetupFunctionEnter(node, vueData) {
				const container = getVueComponentPropertiesContainer(vueData.node);
				const propertyReferences = propertyReferenceExtractor.extractFromFunctionParam(node, 0);
				container.propertyReferencesForProps.push(propertyReferences);
			},
			onRenderFunctionEnter(node, vueData) {
				const container = getVueComponentPropertiesContainer(vueData.node);
				const propertyReferences = propertyReferenceExtractor.extractFromFunctionParam(node, 0);
				container.propertyReferencesForProps.push(propertyReferences);
				if (vueData.functional) {
					const propertyReferencesForV2 = propertyReferenceExtractor.extractFromFunctionParam(node, 1);
					container.propertyReferencesForProps.push(propertyReferencesForV2.getNest("props"));
				}
			},
			"ThisExpression, Identifier"(node, vueData) {
				if (!import_utils.default.isThis(node, context)) return;
				const container = getVueComponentPropertiesContainer(vueData.node);
				const propertyReferences = propertyReferenceExtractor.extractFromExpression(node, false);
				container.propertyReferences.push(propertyReferences);
			}
		}), {
			Program() {
				const styleVars = require_index$1.getStyleVariablesContext(context);
				if (styleVars) templatePropertiesContainer.propertyReferences.push(propertyReferenceExtractor.extractFromStyleVariablesContext(styleVars));
			},
			"Program:exit"(node) {
				if (!node.templateBody) reportUnusedProperties();
			}
		});
		return import_utils.default.defineTemplateBodyVisitor(context, {
			VExpressionContainer(node) {
				const property = propertyReferenceExtractor.extractFromVExpressionContainer(node);
				templatePropertiesContainer.propertyReferences.push(property);
				if (!propsReferencePattern) return;
				for (const key of property.allProperties().keys()) if (propsReferencePattern.type === "Identifier" && propsReferencePattern.name === key) templatePropertiesContainer.propertyReferences.push(property.getNest(key));
			},
			"VAttribute[directive=false]"(node) {
				if (node.key.name === "ref" && node.value != null) templatePropertiesContainer.refNames.add(node.value.value);
			},
			"VElement[parent.type!='VElement']:exit"() {
				reportUnusedProperties();
			}
		}, scriptVisitor);
	}
};
//#endregion
exports.default = no_unused_properties_default;
.x2{`regexpregexp>vue_reserved$1vue-reserved.js"defbvar import_vue_reserved/3vue_reserved$1g7&6function getObjectPropertyMap(object) {
	const props =WMap();
	for (const p of object.properties) {
		if (p.type !== "Property") return null;
*)3);
Areturn null;
		props.set(name, p);
	}
	return props;
}
function getPropertyDataFromObjectProperty(property) {
	if (property == 6null) return null;
	const propertyMap = property.valuea( ? getObjectPropertyMap(property.value) : null;
	return {
		hasNestProperty: Boolean(propertyMap),
		get(name) {
			if (!propertyMapPgetPropertyDataFromObjectProperty(propertyMap.get(name));
		}
	};
}
var no_undefq]definTdef(X ignores: {
items: { type: "string" },
} 5`
			undef: "'{{name}}' is not defined.",
			undefProps: "'{{name}}' is not defined in props."
		!!{ ignores = [String.raw`/^\$/`] }6%8isIgnored = require_regexp.toRegExpGroupMatcher(ignores)k);
		const programNode =  ;
		/**
		* Property names identified as defined via a Vuex or Pinia helpers
		*/
		const propertiesDefinedByStoreHelpers = /* ;
		function isScriptSetupProgram(node) {
			return node === programNode;
		}
		/** Vue component context */
		class VueCompone!ntContext {
			defineProperties =Map();
			reported =;
			hasUnknownProperty = false;
			/**
			* Report
			*/
			verifyReferences(references, options) {
				if (this.hasUnknownProperty) return;
				const report = this.report.bind(this);
				verifyUndefProperties(this.defineProperties, references, null);
				function verifyUndefProperties(defineProperties, references, pathName) {
					if (!references) return;
					for (const [refName, { nodes }] of references.allProperties()) {
						const referencePathName = pathName ? `${pathName}.${refName}` : refName;
						const prop = defineProperties.get && defineProperties.get(refName);
						if (prop) {
							if (options && options.isProps && !prop.isProps) {
								report(nodes[0], referencePathName, "undefProps");
								continue;
							}
						} else {
							report(nodes[0], referencePathName, "undef");
							continue;
						}
						if (prop.hasNestProperty) verifyUndefProperti7es(prop, references.getNest(refName), referencePathName+
			/**
			* Report
			*/
			report(node, name, messageId = "undef") {
				if (import_vue_reserved.default.includes(name) || isIgnored(name) || propertiesDefinedByStoreHelpers.has(name)) return;
				if (this.reported.has(node) || this.reported.has(name))C return;
				this.reported.add(node);
				this.reported.add(name);
node,
					messageId,
					data: { name }
				});
			}
			markAsHasUnknownProperty() {
				this.hasUnknownProperty = true;
			}
		}ContextMap =A!0Context(node) {
			let ctx = vueComponentContexttx) {
				ctx = new VueComponentContext();
				vueComponentContextMap.set(node, ctx);
			}
			return ctx;
		}
		function getVueComponentContextForTemplate() {
			const keys = [...vueComponentContextMap.keys()];
			const exported = keys.find(isScriptSetupProgram) || keys.find(7MInExportDefault);
			return exported && vueComponentContextMap.get(exported);G{ Program() { iScriptSetup(context)) return;
			const ctx = getVueComponentContext(programNode);
			const globalScope =  scopeManager.globalScope;
			if (globalScope) {
				for (const variable of globalScope.variables) ctx.defineProperties.set(variable.name, {});
				const moduleScope = globalScope.childScopes.find((scope) => scope.type === "module");
				const moduleVariables = moduleScope && moduleScope.variables || [];
				for (const variable of moduleVariables) ctx.defineProperties.set(variable.name, {});
			}
		} },Q,&oG.const ctx = getVueComponentContext(programNode' ,v Funknown") {
						ctx.markAsHasUnknownProperty();
						return;
					}I )8ctx.defineProperties.set(prop.propName, { isProps: true !vconst pi#i!attern);
				ctx.verifyReferences5!7$L_node, model) {
				getVueComponentContext(programNode).defineProperties.set%{ isProps: true [&Ve<&GROUP_METHODS]']'((k?if (name) propertiesDefinedByStoreHelpers.add(name);
				}
				))c*+if (!element || 7"StringLiteral(element)) continue;
*L4if (name) propertiesDefinedByStoreHelpers.add(name);+%+) {
				const ctx = getVueComponentContext(4iM,K
GROUP_ASYNC_DATA,
3GROUP_METHODS,
A])' (erties) {
					const propertyMap = (prop-DATA || prop-<ASYNC_DATA) && prop.type === "object" && prop.property.valuea( ? getObjectPropertyMap(prop.property.value) : null;
					ctx.defineProperties.set(prop.name, {
						hasNestProperty: Boolean(!propertyMap),
						isProps: prop-get(name) {
							if (!propertyMap) return null;
							return getPropertyDataFromObjectProperty(propertyMap.get(name));
					T}2,tx.verifyReferences9'-tx.verifyReferences9'.tx.verifyReferences9'/*#0let isProps = false0	isProps = true:1&Context(vueData.node).verifyReferences5, { isProps }}4<06
#)<55getVueComponentContext(vueData.node).verifyReferences5, { isProps: true }5>tx = getVueComponentContext5rtx.verifyReferences56tx.verifyReferences5q7, { isProps: true }7tx = getVueComponentContext5U8tx.verifyReferences5
		}), { "Program:exit"() {
			const ctx = getVueComponentContextForTemplate();
			if (!ctx) return;
			const styleVars = requi91#if (styleVars) ctx.verifyReferences9L} 7:F : ]const ctx = getVueComponentContextForTemplate();
			if (!ctx) return;
			ctx.verifyReferences9':!, { ignoreGlobals: true }));
		} 7==defq;
pӹxconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_slot_scope_attribute$1 = require("./syntaxes/slot-scope-attribute.js");
const require_v_is$1 = require("./syntaxes/v-is.js");
const require_dynamic_directive_arguments$1 = require("./syntaxes/dynamic-directive-arguments.js");
const require_v_slot$1 = require("./syntaxes/v-slot.js");
const require_script_setup$1 = require("./syntaxes/script-setup.js");
const require_style_css_vars_injection = require("./syntaxes/style-css-vars-injection.js");
const require_v_model_argument$1 = require("./syntaxes/v-model-argument.js");
const require_v_model_custom_modifiers$1 = require("./syntaxes/v-model-custom-modifiers.js");
const require_is_attribute_with_vue_prefix$1 = require("./syntaxes/is-attribute-with-vue-prefix.js");
const require_v_memo$1 = require("./syntaxes/v-memo.js");
const require_v_bind_prop_modifier_shorthand$1 = require("./syntaxes/v-bind-prop-modifier-shorthand.js");
const require_v_bind_attr_modifier$1 = require("./syntaxes/v-bind-attr-modifier.js");
const require_define_options$1 = require("./syntaxes/define-options.js");
const require_define_slots$1 = require("./syntaxes/define-slots.js");
const require_define_model$1 = require("./syntaxes/define-model.js");
const require_v_bind_same_name_shorthand$1 = require("./syntaxes/v-bind-same-name-shorthand.js");
let semver = require("semver");
semver = require_runtime.__toESM(semver);
//#region lib/rules/no-unsupported-features.ts
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
var import_slot_scope_attribute = /* @__PURE__ */ require_runtime.__toESM(require_slot_scope_attribute$1.default);
var import_dynamic_directive_arguments = /* @__PURE__ */ require_runtime.__toESM(require_dynamic_directive_arguments$1.default);
var import_v_slot = /* @__PURE__ */ require_runtime.__toESM(require_v_slot$1.default);
var import_script_setup = /* @__PURE__ */ require_runtime.__toESM(require_script_setup$1.default);
var import_v_model_argument = /* @__PURE__ */ require_runtime.__toESM(require_v_model_argument$1.default);
var import_v_model_custom_modifiers = /* @__PURE__ */ require_runtime.__toESM(require_v_model_custom_modifiers$1.default);
var import_v_is = /* @__PURE__ */ require_runtime.__toESM(require_v_is$1.default);
var import_is_attribute_with_vue_prefix = /* @__PURE__ */ require_runtime.__toESM(require_is_attribute_with_vue_prefix$1.default);
var import_v_memo = /* @__PURE__ */ require_runtime.__toESM(require_v_memo$1.default);
var import_v_bind_prop_modifier_shorthand = /* @__PURE__ */ require_runtime.__toESM(require_v_bind_prop_modifier_shorthand$1.default);
var import_v_bind_attr_modifier = /* @__PURE__ */ require_runtime.__toESM(require_v_bind_attr_modifier$1.default);
var import_define_options = /* @__PURE__ */ require_runtime.__toESM(require_define_options$1.default);
var import_define_slots = /* @__PURE__ */ require_runtime.__toESM(require_define_slots$1.default);
var import_define_model = /* @__PURE__ */ require_runtime.__toESM(require_define_model$1.default);
var import_v_bind_same_name_shorthand = /* @__PURE__ */ require_runtime.__toESM(require_v_bind_same_name_shorthand$1.default);
const FEATURES = {
	"slot-scope-attribute": import_slot_scope_attribute.default,
	"dynamic-directive-arguments": import_dynamic_directive_arguments.default,
	"v-slot": import_v_slot.default,
	"script-setup": import_script_setup.default,
	"style-css-vars-injection": require_style_css_vars_injection.default,
	"v-model-argument": import_v_model_argument.default,
	"v-model-custom-modifiers": import_v_model_custom_modifiers.default,
	"v-is": import_v_is.default,
	"is-attribute-with-vue-prefix": import_is_attribute_with_vue_prefix.default,
	"v-memo": import_v_memo.default,
	"v-bind-prop-modifier-shorthand": import_v_bind_prop_modifier_shorthand.default,
	"v-bind-attr-modifier": import_v_bind_attr_modifier.default,
	"define-options": import_define_options.default,
	"define-slots": import_define_slots.default,
	"define-model": import_define_model.default,
	"v-bind-same-name-shorthand": import_v_bind_same_name_shorthand.default
};
const SYNTAX_NAMES = Object.keys(FEATURES);
const cache = /* @__PURE__ */ new Map();
/**
* Get the `semver.Range` object of a given range text.
* It's null if the `x` is not a valid range text.
*/
function getSemverRange(x) {
	let ret = cache.get(x) || null;
	if (!ret) {
		try {
			ret = new semver.default.Range(x);
		} catch {}
		cache.set(x, ret);
	}
	return ret;
}
var no_unsupported_features_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "disallow unsupported Vue.js syntax on the specified version",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/no-unsupported-features.html"
		},
		fixable: "code",
		schema: [{
			type: "object",
			properties: {
				version: { type: "string" },
				ignores: {
					type: "array",
					items: { enum: SYNTAX_NAMES },
					uniqueItems: true
				}
			},
			additionalProperties: false
		}],
		messages: {
			forbiddenSlotScopeAttribute: "`slot-scope` are not supported except Vue.js \">=2.5.0 <3.0.0\".",
			forbiddenDynamicDirectiveArguments: "Dynamic arguments are not supported until Vue.js \"2.6.0\".",
			forbiddenVSlot: "`v-slot` are not supported until Vue.js \"2.6.0\".",
			forbiddenScriptSetup: "`<script setup>` is not supported until Vue.js \"2.7.0\".",
			forbiddenStyleCssVarsInjection: "SFC CSS variable injection is not supported until Vue.js \">=3.0.3 || >=2.7.0 <3.0.0\".",
			forbiddenVModelArgument: "Argument on `v-model` is not supported until Vue.js \"3.0.0\".",
			forbiddenVModelCustomModifiers: "Custom modifiers on `v-model` are not supported until Vue.js \"3.0.0\".",
			forbiddenVIs: "`v-is` are not supported until Vue.js \"3.0.0\".",
			forbiddenIsAttributeWithVuePrefix: "`is=\"vue:\"` are not supported until Vue.js \"3.1.0\".",
			forbiddenVMemo: "`v-memo` are not supported until Vue.js \"3.2.0\".",
			forbiddenVBindPropModifierShorthand: "`.prop` shorthand are not supported until Vue.js \"3.2.0\".",
			forbiddenVBindAttrModifier: "`.attr` modifiers on `v-bind` are not supported until Vue.js \"3.2.0\".",
			forbiddenDefineOptions: "`defineOptions()` macros are not supported until Vue.js \"3.3.0\".",
			forbiddenDefineSlots: "`defineSlots()` macros are not supported until Vue.js \"3.3.0\".",
			forbiddenDefineModel: "`defineModel()` macros are not supported until Vue.js \"3.4.0\".",
			forbiddenVBindSameNameShorthand: "`v-bind` same-name shorthand is not supported until Vue.js \"3.4.0\"."
		}
	},
	create(context) {
		const { version, ignores } = Object.assign({
			version: null,
			ignores: []
		}, context.options[0] || {});
		if (!version) return {};
		const versionRange = getSemverRange(version);
		/**
		* Check whether a given case object is full-supported on the configured node version.
		*/
		function isNotSupportingVersion(aCase) {
			return !semver.default.subset(versionRange, getSemverRange(aCase.supported));
		}
		let templateBodyVisitor = {};
		let scriptVisitor = {};
		for (const syntaxName of SYNTAX_NAMES) {
			const syntax = FEATURES[syntaxName];
			if (ignores.includes(syntaxName) || !isNotSupportingVersion(syntax)) continue;
			if (syntax.createTemplateBodyVisitor) {
				const visitor = syntax.createTemplateBodyVisitor(context);
				templateBodyVisitor = import_utils.default.compositingVisitors(templateBodyVisitor, visitor);
			}
			if (syntax.createScriptVisitor) {
				const visitor = syntax.createScriptVisitor(context);
				scriptVisitor = import_utils.default.compositingVisitors(scriptVisitor, visitor);
			}
		}
		return import_utils.default.defineTemplateBodyVisitor(context, templateBodyVisitor, scriptVisitor);
	}
};
//#endregion
exports.default = no_unsupported_features_default;
w#ax:+//#region lib/rules/no-unused-components.tsTvar no_unusedf[registering components that are not used inside templates",
			categories: ["vue3-essential", "vue2-essential"],
			url: "https	used6	_$WhenBindingPresent: { type: "boolean	9H unused: "The \"{{name}}\" component has been registered but not used." 
!options = context.options[0] || {};
		const ignoreWhenBindingPresent = options.ignoreWhenBindingPresent === void 0 ? true : opt4ions.ignoreWhenBindingPresent;
		const usedComponent![let registeredComponents = [];
		let shouldIgnoreReporting = false;
		let templateLocation;Bb0node.#node.<node.usedComponents.add(node.rawName"OusedComponents.add(@L.value);
				else if (ignoreWhenBindingPresent) shouldIgnoreReporting = trueusedComponents.add(value);
			},
			"VElement[name='template']"(node) {
				templateLocation ||= node.loc.start;
			},
			"VElekment[name='template']:exit"(node) {
				if (node.loc.start !== templateLocation || shouldIgnoreReporting ||ehasAttribute(node, "src")) return;
				for (const { node, name } of registeredComponents) {
					if (.name) || require_casing.isCamelCase(name)) {
						if ([...usedComponents].some((n) => !n.includes("_") && (name === require_camn) || name === require_casing.camelCase(n)))) continue;
					} else if (usedComponents.has(name)) continue;
	aO	node,
						messageId: "unused",
						data: { name }
					});
				}
			}
		},z$registeredComponents =;
		})5-used_components_default;
﹘x!v"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-unused-emit-declarations.js
/**
* @author ItMaga
* See LICENSE file in root directory for full license.
*/
var require_no_unused_emit_declarations = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { findVariable } = require("@eslint-community/eslint-utils");
	const utils = require_index.default;
	/**
	* @typedef {import('../utils').ComponentEmit} ComponentEmit
	* @typedef {import('../utils').VueObjectData} VueObjectData
	*/
	/**
	* @typedef {object} SetupContext
	* @property {Set<Identifier>} contextReferenceIds
	* @property {Set<Identifier>} emitReferenceIds
	*/
	/**
	* @typedef {object} NameWithLoc
	* @property {string} name
	* @property {SourceLocation} loc
	* @property {Range} range
	*/
	/**
	* Get the name param node from the given CallExpression
	* @param {CallExpression} node CallExpression
	* @returns {NameWithLoc | null}
	*/
	function getNameParamNode(node) {
		const nameLiteralNode = node.arguments[0];
		if (nameLiteralNode && utils.isStringLiteral(nameLiteralNode)) {
			const name = utils.getStringLiteralValue(nameLiteralNode);
			if (name != null) return {
				name,
				loc: nameLiteralNode.loc,
				range: nameLiteralNode.range
			};
		}
		return null;
	}
	/**
	* Check if the given node is a reference of setup context
	* @param {Expression | Super | SpreadElement} value
	* @param {SetupContext} setupContext
	* @returns {boolean}
	* */
	function hasReferenceId(value, setupContext) {
		const { contextReferenceIds, emitReferenceIds } = setupContext;
		return value.type === "Identifier" && (emitReferenceIds.has(value) || contextReferenceIds.has(value));
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow unused emit declarations",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/no-unused-emit-declarations.html"
			},
			fixable: null,
			schema: [],
			messages: { unused: "`{{name}}` is defined as emit but never used." }
		},
		/** @param {RuleContext} context */
		create(context) {
			/** @type {Map<string, ComponentEmit>} */
			const emitDeclarations = /* @__PURE__ */ new Map();
			/** @type {Map<string, Expression>} */
			const emitCalls = /* @__PURE__ */ new Map();
			/** @type {Map<ObjectExpression | Program, SetupContext>} */
			const setupContexts = /* @__PURE__ */ new Map();
			const programNode = context.sourceCode.ast;
			let emitParamName = "";
			/**
			* @param {CallExpression} node
			* */
			function addEmitCall(node) {
				const nameParamNode = getNameParamNode(node);
				if (nameParamNode) emitCalls.set(nameParamNode.name, node);
			}
			function clearEmits() {
				emitCalls.clear();
				emitDeclarations.clear();
			}
			/**
			* @param {Expression | SpreadElement} expression
			* @param {SetupContext} setupContext
			* @returns {boolean}
			* */
			function checkExpressionReference(expression, setupContext) {
				if (expression.type === "MemberExpression") {
					if (hasReferenceId(utils.skipChainExpression(expression.object), setupContext)) {
						clearEmits();
						return true;
					}
				}
				if (hasReferenceId(expression, setupContext)) {
					clearEmits();
					return true;
				}
				return false;
			}
			/**
			*
			* @param {Array<Expression | SpreadElement>} args
			* @param {SetupContext} setupContext
			* @returns {boolean}
			*/
			function verifyArgumentsReferences(args, setupContext) {
				for (const argument of args) {
					if (argument.type === "ObjectExpression") {
						for (const property of argument.properties) if (property.type === "Property" && checkExpressionReference(property.value, setupContext)) return true;
					} else if (argument.type === "ArrayExpression" && argument.elements.some((element) => element && checkExpressionReference(element, setupContext))) return true;
					if (checkExpressionReference(argument, setupContext)) return true;
				}
				return false;
			}
			/**
			* @param {Expression | Super} callee
			* @param {Set<Identifier>} referenceIds
			* @param {CallExpression} node
			* */
			function addEmitCallByReference(callee, referenceIds, node) {
				if (callee.type === "Identifier" && referenceIds.has(callee)) addEmitCall(node);
			}
			const callVisitor = { 
			/**
			* @param {CallExpression} node
			* @param {VueObjectData} [info]
			*/
CallExpression(node, info) {
				const callee = utils.skipChainExpression(node.callee);
				let emit = null;
				if (callee.type === "MemberExpression") {
					const name = utils.getStaticPropertyName(callee);
					if (name === "emit" || name === "$emit") emit = {
						name,
						member: callee
					};
				}
				const vueDefineNode = info ? info.node : programNode;
				const setupContext = setupContexts.get(vueDefineNode);
				if (setupContext) {
					if (callee.parent.type === "CallExpression" && callee.parent.arguments && verifyArgumentsReferences(callee.parent.arguments, setupContext)) return;
					const { contextReferenceIds, emitReferenceIds } = setupContext;
					addEmitCallByReference(callee, emitReferenceIds, node);
					if (emit && emit.name === "emit") addEmitCallByReference(utils.skipChainExpression(emit.member.object), contextReferenceIds, node);
				}
				if (emit && emit.name === "$emit") {
					const memObject = utils.skipChainExpression(emit.member.object);
					if (utils.isThis(memObject, context)) addEmitCall(node);
				}
				if (callee.type === "Identifier" && (callee.name === "$emit" || callee.name === emitParamName)) addEmitCall(node);
			} };
			return utils.compositingVisitors(utils.defineTemplateBodyVisitor(context, callVisitor), utils.defineVueVisitor(context, {
				...callVisitor,
				onVueObjectEnter(node) {
					for (const emit of utils.getComponentEmitsFromOptions(node)) if (emit.emitName) emitDeclarations.set(emit.emitName, emit);
				},
				onSetupFunctionEnter(node, { node: vueNode }) {
					const contextParam = node.params[1];
					if (!contextParam || contextParam.type === "RestElement" || contextParam.type === "ArrayPattern") return;
					/** @type {Set<Identifier>} */
					const contextReferenceIds = /* @__PURE__ */ new Set();
					/** @type {Set<Identifier>} */
					const emitReferenceIds = /* @__PURE__ */ new Set();
					if (contextParam.type === "ObjectPattern") {
						const emitProperty = utils.findAssignmentProperty(contextParam, "emit");
						if (!emitProperty) return;
						const emitParam = emitProperty.value;
						const variable = emitParam.type === "Identifier" ? findVariable(utils.getScope(context, emitParam), emitParam) : null;
						if (!variable) return;
						for (const reference of variable.references) emitReferenceIds.add(reference.identifier);
					} else if (contextParam.type === "Identifier") {
						const variable = findVariable(utils.getScope(context, contextParam), contextParam);
						for (const reference of variable.references) contextReferenceIds.add(reference.identifier);
					}
					setupContexts.set(vueNode, {
						contextReferenceIds,
						emitReferenceIds
					});
				}
			}), utils.defineScriptSetupVisitor(context, {
				onDefineEmitsEnter(node, emits) {
					for (const emit of emits) if (emit.emitName) emitDeclarations.set(emit.emitName, emit);
					if (!node.parent || node.parent.type !== "VariableDeclarator" || node.parent.init !== node) return;
					const emitParam = node.parent.id;
					if (emitParam.type !== "Identifier") return;
					emitParamName = emitParam.name;
					const variable = findVariable(utils.getScope(context, emitParam), emitParam);
					if (!variable) return;
					/** @type {Set<Identifier>} */
					const emitReferenceIds = /* @__PURE__ */ new Set();
					for (const reference of variable.references) emitReferenceIds.add(reference.identifier);
					setupContexts.set(programNode, {
						contextReferenceIds: /* @__PURE__ */ new Set(),
						emitReferenceIds
					});
				},
				onDefineModelEnter(node, model) {
					if (node.parent && node.parent.type === "VariableDeclarator" && node.parent.init === node) emitCalls.set(`update:${model.name.modelName}`, node);
				},
				...callVisitor
			}), { "Program:exit"() {
				for (const [name, emit] of emitDeclarations) if (!emitCalls.has(name) && emit.node) context.report({
					node: emit.node,
					loc: emit.node.loc,
					messageId: "unused",
					data: { name }
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_unused_emit_declarations();
	}
});
xU"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-unused-refs.js
/**
* @fileoverview Disallow unused refs.
* @author Yosuke Ota
*/
var require_no_unused_refs = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* Extract names from references objects.
	* @param {VReference[]} references
	*/
	function getReferences(references) {
		return references.filter((ref) => ref.variable == null).map((ref) => ref.id);
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow unused refs",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/no-unused-refs.html"
			},
			fixable: null,
			schema: [],
			messages: { unused: "'{{name}}' is defined as ref, but never used." }
		},
		/** @param {RuleContext} context */
		create(context) {
			/** @type {Set<string>} */
			const usedRefs = /* @__PURE__ */ new Set();
			/** @type {VLiteral[]} */
			const defineRefs = [];
			let hasUnknown = false;
			/**
			* Report all unused refs.
			*/
			function reportUnusedRefs() {
				for (const defineRef of defineRefs) {
					if (usedRefs.has(defineRef.value)) continue;
					context.report({
						node: defineRef,
						messageId: "unused",
						data: { name: defineRef.value }
					});
				}
			}
			/**
			* Extract the use ref names for ObjectPattern.
			* @param {ObjectPattern} node
			* @returns {void}
			*/
			function extractUsedForObjectPattern(node) {
				for (const prop of node.properties) if (prop.type === "Property") {
					const name = utils.getStaticPropertyName(prop);
					if (name) usedRefs.add(name);
					else {
						hasUnknown = true;
						return;
					}
				} else {
					hasUnknown = true;
					return;
				}
			}
			/**
			* Extract the use ref names.
			* @param {Identifier | MemberExpression} refsNode
			* @returns {void}
			*/
			function extractUsedForPattern(refsNode) {
				/** @type {Identifier | MemberExpression | ChainExpression} */
				let node = refsNode;
				while (node.parent.type === "ChainExpression") node = node.parent;
				const parent = node.parent;
				switch (parent.type) {
					case "AssignmentExpression":
						if (parent.right === node) {
							if (parent.left.type === "ObjectPattern") extractUsedForObjectPattern(parent.left);
							else if (parent.left.type === "Identifier") hasUnknown = true;
						}
						break;
					case "VariableDeclarator":
						if (parent.init === node) {
							if (parent.id.type === "ObjectPattern") extractUsedForObjectPattern(parent.id);
							else if (parent.id.type === "Identifier") hasUnknown = true;
						}
						break;
					case "MemberExpression":
						if (parent.object === node) {
							const name = utils.getStaticPropertyName(parent);
							if (name) usedRefs.add(name);
							else hasUnknown = true;
						}
						break;
					case "CallExpression":
						if (parent.arguments.indexOf(node) !== -1) hasUnknown = true;
						break;
					case "ForInStatement":
					case "ReturnStatement":
						hasUnknown = true;
						break;
				}
			}
			return utils.defineTemplateBodyVisitor(context, {
				/**
				* @param {VExpressionContainer} node
				*/
				VExpressionContainer(node) {
					if (hasUnknown) return;
					for (const id of getReferences(node.references)) {
						if (id.name !== "$refs") continue;
						extractUsedForPattern(id);
					}
				},
				/**
				* @param {VAttribute} node
				*/
				"VAttribute[directive=false]"(node) {
					if (hasUnknown) return;
					if (node.key.name === "ref" && node.value != null) defineRefs.push(node.value);
				},
				"VElement[parent.type!='VElement']:exit"() {
					if (hasUnknown) return;
					reportUnusedRefs();
				}
			}, utils.compositingVisitors(utils.isScriptSetup(context) ? { Program() {
				const globalScope = context.sourceCode.scopeManager.globalScope;
				if (!globalScope) return;
				for (const variable of globalScope.variables) if (variable.defs.length > 0) usedRefs.add(variable.name);
				const moduleScope = globalScope.childScopes.find((scope) => scope.type === "module");
				if (!moduleScope) return;
				for (const variable of moduleScope.variables) if (variable.defs.length > 0) usedRefs.add(variable.name);
			} } : {}, utils.defineVueVisitor(context, { onVueObjectEnter(node) {
				const setupProperties = utils.iterateProperties(node, /* @__PURE__ */ new Set(["setup"]));
				for (const prop of setupProperties) usedRefs.add(prop.name);
			} }), {
				Identifier(id) {
					if (hasUnknown) return;
					if (id.name !== "$refs") return;
					extractUsedForPattern(id.parent.type === "MemberExpression" && id.parent.property === id ? id.parent : id);
				},
				CallExpression(callExpression) {
					const firstArgument = callExpression.arguments[0];
					if (callExpression.callee.type !== "Identifier" || callExpression.callee.name !== "useTemplateRef" || !firstArgument || !utils.isStringLiteral(firstArgument)) return;
					const name = utils.getStringLiteralValue(firstArgument);
					if (name !== null) usedRefs.add(name);
				}
			}));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_unused_refs();
	}
});
Tnմxd"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-unused-vars.js
/**
* @fileoverview disallow unused variable definitions of v-for directives or scope attributes.
* @author 薛定谔的猫<hh_2013@foxmail.com>
*/
var require_no_unused_vars = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef {VVariable['kind']} VariableKind
	*/
	/**
	* Groups variables by directive kind.
	* @param {VElement} node The element node
	* @returns { { [kind in VariableKind]?: VVariable[] } } The variables of grouped by directive kind.
	*/
	function groupingVariables(node) {
		/** @type { { [kind in VariableKind]?: VVariable[] } } */
		const result = {};
		for (const variable of node.variables) {
			const kind = variable.kind;
			result[kind] ||= [];
			result[kind].push(variable);
		}
		return result;
	}
	/**
	* Checks if the given variable was defined by destructuring.
	* @param {VVariable} variable the given variable to check
	* @returns {boolean} `true` if the given variable was defined by destructuring.
	*/
	function isDestructuringVar(variable) {
		/** @type {ASTNode | null} */
		let parent = variable.id.parent;
		while (parent) {
			if (parent.type === "VForExpression" || parent.type === "VSlotScopeExpression") return false;
			if (parent.type === "Property" || parent.type === "ArrayPattern") return true;
			parent = parent.parent;
		}
		return false;
	}
	/**
	* Checks if the given variable name is used as a component tag in the element's descendants.
	* @param {string} variableName the variable name to check
	* @param {VElement} element the element node to search within
	* @returns {boolean} `true` if the variable name is used as a component tag.
	*/
	function isUsedAsComponentTag(variableName, element) {
		for (const child of element.children) {
			if (child.type !== "VElement") continue;
			if (child.rawName === variableName) return true;
			if (isUsedAsComponentTag(variableName, child)) return true;
		}
		return false;
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow unused variable definitions of v-for directives or scope attributes",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/no-unused-vars.html"
			},
			fixable: null,
			hasSuggestions: true,
			schema: [{
				type: "object",
				properties: { ignorePattern: { type: "string" } },
				additionalProperties: false
			}],
			messages: {
				unusedVariable: "'{{name}}' is defined but never used.",
				replaceWithUnderscore: "Replace `{{name}}` with `_{{name}}` to ignore the unused variable."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const ignorePattern = (context.options[0] || {}).ignorePattern;
			/** @type {RegExp | null} */
			const ignoreRegEx = ignorePattern ? new RegExp(ignorePattern, "u") : null;
			/**
			* @param {VVariable[]} variables the variables of a single directive kind
			* @param {VElement} node the element node the variables belong to
			*/
			function checkVariableGroup(variables, node) {
				let hasAfterUsed = false;
				for (let i = variables.length - 1; i >= 0; i--) {
					const variable = variables[i];
					if (variable.references.length > 0) {
						hasAfterUsed = true;
						continue;
					}
					if (ignoreRegEx != null && ignoreRegEx.test(variable.id.name)) continue;
					if (hasAfterUsed && !isDestructuringVar(variable)) continue;
					if (isUsedAsComponentTag(variable.id.name, node)) continue;
					context.report({
						node: variable.id,
						loc: variable.id.loc,
						messageId: "unusedVariable",
						data: { name: variable.id.name },
						suggest: ignorePattern === "^_" ? [{
							messageId: "replaceWithUnderscore",
							data: { name: variable.id.name },
							fix(fixer) {
								return fixer.replaceText(variable.id, `_${variable.id.name}`);
							}
						}] : []
					});
				}
			}
			return utils.defineTemplateBodyVisitor(context, { 
			/**
			* @param {VElement} node
			*/
VElement(node) {
				const vars = groupingVariables(node);
				for (const variables of Object.values(vars)) if (variables) checkVariableGroup(variables, node);
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_unused_vars();
	}
});
孕x:*"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-use-computed-property-like-method.js
/**
* @author tyankatsu <https://github.com/tyankatsu0105>
* See LICENSE file in root directory for full license.
*/
var require_no_use_computed_property_like_method = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const eslintUtils = require("@eslint-community/eslint-utils");
	const utils = require_index.default;
	/**
	* @typedef {import('eslint').Scope.Scope} Scope
	* @typedef {import('../utils').ComponentObjectPropertyData} ComponentObjectPropertyData
	* @typedef {import('../utils').GroupName} GroupName
	*/
	/**
	* @typedef {object} CallMember
	* @property {string} name
	* @property {CallExpression} node
	*/
	/** @type {Set<GroupName>} */
	const GROUPS = /* @__PURE__ */ new Set([
		"data",
		"props",
		"computed",
		"methods"
	]);
	const NATIVE_NOT_FUNCTION_TYPES = /* @__PURE__ */ new Set([
		"String",
		"Number",
		"BigInt",
		"Boolean",
		"Object",
		"Array",
		"Symbol"
	]);
	/**
	* @param {RuleContext} context
	* @param {Expression} node
	* @returns {Set<Expression>}
	*/
	function resolvedExpressions(context, node) {
		/** @type {Map<Expression, Set<Expression>>} */
		const resolvedMap = /* @__PURE__ */ new Map();
		return resolvedExpressionsInternal(node);
		/**
		* @param {Expression} node
		* @returns {Set<Expression>}
		*/
		function resolvedExpressionsInternal(node) {
			let resolvedSet = resolvedMap.get(node);
			if (!resolvedSet) {
				resolvedSet = /* @__PURE__ */ new Set();
				resolvedMap.set(node, resolvedSet);
				for (const e of extractResolvedExpressions(node)) resolvedSet.add(e);
			}
			if (resolvedSet.size === 0) resolvedSet.add(node);
			return resolvedSet;
		}
		/**
		* @param {Expression} node
		* @returns {Iterable<Expression>}
		*/
		function* extractResolvedExpressions(node) {
			switch (node.type) {
				case "Identifier": {
					const variable = utils.findVariableByIdentifier(context, node);
					if (variable) for (const ref of variable.references) {
						const id = ref.identifier;
						if (id.parent.type === "VariableDeclarator") {
							if (id.parent.id === id && id.parent.init) yield* resolvedExpressionsInternal(id.parent.init);
						} else if (id.parent.type === "AssignmentExpression" && id.parent.left === id) yield* resolvedExpressionsInternal(id.parent.right);
					}
					break;
				}
				case "ConditionalExpression":
					yield* resolvedExpressionsInternal(node.consequent);
					yield* resolvedExpressionsInternal(node.alternate);
					break;
				case "LogicalExpression":
					yield* resolvedExpressionsInternal(node.left);
					yield* resolvedExpressionsInternal(node.right);
					break;
			}
		}
	}
	/**
	* Get type of props item.
	* Can't consider array props like: props: {propsA: [String, Number, Function]}
	* @param {RuleContext} context
	* @param {ComponentObjectPropertyData} prop
	* @return {string[] | null}
	*
	* @example
	* props: {
	*   propA: String, // => String
	*   propB: {
	*     type: Number // => Number
	*   },
	* }
	*/
	function getComponentPropsTypes(context, prop) {
		const result = [];
		for (const expr of resolvedExpressions(context, prop.property.value)) {
			const types = getComponentPropsTypesFromExpression(expr);
			if (types == null) return null;
			result.push(...types);
		}
		return result;
		/**
		* @param {Expression} expr
		*/
		function getComponentPropsTypesFromExpression(expr) {
			let typeExprs;
			/**
			* Check object props `props: { objectProps: {...} }`
			*/
			if (expr.type === "ObjectExpression") {
				const type = utils.findProperty(expr, "type");
				if (type == null) return null;
				typeExprs = resolvedExpressions(context, type.value);
			} else typeExprs = [expr];
			const result = [];
			for (const typeExpr of typeExprs) {
				const types = getComponentPropsTypesFromTypeExpression(typeExpr);
				if (types == null) return null;
				result.push(...types);
			}
			return result;
		}
		/**
		* @param {Expression} typeExpr
		*/
		function getComponentPropsTypesFromTypeExpression(typeExpr) {
			if (typeExpr.type === "Identifier") return [typeExpr.name];
			if (typeExpr.type === "ArrayExpression") {
				const types = [];
				for (const element of typeExpr.elements) {
					if (!element) continue;
					if (element.type === "SpreadElement") return null;
					for (const elementExpr of resolvedExpressions(context, element)) {
						if (elementExpr.type !== "Identifier") return null;
						types.push(elementExpr.name);
					}
				}
				return types;
			}
			return null;
		}
	}
	/** Expression types that can never resolve to a function. */
	const NON_FUNCTION_EXPRESSION_TYPES = /* @__PURE__ */ new Set([
		"ObjectExpression",
		"ArrayExpression",
		"Literal",
		"TemplateLiteral",
		"BinaryExpression",
		"UnaryExpression",
		"UpdateExpression"
	]);
	/**
	* Check whether given expression may be a function.
	* @param {RuleContext} context
	* @param {Expression} node
	* @returns {boolean}
	*/
	function maybeFunction(context, node) {
		for (const expr of resolvedExpressions(context, node)) {
			if (NON_FUNCTION_EXPRESSION_TYPES.has(expr.type)) continue;
			if (expr.type === "ConditionalExpression" && !maybeFunction(context, expr.consequent) && !maybeFunction(context, expr.alternate)) continue;
			const evaluated = eslintUtils.getStaticValue(expr, utils.getScope(context, expr));
			if (!evaluated) return true;
			if (typeof evaluated.value === "function") return true;
		}
		return false;
	}
	var FunctionData = class {
		/**
		* @param {string} name
		* @param {'methods' | 'computed'} kind
		* @param {FunctionExpression | ArrowFunctionExpression} node
		* @param {RuleContext} context
		*/
		constructor(name, kind, node, context) {
			this.context = context;
			this.name = name;
			this.kind = kind;
			this.node = node;
			/** @type {(Expression | null)[]} */
			this.returnValues = [];
			/** @type {boolean | null} */
			this.cacheMaybeReturnFunction = null;
		}
		/**
		* @param {Expression | null} node
		*/
		addReturnValue(node) {
			this.returnValues.push(node);
		}
		/**
		* @param {ComponentStack} component
		*/
		maybeReturnFunction(component) {
			if (this.cacheMaybeReturnFunction != null) return this.cacheMaybeReturnFunction;
			this.cacheMaybeReturnFunction = true;
			return this.cacheMaybeReturnFunction = this.returnValues.some((returnValue) => returnValue && component.maybeFunctionExpression(returnValue));
		}
	};
	/** Component information class. */
	var ComponentStack = class {
		/**
		* @param {ObjectExpression} node
		* @param {RuleContext} context
		* @param {ComponentStack | null} upper
		*/
		constructor(node, context, upper) {
			this.node = node;
			this.context = context;
			/** Upper scope component */
			this.upper = upper;
			/** @type {Map<string, boolean>} */
			const maybeFunctions = /* @__PURE__ */ new Map();
			/** @type {FunctionData[]} */
			const functions = [];
			/** @param {ComponentObjectPropertyData} property */
			function collectProperty(property) {
				switch (property.groupName) {
					case "data":
						maybeFunctions.set(property.name, maybeFunction(context, property.property.value));
						break;
					case "props": {
						const types = getComponentPropsTypes(context, property);
						maybeFunctions.set(property.name, !types || types.some((type) => !NATIVE_NOT_FUNCTION_TYPES.has(type)));
						break;
					}
					case "computed": {
						let value = property.property.value;
						if (value.type === "ObjectExpression") {
							const getProp = utils.findProperty(value, "get");
							if (getProp) value = getProp.value;
						}
						processFunction(property.name, value, "computed");
						break;
					}
					case "methods": {
						const value = property.property.value;
						processFunction(property.name, value, "methods");
						maybeFunctions.set(property.name, true);
						break;
					}
				}
			}
			for (const property of utils.iterateProperties(node, GROUPS)) if (property.type !== "array") collectProperty(property);
			this.maybeFunctions = maybeFunctions;
			this.functions = functions;
			/** @type {CallMember[]} */
			this.callMembers = [];
			/** @type {Map<Expression, boolean>} */
			this.cacheMaybeFunctionExpressions = /* @__PURE__ */ new Map();
			/**
			* @param {string} name
			* @param {Expression} value
			* @param {'methods' | 'computed'} kind
			*/
			function processFunction(name, value, kind) {
				if (value.type === "FunctionExpression") functions.push(new FunctionData(name, kind, value, context));
				else if (value.type === "ArrowFunctionExpression") {
					const data = new FunctionData(name, kind, value, context);
					if (value.expression) data.addReturnValue(value.body);
					functions.push(data);
				}
			}
		}
		/**
		* Adds the given return statement to the return value of the function.
		* @param {FunctionExpression | ArrowFunctionExpression | FunctionDeclaration} scopeFunction
		* @param {ReturnStatement} returnNode
		*/
		addReturnStatement(scopeFunction, returnNode) {
			for (const data of this.functions) if (data.node === scopeFunction) {
				data.addReturnValue(returnNode.argument);
				break;
			}
		}
		verifyComponent() {
			for (const call of this.callMembers) this.verifyCallMember(call);
		}
		/**
		* @param {CallMember} call
		*/
		verifyCallMember(call) {
			const fnData = this.functions.find((data) => data.name === call.name && data.kind === "computed");
			if (!fnData) return;
			if (!fnData.maybeReturnFunction(this)) {
				const prefix = call.node.callee.type === "MemberExpression" ? "this." : "";
				this.context.report({
					node: call.node,
					messageId: "unexpected",
					data: {
						likeProperty: `${prefix}${call.name}`,
						likeMethod: `${prefix}${call.name}()`
					}
				});
			}
		}
		/**
		* Check whether given expression may be a function.
		* @param {Expression} node
		* @returns {boolean}
		*/
		maybeFunctionExpression(node) {
			const cache = this.cacheMaybeFunctionExpressions.get(node);
			if (cache != null) return cache;
			this.cacheMaybeFunctionExpressions.set(node, true);
			const result = maybeFunctionExpressionWithoutCache.call(this);
			this.cacheMaybeFunctionExpressions.set(node, result);
			return result;
			/**
			* @this {ComponentStack}
			*/
			function maybeFunctionExpressionWithoutCache() {
				for (const expr of resolvedExpressions(this.context, node)) {
					if (!maybeFunction(this.context, expr)) continue;
					if (this.expressionCouldBeFunction(expr)) return true;
				}
				return false;
			}
		}
		/**
		* Check whether the given expression could be a function.
		* @param {Expression} expr
		* @returns {boolean}
		*/
		expressionCouldBeFunction(expr) {
			switch (expr.type) {
				case "MemberExpression":
					if (utils.isThis(expr.object, this.context)) {
						const name = utils.getStaticPropertyName(expr);
						if (name && !this.maybeFunctionProperty(name)) return false;
					}
					return true;
				case "CallExpression":
					if (expr.callee.type === "MemberExpression" && utils.isThis(expr.callee.object, this.context)) {
						const name = utils.getStaticPropertyName(expr.callee);
						const fnData = this.functions.find((data) => data.name === name);
						if (fnData && fnData.kind === "methods" && !fnData.maybeReturnFunction(this)) return false;
					}
					return true;
				case "ConditionalExpression": return this.maybeFunctionExpression(expr.consequent) || this.maybeFunctionExpression(expr.alternate);
				default: return true;
			}
		}
		/**
		* Check whether given property name may be a function.
		* @param {string} name
		* @returns {boolean}
		*/
		maybeFunctionProperty(name) {
			const cache = this.maybeFunctions.get(name);
			if (cache != null) return cache;
			this.maybeFunctions.set(name, true);
			const result = maybeFunctionPropertyWithoutCache.call(this);
			this.maybeFunctions.set(name, result);
			return result;
			/**
			* @this {ComponentStack}
			*/
			function maybeFunctionPropertyWithoutCache() {
				const fnData = this.functions.find((data) => data.name === name);
				if (fnData && fnData.kind === "computed") return fnData.maybeReturnFunction(this);
				return true;
			}
		}
	};
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow use computed property like method",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/no-use-computed-property-like-method.html"
			},
			fixable: null,
			schema: [],
			messages: { unexpected: "Use {{ likeProperty }} instead of {{ likeMethod }}." }
		},
		/** @param {RuleContext} context */
		create(context) {
			/**
			* @typedef {object} ScopeStack
			* @property {ScopeStack | null} upper
			* @property {FunctionDeclaration | FunctionExpression | ArrowFunctionExpression} scopeNode
			*/
			/** @type {ScopeStack | null} */
			let scopeStack = null;
			/** @type {ComponentStack | null} */
			let componentStack = null;
			/** @type {ComponentStack | null} */
			let templateComponent = null;
			return utils.compositingVisitors({}, utils.defineVueVisitor(context, {
				onVueObjectEnter(node) {
					componentStack = new ComponentStack(node, context, componentStack);
					if (!templateComponent && utils.isInExportDefault(node)) templateComponent = componentStack;
				},
				onVueObjectExit() {
					if (!componentStack) return;
					componentStack.verifyComponent();
					componentStack = componentStack.upper;
				},
				/**
				* @param {FunctionExpression | FunctionDeclaration | ArrowFunctionExpression} node
				*/
				":function"(node) {
					scopeStack = {
						upper: scopeStack,
						scopeNode: node
					};
				},
				ReturnStatement(node) {
					if (scopeStack && componentStack) componentStack.addReturnStatement(scopeStack.scopeNode, node);
				},
				":function:exit"() {
					scopeStack &&= scopeStack.upper;
				},
				/**
				* @param {ThisExpression | Identifier} node
				*/
				"ThisExpression, Identifier"(node) {
					if (!componentStack || node.parent.type !== "MemberExpression" || node.parent.object !== node || node.parent.parent.type !== "CallExpression" || node.parent.parent.callee !== node.parent || !utils.isThis(node, context)) return;
					const name = utils.getStaticPropertyName(node.parent);
					if (name) componentStack.callMembers.push({
						name,
						node: node.parent.parent
					});
				}
			}), utils.defineTemplateBodyVisitor(context, { 
			/**
			* @param {VExpressionContainer} node
			*/
VExpressionContainer(node) {
				if (!templateComponent) return;
				for (const ref of node.references) {
					if (ref.variable != null) continue;
					const id = ref.id;
					if (id.parent.type !== "CallExpression" || id.parent.callee !== id) continue;
					templateComponent.verifyCallMember({
						name: id.name,
						node: id.parent
					});
				}
			} }));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_use_computed_property_like_method();
	}
});
̷xH"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-use-v-if-with-v-for.js
/**
* @author Yosuke Ota
*
* Style guide: https://vuejs.org/style-guide/rules-essential.html#avoid-v-if-with-v-for
*/
var require_no_use_v_if_with_v_for = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* Check whether the given `v-if` node is using the variable which is defined by the `v-for` directive.
	* @param {VDirective} vIf The `v-if` attribute node to check.
	* @returns {boolean} `true` if the `v-if` is using the variable which is defined by the `v-for` directive.
	*/
	function isUsingIterationVar(vIf) {
		return !!getVForUsingIterationVar(vIf);
	}
	/** @param {VDirective} vIf */
	function getVForUsingIterationVar(vIf) {
		if (!vIf.value) return null;
		const element = vIf.parent.parent;
		for (const reference of vIf.value.references) {
			const targetVFor = element.variables.find((variable) => variable.id.name === reference.id.name && variable.kind === "v-for");
			if (targetVFor) return targetVFor;
		}
		return null;
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow using `v-if` on the same element as `v-for`",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/no-use-v-if-with-v-for.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: { allowUsingIterationVar: { type: "boolean" } },
				additionalProperties: false
			}],
			messages: {
				movedToWrapper: "This 'v-if' should be moved to the wrapper element.",
				shouldUseComputed: "The '{{iteratorName}}' {{kind}} inside 'v-for' directive should be replaced with a computed property that returns filtered array instead. You should not mix 'v-for' with 'v-if'."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const shouldAllowUsingIterationVar = (context.options[0] || {}).allowUsingIterationVar === true;
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VDirective} node */
"VAttribute[directive=true][key.name.name='if']"(node) {
				const element = node.parent.parent;
				if (utils.hasDirective(element, "for")) if (isUsingIterationVar(node)) {
					if (!shouldAllowUsingIterationVar) {
						const vForVar = getVForUsingIterationVar(node);
						if (!vForVar) return;
						let targetVForExpr = vForVar.id.parent;
						while (targetVForExpr.type !== "VForExpression") targetVForExpr = targetVForExpr.parent;
						const iteratorNode = targetVForExpr.right;
						context.report({
							node,
							loc: node.loc,
							messageId: "shouldUseComputed",
							data: {
								iteratorName: iteratorNode.type === "Identifier" ? iteratorNode.name : context.sourceCode.getText(iteratorNode),
								kind: iteratorNode.type === "Identifier" ? "variable" : "expression"
							}
						});
					}
				} else context.report({
					node,
					loc: node.loc,
					messageId: "movedToWrapper"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_use_v_if_with_v_for();
	}
});
H)r+ExH,else-with-v-for.js
var require_no_use_v_elseB[{ +), hasDirective } = require_index.default;eelse-if`/`v-else3nulld4else6],
			messages: { unexpectedDirectiveWithVFor: "Unexpected `{{ directiveName }}` and `v-for` on the same element. Move `{{ dire-ctiveName }}` to a wrapper element instead." vDreturn +tfor<hasDirective(element, "else-if")) context.report({
					node: element,
					messageId: "unexpectedDirectiveWithVFor",
					data: { directiveName: "v-else-if" }
				});
				else if (hasDirective(element, "else")) context.report({
					node: element,
					PmessageId: "unexpectedDirectiveWithVFor",
					data: { directiveName: "v-else" }else迲$xB"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-useless-concat.js
/**
* @author Yosuke Ota
*/
var require_no_useless_concat = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapCoreRule } = require_index.default;
	module.exports = wrapCoreRule("no-useless-concat", { applyDocument: true });
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_useless_concat();
	}
});
ȥx3"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-useless-mustaches.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_no_useless_mustaches = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* Strip quotes string
	* @param {string} text
	* @returns {string|null}
	*/
	function stripQuotesForHTML(text) {
		if ([
			"\"",
			"'",
			"`"
		].includes(text[0]) && text[0] === text.at(-1)) return text.slice(1, -1);
		const re = /^(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])([\s\S]*)(?:&(?:quot|apos|#\d+|#x[\da-f]+);|["'`])$/u.exec(text);
		if (!re) return null;
		return re[1];
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow unnecessary mustache interpolations",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/no-useless-mustaches.html"
			},
			fixable: "code",
			schema: [{
				type: "object",
				properties: {
					ignoreIncludesComment: { type: "boolean" },
					ignoreStringEscape: { type: "boolean" }
				},
				additionalProperties: false
			}],
			messages: { unexpected: "Unexpected mustache interpolation with a string literal value." }
		},
		/** @param {RuleContext} context */
		create(context) {
			const opts = context.options[0] || {};
			const ignoreIncludesComment = opts.ignoreIncludesComment;
			const ignoreStringEscape = opts.ignoreStringEscape;
			const sourceCode = context.sourceCode;
			/**
			* Report if the value expression is string literals
			* @param {VExpressionContainer} node the node to check
			*/
			function verify(node) {
				const { expression } = node;
				if (!expression) return;
				/** @type {string} */
				let strValue;
				/** @type {string} */
				let rawValue;
				if (expression.type === "Literal") {
					if (typeof expression.value !== "string") return;
					strValue = expression.value;
					rawValue = sourceCode.getText(expression).slice(1, -1);
				} else if (expression.type === "TemplateLiteral") {
					if (expression.expressions.length > 0) return;
					strValue = expression.quasis[0].value.cooked;
					rawValue = expression.quasis[0].value.raw;
				} else return;
				const hasComment = sourceCode.parserServices.getTemplateBodyTokenStore().getTokens(node, { includeComments: true }).some((t) => t.type === "Block" || t.type === "Line");
				if (ignoreIncludesComment && hasComment) return;
				let hasEscape = false;
				if (rawValue !== strValue) {
					const chars = [...rawValue];
					let c = chars.shift();
					while (c) {
						if (c === "\\") {
							c = chars.shift();
							if (c == null || "nrvtbfux".includes(c)) {
								hasEscape = true;
								break;
							}
						}
						c = chars.shift();
					}
				}
				if (ignoreStringEscape && hasEscape) return;
				context.report({
					node,
					messageId: "unexpected",
					fix(fixer) {
						if (hasComment || hasEscape) return null;
						const text = stripQuotesForHTML(sourceCode.getText(expression));
						if (text == null) return null;
						if (text.includes("\n") || /^\s|\s$/u.test(text)) return null;
						const escaped = text.replaceAll("<", "&lt;");
						return fixer.replaceText(node, escaped.replaceAll(/\\([\S\s])/g, "$1"));
					}
				});
			}
			return utils.defineTemplateBodyVisitor(context, { "VElement > VExpressionContainer": verify });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_useless_mustaches();
	}
});
u/xo	"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-useless-template-attributes.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_no_useless_template_attributes = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const SPECIAL_TEMPLATE_DIRECTIVES = /* @__PURE__ */ new Set([
		"if",
		"else",
		"else-if",
		"for",
		"slot"
	]);
	/**
	* @param {VAttribute | VDirective} attr
	*/
	function getKeyName(attr) {
		if (attr.directive) {
			if (attr.key.name.name !== "bind") return null;
			if (!attr.key.argument || attr.key.argument.type === "VExpressionContainer") return null;
			return attr.key.argument.name;
		}
		return attr.key.name;
	}
	/**
	* @param {VAttribute | VDirective} attr
	*/
	function isFragmentTemplateAttribute(attr) {
		if (attr.directive) {
			const directiveName = attr.key.name.name;
			if (SPECIAL_TEMPLATE_DIRECTIVES.has(directiveName)) return true;
			if (directiveName === "slot-scope") return true;
			if (directiveName === "scope") return true;
		}
		return getKeyName(attr) === "slot";
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow useless attribute on `<template>`",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/no-useless-template-attributes.html"
			},
			fixable: null,
			schema: [],
			messages: {
				unexpectedAttr: "Unexpected useless attribute on `<template>`.",
				unexpectedDir: "Unexpected useless directive on `<template>`."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VStartTag} node */
"VElement[name='template'][parent.type='VElement'] > VStartTag"(node) {
				if (!node.attributes.some(isFragmentTemplateAttribute)) return;
				for (const attr of node.attributes) {
					if (isFragmentTemplateAttribute(attr)) continue;
					if (getKeyName(attr) === "key") continue;
					context.report({
						node: attr,
						messageId: attr.directive ? "unexpectedDir" : "unexpectedAttr"
					});
				}
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_useless_template_attributes();
	}
});
x"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-useless-v-bind.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_no_useless_v_bind = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const DOUBLE_QUOTES_RE = /"/gu;
	const SINGLE_QUOTES_RE = /'/gu;
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow unnecessary `v-bind` directives",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/no-useless-v-bind.html"
			},
			fixable: "code",
			schema: [{
				type: "object",
				properties: {
					ignoreIncludesComment: { type: "boolean" },
					ignoreStringEscape: { type: "boolean" }
				},
				additionalProperties: false
			}],
			messages: { unexpected: "Unexpected `v-bind` with a string literal value." }
		},
		/** @param {RuleContext} context */
		create(context) {
			const opts = context.options[0] || {};
			const ignoreIncludesComment = opts.ignoreIncludesComment;
			const ignoreStringEscape = opts.ignoreStringEscape;
			const sourceCode = context.sourceCode;
			/**
			* Report if the value expression is string literals
			* @param {VDirective} node the node to check
			*/
			function verify(node) {
				const { value, key } = node;
				if (!value || key.modifiers.length > 0) return;
				const { expression } = value;
				if (!expression) return;
				/** @type {string} */
				let strValue;
				/** @type {string} */
				let rawValue;
				if (expression.type === "Literal") {
					if (typeof expression.value !== "string") return;
					strValue = expression.value;
					rawValue = sourceCode.getText(expression).slice(1, -1);
				} else if (expression.type === "TemplateLiteral") {
					if (expression.expressions.length > 0) return;
					strValue = expression.quasis[0].value.cooked;
					rawValue = expression.quasis[0].value.raw;
				} else return;
				const hasComment = sourceCode.parserServices.getTemplateBodyTokenStore().getTokens(value, { includeComments: true }).some((t) => t.type === "Block" || t.type === "Line");
				if (ignoreIncludesComment && hasComment) return;
				let hasEscape = false;
				if (rawValue !== strValue) {
					const chars = [...rawValue];
					let c = chars.shift();
					while (c) {
						if (c === "\\") {
							c = chars.shift();
							if (c == null || "nrvtbfux".includes(c)) {
								hasEscape = true;
								break;
							}
						}
						c = chars.shift();
					}
				}
				if (ignoreStringEscape && hasEscape) return;
				context.report({
					node,
					messageId: "unexpected",
					*fix(fixer) {
						if (hasComment || hasEscape) return;
						const quoteChar = sourceCode.getText(value)[0];
						const isShorthand = key.name.rawName === ":";
						/** @type {Range} */
						const keyDirectiveRange = [key.name.range[0], key.name.range[1] + (isShorthand ? 0 : 1)];
						yield fixer.removeRange(keyDirectiveRange);
						let attrValue;
						if (quoteChar === "\"") {
							attrValue = strValue.replaceAll(DOUBLE_QUOTES_RE, "&quot;");
							attrValue = quoteChar + attrValue + quoteChar;
						} else if (quoteChar === "'") {
							attrValue = strValue.replaceAll(SINGLE_QUOTES_RE, "&apos;");
							attrValue = quoteChar + attrValue + quoteChar;
						} else attrValue = strValue.replaceAll(DOUBLE_QUOTES_RE, "&quot;").replaceAll(SINGLE_QUOTES_RE, "&apos;");
						yield fixer.replaceText(value, attrValue);
					}
				});
			}
			return utils.defineTemplateBodyVisitor(context, { "VAttribute[directive=true][key.name.name='bind'][key.argument!=null]": verify });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_useless_v_bind();
	}
});
px
"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-v-for-template-key-on-child.js
/**
* @author Yosuke Ota
* This rule is based on X_V_FOR_TEMPLATE_KEY_PLACEMENT error of Vue 3.
* see https://github.com/vuejs/vue-next/blob/b0d01e9db9ffe5781cce5a2d62c8552db3d615b0/packages/compiler-core/src/errors.ts#L70
*/
var require_no_v_for_template_key_on_child = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* Check whether the given attribute is using the variables which are defined by `v-for` directives.
	* @param {VDirective} vFor The attribute node of `v-for` to check.
	* @param {VDirective} vBindKey The attribute node of `v-bind:key` to check.
	* @returns {boolean} `true` if the node is using the variables which are defined by `v-for` directives.
	*/
	function isUsingIterationVar(vFor, vBindKey) {
		if (vBindKey.value == null) return false;
		const references = vBindKey.value.references;
		const variables = vFor.parent.parent.variables;
		return references.some((reference) => variables.some((variable) => variable.id.name === reference.id.name && variable.kind === "v-for"));
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow key of `<template v-for>` placed on child elements",
				categories: ["vue3-essential"],
				url: "https://eslint.vuejs.org/rules/no-v-for-template-key-on-child.html"
			},
			fixable: null,
			schema: [],
			messages: { vForTemplateKeyPlacement: "`<template v-for>` key should be placed on the `<template>` tag." }
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VDirective} node */
"VElement[name='template'] > VStartTag > VAttribute[directive=true][key.name.name='for']"(node) {
				const template = node.parent.parent;
				const vBindKeyOnTemplate = utils.getDirective(template, "bind", "key");
				if (vBindKeyOnTemplate && isUsingIterationVar(node, vBindKeyOnTemplate)) return;
				for (const child of template.children) {
					if (!utils.isVElement(child) || utils.hasDirective(child, "if") || utils.hasDirective(child, "else-if") || utils.hasDirective(child, "else") || utils.hasDirective(child, "for")) continue;
					const vBindKeyOnChild = utils.getDirective(child, "bind", "key");
					if (vBindKeyOnChild && isUsingIterationVar(node, vBindKeyOnChild)) context.report({
						node: vBindKeyOnChild,
						loc: vBindKeyOnChild.loc,
						messageId: "vForTemplateKeyPlacement"
					});
				}
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_v_for_template_key_on_child();
	}
});
$=xxcv-for"Yosuke Ota
*/
var require_no_v_forJ v-for;g;v-for/deprecated: true5 v-for	Directive$ > VStartTag > VAttribute[directive=true][key.name.name='for']"(node) {
				const element = node.parent.parent;
				const keyNo-element, "key") || utils.getDirective(elementG#%context.report({
					node: keyNode,
messageId: "disallow"
				});v_for_template_key();
	}
});
}gx<"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-v-html.js
/**
* @fileoverview Restrict or warn use of v-html to prevent XSS attack
* @author Nathan Zeplowitz
*/
var require_no_v_html = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow use of v-html to prevent XSS attack",
				categories: ["vue3-recommended", "vue2-recommended"],
				url: "https://eslint.vuejs.org/rules/no-v-html.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: { ignorePattern: { type: "string" } },
				additionalProperties: false
			}],
			messages: { unexpected: "'v-html' directive can lead to XSS attack." }
		},
		/** @param {RuleContext} context */
		create(context) {
			const options = context.options[0];
			const ignoreRegEx = options?.ignorePattern ? new RegExp(options.ignorePattern, "u") : void 0;
			/**
			* Check if the expression matches the ignore pattern
			* @param {VExpressionContainer['expression']} expression
			* @param {SourceCode} sourceCode
			* @returns {boolean}
			*/
			function shouldIgnore(expression, sourceCode) {
				if (!ignoreRegEx || !expression) return false;
				if (expression.type === "Identifier") return ignoreRegEx.test(expression.name);
				const expressionText = sourceCode.getText(expression);
				return ignoreRegEx.test(expressionText);
			}
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VDirective} node */
"VAttribute[directive=true][key.name.name='html']"(node) {
				const sourceCode = context.sourceCode;
				if (node.value && node.value.expression && sourceCode && shouldIgnore(node.value.expression, sourceCode)) return;
				context.report({
					node,
					loc: node.loc,
					messageId: "unexpected"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_v_html();
	}
});
Zx_"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-v-model-argument.js
/**
* @author Przemyslaw Falowski (@przemkow)
* @fileoverview This rule checks whether v-model used on custom component do not have an argument
*/
var require_no_v_model_argument = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "disallow adding an argument to `v-model` used in custom component",
				categories: ["vue2-essential"],
				url: "https://eslint.vuejs.org/rules/no-v-model-argument.html"
			},
			fixable: null,
			deprecated: true,
			schema: [],
			messages: { vModelRequireNoArgument: "'v-model' directives require no argument." }
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VDirective} node */
"VAttribute[directive=true][key.name.name='model']"(node) {
				const element = node.parent.parent;
				if (node.key.argument && utils.isCustomComponent(element)) context.report({
					node,
					loc: node.loc,
					messageId: "vModelRequireNoArgument"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_v_model_argument();
	}
});
β|xJconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
//#region lib/rules/no-v-text-v-html-on-component.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
var no_v_text_v_html_on_component_default = {
	meta: {
		type: "problem",
		docs: {
			description: "disallow v-text / v-html on component",
			categories: ["vue2-essential", "vue3-essential"],
			url: "https://eslint.vuejs.org/rules/no-v-text-v-html-on-component.html"
		},
		fixable: null,
		schema: [{
			type: "object",
			properties: {
				allow: {
					type: "array",
					items: { type: "string" },
					uniqueItems: true
				},
				ignoreElementNamespaces: { type: "boolean" }
			},
			additionalProperties: false
		}],
		messages: { disallow: "Using {{directiveName}} on component may break component's content." }
	},
	create(context) {
		const options = context.options[0] || {};
		const allow = new Set(options.allow);
		const shouldIgnoreElementNamespaces = options.ignoreElementNamespaces === true;
		/**
		* Check whether the given node is an allowed component or not.
		* @param node The start tag node to check.
		*/
		function isAllowedComponent(node) {
			const componentName = node.rawName;
			return allow.has(componentName) || allow.has(require_casing.pascalCase(componentName)) || allow.has(require_casing.kebabCase(componentName));
		}
		/**
		* Verify for v-text and v-html directive
		*/
		function verify(node) {
			const element = node.parent.parent;
			if (import_utils.default.isCustomComponent(element, shouldIgnoreElementNamespaces) && !isAllowedComponent(element)) context.report({
				node,
				loc: node.loc,
				messageId: "disallow",
				data: { directiveName: `v-${node.key.name.name}` }
			});
		}
		return import_utils.default.defineTemplateBodyVisitor(context, {
			"VAttribute[directive=true][key.name.name='text']": verify,
			"VAttribute[directive=true][key.name.name='html']": verify
		});
	}
};
//#endregion
exports.default = no_v_text_v_html_on_component_default;
	aˌGx}"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/no-v-text.js
/**
* @author tyankatsu <https://github.com/tyankatsu0105>
* See LICENSE file in root directory for full license.
*/
var require_no_v_text = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow use of v-text",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/no-v-text.html"
			},
			fixable: null,
			schema: [],
			messages: { unexpected: "Don't use 'v-text'." }
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VDirective} node */
"VAttribute[directive=true][key.name.name='text']"(node) {
				context.report({
					node,
					loc: node.loc,
					messageId: "unexpected"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_no_v_text();
	}
});
t5Fxa,watchrwatch.\q | ChainExpression} node
	* @returns {boolean}
	*/
	function isMaybeUsedStopHandle(node) {
		const parent = node.parent;
		if (parent) {
			if (parent.type === "VariableDeclarator") return true;
			if (parent.type === "AssignmentExpression") return true;
			if (parent.type === "CallExpression") return true;
			if (parent.type === "Property") return true;
			if (parent.type === "ArrayExpression") return true;
			if (parent.type === "ChainExpression") return isMaybeUsedStopHandle(parent);
		}
		return falseo7registered `watch`",
				categories: ["vue3-essential"]$.watcha6P[],
			messages: { forbidden: "`watch` is forbidden after an `await` expression.UFconst watchO Set();2ؓl<program */
Program(programEprogram));
				const watchRefs = utils.iterateReferencesTraceMap(tracker, {
					watch: { [ReferenceTracker.CALL]: true },
				8	watchEffect: { [ReferenceTracker.CALL]: true }
				});
$watchRefs) watchCallNodes.add(node);<if (watchCallNodes.has(node) && !isMaybeUsedStopHandle(node)!1
forbidden"vwatch_after_await();
	}
});
4	yĻ&xk"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/object-curly-newline.js
/**
* @author Yosuke Ota
*/
var require_object_curly_newline = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapStylisticOrCoreRule } = require_index.default;
	module.exports = wrapStylisticOrCoreRule("object-curly-newline", { skipDynamicArguments: true });
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_object_curly_newline();
	}
});
иـ(xr"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/template-curly-spacing.js
/**
* @author Yosuke Ota
*/
var require_template_curly_spacing = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapStylisticOrCoreRule } = require_index.default;
	module.exports = wrapStylisticOrCoreRule("template-curly-spacing", {
		skipDynamicArguments: true,
		applyDocument: true
	});
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_template_curly_spacing();
	}
});
bM	x gJobject-curly-spacing.js
/**
* @author Toru Nagashima
*/
var require_objectobject-curly-spacing", {  yobject_curly_spacing();
	}
});
{5'xw"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/object-property-newline.js
/**
* @author Yosuke Ota
*/
var require_object_property_newline = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapStylisticOrCoreRule } = require_index.default;
	module.exports = wrapStylisticOrCoreRule("object-property-newline", { skipDynamicArguments: true });
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_object_property_newline();
	}
});
[Yؼ'x|"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/object-shorthand.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_object_shorthand = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapCoreRule } = require_index.default;
	module.exports = wrapCoreRule("object-shorthand", { skipDynamicArguments: true });
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_object_shorthand();
	}
});
܍bx%"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/one-component-per-file.js
/**
* @fileoverview enforce that each component should be in its own file
* @author Armano
*/
var require_one_component_per_file = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const { getVueComponentDefinitionType } = require_index.default;
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "enforce that each component should be in its own file",
				categories: ["vue3-strongly-recommended", "vue2-strongly-recommended"],
				url: "https://eslint.vuejs.org/rules/one-component-per-file.html"
			},
			fixable: null,
			schema: [],
			messages: { tooManyComponents: "There is more than one component in this file." }
		},
		/** @param {RuleContext} context */
		create(context) {
			/** @type {ObjectExpression[]} */
			const components = [];
			return Object.assign({}, utils.executeOnVueComponent(context, (node, type) => {
				if (type === "definition") {
					if (getVueComponentDefinitionType(context, node) === "mixin") return;
				}
				components.push(node);
			}), { "Program:exit"() {
				if (components.length > 1) for (const node of components) context.report({
					node,
					messageId: "tooManyComponents"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_one_component_per_file();
	}
});
J$xC"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/operator-linebreak.js
/**
* @author Yosuke Ota
*/
var require_operator_linebreak = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapStylisticOrCoreRule } = require_index.default;
	module.exports = wrapStylisticOrCoreRule("operator-linebreak");
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_operator_linebreak();
	}
});
$kʜx!"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/order-in-components.js
/**
* @fileoverview Keep order of properties in components
* @author Michał Sajnóg
*/
var require_order_in_components = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const traverseNodes = require("vue-eslint-parser").AST.traverseNodes;
	/**
	* @typedef {import('eslint-visitor-keys').VisitorKeys} VisitorKeys
	*/
	const defaultOrder = [
		"el",
		"name",
		"key",
		"parent",
		"functional",
		["delimiters", "comments"],
		[
			"components",
			"directives",
			"filters"
		],
		"extends",
		"mixins",
		["provide", "inject"],
		"ROUTER_GUARDS",
		"layout",
		"middleware",
		"validate",
		"scrollToTop",
		"transition",
		"loading",
		"inheritAttrs",
		"model",
		["props", "propsData"],
		"emits",
		"slots",
		"expose",
		"setup",
		"asyncData",
		"data",
		"fetch",
		"head",
		"computed",
		"watch",
		"watchQuery",
		"LIFECYCLE_HOOKS",
		"methods",
		["template", "render"],
		"renderError"
	];
	/** @type { { [key: string]: string[] } } */
	const groups = {
		LIFECYCLE_HOOKS: [
			"beforeCreate",
			"created",
			"beforeMount",
			"mounted",
			"beforeUpdate",
			"updated",
			"activated",
			"deactivated",
			"beforeUnmount",
			"unmounted",
			"beforeDestroy",
			"destroyed",
			"renderTracked",
			"renderTriggered",
			"errorCaptured"
		],
		ROUTER_GUARDS: [
			"beforeRouteEnter",
			"beforeRouteUpdate",
			"beforeRouteLeave"
		]
	};
	/**
	* @param {(string | string[])[]} order
	*/
	function getOrderMap(order) {
		/** @type {Map<string, number>} */
		const orderMap = /* @__PURE__ */ new Map();
		for (const [i, property] of order.entries()) if (Array.isArray(property)) for (const p of property) orderMap.set(p, i);
		else orderMap.set(property, i);
		return orderMap;
	}
	/**
	* @param {Token} node
	*/
	function isComma(node) {
		return node.type === "Punctuator" && node.value === ",";
	}
	const ARITHMETIC_OPERATORS = [
		"+",
		"-",
		"*",
		"/",
		"%",
		"**"
	];
	const BITWISE_OPERATORS = [
		"&",
		"|",
		"^",
		"~",
		"<<",
		">>",
		">>>"
	];
	const COMPARISON_OPERATORS = [
		"==",
		"!=",
		"===",
		"!==",
		">",
		">=",
		"<",
		"<="
	];
	const RELATIONAL_OPERATORS = ["in", "instanceof"];
	const ALL_BINARY_OPERATORS = /* @__PURE__ */ new Set([
		...ARITHMETIC_OPERATORS,
		...BITWISE_OPERATORS,
		...COMPARISON_OPERATORS,
		...RELATIONAL_OPERATORS
	]);
	const LOGICAL_OPERATORS = /* @__PURE__ */ new Set([
		"&&",
		"||",
		"??"
	]);
	const NO_SIDE_EFFECT_NODE_TYPES = /* @__PURE__ */ new Set([
		"FunctionExpression",
		"Identifier",
		"Literal",
		"ArrowFunctionExpression",
		"TemplateElement",
		"TSAsExpression"
	]);
	/**
	* Result `true` if the node is sure that there are no side effects
	*
	* Currently known side effects types
	*
	* node.type === 'CallExpression'
	* node.type === 'NewExpression'
	* node.type === 'UpdateExpression'
	* node.type === 'AssignmentExpression'
	* node.type === 'TaggedTemplateExpression'
	* node.type === 'UnaryExpression' && node.operator === 'delete'
	*
	* @param  {ASTNode} node target node
	* @param  {VisitorKeys} visitorKeys sourceCode.visitorKey
	* @returns {boolean} no side effects
	*/
	function isNotSideEffectsNode(node, visitorKeys) {
		let isValidOrder = true;
		/** @type {ASTNode | null} */
		let skipNode = null;
		traverseNodes(node, {
			visitorKeys,
			/** @param {ASTNode} node */
			enterNode(node) {
				if (!isValidOrder || skipNode) return;
				if (NO_SIDE_EFFECT_NODE_TYPES.has(node.type)) skipNode = node;
				else if (node.type !== "Property" && node.type !== "ObjectExpression" && node.type !== "ArrayExpression" && (node.type !== "UnaryExpression" || ![
					"!",
					"~",
					"+",
					"-",
					"typeof"
				].includes(node.operator)) && (node.type !== "BinaryExpression" || !ALL_BINARY_OPERATORS.has(node.operator)) && (node.type !== "LogicalExpression" || !LOGICAL_OPERATORS.has(node.operator)) && node.type !== "MemberExpression" && node.type !== "ConditionalExpression" && node.type !== "SpreadElement" && node.type !== "TemplateLiteral" && node.type !== "ChainExpression") isValidOrder = false;
			},
			/** @param {ASTNode} node */
			leaveNode(node) {
				if (skipNode === node) skipNode = null;
			}
		});
		return isValidOrder;
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "enforce order of properties in components",
				categories: ["vue3-recommended", "vue2-recommended"],
				url: "https://eslint.vuejs.org/rules/order-in-components.html"
			},
			fixable: "code",
			hasSuggestions: true,
			schema: [{
				type: "object",
				properties: { order: { type: "array" } },
				additionalProperties: false
			}],
			messages: {
				order: "The \"{{name}}\" property should be above the \"{{firstUnorderedPropertyName}}\" property on line {{line}}.",
				reorderWithSideEffects: "Manually move \"{{name}}\" property above \"{{firstUnorderedPropertyName}}\" property on line {{line}} (might break side effects)."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const orderMap = getOrderMap(((context.options[0] || {}).order || defaultOrder).map((property) => typeof property === "string" && groups[property] || property));
			const sourceCode = context.sourceCode;
			/**
			* @param {string} name
			*/
			function getOrderPosition(name) {
				return orderMap.get(name) ?? -1;
			}
			/**
			* @param {RuleFixer} fixer
			* @param {Property} propertyNode
			* @param {Property} unorderedPropertyNode
			*/
			function* handleFix(fixer, propertyNode, unorderedPropertyNode) {
				const afterComma = sourceCode.getTokenAfter(propertyNode);
				const hasAfterComma = isComma(afterComma);
				const beforeComma = sourceCode.getTokenBefore(propertyNode);
				const codeStart = beforeComma.range[1];
				const codeEnd = (hasAfterComma ? afterComma : propertyNode).range[1];
				const removeStart = hasAfterComma ? codeStart : beforeComma.range[0];
				yield fixer.removeRange([removeStart, codeEnd]);
				const propertyCode = sourceCode.text.slice(codeStart, codeEnd) + (hasAfterComma ? "" : ",");
				const insertTarget = sourceCode.getTokenBefore(unorderedPropertyNode);
				yield fixer.insertTextAfter(insertTarget, propertyCode);
			}
			/**
			* @param {(Property | SpreadElement)[]} propertiesNodes
			*/
			function checkOrder(propertiesNodes) {
				const properties = propertiesNodes.filter(utils.isProperty).map((property) => ({
					node: property,
					name: utils.getStaticPropertyName(property) || property.key.type === "Identifier" && property.key.name || ""
				}));
				for (const [i, property] of properties.entries()) {
					if (getOrderPosition(property.name) < 0) continue;
					const firstUnorderedProperty = properties.slice(0, i).filter((p) => getOrderPosition(p.name) > getOrderPosition(property.name)).sort((p1, p2) => getOrderPosition(p1.name) > getOrderPosition(p2.name) ? 1 : -1)[0];
					if (firstUnorderedProperty) {
						const line = firstUnorderedProperty.node.loc.start.line;
						const propertyNode = property.node;
						const firstUnorderedPropertyNode = firstUnorderedProperty.node;
						const hasSideEffectsPossibility = propertiesNodes.slice(propertiesNodes.indexOf(firstUnorderedPropertyNode), propertiesNodes.indexOf(propertyNode) + 1).some((property) => !isNotSideEffectsNode(property, sourceCode.visitorKeys));
						context.report({
							node: property.node,
							messageId: "order",
							data: {
								name: property.name,
								firstUnorderedPropertyName: firstUnorderedProperty.name,
								line
							},
							fix: hasSideEffectsPossibility ? void 0 : (fixer) => handleFix(fixer, propertyNode, firstUnorderedPropertyNode),
							suggest: hasSideEffectsPossibility ? [{
								messageId: "reorderWithSideEffects",
								data: {
									name: property.name,
									firstUnorderedPropertyName: firstUnorderedProperty.name,
									line
								},
								fix: (fixer) => handleFix(fixer, propertyNode, firstUnorderedPropertyNode)
							}] : void 0
						});
					}
				}
			}
			return utils.compositingVisitors(utils.executeOnVue(context, (obj) => {
				checkOrder(obj.properties);
			}), utils.defineScriptSetupVisitor(context, { onDefineOptionsEnter(node) {
				if (node.arguments.length === 0) return;
				const define = node.arguments[0];
				if (define.type !== "ObjectExpression") return;
				checkOrder(define.properties);
			} }));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_order_in_components();
	}
});
 x*"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/padding-line-between-blocks.js
/**
* @fileoverview Require or disallow padding lines between blocks
* @author Yosuke Ota
*/
var require_padding_line_between_blocks = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* Split the source code into multiple lines based on the line delimiters.
	* @param {string} text Source code as a string.
	* @returns {string[]} Array of source code lines.
	*/
	function splitLines(text) {
		return text.split(/\r\n|[\r\n\u{2028}\u{2029}]/gu);
	}
	/**
	* Check and report blocks for `never` configuration.
	* This autofix removes blank lines between the given 2 blocks.
	* @param {RuleContext} context The rule context to report.
	* @param {VElement} prevBlock The previous block to check.
	* @param {VElement} nextBlock The next block to check.
	* @param {Token[]} betweenTokens The array of tokens between blocks.
	* @returns {void}
	* @private
	*/
	function verifyForNever(context, prevBlock, nextBlock, betweenTokens) {
		if (prevBlock.loc.end.line === nextBlock.loc.start.line) return;
		const tokenOrNodes = [...betweenTokens, nextBlock];
		/** @type {ASTNode | Token} */
		let prev = prevBlock;
		/** @type {[ASTNode | Token, ASTNode | Token][]} */
		const paddingLines = [];
		for (const tokenOrNode of tokenOrNodes) {
			if (tokenOrNode.loc.start.line - prev.loc.end.line > 1) paddingLines.push([prev, tokenOrNode]);
			prev = tokenOrNode;
		}
		if (paddingLines.length === 0) return;
		context.report({
			node: nextBlock,
			messageId: "never",
			*fix(fixer) {
				for (const [prevToken, nextToken] of paddingLines) {
					const start = prevToken.range[1];
					const end = nextToken.range[0];
					const lastSpaces = splitLines(context.sourceCode.text.slice(start, end)).pop();
					yield fixer.replaceTextRange([start, end], `\n${lastSpaces}`);
				}
			}
		});
	}
	/**
	* Check and report blocks for `always` configuration.
	* This autofix inserts a blank line between the given 2 blocks.
	* @param {RuleContext} context The rule context to report.
	* @param {VElement} prevBlock The previous block to check.
	* @param {VElement} nextBlock The next block to check.
	* @param {Token[]} betweenTokens The array of tokens between blocks.
	* @returns {void}
	* @private
	*/
	function verifyForAlways(context, prevBlock, nextBlock, betweenTokens) {
		const tokenOrNodes = [...betweenTokens, nextBlock];
		/** @type {ASTNode | Token} */
		let prev = prevBlock;
		/** @type {ASTNode | Token | undefined} */
		let linebreak;
		for (const tokenOrNode of tokenOrNodes) {
			const numOfLineBreaks = tokenOrNode.loc.start.line - prev.loc.end.line;
			if (numOfLineBreaks > 1) return;
			if (!linebreak && numOfLineBreaks > 0) linebreak = prev;
			prev = tokenOrNode;
		}
		context.report({
			node: nextBlock,
			messageId: "always",
			fix(fixer) {
				if (linebreak) return fixer.insertTextAfter(linebreak, "\n");
				return fixer.insertTextAfter(prevBlock, "\n\n");
			}
		});
	}
	/**
	* Types of blank lines.
	* `never` and `always` are defined.
	* Those have `verify` method to check and report statements.
	* @private
	*/
	const PaddingTypes = {
		never: { verify: verifyForNever },
		always: { verify: verifyForAlways }
	};
	module.exports = {
		meta: {
			type: "layout",
			docs: {
				description: "require or disallow padding lines between blocks",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/padding-line-between-blocks.html"
			},
			fixable: "whitespace",
			schema: [{ enum: Object.keys(PaddingTypes) }],
			messages: {
				never: "Unexpected blank line before this block.",
				always: "Expected blank line before this block."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const sourceCode = context.sourceCode;
			if (!sourceCode.parserServices.getDocumentFragment) return {};
			const df = sourceCode.parserServices.getDocumentFragment();
			if (!df) return {};
			const documentFragment = df;
			/** @type {'always' | 'never'} */
			const option = context.options[0] || "always";
			const paddingType = PaddingTypes[option];
			/** @type {Token[]} */
			let tokens;
			/**
			* @returns {VElement[]}
			*/
			function getTopLevelHTMLElements() {
				return documentFragment.children.filter(utils.isVElement);
			}
			/**
			* @param {VElement} prev
			* @param {VElement} next
			*/
			function getTokenAndCommentsBetween(prev, next) {
				if (!tokens) tokens = [...documentFragment.tokens.filter((token) => token.type !== "HTMLWhitespace"), ...documentFragment.comments].sort((a, b) => a.range[0] - b.range[0]);
				let token = tokens.shift();
				const results = [];
				while (token) {
					if (prev.range[1] <= token.range[0]) {
						if (next.range[0] <= token.range[0]) {
							tokens.unshift(token);
							break;
						}
						results.push(token);
					}
					token = tokens.shift();
				}
				return results;
			}
			return utils.defineTemplateBodyVisitor(context, {}, { 
			/** @param {Program} node */
Program(node) {
				if (utils.hasInvalidEOF(node)) return;
				const elements = [...getTopLevelHTMLElements()];
				let prev = elements.shift();
				for (const element of elements) {
					if (!prev) return;
					const betweenTokens = getTokenAndCommentsBetween(prev, element);
					paddingType.verify(context, prev, element, betweenTokens);
					prev = element;
				}
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_padding_line_between_blocks();
	}
});
f<Wx"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/padding-line-between-tags.js
/**
* @author dev1437
* See LICENSE file in root directory for full license.
*/
var require_padding_line_between_tags = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* Split the source code into multiple lines based on the line delimiters.
	* Copied from padding-line-between-blocks
	* @param {string} text Source code as a string.
	* @returns {string[]} Array of source code lines.
	*/
	function splitLines(text) {
		return text.split(/\r\n|[\r\n\u{2028}\u{2029}]/gu);
	}
	/**
	* @param {RuleContext} context
	* @param {VElement} tag
	* @param {VElement} sibling
	* @param {number} lineDifference
	*/
	function insertNewLine(context, tag, sibling, lineDifference) {
		const endTag = tag.endTag || tag.startTag;
		if (lineDifference === 1) context.report({
			messageId: "always",
			loc: sibling.loc,
			fix(fixer) {
				return fixer.insertTextAfter(tag, "\n");
			}
		});
		else if (lineDifference === 0) context.report({
			messageId: "always",
			loc: sibling.loc,
			fix(fixer) {
				const lastSpaces = /^\s*/.exec(context.sourceCode.lines[endTag.loc.start.line - 1])[0];
				return fixer.insertTextAfter(endTag, `\n\n${lastSpaces}`);
			}
		});
	}
	/**
	* @param {RuleContext} context
	* @param {VEndTag | VStartTag} endTag
	* @param {VElement} sibling
	* @param {number} lineDifference
	*/
	function removeExcessLines(context, endTag, sibling, lineDifference) {
		if (lineDifference <= 1) return;
		let hasOnlyTextBetween = true;
		for (let i = endTag.loc.start.line; i < sibling.loc.start.line - 1 && hasOnlyTextBetween; i++) hasOnlyTextBetween = !/^\s*$/.test(context.sourceCode.lines[i]);
		if (!hasOnlyTextBetween) context.report({
			messageId: "never",
			loc: sibling.loc,
			fix(fixer) {
				const start = endTag.range[1];
				const end = sibling.range[0];
				const textBetween = splitLines(context.sourceCode.text.slice(start, end));
				let newTextBetween = `\n${textBetween.pop()}`;
				for (let i = textBetween.length - 1; i >= 0; i--) if (!/^\s*$/.test(textBetween[i])) newTextBetween = `${i === 0 ? "" : "\n"}${textBetween[i]}${newTextBetween}`;
				return fixer.replaceTextRange([start, end], newTextBetween);
			}
		});
	}
	/**
	* Check if a tag is single-line (opening and closing tags on the same line)
	* @param {VElement} element
	* @returns {boolean}
	*/
	function isSingleLine(element) {
		const endTag = element.endTag || element.startTag;
		return element.startTag.loc.start.line === endTag.loc.end.line;
	}
	/**
	* Match a selector string against an element.
	* Supports pseudo-classes `:single-line` and `:multi-line`.
	* @param {string} selector
	* @param {VElement} element
	* @returns {boolean}
	*/
	function matchesTag(selector, element) {
		const colonIndex = selector.lastIndexOf(":");
		if (colonIndex > 0) {
			const pseudo = selector.slice(colonIndex);
			const tagPart = selector.slice(0, colonIndex);
			const isTagMatch = tagPart === "*" || element.name === tagPart;
			if (pseudo === ":single-line") return isTagMatch && isSingleLine(element);
			if (pseudo === ":multi-line") return isTagMatch && !isSingleLine(element);
		}
		return selector === "*" || element.name === selector;
	}
	/**
	* Check if the configuration matches the given elements
	* @param {{blankLine: string, prev: string, next: string}} configure
	* @param {VElement} prevElement
	* @param {VElement} nextElement
	* @returns {boolean}
	*/
	function matchesConfiguration(configure, prevElement, nextElement) {
		return matchesTag(configure.prev, prevElement) && matchesTag(configure.next, nextElement);
	}
	/**
	* @param {RuleContext} context
	*/
	function checkNewline(context) {
		const reverseConfigureList = [...context.options[0] || [{
			blankLine: "always",
			prev: "*",
			next: "*"
		}]].reverse();
		/**
		* It has the style of the first `blankLine="consistent"`.
		* @type {Map<VElement, "always" | "never">}
		*/
		const firstConsistentBlankLines = /* @__PURE__ */ new Map();
		/**
		* @param {VElement} block
		*/
		return (block) => {
			if (!block.parent.parent) return;
			const endTag = block.endTag || block.startTag;
			const lowerSiblings = block.parent.children.filter((element) => element.type === "VElement" && element.range !== block.range).filter((sibling) => sibling.range[0] >= endTag.range[1]);
			if (lowerSiblings.length === 0) return;
			const closestSibling = lowerSiblings[0];
			const configure = reverseConfigureList.find((configure) => matchesConfiguration(configure, block, closestSibling));
			if (!configure) return;
			const lineDifference = closestSibling.loc.start.line - endTag.loc.end.line;
			let blankLine = configure.blankLine;
			if (blankLine === "consistent") {
				const firstConsistentBlankLine = firstConsistentBlankLines.get(block.parent);
				if (firstConsistentBlankLine == null) {
					firstConsistentBlankLines.set(block.parent, lineDifference > 1 ? "always" : "never");
					return;
				}
				blankLine = firstConsistentBlankLine;
			}
			if (blankLine === "always") insertNewLine(context, block, closestSibling, lineDifference);
			else removeExcessLines(context, endTag, closestSibling, lineDifference);
		};
	}
	module.exports = {
		meta: {
			type: "layout",
			docs: {
				description: "require or disallow newlines between sibling tags in template",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/padding-line-between-tags.html"
			},
			fixable: "whitespace",
			schema: [{
				type: "array",
				items: {
					type: "object",
					properties: {
						blankLine: { enum: [
							"always",
							"never",
							"consistent"
						] },
						prev: { type: "string" },
						next: { type: "string" }
					},
					additionalProperties: false,
					required: [
						"blankLine",
						"prev",
						"next"
					]
				}
			}],
			messages: {
				never: "Unexpected blank line before this tag.",
				always: "Expected blank line before this tag."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { VElement: checkNewline(context) });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_padding_line_between_tags();
	}
});
S'˷x%8"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/padding-lines-in-component-definition.js
/**
* @author ItMaga <https://github.com/ItMaga>
* See LICENSE file in root directory for full license.
*/
var require_padding_lines_in_component_definition = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	/**
	* @typedef {import('../utils').ComponentProp} ComponentProp
	* @typedef {import('../utils').ComponentEmit} ComponentEmit
	* @typedef {import('../utils').GroupName} GroupName
	*/
	const utils = require_index.default;
	const { isCommentToken } = require("@eslint-community/eslint-utils");
	const AvailablePaddingOptions = {
		Never: "never",
		Always: "always",
		Ignore: "ignore"
	};
	const OptionKeys = {
		BetweenOptions: "betweenOptions",
		WithinOption: "withinOption",
		BetweenItems: "betweenItems",
		WithinEach: "withinEach",
		GroupSingleLineProperties: "groupSingleLineProperties"
	};
	/**
	* @param {Token} node
	*/
	function isComma(node) {
		return node.type === "Punctuator" && node.value === ",";
	}
	/**
	* @typedef {Exclude<ComponentProp | ComponentEmit, {type:'infer-type'}> & { node: {type: 'Property' | 'SpreadElement'} }} ValidComponentPropOrEmit
	*/
	/**
	* @template {ComponentProp | ComponentEmit} T
	* @param {T} propOrEmit
	* @returns {propOrEmit is ValidComponentPropOrEmit & T}
	*/
	function isValidProperties(propOrEmit) {
		return Boolean(propOrEmit.type !== "infer-type" && propOrEmit.node && ["Property", "SpreadElement"].includes(propOrEmit.node.type));
	}
	/**
	* Split the source code into multiple lines based on the line delimiters.
	* @param {string} text Source code as a string.
	* @returns {string[]} Array of source code lines.
	*/
	function splitLines(text) {
		return text.split(/\r\n|[\r\n\u{2028}\u{2029}]/gu);
	}
	/**
	* @param {any} initialOption
	* @param {string} optionKey
	* @private
	* */
	function parseOption(initialOption, optionKey) {
		return typeof initialOption === "string" ? initialOption : initialOption[optionKey];
	}
	/**
	* @param {any} initialOption
	* @param {string} optionKey
	* @private
	* */
	function parseBooleanOption(initialOption, optionKey) {
		if (typeof initialOption === "string") {
			if (initialOption === AvailablePaddingOptions.Always) return true;
			if (initialOption === AvailablePaddingOptions.Never) return false;
		}
		return initialOption[optionKey];
	}
	/**
	* @param {(Property | SpreadElement)} currentProperty
	* @param {(Property | SpreadElement)} nextProperty
	* @param {boolean} option
	* @returns {boolean}
	* @private
	* */
	function needGroupSingleLineProperties(currentProperty, nextProperty, option) {
		const isSingleCurrentProperty = currentProperty.loc.start.line === currentProperty.loc.end.line;
		const isSingleNextProperty = nextProperty.loc.start.line === nextProperty.loc.end.line;
		return isSingleCurrentProperty && isSingleNextProperty && option;
	}
	module.exports = {
		meta: {
			type: "layout",
			docs: {
				description: "require or disallow padding lines in component definition",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/padding-lines-in-component-definition.html"
			},
			fixable: "whitespace",
			schema: [{ oneOf: [{ enum: [AvailablePaddingOptions.Always, AvailablePaddingOptions.Never] }, {
				type: "object",
				additionalProperties: false,
				properties: {
					[OptionKeys.BetweenOptions]: { enum: Object.values(AvailablePaddingOptions) },
					[OptionKeys.WithinOption]: { oneOf: [{ enum: Object.values(AvailablePaddingOptions) }, {
						type: "object",
						patternProperties: { "^[a-zA-Z]*$": { oneOf: [{ enum: Object.values(AvailablePaddingOptions) }, {
							type: "object",
							properties: {
								[OptionKeys.BetweenItems]: { enum: Object.values(AvailablePaddingOptions) },
								[OptionKeys.WithinEach]: { enum: Object.values(AvailablePaddingOptions) }
							},
							additionalProperties: false
						}] } },
						minProperties: 1,
						additionalProperties: false
					}] },
					[OptionKeys.GroupSingleLineProperties]: { type: "boolean" }
				}
			}] }],
			messages: {
				never: "Unexpected blank line before this definition.",
				always: "Expected blank line before this definition.",
				groupSingleLineProperties: "Unexpected blank line between single line properties."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const options = context.options[0] || AvailablePaddingOptions.Always;
			const sourceCode = context.sourceCode;
			/**
			* @param {(Property | SpreadElement)} currentProperty
			* @param {(Property | SpreadElement | Token)} nextProperty
			* @param {RuleFixer} fixer
			* */
			function replaceLines(currentProperty, nextProperty, fixer) {
				const start = (sourceCode.getTokenAfter(currentProperty, isComma) || currentProperty).range[1];
				const end = nextProperty.range[0];
				const newText = `\n${splitLines(sourceCode.text.slice(start, end)).pop()}`;
				return fixer.replaceTextRange([start, end], newText);
			}
			/**
			* @param {(Property | SpreadElement)} currentProperty
			* @param {(Property | SpreadElement | Token)} nextProperty
			* @param {RuleFixer} fixer
			* @param {number} betweenLinesRange
			* */
			function insertLines(currentProperty, nextProperty, fixer, betweenLinesRange) {
				const commaToken = sourceCode.getTokenAfter(currentProperty, isComma);
				const lineBeforeNextProperty = sourceCode.lines[nextProperty.loc.start.line - 1];
				const lastSpaces = /^\s*/.exec(lineBeforeNextProperty)[0];
				const newText = betweenLinesRange === 0 ? `\n\n${lastSpaces}` : "\n";
				return fixer.insertTextAfter(commaToken || currentProperty, newText);
			}
			/**
			* @param {(Property | SpreadElement)[]} properties
			* @param {any} option
			* @param {any} nextOption
			* */
			function verify(properties, option, nextOption) {
				const groupSingleLineProperties = parseBooleanOption(options, OptionKeys.GroupSingleLineProperties);
				for (const [i, currentProperty] of properties.entries()) {
					const nextProperty = properties[i + 1];
					if (nextProperty && option !== AvailablePaddingOptions.Ignore) {
						const tokenBeforeNext = sourceCode.getTokenBefore(nextProperty, { includeComments: true });
						const reportNode = isCommentToken(tokenBeforeNext) ? tokenBeforeNext : nextProperty;
						const betweenLinesRange = reportNode.loc.start.line - currentProperty.loc.end.line;
						if (needGroupSingleLineProperties(currentProperty, nextProperty, groupSingleLineProperties)) {
							if (betweenLinesRange > 1) context.report({
								node: reportNode,
								messageId: "groupSingleLineProperties",
								loc: reportNode.loc,
								fix(fixer) {
									return replaceLines(currentProperty, reportNode, fixer);
								}
							});
							continue;
						}
						if (betweenLinesRange <= 1 && option === AvailablePaddingOptions.Always) context.report({
							node: reportNode,
							messageId: "always",
							loc: reportNode.loc,
							fix(fixer) {
								return insertLines(currentProperty, reportNode, fixer, betweenLinesRange);
							}
						});
						else if (betweenLinesRange > 1 && option === AvailablePaddingOptions.Never) context.report({
							node: reportNode,
							messageId: "never",
							loc: reportNode.loc,
							fix(fixer) {
								return replaceLines(currentProperty, reportNode, fixer);
							}
						});
					}
					if (!nextOption) return;
					const name = currentProperty.type === "Property" && utils.getStaticPropertyName(currentProperty);
					if (!name) continue;
					const propertyOption = parseOption(nextOption, name);
					if (!propertyOption) continue;
					const nestedProperties = currentProperty.type === "Property" && currentProperty.value.type === "ObjectExpression" && currentProperty.value.properties;
					if (!nestedProperties) continue;
					verify(nestedProperties, parseOption(propertyOption, OptionKeys.BetweenItems), parseOption(propertyOption, OptionKeys.WithinEach));
				}
			}
			return utils.compositingVisitors(utils.defineVueVisitor(context, { onVueObjectEnter(node) {
				verify(node.properties, parseOption(options, OptionKeys.BetweenOptions), parseOption(options, OptionKeys.WithinOption));
			} }), utils.defineScriptSetupVisitor(context, {
				onDefinePropsEnter(_, props) {
					const propNodes = props.filter(isValidProperties).map((prop) => prop.node);
					const withinOption = parseOption(options, OptionKeys.WithinOption);
					const propsOption = withinOption && parseOption(withinOption, "props");
					if (!propsOption) return;
					verify(propNodes, parseOption(propsOption, OptionKeys.BetweenItems), parseOption(propsOption, OptionKeys.WithinEach));
				},
				onDefineEmitsEnter(_, emits) {
					const emitNodes = emits.filter(isValidProperties).map((emit) => emit.node);
					const withinOption = parseOption(options, OptionKeys.WithinOption);
					const emitsOption = withinOption && parseOption(withinOption, "emits");
					if (!emitsOption) return;
					verify(emitNodes, parseOption(emitsOption, OptionKeys.BetweenItems), parseOption(emitsOption, OptionKeys.WithinEach));
				},
				onDefineOptionsEnter(node) {
					if (node.arguments.length === 0) return;
					const define = node.arguments[0];
					if (define.type !== "ObjectExpression") return;
					verify(define.properties, parseOption(options, OptionKeys.BetweenOptions), parseOption(options, OptionKeys.WithinOption));
				}
			}));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_padding_lines_in_component_definition();
	}
});
M&x"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/prefer-define-options.js
/**
* @author Yosuke Ota <https://github.com/ota-meshi>
* See LICENSE file in root directory for full license.
*/
var require_prefer_define_options = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "enforce use of `defineOptions` instead of default export",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/prefer-define-options.html"
			},
			fixable: "code",
			schema: [],
			messages: { preferDefineOptions: "Use `defineOptions` instead of default export." }
		},
		/**
		* @param {RuleContext} context
		* @returns {RuleListener}
		*/
		create(context) {
			const scriptSetup = utils.getScriptSetupElement(context);
			if (!scriptSetup) return {};
			/** @type {CallExpression | null} */
			let defineOptionsNode = null;
			/** @type {ExportDefaultDeclaration | null} */
			let exportDefaultDeclaration = null;
			/** @type {ImportDeclaration|null} */
			let lastImportDeclaration = null;
			return utils.compositingVisitors(utils.defineScriptSetupVisitor(context, {
				ImportDeclaration(node) {
					lastImportDeclaration = node;
				},
				onDefineOptionsEnter(node) {
					defineOptionsNode = node;
				}
			}), {
				ExportDefaultDeclaration(node) {
					exportDefaultDeclaration = node;
				},
				"Program:exit"() {
					if (!exportDefaultDeclaration) return;
					context.report({
						node: exportDefaultDeclaration,
						messageId: "preferDefineOptions",
						fix: defineOptionsNode ? null : buildFix(exportDefaultDeclaration, scriptSetup)
					});
				}
			});
			/**
			* @param {ExportDefaultDeclaration} node
			* @param {VElement} scriptSetup
			* @returns {(fixer: RuleFixer) => Fix[]}
			*/
			function buildFix(node, scriptSetup) {
				return (fixer) => {
					const sourceCode = context.sourceCode;
					/** @type {Range} */
					let removeRange = [...node.range];
					const script = scriptSetup.parent.children.filter(utils.isVElement).find((node) => node.name === "script" && !utils.hasAttribute(node, "setup"));
					if (script && script.endTag && sourceCode.getTokensBetween(script.startTag, script.endTag, { includeComments: true }).every((token) => removeRange[0] <= token.range[0] && token.range[1] <= removeRange[1])) removeRange = [...script.range];
					const removeStartLoc = sourceCode.getLocFromIndex(removeRange[0]);
					if (sourceCode.lines[removeStartLoc.line - 1].slice(0, removeStartLoc.column).trim() === "") removeRange[0] = removeStartLoc.line === 1 ? 0 : sourceCode.getIndexFromLoc({
						line: removeStartLoc.line - 1,
						column: sourceCode.lines[removeStartLoc.line - 2].length
					});
					/** @type {VStartTag | ImportDeclaration} */
					const insertAfterTag = lastImportDeclaration || scriptSetup.startTag;
					return [fixer.removeRange(removeRange), fixer.insertTextAfter(insertAfterTag, `\ndefineOptions(${sourceCode.getText(node.declaration)})\n`)];
				};
			}
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_prefer_define_options();
	}
});
jBx"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_vue3_export_names$1 = require("../utils/vue3-export-names.js");
//#region lib/rules/prefer-import-from-vue.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_prefer_import_from_vue = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const vue3ExportNames = new Set(require_vue3_export_names$1.default);
	const TARGET_AT_VUE_MODULES = /* @__PURE__ */ new Set([
		"@vue/runtime-dom",
		"@vue/runtime-core",
		"@vue/reactivity",
		"@vue/shared"
	]);
	/**
	* @param {ImportDeclaration['specifiers'][number]} specifier
	* @returns {IterableIterator<string | null>}
	*/
	function* extractSpecifierNames(specifier) {
		switch (specifier.type) {
			case "ImportDefaultSpecifier":
				yield "default";
				break;
			case "ImportNamespaceSpecifier":
				yield null;
				break;
			case "ImportSpecifier":
				yield specifier.imported.name;
				break;
		}
	}
	/**
	* @param {ImportDeclaration} node
	*/
	function* extractImportNames(node) {
		for (const specifier of node.specifiers) yield* extractSpecifierNames(specifier);
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "enforce import from 'vue' instead of import from '@vue/*'",
				categories: ["vue3-essential"],
				url: "https://eslint.vuejs.org/rules/prefer-import-from-vue.html"
			},
			fixable: "code",
			schema: [],
			messages: { importedAtVue: "Import from 'vue' instead of '{{source}}'." }
		},
		/**
		* @param {RuleContext} context
		* @returns {RuleListener}
		*/
		create(context) {
			/**
			*
			* @param {Literal & { value: string }} source
			* @param { () => boolean } fixable
			* @param {string[]} names Named bindings imported or exported from the source.
			*/
			function verifySource(source, fixable, names) {
				if (!TARGET_AT_VUE_MODULES.has(source.value)) return;
				if (names.length > 0 && names.every((name) => !vue3ExportNames.has(name))) return;
				context.report({
					node: source,
					messageId: "importedAtVue",
					data: { source: source.value },
					fix: fixable() ? (fixer) => fixer.replaceTextRange([source.range[0] + 1, source.range[1] - 1], "vue") : null
				});
			}
			return {
				ImportDeclaration(node) {
					if (node.specifiers.length === 0 && context.filename.endsWith(".d.ts")) return;
					const importedNames = node.specifiers.every((specifier) => specifier.type === "ImportSpecifier") ? node.specifiers.map((specifier) => specifier.imported.name) : [];
					verifySource(node.source, () => {
						for (const name of extractImportNames(node)) {
							if (name == null) return false;
							if (!vue3ExportNames.has(name)) return false;
						}
						return true;
					}, importedNames);
				},
				ExportNamedDeclaration(node) {
					if (node.source) verifySource(node.source, () => {
						for (const specifier of node.specifiers) if (!vue3ExportNames.has(specifier.local.name)) return false;
						return true;
					}, node.specifiers.map((specifier) => specifier.local.name));
				},
				ExportAllDeclaration(node) {
					verifySource(node.source, () => false, []);
				}
			};
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_prefer_import_from_vue();
	}
});
zx-⾵x^"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/prefer-prop-type-boolean-first.js
/**
* @author Pig Fang
* See LICENSE file in root directory for full license.
*/
var require_prefer_prop_type_boolean_first = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @param {ArrayExpression} node
	* @param {RuleContext} context
	*/
	function checkArrayExpression(node, context) {
		const booleanType = node.elements.find((element) => element && element.type === "Identifier" && element.name === "Boolean");
		if (!booleanType) return;
		const booleanTypeIndex = node.elements.indexOf(booleanType);
		if (booleanTypeIndex > 0) context.report({
			node: booleanType,
			messageId: "shouldBeFirst",
			suggest: [{
				messageId: "moveToFirst",
				fix: (fixer) => {
					const sourceCode = context.sourceCode;
					const elements = [...node.elements];
					elements.splice(booleanTypeIndex, 1);
					const code = elements.filter(utils.isDef).map((element) => sourceCode.getText(element));
					code.unshift("Boolean");
					return fixer.replaceText(node, `[${code.join(", ")}]`);
				}
			}]
		});
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce `Boolean` comes first in component prop types",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/prefer-prop-type-boolean-first.html"
			},
			fixable: null,
			hasSuggestions: true,
			schema: [],
			messages: {
				shouldBeFirst: "Type `Boolean` should be at first in prop types.",
				moveToFirst: "Move `Boolean` to be first in prop types."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			/**
			* @param {import('../utils').ComponentProp} prop
			*/
			function checkProperty(prop) {
				if (prop.type !== "object") return;
				const { value } = prop;
				if (!value) return;
				if (value.type === "ArrayExpression") checkArrayExpression(value, context);
				else if (value.type === "ObjectExpression") {
					const type = value.properties.find(
						/** @return {property is Property} */
						(property) => property.type === "Property" && utils.getStaticPropertyName(property) === "type"
					);
					if (!type || type.value.type !== "ArrayExpression") return;
					checkArrayExpression(type.value, context);
				}
			}
			return utils.compositingVisitors(utils.defineScriptSetupVisitor(context, { onDefinePropsEnter(_, props) {
				for (const prop of props) checkProperty(prop);
			} }), utils.executeOnVue(context, (obj) => {
				const props = utils.getComponentPropsFromOptions(obj);
				for (const prop of props) checkProperty(prop);
			}));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_prefer_prop_type_boolean_first();
	}
});
x."use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/prefer-separate-static-class.js
/**
* @author Flo Edelmann
* See LICENSE file in root directory for full license.
*/
var require_prefer_separate_static_class = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { defineTemplateBodyVisitor, isStringLiteral, getStringLiteralValue } = require_index.default;
	/**
	* @param {TemplateElement} templateElement
	* @param {number} index
	* @param {TemplateLiteral} templateLiteral
	* @returns {boolean}
	*/
	function isStaticClassTemplateElement(templateElement, index, templateLiteral) {
		const value = templateElement.value.cooked;
		if (!value || value.trim() === "") return false;
		return (index === 0 || /^\s/u.test(value)) && (index === templateLiteral.expressions.length || /\s$/u.test(value));
	}
	/**
	* @param {ASTNode | TemplateLiteral} expressionNode
	* @returns {(Literal | TemplateLiteral | TemplateElement | Identifier)[]}
	*/
	function findStaticClasses(expressionNode) {
		if (isStringLiteral(expressionNode)) return [expressionNode];
		if (expressionNode.type === "TemplateLiteral") return expressionNode.quasis.filter((templateElement, index) => isStaticClassTemplateElement(templateElement, index, expressionNode));
		if (expressionNode.type === "ArrayExpression") return expressionNode.elements.flatMap((element) => {
			if (element === null || element.type === "SpreadElement") return [];
			return findStaticClasses(element);
		});
		if (expressionNode.type === "ObjectExpression") return expressionNode.properties.flatMap((property) => {
			if (property.type === "Property" && property.value.type === "Literal" && property.value.value === true && (isStringLiteral(property.key) || property.key.type === "Identifier" && !property.computed)) return [property.key];
			return [];
		});
		return [];
	}
	/**
	* @param {Literal | TemplateLiteral | TemplateElement | Identifier} staticClassNameNode
	* @returns {string | null}
	*/
	function getStaticClassName(staticClassNameNode) {
		if (staticClassNameNode.type === "Identifier") return staticClassNameNode.name;
		if (staticClassNameNode.type === "TemplateElement") {
			const value = staticClassNameNode.value.cooked;
			return value === null ? null : value.trim().replaceAll(/\s+/gu, " ");
		}
		return getStringLiteralValue(staticClassNameNode, true);
	}
	/**
	* @param {VAttribute | VDirective} attributeNode
	* @returns {attributeNode is VAttribute & { value: VLiteral }}
	*/
	function isStaticClassAttribute(attributeNode) {
		return !attributeNode.directive && attributeNode.key.name === "class" && attributeNode.value !== null;
	}
	/**
	* Removes the node together with the comma before or after the node.
	* @param {RuleFixer} fixer
	* @param {ParserServices.TokenStore} tokenStore
	* @param {ASTNode} node
	*/
	function* removeNodeWithComma(fixer, tokenStore, node) {
		const prevToken = tokenStore.getTokenBefore(node);
		if (prevToken.type === "Punctuator" && prevToken.value === ",") {
			yield fixer.removeRange([prevToken.range[0], node.range[1]]);
			return;
		}
		const [nextToken, nextNextToken] = tokenStore.getTokensAfter(node, { count: 2 });
		if (nextToken.type === "Punctuator" && nextToken.value === "," && (nextNextToken.type !== "Punctuator" || nextNextToken.value !== "]" && nextNextToken.value !== "}")) {
			yield fixer.removeRange([node.range[0], nextNextToken.range[0]]);
			return;
		}
		yield fixer.remove(node);
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "require static class names in template to be in a separate `class` attribute",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/prefer-separate-static-class.html"
			},
			fixable: "code",
			schema: [],
			messages: { preferSeparateStaticClass: "Static class \"{{className}}\" should be in a static `class` attribute." }
		},
		/** @param {RuleContext} context */
		create(context) {
			return defineTemplateBodyVisitor(context, { 
			/** @param {VDirectiveKey} directiveKeyNode */
"VAttribute[directive=true] > VDirectiveKey[name.name='bind'][argument.name='class']"(directiveKeyNode) {
				const attributeNode = directiveKeyNode.parent;
				if (!attributeNode.value || !attributeNode.value.expression) return;
				const expressionNode = attributeNode.value.expression;
				const staticClassNameNodes = findStaticClasses(expressionNode);
				for (const staticClassNameNode of staticClassNameNodes) {
					const className = getStaticClassName(staticClassNameNode);
					if (className === null) continue;
					context.report({
						node: staticClassNameNode,
						messageId: "preferSeparateStaticClass",
						data: { className },
						*fix(fixer) {
							if (staticClassNameNode.type === "TemplateElement") return;
							let isDynamicClassDirectiveRemoved = false;
							yield* removeFromClassDirective();
							yield* addToClassAttribute();
							/**
							* Remove class from dynamic `:class` directive.
							*/
							function* removeFromClassDirective() {
								if (isStringLiteral(expressionNode)) {
									yield fixer.remove(attributeNode);
									isDynamicClassDirectiveRemoved = true;
									return;
								}
								const listElement = staticClassNameNode.parent.type === "Property" ? staticClassNameNode.parent : staticClassNameNode;
								const listNode = listElement.parent;
								if (listNode.type === "ArrayExpression" || listNode.type === "ObjectExpression") {
									const elements = listNode.type === "ObjectExpression" ? listNode.properties : listNode.elements;
									if (elements.length === 1 && listNode === expressionNode) {
										yield fixer.remove(attributeNode);
										isDynamicClassDirectiveRemoved = true;
										return;
									}
									const tokenStore = context.sourceCode.parserServices.getTemplateBodyTokenStore();
									if (elements.length === 1) {
										yield* removeNodeWithComma(fixer, tokenStore, listNode);
										return;
									}
									yield* removeNodeWithComma(fixer, tokenStore, listElement);
								}
							}
							/**
							* Add class to static `class` attribute.
							*/
							function* addToClassAttribute() {
								const existingStaticClassAttribute = attributeNode.parent.attributes.find(isStaticClassAttribute);
								if (existingStaticClassAttribute) {
									const literalNode = existingStaticClassAttribute.value;
									yield fixer.replaceText(literalNode, `"${literalNode.value} ${className}"`);
									return;
								}
								const separator = isDynamicClassDirectiveRemoved ? "" : " ";
								yield fixer.insertTextBefore(attributeNode, `class="${className}"${separator}`);
							}
						}
					});
				}
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_prefer_separate_static_class();
	}
});
fڽx-const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
let _eslint_community_eslint_utils = require("@eslint-community/eslint-utils");
//#region lib/rules/prefer-single-event-payload.ts
/**
* @author Flo Edelmann
* See LICENSE file in root directory for full license.
*/
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
/**
* Get the callee member node from the given CallExpression
*/
function getCalleeMemberNode(node) {
	const callee = import_utils.default.skipChainExpression(node.callee);
	if (callee.type === "MemberExpression") {
		const name = import_utils.default.getStaticPropertyName(callee);
		if (name) return {
			name,
			member: callee
		};
	}
	return null;
}
function getReportLocation(parameters, firstReportedIndex) {
	if (parameters.length < firstReportedIndex + 1) return;
	return {
		start: parameters[firstReportedIndex].loc.start,
		end: parameters.at(-1).loc.end
	};
}
var prefer_single_event_payload_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "enforce passing a single argument to custom event emissions",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/prefer-single-event-payload.html"
		},
		fixable: null,
		hasSuggestions: false,
		schema: [],
		messages: {
			preferSinglePayload: "Pass a single payload object instead of multiple arguments when emitting the \"{{name}}\" event.",
			preferSinglePayloadInDeclaration: "Declare a single payload parameter instead of multiple parameters for the \"{{name}}\" event."
		}
	},
	create(context) {
		const setupContexts = /* @__PURE__ */ new Map();
		function verifyEmitCall(node) {
			if (node.arguments.length <= 2) return;
			const eventNameArg = node.arguments[0];
			const name = import_utils.default.isStringLiteral(eventNameArg) ? import_utils.default.getStringLiteralValue(eventNameArg) : null;
			context.report({
				node,
				loc: getReportLocation(node.arguments, 2),
				messageId: "preferSinglePayload",
				data: { name: name ?? "unknown" }
			});
		}
		function verifyEmitDeclarationNode(emit, parameters, firstReportedIndex = 1) {
			const reportLocation = getReportLocation(parameters, firstReportedIndex);
			if (reportLocation) context.report({
				node: emit.node,
				loc: reportLocation,
				messageId: "preferSinglePayloadInDeclaration",
				data: { name: emit.emitName ?? "unknown" }
			});
		}
		function verifyEmitDeclaration(emit) {
			if (emit.type === "object") {
				if (emit.value.type === "ArrowFunctionExpression" || emit.value.type === "FunctionExpression") verifyEmitDeclarationNode(emit, emit.value.params);
			} else if (emit.type === "type") switch (emit.node.type) {
				case "TSCallSignatureDeclaration":
				case "TSFunctionType":
					verifyEmitDeclarationNode(emit, emit.node.params, 2);
					break;
				case "TSPropertySignature": {
					const typeAnno = emit.node.typeAnnotation?.typeAnnotation;
					if (typeAnno?.type === "TSTupleType") verifyEmitDeclarationNode(emit, typeAnno.elementTypes);
					break;
				}
				case "TSMethodSignature":
					verifyEmitDeclarationNode(emit, emit.node.params);
					break;
			}
		}
		return import_utils.default.defineTemplateBodyVisitor(context, { CallExpression(node) {
			const callee = import_utils.default.skipChainExpression(node.callee);
			const setupContext = setupContexts.get(context.sourceCode.ast);
			if (callee.type === "Identifier" && (callee.name === "$emit" || setupContext && [...setupContext.emitReferenceIds].some((id) => id.name === callee.name))) verifyEmitCall(node);
		} }, import_utils.default.compositingVisitors(import_utils.default.defineScriptSetupVisitor(context, {
			onDefineEmitsEnter(node, emits) {
				for (const emit of emits) verifyEmitDeclaration(emit);
				if (!node.parent || node.parent.type !== "VariableDeclarator" || node.parent.init !== node) return;
				const emitParam = node.parent.id;
				if (emitParam.type !== "Identifier") return;
				const variable = (0, _eslint_community_eslint_utils.findVariable)(import_utils.default.getScope(context, emitParam), emitParam);
				if (!variable) return;
				const emitReferenceIds = /* @__PURE__ */ new Set();
				for (const reference of variable.references) {
					if (!reference.isRead()) continue;
					emitReferenceIds.add(reference.identifier);
				}
				const programNode = context.sourceCode.ast;
				setupContexts.set(programNode, {
					contextReferenceIds: /* @__PURE__ */ new Set(),
					emitReferenceIds
				});
			},
			CallExpression(node) {
				const callee = import_utils.default.skipChainExpression(node.callee);
				const programNode = context.sourceCode.ast;
				const setupContext = setupContexts.get(programNode);
				if (setupContext && callee.type === "Identifier" && setupContext.emitReferenceIds.has(callee)) verifyEmitCall(node);
			}
		}), import_utils.default.executeOnVue(context, (obj) => {
			for (const emit of import_utils.default.getComponentEmitsFromOptions(obj)) verifyEmitDeclaration(emit);
		}), import_utils.default.defineVueVisitor(context, {
			onSetupFunctionEnter(node, { node: vueNode }) {
				const contextParam = import_utils.default.skipDefaultParamValue(node.params[1]);
				if (!contextParam) return;
				if (contextParam.type === "RestElement" || contextParam.type === "ArrayPattern") return;
				const contextReferenceIds = /* @__PURE__ */ new Set();
				const emitReferenceIds = /* @__PURE__ */ new Set();
				if (contextParam.type === "ObjectPattern") {
					const emitProperty = import_utils.default.findAssignmentProperty(contextParam, "emit");
					if (!emitProperty || emitProperty.value.type !== "Identifier") return;
					const emitParam = emitProperty.value;
					const variable = (0, _eslint_community_eslint_utils.findVariable)(import_utils.default.getScope(context, emitParam), emitParam);
					if (!variable) return;
					for (const reference of variable.references) emitReferenceIds.add(reference.identifier);
				} else {
					const variable = (0, _eslint_community_eslint_utils.findVariable)(import_utils.default.getScope(context, contextParam), contextParam);
					if (!variable) return;
					for (const reference of variable.references) contextReferenceIds.add(reference.identifier);
				}
				setupContexts.set(vueNode, {
					contextReferenceIds,
					emitReferenceIds
				});
			},
			CallExpression(node, { node: vueNode }) {
				const callee = import_utils.default.skipChainExpression(node.callee);
				const setupContext = setupContexts.get(vueNode);
				if (setupContext) {
					const { contextReferenceIds, emitReferenceIds } = setupContext;
					if (callee.type === "Identifier" && emitReferenceIds.has(callee)) verifyEmitCall(node);
					else {
						const emit = getCalleeMemberNode(node);
						if (emit && emit.name === "emit" && emit.member.object.type === "Identifier" && contextReferenceIds.has(emit.member.object)) verifyEmitCall(node);
					}
				}
			},
			onVueObjectExit(node) {
				setupContexts.delete(node);
			}
		}), { CallExpression(node) {
			const emit = getCalleeMemberNode(node);
			if (emit && emit.name === "$emit") verifyEmitCall(node);
		} }));
	}
};
//#endregion
exports.default = prefer_single_event_payload_default;
q#x:"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/prefer-template.js
/**
* @author Yosuke Ota
*/
var require_prefer_template = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapCoreRule } = require_index.default;
	module.exports = wrapCoreRule("prefer-template", { applyDocument: true });
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_prefer_template();
	}
});
vũxconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_regexp = require("../utils/regexp.js");
//#region lib/rules/prefer-true-attribute-shorthand.ts
/**
* @author Pig Fang
* See LICENSE file in root directory for full license.
*/
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
function getAttributeName(node) {
	if (!node.directive) return node.key.rawName;
	if ((node.key.name.name === "bind" || node.key.name.name === "model") && node.key.argument && node.key.argument.type === "VIdentifier") return node.key.argument.rawName;
	return null;
}
function shouldConvertToLongForm(node, isExcepted, option) {
	return !node.directive && !node.value && (option === "always" ? isExcepted : !isExcepted);
}
function shouldConvertToShortForm(node, isExcepted, option) {
	return node.directive && node.value?.expression?.type === "Literal" && node.value.expression.value === true && Boolean(node.key.argument) && (option === "always" ? !isExcepted : isExcepted);
}
var prefer_true_attribute_shorthand_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "require shorthand form attribute when `v-bind` value is `true`",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/prefer-true-attribute-shorthand.html"
		},
		fixable: null,
		hasSuggestions: true,
		schema: [{ enum: ["always", "never"] }, {
			type: "object",
			properties: { except: {
				type: "array",
				items: { type: "string" },
				uniqueItems: true
			} },
			additionalProperties: false
		}],
		messages: {
			expectShort: "Boolean prop with 'true' value should be written in shorthand form.",
			expectLong: "Boolean prop with 'true' value should be written in long form.",
			rewriteIntoShort: "Rewrite this prop into shorthand form.",
			rewriteIntoLongVueProp: "Rewrite this prop into long-form Vue component prop.",
			rewriteIntoLongHtmlAttr: "Rewrite this prop into long-form HTML attribute."
		}
	},
	create(context) {
		const option = context.options[0] || "always";
		const exceptMatcher = require_regexp.toRegExpGroupMatcher(context.options[1]?.except);
		function reportLongForm(node, messageId, longVuePropText, longHtmlAttrText) {
			context.report({
				node,
				messageId,
				suggest: [{
					messageId: "rewriteIntoLongVueProp",
					fix: (fixer) => fixer.replaceText(node, longVuePropText)
				}, {
					messageId: "rewriteIntoLongHtmlAttr",
					fix: (fixer) => fixer.replaceText(node, longHtmlAttrText)
				}]
			});
		}
		function reportShortForm(node, messageId, shortFormText) {
			context.report({
				node,
				messageId,
				suggest: [{
					messageId: "rewriteIntoShort",
					fix: (fixer) => fixer.replaceText(node, shortFormText)
				}]
			});
		}
		return import_utils.default.defineTemplateBodyVisitor(context, { VAttribute(node) {
			if (!import_utils.default.isCustomComponent(node.parent.parent)) return;
			const name = getAttributeName(node);
			if (name === null) return;
			const isExcepted = exceptMatcher(name);
			if (shouldConvertToLongForm(node, isExcepted, option)) {
				const key = node.key;
				reportLongForm(node, "expectLong", `:${key.rawName}="true"`, `${key.rawName}="${key.rawName}"`);
			} else if (shouldConvertToShortForm(node, isExcepted, option)) {
				const directiveKey = node.key;
				if (directiveKey.argument && directiveKey.argument.type === "VIdentifier") reportShortForm(node, "expectShort", directiveKey.argument.rawName);
			}
		} });
	}
};
//#endregion
exports.default = prefer_true_attribute_shorthand_default;
Cx
"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/prefer-use-template-ref.js
/**
* @author Thomasan1999
* See LICENSE file in root directory for full license.
*/
var require_prefer_use_template_ref = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef ScriptRef
	* @type {[string, CallExpression]}
	*/
	/**
	* @param body {(Statement | ModuleDeclaration)[]}
	* @returns {ScriptRef[]}
	* */
	function getScriptRefsFromSetupFunction(body) {
		return body.flatMap((child) => {
			if (child.type === "VariableDeclaration") {
				const declarator = child.declarations[0];
				if (declarator.init?.type === "CallExpression" && declarator.init.callee?.type === "Identifier" && declarator.id.type === "Identifier" && ["ref", "shallowRef"].includes(declarator.init.callee.name)) return [[declarator.id.name, declarator.init]];
			}
			return [];
		});
	}
	/** @type {import("eslint").Rule.RuleModule} */
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "require using `useTemplateRef` instead of `ref`/`shallowRef` for template refs",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/prefer-use-template-ref.html"
			},
			schema: [],
			messages: { preferUseTemplateRef: "Replace '{{name}}' with 'useTemplateRef'." }
		},
		/** @param {RuleContext} context */
		create(context) {
			/** @type Set<string> */
			const templateRefs = /* @__PURE__ */ new Set();
			/**
			* @type ScriptRef[] */
			const scriptRefs = [];
			return utils.compositingVisitors(utils.defineTemplateBodyVisitor(context, { "VAttribute[directive=false]"(node) {
				if (node.key.name === "ref" && node.value?.value) templateRefs.add(node.value.value);
			} }), utils.defineVueVisitor(context, { onSetupFunctionEnter(node) {
				if (node.type === "ArrowFunctionExpression" && node.expression) return;
				const newScriptRefs = getScriptRefsFromSetupFunction(node.body.body);
				scriptRefs.push(...newScriptRefs);
			} }), utils.defineScriptSetupVisitor(context, { Program(node) {
				const newScriptRefs = getScriptRefsFromSetupFunction(node.body);
				scriptRefs.push(...newScriptRefs);
			} }), { "Program:exit"() {
				const scriptRefsMap = new Map(scriptRefs);
				for (const templateRef of templateRefs) {
					const scriptRef = scriptRefsMap.get(templateRef);
					if (!scriptRef) continue;
					context.report({
						node: scriptRef,
						messageId: "preferUseTemplateRef",
						data: { name: scriptRef.callee.name }
					});
				}
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_prefer_use_template_ref();
	}
});
ugޱx~const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
//#region lib/rules/prefer-v-model.ts
/**
* @author Flo Edelmann
* See LICENSE file in root directory for full license.
*/
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
/**
* Get the static argument name of a directive, or `null` for dynamic arguments.
*/
const getStaticArgName = (directive) => directive.key.argument?.type === "VIdentifier" ? directive.key.argument.rawName : null;
/**
* Extract the prop name from an `update:propName` event directive argument.
*/
function getUpdateEventPropName(onDirective) {
	const argName = getStaticArgName(onDirective);
	if (!argName?.startsWith("update:")) return null;
	return argName.slice(7);
}
/**
* Check if the event handler is a simple mirror assignment of the bind expression.
* Matches: `bar = $event` or `(param) => bar = param`
*/
function isMirrorAssignment(bindExpr, onExpr, sourceCode) {
	const bindText = sourceCode.getText(bindExpr);
	if (onExpr.type === "VOnExpression") {
		const statements = onExpr.body;
		if (statements.length !== 1) return false;
		const stmt = statements[0];
		if (stmt.type !== "ExpressionStatement") return false;
		const expr = stmt.expression;
		if (expr.type !== "AssignmentExpression" || expr.operator !== "=") return false;
		return sourceCode.getText(expr.left) === bindText && expr.right.type === "Identifier" && expr.right.name === "$event";
	}
	if (onExpr.type === "ArrowFunctionExpression") {
		if (onExpr.params.length !== 1) return false;
		const param = onExpr.params[0];
		if (param.type !== "Identifier") return false;
		const body = onExpr.body;
		if (body.type !== "AssignmentExpression" || body.operator !== "=") return false;
		return sourceCode.getText(body.left) === bindText && body.right.type === "Identifier" && body.right.name === param.name;
	}
	return false;
}
var prefer_v_model_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "enforce using `v-model` instead of `:prop`/`@update:prop` pair",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/prefer-v-model.html"
		},
		fixable: null,
		hasSuggestions: true,
		schema: [],
		messages: {
			preferVModel: "Prefer `{{ vModelName }}` over the `:{{ propName }}`/`@update:{{ eventName }}` pair.",
			replaceWithVModel: "Replace with `{{ vModelName }}`."
		}
	},
	create(context) {
		const sourceCode = context.sourceCode;
		return import_utils.default.defineTemplateBodyVisitor(context, { VStartTag(node) {
			const element = node.parent;
			if (!import_utils.default.isCustomComponent(element)) return;
			const bindDirectives = [];
			const onDirectives = [];
			for (const attr of node.attributes) {
				if (!attr.directive) continue;
				if (attr.key.name.name === "bind" && getStaticArgName(attr) != null && attr.key.modifiers.length === 0) bindDirectives.push(attr);
				if (attr.key.name.name === "on" && getUpdateEventPropName(attr) != null && attr.key.modifiers.length === 0) onDirectives.push(attr);
			}
			for (const bindDir of bindDirectives) {
				const propName = getStaticArgName(bindDir);
				if (!propName) continue;
				const normalizedBindName = require_casing.camelCase(propName);
				const matchingOnDir = onDirectives.find((onDir) => require_casing.camelCase(getUpdateEventPropName(onDir)) === normalizedBindName);
				if (!matchingOnDir) continue;
				const bindExpr = bindDir.value?.expression;
				const onExpr = matchingOnDir.value?.expression;
				if (!bindExpr || bindExpr.type === "VFilterSequenceExpression" || bindExpr.type === "VForExpression" || bindExpr.type === "VOnExpression" || bindExpr.type === "VSlotScopeExpression" || !onExpr || !isMirrorAssignment(bindExpr, onExpr, sourceCode)) continue;
				const vModelName = normalizedBindName === "modelValue" ? "v-model" : `v-model:${propName}`;
				const eventName = getUpdateEventPropName(matchingOnDir) ?? propName;
				const vModelText = `${vModelName}=${sourceCode.getText(bindDir.value)}`;
				context.report({
					node: bindDir,
					messageId: "preferVModel",
					data: {
						vModelName,
						propName,
						eventName
					},
					suggest: [{
						messageId: "replaceWithVModel",
						data: { vModelName },
						*fix(fixer) {
							yield fixer.replaceText(bindDir, vModelText);
							const textBefore = sourceCode.getText().slice(0, matchingOnDir.range[0]);
							const removeStart = matchingOnDir.range[0] - (textBefore.length - textBefore.trimEnd().length);
							yield fixer.removeRange([removeStart, matchingOnDir.range[1]]);
						}
					}]
				});
			}
		} });
	}
};
//#endregion
exports.default = prefer_v_model_default;
t$̻|x4const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
const require_regexp = require("../utils/regexp.js");
//#region lib/rules/prop-name-casing.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
const allowedCaseOptions = ["camelCase", "snake_case"];
function create(context) {
	const options = context.options[0];
	const isIgnoredProp = require_regexp.toRegExpGroupMatcher(context.options[1]?.ignoreProps);
	const caseType = allowedCaseOptions.includes(options) ? options : "camelCase";
	const checker = require_casing.getChecker(caseType);
	function processProps(props) {
		for (const item of props) {
			const propName = item.propName;
			if (propName == null) continue;
			if (!checker(propName) && !isIgnoredProp(propName)) context.report({
				node: item.node,
				messageId: "invalidCase",
				data: {
					name: propName,
					caseType
				}
			});
		}
	}
	return import_utils.default.compositingVisitors(import_utils.default.defineScriptSetupVisitor(context, { onDefinePropsEnter(_node, props) {
		processProps(props);
	} }), import_utils.default.executeOnVue(context, (obj) => {
		processProps(import_utils.default.getComponentPropsFromOptions(obj));
	}));
}
var prop_name_casing_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "enforce specific casing for the Prop name in Vue components",
			categories: ["vue3-strongly-recommended", "vue2-strongly-recommended"],
			url: "https://eslint.vuejs.org/rules/prop-name-casing.html"
		},
		fixable: null,
		schema: [{ enum: allowedCaseOptions }, {
			type: "object",
			properties: { ignoreProps: {
				type: "array",
				items: { type: "string" },
				uniqueItems: true
			} },
			additionalProperties: false
		}],
		messages: { invalidCase: "Prop \"{{name}}\" is not in {{caseType}}." }
	},
	create
};
//#endregion
exports.default = prop_name_casing_default;
ngxr"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/quote-props.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_quote_props = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapStylisticOrCoreRule, flatten } = require_index.default;
	module.exports = wrapStylisticOrCoreRule("quote-props", {
		skipDynamicArguments: true,
		preprocess(context, { wrapContextToOverrideProperties, defineVisitor }) {
			const sourceCode = context.sourceCode;
			/**
			* @type {'"' | "'" | null}
			*/
			let htmlQuote = null;
			defineVisitor({
				/** @param {VExpressionContainer} node */
				"VAttribute > VExpressionContainer.value"(node) {
					const firstChar = sourceCode.getText(node)[0];
					htmlQuote = firstChar === "'" || firstChar === "\"" ? firstChar : null;
				},
				"VAttribute > VExpressionContainer.value:exit"() {
					htmlQuote = null;
				}
			});
			wrapContextToOverrideProperties({ report(descriptor) {
				if (htmlQuote) {
					const expectedQuote = htmlQuote === "\"" ? "'" : "\"";
					context.report({
						...descriptor,
						*fix(fixer) {
							const fixes = flatten(descriptor.fix && descriptor.fix(fixer));
							for (const fix of fixes) yield fixer.replaceTextRange(fix.range, fix.text.replaceAll(/["']/gu, () => expectedQuote));
						}
					});
				} else context.report(descriptor);
			} });
		}
	});
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_quote_props();
	}
});
TxD"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/require-component-is.js
/**
* @author Toru Nagashima
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_require_component_is = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "require `v-bind:is` of `<component>` elements",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/require-component-is.html"
			},
			fixable: null,
			schema: [],
			messages: { requireComponentIs: "Expected '<component>' elements to have 'v-bind:is' attribute." }
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VElement} node */
"VElement[name='component']"(node) {
				if (!utils.hasDirective(node, "bind", "is")) context.report({
					node,
					loc: node.loc,
					messageId: "requireComponentIs"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_require_component_is();
	}
});
'[9rx+"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/require-default-export.js
/**
* @author ItMaga
* See LICENSE file in root directory for full license.
*/
var require_require_default_export = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "require components to be the default export",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/require-default-export.html"
			},
			fixable: null,
			schema: [],
			messages: {
				missing: "Missing default export.",
				mustBeDefaultExport: "Component must be the default export."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const documentFragment = context.sourceCode.parserServices.getDocumentFragment?.();
			const hasScript = documentFragment && documentFragment.children.some((e) => utils.isVElement(e) && e.name === "script");
			if (utils.isScriptSetup(context) || !hasScript) return {};
			let hasDefaultExport = false;
			let hasDefinedComponent = false;
			return utils.compositingVisitors(utils.defineVueVisitor(context, { onVueObjectExit() {
				hasDefinedComponent = true;
			} }), {
				"Program > ExportDefaultDeclaration"() {
					hasDefaultExport = true;
				},
				/**
				* @param {Program} node
				*/
				"Program:exit"(node) {
					if (!hasDefaultExport && node.body.length > 0) context.report({
						loc: node.tokens.at(-1).loc,
						messageId: hasDefinedComponent ? "mustBeDefaultExport" : "missing"
					});
				}
			});
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_require_default_export();
	}
});
OVx"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/require-default-prop.js
/**
* @fileoverview Require default value for props
* @author Michał Sajnóg <msajnog93@gmail.com> (https://github.com/michalsnik)
*/
var require_require_default_prop = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	/**
	* @typedef {import('../utils').ComponentProp} ComponentProp
	* @typedef {import('../utils').ComponentObjectProp} ComponentObjectProp
	* @typedef {import('../utils').ComponentTypeProp} ComponentTypeProp
	* @typedef {ComponentObjectProp & { value: ObjectExpression} } ComponentObjectPropObject
	*/
	const utils = require_index.default;
	const { isDef } = require_index.default;
	const NATIVE_TYPES = /* @__PURE__ */ new Set([
		"String",
		"Number",
		"Boolean",
		"Function",
		"Object",
		"Array",
		"Symbol"
	]);
	/**
	* Detects whether given value node is a Boolean type
	* @param {Expression} value
	* @return {boolean}
	*/
	function isValueNodeOfBooleanType(value) {
		if (value.type === "Identifier" && value.name === "Boolean") return true;
		if (value.type === "ArrayExpression") {
			const elements = value.elements.filter(isDef);
			return elements.length === 1 && elements[0].type === "Identifier" && elements[0].name === "Boolean";
		}
		return false;
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "require default value for props",
				categories: ["vue3-strongly-recommended", "vue2-strongly-recommended"],
				url: "https://eslint.vuejs.org/rules/require-default-prop.html"
			},
			fixable: null,
			schema: [],
			messages: { missingDefault: `Prop '{{propName}}' requires default value to be set.` }
		},
		/** @param {RuleContext} context */
		create(context) {
			/**
			* Checks if the passed prop is required
			* @param {ObjectExpression} propValue - ObjectExpression AST node for a single prop
			* @return {boolean}
			*/
			function propIsRequired(propValue) {
				const propRequiredNode = propValue.properties.find((p) => p.type === "Property" && utils.getStaticPropertyName(p) === "required" && p.value.type === "Literal" && p.value.value === true);
				return Boolean(propRequiredNode);
			}
			/**
			* Checks if the passed prop has a default value
			* @param {ObjectExpression} propValue - ObjectExpression AST node for a single prop
			* @return {boolean}
			*/
			function propHasDefault(propValue) {
				const propDefaultNode = propValue.properties.find((p) => p.type === "Property" && utils.getStaticPropertyName(p) === "default");
				return Boolean(propDefaultNode);
			}
			/**
			* Checks whether the given props that don't have a default value
			* @param {ComponentObjectProp} prop Vue component's "props" node
			* @return {boolean}
			*/
			function isWithoutDefaultValue(prop) {
				if (prop.value.type !== "ObjectExpression") {
					if (prop.value.type === "Identifier") return NATIVE_TYPES.has(prop.value.name);
					return prop.value.type !== "CallExpression" && prop.value.type !== "MemberExpression";
				}
				return !propIsRequired(prop.value) && !propHasDefault(prop.value);
			}
			/**
			* Detects whether given prop node is a Boolean
			* @param {ComponentObjectProp} prop
			* @return {Boolean}
			*/
			function isBooleanProp(prop) {
				const value = utils.skipTSAsExpression(prop.value);
				return isValueNodeOfBooleanType(value) || value.type === "ObjectExpression" && value.properties.some((p) => p.type === "Property" && p.key.type === "Identifier" && p.key.name === "type" && isValueNodeOfBooleanType(p.value));
			}
			/**
			* @param {ComponentProp[]} props
			* @param {(prop: ComponentObjectProp|ComponentTypeProp)=>boolean} [ignore]
			*/
			function processProps(props, ignore) {
				for (const prop of props) if (prop.type === "object") {
					if (prop.node.shorthand) continue;
					if (!isWithoutDefaultValue(prop)) continue;
					if (isBooleanProp(prop)) continue;
					if (ignore?.(prop)) continue;
					const propName = prop.propName ?? `[${context.sourceCode.getText(prop.node.key)}]`;
					context.report({
						node: prop.node,
						messageId: `missingDefault`,
						data: { propName }
					});
				} else if (prop.type === "type") {
					if (prop.required) continue;
					if (prop.types.length === 1 && prop.types[0] === "Boolean") continue;
					if (ignore?.(prop)) continue;
					context.report({
						node: prop.node,
						messageId: `missingDefault`,
						data: { propName: prop.propName }
					});
				}
			}
			return utils.compositingVisitors(utils.defineScriptSetupVisitor(context, { onDefinePropsEnter(node, props) {
				const hasWithDefaults = utils.hasWithDefaults(node);
				const defaultsByWithDefaults = utils.getWithDefaultsPropExpressions(node);
				const isUsingPropsDestructure = utils.isUsingPropsDestructure(node);
				const defaultsByAssignmentPatterns = utils.getDefaultPropExpressionsForPropsDestructure(node);
				processProps(props, (prop) => {
					if (prop.type === "type") {
						if (!hasWithDefaults && !isUsingPropsDestructure) return true;
						if (defaultsByWithDefaults[prop.propName]) return true;
					}
					if (!isUsingPropsDestructure) return false;
					if (prop.propName == null) return true;
					return Boolean(defaultsByAssignmentPatterns[prop.propName]);
				});
			} }), utils.executeOnVue(context, (obj) => {
				processProps(utils.getComponentPropsFromOptions(obj));
			}));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_require_default_prop();
	}
});
2xi"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/require-direct-export.js
/**
* @fileoverview require the component to be directly exported
* @author Hiroki Osame <hiroki.osame@gmail.com>
*/
var require_require_direct_export = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "require the component to be directly exported",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/require-direct-export.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: { disallowFunctionalComponentFunction: { type: "boolean" } },
				additionalProperties: false
			}],
			messages: { expectedDirectExport: "Expected the component literal to be directly exported." }
		},
		/** @param {RuleContext} context */
		create(context) {
			const filePath = context.filename;
			if (!utils.isVueFile(filePath)) return {};
			const disallowFunctional = (context.options[0] || {}).disallowFunctionalComponentFunction;
			/**
			* @typedef {object} ScopeStack
			* @property {ScopeStack | null} upper
			* @property {boolean} withinVue3FunctionalBody
			*/
			/** @type { { body: BlockStatement, hasReturnArgument: boolean } } */
			let maybeVue3Functional;
			/** @type {ScopeStack | null} */
			let scopeStack = null;
			return {
				/** @param {Declaration | Expression} node */
				"ExportDefaultDeclaration > *"(node) {
					if (node.type === "ObjectExpression") return;
					if (node.type === "CallExpression") {
						const { callee } = node;
						const [firstArg] = node.arguments;
						if (firstArg && firstArg.type === "ObjectExpression" && (callee.type === "Identifier" && callee.name === "defineComponent" || callee.type === "MemberExpression" && callee.object.type === "Identifier" && callee.object.name === "Vue" && callee.property.type === "Identifier" && callee.property.name === "extend")) return;
					}
					if (!disallowFunctional) {
						if (node.type === "ArrowFunctionExpression") {
							if (node.body.type !== "BlockStatement") return;
							maybeVue3Functional = {
								body: node.body,
								hasReturnArgument: false
							};
							return;
						}
						if (node.type === "FunctionExpression" || node.type === "FunctionDeclaration") {
							maybeVue3Functional = {
								body: node.body,
								hasReturnArgument: false
							};
							return;
						}
					}
					context.report({
						node: node.parent,
						messageId: "expectedDirectExport"
					});
				},
				...disallowFunctional ? {} : {
					/** @param {BlockStatement} node */
					":function > BlockStatement"(node) {
						if (!maybeVue3Functional) return;
						scopeStack = {
							upper: scopeStack,
							withinVue3FunctionalBody: maybeVue3Functional.body === node
						};
					},
					/** @param {ReturnStatement} node */
					ReturnStatement(node) {
						if (scopeStack && scopeStack.withinVue3FunctionalBody && node.argument) maybeVue3Functional.hasReturnArgument = true;
					},
					":function > BlockStatement:exit"() {
						scopeStack &&= scopeStack.upper;
					},
					/** @param {ExportDefaultDeclaration} node */
					"ExportDefaultDeclaration:exit"(node) {
						if (!maybeVue3Functional) return;
						if (!maybeVue3Functional.hasReturnArgument) context.report({
							node,
							messageId: "expectedDirectExport"
						});
					}
				}
			};
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_require_direct_export();
	}
});
x	"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/require-emit-validator.js
/**
* @fileoverview Emit definitions should be detailed
* @author Pig Fang
*/
var require_require_emit_validator = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef {import('../utils').ComponentEmit} ComponentEmit
	*/
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "require type definitions in emits",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/require-emit-validator.html"
			},
			fixable: null,
			hasSuggestions: true,
			schema: [],
			messages: {
				missing: "Emit \"{{name}}\" should define at least its validator function.",
				skipped: "Emit \"{{name}}\" should not skip validation, or you may define a validator function with no parameters.",
				emptyValidation: "Replace with a validator function with no parameters."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			/**
			* @param {ComponentEmit} emit
			*/
			function checker(emit) {
				/** @type {Expression|null} */
				let value = null;
				let hasType = false;
				if (emit.type === "object") {
					value = emit.value;
					hasType = [
						"ArrowFunctionExpression",
						"FunctionExpression",
						"Identifier"
					].includes(value.type);
				} else if (emit.type !== "array") return;
				if (!hasType) {
					const { node, emitName } = emit;
					const name = emitName || node.type === "Identifier" && node.name || "Unknown emit";
					if (value && value.type === "Literal" && value.value === null) {
						const valueNode = value;
						context.report({
							node,
							messageId: "skipped",
							data: { name },
							suggest: [{
								messageId: "emptyValidation",
								fix: (fixer) => fixer.replaceText(valueNode, "() => true")
							}]
						});
						return;
					}
					context.report({
						node,
						messageId: "missing",
						data: { name }
					});
				}
			}
			return utils.compositingVisitors(utils.executeOnVue(context, (obj) => {
				for (const emit of utils.getComponentEmitsFromOptions(obj)) checker(emit);
			}), utils.defineScriptSetupVisitor(context, { onDefineEmitsEnter(_node, emits) {
				for (const emit of emits) checker(emit);
			} }));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_require_emit_validator();
	}
});
 xI1const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
let _eslint_community_eslint_utils = require("@eslint-community/eslint-utils");
//#region lib/rules/require-explicit-emits.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
const FIX_EMITS_AFTER_OPTIONS = /* @__PURE__ */ new Set([
	"setup",
	"data",
	"computed",
	"watch",
	"methods",
	"template",
	"render",
	"renderError",
	"beforeCreate",
	"created",
	"beforeMount",
	"mounted",
	"beforeUpdate",
	"updated",
	"activated",
	"deactivated",
	"beforeUnmount",
	"unmounted",
	"beforeDestroy",
	"destroyed",
	"renderTracked",
	"renderTriggered",
	"errorCaptured"
]);
/**
* Get the name param node from the given CallExpression
*/
function getNameParamNode(node) {
	const nameLiteralNode = node.arguments[0];
	if (nameLiteralNode && import_utils.default.isStringLiteral(nameLiteralNode)) {
		const name = import_utils.default.getStringLiteralValue(nameLiteralNode);
		if (name != null) return {
			name,
			loc: nameLiteralNode.loc,
			range: nameLiteralNode.range
		};
	}
	return null;
}
var require_explicit_emits_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "require `emits` option with name triggered by `$emit()`",
			categories: ["vue3-strongly-recommended"],
			url: "https://eslint.vuejs.org/rules/require-explicit-emits.html"
		},
		fixable: null,
		hasSuggestions: true,
		schema: [{
			type: "object",
			properties: { allowProps: { type: "boolean" } },
			additionalProperties: false
		}],
		messages: {
			missing: "The \"{{name}}\" event has been triggered but not declared on {{emitsKind}}.",
			addOneOption: "Add the \"{{name}}\" to {{emitsKind}}.",
			addArrayEmitsOption: "Add the {{emitsKind}} with array syntax and define \"{{name}}\" event.",
			addObjectEmitsOption: "Add the {{emitsKind}} with object syntax and define \"{{name}}\" event."
		}
	},
	create(context) {
		const shouldAllowProps = !!(context.options[0] || {}).allowProps;
		const setupContexts = /* @__PURE__ */ new Map();
		const vueEmitsDeclarations = /* @__PURE__ */ new Map();
		const vuePropsDeclarations = /* @__PURE__ */ new Map();
		let emitParamName = "";
		let vueTemplateDefineData = null;
		function verifyEmit(emits, props, nameWithLoc, vueDefineNode) {
			const name = nameWithLoc.name;
			if (emits.some((e) => e.emitName === name || e.emitName == null)) return;
			if (shouldAllowProps) {
				const key = `on${require_casing.capitalize(name)}`;
				if (props.some((e) => e.propName === key || e.propName == null)) return;
			}
			context.report({
				loc: nameWithLoc.loc,
				messageId: "missing",
				data: {
					name,
					emitsKind: vueDefineNode.type === "ObjectExpression" ? "`emits` option" : "`defineEmits`"
				},
				suggest: buildSuggest(vueDefineNode, emits, nameWithLoc, context)
			});
		}
		const programNode = context.sourceCode.ast;
		if (import_utils.default.isScriptSetup(context)) vueTemplateDefineData = {
			type: "setup",
			define: programNode,
			emits: [],
			props: []
		};
		const callVisitor = { CallExpression(node, info) {
			const callee = import_utils.default.skipChainExpression(node.callee);
			const nameWithLoc = getNameParamNode(node);
			if (!nameWithLoc) return;
			const vueDefineNode = info ? info.node : programNode;
			const emitsDeclarations = vueEmitsDeclarations.get(vueDefineNode);
			if (!emitsDeclarations) return;
			let emit;
			if (callee.type === "MemberExpression") {
				const name = import_utils.default.getStaticPropertyName(callee);
				if (name === "emit" || name === "$emit") emit = {
					name,
					member: callee
				};
			}
			const setupContext = setupContexts.get(vueDefineNode);
			if (setupContext) {
				const { contextReferenceIds, emitReferenceIds } = setupContext;
				if (callee.type === "Identifier" && emitReferenceIds.has(callee)) verifyEmit(emitsDeclarations, vuePropsDeclarations.get(vueDefineNode) || [], nameWithLoc, vueDefineNode);
				else if (emit && emit.name === "emit") {
					const memObject = import_utils.default.skipChainExpression(emit.member.object);
					if (memObject.type === "Identifier" && contextReferenceIds.has(memObject)) verifyEmit(emitsDeclarations, vuePropsDeclarations.get(vueDefineNode) || [], nameWithLoc, vueDefineNode);
				}
			}
			if (emit && emit.name === "$emit") {
				const memObject = import_utils.default.skipChainExpression(emit.member.object);
				if (import_utils.default.isThis(memObject, context)) verifyEmit(emitsDeclarations, vuePropsDeclarations.get(vueDefineNode) || [], nameWithLoc, vueDefineNode);
			}
		} };
		return import_utils.default.defineTemplateBodyVisitor(context, { CallExpression(node) {
			const callee = import_utils.default.skipChainExpression(node.callee);
			const nameWithLoc = getNameParamNode(node);
			if (!nameWithLoc) return;
			if (!vueTemplateDefineData) return;
			if (callee.type === "Identifier" && (callee.name === "$emit" || callee.name === emitParamName)) verifyEmit(vueTemplateDefineData.emits, vueTemplateDefineData.props, nameWithLoc, vueTemplateDefineData.define);
		} }, import_utils.default.compositingVisitors(import_utils.default.defineScriptSetupVisitor(context, {
			onDefineEmitsEnter(node, emits) {
				vueEmitsDeclarations.set(programNode, emits);
				if (vueTemplateDefineData && vueTemplateDefineData.type === "setup") {
					vueTemplateDefineData.emits = emits;
					vueTemplateDefineData.defineEmits = node;
				}
				if (!node.parent || node.parent.type !== "VariableDeclarator" || node.parent.init !== node) return;
				const emitParam = node.parent.id;
				if (emitParam.type !== "Identifier") return;
				emitParamName = emitParam.name;
				const variable = (0, _eslint_community_eslint_utils.findVariable)(import_utils.default.getScope(context, emitParam), emitParam);
				if (!variable) return;
				const emitReferenceIds = /* @__PURE__ */ new Set();
				for (const reference of variable.references) {
					if (!reference.isRead()) continue;
					emitReferenceIds.add(reference.identifier);
				}
				setupContexts.set(programNode, {
					contextReferenceIds: /* @__PURE__ */ new Set(),
					emitReferenceIds
				});
			},
			onDefinePropsEnter(_node, props) {
				if (!shouldAllowProps) return;
				vuePropsDeclarations.set(programNode, props);
				if (vueTemplateDefineData && vueTemplateDefineData.type === "setup") vueTemplateDefineData.props = props;
			},
			...callVisitor
		}), import_utils.default.defineVueVisitor(context, {
			onVueObjectEnter(node) {
				vueEmitsDeclarations.set(node, import_utils.default.getComponentEmitsFromOptions(node));
				if (shouldAllowProps) vuePropsDeclarations.set(node, import_utils.default.getComponentPropsFromOptions(node));
			},
			onSetupFunctionEnter(node, { node: vueNode }) {
				const contextParam = node.params[1];
				if (!contextParam) return;
				if (contextParam.type === "RestElement") return;
				if (contextParam.type === "ArrayPattern") return;
				const contextReferenceIds = /* @__PURE__ */ new Set();
				const emitReferenceIds = /* @__PURE__ */ new Set();
				if (contextParam.type === "ObjectPattern") {
					const emitProperty = import_utils.default.findAssignmentProperty(contextParam, "emit");
					if (!emitProperty) return;
					const emitParam = emitProperty.value;
					const variable = emitParam.type === "Identifier" ? (0, _eslint_community_eslint_utils.findVariable)(import_utils.default.getScope(context, emitParam), emitParam) : null;
					if (!variable) return;
					for (const reference of variable.references) {
						if (!reference.isRead()) continue;
						emitReferenceIds.add(reference.identifier);
					}
				} else if (contextParam.type === "Identifier") {
					const variable = (0, _eslint_community_eslint_utils.findVariable)(import_utils.default.getScope(context, contextParam), contextParam);
					if (!variable) return;
					for (const reference of variable.references) {
						if (!reference.isRead()) continue;
						contextReferenceIds.add(reference.identifier);
					}
				}
				setupContexts.set(vueNode, {
					contextReferenceIds,
					emitReferenceIds
				});
			},
			...callVisitor,
			onVueObjectExit(node, { type }) {
				const emits = vueEmitsDeclarations.get(node);
				if ((!vueTemplateDefineData || vueTemplateDefineData.type !== "export" && vueTemplateDefineData.type !== "setup") && emits && (type === "mark" || type === "export" || type === "definition")) vueTemplateDefineData = {
					type,
					define: node,
					emits,
					props: vuePropsDeclarations.get(node) || []
				};
				setupContexts.delete(node);
				vueEmitsDeclarations.delete(node);
				vuePropsDeclarations.delete(node);
			}
		})));
	}
};
function buildSuggest(define, emits, nameWithLoc, context) {
	const emitsKind = define.type === "ObjectExpression" ? "`emits` option" : "`defineEmits`";
	const lastEmit = emits.filter((e) => e.type === "array" || e.type === "object").at(-1);
	if (lastEmit) return [{
		messageId: "addOneOption",
		data: {
			name: nameWithLoc.name,
			emitsKind
		},
		fix(fixer) {
			if (lastEmit.type === "array") return fixer.insertTextAfter(lastEmit.node, `, '${nameWithLoc.name}'`);
			if (lastEmit.type === "object") return fixer.insertTextAfter(lastEmit.node, `, '${nameWithLoc.name}': null`);
			return null;
		}
	}];
	if (define.type !== "ObjectExpression") return [];
	const object = define;
	const propertyNodes = object.properties.filter(import_utils.default.isProperty);
	const emitsOption = propertyNodes.find((p) => import_utils.default.getStaticPropertyName(p) === "emits");
	if (emitsOption) {
		const sourceCode = context.sourceCode;
		const emitsOptionValue = emitsOption.value;
		if (emitsOptionValue.type === "ArrayExpression") {
			const leftBracket = sourceCode.getFirstToken(emitsOptionValue, _eslint_community_eslint_utils.isOpeningBracketToken);
			return [{
				messageId: "addOneOption",
				data: {
					name: nameWithLoc.name,
					emitsKind
				},
				fix(fixer) {
					return fixer.insertTextAfter(leftBracket, `'${nameWithLoc.name}'${emitsOptionValue.elements.length > 0 ? "," : ""}`);
				}
			}];
		}
		if (emitsOptionValue.type === "ObjectExpression") {
			const leftBrace = sourceCode.getFirstToken(emitsOptionValue, _eslint_community_eslint_utils.isOpeningBraceToken);
			return [{
				messageId: "addOneOption",
				data: {
					name: nameWithLoc.name,
					emitsKind
				},
				fix(fixer) {
					return fixer.insertTextAfter(leftBrace, `'${nameWithLoc.name}': null${emitsOptionValue.properties.length > 0 ? "," : ""}`);
				}
			}];
		}
		return [];
	}
	const sourceCode = context.sourceCode;
	const afterOptionNode = propertyNodes.find((p) => FIX_EMITS_AFTER_OPTIONS.has(import_utils.default.getStaticPropertyName(p) || ""));
	return [{
		messageId: "addArrayEmitsOption",
		data: {
			name: nameWithLoc.name,
			emitsKind
		},
		fix(fixer) {
			if (afterOptionNode) return fixer.insertTextAfter(sourceCode.getTokenBefore(afterOptionNode), `\nemits: ['${nameWithLoc.name}'],`);
			const lastPropertyNode = object.properties.at(-1);
			if (lastPropertyNode) {
				const before = propertyNodes.at(-1) || lastPropertyNode;
				return fixer.insertTextAfter(before, `,\nemits: ['${nameWithLoc.name}']`);
			}
			const objectLeftBrace = sourceCode.getFirstToken(object, _eslint_community_eslint_utils.isOpeningBraceToken);
			const objectRightBrace = sourceCode.getLastToken(object, _eslint_community_eslint_utils.isClosingBraceToken);
			return fixer.insertTextAfter(objectLeftBrace, `\nemits: ['${nameWithLoc.name}']${objectLeftBrace.loc.end.line < objectRightBrace.loc.start.line ? "" : "\n"}`);
		}
	}, {
		messageId: "addObjectEmitsOption",
		data: {
			name: nameWithLoc.name,
			emitsKind
		},
		fix(fixer) {
			if (afterOptionNode) return fixer.insertTextAfter(sourceCode.getTokenBefore(afterOptionNode), `\nemits: {'${nameWithLoc.name}': null},`);
			const lastPropertyNode = object.properties.at(-1);
			if (lastPropertyNode) {
				const before = propertyNodes.at(-1) || lastPropertyNode;
				return fixer.insertTextAfter(before, `,\nemits: {'${nameWithLoc.name}': null}`);
			}
			const objectLeftBrace = sourceCode.getFirstToken(object, _eslint_community_eslint_utils.isOpeningBraceToken);
			const objectRightBrace = sourceCode.getLastToken(object, _eslint_community_eslint_utils.isClosingBraceToken);
			return fixer.insertTextAfter(objectLeftBrace, `\nemits: {'${nameWithLoc.name}': null}${objectLeftBrace.loc.end.line < objectRightBrace.loc.start.line ? "" : "\n"}`);
		}
	}];
}
//#endregion
exports.default = require_explicit_emits_default;
cհxp"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/require-explicit-slots.js
/**
* @author Mussin Benarbia
* See LICENSE file in root directory for full license.
*/
var require_require_explicit_slots = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef {import('@typescript-eslint/types').TSESTree.TypeNode} TypeNode
	* @typedef {import('@typescript-eslint/types').TSESTree.TypeElement} TypeElement
	*/
	/**
	* @param {TypeElement} node
	* @return {string | null}
	*/
	function getSlotsName(node) {
		if (node.type !== "TSMethodSignature" && node.type !== "TSPropertySignature") return null;
		const key = node.key;
		if (key.type === "Literal") return typeof key.value === "string" ? key.value : null;
		if (key.type === "Identifier") return key.name;
		return null;
	}
	/**
	* @param {VElement} node
	* @return {VAttribute | VDirective | undefined}
	*/
	function getSlotNameNode(node) {
		return node.startTag.attributes.find((node) => !node.directive && node.key.name === "name" || node.directive && node.key.name.name === "bind" && node.key.argument?.type === "VIdentifier" && node.key.argument?.name === "name");
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "require slots to be explicitly defined",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/require-explicit-slots.html"
			},
			fixable: null,
			schema: [],
			messages: {
				requireExplicitSlots: "Slots must be explicitly defined.",
				alreadyDefinedSlot: "Slot {{slotName}} is already defined."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const sourceCode = context.sourceCode;
			const documentFragment = sourceCode.parserServices.getDocumentFragment && sourceCode.parserServices.getDocumentFragment();
			if (!documentFragment) return {};
			if (documentFragment.children.filter(
				/** @returns {element is VElement} */
				(element) => utils.isVElement(element) && element.name === "script"
			).every((script) => !utils.hasAttribute(script, "lang", "ts"))) return {};
			const slotsDefined = /* @__PURE__ */ new Set();
			/**
			* @param {VElement} node
			* @param {string | undefined} slotName
			*/
			function reportMissingSlot(node, slotName) {
				if (!slotsDefined.has(slotName)) context.report({
					node,
					messageId: "requireExplicitSlots"
				});
			}
			return utils.compositingVisitors(utils.defineScriptSetupVisitor(context, { onDefineSlotsEnter(_node, slots) {
				for (const slot of slots) {
					if (!slot.slotName) continue;
					if (slotsDefined.has(slot.slotName)) context.report({
						node: slot.node,
						messageId: "alreadyDefinedSlot",
						data: { slotName: slot.slotName }
					});
					else slotsDefined.add(slot.slotName);
				}
			} }), utils.executeOnVue(context, (obj) => {
				const slotsProperty = utils.findProperty(obj, "slots");
				if (!slotsProperty) return;
				const slotsTypeHelper = slotsProperty.value.type === "TSAsExpression" && slotsProperty.value.typeAnnotation?.typeName.name === "SlotsType" && slotsProperty.value.typeAnnotation;
				if (!slotsTypeHelper) return;
				const param = ("typeArguments" in slotsTypeHelper ? slotsTypeHelper.typeArguments : slotsTypeHelper.typeParameters)?.params[0];
				if (!param) return;
				if (param.type === "TSTypeLiteral") for (const memberNode of param.members) {
					const slotName = getSlotsName(memberNode);
					if (!slotName) continue;
					if (slotsDefined.has(slotName)) context.report({
						node: memberNode,
						messageId: "alreadyDefinedSlot",
						data: { slotName }
					});
					else slotsDefined.add(slotName);
				}
			}), utils.defineTemplateBodyVisitor(context, { 
			/** @param {VElement} node */
"VElement[name='slot']"(node) {
				const nameNode = getSlotNameNode(node);
				if (!nameNode) {
					reportMissingSlot(node, "default");
					return;
				}
				if (nameNode.directive) {
					const expression = nameNode.value?.expression;
					if (!expression || !utils.isStringLiteral(expression)) return;
					reportMissingSlot(node, utils.getStringLiteralValue(expression) || void 0);
				} else reportMissingSlot(node, nameNode.value?.value);
			} }));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_require_explicit_slots();
	}
});
+ƽx}!"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/require-expose.js
/**
* @fileoverview Require `expose` in Vue components
* @author Yosuke Ota <https://github.com/ota-meshi>
*/
var require_require_expose = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { findVariable, isOpeningBraceToken, isClosingBraceToken } = require("@eslint-community/eslint-utils");
	const utils = require_index.default;
	const { getVueComponentDefinitionType } = require_index.default;
	const FIX_EXPOSE_BEFORE_OPTIONS = /* @__PURE__ */ new Set([
		"name",
		"components",
		"directives",
		"extends",
		"mixins",
		"provide",
		"inject",
		"inheritAttrs",
		"props",
		"emits"
	]);
	/**
	* @param {Property | SpreadElement} node
	* @returns {node is ObjectExpressionProperty}
	*/
	function isExposeProperty(node) {
		return node.type === "Property" && utils.getStaticPropertyName(node) === "expose" && !node.computed;
	}
	/**
	* Get the callee member node from the given CallExpression
	* @param {CallExpression} node CallExpression
	*/
	function getCalleeMemberNode(node) {
		const callee = utils.skipChainExpression(node.callee);
		if (callee.type === "MemberExpression") {
			const name = utils.getStaticPropertyName(callee);
			if (name) return {
				name,
				member: callee
			};
		}
		return null;
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "require declare public properties using `expose`",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/require-expose.html"
			},
			fixable: null,
			hasSuggestions: true,
			schema: [],
			messages: {
				requireExpose: "The public properties of the component must be explicitly declared using `expose`. If the component does not have public properties, declare it empty.",
				addExposeOptionForEmpty: "Add the `expose` option to give an empty array.",
				addExposeOptionForAll: "Add the `expose` option to declare all properties."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			if (utils.isScriptSetup(context)) return {};
			/**
			* @typedef {object} SetupContext
			* @property {Set<Identifier>} exposeReferenceIds
			* @property {Set<Identifier>} contextReferenceIds
			*/
			/** @type {Map<ObjectExpression, SetupContext>} */
			const setupContexts = /* @__PURE__ */ new Map();
			/** @type {Set<ObjectExpression>} */
			const calledExpose = /* @__PURE__ */ new Set();
			/**
			* @typedef {FunctionExpression | FunctionDeclaration | ArrowFunctionExpression} FunctionNode
			*/
			/**
			* @typedef {object} ScopeStack
			* @property {ScopeStack | null} upper
			* @property {FunctionNode} functionNode
			* @property {boolean} returnFunction
			*/
			/**
			* @type {ScopeStack | null}
			*/
			let scopeStack = null;
			/** @type {Map<FunctionNode, ObjectExpression>} */
			const setupFunctions = /* @__PURE__ */ new Map();
			/** @type {Set<ObjectExpression>} */
			const setupRender = /* @__PURE__ */ new Set();
			/**
			* @param {Expression} node
			* @returns {boolean}
			*/
			function isFunction(node) {
				if (node.type === "ArrowFunctionExpression" || node.type === "FunctionExpression") return true;
				if (node.type === "Identifier") {
					const variable = findVariable(utils.getScope(context, node), node);
					if (variable) for (const def of variable.defs) {
						if (def.type === "FunctionName") return true;
						if (def.type === "Variable" && def.node.init) return isFunction(def.node.init);
					}
				}
				return false;
			}
			return utils.defineVueVisitor(context, {
				onSetupFunctionEnter(node, { node: vueNode }) {
					setupFunctions.set(node, vueNode);
					const contextParam = node.params[1];
					if (!contextParam) return;
					if (contextParam.type === "RestElement") return;
					if (contextParam.type === "ArrayPattern") return;
					/** @type {Set<Identifier>} */
					const contextReferenceIds = /* @__PURE__ */ new Set();
					/** @type {Set<Identifier>} */
					const exposeReferenceIds = /* @__PURE__ */ new Set();
					if (contextParam.type === "ObjectPattern") {
						const exposeProperty = utils.findAssignmentProperty(contextParam, "expose");
						if (!exposeProperty) return;
						const exposeParam = exposeProperty.value;
						const variable = exposeParam.type === "Identifier" ? findVariable(utils.getScope(context, exposeParam), exposeParam) : null;
						if (!variable) return;
						for (const reference of variable.references) {
							if (!reference.isRead()) continue;
							exposeReferenceIds.add(reference.identifier);
						}
					} else if (contextParam.type === "Identifier") {
						const variable = findVariable(utils.getScope(context, contextParam), contextParam);
						if (!variable) return;
						for (const reference of variable.references) {
							if (!reference.isRead()) continue;
							contextReferenceIds.add(reference.identifier);
						}
					}
					setupContexts.set(vueNode, {
						contextReferenceIds,
						exposeReferenceIds
					});
				},
				CallExpression(node, { node: vueNode }) {
					if (calledExpose.has(vueNode)) return;
					const setupContext = setupContexts.get(vueNode);
					if (setupContext) {
						const { contextReferenceIds, exposeReferenceIds } = setupContext;
						if (node.callee.type === "Identifier" && exposeReferenceIds.has(node.callee)) calledExpose.add(vueNode);
						else {
							const expose = getCalleeMemberNode(node);
							if (expose && expose.name === "expose" && expose.member.object.type === "Identifier" && contextReferenceIds.has(expose.member.object)) calledExpose.add(vueNode);
						}
					}
				},
				/** @param {FunctionNode} node */
				":function"(node) {
					scopeStack = {
						upper: scopeStack,
						functionNode: node,
						returnFunction: false
					};
					if (node.type === "ArrowFunctionExpression" && node.expression && isFunction(node.body)) scopeStack.returnFunction = true;
				},
				ReturnStatement(node) {
					if (!scopeStack) return;
					if (!scopeStack.returnFunction && node.argument && isFunction(node.argument)) scopeStack.returnFunction = true;
				},
				":function:exit"(node) {
					if (scopeStack && scopeStack.returnFunction) {
						const vueNode = setupFunctions.get(node);
						if (vueNode) setupRender.add(vueNode);
					}
					scopeStack &&= scopeStack.upper;
				},
				onVueObjectExit(component, { type }) {
					if (calledExpose.has(component)) return;
					if (setupRender.has(component)) return;
					if (type === "definition") {
						if (getVueComponentDefinitionType(context, component) === "mixin") return;
					}
					if (component.properties.some(isExposeProperty)) return;
					context.report({
						node: component,
						messageId: "requireExpose",
						suggest: buildSuggest(component, context)
					});
				}
			});
		}
	};
	/**
	* @param {ObjectExpression} object
	* @param {RuleContext} context
	* @returns {Rule.SuggestionReportDescriptor[]}
	*/
	function buildSuggest(object, context) {
		const propertyNodes = object.properties.filter(utils.isProperty);
		const sourceCode = context.sourceCode;
		const beforeOptionNode = propertyNodes.find((p) => FIX_EXPOSE_BEFORE_OPTIONS.has(utils.getStaticPropertyName(p) || ""));
		const allProps = [...new Set(utils.iterateProperties(object, /* @__PURE__ */ new Set([
			"props",
			"data",
			"computed",
			"setup",
			"methods",
			"watch"
		])))];
		return [{
			messageId: "addExposeOptionForEmpty",
			fix: buildFix("expose: []")
		}, ...allProps.length > 0 ? [{
			messageId: "addExposeOptionForAll",
			fix: buildFix(`expose: [${allProps.map((p) => JSON.stringify(p.name)).join(", ")}]`)
		}] : []];
		/**
		* @param {string} text
		*/
		function buildFix(text) {
			/**
			* @param {RuleFixer} fixer
			*/
			return (fixer) => {
				if (beforeOptionNode) return fixer.insertTextAfter(beforeOptionNode, `,\n${text}`);
				if (object.properties.length > 0) {
					const after = propertyNodes[0] || object.properties[0];
					return fixer.insertTextAfter(sourceCode.getTokenBefore(after), `\n${text},`);
				}
				const objectLeftBrace = sourceCode.getFirstToken(object, isOpeningBraceToken);
				const objectRightBrace = sourceCode.getLastToken(object, isClosingBraceToken);
				return fixer.insertTextAfter(objectLeftBrace, `\n${text}${objectLeftBrace.loc.end.line < objectRightBrace.loc.start.line ? "" : "\n"}`);
			};
		}
	}
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_require_expose();
	}
});
fx	J"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/require-macro-variable-name.js
/**
* @author ItMaga
* See LICENSE file in root directory for full license.
*/
var require_require_macro_variable_name = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const DEFAULT_OPTIONS = {
		defineProps: "props",
		defineEmits: "emit",
		defineSlots: "slots",
		useSlots: "slots",
		useAttrs: "attrs"
	};
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "require a certain macro variable name",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/require-macro-variable-name.html"
			},
			fixable: null,
			hasSuggestions: true,
			schema: [{
				type: "object",
				properties: {
					defineProps: { type: "string" },
					defineEmits: { type: "string" },
					defineSlots: { type: "string" },
					useSlots: { type: "string" },
					useAttrs: { type: "string" }
				},
				additionalProperties: false
			}],
			messages: {
				requireName: "The variable name of \"{{macroName}}\" must be \"{{variableName}}\".",
				changeName: "Change the variable name to \"{{variableName}}\"."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const options = Object.assign({}, DEFAULT_OPTIONS, context.options[0]);
			const relevantMacros = /* @__PURE__ */ new Set([...Object.keys(DEFAULT_OPTIONS), "withDefaults"]);
			return utils.defineScriptSetupVisitor(context, { VariableDeclarator(node) {
				if (!node.init || node.init.type !== "CallExpression" || node.init.callee.type !== "Identifier" || !relevantMacros.has(node.init.callee.name)) return;
				const macroName = node.init.callee.name === "withDefaults" ? "defineProps" : node.init.callee.name;
				if (node.id.type === "Identifier" && node.id.name !== options[macroName]) context.report({
					node: node.id,
					loc: node.id.loc,
					messageId: "requireName",
					data: {
						macroName,
						variableName: options[macroName]
					},
					suggest: [{
						messageId: "changeName",
						data: { variableName: options[macroName] },
						fix(fixer) {
							return fixer.replaceText(node.id, options[macroName]);
						}
					}]
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_require_macro_variable_name();
	}
});
x"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/require-name-property.js
/**
* @fileoverview Require a name property in Vue components
* @author LukeeeeBennett
*/
var require_require_name_property = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const path = require("node:path");
	const utils = require_index.default;
	const { getVueComponentDefinitionType } = require_index.default;
	/**
	* Get the text of the empty indentation part of the line which the given token is on.
	* @param {SourceCode} sourceCode the source code object
	* @param {Token} token the token to get the indentation text of the line which the token is on
	* @returns {string} The text of indentation part.
	*/
	function getLineEmptyIndent(sourceCode, token) {
		const LT_CHAR = /[\n\r\u{2028}\u{2029}]/u;
		const EMPTY_CHAR = /\s/;
		const text = sourceCode.text;
		let i = token.range[0] - 1;
		while (i >= 0 && !LT_CHAR.test(text[i])) i -= 1;
		let j = i;
		while (EMPTY_CHAR.test(text[j])) j += 1;
		return text.slice(i + 1, j);
	}
	/**
	* @param {Property | SpreadElement} node
	* @returns {node is ObjectExpressionProperty}
	*/
	function isNameProperty(node) {
		return node.type === "Property" && utils.getStaticPropertyName(node) === "name" && !node.computed;
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "require a name property in Vue components",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/require-name-property.html"
			},
			fixable: null,
			hasSuggestions: true,
			schema: [],
			messages: {
				missingName: "Required name property is not set.",
				addName: "Add name property to component."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			if (utils.isScriptSetup(context)) return {};
			return utils.executeOnVue(context, (component, type) => {
				if (type === "definition") {
					if (getVueComponentDefinitionType(context, component) === "mixin") return;
				}
				if (component.properties.some(isNameProperty)) return;
				context.report({
					node: component,
					messageId: "missingName",
					suggest: [{
						messageId: "addName",
						fix(fixer) {
							const extension = path.extname(context.filename);
							const filename = path.basename(context.filename, extension);
							const sourceCode = context.sourceCode;
							if (component.properties.length > 0) {
								const indentText = getLineEmptyIndent(sourceCode, sourceCode.getFirstToken(component.properties[0]));
								return fixer.insertTextBefore(component.properties[0], `name: '${filename}',\n${indentText}`);
							}
							const firstToken = sourceCode.getFirstToken(component);
							const lastToken = sourceCode.getLastToken(component);
							if (firstToken.value === "{" && lastToken.value === "}") {
								const indentText = getLineEmptyIndent(sourceCode, firstToken);
								return fixer.replaceTextRange([firstToken.range[1], lastToken.range[0]], `\n${indentText}  name: '${filename}'\n${indentText}`);
							}
							return null;
						}
					}]
				});
			});
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_require_name_property();
	}
});
f90xb
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_comments = require("../utils/comments.js");
//#region lib/rules/require-prop-comment.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
var require_prop_comment_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "require props to have a comment",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/require-prop-comment.html"
		},
		fixable: null,
		schema: [{
			type: "object",
			properties: { type: { enum: [
				"JSDoc",
				"line",
				"block",
				"any"
			] } },
			additionalProperties: false
		}],
		messages: {
			requireAnyComment: "The \"{{name}}\" property should have a comment.",
			requireLineComment: "The \"{{name}}\" property should have a line comment.",
			requireBlockComment: "The \"{{name}}\" property should have a block comment.",
			requireJSDocComment: "The \"{{name}}\" property should have a JSDoc comment."
		}
	},
	create(context) {
		const schema = context.options[0];
		const type = schema && schema.type || "JSDoc";
		const sourceCode = context.sourceCode;
		const verifyBlock = (comment) => comment && require_comments.isBlockComment(comment) ? void 0 : "requireBlockComment";
		const verifyLine = (comment) => comment && comment.type === "Line" ? void 0 : "requireLineComment";
		const verifyAny = (comment) => comment ? void 0 : "requireAnyComment";
		const verifyJSDoc = (comment) => comment && require_comments.isJSDocComment(comment) ? void 0 : "requireJSDocComment";
		const verifyComment = (comment) => {
			switch (type) {
				case "block": return verifyBlock(comment);
				case "line": return verifyLine(comment);
				case "any": return verifyAny(comment);
				default: return verifyJSDoc(comment);
			}
		};
		function verifyProps(props) {
			for (const prop of props) {
				if (!prop.propName || prop.type === "infer-type") continue;
				const lastPrecedingComment = sourceCode.getCommentsBefore(prop.node).at(-1);
				const messageId = verifyComment(lastPrecedingComment);
				if (!messageId) continue;
				context.report({
					node: prop.node,
					messageId,
					data: { name: prop.propName }
				});
			}
		}
		return import_utils.default.compositingVisitors(import_utils.default.defineScriptSetupVisitor(context, { onDefinePropsEnter(_node, props) {
			verifyProps(props);
		} }), import_utils.default.defineVueVisitor(context, { onVueObjectEnter(node) {
			verifyProps(import_utils.default.getComponentPropsFromOptions(node));
		} }));
	}
};
//#endregion
exports.default = require_prop_comment_default;
vxo"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/require-prop-type-constructor.js
/**
* @fileoverview require prop type to be a constructor
* @author Michał Sajnóg
*/
var require_require_prop_type_constructor = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const { isDef } = require_index.default;
	/**
	* @typedef {import('../utils').ComponentProp} ComponentProp
	*/
	const forbiddenTypes = /* @__PURE__ */ new Set([
		"Literal",
		"TemplateLiteral",
		"BinaryExpression",
		"UpdateExpression"
	]);
	/**
	* @param {ESNode} node
	*/
	function isForbiddenType(node) {
		return forbiddenTypes.has(node.type) && !(node.type === "Literal" && node.value == null && !node.bigint);
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "require prop type to be a constructor",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/require-prop-type-constructor.html"
			},
			fixable: "code",
			schema: [],
			messages: { propTypeConstructor: "The \"{{name}}\" property should be a constructor." }
		},
		/** @param {RuleContext} context */
		create(context) {
			/**
			* @param {string} propName
			* @param {ESNode} node
			*/
			function checkPropertyNode(propName, node) {
				/** @type {ESNode[]} */
				const nodes = node.type === "ArrayExpression" ? node.elements.filter(isDef) : [node];
				for (const prop of nodes) {
					if (!isForbiddenType(prop)) continue;
					context.report({
						node: prop,
						messageId: "propTypeConstructor",
						data: { name: propName },
						fix: (fixer) => {
							if (prop.type === "Literal" || prop.type === "TemplateLiteral") {
								const newText = utils.getStringLiteralValue(prop, true);
								if (newText) return fixer.replaceText(prop, newText);
							}
							return null;
						}
					});
				}
			}
			/** @param {ComponentProp[]} props */
			function verifyProps(props) {
				for (const prop of props) {
					if (prop.type !== "object" || prop.propName == null) continue;
					if (isForbiddenType(prop.value) || prop.value.type === "ArrayExpression") checkPropertyNode(prop.propName, prop.value);
					else if (prop.value.type === "ObjectExpression") {
						const typeProperty = utils.findProperty(prop.value, "type");
						if (!typeProperty) continue;
						checkPropertyNode(prop.propName, typeProperty.value);
					}
				}
			}
			return utils.compositingVisitors(utils.defineScriptSetupVisitor(context, { onDefinePropsEnter(_node, props) {
				verifyProps(props);
			} }), utils.executeOnVueComponent(context, (obj) => {
				verifyProps(utils.getComponentPropsFromOptions(obj));
			}));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_require_prop_type_constructor();
	}
});
Tx?"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/require-prop-types.js
/**
* @fileoverview Prop definitions should be detailed
* @author Armano
*/
var require_require_prop_types = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef {import('../utils').ComponentProp} ComponentProp
	*/
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "require type definitions in props",
				categories: ["vue3-strongly-recommended", "vue2-strongly-recommended"],
				url: "https://eslint.vuejs.org/rules/require-prop-types.html"
			},
			fixable: null,
			schema: [],
			messages: { requireType: "Prop \"{{name}}\" should define at least its type." }
		},
		/** @param {RuleContext} context */
		create(context) {
			/**
			* @param {Expression} node
			* @returns {boolean|null}
			*/
			function optionHasType(node) {
				switch (node.type) {
					case "ObjectExpression": return objectHasType(node);
					case "ArrayExpression": return node.elements.length > 0;
					case "FunctionExpression":
					case "ArrowFunctionExpression": return false;
				}
				return null;
			}
			/**
			* @param {ObjectExpression} node
			* @returns {boolean}
			*/
			function objectHasType(node) {
				const typeProperty = node.properties.find((p) => p.type === "Property" && utils.getStaticPropertyName(p) === "type" && (p.value.type !== "ArrayExpression" || p.value.elements.length > 0));
				const validatorProperty = node.properties.find((p) => p.type === "Property" && utils.getStaticPropertyName(p) === "validator");
				return Boolean(typeProperty || validatorProperty);
			}
			/**
			* @param {ComponentProp} prop
			*/
			function checkProperty(prop) {
				if (prop.type !== "object" && prop.type !== "array") return;
				if (!(prop.type === "array" ? false : optionHasType(prop.value) ?? true)) {
					const { node, propName } = prop;
					const name = propName || node.type === "Identifier" && node.name || "Unknown prop";
					context.report({
						node,
						messageId: "requireType",
						data: { name }
					});
				}
			}
			return utils.compositingVisitors(utils.defineScriptSetupVisitor(context, {
				onDefinePropsEnter(_node, props) {
					for (const prop of props) checkProperty(prop);
				},
				onDefineModelEnter(node, model) {
					if (model.typeNode) return;
					if (model.options && (optionHasType(model.options) ?? true)) return;
					context.report({
						node: model.options || node,
						messageId: "requireType",
						data: { name: model.name.modelName }
					});
				}
			}), utils.executeOnVue(context, (obj) => {
				const props = utils.getComponentPropsFromOptions(obj);
				for (const prop of props) checkProperty(prop);
			}));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_require_prop_types();
	}
});
\Ŧ[xE"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/require-render-return.js
/**
* @fileoverview Enforces render function to always return value.
* @author Armano
*/
var require_require_render_return = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce render function to always return value",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/require-render-return.html"
			},
			fixable: null,
			schema: [],
			messages: { expectedReturn: "Expected to return a value in render function." }
		},
		/** @param {RuleContext} context */
		create(context) {
			/** @type {Map<ESNode, Property['key']>} */
			const renderFunctions = /* @__PURE__ */ new Map();
			return utils.compositingVisitors(utils.defineVueVisitor(context, { onRenderFunctionEnter(node) {
				renderFunctions.set(node, node.parent.key);
			} }), utils.executeOnFunctionsWithoutReturn(context, true, (node) => {
				const key = renderFunctions.get(node);
				if (key) context.report({
					node: key,
					messageId: "expectedReturn"
				});
			}));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_require_render_return();
	}
});
xA"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/require-slots-as-functions.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_require_slots_as_functions = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const { findVariable } = require("@eslint-community/eslint-utils");
	const SLOT_USED_AS_VALUE_PARENT_TYPES = /* @__PURE__ */ new Set([
		"MemberExpression",
		"VariableDeclarator",
		"SpreadElement",
		"ArrayExpression"
	]);
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce properties of `$slots` to be used as a function",
				categories: ["vue3-essential"],
				url: "https://eslint.vuejs.org/rules/require-slots-as-functions.html"
			},
			fixable: null,
			schema: [],
			messages: { unexpected: "Property in `$slots` should be used as function." }
		},
		/** @param {RuleContext} context */
		create(context) {
			/**
			* Verify the given node
			* @param {MemberExpression | Identifier | ChainExpression} node The node to verify
			* @param {Expression} reportNode The node to report
			*/
			function verify(node, reportNode) {
				const parent = node.parent;
				if (parent.type === "VariableDeclarator" && parent.id.type === "Identifier") {
					verifyReferences(parent.id, reportNode);
					return;
				}
				if (parent.type === "AssignmentExpression" && parent.right === node && parent.left.type === "Identifier") {
					verifyReferences(parent.left, reportNode);
					return;
				}
				if (parent.type === "ChainExpression") {
					verify(parent, reportNode);
					return;
				}
				if (SLOT_USED_AS_VALUE_PARENT_TYPES.has(parent.type)) context.report({
					node: reportNode,
					messageId: "unexpected"
				});
			}
			/**
			* Verify the references of the given node.
			* @param {Identifier} node The node to verify
			* @param {Expression} reportNode The node to report
			*/
			function verifyReferences(node, reportNode) {
				const variable = findVariable(utils.getScope(context, node), node);
				if (!variable) return;
				for (const reference of variable.references) {
					if (!reference.isRead()) continue;
					/** @type {Identifier} */
					const id = reference.identifier;
					verify(id, reportNode);
				}
			}
			return utils.defineVueVisitor(context, { 
			/** @param {MemberExpression} node */
MemberExpression(node) {
				const object = utils.skipChainExpression(node.object);
				if (object.type !== "MemberExpression") return;
				if (utils.getStaticPropertyName(object) !== "$slots") return;
				if (!utils.isThis(object.object, context)) return;
				if (node.property.type === "PrivateIdentifier") return;
				verify(node, node.property);
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_require_slots_as_functions();
	}
});
dҾx"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/require-toggle-inside-transition.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_require_toggle_inside_transition = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @param {VDirective} vBindAppear
	*/
	function isValidBindAppear(vBindAppear) {
		if (vBindAppear.value?.expression && vBindAppear.value.expression.type === "Literal") return vBindAppear.value.expression?.value !== false;
		return true;
	}
	/**
	* @param {string[]} directives
	*/
	function createDirectiveList(directives) {
		let str = "";
		for (const [index, directive] of directives.entries()) if (index === 0) str += `\`v-${directive}\``;
		else if (index < directives.length - 1) str += `, \`v-${directive}\``;
		else str += ` or \`v-${directive}\``;
		return str;
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "require control the display of the content inside `<transition>`",
				categories: ["vue3-essential"],
				url: "https://eslint.vuejs.org/rules/require-toggle-inside-transition.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: { additionalDirectives: {
					type: "array",
					items: { type: "string" },
					uniqueItems: true
				} },
				additionalProperties: false
			}],
			messages: { expected: "The element inside `<transition>` is expected to have a {{allowedDirectives}} directive." }
		},
		/** @param {RuleContext} context */
		create(context) {
			const allowedDirectives = [
				"if",
				"show",
				...context.options[0] && context.options[0].additionalDirectives || []
			];
			const allowedDirectivesString = createDirectiveList(allowedDirectives);
			/**
			* Check if the given element has display control.
			* @param {VElement} element The element node to check.
			*/
			function verifyInsideElement(element) {
				if (utils.isCustomComponent(element)) return;
				/** @type VElement */ const parent = element.parent;
				const vBindAppear = utils.getDirective(parent, "bind", "appear");
				if (utils.hasAttribute(parent, "appear") || vBindAppear && isValidBindAppear(vBindAppear)) return;
				if (element.name !== "slot" && allowedDirectives.every((directive) => !utils.hasDirective(element, directive)) && !utils.hasDirective(element, "bind", "key")) context.report({
					node: element.startTag,
					loc: element.startTag.loc,
					messageId: "expected",
					data: { allowedDirectives: allowedDirectivesString }
				});
			}
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VElement} node */
"VElement[name='transition'] > VElement"(node) {
				if (node.parent.children.find(utils.isVElement) !== node) return;
				verifyInsideElement(node);
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_require_toggle_inside_transition();
	}
});
xb"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/require-typed-object-prop.js
/**
* @author Przemysław Jan Beigert
* See LICENSE file in root directory for full license.
*/
var require_require_typed_object_prop = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @param {RuleContext} context
	* @param {Identifier} identifierNode
	*/
	const checkPropIdentifierType = (context, identifierNode) => {
		if (identifierNode.name !== "Object" && identifierNode.name !== "Array") return;
		const arrayTypeSuggestion = identifierNode.name === "Array" ? "[]" : "";
		context.report({
			node: identifierNode,
			messageId: "expectedTypeAnnotation",
			suggest: [{
				messageId: "addTypeAnnotation",
				data: { type: `any${arrayTypeSuggestion}` },
				fix(fixer) {
					return fixer.insertTextAfter(identifierNode, ` as PropType<any${arrayTypeSuggestion}>`);
				}
			}, {
				messageId: "addTypeAnnotation",
				data: { type: `unknown${arrayTypeSuggestion}` },
				fix(fixer) {
					return fixer.insertTextAfter(identifierNode, ` as PropType<unknown${arrayTypeSuggestion}>`);
				}
			}]
		});
	};
	/**
	* @param {RuleContext} context
	* @param {ArrayExpression} arrayNode
	*/
	const checkPropArrayType = (context, arrayNode) => {
		for (const elementNode of arrayNode.elements) if (elementNode?.type === "Identifier") checkPropIdentifierType(context, elementNode);
	};
	/**
	* @param {RuleContext} context
	* @param {ObjectExpression} objectNode
	*/
	const checkPropObjectType = (context, objectNode) => {
		const typeProperty = objectNode.properties.find((prop) => prop.type === "Property" && prop.key.type === "Identifier" && prop.key.name === "type");
		if (!typeProperty || typeProperty.type !== "Property") return;
		if (typeProperty.value.type === "Identifier") checkPropIdentifierType(context, typeProperty.value);
		else if (typeProperty.value.type === "ArrayExpression") checkPropArrayType(context, typeProperty.value);
	};
	/**
	* @param {import('../utils').ComponentProp} prop
	* @param {RuleContext} context
	*/
	const checkProp = (prop, context) => {
		if (prop.type !== "object") return;
		switch (prop.node.value.type) {
			case "Identifier":
				checkPropIdentifierType(context, prop.node.value);
				break;
			case "ArrayExpression":
				checkPropArrayType(context, prop.node.value);
				break;
			case "ObjectExpression":
				checkPropObjectType(context, prop.node.value);
				return;
		}
	};
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "enforce adding type declarations to object props",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/require-typed-object-prop.html"
			},
			fixable: null,
			hasSuggestions: true,
			schema: [],
			messages: {
				expectedTypeAnnotation: "Expected type annotation on object prop.",
				addTypeAnnotation: "Add `{{ type }}` type annotation."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const filename = context.filename;
			if (!utils.isVueFile(filename) && !utils.isTypeScriptFile(filename)) return {};
			if (utils.isVueFile(filename)) {
				const sourceCode = context.sourceCode;
				const documentFragment = sourceCode.parserServices.getDocumentFragment && sourceCode.parserServices.getDocumentFragment();
				if (!documentFragment) return {};
				if (documentFragment.children.filter(
					/** @returns {element is VElement} */
					(element) => utils.isVElement(element) && element.name === "script"
				).every((script) => !utils.hasAttribute(script, "lang", "ts"))) return {};
			}
			return utils.compositingVisitors(utils.defineScriptSetupVisitor(context, { onDefinePropsEnter(_node, props) {
				for (const prop of props) checkProp(prop, context);
			} }), utils.executeOnVue(context, (obj) => {
				const props = utils.getComponentPropsFromOptions(obj);
				for (const prop of props) checkProp(prop, context);
			}));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_require_typed_object_prop();
	}
});
`wx	Qconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_ref_object_references = require("../utils/ref-object-references.js");
//#region lib/rules/require-typed-ref.ts
/**
* @author Ivan Demchuk <https://github.com/Demivan>
* See LICENSE file in root directory for full license.
*/
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
function isNullOrUndefined(node) {
	return node.type === "Literal" && node.value === null || node.type === "Identifier" && node.name === "undefined";
}
var require_typed_ref_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "require `ref` and `shallowRef` functions to be strongly typed",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/require-typed-ref.html"
		},
		fixable: null,
		schema: [],
		messages: { noType: "Specify type parameter for `{{name}}` function, otherwise created variable will not be typechecked." }
	},
	create(context) {
		const filename = context.filename;
		if (!import_utils.default.isVueFile(filename) && !import_utils.default.isTypeScriptFile(filename)) return {};
		if (import_utils.default.isVueFile(filename)) {
			const sourceCode = context.sourceCode;
			const documentFragment = sourceCode.parserServices.getDocumentFragment && sourceCode.parserServices.getDocumentFragment();
			if (!documentFragment) return {};
			if (documentFragment.children.filter((element) => import_utils.default.isVElement(element) && element.name === "script").every((script) => !import_utils.default.hasAttribute(script, "lang", "ts"))) return {};
		}
		const defines = require_ref_object_references.iterateDefineRefs(context.sourceCode.scopeManager.globalScope);
		function report(name, node) {
			context.report({
				node,
				messageId: "noType",
				data: { name }
			});
		}
		return { Program() {
			for (const ref of defines) {
				if (ref.name !== "ref" && ref.name !== "shallowRef") continue;
				if (ref.node.arguments.length > 0 && !isNullOrUndefined(ref.node.arguments[0])) continue;
				if (("typeArguments" in ref.node ? ref.node.typeArguments : ref.node.typeParameters) == null) if (ref.node.parent.type === "VariableDeclarator" && ref.node.parent.id.type === "Identifier") {
					if (ref.node.parent.id.typeAnnotation == null) report(ref.name, ref.node);
				} else report(ref.name, ref.node);
			}
		} };
	}
};
//#endregion
exports.default = require_typed_ref_default;
\Iox "use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/require-v-for-key.js
/**
* @author Toru Nagashima
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_require_v_for_key = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "require `v-bind:key` with `v-for` directives",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/require-v-for-key.html"
			},
			fixable: null,
			schema: [],
			messages: { requireKey: "Elements in iteration expect to have 'v-bind:key' directives." }
		},
		/** @param {RuleContext} context */
		create(context) {
			/**
			* Check the given element about `v-bind:key` attributes.
			* @param {VElement} element The element node to check.
			*/
			function checkKey(element) {
				if (utils.hasDirective(element, "bind", "key")) return;
				if (element.name === "template" || element.name === "slot") {
					for (const child of element.children) if (child.type === "VElement") checkKey(child);
				} else if (!utils.isCustomComponent(element)) context.report({
					node: element.startTag,
					loc: element.startTag.loc,
					messageId: "requireKey"
				});
			}
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VDirective} node */
"VAttribute[directive=true][key.name.name='for']"(node) {
				checkKey(node.parent.parent);
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_require_v_for_key();
	}
});
"kIVx uconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
//#region lib/rules/require-valid-default-prop.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
const NATIVE_TYPES = /* @__PURE__ */ new Set([
	"String",
	"Number",
	"Boolean",
	"Function",
	"Object",
	"Array",
	"Symbol",
	"BigInt"
]);
const FUNCTION_VALUE_TYPES = /* @__PURE__ */ new Set([
	"Function",
	"Object",
	"Array"
]);
function getPropertyNode(obj, name) {
	for (const p of obj.properties) if (p.type === "Property" && !p.computed && p.key.type === "Identifier" && p.key.name === name) return p;
	return null;
}
function getTypes(targetNode) {
	const node = import_utils.default.skipTSAsExpression(targetNode);
	if (node.type === "Identifier") return [node.name];
	if (node.type === "ArrayExpression") return node.elements.filter((item) => item != null && item.type === "Identifier").map((item) => item.name);
	return [];
}
var require_valid_default_prop_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "enforce props default values to be valid",
			categories: ["vue3-essential", "vue2-essential"],
			url: "https://eslint.vuejs.org/rules/require-valid-default-prop.html"
		},
		fixable: null,
		schema: [],
		messages: { invalidType: "Type of the default value for '{{name}}' prop must be a {{types}}." }
	},
	create(context) {
		const vueObjectPropsContexts = /* @__PURE__ */ new Map();
		const scriptSetupPropsContexts = [];
		let scopeStack = null;
		function onFunctionExit() {
			scopeStack &&= scopeStack.upper;
		}
		function getValueType(targetNode) {
			const node = import_utils.default.skipChainExpression(targetNode);
			switch (node.type) {
				case "CallExpression":
					if (node.callee.type === "Identifier" && NATIVE_TYPES.has(node.callee.name)) return {
						function: false,
						type: node.callee.name
					};
					break;
				case "TemplateLiteral": return {
					function: false,
					type: "String"
				};
				case "Literal": {
					if (node.value === null && !node.bigint) return null;
					const type = node.bigint ? "BigInt" : require_casing.capitalize(typeof node.value);
					if (NATIVE_TYPES.has(type)) return {
						function: false,
						type
					};
					break;
				}
				case "ArrayExpression": return {
					function: false,
					type: "Array"
				};
				case "ObjectExpression": return {
					function: false,
					type: "Object"
				};
				case "FunctionExpression": return {
					function: true,
					expression: false,
					type: "Function",
					functionBody: node.body,
					returnTypes: []
				};
				case "ArrowFunctionExpression":
					if (node.expression) {
						const valueType = getValueType(node.body);
						return {
							function: true,
							expression: true,
							type: "Function",
							functionBody: node.body,
							returnType: valueType ? valueType.type : null
						};
					}
					return {
						function: true,
						expression: false,
						type: "Function",
						functionBody: node.body,
						returnTypes: []
					};
			}
			return null;
		}
		function report(node, prop, expectedTypeNames) {
			const propName = prop.propName ?? `[${context.sourceCode.getText(prop.node.key)}]`;
			context.report({
				node,
				messageId: "invalidType",
				data: {
					name: propName,
					types: [...expectedTypeNames].join(" or ").toLowerCase()
				}
			});
		}
		function verifyReturnTypes({ prop, types: typeNames, default: defType }) {
			for (const returnType of defType.returnTypes) {
				if (typeNames.has(returnType.type)) continue;
				report(returnType.node, prop, typeNames);
			}
		}
		function processPropDefs(props, otherDefaultProvider) {
			const propContexts = [];
			function collectDefaultContext(defaultDef, prop, typeNames) {
				const defType = getValueType(defaultDef.expression);
				if (!defType) return;
				if (defType.function) {
					if (typeNames.has("Function")) return;
					if (defaultDef.src === "assignment") {
						report(defaultDef.expression, prop, typeNames);
						return;
					}
					if (defType.expression) {
						if (!defType.returnType || typeNames.has(defType.returnType)) return;
						report(defType.functionBody, prop, typeNames);
					} else propContexts.push({
						prop,
						types: typeNames,
						default: defType
					});
				} else {
					if (typeNames.has(defType.type)) {
						if (defaultDef.src === "assignment") return;
						if (!FUNCTION_VALUE_TYPES.has(defType.type)) return;
					}
					report(defaultDef.expression, prop, defaultDef.src === "assignment" ? typeNames : [...typeNames].map((type) => FUNCTION_VALUE_TYPES.has(type) ? "Function" : type));
				}
			}
			for (const prop of props) {
				let typeList;
				const defaultList = [];
				if (prop.type === "object") if (prop.value.type === "ObjectExpression") {
					const type = getPropertyNode(prop.value, "type");
					if (!type) continue;
					typeList = getTypes(type.value);
					const def = getPropertyNode(prop.value, "default");
					if (def) defaultList.push({
						src: "defaultProperty",
						expression: def.value
					});
				} else typeList = getTypes(prop.value);
				else typeList = prop.types;
				if (prop.propName != null) defaultList.push(...otherDefaultProvider(prop.propName));
				if (defaultList.length === 0) continue;
				const typeNames = new Set(typeList.filter((item) => NATIVE_TYPES.has(item)));
				if (typeNames.size === 0) continue;
				for (const defaultDef of defaultList) collectDefaultContext(defaultDef, prop, typeNames);
			}
			return propContexts;
		}
		return import_utils.default.compositingVisitors({
			":function"(node) {
				scopeStack = {
					upper: scopeStack,
					body: node.body,
					returnTypes: null
				};
			},
			ReturnStatement(node) {
				if (!scopeStack) return;
				if (scopeStack.returnTypes && node.argument) {
					const type = getValueType(node.argument);
					if (type) scopeStack.returnTypes.push({
						type: type.type,
						node: node.argument
					});
				}
			},
			":function:exit": onFunctionExit
		}, import_utils.default.defineVueVisitor(context, {
			onVueObjectEnter(obj) {
				const propContexts = processPropDefs(import_utils.default.getComponentPropsFromOptions(obj).filter((prop) => prop.type === "object" && prop.value.type === "ObjectExpression"), () => []);
				vueObjectPropsContexts.set(obj, propContexts);
			},
			":function"(node, { node: vueNode }) {
				const data = vueObjectPropsContexts.get(vueNode);
				if (!data || !scopeStack) return;
				for (const { default: defType } of data) if (node.body === defType.functionBody) scopeStack.returnTypes = defType.returnTypes;
			},
			onVueObjectExit(obj) {
				const data = vueObjectPropsContexts.get(obj);
				if (!data) return;
				for (const propContext of data) verifyReturnTypes(propContext);
			}
		}), import_utils.default.defineScriptSetupVisitor(context, {
			onDefinePropsEnter(node, baseProps) {
				const props = baseProps.filter((prop) => [
					"type",
					"infer-type",
					"object"
				].includes(prop.type));
				const defaultsByWithDefaults = import_utils.default.getWithDefaultsPropExpressions(node);
				const defaultsByAssignmentPatterns = import_utils.default.getDefaultPropExpressionsForPropsDestructure(node);
				const propContexts = processPropDefs(props, function* (propName) {
					const withDefaults = defaultsByWithDefaults[propName];
					if (withDefaults) yield {
						src: "withDefaults",
						expression: withDefaults
					};
					const assignmentPattern = defaultsByAssignmentPatterns[propName];
					if (assignmentPattern) yield {
						src: "assignment",
						expression: assignmentPattern.expression
					};
				});
				scriptSetupPropsContexts.push({
					node,
					props: propContexts
				});
			},
			":function"(node) {
				const data = scriptSetupPropsContexts.at(-1);
				if (!data || !scopeStack) return;
				for (const { default: defType } of data.props) if (node.body === defType.functionBody) scopeStack.returnTypes = defType.returnTypes;
			},
			onDefinePropsExit() {
				const data = scriptSetupPropsContexts.pop();
				if (!data) return;
				for (const propContext of data.props) verifyReturnTypes(propContext);
			}
		}));
	}
};
//#endregion
exports.default = require_valid_default_prop_default;
Nx	@const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_html_elements$1 = require("../utils/html-elements.js");
const require_svg_elements$1 = require("../utils/svg-elements.js");
const require_vue2_builtin_components$1 = require("../utils/vue2-builtin-components.js");
const require_vue3_builtin_components$1 = require("../utils/vue3-builtin-components.js");
const require_index = require("../utils/index.js");
const require_regexp = require("../utils/regexp.js");
const require_deprecated_html_elements = require("../utils/deprecated-html-elements.js");
//#region lib/rules/restricted-component-names.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
var import_html_elements = /* @__PURE__ */ require_runtime.__toESM(require_html_elements$1.default);
var import_svg_elements = /* @__PURE__ */ require_runtime.__toESM(require_svg_elements$1.default);
var import_vue2_builtin_components = /* @__PURE__ */ require_runtime.__toESM(require_vue2_builtin_components$1.default);
var import_vue3_builtin_components = /* @__PURE__ */ require_runtime.__toESM(require_vue3_builtin_components$1.default);
const reservedNames = /* @__PURE__ */ new Set([
	...import_html_elements.default,
	...require_deprecated_html_elements.default,
	...import_svg_elements.default,
	...import_vue2_builtin_components.default,
	...import_vue3_builtin_components.default
]);
var restricted_component_names_default = {
	meta: {
		type: "problem",
		docs: {
			description: "enforce using only specific component names",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/restricted-component-names.html"
		},
		fixable: null,
		schema: [{
			type: "object",
			additionalProperties: false,
			properties: { allow: {
				type: "array",
				items: { type: "string" },
				uniqueItems: true,
				additionalItems: false
			} }
		}],
		messages: { invalidName: "Component name \"{{name}}\" is not allowed." }
	},
	create(context) {
		const isAllowed = require_regexp.toRegExpGroupMatcher((context.options[0] || {}).allow);
		function isAllowedTarget(name) {
			return reservedNames.has(name) || isAllowed(name);
		}
		return import_utils.default.defineTemplateBodyVisitor(context, { VElement(node) {
			const name = node.rawName;
			if (isAllowedTarget(name)) return;
			context.report({
				node,
				loc: node.loc,
				messageId: "invalidName",
				data: { name }
			});
		} });
	}
};
//#endregion
exports.default = restricted_component_names_default;
3`ixy"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/return-in-computed-property.js
/**
* @fileoverview Enforces that a return statement is present in computed property (return-in-computed-property)
* @author Armano
*/
var require_return_in_computed_property = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { ReferenceTracker } = require("@eslint-community/eslint-utils");
	const utils = require_index.default;
	/**
	* @typedef {import('../utils').ComponentComputedProperty} ComponentComputedProperty
	*/
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce that a return statement is present in computed property",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/return-in-computed-property.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: { treatUndefinedAsUnspecified: { type: "boolean" } },
				additionalProperties: false
			}],
			messages: {
				expectedReturnInFunction: "Expected to return a value in computed function.",
				expectedReturnInProperty: "Expected to return a value in \"{{name}}\" computed property."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const shouldTreatUndefinedAsUnspecified = (context.options[0] || {}).treatUndefinedAsUnspecified !== false;
			/**
			* @type {Set<ComponentComputedProperty>}
			*/
			const computedProperties = /* @__PURE__ */ new Set();
			/** @type {(FunctionExpression | ArrowFunctionExpression)[]} */
			const computedFunctionNodes = [];
			return Object.assign({ 
			/** @param {Program} program */
Program(program) {
				const tracker = new ReferenceTracker(utils.getScope(context, program));
				const map = { computed: { [ReferenceTracker.CALL]: true } };
				for (const { node } of utils.iterateReferencesTraceMap(tracker, map)) {
					if (node.type !== "CallExpression") continue;
					const getter = utils.getGetterBodyFromComputedFunction(node);
					if (getter) computedFunctionNodes.push(getter);
				}
			} }, utils.defineVueVisitor(context, { onVueObjectEnter(obj) {
				for (const computedProperty of utils.getComputedProperties(obj)) computedProperties.add(computedProperty);
			} }), utils.executeOnFunctionsWithoutReturn(context, shouldTreatUndefinedAsUnspecified, (node) => {
				for (const cp of computedProperties) if (cp.value && cp.value.parent === node) context.report({
					node,
					messageId: "expectedReturnInProperty",
					data: { name: cp.key || "Unknown" }
				});
				for (const cf of computedFunctionNodes) if (cf === node) context.report({
					node,
					messageId: "expectedReturnInFunction"
				});
			}));
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_return_in_computed_property();
	}
});
 $xk"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/return-in-emits-validator.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_return_in_emits_validator = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef {import('../utils').ComponentEmit} ComponentEmit
	* @typedef {import('../utils').ComponentObjectEmit} ComponentObjectEmit
	*/
	/**
	* Checks if the given node value is falsy.
	* @param {Expression} node The node to check
	* @returns {boolean} If `true`, the given node value is falsy.
	*/
	function isFalsy(node) {
		if (node.type === "Literal") {
			if (node.bigint) return node.bigint === "0";
			if (!node.value) return true;
		}
		return node.type === "Identifier" && (node.name === "undefined" || node.name === "NaN");
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce that a return statement is present in emits validator",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/return-in-emits-validator.html"
			},
			fixable: null,
			schema: [],
			messages: {
				expectedTrue: "Expected to return a true value in \"{{name}}\" emits validator.",
				expectedBoolean: "Expected to return a boolean value in \"{{name}}\" emits validator."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			/** @type {ComponentObjectEmit[]} */
			const emitsValidators = [];
			/**
			* @typedef {object} ScopeStack
			* @property {ScopeStack | null} upper
			* @property {FunctionExpression | FunctionDeclaration | ArrowFunctionExpression} functionNode
			* @property {boolean} hasReturnValue
			* @property {boolean} possibleOfReturnTrue
			*/
			/**
			* @type {ScopeStack | null}
			*/
			let scopeStack = null;
			/**
			* @param {ComponentEmit[]} emits
			*/
			function processEmits(emits) {
				for (const emit of emits) {
					if (emit.type !== "object" || !emit.value) continue;
					if (emit.value.type !== "FunctionExpression" && emit.value.type !== "ArrowFunctionExpression") continue;
					emitsValidators.push(emit);
				}
			}
			return utils.compositingVisitors(utils.defineScriptSetupVisitor(context, { onDefineEmitsEnter(_node, emits) {
				processEmits(emits);
			} }), utils.defineVueVisitor(context, { 
			/** @param {ObjectExpression} obj */
onVueObjectEnter(obj) {
				processEmits(utils.getComponentEmitsFromOptions(obj));
			} }), {
				/** @param {FunctionExpression | FunctionDeclaration | ArrowFunctionExpression} node */
				":function"(node) {
					scopeStack = {
						upper: scopeStack,
						functionNode: node,
						hasReturnValue: false,
						possibleOfReturnTrue: false
					};
					if (node.type === "ArrowFunctionExpression" && node.expression) {
						scopeStack.hasReturnValue = true;
						if (!isFalsy(node.body)) scopeStack.possibleOfReturnTrue = true;
					}
				},
				/** @param {ReturnStatement} node */
				ReturnStatement(node) {
					if (!scopeStack) return;
					if (node.argument) {
						scopeStack.hasReturnValue = true;
						if (!isFalsy(node.argument)) scopeStack.possibleOfReturnTrue = true;
					}
				},
				/** @param {FunctionExpression | FunctionDeclaration | ArrowFunctionExpression} node */
				":function:exit"(node) {
					if (scopeStack && !scopeStack.possibleOfReturnTrue) {
						const emits = emitsValidators.find((e) => e.value === node);
						if (emits) context.report({
							node,
							messageId: scopeStack.hasReturnValue ? "expectedTrue" : "expectedBoolean",
							data: { name: emits.emitName || "Unknown" }
						});
					}
					scopeStack &&= scopeStack.upper;
				}
			});
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_return_in_emits_validator();
	}
});
JxSconst require_indent_common = require("../utils/indent-common.js");
//#region lib/rules/script-indent.ts
/**
* @author Toru Nagashima
* See LICENSE file in root directory for full license.
*/
var script_indent_default = {
	meta: {
		type: "layout",
		docs: {
			description: "enforce consistent indentation in `<script>`",
			categories: void 0,
			url: "https://eslint.vuejs.org/rules/script-indent.html"
		},
		fixable: "whitespace",
		schema: [{ oneOf: [{
			type: "integer",
			minimum: 1
		}, { enum: ["tab"] }] }, {
			type: "object",
			properties: {
				baseIndent: {
					type: "integer",
					minimum: 0
				},
				switchCase: {
					type: "integer",
					minimum: 0
				},
				ignores: {
					type: "array",
					items: { allOf: [
						{ type: "string" },
						{ not: {
							type: "string",
							pattern: ":exit$"
						} },
						{ not: {
							type: "string",
							pattern: String.raw`^\s*$`
						} }
					] },
					uniqueItems: true,
					additionalItems: false
				}
			},
			additionalProperties: false
		}]
	},
	create(context) {
		return require_indent_common.defineVisitor(context, context.sourceCode, {});
	}
};
//#endregion
exports.default = script_indent_default;
^eT.Jx'$single"DaSingle6===ZexternalIgnores: [],
		ignoreWhenNoAttributes: true,
		ignoreWhenEmpty: true
	}, options);O singleX)ssinglesingleNoAttributes&!	externalIBwnoxnov/* @__PURE__ */ new Set([...options.ignores, ...options.externalIgnores]);
		const ignoreWhenNoAttributes = options.ignoreWhenN	oAttribut?has(node.name) || ignores.ha
6haV
1
 = node;
				if (!isSinglelineElement(elem)) return;
				if (ignoreWhenNoAttributes && elem.startTag.attributes.length === 0) rXN=.startTag, elem0c.start *0	%
)Gz name: elem.rawName .?, sourceCode)) return;
				7.end!e$X name: elem.rawName *W.endTag_PsingleX+{.uxslotc/**
* Checks whether the given string is a single word.
*/
function isSingleWord(str) {
	return /^[a-z]+$/u.test(str);
}
const f7
	"camelCase",
	"kebab-case",
	"singleword"
];
var slot6o"slot names",
			categories: void 0*slot>P7Slot name \"{{name}}\" is notq	const option54V) ? option : "camelCase";
		const checker = caseType === "singleword" ? isSingleWord :'^	function processSlotNode(node) {
			const name = node.value?.value;
			if (name && !checker(np,
				loc: node.loc5"YdefineTemplateBodyVisitor(context, { "VElement[name='slot']"(node) {
			const slotName = OAttribute(node, "name");
			if (slotName) processSlotNode(slotName);
		} });
	}#slot_name_casing_default;
x3"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/sort-keys.js
/**
* @fileoverview enforce sort-keys in a manner that is compatible with order-in-components
* @author Loren Klingman
* Original ESLint sort-keys by Toru Nagashima
*/
var require_sort_keys = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const naturalCompare = require("natural-compare");
	const utils = require_index.default;
	/**
	* Gets the property name of the given `Property` node.
	*
	* - If the property's key is an `Identifier` node, this returns the key's name
	*   whether it's a computed property or not.
	* - If the property has a static name, this returns the static name.
	* - Otherwise, this returns null.
	* @param {Property} node The `Property` node to get.
	* @returns {string|null} The property name or null.
	* @private
	*/
	function getPropertyName(node) {
		const staticName = utils.getStaticPropertyName(node);
		if (staticName !== null) return staticName;
		return node.key.type === "Identifier" ? node.key.name : null;
	}
	/**
	* Functions which check that the given 2 names are in specific order.
	*
	* Postfix `I` is meant insensitive.
	* Postfix `N` is meant natural.
	* @private
	* @type { { [key: string]: (a:string, b:string) => boolean } }
	*/
	const orderComparators = {
		asc(a, b) {
			return a <= b;
		},
		ascI(a, b) {
			return a.toLowerCase() <= b.toLowerCase();
		},
		ascN(a, b) {
			return naturalCompare(a, b) <= 0;
		},
		ascIN(a, b) {
			return naturalCompare(a.toLowerCase(), b.toLowerCase()) <= 0;
		},
		desc(a, b) {
			return orderComparators.asc(b, a);
		},
		descI(a, b) {
			return orderComparators.ascI(b, a);
		},
		descN(a, b) {
			return orderComparators.ascN(b, a);
		},
		descIN(a, b) {
			return orderComparators.ascIN(b, a);
		}
	};
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "enforce sort-keys in a manner that is compatible with order-in-components",
				categories: null,
				url: "https://eslint.vuejs.org/rules/sort-keys.html"
			},
			fixable: null,
			schema: [{ enum: ["asc", "desc"] }, {
				type: "object",
				properties: {
					caseSensitive: { type: "boolean" },
					ignoreChildrenOf: { type: "array" },
					ignoreGrandchildrenOf: { type: "array" },
					minKeys: {
						type: "integer",
						minimum: 2
					},
					natural: { type: "boolean" },
					allowLineSeparatedGroups: { type: "boolean" }
				},
				additionalProperties: false
			}],
			messages: { sortKeys: "Expected object keys to be in {{natural}}{{insensitive}}{{order}}ending order. '{{thisName}}' should be before '{{prevName}}'." }
		},
		/**
		* @param {RuleContext} context - The rule context.
		* @returns {RuleListener} AST event handlers.
		*/
		create(context) {
			const options = context.options[1];
			const order = context.options[0] || "asc";
			/** @type {Set<string>} */
			const ignoreGrandchildrenOf = new Set(options && options.ignoreGrandchildrenOf || [
				"computed",
				"directives",
				"inject",
				"props",
				"watch"
			]);
			/** @type {Set<string>} */
			const ignoreChildrenOf = new Set(options && options.ignoreChildrenOf || ["model"]);
			const insensitive = options && options.caseSensitive === false;
			const minKeys = options?.minKeys ?? 2;
			const natural = options && options.natural;
			const allowLineSeparatedGroups = options && options.allowLineSeparatedGroups || false;
			const isValidOrder = orderComparators[order + (insensitive ? "I" : "") + (natural ? "N" : "")];
			const sourceCode = context.sourceCode;
			/**
			* @typedef {object} ObjectStack
			* @property {ObjectStack | null} ObjectStack.upper
			* @property {string | null} ObjectStack.prevName
			* @property {Property | null} ObjectStack.prevNode
			* @property {boolean} ObjectStack.prevBlankLine
			* @property {number} ObjectStack.numKeys
			* @property {VueState} ObjectStack.vueState
			*
			* @typedef {object} VueState
			* @property {Property} [VueState.currentProperty]
			* @property {boolean} [VueState.isVueObject]
			* @property {boolean} [VueState.within]
			* @property {string} [VueState.propName]
			* @property {number} [VueState.chainLevel]
			* @property {boolean} [VueState.ignore]
			*/
			/**
			* The stack to save the previous property's name for each object literals.
			* @type {ObjectStack | null}
			*/
			let objectStack;
			return {
				ObjectExpression(node) {
					/** @type {VueState} */
					const vueState = {};
					const upperVueState = objectStack && objectStack.vueState || {};
					objectStack = {
						upper: objectStack,
						prevName: null,
						prevNode: null,
						prevBlankLine: false,
						numKeys: node.properties.length,
						vueState
					};
					vueState.isVueObject = utils.getVueObjectType(context, node) != null;
					if (vueState.isVueObject) {
						vueState.within = vueState.isVueObject;
						vueState.ignore = true;
					} else if (upperVueState.within && upperVueState.currentProperty) if (utils.isPropertyChain(upperVueState.currentProperty, node)) {
						let propName;
						let chainLevel;
						if (upperVueState.isVueObject) {
							propName = utils.getStaticPropertyName(upperVueState.currentProperty) || "";
							chainLevel = 1;
						} else {
							propName = upperVueState.propName || "";
							chainLevel = (upperVueState.chainLevel || 0) + 1;
						}
						vueState.propName = propName;
						vueState.chainLevel = chainLevel;
						vueState.within = true;
						if (chainLevel === 1 && ignoreChildrenOf.has(propName) || chainLevel === 2 && ignoreGrandchildrenOf.has(propName)) vueState.ignore = true;
					} else vueState.within = false;
				},
				"ObjectExpression:exit"() {
					objectStack &&= objectStack.upper;
				},
				SpreadElement(node) {
					if (!objectStack) return;
					if (node.parent.type === "ObjectExpression") objectStack.prevName = null;
				},
				"ObjectExpression > Property"(node) {
					if (!objectStack) return;
					objectStack.vueState.currentProperty = node;
					if (objectStack.vueState.ignore) return;
					const prevName = objectStack.prevName;
					const numKeys = objectStack.numKeys;
					const thisName = getPropertyName(node);
					const prevNode = objectStack.prevNode;
					let isBlankLineBetweenNodes = objectStack.prevBlankLine;
					if (prevNode) {
						const tokens = [
							prevNode,
							...sourceCode.getTokensBetween(prevNode, node, { includeComments: true }),
							node
						];
						isBlankLineBetweenNodes ||= tokens.some((token, index) => {
							if (index === 0) return false;
							return token.loc.start.line - tokens[index - 1].loc.end.line > 1;
						});
					}
					objectStack.prevNode = node;
					if (thisName !== null) objectStack.prevName = thisName;
					if (allowLineSeparatedGroups && isBlankLineBetweenNodes) {
						objectStack.prevBlankLine = thisName === null;
						return;
					}
					if (prevName === null || thisName === null || numKeys < minKeys) return;
					if (!isValidOrder(prevName, thisName)) context.report({
						node,
						loc: node.key.loc,
						messageId: "sortKeys",
						data: {
							thisName,
							prevName,
							order,
							insensitive: insensitive ? "insensitive " : "",
							natural: natural ? "natural " : ""
						}
					});
				}
			};
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_sort_keys();
	}
});
9)xj"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/space-in-parens.js
/**
* @author Yosuke Ota
*/
var require_space_in_parens = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapStylisticOrCoreRule } = require_index.default;
	module.exports = wrapStylisticOrCoreRule("space-in-parens", {
		skipDynamicArguments: true,
		skipDynamicArgumentsReport: true,
		applyDocument: true
	});
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_space_in_parens();
	}
});
j喵'xu"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/space-infix-ops.js
/**
* @author Toru Nagashima
*/
var require_space_infix_ops = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapStylisticOrCoreRule } = require_index.default;
	module.exports = wrapStylisticOrCoreRule("space-infix-ops", {
		skipDynamicArguments: true,
		applyDocument: true
	});
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_space_infix_ops();
	}
});
DU'xu"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/space-unary-ops.js
/**
* @author Toru Nagashima
*/
var require_space_unary_ops = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { wrapStylisticOrCoreRule } = require_index.default;
	module.exports = wrapStylisticOrCoreRule("space-unary-ops", {
		skipDynamicArguments: true,
		applyDocument: true
	});
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_space_unary_ops();
	}
});

ڙjxX"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/static-class-names-order.js
/**
* @fileoverview Alphabetizes static class names.
* @author Maciej Chmurski
*/
var require_static_class_names_order = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { defineTemplateBodyVisitor } = require_index.default;
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				url: "https://eslint.vuejs.org/rules/static-class-names-order.html",
				description: "enforce static class names order",
				categories: void 0
			},
			fixable: "code",
			schema: [],
			messages: { shouldBeOrdered: "Classes should be ordered alphabetically." }
		},
		/** @param {RuleContext} context */
		create: (context) => defineTemplateBodyVisitor(context, { 
		/** @param {VAttribute} node */
"VAttribute[directive=false][key.name='class']"(node) {
			const value = node.value;
			if (!value) return;
			const classList = value.value;
			const classListWithWhitespace = classList.split(/(\s+)/);
			const divider = classListWithWhitespace.length > 1 ? classListWithWhitespace[1] : "";
			const classListSorted = classListWithWhitespace.filter((className) => className.trim() !== "").sort((a, b) => a.localeCompare(b)).join(divider);
			if (classList !== classListSorted) context.report({
				node,
				loc: node.loc,
				messageId: "shouldBeOrdered",
				fix: (fixer) => fixer.replaceText(value, `"${classListSorted}"`)
			});
		} })
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_static_class_names_order();
	}
});
s)6>8x{100644 define-model.js |+NxYG+Nc100644 define-options.js pedb&m100644 define-slots.js N	XP1ﭶZ0K100644 dynamic-directive-arguments.js  ݴ."qzl100644 is-attribute-with-vue-prefix.js W /Gxqf!100644 scope-attribute.js 2Cx|M>,100644 script-setup.js B՗zk	OVաK#100644 slot-attribute.js f /8~~L100644 slot-scope-attribute.js шYJ'2l|݄100644 style-css-vars-injection.js _.<xl*1hrg40000 utils ]O#-/TVۛ100644 v-bind-attr-modifier.js 	hQ$do|d100644 v-bind-prop-modifier-shorthand.js ֿJ' p&N=t3100644 v-bind-same-name-shorthand.js u&Z`sWI^p'100644 v-is.js 	Ff|Ϭ|ɻ|6100644 v-memo.js (s`Ug+awdQn100644 v-model-argument.js R4?r	Tе1100644 v-model-custom-modifiers.js , OĦ[N!܇#100644 v-slot.js d+oH]$	s-miUx'"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/valid-v-model.js
/**
* @author Toru Nagashima
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_valid_v_model = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const VALID_MODIFIERS = /* @__PURE__ */ new Set([
		"lazy",
		"number",
		"trim"
	]);
	/**
	* Check whether the given node is valid or not.
	* @param {VElement} node The element node to check.
	* @returns {boolean} `true` if the node is valid.
	*/
	function isValidElement(node) {
		const name = node.name;
		return name === "input" || name === "select" || name === "textarea" || name !== "keep-alive" && name !== "slot" && name !== "transition" && name !== "transition-group" && utils.isCustomComponent(node);
	}
	/**
	* Check whether the given node is a MemberExpression containing an optional chaining.
	* e.g.
	* - `a?.b`
	* - `a?.b.c`
	* @param {ASTNode} node The node to check.
	* @returns {boolean} `true` if the node is a MemberExpression containing an optional chaining.
	*/
	function isOptionalChainingMemberExpression(node) {
		return node.type === "ChainExpression" && node.expression.type === "MemberExpression";
	}
	/**
	* Check whether the given node can be LHS (left-hand side).
	* @param {ASTNode} node The node to check.
	* @returns {boolean} `true` if the node can be LHS.
	*/
	function isLhs(node) {
		if (node.type === "TSAsExpression" || node.type === "TSNonNullExpression") return isLhs(node.expression);
		return node.type === "Identifier" || node.type === "MemberExpression";
	}
	/**
	* Check whether the given node is a MemberExpression of a possibly null object.
	* e.g.
	* - `(a?.b).c`
	* - `(null).foo`
	* @param {ASTNode} node The node to check.
	* @returns {boolean} `true` if the node is a MemberExpression of a possibly null object.
	*/
	function maybeNullObjectMemberExpression(node) {
		if (node.type !== "MemberExpression") return false;
		const { object } = node;
		if (object.type === "ChainExpression") return true;
		if (object.type === "Literal" && object.value === null && !object.bigint) return true;
		if (object.type === "MemberExpression") return maybeNullObjectMemberExpression(object);
		return false;
	}
	/**
	* Get the variable by names.
	* @param {string} name The variable name to find.
	* @param {VElement} leafNode The node to look up.
	* @returns {VVariable|null} The found variable or null.
	*/
	function getVariable(name, leafNode) {
		let node = leafNode;
		while (node != null) {
			const variables = node.variables;
			const variable = variables && variables.find((v) => v.id.name === name);
			if (variable != null) return variable;
			if (node.parent.type === "VDocumentFragment") break;
			node = node.parent;
		}
		return null;
	}
	/** @type {RuleModule}  */
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce valid `v-model` directives",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/valid-v-model.html"
			},
			fixable: null,
			schema: [],
			messages: {
				unexpectedInvalidElement: "'v-model' directives aren't supported on <{{name}}> elements.",
				unexpectedInputFile: "'v-model' directives don't support 'file' input type.",
				unexpectedArgument: "'v-model' directives require no argument.",
				unexpectedModifier: "'v-model' directives don't support the modifier '{{name}}'.",
				missingValue: "'v-model' directives require that attribute value.",
				unexpectedOptionalChaining: "Optional chaining cannot appear in 'v-model' directives.",
				unexpectedNonLhsExpression: "'v-model' directives require the attribute value which is valid as LHS.",
				unexpectedNullObject: "'v-model' directive has potential null object property access.",
				unexpectedUpdateIterationVariable: "'v-model' directives cannot update the iteration variable '{{varName}}' itself."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VDirective} node */
"VAttribute[directive=true][key.name.name='model']"(node) {
				const element = node.parent.parent;
				const name = element.name;
				if (!isValidElement(element)) context.report({
					node,
					messageId: "unexpectedInvalidElement",
					data: { name }
				});
				if (name === "input" && utils.hasAttribute(element, "type", "file")) context.report({
					node,
					messageId: "unexpectedInputFile"
				});
				if (!utils.isCustomComponent(element)) {
					if (node.key.argument) context.report({
						node: node.key.argument,
						messageId: "unexpectedArgument"
					});
					for (const modifier of node.key.modifiers) if (!VALID_MODIFIERS.has(modifier.name)) context.report({
						node: modifier,
						messageId: "unexpectedModifier",
						data: { name: modifier.name }
					});
				}
				if (!node.value || utils.isEmptyValueDirective(node, context)) {
					context.report({
						node,
						messageId: "missingValue"
					});
					return;
				}
				const expression = node.value.expression;
				if (!expression) return;
				if (isOptionalChainingMemberExpression(expression)) context.report({
					node: expression,
					messageId: "unexpectedOptionalChaining"
				});
				else if (!isLhs(expression)) context.report({
					node: expression,
					messageId: "unexpectedNonLhsExpression"
				});
				else if (maybeNullObjectMemberExpression(expression)) context.report({
					node: expression,
					messageId: "unexpectedNullObject"
				});
				for (const reference of node.value.references) {
					const id = reference.id;
					if (id.parent.type !== "VExpressionContainer") continue;
					if (getVariable(id.name, element) != null) context.report({
						node: expression,
						messageId: "unexpectedUpdateIterationVariable",
						data: { varName: id.name }
					});
				}
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_valid_v_model();
	}
});
;T&5x02/Fr)1syntaxes/define-model.js
/**
* @author Yosuke OtaGdefineMvsupported: ">=3.4.0"%0@returns {RuleListener} */
		createScriptVisitor$"9ScriptSetupVisitor(context, { onDefineModelEnter(node) {
DforbiddenDefineModel"
				});define_model();
	}
});
5anyxk"use strict";
const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_index = require("../../utils/index.js");
//#region lib/rules/syntaxes/define-options.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_define_options = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		supported: ">=3.3.0",
		/** @param {RuleContext} context @returns {RuleListener} */
		createScriptVisitor(context) {
			const sourceCode = context.sourceCode;
			return utils.defineScriptSetupVisitor(context, { onDefineOptionsEnter(node) {
				context.report({
					node,
					messageId: "forbiddenDefineOptions",
					fix(fixer) {
						return fix(fixer, node);
					}
				});
			} });
			/**
			* @param {RuleFixer} fixer
			* @param {CallExpression} node defineOptions() node
			*/
			function fix(fixer, node) {
				if (node.arguments.length === 0) return null;
				const scriptSetup = utils.getScriptSetupElement(context);
				if (!scriptSetup) return null;
				if (scriptSetup.parent.children.filter(utils.isVElement).some((node) => node.name === "script" && !utils.hasAttribute(node, "setup"))) return null;
				/** @type {ASTNode} */
				let statement = node;
				while (statement.parent && statement.parent.type !== "Program") statement = statement.parent;
				/** @type {Range} */
				const removeRange = [...statement.range];
				if (sourceCode.lines[statement.loc.start.line - 1].slice(0, statement.loc.start.column).trim() === "") removeRange[0] -= statement.loc.start.column;
				return [fixer.insertTextBefore(scriptSetup, `<script>\nexport default ${sourceCode.getText(node.arguments[0])}\n<\/script>\n`), fixer.removeRange(removeRange)];
			}
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_define_options();
	}
});
\x"2/Fr)0syntaxes/define-slots.js
/**
* @author Yosuke OtHdefine)v)module.exports = {
		supported: ">=3.3.0"%F@returns {RuleListener} */
		createScriptVisitor(context) {
			return 	=node) {
				
	$forbiddenDefineSlots"
				});
			} }define_slots();
	}
});
$\@x"use strict";
//#region lib/rules/syntaxes/dynamic-directive-arguments.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_dynamic_directive_arguments = /* @__PURE__ */ require("../../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	module.exports = {
		supported: ">=2.6.0",
		/** @param {RuleContext} context @returns {TemplateListener} */
		createTemplateBodyVisitor(context) {
			/**
			* Reports dynamic argument node
			* @param {VExpressionContainer} dynamicArgument node of dynamic argument
			* @returns {void}
			*/
			function reportDynamicArgument(dynamicArgument) {
				context.report({
					node: dynamicArgument,
					messageId: "forbiddenDynamicDirectiveArguments"
				});
			}
			return { "VAttribute[directive=true] > VDirectiveKey > VExpressionContainer": reportDynamicArgument };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_dynamic_directive_arguments();
	}
});
V\C8x}"use strict";
//#region lib/rules/syntaxes/is-attribute-with-vue-prefix.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_is_attribute_with_vue_prefix = /* @__PURE__ */ require("../../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	module.exports = {
		supported: ">=3.1.0",
		/** @param {RuleContext} context @returns {TemplateListener} */
		createTemplateBodyVisitor(context) {
			return { 
			/** @param {VAttribute} node */
"VAttribute[directive=false][key.name='is']"(node) {
				if (!node.value) return;
				if (node.value.value.startsWith("vue:")) context.report({
					node: node.value,
					messageId: "forbiddenIsAttributeWithVuePrefix"
				});
			} };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_is_attribute_with_vue_prefix();
	}
});
*>x"use strict";
//#region lib/rules/syntaxes/scope-attribute.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_scope_attribute = /* @__PURE__ */ require("../../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	module.exports = {
		deprecated: "2.5.0",
		supported: "<3.0.0",
		/** @param {RuleContext} context @returns {TemplateListener} */
		createTemplateBodyVisitor(context) {
			/**
			* Reports `scope` node
			* @param {VDirectiveKey} scopeKey node of `scope`
			* @returns {void}
			*/
			function reportScope(scopeKey) {
				context.report({
					node: scopeKey,
					messageId: "forbiddenScopeAttribute",
					fix: (fixer) => fixer.replaceText(scopeKey, "slot-scope")
				});
			}
			return { "VAttribute[directive=true] > VDirectiveKey[name.name='scope']": reportScope };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_scope_attribute();
	}
});
DFJ7xX2/Fr)	syntaxes/o$|)module.exports = {
		supported: ">=2.7.0"i%@returns {TemplateListener} */
		createScriptVisitor(context) {
			const scriptSetup = utils.getScriptSetupElement(context);
			if (!scriptSetup) return {};
			const reportNode = utils.getAttribute(scriptSetup, "setup") || scriptSetup.startTag;
			return { Program() {0: reportNodeYScriptSetup"
				});
			} }script_setup();
	}
});
jxpconst require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_index = require("../../utils/index.js");
const require_casing = require("../../utils/casing.js");
const require_regexp = require("../../utils/regexp.js");
const require_can_convert_to_v_slot$1 = require("./utils/can-convert-to-v-slot.js");
//#region lib/rules/syntaxes/slot-attribute.ts
var import_can_convert_to_v_slot = /* @__PURE__ */ require_runtime.__toESM(require_can_convert_to_v_slot$1.default);
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
var slot_attribute_default = {
	deprecated: "2.6.0",
	supported: "<3.0.0",
	createTemplateBodyVisitor(context) {
		const { ignore = [], ignoreParents = [] } = context.options[0] || {};
		const isAnyIgnored = require_regexp.toRegExpGroupMatcher(ignore);
		const isParentIgnored = require_regexp.toRegExpGroupMatcher(ignoreParents);
		const sourceCode = context.sourceCode;
		const tokenStore = sourceCode.parserServices.getTemplateBodyTokenStore && sourceCode.parserServices.getTemplateBodyTokenStore();
		/**
		* Checks whether the given node can convert to the `v-slot`.
		*/
		function canConvertFromSlotToVSlot(slotAttr) {
			if (!(0, import_can_convert_to_v_slot.default)(slotAttr.parent.parent, sourceCode, tokenStore)) return false;
			if (!slotAttr.value) return true;
			const slotName = slotAttr.value.value;
			return !/[^\w\-]/u.test(slotName);
		}
		/**
		* Checks whether the given node can convert to the `v-slot`.
		*/
		function canConvertFromVBindSlotToVSlot(slotAttr) {
			if (!(0, import_can_convert_to_v_slot.default)(slotAttr.parent.parent, sourceCode, tokenStore)) return false;
			if (!slotAttr.value) return true;
			if (!slotAttr.value.expression) return false;
			return slotAttr.value.expression.type === "Identifier";
		}
		/**
		* Convert to `v-slot`.
		*/
		function* fixSlotToVSlot(fixer, slotAttr, slotName, isVBind) {
			const startTag = slotAttr.parent;
			const scopeAttr = startTag.attributes.find((attr) => attr.directive === true && attr.key.name && (attr.key.name.name === "slot-scope" || attr.key.name.name === "scope"));
			let nameArgument = "";
			if (slotName) nameArgument = isVBind ? `:[${slotName}]` : `:${slotName}`;
			const scopeValue = scopeAttr && scopeAttr.value ? `=${sourceCode.getText(scopeAttr.value)}` : "";
			const replaceText = `v-slot${nameArgument}${scopeValue}`;
			const element = startTag.parent;
			if (element.name === "template") {
				yield fixer.replaceText(slotAttr || scopeAttr, replaceText);
				if (slotAttr && scopeAttr) yield fixer.remove(scopeAttr);
			} else {
				yield fixer.remove(slotAttr || scopeAttr);
				if (slotAttr && scopeAttr) yield fixer.remove(scopeAttr);
				const vFor = startTag.attributes.find((attr) => attr.directive && attr.key.name.name === "for");
				const vForText = vFor ? `${sourceCode.getText(vFor)} ` : "";
				if (vFor) yield fixer.remove(vFor);
				yield fixer.insertTextBefore(element, `<template ${vForText}${replaceText}>\n`);
				yield fixer.insertTextAfter(element, `\n</template>`);
			}
		}
		/**
		* Reports `slot` node
		*/
		function reportSlot(slotAttr) {
			const component = slotAttr.parent.parent;
			const componentName = component.rawName;
			if (isAnyIgnored(componentName, require_casing.pascalCase(componentName), require_casing.kebabCase(componentName))) return;
			const parent = component.parent;
			const parentName = import_utils.default.isVElement(parent) ? parent.rawName : null;
			if (parentName && isParentIgnored(parentName)) return;
			context.report({
				node: slotAttr.key,
				messageId: "forbiddenSlotAttribute",
				*fix(fixer) {
					if (!canConvertFromSlotToVSlot(slotAttr)) return;
					yield* fixSlotToVSlot(fixer, slotAttr, slotAttr.value && slotAttr.value.value, false);
				}
			});
		}
		/**
		* Reports `v-bind:slot` node
		*/
		function reportVBindSlot(slotAttr) {
			context.report({
				node: slotAttr.key,
				messageId: "forbiddenSlotAttribute",
				*fix(fixer) {
					if (!canConvertFromVBindSlotToVSlot(slotAttr)) return;
					yield* fixSlotToVSlot(fixer, slotAttr, slotAttr.value && slotAttr.value.expression && sourceCode.getText(slotAttr.value.expression).trim(), true);
				}
			});
		}
		return {
			"VAttribute[directive=false][key.name='slot']": reportSlot,
			"VAttribute[directive=true][key.name.name='bind'][key.argument.name='slot']": reportVBindSlot
		};
	}
};
//#endregion
exports.default = slot_attribute_default;
X$x"use strict";
const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_can_convert_to_v_slot$1 = require("./utils/can-convert-to-v-slot.js");
//#region lib/rules/syntaxes/slot-scope-attribute.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_slot_scope_attribute = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const canConvertToVSlotForElement = require_can_convert_to_v_slot$1.default;
	module.exports = {
		deprecated: "2.6.0",
		supported: ">=2.5.0 <3.0.0",
		/**
		* @param {RuleContext} context
		* @param {object} option
		* @param {boolean} [option.fixToUpgrade]
		* @returns {TemplateListener}
		*/
		createTemplateBodyVisitor(context, { fixToUpgrade } = {}) {
			const sourceCode = context.sourceCode;
			const tokenStore = sourceCode.parserServices.getTemplateBodyTokenStore && sourceCode.parserServices.getTemplateBodyTokenStore();
			/**
			* Checks whether the given node can convert to the `v-slot`.
			* @param {VStartTag} startTag node of `<element v-slot ... >`
			* @returns {boolean} `true` if the given node can convert to the `v-slot`
			*/
			function canConvertToVSlot(startTag) {
				if (!canConvertToVSlotForElement(startTag.parent, sourceCode, tokenStore)) return false;
				if (startTag.attributes.find((attr) => attr.directive === false && attr.key.name === "slot")) return false;
				return !startTag.attributes.find((attr) => attr.directive === true && attr.key.name.name === "bind" && attr.key.argument && attr.key.argument.type === "VIdentifier" && attr.key.argument.name === "slot");
			}
			/**
			* Convert to `v-slot`.
			* @param {RuleFixer} fixer fixer
			* @param {VDirective} scopeAttr node of `slot-scope`
			* @returns {Fix[]} fix data
			*/
			function fixSlotScopeToVSlot(fixer, scopeAttr) {
				const element = scopeAttr.parent.parent;
				const replaceText = `v-slot${scopeAttr && scopeAttr.value ? `=${sourceCode.getText(scopeAttr.value)}` : ""}`;
				if (element.name === "template") return [fixer.replaceText(scopeAttr, replaceText)];
				const tokenBefore = tokenStore.getTokenBefore(scopeAttr);
				return [
					fixer.removeRange([tokenBefore.range[1], scopeAttr.range[1]]),
					fixer.insertTextBefore(element, `<template ${replaceText}>\n`),
					fixer.insertTextAfter(element, `\n</template>`)
				];
			}
			/**
			* Reports `slot-scope` node
			* @param {VDirective} scopeAttr node of `slot-scope`
			* @returns {void}
			*/
			function reportSlotScope(scopeAttr) {
				context.report({
					node: scopeAttr.key,
					messageId: "forbiddenSlotScopeAttribute",
					fix(fixer) {
						if (!fixToUpgrade) return null;
						const startTag = scopeAttr.parent;
						if (!canConvertToVSlot(startTag)) return null;
						return fixSlotScopeToVSlot(fixer, scopeAttr);
					}
				});
			}
			return { "VAttribute[directive=true][key.name.name='slot-scope']": reportSlotScope };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_slot_scope_attribute();
	}
});
88 (xqconst require_index = require("../../utils/style-variables/index.js");
//#region lib/rules/syntaxes/style-css-vars-injection.ts
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var style_css_vars_injection_default = {
	supported: ">=3.0.3 || >=2.7.0 <3.0.0",
	createScriptVisitor(context) {
		const styleVars = require_index.getStyleVariablesContext(context);
		if (!styleVars) return {};
		return { Program() {
			for (const vBind of styleVars.vBinds) context.report({
				node: vBind,
				messageId: "forbiddenStyleCssVarsInjection"
			});
		} };
	}
};
//#endregion
exports.default = style_css_vars_injection_default;
;x4 100644 can-convert-to-v-slot.js -Vw ,)3k=:mQH)x]"use strict";
const require_runtime = require("../../../_virtual/_rolldown/runtime.js");
const require_index = require("../../../utils/index.js");
//#region lib/rules/syntaxes/utils/can-convert-to-v-slot.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_can_convert_to_v_slot = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef {object} SlotVForVariables
	* @property {VForExpression} expr
	* @property {VVariable[]} variables
	*/
	/**
	* @typedef {object} SlotContext
	* @property {VElement} element
	* @property {VAttribute | VDirective | null} slot
	* @property {VDirective | null} vFor
	* @property {SlotVForVariables | null} slotVForVars
	* @property {string} normalizedName
	*/
	/**
	* Checks whether the given element can use v-slot.
	* @param {VElement} element
	* @param {SourceCode} sourceCode
	* @param {ParserServices.TokenStore} tokenStore
	*/
	module.exports = function canConvertToVSlot(element, sourceCode, tokenStore) {
		const ownerElement = element.parent;
		if (ownerElement.type === "VDocumentFragment" || !utils.isCustomComponent(ownerElement) || ownerElement.name === "component") return false;
		const slot = getSlotContext(element, sourceCode);
		if (slot.vFor && !slot.slotVForVars) return false;
		return !hasSameSlotDirective(ownerElement, slot, sourceCode, tokenStore);
	};
	/**
	* @param {VElement} element
	* @param {SourceCode} sourceCode
	* @returns {SlotContext}
	*/
	function getSlotContext(element, sourceCode) {
		const slot = utils.getAttribute(element, "slot") || utils.getDirective(element, "bind", "slot");
		const vFor = utils.getDirective(element, "for");
		return {
			element,
			slot,
			vFor,
			slotVForVars: getSlotVForVariableIfUsingIterationVars(slot, vFor),
			normalizedName: getNormalizedName(slot, sourceCode)
		};
	}
	/**
	* Gets the `v-for` directive and variable that provide the variables used by the given `slot` attribute.
	* @param {VAttribute | VDirective | null} slot The current `slot` attribute node.
	* @param {VDirective | null} [vFor] The current `v-for` directive node.
	* @returns { SlotVForVariables | null } The SlotVForVariables.
	*/
	function getSlotVForVariableIfUsingIterationVars(slot, vFor) {
		if (!slot || !slot.directive) return null;
		const expr = vFor && vFor.value && vFor.value.expression;
		const variables = expr && getUsingIterationVars(slot.value, slot.parent.parent);
		return expr && variables && variables.length > 0 ? {
			expr,
			variables
		} : null;
	}
	/**
	* Gets iterative variables if a given expression node is using iterative variables that the element defined.
	* @param {VExpressionContainer|null} expression The expression node to check.
	* @param {VElement} element The element node which has the expression.
	* @returns {VVariable[]} The expression node is using iteration variables.
	*/
	function getUsingIterationVars(expression, element) {
		const vars = [];
		if (expression && expression.type === "VExpressionContainer") {
			for (const { variable } of expression.references) if (variable != null && variable.kind === "v-for" && variable.id.range[0] > element.startTag.range[0] && variable.id.range[1] < element.startTag.range[1]) vars.push(variable);
		}
		return vars;
	}
	/**
	* Get the normalized name of a given `slot` attribute node.
	* @param {VAttribute | VDirective | null} slotAttr node of `slot`
	* @param {SourceCode} sourceCode The source code.
	* @returns {string} The normalized name.
	*/
	function getNormalizedName(slotAttr, sourceCode) {
		if (!slotAttr) return "default";
		if (!slotAttr.directive) return slotAttr.value ? slotAttr.value.value : "default";
		return slotAttr.value ? `[${sourceCode.getText(slotAttr.value)}]` : "[null]";
	}
	/**
	* Checks whether parent element has the same slot as the given slot.
	* @param {VElement} ownerElement The parent element.
	* @param {SlotContext} targetSlot The SlotContext with a slot to check if they are the same.
	* @param {SourceCode} sourceCode
	* @param {ParserServices.TokenStore} tokenStore
	*/
	function hasSameSlotDirective(ownerElement, targetSlot, sourceCode, tokenStore) {
		for (const group of utils.iterateChildElementsChains(ownerElement)) {
			if (group.includes(targetSlot.element)) continue;
			for (const childElement of group) {
				const slot = getSlotContext(childElement, sourceCode);
				if (!targetSlot.slotVForVars || !slot.slotVForVars) {
					if (!targetSlot.slotVForVars && !slot.slotVForVars && targetSlot.normalizedName === slot.normalizedName) return true;
				} else if (equalSlotVForVariables(targetSlot.slotVForVars, slot.slotVForVars, tokenStore)) return true;
			}
		}
		return false;
	}
	/**
	* Determines whether the two given `v-slot` variables are considered to be equal.
	* @param {SlotVForVariables} a First element.
	* @param {SlotVForVariables} b Second element.
	* @param {ParserServices.TokenStore} tokenStore The token store.
	* @returns {boolean} `true` if the elements are considered to be equal.
	*/
	function equalSlotVForVariables(a, b, tokenStore) {
		if (a.variables.length !== b.variables.length) return false;
		if (!equal(a.expr.right, b.expr.right)) return false;
		const checkedVarNames = /* @__PURE__ */ new Set();
		const len = Math.min(a.expr.left.length, b.expr.left.length);
		for (let index = 0; index < len; index++) {
			const aPtn = a.expr.left[index];
			const bPtn = b.expr.left[index];
			const aVar = a.variables.find((v) => aPtn.range[0] <= v.id.range[0] && v.id.range[1] <= aPtn.range[1]);
			const bVar = b.variables.find((v) => bPtn.range[0] <= v.id.range[0] && v.id.range[1] <= bPtn.range[1]);
			if (aVar && bVar) {
				if (aVar.id.name !== bVar.id.name) return false;
				if (!equal(aPtn, bPtn)) return false;
				checkedVarNames.add(aVar.id.name);
			} else if (aVar || bVar) return false;
		}
		return a.variables.every((v) => checkedVarNames.has(v.id.name) || b.variables.some((bv) => v.id.name === bv.id.name));
		/**
		* Determines whether the two given nodes are considered to be equal.
		* @param {ASTNode} a First node.
		* @param {ASTNode} b Second node.
		* @returns {boolean} `true` if the nodes are considered to be equal.
		*/
		function equal(a, b) {
			if (a.type !== b.type) return false;
			return utils.equalTokens(a, b, tokenStore);
		}
	}
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_can_convert_to_v_slot();
	}
});
yp?x"use strict";
//#region lib/rules/syntaxes/v-bind-attr-modifier.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_v_bind_attr_modifier = /* @__PURE__ */ require("../../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	module.exports = {
		supported: ">=3.2.0",
		/** @param {RuleContext} context @returns {TemplateListener} */
		createTemplateBodyVisitor(context) {
			/**
			* Reports `v-bind.attr` node
			* @param { VIdentifier } mod node of `v-bind.attr`
			* @returns {void}
			*/
			function report(mod) {
				context.report({
					node: mod,
					messageId: "forbiddenVBindAttrModifier"
				});
			}
			return { "VAttribute[directive=true][key.name.name='bind']"(node) {
				const attrMod = node.key.modifiers.find((m) => m.name === "attr");
				if (attrMod) report(attrMod);
			} };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_v_bind_attr_modifier();
	}
});
HOKxI"use strict";
//#region lib/rules/syntaxes/v-bind-prop-modifier-shorthand.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_v_bind_prop_modifier_shorthand = /* @__PURE__ */ require("../../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	module.exports = {
		supported: ">=3.2.0 || >=2.6.0-beta.1 <=2.6.0-beta.3",
		/** @param {RuleContext} context @returns {TemplateListener} */
		createTemplateBodyVisitor(context) {
			/**
			* Reports `.prop` shorthand node
			* @param { VDirectiveKey & { argument: VIdentifier } } bindPropKey node of `.prop` shorthand
			* @returns {void}
			*/
			function reportPropModifierShorthand(bindPropKey) {
				context.report({
					node: bindPropKey,
					messageId: "forbiddenVBindPropModifierShorthand",
					fix: (fixer) => fixer.replaceText(bindPropKey, `:${bindPropKey.argument.rawName}.prop`)
				});
			}
			return { "VAttribute[directive=true] > VDirectiveKey[name.name='bind'][name.rawName='.']": reportPropModifierShorthand };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_v_bind_prop_modifier_shorthand();
	}
});
<SŶKxI"use strict";
const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_index = require("../../utils/index.js");
//#region lib/rules/syntaxes/v-bind-same-name-shorthand.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_v_bind_same_name_shorthand = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		supported: ">=3.4.0",
		/** @param {RuleContext} context @returns {TemplateListener} */
		createTemplateBodyVisitor(context) {
			/**
			* Verify the directive node
			* @param {VDirective} node The directive node to check
			* @returns {void}
			*/
			function checkDirective(node) {
				if (utils.isVBindSameNameShorthand(node)) context.report({
					node,
					messageId: "forbiddenVBindSameNameShorthand",
					fix: (fixer) => fixer.insertTextAfter(node, `="${node.value.expression.name}"`)
				});
			}
			return { "VAttribute[directive=true][key.name.name='bind']": checkDirective };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_v_bind_same_name_shorthand();
	}
});
 ԓ6xf"use strict";
//#region lib/rules/syntaxes/v-is.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_v_is = /* @__PURE__ */ require("../../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	module.exports = {
		deprecated: "3.1.0",
		supported: ">=3.0.0",
		/** @param {RuleContext} context @returns {TemplateListener} */
		createTemplateBodyVisitor(context) {
			/**
			* Reports `v-is` node
			* @param {VDirective} vIsAttr node of `v-is`
			* @returns {void}
			*/
			function reportVIs(vIsAttr) {
				context.report({
					node: vIsAttr.key,
					messageId: "forbiddenVIs"
				});
			}
			return { "VAttribute[directive=true][key.name.name='is']": reportVIs };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_v_is();
	}
});
q6xc"use strict";
//#region lib/rules/syntaxes/v-memo.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_v_memo = /* @__PURE__ */ require("../../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	module.exports = {
		supported: ">=3.2.0",
		/** @param {RuleContext} context @returns {TemplateListener} */
		createTemplateBodyVisitor(context) {
			/**
			* Reports `v-is` node
			* @param {VDirective} vMemoAttr node of `v-is`
			* @returns {void}
			*/
			function reportVMemo(vMemoAttr) {
				context.report({
					node: vMemoAttr.key,
					messageId: "forbiddenVMemo"
				});
			}
			return { "VAttribute[directive=true][key.name.name='memo']": reportVMemo };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_v_memo();
	}
});
D6xj"use strict";
//#region lib/rules/syntaxes/v-model-argument.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_v_model_argument = /* @__PURE__ */ require("../../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	module.exports = {
		supported: ">=3.0.0",
		/** @param {RuleContext} context @returns {TemplateListener} */
		createTemplateBodyVisitor(context) {
			return { 
			/** @param {VDirectiveKey & { argument: VExpressionContainer | VIdentifier }} node */
"VAttribute[directive=true] > VDirectiveKey[name.name='model'][argument!=null]"(node) {
				context.report({
					node: node.argument,
					messageId: "forbiddenVModelArgument"
				});
			} };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_v_model_argument();
	}
});
e"ְ@x "use strict";
//#region lib/rules/syntaxes/v-model-custom-modifiers.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_v_model_custom_modifiers = /* @__PURE__ */ require("../../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	const BUILTIN_MODIFIERS = /* @__PURE__ */ new Set([
		"lazy",
		"number",
		"trim"
	]);
	module.exports = {
		supported: ">=3.0.0",
		/** @param {RuleContext} context @returns {TemplateListener} */
		createTemplateBodyVisitor(context) {
			return { 
			/** @param {VDirectiveKey} node */
"VAttribute[directive=true] > VDirectiveKey[name.name='model'][modifiers.length>0]"(node) {
				for (const modifier of node.modifiers) if (!BUILTIN_MODIFIERS.has(modifier.name)) context.report({
					node: modifier,
					messageId: "forbiddenVModelCustomModifiers"
				});
			} };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_v_model_custom_modifiers();
	}
});
TOZx"use strict";
//#region lib/rules/syntaxes/v-slot.js
/**
* @author Yosuke Ota
* See LICENSE file in root directory for full license.
*/
var require_v_slot = /* @__PURE__ */ require("../../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	/**
	* Checks whether the given node can convert to the `slot`.
	* @param {VDirective} vSlotAttr node of `v-slot`
	* @returns {boolean} `true` if the given node can convert to the `slot`
	*/
	function canConvertToSlot(vSlotAttr) {
		return vSlotAttr.parent.parent.name === "template";
	}
	module.exports = {
		supported: ">=2.6.0",
		/** @param {RuleContext} context @returns {TemplateListener} */
		createTemplateBodyVisitor(context) {
			const sourceCode = context.sourceCode;
			/**
			* Convert to `slot` and `slot-scope`.
			* @param {RuleFixer} fixer fixer
			* @param {VDirective} vSlotAttr node of `v-slot`
			* @returns {null|Fix} fix data
			*/
			function fixVSlotToSlot(fixer, vSlotAttr) {
				const key = vSlotAttr.key;
				if (key.modifiers.length > 0) return null;
				const attrs = [];
				const argument = key.argument;
				if (argument) if (argument.type === "VIdentifier") {
					const name = argument.rawName;
					attrs.push(`slot="${name}"`);
				} else if (argument.type === "VExpressionContainer" && argument.expression) {
					const expression = sourceCode.getText(argument.expression);
					attrs.push(`:slot="${expression}"`);
				} else return null;
				const scopedValueNode = vSlotAttr.value;
				if (scopedValueNode) attrs.push(`slot-scope=${sourceCode.getText(scopedValueNode)}`);
				if (attrs.length === 0) attrs.push("slot");
				return fixer.replaceText(vSlotAttr, attrs.join(" "));
			}
			/**
			* Reports `v-slot` node
			* @param {VDirective} vSlotAttr node of `v-slot`
			* @returns {void}
			*/
			function reportVSlot(vSlotAttr) {
				context.report({
					node: vSlotAttr.key,
					messageId: "forbiddenVSlot",
					fix(fixer) {
						if (!canConvertToSlot(vSlotAttr)) return null;
						return fixVSlotToSlot(fixer, vSlotAttr);
					}
				});
			}
			return { "VAttribute[directive=true][key.name.name='slot']": reportVSlot };
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_v_slot();
	}
});
ؼ"xd"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_js_reserved$1 = require("../utils/js-reserved.js");
//#region lib/rules/this-in-template.js
/**
* @fileoverview disallow usage of `this` in template.
* @author Armano
*/
var require_this_in_template = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const RESERVED_NAMES = new Set(require_js_reserved$1.default);
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "disallow usage of `this` in template",
				categories: ["vue3-recommended", "vue2-recommended"],
				url: "https://eslint.vuejs.org/rules/this-in-template.html"
			},
			fixable: "code",
			schema: [{ enum: ["always", "never"] }],
			messages: {
				unexpected: "Unexpected usage of 'this'.",
				expected: "Expected 'this'."
			}
		},
		/**
		* Creates AST event handlers for this-in-template.
		*
		* @param {RuleContext} context - The rule context.
		* @returns {RuleListener} AST event handlers.
		*/
		create(context) {
			const options = context.options[0] === "always" ? "always" : "never";
			/**
			* @typedef {object} ScopeStack
			* @property {ScopeStack | null} parent
			* @property {Identifier[]} nodes
			*/
			/** @type {ScopeStack | null} */
			let scopeStack = null;
			return utils.defineTemplateBodyVisitor(context, {
				/** @param {VElement} node */
				VElement(node) {
					scopeStack = {
						parent: scopeStack,
						nodes: scopeStack ? [...scopeStack.nodes] : []
					};
					if (node.variables) for (const variable of node.variables) {
						const varNode = variable.id;
						const name = varNode.name;
						if (scopeStack.nodes.every((node) => node.name !== name)) scopeStack.nodes.push(varNode);
					}
				},
				"VElement:exit"() {
					scopeStack &&= scopeStack.parent;
				},
				...options === "never" ? { 
				/** @param { ThisExpression & { parent: MemberExpression } } node */
"VExpressionContainer MemberExpression > ThisExpression"(node) {
					if (!scopeStack) return;
					const propertyName = utils.getStaticPropertyName(node.parent);
					if (!propertyName || scopeStack.nodes.some((el) => el.name === propertyName) || RESERVED_NAMES.has(propertyName) || /^\d.*$|[^\w$]/.test(propertyName)) return;
					context.report({
						node,
						loc: node.loc,
						fix(fixer) {
							return fixer.replaceText(node.parent, propertyName);
						},
						messageId: "unexpected"
					});
				} } : { 
				/** @param {VExpressionContainer} node */
VExpressionContainer(node) {
					if (!scopeStack) return;
					if (node.parent.type === "VDirectiveKey") return;
					if (node.references) {
						for (const reference of node.references) if (scopeStack.nodes.every((el) => el.name !== reference.id.name)) context.report({
							node: reference.id,
							loc: reference.id.loc,
							messageId: "expected",
							fix(fixer) {
								return fixer.insertTextBefore(reference.id, "this.");
							}
						});
					}
				} }
			});
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_this_in_template();
	}
});
t,x3"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/use-v-on-exact.js
/**
* @fileoverview enforce usage of `exact` modifier on `v-on`.
* @author Armano
*/
var require_use_v_on_exact = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	/**
	* @typedef { {name: string, node: VDirectiveKey, modifiers: string[] } } EventDirective
	*/
	const utils = require_index.default;
	const SYSTEM_MODIFIERS = /* @__PURE__ */ new Set([
		"ctrl",
		"shift",
		"alt",
		"meta"
	]);
	const GLOBAL_MODIFIERS = /* @__PURE__ */ new Set([
		"stop",
		"prevent",
		"capture",
		"self",
		"once",
		"passive",
		"native"
	]);
	/**
	* Finds and returns all keys for event directives
	*
	* @param {VStartTag} startTag Element startTag
	* @param {SourceCode} sourceCode The source code object.
	* @returns {EventDirective[]} [{ name, node, modifiers }]
	*/
	function getEventDirectives(startTag, sourceCode) {
		return utils.getDirectives(startTag, "on").map((attribute) => ({
			name: attribute.key.argument ? sourceCode.getText(attribute.key.argument) : "",
			node: attribute.key,
			modifiers: attribute.key.modifiers.map((modifier) => modifier.name)
		}));
	}
	/**
	* Checks whether given modifier is key modifier
	*
	* @param {string} modifier
	* @returns {boolean}
	*/
	function isKeyModifier(modifier) {
		return !GLOBAL_MODIFIERS.has(modifier) && !SYSTEM_MODIFIERS.has(modifier);
	}
	/**
	* Checks whether given modifier is system one
	*
	* @param {string} modifier
	* @returns {boolean}
	*/
	function isSystemModifier(modifier) {
		return SYSTEM_MODIFIERS.has(modifier);
	}
	/**
	* Checks whether given any of provided modifiers
	* has system modifier
	*
	* @param {string[]} modifiers
	* @returns {boolean}
	*/
	function hasSystemModifier(modifiers) {
		return modifiers.some(isSystemModifier);
	}
	/**
	* Groups all events in object,
	* with keys represinting each event name
	*
	* @param {EventDirective[]} events
	* @returns { { [key: string]: EventDirective[] } } { click: [], keypress: [] }
	*/
	function groupEvents(events) {
		/** @type { { [key: string]: EventDirective[] } } */
		const grouped = {};
		for (const event of events) {
			if (!grouped[event.name]) grouped[event.name] = [];
			grouped[event.name].push(event);
		}
		return grouped;
	}
	/**
	* Creates alphabetically sorted string with system modifiers
	*
	* @param {string[]} modifiers
	* @returns {string} e.g. "alt,ctrl,del,shift"
	*/
	function getSystemModifiersString(modifiers) {
		return modifiers.filter(isSystemModifier).sort((a, b) => a.localeCompare(b)).join(",");
	}
	/**
	* Creates alphabetically sorted string with key modifiers
	*
	* @param {string[]} modifiers
	* @returns {string} e.g. "enter,tab"
	*/
	function getKeyModifiersString(modifiers) {
		return modifiers.filter(isKeyModifier).sort((a, b) => a.localeCompare(b)).join(",");
	}
	/**
	* Compares two events based on their modifiers
	* to detect possible event leakeage
	*
	* @param {EventDirective} baseEvent
	* @param {EventDirective} event
	* @returns {boolean}
	*/
	function hasConflictedModifiers(baseEvent, event) {
		if (event.node === baseEvent.node || event.modifiers.includes("exact")) return false;
		const eventKeyModifiers = getKeyModifiersString(event.modifiers);
		const baseEventKeyModifiers = getKeyModifiersString(baseEvent.modifiers);
		if (eventKeyModifiers && baseEventKeyModifiers && eventKeyModifiers !== baseEventKeyModifiers) return false;
		const eventSystemModifiers = getSystemModifiersString(event.modifiers);
		const baseEventSystemModifiers = getSystemModifiersString(baseEvent.modifiers);
		return baseEvent.modifiers.length > 0 && baseEventSystemModifiers !== eventSystemModifiers && baseEventSystemModifiers.includes(eventSystemModifiers);
	}
	/**
	* Searches for events that might conflict with each other
	*
	* @param {EventDirective[]} events
	* @returns {EventDirective[]} conflicted events, without duplicates
	*/
	function findConflictedEvents(events) {
		/** @type {EventDirective[]} */
		const conflictedEvents = [];
		for (const event of events) conflictedEvents.push(...events.filter((evt) => !conflictedEvents.includes(evt)).filter(hasConflictedModifiers.bind(null, event)));
		return conflictedEvents;
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "enforce usage of `exact` modifier on `v-on`",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/use-v-on-exact.html"
			},
			fixable: null,
			schema: [],
			messages: { considerExact: "Consider to use '.exact' modifier." }
		},
		/**
		* Creates AST event handlers for use-v-on-exact.
		*
		* @param {RuleContext} context - The rule context.
		* @returns {RuleListener} AST event handlers.
		*/
		create(context) {
			const sourceCode = context.sourceCode;
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VStartTag} node */
VStartTag(node) {
				if (node.attributes.length === 0) return;
				const isCustomComponent = utils.isCustomComponent(node.parent);
				let events = getEventDirectives(node, sourceCode);
				if (isCustomComponent) events = events.filter((event) => event.modifiers.includes("native"));
				const grouppedEvents = groupEvents(events);
				for (const eventsInGroup of Object.values(grouppedEvents)) {
					if (!eventsInGroup.some((event) => hasSystemModifier(event.modifiers))) continue;
					const conflictedEvents = findConflictedEvents(eventsInGroup);
					for (const e of conflictedEvents) context.report({
						node: e.node,
						loc: e.node.loc,
						messageId: "considerExact"
					});
				}
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_use_v_on_exact();
	}
});
xSconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
//#region lib/rules/v-bind-style.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
function kebabCaseToCamelCase(name) {
	return require_casing.isKebabCase(name) ? require_casing.camelCase(name) : name;
}
function isSameName(node) {
	const attrName = node.key.argument.type === "VIdentifier" ? node.key.argument.rawName : null;
	const valueName = node.value?.expression?.type === "Identifier" ? node.value.expression.name : null;
	if (!attrName || !valueName) return false;
	return kebabCaseToCamelCase(attrName) === kebabCaseToCamelCase(valueName);
}
function getCutStart(key) {
	return (key.modifiers.at(-1) || key.argument).range[1];
}
var v_bind_style_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "enforce `v-bind` directive style",
			categories: ["vue3-strongly-recommended", "vue2-strongly-recommended"],
			url: "https://eslint.vuejs.org/rules/v-bind-style.html"
		},
		fixable: "code",
		schema: [{ enum: ["shorthand", "longform"] }, {
			type: "object",
			properties: { sameNameShorthand: { enum: [
				"always",
				"never",
				"ignore"
			] } },
			additionalProperties: false
		}],
		messages: {
			expectedLonghand: "Expected 'v-bind' before ':'.",
			unexpectedLonghand: "Unexpected 'v-bind' before ':'.",
			expectedLonghandForProp: "Expected 'v-bind:' instead of '.'.",
			expectedShorthand: "Expected same-name shorthand.",
			unexpectedShorthand: "Unexpected same-name shorthand."
		}
	},
	create(context) {
		const shouldPreferShorthand = context.options[0] !== "longform";
		const sameNameShorthand = context.options[1]?.sameNameShorthand || "ignore";
		function checkAttributeStyle(node) {
			const isShorthandProp = node.key.name.rawName === ".";
			if ((node.key.name.rawName === ":" || isShorthandProp) === shouldPreferShorthand) return;
			let messageId = "expectedLonghand";
			if (shouldPreferShorthand) messageId = "unexpectedLonghand";
			else if (isShorthandProp) messageId = "expectedLonghandForProp";
			context.report({
				node,
				loc: node.loc,
				messageId,
				*fix(fixer) {
					if (shouldPreferShorthand) yield fixer.remove(node.key.name);
					else {
						yield fixer.insertTextBefore(node, "v-bind");
						if (isShorthandProp) {
							yield fixer.replaceText(node.key.name, ":");
							const modifier = node.key.modifiers[0];
							if (modifier.name === "prop" && modifier.rawName === "") yield fixer.insertTextBefore(modifier, ".prop");
						}
					}
				}
			});
		}
		function checkAttributeSameName(node) {
			if (sameNameShorthand === "ignore" || !isSameName(node)) return;
			const isPreferShorthand = sameNameShorthand === "always";
			if (import_utils.default.isVBindSameNameShorthand(node) === isPreferShorthand) return;
			const messageId = isPreferShorthand ? "expectedShorthand" : "unexpectedShorthand";
			context.report({
				node,
				loc: node.loc,
				messageId,
				*fix(fixer) {
					if (isPreferShorthand) {
						const valueRange = [getCutStart(node.key), node.range[1]];
						yield fixer.removeRange(valueRange);
					} else if (node.key.argument.type === "VIdentifier") yield fixer.insertTextAfter(node, `="${kebabCaseToCamelCase(node.key.argument.rawName)}"`);
				}
			});
		}
		return import_utils.default.defineTemplateBodyVisitor(context, { "VAttribute[directive=true][key.name.name='bind'][key.argument!=null]"(node) {
			checkAttributeSameName(node);
			checkAttributeStyle(node);
		} });
	}
};
//#endregion
exports.default = v_bind_style_default;
<'}x-"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/v-for-delimiter-style.js
/**
* @fileoverview enforce `v-for` directive's delimiter style
* @author Flo Edelmann
* @copyright 2020 Flo Edelmann. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_v_for_delimiter_style = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "layout",
			docs: {
				description: "enforce `v-for` directive's delimiter style",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/v-for-delimiter-style.html"
			},
			fixable: "code",
			schema: [{ enum: ["in", "of"] }],
			messages: { expected: "Expected '{{preferredDelimiter}}' instead of '{{usedDelimiter}}' in 'v-for'." }
		},
		/** @param {RuleContext} context */
		create(context) {
			const preferredDelimiter = context.options[0] || "in";
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VForExpression} node */
VForExpression(node) {
				const sourceCode = context.sourceCode;
				const tokenStore = sourceCode.parserServices.getTemplateBodyTokenStore && sourceCode.parserServices.getTemplateBodyTokenStore();
				const lastLeftNode = node.left.at(-1);
				const delimiterToken = tokenStore.getTokenAfter(lastLeftNode ?? tokenStore.getFirstToken(node), (token) => token.type !== "Punctuator");
				if (delimiterToken.value === preferredDelimiter) return;
				context.report({
					node,
					loc: node.loc,
					messageId: "expected",
					data: {
						preferredDelimiter,
						usedDelimiter: delimiterToken.value
					},
					*fix(fixer) {
						yield fixer.replaceText(delimiterToken, preferredDelimiter);
					}
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_v_for_delimiter_style();
	}
});
xI const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
//#region lib/rules/v-if-else-key.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
/**
* Checks if a given node has sibling nodes of the same type that are also conditionally rendered.
* This is used to determine if multiple instances of the same component are being conditionally
* rendered within the same parent scope.
*
* @param node - The Vue component node to check for conditional rendering siblings.
* @param componentName - The name of the component to check for sibling instances.
* @returns True if there are sibling nodes of the same type and conditionally rendered, false otherwise.
*/
const hasConditionalRenderedSiblings = (node, componentName) => {
	if (!node.parent || node.parent.type !== "VElement") return false;
	return node.parent.children.some((sibling) => sibling !== node && sibling.type === "VElement" && sibling.rawName === componentName && hasConditionalDirective(sibling));
};
/**
* Checks for the presence of a 'key' attribute in the given node. If the 'key' attribute is missing
* and the node is part of a conditional family a report is generated.
* The fix proposed adds a unique key based on the component's name and count,
* following the format '${kebabCase(componentName)}-${componentCount}', e.g., 'some-component-2'.
*
* @param node - The Vue component node to check for a 'key' attribute.
* @param context - The rule's context object, used for reporting.
* @param componentName - Name of the component.
* @param uniqueKey - A unique key for the repeated component, used for the fix.
* @param conditionalFamilies - Map of conditionally rendered components and their respective conditional directives.
*/
const checkForKey = (node, context, componentName, uniqueKey, conditionalFamilies) => {
	if (!node.parent || node.parent.type !== "VElement" || !hasConditionalRenderedSiblings(node, componentName)) return;
	const conditionalFamily = conditionalFamilies.get(node.parent);
	if (!conditionalFamily || import_utils.default.hasAttribute(node, "key")) return;
	if (conditionalFamily.if === node || conditionalFamily.else === node || conditionalFamily.elseIf.includes(node)) context.report({
		node: node.startTag,
		loc: node.startTag.loc,
		messageId: "requireKey",
		data: { componentName },
		fix(fixer) {
			const afterComponentNamePosition = node.startTag.range[0] + componentName.length + 1;
			return fixer.insertTextBeforeRange([afterComponentNamePosition, afterComponentNamePosition], ` key="${uniqueKey}"`);
		}
	});
};
/**
* Checks for the presence of conditional directives in the given node.
*
* @param node - The node to check for conditional directives.
* @returns Returns true if a conditional directive is found in the node or its parents,
*   false otherwise.
*/
const hasConditionalDirective = (node) => import_utils.default.hasDirective(node, "if") || import_utils.default.hasDirective(node, "else-if") || import_utils.default.hasDirective(node, "else");
var v_if_else_key_default = {
	meta: {
		type: "problem",
		docs: {
			description: "require key attribute for conditionally rendered repeated components",
			categories: null,
			url: "https://eslint.vuejs.org/rules/v-if-else-key.html"
		},
		fixable: "code",
		schema: [],
		messages: { requireKey: "Conditionally rendered repeated component '{{componentName}}' expected to have a 'key' attribute." }
	},
	/**
	* Creates and returns a rule object which checks usage of repeated components. If a component
	* is used more than once, it checks for the presence of a key.
	*
	* @returns A dictionary of functions to be called on traversal of the template body by
	*   the eslint parser.
	*/
	create(context) {
		/**
		* Map to store conditionally rendered components and their respective conditional directives.
		*
		* @type {Map<VElement, ConditionalFamily>}
		*/
		const conditionalFamilies = /* @__PURE__ */ new Map();
		/**
		* Array of Maps to keep track of components and their usage counts along with the first
		* node instance. Each Map represents a different scope level, and maps a component name to
		* an object containing the count and a reference to the first node.
		*/
		/** @type {Map<string, { count: number; firstNode: any }>[]} */
		const componentUsageStack = [/* @__PURE__ */ new Map()];
		/**
		* Checks if a given node represents a custom component without any conditional directives.
		*
		* @returns True if the node represents a custom component without any conditional directives, false otherwise.
		*/
		const isCustomComponentWithoutCondition = (node) => node.type === "VElement" && import_utils.default.isCustomComponent(node) && !hasConditionalDirective(node);
		/** Set of built-in Vue components that are exempt from the rule. */
		const exemptTags = /* @__PURE__ */ new Set([
			"component",
			"slot",
			"template"
		]);
		/** Set to keep track of nodes we've pushed to the stack. */
		const pushedNodes = /* @__PURE__ */ new Set();
		/**
		* Creates and returns an object representing a conditional family.
		*
		* @param ifNode - The VElement associated with the 'v-if' directive.
		*/
		const createConditionalFamily = (ifNode) => ({
			if: ifNode,
			elseIf: [],
			else: null
		});
		return import_utils.default.defineTemplateBodyVisitor(context, {
			/**
			* Callback to be executed when a Vue element is traversed. This function checks if the
			* element is a component, increments the usage count of the component in the
			* current scope, and checks for the key directive if the component is repeated.
			*
			* @param {VElement} node - The traversed Vue element.
			*/
			VElement(node) {
				if (exemptTags.has(node.rawName)) return;
				const condition = import_utils.default.getDirective(node, "if") || import_utils.default.getDirective(node, "else-if") || import_utils.default.getDirective(node, "else");
				if (condition) {
					const conditionType = condition.key.name.name;
					if (node.parent && node.parent.type === "VElement") {
						let conditionalFamily = conditionalFamilies.get(node.parent);
						if (!conditionalFamily) {
							conditionalFamily = createConditionalFamily(node);
							conditionalFamilies.set(node.parent, conditionalFamily);
						}
						if (conditionalFamily) switch (conditionType) {
							case "if":
								conditionalFamily = createConditionalFamily(node);
								conditionalFamilies.set(node.parent, conditionalFamily);
								break;
							case "else-if":
								conditionalFamily.elseIf.push(node);
								break;
							case "else":
								conditionalFamily.else = node;
								break;
						}
					}
				}
				if (isCustomComponentWithoutCondition(node)) {
					componentUsageStack.push(/* @__PURE__ */ new Map());
					return;
				}
				if (!import_utils.default.isCustomComponent(node)) return;
				const componentName = node.rawName;
				const currentScope = componentUsageStack.at(-1);
				const usageInfo = currentScope?.get(componentName) ?? {
					count: 0,
					firstNode: null
				};
				if (hasConditionalDirective(node)) {
					if (usageInfo.count === 0) usageInfo.firstNode = node;
					if (usageInfo.count > 0) {
						const uniqueKey = `${require_casing.kebabCase(componentName)}-${usageInfo.count + 1}`;
						checkForKey(node, context, componentName, uniqueKey, conditionalFamilies);
						if (usageInfo.count === 1) {
							const uniqueKeyForFirstInstance = `${require_casing.kebabCase(componentName)}-1`;
							checkForKey(usageInfo.firstNode, context, componentName, uniqueKeyForFirstInstance, conditionalFamilies);
						}
					}
					usageInfo.count += 1;
					currentScope?.set(componentName, usageInfo);
				}
				componentUsageStack.push(/* @__PURE__ */ new Map());
				pushedNodes.add(node);
			},
			"VElement:exit"(node) {
				if (exemptTags.has(node.rawName)) return;
				if (isCustomComponentWithoutCondition(node)) {
					componentUsageStack.pop();
					return;
				}
				if (!import_utils.default.isCustomComponent(node)) return;
				if (pushedNodes.has(node)) {
					componentUsageStack.pop();
					pushedNodes.delete(node);
				}
			}
		});
	}
};
//#endregion
exports.default = v_if_else_key_default;
!x7"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/v-on-handler-style.js
/**
* @author Yosuke Ota <https://github.com/ota-meshi>
* See LICENSE file in root directory for full license.
*/
var require_v_on_handler_style = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef {import('eslint').ReportDescriptorFix} ReportDescriptorFix
	* @typedef {'method' | 'inline' | 'inline-function'} HandlerKind
	* @typedef {object} ObjectOption
	* @property {boolean} [ignoreIncludesComment]
	*/
	/**
	* @param {RuleContext} context
	*/
	function parseOptions(context) {
		/** @type {[HandlerKind | HandlerKind[] | undefined, ObjectOption | undefined]} */
		const options = context.options;
		/** @type {HandlerKind[]} */
		const allows = [];
		if (options[0]) if (Array.isArray(options[0])) allows.push(...options[0]);
		else allows.push(options[0]);
		else allows.push("method", "inline-function");
		return {
			allows,
			shouldIgnoreIncludesComment: !!(options[1] || {}).ignoreIncludesComment
		};
	}
	/**
	* Check whether the given token is a quote.
	* @param {Token} token The token to check.
	* @returns {boolean} `true` if the token is a quote.
	*/
	function isQuote(token) {
		return token != null && token.type === "Punctuator" && (token.value === "\"" || token.value === "'");
	}
	/**
	* Check whether the given node is an identifier call expression. e.g. `foo()`
	* @param {Expression} node The node to check.
	* @returns {node is CallExpression & {callee: Identifier}}
	*/
	function isIdentifierCallExpression(node) {
		if (node.type !== "CallExpression") return false;
		if (node.optional) return false;
		return node.callee.type === "Identifier";
	}
	/**
	* Returns a call expression node if the given VOnExpression or BlockStatement consists
	* of only a single identifier call expression.
	* e.g.
	*   @click="foo()"
	*   @click="{ foo() }"
	*   @click="foo();;"
	* @param {VOnExpression | BlockStatement} node
	* @returns {CallExpression & {callee: Identifier} | null}
	*/
	function getIdentifierCallExpression(node) {
		/** @type {ExpressionStatement} */
		let exprStatement;
		let body = node.body;
		while (true) {
			const statements = body.filter((st) => st.type !== "EmptyStatement");
			if (statements.length !== 1) return null;
			const statement = statements[0];
			if (statement.type === "ExpressionStatement") {
				exprStatement = statement;
				break;
			}
			if (statement.type === "BlockStatement") {
				body = statement.body;
				continue;
			}
			return null;
		}
		const expression = exprStatement.expression;
		if (!isIdentifierCallExpression(expression)) return null;
		return expression;
	}
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "enforce writing style for handlers in `v-on` directives",
				categories: void 0,
				url: "https://eslint.vuejs.org/rules/v-on-handler-style.html"
			},
			fixable: "code",
			schema: [{ oneOf: [{ enum: ["inline", "inline-function"] }, {
				type: "array",
				items: [{ const: "method" }, { enum: ["inline", "inline-function"] }],
				uniqueItems: true,
				additionalItems: false,
				minItems: 2,
				maxItems: 2
			}] }, {
				type: "object",
				properties: { ignoreIncludesComment: { type: "boolean" } },
				additionalProperties: false
			}],
			messages: {
				preferMethodOverInline: "Prefer method handler over inline handler in v-on.",
				preferMethodOverInlineWithoutIdCall: "Prefer method handler over inline handler in v-on. Note that you may need to create a new method.",
				preferMethodOverInlineFunction: "Prefer method handler over inline function in v-on.",
				preferMethodOverInlineFunctionWithoutIdCall: "Prefer method handler over inline function in v-on. Note that you may need to create a new method.",
				preferInlineOverMethod: "Prefer inline handler over method handler in v-on.",
				preferInlineOverInlineFunction: "Prefer inline handler over inline function in v-on.",
				preferInlineOverInlineFunctionWithMultipleParams: "Prefer inline handler over inline function in v-on. Note that the custom event must be changed to a single payload.",
				preferInlineFunctionOverMethod: "Prefer inline function over method handler in v-on.",
				preferInlineFunctionOverInline: "Prefer inline function over inline handler in v-on."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const sourceCode = context.sourceCode;
			const { allows, shouldIgnoreIncludesComment } = parseOptions(context);
			/** @type {Set<VElement>} */
			const upperElements = /* @__PURE__ */ new Set();
			/** @type {Map<string, number>} */
			const methodParamCountMap = /* @__PURE__ */ new Map();
			/** @type {Identifier[]} */
			const $eventIdentifiers = [];
			/**
			* Verify for inline handler.
			* @param {VOnExpression} node
			* @param {HandlerKind} kind
			* @returns {boolean} Returns `true` if reported.
			*/
			function verifyForInlineHandler(node, kind) {
				switch (kind) {
					case "method": return verifyCanUseMethodHandlerForInlineHandler(node);
					case "inline-function":
						reportCanUseInlineFunctionForInlineHandler(node);
						return true;
				}
				return false;
			}
			/**
			* Report for method handler.
			* @param {Identifier} node
			* @param {HandlerKind} kind
			* @returns {boolean} Returns `true` if reported.
			*/
			function reportForMethodHandler(node, kind) {
				switch (kind) {
					case "inline":
					case "inline-function":
						context.report({
							node,
							messageId: kind === "inline" ? "preferInlineOverMethod" : "preferInlineFunctionOverMethod"
						});
						return true;
				}
				return false;
			}
			/**
			* Verify for inline function handler.
			* @param {ArrowFunctionExpression | FunctionExpression} node
			* @param {HandlerKind} kind
			* @returns {boolean} Returns `true` if reported.
			*/
			function verifyForInlineFunction(node, kind) {
				switch (kind) {
					case "method": return verifyCanUseMethodHandlerForInlineFunction(node);
					case "inline":
						reportCanUseInlineHandlerForInlineFunction(node);
						return true;
				}
				return false;
			}
			/**
			* Get token information for the given VExpressionContainer node.
			* @param {VExpressionContainer} node
			*/
			function getVExpressionContainerTokenInfo(node) {
				const tokens = sourceCode.parserServices.getTemplateBodyTokenStore().getTokens(node, { includeComments: true });
				const firstToken = tokens[0];
				const lastToken = tokens.at(-1);
				if (!lastToken) return {
					rangeWithoutQuotes: [0, 0],
					hasComment: false,
					hasQuote: false
				};
				const hasQuote = isQuote(firstToken);
				return {
					rangeWithoutQuotes: hasQuote ? [firstToken.range[1], lastToken.range[0]] : [firstToken.range[0], lastToken.range[1]],
					get hasComment() {
						return tokens.some((token) => token.type === "Block" || token.type === "Line");
					},
					hasQuote
				};
			}
			/**
			* Checks whether the given node refers to a variable of the element.
			* @param {Expression | VOnExpression} node
			*/
			function hasReferenceUpperElementVariable(node) {
				for (const element of upperElements) for (const vv of element.variables) for (const reference of vv.references) {
					const { range } = reference.id;
					if (node.range[0] <= range[0] && range[1] <= node.range[1]) return true;
				}
				return false;
			}
			/**
			* Check if `v-on:click="foo()"` can be converted to `v-on:click="foo"` and report if it can.
			* @param {VOnExpression} node
			* @returns {boolean} Returns `true` if reported.
			*/
			function verifyCanUseMethodHandlerForInlineHandler(node) {
				const { rangeWithoutQuotes, hasComment } = getVExpressionContainerTokenInfo(node.parent);
				if (shouldIgnoreIncludesComment && hasComment) return false;
				const idCallExpr = getIdentifierCallExpression(node);
				if ((!idCallExpr || idCallExpr.arguments.length > 0) && hasReferenceUpperElementVariable(node)) return false;
				context.report({
					node,
					messageId: idCallExpr ? "preferMethodOverInline" : "preferMethodOverInlineWithoutIdCall",
					fix: (fixer) => {
						if (hasComment || !idCallExpr || idCallExpr.arguments.length > 0) return null;
						const paramCount = methodParamCountMap.get(idCallExpr.callee.name);
						if (paramCount != null && paramCount > 0) return null;
						return fixer.replaceTextRange(rangeWithoutQuotes, sourceCode.getText(idCallExpr.callee));
					}
				});
				return true;
			}
			/**
			* Check if `v-on:click="() => foo()"` can be converted to `v-on:click="foo"` and report if it can.
			* @param {ArrowFunctionExpression | FunctionExpression} node
			* @returns {boolean} Returns `true` if reported.
			*/
			function verifyCanUseMethodHandlerForInlineFunction(node) {
				const { rangeWithoutQuotes, hasComment } = getVExpressionContainerTokenInfo(node.parent);
				if (shouldIgnoreIncludesComment && hasComment) return false;
				/** @type {CallExpression & {callee: Identifier} | null} */
				let idCallExpr = null;
				if (node.body.type === "BlockStatement") idCallExpr = getIdentifierCallExpression(node.body);
				else if (isIdentifierCallExpression(node.body)) idCallExpr = node.body;
				if ((!idCallExpr || !isSameParamsAndArgs(idCallExpr)) && hasReferenceUpperElementVariable(node)) return false;
				context.report({
					node,
					messageId: idCallExpr ? "preferMethodOverInlineFunction" : "preferMethodOverInlineFunctionWithoutIdCall",
					fix: (fixer) => {
						if (hasComment || !idCallExpr) return null;
						if (!isSameParamsAndArgs(idCallExpr)) return null;
						const paramCount = methodParamCountMap.get(idCallExpr.callee.name);
						if (paramCount != null && paramCount !== idCallExpr.arguments.length) return null;
						return fixer.replaceTextRange(rangeWithoutQuotes, sourceCode.getText(idCallExpr.callee));
					}
				});
				return true;
				/**
				* Checks whether parameters are passed as arguments as-is.
				* @param {CallExpression} expression
				*/
				function isSameParamsAndArgs(expression) {
					return node.params.length === expression.arguments.length && node.params.every((param, index) => {
						if (param.type !== "Identifier") return false;
						const arg = expression.arguments[index];
						if (!arg || arg.type !== "Identifier") return false;
						return param.name === arg.name;
					});
				}
			}
			/**
			* Report `v-on:click="foo()"` can be converted to `v-on:click="()=>foo()"`.
			* @param {VOnExpression} node
			* @returns {void}
			*/
			function reportCanUseInlineFunctionForInlineHandler(node) {
				context.report({
					node,
					messageId: "preferInlineFunctionOverInline",
					*fix(fixer) {
						if ($eventIdentifiers.some(({ range }) => node.range[0] <= range[0] && range[1] <= node.range[1])) return;
						const { rangeWithoutQuotes, hasQuote } = getVExpressionContainerTokenInfo(node.parent);
						if (!hasQuote) return;
						yield fixer.insertTextBeforeRange(rangeWithoutQuotes, "() => ");
						const tokenStore = sourceCode.parserServices.getTemplateBodyTokenStore();
						const firstToken = tokenStore.getFirstToken(node);
						const lastToken = tokenStore.getLastToken(node);
						if (firstToken.value === "{" && lastToken.value === "}") return;
						if (lastToken.value !== ";" && node.body.length === 1 && node.body[0].type === "ExpressionStatement") return;
						yield fixer.insertTextBefore(firstToken, "{");
						yield fixer.insertTextAfter(lastToken, "}");
					}
				});
			}
			/**
			* Report `v-on:click="() => foo()"` can be converted to `v-on:click="foo()"`.
			* @param {ArrowFunctionExpression | FunctionExpression} node
			* @returns {void}
			*/
			function reportCanUseInlineHandlerForInlineFunction(node) {
				context.report({
					node,
					messageId: node.params.length > 1 ? "preferInlineOverInlineFunctionWithMultipleParams" : "preferInlineOverInlineFunction",
					fix: node.params.length > 0 ? null : (fixer) => {
						let text = sourceCode.getText(node.body);
						if (node.body.type === "BlockStatement") text = text.slice(1, -1);
						return fixer.replaceText(node, text);
					}
				});
			}
			return utils.defineTemplateBodyVisitor(context, {
				VElement(node) {
					upperElements.add(node);
				},
				"VElement:exit"(node) {
					upperElements.delete(node);
				},
				/** @param {VExpressionContainer} node */
				"VAttribute[directive=true][key.name.name='on'][key.argument!=null] > VExpressionContainer.value:exit"(node) {
					const expression = node.expression;
					if (!expression) return;
					switch (expression.type) {
						case "VOnExpression":
							if (allows[0] === "inline") return;
							for (const allow of allows) if (verifyForInlineHandler(expression, allow)) return;
							break;
						case "Identifier":
							if (allows[0] === "method") return;
							for (const allow of allows) if (reportForMethodHandler(expression, allow)) return;
							break;
						case "ArrowFunctionExpression":
						case "FunctionExpression":
							if (allows[0] === "inline-function") return;
							for (const allow of allows) if (verifyForInlineFunction(expression, allow)) return;
							break;
						default: return;
					}
				},
				...allows.includes("inline-function") ? { "Identifier[name=\"$event\"]"(node) {
					$eventIdentifiers.push(node);
				} } : {}
			}, allows.includes("method") ? utils.defineVueVisitor(context, { onVueObjectEnter(node) {
				const methods = utils.iterateProperties(node, /* @__PURE__ */ new Set(["methods"]));
				for (const method of methods) {
					if (method.type !== "object") continue;
					const value = method.property.value;
					if (value.type === "FunctionExpression" || value.type === "ArrowFunctionExpression") methodParamCountMap.set(method.name, value.params.some((p) => p.type === "RestElement") ? Infinity : value.params.length);
				}
			} }) : {});
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_v_on_handler_style();
	}
});
Blx1"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/v-on-style.js
/**
* @author Toru Nagashima
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_v_on_style = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "suggestion",
			docs: {
				description: "enforce `v-on` directive style",
				categories: ["vue3-strongly-recommended", "vue2-strongly-recommended"],
				url: "https://eslint.vuejs.org/rules/v-on-style.html"
			},
			fixable: "code",
			schema: [{ enum: ["shorthand", "longform"] }],
			messages: {
				expectedShorthand: "Expected '@' instead of 'v-on:'.",
				expectedLonghand: "Expected 'v-on:' instead of '@'."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const shouldPreferShorthand = context.options[0] !== "longform";
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VDirective} node */
"VAttribute[directive=true][key.name.name='on'][key.argument!=null]"(node) {
				if (node.key.name.rawName === "@" === shouldPreferShorthand) return;
				const pos = node.range[0];
				context.report({
					node,
					loc: node.loc,
					messageId: shouldPreferShorthand ? "expectedShorthand" : "expectedLonghand",
					fix: (fixer) => shouldPreferShorthand ? fixer.replaceTextRange([pos, pos + 5], "@") : fixer.replaceTextRange([pos, pos + 1], "v-on:")
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_v_on_style();
	}
});
(07`x	const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_casing = require("../utils/casing.js");
//#region lib/rules/v-slot-style.ts
/**
* @author Toru Nagashima
* See LICENSE file in root directory for full license.
*/
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
function normalizeOptions(options) {
	const normalized = {
		atComponent: "v-slot",
		default: "shorthand",
		named: "shorthand"
	};
	if (typeof options === "string") normalized.atComponent = normalized.default = normalized.named = options;
	else if (options != null) {
		for (const key of [
			"atComponent",
			"default",
			"named"
		]) if (options[key] != null) normalized[key] = options[key];
	}
	return normalized;
}
/**
* Get the expected style.
*/
function getExpectedStyle(options, node) {
	const { argument } = node.key;
	if (argument == null || argument.type === "VIdentifier" && argument.name === "default") return node.parent.parent.name === "template" ? options.default : options.atComponent;
	return options.named;
}
/**
* Get the expected style.
*/
function getActualStyle(node) {
	const { name, argument } = node.key;
	if (name.rawName === "#") return "shorthand";
	if (argument != null) return "longform";
	return "v-slot";
}
var v_slot_style_default = {
	meta: {
		type: "suggestion",
		docs: {
			description: "enforce `v-slot` directive style",
			categories: ["vue3-strongly-recommended", "vue2-strongly-recommended"],
			url: "https://eslint.vuejs.org/rules/v-slot-style.html"
		},
		fixable: "code",
		schema: [{ oneOf: [{ enum: ["shorthand", "longform"] }, {
			type: "object",
			properties: {
				atComponent: { enum: [
					"shorthand",
					"longform",
					"v-slot"
				] },
				default: { enum: [
					"shorthand",
					"longform",
					"v-slot"
				] },
				named: { enum: ["shorthand", "longform"] }
			},
			additionalProperties: false
		}] }],
		messages: {
			expectedShorthand: "Expected '#{{argument}}' instead of '{{actual}}'.",
			expectedLongform: "Expected 'v-slot:{{argument}}' instead of '{{actual}}'.",
			expectedVSlot: "Expected 'v-slot' instead of '{{actual}}'."
		}
	},
	create(context) {
		const sourceCode = context.sourceCode;
		const options = normalizeOptions(context.options[0]);
		return import_utils.default.defineTemplateBodyVisitor(context, { "VAttribute[directive=true][key.name.name='slot']"(node) {
			const expected = getExpectedStyle(options, node);
			if (getActualStyle(node) === expected) return;
			const { name, argument } = node.key;
			const range = [name.range[0], (argument || name).range[1]];
			const argumentText = argument ? sourceCode.getText(argument) : "default";
			context.report({
				node,
				messageId: `expected${require_casing.pascalCase(expected)}`,
				data: {
					actual: sourceCode.text.slice(range[0], range[1]),
					argument: argumentText
				},
				fix(fixer) {
					switch (expected) {
						case "shorthand": return fixer.replaceTextRange(range, `#${argumentText}`);
						case "longform": return fixer.replaceTextRange(range, `v-slot:${argumentText}`);
						case "v-slot": return fixer.replaceTextRange(range, "v-slot");
						default: return null;
					}
				}
			});
		} });
	}
};
//#endregion
exports.default = v_slot_style_default;
\@px"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/valid-attribute-name.js
/**
* @author Doug Wade <douglas.b.wade@gmail.com>
* See LICENSE file in root directory for full license.
*/
var require_valid_attribute_name = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const xnv = require("xml-name-validator");
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "require valid attribute names",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/valid-attribute-name.html"
			},
			fixable: null,
			schema: [],
			messages: { attribute: "Attribute name {{name}} is not valid." }
		},
		/** @param {RuleContext} context */
		create(context) {
			/**
			* @param {string | VIdentifier} key
			* @return {string}
			*/
			const getName = (key) => typeof key === "string" ? key : key.name;
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VDirective | VAttribute} node */
VAttribute(node) {
				if (utils.isCustomComponent(node.parent.parent)) return;
				const name = getName(node.key.name);
				if (node.directive && name === "bind" && node.key.argument && node.key.argument.type === "VIdentifier" && !xnv.name(node.key.argument.name)) context.report({
					node,
					messageId: "attribute",
					data: { name: node.key.argument.name }
				});
				if (!node.directive && !xnv.name(name)) context.report({
					node,
					messageId: "attribute",
					data: { name }
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_valid_attribute_name();
	}
});
1C#xY"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/valid-define-emits.js
/**
* @author Yosuke Ota <https://github.com/ota-meshi>
* See LICENSE file in root directory for full license.
*/
var require_valid_define_emits = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { findVariable } = require("@eslint-community/eslint-utils");
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce valid `defineEmits` compiler macro",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/valid-define-emits.html"
			},
			fixable: null,
			schema: [],
			messages: {
				hasTypeAndArg: "`defineEmits` has both a type-only emit and an argument.",
				referencingLocally: "`defineEmits` is referencing locally declared variables.",
				multiple: "`defineEmits` has been called multiple times.",
				notDefined: "Custom events are not defined.",
				definedInBoth: "Custom events are defined in both `defineEmits` and `export default {}`."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const scriptSetup = utils.getScriptSetupElement(context);
			if (!scriptSetup) return {};
			/** @type {Set<Expression | SpreadElement>} */
			const emitsDefExpressions = /* @__PURE__ */ new Set();
			let hasDefaultExport = false;
			/** @type {CallExpression[]} */
			const defineEmitsNodes = [];
			/** @type {CallExpression | null} */
			let emptyDefineEmits = null;
			return utils.compositingVisitors(utils.defineScriptSetupVisitor(context, {
				onDefineEmitsEnter(node) {
					defineEmitsNodes.push(node);
					const typeArguments = "typeArguments" in node ? node.typeArguments : node.typeParameters;
					if (node.arguments.length > 0) {
						if (typeArguments && typeArguments.params.length > 0) {
							context.report({
								node,
								messageId: "hasTypeAndArg"
							});
							return;
						}
						emitsDefExpressions.add(node.arguments[0]);
					} else if (!typeArguments || typeArguments.params.length === 0) emptyDefineEmits = node;
				},
				Identifier(node) {
					for (const defineEmits of emitsDefExpressions) {
						if (!utils.inRange(defineEmits.range, node)) continue;
						const variable = findVariable(utils.getScope(context, node), node);
						if (variable && variable.references.some((ref) => ref.identifier === node) && variable.defs.length > 0 && variable.defs.every((def) => def.type !== "ImportBinding" && utils.inRange(scriptSetup.range, def.name) && !utils.inRange(defineEmits.range, def.name))) {
							if (utils.withinTypeNode(node)) continue;
							context.report({
								node,
								messageId: "referencingLocally"
							});
						}
					}
				}
			}), utils.defineVueVisitor(context, { onVueObjectEnter(node, { type }) {
				if (type !== "export" || utils.inRange(scriptSetup.range, node)) return;
				hasDefaultExport = Boolean(utils.findProperty(node, "emits"));
			} }), { "Program:exit"() {
				if (defineEmitsNodes.length === 0) return;
				if (defineEmitsNodes.length > 1) {
					for (const node of defineEmitsNodes) context.report({
						node,
						messageId: "multiple"
					});
					return;
				}
				if (emptyDefineEmits) {
					if (!hasDefaultExport) context.report({
						node: emptyDefineEmits,
						messageId: "notDefined"
					});
				} else if (hasDefaultExport) for (const node of defineEmitsNodes) context.report({
					node,
					messageId: "definedInBoth"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_valid_define_emits();
	}
});
 :x"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/valid-define-options.js
/**
* @author Yosuke Ota <https://github.com/ota-meshi>
* See LICENSE file in root directory for full license.
*/
var require_valid_define_options = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { findVariable } = require("@eslint-community/eslint-utils");
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce valid `defineOptions` compiler macro",
				categories: ["vue3-essential"],
				url: "https://eslint.vuejs.org/rules/valid-define-options.html"
			},
			fixable: null,
			schema: [],
			messages: {
				referencingLocally: "`defineOptions` is referencing locally declared variables.",
				multiple: "`defineOptions` has been called multiple times.",
				notDefined: "Options are not defined.",
				disallowProp: "`defineOptions()` cannot be used to declare `{{propName}}`. Use `{{insteadMacro}}()` instead.",
				typeArgs: "`defineOptions()` cannot accept type arguments."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const scriptSetup = utils.getScriptSetupElement(context);
			if (!scriptSetup) return {};
			/** @type {Set<Expression | SpreadElement>} */
			const optionsDefExpressions = /* @__PURE__ */ new Set();
			/** @type {CallExpression[]} */
			const defineOptionsNodes = [];
			return utils.compositingVisitors(utils.defineScriptSetupVisitor(context, {
				onDefineOptionsEnter(node) {
					defineOptionsNodes.push(node);
					if (node.arguments.length > 0) {
						const define = node.arguments[0];
						if (define.type === "ObjectExpression") {
							for (const [propName, insteadMacro] of [
								["props", "defineProps"],
								["emits", "defineEmits"],
								["expose", "defineExpose"],
								["slots", "defineSlots"]
							]) if (utils.findProperty(define, propName)) context.report({
								node,
								messageId: "disallowProp",
								data: {
									propName,
									insteadMacro
								}
							});
						}
						optionsDefExpressions.add(node.arguments[0]);
					} else context.report({
						node,
						messageId: "notDefined"
					});
					const typeArguments = "typeArguments" in node ? node.typeArguments : node.typeParameters;
					if (typeArguments) context.report({
						node: typeArguments,
						messageId: "typeArgs"
					});
				},
				Identifier(node) {
					for (const defineOptions of optionsDefExpressions) {
						if (!utils.inRange(defineOptions.range, node)) continue;
						const variable = findVariable(utils.getScope(context, node), node);
						if (variable && variable.references.some((ref) => ref.identifier === node) && variable.defs.length > 0 && variable.defs.every((def) => def.type !== "ImportBinding" && utils.inRange(scriptSetup.range, def.name) && !utils.inRange(defineOptions.range, def.name) && !(def.type === "Variable" && def.parent.kind === "const" && def.node.init && def.node.init.type === "Literal"))) {
							if (utils.withinTypeNode(node)) continue;
							context.report({
								node,
								messageId: "referencingLocally"
							});
						}
					}
				}
			}), { "Program:exit"() {
				if (defineOptionsNodes.length > 1) for (const node of defineOptionsNodes) context.report({
					node,
					messageId: "multiple"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_valid_define_options();
	}
});
$mxh"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/valid-define-props.js
/**
* @author Yosuke Ota <https://github.com/ota-meshi>
* See LICENSE file in root directory for full license.
*/
var require_valid_define_props = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { findVariable } = require("@eslint-community/eslint-utils");
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce valid `defineProps` compiler macro",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/valid-define-props.html"
			},
			fixable: null,
			schema: [],
			messages: {
				hasTypeAndArg: "`defineProps` has both a type-only props and an argument.",
				referencingLocally: "`defineProps` is referencing locally declared variables.",
				multiple: "`defineProps` has been called multiple times.",
				notDefined: "Props are not defined.",
				definedInBoth: "Props are defined in both `defineProps` and `export default {}`."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const scriptSetup = utils.getScriptSetupElement(context);
			if (!scriptSetup) return {};
			/** @type {Set<Expression | SpreadElement>} */
			const propsDefExpressions = /* @__PURE__ */ new Set();
			let hasDefaultExport = false;
			/** @type {CallExpression[]} */
			const definePropsNodes = [];
			/** @type {CallExpression | null} */
			let emptyDefineProps = null;
			return utils.compositingVisitors(utils.defineScriptSetupVisitor(context, {
				onDefinePropsEnter(node) {
					definePropsNodes.push(node);
					const typeArguments = "typeArguments" in node ? node.typeArguments : node.typeParameters;
					if (node.arguments.length > 0) {
						if (typeArguments && typeArguments.params.length > 0) {
							context.report({
								node,
								messageId: "hasTypeAndArg"
							});
							return;
						}
						propsDefExpressions.add(node.arguments[0]);
					} else if (!typeArguments || typeArguments.params.length === 0) emptyDefineProps = node;
				},
				Identifier(node) {
					for (const defineProps of propsDefExpressions) {
						if (!utils.inRange(defineProps.range, node)) continue;
						const variable = findVariable(utils.getScope(context, node), node);
						if (variable && variable.references.some((ref) => ref.identifier === node) && variable.defs.length > 0 && variable.defs.every((def) => def.type !== "ImportBinding" && utils.inRange(scriptSetup.range, def.name) && !utils.inRange(defineProps.range, def.name))) {
							if (utils.withinTypeNode(node)) continue;
							context.report({
								node,
								messageId: "referencingLocally"
							});
						}
					}
				}
			}), utils.defineVueVisitor(context, { onVueObjectEnter(node, { type }) {
				if (type !== "export" || utils.inRange(scriptSetup.range, node)) return;
				hasDefaultExport = Boolean(utils.findProperty(node, "props"));
			} }), { "Program:exit"() {
				if (definePropsNodes.length === 0) return;
				if (definePropsNodes.length > 1) {
					for (const node of definePropsNodes) context.report({
						node,
						messageId: "multiple"
					});
					return;
				}
				if (emptyDefineProps) {
					if (!hasDefaultExport) context.report({
						node: emptyDefineProps,
						messageId: "notDefined"
					});
				} else if (hasDefaultExport) for (const node of definePropsNodes) context.report({
					node,
					messageId: "definedInBoth"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_valid_define_props();
	}
});
ڪEax"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/valid-model-definition.js
/**
* @fileoverview Requires valid keys in model option.
* @author Alex Sokolov
*/
var require_valid_model_definition = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const VALID_MODEL_KEYS = /* @__PURE__ */ new Set(["prop", "event"]);
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "require valid keys in model option",
				categories: ["vue2-essential"],
				url: "https://eslint.vuejs.org/rules/valid-model-definition.html"
			},
			fixable: null,
			deprecated: true,
			schema: [],
			messages: { invalidKey: "Invalid key '{{name}}' in model option." }
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.executeOnVue(context, (obj) => {
				const modelProperty = utils.findProperty(obj, "model");
				if (!modelProperty || modelProperty.value.type !== "ObjectExpression") return;
				for (const p of modelProperty.value.properties) {
					if (p.type !== "Property") continue;
					const name = utils.getStaticPropertyName(p);
					if (!name) continue;
					if (!VALID_MODEL_KEYS.has(name)) context.report({
						node: p,
						messageId: "invalidKey",
						data: { name }
					});
				}
			});
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_valid_model_definition();
	}
});
rjx"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/valid-next-tick.js
/**
* @fileoverview enforce valid `nextTick` function calls
* @author Flo Edelmann
* @copyright 2021 Flo Edelmann. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_valid_next_tick = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const { findVariable } = require("@eslint-community/eslint-utils");
	/**
	* @param {Identifier} identifier
	* @param {RuleContext} context
	* @returns {ASTNode|undefined}
	*/
	function getVueNextTickNode(identifier, context) {
		if (identifier.name === "$nextTick" && identifier.parent.type === "MemberExpression" && utils.isThis(identifier.parent.object, context)) return identifier.parent;
		if (identifier.name === "nextTick" && identifier.parent.type === "MemberExpression" && identifier.parent.object.type === "Identifier" && identifier.parent.object.name === "Vue") return identifier.parent;
		const variable = findVariable(utils.getScope(context, identifier), identifier);
		if (variable != null && variable.defs.length === 1) {
			const def = variable.defs[0];
			if (def.type === "ImportBinding" && def.node.type === "ImportSpecifier" && def.node.imported.type === "Identifier" && def.node.imported.name === "nextTick" && def.node.parent.type === "ImportDeclaration" && def.node.parent.source.value === "vue") return identifier;
		}
	}
	/**
	* @param {CallExpression} callExpression
	* @returns {boolean}
	*/
	function isAwaitedPromise(callExpression) {
		if (callExpression.parent.type === "AwaitExpression") return true;
		if (callExpression.parent.type === "ReturnStatement") return true;
		if (callExpression.parent.type === "ArrowFunctionExpression" && callExpression.parent.body === callExpression) return true;
		if (callExpression.parent.type === "MemberExpression" && callExpression.parent.property.type === "Identifier" && callExpression.parent.property.name === "then") return true;
		if (callExpression.parent.type === "VariableDeclarator" || callExpression.parent.type === "AssignmentExpression") return true;
		return callExpression.parent.type === "ArrayExpression" && callExpression.parent.parent.type === "CallExpression" && callExpression.parent.parent.callee.type === "MemberExpression" && callExpression.parent.parent.callee.object.type === "Identifier" && callExpression.parent.parent.callee.object.name === "Promise" && callExpression.parent.parent.callee.property.type === "Identifier";
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce valid `nextTick` function calls",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/valid-next-tick.html"
			},
			fixable: "code",
			hasSuggestions: true,
			schema: [],
			messages: {
				shouldBeFunction: "`nextTick` is a function.",
				missingCallbackOrAwait: "Await the Promise returned by `nextTick` or pass a callback function.",
				addAwait: "Add missing `await` statement.",
				tooManyParameters: "`nextTick` expects zero or one parameters.",
				eitherAwaitOrCallback: "Either await the Promise or pass a callback function to `nextTick`."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineVueVisitor(context, { 
			/** @param {Identifier} node */
Identifier(node) {
				const nextTickNode = getVueNextTickNode(node, context);
				if (!nextTickNode || !nextTickNode.parent) return;
				let parentNode = nextTickNode.parent;
				if (parentNode.type === "ConditionalExpression") parentNode = parentNode.parent;
				if (parentNode.type === "CallExpression" && parentNode.callee !== nextTickNode) return;
				if (parentNode.type === "VariableDeclarator" || parentNode.type === "AssignmentExpression") return;
				if (parentNode.type !== "CallExpression") {
					context.report({
						node,
						messageId: "shouldBeFunction",
						fix(fixer) {
							return fixer.insertTextAfter(node, "()");
						}
					});
					return;
				}
				if (parentNode.arguments.length === 0) {
					if (!isAwaitedPromise(parentNode)) context.report({
						node,
						messageId: "missingCallbackOrAwait",
						suggest: [{
							messageId: "addAwait",
							fix(fixer) {
								return fixer.insertTextBefore(parentNode, "await ");
							}
						}]
					});
					return;
				}
				if (parentNode.arguments.length > 1) {
					context.report({
						node,
						messageId: "tooManyParameters"
					});
					return;
				}
				if (isAwaitedPromise(parentNode)) context.report({
					node,
					messageId: "eitherAwaitOrCallback"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_valid_next_tick();
	}
});
M'J13xvalid-template-root.js
/**
* @author Toru Nagashima
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file i7n root directory for full license.
*/
var require_validDAenforce valid template root",
				categories: ["vue3-essential", W<valid9],
			messages: {
				emptySrc: "The template root with 'src' attribute is required to be empty.",
				noChild: "The template r&equires child element."
			}
		},
		/*6 -$
			/** @param {Program} program */
h*hasSrc = utils.hasAttribute(element, "src"p$*	)%if (hasSrc && rootElements.length > 0d
&Kelement,
					loc: element.loc,
					messageId: "emptySrc"
				});
				else& && !hasSrc8element,
					loc: element.loc,
					messageId: "noChildvalid_template_root();
	}
});
+2ճjx\"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/valid-v-bind.js
/**
* @author Toru Nagashima
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_valid_v_bind = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const VALID_MODIFIERS = /* @__PURE__ */ new Set([
		"prop",
		"camel",
		"sync",
		"attr"
	]);
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce valid `v-bind` directives",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/valid-v-bind.html"
			},
			fixable: null,
			schema: [],
			messages: {
				unsupportedModifier: "'v-bind' directives don't support the modifier '{{name}}'.",
				expectedValue: "'v-bind' directives require an attribute value."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VDirective} node */
"VAttribute[directive=true][key.name.name='bind']"(node) {
				for (const modifier of node.key.modifiers) if (!VALID_MODIFIERS.has(modifier.name)) context.report({
					node: modifier,
					messageId: "unsupportedModifier",
					data: { name: modifier.name }
				});
				if (!node.value || utils.isEmptyValueDirective(node, context)) context.report({
					node,
					messageId: "expectedValue"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_valid_v_bind();
	}
});
R#ox"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/valid-v-cloak.js
/**
* @author Toru Nagashima
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_valid_v_cloak = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce valid `v-cloak` directives",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/valid-v-cloak.html"
			},
			fixable: null,
			schema: [],
			messages: {
				unexpectedArgument: "'v-cloak' directives require no argument.",
				unexpectedModifier: "'v-cloak' directives require no modifier.",
				unexpectedValue: "'v-cloak' directives require no attribute value."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VDirective} node */
"VAttribute[directive=true][key.name.name='cloak']"(node) {
				if (node.key.argument) context.report({
					node: node.key.argument,
					messageId: "unexpectedArgument"
				});
				const lastModifier = node.key.modifiers.at(-1);
				if (lastModifier) context.report({
					node,
					loc: {
						start: node.key.modifiers[0].loc.start,
						end: lastModifier.loc.end
					},
					messageId: "unexpectedModifier"
				});
				if (node.value) context.report({
					node: node.value,
					messageId: "unexpectedValue"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_valid_v_cloak();
	}
});
?ýx	B"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/valid-v-else-if.js
/**
* @author Toru Nagashima
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_valid_v_else_if = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce valid `v-else-if` directives",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/valid-v-else-if.html"
			},
			fixable: null,
			schema: [],
			messages: {
				missingVIf: "'v-else-if' directives require being preceded by the element which has a 'v-if' or 'v-else-if' directive.",
				withVIf: "'v-else-if' and 'v-if' directives can't exist on the same element.",
				withVElse: "'v-else-if' and 'v-else' directives can't exist on the same element.",
				unexpectedArgument: "'v-else-if' directives require no argument.",
				unexpectedModifier: "'v-else-if' directives require no modifier.",
				expectedValue: "'v-else-if' directives require that attribute value."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VDirective} node */
"VAttribute[directive=true][key.name.name='else-if']"(node) {
				const element = node.parent.parent;
				if (!utils.prevElementHasIf(element)) context.report({
					node,
					messageId: "missingVIf"
				});
				if (utils.hasDirective(element, "if")) context.report({
					node,
					messageId: "withVIf"
				});
				if (utils.hasDirective(element, "else")) context.report({
					node,
					messageId: "withVElse"
				});
				if (node.key.argument) context.report({
					node: node.key.argument,
					messageId: "unexpectedArgument"
				});
				const lastModifier = node.key.modifiers.at(-1);
				if (lastModifier) context.report({
					node,
					loc: {
						start: node.key.modifiers[0].loc.start,
						end: lastModifier.loc.end
					},
					messageId: "unexpectedModifier"
				});
				if (!node.value || utils.isEmptyValueDirective(node, context)) context.report({
					node,
					messageId: "expectedValue"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_valid_v_else_if();
	}
});
x	X"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/valid-v-else.js
/**
* @author Toru Nagashima
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_valid_v_else = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce valid `v-else` directives",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/valid-v-else.html"
			},
			fixable: null,
			schema: [],
			messages: {
				missingVIf: "'v-else' directives require being preceded by the element which has a 'v-if' or 'v-else-if' directive.",
				withVIf: "'v-else' and 'v-if' directives can't exist on the same element. You may want 'v-else-if' directives.",
				withVElseIf: "'v-else' and 'v-else-if' directives can't exist on the same element.",
				unexpectedArgument: "'v-else' directives require no argument.",
				unexpectedModifier: "'v-else' directives require no modifier.",
				unexpectedValue: "'v-else' directives require no attribute value."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VDirective} node */
"VAttribute[directive=true][key.name.name='else']"(node) {
				const element = node.parent.parent;
				if (!utils.prevElementHasIf(element)) context.report({
					node,
					messageId: "missingVIf"
				});
				if (utils.hasDirective(element, "if")) context.report({
					node,
					messageId: "withVIf"
				});
				if (utils.hasDirective(element, "else-if")) context.report({
					node,
					messageId: "withVElseIf"
				});
				if (node.key.argument) context.report({
					node: node.key.argument,
					messageId: "unexpectedArgument"
				});
				const lastModifier = node.key.modifiers.at(-1);
				if (lastModifier) context.report({
					node,
					loc: {
						start: node.key.modifiers[0].loc.start,
						end: lastModifier.loc.end
					},
					messageId: "unexpectedModifier"
				});
				if (node.value) context.report({
					node: node.value,
					messageId: "unexpectedValue"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_valid_v_else();
	}
});
RxH"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/valid-v-for.js
/**
* @author Toru Nagashima
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_valid_v_for = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* Check whether the given attribute is using the variables which are defined by `v-for` directives.
	* @param {VDirective} vFor The attribute node of `v-for` to check.
	* @param {VDirective} vBindKey The attribute node of `v-bind:key` to check.
	* @returns {boolean} `true` if the node is using the variables which are defined by `v-for` directives.
	*/
	function isUsingIterationVar(vFor, vBindKey) {
		if (vBindKey.value == null) return false;
		const references = vBindKey.value.references;
		const variables = vFor.parent.parent.variables;
		return references.some((reference) => variables.some((variable) => variable.id.name === reference.id.name && variable.kind === "v-for"));
	}
	/**
	* Check the child element in tempalte v-for about `v-bind:key` attributes.
	* @param {RuleContext} context The rule context to report.
	* @param {VDirective} vFor The attribute node of `v-for` to check.
	* @param {VElement} child The child node to check.
	*/
	function checkChildKey(context, vFor, child) {
		const childFor = utils.getDirective(child, "for");
		if (childFor != null) {
			const childForRefs = childFor.value && childFor.value.references || [];
			const variables = vFor.parent.parent.variables;
			if (childForRefs.some((cref) => variables.some((variable) => cref.id.name === variable.id.name && variable.kind === "v-for"))) return;
		}
		checkKey(context, vFor, child);
	}
	/**
	* Check the given element about `v-bind:key` attributes.
	* @param {RuleContext} context The rule context to report.
	* @param {VDirective} vFor The attribute node of `v-for` to check.
	* @param {VElement} element The element node to check.
	*/
	function checkKey(context, vFor, element) {
		const vBindKey = utils.getDirective(element, "bind", "key");
		if (vBindKey == null && element.name === "template") {
			for (const child of element.children) if (child.type === "VElement") checkChildKey(context, vFor, child);
			return;
		}
		if (utils.isCustomComponent(element) && vBindKey == null) context.report({
			node: element.startTag,
			messageId: "requireKey"
		});
		if (vBindKey != null && !isUsingIterationVar(vFor, vBindKey)) context.report({
			node: vBindKey,
			messageId: "keyUseFVorVars"
		});
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce valid `v-for` directives",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/valid-v-for.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: { allowEmptyAlias: { type: "boolean" } },
				additionalProperties: false
			}],
			messages: {
				requireKey: "Custom elements in iteration require 'v-bind:key' directives.",
				keyUseFVorVars: "Expected 'v-bind:key' directive to use the variables which are defined by the 'v-for' directive.",
				unexpectedArgument: "'v-for' directives require no argument.",
				unexpectedModifier: "'v-for' directives require no modifier.",
				expectedValue: "'v-for' directives require that attribute value.",
				unexpectedExpression: "'v-for' directives require the special syntax '<alias> in <expression>'.",
				invalidEmptyAlias: "Invalid empty alias.",
				invalidAlias: "Invalid alias '{{text}}'."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const sourceCode = context.sourceCode;
			const shouldAllowEmptyAlias = (context.options[0] || {}).allowEmptyAlias === true;
			/**
			* @param {Pattern|null} alias
			* @returns {boolean}
			*/
			function isValidAlias(alias) {
				return alias ? alias.type === "Identifier" : shouldAllowEmptyAlias;
			}
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VDirective} node */
"VAttribute[directive=true][key.name.name='for']"(node) {
				const element = node.parent.parent;
				checkKey(context, node, element);
				if (node.key.argument) context.report({
					node: node.key.argument,
					messageId: "unexpectedArgument"
				});
				const lastModifier = node.key.modifiers.at(-1);
				if (lastModifier) context.report({
					node,
					loc: {
						start: node.key.modifiers[0].loc.start,
						end: lastModifier.loc.end
					},
					messageId: "unexpectedModifier"
				});
				if (!node.value || utils.isEmptyValueDirective(node, context)) {
					context.report({
						node,
						messageId: "expectedValue"
					});
					return;
				}
				const expr = node.value.expression;
				if (expr == null) return;
				if (expr.type !== "VForExpression") {
					context.report({
						node: node.value,
						messageId: "unexpectedExpression"
					});
					return;
				}
				const lhs = expr.left;
				const value = lhs[0];
				const key = lhs[1];
				const index = lhs[2];
				if (value === null && !shouldAllowEmptyAlias) context.report({
					node: expr,
					messageId: "invalidEmptyAlias"
				});
				if (key !== void 0 && !isValidAlias(key)) {
					const isEmptyAlias = !key;
					context.report({
						node: key || expr,
						messageId: isEmptyAlias ? "invalidEmptyAlias" : "invalidAlias",
						data: isEmptyAlias ? {} : { text: sourceCode.getText(key) }
					});
				}
				if (index !== void 0 && !isValidAlias(index)) {
					const isEmptyAlias = !index;
					context.report({
						node: index || expr,
						messageId: isEmptyAlias ? "invalidEmptyAlias" : "invalidAlias",
						data: isEmptyAlias ? {} : { text: sourceCode.getText(index) }
					});
				}
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_valid_v_for();
	}
});
qx"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/valid-v-html.js
/**
* @author Toru Nagashima
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_valid_v_html = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce valid `v-html` directives",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/valid-v-html.html"
			},
			fixable: null,
			schema: [],
			messages: {
				unexpectedArgument: "'v-html' directives require no argument.",
				unexpectedModifier: "'v-html' directives require no modifier.",
				expectedValue: "'v-html' directives require that attribute value."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VDirective} node */
"VAttribute[directive=true][key.name.name='html']"(node) {
				if (node.key.argument) context.report({
					node: node.key.argument,
					messageId: "unexpectedArgument"
				});
				const lastModifier = node.key.modifiers.at(-1);
				if (lastModifier) context.report({
					node,
					loc: {
						start: node.key.modifiers[0].loc.start,
						end: lastModifier.loc.end
					},
					messageId: "unexpectedModifier"
				});
				if (!node.value || utils.isEmptyValueDirective(node, context)) context.report({
					node,
					messageId: "expectedValue"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_valid_v_html();
	}
});
Iux KUѓ+xCwithVElse: "'v= You may want !.",
				withVElseIf: "'v-if' and ?F+&ߓ>m\else-if"0	withVElse2yif();
	}
});
9xC"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/valid-v-memo.js
/**
* @author Yosuke Ota <https://github.com/ota-meshi>
* See LICENSE file in root directory for full license.
*/
var require_valid_v_memo = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @param {RuleContext} context
	* @param {NonNullable<VExpressionContainer['expression']>} expression
	* @param {NonNullable<VExpressionContainer['expression']>[]} expressions
	*/
	function verifyMemoExpression(context, expression, expressions) {
		switch (expression.type) {
			case "ObjectExpression":
			case "ClassExpression":
			case "ArrowFunctionExpression":
			case "FunctionExpression":
			case "Literal":
			case "TemplateLiteral":
			case "UnaryExpression":
			case "BinaryExpression":
			case "UpdateExpression":
				context.report({
					node: expression,
					messageId: "expectedArray"
				});
				break;
			case "AssignmentExpression":
				expressions.push(expression.right);
				break;
			case "TSAsExpression":
				expressions.push(expression.expression);
				break;
			case "SequenceExpression": {
				const lastExpression = expression.expressions.at(-1);
				if (lastExpression) expressions.push(lastExpression);
				break;
			}
			case "ConditionalExpression":
				expressions.push(expression.consequent, expression.alternate);
				break;
		}
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce valid `v-memo` directives",
				categories: ["vue3-essential"],
				url: "https://eslint.vuejs.org/rules/valid-v-memo.html"
			},
			fixable: null,
			schema: [],
			messages: {
				unexpectedArgument: "'v-memo' directives require no argument.",
				unexpectedModifier: "'v-memo' directives require no modifier.",
				expectedValue: "'v-memo' directives require that attribute value.",
				expectedArray: "'v-memo' directives require the attribute value to be an array.",
				insideVFor: "'v-memo' directive does not work inside 'v-for'."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			/** @type {VElement | null} */
			let vForElement = null;
			return utils.defineTemplateBodyVisitor(context, {
				VElement(node) {
					if (!vForElement && utils.hasDirective(node, "for")) vForElement = node;
				},
				"VElement:exit"(node) {
					if (vForElement === node) vForElement = null;
				},
				/** @param {VDirective} node */
				"VAttribute[directive=true][key.name.name='memo']"(node) {
					if (vForElement && vForElement !== node.parent.parent) context.report({
						node: node.key,
						messageId: "insideVFor"
					});
					if (node.key.argument) context.report({
						node: node.key.argument,
						messageId: "unexpectedArgument"
					});
					const lastModifier = node.key.modifiers.at(-1);
					if (lastModifier) context.report({
						node,
						loc: {
							start: node.key.modifiers[0].loc.start,
							end: lastModifier.loc.end
						},
						messageId: "unexpectedModifier"
					});
					if (!node.value || utils.isEmptyValueDirective(node, context)) {
						context.report({
							node,
							messageId: "expectedValue"
						});
						return;
					}
					if (!node.value.expression) return;
					const expressions = [node.value.expression];
					let expression;
					while (expression = expressions.pop()) verifyMemoExpression(context, expression, expressions);
				}
			});
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_valid_v_memo();
	}
});
*]xC"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
const require_key_aliases$1 = require("../utils/key-aliases.js");
//#region lib/rules/valid-v-on.js
/**
* @author Toru Nagashima
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_valid_v_on = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	const keyAliases = require_key_aliases$1.default;
	const VALID_MODIFIERS = /* @__PURE__ */ new Set([
		"stop",
		"prevent",
		"capture",
		"self",
		"ctrl",
		"shift",
		"alt",
		"meta",
		"native",
		"once",
		"left",
		"right",
		"middle",
		"passive",
		"esc",
		"tab",
		"enter",
		"space",
		"up",
		"down",
		"delete",
		"exact"
	]);
	const VERB_MODIFIERS = /* @__PURE__ */ new Set(["stop", "prevent"]);
	const KEY_ALIASES = new Set(keyAliases);
	/**
	* @param {VIdentifier} modifierNode
	* @param {Set<string>} customModifiers
	*/
	function isValidModifier(modifierNode, customModifiers) {
		const modifier = modifierNode.name;
		return VALID_MODIFIERS.has(modifier) || Number.isSafeInteger(Number.parseInt(modifier, 10)) || [...modifier].length === 1 || KEY_ALIASES.has(modifier) || customModifiers.has(modifier);
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce valid `v-on` directives",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/valid-v-on.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: { modifiers: { type: "array" } },
				additionalProperties: false
			}],
			messages: {
				unsupportedModifier: "'v-on' directives don't support the modifier '{{modifier}}'.",
				avoidKeyword: "Avoid using JavaScript keyword as \"v-on\" value: {{value}}.",
				expectedValueOrVerb: "'v-on' directives require a value or verb modifier (like 'stop' or 'prevent')."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const options = context.options[0] || {};
			/** @type {Set<string>} */
			const customModifiers = new Set(options.modifiers || []);
			const sourceCode = context.sourceCode;
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VDirective} node */
"VAttribute[directive=true][key.name.name='on']"(node) {
				for (const modifier of node.key.modifiers) if (!isValidModifier(modifier, customModifiers)) context.report({
					node: modifier,
					messageId: "unsupportedModifier",
					data: { modifier: modifier.name }
				});
				if ((!node.value || !node.value.expression) && node.key.modifiers.every((modifier) => !VERB_MODIFIERS.has(modifier.name))) if (node.value && !utils.isEmptyValueDirective(node, context)) {
					const valueText = sourceCode.getText(node.value);
					const innerText = (valueText[0] === "\"" || valueText[0] === "'") && valueText[0] === valueText.at(-1) ? valueText.slice(1, -1) : valueText;
					if (/^\w+$/.test(innerText)) context.report({
						node: node.value,
						messageId: "avoidKeyword",
						data: { value: valueText }
					});
				} else context.report({
					node,
					messageId: "expectedValueOrVerb"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_valid_v_on();
	}
});
n<;ox"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/valid-v-once.js
/**
* @author Toru Nagashima
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_valid_v_once = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce valid `v-once` directives",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/valid-v-once.html"
			},
			fixable: null,
			schema: [],
			messages: {
				unexpectedArgument: "'v-once' directives require no argument.",
				unexpectedModifier: "'v-once' directives require no modifier.",
				unexpectedValue: "'v-once' directives require no attribute value."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VDirective} node */
"VAttribute[directive=true][key.name.name='once']"(node) {
				if (node.key.argument) context.report({
					node: node.key.argument,
					messageId: "unexpectedArgument"
				});
				const lastModifier = node.key.modifiers.at(-1);
				if (lastModifier) context.report({
					node,
					loc: {
						start: node.key.modifiers[0].loc.start,
						end: lastModifier.loc.end
					},
					messageId: "unexpectedModifier"
				});
				if (node.value) context.report({
					node: node.value,
					messageId: "unexpectedValue"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_valid_v_once();
	}
});
<6nx"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/valid-v-pre.js
/**
* @author Toru Nagashima
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_valid_v_pre = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce valid `v-pre` directives",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/valid-v-pre.html"
			},
			fixable: null,
			schema: [],
			messages: {
				unexpectedArgument: "'v-pre' directives require no argument.",
				unexpectedModifier: "'v-pre' directives require no modifier.",
				unexpectedValue: "'v-pre' directives require no attribute value."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VDirective} node */
"VAttribute[directive=true][key.name.name='pre']"(node) {
				if (node.key.argument) context.report({
					node: node.key.argument,
					messageId: "unexpectedArgument"
				});
				const lastModifier = node.key.modifiers.at(-1);
				if (lastModifier) context.report({
					node,
					loc: {
						start: node.key.modifiers[0].loc.start,
						end: lastModifier.loc.end
					},
					messageId: "unexpectedModifier"
				});
				if (node.value) context.report({
					node: node.value,
					messageId: "unexpectedValue"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_valid_v_pre();
	}
});
8}x#"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/valid-v-show.js
/**
* @author Toru Nagashima
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_valid_v_show = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce valid `v-show` directives",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/valid-v-show.html"
			},
			fixable: null,
			schema: [],
			messages: {
				unexpectedArgument: "'v-show' directives require no argument.",
				unexpectedModifier: "'v-show' directives require no modifier.",
				expectedValue: "'v-show' directives require that attribute value.",
				unexpectedTemplate: "'v-show' directives cannot be put on <template> tags."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VDirective} node */
"VAttribute[directive=true][key.name.name='show']"(node) {
				if (node.key.argument) context.report({
					node: node.key.argument,
					messageId: "unexpectedArgument"
				});
				const lastModifier = node.key.modifiers.at(-1);
				if (lastModifier) context.report({
					node,
					loc: {
						start: node.key.modifiers[0].loc.start,
						end: lastModifier.loc.end
					},
					messageId: "unexpectedModifier"
				});
				if (!node.value || utils.isEmptyValueDirective(node, context)) context.report({
					node,
					messageId: "expectedValue"
				});
				if (node.parent.parent.name === "template") context.report({
					node,
					messageId: "unexpectedTemplate"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_valid_v_show();
	}
});
]Hx-a"use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("../utils/index.js");
//#region lib/rules/valid-v-slot.js
/**
* @author Toru Nagashima
* See LICENSE file in root directory for full license.
*/
var require_valid_v_slot = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const utils = require_index.default;
	/**
	* @typedef { { expr: VForExpression, variables: VVariable[] } } VSlotVForVariables
	*/
	/**
	* Get all `v-slot` directives on a given element.
	* @param {VElement} node The VElement node to check.
	* @returns {VDirective[]} The array of `v-slot` directives.
	*/
	function getSlotDirectivesOnElement(node) {
		return utils.getDirectives(node, "slot");
	}
	/**
	* Get all `v-slot` directives on the children of a given element.
	* @param {VElement} node The VElement node to check.
	* @returns {VDirective[][]}
	* The array of the group of `v-slot` directives.
	* The group bundles `v-slot` directives of element sequence which is connected
	* by `v-if`/`v-else-if`/`v-else`.
	*/
	function getSlotDirectivesOnChildren(node) {
		/** @type {VDirective[][]} */
		const groups = [];
		for (const group of utils.iterateChildElementsChains(node)) {
			const slotDirs = group.map((childElement) => childElement.name === "template" ? utils.getDirective(childElement, "slot") : null).filter(utils.isDef);
			if (slotDirs.length > 0) groups.push(slotDirs);
		}
		return groups;
	}
	/**
	* Get the normalized name of a given `v-slot` directive node with modifiers after `v-slot:` directive.
	* @param {VDirective} node The `v-slot` directive node.
	* @param {SourceCode} sourceCode The source code.
	* @returns {string} The normalized name.
	*/
	function getNormalizedName(node, sourceCode) {
		if (node.key.argument == null) return "default";
		return node.key.modifiers.length === 0 ? sourceCode.getText(node.key.argument) : sourceCode.text.slice(node.key.argument.range[0], node.key.range[1]);
	}
	/**
	* Get all `v-slot` directives which are distributed to the same slot as a given `v-slot` directive node.
	* @param {VDirective[][]} vSlotGroups The result of `getAllNamedSlotElements()`.
	* @param {VDirective} currentVSlot The current `v-slot` directive node.
	* @param {VSlotVForVariables | null} currentVSlotVForVars The current `v-for` variables.
	* @param {SourceCode} sourceCode The source code.
	* @param {ParserServices.TokenStore} tokenStore The token store.
	* @returns {VDirective[][]} The array of the group of `v-slot` directives.
	*/
	function filterSameSlot(vSlotGroups, currentVSlot, currentVSlotVForVars, sourceCode, tokenStore) {
		const currentName = getNormalizedName(currentVSlot, sourceCode);
		return vSlotGroups.map((vSlots) => vSlots.filter((vSlot) => {
			if (getNormalizedName(vSlot, sourceCode) !== currentName) return false;
			const vForExpr = getVSlotVForVariableIfUsingIterationVars(vSlot, utils.getDirective(vSlot.parent.parent, "for"));
			if (!currentVSlotVForVars || !vForExpr) return !currentVSlotVForVars && !vForExpr;
			return equalVSlotVForVariables(currentVSlotVForVars, vForExpr, tokenStore);
		})).filter((slots) => slots.length > 0);
	}
	/**
	* Determines whether the two given `v-slot` variables are considered to be equal.
	* @param {VSlotVForVariables} a First element.
	* @param {VSlotVForVariables} b Second element.
	* @param {ParserServices.TokenStore} tokenStore The token store.
	* @returns {boolean} `true` if the elements are considered to be equal.
	*/
	function equalVSlotVForVariables(a, b, tokenStore) {
		if (a.variables.length !== b.variables.length) return false;
		if (!equal(a.expr.right, b.expr.right)) return false;
		const checkedVarNames = /* @__PURE__ */ new Set();
		const len = Math.min(a.expr.left.length, b.expr.left.length);
		for (let index = 0; index < len; index++) {
			const aPtn = a.expr.left[index];
			const bPtn = b.expr.left[index];
			const aVar = a.variables.find((v) => aPtn.range[0] <= v.id.range[0] && v.id.range[1] <= aPtn.range[1]);
			const bVar = b.variables.find((v) => bPtn.range[0] <= v.id.range[0] && v.id.range[1] <= bPtn.range[1]);
			if (aVar && bVar) {
				if (aVar.id.name !== bVar.id.name) return false;
				if (!equal(aPtn, bPtn)) return false;
				checkedVarNames.add(aVar.id.name);
			} else if (aVar || bVar) return false;
		}
		return a.variables.every((v) => checkedVarNames.has(v.id.name) || b.variables.some((bv) => v.id.name === bv.id.name));
		/**
		* Determines whether the two given nodes are considered to be equal.
		* @param {ASTNode} a First node.
		* @param {ASTNode} b Second node.
		* @returns {boolean} `true` if the nodes are considered to be equal.
		*/
		function equal(a, b) {
			if (a.type !== b.type) return false;
			return utils.equalTokens(a, b, tokenStore);
		}
	}
	/**
	* Gets the `v-for` directive and variable that provide the variables used by the given` v-slot` directive.
	* @param {VDirective} vSlot The current `v-slot` directive node.
	* @param {VDirective | null} [vFor] The current `v-for` directive node.
	* @returns { VSlotVForVariables | null } The VSlotVForVariable.
	*/
	function getVSlotVForVariableIfUsingIterationVars(vSlot, vFor) {
		const expr = vFor && vFor.value && vFor.value.expression;
		const variables = expr && getUsingIterationVars(vSlot.key.argument, vSlot.parent.parent);
		return expr && variables && variables.length > 0 ? {
			expr,
			variables
		} : null;
	}
	/**
	* Gets iterative variables if a given argument node is using iterative variables that the element defined.
	* @param {VExpressionContainer|VIdentifier|null} argument The argument node to check.
	* @param {VElement} element The element node which has the argument.
	* @returns {VVariable[]} The argument node is using iteration variables.
	*/
	function getUsingIterationVars(argument, element) {
		const vars = [];
		if (argument && argument.type === "VExpressionContainer") {
			for (const { variable } of argument.references) if (variable != null && variable.kind === "v-for" && variable.id.range[0] > element.startTag.range[0] && variable.id.range[1] < element.startTag.range[1]) vars.push(variable);
		}
		return vars;
	}
	/**
	* Check whether a given argument node is using an scope variable that the directive defined.
	* @param {VDirective} vSlot The `v-slot` directive to check.
	* @returns {boolean} `true` if that argument node is using a scope variable the directive defined.
	*/
	function isUsingScopeVar(vSlot) {
		const argument = vSlot.key.argument;
		const value = vSlot.value;
		if (argument && value && argument.type === "VExpressionContainer") {
			for (const { variable } of argument.references) if (variable != null && variable.kind === "scope" && variable.id.range[0] > value.range[0] && variable.id.range[1] < value.range[1]) return true;
		}
		return false;
	}
	/**
	* If `allowModifiers` option is set to `true`, check whether a given argument node has invalid modifiers like `v-slot.foo`.
	* Otherwise, check whether a given argument node has at least one modifier.
	* @param {VDirective} vSlot The `v-slot` directive to check.
	* @param {boolean} shouldAllowModifiers `allowModifiers` option in context.
	* @return {boolean} `true` if that argument node has invalid modifiers like `v-slot.foo`.
	*/
	function hasInvalidModifiers(vSlot, shouldAllowModifiers) {
		return shouldAllowModifiers ? vSlot.key.argument == null && vSlot.key.modifiers.length > 0 : vSlot.key.modifiers.length > 0;
	}
	module.exports = {
		meta: {
			type: "problem",
			docs: {
				description: "enforce valid `v-slot` directives",
				categories: ["vue3-essential", "vue2-essential"],
				url: "https://eslint.vuejs.org/rules/valid-v-slot.html"
			},
			fixable: null,
			schema: [{
				type: "object",
				properties: { allowModifiers: { type: "boolean" } },
				additionalProperties: false
			}],
			messages: {
				ownerMustBeCustomElement: "'v-slot' directive must be owned by a custom element, but '{{name}}' is not.",
				namedSlotMustBeOnTemplate: "Named slots must use '<template>' on a custom element.",
				defaultSlotMustBeOnTemplate: "Default slot must use '<template>' on a custom element when there are other named slots.",
				disallowDuplicateSlotsOnElement: "An element cannot have multiple 'v-slot' directives.",
				disallowDuplicateSlotsOnChildren: "An element cannot have multiple '<template>' elements which are distributed to the same slot.",
				disallowArgumentUseSlotParams: "Dynamic argument of 'v-slot' directive cannot use that slot parameter.",
				disallowAnyModifier: "'v-slot' directive doesn't support any modifier.",
				requireAttributeValue: "'v-slot' directive on a custom element requires that attribute value."
			}
		},
		/** @param {RuleContext} context */
		create(context) {
			const sourceCode = context.sourceCode;
			const tokenStore = sourceCode.parserServices.getTemplateBodyTokenStore && sourceCode.parserServices.getTemplateBodyTokenStore();
			const shouldAllowModifiers = (context.options[0] || {}).allowModifiers === true;
			return utils.defineTemplateBodyVisitor(context, { 
			/** @param {VDirective} node */
"VAttribute[directive=true][key.name.name='slot']"(node) {
				const isDefaultSlot = node.key.argument == null || node.key.argument.type === "VIdentifier" && node.key.argument.name === "default";
				const element = node.parent.parent;
				const parentElement = element.parent;
				const ownerElement = element.name === "template" ? parentElement : element;
				if (ownerElement.type === "VDocumentFragment") return;
				const vSlotsOnElement = getSlotDirectivesOnElement(element);
				const vSlotGroupsOnChildren = getSlotDirectivesOnChildren(ownerElement);
				if (!utils.isCustomComponent(ownerElement)) context.report({
					node,
					messageId: "ownerMustBeCustomElement",
					data: { name: ownerElement.rawName }
				});
				if (!isDefaultSlot && element.name !== "template") context.report({
					node,
					messageId: "namedSlotMustBeOnTemplate"
				});
				if (ownerElement === element && vSlotGroupsOnChildren.length > 0) context.report({
					node,
					messageId: "defaultSlotMustBeOnTemplate"
				});
				if (vSlotsOnElement.length >= 2 && vSlotsOnElement[0] !== node) context.report({
					node,
					messageId: "disallowDuplicateSlotsOnElement"
				});
				if (ownerElement === parentElement) {
					const vFor = utils.getDirective(element, "for");
					const vSlotVForVar = getVSlotVForVariableIfUsingIterationVars(node, vFor);
					const vSlotGroupsOfSameSlot = filterSameSlot(vSlotGroupsOnChildren, node, vSlotVForVar, sourceCode, tokenStore);
					if (vSlotGroupsOfSameSlot.length >= 2 && !vSlotGroupsOfSameSlot[0].includes(node)) context.report({
						node,
						messageId: "disallowDuplicateSlotsOnChildren"
					});
					if (vFor && !vSlotVForVar) context.report({
						node,
						messageId: "disallowDuplicateSlotsOnChildren"
					});
				}
				if (isUsingScopeVar(node)) context.report({
					node,
					messageId: "disallowArgumentUseSlotParams"
				});
				const lastModifier = node.key.modifiers.at(-1);
				if (hasInvalidModifiers(node, shouldAllowModifiers) && lastModifier) context.report({
					node,
					loc: {
						start: node.key.modifiers[0].loc.start,
						end: lastModifier.loc.end
					},
					messageId: "disallowAnyModifier"
				});
				if (ownerElement === element && isDefaultSlot && (!node.value || utils.isEmptyValueDirective(node, context) || utils.isEmptyExpressionValueDirective(node, context))) context.report({
					node,
					messageId: "requireAttributeValue"
				});
			} });
		}
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_valid_v_slot();
	}
});
mU4^xIvalidEToru Nagashima
* @copyright 2017 Toru Nagashima. All rights reserved.Gvalid+problem",
			docs: {
				description: "enforce valid `v-text` directives",
				categories: ["vue3-essential", "vue2-essential"]"+validOC
				unexpectedArgument: "'v-text' directives require no argument.",
				unexpectedModifier: "'v-text' directives require no moTdifier.",
				expectedValue: "'v-text' directives require that attribute value."
			if (node.key.argument) : node.key.argument\Argument"
				});
				const lastModifier = node.key.modifiers.at(-1);
				if (lastModifier) &V{
						start: node.key.modifiers[0].loc.start,
						end: lastModifier.loc.end
					}UModifier"
				});
				if (!node.value || utils.isEmptyValueDirective(node, context)) !messageId: "expectedValuevalid_v_text();
	}
});
RTxB100644 casing.js cR֏6-{7/g100644 comments.js l<FVv100644 deprecated-html-elements.js "|96ߠZ{wyZ100644 html-comments.js |!ݓ{p100644 html-elements.js i%T6BSXb65G100644 indent-common.js N pOA'ۉT:h`100644 indent-ts.js Q4P&g1t100644 indent-utils.js ݵvBJ]wIO100644 index.js 9bMTVkΗ|100644 inline-non-void-elements.js bb_>'/O+B100644 js-reserved.js F+*h0C"؛/100644 key-aliases.js aIcT9E= 100644 keycode-to-key.js }6ŏNC5zHF0100644 math-elements.js MAҁUAJҖ100644 property-references.js 6RG/sL|Yޕ\100644 ref-object-references.js 62yJ
Y^%100644 regexp.js 6e?bG100644 scope.js rD߆+l}`w100644 selector.js B#ij1(< t}Pò40000 style-variables O0LQ:nHW100644 svg-attributes-weird-case.js ;Q[&T[p0100644 svg-elements.js ׂ0]T9T4Zc40000 ts-utils !'Z#:HS34iE100644 void-elements.js ^Q`ҒV!>{rpE 100644 vue-builtin-elements.js s.qs`&>	}w100644 vue-component-options.js ub;A9\߶%Tc^p100644 vue-reserved.js iT"DseyͺZO100644 vue2-builtin-components.js 9Uc"8K?Y100644 vue3-builtin-components.js к#&Z:?b{+FZ100644 vue3-export-names.js ML:%K¥ jhxJ//#region lib/utils/casing.ts
/**
* Capitalize a string.
*/
function capitalize(str) {
	return str.charAt(0).toUpperCase() + str.slice(1);
}
/**
* Checks whether the given string has symbols.
*/
function hasSymbols(str) {
	return /[!"#%&'()*+,./:;<=>?@[\\\]^`{|}]/u.exec(str) != null;
}
/**
* Checks whether the given string has uppercase.
*/
function hasUpper(str) {
	return /[A-Z]/u.exec(str) != null;
}
/**
* Convert text to kebab-case
*/
function kebabCase(str) {
	return str.replaceAll("_", "-").replaceAll(/\B([A-Z])/gu, "-$1").toLowerCase();
}
/**
* Checks whether the given string is kebab-case.
*/
function isKebabCase(str) {
	return !hasUpper(str) && !hasSymbols(str) && !str.startsWith("-") && !/_|--|\s/u.test(str);
}
/**
* Convert text to snake_case
*/
function snakeCase(str) {
	return str.replaceAll(/\B([A-Z])/gu, "_$1").replaceAll("-", "_").toLowerCase();
}
/**
* Checks whether the given string is snake_case.
*/
function isSnakeCase(str) {
	return !hasUpper(str) && !hasSymbols(str) && !/-|__|\s/u.test(str);
}
/**
* Convert text to camelCase
*/
function camelCase(str) {
	if (isPascalCase(str)) return str.charAt(0).toLowerCase() + str.slice(1);
	return str.replaceAll(/[-_](\w)/gu, (_, c) => c ? c.toUpperCase() : "");
}
/**
* Checks whether the given string is camelCase.
*/
function isCamelCase(str) {
	return !hasSymbols(str) && !/^[A-Z]/u.test(str) && !/-|_|\s/u.test(str);
}
/**
* Convert text to PascalCase
*/
function pascalCase(str) {
	return capitalize(camelCase(str));
}
/**
* Checks whether the given string is PascalCase.
*/
function isPascalCase(str) {
	return !hasSymbols(str) && !/^[a-z]/u.test(str) && !/-|_|\s/u.test(str);
}
const convertersMap = {
	"kebab-case": kebabCase,
	snake_case: snakeCase,
	camelCase,
	PascalCase: pascalCase
};
const checkersMap = {
	"kebab-case": isKebabCase,
	snake_case: isSnakeCase,
	camelCase: isCamelCase,
	PascalCase: isPascalCase
};
/**
* Return case checker
*/
function getChecker(name) {
	return checkersMap[name] || isPascalCase;
}
/**
* Return case converter
*/
function getConverter(name) {
	return convertersMap[name] || pascalCase;
}
/**
* Return case exact converter.
* If the converted result is not in correct case, the original value is returned.
*/
function getExactConverter(name) {
	const converter = getConverter(name);
	const checker = getChecker(name);
	return (str) => {
		const result = converter(str);
		return checker(result) ? result : str;
	};
}
const allowedCaseOptions = [
	"camelCase",
	"kebab-case",
	"PascalCase"
];
//#endregion
exports.allowedCaseOptions = allowedCaseOptions;
exports.camelCase = camelCase;
exports.capitalize = capitalize;
exports.getChecker = getChecker;
exports.getConverter = getConverter;
exports.getExactConverter = getExactConverter;
exports.isCamelCase = isCamelCase;
exports.isKebabCase = isKebabCase;
exports.isPascalCase = isPascalCase;
exports.isSnakeCase = isSnakeCase;
exports.kebabCase = kebabCase;
exports.pascalCase = pascalCase;
exports.snakeCase = snakeCase;
uxq//#region lib/utils/comments.ts
const isJSDocComment = (node) => node.type === "Block" && node.value.charAt(0) === "*" && node.value.charAt(1) !== "*";
const isBlockComment = (node) => node.type === "Block" && (node.value.charAt(0) !== "*" || node.value.charAt(1) === "*");
//#endregion
exports.isBlockComment = isBlockComment;
exports.isJSDocComment = isJSDocComment;
ou"x%//#region lib/utils/deprecated-html-elements.json
var deprecated_html_elements_default = [
	"acronym",
	"applet",
	"basefont",
	"bgsound",
	"big",
	"blink",
	"center",
	"dir",
	"font",
	"frame",
	"frameset",
	"isindex",
	"keygen",
	"listing",
	"marquee",
	"menuitem",
	"multicol",
	"nextid",
	"nobr",
	"noembed",
	"noframes",
	"param",
	"plaintext",
	"rb",
	"rtc",
	"spacer",
	"strike",
	"tt",
	"xmp"
];
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return deprecated_html_elements_default;
	}
});
 7xconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("./index.js");
//#region lib/utils/html-comments.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
const COMMENT_DIRECTIVE = /^\s*eslint-(?:en|dis)able/;
const IE_CONDITIONAL_IF = /^\[if\s+/;
const IE_CONDITIONAL_ENDIF = /\[endif]$/;
const TYPE_HTML_COMMENT_OPEN = "HTMLCommentOpen";
const TYPE_HTML_COMMENT_OPEN_DECORATION = "HTMLCommentOpenDecoration";
const TYPE_HTML_COMMENT_VALUE = "HTMLCommentValue";
const TYPE_HTML_COMMENT_CLOSE = "HTMLCommentClose";
const TYPE_HTML_COMMENT_CLOSE_DECORATION = "HTMLCommentCloseDecoration";
function isCommentDirective(comment) {
	return COMMENT_DIRECTIVE.test(comment.value);
}
function isIEConditionalComment(comment) {
	return IE_CONDITIONAL_IF.test(comment.value) || IE_CONDITIONAL_ENDIF.test(comment.value);
}
/**
* Define HTML comment parser
*/
function defineParser(sourceCode, config) {
	config ||= {};
	const exceptions = config.exceptions || [];
	/**
	* Get a open decoration string from comment contents.
	*/
	function getOpenDecoration(contents) {
		let decoration = "";
		for (const exception of exceptions) {
			const length = exception.length;
			let index = 0;
			while (contents.startsWith(exception, index)) index += length;
			const exceptionLength = index;
			if (decoration.length < exceptionLength) decoration = contents.slice(0, exceptionLength);
		}
		return decoration;
	}
	/**
	* Get a close decoration string from comment contents.
	*/
	function getCloseDecoration(contents) {
		let decoration = "";
		for (const exception of exceptions) {
			const length = exception.length;
			let index = contents.length;
			while (contents.endsWith(exception, index)) index -= length;
			const exceptionLength = contents.length - index;
			if (decoration.length < exceptionLength) decoration = contents.slice(index);
		}
		return decoration;
	}
	/**
	* Parse HTMLComment.
	*/
	return function parseHTMLComment(node) {
		if (node.type !== "HTMLComment") return null;
		const htmlCommentText = sourceCode.getText(node);
		if (!htmlCommentText.startsWith("<!--") || !htmlCommentText.endsWith("-->")) return null;
		let valueText = htmlCommentText.slice(4, -3);
		const openDecorationText = getOpenDecoration(valueText);
		valueText = valueText.slice(openDecorationText.length);
		const firstCharIndex = valueText.search(/\S/);
		const beforeSpace = firstCharIndex >= 0 ? valueText.slice(0, firstCharIndex) : valueText;
		valueText = valueText.slice(beforeSpace.length);
		const closeDecorationText = getCloseDecoration(valueText);
		if (closeDecorationText) valueText = valueText.slice(0, -closeDecorationText.length);
		const lastCharIndex = valueText.search(/\S\s*$/);
		const afterSpace = lastCharIndex >= 0 ? valueText.slice(lastCharIndex + 1) : valueText;
		if (afterSpace) valueText = valueText.slice(0, -afterSpace.length);
		let tokenIndex = node.range[0];
		const createToken = (type, value) => {
			const range = [tokenIndex, tokenIndex + value.length];
			tokenIndex = range[1];
			let loc;
			return {
				type,
				value,
				range,
				get loc() {
					if (loc) return loc;
					return loc = {
						start: sourceCode.getLocFromIndex(range[0]),
						end: sourceCode.getLocFromIndex(range[1])
					};
				}
			};
		};
		const open = createToken(TYPE_HTML_COMMENT_OPEN, "<!--");
		const openDecoration = openDecorationText ? createToken(TYPE_HTML_COMMENT_OPEN_DECORATION, openDecorationText) : null;
		tokenIndex += beforeSpace.length;
		const value = valueText ? createToken(TYPE_HTML_COMMENT_VALUE, valueText) : null;
		tokenIndex += afterSpace.length;
		return {
			/** HTML comment open (`<!--`) */
			open,
			/** decoration of the start of HTML comments. (`*****` when `<!--*****`) */
			openDecoration,
			/** value of HTML comment. whitespaces and other tokens are not included. */
			value,
			/** decoration of the end of HTML comments.  (`*****` when `*****-->`) */
			closeDecoration: closeDecorationText ? createToken(TYPE_HTML_COMMENT_CLOSE_DECORATION, closeDecorationText) : null,
			/** HTML comment close (`-->`) */
			close: createToken(TYPE_HTML_COMMENT_CLOSE, "-->")
		};
	};
}
/**
* Define HTML comment visitor
*/
function defineVisitor(context, config, visitHTMLComment, visitorOption) {
	return { Program(node) {
		visitorOption ||= {};
		if (import_utils.default.hasInvalidEOF(node)) return;
		if (!node.templateBody) return;
		const parse = defineParser(context.sourceCode, config);
		for (const comment of node.templateBody.comments) {
			if (comment.type !== "HTMLComment") continue;
			if (!visitorOption.includeDirectives && isCommentDirective(comment)) continue;
			if (isIEConditionalComment(comment)) continue;
			const tokens = parse(comment);
			if (tokens) visitHTMLComment(tokens);
		}
	} };
}
//#endregion
exports.defineVisitor = defineVisitor;

Dj`x//#region lib/utils/html-elements.json
var require_html_elements = /* @__PURE__ */ require("../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	module.exports = [
		"a",
		"abbr",
		"address",
		"area",
		"article",
		"aside",
		"audio",
		"b",
		"base",
		"bdi",
		"bdo",
		"blockquote",
		"body",
		"br",
		"button",
		"canvas",
		"caption",
		"cite",
		"code",
		"col",
		"colgroup",
		"data",
		"datalist",
		"dd",
		"del",
		"details",
		"dfn",
		"dialog",
		"div",
		"dl",
		"dt",
		"em",
		"embed",
		"fencedframe",
		"fieldset",
		"figcaption",
		"figure",
		"footer",
		"form",
		"geolocation",
		"h1",
		"h2",
		"h3",
		"h4",
		"h5",
		"h6",
		"head",
		"header",
		"hgroup",
		"hr",
		"html",
		"i",
		"iframe",
		"img",
		"input",
		"ins",
		"kbd",
		"label",
		"legend",
		"li",
		"link",
		"main",
		"map",
		"mark",
		"menu",
		"meta",
		"meter",
		"nav",
		"noscript",
		"object",
		"ol",
		"optgroup",
		"option",
		"output",
		"p",
		"picture",
		"pre",
		"progress",
		"q",
		"rp",
		"rt",
		"ruby",
		"s",
		"samp",
		"script",
		"search",
		"section",
		"select",
		"selectedcontent",
		"slot",
		"small",
		"source",
		"span",
		"strong",
		"style",
		"sub",
		"summary",
		"sup",
		"table",
		"tbody",
		"td",
		"template",
		"textarea",
		"tfoot",
		"th",
		"thead",
		"time",
		"title",
		"tr",
		"track",
		"u",
		"ul",
		"var",
		"video",
		"wbr"
	];
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_html_elements();
	}
});
LxcHconst require_indent_utils = require("./indent-utils.js");
const require_indent_ts = require("./indent-ts.js");
let _eslint_community_eslint_utils = require("@eslint-community/eslint-utils");
//#region lib/utils/indent-common.ts
const LT_CHAR = /[\n\r\u{2028}\u{2029}]/u;
const LINES = /[^\n\r\u{2028}\u{2029}]+(?:$|\r\n|[\n\r\u{2028}\u{2029}])/gu;
const BLOCK_COMMENT_PREFIX = /^\s*\*/;
const HTML_CONTENT_TOKEN_TYPES = /* @__PURE__ */ new Set([
	"HTMLText",
	"HTMLRCDataText",
	"HTMLTagOpen",
	"HTMLEndTagOpen",
	"HTMLComment"
]);
const ITERATION_OPTS = Object.freeze({
	includeComments: true,
	filter: require_indent_utils.isNotWhitespace
});
const PREFORMATTED_ELEMENT_NAMES = /* @__PURE__ */ new Set(["pre", "textarea"]);
/**
* Normalize options.
*/
function parseOptions(type, options, defaultOptions) {
	const ret = Object.assign({
		indentChar: " ",
		indentSize: 2,
		baseIndent: 0,
		attribute: 1,
		closeBracket: {
			startTag: 0,
			endTag: 0,
			selfClosingTag: 0
		},
		switchCase: 0,
		alignAttributesVertically: true,
		ignores: []
	}, defaultOptions);
	if (Number.isSafeInteger(type)) ret.indentSize = Number(type);
	else if (type === "tab") {
		ret.indentChar = "	";
		ret.indentSize = 1;
	}
	if (options.baseIndent != null && Number.isSafeInteger(options.baseIndent)) ret.baseIndent = options.baseIndent;
	if (options.attribute != null && Number.isSafeInteger(options.attribute)) ret.attribute = options.attribute;
	if (Number.isSafeInteger(options.closeBracket)) {
		const num = Number(options.closeBracket);
		ret.closeBracket = {
			startTag: num,
			endTag: num,
			selfClosingTag: num
		};
	} else if (options.closeBracket) ret.closeBracket = Object.assign({
		startTag: 0,
		endTag: 0,
		selfClosingTag: 0
	}, options.closeBracket);
	if (options.switchCase != null && Number.isSafeInteger(options.switchCase)) ret.switchCase = options.switchCase;
	if (options.alignAttributesVertically != null) ret.alignAttributesVertically = options.alignAttributesVertically;
	if (options.ignores != null) ret.ignores = options.ignores;
	return ret;
}
/**
* Check whether the node is at the beginning of line.
*/
function isBeginningOfLine(node, index, nodes) {
	if (node != null) for (let i = index - 1; i >= 0; --i) {
		const prevNode = nodes[i];
		if (prevNode == null) continue;
		return node.loc.start.line !== prevNode.loc.end.line;
	}
	return false;
}
/**
* Check whether a given token is a closing token which triggers unindent.
*/
function isClosingToken(token) {
	return token != null && (token.type === "HTMLEndTagOpen" || token.type === "VExpressionEnd" || token.type === "Punctuator" && [
		")",
		"}",
		"]"
	].includes(token.value));
}
/**
* Checks whether  a given token is a optional token.
*/
function isOptionalToken(token) {
	return token.type === "Punctuator" && token.value === "?.";
}
/**
* Creates AST event handlers for html-indent.
*/
function defineVisitor(context, tokenStore, defaultOptions) {
	if (!context.filename.endsWith(".vue")) return {};
	const options = parseOptions(context.options[0], context.options[1] || {}, defaultOptions);
	const sourceCode = context.sourceCode;
	const offsets = /* @__PURE__ */ new Map();
	const ignoreTokens = /* @__PURE__ */ new Set();
	/**
	* Set offset to the given tokens.
	*/
	function setOffset(token, offset, baseToken) {
		if (!token || token === baseToken) return;
		if (Array.isArray(token)) for (const t of token) {
			if (!t || t === baseToken) continue;
			offsets.set(t, {
				baseToken,
				offset,
				baseline: false,
				expectedIndent: void 0
			});
		}
		else offsets.set(token, {
			baseToken,
			offset,
			baseline: false,
			expectedIndent: void 0
		});
	}
	/**
	* Copy offset to the given tokens from srcToken.
	*/
	function copyOffset(token, srcToken) {
		if (!token) return;
		const offsetData = offsets.get(srcToken);
		if (!offsetData) return;
		setOffset(token, offsetData.offset, offsetData.baseToken);
		if (offsetData.baseline) setBaseline(token);
		const o = offsets.get(token);
		o.expectedIndent = offsetData.expectedIndent;
	}
	/**
	* Set baseline flag to the given token.
	*/
	function setBaseline(token) {
		const offsetInfo = offsets.get(token);
		if (offsetInfo != null) offsetInfo.baseline = true;
	}
	/**
	* Sets preformatted tokens to the given element node.
	*/
	function setPreformattedTokens(node) {
		const endToken = node.endTag && tokenStore.getFirstToken(node.endTag) || tokenStore.getTokenAfter(node);
		const cursorOptions = {
			includeComments: true,
			filter: (token) => token != null && HTML_CONTENT_TOKEN_TYPES.has(token.type)
		};
		const contentTokens = endToken ? tokenStore.getTokensBetween(node.startTag, endToken, cursorOptions) : tokenStore.getTokensAfter(node.startTag, cursorOptions);
		for (const token of contentTokens) ignoreTokens.add(token);
		ignoreTokens.add(endToken);
	}
	/**
	* Get the first and last tokens of the given node.
	* If the node is parenthesized, this gets the outermost parentheses.
	* The `borderOffset` value is used to prevent false positive in the following case: `(a) => {}` The parentheses are enclosing the whole parameter part rather than the first parameter, but this offset parameter is needed to distinguish.
	*/
	function getFirstAndLastTokens(node, borderOffset = 0) {
		borderOffset = Math.trunc(borderOffset);
		let firstToken = tokenStore.getFirstToken(node);
		let lastToken = tokenStore.getLastToken(node);
		let t, u;
		while ((t = tokenStore.getTokenBefore(firstToken)) != null && (u = tokenStore.getTokenAfter(lastToken)) != null && (0, _eslint_community_eslint_utils.isOpeningParenToken)(t) && (0, _eslint_community_eslint_utils.isClosingParenToken)(u) && t.range[0] >= borderOffset) {
			firstToken = t;
			lastToken = u;
		}
		return {
			firstToken,
			lastToken
		};
	}
	/**
	* Process the given node list.
	* The first node is offsetted from the given left token.
	* Rest nodes are adjusted to the first node.
	*
	* @param shouldAlignVertically The flag to align vertically. If `false`, this doesn't align vertically even if the first node is not at beginning of line.
	*/
	function processNodeList(nodeList, left, right, offset, shouldAlignVertically = true) {
		let t;
		const leftToken = left && tokenStore.getFirstToken(left);
		const rightToken = right && tokenStore.getFirstToken(right);
		if (nodeList.length > 0) {
			let baseToken = null;
			let lastToken = left;
			const alignTokensBeforeBaseToken = [];
			const alignTokens = [];
			for (const node of nodeList) {
				if (node == null) continue;
				const elementTokens = getFirstAndLastTokens(node, lastToken == null ? 0 : lastToken.range[1]);
				if (lastToken != null) {
					t = lastToken;
					while ((t = tokenStore.getTokenAfter(t, ITERATION_OPTS)) != null && t.range[1] <= elementTokens.firstToken.range[0]) if (baseToken == null) alignTokensBeforeBaseToken.push(t);
					else alignTokens.push(t);
				}
				if (baseToken == null) baseToken = elementTokens.firstToken;
				else alignTokens.push(elementTokens.firstToken);
				lastToken = elementTokens.lastToken;
			}
			if (rightToken != null && lastToken != null) {
				t = lastToken;
				while ((t = tokenStore.getTokenAfter(t, ITERATION_OPTS)) != null && t.range[1] <= rightToken.range[0]) if (baseToken == null) alignTokensBeforeBaseToken.push(t);
				else alignTokens.push(t);
			}
			if (leftToken != null) setOffset(alignTokensBeforeBaseToken, offset, leftToken);
			if (baseToken != null) {
				if (leftToken != null) setOffset(baseToken, offset, leftToken);
				if (nodeList.some(isBeginningOfLine)) setBaseline(baseToken);
				if (!shouldAlignVertically && leftToken != null) setOffset(alignTokens, offset, leftToken);
				else setOffset(alignTokens, 0, baseToken);
			}
		}
		if (rightToken != null && leftToken != null) setOffset(rightToken, 0, leftToken);
	}
	/**
	* Process the given node as body.
	* The body node maybe a block statement or an expression node.
	*/
	function processMaybeBlock(node, baseToken) {
		const firstToken = getFirstAndLastTokens(node).firstToken;
		setOffset(firstToken, (0, _eslint_community_eslint_utils.isOpeningBraceToken)(firstToken) ? 0 : 1, baseToken);
	}
	/**
	* Process semicolons of the given statement node.
	*/
	function processSemicolons(node) {
		const firstToken = tokenStore.getFirstToken(node);
		const lastToken = tokenStore.getLastToken(node);
		if ((0, _eslint_community_eslint_utils.isSemicolonToken)(lastToken) && firstToken !== lastToken) setOffset(lastToken, 0, firstToken);
		const info = offsets.get(firstToken);
		const prevToken = tokenStore.getTokenBefore(firstToken);
		if (info != null && prevToken && (0, _eslint_community_eslint_utils.isSemicolonToken)(prevToken) && prevToken.loc.end.line === firstToken.loc.start.line) offsets.set(prevToken, info);
	}
	/**
	* Find the head of chaining nodes.
	*/
	function getChainHeadToken(node) {
		const type = node.type;
		while (node.parent && node.parent.type === type) {
			if ((0, _eslint_community_eslint_utils.isOpeningParenToken)(tokenStore.getTokenBefore(node))) break;
			node = node.parent;
		}
		return tokenStore.getFirstToken(node);
	}
	/**
	* Check whether a given token is the first token of:
	*
	* - ExpressionStatement
	* - VExpressionContainer
	* - A parameter of CallExpression/NewExpression
	* - An element of ArrayExpression
	* - An expression of SequenceExpression
	*/
	function isBeginningOfElement(token, belongingNode) {
		let node = belongingNode;
		while (node != null && node.parent != null) {
			const parent = node.parent;
			if (parent.type.endsWith("Statement") || parent.type.endsWith("Declaration")) return parent.range[0] === token.range[0];
			if (parent.type === "VExpressionContainer") {
				if (node.range[0] !== token.range[0]) return false;
				return !(0, _eslint_community_eslint_utils.isOpeningParenToken)(tokenStore.getTokenBefore(belongingNode));
			}
			if (parent.type === "CallExpression" || parent.type === "NewExpression") {
				const openParen = tokenStore.getTokenAfter(parent.callee, _eslint_community_eslint_utils.isNotClosingParenToken);
				return parent.arguments.some((param) => getFirstAndLastTokens(param, openParen.range[1]).firstToken.range[0] === token.range[0]);
			}
			if (parent.type === "ArrayExpression") return parent.elements.some((element) => element != null && getFirstAndLastTokens(element).firstToken.range[0] === token.range[0]);
			if (parent.type === "SequenceExpression") return parent.expressions.some((expr) => getFirstAndLastTokens(expr).firstToken.range[0] === token.range[0]);
			node = parent;
		}
		return false;
	}
	/**
	* Set the base indentation to a given top-level AST node.
	*/
	function processTopLevelNode(node, expectedIndent) {
		const token = tokenStore.getFirstToken(node);
		const offsetInfo = offsets.get(token);
		if (offsetInfo == null) offsets.set(token, {
			baseToken: null,
			offset: 0,
			baseline: false,
			expectedIndent
		});
		else offsetInfo.expectedIndent = expectedIndent;
	}
	/**
	* Ignore all tokens of the given node.
	*/
	function ignore(node) {
		for (const token of tokenStore.getTokens(node)) {
			offsets.delete(token);
			ignoreTokens.add(token);
		}
	}
	/**
	* Define functions to ignore nodes into the given visitor.
	*/
	function processIgnores(visitor) {
		for (const ignorePattern of options.ignores) {
			const key = `${ignorePattern}:exit`;
			if (visitor.hasOwnProperty(key)) {
				const handler = visitor[key];
				visitor[key] = function(node, ...args) {
					const ret = handler.call(this, node, ...args);
					ignore(node);
					return ret;
				};
			} else visitor[key] = ignore;
		}
		return visitor;
	}
	/**
	* Calculate correct indentation of the line of the given tokens.
	*/
	function getExpectedIndents(tokens) {
		const expectedIndents = [];
		for (const [i, token] of tokens.entries()) {
			const offsetInfo = offsets.get(token);
			if (offsetInfo != null) if (offsetInfo.expectedIndent == null) {
				const baseOffsetInfo = offsets.get(offsetInfo.baseToken);
				if (baseOffsetInfo != null && baseOffsetInfo.expectedIndent != null && (i === 0 || !baseOffsetInfo.baseline)) {
					expectedIndents.push(baseOffsetInfo.expectedIndent + offsetInfo.offset * options.indentSize);
					if (baseOffsetInfo.baseline) break;
				}
			} else expectedIndents.push(offsetInfo.expectedIndent);
		}
		if (expectedIndents.length === 0) return null;
		return {
			expectedIndent: expectedIndents[0],
			expectedBaseIndent: Math.min(...expectedIndents)
		};
	}
	/**
	* Get the text of the indentation part of the line which the given token is on.
	*/
	function getIndentText(firstToken) {
		const text = sourceCode.text;
		let i = firstToken.range[0] - 1;
		while (i >= 0 && !LT_CHAR.test(text[i])) i -= 1;
		return text.slice(i + 1, firstToken.range[0]);
	}
	/**
	* Define the function which fixes the problem.
	*/
	function defineFix(token, actualIndent, expectedIndent) {
		if (token.type === "Block" && token.loc.start.line !== token.loc.end.line) {
			const lines = sourceCode.getText(token).match(LINES) || [];
			const firstLine = lines.shift();
			if (lines.every((l) => BLOCK_COMMENT_PREFIX.test(l))) return (fixer) => {
				const range = [token.range[0] - actualIndent, token.range[1]];
				const indent = options.indentChar.repeat(expectedIndent);
				return fixer.replaceTextRange(range, `${indent}${firstLine}${lines.map((l) => l.replace(BLOCK_COMMENT_PREFIX, () => `${indent} *`)).join("")}`);
			};
		}
		return (fixer) => {
			const range = [token.range[0] - actualIndent, token.range[0]];
			const indent = options.indentChar.repeat(expectedIndent);
			return fixer.replaceTextRange(range, indent);
		};
	}
	/**
	* Validate the given token with the pre-calculated expected indentation.
	*/
	function validateCore(token, expectedIndent, optionalExpectedIndents) {
		const line = token.loc.start.line;
		const indentText = getIndentText(token);
		if (indentText.trim() !== "") return;
		const actualIndent = token.loc.start.column;
		const unit = options.indentChar === "	" ? "tab" : "space";
		for (const [i, char] of [...indentText].entries()) if (char !== options.indentChar) {
			context.report({
				loc: {
					start: {
						line,
						column: i
					},
					end: {
						line,
						column: i + 1
					}
				},
				message: "Expected {{expected}} character, but found {{actual}} character.",
				data: {
					expected: JSON.stringify(options.indentChar),
					actual: JSON.stringify(char)
				},
				fix: defineFix(token, actualIndent, expectedIndent)
			});
			return;
		}
		if (actualIndent !== expectedIndent && (optionalExpectedIndents == null || !optionalExpectedIndents.includes(actualIndent))) context.report({
			loc: {
				start: {
					line,
					column: 0
				},
				end: {
					line,
					column: actualIndent
				}
			},
			message: "Expected indentation of {{expectedIndent}} {{unit}}{{expectedIndentPlural}} but found {{actualIndent}} {{unit}}{{actualIndentPlural}}.",
			data: {
				expectedIndent,
				actualIndent,
				unit,
				expectedIndentPlural: expectedIndent === 1 ? "" : "s",
				actualIndentPlural: actualIndent === 1 ? "" : "s"
			},
			fix: defineFix(token, actualIndent, expectedIndent)
		});
	}
	/**
	* Get the expected indent of comments.
	*/
	function getCommentExpectedIndents(nextToken, nextExpectedIndent, lastExpectedIndent) {
		if (typeof lastExpectedIndent === "number" && isClosingToken(nextToken)) {
			if (nextExpectedIndent === lastExpectedIndent) return [nextExpectedIndent + options.indentSize, nextExpectedIndent];
			return [lastExpectedIndent, nextExpectedIndent];
		}
		return [nextExpectedIndent];
	}
	/**
	* Validate indentation of the line that the given tokens are on.
	* @param tokens The tokens on the same line to validate.
	* @param comments The comments which are on the immediately previous lines of the tokens.
	* @param lastToken The last validated token. Comments can adjust to the token.
	*/
	function validate(tokens, comments, lastToken) {
		const firstToken = tokens[0];
		const actualIndent = firstToken.loc.start.column;
		const expectedIndents = getExpectedIndents(tokens);
		if (!expectedIndents) return;
		const expectedBaseIndent = expectedIndents.expectedBaseIndent;
		const expectedIndent = expectedIndents.expectedIndent;
		const baseline = /* @__PURE__ */ new Set();
		for (const token of tokens) {
			const offsetInfo = offsets.get(token);
			if (offsetInfo != null) if (offsetInfo.baseline) {
				offsetInfo.expectedIndent = options.indentChar === " " ? Math.max(0, token.loc.start.column + expectedBaseIndent - actualIndent) : expectedBaseIndent + (token === tokens[0] ? 0 : 1);
				baseline.add(token);
			} else if (baseline.has(offsetInfo.baseToken)) {
				offsetInfo.expectedIndent = offsets.get(offsetInfo.baseToken).expectedIndent;
				baseline.add(token);
			} else offsetInfo.expectedIndent = expectedBaseIndent;
		}
		if (ignoreTokens.has(firstToken)) return;
		const lastOffsetInfo = offsets.get(lastToken);
		const commentOptionalExpectedIndents = getCommentExpectedIndents(firstToken, expectedIndent, lastOffsetInfo && lastOffsetInfo.expectedIndent);
		for (const comment of comments) {
			const commentExpectedIndents = getExpectedIndents([comment]);
			validateCore(comment, commentExpectedIndents ? commentExpectedIndents.expectedIndent : commentOptionalExpectedIndents[0], commentOptionalExpectedIndents);
		}
		validateCore(firstToken, expectedIndent);
	}
	const knownNodes = /* @__PURE__ */ new Set();
	const visitor = {
		VAttribute(node) {
			const keyToken = tokenStore.getFirstToken(node);
			const eqToken = tokenStore.getTokenAfter(node.key);
			if (eqToken != null && eqToken.range[1] <= node.range[1]) {
				setOffset(eqToken, 1, keyToken);
				const valueToken = tokenStore.getTokenAfter(eqToken);
				if (valueToken != null && valueToken.range[1] <= node.range[1]) setOffset(valueToken, 1, keyToken);
			}
		},
		VElement(node) {
			if (PREFORMATTED_ELEMENT_NAMES.has(node.name)) {
				const startTagToken = tokenStore.getFirstToken(node);
				setOffset(node.endTag && tokenStore.getFirstToken(node.endTag), 0, startTagToken);
				setPreformattedTokens(node);
			} else {
				const offset = node.parent.type !== "VElement" ? options.baseIndent : 1;
				processNodeList(node.children.filter(require_indent_utils.isNotEmptyTextNode), node.startTag, node.endTag, offset, false);
			}
		},
		VEndTag(node) {
			const element = node.parent;
			const startTagOpenToken = tokenStore.getFirstToken(element.startTag);
			const closeToken = tokenStore.getLastToken(node);
			if (closeToken.type.endsWith("TagClose")) setOffset(closeToken, options.closeBracket.endTag, startTagOpenToken);
		},
		VExpressionContainer(node) {
			if (node.expression == null || node.range[0] === node.expression.range[0]) return;
			const startQuoteToken = tokenStore.getFirstToken(node);
			const endQuoteToken = tokenStore.getLastToken(node);
			setOffset(tokenStore.getTokenAfter(startQuoteToken), 1, startQuoteToken);
			setOffset(endQuoteToken, 0, startQuoteToken);
		},
		VFilter(node) {
			const idToken = tokenStore.getFirstToken(node);
			const lastToken = tokenStore.getLastToken(node);
			if ((0, _eslint_community_eslint_utils.isClosingParenToken)(lastToken)) {
				const leftParenToken = tokenStore.getTokenAfter(node.callee);
				setOffset(leftParenToken, 1, idToken);
				processNodeList(node.arguments, leftParenToken, lastToken, 1);
			}
		},
		VFilterSequenceExpression(node) {
			if (node.filters.length === 0) return;
			const firstToken = tokenStore.getFirstToken(node);
			const tokens = [];
			for (const filter of node.filters) tokens.push(tokenStore.getTokenBefore(filter, require_indent_utils.isPipeOperator), tokenStore.getFirstToken(filter));
			setOffset(tokens, 1, firstToken);
		},
		VForExpression(node) {
			const firstToken = tokenStore.getFirstToken(node);
			const lastOfLeft = require_indent_utils.last(node.left) || firstToken;
			const inToken = tokenStore.getTokenAfter(lastOfLeft, _eslint_community_eslint_utils.isNotClosingParenToken);
			const rightToken = tokenStore.getFirstToken(node.right);
			if ((0, _eslint_community_eslint_utils.isOpeningParenToken)(firstToken)) {
				const rightToken = tokenStore.getTokenAfter(lastOfLeft, _eslint_community_eslint_utils.isClosingParenToken);
				processNodeList(node.left, firstToken, rightToken, 1);
			}
			setOffset(inToken, 1, firstToken);
			setOffset(rightToken, 1, inToken);
		},
		VOnExpression(node) {
			processNodeList(node.body, null, null, 0);
		},
		VStartTag(node) {
			const openToken = tokenStore.getFirstToken(node);
			const closeToken = tokenStore.getLastToken(node);
			processNodeList(node.attributes, openToken, null, options.attribute, options.alignAttributesVertically);
			if (closeToken != null && closeToken.type.endsWith("TagClose")) setOffset(closeToken, closeToken.type === "HTMLSelfClosingTagClose" ? options.closeBracket.selfClosingTag : options.closeBracket.startTag, openToken);
		},
		VText(node) {
			const tokens = tokenStore.getTokens(node, require_indent_utils.isNotWhitespace);
			const firstTokenInfo = offsets.get(tokenStore.getFirstToken(node));
			for (const token of tokens) offsets.set(token, Object.assign({}, firstTokenInfo));
		},
		VIdentifier() {},
		VLiteral() {},
		VDirectiveKey() {},
		VSlotScopeExpression() {},
		"ArrayExpression, ArrayPattern"(node) {
			const firstToken = tokenStore.getFirstToken(node);
			const rightToken = tokenStore.getTokenAfter(node.elements.at(-1) || firstToken, _eslint_community_eslint_utils.isClosingBracketToken);
			processNodeList(node.elements, firstToken, rightToken, 1);
		},
		ArrowFunctionExpression(node) {
			const firstToken = tokenStore.getFirstToken(node);
			const secondToken = tokenStore.getTokenAfter(firstToken);
			const leftToken = node.async ? secondToken : firstToken;
			const arrowToken = tokenStore.getTokenBefore(node.body, _eslint_community_eslint_utils.isArrowToken);
			if (node.async) setOffset(secondToken, 1, firstToken);
			if ((0, _eslint_community_eslint_utils.isOpeningParenToken)(leftToken)) {
				const rightToken = tokenStore.getTokenAfter(require_indent_utils.last(node.params) || leftToken, _eslint_community_eslint_utils.isClosingParenToken);
				processNodeList(node.params, leftToken, rightToken, 1);
			}
			setOffset(arrowToken, 1, firstToken);
			processMaybeBlock(node.body, firstToken);
		},
		"AssignmentExpression, AssignmentPattern, BinaryExpression, LogicalExpression"(node) {
			const leftToken = getChainHeadToken(node);
			const opToken = tokenStore.getTokenAfter(node.left, _eslint_community_eslint_utils.isNotClosingParenToken);
			const rightToken = tokenStore.getTokenAfter(opToken);
			const prevToken = tokenStore.getTokenBefore(leftToken);
			const shouldIndent = prevToken == null || prevToken.loc.end.line === leftToken.loc.start.line || isBeginningOfElement(leftToken, node);
			setOffset([opToken, rightToken], shouldIndent ? 1 : 0, leftToken);
		},
		"AwaitExpression, RestElement, SpreadElement, UnaryExpression"(node) {
			const firstToken = tokenStore.getFirstToken(node);
			setOffset(tokenStore.getTokenAfter(firstToken), 1, firstToken);
		},
		"BlockStatement, ClassBody"(node) {
			processNodeList(node.body, tokenStore.getFirstToken(node), tokenStore.getLastToken(node), 1);
		},
		StaticBlock(node) {
			const firstToken = tokenStore.getFirstToken(node);
			let next = tokenStore.getTokenAfter(firstToken);
			while (next && (0, _eslint_community_eslint_utils.isNotOpeningBraceToken)(next)) {
				setOffset(next, 0, firstToken);
				next = tokenStore.getTokenAfter(next);
			}
			setOffset(next, 0, firstToken);
			processNodeList(node.body, next, tokenStore.getLastToken(node), 1);
		},
		"BreakStatement, ContinueStatement, ReturnStatement, ThrowStatement"(node) {
			if ((node.type !== "ReturnStatement" && node.type !== "ThrowStatement" || node.argument == null) && (node.type !== "BreakStatement" && node.type !== "ContinueStatement" || node.label == null)) return;
			const firstToken = tokenStore.getFirstToken(node);
			setOffset(tokenStore.getTokenAfter(firstToken), 1, firstToken);
		},
		CallExpression(node) {
			const typeArguments = "typeArguments" in node ? node.typeArguments : node.typeParameters;
			const firstToken = tokenStore.getFirstToken(node);
			const rightToken = tokenStore.getLastToken(node);
			const leftToken = tokenStore.getTokenAfter(typeArguments || node.callee, _eslint_community_eslint_utils.isOpeningParenToken);
			if (typeArguments) setOffset(tokenStore.getFirstToken(typeArguments), 1, firstToken);
			const optionalTokens = tokenStore.getTokensBetween(tokenStore.getLastToken(typeArguments || node.callee), leftToken, isOptionalToken);
			for (const optionalToken of optionalTokens) setOffset(optionalToken, 1, firstToken);
			setOffset(leftToken, 1, firstToken);
			processNodeList(node.arguments, leftToken, rightToken, 1);
		},
		ImportExpression(node) {
			const firstToken = tokenStore.getFirstToken(node);
			const rightToken = tokenStore.getLastToken(node);
			const leftToken = tokenStore.getTokenAfter(firstToken, _eslint_community_eslint_utils.isOpeningParenToken);
			setOffset(leftToken, 1, firstToken);
			processNodeList([node.source], leftToken, rightToken, 1);
		},
		CatchClause(node) {
			const firstToken = tokenStore.getFirstToken(node);
			const bodyToken = tokenStore.getFirstToken(node.body);
			if (node.param != null) {
				const leftToken = tokenStore.getTokenAfter(firstToken);
				const rightToken = tokenStore.getTokenAfter(node.param);
				setOffset(leftToken, 1, firstToken);
				processNodeList([node.param], leftToken, rightToken, 1);
			}
			setOffset(bodyToken, 0, firstToken);
		},
		"ClassDeclaration, ClassExpression"(node) {
			const firstToken = tokenStore.getFirstToken(node);
			const bodyToken = tokenStore.getFirstToken(node.body);
			if (node.id != null) setOffset(tokenStore.getFirstToken(node.id), 1, firstToken);
			if (node.superClass != null) {
				const extendsToken = tokenStore.getTokenBefore(node.superClass, require_indent_utils.isExtendsKeyword);
				const superClassToken = tokenStore.getTokenAfter(extendsToken);
				setOffset(extendsToken, 1, firstToken);
				setOffset(superClassToken, 1, extendsToken);
			}
			setOffset(bodyToken, 0, firstToken);
		},
		ConditionalExpression(node) {
			const prevToken = tokenStore.getTokenBefore(node);
			const firstToken = tokenStore.getFirstToken(node);
			const questionToken = tokenStore.getTokenAfter(node.test, _eslint_community_eslint_utils.isNotClosingParenToken);
			const consequentToken = tokenStore.getTokenAfter(questionToken);
			const colonToken = tokenStore.getTokenAfter(node.consequent, _eslint_community_eslint_utils.isNotClosingParenToken);
			const alternateToken = tokenStore.getTokenAfter(colonToken);
			if (prevToken && prevToken.loc.end.line !== node.loc.start.line && node.test.loc.end.line === node.consequent.loc.start.line) setOffset([
				questionToken,
				consequentToken,
				colonToken,
				alternateToken
			], 0, firstToken);
			else {
				setOffset([questionToken, colonToken], 1, firstToken);
				setOffset([consequentToken, alternateToken], 1, questionToken);
			}
		},
		DoWhileStatement(node) {
			const doToken = tokenStore.getFirstToken(node);
			const whileToken = tokenStore.getTokenAfter(node.body, _eslint_community_eslint_utils.isNotClosingParenToken);
			const leftToken = tokenStore.getTokenAfter(whileToken);
			const testToken = tokenStore.getTokenAfter(leftToken);
			const lastToken = tokenStore.getLastToken(node);
			const rightToken = (0, _eslint_community_eslint_utils.isSemicolonToken)(lastToken) ? tokenStore.getTokenBefore(lastToken) : lastToken;
			processMaybeBlock(node.body, doToken);
			setOffset(whileToken, 0, doToken);
			setOffset(leftToken, 1, whileToken);
			setOffset(testToken, 1, leftToken);
			setOffset(rightToken, 0, leftToken);
		},
		ExportAllDeclaration(node) {
			const exportToken = tokenStore.getFirstToken(node);
			const tokens = [...tokenStore.getTokensBetween(exportToken, node.source), tokenStore.getFirstToken(node.source)];
			if (node.exported) {
				const starToken = tokens.find(require_indent_utils.isWildcard);
				const asToken = tokenStore.getTokenAfter(starToken);
				const exportedToken = tokenStore.getTokenAfter(asToken);
				const afterTokens = tokens.slice(tokens.indexOf(exportedToken) + 1);
				setOffset(starToken, 1, exportToken);
				setOffset(asToken, 1, starToken);
				setOffset(exportedToken, 1, starToken);
				setOffset(afterTokens, 1, exportToken);
			} else setOffset(tokens, 1, exportToken);
			const lastToken = tokenStore.getLastToken(node, _eslint_community_eslint_utils.isNotSemicolonToken);
			const assertionTokens = tokenStore.getTokensBetween(node.source, lastToken);
			if (assertionTokens.length > 0) {
				const assertToken = assertionTokens.shift();
				setOffset(assertToken, 0, exportToken);
				const assertionOpen = assertionTokens.shift();
				if (assertionOpen) {
					setOffset(assertionOpen, 1, assertToken);
					processNodeList(assertionTokens, assertionOpen, lastToken, 1);
				}
			}
		},
		ExportDefaultDeclaration(node) {
			const exportToken = tokenStore.getFirstToken(node);
			const defaultToken = tokenStore.getFirstToken(node, 1);
			const declarationToken = getFirstAndLastTokens(node.declaration).firstToken;
			setOffset([defaultToken, declarationToken], 1, exportToken);
		},
		ExportNamedDeclaration(node) {
			const exportToken = tokenStore.getFirstToken(node);
			if (node.declaration) setOffset(tokenStore.getFirstToken(node, 1), 1, exportToken);
			else {
				const firstSpecifier = node.specifiers[0];
				if (!firstSpecifier || firstSpecifier.type === "ExportSpecifier") {
					const leftBraceTokens = firstSpecifier ? tokenStore.getTokensBetween(exportToken, firstSpecifier) : [tokenStore.getTokenAfter(exportToken)];
					const rightBraceToken = node.source ? tokenStore.getTokenBefore(node.source, _eslint_community_eslint_utils.isClosingBraceToken) : tokenStore.getLastToken(node, _eslint_community_eslint_utils.isClosingBraceToken);
					setOffset(leftBraceTokens, 0, exportToken);
					processNodeList(node.specifiers, require_indent_utils.last(leftBraceTokens), rightBraceToken, 1);
					if (node.source) {
						setOffset([...tokenStore.getTokensBetween(rightBraceToken, node.source), sourceCode.getFirstToken(node.source)], 1, exportToken);
						const lastToken = tokenStore.getLastToken(node, _eslint_community_eslint_utils.isNotSemicolonToken);
						const assertionTokens = tokenStore.getTokensBetween(node.source, lastToken);
						if (assertionTokens.length > 0) {
							const assertToken = assertionTokens.shift();
							setOffset(assertToken, 0, exportToken);
							const assertionOpen = assertionTokens.shift();
							if (assertionOpen) {
								setOffset(assertionOpen, 1, assertToken);
								processNodeList(assertionTokens, assertionOpen, lastToken, 1);
							}
						}
					}
				}
			}
		},
		"ExportSpecifier, ImportSpecifier"(node) {
			const tokens = tokenStore.getTokens(node);
			let firstToken = tokens.shift();
			if (firstToken.value === "type") {
				const typeToken = firstToken;
				firstToken = tokens.shift();
				setOffset(firstToken, 0, typeToken);
			}
			setOffset(tokens, 1, firstToken);
		},
		"ForInStatement, ForOfStatement"(node) {
			const forToken = tokenStore.getFirstToken(node);
			const awaitToken = node.type === "ForOfStatement" && node.await && tokenStore.getTokenAfter(forToken) || null;
			const leftParenToken = tokenStore.getTokenAfter(awaitToken || forToken);
			const leftToken = tokenStore.getTokenAfter(leftParenToken);
			const inToken = tokenStore.getTokenAfter(leftToken, _eslint_community_eslint_utils.isNotClosingParenToken);
			const rightToken = tokenStore.getTokenAfter(inToken);
			const rightParenToken = tokenStore.getTokenBefore(node.body, _eslint_community_eslint_utils.isNotOpeningParenToken);
			if (awaitToken != null) setOffset(awaitToken, 0, forToken);
			setOffset(leftParenToken, 1, forToken);
			setOffset(leftToken, 1, leftParenToken);
			setOffset(inToken, 1, leftToken);
			setOffset(rightToken, 1, leftToken);
			setOffset(rightParenToken, 0, leftParenToken);
			processMaybeBlock(node.body, forToken);
		},
		ForStatement(node) {
			const forToken = tokenStore.getFirstToken(node);
			const leftParenToken = tokenStore.getTokenAfter(forToken);
			const rightParenToken = tokenStore.getTokenBefore(node.body, _eslint_community_eslint_utils.isNotOpeningParenToken);
			setOffset(leftParenToken, 1, forToken);
			processNodeList([
				node.init,
				node.test,
				node.update
			], leftParenToken, rightParenToken, 1);
			processMaybeBlock(node.body, forToken);
		},
		"FunctionDeclaration, FunctionExpression"(node) {
			const firstToken = tokenStore.getFirstToken(node);
			let leftParenToken, bodyBaseToken;
			if ((0, _eslint_community_eslint_utils.isOpeningParenToken)(firstToken)) {
				leftParenToken = firstToken;
				bodyBaseToken = tokenStore.getFirstToken(node.parent);
			} else {
				let nextToken = tokenStore.getTokenAfter(firstToken);
				let nextTokenOffset = 0;
				while (nextToken && !(0, _eslint_community_eslint_utils.isOpeningParenToken)(nextToken) && nextToken.value !== "<") {
					if (nextToken.value === "*" || node.id && nextToken.range[0] === node.id.range[0]) nextTokenOffset = 1;
					setOffset(nextToken, nextTokenOffset, firstToken);
					nextToken = tokenStore.getTokenAfter(nextToken);
				}
				leftParenToken = nextToken;
				bodyBaseToken = firstToken;
			}
			if (!(0, _eslint_community_eslint_utils.isOpeningParenToken)(leftParenToken) && node.typeParameters) leftParenToken = tokenStore.getTokenAfter(node.typeParameters);
			const rightParenToken = tokenStore.getTokenAfter(node.params.at(-1) || leftParenToken, _eslint_community_eslint_utils.isClosingParenToken);
			setOffset(leftParenToken, 1, bodyBaseToken);
			processNodeList(node.params, leftParenToken, rightParenToken, 1);
			setOffset(tokenStore.getFirstToken(node.body), 0, bodyBaseToken);
		},
		IfStatement(node) {
			const ifToken = tokenStore.getFirstToken(node);
			const ifLeftParenToken = tokenStore.getTokenAfter(ifToken);
			const ifRightParenToken = tokenStore.getTokenBefore(node.consequent, _eslint_community_eslint_utils.isClosingParenToken);
			setOffset(ifLeftParenToken, 1, ifToken);
			setOffset(ifRightParenToken, 0, ifLeftParenToken);
			processMaybeBlock(node.consequent, ifToken);
			if (node.alternate != null) {
				const elseToken = tokenStore.getTokenAfter(node.consequent, _eslint_community_eslint_utils.isNotClosingParenToken);
				setOffset(elseToken, 0, ifToken);
				processMaybeBlock(node.alternate, elseToken);
			}
		},
		ImportDeclaration(node) {
			const importToken = tokenStore.getFirstToken(node);
			const tokens = tokenStore.getTokensBetween(importToken, node.source);
			const fromIndex = tokens.map((t) => t.value).lastIndexOf("from");
			const { fromToken, beforeTokens, afterTokens } = fromIndex === -1 ? {
				fromToken: null,
				beforeTokens: [...tokens, tokenStore.getFirstToken(node.source)],
				afterTokens: []
			} : {
				fromToken: tokens[fromIndex],
				beforeTokens: tokens.slice(0, fromIndex),
				afterTokens: [...tokens.slice(fromIndex + 1), tokenStore.getFirstToken(node.source)]
			};
			const namedSpecifiers = [];
			for (const specifier of node.specifiers) if (specifier.type === "ImportSpecifier") namedSpecifiers.push(specifier);
			else {
				const removeTokens = tokenStore.getTokens(specifier);
				removeTokens.shift();
				for (const token of removeTokens) {
					const i = beforeTokens.indexOf(token);
					if (i !== -1) beforeTokens.splice(i, 1);
				}
			}
			const lastNamedSpecifier = namedSpecifiers.at(-1);
			if (lastNamedSpecifier) {
				const leftBrace = tokenStore.getTokenBefore(namedSpecifiers[0]);
				const rightBrace = tokenStore.getTokenAfter(lastNamedSpecifier, _eslint_community_eslint_utils.isClosingBraceToken);
				processNodeList(namedSpecifiers, leftBrace, rightBrace, 1);
				for (const token of [...tokenStore.getTokensBetween(leftBrace, rightBrace), rightBrace]) {
					const i = beforeTokens.indexOf(token);
					if (i !== -1) beforeTokens.splice(i, 1);
				}
			}
			if (beforeTokens.every((t) => (0, _eslint_community_eslint_utils.isOpeningBraceToken)(t) || (0, _eslint_community_eslint_utils.isClosingBraceToken)(t))) setOffset(beforeTokens, 0, importToken);
			else setOffset(beforeTokens, 1, importToken);
			if (fromToken) {
				setOffset(fromToken, 1, importToken);
				setOffset(afterTokens, 0, fromToken);
			}
			const lastToken = tokenStore.getLastToken(node, _eslint_community_eslint_utils.isNotSemicolonToken);
			const assertionTokens = tokenStore.getTokensBetween(node.source, lastToken);
			if (assertionTokens.length > 0) {
				const assertToken = assertionTokens.shift();
				setOffset(assertToken, 0, importToken);
				const assertionOpen = assertionTokens.shift();
				if (assertionOpen) {
					setOffset(assertionOpen, 1, assertToken);
					processNodeList(assertionTokens, assertionOpen, lastToken, 1);
				}
			}
		},
		ImportNamespaceSpecifier(node) {
			const tokens = tokenStore.getTokens(node);
			setOffset(tokens, 1, tokens.shift());
		},
		LabeledStatement(node) {
			const labelToken = tokenStore.getFirstToken(node);
			const colonToken = tokenStore.getTokenAfter(labelToken);
			setOffset([colonToken, tokenStore.getTokenAfter(colonToken)], 1, labelToken);
		},
		"MemberExpression, MetaProperty"(node) {
			const objectToken = tokenStore.getFirstToken(node);
			if (node.type === "MemberExpression" && node.computed) {
				const leftBracketToken = tokenStore.getTokenBefore(node.property, _eslint_community_eslint_utils.isOpeningBracketToken);
				const propertyToken = tokenStore.getTokenAfter(leftBracketToken);
				const rightBracketToken = tokenStore.getTokenAfter(node.property, _eslint_community_eslint_utils.isClosingBracketToken);
				const optionalTokens = tokenStore.getTokensBetween(tokenStore.getLastToken(node.object), leftBracketToken, isOptionalToken);
				for (const optionalToken of optionalTokens) setOffset(optionalToken, 1, objectToken);
				setOffset(leftBracketToken, 1, objectToken);
				setOffset(propertyToken, 1, leftBracketToken);
				setOffset(rightBracketToken, 0, leftBracketToken);
			} else {
				const dotToken = tokenStore.getTokenBefore(node.property);
				setOffset([dotToken, tokenStore.getTokenAfter(dotToken)], 1, objectToken);
			}
		},
		"MethodDefinition, Property, PropertyDefinition"(node) {
			const firstToken = tokenStore.getFirstToken(node);
			const keyTokens = getFirstAndLastTokens(node.key);
			const prefixTokens = tokenStore.getTokensBetween(firstToken, keyTokens.firstToken);
			if (node.computed) prefixTokens.pop();
			setOffset(prefixTokens, 0, firstToken);
			let lastKeyToken;
			if (node.computed) {
				const leftBracketToken = tokenStore.getTokenBefore(keyTokens.firstToken);
				const rightBracketToken = lastKeyToken = tokenStore.getTokenAfter(keyTokens.lastToken);
				setOffset(leftBracketToken, 0, firstToken);
				processNodeList([node.key], leftBracketToken, rightBracketToken, 1);
			} else {
				setOffset(keyTokens.firstToken, 0, firstToken);
				lastKeyToken = keyTokens.lastToken;
			}
			if (node.value != null) {
				const initToken = tokenStore.getFirstToken(node.value);
				setOffset([...tokenStore.getTokensBetween(lastKeyToken, initToken), initToken], 1, lastKeyToken);
			}
		},
		NewExpression(node) {
			const typeArguments = "typeArguments" in node ? node.typeArguments : node.typeParameters;
			const newToken = tokenStore.getFirstToken(node);
			const calleeToken = tokenStore.getTokenAfter(newToken);
			const rightToken = tokenStore.getLastToken(node);
			const leftToken = (0, _eslint_community_eslint_utils.isClosingParenToken)(rightToken) ? tokenStore.getFirstTokenBetween(typeArguments || node.callee, rightToken, _eslint_community_eslint_utils.isOpeningParenToken) : null;
			if (typeArguments) setOffset(tokenStore.getFirstToken(typeArguments), 1, calleeToken);
			setOffset(calleeToken, 1, newToken);
			if (leftToken != null) {
				setOffset(leftToken, 1, calleeToken);
				processNodeList(node.arguments, leftToken, rightToken, 1);
			}
		},
		"ObjectExpression, ObjectPattern"(node) {
			const firstToken = tokenStore.getFirstToken(node);
			const rightToken = tokenStore.getTokenAfter(node.properties.at(-1) || firstToken, _eslint_community_eslint_utils.isClosingBraceToken);
			processNodeList(node.properties, firstToken, rightToken, 1);
		},
		SequenceExpression(node) {
			processNodeList(node.expressions, null, null, 0);
		},
		SwitchCase(node) {
			const caseToken = tokenStore.getFirstToken(node);
			if (node.test == null) setOffset(tokenStore.getTokenAfter(caseToken), 1, caseToken);
			else setOffset([tokenStore.getTokenAfter(caseToken), tokenStore.getTokenAfter(node.test, _eslint_community_eslint_utils.isNotClosingParenToken)], 1, caseToken);
			if (node.consequent.length === 1 && node.consequent[0].type === "BlockStatement") setOffset(tokenStore.getFirstToken(node.consequent[0]), 0, caseToken);
			else if (node.consequent.length > 0) {
				setOffset(tokenStore.getFirstToken(node.consequent[0]), 1, caseToken);
				processNodeList(node.consequent, null, null, 0);
			}
		},
		SwitchStatement(node) {
			const switchToken = tokenStore.getFirstToken(node);
			const leftParenToken = tokenStore.getTokenAfter(switchToken);
			const discriminantToken = tokenStore.getTokenAfter(leftParenToken);
			const leftBraceToken = tokenStore.getTokenAfter(node.discriminant, _eslint_community_eslint_utils.isOpeningBraceToken);
			const rightParenToken = tokenStore.getTokenBefore(leftBraceToken);
			const rightBraceToken = tokenStore.getLastToken(node);
			setOffset(leftParenToken, 1, switchToken);
			setOffset(discriminantToken, 1, leftParenToken);
			setOffset(rightParenToken, 0, leftParenToken);
			setOffset(leftBraceToken, 0, switchToken);
			processNodeList(node.cases, leftBraceToken, rightBraceToken, options.switchCase);
		},
		TaggedTemplateExpression(node) {
			const tagTokens = getFirstAndLastTokens(node.tag, node.range[0]);
			setOffset(tokenStore.getTokenAfter(tagTokens.lastToken), 1, tagTokens.firstToken);
		},
		TemplateLiteral(node) {
			const firstToken = tokenStore.getFirstToken(node);
			const quasiTokens = node.quasis.slice(1).map((n) => tokenStore.getFirstToken(n));
			const expressionToken = node.quasis.slice(0, -1).map((n) => tokenStore.getTokenAfter(n));
			setOffset(quasiTokens, 0, firstToken);
			setOffset(expressionToken, 1, firstToken);
		},
		TryStatement(node) {
			const tryToken = tokenStore.getFirstToken(node);
			setOffset(tokenStore.getFirstToken(node.block), 0, tryToken);
			if (node.handler != null) setOffset(tokenStore.getFirstToken(node.handler), 0, tryToken);
			if (node.finalizer != null) setOffset([tokenStore.getTokenBefore(node.finalizer), tokenStore.getFirstToken(node.finalizer)], 0, tryToken);
		},
		UpdateExpression(node) {
			const firstToken = tokenStore.getFirstToken(node);
			setOffset(tokenStore.getTokenAfter(firstToken), 1, firstToken);
		},
		VariableDeclaration(node) {
			processNodeList(node.declarations, tokenStore.getFirstToken(node), null, 1);
		},
		VariableDeclarator(node) {
			if (node.init == null) return;
			const idToken = tokenStore.getFirstToken(node);
			const eqToken = tokenStore.getTokenAfter(node.id);
			setOffset([eqToken, tokenStore.getTokenAfter(eqToken)], 1, idToken);
		},
		"WhileStatement, WithStatement"(node) {
			const firstToken = tokenStore.getFirstToken(node);
			const leftParenToken = tokenStore.getTokenAfter(firstToken);
			const rightParenToken = tokenStore.getTokenBefore(node.body, _eslint_community_eslint_utils.isClosingParenToken);
			setOffset(leftParenToken, 1, firstToken);
			setOffset(rightParenToken, 0, leftParenToken);
			processMaybeBlock(node.body, firstToken);
		},
		YieldExpression(node) {
			if (node.argument == null) return;
			const yieldToken = tokenStore.getFirstToken(node);
			setOffset(tokenStore.getTokenAfter(yieldToken), 1, yieldToken);
			if (node.delegate) setOffset(tokenStore.getTokenAfter(yieldToken, 1), 1, yieldToken);
		},
		DebuggerStatement() {},
		Identifier() {},
		ImportDefaultSpecifier() {},
		Literal() {},
		PrivateIdentifier() {},
		Super() {},
		TemplateElement() {},
		ThisExpression() {},
		ExpressionStatement() {},
		ChainExpression() {},
		EmptyStatement() {},
		":statement, PropertyDefinition"(node) {
			processSemicolons(node);
		},
		":expression"(node) {
			let leftToken = tokenStore.getTokenBefore(node);
			let rightToken = tokenStore.getTokenAfter(node);
			let firstToken = tokenStore.getFirstToken(node);
			while (leftToken && rightToken && (0, _eslint_community_eslint_utils.isOpeningParenToken)(leftToken) && (0, _eslint_community_eslint_utils.isClosingParenToken)(rightToken)) {
				setOffset(firstToken, 1, leftToken);
				setOffset(rightToken, 0, leftToken);
				firstToken = leftToken;
				leftToken = tokenStore.getTokenBefore(leftToken);
				rightToken = tokenStore.getTokenAfter(rightToken);
			}
		},
		...require_indent_ts.defineVisitor({
			processNodeList,
			tokenStore,
			setOffset,
			copyOffset,
			processSemicolons,
			getFirstAndLastTokens
		}),
		"*:exit"(node) {
			if (!knownNodes.has(node.type)) ignore(node);
		},
		Program(node) {
			const firstToken = node.tokens[0];
			const baseIndent = firstToken != null && firstToken.type === "Punctuator" && firstToken.value === "<script>" ? options.indentSize * options.baseIndent : 0;
			for (const statement of node.body) processTopLevelNode(statement, baseIndent);
		},
		"VElement[parent.type!='VElement']"(node) {
			processTopLevelNode(node, 0);
		},
		":matches(Program, VElement[parent.type!='VElement']):exit"(node) {
			let comments = [];
			let tokensOnSameLine = [];
			let isBesideMultilineToken = false;
			let lastValidatedToken = null;
			for (const token of tokenStore.getTokens(node, ITERATION_OPTS)) {
				const tokenStartLine = token.loc.start.line;
				if (tokensOnSameLine.length === 0 || tokensOnSameLine[0].loc.start.line === tokenStartLine) tokensOnSameLine.push(token);
				else if (tokensOnSameLine.every(require_indent_utils.isComment)) {
					comments.push(tokensOnSameLine[0]);
					isBesideMultilineToken = require_indent_utils.last(tokensOnSameLine).loc.end.line === tokenStartLine;
					tokensOnSameLine = [token];
				} else {
					if (!isBesideMultilineToken) {
						validate(tokensOnSameLine, comments, lastValidatedToken);
						lastValidatedToken = tokensOnSameLine[0];
					}
					isBesideMultilineToken = require_indent_utils.last(tokensOnSameLine).loc.end.line === tokenStartLine;
					tokensOnSameLine = [token];
					comments = [];
				}
			}
			if (tokensOnSameLine.some(require_indent_utils.isNotComment)) validate(tokensOnSameLine, comments, lastValidatedToken);
		}
	};
	for (const key of Object.keys(visitor)) for (const rawNodeName of key.split(/\s*,\s*/gu)) {
		const nodeName = rawNodeName.trim();
		if (/[a-z]+/i.test(nodeName)) knownNodes.add(nodeName);
	}
	return processIgnores(visitor);
}
//#endregion
exports.defineVisitor = defineVisitor;
3xwRconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("./ts-utils/index.js");
let _eslint_community_eslint_utils = require("@eslint-community/eslint-utils");
//#region lib/utils/indent-ts.ts
var import_ts_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
function defineVisitor({ processNodeList, tokenStore, setOffset, copyOffset, processSemicolons, getFirstAndLastTokens }) {
	/**
	* Check whether a given token is the first token of:
	*
	* - A parameter of TSTypeParameterInstantiation
	* - An element of TSTupleType
	*/
	function isBeginningOfElement(token, belongingNode) {
		let node = belongingNode;
		while (node != null && node.parent != null) {
			const parent = node.parent;
			if (parent.type === "TSTypeParameterInstantiation") return parent.params.length >= 2 && parent.params.some((param) => getFirstAndLastTokens(param).firstToken.range[0] === token.range[0]);
			if (parent.type === "TSTupleType") return parent.elementTypes.some((element) => element != null && getFirstAndLastTokens(element).firstToken.range[0] === token.range[0]);
			node = parent;
		}
		return false;
	}
	return {
		["ClassDeclaration[implements], ClassDeclaration[typeParameters], ClassDeclaration[superTypeParameters],ClassExpression[implements], ClassExpression[typeParameters], ClassExpression[superTypeParameters]"](node) {
			if (node.typeParameters != null) setOffset(tokenStore.getFirstToken(node.typeParameters), 1, tokenStore.getFirstToken(node.id || node));
			const superTypeArguments = node.superTypeArguments || node.superTypeParameters;
			if (superTypeArguments != null && node.superClass != null) setOffset(tokenStore.getFirstToken(superTypeArguments), 1, tokenStore.getFirstToken(node.superClass));
			if (node.implements != null && node.implements.length > 0) {
				const classToken = tokenStore.getFirstToken(node);
				const implementsToken = tokenStore.getTokenBefore(node.implements[0]);
				setOffset(implementsToken, 1, classToken);
				processNodeList(node.implements, implementsToken, null, 1);
			}
		},
		["TSTypeAliasDeclaration, TSCallSignatureDeclaration, TSConstructSignatureDeclaration, TSImportEqualsDeclaration,TSAbstractMethodDefinition, TSAbstractPropertyDefinition, TSAbstractAccessorProperty, TSEnumMember,TSPropertySignature, TSIndexSignature, TSMethodSignature,ClassProperty, TSAbstractClassProperty"](node) {
			processSemicolons(node);
		},
		"*[type=/^TS/]"(node) {
			if (!import_ts_utils.default.isTypeNode(node)) return;
			if (node.parent.type === "TSParenthesizedType") return;
			let leftToken = tokenStore.getTokenBefore(node);
			let rightToken = tokenStore.getTokenAfter(node);
			let firstToken = tokenStore.getFirstToken(node);
			while (leftToken && rightToken && (0, _eslint_community_eslint_utils.isOpeningParenToken)(leftToken) && (0, _eslint_community_eslint_utils.isClosingParenToken)(rightToken)) {
				setOffset(firstToken, 1, leftToken);
				setOffset(rightToken, 0, leftToken);
				firstToken = leftToken;
				leftToken = tokenStore.getTokenBefore(leftToken);
				rightToken = tokenStore.getTokenAfter(rightToken);
			}
		},
		/**
		* Process type annotation
		*
		* e.g.
		* ```
		* const foo: Type
		* //       ^^^^^^
		* type foo = () => string
		* //            ^^^^^^^^^
		* ```
		*/
		TSTypeAnnotation(node) {
			const [colonOrArrowToken, secondToken] = tokenStore.getFirstTokens(node, {
				count: 2,
				includeComments: false
			});
			const baseToken = tokenStore.getFirstToken(node.parent);
			setOffset([colonOrArrowToken, secondToken], 1, baseToken);
			const before = tokenStore.getTokenBefore(colonOrArrowToken);
			if (before && before.value === "?") setOffset(before, 1, baseToken);
		},
		/**
		* Process as expression or satisfies expression
		*
		* e.g.
		* ```
		* var foo = bar as boolean
		* //        ^^^^^^^^^^^^^^
		* ```
		*
		* e.g.
		* ```
		* var foo = bar satisfies Bar
		* //        ^^^^^^^^^^^^^^^^^
		* ```
		*
		*/
		"TSAsExpression, TSSatisfiesExpression"(node) {
			const expressionTokens = getFirstAndLastTokens(node.expression);
			setOffset([tokenStore.getTokenAfter(expressionTokens.lastToken), getFirstAndLastTokens(node.typeAnnotation).firstToken], 1, expressionTokens.firstToken);
		},
		/**
		* Process type reference and instantiation expression
		*
		* e.g.
		* ```
		* const foo: Type<P>
		* //         ^^^^^^^
		* ```
		*
		* e.g.
		* ```
		* const ErrorMap = Map<string, Error>;
		* //               ^^^^^^^^^^^^^^^^^^
		* ```
		*
		*/
		"TSTypeReference, TSInstantiationExpression"(node) {
			const typeArguments = "typeArguments" in node ? node.typeArguments : 			/** typescript-eslint v5 */ node.typeParameters;
			if (typeArguments) {
				const firstToken = tokenStore.getFirstToken(node);
				setOffset(tokenStore.getFirstToken(typeArguments), 1, firstToken);
			}
		},
		/**
		* Process type parameter instantiation and type parameter declaration
		*
		* e.g.
		* ```
		* const foo: Type<P>
		* //             ^^^
		* ```
		*
		* e.g.
		* ```
		* type Foo<T>
		* //      ^^^
		* ```
		*/
		"TSTypeParameterInstantiation, TSTypeParameterDeclaration"(node) {
			processNodeList(node.params, tokenStore.getFirstToken(node), tokenStore.getLastToken(node), 1);
		},
		/**
		* Process type alias declaration
		*
		* e.g.
		* ```
		* type Foo
		* ```
		*/
		TSTypeAliasDeclaration(node) {
			const typeToken = tokenStore.getFirstToken(node);
			const idToken = tokenStore.getFirstToken(node.id);
			setOffset(idToken, 1, typeToken);
			let eqToken;
			if (node.typeParameters) {
				setOffset(tokenStore.getFirstToken(node.typeParameters), 1, idToken);
				eqToken = tokenStore.getTokenAfter(node.typeParameters);
			} else eqToken = tokenStore.getTokenAfter(node.id);
			const initToken = tokenStore.getTokenAfter(eqToken);
			setOffset([eqToken, initToken], 1, idToken);
		},
		/**
		* Process constructor type or function type
		*
		* e.g.
		* ```
		* type Foo = new () => T
		* //         ^^^^^^^^^^^
		* type Foo = () => void
		* //         ^^^^^^^^^^
		* ```
		*/
		"TSConstructorType, TSFunctionType"(node) {
			const firstToken = tokenStore.getFirstToken(node);
			let currToken = firstToken;
			if (node.type === "TSConstructorType") {
				currToken = tokenStore.getTokenAfter(currToken);
				setOffset(currToken, 1, firstToken);
			}
			if (node.typeParameters) {
				currToken = tokenStore.getTokenAfter(node.typeParameters);
				setOffset(currToken, 1, firstToken);
			}
			const leftParenToken = currToken;
			const rightParenToken = tokenStore.getTokenAfter(node.params.at(-1) || leftParenToken, _eslint_community_eslint_utils.isClosingParenToken);
			processNodeList(node.params, leftParenToken, rightParenToken, 1);
			setOffset(tokenStore.getTokenAfter(rightParenToken), 1, leftParenToken);
		},
		/**
		* Process type literal
		*
		* e.g.
		* ```
		* const foo: { bar: string }
		* //         ^^^^^^^^^^^^^^^
		* ```
		*/
		TSTypeLiteral(node) {
			processNodeList(node.members, tokenStore.getFirstToken(node), tokenStore.getLastToken(node), 1);
		},
		/**
		* Process property signature
		*
		* e.g.
		* ```
		* const foo: { bar: string }
		* //           ^^^^^^^^^^^
		* ```
		*/
		TSPropertySignature(node) {
			const firstToken = tokenStore.getFirstToken(node);
			const keyTokens = getFirstAndLastTokens(node.key);
			let keyLast;
			if (node.computed) {
				const closeBracket = tokenStore.getTokenAfter(keyTokens.lastToken);
				processNodeList([node.key], firstToken, closeBracket, 1);
				keyLast = closeBracket;
			} else keyLast = keyTokens.lastToken;
			if (node.typeAnnotation) {
				const typeAnnotationToken = tokenStore.getFirstToken(node.typeAnnotation);
				setOffset([...tokenStore.getTokensBetween(keyLast, typeAnnotationToken), typeAnnotationToken], 1, firstToken);
			} else if (node.optional) setOffset(tokenStore.getLastToken(node), 1, firstToken);
		},
		/**
		* Process index signature
		*
		* e.g.
		* ```
		* const foo: { [bar: string]: string }
		* //           ^^^^^^^^^^^^^^^^^^^^^
		* ```
		*/
		TSIndexSignature(node) {
			const leftBracketToken = tokenStore.getFirstToken(node);
			const rightBracketToken = tokenStore.getTokenAfter(node.parameters.at(-1) || leftBracketToken, _eslint_community_eslint_utils.isClosingBracketToken);
			processNodeList(node.parameters, leftBracketToken, rightBracketToken, 1);
			const keyLast = rightBracketToken;
			if (node.typeAnnotation) {
				const typeAnnotationToken = tokenStore.getFirstToken(node.typeAnnotation);
				setOffset([...tokenStore.getTokensBetween(keyLast, typeAnnotationToken), typeAnnotationToken], 1, leftBracketToken);
			}
		},
		/**
		* Process array type
		*
		* e.g.
		* ```
		* const foo: Type[]
		* //         ^^^^^^
		* ```
		*/
		TSArrayType(node) {
			const firstToken = tokenStore.getFirstToken(node);
			setOffset(tokenStore.getLastTokens(node, {
				count: 2,
				includeComments: false
			}), 0, firstToken);
		},
		TSTupleType(node) {
			processNodeList(node.elementTypes, tokenStore.getFirstToken(node), tokenStore.getLastToken(node), 1);
		},
		TSQualifiedName(node) {
			const objectToken = tokenStore.getFirstToken(node);
			const dotToken = tokenStore.getTokenBefore(node.right);
			setOffset([dotToken, tokenStore.getTokenAfter(dotToken)], 1, objectToken);
		},
		TSIndexedAccessType(node) {
			const objectToken = tokenStore.getFirstToken(node);
			const leftBracketToken = tokenStore.getTokenBefore(node.indexType, _eslint_community_eslint_utils.isOpeningBracketToken);
			const rightBracketToken = tokenStore.getTokenAfter(node.indexType, _eslint_community_eslint_utils.isClosingBracketToken);
			setOffset(leftBracketToken, 1, objectToken);
			processNodeList([node.indexType], leftBracketToken, rightBracketToken, 1);
		},
		"TSUnionType, TSIntersectionType"(node) {
			const firstToken = tokenStore.getFirstToken(node);
			const prevToken = tokenStore.getTokenBefore(firstToken);
			const offset = prevToken == null || prevToken.loc.end.line === firstToken.loc.start.line || isBeginningOfElement(firstToken, node) ? 1 : 0;
			const typeTokensList = node.types.map(getFirstAndLastTokens);
			const typeTokens = typeTokensList.shift();
			if (!typeTokens) return;
			let lastToken;
			if (typeTokens.firstToken === firstToken) lastToken = typeTokens.lastToken;
			else {
				typeTokensList.unshift(typeTokens);
				lastToken = firstToken;
			}
			for (const typeTokens of typeTokensList) {
				setOffset(tokenStore.getTokensBetween(lastToken, typeTokens.firstToken), offset, firstToken);
				setOffset(typeTokens.firstToken, offset, firstToken);
			}
		},
		TSMappedType(node) {
			const leftBraceToken = tokenStore.getFirstToken(node);
			const leftBracketToken = tokenStore.getTokenBefore(node.key || node.typeParameter);
			const rightBracketToken = tokenStore.getTokenAfter(node.nameType || node.constraint || node.typeParameter);
			setOffset([...tokenStore.getTokensBetween(leftBraceToken, leftBracketToken), leftBracketToken], 1, leftBraceToken);
			processNodeList([node.key || node.typeParameter, node.nameType], leftBracketToken, rightBracketToken, 1);
			if (node.constraint) setOffset([...tokenStore.getTokensBetween(node.key, node.constraint), tokenStore.getFirstToken(node.constraint)], 1, tokenStore.getFirstToken(node.key));
			const rightBraceToken = tokenStore.getLastToken(node);
			if (node.typeAnnotation) {
				const typeAnnotationToken = tokenStore.getFirstToken(node.typeAnnotation);
				setOffset([...tokenStore.getTokensBetween(rightBracketToken, typeAnnotationToken), typeAnnotationToken], 1, leftBraceToken);
			} else setOffset([...tokenStore.getTokensBetween(rightBracketToken, rightBraceToken)], 1, leftBraceToken);
			setOffset(rightBraceToken, 0, leftBraceToken);
		},
		/**
		* Process type parameter
		*
		* e.g.
		* ```
		* type Foo<T, U extends T, V = U>
		* //       ^  ^^^^^^^^^^^  ^^^^^
		* type Foo = {[key in foo]: bar}
		* //           ^^^^^^^^^^
		* ```
		*/
		TSTypeParameter(node) {
			const [firstToken, ...afterTokens] = tokenStore.getTokens(node);
			for (const child of [node.constraint, node.default]) {
				if (!child) continue;
				const [, ...removeTokens] = tokenStore.getTokens(child);
				for (const token of removeTokens) {
					const i = afterTokens.indexOf(token);
					if (i !== -1) afterTokens.splice(i, 1);
				}
			}
			const secondToken = afterTokens.shift();
			if (!secondToken) return;
			setOffset(secondToken, 1, firstToken);
			if (secondToken.value === "extends") {
				let prevToken = null;
				let token = afterTokens.shift();
				while (token) {
					if (token.value === "=") break;
					setOffset(token, 1, secondToken);
					prevToken = token;
					token = afterTokens.shift();
				}
				while (token) {
					setOffset(token, 1, prevToken || secondToken);
					token = afterTokens.shift();
				}
			} else setOffset(afterTokens, 1, firstToken);
		},
		/**
		* Process conditional type
		*
		* e.g.
		* ```
		* type Foo = A extends B ? Bar : Baz
		* //         ^^^^^^^^^^^^^^^^^^^^^^^
		* ```
		*/
		TSConditionalType(node) {
			const checkTypeToken = tokenStore.getFirstToken(node);
			const extendsToken = tokenStore.getTokenAfter(node.checkType);
			const extendsTypeToken = tokenStore.getFirstToken(node.extendsType);
			setOffset(extendsToken, 1, checkTypeToken);
			setOffset(extendsTypeToken, 1, extendsToken);
			const questionToken = tokenStore.getTokenAfter(node.extendsType, _eslint_community_eslint_utils.isNotClosingParenToken);
			const consequentToken = tokenStore.getTokenAfter(questionToken);
			const colonToken = tokenStore.getTokenAfter(node.trueType, _eslint_community_eslint_utils.isNotClosingParenToken);
			const alternateToken = tokenStore.getTokenAfter(colonToken);
			let baseNode = node;
			let parent = baseNode.parent;
			while (parent && parent.type === "TSConditionalType" && parent.falseType === baseNode) {
				baseNode = parent;
				parent = baseNode.parent;
			}
			const baseToken = tokenStore.getFirstToken(baseNode);
			setOffset([questionToken, colonToken], 1, baseToken);
			setOffset(consequentToken, 1, questionToken);
			setOffset(alternateToken, 1, colonToken);
		},
		/**
		* Process interface declaration
		*
		* e.g.
		* ```
		* interface Foo { }
		* ```
		*/
		TSInterfaceDeclaration(node) {
			const interfaceToken = tokenStore.getFirstToken(node);
			setOffset(tokenStore.getFirstToken(node.id), 1, interfaceToken);
			if (node.typeParameters != null) setOffset(tokenStore.getFirstToken(node.typeParameters), 1, tokenStore.getFirstToken(node.id));
			if (node.extends != null && node.extends.length > 0) {
				const extendsToken = tokenStore.getTokenBefore(node.extends[0]);
				setOffset(extendsToken, 1, interfaceToken);
				processNodeList(node.extends, extendsToken, null, 1);
			}
			setOffset(tokenStore.getFirstToken(node.body), 0, interfaceToken);
		},
		/**
		* Process interface body
		*
		* e.g.
		* ```
		* interface Foo { }
		* //            ^^^
		* ```
		*/
		"TSInterfaceBody, TSModuleBlock"(node) {
			processNodeList(node.body, tokenStore.getFirstToken(node), tokenStore.getLastToken(node), 1);
		},
		/**
		* Process interface heritage and class implements
		*
		* e.g.
		* ```
		* interface Foo<T> extends Bar<T> { }
		* //                       ^^^^^^
		* class Foo<T> implements Bar<T> { }
		* //                      ^^^^^^
		* ```
		*/
		"TSClassImplements, TSInterfaceHeritage"(node) {
			const typeArguments = node.typeArguments || node.typeParameters;
			if (typeArguments) setOffset(tokenStore.getFirstToken(typeArguments), 1, tokenStore.getFirstToken(node));
		},
		/**
		* Process enum
		*
		* e.g.
		* ```
		* enum Foo { }
		* ```
		*/
		TSEnumDeclaration(node) {
			const firstToken = tokenStore.getFirstToken(node);
			const idTokens = getFirstAndLastTokens(node.id);
			setOffset(tokenStore.getTokensBetween(firstToken, idTokens.firstToken), 0, firstToken);
			setOffset(idTokens.firstToken, 1, firstToken);
			const leftBraceToken = tokenStore.getTokenAfter(idTokens.lastToken);
			const rightBraceToken = tokenStore.getLastToken(node);
			setOffset(leftBraceToken, 0, firstToken);
			if (node.body) return;
			processNodeList(node.members, leftBraceToken, rightBraceToken, 1);
		},
		TSEnumBody(node) {
			const leftBraceToken = tokenStore.getFirstToken(node);
			const rightBraceToken = tokenStore.getLastToken(node);
			processNodeList(node.members, leftBraceToken, rightBraceToken, 1);
		},
		TSModuleDeclaration(node) {
			const firstToken = tokenStore.getFirstToken(node);
			const idTokens = getFirstAndLastTokens(node.id);
			setOffset(tokenStore.getTokensBetween(firstToken, idTokens.firstToken), 0, firstToken);
			setOffset(idTokens.firstToken, 1, firstToken);
			if (node.body) {
				const bodyFirstToken = tokenStore.getFirstToken(node.body);
				setOffset(bodyFirstToken, (0, _eslint_community_eslint_utils.isOpeningBraceToken)(bodyFirstToken) ? 0 : 1, firstToken);
			}
		},
		TSMethodSignature(node) {
			const firstToken = tokenStore.getFirstToken(node);
			const keyTokens = getFirstAndLastTokens(node.key);
			let keyLast;
			if (node.computed) {
				const closeBracket = tokenStore.getTokenAfter(keyTokens.lastToken);
				processNodeList([node.key], firstToken, closeBracket, 1);
				keyLast = closeBracket;
			} else keyLast = keyTokens.lastToken;
			const leftParenToken = tokenStore.getTokenAfter(keyLast, _eslint_community_eslint_utils.isOpeningParenToken);
			setOffset([...tokenStore.getTokensBetween(keyLast, leftParenToken), leftParenToken], 1, firstToken);
			const rightParenToken = tokenStore.getTokenAfter(node.params.at(-1) || leftParenToken, _eslint_community_eslint_utils.isClosingParenToken);
			processNodeList(node.params, leftParenToken, rightParenToken, 1);
			if (node.returnType) {
				const typeAnnotationToken = tokenStore.getFirstToken(node.returnType);
				setOffset([...tokenStore.getTokensBetween(keyLast, typeAnnotationToken), typeAnnotationToken], 1, firstToken);
			}
		},
		/**
		* Process call signature declaration and construct signature declaration
		*
		* e.g.
		* ```
		* interface Foo {
		*   (): string;
		* //^^^^^^^^^^^
		*   <T> (e: E): R
		* //^^^^^^^^^^^^^
		* }
		* ```
		*
		* e.g.
		* ```
		* interface Foo {
		*   new ();
		* //^^^^^^^
		* }
		* interface A { new <T> (e: E): R }
		* //            ^^^^^^^^^^^^^^^^^
		* ```
		*/
		"TSCallSignatureDeclaration, TSConstructSignatureDeclaration"(node) {
			const firstToken = tokenStore.getFirstToken(node);
			let currToken = firstToken;
			if (node.type === "TSConstructSignatureDeclaration") {
				currToken = tokenStore.getTokenAfter(currToken);
				setOffset(currToken, 1, firstToken);
			}
			if (node.typeParameters) {
				currToken = tokenStore.getTokenAfter(node.typeParameters);
				setOffset(currToken, 1, firstToken);
			}
			const leftParenToken = currToken;
			const rightParenToken = tokenStore.getTokenAfter(node.params.at(-1) || leftParenToken, _eslint_community_eslint_utils.isClosingParenToken);
			processNodeList(node.params, leftParenToken, rightParenToken, 1);
			if (node.returnType) {
				const typeAnnotationToken = tokenStore.getFirstToken(node.returnType);
				setOffset([...tokenStore.getTokensBetween(rightParenToken, typeAnnotationToken), typeAnnotationToken], 1, firstToken);
			}
		},
		/**
		* Process declare function and empty body function
		*
		* e.g.
		* ```
		* declare function foo();
		* ```
		*
		* e.g.
		* ```
		* class Foo {
		*   abstract fn();
		* //           ^^^
		* }
		* ```
		*/
		"TSDeclareFunction, TSEmptyBodyFunctionExpression"(node) {
			const firstToken = tokenStore.getFirstToken(node);
			let leftParenToken, bodyBaseToken;
			if (firstToken.type === "Punctuator") {
				leftParenToken = firstToken;
				bodyBaseToken = tokenStore.getFirstToken(node.parent);
			} else {
				let nextToken = tokenStore.getTokenAfter(firstToken);
				let nextTokenOffset = 0;
				while (nextToken && !(0, _eslint_community_eslint_utils.isOpeningParenToken)(nextToken) && nextToken.value !== "<") {
					if (nextToken.value === "*" || node.id && nextToken.range[0] === node.id.range[0]) nextTokenOffset = 1;
					setOffset(nextToken, nextTokenOffset, firstToken);
					nextToken = tokenStore.getTokenAfter(nextToken);
				}
				leftParenToken = nextToken;
				bodyBaseToken = firstToken;
			}
			if (!(0, _eslint_community_eslint_utils.isOpeningParenToken)(leftParenToken) && node.typeParameters) leftParenToken = tokenStore.getTokenAfter(node.typeParameters);
			const rightParenToken = tokenStore.getTokenAfter(node.params.at(-1) || leftParenToken, _eslint_community_eslint_utils.isClosingParenToken);
			setOffset(leftParenToken, 1, bodyBaseToken);
			processNodeList(node.params, leftParenToken, rightParenToken, 1);
		},
		/**
		* Process type operator, type query and infer type
		*
		* e.g.
		* ```
		* type Foo = keyof Bar
		* //         ^^^^^^^^^
		* ```
		*
		* e.g.
		* ```
		* type T = typeof a
		* //       ^^^^^^^^
		* ```
		*
		* e.g.
		* ```
		* type Foo<T> = T extends Bar<infer U> ? U : T;
		* //                          ^^^^^^^
		* ```
		*/
		"TSTypeOperator, TSTypeQuery, TSInferType"(node) {
			const firstToken = tokenStore.getFirstToken(node);
			setOffset(tokenStore.getTokenAfter(firstToken), 1, firstToken);
		},
		/**
		* Process type predicate
		*
		* e.g.
		* ```
		* function foo(value): value is string;
		* //                   ^^^^^^^^^^^^^^^
		* ```
		*/
		TSTypePredicate(node) {
			const firstToken = tokenStore.getFirstToken(node);
			setOffset([tokenStore.getTokenAfter(node.parameterName, _eslint_community_eslint_utils.isNotClosingParenToken), node.typeAnnotation && getFirstAndLastTokens(node.typeAnnotation).firstToken], 1, getFirstAndLastTokens(firstToken).firstToken);
		},
		/**
		* Process abstract method definition, abstract class property, enum member and class property
		*
		* e.g.
		* ```
		* class Foo {
		*   abstract fn()
		* //^^^^^^^^^^^^^
		*   abstract x
		* //^^^^^^^^^^
		*   x
		* //^
		* }
		* ```
		*
		* e.g.
		* ```
		* enum Foo { Bar = x }
		* //         ^^^^^^^
		* ```
		*/
		["TSAbstractMethodDefinition, TSAbstractPropertyDefinition, TSAbstractAccessorProperty, TSEnumMember,ClassProperty, TSAbstractClassProperty"](node) {
			const { keyNode, valueNode } = node.type === "TSEnumMember" ? {
				keyNode: node.id,
				valueNode: node.initializer
			} : {
				keyNode: node.key,
				valueNode: node.value
			};
			const firstToken = tokenStore.getFirstToken(node);
			const keyTokens = getFirstAndLastTokens(keyNode);
			const prefixTokens = tokenStore.getTokensBetween(firstToken, keyTokens.firstToken);
			if (node.computed) prefixTokens.pop();
			setOffset(prefixTokens, 0, firstToken);
			let lastKeyToken;
			if (node.computed) {
				const leftBracketToken = tokenStore.getTokenBefore(keyTokens.firstToken);
				const rightBracketToken = lastKeyToken = tokenStore.getTokenAfter(keyTokens.lastToken);
				setOffset(leftBracketToken, 0, firstToken);
				processNodeList([keyNode], leftBracketToken, rightBracketToken, 1);
			} else {
				setOffset(keyTokens.firstToken, 0, firstToken);
				lastKeyToken = keyTokens.lastToken;
			}
			if (valueNode != null) {
				const initToken = tokenStore.getFirstToken(valueNode);
				setOffset([...tokenStore.getTokensBetween(lastKeyToken, initToken), initToken], 1, lastKeyToken);
			}
		},
		/**
		* Process optional type, non-null expression and JSDocNonNullableType
		*
		* e.g.
		* ```
		* type Foo = [number?]
		* //          ^^^^^^^
		* const a = v!
		* //        ^
		* type T = U!
		* //       ^^
		* ```
		*/
		"TSOptionalType, TSNonNullExpression, TSJSDocNonNullableType"(node) {
			setOffset(tokenStore.getLastToken(node), 1, tokenStore.getFirstToken(node));
		},
		TSTypeAssertion(node) {
			const firstToken = tokenStore.getFirstToken(node);
			const expressionToken = getFirstAndLastTokens(node.expression).firstToken;
			processNodeList([node.typeAnnotation], firstToken, tokenStore.getTokenBefore(expressionToken), 1);
			setOffset(expressionToken, 1, firstToken);
		},
		/**
		* Process import type
		*
		* e.g.
		* ```
		* const foo: import('foo').Bar<T>
		* //         ^^^^^^^^^^^^^^^^^^^^
		* ```
		*/
		TSImportType(node) {
			const firstToken = tokenStore.getFirstToken(node);
			const leftParenToken = tokenStore.getTokenAfter(firstToken, _eslint_community_eslint_utils.isOpeningParenToken);
			setOffset(leftParenToken, 1, firstToken);
			const args = [];
			if (node.source) args.push(node.source);
			else args.push(node.argument || node.parameter);
			if (node.options) args.push(node.options);
			processNodeList(args, leftParenToken, tokenStore.getTokenAfter(args.at(-1), _eslint_community_eslint_utils.isClosingParenToken), 1);
			if (node.qualifier) {
				const dotToken = tokenStore.getTokenBefore(node.qualifier);
				setOffset([dotToken, tokenStore.getTokenAfter(dotToken)], 1, firstToken);
			}
			const typeArguments = "typeArguments" in node ? node.typeArguments : 			/** typescript-eslint v5 */ node.typeParameters;
			if (typeArguments) setOffset(tokenStore.getFirstToken(typeArguments), 1, firstToken);
		},
		TSParameterProperty(node) {
			const firstToken = tokenStore.getFirstToken(node);
			const parameterToken = tokenStore.getFirstToken(node.parameter);
			setOffset([...tokenStore.getTokensBetween(firstToken, parameterToken), parameterToken], 1, firstToken);
		},
		/**
		* Process import equal
		*
		* e.g.
		* ```
		* import foo = require('foo')
		* ```
		*/
		TSImportEqualsDeclaration(node) {
			const importToken = tokenStore.getFirstToken(node);
			const idTokens = getFirstAndLastTokens(node.id);
			setOffset(idTokens.firstToken, 1, importToken);
			setOffset([tokenStore.getTokenAfter(idTokens.lastToken), tokenStore.getFirstToken(node.moduleReference)], 1, idTokens.lastToken);
		},
		/**
		* Process external module reference
		*
		* e.g.
		* ```
		* import foo = require('foo')
		* //           ^^^^^^^^^^^^^^
		* ```
		*/
		TSExternalModuleReference(node) {
			const requireToken = tokenStore.getFirstToken(node);
			const leftParenToken = tokenStore.getTokenAfter(requireToken, _eslint_community_eslint_utils.isOpeningParenToken);
			const rightParenToken = tokenStore.getLastToken(node);
			setOffset(leftParenToken, 1, requireToken);
			processNodeList([node.expression], leftParenToken, rightParenToken, 1);
		},
		/**
		* Process export assignment
		*
		* e.g.
		* ```
		* export = foo
		* ```
		*/
		TSExportAssignment(node) {
			const exportNode = tokenStore.getFirstToken(node);
			const exprTokens = getFirstAndLastTokens(node.expression);
			setOffset([tokenStore.getTokenBefore(exprTokens.firstToken), exprTokens.firstToken], 1, exportNode);
		},
		TSNamedTupleMember(node) {
			const labelToken = tokenStore.getFirstToken(node);
			const elementTokens = getFirstAndLastTokens(node.elementType);
			setOffset([...tokenStore.getTokensBetween(labelToken, elementTokens.firstToken), elementTokens.firstToken], 1, labelToken);
		},
		TSRestType(node) {
			const firstToken = tokenStore.getFirstToken(node);
			setOffset(tokenStore.getTokenAfter(firstToken), 1, firstToken);
		},
		TSNamespaceExportDeclaration(node) {
			const firstToken = tokenStore.getFirstToken(node);
			const idToken = tokenStore.getFirstToken(node.id);
			setOffset([...tokenStore.getTokensBetween(firstToken, idToken), idToken], 1, firstToken);
		},
		TSTemplateLiteralType(node) {
			const firstToken = tokenStore.getFirstToken(node);
			const quasiTokens = node.quasis.slice(1).map((n) => tokenStore.getFirstToken(n));
			const expressionToken = node.quasis.slice(0, -1).map((n) => tokenStore.getTokenAfter(n));
			setOffset(quasiTokens, 0, firstToken);
			setOffset(expressionToken, 1, firstToken);
		},
		Decorator(node) {
			const [atToken, secondToken] = tokenStore.getFirstTokens(node, {
				count: 2,
				includeComments: false
			});
			setOffset(secondToken, 0, atToken);
			const parent = node.parent;
			const { decorators, range } = parent;
			if (!decorators || decorators.length === 0) return;
			if (decorators[0] === node) if (range[0] === node.range[0]) setOffset(tokenStore.getTokenAfter(decorators.at(-1)), 0, atToken);
			else copyOffset(atToken, tokenStore.getFirstToken(parent.parent && (parent.parent.type === "ExportDefaultDeclaration" || parent.parent.type === "ExportNamedDeclaration") && node.range[0] < parent.parent.range[0] ? parent.parent : parent));
			else setOffset(atToken, 0, tokenStore.getFirstToken(decorators[0]));
		},
		AccessorProperty(node) {
			const keyNode = node.key;
			const valueNode = node.value;
			const firstToken = tokenStore.getFirstToken(node);
			const keyTokens = getFirstAndLastTokens(keyNode);
			const prefixTokens = tokenStore.getTokensBetween(firstToken, keyTokens.firstToken);
			if (node.computed) prefixTokens.pop();
			setOffset(prefixTokens, 0, firstToken);
			let lastKeyToken;
			if (node.computed) {
				const leftBracketToken = tokenStore.getTokenBefore(keyTokens.firstToken);
				const rightBracketToken = lastKeyToken = tokenStore.getTokenAfter(keyTokens.lastToken);
				setOffset(leftBracketToken, 0, firstToken);
				processNodeList([keyNode], leftBracketToken, rightBracketToken, 1);
			} else {
				setOffset(keyTokens.firstToken, 0, firstToken);
				lastKeyToken = keyTokens.lastToken;
			}
			if (valueNode != null) {
				const initToken = tokenStore.getFirstToken(valueNode);
				setOffset([...tokenStore.getTokensBetween(lastKeyToken, initToken), initToken], 1, lastKeyToken);
			}
			processSemicolons(node);
		},
		ImportAttribute(node) {
			const firstToken = tokenStore.getFirstToken(node);
			const keyTokens = getFirstAndLastTokens(node.key);
			setOffset(tokenStore.getTokensBetween(firstToken, keyTokens.firstToken), 0, firstToken);
			setOffset(keyTokens.firstToken, 0, firstToken);
			const initToken = tokenStore.getFirstToken(node.value);
			setOffset([...tokenStore.getTokensBetween(keyTokens.lastToken, initToken), initToken], 1, keyTokens.lastToken);
		},
		TSParenthesizedType(node) {
			processNodeList([node.typeAnnotation], tokenStore.getFirstToken(node), tokenStore.getLastToken(node), 1);
		},
		TSPrivateIdentifier() {},
		TSAnyKeyword() {},
		TSBigIntKeyword() {},
		TSBooleanKeyword() {},
		TSNeverKeyword() {},
		TSNullKeyword() {},
		TSNumberKeyword() {},
		TSObjectKeyword() {},
		TSStringKeyword() {},
		TSSymbolKeyword() {},
		TSUndefinedKeyword() {},
		TSUnknownKeyword() {},
		TSVoidKeyword() {},
		TSAbstractKeyword() {},
		TSAsyncKeyword() {},
		TSPrivateKeyword() {},
		TSProtectedKeyword() {},
		TSPublicKeyword() {},
		TSReadonlyKeyword() {},
		TSStaticKeyword() {},
		TSDeclareKeyword() {},
		TSExportKeyword() {},
		TSIntrinsicKeyword() {},
		TSThisType() {},
		TSLiteralType() {}
	};
}
//#endregion
exports.defineVisitor = defineVisitor;
F+Jsx3//#region lib/utils/indent-utils.ts
/**
* Check whether the given token is a wildcard.
*/
function isWildcard(token) {
	return token != null && token.type === "Punctuator" && token.value === "*";
}
/**
* Check whether the given token is an extends keyword.
*/
function isExtendsKeyword(token) {
	return token != null && token.type === "Keyword" && token.value === "extends";
}
/**
* Check whether the given token is a whitespace.
*/
function isNotWhitespace(token) {
	return token != null && token.type !== "HTMLWhitespace" && (token.type !== "JSXText" || !!token.value.trim());
}
/**
* Check whether the given token is a comment.
*/
function isComment(token) {
	return token != null && (token.type === "Block" || token.type === "Line" || token.type === "Shebang" || typeof token.type === "string" && token.type.endsWith("Comment"));
}
/**
* Check whether the given token is a comment.
*/
function isNotComment(token) {
	return token != null && token.type !== "Block" && token.type !== "Line" && token.type !== "Shebang" && !(typeof token.type === "string" && token.type.endsWith("Comment"));
}
/**
* Check whether the given node is not an empty text node.
*/
function isNotEmptyTextNode(node) {
	return !(node.type === "VText" && node.value.trim() === "");
}
/**
* Check whether the given token is a pipe operator.
*/
function isPipeOperator(token) {
	return token != null && token.type === "Punctuator" && token.value === "|";
}
/**
* Get the last element.
*/
function last(xs) {
	return xs.length === 0 ? void 0 : xs.at(-1);
}
//#endregion
exports.isComment = isComment;
exports.isExtendsKeyword = isExtendsKeyword;
exports.isNotComment = isNotComment;
exports.isNotEmptyTextNode = isNotEmptyTextNode;
exports.isNotWhitespace = isNotWhitespace;
exports.isPipeOperator = isPipeOperator;
exports.isWildcard = isWildcard;
exports.last = last;
Ge0x   "use strict";
const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_scope$1 = require("./scope.js");
const require_html_elements$1 = require("./html-elements.js");
const require_svg_elements$1 = require("./svg-elements.js");
const require_math_elements$1 = require("./math-elements.js");
const require_void_elements$1 = require("./void-elements.js");
const require_vue2_builtin_components$1 = require("./vue2-builtin-components.js");
const require_vue3_builtin_components$1 = require("./vue3-builtin-components.js");
const require_vue_builtin_elements$1 = require("./vue-builtin-elements.js");
const require_index = require("./ts-utils/index.js");
//#region lib/utils/index.js
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
var require_utils = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { getScope } = require_scope$1.default;
	/**
	* @typedef {import('eslint').Rule.RuleModule} RuleModule
	* @typedef {import('estree').Position} Position
	* @typedef {import('eslint').Rule.CodePath} CodePath
	* @typedef {import('eslint').Rule.CodePathSegment} CodePathSegment
	*/
	/**
	* @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentArrayProp} ComponentArrayProp
	* @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentObjectProp} ComponentObjectProp
	* @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentTypeProp} ComponentTypeProp
	* @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentInferTypeProp} ComponentInferTypeProp
	* @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentUnknownProp} ComponentUnknownProp
	* @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentProp} ComponentProp
	* @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentArrayEmit} ComponentArrayEmit
	* @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentObjectEmit} ComponentObjectEmit
	* @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentTypeEmit} ComponentTypeEmit
	* @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentInferTypeEmit} ComponentInferTypeEmit
	* @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentUnknownEmit} ComponentUnknownEmit
	* @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentEmit} ComponentEmit
	* @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentTypeSlot} ComponentTypeSlot
	* @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentInferTypeSlot} ComponentInferTypeSlot
	* @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentUnknownSlot} ComponentUnknownSlot
	* @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentSlot} ComponentSlot
	* @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentModelName} ComponentModelName
	* @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ComponentModel} ComponentModel
	*/
	/**
	* @typedef { {key: string | null, value: BlockStatement | null} } ComponentComputedProperty
	*/
	/**
	* @typedef { 'props' | 'asyncData' | 'data' | 'computed' | 'setup' | 'watch' | 'methods' | 'provide' | 'inject' | 'expose' } GroupName
	* @typedef { { type: 'array',  name: string, groupName: GroupName, node: Literal | TemplateLiteral } } ComponentArrayPropertyData
	* @typedef { { type: 'object', name: string, groupName: GroupName, node: Identifier | Literal | TemplateLiteral, property: Property } } ComponentObjectPropertyData
	* @typedef { ComponentArrayPropertyData | ComponentObjectPropertyData } ComponentPropertyData
	*/
	/**
	* @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').VueObjectType} VueObjectType
	* @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').VueObjectData} VueObjectData
	* @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').VueVisitor} VueVisitor
	* @typedef {import('../../typings/eslint-plugin-vue/util-types/utils').ScriptSetupVisitor} ScriptSetupVisitor
	*/
	const HTML_ELEMENT_NAMES = new Set(require_html_elements$1.default);
	const SVG_ELEMENT_NAMES = new Set(require_svg_elements$1.default);
	const MATH_ELEMENT_NAMES = new Set(require_math_elements$1.default);
	const VOID_ELEMENT_NAMES = new Set(require_void_elements$1.default);
	const VUE2_BUILTIN_COMPONENT_NAMES = new Set(require_vue2_builtin_components$1.default);
	const VUE3_BUILTIN_COMPONENT_NAMES = new Set(require_vue3_builtin_components$1.default);
	const VUE_BUILTIN_ELEMENT_NAMES = new Set(require_vue_builtin_elements$1.default);
	const BUILTIN_DIRECTIVE_NAMES = /* @__PURE__ */ new Set([
		"bind",
		"on",
		"text",
		"html",
		"show",
		"if",
		"else",
		"else-if",
		"for",
		"model",
		"slot",
		"pre",
		"cloak",
		"once",
		"memo",
		"is"
	]);
	const { createRequire } = require("node:module");
	const path = require("node:path");
	const { traverseNodes, getFallbackKeys, NS } = require("vue-eslint-parser").AST;
	const { findVariable, ReferenceTracker } = require("@eslint-community/eslint-utils");
	const { getComponentPropsFromTypeDefine, getComponentEmitsFromTypeDefine, getComponentSlotsFromTypeDefine, isExhaustiveSwitch, isTypeNode } = require_index.default;
	/**
	* @type { WeakMap<RuleContext, Token[]> }
	*/
	const componentComments = /* @__PURE__ */ new WeakMap();
	/** @type { Map<string, RuleModule> | null } */
	let coreRuleMap = null;
	/** @type { Map<string, RuleModule> } */
	const stylisticRuleMap = /* @__PURE__ */ new Map();
	/**
	* Get the core rule implementation from the rule name
	* @param {string} name
	* @returns {RuleModule | null}
	*/
	function getCoreRule(name) {
		const eslint = require("eslint");
		try {
			coreRuleMap ||= new eslint.Linter().getRules();
			return coreRuleMap.get(name) || null;
		} catch {}
		const { builtinRules } = require("eslint/use-at-your-own-risk");
		return builtinRules.get(name) || null;
	}
	/**
	* Get ESLint Stylistic rule implementation from the rule name
	* @param {string} name
	* @param {'@stylistic/eslint-plugin' | '@stylistic/eslint-plugin-ts' | '@stylistic/eslint-plugin-js'} [preferModule]
	* @returns {RuleModule | null}
	*/
	function getStylisticRule(name, preferModule) {
		if (!preferModule) {
			const cached = stylisticRuleMap.get(name);
			if (cached) return cached;
		}
		const stylisticPluginNames = [
			"@stylistic/eslint-plugin",
			"@stylistic/eslint-plugin-ts",
			"@stylistic/eslint-plugin-js"
		];
		if (preferModule) stylisticPluginNames.unshift(preferModule);
		for (const stylisticPluginName of stylisticPluginNames) try {
			const rule = createRequire(`${process.cwd()}/__placeholder__.js`)(stylisticPluginName)?.rules?.[name];
			if (!preferModule) stylisticRuleMap.set(name, rule);
			return rule;
		} catch {}
		return null;
	}
	/**
	* @template {object} T
	* @param {T} target
	* @param {Partial<T>[]} propsArray
	* @returns {T}
	*/
	function newProxy(target, ...propsArray) {
		return new Proxy({}, {
			get(_object, key) {
				for (const props of propsArray) if (key in props) return props[key];
				return target[key];
			},
			has(_object, key) {
				return key in target;
			},
			ownKeys(_object) {
				return Reflect.ownKeys(target);
			},
			getPrototypeOf(_object) {
				return Reflect.getPrototypeOf(target);
			}
		});
	}
	/**
	* Wrap the rule context object to override methods which access to tokens (such as getTokenAfter).
	* @param {RuleContext} context The rule context object.
	* @param {ParserServices.TokenStore} tokenStore The token store object for template.
	* @param {Object} options The option of this rule.
	* @param {boolean} [options.applyDocument] If `true`, apply check to document fragment.
	* @returns {RuleContext}
	*/
	function wrapContextToOverrideTokenMethods(context, tokenStore, options) {
		const eslintSourceCode = context.sourceCode;
		const rootNode = options.applyDocument ? eslintSourceCode.parserServices.getDocumentFragment && eslintSourceCode.parserServices.getDocumentFragment() : eslintSourceCode.ast.templateBody;
		/** @type {Token[] | null} */
		let tokensAndComments = null;
		function getTokensAndComments() {
			if (tokensAndComments) return tokensAndComments;
			tokensAndComments = rootNode ? tokenStore.getTokens(rootNode, { includeComments: true }) : [];
			return tokensAndComments;
		}
		/** @param {number} index */
		function getNodeByRangeIndex(index) {
			if (!rootNode) return eslintSourceCode.ast;
			/** @type {ASTNode} */
			let result = eslintSourceCode.ast;
			/** @type {ASTNode[]} */
			const skipNodes = [];
			let shouldBreak = false;
			traverseNodes(rootNode, {
				enterNode(node, parent) {
					if (shouldBreak) return;
					if (skipNodes[0] === parent) {
						skipNodes.unshift(node);
						return;
					}
					if (node.range[0] <= index && index < node.range[1]) result = node;
					else skipNodes.unshift(node);
				},
				leaveNode(node) {
					if (shouldBreak) return;
					if (result === node) shouldBreak = true;
					else if (skipNodes[0] === node) skipNodes.shift();
				}
			});
			return result;
		}
		const sourceCode = newProxy(eslintSourceCode, {
			get tokensAndComments() {
				return getTokensAndComments();
			},
			getNodeByRangeIndex,
			getDeclaredVariables
		}, tokenStore);
		/** @type {WeakMap<ASTNode, import('eslint').Scope.ScopeManager>} */
		const containerScopes = /* @__PURE__ */ new WeakMap();
		/**
		* @param {ASTNode} node
		* @returns {import('eslint').Scope.ScopeManager|null}
		*/
		function getContainerScope(node) {
			const exprContainer = getVExpressionContainer(node);
			if (!exprContainer) return null;
			const cache = containerScopes.get(exprContainer);
			if (cache) return cache;
			const programNode = eslintSourceCode.ast;
			const parserOptions = context.languageOptions?.parserOptions ?? context.parserOptions ?? {};
			const ecmaFeatures = parserOptions.ecmaFeatures || {};
			const ecmaVersion = context.languageOptions?.ecmaVersion ?? parserOptions.ecmaVersion ?? 2020;
			const sourceType = programNode.sourceType;
			try {
				const eslintScope = createRequire(require.resolve("eslint"))("eslint-scope");
				const scopeProgram = newProxy(programNode, { body: [newProxy(exprContainer, { type: "ExpressionStatement" })] });
				const scope = eslintScope.analyze(scopeProgram, {
					ignoreEval: true,
					nodejsScope: false,
					impliedStrict: ecmaFeatures.impliedStrict,
					ecmaVersion,
					sourceType,
					fallback: getFallbackKeys
				});
				containerScopes.set(exprContainer, scope);
				return scope;
			} catch {}
			return null;
		}
		return newProxy(context, {
			getSourceCode() {
				return sourceCode;
			},
			get sourceCode() {
				return sourceCode;
			},
			getDeclaredVariables
		});
		/**
		* @param {ESNode} node
		* @returns {Variable[]}
		*/
		function getDeclaredVariables(node) {
			return getContainerScope(node)?.getDeclaredVariables(node) ?? [];
		}
	}
	/**
	* Wrap the rule context object to override report method to skip the dynamic argument.
	* @param {RuleContext} context The rule context object.
	* @returns {RuleContext}
	*/
	function wrapContextToOverrideReportMethodToSkipDynamicArgument(context) {
		const sourceCode = context.sourceCode;
		const templateBody = sourceCode.ast.templateBody;
		if (!templateBody) return context;
		/** @type {Range[]} */
		const directiveKeyRanges = [];
		traverseNodes(templateBody, {
			enterNode(node, parent) {
				if (parent && parent.type === "VDirectiveKey" && node.type === "VExpressionContainer") directiveKeyRanges.push(node.range);
			},
			leaveNode() {}
		});
		return newProxy(context, { report(descriptor, ...args) {
			let range = null;
			if (descriptor.loc) {
				const startLoc = descriptor.loc.start || descriptor.loc;
				const endLoc = descriptor.loc.end || startLoc;
				range = [sourceCode.getIndexFromLoc(startLoc), sourceCode.getIndexFromLoc(endLoc)];
			} else if (descriptor.node) range = descriptor.node.range;
			if (range) {
				for (const directiveKeyRange of directiveKeyRanges) if (range[0] < directiveKeyRange[1] && directiveKeyRange[0] < range[1]) return;
			}
			context.report(descriptor, ...args);
		} });
	}
	/**
	* @callback WrapRuleCreate
	* @param {RuleContext} ruleContext
	* @param {WrapRuleCreateContext} wrapContext
	* @returns {TemplateListener}
	*
	* @typedef {object} WrapRuleCreateContext
	* @property {RuleListener} baseHandlers
	*/
	/**
	* @callback WrapRulePreprocess
	* @param {RuleContext} ruleContext
	* @param {WrapRulePreprocessContext} wrapContext
	* @returns {void}
	*
	* @typedef {object} WrapRulePreprocessContext
	* @property { (override: Partial<RuleContext>) => RuleContext } wrapContextToOverrideProperties Wrap the rule context object to override
	* @property { (visitor: TemplateListener) => void } defineVisitor Define template body visitor
	*/
	/**
	* @typedef {object} WrapRuleOptions
	* @property {string[]} [categories] The categories of this rule.
	* @property {boolean} [skipDynamicArguments] If `true`, skip validation within dynamic arguments.
	* @property {boolean} [skipDynamicArgumentsReport] If `true`, skip report within dynamic arguments.
	* @property {boolean} [applyDocument] If `true`, apply check to document fragment.
	* @property {boolean} [skipBaseHandlers] If `true`, skip base rule handlers.
	* @property {WrapRulePreprocess} [preprocess] Preprocess to calling create of base rule.
	* @property {WrapRuleCreate} [create] If define, extend base rule.
	*/
	/**
	* Wrap a given core rule to apply it to Vue.js template.
	* @param {string} coreRuleName The name of the core rule implementation to wrap.
	* @param {WrapRuleOptions} [options] The option of this rule.
	* @returns {RuleModule} The wrapped rule implementation.
	*/
	function wrapCoreRule(coreRuleName, options) {
		const coreRule = getCoreRule(coreRuleName);
		if (!coreRule) return {
			meta: {
				type: "problem",
				docs: { url: `https://eslint.vuejs.org/rules/${coreRuleName}.html` }
			},
			create(context) {
				return defineTemplateBodyVisitor(context, { "VElement[name='template'][parent.type='VDocumentFragment']"(node) {
					context.report({
						node,
						message: `Failed to extend ESLint core rule "${coreRuleName}". You may be able to use this rule by upgrading the version of ESLint. If you cannot upgrade it, turn off this rule.`
					});
				} });
			}
		};
		const rule = wrapRuleModule(coreRule, coreRuleName, options);
		const meta = {
			...rule.meta,
			docs: {
				...rule.meta.docs,
				extensionSource: {
					url: coreRule.meta.docs.url,
					name: "ESLint core"
				}
			}
		};
		return {
			...rule,
			meta
		};
	}
	/**
	* @typedef {object} RuleNames
	* @property {string} core The name of the core rule implementation to wrap.
	* @property {string} stylistic The name of ESLint Stylistic rule implementation to wrap.
	* @property {string} vue The name of the wrapped rule
	*/
	/**
	* Wrap a core rule or ESLint Stylistic rule to apply it to Vue.js template.
	* @param {RuleNames|string} ruleNames The names of the rule implementation to wrap.
	* @param {WrapRuleOptions} [options] The option of this rule.
	* @returns {RuleModule} The wrapped rule implementation.
	*/
	function wrapStylisticOrCoreRule(ruleNames, options) {
		const stylisticRuleName = typeof ruleNames === "string" ? ruleNames : ruleNames.stylistic;
		const coreRuleName = typeof ruleNames === "string" ? ruleNames : ruleNames.core;
		const vueRuleName = typeof ruleNames === "string" ? ruleNames : ruleNames.vue;
		const stylisticRule = getStylisticRule(stylisticRuleName);
		const baseRule = stylisticRule || getCoreRule(coreRuleName);
		if (!baseRule) return {
			meta: {
				type: "problem",
				docs: { url: `https://eslint.vuejs.org/rules/${vueRuleName}.html` }
			},
			create(context) {
				return defineTemplateBodyVisitor(context, { "VElement[name='template'][parent.type='VDocumentFragment']"(node) {
					context.report({
						node,
						message: `Failed to extend ESLint Stylistic rule "${stylisticRule}". You may be able to use this rule by installing ESLint Stylistic plugin (https://eslint.style/). If you cannot install it, turn off this rule.`
					});
				} });
			}
		};
		const rule = wrapRuleModule(baseRule, vueRuleName, options);
		const jsRule = getStylisticRule(stylisticRuleName, "@stylistic/eslint-plugin-js");
		const description = stylisticRule ? `${jsRule?.meta.docs.description} in \`<template>\`` : rule.meta.docs.description;
		const meta = {
			...rule.meta,
			docs: {
				...rule.meta.docs,
				description,
				extensionSource: {
					url: baseRule.meta.docs.url,
					name: stylisticRule ? "ESLint Stylistic" : "ESLint core"
				}
			},
			deprecated: void 0,
			replacedBy: void 0
		};
		return {
			...rule,
			meta
		};
	}
	/**
	* Wrap a given rule to apply it to Vue.js template.
	* @param {RuleModule} baseRule The rule implementation to wrap.
	* @param {string} ruleName The name of the wrapped rule.
	* @param {WrapRuleOptions} [options] The option of this rule.
	* @returns {RuleModule} The wrapped rule implementation.
	*/
	function wrapRuleModule(baseRule, ruleName, options) {
		let description = baseRule.meta.docs.description;
		if (description) description += " in `<template>`";
		const { categories, skipDynamicArguments, skipDynamicArgumentsReport, skipBaseHandlers, applyDocument, preprocess, create } = options || {};
		return {
			create(context) {
				const sourceCode = context.sourceCode;
				const tokenStore = sourceCode.parserServices.getTemplateBodyTokenStore && sourceCode.parserServices.getTemplateBodyTokenStore();
				if (tokenStore) context = wrapContextToOverrideTokenMethods(context, tokenStore, { applyDocument });
				if (skipDynamicArgumentsReport) context = wrapContextToOverrideReportMethodToSkipDynamicArgument(context);
				/** @type {TemplateListener} */
				const handlers = {};
				if (preprocess) preprocess(context, {
					wrapContextToOverrideProperties(override) {
						context = newProxy(context, override);
						return context;
					},
					defineVisitor(visitor) {
						compositingVisitors(handlers, visitor);
					}
				});
				const baseHandlers = baseRule.create(context);
				if (!skipBaseHandlers) compositingVisitors(handlers, baseHandlers);
				if (handlers.Program) {
					handlers[applyDocument ? "VDocumentFragment" : "VElement[parent.type!='VElement']"] = handlers.Program;
					delete handlers.Program;
				}
				if (handlers["Program:exit"]) {
					handlers[applyDocument ? "VDocumentFragment:exit" : "VElement[parent.type!='VElement']:exit"] = handlers["Program:exit"];
					delete handlers["Program:exit"];
				}
				if (skipDynamicArguments) {
					let isWithinDynamicArguments = false;
					for (const name of Object.keys(handlers)) {
						const original = handlers[name];
						/** @param {any[]} args */
						handlers[name] = (...args) => {
							if (isWithinDynamicArguments) return;
							original(...args);
						};
					}
					handlers["VDirectiveKey > VExpressionContainer"] = () => {
						isWithinDynamicArguments = true;
					};
					handlers["VDirectiveKey > VExpressionContainer:exit"] = () => {
						isWithinDynamicArguments = false;
					};
				}
				if (create) compositingVisitors(handlers, create(context, { baseHandlers }));
				if (applyDocument) return defineDocumentVisitor(context, handlers);
				return defineTemplateBodyVisitor(context, handlers);
			},
			meta: Object.assign({}, baseRule.meta, { docs: Object.assign({}, baseRule.meta.docs, {
				description,
				category: null,
				categories,
				url: `https://eslint.vuejs.org/rules/${ruleName}.html`
			}) })
		};
	}
	module.exports = {
		/**
		* Register the given visitor to parser services.
		* If the parser service of `vue-eslint-parser` was not found,
		* this generates a warning.
		*
		* @param {RuleContext} context The rule context to use parser services.
		* @param {TemplateListener} templateBodyVisitor The visitor to traverse the template body.
		* @param {RuleListener} [scriptVisitor] The visitor to traverse the script.
		* @param { { templateBodyTriggerSelector: "Program" | "Program:exit" } } [options] The options.
		* @returns {RuleListener} The merged visitor.
		*/
		defineTemplateBodyVisitor,
		/**
		* Register the given visitor to parser services.
		* If the parser service of `vue-eslint-parser` was not found,
		* this generates a warning.
		*
		* @param {RuleContext} context The rule context to use parser services.
		* @param {TemplateListener} documentVisitor The visitor to traverse the document.
		* @param { { triggerSelector: "Program" | "Program:exit" } } [options] The options.
		* @returns {RuleListener} The merged visitor.
		*/
		defineDocumentVisitor,
		/**
		* Wrap a given core rule to apply it to Vue.js template.
		* @type {typeof wrapCoreRule}
		*/
		wrapCoreRule,
		wrapStylisticOrCoreRule,
		getCoreRule,
		/**
		* Checks whether the given value is defined.
		* @template T
		* @param {T | null | undefined} v
		* @returns {v is T}
		*/
		isDef,
		/**
		* Flattens arrays, objects and iterable objects.
		* @template T
		* @param {T | Iterable<T> | null | undefined} v
		* @returns {T[]}
		*/
		flatten,
		/**
		* Get the previous sibling element of the given element.
		* @param {VElement} node The element node to get the previous sibling element.
		* @returns {VElement|null} The previous sibling element.
		*/
		prevSibling(node) {
			let prevElement = null;
			const siblings = node.parent && node.parent.children || [];
			for (const siblingNode of siblings) {
				if (siblingNode === node) return prevElement;
				if (siblingNode.type === "VElement") prevElement = siblingNode;
			}
			return null;
		},
		/**
		* Check whether the given directive attribute has their empty value (`=""`).
		* @param {VDirective} node The directive attribute node to check.
		* @param {RuleContext} context The rule context to use parser services.
		* @returns {boolean} `true` if the directive attribute has their empty value (`=""`).
		*/
		isEmptyValueDirective(node, context) {
			if (node.value == null) return false;
			if (node.value.expression != null) return false;
			let valueText = context.sourceCode.getText(node.value);
			if ((valueText[0] === "\"" || valueText[0] === "'") && valueText[0] === valueText.at(-1)) valueText = valueText.slice(1, -1);
			return !valueText;
		},
		/**
		* Check whether the given directive attribute has their empty expression value (e.g. `=" "`, `="/* &ast;/"`).
		* @param {VDirective} node The directive attribute node to check.
		* @param {RuleContext} context The rule context to use parser services.
		* @returns {boolean} `true` if the directive attribute has their empty expression value.
		*/
		isEmptyExpressionValueDirective(node, context) {
			if (node.value == null) return false;
			if (node.value.expression != null) return false;
			const sourceCode = context.sourceCode;
			const valueNode = node.value;
			const tokenStore = sourceCode.parserServices.getTemplateBodyTokenStore();
			let quote1 = null;
			let quote2 = null;
			for (const token of tokenStore.getTokens(node)) {
				if (token.range[1] <= valueNode.range[0]) continue;
				if (valueNode.range[1] <= token.range[0]) return true;
				if (!quote1 && token.type === "Punctuator" && (token.value === "\"" || token.value === "'")) {
					quote1 = token;
					continue;
				}
				if (!quote2 && quote1 && token.type === "Punctuator" && token.value === quote1.value) {
					quote2 = token;
					continue;
				}
				return false;
			}
			return true;
		},
		/**
		* Get the attribute which has the given name.
		* @param {VElement} node The start tag node to check.
		* @param {string} name The attribute name to check.
		* @param {string} [value] The attribute value to check.
		* @returns {VAttribute | null} The found attribute.
		*/
		getAttribute,
		/**
		* Check whether the given start tag has specific directive.
		* @param {VElement} node The start tag node to check.
		* @param {string} name The attribute name to check.
		* @param {string} [value] The attribute value to check.
		* @returns {boolean} `true` if the start tag has the attribute.
		*/
		hasAttribute,
		/**
		* Get the directive list which has the given name.
		* @param {VElement | VStartTag} node The start tag node to check.
		* @param {string} name The directive name to check.
		* @returns {VDirective[]} The array of `v-slot` directives.
		*/
		getDirectives,
		/**
		* Get the directive which has the given name.
		* @param {VElement} node The start tag node to check.
		* @param {string} name The directive name to check.
		* @param {string} [argument] The directive argument to check.
		* @returns {VDirective | null} The found directive.
		*/
		getDirective,
		/**
		* Check whether the given start tag has specific directive.
		* @param {VElement} node The start tag node to check.
		* @param {string} name The directive name to check.
		* @param {string} [argument] The directive argument to check.
		* @returns {boolean} `true` if the start tag has the directive.
		*/
		hasDirective,
		isVBindSameNameShorthand,
		/**
		* Returns the list of all registered components
		* @param {ObjectExpression} componentObject
		* @returns { { node: Property, name: string }[] } Array of ASTNodes
		*/
		getRegisteredComponents(componentObject) {
			const componentsNode = componentObject.properties.find(
				/**
				* @param {ESNode} p
				* @returns {p is (Property & { key: Identifier & {name: 'components'}, value: ObjectExpression })}
				*/
				(p) => p.type === "Property" && getStaticPropertyName(p) === "components" && p.value.type === "ObjectExpression"
			);
			if (!componentsNode) return [];
			return componentsNode.value.properties.filter(isProperty).map((node) => {
				const name = getStaticPropertyName(node);
				return name ? {
					node,
					name
				} : null;
			}).filter(isDef);
		},
		/**
		* Check whether the previous sibling element has `if` or `else-if` directive.
		* @param {VElement} node The element node to check.
		* @returns {boolean} `true` if the previous sibling element has `if` or `else-if` directive.
		*/
		prevElementHasIf(node) {
			const prev = this.prevSibling(node);
			return prev != null && prev.startTag.attributes.some((a) => a.directive && (a.key.name.name === "if" || a.key.name.name === "else-if"));
		},
		/**
		* Returns a generator with all child element v-if chains of the given element.
		* @param {VElement} node The element node to check.
		* @returns {IterableIterator<VElement[]>}
		*/
		*iterateChildElementsChains(node) {
			let isVIf = false;
			/** @type {VElement[]} */
			let elementChain = [];
			for (const childNode of node.children) if (childNode.type === "VElement") {
				let connected;
				if (hasDirective(childNode, "if")) {
					connected = false;
					isVIf = true;
				} else if (hasDirective(childNode, "else-if")) {
					connected = isVIf;
					isVIf = true;
				} else if (hasDirective(childNode, "else")) {
					connected = isVIf;
					isVIf = false;
				} else {
					connected = false;
					isVIf = false;
				}
				if (connected) elementChain.push(childNode);
				else {
					if (elementChain.length > 0) yield elementChain;
					elementChain = [childNode];
				}
			} else if (childNode.type !== "VText" || childNode.value.trim() !== "") isVIf = false;
			if (elementChain.length > 0) yield elementChain;
		},
		isStringLiteral,
		/**
		* Check whether the given node is a custom component or not.
		* @param {VElement} node The start tag node to check.
		* @param {boolean} [shouldIgnoreElementNamespaces=false] If `true`, ignore element namespaces.
		* @returns {boolean} `true` if the node is a custom component.
		*/
		isCustomComponent(node, shouldIgnoreElementNamespaces = false) {
			if (hasAttribute(node, "is") || hasDirective(node, "bind", "is") || hasDirective(node, "is")) return true;
			const isHtmlName = this.isHtmlWellKnownElementName(node.rawName);
			const isSvgName = this.isSvgWellKnownElementName(node.rawName);
			const isMathName = this.isMathWellKnownElementName(node.rawName);
			if (shouldIgnoreElementNamespaces) return !isHtmlName && !isSvgName && !isMathName;
			return this.isHtmlElementNode(node) && !isHtmlName || this.isSvgElementNode(node) && !isSvgName || this.isMathElementNode(node) && !isMathName;
		},
		/**
		* Check whether the given node is a HTML element or not.
		* @param {VElement} node The node to check.
		* @returns {boolean} `true` if the node is a HTML element.
		*/
		isHtmlElementNode(node) {
			return node.namespace === NS.HTML;
		},
		/**
		* Check whether the given node is a SVG element or not.
		* @param {VElement} node The node to check.
		* @returns {boolean} `true` if the name is a SVG element.
		*/
		isSvgElementNode(node) {
			return node.namespace === NS.SVG;
		},
		/**
		* Check whether the given name is a MathML element or not.
		* @param {VElement} node The node to check.
		* @returns {boolean} `true` if the node is a MathML element.
		*/
		isMathElementNode(node) {
			return node.namespace === NS.MathML;
		},
		VUE2_BUILTIN_COMPONENT_NAMES,
		VUE3_BUILTIN_COMPONENT_NAMES,
		/**
		* Check whether the given name is an well-known element or not.
		* @param {string} name The name to check.
		* @returns {boolean} `true` if the name is an well-known element name.
		*/
		isHtmlWellKnownElementName(name) {
			return HTML_ELEMENT_NAMES.has(name);
		},
		/**
		* Check whether the given name is an well-known SVG element or not.
		* @param {string} name The name to check.
		* @returns {boolean} `true` if the name is an well-known SVG element name.
		*/
		isSvgWellKnownElementName(name) {
			return SVG_ELEMENT_NAMES.has(name);
		},
		/**
		* Check whether the given name is a well-known MathML element or not.
		* @param {string} name The name to check.
		* @returns {boolean} `true` if the name is a well-known MathML element name.
		*/
		isMathWellKnownElementName(name) {
			return MATH_ELEMENT_NAMES.has(name);
		},
		/**
		* Check whether the given name is a void element name or not.
		* @param {string} name The name to check.
		* @returns {boolean} `true` if the name is a void element name.
		*/
		isHtmlVoidElementName(name) {
			return VOID_ELEMENT_NAMES.has(name);
		},
		/**
		* Check whether the given name is Vue builtin component name or not.
		* @param {string} name The name to check.
		* @returns {boolean} `true` if the name is a builtin component name
		*/
		isBuiltInComponentName(name) {
			return VUE3_BUILTIN_COMPONENT_NAMES.has(name) || VUE2_BUILTIN_COMPONENT_NAMES.has(name);
		},
		/**
		* Check whether the given name is Vue builtin element name or not.
		* @param {string} name The name to check.
		* @returns {boolean} `true` if the name is a builtin Vue element name
		*/
		isVueBuiltInElementName(name) {
			return VUE_BUILTIN_ELEMENT_NAMES.has(name.toLowerCase());
		},
		/**
		* Check whether the given name is Vue builtin directive name or not.
		* @param {string} name The name to check.
		* @returns {boolean} `true` if the name is a builtin Directive name
		*/
		isBuiltInDirectiveName(name) {
			return BUILTIN_DIRECTIVE_NAMES.has(name);
		},
		/**
		* Gets the property name of a given node.
		* @param {Property|AssignmentProperty|MethodDefinition|MemberExpression} node - The node to get.
		* @return {string|null} The property name if static. Otherwise, null.
		*/
		getStaticPropertyName,
		/**
		* Gets the string of a given node.
		* @param {Literal|TemplateLiteral} node - The node to get.
		* @return {string|null} The string if static. Otherwise, null.
		*/
		getStringLiteralValue,
		/**
		* Get all props by looking at all component's properties
		* @param {ObjectExpression} componentObject Object with component definition
		* @return {(ComponentArrayProp | ComponentObjectProp | ComponentUnknownProp)[]} Array of component props
		*/
		getComponentPropsFromOptions,
		/**
		* Get all emits by looking at all component's properties
		* @param {ObjectExpression} componentObject Object with component definition
		* @return {(ComponentArrayEmit | ComponentObjectEmit | ComponentUnknownEmit)[]} Array of component emits
		*/
		getComponentEmitsFromOptions,
		/**
		* Get all computed properties by looking at all component's properties
		* @param {ObjectExpression} componentObject Object with component definition
		* @return {ComponentComputedProperty[]} Array of computed properties in format: [{key: String, value: ASTNode}]
		*/
		getComputedProperties(componentObject) {
			const computedPropertiesNode = componentObject.properties.find(
				/**
				* @param {ESNode} p
				* @returns {p is (Property & { key: Identifier & {name: 'computed'}, value: ObjectExpression })}
				*/
				(p) => p.type === "Property" && getStaticPropertyName(p) === "computed" && p.value.type === "ObjectExpression"
			);
			if (!computedPropertiesNode) return [];
			return computedPropertiesNode.value.properties.filter(isProperty).map((cp) => {
				const key = getStaticPropertyName(cp);
				/** @type {Expression} */
				const propValue = skipTSAsExpression(cp.value);
				/** @type {BlockStatement | null} */
				let value = null;
				if (propValue.type === "FunctionExpression") value = propValue.body;
				else if (propValue.type === "ObjectExpression") {
					const get = findProperty(propValue, "get", (p) => p.value.type === "FunctionExpression");
					value = get ? get.value.body : null;
				}
				return {
					key,
					value
				};
			});
		},
		/**
		* Get getter body from computed function
		* @param {CallExpression} callExpression call of computed function
		* @return {FunctionExpression | ArrowFunctionExpression | null} getter function
		*/
		getGetterBodyFromComputedFunction(callExpression) {
			if (callExpression.arguments.length === 0) return null;
			const arg = callExpression.arguments[0];
			if (arg.type === "FunctionExpression" || arg.type === "ArrowFunctionExpression") return arg;
			if (arg.type === "ObjectExpression") {
				const getProperty = findProperty(arg, "get", (p) => p.value.type === "FunctionExpression" || p.value.type === "ArrowFunctionExpression");
				return getProperty ? getProperty.value : null;
			}
			return null;
		},
		isTypeScriptFile,
		isVueFile,
		/**
		* Checks whether the current file is uses `<script setup>`
		* @param {RuleContext} context The ESLint rule context object.
		*/
		isScriptSetup,
		/**
		* Gets the element of `<script setup>`
		* @param {RuleContext} context The ESLint rule context object.
		* @returns {VElement | null} the element of `<script setup>`
		*/
		getScriptSetupElement,
		/**
		* Check if current file is a Vue instance or component and call callback
		* @param {RuleContext} context The ESLint rule context object.
		* @param { (node: ObjectExpression, type: VueObjectType) => void } cb Callback function
		*/
		executeOnVue(context, cb) {
			return compositingVisitors(this.executeOnVueComponent(context, cb), this.executeOnVueInstance(context, cb));
		},
		/**
		* Define handlers to traverse the Vue Objects.
		* Some special events are available to visitor.
		*
		* - `onVueObjectEnter` ... Event when Vue Object is found.
		* - `onVueObjectExit` ... Event when Vue Object visit ends.
		* - `onSetupFunctionEnter` ... Event when setup function found.
		* - `onRenderFunctionEnter` ... Event when render function found.
		*
		* @param {RuleContext} context The ESLint rule context object.
		* @param {VueVisitor} visitor The visitor to traverse the Vue Objects.
		*/
		defineVueVisitor(context, visitor) {
			/** @type {VueObjectData | null} */
			let vueStack = null;
			/**
			* @param {string} key
			* @param {ESNode} node
			*/
			function callVisitor(key, node) {
				if (visitor[key] && vueStack) visitor[key](node, vueStack);
			}
			/** @type {NodeListener} */
			const vueVisitor = {};
			for (const key in visitor) vueVisitor[key] = (node) => callVisitor(key, node);
			/**
			* @param {ObjectExpression} node
			*/
			vueVisitor.ObjectExpression = (node) => {
				const type = getVueObjectType(context, node);
				if (type) {
					vueStack = {
						node,
						type,
						parent: vueStack,
						get functional() {
							const functional = node.properties.find(
								/**
								* @param {Property | SpreadElement} p
								* @returns {p is Property}
								*/
								(p) => p.type === "Property" && getStaticPropertyName(p) === "functional"
							);
							if (!functional) return false;
							return functional.value.type !== "Literal" || functional.value.value !== false;
						}
					};
					callVisitor("onVueObjectEnter", node);
				}
				callVisitor("ObjectExpression", node);
			};
			vueVisitor["ObjectExpression:exit"] = (node) => {
				callVisitor("ObjectExpression:exit", node);
				if (vueStack && vueStack.node === node) {
					callVisitor("onVueObjectExit", node);
					vueStack = vueStack.parent;
				}
			};
			if (visitor.onSetupFunctionEnter || visitor.onSetupFunctionExit || visitor.onRenderFunctionEnter) {
				const setups = /* @__PURE__ */ new Set();
				/** @param { (FunctionExpression | ArrowFunctionExpression) & { parent: Property } } node */
				vueVisitor["Property[value.type=/^(Arrow)?FunctionExpression$/] > :function"] = (node) => {
					/** @type {Property} */
					const prop = node.parent;
					if (vueStack && prop.parent === vueStack.node && prop.value === node) {
						const name = getStaticPropertyName(prop);
						if (name === "setup") {
							callVisitor("onSetupFunctionEnter", node);
							setups.add(node);
						} else if (name === "render") callVisitor("onRenderFunctionEnter", node);
					}
					callVisitor("Property[value.type=/^(Arrow)?FunctionExpression$/] > :function", node);
				};
				if (visitor.onSetupFunctionExit)
 /** @param { (FunctionExpression | ArrowFunctionExpression) & { parent: Property } } node */
				vueVisitor["Property[value.type=/^(Arrow)?FunctionExpression$/] > :function:exit"] = (node) => {
					if (!setups.has(node)) return;
					callVisitor("onSetupFunctionExit", node);
					setups.delete(node);
				};
			}
			return vueVisitor;
		},
		/**
		* Define handlers to traverse the AST nodes in `<script setup>`.
		* Some special events are available to visitor.
		*
		* - `onDefinePropsEnter` ... Event when defineProps is found.
		* - `onDefinePropsExit` ... Event when defineProps visit ends.
		* - `onDefineEmitsEnter` ... Event when defineEmits is found.
		* - `onDefineEmitsExit` ... Event when defineEmits visit ends.
		* - `onDefineOptionsEnter` ... Event when defineOptions is found.
		* - `onDefineOptionsExit` ... Event when defineOptions visit ends.
		* - `onDefineSlotsEnter` ... Event when defineSlots is found.
		* - `onDefineSlotsExit` ... Event when defineSlots visit ends.
		* - `onDefineExposeEnter` ... Event when defineExpose is found.
		* - `onDefineExposeExit` ... Event when defineExpose visit ends.
		* - `onDefineModelEnter` ... Event when defineModel is found.
		* - `onDefineModelExit` ... Event when defineModel visit ends.
		*
		* @param {RuleContext} context The ESLint rule context object.
		* @param {ScriptSetupVisitor} visitor The visitor to traverse the AST nodes.
		*/
		defineScriptSetupVisitor(context, visitor) {
			const scriptSetup = getScriptSetupElement(context);
			if (scriptSetup == null) return {};
			const scriptSetupRange = scriptSetup.range;
			/**
			* @param {ESNode} node
			*/
			function isInScriptSetup(node) {
				return scriptSetupRange[0] <= node.range[0] && node.range[1] <= scriptSetupRange[1];
			}
			/**
			* @param {string} key
			* @param {ESNode} node
			* @param {any[]} args
			*/
			function callVisitor(key, node, ...args) {
				if (visitor[key] && (node.type === "Program" || isInScriptSetup(node))) visitor[key](node, ...args);
			}
			/** @type {NodeListener} */
			const scriptSetupVisitor = {};
			for (const key in visitor) scriptSetupVisitor[key] = (node) => callVisitor(key, node);
			class MacroListener {
				/**
				* @param {string} name
				* @param {string} enterName
				* @param {string} exitName
				* @param {(candidateMacro: Expression | null, node: CallExpression) => boolean} isMacroNode
				* @param {(context: RuleContext, node: CallExpression) => unknown} buildParam
				*/
				constructor(name, enterName, exitName, isMacroNode, buildParam) {
					this.name = name;
					this.enterName = enterName;
					this.exitName = exitName;
					this.isMacroNode = isMacroNode;
					this.buildParam = buildParam;
					this.hasListener = Boolean(visitor[this.enterName] || visitor[this.exitName]);
					this.paramsMap = /* @__PURE__ */ new Map();
				}
			}
			const macroListenerList = [
				new MacroListener("defineProps", "onDefinePropsEnter", "onDefinePropsExit", (candidateMacro, node) => candidateMacro === node || candidateMacro === getWithDefaults(node), getComponentPropsFromDefineProps),
				new MacroListener("defineEmits", "onDefineEmitsEnter", "onDefineEmitsExit", (candidateMacro, node) => candidateMacro === node, getComponentEmitsFromDefineEmits),
				new MacroListener("defineOptions", "onDefineOptionsEnter", "onDefineOptionsExit", (candidateMacro, node) => candidateMacro === node, () => void 0),
				new MacroListener("defineSlots", "onDefineSlotsEnter", "onDefineSlotsExit", (candidateMacro, node) => candidateMacro === node, getComponentSlotsFromDefineSlots),
				new MacroListener("defineExpose", "onDefineExposeEnter", "onDefineExposeExit", (candidateMacro, node) => candidateMacro === node, () => void 0),
				new MacroListener("defineModel", "onDefineModelEnter", "onDefineModelExit", (candidateMacro, node) => candidateMacro === node, getComponentModelFromDefineModel)
			].filter((m) => m.hasListener);
			if (macroListenerList.length > 0) {
				/** @type {Expression | null} */
				let candidateMacro = null;
				/** @param {VariableDeclarator|ExpressionStatement} node */
				scriptSetupVisitor["Program > VariableDeclaration > VariableDeclarator, Program > ExpressionStatement"] = (node) => {
					if (!candidateMacro) candidateMacro = node.type === "VariableDeclarator" ? node.init : node.expression;
				};
				/** @param {VariableDeclarator|ExpressionStatement} node */
				scriptSetupVisitor["Program > VariableDeclaration > VariableDeclarator, Program > ExpressionStatement:exit"] = (node) => {
					if (candidateMacro === (node.type === "VariableDeclarator" ? node.init : node.expression)) candidateMacro = null;
				};
				/**
				* @param {CallExpression} node
				*/
				scriptSetupVisitor.CallExpression = (node) => {
					if (candidateMacro && isInScriptSetup(node) && node.callee.type === "Identifier") for (const macroListener of macroListenerList) {
						if (node.callee.name !== macroListener.name || !macroListener.isMacroNode(candidateMacro, node)) continue;
						const param = macroListener.buildParam(context, node);
						callVisitor(macroListener.enterName, node, param);
						macroListener.paramsMap.set(node, param);
						break;
					}
					callVisitor("CallExpression", node);
				};
				scriptSetupVisitor["CallExpression:exit"] = (node) => {
					callVisitor("CallExpression:exit", node);
					for (const macroListener of macroListenerList) {
						if (!macroListener.paramsMap.has(node)) continue;
						callVisitor(macroListener.exitName, node, macroListener.paramsMap.get(node));
						macroListener.paramsMap.delete(node);
					}
				};
			}
			return scriptSetupVisitor;
		},
		/**
		* Checks whether given defineProps call node has withDefaults.
		* @param {CallExpression} node The node of defineProps
		* @returns {node is CallExpression & { parent: CallExpression }}
		*/
		hasWithDefaults,
		/**
		* Gets a map of the expressions defined in withDefaults.
		* @param {CallExpression} node The node of defineProps
		* @returns { { [key: string]: Expression | undefined } }
		*/
		getWithDefaultsPropExpressions(node) {
			const map = getWithDefaultsProps(node);
			/** @type {Record<string, Expression | undefined>} */
			const result = {};
			for (const [key, prop] of Object.entries(map)) result[key] = prop && prop.value;
			return result;
		},
		/**
		* Gets a map of the property nodes defined in withDefaults.
		* @param {CallExpression} node The node of defineProps
		* @returns { { [key: string]: Property | undefined } }
		*/
		getWithDefaultsProps,
		/**
		* Gets the default definition nodes for defineProp
		* using the props destructure with assignment pattern.
		* @param {CallExpression} node The node of defineProps
		* @returns { Record<string, {prop: AssignmentProperty , expression: Expression} | undefined> }
		*/
		getDefaultPropExpressionsForPropsDestructure,
		getLeftOfDefineProps,
		/**
		* Checks whether the given defineProps node is using Props Destructure.
		* @param {CallExpression} node The node of defineProps
		* @returns {boolean}
		*/
		isUsingPropsDestructure(node) {
			return getLeftOfDefineProps(node)?.type === "ObjectPattern";
		},
		/**
		* Gets the props destructure property nodes for defineProp.
		* @param {CallExpression} node The node of defineProps
		* @returns { Record<string, AssignmentProperty | undefined> }
		*/
		getPropsDestructure,
		getVueObjectType,
		getVueComponentDefinitionType,
		/**
		* Checks whether the given object is an SFC definition.
		* @param {RuleContext} context The ESLint rule context object.
		* @param {ObjectExpression} node Node to check
		* @returns { boolean } `true`, the given object is an SFC definition.
		*/
		isSFCObject,
		compositingVisitors,
		/**
		* Check if current file is a Vue instance (new Vue) and call callback
		* @param {RuleContext} context The ESLint rule context object.
		* @param { (node: ObjectExpression, type: VueObjectType) => void } cb Callback function
		*/
		executeOnVueInstance(context, cb) {
			return { 
			/** @param {ObjectExpression} node */
"ObjectExpression:exit"(node) {
				const type = getVueObjectType(context, node);
				if (!type || type !== "instance") return;
				cb(node, type);
			} };
		},
		/**
		* Check if current file is a Vue component and call callback
		* @param {RuleContext} context The ESLint rule context object.
		* @param { (node: ObjectExpression, type: VueObjectType) => void } cb Callback function
		*/
		executeOnVueComponent(context, cb) {
			return { 
			/** @param {ObjectExpression} node */
"ObjectExpression:exit"(node) {
				const type = getVueObjectType(context, node);
				if (!type || type !== "mark" && type !== "export" && type !== "definition") return;
				cb(node, type);
			} };
		},
		/**
		* Check call `Vue.component` and call callback.
		* @param {RuleContext} _context The ESLint rule context object.
		* @param { (node: CallExpression) => void } cb Callback function
		*/
		executeOnCallVueComponent(_context, cb) {
			return { 
			/** @param {Identifier & { parent: MemberExpression & { parent: CallExpression } } } node */
"CallExpression > MemberExpression > Identifier[name='component']": (node) => {
				const callExpr = node.parent.parent;
				const callee = callExpr.callee;
				if (callee.type === "MemberExpression") {
					if (skipTSAsExpression(callee.object).type === "Identifier" && callee.property === node && callExpr.arguments.length > 0) cb(callExpr);
				}
			} };
		},
		/**
		* Return generator with all properties
		* @param {ObjectExpression} node Node to check
		* @param {Set<GroupName>} groups Name of parent group
		* @returns {IterableIterator<ComponentPropertyData>}
		*/
		*iterateProperties(node, groups) {
			for (const item of node.properties) {
				if (item.type !== "Property") continue;
				const name = getStaticPropertyName(item);
				if (!name || !groups.has(name)) continue;
				yield* this.iteratePropertyValue(item.value, name);
			}
		},
		/**
		* Return generator with all properties defined by the given property value.
		* @param {Expression} value Property value node to check
		* @param {GroupName} groupName Name of parent group
		* @returns {IterableIterator<ComponentPropertyData>}
		*/
		*iteratePropertyValue(value, groupName) {
			switch (value.type) {
				case "ArrayExpression":
					yield* this.iterateArrayExpression(value, groupName);
					break;
				case "ObjectExpression":
					yield* this.iterateObjectExpression(value, groupName);
					break;
				case "FunctionExpression":
					yield* this.iterateFunctionExpression(value, groupName);
					break;
				case "ArrowFunctionExpression":
					yield* this.iterateArrowFunctionExpression(value, groupName);
					break;
			}
		},
		/**
		* Return generator with all elements inside ArrayExpression
		* @param {ArrayExpression} node Node to check
		* @param {GroupName} groupName Name of parent group
		* @returns {IterableIterator<ComponentArrayPropertyData>}
		*/
		*iterateArrayExpression(node, groupName) {
			for (const item of node.elements) {
				if (!item || item.type !== "Literal" && item.type !== "TemplateLiteral") continue;
				const name = getStringLiteralValue(item);
				if (name) yield {
					type: "array",
					name,
					groupName,
					node: item
				};
			}
		},
		/**
		* Return generator with all elements inside ObjectExpression
		* @param {ObjectExpression} node Node to check
		* @param {GroupName} groupName Name of parent group
		* @returns {IterableIterator<ComponentObjectPropertyData>}
		*/
		*iterateObjectExpression(node, groupName) {
			/** @type {Set<Property> | undefined} */
			let usedGetter;
			for (const item of node.properties) {
				if (item.type !== "Property") continue;
				const key = item.key;
				if (key.type === "Identifier" || key.type === "Literal" || key.type === "TemplateLiteral") {
					const name = getStaticPropertyName(item);
					if (name) {
						if (item.kind === "set" && node.properties.some((item2) => {
							if (item2.type === "Property" && item2.kind === "get") {
								if (!usedGetter) usedGetter = /* @__PURE__ */ new Set();
								if (usedGetter.has(item2)) return false;
								if (getStaticPropertyName(item2) === name) {
									usedGetter.add(item2);
									return true;
								}
							}
							return false;
						})) continue;
						yield {
							type: "object",
							name,
							groupName,
							node: key,
							property: item
						};
					}
				}
			}
		},
		/**
		* Return generator with all elements inside FunctionExpression
		* @param {FunctionExpression} node Node to check
		* @param {GroupName} groupName Name of parent group
		* @returns {IterableIterator<ComponentObjectPropertyData>}
		*/
		*iterateFunctionExpression(node, groupName) {
			if (node.body.type === "BlockStatement") {
				for (const item of node.body.body) if (item.type === "ReturnStatement" && item.argument && item.argument.type === "ObjectExpression") yield* this.iterateObjectExpression(item.argument, groupName);
			}
		},
		/**
		* Return generator with all elements inside ArrowFunctionExpression
		* @param {ArrowFunctionExpression} node Node to check
		* @param {GroupName} groupName Name of parent group
		* @returns {IterableIterator<ComponentObjectPropertyData>}
		*/
		*iterateArrowFunctionExpression(node, groupName) {
			const body = node.body;
			if (body.type === "BlockStatement") {
				for (const item of body.body) if (item.type === "ReturnStatement" && item.argument && item.argument.type === "ObjectExpression") yield* this.iterateObjectExpression(item.argument, groupName);
			} else if (body.type === "ObjectExpression") yield* this.iterateObjectExpression(body, groupName);
		},
		/**
		* Find all functions which do not always return values
		* @param {RuleContext} context The ESLint rule context object.
		* @param {boolean} treatUndefinedAsUnspecified
		* @param { (node: ArrowFunctionExpression | FunctionExpression | FunctionDeclaration) => void } cb Callback function
		* @returns {RuleListener}
		*/
		executeOnFunctionsWithoutReturn(context, treatUndefinedAsUnspecified, cb) {
			/**
			* @typedef {object} FuncInfo
			* @property {FuncInfo | null} funcInfo
			* @property {CodePath} codePath
			* @property {boolean} hasReturn
			* @property {boolean} hasReturnValue
			* @property {ArrowFunctionExpression | FunctionExpression | FunctionDeclaration} node
			* @property {CodePathSegment[]} currentSegments
			*/
			/** @type {FuncInfo | null} */
			let funcInfo = null;
			/** @type {WeakSet<CodePathSegment>} */
			const spuriousSegments = /* @__PURE__ */ new WeakSet();
			/** @type {WeakSet<CodePathSegment>} */
			const caseBodySegments = /* @__PURE__ */ new WeakSet();
			let caseBodyDepth = 0;
			/**
			* Treat spurious segments the same as unreachable.
			* @param {CodePathSegment} segment
			*/
			function isEffectivelyUnreachable(segment) {
				return !segment.reachable || spuriousSegments.has(segment);
			}
			function isValidReturn() {
				if (!funcInfo) return true;
				if (funcInfo.currentSegments.some((segment) => !isEffectivelyUnreachable(segment))) return false;
				return !treatUndefinedAsUnspecified || funcInfo.hasReturnValue;
			}
			return {
				/**
				* @param {CodePath} codePath
				* @param {ESNode} node
				*/
				onCodePathStart(codePath, node) {
					if (node.type === "ArrowFunctionExpression" || node.type === "FunctionExpression" || node.type === "FunctionDeclaration") funcInfo = {
						codePath,
						currentSegments: [],
						funcInfo,
						hasReturn: false,
						hasReturnValue: false,
						node
					};
				},
				/** @param {CodePathSegment} segment */
				onCodePathSegmentStart(segment) {
					funcInfo?.currentSegments.push(segment);
					if (segment.prevSegments.length > 0 && segment.prevSegments.every(isEffectivelyUnreachable)) spuriousSegments.add(segment);
					if (caseBodyDepth > 0) caseBodySegments.add(segment);
				},
				onCodePathSegmentEnd() {
					funcInfo?.currentSegments.pop();
				},
				onCodePathEnd() {
					funcInfo &&= funcInfo.funcInfo;
				},
				/** @param {ReturnStatement} node */
				ReturnStatement(node) {
					if (!funcInfo) return;
					funcInfo.hasReturn = true;
					funcInfo.hasReturnValue = Boolean(node.argument);
				},
				SwitchCase() {
					caseBodyDepth++;
				},
				"SwitchCase:exit"() {
					caseBodyDepth--;
				},
				/** @param {SwitchStatement} node */
				"SwitchStatement:exit"(node) {
					if (!funcInfo) return;
					if (node.cases.some((switchCase) => switchCase.test === null)) return;
					if (!isExhaustiveSwitch(context, node)) return;
					if (funcInfo.currentSegments.some((post) => post.prevSegments.some((prev) => !isEffectivelyUnreachable(prev) && caseBodySegments.has(prev)))) return;
					for (const segment of funcInfo.currentSegments) spuriousSegments.add(segment);
				},
				/** @param {ArrowFunctionExpression} node */
				"ArrowFunctionExpression:exit"(node) {
					if (funcInfo && !isValidReturn() && !node.expression) cb(funcInfo.node);
				},
				"FunctionExpression:exit"() {
					if (funcInfo && !isValidReturn()) cb(funcInfo.node);
				}
			};
		},
		/**
		* Check whether the component is declared in a single line or not.
		* @param {ASTNode} node
		* @returns {boolean}
		*/
		isSingleLine(node) {
			return node.loc.start.line === node.loc.end.line;
		},
		/**
		* Check whether the templateBody of the program has invalid EOF or not.
		* @param {Program} node The program node to check.
		* @returns {boolean} `true` if it has invalid EOF.
		*/
		hasInvalidEOF(node) {
			const body = node.templateBody;
			if (body == null || body.errors == null) return false;
			return body.errors.some((error) => typeof error.code === "string" && error.code.startsWith("eof-"));
		},
		/**
		* Get the chaining nodes of MemberExpression.
		*
		* @param  {ESNode} node The node to parse
		* @return {[ESNode, ...MemberExpression[]]} The chaining nodes
		*/
		getMemberChaining(node) {
			/** @type {MemberExpression[]} */
			const nodes = [];
			let n = skipChainExpression(node);
			while (n.type === "MemberExpression") {
				nodes.push(n);
				n = skipChainExpression(n.object);
			}
			return [n, ...nodes.reverse()];
		},
		/**
		* return two string editdistance
		* @param {string} a string a to compare
		* @param {string} b string b to compare
		* @returns {number}
		*/
		editDistance(a, b) {
			if (a === b) return 0;
			const alen = a.length;
			const blen = b.length;
			const dp = Array.from({ length: alen + 1 }, () => Array.from({ length: blen + 1 }, () => 0));
			for (let i = 0; i <= alen; i++) dp[i][0] = i;
			for (let j = 0; j <= blen; j++) dp[0][j] = j;
			for (let i = 1; i <= alen; i++) for (let j = 1; j <= blen; j++) dp[i][j] = a[i - 1] === b[j - 1] ? dp[i - 1][j - 1] : Math.min(dp[i - 1][j], dp[i][j - 1], dp[i - 1][j - 1]) + 1;
			return dp[alen][blen];
		},
		/**
		* Checks whether the target node is within the given range.
		* @param { [number, number] | ASTNode | Token } rangeOrNode
		* @param {ASTNode | Token} target
		*/
		inRange(rangeOrNode, target) {
			const range = Array.isArray(rangeOrNode) ? rangeOrNode : rangeOrNode.range;
			return range[0] <= target.range[0] && target.range[1] <= range[1];
		},
		/**
		* Checks whether the given node is Property.
		*/
		isProperty,
		/**
		* Checks whether the given node is AssignmentProperty.
		*/
		isAssignmentProperty,
		/**
		* Checks whether the given node is VElement.
		*/
		isVElement,
		/**
		* Finds the property with the given name from the given ObjectExpression node.
		*/
		findProperty,
		/**
		* Finds the assignment property with the given name from the given ObjectPattern node.
		*/
		findAssignmentProperty,
		/**
		* Checks if the given node is a property value.
		* @param {Property} prop
		* @param {Expression} node
		*/
		isPropertyChain,
		/**
		* Retrieve `TSAsExpression#expression` value if the given node a `TSAsExpression` node. Otherwise, pass through it.
		*/
		skipTSAsExpression,
		/**
		* Retrieve `AssignmentPattern#left` value if the given node a `AssignmentPattern` node. Otherwise, pass through it.
		*/
		skipDefaultParamValue,
		/**
		* Retrieve `ChainExpression#expression` value if the given node a `ChainExpression` node. Otherwise, pass through it.
		*/
		skipChainExpression,
		/**
		* Checks whether the given node is in a type annotation.
		*/
		withinTypeNode,
		findVariableByIdentifier,
		getScope,
		/**
		* Checks whether the given node is in export default.
		* @param {ASTNode} node
		* @returns {boolean}
		*/
		isInExportDefault,
		/**
		* Check whether the given node is `this` or variable that stores `this`.
		* @param  {ESNode} node The node to check
		* @param {RuleContext} context The rule context to use parser services.
		* @returns {boolean} `true` if the given node is `this`.
		*/
		isThis(node, context) {
			if (node.type === "ThisExpression") return true;
			if (node.type !== "Identifier") return false;
			const parent = node.parent;
			if (parent.type === "MemberExpression" && parent.property === node || parent.type === "Property" && parent.key === node && !parent.computed) return false;
			const variable = findVariable(getScope(context, node), node);
			if (variable != null && variable.defs.length === 1) {
				const def = variable.defs[0];
				if (def.type === "Variable" && def.parent.kind === "const" && def.node.id.type === "Identifier") return Boolean(def.node && def.node.init && def.node.init.type === "ThisExpression");
			}
			return false;
		},
		/**
		* Check if a call expression is Object.assign with the given node as first argument
		* @param {CallExpression} callExpr
		* @param {ASTNode} targetNode
		* @returns {boolean}
		*/
		isObjectAssignCall(callExpr, targetNode) {
			const { callee, arguments: args } = callExpr;
			return args.length > 0 && args[0] === targetNode && callee?.type === "MemberExpression" && callee.object?.type === "Identifier" && callee.object.name === "Object" && callee.property?.type === "Identifier" && callee.property.name === "assign";
		},
		/**
		* @param {MemberExpression|Identifier} props
		* @returns { { kind: 'assignment' | 'update' | 'call' , node: ESNode, pathNodes: MemberExpression[] } | null }
		*/
		findMutating(props) {
			/** @type {MemberExpression[]} */
			const pathNodes = [];
			/** @type {MemberExpression | Identifier | ChainExpression} */
			let node = props;
			let target = node.parent;
			while (true) {
				const step = this.findMutatingStep(node, target, pathNodes);
				if (step.done) return step.result;
				node = step.node;
				target = step.target;
			}
		},
		/**
		* Resolve a single step of the parent chain walk in `findMutating`.
		* @param {MemberExpression | Identifier | ChainExpression} node
		* @param {ASTNode} target
		* @param {MemberExpression[]} pathNodes
		* @returns {{ done: true, result: { kind: 'assignment' | 'update' | 'call', node: ESNode, pathNodes: MemberExpression[] } | null } | { done: false, node: MemberExpression | ChainExpression, target: ASTNode }}
		*/
		findMutatingStep(node, target, pathNodes) {
			switch (target.type) {
				case "AssignmentExpression":
					if (target.left === node) return {
						done: true,
						result: {
							kind: "assignment",
							node: target,
							pathNodes
						}
					};
					return {
						done: true,
						result: null
					};
				case "UpdateExpression": return {
					done: true,
					result: {
						kind: "update",
						node: target,
						pathNodes
					}
				};
				case "UnaryExpression":
					if (target.operator === "delete") return {
						done: true,
						result: {
							kind: "update",
							node: target,
							pathNodes
						}
					};
					return {
						done: true,
						result: null
					};
				case "CallExpression": {
					const mem = pathNodes.at(-1);
					if (mem && target.callee === node) {
						const callName = getStaticPropertyName(mem);
						if (callName && /^(?:push|pop|shift|unshift|reverse|splice|sort|copyWithin|fill)$/u.test(callName)) {
							pathNodes.pop();
							return {
								done: true,
								result: {
									kind: "call",
									node: target,
									pathNodes
								}
							};
						}
					}
					if (this.isObjectAssignCall(target, node)) return {
						done: true,
						result: {
							kind: "call",
							node: target,
							pathNodes
						}
					};
					return {
						done: true,
						result: null
					};
				}
				case "MemberExpression":
					if (target.object === node) {
						pathNodes.push(target);
						return {
							done: false,
							node: target,
							target: target.parent
						};
					}
					return {
						done: true,
						result: null
					};
				case "ChainExpression": return {
					done: false,
					node: target,
					target: target.parent
				};
				default: return {
					done: true,
					result: null
				};
			}
		},
		/**
		* Return generator with the all handler nodes defined in the given watcher property.
		* @param {Property|Expression} property
		* @returns {IterableIterator<Expression>}
		*/
		iterateWatchHandlerValues,
		/**
		* Wraps composition API trace map in both 'vue' and '@vue/composition-api' imports, or '#imports' from unimport
		* @param {import('@eslint-community/eslint-utils').TYPES.TraceMap} map
		*/
		createCompositionApiTraceMap,
		/**
		* Iterates all references in the given trace map.
		* Take the third argument option to detect auto-imported references.
		*
		* @param {import('@eslint-community/eslint-utils').ReferenceTracker} tracker
		* @param {import('@eslint-community/eslint-utils').TYPES.TraceMap} map
		* @returns {ReturnType<import('@eslint-community/eslint-utils').ReferenceTracker['iterateEsmReferences']>}
		*/
		*iterateReferencesTraceMap(tracker, map) {
			const esmTraceMap = this.createCompositionApiTraceMap({
				...map,
				[ReferenceTracker.ESM]: true
			});
			for (const ref of tracker.iterateEsmReferences(esmTraceMap)) yield ref;
			for (const ref of tracker.iterateGlobalReferences(map)) yield ref;
		},
		/**
		* Checks whether or not the tokens of two given nodes are same.
		* @param {ASTNode} left A node 1 to compare.
		* @param {ASTNode} right A node 2 to compare.
		* @param {ParserServices.TokenStore | SourceCode} sourceCode The ESLint source code object.
		* @returns {boolean} the source code for the given node.
		*/
		equalTokens(left, right, sourceCode) {
			const tokensL = sourceCode.getTokens(left);
			const tokensR = sourceCode.getTokens(right);
			if (tokensL.length !== tokensR.length) return false;
			return tokensL.every((token, i) => token.type === tokensR[i].type && token.value === tokensR[i].value);
		}
	};
	/**
	* Checks whether the given value is defined.
	* @template T
	* @param {T | null | undefined} v
	* @returns {v is T}
	*/
	function isDef(v) {
		return v != null;
	}
	/**
	* Flattens arrays, objects and iterable objects.
	* @template T
	* @param {T | Iterable<T> | null | undefined} v
	* @returns {T[]}
	*/
	function flatten(v) {
		/** @type {T[]} */
		const result = [];
		if (v) if (isIterable(v)) result.push(...v);
		else result.push(v);
		return result;
	}
	/**
	* @param {*} v
	* @returns {v is Iterable<any>}
	*/
	function isIterable(v) {
		return v && Symbol.iterator in v;
	}
	/**
	* Register the given visitor to parser services.
	* If the parser service of `vue-eslint-parser` was not found,
	* this generates a warning.
	*
	* @param {RuleContext} context The rule context to use parser services.
	* @param {TemplateListener} templateBodyVisitor The visitor to traverse the template body.
	* @param {RuleListener} [scriptVisitor] The visitor to traverse the script.
	* @param { { templateBodyTriggerSelector: "Program" | "Program:exit" } } [options] The options.
	* @returns {RuleListener} The merged visitor.
	*/
	function defineTemplateBodyVisitor(context, templateBody_{Visitor, scriptVisitor, options) {
		const sourceCode = context.sourceCode;
		if (sourceCode.parserServices.defineTemplateBodyVisitor == null) {
			const filename = context.filename;
			if (path.extname(filename) === ".vue") context.report({
				loc: {
					line: 1,
					column: 0
				},
				message: "Use the latest vue-eslint-parser. See also https://eslint.vuejs.org/user-guide/#what-is-the-use-the-latest-vue-eslint-parser-error."
			});
			return {};
		}
		return sourceCode.parserServices.defineTemplateBodyVisitor(templateBodyVisitor, scriptVisitor, options);
	}
	/**
	* Register the given visitor to parser services.
	* If the parser service of `vue-eslint-parser` was not found,
	* this generates a warning.
	*
	* @param {RuleContext} context The rule context to use parser services.
	* @param {TemplateListener} documentVisitor The visitor to traverse the document.
	* @param { { triggerSelector: "Program" | "Program:exit" } } [options] The options.
	* @returns {RuleListener} The merged visitor.
	*/
	function defineDocumentVisitor(context, documentVisitor, options) {
		const sourceCode = context.sourceCode;
		if (sourceCode.parserServices.defineDocumentVisitor == null) {
			const filename = context.filename;
			if (path.extname(filename) === ".vue") context.report({
				loc: {
					line: 1,
					column: 0
				},
				message: "Use the latest vue-eslint-parser. See also https://eslint.vuejs.org/user-guide/#what-is-the-use-the-latest-vue-eslint-parser-error."
			});
			return {};
		}
		return sourceCode.parserServices.defineDocumentVisitor(documentVisitor, options);
	}
	/**
	* @template T
	* @param {T} visitor
	* @param {...(TemplateListener | RuleListener | NodeListener)} visitors
	* @returns {T}
	*/
	function compositingVisitors(visitor, ...visitors) {
		for (const v of visitors) for (const key in v) if (visitor[key]) {
			const o = visitor[key];
			visitor[key] = (...args) => {
				o(...args);
				v[key](...args);
			};
		} else visitor[key] = v[key];
		return visitor;
	}
	/**
	* Find the variable of a given identifier.
	* @param {RuleContext} context The rule context
	* @param {Identifier} node The variable name to find.
	* @returns {Variable|null} The found variable or null.
	*/
	function findVariableByIdentifier(context, node) {
		return findVariable(getScope(context, node), node);
	}
	/**
	* Finds the property with the given name from the given ObjectExpression node.
	* @param {ObjectExpression} node
	* @param {string} name
	* @param { (p: Property) => boolean } [filter]
	* @returns { (Property) | null}
	*/
	function findProperty(node, name, filter) {
		const predicate = filter ? (prop) => isProperty(prop) && getStaticPropertyName(prop) === name && filter(prop) : (prop) => isProperty(prop) && getStaticPropertyName(prop) === name;
		return node.properties.find(predicate) || null;
	}
	/**
	* Finds the assignment property with the given name from the given ObjectPattern node.
	* @param {ObjectPattern} node
	* @param {string} name
	* @param { (p: AssignmentProperty) => boolean } [filter]
	* @returns { (AssignmentProperty) | null}
	*/
	function findAssignmentProperty(node, name, filter) {
		const predicate = filter ? (prop) => isAssignmentProperty(prop) && getStaticPropertyName(prop) === name && filter(prop) : (prop) => isAssignmentProperty(prop) && getStaticPropertyName(prop) === name;
		return node.properties.find(predicate) || null;
	}
	/**
	* Checks whether the given node is Property.
	* @param {Property | SpreadElement | AssignmentProperty} node
	* @returns {node is Property}
	*/
	function isProperty(node) {
		if (node.type !== "Property") return false;
		return !node.parent || node.parent.type === "ObjectExpression";
	}
	/**
	* Checks whether the given node is AssignmentProperty.
	* @param {AssignmentProperty | RestElement} node
	* @returns {node is AssignmentProperty}
	*/
	function isAssignmentProperty(node) {
		return node.type === "Property";
	}
	/**
	* Checks whether the given node is VElement.
	* @param {VElement | VExpressionContainer | VText | VDocumentFragment} node
	* @returns {node is VElement}
	*/
	function isVElement(node) {
		return node.type === "VElement";
	}
	/**
	* Checks whether the given node is in export default.
	* @param {ASTNode} node
	* @returns {boolean}
	*/
	function isInExportDefault(node) {
		/** @type {ASTNode | null} */
		let parent = node.parent;
		while (parent) {
			if (parent.type === "ExportDefaultDeclaration") return true;
			parent = parent.parent;
		}
		return false;
	}
	/**
	* Retrieve `TSAsExpression#expression` value if the given node a `TSAsExpression` node. Otherwise, pass through it.
	* @template T Node type
	* @param {T | TSAsExpression} node The node to address.
	* @returns {T} The `TSAsExpression#expression` value if the node is a `TSAsExpression` node. Otherwise, the node.
	*/
	function skipTSAsExpression(node) {
		if (!node) return node;
		if (node.type === "TSAsExpression") return skipTSAsExpression(node.expression);
		return node;
	}
	/**
	* Gets the parent node of the given node. This method returns a value ignoring `X as F`.
	* @param {Expression} node
	* @returns {ASTNode}
	*/
	function getParent(node) {
		let parent = node.parent;
		while (parent.type === "TSAsExpression") parent = parent.parent;
		return parent;
	}
	/**
	* Checks if the given node is a property value.
	* @param {Property} prop
	* @param {Expression} node
	*/
	function isPropertyChain(prop, node) {
		let value = node;
		while (value.parent.type === "TSAsExpression") value = value.parent;
		return prop === value.parent && prop.value === value;
	}
	/**
	* Retrieve `AssignmentPattern#left` value if the given node a `AssignmentPattern` node. Otherwise, pass through it.
	* @template T Node type
	* @param {T | AssignmentPattern} node The node to address.
	* @return {T} The `AssignmentPattern#left` value if the node is a `AssignmentPattern` node. Otherwise, the node.
	*/
	function skipDefaultParamValue(node) {
		if (!node) return node;
		if (node.type === "AssignmentPattern") return skipDefaultParamValue(node.left);
		return node;
	}
	/**
	* Retrieve `ChainExpression#expression` value if the given node a `ChainExpression` node. Otherwise, pass through it.
	* @template T Node type
	* @param {T | ChainExpression} node The node to address.
	* @returns {T} The `ChainExpression#expression` value if the node is a `ChainExpression` node. Otherwise, the node.
	*/
	function skipChainExpression(node) {
		if (!node) return node;
		if (node.type === "ChainExpression") return skipChainExpression(node.expression);
		return node;
	}
	/**
	* Checks whether the given node is in a type annotation.
	* @param {ESNode} node
	* @returns {boolean}
	*/
	function withinTypeNode(node) {
		/** @type {ASTNode | null} */
		let target = node;
		while (target) {
			if (isTypeNode(target)) return true;
			target = target.parent;
		}
		return false;
	}
	/**
	* Gets the property name of a given node.
	* @param {Property|AssignmentProperty|MethodDefinition|MemberExpression} node - The node to get.
	* @return {string|null} The property name if static. Otherwise, null.
	*/
	function getStaticPropertyName(node) {
		if (node.type === "Property" || node.type === "MethodDefinition") {
			if (!node.computed) {
				const key = node.key;
				if (key.type === "Identifier") return key.name;
			}
			const key = node.key;
			return getStringLiteralValue(key);
		}
		if (node.type === "MemberExpression") {
			if (!node.computed) {
				const property = node.property;
				if (property.type === "Identifier") return property.name;
				return null;
			}
			const property = node.property;
			return getStringLiteralValue(property);
		}
		return null;
	}
	/**
	* Gets the string of a given node.
	* @param {Literal|TemplateLiteral} node - The node to get.
	* @param {boolean} [stringOnly]
	* @return {string|null} The string if static. Otherwise, null.
	*/
	function getStringLiteralValue(node, stringOnly) {
		if (node.type === "Literal") {
			if (node.value == null) {
				if (!stringOnly && node.bigint != null) return node.bigint;
				return null;
			}
			if (typeof node.value === "string") return node.value;
			if (!stringOnly) return String(node.value);
			return null;
		}
		if (node.type === "TemplateLiteral" && node.expressions.length === 0 && node.quasis.length === 1) return node.quasis[0].value.cooked;
		return null;
	}
	/**
	* Gets the VExpressionContainer of a given node.
	* @param {ASTNode} node - The node to get.
	* @return {VExpressionContainer|null}
	*/
	function getVExpressionContainer(node) {
		/** @type {ASTNode | null} */
		let n = node;
		while (n && n.type !== "VExpressionContainer") n = n.parent;
		return n;
	}
	/**
	* @param {string} path
	*/
	function isTypeScriptFile(path) {
		return path.endsWith(".ts") || path.endsWith(".tsx") || path.endsWith(".mts");
	}
	/**
	* @param {string} path
	*/
	function isVueFile(path) {
		return path.endsWith(".vue") || path.endsWith(".jsx") || path.endsWith(".tsx");
	}
	/**
	* Checks whether the current file is uses `<script setup>`
	* @param {RuleContext} context The ESLint rule context object.
	*/
	function isScriptSetup(context) {
		return Boolean(getScriptSetupElement(context));
	}
	/**
	* Gets the element of `<script setup>`
	* @param {RuleContext} context The ESLint rule context object.
	* @returns {VElement | null} the element of `<script setup>`
	*/
	function getScriptSetupElement(context) {
		const sourceCode = context.sourceCode;
		const df = sourceCode.parserServices.getDocumentFragment && sourceCode.parserServices.getDocumentFragment();
		if (!df) return null;
		const scripts = df.children.filter(
			/** @returns {e is VElement} */
			(e) => isVElement(e) && e.name === "script"
		);
		if (scripts.length === 2) return scripts.find((e) => hasAttribute(e, "setup")) || null;
		const script = scripts[0];
		if (script && hasAttribute(script, "setup")) return script;
		return null;
	}
	/**
	* Check whether the given node is a Vue component based
	* on the filename and default export type
	* export default {} in .vue || .jsx
	* @param {ESNode} node Node to check
	* @param {string} path File name with extension
	* @returns {boolean}
	*/
	function isVueComponentFile(node, path) {
		return isVueFile(path) && node.type === "ExportDefaultDeclaration" && node.declaration.type === "ObjectExpression";
	}
	/**
	* Whether the given callee refers to a symbol exported by Vue.
	* @param {Identifier} callee Node to check.
	* @param {RuleContext} context The rule context to use parser services.
	* @returns {boolean}
	*/
	function isGlobalOrImportedFromVue(callee, context) {
		const globalScope = context.sourceCode.scopeManager.globalScope;
		if (globalScope === null) return true;
		const tracker = new ReferenceTracker(globalScope);
		const globalTraceMap = { [callee.name]: { [ReferenceTracker.CALL]: true } };
		const cjsTraceMap = createCompositionApiTraceMap(globalTraceMap);
		const esmTraceMap = createCompositionApiTraceMap({
			[ReferenceTracker.ESM]: true,
			[callee.name]: { [ReferenceTracker.CALL]: true }
		});
		function* allReferences() {
			yield* tracker.iterateGlobalReferences(globalTraceMap);
			yield* tracker.iterateEsmReferences(esmTraceMap);
			yield* tracker.iterateCjsReferences(cjsTraceMap);
		}
		for (const { node } of allReferences()) if (node === callee.parent) return true;
		const variable = findVariable(getScope(context, callee), callee);
		if (variable !== null && variable.defs.length === 1) {
			const def = variable.defs[0];
			if (def.type === "ImportBinding" && def.node.type === "ImportSpecifier" && def.node.imported.type === "Identifier" && def.node.parent.type === "ImportDeclaration") return def.node.parent.source.value === "vue" || def.node.parent.source.value === "@vue/composition-api";
			if (def.type === "Variable" && def.node.id.type === "ObjectPattern" && def.node.init !== null) {
				const init = def.node.init;
				if (init.type === "CallExpression") {
					const firstArg = init.arguments[0];
					if (init.callee.type === "Identifier" && init.callee.name === "require") {
						const source = isStringLiteral(firstArg) ? getStringLiteralValue(firstArg) : null;
						return source === "vue" || source === "@vue/composition-api";
					}
				}
			}
			if ([
				"CatchClause",
				"ClassName",
				"FunctionName",
				"TDZ"
			].includes(def.type)) return false;
		}
		return true;
	}
	/**
	* Get the Vue component definition type from given node
	* Vue.component('xxx', {}) || component('xxx', {})
	* @param {RuleContext} context The rule context to use parser services.
	* @param {ObjectExpression} node Node to check
	* @returns {'component' | 'mixin' | 'extend' | 'createApp' | 'defineComponent' | 'defineNuxtComponent' | null}
	*/
	function getVueComponentDefinitionType(context, node) {
		const parent = getParent(node);
		if (parent.type === "CallExpression") {
			const callee = parent.callee;
			if (callee.type === "MemberExpression") {
				const calleeObject = skipTSAsExpression(callee.object);
				if (calleeObject.type === "Identifier") {
					const propName = getStaticPropertyName(callee);
					if (calleeObject.name === "Vue") return propName && isObjectArgument(parent) && (propName === "component" || propName === "mixin" || propName === "extend") ? propName : null;
					return propName && isObjectArgument(parent) && (propName === "component" || propName === "mixin") ? propName : null;
				}
			} else if (callee.type === "Identifier") {
				if (callee.name === "defineNuxtComponent") return isObjectArgument(parent) ? "defineNuxtComponent" : null;
				if ((callee.name === "component" || callee.name === "createApp" || callee.name === "defineComponent") && isGlobalOrImportedFromVue(callee, context)) return isObjectArgument(parent) ? callee.name : null;
			}
		}
		return null;
	}
	/** @param {CallExpression} node */
	function isObjectArgument(node) {
		const lastArgument = node.arguments.at(-1);
		return lastArgument && skipTSAsExpression(lastArgument).type === "ObjectExpression";
	}
	/**
	* Check whether given node is new Vue instance
	* new Vue({})
	* @param {NewExpression} node Node to check
	* @returns {boolean}
	*/
	function isVueInstance(node) {
		const callee = node.callee;
		return node.type === "NewExpression" && callee.type === "Identifier" && callee.name === "Vue" && node.arguments.length > 0 && skipTSAsExpression(node.arguments[0]).type === "ObjectExpression";
	}
	/**
	* If the given object is a Vue component or instance, returns the Vue definition type.
	* @param {RuleContext} context The ESLint rule context object.
	* @param {ObjectExpression} node Node to check
	* @returns { VueObjectType | null } The Vue definition type.
	*/
	function getVueObjectType(context, node) {
		if (node.type !== "ObjectExpression") return null;
		const parent = getParent(node);
		switch (parent.type) {
			case "ExportDefaultDeclaration": {
				const filePath = context.filename;
				if (isVueComponentFile(parent, filePath) && skipTSAsExpression(parent.declaration) === node) {
					const scriptSetup = getScriptSetupElement(context);
					if (scriptSetup && scriptSetup.range[0] <= parent.range[0] && parent.range[1] <= scriptSetup.range[1]) return null;
					return "export";
				}
				break;
			}
			case "CallExpression":
				if (getVueComponentDefinitionType(context, node) != null && skipTSAsExpression(parent.arguments.at(-1)) === node) return "definition";
				break;
			case "NewExpression":
				if (isVueInstance(parent) && skipTSAsExpression(parent.arguments[0]) === node) return "instance";
				break;
		}
		if (getComponentComments(context).some((el) => el.loc.end.line === node.loc.start.line - 1)) return "mark";
		return null;
	}
	/**
	* Checks whether the given object is an SFC definition.
	* @param {RuleContext} context The ESLint rule context object.
	* @param {ObjectExpression} node Node to check
	* @returns { boolean } `true`, the given object is an SFC definition.
	*/
	function isSFCObject(context, node) {
		if (node.type !== "ObjectExpression") return false;
		const filePath = context.filename;
		const ext = path.extname(filePath);
		if (ext !== ".vue" && ext) return false;
		return isSFC(node);
		/**
		* @param {Expression} node
		* @returns {boolean}
		*/
		function isSFC(node) {
			const parent = getParent(node);
			switch (parent.type) {
				case "ExportDefaultDeclaration": {
					if (skipTSAsExpression(parent.declaration) !== node) return false;
					const scriptSetup = getScriptSetupElement(context);
					return !scriptSetup || scriptSetup.range[0] > parent.range[0] || parent.range[1] > scriptSetup.range[1];
				}
				case "CallExpression": {
					if (parent.arguments.every((arg) => skipTSAsExpression(arg) !== node)) return false;
					const { callee } = parent;
					if (callee.type === "Identifier" && (callee.name === "defineComponent" || callee.name === "defineNuxtComponent") || callee.type === "MemberExpression" && callee.object.type === "Identifier" && callee.object.name === "Vue" && callee.property.type === "Identifier" && callee.property.name === "extend") return isSFC(parent);
					return false;
				}
				case "VariableDeclarator": {
					if (skipTSAsExpression(parent.init) !== node || parent.id.type !== "Identifier") return false;
					const variable = findVariable(getScope(context, node), parent.id);
					if (!variable) return false;
					return variable.references.some((ref) => isSFC(ref.identifier));
				}
			}
			return false;
		}
	}
	/**
	* Gets the component comments of a given context.
	* @param {RuleContext} context The ESLint rule context object.
	* @return {Token[]} The the component comments.
	*/
	function getComponentComments(context) {
		let tokens = componentComments.get(context);
		if (tokens) return tokens;
		tokens = context.sourceCode.getAllComments().filter((comment) => /@vue\/component/g.test(comment.value));
		componentComments.set(context, tokens);
		return tokens;
	}
	/**
	* Return generator with the all handler nodes defined in the given watcher property.
	* @param {Property|Expression} property
	* @returns {IterableIterator<Expression>}
	*/
	function* iterateWatchHandlerValues(property) {
		const value = property.type === "Property" ? property.value : property;
		if (value.type === "ObjectExpression") {
			const handler = findProperty(value, "handler");
			if (handler) yield handler.value;
		} else if (value.type === "ArrayExpression") {
			for (const element of value.elements) if (isDef(element) && element.type !== "SpreadElement") yield* iterateWatchHandlerValues(element);
		} else yield value;
	}
	/**
	* Wraps composition API trace map in both 'vue' and '@vue/composition-api' imports, or '#imports' from unimport
	* @param {import('@eslint-community/eslint-utils').TYPES.TraceMap} map
	*/
	function createCompositionApiTraceMap(map) {
		return {
			vue: map,
			"@vue/composition-api": map,
			"#imports": map
		};
	}
	/**
	* Get the attribute which has the given name.
	* @param {VElement} node The start tag node to check.
	* @param {string} name The attribute name to check.
	* @param {string} [value] The attribute value to check.
	* @returns {VAttribute | null} The found attribute.
	*/
	function getAttribute(node, name, value) {
		return node.startTag.attributes.find(
			/**
			* @param {VAttribute | VDirective} node
			* @returns {node is VAttribute}
			*/
			(node) => !node.directive && node.key.name === name && (value === void 0 || node.value != null && node.value.value === value)
		) || null;
	}
	/**
	* Get the directive list which has the given name.
	* @param {VElement | VStartTag} node The start tag node to check.
	* @param {string} name The directive name to check.
	* @returns {VDirective[]} The array of `v-slot` directives.
	*/
	function getDirectives(node, name) {
		return (node.type === "VElement" ? node.startTag : node).attributes.filter(
			/**
			* @param {VAttribute | VDirective} node
			* @returns {node is VDirective}
			*/
			(node) => node.directive && node.key.name.name === name
		);
	}
	/**
	* Get the directive which has the given name.
	* @param {VElement} node The start tag node to check.
	* @param {string} name The directive name to check.
	* @param {string} [argument] The directive argument to check.
	* @returns {VDirective | null} The found directive.
	*/
	function getDirective(node, name, argument) {
		return node.startTag.attributes.find(
			/**
			* @param {VAttribute | VDirective} node
			* @returns {node is VDirective}
			*/
			(node) => node.directive && node.key.name.name === name && (argument === void 0 || (node.key.argument && node.key.argument.type === "VIdentifier" && node.key.argument.name) === argument)
		) || null;
	}
	/**
	* Check whether the given start tag has specific directive.
	* @param {VElement} node The start tag node to check.
	* @param {string} name The attribute name to check.
	* @param {string} [value] The attribute value to check.
	* @returns {boolean} `true` if the start tag has the attribute.
	*/
	function hasAttribute(node, name, value) {
		return Boolean(getAttribute(node, name, value));
	}
	/**
	* Check whether the given start tag has specific directive.
	* @param {VElement} node The start tag node to check.
	* @param {string} name The directive name to check.
	* @param {string} [argument] The directive argument to check.
	* @returns {boolean} `true` if the start tag has the directive.
	*/
	function hasDirective(node, name, argument) {
		return Boolean(getDirective(node, name, argument));
	}
	/**
	* Check whether the given directive node is v-bind same-name shorthand.
	* @param {VAttribute | VDirective} node The directive node to check.
	* @returns {node is VDirective & { value: VExpressionContainer & { expression: Identifier } }} `true` if the directive node is v-bind same-name shorthand.
	*/
	function isVBindSameNameShorthand(node) {
		return node.directive && node.key.name.name === "bind" && node.value?.expression?.type === "Identifier" && node.key.range[0] <= node.value.range[0] && node.value.range[1] <= node.key.range[1];
	}
	/**
	* @param {ASTNode} node
	* @returns {node is Literal | TemplateLiteral}
	*/
	function isStringLiteral(node) {
		return node.type === "Literal" && typeof node.value === "string" || node.type === "TemplateLiteral" && node.expressions.length === 0;
	}
	/**
	* Checks whether given defineProps call node has withDefaults.
	* @param {CallExpression} node The node of defineProps
	* @returns {node is CallExpression & { parent: CallExpression }}
	*/
	function hasWithDefaults(node) {
		return node.parent && node.parent.type === "CallExpression" && node.parent.arguments[0] === node && node.parent.callee.type === "Identifier" && node.parent.callee.name === "withDefaults";
	}
	/**
	* Get the withDefaults call node from given defineProps call node.
	* @param {CallExpression} node The node of defineProps
	* @returns {CallExpression | null}
	*/
	function getWithDefaults(node) {
		return hasWithDefaults(node) ? node.parent : null;
	}
	/**
	* Gets a map of the property nodes defined in withDefaults.
	* @param {CallExpression} node The node of defineProps
	* @returns { { [key: string]: Property | undefined } }
	*/
	function getWithDefaultsProps(node) {
		if (!hasWithDefaults(node)) return {};
		const param = node.parent.arguments[1];
		if (!param || param.type !== "ObjectExpression") return {};
		/** @type {Record<string, Property>} */
		const result = {};
		for (const prop of param.properties) {
			if (prop.type !== "Property") continue;
			const name = getStaticPropertyName(prop);
			if (name != null) result[name] = prop;
		}
		return result;
	}
	/**
	* Gets the props destructure property nodes for defineProp.
	* @param {CallExpression} node The node of defineProps
	* @returns { Record<string, AssignmentProperty | undefined> }
	*/
	function getPropsDestructure(node) {
		/** @type {ReturnType<typeof getPropsDestructure>} */
		const result = Object.create(null);
		const left = getLeftOfDefineProps(node);
		if (!left || left.type !== "ObjectPattern") return result;
		for (const prop of left.properties) {
			if (prop.type !== "Property") continue;
			const name = getStaticPropertyName(prop);
			if (name != null) result[name] = prop;
		}
		return result;
	}
	/**
	* Gets the default definition nodes for defineProp
	* using the props destructure with assignment pattern.
	* @param {CallExpression} node The node of defineProps
	* @returns { Record<string, {prop: AssignmentProperty , expression: Expression} | undefined> }
	*/
	function getDefaultPropExpressionsForPropsDestructure(node) {
		/** @type {ReturnType<typeof getDefaultPropExpressionsForPropsDestructure>} */
		const result = Object.create(null);
		const propsDestructureEntries = Object.entries(getPropsDestructure(node));
		for (const [name, prop] of propsDestructureEntries) {
			if (!prop) continue;
			const value = prop.value;
			if (value.type !== "AssignmentPattern") continue;
			result[name] = {
				prop,
				expression: value.right
			};
		}
		return result;
	}
	/**
	* Gets the pattern of the left operand of defineProps.
	* @param {CallExpression} node The node of defineProps
	* @returns {Pattern | null} The pattern of the left operand of defineProps
	*/
	function getLeftOfDefineProps(node) {
		let target = node;
		if (hasWithDefaults(target)) target = target.parent;
		if (!target.parent) return null;
		if (target.parent.type === "VariableDeclarator" && target.parent.init === target) return target.parent.id;
		return null;
	}
	/**
	* Get all props from component options object.
	* @param {ObjectExpression} componentObject Object with component definition
	* @return {(ComponentArrayProp | ComponentObjectProp | ComponentUnknownProp)[]} Array of component props
	*/
	function getComponentPropsFromOptions(componentObject) {
		const propsNode = componentObject.properties.find(
			/**
			* @param {ESNode} p
			* @returns {p is (Property & { key: Identifier & {name: 'props'} })}
			*/
			(p) => p.type === "Property" && getStaticPropertyName(p) === "props"
		);
		if (!propsNode) return [];
		if (propsNode.value.type !== "ObjectExpression" && propsNode.value.type !== "ArrayExpression") return [{
			type: "unknown",
			propName: null,
			node: propsNode.value
		}];
		return getComponentPropsFromDefine(propsNode.value);
	}
	/**
	* Get all emits from component options object.
	* @param {ObjectExpression} componentObject Object with component definition
	* @return {(ComponentArrayEmit | ComponentObjectEmit | ComponentUnknownEmit)[]} Array of component emits
	*/
	function getComponentEmitsFromOptions(componentObject) {
		const emitsNode = componentObject.properties.find(
			/**
			* @param {ESNode} p
			* @returns {p is (Property & { key: Identifier & {name: 'emits'} })}
			*/
			(p) => p.type === "Property" && getStaticPropertyName(p) === "emits"
		);
		if (!emitsNode) return [];
		if (emitsNode.value.type !== "ObjectExpression" && emitsNode.value.type !== "ArrayExpression") return [{
			type: "unknown",
			emitName: null,
			node: emitsNode.value
		}];
		return getComponentEmitsFromDefine(emitsNode.value);
	}
	/**
	* Get all props from `defineProps` call expression.
	* @param {RuleContext} context The rule context object.
	* @param {CallExpression} node `defineProps` call expression
	* @return {ComponentProp[]} Array of component props
	*/
	function getComponentPropsFromDefineProps(context, node) {
		if (node.arguments.length > 0) {
			const defNode = getObjectOrArray(context, node.arguments[0]);
			if (defNode) return getComponentPropsFromDefine(defNode);
			return [{
				type: "unknown",
				propName: null,
				node: node.arguments[0]
			}];
		}
		const typeArguments = "typeArguments" in node ? node.typeArguments : node.typeParameters;
		if (typeArguments && typeArguments.params.length > 0) return getComponentPropsFromTypeDefine(context, typeArguments.params[0]);
		return [{
			type: "unknown",
			propName: null,
			node: null
		}];
	}
	/**
	* Get all emits from `defineEmits` call expression.
	* @param {RuleContext} context The rule context object.
	* @param {CallExpression} node `defineEmits` call expression
	* @return {ComponentEmit[]} Array of component emits
	*/
	function getComponentEmitsFromDefineEmits(context, node) {
		if (node.arguments.length > 0) {
			const defNode = getObjectOrArray(context, node.arguments[0]);
			if (defNode) return getComponentEmitsFromDefine(defNode);
			return [{
				type: "unknown",
				emitName: null,
				node: node.arguments[0]
			}];
		}
		const typeArguments = "typeArguments" in node ? node.typeArguments : node.typeParameters;
		if (typeArguments && typeArguments.params.length > 0) return getComponentEmitsFromTypeDefine(context, typeArguments.params[0]);
		return [{
			type: "unknown",
			emitName: null,
			node: null
		}];
	}
	/**
	* Get all slots from `defineSlots` call expression.
	* @param {RuleContext} context The rule context object.
	* @param {CallExpression} node `defineSlots` call expression
	* @return {ComponentSlot[]} Array of component slots
	*/
	function getComponentSlotsFromDefineSlots(context, node) {
		const typeArguments = "typeArguments" in node ? node.typeArguments : node.typeParameters;
		if (typeArguments && typeArguments.params.length > 0) return getComponentSlotsFromTypeDefine(context, typeArguments.params[0]);
		return [{
			type: "unknown",
			slotName: null,
			node: null
		}];
	}
	/**
	* Get model info from `defineModel` call expression.
	* @param {RuleContext} _context The rule context object.
	* @param {CallExpression} node `defineModel` call expression
	* @return {ComponentModel} Object of component model
	*/
	function getComponentModelFromDefineModel(_context, node) {
		/** @type {ComponentModelName} */
		let name = {
			modelName: "modelValue",
			node: null
		};
		/** @type {Expression|null} */
		let options = node.arguments[0]?.type === "SpreadElement" ? null : node.arguments[0];
		if (node.arguments.length > 0) {
			const nameNodeCandidate = skipTSAsExpression(node.arguments[0]);
			if (nameNodeCandidate.type === "Literal") {
				name = {
					modelName: String(nameNodeCandidate.value),
					node: nameNodeCandidate
				};
				options = node.arguments[1]?.type === "SpreadElement" ? null : node.arguments[1];
			}
		}
		const typeArguments = "typeArguments" in node ? node.typeArguments : node.typeParameters;
		if (typeArguments && typeArguments.params.length > 0) return {
			name,
			options,
			typeNode: typeArguments.params[0]
		};
		return {
			name,
			options,
			typeNode: null
		};
	}
	/**
	* Get all props by looking at all component's properties
	* @param {ObjectExpression|ArrayExpression} propsNode Object with props definition
	* @return {(ComponentArrayProp | ComponentObjectProp | ComponentUnknownProp)[]} Array of component props
	*/
	function getComponentPropsFromDefine(propsNode) {
		if (propsNode.type === "ObjectExpression") return propsNode.properties.map(
			/** @returns {ComponentArrayProp | ComponentObjectProp | ComponentUnknownProp} */
			(prop) => {
				if (!isProperty(prop)) return {
					type: "unknown",
					propName: null,
					node: prop
				};
				const propName = getStaticPropertyName(prop);
				if (propName != null) return {
					type: "object",
					key: prop.key,
					propName,
					value: skipTSAsExpression(prop.value),
					node: prop
				};
				return {
					type: "object",
					key: null,
					propName: null,
					value: skipTSAsExpression(prop.value),
					node: prop
				};
			}
		);
		return propsNode.elements.filter(isDef).map((prop) => {
			if (prop.type === "Literal" || prop.type === "TemplateLiteral") {
				const propName = getStringLiteralValue(prop);
				if (propName != null) return {
					type: "array",
					key: prop,
					propName,
					value: null,
					node: prop
				};
			}
			return {
				type: "array",
				key: null,
				propName: null,
				value: null,
				node: prop
			};
		});
	}
	/**
	* Get all emits by looking at all component's properties
	* @param {ObjectExpression|ArrayExpression} emitsNode Object with emits definition
	* @return {(ComponentArrayEmit | ComponentObjectEmit | ComponentUnknownEmit)[]} Array of component emits.
	*/
	function getComponentEmitsFromDefine(emitsNode) {
		if (emitsNode.type === "ObjectExpression") return emitsNode.properties.map((prop) => {
			if (!isProperty(prop)) return {
				type: "unknown",
				key: null,
				emitName: null,
				value: null,
				node: prop
			};
			const emitName = getStaticPropertyName(prop);
			if (emitName != null) return {
				type: "object",
				key: prop.key,
				emitName,
				value: skipTSAsExpression(prop.value),
				node: prop
			};
			return {
				type: "object",
				key: null,
				emitName: null,
				value: skipTSAsExpression(prop.value),
				node: prop
			};
		});
		return emitsNode.elements.filter(isDef).map((emit) => {
			if (emit.type === "Literal" || emit.type === "TemplateLiteral") {
				const emitName = getStringLiteralValue(emit);
				if (emitName != null) return {
					type: "array",
					key: emit,
					emitName,
					value: null,
					node: emit
				};
			}
			return {
				type: "array",
				key: null,
				emitName: null,
				value: null,
				node: emit
			};
		});
	}
	/**
	* @param {RuleContext} context The rule context object.
	* @param {ESNode} node
	* @returns {ObjectExpression | ArrayExpression | null}
	*/
	function getObjectOrArray(context, node) {
		if (node.type === "ObjectExpression") return node;
		if (node.type === "ArrayExpression") return node;
		if (node.type === "Identifier") {
			const variable = findVariable(getScope(context, node), node);
			if (variable != null && variable.defs.length === 1) {
				const def = variable.defs[0];
				if (def.type === "Variable" && def.parent.kind === "const" && def.node.id.type === "Identifier" && def.node.init) return getObjectOrArray(context, def.node.init);
			}
		}
		return null;
	}
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_utils();
	}
});
쟇#x://#region lib/utils/inline-non-void-elements.json
var inline_non_void_elements_default = [
	"a",
	"abbr",
	"audio",
	"b",
	"bdi",
	"bdo",
	"canvas",
	"cite",
	"code",
	"data",
	"del",
	"dfn",
	"em",
	"i",
	"iframe",
	"ins",
	"kbd",
	"label",
	"map",
	"mark",
	"noscript",
	"object",
	"output",
	"picture",
	"q",
	"ruby",
	"s",
	"samp",
	"small",
	"span",
	"strong",
	"sub",
	"sup",
	"svg",
	"time",
	"u",
	"var",
	"video"
];
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return inline_non_void_elements_default;
	}
});
~Bx(//#region lib/utils/js-reserved.json
var require_js_reserved = /* @__PURE__ */ require("../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	module.exports = [
		"abstract",
		"arguments",
		"await",
		"boolean",
		"break",
		"byte",
		"case",
		"catch",
		"char",
		"class",
		"const",
		"continue",
		"debugger",
		"default",
		"delete",
		"do",
		"double",
		"else",
		"enum",
		"eval",
		"export",
		"extends",
		"false",
		"final",
		"finally",
		"float",
		"for",
		"function",
		"goto",
		"if",
		"implements",
		"import",
		"in",
		"instanceof",
		"int",
		"interface",
		"let",
		"long",
		"native",
		"new",
		"null",
		"package",
		"private",
		"protected",
		"public",
		"return",
		"short",
		"static",
		"super",
		"switch",
		"synchronized",
		"this",
		"throw",
		"throws",
		"transient",
		"true",
		"try",
		"typeof",
		"var",
		"void",
		"volatile",
		"while",
		"with",
		"yield"
	];
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_js_reserved();
	}
});
'Rx)//#region lib/utils/key-aliases.json
var require_key_aliases = /* @__PURE__ */ require("../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	module.exports = [
		"unidentified",
		"alt",
		"alt-graph",
		"caps-lock",
		"control",
		"fn",
		"fn-lock",
		"meta",
		"num-lock",
		"scroll-lock",
		"shift",
		"symbol",
		"symbol-lock",
		"hyper",
		"super",
		"enter",
		"tab",
		"arrow-down",
		"arrow-left",
		"arrow-right",
		"arrow-up",
		"end",
		"home",
		"page-down",
		"page-up",
		"backspace",
		"clear",
		"copy",
		"cr-sel",
		"cut",
		"delete",
		"erase-eof",
		"ex-sel",
		"insert",
		"paste",
		"redo",
		"undo",
		"accept",
		"again",
		"attn",
		"cancel",
		"context-menu",
		"escape",
		"execute",
		"find",
		"help",
		"pause",
		"select",
		"zoom-in",
		"zoom-out",
		"brightness-down",
		"brightness-up",
		"eject",
		"log-off",
		"power",
		"print-screen",
		"hibernate",
		"standby",
		"wake-up",
		"all-candidates",
		"alphanumeric",
		"code-input",
		"compose",
		"convert",
		"dead",
		"final-mode",
		"group-first",
		"group-last",
		"group-next",
		"group-previous",
		"mode-change",
		"next-candidate",
		"non-convert",
		"previous-candidate",
		"process",
		"single-candidate",
		"hangul-mode",
		"hanja-mode",
		"junja-mode",
		"eisu",
		"hankaku",
		"hiragana",
		"hiragana-katakana",
		"kana-mode",
		"kanji-mode",
		"katakana",
		"romaji",
		"zenkaku",
		"zenkaku-hankaku",
		"f1",
		"f2",
		"f3",
		"f4",
		"f5",
		"f6",
		"f7",
		"f8",
		"f9",
		"f10",
		"f11",
		"f12",
		"soft1",
		"soft2",
		"soft3",
		"soft4",
		"channel-down",
		"channel-up",
		"close",
		"mail-forward",
		"mail-reply",
		"mail-send",
		"media-close",
		"media-fast-forward",
		"media-pause",
		"media-play-pause",
		"media-record",
		"media-rewind",
		"media-stop",
		"media-track-next",
		"media-track-previous",
		"new",
		"open",
		"print",
		"save",
		"spell-check",
		"key11",
		"key12",
		"audio-balance-left",
		"audio-balance-right",
		"audio-bass-boost-down",
		"audio-bass-boost-toggle",
		"audio-bass-boost-up",
		"audio-fader-front",
		"audio-fader-rear",
		"audio-surround-mode-next",
		"audio-treble-down",
		"audio-treble-up",
		"audio-volume-down",
		"audio-volume-up",
		"audio-volume-mute",
		"microphone-toggle",
		"microphone-volume-down",
		"microphone-volume-up",
		"microphone-volume-mute",
		"speech-correction-list",
		"speech-input-toggle",
		"launch-application1",
		"launch-application2",
		"launch-calendar",
		"launch-contacts",
		"launch-mail",
		"launch-media-player",
		"launch-music-player",
		"launch-phone",
		"launch-screen-saver",
		"launch-spreadsheet",
		"launch-web-browser",
		"launch-web-cam",
		"launch-word-processor",
		"browser-back",
		"browser-favorites",
		"browser-forward",
		"browser-home",
		"browser-refresh",
		"browser-search",
		"browser-stop",
		"app-switch",
		"call",
		"camera",
		"camera-focus",
		"end-call",
		"go-back",
		"go-home",
		"headset-hook",
		"last-number-redial",
		"notification",
		"manner-mode",
		"voice-dial",
		"t-v",
		"t-v3-d-mode",
		"t-v-antenna-cable",
		"t-v-audio-description",
		"t-v-audio-description-mix-down",
		"t-v-audio-description-mix-up",
		"t-v-contents-menu",
		"t-v-data-service",
		"t-v-input",
		"t-v-input-component1",
		"t-v-input-component2",
		"t-v-input-composite1",
		"t-v-input-composite2",
		"t-v-input-h-d-m-i1",
		"t-v-input-h-d-m-i2",
		"t-v-input-h-d-m-i3",
		"t-v-input-h-d-m-i4",
		"t-v-input-v-g-a1",
		"t-v-media-context",
		"t-v-network",
		"t-v-number-entry",
		"t-v-power",
		"t-v-radio-service",
		"t-v-satellite",
		"t-v-satellite-b-s",
		"t-v-satellite-c-s",
		"t-v-satellite-toggle",
		"t-v-terrestrial-analog",
		"t-v-terrestrial-digital",
		"t-v-timer",
		"a-v-r-input",
		"a-v-r-power",
		"color-f0-red",
		"color-f1-green",
		"color-f2-yellow",
		"color-f3-blue",
		"color-f4-grey",
		"color-f5-brown",
		"closed-caption-toggle",
		"dimmer",
		"display-swap",
		"d-v-r",
		"exit",
		"favorite-clear0",
		"favorite-clear1",
		"favorite-clear2",
		"favorite-clear3",
		"favorite-recall0",
		"favorite-recall1",
		"favorite-recall2",
		"favorite-recall3",
		"favorite-store0",
		"favorite-store1",
		"favorite-store2",
		"favorite-store3",
		"guide",
		"guide-next-day",
		"guide-previous-day",
		"info",
		"instant-replay",
		"link",
		"list-program",
		"live-content",
		"lock",
		"media-apps",
		"media-last",
		"media-skip-backward",
		"media-skip-forward",
		"media-step-backward",
		"media-step-forward",
		"media-top-menu",
		"navigate-in",
		"navigate-next",
		"navigate-out",
		"navigate-previous",
		"next-favorite-channel",
		"next-user-profile",
		"on-demand",
		"pairing",
		"pin-p-down",
		"pin-p-move",
		"pin-p-toggle",
		"pin-p-up",
		"play-speed-down",
		"play-speed-reset",
		"play-speed-up",
		"random-toggle",
		"rc-low-battery",
		"record-speed-next",
		"rf-bypass",
		"scan-channels-toggle",
		"screen-mode-next",
		"settings",
		"split-screen-toggle",
		"s-t-b-input",
		"s-t-b-power",
		"subtitle",
		"teletext",
		"video-mode-next",
		"wink",
		"zoom-toggle",
		"audio-volume-down",
		"audio-volume-up",
		"audio-volume-mute",
		"browser-back",
		"browser-forward",
		"channel-down",
		"channel-up",
		"context-menu",
		"eject",
		"end",
		"enter",
		"home",
		"media-fast-forward",
		"media-play",
		"media-play-pause",
		"media-record",
		"media-rewind",
		"media-stop",
		"media-next-track",
		"media-pause",
		"media-previous-track",
		"power",
		"unidentified"
	];
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_key_aliases();
	}
});
[k6xn//#region lib/utils/keycode-to-key.ts
var keycode_to_key_default = {
	8: "backspace",
	9: "tab",
	13: "enter",
	16: "shift",
	17: "ctrl",
	18: "alt",
	19: "pause",
	20: "caps-lock",
	27: "escape",
	32: "space",
	33: "page-up",
	34: "page-down",
	35: "end",
	36: "home",
	37: "arrow-left",
	38: "arrow-up",
	39: "arrow-right",
	40: "arrow-down",
	45: "insert",
	46: "delete",
	65: "a",
	66: "b",
	67: "c",
	68: "d",
	69: "e",
	70: "f",
	71: "g",
	72: "h",
	73: "i",
	74: "j",
	75: "k",
	76: "l",
	77: "m",
	78: "n",
	79: "o",
	80: "p",
	81: "q",
	82: "r",
	83: "s",
	84: "t",
	85: "u",
	86: "v",
	87: "w",
	88: "x",
	89: "y",
	90: "z",
	112: "f1",
	113: "f2",
	114: "f3",
	115: "f4",
	116: "f5",
	117: "f6",
	118: "f7",
	119: "f8",
	120: "f9",
	121: "f10",
	122: "f11",
	123: "f12",
	144: "num-lock",
	145: "scroll-lock"
};
//#endregion
exports.default = keycode_to_key_default;
" ,x2//#region lib/utils/math-elements.json
var require_math_elements = /* @__PURE__ */ require("../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	module.exports = [
		"math",
		"maction",
		"annotation",
		"annotation-xml",
		"menclose",
		"merror",
		"mfenced",
		"mfrac",
		"mi",
		"mmultiscripts",
		"mn",
		"mo",
		"mover",
		"mpadded",
		"mphantom",
		"mprescripts",
		"mroot",
		"mrow",
		"ms",
		"semantics",
		"mspace",
		"msqrt",
		"mstyle",
		"msub",
		"msup",
		"msubsup",
		"mtable",
		"mtd",
		"mtext",
		"mtr",
		"munder",
		"munderover"
	];
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_math_elements();
	}
});
ԡxo;const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("./index.js");
let _eslint_community_eslint_utils = require("@eslint-community/eslint-utils");
//#region lib/utils/property-references.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
const ANY = {
	hasProperty: () => true,
	allProperties: () => /* @__PURE__ */ new Map(),
	getNest: () => ANY,
	getNestNodes: () => []
};
const NEVER = {
	hasProperty: () => false,
	allProperties: () => /* @__PURE__ */ new Map(),
	getNest: () => NEVER,
	getNestNodes: () => []
};
function findFunction(context, id) {
	const calleeVariable = import_utils.default.findVariableByIdentifier(context, id);
	if (!calleeVariable) return null;
	if (calleeVariable.defs.length === 1) {
		const def = calleeVariable.defs[0];
		if (def.node.type === "FunctionDeclaration") return def.node;
		if (def.type === "Variable" && def.parent.kind === "const" && def.node.init) {
			if (def.node.init.type === "FunctionExpression" || def.node.init.type === "ArrowFunctionExpression") return def.node.init;
			if (def.node.init.type === "Identifier") return findFunction(context, def.node.init);
		}
	}
	return null;
}
function definePropertyReferenceExtractor(context, { unknownMemberAsUnreferenced = false, returnAsUnreferenced = false } = {}) {
	const cacheForExpression = /* @__PURE__ */ new Map();
	const cacheForPattern = /* @__PURE__ */ new Map();
	const cacheForFunction = /* @__PURE__ */ new Map();
	let toRefSet = null;
	let isFunctionalTemplate = false;
	const templateBody = context.sourceCode.ast.templateBody;
	if (templateBody) isFunctionalTemplate = import_utils.default.hasAttribute(templateBody, "functional");
	function getToRefSet() {
		if (toRefSet) return toRefSet;
		const tracker = new _eslint_community_eslint_utils.ReferenceTracker(context.sourceCode.scopeManager.scopes[0]);
		const toRefNodes = /* @__PURE__ */ new Set();
		const toRefReferences = import_utils.default.iterateReferencesTraceMap(tracker, {
			[_eslint_community_eslint_utils.ReferenceTracker.ESM]: true,
			toRef: { [_eslint_community_eslint_utils.ReferenceTracker.CALL]: true }
		});
		for (const { node } of toRefReferences) toRefNodes.add(node);
		const toRefsNodes = /* @__PURE__ */ new Set();
		const toRefsReferences = import_utils.default.iterateReferencesTraceMap(tracker, {
			[_eslint_community_eslint_utils.ReferenceTracker.ESM]: true,
			toRefs: { [_eslint_community_eslint_utils.ReferenceTracker.CALL]: true }
		});
		for (const { node } of toRefsReferences) toRefsNodes.add(node);
		return toRefSet = {
			toRefNodes,
			toRefsNodes
		};
	}
	/**
	* Collects the property references for member expr.
	*/
	class PropertyReferencesForMember {
		node;
		name;
		isWithinTemplate;
		constructor(node, name, isWithinTemplate) {
			this.node = node;
			this.name = name;
			this.isWithinTemplate = isWithinTemplate;
		}
		hasProperty(name) {
			return name === this.name;
		}
		allProperties() {
			return /* @__PURE__ */ new Map([[this.name, { nodes: [this.node.property] }]]);
		}
		getNest(name) {
			return name === this.name ? extractFromExpression(this.node, this.isWithinTemplate) : NEVER;
		}
		*getNestNodes(name) {
			if (name === this.name) yield {
				type: "expression",
				node: this.node
			};
		}
	}
	/**
	* Collects the property references for object.
	*/
	class PropertyReferencesForObject {
		properties;
		constructor() {
			this.properties = Object.create(null);
		}
		hasProperty(name) {
			return Boolean(this.properties[name]);
		}
		allProperties() {
			const result = /* @__PURE__ */ new Map();
			for (const [name, nodes] of Object.entries(this.properties)) result.set(name, { nodes: nodes.map((node) => node.key) });
			return result;
		}
		getNest(name) {
			const properties = this.properties[name];
			return properties ? mergePropertyReferences(properties.map((property) => getNestFromPattern(property.value))) : NEVER;
		}
		*getNestNodes(name) {
			const properties = this.properties[name];
			if (!properties) return;
			const values = properties.map((property) => property.value);
			let node;
			while (node = values.shift()) if (node.type === "Identifier" || node.type === "MemberExpression" || node.type === "ObjectPattern" || node.type === "ArrayPattern") yield {
				type: "pattern",
				node
			};
			else if (node.type === "AssignmentPattern") values.unshift(node.left);
			return properties ? properties.map((p) => p.value) : [];
		}
	}
	function getNestFromPattern(pattern) {
		if (pattern.type === "ObjectPattern") return extractFromObjectPattern(pattern);
		if (pattern.type === "Identifier") return extractFromIdentifier(pattern);
		if (pattern.type === "AssignmentPattern") return getNestFromPattern(pattern.left);
		return ANY;
	}
	/**
	* Extract the property references from Expression.
	*/
	function extractFromExpression(node, isWithinTemplate) {
		const ref = cacheForExpression.get(node);
		if (ref) return ref;
		cacheForExpression.set(node, ANY);
		const result = extractWithoutCache();
		cacheForExpression.set(node, result);
		return result;
		function extractWithoutCache() {
			const parent = node.parent;
			switch (parent.type) {
				case "AssignmentExpression": return !isWithinTemplate && parent.right === node && parent.operator === "=" ? extractFromPattern(parent.left) : NEVER;
				case "VariableDeclarator": return !isWithinTemplate && parent.init === node ? extractFromPattern(parent.id) : NEVER;
				case "MemberExpression":
					if (parent.object === node) {
						const name = import_utils.default.getStaticPropertyName(parent);
						if (name === "$props" && parent.parent.type === "MemberExpression") {
							const propName = import_utils.default.getStaticPropertyName(parent.parent);
							if (!propName) return unknownMemberAsUnreferenced ? NEVER : ANY;
							return new PropertyReferencesForMember(parent.parent, propName, isWithinTemplate);
						}
						if (name) return new PropertyReferencesForMember(parent, name, isWithinTemplate);
						return unknownMemberAsUnreferenced ? NEVER : ANY;
					}
					return NEVER;
				case "CallExpression": {
					const argIndex = parent.arguments.indexOf(node);
					return !isWithinTemplate && argIndex !== -1 ? extractFromCall(parent, argIndex) : NEVER;
				}
				case "ChainExpression": return extractFromExpression(parent, isWithinTemplate);
				case "ArrowFunctionExpression":
				case "VExpressionContainer":
				case "Property":
				case "ArrayExpression": return isMaybeExternallyUsed(parent) ? ANY : NEVER;
				case "ReturnStatement":
					if (returnAsUnreferenced) return NEVER;
					return isMaybeExternallyUsed(parent) ? ANY : NEVER;
			}
			return NEVER;
		}
		function isMaybeExternallyUsed(parentTarget) {
			if (parentTarget.type === "ReturnStatement" || parentTarget.type === "VExpressionContainer") return true;
			if (parentTarget.type === "ArrayExpression") return isMaybeExternallyUsed(parentTarget.parent);
			if (parentTarget.type === "Property") return isMaybeExternallyUsed(parentTarget.parent.parent);
			if (parentTarget.type === "ArrowFunctionExpression") return parentTarget.body === node;
			return false;
		}
	}
	/**
	* Extract the property references from one parameter of the function.
	*/
	function extractFromPattern(node) {
		const ref = cacheForPattern.get(node);
		if (ref) return ref;
		cacheForPattern.set(node, ANY);
		const result = extractWithoutCache();
		cacheForPattern.set(node, result);
		return result;
		function extractWithoutCache() {
			while (node.type === "AssignmentPattern") node = node.left;
			if (node.type === "RestElement" || node.type === "ArrayPattern") return NEVER;
			if (node.type === "ObjectPattern") return extractFromObjectPattern(node);
			if (node.type === "Identifier") return extractFromIdentifier(node);
			return NEVER;
		}
	}
	/**
	* Extract the property references from ObjectPattern.
	*/
	function extractFromObjectPattern(node) {
		const refs = new PropertyReferencesForObject();
		for (const prop of node.properties) if (prop.type === "Property") {
			const name = import_utils.default.getStaticPropertyName(prop);
			if (name) {
				refs.properties[name] ||= [];
				refs.properties[name].push(prop);
			} else return ANY;
		} else return ANY;
		return refs;
	}
	/**
	* Extract the property references from id.
	*/
	function extractFromIdentifier(node) {
		const variable = import_utils.default.findVariableByIdentifier(context, node);
		if (!variable) return NEVER;
		return mergePropertyReferences(variable.references.map((reference) => {
			const id = reference.identifier;
			return extractFromExpression(id, false);
		}));
	}
	/**
	* Extract the property references from call.
	*/
	function extractFromCall(node, argIndex) {
		if (node.callee.type !== "Identifier") return {
			hasProperty(_name, options) {
				return Boolean(options && options.unknownCallAsAny);
			},
			allProperties: () => /* @__PURE__ */ new Map(),
			getNest: () => ANY,
			getNestNodes: () => []
		};
		const fnNode = findFunction(context, node.callee);
		if (!fnNode) {
			if (argIndex === 0) {
				if (getToRefSet().toRefNodes.has(node)) return extractFromToRef(node);
				if (getToRefSet().toRefsNodes.has(node)) return extractFromToRefs(node);
			}
			return {
				hasProperty(_name, options) {
					return Boolean(options && options.unknownCallAsAny);
				},
				allProperties: () => /* @__PURE__ */ new Map(),
				getNest: () => ANY,
				getNestNodes: () => []
			};
		}
		return extractFromFunctionParam(fnNode, argIndex);
	}
	/**
	* Extract the property references from function param.
	*/
	function extractFromFunctionParam(node, argIndex) {
		let cacheForIndexes = cacheForFunction.get(node);
		if (!cacheForIndexes) {
			cacheForIndexes = /* @__PURE__ */ new Map();
			cacheForFunction.set(node, cacheForIndexes);
		}
		const ref = cacheForIndexes.get(argIndex);
		if (ref) return ref;
		cacheForIndexes.set(argIndex, NEVER);
		const arg = node.params[argIndex];
		if (!arg) return NEVER;
		const result = extractFromPattern(arg);
		cacheForIndexes.set(argIndex, result);
		return result;
	}
	/**
	* Extract the property references from path.
	*/
	function extractFromPath(pathString, node) {
		return extractFromSegments(pathString.split("."));
		function extractFromSegments(segments) {
			if (segments.length === 0) return ANY;
			const segmentName = segments[0];
			return {
				hasProperty: (name) => name === segmentName,
				allProperties: () => /* @__PURE__ */ new Map([[segmentName, { nodes: [node] }]]),
				getNest: (name) => name === segmentName ? extractFromSegments(segments.slice(1)) : NEVER,
				getNestNodes: () => []
			};
		}
	}
	/**
	* Extract the property references from name literal.
	*/
	function extractFromNameLiteral(node) {
		const referenceName = node.type === "Literal" || node.type === "TemplateLiteral" ? import_utils.default.getStringLiteralValue(node) : null;
		return referenceName ? {
			hasProperty: (name) => name === referenceName,
			allProperties: () => /* @__PURE__ */ new Map([[referenceName, { nodes: [node] }]]),
			getNest: (name) => name === referenceName ? ANY : NEVER,
			getNestNodes: () => []
		} : NEVER;
	}
	/**
	* Extract the property references from name.
	*/
	function extractFromName(referenceName, nameNode, getNest) {
		return {
			hasProperty: (name) => name === referenceName,
			allProperties: () => /* @__PURE__ */ new Map([[referenceName, { nodes: [nameNode] }]]),
			getNest: (name) => name === referenceName ? getNest ? getNest() : ANY : NEVER,
			getNestNodes: () => []
		};
	}
	/**
	* Extract the property references from toRef call.
	*/
	function extractFromToRef(node) {
		const nameNode = node.arguments[1];
		const refName = nameNode && (nameNode.type === "Literal" || nameNode.type === "TemplateLiteral") ? import_utils.default.getStringLiteralValue(nameNode) : null;
		if (!refName) return ANY;
		return extractFromName(refName, nameNode, () => extractFromExpression(node, false).getNest("value"));
	}
	/**
	* Extract the property references from toRefs call.
	*/
	function extractFromToRefs(node) {
		const base = extractFromExpression(node, false);
		return {
			hasProperty: (name, option) => base.hasProperty(name, option),
			allProperties: () => base.allProperties(),
			getNest: (name) => base.getNest(name).getNest("value"),
			getNestNodes: (name) => base.getNest(name).getNestNodes("value")
		};
	}
	/**
	* Extract the property references from VExpressionContainer.
	*/
	function extractFromVExpressionContainer(node, options) {
		const ignoreGlobals = options && options.ignoreGlobals;
		let shouldIgnoreRef = () => false;
		if (ignoreGlobals) {
			const globalScope = context.sourceCode.scopeManager.globalScope || context.sourceCode.scopeManager.scopes[0];
			shouldIgnoreRef = (name) => globalScope.set.has(name);
		}
		const references = [];
		for (const ref of node.references) {
			const id = ref.id;
			if (ref.variable != null || shouldIgnoreRef(id.name)) continue;
			if (isFunctionalTemplate) {
				if (id.name === "props") references.push(extractFromExpression(id, true));
			} else {
				const referenceId = id.name === "$props" && id.parent.type === "MemberExpression" && id.parent.property.type === "Identifier" ? id.parent.property : id;
				references.push(extractFromName(referenceId.name, referenceId, () => extractFromExpression(referenceId, true)));
			}
		}
		return mergePropertyReferences(references);
	}
	/**
	* Extract the property references from StyleVariablesContext.
	*/
	function extractFromStyleVariablesContext(ctx) {
		const references = [];
		for (const { id } of ctx.references) references.push(extractFromName(id.name, id, () => extractFromExpression(id, true)));
		return mergePropertyReferences(references);
	}
	return {
		extractFromExpression,
		extractFromPattern,
		extractFromFunctionParam,
		extractFromPath,
		extractFromName,
		extractFromNameLiteral,
		extractFromVExpressionContainer,
		extractFromStyleVariablesContext
	};
}
function mergePropertyReferences(references) {
	if (references.length === 0) return NEVER;
	if (references.length === 1) return references[0];
	return new PropertyReferencesForMerge(references);
}
/**
* Collects the property references for merge.
*/
var PropertyReferencesForMerge = class {
	references;
	constructor(references) {
		this.references = references;
	}
	hasProperty(name, option) {
		return this.references.some((ref) => ref.hasProperty(name, option));
	}
	allProperties() {
		const result = /* @__PURE__ */ new Map();
		for (const reference of this.references) for (const [name, { nodes }] of reference.allProperties()) {
			const r = result.get(name);
			if (r) r.nodes = [.../* @__PURE__ */ new Set([...r.nodes, ...nodes])];
			else result.set(name, { nodes: [...nodes] });
		}
		return result;
	}
	getNest(name) {
		const nest = [];
		for (const ref of this.references) if (ref.hasProperty(name)) nest.push(ref.getNest(name));
		return mergePropertyReferences(nest);
	}
	*getNestNodes(name) {
		for (const ref of this.references) if (ref.hasProperty(name)) yield* ref.getNestNodes(name);
	}
};
//#endregion
exports.definePropertyReferenceExtractor = definePropertyReferenceExtractor;
exports.mergePropertyReferences = mergePropertyReferences;
۴x-Aconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("./index.js");
const require_property_references = require("./property-references.js");
let _eslint_community_eslint_utils = require("@eslint-community/eslint-utils");
//#region lib/utils/ref-object-references.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
const REF_MACROS = [
	"$ref",
	"$computed",
	"$shallowRef",
	"$customRef",
	"$toRef",
	"$"
];
const cacheForRefObjectReferences = /* @__PURE__ */ new WeakMap();
const cacheForReactiveVariableReferences = /* @__PURE__ */ new WeakMap();
/**
* Iterate the call expressions that define the ref object.
*/
function* iterateDefineRefs(globalScope) {
	const tracker = new _eslint_community_eslint_utils.ReferenceTracker(globalScope);
	const reactiveReferences = import_utils.default.iterateReferencesTraceMap(tracker, {
		ref: { [_eslint_community_eslint_utils.ReferenceTracker.CALL]: true },
		computed: { [_eslint_community_eslint_utils.ReferenceTracker.CALL]: true },
		toRef: { [_eslint_community_eslint_utils.ReferenceTracker.CALL]: true },
		customRef: { [_eslint_community_eslint_utils.ReferenceTracker.CALL]: true },
		shallowRef: { [_eslint_community_eslint_utils.ReferenceTracker.CALL]: true },
		toRefs: { [_eslint_community_eslint_utils.ReferenceTracker.CALL]: true }
	});
	for (const { node, path } of reactiveReferences) yield {
		node,
		name: path.at(-1)
	};
}
/**
* Iterate the call expressions that defineModel() macro.
*/
function* iterateDefineModels(globalScope) {
	for (const { identifier } of iterateMacroReferences()) if (identifier.parent.type === "CallExpression" && identifier.parent.callee === identifier) yield { node: identifier.parent };
	/**
	* Iterate macro reference.
	*/
	function* iterateMacroReferences() {
		const variable = globalScope.set.get("defineModel");
		if (variable && variable.defs.length === 0) yield* variable.references;
		for (const ref of globalScope.through) if (ref.identifier.name === "defineModel") yield ref;
	}
}
/**
* Iterate the call expressions that define the reactive variables.
*/
function* iterateDefineReactiveVariables(globalScope) {
	for (const { identifier } of iterateRefMacroReferences()) if (identifier.parent.type === "CallExpression" && identifier.parent.callee === identifier) yield {
		node: identifier.parent,
		name: identifier.name
	};
	/**
	* Iterate ref macro reference.
	*/
	function* iterateRefMacroReferences() {
		yield* REF_MACROS.map((m) => globalScope.set.get(m)).filter(import_utils.default.isDef).flatMap((v) => v.references);
		for (const ref of globalScope.through) if (REF_MACROS.includes(ref.identifier.name)) yield ref;
	}
}
/**
*  Iterate the call expressions that the escape hint values.
*/
function* iterateEscapeHintValueRefs(globalScope) {
	for (const { identifier } of iterateEscapeHintReferences()) if (identifier.parent.type === "CallExpression" && identifier.parent.callee === identifier) yield identifier.parent;
	/**
	* Iterate escape hint reference.
	*/
	function* iterateEscapeHintReferences() {
		const escapeHint = globalScope.set.get("$$");
		if (escapeHint) yield* escapeHint.references;
		for (const ref of globalScope.through) if (ref.identifier.name === "$$") yield ref;
	}
}
/**
* Extract identifier from given pattern node.
*/
function* extractIdentifier(node) {
	switch (node.type) {
		case "Identifier":
			yield node;
			break;
		case "ObjectPattern":
			for (const property of node.properties) if (property.type === "Property") yield* extractIdentifier(property.value);
			else if (property.type === "RestElement") yield* extractIdentifier(property);
			break;
		case "ArrayPattern":
			for (const element of node.elements) if (element) yield* extractIdentifier(element);
			break;
		case "AssignmentPattern":
			yield* extractIdentifier(node.left);
			break;
		case "RestElement":
			yield* extractIdentifier(node.argument);
			break;
		case "MemberExpression": break;
	}
}
/**
* Iterate references of the given identifier.
*/
function* iterateIdentifierReferences(id, globalScope) {
	const variable = (0, _eslint_community_eslint_utils.findVariable)(globalScope, id);
	if (!variable) return;
	for (const reference of variable.references) yield reference;
}
function getGlobalScope(context) {
	const sourceCode = context.sourceCode;
	return sourceCode.scopeManager.globalScope || sourceCode.scopeManager.scopes[0];
}
var RefObjectReferenceExtractor = class {
	#processedIds = /* @__PURE__ */ new Set();
	context;
	references = /* @__PURE__ */ new Map();
	constructor(context) {
		this.context = context;
	}
	get(node) {
		return this.references.get(node) || null;
	}
	processDefineRef(node, method) {
		const parent = node.parent;
		let pattern = null;
		if (parent.type === "VariableDeclarator") pattern = parent.id;
		else if (parent.type === "AssignmentExpression" && parent.operator === "=") pattern = parent.left;
		else {
			if (method !== "toRefs") this.references.set(node, {
				type: "expression",
				node,
				method,
				define: node,
				defineChain: [node]
			});
			return;
		}
		const ctx = {
			method,
			define: node,
			defineChain: [node]
		};
		if (method === "toRefs") {
			const propertyReferences = require_property_references.definePropertyReferenceExtractor(this.context).extractFromPattern(pattern);
			for (const name of propertyReferences.allProperties().keys()) for (const nest of propertyReferences.getNestNodes(name)) if (nest.type === "expression") this.processMemberExpression(nest.node, ctx);
			else if (nest.type === "pattern") this.processPattern(nest.node, ctx);
		} else this.processPattern(pattern, ctx);
	}
	processDefineModel(node) {
		const parent = node.parent;
		let pattern = null;
		if (parent.type === "VariableDeclarator") pattern = parent.id;
		else if (parent.type === "AssignmentExpression" && parent.operator === "=") pattern = parent.left;
		else return;
		const ctx = {
			method: "defineModel",
			define: node,
			defineChain: [node]
		};
		if (pattern.type === "ArrayPattern" && pattern.elements[0]) pattern = pattern.elements[0];
		this.processPattern(pattern, ctx);
	}
	processExpression(node, ctx) {
		const parent = node.parent;
		if (parent.type === "AssignmentExpression") {
			if (parent.operator === "=" && parent.right === node) {
				this.processPattern(parent.left, {
					...ctx,
					defineChain: [node, ...ctx.defineChain]
				});
				return true;
			}
		} else if (parent.type === "VariableDeclarator" && parent.init === node) {
			this.processPattern(parent.id, {
				...ctx,
				defineChain: [node, ...ctx.defineChain]
			});
			return true;
		}
		return false;
	}
	processMemberExpression(node, ctx) {
		if (this.processExpression(node, ctx)) return;
		this.references.set(node, {
			type: "expression",
			node,
			...ctx
		});
	}
	processPattern(node, ctx) {
		switch (node.type) {
			case "Identifier":
				this.processIdentifierPattern(node, ctx);
				break;
			case "ArrayPattern":
			case "RestElement":
			case "MemberExpression": return;
			case "ObjectPattern":
				this.references.set(node, {
					type: "pattern",
					node,
					...ctx
				});
				return;
			case "AssignmentPattern":
				this.processPattern(node.left, ctx);
				return;
		}
	}
	processIdentifierPattern(node, ctx) {
		if (this.#processedIds.has(node)) return;
		this.#processedIds.add(node);
		const identifierReferences = iterateIdentifierReferences(node, getGlobalScope(this.context));
		for (const reference of identifierReferences) {
			const def = reference.resolved && reference.resolved.defs.length === 1 && reference.resolved.defs[0].type === "Variable" ? reference.resolved.defs[0] : null;
			if (def && def.name === reference.identifier) continue;
			if (reference.isRead() && this.processExpression(reference.identifier, ctx)) continue;
			this.references.set(reference.identifier, {
				type: reference.isWrite() ? "pattern" : "expression",
				node: reference.identifier,
				variableDeclarator: def ? def.node : null,
				variableDeclaration: def ? def.parent : null,
				...ctx
			});
		}
	}
};
/**
* Extracts references of all ref objects.
* @param context The rule context.
*/
function extractRefObjectReferences(context) {
	const sourceCode = context.sourceCode;
	const cachedReferences = cacheForRefObjectReferences.get(sourceCode.ast);
	if (cachedReferences) return cachedReferences;
	const references = new RefObjectReferenceExtractor(context);
	const globalScope = getGlobalScope(context);
	for (const { node, name } of iterateDefineRefs(globalScope)) references.processDefineRef(node, name);
	for (const { node } of iterateDefineModels(globalScope)) references.processDefineModel(node);
	cacheForRefObjectReferences.set(sourceCode.ast, references);
	return references;
}
var ReactiveVariableReferenceExtractor = class {
	#processedIds;
	#escapeHintValueRefs;
	context;
	references;
	constructor(context) {
		this.context = context;
		this.references = /* @__PURE__ */ new Map();
		this.#processedIds = /* @__PURE__ */ new Set();
		this.#escapeHintValueRefs = new Set(iterateEscapeHintValueRefs(getGlobalScope(context)));
	}
	get(node) {
		return this.references.get(node) || null;
	}
	processDefineReactiveVariable(node, method) {
		const parent = node.parent;
		if (parent.type !== "VariableDeclarator") return;
		const pattern = parent.id;
		if (method === "$") for (const id of extractIdentifier(pattern)) this.processIdentifierPattern(id, method, node);
		else if (pattern.type === "Identifier") this.processIdentifierPattern(pattern, method, node);
	}
	processIdentifierPattern(node, method, define) {
		if (this.#processedIds.has(node)) return;
		this.#processedIds.add(node);
		const identifierReferences = iterateIdentifierReferences(node, getGlobalScope(this.context));
		for (const reference of identifierReferences) {
			const def = reference.resolved && reference.resolved.defs.length === 1 && reference.resolved.defs[0].type === "Variable" ? reference.resolved.defs[0] : null;
			if (!def || def.name === reference.identifier) continue;
			this.references.set(reference.identifier, {
				node: reference.identifier,
				escape: this.withinEscapeHint(reference.identifier),
				method,
				define,
				variableDeclaration: def.parent
			});
		}
	}
	/**
	* Checks whether the given identifier node within the escape hints (`$$()`) or not.
	*/
	withinEscapeHint(node) {
		let target = node;
		let parent = target.parent;
		while (parent) {
			if (parent.type === "CallExpression") return parent.arguments.includes(target) && this.#escapeHintValueRefs.has(parent);
			if (parent.type === "Property" && parent.value === target || parent.type === "ObjectExpression" && parent.properties.includes(target) || parent.type === "ArrayExpression" || parent.type === "SpreadElement") {
				target = parent;
				parent = target.parent;
			} else return false;
		}
		return false;
	}
};
/**
* Extracts references of all reactive variables.
*/
function extractReactiveVariableReferences(context) {
	const sourceCode = context.sourceCode;
	const cachedReferences = cacheForReactiveVariableReferences.get(sourceCode.ast);
	if (cachedReferences) return cachedReferences;
	const references = new ReactiveVariableReferenceExtractor(context);
	const reactiveVariables = iterateDefineReactiveVariables(getGlobalScope(context));
	for (const { node, name } of reactiveVariables) references.processDefineReactiveVariable(node, name);
	cacheForReactiveVariableReferences.set(sourceCode.ast, references);
	return references;
}
//#endregion
exports.extractReactiveVariableReferences = extractReactiveVariableReferences;
exports.extractRefObjectReferences = extractRefObjectReferences;
exports.iterateDefineRefs = iterateDefineRefs;
zuxR//#region lib/utils/regexp.ts
const RE_REGEXP_CHAR = /[\\^$.*+?()[\]{}|]/gu;
const RE_HAS_REGEXP_CHAR = new RegExp(RE_REGEXP_CHAR.source);
const RE_REGEXP_STR = /^\/(.+)\/(.*)$/u;
/**
* Escapes the `RegExp` special characters "^", "$", "\", ".", "*", "+",
* "?", "(", ")", "[", "]", "{", "}", and "|" in `string`.
*/
function escape(string) {
	return string && RE_HAS_REGEXP_CHAR.test(string) ? string.replaceAll(RE_REGEXP_CHAR, String.raw`\$&`) : string;
}
/**
* Convert a string to the `RegExp`.
* Normal strings (e.g. `"foo"`) is converted to `/^foo$/` of `RegExp`.
* Strings like `"/^foo/i"` are converted to `/^foo/i` of `RegExp`.
*/
function toRegExp(string, flags = {}) {
	const parts = RE_REGEXP_STR.exec(string);
	const { add: forceAddFlags = "", remove: forceRemoveFlags = "" } = typeof flags === "object" ? flags : {};
	if (parts) return new RegExp(parts[1], parts[2].replaceAll(new RegExp(`[${forceAddFlags}${forceRemoveFlags}]`, "g"), "") + forceAddFlags);
	return new RegExp(`^${escape(string)}$`, forceAddFlags);
}
/**
* Checks whether given string is regexp string
*/
function isRegExp(string) {
	return RE_REGEXP_STR.test(string);
}
/**
* Converts an array of strings or regular expression strings to a singular function to match any of them.
* This function converts each string to a `RegExp` and returns a function that checks all of them.
*/
function toRegExpGroupMatcher(patterns = []) {
	if (patterns.length === 0) return () => false;
	const regexps = patterns.map((pattern) => toRegExp(pattern, { remove: "g" }));
	if (regexps.length === 1) return (...toCheck) => toCheck.some((str) => regexps[0].test(str));
	return (...toCheck) => regexps.some((regexp) => toCheck.some((str) => regexp.test(str)));
}
//#endregion
exports.escape = escape;
exports.isRegExp = isRegExp;
exports.toRegExp = toRegExp;
exports.toRegExpGroupMatcher = toRegExpGroupMatcher;
fo>x//#region lib/utils/scope.js
var require_scope = /* @__PURE__ */ require("../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	module.exports = { getScope };
	/**
	* Gets the scope for the current node
	* @param {RuleContext} context The rule context
	* @param {ESNode} currentNode The node to get the scope of
	* @returns { import('eslint').Scope.Scope } The scope information for this node
	*/
	function getScope(context, currentNode) {
		const isInner = currentNode.type !== "Program";
		const scopeManager = context.sourceCode.scopeManager;
		/** @type {ESNode | null} */
		let node = currentNode;
		for (; node; node = node.parent) {
			const scope = scopeManager.acquire(node, isInner);
			if (scope) {
				if (scope.type === "function-expression-name") return scope.childScopes[0];
				return scope;
			}
		}
		return scopeManager.scopes[0];
	}
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_scope();
	}
});
Ox.const require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_index = require("./index.js");
let postcss_selector_parser = require("postcss-selector-parser");
postcss_selector_parser = require_runtime.__toESM(postcss_selector_parser);
let nth_check = require("nth-check");
nth_check = require_runtime.__toESM(nth_check);
//#region lib/utils/selector.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
/**
* Parses CSS selectors and returns an object with a function that tests VElement.
*/
function parseSelector(selector, context) {
	let astSelector;
	try {
		astSelector = (0, postcss_selector_parser.default)().astSync(selector);
	} catch {
		context.report({
			loc: {
				line: 0,
				column: 0
			},
			message: `Cannot parse selector: ${selector}.`
		});
		return { test: () => false };
	}
	try {
		const test = selectorsToVElementMatcher(astSelector.nodes);
		return { test(element) {
			return test(element, null);
		} };
	} catch (error) {
		if (error instanceof SelectorError) {
			context.report({
				loc: {
					line: 0,
					column: 0
				},
				message: error.message
			});
			return { test: () => false };
		}
		throw error;
	}
}
var SelectorError = class extends Error {};
/**
* Convert nodes to VElementMatcher
*/
function selectorsToVElementMatcher(selectorNodes) {
	const selectors = selectorNodes.map((n) => selectorToVElementMatcher(cleanSelectorChildren(n)));
	return (element, subject) => selectors.some((sel) => sel(element, subject));
}
function isDescendantCombinator(node) {
	return Boolean(node && node.type === "combinator" && !node.value.trim());
}
/**
* Clean and get the selector child nodes.
*/
function cleanSelectorChildren(selector) {
	const nodes = [];
	let last = null;
	for (const node of selector.nodes) {
		if (node.type === "root") throw new SelectorError("Unexpected state type=root");
		if (node.type === "comment") continue;
		if ((last == null || last.type === "combinator") && isDescendantCombinator(node)) continue;
		if (isDescendantCombinator(last) && node.type === "combinator") nodes.pop();
		nodes.push(node);
		last = node;
	}
	if (isDescendantCombinator(last)) nodes.pop();
	return nodes;
}
/**
* Convert Selector child nodes to VElementMatcher
*/
function selectorToVElementMatcher(selectorChildren) {
	const nodes = [...selectorChildren];
	let node = nodes.shift();
	let result = null;
	while (node) {
		if (node.type === "combinator") {
			const combinator = node.value;
			node = nodes.shift();
			if (!node) throw new SelectorError(`Expected selector after '${combinator}'.`);
			if (node.type === "combinator") throw new SelectorError(`Unexpected combinator '${node.value}'.`);
			const right = nodeToVElementMatcher(node);
			result = combination(result || ((element, subject) => element === subject), combinator, right);
		} else {
			const sel = nodeToVElementMatcher(node);
			result = result ? compound(result, sel) : sel;
		}
		node = nodes.shift();
	}
	if (!result) throw new SelectorError(`Unexpected empty selector.`);
	return result;
}
function combination(left, combinator, right) {
	switch (combinator.trim()) {
		case "": return (element, subject) => {
			if (right(element, null)) {
				let parent = element.parent;
				while (parent.type === "VElement") {
					if (left(parent, subject)) return true;
					parent = parent.parent;
				}
			}
			return false;
		};
		case ">": return (element, subject) => {
			if (right(element, null)) {
				const parent = element.parent;
				if (parent.type === "VElement") return left(parent, subject);
			}
			return false;
		};
		case "+": return (element, subject) => {
			if (right(element, null)) {
				const before = getBeforeElement(element);
				if (before) return left(before, subject);
			}
			return false;
		};
		case "~": return (element, subject) => {
			if (right(element, null)) {
				for (const before of getBeforeElements(element)) if (left(before, subject)) return true;
			}
			return false;
		};
		default: throw new SelectorError(`Unknown combinator: ${combinator}.`);
	}
}
/**
* Convert node to VElementMatcher
*/
function nodeToVElementMatcher(selector) {
	switch (selector.type) {
		case "attribute": return attributeNodeToVElementMatcher(selector);
		case "class": return classNameNodeToVElementMatcher(selector);
		case "id": return identifierNodeToVElementMatcher(selector);
		case "tag": return tagNodeToVElementMatcher(selector);
		case "universal": return universalNodeToVElementMatcher(selector);
		case "pseudo": return pseudoNodeToVElementMatcher(selector);
		case "nesting": throw new SelectorError("Unsupported nesting selector.");
		case "string": throw new SelectorError(`Unknown selector: ${selector.value}.`);
		default: throw new SelectorError(`Unknown selector: ${selector.value}.`);
	}
}
/**
* Convert Attribute node to VElementMatcher
*/
function attributeNodeToVElementMatcher(selector) {
	const key = selector.attribute;
	if (!selector.operator) return (element) => getAttributeValue(element, key) != null;
	const value = selector.value || "";
	switch (selector.operator) {
		case "=": return buildVElementMatcher(value, (attr, val) => attr === val);
		case "~=": return buildVElementMatcher(value, (attr, val) => attr.split(/\s+/gu).includes(val));
		case "|=": return buildVElementMatcher(value, (attr, val) => attr === val || attr.startsWith(`${val}-`));
		case "^=": return buildVElementMatcher(value, (attr, val) => attr.startsWith(val));
		case "$=": return buildVElementMatcher(value, (attr, val) => attr.endsWith(val));
		case "*=": return buildVElementMatcher(value, (attr, val) => attr.includes(val));
		default: throw new SelectorError(`Unsupported operator: ${selector.operator}.`);
	}
	function buildVElementMatcher(selectorValue, test) {
		const val = selector.insensitive ? selectorValue.toLowerCase() : selectorValue;
		return (element) => {
			const attrValue = getAttributeValue(element, key);
			if (attrValue == null) return false;
			return test(selector.insensitive ? attrValue.toLowerCase() : attrValue, val);
		};
	}
}
/**
* Convert ClassName node to VElementMatcher
*/
function classNameNodeToVElementMatcher(selector) {
	const className = selector.value;
	return (element) => {
		const attrValue = getAttributeValue(element, "class");
		if (attrValue == null) return false;
		return attrValue.split(/\s+/gu).includes(className);
	};
}
/**
* Convert Identifier node to VElementMatcher
*/
function identifierNodeToVElementMatcher(selector) {
	const id = selector.value;
	return (element) => {
		const attrValue = getAttributeValue(element, "id");
		if (attrValue == null) return false;
		return attrValue === id;
	};
}
/**
* Convert Tag node to VElementMatcher
*/
function tagNodeToVElementMatcher(selector) {
	const name = selector.value;
	return (element) => element.rawName === name;
}
/**
* Convert Universal node to VElementMatcher
*/
function universalNodeToVElementMatcher(_selector) {
	return () => true;
}
/**
* Convert Pseudo node to VElementMatcher
*/
function pseudoNodeToVElementMatcher(selector) {
	const pseudo = selector.value;
	switch (pseudo) {
		case ":not": {
			const selectors = selectorsToVElementMatcher(selector.nodes);
			return (element, subject) => !selectors(element, subject);
		}
		case ":is":
		case ":where": return selectorsToVElementMatcher(selector.nodes);
		case ":has": return pseudoHasSelectorsToVElementMatcher(selector.nodes);
		case ":empty": return (element) => element.children.every((child) => child.type === "VText" && !child.value.trim());
		case ":nth-child": return buildPseudoNthVElementMatcher(parseNth(selector));
		case ":nth-last-child": {
			const nth = parseNth(selector);
			return buildPseudoNthVElementMatcher((index, length) => nth(length - index - 1));
		}
		case ":first-child": return buildPseudoNthVElementMatcher((index) => index === 0);
		case ":last-child": return buildPseudoNthVElementMatcher((index, length) => index === length - 1);
		case ":only-child": return buildPseudoNthVElementMatcher((index, length) => index === 0 && length === 1);
		case ":nth-of-type": return buildPseudoNthOfTypeVElementMatcher(parseNth(selector));
		case ":nth-last-of-type": {
			const nth = parseNth(selector);
			return buildPseudoNthOfTypeVElementMatcher((index, length) => nth(length - index - 1));
		}
		case ":first-of-type": return buildPseudoNthOfTypeVElementMatcher((index) => index === 0);
		case ":last-of-type": return buildPseudoNthOfTypeVElementMatcher((index, length) => index === length - 1);
		case ":only-of-type": return buildPseudoNthOfTypeVElementMatcher((index, length) => index === 0 && length === 1);
		default: throw new SelectorError(`Unsupported pseudo selector: ${pseudo}.`);
	}
}
/**
* Convert :has() selector nodes to VElementMatcher
*/
function pseudoHasSelectorsToVElementMatcher(selectorNodes) {
	const selectors = selectorNodes.map((n) => pseudoHasSelectorToVElementMatcher(n));
	return (element, subject) => selectors.some((sel) => sel(element, subject));
}
/**
* Convert :has() selector node to VElementMatcher
*/
function pseudoHasSelectorToVElementMatcher(selector) {
	const nodes = cleanSelectorChildren(selector);
	const selectors = selectorToVElementMatcher(nodes);
	const firstNode = nodes[0];
	if (firstNode.type === "combinator" && (firstNode.value === "+" || firstNode.value === "~")) return buildVElementMatcher(selectors, (element) => getAfterElements(element));
	return buildVElementMatcher(selectors, (element) => element.children.filter(import_utils.default.isVElement));
}
function buildVElementMatcher(selectors, getStartElements) {
	return (element) => {
		const elements = [...getStartElements(element)];
		let curr;
		while (curr = elements.shift()) {
			const el = curr;
			if (selectors(el, element)) return true;
			elements.push(...el.children.filter(import_utils.default.isVElement));
		}
		return false;
	};
}
/**
* Parse <nth>
*/
function parseNth(pseudoNode) {
	const argumentsText = pseudoNode.toString().slice(pseudoNode.value.length).toLowerCase();
	const openParenIndex = argumentsText.indexOf("(");
	const closeParenIndex = argumentsText.lastIndexOf(")");
	if (openParenIndex === -1 || closeParenIndex === -1) throw new SelectorError(`Cannot parse An+B micro syntax (:nth-xxx() argument): ${argumentsText}.`);
	const argument = argumentsText.slice(openParenIndex + 1, closeParenIndex).trim();
	try {
		return (0, nth_check.default)(argument);
	} catch {
		throw new SelectorError(`Cannot parse An+B micro syntax (:nth-xxx() argument): '${argument}'.`);
	}
}
/**
* Build VElementMatcher for :nth-xxx()
*/
function buildPseudoNthVElementMatcher(testIndex) {
	return (element) => {
		const elements = element.parent.children.filter(import_utils.default.isVElement);
		return testIndex(elements.indexOf(element), elements.length);
	};
}
/**
* Build VElementMatcher for :nth-xxx-of-type()
*/
function buildPseudoNthOfTypeVElementMatcher(testIndex) {
	return (element) => {
		const elements = element.parent.children.filter((e) => import_utils.default.isVElement(e) && e.rawName === element.rawName);
		return testIndex(elements.indexOf(element), elements.length);
	};
}
function getBeforeElement(element) {
	return getBeforeElements(element).pop() || null;
}
function getBeforeElements(element) {
	const parent = element.parent;
	const index = parent.children.indexOf(element);
	return parent.children.slice(0, index).filter(import_utils.default.isVElement);
}
function getAfterElements(element) {
	const parent = element.parent;
	const index = parent.children.indexOf(element);
	return parent.children.slice(index + 1).filter(import_utils.default.isVElement);
}
function compound(a, b) {
	return (element, subject) => a(element, subject) && b(element, subject);
}
/**
* Get attribute value from given element.
*/
function getAttributeValue(element, attribute) {
	const attr = import_utils.default.getAttribute(element, attribute);
	if (attr) return attr.value && attr.value.value || "";
	return null;
}
//#endregion
exports.parseSelector = parseSelector;
\枤x$ 100644 index.js l,ԥ*ŜM zz/|Yxkconst require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_index = require("../index.js");
//#region lib/utils/style-variables/index.ts
var import_utils = /* @__PURE__ */ require_runtime.__toESM(require_index.default);
var StyleVariablesContext = class {
	context;
	styles;
	references = [];
	vBinds = [];
	constructor(context, styles) {
		this.context = context;
		this.styles = styles;
		for (const style of styles) {
			const containers = style.children.filter((node) => node.type === "VExpressionContainer");
			for (const node of containers) {
				this.vBinds.push(node);
				for (const ref of node.references) if (ref.variable == null) this.references.push(ref);
			}
		}
	}
};
const cache = /* @__PURE__ */ new WeakMap();
/**
* Get the style vars context
*/
function getStyleVariablesContext(context) {
	const sourceCode = context.sourceCode;
	const df = sourceCode.parserServices.getDocumentFragment && sourceCode.parserServices.getDocumentFragment();
	if (!df) return null;
	const styles = df.children.filter((e) => import_utils.default.isVElement(e) && e.name === "style");
	if (styles.length === 0) return null;
	let ctx = cache.get(styles[0]);
	if (ctx) return ctx;
	ctx = new StyleVariablesContext(context, styles);
	cache.set(styles[0], ctx);
	return ctx;
}
//#endregion
exports.StyleVariablesContext = StyleVariablesContext;
exports.getStyleVariablesContext = getStyleVariablesContext;
/x
s//#region lib/utils/svg-attributes-weird-case.json
var svg_attributes_weird_case_default = [
	"accent-height",
	"alignment-baseline",
	"arabic-form",
	"attributeName",
	"attributeType",
	"baseFrequency",
	"baseline-shift",
	"baseProfile",
	"calcMode",
	"cap-height",
	"clipPathUnits",
	"clip-path",
	"clip-rule",
	"color-interpolation",
	"color-interpolation-filters",
	"color-profile",
	"color-rendering",
	"contentScriptType",
	"contentStyleType",
	"diffuseConstant",
	"dominant-baseline",
	"edgeMode",
	"enable-background",
	"externalResourcesRequired",
	"fill-opacity",
	"fill-rule",
	"filterRes",
	"filterUnits",
	"flood-color",
	"flood-opacity",
	"font-family",
	"font-size",
	"font-size-adjust",
	"font-stretch",
	"font-style",
	"font-variant",
	"font-weight",
	"glyph-name",
	"glyph-orientation-horizontal",
	"glyph-orientation-vertical",
	"glyphRef",
	"gradientTransform",
	"gradientUnits",
	"horiz-adv-x",
	"horiz-origin-x",
	"image-rendering",
	"kernelMatrix",
	"kernelUnitLength",
	"keyPoints",
	"keySplines",
	"keyTimes",
	"lengthAdjust",
	"letter-spacing",
	"lighting-color",
	"limitingConeAngle",
	"marker-end",
	"marker-mid",
	"marker-start",
	"markerHeight",
	"markerUnits",
	"markerWidth",
	"maskContentUnits",
	"maskUnits",
	"numOctaves",
	"overline-position",
	"overline-thickness",
	"panose-1",
	"paint-order",
	"pathLength",
	"patternContentUnits",
	"patternTransform",
	"patternUnits",
	"pointer-events",
	"pointsAtX",
	"pointsAtY",
	"pointsAtZ",
	"preserveAlpha",
	"preserveAspectRatio",
	"primitiveUnits",
	"referrerPolicy",
	"refX",
	"refY",
	"rendering-intent",
	"repeatCount",
	"repeatDur",
	"requiredExtensions",
	"requiredFeatures",
	"shape-rendering",
	"specularConstant",
	"specularExponent",
	"spreadMethod",
	"startOffset",
	"stdDeviation",
	"stitchTiles",
	"stop-color",
	"stop-opacity",
	"strikethrough-position",
	"strikethrough-thickness",
	"stroke-dasharray",
	"stroke-dashoffset",
	"stroke-linecap",
	"stroke-linejoin",
	"stroke-miterlimit",
	"stroke-opacity",
	"stroke-width",
	"surfaceScale",
	"systemLanguage",
	"tableValues",
	"targetX",
	"targetY",
	"text-anchor",
	"text-decoration",
	"text-rendering",
	"textLength",
	"transform-origin",
	"underline-position",
	"underline-thickness",
	"unicode-bidi",
	"unicode-range",
	"units-per-em",
	"v-alphabetic",
	"v-hanging",
	"v-ideographic",
	"v-mathematical",
	"vector-effect",
	"vert-adv-y",
	"vert-origin-x",
	"vert-origin-y",
	"viewBox",
	"viewTarget",
	"word-spacing",
	"writing-mode",
	"x-height",
	"xChannelSelector",
	"yChannelSelector",
	"zoomAndPan"
];
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return svg_attributes_weird_case_default;
	}
});
]FmLx://#region lib/utils/svg-elements.json
var require_svg_elements = /* @__PURE__ */ require("../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	module.exports = [
		"a",
		"animate",
		"animateMotion",
		"animateTransform",
		"circle",
		"clipPath",
		"defs",
		"desc",
		"ellipse",
		"feBlend",
		"feColorMatrix",
		"feComponentTransfer",
		"feComposite",
		"feConvolveMatrix",
		"feDiffuseLighting",
		"feDisplacementMap",
		"feDistantLight",
		"feDropShadow",
		"feFlood",
		"feFuncA",
		"feFuncB",
		"feFuncG",
		"feFuncR",
		"feGaussianBlur",
		"feImage",
		"feMerge",
		"feMergeNode",
		"feMorphology",
		"feOffset",
		"fePointLight",
		"feSpecularLighting",
		"feSpotLight",
		"feTile",
		"feTurbulence",
		"filter",
		"foreignObject",
		"g",
		"image",
		"line",
		"linearGradient",
		"marker",
		"mask",
		"metadata",
		"mpath",
		"path",
		"pattern",
		"polygon",
		"polyline",
		"radialGradient",
		"rect",
		"script",
		"set",
		"stop",
		"style",
		"svg",
		"switch",
		"symbol",
		"text",
		"textPath",
		"title",
		"tspan",
		"use",
		"view"
	];
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_svg_elements();
	}
});
Sc	x f100644 index.js UAMif1KeB".100644 ts-ast.js {Lvps100644 ts-types.js [lAI9&\Eϩ100644 typescript.js 
M"B* zH2>lxwconst require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_ts_types$1 = require("./ts-types.js");
const require_ts_ast$1 = require("./ts-ast.js");
//#region lib/utils/ts-utils/index.js
var require_ts_utils = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { isTypeNode, extractRuntimeProps, isTSTypeLiteral, isTSTypeLiteralOrTSFunctionType, extractRuntimeEmits, flattenTypeNodes, isTSInterfaceBody, extractRuntimeSlots } = require_ts_ast$1.default;
	const { getComponentPropsFromTypeDefineTypes, getComponentEmitsFromTypeDefineTypes, getComponentSlotsFromTypeDefineTypes, isExhaustiveSwitch } = require_ts_types$1.default;
	/**
	* @typedef {import('@typescript-eslint/types').TSESTree.TypeNode} TSESTreeTypeNode
	*/
	/**
	* @typedef {import('../index').ComponentTypeProp} ComponentTypeProp
	* @typedef {import('../index').ComponentInferTypeProp} ComponentInferTypeProp
	* @typedef {import('../index').ComponentUnknownProp} ComponentUnknownProp
	* @typedef {import('../index').ComponentTypeEmit} ComponentTypeEmit
	* @typedef {import('../index').ComponentInferTypeEmit} ComponentInferTypeEmit
	* @typedef {import('../index').ComponentUnknownEmit} ComponentUnknownEmit
	* @typedef {import('../index').ComponentTypeSlot} ComponentTypeSlot
	* @typedef {import('../index').ComponentInferTypeSlot} ComponentInferTypeSlot
	* @typedef {import('../index').ComponentUnknownSlot} ComponentUnknownSlot
	*/
	module.exports = {
		isTypeNode,
		isExhaustiveSwitch,
		getComponentPropsFromTypeDefine,
		getComponentEmitsFromTypeDefine,
		getComponentSlotsFromTypeDefine
	};
	/**
	* Get all props by looking at all component's properties
	* @param {RuleContext} context The ESLint rule context object.
	* @param {TypeNode} propsNode Type with props definition
	* @return {(ComponentTypeProp|ComponentInferTypeProp|ComponentUnknownProp)[]} Array of component props
	*/
	function getComponentPropsFromTypeDefine(context, propsNode) {
		/** @type {(ComponentTypeProp|ComponentInferTypeProp|ComponentUnknownProp)[]} */
		const result = [];
		for (const defNode of flattenTypeNodes(context, propsNode)) if (isTSInterfaceBody(defNode) || isTSTypeLiteral(defNode)) result.push(...extractRuntimeProps(context, defNode));
		else result.push(...getComponentPropsFromTypeDefineTypes(context, defNode));
		return result;
	}
	/**
	* Get all emits by looking at all component's properties
	* @param {RuleContext} context The ESLint rule context object.
	* @param {TypeNode} emitsNode Type with emits definition
	* @return {(ComponentTypeEmit|ComponentInferTypeEmit|ComponentUnknownEmit)[]} Array of component emits
	*/
	function getComponentEmitsFromTypeDefine(context, emitsNode) {
		/** @type {(ComponentTypeEmit|ComponentInferTypeEmit|ComponentUnknownEmit)[]} */
		const result = [];
		for (const defNode of flattenTypeNodes(context, emitsNode)) if (isTSInterfaceBody(defNode) || isTSTypeLiteralOrTSFunctionType(defNode)) result.push(...extractRuntimeEmits(defNode));
		else result.push(...getComponentEmitsFromTypeDefineTypes(context, defNode));
		return result;
	}
	/**
	* Get all slots by looking at all component's properties
	* @param {RuleContext} context The ESLint rule context object.
	* @param {TypeNode} slotsNode Type with slots definition
	* @return {(ComponentTypeSlot|ComponentInferTypeSlot|ComponentUnknownSlot)[]} Array of component slots
	*/
	function getComponentSlotsFromTypeDefine(context, slotsNode) {
		/** @type {(ComponentTypeSlot|ComponentInferTypeSlot|ComponentUnknownSlot)[]} */
		const result = [];
		for (const defNode of flattenTypeNodes(context, slotsNode)) if (isTSInterfaceBody(defNode) || isTSTypeLiteral(defNode)) result.push(...extractRuntimeSlots(defNode));
		else result.push(...getComponentSlotsFromTypeDefineTypes(context, defNode));
		return result;
	}
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_ts_utils();
	}
});
wx.;const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_scope$1 = require("../scope.js");
const require_ts_types$1 = require("./ts-types.js");
//#region lib/utils/ts-utils/ts-ast.js
var require_ts_ast = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { getScope } = require_scope$1.default;
	const { findVariable } = require("@eslint-community/eslint-utils");
	const { inferRuntimeTypeFromTypeNode } = require_ts_types$1.default;
	/**
	* @typedef {import('@typescript-eslint/types').TSESTree.TypeNode} TSESTreeTypeNode
	* @typedef {import('@typescript-eslint/types').TSESTree.TSInterfaceBody} TSESTreeTSInterfaceBody
	* @typedef {import('@typescript-eslint/types').TSESTree.TSTypeLiteral} TSESTreeTSTypeLiteral
	* @typedef {import('@typescript-eslint/types').TSESTree.TSFunctionType} TSESTreeTSFunctionType
	* @typedef {import('@typescript-eslint/types').TSESTree.Parameter} TSESTreeParameter
	* @typedef {import('@typescript-eslint/types').TSESTree.Node} TSESTreeNode
	*
	*/
	/**
	* @typedef {import('../index').ComponentTypeProp} ComponentTypeProp
	* @typedef {import('../index').ComponentUnknownProp} ComponentUnknownProp
	* @typedef {import('../index').ComponentTypeEmit} ComponentTypeEmit
	* @typedef {import('../index').ComponentUnknownEmit} ComponentUnknownEmit
	* @typedef {import('../index').ComponentTypeSlot} ComponentTypeSlot
	* @typedef {import('../index').ComponentUnknownSlot} ComponentUnknownSlot
	*/
	/**
	* All type node types. Typed as `Record<TypeNode['type'], true>` so that the
	* list stays exhaustive: adding or removing a member of `TypeNode['type']`
	* becomes a compile-time error here.
	* @type {Record<TypeNode['type'], true>}
	*/
	const TYPE_NODE_TYPES = {
		TSAbstractKeyword: true,
		TSAnyKeyword: true,
		TSAsyncKeyword: true,
		TSArrayType: true,
		TSBigIntKeyword: true,
		TSBooleanKeyword: true,
		TSConditionalType: true,
		TSConstructorType: true,
		TSDeclareKeyword: true,
		TSExportKeyword: true,
		TSFunctionType: true,
		TSImportType: true,
		TSIndexedAccessType: true,
		TSInferType: true,
		TSIntersectionType: true,
		TSIntrinsicKeyword: true,
		TSLiteralType: true,
		TSMappedType: true,
		TSNamedTupleMember: true,
		TSNeverKeyword: true,
		TSNullKeyword: true,
		TSNumberKeyword: true,
		TSObjectKeyword: true,
		TSOptionalType: true,
		TSQualifiedName: true,
		TSPrivateKeyword: true,
		TSProtectedKeyword: true,
		TSPublicKeyword: true,
		TSReadonlyKeyword: true,
		TSRestType: true,
		TSStaticKeyword: true,
		TSStringKeyword: true,
		TSSymbolKeyword: true,
		TSTemplateLiteralType: true,
		TSThisType: true,
		TSTupleType: true,
		TSTypeLiteral: true,
		TSTypeOperator: true,
		TSTypePredicate: true,
		TSTypeQuery: true,
		TSTypeReference: true,
		TSUndefinedKeyword: true,
		TSUnionType: true,
		TSUnknownKeyword: true,
		TSVoidKeyword: true
	};
	module.exports = {
		isTypeNode,
		flattenTypeNodes,
		isTSInterfaceBody,
		isTSTypeLiteral,
		isTSTypeLiteralOrTSFunctionType,
		extractRuntimeProps,
		extractRuntimeEmits,
		extractRuntimeSlots
	};
	/**
	* @param {ASTNode} node
	* @returns {node is TypeNode}
	*/
	function isTypeNode(node) {
		return TYPE_NODE_TYPES[node.type] === true;
	}
	/**
	* @param {TSESTreeTypeNode|TSESTreeTSInterfaceBody} node
	* @returns {node is TSESTreeTSInterfaceBody}
	*/
	function isTSInterfaceBody(node) {
		return node.type === "TSInterfaceBody";
	}
	/**
	* @param {TSESTreeTypeNode} node
	* @returns {node is TSESTreeTSTypeLiteral}
	*/
	function isTSTypeLiteral(node) {
		return node.type === "TSTypeLiteral";
	}
	/**
	* @param {TSESTreeTypeNode} node
	* @returns {node is TSESTreeTSFunctionType}
	*/
	function isTSFunctionType(node) {
		return node.type === "TSFunctionType";
	}
	/**
	* @param {TSESTreeTypeNode} node
	* @returns {node is TSESTreeTSTypeLiteral | TSESTreeTSFunctionType}
	*/
	function isTSTypeLiteralOrTSFunctionType(node) {
		return isTSTypeLiteral(node) || isTSFunctionType(node);
	}
	/**
	* @see https://github.com/vuejs/vue-next/blob/253ca2729d808fc051215876aa4af986e4caa43c/packages/compiler-sfc/src/compileScript.ts#L1512
	* @param {RuleContext} context The ESLint rule context object.
	* @param {TSESTreeTSTypeLiteral | TSESTreeTSInterfaceBody} node
	* @returns {IterableIterator<ComponentTypeProp | ComponentUnknownProp>}
	*/
	function* extractRuntimeProps(context, node) {
		const members = node.type === "TSTypeLiteral" ? node.members : node.body;
		for (const member of members) {
			if (member.type !== "TSPropertySignature" && member.type !== "TSMethodSignature") continue;
			if (member.key.type !== "Identifier" && member.key.type !== "Literal") {
				yield {
					type: "unknown",
					propName: null,
					node: member.key
				};
				continue;
			}
			/** @type {string[]|undefined} */
			let types;
			if (member.type === "TSMethodSignature") types = ["Function"];
			else if (member.typeAnnotation) types = inferRuntimeType(context, member.typeAnnotation.typeAnnotation);
			yield {
				type: "type",
				key: member.key,
				propName: member.key.type === "Identifier" ? member.key.name : String(member.key.value),
				node: member,
				required: !member.optional,
				types: types || [`null`]
			};
		}
	}
	/**
	* @param {TSESTreeTSTypeLiteral | TSESTreeTSInterfaceBody | TSESTreeTSFunctionType} node
	* @returns {IterableIterator<ComponentTypeEmit | ComponentUnknownEmit>}
	*/
	function* extractRuntimeEmits(node) {
		if (node.type === "TSFunctionType") {
			yield* extractEventNames(node.params[0], node);
			return;
		}
		const members = node.type === "TSTypeLiteral" ? node.members : node.body;
		for (const member of members) if (member.type === "TSCallSignatureDeclaration") yield* extractEventNames(member.params[0], member);
		else if (member.type === "TSPropertySignature" || member.type === "TSMethodSignature") {
			if (member.key.type !== "Identifier" && member.key.type !== "Literal") {
				yield {
					type: "unknown",
					emitName: null,
					node: member.key
				};
				continue;
			}
			yield {
				type: "type",
				key: member.key,
				emitName: member.key.type === "Identifier" ? member.key.name : String(member.key.value),
				node: member
			};
		}
	}
	/**
	* @param {TSESTreeTSTypeLiteral | TSESTreeTSInterfaceBody} node
	* @returns {IterableIterator<ComponentTypeSlot | ComponentUnknownSlot>}
	*/
	function* extractRuntimeSlots(node) {
		const members = node.type === "TSTypeLiteral" ? node.members : node.body;
		for (const member of members) {
			if (member.type !== "TSPropertySignature" && member.type !== "TSMethodSignature") continue;
			if (member.key.type !== "Identifier" && member.key.type !== "Literal") {
				yield {
					type: "unknown",
					slotName: null,
					node: member.key
				};
				continue;
			}
			yield {
				type: "type",
				key: member.key,
				slotName: member.key.type === "Identifier" ? member.key.name : String(member.key.value),
				node: member
			};
		}
	}
	/**
	* @param {TSESTreeParameter} eventName
	* @param {TSCallSignatureDeclaration | TSFunctionType} member
	* @returns {IterableIterator<ComponentTypeEmit>}
	*/
	function* extractEventNames(eventName, member) {
		if (!eventName || eventName.type !== "Identifier" || !eventName.typeAnnotation || eventName.typeAnnotation.type !== "TSTypeAnnotation") return;
		const typeNode = eventName.typeAnnotation.typeAnnotation;
		if (typeNode.type === "TSLiteralType" && typeNode.literal.type === "Literal") yield {
			type: "type",
			key: typeNode,
			emitName: String(typeNode.literal.value),
			node: member
		};
		else if (typeNode.type === "TSUnionType") for (const t of typeNode.types) {
			if (t.type !== "TSLiteralType" || t.literal.type !== "Literal") continue;
			yield {
				type: "type",
				key: t,
				emitName: String(t.literal.value),
				node: member
			};
		}
	}
	/**
	* @param {RuleContext} context The ESLint rule context object.
	* @param {TSESTreeTypeNode} node
	* @returns {(TSESTreeTypeNode|TSESTreeTSInterfaceBody)[]}
	*/
	function flattenTypeNodes(context, node) {
		/**
		* @typedef {object} TraversedData
		* @property {Set<TSESTreeTypeNode|TSESTreeTSInterfaceBody>} nodes
		* @property {boolean} finished
		*/
		/** @type {Map<TSESTreeTypeNode,TraversedData>} */
		const traversed = /* @__PURE__ */ new Map();
		return [...flattenImpl(node)];
		/**
		* @param {TSESTreeTypeNode} node
		* @returns {Iterable<TSESTreeTypeNode|TSESTreeTSInterfaceBody>}
		*/
		function* flattenImpl(node) {
			if (node.type === "TSUnionType" || node.type === "TSIntersectionType") {
				for (const typeNode of node.types) yield* flattenImpl(typeNode);
				return;
			}
			if (node.type === "TSTypeReference" && node.typeName.type === "Identifier") {
				const refName = node.typeName.name;
				const variable = findVariable(getScope(context, node), refName);
				if (variable && variable.defs.length === 1) {
					const defNode = variable.defs[0].node;
					if (defNode.type === "TSInterfaceDeclaration") {
						yield defNode.body;
						return;
					}
					if (defNode.type === "TSTypeAliasDeclaration") {
						const typeAnnotation = defNode.typeAnnotation;
						let traversedData = traversed.get(typeAnnotation);
						if (traversedData) {
							yield* [...traversedData.nodes];
							if (!traversedData.finished) yield typeAnnotation;
							return;
						}
						traversedData = {
							nodes: /* @__PURE__ */ new Set(),
							finished: false
						};
						traversed.set(typeAnnotation, traversedData);
						for (const e of flattenImpl(typeAnnotation)) traversedData.nodes.add(e);
						traversedData.finished = true;
						yield* traversedData.nodes;
						return;
					}
				}
			}
			yield node;
		}
	}
	/**
	* @param {RuleContext} context The ESLint rule context object.
	* @param {TSESTreeTypeNode} node
	* @param {Set<TSESTreeTypeNode>} [checked]
	* @returns {string[]}
	*/
	function inferRuntimeType(context, node, checked = /* @__PURE__ */ new Set()) {
		switch (node.type) {
			case "TSStringKeyword":
			case "TSTemplateLiteralType": return ["String"];
			case "TSNumberKeyword": return ["Number"];
			case "TSBooleanKeyword": return ["Boolean"];
			case "TSObjectKeyword": return ["Object"];
			case "TSTypeLiteral": return inferTypeLiteralType(node);
			case "TSFunctionType": return ["Function"];
			case "TSArrayType":
			case "TSTupleType": return ["Array"];
			case "TSSymbolKeyword": return ["Symbol"];
			case "TSLiteralType":
				if (node.literal.type === "Literal") switch (typeof node.literal.value) {
					case "boolean": return ["Boolean"];
					case "string": return ["String"];
					case "number":
					case "bigint": return ["Number"];
				}
				return inferRuntimeTypeFromTypeNode(context, node);
			case "TSTypeReference":
				if (node.typeName.type === "Identifier") {
					const variable = findVariable(getScope(context, node), node.typeName.name);
					if (variable && variable.defs.length === 1) {
						const defNode = variable.defs[0].node;
						if (defNode.type === "TSInterfaceDeclaration") return [`Object`];
						if (defNode.type === "TSTypeAliasDeclaration") {
							const typeAnnotation = defNode.typeAnnotation;
							if (!checked.has(typeAnnotation)) {
								checked.add(typeAnnotation);
								return inferRuntimeType(context, typeAnnotation, checked);
							}
						} else if (defNode.type === "TSEnumDeclaration") return inferEnumType(context, defNode);
					}
					for (const name of [node.typeName.name, ...node.typeName.name.startsWith("Readonly") ? [node.typeName.name.slice(8)] : []]) switch (name) {
						case "Array":
						case "Function":
						case "Object":
						case "Set":
						case "Map":
						case "WeakSet":
						case "WeakMap":
						case "Date": return [name];
					}
					switch (node.typeName.name) {
						case "Record":
						case "Partial":
						case "Readonly":
						case "Pick":
						case "Omit":
						case "Required":
						case "InstanceType": return ["Object"];
						case "Uppercase":
						case "Lowercase":
						case "Capitalize":
						case "Uncapitalize": return ["String"];
						case "Parameters":
						case "ConstructorParameters": return ["Array"];
						case "NonNullable": {
							const typeArguments = "typeArguments" in node ? node.typeArguments : 							/** @type {any} typescript-eslint v5 */ node.typeParameters;
							if (typeArguments && typeArguments.params[0]) return inferRuntimeType(context, typeArguments.params[0], checked).filter((t) => t !== "null");
							break;
						}
						case "Extract": {
							const typeArguments = "typeArguments" in node ? node.typeArguments : 							/** @type {any} typescript-eslint v5 */ node.typeParameters;
							if (typeArguments && typeArguments.params[1]) return inferRuntimeType(context, typeArguments.params[1], checked);
							break;
						}
						case "Exclude":
						case "OmitThisParameter": {
							const typeArguments = "typeArguments" in node ? node.typeArguments : 							/** @type {any} typescript-eslint v5 */ node.typeParameters;
							if (typeArguments && typeArguments.params[0]) return inferRuntimeType(context, typeArguments.params[0], checked);
							break;
						}
					}
				}
				return inferRuntimeTypeFromTypeNode(context, node);
			case "TSUnionType":
			case "TSIntersectionType": return inferUnionType(node);
			default: return inferRuntimeTypeFromTypeNode(context, node);
		}
		/**
		* @param {import('@typescript-eslint/types').TSESTree.TSUnionType|import('@typescript-eslint/types').TSESTree.TSIntersectionType} node
		* @returns {string[]}
		*/
		function inferUnionType(node) {
			const types = /* @__PURE__ */ new Set();
			for (const t of node.types) for (const tt of inferRuntimeType(context, t, checked)) types.add(tt);
			return [...types];
		}
	}
	/**
	* @param {import('@typescript-eslint/types').TSESTree.TSTypeLiteral} node
	* @returns {string[]}
	*/
	function inferTypeLiteralType(node) {
		const types = /* @__PURE__ */ new Set();
		for (const m of node.members) if (m.type === "TSCallSignatureDeclaration" || m.type === "TSConstructSignatureDeclaration") types.add("Function");
		else types.add("Object");
		return types.size > 0 ? [...types] : ["Object"];
	}
	/**
	* @param {import('@typescript-eslint/types').TSESTree.Literal['value']} value
	* @returns {string | null}
	*/
	function inferLiteralValueType(value) {
		switch (typeof value) {
			case "string": return "String";
			case "number":
			case "bigint": return "Number";
			case "boolean": return "Boolean";
			default: return null;
		}
	}
	/**
	* @param {RuleContext} context The ESLint rule context object.
	* @param {import('@typescript-eslint/types').TSESTree.TSEnumDeclaration} node
	* @returns {string[]}
	*/
	function inferEnumType(context, node) {
		const types = /* @__PURE__ */ new Set();
		for (const m of node.members) if (m.initializer) if (m.initializer.type === "Literal") {
			const type = inferLiteralValueType(m.initializer.value);
			if (type) types.add(type);
		} else for (const type of inferRuntimeTypeFromTypeNode(context, m.initializer)) types.add(type);
		return types.size > 0 ? [...types] : ["Number"];
	}
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_ts_ast();
	}
});
ִ x*&const require_runtime = require("../../_virtual/_rolldown/runtime.js");
const require_typescript$1 = require("./typescript.js");
//#region lib/utils/ts-utils/ts-types.js
var require_ts_types = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	const { getTypeScript, isAny, isUnknown, isNever, isNull, isObject, isFunction, isStringLike, isNumberLike, isBooleanLike, isBigIntLike, isArrayLikeObject, isReferenceObject } = require_typescript$1.default;
	/**
	* @typedef {import('@typescript-eslint/types').TSESTree.Node} TSESTreeNode
	* @typedef {import('typescript').Type} Type
	* @typedef {import('typescript').TypeChecker} TypeChecker
	* @typedef {import('typescript').Node} TypeScriptNode
	*/
	/**
	* @typedef {import('../index').ComponentInferTypeProp} ComponentInferTypeProp
	* @typedef {import('../index').ComponentUnknownProp} ComponentUnknownProp
	* @typedef {import('../index').ComponentInferTypeEmit} ComponentInferTypeEmit
	* @typedef {import('../index').ComponentUnknownEmit} ComponentUnknownEmit
	* @typedef {import('../index').ComponentInferTypeSlot} ComponentInferTypeSlot
	* @typedef {import('../index').ComponentUnknownSlot} ComponentUnknownSlot
	*/
	module.exports = {
		getComponentPropsFromTypeDefineTypes,
		getComponentEmitsFromTypeDefineTypes,
		getComponentSlotsFromTypeDefineTypes,
		inferRuntimeTypeFromTypeNode,
		isExhaustiveSwitch
	};
	/**
	* @typedef {object} Services
	* @property {typeof import("typescript")} ts
	* @property {Map<ESNode | TSNode | TSESTreeNode, TypeScriptNode>} tsNodeMap
	* @property {import('typescript').TypeChecker} checker
	*/
	/**
	* Get TypeScript parser services.
	* @param {RuleContext} context The ESLint rule context object.
	* @returns {Services|null}
	*/
	function getTSParserServices(context) {
		const sourceCode = context.sourceCode;
		const tsNodeMap = sourceCode.parserServices.esTreeNodeToTSNodeMap;
		if (!tsNodeMap) return null;
		const checker = sourceCode.parserServices.hasFullTypeInformation !== false && sourceCode.parserServices.program && sourceCode.parserServices.program.getTypeChecker() || null;
		if (!checker) return null;
		const ts = getTypeScript();
		if (!ts) return null;
		return {
			ts,
			tsNodeMap,
			checker
		};
	}
	/**
	* Get all props by looking at all component's properties
	* @param {RuleContext} context The ESLint rule context object.
	* @param {TypeNode} propsNode Type with props definition
	* @return {(ComponentInferTypeProp|ComponentUnknownProp)[]} Array of component props
	*/
	function getComponentPropsFromTypeDefineTypes(context, propsNode) {
		const services = getTSParserServices(context);
		const tsNode = services && services.tsNodeMap.get(propsNode);
		const type = tsNode && services.checker.getTypeAtLocation(tsNode);
		if (!type || isAny(type) || isUnknown(type) || isNever(type) || isNull(type)) return [{
			type: "unknown",
			propName: null,
			node: propsNode
		}];
		return [...extractRuntimeProps(type, tsNode, propsNode, services)];
	}
	/**
	* Get all emits by looking at all component's properties
	* @param {RuleContext} context The ESLint rule context object.
	* @param {TypeNode} emitsNode Type with emits definition
	* @return {(ComponentInferTypeEmit|ComponentUnknownEmit)[]} Array of component emits
	*/
	function getComponentEmitsFromTypeDefineTypes(context, emitsNode) {
		const services = getTSParserServices(context);
		const tsNode = services && services.tsNodeMap.get(emitsNode);
		const type = tsNode && services.checker.getTypeAtLocation(tsNode);
		if (!type || isAny(type) || isUnknown(type) || isNever(type) || isNull(type)) return [{
			type: "unknown",
			emitName: null,
			node: emitsNode
		}];
		return [...extractRuntimeEmits(type, tsNode, emitsNode, services)];
	}
	/**
	* Get all slots by looking at all component's properties
	* @param {RuleContext} context The ESLint rule context object.
	* @param {TypeNode} slotsNode Type with slots definition
	* @return {(ComponentInferTypeSlot|ComponentUnknownSlot)[]} Array of component slots
	*/
	function getComponentSlotsFromTypeDefineTypes(context, slotsNode) {
		const services = getTSParserServices(context);
		const tsNode = services && services.tsNodeMap.get(slotsNode);
		const type = tsNode && services.checker.getTypeAtLocation(tsNode);
		if (!type || isAny(type) || isUnknown(type) || isNever(type) || isNull(type)) return [{
			type: "unknown",
			slotName: null,
			node: slotsNode
		}];
		return [...extractRuntimeSlots(type, slotsNode)];
	}
	/**
	* @param {RuleContext} context The ESLint rule context object.
	* @param {TypeNode|Expression} node
	* @returns {string[]}
	*/
	function inferRuntimeTypeFromTypeNode(context, node) {
		const services = getTSParserServices(context);
		const tsNode = services && services.tsNodeMap.get(node);
		const type = tsNode && services.checker.getTypeAtLocation(tsNode);
		if (!type) return ["null"];
		return inferRuntimeTypeInternal(type, services);
	}
	/**
	* @param {Type} type
	* @param {TypeScriptNode} tsNode
	* @param {TypeNode} propsNode Type with props definition
	* @param {Services} services
	* @returns {IterableIterator<ComponentInferTypeProp>}
	*/
	function* extractRuntimeProps(type, tsNode, propsNode, services) {
		const { ts, checker } = services;
		for (const property of type.getProperties()) {
			const isOptional = (property.flags & ts.SymbolFlags.Optional) !== 0;
			const name = property.getName();
			const type = checker.getTypeOfSymbolAtLocation(property, tsNode);
			yield {
				type: "infer-type",
				propName: name,
				required: !isOptional,
				node: propsNode,
				types: inferRuntimeTypeInternal(type, services)
			};
		}
	}
	/**
	* @param {Type} type
	* @param {Services} services
	* @returns {string[]}
	*/
	function inferRuntimeTypeInternal(type, services) {
		const { checker } = services;
		/** @type {Set<string>} */
		const types = /* @__PURE__ */ new Set();
		if (type.isTypeParameter()) {
			const constraint = type.getConstraint();
			if (constraint) for (const t of inferRuntimeTypeInternal(constraint, services)) types.add(t);
			return [...types];
		}
		const targetTypes = iterateTypes(checker.getNonNullableType(type));
		for (const targetType of targetTypes) if (isAny(targetType) || isUnknown(targetType) || isNever(targetType) || isNull(targetType)) types.add("null");
		else if (isStringLike(targetType)) types.add("String");
		else if (isNumberLike(targetType) || isBigIntLike(targetType)) types.add("Number");
		else if (isBooleanLike(targetType)) types.add("Boolean");
		else if (isFunction(targetType)) types.add("Function");
		else if (isArrayLikeObject(targetType) || targetType.isClassOrInterface() && ["Array", "ReadonlyArray"].includes(checker.getFullyQualifiedName(targetType.symbol))) types.add("Array");
		else if (isObject(targetType)) types.add("Object");
		if (types.size === 0) types.add("null");
		return [...types];
	}
	/**
	* @param {Type} type
	* @param {TypeScriptNode} tsNode
	* @param {TypeNode} emitsNode Type with emits definition
	* @param {Services} services
	* @returns {IterableIterator<ComponentInferTypeEmit|ComponentUnknownEmit>}
	*/
	function* extractRuntimeEmits(type, tsNode, emitsNode, services) {
		const { checker } = services;
		if (isFunction(type)) for (const signature of type.getCallSignatures()) {
			const param = signature.getParameters()[0];
			if (!param) {
				yield {
					type: "unknown",
					emitName: null,
					node: emitsNode
				};
				continue;
			}
			const type = checker.getTypeOfSymbolAtLocation(param, tsNode);
			for (const targetType of iterateTypes(type)) yield targetType.isStringLiteral() ? {
				type: "infer-type",
				emitName: targetType.value,
				node: emitsNode
			} : {
				type: "unknown",
				emitName: null,
				node: emitsNode
			};
		}
		else if (isObject(type)) for (const property of type.getProperties()) yield {
			type: "infer-type",
			emitName: property.getName(),
			node: emitsNode
		};
		else yield {
			type: "unknown",
			emitName: null,
			node: emitsNode
		};
	}
	/**
	* @param {Type} type
	* @param {TypeNode} slotsNode Type with slots definition
	* @returns {IterableIterator<ComponentInferTypeSlot>}
	*/
	function* extractRuntimeSlots(type, slotsNode) {
		for (const property of type.getProperties()) yield {
			type: "infer-type",
			slotName: property.getName(),
			node: slotsNode
		};
	}
	/**
	* @param {Type} type
	* @returns {Iterable<Type>}
	*/
	function* iterateTypes(type) {
		if (isReferenceObject(type) && type.target !== type) yield* iterateTypes(type.target);
		else if (type.isUnion() && !isBooleanLike(type)) for (const t of type.types) yield* iterateTypes(t);
		else yield type;
	}
	/**
	* @param {Type} type
	* @returns {Type[]}
	*/
	function unionConstituents(type) {
		return type.isUnion() ? type.types : [type];
	}
	/**
	* @param {Type} type
	* @returns {Type[]}
	*/
	function intersectionConstituents(type) {
		return type.isIntersection() ? type.types : [type];
	}
	/**
	* @param {Type} type
	* @param {typeof import('typescript')} ts
	* @returns {boolean}
	*/
	function isTypeLiteralLike(type, ts) {
		return (type.flags & (ts.TypeFlags.Literal | ts.TypeFlags.Undefined | ts.TypeFlags.Null | ts.TypeFlags.UniqueESSymbol)) !== 0;
	}
	/**
	* Check whether a switch statement's discriminant is a finite union of literal
	* types and every union member is covered by a case clause.
	* Does NOT verify that case bodies terminate — callers can use ESLint's code
	* path analysis for that.
	* @param {RuleContext} context
	* @param {SwitchStatement} switchNode
	* @returns {boolean}
	*/
	function isExhaustiveSwitch(context, switchNode) {
		const services = getTSParserServices(context);
		if (!services) return false;
		const { ts, tsNodeMap, checker } = services;
		const discriminantTSNode = tsNodeMap.get(switchNode.discriminant);
		if (!discriminantTSNode) return false;
		let discriminantType = checker.getTypeAtLocation(discriminantTSNode);
		if (!discriminantType) return false;
		discriminantType = checker.getBaseConstraintOfType(discriminantType) ?? discriminantType;
		/** @type {Set<Type>} */
		const caseTypes = /* @__PURE__ */ new Set();
		for (const switchCase of switchNode.cases) {
			if (switchCase.test === null) return true;
			const caseTSNode = tsNodeMap.get(switchCase.test);
			if (!caseTSNode) return false;
			let caseType = checker.getTypeAtLocation(caseTSNode);
			if (!caseType) return false;
			caseType = checker.getBaseConstraintOfType(caseType) ?? caseType;
			caseTypes.add(caseType);
		}
		const hasUndefinedCase = [...caseTypes].some((type) => (type.flags & ts.TypeFlags.Undefined) !== 0);
		for (const member of unionConstituents(discriminantType)) if (!intersectionConstituents(member).some((part) => isTypeLiteralLike(part, ts) && (caseTypes.has(part) || hasUndefinedCase && (part.flags & ts.TypeFlags.Undefined) !== 0))) return false;
		return true;
	}
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_ts_types();
	}
});
 eھxA//#region lib/utils/ts-utils/typescript.js
var require_typescript = /* @__PURE__ */ require("../../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	/**
	* @typedef {typeof import("typescript")} TypeScript
	* @typedef {import("typescript").Type} Type
	* @typedef {import("typescript").ObjectType} ObjectType
	* @typedef {import("typescript").InterfaceType} InterfaceType
	* @typedef {import("typescript").TypeReference} TypeReference
	* @typedef {import("typescript").UnionOrIntersectionType} UnionOrIntersectionType
	* @typedef {import("typescript").TypeParameter} TypeParameter
	*/
	/** @type {TypeScript | undefined} */
	let cacheTypeScript;
	module.exports = {
		getTypeScript,
		isObject,
		isAny,
		isUnknown,
		isNever,
		isNull,
		isFunction,
		isArrayLikeObject,
		isStringLike,
		isNumberLike,
		isBooleanLike,
		isBigIntLike,
		isReferenceObject,
		extractTypeFlags,
		extractObjectFlags
	};
	/**
	* Get TypeScript instance
	*/
	function getTypeScript() {
		if (cacheTypeScript) return cacheTypeScript;
		try {
			return cacheTypeScript = require("typescript");
		} catch (error) {
			if (error.code === "MODULE_NOT_FOUND") return;
			throw error;
		}
	}
	/**
	* For debug
	* @param {Type} tsType
	* @returns {string[]}
	*/
	function extractTypeFlags(tsType) {
		const ts = getTypeScript();
		/** @type {string[]} */
		const result = [];
		const keys = Object.keys(ts.TypeFlags);
		for (const k of keys) if ((tsType.flags & ts.TypeFlags[k]) !== 0) result.push(k);
		return result;
	}
	/**
	* For debug
	* @param {Type} tsType
	* @returns {string[]}
	*/
	function extractObjectFlags(tsType) {
		if (!isObject(tsType)) return [];
		const ts = getTypeScript();
		/** @type {string[]} */
		const result = [];
		const keys = Object.keys(ts.ObjectFlags);
		for (const k of keys) if ((tsType.objectFlags & ts.ObjectFlags[k]) !== 0) result.push(k);
		return result;
	}
	/**
	* Check if a given type is an object type or not.
	* @param {Type} tsType The type to check.
	* @returns {tsType is ObjectType}
	*/
	function isObject(tsType) {
		const ts = getTypeScript();
		return (tsType.flags & ts.TypeFlags.Object) !== 0;
	}
	/**
	* Check if a given type is an array-like type or not.
	* @param {Type} tsType The type to check.
	*/
	function isArrayLikeObject(tsType) {
		const ts = getTypeScript();
		return isObject(tsType) && (tsType.objectFlags & (ts.ObjectFlags.ArrayLiteral | ts.ObjectFlags.EvolvingArray | ts.ObjectFlags.Tuple)) !== 0;
	}
	/**
	* Check if a given type is an any type or not.
	* @param {Type} tsType The type to check.
	*/
	function isAny(tsType) {
		const ts = getTypeScript();
		return (tsType.flags & ts.TypeFlags.Any) !== 0;
	}
	/**
	* Check if a given type is an unknown type or not.
	* @param {Type} tsType The type to check.
	*/
	function isUnknown(tsType) {
		const ts = getTypeScript();
		return (tsType.flags & ts.TypeFlags.Unknown) !== 0;
	}
	/**
	* Check if a given type is a never type or not.
	* @param {Type} tsType The type to check.
	*/
	function isNever(tsType) {
		const ts = getTypeScript();
		return (tsType.flags & ts.TypeFlags.Never) !== 0;
	}
	/**
	* Check if a given type is an null type or not.
	* @param {Type} tsType The type to check.
	*/
	function isNull(tsType) {
		const ts = getTypeScript();
		return (tsType.flags & ts.TypeFlags.Null) !== 0;
	}
	/**
	* Check if a given type is a string-like type or not.
	* @param {Type} tsType The type to check.
	* @returns {boolean} `true` if the type is a string-like type.
	*/
	function isStringLike(tsType) {
		const ts = getTypeScript();
		return (tsType.flags & ts.TypeFlags.StringLike) !== 0;
	}
	/**
	* Check if a given type is an number-like type or not.
	* @param {Type} tsType The type to check.
	* @returns {boolean} `true` if the type is a number-like type.
	*/
	function isNumberLike(tsType) {
		const ts = getTypeScript();
		return (tsType.flags & ts.TypeFlags.NumberLike) !== 0;
	}
	/**
	* Check if a given type is an boolean-like type or not.
	* @param {Type} tsType The type to check.
	* @returns {boolean} `true` if the type is a boolean-like type.
	*/
	function isBooleanLike(tsType) {
		const ts = getTypeScript();
		return (tsType.flags & ts.TypeFlags.BooleanLike) !== 0;
	}
	/**
	* Check if a given type is an bigint-like type or not.
	* @param {Type} tsType The type to check.
	* @returns {boolean} `true` if the type is a bigint-like type.
	*/
	function isBigIntLike(tsType) {
		const ts = getTypeScript();
		return (tsType.flags & ts.TypeFlags.BigIntLike) !== 0;
	}
	/**
	* Check if a given type is a reference type or not.
	* @param {Type} tsType The type to check.
	* @returns {tsType is TypeReference} `true` if the type is a reference type.
	*/
	function isReferenceObject(tsType) {
		const ts = getTypeScript();
		return isObject(tsType) && (tsType.objectFlags & ts.ObjectFlags.Reference) !== 0;
	}
	/**
	* Check if a given type is `function` or not.
	* @param {Type} tsType The type to check.
	*/
	function isFunction(tsType) {
		const ts = getTypeScript();
		if (tsType.symbol && (tsType.symbol.flags & (ts.SymbolFlags.Function | ts.SymbolFlags.Method)) !== 0) return true;
		return tsType.getCallSignatures().length > 0;
	}
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_typescript();
	}
});
yھx//#region lib/utils/void-elements.json
var require_void_elements = /* @__PURE__ */ require("../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	module.exports = [
		"area",
		"base",
		"br",
		"col",
		"embed",
		"hr",
		"img",
		"input",
		"keygen",
		"link",
		"menuitem",
		"meta",
		"param",
		"source",
		"track",
		"wbr"
	];
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_void_elements();
	}
});
x|//#region lib/utils/vue-builtin-elements.js
var require_vue_builtin_elements = /* @__PURE__ */ require("../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	module.exports = [
		"template",
		"slot",
		"component"
	];
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_vue_builtin_elements();
	}
});
ۂ~Qx//#region lib/utils/vue-component-options.json
var require_vue_component_options = /* @__PURE__ */ require("../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	module.exports = {
		"nuxt": [
			"asyncData",
			"fetch",
			"head",
			"key",
			"layout",
			"loading",
			"middleware",
			"scrollToTop",
			"transition",
			"validate",
			"watchQuery"
		],
		"vue-router": [
			"beforeRouteEnter",
			"beforeRouteUpdate",
			"beforeRouteLeave"
		],
		"vue": [
			"data",
			"props",
			"propsData",
			"computed",
			"methods",
			"watch",
			"el",
			"template",
			"render",
			"renderError",
			"staticRenderFns",
			"beforeCreate",
			"created",
			"beforeDestroy",
			"destroyed",
			"beforeMount",
			"mounted",
			"beforeUpdate",
			"updated",
			"activated",
			"deactivated",
			"errorCaptured",
			"serverPrefetch",
			"directives",
			"components",
			"transitions",
			"filters",
			"provide",
			"inject",
			"model",
			"parent",
			"mixins",
			"name",
			"extends",
			"delimiters",
			"comments",
			"inheritAttrs",
			"setup",
			"emits",
			"beforeUnmount",
			"unmounted",
			"renderTracked",
			"renderTriggered"
		]
	};
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_vue_component_options();
	}
});
0y'xv//#region lib/utils/vue-reserved.json
var require_vue_reserved = /* @__PURE__ */ require("../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	module.exports = [
		"$data",
		"$props",
		"$el",
		"$options",
		"$parent",
		"$root",
		"$children",
		"$slots",
		"$scopedSlots",
		"$refs",
		"$isServer",
		"$attrs",
		"$listeners",
		"$watch",
		"$set",
		"$delete",
		"$on",
		"$once",
		"$off",
		"$emit",
		"$mount",
		"$forceUpdate",
		"$nextTick",
		"$destroy"
	];
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_vue_reserved();
	}
});
Psι$xIconst require_runtime = require("../_virtual/_rolldown/runtime.js");
const require_vue2_builtin_components$1 = require("./vue2-builtin-components.js");
//#region lib/utils/vue3-builtin-components.js
var require_vue3_builtin_components = /* @__PURE__ */ require_runtime.__commonJSMin(((exports, module) => {
	module.exports = [
		...require_vue2_builtin_components$1.default,
		"teleport",
		"Teleport",
		"suspense",
		"Suspense"
	];
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_vue3_builtin_components();
	}
});
mVx )//#region lib/utils/vue2&W$="template",
		"slot",
		"component",
		"Component",
		"transition",
		"Transition",
		"transition-group",
		"TransitionGroup",
		"keep-alive",
		"KeepAlivW>[Ax//#region lib/utils/vue3-export-names.json
var require_vue3_export_names = /* @__PURE__ */ require("../_virtual/_rolldown/runtime.js").__commonJSMin(((exports, module) => {
	module.exports = [
		"ComputedGetter",
		"ComputedRef",
		"ComputedSetter",
		"CustomRefFactory",
		"DebuggerEvent",
		"DebuggerEventExtraInfo",
		"DebuggerOptions",
		"DeepReadonly",
		"EffectScheduler",
		"EffectScope",
		"MaybeRef",
		"MaybeRefOrGetter",
		"Raw",
		"Reactive",
		"ReactiveEffect",
		"ReactiveEffectOptions",
		"ReactiveEffectRunner",
		"ReactiveFlags",
		"Ref",
		"ShallowReactive",
		"ShallowRef",
		"ShallowUnwrapRef",
		"ToRef",
		"ToRefs",
		"TrackOpTypes",
		"TriggerOpTypes",
		"UnwrapNestedRefs",
		"UnwrapRef",
		"WatchCallback",
		"WatchEffect",
		"WatchHandle",
		"WatchSource",
		"WatchStopHandle",
		"WritableComputedOptions",
		"WritableComputedRef",
		"customRef",
		"effect",
		"effectScope",
		"getCurrentScope",
		"getCurrentWatcher",
		"isProxy",
		"isReactive",
		"isReadonly",
		"isRef",
		"isShallow",
		"markRaw",
		"onScopeDispose",
		"onWatcherCleanup",
		"proxyRefs",
		"reactive",
		"readonly",
		"ref",
		"shallowReactive",
		"shallowReadonly",
		"shallowRef",
		"stop",
		"toRaw",
		"toRef",
		"toRefs",
		"toValue",
		"triggerRef",
		"unref",
		"camelize",
		"capitalize",
		"normalizeClass",
		"normalizeProps",
		"normalizeStyle",
		"toDisplayString",
		"toHandlerKey",
		"computed",
		"Slot",
		"Slots",
		"SlotsType",
		"nextTick",
		"queuePostFlushCb",
		"ComponentPropsOptions",
		"ComponentObjectPropsOptions",
		"Prop",
		"PropType",
		"ExtractPropTypes",
		"ExtractPublicPropTypes",
		"ExtractDefaultPropTypes",
		"defineProps",
		"DefineProps",
		"defineEmits",
		"ComponentTypeEmits",
		"defineExpose",
		"defineOptions",
		"defineSlots",
		"ModelRef",
		"defineModel",
		"withDefaults",
		"useSlots",
		"useAttrs",
		"ObjectEmitsOptions",
		"EmitsOptions",
		"EmitsToProps",
		"ShortEmitsToObject",
		"EmitFn",
		"DirectiveBinding",
		"DirectiveHook",
		"ObjectDirective",
		"FunctionDirective",
		"Directive",
		"DirectiveModifiers",
		"DirectiveArguments",
		"withDirectives",
		"ComponentCustomProperties",
		"CreateComponentPublicInstance",
		"CreateComponentPublicInstanceWithMixins",
		"ComponentPublicInstance",
		"SuspenseProps",
		"Suspense",
		"SuspenseBoundary",
		"RootHydrateFunction",
		"BaseTransitionProps",
		"TransitionHooks",
		"TransitionState",
		"useTransitionState",
		"BaseTransitionPropsValidators",
		"BaseTransition",
		"resolveTransitionHooks",
		"setTransitionHooks",
		"getTransitionRawChildren",
		"Renderer",
		"HydrationRenderer",
		"ElementNamespace",
		"RootRenderFunction",
		"RendererOptions",
		"RendererNode",
		"RendererElement",
		"createRenderer",
		"createHydrationRenderer",
		"KeepAliveProps",
		"KeepAlive",
		"onActivated",
		"onDeactivated",
		"onBeforeMount",
		"onMounted",
		"onBeforeUpdate",
		"onUpdated",
		"onBeforeUnmount",
		"onUnmounted",
		"onServerPrefetch",
		"onRenderTriggered",
		"onRenderTracked",
		"onErrorCaptured",
		"ComponentCustomOptions",
		"RenderFunction",
		"ComponentOptionsBase",
		"RuntimeCompilerOptions",
		"ComponentOptions",
		"ComponentOptionsMixin",
		"ComputedOptions",
		"MethodOptions",
		"ComponentProvideOptions",
		"ComponentInjectOptions",
		"ComponentOptionsWithoutProps",
		"ComponentOptionsWithArrayProps",
		"ComponentOptionsWithObjectProps",
		"InjectionKey",
		"provide",
		"inject",
		"hasInjectionContext",
		"PublicProps",
		"DefineComponent",
		"DefineSetupFnComponent",
		"defineComponent",
		"App",
		"OptionMergeFunction",
		"AppConfig",
		"AppContext",
		"ObjectPlugin",
		"FunctionPlugin",
		"Plugin",
		"CreateAppFunction",
		"TeleportProps",
		"Teleport",
		"resolveComponent",
		"resolveDynamicComponent",
		"resolveDirective",
		"Fragment",
		"Text",
		"Comment",
		"Static",
		"VNodeTypes",
		"VNodeRef",
		"VNodeProps",
		"VNodeArrayChildren",
		"VNodeChild",
		"VNodeNormalizedChildren",
		"VNode",
		"openBlock",
		"setBlockTracking",
		"createElementBlock",
		"createBlock",
		"isVNode",
		"transformVNodeArgs",
		"createBaseVNode",
		"createVNode",
		"guardReactiveProps",
		"cloneVNode",
		"createTextVNode",
		"createStaticVNode",
		"createCommentVNode",
		"mergeProps",
		"AllowedAttrs",
		"Attrs",
		"ComponentInstance",
		"ComponentCustomProps",
		"GlobalDirectives",
		"GlobalComponents",
		"AllowedComponentProps",
		"FunctionalComponent",
		"ConcreteComponent",
		"Component",
		"SetupContext",
		"ComponentInternalInstance",
		"getCurrentInstance",
		"registerRuntimeCompiler",
		"isRuntimeOnly",
		"ComponentCustomElementInterface",
		"WatchEffectOptions",
		"WatchOptions",
		"watchEffect",
		"watchPostEffect",
		"watchSyncEffect",
		"MultiWatchSources",
		"watch",
		"HydrationStrategy",
		"HydrationStrategyFactory",
		"hydrateOnIdle",
		"hydrateOnVisible",
		"hydrateOnMediaQuery",
		"hydrateOnInteraction",
		"AsyncComponentLoader",
		"AsyncComponentOptions",
		"defineAsyncComponent",
		"useModel",
		"TemplateRef",
		"useTemplateRef",
		"useId",
		"h",
		"ssrContextKey",
		"useSSRContext",
		"ErrorCodes",
		"callWithErrorHandling",
		"callWithAsyncErrorHandling",
		"handleError",
		"initCustomFormatter",
		"HMRRuntime",
		"pushScopeId",
		"popScopeId",
		"withScopeId",
		"withCtx",
		"renderList",
		"toHandlers",
		"renderSlot",
		"createSlots",
		"withMemo",
		"isMemoSame",
		"LegacyConfig",
		"CompatVue",
		"version",
		"warn",
		"devtools",
		"setDevtoolsHook",
		"DeprecationTypes",
		"createElementVNode",
		"WatchOptionsBase",
		"nodeOps",
		"patchProp",
		"TransitionProps",
		"Transition",
		"TransitionGroupProps",
		"TransitionGroup",
		"vShow",
		"withModifiers",
		"withKeys",
		"vModelText",
		"vModelCheckbox",
		"vModelRadio",
		"vModelSelect",
		"vModelDynamic",
		"CSSProperties",
		"AriaAttributes",
		"StyleValue",
		"ClassValue",
		"HTMLAttributes",
		"AnchorHTMLAttributes",
		"AreaHTMLAttributes",
		"AudioHTMLAttributes",
		"BaseHTMLAttributes",
		"BlockquoteHTMLAttributes",
		"ButtonHTMLAttributes",
		"CanvasHTMLAttributes",
		"ColHTMLAttributes",
		"ColgroupHTMLAttributes",
		"DataHTMLAttributes",
		"DetailsHTMLAttributes",
		"DelHTMLAttributes",
		"DialogHTMLAttributes",
		"EmbedHTMLAttributes",
		"FieldsetHTMLAttributes",
		"FormHTMLAttributes",
		"HtmlHTMLAttributes",
		"IframeHTMLAttributes",
		"ImgHTMLAttributes",
		"InsHTMLAttributes",
		"InputTypeHTMLAttribute",
		"InputAutoCompleteAttribute",
		"InputHTMLAttributes",
		"KeygenHTMLAttributes",
		"LabelHTMLAttributes",
		"LiHTMLAttributes",
		"LinkHTMLAttributes",
		"MapHTMLAttributes",
		"MenuHTMLAttributes",
		"MediaHTMLAttributes",
		"MetaHTMLAttributes",
		"MeterHTMLAttributes",
		"QuoteHTMLAttributes",
		"ObjectHTMLAttributes",
		"OlHTMLAttributes",
		"OptgroupHTMLAttributes",
		"OptionHTMLAttributes",
		"OutputHTMLAttributes",
		"ParamHTMLAttributes",
		"ProgressHTMLAttributes",
		"ScriptHTMLAttributes",
		"SelectHTMLAttributes",
		"SourceHTMLAttributes",
		"StyleHTMLAttributes",
		"TableHTMLAttributes",
		"TextareaHTMLAttributes",
		"TdHTMLAttributes",
		"ThHTMLAttributes",
		"TimeHTMLAttributes",
		"TrackHTMLAttributes",
		"VideoHTMLAttributes",
		"WebViewHTMLAttributes",
		"SVGAttributes",
		"IntrinsicElementAttributes",
		"Events",
		"ReservedProps",
		"NativeElements",
		"VueElementConstructor",
		"CustomElementOptions",
		"defineCustomElement",
		"defineSSRCustomElement",
		"VueElement",
		"useHost",
		"useShadowRoot",
		"useCssModule",
		"useCssVars",
		"render",
		"hydrate",
		"createApp",
		"createSSRApp",
		"compileToFunction",
		"compile"
	];
}));
//#endregion
Object.defineProperty(exports, "default", {
	enumerable: true,
	get: function() {
		return require_vue3_export_names();
	}
});
\x{
  "name": "eslint-plugin-vue",
  "version": "10.10.0",
  "description": "Official ESLint plugin for Vue.js",
  "main": "dist/index.js",
  "types": "dist/index.d.ts",
  "scripts": {
    "new": "node tools/new-rule.js",
    "start": "npm run test:base -- --watch",
    "test:base": "vitest run --reporter=dot tests/lib",
    "test": "vitest run",
    "test:integrations": "vitest run tests/integrations",
    "debug": "vitest run --inspect --no-file-parallelism --reporter=dot tests/lib",
    "cover": "npm run cover:test && npm run cover:report",
    "cover:test": "vitest run --coverage --reporter=dot tests/lib",
    "cover:report": "echo 'HTML coverage report available at ./coverage/index.html'",
    "lint": "eslint . && markdownlint \"**/*.md\"",
    "lint:fix": "eslint . --fix && markdownlint \"**/*.md\" --fix",
    "tsc": "tsc",
    "preversion": "npm test && git add .",
    "version": "npm run generate:version && git add .",
    "update": "node ./tools/update.js",
    "update-resources": "node ./tools/update-resources.js",
    "typegen": "node ./tools/generate-typegen.mjs",
    "build": "npm run typegen && tsdown",
    "docs:watch": "vitepress dev docs",
    "predocs:build": "npm run update",
    "docs:build": "vitepress build docs",
    "generate:version": "env-cmd --environments version -- npm run update && npm run lint:fix",
    "changeset:version": "changeset version && npm run generate:version && git add --all",
    "changeset:publish": "npm run build && changeset publish"
  },
  "files": [
    "dist"
  ],
  "homepage": "https://eslint.vuejs.org",
  "keywords": [
    "eslint",
    "eslint-plugin",
    "eslint-config",
    "vue",
    "vuejs",
    "rules"
  ],
  "author": "Toru Nagashima (https://github.com/mysticatea)",
  "contributors": [
    "Michał Sajnóg <msajnog93@gmail.com> (https://github.com/michalsnik)",
    "Yosuke Ota (https://github.com/ota-meshi)"
  ],
  "license": "MIT",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/vuejs/eslint-plugin-vue.git"
  },
  "bugs": {
    "url": "https://github.com/vuejs/eslint-plugin-vue/issues"
  },
  "engines": {
    "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
  },
  "peerDependencies": {
    "@stylistic/eslint-plugin": "^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0",
    "@typescript-eslint/parser": "^7.0.0 || ^8.0.0",
    "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0",
    "vue-eslint-parser": "^10.3.0"
  },
  "peerDependenciesMeta": {
    "@stylistic/eslint-plugin": {
      "optional": true
    },
    "@typescript-eslint/parser": {
      "optional": true
    }
  },
  "dependencies": {
    "@eslint-community/eslint-utils": "^4.9.1",
    "natural-compare": "^1.4.0",
    "nth-check": "^2.1.1",
    "postcss-selector-parser": "^7.1.4",
    "semver": "^7.8.5",
    "xml-name-validator": "^5.0.0"
  },
  "devDependencies": {
    "@changesets/cli": "^2.31.0",
    "@eslint/markdown": "^8.0.3",
    "@ota-meshi/site-kit-eslint-editor-vue": "^0.2.4",
    "@stylistic/eslint-plugin": "^5.10.0",
    "@svitejs/changesets-changelog-github-compact": "^1.2.0",
    "@types/eslint": "^9.6.1",
    "@types/natural-compare": "^1.4.3",
    "@types/node": "^24.13.2",
    "@types/semver": "^7.7.1",
    "@types/xml-name-validator": "^4.0.3",
    "@typescript-eslint/eslint-plugin": "^8.62.1",
    "@typescript-eslint/parser": "^8.62.1",
    "@typescript-eslint/types": "^8.62.1",
    "@vitest/coverage-v8": "^4.1.9",
    "assert": "^2.1.0",
    "env-cmd": "^11.0.0",
    "esbuild": "^0.28.1",
    "eslint": "^10.6.0",
    "eslint-compat-utils": "^0.6.5",
    "eslint-config-flat-gitignore": "^2.3.0",
    "eslint-config-prettier": "^10.1.8",
    "eslint-plugin-eslint-plugin": "^7.4.1",
    "eslint-plugin-jsonc": "^3.2.0",
    "eslint-plugin-markdown-preferences": "^0.41.1",
    "eslint-plugin-node-dependencies": "^2.2.0",
    "eslint-plugin-prettier": "^5.5.6",
    "eslint-plugin-unicorn": "^70.0.0",
    "eslint-plugin-vue": "file:.",
    "eslint-typegen": "^2.3.1",
    "eslint-visitor-keys": "^5.0.1",
    "espree": "^11.2.0",
    "events": "^3.3.0",
    "globals": "^17.7.0",
    "jsdom": "^29.1.1",
    "markdownlint-cli": "^0.49.0",
    "pathe": "^2.0.3",
    "prettier": "^3.9.4",
    "tsdown": "^0.22.3",
    "typescript": "^6.0.3",
    "vite-plugin-eslint4b": "^0.8.1",
    "vitepress": "^1.6.4",
    "vitest": "^4.1.9",
    "vue-eslint-parser": "^10.4.1"
  }
}
6

x R100644 LICENSE jRo~CƏ4b./ȧ100644 README.md }Y^H_ϟP[B-W40000 dist Vf׊K#^oBS40000 lib R:0"k@G100644 package.json %x)z	ݯ}?\VxnCopyright JS Foundation and other contributors, https://js.foundation
Copyright (C) 2012-2013 Yusuke Suzuki (twitter: @Constellation) and other contributors.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

  * Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
  * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ĮUx+\[![npm version](https://img.shields.io/npm/v/eslint-scope.svg)](https://www.npmjs.com/package/eslint-scope)
[![Downloads](https://img.shields.io/npm/dm/eslint-scope.svg)](https://www.npmjs.com/package/eslint-scope)
[![Build Status](https://github.com/eslint/js/workflows/CI/badge.svg)](https://github.com/eslint/js/actions)

# ESLint Scope

ESLint Scope is the [ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm) scope analyzer used in ESLint. It is a fork of [escope](http://github.com/estools/escope).

## Install

```
npm i eslint-scope --save
```

## 📖 Usage

To use in an ESM file:

```js
import * as eslintScope from "eslint-scope";
```

To use in a CommonJS file:

```js
const eslintScope = require("eslint-scope");
```

In order to analyze scope, you'll need to have an [ESTree](https://github.com/estree/estree) compliant AST structure to run it on. The primary method is `eslintScope.analyze()`, which takes two arguments:

1. `ast` - the ESTree-compliant AST structure to analyze.
2. `options` (optional) - Options to adjust how the scope is analyzed, including:

- `ignoreEval` (default: `false`) - Set to `true` to ignore all `eval()` calls (which would normally create scopes).
- `nodejsScope` (default: `false`) - Set to `true` to create a top-level function scope needed for CommonJS evaluation.
- `impliedStrict` (default: `false`) - Set to `true` to evaluate the code in strict mode even outside of modules and without `"use strict"`.
- `ecmaVersion` (default: `5`) - The version of ECMAScript to use to evaluate the code.
- `sourceType` (default: `"script"`) - The type of JavaScript file to evaluate. Change to `"module"` for ECMAScript module code.
- `childVisitorKeys` (default: `null`) - An object with visitor key information (like [`eslint-visitor-keys`](https://github.com/eslint/js/tree/main/packages/eslint-visitor-keys)). Without this, `eslint-scope` finds child nodes to visit algorithmically. Providing this option is a performance enhancement.
- `fallback` (default: `"iteration"`) - The strategy to use when `childVisitorKeys` is not specified. May be a function.
- `optimistic` (default: `false`) - Set to `true` to enable optimistic scope analysis.
- `jsx` (default: `false`) - Enables the tracking of JSX components as variable references.

Example:

```js
import * as eslintScope from "eslint-scope";
import * as espree from "espree";
import estraverse from "estraverse";

const options = {
	ecmaVersion: 2022,
	sourceType: "module",
};

const ast = espree.parse(code, { range: true, ...options });
const scopeManager = eslintScope.analyze(ast, options);

const currentScope = scopeManager.acquire(ast); // global scope

estraverse.traverse(ast, {
	enter(node, parent) {
		// do stuff

		if (/Function/.test(node.type)) {
			currentScope = scopeManager.acquire(node); // get current function scope
		}
	},
	leave(node, parent) {
		if (/Function/.test(node.type)) {
			currentScope = currentScope.upper; // set to parent scope
		}

		// do stuff
	},
});
```

## API

The following section describes the API for this package. You can also read [the docs](https://eslint.org/docs/latest/extend/scope-manager-interface).

### ScopeManager

The `ScopeManager` class is at the core of eslint-scope and is returned when you call `eslintScope.analyze()`. It manages all scopes in a given AST.

#### Properties

- `scopes` - An array of all scopes.
- `globalScope` - Reference to the global scope.

#### Methods

- **`addGlobals(names)`**
  Adds variables to the global scope and resolves references to them.
    - `names` - An array of strings, the names of variables to add to the global scope.
    - Returns: `undefined`.

- **`acquire(node, inner)`**
  Acquires the appropriate scope for a given node.
    - `node` - The AST node to acquire the scope from.
    - `inner` - Optional boolean. When `true`, returns the innermost scope, otherwise returns the outermost scope. Default is `false`.
    - Returns: The acquired scope or `null` if no scope is found.

- **`acquireAll(node)` (Deprecated)**
  Acquires all scopes for a given node.
    - `node` - The AST node to acquire scopes from.
    - Returns: An array of scopes or `undefined` if none are found.

- **`release(node, inner)`**
  Returns the upper scope for a given node.
    - `node` - The AST node to release.
    - `inner` - Optional boolean. When `true`, returns the innermost upper scope, otherwise returns the outermost upper scope. Default is `false`.
    - Returns: The upper scope or `null` if no upper scope exists.

- **`getDeclaredVariables(node)`**
  Get variables that are declared by the node.
    - `node` - The AST node to get declarations from.
    - Returns: An array of variable objects declared by the node. If the node doesn't declare any variables, it returns an empty array.

- **`isGlobalReturn()`**
  Determines if the global return statement should be allowed.
    - Returns: `true` if the global return is enabled.

- **`isModule()` (Deprecated)**
  Checks if the code should be handled as an ECMAScript module.
    - Returns: `true` if the sourceType is "module".

- **`isImpliedStrict()` (Deprecated)**
  Checks if implied strict mode is enabled.
    - Returns: `true` if implied strict mode is enabled.

- **`isStrictModeSupported()` (Deprecated)**
  Checks if strict mode is supported based on ECMAScript version.
    - Returns: `true` if the ECMAScript version supports strict mode.

### Scope Objects

Scopes returned by the ScopeManager methods have the following properties:

- `type` - The type of scope (e.g., `"function"`, `"block"`, `"global"`).
- `isStrict` - `true` if this scope is in strict mode.
- `variables` - Array of variables declared in this scope.
- `set` - A Map of variable names to Variable objects for variables declared in this scope.
- `references` - Array of references in this scope.
- `through` - Array of references in this scope and its child scopes that aren't resolved in this scope or its child scopes.
- `functionExpressionScope` - `true` if this is a `"function-expression-name"` scope.
- `variableScope` - Reference to the closest variable scope.
- `upper` - Reference to the parent scope.
- `childScopes` - Array of child scopes.
- `block` - The AST node that created this scope.

### GlobalScope

The `GlobalScope` class is a specialized scope representing the global execution context. It extends the base `Scope` class with additional functionality for handling implicitly defined global variables.

#### Properties

- **`implicit`** - Tracks implicitly defined global variables (those used without declaration).
    - `set` - A Map of variable names to Variable objects for implicitly defined globals.
    - `variables` - Array of implicit global Variable objects.
    - `left` - Array of References that need to be linked to the variable they refer to.

### Variable Objects

Each variable object has the following properties:

- `name` - The variable name.
- `identifiers` - Array of identifier nodes declaring this variable.
- `references` - Array of references to this variable.
- `defs` - Array of definition objects for this variable.
- `scope` - The scope object where this variable is defined.

## Contributing

Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/js/issues).

## Security Policy

We work hard to ensure that ESLint Scope is safe for everyone and that security issues are addressed quickly and responsibly. Read the full [security policy](https://github.com/eslint/.github/blob/master/SECURITY.md).

## Build Commands

- `npm test` - run all linting and tests
- `npm run lint` - run all linting

## License

ESLint Scope is licensed under a permissive BSD 2-clause license.

<!-- NOTE: This section is autogenerated. Do not manually edit.-->
<!--sponsorsstart-->

## Sponsors

The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
to get your logo on our READMEs and [website](https://eslint.org/sponsors).

<h3>Platinum Sponsors</h3>
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a></p><h3>Gold Sponsors</h3>
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a></p><h3>Silver Sponsors</h3>
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/d472863/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/2d6c3b6/logo.png" alt="Liftoff" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" height="32"></a> <a href="https://www.crawljobs.com/"><img src="https://images.opencollective.com/crawljobs-poland/fa43a17/logo.png" alt="CrawlJobs" height="32"></a> <a href="https://depot.dev"><img src="https://images.opencollective.com/depot/39125a1/logo.png" alt="Depot" height="32"></a> <a href="https://www.n-ix.com/"><img src="https://images.opencollective.com/n-ix-ltd/575a7a5/logo.png" alt="N-iX Ltd" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="TestMu AI Open Source Office (Formerly LambdaTest)" height="32"></a></p>
<h3>Technology Sponsors</h3>
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
<!--sponsorsend-->
Z۬x, 100644 eslint-scope.cjs hUw*P}$}=kBx@'use strict';

var estraverse = require('estraverse');
var esrecurse = require('esrecurse');

/**
 * @fileoverview Assertion utilities.
 * @author Nicholas C. Zakas
 */

/**
 * Throws an error if the given condition is not truthy.
 * @param {boolean} condition The condition to check.
 * @param {string} message The message to include with the error.
 * @returns {void}
 * @throws {Error} When the condition is not truthy.
 */
function assert(condition, message = "Assertion failed.") {
	if (!condition) {
		throw new Error(message);
	}
}

/*
  Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/** @import * as types from "eslint-scope" */

const READ = 0x1;
const WRITE = 0x2;
const RW = READ | WRITE;

/**
 * A Reference represents a single occurrence of an identifier in code.
 * @constructor Reference
 * @implements {types.Reference}
 */
class Reference {
	constructor(
		ident,
		scope,
		flag,
		writeExpr,
		maybeImplicitGlobal,
		partial,
		init,
	) {
		/**
		 * Identifier syntax node.
		 * @member {espreeIdentifier} Reference#identifier
		 */
		this.identifier = ident;

		/**
		 * Reference to the enclosing Scope.
		 * @member {Scope} Reference#from
		 */
		this.from = scope;

		/**
		 * Whether the reference comes from a dynamic scope (such as 'eval',
		 * 'with', etc.), and may be trapped by dynamic scopes.
		 * @member {boolean} Reference#tainted
		 */
		this.tainted = false;

		/**
		 * The variable this reference is resolved with.
		 * @member {Variable} Reference#resolved
		 */
		this.resolved = null;

		/**
		 * The read-write mode of the reference. (Value is one of {@link
		 * Reference.READ}, {@link Reference.RW}, {@link Reference.WRITE}).
		 * @member {number} Reference#flag
		 */
		this.flag = flag;
		if (this.isWrite()) {
			/**
			 * If reference is writeable, this is the tree being written to it.
			 * @member {espreeNode} Reference#writeExpr
			 */
			this.writeExpr = writeExpr;

			/**
			 * Whether the Reference might refer to a partial value of writeExpr.
			 * @member {boolean} Reference#partial
			 */
			this.partial = partial;

			/**
			 * Whether the Reference is to write of initialization.
			 * @member {boolean} Reference#init
			 */
			this.init = init;
		}
		this.__maybeImplicitGlobal = maybeImplicitGlobal;
	}

	/**
	 * Whether the reference is static.
	 * @function Reference#isStatic
	 * @returns {boolean} static
	 */
	isStatic() {
		return (
			!this.tainted && !!this.resolved && this.resolved.scope.isStatic()
		);
	}

	/**
	 * Whether the reference is writeable.
	 * @function Reference#isWrite
	 * @returns {boolean} write
	 */
	isWrite() {
		return !!(this.flag & Reference.WRITE);
	}

	/**
	 * Whether the reference is readable.
	 * @function Reference#isRead
	 * @returns {boolean} read
	 */
	isRead() {
		return !!(this.flag & Reference.READ);
	}

	/**
	 * Whether the reference is read-only.
	 * @function Reference#isReadOnly
	 * @returns {boolean} read only
	 */
	isReadOnly() {
		return this.flag === Reference.READ;
	}

	/**
	 * Whether the reference is write-only.
	 * @function Reference#isWriteOnly
	 * @returns {boolean} write only
	 */
	isWriteOnly() {
		return this.flag === Reference.WRITE;
	}

	/**
	 * Whether the reference is read-write.
	 * @function Reference#isReadWrite
	 * @returns {boolean} read write
	 */
	isReadWrite() {
		return this.flag === Reference.RW;
	}
}

/**
 * @constant Reference.READ
 */
Reference.READ = READ;

/**
 * @constant Reference.WRITE
 */
Reference.WRITE = WRITE;

/**
 * @constant Reference.RW
 */
Reference.RW = RW;

/* vim: set sw=4 ts=4 et tw=80 : */

/*
  Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/** @import * as types from "eslint-scope" */
/** @import Reference from "./reference.js" */

/**
 * A Variable represents a locally scoped identifier. These include arguments to
 * functions.
 * @constructor Variable
 * @implements {types.Variable}
 */
class Variable {
	constructor(name, scope) {
		/**
		 * The variable name, as given in the source code.
		 * @member {string} Variable#name
		 */
		this.name = name;

		/**
		 * List of defining occurrences of this variable (like in 'var ...'
		 * statements or as parameter), as AST nodes.
		 * @member {espree.Identifier[]} Variable#identifiers
		 */
		this.identifiers = [];

		/**
		 * List of {@link Reference|references} of this variable (excluding parameter entries)
		 * in its defining scope and all nested scopes. For defining
		 * occurrences only see {@link Variable#defs}.
		 * @member {Reference[]} Variable#references
		 */
		this.references = [];

		/**
		 * List of defining occurrences of this variable (like in 'var ...'
		 * statements or as parameter), as custom objects.
		 * @member {Definition[]} Variable#defs
		 */
		this.defs = [];

		this.tainted = false;

		/**
		 * Whether this is a stack variable.
		 * @member {boolean} Variable#stack
		 */
		this.stack = true;

		/**
		 * Reference to the enclosing Scope.
		 * @member {Scope} Variable#scope
		 */
		this.scope = scope;
	}
}

Variable.CatchClause = "CatchClause";
Variable.Parameter = "Parameter";
Variable.FunctionName = "FunctionName";
Variable.ClassName = "ClassName";
Variable.Variable = "Variable";
Variable.ImportBinding = "ImportBinding";
Variable.ImplicitGlobalVariable = "ImplicitGlobalVariable";

/* vim: set sw=4 ts=4 et tw=80 : */

/*
  Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/


/** @import * as types from "eslint-scope" */

// Cannot implement `types.Definition` directly because it contains a union.
/**
 * @constructor Definition
 * @implements {Omit<types.Definition, never>}
 */
class Definition {
	constructor(type, name, node, parent, index, kind) {
		/**
		 * @member {string} Definition#type - type of the occurrence (e.g. "Parameter", "Variable", ...).
		 */
		this.type = type;

		/**
		 * @member {espree.Identifier} Definition#name - the identifier AST node of the occurrence.
		 */
		this.name = name;

		/**
		 * @member {espree.Node} Definition#node - the enclosing node of the identifier.
		 */
		this.node = node;

		/**
		 * @member {espree.Node?} Definition#parent - the enclosing statement node of the identifier.
		 */
		this.parent = parent;

		/**
		 * @member {number?} Definition#index - the index in the declaration statement.
		 */
		this.index = index;

		/**
		 * @member {string?} Definition#kind - the kind of the declaration statement.
		 */
		this.kind = kind;
	}
}

/**
 * @constructor ParameterDefinition
 */
class ParameterDefinition extends Definition {
	constructor(name, node, index, rest) {
		super(Variable.Parameter, name, node, null, index, null);

		/**
		 * Whether the parameter definition is a part of a rest parameter.
		 * @member {boolean} ParameterDefinition#rest
		 */
		this.rest = rest;
	}
}

/* vim: set sw=4 ts=4 et tw=80 : */

/*
  Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/


/** @import * as types from "eslint-scope" */
/** @import ESTree from "estree" */
/** @import ScopeManager from "./scope-manager.js" */
/** @typedef {ESTree.Function | ESTree.Program | ESTree.StaticBlock} Block */
/** @typedef {{pattern: unknown, node: unknown}} MaybeImplicitGlobal */

const { Syntax: Syntax$2 } = estraverse;

/**
 * Test if scope is struct
 * @param {Scope} scope scope
 * @param {Block} block block
 * @param {boolean} isMethodDefinition is method definition
 * @returns {boolean} is strict scope
 */
function isStrictScope(scope, block, isMethodDefinition) {
	let body;

	// When upper scope is exists and strict, inner scope is also strict.
	if (scope.upper && scope.upper.isStrict) {
		return true;
	}

	if (isMethodDefinition) {
		return true;
	}

	if (scope.type === "class" || scope.type === "module") {
		return true;
	}

	if (scope.type === "block" || scope.type === "switch") {
		return false;
	}

	if (scope.type === "function") {
		if (
			block.type === Syntax$2.ArrowFunctionExpression &&
			// @ts-ignore -- when block is ArrowFunctionExpression
			block.body.type !== Syntax$2.BlockStatement
		) {
			return false;
		}

		if (block.type === Syntax$2.Program) {
			body = block;
		} else {
			body = block.body;
		}

		if (!body) {
			return false;
		}
	} else if (scope.type === "global") {
		body = block;
	} else {
		return false;
	}

	// Search for a 'use strict' directive.
	// @ts-ignore -- body is a function body
	for (let i = 0, iz = body.body.length; i < iz; ++i) {
		// @ts-ignore -- body is a function body
		const stmt = body.body[i];

		/*
		 * Check if the current statement is a directive.
		 * If it isn't, then we're past the directive prologue
		 * so stop the search because directives cannot
		 * appear after this point.
		 *
		 * Some parsers set `directive:null` on non-directive
		 * statements, so the `typeof` check is safer than
		 * checking for property existence.
		 */
		if (typeof stmt.directive !== "string") {
			break;
		}

		if (stmt.directive === "use strict") {
			return true;
		}
	}

	return false;
}

/**
 * Register scope
 * @param {ScopeManager} scopeManager scope manager
 * @param {Scope} scope scope
 * @returns {void}
 */
function registerScope(scopeManager, scope) {
	scopeManager.scopes.push(scope);

	const scopes = scopeManager.__nodeToScope.get(scope.block);

	if (scopes) {
		scopes.push(scope);
	} else {
		scopeManager.__nodeToScope.set(scope.block, [scope]);
	}
}

/**
 * @constructor Scope
 * @implements {types.Scope}
 */
class Scope {
	constructor(scopeManager, type, upperScope, block, isMethodDefinition) {
		/**
		 * One of "global", "module", "function", "function-expression-name", "block", "switch", "catch", "with", "for",
		 * "class", "class-field-initializer", "class-static-block".
		 * @member {string} Scope#type
		 */
		this.type = type;

		/**
		 * The scoped {@link Variable}s of this scope, as <code>{ Variable.name
		 * : Variable }</code>.
		 * @member {Map} Scope#set
		 */
		this.set = new Map();

		/**
		 * The tainted variables of this scope, as <code>{ Variable.name :
		 * boolean }</code>.
		 *  @member {Map} Scope#taints
		 */
		this.taints = new Map();

		/**
		 * Generally, through the lexical scoping of JS you can always know
		 * which variable an identifier in the source code refers to. There are
		 * a few exceptions to this rule. With 'global' and 'with' scopes you
		 * can only decide at runtime which variable a reference refers to.
		 * Moreover, if 'eval()' is used in a scope, it might introduce new
		 * bindings in this or its parent scopes.
		 * All those scopes are considered 'dynamic'.
		 * @member {boolean} Scope#dynamic
		 */
		this.dynamic = this.type === "global" || this.type === "with";

		/**
		 * A reference to the scope-defining syntax node.
		 * @member {espree.Node} Scope#block
		 */
		this.block = block;

		/**
		 * The {@link Reference|references} that are not resolved with this scope.
		 * @member {Reference[]} Scope#through
		 */
		this.through = [];

		/**
		 * The scoped {@link Variable}s of this scope. In the case of a
		 * 'function' scope this includes the automatic argument <em>arguments</em> as
		 * its first element, as well as all further formal arguments.
		 * @member {Variable[]} Scope#variables
		 */
		this.variables = [];

		/**
		 * Any variable {@link Reference|reference} found in this scope. This
		 * includes occurrences of local variables as well as variables from
		 * parent scopes (including the global scope). For local variables
		 * this also includes defining occurrences (like in a 'var' statement).
		 * In a 'function' scope this does not include the occurrences of the
		 * formal parameter in the parameter list.
		 * @member {Reference[]} Scope#references
		 */
		this.references = [];

		/**
		 * For 'global' and 'function' scopes, this is a self-reference. For
		 * other scope types this is the <em>variableScope</em> value of the
		 * parent scope.
		 * @member {Scope} Scope#variableScope
		 */
		this.variableScope =
			this.type === "global" ||
			this.type === "module" ||
			this.type === "function" ||
			this.type === "class-field-initializer" ||
			this.type === "class-static-block"
				? this
				: upperScope.variableScope;

		/**
		 * Whether this scope is created by a FunctionExpression.
		 * @member {boolean} Scope#functionExpressionScope
		 */
		this.functionExpressionScope = /** @type {any} */ (false);

		/**
		 * Whether this is a scope that contains an 'eval()' invocation.
		 * @member {boolean} Scope#directCallToEvalScope
		 */
		this.directCallToEvalScope = false;

		/**
		 * @member {boolean} Scope#thisFound
		 */
		this.thisFound = false;

		/** @type {?Reference[]} */
		this.__left = [];

		/**
		 * Reference to the parent {@link Scope|scope}.
		 * @member {Scope} Scope#upper
		 */
		this.upper = upperScope;

		/**
		 * Whether 'use strict' is in effect in this scope.
		 * @member {boolean} Scope#isStrict
		 */
		this.isStrict = scopeManager.isStrictModeSupported()
			? isStrictScope(this, block, isMethodDefinition)
			: false;

		/**
		 * List of nested {@link Scope}s.
		 * @member {Scope[]} Scope#childScopes
		 */
		this.childScopes = [];
		if (this.upper) {
			this.upper.childScopes.push(this);
		}

		this.__declaredVariables = scopeManager.__declaredVariables;

		registerScope(scopeManager, this);
	}

	__shouldStaticallyClose(scopeManager) {
		return (
			!this.dynamic ||
			scopeManager.__isOptimistic() ||
			this.type === "global"
		);
	}

	__staticCloseRef(ref) {
		if (!this.__resolve(ref)) {
			this.__delegateToUpperScope(ref);
		}
	}

	__dynamicCloseRef(ref) {
		// notify all names are through to global
		let current = this;

		do {
			current.through.push(ref);
			current = current.upper;
		} while (current);
	}

	__close(scopeManager) {
		let closeRef;

		if (this.__shouldStaticallyClose(scopeManager)) {
			closeRef = this.__staticCloseRef;
		} else {
			closeRef = this.__dynamicCloseRef;
		}

		// Try Resolving all references in this scope.
		// @ts-ignore -- __left should be an array here
		for (let i = 0, iz = this.__left.length; i < iz; ++i) {
			// @ts-ignore -- __left should be an array here
			const ref = this.__left[i];

			closeRef.call(this, ref);
		}
		this.__left = null;

		return this.upper;
	}

	// To override by function scopes.
	// References in default parameters isn't resolved to variables which are in their function body.
	// eslint-disable-next-line class-methods-use-this, no-unused-vars  -- Desired as instance method with signature
	__isValidResolution(ref, variable) {
		return true;
	}

	__resolve(ref) {
		const name = ref.identifier.name;

		if (!this.set.has(name)) {
			return false;
		}
		const variable = this.set.get(name);

		if (!this.__isValidResolution(ref, variable)) {
			return false;
		}
		variable.references.push(ref);
		variable.stack =
			variable.stack && ref.from.variableScope === this.variableScope;
		if (ref.tainted) {
			variable.tainted = true;
			this.taints.set(variable.name, true);
		}
		ref.resolved = variable;

		return true;
	}

	__delegateToUpperScope(ref) {
		if (this.upper) {
			this.upper.__left.push(ref);
		}
		this.through.push(ref);
	}

	__addDeclaredVariablesOfNode(variable, node) {
		if (node === null || node === void 0) {
			return;
		}

		let variables = this.__declaredVariables.get(node);

		if (variables === null || variables === void 0) {
			variables = [];
			this.__declaredVariables.set(node, variables);
		}
		if (!variables.includes(variable)) {
			variables.push(variable);
		}
	}

	__defineGeneric(name, set, variables, node, def) {
		let variable;

		variable = set.get(name);
		if (!variable) {
			variable = new Variable(name, this);
			set.set(name, variable);
			variables.push(variable);
		}

		if (def) {
			variable.defs.push(def);
			this.__addDeclaredVariablesOfNode(variable, def.node);
			this.__addDeclaredVariablesOfNode(variable, def.parent);
		}
		if (node) {
			variable.identifiers.push(node);
		}
	}

	__define(node, def) {
		if (node && node.type === Syntax$2.Identifier) {
			this.__defineGeneric(
				node.name,
				this.set,
				this.variables,
				node,
				def,
			);
		}
	}

	__referencing(node, assign, writeExpr, maybeImplicitGlobal, partial, init) {
		// because Array element may be null
		if (
			!node ||
			(node.type !== Syntax$2.Identifier && node.type !== "JSXIdentifier")
		) {
			return;
		}

		// Specially handle like `this`.
		if (node.name === "super") {
			return;
		}

		const ref = new Reference(
			node,
			this,
			assign || Reference.READ,
			writeExpr,
			maybeImplicitGlobal,
			!!partial,
			!!init,
		);

		this.references.push(ref);

		// @ts-ignore -- __left should be an array here
		this.__left.push(ref);
	}

	__detectEval() {
		let current = this;

		this.directCallToEvalScope = true;
		do {
			current.dynamic = true;
			current = current.upper;
		} while (current);
	}

	__detectThis() {
		this.thisFound = true;
	}

	__isClosed() {
		return this.__left === null;
	}

	/**
	 * returns resolved {Reference}
	 * @function Scope#resolve
	 * @param {ESTree.Identifier} ident identifier to be resolved.
	 * @returns {?Reference} reference
	 */
	resolve(ident) {
		let ref, i, iz;

		assert(this.__isClosed(), "Scope should be closed.");
		assert(
			ident.type === Syntax$2.Identifier,
			"Target should be identifier.",
		);
		for (i = 0, iz = this.references.length; i < iz; ++i) {
			ref = this.references[i];
			if (ref.identifier === ident) {
				return ref;
			}
		}
		return null;
	}

	/**
	 * returns this scope is static
	 * @function Scope#isStatic
	 * @returns {boolean} static
	 */
	isStatic() {
		return !this.dynamic;
	}

	/**
	 * returns this scope has materialized arguments
	 * @function Scope#isArgumentsMaterialized
	 * @returns {any} arguments materialized
	 */ // eslint-disable-next-line class-methods-use-this -- Desired as instance method
	isArgumentsMaterialized() {
		return true;
	}

	/**
	 * returns this scope has materialized `this` reference
	 * @function Scope#isThisMaterialized
	 * @returns {any} this materialized
	 */ // eslint-disable-next-line class-methods-use-this -- Desired as instance method
	isThisMaterialized() {
		return true;
	}

	isUsedName(name) {
		if (this.set.has(name)) {
			return true;
		}
		for (let i = 0, iz = this.through.length; i < iz; ++i) {
			if (this.through[i].identifier.name === name) {
				return true;
			}
		}
		return false;
	}
}

/**
 * Global scope.
 * @implements {types.GlobalScope}
 */
class GlobalScope extends Scope {
	constructor(scopeManager, block) {
		super(scopeManager, "global", null, block, false);
		this.implicit = {
			set: new Map(),

			/** @type {Variable[]} */
			variables: [],

			/**
			 * List of {@link Reference}s that are left to be resolved (i.e. which
			 * need to be linked to the variable they refer to).
			 * @member {Reference[]} Scope#implicit#left
			 * @type {Reference[]}
			 */
			left: [],
		};
	}

	__close(scopeManager) {
		const implicit = [];

		// @ts-ignore -- __left should be an array here
		for (let i = 0, iz = this.__left.length; i < iz; ++i) {
			// @ts-ignore -- __left should be an array here
			const ref = this.__left[i];

			if (
				ref.__maybeImplicitGlobal &&
				!this.set.has(ref.identifier.name)
			) {
				implicit.push(ref.__maybeImplicitGlobal);
			}
		}

		// create an implicit global variable from assignment expression
		for (let i = 0, iz = implicit.length; i < iz; ++i) {
			const info = implicit[i];

			this.__defineImplicit(
				info.pattern,
				new Definition(
					Variable.ImplicitGlobalVariable,
					info.pattern,
					info.node,
					null,
					null,
					null,
				),
			);
		}

		super.__close(scopeManager);

		this.implicit.left = [...this.through];

		return null;
	}

	__defineImplicit(node, def) {
		if (node && node.type === Syntax$2.Identifier) {
			this.__defineGeneric(
				node.name,
				this.implicit.set,
				this.implicit.variables,
				node,
				def,
			);
		}
	}

	__addVariables(names) {
		for (const name of names) {
			this.__defineGeneric(name, this.set, this.variables, null, null);
		}

		const namesSet = new Set(names);

		this.through = this.through.filter(reference => {
			const name = reference.identifier.name;

			if (namesSet.has(name)) {
				const variable = this.set.get(name);

				reference.resolved = variable;
				variable.references.push(reference);

				return false;
			}

			return true;
		});

		this.implicit.variables = this.implicit.variables.filter(variable => {
			const name = variable.name;

			if (namesSet.has(name)) {
				this.implicit.set.delete(name);

				return false;
			}

			return true;
		});

		this.implicit.left = this.implicit.left.filter(
			reference => !namesSet.has(reference.identifier.name),
		);
	}
}

/**
 * Module scope.
 * @implements {types.ModuleScope}
 */
class ModuleScope extends Scope {
	constructor(scopeManager, upperScope, block) {
		super(scopeManager, "module", upperScope, block, false);
	}
}

/**
 * Function expression name scope.
 * @implements {types.FunctionExpressionNameScope}
 */
class FunctionExpressionNameScope extends Scope {
	constructor(scopeManager, upperScope, block) {
		super(
			scopeManager,
			"function-expression-name",
			upperScope,
			block,
			false,
		);
		this.__define(
			block.id,
			new Definition(
				Variable.FunctionName,
				block.id,
				block,
				null,
				null,
				null,
			),
		);
		this.functionExpressionScope = /** @type {const} */ (true);
	}
}

/**
 * Catch scope.
 * @implements {types.CatchScope}
 */
class CatchScope extends Scope {
	constructor(scopeManager, upperScope, block) {
		super(scopeManager, "catch", upperScope, block, false);
	}
}

/**
 * With statement scope.
 * @implements {types.WithScope}
 */
class WithScope extends Scope {
	constructor(scopeManager, upperScope, block) {
		super(scopeManager, "with", upperScope, block, false);
	}

	__close(scopeManager) {
		if (this.__shouldStaticallyClose(scopeManager)) {
			return super.__close(scopeManager);
		}

		// @ts-ignore -- __left should be an array here
		for (let i = 0, iz = this.__left.length; i < iz; ++i) {
			// @ts-ignore -- __left should be an array here
			const ref = this.__left[i];

			ref.tainted = true;
			this.__delegateToUpperScope(ref);
		}
		this.__left = null;

		return this.upper;
	}
}

/**
 * Block scope.
 * @implements {types.BlockScope}
 */
class BlockScope extends Scope {
	constructor(scopeManager, upperScope, block) {
		super(scopeManager, "block", upperScope, block, false);
	}
}

/**
 * Switch scope.
 * @implements {types.SwitchScope}
 */
class SwitchScope extends Scope {
	constructor(scopeManager, upperScope, block) {
		super(scopeManager, "switch", upperScope, block, false);
	}
}

/**
 * Function scope.
 * @implements {types.FunctionScope}
 */
class FunctionScope extends Scope {
	constructor(scopeManager, upperScope, block, isMethodDefinition) {
		super(scopeManager, "function", upperScope, block, isMethodDefinition);

		// section 9.2.13, FunctionDeclarationInstantiation.
		// NOTE Arrow functions never have an arguments objects.
		if (this.block.type !== Syntax$2.ArrowFunctionExpression) {
			this.__defineArguments();
		}
	}

	isArgumentsMaterialized() {
		// TODO(Constellation)
		// We can more aggressive on this condition like this.
		//
		// function t() {
		//     // arguments of t is always hidden.
		//     function arguments() {
		//     }
		// }
		if (this.block.type === Syntax$2.ArrowFunctionExpression) {
			return false;
		}

		if (!this.isStatic()) {
			return true;
		}

		const variable = this.set.get("arguments");

		assert(variable, "Always have arguments variable.");
		return variable.tainted || variable.references.length !== 0;
	}

	isThisMaterialized() {
		if (!this.isStatic()) {
			return true;
		}
		return this.thisFound;
	}

	__defineArguments() {
		this.__defineGeneric("arguments", this.set, this.variables, null, null);
		this.taints.set("arguments", true);
	}

	// References in default parameters isn't resolved to variables which are in their function body.
	//     const x = 1
	//     function f(a = x) { // This `x` is resolved to the `x` in the outer scope.
	//         const x = 2
	//         console.log(a)
	//     }
	__isValidResolution(ref, variable) {
		// If `options.nodejsScope` is true, `this.block` becomes a Program node.
		if (this.block.type === "Program") {
			return true;
		}

		const bodyStart = this.block.body.range[0];

		// It's invalid resolution in the following case:
		return !(
			variable.scope === this &&
			ref.identifier.range[0] < bodyStart && // the reference is in the parameter part.
			variable.defs.every(d => d.name.range[0] >= bodyStart) // the variable is in the body.
		);
	}
}

/**
 * Scope of for, for-in, and for-of statements.
 * @implements {types.ForScope}
 */
class ForScope extends Scope {
	constructor(scopeManager, upperScope, block) {
		super(scopeManager, "for", upperScope, block, false);
	}
}

/**
 * Class scope.
 * @implements {types.ClassScope}
 */
class ClassScope extends Scope {
	constructor(scopeManager, upperScope, block) {
		super(scopeManager, "class", upperScope, block, false);
	}
}

/**
 * Class field initializer scope.
 * @implements {types.ClassFieldInitializerScope}
 */
class ClassFieldInitializerScope extends Scope {
	constructor(scopeManager, upperScope, block) {
		super(scopeManager, "class-field-initializer", upperScope, block, true);
	}
}

/**
 * Class static block scope.
 * @implements {types.ClassStaticBlockScope}
 */
class ClassStaticBlockScope extends Scope {
	constructor(scopeManager, upperScope, block) {
		super(scopeManager, "class-static-block", upperScope, block, true);
	}
}

/* vim: set sw=4 ts=4 et tw=80 : */

/*
  Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/


/** @import * as types from "eslint-scope" */
/** @import ESTree from "estree" */
/** @import { Scope } from "./scope.js" */
/** @import Variable from "./variable.js" */

/**
 * @constructor ScopeManager
 * @implements {types.ScopeManager}
 */
class ScopeManager {
	constructor(options) {
		this.scopes = [];
		this.globalScope = null;
		this.__nodeToScope = new WeakMap();
		this.__currentScope = null;
		this.__options = options;
		this.__declaredVariables = new WeakMap();
	}

	__isOptimistic() {
		return this.__options.optimistic;
	}

	__ignoreEval() {
		return this.__options.ignoreEval;
	}

	__isJSXEnabled() {
		return this.__options.jsx === true;
	}

	isGlobalReturn() {
		return (
			this.__options.nodejsScope ||
			this.__options.sourceType === "commonjs"
		);
	}

	isModule() {
		return this.__options.sourceType === "module";
	}

	isImpliedStrict() {
		return !!this.__options.impliedStrict;
	}

	isStrictModeSupported() {
		return this.__options.ecmaVersion >= 5;
	}

	// Returns appropriate scope for this node.
	__get(node) {
		return this.__nodeToScope.get(node);
	}

	/**
	 * Get variables that are declared by the node.
	 *
	 * "are declared by the node" means the node is same as `Variable.defs[].node` or `Variable.defs[].parent`.
	 * If the node declares nothing, this method returns an empty array.
	 * CAUTION: This API is experimental. See https://github.com/estools/escope/pull/69 for more details.
	 * @param {ESTree.Node} node a node to get.
	 * @returns {Variable[]} variables that declared by the node.
	 */
	getDeclaredVariables(node) {
		return this.__declaredVariables.get(node) || [];
	}

	/**
	 * acquire scope from node.
	 * @function ScopeManager#acquire
	 * @param {ESTree.Node} node node for the acquired scope.
	 * @param {?boolean} [inner=false] look up the most inner scope, default value is false.
	 * @returns {Scope?} Scope from node
	 */
	acquire(node, inner) {
		/**
		 * predicate
		 * @param {Scope} testScope scope to test
		 * @returns {boolean} predicate
		 */
		function predicate(testScope) {
			if (
				testScope.type === "function" &&
				testScope.functionExpressionScope
			) {
				return false;
			}
			return true;
		}

		const scopes = this.__get(node);

		if (!scopes || scopes.length === 0) {
			return null;
		}

		// Heuristic selection from all scopes.
		// If you would like to get all scopes, please use ScopeManager#acquireAll.
		if (scopes.length === 1) {
			return scopes[0];
		}

		if (inner) {
			for (let i = scopes.length - 1; i >= 0; --i) {
				const scope = scopes[i];

				if (predicate(scope)) {
					return scope;
				}
			}
		} else {
			for (let i = 0, iz = scopes.length; i < iz; ++i) {
				const scope = scopes[i];

				if (predicate(scope)) {
					return scope;
				}
			}
		}

		return null;
	}

	/**
	 * acquire all scopes from node.
	 * @function ScopeManager#acquireAll
	 * @param {ESTree.Node} node node for the acquired scope.
	 * @returns {Scope[]?} Scope array
	 */
	acquireAll(node) {
		return this.__get(node);
	}

	/**
	 * release the node.
	 * @function ScopeManager#release
	 * @param {ESTree.Node} node releasing node.
	 * @param {?boolean} [inner=false] look up the most inner scope, default value is false.
	 * @returns {Scope?} upper scope for the node.
	 */
	release(node, inner) {
		const scopes = this.__get(node);

		if (scopes && scopes.length) {
			const scope = scopes[0].upper;

			if (!scope) {
				return null;
			}
			return this.acquire(scope.block, inner);
		}
		return null;
	}

	/**
	 * Add global variables and resolve their references.
	 * @function ScopeManager#addGlobals
	 * @param {string[]} names Names of global variables to add.
	 * @returns {void}
	 */
	addGlobals(names) {
		// @ts-ignore -- globalScope must be set before this method is called.
		this.globalScope.__addVariables(names);
	}

	attach() {} // eslint-disable-line class-methods-use-this -- Desired as instance method

	detach() {} // eslint-disable-line class-methods-use-this -- Desired as instance method

	__nestScope(scope) {
		if (scope instanceof GlobalScope) {
			assert(this.__currentScope === null);
			this.globalScope = scope;
		}
		this.__currentScope = scope;
		return scope;
	}

	__nestGlobalScope(node) {
		return this.__nestScope(new GlobalScope(this, node));
	}

	__nestBlockScope(node) {
		return this.__nestScope(
			new BlockScope(this, this.__currentScope, node),
		);
	}

	__nestFunctionScope(node, isMethodDefinition) {
		return this.__nestScope(
			new FunctionScope(
				this,
				this.__currentScope,
				node,
				isMethodDefinition,
			),
		);
	}

	__nestForScope(node) {
		return this.__nestScope(new ForScope(this, this.__currentScope, node));
	}

	__nestCatchScope(node) {
		return this.__nestScope(
			new CatchScope(this, this.__currentScope, node),
		);
	}

	__nestWithScope(node) {
		return this.__nestScope(new WithScope(this, this.__currentScope, node));
	}

	__nestClassScope(node) {
		return this.__nestScope(
			new ClassScope(this, this.__currentScope, node),
		);
	}

	__nestClassFieldInitializerScope(node) {
		return this.__nestScope(
			new ClassFieldInitializerScope(this, this.__currentScope, node),
		);
	}

	__nestClassStaticBlockScope(node) {
		return this.__nestScope(
			new ClassStaticBlockScope(this, this.__currentScope, node),
		);
	}

	__nestSwitchScope(node) {
		return this.__nestScope(
			new SwitchScope(this, this.__currentScope, node),
		);
	}

	__nestModuleScope(node) {
		return this.__nestScope(
			new ModuleScope(this, this.__currentScope, node),
		);
	}

	__nestFunctionExpressionNameScope(node) {
		return this.__nestScope(
			new FunctionExpressionNameScope(this, this.__currentScope, node),
		);
	}

	__isES6() {
		return this.__options.ecmaVersion >= 6;
	}
}

/* vim: set sw=4 ts=4 et tw=80 : */

/*
  Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/


/** @import * as types from "eslint-scope" */

const { Syntax: Syntax$1 } = estraverse;

/**
 * Get last array element
 * @param {Array} xs array
 * @returns {any} Last elment
 */
function getLast(xs) {
	return xs.at(-1) || null;
}

/**
 * Visitor for destructuring patterns.
 * @implements {types.PatternVisitor}
 */
class PatternVisitor extends esrecurse.Visitor {
	static isPattern(node) {
		const nodeType = node.type;

		return (
			nodeType === Syntax$1.Identifier ||
			nodeType === Syntax$1.ObjectPattern ||
			nodeType === Syntax$1.ArrayPattern ||
			nodeType === Syntax$1.SpreadElement ||
			nodeType === Syntax$1.RestElement ||
			nodeType === Syntax$1.AssignmentPattern
		);
	}

	constructor(options, rootPattern, callback) {
		super(null, options);
		this.rootPattern = rootPattern;
		this.callback = callback;
		this.assignments = [];
		this.rightHandNodes = [];
		this.restElements = [];
	}

	Identifier(pattern) {
		const lastRestElement = getLast(this.restElements);

		this.callback(pattern, {
			topLevel: pattern === this.rootPattern,
			rest:
				lastRestElement !== null &&
				lastRestElement !== void 0 &&
				lastRestElement.argument === pattern,
			assignments: this.assignments,
		});
	}

	Property(property) {
		// Computed property's key is a right hand node.
		if (property.computed) {
			this.rightHandNodes.push(property.key);
		}

		// If it's shorthand, its key is same as its value.
		// If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern).
		// If it's not shorthand, the name of new variable is its value's.
		this.visit(property.value);
	}

	ArrayPattern(pattern) {
		for (let i = 0, iz = pattern.elements.length; i < iz; ++i) {
			const element = pattern.elements[i];

			this.visit(element);
		}
	}

	AssignmentPattern(pattern) {
		this.assignments.push(pattern);
		this.visit(pattern.left);
		this.rightHandNodes.push(pattern.right);
		this.assignments.pop();
	}

	RestElement(pattern) {
		this.restElements.push(pattern);
		this.visit(pattern.argument);
		this.restElements.pop();
	}

	MemberExpression(node) {
		// Computed property's key is a right hand node.
		if (node.computed) {
			this.rightHandNodes.push(node.property);
		}

		// the object is only read, write to its property.
		this.rightHandNodes.push(node.object);
	}

	//
	// ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression.
	// By spec, LeftHandSideExpression is Pattern or MemberExpression.
	//   (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758)
	// But espree 2.0 parses to ArrayExpression, ObjectExpression, etc...
	//

	SpreadElement(node) {
		this.visit(node.argument);
	}

	ArrayExpression(node) {
		node.elements.forEach(this.visit, this);
	}

	AssignmentExpression(node) {
		this.assignments.push(node);
		this.visit(node.left);
		this.rightHandNodes.push(node.right);
		this.assignments.pop();
	}

	CallExpression(node) {
		// arguments are right hand nodes.
		node.arguments.forEach(a => {
			this.rightHandNodes.push(a);
		});
		this.visit(node.callee);
	}
}

/* vim: set sw=4 ts=4 et tw=80 : */

/*
  Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/


/** @import * as types from "eslint-scope" */
/** @import ESTree from "estree" */

const { Syntax } = estraverse;

/**
 * Traverse identifier in pattern
 * @param {Object} options options
 * @param {ESTree.Pattern} rootPattern root pattern
 * @param {?Referencer} referencer referencer
 * @param {types.PatternVisitorCallback} callback callback
 * @returns {void}
 */
function traverseIdentifierInPattern(
	options,
	rootPattern,
	referencer,
	callback,
) {
	// Call the callback at left hand identifier nodes, and Collect right hand nodes.
	const visitor = new PatternVisitor(options, rootPattern, callback);

	visitor.visit(rootPattern);

	// Process the right hand nodes recursively.
	if (referencer !== null && referencer !== void 0) {
		visitor.rightHandNodes.forEach(referencer.visit, referencer);
	}
}

// Importing ImportDeclaration.
// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-moduledeclarationinstantiation
// https://github.com/estree/estree/blob/master/es6.md#importdeclaration
// FIXME: Now, we don't create module environment, because the context is
// implementation dependent.

/**
 * Visitor for import specifiers.
 */
class Importer extends esrecurse.Visitor {
	constructor(declaration, referencer) {
		super(null, referencer.options);
		this.declaration = declaration;
		this.referencer = referencer;
	}

	visitImport(id, specifier) {
		this.referencer.visitPattern(id, pattern => {
			this.referencer
				.currentScope()
				.__define(
					pattern,
					new Definition(
						Variable.ImportBinding,
						pattern,
						specifier,
						this.declaration,
						null,
						null,
					),
				);
		});
	}

	ImportNamespaceSpecifier(node) {
		const local = node.local || node.id;

		if (local) {
			this.visitImport(local, node);
		}
	}

	ImportDefaultSpecifier(node) {
		const local = node.local || node.id;

		this.visitImport(local, node);
	}

	ImportSpecifier(node) {
		const local = node.local || node.id;

		if (node.name) {
			this.visitImport(node.name, node);
		} else {
			this.visitImport(local, node);
		}
	}
}

/**
 * Referencing variables and creating bindings.
 * @implements {types.Referencer}
 */
class Referencer extends esrecurse.Visitor {
	constructor(options, scopeManager) {
		super(null, options);
		this.options = options;
		this.scopeManager = scopeManager;
		this.parent = null;
		this.isInnerMethodDefinition = false;
	}

	currentScope() {
		return this.scopeManager.__currentScope;
	}

	close(node) {
		while (this.currentScope() && node === this.currentScope().block) {
			this.scopeManager.__currentScope = this.currentScope().__close(
				this.scopeManager,
			);
		}
	}

	pushInnerMethodDefinition(isInnerMethodDefinition) {
		const previous = this.isInnerMethodDefinition;

		this.isInnerMethodDefinition = isInnerMethodDefinition;
		return previous;
	}

	popInnerMethodDefinition(isInnerMethodDefinition) {
		this.isInnerMethodDefinition = isInnerMethodDefinition;
	}

	referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) {
		const scope = this.currentScope();

		assignments.forEach(assignment => {
			scope.__referencing(
				pattern,
				Reference.WRITE,
				assignment.right,
				maybeImplicitGlobal,
				pattern !== assignment.left,
				init,
			);
		});
	}

	visitPattern(node, options, callback) {
		let visitPatternOptions = options;
		let visitPatternCallback = callback;

		if (typeof options === "function") {
			visitPatternCallback = options;
			visitPatternOptions = { processRightHandNodes: false };
		}

		traverseIdentifierInPattern(
			this.options,
			node,
			visitPatternOptions.processRightHandNodes ? this : null,
			visitPatternCallback,
		);
	}

	visitFunction(node) {
		let i, iz;

		// FunctionDeclaration name is defined in upper scope
		// NOTE: Not referring variableScope. It is intended.
		// Since
		//  in ES5, FunctionDeclaration should be in FunctionBody.
		//  in ES6, FunctionDeclaration should be block scoped.

		if (node.type === Syntax.FunctionDeclaration) {
			// id is defined in upper scope
			this.currentScope().__define(
				node.id,
				new Definition(
					Variable.FunctionName,
					node.id,
					node,
					null,
					null,
					null,
				),
			);
		}

		// FunctionExpression with name creates its special scope;
		// FunctionExpressionNameScope.
		if (node.type === Syntax.FunctionExpression && node.id) {
			this.scopeManager.__nestFunctionExpressionNameScope(node);
		}

		// Consider this function is in the MethodDefinition.
		this.scopeManager.__nestFunctionScope(
			node,
			this.isInnerMethodDefinition,
		);

		const that = this;

		/**
		 * Visit pattern callback
		 * @param {ESTree.Pattern} pattern pattern
		 * @param {Object} info info
		 * @returns {void}
		 */
		function visitPatternCallback(pattern, info) {
			that.currentScope().__define(
				pattern,
				new ParameterDefinition(pattern, node, i, info.rest),
			);

			that.referencingDefaultValue(pattern, info.assignments, null, true);
		}

		// Process parameter declarations.
		for (i = 0, iz = node.params.length; i < iz; ++i) {
			this.visitPattern(
				node.params[i],
				{ processRightHandNodes: true },
				visitPatternCallback,
			);
		}

		// if there's a rest argument, add that
		if (node.rest) {
			this.visitPattern(
				{
					type: "RestElement",
					argument: node.rest,
				},
				pattern => {
					this.currentScope().__define(
						pattern,
						new ParameterDefinition(
							pattern,
							node,
							node.params.length,
							true,
						),
					);
				},
			);
		}

		// In TypeScript there are a number of function-like constructs which have no body,
		// so check it exists before traversing
		if (node.body) {
			// Skip BlockStatement to prevent creating BlockStatement scope.
			if (node.body.type === Syntax.BlockStatement) {
				this.visitChildren(node.body);
			} else {
				this.visit(node.body);
			}
		}

		this.close(node);
	}

	visitClass(node) {
		if (node.type === Syntax.ClassDeclaration) {
			this.currentScope().__define(
				node.id,
				new Definition(
					Variable.ClassName,
					node.id,
					node,
					null,
					null,
					null,
				),
			);
		}

		this.scopeManager.__nestClassScope(node);

		if (node.id) {
			this.currentScope().__define(
				node.id,
				new Definition(Variable.ClassName, node.id, node),
			);
		}

		this.visit(node.superClass);
		this.visit(node.body);

		this.close(node);
	}

	visitProperty(node) {
		let previous;

		if (node.computed) {
			this.visit(node.key);
		}

		const isMethodDefinition = node.type === Syntax.MethodDefinition;

		if (isMethodDefinition) {
			previous = this.pushInnerMethodDefinition(true);
		}
		this.visit(node.value);
		if (isMethodDefinition) {
			this.popInnerMethodDefinition(previous);
		}
	}

	visitForIn(node) {
		if (
			node.left.type === Syntax.VariableDeclaration &&
			node.left.kind !== "var"
		) {
			this.scopeManager.__nestForScope(node);
		}

		if (node.left.type === Syntax.VariableDeclaration) {
			this.visit(node.left);
			this.visitPattern(node.left.declarations[0].id, pattern => {
				this.currentScope().__referencing(
					pattern,
					Reference.WRITE,
					node.right,
					null,
					true,
					true,
				);
			});
		} else {
			this.visitPattern(
				node.left,
				{ processRightHandNodes: true },
				(pattern, info) => {
					let maybeImplicitGlobal = null;

					if (!this.currentScope().isStrict) {
						maybeImplicitGlobal = {
							pattern,
							node,
						};
					}
					this.referencingDefaultValue(
						pattern,
						info.assignments,
						maybeImplicitGlobal,
						false,
					);
					this.currentScope().__referencing(
						pattern,
						Reference.WRITE,
						node.right,
						maybeImplicitGlobal,
						true,
						false,
					);
				},
			);
		}
		this.visit(node.right);
		this.visit(node.body);

		this.close(node);
	}

	visitVariableDeclaration(variableTargetScope, type, node, index) {
		const decl = node.declarations[index];
		const init = decl.init;

		this.visitPattern(
			decl.id,
			{ processRightHandNodes: true },
			(pattern, info) => {
				variableTargetScope.__define(
					pattern,
					new Definition(type, pattern, decl, node, index, node.kind),
				);

				this.referencingDefaultValue(
					pattern,
					info.assignments,
					null,
					true,
				);
				if (init) {
					this.currentScope().__referencing(
						pattern,
						Reference.WRITE,
						init,
						null,
						!info.topLevel,
						true,
					);
				}
			},
		);
	}

	AssignmentExpression(node) {
		if (PatternVisitor.isPattern(node.left)) {
			if (node.operator === "=") {
				this.visitPattern(
					node.left,
					{ processRightHandNodes: true },
					(pattern, info) => {
						let maybeImplicitGlobal = null;

						if (!this.currentScope().isStrict) {
							maybeImplicitGlobal = {
								pattern,
								node,
							};
						}
						this.referencingDefaultValue(
							pattern,
							info.assignments,
							maybeImplicitGlobal,
							false,
						);
						this.currentScope().__referencing(
							pattern,
							Reference.WRITE,
							node.right,
							maybeImplicitGlobal,
							!info.topLevel,
							false,
						);
					},
				);
			} else {
				this.currentScope().__referencing(
					node.left,
					Reference.RW,
					node.right,
				);
			}
		} else {
			this.visit(node.left);
		}
		this.visit(node.right);
	}

	CatchClause(node) {
		this.scopeManager.__nestCatchScope(node);

		this.visitPattern(
			node.param,
			{ processRightHandNodes: true },
			(pattern, info) => {
				this.currentScope().__define(
					pattern,
					new Definition(
						Variable.CatchClause,
						pattern,
						node,
						null,
						null,
						null,
					),
				);
				this.referencingDefaultValue(
					pattern,
					info.assignments,
					null,
					true,
				);
			},
		);
		this.visit(node.body);

		this.close(node);
	}

	Program(node) {
		this.scopeManager.__nestGlobalScope(node);

		if (this.scopeManager.isGlobalReturn()) {
			// Force strictness of GlobalScope to false when using node.js scope.
			this.currentScope().isStrict = false;
			this.scopeManager.__nestFunctionScope(node, false);
		}

		if (this.scopeManager.__isES6() && this.scopeManager.isModule()) {
			this.scopeManager.__nestModuleScope(node);
		}

		if (
			this.scopeManager.isStrictModeSupported() &&
			this.scopeManager.isImpliedStrict()
		) {
			this.currentScope().isStrict = true;
		}

		this.visitChildren(node);
		this.close(node);
	}

	Identifier(node) {
		this.currentScope().__referencing(node);
	}

	// eslint-disable-next-line class-methods-use-this -- Desired as instance method
	PrivateIdentifier() {
		// Do nothing.
	}

	UpdateExpression(node) {
		if (PatternVisitor.isPattern(node.argument)) {
			this.currentScope().__referencing(
				node.argument,
				Reference.RW,
				null,
			);
		} else {
			this.visitChildren(node);
		}
	}

	MemberExpression(node) {
		this.visit(node.object);
		if (node.computed) {
			this.visit(node.property);
		}
	}

	Property(node) {
		this.visitProperty(node);
	}

	PropertyDefinition(node) {
		const { computed, key, value } = node;

		if (computed) {
			this.visit(key);
		}
		if (value) {
			this.scopeManager.__nestClassFieldInitializerScope(value);
			this.visit(value);
			this.close(value);
		}
	}

	StaticBlock(node) {
		this.scopeManager.__nestClassStaticBlockScope(node);

		this.visitChildren(node);

		this.close(node);
	}

	MethodDefinition(node) {
		this.visitProperty(node);
	}

	BreakStatement() {} // eslint-disable-line class-methods-use-this -- Desired as instance method

	ContinueStatement() {} // eslint-disable-line class-methods-use-this -- Desired as instance method

	LabeledStatement(node) {
		this.visit(node.body);
	}

	ForStatement(node) {
		// Create ForStatement declaration.
		// NOTE: In ES6, ForStatement dynamically generates
		// per iteration environment. However, escope is
		// a static analyzer, we only generate one scope for ForStatement.
		if (
			node.init &&
			node.init.type === Syntax.VariableDeclaration &&
			node.init.kind !== "var"
		) {
			this.scopeManager.__nestForScope(node);
		}

		this.visitChildren(node);

		this.close(node);
	}

	ClassExpression(node) {
		this.visitClass(node);
	}

	ClassDeclaration(node) {
		this.visitClass(node);
	}

	CallExpression(node) {
		// Check this is direct call to eval
		if (
			!this.scopeManager.__ignoreEval() &&
			node.callee.type === Syntax.Identifier &&
			node.callee.name === "eval"
		) {
			// NOTE: This should be `variableScope`. Since direct eval call always creates Lexical environment and
			// let / const should be enclosed into it. Only VariableDeclaration affects on the caller's environment.
			this.currentScope().variableScope.__detectEval();
		}
		this.visitChildren(node);
	}

	BlockStatement(node) {
		if (this.scopeManager.__isES6()) {
			this.scopeManager.__nestBlockScope(node);
		}

		this.visitChildren(node);

		this.close(node);
	}

	ThisExpression() {
		this.currentScope().variableScope.__detectThis();
	}

	WithStatement(node) {
		this.visit(node.object);

		// Then nest scope for WithStatement.
		this.scopeManager.__nestWithScope(node);

		this.visit(node.body);

		this.close(node);
	}

	VariableDeclaration(node) {
		const variableTargetScope =
			node.kind === "var"
				? this.currentScope().variableScope
				: this.currentScope();

		for (let i = 0, iz = node.declarations.length; i < iz; ++i) {
			const decl = node.declarations[i];

			this.visitVariableDeclaration(
				variableTargetScope,
				Variable.Variable,
				node,
				i,
			);
			if (decl.init) {
				this.visit(decl.init);
			}
		}
	}

	// sec 13.11.8
	SwitchStatement(node) {
		this.visit(node.discriminant);

		if (this.scopeManager.__isES6()) {
			this.scopeManager.__nestSwitchScope(node);
		}

		for (let i = 0, iz = node.cases.length; i < iz; ++i) {
			this.visit(node.cases[i]);
		}

		this.close(node);
	}

	FunctionDeclaration(node) {
		this.visitFunction(node);
	}

	FunctionExpression(node) {
		this.visitFunction(node);
	}

	ForOfStatement(node) {
		this.visitForIn(node);
	}

	ForInStatement(node) {
		this.visitForIn(node);
	}

	ArrowFunctionExpression(node) {
		this.visitFunction(node);
	}

	ImportDeclaration(node) {
		assert(
			this.scopeManager.__isES6() && this.scopeManager.isModule(),
			"ImportDeclaration should appear when the mode is ES6 and in the module context.",
		);

		const importer = new Importer(node, this);

		importer.visit(node);
	}

	visitExportDeclaration(node) {
		if (node.source) {
			return;
		}
		if (node.declaration) {
			this.visit(node.declaration);
			return;
		}

		this.visitChildren(node);
	}

	// TODO: ExportDeclaration doesn't exist. for bc?
	ExportDeclaration(node) {
		this.visitExportDeclaration(node);
	}

	ExportAllDeclaration(node) {
		this.visitExportDeclaration(node);
	}

	ExportDefaultDeclaration(node) {
		this.visitExportDeclaration(node);
	}

	ExportNamedDeclaration(node) {
		this.visitExportDeclaration(node);
	}

	ExportSpecifier(node) {
		// TODO: `node.id` doesn't exist. for bc?
		const local = node.id || node.local;

		this.visit(local);
	}

	// eslint-disable-next-line class-methods-use-this -- Desired as instance method
	MetaProperty() {
		// do nothing.
	}

	JSXIdentifier(node) {
		// Special case: "this" should not count as a reference
		if (this.scopeManager.__isJSXEnabled() && node.name !== "this") {
			this.currentScope().__referencing(node);
		}
	}

	JSXMemberExpression(node) {
		this.visit(node.object);
	}

	JSXElement(node) {
		if (this.scopeManager.__isJSXEnabled()) {
			this.visit(node.openingElement);
			node.children.forEach(this.visit, this);
		} else {
			this.visitChildren(node);
		}
	}

	JSXOpeningElement(node) {
		if (this.scopeManager.__isJSXEnabled()) {
			const nameNode = node.name;
			const isComponentName =
				nameNode.type === "JSXIdentifier" &&
				nameNode.name[0].toUpperCase() === nameNode.name[0];
			const isComponent =
				isComponentName || nameNode.type === "JSXMemberExpression";

			// we only want to visit JSXIdentifier nodes if they are capitalized
			if (isComponent) {
				this.visit(nameNode);
			}
		}

		node.attributes.forEach(this.visit, this);
	}

	JSXAttribute(node) {
		if (node.value) {
			this.visit(node.value);
		}
	}

	JSXExpressionContainer(node) {
		this.visit(node.expression);
	}

	JSXNamespacedName(node) {
		this.visit(node.namespace);
		this.visit(node.name);
	}
}

/* vim: set sw=4 ts=4 et tw=80 : */

/*
  Copyright (C) 2012-2014 Yusuke Suzuki <utatane.tea@gmail.com>
  Copyright (C) 2013 Alex Seville <hi@alexanderseville.com>
  Copyright (C) 2014 Thiago de Arruda <tpadilha84@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/


/** @import ESTree from "estree" */

/**
 * Set the default options
 * @returns {Object} options
 */
function defaultOptions() {
	return {
		optimistic: false,
		nodejsScope: false,
		impliedStrict: false,
		sourceType: "script", // one of ['script', 'module', 'commonjs']
		ecmaVersion: 5,
		childVisitorKeys: null,
		fallback: "iteration",
	};
}

/**
 * Preform deep update on option object
 * @param {Record<string, unknown>} target Options
 * @param {Record<string, unknown>} override Updates
 * @returns {Record<string, unknown>} Updated options
 */
function updateDeeply(target, override) {
	/**
	 * Is hash object
	 * @param {Object} value Test value
	 * @returns {value is Record<string, unknown>} Result
	 */
	function isHashObject(value) {
		return (
			typeof value === "object" &&
			value instanceof Object &&
			!(value instanceof Array) &&
			!(value instanceof RegExp)
		);
	}

	for (const key in override) {
		if (Object.hasOwn(override, key)) {
			const val = override[key];

			if (isHashObject(val)) {
				if (isHashObject(target[key])) {
					updateDeeply(target[key], val);
				} else {
					target[key] = updateDeeply({}, val);
				}
			} else {
				target[key] = val;
			}
		}
	}
	return target;
}

/**
 * Main interface function. Takes an Espree syntax tree and returns the
 * analyzed scopes.
 * @function analyze
 * @param {ESTree.Program} tree Abstract Syntax Tree
 * @param {Object} providedOptions Options that tailor the scope analysis
 * @param {boolean} [providedOptions.optimistic=false] the optimistic flag
 * @param {boolean} [providedOptions.ignoreEval=false] whether to check 'eval()' calls
 * @param {boolean} [providedOptions.nodejsScope=false] whether the whole
 * script is executed under node.js environment. When enabled, escope adds
 * a function scope immediately following the global scope.
 * @param {boolean} [providedOptions.impliedStrict=false] implied strict mode
 * (if ecmaVersion >= 5).
 * @param {string} [providedOptions.sourceType='script'] the source type of the script. one of 'script', 'module', and 'commonjs'
 * @param {number} [providedOptions.ecmaVersion=5] which ECMAScript version is considered
 * @param {boolean} [providedOptions.jsx=false] support JSX references
 * @param {Object} [providedOptions.childVisitorKeys=null] Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option.
 * @param {string} [providedOptions.fallback='iteration'] A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option.
 * @returns {ScopeManager} ScopeManager
 */
function analyze(tree, providedOptions) {
	const options = updateDeeply(defaultOptions(), providedOptions);
	const scopeManager = new ScopeManager(options);
	const referencer = new Referencer(options, scopeManager);

	referencer.visit(tree);

	assert(
		scopeManager.__currentScope === null,
		"currentScope should be null.",
	);

	return scopeManager;
}

/** @name module:escope.version */
const version = "9.1.2"; // x-release-please-version

/* vim: set sw=4 ts=4 et tw=80 : */

exports.Definition = Definition;
exports.PatternVisitor = PatternVisitor;
exports.Reference = Reference;
exports.Referencer = Referencer;
exports.Scope = Scope;
exports.ScopeManager = ScopeManager;
exports.Variable = Variable;
exports.analyze = analyze;
exports.version = version;
//# sourceMappingURL=eslint-scope.cjs.map
KFAxJ100644 assert.js 6Lx Og=100644 definition.js ɯx LyO d100644 index.d.cts @ބruit	f100644 index.d.ts Uӥ]'OcՄnj100644 index.js C|=$ܤ100644 pattern-visitor.js שm&RǱ100644 reference.js ">BFz̡da@100644 referencer.js y2(!/XZ100644 scope-manager.js #}YHl*LbJO`100644 scope.js m=:FV100644 variable.js xSzc_sg)@,Qx;/**
 * @fileoverview Assertion utilities.
 * @author Nicholas C. Zakas
 */

/**
 * Throws an error if the given condition is not truthy.
 * @param {boolean} condition The condition to check.
 * @param {string} message The message to include with the error.
 * @returns {void}
 * @throws {Error} When the condition is not truthy.
 */
export function assert(condition, message = "Assertion failed.") {
	if (!condition) {
		throw new Error(message);
	}
}
pgx/*
  Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import Variable from "./variable.js";

/** @import * as types from "eslint-scope" */

// Cannot implement `types.Definition` directly because it contains a union.
/**
 * @constructor Definition
 * @implements {Omit<types.Definition, never>}
 */
class Definition {
	constructor(type, name, node, parent, index, kind) {
		/**
		 * @member {string} Definition#type - type of the occurrence (e.g. "Parameter", "Variable", ...).
		 */
		this.type = type;

		/**
		 * @member {espree.Identifier} Definition#name - the identifier AST node of the occurrence.
		 */
		this.name = name;

		/**
		 * @member {espree.Node} Definition#node - the enclosing node of the identifier.
		 */
		this.node = node;

		/**
		 * @member {espree.Node?} Definition#parent - the enclosing statement node of the identifier.
		 */
		this.parent = parent;

		/**
		 * @member {number?} Definition#index - the index in the declaration statement.
		 */
		this.index = index;

		/**
		 * @member {string?} Definition#kind - the kind of the declaration statement.
		 */
		this.kind = kind;
	}
}

/**
 * @constructor ParameterDefinition
 */
class ParameterDefinition extends Definition {
	constructor(name, node, index, rest) {
		super(Variable.Parameter, name, node, null, index, null);

		/**
		 * Whether the parameter definition is a part of a rest parameter.
		 * @member {boolean} ParameterDefinition#rest
		 */
		this.rest = rest;
	}
}

export { ParameterDefinition, Definition };

/* vim: set sw=4 ts=4 et tw=80 : */
Co汒x!iޖ/**
 * @fileoverview This file contains the types for ESLint Scope.
 * It was initially extracted from the DefinitelyTyped repository.
 */

/*
 * MIT License
 * Copyright (c) Microsoft Corporation.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE
 */

//------------------------------------------------------------------------------
// Imports
//------------------------------------------------------------------------------

import type { Visitor, VisitorOptions } from "esrecurse";
import type * as ESTree from "estree";

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

interface JSXIdentifier extends ESTree.BaseNode {
	type: "JSXIdentifier";
	name: string;
}

//------------------------------------------------------------------------------
// Exports
//------------------------------------------------------------------------------

/**
 * Options for scope analysis.
 */
export interface AnalyzeOptions {
	/**
	 * Whether to ignore `eval()` calls, which normally create scopes.
	 * @default false
	 */
	ignoreEval?: boolean;

	/**
	 * Whether to create a top-level function scope for CommonJS evaluation.
	 * @default false
	 */
	nodejsScope?: boolean;

	/**
	 * Whether to evaluate code in strict mode even outside modules or without `"use strict"`.
	 * @default false
	 */
	impliedStrict?: boolean;

	/**
	 * The ECMAScript version to use for evaluation (e.g., `5`, `2015`, `2022`).
	 * @default 5
	 */
	ecmaVersion?: number;

	/**
	 * The type of JavaScript file to evaluate.
	 * @default "script"
	 */
	sourceType?: "script" | "module" | "commonjs";

	/**
	 * Visitor key information for performance enhancement.
	 * @default null
	 */
	childVisitorKeys?: {
		readonly [type: string]: ReadonlyArray<string>;
	} | null;

	/**
	 * Strategy to use when `childVisitorKeys` is not specified.
	 * @default "iteration"
	 */
	fallback?: "iteration" | ((node: ESTree.Node) => string[]);

	/**
	 * Whether to enable optimistic scope analysis.
	 * @default false
	 */
	optimistic?: boolean;

	/**
	 * Enables the tracking of JSX components as variable references.
	 * @default false
	 */
	jsx?: boolean;
}

/**
 * Callback function for pattern visitors.
 */
export type PatternVisitorCallback = (
	pattern: ESTree.Identifier,
	misc: {
		topLevel: boolean;
		rest: boolean;
		assignments: ESTree.AssignmentPattern[];
	},
) => void;

/**
 * Manages the scope hierarchy of an AST.
 */
export class ScopeManager {
	/**
	 * Creates a new `ScopeManager` instance.
	 * @param options Options for scope analysis.
	 */
	constructor(options: AnalyzeOptions);

	/**
	 * The global scope, initially set to `null`.
	 */
	globalScope: GlobalScope | null;

	/**
	 * All scopes in the analyzed program.
	 */
	scopes: Scope[];

	/**
	 * Adds variables to the global scope and resolves references to them.
	 * @param names An array of strings, the names of variables to add to the global scope.
	 * @returns void
	 */
	addGlobals(names: ReadonlyArray<string>): void;

	/**
	 * Acquires the scope for a given node.
	 * @param node The AST node to get the scope for.
	 * @param inner Whether to get the innermost scope. (default: `false`)
	 * @returns The scope or null if not found.
	 */
	acquire(node: ESTree.Node, inner?: boolean): Scope | null;

	/**
	 * acquire all scopes from node.
	 * @param node node for the acquired scope.
	 * @returns Scope array
	 * @deprecated
	 */
	acquireAll(node: ESTree.Node): Scope[] | null;

	/**
	 * Releases a scope, moving to its parent.
	 * @param node The AST node to release the scope for.
	 * @param inner Whether to release the innermost scope. (default: `false`)
	 * @returns The parent scope or null if not found.
	 */
	release(node: ESTree.Node, inner?: boolean): Scope | null;

	/**
	 * Gets all scopes for a given node, including parents.
	 * @param node The AST node to get scopes for.
	 * @param inner Whether to start from the innermost scope.
	 * @returns Array of scopes or empty array if none found.
	 */
	getDeclaredVariables(node: ESTree.Node): Variable[];

	/**
	 * Determines if the global return statement should be allowed.
	 * @returns `true` if the global return is enabled.
	 */
	isGlobalReturn(): boolean;

	/** @deprecated */
	isModule(): boolean;

	/** @deprecated */
	isImpliedStrict(): boolean;

	/** @deprecated */
	isStrictModeSupported(): boolean;

	/** @deprecated */
	attach(): void;

	/** @deprecated */
	detach(): void;
}

/**
 * Base export class for all scopes.
 */
export class Scope<
	TVariable extends Variable = Variable,
	TReference extends Reference = Reference,
> {
	/**
	 * Creates a new `Scope` instance.
	 * @param scopeManager The scope manager this scope belongs to.
	 * @param type The type of the scope.
	 * @param upperScope The parent scope, or null for the global scope.
	 * @param block The AST node that created this scope.
	 * @param isMethodDefinition Whether this scope is for a method definition.
	 */
	constructor(
		scopeManager: ScopeManager,
		type: typeof this.type,
		upperScope: Scope | null,
		block: ESTree.Node,
		isMethodDefinition: boolean,
	);

	/**
	 * The type of the scope (e.g., 'global', 'function').
	 */
	type:
		| "block"
		| "catch"
		| "class"
		| "class-field-initializer"
		| "class-static-block"
		| "for"
		| "function"
		| "function-expression-name"
		| "global"
		| "module"
		| "switch"
		| "with";

	/**
	 * Whether the scope is in strict mode.
	 */
	isStrict: boolean;

	/**
	 * The parent scope, or null for the global scope.
	 */
	upper: Scope | null;

	/**
	 * The scope where variables are declared (same as this for most scopes).
	 */
	variableScope: Scope;

	/**
	 * Variables defined in this scope.
	 */
	variables: TVariable[];

	/**
	 * References to variables in this scope.
	 */
	references: TReference[];

	/**
	 * Child scopes.
	 */
	childScopes: Scope[];

	/**
	 * The AST node that created this scope.
	 */
	block: ESTree.Node;

	/**
	 * Whether this is a function expression scope.
	 */
	functionExpressionScope: boolean;

	/**
	 * Map of variable names to variables.
	 */
	set: Map<string, TVariable>;

	/**
	 * The tainted variables of this scope.
	 * @deprecated
	 */
	taints: Map<string, TVariable>;

	/**
	 * References that pass through this scope to outer scopes.
	 */
	through: TReference[];

	/**
	 * Dynamic flag for certain scope types.
	 * @deprecated
	 */
	dynamic: boolean;

	/**
	 * Direct call to eval() flag.
	 * @deprecated
	 */
	directCallToEvalScope: boolean;

	/**
	 * This scope flag.
	 * @deprecated
	 */
	thisFound: boolean;

	/**
	 * Resolves a reference in this scope.
	 * @param ident An AST node to get their reference object.
	 * @deprecated
	 */
	resolve(ident: ESTree.Identifier): TReference | null;

	/**
	 * Whether the reference is static.
	 * @deprecated
	 */
	isStatic(): boolean;

	/**
	 * Returns whether this scope has materialized arguments.
	 * @deprecated
	 */
	isArgumentsMaterialized(): boolean;

	/**
	 * Returns whether this scope has materialized `this` reference.
	 * @deprecated
	 */
	isThisMaterialized(): boolean;

	/** @deprecated */
	isUsedName(name: string): boolean;
}

/**
 * Global scope.
 */
export class GlobalScope extends Scope {
	/**
	 * Creates a new GlobalScope instance.
	 * @param scopeManager The scope manager this scope belongs to.
	 * @param block The AST node that created this scope.
	 */
	constructor(scopeManager: ScopeManager, block: ESTree.Node);

	type: "global";

	functionExpressionScope: false;

	isArgumentsMaterialized(): true;

	isThisMaterialized(): true;

	/**
	 * Implicit references (e.g., 'arguments' in functions).
	 */
	implicit: {
		left: Reference[];
		set: Map<string, Variable>;
		variables: Variable[];
	};
}

/**
 * Module scope.
 */
export class ModuleScope extends Scope {
	/**
	 * Creates a new ModuleScope instance.
	 * @param scopeManager The scope manager this scope belongs to.
	 * @param upperScope The parent scope.
	 * @param block The AST node that created this scope.
	 */
	constructor(
		scopeManager: ScopeManager,
		upperScope: Scope,
		block: ESTree.Node,
	);

	type: "module";

	functionExpressionScope: false;

	isArgumentsMaterialized(): true;

	isThisMaterialized(): true;
}

/**
 * Function expression name scope.
 */
export class FunctionExpressionNameScope extends Scope {
	/**
	 * Creates a new FunctionExpressionNameScope instance.
	 * @param scopeManager The scope manager this scope belongs to.
	 * @param upperScope The parent scope.
	 * @param block The AST node that created this scope.
	 */
	constructor(
		scopeManager: ScopeManager,
		upperScope: Scope,
		block: ESTree.Node,
	);

	type: "function-expression-name";

	functionExpressionScope: true;

	isArgumentsMaterialized(): true;

	isThisMaterialized(): true;
}

/**
 * Catch scope.
 */
export class CatchScope extends Scope {
	/**
	 * Creates a new CatchScope instance.
	 * @param scopeManager The scope manager this scope belongs to.
	 * @param upperScope The parent scope.
	 * @param block The AST node that created this scope.
	 */
	constructor(
		scopeManager: ScopeManager,
		upperScope: Scope,
		block: ESTree.Node,
	);

	type: "catch";

	functionExpressionScope: false;

	isArgumentsMaterialized(): true;

	isThisMaterialized(): true;
}

/**
 * With scope.
 */
export class WithScope extends Scope {
	/**
	 * Creates a new WithScope instance.
	 * @param scopeManager The scope manager this scope belongs to.
	 * @param upperScope The parent scope.
	 * @param block The AST node that created this scope.
	 */
	constructor(
		scopeManager: ScopeManager,
		upperScope: Scope,
		block: ESTree.Node,
	);

	type: "with";

	functionExpressionScope: false;

	isArgumentsMaterialized(): true;

	isThisMaterialized(): true;
}

/**
 * Block scope.
 */
export class BlockScope extends Scope {
	/**
	 * Creates a new BlockScope instance.
	 * @param scopeManager The scope manager this scope belongs to.
	 * @param upperScope The parent scope.
	 * @param block The AST node that created this scope.
	 */
	constructor(
		scopeManager: ScopeManager,
		upperScope: Scope,
		block: ESTree.Node,
	);

	type: "block";

	functionExpressionScope: false;

	isArgumentsMaterialized(): true;

	isThisMaterialized(): true;
}

/**
 * Switch scope.
 */
export class SwitchScope extends Scope {
	/**
	 * Creates a new SwitchScope instance.
	 * @param scopeManager The scope manager this scope belongs to.
	 * @param upperScope The parent scope.
	 * @param block The AST node that created this scope.
	 */
	constructor(
		scopeManager: ScopeManager,
		upperScope: Scope,
		block: ESTree.Node,
	);

	type: "switch";

	functionExpressionScope: false;

	isArgumentsMaterialized(): true;

	isThisMaterialized(): true;
}

/**
 * Function scope.
 */
export class FunctionScope extends Scope {
	/**
	 * Creates a new FunctionScope instance.
	 * @param scopeManager The scope manager this scope belongs to.
	 * @param upperScope The parent scope.
	 * @param block The AST node that created this scope.
	 * @param isMethodDefinition Whether this scope is for a method definition.
	 */
	constructor(
		scopeManager: ScopeManager,
		upperScope: Scope,
		block: ESTree.Node,
		isMethodDefinition: boolean,
	);

	type: "function";

	functionExpressionScope: false;
}

/**
 * Scope of for, for-in, and for-of statements.
 */
export class ForScope extends Scope {
	/**
	 * Creates a new ForScope instance.
	 * @param scopeManager The scope manager this scope belongs to.
	 * @param upperScope The parent scope.
	 * @param block The AST node that created this scope.
	 */
	constructor(
		scopeManager: ScopeManager,
		upperScope: Scope,
		block: ESTree.Node,
	);

	type: "for";

	functionExpressionScope: false;

	isArgumentsMaterialized(): true;

	isThisMaterialized(): true;
}

/**
 * Class scope.
 */
export class ClassScope extends Scope {
	/**
	 * Creates a new ClassScope instance.
	 * @param scopeManager The scope manager this scope belongs to.
	 * @param upperScope The parent scope.
	 * @param block The AST node that created this scope.
	 */
	constructor(
		scopeManager: ScopeManager,
		upperScope: Scope,
		block: ESTree.Node,
	);

	type: "class";

	functionExpressionScope: false;

	isArgumentsMaterialized(): true;

	isThisMaterialized(): true;
}

/**
 * Class field initializer scope.
 */
export class ClassFieldInitializerScope extends Scope {
	/**
	 * Creates a new ClassFieldInitializerScope instance.
	 * @param scopeManager The scope manager this scope belongs to.
	 * @param upperScope The parent scope.
	 * @param block The AST node that created this scope.
	 */
	constructor(
		scopeManager: ScopeManager,
		upperScope: Scope,
		block: ESTree.Node,
	);

	type: "class-field-initializer";

	functionExpressionScope: false;

	isArgumentsMaterialized(): true;

	isThisMaterialized(): true;
}

/**
 * Class static block scope.
 */
export class ClassStaticBlockScope extends Scope {
	/**
	 * Creates a new ClassStaticBlockScope instance.
	 * @param scopeManager The scope manager this scope belongs to.
	 * @param upperScope The parent scope.
	 * @param block The AST node that created this scope.
	 */
	constructor(
		scopeManager: ScopeManager,
		upperScope: Scope,
		block: ESTree.Node,
	);

	type: "class-static-block";

	functionExpressionScope: false;

	isArgumentsMaterialized(): true;

	isThisMaterialized(): true;
}

/**
 * Represents a variable in a scope.
 */
export class Variable<TReference extends Reference = Reference> {
	static readonly CatchClause: "CatchClause";
	static readonly Parameter: "Parameter";
	static readonly FunctionName: "FunctionName";
	static readonly ClassName: "ClassName";
	static readonly Variable: "Variable";
	static readonly ImportBinding: "ImportBinding";
	static readonly ImplicitGlobalVariable: "ImplicitGlobalVariable";

	/**
	 * Creates a new Variable instance.
	 * @param name The name of the variable.
	 * @param scope The scope where the variable is defined.
	 */
	constructor(name: string, scope: Scope);

	/**
	 * The name of the variable.
	 */
	name: string;

	/**
	 * The scope where the variable is defined.
	 */
	scope: Scope;

	/**
	 * Identifiers that declare this variable.
	 */
	identifiers: ESTree.Identifier[];

	/**
	 * References to this variable.
	 */
	references: TReference[];

	/**
	 * Definitions of this variable.
	 */
	defs: Definition[];

	/**
	 * Whether the variable is tainted (e.g., potentially modified externally).
	 * @deprecated
	 */
	tainted: boolean;

	/**
	 * Stack flag for certain variable types.
	 * @deprecated
	 */
	stack: boolean;
}

/**
 * Represents a reference to a variable.
 */
export class Reference {
	static readonly READ: 1;
	static readonly WRITE: 2;
	static readonly RW: 3;

	/**
	 * Creates a new Reference instance.
	 * @param ident The identifier node of the reference.
	 * @param scope The scope where the reference occurs.
	 * @param flag The reference flag (read, write, or read-write).
	 * @param writeExpr The expression being written, if applicable.
	 * @param maybeImplicitGlobal Information about a possible global variable, if applicable.
	 * @param partial Whether this is a partial reference.
	 * @param init Whether this is an initialization reference.
	 */
	constructor(
		ident: ESTree.Identifier | JSXIdentifier,
		scope: Scope,
		flag: number,
		writeExpr: ESTree.Expression | null,
		maybeImplicitGlobal: {
			pattern: ESTree.Pattern;
			node: ESTree.Node;
		} | null,
		partial: boolean,
		init: boolean,
	);

	/**
	 * The identifier node of the reference.
	 */
	identifier: ESTree.Identifier | JSXIdentifier;

	/**
	 * The variable being referenced, or null if unresolved.
	 */
	resolved: Variable | null;

	/**
	 * Whether the reference is static.
	 * @deprecated
	 */
	isStatic(): boolean;

	/**
	 * Whether this is a write operation.
	 */
	isWrite(): boolean;

	/**
	 * Whether this is a read operation.
	 */
	isRead(): boolean;

	/**
	 * The scope where the reference occurs.
	 */
	from: Scope;

	/**
	 * Whether the reference comes from a dynamic scope (such as 'eval',
	 * 'with', etc.), and may be trapped by dynamic scopes.
	 * @deprecated
	 */
	tainted: boolean;

	/**
	 * The expression being written, if applicable.
	 */
	writeExpr?: ESTree.Expression | null;

	/**
	 * Whether this is a partial reference.
	 * @deprecated
	 */
	partial?: boolean;

	/**
	 * Whether this is an initialization reference.
	 */
	init?: boolean;

	/**
	 * Whether this reference is only read.
	 * @returns True if the reference is read-only.
	 */
	isReadOnly(): boolean;

	/**
	 * Whether this reference is only written.
	 * @returns True if the reference is write-only.
	 */
	isWriteOnly(): boolean;

	/**
	 * Whether this reference is read-write.
	 * @returns True if the reference is read-write.
	 */
	isReadWrite(): boolean;

	/** @deprecated */
	flag: number;
}

/**
 * Represents a variable definition.
 */
export const Definition: {
	/**
	 * Creates a new Definition instance.
	 * @param type The type of definition (e.g., 'Variable', 'Parameter').
	 * @param name The identifier node of the definition.
	 * @param node The AST node where the definition occurs.
	 * @param parent The parent node, if applicable.
	 * @param index The index of the definition in a pattern, if applicable.
	 * @param kind The kind of variable (e.g., 'var', 'let', 'const'), if applicable.
	 */
	new (
		type: Definition["type"],
		name: ESTree.Identifier,
		node: Definition["node"],
		parent: Definition["parent"],
		index: number | null,
		kind: string | null,
	): Definition;
};

export type Definition = (
	| { type: "CatchClause"; node: ESTree.CatchClause; parent: null }
	| {
			type: "ClassName";
			node: ESTree.ClassDeclaration | ESTree.ClassExpression;
			parent: null;
	  }
	| {
			type: "FunctionName";
			node: ESTree.FunctionDeclaration | ESTree.FunctionExpression;
			parent: null;
	  }
	| {
			type: "ImplicitGlobalVariable";
			node:
				| ESTree.AssignmentExpression
				| ESTree.ForInStatement
				| ESTree.ForOfStatement;
			parent: null;
	  }
	| {
			type: "ImportBinding";
			node:
				| ESTree.ImportSpecifier
				| ESTree.ImportDefaultSpecifier
				| ESTree.ImportNamespaceSpecifier;
			parent: ESTree.ImportDeclaration;
	  }
	| {
			type: "Parameter";
			node:
				| ESTree.FunctionDeclaration
				| ESTree.FunctionExpression
				| ESTree.ArrowFunctionExpression;
			parent: null;
	  }
	| {
			type: "Variable";
			node: ESTree.VariableDeclarator;
			parent: ESTree.VariableDeclaration;
	  }
) & {
	/**
	 * The identifier node of the definition.
	 */
	name: ESTree.Identifier;

	/**
	 * The index of the definition in a pattern, if applicable.
	 * @deprecated
	 */
	index: number | null;

	/**
	 * The kind of variable (e.g., 'var', 'let', 'const'), if applicable.
	 * @deprecated
	 */
	kind: string | null;
};

/**
 * Visitor for destructuring patterns.
 */
export class PatternVisitor extends Visitor {
	static isPattern(
		node: ESTree.Node,
	): node is
		| ESTree.Identifier
		| ESTree.ObjectPattern
		| ESTree.ArrayPattern
		| ESTree.SpreadElement
		| ESTree.RestElement
		| ESTree.AssignmentPattern;

	constructor(
		options: VisitorOptions | null | undefined,
		rootPattern: ESTree.Pattern,
		callback: PatternVisitorCallback,
	);

	rootPattern: ESTree.Pattern;

	callback: PatternVisitorCallback;

	assignments: Array<ESTree.AssignmentExpression | ESTree.AssignmentPattern>;

	rightHandNodes: ESTree.Node[];

	restElements: ESTree.RestElement[];

	Identifier(pattern: ESTree.Identifier): void;

	Property(pattern: ESTree.Property): void;

	ArrayPattern(pattern: ESTree.ArrayPattern): void;

	AssignmentPattern(pattern: ESTree.AssignmentPattern): void;

	RestElement(pattern: ESTree.RestElement): void;

	MemberExpression(pattern: ESTree.MemberExpression): void;

	SpreadElement(pattern: ESTree.SpreadElement): void;

	ArrayExpression(pattern: ESTree.ArrayExpression): void;

	AssignmentExpression(pattern: ESTree.AssignmentExpression): void;

	CallExpression(pattern: ESTree.CallExpression): void;
}

/**
 * Visitor class for traversing AST nodes and creating variable references and bindings.
 */
export class Referencer extends Visitor {
	/**
	 * Creates a new Referencer instance.
	 * @param options Options for scope analysis.
	 * @param scopeManager The scope manager to use.
	 */
	constructor(
		options: VisitorOptions | null | undefined,
		scopeManager: ScopeManager,
	);

	/**
	 * Options for scope analysis.
	 */
	options: VisitorOptions | null | undefined;

	/**
	 * The scope manager being used.
	 */
	scopeManager: ScopeManager;

	/**
	 * The parent node.
	 */
	parent: ESTree.Node | null;

	/**
	 * Whether currently inside a method definition.
	 */
	isInnerMethodDefinition: boolean;

	/**
	 * Gets the current scope.
	 * @returns The current scope.
	 */
	currentScope(): Scope;

	/**
	 * Closes scopes up to the given node.
	 * @param node The AST node.
	 */
	close(node: ESTree.Node): void;

	/**
	 * Pushes a new inner method definition state.
	 * @param isInnerMethodDefinition Whether inside a method definition.
	 * @returns The previous state.
	 */
	pushInnerMethodDefinition(isInnerMethodDefinition: boolean): boolean;

	/**
	 * Pops the inner method definition state.
	 * @param isInnerMethodDefinition The state to restore.
	 */
	popInnerMethodDefinition(isInnerMethodDefinition: boolean): void;

	/**
	 * References default values in patterns.
	 * @param pattern The pattern.
	 * @param assignments The assignments.
	 * @param maybeImplicitGlobal Information about a possible implicit global.
	 * @param init Whether this is an initialization.
	 */
	referencingDefaultValue(
		pattern: ESTree.Pattern,
		assignments: Array<
			ESTree.AssignmentExpression | ESTree.AssignmentPattern
		>,
		maybeImplicitGlobal: {
			pattern: ESTree.Pattern;
			node: ESTree.Node;
		} | null,
		init: boolean,
	): void;

	/**
	 * Visits a pattern node.
	 * @param node The pattern node.
	 * @param options Options or callback.
	 * @param callback The callback function.
	 */
	visitPattern(
		node: ESTree.Pattern,
		options: { processRightHandNodes: boolean } | PatternVisitorCallback,
		callback?: PatternVisitorCallback,
	): void;

	/**
	 * Visits a function node.
	 * @param node The function node.
	 */
	visitFunction(
		node:
			| ESTree.FunctionDeclaration
			| ESTree.FunctionExpression
			| ESTree.ArrowFunctionExpression,
	): void;

	/**
	 * Visits a class node.
	 * @param node The class node.
	 */
	visitClass(node: ESTree.ClassDeclaration | ESTree.ClassExpression): void;

	/**
	 * Visits a property node.
	 * @param node The property node.
	 */
	visitProperty(node: ESTree.Property | ESTree.MethodDefinition): void;

	/**
	 * Visits a for-in or for-of statement.
	 * @param node The for-in or for-of node.
	 */
	visitForIn(node: ESTree.ForInStatement | ESTree.ForOfStatement): void;

	/**
	 * Visits a variable declaration.
	 * @param variableTargetScope The scope where the variable should be defined.
	 * @param type The variable type.
	 * @param node The variable declaration node.
	 * @param index The index of the declarator.
	 */
	visitVariableDeclaration(
		variableTargetScope: Scope,
		type: typeof Variable.Variable,
		node: ESTree.VariableDeclaration,
		index: number,
	): void;

	/**
	 * Visits an export declaration.
	 * @param node The export declaration node.
	 */
	visitExportDeclaration(
		node:
			| ESTree.ExportAllDeclaration
			| ESTree.ExportDefaultDeclaration
			| ESTree.ExportNamedDeclaration,
	): void;

	AssignmentExpression(node: ESTree.AssignmentExpression): void;
	CatchClause(node: ESTree.CatchClause): void;
	Program(node: ESTree.Program): void;
	Identifier(node: ESTree.Identifier): void;
	PrivateIdentifier(): void;
	UpdateExpression(node: ESTree.UpdateExpression): void;
	MemberExpression(node: ESTree.MemberExpression): void;
	Property(node: ESTree.Property): void;
	PropertyDefinition(node: ESTree.PropertyDefinition): void;
	StaticBlock(node: ESTree.StaticBlock): void;
	MethodDefinition(node: ESTree.MethodDefinition): void;
	BreakStatement(): void;
	ContinueStatement(): void;
	LabeledStatement(node: ESTree.LabeledStatement): void;
	ForStatement(node: ESTree.ForStatement): void;
	ClassExpression(node: ESTree.ClassExpression): void;
	ClassDeclaration(node: ESTree.ClassDeclaration): void;
	CallExpression(node: ESTree.CallExpression): void;
	BlockStatement(node: ESTree.BlockStatement): void;
	ThisExpression(): void;
	WithStatement(node: ESTree.WithStatement): void;
	VariableDeclaration(node: ESTree.VariableDeclaration): void;
	SwitchStatement(node: ESTree.SwitchStatement): void;
	FunctionDeclaration(node: ESTree.FunctionDeclaration): void;
	FunctionExpression(node: ESTree.FunctionExpression): void;
	ForOfStatement(node: ESTree.ForOfStatement): void;
	ForInStatement(node: ESTree.ForInStatement): void;
	ArrowFunctionExpression(node: ESTree.ArrowFunctionExpression): void;
	ImportDeclaration(node: ESTree.ImportDeclaration): void;
	ExportDeclaration(
		node:
			| ESTree.ExportAllDeclaration
			| ESTree.ExportDefaultDeclaration
			| ESTree.ExportNamedDeclaration,
	): void;
	ExportAllDeclaration(node: ESTree.ExportAllDeclaration): void;
	ExportDefaultDeclaration(node: ESTree.ExportDefaultDeclaration): void;
	ExportNamedDeclaration(node: ESTree.ExportNamedDeclaration): void;
	ExportSpecifier(node: ESTree.ExportSpecifier): void;
	MetaProperty(): void;
	JSXIdentifier(node: JSXIdentifier): void;
	JSXMemberExpression(node: any): void;
	JSXElement(node: any): void;
	JSXOpeningElement(node: any): void;
	JSXAttribute(node: any): void;
	JSXExpressionContainer(node: any): void;
	JSXNamespacedName(node: any): void;
}

/**
 * Analyzes the scope of an AST.
 * @param ast The ESTree-compliant AST to analyze.
 * @param options Options for scope analysis.
 * @returns The scope manager for the analyzed AST.
 */
export function analyze(
	ast: ESTree.Program,
	options?: AnalyzeOptions,
): ScopeManager;

/**
 * The version of ESLint Scope.
 */
export const version: string;
듵xu /**
 * @fileoverview ESLint Scope types in ESM format.
 * @author Francesco Trotta
 */

export * from "./index.cjs";
%\xL/*
  Copyright (C) 2012-2014 Yusuke Suzuki <utatane.tea@gmail.com>
  Copyright (C) 2013 Alex Seville <hi@alexanderseville.com>
  Copyright (C) 2014 Thiago de Arruda <tpadilha84@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/**
 * Escope (<a href="http://github.com/estools/escope">escope</a>) is an <a
 * href="http://www.ecma-international.org/publications/standards/Ecma-262.htm">ECMAScript</a>
 * scope analyzer extracted from the <a
 * href="http://github.com/estools/esmangle">esmangle project</a/>.
 * <p>
 * <em>escope</em> finds lexical scopes in a source program, i.e. areas of that
 * program where different occurrences of the same identifier refer to the same
 * variable. With each scope the contained variables are collected, and each
 * identifier reference in code is linked to its corresponding variable (if
 * possible).
 * <p>
 * <em>escope</em> works on a syntax tree of the parsed source code which has
 * to adhere to the <a
 * href="https://developer.mozilla.org/en-US/docs/SpiderMonkey/Parser_API">
 * Mozilla Parser API</a>. E.g. <a href="https://github.com/eslint/espree">espree</a> is a parser
 * that produces such syntax trees.
 * <p>
 * The main interface is the {@link analyze} function.
 * @module escope
 */

import { assert } from "./assert.js";

import ScopeManager from "./scope-manager.js";
import Referencer from "./referencer.js";
import Reference from "./reference.js";
import Variable from "./variable.js";

/** @import ESTree from "estree" */

/**
 * Set the default options
 * @returns {Object} options
 */
function defaultOptions() {
	return {
		optimistic: false,
		nodejsScope: false,
		impliedStrict: false,
		sourceType: "script", // one of ['script', 'module', 'commonjs']
		ecmaVersion: 5,
		childVisitorKeys: null,
		fallback: "iteration",
	};
}

/**
 * Preform deep update on option object
 * @param {Record<string, unknown>} target Options
 * @param {Record<string, unknown>} override Updates
 * @returns {Record<string, unknown>} Updated options
 */
function updateDeeply(target, override) {
	/**
	 * Is hash object
	 * @param {Object} value Test value
	 * @returns {value is Record<string, unknown>} Result
	 */
	function isHashObject(value) {
		return (
			typeof value === "object" &&
			value instanceof Object &&
			!(value instanceof Array) &&
			!(value instanceof RegExp)
		);
	}

	for (const key in override) {
		if (Object.hasOwn(override, key)) {
			const val = override[key];

			if (isHashObject(val)) {
				if (isHashObject(target[key])) {
					updateDeeply(target[key], val);
				} else {
					target[key] = updateDeeply({}, val);
				}
			} else {
				target[key] = val;
			}
		}
	}
	return target;
}

/**
 * Main interface function. Takes an Espree syntax tree and returns the
 * analyzed scopes.
 * @function analyze
 * @param {ESTree.Program} tree Abstract Syntax Tree
 * @param {Object} providedOptions Options that tailor the scope analysis
 * @param {boolean} [providedOptions.optimistic=false] the optimistic flag
 * @param {boolean} [providedOptions.ignoreEval=false] whether to check 'eval()' calls
 * @param {boolean} [providedOptions.nodejsScope=false] whether the whole
 * script is executed under node.js environment. When enabled, escope adds
 * a function scope immediately following the global scope.
 * @param {boolean} [providedOptions.impliedStrict=false] implied strict mode
 * (if ecmaVersion >= 5).
 * @param {string} [providedOptions.sourceType='script'] the source type of the script. one of 'script', 'module', and 'commonjs'
 * @param {number} [providedOptions.ecmaVersion=5] which ECMAScript version is considered
 * @param {boolean} [providedOptions.jsx=false] support JSX references
 * @param {Object} [providedOptions.childVisitorKeys=null] Additional known visitor keys. See [esrecurse](https://github.com/estools/esrecurse)'s the `childVisitorKeys` option.
 * @param {string} [providedOptions.fallback='iteration'] A kind of the fallback in order to encounter with unknown node. See [esrecurse](https://github.com/estools/esrecurse)'s the `fallback` option.
 * @returns {ScopeManager} ScopeManager
 */
function analyze(tree, providedOptions) {
	const options = updateDeeply(defaultOptions(), providedOptions);
	const scopeManager = new ScopeManager(options);
	const referencer = new Referencer(options, scopeManager);

	referencer.visit(tree);

	assert(
		scopeManager.__currentScope === null,
		"currentScope should be null.",
	);

	return scopeManager;
}

/** @name module:escope.version */
export const version = "9.1.2"; // x-release-please-version

export {
	/** @name module:escope.Reference */
	Reference,

	/** @name module:escope.Variable */
	Variable,

	/** @name module:escope.ScopeManager */
	ScopeManager,

	/** @name module:escope.Referencer */
	Referencer,
	analyze,
};

/** @name module:escope.Definition */
export { Definition } from "./definition.js";

/** @name module:escope.PatternVisitor */
export { default as PatternVisitor } from "./pattern-visitor.js";

/** @name module:escope.Scope */
export { Scope } from "./scope.js";

/* vim: set sw=4 ts=4 et tw=80 : */
|-x?/*
  Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import estraverse from "estraverse";
import esrecurse from "esrecurse";

/** @import * as types from "eslint-scope" */

const { Syntax } = estraverse;

/**
 * Get last array element
 * @param {Array} xs array
 * @returns {any} Last elment
 */
function getLast(xs) {
	return xs.at(-1) || null;
}

/**
 * Visitor for destructuring patterns.
 * @implements {types.PatternVisitor}
 */
class PatternVisitor extends esrecurse.Visitor {
	static isPattern(node) {
		const nodeType = node.type;

		return (
			nodeType === Syntax.Identifier ||
			nodeType === Syntax.ObjectPattern ||
			nodeType === Syntax.ArrayPattern ||
			nodeType === Syntax.SpreadElement ||
			nodeType === Syntax.RestElement ||
			nodeType === Syntax.AssignmentPattern
		);
	}

	constructor(options, rootPattern, callback) {
		super(null, options);
		this.rootPattern = rootPattern;
		this.callback = callback;
		this.assignments = [];
		this.rightHandNodes = [];
		this.restElements = [];
	}

	Identifier(pattern) {
		const lastRestElement = getLast(this.restElements);

		this.callback(pattern, {
			topLevel: pattern === this.rootPattern,
			rest:
				lastRestElement !== null &&
				lastRestElement !== void 0 &&
				lastRestElement.argument === pattern,
			assignments: this.assignments,
		});
	}

	Property(property) {
		// Computed property's key is a right hand node.
		if (property.computed) {
			this.rightHandNodes.push(property.key);
		}

		// If it's shorthand, its key is same as its value.
		// If it's shorthand and has its default value, its key is same as its value.left (the value is AssignmentPattern).
		// If it's not shorthand, the name of new variable is its value's.
		this.visit(property.value);
	}

	ArrayPattern(pattern) {
		for (let i = 0, iz = pattern.elements.length; i < iz; ++i) {
			const element = pattern.elements[i];

			this.visit(element);
		}
	}

	AssignmentPattern(pattern) {
		this.assignments.push(pattern);
		this.visit(pattern.left);
		this.rightHandNodes.push(pattern.right);
		this.assignments.pop();
	}

	RestElement(pattern) {
		this.restElements.push(pattern);
		this.visit(pattern.argument);
		this.restElements.pop();
	}

	MemberExpression(node) {
		// Computed property's key is a right hand node.
		if (node.computed) {
			this.rightHandNodes.push(node.property);
		}

		// the object is only read, write to its property.
		this.rightHandNodes.push(node.object);
	}

	//
	// ForInStatement.left and AssignmentExpression.left are LeftHandSideExpression.
	// By spec, LeftHandSideExpression is Pattern or MemberExpression.
	//   (see also: https://github.com/estree/estree/pull/20#issuecomment-74584758)
	// But espree 2.0 parses to ArrayExpression, ObjectExpression, etc...
	//

	SpreadElement(node) {
		this.visit(node.argument);
	}

	ArrayExpression(node) {
		node.elements.forEach(this.visit, this);
	}

	AssignmentExpression(node) {
		this.assignments.push(node);
		this.visit(node.left);
		this.rightHandNodes.push(node.right);
		this.assignments.pop();
	}

	CallExpression(node) {
		// arguments are right hand nodes.
		node.arguments.forEach(a => {
			this.rightHandNodes.push(a);
		});
		this.visit(node.callee);
	}
}

export default PatternVisitor;

/* vim: set sw=4 ts=4 et tw=80 : */
Rx
/*
  Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/** @import * as types from "eslint-scope" */

const READ = 0x1;
const WRITE = 0x2;
const RW = READ | WRITE;

/**
 * A Reference represents a single occurrence of an identifier in code.
 * @constructor Reference
 * @implements {types.Reference}
 */
class Reference {
	constructor(
		ident,
		scope,
		flag,
		writeExpr,
		maybeImplicitGlobal,
		partial,
		init,
	) {
		/**
		 * Identifier syntax node.
		 * @member {espreeIdentifier} Reference#identifier
		 */
		this.identifier = ident;

		/**
		 * Reference to the enclosing Scope.
		 * @member {Scope} Reference#from
		 */
		this.from = scope;

		/**
		 * Whether the reference comes from a dynamic scope (such as 'eval',
		 * 'with', etc.), and may be trapped by dynamic scopes.
		 * @member {boolean} Reference#tainted
		 */
		this.tainted = false;

		/**
		 * The variable this reference is resolved with.
		 * @member {Variable} Reference#resolved
		 */
		this.resolved = null;

		/**
		 * The read-write mode of the reference. (Value is one of {@link
		 * Reference.READ}, {@link Reference.RW}, {@link Reference.WRITE}).
		 * @member {number} Reference#flag
		 */
		this.flag = flag;
		if (this.isWrite()) {
			/**
			 * If reference is writeable, this is the tree being written to it.
			 * @member {espreeNode} Reference#writeExpr
			 */
			this.writeExpr = writeExpr;

			/**
			 * Whether the Reference might refer to a partial value of writeExpr.
			 * @member {boolean} Reference#partial
			 */
			this.partial = partial;

			/**
			 * Whether the Reference is to write of initialization.
			 * @member {boolean} Reference#init
			 */
			this.init = init;
		}
		this.__maybeImplicitGlobal = maybeImplicitGlobal;
	}

	/**
	 * Whether the reference is static.
	 * @function Reference#isStatic
	 * @returns {boolean} static
	 */
	isStatic() {
		return (
			!this.tainted && !!this.resolved && this.resolved.scope.isStatic()
		);
	}

	/**
	 * Whether the reference is writeable.
	 * @function Reference#isWrite
	 * @returns {boolean} write
	 */
	isWrite() {
		return !!(this.flag & Reference.WRITE);
	}

	/**
	 * Whether the reference is readable.
	 * @function Reference#isRead
	 * @returns {boolean} read
	 */
	isRead() {
		return !!(this.flag & Reference.READ);
	}

	/**
	 * Whether the reference is read-only.
	 * @function Reference#isReadOnly
	 * @returns {boolean} read only
	 */
	isReadOnly() {
		return this.flag === Reference.READ;
	}

	/**
	 * Whether the reference is write-only.
	 * @function Reference#isWriteOnly
	 * @returns {boolean} write only
	 */
	isWriteOnly() {
		return this.flag === Reference.WRITE;
	}

	/**
	 * Whether the reference is read-write.
	 * @function Reference#isReadWrite
	 * @returns {boolean} read write
	 */
	isReadWrite() {
		return this.flag === Reference.RW;
	}
}

/**
 * @constant Reference.READ
 */
Reference.READ = READ;

/**
 * @constant Reference.WRITE
 */
Reference.WRITE = WRITE;

/**
 * @constant Reference.RW
 */
Reference.RW = RW;

export default Reference;

/* vim: set sw=4 ts=4 et tw=80 : */
25xF/*
  Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import estraverse from "estraverse";
import esrecurse from "esrecurse";
import Reference from "./reference.js";
import Variable from "./variable.js";
import PatternVisitor from "./pattern-visitor.js";
import { Definition, ParameterDefinition } from "./definition.js";
import { assert } from "./assert.js";

/** @import * as types from "eslint-scope" */
/** @import ESTree from "estree" */

const { Syntax } = estraverse;

/**
 * Traverse identifier in pattern
 * @param {Object} options options
 * @param {ESTree.Pattern} rootPattern root pattern
 * @param {?Referencer} referencer referencer
 * @param {types.PatternVisitorCallback} callback callback
 * @returns {void}
 */
function traverseIdentifierInPattern(
	options,
	rootPattern,
	referencer,
	callback,
) {
	// Call the callback at left hand identifier nodes, and Collect right hand nodes.
	const visitor = new PatternVisitor(options, rootPattern, callback);

	visitor.visit(rootPattern);

	// Process the right hand nodes recursively.
	if (referencer !== null && referencer !== void 0) {
		visitor.rightHandNodes.forEach(referencer.visit, referencer);
	}
}

// Importing ImportDeclaration.
// http://people.mozilla.org/~jorendorff/es6-draft.html#sec-moduledeclarationinstantiation
// https://github.com/estree/estree/blob/master/es6.md#importdeclaration
// FIXME: Now, we don't create module environment, because the context is
// implementation dependent.

/**
 * Visitor for import specifiers.
 */
class Importer extends esrecurse.Visitor {
	constructor(declaration, referencer) {
		super(null, referencer.options);
		this.declaration = declaration;
		this.referencer = referencer;
	}

	visitImport(id, specifier) {
		this.referencer.visitPattern(id, pattern => {
			this.referencer
				.currentScope()
				.__define(
					pattern,
					new Definition(
						Variable.ImportBinding,
						pattern,
						specifier,
						this.declaration,
						null,
						null,
					),
				);
		});
	}

	ImportNamespaceSpecifier(node) {
		const local = node.local || node.id;

		if (local) {
			this.visitImport(local, node);
		}
	}

	ImportDefaultSpecifier(node) {
		const local = node.local || node.id;

		this.visitImport(local, node);
	}

	ImportSpecifier(node) {
		const local = node.local || node.id;

		if (node.name) {
			this.visitImport(node.name, node);
		} else {
			this.visitImport(local, node);
		}
	}
}

/**
 * Referencing variables and creating bindings.
 * @implements {types.Referencer}
 */
class Referencer extends esrecurse.Visitor {
	constructor(options, scopeManager) {
		super(null, options);
		this.options = options;
		this.scopeManager = scopeManager;
		this.parent = null;
		this.isInnerMethodDefinition = false;
	}

	currentScope() {
		return this.scopeManager.__currentScope;
	}

	close(node) {
		while (this.currentScope() && node === this.currentScope().block) {
			this.scopeManager.__currentScope = this.currentScope().__close(
				this.scopeManager,
			);
		}
	}

	pushInnerMethodDefinition(isInnerMethodDefinition) {
		const previous = this.isInnerMethodDefinition;

		this.isInnerMethodDefinition = isInnerMethodDefinition;
		return previous;
	}

	popInnerMethodDefinition(isInnerMethodDefinition) {
		this.isInnerMethodDefinition = isInnerMethodDefinition;
	}

	referencingDefaultValue(pattern, assignments, maybeImplicitGlobal, init) {
		const scope = this.currentScope();

		assignments.forEach(assignment => {
			scope.__referencing(
				pattern,
				Reference.WRITE,
				assignment.right,
				maybeImplicitGlobal,
				pattern !== assignment.left,
				init,
			);
		});
	}

	visitPattern(node, options, callback) {
		let visitPatternOptions = options;
		let visitPatternCallback = callback;

		if (typeof options === "function") {
			visitPatternCallback = options;
			visitPatternOptions = { processRightHandNodes: false };
		}

		traverseIdentifierInPattern(
			this.options,
			node,
			visitPatternOptions.processRightHandNodes ? this : null,
			visitPatternCallback,
		);
	}

	visitFunction(node) {
		let i, iz;

		// FunctionDeclaration name is defined in upper scope
		// NOTE: Not referring variableScope. It is intended.
		// Since
		//  in ES5, FunctionDeclaration should be in FunctionBody.
		//  in ES6, FunctionDeclaration should be block scoped.

		if (node.type === Syntax.FunctionDeclaration) {
			// id is defined in upper scope
			this.currentScope().__define(
				node.id,
				new Definition(
					Variable.FunctionName,
					node.id,
					node,
					null,
					null,
					null,
				),
			);
		}

		// FunctionExpression with name creates its special scope;
		// FunctionExpressionNameScope.
		if (node.type === Syntax.FunctionExpression && node.id) {
			this.scopeManager.__nestFunctionExpressionNameScope(node);
		}

		// Consider this function is in the MethodDefinition.
		this.scopeManager.__nestFunctionScope(
			node,
			this.isInnerMethodDefinition,
		);

		const that = this;

		/**
		 * Visit pattern callback
		 * @param {ESTree.Pattern} pattern pattern
		 * @param {Object} info info
		 * @returns {void}
		 */
		function visitPatternCallback(pattern, info) {
			that.currentScope().__define(
				pattern,
				new ParameterDefinition(pattern, node, i, info.rest),
			);

			that.referencingDefaultValue(pattern, info.assignments, null, true);
		}

		// Process parameter declarations.
		for (i = 0, iz = node.params.length; i < iz; ++i) {
			this.visitPattern(
				node.params[i],
				{ processRightHandNodes: true },
				visitPatternCallback,
			);
		}

		// if there's a rest argument, add that
		if (node.rest) {
			this.visitPattern(
				{
					type: "RestElement",
					argument: node.rest,
				},
				pattern => {
					this.currentScope().__define(
						pattern,
						new ParameterDefinition(
							pattern,
							node,
							node.params.length,
							true,
						),
					);
				},
			);
		}

		// In TypeScript there are a number of function-like constructs which have no body,
		// so check it exists before traversing
		if (node.body) {
			// Skip BlockStatement to prevent creating BlockStatement scope.
			if (node.body.type === Syntax.BlockStatement) {
				this.visitChildren(node.body);
			} else {
				this.visit(node.body);
			}
		}

		this.close(node);
	}

	visitClass(node) {
		if (node.type === Syntax.ClassDeclaration) {
			this.currentScope().__define(
				node.id,
				new Definition(
					Variable.ClassName,
					node.id,
					node,
					null,
					null,
					null,
				),
			);
		}

		this.scopeManager.__nestClassScope(node);

		if (node.id) {
			this.currentScope().__define(
				node.id,
				new Definition(Variable.ClassName, node.id, node),
			);
		}

		this.visit(node.superClass);
		this.visit(node.body);

		this.close(node);
	}

	visitProperty(node) {
		let previous;

		if (node.computed) {
			this.visit(node.key);
		}

		const isMethodDefinition = node.type === Syntax.MethodDefinition;

		if (isMethodDefinition) {
			previous = this.pushInnerMethodDefinition(true);
		}
		this.visit(node.value);
		if (isMethodDefinition) {
			this.popInnerMethodDefinition(previous);
		}
	}

	visitForIn(node) {
		if (
			node.left.type === Syntax.VariableDeclaration &&
			node.left.kind !== "var"
		) {
			this.scopeManager.__nestForScope(node);
		}

		if (node.left.type === Syntax.VariableDeclaration) {
			this.visit(node.left);
			this.visitPattern(node.left.declarations[0].id, pattern => {
				this.currentScope().__referencing(
					pattern,
					Reference.WRITE,
					node.right,
					null,
					true,
					true,
				);
			});
		} else {
			this.visitPattern(
				node.left,
				{ processRightHandNodes: true },
				(pattern, info) => {
					let maybeImplicitGlobal = null;

					if (!this.currentScope().isStrict) {
						maybeImplicitGlobal = {
							pattern,
							node,
						};
					}
					this.referencingDefaultValue(
						pattern,
						info.assignments,
						maybeImplicitGlobal,
						false,
					);
					this.currentScope().__referencing(
						pattern,
						Reference.WRITE,
						node.right,
						maybeImplicitGlobal,
						true,
						false,
					);
				},
			);
		}
		this.visit(node.right);
		this.visit(node.body);

		this.close(node);
	}

	visitVariableDeclaration(variableTargetScope, type, node, index) {
		const decl = node.declarations[index];
		const init = decl.init;

		this.visitPattern(
			decl.id,
			{ processRightHandNodes: true },
			(pattern, info) => {
				variableTargetScope.__define(
					pattern,
					new Definition(type, pattern, decl, node, index, node.kind),
				);

				this.referencingDefaultValue(
					pattern,
					info.assignments,
					null,
					true,
				);
				if (init) {
					this.currentScope().__referencing(
						pattern,
						Reference.WRITE,
						init,
						null,
						!info.topLevel,
						true,
					);
				}
			},
		);
	}

	AssignmentExpression(node) {
		if (PatternVisitor.isPattern(node.left)) {
			if (node.operator === "=") {
				this.visitPattern(
					node.left,
					{ processRightHandNodes: true },
					(pattern, info) => {
						let maybeImplicitGlobal = null;

						if (!this.currentScope().isStrict) {
							maybeImplicitGlobal = {
								pattern,
								node,
							};
						}
						this.referencingDefaultValue(
							pattern,
							info.assignments,
							maybeImplicitGlobal,
							false,
						);
						this.currentScope().__referencing(
							pattern,
							Reference.WRITE,
							node.right,
							maybeImplicitGlobal,
							!info.topLevel,
							false,
						);
					},
				);
			} else {
				this.currentScope().__referencing(
					node.left,
					Reference.RW,
					node.right,
				);
			}
		} else {
			this.visit(node.left);
		}
		this.visit(node.right);
	}

	CatchClause(node) {
		this.scopeManager.__nestCatchScope(node);

		this.visitPattern(
			node.param,
			{ processRightHandNodes: true },
			(pattern, info) => {
				this.currentScope().__define(
					pattern,
					new Definition(
						Variable.CatchClause,
						pattern,
						node,
						null,
						null,
						null,
					),
				);
				this.referencingDefaultValue(
					pattern,
					info.assignments,
					null,
					true,
				);
			},
		);
		this.visit(node.body);

		this.close(node);
	}

	Program(node) {
		this.scopeManager.__nestGlobalScope(node);

		if (this.scopeManager.isGlobalReturn()) {
			// Force strictness of GlobalScope to false when using node.js scope.
			this.currentScope().isStrict = false;
			this.scopeManager.__nestFunctionScope(node, false);
		}

		if (this.scopeManager.__isES6() && this.scopeManager.isModule()) {
			this.scopeManager.__nestModuleScope(node);
		}

		if (
			this.scopeManager.isStrictModeSupported() &&
			this.scopeManager.isImpliedStrict()
		) {
			this.currentScope().isStrict = true;
		}

		this.visitChildren(node);
		this.close(node);
	}

	Identifier(node) {
		this.currentScope().__referencing(node);
	}

	// eslint-disable-next-line class-methods-use-this -- Desired as instance method
	PrivateIdentifier() {
		// Do nothing.
	}

	UpdateExpression(node) {
		if (PatternVisitor.isPattern(node.argument)) {
			this.currentScope().__referencing(
				node.argument,
				Reference.RW,
				null,
			);
		} else {
			this.visitChildren(node);
		}
	}

	MemberExpression(node) {
		this.visit(node.object);
		if (node.computed) {
			this.visit(node.property);
		}
	}

	Property(node) {
		this.visitProperty(node);
	}

	PropertyDefinition(node) {
		const { computed, key, value } = node;

		if (computed) {
			this.visit(key);
		}
		if (value) {
			this.scopeManager.__nestClassFieldInitializerScope(value);
			this.visit(value);
			this.close(value);
		}
	}

	StaticBlock(node) {
		this.scopeManager.__nestClassStaticBlockScope(node);

		this.visitChildren(node);

		this.close(node);
	}

	MethodDefinition(node) {
		this.visitProperty(node);
	}

	BreakStatement() {} // eslint-disable-line class-methods-use-this -- Desired as instance method

	ContinueStatement() {} // eslint-disable-line class-methods-use-this -- Desired as instance method

	LabeledStatement(node) {
		this.visit(node.body);
	}

	ForStatement(node) {
		// Create ForStatement declaration.
		// NOTE: In ES6, ForStatement dynamically generates
		// per iteration environment. However, escope is
		// a static analyzer, we only generate one scope for ForStatement.
		if (
			node.init &&
			node.init.type === Syntax.VariableDeclaration &&
			node.init.kind !== "var"
		) {
			this.scopeManager.__nestForScope(node);
		}

		this.visitChildren(node);

		this.close(node);
	}

	ClassExpression(node) {
		this.visitClass(node);
	}

	ClassDeclaration(node) {
		this.visitClass(node);
	}

	CallExpression(node) {
		// Check this is direct call to eval
		if (
			!this.scopeManager.__ignoreEval() &&
			node.callee.type === Syntax.Identifier &&
			node.callee.name === "eval"
		) {
			// NOTE: This should be `variableScope`. Since direct eval call always creates Lexical environment and
			// let / const should be enclosed into it. Only VariableDeclaration affects on the caller's environment.
			this.currentScope().variableScope.__detectEval();
		}
		this.visitChildren(node);
	}

	BlockStatement(node) {
		if (this.scopeManager.__isES6()) {
			this.scopeManager.__nestBlockScope(node);
		}

		this.visitChildren(node);

		this.close(node);
	}

	ThisExpression() {
		this.currentScope().variableScope.__detectThis();
	}

	WithStatement(node) {
		this.visit(node.object);

		// Then nest scope for WithStatement.
		this.scopeManager.__nestWithScope(node);

		this.visit(node.body);

		this.close(node);
	}

	VariableDeclaration(node) {
		const variableTargetScope =
			node.kind === "var"
				? this.currentScope().variableScope
				: this.currentScope();

		for (let i = 0, iz = node.declarations.length; i < iz; ++i) {
			const decl = node.declarations[i];

			this.visitVariableDeclaration(
				variableTargetScope,
				Variable.Variable,
				node,
				i,
			);
			if (decl.init) {
				this.visit(decl.init);
			}
		}
	}

	// sec 13.11.8
	SwitchStatement(node) {
		this.visit(node.discriminant);

		if (this.scopeManager.__isES6()) {
			this.scopeManager.__nestSwitchScope(node);
		}

		for (let i = 0, iz = node.cases.length; i < iz; ++i) {
			this.visit(node.cases[i]);
		}

		this.close(node);
	}

	FunctionDeclaration(node) {
		this.visitFunction(node);
	}

	FunctionExpression(node) {
		this.visitFunction(node);
	}

	ForOfStatement(node) {
		this.visitForIn(node);
	}

	ForInStatement(node) {
		this.visitForIn(node);
	}

	ArrowFunctionExpression(node) {
		this.visitFunction(node);
	}

	ImportDeclaration(node) {
		assert(
			this.scopeManager.__isES6() && this.scopeManager.isModule(),
			"ImportDeclaration should appear when the mode is ES6 and in the module context.",
		);

		const importer = new Importer(node, this);

		importer.visit(node);
	}

	visitExportDeclaration(node) {
		if (node.source) {
			return;
		}
		if (node.declaration) {
			this.visit(node.declaration);
			return;
		}

		this.visitChildren(node);
	}

	// TODO: ExportDeclaration doesn't exist. for bc?
	ExportDeclaration(node) {
		this.visitExportDeclaration(node);
	}

	ExportAllDeclaration(node) {
		this.visitExportDeclaration(node);
	}

	ExportDefaultDeclaration(node) {
		this.visitExportDeclaration(node);
	}

	ExportNamedDeclaration(node) {
		this.visitExportDeclaration(node);
	}

	ExportSpecifier(node) {
		// TODO: `node.id` doesn't exist. for bc?
		const local = node.id || node.local;

		this.visit(local);
	}

	// eslint-disable-next-line class-methods-use-this -- Desired as instance method
	MetaProperty() {
		// do nothing.
	}

	JSXIdentifier(node) {
		// Special case: "this" should not count as a reference
		if (this.scopeManager.__isJSXEnabled() && node.name !== "this") {
			this.currentScope().__referencing(node);
		}
	}

	JSXMemberExpression(node) {
		this.visit(node.object);
	}

	JSXElement(node) {
		if (this.scopeManager.__isJSXEnabled()) {
			this.visit(node.openingElement);
			node.children.forEach(this.visit, this);
		} else {
			this.visitChildren(node);
		}
	}

	JSXOpeningElement(node) {
		if (this.scopeManager.__isJSXEnabled()) {
			const nameNode = node.name;
			const isComponentName =
				nameNode.type === "JSXIdentifier" &&
				nameNode.name[0].toUpperCase() === nameNode.name[0];
			const isComponent =
				isComponentName || nameNode.type === "JSXMemberExpression";

			// we only want to visit JSXIdentifier nodes if they are capitalized
			if (isComponent) {
				this.visit(nameNode);
			}
		}

		node.attributes.forEach(this.visit, this);
	}

	JSXAttribute(node) {
		if (node.value) {
			this.visit(node.value);
		}
	}

	JSXExpressionContainer(node) {
		this.visit(node.expression);
	}

	JSXNamespacedName(node) {
		this.visit(node.namespace);
		this.visit(node.name);
	}
}

export default Referencer;

/* vim: set sw=4 ts=4 et tw=80 : */
T"ֵx/*
  Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import {
	BlockScope,
	CatchScope,
	ClassFieldInitializerScope,
	ClassStaticBlockScope,
	ClassScope,
	ForScope,
	FunctionExpressionNameScope,
	FunctionScope,
	GlobalScope,
	ModuleScope,
	SwitchScope,
	WithScope,
} from "./scope.js";
import { assert } from "./assert.js";

/** @import * as types from "eslint-scope" */
/** @import ESTree from "estree" */
/** @import { Scope } from "./scope.js" */
/** @import Variable from "./variable.js" */

/**
 * @constructor ScopeManager
 * @implements {types.ScopeManager}
 */
class ScopeManager {
	constructor(options) {
		this.scopes = [];
		this.globalScope = null;
		this.__nodeToScope = new WeakMap();
		this.__currentScope = null;
		this.__options = options;
		this.__declaredVariables = new WeakMap();
	}

	__isOptimistic() {
		return this.__options.optimistic;
	}

	__ignoreEval() {
		return this.__options.ignoreEval;
	}

	__isJSXEnabled() {
		return this.__options.jsx === true;
	}

	isGlobalReturn() {
		return (
			this.__options.nodejsScope ||
			this.__options.sourceType === "commonjs"
		);
	}

	isModule() {
		return this.__options.sourceType === "module";
	}

	isImpliedStrict() {
		return !!this.__options.impliedStrict;
	}

	isStrictModeSupported() {
		return this.__options.ecmaVersion >= 5;
	}

	// Returns appropriate scope for this node.
	__get(node) {
		return this.__nodeToScope.get(node);
	}

	/**
	 * Get variables that are declared by the node.
	 *
	 * "are declared by the node" means the node is same as `Variable.defs[].node` or `Variable.defs[].parent`.
	 * If the node declares nothing, this method returns an empty array.
	 * CAUTION: This API is experimental. See https://github.com/estools/escope/pull/69 for more details.
	 * @param {ESTree.Node} node a node to get.
	 * @returns {Variable[]} variables that declared by the node.
	 */
	getDeclaredVariables(node) {
		return this.__declaredVariables.get(node) || [];
	}

	/**
	 * acquire scope from node.
	 * @function ScopeManager#acquire
	 * @param {ESTree.Node} node node for the acquired scope.
	 * @param {?boolean} [inner=false] look up the most inner scope, default value is false.
	 * @returns {Scope?} Scope from node
	 */
	acquire(node, inner) {
		/**
		 * predicate
		 * @param {Scope} testScope scope to test
		 * @returns {boolean} predicate
		 */
		function predicate(testScope) {
			if (
				testScope.type === "function" &&
				testScope.functionExpressionScope
			) {
				return false;
			}
			return true;
		}

		const scopes = this.__get(node);

		if (!scopes || scopes.length === 0) {
			return null;
		}

		// Heuristic selection from all scopes.
		// If you would like to get all scopes, please use ScopeManager#acquireAll.
		if (scopes.length === 1) {
			return scopes[0];
		}

		if (inner) {
			for (let i = scopes.length - 1; i >= 0; --i) {
				const scope = scopes[i];

				if (predicate(scope)) {
					return scope;
				}
			}
		} else {
			for (let i = 0, iz = scopes.length; i < iz; ++i) {
				const scope = scopes[i];

				if (predicate(scope)) {
					return scope;
				}
			}
		}

		return null;
	}

	/**
	 * acquire all scopes from node.
	 * @function ScopeManager#acquireAll
	 * @param {ESTree.Node} node node for the acquired scope.
	 * @returns {Scope[]?} Scope array
	 */
	acquireAll(node) {
		return this.__get(node);
	}

	/**
	 * release the node.
	 * @function ScopeManager#release
	 * @param {ESTree.Node} node releasing node.
	 * @param {?boolean} [inner=false] look up the most inner scope, default value is false.
	 * @returns {Scope?} upper scope for the node.
	 */
	release(node, inner) {
		const scopes = this.__get(node);

		if (scopes && scopes.length) {
			const scope = scopes[0].upper;

			if (!scope) {
				return null;
			}
			return this.acquire(scope.block, inner);
		}
		return null;
	}

	/**
	 * Add global variables and resolve their references.
	 * @function ScopeManager#addGlobals
	 * @param {string[]} names Names of global variables to add.
	 * @returns {void}
	 */
	addGlobals(names) {
		// @ts-ignore -- globalScope must be set before this method is called.
		this.globalScope.__addVariables(names);
	}

	attach() {} // eslint-disable-line class-methods-use-this -- Desired as instance method

	detach() {} // eslint-disable-line class-methods-use-this -- Desired as instance method

	__nestScope(scope) {
		if (scope instanceof GlobalScope) {
			assert(this.__currentScope === null);
			this.globalScope = scope;
		}
		this.__currentScope = scope;
		return scope;
	}

	__nestGlobalScope(node) {
		return this.__nestScope(new GlobalScope(this, node));
	}

	__nestBlockScope(node) {
		return this.__nestScope(
			new BlockScope(this, this.__currentScope, node),
		);
	}

	__nestFunctionScope(node, isMethodDefinition) {
		return this.__nestScope(
			new FunctionScope(
				this,
				this.__currentScope,
				node,
				isMethodDefinition,
			),
		);
	}

	__nestForScope(node) {
		return this.__nestScope(new ForScope(this, this.__currentScope, node));
	}

	__nestCatchScope(node) {
		return this.__nestScope(
			new CatchScope(this, this.__currentScope, node),
		);
	}

	__nestWithScope(node) {
		return this.__nestScope(new WithScope(this, this.__currentScope, node));
	}

	__nestClassScope(node) {
		return this.__nestScope(
			new ClassScope(this, this.__currentScope, node),
		);
	}

	__nestClassFieldInitializerScope(node) {
		return this.__nestScope(
			new ClassFieldInitializerScope(this, this.__currentScope, node),
		);
	}

	__nestClassStaticBlockScope(node) {
		return this.__nestScope(
			new ClassStaticBlockScope(this, this.__currentScope, node),
		);
	}

	__nestSwitchScope(node) {
		return this.__nestScope(
			new SwitchScope(this, this.__currentScope, node),
		);
	}

	__nestModuleScope(node) {
		return this.__nestScope(
			new ModuleScope(this, this.__currentScope, node),
		);
	}

	__nestFunctionExpressionNameScope(node) {
		return this.__nestScope(
			new FunctionExpressionNameScope(this, this.__currentScope, node),
		);
	}

	__isES6() {
		return this.__options.ecmaVersion >= 6;
	}
}

export default ScopeManager;

/* vim: set sw=4 ts=4 et tw=80 : */
5>	xO8/*
  Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

import estraverse from "estraverse";

import Reference from "./reference.js";
import Variable from "./variable.js";
import { Definition } from "./definition.js";
import { assert } from "./assert.js";

/** @import * as types from "eslint-scope" */
/** @import ESTree from "estree" */
/** @import ScopeManager from "./scope-manager.js" */
/** @typedef {ESTree.Function | ESTree.Program | ESTree.StaticBlock} Block */
/** @typedef {{pattern: unknown, node: unknown}} MaybeImplicitGlobal */

const { Syntax } = estraverse;

/**
 * Test if scope is struct
 * @param {Scope} scope scope
 * @param {Block} block block
 * @param {boolean} isMethodDefinition is method definition
 * @returns {boolean} is strict scope
 */
function isStrictScope(scope, block, isMethodDefinition) {
	let body;

	// When upper scope is exists and strict, inner scope is also strict.
	if (scope.upper && scope.upper.isStrict) {
		return true;
	}

	if (isMethodDefinition) {
		return true;
	}

	if (scope.type === "class" || scope.type === "module") {
		return true;
	}

	if (scope.type === "block" || scope.type === "switch") {
		return false;
	}

	if (scope.type === "function") {
		if (
			block.type === Syntax.ArrowFunctionExpression &&
			// @ts-ignore -- when block is ArrowFunctionExpression
			block.body.type !== Syntax.BlockStatement
		) {
			return false;
		}

		if (block.type === Syntax.Program) {
			body = block;
		} else {
			body = block.body;
		}

		if (!body) {
			return false;
		}
	} else if (scope.type === "global") {
		body = block;
	} else {
		return false;
	}

	// Search for a 'use strict' directive.
	// @ts-ignore -- body is a function body
	for (let i = 0, iz = body.body.length; i < iz; ++i) {
		// @ts-ignore -- body is a function body
		const stmt = body.body[i];

		/*
		 * Check if the current statement is a directive.
		 * If it isn't, then we're past the directive prologue
		 * so stop the search because directives cannot
		 * appear after this point.
		 *
		 * Some parsers set `directive:null` on non-directive
		 * statements, so the `typeof` check is safer than
		 * checking for property existence.
		 */
		if (typeof stmt.directive !== "string") {
			break;
		}

		if (stmt.directive === "use strict") {
			return true;
		}
	}

	return false;
}

/**
 * Register scope
 * @param {ScopeManager} scopeManager scope manager
 * @param {Scope} scope scope
 * @returns {void}
 */
function registerScope(scopeManager, scope) {
	scopeManager.scopes.push(scope);

	const scopes = scopeManager.__nodeToScope.get(scope.block);

	if (scopes) {
		scopes.push(scope);
	} else {
		scopeManager.__nodeToScope.set(scope.block, [scope]);
	}
}

/**
 * @constructor Scope
 * @implements {types.Scope}
 */
class Scope {
	constructor(scopeManager, type, upperScope, block, isMethodDefinition) {
		/**
		 * One of "global", "module", "function", "function-expression-name", "block", "switch", "catch", "with", "for",
		 * "class", "class-field-initializer", "class-static-block".
		 * @member {string} Scope#type
		 */
		this.type = type;

		/**
		 * The scoped {@link Variable}s of this scope, as <code>{ Variable.name
		 * : Variable }</code>.
		 * @member {Map} Scope#set
		 */
		this.set = new Map();

		/**
		 * The tainted variables of this scope, as <code>{ Variable.name :
		 * boolean }</code>.
		 *  @member {Map} Scope#taints
		 */
		this.taints = new Map();

		/**
		 * Generally, through the lexical scoping of JS you can always know
		 * which variable an identifier in the source code refers to. There are
		 * a few exceptions to this rule. With 'global' and 'with' scopes you
		 * can only decide at runtime which variable a reference refers to.
		 * Moreover, if 'eval()' is used in a scope, it might introduce new
		 * bindings in this or its parent scopes.
		 * All those scopes are considered 'dynamic'.
		 * @member {boolean} Scope#dynamic
		 */
		this.dynamic = this.type === "global" || this.type === "with";

		/**
		 * A reference to the scope-defining syntax node.
		 * @member {espree.Node} Scope#block
		 */
		this.block = block;

		/**
		 * The {@link Reference|references} that are not resolved with this scope.
		 * @member {Reference[]} Scope#through
		 */
		this.through = [];

		/**
		 * The scoped {@link Variable}s of this scope. In the case of a
		 * 'function' scope this includes the automatic argument <em>arguments</em> as
		 * its first element, as well as all further formal arguments.
		 * @member {Variable[]} Scope#variables
		 */
		this.variables = [];

		/**
		 * Any variable {@link Reference|reference} found in this scope. This
		 * includes occurrences of local variables as well as variables from
		 * parent scopes (including the global scope). For local variables
		 * this also includes defining occurrences (like in a 'var' statement).
		 * In a 'function' scope this does not include the occurrences of the
		 * formal parameter in the parameter list.
		 * @member {Reference[]} Scope#references
		 */
		this.references = [];

		/**
		 * For 'global' and 'function' scopes, this is a self-reference. For
		 * other scope types this is the <em>variableScope</em> value of the
		 * parent scope.
		 * @member {Scope} Scope#variableScope
		 */
		this.variableScope =
			this.type === "global" ||
			this.type === "module" ||
			this.type === "function" ||
			this.type === "class-field-initializer" ||
			this.type === "class-static-block"
				? this
				: upperScope.variableScope;

		/**
		 * Whether this scope is created by a FunctionExpression.
		 * @member {boolean} Scope#functionExpressionScope
		 */
		this.functionExpressionScope = /** @type {any} */ (false);

		/**
		 * Whether this is a scope that contains an 'eval()' invocation.
		 * @member {boolean} Scope#directCallToEvalScope
		 */
		this.directCallToEvalScope = false;

		/**
		 * @member {boolean} Scope#thisFound
		 */
		this.thisFound = false;

		/** @type {?Reference[]} */
		this.__left = [];

		/**
		 * Reference to the parent {@link Scope|scope}.
		 * @member {Scope} Scope#upper
		 */
		this.upper = upperScope;

		/**
		 * Whether 'use strict' is in effect in this scope.
		 * @member {boolean} Scope#isStrict
		 */
		this.isStrict = scopeManager.isStrictModeSupported()
			? isStrictScope(this, block, isMethodDefinition)
			: false;

		/**
		 * List of nested {@link Scope}s.
		 * @member {Scope[]} Scope#childScopes
		 */
		this.childScopes = [];
		if (this.upper) {
			this.upper.childScopes.push(this);
		}

		this.__declaredVariables = scopeManager.__declaredVariables;

		registerScope(scopeManager, this);
	}

	__shouldStaticallyClose(scopeManager) {
		return (
			!this.dynamic ||
			scopeManager.__isOptimistic() ||
			this.type === "global"
		);
	}

	__staticCloseRef(ref) {
		if (!this.__resolve(ref)) {
			this.__delegateToUpperScope(ref);
		}
	}

	__dynamicCloseRef(ref) {
		// notify all names are through to global
		let current = this;

		do {
			current.through.push(ref);
			current = current.upper;
		} while (current);
	}

	__close(scopeManager) {
		let closeRef;

		if (this.__shouldStaticallyClose(scopeManager)) {
			closeRef = this.__staticCloseRef;
		} else {
			closeRef = this.__dynamicCloseRef;
		}

		// Try Resolving all references in this scope.
		// @ts-ignore -- __left should be an array here
		for (let i = 0, iz = this.__left.length; i < iz; ++i) {
			// @ts-ignore -- __left should be an array here
			const ref = this.__left[i];

			closeRef.call(this, ref);
		}
		this.__left = null;

		return this.upper;
	}

	// To override by function scopes.
	// References in default parameters isn't resolved to variables which are in their function body.
	// eslint-disable-next-line class-methods-use-this, no-unused-vars  -- Desired as instance method with signature
	__isValidResolution(ref, variable) {
		return true;
	}

	__resolve(ref) {
		const name = ref.identifier.name;

		if (!this.set.has(name)) {
			return false;
		}
		const variable = this.set.get(name);

		if (!this.__isValidResolution(ref, variable)) {
			return false;
		}
		variable.references.push(ref);
		variable.stack =
			variable.stack && ref.from.variableScope === this.variableScope;
		if (ref.tainted) {
			variable.tainted = true;
			this.taints.set(variable.name, true);
		}
		ref.resolved = variable;

		return true;
	}

	__delegateToUpperScope(ref) {
		if (this.upper) {
			this.upper.__left.push(ref);
		}
		this.through.push(ref);
	}

	__addDeclaredVariablesOfNode(variable, node) {
		if (node === null || node === void 0) {
			return;
		}

		let variables = this.__declaredVariables.get(node);

		if (variables === null || variables === void 0) {
			variables = [];
			this.__declaredVariables.set(node, variables);
		}
		if (!variables.includes(variable)) {
			variables.push(variable);
		}
	}

	__defineGeneric(name, set, variables, node, def) {
		let variable;

		variable = set.get(name);
		if (!variable) {
			variable = new Variable(name, this);
			set.set(name, variable);
			variables.push(variable);
		}

		if (def) {
			variable.defs.push(def);
			this.__addDeclaredVariablesOfNode(variable, def.node);
			this.__addDeclaredVariablesOfNode(variable, def.parent);
		}
		if (node) {
			variable.identifiers.push(node);
		}
	}

	__define(node, def) {
		if (node && node.type === Syntax.Identifier) {
			this.__defineGeneric(
				node.name,
				this.set,
				this.variables,
				node,
				def,
			);
		}
	}

	__referencing(node, assign, writeExpr, maybeImplicitGlobal, partial, init) {
		// because Array element may be null
		if (
			!node ||
			(node.type !== Syntax.Identifier && node.type !== "JSXIdentifier")
		) {
			return;
		}

		// Specially handle like `this`.
		if (node.name === "super") {
			return;
		}

		const ref = new Reference(
			node,
			this,
			assign || Reference.READ,
			writeExpr,
			maybeImplicitGlobal,
			!!partial,
			!!init,
		);

		this.references.push(ref);

		// @ts-ignore -- __left should be an array here
		this.__left.push(ref);
	}

	__detectEval() {
		let current = this;

		this.directCallToEvalScope = true;
		do {
			current.dynamic = true;
			current = current.upper;
		} while (current);
	}

	__detectThis() {
		this.thisFound = true;
	}

	__isClosed() {
		return this.__left === null;
	}

	/**
	 * returns resolved {Reference}
	 * @function Scope#resolve
	 * @param {ESTree.Identifier} ident identifier to be resolved.
	 * @returns {?Reference} reference
	 */
	resolve(ident) {
		let ref, i, iz;

		assert(this.__isClosed(), "Scope should be closed.");
		assert(
			ident.type === Syntax.Identifier,
			"Target should be identifier.",
		);
		for (i = 0, iz = this.references.length; i < iz; ++i) {
			ref = this.references[i];
			if (ref.identifier === ident) {
				return ref;
			}
		}
		return null;
	}

	/**
	 * returns this scope is static
	 * @function Scope#isStatic
	 * @returns {boolean} static
	 */
	isStatic() {
		return !this.dynamic;
	}

	/**
	 * returns this scope has materialized arguments
	 * @function Scope#isArgumentsMaterialized
	 * @returns {any} arguments materialized
	 */ // eslint-disable-next-line class-methods-use-this -- Desired as instance method
	isArgumentsMaterialized() {
		return true;
	}

	/**
	 * returns this scope has materialized `this` reference
	 * @function Scope#isThisMaterialized
	 * @returns {any} this materialized
	 */ // eslint-disable-next-line class-methods-use-this -- Desired as instance method
	isThisMaterialized() {
		return true;
	}

	isUsedName(name) {
		if (this.set.has(name)) {
			return true;
		}
		for (let i = 0, iz = this.through.length; i < iz; ++i) {
			if (this.through[i].identifier.name === name) {
				return true;
			}
		}
		return false;
	}
}

/**
 * Global scope.
 * @implements {types.GlobalScope}
 */
class GlobalScope extends Scope {
	constructor(scopeManager, block) {
		super(scopeManager, "global", null, block, false);
		this.implicit = {
			set: new Map(),

			/** @type {Variable[]} */
			variables: [],

			/**
			 * List of {@link Reference}s that are left to be resolved (i.e. which
			 * need to be linked to the variable they refer to).
			 * @member {Reference[]} Scope#implicit#left
			 * @type {Reference[]}
			 */
			left: [],
		};
	}

	__close(scopeManager) {
		const implicit = [];

		// @ts-ignore -- __left should be an array here
		for (let i = 0, iz = this.__left.length; i < iz; ++i) {
			// @ts-ignore -- __left should be an array here
			const ref = this.__left[i];

			if (
				ref.__maybeImplicitGlobal &&
				!this.set.has(ref.identifier.name)
			) {
				implicit.push(ref.__maybeImplicitGlobal);
			}
		}

		// create an implicit global variable from assignment expression
		for (let i = 0, iz = implicit.length; i < iz; ++i) {
			const info = implicit[i];

			this.__defineImplicit(
				info.pattern,
				new Definition(
					Variable.ImplicitGlobalVariable,
					info.pattern,
					info.node,
					null,
					null,
					null,
				),
			);
		}

		super.__close(scopeManager);

		this.implicit.left = [...this.through];

		return null;
	}

	__defineImplicit(node, def) {
		if (node && node.type === Syntax.Identifier) {
			this.__defineGeneric(
				node.name,
				this.implicit.set,
				this.implicit.variables,
				node,
				def,
			);
		}
	}

	__addVariables(names) {
		for (const name of names) {
			this.__defineGeneric(name, this.set, this.variables, null, null);
		}

		const namesSet = new Set(names);

		this.through = this.through.filter(reference => {
			const name = reference.identifier.name;

			if (namesSet.has(name)) {
				const variable = this.set.get(name);

				reference.resolved = variable;
				variable.references.push(reference);

				return false;
			}

			return true;
		});

		this.implicit.variables = this.implicit.variables.filter(variable => {
			const name = variable.name;

			if (namesSet.has(name)) {
				this.implicit.set.delete(name);

				return false;
			}

			return true;
		});

		this.implicit.left = this.implicit.left.filter(
			reference => !namesSet.has(reference.identifier.name),
		);
	}
}

/**
 * Module scope.
 * @implements {types.ModuleScope}
 */
class ModuleScope extends Scope {
	constructor(scopeManager, upperScope, block) {
		super(scopeManager, "module", upperScope, block, false);
	}
}

/**
 * Function expression name scope.
 * @implements {types.FunctionExpressionNameScope}
 */
class FunctionExpressionNameScope extends Scope {
	constructor(scopeManager, upperScope, block) {
		super(
			scopeManager,
			"function-expression-name",
			upperScope,
			block,
			false,
		);
		this.__define(
			block.id,
			new Definition(
				Variable.FunctionName,
				block.id,
				block,
				null,
				null,
				null,
			),
		);
		this.functionExpressionScope = /** @type {const} */ (true);
	}
}

/**
 * Catch scope.
 * @implements {types.CatchScope}
 */
class CatchScope extends Scope {
	constructor(scopeManager, upperScope, block) {
		super(scopeManager, "catch", upperScope, block, false);
	}
}

/**
 * With statement scope.
 * @implements {types.WithScope}
 */
class WithScope extends Scope {
	constructor(scopeManager, upperScope, block) {
		super(scopeManager, "with", upperScope, block, false);
	}

	__close(scopeManager) {
		if (this.__shouldStaticallyClose(scopeManager)) {
			return super.__close(scopeManager);
		}

		// @ts-ignore -- __left should be an array here
		for (let i = 0, iz = this.__left.length; i < iz; ++i) {
			// @ts-ignore -- __left should be an array here
			const ref = this.__left[i];

			ref.tainted = true;
			this.__delegateToUpperScope(ref);
		}
		this.__left = null;

		return this.upper;
	}
}

/**
 * Block scope.
 * @implements {types.BlockScope}
 */
class BlockScope extends Scope {
	constructor(scopeManager, upperScope, block) {
		super(scopeManager, "block", upperScope, block, false);
	}
}

/**
 * Switch scope.
 * @implements {types.SwitchScope}
 */
class SwitchScope extends Scope {
	constructor(scopeManager, upperScope, block) {
		super(scopeManager, "switch", upperScope, block, false);
	}
}

/**
 * Function scope.
 * @implements {types.FunctionScope}
 */
class FunctionScope extends Scope {
	constructor(scopeManager, upperScope, block, isMethodDefinition) {
		super(scopeManager, "function", upperScope, block, isMethodDefinition);

		// section 9.2.13, FunctionDeclarationInstantiation.
		// NOTE Arrow functions never have an arguments objects.
		if (this.block.type !== Syntax.ArrowFunctionExpression) {
			this.__defineArguments();
		}
	}

	isArgumentsMaterialized() {
		// TODO(Constellation)
		// We can more aggressive on this condition like this.
		//
		// function t() {
		//     // arguments of t is always hidden.
		//     function arguments() {
		//     }
		// }
		if (this.block.type === Syntax.ArrowFunctionExpression) {
			return false;
		}

		if (!this.isStatic()) {
			return true;
		}

		const variable = this.set.get("arguments");

		assert(variable, "Always have arguments variable.");
		return variable.tainted || variable.references.length !== 0;
	}

	isThisMaterialized() {
		if (!this.isStatic()) {
			return true;
		}
		return this.thisFound;
	}

	__defineArguments() {
		this.__defineGeneric("arguments", this.set, this.variables, null, null);
		this.taints.set("arguments", true);
	}

	// References in default parameters isn't resolved to variables which are in their function body.
	//     const x = 1
	//     function f(a = x) { // This `x` is resolved to the `x` in the outer scope.
	//         const x = 2
	//         console.log(a)
	//     }
	__isValidResolution(ref, variable) {
		// If `options.nodejsScope` is true, `this.block` becomes a Program node.
		if (this.block.type === "Program") {
			return true;
		}

		const bodyStart = this.block.body.range[0];

		// It's invalid resolution in the following case:
		return !(
			variable.scope === this &&
			ref.identifier.range[0] < bodyStart && // the reference is in the parameter part.
			variable.defs.every(d => d.name.range[0] >= bodyStart) // the variable is in the body.
		);
	}
}

/**
 * Scope of for, for-in, and for-of statements.
 * @implements {types.ForScope}
 */
class ForScope extends Scope {
	constructor(scopeManager, upperScope, block) {
		super(scopeManager, "for", upperScope, block, false);
	}
}

/**
 * Class scope.
 * @implements {types.ClassScope}
 */
class ClassScope extends Scope {
	constructor(scopeManager, upperScope, block) {
		super(scopeManager, "class", upperScope, block, false);
	}
}

/**
 * Class field initializer scope.
 * @implements {types.ClassFieldInitializerScope}
 */
class ClassFieldInitializerScope extends Scope {
	constructor(scopeManager, upperScope, block) {
		super(scopeManager, "class-field-initializer", upperScope, block, true);
	}
}

/**
 * Class static block scope.
 * @implements {types.ClassStaticBlockScope}
 */
class ClassStaticBlockScope extends Scope {
	constructor(scopeManager, upperScope, block) {
		super(scopeManager, "class-static-block", upperScope, block, true);
	}
}

export {
	Scope,
	GlobalScope,
	ModuleScope,
	FunctionExpressionNameScope,
	CatchScope,
	WithScope,
	BlockScope,
	SwitchScope,
	FunctionScope,
	ForScope,
	ClassScope,
	ClassFieldInitializerScope,
	ClassStaticBlockScope,
};

/* vim: set sw=4 ts=4 et tw=80 : */
u{x/*
  Copyright (C) 2015 Yusuke Suzuki <utatane.tea@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

/** @import * as types from "eslint-scope" */
/** @import Reference from "./reference.js" */

/**
 * A Variable represents a locally scoped identifier. These include arguments to
 * functions.
 * @constructor Variable
 * @implements {types.Variable}
 */
class Variable {
	constructor(name, scope) {
		/**
		 * The variable name, as given in the source code.
		 * @member {string} Variable#name
		 */
		this.name = name;

		/**
		 * List of defining occurrences of this variable (like in 'var ...'
		 * statements or as parameter), as AST nodes.
		 * @member {espree.Identifier[]} Variable#identifiers
		 */
		this.identifiers = [];

		/**
		 * List of {@link Reference|references} of this variable (excluding parameter entries)
		 * in its defining scope and all nested scopes. For defining
		 * occurrences only see {@link Variable#defs}.
		 * @member {Reference[]} Variable#references
		 */
		this.references = [];

		/**
		 * List of defining occurrences of this variable (like in 'var ...'
		 * statements or as parameter), as custom objects.
		 * @member {Definition[]} Variable#defs
		 */
		this.defs = [];

		this.tainted = false;

		/**
		 * Whether this is a stack variable.
		 * @member {boolean} Variable#stack
		 */
		this.stack = true;

		/**
		 * Reference to the enclosing Scope.
		 * @member {Scope} Variable#scope
		 */
		this.scope = scope;
	}
}

Variable.CatchClause = "CatchClause";
Variable.Parameter = "Parameter";
Variable.FunctionName = "FunctionName";
Variable.ClassName = "ClassName";
Variable.Variable = "Variable";
Variable.ImportBinding = "ImportBinding";
Variable.ImplicitGlobalVariable = "ImplicitGlobalVariable";

export default Variable;

/* vim: set sw=4 ts=4 et tw=80 : */
@߲ixm{
  "name": "eslint-scope",
  "description": "ECMAScript scope analyzer for ESLint",
  "homepage": "https://github.com/eslint/js/blob/main/packages/eslint-scope/README.md",
  "main": "./dist/eslint-scope.cjs",
  "types": "./lib/index.d.cts",
  "type": "module",
  "exports": {
    ".": {
      "import": {
        "types": "./lib/index.d.ts",
        "default": "./lib/index.js"
      },
      "require": {
        "types": "./lib/index.d.cts",
        "default": "./dist/eslint-scope.cjs"
      }
    },
    "./package.json": "./package.json"
  },
  "version": "9.1.2",
  "engines": {
    "node": "^20.19.0 || ^22.13.0 || >=24"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/eslint/js.git",
    "directory": "packages/eslint-scope"
  },
  "funding": "https://opencollective.com/eslint",
  "keywords": [
    "eslint"
  ],
  "bugs": {
    "url": "https://github.com/eslint/js/issues"
  },
  "license": "BSD-2-Clause",
  "scripts": {
    "build": "rollup -c",
    "lint:types": "attw --pack",
    "pretest": "npm run build",
    "test": "node Makefile.js test && npm run test:types",
    "test:types": "tsc -p tsconfig.json && tsc -p tests/types/tsconfig.json"
  },
  "files": [
    "LICENSE",
    "README.md",
    "lib",
    "dist/eslint-scope.cjs"
  ],
  "dependencies": {
    "@types/esrecurse": "^4.3.1",
    "@types/estree": "^1.0.8",
    "esrecurse": "^4.3.0",
    "estraverse": "^5.2.0"
  },
  "devDependencies": {
    "@typescript-eslint/parser": "^8.7.0",
    "chai": "^6.0.0",
    "eslint": ">=10.0.0-rc.0 <10.0.0 || ^10.0.0",
    "eslint-visitor-keys": "^5.0.1",
    "espree": "^11.2.0",
    "npm-license": "^0.3.3",
    "shelljs": "^0.8.5"
  }
}
T~k
x R100644 LICENSE U8ٽcKyd-5צB*100644 README.md N.SE){DK.40000 dist ǿHu+eNWY\140000 lib !u!YvڋC100644 package.json a-ܯ/M)?#@Kx D100644 eslint-visitor-keys.cjs H+gQ6Y|@x100644 eslint-visitor-keys.d.cts 4%<P5U\j995100644 index.d.ts [}8	[:O.Ûg"?100644 visitor-keys.d.ts -z/]SK@EKx'use strict';

/* eslint-disable jsdoc/valid-types -- doesn't allow `readonly`.
   TODO: remove eslint-disable when https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/164 is fixed
*/
/**
 * @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
 */
/* eslint-enable jsdoc/valid-types -- doesn't allow `readonly string[]`. TODO: check why */

/**
 * @type {VisitorKeys}
 */
const KEYS = {
	ArrayExpression: ["elements"],
	ArrayPattern: ["elements"],
	ArrowFunctionExpression: ["params", "body"],
	AssignmentExpression: ["left", "right"],
	AssignmentPattern: ["left", "right"],
	AwaitExpression: ["argument"],
	BinaryExpression: ["left", "right"],
	BlockStatement: ["body"],
	BreakStatement: ["label"],
	CallExpression: ["callee", "arguments"],
	CatchClause: ["param", "body"],
	ChainExpression: ["expression"],
	ClassBody: ["body"],
	ClassDeclaration: ["id", "superClass", "body"],
	ClassExpression: ["id", "superClass", "body"],
	ConditionalExpression: ["test", "consequent", "alternate"],
	ContinueStatement: ["label"],
	DebuggerStatement: [],
	DoWhileStatement: ["body", "test"],
	EmptyStatement: [],
	ExperimentalRestProperty: ["argument"],
	ExperimentalSpreadProperty: ["argument"],
	ExportAllDeclaration: ["exported", "source", "attributes"],
	ExportDefaultDeclaration: ["declaration"],
	ExportNamedDeclaration: [
		"declaration",
		"specifiers",
		"source",
		"attributes",
	],
	ExportSpecifier: ["local", "exported"],
	ExpressionStatement: ["expression"],
	ForInStatement: ["left", "right", "body"],
	ForOfStatement: ["left", "right", "body"],
	ForStatement: ["init", "test", "update", "body"],
	FunctionDeclaration: ["id", "params", "body"],
	FunctionExpression: ["id", "params", "body"],
	Identifier: [],
	IfStatement: ["test", "consequent", "alternate"],
	ImportAttribute: ["key", "value"],
	ImportDeclaration: ["specifiers", "source", "attributes"],
	ImportDefaultSpecifier: ["local"],
	ImportExpression: ["source", "options"],
	ImportNamespaceSpecifier: ["local"],
	ImportSpecifier: ["imported", "local"],
	JSXAttribute: ["name", "value"],
	JSXClosingElement: ["name"],
	JSXClosingFragment: [],
	JSXElement: ["openingElement", "children", "closingElement"],
	JSXEmptyExpression: [],
	JSXExpressionContainer: ["expression"],
	JSXFragment: ["openingFragment", "children", "closingFragment"],
	JSXIdentifier: [],
	JSXMemberExpression: ["object", "property"],
	JSXNamespacedName: ["namespace", "name"],
	JSXOpeningElement: ["name", "attributes"],
	JSXOpeningFragment: [],
	JSXSpreadAttribute: ["argument"],
	JSXSpreadChild: ["expression"],
	JSXText: [],
	LabeledStatement: ["label", "body"],
	Literal: [],
	LogicalExpression: ["left", "right"],
	MemberExpression: ["object", "property"],
	MetaProperty: ["meta", "property"],
	MethodDefinition: ["key", "value"],
	NewExpression: ["callee", "arguments"],
	ObjectExpression: ["properties"],
	ObjectPattern: ["properties"],
	PrivateIdentifier: [],
	Program: ["body"],
	Property: ["key", "value"],
	PropertyDefinition: ["key", "value"],
	RestElement: ["argument"],
	ReturnStatement: ["argument"],
	SequenceExpression: ["expressions"],
	SpreadElement: ["argument"],
	StaticBlock: ["body"],
	Super: [],
	SwitchCase: ["test", "consequent"],
	SwitchStatement: ["discriminant", "cases"],
	TaggedTemplateExpression: ["tag", "quasi"],
	TemplateElement: [],
	TemplateLiteral: ["quasis", "expressions"],
	ThisExpression: [],
	ThrowStatement: ["argument"],
	TryStatement: ["block", "handler", "finalizer"],
	UnaryExpression: ["argument"],
	UpdateExpression: ["argument"],
	VariableDeclaration: ["declarations"],
	VariableDeclarator: ["id", "init"],
	WhileStatement: ["test", "body"],
	WithStatement: ["object", "body"],
	YieldExpression: ["argument"],
};

// Types.
const NODE_TYPES = Object.keys(KEYS);

// Freeze the keys.
for (const type of NODE_TYPES) {
	Object.freeze(KEYS[type]);
}
Object.freeze(KEYS);

/**
 * @author Toru Nagashima <https://github.com/mysticatea>
 * See LICENSE file in root directory for full license.
 */

/**
 * @typedef {import('./visitor-keys.js').VisitorKeys} VisitorKeys
 */

// List to ignore keys.
const KEY_BLACKLIST = new Set([
	"parent",
	"leadingComments",
	"trailingComments",
]);

/**
 * Check whether a given key should be used or not.
 * @param {string} key The key to check.
 * @returns {boolean} `true` if the key should be used.
 */
function filterKey(key) {
	return !KEY_BLACKLIST.has(key) && key[0] !== "_";
}

/* eslint-disable jsdoc/valid-types -- doesn't allow `readonly`.
   TODO: remove eslint-disable when https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/164 is fixed
*/
/**
 * Get visitor keys of a given node.
 * @param {Object} node The AST node to get keys.
 * @returns {readonly string[]} Visitor keys of the node.
 */
function getKeys(node) {
	return Object.keys(node).filter(filterKey);
}
/* eslint-enable jsdoc/valid-types -- doesn't allow `readonly` */

/**
 * Make the union set with `KEYS` and given keys.
 * @param {VisitorKeys} additionalKeys The additional keys.
 * @returns {VisitorKeys} The union set.
 */
function unionWith(additionalKeys) {
	const retv =
		/** @type {{ [type: string]: ReadonlyArray<string> }} */
		(Object.assign({}, KEYS));

	for (const type of Object.keys(additionalKeys)) {
		if (Object.hasOwn(retv, type)) {
			const keys = new Set(additionalKeys[type]);

			for (const key of retv[type]) {
				keys.add(key);
			}

			retv[type] = Object.freeze(Array.from(keys));
		} else {
			retv[type] = Object.freeze(Array.from(additionalKeys[type]));
		}
	}

	return Object.freeze(retv);
}

exports.KEYS = KEYS;
exports.getKeys = getKeys;
exports.unionWith = unionWith;
_Ix) 4O5O1"./visitor-keys.js"X*xO 100644 index.js nRicJ%fMUr>'G&u100644 visitor-keys.js ͜&+1])g/R*X Dx$3	"parent",
	"leadingComments",
	"trailingComments",_	 7 eslint-disable jsdoc/valid-types -- doesn't allow `readonly`.
   TODO: remove eslint-disable when https://github.com/jsdoc-typ=e-pratt-parser/jsdoc-type-pratt-parser/issues/164 is fixed
*/T5O	.B/* eslint-enable jsdoc/valid-types -- doesn't allow `readonly` */
	const retv =
		/** @type {{&	 }} */
			2&		if (Object.hasOwn(retv, type)) {
			}-			 				keys.add(key);
			}

			.		} else {
			&);
		}
	}

	0R%Tx=/* eslint-disable jsdoc/valid-types -- doesn't allow `readonly`.
   TODO: remove eslint-disable when https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/164 is fixed
*/
/**
 * @typedef {{ readonly [type: string]: ReadonlyArray<string> }} VisitorKeys
 */
/* eslint-enable jsdoc/valid-types -- doesn't allow `readonly string[]`. TODO: check why */

/**
 * @type {VisitorKeys}
 */
const KEYS = {
	ArrayExpression: ["elements"],
	ArrayPattern: ["elements"],
	ArrowFunctionExpression: ["params", "body"],
	AssignmentExpression: ["left", "right"],
	AssignmentPattern: ["left", "right"],
	AwaitExpression: ["argument"],
	BinaryExpression: ["left", "right"],
	BlockStatement: ["body"],
	BreakStatement: ["label"],
	CallExpression: ["callee", "arguments"],
	CatchClause: ["param", "body"],
	ChainExpression: ["expression"],
	ClassBody: ["body"],
	ClassDeclaration: ["id", "superClass", "body"],
	ClassExpression: ["id", "superClass", "body"],
	ConditionalExpression: ["test", "consequent", "alternate"],
	ContinueStatement: ["label"],
	DebuggerStatement: [],
	DoWhileStatement: ["body", "test"],
	EmptyStatement: [],
	ExperimentalRestProperty: ["argument"],
	ExperimentalSpreadProperty: ["argument"],
	ExportAllDeclaration: ["exported", "source", "attributes"],
	ExportDefaultDeclaration: ["declaration"],
	ExportNamedDeclaration: [
		"declaration",
		"specifiers",
		"source",
		"attributes",
	],
	ExportSpecifier: ["local", "exported"],
	ExpressionStatement: ["expression"],
	ForInStatement: ["left", "right", "body"],
	ForOfStatement: ["left", "right", "body"],
	ForStatement: ["init", "test", "update", "body"],
	FunctionDeclaration: ["id", "params", "body"],
	FunctionExpression: ["id", "params", "body"],
	Identifier: [],
	IfStatement: ["test", "consequent", "alternate"],
	ImportAttribute: ["key", "value"],
	ImportDeclaration: ["specifiers", "source", "attributes"],
	ImportDefaultSpecifier: ["local"],
	ImportExpression: ["source", "options"],
	ImportNamespaceSpecifier: ["local"],
	ImportSpecifier: ["imported", "local"],
	JSXAttribute: ["name", "value"],
	JSXClosingElement: ["name"],
	JSXClosingFragment: [],
	JSXElement: ["openingElement", "children", "closingElement"],
	JSXEmptyExpression: [],
	JSXExpressionContainer: ["expression"],
	JSXFragment: ["openingFragment", "children", "closingFragment"],
	JSXIdentifier: [],
	JSXMemberExpression: ["object", "property"],
	JSXNamespacedName: ["namespace", "name"],
	JSXOpeningElement: ["name", "attributes"],
	JSXOpeningFragment: [],
	JSXSpreadAttribute: ["argument"],
	JSXSpreadChild: ["expression"],
	JSXText: [],
	LabeledStatement: ["label", "body"],
	Literal: [],
	LogicalExpression: ["left", "right"],
	MemberExpression: ["object", "property"],
	MetaProperty: ["meta", "property"],
	MethodDefinition: ["key", "value"],
	NewExpression: ["callee", "arguments"],
	ObjectExpression: ["properties"],
	ObjectPattern: ["properties"],
	PrivateIdentifier: [],
	Program: ["body"],
	Property: ["key", "value"],
	PropertyDefinition: ["key", "value"],
	RestElement: ["argument"],
	ReturnStatement: ["argument"],
	SequenceExpression: ["expressions"],
	SpreadElement: ["argument"],
	StaticBlock: ["body"],
	Super: [],
	SwitchCase: ["test", "consequent"],
	SwitchStatement: ["discriminant", "cases"],
	TaggedTemplateExpression: ["tag", "quasi"],
	TemplateElement: [],
	TemplateLiteral: ["quasis", "expressions"],
	ThisExpression: [],
	ThrowStatement: ["argument"],
	TryStatement: ["block", "handler", "finalizer"],
	UnaryExpression: ["argument"],
	UpdateExpression: ["argument"],
	VariableDeclaration: ["declarations"],
	VariableDeclarator: ["id", "init"],
	WhileStatement: ["test", "body"],
	WithStatement: ["object", "body"],
	YieldExpression: ["argument"],
};

// Types.
const NODE_TYPES = Object.keys(KEYS);

// Freeze the keys.
for (const type of NODE_TYPES) {
	Object.freeze(KEYS[type]);
}
Object.freeze(KEYS);

export default KEYS;
exU{
  "name": "eslint-visitor-keys",
  "version": "5.0.1",
  "description": "Constants and utilities about visitor keys to traverse AST.",
  "type": "module",
  "main": "dist/eslint-visitor-keys.cjs",
  "types": "./dist/index.d.ts",
  "exports": {
    ".": [
      {
        "import": "./lib/index.js",
        "require": "./dist/eslint-visitor-keys.cjs"
      },
      "./dist/eslint-visitor-keys.cjs"
    ],
    "./package.json": "./package.json"
  },
  "files": [
    "dist/index.d.ts",
    "dist/visitor-keys.d.ts",
    "dist/eslint-visitor-keys.cjs",
    "dist/eslint-visitor-keys.d.cts",
    "lib"
  ],
  "engines": {
    "node": "^20.19.0 || ^22.13.0 || >=24"
  },
  "devDependencies": {
    "rollup-plugin-dts": "^6.2.3",
    "tsd": "^0.33.0"
  },
  "scripts": {
    "build": "npm run build:cjs && npm run build:types",
    "build:cjs": "rollup -c",
    "build:debug": "npm run build:cjs -- -m && npm run build:types",
    "build:types": "tsc -v && tsc",
    "test": "mocha \"tests/**/*.test.cjs\" && mocha \"tests/**/*.test.js\" && npm run test:types",
    "test:coverage": "c8 npm test",
    "test:types": "tsd"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/eslint/js.git",
    "directory": "packages/eslint-visitor-keys"
  },
  "funding": "https://opencollective.com/eslint",
  "keywords": [
    "eslint"
  ],
  "author": "Toru Nagashima (https://github.com/mysticatea)",
  "license": "Apache-2.0",
  "bugs": {
    "url": "https://github.com/eslint/js/issues"
  },
  "homepage": "https://github.com/eslint/js/blob/main/packages/eslint-visitor-keys/README.md",
  "sideEffects": false
}
G焮x 100644 LICENSE 6l36Ņz100644 README.md Cqt|%DEZ40000 bin $@-Ub EQR"(Ʉ40000 conf 8(56Fvu],rM40000 lib ajK0(c<\40000 messages fTЇuy100644 package.json DYSM)7W;i6A[
xQQ[![npm version](https://img.shields.io/npm/v/eslint.svg)](https://www.npmjs.com/package/eslint)
[![Downloads](https://img.shields.io/npm/dm/eslint.svg)](https://www.npmjs.com/package/eslint)
[![Build Status](https://github.com/eslint/eslint/workflows/CI/badge.svg)](https://github.com/eslint/eslint/actions)
<br>
[![Open Collective Backers](https://img.shields.io/opencollective/backers/eslint)](https://opencollective.com/eslint)
[![Open Collective Sponsors](https://img.shields.io/opencollective/sponsors/eslint)](https://opencollective.com/eslint)

# ESLint

[Website](https://eslint.org) |
[Configure ESLint](https://eslint.org/docs/latest/use/configure) |
[Rules](https://eslint.org/docs/rules/) |
[Contribute to ESLint](https://eslint.org/docs/latest/contribute) |
[Report Bugs](https://eslint.org/docs/latest/contribute/report-bugs) |
[Code of Conduct](https://eslint.org/conduct) |
[X](https://x.com/geteslint) |
[Discord](https://eslint.org/chat) |
[Mastodon](https://fosstodon.org/@eslint) |
[Bluesky](https://bsky.app/profile/eslint.org)

ESLint is a tool for identifying and reporting on patterns found in ECMAScript/JavaScript code. In many ways, it is similar to JSLint and JSHint with a few exceptions:

- ESLint uses [Espree](https://github.com/eslint/js/tree/main/packages/espree) for JavaScript parsing.
- ESLint uses an AST to evaluate patterns in code.
- ESLint is completely pluggable, every single rule is a plugin and you can add more at runtime.

## Table of Contents

1. [Installation and Usage](#installation-and-usage)
1. [Configuration](#configuration)
1. [Version Support](#version-support)
1. [Code of Conduct](#code-of-conduct)
1. [Filing Issues](#filing-issues)
1. [Frequently Asked Questions](#frequently-asked-questions)
1. [Releases](#releases)
1. [Security Policy](#security-policy)
1. [Semantic Versioning Policy](#semantic-versioning-policy)
1. [ESM Dependencies](#esm-dependencies)
1. [License](#license)
1. [Team](#team)
1. [Sponsors](#sponsors)
1. [Technology Sponsors](#technology-sponsors) <!-- markdownlint-disable-line MD051 -->

## Installation and Usage

### Prerequisites

To use ESLint, you must have [Node.js](https://nodejs.org/) (`^20.19.0`, `^22.13.0`, or `>=24`) installed and built with SSL and ICU support. (If you are using an official Node.js distribution, both SSL and ICU are always built in.)

If you use ESLint's TypeScript type definitions, TypeScript 5.3 or later is required.

### npm Installation

You can install and configure ESLint using this command:

```shell
npm init @eslint/config@latest
```

After that, you can run ESLint on any file or directory like this:

```shell
npx eslint yourfile.js
```

### pnpm Installation

To use ESLint with pnpm, we recommend setting up a `.npmrc` file with at least the following settings:

```text
auto-install-peers=true
node-linker=hoisted
```

This ensures that pnpm installs dependencies in a way that is more compatible with npm and is less likely to produce errors.

## Configuration

You can configure rules in your `eslint.config.js` files as in this example:

```js
import { defineConfig } from "eslint/config";

export default defineConfig([
	{
		files: ["**/*.js", "**/*.cjs", "**/*.mjs"],
		rules: {
			"prefer-const": "warn",
			"no-constant-binary-expression": "error",
		},
	},
]);
```

The names `"prefer-const"` and `"no-constant-binary-expression"` are the names of [rules](https://eslint.org/docs/rules) in ESLint. The first value is the error level of the rule and can be one of these values:

- `"off"` or `0` - turn the rule off
- `"warn"` or `1` - turn the rule on as a warning (doesn't affect exit code)
- `"error"` or `2` - turn the rule on as an error (exit code will be 1)

The three error levels allow you fine-grained control over how ESLint applies rules (for more configuration options and details, see the [configuration docs](https://eslint.org/docs/latest/use/configure)).

## Version Support

The ESLint team provides ongoing support for the current version and six months of limited support for the previous version. Limited support includes critical bug fixes, security issues, and compatibility issues only.

ESLint offers commercial support for both current and previous versions through our partners, [Tidelift][tidelift] and [HeroDevs][herodevs].

See [Version Support](https://eslint.org/version-support) for more details.

## Code of Conduct

ESLint adheres to the [OpenJS Foundation Code of Conduct](https://eslint.org/conduct).

## Filing Issues

Before filing an issue, please be sure to read the guidelines for what you're reporting:

- [Bug Report](https://eslint.org/docs/latest/contribute/report-bugs)
- [Propose a New Rule](https://eslint.org/docs/latest/contribute/propose-new-rule)
- [Proposing a Rule Change](https://eslint.org/docs/latest/contribute/propose-rule-change)
- [Request a Change](https://eslint.org/docs/latest/contribute/request-change)

## Frequently Asked Questions

### Does ESLint support JSX?

Yes, ESLint natively supports parsing JSX syntax (this must be enabled in [configuration](https://eslint.org/docs/latest/use/configure)). Please note that supporting JSX syntax _is not_ the same as supporting React. React applies specific semantics to JSX syntax that ESLint doesn't recognize. We recommend using [eslint-plugin-react](https://www.npmjs.com/package/eslint-plugin-react) if you are using React and want React semantics.

### Does Prettier replace ESLint?

No, ESLint and Prettier have different jobs: ESLint is a linter (looking for problematic patterns) and Prettier is a code formatter. Using both tools is common, refer to [Prettier's documentation](https://prettier.io/docs/en/install#eslint-and-other-linters) to learn how to configure them to work well with each other.

### What ECMAScript versions does ESLint support?

ESLint has full support for ECMAScript 3, 5, and every year from 2015 up until the most recent stage 4 specification (the default). You can set your desired ECMAScript syntax and other settings (like global variables) through [configuration](https://eslint.org/docs/latest/use/configure).

### What about experimental features?

ESLint's parser only officially supports the latest final ECMAScript standard. We will make changes to core rules in order to avoid crashes on stage 3 ECMAScript syntax proposals (as long as they are implemented using the correct experimental ESTree syntax). We may make changes to core rules to better work with language extensions (such as JSX, Flow, and TypeScript) on a case-by-case basis.

In other cases (including if rules need to warn on more or fewer cases due to new syntax, rather than just not crashing), we recommend you use other parsers and/or rule plugins. If you are using Babel, you can use [@babel/eslint-parser](https://www.npmjs.com/package/@babel/eslint-parser) and [@babel/eslint-plugin](https://www.npmjs.com/package/@babel/eslint-plugin) to use any option available in Babel.

Once a language feature has been adopted into the ECMAScript standard (stage 4 according to the [TC39 process](https://tc39.github.io/process-document/)), we will accept issues and pull requests related to the new feature, subject to our [contributing guidelines](https://eslint.org/docs/latest/contribute). Until then, please use the appropriate parser and plugin(s) for your experimental feature.

### Which Node.js versions does ESLint support?

ESLint updates the supported Node.js versions with each major release of ESLint. At that time, ESLint's supported Node.js versions are updated to be:

1. The most recent maintenance release of Node.js
1. The lowest minor version of the Node.js LTS release that includes the features the ESLint team wants to use.
1. The Node.js Current release

ESLint is also expected to work with Node.js versions released after the Node.js Current release.

Refer to the [Quick Start Guide](https://eslint.org/docs/latest/use/getting-started#prerequisites) for the officially supported Node.js versions for a given ESLint release.

### Where to ask for help?

Open a [discussion](https://github.com/eslint/eslint/discussions) or stop by our [Discord server](https://eslint.org/chat).

### Why doesn't ESLint lock dependency versions?

Lock files like `package-lock.json` are helpful for deployed applications. They ensure that dependencies are consistent between environments and across deployments.

Packages like `eslint` that get published to the npm registry do not include lock files. `npm install eslint` as a user will respect version constraints in ESLint's `package.json`. ESLint and its dependencies will be included in the user's lock file if one exists, but ESLint's own lock file would not be used.

We intentionally don't lock dependency versions so that we have the latest compatible dependency versions in development and CI that our users get when installing ESLint in a project.

The Twilio blog has a [deeper dive](https://www.twilio.com/blog/lockfiles-nodejs) to learn more.

## Releases

We have scheduled releases every two weeks on Friday or Saturday. You can follow a [release issue](https://github.com/eslint/eslint/issues?q=is%3Aopen+is%3Aissue+label%3Arelease) for updates about the scheduling of any particular release.

## Security Policy

ESLint takes security seriously. We work hard to ensure that ESLint is safe for everyone and that security issues are addressed quickly and responsibly. Read the full [security policy](https://github.com/eslint/.github/blob/master/SECURITY.md).

## Semantic Versioning Policy

ESLint follows [semantic versioning](https://semver.org). However, due to the nature of ESLint as a code quality tool, it's not always clear when a minor or major version bump occurs. To help clarify this for everyone, we've defined the following semantic versioning policy for ESLint:

- Patch release (intended to not break your lint build)
    - A bug fix in a rule that results in ESLint reporting fewer linting errors.
    - A bug fix to the CLI or core (including formatters).
    - Improvements to documentation.
    - Non-user-facing changes such as refactoring code, adding, deleting, or modifying tests, and increasing test coverage.
    - Re-releasing after a failed release (i.e., publishing a release that doesn't work for anyone).
- Minor release (might break your lint build)
    - A bug fix that results in ESLint reporting more linting errors (e.g., fixing false negatives in a core rule, or linting additional files that were previously incorrectly skipped).
    - A new rule is created.
    - A new option to an existing rule that does not result in ESLint reporting more linting errors by default.
    - A new addition to an existing rule to support a newly-added language feature (within the last 12 months) that will result in ESLint reporting more linting errors by default.
    - An existing rule is deprecated.
    - A new CLI capability is created.
    - New capabilities to the public API are added (new classes, new methods, new arguments to existing methods, etc.).
    - A new formatter is created.
    - `eslint:recommended` is updated and will result in strictly fewer linting errors (e.g., rule removals).
- Major release (likely to break your lint build)
    - `eslint:recommended` is updated and may result in new linting errors (e.g., rule additions, most rule option updates).
    - A new option to an existing rule that results in ESLint reporting more linting errors by default.
    - An existing formatter is removed.
    - Part of the public API is removed or changed in an incompatible way. The public API includes:
        - Rule schemas
        - Configuration schema
        - Command-line options
        - Node.js API
        - Rule, formatter, parser, plugin APIs

According to our policy, any minor update may report more linting errors than the previous release (ex: from a bug fix). As such, we recommend using the tilde (`~`) in `package.json` e.g. `"eslint": "~3.1.0"` to guarantee the results of your builds.

## ESM Dependencies

Since ESLint is a CommonJS package, there are restrictions on which ESM-only packages can be used as dependencies.

Packages that are controlled by the ESLint team and have no external dependencies can be safely loaded synchronously using [`require(esm)`](https://nodejs.org/api/modules.html#loading-ecmascript-modules-using-require) and therefore used in any contexts.

For external packages, we don't use `require(esm)` because a package could add a top-level `await` and thus break ESLint. We can use an external ESM-only package only in case it is needed only in asynchronous code, in which case it can be loaded using dynamic `import()`.

These policies don't apply to packages intended for our own usage only, such as `eslint-config-eslint`.

## License

MIT License

Copyright OpenJS Foundation and other contributors, <www.openjsf.org>

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

## Team

These folks keep the project moving and are resources for help.

<!-- NOTE: This section is autogenerated. Do not manually edit.-->

<!--teamstart-->

### Technical Steering Committee (TSC)

The people who manage releases, review feature requests, and meet regularly to ensure ESLint is properly maintained.

<table><tbody><tr><td align="center" valign="top" width="11%">
<a href="https://github.com/nzakas">
<img src="https://github.com/nzakas.png?s=75" width="75" height="75" alt="Nicholas C. Zakas's Avatar"><br />
Nicholas C. Zakas
</a>
</td><td align="center" valign="top" width="11%">
<a href="https://github.com/fasttime">
<img src="https://github.com/fasttime.png?s=75" width="75" height="75" alt="Francesco Trotta's Avatar"><br />
Francesco Trotta
</a>
</td><td align="center" valign="top" width="11%">
<a href="https://github.com/mdjermanovic">
<img src="https://github.com/mdjermanovic.png?s=75" width="75" height="75" alt="Milos Djermanovic's Avatar"><br />
Milos Djermanovic
</a>
</td></tr></tbody></table>

### Reviewers

The people who review and implement new features.

<table><tbody><tr><td align="center" valign="top" width="11%">
<a href="https://github.com/aladdin-add">
<img src="https://github.com/aladdin-add.png?s=75" width="75" height="75" alt="唯然's Avatar"><br />
唯然
</a>
</td><td align="center" valign="top" width="11%">
<a href="https://github.com/snitin315">
<img src="https://github.com/snitin315.png?s=75" width="75" height="75" alt="Nitin Kumar's Avatar"><br />
Nitin Kumar
</a>
</td></tr></tbody></table>

### Committers

The people who review and fix bugs and help triage issues.

<table><tbody><tr><td align="center" valign="top" width="11%">
<a href="https://github.com/DMartens">
<img src="https://github.com/DMartens.png?s=75" width="75" height="75" alt="fnx's Avatar"><br />
fnx
</a>
</td><td align="center" valign="top" width="11%">
<a href="https://github.com/JoshuaKGoldberg">
<img src="https://github.com/JoshuaKGoldberg.png?s=75" width="75" height="75" alt="Josh Goldberg ✨'s Avatar"><br />
Josh Goldberg ✨
</a>
</td><td align="center" valign="top" width="11%">
<a href="https://github.com/SwetaTanwar">
<img src="https://github.com/SwetaTanwar.png?s=75" width="75" height="75" alt="Sweta Tanwar's Avatar"><br />
Sweta Tanwar
</a>
</td><td align="center" valign="top" width="11%">
<a href="https://github.com/Tanujkanti4441">
<img src="https://github.com/Tanujkanti4441.png?s=75" width="75" height="75" alt="Tanuj Kanti's Avatar"><br />
Tanuj Kanti
</a>
</td><td align="center" valign="top" width="11%">
<a href="https://github.com/lumirlumir">
<img src="https://github.com/lumirlumir.png?s=75" width="75" height="75" alt="lumir's Avatar"><br />
lumir
</a>
</td><td align="center" valign="top" width="11%">
<a href="https://github.com/Pixel998">
<img src="https://github.com/Pixel998.png?s=75" width="75" height="75" alt="Pixel's Avatar"><br />
Pixel
</a>
</td></tr></tbody></table>

### Website Team

Team members who focus specifically on eslint.org

<table><tbody><tr><td align="center" valign="top" width="11%">
<a href="https://github.com/amareshsm">
<img src="https://github.com/amareshsm.png?s=75" width="75" height="75" alt="Amaresh  S M's Avatar"><br />
Amaresh  S M
</a>
</td><td align="center" valign="top" width="11%">
<a href="https://github.com/harish-sethuraman">
<img src="https://github.com/harish-sethuraman.png?s=75" width="75" height="75" alt="Harish's Avatar"><br />
Harish
</a>
</td><td align="center" valign="top" width="11%">
<a href="https://github.com/kecrily">
<img src="https://github.com/kecrily.png?s=75" width="75" height="75" alt="Percy Ma's Avatar"><br />
Percy Ma
</a>
</td></tr></tbody></table>

<!--teamend-->

<!-- NOTE: This section is autogenerated. Do not manually edit.-->
<!--sponsorsstart-->

## Sponsors

The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
to get your logo on our READMEs and [website](https://eslint.org/sponsors).

<h3>Platinum Sponsors</h3>
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a></p><h3>Gold Sponsors</h3>
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a> <a href="https://shopify.engineering/"><img src="https://avatars.githubusercontent.com/u/8085" alt="Shopify" height="96"></a> <a href="https://www.coderabbit.ai/?utm_source=cr_org&utm_medium=github"><img src="https://avatars.githubusercontent.com/u/132028505" alt="CodeRabbit" height="96"></a></p><h3>Silver Sponsors</h3>
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/d472863/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/2d6c3b6/logo.png" alt="Liftoff" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" height="32"></a> <a href="https://syntax.fm"><img src="https://github.com/syntaxfm.png" alt="Syntax" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://citadel-ai.com"><img src="https://avatars.githubusercontent.com/u/75781367" alt="Citadel AI" height="32"></a></p>
<h3>Technology Sponsors</h3>
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>

<!--sponsorsend-->

[tidelift]: https://tidelift.com/funding/github/npm/eslint
[herodevs]: https://www.herodevs.com/support/eslint-nes?utm_source=ESLintWebsite&utm_medium=ESLintWebsite&utm_campaign=ESLintNES&utm_id=ESLintNES
ax% 100644 eslint.js nHXn?CHr;PSDxs#!/usr/bin/env node

/**
 * @fileoverview Main CLI that is run via the eslint command.
 * @author Nicholas C. Zakas
 */

/* eslint no-console:off -- CLI */

"use strict";

const mod = require("node:module");

// to use V8's code cache to speed up instantiation time
mod.enableCompileCache?.();

// must do this initialization *before* other requires in order to work
if (process.argv.includes("--debug")) {
	require("debug").enable("eslint:*,-eslint:code-path,eslintrc:*");
}

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Read data from stdin til the end.
 *
 * Note: See
 * - https://github.com/nodejs/node/blob/master/doc/api/process.md#processstdin
 * - https://github.com/nodejs/node/blob/master/doc/api/process.md#a-note-on-process-io
 * - https://lists.gnu.org/archive/html/bug-gnu-emacs/2016-01/msg00419.html
 * - https://github.com/nodejs/node/issues/7439 (historical)
 *
 * On Windows using `fs.readFileSync(STDIN_FILE_DESCRIPTOR, "utf8")` seems
 * to read 4096 bytes before blocking and never drains to read further data.
 *
 * The investigation on the Emacs thread indicates:
 *
 * > Emacs on MS-Windows uses pipes to communicate with subprocesses; a
 * > pipe on Windows has a 4K buffer. So as soon as Emacs writes more than
 * > 4096 bytes to the pipe, the pipe becomes full, and Emacs then waits for
 * > the subprocess to read its end of the pipe, at which time Emacs will
 * > write the rest of the stuff.
 * @returns {Promise<string>} The read text.
 */
function readStdin() {
	return new Promise((resolve, reject) => {
		let content = "";
		let chunk = "";

		process.stdin
			.setEncoding("utf8")
			.on("readable", () => {
				while ((chunk = process.stdin.read()) !== null) {
					content += chunk;
				}
			})
			.on("end", () => resolve(content))
			.on("error", reject);
	});
}

/**
 * Spawns an external command and propagates its exit status.
 * @param {string} command The command to run.
 * @param {string[]} args The command arguments.
 * @throws {Error} If the command cannot be spawned.
 * @returns {void}
 */
function spawnExternalCommand(command, args) {
	const spawn = require("cross-spawn");
	const result = spawn.sync(command, args, {
		encoding: "utf8",
		stdio: "inherit",
	});

	if (result.error) {
		throw result.error;
	}

	if (result.signal) {
		process.kill(process.pid, result.signal);
		return;
	}

	process.exitCode = result.status ?? 0;
}

/**
 * Get the error message of a given value.
 * @param {any} error The value to get.
 * @returns {string} The error message.
 */
function getErrorMessage(error) {
	// Lazy loading because this is used only if an error happened.
	const util = require("node:util");

	// Foolproof -- third-party module might throw non-object.
	if (typeof error !== "object" || error === null) {
		return String(error);
	}

	// Use templates if `error.messageTemplate` is present.
	if (typeof error.messageTemplate === "string") {
		try {
			const template = require(`../messages/${error.messageTemplate}.js`);

			return template(error.messageData || {});
		} catch {
			// Ignore template error then fallback to use `error.stack`.
		}
	}

	// Use the stacktrace if it's an error object.
	if (typeof error.stack === "string") {
		return error.stack;
	}

	// Otherwise, dump the object.
	return util.format("%o", error);
}

/**
 * Tracks error messages that are shown to the user so we only ever show the
 * same message once.
 * @type {Set<string>}
 */
const displayedErrors = new Set();

/**
 * Tracks whether an unexpected error was caught
 * @type {boolean}
 */
let hadFatalError = false;

/**
 * Catch and report unexpected error.
 * @param {any} error The thrown error object.
 * @returns {void}
 */
function onFatalError(error) {
	process.exitCode = 2;
	hadFatalError = true;

	const { version } = require("../package.json");
	const message = `
Oops! Something went wrong! :(

ESLint: ${version}

${getErrorMessage(error)}`;

	if (!displayedErrors.has(message)) {
		console.error(message);
		displayedErrors.add(message);
	}
}

//------------------------------------------------------------------------------
// Execution
//------------------------------------------------------------------------------

(async function main() {
	process.on("uncaughtException", onFatalError);
	process.on("unhandledRejection", onFatalError);

	// Call the config initializer if `--init` is present.
	if (process.argv.includes("--init")) {
		// `eslint --init` has been moved to `@eslint/create-config`
		console.warn(
			"You can also run this command directly using 'npm init @eslint/config@latest'.",
		);

		spawnExternalCommand("npm", ["init", "@eslint/config@latest"]);
		return;
	}

	// start the MCP server if `--mcp` is present
	if (process.argv.includes("--mcp")) {
		console.warn(
			"You can also run this command directly using 'npx @eslint/mcp@latest'.",
		);

		spawnExternalCommand("npx", ["@eslint/mcp@latest"]);
		return;
	}

	// Otherwise, call the CLI.
	const cli = require("../lib/cli");
	const exitCode = await cli.execute(
		process.argv,
		process.argv.includes("--stdin") ? await readStdin() : void 0,
	);

	/*
	 * If an uncaught exception or unhandled rejection was detected in the meantime,
	 * keep the fatal exit code 2 that is already assigned to `process.exitCode`.
	 * Without this condition, exit code 2 (unsuccessful execution) could be overwritten with
	 * 1 (successful execution, lint problems found) or even 0 (successful execution, no lint problems found).
	 * This ensures that unexpected errors that seemingly don't affect the success
	 * of the execution will still cause a non-zero exit code, as it's a common
	 * practice and the default behavior of Node.js to exit with non-zero
	 * in case of an uncaught exception or unhandled rejection.
	 *
	 * Otherwise, assign the exit code returned from CLI.
	 */
	if (!hadFatalError) {
		process.exitCode = exitCode;
	}
})().catch(onFatalError);
qH
x R100644 ecma-version.js 0 bqw Dȯn100644 globals.js #R^QЗ;~eb100644 replacements.json '2Lb8ovВԱ6100644 rule-type-list.json l1FvJ:Dx0/**
 * @fileoverview Configuration related to ECMAScript versions
 * @author Milos Djermanovic
 */

"use strict";

/**
 * The latest ECMAScript version supported by ESLint.
 * @type {number} year-based ECMAScript version
 */
const LATEST_ECMA_VERSION = 2026;

module.exports = {
	LATEST_ECMA_VERSION,
};
axF
/**
 * @fileoverview Globals for ecmaVersion/sourceType
 * @author Nicholas C. Zakas
 */

"use strict";

//-----------------------------------------------------------------------------
// Globals
//-----------------------------------------------------------------------------

const commonjs = {
	exports: true,
	global: false,
	module: false,
	require: false,
};

const es3 = {
	Array: false,
	Boolean: false,
	constructor: false,
	Date: false,
	decodeURI: false,
	decodeURIComponent: false,
	encodeURI: false,
	encodeURIComponent: false,
	Error: false,
	escape: false,
	eval: false,
	EvalError: false,
	Function: false,
	hasOwnProperty: false,
	Infinity: false,
	isFinite: false,
	isNaN: false,
	isPrototypeOf: false,
	Math: false,
	NaN: false,
	Number: false,
	Object: false,
	parseFloat: false,
	parseInt: false,
	propertyIsEnumerable: false,
	RangeError: false,
	ReferenceError: false,
	RegExp: false,
	String: false,
	SyntaxError: false,
	toLocaleString: false,
	toString: false,
	TypeError: false,
	undefined: false,
	unescape: false,
	URIError: false,
	valueOf: false,
};

const es5 = {
	...es3,
	JSON: false,
};

const es2015 = {
	...es5,
	ArrayBuffer: false,
	DataView: false,
	Float32Array: false,
	Float64Array: false,
	Int16Array: false,
	Int32Array: false,
	Int8Array: false,
	Intl: false,
	Map: false,
	Promise: false,
	Proxy: false,
	Reflect: false,
	Set: false,
	Symbol: false,
	Uint16Array: false,
	Uint32Array: false,
	Uint8Array: false,
	Uint8ClampedArray: false,
	WeakMap: false,
	WeakSet: false,
};

// no new globals in ES2016
const es2016 = {
	...es2015,
};

const es2017 = {
	...es2016,
	Atomics: false,
	SharedArrayBuffer: false,
};

// no new globals in ES2018
const es2018 = {
	...es2017,
};

// no new globals in ES2019
const es2019 = {
	...es2018,
};

const es2020 = {
	...es2019,
	BigInt: false,
	BigInt64Array: false,
	BigUint64Array: false,
	globalThis: false,
};

const es2021 = {
	...es2020,
	AggregateError: false,
	FinalizationRegistry: false,
	WeakRef: false,
};

const es2022 = {
	...es2021,
};

const es2023 = {
	...es2022,
};

const es2024 = {
	...es2023,
};

const es2025 = {
	...es2024,
	Float16Array: false,
	Iterator: false,
};

const es2026 = {
	...es2025,
	AsyncDisposableStack: false,
	DisposableStack: false,
	SuppressedError: false,
	Temporal: false,
};

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

module.exports = {
	commonjs,
	es3,
	es5,
	es2015,
	es2016,
	es2017,
	es2018,
	es2019,
	es2020,
	es2021,
	es2022,
	es2023,
	es2024,
	es2025,
	es2026,
};
=x${
  "rules": {
    "generator-star": ["generator-star-spacing"],
    "global-strict": ["strict"],
    "no-arrow-condition": ["no-confusing-arrow", "no-constant-condition"],
    "no-comma-dangle": ["comma-dangle"],
    "no-empty-class": ["no-empty-character-class"],
    "no-empty-label": ["no-labels"],
    "no-extra-strict": ["strict"],
    "no-reserved-keys": ["quote-props"],
    "no-space-before-semi": ["semi-spacing"],
    "no-wrap-func": ["no-extra-parens"],
    "space-after-function-name": ["space-before-function-paren"],
    "space-after-keywords": ["keyword-spacing"],
    "space-before-function-parentheses": ["space-before-function-paren"],
    "space-before-keywords": ["keyword-spacing"],
    "space-in-brackets": [
      "object-curly-spacing",
      "array-bracket-spacing",
      "computed-property-spacing"
    ],
    "space-return-throw-case": ["keyword-spacing"],
    "space-unary-word-ops": ["space-unary-ops"],
    "spaced-line-comment": ["spaced-comment"]
  }
}
?Gx	{
  "types": {
    "problem": [],
    "suggestion": [],
    "layout": []
  },
  "deprecated": [],
  "removed": [
    {
      "removed": "generator-star",
      "replacedBy": [{ "rule": { "name": "generator-star-spacing" } }]
    },
    {
      "removed": "global-strict",
      "replacedBy": [{ "rule": { "name": "strict" } }]
    },
    {
      "removed": "no-arrow-condition",
      "replacedBy": [
        { "rule": { "name": "no-confusing-arrow" } },
        { "rule": { "name": "no-constant-condition" } }
      ]
    },
    {
      "removed": "no-comma-dangle",
      "replacedBy": [{ "rule": { "name": "comma-dangle" } }]
    },
    {
      "removed": "no-empty-class",
      "replacedBy": [{ "rule": { "name": "no-empty-character-class" } }]
    },
    {
      "removed": "no-empty-label",
      "replacedBy": [{ "rule": { "name": "no-labels" } }]
    },
    {
      "removed": "no-extra-strict",
      "replacedBy": [{ "rule": { "name": "strict" } }]
    },
    {
      "removed": "no-reserved-keys",
      "replacedBy": [{ "rule": { "name": "quote-props" } }]
    },
    {
      "removed": "no-space-before-semi",
      "replacedBy": [{ "rule": { "name": "semi-spacing" } }]
    },
    {
      "removed": "no-wrap-func",
      "replacedBy": [{ "rule": { "name": "no-extra-parens" } }]
    },
    {
      "removed": "space-after-function-name",
      "replacedBy": [{ "rule": { "name": "space-before-function-paren" } }]
    },
    {
      "removed": "space-after-keywords",
      "replacedBy": [{ "rule": { "name": "keyword-spacing" } }]
    },
    {
      "removed": "space-before-function-parentheses",
      "replacedBy": [{ "rule": { "name": "space-before-function-paren" } }]
    },
    {
      "removed": "space-before-keywords",
      "replacedBy": [{ "rule": { "name": "keyword-spacing" } }]
    },
    {
      "removed": "space-in-brackets",
      "replacedBy": [
        { "rule": { "name": "object-curly-spacing" } },
        { "rule": { "name": "array-bracket-spacing" } },
        { "rule": { "name": "computed-property-spacing" } }
      ]
    },
    {
      "removed": "space-return-throw-case",
      "replacedBy": [{ "rule": { "name": "keyword-spacing" } }]
    },
    {
      "removed": "space-unary-word-ops",
      "replacedBy": [{ "rule": { "name": "space-unary-ops" } }]
    },
    {
      "removed": "spaced-line-comment",
      "replacedBy": [{ "rule": { "name": "spaced-comment" } }]
    },
    { "removed": "valid-jsdoc", "replacedBy": [] },
    { "removed": "require-jsdoc", "replacedBy": [] }
  ]
}

ظ#x?100644 api.js ]_}wQta;40000 cli-engine FmL,=P33`100644 cli.js 61xsR"5e/	100644 config-api.js v%B5]K-im40000 config kC]'`SL40000 eslint k'*Jgw=M?40000 languages g[`0x40000 linter mk13]H>100644 options.js -xP>(}'^40000 rule-tester WߊFk[[ļ640000 rules <	|*׷N[40000 services +O>n3DY}=240000 shared n2|jauӆ40000 types .y­cr͂GƷ(\100644 universal.js QńSɋ;e?IG100644 unsupported-api.js k@(;i)PcٰB(@@Bx)/**
 * @fileoverview Expose out ESLint and CLI to require.
 * @author Ian Christian Myers
 */

"use strict";

//-----------------------------------------------------------------------------
// Requirements
//-----------------------------------------------------------------------------

const { ESLint } = require("./eslint/eslint");
const { Linter } = require("./linter");
const { RuleTester } = require("./rule-tester");
const { SourceCode } = require("./languages/js/source-code");

//-----------------------------------------------------------------------------
// Functions
//-----------------------------------------------------------------------------

/**
 * Loads the correct `ESLint` constructor.
 * @returns {Promise<ESLint>} The ESLint constructor.
 */
async function loadESLint() {
	return ESLint;
}

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

module.exports = {
	Linter,
	loadESLint,
	ESLint,
	RuleTester,
	SourceCode,
};
)xx 40000 formatters Xl؃/Fx >FYT100644 hash.js L0kMk5nm?CCG 100644 lint-result-cache.js H.ѕUOVoN0)x 2100644 formatters-meta.json 2)IJBQ[l W^}100644 html.js ,$]1n`#100644 json-with-metadata.js DǅAu3cb"h100644 json.js #\XvPJ߉W!>100644 stylish.js r-3j[UXUaךͩMZ@x[
  {
    "name": "html",
    "description": "Outputs results to HTML. The `html` formatter is useful for visual presentation in the browser."
  },
  {
    "name": "json-with-metadata",
    "description": "Outputs JSON-serialized results. The `json-with-metadata` provides the same linting results as the [`json`](#json) formatter with additional metadata about the rules applied. The linting results are included in the `results` property and the rules metadata is included in the `metadata` property.\n\nAlternatively, you can use the [ESLint Node.js API](../../integrate/nodejs-api) to programmatically use ESLint."
  },
  {
    "name": "json",
    "description": "Outputs JSON-serialized results. The `json` formatter is useful when you want to programmatically work with the CLI's linting results.\n\nAlternatively, you can use the [ESLint Node.js API](../../integrate/nodejs-api) to programmatically use ESLint."
  },
  {
    "name": "stylish",
    "description": "Human-readable output format. This is the default formatter."
  }
]
dIx0/**
 * @fileoverview HTML reporter
 * @author Julian Laval
 */
"use strict";

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const encodeHTML = (function () {
	const encodeHTMLRules = {
		"&": "&#38;",
		"<": "&#60;",
		">": "&#62;",
		'"': "&#34;",
		"'": "&#39;",
	};
	const matchHTML = /[&<>"']/gu;

	return function (code) {
		return code
			? code.toString().replace(matchHTML, m => encodeHTMLRules[m] || m)
			: "";
	};
})();

/**
 * Get the final HTML document.
 * @param {Object} it data for the document.
 * @returns {string} HTML document.
 */
function pageTemplate(it) {
	const { reportColor, reportSummary, date, results } = it;

	return `
<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title>ESLint Report</title>
        <link rel="icon" type="image/png" sizes="any" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAACXBIWXMAAAHaAAAB2gGFomX7AAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jnm+48GgAABD1JREFUWMPFl11sk2UUx3/nbYtjxS1MF7MLMTECMgSTtSSyrQkLhAj7UBPnDSEGoxegGzMwojhXVpmTAA5iYpSoMQa8GBhFOrMFk03buei6yRAlcmOM0SEmU9d90b19jxcM1o5+sGnsc/e+z/l6ztf/HFFVMnns6QieeOCHBePGsHM+wrOtvLG2C4WRVDSSygNV7sCjlspxwDnPB44aols/DXk+mbMBmx/6OseITF1CuOtfevkPh2Uu+/jbdX8lujSScRlT5r7/QDlAfsRmfzmpnkQ/H3H13gf6bBrBn1uqK8WylgEnU8eZmk1repbfchJG1TyKyIKEwuBHFd3lD3naY3O1siiwXsVoBV2VgM1ht/QQUJk2ByqKghsQziYQ8ifKgexIXmuyzC4r67Y7R+xPAfuB/Nn3Cpva+0s7khpQVtZtd4bt51BWxtBYAiciprG7c7D4SixzU9PYalDL6110Ifb/w8W9eY7J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LTEuMjgyLTAuNzQxLTIuMTc5LTIuMTA5LTIuMTc5LTMuNTlWODcuODQzYzAtMS40ODEsMC44ODQtMi44NDksMi4xNjctMy41OSBsNzMuNzA3LTQyLjUyN2MxLjI4Mi0wLjc0MSwyLjg4Ni0wLjc0MSw0LjE2OCwwbDczLjc3Miw0Mi41MjdjMS4yODMsMC43NDEsMi4xODYsMi4xMDksMi4xODYsMy41OVYxNzIuODk4eicvPg0KPC9zdmc+">
        <style>
            body {
                font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
                font-size: 16px;
                font-weight: normal;
                margin: 0;
                padding: 0;
                color: #333;
            }

            #overview {
                padding: 20px 30px;
            }

            td,
            th {
                padding: 5px 10px;
            }

            h1 {
                margin: 0;
            }

            table {
                margin: 30px;
                width: calc(100% - 60px);
                max-width: 1000px;
                border-radius: 5px;
                border: 1px solid #ddd;
                border-spacing: 0;
            }

            th {
                font-weight: 400;
                font-size: medium;
                text-align: left;
                cursor: pointer;
            }

            td.clr-1,
            td.clr-2,
            th span {
                font-weight: 700;
            }

            th span {
                float: right;
                margin-left: 20px;
            }

            th span::after {
                content: "";
                clear: both;
                display: block;
            }

            tr:last-child td {
                border-bottom: none;
            }

            tr td:first-child,
            tr td:last-child {
                color: #9da0a4;
            }

            #overview.bg-0,
            tr.bg-0 th {
                color: #468847;
                background: #dff0d8;
                border-bottom: 1px solid #d6e9c6;
            }

            #overview.bg-1,
            tr.bg-1 th {
                color: #f0ad4e;
                background: #fcf8e3;
                border-bottom: 1px solid #fbeed5;
            }

            #overview.bg-2,
            tr.bg-2 th {
                color: #b94a48;
                background: #f2dede;
                border-bottom: 1px solid #eed3d7;
            }

            td {
                border-bottom: 1px solid #ddd;
            }

            td.clr-1 {
                color: #f0ad4e;
            }

            td.clr-2 {
                color: #b94a48;
            }

            td a {
                color: #3a33d1;
                text-decoration: none;
            }

            td a:hover {
                color: #272296;
                text-decoration: underline;
            }
        </style>
    </head>
    <body>
        <div id="overview" class="bg-${reportColor}">
            <h1>ESLint Report</h1>
            <div>
                <span>${reportSummary}</span> - Generated on ${date}
            </div>
        </div>
        <table>
            <tbody>
                ${results}
            </tbody>
        </table>
        <script type="text/javascript">
            var groups = document.querySelectorAll("tr[data-group]");
            for (i = 0; i < groups.length; i++) {
                groups[i].addEventListener("click", function() {
                    var inGroup = document.getElementsByClassName(this.getAttribute("data-group"));
                    this.innerHTML = (this.innerHTML.indexOf("+") > -1) ? this.innerHTML.replace("+", "-") : this.innerHTML.replace("-", "+");
                    for (var j = 0; j < inGroup.length; j++) {
                        inGroup[j].style.display = (inGroup[j].style.display !== "none") ? "none" : "table-row";
                    }
                });
            }
        </script>
    </body>
</html>
`.trimStart();
}

/**
 * Given a word and a count, append an s if count is not one.
 * @param {string} word A word in its singular form.
 * @param {number} count A number controlling whether word should be pluralized.
 * @returns {string} The original word with an s on the end if count is not one.
 */
function pluralize(word, count) {
	return count === 1 ? word : `${word}s`;
}

/**
 * Renders text along the template of x problems (x errors, x warnings)
 * @param {number} totalErrors Total errors
 * @param {number} totalWarnings Total warnings
 * @returns {string} The formatted string, pluralized where necessary
 */
function renderSummary(totalErrors, totalWarnings) {
	const totalProblems = totalErrors + totalWarnings;
	let renderedText = `${totalProblems} ${pluralize("problem", totalProblems)}`;

	if (totalProblems !== 0) {
		renderedText += ` (${totalErrors} ${pluralize("error", totalErrors)}, ${totalWarnings} ${pluralize("warning", totalWarnings)})`;
	}
	return renderedText;
}

/**
 * Get the color based on whether there are errors/warnings...
 * @param {number} totalErrors Total errors
 * @param {number} totalWarnings Total warnings
 * @returns {number} The color code (0 = green, 1 = yellow, 2 = red)
 */
function renderColor(totalErrors, totalWarnings) {
	if (totalErrors !== 0) {
		return 2;
	}
	if (totalWarnings !== 0) {
		return 1;
	}
	return 0;
}

/**
 * Get HTML (table row) describing a single message.
 * @param {Object} it data for the message.
 * @returns {string} HTML (table row) describing the message.
 */
function messageTemplate(it) {
	const {
		parentIndex,
		lineNumber,
		columnNumber,
		severityNumber,
		severityName,
		message,
		ruleUrl,
		ruleId,
	} = it;

	return `
<tr style="display: none;" class="f-${parentIndex}">
    <td>${lineNumber}:${columnNumber}</td>
    <td class="clr-${severityNumber}">${severityName}</td>
    <td>${encodeHTML(message)}</td>
    <td>
        <a href="${ruleUrl ? ruleUrl : ""}" target="_blank" rel="noopener noreferrer">${encodeHTML(ruleId)}</a>
    </td>
</tr>
`.trimStart();
}

/**
 * Get HTML (table rows) describing the messages.
 * @param {Array} messages Messages.
 * @param {number} parentIndex Index of the parent HTML row.
 * @param {Object} rulesMeta Dictionary containing metadata for each rule executed by the analysis.
 * @returns {string} HTML (table rows) describing the messages.
 */
function renderMessages(messages, parentIndex, rulesMeta) {
	/**
	 * Get HTML (table row) describing a message.
	 * @param {Object} message Message.
	 * @returns {string} HTML (table row) describing a message.
	 */
	return messages
		.map(message => {
			const lineNumber = message.line || 0;
			const columnNumber = message.column || 0;
			let ruleUrl;

			if (rulesMeta) {
				const meta = rulesMeta[message.ruleId];

				if (meta && meta.docs && meta.docs.url) {
					ruleUrl = meta.docs.url;
				}
			}

			return messageTemplate({
				parentIndex,
				lineNumber,
				columnNumber,
				severityNumber: message.severity,
				severityName: message.severity === 1 ? "Warning" : "Error",
				message: message.message,
				ruleId: message.ruleId,
				ruleUrl,
			});
		})
		.join("\n");
}

/**
 * Get HTML (table row) describing the result for a single file.
 * @param {Object} it data for the file.
 * @returns {string} HTML (table row) describing the result for the file.
 */
function resultTemplate(it) {
	const { color, index, filePath, summary } = it;

	return `
<tr class="bg-${color}" data-group="f-${index}">
    <th colspan="4">
        [+] ${encodeHTML(filePath)}
        <span>${encodeHTML(summary)}</span>
    </th>
</tr>
`.trimStart();
}

/**
 * Render the results.
 * @param {Array} results Test results.
 * @param {Object} rulesMeta Dictionary containing metadata for each rule executed by the analysis.
 * @returns {string} HTML string describing the results.
 */
function renderResults(results, rulesMeta) {
	return results
		.map(
			(result, index) =>
				resultTemplate({
					index,
					color: renderColor(result.errorCount, result.warningCount),
					filePath: result.filePath,
					summary: renderSummary(
						result.errorCount,
						result.warningCount,
					),
				}) + renderMessages(result.messages, index, rulesMeta),
		)
		.join("\n");
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

module.exports = function (results, data) {
	let totalErrors, totalWarnings;

	const metaData = data ? data.rulesMeta : {};

	totalErrors = 0;
	totalWarnings = 0;

	// Iterate over results to get totals
	results.forEach(result => {
		totalErrors += result.errorCount;
		totalWarnings += result.warningCount;
	});

	return pageTemplate({
		date: new Date(),
		reportColor: renderColor(totalErrors, totalWarnings),
		reportSummary: renderSummary(totalErrors, totalWarnings),
		results: renderResults(results, metaData),
	});
};
;Ґøxw/**
 * @fileoverview JSON reporter, including rules metadata
 * @author Chris Meyer
 */
"use strict";

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

module.exports = function (results, data) {
	return JSON.stringify({
		results,
		metadata: data,
	});
};
0g{x[/**
 * @fileoverview JSON reporter
 * @author Burak Yigit Kaya aka BYK
 */
"use strict";

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

module.exports = function (results) {
	return JSON.stringify(results);
};
KY	xG/**
 * @fileoverview Stylish reporter
 * @author Sindre Sorhus
 */
"use strict";

const util = require("node:util"),
	table = require("../../shared/text-table");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Returns a styling function based on the color option.
 * @param {boolean|undefined} color Indicates whether to use colors.
 * @returns {Function} A function that styles text.
 */
function getStyleText(color) {
	if (typeof color === "undefined") {
		return (format, text) =>
			util.styleText(format, text, { validateStream: true });
	}
	if (color) {
		return (format, text) =>
			util.styleText(format, text, { validateStream: false });
	}
	return (_, text) => text;
}

/**
 * Given a word and a count, append an s if count is not one.
 * @param {string} word A word in its singular form.
 * @param {number} count A number controlling whether word should be pluralized.
 * @returns {string} The original word with an s on the end if count is not one.
 */
function pluralize(word, count) {
	return count === 1 ? word : `${word}s`;
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

module.exports = function (results, data) {
	const styleText = getStyleText(data?.color);

	let output = "\n",
		errorCount = 0,
		warningCount = 0,
		fixableErrorCount = 0,
		fixableWarningCount = 0,
		summaryColor = "yellow";

	results.forEach(result => {
		const messages = result.messages;

		if (messages.length === 0) {
			return;
		}

		errorCount += result.errorCount;
		warningCount += result.warningCount;
		fixableErrorCount += result.fixableErrorCount;
		fixableWarningCount += result.fixableWarningCount;

		output += `${styleText("underline", result.filePath)}\n`;

		output += `${table(
			messages.map(message => {
				let messageType;

				if (message.fatal || message.severity === 2) {
					messageType = styleText("red", "error");
					summaryColor = "red";
				} else {
					messageType = styleText("yellow", "warning");
				}

				return [
					"",
					String(message.line || 0),
					String(message.column || 0),
					messageType,
					message.message.replace(/([^ ])\.$/u, "$1"),
					message.ruleId ? styleText("dim", message.ruleId) : "",
				];
			}),
			{
				align: ["", "r", "l"],
				stringLength(str) {
					return util.stripVTControlCharacters(str).length;
				},
			},
		)
			.split("\n")
			.map(el =>
				el.replace(/(\d+)\s+(\d+)/u, (m, p1, p2) =>
					styleText("dim", `${p1}:${p2}`),
				),
			)
			.join("\n")}\n\n`;
	});

	const total = errorCount + warningCount;

	/*
	 * We can't use a single `styleText` call like `styleText([summaryColor, "bold"], text)` here.
	 * This is a bug in `util.styleText` in Node.js versions earlier than v22.15.0 (https://github.com/nodejs/node/issues/56717).
	 * As a workaround, we use nested `styleText` calls.
	 */
	if (total > 0) {
		output += `${styleText(
			summaryColor,
			styleText(
				"bold",
				[
					"\u2716 ",
					total,
					pluralize(" problem", total),
					" (",
					errorCount,
					pluralize(" error", errorCount),
					", ",
					warningCount,
					pluralize(" warning", warningCount),
					")",
				].join(""),
			),
		)}\n`;

		if (fixableErrorCount > 0 || fixableWarningCount > 0) {
			output += `${styleText(
				summaryColor,
				styleText(
					"bold",
					[
						"  ",
						fixableErrorCount,
						pluralize(" error", fixableErrorCount),
						" and ",
						fixableWarningCount,
						pluralize(" warning", fixableWarningCount),
						" potentially fixable with the `--fix` option.",
					].join(""),
				),
			)}\n`;
		}
	}

	// Resets output color, for prevent change on top level
	return total > 0 ? styleText("reset", output) : "";
};
4Bx!/**
 * @fileoverview Defining the hashing function in one place.
 * @author Michael Ficarra
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const murmur = require("imurmurhash");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
// Private
//------------------------------------------------------------------------------

/**
 * hash the given string
 * @param {string} str the string to hash
 * @returns {string} the hash
 */
function hash(str) {
	return murmur(str).result().toString(36);
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

module.exports = hash;
0xA/**
 * @fileoverview Utility for caching lint results.
 * @author Kevin Partington
 */
"use strict";

//-----------------------------------------------------------------------------
// Requirements
//-----------------------------------------------------------------------------

const fs = require("node:fs");
const fileEntryCache = require("file-entry-cache");
const stringify = require("json-stable-stringify-without-jsonify");
const pkg = require("../../package.json");
const assert = require("../shared/assert");
const hash = require("./hash");

const debug = require("debug")("eslint:lint-result-cache");

//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------

/** @typedef {import("../types").Linter.Config} Config */

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

const configHashCache = new WeakMap();
const nodeVersion = process && process.version;

const validCacheStrategies = ["metadata", "content"];
const invalidCacheStrategyErrorMessage = `Cache strategy must be one of: ${validCacheStrategies
	.map(strategy => `"${strategy}"`)
	.join(", ")}`;

/**
 * Tests whether a provided cacheStrategy is valid
 * @param {string} cacheStrategy The cache strategy to use
 * @returns {boolean} true if `cacheStrategy` is one of `validCacheStrategies`; false otherwise
 */
function isValidCacheStrategy(cacheStrategy) {
	return validCacheStrategies.includes(cacheStrategy);
}

/**
 * Calculates the hash of the config
 * @param {Config} config The config.
 * @returns {string} The hash of the config
 */
function hashOfConfigFor(config) {
	if (!configHashCache.has(config)) {
		configHashCache.set(
			config,
			hash(`${pkg.version}_${nodeVersion}_${stringify(config)}`),
		);
	}

	return configHashCache.get(config);
}

//-----------------------------------------------------------------------------
// Public Interface
//-----------------------------------------------------------------------------

/**
 * Lint result cache. This wraps around the file-entry-cache module,
 * transparently removing properties that are difficult or expensive to
 * serialize and adding them back in on retrieval.
 */
class LintResultCache {
	/**
	 * Creates a new LintResultCache instance.
	 * @param {string} cacheFileLocation The cache file location.
	 * @param {"metadata" | "content"} cacheStrategy The cache strategy to use.
	 */
	constructor(cacheFileLocation, cacheStrategy) {
		assert(cacheFileLocation, "Cache file location is required");
		assert(cacheStrategy, "Cache strategy is required");
		assert(
			isValidCacheStrategy(cacheStrategy),
			invalidCacheStrategyErrorMessage,
		);

		debug(`Caching results to ${cacheFileLocation}`);

		const useChecksum = cacheStrategy === "content";

		debug(`Using "${cacheStrategy}" strategy to detect changes`);

		this.fileEntryCache = fileEntryCache.create(
			cacheFileLocation,
			void 0,
			useChecksum,
		);
		this.cacheFileLocation = cacheFileLocation;
	}

	/**
	 * Retrieve cached lint results for a given file path, if present in the
	 * cache. If the file is present and has not been changed, rebuild any
	 * missing result information.
	 * @param {string} filePath The file for which to retrieve lint results.
	 * @param {Config} config The config of the file.
	 * @returns {Object|null} The rebuilt lint results, or null if the file is
	 *   changed or not in the filesystem.
	 */
	getCachedLintResults(filePath, config) {
		const cachedResults = this.getValidCachedLintResults(filePath, config);

		if (!cachedResults) {
			return cachedResults;
		}

		/*
		 * Shallow clone the object to ensure that any properties added or modified afterwards
		 * will not be accidentally stored in the cache file when `reconcile()` is called.
		 * https://github.com/eslint/eslint/issues/13507
		 * All intentional changes to the cache file must be done through `setCachedLintResults()`.
		 */
		const results = { ...cachedResults };

		// If source is present but null, need to reread the file from the filesystem.
		if (results.source === null) {
			debug(
				`Rereading cached result source from filesystem: ${filePath}`,
			);
			results.source = fs.readFileSync(filePath, "utf-8");
		}

		return results;
	}

	/**
	 * Retrieve cached lint results for a given file path, if present in the
	 * cache and still valid.
	 * @param {string} filePath The file for which to retrieve lint results.
	 * @param {Config} config The config of the file.
	 * @returns {Object|null} The cached lint results if present in the cache
	 * and still valid; null otherwise.
	 */
	getValidCachedLintResults(filePath, config) {
		/*
		 * Cached lint results are valid if and only if:
		 * 1. The file is present in the filesystem
		 * 2. The file has not changed since the time it was previously linted
		 * 3. The ESLint configuration has not changed since the time the file
		 *    was previously linted
		 * If any of these are not true, we will not reuse the lint results.
		 */
		const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath);

		if (fileDescriptor.notFound) {
			debug(`File not found on the file system: ${filePath}`);
			return null;
		}

		const hashOfConfig = hashOfConfigFor(config);
		const changed =
			fileDescriptor.changed ||
			fileDescriptor.meta.hashOfConfig !== hashOfConfig;

		if (changed) {
			debug(`Cache entry not found or no longer valid: ${filePath}`);
			return null;
		}

		return fileDescriptor.meta.results;
	}

	/**
	 * Set the cached lint results for a given file path, after removing any
	 * information that will be both unnecessary and difficult to serialize.
	 * Avoids caching results with an "output" property (meaning fixes were
	 * applied), to prevent potentially incorrect results if fixes are not
	 * written to disk.
	 * @param {string} filePath The file for which to set lint results.
	 * @param {Config} config The config of the file.
	 * @param {Object} result The lint result to be set for the file.
	 * @returns {void}
	 */
	setCachedLintResults(filePath, config, result) {
		if (result && Object.hasOwn(result, "output")) {
			return;
		}

		const fileDescriptor = this.fileEntryCache.getFileDescriptor(filePath);

		if (fileDescriptor && !fileDescriptor.notFound) {
			debug(`Updating cached result: ${filePath}`);

			// Serialize the result, except that we want to remove the file source if present.
			const resultToSerialize = Object.assign({}, result);

			/*
			 * Set result.source to null.
			 * In `getCachedLintResults`, if source is explicitly null, we will
			 * read the file from the filesystem to set the value again.
			 */
			if (Object.hasOwn(resultToSerialize, "source")) {
				resultToSerialize.source = null;
			}

			fileDescriptor.meta.results = resultToSerialize;
			fileDescriptor.meta.hashOfConfig = hashOfConfigFor(config);
		}
	}

	/**
	 * Persists the in-memory cache to disk.
	 * @returns {void}
	 */
	reconcile() {
		debug(`Persisting cached results: ${this.cacheFileLocation}`);
		this.fileEntryCache.reconcile();
	}
}

module.exports = LintResultCache;
oEx7\/**
 * @fileoverview Main CLI object.
 * @author Nicholas C. Zakas
 */

"use strict";

/*
 * NOTE: The CLI object should *not* call process.exit() directly. It should only return
 * exit codes. This allows other programs to use the CLI object and still control
 * when the program exits.
 */

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const fs = require("node:fs"),
	{ mkdir, stat, writeFile } = require("node:fs/promises"),
	path = require("node:path"),
	{ pathToFileURL } = require("node:url"),
	{ ESLint, locateConfigFileToUse } = require("./eslint/eslint"),
	createCLIOptions = require("./options"),
	log = require("./shared/logging"),
	RuntimeInfo = require("./shared/runtime-info"),
	translateOptions = require("./shared/translate-cli-options");
const { getCacheFile } = require("./eslint/eslint-helpers");
const { SuppressionsService } = require("./services/suppressions-service");
const debug = require("debug")("eslint:cli");

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @typedef {import("./options").ParsedCLIOptions} ParsedCLIOptions */
/** @typedef {import("./types").ESLint.LintResult} LintResult */
/** @typedef {import("./types").ESLint.ResultsMeta} ResultsMeta */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Count error messages.
 * @param {LintResult[]} results The lint results.
 * @returns {{errorCount:number;fatalErrorCount:number,warningCount:number}} The number of error messages.
 */
function countErrors(results) {
	let errorCount = 0;
	let fatalErrorCount = 0;
	let warningCount = 0;

	for (const result of results) {
		errorCount += result.errorCount;
		fatalErrorCount += result.fatalErrorCount;
		warningCount += result.warningCount;
	}

	return { errorCount, fatalErrorCount, warningCount };
}

/**
 * Creates an options module from the provided CLI options and encodes it as a data URL.
 * @param {ParsedCLIOptions} options The CLI options.
 * @returns {URL} The URL of the options module.
 */
function createOptionsModule(options) {
	const translateOptionsFileURL = new URL(
		"./shared/translate-cli-options.js",
		pathToFileURL(__filename),
	).href;
	const optionsSrc =
		`import translateOptions from ${JSON.stringify(translateOptionsFileURL)};\n` +
		`export default await translateOptions(${JSON.stringify(options)});\n`;

	// Base64 encoding is typically shorter than URL encoding
	return new URL(
		`data:text/javascript;base64,${Buffer.from(optionsSrc).toString("base64")}`,
	);
}

/**
 * Check if a given file path is a directory or not.
 * @param {string} filePath The path to a file to check.
 * @returns {Promise<boolean>} `true` if the given path is a directory.
 */
async function isDirectory(filePath) {
	try {
		return (await stat(filePath)).isDirectory();
	} catch (error) {
		if (error.code === "ENOENT" || error.code === "ENOTDIR") {
			return false;
		}
		throw error;
	}
}

/**
 * Outputs the results of the linting.
 * @param {ESLint} engine The ESLint instance to use.
 * @param {LintResult[]} results The results to print.
 * @param {string} format The name of the formatter to use or the path to the formatter.
 * @param {string} outputFile The path for the output file.
 * @param {ResultsMeta} resultsMeta Warning count and max threshold.
 * @returns {Promise<boolean>} True if the printing succeeds, false if not.
 * @private
 */
async function printResults(engine, results, format, outputFile, resultsMeta) {
	let formatter;

	try {
		formatter = await engine.loadFormatter(format);
	} catch (e) {
		log.error(e.message);
		return false;
	}

	const output = await formatter.format(results, resultsMeta);

	if (outputFile) {
		const filePath = path.resolve(process.cwd(), outputFile);

		if (await isDirectory(filePath)) {
			log.error(
				"Cannot write to output file path, it is a directory: %s",
				outputFile,
			);
			return false;
		}

		try {
			await mkdir(path.dirname(filePath), { recursive: true });
			await writeFile(filePath, output);
		} catch (ex) {
			log.error("There was a problem writing the output file:\n%s", ex);
			return false;
		}
	} else if (output) {
		log.info(output);
	}

	return true;
}

/**
 * Validates the `--concurrency` flag value.
 * @param {string} concurrency The `--concurrency` flag value to validate.
 * @returns {void}
 * @throws {Error} If the `--concurrency` flag value is invalid.
 */
function validateConcurrency(concurrency) {
	if (
		concurrency === void 0 ||
		concurrency === "auto" ||
		concurrency === "off"
	) {
		return;
	}

	const concurrencyValue = Number(concurrency);

	if (!Number.isInteger(concurrencyValue) || concurrencyValue < 1) {
		throw new Error(
			`Option concurrency: '${concurrency}' is not a positive integer, 'auto' or 'off'.`,
		);
	}
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

/**
 * Encapsulates all CLI behavior for eslint. Makes it easier to test as well as
 * for other Node.js programs to effectively run the CLI.
 */
const cli = {
	/**
	 * Calculates the command string for the --inspect-config operation.
	 * @param {string} configFile The path to the config file to inspect.
	 * @returns {Promise<string>} The command string to execute.
	 */
	async calculateInspectConfigFlags(configFile) {
		// find the config file
		const { configFilePath, basePath } = await locateConfigFileToUse({
			cwd: process.cwd(),
			configFile,
		});

		return ["--config", configFilePath, "--basePath", basePath];
	},

	/**
	 * Executes the CLI based on an array of arguments that is passed in.
	 * @param {string|Array|Object} args The arguments to process.
	 * @param {string} [text] The text to lint (used for TTY).
	 * @returns {Promise<number>} The exit code for the operation.
	 */
	async execute(args, text) {
		if (Array.isArray(args)) {
			debug("CLI args: %o", args.slice(2));
		}

		const CLIOptions = createCLIOptions();

		/** @type {ParsedCLIOptions} */
		let options;

		try {
			options = CLIOptions.parse(args);
			validateConcurrency(options.concurrency);
		} catch (error) {
			log.error(error.message);
			return 2;
		}

		const files = options._;
		const useStdin = typeof text === "string";

		if (options.help) {
			log.info(CLIOptions.generateHelp());
			return 0;
		}
		if (options.version) {
			log.info(RuntimeInfo.version());
			return 0;
		}
		if (options.envInfo) {
			try {
				log.info(RuntimeInfo.environment());
				return 0;
			} catch (err) {
				debug("Error retrieving environment info");
				log.error(err.message);
				return 2;
			}
		}

		if (options.printConfig) {
			if (files.length) {
				log.error(
					"The --print-config option must be used with exactly one file name.",
				);
				return 2;
			}
			if (useStdin) {
				log.error(
					"The --print-config option is not available for piped-in code.",
				);
				return 2;
			}

			const engine = new ESLint(await translateOptions(options));
			const fileConfig = await engine.calculateConfigForFile(
				options.printConfig,
			);

			log.info(JSON.stringify(fileConfig, null, "  "));
			return 0;
		}

		if (options.inspectConfig) {
			log.info(
				"You can also run this command directly using 'npx @eslint/config-inspector@latest' in the same directory as your configuration file.",
			);

			try {
				const flatOptions = await translateOptions(options);
				const spawn = require("cross-spawn");
				const flags = await cli.calculateInspectConfigFlags(
					flatOptions.overrideConfigFile,
				);

				spawn.sync(
					"npx",
					["@eslint/config-inspector@latest", ...flags],
					{ encoding: "utf8", stdio: "inherit" },
				);
			} catch (error) {
				log.error(error);
				return 2;
			}

			return 0;
		}

		debug(`Running on ${useStdin ? "text" : "files"}`);

		if (options.fix && options.fixDryRun) {
			log.error(
				"The --fix option and the --fix-dry-run option cannot be used together.",
			);
			return 2;
		}
		if (useStdin && options.fix) {
			log.error(
				"The --fix option is not available for piped-in code; use --fix-dry-run instead.",
			);
			return 2;
		}
		if (options.fixType && !options.fix && !options.fixDryRun) {
			log.error(
				"The --fix-type option requires either --fix or --fix-dry-run.",
			);
			return 2;
		}

		if (
			options.reportUnusedDisableDirectives &&
			options.reportUnusedDisableDirectivesSeverity !== void 0
		) {
			log.error(
				"The --report-unused-disable-directives option and the --report-unused-disable-directives-severity option cannot be used together.",
			);
			return 2;
		}

		if (options.ext) {
			// Passing `--ext ""` results in `options.ext` being an empty array.
			if (options.ext.length === 0) {
				log.error("The --ext option value cannot be empty.");
				return 2;
			}

			// Passing `--ext ,ts` results in an empty string at index 0. Passing `--ext ts,,tsx` results in an empty string at index 1.
			const emptyStringIndex = options.ext.indexOf("");

			if (emptyStringIndex >= 0) {
				log.error(
					`The --ext option arguments cannot be empty strings. Found an empty string at index ${emptyStringIndex}.`,
				);
				return 2;
			}
		}

		if (options.suppressAll && options.suppressRule) {
			log.error(
				"The --suppress-all option and the --suppress-rule option cannot be used together.",
			);
			return 2;
		}

		if (options.suppressAll && options.pruneSuppressions) {
			log.error(
				"The --suppress-all option and the --prune-suppressions option cannot be used together.",
			);
			return 2;
		}

		if (options.suppressRule && options.pruneSuppressions) {
			log.error(
				"The --suppress-rule option and the --prune-suppressions option cannot be used together.",
			);
			return 2;
		}

		if (
			useStdin &&
			(options.suppressAll ||
				options.suppressRule ||
				options.pruneSuppressions)
		) {
			log.error(
				"The --suppress-all, --suppress-rule, and --prune-suppressions options cannot be used with piped-in code.",
			);
			return 2;
		}

		/** @type {ESLint} */
		let engine;

		if (options.concurrency !== "off") {
			const optionsURL = createOptionsModule(options);
			engine = await ESLint.fromOptionsModule(optionsURL);
		} else {
			const eslintOptions = await translateOptions(options);
			engine = new ESLint(eslintOptions);
		}
		let results;

		if (useStdin) {
			results = await engine.lintText(text, {
				filePath: options.stdinFilename,
			});
		} else {
			results = await engine.lintFiles(files);
		}

		if (options.fix) {
			debug("Fix mode enabled - applying fixes");
			await ESLint.outputFixes(results);
		}

		let unusedSuppressions = {};

		if (!useStdin) {
			const suppressionsFileLocation = getCacheFile(
				options.suppressionsLocation ||
					SuppressionsService.DEFAULT_SUPPRESSIONS_FILENAME,
				process.cwd(),
				{
					prefix: "suppressions_",
				},
			);

			if (
				options.suppressionsLocation &&
				!fs.existsSync(suppressionsFileLocation) &&
				!options.suppressAll &&
				!options.suppressRule
			) {
				log.error(
					"The suppressions file does not exist. Please run the command with `--suppress-all` or `--suppress-rule` to create it.",
				);
				return 2;
			}

			if (
				options.suppressAll ||
				options.suppressRule ||
				options.pruneSuppressions ||
				fs.existsSync(suppressionsFileLocation)
			) {
				const suppressions = new SuppressionsService({
					filePath: suppressionsFileLocation,
					cwd: process.cwd(),
				});

				if (options.suppressAll || options.suppressRule) {
					await suppressions.suppress(results, options.suppressRule);
				}

				if (options.pruneSuppressions) {
					await suppressions.prune(results);
				}

				const suppressionResults = suppressions.applySuppressions(
					results,
					await suppressions.load(),
				);

				results = suppressionResults.results;
				unusedSuppressions = suppressionResults.unused;
			}
		}

		let resultsToPrint = results;

		if (options.quiet) {
			debug("Quiet mode enabled - filtering out warnings");
			resultsToPrint = ESLint.getErrorResults(resultsToPrint);
		}

		const resultCounts = countErrors(results);
		const tooManyWarnings =
			options.maxWarnings >= 0 &&
			resultCounts.warningCount > options.maxWarnings;
		const resultsMeta = /** @type {ResultsMeta} */ ({});

		/*
		 * `--color` was set, `options.color` is `true`.
		 * `--no-color` was set, `options.color` is `false`.
		 * Neither option was provided, `options.color` is omitted, so `undefined`.
		 */
		if (options.color !== void 0) {
			debug(`Color setting for output: ${options.color}`);
			resultsMeta.color = options.color;
		}

		if (tooManyWarnings) {
			resultsMeta.maxWarningsExceeded = {
				maxWarnings: options.maxWarnings,
				foundWarnings: resultCounts.warningCount,
			};
		}

		if (
			await printResults(
				engine,
				resultsToPrint,
				options.format,
				options.outputFile,
				resultsMeta,
			)
		) {
			// Errors and warnings from the original unfiltered results should determine the exit code
			const shouldExitForFatalErrors =
				options.exitOnFatalError && resultCounts.fatalErrorCount > 0;

			if (!resultCounts.errorCount && tooManyWarnings) {
				log.error(
					"ESLint found too many warnings (maximum: %s).",
					options.maxWarnings,
				);
			}

			if (!options.passOnUnprunedSuppressions) {
				const unusedSuppressionsCount =
					Object.keys(unusedSuppressions).length;

				if (unusedSuppressionsCount > 0) {
					log.error(
						"There are suppressions left that do not occur anymore. To resolve this, re-run the command with `--prune-suppressions` to remove unused suppressions. To ignore unused suppressions, use `--pass-on-unpruned-suppressions`.",
					);
					debug(JSON.stringify(unusedSuppressions, null, 2));

					return 2;
				}
			}

			if (shouldExitForFatalErrors) {
				return 2;
			}

			return resultCounts.errorCount || tooManyWarnings ? 1 : 0;
		}

		return 2;
	},
};

module.exports = cli;
ox/**
 * @fileoverview exports for config helpers
 * @author Nicholas C. Zakas
 */

"use strict";

const {
	defineConfig,
	globalIgnores,
	includeIgnoreFile,
} = require("@eslint/config-helpers");

module.exports = {
	defineConfig,
	globalIgnores,
	includeIgnoreFile,
};
Yx  100644 config-loader.js nR9znP9@,W V100644 config.js '̰9vKBYV#Y}100644 default-config.js n2{&(J100644 flat-config-array.js }YTT\ե}-100644 flat-config-schema.js {R{OA5\xV뷟xY/**
 * @fileoverview Utility to load config files
 * @author Nicholas C. Zakas
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const path = require("node:path");
const fs = require("node:fs/promises");
const findUp = require("find-up");
const { pathToFileURL } = require("node:url");
const debug = require("debug")("eslint:config-loader");
const { FlatConfigArray } = require("./flat-config-array");
const { WarningService } = require("../services/warning-service");

//-----------------------------------------------------------------------------
// Types
//-----------------------------------------------------------------------------

/** @typedef {import("../types").Linter.Config} Config */

/**
 * @typedef {Object} ConfigLoaderOptions
 * @property {string|false|undefined} configFile The path to the config file to use.
 * @property {string} cwd The current working directory.
 * @property {boolean} ignoreEnabled Indicates if ignore patterns should be honored.
 * @property {Config|Array<Config>} [baseConfig] The base config to use.
 * @property {Array<Config>} [defaultConfigs] The default configs to use.
 * @property {Array<string>} [ignorePatterns] The ignore patterns to use.
 * @property {Config|Array<Config>} [overrideConfig] The override config to use.
 * @property {boolean} [hasUnstableNativeNodeJsTSConfigFlag] The flag to indicate whether the `unstable_native_nodejs_ts_config` flag is enabled.
 * @property {WarningService} [warningService] The warning service to use.
 */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const FLAT_CONFIG_FILENAMES = [
	"eslint.config.js",
	"eslint.config.mjs",
	"eslint.config.cjs",
	"eslint.config.ts",
	"eslint.config.mts",
	"eslint.config.cts",
];

const importedConfigFileModificationTime = new Map();

/**
 * Asserts that the given file path is valid.
 * @param {string} filePath The file path to check.
 * @returns {void}
 * @throws {Error} If `filePath` is not a non-empty string.
 */
function assertValidFilePath(filePath) {
	if (!filePath || typeof filePath !== "string") {
		throw new Error("'filePath' must be a non-empty string");
	}
}

/**
 * Asserts that a configuration exists. A configuration exists if any
 * of the following are true:
 * - `configFilePath` is defined.
 * - `useConfigFile` is `false`.
 * @param {string|undefined} configFilePath The path to the config file.
 * @param {ConfigLoaderOptions} loaderOptions The options to use when loading configuration files.
 * @returns {void}
 * @throws {Error} If no configuration exists.
 */
function assertConfigurationExists(configFilePath, loaderOptions) {
	const { configFile: useConfigFile } = loaderOptions;

	if (!configFilePath && useConfigFile !== false) {
		const error = new Error("Could not find config file.");

		error.messageTemplate = "config-file-missing";
		throw error;
	}
}

/**
 * Check if the file is a TypeScript file.
 * @param {string} filePath The file path to check.
 * @returns {boolean} `true` if the file is a TypeScript file, `false` if it's not.
 */
function isFileTS(filePath) {
	const fileExtension = path.extname(filePath);

	return /^\.[mc]?ts$/u.test(fileExtension);
}

/**
 * Check if ESLint is running in Bun.
 * @returns {boolean} `true` if the ESLint is running Bun, `false` if it's not.
 */
function isRunningInBun() {
	return !!globalThis.Bun;
}

/**
 * Check if ESLint is running in Deno.
 * @returns {boolean} `true` if the ESLint is running in Deno, `false` if it's not.
 */
function isRunningInDeno() {
	return !!globalThis.Deno;
}

/**
 * Checks if native TypeScript support is
 * enabled in the current Node.js process.
 *
 * This function determines if the
 * {@linkcode NodeJS.ProcessFeatures.typescript | typescript}
 * feature is present in the
 * {@linkcode process.features} object
 * and if its value is either "strip" or "transform".
 * @returns {boolean} `true` if native TypeScript support is enabled, otherwise `false`.
 * @since 9.24.0
 */
function isNativeTypeScriptSupportEnabled() {
	return (
		// eslint-disable-next-line n/no-unsupported-features/node-builtins -- it's still an experimental feature.
		["strip", "transform"].includes(process.features.typescript)
	);
}

/**
 * Load the TypeScript configuration file.
 * @param {string} filePath The absolute file path to load.
 * @param {URL} fileURL The file URL to load.
 * @param {number} mtime The last modified timestamp of the file.
 * @returns {Promise<any>} The configuration loaded from the file.
 * @since 9.24.0
 */
async function loadTypeScriptConfigFileWithJiti(filePath, fileURL, mtime) {
	const { createJiti, version: jitiVersion } =
		// eslint-disable-next-line no-use-before-define -- `ConfigLoader.loadJiti` can be overwritten for testing
		await ConfigLoader.loadJiti().catch(() => {
			throw new Error(
				"The 'jiti' library is required for loading TypeScript configuration files. Make sure to install it.",
			);
		});

	// Ensure the version is at least 2.2.0.
	const [jitiMajor, jitiMinor] = jitiVersion
		.split(".")
		.map(versionPart => Number(versionPart));
	if (jitiMajor < 2 || (jitiMajor === 2 && jitiMinor < 2)) {
		throw new Error(
			"You are using an outdated version of the 'jiti' library. Please update to the latest version of 'jiti' to ensure compatibility and access to the latest features.",
		);
	}

	/*
	 * Disabling `moduleCache` allows us to reload a
	 * config file when the last modified timestamp changes.
	 */
	const jitiOptions = {
		moduleCache: false,
	};

	const jiti = createJiti(__filename, jitiOptions);
	const config = await jiti.import(fileURL.href);

	importedConfigFileModificationTime.set(filePath, mtime);

	return config?.default ?? config;
}

/**
 * Dynamically imports a module from the given file path.
 * @param {string} filePath The absolute file path of the module to import.
 * @param {URL} fileURL The file URL to load.
 * @param {number} mtime The last modified timestamp of the file.
 * @returns {Promise<any>} - A {@linkcode Promise | promise} that resolves to the imported ESLint config.
 * @since 9.24.0
 */
async function dynamicImportConfig(filePath, fileURL, mtime) {
	const module = await import(fileURL.href);

	importedConfigFileModificationTime.set(filePath, mtime);

	return module.default;
}

/**
 * Load the config array from the given filename.
 * @param {string} filePath The filename to load from.
 * @param {boolean} hasUnstableNativeNodeJsTSConfigFlag The flag to indicate whether the `unstable_native_nodejs_ts_config` flag is enabled.
 * @returns {Promise<any>} The config loaded from the config file.
 */
async function loadConfigFile(filePath, hasUnstableNativeNodeJsTSConfigFlag) {
	debug(`Loading config from ${filePath}`);

	const fileURL = pathToFileURL(filePath);

	debug(`Config file URL is ${fileURL}`);

	const mtime = (await fs.stat(filePath)).mtime.getTime();

	/*
	 * Append a query with the config file's modification time (`mtime`) in order
	 * to import the current version of the config file. Without the query, `import()` would
	 * cache the config file module by the pathname only, and then always return
	 * the same version (the one that was actual when the module was imported for the first time).
	 *
	 * This ensures that the config file module is loaded and executed again
	 * if it has been changed since the last time it was imported.
	 * If it hasn't been changed, `import()` will just return the cached version.
	 *
	 * Note that we should not overuse queries (e.g., by appending the current time
	 * to always reload the config file module) as that could cause memory leaks
	 * because entries are never removed from the import cache.
	 */
	fileURL.searchParams.append("mtime", mtime);

	/*
	 * With queries, we can bypass the import cache. However, when import-ing a CJS module,
	 * Node.js uses the require infrastructure under the hood. That includes the require cache,
	 * which caches the config file module by its file path (queries have no effect).
	 * Therefore, we also need to clear the require cache before importing the config file module.
	 * In order to get the same behavior with ESM and CJS config files, in particular - to reload
	 * the config file only if it has been changed, we track file modification times and clear
	 * the require cache only if the file has been changed.
	 */
	if (importedConfigFileModificationTime.get(filePath) !== mtime) {
		delete require.cache?.[filePath];
	}

	const isTS = isFileTS(filePath);
	const isBun = isRunningInBun();
	const isDeno = isRunningInDeno();

	/*
	 * If we are dealing with a TypeScript file, then we need to use `jiti` to load it
	 * in Node.js. Deno and Bun both allow native importing of TypeScript files.
	 *
	 * When Node.js supports native TypeScript imports, we can remove this check.
	 */

	if (isTS) {
		if (hasUnstableNativeNodeJsTSConfigFlag) {
			if (isNativeTypeScriptSupportEnabled()) {
				return await dynamicImportConfig(filePath, fileURL, mtime);
			}

			if (!("typescript" in process.features)) {
				throw new Error(
					"The unstable_native_nodejs_ts_config flag is not supported in older versions of Node.js.",
				);
			}

			throw new Error(
				"The unstable_native_nodejs_ts_config flag is enabled, but native TypeScript support is not enabled in the current Node.js process. You need to either enable native TypeScript support by passing --experimental-strip-types or remove the unstable_native_nodejs_ts_config flag.",
			);
		}

		if (!isDeno && !isBun) {
			return await loadTypeScriptConfigFileWithJiti(
				filePath,
				fileURL,
				mtime,
			);
		}
	}

	// fallback to normal runtime behavior

	return await dynamicImportConfig(filePath, fileURL, mtime);
}

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * Encapsulates the loading and caching of configuration files when looking up
 * from the file being linted.
 */
class ConfigLoader {
	/**
	 * Map of config file paths to the config arrays for those directories.
	 * @type {Map<string, FlatConfigArray|Promise<FlatConfigArray>>}
	 */
	#configArrays = new Map();

	/**
	 * Map of absolute directory names to the config file paths for those directories.
	 * @type {Map<string, {configFilePath:string,basePath:string}|Promise<{configFilePath:string,basePath:string}>>}
	 */
	#configFilePaths = new Map();

	/**
	 * The options to use when loading configuration files.
	 * @type {ConfigLoaderOptions}
	 */
	#options;

	/**
	 * Creates a new instance.
	 * @param {ConfigLoaderOptions} options The options to use when loading configuration files.
	 */
	constructor(options) {
		this.#options = options.warningService
			? options
			: { ...options, warningService: new WarningService() };
	}

	/**
	 * Determines which config file to use. This is determined by seeing if an
	 * override config file was specified, and if so, using it; otherwise, as long
	 * as override config file is not explicitly set to `false`, it will search
	 * upwards from `fromDirectory` for a file named `eslint.config.js`.
	 * @param {string} fromDirectory The directory from which to start searching.
	 * @returns {Promise<{configFilePath:string|undefined,basePath:string}>} Location information for
	 *      the config file.
	 */
	async #locateConfigFileToUse(fromDirectory) {
		// check cache first
		if (this.#configFilePaths.has(fromDirectory)) {
			return this.#configFilePaths.get(fromDirectory);
		}

		const resultPromise = ConfigLoader.locateConfigFileToUse({
			useConfigFile: this.#options.configFile,
			cwd: this.#options.cwd,
			fromDirectory,
		});

		// ensure `ConfigLoader.locateConfigFileToUse` is called only once for `fromDirectory`
		this.#configFilePaths.set(fromDirectory, resultPromise);

		// Unwrap the promise. This is primarily for the sync `getCachedConfigArrayForPath` method.
		const result = await resultPromise;

		this.#configFilePaths.set(fromDirectory, result);

		return result;
	}

	/**
	 * Calculates the config array for this run based on inputs.
	 * @param {string} configFilePath The absolute path to the config file to use if not overridden.
	 * @param {string} basePath The base path to use for relative paths in the config file.
	 * @returns {Promise<FlatConfigArray>} The config array for `eslint`.
	 */
	async #calculateConfigArray(configFilePath, basePath) {
		// check for cached version first
		if (this.#configArrays.has(configFilePath)) {
			return this.#configArrays.get(configFilePath);
		}

		const configsPromise = ConfigLoader.calculateConfigArray(
			configFilePath,
			basePath,
			this.#options,
		);

		// ensure `ConfigLoader.calculateConfigArray` is called only once for `configFilePath`
		this.#configArrays.set(configFilePath, configsPromise);

		// Unwrap the promise. This is primarily for the sync `getCachedConfigArrayForPath` method.
		const configs = await configsPromise;

		this.#configArrays.set(configFilePath, configs);

		return configs;
	}

	/**
	 * Returns the config file path for the given directory or file. This will either use
	 * the override config file that was specified in the constructor options or
	 * search for a config file from the directory.
	 * @param {string} fileOrDirPath The file or directory path to get the config file path for.
	 * @returns {Promise<string|undefined>} The config file path or `undefined` if not found.
	 * @throws {Error} If `fileOrDirPath` is not a non-empty string.
	 * @throws {Error} If `fileOrDirPath` is not an absolute path.
	 */
	async findConfigFileForPath(fileOrDirPath) {
		assertValidFilePath(fileOrDirPath);

		const absoluteDirPath = path.resolve(
			this.#options.cwd,
			path.dirname(fileOrDirPath),
		);
		const { configFilePath } =
			await this.#locateConfigFileToUse(absoluteDirPath);

		return configFilePath;
	}

	/**
	 * Returns a configuration object for the given file based on the CLI options.
	 * This is the same logic used by the ESLint CLI executable to determine
	 * configuration for each file it processes.
	 * @param {string} filePath The path of the file or directory to retrieve config for.
	 * @returns {Promise<FlatConfigArray>} A configuration object for the file.
	 * @throws {Error} If no configuration for `filePath` exists.
	 */
	async loadConfigArrayForFile(filePath) {
		assertValidFilePath(filePath);

		debug(`Calculating config for file ${filePath}`);

		const configFilePath = await this.findConfigFileForPath(filePath);

		assertConfigurationExists(configFilePath, this.#options);

		return this.loadConfigArrayForDirectory(filePath);
	}

	/**
	 * Returns a configuration object for the given directory based on the CLI options.
	 * This is the same logic used by the ESLint CLI executable to determine
	 * configuration for each file it processes.
	 * @param {string} dirPath The path of the directory to retrieve config for.
	 * @returns {Promise<FlatConfigArray>} A configuration object for the directory.
	 */
	async loadConfigArrayForDirectory(dirPath) {
		assertValidFilePath(dirPath);

		debug(`Calculating config for directory ${dirPath}`);

		const absoluteDirPath = path.resolve(
			this.#options.cwd,
			path.dirname(dirPath),
		);
		const { configFilePath, basePath } =
			await this.#locateConfigFileToUse(absoluteDirPath);

		debug(`Using config file ${configFilePath} and base path ${basePath}`);
		return this.#calculateConfigArray(configFilePath, basePath);
	}

	/**
	 * Returns a configuration array for the given file based on the CLI options.
	 * This is a synchronous operation and does not read any files from disk. It's
	 * intended to be used in locations where we know the config file has already
	 * been loaded and we just need to get the configuration for a file.
	 * @param {string} filePath The path of the file to retrieve a config object for.
	 * @returns {FlatConfigArray} A configuration object for the file.
	 * @throws {Error} If `filePath` is not a non-empty string.
	 * @throws {Error} If `filePath` is not an absolute path.
	 * @throws {Error} If the config file was not already loaded.
	 */
	getCachedConfigArrayForFile(filePath) {
		assertValidFilePath(filePath);

		debug(`Looking up cached config for ${filePath}`);

		return this.getCachedConfigArrayForPath(path.dirname(filePath));
	}

	/**
	 * Returns a configuration array for the given directory based on the CLI options.
	 * This is a synchronous operation and does not read any files from disk. It's
	 * intended to be used in locations where we know the config file has already
	 * been loaded and we just need to get the configuration for a file.
	 * @param {string} fileOrDirPath The path of the directory to retrieve a config object for.
	 * @returns {FlatConfigArray} A configuration object for the directory.
	 * @throws {Error} If `dirPath` is not a non-empty string.
	 * @throws {Error} If `dirPath` is not an absolute path.
	 * @throws {Error} If the config file was not already loaded.
	 */
	getCachedConfigArrayForPath(fileOrDirPath) {
		assertValidFilePath(fileOrDirPath);

		debug(`Looking up cached config for ${fileOrDirPath}`);

		const absoluteDirPath = path.resolve(this.#options.cwd, fileOrDirPath);

		if (!this.#configFilePaths.has(absoluteDirPath)) {
			throw new Error(`Could not find config file for ${fileOrDirPath}`);
		}

		const configFilePathInfo = this.#configFilePaths.get(absoluteDirPath);

		if (typeof configFilePathInfo.then === "function") {
			throw new Error(
				`Config file path for ${fileOrDirPath} has not yet been calculated or an error occurred during the calculation`,
			);
		}

		const { configFilePath } = configFilePathInfo;

		const configArray = this.#configArrays.get(configFilePath);

		if (!configArray || typeof configArray.then === "function") {
			throw new Error(
				`Config array for ${fileOrDirPath} has not yet been calculated or an error occurred during the calculation`,
			);
		}

		return configArray;
	}

	/**
	 * Used to import the jiti dependency. This method is exposed internally for testing purposes.
	 * @returns {Promise<{createJiti: Function|undefined, version: string;}>} A promise that fulfills with an object containing the jiti module's createJiti function and version.
	 */
	static async loadJiti() {
		const { createJiti } = await import("jiti");
		const version = require("jiti/package.json").version;
		return { createJiti, version };
	}

	/**
	 * Determines which config file to use. This is determined by seeing if an
	 * override config file was specified, and if so, using it; otherwise, as long
	 * as override config file is not explicitly set to `false`, it will search
	 * upwards from `fromDirectory` for a file named `eslint.config.js`.
	 * This method is exposed internally for testing purposes.
	 * @param {Object} [options] the options object
	 * @param {string|false|undefined} options.useConfigFile The path to the config file to use.
	 * @param {string} options.cwd Path to a directory that should be considered as the current working directory.
	 * @param {string} [options.fromDirectory] The directory from which to start searching. Defaults to `cwd`.
	 * @returns {Promise<{configFilePath:string|undefined,basePath:string}>} Location information for
	 *      the config file.
	 */
	static async locateConfigFileToUse({
		useConfigFile,
		cwd,
		fromDirectory = cwd,
	}) {
		// determine where to load config file from
		let configFilePath;
		let basePath = cwd;

		if (typeof useConfigFile === "string") {
			debug(`Override config file path is ${useConfigFile}`);
			configFilePath = path.resolve(cwd, useConfigFile);
			basePath = cwd;
		} else if (useConfigFile !== false) {
			debug("Searching for eslint.config.js");
			configFilePath = await findUp(FLAT_CONFIG_FILENAMES, {
				cwd: fromDirectory,
			});

			if (configFilePath) {
				basePath = path.dirname(configFilePath);
			}
		}

		return {
			configFilePath,
			basePath,
		};
	}

	/**
	 * Calculates the config array for this run based on inputs.
	 * This method is exposed internally for testing purposes.
	 * @param {string} configFilePath The absolute path to the config file to use if not overridden.
	 * @param {string} basePath The base path to use for relative paths in the config file.
	 * @param {ConfigLoaderOptions} options The options to use when loading configuration files.
	 * @returns {Promise<FlatConfigArray>} The config array for `eslint`.
	 */
	static async calculateConfigArray(configFilePath, basePath, options) {
		const {
			cwd,
			baseConfig,
			ignoreEnabled,
			ignorePatterns,
			overrideConfig,
			hasUnstableNativeNodeJsTSConfigFlag = false,
			defaultConfigs = [],
			warningService,
		} = options;

		debug(
			`Calculating config array from config file ${configFilePath} and base path ${basePath}`,
		);

		const configs = new FlatConfigArray(baseConfig || [], {
			basePath,
			shouldIgnore: ignoreEnabled,
		});

		// load config file
		if (configFilePath) {
			debug(`Loading config file ${configFilePath}`);
			const fileConfig = await loadConfigFile(
				configFilePath,
				hasUnstableNativeNodeJsTSConfigFlag,
			);

			/*
			 * It's possible that a config file could be empty or else
			 * have an empty object or array. In this case, we want to
			 * warn the user that they have an empty config.
			 *
			 * An empty CommonJS file exports an empty object while
			 * an empty ESM file exports undefined.
			 */

			let emptyConfig = typeof fileConfig === "undefined";

			debug(
				`Config file ${configFilePath} is ${emptyConfig ? "empty" : "not empty"}`,
			);

			if (!emptyConfig) {
				if (Array.isArray(fileConfig)) {
					if (fileConfig.length === 0) {
						debug(
							`Config file ${configFilePath} is an empty array`,
						);
						emptyConfig = true;
					} else {
						configs.push(...fileConfig);
					}
				} else {
					if (
						typeof fileConfig === "object" &&
						fileConfig !== null &&
						Object.keys(fileConfig).length === 0
					) {
						debug(
							`Config file ${configFilePath} is an empty object`,
						);
						emptyConfig = true;
					} else {
						configs.push(fileConfig);
					}
				}
			}

			if (emptyConfig) {
				warningService.emitEmptyConfigWarning(configFilePath);
			}
		}

		// add in any configured defaults
		configs.push(...defaultConfigs);

		// append command line ignore patterns
		if (ignorePatterns && ignorePatterns.length > 0) {
			/*
			 * Ignore patterns are added to the end of the config array
			 * so they can override default ignores.
			 */
			configs.push({
				basePath: cwd,
				ignores: ignorePatterns,
			});
		}

		if (overrideConfig) {
			if (Array.isArray(overrideConfig)) {
				configs.push(...overrideConfig);
			} else {
				configs.push(overrideConfig);
			}
		}

		await configs.normalize();

		return configs;
	}
}

module.exports = { ConfigLoader };
װx`Y/**
 * @fileoverview The `Config` class
 * @author Nicholas C. Zakas
 */

"use strict";

//-----------------------------------------------------------------------------
// Requirements
//-----------------------------------------------------------------------------

const { deepMergeArrays } = require("../shared/deep-merge-arrays");
const { flatConfigSchema, hasMethod } = require("./flat-config-schema");
const { ObjectSchema } = require("@eslint/config-array");
const ajvImport = require("../shared/ajv");
const ajv = ajvImport();
const ruleReplacements = require("../../conf/replacements.json");

//-----------------------------------------------------------------------------
// Typedefs
//-----------------------------------------------------------------------------

/**
 * @import { RuleDefinition } from "@eslint/core";
 * @import { Linter } from "eslint";
 */

//-----------------------------------------------------------------------------
// Private Members
//------------------------------------------------------------------------------

// JSON schema that disallows passing any options
const noOptionsSchema = Object.freeze({
	type: "array",
	minItems: 0,
	maxItems: 0,
});

const severities = new Map([
	[0, 0],
	[1, 1],
	[2, 2],
	["off", 0],
	["warn", 1],
	["error", 2],
]);

/**
 * A collection of compiled validators for rules that have already
 * been validated.
 * @type {WeakMap}
 */
const validators = new WeakMap();

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

/**
 * Throws a helpful error when a rule cannot be found.
 * @param {Object} ruleId The rule identifier.
 * @param {string} ruleId.pluginName The ID of the rule to find.
 * @param {string} ruleId.ruleName The ID of the rule to find.
 * @param {Object} config The config to search in.
 * @throws {TypeError} For missing plugin or rule.
 * @returns {void}
 */
function throwRuleNotFoundError({ pluginName, ruleName }, config) {
	const ruleId = pluginName === "@" ? ruleName : `${pluginName}/${ruleName}`;

	const errorMessageHeader = `Key "rules": Key "${ruleId}"`;

	let errorMessage = `${errorMessageHeader}: Could not find plugin "${pluginName}" in configuration.`;

	const missingPluginErrorMessage = errorMessage;

	// if the plugin exists then we need to check if the rule exists
	if (config.plugins && config.plugins[pluginName]) {
		const replacementRuleName = ruleReplacements.rules[ruleName];

		if (pluginName === "@" && replacementRuleName) {
			errorMessage = `${errorMessageHeader}: Rule "${ruleName}" was removed and replaced by "${replacementRuleName}".`;
		} else {
			errorMessage = `${errorMessageHeader}: Could not find "${ruleName}" in plugin "${pluginName}".`;

			// otherwise, let's see if we can find the rule name elsewhere
			for (const [otherPluginName, otherPlugin] of Object.entries(
				config.plugins,
			)) {
				if (otherPlugin.rules && otherPlugin.rules[ruleName]) {
					errorMessage += ` Did you mean "${otherPluginName}/${ruleName}"?`;
					break;
				}
			}
		}

		// falls through to throw error
	}

	const error = new TypeError(errorMessage);

	if (errorMessage === missingPluginErrorMessage) {
		error.messageTemplate = "config-plugin-missing";
		error.messageData = { pluginName, ruleId };
	}

	throw error;
}

/**
 * The error type when a rule has an invalid `meta.schema`.
 */
class InvalidRuleOptionsSchemaError extends Error {
	/**
	 * Creates a new instance.
	 * @param {string} ruleId Id of the rule that has an invalid `meta.schema`.
	 * @param {Error} processingError Error caught while processing the `meta.schema`.
	 */
	constructor(ruleId, processingError) {
		super(
			`Error while processing options validation schema of rule '${ruleId}': ${processingError.message}`,
			{ cause: processingError },
		);
		this.code = "ESLINT_INVALID_RULE_OPTIONS_SCHEMA";
	}
}

/**
 * Parses a ruleId into its plugin and rule parts.
 * @param {string} ruleId The rule ID to parse.
 * @returns {{pluginName:string,ruleName:string}} The plugin and rule
 *      parts of the ruleId;
 */
function parseRuleId(ruleId) {
	let pluginName, ruleName;

	// distinguish between core rules and plugin rules
	if (ruleId.includes("/")) {
		// mimic scoped npm packages
		if (ruleId.startsWith("@")) {
			pluginName = ruleId.slice(0, ruleId.lastIndexOf("/"));
		} else {
			pluginName = ruleId.slice(0, ruleId.indexOf("/"));
		}

		ruleName = ruleId.slice(pluginName.length + 1);
	} else {
		pluginName = "@";
		ruleName = ruleId;
	}

	return {
		pluginName,
		ruleName,
	};
}

/**
 * Retrieves a rule instance from a given config based on the ruleId.
 * @param {string} ruleId The rule ID to look for.
 * @param {Linter.Config} config The config to search.
 * @returns {RuleDefinition|undefined} The rule if found
 *      or undefined if not.
 */
function getRuleFromConfig(ruleId, config) {
	const { pluginName, ruleName } = parseRuleId(ruleId);

	return config.plugins?.[pluginName]?.rules?.[ruleName];
}

/**
 * Gets a complete options schema for a rule.
 * @param {RuleDefinition} rule A rule object
 * @throws {TypeError} If `meta.schema` is specified but is not an array, object or `false`.
 * @returns {Object|null} JSON Schema for the rule's options. `null` if `meta.schema` is `false`.
 */
function getRuleOptionsSchema(rule) {
	if (!rule.meta) {
		return { ...noOptionsSchema }; // default if `meta.schema` is not specified
	}

	const schema = rule.meta.schema;

	if (typeof schema === "undefined") {
		return { ...noOptionsSchema }; // default if `meta.schema` is not specified
	}

	// `schema:false` is an allowed explicit opt-out of options validation for the rule
	if (schema === false) {
		return null;
	}

	if (typeof schema !== "object" || schema === null) {
		throw new TypeError("Rule's `meta.schema` must be an array or object");
	}

	// ESLint-specific array form needs to be converted into a valid JSON Schema definition
	if (Array.isArray(schema)) {
		if (schema.length) {
			return {
				type: "array",
				items: schema,
				minItems: 0,
				maxItems: schema.length,
			};
		}

		// `schema:[]` is an explicit way to specify that the rule does not accept any options
		return { ...noOptionsSchema };
	}

	// `schema:<object>` is assumed to be a valid JSON Schema definition
	return schema;
}

/**
 * Splits a plugin identifier in the form a/b/c into two parts: a/b and c.
 * @param {string} identifier The identifier to parse.
 * @returns {{objectName: string, pluginName: string}} The parts of the plugin
 *      name.
 */
function splitPluginIdentifier(identifier) {
	const parts = identifier.split("/");

	return {
		objectName: parts.pop(),
		pluginName: parts.join("/"),
	};
}

/**
 * Normalizes a language name by replacing the built-in `@/` plugin prefix with `js/`.
 * @param {string} languageName The language name to normalize.
 * @returns {string} The normalized language name.
 */
function normalizeLanguageName(languageName) {
	return languageName.startsWith("@/")
		? `js/${languageName.slice(2)}`
		: languageName;
}

/**
 * Checks if a rule's `meta.languages` supports the given language.
 * @param {Array<string>|undefined} ruleLangs The rule's `meta.languages` array.
 * @param {string} configLanguageName The normalized language name from the config (e.g., "js/js").
 * @param {Array<string>} validPluginNames The valid plugin name aliases for the config's plugin
 *   (normalized plugin name plus its `meta.namespace` if defined).
 * @returns {boolean} True if the rule supports the language, false otherwise.
 */
function doesRuleSupportLanguage(
	ruleLangs,
	configLanguageName,
	validPluginNames,
) {
	// If no languages specified, works with all languages (backward compatible)
	if (!ruleLangs) {
		return true;
	}

	const { objectName: configLangPart } =
		splitPluginIdentifier(configLanguageName);

	for (const langEntry of ruleLangs) {
		// Skip non-string entries
		if (typeof langEntry !== "string") {
			continue;
		}

		// "*" matches any language
		if (langEntry === "*") {
			return true;
		}

		// Direct match
		if (langEntry === configLanguageName) {
			return true;
		}

		const { pluginName: rulePluginPart, objectName: ruleLangPart } =
			splitPluginIdentifier(langEntry);

		// "plugin/*" wildcard - matches any language from that plugin (by name or namespace)
		if (ruleLangPart === "*") {
			if (validPluginNames.includes(rulePluginPart)) {
				return true;
			}
		} else {
			// Match by plugin name or namespace, with exact language part
			if (
				validPluginNames.includes(rulePluginPart) &&
				ruleLangPart === configLangPart
			) {
				return true;
			}
		}
	}

	return false;
}

/**
 * Returns the name of an object in the config by reading its `meta` key.
 * @param {Object} object The object to check.
 * @returns {string?} The name of the object if found or `null` if there
 *      is no name.
 */
function getObjectId(object) {
	// first check old-style name
	let name = object.name;

	if (!name) {
		if (!object.meta) {
			return null;
		}

		name = object.meta.name;

		if (!name) {
			return null;
		}
	}

	// now check for old-style version
	let version = object.version;

	if (!version) {
		version = object.meta && object.meta.version;
	}

	// if there's a version then append that
	if (version) {
		return `${name}@${version}`;
	}

	return name;
}

/**
 * Asserts that a value is not a function.
 * @param {any} value The value to check.
 * @param {string} key The key of the value in the object.
 * @param {string} objectKey The key of the object being checked.
 * @returns {void}
 * @throws {TypeError} If the value is a function.
 */
function assertNotFunction(value, key, objectKey) {
	if (typeof value === "function") {
		const error = new TypeError(
			`Cannot serialize key "${key}" in "${objectKey}": Function values are not supported.`,
		);

		error.messageTemplate = "config-serialize-function";
		error.messageData = { key, objectKey };

		throw error;
	}
}

/**
 * Converts a languageOptions object to a JSON representation.
 * @param {Record<string, any>} languageOptions The options to create a JSON
 *     representation of.
 * @param {string} objectKey The key of the object being converted.
 * @returns {Record<string, any>} The JSON representation of the languageOptions.
 * @throws {TypeError} If a function is found in the languageOptions.
 */
function languageOptionsToJSON(languageOptions, objectKey = "languageOptions") {
	if (typeof languageOptions.toJSON === "function") {
		const result = languageOptions.toJSON();

		assertNotFunction(result, "toJSON", objectKey);

		return result;
	}

	const result = {};

	for (const [key, value] of Object.entries(languageOptions)) {
		if (value) {
			if (typeof value === "object") {
				const name = getObjectId(value);

				if (typeof value.toJSON === "function") {
					result[key] = value.toJSON();
					assertNotFunction(result[key], key, objectKey);
				} else if (name && hasMethod(value)) {
					result[key] = name;
				} else {
					result[key] = languageOptionsToJSON(value, key);
				}
				continue;
			}

			assertNotFunction(value, key, objectKey);
		}

		result[key] = value;
	}

	return result;
}

/**
 * Gets or creates a validator for a rule.
 * @param {Object} rule The rule to get a validator for.
 * @param {string} ruleId The ID of the rule (for error reporting).
 * @returns {Function|null} A validation function or null if no validation is needed.
 * @throws {InvalidRuleOptionsSchemaError} If a rule's `meta.schema` is invalid.
 */
function getOrCreateValidator(rule, ruleId) {
	if (!validators.has(rule)) {
		try {
			const schema = getRuleOptionsSchema(rule);

			if (schema) {
				validators.set(rule, ajv.compile(schema));
			}
		} catch (err) {
			throw new InvalidRuleOptionsSchemaError(ruleId, err);
		}
	}

	return validators.get(rule);
}

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * Represents a normalized configuration object.
 */
class Config {
	/**
	 * The name to use for the language when serializing to JSON.
	 * @type {string|undefined}
	 */
	#languageName;

	/**
	 * The name to use for the processor when serializing to JSON.
	 * @type {string|undefined}
	 */
	#processorName;

	/**
	 * Creates a new instance.
	 * @param {Object} config The configuration object.
	 */
	constructor(config) {
		const { plugins, language, languageOptions, processor, ...otherKeys } =
			config;

		// Validate config object
		const schema = new ObjectSchema(flatConfigSchema);

		schema.validate(config);

		// first, copy all the other keys over
		Object.assign(this, otherKeys);

		// ensure that a language is specified
		if (!language) {
			throw new TypeError("Key 'language' is required.");
		}

		// copy the rest over
		this.plugins = plugins;
		this.language = language;

		// Check language value
		const {
			pluginName: languagePluginName,
			objectName: localLanguageName,
		} = splitPluginIdentifier(language);

		this.#languageName = language;

		if (
			!plugins ||
			!plugins[languagePluginName] ||
			!plugins[languagePluginName].languages ||
			!plugins[languagePluginName].languages[localLanguageName]
		) {
			throw new TypeError(
				`Key "language": Could not find "${localLanguageName}" in plugin "${languagePluginName}".`,
			);
		}

		this.language =
			plugins[languagePluginName].languages[localLanguageName];

		if (this.language.defaultLanguageOptions ?? languageOptions) {
			this.languageOptions = flatConfigSchema.languageOptions.merge(
				this.language.defaultLanguageOptions,
				languageOptions,
			);
		} else {
			this.languageOptions = {};
		}

		// Validate language options
		try {
			this.language.validateLanguageOptions(this.languageOptions);
		} catch (error) {
			throw new TypeError(`Key "languageOptions": ${error.message}`, {
				cause: error,
			});
		}

		// Normalize language options if necessary
		if (this.language.normalizeLanguageOptions) {
			this.languageOptions = this.language.normalizeLanguageOptions(
				this.languageOptions,
			);
		}

		// Check processor value
		if (processor) {
			this.processor = processor;

			if (typeof processor === "string") {
				const { pluginName, objectName: localProcessorName } =
					splitPluginIdentifier(processor);

				this.#processorName = processor;

				if (
					!plugins ||
					!plugins[pluginName] ||
					!plugins[pluginName].processors ||
					!plugins[pluginName].processors[localProcessorName]
				) {
					throw new TypeError(
						`Key "processor": Could not find "${localProcessorName}" in plugin "${pluginName}".`,
					);
				}

				this.processor =
					plugins[pluginName].processors[localProcessorName];
			} else if (typeof processor === "object") {
				this.#processorName = getObjectId(processor);
				this.processor = processor;
			} else {
				throw new TypeError(
					"Key 'processor' must be a string or an object.",
				);
			}
		}

		// Process the rules
		if (this.rules) {
			this.#normalizeRulesConfig();
			this.validateRulesConfig(this.rules);
		}
	}

	/**
	 * Converts the configuration to a JSON representation.
	 * @returns {Record<string, any>} The JSON representation of the configuration.
	 * @throws {Error} If the configuration cannot be serialized.
	 */
	toJSON() {
		if (this.processor && !this.#processorName) {
			throw new Error(
				"Could not serialize processor object (missing 'meta' object).",
			);
		}

		if (!this.#languageName) {
			throw new Error(
				"Could not serialize language object (missing 'meta' object).",
			);
		}

		return {
			...this,
			plugins: Object.entries(this.plugins).map(([namespace, plugin]) => {
				const pluginId = getObjectId(plugin);

				if (!pluginId) {
					return namespace;
				}

				return `${namespace}:${pluginId}`;
			}),
			language: this.#languageName,
			languageOptions: languageOptionsToJSON(this.languageOptions),
			processor: this.#processorName,
		};
	}

	/**
	 * Gets a rule configuration by its ID.
	 * @param {string} ruleId The ID of the rule to get.
	 * @returns {RuleDefinition|undefined} The rule definition from the plugin, or `undefined` if the rule is not found.
	 */
	getRuleDefinition(ruleId) {
		return getRuleFromConfig(ruleId, this);
	}

	/**
	 * Normalizes the rules configuration. Ensures that each rule config is
	 * an array and that the severity is a number. Applies meta.defaultOptions.
	 * This function modifies `this.rules`.
	 * @returns {void}
	 */
	#normalizeRulesConfig() {
		for (const [ruleId, originalConfig] of Object.entries(this.rules)) {
			// ensure rule config is an array
			let ruleConfig = Array.isArray(originalConfig)
				? originalConfig
				: [originalConfig];

			// normalize severity
			ruleConfig[0] = severities.get(ruleConfig[0]);

			const rule = getRuleFromConfig(ruleId, this);

			// apply meta.defaultOptions
			const slicedOptions = ruleConfig.slice(1);
			const mergedOptions = deepMergeArrays(
				rule?.meta?.defaultOptions,
				slicedOptions,
			);

			if (mergedOptions.length) {
				ruleConfig = [ruleConfig[0], ...mergedOptions];
			}

			this.rules[ruleId] = ruleConfig;
		}
	}

	/**
	 * Validates all of the rule configurations in the given rules config
	 * against the plugins in this instance. This is used primarily to
	 * validate inline configuration rules while inting.
	 * @param {Object} rulesConfig The rules config to validate.
	 * @returns {void}
	 * @throws {Error} If a rule's configuration does not match its schema.
	 * @throws {TypeError} If the rulesConfig is not provided or is invalid.
	 * @throws {InvalidRuleOptionsSchemaError} If a rule's `meta.schema` is invalid.
	 * @throws {TypeError} If a rule is not found in the plugins.
	 * @throws {TypeError} If a rule does not support the current language.
	 */
	validateRulesConfig(rulesConfig) {
		if (!rulesConfig) {
			throw new TypeError("Config is required for validation.");
		}

		// Normalize "@/" prefix to "js/" for matching and user-facing messages
		const normalizedLanguageName = normalizeLanguageName(
			this.#languageName,
		);

		// Compute valid plugin name aliases for the config's language plugin once
		const { pluginName: configPluginName } = splitPluginIdentifier(
			normalizedLanguageName,
		);
		const configPlugin =
			this.plugins[configPluginName] ??
			(configPluginName === "js" ? this.plugins["@"] : void 0);
		const validPluginNames = configPlugin?.meta?.namespace
			? [configPluginName, configPlugin.meta.namespace]
			: [configPluginName];
		const unsupportedLanguageRules = [];

		for (const [ruleId, ruleOptions] of Object.entries(rulesConfig)) {
			// check for edge case
			if (ruleId === "__proto__") {
				continue;
			}

			/*
			 * If a rule is disabled, we don't do any validation. This allows
			 * users to safely set any value to 0 or "off" without worrying
			 * that it will cause a validation error.
			 *
			 * Note: ruleOptions is always an array at this point because
			 * this validation occurs after FlatConfigArray has merged and
			 * normalized values.
			 */
			if (ruleOptions[0] === 0) {
				continue;
			}

			const rule = getRuleFromConfig(ruleId, this);

			if (!rule) {
				throwRuleNotFoundError(parseRuleId(ruleId), this);
			}

			// Validate meta.languages structure if present (only for enabled rules)
			if (rule.meta?.languages !== void 0) {
				if (!Array.isArray(rule.meta.languages)) {
					throw new TypeError(
						`Key "rules": Key "${ruleId}": Key "meta": Key "languages": Expected an array.`,
					);
				}

				for (const lang of rule.meta.languages) {
					if (typeof lang !== "string") {
						throw new TypeError(
							`Key "rules": Key "${ruleId}": Key "meta": Key "languages": Expected each element to be a string.`,
						);
					}
				}
			}

			// Check if the rule supports the current language
			if (
				!doesRuleSupportLanguage(
					rule.meta?.languages,
					normalizedLanguageName,
					validPluginNames,
				)
			) {
				unsupportedLanguageRules.push(ruleId);
			}

			const validateRule = getOrCreateValidator(rule, ruleId);

			if (validateRule) {
				validateRule(ruleOptions.slice(1));

				if (validateRule.errors) {
					throw new Error(
						`Key "rules": Key "${ruleId}":\n${validateRule.errors
							.map(error => {
								if (
									error.keyword === "additionalProperties" &&
									error.schema === false &&
									typeof error.parentSchema?.properties ===
										"object" &&
									typeof error.params?.additionalProperty ===
										"string"
								) {
									const expectedProperties = Object.keys(
										error.parentSchema.properties,
									).map(property => `"${property}"`);

									return `\tValue ${JSON.stringify(error.data)} ${error.message}.\n\t\tUnexpected property "${error.params.additionalProperty}". Expected properties: ${expectedProperties.join(", ")}.\n`;
								}

								return `\tValue ${JSON.stringify(error.data)} ${error.message}.\n`;
							})
							.join("")}`,
					);
				}
			}
		}

		if (unsupportedLanguageRules.length > 0) {
			const error = new TypeError(
				`Key "rules": The following rules do not support the language "${normalizedLanguageName}":\n${unsupportedLanguageRules.map(ruleId => `\t- "${ruleId}"`).join("\n")}`,
			);

			error.messageTemplate = "rule-unsupported-language";
			error.messageData = {
				ruleIds: unsupportedLanguageRules,
				language: normalizedLanguageName,
			};
			throw error;
		}
	}

	/**
	 * Gets a complete options schema for a rule.
	 * @param {RuleDefinition} ruleDefinition A rule definition object.
	 * @throws {TypeError} If `meta.schema` is specified but is not an array, object or `false`.
	 * @returns {Object|null} JSON Schema for the rule's options. `null` if `meta.schema` is `false`.
	 */
	static getRuleOptionsSchema(ruleDefinition) {
		return getRuleOptionsSchema(ruleDefinition);
	}

	/**
	 * Normalizes the severity value of a rule's configuration to a number
	 * @param {(number|string|[number, ...*]|[string, ...*])} ruleConfig A rule's configuration value, generally
	 * received from the user. A valid config value is either 0, 1, 2, the string "off" (treated the same as 0),
	 * the string "warn" (treated the same as 1), the string "error" (treated the same as 2), or an array
	 * whose first element is one of the above values. Strings are matched case-insensitively.
	 * @returns {(0|1|2)} The numeric severity value if the config value was valid, otherwise 0.
	 */
	static getRuleNumericSeverity(ruleConfig) {
		const severityValue = Array.isArray(ruleConfig)
			? ruleConfig[0]
			: ruleConfig;

		if (severities.has(severityValue)) {
			return severities.get(severityValue);
		}

		if (typeof severityValue === "string") {
			return severities.get(severityValue.toLowerCase()) ?? 0;
		}

		return 0;
	}
}

module.exports = { Config };
ݸ[jx^/**
 * @fileoverview Default configuration
 * @author Nicholas C. Zakas
 */

"use strict";

//-----------------------------------------------------------------------------
// Requirements
//-----------------------------------------------------------------------------

const Rules = require("../rules");

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

const sharedDefaultConfig = [
	// intentionally empty config to ensure these files are globbed by default
	{
		files: ["**/*.js", "**/*.mjs"],
	},
	{
		files: ["**/*.cjs"],
		languageOptions: {
			sourceType: "commonjs",
			ecmaVersion: "latest",
		},
	},
];

exports.defaultConfig = Object.freeze([
	{
		plugins: {
			"@": {
				languages: {
					js: require("../languages/js"),
				},

				/*
				 * Because we try to delay loading rules until absolutely
				 * necessary, a proxy allows us to hook into the lazy-loading
				 * aspect of the rules map while still keeping all of the
				 * relevant configuration inside of the config array.
				 */
				rules: new Proxy(
					{},
					{
						get(target, property) {
							return Rules.get(property);
						},

						has(target, property) {
							return Rules.has(property);
						},
					},
				),
			},
		},
		language: "@/js",
		linterOptions: {
			reportUnusedDisableDirectives: 1,
		},
	},

	// default ignores are listed here
	{
		ignores: ["**/node_modules/", ".git/"],
	},

	...sharedDefaultConfig,
]);

exports.defaultRuleTesterConfig = Object.freeze([
	{ files: ["**"] }, // Make sure the default config matches for all files

	...sharedDefaultConfig,
]);
_&xY/**
 * @fileoverview Flat Config Array
 * @author Nicholas C. Zakas
 */

"use strict";

//-----------------------------------------------------------------------------
// Requirements
//-----------------------------------------------------------------------------

const { ConfigArray, ConfigArraySymbol } = require("@eslint/config-array");
const { flatConfigSchema } = require("./flat-config-schema");
const { defaultConfig } = require("./default-config");
const { Config } = require("./config");

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

/**
 * Fields that are considered metadata and not part of the config object.
 */
const META_FIELDS = new Set(["name", "basePath"]);

/**
 * Wraps a config error with details about where the error occurred.
 * @param {Error} error The original error.
 * @param {number} originalLength The original length of the config array.
 * @param {number} baseLength The length of the base config.
 * @returns {TypeError} The new error with details.
 */
function wrapConfigErrorWithDetails(error, originalLength, baseLength) {
	let location = "user-defined";
	let configIndex = error.index;

	/*
	 * A config array is set up in this order:
	 * 1. Base config
	 * 2. Original configs
	 * 3. User-defined configs
	 * 4. CLI-defined configs
	 *
	 * So we need to adjust the index to account for the base config.
	 *
	 * - If the index is less than the base length, it's in the base config
	 *   (as specified by `baseConfig` argument to `FlatConfigArray` constructor).
	 * - If the index is greater than the base length but less than the original
	 *   length + base length, it's in the original config. The original config
	 *   is passed to the `FlatConfigArray` constructor as the first argument.
	 * - Otherwise, it's in the user-defined config, which is loaded from the
	 *   config file and merged with any command-line options.
	 */
	if (error.index < baseLength) {
		location = "base";
	} else if (error.index < originalLength + baseLength) {
		location = "original";
		configIndex = error.index - baseLength;
	} else {
		configIndex = error.index - originalLength - baseLength;
	}

	return new TypeError(
		`${error.message.slice(0, -1)} at ${location} index ${configIndex}.`,
		{ cause: error },
	);
}

const originalBaseConfig = Symbol("originalBaseConfig");
const originalLength = Symbol("originalLength");
const baseLength = Symbol("baseLength");

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * Represents an array containing configuration information for ESLint.
 */
class FlatConfigArray extends ConfigArray {
	/**
	 * Creates a new instance.
	 * @param {*[]} configs An array of configuration information.
	 * @param {{basePath: string, shouldIgnore: boolean, baseConfig: FlatConfig}} options The options
	 *      to use for the config array instance.
	 */
	constructor(
		configs,
		{ basePath, shouldIgnore = true, baseConfig = defaultConfig } = {},
	) {
		super(configs, {
			basePath,
			schema: flatConfigSchema,
		});

		/**
		 * The original length of the array before any modifications.
		 * @type {number}
		 */
		this[originalLength] = this.length;

		if (baseConfig[Symbol.iterator]) {
			this.unshift(...baseConfig);
		} else {
			this.unshift(baseConfig);
		}

		/**
		 * The length of the array after applying the base config.
		 * @type {number}
		 */
		this[baseLength] = this.length - this[originalLength];

		/**
		 * The base config used to build the config array.
		 * @type {Array<FlatConfig>}
		 */
		this[originalBaseConfig] = baseConfig;
		Object.defineProperty(this, originalBaseConfig, { writable: false });

		/**
		 * Determines if `ignores` fields should be honored.
		 * If true, then all `ignores` fields are honored.
		 * if false, then only `ignores` fields in the baseConfig are honored.
		 * @type {boolean}
		 */
		this.shouldIgnore = shouldIgnore;
		Object.defineProperty(this, "shouldIgnore", { writable: false });
	}

	/**
	 * Normalizes the array by calling the superclass method and catching/rethrowing
	 * any ConfigError exceptions with additional details.
	 * @param {any} [context] The context to use to normalize the array.
	 * @returns {Promise<FlatConfigArray>} A promise that resolves when the array is normalized.
	 */
	normalize(context) {
		return super.normalize(context).catch(error => {
			if (error.name === "ConfigError") {
				throw wrapConfigErrorWithDetails(
					error,
					this[originalLength],
					this[baseLength],
				);
			}

			throw error;
		});
	}

	/**
	 * Normalizes the array by calling the superclass method and catching/rethrowing
	 * any ConfigError exceptions with additional details.
	 * @param {any} [context] The context to use to normalize the array.
	 * @returns {FlatConfigArray} The current instance.
	 * @throws {TypeError} If the config is invalid.
	 */
	normalizeSync(context) {
		try {
			return super.normalizeSync(context);
		} catch (error) {
			if (error.name === "ConfigError") {
				throw wrapConfigErrorWithDetails(
					error,
					this[originalLength],
					this[baseLength],
				);
			}

			throw error;
		}
	}

	/* eslint-disable class-methods-use-this -- Desired as instance method */
	/**
	 * Replaces a config with another config to allow us to put strings
	 * in the config array that will be replaced by objects before
	 * normalization.
	 * @param {Object} config The config to preprocess.
	 * @returns {Object} The preprocessed config.
	 */
	[ConfigArraySymbol.preprocessConfig](config) {
		/*
		 * If a config object has `ignores` and no other non-meta fields, then it's an object
		 * for global ignores. If `shouldIgnore` is false, that object shouldn't apply,
		 * so we'll remove its `ignores`.
		 */
		if (
			!this.shouldIgnore &&
			!this[originalBaseConfig].includes(config) &&
			config.ignores &&
			Object.keys(config).filter(key => !META_FIELDS.has(key)).length ===
				1
		) {
			/* eslint-disable-next-line no-unused-vars -- need to strip off other keys */
			const { ignores, ...otherKeys } = config;

			return otherKeys;
		}

		return config;
	}

	/**
	 * Finalizes the config by replacing plugin references with their objects
	 * and validating rule option schemas.
	 * @param {Object} config The config to finalize.
	 * @returns {Object} The finalized config.
	 * @throws {TypeError} If the config is invalid.
	 */
	[ConfigArraySymbol.finalizeConfig](config) {
		return new Config(config);
	}
	/* eslint-enable class-methods-use-this -- Desired as instance method */
}

exports.FlatConfigArray = FlatConfigArray;
;eڲx>m/**
 * @fileoverview Flat config schema
 * @author Nicholas C. Zakas
 */

"use strict";

//-----------------------------------------------------------------------------
// Requirements
//-----------------------------------------------------------------------------

const { normalizeSeverityToNumber } = require("../shared/severity");

//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------

/**
 * @typedef ObjectPropertySchema
 * @property {Function|string} merge The function or name of the function to call
 *      to merge multiple objects with this property.
 * @property {Function|string} validate The function or name of the function to call
 *      to validate the value of this property.
 */

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

const ruleSeverities = new Map([
	[0, 0],
	["off", 0],
	[1, 1],
	["warn", 1],
	[2, 2],
	["error", 2],
]);

/**
 * Check if a value is a non-null object.
 * @param {any} value The value to check.
 * @returns {boolean} `true` if the value is a non-null object.
 */
function isNonNullObject(value) {
	return typeof value === "object" && value !== null;
}

/**
 * Check if a value is a non-null non-array object.
 * @param {any} value The value to check.
 * @returns {boolean} `true` if the value is a non-null non-array object.
 */
function isNonArrayObject(value) {
	return isNonNullObject(value) && !Array.isArray(value);
}

/**
 * Check if a value is undefined.
 * @param {any} value The value to check.
 * @returns {boolean} `true` if the value is undefined.
 */
function isUndefined(value) {
	return typeof value === "undefined";
}

/**
 * Deeply merges two non-array objects.
 * @param {Object} first The base object.
 * @param {Object} second The overrides object.
 * @param {Map<string, Map<string, Object>>} [mergeMap] Maps the combination of first and second arguments to a merged result.
 * @returns {Object} An object with properties from both first and second.
 */
function deepMerge(first, second, mergeMap = new Map()) {
	let secondMergeMap = mergeMap.get(first);

	if (secondMergeMap) {
		const result = secondMergeMap.get(second);

		if (result) {
			// If this combination of first and second arguments has been already visited, return the previously created result.
			return result;
		}
	} else {
		secondMergeMap = new Map();
		mergeMap.set(first, secondMergeMap);
	}

	/*
	 * First create a result object where properties from the second object
	 * overwrite properties from the first. This sets up a baseline to use
	 * later rather than needing to inspect and change every property
	 * individually.
	 */
	const result = {
		...first,
		...second,
	};

	delete result.__proto__; // eslint-disable-line no-proto -- don't merge own property "__proto__"

	// Store the pending result for this combination of first and second arguments.
	secondMergeMap.set(second, result);

	for (const key of Object.keys(second)) {
		// avoid hairy edge case
		if (
			key === "__proto__" ||
			!Object.prototype.propertyIsEnumerable.call(first, key)
		) {
			continue;
		}

		const firstValue = first[key];
		const secondValue = second[key];

		if (isNonArrayObject(firstValue) && isNonArrayObject(secondValue)) {
			result[key] = deepMerge(firstValue, secondValue, mergeMap);
		} else if (isUndefined(secondValue)) {
			result[key] = firstValue;
		}
	}

	return result;
}

/**
 * Normalizes the rule options config for a given rule by ensuring that
 * it is an array and that the first item is 0, 1, or 2.
 * @param {Array|string|number} ruleOptions The rule options config.
 * @returns {Array} An array of rule options.
 */
function normalizeRuleOptions(ruleOptions) {
	const finalOptions = Array.isArray(ruleOptions)
		? ruleOptions.slice(0)
		: [ruleOptions];

	finalOptions[0] = ruleSeverities.get(finalOptions[0]);
	return structuredClone(finalOptions);
}

/**
 * Determines if an object has any methods.
 * @param {Object} object The object to check.
 * @returns {boolean} `true` if the object has any methods.
 */
function hasMethod(object) {
	for (const key of Object.keys(object)) {
		if (typeof object[key] === "function") {
			return true;
		}
	}

	return false;
}

//-----------------------------------------------------------------------------
// Assertions
//-----------------------------------------------------------------------------

/**
 * The error type when a rule's options are configured with an invalid type.
 */
class InvalidRuleOptionsError extends Error {
	/**
	 * @param {string} ruleId Rule name being configured.
	 * @param {any} value The invalid value.
	 */
	constructor(ruleId, value) {
		super(
			`Key "${ruleId}": Expected severity of "off", 0, "warn", 1, "error", or 2.`,
		);
		this.messageTemplate = "invalid-rule-options";
		this.messageData = { ruleId, value };
	}
}

/**
 * Validates that a value is a valid rule options entry.
 * @param {string} ruleId Rule name being configured.
 * @param {any} value The value to check.
 * @returns {void}
 * @throws {InvalidRuleOptionsError} If the value isn't a valid rule options.
 */
function assertIsRuleOptions(ruleId, value) {
	if (
		typeof value !== "string" &&
		typeof value !== "number" &&
		!Array.isArray(value)
	) {
		throw new InvalidRuleOptionsError(ruleId, value);
	}
}

/**
 * The error type when a rule's severity is invalid.
 */
class InvalidRuleSeverityError extends Error {
	/**
	 * @param {string} ruleId Rule name being configured.
	 * @param {any} value The invalid value.
	 */
	constructor(ruleId, value) {
		super(
			`Key "${ruleId}": Expected severity of "off", 0, "warn", 1, "error", or 2.`,
		);
		this.messageTemplate = "invalid-rule-severity";
		this.messageData = { ruleId, value };
	}
}

/**
 * Validates that a value is valid rule severity.
 * @param {string} ruleId Rule name being configured.
 * @param {any} value The value to check.
 * @returns {void}
 * @throws {InvalidRuleSeverityError} If the value isn't a valid rule severity.
 */
function assertIsRuleSeverity(ruleId, value) {
	const severity = ruleSeverities.get(value);

	if (typeof severity === "undefined") {
		throw new InvalidRuleSeverityError(ruleId, value);
	}
}

/**
 * Validates that a given string matches the "pluginName/memberPlaceholder" pattern.
 * @param {string} value The string to check.
 * @param {string} memberPlaceholder The placeholder for the member portion of the expected format in the error message.
 * @returns {void}
 * @throws {TypeError} If the string doesn't match the expected pattern.
 */
function assertIsPluginMemberName(value, memberPlaceholder) {
	if (!/[\w\-@$]+(?:\/[\w\-$]+)+$/iu.test(value)) {
		throw new TypeError(
			`Expected string in the form "pluginName/${memberPlaceholder}" but found "${value}".`,
		);
	}
}

/**
 * Validates that a value is an object.
 * @param {any} value The value to check.
 * @returns {void}
 * @throws {TypeError} If the value isn't an object.
 */
function assertIsObject(value) {
	if (!isNonNullObject(value)) {
		throw new TypeError("Expected an object.");
	}
}

/**
 * The error type when there's an eslintrc-style options in a flat config.
 */
class IncompatibleKeyError extends Error {
	/**
	 * @param {string} key The invalid key.
	 */
	constructor(key) {
		super(
			"This appears to be in eslintrc format rather than flat config format.",
		);
		this.messageTemplate = "eslintrc-incompat";
		this.messageData = { key };
	}
}

/**
 * The error type when there's an eslintrc-style plugins array found.
 */
class IncompatiblePluginsError extends Error {
	/**
	 * Creates a new instance.
	 * @param {Array<string>} plugins The plugins array.
	 */
	constructor(plugins) {
		super(
			"This appears to be in eslintrc format (array of strings) rather than flat config format (object).",
		);
		this.messageTemplate = "eslintrc-plugins";
		this.messageData = { plugins };
	}
}

//-----------------------------------------------------------------------------
// Low-Level Schemas
//-----------------------------------------------------------------------------

/** @type {ObjectPropertySchema} */
const booleanSchema = {
	merge: "replace",
	validate: "boolean",
};

const ALLOWED_SEVERITIES = new Set(["error", "warn", "off", 2, 1, 0]);

/** @type {ObjectPropertySchema} */
const disableDirectiveSeveritySchema = {
	merge(first, second) {
		const value = second === void 0 ? first : second;

		if (typeof value === "boolean") {
			return value ? "warn" : "off";
		}

		return normalizeSeverityToNumber(value);
	},
	validate(value) {
		if (!(ALLOWED_SEVERITIES.has(value) || typeof value === "boolean")) {
			throw new TypeError(
				'Expected one of: "error", "warn", "off", 0, 1, 2, or a boolean.',
			);
		}
	},
};

/** @type {ObjectPropertySchema} */
const unusedInlineConfigsSeveritySchema = {
	merge(first, second) {
		const value = second === void 0 ? first : second;

		return normalizeSeverityToNumber(value);
	},
	validate(value) {
		if (!ALLOWED_SEVERITIES.has(value)) {
			throw new TypeError(
				'Expected one of: "error", "warn", "off", 0, 1, or 2.',
			);
		}
	},
};

/** @type {ObjectPropertySchema} */
const deepObjectAssignSchema = {
	merge(first = {}, second = {}) {
		return deepMerge(first, second);
	},
	validate: "object",
};

//-----------------------------------------------------------------------------
// High-Level Schemas
//-----------------------------------------------------------------------------

/** @type {ObjectPropertySchema} */
const languageOptionsSchema = {
	merge(first = {}, second = {}) {
		const result = deepMerge(first, second);

		for (const [key, value] of Object.entries(result)) {
			/*
			 * Special case: Because the `parser` property is an object, it should
			 * not be deep merged. Instead, it should be replaced if it exists in
			 * the second object. To make this more generic, we just check for
			 * objects with methods and replace them if they exist in the second
			 * object.
			 */
			if (isNonArrayObject(value)) {
				if (hasMethod(value)) {
					result[key] = second[key] ?? first[key];
					continue;
				}

				// for other objects, make sure we aren't reusing the same object
				result[key] = { ...result[key] };
				continue;
			}
		}

		return result;
	},
	validate: "object",
};

/** @type {ObjectPropertySchema} */
const languageSchema = {
	merge: "replace",
	validate(value) {
		assertIsPluginMemberName(value, "languageName");
	},
};

/** @type {ObjectPropertySchema} */
const pluginsSchema = {
	merge(first = {}, second = {}) {
		const keys = new Set([...Object.keys(first), ...Object.keys(second)]);
		const result = {};

		// manually validate that plugins are not redefined
		for (const key of keys) {
			// avoid hairy edge case
			if (key === "__proto__") {
				continue;
			}

			if (key in first && key in second && first[key] !== second[key]) {
				throw new TypeError(`Cannot redefine plugin "${key}".`);
			}

			result[key] = second[key] || first[key];
		}

		return result;
	},
	validate(value) {
		// first check the value to be sure it's an object
		if (value === null || typeof value !== "object") {
			throw new TypeError("Expected an object.");
		}

		// make sure it's not an array, which would mean eslintrc-style is used
		if (Array.isArray(value)) {
			throw new IncompatiblePluginsError(value);
		}

		// second check the keys to make sure they are objects
		for (const key of Object.keys(value)) {
			// avoid hairy edge case
			if (key === "__proto__") {
				continue;
			}

			if (value[key] === null || typeof value[key] !== "object") {
				throw new TypeError(`Key "${key}": Expected an object.`);
			}
		}
	},
};

/** @type {ObjectPropertySchema} */
const processorSchema = {
	merge: "replace",
	validate(value) {
		if (typeof value === "string") {
			assertIsPluginMemberName(value, "processorName");
		} else if (value && typeof value === "object") {
			if (
				typeof value.preprocess !== "function" ||
				typeof value.postprocess !== "function"
			) {
				throw new TypeError(
					"Object must have a preprocess() and a postprocess() method.",
				);
			}
		} else {
			throw new TypeError("Expected an object or a string.");
		}
	},
};

/** @type {ObjectPropertySchema} */
const rulesSchema = {
	merge(first = {}, second = {}) {
		const result = {
			...first,
			...second,
		};

		for (const ruleId of Object.keys(result)) {
			try {
				// avoid hairy edge case
				if (ruleId === "__proto__") {
					/* eslint-disable-next-line no-proto -- Though deprecated, may still be present */
					delete result.__proto__;
					continue;
				}

				result[ruleId] = normalizeRuleOptions(result[ruleId]);

				/*
				 * If either rule config is missing, then the correct
				 * config is already present and we just need to normalize
				 * the severity.
				 */
				if (!(ruleId in first) || !(ruleId in second)) {
					continue;
				}

				const firstRuleOptions = normalizeRuleOptions(first[ruleId]);
				const secondRuleOptions = normalizeRuleOptions(second[ruleId]);

				/*
				 * If the second rule config only has a severity (length of 1),
				 * then use that severity and keep the rest of the options from
				 * the first rule config.
				 */
				if (secondRuleOptions.length === 1) {
					result[ruleId] = [
						secondRuleOptions[0],
						...firstRuleOptions.slice(1),
					];
					continue;
				}

				/*
				 * In any other situation, then the second rule config takes
				 * precedence. That means the value at `result[ruleId]` is
				 * already correct and no further work is necessary.
				 */
			} catch (ex) {
				throw new Error(`Key "${ruleId}": ${ex.message}`, {
					cause: ex,
				});
			}
		}

		return result;
	},

	validate(value) {
		assertIsObject(value);

		/*
		 * We are not checking the rule schema here because there is no
		 * guarantee that the rule definition is present at this point. Instead
		 * we wait and check the rule schema during the finalization step
		 * of calculating a config.
		 */
		for (const ruleId of Object.keys(value)) {
			// avoid hairy edge case
			if (ruleId === "__proto__") {
				continue;
			}

			const ruleOptions = value[ruleId];

			assertIsRuleOptions(ruleId, ruleOptions);

			if (Array.isArray(ruleOptions)) {
				assertIsRuleSeverity(ruleId, ruleOptions[0]);
			} else {
				assertIsRuleSeverity(ruleId, ruleOptions);
			}
		}
	},
};

/**
 * Creates a schema that always throws an error. Useful for warning
 * about eslintrc-style keys.
 * @param {string} key The eslintrc key to create a schema for.
 * @returns {ObjectPropertySchema} The schema.
 */
function createEslintrcErrorSchema(key) {
	return {
		merge: "replace",
		validate() {
			throw new IncompatibleKeyError(key);
		},
	};
}

const eslintrcKeys = [
	"env",
	"extends",
	"globals",
	"ignorePatterns",
	"noInlineConfig",
	"overrides",
	"parser",
	"parserOptions",
	"reportUnusedDisableDirectives",
	"root",
];

//-----------------------------------------------------------------------------
// Full schema
//-----------------------------------------------------------------------------

const flatConfigSchema = {
	// eslintrc-style keys that should always error
	...Object.fromEntries(
		eslintrcKeys.map(key => [key, createEslintrcErrorSchema(key)]),
	),

	// flat config keys
	settings: deepObjectAssignSchema,
	linterOptions: {
		schema: {
			noInlineConfig: booleanSchema,
			reportUnusedDisableDirectives: disableDirectiveSeveritySchema,
			reportUnusedInlineConfigs: unusedInlineConfigsSeveritySchema,
		},
	},
	language: languageSchema,
	languageOptions: languageOptionsSchema,
	processor: processorSchema,
	plugins: pluginsSchema,
	rules: rulesSchema,
};

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

module.exports = {
	flatConfigSchema,
	hasMethod,
	assertIsRuleSeverity,
};
eP	x d100644 eslint-helpers.js  R5,Vh=i100644 eslint.js Jp /?#\B100644 index.js j@i(qr"0AѪ100644 worker.js p!C~~@2-#й;kxP/**
 * @fileoverview Helper functions for ESLint class
 * @author Nicholas C. Zakas
 */

"use strict";

//-----------------------------------------------------------------------------
// Requirements
//-----------------------------------------------------------------------------

const path = require("node:path");
const fs = require("node:fs");
const { isMainThread, threadId } = require("node:worker_threads");
const fsp = fs.promises;
const isGlob = require("is-glob");
const hash = require("../cli-engine/hash");
const minimatch = require("minimatch");
const globParent = require("glob-parent");
const { Linter } = require("../linter");
const { getShorthandName } = require("../shared/naming");
const { calculateStatsPerFile } = require("../shared/message-counts");
const LintResultCache = require("../cli-engine/lint-result-cache");
const { ConfigLoader } = require("../config/config-loader");
const createDebug = require("debug");
const { SuppressionsService } = require("../services/suppressions-service.js");

//-----------------------------------------------------------------------------
// Fixup references
//-----------------------------------------------------------------------------

const Minimatch = minimatch.Minimatch;
const MINIMATCH_OPTIONS = { dot: true };
const hrtimeBigint = process.hrtime.bigint;

//-----------------------------------------------------------------------------
// Types
//-----------------------------------------------------------------------------

/**
 * @import { ESLintOptions } from "./eslint.js";
 * @import { Config as CalculatedConfig } from "../config/config.js";
 * @import { FlatConfigArray } from "../config/flat-config-array.js";
 * @import { WarningService } from "../services/warning-service.js";
 * @import { Retrier } from "@humanwhocodes/retry";
 */

/** @typedef {import("../types").Linter.Config} Config */
/** @typedef {import("../types").Linter.LintMessage} LintMessage */
/** @typedef {import("../types").ESLint.LintResult} LintResult */
/** @typedef {import("../types").ESLint.Plugin} Plugin */

/**
 * @typedef {Object} GlobSearch
 * @property {Array<string>} patterns The normalized patterns to use for a search.
 * @property {Array<string>} rawPatterns The patterns as entered by the user
 *      before doing any normalization.
 */

//------------------------------------------------------------------------------
// Debug Helpers
//------------------------------------------------------------------------------

// Add %t formatter to print bigint nanosecond times in milliseconds.
createDebug.formatters.t = timeDiff =>
	`${(timeDiff + 500_000n) / 1_000_000n} ms`;

const debug = createDebug(
	`eslint:eslint-helpers${isMainThread ? "" : `:thread-${threadId}`}`,
);

//-----------------------------------------------------------------------------
// Errors
//-----------------------------------------------------------------------------

/**
 * The error type when no files match a glob.
 */
class NoFilesFoundError extends Error {
	/**
	 * @param {string} pattern The glob pattern which was not found.
	 * @param {boolean} globEnabled If `false` then the pattern was a glob pattern, but glob was disabled.
	 */
	constructor(pattern, globEnabled) {
		super(
			`No files matching '${pattern}' were found${!globEnabled ? " (glob was disabled)" : ""}.`,
		);
		this.messageTemplate = "file-not-found";
		this.messageData = { pattern, globDisabled: !globEnabled };
	}
}

/**
 * The error type when a search fails to match multiple patterns.
 */
class UnmatchedSearchPatternsError extends Error {
	/**
	 * @param {Object} options The options for the error.
	 * @param {string} options.basePath The directory that was searched.
	 * @param {Array<string>} options.unmatchedPatterns The glob patterns
	 *      which were not found.
	 * @param {Array<string>} options.patterns The glob patterns that were
	 *      searched.
	 * @param {Array<string>} options.rawPatterns The raw glob patterns that
	 *      were searched.
	 */
	constructor({ basePath, unmatchedPatterns, patterns, rawPatterns }) {
		super(
			`No files matching '${rawPatterns}' in '${basePath}' were found.`,
		);
		this.basePath = basePath;
		this.unmatchedPatterns = unmatchedPatterns;
		this.patterns = patterns;
		this.rawPatterns = rawPatterns;
	}
}

/**
 * The error type when there are files matched by a glob, but all of them have been ignored.
 */
class AllFilesIgnoredError extends Error {
	/**
	 * @param {string} pattern The glob pattern which was not found.
	 */
	constructor(pattern) {
		super(`All files matched by '${pattern}' are ignored.`);
		this.messageTemplate = "all-matched-files-ignored";
		this.messageData = { pattern };
	}
}

//-----------------------------------------------------------------------------
// General Helpers
//-----------------------------------------------------------------------------

/**
 * Check if a given value is a non-empty string or not.
 * @param {any} value The value to check.
 * @returns {boolean} `true` if `value` is a non-empty string.
 */
function isNonEmptyString(value) {
	return typeof value === "string" && value.trim() !== "";
}

/**
 * Check if a given value is an array of non-empty strings or not.
 * @param {any} value The value to check.
 * @returns {boolean} `true` if `value` is an array of non-empty strings.
 */
function isArrayOfNonEmptyString(value) {
	return (
		Array.isArray(value) && !!value.length && value.every(isNonEmptyString)
	);
}

/**
 * Check if a given value is an empty array or an array of non-empty strings.
 * @param {any} value The value to check.
 * @returns {boolean} `true` if `value` is an empty array or an array of non-empty
 *      strings.
 */
function isEmptyArrayOrArrayOfNonEmptyString(value) {
	return Array.isArray(value) && value.every(isNonEmptyString);
}

/**
 * Check if a given value is a positive integer.
 * @param {unknown} value The value to check.
 * @returns {boolean} `true` if `value` is a positive integer.
 */
function isPositiveInteger(value) {
	return Number.isInteger(value) && value > 0;
}

//-----------------------------------------------------------------------------
// File-related Helpers
//-----------------------------------------------------------------------------

/**
 * Normalizes slashes in a file pattern to posix-style.
 * @param {string} pattern The pattern to replace slashes in.
 * @returns {string} The pattern with slashes normalized.
 */
function normalizeToPosix(pattern) {
	return pattern.replace(/\\/gu, "/");
}

/**
 * Check if a string is a glob pattern or not.
 * @param {string} pattern A glob pattern.
 * @returns {boolean} `true` if the string is a glob pattern.
 */
function isGlobPattern(pattern) {
	return isGlob(path.sep === "\\" ? normalizeToPosix(pattern) : pattern);
}

/**
 * Determines if a given glob pattern will return any results.
 * Used primarily to help with useful error messages.
 * @param {Object} options The options for the function.
 * @param {string} options.basePath The directory to search.
 * @param {string} options.pattern An absolute path glob pattern to match.
 * @returns {Promise<boolean>} True if there is a glob match, false if not.
 */
async function globMatch({ basePath, pattern }) {
	let found = false;
	const { hfs } = await import("@humanfs/node");
	const patternToUse = normalizeToPosix(path.relative(basePath, pattern));

	const matcher = new Minimatch(patternToUse, MINIMATCH_OPTIONS);

	const walkSettings = {
		directoryFilter(entry) {
			return !found && matcher.match(entry.path, true);
		},

		entryFilter(entry) {
			if (found || entry.isDirectory) {
				return false;
			}

			if (matcher.match(entry.path)) {
				found = true;
				return true;
			}

			return false;
		},
	};

	if (await hfs.isDirectory(basePath)) {
		return hfs
			.walk(basePath, walkSettings)
			.next()
			.then(() => found);
	}

	return found;
}

/**
 * Searches a directory looking for matching glob patterns. This uses
 * the config array's logic to determine if a directory or file should
 * be ignored, so it is consistent with how ignoring works throughout
 * ESLint.
 * @param {Object} options The options for this function.
 * @param {string} options.basePath The directory to search.
 * @param {Array<string>} options.patterns An array of absolute path glob patterns
 *      to match.
 * @param {Array<string>} options.rawPatterns An array of glob patterns
 *      as the user inputted them. Used for errors.
 * @param {ConfigLoader} options.configLoader The config array to use for
 *      determining what to ignore.
 * @param {boolean} options.errorOnUnmatchedPattern Determines if an error
 *      should be thrown when a pattern is unmatched.
 * @returns {Promise<Array<string>>} An array of matching file paths
 *      or an empty array if there are no matches.
 * @throws {UnmatchedSearchPatternsError} If there is a pattern that doesn't
 *      match any files.
 */
async function globSearch({
	basePath,
	patterns,
	rawPatterns,
	configLoader,
	errorOnUnmatchedPattern,
}) {
	if (patterns.length === 0) {
		return [];
	}

	/*
	 * In this section we are converting the patterns into Minimatch
	 * instances for performance reasons. Because we are doing the same
	 * matches repeatedly, it's best to compile those patterns once and
	 * reuse them multiple times.
	 *
	 * To do that, we convert any patterns with an absolute path into a
	 * relative path and normalize it to Posix-style slashes. We also keep
	 * track of the relative patterns to map them back to the original
	 * patterns, which we need in order to throw an error if there are any
	 * unmatched patterns.
	 */
	const relativeToPatterns = new Map();
	const matchers = patterns.map((pattern, i) => {
		const patternToUse = normalizeToPosix(path.relative(basePath, pattern));

		relativeToPatterns.set(patternToUse, patterns[i]);

		return new Minimatch(patternToUse, MINIMATCH_OPTIONS);
	});

	/*
	 * We track unmatched patterns because we may want to throw an error when
	 * they occur. To start, this set is initialized with all of the patterns.
	 * Every time a match occurs, the pattern is removed from the set, making
	 * it easy to tell if we have any unmatched patterns left at the end of
	 * search.
	 */
	const unmatchedPatterns = new Set([...relativeToPatterns.keys()]);
	const { hfs } = await import("@humanfs/node");

	const walk = hfs.walk(basePath, {
		async directoryFilter(entry) {
			if (!matchers.some(matcher => matcher.match(entry.path, true))) {
				return false;
			}

			const absolutePath = path.resolve(basePath, entry.path);
			const configs =
				await configLoader.loadConfigArrayForDirectory(absolutePath);

			return !configs.isDirectoryIgnored(absolutePath);
		},
		async entryFilter(entry) {
			const absolutePath = path.resolve(basePath, entry.path);

			// entries may be directories or files so filter out directories
			if (entry.isDirectory) {
				return false;
			}

			const configs =
				await configLoader.loadConfigArrayForFile(absolutePath);
			const config = configs.getConfig(absolutePath);

			/*
			 * Optimization: We need to track when patterns are left unmatched
			 * and so we use `unmatchedPatterns` to do that. There is a bit of
			 * complexity here because the same file can be matched by more than
			 * one pattern. So, when we start, we actually need to test every
			 * pattern against every file. Once we know there are no remaining
			 * unmatched patterns, then we can switch to just looking for the
			 * first matching pattern for improved speed.
			 */
			const matchesPattern =
				unmatchedPatterns.size > 0
					? matchers.reduce((previousValue, matcher) => {
							const pathMatches = matcher.match(entry.path);

							/*
							 * We updated the unmatched patterns set only if the path
							 * matches and the file has a config. If the file has no
							 * config, that means there wasn't a match for the
							 * pattern so it should not be removed.
							 *
							 * Performance note: `getConfig()` aggressively caches
							 * results so there is no performance penalty for calling
							 * it multiple times with the same argument.
							 */
							if (pathMatches && config) {
								unmatchedPatterns.delete(matcher.pattern);
							}

							return pathMatches || previousValue;
						}, false)
					: matchers.some(matcher => matcher.match(entry.path));

			return matchesPattern && config !== void 0;
		},
	});

	const filePaths = [];

	if (await hfs.isDirectory(basePath)) {
		for await (const entry of walk) {
			filePaths.push(path.resolve(basePath, entry.path));
		}
	}

	// now check to see if we have any unmatched patterns
	if (errorOnUnmatchedPattern && unmatchedPatterns.size > 0) {
		throw new UnmatchedSearchPatternsError({
			basePath,
			unmatchedPatterns: [...unmatchedPatterns].map(pattern =>
				relativeToPatterns.get(pattern),
			),
			patterns,
			rawPatterns,
		});
	}

	return filePaths;
}

/**
 * Throws an error for unmatched patterns. The error will only contain information about the first one.
 * Checks to see if there are any ignored results for a given search.
 * @param {Object} options The options for this function.
 * @param {string} options.basePath The directory to search.
 * @param {Array<string>} options.patterns An array of glob patterns
 *      that were used in the original search.
 * @param {Array<string>} options.rawPatterns An array of glob patterns
 *      as the user inputted them. Used for errors.
 * @param {Array<string>} options.unmatchedPatterns A non-empty array of absolute path glob patterns
 *      that were unmatched in the original search.
 * @returns {Promise<never>} Always throws an error.
 * @throws {NoFilesFoundError} If the first unmatched pattern
 *      doesn't match any files even when there are no ignores.
 * @throws {AllFilesIgnoredError} If the first unmatched pattern
 *      matches some files when there are no ignores.
 */
async function throwErrorForUnmatchedPatterns({
	basePath,
	patterns,
	rawPatterns,
	unmatchedPatterns,
}) {
	const pattern = unmatchedPatterns[0];
	const rawPattern = rawPatterns[patterns.indexOf(pattern)];

	const patternHasMatch = await globMatch({
		basePath,
		pattern,
	});

	if (patternHasMatch) {
		throw new AllFilesIgnoredError(rawPattern);
	}

	// if we get here there are truly no matches
	throw new NoFilesFoundError(rawPattern, true);
}

/**
 * Performs multiple glob searches in parallel.
 * @param {Object} options The options for this function.
 * @param {Map<string,GlobSearch>} options.searches
 *      A map of absolute path glob patterns to match.
 * @param {ConfigLoader} options.configLoader The config loader to use for
 *      determining what to ignore.
 * @param {boolean} options.errorOnUnmatchedPattern Determines if an
 *      unmatched glob pattern should throw an error.
 * @returns {Promise<Array<string>>} An array of matching file paths
 *      or an empty array if there are no matches.
 */
async function globMultiSearch({
	searches,
	configLoader,
	errorOnUnmatchedPattern,
}) {
	/*
	 * For convenience, we normalized the search map into an array of objects.
	 * Next, we filter out all searches that have no patterns. This happens
	 * primarily for the cwd, which is prepopulated in the searches map as an
	 * optimization. However, if it has no patterns, it means all patterns
	 * occur outside of the cwd and we can safely filter out that search.
	 */
	const normalizedSearches = [...searches]
		.map(([basePath, { patterns, rawPatterns }]) => ({
			basePath,
			patterns,
			rawPatterns,
		}))
		.filter(({ patterns }) => patterns.length > 0);

	const results = await Promise.allSettled(
		normalizedSearches.map(({ basePath, patterns, rawPatterns }) =>
			globSearch({
				basePath,
				patterns,
				rawPatterns,
				configLoader,
				errorOnUnmatchedPattern,
			}),
		),
	);

	/*
	 * The first loop handles errors from the glob searches. Since we can't
	 * use `await` inside `flatMap`, we process errors separately in this loop.
	 * This results in two iterations over `results`, but since the length is
	 * less than or equal to the number of globs and directories passed on the
	 * command line, the performance impact should be minimal.
	 */
	for (let i = 0; i < results.length; i++) {
		const result = results[i];
		const currentSearch = normalizedSearches[i];

		if (result.status === "fulfilled") {
			continue;
		}

		// if we make it here then there was an error
		const error = result.reason;

		// unexpected errors should be re-thrown
		if (!error.basePath) {
			throw error;
		}

		if (errorOnUnmatchedPattern) {
			await throwErrorForUnmatchedPatterns({
				...currentSearch,
				unmatchedPatterns: error.unmatchedPatterns,
			});
		}
	}

	// second loop for `fulfilled` results
	return results.flatMap(result => result.value);
}

/**
 * Finds all files matching the options specified.
 * @param {Object} args The arguments objects.
 * @param {Array<string>} args.patterns An array of glob patterns.
 * @param {boolean} args.globInputPaths true to interpret glob patterns,
 *      false to not interpret glob patterns.
 * @param {string} args.cwd The current working directory to find from.
 * @param {ConfigLoader} args.configLoader The config loader for the current run.
 * @param {boolean} args.errorOnUnmatchedPattern Determines if an unmatched pattern
 *      should throw an error.
 * @returns {Promise<Array<string>>} The fully resolved file paths.
 * @throws {AllFilesIgnoredError} If there are no results due to an ignore pattern.
 * @throws {NoFilesFoundError} If no files matched the given patterns.
 */
async function findFiles({
	patterns,
	globInputPaths,
	cwd,
	configLoader,
	errorOnUnmatchedPattern,
}) {
	const results = [];
	const missingPatterns = [];
	let globbyPatterns = [];
	let rawPatterns = [];
	const searches = new Map([
		[cwd, { patterns: globbyPatterns, rawPatterns: [] }],
	]);

	/*
	 * This part is a bit involved because we need to account for
	 * the different ways that the patterns can match directories.
	 * For each different way, we need to decide if we should look
	 * for a config file or just use the default config. (Directories
	 * without a config file always use the default config.)
	 *
	 * Here are the cases:
	 *
	 * 1. A directory is passed directly (e.g., "subdir"). In this case, we
	 * can assume that the user intends to lint this directory and we should
	 * not look for a config file in the parent directory, because the only
	 * reason to do that would be to ignore this directory (which we already
	 * know we don't want to do). Instead, we use the default config until we
	 * get to the directory that was passed, at which point we start looking
	 * for config files again.
	 *
	 * 2. A dot (".") or star ("*"). In this case, we want to read
	 * the config file in the current directory because the user is
	 * explicitly asking to lint the current directory. Note that "."
	 * will traverse into subdirectories while "*" will not.
	 *
	 * 3. A directory is passed in the form of "subdir/subsubdir".
	 * In this case, we don't want to look for a config file in the
	 * parent directory ("subdir"). We can skip looking for a config
	 * file until `entry.depth` is greater than 1 because there's no
	 * way that the pattern can match `entry.path` yet.
	 *
	 * 4. A directory glob pattern is passed (e.g., "subd*"). We want
	 * this case to act like case 2 because it's unclear whether or not
	 * any particular directory is meant to be traversed.
	 *
	 * 5. A recursive glob pattern is passed (e.g., "**"). We want this
	 * case to act like case 2.
	 */

	// check to see if we have explicit files and directories
	const filePaths = patterns.map(filePath => path.resolve(cwd, filePath));
	const stats = await Promise.all(
		filePaths.map(filePath => fsp.stat(filePath).catch(() => {})),
	);

	const promises = [];
	stats.forEach((stat, index) => {
		const filePath = filePaths[index];
		const pattern = normalizeToPosix(patterns[index]);

		if (stat) {
			// files are added directly to the list
			if (stat.isFile()) {
				results.push(filePath);
				promises.push(configLoader.loadConfigArrayForFile(filePath));
			}

			// directories need extensions attached
			if (stat.isDirectory()) {
				if (!searches.has(filePath)) {
					searches.set(filePath, { patterns: [], rawPatterns: [] });
				}
				({ patterns: globbyPatterns, rawPatterns } =
					searches.get(filePath));

				globbyPatterns.push(`${normalizeToPosix(filePath)}/**`);
				rawPatterns.push(pattern);
			}

			return;
		}

		// save patterns for later use based on whether globs are enabled
		if (globInputPaths && isGlobPattern(pattern)) {
			/*
			 * We are grouping patterns by their glob parent. This is done to
			 * make it easier to determine when a config file should be loaded.
			 */

			const basePath = path.resolve(cwd, globParent(pattern));

			if (!searches.has(basePath)) {
				searches.set(basePath, { patterns: [], rawPatterns: [] });
			}
			({ patterns: globbyPatterns, rawPatterns } =
				searches.get(basePath));

			globbyPatterns.push(filePath);
			rawPatterns.push(pattern);
		} else {
			missingPatterns.push(pattern);
		}
	});

	// there were patterns that didn't match anything, tell the user
	if (errorOnUnmatchedPattern && missingPatterns.length) {
		throw new NoFilesFoundError(missingPatterns[0], globInputPaths);
	}

	// now we are safe to do the search
	promises.push(
		globMultiSearch({
			searches,
			configLoader,
			errorOnUnmatchedPattern,
		}),
	);
	const globbyResults = (await Promise.all(promises)).at(-1);

	return [...new Set([...results, ...globbyResults])];
}

/**
 * Return the absolute path of a file named `"__placeholder__.js"` in a given directory.
 * This is used as a replacement for a missing file path.
 * @param {string} cwd An absolute directory path.
 * @returns {string} The absolute path of a file named `"__placeholder__.js"` in the given directory.
 */
function getPlaceholderPath(cwd) {
	return path.join(cwd, "__placeholder__.js");
}

//-----------------------------------------------------------------------------
// Results-related Helpers
//-----------------------------------------------------------------------------

/**
 * Checks if the given message is an error message.
 * @param {LintMessage} message The message to check.
 * @returns {boolean} Whether or not the message is an error message.
 * @private
 */
function isErrorMessage(message) {
	return message.severity === 2;
}

/**
 * Returns result with warning by ignore settings
 * @param {string} filePath Absolute file path of checked code
 * @param {string} baseDir Absolute path of base directory
 * @param {"ignored"|"external"|"unconfigured"} configStatus A status that determines why the file is ignored
 * @returns {LintResult} Result with single warning
 * @private
 */
function createIgnoreResult(filePath, baseDir, configStatus) {
	let message;

	switch (configStatus) {
		case "external":
			message = "File ignored because outside of base path.";
			break;
		case "unconfigured":
			message =
				"File ignored because no matching configuration was supplied.";
			break;
		default:
			{
				const isInNodeModules =
					baseDir &&
					path
						.dirname(path.relative(baseDir, filePath))
						.split(path.sep)
						.includes("node_modules");

				if (isInNodeModules) {
					message =
						'File ignored by default because it is located under the node_modules directory. Use ignore pattern "!**/node_modules/" to disable file ignore settings or use "--no-warn-ignored" to suppress this warning.';
				} else {
					message =
						'File ignored because of a matching ignore pattern. Use "--no-ignore" to disable file ignore settings or use "--no-warn-ignored" to suppress this warning.';
				}
			}
			break;
	}

	return {
		filePath,
		messages: [
			{
				ruleId: null,
				fatal: false,
				severity: 1,
				message,
			},
		],
		suppressedMessages: [],
		errorCount: 0,
		warningCount: 1,
		fatalErrorCount: 0,
		fixableErrorCount: 0,
		fixableWarningCount: 0,
	};
}

//-----------------------------------------------------------------------------
// Options-related Helpers
//-----------------------------------------------------------------------------

/**
 * Check if a given value is a valid fix type or not.
 * @param {any} x The value to check.
 * @returns {boolean} `true` if `x` is valid fix type.
 */
function isFixType(x) {
	return (
		x === "directive" ||
		x === "problem" ||
		x === "suggestion" ||
		x === "layout"
	);
}

/**
 * Check if a given value is an array of fix types or not.
 * @param {any} x The value to check.
 * @returns {boolean} `true` if `x` is an array of fix types.
 */
function isFixTypeArray(x) {
	return Array.isArray(x) && x.every(isFixType);
}

/**
 * The error for invalid options.
 */
class ESLintInvalidOptionsError extends Error {
	constructor(messages) {
		super(`Invalid Options:\n- ${messages.join("\n- ")}`);
		this.code = "ESLINT_INVALID_OPTIONS";
		Error.captureStackTrace(this, ESLintInvalidOptionsError);
	}
}

/**
 * Validates and normalizes options for the wrapped CLIEngine instance.
 * @param {ESLintOptions} options The options to process.
 * @throws {ESLintInvalidOptionsError} If of any of a variety of type errors.
 * @returns {ESLintOptions} The normalized options.
 */
function processOptions({
	allowInlineConfig = true, // ← we cannot use `overrideConfig.noInlineConfig` instead because `allowInlineConfig` has side-effect that suppress warnings that show inline configs are ignored.
	baseConfig = null,
	cache = false,
	cacheLocation = ".eslintcache",
	cacheStrategy = "metadata",
	concurrency = "off",
	cwd = process.cwd(),
	errorOnUnmatchedPattern = true,
	fix = false,
	fixTypes = null, // ← should be null by default because if it's an array then it suppresses rules that don't have the `meta.type` property.
	flags = [],
	globInputPaths = true,
	ignore = true,
	ignorePatterns = null,
	overrideConfig = null,
	overrideConfigFile = null,
	plugins = {},
	stats = false,
	warnIgnored = true,
	passOnNoPatterns = false,
	ruleFilter = () => true,
	applySuppressions = false,
	suppressionsLocation = SuppressionsService.DEFAULT_SUPPRESSIONS_FILENAME,
	...unknownOptions
}) {
	const errors = [];
	const unknownOptionKeys = Object.keys(unknownOptions);

	if (unknownOptionKeys.length >= 1) {
		errors.push(`Unknown options: ${unknownOptionKeys.join(", ")}`);
		if (unknownOptionKeys.includes("cacheFile")) {
			errors.push(
				"'cacheFile' has been removed. Please use the 'cacheLocation' option instead.",
			);
		}
		if (unknownOptionKeys.includes("configFile")) {
			errors.push(
				"'configFile' has been removed. Please use the 'overrideConfigFile' option instead.",
			);
		}
		if (unknownOptionKeys.includes("envs")) {
			errors.push("'envs' has been removed.");
		}
		if (unknownOptionKeys.includes("extensions")) {
			errors.push("'extensions' has been removed.");
		}
		if (unknownOptionKeys.includes("resolvePluginsRelativeTo")) {
			errors.push("'resolvePluginsRelativeTo' has been removed.");
		}
		if (unknownOptionKeys.includes("globals")) {
			errors.push(
				"'globals' has been removed. Please use the 'overrideConfig.languageOptions.globals' option instead.",
			);
		}
		if (unknownOptionKeys.includes("ignorePath")) {
			errors.push("'ignorePath' has been removed.");
		}
		if (unknownOptionKeys.includes("ignorePattern")) {
			errors.push(
				"'ignorePattern' has been removed. Please use the 'overrideConfig.ignorePatterns' option instead.",
			);
		}
		if (unknownOptionKeys.includes("parser")) {
			errors.push(
				"'parser' has been removed. Please use the 'overrideConfig.languageOptions.parser' option instead.",
			);
		}
		if (unknownOptionKeys.includes("parserOptions")) {
			errors.push(
				"'parserOptions' has been removed. Please use the 'overrideConfig.languageOptions.parserOptions' option instead.",
			);
		}
		if (unknownOptionKeys.includes("rules")) {
			errors.push(
				"'rules' has been removed. Please use the 'overrideConfig.rules' option instead.",
			);
		}
		if (unknownOptionKeys.includes("rulePaths")) {
			errors.push(
				"'rulePaths' has been removed. Please define your rules using plugins.",
			);
		}
		if (unknownOptionKeys.includes("reportUnusedDisableDirectives")) {
			errors.push(
				"'reportUnusedDisableDirectives' has been removed. Please use the 'overrideConfig.linterOptions.reportUnusedDisableDirectives' option instead.",
			);
		}
	}
	if (typeof allowInlineConfig !== "boolean") {
		errors.push("'allowInlineConfig' must be a boolean.");
	}
	if (typeof baseConfig !== "object") {
		errors.push("'baseConfig' must be an object or null.");
	}
	if (typeof cache !== "boolean") {
		errors.push("'cache' must be a boolean.");
	}
	if (!isNonEmptyString(cacheLocation)) {
		errors.push("'cacheLocation' must be a non-empty string.");
	}
	if (cacheStrategy !== "metadata" && cacheStrategy !== "content") {
		errors.push('\'cacheStrategy\' must be any of "metadata", "content".');
	}
	if (
		concurrency !== "off" &&
		concurrency !== "auto" &&
		!isPositiveInteger(concurrency)
	) {
		errors.push(
			'\'concurrency\' must be a positive integer, "auto", or "off".',
		);
	}
	if (!isNonEmptyString(cwd) || !path.isAbsolute(cwd)) {
		errors.push("'cwd' must be an absolute path.");
	}
	if (typeof errorOnUnmatchedPattern !== "boolean") {
		errors.push("'errorOnUnmatchedPattern' must be a boolean.");
	}
	if (typeof fix !== "boolean" && typeof fix !== "function") {
		errors.push("'fix' must be a boolean or a function.");
	}
	if (fixTypes !== null && !isFixTypeArray(fixTypes)) {
		errors.push(
			'\'fixTypes\' must be an array of any of "directive", "problem", "suggestion", and "layout".',
		);
	}
	if (!isEmptyArrayOrArrayOfNonEmptyString(flags)) {
		errors.push("'flags' must be an array of non-empty strings.");
	}
	if (typeof globInputPaths !== "boolean") {
		errors.push("'globInputPaths' must be a boolean.");
	}
	if (typeof ignore !== "boolean") {
		errors.push("'ignore' must be a boolean.");
	}
	if (
		!isEmptyArrayOrArrayOfNonEmptyString(ignorePatterns) &&
		ignorePatterns !== null
	) {
		errors.push(
			"'ignorePatterns' must be an array of non-empty strings or null.",
		);
	}
	if (typeof overrideConfig !== "object") {
		errors.push("'overrideConfig' must be an object or null.");
	}
	if (
		!isNonEmptyString(overrideConfigFile) &&
		overrideConfigFile !== null &&
		overrideConfigFile !== true
	) {
		errors.push(
			"'overrideConfigFile' must be a non-empty string, null, or true.",
		);
	}
	if (typeof passOnNoPatterns !== "boolean") {
		errors.push("'passOnNoPatterns' must be a boolean.");
	}
	if (typeof plugins !== "object") {
		errors.push("'plugins' must be an object or null.");
	} else if (plugins !== null && Object.keys(plugins).includes("")) {
		errors.push("'plugins' must not include an empty string.");
	}
	if (Array.isArray(plugins)) {
		errors.push(
			"'plugins' doesn't add plugins to configuration to load. Please use the 'overrideConfig.plugins' option instead.",
		);
	}
	if (typeof stats !== "boolean") {
		errors.push("'stats' must be a boolean.");
	}
	if (typeof warnIgnored !== "boolean") {
		errors.push("'warnIgnored' must be a boolean.");
	}
	if (typeof ruleFilter !== "function") {
		errors.push("'ruleFilter' must be a function.");
	}
	if (typeof applySuppressions !== "boolean") {
		errors.push("'applySuppressions' must be a boolean.");
	}
	if (!isNonEmptyString(suppressionsLocation)) {
		errors.push("'suppressionsLocation' must be a non-empty string.");
	}
	if (errors.length > 0) {
		throw new ESLintInvalidOptionsError(errors);
	}

	return {
		allowInlineConfig,
		baseConfig,
		cache,
		cacheLocation,
		cacheStrategy,
		concurrency,

		// when overrideConfigFile is true that means don't do config file lookup
		configFile: overrideConfigFile === true ? false : overrideConfigFile,
		overrideConfig,
		cwd: path.normalize(cwd),
		errorOnUnmatchedPattern,
		fix,
		fixTypes,
		flags: [...flags],
		globInputPaths,
		ignore,
		ignorePatterns,
		stats,
		passOnNoPatterns,
		warnIgnored,
		ruleFilter,
		applySuppressions,
		suppressionsLocation,
	};
}

/**
 * Loads ESLint constructor options from an options module.
 * @param {string} optionsURL The URL string of the options module to load.
 * @returns {Promise<ESLintOptions>} ESLint constructor options.
 */
async function loadOptionsFromModule(optionsURL) {
	return (await import(optionsURL)).default;
}

//-----------------------------------------------------------------------------
// Cache-related helpers
//-----------------------------------------------------------------------------

/**
 * return the cacheFile to be used by eslint, based on whether the provided parameter is
 * a directory or looks like a directory (ends in `path.sep`), in which case the file
 * name will be the `cacheFile/.cache_hashOfCWD`
 *
 * if cacheFile points to a file or looks like a file then in will just use that file
 * @param {string} cacheFile The name of file to be used to store the cache
 * @param {string} cwd Current working directory
 * @param {Object} options The options
 * @param {string} [options.prefix] The prefix to use for the cache file
 * @returns {string} the resolved path to the cache file
 */
function getCacheFile(cacheFile, cwd, { prefix = ".cache_" } = {}) {
	/*
	 * make sure the path separators are normalized for the environment/os
	 * keeping the trailing path separator if present
	 */
	const normalizedCacheFile = path.normalize(cacheFile);

	const resolvedCacheFile = path.resolve(cwd, normalizedCacheFile);
	const looksLikeADirectory = normalizedCacheFile.slice(-1) === path.sep;

	/**
	 * return the name for the cache file in case the provided parameter is a directory
	 * @returns {string} the resolved path to the cacheFile
	 */
	function getCacheFileForDirectory() {
		return path.join(resolvedCacheFile, `${prefix}${hash(cwd)}`);
	}

	let fileStats;

	try {
		fileStats = fs.lstatSync(resolvedCacheFile);
	} catch {
		fileStats = null;
	}

	/*
	 * in case the file exists we need to verify if the provided path
	 * is a directory or a file. If it is a directory we want to create a file
	 * inside that directory
	 */
	if (fileStats) {
		/*
		 * is a directory or is a file, but the original file the user provided
		 * looks like a directory but `path.resolve` removed the `last path.sep`
		 * so we need to still treat this like a directory
		 */
		if (fileStats.isDirectory() || looksLikeADirectory) {
			return getCacheFileForDirectory();
		}

		// is file so just use that file
		return resolvedCacheFile;
	}

	/*
	 * here we known the file or directory doesn't exist,
	 * so we will try to infer if its a directory if it looks like a directory
	 * for the current operating system.
	 */

	// if the last character passed is a path separator we assume is a directory
	if (looksLikeADirectory) {
		return getCacheFileForDirectory();
	}

	return resolvedCacheFile;
}

/**
 * Creates a new lint result cache.
 * @param {ESLintOptions} eslintOptions The processed ESLint options.
 * @param {string} cacheFilePath The path to the cache file.
 * @returns {?LintResultCache} A new lint result cache or `null`.
 */
function createLintResultCache({ cache, cacheStrategy }, cacheFilePath) {
	return cache ? new LintResultCache(cacheFilePath, cacheStrategy) : null;
}

//-----------------------------------------------------------------------------
// Lint helpers
//-----------------------------------------------------------------------------

/**
 * Checks whether a message's rule type should be fixed.
 * @param {LintMessage} message The message to check.
 * @param {CalculatedConfig} config The config for the file that generated the message.
 * @param {string[]} fixTypes An array of fix types to check.
 * @returns {boolean} Whether the message should be fixed.
 */
function shouldMessageBeFixed(message, config, fixTypes) {
	if (!message.ruleId) {
		return fixTypes.has("directive");
	}

	const rule = message.ruleId && config.getRuleDefinition(message.ruleId);

	return Boolean(rule && rule.meta && fixTypes.has(rule.meta.type));
}

/**
 * Creates a fixer function based on the provided fix, fixTypesSet, and config.
 * @param {Function|boolean} fix The original fix option.
 * @param {Set<string>} fixTypesSet A set of fix types to filter messages for fixing.
 * @param {CalculatedConfig} config The config for the file that generated the message.
 * @returns {Function|boolean} The fixer function or the original fix value.
 */
function getFixerForFixTypes(fix, fixTypesSet, config) {
	if (!fix || !fixTypesSet) {
		return fix;
	}

	const originalFix = typeof fix === "function" ? fix : () => true;

	return message =>
		shouldMessageBeFixed(message, config, fixTypesSet) &&
		originalFix(message);
}

/**
 * Processes a source code using ESLint.
 * @param {Object} config The config object.
 * @param {string} config.text The source code to verify.
 * @param {string} config.cwd The path to the current working directory.
 * @param {string|undefined} config.filePath The path to the file of `text`. If this is undefined, it uses `<text>`.
 * @param {FlatConfigArray} config.configs The config.
 * @param {boolean} config.fix If `true` then it does fix.
 * @param {boolean} config.allowInlineConfig If `true` then it uses directive comments.
 * @param {Function} config.ruleFilter A predicate function to filter which rules should be run.
 * @param {boolean} config.stats If `true`, then if reports extra statistics with the lint results.
 * @param {Linter} config.linter The linter instance to verify.
 * @returns {LintResult} The result of linting.
 * @private
 */
function verifyText({
	text,
	cwd,
	filePath: providedFilePath,
	configs,
	fix,
	allowInlineConfig,
	ruleFilter,
	stats,
	linter,
}) {
	const startTime = hrtimeBigint();

	const filePath = providedFilePath || "<text>";

	/*
	 * Verify.
	 * `config.extractConfig(filePath)` requires an absolute path, but `linter`
	 * doesn't know CWD, so it gives `linter` an absolute path always.
	 */
	const filePathToVerify =
		filePath === "<text>" ? getPlaceholderPath(cwd) : filePath;
	const { fixed, messages, output } = linter.verifyAndFix(text, configs, {
		allowInlineConfig,
		filename: filePathToVerify,
		fix,
		ruleFilter,
		stats,

		/**
		 * Check if the linter should adopt a given code block or not.
		 * @param {string} blockFilename The virtual filename of a code block.
		 * @returns {boolean} `true` if the linter should adopt the code block.
		 */
		filterCodeBlock(blockFilename) {
			return configs.getConfig(blockFilename) !== void 0;
		},
	});

	// Tweak and return.
	const result = {
		filePath: filePath === "<text>" ? filePath : path.resolve(filePath),
		messages,
		suppressedMessages: linter.getSuppressedMessages(),
		...calculateStatsPerFile(messages),
	};

	if (fixed) {
		result.output = output;
	}

	if (
		result.errorCount + result.warningCount > 0 &&
		typeof result.output === "undefined"
	) {
		result.source = text;
	}

	if (stats) {
		result.stats = {
			times: linter.getTimes(),
			fixPasses: linter.getFixPassCount(),
		};
	}

	const endTime = hrtimeBigint();
	debug('File "%s" linted in %t', filePath, endTime - startTime);

	return result;
}

/**
 * Lints a single file.
 * @param {string} filePath File path to lint.
 * @param {FlatConfigArray} configs The config array for the file.
 * @param {ESLintOptions} eslintOptions The processed ESLint options.
 * @param {Linter} linter The linter instance to use.
 * @param {?LintResultCache} lintResultCache The result cache or `null`.
 * @param {?{ duration: bigint; }} readFileCounter Used to keep track of the time spent reading files.
 * @param {Retrier} [retrier] Used to retry linting on certain errors.
 * @param {AbortController} [controller] Used to stop linting when an error occurs.
 * @returns {Promise<LintResult>} The lint result.
 */
async function lintFile(
	filePath,
	configs,
	eslintOptions,
	linter,
	lintResultCache,
	readFileCounter,
	retrier,
	controller,
) {
	const config = configs.getConfig(filePath);
	const {
		allowInlineConfig,
		cwd,
		fix,
		fixTypes,
		ruleFilter,
		stats,
		warnIgnored,
	} = eslintOptions;
	const fixTypesSet = fixTypes ? new Set(fixTypes) : null;

	/*
	 * If a filename was entered that cannot be matched
	 * to a config, then notify the user.
	 */
	if (!config) {
		if (warnIgnored) {
			const configStatus = configs.getConfigStatus(filePath);

			return createIgnoreResult(filePath, cwd, configStatus);
		}

		return void 0;
	}

	// Skip if there is cached result.
	if (lintResultCache) {
		const cachedResult = lintResultCache.getCachedLintResults(
			filePath,
			config,
		);

		if (cachedResult) {
			const hadMessages =
				cachedResult.messages && cachedResult.messages.length > 0;

			if (hadMessages && fix) {
				debug(`Reprocessing cached file to allow autofix: ${filePath}`);
			} else {
				debug(`Skipping file since it hasn't changed: ${filePath}`);
				return cachedResult;
			}
		}
	}

	// set up fixer for fixTypes if necessary
	const fixer = getFixerForFixTypes(fix, fixTypesSet, config);

	/**
	 * Reads the file and lints its content.
	 * @returns {Promise<LintResult>} A lint result.
	 */
	async function readAndVerifyFile() {
		const readFileEnterTime = hrtimeBigint();
		const text = await fsp.readFile(filePath, {
			encoding: "utf8",
			signal: controller?.signal,
		});
		const readFileExitTime = hrtimeBigint();
		const readFileDuration = readFileExitTime - readFileEnterTime;
		debug('File "%s" read in %t', filePath, readFileDuration);
		if (readFileCounter) {
			readFileCounter.duration += readFileDuration;
		}

		// fail immediately if an error occurred in another file
		controller?.signal.throwIfAborted();

		// do the linting
		return verifyText({
			text,
			filePath,
			configs,
			cwd,
			fix: fixer,
			allowInlineConfig,
			ruleFilter,
			stats,
			linter,
		});
	}

	// Use the retrier if provided, otherwise just call the function.
	const readAndVerifyFilePromise = retrier
		? retrier.retry(readAndVerifyFile, { signal: controller?.signal })
		: readAndVerifyFile();

	return readAndVerifyFilePromise.catch(error => {
		controller?.abort(error);
		throw error;
	});
}

/**
 * Retrieves flags from the environment variable ESLINT_FLAGS.
 * @param {string[]} flags The flags defined via the API.
 * @returns {string[]} The merged flags to use.
 */
function mergeEnvironmentFlags(flags) {
	if (!process.env.ESLINT_FLAGS) {
		return flags;
	}

	const envFlags = process.env.ESLINT_FLAGS.trim().split(/\s*,\s*/gu);
	return Array.from(new Set([...envFlags, ...flags]));
}

/**
 * Creates a new linter instance.
 * @param {ESLintOptions} eslintOptions The processed ESLint options.
 * @param {WarningService} warningService The warning service to use.
 * @returns {Linter} The linter instance.
 */
function createLinter({ cwd, flags }, warningService) {
	return new Linter({
		configType: "flat",
		cwd,
		flags: mergeEnvironmentFlags(flags),
		warningService,
	});
}

/**
 * Creates default configs with the specified plugins.
 * @param {Record<string, Plugin> | undefined} optionPlugins The plugins specified in the ESLint options.
 * @returns {Config[]} The default configs.
 */
function createDefaultConfigs(optionPlugins) {
	const defaultConfigs = [];

	// Add plugins
	if (optionPlugins) {
		const plugins = {};

		for (const [pluginName, plugin] of Object.entries(optionPlugins)) {
			plugins[getShorthandName(pluginName, "eslint-plugin")] = plugin;
		}

		defaultConfigs.push({ plugins });
	}

	return defaultConfigs;
}

/**
 * Creates a config loader.
 * @param {ESLintOptions} eslintOptions The processed ESLint options.
 * @param {Config[]} defaultConfigs The default configs.
 * @param {Linter} linter The linter instance.
 * @param {WarningService} warningService The warning service to use.
 * @returns {ConfigLoader} The config loader.
 */
function createConfigLoader(
	{
		cwd,
		baseConfig,
		overrideConfig,
		configFile,
		ignore: ignoreEnabled,
		ignorePatterns,
	},
	defaultConfigs,
	linter,
	warningService,
) {
	const configLoaderOptions = {
		cwd,
		baseConfig,
		overrideConfig,
		configFile,
		ignoreEnabled,
		ignorePatterns,
		defaultConfigs,
		hasUnstableNativeNodeJsTSConfigFlag: linter.hasFlag(
			"unstable_native_nodejs_ts_config",
		),
		warningService,
	};

	return new ConfigLoader(configLoaderOptions);
}

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

module.exports = {
	createDebug,

	findFiles,

	isNonEmptyString,
	isArrayOfNonEmptyString,

	createIgnoreResult,
	isErrorMessage,
	getPlaceholderPath,

	processOptions,
	loadOptionsFromModule,

	getCacheFile,
	createLintResultCache,

	getFixerForFixTypes,
	verifyText,
	lintFile,
	createLinter,
	createDefaultConfigs,
	createConfigLoader,
};
NLPx
]/**
 * @fileoverview Main class using flat config
 * @author Nicholas C. Zakas
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const { existsSync } = require("node:fs");
const fs = require("node:fs/promises");
const os = require("node:os");
const path = require("node:path");
const { pathToFileURL } = require("node:url");
const { SHARE_ENV, Worker } = require("node:worker_threads");
const { version } = require("../../package.json");
const { defaultConfig } = require("../config/default-config");
const timing = require("../linter/timing");

const {
	createDebug,

	findFiles,
	getCacheFile,

	isNonEmptyString,
	isArrayOfNonEmptyString,

	createIgnoreResult,
	isErrorMessage,
	getPlaceholderPath,

	processOptions,
	loadOptionsFromModule,

	getFixerForFixTypes,
	verifyText,
	lintFile,
	createLinter,
	createLintResultCache,
	createDefaultConfigs,
	createConfigLoader,
} = require("./eslint-helpers");
const { Retrier } = require("@humanwhocodes/retry");
const { ConfigLoader } = require("../config/config-loader");
const { WarningService } = require("../services/warning-service");
const { SuppressionsService } = require("../services/suppressions-service");
const { Config } = require("../config/config.js");
const {
	getShorthandName,
	getNamespaceFromTerm,
	normalizePackageName,
} = require("../shared/naming.js");
const { resolve } = require("../shared/relative-module-resolver.js");

//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------

// For VSCode IntelliSense
/**
 * @import { Config as CalculatedConfig } from "../config/config.js";
 * @import { FlatConfigArray } from "../config/flat-config-array.js";
 * @import { RuleDefinition, RulesMeta } from "@eslint/core";
 * @import { WorkerLintResults } from "./worker.js";
 */

/** @typedef {import("../types").Linter.Config} Config */
/** @typedef {import("../types").ESLint.DeprecatedRuleUse} DeprecatedRuleInfo */
/** @typedef {import("../types").ESLint.Options} ESLintOptions */
/** @typedef {import("../types").ESLint.LintResult} LintResult */
/** @typedef {import("../types").ESLint.Plugin} Plugin */
/** @typedef {import("../types").ESLint.ResultsMeta} ResultsMeta */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const hrtimeBigint = process.hrtime.bigint;

const debug = createDebug("eslint:eslint");
const privateMembers = new WeakMap();
const removedFormatters = new Set([
	"checkstyle",
	"codeframe",
	"compact",
	"jslint-xml",
	"junit",
	"table",
	"tap",
	"unix",
	"visualstudio",
]);
const fileRetryCodes = new Set(["ENFILE", "EMFILE"]);

/**
 * Create rulesMeta object.
 * @param {Map<string, RuleDefinition>} rules a map of rules from which to generate the object.
 * @returns {Record<string, RulesMeta>} metadata for all enabled rules.
 */
function createRulesMeta(rules) {
	return Array.from(rules).reduce((retVal, [id, rule]) => {
		retVal[id] = rule.meta;
		return retVal;
	}, {});
}

/**
 * Gets the replacement rule names from a deprecated rule's metadata.
 * @param {RulesMeta} meta The rule metadata.
 * @returns {string[]} Replacement rule names.
 */
function getDeprecatedRuleReplacements(meta) {
	if (typeof meta.deprecated !== "object") {
		return meta.replacedBy || [];
	}

	const { replacedBy } = meta.deprecated;

	if (!Array.isArray(replacedBy)) {
		return [];
	}

	return replacedBy.map(replacement => {
		if (typeof replacement !== "object" || replacement === null) {
			return "";
		}

		const pluginName = replacement.plugin?.name;
		const ruleName = replacement.rule?.name;

		return `${typeof pluginName === "string" ? `${getShorthandName(pluginName, "eslint-plugin")}/` : ""}${typeof ruleName === "string" ? ruleName : ""}`;
	});
}

/** @type {WeakMap<CalculatedConfig, DeprecatedRuleInfo[]>} */
const usedDeprecatedRulesCache = new WeakMap();

/**
 * Create used deprecated rule list.
 * @param {ESLint} eslint The ESLint instance.
 * @param {string} maybeFilePath The absolute path to a lint target file or `"<text>"`.
 * @returns {DeprecatedRuleInfo[]} The used deprecated rule list.
 */
function getOrFindUsedDeprecatedRules(eslint, maybeFilePath) {
	const {
		options: { cwd },
		configLoader,
	} = privateMembers.get(eslint);
	const filePath = path.isAbsolute(maybeFilePath)
		? maybeFilePath
		: getPlaceholderPath(cwd);
	const configs = configLoader.getCachedConfigArrayForFile(filePath);
	const config = configs.getConfig(filePath);

	// Most files use the same config, so cache it.
	if (config && !usedDeprecatedRulesCache.has(config)) {
		const retv = [];

		if (config.rules) {
			for (const [ruleId, ruleConf] of Object.entries(config.rules)) {
				if (Config.getRuleNumericSeverity(ruleConf) === 0) {
					continue;
				}
				const rule = config.getRuleDefinition(ruleId);
				const meta = rule && rule.meta;

				if (meta && meta.deprecated) {
					const usesNewFormat = typeof meta.deprecated === "object";

					retv.push({
						ruleId,
						replacedBy: getDeprecatedRuleReplacements(meta),
						info: usesNewFormat ? meta.deprecated : void 0,
					});
				}
			}
		}

		usedDeprecatedRulesCache.set(config, Object.freeze(retv));
	}

	return config ? usedDeprecatedRulesCache.get(config) : Object.freeze([]);
}

/**
 * Processes the linting results generated by a CLIEngine linting report to
 * match the ESLint class's API.
 * @param {ESLint} eslint The ESLint instance.
 * @param {LintResult[]} results The linting results to process.
 * @returns {LintResult[]} The processed linting results.
 */
function processLintReport(eslint, results) {
	const descriptor = {
		configurable: true,
		enumerable: true,
		get() {
			return getOrFindUsedDeprecatedRules(eslint, this.filePath);
		},
	};

	for (const result of results) {
		Object.defineProperty(result, "usedDeprecatedRules", descriptor);
	}

	return results;
}

/**
 * An Array.prototype.sort() compatible compare function to order results by their file path.
 * @param {LintResult} a The first lint result.
 * @param {LintResult} b The second lint result.
 * @returns {number} An integer representing the order in which the two results should occur.
 */
function compareResultsByFilePath(a, b) {
	if (a.filePath < b.filePath) {
		return -1;
	}

	if (a.filePath > b.filePath) {
		return 1;
	}

	return 0;
}

/**
 * Determines which config file to use. This is determined by seeing if an
 * override config file was passed, and if so, using it; otherwise, as long
 * as override config file is not explicitly set to `false`, it will search
 * upwards from the cwd for a file named `eslint.config.js`.
 *
 * This function is used primarily by the `--inspect-config` option. For now,
 * we will maintain the existing behavior, which is to search up from the cwd.
 * @param {{ configFile: string | undefined; cwd: string; }} options Config file location options.
 * @returns {Promise<{configFilePath:string|undefined;basePath:string}>} Location information for
 *      the config file.
 */
async function locateConfigFileToUse({ configFile, cwd }) {
	const configLoader = new ConfigLoader({
		cwd,
		configFile,
	});

	const configFilePath = await configLoader.findConfigFileForPath(
		path.join(cwd, "__placeholder__.js"),
	);

	if (!configFilePath) {
		throw new Error("No ESLint configuration file was found.");
	}

	return {
		configFilePath,
		basePath: configFile ? cwd : path.dirname(configFilePath),
	};
}

/**
 * Creates an error to be thrown when an array of results passed to `getRulesMetaForResults` was not created by the current engine.
 * @param {Error|undefined} cause The original error that led to this symptom error being thrown. Might not always be available.
 * @returns {TypeError} An error object.
 */
function createExtraneousResultsError(cause) {
	return new TypeError(
		"Results object was not created from this ESLint instance.",
		{
			cause,
		},
	);
}

/**
 * Maximum number of files assumed to be best handled by one worker thread.
 * This value is a heuristic estimation that can be adjusted if required.
 */
const AUTO_FILES_PER_WORKER = 50;

/**
 * Calculates the number of worker threads to run for "auto" concurrency depending on the number of
 * files that need to be processed.
 *
 * The number of worker threads is calculated as the number of files that need to be processed
 * (`processableFileCount`) divided by the number of files assumed to be best handled by one worker
 * thread (`AUTO_FILES_PER_WORKER`), rounded up to the next integer.
 * Two adjustments are made to this calculation: first, the number of workers is capped at half the
 * number of available CPU cores (`maxWorkers`); second, a value of 1 is converted to 0.
 * The following table shows the relationship between the number of files to be processed and the
 * number of workers:
 *
 * Files to be processed                                              | Workers
 * -------------------------------------------------------------------|-----------------
 * 0                                                                  | 0
 * 1, 2, …, AUTO_FILES_PER_WORKER                                     | 0 (there's no 1)
 * AUTO_FILES_PER_WORKER + 1, …, AUTO_FILES_PER_WORKER * 2            | 2
 * AUTO_FILES_PER_WORKER * 2 + 1, …, AUTO_FILES_PER_WORKER * 3        | 3
 * ⋯                                                                  | ⋯
 * AUTO_FILES_PER_WORKER * (𝑛 - 1) + 1, …, AUTO_FILES_PER_WORKER * 𝑛  | 𝑛
 * ⋯                                                                  | ⋯
 * AUTO_FILES_PER_WORKER * (maxWorkers - 1) + 1, …                    | maxWorkers
 *
 * The number of files to be processed should be determined by the calling function.
 * @param {number} processableFileCount The number of files that need to be processed.
 * @param {number} maxWorkers The maximum number of workers to run.
 * @returns {number} The number of worker threads to run.
 */
function getWorkerCountFor(processableFileCount, maxWorkers) {
	let workerCount = Math.ceil(processableFileCount / AUTO_FILES_PER_WORKER);
	if (workerCount > maxWorkers) {
		workerCount = maxWorkers;
	}
	if (workerCount <= 1) {
		workerCount = 0;
	}
	return workerCount;
}

/**
 * Returns true if a file has no valid cached results or if it needs to be reprocessed because there are violations that may need fixing.
 * This function will access the filesystem.
 * @param {LintResultCache} lintResultCache The lint result cache.
 * @param {boolean} fix The fix option.
 * @param {string} filePath The file for which to retrieve lint results.
 * @param {Config} config The config of the file.
 * @returns {boolean} True if the file needs to be reprocessed.
 */
function needsReprocessing(lintResultCache, fix, filePath, config) {
	const results = lintResultCache.getValidCachedLintResults(filePath, config);

	// This reflects the reprocessing logic of the `lintFile` helper function.
	return !results || (fix && results.messages && results.messages.length > 0);
}

/**
 * Calculates the number of worker threads to run for "auto" concurrency.
 *
 * The number of worker threads depends on the number files that need to be processed.
 * Typically, this includes all non-ignored files.
 * In a cached run with "metadata" strategy, files with a valid cached result aren't counted.
 * @param {ESLint} eslint ESLint instance.
 * @param {string[]} filePaths File paths to lint.
 * @param {number} maxWorkers The maximum number of workers to run.
 * @returns {number} The number of worker threads to run for "auto" concurrency.
 */
function calculateAutoWorkerCount(eslint, filePaths, maxWorkers) {
	const startTime = hrtimeBigint();
	const {
		configLoader,
		lintResultCache,
		options: { cacheStrategy, fix },
	} = privateMembers.get(eslint);
	/** True if cache is not used or if strategy is "content". */
	const countAllMatched = !lintResultCache || cacheStrategy === "content";

	let processableFileCount = 0;
	let remainingFiles = filePaths.length;

	/** The number of workers if none of the remaining files were to be counted. */
	let lowWorkerCount = 0;

	/*
	 * Rather than counting all files to be processed in advance, we stop iterating as soon as we reach
	 * a point where adding more files doesn't change the number of workers anymore.
	 */
	for (const filePath of filePaths) {
		/** The number of workers if all of the remaining files were to be counted. */
		const highWorkerCount = getWorkerCountFor(
			processableFileCount + remainingFiles,
			maxWorkers,
		);
		if (lowWorkerCount >= highWorkerCount) {
			// The highest possible number of workers has been reached, so stop counting.
			break;
		}
		remainingFiles--;
		const configs = configLoader.getCachedConfigArrayForFile(filePath);
		const config = configs.getConfig(filePath);
		if (!config) {
			// file is ignored
			continue;
		}
		if (
			countAllMatched ||
			needsReprocessing(lintResultCache, fix, filePath, config)
		) {
			processableFileCount++;
			lowWorkerCount = getWorkerCountFor(
				processableFileCount,
				maxWorkers,
			);
		}
	}
	debug(
		"%d file(s) to process counted in %t",
		processableFileCount,
		hrtimeBigint() - startTime,
	);
	return lowWorkerCount;
}

/**
 * Calculates the number of workers to run based on the concurrency setting and the number of files to lint.
 * @param {ESLint} eslint The ESLint instance.
 * @param {string[]} filePaths File paths to lint.
 * @param {{ availableParallelism: () => number }} [os] Node.js `os` module, or a mock for testing.
 * @returns {number} The effective number of worker threads to be started. A value of zero disables multithread linting.
 */
function calculateWorkerCount(
	eslint,
	filePaths,
	{ availableParallelism } = os,
) {
	const { concurrency } = privateMembers.get(eslint).options;
	switch (concurrency) {
		case "off":
			return 0;
		case "auto": {
			const maxWorkers = availableParallelism() >> 1;
			return calculateAutoWorkerCount(eslint, filePaths, maxWorkers);
		}
		default: {
			const workerCount = Math.min(concurrency, filePaths.length);
			return workerCount > 1 ? workerCount : 0;
		}
	}
}

// Used internally. Do not expose.
const disableCloneabilityCheck = Symbol(
	"Do not check for uncloneable options.",
);

/**
 * The smallest net linting ratio that doesn't trigger a poor concurrency warning.
 * The net linting ratio is defined as the net linting duration divided by the thread's total runtime,
 * where the net linting duration is the total linting time minus the time spent on I/O-intensive operations:
 * **Net Linting Ratio** = (**Linting Time** – **I/O Time**) / **Thread Runtime**.
 * - **Linting Time**: Total time spent linting files
 * - **I/O Time**: Portion of linting time spent loading configs and reading files
 * - **Thread Runtime**: End-to-end execution time of the thread
 *
 * This value is a heuristic estimation that can be adjusted if required.
 */
const LOW_NET_LINTING_RATIO = 0.7;

/**
 * Runs worker threads to lint files.
 * @param {string[]} filePaths File paths to lint.
 * @param {number} workerCount The number of worker threads to run.
 * @param {ESLintOptions | string} eslintOptionsOrURL The unprocessed ESLint options or the URL of the options module.
 * @param {() => void} warnOnLowNetLintingRatio A function to call if the net linting ratio is low.
 * @returns {Promise<LintResult[]>} Lint results.
 */
async function runWorkers(
	filePaths,
	workerCount,
	eslintOptionsOrURL,
	warnOnLowNetLintingRatio,
) {
	const fileCount = filePaths.length;
	const results = Array(fileCount);
	const workerURL = pathToFileURL(path.join(__dirname, "./worker.js"));
	const filePathIndexArray = new Uint32Array(
		new SharedArrayBuffer(Uint32Array.BYTES_PER_ELEMENT),
	);
	const abortController = new AbortController();
	const abortSignal = abortController.signal;
	const workerOptions = {
		env: SHARE_ENV,
		workerData: {
			eslintOptionsOrURL,
			filePathIndexArray,
			filePaths,
		},
	};

	let worstNetLintingRatio = 1;

	/**
	 * A promise executor function that starts a worker thread on each invocation.
	 * @param {() => void} resolve_ Called when the worker thread terminates successfully.
	 * @param {(error: Error) => void} reject Called when the worker thread terminates with an error.
	 * @returns {void}
	 */
	function workerExecutor(resolve_, reject) {
		const workerStartTime = hrtimeBigint();
		const worker = new Worker(workerURL, workerOptions);
		worker.once(
			"message",
			(/** @type {WorkerLintResults} */ indexedResults) => {
				const workerDuration = hrtimeBigint() - workerStartTime;

				// The net linting ratio provides an approximate measure of worker thread efficiency, defined as the net linting duration divided by the thread's total runtime.
				const netLintingRatio =
					Number(indexedResults.netLintingDuration) /
					Number(workerDuration);

				worstNetLintingRatio = Math.min(
					worstNetLintingRatio,
					netLintingRatio,
				);

				if (timing.enabled && indexedResults.timings) {
					timing.mergeData(indexedResults.timings);
				}

				for (const result of indexedResults) {
					const { index } = result;
					delete result.index;
					results[index] = result;
				}
				resolve_();
			},
		);
		worker.once("error", error => {
			abortController.abort(error);
			reject(error);
		});
		abortSignal.addEventListener("abort", () => worker.terminate());
	}

	const promises = Array(workerCount);
	for (let index = 0; index < workerCount; ++index) {
		promises[index] = new Promise(workerExecutor);
	}

	try {
		await Promise.all(promises);
	} catch (error) {
		/*
		 * If any worker fails, suppress timing display in the main thread
		 * to avoid printing partial or misleading timing output.
		 */
		timing.disableDisplay();
		throw error;
	}

	if (worstNetLintingRatio < LOW_NET_LINTING_RATIO) {
		warnOnLowNetLintingRatio();
	}

	return results;
}

/**
 * Lint files in multithread mode.
 * @param {ESLint} eslint ESLint instance.
 * @param {string[]} filePaths File paths to lint.
 * @param {number} workerCount The number of worker threads to run.
 * @param {ESLintOptions | string} eslintOptionsOrURL The unprocessed ESLint options or the URL of the options module.
 * @param {() => void} warnOnLowNetLintingRatio A function to call if the net linting ratio is low.
 * @returns {Promise<LintResult[]>} Lint results.
 */
async function lintFilesWithMultithreading(
	eslint,
	filePaths,
	workerCount,
	eslintOptionsOrURL,
	warnOnLowNetLintingRatio,
) {
	const { configLoader, lintResultCache } = privateMembers.get(eslint);

	const results = await runWorkers(
		filePaths,
		workerCount,
		eslintOptionsOrURL,
		warnOnLowNetLintingRatio,
	);
	// Persist the cache to disk.
	if (lintResultCache) {
		results.forEach((result, index) => {
			if (result) {
				const filePath = filePaths[index];
				const configs =
					configLoader.getCachedConfigArrayForFile(filePath);
				const config = configs.getConfig(filePath);

				if (config) {
					/*
					 * Store the lint result in the LintResultCache.
					 * NOTE: The LintResultCache will remove the file source and any
					 * other properties that are difficult to serialize, and will
					 * hydrate those properties back in on future lint runs.
					 */
					lintResultCache.setCachedLintResults(
						filePath,
						config,
						result,
					);
				}
			}
		});
	}
	return results;
}

/**
 * Lint files in single-thread mode.
 * @param {ESLint} eslint ESLint instance.
 * @param {string[]} filePaths File paths to lint.
 * @returns {Promise<LintResult[]>} Lint results.
 */
async function lintFilesWithoutMultithreading(eslint, filePaths) {
	const {
		configLoader,
		linter,
		lintResultCache,
		options: eslintOptions,
	} = privateMembers.get(eslint);

	const controller = new AbortController();
	const retrier = new Retrier(error => fileRetryCodes.has(error.code), {
		concurrency: 100,
	});

	/*
	 * Because we need to process multiple files, including reading from disk,
	 * it is most efficient to start by reading each file via promises so that
	 * they can be done in parallel. Then, we can lint the returned text. This
	 * ensures we are waiting the minimum amount of time in between lints.
	 */
	const results = await Promise.all(
		filePaths.map(async filePath => {
			const configs = configLoader.getCachedConfigArrayForFile(filePath);
			const config = configs.getConfig(filePath);

			const result = await lintFile(
				filePath,
				configs,
				eslintOptions,
				linter,
				lintResultCache,
				null,
				retrier,
				controller,
			);

			if (config) {
				/*
				 * Store the lint result in the LintResultCache.
				 * NOTE: The LintResultCache will remove the file source and any
				 * other properties that are difficult to serialize, and will
				 * hydrate those properties back in on future lint runs.
				 */
				lintResultCache?.setCachedLintResults(filePath, config, result);
			}

			return result;
		}),
	);
	return results;
}

/**
 * Throws an error if the given options are not cloneable.
 * @param {ESLintOptions} options The options to check.
 * @returns {void}
 * @throws {TypeError} If the options are not cloneable.
 */
function validateOptionCloneability(options) {
	try {
		structuredClone(options);
		return;
	} catch {
		// continue
	}
	const uncloneableOptionKeys = Object.keys(options)
		.filter(key => {
			try {
				structuredClone(options[key]);
			} catch {
				return true;
			}
			return false;
		})
		.sort();
	const error = new TypeError(
		`The ${uncloneableOptionKeys.length === 1 ? "option" : "options"} ${new Intl.ListFormat("en-US").format(uncloneableOptionKeys.map(key => `"${key}"`))} cannot be cloned. When concurrency is enabled, all options must be cloneable values (JSON values). Remove uncloneable options or use an options module.`,
	);
	error.code = "ESLINT_UNCLONEABLE_OPTIONS";
	throw error;
}

//-----------------------------------------------------------------------------
// Main API
//-----------------------------------------------------------------------------

/**
 * Primary Node.js API for ESLint.
 */
class ESLint {
	/**
	 * The type of configuration used by this class.
	 * @type {string}
	 */
	static configType = "flat";

	/**
	 * The loader to use for finding config files.
	 * @type {ConfigLoader}
	 */
	#configLoader;

	/**
	 * The unprocessed options or the URL of the options module. Only set when concurrency is enabled.
	 * @type {ESLintOptions | string | undefined}
	 */
	#optionsOrURL;

	/**
	 * Creates a new instance of the main ESLint API.
	 * @param {ESLintOptions} options The options for this instance.
	 */
	constructor(options = {}) {
		const processedOptions = processOptions(options);
		if (
			!options[disableCloneabilityCheck] &&
			processedOptions.concurrency !== "off"
		) {
			validateOptionCloneability(options);

			// Save the unprocessed options in an instance field to pass to worker threads in `lintFiles()`.
			this.#optionsOrURL = options;
		}
		const warningService = new WarningService();
		const linter = createLinter(processedOptions, warningService);

		const cacheFilePath = getCacheFile(
			processedOptions.cacheLocation,
			processedOptions.cwd,
		);

		const lintResultCache = createLintResultCache(
			processedOptions,
			cacheFilePath,
		);

		let suppressionsService = null;
		if (processedOptions.applySuppressions) {
			const suppressionsFilePath = getCacheFile(
				processedOptions.suppressionsLocation,
				processedOptions.cwd,
				{ prefix: "suppressions_" },
			);
			suppressionsService = new SuppressionsService({
				filePath: suppressionsFilePath,
				cwd: processedOptions.cwd,
			});
		}

		const defaultConfigs = createDefaultConfigs(options.plugins);

		this.#configLoader = createConfigLoader(
			processedOptions,
			defaultConfigs,
			linter,
			warningService,
		);

		debug(`Using config loader ${this.#configLoader.constructor.name}`);

		privateMembers.set(this, {
			options: processedOptions,
			linter,
			cacheFilePath,
			lintResultCache,
			defaultConfigs,
			configs: null,
			configLoader: this.#configLoader,
			warningService,
			suppressionsService,
		});

		// Check for the .eslintignore file, and warn if it's present.
		if (existsSync(path.resolve(processedOptions.cwd, ".eslintignore"))) {
			warningService.emitESLintIgnoreWarning();
		}
	}

	/**
	 * The version text.
	 * @type {string}
	 */
	static get version() {
		return version;
	}

	/**
	 * The default configuration that ESLint uses internally. This is provided for tooling that wants to calculate configurations using the same defaults as ESLint.
	 * Keep in mind that the default configuration may change from version to version, so you shouldn't rely on any particular keys or values to be present.
	 * @type {FlatConfigArray}
	 */
	static get defaultConfig() {
		return defaultConfig;
	}

	/**
	 * Outputs fixes from the given results to files.
	 * @param {LintResult[]} results The lint results.
	 * @returns {Promise<void>} Returns a promise that is used to track side effects.
	 */
	static async outputFixes(results) {
		if (!Array.isArray(results)) {
			throw new Error("'results' must be an array");
		}

		const retrier = new Retrier(error => fileRetryCodes.has(error.code), {
			concurrency: 100,
		});

		await Promise.all(
			results
				.filter(result => {
					if (typeof result !== "object" || result === null) {
						throw new Error("'results' must include only objects");
					}
					return (
						typeof result.output === "string" &&
						path.isAbsolute(result.filePath)
					);
				})
				.map(r =>
					retrier.retry(() => fs.writeFile(r.filePath, r.output)),
				),
		);
	}

	/**
	 * Returns results that only contains errors.
	 * @param {LintResult[]} results The results to filter.
	 * @returns {LintResult[]} The filtered results.
	 */
	static getErrorResults(results) {
		const filtered = [];

		results.forEach(result => {
			const filteredMessages = result.messages.filter(isErrorMessage);
			const filteredSuppressedMessages =
				result.suppressedMessages.filter(isErrorMessage);

			if (filteredMessages.length > 0) {
				filtered.push({
					...result,
					messages: filteredMessages,
					suppressedMessages: filteredSuppressedMessages,
					errorCount: filteredMessages.length,
					warningCount: 0,
					fixableErrorCount: result.fixableErrorCount,
					fixableWarningCount: 0,
				});
			}
		});

		return filtered;
	}

	/**
	 * Creates a new ESLint instance using options loaded from a module.
	 * @param {URL} optionsURL The URL of the options module.
	 * @returns {ESLint} The new ESLint instance.
	 */
	static async fromOptionsModule(optionsURL) {
		if (!(optionsURL instanceof URL)) {
			throw new TypeError("Argument must be a URL object");
		}
		const optionsURLString = optionsURL.href;
		const loadedOptions = await loadOptionsFromModule(optionsURLString);
		const options = { ...loadedOptions, [disableCloneabilityCheck]: true };
		const eslint = new ESLint(options);

		if (options.concurrency !== "off") {
			// Save the options module URL in an instance field to pass to worker threads in `lintFiles()`.
			eslint.#optionsOrURL = optionsURLString;
		}
		return eslint;
	}

	/**
	 * Returns meta objects for each rule represented in the lint results.
	 * @param {LintResult[]} results The results to fetch rules meta for.
	 * @returns {Record<string, RulesMeta>} A mapping of ruleIds to rule meta objects.
	 * @throws {TypeError} When the results object wasn't created from this ESLint instance.
	 * @throws {TypeError} When a plugin or rule is missing.
	 */
	getRulesMetaForResults(results) {
		// short-circuit simple case
		if (results.length === 0) {
			return {};
		}

		const resultRules = new Map();
		const {
			configLoader,
			options: { cwd },
		} = privateMembers.get(this);

		for (const result of results) {
			/*
			 * Normalize filename for <text>.
			 */
			const filePath =
				result.filePath === "<text>"
					? getPlaceholderPath(cwd)
					: result.filePath;
			const allMessages = result.messages.concat(
				result.suppressedMessages,
			);

			for (const { ruleId } of allMessages) {
				if (!ruleId) {
					continue;
				}

				/*
				 * All of the plugin and rule information is contained within the
				 * calculated config for the given file.
				 */
				let configs;

				try {
					configs =
						configLoader.getCachedConfigArrayForFile(filePath);
				} catch (err) {
					throw createExtraneousResultsError(err);
				}

				const config = configs.getConfig(filePath);

				if (!config) {
					throw createExtraneousResultsError();
				}
				const rule = config.getRuleDefinition(ruleId);

				// ignore unknown rules
				if (rule) {
					resultRules.set(ruleId, rule);
				}
			}
		}

		return createRulesMeta(resultRules);
	}

	/**
	 * Indicates if the given feature flag is enabled for this instance.
	 * @param {string} flag The feature flag to check.
	 * @returns {boolean} `true` if the feature flag is enabled, `false` if not.
	 */
	hasFlag(flag) {
		// note: Linter does validation of the flags
		return privateMembers.get(this).linter.hasFlag(flag);
	}

	/**
	 * Executes the current configuration on an array of file and directory names.
	 * @param {string|string[]} patterns An array of file and directory names.
	 * @returns {Promise<LintResult[]>} The results of linting the file patterns given.
	 */
	async lintFiles(patterns) {
		let normalizedPatterns = patterns;
		const {
			cacheFilePath,
			lintResultCache,
			options: eslintOptions,
			warningService,
			suppressionsService,
		} = privateMembers.get(this);

		/*
		 * Special cases:
		 * 1. `patterns` is an empty string
		 * 2. `patterns` is an empty array
		 *
		 * In both cases, we use the cwd as the directory to lint.
		 */
		if (
			patterns === "" ||
			(Array.isArray(patterns) && patterns.length === 0)
		) {
			/*
			 * Special case: If `passOnNoPatterns` is true, then we just exit
			 * without doing any work.
			 */
			if (eslintOptions.passOnNoPatterns) {
				return [];
			}

			normalizedPatterns = ["."];
		} else {
			if (
				!isNonEmptyString(patterns) &&
				!isArrayOfNonEmptyString(patterns)
			) {
				throw new Error(
					"'patterns' must be a non-empty string or an array of non-empty strings",
				);
			}

			if (typeof patterns === "string") {
				normalizedPatterns = [patterns];
			}
		}

		debug(`Using file patterns: ${normalizedPatterns}`);

		const { concurrency, cwd, globInputPaths, errorOnUnmatchedPattern } =
			eslintOptions;

		// Delete cache file; should this be done here?
		if (!lintResultCache && cacheFilePath) {
			debug(`Deleting cache file at ${cacheFilePath}`);

			try {
				if (existsSync(cacheFilePath)) {
					await fs.unlink(cacheFilePath);
				}
			} catch (error) {
				if (existsSync(cacheFilePath)) {
					throw error;
				}
			}
		}

		const startTime = hrtimeBigint();
		const filePaths = await findFiles({
			patterns: normalizedPatterns,
			cwd,
			globInputPaths,
			configLoader: this.#configLoader,
			errorOnUnmatchedPattern,
		});
		debug(
			"%d file(s) found in %t",
			filePaths.length,
			hrtimeBigint() - startTime,
		);

		/** @type {LintResult[]} */
		let results;

		// The value of `module.exports.calculateWorkerCount` can be overridden in tests.
		const workerCount = module.exports.calculateWorkerCount(
			this,
			filePaths,
		);
		if (workerCount) {
			debug(`Linting using ${workerCount} worker thread(s).`);
			let poorConcurrencyNotice;
			if (workerCount <= 2) {
				poorConcurrencyNotice = "disable concurrency";
			} else {
				if (concurrency === "auto") {
					poorConcurrencyNotice =
						"disable concurrency or use a numeric concurrency setting";
				} else {
					poorConcurrencyNotice = "reduce or disable concurrency";
				}
			}
			results = await lintFilesWithMultithreading(
				this,
				filePaths,
				workerCount,
				this.#optionsOrURL,
				() =>
					warningService.emitPoorConcurrencyWarning(
						poorConcurrencyNotice,
					),
			);
		} else {
			debug(`Linting in single-thread mode.`);
			results = await lintFilesWithoutMultithreading(this, filePaths);
		}

		// Persist the cache to disk.
		if (lintResultCache) {
			lintResultCache.reconcile();
		}

		const unsuppressedResults = results.filter(result => !!result);

		if (!eslintOptions.applySuppressions) {
			return processLintReport(this, unsuppressedResults);
		}

		const { results: suppressedResults } =
			suppressionsService.applySuppressions(
				unsuppressedResults,
				await suppressionsService.load(),
			);

		return processLintReport(this, suppressedResults);
	}

	/**
	 * Executes the current configuration on text.
	 * @param {string} code A string of JavaScript code to lint.
	 * @param {Object} [options] The options.
	 * @param {string} [options.filePath] The path to the file of the source code.
	 * @param {boolean} [options.warnIgnored] When set to true, warn if given filePath is an ignored path.
	 * @returns {Promise<LintResult[]>} The results of linting the string of code given.
	 */
	async lintText(code, options = {}) {
		// Parameter validation

		if (typeof code !== "string") {
			throw new Error("'code' must be a string");
		}

		if (typeof options !== "object") {
			throw new Error("'options' must be an object, null, or undefined");
		}

		// Options validation

		const { filePath, warnIgnored, ...unknownOptions } = options || {};

		const unknownOptionKeys = Object.keys(unknownOptions);

		if (unknownOptionKeys.length > 0) {
			throw new Error(
				`'options' must not include the unknown option(s): ${unknownOptionKeys.join(", ")}`,
			);
		}

		if (filePath !== void 0 && !isNonEmptyString(filePath)) {
			throw new Error(
				"'options.filePath' must be a non-empty string or undefined",
			);
		}

		if (
			typeof warnIgnored !== "boolean" &&
			typeof warnIgnored !== "undefined"
		) {
			throw new Error(
				"'options.warnIgnored' must be a boolean or undefined",
			);
		}

		// Now we can get down to linting

		const {
			linter,
			options: eslintOptions,
			suppressionsService,
		} = privateMembers.get(this);
		const {
			allowInlineConfig,
			cwd,
			fix,
			fixTypes,
			warnIgnored: constructorWarnIgnored,
			ruleFilter,
			stats,
		} = eslintOptions;
		const results = [];
		const startTime = hrtimeBigint();
		const fixTypesSet = fixTypes ? new Set(fixTypes) : null;
		const resolvedFilename = path.resolve(
			cwd,
			filePath || "__placeholder__.js",
		);
		const configs =
			await this.#configLoader.loadConfigArrayForFile(resolvedFilename);
		const configStatus =
			configs?.getConfigStatus(resolvedFilename) ?? "unconfigured";

		// Clear the last used config arrays.
		if (resolvedFilename && configStatus !== "matched") {
			const shouldWarnIgnored =
				typeof warnIgnored === "boolean"
					? warnIgnored
					: constructorWarnIgnored;

			if (shouldWarnIgnored) {
				results.push(
					createIgnoreResult(resolvedFilename, cwd, configStatus),
				);
			}
		} else {
			const config = configs.getConfig(resolvedFilename);
			const fixer = getFixerForFixTypes(fix, fixTypesSet, config);

			// Do lint.
			results.push(
				verifyText({
					text: code,
					filePath: resolvedFilename.endsWith("__placeholder__.js")
						? "<text>"
						: resolvedFilename,
					configs,
					cwd,
					fix: fixer,
					allowInlineConfig,
					ruleFilter,
					stats,
					linter,
				}),
			);
		}

		debug("Linting complete in %t", hrtimeBigint() - startTime);

		if (!filePath || !eslintOptions.applySuppressions) {
			return processLintReport(this, results);
		}

		const { results: suppressedResults } =
			suppressionsService.applySuppressions(
				results,
				await suppressionsService.load(),
			);
		return processLintReport(this, suppressedResults);
	}

	/**
	 * Returns the formatter representing the given formatter name.
	 * @param {string} [name] The name of the formatter to load.
	 * The following values are allowed:
	 * - `undefined` ... Load `stylish` builtin formatter.
	 * - A builtin formatter name ... Load the builtin formatter.
	 * - A third-party formatter name:
	 *   - `foo` → `eslint-formatter-foo`
	 *   - `@foo` → `@foo/eslint-formatter`
	 *   - `@foo/bar` → `@foo/eslint-formatter-bar`
	 * - A file path ... Load the file.
	 * @returns {Promise<Formatter>} A promise resolving to the formatter object.
	 * This promise will be rejected if the given formatter was not found or not
	 * a function.
	 */
	async loadFormatter(name = "stylish") {
		if (typeof name !== "string") {
			throw new Error("'name' must be a string");
		}

		// replace \ with / for Windows compatibility
		const normalizedFormatName = name.replace(/\\/gu, "/");
		const namespace = getNamespaceFromTerm(normalizedFormatName);

		// grab our options
		const { cwd } = privateMembers.get(this).options;

		let formatterPath;
		let isBuiltInFormatter = false;

		// if there's a slash, then it's a file (TODO: this check seems dubious for scoped npm packages)
		if (!namespace && normalizedFormatName.includes("/")) {
			formatterPath = path.resolve(cwd, normalizedFormatName);
		} else {
			try {
				const npmFormat = normalizePackageName(
					normalizedFormatName,
					"eslint-formatter",
				);

				// TODO: This is pretty dirty...would be nice to clean up at some point.
				formatterPath = resolve(npmFormat, getPlaceholderPath(cwd));
			} catch {
				formatterPath = path.resolve(
					__dirname,
					"../",
					"cli-engine",
					"formatters",
					`${normalizedFormatName}.js`,
				);
				isBuiltInFormatter = true;
			}
		}

		let formatter;

		try {
			formatter = (await import(pathToFileURL(formatterPath))).default;
		} catch (ex) {
			// check for formatters that have been removed
			if (isBuiltInFormatter && removedFormatters.has(name)) {
				ex.message = `The ${name} formatter is no longer part of core ESLint. Install it manually with \`npm install -D eslint-formatter-${name}\``;
			} else {
				ex.message = `There was a problem loading formatter: ${formatterPath}\nError: ${ex.message}`;
			}

			throw ex;
		}

		if (typeof formatter !== "function") {
			throw new TypeError(
				`Formatter must be a function, but got a ${typeof formatter}.`,
			);
		}

		const eslint = this;

		return {
			/**
			 * The main formatter method.
			 * @param {LintResult[]} results The lint results to format.
			 * @param {ResultsMeta} resultsMeta Warning count and max threshold.
			 * @returns {string} The formatted lint results.
			 */
			format(results, resultsMeta) {
				let rulesMeta = null;

				results.sort(compareResultsByFilePath);

				return formatter(results, {
					...resultsMeta,
					cwd,
					get rulesMeta() {
						if (!rulesMeta) {
							rulesMeta = eslint.getRulesMetaForResults(results);
						}

						return rulesMeta;
					},
				});
			},
		};
	}

	/**
	 * Returns a configuration object for the given file based on the CLI options.
	 * This is the same logic used by the ESLint CLI executable to determine
	 * configuration for each file it processes.
	 * @param {string} filePath The path of the file to retrieve a config object for.
	 * @returns {Promise<CalculatedConfig|undefined>} A configuration object for the file
	 *      or `undefined` if there is no configuration data for the object.
	 */
	async calculateConfigForFile(filePath) {
		if (!isNonEmptyString(filePath)) {
			throw new Error("'filePath' must be a non-empty string");
		}
		const options = privateMembers.get(this).options;
		const absolutePath = path.resolve(options.cwd, filePath);
		const configs =
			await this.#configLoader.loadConfigArrayForFile(absolutePath);

		if (!configs) {
			const error = new Error("Could not find config file.");

			error.messageTemplate = "config-file-missing";
			throw error;
		}

		return configs.getConfig(absolutePath);
	}

	/**
	 * Finds the config file being used by this instance based on the options
	 * passed to the constructor.
	 * @param {string} [filePath] The path of the file to find the config file for.
	 * @returns {Promise<string|undefined>} The path to the config file being used or
	 *      `undefined` if no config file is being used.
	 */
	async findConfigFile(filePath) {
		const options = privateMembers.get(this).options;

		/*
		 * Because the new config lookup scheme skips the current directory
		 * and looks into the parent directories, we need to use a placeholder
		 * directory to ensure the file in cwd is checked.
		 */
		const fakeCwd = path.join(options.cwd, "__placeholder__");

		return this.#configLoader
			.findConfigFileForPath(filePath ?? fakeCwd)
			.catch(() => void 0);
	}

	/**
	 * Checks if a given path is ignored by ESLint.
	 * @param {string} filePath The path of the file to check.
	 * @returns {Promise<boolean>} Whether or not the given path is ignored.
	 */
	async isPathIgnored(filePath) {
		const config = await this.calculateConfigForFile(filePath);

		return config === void 0;
	}
}

/**
 * Returns whether flat config should be used.
 * @returns {Promise<true>} Whether flat config should be used.
 */
async function shouldUseFlatConfig() {
	return true;
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

module.exports = {
	ESLint,
	shouldUseFlatConfig,
	locateConfigFileToUse,
	calculateWorkerCount,
};
oxW "use strict";

const { ESLint } = require("./eslint");

module.exports = {
	ESLint,
};
ܹx/**
 * @fileoverview Worker thread for multithread linting.
 * @author Francesco Trotta
 */

"use strict";

const hrtimeBigint = process.hrtime.bigint;

const startTime = hrtimeBigint();

// eslint-disable-next-line n/no-unsupported-features/node-builtins -- enable V8's code cache if supported
require("node:module").enableCompileCache?.();

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const { parentPort, threadId, workerData } = require("node:worker_threads");
const {
	createConfigLoader,
	createDebug,
	createDefaultConfigs,
	createLinter,
	createLintResultCache,
	getCacheFile,
	lintFile,
	loadOptionsFromModule,
	processOptions,
} = require("./eslint-helpers");
const { WarningService } = require("../services/warning-service");
const timing = require("../linter/timing");

const depsLoadedTime = hrtimeBigint();

//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------

/** @typedef {import("../types").ESLint.LintResult} LintResult */
/** @typedef {import("../types").ESLint.Options} ESLintOptions */
/** @typedef {LintResult & { index?: number; }} IndexedLintResult */
/** @typedef {IndexedLintResult[] & { netLintingDuration: bigint; timings?: Record<string, number>; }} WorkerLintResults */
/**
 * @typedef {Object} WorkerData - Data passed to the worker thread.
 * @property {ESLintOptions | string} eslintOptionsOrURL - The unprocessed ESLint options or the URL of the options module.
 * @property {Uint32Array<SharedArrayBuffer>} filePathIndexArray - Shared counter used to track the next file to lint.
 * @property {string[]} filePaths - File paths to lint.
 */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const debug = createDebug(`eslint:worker:thread-${threadId}`);

//------------------------------------------------------------------------------
// Main
//------------------------------------------------------------------------------

/*
 * Prevent timing module from printing profiling output from worker threads.
 * The main thread is responsible for displaying any aggregated timings.
 */
timing.disableDisplay();

debug("Dependencies loaded in %t", depsLoadedTime - startTime);

(async () => {
	/** @type {WorkerData} */
	const { eslintOptionsOrURL, filePathIndexArray, filePaths } = workerData;
	const eslintOptions =
		typeof eslintOptionsOrURL === "object"
			? eslintOptionsOrURL
			: await loadOptionsFromModule(eslintOptionsOrURL);
	const processedESLintOptions = processOptions(eslintOptions);

	const warningService = new WarningService();

	// These warnings are always emitted by the controlling thread.
	warningService.emitEmptyConfigWarning =
		warningService.emitInactiveFlagWarning = () => {};

	const linter = createLinter(processedESLintOptions, warningService);

	const cacheFilePath = getCacheFile(
		processedESLintOptions.cacheLocation,
		processedESLintOptions.cwd,
	);

	const lintResultCache = createLintResultCache(
		processedESLintOptions,
		cacheFilePath,
	);
	const defaultConfigs = createDefaultConfigs(eslintOptions.plugins);

	const configLoader = createConfigLoader(
		processedESLintOptions,
		defaultConfigs,
		linter,
		warningService,
	);

	/** @type {WorkerLintResults} */
	const indexedResults = [];
	let loadConfigTotalDuration = 0n;
	const readFileCounter = { duration: 0n };

	const lintingStartTime = hrtimeBigint();
	debug(
		"Linting started %t after dependencies loaded",
		lintingStartTime - depsLoadedTime,
	);

	for (;;) {
		const fileLintingStartTime = hrtimeBigint();

		// It seems hard to produce an arithmetic overflow under realistic conditions here.
		const index = Atomics.add(filePathIndexArray, 0, 1);

		const filePath = filePaths[index];
		if (!filePath) {
			break;
		}

		const loadConfigEnterTime = hrtimeBigint();
		const configs = await configLoader.loadConfigArrayForFile(filePath);
		const loadConfigExitTime = hrtimeBigint();
		const loadConfigDuration = loadConfigExitTime - loadConfigEnterTime;
		debug(
			'Config array for file "%s" loaded in %t',
			filePath,
			loadConfigDuration,
		);
		loadConfigTotalDuration += loadConfigDuration;

		/** @type {IndexedLintResult} */
		const result = await lintFile(
			filePath,
			configs,
			processedESLintOptions,
			linter,
			lintResultCache,
			readFileCounter,
		);
		if (result) {
			result.index = index;
			indexedResults.push(result);
		}

		const fileLintingEndTime = hrtimeBigint();
		debug(
			'File "%s" processed in %t',
			filePath,
			fileLintingEndTime - fileLintingStartTime,
		);
	}

	const lintingDuration = hrtimeBigint() - lintingStartTime;

	/*
	 * The net linting duration is the total linting time minus the time spent loading configs and reading files.
	 * It captures the processing time dedicated to computation-intensive tasks that are highly parallelizable and not repeated across threads.
	 */
	indexedResults.netLintingDuration =
		lintingDuration - loadConfigTotalDuration - readFileCounter.duration;

	if (timing.enabled) {
		indexedResults.timings = timing.getData();
	}

	parentPort.postMessage(indexedResults);
})();
4Fx 40000 js _k%_@zEҟP֢x }100644 index.js ?YoOV=u:-?6X40000 source-code [C}Ų0%100644 validate-language-options.js #&fBdM7v2xs)/**
 * @fileoverview JavaScript Language Object
 * @author Nicholas C. Zakas
 */

"use strict";

//-----------------------------------------------------------------------------
// Requirements
//-----------------------------------------------------------------------------

const { SourceCode } = require("./source-code");
const createDebug = require("debug");
const astUtils = require("../../shared/ast-utils");
const espree = require("espree");
const eslintScope = require("eslint-scope");
const evk = require("eslint-visitor-keys");
const { validateLanguageOptions } = require("./validate-language-options");
const { LATEST_ECMA_VERSION } = require("../../../conf/ecma-version");

//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------

/** @typedef {import("@eslint/core").File} File */
/** @typedef {import("@eslint/core").Language} Language */
/** @typedef {import("@eslint/core").OkParseResult} OkParseResult */
/** @typedef {import("../../types").Linter.LanguageOptions} JSLanguageOptions */

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

const debug = createDebug("eslint:languages:js");
const DEFAULT_ECMA_VERSION = 5;
const parserSymbol = Symbol.for("eslint.RuleTester.parser");

/**
 * Analyze scope of the given AST.
 * @param {ASTNode} ast The `Program` node to analyze.
 * @param {JSLanguageOptions} languageOptions The parser options.
 * @param {Record<string, string[]>} visitorKeys The visitor keys.
 * @returns {ScopeManager} The analysis result.
 */
function analyzeScope(ast, languageOptions, visitorKeys) {
	const parserOptions = languageOptions.parserOptions;
	const ecmaFeatures = parserOptions.ecmaFeatures || {};
	const ecmaVersion = languageOptions.ecmaVersion || DEFAULT_ECMA_VERSION;

	return eslintScope.analyze(ast, {
		ignoreEval: true,
		nodejsScope: ecmaFeatures.globalReturn,
		impliedStrict: ecmaFeatures.impliedStrict,
		ecmaVersion: typeof ecmaVersion === "number" ? ecmaVersion : 6,
		sourceType: languageOptions.sourceType || "script",
		childVisitorKeys: visitorKeys || evk.KEYS,
		fallback: evk.getKeys,
		jsx: ecmaFeatures.jsx,
	});
}

/**
 * Determines if a given object is Espree.
 * @param {Object} parser The parser to check.
 * @returns {boolean} `true` if the parser is Espree or `false` if not.
 */
function isEspree(parser) {
	return !!(parser === espree || parser[parserSymbol] === espree);
}

/**
 * Normalize ECMAScript version from the initial config into languageOptions (year)
 * format.
 * @param {any} [ecmaVersion] ECMAScript version from the initial config
 * @returns {number} normalized ECMAScript version
 */
function normalizeEcmaVersionForLanguageOptions(ecmaVersion) {
	switch (ecmaVersion) {
		case 3:
			return 3;

		// void 0 = no ecmaVersion specified so use the default
		case 5:
		case void 0:
			return 5;

		default:
			if (typeof ecmaVersion === "number") {
				return ecmaVersion >= 2015 ? ecmaVersion : ecmaVersion + 2009;
			}
	}

	/*
	 * We default to the latest supported ecmaVersion for everything else.
	 * Remember, this is for languageOptions.ecmaVersion, which sets the version
	 * that is used for a number of processes inside of ESLint. It's normally
	 * safe to assume people want the latest unless otherwise specified.
	 */
	return LATEST_ECMA_VERSION;
}

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * @type {Language}
 */
module.exports = {
	fileType: "text",
	lineStart: 1,
	columnStart: 0,
	nodeTypeKey: "type",
	visitorKeys: evk.KEYS,

	defaultLanguageOptions: {
		sourceType: "module",
		ecmaVersion: "latest",
		parser: espree,
		parserOptions: {},
	},

	validateLanguageOptions,

	/**
	 * Normalizes the language options.
	 * @param {Object} languageOptions The language options to normalize.
	 * @returns {Object} The normalized language options.
	 */
	normalizeLanguageOptions(languageOptions) {
		languageOptions.ecmaVersion = normalizeEcmaVersionForLanguageOptions(
			languageOptions.ecmaVersion,
		);

		// Espree expects this information to be passed in
		if (isEspree(languageOptions.parser)) {
			const parserOptions = languageOptions.parserOptions;

			if (languageOptions.sourceType) {
				parserOptions.sourceType = languageOptions.sourceType;

				if (
					parserOptions.sourceType === "module" &&
					parserOptions.ecmaFeatures &&
					parserOptions.ecmaFeatures.globalReturn
				) {
					parserOptions.ecmaFeatures.globalReturn = false;
				}
			}
		}

		return languageOptions;
	},

	/**
	 * Determines if a given node matches a given selector class.
	 * @param {string} className The class name to check.
	 * @param {ASTNode} node The node to check.
	 * @param {Array<ASTNode>} ancestry The ancestry of the node.
	 * @returns {boolean} True if there's a match, false if not.
	 * @throws {Error} When an unknown class name is passed.
	 */
	matchesSelectorClass(className, node, ancestry) {
		/*
		 * Copyright (c) 2013, Joel Feenstra
		 * All rights reserved.
		 *
		 * Redistribution and use in source and binary forms, with or without
		 * modification, are permitted provided that the following conditions are met:
		 *    * Redistributions of source code must retain the above copyright
		 *      notice, this list of conditions and the following disclaimer.
		 *    * Redistributions in binary form must reproduce the above copyright
		 *      notice, this list of conditions and the following disclaimer in the
		 *      documentation and/or other materials provided with the distribution.
		 *    * Neither the name of the ESQuery nor the names of its contributors may
		 *      be used to endorse or promote products derived from this software without
		 *      specific prior written permission.
		 *
		 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
		 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
		 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
		 * DISCLAIMED. IN NO EVENT SHALL JOEL FEENSTRA BE LIABLE FOR ANY
		 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
		 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
		 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
		 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
		 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
		 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
		 */

		switch (className.toLowerCase()) {
			case "statement":
				if (node.type.slice(-9) === "Statement") {
					return true;
				}

			// fallthrough: interface Declaration <: Statement { }

			case "declaration":
				return node.type.slice(-11) === "Declaration";

			case "pattern":
				if (node.type.slice(-7) === "Pattern") {
					return true;
				}

			// fallthrough: interface Expression <: Node, Pattern { }

			case "expression":
				return (
					node.type.slice(-10) === "Expression" ||
					node.type.slice(-7) === "Literal" ||
					(node.type === "Identifier" &&
						(ancestry.length === 0 ||
							ancestry[0].type !== "MetaProperty")) ||
					node.type === "MetaProperty"
				);

			case "function":
				return (
					node.type === "FunctionDeclaration" ||
					node.type === "FunctionExpression" ||
					node.type === "ArrowFunctionExpression"
				);

			default:
				throw new Error(`Unknown class name: ${className}`);
		}
	},

	/**
	 * Parses the given file into an AST.
	 * @param {File} file The virtual file to parse.
	 * @param {Object} options Additional options passed from ESLint.
	 * @param {JSLanguageOptions} options.languageOptions The language options.
	 * @returns {Object} The result of parsing.
	 */
	parse(file, { languageOptions }) {
		// Note: BOM already removed
		const { body: text, path: filePath } = file;
		const textToParse = text.replace(
			astUtils.shebangPattern,
			(match, captured) => `//${captured}`,
		);
		const { ecmaVersion, sourceType, parser } = languageOptions;
		const parserOptions = Object.assign(
			{ ecmaVersion, sourceType },
			languageOptions.parserOptions,
			{
				loc: true,
				range: true,
				tokens: true,
				comment: true,
				eslintVisitorKeys: true,
				eslintScopeManager: true,
				filePath,
			},
		);

		/*
		 * Check for parsing errors first. If there's a parsing error, nothing
		 * else can happen. However, a parsing error does not throw an error
		 * from this method - it's just considered a fatal error message, a
		 * problem that ESLint identified just like any other.
		 */
		try {
			debug("Parsing:", filePath);
			const parseResult =
				typeof parser.parseForESLint === "function"
					? parser.parseForESLint(textToParse, parserOptions)
					: { ast: parser.parse(textToParse, parserOptions) };

			debug("Parsing successful:", filePath);

			const {
				ast,
				services: parserServices = {},
				visitorKeys = evk.KEYS,
				scopeManager,
			} = parseResult;

			return {
				ok: true,
				ast,
				parserServices,
				visitorKeys,
				scopeManager,
			};
		} catch (ex) {
			// If the message includes a leading line number, strip it:
			const message = ex.message.replace(/^line \d+:/iu, "").trim();

			debug("%s\n%s", message, ex.stack);

			return {
				ok: false,
				errors: [
					{
						message,
						line: ex.lineNumber,
						column: ex.column,
					},
				],
			};
		}
	},

	/**
	 * Creates a new `SourceCode` object from the given information.
	 * @param {File} file The virtual file to create a `SourceCode` object from.
	 * @param {OkParseResult} parseResult The result returned from `parse()`.
	 * @param {Object} options Additional options passed from ESLint.
	 * @param {JSLanguageOptions} options.languageOptions The language options.
	 * @returns {SourceCode} The new `SourceCode` object.
	 */
	createSourceCode(file, parseResult, { languageOptions }) {
		const { body: text, path: filePath, bom: hasBOM } = file;
		const { ast, parserServices, visitorKeys } = parseResult;

		debug("Scope analysis:", filePath);
		const scopeManager =
			parseResult.scopeManager ||
			analyzeScope(ast, languageOptions, visitorKeys);

		debug("Scope analysis successful:", filePath);

		return new SourceCode({
			text,
			ast,
			hasBOM,
			parserServices,
			scopeManager,
			visitorKeys,
		});
	},
};
'xt 100644 index.js  >9:OW(ey$Bf3q@100644 source-code.js Q~:C	@240000 token-store ZέM1<1Τ)@,ox` "use strict";

const SourceCode = require("./source-code");

module.exports = {
	SourceCode,
};
xI|/**
 * @fileoverview Abstraction of JavaScript source code.
 * @author Nicholas C. Zakas
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const TokenStore = require("./token-store"),
	astUtils = require("../../../shared/ast-utils"),
	Traverser = require("../../../shared/traverser"),
	globals = require("../../../../conf/globals"),
	{ directivesPattern } = require("../../../shared/directives"),
	CodePathAnalyzer = require("../../../linter/code-path-analysis/code-path-analyzer"),
	{
		ConfigCommentParser,
		VisitNodeStep,
		CallMethodStep,
		Directive,
	} = require("@eslint/plugin-kit");

//------------------------------------------------------------------------------
// Type Definitions
//------------------------------------------------------------------------------

/** @typedef {import("eslint-scope").Variable} Variable */
/** @typedef {import("eslint-scope").Scope} Scope */
/** @typedef {import("eslint-scope").ScopeManager} ScopeManager */
/** @typedef {import("@eslint/core").SourceCode} ISourceCode */
/** @typedef {import("@eslint/core").Directive} IDirective */
/** @typedef {import("@eslint/core").TraversalStep} ITraversalStep */

//------------------------------------------------------------------------------
// Private
//------------------------------------------------------------------------------

const commentParser = new ConfigCommentParser();

/**
 * Validates that the given AST has the required information.
 * @param {ASTNode} ast The Program node of the AST to check.
 * @throws {TypeError} If the AST doesn't contain the correct information.
 * @returns {void}
 * @private
 */
function validate(ast) {
	if (!ast) {
		throw new TypeError(`Unexpected empty AST. (${ast})`);
	}

	if (!ast.tokens) {
		throw new TypeError("AST is missing the tokens array.");
	}

	if (!ast.comments) {
		throw new TypeError("AST is missing the comments array.");
	}

	if (!ast.loc) {
		throw new TypeError("AST is missing location information.");
	}

	if (!ast.range) {
		throw new TypeError("AST is missing range information");
	}
}

/**
 * Retrieves globals for the given ecmaVersion.
 * @param {number} ecmaVersion The version to retrieve globals for.
 * @returns {Object} The globals for the given ecmaVersion.
 */
function getGlobalsForEcmaVersion(ecmaVersion) {
	switch (ecmaVersion) {
		case 3:
			return globals.es3;

		case 5:
			return globals.es5;

		default:
			if (ecmaVersion < 2015) {
				return globals[`es${ecmaVersion + 2009}`];
			}

			return globals[`es${ecmaVersion}`];
	}
}

/**
 * Merges two sorted lists into a larger sorted list in O(n) time.
 * @param {Token[]} tokens The list of tokens.
 * @param {Token[]} comments The list of comments.
 * @returns {Token[]} A sorted list of tokens and comments.
 * @private
 */
function sortedMerge(tokens, comments) {
	const result = [];
	let tokenIndex = 0;
	let commentIndex = 0;

	while (tokenIndex < tokens.length || commentIndex < comments.length) {
		if (
			commentIndex >= comments.length ||
			(tokenIndex < tokens.length &&
				tokens[tokenIndex].range[0] < comments[commentIndex].range[0])
		) {
			result.push(tokens[tokenIndex++]);
		} else {
			result.push(comments[commentIndex++]);
		}
	}

	return result;
}

/**
 * Normalizes a value for a global in a config
 * @param {(boolean|string|null)} configuredValue The value given for a global in configuration or in
 * a global directive comment
 * @returns {("readonly"|"writable"|"off")} The value normalized as a string
 * @throws {Error} if global value is invalid
 */
function normalizeConfigGlobal(configuredValue) {
	switch (configuredValue) {
		case "off":
			return "off";

		case true:
		case "true":
		case "writeable":
		case "writable":
			return "writable";

		case null:
		case false:
		case "false":
		case "readable":
		case "readonly":
			return "readonly";

		default:
			throw new Error(
				`'${configuredValue}' is not a valid configuration for a global (use 'readonly', 'writable', or 'off')`,
			);
	}
}

/**
 * Determines if two nodes or tokens overlap.
 * @param {ASTNode|Token} first The first node or token to check.
 * @param {ASTNode|Token} second The second node or token to check.
 * @returns {boolean} True if the two nodes or tokens overlap.
 * @private
 */
function nodesOrTokensOverlap(first, second) {
	return (
		(first.range[0] <= second.range[0] &&
			first.range[1] >= second.range[0]) ||
		(second.range[0] <= first.range[0] && second.range[1] >= first.range[0])
	);
}

/**
 * Performs binary search to find the line number containing a given character index.
 * Returns the lower bound - the index of the first element greater than the target.
 * **Please note that the `lineStartIndices` should be sorted in ascending order**.
 * - Time Complexity: O(log n) - Significantly faster than linear search for large files.
 * @param {number[]} lineStartIndices Sorted array of line start indices.
 * @param {number} target The character index to find the line number for.
 * @returns {number} The 1-based line number for the target index.
 * @private
 */
function findLineNumberBinarySearch(lineStartIndices, target) {
	let low = 0;
	let high = lineStartIndices.length;

	while (low < high) {
		const mid = ((low + high) / 2) | 0; // Use bitwise OR to floor the division

		if (target < lineStartIndices[mid]) {
			high = mid;
		} else {
			low = mid + 1;
		}
	}

	return low;
}

//-----------------------------------------------------------------------------
// Directive Comments
//-----------------------------------------------------------------------------

/**
 * Ensures that variables representing built-in properties of the Global Object,
 * and any globals declared by special block comments, are present in the global
 * scope.
 * @param {ScopeManager} scopeManager Scope manager.
 * @param {Object|undefined} configGlobals The globals declared in configuration
 * @param {Object|undefined} inlineGlobals The globals declared in the source code
 * @returns {void}
 */
function addDeclaredGlobals(
	scopeManager,
	configGlobals = Object.create(null),
	inlineGlobals = Object.create(null),
) {
	const finalGlobals = { __proto__: null, ...configGlobals };

	for (const [name, data] of Object.entries(inlineGlobals)) {
		finalGlobals[name] = data.value;
	}

	const names = Object.keys(finalGlobals).filter(
		name => finalGlobals[name] !== "off",
	);

	scopeManager.addGlobals(names);

	const globalScope = scopeManager.scopes[0];

	for (const name of names) {
		const variable = globalScope.set.get(name);

		variable.eslintImplicitGlobalSetting = configGlobals[name];
		variable.eslintExplicitGlobal = !!inlineGlobals[name];
		variable.eslintExplicitGlobalComments = inlineGlobals[name]?.comments;
		variable.writeable = finalGlobals[name] === "writable";
	}
}

/**
 * Sets the given variable names as exported so they won't be triggered by
 * the `no-unused-vars` rule.
 * @param {eslint.Scope} globalScope The global scope to define exports in.
 * @param {Record<string,string>} variables An object whose keys are the variable
 *      names to export.
 * @returns {void}
 */
function markExportedVariables(globalScope, variables) {
	Object.keys(variables).forEach(name => {
		const variable = globalScope.set.get(name);

		if (variable) {
			variable.eslintUsed = true;
			variable.eslintExported = true;
		}
	});
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

const caches = Symbol("caches");

/**
 * Represents parsed source code.
 * @implements {ISourceCode}
 */
class SourceCode extends TokenStore {
	/**
	 * The cache of steps that were taken while traversing the source code.
	 * @type {Array<ITraversalStep>}
	 */
	#steps;

	/**
	 * Creates a new instance.
	 * @param {string|Object} textOrConfig The source code text or config object.
	 * @param {string} textOrConfig.text The source code text.
	 * @param {ASTNode} textOrConfig.ast The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped.
	 * @param {boolean} textOrConfig.hasBOM Indicates if the text has a Unicode BOM.
	 * @param {Object|null} textOrConfig.parserServices The parser services.
	 * @param {ScopeManager|null} textOrConfig.scopeManager The scope of this source code.
	 * @param {Object|null} textOrConfig.visitorKeys The visitor keys to traverse AST.
	 * @param {ASTNode} [astIfNoConfig] The Program node of the AST representing the code. This AST should be created from the text that BOM was stripped.
	 */
	constructor(textOrConfig, astIfNoConfig) {
		let text, hasBOM, ast, parserServices, scopeManager, visitorKeys;

		// Process overloading of arguments
		if (typeof textOrConfig === "string") {
			text = textOrConfig;
			ast = astIfNoConfig;
			hasBOM = false;
		} else if (typeof textOrConfig === "object" && textOrConfig !== null) {
			text = textOrConfig.text;
			ast = textOrConfig.ast;
			hasBOM = textOrConfig.hasBOM;
			parserServices = textOrConfig.parserServices;
			scopeManager = textOrConfig.scopeManager;
			visitorKeys = textOrConfig.visitorKeys;
		}

		validate(ast);
		super(ast.tokens, ast.comments);

		/**
		 * General purpose caching for the class.
		 */
		this[caches] = new Map([
			["scopes", new WeakMap()],
			["vars", new Map()],
			["configNodes", void 0],
			["isGlobalReference", new WeakMap()],
		]);

		/**
		 * Indicates if the AST is ESTree compatible.
		 * @type {boolean}
		 */
		this.isESTree = ast.type === "Program";

		/*
		 * Backwards compatibility for BOM handling.
		 *
		 * The `hasBOM` property has been available on the `SourceCode` object
		 * for a long time and is used to indicate if the source contains a BOM.
		 * The linter strips the BOM and just passes the `hasBOM` property to the
		 * `SourceCode` constructor to make it easier for languages to not deal with
		 * the BOM.
		 *
		 * However, the text passed in to the `SourceCode` constructor might still
		 * have a BOM if the constructor is called outside of the linter, so we still
		 * need to check for the BOM in the text.
		 */
		const textHasBOM = text.charCodeAt(0) === 0xfeff;

		/**
		 * The flag to indicate that the source code has Unicode BOM.
		 * @type {boolean}
		 */
		this.hasBOM = textHasBOM || !!hasBOM;

		/**
		 * The original text source code.
		 * BOM was stripped from this text.
		 * @type {string}
		 */
		this.text = textHasBOM ? text.slice(1) : text;

		/**
		 * The parsed AST for the source code.
		 * @type {ASTNode}
		 */
		this.ast = ast;

		/**
		 * The parser services of this source code.
		 * @type {Object}
		 */
		this.parserServices = parserServices || {};

		/**
		 * The scope of this source code.
		 * @type {ScopeManager|null}
		 */
		this.scopeManager = scopeManager || null;

		/**
		 * The visitor keys to traverse AST.
		 * @type {Object}
		 */
		this.visitorKeys = visitorKeys || Traverser.DEFAULT_VISITOR_KEYS;

		// Check the source text for the presence of a shebang since it is parsed as a standard line comment.
		const shebangMatched = this.text.match(astUtils.shebangPattern);
		const hasShebang =
			shebangMatched &&
			ast.comments.length &&
			ast.comments[0].value === shebangMatched[1];

		if (hasShebang) {
			ast.comments[0].type = "Shebang";
		}

		this.tokensAndComments = sortedMerge(ast.tokens, ast.comments);

		/**
		 * The source code split into lines according to ECMA-262 specification.
		 * This is done to avoid each rule needing to do so separately.
		 * @type {string[]}
		 */
		this.lines = [];

		/**
		 * @type {number[]}
		 */
		this.lineStartIndices = [0];

		const lineEndingPattern = astUtils.createGlobalLinebreakMatcher();
		let match;

		/*
		 * Previously, this was implemented using a regex that
		 * matched a sequence of non-linebreak characters followed by a
		 * linebreak, then adding the lengths of the matches. However,
		 * this caused a catastrophic backtracking issue when the end
		 * of a file contained a large number of non-newline characters.
		 * To avoid this, the current implementation just matches newlines
		 * and uses match.index to get the correct line start indices.
		 */
		while ((match = lineEndingPattern.exec(this.text))) {
			this.lines.push(
				this.text.slice(this.lineStartIndices.at(-1), match.index),
			);
			this.lineStartIndices.push(match.index + match[0].length);
		}
		this.lines.push(this.text.slice(this.lineStartIndices.at(-1)));

		// don't allow further modification of this object
		Object.freeze(this);
		Object.freeze(this.lines);
	}

	/**
	 * Split the source code into multiple lines based on the line delimiters.
	 * @param {string} text Source code as a string.
	 * @returns {string[]} Array of source code lines.
	 * @public
	 */
	static splitLines(text) {
		return text.split(astUtils.createGlobalLinebreakMatcher());
	}

	/**
	 * Gets the source code for the given node.
	 * @param {ASTNode} [node] The AST node to get the text for.
	 * @param {number} [beforeCount] The number of characters before the node to retrieve.
	 * @param {number} [afterCount] The number of characters after the node to retrieve.
	 * @returns {string} The text representing the AST node.
	 * @public
	 */
	getText(node, beforeCount, afterCount) {
		if (node) {
			return this.text.slice(
				Math.max(node.range[0] - (beforeCount || 0), 0),
				node.range[1] + (afterCount || 0),
			);
		}
		return this.text;
	}

	/**
	 * Gets the entire source text split into an array of lines.
	 * @returns {string[]} The source text as an array of lines.
	 * @public
	 */
	getLines() {
		return this.lines;
	}

	/**
	 * Retrieves an array containing all comments in the source code.
	 * @returns {ASTNode[]} An array of comment nodes.
	 * @public
	 */
	getAllComments() {
		return this.ast.comments;
	}

	/**
	 * Gets the deepest node containing a range index.
	 * @param {number} index Range index of the desired node.
	 * @returns {ASTNode} The node if found or null if not found.
	 * @public
	 */
	getNodeByRangeIndex(index) {
		let result = null;

		Traverser.traverse(this.ast, {
			visitorKeys: this.visitorKeys,
			enter(node) {
				if (node.range[0] <= index && index < node.range[1]) {
					result = node;
				} else {
					this.skip();
				}
			},
			leave(node) {
				if (node === result) {
					this.break();
				}
			},
		});

		return result;
	}

	/**
	 * Determines if two nodes or tokens have at least one whitespace character
	 * between them. Order does not matter. Returns false if the given nodes or
	 * tokens overlap.
	 * @param {ASTNode|Token} first The first node or token to check between.
	 * @param {ASTNode|Token} second The second node or token to check between.
	 * @returns {boolean} True if there is a whitespace character between
	 * any of the tokens found between the two given nodes or tokens.
	 * @public
	 */
	isSpaceBetween(first, second) {
		if (nodesOrTokensOverlap(first, second)) {
			return false;
		}

		const [startingNodeOrToken, endingNodeOrToken] =
			first.range[1] <= second.range[0]
				? [first, second]
				: [second, first];
		const firstToken =
			this.getLastToken(startingNodeOrToken) || startingNodeOrToken;
		const finalToken =
			this.getFirstToken(endingNodeOrToken) || endingNodeOrToken;
		let currentToken = firstToken;

		while (currentToken !== finalToken) {
			const nextToken = this.getTokenAfter(currentToken, {
				includeComments: true,
			});

			if (currentToken.range[1] !== nextToken.range[0]) {
				return true;
			}

			currentToken = nextToken;
		}

		return false;
	}

	/**
	 * Converts a source text index into a (line, column) pair.
	 * @param {number} index The index of a character in a file.
	 * @throws {TypeError|RangeError} If non-numeric index or index out of range.
	 * @returns {{line: number, column: number}} A {line, column} location object with 1-indexed line and 0-indexed column.
	 * @public
	 */
	getLocFromIndex(index) {
		if (typeof index !== "number") {
			throw new TypeError("Expected `index` to be a number.");
		}

		if (index < 0 || index > this.text.length) {
			throw new RangeError(
				`Index out of range (requested index ${index}, but source text has length ${this.text.length}).`,
			);
		}

		/*
		 * For an argument of this.text.length, return the location one "spot" past the last character
		 * of the file. If the last character is a linebreak, the location will be column 0 of the next
		 * line; otherwise, the location will be in the next column on the same line.
		 *
		 * See getIndexFromLoc for the motivation for this special case.
		 */
		if (index === this.text.length) {
			return {
				line: this.lines.length,
				column: this.lines.at(-1).length,
			};
		}

		/*
		 * To figure out which line index is on, determine the last place at which index could
		 * be inserted into lineStartIndices to keep the list sorted.
		 */
		const lineNumber =
			index >= this.lineStartIndices.at(-1)
				? this.lineStartIndices.length
				: findLineNumberBinarySearch(this.lineStartIndices, index);

		return {
			line: lineNumber,
			column: index - this.lineStartIndices[lineNumber - 1],
		};
	}

	/**
	 * Converts a (line, column) pair into a range index.
	 * @param {Object} loc A line/column location
	 * @param {number} loc.line The line number of the location (1-indexed)
	 * @param {number} loc.column The column number of the location (0-indexed)
	 * @throws {TypeError|RangeError} If `loc` is not an object with a numeric
	 *   `line` and `column`, if the `line` is less than or equal to zero or
	 *   the line or column is out of the expected range.
	 * @returns {number} The range index of the location in the file.
	 * @public
	 */
	getIndexFromLoc(loc) {
		if (
			loc === null ||
			typeof loc !== "object" ||
			typeof loc.line !== "number" ||
			typeof loc.column !== "number"
		) {
			throw new TypeError(
				"Expected `loc` to be an object with numeric `line` and `column` properties.",
			);
		}

		if (loc.line <= 0) {
			throw new RangeError(
				`Line number out of range (line ${loc.line} requested). Line numbers should be 1-based.`,
			);
		}

		if (loc.line > this.lineStartIndices.length) {
			throw new RangeError(
				`Line number out of range (line ${loc.line} requested, but only ${this.lineStartIndices.length} lines present).`,
			);
		}

		if (loc.column < 0) {
			throw new RangeError(
				`Invalid column number (column ${loc.column} requested).`,
			);
		}

		const lineStartIndex = this.lineStartIndices[loc.line - 1];
		const lineEndIndex =
			loc.line === this.lineStartIndices.length
				? this.text.length
				: this.lineStartIndices[loc.line];
		const positionIndex = lineStartIndex + loc.column;

		/*
		 * By design, getIndexFromLoc({ line: lineNum, column: 0 }) should return the start index of
		 * the given line, provided that the line number is valid element of this.lines. Since the
		 * last element of this.lines is an empty string for files with trailing newlines, add a
		 * special case where getting the index for the first location after the end of the file
		 * will return the length of the file, rather than throwing an error. This allows rules to
		 * use getIndexFromLoc consistently without worrying about edge cases at the end of a file.
		 */
		if (
			(loc.line === this.lineStartIndices.length &&
				positionIndex > lineEndIndex) ||
			(loc.line < this.lineStartIndices.length &&
				positionIndex >= lineEndIndex)
		) {
			throw new RangeError(
				`Column number out of range (column ${loc.column} requested, but the length of line ${loc.line} is ${lineEndIndex - lineStartIndex}).`,
			);
		}

		return positionIndex;
	}

	/**
	 * Gets the scope for the given node
	 * @param {ASTNode} currentNode The node to get the scope of
	 * @returns {Scope} The scope information for this node
	 * @throws {TypeError} If the `currentNode` argument is missing.
	 */
	getScope(currentNode) {
		if (!currentNode) {
			throw new TypeError("Missing required argument: node.");
		}

		// check cache first
		const cache = this[caches].get("scopes");
		const cachedScope = cache.get(currentNode);

		if (cachedScope) {
			return cachedScope;
		}

		// On Program node, get the outermost scope to avoid return Node.js special function scope or ES modules scope.
		const inner = currentNode.type !== "Program";

		for (let node = currentNode; node; node = node.parent) {
			const scope = this.scopeManager.acquire(node, inner);

			if (scope) {
				if (scope.type === "function-expression-name") {
					cache.set(currentNode, scope.childScopes[0]);
					return scope.childScopes[0];
				}

				cache.set(currentNode, scope);
				return scope;
			}
		}

		cache.set(currentNode, this.scopeManager.scopes[0]);
		return this.scopeManager.scopes[0];
	}

	/**
	 * Get the variables that `node` defines.
	 * This is a convenience method that passes through
	 * to the same method on the `scopeManager`.
	 * @param {ASTNode} node The node for which the variables are obtained.
	 * @returns {Array<Variable>} An array of variable nodes representing
	 *      the variables that `node` defines.
	 */
	getDeclaredVariables(node) {
		return this.scopeManager.getDeclaredVariables(node);
	}

	/* eslint-disable class-methods-use-this -- node is owned by SourceCode */
	/**
	 * Gets all the ancestors of a given node
	 * @param {ASTNode} node The node
	 * @returns {Array<ASTNode>} All the ancestor nodes in the AST, not including the provided node, starting
	 * from the root node at index 0 and going inwards to the parent node.
	 * @throws {TypeError} When `node` is missing.
	 */
	getAncestors(node) {
		if (!node) {
			throw new TypeError("Missing required argument: node.");
		}

		const ancestorsStartingAtParent = [];

		for (let ancestor = node.parent; ancestor; ancestor = ancestor.parent) {
			ancestorsStartingAtParent.push(ancestor);
		}

		return ancestorsStartingAtParent.reverse();
	}

	/**
	 * Determines whether the given identifier node is a reference to a global variable.
	 * @param {ASTNode} node `Identifier` node to check.
	 * @returns {boolean} True if the identifier is a reference to a global variable.
	 */
	isGlobalReference(node) {
		if (!node) {
			throw new TypeError("Missing required argument: node.");
		}

		const cache = this[caches].get("isGlobalReference");

		if (cache.has(node)) {
			return cache.get(node);
		}

		if (node.type !== "Identifier") {
			cache.set(node, false);
			return false;
		}

		const variable = this.scopeManager.scopes[0].set.get(node.name);

		if (!variable || variable.defs.length > 0) {
			cache.set(node, false);
			return false;
		}

		const result = variable.references.some(
			({ identifier }) => identifier === node,
		);
		cache.set(node, result);
		return result;
	}

	/**
	 * Returns the location of the given node or token.
	 * @param {ASTNode|Token} nodeOrToken The node or token to get the location of.
	 * @returns {SourceLocation} The location of the node or token.
	 */
	getLoc(nodeOrToken) {
		return nodeOrToken.loc;
	}

	/**
	 * Returns the range of the given node or token.
	 * @param {ASTNode|Token} nodeOrToken The node or token to get the range of.
	 * @returns {[number, number]} The range of the node or token.
	 */
	getRange(nodeOrToken) {
		return nodeOrToken.range;
	}

	/* eslint-enable class-methods-use-this -- node is owned by SourceCode */

	/**
	 * Marks a variable as used in the current scope
	 * @param {string} name The name of the variable to mark as used.
	 * @param {ASTNode} [refNode] The closest node to the variable reference.
	 * @returns {boolean} True if the variable was found and marked as used, false if not.
	 */
	markVariableAsUsed(name, refNode = this.ast) {
		const currentScope = this.getScope(refNode);
		let initialScope = currentScope;

		/*
		 * When we are in an ESM or CommonJS module, we need to start searching
		 * from the top-level scope, not the global scope. For ESM the top-level
		 * scope is the module scope; for CommonJS the top-level scope is the
		 * outer function scope.
		 *
		 * Without this check, we might miss a variable declared with `var` at
		 * the top-level because it won't exist in the global scope.
		 */
		if (
			currentScope.type === "global" &&
			currentScope.childScopes.length > 0 &&
			// top-level scopes refer to a `Program` node
			currentScope.childScopes[0].block === this.ast
		) {
			initialScope = currentScope.childScopes[0];
		}

		for (let scope = initialScope; scope; scope = scope.upper) {
			const variable = scope.variables.find(
				scopeVar => scopeVar.name === name,
			);

			if (variable) {
				variable.eslintUsed = true;
				return true;
			}
		}

		return false;
	}

	/**
	 * Returns an array of all inline configuration nodes found in the
	 * source code.
	 * @returns {Array<Token>} An array of all inline configuration nodes.
	 */
	getInlineConfigNodes() {
		// check the cache first
		let configNodes = this[caches].get("configNodes");

		if (configNodes) {
			return configNodes;
		}

		// calculate fresh config nodes
		configNodes = this.ast.comments.filter(comment => {
			// shebang comments are never directives
			if (comment.type === "Shebang") {
				return false;
			}

			const directive = commentParser.parseDirective(comment.value);

			if (!directive) {
				return false;
			}

			if (!directivesPattern.test(directive.label)) {
				return false;
			}

			// only certain comment types are supported as line comments
			return (
				comment.type !== "Line" ||
				!!/^eslint-disable-(?:next-)?line$/u.test(directive.label)
			);
		});

		this[caches].set("configNodes", configNodes);

		return configNodes;
	}

	/**
	 * Returns an all directive nodes that enable or disable rules along with any problems
	 * encountered while parsing the directives.
	 * @returns {{problems:Array<Problem>,directives:Array<Directive>}} Information
	 *      that ESLint needs to further process the directives.
	 */
	getDisableDirectives() {
		// check the cache first
		const cachedDirectives = this[caches].get("disableDirectives");

		if (cachedDirectives) {
			return cachedDirectives;
		}

		const problems = [];
		const directives = [];

		this.getInlineConfigNodes().forEach(comment => {
			// Step 1: Parse the directive
			const {
				label,
				value,
				justification: justificationPart,
			} = commentParser.parseDirective(comment.value);

			// Step 2: Extract the directive value
			const lineCommentSupported =
				/^eslint-disable-(?:next-)?line$/u.test(label);

			if (comment.type === "Line" && !lineCommentSupported) {
				return;
			}

			// Step 3: Validate the directive does not span multiple lines
			if (
				label === "eslint-disable-line" &&
				comment.loc.start.line !== comment.loc.end.line
			) {
				const message = `${label} comment should not span multiple lines.`;

				problems.push({
					ruleId: null,
					message,
					loc: comment.loc,
				});
				return;
			}

			// Step 4: Extract the directive value and create the Directive object
			switch (label) {
				case "eslint-disable":
				case "eslint-enable":
				case "eslint-disable-next-line":
				case "eslint-disable-line": {
					const directiveType = label.slice("eslint-".length);

					directives.push(
						new Directive({
							type: directiveType,
							node: comment,
							value,
							justification: justificationPart,
						}),
					);
				}

				// no default
			}
		});

		const result = { problems, directives };

		this[caches].set("disableDirectives", result);

		return result;
	}

	/**
	 * Applies language options sent in from the core.
	 * @param {Object} languageOptions The language options for this run.
	 * @returns {void}
	 */
	applyLanguageOptions(languageOptions) {
		/*
		 * Add configured globals and language globals
		 *
		 * Using Object.assign instead of object spread for performance reasons
		 * https://github.com/eslint/eslint/issues/16302
		 */
		const configGlobals = Object.assign(
			Object.create(null), // https://github.com/eslint/eslint/issues/18363
			getGlobalsForEcmaVersion(languageOptions.ecmaVersion),
			languageOptions.sourceType === "commonjs"
				? globals.commonjs
				: void 0,
			languageOptions.globals,
		);

		/*
		 * `normalizeConfigGlobal` will throw an error if a configured global value is invalid. However, these errors would
		 * typically be caught when validating a config anyway (validity for inline global comments is checked separately).
		 */
		for (const [name, value] of Object.entries(configGlobals)) {
			configGlobals[name] = normalizeConfigGlobal(value);
		}

		const varsCache = this[caches].get("vars");

		varsCache.set("configGlobals", configGlobals);
	}

	/**
	 * Applies configuration found inside of the source code. This method is only
	 * called when ESLint is running with inline configuration allowed.
	 * @returns {{problems:Array<Problem>,configs:{config:FlatConfigArray,loc:Location}}} Information
	 *      that ESLint needs to further process the inline configuration.
	 */
	applyInlineConfig() {
		const problems = [];
		const configs = [];
		const exportedVariables = {};
		const inlineGlobals = Object.create(null);

		this.getInlineConfigNodes().forEach(comment => {
			const { label, value } = commentParser.parseDirective(
				comment.value,
			);

			switch (label) {
				case "exported":
					Object.assign(
						exportedVariables,
						commentParser.parseListConfig(value),
					);
					break;

				case "globals":
				case "global":
					for (const [id, idSetting] of Object.entries(
						commentParser.parseStringConfig(value),
					)) {
						let normalizedValue;

						try {
							normalizedValue = normalizeConfigGlobal(idSetting);
						} catch (err) {
							problems.push({
								ruleId: null,
								loc: comment.loc,
								message: err.message,
							});
							continue;
						}

						if (inlineGlobals[id]) {
							inlineGlobals[id].comments.push(comment);
							inlineGlobals[id].value = normalizedValue;
						} else {
							inlineGlobals[id] = {
								comments: [comment],
								value: normalizedValue,
							};
						}
					}
					break;

				case "eslint": {
					const parseResult =
						commentParser.parseJSONLikeConfig(value);

					if (parseResult.ok) {
						configs.push({
							config: {
								rules: parseResult.config,
							},
							loc: comment.loc,
						});
					} else {
						problems.push({
							ruleId: null,
							loc: comment.loc,
							message: parseResult.error.message,
						});
					}

					break;
				}
				case "eslint-env": {
					problems.push({
						ruleId: null,
						loc: comment.loc,
						message:
							"/* eslint-env */ comments are no longer supported.",
					});
					break;
				}

				// no default
			}
		});

		// save all the new variables for later
		const varsCache = this[caches].get("vars");

		varsCache.set("inlineGlobals", inlineGlobals);
		varsCache.set("exportedVariables", exportedVariables);

		return {
			configs,
			problems,
		};
	}

	/**
	 * Called by ESLint core to indicate that it has finished providing
	 * information. We now add in all the missing variables and ensure that
	 * state-changing methods cannot be called by rules.
	 * @returns {void}
	 */
	finalize() {
		const varsCache = this[caches].get("vars");
		const configGlobals = varsCache.get("configGlobals");
		const inlineGlobals = varsCache.get("inlineGlobals");
		const exportedVariables = varsCache.get("exportedVariables");
		const globalScope = this.scopeManager.scopes[0];

		addDeclaredGlobals(this.scopeManager, configGlobals, inlineGlobals);

		if (exportedVariables) {
			markExportedVariables(globalScope, exportedVariables);
		}
	}

	/**
	 * Traverse the source code and return the steps that were taken.
	 * @returns {Array<TraversalStep>} The steps that were taken while traversing the source code.
	 */
	traverse() {
		// Because the AST doesn't mutate, we can cache the steps
		if (this.#steps) {
			return this.#steps;
		}

		const steps = (this.#steps = []);

		/*
		 * This logic works for any AST, not just ESTree. Because ESLint has allowed
		 * custom parsers to return any AST, we need to ensure that the traversal
		 * logic works for any AST.
		 */
		let analyzer = {
			enterNode(node) {
				steps.push(
					new VisitNodeStep({
						target: node,
						phase: 1,
						args: [node],
					}),
				);
			},
			leaveNode(node) {
				steps.push(
					new VisitNodeStep({
						target: node,
						phase: 2,
						args: [node],
					}),
				);
			},
			emit(eventName, args) {
				steps.push(
					new CallMethodStep({
						target: eventName,
						args,
					}),
				);
			},
		};

		/*
		 * We do code path analysis for ESTree only. Code path analysis is not
		 * necessary for other ASTs, and it's also not possible to do for other
		 * ASTs because the necessary information is not available.
		 *
		 * Generally speaking, we can tell that the AST is an ESTree if it has a
		 * Program node at the top level. This is not a perfect heuristic, but it
		 * is good enough for now.
		 */
		if (this.isESTree) {
			analyzer = new CodePathAnalyzer(analyzer);
		}

		/*
		 * The actual AST traversal is done by the `Traverser` class. This class
		 * is responsible for walking the AST and calling the appropriate methods
		 * on the `analyzer` object, which is appropriate for the given AST.
		 */
		Traverser.traverse(this.ast, {
			enter(node, parent) {
				// save the parent node on a property for backwards compatibility
				node.parent = parent;

				analyzer.enterNode(node);
			},
			leave(node) {
				analyzer.leaveNode(node);
			},
			visitorKeys: this.visitorKeys,
		});

		return steps;
	}
}

module.exports = SourceCode;
%xT100644 backward-token-comment-cursor.js V ~Jy9^100644 backward-token-cursor.js  A(' bg}100644 cursor.js @?
wpx7mWI100644 cursors.js LT'dS100644 decorative-cursor.js :!4,:QÕ100644 filter-cursor.js .ɖ@{92d7R`100644 forward-token-comment-cursor.js ԡC[K;IuA100644 forward-token-cursor.js \)<v٦	Xw100644 index.js ud6%Ā_[=100644 limit-cursor.js 0T3"Iz75100644 padded-token-cursor.js =<Oz'][@76\100644 skip-cursor.js k=`Oji\r[X100644 utils.js 6E$<_#V8B#`wxw/**
 * @fileoverview Define the cursor which iterates tokens and comments.
 * @author Toru Nagashima
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const Cursor = require("./cursor");
const { getFirstIndex, search } = require("./utils");

//------------------------------------------------------------------------------
// Exports
//------------------------------------------------------------------------------

/**
 * The cursor which iterates tokens and comments.
 */
module.exports = class ForwardTokenCommentCursor extends Cursor {
	/**
	 * Initializes this cursor.
	 * @param {Token[]} tokens The array of tokens.
	 * @param {Comment[]} comments The array of comments.
	 * @param {Object} indexMap The map from locations to indices in `tokens`.
	 * @param {number} startLoc The start location of the iteration range.
	 * @param {number} endLoc The end location of the iteration range.
	 */
	constructor(tokens, comments, indexMap, startLoc, endLoc) {
		super();
		this.tokens = tokens;
		this.comments = comments;
		this.tokenIndex = getFirstIndex(tokens, indexMap, startLoc);
		this.commentIndex = search(comments, startLoc);
		this.border = endLoc;
	}

	/** @inheritdoc */
	moveNext() {
		const token =
			this.tokenIndex < this.tokens.length
				? this.tokens[this.tokenIndex]
				: null;
		const comment =
			this.commentIndex < this.comments.length
				? this.comments[this.commentIndex]
				: null;

		if (token && (!comment || token.range[0] < comment.range[0])) {
			this.current = token;
			this.tokenIndex += 1;
		} else if (comment) {
			this.current = comment;
			this.commentIndex += 1;
		} else {
			this.current = null;
		}

		return (
			Boolean(this.current) &&
			(this.border === -1 || this.current.range[1] <= this.border)
		);
	}
};
SOAix !I in reverseIutilsn in reversehBackutils.getLaend9utils.search(comments, endLoc) - 1;
		this.border = startN>= 0 ~ />= 0 " 11] > comment.range[1W2-M-0] >]E-Eixk/**
 * @fileoverview Define the cursor which iterates tokens only.
 * @author Toru Nagashima
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const Cursor = require("./cursor");
const { getFirstIndex, getLastIndex } = require("./utils");

//------------------------------------------------------------------------------
// Exports
//------------------------------------------------------------------------------

/**
 * The cursor which iterates tokens only.
 */
module.exports = class ForwardTokenCursor extends Cursor {
	/**
	 * Initializes this cursor.
	 * @param {Token[]} tokens The array of tokens.
	 * @param {Comment[]} comments The array of comments.
	 * @param {Object} indexMap The map from locations to indices in `tokens`.
	 * @param {number} startLoc The start location of the iteration range.
	 * @param {number} endLoc The end location of the iteration range.
	 */
	constructor(tokens, comments, indexMap, startLoc, endLoc) {
		super();
		this.tokens = tokens;
		this.index = getFirstIndex(tokens, indexMap, startLoc);
		this.indexEnd = getLastIndex(tokens, indexMap, endLoc);
	}

	/** @inheritdoc */
	moveNext() {
		if (this.index <= this.indexEnd) {
			this.current = this.tokens[this.index];
			this.index += 1;
			return true;
		}
		return false;
	}

	/*
	 *
	 * Shorthand for performance.
	 *
	 */

	/** @inheritdoc */
	getOneToken() {
		return this.index <= this.indexEnd ? this.tokens[this.index] : null;
	}

	/** @inheritdoc */
	getAllTokens() {
		return this.tokens.slice(this.index, this.indexEnd + 1);
	}
};
K\!xl A in reverseALastIndex, getFirc in reverse^Back~&x)6>L-_>5};
#˶xi/**
 * @fileoverview Define the abstract class about cursors which iterate tokens.
 * @author Toru Nagashima
 */
"use strict";

//------------------------------------------------------------------------------
// Exports
//------------------------------------------------------------------------------

/**
 * The abstract class about cursors which iterate tokens.
 *
 * This class has 2 abstract methods.
 *
 * - `current: Token | Comment | null` ... The current token.
 * - `moveNext(): boolean` ... Moves this cursor to the next token. If the next token didn't exist, it returns `false`.
 *
 * This is similar to ES2015 Iterators.
 * However, Iterators were slow (at 2017-01), so I created this class as similar to C# IEnumerable.
 *
 * There are the following known sub classes.
 *
 * - ForwardTokenCursor .......... The cursor which iterates tokens only.
 * - BackwardTokenCursor ......... The cursor which iterates tokens only in reverse.
 * - ForwardTokenCommentCursor ... The cursor which iterates tokens and comments.
 * - BackwardTokenCommentCursor .. The cursor which iterates tokens and comments in reverse.
 * - DecorativeCursor
 *     - FilterCursor ............ The cursor which ignores the specified tokens.
 *     - SkipCursor .............. The cursor which ignores the first few tokens.
 *     - LimitCursor ............. The cursor which limits the count of tokens.
 *
 */
module.exports = class Cursor {
	/**
	 * Initializes this cursor.
	 */
	constructor() {
		this.current = null;
	}

	/**
	 * Gets the first token.
	 * This consumes this cursor.
	 * @returns {Token|Comment} The first token or null.
	 */
	getOneToken() {
		return this.moveNext() ? this.current : null;
	}

	/**
	 * Gets the first tokens.
	 * This consumes this cursor.
	 * @returns {(Token|Comment)[]} All tokens.
	 */
	getAllTokens() {
		const tokens = [];

		while (this.moveNext()) {
			tokens.push(this.current);
		}

		return tokens;
	}

	/**
	 * Moves this cursor to the next token.
	 * @returns {boolean} `true` if the next token exists.
	 * @abstract
	 */
	/* c8 ignore next */
	// eslint-disable-next-line class-methods-use-this -- Unused
	moveNext() {
		throw new Error("Not implemented.");
	}
};
['x}/**
 * @fileoverview Define 2 token factories; forward and backward.
 * @author Toru Nagashima
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const BackwardTokenCommentCursor = require("./backward-token-comment-cursor");
const BackwardTokenCursor = require("./backward-token-cursor");
const FilterCursor = require("./filter-cursor");
const ForwardTokenCommentCursor = require("./forward-token-comment-cursor");
const ForwardTokenCursor = require("./forward-token-cursor");
const LimitCursor = require("./limit-cursor");
const SkipCursor = require("./skip-cursor");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * The cursor factory.
 * @private
 */
class CursorFactory {
	/**
	 * Initializes this cursor.
	 * @param {Function} TokenCursor The class of the cursor which iterates tokens only.
	 * @param {Function} TokenCommentCursor The class of the cursor which iterates the mix of tokens and comments.
	 */
	constructor(TokenCursor, TokenCommentCursor) {
		this.TokenCursor = TokenCursor;
		this.TokenCommentCursor = TokenCommentCursor;
	}

	/**
	 * Creates a base cursor instance that can be decorated by createCursor.
	 * @param {Token[]} tokens The array of tokens.
	 * @param {Comment[]} comments The array of comments.
	 * @param {Object} indexMap The map from locations to indices in `tokens`.
	 * @param {number} startLoc The start location of the iteration range.
	 * @param {number} endLoc The end location of the iteration range.
	 * @param {boolean} includeComments The flag to iterate comments as well.
	 * @returns {Cursor} The created base cursor.
	 */
	createBaseCursor(
		tokens,
		comments,
		indexMap,
		startLoc,
		endLoc,
		includeComments,
	) {
		const Cursor = includeComments
			? this.TokenCommentCursor
			: this.TokenCursor;

		return new Cursor(tokens, comments, indexMap, startLoc, endLoc);
	}

	/**
	 * Creates a cursor that iterates tokens with normalized options.
	 * @param {Token[]} tokens The array of tokens.
	 * @param {Comment[]} comments The array of comments.
	 * @param {Object} indexMap The map from locations to indices in `tokens`.
	 * @param {number} startLoc The start location of the iteration range.
	 * @param {number} endLoc The end location of the iteration range.
	 * @param {boolean} includeComments The flag to iterate comments as well.
	 * @param {Function|null} filter The predicate function to choose tokens.
	 * @param {number} skip The count of tokens the cursor skips.
	 * @param {number} count The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility.
	 * @returns {Cursor} The created cursor.
	 */
	createCursor(
		tokens,
		comments,
		indexMap,
		startLoc,
		endLoc,
		includeComments,
		filter,
		skip,
		count,
	) {
		let cursor = this.createBaseCursor(
			tokens,
			comments,
			indexMap,
			startLoc,
			endLoc,
			includeComments,
		);

		if (filter) {
			cursor = new FilterCursor(cursor, filter);
		}
		if (skip >= 1) {
			cursor = new SkipCursor(cursor, skip);
		}
		if (count >= 0) {
			cursor = new LimitCursor(cursor, count);
		}

		return cursor;
	}
}

//------------------------------------------------------------------------------
// Exports
//------------------------------------------------------------------------------

module.exports = {
	forward: new CursorFactory(ForwardTokenCursor, ForwardTokenCommentCursor),
	backward: new CursorFactory(
		BackwardTokenCursor,
		BackwardTokenCommentCursor,
	),
};
+=PxZ <abstract class about cursors which manipulate another cursorA<abstract class about cursors which manipulate another cursor^
DecorativeFCCursor} cursor The cursor to be decorated.
	 */
	constructor(cursor?cursor = cursor*bconst retv = this.cursor.moveNext();

		this.current = this.cursor.current;

		return retv;
	}
};
{*x.gnores specified tokenH
Decorative1decorative-cursor/decorative cursor which ignores specified tokengilterCursor extends Decorative7Cursor} cursor The cursor to be decorated.
	 * @param {Function} predicate The predicate function to decide tokens this cursor iteratesBcursor, predicate) {
		super(cursor);
		this.predicate = predicate0predicate = this.predicate;

		while (super.moveNext()) {
			if (predicate(this.current)) {
				return true;
			}
		}
		return false;
	}
};
ǰ
x@T/**
 * @fileoverview Object to handle access and retrieval of tokens.
 * @author Brandon Mills
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const { isCommentToken } = require("@eslint-community/eslint-utils");
const assert = require("../../../../shared/assert");
const cursors = require("./cursors");
const ForwardTokenCursor = require("./forward-token-cursor");
const PaddedTokenCursor = require("./padded-token-cursor");
const utils = require("./utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const TOKENS = Symbol("tokens");
const COMMENTS = Symbol("comments");
const INDEX_MAP = Symbol("indexMap");

/**
 * Creates the map from locations to indices in `tokens`.
 *
 * The first/last location of tokens is mapped to the index of the token.
 * The first/last location of comments is mapped to the index of the next token of each comment.
 * @param {Token[]} tokens The array of tokens.
 * @param {Comment[]} comments The array of comments.
 * @returns {Object} The map from locations to indices in `tokens`.
 * @private
 */
function createIndexMap(tokens, comments) {
	const map = Object.create(null);
	let tokenIndex = 0;
	let commentIndex = 0;
	let nextStart;
	let range;

	while (tokenIndex < tokens.length || commentIndex < comments.length) {
		nextStart =
			commentIndex < comments.length
				? comments[commentIndex].range[0]
				: Number.MAX_SAFE_INTEGER;
		while (
			tokenIndex < tokens.length &&
			(range = tokens[tokenIndex].range)[0] < nextStart
		) {
			map[range[0]] = tokenIndex;
			map[range[1] - 1] = tokenIndex;
			tokenIndex += 1;
		}

		nextStart =
			tokenIndex < tokens.length
				? tokens[tokenIndex].range[0]
				: Number.MAX_SAFE_INTEGER;
		while (
			commentIndex < comments.length &&
			(range = comments[commentIndex].range)[0] < nextStart
		) {
			map[range[0]] = tokenIndex;
			map[range[1] - 1] = tokenIndex;
			commentIndex += 1;
		}
	}

	return map;
}

/**
 * Creates the cursor iterates tokens with options.
 * @param {CursorFactory} factory The cursor factory to initialize cursor.
 * @param {Token[]} tokens The array of tokens.
 * @param {Comment[]} comments The array of comments.
 * @param {Object} indexMap The map from locations to indices in `tokens`.
 * @param {number} startLoc The start location of the iteration range.
 * @param {number} endLoc The end location of the iteration range.
 * @param {number|Function|Object} [opts=0] The option object. If this is a number then it's `opts.skip`. If this is a function then it's `opts.filter`.
 * @param {boolean} [opts.includeComments=false] The flag to iterate comments as well.
 * @param {Function|null} [opts.filter=null] The predicate function to choose tokens.
 * @param {number} [opts.skip=0] The count of tokens the cursor skips.
 * @returns {Cursor} The created cursor.
 * @private
 */
function createCursorWithSkip(
	factory,
	tokens,
	comments,
	indexMap,
	startLoc,
	endLoc,
	opts,
) {
	let includeComments = false;
	let skip = 0;
	let filter = null;

	if (typeof opts === "number") {
		skip = opts | 0;
	} else if (typeof opts === "function") {
		filter = opts;
	} else if (opts) {
		includeComments = !!opts.includeComments;
		skip = opts.skip | 0;
		filter = opts.filter || null;
	}
	assert(skip >= 0, "options.skip should be zero or a positive integer.");
	assert(
		!filter || typeof filter === "function",
		"options.filter should be a function.",
	);

	return factory.createCursor(
		tokens,
		comments,
		indexMap,
		startLoc,
		endLoc,
		includeComments,
		filter,
		skip,
		-1,
	);
}

/**
 * Creates the cursor iterates tokens with options.
 * @param {CursorFactory} factory The cursor factory to initialize cursor.
 * @param {Token[]} tokens The array of tokens.
 * @param {Comment[]} comments The array of comments.
 * @param {Object} indexMap The map from locations to indices in `tokens`.
 * @param {number} startLoc The start location of the iteration range.
 * @param {number} endLoc The end location of the iteration range.
 * @param {number|Function|Object} [opts=0] The option object. If this is a number then it's `opts.count`. If this is a function then it's `opts.filter`.
 * @param {boolean} [opts.includeComments] The flag to iterate comments as well.
 * @param {Function|null} [opts.filter=null] The predicate function to choose tokens.
 * @param {number} [opts.count=0] The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility.
 * @returns {Cursor} The created cursor.
 * @private
 */
function createCursorWithCount(
	factory,
	tokens,
	comments,
	indexMap,
	startLoc,
	endLoc,
	opts,
) {
	let includeComments = false;
	let count = 0;
	let countExists = false;
	let filter = null;

	if (typeof opts === "number") {
		count = opts | 0;
		countExists = true;
	} else if (typeof opts === "function") {
		filter = opts;
	} else if (opts) {
		includeComments = !!opts.includeComments;
		count = opts.count | 0;
		countExists = typeof opts.count === "number";
		filter = opts.filter || null;
	}
	assert(count >= 0, "options.count should be zero or a positive integer.");
	assert(
		!filter || typeof filter === "function",
		"options.filter should be a function.",
	);

	return factory.createCursor(
		tokens,
		comments,
		indexMap,
		startLoc,
		endLoc,
		includeComments,
		filter,
		0,
		countExists ? count : -1,
	);
}

/**
 * Creates the cursor iterates tokens with options.
 * This is overload function of the below.
 * @param {Token[]} tokens The array of tokens.
 * @param {Comment[]} comments The array of comments.
 * @param {Object} indexMap The map from locations to indices in `tokens`.
 * @param {number} startLoc The start location of the iteration range.
 * @param {number} endLoc The end location of the iteration range.
 * @param {Function|Object} opts The option object. If this is a function then it's `opts.filter`.
 * @param {boolean} [opts.includeComments] The flag to iterate comments as well.
 * @param {Function|null} [opts.filter=null] The predicate function to choose tokens.
 * @param {number} [opts.count=0] The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility.
 * @returns {Cursor} The created cursor.
 * @private
 */
/**
 * Creates the cursor iterates tokens with options.
 * @param {Token[]} tokens The array of tokens.
 * @param {Comment[]} comments The array of comments.
 * @param {Object} indexMap The map from locations to indices in `tokens`.
 * @param {number} startLoc The start location of the iteration range.
 * @param {number} endLoc The end location of the iteration range.
 * @param {number} [beforeCount=0] The number of tokens before the node to retrieve.
 * @param {boolean} [afterCount=0] The number of tokens after the node to retrieve.
 * @returns {Cursor} The created cursor.
 * @private
 */
function createCursorWithPadding(
	tokens,
	comments,
	indexMap,
	startLoc,
	endLoc,
	beforeCount,
	afterCount,
) {
	if (
		typeof beforeCount === "undefined" &&
		typeof afterCount === "undefined"
	) {
		return new ForwardTokenCursor(
			tokens,
			comments,
			indexMap,
			startLoc,
			endLoc,
		);
	}
	if (typeof beforeCount === "number" || typeof beforeCount === "undefined") {
		return new PaddedTokenCursor(
			tokens,
			comments,
			indexMap,
			startLoc,
			endLoc,
			beforeCount | 0,
			afterCount | 0,
		);
	}
	return createCursorWithCount(
		cursors.forward,
		tokens,
		comments,
		indexMap,
		startLoc,
		endLoc,
		beforeCount,
	);
}

/**
 * Gets comment tokens that are adjacent to the current cursor position.
 * @param {Cursor} cursor A cursor instance.
 * @returns {Array} An array of comment tokens adjacent to the current cursor position.
 * @private
 */
function getAdjacentCommentTokensFromCursor(cursor) {
	const tokens = [];
	let currentToken = cursor.getOneToken();

	while (currentToken && isCommentToken(currentToken)) {
		tokens.push(currentToken);
		currentToken = cursor.getOneToken();
	}

	return tokens;
}

//------------------------------------------------------------------------------
// Exports
//------------------------------------------------------------------------------

/**
 * The token store.
 *
 * This class provides methods to get tokens by locations as fast as possible.
 * The methods are a part of public API, so we should be careful if it changes this class.
 *
 * People can get tokens in O(1) by the hash map which is mapping from the location of tokens/comments to tokens.
 * Also people can get a mix of tokens and comments in O(log k), the k is the number of comments.
 * Assuming that comments to be much fewer than tokens, this does not make hash map from token's locations to comments to reduce memory cost.
 * This uses binary-searching instead for comments.
 */
module.exports = class TokenStore {
	/**
	 * Initializes this token store.
	 * @param {Token[]} tokens The array of tokens.
	 * @param {Comment[]} comments The array of comments.
	 */
	constructor(tokens, comments) {
		this[TOKENS] = tokens;
		this[COMMENTS] = comments;
		this[INDEX_MAP] = createIndexMap(tokens, comments);
	}

	//--------------------------------------------------------------------------
	// Gets single token.
	//--------------------------------------------------------------------------

	/**
	 * Gets the token starting at the specified index.
	 * @param {number} offset Index of the start of the token's range.
	 * @param {Object} [options=0] The option object.
	 * @param {boolean} [options.includeComments=false] The flag to iterate comments as well.
	 * @returns {Token|null} The token starting at index, or null if no such token.
	 */
	getTokenByRangeStart(offset, options) {
		const includeComments = options && options.includeComments;
		const token = cursors.forward
			.createBaseCursor(
				this[TOKENS],
				this[COMMENTS],
				this[INDEX_MAP],
				offset,
				-1,
				includeComments,
			)
			.getOneToken();

		if (token && token.range[0] === offset) {
			return token;
		}
		return null;
	}

	/**
	 * Gets the first token of the given node.
	 * @param {ASTNode} node The AST node.
	 * @param {number|Function|Object} [options=0] The option object. If this is a number then it's `options.skip`. If this is a function then it's `options.filter`.
	 * @param {boolean} [options.includeComments=false] The flag to iterate comments as well.
	 * @param {Function|null} [options.filter=null] The predicate function to choose tokens.
	 * @param {number} [options.skip=0] The count of tokens the cursor skips.
	 * @returns {Token|null} An object representing the token.
	 */
	getFirstToken(node, options) {
		return createCursorWithSkip(
			cursors.forward,
			this[TOKENS],
			this[COMMENTS],
			this[INDEX_MAP],
			node.range[0],
			node.range[1],
			options,
		).getOneToken();
	}

	/**
	 * Gets the last token of the given node.
	 * @param {ASTNode} node The AST node.
	 * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken()
	 * @returns {Token|null} An object representing the token.
	 */
	getLastToken(node, options) {
		return createCursorWithSkip(
			cursors.backward,
			this[TOKENS],
			this[COMMENTS],
			this[INDEX_MAP],
			node.range[0],
			node.range[1],
			options,
		).getOneToken();
	}

	/**
	 * Gets the token that precedes a given node or token.
	 * @param {ASTNode|Token|Comment} node The AST node or token.
	 * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken()
	 * @returns {Token|null} An object representing the token.
	 */
	getTokenBefore(node, options) {
		return createCursorWithSkip(
			cursors.backward,
			this[TOKENS],
			this[COMMENTS],
			this[INDEX_MAP],
			-1,
			node.range[0],
			options,
		).getOneToken();
	}

	/**
	 * Gets the token that follows a given node or token.
	 * @param {ASTNode|Token|Comment} node The AST node or token.
	 * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken()
	 * @returns {Token|null} An object representing the token.
	 */
	getTokenAfter(node, options) {
		return createCursorWithSkip(
			cursors.forward,
			this[TOKENS],
			this[COMMENTS],
			this[INDEX_MAP],
			node.range[1],
			-1,
			options,
		).getOneToken();
	}

	/**
	 * Gets the first token between two non-overlapping nodes.
	 * @param {ASTNode|Token|Comment} left Node before the desired token range.
	 * @param {ASTNode|Token|Comment} right Node after the desired token range.
	 * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken()
	 * @returns {Token|null} An object representing the token.
	 */
	getFirstTokenBetween(left, right, options) {
		return createCursorWithSkip(
			cursors.forward,
			this[TOKENS],
			this[COMMENTS],
			this[INDEX_MAP],
			left.range[1],
			right.range[0],
			options,
		).getOneToken();
	}

	/**
	 * Gets the last token between two non-overlapping nodes.
	 * @param {ASTNode|Token|Comment} left Node before the desired token range.
	 * @param {ASTNode|Token|Comment} right Node after the desired token range.
	 * @param {number|Function|Object} [options=0] The option object. Same options as getFirstToken()
	 * @returns {Token|null} An object representing the token.
	 */
	getLastTokenBetween(left, right, options) {
		return createCursorWithSkip(
			cursors.backward,
			this[TOKENS],
			this[COMMENTS],
			this[INDEX_MAP],
			left.range[1],
			right.range[0],
			options,
		).getOneToken();
	}

	//--------------------------------------------------------------------------
	// Gets multiple tokens.
	//--------------------------------------------------------------------------

	/**
	 * Gets the first `count` tokens of the given node.
	 * @param {ASTNode} node The AST node.
	 * @param {number|Function|Object} [options=0] The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
	 * @param {boolean} [options.includeComments=false] The flag to iterate comments as well.
	 * @param {Function|null} [options.filter=null] The predicate function to choose tokens.
	 * @param {number} [options.count=0] The maximum count of tokens the cursor iterates.
	 * @returns {Token[]} Tokens.
	 */
	getFirstTokens(node, options) {
		return createCursorWithCount(
			cursors.forward,
			this[TOKENS],
			this[COMMENTS],
			this[INDEX_MAP],
			node.range[0],
			node.range[1],
			options,
		).getAllTokens();
	}

	/**
	 * Gets the last `count` tokens of the given node.
	 * @param {ASTNode} node The AST node.
	 * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens()
	 * @returns {Token[]} Tokens.
	 */
	getLastTokens(node, options) {
		return createCursorWithCount(
			cursors.backward,
			this[TOKENS],
			this[COMMENTS],
			this[INDEX_MAP],
			node.range[0],
			node.range[1],
			options,
		)
			.getAllTokens()
			.reverse();
	}

	/**
	 * Gets the `count` tokens that precedes a given node or token.
	 * @param {ASTNode|Token|Comment} node The AST node or token.
	 * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens()
	 * @returns {Token[]} Tokens.
	 */
	getTokensBefore(node, options) {
		return createCursorWithCount(
			cursors.backward,
			this[TOKENS],
			this[COMMENTS],
			this[INDEX_MAP],
			-1,
			node.range[0],
			options,
		)
			.getAllTokens()
			.reverse();
	}

	/**
	 * Gets the `count` tokens that follows a given node or token.
	 * @param {ASTNode|Token|Comment} node The AST node or token.
	 * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens()
	 * @returns {Token[]} Tokens.
	 */
	getTokensAfter(node, options) {
		return createCursorWithCount(
			cursors.forward,
			this[TOKENS],
			this[COMMENTS],
			this[INDEX_MAP],
			node.range[1],
			-1,
			options,
		).getAllTokens();
	}

	/**
	 * Gets the first `count` tokens between two non-overlapping nodes.
	 * @param {ASTNode|Token|Comment} left Node before the desired token range.
	 * @param {ASTNode|Token|Comment} right Node after the desired token range.
	 * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens()
	 * @returns {Token[]} Tokens between left and right.
	 */
	getFirstTokensBetween(left, right, options) {
		return createCursorWithCount(
			cursors.forward,
			this[TOKENS],
			this[COMMENTS],
			this[INDEX_MAP],
			left.range[1],
			right.range[0],
			options,
		).getAllTokens();
	}

	/**
	 * Gets the last `count` tokens between two non-overlapping nodes.
	 * @param {ASTNode|Token|Comment} left Node before the desired token range.
	 * @param {ASTNode|Token|Comment} right Node after the desired token range.
	 * @param {number|Function|Object} [options=0] The option object. Same options as getFirstTokens()
	 * @returns {Token[]} Tokens between left and right.
	 */
	getLastTokensBetween(left, right, options) {
		return createCursorWithCount(
			cursors.backward,
			this[TOKENS],
			this[COMMENTS],
			this[INDEX_MAP],
			left.range[1],
			right.range[0],
			options,
		)
			.getAllTokens()
			.reverse();
	}

	/**
	 * Gets all tokens that are related to the given node.
	 * @param {ASTNode} node The AST node.
	 * @param {Function|Object} options The option object. If this is a function then it's `options.filter`.
	 * @param {boolean} [options.includeComments=false] The flag to iterate comments as well.
	 * @param {Function|null} [options.filter=null] The predicate function to choose tokens.
	 * @param {number} [options.count=0] The maximum count of tokens the cursor iterates.
	 * @returns {Token[]} Array of objects representing tokens.
	 */
	/**
	 * Gets all tokens that are related to the given node.
	 * @param {ASTNode} node The AST node.
	 * @param {number} [beforeCount=0] The number of tokens before the node to retrieve.
	 * @param {number} [afterCount=0] The number of tokens after the node to retrieve.
	 * @returns {Token[]} Array of objects representing tokens.
	 */
	getTokens(node, beforeCount, afterCount) {
		return createCursorWithPadding(
			this[TOKENS],
			this[COMMENTS],
			this[INDEX_MAP],
			node.range[0],
			node.range[1],
			beforeCount,
			afterCount,
		).getAllTokens();
	}

	/**
	 * Gets all of the tokens between two non-overlapping nodes.
	 * @param {ASTNode|Token|Comment} left Node before the desired token range.
	 * @param {ASTNode|Token|Comment} right Node after the desired token range.
	 * @param {Function|Object} options The option object. If this is a function then it's `options.filter`.
	 * @param {boolean} [options.includeComments=false] The flag to iterate comments as well.
	 * @param {Function|null} [options.filter=null] The predicate function to choose tokens.
	 * @param {number} [options.count=0] The maximum count of tokens the cursor iterates.
	 * @returns {Token[]} Tokens between left and right.
	 */
	/**
	 * Gets all of the tokens between two non-overlapping nodes.
	 * @param {ASTNode|Token|Comment} left Node before the desired token range.
	 * @param {ASTNode|Token|Comment} right Node after the desired token range.
	 * @param {number} [padding=0] Number of extra tokens on either side of center.
	 * @returns {Token[]} Tokens between left and right.
	 */
	getTokensBetween(left, right, padding) {
		return createCursorWithPadding(
			this[TOKENS],
			this[COMMENTS],
			this[INDEX_MAP],
			left.range[1],
			right.range[0],
			padding,
			padding,
		).getAllTokens();
	}

	//--------------------------------------------------------------------------
	// Others.
	//--------------------------------------------------------------------------

	/**
	 * Checks whether any comments exist or not between the given 2 nodes.
	 * @param {ASTNode} left The node to check.
	 * @param {ASTNode} right The node to check.
	 * @returns {boolean} `true` if one or more comments exist.
	 */
	commentsExistBetween(left, right) {
		const index = utils.search(this[COMMENTS], left.range[1]);

		return (
			index < this[COMMENTS].length &&
			this[COMMENTS][index].range[1] <= right.range[0]
		);
	}

	/**
	 * Gets all comment tokens directly before the given node or token.
	 * @param {ASTNode|token} nodeOrToken The AST node or token to check for adjacent comment tokens.
	 * @returns {Array} An array of comments in occurrence order.
	 */
	getCommentsBefore(nodeOrToken) {
		const cursor = createCursorWithCount(
			cursors.backward,
			this[TOKENS],
			this[COMMENTS],
			this[INDEX_MAP],
			-1,
			nodeOrToken.range[0],
			{ includeComments: true },
		);

		return getAdjacentCommentTokensFromCursor(cursor).reverse();
	}

	/**
	 * Gets all comment tokens directly after the given node or token.
	 * @param {ASTNode|token} nodeOrToken The AST node or token to check for adjacent comment tokens.
	 * @returns {Array} An array of comments in occurrence order.
	 */
	getCommentsAfter(nodeOrToken) {
		const cursor = createCursorWithCount(
			cursors.forward,
			this[TOKENS],
			this[COMMENTS],
			this[INDEX_MAP],
			nodeOrToken.range[1],
			-1,
			{ includeComments: true },
		);

		return getAdjacentCommentTokensFromCursor(cursor);
	}

	/**
	 * Gets all comment tokens inside the given node.
	 * @param {ASTNode} node The AST node to get the comments for.
	 * @returns {Array} An array of comments in occurrence order.
	 */
	getCommentsInside(node) {
		return this.getTokens(node, {
			includeComments: true,
			filter: isCommentToken,
		});
	}
};

y$xN-limits the number of tokenH
Decorative1decorative-cursor2decorative cursor which limits the number of tokengLimitCursor extends Decorative7mCursor} cursor The cursor to be decorated.
	 * @param {number} count The count of tokens this cursor iterates6cursor, count) {
		super(cursor);
		this.count = count*`if (this.count > 0) {
			this.count -= 1;
			return super.moveNext();
		}
		return false;
	}
};
~&UxmA, with inflated rangeA4ForwardTokenCursor = require("./forward-token-cursorS, with inflated range.
 * This is for the backward compatibility of padding options^PaddeForwardTokennbeforeCount The number of tokens this cursor iterates before start.
	 * @param {number} afterCount The number of tokens this cursor iterates after end.
	 */
	constructor(
		tokens,
		comments,
		indexMap,
		startLoc,
		endLoc,
		beforeCount,
		afterCount,
	) {
		supe/;
		this.index = Math.max(0, this.index - beforeCount);
		this.indexEnd = Math.min(tokens.length - 1, this.indexEnd + afterCoun
t);
	}
};
>ҽCx+.gnores the first few tokenH
Decorative1decorative-cursor3decorative cursor which ignores the first few tokengSkipCursor extends Decorative7jCursor} cursor The cursor to be decorated.
	 * @param {number} count The count of tokens this cursor skips6cursor, count) {
		super(cursor);
		this.count = count*while (this.count > 0) {
			this.count -= 1;
			if (!super.moveNext()) {
				return false;
			}
		}
		return super.moveNext();
	}
};
P	x /**
 * @fileoverview Define utility functions for token store.
 * @author Toru Nagashima
 */
"use strict";

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Finds the index of the first token which is after the given location.
 * If it was not found, this returns `tokens.length`.
 * @param {(Token|Comment)[]} tokens It searches the token in this list.
 * @param {number} location The location to search.
 * @returns {number} The found index or `tokens.length`.
 */
function search(tokens, location) {
	for (
		let minIndex = 0, maxIndex = tokens.length - 1;
		minIndex <= maxIndex;
	) {
		/*
		 * Calculate the index in the middle between minIndex and maxIndex.
		 * `| 0` is used to round a fractional value down to the nearest integer: this is similar to
		 * using `Math.trunc()` or `Math.floor()`, but performance tests have shown this method to
		 * be faster.
		 */
		const index = ((minIndex + maxIndex) / 2) | 0;
		const token = tokens[index];
		const tokenStartLocation = token.range[0];

		if (location <= tokenStartLocation) {
			if (index === minIndex) {
				return index;
			}
			maxIndex = index;
		} else {
			minIndex = index + 1;
		}
	}
	return tokens.length;
}

/**
 * Gets the index of the `startLoc` in `tokens`.
 * `startLoc` can be the value of `node.range[1]`, so this checks about `startLoc - 1` as well.
 * @param {(Token|Comment)[]} tokens The tokens to find an index.
 * @param {Object} indexMap The map from locations to indices.
 * @param {number} startLoc The location to get an index.
 * @returns {number} The index.
 */
function getFirstIndex(tokens, indexMap, startLoc) {
	if (startLoc === -1) {
		return 0;
	}
	if (startLoc in indexMap) {
		return indexMap[startLoc];
	}
	if (startLoc - 1 in indexMap) {
		const index = indexMap[startLoc - 1];
		const token = tokens[index];

		// If the mapped index is out of bounds, the returned cursor index will point after the end of the tokens array.
		if (!token) {
			return tokens.length;
		}

		/*
		 * For the map of "comment's location -> token's index", it points the next token of a comment.
		 * In that case, +1 is unnecessary.
		 */
		if (token.range[0] >= startLoc) {
			return index;
		}
		return index + 1;
	}

	// Program node that doesn't start/end with a token or comment
	if (startLoc === 0) {
		return 0;
	}
	return tokens.length;
}
/**
 * Gets the index of the `endLoc` in `tokens`.
 * The information of end locations are recorded at `endLoc - 1` in `indexMap`, so this checks about `endLoc - 1` as well.
 * @param {(Token|Comment)[]} tokens The tokens to find an index.
 * @param {Object} indexMap The map from locations to indices.
 * @param {number} endLoc The location to get an index.
 * @returns {number} The index.
 */
function getLastIndex(tokens, indexMap, endLoc) {
	if (endLoc === -1) {
		return tokens.length - 1;
	}
	if (endLoc in indexMap) {
		return indexMap[endLoc] - 1;
	}
	if (endLoc - 1 in indexMap) {
		const index = indexMap[endLoc - 1];
		const token = tokens[index];

		// If the mapped index is out of bounds, the returned cursor index will point before the end of the tokens array.
		if (!token) {
			return tokens.length - 1;
		}

		/*
		 * For the map of "comment's location -> token's index", it points the next token of a comment.
		 * In that case, -1 is necessary.
		 */
		if (token.range[1] > endLoc) {
			return index - 1;
		}
		return index;
	}

	// Program node that doesn't start/end with a token or comment
	if (endLoc === 0) {
		return -1;
	}
	return tokens.length - 1;
}

//------------------------------------------------------------------------------
// Exports
//------------------------------------------------------------------------------

module.exports = { search, getFirstIndex, getLastIndex };
4￤xO/**
 * @fileoverview The schema to validate language options
 * @author Nicholas C. Zakas
 */

"use strict";

//-----------------------------------------------------------------------------
// Data
//-----------------------------------------------------------------------------

const globalVariablesValues = new Set([
	true,
	"true",
	"writable",
	"writeable",
	false,
	"false",
	"readonly",
	"readable",
	null,
	"off",
]);

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Check if a value is a non-null object.
 * @param {any} value The value to check.
 * @returns {boolean} `true` if the value is a non-null object.
 */
function isNonNullObject(value) {
	return typeof value === "object" && value !== null;
}

/**
 * Check if a value is a non-null non-array object.
 * @param {any} value The value to check.
 * @returns {boolean} `true` if the value is a non-null non-array object.
 */
function isNonArrayObject(value) {
	return isNonNullObject(value) && !Array.isArray(value);
}

/**
 * Check if a value is undefined.
 * @param {any} value The value to check.
 * @returns {boolean} `true` if the value is undefined.
 */
function isUndefined(value) {
	return typeof value === "undefined";
}

//-----------------------------------------------------------------------------
// Schemas
//-----------------------------------------------------------------------------

/**
 * Validates the ecmaVersion property.
 * @param {string|number} ecmaVersion The value to check.
 * @returns {void}
 * @throws {TypeError} If the value is invalid.
 */
function validateEcmaVersion(ecmaVersion) {
	if (isUndefined(ecmaVersion)) {
		throw new TypeError(
			'Key "ecmaVersion": Expected an "ecmaVersion" property.',
		);
	}

	if (typeof ecmaVersion !== "number" && ecmaVersion !== "latest") {
		throw new TypeError(
			'Key "ecmaVersion": Expected a number or "latest".',
		);
	}
}

/**
 * Validates the sourceType property.
 * @param {string} sourceType The value to check.
 * @returns {void}
 * @throws {TypeError} If the value is invalid.
 */
function validateSourceType(sourceType) {
	if (
		typeof sourceType !== "string" ||
		!/^(?:script|module|commonjs)$/u.test(sourceType)
	) {
		throw new TypeError(
			'Key "sourceType": Expected "script", "module", or "commonjs".',
		);
	}
}

/**
 * Validates the globals property.
 * @param {Object} globals The value to check.
 * @returns {void}
 * @throws {TypeError} If the value is invalid.
 */
function validateGlobals(globals) {
	if (!isNonArrayObject(globals)) {
		throw new TypeError('Key "globals": Expected an object.');
	}

	for (const key of Object.keys(globals)) {
		// avoid hairy edge case
		if (key === "__proto__") {
			continue;
		}

		if (key !== key.trim()) {
			throw new TypeError(
				`Key "globals": Global "${key}" has leading or trailing whitespace.`,
			);
		}

		if (!globalVariablesValues.has(globals[key])) {
			throw new TypeError(
				`Key "globals": Key "${key}": Expected "readonly", "writable", or "off".`,
			);
		}
	}
}

/**
 * Validates the parser property.
 * @param {Object} parser The value to check.
 * @returns {void}
 * @throws {TypeError} If the value is invalid.
 */
function validateParser(parser) {
	if (
		!parser ||
		typeof parser !== "object" ||
		(typeof parser.parse !== "function" &&
			typeof parser.parseForESLint !== "function")
	) {
		throw new TypeError(
			'Key "parser": Expected object with parse() or parseForESLint() method.',
		);
	}
}

/**
 * Validates the language options.
 * @param {Object} languageOptions The language options to validate.
 * @returns {void}
 * @throws {TypeError} If the language options are invalid.
 */
function validateLanguageOptions(languageOptions) {
	if (!isNonArrayObject(languageOptions)) {
		throw new TypeError("Expected an object.");
	}

	const {
		ecmaVersion,
		sourceType,
		globals,
		parser,
		parserOptions,
		...otherOptions
	} = languageOptions;

	if ("ecmaVersion" in languageOptions) {
		validateEcmaVersion(ecmaVersion);
	}

	if ("sourceType" in languageOptions) {
		validateSourceType(sourceType);
	}

	if ("globals" in languageOptions) {
		validateGlobals(globals);
	}

	if ("parser" in languageOptions) {
		validateParser(parser);
	}

	if ("parserOptions" in languageOptions) {
		if (!isNonArrayObject(parserOptions)) {
			throw new TypeError('Key "parserOptions": Expected an object.');
		}
	}

	const otherOptionKeys = Object.keys(otherOptions);

	if (otherOptionKeys.length > 0) {
		throw new TypeError(`Unexpected key "${otherOptionKeys[0]}" found.`);
	}
}

module.exports = { validateLanguageOptions };
ݶU%xZ100644 apply-disable-directives.js +Lf~
!VN640000 code-path-analysis H|sHXo100644 esquery.js 1k}m=;CxX100644 file-context.js :P;
HU100644 file-report.js nhd5|O(100644 index.js Z;6D@4O^100644 interpolate.js c'nifrote/100644 linter.js Kdҽpy W{tf100644 rule-fixer.js `Vp8lB-n/100644 source-code-fixer.js ,,`@3!<9Bt݄7100644 source-code-traverser.js 
b5Iٟilcv-100644 source-code-visitor.js Ze8vd*iȽlN100644 timing.js KQRL!K100644 vfile.js !W1p:!>Mb	xJr/**
 * @fileoverview A module that filters reported problems based on `eslint-disable` and `eslint-enable` comments
 * @author Teddy Katz
 */

"use strict";

//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------

/** @typedef {import("../types").Linter.LintMessage} LintMessage */
/** @typedef {import("@eslint/core").Language} Language */
/** @typedef {import("@eslint/core").Position} Position */
/** @typedef {import("@eslint/core").RulesConfig} RulesConfig */

//------------------------------------------------------------------------------
// Module Definition
//------------------------------------------------------------------------------

const escapeRegExp = require("escape-string-regexp");
const { Config } = require("../config/config.js");

/**
 * Compares the locations of two objects in a source file
 * @param {Position} itemA The first object
 * @param {Position} itemB The second object
 * @returns {number} A value less than 1 if itemA appears before itemB in the source file, greater than 1 if
 * itemA appears after itemB in the source file, or 0 if itemA and itemB have the same location.
 */
function compareLocations(itemA, itemB) {
	return itemA.line - itemB.line || itemA.column - itemB.column;
}

/**
 * Groups a set of directives into sub-arrays by their parent comment.
 * @param {Iterable<Directive>} directives Unused directives to be removed.
 * @returns {Directive[][]} Directives grouped by their parent comment.
 */
function groupByParentDirective(directives) {
	const groups = new Map();

	for (const directive of directives) {
		const {
			unprocessedDirective: { parentDirective },
		} = directive;

		if (groups.has(parentDirective)) {
			groups.get(parentDirective).push(directive);
		} else {
			groups.set(parentDirective, [directive]);
		}
	}

	return [...groups.values()];
}

/**
 * Creates removal details for a set of directives within the same comment.
 * @param {Directive[]} directives Unused directives to be removed.
 * @param {{node: Token, value: string}} parentDirective Data about the backing directive.
 * @param {SourceCode} sourceCode The source code object for the file being linted.
 * @returns {{ description, fix, unprocessedDirective }[]} Details for later creation of output Problems.
 */
function createIndividualDirectivesRemoval(
	directives,
	parentDirective,
	sourceCode,
) {
	/*
	 * Get the list of the rules text without any surrounding whitespace. In order to preserve the original
	 * formatting, we don't want to change that whitespace.
	 *
	 *     // eslint-disable-line rule-one , rule-two , rule-three -- comment
	 *                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
	 */
	const listText = parentDirective.value.trim();

	// Calculate where it starts in the source code text
	const listStart = sourceCode.text.indexOf(
		listText,
		sourceCode.getRange(parentDirective.node)[0],
	);

	/*
	 * We can assume that `listText` contains multiple elements.
	 * Otherwise, this function wouldn't be called - if there is
	 * only one rule in the list, then the whole comment must be removed.
	 */

	return directives.map(directive => {
		const { ruleId } = directive;

		const regex = new RegExp(
			String.raw`(?:^|\s*,\s*)(?<quote>['"]?)${escapeRegExp(ruleId)}\k<quote>(?:\s*,\s*|$)`,
			"u",
		);
		const match = regex.exec(listText);
		const matchedText = match[0];
		const matchStart = listStart + match.index;
		const matchEnd = matchStart + matchedText.length;

		const firstIndexOfComma = matchedText.indexOf(",");
		const lastIndexOfComma = matchedText.lastIndexOf(",");

		let removalStart, removalEnd;

		if (firstIndexOfComma !== lastIndexOfComma) {
			/*
			 * Since there are two commas, this must one of the elements in the middle of the list.
			 * Matched range starts where the previous rule name ends, and ends where the next rule name starts.
			 *
			 *     // eslint-disable-line rule-one , rule-two , rule-three -- comment
			 *                                    ^^^^^^^^^^^^^^
			 *
			 * We want to remove only the content between the two commas, and also one of the commas.
			 *
			 *     // eslint-disable-line rule-one , rule-two , rule-three -- comment
			 *                                     ^^^^^^^^^^^
			 */
			removalStart = matchStart + firstIndexOfComma;
			removalEnd = matchStart + lastIndexOfComma;
		} else {
			/*
			 * This is either the first element or the last element.
			 *
			 * If this is the first element, matched range starts where the first rule name starts
			 * and ends where the second rule name starts. This is exactly the range we want
			 * to remove so that the second rule name will start where the first one was starting
			 * and thus preserve the original formatting.
			 *
			 *     // eslint-disable-line rule-one , rule-two , rule-three -- comment
			 *                            ^^^^^^^^^^^
			 *
			 * Similarly, if this is the last element, we've already matched the range we want to
			 * remove. The previous rule name will end where the last one was ending, relative
			 * to the content on the right side.
			 *
			 *     // eslint-disable-line rule-one , rule-two , rule-three -- comment
			 *                                               ^^^^^^^^^^^^^
			 */
			removalStart = matchStart;
			removalEnd = matchEnd;
		}

		return {
			description: `'${ruleId}'`,
			fix: {
				range: [removalStart, removalEnd],
				text: "",
			},
			unprocessedDirective: directive.unprocessedDirective,
		};
	});
}

/**
 * Creates a description of deleting an entire unused disable directive.
 * @param {Directive[]} directives Unused directives to be removed.
 * @param {Token} node The backing Comment token.
 * @param {SourceCode} sourceCode The source code object for the file being linted.
 * @returns {{ description, fix, unprocessedDirective }} Details for later creation of an output problem.
 */
function createDirectiveRemoval(directives, node, sourceCode) {
	const range = sourceCode.getRange(node);
	const ruleIds = directives
		.filter(directive => directive.ruleId)
		.map(directive => `'${directive.ruleId}'`);

	return {
		description:
			ruleIds.length <= 2
				? ruleIds.join(" or ")
				: `${ruleIds.slice(0, ruleIds.length - 1).join(", ")}, or ${ruleIds.at(-1)}`,
		fix: {
			range,
			text: " ",
		},
		unprocessedDirective: directives[0].unprocessedDirective,
	};
}

/**
 * Parses details from directives to create output Problems.
 * @param {Iterable<Directive>} allDirectives Unused directives to be removed.
 * @param {SourceCode} sourceCode The source code object for the file being linted.
 * @returns {{ description, fix, unprocessedDirective }[]} Details for later creation of output Problems.
 */
function processUnusedDirectives(allDirectives, sourceCode) {
	const directiveGroups = groupByParentDirective(allDirectives);

	return directiveGroups.flatMap(directives => {
		const { parentDirective } = directives[0].unprocessedDirective;
		const remainingRuleIds = new Set(parentDirective.ruleIds);

		for (const directive of directives) {
			remainingRuleIds.delete(directive.ruleId);
		}

		return remainingRuleIds.size
			? createIndividualDirectivesRemoval(
					directives,
					parentDirective,
					sourceCode,
				)
			: [
					createDirectiveRemoval(
						directives,
						parentDirective.node,
						sourceCode,
					),
				];
	});
}

/**
 * Collect eslint-enable comments that are removing suppressions by eslint-disable comments.
 * @param {Directive[]} directives The directives to check.
 * @returns {Set<Directive>} The used eslint-enable comments
 */
function collectUsedEnableDirectives(directives) {
	/**
	 * A Map of `eslint-enable` keyed by ruleIds that may be marked as used.
	 * If `eslint-enable` does not have a ruleId, the key will be `null`.
	 * @type {Map<string|null, Directive>}
	 */
	const enabledRules = new Map();

	/**
	 * A Set of `eslint-enable` marked as used.
	 * It is also the return value of `collectUsedEnableDirectives` function.
	 * @type {Set<Directive>}
	 */
	const usedEnableDirectives = new Set();

	/*
	 * Checks the directives backwards to see if the encountered `eslint-enable` is used by the previous `eslint-disable`,
	 * and if so, stores the `eslint-enable` in `usedEnableDirectives`.
	 */
	for (let index = directives.length - 1; index >= 0; index--) {
		const directive = directives[index];

		if (directive.type === "disable") {
			if (enabledRules.size === 0) {
				continue;
			}
			if (directive.ruleId === null) {
				// If encounter `eslint-disable` without ruleId,
				// mark all `eslint-enable` currently held in enabledRules as used.
				// e.g.
				//    /* eslint-disable */ <- current directive
				//    /* eslint-enable rule-id1 */ <- used
				//    /* eslint-enable rule-id2 */ <- used
				//    /* eslint-enable */ <- used
				for (const enableDirective of enabledRules.values()) {
					usedEnableDirectives.add(enableDirective);
				}
				enabledRules.clear();
			} else {
				const enableDirective = enabledRules.get(directive.ruleId);

				if (enableDirective) {
					// If encounter `eslint-disable` with ruleId, and there is an `eslint-enable` with the same ruleId in enabledRules,
					// mark `eslint-enable` with ruleId as used.
					// e.g.
					//    /* eslint-disable rule-id */ <- current directive
					//    /* eslint-enable rule-id */ <- used
					usedEnableDirectives.add(enableDirective);
				} else {
					const enabledDirectiveWithoutRuleId =
						enabledRules.get(null);

					if (enabledDirectiveWithoutRuleId) {
						// If encounter `eslint-disable` with ruleId, and there is no `eslint-enable` with the same ruleId in enabledRules,
						// mark `eslint-enable` without ruleId as used.
						// e.g.
						//    /* eslint-disable rule-id */ <- current directive
						//    /* eslint-enable */ <- used
						usedEnableDirectives.add(enabledDirectiveWithoutRuleId);
					}
				}
			}
		} else if (directive.type === "enable") {
			if (directive.ruleId === null) {
				// If encounter `eslint-enable` without ruleId, the `eslint-enable` that follows it are unused.
				// So clear enabledRules.
				// e.g.
				//    /* eslint-enable */ <- current directive
				//    /* eslint-enable rule-id *// <- unused
				//    /* eslint-enable */ <- unused
				enabledRules.clear();
				enabledRules.set(null, directive);
			} else {
				enabledRules.set(directive.ruleId, directive);
			}
		}
	}
	return usedEnableDirectives;
}

/**
 * This is the same as the exported function, except that it
 * doesn't handle disable-line and disable-next-line directives, and it always reports unused
 * disable directives.
 * @param {Object} options options for applying directives. This is the same as the options
 * for the exported function, except that `reportUnusedDisableDirectives` is not supported
 * (this function always reports unused disable directives).
 * @returns {{problems: LintMessage[], unusedDirectives: LintMessage[]}} An object with a list
 * of problems (including suppressed ones) and unused eslint-disable directives
 */
function applyDirectives(options) {
	const problems = [];
	const usedDisableDirectives = new Set();
	const { sourceCode } = options;

	for (const problem of options.problems) {
		let disableDirectivesForProblem = [];
		let nextDirectiveIndex = 0;

		while (
			nextDirectiveIndex < options.directives.length &&
			compareLocations(options.directives[nextDirectiveIndex], problem) <=
				0
		) {
			const directive = options.directives[nextDirectiveIndex++];

			if (
				directive.ruleId === null ||
				directive.ruleId === problem.ruleId
			) {
				switch (directive.type) {
					case "disable":
						disableDirectivesForProblem.push(directive);
						break;

					case "enable":
						disableDirectivesForProblem = [];
						break;

					// no default
				}
			}
		}

		if (disableDirectivesForProblem.length > 0) {
			const suppressions = disableDirectivesForProblem.map(directive => ({
				kind: "directive",
				justification: directive.unprocessedDirective.justification,
			}));

			if (problem.suppressions) {
				problem.suppressions =
					problem.suppressions.concat(suppressions);
			} else {
				problem.suppressions = suppressions;
				usedDisableDirectives.add(disableDirectivesForProblem.at(-1));
			}
		}

		problems.push(problem);
	}

	const unusedDisableDirectivesToReport = options.directives.filter(
		directive =>
			directive.type === "disable" &&
			!usedDisableDirectives.has(directive) &&
			!options.rulesToIgnore.has(directive.ruleId),
	);

	const unusedEnableDirectivesToReport = new Set(
		options.directives.filter(
			directive =>
				directive.unprocessedDirective.type === "enable" &&
				!options.rulesToIgnore.has(directive.ruleId),
		),
	);

	/*
	 * If directives has the eslint-enable directive,
	 * check whether the eslint-enable comment is used.
	 */
	if (unusedEnableDirectivesToReport.size > 0) {
		for (const directive of collectUsedEnableDirectives(
			options.directives,
		)) {
			unusedEnableDirectivesToReport.delete(directive);
		}
	}

	const processed = processUnusedDirectives(
		unusedDisableDirectivesToReport,
		sourceCode,
	).concat(
		processUnusedDirectives(unusedEnableDirectivesToReport, sourceCode),
	);
	const columnOffset = options.language.columnStart === 1 ? 0 : 1;
	const lineOffset = options.language.lineStart === 1 ? 0 : 1;

	const unusedDirectives = processed.map(
		({ description, fix, unprocessedDirective }) => {
			const { parentDirective, type, line, column } =
				unprocessedDirective;

			let message;

			if (type === "enable") {
				message = description
					? `Unused eslint-enable directive (no matching eslint-disable directives were found for ${description}).`
					: "Unused eslint-enable directive (no matching eslint-disable directives were found).";
			} else {
				message = description
					? `Unused eslint-disable directive (no problems were reported from ${description}).`
					: "Unused eslint-disable directive (no problems were reported).";
			}

			const loc = sourceCode.getLoc(parentDirective.node);

			return {
				ruleId: null,
				message,
				line:
					type === "disable-next-line"
						? loc.start.line + lineOffset
						: line,
				column:
					type === "disable-next-line"
						? loc.start.column + columnOffset
						: column,
				severity:
					options.reportUnusedDisableDirectives === "warn" ? 1 : 2,
				...(options.disableFixes ? {} : { fix }),
			};
		},
	);

	return { problems, unusedDirectives };
}

/**
 * Given a list of directive comments (i.e. metadata about eslint-disable and eslint-enable comments) and a list
 * of reported problems, adds the suppression information to the problems.
 * @param {Object} options Information about directives and problems
 * @param {Language} options.language The language being linted.
 * @param {SourceCode} options.sourceCode The source code object for the file being linted.
 * @param {{
 *      type: ("disable"|"enable"|"disable-line"|"disable-next-line"),
 *      ruleId: (string|null),
 *      line: number,
 *      column: number,
 *      justification: string
 * }} options.directives Directive comments found in the file, with one-based columns.
 * Two directive comments can only have the same location if they also have the same type (e.g. a single eslint-disable
 * comment for two different rules is represented as two directives).
 * @param {{ruleId: (string|null), line: number, column: number}[]} options.problems
 * A list of problems reported by rules, sorted by increasing location in the file, with one-based columns.
 * @param {"off" | "warn" | "error"} options.reportUnusedDisableDirectives If `"warn"` or `"error"`, adds additional problems for unused directives
 * @param {RulesConfig} options.configuredRules The rules configuration.
 * @param {Function} options.ruleFilter A predicate function to filter which rules should be executed.
 * @param {boolean} options.disableFixes If true, it doesn't make `fix` properties.
 * @returns {{ruleId: (string|null), line: number, column: number, suppressions?: {kind: string, justification: string}}[]}
 * An object with a list of reported problems, the suppressed of which contain the suppression information.
 */
module.exports = ({
	language,
	sourceCode,
	directives,
	disableFixes,
	problems,
	configuredRules,
	ruleFilter,
	reportUnusedDisableDirectives = "off",
}) => {
	const blockDirectives = directives
		.filter(
			directive =>
				directive.type === "disable" || directive.type === "enable",
		)
		.map(directive =>
			Object.assign({}, directive, { unprocessedDirective: directive }),
		)
		.sort(compareLocations);

	const lineDirectives = directives
		.flatMap(directive => {
			switch (directive.type) {
				case "disable":
				case "enable":
					return [];

				case "disable-line":
					return [
						{
							type: "disable",
							line: directive.line,
							column: 1,
							ruleId: directive.ruleId,
							unprocessedDirective: directive,
						},
						{
							type: "enable",
							line: directive.line + 1,
							column: 0,
							ruleId: directive.ruleId,
							unprocessedDirective: directive,
						},
					];

				case "disable-next-line":
					return [
						{
							type: "disable",
							line: directive.line + 1,
							column: 1,
							ruleId: directive.ruleId,
							unprocessedDirective: directive,
						},
						{
							type: "enable",
							line: directive.line + 2,
							column: 0,
							ruleId: directive.ruleId,
							unprocessedDirective: directive,
						},
					];

				default:
					throw new TypeError(
						`Unrecognized directive type '${directive.type}'`,
					);
			}
		})
		.sort(compareLocations);

	// This determines a list of rules that are not being run by the given ruleFilter, if present.
	const rulesToIgnore =
		configuredRules && ruleFilter
			? new Set(
					Object.keys(configuredRules).filter(ruleId => {
						const severity = Config.getRuleNumericSeverity(
							configuredRules[ruleId],
						);

						// Ignore for disabled rules.
						if (severity === 0) {
							return false;
						}

						return !ruleFilter({ severity, ruleId });
					}),
				)
			: new Set();

	// If no ruleId is supplied that means this directive is applied to all rules, so we can't determine if it's unused if any rules are filtered out.
	if (rulesToIgnore.size > 0) {
		rulesToIgnore.add(null);
	}

	const blockDirectivesResult = applyDirectives({
		language,
		sourceCode,
		problems,
		directives: blockDirectives,
		disableFixes,
		reportUnusedDisableDirectives,
		rulesToIgnore,
	});
	const lineDirectivesResult = applyDirectives({
		language,
		sourceCode,
		problems: blockDirectivesResult.problems,
		directives: lineDirectives,
		disableFixes,
		reportUnusedDisableDirectives,
		rulesToIgnore,
	});

	return reportUnusedDisableDirectives !== "off"
		? lineDirectivesResult.problems
				.concat(blockDirectivesResult.unusedDirectives)
				.concat(lineDirectivesResult.unusedDirectives)
				.sort(compareLocations)
		: lineDirectivesResult.problems;
};
	x9100644 code-path-analyzer.js ,%Η¨"100644 code-path-segment.js IPWI+emi͂M100644 code-path-state.js v!g_y9 4bx,100644 code-path.js <qZ/ДSE(100644 debug-helpers.js (U%0Pkh'100644 fork-context.js 1bT(  scz)100644 id-generator.js k1	E~bc>+#w
xtR/**
 * @fileoverview A class of the code path analyzer.
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const assert = require("../../shared/assert"),
	{ breakableTypePattern } = require("../../shared/ast-utils"),
	CodePath = require("./code-path"),
	CodePathSegment = require("./code-path-segment"),
	IdGenerator = require("./id-generator"),
	debug = require("./debug-helpers");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Checks whether or not a given node is a `case` node (not `default` node).
 * @param {ASTNode} node A `SwitchCase` node to check.
 * @returns {boolean} `true` if the node is a `case` node (not `default` node).
 */
function isCaseNode(node) {
	return Boolean(node.test);
}

/**
 * Checks if a given node appears as the value of a PropertyDefinition node.
 * @param {ASTNode} node The node to check.
 * @returns {boolean} `true` if the node is a PropertyDefinition value,
 *      false if not.
 */
function isPropertyDefinitionValue(node) {
	const parent = node.parent;

	return (
		parent && parent.type === "PropertyDefinition" && parent.value === node
	);
}

/**
 * Checks whether the given logical operator is taken into account for the code
 * path analysis.
 * @param {string} operator The operator found in the LogicalExpression node
 * @returns {boolean} `true` if the operator is "&&" or "||" or "??"
 */
function isHandledLogicalOperator(operator) {
	return operator === "&&" || operator === "||" || operator === "??";
}

/**
 * Checks whether the given assignment operator is a logical assignment operator.
 * Logical assignments are taken into account for the code path analysis
 * because of their short-circuiting semantics.
 * @param {string} operator The operator found in the AssignmentExpression node
 * @returns {boolean} `true` if the operator is "&&=" or "||=" or "??="
 */
function isLogicalAssignmentOperator(operator) {
	return operator === "&&=" || operator === "||=" || operator === "??=";
}

/**
 * Gets the label if the parent node of a given node is a LabeledStatement.
 * @param {ASTNode} node A node to get.
 * @returns {string|null} The label or `null`.
 */
function getLabel(node) {
	if (node.parent.type === "LabeledStatement") {
		return node.parent.label.name;
	}
	return null;
}

/**
 * Checks whether a given logical expression node takes different paths for the
 * `true` and `false` cases.
 * @param {ASTNode} node A node to check.
 * @returns {boolean} `true` if the node is a test of a choice statement.
 */
function isForkingByTrueOrFalse(node) {
	const parent = node.parent;

	switch (parent.type) {
		case "ConditionalExpression":
		case "IfStatement":
		case "WhileStatement":
		case "DoWhileStatement":
		case "ForStatement":
			return parent.test === node;

		case "LogicalExpression":
			return isHandledLogicalOperator(parent.operator);

		case "AssignmentExpression":
			return isLogicalAssignmentOperator(parent.operator);

		default:
			return false;
	}
}

/**
 * Gets the boolean value of a given literal node.
 *
 * This is used to detect infinite loops (e.g. `while (true) {}`).
 * Statements preceded by an infinite loop are unreachable if the loop didn't
 * have any `break` statement.
 * @param {ASTNode} node A node to get.
 * @returns {boolean|undefined} a boolean value if the node is a Literal node,
 *   otherwise `undefined`.
 */
function getBooleanValueIfSimpleConstant(node) {
	if (node.type === "Literal") {
		return Boolean(node.value);
	}
	return void 0;
}

/**
 * Checks that a given identifier node is a reference or not.
 *
 * This is used to detect the first throwable node in a `try` block.
 * @param {ASTNode} node An Identifier node to check.
 * @returns {boolean} `true` if the node is a reference.
 */
function isIdentifierReference(node) {
	const parent = node.parent;

	switch (parent.type) {
		case "LabeledStatement":
		case "BreakStatement":
		case "ContinueStatement":
		case "ArrayPattern":
		case "RestElement":
		case "ImportSpecifier":
		case "ImportDefaultSpecifier":
		case "ImportNamespaceSpecifier":
		case "CatchClause":
			return false;

		case "FunctionDeclaration":
		case "FunctionExpression":
		case "ArrowFunctionExpression":
		case "ClassDeclaration":
		case "ClassExpression":
		case "VariableDeclarator":
			return parent.id !== node;

		case "Property":
		case "PropertyDefinition":
		case "MethodDefinition":
			return parent.key !== node || parent.computed || parent.shorthand;

		case "AssignmentPattern":
			return parent.key !== node;

		default:
			return true;
	}
}

/**
 * Updates the current segment with the head segment.
 * This is similar to local branches and tracking branches of git.
 *
 * To separate the current and the head is in order to not make useless segments.
 *
 * In this process, both "onCodePathSegmentStart" and "onCodePathSegmentEnd"
 * events are fired.
 * @param {CodePathAnalyzer} analyzer The instance.
 * @param {ASTNode} node The current AST node.
 * @returns {void}
 */
function forwardCurrentToHead(analyzer, node) {
	const codePath = analyzer.codePath;
	const state = CodePath.getState(codePath);
	const currentSegments = state.currentSegments;
	const headSegments = state.headSegments;
	const end = Math.max(currentSegments.length, headSegments.length);
	let i, currentSegment, headSegment;

	// Fires leaving events.
	for (i = 0; i < end; ++i) {
		currentSegment = currentSegments[i];
		headSegment = headSegments[i];

		if (currentSegment !== headSegment && currentSegment) {
			const eventName = currentSegment.reachable
				? "onCodePathSegmentEnd"
				: "onUnreachableCodePathSegmentEnd";

			debug.dump(`${eventName} ${currentSegment.id}`);

			analyzer.emit(eventName, [currentSegment, node]);
		}
	}

	// Update state.
	state.currentSegments = headSegments;

	// Fires entering events.
	for (i = 0; i < end; ++i) {
		currentSegment = currentSegments[i];
		headSegment = headSegments[i];

		if (currentSegment !== headSegment && headSegment) {
			const eventName = headSegment.reachable
				? "onCodePathSegmentStart"
				: "onUnreachableCodePathSegmentStart";

			debug.dump(`${eventName} ${headSegment.id}`);
			CodePathSegment.markUsed(headSegment);
			analyzer.emit(eventName, [headSegment, node]);
		}
	}
}

/**
 * Updates the current segment with an empty array.
 * This is called when a code path ends.
 * @param {CodePathAnalyzer} analyzer The instance.
 * @param {ASTNode} node The current AST node.
 * @returns {void}
 */
function leaveFromCurrentSegment(analyzer, node) {
	const state = CodePath.getState(analyzer.codePath);
	const currentSegments = state.currentSegments;

	for (let i = 0; i < currentSegments.length; ++i) {
		const currentSegment = currentSegments[i];
		const eventName = currentSegment.reachable
			? "onCodePathSegmentEnd"
			: "onUnreachableCodePathSegmentEnd";

		debug.dump(`${eventName} ${currentSegment.id}`);

		analyzer.emit(eventName, [currentSegment, node]);
	}

	state.currentSegments = [];
}

/**
 * Updates the code path due to the position of a given node in the parent node
 * thereof.
 *
 * For example, if the node is `parent.consequent`, this creates a fork from the
 * current path.
 * @param {CodePathAnalyzer} analyzer The instance.
 * @param {ASTNode} node The current AST node.
 * @returns {void}
 */
function preprocess(analyzer, node) {
	const codePath = analyzer.codePath;
	const state = CodePath.getState(codePath);
	const parent = node.parent;

	switch (parent.type) {
		// The `arguments.length == 0` case is in `postprocess` function.
		case "CallExpression":
			if (
				parent.optional === true &&
				parent.arguments.length >= 1 &&
				parent.arguments[0] === node
			) {
				state.makeOptionalRight();
			}
			break;
		case "MemberExpression":
			if (parent.optional === true && parent.property === node) {
				state.makeOptionalRight();
			}
			break;

		case "LogicalExpression":
			if (
				parent.right === node &&
				isHandledLogicalOperator(parent.operator)
			) {
				state.makeLogicalRight();
			}
			break;

		case "AssignmentExpression":
			if (
				parent.right === node &&
				isLogicalAssignmentOperator(parent.operator)
			) {
				state.makeLogicalRight();
			}
			break;

		case "ConditionalExpression":
		case "IfStatement":
			/*
			 * Fork if this node is at `consequent`/`alternate`.
			 * `popForkContext()` exists at `IfStatement:exit` and
			 * `ConditionalExpression:exit`.
			 */
			if (parent.consequent === node) {
				state.makeIfConsequent();
			} else if (parent.alternate === node) {
				state.makeIfAlternate();
			}
			break;

		case "SwitchCase":
			if (parent.consequent[0] === node) {
				state.makeSwitchCaseBody(false, !parent.test);
			}
			break;

		case "TryStatement":
			if (parent.handler === node) {
				state.makeCatchBlock();
			} else if (parent.finalizer === node) {
				state.makeFinallyBlock();
			}
			break;

		case "WhileStatement":
			if (parent.test === node) {
				state.makeWhileTest(getBooleanValueIfSimpleConstant(node));
			} else {
				assert(parent.body === node);
				state.makeWhileBody();
			}
			break;

		case "DoWhileStatement":
			if (parent.body === node) {
				state.makeDoWhileBody();
			} else {
				assert(parent.test === node);
				state.makeDoWhileTest(getBooleanValueIfSimpleConstant(node));
			}
			break;

		case "ForStatement":
			if (parent.test === node) {
				state.makeForTest(getBooleanValueIfSimpleConstant(node));
			} else if (parent.update === node) {
				state.makeForUpdate();
			} else if (parent.body === node) {
				state.makeForBody();
			}
			break;

		case "ForInStatement":
		case "ForOfStatement":
			if (parent.left === node) {
				state.makeForInOfLeft();
			} else if (parent.right === node) {
				state.makeForInOfRight();
			} else {
				assert(parent.body === node);
				state.makeForInOfBody();
			}
			break;

		case "AssignmentPattern":
			/*
			 * Fork if this node is at `right`.
			 * `left` is executed always, so it uses the current path.
			 * `popForkContext()` exists at `AssignmentPattern:exit`.
			 */
			if (parent.right === node) {
				state.pushForkContext();
				state.forkBypassPath();
				state.forkPath();
			}
			break;

		default:
			break;
	}
}

/**
 * Updates the code path due to the type of a given node in entering.
 * @param {CodePathAnalyzer} analyzer The instance.
 * @param {ASTNode} node The current AST node.
 * @returns {void}
 */
function processCodePathToEnter(analyzer, node) {
	let codePath = analyzer.codePath;
	let state = codePath && CodePath.getState(codePath);
	const parent = node.parent;

	/**
	 * Creates a new code path and trigger the onCodePathStart event
	 * based on the currently selected node.
	 * @param {string} origin The reason the code path was started.
	 * @returns {void}
	 */
	function startCodePath(origin) {
		if (codePath) {
			// Emits onCodePathSegmentStart events if updated.
			forwardCurrentToHead(analyzer, node);
			debug.dumpState(node, state, false);
		}

		// Create the code path of this scope.
		codePath = analyzer.codePath = new CodePath({
			id: analyzer.idGenerator.next(),
			origin,
			upper: codePath,
			onLooped: analyzer.onLooped,
		});
		state = CodePath.getState(codePath);

		// Emits onCodePathStart events.
		debug.dump(`onCodePathStart ${codePath.id}`);
		analyzer.emit("onCodePathStart", [codePath, node]);
	}

	/*
	 * Special case: The right side of class field initializer is considered
	 * to be its own function, so we need to start a new code path in this
	 * case.
	 */
	if (isPropertyDefinitionValue(node)) {
		startCodePath("class-field-initializer");

		/*
		 * Intentional fall through because `node` needs to also be
		 * processed by the code below. For example, if we have:
		 *
		 * class Foo {
		 *     a = () => {}
		 * }
		 *
		 * In this case, we also need start a second code path.
		 */
	}

	switch (node.type) {
		case "Program":
			startCodePath("program");
			break;

		case "FunctionDeclaration":
		case "FunctionExpression":
		case "ArrowFunctionExpression":
			startCodePath("function");
			break;

		case "StaticBlock":
			startCodePath("class-static-block");
			break;

		case "ChainExpression":
			state.pushChainContext();
			break;
		case "CallExpression":
			if (node.optional === true) {
				state.makeOptionalNode();
			}
			break;
		case "MemberExpression":
			if (node.optional === true) {
				state.makeOptionalNode();
			}
			break;

		case "LogicalExpression":
			if (isHandledLogicalOperator(node.operator)) {
				state.pushChoiceContext(
					node.operator,
					isForkingByTrueOrFalse(node),
				);
			}
			break;

		case "AssignmentExpression":
			if (isLogicalAssignmentOperator(node.operator)) {
				state.pushChoiceContext(
					node.operator.slice(0, -1), // removes `=` from the end
					isForkingByTrueOrFalse(node),
				);
			}
			break;

		case "ConditionalExpression":
		case "IfStatement":
			state.pushChoiceContext("test", false);
			break;

		case "SwitchStatement":
			state.pushSwitchContext(
				node.cases.some(isCaseNode),
				getLabel(node),
			);
			break;

		case "TryStatement":
			state.pushTryContext(Boolean(node.finalizer));
			break;

		case "SwitchCase":
			/*
			 * Fork if this node is after the 1st node in `cases`.
			 * It's similar to `else` blocks.
			 * The next `test` node is processed in this path.
			 */
			if (parent.discriminant !== node && parent.cases[0] !== node) {
				state.forkPath();
			}
			break;

		case "WhileStatement":
		case "DoWhileStatement":
		case "ForStatement":
		case "ForInStatement":
		case "ForOfStatement":
			state.pushLoopContext(node.type, getLabel(node));
			break;

		case "LabeledStatement":
			if (!breakableTypePattern.test(node.body.type)) {
				state.pushBreakContext(false, node.label.name);
			}
			break;

		default:
			break;
	}

	// Emits onCodePathSegmentStart events if updated.
	forwardCurrentToHead(analyzer, node);
	debug.dumpState(node, state, false);
}

/**
 * Updates the code path due to the type of a given node in leaving.
 * @param {CodePathAnalyzer} analyzer The instance.
 * @param {ASTNode} node The current AST node.
 * @returns {void}
 */
function processCodePathToExit(analyzer, node) {
	const codePath = analyzer.codePath;
	const state = CodePath.getState(codePath);
	let dontForward = false;

	switch (node.type) {
		case "ChainExpression":
			state.popChainContext();
			break;

		case "IfStatement":
		case "ConditionalExpression":
			state.popChoiceContext();
			break;

		case "LogicalExpression":
			if (isHandledLogicalOperator(node.operator)) {
				state.popChoiceContext();
			}
			break;

		case "AssignmentExpression":
			if (isLogicalAssignmentOperator(node.operator)) {
				state.popChoiceContext();
			}
			break;

		case "SwitchStatement":
			state.popSwitchContext();
			break;

		case "SwitchCase":
			/*
			 * This is the same as the process at the 1st `consequent` node in
			 * `preprocess` function.
			 * Must do if this `consequent` is empty.
			 */
			if (node.consequent.length === 0) {
				state.makeSwitchCaseBody(true, !node.test);
			}
			if (state.forkContext.reachable) {
				dontForward = true;
			}
			break;

		case "TryStatement":
			state.popTryContext();
			break;

		case "BreakStatement":
			forwardCurrentToHead(analyzer, node);
			state.makeBreak(node.label && node.label.name);
			dontForward = true;
			break;

		case "ContinueStatement":
			forwardCurrentToHead(analyzer, node);
			state.makeContinue(node.label && node.label.name);
			dontForward = true;
			break;

		case "ReturnStatement":
			forwardCurrentToHead(analyzer, node);
			state.makeReturn();
			dontForward = true;
			break;

		case "ThrowStatement":
			forwardCurrentToHead(analyzer, node);
			state.makeThrow();
			dontForward = true;
			break;

		case "Identifier":
			if (isIdentifierReference(node)) {
				state.makeFirstThrowablePathInTryOrCatchBlock();
				dontForward = true;
			}
			break;

		case "CallExpression":
		case "ImportExpression":
		case "MemberExpression":
		case "NewExpression":
			state.makeFirstThrowablePathInTryOrCatchBlock();
			break;

		case "YieldExpression":
			state.makeYield();
			break;

		case "WhileStatement":
		case "DoWhileStatement":
		case "ForStatement":
		case "ForInStatement":
		case "ForOfStatement":
			state.popLoopContext();
			break;

		case "AssignmentPattern":
			state.popForkContext();
			break;

		case "LabeledStatement":
			if (!breakableTypePattern.test(node.body.type)) {
				state.popBreakContext();
			}
			break;

		default:
			break;
	}

	// Emits onCodePathSegmentStart events if updated.
	if (!dontForward) {
		forwardCurrentToHead(analyzer, node);
	}
	debug.dumpState(node, state, true);
}

/**
 * Updates the code path to finalize the current code path.
 * @param {CodePathAnalyzer} analyzer The instance.
 * @param {ASTNode} node The current AST node.
 * @returns {void}
 */
function postprocess(analyzer, node) {
	/**
	 * Ends the code path for the current node.
	 * @returns {void}
	 */
	function endCodePath() {
		let codePath = analyzer.codePath;

		// Mark the current path as the final node.
		CodePath.getState(codePath).makeFinal();

		// Emits onCodePathSegmentEnd event of the current segments.
		leaveFromCurrentSegment(analyzer, node);

		// Emits onCodePathEnd event of this code path.
		debug.dump(`onCodePathEnd ${codePath.id}`);
		analyzer.emit("onCodePathEnd", [codePath, node]);
		debug.dumpDot(codePath);

		codePath = analyzer.codePath = analyzer.codePath.upper;
		if (codePath) {
			debug.dumpState(node, CodePath.getState(codePath), true);
		}
	}

	switch (node.type) {
		case "Program":
		case "FunctionDeclaration":
		case "FunctionExpression":
		case "ArrowFunctionExpression":
		case "StaticBlock": {
			endCodePath();
			break;
		}

		// The `arguments.length >= 1` case is in `preprocess` function.
		case "CallExpression":
			if (node.optional === true && node.arguments.length === 0) {
				CodePath.getState(analyzer.codePath).makeOptionalRight();
			}
			break;

		default:
			break;
	}

	/*
	 * Special case: The right side of class field initializer is considered
	 * to be its own function, so we need to end a code path in this
	 * case.
	 *
	 * We need to check after the other checks in order to close the
	 * code paths in the correct order for code like this:
	 *
	 *
	 * class Foo {
	 *     a = () => {}
	 * }
	 *
	 * In this case, the ArrowFunctionExpression code path is closed first,
	 * and then we need to close the code path for the PropertyDefinition
	 * value.
	 */
	if (isPropertyDefinitionValue(node)) {
		endCodePath();
	}
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

/**
 * The class to analyze code paths.
 * This class implements the EventGenerator interface.
 */
class CodePathAnalyzer {
	/**
	 * @param {EventGenerator} eventGenerator An event generator to wrap.
	 */
	constructor(eventGenerator) {
		this.original = eventGenerator;
		this.emit = eventGenerator.emit;
		this.codePath = null;
		this.idGenerator = new IdGenerator("s");
		this.currentNode = null;
		this.onLooped = this.onLooped.bind(this);
	}

	/**
	 * Does the process to enter a given AST node.
	 * This updates state of analysis and calls `enterNode` of the wrapped.
	 * @param {ASTNode} node A node which is entering.
	 * @returns {void}
	 */
	enterNode(node) {
		this.currentNode = node;

		// Updates the code path due to node's position in its parent node.
		if (node.parent) {
			preprocess(this, node);
		}

		/*
		 * Updates the code path.
		 * And emits onCodePathStart/onCodePathSegmentStart events.
		 */
		processCodePathToEnter(this, node);

		// Emits node events.
		this.original.enterNode(node);

		this.currentNode = null;
	}

	/**
	 * Does the process to leave a given AST node.
	 * This updates state of analysis and calls `leaveNode` of the wrapped.
	 * @param {ASTNode} node A node which is leaving.
	 * @returns {void}
	 */
	leaveNode(node) {
		this.currentNode = node;

		/*
		 * Updates the code path.
		 * And emits onCodePathStart/onCodePathSegmentStart events.
		 */
		processCodePathToExit(this, node);

		// Emits node events.
		this.original.leaveNode(node);

		// Emits the last onCodePathStart/onCodePathSegmentStart events.
		postprocess(this, node);

		this.currentNode = null;
	}

	/**
	 * This is called on a code path looped.
	 * Then this raises a looped event.
	 * @param {CodePathSegment} fromSegment A segment of prev.
	 * @param {CodePathSegment} toSegment A segment of next.
	 * @returns {void}
	 */
	onLooped(fromSegment, toSegment) {
		if (fromSegment.reachable && toSegment.reachable) {
			debug.dump(
				`onCodePathSegmentLoop ${fromSegment.id} -> ${toSegment.id}`,
			);
			this.emit("onCodePathSegmentLoop", [
				fromSegment,
				toSegment,
				this.currentNode,
			]);
		}
	}
}

module.exports = CodePathAnalyzer;
Q_x>/**
 * @fileoverview The CodePathSegment class.
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const debug = require("./debug-helpers");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Checks whether or not a given segment is reachable.
 * @param {CodePathSegment} segment A segment to check.
 * @returns {boolean} `true` if the segment is reachable.
 */
function isReachable(segment) {
	return segment.reachable;
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

/**
 * A code path segment.
 *
 * Each segment is arranged in a series of linked lists (implemented by arrays)
 * that keep track of the previous and next segments in a code path. In this way,
 * you can navigate between all segments in any code path so long as you have a
 * reference to any segment in that code path.
 *
 * When first created, the segment is in a detached state, meaning that it knows the
 * segments that came before it but those segments don't know that this new segment
 * follows it. Only when `CodePathSegment#markUsed()` is called on a segment does it
 * officially become part of the code path by updating the previous segments to know
 * that this new segment follows.
 */
class CodePathSegment {
	/**
	 * Creates a new instance.
	 * @param {string} id An identifier.
	 * @param {CodePathSegment[]} allPrevSegments An array of the previous segments.
	 *   This array includes unreachable segments.
	 * @param {boolean} reachable A flag which shows this is reachable.
	 */
	constructor(id, allPrevSegments, reachable) {
		/**
		 * The identifier of this code path.
		 * Rules use it to store additional information of each rule.
		 * @type {string}
		 */
		this.id = id;

		/**
		 * An array of the next reachable segments.
		 * @type {CodePathSegment[]}
		 */
		this.nextSegments = [];

		/**
		 * An array of the previous reachable segments.
		 * @type {CodePathSegment[]}
		 */
		this.prevSegments = allPrevSegments.filter(isReachable);

		/**
		 * An array of all next segments including reachable and unreachable.
		 * @type {CodePathSegment[]}
		 */
		this.allNextSegments = [];

		/**
		 * An array of all previous segments including reachable and unreachable.
		 * @type {CodePathSegment[]}
		 */
		this.allPrevSegments = allPrevSegments;

		/**
		 * A flag which shows this is reachable.
		 * @type {boolean}
		 */
		this.reachable = reachable;

		// Internal data.
		Object.defineProperty(this, "internal", {
			value: {
				// determines if the segment has been attached to the code path
				used: false,

				// array of previous segments coming from the end of a loop
				loopedPrevSegments: [],
			},
		});

		/* c8 ignore start */
		if (debug.enabled) {
			this.internal.nodes = [];
		} /* c8 ignore stop */
	}

	/**
	 * Checks a given previous segment is coming from the end of a loop.
	 * @param {CodePathSegment} segment A previous segment to check.
	 * @returns {boolean} `true` if the segment is coming from the end of a loop.
	 */
	isLoopedPrevSegment(segment) {
		return this.internal.loopedPrevSegments.includes(segment);
	}

	/**
	 * Creates the root segment.
	 * @param {string} id An identifier.
	 * @returns {CodePathSegment} The created segment.
	 */
	static newRoot(id) {
		return new CodePathSegment(id, [], true);
	}

	/**
	 * Creates a new segment and appends it after the given segments.
	 * @param {string} id An identifier.
	 * @param {CodePathSegment[]} allPrevSegments An array of the previous segments
	 *      to append to.
	 * @returns {CodePathSegment} The created segment.
	 */
	static newNext(id, allPrevSegments) {
		return new CodePathSegment(
			id,
			CodePathSegment.flattenUnusedSegments(allPrevSegments),
			allPrevSegments.some(isReachable),
		);
	}

	/**
	 * Creates an unreachable segment and appends it after the given segments.
	 * @param {string} id An identifier.
	 * @param {CodePathSegment[]} allPrevSegments An array of the previous segments.
	 * @returns {CodePathSegment} The created segment.
	 */
	static newUnreachable(id, allPrevSegments) {
		const segment = new CodePathSegment(
			id,
			CodePathSegment.flattenUnusedSegments(allPrevSegments),
			false,
		);

		/*
		 * In `if (a) return a; foo();` case, the unreachable segment preceded by
		 * the return statement is not used but must not be removed.
		 */
		CodePathSegment.markUsed(segment);

		return segment;
	}

	/**
	 * Creates a segment that follows given segments.
	 * This factory method does not connect with `allPrevSegments`.
	 * But this inherits `reachable` flag.
	 * @param {string} id An identifier.
	 * @param {CodePathSegment[]} allPrevSegments An array of the previous segments.
	 * @returns {CodePathSegment} The created segment.
	 */
	static newDisconnected(id, allPrevSegments) {
		return new CodePathSegment(id, [], allPrevSegments.some(isReachable));
	}

	/**
	 * Marks a given segment as used.
	 *
	 * And this function registers the segment into the previous segments as a next.
	 * @param {CodePathSegment} segment A segment to mark.
	 * @returns {void}
	 */
	static markUsed(segment) {
		if (segment.internal.used) {
			return;
		}
		segment.internal.used = true;

		let i;

		if (segment.reachable) {
			/*
			 * If the segment is reachable, then it's officially part of the
			 * code path. This loops through all previous segments to update
			 * their list of next segments. Because the segment is reachable,
			 * it's added to both `nextSegments` and `allNextSegments`.
			 */
			for (i = 0; i < segment.allPrevSegments.length; ++i) {
				const prevSegment = segment.allPrevSegments[i];

				prevSegment.allNextSegments.push(segment);
				prevSegment.nextSegments.push(segment);
			}
		} else {
			/*
			 * If the segment is not reachable, then it's not officially part of the
			 * code path. This loops through all previous segments to update
			 * their list of next segments. Because the segment is not reachable,
			 * it's added only to `allNextSegments`.
			 */
			for (i = 0; i < segment.allPrevSegments.length; ++i) {
				segment.allPrevSegments[i].allNextSegments.push(segment);
			}
		}
	}

	/**
	 * Marks a previous segment as looped.
	 * @param {CodePathSegment} segment A segment.
	 * @param {CodePathSegment} prevSegment A previous segment to mark.
	 * @returns {void}
	 */
	static markPrevSegmentAsLooped(segment, prevSegment) {
		segment.internal.loopedPrevSegments.push(prevSegment);
	}

	/**
	 * Creates a new array based on an array of segments. If any segment in the
	 * array is unused, then it is replaced by all of its previous segments.
	 * All used segments are returned as-is without replacement.
	 * @param {CodePathSegment[]} segments The array of segments to flatten.
	 * @returns {CodePathSegment[]} The flattened array.
	 */
	static flattenUnusedSegments(segments) {
		const done = new Set();

		for (let i = 0; i < segments.length; ++i) {
			const segment = segments[i];

			// Ignores duplicated.
			if (done.has(segment)) {
				continue;
			}

			// Use previous segments if unused.
			if (!segment.internal.used) {
				for (let j = 0; j < segment.allPrevSegments.length; ++j) {
					const prevSegment = segment.allPrevSegments[j];

					if (!done.has(prevSegment)) {
						done.add(prevSegment);
					}
				}
			} else {
				done.add(segment);
			}
		}

		return [...done];
	}
}

module.exports = CodePathSegment;
c@#x   /**
 * @fileoverview A class to manage state of generating a code path.
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const CodePathSegment = require("./code-path-segment"),
	ForkContext = require("./fork-context");

//-----------------------------------------------------------------------------
// Contexts
//-----------------------------------------------------------------------------

/**
 * Represents the context in which a `break` statement can be used.
 *
 * A `break` statement without a label is only valid in a few places in
 * JavaScript: any type of loop or a `switch` statement. Otherwise, `break`
 * without a label causes a syntax error. For these contexts, `breakable` is
 * set to `true` to indicate that a `break` without a label is valid.
 *
 * However, a `break` statement with a label is also valid inside of a labeled
 * statement. For example, this is valid:
 *
 *     a : {
 *         break a;
 *     }
 *
 * The `breakable` property is set false for labeled statements to indicate
 * that `break` without a label is invalid.
 */
class BreakContext {
	/**
	 * Creates a new instance.
	 * @param {BreakContext} upperContext The previous `BreakContext`.
	 * @param {boolean} breakable Indicates if we are inside a statement where
	 *      `break` without a label will exit the statement.
	 * @param {string|null} label The label for the statement.
	 * @param {ForkContext} forkContext The current fork context.
	 */
	constructor(upperContext, breakable, label, forkContext) {
		/**
		 * The previous `BreakContext`
		 * @type {BreakContext}
		 */
		this.upper = upperContext;

		/**
		 * Indicates if we are inside a statement where `break` without a label
		 * will exit the statement.
		 * @type {boolean}
		 */
		this.breakable = breakable;

		/**
		 * The label associated with the statement.
		 * @type {string|null}
		 */
		this.label = label;

		/**
		 * The fork context for the `break`.
		 * @type {ForkContext}
		 */
		this.brokenForkContext = ForkContext.newEmpty(forkContext);
	}
}

/**
 * Represents the context for `ChainExpression` nodes.
 */
class ChainContext {
	/**
	 * Creates a new instance.
	 * @param {ChainContext} upperContext The previous `ChainContext`.
	 */
	constructor(upperContext) {
		/**
		 * The previous `ChainContext`
		 * @type {ChainContext}
		 */
		this.upper = upperContext;

		/**
		 * The number of choice contexts inside of the `ChainContext`.
		 * @type {number}
		 */
		this.choiceContextCount = 0;
	}
}

/**
 * Represents a choice in the code path.
 *
 * Choices are created by logical operators such as `&&`, loops, conditionals,
 * and `if` statements. This is the point at which the code path has a choice of
 * which direction to go.
 *
 * The result of a choice might be in the left (test) expression of another choice,
 * and in that case, may create a new fork. For example, `a || b` is a choice
 * but does not create a new fork because the result of the expression is
 * not used as the test expression in another expression. In this case,
 * `isForkingAsResult` is false. In the expression `a || b || c`, the `a || b`
 * expression appears as the test expression for `|| c`, so the
 * result of `a || b` creates a fork because execution may or may not
 * continue to `|| c`. `isForkingAsResult` for `a || b` in this case is true
 * while `isForkingAsResult` for `|| c` is false. (`isForkingAsResult` is always
 * false for `if` statements, conditional expressions, and loops.)
 *
 * All of the choices except one (`??`) operate on a true/false fork, meaning if
 * true go one way and if false go the other (tracked by `trueForkContext` and
 * `falseForkContext`). The `??` operator doesn't operate on true/false because
 * the left expression is evaluated to be nullish or not, so only if nullish do
 * we fork to the right expression (tracked by `nullishForkContext`).
 */
class ChoiceContext {
	/**
	 * Creates a new instance.
	 * @param {ChoiceContext} upperContext The previous `ChoiceContext`.
	 * @param {string} kind The kind of choice. If it's a logical or assignment expression, this
	 *      is `"&&"` or `"||"` or `"??"`; if it's an `if` statement or
	 *      conditional expression, this is `"test"`; otherwise, this is `"loop"`.
	 * @param {boolean} isForkingAsResult Indicates if the result of the choice
	 *      creates a fork.
	 * @param {ForkContext} forkContext The containing `ForkContext`.
	 */
	constructor(upperContext, kind, isForkingAsResult, forkContext) {
		/**
		 * The previous `ChoiceContext`
		 * @type {ChoiceContext}
		 */
		this.upper = upperContext;

		/**
		 * The kind of choice. If it's a logical or assignment expression, this
		 * is `"&&"` or `"||"` or `"??"`; if it's an `if` statement or
		 * conditional expression, this is `"test"`; otherwise, this is `"loop"`.
		 * @type {string}
		 */
		this.kind = kind;

		/**
		 * Indicates if the result of the choice forks the code path.
		 * @type {boolean}
		 */
		this.isForkingAsResult = isForkingAsResult;

		/**
		 * The fork context for the `true` path of the choice.
		 * @type {ForkContext}
		 */
		this.trueForkContext = ForkContext.newEmpty(forkContext);

		/**
		 * The fork context for the `false` path of the choice.
		 * @type {ForkContext}
		 */
		this.falseForkContext = ForkContext.newEmpty(forkContext);

		/**
		 * The fork context for when the choice result is `null` or `undefined`.
		 * @type {ForkContext}
		 */
		this.nullishForkContext = ForkContext.newEmpty(forkContext);

		/**
		 * Indicates if any of `trueForkContext`, `falseForkContext`, or
		 * `nullishForkContext` have been updated with segments from a child context.
		 * @type {boolean}
		 */
		this.processed = false;
	}
}

/**
 * Base class for all loop contexts.
 */
class LoopContextBase {
	/**
	 * Creates a new instance.
	 * @param {LoopContext|null} upperContext The previous `LoopContext`.
	 * @param {string} type The AST node's `type` for the loop.
	 * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`.
	 * @param {BreakContext} breakContext The context for breaking the loop.
	 */
	constructor(upperContext, type, label, breakContext) {
		/**
		 * The previous `LoopContext`.
		 * @type {LoopContext}
		 */
		this.upper = upperContext;

		/**
		 * The AST node's `type` for the loop.
		 * @type {string}
		 */
		this.type = type;

		/**
		 * The label for the loop from an enclosing `LabeledStatement`.
		 * @type {string|null}
		 */
		this.label = label;

		/**
		 * The fork context for when `break` is encountered.
		 * @type {ForkContext}
		 */
		this.brokenForkContext = breakContext.brokenForkContext;
	}
}

/**
 * Represents the context for a `while` loop.
 */
class WhileLoopContext extends LoopContextBase {
	/**
	 * Creates a new instance.
	 * @param {LoopContext|null} upperContext The previous `LoopContext`.
	 * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`.
	 * @param {BreakContext} breakContext The context for breaking the loop.
	 */
	constructor(upperContext, label, breakContext) {
		super(upperContext, "WhileStatement", label, breakContext);

		/**
		 * The hardcoded literal boolean test condition for
		 * the loop. Used to catch infinite or skipped loops.
		 * @type {boolean|undefined}
		 */
		this.test = void 0;

		/**
		 * The segments representing the test condition where `continue` will
		 * jump to. The test condition will typically have just one segment but
		 * it's possible for there to be more than one.
		 * @type {Array<CodePathSegment>|null}
		 */
		this.continueDestSegments = null;
	}
}

/**
 * Represents the context for a `do-while` loop.
 */
class DoWhileLoopContext extends LoopContextBase {
	/**
	 * Creates a new instance.
	 * @param {LoopContext|null} upperContext The previous `LoopContext`.
	 * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`.
	 * @param {BreakContext} breakContext The context for breaking the loop.
	 * @param {ForkContext} forkContext The enclosing fork context.
	 */
	constructor(upperContext, label, breakContext, forkContext) {
		super(upperContext, "DoWhileStatement", label, breakContext);

		/**
		 * The hardcoded literal boolean test condition for
		 * the loop. Used to catch infinite or skipped loops.
		 * @type {boolean|undefined}
		 */
		this.test = void 0;

		/**
		 * The segments at the start of the loop body. This is the only loop
		 * where the test comes at the end, so the first iteration always
		 * happens and we need a reference to the first statements.
		 * @type {Array<CodePathSegment>|null}
		 */
		this.entrySegments = null;

		/**
		 * The fork context to follow when a `continue` is found.
		 * @type {ForkContext}
		 */
		this.continueForkContext = ForkContext.newEmpty(forkContext);
	}
}

/**
 * Represents the context for a `for` loop.
 */
class ForLoopContext extends LoopContextBase {
	/**
	 * Creates a new instance.
	 * @param {LoopContext|null} upperContext The previous `LoopContext`.
	 * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`.
	 * @param {BreakContext} breakContext The context for breaking the loop.
	 */
	constructor(upperContext, label, breakContext) {
		super(upperContext, "ForStatement", label, breakContext);

		/**
		 * The hardcoded literal boolean test condition for
		 * the loop. Used to catch infinite or skipped loops.
		 * @type {boolean|undefined}
		 */
		this.test = void 0;

		/**
		 * The end of the init expression. This may change during the lifetime
		 * of the instance as we traverse the loop because some loops don't have
		 * an init expression.
		 * @type {Array<CodePathSegment>|null}
		 */
		this.endOfInitSegments = null;

		/**
		 * The start of the test expression. This may change during the lifetime
		 * of the instance as we traverse the loop because some loops don't have
		 * a test expression.
		 * @type {Array<CodePathSegment>|null}
		 */
		this.testSegments = null;

		/**
		 * The end of the test expression. This may change during the lifetime
		 * of the instance as we traverse the loop because some loops don't have
		 * a test expression.
		 * @type {Array<CodePathSegment>|null}
		 */
		this.endOfTestSegments = null;

		/**
		 * The start of the update expression. This may change during the lifetime
		 * of the instance as we traverse the loop because some loops don't have
		 * an update expression.
		 * @type {Array<CodePathSegment>|null}
		 */
		this.updateSegments = null;

		/**
		 * The end of the update expression. This may change during the lifetime
		 * of the instance as we traverse the loop because some loops don't have
		 * an update expression.
		 * @type {Array<CodePathSegment>|null}
		 */
		this.endOfUpdateSegments = null;

		/**
		 * The segments representing the test condition where `continue` will
		 * jump to. The test condition will typically have just one segment but
		 * it's possible for there to be more than one. This may change during the
		 * lifetime of the instance as we traverse the loop because some loops
		 * don't have an update expression. When there is an update expression, this
		 * will end up pointing to that expression; otherwise it will end up pointing
		 * to the test expression.
		 * @type {Array<CodePathSegment>|null}
		 */
		this.continueDestSegments = null;
	}
}

/**
 * Represents the context for a `for-in` loop.
 *
 * Terminology:
 * - "left" means the part of the loop to the left of the `in` keyword. For
 *   example, in `for (var x in y)`, the left is `var x`.
 * - "right" means the part of the loop to the right of the `in` keyword. For
 *   example, in `for (var x in y)`, the right is `y`.
 */
class ForInLoopContext extends LoopContextBase {
	/**
	 * Creates a new instance.
	 * @param {LoopContext|null} upperContext The previous `LoopContext`.
	 * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`.
	 * @param {BreakContext} breakContext The context for breaking the loop.
	 */
	constructor(upperContext, label, breakContext) {
		super(upperContext, "ForInStatement", label, breakContext);

		/**
		 * The segments that came immediately before the start of the loop.
		 * This allows you to traverse backwards out of the loop into the
		 * surrounding code. This is necessary to evaluate the right expression
		 * correctly, as it must be evaluated in the same way as the left
		 * expression, but the pointer to these segments would otherwise be
		 * lost if not stored on the instance. Once the right expression has
		 * been evaluated, this property is no longer used.
		 * @type {Array<CodePathSegment>|null}
		 */
		this.prevSegments = null;

		/**
		 * Segments representing the start of everything to the left of the
		 * `in` keyword. This can be used to move forward towards
		 * `endOfLeftSegments`. `leftSegments` and `endOfLeftSegments` are
		 * effectively the head and tail of a doubly-linked list.
		 * @type {Array<CodePathSegment>|null}
		 */
		this.leftSegments = null;

		/**
		 * Segments representing the end of everything to the left of the
		 * `in` keyword. This can be used to move backward towards `leftSegments`.
		 * `leftSegments` and `endOfLeftSegments` are effectively the head
		 * and tail of a doubly-linked list.
		 * @type {Array<CodePathSegment>|null}
		 */
		this.endOfLeftSegments = null;

		/**
		 * The segments representing the left expression where `continue` will
		 * jump to. In `for-in` loops, `continue` must always re-execute the
		 * left expression each time through the loop. This contains the same
		 * segments as `leftSegments`, but is duplicated here so each loop
		 * context has the same property pointing to where `continue` should
		 * end up.
		 * @type {Array<CodePathSegment>|null}
		 */
		this.continueDestSegments = null;
	}
}

/**
 * Represents the context for a `for-of` loop.
 */
class ForOfLoopContext extends LoopContextBase {
	/**
	 * Creates a new instance.
	 * @param {LoopContext|null} upperContext The previous `LoopContext`.
	 * @param {string|null} label The label for the loop from an enclosing `LabeledStatement`.
	 * @param {BreakContext} breakContext The context for breaking the loop.
	 */
	constructor(upperContext, label, breakContext) {
		super(upperContext, "ForOfStatement", label, breakContext);

		/**
		 * The segments that came immediately before the start of the loop.
		 * This allows you to traverse backwards out of the loop into the
		 * surrounding code. This is necessary to evaluate the right expression
		 * correctly, as it must be evaluated in the same way as the left
		 * expression, but the pointer to these segments would otherwise be
		 * lost if not stored on the instance. Once the right expression has
		 * been evaluated, this property is no longer used.
		 * @type {Array<CodePathSegment>|null}
		 */
		this.prevSegments = null;

		/**
		 * Segments representing the start of everything to the left of the
		 * `of` keyword. This can be used to move forward towards
		 * `endOfLeftSegments`. `leftSegments` and `endOfLeftSegments` are
		 * effectively the head and tail of a doubly-linked list.
		 * @type {Array<CodePathSegment>|null}
		 */
		this.leftSegments = null;

		/**
		 * Segments representing the end of everything to the left of the
		 * `of` keyword. This can be used to move backward towards `leftSegments`.
		 * `leftSegments` and `endOfLeftSegments` are effectively the head
		 * and tail of a doubly-linked list.
		 * @type {Array<CodePathSegment>|null}
		 */
		this.endOfLeftSegments = null;

		/**
		 * The segments representing the left expression where `continue` will
		 * jump to. In `for-in` loops, `continue` must always re-execute the
		 * left expression each time through the loop. This contains the same
		 * segments as `leftSegments`, but is duplicated here so each loop
		 * context has the same property pointing to where `continue` should
		 * end up.
		 * @type {Array<CodePathSegment>|null}
		 */
		this.continueDestSegments = null;
	}
}

/**
 * Represents the context for any loop.
 * @typedef {WhileLoopContext|DoWhileLoopContext|ForLoopContext|ForInLoopContext|ForOfLoopContext} LoopContext
 */

/**
 * Represents the context for a `switch` statement.
 */
class SwitchContext {
	/**
	 * Creates a new instance.
	 * @param {SwitchContext} upperContext The previous context.
	 * @param {boolean} hasCase Indicates if there is at least one `case` statement.
	 *      `default` doesn't count.
	 */
	constructor(upperContext, hasCase) {
		/**
		 * The previous context.
		 * @type {SwitchContext}
		 */
		this.upper = upperContext;

		/**
		 * Indicates if there is at least one `case` statement. `default` doesn't count.
		 * @type {boolean}
		 */
		this.hasCase = hasCase;

		/**
		 * The `default` keyword.
		 * @type {Array<CodePathSegment>|null}
		 */
		this.defaultSegments = null;

		/**
		 * The default case body starting segments.
		 * @type {Array<CodePathSegment>|null}
		 */
		this.defaultBodySegments = null;

		/**
		 * Indicates if a `default` case and is empty exists.
		 * @type {boolean}
		 */
		this.foundEmptyDefault = false;

		/**
		 * Indicates that a `default` exists and is the last case.
		 * @type {boolean}
		 */
		this.lastIsDefault = false;

		/**
		 * The number of fork contexts created. This is equivalent to the
		 * number of `case` statements plus a `default` statement (if present).
		 * @type {number}
		 */
		this.forkCount = 0;
	}
}

/**
 * Represents the context for a `try` statement.
 */
class TryContext {
	/**
	 * Creates a new instance.
	 * @param {TryContext} upperContext The previous context.
	 * @param {boolean} hasFinalizer Indicates if the `try` statement has a
	 *      `finally` block.
	 * @param {ForkContext} forkContext The enclosing fork context.
	 */
	constructor(upperContext, hasFinalizer, forkContext) {
		/**
		 * The previous context.
		 * @type {TryContext}
		 */
		this.upper = upperContext;

		/**
		 * Indicates if the `try` statement has a `finally` block.
		 * @type {boolean}
		 */
		this.hasFinalizer = hasFinalizer;

		/**
		 * Tracks the traversal position inside of the `try` statement. This is
		 * used to help determine the context necessary to create paths because
		 * a `try` statement may or may not have `catch` or `finally` blocks,
		 * and code paths behave differently in those blocks.
		 * @type {"try"|"catch"|"finally"}
		 */
		this.position = "try";

		/**
		 * If the `try` statement has a `finally` block, this affects how return-like
		 * leaving paths behave in the `try` block. Without `finally`, they behave as
		 * usual and don't require a fork; with `finally`, they fork into the
		 * `finally` block, so we need a fork context to track them.
		 * @type {ForkContext|null}
		 */
		this.returnedForkContext = hasFinalizer
			? ForkContext.newEmpty(forkContext)
			: null;

		/**
		 * When a `throw` occurs inside of a `try` block, the code path forks
		 * into the `catch` or `finally` blocks, and this fork context tracks
		 * that path.
		 * @type {ForkContext}
		 */
		this.thrownForkContext = ForkContext.newEmpty(forkContext);

		/**
		 * Indicates if the last segment in the `try` block is reachable.
		 * @type {boolean}
		 */
		this.lastOfTryIsReachable = false;

		/**
		 * Indicates if the last segment in the `catch` block is reachable.
		 * @type {boolean}
		 */
		this.lastOfCatchIsReachable = false;
	}
}

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Adds given segments into the `dest` array.
 * If the `others` array does not include the given segments, adds to the `all`
 * array as well.
 *
 * This adds only reachable and used segments.
 * @param {CodePathSegment[]} dest A destination array (`returnedSegments` or `thrownSegments`).
 * @param {CodePathSegment[]} others Another destination array (`returnedSegments` or `thrownSegments`).
 * @param {CodePathSegment[]} all The unified destination array (`finalSegments`).
 * @param {CodePathSegment[]} segments Segments to add.
 * @returns {void}
 */
function addToReturnedOrThrown(dest, others, all, segments) {
	for (let i = 0; i < segments.length; ++i) {
		const segment = segments[i];

		dest.push(segment);
		if (!others.includes(segment)) {
			all.push(segment);
		}
	}
}

/**
 * Gets a loop context for a `continue` statement based on a given label.
 * @param {CodePathState} state The state to search within.
 * @param {string|null} label The label of a `continue` statement.
 * @returns {LoopContext} A loop-context for a `continue` statement.
 */
function getContinueContext(state, label) {
	if (!label) {
		return state.loopContext;
	}

	let context = state.loopContext;

	while (context) {
		if (context.label === label) {
			return context;
		}
		context = context.upper;
	}

	/* c8 ignore next */
	return null;
}

/**
 * Gets a context for a `break` statement.
 * @param {CodePathState} state The state to search within.
 * @param {string|null} label The label of a `break` statement.
 * @returns {BreakContext} A context for a `break` statement.
 */
function getBreakContext(state, label) {
	let context = state.breakContext;

	while (context) {
		if (label ? context.label === label : context.breakable) {
			return context;
		}
		context = context.upper;
	}

	/* c8 ignore next */
	return null;
}

/**
 * Gets a context for a `return` statement. There is just one special case:
 * if there is a `try` statement with a `finally` block, because that alters
 * how `return` behaves; otherwise, this just passes through the given state.
 * @param {CodePathState} state The state to search within
 * @returns {TryContext|CodePathState} A context for a `return` statement.
 */
function getReturnContext(state) {
	let context = state.tryContext;

	while (context) {
		if (context.hasFinalizer && context.position !== "finally") {
			return context;
		}
		context = context.upper;
	}

	return state;
}

/**
 * Gets a context for a `throw` statement. There is just one special case:
 * if there is a `try` statement with a `finally` block and we are inside of
 * a `catch` because that changes how `throw` behaves; otherwise, this just
 * passes through the given state.
 * @param {CodePathState} state The state to search within.
 * @returns {TryContext|CodePathState} A context for a `throw` statement.
 */
function getThrowContext(state) {
	let context = state.tryContext;

	while (context) {
		if (
			context.position === "try" ||
			(context.hasFinalizer && context.position === "catch")
		) {
			return context;
		}
		context = context.upper;
	}

	return state;
}

/**
 * Removes a given value from a given array.
 * @param {any[]} elements An array to remove the specific element.
 * @param {any} value The value to be removed.
 * @returns {void}
 */
function removeFromArray(elements, value) {
	elements.splice(elements.indexOf(value), 1);
}

/**
 * Disconnect given segments.
 *
 * This is used in a process for switch statements.
 * If there is the "default" chunk before other cases, the order is different
 * between node's and running's.
 * @param {CodePathSegment[]} prevSegments Forward segments to disconnect.
 * @param {CodePathSegment[]} nextSegments Backward segments to disconnect.
 * @returns {void}
 */
function disconnectSegments(prevSegments, nextSegments) {
	for (let i = 0; i < prevSegments.length; ++i) {
		const prevSegment = prevSegments[i];
		const nextSegment = nextSegments[i];

		removeFromArray(prevSegment.nextSegments, nextSegment);
		removeFromArray(prevSegment.allNextSegments, nextSegment);
		removeFromArray(nextSegment.prevSegments, prevSegment);
		removeFromArray(nextSegment.allPrevSegments, prevSegment);
	}
}

/**
 * Creates looping path between two arrays of segments, ensuring that there are
 * paths going between matching segments in the arrays.
 * @param {CodePathState} state The state to operate on.
 * @param {CodePathSegment[]} unflattenedFromSegments Segments which are source.
 * @param {CodePathSegment[]} unflattenedToSegments Segments which are destination.
 * @returns {void}
 */
function makeLooped(state, unflattenedFromSegments, unflattenedToSegments) {
	const fromSegments = CodePathSegment.flattenUnusedSegments(
		unflattenedFromSegments,
	);
	const toSegments = CodePathSegment.flattenUnusedSegments(
		unflattenedToSegments,
	);
	const end = Math.min(fromSegments.length, toSegments.length);

	/*
	 * This loop effectively updates a doubly-linked list between two collections
	 * of segments making sure that segments in the same array indices are
	 * combined to create a path.
	 */
	for (let i = 0; i < end; ++i) {
		// get the segments in matching array indices
		const fromSegment = fromSegments[i];
		const toSegment = toSegments[i];

		/*
		 * If the destination segment is reachable, then create a path from the
		 * source segment to the destination segment.
		 */
		if (toSegment.reachable) {
			fromSegment.nextSegments.push(toSegment);
		}

		/*
		 * If the source segment is reachable, then create a path from the
		 * destination segment back to the source segment.
		 */
		if (fromSegment.reachable) {
			toSegment.prevSegments.push(fromSegment);
		}

		/*
		 * Also update the arrays that don't care if the segments are reachable
		 * or not. This should always happen regardless of anything else.
		 */
		fromSegment.allNextSegments.push(toSegment);
		toSegment.allPrevSegments.push(fromSegment);

		/*
		 * If the destination segment has at least two previous segments in its
		 * path then that means there was one previous segment before this iteration
		 * of the loop was executed. So, we need to mark the source segment as
		 * looped.
		 */
		if (toSegment.allPrevSegments.length >= 2) {
			CodePathSegment.markPrevSegmentAsLooped(toSegment, fromSegment);
		}

		// let the code path analyzer know that there's been a loop created
		state.notifyLooped(fromSegment, toSegment);
	}
}

/**
 * Finalizes segments of `test` chunk of a ForStatement.
 *
 * - Adds `false` paths to paths which are leaving from the loop.
 * - Sets `true` paths to paths which go to the body.
 * @param {LoopContext} context A loop context to modify.
 * @param {ChoiceContext} choiceContext A choice context of this loop.
 * @param {CodePathSegment[]} head The current head paths.
 * @returns {void}
 */
function finalizeTestSegmentsOfFor(context, choiceContext, head) {
	/*
	 * If this choice context doesn't already contain paths from a
	 * child context, then add the current head to each potential path.
	 */
	if (!choiceContext.processed) {
		choiceContext.trueForkContext.add(head);
		choiceContext.falseForkContext.add(head);
		choiceContext.nullishForkContext.add(head);
	}

	/*
	 * If the test condition isn't a hardcoded truthy value, then `break`
	 * must follow the same path as if the test condition is false. To represent
	 * that, we append the path for when the loop test is false (represented by
	 * `falseForkContext`) to the `brokenForkContext`.
	 */
	if (context.test !== true) {
		context.brokenForkContext.addAll(choiceContext.falseForkContext);
	}

	context.endOfTestSegments = choiceContext.trueForkContext.makeNext(0, -1);
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

/**
 * A class which manages state to analyze code paths.
 */
class CodePathState {
	/**
	 * Creates a new instance.
	 * @param {IdGenerator} idGenerator An id generator to generate id for code
	 *   path segments.
	 * @param {Function} onLooped A callback function to notify looping.
	 */
	constructor(idGenerator, onLooped) {
		/**
		 * The ID generator to use when creating new segments.
		 * @type {IdGenerator}
		 */
		this.idGenerator = idGenerator;

		/**
		 * A callback function to call when there is a loop.
		 * @type {Function}
		 */
		this.notifyLooped = onLooped;

		/**
		 * The root fork context for this state.
		 * @type {ForkContext}
		 */
		this.forkContext = ForkContext.newRoot(idGenerator);

		/**
		 * Context for logical expressions, conditional expressions, `if` statements,
		 * and loops.
		 * @type {ChoiceContext}
		 */
		this.choiceContext = null;

		/**
		 * Context for `switch` statements.
		 * @type {SwitchContext}
		 */
		this.switchContext = null;

		/**
		 * Context for `try` statements.
		 * @type {TryContext}
		 */
		this.tryContext = null;

		/**
		 * Context for loop statements.
		 * @type {LoopContext}
		 */
		this.loopContext = null;

		/**
		 * Context for `break` statements.
		 * @type {BreakContext}
		 */
		this.breakContext = null;

		/**
		 * Context for `ChainExpression` nodes.
		 * @type {ChainContext}
		 */
		this.chainContext = null;

		/**
		 * An array that tracks the current segments in the state. The array
		 * starts empty and segments are added with each `onCodePathSegmentStart`
		 * event and removed with each `onCodePathSegmentEnd` event. Effectively,
		 * this is tracking the code path segment traversal as the state is
		 * modified.
		 * @type {Array<CodePathSegment>}
		 */
		this.currentSegments = [];

		/**
		 * Tracks the starting segment for this path. This value never changes.
		 * @type {CodePathSegment}
		 */
		this.initialSegment = this.forkContext.head[0];

		/**
		 * The final segments of the code path which are either `return` or `throw`.
		 * This is a union of the segments in `returnedForkContext` and `thrownForkContext`.
		 * @type {Array<CodePathSegment>}
		 */
		this.finalSegments = [];

		/**
		 * The final segments of the code path which are `return`. These
		 * segments are also contained in `finalSegments`.
		 * @type {Array<CodePathSegment>}
		 */
		this.returnedForkContext = [];

		/**
		 * The final segments of the code path which are `throw`. These
		 * segments are also contained in `finalSegments`.
		 * @type {Array<CodePathSegment>}
		 */
		this.thrownForkContext = [];

		/*
		 * We add an `add` method so that these look more like fork contexts and
		 * can be used interchangeably when a fork context is needed to add more
		 * segments to a path.
		 *
		 * Ultimately, we want anything added to `returned` or `thrown` to also
		 * be added to `final`. We only add reachable and used segments to these
		 * arrays.
		 */
		const final = this.finalSegments;
		const returned = this.returnedForkContext;
		const thrown = this.thrownForkContext;

		returned.add = addToReturnedOrThrown.bind(
			null,
			returned,
			thrown,
			final,
		);
		thrown.add = addToReturnedOrThrown.bind(null, thrown, returned, final);
	}

	/**
	 * A passthrough property exposing the current pointer as part of the API.
	 * @type {CodePathSegment[]}
	 */
	get headSegments() {
		return this.forkContext.head;
	}

	/**
	 * The parent forking context.
	 * This is used for the root of new forks.
	 * @type {ForkContext}
	 */
	get parentForkContext() {
		const current = this.forkContext;

		return current && current.upper;
	}

	/**
	 * Creates and stacks new forking context.
	 * @param {boolean} forkLeavingPath A flag which shows being in a
	 *   "finally" block.
	 * @returns {ForkContext} The created context.
	 */
	pushForkContext(forkLeavingPath) {
		this.forkContext = ForkContext.newEmpty(
			this.forkContext,
			forkLeavingPath,
		);

		return this.forkContext;
	}

	/**
	 * Pops and merges the last forking context.
	 * @returns {ForkContext} The last context.
	 */
	popForkContext() {
		const lastContext = this.forkContext;

		this.forkContext = lastContext.upper;
		this.forkContext.replaceHead(lastContext.makeNext(0, -1));

		return lastContext;
	}

	/**
	 * Creates a new path.
	 * @returns {void}
	 */
	forkPath() {
		this.forkContext.add(this.parentForkContext.makeNext(-1, -1));
	}

	/**
	 * Creates a bypass path.
	 * This is used for such as IfStatement which does not have "else" chunk.
	 * @returns {void}
	 */
	forkBypassPath() {
		this.forkContext.add(this.parentForkContext.head);
	}

	//--------------------------------------------------------------------------
	// ConditionalExpression, LogicalExpression, IfStatement
	//--------------------------------------------------------------------------

	/**
	 * Creates a context for ConditionalExpression, LogicalExpression, AssignmentExpression (logical assignments only),
	 * IfStatement, WhileStatement, DoWhileStatement, or ForStatement.
	 *
	 * LogicalExpressions have cases that it goes different paths between the
	 * `true` case and the `false` case.
	 *
	 * For Example:
	 *
	 *     if (a || b) {
	 *         foo();
	 *     } else {
	 *         bar();
	 *     }
	 *
	 * In this case, `b` is evaluated always in the code path of the `else`
	 * block, but it's not so in the code path of the `if` block.
	 * So there are 3 paths.
	 *
	 *     a -> foo();
	 *     a -> b -> foo();
	 *     a -> b -> bar();
	 * @param {string} kind A kind string.
	 *   If the new context is LogicalExpression's or AssignmentExpression's, this is `"&&"` or `"||"` or `"??"`.
	 *   If it's IfStatement's or ConditionalExpression's, this is `"test"`.
	 *   Otherwise, this is `"loop"`.
	 * @param {boolean} isForkingAsResult Indicates if the result of the choice
	 *      creates a fork.
	 * @returns {void}
	 */
	pushChoiceContext(kind, isForkingAsResult) {
		this.choiceContext = new ChoiceContext(
			this.choiceContext,
			kind,
			isForkingAsResult,
			this.forkContext,
		);
	}

	/**
	 * Pops the last choice context and finalizes it.
	 * This is called upon leaving a node that represents a choice.
	 * @throws {Error} (Unreachable.)
	 * @returns {ChoiceContext} The popped context.
	 */
	popChoiceContext() {
		const poppedChoiceContext = this.choiceContext;
		const forkContext = this.forkContext;
		const head = forkContext.head;

		this.choiceContext = poppedChoiceContext.upper;

		switch (poppedChoiceContext.kind) {
			case "&&":
			case "||":
			case "??":
				/*
				 * The `head` are the path of the right-hand operand.
				 * If we haven't previously added segments from child contexts,
				 * then we add these segments to all possible forks.
				 */
				if (!poppedChoiceContext.processed) {
					poppedChoiceContext.trueForkContext.add(head);
					poppedChoiceContext.falseForkContext.add(head);
					poppedChoiceContext.nullishForkContext.add(head);
				}

				/*
				 * If this context is the left (test) expression for another choice
				 * context, such as `a || b` in the expression `a || b || c`,
				 * then we take the segments for this context and move them up
				 * to the parent context.
				 */
				if (poppedChoiceContext.isForkingAsResult) {
					const parentContext = this.choiceContext;

					parentContext.trueForkContext.addAll(
						poppedChoiceContext.trueForkContext,
					);
					parentContext.falseForkContext.addAll(
						poppedChoiceContext.falseForkContext,
					);
					parentContext.nullishForkContext.addAll(
						poppedChoiceContext.nullishForkContext,
					);
					parentContext.processed = true;

					// Exit early so we don't collapse all paths into one.
					return poppedChoiceContext;
				}

				break;

			case "test":
				if (!poppedChoiceContext.processed) {
					/*
					 * The head segments are the path of the `if` block here.
					 * Updates the `true` path with the end of the `if` block.
					 */
					poppedChoiceContext.trueForkContext.clear();
					poppedChoiceContext.trueForkContext.add(head);
				} else {
					/*
					 * The head segments are the path of the `else` block here.
					 * Updates the `false` path with the end of the `else`
					 * block.
					 */
					poppedChoiceContext.falseForkContext.clear();
					poppedChoiceContext.falseForkContext.add(head);
				}

				break;

			case "loop":
				/*
				 * Loops are addressed in `popLoopContext()` so just return
				 * the context without modification.
				 */
				return poppedChoiceContext;

			/* c8 ignore next */
			default:
				throw new Error("unreachable");
		}

		/*
		 * Merge the true path with the false path to create a single path.
		 */
		const combinedForkContext = poppedChoiceContext.trueForkContext;

		combinedForkContext.addAll(poppedChoiceContext.falseForkContext);
		forkContext.replaceHead(combinedForkContext.makeNext(0, -1));

		return poppedChoiceContext;
	}

	/**
	 * Creates a code path segment to represent right-hand operand of a logical
	 * expression.
	 * This is called in the preprocessing phase when entering a node.
	 * @throws {Error} (Unreachable.)
	 * @returns {void}
	 */
	makeLogicalRight() {
		const currentChoiceContext = this.choiceContext;
		const forkContext = this.forkContext;

		if (currentChoiceContext.processed) {
			/*
			 * This context was already assigned segments from a child
			 * choice context. In this case, we are concerned only about
			 * the path that does not short-circuit and so ends up on the
			 * right-hand operand of the logical expression.
			 */
			let prevForkContext;

			switch (currentChoiceContext.kind) {
				case "&&": // if true then go to the right-hand side.
					prevForkContext = currentChoiceContext.trueForkContext;
					break;
				case "||": // if false then go to the right-hand side.
					prevForkContext = currentChoiceContext.falseForkContext;
					break;
				case "??": // Both true/false can short-circuit, so needs the third path to go to the right-hand side. That's nullishForkContext.
					prevForkContext = currentChoiceContext.nullishForkContext;
					break;
				default:
					throw new Error("unreachable");
			}

			/*
			 * Create the segment for the right-hand operand of the logical expression
			 * and adjust the fork context pointer to point there. The right-hand segment
			 * is added at the end of all segments in `prevForkContext`.
			 */
			forkContext.replaceHead(prevForkContext.makeNext(0, -1));

			/*
			 * We no longer need this list of segments.
			 *
			 * Reset `processed` because we've removed the segments from the child
			 * choice context. This allows `popChoiceContext()` to continue adding
			 * segments later.
			 */
			prevForkContext.clear();
			currentChoiceContext.processed = false;
		} else {
			/*
			 * This choice context was not assigned segments from a child
			 * choice context, which means that it's a terminal logical
			 * expression.
			 *
			 * `head` is the segments for the left-hand operand of the
			 * logical expression.
			 *
			 * Each of the fork contexts below are empty at this point. We choose
			 * the path(s) that will short-circuit and add the segment for the
			 * left-hand operand to it. Ultimately, this will be the only segment
			 * in that path due to the short-circuting, so we are just seeding
			 * these paths to start.
			 */
			switch (currentChoiceContext.kind) {
				case "&&":
					/*
					 * In most contexts, when a && expression evaluates to false,
					 * it short circuits, so we need to account for that by setting
					 * the `falseForkContext` to the left operand.
					 *
					 * When a && expression is the left-hand operand for a ??
					 * expression, such as `(a && b) ?? c`, a nullish value will
					 * also short-circuit in a different way than a false value,
					 * so we also set the `nullishForkContext` to the left operand.
					 * This path is only used with a ?? expression and is thrown
					 * away for any other type of logical expression, so it's safe
					 * to always add.
					 */
					currentChoiceContext.falseForkContext.add(forkContext.head);
					currentChoiceContext.nullishForkContext.add(
						forkContext.head,
					);
					break;
				case "||": // the true path can short-circuit.
					currentChoiceContext.trueForkContext.add(forkContext.head);
					break;
				case "??": // both can short-circuit.
					currentChoiceContext.trueForkContext.add(forkContext.head);
					currentChoiceContext.falseForkContext.add(forkContext.head);
					break;
				default:
					throw new Error("unreachable");
			}

			/*
			 * Create the segment for the right-hand operand of the logical expression
			 * and adjust the fork context pointer to point there.
			 */
			forkContext.replaceHead(forkContext.makeNext(-1, -1));
		}
	}

	/**
	 * Makes a code path segment of the `if` block.
	 * @returns {void}
	 */
	makeIfConsequent() {
		const context = this.choiceContext;
		const forkContext = this.forkContext;

		/*
		 * If any result were not transferred from child contexts,
		 * this sets the head segments to both cases.
		 * The head segments are the path of the test expression.
		 */
		if (!context.processed) {
			context.trueForkContext.add(forkContext.head);
			context.falseForkContext.add(forkContext.head);
			context.nullishForkContext.add(forkContext.head);
		}

		context.processed = false;

		// Creates new path from the `true` case.
		forkContext.replaceHead(context.trueForkContext.makeNext(0, -1));
	}

	/**
	 * Makes a code path segment of the `else` block.
	 * @returns {void}
	 */
	makeIfAlternate() {
		const context = this.choiceContext;
		const forkContext = this.forkContext;

		/*
		 * The head segments are the path of the `if` block.
		 * Updates the `true` path with the end of the `if` block.
		 */
		context.trueForkContext.clear();
		context.trueForkContext.add(forkContext.head);
		context.processed = true;

		// Creates new path from the `false` case.
		forkContext.replaceHead(context.falseForkContext.makeNext(0, -1));
	}

	//--------------------------------------------------------------------------
	// ChainExpression
	//--------------------------------------------------------------------------

	/**
	 * Pushes a new `ChainExpression` context to the stack. This method is
	 * called when entering a `ChainExpression` node. A chain context is used to
	 * count forking in the optional chain then merge them on the exiting from the
	 * `ChainExpression` node.
	 * @returns {void}
	 */
	pushChainContext() {
		this.chainContext = new ChainContext(this.chainContext);
	}

	/**
	 * Pop a `ChainExpression` context from the stack. This method is called on
	 * exiting from each `ChainExpression` node. This merges all forks of the
	 * last optional chaining.
	 * @returns {void}
	 */
	popChainContext() {
		const context = this.chainContext;

		this.chainContext = context.upper;

		// pop all choice contexts of this.
		for (let i = context.choiceContextCount; i > 0; --i) {
			this.popChoiceContext();
		}
	}

	/**
	 * Create a choice context for optional access.
	 * This method is called on entering to each `(Call|Member)Expression[optional=true]` node.
	 * This creates a choice context as similar to `LogicalExpression[operator="??"]` node.
	 * @returns {void}
	 */
	makeOptionalNode() {
		if (this.chainContext) {
			this.chainContext.choiceContextCount += 1;
			this.pushChoiceContext("??", false);
		}
	}

	/**
	 * Create a fork.
	 * This method is called on entering to the `arguments|property` property of each `(Call|Member)Expression` node.
	 * @returns {void}
	 */
	makeOptionalRight() {
		if (this.chainContext) {
			this.makeLogicalRight();
		}
	}

	//--------------------------------------------------------------------------
	// SwitchStatement
	//--------------------------------------------------------------------------

	/**
	 * Creates a context object of SwitchStatement and stacks it.
	 * @param {boolean} hasCase `true` if the switch statement has one or more
	 *   case parts.
	 * @param {string|null} label The label text.
	 * @returns {void}
	 */
	pushSwitchContext(hasCase, label) {
		this.switchContext = new SwitchContext(this.switchContext, hasCase);
		this.pushBreakContext(true, label);
	}

	/**
	 * Pops the last context of SwitchStatement and finalizes it.
	 *
	 * - Disposes all forking stack for `case` and `default`.
	 * - Creates the next code path segment from `context.brokenForkContext`.
	 * - If the last `SwitchCase` node is not a `default` part, creates a path
	 *   to the `default` body.
	 * @returns {void}
	 */
	popSwitchContext() {
		const context = this.switchContext;

		this.switchContext = context.upper;

		const forkContext = this.forkContext;
		const brokenForkContext = this.popBreakContext().brokenForkContext;

		if (context.forkCount === 0) {
			/*
			 * When there is only one `default` chunk and there is one or more
			 * `break` statements, even if forks are nothing, it needs to merge
			 * those.
			 */
			if (!brokenForkContext.empty) {
				brokenForkContext.add(forkContext.makeNext(-1, -1));
				forkContext.replaceHead(brokenForkContext.makeNext(0, -1));
			}

			return;
		}

		const lastSegments = forkContext.head;

		this.forkBypassPath();
		const lastCaseSegments = forkContext.head;

		/*
		 * `brokenForkContext` is used to make the next segment.
		 * It must add the last segment into `brokenForkContext`.
		 */
		brokenForkContext.add(lastSegments);

		/*
		 * Any value that doesn't match a `case` test should flow to the default
		 * case. That happens normally when the default case is last in the `switch`,
		 * but if it's not, we need to rewire some of the paths to be correct.
		 */
		if (!context.lastIsDefault) {
			if (context.defaultBodySegments) {
				/*
				 * There is a non-empty default case, so remove the path from the `default`
				 * label to its body for an accurate representation.
				 */
				disconnectSegments(
					context.defaultSegments,
					context.defaultBodySegments,
				);

				/*
				 * Connect the path from the last non-default case to the body of the
				 * default case.
				 */
				makeLooped(this, lastCaseSegments, context.defaultBodySegments);
			} else {
				/*
				 * There is no default case, so we treat this as if the last case
				 * had a `break` in it.
				 */
				brokenForkContext.add(lastCaseSegments);
			}
		}

		// Traverse up to the original fork context for the `switch` statement
		for (let i = 0; i < context.forkCount; ++i) {
			this.forkContext = this.forkContext.upper;
		}

		/*
		 * Creates a path from all `brokenForkContext` paths.
		 * This is a path after `switch` statement.
		 */
		this.forkContext.replaceHead(brokenForkContext.makeNext(0, -1));
	}

	/**
	 * Makes a code path segment for a `SwitchCase` node.
	 * @param {boolean} isCaseBodyEmpty `true` if the body is empty.
	 * @param {boolean} isDefaultCase `true` if the body is the default case.
	 * @returns {void}
	 */
	makeSwitchCaseBody(isCaseBodyEmpty, isDefaultCase) {
		const context = this.switchContext;

		if (!context.hasCase) {
			return;
		}

		/*
		 * Merge forks.
		 * The parent fork context has two segments.
		 * Those are from the current `case` and the body of the previous case.
		 */
		const parentForkContext = this.forkContext;
		const forkContext = this.pushForkContext();

		forkContext.add(parentForkContext.makeNext(0, -1));

		/*
		 * Add information about the default case.
		 *
		 * The purpose of this is to identify the starting segments for the
		 * default case to make sure there is a path there.
		 */
		if (isDefaultCase) {
			/*
			 * This is the default case in the `switch`.
			 *
			 * We first save the current pointer as `defaultSegments` to point
			 * to the `default` keyword.
			 */
			context.defaultSegments = parentForkContext.head;

			/*
			 * If the body of the case is empty then we just set
			 * `foundEmptyDefault` to true; otherwise, we save a reference
			 * to the current pointer as `defaultBodySegments`.
			 */
			if (isCaseBodyEmpty) {
				context.foundEmptyDefault = true;
			} else {
				context.defaultBodySegments = forkContext.head;
			}
		} else {
			/*
			 * This is not the default case in the `switch`.
			 *
			 * If it's not empty and there is already an empty default case found,
			 * that means the default case actually comes before this case,
			 * and that it will fall through to this case. So, we can now
			 * ignore the previous default case (reset `foundEmptyDefault` to false)
			 * and set `defaultBodySegments` to the current segments because this is
			 * effectively the new default case.
			 */
			if (!isCaseBodyEmpty && context.foundEmptyDefault) {
				context.foundEmptyDefault = false;
				context.defaultBodySegments = forkContext.head;
			}
		}

		// keep track if the default case ends up last
		context.lastIsDefault = isDefaultCase;
		context.forkCount += 1;
	}

	//--------------------------------------------------------------------------
	// TryStatement
	//--------------------------------------------------------------------------

	/**
	 * Creates a context object of TryStatement and stacks it.
	 * @param {boolean} hasFinalizer `true` if the try statement has a
	 *   `finally` block.
	 * @returns {void}
	 */
	pushTryContext(hasFinalizer) {
		this.tryContext = new TryContext(
			this.tryContext,
			hasFinalizer,
			this.forkContext,
		);
	}

	/**
	 * Pops the last context of TryStatement and finalizes it.
	 * @returns {void}
	 */
	popTryContext() {
		const context = this.tryContext;

		this.tryContext = context.upper;

		/*
		 * If we're inside the `catch` block, that means there is no `finally`,
		 * so we can process the `try` and `catch` blocks the simple way and
		 * merge their two paths.
		 */
		if (context.position === "catch") {
			this.popForkContext();
			return;
		}

		/*
		 * The following process is executed only when there is a `finally`
		 * block.
		 */

		const originalReturnedForkContext = context.returnedForkContext;
		const originalThrownForkContext = context.thrownForkContext;

		// no `return` or `throw` in `try` or `catch` so there's nothing left to do
		if (
			originalReturnedForkContext.empty &&
			originalThrownForkContext.empty
		) {
			return;
		}

		/*
		 * The following process is executed only when there is a `finally`
		 * block and there was a `return` or `throw` in the `try` or `catch`
		 * blocks.
		 */

		// Separate head to normal paths and leaving paths.
		const headSegments = this.forkContext.head;

		this.forkContext = this.forkContext.upper;
		const normalSegments = headSegments.slice(
			0,
			(headSegments.length / 2) | 0,
		);
		const leavingSegments = headSegments.slice(
			(headSegments.length / 2) | 0,
		);

		// Forwards the leaving path to upper contexts.
		if (!originalReturnedForkContext.empty) {
			getReturnContext(this).returnedForkContext.add(leavingSegments);
		}
		if (!originalThrownForkContext.empty) {
			getThrowContext(this).thrownForkContext.add(leavingSegments);
		}

		// Sets the normal path as the next.
		this.forkContext.replaceHead(normalSegments);

		/*
		 * If both paths of the `try` block and the `catch` block are
		 * unreachable, the next path becomes unreachable as well.
		 */
		if (!context.lastOfTryIsReachable && !context.lastOfCatchIsReachable) {
			this.forkContext.makeUnreachable();
		}
	}

	/**
	 * Makes a code path segment for a `catch` block.
	 * @returns {void}
	 */
	makeCatchBlock() {
		const context = this.tryContext;
		const forkContext = this.forkContext;
		const originalThrownForkContext = context.thrownForkContext;

		/*
		 * We are now in a catch block so we need to update the context
		 * with that information. This includes creating a new fork
		 * context in case we encounter any `throw` statements here.
		 */
		context.position = "catch";
		context.thrownForkContext = ForkContext.newEmpty(forkContext);
		context.lastOfTryIsReachable = forkContext.reachable;

		// Merge the thrown paths from the `try` and `catch` blocks
		originalThrownForkContext.add(forkContext.head);
		const thrownSegments = originalThrownForkContext.makeNext(0, -1);

		// Fork to a bypass and the merged thrown path.
		this.pushForkContext();
		this.forkBypassPath();
		this.forkContext.add(thrownSegments);
	}

	/**
	 * Makes a code path segment for a `finally` block.
	 *
	 * In the `finally` block, parallel paths are created. The parallel paths
	 * are used as leaving-paths. The leaving-paths are paths from `return`
	 * statements and `throw` statements in a `try` block or a `catch` block.
	 * @returns {void}
	 */
	makeFinallyBlock() {
		const context = this.tryContext;
		let forkContext = this.forkContext;
		const originalReturnedForkContext = context.returnedForkContext;
		const originalThrownForContext = context.thrownForkContext;
		const headOfLeavingSegments = forkContext.head;

		// Update state.
		if (context.position === "catch") {
			// Merges two paths from the `try` block and `catch` block.
			this.popForkContext();
			forkContext = this.forkContext;

			context.lastOfCatchIsReachable = forkContext.reachable;
		} else {
			context.lastOfTryIsReachable = forkContext.reachable;
		}

		context.position = "finally";

		/*
		 * If there was no `return` or `throw` in either the `try` or `catch`
		 * blocks, then there's no further code paths to create for `finally`.
		 */
		if (
			originalReturnedForkContext.empty &&
			originalThrownForContext.empty
		) {
			// This path does not leave.
			return;
		}

		/*
		 * Create a parallel segment from merging returned and thrown.
		 * This segment will leave at the end of this `finally` block.
		 */
		const segments = forkContext.makeNext(-1, -1);

		for (let i = 0; i < forkContext.count; ++i) {
			const prevSegsOfLeavingSegment = [headOfLeavingSegments[i]];

			for (
				let j = 0;
				j < originalReturnedForkContext.segmentsList.length;
				++j
			) {
				prevSegsOfLeavingSegment.push(
					originalReturnedForkContext.segmentsList[j][i],
				);
			}
			for (
				let j = 0;
				j < originalThrownForContext.segmentsList.length;
				++j
			) {
				prevSegsOfLeavingSegment.push(
					originalThrownForContext.segmentsList[j][i],
				);
			}

			segments.push(
				CodePathSegment.newNext(
					this.idGenerator.next(),
					prevSegsOfLeavingSegment,
				),
			);
		}

		this.pushForkContext(true);
		this.forkContext.add(segments);
	}

	/**
	 * Records abrupt resumption paths from a suspended `yield` expression,
	 * then splits normal post-`yield` continuation into a fresh segment.
	 * @returns {void}
	 */
	makeYield() {
		const forkContext = this.forkContext;
		const leavingSegments = forkContext.head;

		if (forkContext.reachable) {
			getReturnContext(this).returnedForkContext.add(leavingSegments);
			getThrowContext(this).thrownForkContext.add(leavingSegments);

			forkContext.replaceHead(forkContext.makeNext(-1, -1));
		}
	}

	/**
	 * Makes a code path segment from the first throwable node in a `try` block to the `catch`
	 * block or the `finally` block or from the first throwable node in a `catch` block
	 * to the `finally` block.
	 * @returns {void}
	 */
	makeFirstThrowablePathInTryOrCatchBlock() {
		const forkContext = this.forkContext;

		if (!forkContext.reachable) {
			return;
		}

		const context = getThrowContext(this);

		if (context === this || !context.thrownForkContext.empty) {
			return;
		}

		if (
			context.position !== "try" &&
			(context.position !== "catch" || !context.hasFinalizer)
		) {
			return;
		}

		context.thrownForkContext.add(forkContext.head);
		forkContext.replaceHead(forkContext.makeNext(-1, -1));
	}

	//--------------------------------------------------------------------------
	// Loop Statements
	//--------------------------------------------------------------------------

	/**
	 * Creates a context object of a loop statement and stacks it.
	 * @param {string} type The type of the node which was triggered. One of
	 *   `WhileStatement`, `DoWhileStatement`, `ForStatement`, `ForInStatement`,
	 *   and `ForStatement`.
	 * @param {string|null} label A label of the node which was triggered.
	 * @throws {Error} (Unreachable - unknown type.)
	 * @returns {void}
	 */
	pushLoopContext(type, label) {
		const forkContext = this.forkContext;

		// All loops need a path to account for `break` statements
		const breakContext = this.pushBreakContext(true, label);

		switch (type) {
			case "WhileStatement":
				this.pushChoiceContext("loop", false);
				this.loopContext = new WhileLoopContext(
					this.loopContext,
					label,
					breakContext,
				);
				break;

			case "DoWhileStatement":
				this.pushChoiceContext("loop", false);
				this.loopContext = new DoWhileLoopContext(
					this.loopContext,
					label,
					breakContext,
					forkContext,
				);
				break;

			case "ForStatement":
				this.pushChoiceContext("loop", false);
				this.loopContext = new ForLoopContext(
					this.loopContext,
					label,
					breakContext,
				);
				break;

			case "ForInStatement":
				this.loopContext = new ForInLoopContext(
					this.loopContext,
					label,
					breakContext,
				);
				break;

			case "ForOfStatement":
				this.loopContext = new ForOfLoopContext(
					this.loopContext,
					label,
					breakContext,
				);
				break;

			/* c8 ignore next */
			default:
				throw new Error(`unknown type: "${type}"`);
		}
	}

	/**
	 * Pops the last context of a loop statement and finalizes it.
	 * @throws {Error} (Unreachable - unknown type.)
	 * @returns {void}
	 */
	popLoopContext() {
		const context = this.loopContext;

		this.loopContext = context.upper;

		const forkContext = this.forkContext;
		const brokenForkContext = this.popBreakContext().brokenForkContext;

		// Creates a looped path.
		switch (context.type) {
			case "WhileStatement":
			case "ForStatement":
				this.popChoiceContext();

				/*
				 * Creates the path from the end of the loop body up to the
				 * location where `continue` would jump to.
				 */
				makeLooped(
					this,
					forkContext.head,
					context.continueDestSegments,
				);
				break;

			case "DoWhileStatement": {
				const choiceContext = this.popChoiceContext();

				if (!choiceContext.processed) {
					choiceContext.trueForkContext.add(forkContext.head);
					choiceContext.falseForkContext.add(forkContext.head);
				}

				/*
				 * If this isn't a hardcoded `true` condition, then `break`
				 * should continue down the path as if the condition evaluated
				 * to false.
				 */
				if (context.test !== true) {
					brokenForkContext.addAll(choiceContext.falseForkContext);
				}

				/*
				 * When the condition is true, the loop continues back to the top,
				 * so create a path from each possible true condition back to the
				 * top of the loop.
				 */
				const segmentsList = choiceContext.trueForkContext.segmentsList;

				for (let i = 0; i < segmentsList.length; ++i) {
					makeLooped(this, segmentsList[i], context.entrySegments);
				}
				break;
			}

			case "ForInStatement":
			case "ForOfStatement":
				brokenForkContext.add(forkContext.head);

				/*
				 * Creates the path from the end of the loop body up to the
				 * left expression (left of `in` or `of`) of the loop.
				 */
				makeLooped(this, forkContext.head, context.leftSegments);
				break;

			/* c8 ignore next */
			default:
				throw new Error("unreachable");
		}

		/*
		 * If there wasn't a `break` statement in the loop, then we're at
		 * the end of the loop's path, so we make an unreachable segment
		 * to mark that.
		 *
		 * If there was a `break` statement, then we continue on into the
		 * `brokenForkContext`.
		 */
		if (brokenForkContext.empty) {
			forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
		} else {
			forkContext.replaceHead(brokenForkContext.makeNext(0, -1));
		}
	}

	/**
	 * Makes a code path segment for the test part of a WhileStatement.
	 * @param {boolean|undefined} test The test value (only when constant).
	 * @returns {void}
	 */
	makeWhileTest(test) {
		const context = this.loopContext;
		const forkContext = this.forkContext;
		const testSegments = forkContext.makeNext(0, -1);

		// Update state.
		context.test = test;
		context.continueDestSegments = testSegments;
		forkContext.replaceHead(testSegments);
	}

	/**
	 * Makes a code path segment for the body part of a WhileStatement.
	 * @returns {void}
	 */
	makeWhileBody() {
		const context = this.loopContext;
		const choiceContext = this.choiceContext;
		const forkContext = this.forkContext;

		if (!choiceContext.processed) {
			choiceContext.trueForkContext.add(forkContext.head);
			choiceContext.falseForkContext.add(forkContext.head);
		}

		/*
		 * If this isn't a hardcoded `true` condition, then `break`
		 * should continue down the path as if the condition evaluated
		 * to false.
		 */
		if (context.test !== true) {
			context.brokenForkContext.addAll(choiceContext.falseForkContext);
		}
		forkContext.replaceHead(choiceContext.trueForkContext.makeNext(0, -1));
	}

	/**
	 * Makes a code path segment for the body part of a DoWhileStatement.
	 * @returns {void}
	 */
	makeDoWhileBody() {
		const context = this.loopContext;
		const forkContext = this.forkContext;
		const bodySegments = forkContext.makeNext(-1, -1);

		// Update state.
		context.entrySegments = bodySegments;
		forkContext.replaceHead(bodySegments);
	}

	/**
	 * Makes a code path segment for the test part of a DoWhileStatement.
	 * @param {boolean|undefined} test The test value (only when constant).
	 * @returns {void}
	 */
	makeDoWhileTest(test) {
		const context = this.loopContext;
		const forkContext = this.forkContext;

		context.test = test;

		/*
		 * If there is a `continue` statement in the loop then `continueForkContext`
		 * won't be empty. We wire up the path from `continue` to the loop
		 * test condition and then continue the traversal in the root fork context.
		 */
		if (!context.continueForkContext.empty) {
			context.continueForkContext.add(forkContext.head);
			const testSegments = context.continueForkContext.makeNext(0, -1);

			forkContext.replaceHead(testSegments);
		}
	}

	/**
	 * Makes a code path segment for the test part of a ForStatement.
	 * @param {boolean|undefined} test The test value (only when constant).
	 * @returns {void}
	 */
	makeForTest(test) {
		const context = this.loopContext;
		const forkContext = this.forkContext;
		const endOfInitSegments = forkContext.head;
		const testSegments = forkContext.makeNext(-1, -1);

		/*
		 * Update the state.
		 *
		 * The `continueDestSegments` are set to `testSegments` because we
		 * don't yet know if there is an update expression in this loop. So,
		 * from what we already know at this point, a `continue` statement
		 * will jump back to the test expression.
		 */
		context.test = test;
		context.endOfInitSegments = endOfInitSegments;
		context.continueDestSegments = context.testSegments = testSegments;
		forkContext.replaceHead(testSegments);
	}

	/**
	 * Makes a code path segment for the update part of a ForStatement.
	 * @returns {void}
	 */
	makeForUpdate() {
		const context = this.loopContext;
		const choiceContext = this.choiceContext;
		const forkContext = this.forkContext;

		// Make the next paths of the test.
		if (context.testSegments) {
			finalizeTestSegmentsOfFor(context, choiceContext, forkContext.head);
		} else {
			context.endOfInitSegments = forkContext.head;
		}

		/*
		 * Update the state.
		 *
		 * The `continueDestSegments` are now set to `updateSegments` because we
		 * know there is an update expression in this loop. So, a `continue` statement
		 * in the loop will jump to the update expression first, and then to any
		 * test expression the loop might have.
		 */
		const updateSegments = forkContext.makeDisconnected(-1, -1);

		context.continueDestSegments = context.updateSegments = updateSegments;
		forkContext.replaceHead(updateSegments);
	}

	/**
	 * Makes a code path segment for the body part of a ForStatement.
	 * @returns {void}
	 */
	makeForBody() {
		const context = this.loopContext;
		const choiceContext = this.choiceContext;
		const forkContext = this.forkContext;

		/*
		 * Determine what to do based on which part of the `for` loop are present.
		 * 1. If there is an update expression, then `updateSegments` is not null and
		 *    we need to assign `endOfUpdateSegments`, and if there is a test
		 *    expression, we then need to create the looped path to get back to
		 *    the test condition.
		 * 2. If there is no update expression but there is a test expression,
		 *    then we only need to update the test segment information.
		 * 3. If there is no update expression and no test expression, then we
		 *    just save `endOfInitSegments`.
		 */
		if (context.updateSegments) {
			context.endOfUpdateSegments = forkContext.head;

			/*
			 * In a `for` loop that has both an update expression and a test
			 * condition, execution flows from the test expression into the
			 * loop body, to the update expression, and then back to the test
			 * expression to determine if the loop should continue.
			 *
			 * To account for that, we need to make a path from the end of the
			 * update expression to the start of the test expression. This is
			 * effectively what creates the loop in the code path.
			 */
			if (context.testSegments) {
				makeLooped(
					this,
					context.endOfUpdateSegments,
					context.testSegments,
				);
			}
		} else if (context.testSegments) {
			finalizeTestSegmentsOfFor(context, choiceContext, forkContext.head);
		} else {
			context.endOfInitSegments = forkContext.head;
		}

		let bodySegments = context.endOfTestSegments;

		/*
		 * If there is a test condition, then there `endOfTestSegments` is also
		 * the start of the loop body. If there isn't a test condition then
		 * `bodySegments` will be null and we need to look elsewhere to find
		 * the start of the body.
		 *
		 * The body starts at the end of the init expression and ends at the end
		 * of the update expression, so we use those locations to determine the
		 * body segments.
		 */
		if (!bodySegments) 3{
			const prevForkContext = ForkContext.newEmpty(forkContext);

			prevForkContext.add(context.endOfInitSegments);
			if (context.endOfUpdateSegments) {
				prevForkContext.add(context.endOfUpdateSegments);
			}

			bodySegments = prevForkContext.makeNext(0, -1);
		}

		/*
		 * If there was no test condition and no update expression, then
		 * `continueDestSegments` will be null. In that case, a
		 * `continue` should skip directly to the body of the loop.
		 * Otherwise, we want to keep the current `continueDestSegments`.
		 */
		context.continueDestSegments =
			context.continueDestSegments || bodySegments;

		// move pointer to the body
		forkContext.replaceHead(bodySegments);
	}

	/**
	 * Makes a code path segment for the left part of a ForInStatement and a
	 * ForOfStatement.
	 * @returns {void}
	 */
	makeForInOfLeft() {
		const context = this.loopContext;
		const forkContext = this.forkContext;
		const leftSegments = forkContext.makeDisconnected(-1, -1);

		// Update state.
		context.prevSegments = forkContext.head;
		context.leftSegments = context.continueDestSegments = leftSegments;
		forkContext.replaceHead(leftSegments);
	}

	/**
	 * Makes a code path segment for the right part of a ForInStatement and a
	 * ForOfStatement.
	 * @returns {void}
	 */
	makeForInOfRight() {
		const context = this.loopContext;
		const forkContext = this.forkContext;
		const temp = ForkContext.newEmpty(forkContext);

		temp.add(context.prevSegments);
		const rightSegments = temp.makeNext(-1, -1);

		// Update state.
		context.endOfLeftSegments = forkContext.head;
		forkContext.replaceHead(rightSegments);
	}

	/**
	 * Makes a code path segment for the body part of a ForInStatement and a
	 * ForOfStatement.
	 * @returns {void}
	 */
	makeForInOfBody() {
		const context = this.loopContext;
		const forkContext = this.forkContext;
		const temp = ForkContext.newEmpty(forkContext);

		temp.add(context.endOfLeftSegments);
		const bodySegments = temp.makeNext(-1, -1);

		// Make a path: `right` -> `left`.
		makeLooped(this, forkContext.head, context.leftSegments);

		// Update state.
		context.brokenForkContext.add(forkContext.head);
		forkContext.replaceHead(bodySegments);
	}

	//--------------------------------------------------------------------------
	// Control Statements
	//--------------------------------------------------------------------------

	/**
	 * Creates new context in which a `break` statement can be used. This occurs inside of a loop,
	 * labeled statement, or switch statement.
	 * @param {boolean} breakable Indicates if we are inside a statement where
	 *      `break` without a label will exit the statement.
	 * @param {string|null} label The label associated with the statement.
	 * @returns {BreakContext} The new context.
	 */
	pushBreakContext(breakable, label) {
		this.breakContext = new BreakContext(
			this.breakContext,
			breakable,
			label,
			this.forkContext,
		);
		return this.breakContext;
	}

	/**
	 * Removes the top item of the break context stack.
	 * @returns {Object} The removed context.
	 */
	popBreakContext() {
		const context = this.breakContext;
		const forkContext = this.forkContext;

		this.breakContext = context.upper;

		// Process this context here for other than switches and loops.
		if (!context.breakable) {
			const brokenForkContext = context.brokenForkContext;

			if (!brokenForkContext.empty) {
				brokenForkContext.add(forkContext.head);
				forkContext.replaceHead(brokenForkContext.makeNext(0, -1));
			}
		}

		return context;
	}

	/**
	 * Makes a path for a `break` statement.
	 *
	 * It registers the head segment to a context of `break`.
	 * It makes new unreachable segment, then it set the head with the segment.
	 * @param {string|null} label A label of the break statement.
	 * @returns {void}
	 */
	makeBreak(label) {
		const forkContext = this.forkContext;

		if (!forkContext.reachable) {
			return;
		}

		const context = getBreakContext(this, label);

		if (context) {
			context.brokenForkContext.add(forkContext.head);
		}

		/* c8 ignore next */
		forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
	}

	/**
	 * Makes a path for a `continue` statement.
	 *
	 * It makes a looping path.
	 * It makes new unreachable segment, then it set the head with the segment.
	 * @param {string|null} label A label of the continue statement.
	 * @returns {void}
	 */
	makeContinue(label) {
		const forkContext = this.forkContext;

		if (!forkContext.reachable) {
			return;
		}

		const context = getContinueContext(this, label);

		if (context) {
			if (context.continueDestSegments) {
				makeLooped(
					this,
					forkContext.head,
					context.continueDestSegments,
				);

				// If the context is a for-in/of loop, this affects a break also.
				if (
					context.type === "ForInStatement" ||
					context.type === "ForOfStatement"
				) {
					context.brokenForkContext.add(forkContext.head);
				}
			} else {
				context.continueForkContext.add(forkContext.head);
			}
		}
		forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
	}

	/**
	 * Makes a path for a `return` statement.
	 *
	 * It registers the head segment to a context of `return`.
	 * It makes new unreachable segment, then it set the head with the segment.
	 * @returns {void}
	 */
	makeReturn() {
		const forkContext = this.forkContext;

		if (forkContext.reachable) {
			getReturnContext(this).returnedForkContext.add(forkContext.head);
			forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
		}
	}

	/**
	 * Makes a path for a `throw` statement.
	 *
	 * It registers the head segment to a context of `throw`.
	 * It makes new unreachable segment, then it set the head with the segment.
	 * @returns {void}
	 */
	makeThrow() {
		const forkContext = this.forkContext;

		if (forkContext.reachable) {
			getThrowContext(this).thrownForkContext.add(forkContext.head);
			forkContext.replaceHead(forkContext.makeUnreachable(-1, -1));
		}
	}

	/**
	 * Makes the final path.
	 * @returns {void}
	 */
	makeFinal() {
		const segments = this.currentSegments;

		if (segments.length > 0 && segments[0].reachable) {
			this.returnedForkContext.add(segments);
		}
	}
}

module.exports = CodePathState;
Xj,Mx
&/**
 * @fileoverview A class of the code path.
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const CodePathState = require("./code-path-state");
const IdGenerator = require("./id-generator");

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

/**
 * A code path.
 */
class CodePath {
	/**
	 * Creates a new instance.
	 * @param {Object} options Options for the function (see below).
	 * @param {string} options.id An identifier.
	 * @param {string} options.origin The type of code path origin.
	 * @param {CodePath|null} options.upper The code path of the upper function scope.
	 * @param {Function} options.onLooped A callback function to notify looping.
	 */
	constructor({ id, origin, upper, onLooped }) {
		/**
		 * The identifier of this code path.
		 * Rules use it to store additional information of each rule.
		 * @type {string}
		 */
		this.id = id;

		/**
		 * The reason that this code path was started. May be "program",
		 * "function", "class-field-initializer", or "class-static-block".
		 * @type {string}
		 */
		this.origin = origin;

		/**
		 * The code path of the upper function scope.
		 * @type {CodePath|null}
		 */
		this.upper = upper;

		/**
		 * The code paths of nested function scopes.
		 * @type {CodePath[]}
		 */
		this.childCodePaths = [];

		// Initializes internal state.
		Object.defineProperty(this, "internal", {
			value: new CodePathState(new IdGenerator(`${id}_`), onLooped),
		});

		// Adds this into `childCodePaths` of `upper`.
		if (upper) {
			upper.childCodePaths.push(this);
		}
	}

	/**
	 * Gets the state of a given code path.
	 * @param {CodePath} codePath A code path to get.
	 * @returns {CodePathState} The state of the code path.
	 */
	static getState(codePath) {
		return codePath.internal;
	}

	/**
	 * The initial code path segment. This is the segment that is at the head
	 * of the code path.
	 * This is a passthrough to the underlying `CodePathState`.
	 * @type {CodePathSegment}
	 */
	get initialSegment() {
		return this.internal.initialSegment;
	}

	/**
	 * Final code path segments. These are the terminal (tail) segments in the
	 * code path, which is the combination of `returnedSegments` and `thrownSegments`.
	 * All segments in this array are reachable.
	 * This is a passthrough to the underlying `CodePathState`.
	 * @type {CodePathSegment[]}
	 */
	get finalSegments() {
		return this.internal.finalSegments;
	}

	/**
	 * Final code path segments that represent normal completion of the code path.
	 * For functions, this means both explicit `return` statements and implicit returns,
	 * such as the last reachable segment in a function that does not have an
	 * explicit `return` as this implicitly returns `undefined`, as well as
	 * return-like exits from suspended `yield` expressions. For scripts, modules,
	 * class field initializers, and class static blocks, this means all lines of
	 * code have been executed.
	 * These segments are also present in `finalSegments`.
	 * This is a passthrough to the underlying `CodePathState`.
	 * @type {CodePathSegment[]}
	 */
	get returnedSegments() {
		return this.internal.returnedForkContext;
	}

	/**
	 * Final code path segments that represent `throw` statements and throw-like
	 * exits from suspended `yield` expressions.
	 * This is a passthrough to the underlying `CodePathState`.
	 * These segments are also present in `finalSegments`.
	 * @type {CodePathSegment[]}
	 */
	get thrownSegments() {
		return this.internal.thrownForkContext;
	}

	/**
	 * Traverses all segments in this code path.
	 *
	 *     codePath.traverseSegments((segment, controller) => {
	 *         // do something.
	 *     });
	 *
	 * This method enumerates segments in order from the head.
	 *
	 * The `controller` argument has two methods:
	 *
	 * - `skip()` - skips the following segments in this branch
	 * - `break()` - skips all following segments in the traversal
	 *
	 * A note on the parameters: the `options` argument is optional. This means
	 * the first argument might be an options object or the callback function.
	 * @param {Object} [optionsOrCallback] Optional first and last segments to traverse.
	 * @param {CodePathSegment} [optionsOrCallback.first] The first segment to traverse.
	 * @param {CodePathSegment} [optionsOrCallback.last] The last segment to traverse.
	 * @param {Function} callback A callback function.
	 * @returns {void}
	 */
	traverseSegments(optionsOrCallback, callback) {
		// normalize the arguments into a callback and options
		let resolvedOptions;
		let resolvedCallback;

		if (typeof optionsOrCallback === "function") {
			resolvedCallback = optionsOrCallback;
			resolvedOptions = {};
		} else {
			resolvedOptions = optionsOrCallback || {};
			resolvedCallback = callback;
		}

		// determine where to start traversing from based on the options
		const startSegment =
			resolvedOptions.first || this.internal.initialSegment;
		const lastSegment = resolvedOptions.last;

		// set up initial location information
		let record;
		let index;
		let end;
		let segment = null;

		// segments that have already been visited during traversal
		const visited = new Set();

		// tracks the traversal steps
		const stack = [[startSegment, 0]];

		// segments that have been skipped during traversal
		const skipped = new Set();

		// indicates if we exited early from the traversal
		let broken = false;

		/**
		 * Maintains traversal state.
		 */
		const controller = {
			/**
			 * Skip the following segments in this branch.
			 * @returns {void}
			 */
			skip() {
				skipped.add(segment);
			},

			/**
			 * Stop traversal completely - do not traverse to any
			 * other segments.
			 * @returns {void}
			 */
			break() {
				broken = true;
			},
		};

		/**
		 * Checks if a given previous segment has been visited.
		 * @param {CodePathSegment} prevSegment A previous segment to check.
		 * @returns {boolean} `true` if the segment has been visited.
		 */
		function isVisited(prevSegment) {
			return (
				visited.has(prevSegment) ||
				segment.isLoopedPrevSegment(prevSegment)
			);
		}

		/**
		 * Checks if a given previous segment has been skipped.
		 * @param {CodePathSegment} prevSegment A previous segment to check.
		 * @returns {boolean} `true` if the segment has been skipped.
		 */
		function isSkipped(prevSegment) {
			return (
				skipped.has(prevSegment) ||
				segment.isLoopedPrevSegment(prevSegment)
			);
		}

		// the traversal
		while (stack.length > 0) {
			/*
			 * This isn't a pure stack. We use the top record all the time
			 * but don't always pop it off. The record is popped only if
			 * one of the following is true:
			 *
			 * 1) We have already visited the segment.
			 * 2) We have not visited *all* of the previous segments.
			 * 3) We have traversed past the available next segments.
			 *
			 * Otherwise, we just read the value and sometimes modify the
			 * record as we traverse.
			 */
			record = stack.at(-1);
			segment = record[0];
			index = record[1];

			if (index === 0) {
				// Skip if this segment has been visited already.
				if (visited.has(segment)) {
					stack.pop();
					continue;
				}

				// Skip if all previous segments have not been visited.
				if (
					segment !== startSegment &&
					segment.prevSegments.length > 0 &&
					!segment.prevSegments.every(isVisited)
				) {
					stack.pop();
					continue;
				}

				visited.add(segment);

				// Skips the segment if all previous segments have been skipped.
				const shouldSkip =
					skipped.size > 0 &&
					segment.prevSegments.length > 0 &&
					segment.prevSegments.every(isSkipped);

				/*
				 * If the most recent segment hasn't been skipped, then we call
				 * the callback, passing in the segment and the controller.
				 */
				if (!shouldSkip) {
					resolvedCallback.call(this, segment, controller);

					// exit if we're at the last segment
					if (segment === lastSegment) {
						controller.skip();
					}

					/*
					 * If the previous statement was executed, or if the callback
					 * called a method on the controller, we might need to exit the
					 * loop, so check for that and break accordingly.
					 */
					if (broken) {
						break;
					}
				} else {
					// If the most recent segment has been skipped, then mark it as skipped.
					skipped.add(segment);
				}
			}

			// Update the stack.
			end = segment.nextSegments.length - 1;
			if (index < end) {
				/*
				 * If we haven't yet visited all of the next segments, update
				 * the current top record on the stack to the next index to visit
				 * and then push a record for the current segment on top.
				 *
				 * Setting the current top record's index lets us know how many
				 * times we've been here and ensures that the segment won't be
				 * reprocessed (because we only process segments with an index
				 * of 0).
				 */
				record[1] += 1;
				stack.push([segment.nextSegments[index], 0]);
			} else if (index === end) {
				/*
				 * If we are at the last next segment, then reset the top record
				 * in the stack to next segment and set its index to 0 so it will
				 * be processed next.
				 */
				record[0] = segment.nextSegments[index];
				record[1] = 0;
			} else {
				/*
				 * If index > end, that means we have no more segments that need
				 * processing. So, we pop that record off of the stack in order to
				 * continue traversing at the next level up.
				 */
				stack.pop();
			}
		}
	}
}

module.exports = CodePath;
*x/**
 * @fileoverview Helpers to debug for code path analysis.
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const debug = require("debug")("eslint:code-path");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Gets id of a given segment.
 * @param {CodePathSegment} segment A segment to get.
 * @returns {string} Id of the segment.
 */
/* c8 ignore next */
// eslint-disable-next-line jsdoc/require-jsdoc -- Ignoring
function getId(segment) {
	return segment.id + (segment.reachable ? "" : "!");
}

/**
 * Get string for the given node and operation.
 * @param {ASTNode} node The node to convert.
 * @param {"enter" | "exit" | undefined} label The operation label.
 * @returns {string} The string representation.
 */
function nodeToString(node, label) {
	const suffix = label ? `:${label}` : "";

	switch (node.type) {
		case "Identifier":
			return `${node.type}${suffix} (${node.name})`;
		case "Literal":
			return `${node.type}${suffix} (${node.value})`;
		default:
			return `${node.type}${suffix}`;
	}
}

/**
 * Escape text for use in a DOT label.
 * @param {string} value The value to escape.
 * @returns {string} The escaped value.
 */
function escapeDotLabelText(value) {
	return value.replace(/\\/gu, String.raw`\\`).replace(/"/gu, String.raw`\"`);
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

module.exports = {
	/**
	 * A flag that debug dumping is enabled or not.
	 * @type {boolean}
	 */
	enabled: debug.enabled,

	/**
	 * Dumps given objects.
	 * @param {...any} args objects to dump.
	 * @returns {void}
	 */
	dump: debug,

	/**
	 * Dumps the current analyzing state.
	 * @param {ASTNode} node A node to dump.
	 * @param {CodePathState} state A state to dump.
	 * @param {boolean} leaving A flag whether or not it's leaving
	 * @returns {void}
	 */
	dumpState: !debug.enabled
		? debug
		: /* c8 ignore next */ function (node, state, leaving) {
				for (let i = 0; i < state.currentSegments.length; ++i) {
					const segInternal = state.currentSegments[i].internal;

					if (leaving) {
						const last = segInternal.nodes.length - 1;

						if (
							last >= 0 &&
							segInternal.nodes[last] ===
								nodeToString(node, "enter")
						) {
							segInternal.nodes[last] = nodeToString(
								node,
								void 0,
							);
						} else {
							segInternal.nodes.push(nodeToString(node, "exit"));
						}
					} else {
						segInternal.nodes.push(nodeToString(node, "enter"));
					}
				}

				debug(
					[
						`${state.currentSegments.map(getId).join(",")})`,
						`${node.type}${leaving ? ":exit" : ""}`,
					].join(" "),
				);
			},

	/**
	 * Dumps a DOT code of a given code path.
	 * The DOT code can be visualized with Graphvis.
	 * @param {CodePath} codePath A code path to dump.
	 * @returns {void}
	 * @see https://www.graphviz.org
	 * @see http://www.webgraphviz.com
	 */
	dumpDot: !debug.enabled
		? debug
		: /* c8 ignore next */ function (codePath) {
				let text =
					"\n" +
					"digraph {\n" +
					'node[shape=box,style="rounded,filled",fillcolor=white];\n' +
					'initial[label="",shape=circle,style=filled,fillcolor=black,width=0.25,height=0.25];\n';

				if (codePath.returnedSegments.length > 0) {
					text +=
						'final[label="",shape=doublecircle,style=filled,fillcolor=black,width=0.25,height=0.25];\n';
				}
				if (codePath.thrownSegments.length > 0) {
					text +=
						'thrown[label="✘",shape=circle,width=0.3,height=0.3,fixedsize=true];\n';
				}

				const traceMap = Object.create(null);
				const arrows = this.makeDotArrows(codePath, traceMap);

				// eslint-disable-next-line guard-for-in -- Want ability to traverse prototype
				for (const id in traceMap) {
					const segment = traceMap[id];

					text += `${id}[`;

					if (segment.reachable) {
						text += 'label="';
					} else {
						text +=
							'style="rounded,dashed,filled",fillcolor="#FF9800",label="<<unreachable>>\\n';
					}

					if (segment.internal.nodes.length > 0) {
						text += segment.internal.nodes
							.map(escapeDotLabelText)
							.join("\\n");
					} else {
						text += "????";
					}

					text += '"];\n';
				}

				text += `${arrows}\n`;
				text += "}";
				debug("DOT", text);
			},

	/**
	 * Makes a DOT code of a given code path.
	 * The DOT code can be visualized with Graphvis.
	 * @param {CodePath} codePath A code path to make DOT.
	 * @param {Object} traceMap Optional. A map to check whether or not segments had been done.
	 * @returns {string} A DOT code of the code path.
	 */
	makeDotArrows(codePath, traceMap) {
		const stack = [[codePath.initialSegment, 0]];
		const done = traceMap || Object.create(null);
		let lastId = codePath.initialSegment.id;
		let text = `initial->${codePath.initialSegment.id}`;

		while (stack.length > 0) {
			const item = stack.pop();
			const segment = item[0];
			const index = item[1];

			if (done[segment.id] && index === 0) {
				continue;
			}
			done[segment.id] = segment;

			const nextSegment = segment.allNextSegments[index];

			if (!nextSegment) {
				continue;
			}

			if (lastId === segment.id) {
				text += `->${nextSegment.id}`;
			} else {
				text += `;\n${segment.id}->${nextSegment.id}`;
			}
			lastId = nextSegment.id;

			stack.unshift([segment, 1 + index]);
			stack.push([nextSegment, 0]);
		}

		codePath.returnedSegments.forEach(finalSegment => {
			if (lastId === finalSegment.id) {
				text += "->final";
			} else {
				text += `;\n${finalSegment.id}->final`;
			}
			lastId = null;
		});

		codePath.thrownSegments.forEach(finalSegment => {
			if (lastId === finalSegment.id) {
				text += "->thrown";
			} else {
				text += `;\n${finalSegment.id}->thrown`;
			}
			lastId = null;
		});

		return `${text};`;
	},
};
q.x0/**
 * @fileoverview A class to operate forking.
 *
 * This is state of forking.
 * This has a fork list and manages it.
 *
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const assert = require("../../shared/assert"),
	CodePathSegment = require("./code-path-segment");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Determines whether or not a given segment is reachable.
 * @param {CodePathSegment} segment The segment to check.
 * @returns {boolean} `true` if the segment is reachable.
 */
function isReachable(segment) {
	return segment.reachable;
}

/**
 * Creates a new segment for each fork in the given context and appends it
 * to the end of the specified range of segments. Ultimately, this ends up calling
 * `new CodePathSegment()` for each of the forks using the `create` argument
 * as a wrapper around special behavior.
 *
 * The `startIndex` and `endIndex` arguments specify a range of segments in
 * `context` that should become `allPrevSegments` for the newly created
 * `CodePathSegment` objects.
 *
 * When `context.segmentsList` is `[[a, b], [c, d], [e, f]]`, `begin` is `0`, and
 * `end` is `-1`, this creates two new segments, `[g, h]`. This `g` is appended to
 * the end of the path from `a`, `c`, and `e`. This `h` is appended to the end of
 * `b`, `d`, and `f`.
 * @param {ForkContext} context An instance from which the previous segments
 *      will be obtained.
 * @param {number} startIndex The index of the first segment in the context
 *      that should be specified as previous segments for the newly created segments.
 * @param {number} endIndex The index of the last segment in the context
 *      that should be specified as previous segments for the newly created segments.
 * @param {Function} create A function that creates new `CodePathSegment`
 *      instances in a particular way. See the `CodePathSegment.new*` methods.
 * @returns {Array<CodePathSegment>} An array of the newly-created segments.
 */
function createSegments(context, startIndex, endIndex, create) {
	/** @type {Array<Array<CodePathSegment>>} */
	const list = context.segmentsList;

	/*
	 * Both `startIndex` and `endIndex` work the same way: if the number is zero
	 * or more, then the number is used as-is. If the number is negative,
	 * then that number is added to the length of the segments list to
	 * determine the index to use. That means -1 for either argument
	 * is the last element, -2 is the second to last, and so on.
	 *
	 * So if `startIndex` is 0, `endIndex` is -1, and `list.length` is 3, the
	 * effective `startIndex` is 0 and the effective `endIndex` is 2, so this function
	 * will include items at indices 0, 1, and 2.
	 *
	 * Therefore, if `startIndex` is -1 and `endIndex` is -1, that means we'll only
	 * be using the last segment in `list`.
	 */
	const normalizedBegin =
		startIndex >= 0 ? startIndex : list.length + startIndex;
	const normalizedEnd = endIndex >= 0 ? endIndex : list.length + endIndex;

	/** @type {Array<CodePathSegment>} */
	const segments = [];

	for (let i = 0; i < context.count; ++i) {
		// this is passed into `new CodePathSegment` to add to code path.
		const allPrevSegments = [];

		for (let j = normalizedBegin; j <= normalizedEnd; ++j) {
			allPrevSegments.push(list[j][i]);
		}

		// note: `create` is just a wrapper that augments `new CodePathSegment`.
		segments.push(create(context.idGenerator.next(), allPrevSegments));
	}

	return segments;
}

/**
 * Inside of a `finally` block we end up with two parallel paths. If the code path
 * exits by a control statement (such as `break` or `continue`) from the `finally`
 * block, then we need to merge the remaining parallel paths back into one.
 * @param {ForkContext} context The fork context to work on.
 * @param {Array<CodePathSegment>} segments Segments to merge.
 * @returns {Array<CodePathSegment>} The merged segments.
 */
function mergeExtraSegments(context, segments) {
	let currentSegments = segments;

	/*
	 * We need to ensure that the array returned from this function contains no more
	 * than the number of segments that the context allows. `context.count` indicates
	 * how many items should be in the returned array to ensure that the new segment
	 * entries will line up with the already existing segment entries.
	 */
	while (currentSegments.length > context.count) {
		const merged = [];

		/*
		 * Because `context.count` is a factor of 2 inside of a `finally` block,
		 * we can divide the segment count by 2 to merge the paths together.
		 * This loops through each segment in the list and creates a new `CodePathSegment`
		 * that has the segment and the segment two slots away as previous segments.
		 *
		 * If `currentSegments` is [a,b,c,d], this will create new segments e and f, such
		 * that:
		 *
		 * When `i` is 0:
		 * a->e
		 * c->e
		 *
		 * When `i` is 1:
		 * b->f
		 * d->f
		 */
		for (
			let i = 0, length = Math.floor(currentSegments.length / 2);
			i < length;
			++i
		) {
			merged.push(
				CodePathSegment.newNext(context.idGenerator.next(), [
					currentSegments[i],
					currentSegments[i + length],
				]),
			);
		}

		/*
		 * Go through the loop condition one more time to see if we have the
		 * number of segments for the context. If not, we'll keep merging paths
		 * of the merged segments until we get there.
		 */
		currentSegments = merged;
	}

	return currentSegments;
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

/**
 * Manages the forking of code paths.
 */
class ForkContext {
	/**
	 * Creates a new instance.
	 * @param {IdGenerator} idGenerator An identifier generator for segments.
	 * @param {ForkContext|null} upper The preceding fork context.
	 * @param {number} count The number of parallel segments in each element
	 *      of `segmentsList`.
	 */
	constructor(idGenerator, upper, count) {
		/**
		 * The ID generator that will generate segment IDs for any new
		 * segments that are created.
		 * @type {IdGenerator}
		 */
		this.idGenerator = idGenerator;

		/**
		 * The preceding fork context.
		 * @type {ForkContext|null}
		 */
		this.upper = upper;

		/**
		 * The number of elements in each element of `segmentsList`. In most
		 * cases, this is 1 but can be 2 when there is a `finally` present,
		 * which forks the code path outside of normal flow. In the case of nested
		 * `finally` blocks, this can be a multiple of 2.
		 * @type {number}
		 */
		this.count = count;

		/**
		 * The segments within this context. Each element in this array has
		 * `count` elements that represent one step in each fork. For example,
		 * when `segmentsList` is `[[a, b], [c, d], [e, f]]`, there is one path
		 * a->c->e and one path b->d->f, and `count` is 2 because each element
		 * is an array with two elements.
		 * @type {Array<Array<CodePathSegment>>}
		 */
		this.segmentsList = [];
	}

	/**
	 * The segments that begin this fork context.
	 * @type {Array<CodePathSegment>}
	 */
	get head() {
		const list = this.segmentsList;

		return list.length === 0 ? [] : list.at(-1);
	}

	/**
	 * Indicates if the context contains no segments.
	 * @type {boolean}
	 */
	get empty() {
		return this.segmentsList.length === 0;
	}

	/**
	 * Indicates if there are any segments that are reachable.
	 * @type {boolean}
	 */
	get reachable() {
		const segments = this.head;

		return segments.length > 0 && segments.some(isReachable);
	}

	/**
	 * Creates new segments in this context and appends them to the end of the
	 * already existing `CodePathSegment`s specified by `startIndex` and
	 * `endIndex`.
	 * @param {number} startIndex The index of the first segment in the context
	 *      that should be specified as previous segments for the newly created segments.
	 * @param {number} endIndex The index of the last segment in the context
	 *      that should be specified as previous segments for the newly created segments.
	 * @returns {Array<CodePathSegment>} An array of the newly created segments.
	 */
	makeNext(startIndex, endIndex) {
		return createSegments(
			this,
			startIndex,
			endIndex,
			CodePathSegment.newNext,
		);
	}

	/**
	 * Creates new unreachable segments in this context and appends them to the end of the
	 * already existing `CodePathSegment`s specified by `startIndex` and
	 * `endIndex`.
	 * @param {number} startIndex The index of the first segment in the context
	 *      that should be specified as previous segments for the newly created segments.
	 * @param {number} endIndex The index of the last segment in the context
	 *      that should be specified as previous segments for the newly created segments.
	 * @returns {Array<CodePathSegment>} An array of the newly created segments.
	 */
	makeUnreachable(startIndex, endIndex) {
		return createSegments(
			this,
			startIndex,
			endIndex,
			CodePathSegment.newUnreachable,
		);
	}

	/**
	 * Creates new segments in this context and does not append them to the end
	 *  of the already existing `CodePathSegment`s specified by `startIndex` and
	 * `endIndex`. The `startIndex` and `endIndex` are only used to determine if
	 * the new segments should be reachable. If any of the segments in this range
	 * are reachable then the new segments are also reachable; otherwise, the new
	 * segments are unreachable.
	 * @param {number} startIndex The index of the first segment in the context
	 *      that should be considered for reachability.
	 * @param {number} endIndex The index of the last segment in the context
	 *      that should be considered for reachability.
	 * @returns {Array<CodePathSegment>} An array of the newly created segments.
	 */
	makeDisconnected(startIndex, endIndex) {
		return createSegments(
			this,
			startIndex,
			endIndex,
			CodePathSegment.newDisconnected,
		);
	}

	/**
	 * Adds segments to the head of this context.
	 * @param {Array<CodePathSegment>} segments The segments to add.
	 * @returns {void}
	 */
	add(segments) {
		assert(
			segments.length >= this.count,
			`${segments.length} >= ${this.count}`,
		);
		this.segmentsList.push(mergeExtraSegments(this, segments));
	}

	/**
	 * Replaces the head segments with the given segments.
	 * The current head segments are removed.
	 * @param {Array<CodePathSegment>} replacementHeadSegments The new head segments.
	 * @returns {void}
	 */
	replaceHead(replacementHeadSegments) {
		assert(
			replacementHeadSegments.length >= this.count,
			`${replacementHeadSegments.length} >= ${this.count}`,
		);
		this.segmentsList.splice(
			-1,
			1,
			mergeExtraSegments(this, replacementHeadSegments),
		);
	}

	/**
	 * Adds all segments of a given fork context into this context.
	 * @param {ForkContext} otherForkContext The fork context to add from.
	 * @returns {void}
	 */
	addAll(otherForkContext) {
		assert(otherForkContext.count === this.count);
		this.segmentsList.push(...otherForkContext.segmentsList);
	}

	/**
	 * Clears all segments in this context.
	 * @returns {void}
	 */
	clear() {
		this.segmentsList = [];
	}

	/**
	 * Creates a new root context, meaning that there are no parent
	 * fork contexts.
	 * @param {IdGenerator} idGenerator An identifier generator for segments.
	 * @returns {ForkContext} New fork context.
	 */
	static newRoot(idGenerator) {
		const context = new ForkContext(idGenerator, null, 1);

		context.add([CodePathSegment.newRoot(idGenerator.next())]);

		return context;
	}

	/**
	 * Creates an empty fork context preceded by a given context.
	 * @param {ForkContext} parentContext The parent fork context.
	 * @param {boolean} shouldForkLeavingPath Indicates that we are inside of
	 *      a `finally` block and should therefore fork the path that leaves
	 *      `finally`.
	 * @returns {ForkContext} New fork context.
	 */
	static newEmpty(parentContext, shouldForkLeavingPath) {
		return new ForkContext(
			parentContext.idGenerator,
			parentContext,
			(shouldForkLeavingPath ? 2 : 1) * parentContext.count,
		);
	}
}

module.exports = ForkContext;
[4xH/**
 * @fileoverview A class of identifiers generator for code path segments.
 *
 * Each rule uses the identifier of code path segments to store additional
 * information of the code path.
 *
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

/**
 * A generator for unique ids.
 */
class IdGenerator {
	/**
	 * @param {string} prefix Optional. A prefix of generated ids.
	 */
	constructor(prefix) {
		this.prefix = String(prefix);
		this.n = 0;
	}

	/**
	 * Generates id.
	 * @returns {string} A generated id.
	 */
	next() {
		this.n = (1 + this.n) | 0;

		if (this.n < 0) {
			this.n = 1;
		}

		return this.prefix + this.n;
	}
}

module.exports = IdGenerator;
9ﯶx$y/**
 * @fileoverview ESQuery wrapper for ESLint.
 * @author Nicholas C. Zakas
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const esquery = require("esquery");

//-----------------------------------------------------------------------------
// Typedefs
//-----------------------------------------------------------------------------

/**
 * @typedef {import("esquery").Selector} ESQuerySelector
 * @typedef {import("esquery").ESQueryOptions} ESQueryOptions
 */

//------------------------------------------------------------------------------
// Classes
//------------------------------------------------------------------------------

/**
 * The result of parsing and analyzing an ESQuery selector.
 */
class ESQueryParsedSelector {
	/**
	 * The raw selector string that was parsed
	 * @type {string}
	 */
	source;

	/**
	 * Whether this selector is an exit selector
	 * @type {boolean}
	 */
	isExit;

	/**
	 * An object (from esquery) describing the matching behavior of the selector
	 * @type {ESQuerySelector}
	 */
	root;

	/**
	 * The node types that could possibly trigger this selector, or `null` if all node types could trigger it
	 * @type {string[]|null}
	 */
	nodeTypes;

	/**
	 * The number of class, pseudo-class, and attribute queries in this selector
	 * @type {number}
	 */
	attributeCount;

	/**
	 * The number of identifier queries in this selector
	 * @type {number}
	 */
	identifierCount;

	/**
	 * Creates a new parsed selector.
	 * @param {string} source The raw selector string that was parsed
	 * @param {boolean} isExit Whether this selector is an exit selector
	 * @param {ESQuerySelector} root An object (from esquery) describing the matching behavior of the selector
	 * @param {string[]|null} nodeTypes The node types that could possibly trigger this selector, or `null` if all node types could trigger it
	 * @param {number} attributeCount The number of class, pseudo-class, and attribute queries in this selector
	 * @param {number} identifierCount The number of identifier queries in this selector
	 */
	constructor(
		source,
		isExit,
		root,
		nodeTypes,
		attributeCount,
		identifierCount,
	) {
		this.source = source;
		this.isExit = isExit;
		this.root = root;
		this.nodeTypes = nodeTypes;
		this.attributeCount = attributeCount;
		this.identifierCount = identifierCount;
	}

	/**
	 * Compares this selector's specificity to another selector for sorting purposes.
	 * @param {ESQueryParsedSelector} otherSelector The selector to compare against
	 * @returns {number}
	 * a value less than 0 if this selector is less specific than otherSelector
	 * a value greater than 0 if this selector is more specific than otherSelector
	 * a value less than 0 if this selector and otherSelector have the same specificity, and this selector <= otherSelector alphabetically
	 * a value greater than 0 if this selector and otherSelector have the same specificity, and this selector > otherSelector alphabetically
	 */
	compare(otherSelector) {
		return (
			this.attributeCount - otherSelector.attributeCount ||
			this.identifierCount - otherSelector.identifierCount ||
			(this.source <= otherSelector.source ? -1 : 1)
		);
	}
}

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const selectorCache = new Map();

/**
 * Computes the union of one or more arrays
 * @param {...any[]} arrays One or more arrays to union
 * @returns {any[]} The union of the input arrays
 */
function union(...arrays) {
	return [...new Set(arrays.flat())];
}

/**
 * Computes the intersection of one or more arrays
 * @param {...any[]} arrays One or more arrays to intersect
 * @returns {any[]} The intersection of the input arrays
 */
function intersection(...arrays) {
	if (arrays.length === 0) {
		return [];
	}

	let result = [...new Set(arrays[0])];

	for (const array of arrays.slice(1)) {
		result = result.filter(x => array.includes(x));
	}
	return result;
}

/**
 * Analyzes a parsed selector and returns combined data about it
 * @param {ESQuerySelector} parsedSelector An object (from esquery) describing the matching behavior of the selector
 * @returns {{nodeTypes:string[]|null, attributeCount:number, identifierCount:number}} Object containing selector data.
 */
function analyzeParsedSelector(parsedSelector) {
	let attributeCount = 0;
	let identifierCount = 0;

	/**
	 * Analyzes a selector and returns the node types that could possibly trigger it.
	 * @param {ESQuerySelector} selector The selector to analyze.
	 * @returns {string[]|null} The node types that could possibly trigger this selector, or `null` if all node types could trigger it
	 */
	function analyzeSelector(selector) {
		switch (selector.type) {
			case "identifier":
				identifierCount++;
				return [selector.value];

			case "not":
				selector.selectors.map(analyzeSelector);
				return null;

			case "matches": {
				const typesForComponents =
					selector.selectors.map(analyzeSelector);

				if (typesForComponents.every(Boolean)) {
					return union(...typesForComponents);
				}
				return null;
			}

			case "compound": {
				const typesForComponents = selector.selectors
					.map(analyzeSelector)
					.filter(typesForComponent => typesForComponent);

				// If all of the components could match any type, then the compound could also match any type.
				if (!typesForComponents.length) {
					return null;
				}

				/*
				 * If at least one of the components could only match a particular type, the compound could only match
				 * the intersection of those types.
				 */
				return intersection(...typesForComponents);
			}

			case "attribute":
			case "field":
			case "nth-child":
			case "nth-last-child":
				attributeCount++;
				return null;

			case "child":
			case "descendant":
			case "sibling":
			case "adjacent":
				analyzeSelector(selector.left);
				return analyzeSelector(selector.right);

			case "class":
				// TODO: abstract into JSLanguage somehow
				if (selector.name === "function") {
					return [
						"FunctionDeclaration",
						"FunctionExpression",
						"ArrowFunctionExpression",
					];
				}
				return null;

			default:
				return null;
		}
	}

	const nodeTypes = analyzeSelector(parsedSelector);

	return {
		nodeTypes,
		attributeCount,
		identifierCount,
	};
}

/**
 * Tries to parse a simple selector string, such as a single identifier or wildcard.
 * This saves time by avoiding the overhead of esquery parsing for simple cases.
 * @param {string} selector The selector string to parse.
 * @returns {Object|null} An object describing the selector if it is simple, or `null` if it is not.
 */
function trySimpleParseSelector(selector) {
	if (selector === "*") {
		return {
			type: "wildcard",
			value: "*",
		};
	}

	if (/^[a-z]+$/iu.test(selector)) {
		return {
			type: "identifier",
			value: selector,
		};
	}

	return null;
}

/**
 * Parses a raw selector string, and throws a useful error if parsing fails.
 * @param {string} selector The selector string to parse.
 * @returns {Object} An object (from esquery) describing the matching behavior of this selector
 * @throws {Error} An error if the selector is invalid
 */
function tryParseSelector(selector) {
	try {
		return esquery.parse(selector);
	} catch (err) {
		if (
			err.location &&
			err.location.start &&
			typeof err.location.start.offset === "number"
		) {
			throw new SyntaxError(
				`Syntax error in selector "${selector}" at position ${err.location.start.offset}: ${err.message}`,
				{
					cause: err,
				},
			);
		}
		throw err;
	}
}

/**
 * Parses a raw selector string, and returns the parsed selector along with specificity and type information.
 * @param {string} source A raw AST selector
 * @returns {ESQueryParsedSelector} A selector descriptor
 */
function parse(source) {
	if (selectorCache.has(source)) {
		return selectorCache.get(source);
	}

	const cleanSource = source.replace(/:exit$/u, "");
	const parsedSelector =
		trySimpleParseSelector(cleanSource) ?? tryParseSelector(cleanSource);
	const { nodeTypes, attributeCount, identifierCount } =
		analyzeParsedSelector(parsedSelector);

	const result = new ESQueryParsedSelector(
		source,
		source.endsWith(":exit"),
		parsedSelector,
		nodeTypes,
		attributeCount,
		identifierCount,
	);

	selectorCache.set(source, result);
	return result;
}

/**
 * Checks if a node matches a given selector.
 * @param {Object} node The node to check against the selector.
 * @param {ESQuerySelector} root The root of the selector to match against.
 * @param {Object[]} ancestry The ancestry of the node being checked, which is an array of nodes from the current node to the root.
 * @param {ESQueryOptions} options The options to use for matching.
 * @returns {boolean} `true` if the node matches the selector, `false` otherwise.
 */
function matches(node, root, ancestry, options) {
	return esquery.matches(node, root, ancestry, options);
}

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

module.exports = {
	parse,
	matches,
	ESQueryParsedSelector,
};
?ɶ/xu/**
 * @fileoverview The FileContext class.
 * @author Nicholas C. Zakas
 */

"use strict";

/**
 * Represents a file context that the linter can use to lint a file.
 */
class FileContext {
	/**
	 * The current working directory.
	 * @type {string}
	 */
	cwd;

	/**
	 * The filename of the file being linted.
	 * @type {string}
	 */
	filename;

	/**
	 * The physical filename of the file being linted.
	 * @type {string}
	 */
	physicalFilename;

	/**
	 * The source code of the file being linted.
	 * @type {SourceCode}
	 */
	sourceCode;

	/**
	 * The language options used when parsing this file.
	 * @type {Record<string, unknown>}
	 */
	languageOptions;

	/**
	 * The settings for the file being linted.
	 * @type {Record<string, unknown>}
	 */
	settings;

	/**
	 * Creates a new instance.
	 * @param {Object} config The configuration object for the file context.
	 * @param {string} config.cwd The current working directory.
	 * @param {string} config.filename The filename of the file being linted.
	 * @param {string} config.physicalFilename The physical filename of the file being linted.
	 * @param {SourceCode} config.sourceCode The source code of the file being linted.
	 * @param {Record<string, unknown>} config.languageOptions The language options used when parsing this file.
	 * @param {Record<string, unknown>} config.settings The settings for the file being linted.
	 */
	constructor({
		cwd,
		filename,
		physicalFilename,
		sourceCode,
		languageOptions,
		settings,
	}) {
		this.cwd = cwd;
		this.filename = filename;
		this.physicalFilename = physicalFilename;
		this.sourceCode = sourceCode;
		this.languageOptions = languageOptions;
		this.settings = settings;

		Object.freeze(this);
	}

	/**
	 * Creates a new object with the current object as the prototype and
	 * the specified properties as its own properties.
	 * @param {Object} extension The properties to add to the new object.
	 * @returns {FileContext} A new object with the current object as the prototype
	 * and the specified properties as its own properties.
	 */
	extend(extension) {
		return Object.freeze(Object.assign(Object.create(this), extension));
	}
}

exports.FileContext = FileContext;
/	xH|/**
 * @fileoverview A class to track messages reported by the linter for a file.
 * @author Nicholas C. Zakas
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const assert = require("../shared/assert");
const { RuleFixer } = require("./rule-fixer");
const { interpolate } = require("./interpolate");
const ruleReplacements = require("../../conf/replacements.json");

//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------

/** @typedef {import("../types").Linter.LintMessage} LintMessage */
/** @typedef {import("../types").Linter.LintSuggestion} SuggestionResult */
/** @typedef {import("@eslint/core").Language} Language */
/** @typedef {import("@eslint/core").SourceLocation} SourceLocation */

/**
 * An error message description
 * @typedef {Object} MessageDescriptor
 * @property {ASTNode} [node] The reported node
 * @property {Location} loc The location of the problem.
 * @property {string} message The problem message.
 * @property {Object} [data] Optional data to use to fill in placeholders in the
 *      message.
 * @property {Function} [fix] The function to call that creates a fix command.
 * @property {Array<{desc?: string, messageId?: string, fix: Function}>} suggest Suggestion descriptions and functions to create a the associated fixes.
 */

/**
 * @typedef {Object} LintProblem
 * @property {string} ruleId The rule ID that reported the problem.
 * @property {string} message The problem message.
 * @property {SourceLocation} loc The location of the problem.
 */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const DEFAULT_ERROR_LOC = {
	start: { line: 1, column: 0 },
	end: { line: 1, column: 1 },
};

/**
 * Updates a given location based on the language offsets. This allows us to
 * change 0-based locations to 1-based locations. We always want ESLint
 * reporting lines and columns starting from 1.
 * @todo Potentially this should be moved into a shared utility file.
 * @param {Object} location The location to update.
 * @param {number} location.line The starting line number.
 * @param {number} location.column The starting column number.
 * @param {number} [location.endLine] The ending line number.
 * @param {number} [location.endColumn] The ending column number.
 * @param {Language} language The language to use to adjust the location information.
 * @returns {Object} The updated location.
 */
function updateLocationInformation(
	{ line, column, endLine, endColumn },
	language,
) {
	const columnOffset = language.columnStart === 1 ? 0 : 1;
	const lineOffset = language.lineStart === 1 ? 0 : 1;

	// calculate separately to account for undefined
	const finalEndLine = endLine === void 0 ? endLine : endLine + lineOffset;
	const finalEndColumn =
		endColumn === void 0 ? endColumn : endColumn + columnOffset;

	return {
		line: line + lineOffset,
		column: column + columnOffset,
		endLine: finalEndLine,
		endColumn: finalEndColumn,
	};
}

/**
 * creates a missing-rule message.
 * @param {string} ruleId the ruleId to create
 * @returns {string} created error message
 * @private
 */
function createMissingRuleMessage(ruleId) {
	return Object.hasOwn(ruleReplacements.rules, ruleId)
		? `Rule '${ruleId}' was removed and replaced by: ${ruleReplacements.rules[ruleId].join(", ")}`
		: `Definition for rule '${ruleId}' was not found.`;
}

/**
 * creates a linting problem
 * @param {LintProblem} options to create linting error
 * @param {RuleSeverity} severity the error message to report
 * @param {Language} language the language to use to adjust the location information.
 * @returns {LintMessage} created problem, returns a missing-rule problem if only provided ruleId.
 * @private
 */
function createLintingProblem(options, severity, language) {
	const {
		ruleId = null,
		loc = DEFAULT_ERROR_LOC,
		message = createMissingRuleMessage(options.ruleId),
	} = options;

	return {
		ruleId,
		message,
		...updateLocationInformation(
			{
				line: loc.start.line,
				column: loc.start.column,
				endLine: loc.end.line,
				endColumn: loc.end.column,
			},
			language,
		),
		severity,
	};
}

/**
 * Translates a multi-argument context.report() call into a single object argument call
 * @param {...*} args A list of arguments passed to `context.report`
 * @returns {MessageDescriptor} A normalized object containing report information
 */
function normalizeMultiArgReportCall(...args) {
	// If there is one argument, it is considered to be a new-style call already.
	if (args.length === 1) {
		// Shallow clone the object to avoid surprises if reusing the descriptor
		return Object.assign({}, args[0]);
	}

	// If the second argument is a string, the arguments are interpreted as [node, message, data, fix].
	if (typeof args[1] === "string") {
		return {
			node: args[0],
			message: args[1],
			data: args[2],
			fix: args[3],
		};
	}

	// Otherwise, the arguments are interpreted as [node, loc, message, data, fix].
	return {
		node: args[0],
		loc: args[1],
		message: args[2],
		data: args[3],
		fix: args[4],
	};
}

/**
 * Asserts that either a loc or a node was provided, and the node is valid if it was provided.
 * @param {MessageDescriptor} descriptor A descriptor to validate
 * @returns {void}
 * @throws AssertionError if neither a node nor a loc was provided, or if the node is not an object
 */
function assertValidNodeInfo(descriptor) {
	if (descriptor.node) {
		assert(typeof descriptor.node === "object", "Node must be an object");
	} else {
		assert(
			descriptor.loc,
			"Node must be provided when reporting error if location is not provided",
		);
	}
}

/**
 * Normalizes a MessageDescriptor to always have a `loc` with `start` and `end` properties
 * @param {MessageDescriptor} descriptor A descriptor for the report from a rule.
 * @returns {{start: Location, end: (Location|null)}} An updated location that infers the `start` and `end` properties
 * from the `node` of the original descriptor, or infers the `start` from the `loc` of the original descriptor.
 */
function normalizeReportLoc(descriptor) {
	if (descriptor.loc.start) {
		return descriptor.loc;
	}
	return { start: descriptor.loc, end: null };
}

/**
 * Clones the given fix object.
 * @param {Fix|null} fix The fix to clone.
 * @returns {Fix|null} Deep cloned fix object or `null` if `null` or `undefined` was passed in.
 */
function cloneFix(fix) {
	if (!fix) {
		return null;
	}

	return {
		range: [fix.range[0], fix.range[1]],
		text: fix.text,
	};
}

/**
 * Check that a fix has a valid range.
 * @param {Fix|null} fix The fix to validate.
 * @returns {void}
 */
function assertValidFix(fix) {
	if (fix) {
		assert(
			fix.range &&
				typeof fix.range[0] === "number" &&
				typeof fix.range[1] === "number",
			`Fix has invalid range: ${JSON.stringify(fix, null, 2)}`,
		);
	}
}

/**
 * Compares items in a fixes array by range.
 * @param {Fix} a The first message.
 * @param {Fix} b The second message.
 * @returns {number} -1 if a comes before b, 1 if a comes after b, 0 if equal.
 * @private
 */
function compareFixesByRange(a, b) {
	return a.range[0] - b.range[0] || a.range[1] - b.range[1];
}

/**
 * Merges the given fixes array into one.
 * @param {Fix[]} fixes The fixes to merge.
 * @param {SourceCode} sourceCode The source code object to get the text between fixes.
 * @returns {{text: string, range: number[]}} The merged fixes
 */
function mergeFixes(fixes, sourceCode) {
	for (const fix of fixes) {
		assertValidFix(fix);
	}

	if (fixes.length === 0) {
		return null;
	}
	if (fixes.length === 1) {
		return cloneFix(fixes[0]);
	}

	fixes.sort(compareFixesByRange);

	const originalText = sourceCode.text;
	const start = fixes[0].range[0];
	const end = fixes.at(-1).range[1];
	let text = "";
	let lastPos = Number.MIN_SAFE_INTEGER;

	for (const fix of fixes) {
		assert(
			fix.range[0] >= lastPos,
			"Fix objects must not be overlapped in a report.",
		);

		if (fix.range[0] >= 0) {
			text += originalText.slice(
				Math.max(0, start, lastPos),
				fix.range[0],
			);
		}
		text += fix.text;
		lastPos = fix.range[1];
	}
	text += originalText.slice(Math.max(0, start, lastPos), end);

	return { range: [start, end], text };
}

/**
 * Gets one fix object from the given descriptor.
 * If the descriptor retrieves multiple fixes, this merges those to one.
 * @param {MessageDescriptor} descriptor The report descriptor.
 * @param {SourceCode} sourceCode The source code object to get text between fixes.
 * @returns {({text: string, range: number[]}|null)} The fix for the descriptor
 */
function normalizeFixes(descriptor, sourceCode) {
	if (typeof descriptor.fix !== "function") {
		return null;
	}

	const ruleFixer = new RuleFixer({ sourceCode });

	// @type {null | Fix | Fix[] | IterableIterator<Fix>}
	const fix = descriptor.fix(ruleFixer);

	// Merge to one.
	if (fix && Symbol.iterator in fix) {
		return mergeFixes(Array.from(fix), sourceCode);
	}

	assertValidFix(fix);
	return cloneFix(fix);
}

/**
 * Gets an array of suggestion objects from the given descriptor.
 * @param {MessageDescriptor} descriptor The report descriptor.
 * @param {SourceCode} sourceCode The source code object to get text between fixes.
 * @param {Object} messages Object of meta messages for the rule.
 * @returns {Array<SuggestionResult>} The suggestions for the descriptor
 */
function mapSuggestions(descriptor, sourceCode, messages) {
	if (!descriptor.suggest || !Array.isArray(descriptor.suggest)) {
		return [];
	}

	return (
		descriptor.suggest
			.map(suggestInfo => {
				const computedDesc =
					suggestInfo.desc || messages[suggestInfo.messageId];

				return {
					...suggestInfo,
					desc: interpolate(computedDesc, suggestInfo.data),
					fix: normalizeFixes(suggestInfo, sourceCode),
				};
			})

			// Remove suggestions that didn't provide a fix
			.filter(({ fix }) => fix)
	);
}

/**
 * Creates information about the report from a descriptor
 * @param {Object} options Information about the problem
 * @param {string} options.ruleId Rule ID
 * @param {(0|1|2)} options.severity Rule severity
 * @param {string} options.message Error message
 * @param {string} [options.messageId] The error message ID.
 * @param {{start: SourceLocation, end: (SourceLocation|null)}} options.loc Start and end location
 * @param {{text: string, range: (number[]|null)}} options.fix The fix object
 * @param {Array<{text: string, range: (number[]|null)}>} options.suggestions The array of suggestions objects
 * @param {Language} [options.language] The language to use to adjust line and column offsets.
 * @returns {LintMessage} Information about the report
 */
function createProblem(options) {
	const { language } = options;

	// calculate offsets based on the language in use
	const columnOffset = language.columnStart === 1 ? 0 : 1;
	const lineOffset = language.lineStart === 1 ? 0 : 1;

	const problem = {
		ruleId: options.ruleId,
		severity: options.severity,
		message: options.message,
		line: options.loc.start.line + lineOffset,
		column: options.loc.start.column + columnOffset,
	};

	/*
	 * If this isn’t in the conditional, some of the tests fail
	 * because `messageId` is present in the problem object
	 */
	if (options.messageId) {
		problem.messageId = options.messageId;
	}

	if (options.loc.end) {
		problem.endLine = options.loc.end.line + lineOffset;
		problem.endColumn = options.loc.end.column + columnOffset;
	}

	if (options.fix) {
		problem.fix = options.fix;
	}

	if (options.suggestions && options.suggestions.length > 0) {
		problem.suggestions = options.suggestions;
	}

	return problem;
}

/**
 * Validates that suggestions are properly defined. Throws if an error is detected.
 * @param {Array<{ desc?: string, messageId?: string }>} suggest The incoming suggest data.
 * @param {Object} messages Object of meta messages for the rule.
 * @returns {void}
 */
function validateSuggestions(suggest, messages) {
	if (suggest && Array.isArray(suggest)) {
		suggest.forEach(suggestion => {
			if (suggestion.messageId) {
				const { messageId } = suggestion;

				if (!messages) {
					throw new TypeError(
						`context.report() called with a suggest option with a messageId '${messageId}', but no messages were present in the rule metadata.`,
					);
				}

				if (!messages[messageId]) {
					throw new TypeError(
						`context.report() called with a suggest option with a messageId '${messageId}' which is not present in the 'messages' config: ${JSON.stringify(messages, null, 2)}`,
					);
				}

				if (suggestion.desc) {
					throw new TypeError(
						"context.report() called with a suggest option that defines both a 'messageId' and an 'desc'. Please only pass one.",
					);
				}
			} else if (!suggestion.desc) {
				throw new TypeError(
					"context.report() called with a suggest option that doesn't have either a `desc` or `messageId`",
				);
			}

			if (typeof suggestion.fix !== "function") {
				throw new TypeError(
					`context.report() called with a suggest option without a fix function. See: ${JSON.stringify(suggestion, null, 2)}`,
				);
			}
		});
	}
}

/**
 * Computes the message from a report descriptor.
 * @param {MessageDescriptor} descriptor The report descriptor.
 * @param {Object} messages Object of meta messages for the rule.
 * @returns {string} The computed message.
 * @throws {TypeError} If messageId is not found or both message and messageId are provided.
 */
function computeMessageFromDescriptor(descriptor, messages) {
	if (descriptor.messageId) {
		if (!messages) {
			throw new TypeError(
				"context.report() called with a messageId, but no messages were present in the rule metadata.",
			);
		}
		const id = descriptor.messageId;

		if (descriptor.message) {
			throw new TypeError(
				"context.report() called with a message and a messageId. Please only pass one.",
			);
		}
		if (!messages || !Object.hasOwn(messages, id)) {
			throw new TypeError(
				`context.report() called with a messageId of '${id}' which is not present in the 'messages' config: ${JSON.stringify(messages, null, 2)}`,
			);
		}
		return messages[id];
	}

	if (descriptor.message) {
		return descriptor.message;
	}

	throw new TypeError(
		"Missing `message` property in report() call; add a message that describes the linting problem.",
	);
}

/**
 * A report object that contains the messages reported the linter
 * for a file.
 */
class FileReport {
	/**
	 * The messages reported by the linter for this file.
	 * @type {LintMessage[]}
	 */
	messages = [];

	/**
	 * A rule mapper that maps rule IDs to their metadata.
	 * @type {(string) => RuleDefinition}
	 */
	#ruleMapper;

	/**
	 * The source code object for the file.
	 * @type {SourceCode}
	 */
	#sourceCode;

	/**
	 * The language to use to adjust line and column offsets.
	 * @type {Language}
	 */
	#language;

	/**
	 * Whether to disable fixes for this report.
	 * @type {boolean}
	 */
	#disableFixes;

	/**
	 * Creates a new FileReport instance.
	 * @param {Object} options The options for the file report
	 * @param {(string) => RuleDefinition} options.ruleMapper A rule mapper that maps rule IDs to their metadata.
	 * @param {SourceCode} options.sourceCode The source code object for the file.
	 * @param {Language} options.language The language to use to adjust line and column offsets.
	 * @param {boolean} [options.disableFixes=false] Whether to disable fixes for this report.
	 */
	constructor({ ruleMapper, sourceCode, language, disableFixes = false }) {
		this.#ruleMapper = ruleMapper;
		this.#sourceCode = sourceCode;
		this.#language = language;
		this.#disableFixes = disableFixes;
	}

	/**
	 * Adds a rule-generated message to the report.
	 * @param {string} ruleId The rule ID that reported the problem.
	 * @param {0|1|2} severity The severity of the problem (0 = off, 1 = warning, 2 = error).
	 * @param {...*} args The arguments passed to `context.report()`.
	 * @returns {LintMessage} The created message object.
	 * @throws {TypeError} If the messageId is not found or both message and messageId are provided.
	 * @throws {AssertionError} If the node is not an object or neither a node nor a loc is provided.
	 */
	addRuleMessage(ruleId, severity, ...args) {
		const descriptor = normalizeMultiArgReportCall(...args);
		const ruleDefinition = this.#ruleMapper(ruleId);
		const messages = ruleDefinition?.meta?.messages;

		assertValidNodeInfo(descriptor);

		const computedMessage = computeMessageFromDescriptor(
			descriptor,
			messages,
		);

		validateSuggestions(descriptor.suggest, messages);

		this.messages.push(
			createProblem({
				ruleId,
				severity,
				message: interpolate(computedMessage, descriptor.data),
				messageId: descriptor.messageId,
				loc: descriptor.loc
					? normalizeReportLoc(descriptor)
					: this.#sourceCode.getLoc(descriptor.node),
				fix: this.#disableFixes
					? null
					: normalizeFixes(descriptor, this.#sourceCode),
				suggestions: this.#disableFixes
					? []
					: mapSuggestions(descriptor, this.#sourceCode, messages),
				language: this.#language,
			}),
		);

		return this.messages.at(-1);
	}

	/**
	 * Adds an error message to the report. Meant to be called outside of rules.
	 * @param {LintProblem} descriptor The descriptor for the error message.
	 * @returns {LintMessage} The created message object.
	 */
	addError(descriptor) {
		const message = createLintingProblem(descriptor, 2, this.#language);
		this.messages.push(message);
		return message;
	}

	/**
	 * Adds a fatal error message to the report. Meant to be called outside of rules.
	 * @param {LintProblem} descriptor The descriptor for the fatal error message.
	 * @returns {LintMessage} The created message object.
	 */
	addFatal(descriptor) {
		const message = createLintingProblem(descriptor, 2, this.#language);
		message.fatal = true;
		this.messages.push(message);
		return message;
	}

	/**
	 * Adds a warning message to the report. Meant to be called outside of rules.
	 * @param {LintProblem} descriptor The descriptor for the warning message.
	 * @returns {LintMessage} The created message object.
	 */
	addWarning(descriptor) {
		const message = createLintingProblem(descriptor, 1, this.#language);
		this.messages.push(message);
		return message;
	}
}

module.exports = {
	FileReport,
	updateLocationInformation,
};
x L"use strict";

const { Linter } = require("./linter");
const SourceCodeFixer = require("./source-code-fixer");

module.exports = {
	Linter,

	// For testers.
	SourceCodeFixer,
};
:ӰTx@/**
 * @fileoverview Interpolate keys from an object into a string with {{ }} markers.
 * @author Jed Fox
 */

"use strict";

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

/**
 * Returns a global expression matching placeholders in messages.
 * @returns {RegExp} Global regular expression matching placeholders
 */
function getPlaceholderMatcher() {
	return /\{\{([^{}]+)\}\}/gu;
}

/**
 * Replaces {{ placeholders }} in the message with the provided data.
 * Does not replace placeholders not available in the data.
 * @param {string} text Original message with potential placeholders
 * @param {Record<string, string>} data Map of placeholder name to its value
 * @returns {string} Message with replaced placeholders
 */
function interpolate(text, data) {
	if (!data) {
		return text;
	}

	const matcher = getPlaceholderMatcher();

	// Substitution content for any {{ }} markers.
	return text.replace(matcher, (fullMatch, termWithWhitespace) => {
		const term = termWithWhitespace.trim();

		if (term in data) {
			return data[term];
		}

		// Preserve old behavior: If parameter name not provided, don't replace it.
		return fullMatch;
	});
}

module.exports = {
	getPlaceholderMatcher,
	interpolate,
};
Ax3?/**
 * @fileoverview Main Linter Class
 * @author Gyandeep Singh
 * @author aladdin-add
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const path = require("node:path"),
	eslintScope = require("eslint-scope"),
	evk = require("eslint-visitor-keys"),
	pkg = require("../../package.json"),
	Traverser = require("../shared/traverser"),
	{ SourceCode } = require("../languages/js/source-code"),
	applyDisableDirectives = require("./apply-disable-directives"),
	{ ConfigCommentParser } = require("@eslint/plugin-kit"),
	SourceCodeFixer = require("./source-code-fixer"),
	{ SourceCodeVisitor } = require("./source-code-visitor"),
	timing = require("./timing");
const { FlatConfigArray } = require("../config/flat-config-array");
const { startTime, endTime } = require("../shared/stats");
const { assertIsRuleSeverity } = require("../config/flat-config-schema");
const {
	normalizeSeverityToString,
	normalizeSeverityToNumber,
} = require("../shared/severity");
const { deepMergeArrays } = require("../shared/deep-merge-arrays");
const {
	activeFlags,
	inactiveFlags,
	getInactivityReasonMessage,
} = require("../shared/flags");
const debug = require("debug")("eslint:linter");
const MAX_AUTOFIX_PASSES = 10;
const DEFAULT_ECMA_VERSION = 5;
const commentParser = new ConfigCommentParser();
const { VFile } = require("./vfile");
const { ParserService } = require("../services/parser-service");
const { FileContext } = require("./file-context");
const { ProcessorService } = require("../services/processor-service");
const { containsDifferentProperty } = require("../shared/option-utils");
const { Config } = require("../config/config");
const { WarningService } = require("../services/warning-service");
const { SourceCodeTraverser } = require("./source-code-traverser");
const { FileReport, updateLocationInformation } = require("./file-report");

//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------

/** @import { Language, LanguageOptions, RuleConfig, RuleDefinition } from "@eslint/core" */

/** @typedef {import("../types").Linter.Config} ConfigObject */
/** @typedef {import("../types").Linter.LanguageOptions} JSLanguageOptions */
/** @typedef {import("../types").Linter.LintMessage} LintMessage */
/** @typedef {import("../types").Linter.Parser} Parser */
/** @typedef {import("../types").Linter.ParserOptions} ParserOptions */
/** @typedef {import("../types").Linter.Processor} Processor */
/** @typedef {import("../types").Rule.RuleModule} Rule */
/** @typedef {import("../types").Linter.StringSeverity} StringSeverity */
/** @typedef {import("../types").Linter.SuppressedLintMessage} SuppressedLintMessage */
/** @typedef {import("../types").Linter.TimePass} TimePass */

/* eslint-disable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/4#issuecomment-778805577 */
/**
 * @template T
 * @typedef {{ [P in keyof T]-?: T[P] }} Required
 */
/* eslint-enable jsdoc/valid-types -- https://github.com/jsdoc-type-pratt-parser/jsdoc-type-pratt-parser/issues/4#issuecomment-778805577 */

/**
 * @typedef {Object} DisableDirective
 * @property {("disable"|"enable"|"disable-line"|"disable-next-line")} type Type of directive
 * @property {number} line The line number
 * @property {number} column The column number
 * @property {(string|null)} ruleId The rule ID
 * @property {string} justification The justification of directive
 */

/**
 * The private data for `Linter` instance.
 * @typedef {Object} LinterInternalSlots
 * @property {FlatConfigArray|null} lastConfigArray The `ConfigArray` instance that the last `verify()` call used.
 * @property {SourceCode|null} lastSourceCode The `SourceCode` instance that the last `verify()` call used.
 * @property {SuppressedLintMessage[]} lastSuppressedMessages The `SuppressedLintMessage[]` instance that the last `verify()` call produced.
 * @property {{ passes: TimePass[]; }} times The times spent on applying a rule to a file (see `stats` option).
 * @property {WarningService} warningService The warning service.
 */

/**
 * @typedef {Object} VerifyOptions
 * @property {boolean} [allowInlineConfig] Allow/disallow inline comments' ability
 *      to change config once it is set. Defaults to true if not supplied.
 *      Useful if you want to validate JS without comments overriding rules.
 * @property {boolean} [disableFixes] if `true` then the linter doesn't make `fix`
 *      properties into the lint result.
 * @property {string} [filename] the filename of the source code.
 * @property {boolean | "off" | "warn" | "error"} [reportUnusedDisableDirectives] Adds reported errors for
 *      unused `eslint-disable` directives.
 * @property {Function} [ruleFilter] A predicate function that determines whether a given rule should run.
 */

/**
 * @typedef {Object} ProcessorOptions
 * @property {(filename:string, text:string) => boolean} [filterCodeBlock] the
 *      predicate function that selects adopt code blocks.
 * @property {Processor.postprocess} [postprocess] postprocessor for report
 *      messages. If provided, this should accept an array of the message lists
 *      for each code block returned from the preprocessor, apply a mapping to
 *      the messages as appropriate, and return a one-dimensional array of
 *      messages.
 * @property {Processor.preprocess} [preprocess] preprocessor for source text.
 *      If provided, this should accept a string of source text, and return an
 *      array of code blocks to lint.
 */

/**
 * @typedef {Object} FixOptions
 * @property {boolean | ((message: LintMessage) => boolean)} [fix] Determines
 *      whether fixes should be applied.
 */

/**
 * @typedef {Object} InternalOptions
 * @property {string | null} warnInlineConfig The config name what `noInlineConfig` setting came from. If `noInlineConfig` setting didn't exist, this is null. If this is a config name, then the linter warns directive comments.
 * @property {StringSeverity} reportUnusedDisableDirectives Severity to report unused disable directives, if not "off" (boolean values were normalized).
 * @property {StringSeverity} reportUnusedInlineConfigs Severity to report unused inline configs, if not "off".
 */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Wraps the value in an Array if it isn't already one.
 * @template T
 * @param {T|T[]} value Value to be wrapped.
 * @returns {Array} The value as an array.
 */
function asArray(value) {
	return Array.isArray(value) ? value : [value];
}

/**
 * Pushes a problem to inlineConfigProblems if ruleOptions are redundant.
 * @param {Config} config Provided config.
 * @param {Object} loc A line/column location
 * @param {FileReport} report Report that may be added to.
 * @param {string} ruleId The rule ID.
 * @param {Array} ruleOptions The rule options, merged with the config's.
 * @param {Array} ruleOptionsInline The rule options from the comment.
 * @param {"error"|"warn"} severity The severity to report.
 * @returns {void}
 */
function addProblemIfSameSeverityAndOptions(
	config,
	loc,
	report,
	ruleId,
	ruleOptions,
	ruleOptionsInline,
	severity,
) {
	const existingConfigRaw = config.rules?.[ruleId];
	const existingConfig = existingConfigRaw
		? asArray(existingConfigRaw)
		: ["off"];
	const existingSeverity = normalizeSeverityToString(existingConfig[0]);
	const inlineSeverity = normalizeSeverityToString(ruleOptions[0]);
	const sameSeverity = existingSeverity === inlineSeverity;

	if (!sameSeverity) {
		return;
	}

	const alreadyConfigured = existingConfigRaw
		? `is already configured to '${existingSeverity}'`
		: "is not enabled so can't be turned off";
	let message;

	if (
		(existingConfig.length === 1 && ruleOptions.length === 1) ||
		existingSeverity === "off"
	) {
		message = `Unused inline config ('${ruleId}' ${alreadyConfigured}).`;
	} else if (
		!containsDifferentProperty(
			ruleOptions.slice(1),
			existingConfig.slice(1),
		)
	) {
		message =
			ruleOptionsInline.length === 1
				? `Unused inline config ('${ruleId}' ${alreadyConfigured}).`
				: `Unused inline config ('${ruleId}' ${alreadyConfigured} with the same options).`;
	}

	if (message) {
		const numericSeverity = normalizeSeverityToNumber(severity);
		const descriptor = {
			message,
			loc,
		};

		if (numericSeverity === 1) {
			report.addWarning(descriptor);
		} else if (numericSeverity === 2) {
			report.addError(descriptor);
		}
	}
}

/**
 * Creates a collection of disable directives from a comment
 * @param {Object} options to create disable directives
 * @param {("disable"|"enable"|"disable-line"|"disable-next-line")} options.type The type of directive comment
 * @param {string} options.value The value after the directive in the comment
 * comment specified no specific rules, so it applies to all rules (e.g. `eslint-disable`)
 * @param {string} options.justification The justification of the directive
 * @param {ASTNode|token} options.node The Comment node/token.
 * @param {function(string): {create: Function}} ruleMapper A map from rule IDs to defined rules
 * @param {Language} language The language to use to adjust the location information.
 * @param {SourceCode} sourceCode The SourceCode object to get comments from.
 * @param {FileReport} report The report to add problems to.
 * @returns {Object[]} Directives from the comment
 */
function createDisableDirectives(
	{ type, value, justification, node },
	ruleMapper,
	language,
	sourceCode,
	report,
) {
	const ruleIds = Object.keys(commentParser.parseListConfig(value));
	const directiveRules = ruleIds.length ? ruleIds : [null];
	const directives = []; // valid disable directives
	const parentDirective = { node, value, ruleIds };

	for (const ruleId of directiveRules) {
		const loc = sourceCode.getLoc(node);

		// push to directives, if the rule is defined(including null, e.g. /*eslint enable*/)
		if (ruleId === null || !!ruleMapper(ruleId)) {
			if (type === "disable-next-line") {
				const { line, column } = updateLocationInformation(
					loc.end,
					language,
				);

				directives.push({
					parentDirective,
					type,
					line,
					column,
					ruleId,
					justification,
				});
			} else {
				const { line, column } = updateLocationInformation(
					loc.start,
					language,
				);

				directives.push({
					parentDirective,
					type,
					line,
					column,
					ruleId,
					justification,
				});
			}
		} else {
			report.addError({ ruleId, loc });
		}
	}

	return directives;
}

/**
 * Parses comments in file to extract disable directives.
 * @param {SourceCode} sourceCode The SourceCode object to get comments from.
 * @param {function(string): {create: Function}} ruleMapper A map from rule IDs to defined rules
 * @param {Language} language The language to use to adjust the location information
 * @param {FileReport} report The report to add problems to.
 * @returns {DisableDirective[]}
 * A collection of the directive comments that were found, along with any problems that occurred when parsing
 */
function getDirectiveCommentsForFlatConfig(
	sourceCode,
	ruleMapper,
	language,
	report,
) {
	const disableDirectives = [];

	if (sourceCode.getDisableDirectives) {
		const { directives: directivesSources, problems: directivesProblems } =
			sourceCode.getDisableDirectives();

		if (Array.isArray(directivesProblems)) {
			directivesProblems.forEach(problem => report.addError(problem));
		}

		directivesSources.forEach(directive => {
			const directives = createDisableDirectives(
				directive,
				ruleMapper,
				language,
				sourceCode,
				report,
			);

			disableDirectives.push(...directives);
		});
	}

	return disableDirectives;
}

/**
 * Convert "/path/to/<text>" to "<text>".
 * `CLIEngine#executeOnText()` method gives "/path/to/<text>" if the filename
 * was omitted because `configArray.extractConfig()` requires an absolute path.
 * But the linter should pass `<text>` to `RuleContext#filename` in that
 * case.
 * Also, code blocks can have their virtual filename. If the parent filename was
 * `<text>`, the virtual filename is `<text>/0_foo.js` or something like (i.e.,
 * it's not an absolute path).
 * @param {string} filename The filename to normalize.
 * @returns {string} The normalized filename.
 */
function normalizeFilename(filename) {
	const parts = filename.split(path.sep);
	const index = parts.lastIndexOf("<text>");

	return index === -1 ? filename : parts.slice(index).join(path.sep);
}

/**
 * Normalizes the possible options for `linter.verify` and `linter.verifyAndFix` to a
 * consistent shape.
 * @param {VerifyOptions} providedOptions Options
 * @param {Config} config Config.
 * @returns {Required<VerifyOptions> & InternalOptions} Normalized options
 */
function normalizeVerifyOptions(providedOptions, config) {
	const linterOptions = config.linterOptions || config;
	const disableInlineConfig = linterOptions.noInlineConfig === true;
	const ignoreInlineConfig = providedOptions.allowInlineConfig === false;
	const configNameOfNoInlineConfig = config.configNameOfNoInlineConfig
		? ` (${config.configNameOfNoInlineConfig})`
		: "";

	let reportUnusedDisableDirectives =
		providedOptions.reportUnusedDisableDirectives;

	if (typeof reportUnusedDisableDirectives === "boolean") {
		reportUnusedDisableDirectives = reportUnusedDisableDirectives
			? "error"
			: "off";
	}
	if (typeof reportUnusedDisableDirectives !== "string") {
		if (typeof linterOptions.reportUnusedDisableDirectives === "boolean") {
			reportUnusedDisableDirectives =
				linterOptions.reportUnusedDisableDirectives ? "warn" : "off";
		} else {
			reportUnusedDisableDirectives =
				linterOptions.reportUnusedDisableDirectives === void 0
					? "off"
					: normalizeSeverityToString(
							linterOptions.reportUnusedDisableDirectives,
						);
		}
	}

	const reportUnusedInlineConfigs =
		linterOptions.reportUnusedInlineConfigs === void 0
			? "off"
			: normalizeSeverityToString(
					linterOptions.reportUnusedInlineConfigs,
				);

	let ruleFilter = providedOptions.ruleFilter;

	if (typeof ruleFilter !== "function") {
		ruleFilter = () => true;
	}

	return {
		filename: normalizeFilename(providedOptions.filename || "<input>"),
		allowInlineConfig: !ignoreInlineConfig,
		warnInlineConfig:
			disableInlineConfig && !ignoreInlineConfig
				? `your config${configNameOfNoInlineConfig}`
				: null,
		reportUnusedDisableDirectives,
		reportUnusedInlineConfigs,
		disableFixes: Boolean(providedOptions.disableFixes),
		stats: providedOptions.stats,
		ruleFilter,
	};
}

/**
 * Store time measurements in map
 * @param {number} time Time measurement
 * @param {Object} timeOpts Options relating which time was measured
 * @param {WeakMap<Linter, LinterInternalSlots>} slots Linter internal slots map
 * @returns {void}
 */
function storeTime(time, timeOpts, slots) {
	const { type, key } = timeOpts;

	if (!slots.times) {
		slots.times = { passes: [{}] };
	}

	const passIndex = slots.fixPasses;

	if (passIndex > slots.times.passes.length - 1) {
		slots.times.passes.push({});
	}

	if (key) {
		slots.times.passes[passIndex][type] ??= {};
		slots.times.passes[passIndex][type][key] ??= { total: 0 };
		slots.times.passes[passIndex][type][key].total += time;
	} else {
		slots.times.passes[passIndex][type] ??= { total: 0 };
		slots.times.passes[passIndex][type].total += time;
	}
}

/**
 * Get the options for a rule (not including severity), if any
 * @param {RuleConfig} ruleConfig rule configuration
 * @param {Object|undefined} defaultOptions rule.meta.defaultOptions
 * @returns {Array} of rule options, empty Array if none
 */
function getRuleOptions(ruleConfig, defaultOptions) {
	if (Array.isArray(ruleConfig)) {
		return deepMergeArrays(defaultOptions, ruleConfig.slice(1));
	}
	return defaultOptions ?? [];
}

/**
 * Analyze scope of the given AST.
 * @param {ASTNode} ast The `Program` node to analyze.
 * @param {JSLanguageOptions} languageOptions The language options.
 * @param {Record<string, string[]>} visitorKeys The visitor keys.
 * @returns {ScopeManager} The analysis result.
 */
function analyzeScope(ast, languageOptions, visitorKeys) {
	const parserOptions = languageOptions.parserOptions;
	const ecmaFeatures = parserOptions.ecmaFeatures || {};
	const ecmaVersion = languageOptions.ecmaVersion || DEFAULT_ECMA_VERSION;

	return eslintScope.analyze(ast, {
		ignoreEval: true,
		nodejsScope: ecmaFeatures.globalReturn,
		impliedStrict: ecmaFeatures.impliedStrict,
		ecmaVersion: typeof ecmaVersion === "number" ? ecmaVersion : 6,
		sourceType: languageOptions.sourceType || "script",
		childVisitorKeys: visitorKeys || evk.KEYS,
		fallback: Traverser.getKeys,
		jsx: ecmaFeatures.jsx,
	});
}

/**
 * Runs a rule, and gets its listeners
 * @param {RuleDefinition} rule A rule object
 * @param {Context} ruleContext The context that should be passed to the rule
 * @throws {TypeError} If `rule` is not an object with a `create` method
 * @throws {any} Any error during the rule's `create`
 * @returns {Object} A map of selector listeners provided by the rule
 */
function createRuleListeners(rule, ruleContext) {
	if (
		!rule ||
		typeof rule !== "object" ||
		typeof rule.create !== "function"
	) {
		throw new TypeError(
			`Error while loading rule '${ruleContext.id}': Rule must be an object with a \`create\` method`,
		);
	}

	try {
		return rule.create(ruleContext);
	} catch (ex) {
		ex.message = `Error while loading rule '${ruleContext.id}': ${ex.message}`;
		throw ex;
	}
}

/**
 * Runs the given rules on the given SourceCode object
 * @param {SourceCode} sourceCode A SourceCode object for the given text
 * @param {Object} configuredRules The rules configuration
 * @param {function(string): RuleDefinition} ruleMapper A mapper function from rule names to rules
 * @param {Language} language The language object used for parsing.
 * @param {LanguageOptions} languageOptions The options for parsing the code.
 * @param {Object} settings The settings that were enabled in the config
 * @param {string} filename The reported filename of the code
 * @param {boolean} applyDefaultOptions If true, apply rules' meta.defaultOptions in computing their config options.
 * @param {string | undefined} cwd cwd of the cli
 * @param {string} physicalFilename The full path of the file on disk without any code block information
 * @param {Function} ruleFilter A predicate function to filter which rules should be executed.
 * @param {boolean} stats If true, stats are collected appended to the result
 * @param {WeakMap<Linter, LinterInternalSlots>} slots InternalSlotsMap of linter
 * @param {FileReport} report The report to add problems to
 * @returns {FileReport} report The report with added problems
 * @throws {Error} If traversal into a node fails.
 */
function runRules(
	sourceCode,
	configuredRules,
	ruleMapper,
	language,
	languageOptions,
	settings,
	filename,
	applyDefaultOptions,
	cwd,
	physicalFilename,
	ruleFilter,
	stats,
	slots,
	report,
) {
	const visitor = new SourceCodeVisitor();

	/*
	 * Create a frozen object with the ruleContext properties and methods that are shared by all rules.
	 * All rule contexts will inherit from this object. This avoids the performance penalty of copying all the
	 * properties once for each rule.
	 */
	const fileContext = new FileContext({
		cwd,
		filename,
		physicalFilename: physicalFilename || filename,
		sourceCode,
		languageOptions,
		settings,
	});

	const steps = sourceCode.traverse();

	Object.keys(configuredRules).forEach(ruleId => {
		const severity = Config.getRuleNumericSeverity(configuredRules[ruleId]);

		// not load disabled rules
		if (severity === 0) {
			return;
		}

		if (ruleFilter && !ruleFilter({ ruleId, severity })) {
			return;
		}

		const rule = ruleMapper(ruleId);

		if (!rule) {
			report.addError({ ruleId });
			return;
		}

		const ruleContext = fileContext.extend({
			id: ruleId,
			options: getRuleOptions(
				configuredRules[ruleId],
				applyDefaultOptions ? rule.meta?.defaultOptions : void 0,
			),
			report(...args) {
				const problem = report.addRuleMessage(
					ruleId,
					severity,
					...args,
				);

				if (problem.fix && !(rule.meta && rule.meta.fixable)) {
					throw new Error(
						'Fixable rules must set the `meta.fixable` property to "code" or "whitespace".',
					);
				}

				if (
					problem.suggestions &&
					!(rule.meta && rule.meta.hasSuggestions === true)
				) {
					if (
						rule.meta &&
						rule.meta.docs &&
						typeof rule.meta.docs.suggestion !== "undefined"
					) {
						// Encourage migration from the former property name.
						throw new Error(
							"Rules with suggestions must set the `meta.hasSuggestions` property to `true`. `meta.docs.suggestion` is ignored by ESLint.",
						);
					}
					throw new Error(
						"Rules with suggestions must set the `meta.hasSuggestions` property to `true`.",
					);
				}
			},
		});

		const ruleListenersReturn =
			timing.enabled || stats
				? timing.time(
						ruleId,
						createRuleListeners,
						stats,
					)(rule, ruleContext)
				: createRuleListeners(rule, ruleContext);

		const ruleListeners = stats
			? ruleListenersReturn.result
			: ruleListenersReturn;

		if (stats) {
			storeTime(
				ruleListenersReturn.tdiff,
				{ type: "rules", key: ruleId },
				slots,
			);
		}

		/**
		 * Include `ruleId` in error logs
		 * @param {Function} ruleListener A rule method that listens for a node.
		 * @returns {Function} ruleListener wrapped in error handler
		 */
		function addRuleErrorHandler(ruleListener) {
			return function ruleErrorHandler(...listenerArgs) {
				try {
					const ruleListenerReturn = ruleListener(...listenerArgs);

					const ruleListenerResult = stats
						? ruleListenerReturn.result
						: ruleListenerReturn;

					if (stats) {
						storeTime(
							ruleListenerReturn.tdiff,
							{ type: "rules", key: ruleId },
							slots,
						);
					}

					return ruleListenerResult;
				} catch (e) {
					e.ruleId = ruleId;
					throw e;
				}
			};
		}

		if (typeof ruleListeners === "undefined" || ruleListeners === null) {
			throw new Error(
				`The create() function for rule '${ruleId}' did not return an object.`,
			);
		}

		// add all the selectors from the rule as listeners
		Object.keys(ruleListeners).forEach(selector => {
			const ruleListener =
				timing.enabled || stats
					? timing.time(ruleId, ruleListeners[selector], stats)
					: ruleListeners[selector];

			visitor.add(selector, addRuleErrorHandler(ruleListener));
		});
	});

	const traverser = SourceCodeTraverser.getInstance(language);

	traverser.traverseSync(sourceCode, visitor, { steps });

	return report;
}

/**
 * Ensure the source code to be a string.
 * @param {string|SourceCode} textOrSourceCode The text or source code object.
 * @returns {string} The source code text.
 */
function ensureText(textOrSourceCode) {
	if (typeof textOrSourceCode === "object") {
		const { hasBOM, text } = textOrSourceCode;
		const bom = hasBOM ? "\uFEFF" : "";

		return bom + text;
	}

	return String(textOrSourceCode);
}

/**
 * Normalize the value of the cwd
 * @param {string | undefined} cwd raw value of the cwd, path to a directory that should be considered as the current working directory, can be undefined.
 * @returns {string | undefined} normalized cwd
 */
function normalizeCwd(cwd) {
	if (cwd) {
		return cwd;
	}
	if (typeof process === "object") {
		return process.cwd();
	}

	// It's more explicit to assign the undefined
	// eslint-disable-next-line no-undefined -- Consistently returning a value
	return undefined;
}

/**
 * The map to store private data.
 * @type {WeakMap<Linter, LinterInternalSlots>}
 */
const internalSlotsMap = new WeakMap();

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

/**
 * Object that is responsible for verifying JavaScript text
 * @name Linter
 */
class Linter {
	/**
	 * Initialize the Linter.
	 * @param {Object} [config] the config object
	 * @param {string} [config.cwd] path to a directory that should be considered as the current working directory, can be undefined.
	 * @param {Array<string>} [config.flags] the feature flags to enable.
	 * @param {"flat"} [config.configType="flat"] the type of config used. Retrained for backwards compatibility, will be removed in future.
	 * @param {WarningService} [config.warningService] The warning service to use.
	 */
	constructor({
		cwd,
		configType = "flat",
		flags = [],
		warningService = new WarningService(),
	} = {}) {
		const processedFlags = [];

		if (configType !== "flat") {
			throw new TypeError(
				`The 'configType' option value must be 'flat'. The value '${configType}' is not supported.`,
			);
		}

		flags.forEach(flag => {
			if (inactiveFlags.has(flag)) {
				const inactiveFlagData = inactiveFlags.get(flag);
				const inactivityReason =
					getInactivityReasonMessage(inactiveFlagData);
				const message = `The flag '${flag}' is inactive: ${inactivityReason}`;

				if (typeof inactiveFlagData.replacedBy === "undefined") {
					throw new Error(message);
				}

				// if there's a replacement, enable it instead of original
				if (typeof inactiveFlagData.replacedBy === "string") {
					processedFlags.push(inactiveFlagData.replacedBy);
				}

				warningService.emitInactiveFlagWarning(flag, message);

				return;
			}

			if (!activeFlags.has(flag)) {
				throw new Error(`Unknown flag '${flag}'.`);
			}

			processedFlags.push(flag);
		});

		internalSlotsMap.set(this, {
			cwd: normalizeCwd(cwd),
			flags: processedFlags,
			lastConfigArray: null,
			lastSourceCode: null,
			lastSuppressedMessages: [],
			warningService,
		});

		this.version = pkg.version;
	}

	/**
	 * Getter for package version.
	 * @static
	 * @returns {string} The version from package.json.
	 */
	static get version() {
		return pkg.version;
	}

	/**
	 * Indicates if the given feature flag is enabled for this instance.
	 * @param {string} flag The feature flag to check.
	 * @returns {boolean} `true` if the feature flag is enabled, `false` if not.
	 */
	hasFlag(flag) {
		return internalSlotsMap.get(this).flags.includes(flag);
	}

	/**
	 * Verifies the text against the rules specified by the second argument.
	 * @param {string|SourceCode} textOrSourceCode The text to parse or a SourceCode object.
	 * @param {ConfigObject|ConfigObject[]} config The ESLint config object or array to use.
	 * @param {(string|(VerifyOptions&ProcessorOptions))} [filenameOrOptions] The optional filename of the file being checked.
	 *      If this is not set, the filename will default to '<input>' in the rule context. If
	 *      an object, then it has "filename", "allowInlineConfig", and some properties.
	 * @returns {LintMessage[]} The results as an array of messages or an empty array if no messages.
	 */
	verify(textOrSourceCode, config, filenameOrOptions) {
		debug("Verify");

		const { cwd } = internalSlotsMap.get(this);

		const options =
			typeof filenameOrOptions === "string"
				? { filename: filenameOrOptions }
				: filenameOrOptions || {};

		const configToUse = config ?? {};

		/*
		 * Because of how Webpack packages up the files, we can't
		 * compare directly to `FlatConfigArray` using `instanceof`
		 * because it's not the same `FlatConfigArray` as in the tests.
		 * So, we work around it by assuming an array is, in fact, a
		 * `FlatConfigArray` if it has a `getConfig()` method.
		 */
		let configArray = configToUse;

		if (
			!Array.isArray(configToUse) ||
			typeof configToUse.getConfig !== "function"
		) {
			configArray = new FlatConfigArray(configToUse, {
				basePath: cwd,
			});
			configArray.normalizeSync();
		}

		return this._distinguishSuppressedMessages(
			this._verifyWithFlatConfigArray(
				textOrSourceCode,
				configArray,
				options,
				true,
			),
		);
	}

	/**
	 * Verify with a processor.
	 * @param {string|SourceCode} textOrSourceCode The source code.
	 * @param {Config} config The config array.
	 * @param {VerifyOptions&ProcessorOptions} options The options.
	 * @param {FlatConfigArray} [configForRecursive] The `ConfigArray` object to apply multiple processors recursively.
	 * @returns {(LintMessage|SuppressedLintMessage)[]} The found problems.
	 */
	_verifyWithFlatConfigArrayAndProcessor(
		textOrSourceCode,
		config,
		options,
		configForRecursive,
	) {
		const slots = internalSlotsMap.get(this);
		const filename = options.filename || "<input>";
		const filenameToExpose = normalizeFilename(filename);
		const physicalFilename = options.physicalFilename || filenameToExpose;
		const text = ensureText(textOrSourceCode);
		const file = new VFile(filenameToExpose, text, {
			physicalPath: physicalFilename,
		});

		const preprocess = options.preprocess || (rawText => [rawText]);
		const postprocess =
			options.postprocess || (messagesList => messagesList.flat());

		const processorService = new ProcessorService();
		const preprocessResult = processorService.preprocessSync(file, {
			processor: {
				preprocess,
				postprocess,
			},
		});

		if (!preprocessResult.ok) {
			return preprocessResult.errors;
		}

		const filterCodeBlock =
			options.filterCodeBlock ||
			(blockFilename => blockFilename.endsWith(".js"));
		const originalExtname = path.extname(filename);
		const { files } = preprocessResult;

		const messageLists = files.map(block => {
			debug("A code block was found: %o", block.path || "(unnamed)");

			// Keep the legacy behavior.
			if (typeof block === "string") {
				return this._verifyWithFlatConfigArrayAndWithoutProcessors(
					block,
					config,
					options,
				);
			}

			// Skip this block if filtered.
			if (!filterCodeBlock(block.path, block.body)) {
				debug("This code block was skipped.");
				return [];
			}

			// Resolve configuration again if the file content or extension was changed.
			if (
				configForRecursive &&
				(text !== block.rawBody ||
					path.extname(block.path) !== originalExtname)
			) {
				debug(
					"Resolving configuration again because the file content or extension was changed.",
				);
				return this._verifyWithFlatConfigArray(
					block.rawBody,
					configForRecursive,
					{
						...options,
						filename: block.path,
						physicalFilename: block.physicalPath,
					},
				);
			}

			slots.lastSourceCode = null;

			// Does lint.
			return this.#flatVerifyWithoutProcessors(block, config, {
				...options,
				filename: block.path,
				physicalFilename: block.physicalPath,
			});
		});

		return processorService.postprocessSync(file, messageLists, {
			processor: {
				preprocess,
				postprocess,
			},
		});
	}

	/**
	 * Verify using flat config and without any processors.
	 * @param {VFile} file The file to lint.
	 * @param {Config} providedConfig An ESLintConfig instance to configure everything.
	 * @param {VerifyOptions} [providedOptions] The optional filename of the file being checked.
	 * @throws {Error} If during rule execution.
	 * @returns {(LintMessage|SuppressedLintMessage)[]} The results as an array of messages or an empty array if no messages.
	 */
	#flatVerifyWithoutProcessors(file, providedConfig, providedOptions) {
		const slots = internalSlotsMap.get(this);
		const config = providedConfig || {};
		const { settings = {}, languageOptions } = config;
		const options = normalizeVerifyOptions(providedOptions, config);

		if (!slots.lastSourceCode) {
			let t;

			if (options.stats) {
				t = startTime();
			}

			const parserService = new ParserService();
			const parseResult = parserService.parseSync(file, config);

			if (options.stats) {
				const time = endTime(t);

				storeTime(time, { type: "parse" }, slots);
			}

			if (!parseResult.ok) {
				return parseResult.errors;
			}

			slots.lastSourceCode = parseResult.sourceCode;
		} else {
			/*
			 * If the given source code object as the first argument does not have scopeManager, analyze the scope.
			 * This is for backward compatibility (SourceCode is frozen so it cannot rebind).
			 *
			 * We check explicitly for `null` to ensure that this is a JS-flavored language.
			 * For non-JS languages we don't want to do this.
			 *
			 * TODO: Remove this check when we stop exporting the `SourceCode` object.
			 */
			if (slots.lastSourceCode.scopeManager === null) {
				slots.lastSourceCode = new SourceCode({
					text: slots.lastSourceCode.text,
					ast: slots.lastSourceCode.ast,
					hasBOM: slots.lastSourceCode.hasBOM,
					parserServices: slots.lastSourceCode.parserServices,
					visitorKeys: slots.lastSourceCode.visitorKeys,
					scopeManager: analyzeScope(
						slots.lastSourceCode.ast,
						languageOptions,
					),
				});
			}
		}

		const sourceCode = slots.lastSourceCode;
		const report = new FileReport({
			ruleMapper: ruleId => config.getRuleDefinition(ruleId),
			language: config.language,
			sourceCode,
			disableFixes: options.disableFixes,
		});

		/*
		 * Make adjustments based on the language options. For JavaScript,
		 * this is primarily about adding variables into the global scope
		 * to account for ecmaVersion and configured globals.
		 */
		sourceCode.applyLanguageOptions?.(languageOptions);

		const mergedInlineConfig = {
			rules: {},
		};

		/*
		 * Inline config can be either enabled or disabled. If disabled, it's possible
		 * to detect the inline config and emit a warning (though this is not required).
		 * So we first check to see if inline config is allowed at all, and if so, we
		 * need to check if it's a warning or not.
		 */
		if (options.allowInlineConfig) {
			// if inline config should warn then add the warnings
			if (options.warnInlineConfig) {
				if (sourceCode.getInlineConfigNodes) {
					sourceCode.getInlineConfigNodes().forEach(node => {
						const loc = sourceCode.getLoc(node);
						const range = sourceCode.getRange(node);

						report.addWarning({
							message: `'${sourceCode.text.slice(range[0], range[1])}' has no effect because you have 'noInlineConfig' setting in ${options.warnInlineConfig}.`,
							loc,
						});
					});
				}
			} else {
				const inlineConfigResult = sourceCode.applyInlineConfig?.();

				if (inlineConfigResult) {
					inlineConfigResult.problems.forEach(problem => {
						report.addFatal(problem);
					});

					for (const {
						config: inlineConfig,
						loc,
					} of inlineConfigResult.configs) {
						Object.keys(inlineConfig.rules).forEach(ruleId => {
							const rule = config.getRuleDefinition(ruleId);
							const ruleValue = inlineConfig.rules[ruleId];

							if (!rule) {
								report.addError({
									ruleId,
									loc,
								});
								return;
							}

							if (
								Object.hasOwn(mergedInlineConfig.rules, ruleId)
							) {
								report.addError({
									message: `Rule "${ruleId}" is already configured by another configuration comment in the preceding code. This configuration is ignored.`,
									loc,
								});
								return;
							}

							try {
								const ruleOptionsInline = asArray(ruleValue);
								let ruleOptions = ruleOptionsInline;

								assertIsRuleSeverity(ruleId, ruleOptions[0]);

								/*
								 * If the rule was already configured, inline rule configuration that
								 * only has severity should retain options from the config and just override the severity.
								 *
								 * Example:
								 *
								 *   {
								 *       rules: {
								 *           curly: ["error", "multi"]
								 *       }
								 *   }
								 *
								 *   /* eslint curly: ["warn"] * /
								 *
								 *   Results in:
								 *
								 *   curly: ["warn", "multi"]
								 */

								let shouldValidateOptions = true;

								if (
									/*
									 * If inline config for the rule has only severity
									 */
									ruleOptions.length === 1 &&
									/*
									 * And the rule was already configured
									 */
									config.rules &&
									Object.hasOwn(config.rules, ruleId)
								) {
									/*
									 * Then use severity from the inline config and options from the provided config
									 */
									ruleOptions = [
										ruleOptions[0], // severity from the inline config
										...config.rules[ruleId].slice(1), // options from the provided config
									];

									// if the rule was enabled, the options have already been validated
									if (config.rules[ruleId][0] > 0) {
										shouldValidateOptions = false;
									}
								} else {
									/**
									 * Since we know the user provided options, apply defaults on top of them
									 */
									const slicedOptions = ruleOptions.slice(1);
									const mergedOptions = deepMergeArrays(
										rule.meta?.defaultOptions,
										slicedOptions,
									);

									if (mergedOptions.length) {
										ruleOptions = [
											ruleOptions[0],
											...mergedOptions,
										];
									}
								}

								if (
									options.reportUnusedInlineConfigs !== "off"
								) {
									addProblemIfSameSeverityAndOptions(
										config,
										loc,
										report,
										ruleId,
										ruleOptions,
										ruleOptionsInline,
										options.reportUnusedInlineConfigs,
									);
								}

								if (shouldValidateOptions) {
									config.validateRulesConfig({
										[ruleId]: ruleOptions,
									});
								}

								mergedInlineConfig.rules[ruleId] = ruleOptions;
							} catch (err) {
								/*
								 * If the rule has invalid `meta.schema`, throw the error because
								 * this is not an invalid inline configuration but an invalid rule.
								 */
								if (
									err.code ===
									"ESLINT_INVALID_RULE_OPTIONS_SCHEMA"
								) {
									throw err;
								}

								/*
								 * If the rule does not support the current language, report a
								 * specific, actionable error message.
								 */
								if (
									err.messageTemplate ===
									"rule-unsupported-language"
								) {
									report.addError({
										ruleId,
										message: `Inline configuration for rule "${ruleId}" is invalid:\n\tRule does not support the language "${err.messageData.language}". Use a config block with "files" to apply the rule only to supported files, or disable it.\n`,
										loc,
									});
									return;
								}

								let baseMessage = err.message
									.slice(
										err.message.startsWith('Key "rules":')
											? err.message.indexOf(":", 12) + 1
											: err.message.indexOf(":") + 1,
									)
									.trim();

								if (err.messageTemplate) {
									baseMessage += ` You passed "${ruleValue}".`;
								}

								report.addError({
									ruleId,
									message: `Inline configuration for rule "${ruleId}" is invalid:\n\t${baseMessage}\n`,
									loc,
								});
							}
						});
					}
				}
			}
		}

		const commentDirectives =
			options.allowInlineConfig && !options.warnInlineConfig
				? getDirectiveCommentsForFlatConfig(
						sourceCode,
						ruleId => config.getRuleDefinition(ruleId),
						config.language,
						report,
					)
				: [];

		const configuredRules = Object.assign(
			{},
			config.rules,
			mergedInlineConfig.rules,
		);

		sourceCode.finalize?.();

		try {
			runRules(
				sourceCode,
				configuredRules,
				ruleId => config.getRuleDefinition(ruleId),
				config.language,
				languageOptions,
				settings,
				options.filename,
				false,
				slots.cwd,
				providedOptions.physicalFilename,
				options.ruleFilter,
				options.stats,
				slots,
				report,
			);
		} catch (err) {
			err.message += `\nOccurred while linting ${options.filename}`;
			debug("An error occurred while traversing");
			debug("Filename:", options.filename);
			if (err.currentNode) {
				const { line } = sourceCode.getLoc(err.currentNode).start;

				debug("Line:", line);
				err.message += `:${line}`;
			}
			debug("Parser Options:", languageOptions.parserOptions);
			debug("Settings:", settings);

			if (err.ruleId) {
				err.message += `\nRule: "${err.ruleId}"`;
			}

			throw err;
		}

		return applyDisableDirectives({
			language: config.language,
			sourceCode,
			directives: commentDirectives,
			disableFixes: options.disableFixes,
			problems: report.messages.sort(
				(problemA, problemB) =>
					problemA.line - problemB.line ||
					problemA.column - problemB.column,
			),
			reportUnusedDisableDirectives:
				options.reportUnusedDisableDirectives,
			ruleFilter: options.ruleFilter,
			configuredRules,
		});
	}

	/**
	 * Same as linter.verify, except without support for processors.
	 * @param {string|SourceCode} textOrSourceCode The text to parse or a SourceCode object.
	 * @param {Config} providedConfig An ESLintConfig instance to configure everything.
	 * @param {VerifyOptions} [providedOptions] The optional filename of the file being checked.
	 * @throws {Error} If during rule execution.
	 * @returns {(LintMessage|SuppressedLintMessage)[]} The results as an array of messages or an empty array if no messages.
	 */
	_verifyWithFlatConfigArrayAndWithoutProcessors(
		textOrSourceCode,
		providedConfig,
		providedOptions,
	) {
		const slots = internalSlotsMap.get(this);
		const filename = normalizeFilename(
			providedOptions.filename || "<input>",
		);
		let text;

		// evaluate arguments
		if (typeof textOrSourceCode === "string") {
			slots.lastSourceCode = null;
			text = textOrSourceCode;
		} else {
			slots.lastSourceCode = textOrSourceCode;
			text = textOrSourceCode.text;
		}

		const file = new VFile(filename, text, {
			physicalPath: providedOptions.physicalFilename,
		});

		return this.#flatVerifyWithoutProcessors(
			file,
			providedConfig,
			providedOptions,
		);
	}

	/**
	 * Verify a given code with a flat config.
	 * @param {string|SourceCode} textOrSourceCode The source code.
	 * @param {FlatConfigArray} configArray The config array.
	 * @param {VerifyOptions&ProcessorOptions} options The options.
	 * @param {boolean} firstCall Indicates if this is the first call in `verify()`
	 *   to determine processor behavior.
	 * @returns {(LintMessage|SuppressedLintMessage)[]} The found problems.
	 */
	_verifyWithFlatConfigArray(
		textOrSourceCode,
		configArray,
		options,
		firstCall = false,
	) {
		debug("With flat config: %s", options.filename);

		// we need a filename to match configs against
		const filename = options.filename || "__placeholder__.js";

		// Store the config array in order to get plugin envs and rules later.
		internalSlotsMap.get(this).lastConfigArray = configArray;
		const config = configArray.getConfig(filename);

		if (!config) {
			return [
				{
					ruleId: null,
					severity: 1,
					message: `No matching configuration found for ${filename}.`,
					line: 0,
					column: 0,
				},
			];
		}

		// Verify.
		if (config.processor) {
			debug("Apply the processor: %o", config.processor);
			const { preprocess, postprocess, supportsAutofix } =
				config.processor;
			const disableFixes = options.disableFixes || !supportsAutofix;

			return this._verifyWithFlatConfigArrayAndProcessor(
				textOrSourceCode,
				config,
				{ ...options, filename, disableFixes, postprocess, preprocess },
				configArray,
			);
		}

		// check for options-based processing
		if (firstCall && (options.preprocess || options.postprocess)) {
			return this._verifyWithFlatConfigArrayAndProcessor(
				textOrSourceCode,
				config,
				options,
			);
		}

		return this._verifyWithFlatConfigArrayAndWithoutProcessors(
			textOrSourceCode,
			config,
			options,
		);
	}

	/**
	 * Given a list of reported problems, distinguish problems between normal messages and suppressed messages.
	 * The normal messages will be returned and the suppressed messages will be stored as lastSuppressedMessages.
	 * @param {Array<LintMessage|SuppressedLintMessage>} problems A list of reported problems.
	 * @returns {LintMessage[]} A list of LintMessage.
	 */
	_distinguishSuppressedMessages(problems) {
		const messages = [];
		const suppressedMessages = [];
		const slots = internalSlotsMap.get(this);

		for (const problem of problems) {
			if (problem.suppressions) {
				suppressedMessages.push(problem);
			} else {
				messages.push(problem);
			}
		}

		slots.lastSuppressedMessages = suppressedMessages;

		return messages;
	}

	/**
	 * Gets the SourceCode object representing the parsed source.
	 * @returns {SourceCode} The SourceCode object.
	 */
	getSourceCode() {
		return internalSlotsMap.get(this).lastSourceCode;
	}

	/**
	 * Gets the times spent on (parsing, fixing, linting) a file.
	 * @returns {{ passes: TimePass[]; }} The times.
	 */
	getTimes() {
		return internalSlotsMap.get(this).times ?? { passes: [] };
	}

	/**
	 * Gets the number of autofix passes that were made in the last run.
	 * @returns {number} The number of autofix passes.
	 */
	getFixPassCount() {
		return internalSlotsMap.get(this).fixPasses ?? 0;
	}

	/**
	 * Gets the list of SuppressedLintMessage produced in the last running.
	 * @returns {SuppressedLintMessage[]} The list of SuppressedLintMessage
	 */
	getSuppressedMessages() {
		return internalSlotsMap.get(this).lastSuppressedMessages;
	}

	/**
	 * Performs multiple autofix passes over the text until as many fixes as possible
	 * have been applied.
	 * @param {string} text The source text to apply fixes to.
	 * @param {ConfigObject|ConfigObject[]} config The ESLint config object or array to use.
	 * @param {string|(VerifyOptions&ProcessorOptions&FixOptions)} [filenameOrOptions] The filename or ESLint options object to use.
	 * @returns {{fixed:boolean,messages:LintMessage[],output:string}} The result of the fix operation as returned from the
	 *      SourceCodeFixer.
	 */
	verifyAndFix(text, config, filenameOrOptions) {
		let messages,
			fixedResult,
			fixed = false,
			passNumber = 0,
			currentText = text,
			secondPreviousText,
			previousText;
		const options =
			typeof filenameOrOptions === "string"
				? { filename: filenameOrOptions }
				: filenameOrOptions || {};
		const debugTextDescription =
			options.filename || `${text.slice(0, 10)}...`;
		const shouldFix =
			typeof options.fix !== "undefined" ? options.fix : true;
		const stats = options?.stats;

		const slots = internalSlotsMap.get(this);

		// Remove lint times from the last run.
		if (stats) {
			delete slots.times;
			slots.fixPasses = 0;
		}

		/**
		 * This loop continues until one of the following is true:
		 *
		 * 1. No more fixes have been applied.
		 * 2. Ten passes have been made.
		 *
		 * That means anytime a fix is successfully applied, there will be another pass.
		 * Essentially, guaranteeing a minimum of two passes.
		 */
		do {
			passNumber++;
			let tTotal;

			if (stats) {
				tTotal = startTime();
			}

			debug(
				`Linting code for ${debugTextDescription} (pass ${passNumber})`,
			);
			messages = this.verify(currentText, config, options);

			debug(
				`Generating fixed text for ${debugTextDescription} (pass ${passNumber})`,
			);
			let t;

			if (stats) {
				t = startTime();
			}

			fixedResult = SourceCodeFixer.applyFixes(
				currentText,
				messages,
				shouldFix,
			);

			if (stats) {
				if (fixedResult.fixed) {
					const time = endTime(t);

					storeTime(time, { type: "fix" }, slots);
					slots.fixPasses++;
				} else {
					storeTime(0, { type: "fix" }, slots);
				}
			}

			/*
			 * stop if there are any syntax errors.
			 * 'fixedResult.output' is a empty string.
			 */
			if (messages.length === 1 && messages[0].fatal) {
				break;
			}

			// keep track if any fixes were ever applied - important for return value
			fixed = fixed || fixedResult.fixed;

			// update to use the fixed output instead of the original text
			secondPreviousText = previousText;
			previousText = currentText;
			currentText = fixedResult.output;

			if (stats) {
				tTotal = endTime(tTotal);
				const passIndex = slots.times.passes.length - 1;

				slots.times.passes[passIndex].total = tTotal;
			}

			// Stop if we've made a circular fix
			if (
				passNumber > 1 &&
				currentText.length === secondPreviousText.length &&
				currentText === secondPreviousText
			) {
				debug(
					`Circular fixes detected after pass ${passNumber}. Exiting fix loop.`,
				);
				slots.warningService.emitCircularFixesWarning(
					options.filename ?? "text",
				);
				break;
			}
		} while (fixedResult.fixed && passNumber < MAX_AUTOFIX_PASSES);

		/*
		 * If the last result had fixes, we need to lint again to be sure we have
		 * the most up-to-date information.
		 */
		if (fixedResult.fixed) {
			let tTotal;

			if (stats) {
				tTotal = startTime();
			}

			fixedResult.messages = this.verify(currentText, config, options);

			if (stats) {
				storeTime(0, { type: "fix" }, slots);
				slots.times.passes.at(-1).total = endTime(tTotal);
			}
		}

		// ensure the last result properly reflects if fixes were done
		fixedResult.fixed = fixed;
		fixedResult.output = currentText;

		return fixedResult;
	}
}

module.exports = {
	Linter,
};
x/**
 * @fileoverview An object that creates fix commands for rules.
 * @author Nicholas C. Zakas
 */
"use strict";

//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------

/**
 * @import { SourceRange } from "@eslint/core";
 */

/* eslint class-methods-use-this: off -- Methods desired on instance */

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

// none!

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Creates a fix command that inserts text at the specified index in the source text.
 * @param {number} index The 0-based index at which to insert the new text.
 * @param {string} text The text to insert.
 * @returns {Object} The fix command.
 * @private
 */
function insertTextAt(index, text) {
	return {
		range: [index, index],
		text,
	};
}

/**
 * Asserts that the provided text is a string.
 * @param {unknown} text The text to validate.
 * @returns {void}
 * @throws {TypeError} If `text` is not a string.
 */
function assertIsString(text) {
	if (typeof text !== "string") {
		throw new TypeError("'text' must be a string");
	}
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

/**
 * Creates code fixing commands for rules.
 */
class RuleFixer {
	/**
	 * The source code object representing the text to be fixed.
	 * @type {SourceCode}
	 */
	#sourceCode;

	/**
	 * Creates a new instance.
	 * @param {Object} options The options for the fixer.
	 * @param {SourceCode} options.sourceCode The source code object representing the text to be fixed.
	 */
	constructor({ sourceCode }) {
		this.#sourceCode = sourceCode;
	}

	/**
	 * Creates a fix command that inserts text after the given node or token.
	 * The fix is not applied until applyFixes() is called.
	 * @param {ASTNode|Token} nodeOrToken The node or token to insert after.
	 * @param {string} text The text to insert.
	 * @returns {Object} The fix command.
	 * @throws {TypeError} If `text` is not a string.
	 */
	insertTextAfter(nodeOrToken, text) {
		assertIsString(text);

		const range = this.#sourceCode.getRange(nodeOrToken);

		return this.insertTextAfterRange(range, text);
	}

	/**
	 * Creates a fix command that inserts text after the specified range in the source text.
	 * The fix is not applied until applyFixes() is called.
	 * @param {SourceRange} range The range to replace, first item is start of range, second
	 *      is end of range.
	 * @param {string} text The text to insert.
	 * @returns {Object} The fix command.
	 * @throws {TypeError} If `text` is not a string.
	 */
	insertTextAfterRange(range, text) {
		assertIsString(text);

		return insertTextAt(range[1], text);
	}

	/**
	 * Creates a fix command that inserts text before the given node or token.
	 * The fix is not applied until applyFixes() is called.
	 * @param {ASTNode|Token} nodeOrToken The node or token to insert before.
	 * @param {string} text The text to insert.
	 * @returns {Object} The fix command.
	 * @throws {TypeError} If `text` is not a string.
	 */
	insertTextBefore(nodeOrToken, text) {
		assertIsString(text);

		const range = this.#sourceCode.getRange(nodeOrToken);

		return this.insertTextBeforeRange(range, text);
	}

	/**
	 * Creates a fix command that inserts text before the specified range in the source text.
	 * The fix is not applied until applyFixes() is called.
	 * @param {SourceRange} range The range to replace, first item is start of range, second
	 *      is end of range.
	 * @param {string} text The text to insert.
	 * @returns {Object} The fix command.
	 * @throws {TypeError} If `text` is not a string.
	 */
	insertTextBeforeRange(range, text) {
		assertIsString(text);

		return insertTextAt(range[0], text);
	}

	/**
	 * Creates a fix command that replaces text at the node or token.
	 * The fix is not applied until applyFixes() is called.
	 * @param {ASTNode|Token} nodeOrToken The node or token to remove.
	 * @param {string} text The text to insert.
	 * @returns {Object} The fix command.
	 * @throws {TypeError} If `text` is not a string.
	 */
	replaceText(nodeOrToken, text) {
		assertIsString(text);

		const range = this.#sourceCode.getRange(nodeOrToken);

		return this.replaceTextRange(range, text);
	}

	/**
	 * Creates a fix command that replaces text at the specified range in the source text.
	 * The fix is not applied until applyFixes() is called.
	 * @param {SourceRange} range The range to replace, first item is start of range, second
	 *      is end of range.
	 * @param {string} text The text to insert.
	 * @returns {Object} The fix command.
	 * @throws {TypeError} If `text` is not a string.
	 */
	replaceTextRange(range, text) {
		assertIsString(text);

		return {
			range,
			text,
		};
	}

	/**
	 * Creates a fix command that removes the node or token from the source.
	 * The fix is not applied until applyFixes() is called.
	 * @param {ASTNode|Token} nodeOrToken The node or token to remove.
	 * @returns {Object} The fix command.
	 */
	remove(nodeOrToken) {
		const range = this.#sourceCode.getRange(nodeOrToken);

		return this.removeRange(range);
	}

	/**
	 * Creates a fix command that removes the specified range of text from the source.
	 * The fix is not applied until applyFixes() is called.
	 * @param {SourceRange} range The range to remove, first item is start of range, second
	 *      is end of range.
	 * @returns {Object} The fix command.
	 */
	removeRange(range) {
		return {
			range,
			text: "",
		};
	}
}

module.exports = { RuleFixer };
>B8xq/**
 * @fileoverview An object that caches and applies source code fixes.
 * @author Nicholas C. Zakas
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const debug = require("debug")("eslint:source-code-fixer");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const BOM = "\uFEFF";

/**
 * Compares items in a messages array by range.
 * @param {Message} a The first message.
 * @param {Message} b The second message.
 * @returns {number} -1 if a comes before b, 1 if a comes after b, 0 if equal.
 * @private
 */
function compareMessagesByFixRange(a, b) {
	return a.fix.range[0] - b.fix.range[0] || a.fix.range[1] - b.fix.range[1];
}

/**
 * Compares items in a messages array by line and column.
 * @param {Message} a The first message.
 * @param {Message} b The second message.
 * @returns {number} -1 if a comes before b, 1 if a comes after b, 0 if equal.
 * @private
 */
function compareMessagesByLocation(a, b) {
	return a.line - b.line || a.column - b.column;
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

/**
 * Utility for apply fixes to source code.
 * @constructor
 */
function SourceCodeFixer() {
	Object.freeze(this);
}

/**
 * Applies the fixes specified by the messages to the given text. Tries to be
 * smart about the fixes and won't apply fixes over the same area in the text.
 * @param {string} sourceText The text to apply the changes to.
 * @param {Message[]} messages The array of messages reported by ESLint.
 * @param {boolean|Function} [shouldFix=true] Determines whether each message should be fixed
 * @returns {Object} An object containing the fixed text and any unfixed messages.
 */
SourceCodeFixer.applyFixes = function (sourceText, messages, shouldFix) {
	debug("Applying fixes");

	if (shouldFix === false) {
		debug("shouldFix parameter was false, not attempting fixes");
		return {
			fixed: false,
			messages,
			output: sourceText,
		};
	}

	// clone the array
	const remainingMessages = [],
		fixes = [],
		bom = sourceText.startsWith(BOM) ? BOM : "",
		text = bom ? sourceText.slice(1) : sourceText;
	let lastPos = Number.NEGATIVE_INFINITY,
		output = bom;

	/**
	 * Try to use the 'fix' from a problem.
	 * @param {Message} problem The message object to apply fixes from
	 * @returns {boolean} Whether fix was successfully applied
	 */
	function attemptFix(problem) {
		const fix = problem.fix;
		const start = fix.range[0];
		const end = fix.range[1];

		// Remain it as a problem if it's overlapped or it's a negative range
		if (lastPos >= start || start > end) {
			remainingMessages.push(problem);
			return false;
		}

		// Remove BOM.
		if (
			(start < 0 && end >= 0) ||
			(start === 0 && fix.text.startsWith(BOM))
		) {
			output = "";
		}

		// Make output to this fix.
		output += text.slice(Math.max(0, lastPos), Math.max(0, start));
		output += fix.text;
		lastPos = end;
		return true;
	}

	messages.forEach(problem => {
		if (Object.hasOwn(problem, "fix") && problem.fix) {
			fixes.push(problem);
		} else {
			remainingMessages.push(problem);
		}
	});

	if (fixes.length) {
		debug("Found fixes to apply");
		let fixesWereApplied = false;

		for (const problem of fixes.sort(compareMessagesByFixRange)) {
			if (typeof shouldFix !== "function" || shouldFix(problem)) {
				attemptFix(problem);

				/*
				 * The only time attemptFix will fail is if a previous fix was
				 * applied which conflicts with it.  So we can mark this as true.
				 */
				fixesWereApplied = true;
			} else {
				remainingMessages.push(problem);
			}
		}
		output += text.slice(Math.max(0, lastPos));

		return {
			fixed: fixesWereApplied,
			messages: remainingMessages.sort(compareMessagesByLocation),
			output,
		};
	}

	debug("No fixes to apply");
	return {
		fixed: false,
		messages,
		output: bom + text,
	};
};

module.exports = SourceCodeFixer;
u
,xK&/**
 * @fileoverview Traverser for SourceCode objects.
 * @author Nicholas C. Zakas
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const { parse, matches } = require("./esquery");
const vk = require("eslint-visitor-keys");

//-----------------------------------------------------------------------------
// Typedefs
//-----------------------------------------------------------------------------

/**
 * @import { Language, SourceCode } from "@eslint/core";
 * @import { ESQueryOptions } from "esquery";
 * @import { ESQueryParsedSelector } from "./esquery.js";
 * @import { SourceCodeVisitor } from "./source-code-visitor.js";
 */

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

const STEP_KIND_VISIT = 1;
const STEP_KIND_CALL = 2;

/**
 * Compares two ESQuery selectors by specificity.
 * @param {ESQueryParsedSelector} a The first selector to compare.
 * @param {ESQueryParsedSelector} b The second selector to compare.
 * @returns {number} A negative number if `a` is less specific than `b` or they are equally specific and `a` <= `b` alphabetically, a positive number if `a` is more specific than `b`.
 */
function compareSpecificity(a, b) {
	return a.compare(b);
}

/**
 * Helper to wrap ESQuery operations.
 */
class ESQueryHelper {
	/**
	 * Creates a new instance.
	 * @param {SourceCodeVisitor} visitor The visitor containing the functions to call.
	 * @param {ESQueryOptions} esqueryOptions `esquery` options for traversing custom nodes.
	 */
	constructor(visitor, esqueryOptions) {
		/**
		 * The visitor to use during traversal.
		 * @type {SourceCodeVisitor}
		 */
		this.visitor = visitor;

		/**
		 * The options for `esquery` to use during matching.
		 * @type {ESQueryOptions}
		 */
		this.esqueryOptions = esqueryOptions;

		/**
		 * A map of node type to selectors targeting that node type on the
		 * enter phase of traversal.
		 * @type {Map<string, ESQueryParsedSelector[]>}
		 */
		this.enterSelectorsByNodeType = new Map();

		/**
		 * A map of node type to selectors targeting that node type on the
		 * exit phase of traversal.
		 * @type {Map<string, ESQueryParsedSelector[]>}
		 */
		this.exitSelectorsByNodeType = new Map();

		/**
		 * An array of selectors that match any node type on the
		 * enter phase of traversal.
		 * @type {ESQueryParsedSelector[]}
		 */
		this.anyTypeEnterSelectors = [];

		/**
		 * An array of selectors that match any node type on the
		 * exit phase of traversal.
		 * @type {ESQueryParsedSelector[]}
		 */
		this.anyTypeExitSelectors = [];

		visitor.forEachName(rawSelector => {
			const selector = parse(rawSelector);

			/*
			 * If this selector has identified specific node types,
			 * add it to the map for these node types for faster lookup.
			 */
			if (selector.nodeTypes) {
				const typeMap = selector.isExit
					? this.exitSelectorsByNodeType
					: this.enterSelectorsByNodeType;

				selector.nodeTypes.forEach(nodeType => {
					if (!typeMap.has(nodeType)) {
						typeMap.set(nodeType, []);
					}
					typeMap.get(nodeType).push(selector);
				});
				return;
			}

			/*
			 * Remaining selectors are added to the "any type" selectors
			 * list for the appropriate phase of traversal. This ensures
			 * that all selectors will still be applied even if no
			 * specific node type is matched.
			 */
			const selectors = selector.isExit
				? this.anyTypeExitSelectors
				: this.anyTypeEnterSelectors;

			selectors.push(selector);
		});

		// sort all selectors by specificity for prioritizing call order
		this.anyTypeEnterSelectors.sort(compareSpecificity);
		this.anyTypeExitSelectors.sort(compareSpecificity);
		this.enterSelectorsByNodeType.forEach(selectorList =>
			selectorList.sort(compareSpecificity),
		);
		this.exitSelectorsByNodeType.forEach(selectorList =>
			selectorList.sort(compareSpecificity),
		);
	}

	/**
	 * Checks if a node matches a given selector.
	 * @param {ASTNode} node The node to check
	 * @param {ASTNode[]} ancestry The ancestry of the node being checked.
	 * @param {ESQueryParsedSelector} selector An AST selector descriptor
	 * @returns {boolean} `true` if the selector matches the node, `false` otherwise
	 */
	matches(node, ancestry, selector) {
		return matches(node, selector.root, ancestry, this.esqueryOptions);
	}

	/**
	 * Calculates all appropriate selectors to a node, in specificity order
	 * @param {ASTNode} node The node to check
	 * @param {ASTNode[]} ancestry The ancestry of the node being checked.
	 * @param {boolean} isExit `false` if the node is currently being entered, `true` if it's currently being exited
	 * @returns {string[]} An array of selectors that match the node.
	 */
	calculateSelectors(node, ancestry, isExit) {
		const nodeTypeKey = this.esqueryOptions?.nodeTypeKey || "type";
		const selectors = [];

		/*
		 * Get the selectors that may match this node. First, check
		 * to see if the node type has specific selectors,
		 * then gather the "any type" selectors.
		 */
		const selectorsByNodeType =
			(isExit
				? this.exitSelectorsByNodeType
				: this.enterSelectorsByNodeType
			).get(node[nodeTypeKey]) || [];
		const anyTypeSelectors = isExit
			? this.anyTypeExitSelectors
			: this.anyTypeEnterSelectors;

		/*
		 * selectorsByNodeType and anyTypeSelectors were already sorted by specificity in the constructor.
		 * Iterate through each of them, applying selectors in the right order.
		 */
		let selectorsByNodeTypeIndex = 0;
		let anyTypeSelectorsIndex = 0;

		while (
			selectorsByNodeTypeIndex < selectorsByNodeType.length ||
			anyTypeSelectorsIndex < anyTypeSelectors.length
		) {
			/*
			 * If we've already exhausted the selectors for this node type,
			 * or if the next any type selector is more specific than the
			 * next selector for this node type, apply the any type selector.
			 */
			const hasMoreNodeTypeSelectors =
				selectorsByNodeTypeIndex < selectorsByNodeType.length;
			const hasMoreAnyTypeSelectors =
				anyTypeSelectorsIndex < anyTypeSelectors.length;
			const anyTypeSelector = anyTypeSelectors[anyTypeSelectorsIndex];
			const nodeTypeSelector =
				selectorsByNodeType[selectorsByNodeTypeIndex];

			// Only compare specificity if both selectors exist
			const isAnyTypeSelectorLessSpecific =
				hasMoreAnyTypeSelectors &&
				hasMoreNodeTypeSelectors &&
				anyTypeSelector.compare(nodeTypeSelector) < 0;

			if (!hasMoreNodeTypeSelectors || isAnyTypeSelectorLessSpecific) {
				anyTypeSelectorsIndex++;

				if (this.matches(node, ancestry, anyTypeSelector)) {
					selectors.push(anyTypeSelector.source);
				}
			} else {
				selectorsByNodeTypeIndex++;

				if (this.matches(node, ancestry, nodeTypeSelector)) {
					selectors.push(nodeTypeSelector.source);
				}
			}
		}

		return selectors;
	}
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

/**
 * Traverses source code and ensures that visitor methods are called when
 * entering and leaving each node.
 */
class SourceCodeTraverser {
	/**
	 * The language of the source code being traversed.
	 * @type {Language}
	 */
	#language;

	/**
	 * Map of languages to instances of this class.
	 * @type {WeakMap<Language, SourceCodeTraverser>}
	 */
	static instances = new WeakMap();

	/**
	 * Creates a new instance.
	 * @param {Language} language The language of the source code being traversed.
	 */
	constructor(language) {
		this.#language = language;
	}

	static getInstance(language) {
		if (!this.instances.has(language)) {
			this.instances.set(language, new this(language));
		}

		return this.instances.get(language);
	}

	/**
	 * Traverses the given source code synchronously.
	 * @param {SourceCode} sourceCode The source code to traverse.
	 * @param {SourceCodeVisitor} visitor The emitter to use for events.
	 * @param {Object} options Options for traversal.
	 * @param {ReturnType<SourceCode["traverse"]>} options.steps The steps to take during traversal.
	 * @returns {void}
	 * @throws {Error} If an error occurs during traversal.
	 */
	traverseSync(sourceCode, visitor, { steps } = {}) {
		const esquery = new ESQueryHelper(visitor, {
			visitorKeys: sourceCode.visitorKeys ?? this.#language.visitorKeys,
			fallback: vk.getKeys,
			matchClass: this.#language.matchesSelectorClass ?? (() => false),
			nodeTypeKey: this.#language.nodeTypeKey,
		});

		const currentAncestry = [];

		for (const step of steps ?? sourceCode.traverse()) {
			switch (step.kind) {
				case STEP_KIND_VISIT: {
					try {
						if (step.phase === 1) {
							esquery
								.calculateSelectors(
									step.target,
									currentAncestry,
									false,
								)
								.forEach(selector => {
									visitor.callSync(
										selector,
										...(step.args ?? [step.target]),
									);
								});
							currentAncestry.unshift(step.target);
						} else {
							currentAncestry.shift();
							esquery
								.calculateSelectors(
									step.target,
									currentAncestry,
									true,
								)
								.forEach(selector => {
									visitor.callSync(
										selector,
										...(step.args ?? [step.target]),
									);
								});
						}
					} catch (err) {
						err.currentNode = step.target;
						throw err;
					}
					break;
				}

				case STEP_KIND_CALL: {
					visitor.callSync(step.target, ...step.args);
					break;
				}

				default:
					throw new Error(
						`Invalid traversal step found: "${step.kind}".`,
					);
			}
		}
	}
}

module.exports = { SourceCodeTraverser };
3xc/**
 * @fileoverview SourceCodeVisitor class
 * @author Nicholas C. Zakas
 */

"use strict";

//-----------------------------------------------------------------------------
// Helpers
//-----------------------------------------------------------------------------

const emptyArray = Object.freeze([]);

//------------------------------------------------------------------------------
// Exports
//------------------------------------------------------------------------------

/**
 * A structure to hold a list of functions to call for a given name.
 * This is used to allow multiple rules to register functions for a given name
 * without having to know about each other.
 */
class SourceCodeVisitor {
	/**
	 * The functions to call for a given name.
	 * @type {Map<string, Function[]>}
	 */
	#functions = new Map();

	/**
	 * Adds a function to the list of functions to call for a given name.
	 * @param {string} name The name of the function to call.
	 * @param {Function} func The function to call.
	 * @returns {void}
	 */
	add(name, func) {
		if (this.#functions.has(name)) {
			this.#functions.get(name).push(func);
		} else {
			this.#functions.set(name, [func]);
		}
	}

	/**
	 * Gets the list of functions to call for a given name.
	 * @param {string} name The name of the function to call.
	 * @returns {Function[]} The list of functions to call.
	 */
	get(name) {
		if (this.#functions.has(name)) {
			return this.#functions.get(name);
		}

		return emptyArray;
	}

	/**
	 * Iterates over all names and calls the callback with the name.
	 * @param {(name:string) => void} callback The callback to call for each name.
	 * @returns {void}
	 */
	forEachName(callback) {
		this.#functions.forEach((funcs, name) => {
			callback(name);
		});
	}

	/**
	 * Calls the functions for a given name with the given arguments.
	 * @param {string} name The name of the function to call.
	 * @param {any[]} args The arguments to pass to the function.
	 * @returns {void}
	 */
	callSync(name, ...args) {
		if (this.#functions.has(name)) {
			this.#functions.get(name).forEach(func => func(...args));
		}
	}
}

module.exports = { SourceCodeVisitor };
[߆xs/**
 * @fileoverview Tracks performance of individual rules.
 * @author Brandon Mills
 */

"use strict";

const { startTime, endTime } = require("../shared/stats");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/* c8 ignore next */
/**
 * Align the string to left
 * @param {string} str string to evaluate
 * @param {number} len length of the string
 * @param {string} ch delimiter character
 * @returns {string} modified string
 * @private
 */
function alignLeft(str, len, ch) {
	return str + new Array(len - str.length + 1).join(ch || " ");
}

/* c8 ignore next */
/**
 * Align the string to right
 * @param {string} str string to evaluate
 * @param {number} len length of the string
 * @param {string} ch delimiter character
 * @returns {string} modified string
 * @private
 */
function alignRight(str, len, ch) {
	return new Array(len - str.length + 1).join(ch || " ") + str;
}

//------------------------------------------------------------------------------
// Module definition
//------------------------------------------------------------------------------

const enabled = !!process.env.TIMING;

const HEADERS = ["Rule", "Time (ms)", "Relative"];
const ALIGN = [alignLeft, alignRight, alignRight];

/**
 * Decide how many rules to show in the output list.
 * @returns {number} the number of rules to show
 */
function getListSize() {
	const MINIMUM_SIZE = 10;

	if (typeof process.env.TIMING !== "string") {
		return MINIMUM_SIZE;
	}

	if (process.env.TIMING.toLowerCase() === "all") {
		return Number.POSITIVE_INFINITY;
	}

	const TIMING_ENV_VAR_AS_INTEGER = Number.parseInt(process.env.TIMING, 10);

	return TIMING_ENV_VAR_AS_INTEGER > 10
		? TIMING_ENV_VAR_AS_INTEGER
		: MINIMUM_SIZE;
}

/* c8 ignore next */
/**
 * display the data
 * @param {Object} data Data object to be displayed
 * @returns {void} prints modified string with console.log
 * @private
 */
function display(data) {
	let total = 0;
	const rows = Object.keys(data)
		.map(key => {
			const time = data[key];

			total += time;
			return [key, time];
		})
		.sort((a, b) => b[1] - a[1])
		.slice(0, getListSize());

	rows.forEach(row => {
		row.push(`${((row[1] * 100) / total).toFixed(1)}%`);
		row[1] = row[1].toFixed(3);
	});

	rows.unshift(HEADERS);

	const widths = [];

	rows.forEach(row => {
		const len = row.length;

		for (let i = 0; i < len; i++) {
			const n = row[i].length;

			if (!widths[i] || n > widths[i]) {
				widths[i] = n;
			}
		}
	});

	const table = rows.map(row =>
		row.map((cell, index) => ALIGN[index](cell, widths[index])).join(" | "),
	);

	table.splice(
		1,
		0,
		widths
			.map((width, index) => {
				const extraAlignment =
					index !== 0 && index !== widths.length - 1 ? 2 : 1;

				return ALIGN[index](":", width + extraAlignment, "-");
			})
			.join("|"),
	);

	console.log(table.join("\n")); // eslint-disable-line no-console -- Debugging function
}

/* c8 ignore next */
module.exports = (function () {
	const data = Object.create(null);
	let displayEnabled = true;

	/**
	 * Time the run
	 * @param {any} key key from the data object
	 * @param {Function} fn function to be called
	 * @param {boolean} stats if 'stats' is true, return the result and the time difference
	 * @returns {Function} function to be executed
	 * @private
	 */
	function time(key, fn, stats) {
		return function (...args) {
			const t = startTime();
			const result = fn(...args);
			const tdiff = endTime(t);

			if (enabled) {
				if (typeof data[key] === "undefined") {
					data[key] = 0;
				}

				data[key] += tdiff;
			}

			return stats ? { result, tdiff } : result;
		};
	}

	/**
	 * Returns a shallow copy of the collected timings data.
	 * @returns {Record<string, number>} mapping of ruleId to total time in ms
	 */
	function getData() {
		return { ...data };
	}

	/**
	 * Merges rule timing totals collected elsewhere into this process' totals.
	 * @param {Record<string, number>} dataToMerge mapping of ruleId to total time in ms
	 * @returns {void}
	 */
	function mergeData(dataToMerge) {
		for (const [key, value] of Object.entries(dataToMerge)) {
			if (typeof data[key] === "undefined") {
				data[key] = 0;
			}
			data[key] += value;
		}
	}

	/**
	 * Disables printing of timing data on process exit.
	 * Intended for worker threads or non-main contexts.
	 * @returns {void}
	 */
	function disableDisplay() {
		displayEnabled = false;
	}

	if (enabled) {
		process.on("exit", () => {
			if (displayEnabled && Object.keys(data).length > 0) {
				display(data);
			}
		});
	}

	return {
		time,
		enabled,
		getListSize,
		getData,
		mergeData,
		disableDisplay,
	};
})();
jݸx
/**
 * @fileoverview Virtual file
 * @author Nicholas C. Zakas
 */

"use strict";

//-----------------------------------------------------------------------------
// Type Definitions
//-----------------------------------------------------------------------------

/** @typedef {import("@eslint/core").File} File */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Determines if a given value has a byte order mark (BOM).
 * @param {string|Uint8Array} value The value to check.
 * @returns {boolean} `true` if the value has a BOM, `false` otherwise.
 */
function hasUnicodeBOM(value) {
	return typeof value === "string"
		? value.charCodeAt(0) === 0xfeff
		: value[0] === 0xef && value[1] === 0xbb && value[2] === 0xbf;
}

/**
 * Strips Unicode BOM from the given value.
 * @param {string|Uint8Array} value The value to remove the BOM from.
 * @returns {string|Uint8Array} The stripped value.
 */
function stripUnicodeBOM(value) {
	if (!hasUnicodeBOM(value)) {
		return value;
	}

	if (typeof value === "string") {
		/*
		 * Check Unicode BOM.
		 * In JavaScript, string data is stored as UTF-16, so BOM is 0xFEFF.
		 * https://262.ecma-international.org/6.0/#sec-unicode-format-control-characters
		 */
		return value.slice(1);
	}

	/*
	 * In a Uint8Array, the BOM is represented by three bytes: 0xEF, 0xBB, and 0xBF,
	 * so we can just remove the first three bytes.
	 */
	return value.slice(3);
}

//------------------------------------------------------------------------------
// Exports
//------------------------------------------------------------------------------

/**
 * Represents a virtual file inside of ESLint.
 * @implements {File}
 */
class VFile {
	/**
	 * The file path including any processor-created virtual path.
	 * @type {string}
	 * @readonly
	 */
	path;

	/**
	 * The file path on disk.
	 * @type {string}
	 * @readonly
	 */
	physicalPath;

	/**
	 * The file contents.
	 * @type {string|Uint8Array}
	 * @readonly
	 */
	body;

	/**
	 * The raw body of the file, including a BOM if present.
	 * @type {string|Uint8Array}
	 * @readonly
	 */
	rawBody;

	/**
	 * Indicates whether the file has a byte order mark (BOM).
	 * @type {boolean}
	 * @readonly
	 */
	bom;

	/**
	 * Creates a new instance.
	 * @param {string} path The file path.
	 * @param {string|Uint8Array} body The file contents.
	 * @param {Object} [options] Additional options.
	 * @param {string} [options.physicalPath] The file path on disk.
	 */
	constructor(path, body, { physicalPath } = {}) {
		this.path = path;
		this.physicalPath = physicalPath ?? path;
		this.bom = hasUnicodeBOM(body);
		this.body = stripUnicodeBOM(body);
		this.rawBody = body;
	}
}

module.exports = { VFile };
4x.Y/**
 * @fileoverview Options configuration for optionator.
 * @author George Zahariev
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const optionator = require("optionator");

//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------

/**
 * The options object parsed by Optionator.
 * @typedef {Object} ParsedCLIOptions
 * @property {boolean} cache Only check changed files
 * @property {string} cacheFile Path to the cache file. Deprecated: use --cache-location
 * @property {string} [cacheLocation] Path to the cache file or directory
 * @property {"metadata" | "content"} cacheStrategy Strategy to use for detecting changed files in the cache
 * @property {boolean} [color] Force enabling/disabling of color
 * @property {number | "auto" | "off"} [concurrency] Number of linting threads, "auto" to choose automatically, "off" for no multithreading
 * @property {string} [config] Use this configuration, overriding eslint.config.* config options if present
 * @property {boolean} debug Output debugging information
 * @property {boolean} envInfo Output execution environment information
 * @property {boolean} errorOnUnmatchedPattern Prevent errors when pattern is unmatched
 * @property {string[]} [ext] Specify JavaScript file extensions
 * @property {string[]} [flag] Feature flags
 * @property {boolean} fix Automatically fix problems
 * @property {boolean} fixDryRun Automatically fix problems without saving the changes to the file system
 * @property {("directive" | "problem" | "suggestion" | "layout")[]} [fixType] Specify the types of fixes to apply (directive, problem, suggestion, layout)
 * @property {string} format Use a specific output format
 * @property {string[]} [global] Define global variables
 * @property {boolean} [help] Show help
 * @property {boolean} ignore Disable use of ignore files and patterns
 * @property {string[]} [ignorePattern] Patterns of files to ignore
 * @property {boolean} init Run config initialization wizard
 * @property {boolean} inlineConfig Prevent comments from changing config or rules
 * @property {number} maxWarnings Number of warnings to trigger nonzero exit code
 * @property {string} [outputFile] Specify file to write report to
 * @property {string} [parser] Specify the parser to be used
 * @property {Object} [parserOptions] Specify parser options
 * @property {boolean} [passOnNoPatterns=false] When set to true, missing patterns cause
 *      the linting operation to short circuit and not report any failures.
 * @property {boolean} [passOnUnprunedSuppressions] Ignore unused suppressions
 * @property {string[]} [plugin] Specify plugins
 * @property {string} [printConfig] Print the configuration for the given file
 * @property {boolean} [pruneSuppressions] Prune unused suppressions
 * @property {boolean} quiet Report errors only
 * @property {boolean | undefined} reportUnusedDisableDirectives Adds reported errors for unused eslint-disable and eslint-enable directives
 * @property {string | undefined} reportUnusedDisableDirectivesSeverity A severity string indicating if and how unused disable and enable directives should be tracked and reported.
 * @property {Object} [rule] Specify rules
 * @property {boolean} [stats] Report additional statistics
 * @property {boolean} stdin Lint code provided on <STDIN>
 * @property {string} [stdinFilename] Specify filename to process STDIN as
 * @property {boolean} [suppressAll] Suppress all error violations
 * @property {string} [suppressionsLocation] Path to the suppressions file or directory
 * @property {string[]} [suppressRule] Suppress specific rules
 * @property {boolean} [version] Output the version number
 * @property {boolean} warnIgnored Show warnings when the file list includes ignored files
 * @property {string[]} _ Positional filenames or patterns
 */

//------------------------------------------------------------------------------
// Initialization and Public Interface
//------------------------------------------------------------------------------

// exports "parse(args)", "generateHelp()", and "generateHelpForOption(optionName)"

/**
 * Creates the CLI options for ESLint.
 * @returns {Object} The optionator instance.
 */
module.exports = function () {
	return optionator({
		prepend: "eslint [options] file.js [file.js] [dir]",
		defaults: {
			concatRepeatedArrays: true,
			mergeRepeatedObjects: true,
		},
		options: [
			{
				heading: "Basic configuration",
			},
			{
				option: "config-lookup",
				type: "Boolean",
				default: "true",
				description: "Disable look up for eslint.config.js",
			},
			{
				option: "config",
				alias: "c",
				type: "path::String",
				description:
					"Use this configuration instead of eslint.config.js, eslint.config.mjs, or eslint.config.cjs",
			},
			{
				option: "inspect-config",
				type: "Boolean",
				description:
					"Open the config inspector with the current configuration",
			},
			{
				option: "ext",
				type: "[String]",
				description: "Specify additional file extensions to lint",
			},
			{
				option: "global",
				type: "[String]",
				description: "Define global variables",
			},
			{
				option: "parser",
				type: "String",
				description: "Specify the parser to be used",
			},
			{
				option: "parser-options",
				type: "Object",
				description: "Specify parser options",
			},
			{
				heading: "Specify Rules and Plugins",
			},
			{
				option: "plugin",
				type: "[String]",
				description: "Specify plugins",
			},
			{
				option: "rule",
				type: "Object",
				description: "Specify rules",
			},
			{
				heading: "Fix Problems",
			},
			{
				option: "fix",
				type: "Boolean",
				default: false,
				description: "Automatically fix problems",
			},
			{
				option: "fix-dry-run",
				type: "Boolean",
				default: false,
				description:
					"Automatically fix problems without saving the changes to the file system",
			},
			{
				option: "fix-type",
				type: "Array",
				description:
					"Specify the types of fixes to apply (directive, problem, suggestion, layout)",
			},
			{
				heading: "Ignore Files",
			},
			{
				option: "ignore",
				type: "Boolean",
				default: "true",
				description: "Disable use of ignore files and patterns",
			},
			{
				option: "ignore-pattern",
				type: "[String]",
				description: "Patterns of files to ignore",
				concatRepeatedArrays: [
					true,
					{
						oneValuePerFlag: true,
					},
				],
			},
			{
				heading: "Use stdin",
			},
			{
				option: "stdin",
				type: "Boolean",
				default: "false",
				description: "Lint code provided on <STDIN>",
			},
			{
				option: "stdin-filename",
				type: "String",
				description: "Specify filename to process STDIN as",
			},
			{
				heading: "Handle Warnings",
			},
			{
				option: "quiet",
				type: "Boolean",
				default: "false",
				description: "Report errors only",
			},
			{
				option: "max-warnings",
				type: "Int",
				default: "-1",
				description: "Number of warnings to trigger nonzero exit code",
			},
			{
				heading: "Output",
			},
			{
				option: "output-file",
				alias: "o",
				type: "path::String",
				description: "Specify file to write report to",
			},
			{
				option: "format",
				alias: "f",
				type: "String",
				default: "stylish",
				description: "Use a specific output format",
			},
			{
				option: "color",
				type: "Boolean",
				alias: "no-color",
				description: "Force enabling/disabling of color",
			},
			{
				heading: "Inline configuration comments",
			},
			{
				option: "inline-config",
				type: "Boolean",
				default: "true",
				description: "Prevent comments from changing config or rules",
			},
			{
				option: "report-unused-disable-directives",
				type: "Boolean",
				default: void 0,
				description:
					"Adds reported errors for unused eslint-disable and eslint-enable directives",
			},
			{
				option: "report-unused-disable-directives-severity",
				type: "String",
				default: void 0,
				description:
					"Chooses severity level for reporting unused eslint-disable and eslint-enable directives",
				enum: ["off", "warn", "error", "0", "1", "2"],
			},
			{
				option: "report-unused-inline-configs",
				type: "String",
				default: void 0,
				description:
					"Adds reported errors for unused eslint inline config comments",
				enum: ["off", "warn", "error", "0", "1", "2"],
			},
			{
				heading: "Caching",
			},
			{
				option: "cache",
				type: "Boolean",
				default: "false",
				description: "Only check changed files",
			},
			{
				option: "cache-file",
				type: "path::String",
				default: ".eslintcache",
				description:
					"Path to the cache file. Deprecated: use --cache-location",
			},
			{
				option: "cache-location",
				type: "path::String",
				description: "Path to the cache file or directory",
			},
			{
				option: "cache-strategy",
				dependsOn: ["cache"],
				type: "String",
				default: "metadata",
				enum: ["metadata", "content"],
				description:
					"Strategy to use for detecting changed files in the cache",
			},
			{
				heading: "Suppressing Violations",
			},
			{
				option: "suppress-all",
				type: "Boolean",
				default: "false",
				description: "Suppress all violations",
			},
			{
				option: "suppress-rule",
				type: "[String]",
				description: "Suppress specific rules",
			},
			{
				option: "suppressions-location",
				type: "path::String",
				description: "Specify the location of the suppressions file",
			},
			{
				option: "prune-suppressions",
				type: "Boolean",
				default: "false",
				description: "Prune unused suppressions",
			},
			{
				option: "pass-on-unpruned-suppressions",
				type: "Boolean",
				default: "false",
				description: "Ignore unused suppressions",
			},
			{
				heading: "Miscellaneous",
			},
			{
				option: "init",
				type: "Boolean",
				default: "false",
				description: "Run config initialization wizard",
			},
			{
				option: "env-info",
				type: "Boolean",
				default: "false",
				description: "Output execution environment information",
			},
			{
				option: "error-on-unmatched-pattern",
				type: "Boolean",
				default: "true",
				description: "Prevent errors when pattern is unmatched",
			},
			{
				option: "exit-on-fatal-error",
				type: "Boolean",
				default: "false",
				description: "Exit with exit code 2 in case of fatal error",
			},
			{
				option: "warn-ignored",
				type: "Boolean",
				default: "true",
				description:
					"Suppress warnings when the file list includes ignored files",
			},
			{
				option: "pass-on-no-patterns",
				type: "Boolean",
				default: false,
				description:
					"Exit with exit code 0 in case no file patterns are passed",
			},
			{
				option: "debug",
				type: "Boolean",
				default: false,
				description: "Output debugging information",
			},
			{
				option: "help",
				alias: "h",
				type: "Boolean",
				description: "Show help",
			},
			{
				option: "version",
				alias: "v",
				type: "Boolean",
				description: "Output the version number",
			},
			{
				option: "print-config",
				type: "path::String",
				description: "Print the configuration for the given file",
			},
			{
				option: "stats",
				type: "Boolean",
				default: "false",
				description: "Add statistics to the lint report",
			},
			{
				option: "flag",
				type: "[String]",
				description: "Enable a feature flag",
			},
			{
				option: "mcp",
				type: "Boolean",
				description: "Start the ESLint MCP server",
			},
			{
				option: "concurrency",
				type: "Int|String",
				default: "off",
				description:
					"Number of linting threads, auto to choose automatically, off for no multithreading",
			},
		],
	});
};
hxN 100644 index.js OQ98tw 100644 rule-tester.js =ЫiʭƏG&ʄ x` "use strict";

const RuleTester = require("./rule-tester");

module.exports = {
	RuleTester,
};
,	 x	/**
 * @fileoverview Mocha/Jest test wrapper
 * @author Ilya Volodin
 */
"use strict";

/* globals describe, it -- Mocha globals */

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const assert = require("node:assert"),
	{ existsSync, readFileSync } = require("node:fs"),
	util = require("node:util"),
	path = require("node:path"),
	equal = require("fast-deep-equal"),
	Traverser = require("../shared/traverser"),
	{ Config } = require("../config/config"),
	{ Linter, SourceCodeFixer } = require("../linter"),
	{ interpolate, getPlaceholderMatcher } = require("../linter/interpolate"),
	stringify = require("json-stable-stringify-without-jsonify"),
	{ isSerializable } = require("../shared/serialization");

const { FlatConfigArray } = require("../config/flat-config-array");
const {
	defaultConfig,
	defaultRuleTesterConfig,
} = require("../config/default-config");

const ajv = require("../shared/ajv")({ strictDefaults: true });

const parserSymbol = Symbol.for("eslint.RuleTester.parser");
const { ConfigArraySymbol } = require("@eslint/config-array");

const jslang = require("../languages/js");
const { SourceCode } = require("../languages/js/source-code");

//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------

/** @import { LanguageOptions, RuleDefinition } from "@eslint/core" */

/** @typedef {import("../types").Linter.Parser} Parser */

/**
 * A test case that is expected to pass lint.
 * @typedef {Object} ValidTestCase
 * @property {string} [name] Name for the test case.
 * @property {string} code Code for the test case.
 * @property {any[]} [options] Options for the test case.
 * @property {Function} [before] Function to execute before testing the case.
 * @property {Function} [after] Function to execute after testing the case regardless of its result.
 * @property {LanguageOptions} [languageOptions] The language options to use in the test case.
 * @property {{ [name: string]: any }} [settings] Settings for the test case.
 * @property {string} [filename] The fake filename for the test case. Useful for rules that make assertion about filenames.
 * @property {boolean} [only] Run only this test case or the subset of test cases with this property.
 */

/**
 * A test case that is expected to fail lint.
 * @typedef {Object} InvalidTestCase
 * @property {string} [name] Name for the test case.
 * @property {string} code Code for the test case.
 * @property {number | Array<TestCaseError | string | RegExp>} errors Expected errors.
 * @property {string | null} [output] The expected code after autofixes are applied. If set to `null`, the test runner will assert that no autofix is suggested.
 * @property {any[]} [options] Options for the test case.
 * @property {Function} [before] Function to execute before testing the case.
 * @property {Function} [after] Function to execute after testing the case regardless of its result.
 * @property {{ [name: string]: any }} [settings] Settings for the test case.
 * @property {string} [filename] The fake filename for the test case. Useful for rules that make assertion about filenames.
 * @property {LanguageOptions} [languageOptions] The language options to use in the test case.
 * @property {boolean} [only] Run only this test case or the subset of test cases with this property.
 */

/**
 * A description of a reported error used in a rule tester test.
 * @typedef {Object} TestCaseError
 * @property {string | RegExp} [message] Message.
 * @property {string} [messageId] Message ID.
 * @property {{ [name: string]: string }} [data] The data used to fill the message template.
 * @property {number} [line] The 1-based line number of the reported start location.
 * @property {number} [column] The 1-based column number of the reported start location.
 * @property {number} [endLine] The 1-based line number of the reported end location.
 * @property {number} [endColumn] The 1-based column number of the reported end location.
 */

//------------------------------------------------------------------------------
// Private Members
//------------------------------------------------------------------------------

/*
 * testerDefaultConfig must not be modified as it allows to reset the tester to
 * the initial default configuration
 */
const testerDefaultConfig = { rules: {} };

/*
 * RuleTester uses this config as its default. This can be overwritten via
 * setDefaultConfig().
 */
let sharedDefaultConfig = { rules: {} };

/*
 * List every parameters possible on a test case that are not related to eslint
 * configuration
 */
const RuleTesterParameters = [
	"name",
	"code",
	"filename",
	"options",
	"before",
	"after",
	"errors",
	"output",
	"only",
];

/*
 * All allowed property names in error objects.
 */
const errorObjectParameters = new Set([
	"message",
	"messageId",
	"data",
	"line",
	"column",
	"endLine",
	"endColumn",
	"suggestions",
]);
const friendlyErrorObjectParameterList = `[${[...errorObjectParameters].map(key => `'${key}'`).join(", ")}]`;

/*
 * All allowed property names in suggestion objects.
 */
const suggestionObjectParameters = new Set([
	"desc",
	"messageId",
	"data",
	"output",
]);
const friendlySuggestionObjectParameterList = `[${[...suggestionObjectParameters].map(key => `'${key}'`).join(", ")}]`;

const forbiddenMethods = [
	"applyInlineConfig",
	"applyLanguageOptions",
	"finalize",
];

/** @type {Map<string,WeakSet>} */
const forbiddenMethodCalls = new Map(
	forbiddenMethods.map(methodName => [methodName, new WeakSet()]),
);

const hasOwnProperty = Function.call.bind(Object.hasOwnProperty);

/**
 * Clones a given value deeply.
 * Note: This ignores `parent` property.
 * @param {any} x A value to clone.
 * @returns {any} A cloned value.
 */
function cloneDeeplyExcludesParent(x) {
	if (typeof x === "object" && x !== null) {
		if (Array.isArray(x)) {
			return x.map(cloneDeeplyExcludesParent);
		}

		const retv = {};

		for (const key in x) {
			if (key !== "parent" && hasOwnProperty(x, key)) {
				retv[key] = cloneDeeplyExcludesParent(x[key]);
			}
		}

		return retv;
	}

	return x;
}

/**
 * Freezes a given value deeply.
 * @param {any} x A value to freeze.
 * @param {Set<Object>} seenObjects Objects already seen during the traversal.
 * @returns {void}
 */
function freezeDeeply(x, seenObjects = new Set()) {
	if (typeof x === "object" && x !== null) {
		if (seenObjects.has(x)) {
			return; // skip to avoid infinite recursion
		}
		seenObjects.add(x);

		if (Array.isArray(x)) {
			x.forEach(element => {
				freezeDeeply(element, seenObjects);
			});
		} else {
			for (const key in x) {
				if (key !== "parent" && hasOwnProperty(x, key)) {
					freezeDeeply(x[key], seenObjects);
				}
			}
		}
		Object.freeze(x);
	}
}

/**
 * Replace control characters by `\u00xx` form.
 * @param {string} text The text to sanitize.
 * @returns {string} The sanitized text.
 */
function sanitize(text) {
	if (typeof text !== "string") {
		return "";
	}
	return text.replace(
		/[\u0000-\u0009\u000b-\u001a]/gu, // eslint-disable-line no-control-regex -- Escaping controls
		c => `\\u${c.codePointAt(0).toString(16).padStart(4, "0")}`,
	);
}

/**
 * Define `start`/`end` properties as throwing error.
 * @param {string} objName Object name used for error messages.
 * @param {ASTNode} node The node to define.
 * @returns {void}
 */
function defineStartEndAsError(objName, node) {
	Object.defineProperties(node, {
		start: {
			get() {
				throw new Error(
					`Use ${objName}.range[0] instead of ${objName}.start`,
				);
			},
			configurable: true,
			enumerable: false,
		},
		end: {
			get() {
				throw new Error(
					`Use ${objName}.range[1] instead of ${objName}.end`,
				);
			},
			configurable: true,
			enumerable: false,
		},
	});
}

/**
 * Define `start`/`end` properties of all nodes of the given AST as throwing error.
 * @param {ASTNode} ast The root node to errorize `start`/`end` properties.
 * @param {Object} [visitorKeys] Visitor keys to be used for traversing the given ast.
 * @returns {void}
 */
function defineStartEndAsErrorInTree(ast, visitorKeys) {
	Traverser.traverse(ast, {
		visitorKeys,
		enter: defineStartEndAsError.bind(null, "node"),
	});
	ast.tokens.forEach(defineStartEndAsError.bind(null, "token"));
	ast.comments.forEach(defineStartEndAsError.bind(null, "token"));
}

/**
 * Wraps the given parser in order to intercept and modify return values from the `parse` and `parseForESLint` methods, for test purposes.
 * In particular, to modify ast nodes, tokens and comments to throw on access to their `start` and `end` properties.
 * @param {Parser} parser Parser object.
 * @returns {Parser} Wrapped parser object.
 */
function wrapParser(parser) {
	if (typeof parser.parseForESLint === "function") {
		return {
			[parserSymbol]: parser,
			parseForESLint(...args) {
				const ret = parser.parseForESLint(...args);

				defineStartEndAsErrorInTree(ret.ast, ret.visitorKeys);
				return ret;
			},
		};
	}

	return {
		[parserSymbol]: parser,
		parse(...args) {
			const ast = parser.parse(...args);

			defineStartEndAsErrorInTree(ast);
			return ast;
		},
	};
}

/**
 * Function to replace forbidden `SourceCode` methods. Allows just one call per method.
 * @param {string} methodName The name of the method to forbid.
 * @param {Function} prototype The prototype with the original method to call.
 * @returns {Function} The function that throws the error.
 */
function throwForbiddenMethodError(methodName, prototype) {
	const original = prototype[methodName];

	return function (...args) {
		const called = forbiddenMethodCalls.get(methodName);

		/* eslint-disable no-invalid-this -- needed to operate as a method. */
		if (!called.has(this)) {
			called.add(this);

			return original.apply(this, args);
		}
		/* eslint-enable no-invalid-this -- not needed past this point */

		throw new Error(
			`\`SourceCode#${methodName}()\` cannot be called inside a rule.`,
		);
	};
}

/**
 * Extracts names of {{ placeholders }} from the reported message.
 * @param   {string} message Reported message
 * @returns {string[]} Array of placeholder names
 */
function getMessagePlaceholders(message) {
	const matcher = getPlaceholderMatcher();

	return Array.from(message.matchAll(matcher), ([, name]) => name.trim());
}

/**
 * Returns the placeholders in the reported messages but
 * only includes the placeholders available in the raw message and not in the provided data.
 * @param {string} message The reported message
 * @param {string} raw The raw message specified in the rule meta.messages
 * @param {undefined|Record<unknown, unknown>} data The passed
 * @returns {string[]} Missing placeholder names
 */
function getUnsubstitutedMessagePlaceholders(message, raw, data = {}) {
	const unsubstituted = getMessagePlaceholders(message);

	if (unsubstituted.length === 0) {
		return [];
	}

	// Remove false positives by only counting placeholders in the raw message, which were not provided in the data matcher or added with a data property
	const known = getMessagePlaceholders(raw);
	const provided = Object.keys(data);

	return unsubstituted.filter(
		name => known.includes(name) && !provided.includes(name),
	);
}

const metaSchemaDescription = `
\t- If the rule has options, set \`meta.schema\` to an array or non-empty object to enable options validation.
\t- If the rule doesn't have options, omit \`meta.schema\` to enforce that no options can be passed to the rule.
\t- You can also set \`meta.schema\` to \`false\` to opt-out of options validation (not recommended).

\thttps://eslint.org/docs/latest/extend/custom-rules#options-schemas
`;

/*
 * Ignored test case properties when checking for test case duplicates.
 */
const duplicationIgnoredParameters = new Set(["name", "errors", "output"]);

/**
 * Normalizes a test case item, ensuring it is an object with a 'code' property.
 * If the item is not an object, it returns an object with the 'code' property set to the item.
 * @param {any} item The test case item to normalize.
 * @returns {Object} The normalized test case object.
 */
function normalizeTestCase(item) {
	return item && typeof item === "object" ? item : { code: item };
}

/**
 * Asserts that the `errors` property of an invalid test case is valid.
 * @param {number | string[]} errors The `errors` property of the invalid test case.
 * @param {string} ruleName The name of the rule being tested.
 * @param {Object} [assertionOptions] The assertion options for the test case.
 * @returns {void}
 */
function assertErrorsProperty(errors, ruleName, assertionOptions = {}) {
	const isNumber = typeof errors === "number";
	const isArray = Array.isArray(errors);

	if (!isNumber && !isArray) {
		if (errors === void 0) {
			assert.fail(
				`Did not specify errors for an invalid test of ${ruleName}`,
			);
		} else {
			assert.fail(
				`Invalid 'errors' property for invalid test of ${ruleName}: expected a number or an array but got ${
					errors === null ? "null" : typeof errors
				}`,
			);
		}
	}

	const { requireMessage = false, requireLocation = false } =
		assertionOptions;

	if (isArray) {
		assert.ok(
			errors.length !== 0,
			"Invalid cases must have at least one error",
		);

		for (const [number, error] of errors.entries()) {
			if (typeof error === "string" || error instanceof RegExp) {
				// Just an error message.
				assert.ok(
					requireMessage !== "messageId" && !requireLocation,
					`errors[${number}] should be an object when 'assertionOptions.requireMessage' is 'messageId' or 'assertionOptions.requireLocation' is true.`,
				);
			} else if (typeof error === "object" && error !== null) {
				/*
				 * Error object.
				 * This may have a message, messageId, data, line, and/or column.
				 */

				for (const propertyName of Object.keys(error)) {
					assert.ok(
						errorObjectParameters.has(propertyName),
						`Invalid error property name '${propertyName}'. Expected one of ${friendlyErrorObjectParameterList}.`,
					);
				}

				if (requireMessage === "message") {
					assert.ok(
						!hasOwnProperty(error, "messageId") &&
							hasOwnProperty(error, "message"),
						`errors[${number}] should specify 'message' (and not 'messageId') when 'assertionOptions.requireMessage' is 'message'.`,
					);
				} else if (requireMessage === "messageId") {
					assert.ok(
						!hasOwnProperty(error, "message") &&
							hasOwnProperty(error, "messageId"),
						`errors[${number}] should specify 'messageId' (and not 'message') when 'assertionOptions.requireMessage' is 'messageId'.`,
					);
				}

				if (hasOwnProperty(error, "message")) {
					assert.ok(
						!hasOwnProperty(error, "messageId"),
						`errors[${number}] should not specify both 'message' and 'messageId'.`,
					);
					assert.ok(
						!hasOwnProperty(error, "data"),
						`errors[${number}] should not specify both 'data' and 'message'.`,
					);
				} else {
					assert.ok(
						hasOwnProperty(error, "messageId"),
						`errors[${number}] must specify either 'messageId' or 'message'.`,
					);
				}
			} else {
				assert.fail(
					`errors[${number}] must be a string, RegExp, or an object.`,
				);
			}
		}
	} else {
		assert.ok(
			!requireMessage && !requireLocation,
			"Invalid cases must have 'errors' value as an array",
		);
		assert.ok(
			errors > 0,
			"Invalid cases must have 'error' value greater than 0",
		);
	}
}

/**
 * Check if this test case is a duplicate of one we have seen before.
 * @param {Object} item test case object
 * @param {Set<string>} seenTestCases set of serialized test cases we have seen so far (managed by this function)
 * @returns {void}
 */
function checkDuplicateTestCase(item, seenTestCases) {
	if (!isSerializable(item)) {
		/*
		 * If we can't serialize a test case (because it contains a function, RegExp, etc), skip the check.
		 * This might happen with properties like: options, plugins, settings, languageOptions.parser, languageOptions.parserOptions.
		 */
		return;
	}

	const serializedTestCase = stringify(item, {
		replacer(key, value) {
			// "this" is the currently stringified object --> only ignore top-level properties
			return item !== this || !duplicationIgnoredParameters.has(key)
				? value
				: void 0;
		},
	});

	assert(
		!seenTestCases.has(serializedTestCase),
		"detected duplicate test case",
	);
	seenTestCases.add(serializedTestCase);
}

/**
 * Asserts that a rule is valid.
 * A valid rule must be an object with a `create` method.
 * @param {Object} rule The rule to check.
 * @param {string} ruleName The name of the rule.
 * @returns {void}
 * @throws {AssertionError} If the rule is not valid.
 */
function assertRule(rule, ruleName) {
	assert.ok(
		rule && typeof rule === "object" && typeof rule.create === "function",
		`Rule ${ruleName} must be an object with a \`create\` method`,
	);
}

/**
 * Asserts that a test scenario object is valid.
 * A valid test scenario object must have `valid` and `invalid` properties, both of
 * which must be arrays.
 * @param {Object} test The test scenario object to check.
 * @param {string} ruleName The name of the rule being tested.
 * @returns {void}
 * @throws {AssertionError} If the test scenario object is not valid.
 */
function assertTest(test, ruleName) {
	assert.ok(
		test && typeof test === "object",
		`Test Scenarios for rule ${ruleName} : Could not find test scenario object`,
	);

	const hasValid = Array.isArray(test.valid);
	const hasInvalid = Array.isArray(test.invalid);

	assert.ok(
		hasValid,
		`Test Scenarios for rule ${ruleName} is invalid: Could not find any valid test scenarios`,
	);

	assert.ok(
		hasInvalid,
		`Test Scenarios for rule ${ruleName} is invalid: Could not find any invalid test scenarios`,
	);
}

/**
 * Asserts that the common properties of a valid/invalid test case have the correct types.
 * @param {Object} item The test case object to check.
 * @returns {void}
 */
function assertTestCommonProperties(item) {
	assert.ok(
		typeof item.code === "string",
		"Test case must specify a string value for 'code'",
	);

	// optional properties
	if (item.name) {
		assert.ok(
			typeof item.name === "string",
			"Optional test case property 'name' must be a string",
		);
	}
	if (hasOwnProperty(item, "only")) {
		assert.ok(
			typeof item.only === "boolean",
			"Optional test case property 'only' must be a boolean",
		);
	}
	if (hasOwnProperty(item, "filename")) {
		assert.ok(
			typeof item.filename === "string",
			"Optional test case property 'filename' must be a string",
		);
	}
	if (hasOwnProperty(item, "options")) {
		assert.ok(
			Array.isArray(item.options),
			"Optional test case property 'options' must be an array",
		);
	}
}

/**
 * Asserts that a valid test case object is valid.
 * A valid test case must specify a string value for 'code'.
 * Optional properties are checked for correct types.
 * @param {Object} item The valid test case object to check.
 * @param {Set<string>} seenTestCases Set of serialized test cases to check for duplicates.
 * @returns {void}
 * @throws {AssertionError} If the test case is not valid.
 */
function assertValidTestCase(item, seenTestCases) {
	// must not have properties of invalid test cases
	assert.ok(
		item.errors === void 0,
		"Valid test case must not have 'errors' property",
	);
	assert.ok(
		item.output === void 0,
		"Valid test case must not have 'output' property",
	);

	assertTestCommonProperties(item);
	checkDuplicateTestCase(item, seenTestCases);
}

/**
 * Asserts that the invalid test case object is valid.
 * An invalid test case must specify a string value for 'code' and must have 'errors' property.
 * Optional properties are checked for correct types.
 * @param {Object} item The invalid test case object to check.
 * @param {Set<string>} seenTestCases Set of serialized test cases to check for duplicates.
 * @param {string} ruleName The name of the rule being tested.
 * @param {Object} [assertionOptions] The assertion options for the test case.
 * @returns {void}
 * @throws {AssertionError} If the test case is not valid.
 */
function assertInvalidTestCase(
	item,
	seenTestCases,
	ruleName,
	assertionOptions = {},
) {
	assertTestCommonProperties(item);

	assertErrorsProperty(item.errors, ruleName, assertionOptions);

	// 'output' is optional, but if it exists it must be a string or null
	if (hasOwnProperty(item, "output")) {
		assert.ok(
			item.output === null || typeof item.output === "string",
			"Test property 'output', if specified, must be a string or null. If no autofix is expected, then omit the 'output' property or set it to null.",
		);
	}

	checkDuplicateTestCase(item, seenTestCases);
}

/**
 * Gets the invocation location from the stack trace for later use.
 * @param {Function} relative The function before the invocation point.
 * @returns {{ sourceFile: string; sourceLine: number; sourceColumn: number; }} The invocation location.
 */
function getInvocationLocation(relative = getInvocationLocation) {
	const dummyObject = {};
	let location;
	const { prepareStackTrace } = Error;
	Error.prepareStackTrace = (_, [callSite]) => {
		location = {
			sourceFile:
				callSite.getFileName() ??
				`${callSite.getEvalOrigin()}, <anonymous>`,
			sourceLine: callSite.getLineNumber() ?? 1,
			sourceColumn: callSite.getColumnNumber() ?? 1,
		};
	};
	Error.captureStackTrace(dummyObject, relative); // invoke Error.prepareStackTrace in Bun
	void dummyObject.stack; // invoke Error.prepareStackTrace in Node.js
	Error.prepareStackTrace = prepareStackTrace;
	return location;
}

/**
 * Estimates the location of the test case in the source file.
 * @param {Function} invoker The method that runs the tests.
 * @returns {(key: string) => string} The lazy resolver for the estimated location of the test case.
 */
function buildLazyTestLocationEstimator(invoker) {
	const invocationLocation = getInvocationLocation(invoker);
	let testLocations = null;
	return key => {
		if (testLocations === null) {
			const { sourceFile, sourceLine, sourceColumn } = invocationLocation;
			testLocations = {
				root: `${sourceFile}:${sourceLine}:${sourceColumn}`,
			};

			if (existsSync(sourceFile)) {
				let content = readFileSync(sourceFile, "utf8")
					.split("\n")
					.slice(sourceLine - 1);
				content[0] = content[0].slice(Math.max(0, sourceColumn - 1));
				content = content.map(
					l =>
						l
							.trim() // Remove whitespace
							.replace(/\s*\/\/.*$(?<!,)/u, ""), // and trailing in-line comments that aren't part of the test `code`
				);

				// Roots
				const validStartIndex = content.findIndex(line =>
					/\bvalid\s*:/u.test(line),
				);
				const invalidStartIndex = content.findIndex(line =>
					/\binvalid\s*:/u.test(line),
				);

				testLocations.valid = `${sourceFile}:${
					sourceLine + validStartIndex
				}`;
				testLocations.invalid = `${sourceFile}:${
					sourceLine + invalidStartIndex
				}`;

				// Scenario basics
				const validEndIndex =
					validStartIndex < invalidStartIndex
						? invalidStartIndex
						: content.length;
				const invalidEndIndex =
					validStartIndex < invalidStartIndex
						? content.length
						: validStartIndex;

				const validLines = content.slice(
					validStartIndex,
					validEndIndex,
				);
				const invalidLines = content.slice(
					invalidStartIndex,
					invalidEndIndex,
				);

				let objectDepth = 0;
				const validLineIndexes = validLines
					.map((l, i) => {
						// matches `key: {` and `{`
						if (/^(?:\w+\s*:\s*)?\{/u.test(l)) {
							objectDepth++;
						}

						if (objectDepth > 0) {
							if (l.endsWith("}") || l.endsWith("},")) {
								objectDepth--;
							}

							return objectDepth <= 1 && l.includes("code:")
								? i
								: null;
						}

						return l.endsWith(",") ? i : null;
					})
					.filter(Boolean);
				const invalidLineIndexes = invalidLines
					.map((l, i) =>
						l.trimStart().startsWith("errors:") ? i : null,
					)
					.filter(Boolean);

				Object.assign(
					testLocations,
					{
						[`valid[0]`]: `${sourceFile}:${
							sourceLine + validStartIndex
						}`,
					},
					Object.fromEntries(
						validLineIndexes.map((location, validIndex) => [
							`valid[${validIndex}]`,
							`${sourceFile}:${
								sourceLine + validStartIndex + location
							}`,
						]),
					),
					Object.fromEntries(
						invalidLineIndexes.map((location, invalidIndex) => [
							`invalid[${invalidIndex}]`,
							`${sourceFile}:${
								sourceLine + invalidStartIndex + location
							}`,
						]),
					),
				);

				// Indexes for errors inside each invalid test case
				invalidLineIndexes.push(invalidLines.length);

				for (let i = 0; i < invalidLineIndexes.length - 1; i++) {
					const start = invalidLineIndexes[i];
					const end = invalidLineIndexes[i + 1];
					const errorLines = invalidLines.slice(start, end);
					let errorObjectDepth = 0;
					const errorLineIndexes = errorLines
						.map((l, j) => {
							if (l.startsWith("{") || l.endsWith("{")) {
								errorObjectDepth++;

								if (l.endsWith("}") || l.endsWith("},")) {
									errorObjectDepth--;
								}

								return errorObjectDepth <= 1 ? j : null;
							}

							if (errorObjectDepth > 0) {
								if (l.endsWith("}") || l.endsWith("},")) {
									errorObjectDepth--;
								}

								return null;
							}

							return l.endsWith(",") ? j : null;
						})
						.filter(Boolean);

					Object.assign(
						testLocations,
						Object.fromEntries(
							errorLineIndexes.map((line, errorIndex) => [
								`invalid[${i}].errors[${errorIndex}]`,
								`${sourceFile}:${
									sourceLine +
									invalidStartIndex +
									start +
									line
								}`,
							]),
						),
					);
				}
			}
		}

		return testLocations[key] || "unknown source";
	};
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

// default separators for testing
const DESCRIBE = Symbol("describe");
const IT = Symbol("it");
const IT_ONLY = Symbol("itOnly");

/**
 * This is `it` default handler if `it` don't exist.
 * @this {Mocha}
 * @param {string} text The description of the test case.
 * @param {Function} method The logic of the test case.
 * @throws {Error} Any error upon execution of `method`.
 * @returns {any} Returned value of `method`.
 */
function itDefaultHandler(text, method) {
	try {
		return method.call(this);
	} catch (err) {
		if (err instanceof assert.AssertionError) {
			err.message += ` (${util.inspect(err.actual)} ${err.operator} ${util.inspect(err.expected)})`;
		}
		throw err;
	}
}

/**
 * This is `describe` default handler if `describe` don't exist.
 * @this {Mocha}
 * @param {string} text The description of the test case.
 * @param {Function} method The logic of the test case.
 * @returns {any} Returned value of `method`.
 */
function describeDefaultHandler(text, method) {
	return method.call(this);
}

/**
 * Mocha test wrapper.
 */
class RuleTester {
	/**
	 * Creates a new instance of RuleTester.
	 * @param {Object} [testerConfig] Optional, extra configuration for the tester
	 */
	constructor(testerConfig = {}) {
		/**
		 * The configuration to use for this tester. Combination of the tester
		 * configuration and the default configuration.
		 * @type {Object}
		 */
		this.testerConfig = [
			sharedDefaultConfig,
			testerConfig,
			{ rules: { "rule-tester/validate-ast": "error" } },
		];

		this.linter = new Linter({ configType: "flat" });
	}

	/**
	 * Set the configuration to use for all future tests
	 * @param {Object} config the configuration to use.
	 * @throws {TypeError} If non-object config.
	 * @returns {void}
	 */
	static setDefaultConfig(config) {
		if (typeof config !== "object" || config === null) {
			throw new TypeError(
				"RuleTester.setDefaultConfig: config must be an object",
			);
		}
		sharedDefaultConfig = config;

		// Make sure the rules object exists since it is assumed to exist later
		sharedDefaultConfig.rules = sharedDefaultConfig.rules || {};
	}

	/**
	 * Get the current configuration used for all tests
	 * @returns {Object} the current configuration
	 */
	static getDefaultConfig() {
		return sharedDefaultConfig;
	}

	/**
	 * Reset the configuration to the initial configuration of the tester removing
	 * any changes made until now.
	 * @returns {void}
	 */
	static resetDefaultConfig() {
		sharedDefaultConfig = {
			rules: {
				...testerDefaultConfig.rules,
			},
		};
	}

	/*
	 * If people use `mocha test.js --watch` command, `describe` and `it` function
	 * instances are different for each execution. So `describe` and `it` should get fresh instance
	 * always.
	 */
	static get describe() {
		return (
			this[DESCRIBE] ||
			(typeof describe === "function" ? describe : describeDefaultHandler)
		);
	}

	static set describe(value) {
		this[DESCRIBE] = value;
	}

	static get it() {
		return this[IT] || (typeof it === "function" ? it : itDefaultHandler);
	}

	static set it(value) {
		this[IT] = value;
	}

	/**
	 * Adds the `only` property to a test to run it in isolation.
	 * @param {string | ValidTestCase | InvalidTestCase} item A single test to run by itself.
	 * @returns {ValidTestCase | InvalidTestCase} The test with `only` set.
	 */
	static only(item) {
		if (typeof item === "string") {
			return { code: item, only: true };
		}

		return { ...item, only: true };
	}

	static get itOnly() {
		if (typeof this[IT_ONLY] === "function") {
			return this[IT_ONLY];
		}
		if (
			typeof this[IT] === "function" &&
			typeof this[IT].only === "function"
		) {
			return Function.bind.call(this[IT].only, this[IT]);
		}
		if (typeof it === "function" && typeof it.only === "function") {
			return Function.bind.call(it.only, it);
		}

		if (
			typeof this[DESCRIBE] === "function" ||
			typeof this[IT] === "function"
		) {
			throw new Error(
				"Set `RuleTester.itOnly` to use `only` with a custom test framework.\n" +
					"See https://eslint.org/docs/latest/integrate/nodejs-api#customizing-ruletester for more.",
			);
		}
		if (typeof it === "function") {
			throw new Error(
				"The current test framework does not support exclusive tests with `only`.",
			);
		}
		throw new Error(
			"To use `only`, use RuleTester with a test framework that provides `it.only()` like Mocha.",
		);
	}

	static set itOnly(value) {
		this[IT_ONLY] = value;
	}

	/**
	 * Adds a new rule test to execute.
	 * @param {string} ruleName The name of the rule to run.
	 * @param {RuleDefinition} rule The rule to test.
	 * @param {{
	 *   assertionOptions?: {
	 *     requireMessage?: boolean | "message" | "messageId",
	 *     requireLocation?: boolean
	 *     requireData?: boolean | "error" | "suggestion"
	 *   },
	 *   valid: (ValidTestCase | string)[],
	 *   invalid: InvalidTestCase[]
	 * }} test The collection of tests to run.
	 * @throws {TypeError|Error} If `rule` is not an object with a `create` method,
	 * or if non-object `test`, or if a required scenario of the given type is missing.
	 * @returns {void}
	 */
	run(ruleName, rule, test) {
		const testerConfig = this.testerConfig,
			linter = this.linter,
			ruleId = `rule-to-test/${ruleName}`;

		assertRule(rule, ruleName);
		assertTest(test, ruleName);

		const estimateTestLocation = buildLazyTestLocationEstimator(this.run);

		const baseConfig = [
			{
				plugins: {
					// copy root plugin over
					"@": {
						/*
						 * Parsers are wrapped to detect more errors, so this needs
						 * to be a new object for each call to run(), otherwise the
						 * parsers will be wrapped multiple times.
						 */
						parsers: {
							...defaultConfig[0].plugins["@"].parsers,
						},

						/*
						 * The rules key on the default plugin is a proxy to lazy-load
						 * just the rules that are needed. So, don't create a new object
						 * here, just use the default one to keep that performance
						 * enhancement.
						 */
						rules: defaultConfig[0].plugins["@"].rules,
						languages: defaultConfig[0].plugins["@"].languages,
					},
					"rule-to-test": {
						rules: {
							[ruleName]: Object.assign({}, rule, {
								// Create a wrapper rule that freezes the `context` properties.
								create(context) {
									freezeDeeply(context.options);
									freezeDeeply(context.settings);
									freezeDeeply(context.parserOptions);

									// freezeDeeply(context.languageOptions);

									return rule.create(context);
								},
							}),
						},
					},
				},
				language: defaultConfig[0].language,
			},
			...defaultRuleTesterConfig,
		];

		/**
		 * Runs a hook on the given item when it's assigned to the given property
		 * @param {Object} item Item to run the hook on
		 * @param {string} prop The property having the hook assigned to
		 * @throws {Error} If the property is not a function or that function throws an error
		 * @returns {void}
		 * @private
		 */
		function runHook(item, prop) {
			if (hasOwnProperty(item, prop)) {
				assert.strictEqual(
					typeof item[prop],
					"function",
					`Optional test case property '${prop}' must be a function`,
				);
				item[prop]();
			}
		}
		/**
		 * Run the rule for the given item
		 * @param {Object} item Item to run the rule against
		 * @throws {Error} If an invalid schema.
		 * @returns {Object} Eslint run result
		 * @private
		 */
		function runRuleForItem(item) {
			const code = item.code;
			const filename = hasOwnProperty(item, "filename")
				? item.filename
				: void 0;
			const options = hasOwnProperty(item, "options") ? item.options : [];
			const flatConfigArrayOptions = {
				baseConfig,
			};

			if (filename) {
				flatConfigArrayOptions.basePath =
					path.parse(filename).root || void 0;
			}

			const configs = new FlatConfigArray(
				testerConfig,
				flatConfigArrayOptions,
			);

			/*
			 * Modify the returned config so that the parser is wrapped to catch
			 * access of the start/end properties. This method is called just
			 * once per code snippet being tested, so each test case gets a clean
			 * parser.
			 */
			configs[ConfigArraySymbol.finalizeConfig] = function (...args) {
				// can't do super here :(
				const proto = Object.getPrototypeOf(this);
				const calculatedConfig = proto[
					ConfigArraySymbol.finalizeConfig
				].apply(this, args);

				// wrap the parser to catch start/end property access
				if (calculatedConfig.language === jslang) {
					calculatedConfig.languageOptions.parser = wrapParser(
						calculatedConfig.languageOptions.parser,
					);
				}

				return calculatedConfig;
			};

			let output, beforeAST, afterAST;

			/*
			 * Assumes everything on the item is a config except for the
			 * parameters used by this tester
			 */
			const itemConfig = { ...item };

			for (const parameter of RuleTesterParameters) {
				delete itemConfig[parameter];
			}

			/*
			 * Create the config object from the tester config and this item
			 * specific configurations.
			 */
			configs.push(itemConfig);

			configs.push({
				rules: {
					[ruleId]: [1, ...options],
				},
			});

			let schema;

			try {
				schema = Config.getRuleOptionsSchema(rule);
			} catch (err) {
				err.message += metaSchemaDescription;
				throw err;
			}

			/*
			 * Check and throw an error if the schema is an empty object (`schema:{}`), because such schema
			 * doesn't validate or enforce anything and is therefore considered a possible error. If the intent
			 * was to skip options validation, `schema:false` should be set instead (explicit opt-out).
			 *
			 * For this purpose, a schema object is considered empty if it doesn't have any own enumerable string-keyed
			 * properties. While `ajv.compile()` does use enumerable properties from the prototype chain as well,
			 * it caches compiled schemas by serializing only own enumerable properties, so it's generally not a good idea
			 * to use inherited properties in schemas because schemas that differ only in inherited properties would end up
			 * having the same cache entry that would be correct for only one of them.
			 *
			 * At this point, `schema` can only be an object or `null`.
			 */
			if (schema && Object.keys(schema).length === 0) {
				throw new Error(
					`\`schema: {}\` is a no-op${metaSchemaDescription}`,
				);
			}

			/*
			 * Setup AST getters.
			 * The goal is to check whether or not AST was modified when
			 * running the rule under test.
			 */
			configs.push({
				plugins: {
					"rule-tester": {
						rules: {
							"validate-ast": {
								create() {
									return {
										Program(node) {
											beforeAST =
												cloneDeeplyExcludesParent(node);
										},
										"Program:exit"(node) {
											afterAST = node;
										},
									};
								},
							},
						},
					},
				},
			});

			if (schema) {
				ajv.validateSchema(schema);

				if (ajv.errors) {
					const errors = ajv.errors
						.map(error => {
							const field =
								error.dataPath[0] === "."
									? error.dataPath.slice(1)
									: error.dataPath;

							return `\t${field}: ${error.message}`;
						})
						.join("\n");

					throw new Error([
						`Schema for rule ${ruleName} is invalid:`,
						errors,
					]);
				}

				/*
				 * `ajv.validateSchema` checks for errors in the structure of the schema (by comparing the schema against a "meta-schema"),
				 * and it reports those errors individually. However, there are other types of schema errors that only occur when compiling
				 * the schema (e.g. using invalid defaults in a schema), and only one of these errors can be reported at a time. As a result,
				 * the schema is compiled here separately from checking for `validateSchema` errors.
				 */
				try {
					ajv.compile(schema);
				} catch (err) {
					throw new Error(
						`Schema for rule ${ruleName} is invalid: ${err.message}`,
						{
							cause: err,
						},
					);
				}
			}

			// check for validation errors
			try {
				configs.normalizeSync();
				configs.getConfig("test.js");
			} catch (error) {
				error.message = `ESLint configuration in rule-tester is invalid: ${error.message}`;
				throw error;
			}

			// Verify the code.
			const { applyLanguageOptions, applyInlineConfig, finalize } =
				SourceCode.prototype;
			let messages;

			try {
				forbiddenMethods.forEach(methodName => {
					SourceCode.prototype[methodName] =
						throwForbiddenMethodError(
							methodName,
							SourceCode.prototype,
						);
				});

				messages = linter.verify(code, configs, filename);
			} finally {
				SourceCode.prototype.applyInlineConfig = applyInlineConfig;
				SourceCode.prototype.applyLanguageOptions =
					applyLanguageOptions;
				SourceCode.prototype.finalize = finalize;
			}

			const fatalErrorMessage = messages.find(m => m.fatal);

			assert(
				!fatalErrorMessage,
				`A fatal parsing error occurred: ${fatalErrorMessage && fatalErrorMessage.message}`,
			);

			// Verify if autofix makes a syntax error or not.
			if (messages.some(m => m.fix)) {
				output = SourceCodeFixer.applyFixes(code, messages).output;
				const errorMessageInFix = linter
					.verify(output, configs, filename)
					.find(m => m.fatal);

				assert(
					!errorMessageInFix,
					[
						"A fatal parsing error occurred in autofix.",
						`Error: ${errorMessageInFix && errorMessageInFix.message}`,
						"Autofix output:",
						output,
					].join("\n"),
				);
			} else {
				output = code;
			}

			return {
				messages,
				output,
				beforeAST,
				afterAST: cloneDeeplyExcludesParent(afterAST),
				configs,
				filename,
			};
		}

		/**
		 * Check if the AST was changed
		 * @param {ASTNode} beforeAST AST node before running
		 * @param {ASTNode} afterAST AST node after running
		 * @returns {void}
		 * @private
		 */
		function assertASTDidntChange(beforeAST, afterAST) {
			if (!equal(beforeAST, afterAST)) {
				assert.fail("Rule should not modify AST.");
			}
		}

		/**
		 * Check if the template is valid or not
		 * all valid cases go through this
		 * @param {Object} item Item to run the rule against
		 * @returns {void}
		 * @private
		 */
		function testValidTemplate(item) {
			const result = runRuleForItem(item);
			const messages = result.messages;

			assert.strictEqual(
				messages.length,
				0,
				util.format(
					"Should have no errors but had %d: %s",
					messages.length,
					util.inspect(messages),
				),
			);

			assertASTDidntChange(result.beforeAST, result.afterAST);
		}

		/**
		 * Asserts that the message matches its expected value. If the expected
		 * value is a regular expression, it is checked against the actual
		 * value.
		 * @param {string} actual Actual value
		 * @param {string|RegExp} expected Expected value
		 * @returns {void}
		 * @private
		 */
		function assertMessageMatches(actual, expected) {
			if (expected instanceof RegExp) {
				// assert.js doesn't have a built-in RegExp match function
				assert.ok(
					expected.test(actual),
					`Expected '${actual}' to match ${expected}`,
				);
			} else {
				assert.strictEqual(actual, expected);
			}
		}

		/**
		 * Check if the template is invalid or not
		 * all invalid cases go through this.
		 * @param {Object} item Item to run the rule against
		 * @returns {void}
		 * @private
		 * @throws {Error} If the test case is invalid or has an invalid error.
		 */
		function testInvalidTemplate(item) {
			const {
				requireMessage = false,
				requireLocation = false,
				requireData = false,
			} = test.assertionOptions ?? {};

			const ruleHasMetaMessages =
				hasOwnProperty(rule, "meta") &&
				hasOwnProperty(rule.meta, "messages");
			const friendlyIDList = ruleHasMetaMessages
				? `[${Object.keys(rule.meta.messages)
						.map(key => `'${key}'`)
						.join(", ")}]`
				: null;

			assert.ok(
				ruleHasMetaMessages || requireMessage !== "messageId",
				`Assertion options can not use 'requireMessage: "messageId"' if rule under test doesn't define 'meta.messages'.`,
			);

			const result = runRuleForItem(item);
			const messages = result.messages;

			for (const message of messages) {
				if (hasOwnProperty(message, "suggestions")) {
					/** @type {Map<string, number>} */
					const seenMessageIndices = new Map();

					for (let i = 0; i < message.suggestions.length; i += 1) {
						const suggestionMessage = message.suggestions[i].desc;
						const previous =
							seenMessageIndices.get(suggestionMessage);

						assert.ok(
							!seenMessageIndices.has(suggestionMessage),
							`Suggestion message '${suggestionMessage}' reported from suggestion ${i} was previously reported by suggestion ${previous}. Suggestion messages should be unique within an error.`,
						);
						seenMessageIndices.set(suggestionMessage, i);
					}
				}
			}

			if (typeof item.errors === "number") {
				assert.strictEqual(
					messages.length,
					item.errors,
					util.format(
						"Should have %d error%s but had %d: %s",
						item.errors,
						item.errors === 1 ? "" : "s",
						messages.length,
						util.inspect(messages),
					),
				);
			} else {
				assert.strictEqual(
					messages.length,
					item.errors.length,
					util.format(
						"Should have %d error%s but had %d: %s",
						item.errors.length,
						item.errors.length === 1 ? "" : "s",
						messages.length,
						util.inspect(messages),
					),
				);

				const hasMessageOfThisRule = messages.some(
					m => m.ruleId === ruleId,
				);

				for (let i = 0, l = item.errors.length; i < l; i++) {
					try {
						const error = item.errors[i];
						const message = messages[i];

						assert(
							hasMessageOfThisRule,
							"Error rule name should be the same as the name of the rule being tested",
						);

						if (
							typeof error === "string" ||
							error instanceof RegExp
						) {
							// Just an error message.
							assertMessageMatches(message.message, error);
							assert.ok(
								message.suggestions === void 0,
								`Error at index ${i} has suggestions. Please convert the test error into an object and specify 'suggestions' property on it to test suggestions.`,
							);
						} else if (
							typeof error === "object" &&
							error !== null
						) {
							/*
							 * Error object.
							 * This may have a message, messageId, data, line, and/or column.
							 */

							if (hasOwnProperty(error, "message")) {
								assertMessageMatches(
									message.message,
									error.message,
								);
							} else if (hasOwnProperty(error, "messageId")) {
								assert.ok(
									ruleHasMetaMessages,
									"Error can not use 'messageId' if rule under test doesn't define 'meta.messages'.",
								);
								if (
									!hasOwnProperty(
										rule.meta.messages,
										error.messageId,
									)
								) {
									assert(
										false,
										`Invalid messageId '${error.messageId}'. Expected one of ${friendlyIDList}.`,
									);
								}
								assert.strictEqual(
									message.messageId,
									error.messageId,
									`messageId '${message.messageId}' does not match expected messageId '${error.messageId}'.`,
								);

								const unsubstitutedPlaceholders =
									getUnsubstitutedMessagePlaceholders(
										message.message,
										rule.meta.messages[message.messageId],
										error.data,
									);

								assert.ok(
									unsubstitutedPlaceholders.length === 0,
									`The reported message has ${unsubstitutedPlaceholders.length > 1 ? `unsubstituted placeholders: ${unsubstitutedPlaceholders.map(name => `'${name}'`).join(", ")}` : `an unsubstituted placeholder '${unsubstitutedPlaceholders[0]}'`}. Please provide the missing ${unsubstitutedPlaceholders.length > 1 ? "values" : "value"} via the 'data' property in the context.report() call.`,
								);

								if (hasOwnProperty(error, "data")) {
									/*
									 *  if data was provided, then directly compare the returned message to a synthetic
									 *  interpolated message using the same message ID and data provided in the test.
									 *  See https://github.com/eslint/eslint/issues/9890 for context.
									 */
									const unformattedOriginalMessage =
										rule.meta.messages[error.messageId];
									const rehydratedMessage = interpolate(
										unformattedOriginalMessage,
										error.data,
									);

									assert.strictEqual(
										message.message,
										rehydratedMessage,
										`Hydrated message "${rehydratedMessage}" does not match "${message.message}"`,
									);
								} else {
									const requiresDataProperty =
										requireData === true ||
										requireData === "error";
									const hasPlaceholders =
										getMessagePlaceholders(
											rule.meta.messages[error.messageId],
										).length > 0;
									assert.ok(
										!requiresDataProperty ||
											!hasPlaceholders,
										`Error should specify the 'data' property as the referenced message has placeholders.`,
									);
								}
							}

							const locationProperties = [
								"line",
								"column",
								"endLine",
								"endColumn",
							];
							const actualLocation = {};
							const expectedLocation = {};

							for (const key of locationProperties) {
								if (hasOwnProperty(error, key)) {
									actualLocation[key] = message[key];
									expectedLocation[key] = error[key];
								}
							}

							if (requireLocation) {
								const missingKeys = locationProperties.filter(
									key =>
										!hasOwnProperty(error, key) &&
										hasOwnProperty(message, key),
								);
								assert.ok(
									missingKeys.length === 0,
									`Error is missing expected location properties: ${missingKeys.join(", ")}`,
								);
							}

							if (Object.keys(expectedLocation).length > 0) {
								assert.deepStrictEqual(
									actualLocation,
									expectedLocation,
									"Actual error location does not match expected error location.",
								);
							}

							assert.ok(
								!message.suggestions ||
									hasOwnProperty(error, "suggestions"),
								`Error at index ${i} has suggestions. Please specify 'suggestions' property on the test error object.`,
							);
							if (hasOwnProperty(error, "suggestions")) {
								// Support asserting there are no suggestions
								const expectsSuggestions = Array.isArray(
									error.suggestions,
								)
									? error.suggestions.length > 0
									: Boolean(error.suggestions);
								const hasSuggestions =
									message.suggestions !== void 0;

								if (!hasSuggestions && expectsSuggestions) {
									assert.ok(
										!error.suggestions,
										`Error should have suggestions on error with message: "${message.message}"`,
									);
								} else if (hasSuggestions) {
									assert.ok(
										expectsSuggestions,
										`Error should have no suggestions on error with message: "${message.message}"`,
									);
									if (typeof error.suggestions === "number") {
										assert.strictEqual(
											message.suggestions.length,
											error.suggestions,
											`Error should have ${error.suggestions} suggestions. Instead found ${message.suggestions.length} suggestions`,
										);
									} else if (
										Array.isArray(error.suggestions)
									) {
										assert.strictEqual(
											message.suggestions.length,
											error.suggestions.length,
											`Error should have ${error.suggestions.length} suggestions. Instead found ${message.suggestions.length} suggestions`,
										);

										error.suggestions.forEach(
											(expectedSuggestion, index) => {
												assert.ok(
													typeof expectedSuggestion ===
														"object" &&
														expectedSuggestion !==
															null,
													"Test suggestion in 'suggestions' array must be an object.",
												);
												Object.keys(
													expectedSuggestion,
												).forEach(propertyName => {
													assert.ok(
														suggestionObjectParameters.has(
															propertyName,
														),
														`Invalid suggestion property name '${propertyName}'. Expected one of ${friendlySuggestionObjectParameterList}.`,
													);
												});

												const actualSuggestion =
													message.suggestions[index];
												const suggestionPrefix = `Error Suggestion at index ${index}:`;

												if (
													hasOwnProperty(
														expectedSuggestion,
														"desc",
													)
												) {
													assert.ok(
														!hasOwnProperty(
															expectedSuggestion,
															"data",
														),
														`${suggestionPrefix} Test should not specify both 'desc' and 'data'.`,
													);
													assert.ok(
														!hasOwnProperty(
															expectedSuggestion,
															"messageId",
														),
														`${suggestionPrefix} Test should not specify both 'desc' and 'messageId'.`,
													);
													assert.strictEqual(
														actualSuggestion.desc,
														expectedSuggestion.desc,
														`${suggestionPrefix} desc should be "${expectedSuggestion.desc}" but got "${actualSuggestion.desc}" instead.`,
													);
												} else if (
													hasOwnProperty(
														expectedSuggestion,
														"messageId",
													)
												) {
													assert.ok(
														ruleHasMetaMessages,
														`${suggestionPrefix} Test can not use 'messageId' if rule under test doesn't define 'meta.messages'.`,
													);
													assert.ok(
														hasOwnProperty(
															rule.meta.messages,
															expectedSuggestion.messageId,
														),
														`${suggestionPrefix} Test has invalid messageId '${expectedSuggestion.messageId}', the rule under test allows only one of ${friendlyIDList}.`,
													);
													assert.strictEqual(
														actualSuggestion.messageId,
														expectedSuggestion.messageId,
														`${suggestionPrefix} messageId should be '${expectedSuggestion.messageId}' but got '${actualSuggestion.messageId}' instead.`,
													);

													const rawSuggestionMessage =
														rule.meta.messages[
															expectedSuggestion
																.messageId
														];
													const unsubstitutedPlaceholders =
														getUnsubstitutedMessagePlaceholders(
															actualSuggestion.desc,
															rawSuggestionMessage,
															expectedSuggestion.data,
														);

													assert.ok(
														unsubstitutedPlaceholders.length ===
															0,
														`The message of the suggestion has ${unsubstitutedPlaceholders.length > 1 ? `unsubstituted placeholders: ${unsubstitutedPlaceholders.map(name => `'${name}'`).join(", ")}` : `an unsubstituted placeholder '${unsubstitutedPlaceholders[0]}'`}. Please provide the missing ${unsubstitutedPlaceholders.length > 1 ? "values" : "value"} via the 'data' property for the suggestion in the context.report() call.`,
													);

													if (
														hasOwnProperty(
															expectedSuggestion,
															"data",
														)
													) {
														const unformattedMetaMessage =
															rule.meta.messages[
																expectedSuggestion
																	.messageId
															];
														const rehydratedDesc =
															interpolate(
																unformattedMetaMessage,
																expectedSuggestion.data,
															);

														assert.strictEqual(
															actualSuggestion.desc,
															rehydratedDesc,
															`${suggestionPrefix} Hydrated test desc "${rehydratedDesc}" does not match received desc "${actualSuggestion.desc}".`,
														);
													} else {
														const requiresDataProperty =
															requireData ===
																true ||
															requireData ===
																"suggestion";
														const hasPlaceholders =
															getMessagePlaceholders(
																rawSuggestionMessage,
															).length > 0;
														assert.ok(
															!requiresDataProperty ||
																!hasPlaceholders,
															`${suggestionPrefix} Suggestion should specify the 'data' property as the referenced message has placeholders.`,
														);
													}
												} else if (
													hasOwnProperty(
														expectedSuggestion,
														"data",
													)
												) {
													assert.fail(
														`${suggestionPrefix} Test must specify 'messageId' if 'data' is used.`,
													);
												} else {
													assert.fail(
														`${suggestionPrefix} Test must specify either 'messageId' or 'desc'.`,
													);
												}

												assert.ok(
													hasOwnProperty(
														expectedSuggestion,
														"output",
													),
													`${suggestionPrefix} The "output" property is required.`,
												);
												const codeWithAppliedSuggestion =
													SourceCodeFixer.applyFixes(
														item.code,
														[actualSuggestion],
													).output;

												// Verify if suggestion fix makes a syntax error or not.
												const errorMessageInSuggestion =
													linter
														.verify(
															codeWithAppliedSuggestion,
															result.configs,
															result.filename,
														)
														.find(m => m.fatal);

												assert(
													!errorMessageInSuggestion,
													[
														"A fatal parsing error occurred in suggestion fix.",
														`Error: ${errorMessageInSuggestion && errorMessageInSuggestion.message}`,
														"Suggestion output:",
														codeWithAppliedSuggestion,
													].join("\n"),
												);

												assert.strictEqual(
													codeWithAppliedSuggestion,
													expectedSuggestion.output,
													`Expected the applied suggestion fix to match the test suggestion output for suggestion at index: ${index} on error with message: "${message.message}"`,
												);
												assert.notStrictEqual(
													expectedSuggestion.output,
													item.code,
													`The output of a suggestion should differ from the original source code for suggestion at index: ${index} on error with message: "${message.message}"`,
												);
											},
										);
									} else {
										assert.fail(
											"Test error object property 'suggestions' should be an array or a number",
										);
									}
								}
							}
						}
					} catch (error) {
						if (error instanceof Error) {
							error.errorIndex = i;
						}
						throw error;
					}
				}
			}

			if (hasOwnProperty(item, "output")) {
				if (item.output === null) {
					assert.strictEqual(
						result.output,
						item.code,
						"Expected no autofixes to be suggested",
					);
				} else {
					assert.strictEqual(
						result.output,
						item.output,
						"Output is incorrect.",
					);
					assert.notStrictEqual(
						item.code,
						item.output,
						"Test property 'output' matches 'code'. If no autofix is expected, then omit the 'output' property or set it to null.",
					);
				}
			} else {
				assert.strictEqual(
					result.output,
					item.code,
					"The rule fixed the code. Please add 'output' property.",
				);
			}

			assertASTDidntChange(result.beforeAST, result.afterAST);
		}

		/*
		 * This creates a mocha test suite and pipes all supplied info through
		 * one of the templates above.
		 * The test suites for valid/invalid are created conditionally as
		 * test runners (eg. vitest) fail for empty test suites.
		 */
		this.constructor.describe(ruleName, () => {
			if (test.valid.length > 0) {
				this.constructor.describe("valid", () => {
					const seenTestCases = new Set();
					test.valid.forEach((valid, index) => {
						const item = normalizeTestCase(valid);
						this.constructor[valid.only ? "itOnly" : "it"](
							sanitize(item.name || item.code),
							() => {
								try {
									runHook(item, "before");
									assertValidTestCase(item, seenTestCases);
									testValidTemplate(item);
								} catch (error) {
									if (error instanceof Error) {
										error.scenarioType = "valid";
										error.scenarioIndex = index;
										error.stack = error.stack.replace(
											/^ +at /mu,
											[
												`    roughly at RuleTester.run.valid[${index}] (${estimateTestLocation(`valid[${index}]`)})`,
												`    roughly at RuleTester.run.valid (${estimateTestLocation("valid")})`,
												`    at RuleTester.run (${estimateTestLocation("root")})`,
												"    at ",
											].join("\n"),
										);
									}
									throw error;
								} finally {
									runHook(item, "after");
								}
							},
						);
					});
				});
			}

			if (test.invalid.length > 0) {
				this.constructor.describe("invalid", () => {
					const seenTestCases = new Set();
					test.invalid.forEach((invalid, index) => {
						const item = normalizeTestCase(invalid);
						this.constructor[item.only ? "itOnly" : "it"](
							sanitize(item.name || item.code),
							() => {
								try {
									runHook(item, "before");
									assertInvalidTestCase(
										item,
										seenTestCases,
										ruleName,
										test.assertionOptions,
									);
									testInvalidTemplate(item);
								} catch (error) {
									if (error instanceof Error) {
										error.scenarioType = "invalid";
										error.scenarioIndex = index;
										const errorIndex = error.errorIndex;
										error.stack = error.stack.replace(
											/^ +at /mu,
											[
												...(typeof errorIndex ===
												"number"
													? [
															`    roughly at RuleTester.run.invalid[${index}].error[${errorIndex}] (${estimateTestLocation(`invalid[${index}].errors[${errorIndex}]`)})`,
														]
													: []),
												`    roughly at RuleTester.run.invalid[${index}] (${estimateTestLocation(`invalid[${index}]`)})`,
												`    roughly at RuleTester.run.invalid (${estimateTestLocation("invalid")})`,
												`    at RuleTester.run (${estimateTestLocation("root")})`,
												"    at ",
											].join("\n"),
										);
									}
									throw error;
								} finally {
									runHook(item, "after");
								}
							},
						);
					});
				});
			}
		});
	}
}

RuleTester[DESCRIBE] = RuleTester[IT] = RuleTester[IT_ONLY] = null;

module.exports = RuleTester;
ặx)6100644 accessor-pairs.js Jzrʄ%V0[)100644 array-bracket-newline.js Vz0p[`ty100644 array-bracket-spacing.js ͻ_%w֖fal100644 array-callback-return.js `M:m~vDA[s?/F100644 array-element-newline.js ևˠ|"Qɒֿl100644 arrow-body-style.js r1{[ /p5F(b8<100644 arrow-parens.js 58D5@~8˔v100644 arrow-spacing.js !1g"olK100644 block-scoped-var.js 8a`s㆑\100644 block-spacing.js 'Y#*Iܘo;100644 brace-style.js 8 1n+Ɛ100644 callback-return.js G&O;3C'O100644 camelcase.js ֱ mfOK^O100644 capitalized-comments.js Qy8vb|7100644 class-methods-use-this.js /^29100644 comma-dangle.js <YO4100644 comma-spacing.js AsnXz>U100644 comma-style.js lvVn)3p100644 complexity.js [ViƥԎy9@z؍100644 computed-property-spacing.js }G@?Zcú100644 consistent-return.js =]	FݨFC#100644 consistent-this.js rҙiD.nvβ100644 constructor-super.js "bg}1?T	[100644 curly.js D8!¸`׏100644 default-case-last.js apA`}9:hHd100644 default-case.js #j\8eZ;100644 default-param-last.js QHlc˖100644 dot-location.js %/5pojZVMI;100644 dot-notation.js }hJZ1(gm100644 eol-last.js ICxFi\f^*100644 eqeqeq.js kMc')x"100644 for-direction.js 2J~ӎSDP7=100644 func-call-spacing.js kY6nFqRm100644 func-name-matching.js Aǹ$&AY"Ʊ100644 func-names.js =
 tfn3H;6傝100644 func-style.js `܍&;Ws@|ӌCJ100644 function-call-argument-newline.js 
z\e_oH.E100644 function-paren-newline.js υ#om100644 generator-star-spacing.js ݇zayI100644 getter-return.js (QKqpDJd100644 global-require.js D<ԩ+-Tk100644 grouped-accessor-pairs.js ĬHwN8O100644 guard-for-in.js H@N܅100644 handle-callback-err.js ٰd7in\R`J100644 id-blacklist.js j|E/'\{1100644 id-denylist.js [JDBpLIňB31CF100644 id-length.js ;JZ> ` {m2100644 id-match.js .prQgÖ`X(k#UZ100644 implicit-arrow-linebreak.js -ZzI^[p100644 indent-legacy.js <v~%*CC%a`100644 indent.js :XVIxC_B?w,\S100644 index.js P'lrǹdC100644 init-declarations.js \9f7N Iui|100644 jsx-quotes.js 5:PvWڱxζ100644 key-spacing.js m,O6;W%100644 keyword-spacing.js pnq0m Q100644 line-comment-position.js l@3u#QU^JhqAbgY@100644 linebreak-style.js *=`
N100644 lines-around-comment.js {-
d'Nldu100644 lines-around-directive.js WK3ϗЈg#(100644 lines-between-class-members.js ai\P4vIC,z100644 logical-assignment-operators.js d8 E [z100644 max-classes-per-file.js nh<~|GG-8>100644 max-depth.js ;5ӮmMt:/'100644 max-len.js 
fE- .1'w:ZN100644 max-lines-per-function.js ï%o1Cpo100644 max-lines.js hG EĂpY100644 max-nested-callbacks.js Чر<,[ܵm100644 max-params.js ^Çϧ癿+iel100644 max-statements-per-line.js HOg{=@100644 max-statements.js TX%ѐaE3100644 multiline-comment-style.js F>zsC%?_)[vG}E100644 multiline-ternary.js UE#pV
[100644 new-cap.js 9Uѻb%C100644 new-parens.js ˍ|;M2^Unn5]W100644 newline-after-var.js vґÐ-fSpL100644 newline-before-return.js L1Htǩ100644 newline-per-chained-call.js nf{q|0100644 no-alert.js ѣźxdcu]O100644 no-array-constructor.js )_KN%P100644 no-async-promise-executor.js 4oNMDAe!7Esg100644 no-await-in-loop.js )E%}}kⲮXC100644 no-bitwise.js waP(100644 no-buffer-constructor.js jHW7㻼JUU100644 no-caller.js PyyeoO4ft"100644 no-case-declarations.js lreM100644 no-catch-shadow.js z$Qc~O8[100644 no-class-assign.js diY=/ ]<o>Nn[100644 no-compare-neg-zero.js -g,q:100644 no-cond-assign.js 搦q$1H`w'>'100644 no-confusing-arrow.js >yVqdN100644 no-console.js ͘XHȽ4100644 no-const-assign.js ^l'0Te^X4100644 no-constant-binary-expression.js j:#Au׍6cRv100644 no-constant-condition.js NZ=.tp#MAc2F100644 no-constructor-return.js CH(=oHw100644 no-continue.js fq)UX]vWՐ100644 no-control-regex.js J(sd'100644 no-debugger.js f .T 100644 no-delete-var.js } *Cӯ100644 no-div-regex.js i[> 2]8ؾ.9100644 no-dupe-args.js Eb`jRbsj7lY100644 no-dupe-class-members.js -8f30Y]x7.100644 no-dupe-else-if.js |AڒP>:x100644 no-dupe-keys.js |Cf*r<(>100644 no-duplicate-case.js ys'&1B(100644 no-duplicate-imports.js 
O(G#ʵ5100644 no-else-return.js Tq;`h3"̾|$\100644 no-empty-character-class.js Ѩ˧0v!H(ڑ100644 no-empty-function.js  &xΟ$_100644 no-empty-pattern.js uLj3:/G"100644 no-empty-static-block.js H^&VYߪesܟ&100644 no-empty.js 0zjz^(;5100644 no-eq-null.js ^lf%ҞRM.100644 no-eval.js :0wPfj%SO1100644 no-ex-assign.js bZ[(D'sve100644 no-extend-native.js Ѧ-,؜ 2U2100644 no-extra-bind.js sO@bu4|[ɩ2100644 no-extra-boolean-cast.js *XOr䩣QGF\,y)100644 no-extra-label.js 8:mHjx100644 no-extra-parens.js :г]<2c3#k100644 no-extra-semi.js Uעŭ2yd100644 no-fallthrough.js Z,ys2&}100644 no-floating-decimal.js V'6Vj ~>9(S100644 no-func-assign.js }Klܑ̲l!6ZNk100644 no-global-assign.js o#IUJ d
~Oo$100644 no-implicit-coercion.js gfA\%Iљ"100644 no-implicit-globals.js ͆e3ܗm100644 no-implied-eval.js OSinOI100644 no-import-assign.js &o`<dc100644 no-inline-comments.js 쭶0)NEJ100644 no-inner-declarations.js lIRTDҚ@{%1z100644 no-invalid-regexp.js I CtXMGAQ9100644 no-invalid-this.js Ak(pl]r100644 no-irregular-whitespace.js J&.C_7|~100644 no-iterator.js dQ4d󼮵o1zq100644 no-label-var.js x0egi0=/^100644 no-labels.js ECq* "*Dtˋr100644 no-lone-blocks.js B 4r8h100644 no-lonely-if.js eBG@D톕#P100644 no-loop-func.js BơSқ100644 no-loss-of-precision.js CFN˶rzKQv100644 no-magic-numbers.js -Cs100644 no-misleading-character-class.js "35A+mS38%"\t100644 no-mixed-operators.js szJnbv100644 no-mixed-requires.js Xc4fs֨|U100644 no-mixed-spaces-and-tabs.js gR&C]W?3}100644 no-multi-assign.js ݴkp P<x100644 no-multi-spaces.js pG`a9r6k8;100644 no-multi-str.js BX.1LtRH60"100644 no-multiple-empty-lines.js mrd}Ǵvԑ100644 no-native-reassign.js c'kZսH/-1100644 no-negated-condition.js 3P萝>+v,<Yt{I100644 no-negated-in-lhs.js 0bUu懶VY100644 no-nested-ternary.js ]xIiAČC,X100644 no-new-func.js v@au~٤7O100644 no-new-native-nonconstructor.js 
S~p4&"KqG100644 no-new-object.js ttv$w)ҩ100644 no-new-require.js 	6<Cä7OhmXfM100644 no-new-symbol.js P/U<Oa2X100644 no-new-wrappers.js ]IPL/~o100644 no-new.js [);X2H"rZG 100644 no-nonoctal-decimal-escape.js ЛyOĊ?C7H#100644 no-obj-calls.js TC8@¾G100644 no-object-constructor.js a"~HD/P(100644 no-octal-escape.js [0Gi_ѷ100644 no-octal.js ̑o>&2100644 no-param-reassign.js "
qSǹ100644 no-path-concat.js #
9CWȑ2Ew{MAi100644 no-plusplus.js :B:100644 no-process-env.js 5?y]7kDl¯100644 no-process-exit.js y:chkr1#A100644 no-promise-executor-return.js @k)eu'HvBKR^.J100644 no-proto.js օ	퐺W#JZ100644 no-prototype-builtins.js _ώђ2XȪI100644 no-redeclare.js Op>Oҟ@100644 no-regex-spaces.js q@W1AⰋ!٪u100644 no-restricted-exports.js !$#ɸ}Yڣ100644 no-restricted-globals.js &[wG0iEMέ100644 no-restricted-imports.js -ʦAS}kNHwn4o100644 no-restricted-modules.js j*6DY
100644 no-restricted-properties.js gvŹxz.100644 no-restricted-syntax.js E=/W[/Z
\100644 no-return-assign.js +aaE]n3aM100644 no-return-await.js !b~זr9-}:HT'100644 no-script-url.js c)5I²8!2x=100644 no-self-assign.js :]MD)Ua100644 no-self-compare.js Ӧ\Ovf100644 no-sequences.js N3H$~\rm100644 no-setter-return.js cSlvud0:;ZOge100644 no-shadow-restricted-names.js D6B分_v,u{4 100644 no-shadow.js UʞM<6f\100644 no-spaced-func.js }`Qu2-᎒	o100644 no-sparse-arrays.js >	4Rw100644 no-sync.js P~.u0r100644 no-tabs.js _MЛ2If^)Hd}100644 no-template-curly-in-string.js gDr#eF$Q100644 no-ternary.js 6PۡEi/Vm100644 no-this-before-super.js 'qZA!W!100644 no-throw-literal.js 4v_%(ŕlx100644 no-trailing-spaces.js m7||R%vߣv)100644 no-unassigned-vars.js $;?xz`/F:100644 no-undef-init.js w >,|]!X{100644 no-undef.js ڇs0t:eT8ۺ$}!U100644 no-undefined.js (}"Ow100644 no-underscore-dangle.js $#p)Cn0c100644 no-unexpected-multiline.js ʎ{v)$2_100644 no-unmodified-loop-condition.js YqVk4100644 no-unneeded-ternary.js $[g|f7100644 no-unreachable-loop.js MYɺk>$fJ100644 no-unreachable.js 2WoZLU100644 no-unsafe-finally.js LcRh0100644 no-unsafe-negation.js 'h✩5 @lPcxo100644 no-unsafe-optional-chaining.js [~u87lLds|U100644 no-unused-expressions.js &+O8]]x
>z100644 no-unused-labels.js >Btwµ{G	100644 no-unused-private-class-members.js ?2if\!:100644 no-unused-vars.js 3::F#ܩZ100644 no-use-before-define.js lK*qb_^-9100644 no-useless-assignment.js ̡Rф(C؆100644 no-useless-backreference.js swwU{F-"˗100644 no-useless-call.js *)	"k5[Hw100644 no-useless-catch.js 0X100644 no-useless-computed-key.js <ag!kcR 100644 no-useless-concat.js n ۂmہbÔ<100644 no-useless-constructor.js tQ83 }Jf,Yz100644 no-useless-escape.js HQYw:HCޏ100644 no-useless-rename.js hadz W#"A100644 no-useless-return.js 8V=x<y>e;^l100644 no-var.js 9۲,>S6ʋQB100644 no-void.js ~<~N`;Cӛϒ100644 no-warning-comments.js |6gjL3L100644 no-whitespace-before-property.js }Ϙx`{EO:100644 no-with.js F{Kb100644 nonblock-statement-body-position.js c͒Ar,HX3100644 object-curly-newline.js `ӓn>9bb ]100644 object-curly-spacing.js C(Z100644 object-property-newline.js i!H1iGUٗf	100644 object-shorthand.js I;:RI&j100644 one-var-declaration-per-line.js 6qr+/7100644 one-var.js BA550=07100644 operator-assignment.js P2zv100644 operator-linebreak.js ol\{m%1˷100644 padded-blocks.js -Os^ղ:W100644 padding-line-between-statements.js BWrۛ?,100644 prefer-arrow-callback.js .pl?Tm@G100644 prefer-const.js WϷIm?/#7 h
100644 prefer-destructuring.js 	:՝7Lٻ100644 prefer-exponentiation-operator.js an	 O=pr100644 prefer-named-capture-group.js `(w1gے4Q100644 prefer-numeric-literals.js PzM|:100644 prefer-object-has-own.js 0\q
tIN_100644 prefer-object-spread.js ؋Gڦ1Dʀ100644 prefer-promise-reject-errors.js yρ`rpC@`R100644 prefer-reflect.js N"/:
|&l100644 prefer-regex-literals.js AM^XWFŅ100644 prefer-rest-params.js 36]UwvZQq100644 prefer-spread.js w£k@b>a0100644 prefer-template.js R#&P_iqCX100644 preserve-caught-error.js 3d@~[[|SA15100644 quote-props.js \woV5
fa4t100644 quotes.js 0&pqYF3k-100644 radix.js JQ5lXy gଊ100644 require-atomic-updates.js Ó\ʇ S%ws%G100644 require-await.js 6VΘohy!m100644 require-unicode-regexp.js w=iK100644 require-yield.js  &j0ot%?RASݙ5100644 rest-spread-spacing.js `b K@Lpk`F100644 semi-spacing.js M xkEXWղb100644 semi-style.js C.(o6wٱ%100644 semi.js ҍpm
vHR100644 sort-imports.js ?SF!e4100644 sort-keys.js +ksZ%(aQ100644 sort-vars.js 4Yyj5%,100644 space-before-blocks.js RJH*S=sXXP100644 space-before-function-paren.js *UU C]a~,100644 space-in-parens.js ޮ)f`>gY9"W100644 space-infix-ops.js K/a%	=t祙>100644 space-unary-ops.js XqGA*$Aoa100644 spaced-comment.js *.զM\[100644 strict.js z!` dBى100644 switch-colon-spacing.js F 2bPAd100644 symbol-description.js Lv6MH`100644 template-curly-spacing.js %'LfJ[T100644 template-tag-spacing.js V=1> ]ʤO100644 unicode-bom.js {D,UOfX&100644 use-isnan.js {Ux5mF-1UP840000 utils bnPګ100644 valid-typeof.js O= Hobo100644 vars-on-top.js ǐ̽\u:xg<־w100644 wrap-iife.js ;:7K`!1: (100644 wrap-regex.js pT櫯f,`4k100644 yield-star-spacing.js gT8Ϯ#m.100644 yoda.js G	bpPkގx+5/**
 * @fileoverview Rule to enforce getter and setter pairs in objects and classes.
 * @author Gyandeep Singh
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------

/**
 * Property name if it can be computed statically, otherwise the list of the tokens of the key node.
 * @typedef {string|Token[]} Key
 */

/**
 * Accessor nodes with the same key.
 * @typedef {Object} AccessorData
 * @property {Key} key Accessor's key
 * @property {ASTNode[]} getters List of getter nodes.
 * @property {ASTNode[]} setters List of setter nodes.
 */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Checks whether or not the given lists represent the equal tokens in the same order.
 * Tokens are compared by their properties, not by instance.
 * @param {Token[]} left First list of tokens.
 * @param {Token[]} right Second list of tokens.
 * @returns {boolean} `true` if the lists have same tokens.
 */
function areEqualTokenLists(left, right) {
	if (left.length !== right.length) {
		return false;
	}

	for (let i = 0; i < left.length; i++) {
		const leftToken = left[i],
			rightToken = right[i];

		if (
			leftToken.type !== rightToken.type ||
			leftToken.value !== rightToken.value
		) {
			return false;
		}
	}

	return true;
}

/**
 * Checks whether or not the given keys are equal.
 * @param {Key} left First key.
 * @param {Key} right Second key.
 * @returns {boolean} `true` if the keys are equal.
 */
function areEqualKeys(left, right) {
	if (typeof left === "string" && typeof right === "string") {
		// Statically computed names.
		return left === right;
	}
	if (Array.isArray(left) && Array.isArray(right)) {
		// Token lists.
		return areEqualTokenLists(left, right);
	}

	return false;
}

/**
 * Checks whether or not a given node is of an accessor kind ('get' or 'set').
 * @param {ASTNode} node A node to check.
 * @returns {boolean} `true` if the node is of an accessor kind.
 */
function isAccessorKind(node) {
	return node.kind === "get" || node.kind === "set";
}

/**
 * Checks whether or not a given node is an argument of a specified method call.
 * @param {ASTNode} node A node to check.
 * @param {number} index An expected index of the node in arguments.
 * @param {string} object An expected name of the object of the method.
 * @param {string} property An expected name of the method.
 * @returns {boolean} `true` if the node is an argument of the specified method call.
 */
function isArgumentOfMethodCall(node, index, object, property) {
	const parent = node.parent;

	return (
		parent.type === "CallExpression" &&
		astUtils.isSpecificMemberAccess(parent.callee, object, property) &&
		parent.arguments[index] === node
	);
}

/**
 * Checks whether or not a given node is a property descriptor.
 * @param {ASTNode} node A node to check.
 * @returns {boolean} `true` if the node is a property descriptor.
 */
function isPropertyDescriptor(node) {
	// Object.defineProperty(obj, "foo", {set: ...})
	if (
		isArgumentOfMethodCall(node, 2, "Object", "defineProperty") ||
		isArgumentOfMethodCall(node, 2, "Reflect", "defineProperty")
	) {
		return true;
	}

	/*
	 * Object.defineProperties(obj, {foo: {set: ...}})
	 * Object.create(proto, {foo: {set: ...}})
	 */
	const grandparent = node.parent.parent;

	return (
		grandparent.type === "ObjectExpression" &&
		(isArgumentOfMethodCall(grandparent, 1, "Object", "create") ||
			isArgumentOfMethodCall(
				grandparent,
				1,
				"Object",
				"defineProperties",
			))
	);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				enforceForTSTypes: false,
				enforceForClassMembers: true,
				getWithoutSet: false,
				setWithoutGet: true,
			},
		],

		docs: {
			description:
				"Enforce getter and setter pairs in objects and classes",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/accessor-pairs",
		},

		schema: [
			{
				type: "object",
				properties: {
					getWithoutSet: {
						type: "boolean",
					},
					setWithoutGet: {
						type: "boolean",
					},
					enforceForClassMembers: {
						type: "boolean",
					},
					enforceForTSTypes: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			missingGetterInPropertyDescriptor:
				"Getter is not present in property descriptor.",
			missingSetterInPropertyDescriptor:
				"Setter is not present in property descriptor.",
			missingGetterInObjectLiteral:
				"Getter is not present for {{ name }}.",
			missingSetterInObjectLiteral:
				"Setter is not present for {{ name }}.",
			missingGetterInClass: "Getter is not present for class {{ name }}.",
			missingSetterInClass: "Setter is not present for class {{ name }}.",
			missingGetterInType: "Getter is not present for type {{ name }}.",
			missingSetterInType: "Setter is not present for type {{ name }}.",
		},
	},
	create(context) {
		const [
			{
				getWithoutSet: checkGetWithoutSet,
				setWithoutGet: checkSetWithoutGet,
				enforceForClassMembers,
				enforceForTSTypes,
			},
		] = context.options;
		const sourceCode = context.sourceCode;

		/**
		 * Reports the given node.
		 * @param {ASTNode} node The node to report.
		 * @param {string} messageKind "missingGetter" or "missingSetter".
		 * @returns {void}
		 * @private
		 */
		function report(node, messageKind) {
			if (node.type === "Property") {
				context.report({
					node,
					messageId: `${messageKind}InObjectLiteral`,
					loc: astUtils.getFunctionHeadLoc(node.value, sourceCode),
					data: {
						name: astUtils.getFunctionNameWithKind(node.value),
					},
				});
			} else if (node.type === "MethodDefinition") {
				context.report({
					node,
					messageId: `${messageKind}InClass`,
					loc: astUtils.getFunctionHeadLoc(node.value, sourceCode),
					data: {
						name: astUtils.getFunctionNameWithKind(node.value),
					},
				});
			} else if (node.type === "TSMethodSignature") {
				context.report({
					node,
					messageId: `${messageKind}InType`,
					loc: astUtils.getFunctionHeadLoc(node, sourceCode),
					data: {
						name: astUtils.getFunctionNameWithKind(node),
					},
				});
			} else {
				context.report({
					node,
					messageId: `${messageKind}InPropertyDescriptor`,
				});
			}
		}

		/**
		 * Reports each of the nodes in the given list using the same messageId.
		 * @param {ASTNode[]} nodes Nodes to report.
		 * @param {string} messageKind "missingGetter" or "missingSetter".
		 * @returns {void}
		 * @private
		 */
		function reportList(nodes, messageKind) {
			for (const node of nodes) {
				report(node, messageKind);
			}
		}

		/**
		 * Checks accessor pairs in the given list of nodes.
		 * @param {ASTNode[]} nodes The list to check.
		 * @returns {void}
		 * @private
		 */
		function checkList(nodes) {
			const accessors = [];
			let found = false;

			for (let i = 0; i < nodes.length; i++) {
				const node = nodes[i];

				if (isAccessorKind(node)) {
					// Creates a new `AccessorData` object for the given getter or setter node.
					const name = astUtils.getStaticPropertyName(node);
					const key =
						name !== null ? name : sourceCode.getTokens(node.key);

					// Merges the given `AccessorData` object into the given accessors list.
					for (let j = 0; j < accessors.length; j++) {
						const accessor = accessors[j];

						if (areEqualKeys(accessor.key, key)) {
							accessor.getters.push(
								...(node.kind === "get" ? [node] : []),
							);
							accessor.setters.push(
								...(node.kind === "set" ? [node] : []),
							);
							found = true;
							break;
						}
					}
					if (!found) {
						accessors.push({
							key,
							getters: node.kind === "get" ? [node] : [],
							setters: node.kind === "set" ? [node] : [],
						});
					}
					found = false;
				}
			}

			for (const { getters, setters } of accessors) {
				if (checkSetWithoutGet && setters.length && !getters.length) {
					reportList(setters, "missingGetter");
				}
				if (checkGetWithoutSet && getters.length && !setters.length) {
					reportList(getters, "missingSetter");
				}
			}
		}

		/**
		 * Checks accessor pairs in an object literal.
		 * @param {ASTNode} node `ObjectExpression` node to check.
		 * @returns {void}
		 * @private
		 */
		function checkObjectLiteral(node) {
			checkList(node.properties.filter(p => p.type === "Property"));
		}

		/**
		 * Checks accessor pairs in a property descriptor.
		 * @param {ASTNode} node Property descriptor `ObjectExpression` node to check.
		 * @returns {void}
		 * @private
		 */
		function checkPropertyDescriptor(node) {
			const namesToCheck = new Set(
				node.properties
					.filter(
						p =>
							p.type === "Property" &&
							p.kind === "init" &&
							!p.computed,
					)
					.map(({ key }) => key.name),
			);

			const hasGetter = namesToCheck.has("get");
			const hasSetter = namesToCheck.has("set");

			if (checkSetWithoutGet && hasSetter && !hasGetter) {
				report(node, "missingGetter");
			}
			if (checkGetWithoutSet && hasGetter && !hasSetter) {
				report(node, "missingSetter");
			}
		}

		/**
		 * Checks the given object expression as an object literal and as a possible property descriptor.
		 * @param {ASTNode} node `ObjectExpression` node to check.
		 * @returns {void}
		 * @private
		 */
		function checkObjectExpression(node) {
			checkObjectLiteral(node);
			if (isPropertyDescriptor(node)) {
				checkPropertyDescriptor(node);
			}
		}

		/**
		 * Checks the given class body.
		 * @param {ASTNode} node `ClassBody` node to check.
		 * @returns {void}
		 * @private
		 */
		function checkClassBody(node) {
			const methodDefinitions = node.body.filter(
				m => m.type === "MethodDefinition",
			);

			checkList(methodDefinitions.filter(m => m.static));
			checkList(methodDefinitions.filter(m => !m.static));
		}

		/**
		 * Checks the given type.
		 * @param {ASTNode} node `TSTypeLiteral` or `TSInterfaceBody` node to check.
		 * @returns {void}
		 * @private
		 */
		function checkType(node) {
			const members =
				node.type === "TSTypeLiteral" ? node.members : node.body;
			const methodDefinitions = members.filter(
				m => m.type === "TSMethodSignature",
			);

			checkList(methodDefinitions);
		}

		const listeners = {};

		if (checkSetWithoutGet || checkGetWithoutSet) {
			listeners.ObjectExpression = checkObjectExpression;
			if (enforceForClassMembers) {
				listeners.ClassBody = checkClassBody;
			}
			if (enforceForTSTypes) {
				listeners["TSTypeLiteral, TSInterfaceBody"] = checkType;
			}
		}

		return listeners;
	},
};
`]xD/**
 * @fileoverview Rule to enforce linebreaks after open and before close array brackets
 * @author Jan Peer Stöcklmair <https://github.com/JPeer264>
 * @deprecated in ESLint v8.53.0
 */

"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "array-bracket-newline",
						url: "https://eslint.style/rules/array-bracket-newline",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description:
				"Enforce linebreaks after opening and before closing array brackets",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/array-bracket-newline",
		},

		fixable: "whitespace",

		schema: [
			{
				oneOf: [
					{
						enum: ["always", "never", "consistent"],
					},
					{
						type: "object",
						properties: {
							multiline: {
								type: "boolean",
							},
							minItems: {
								type: ["integer", "null"],
								minimum: 0,
							},
						},
						additionalProperties: false,
					},
				],
			},
		],

		messages: {
			unexpectedOpeningLinebreak:
				"There should be no linebreak after '['.",
			unexpectedClosingLinebreak:
				"There should be no linebreak before ']'.",
			missingOpeningLinebreak: "A linebreak is required after '['.",
			missingClosingLinebreak: "A linebreak is required before ']'.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		//----------------------------------------------------------------------
		// Helpers
		//----------------------------------------------------------------------

		/**
		 * Normalizes a given option value.
		 * @param {string|Object|undefined} option An option value to parse.
		 * @returns {{multiline: boolean, minItems: number}} Normalized option object.
		 */
		function normalizeOptionValue(option) {
			let consistent = false;
			let multiline = false;
			let minItems;

			if (option) {
				if (option === "consistent") {
					consistent = true;
					minItems = Number.POSITIVE_INFINITY;
				} else if (option === "always" || option.minItems === 0) {
					minItems = 0;
				} else if (option === "never") {
					minItems = Number.POSITIVE_INFINITY;
				} else {
					multiline = Boolean(option.multiline);
					minItems = option.minItems || Number.POSITIVE_INFINITY;
				}
			} else {
				consistent = false;
				multiline = true;
				minItems = Number.POSITIVE_INFINITY;
			}

			return { consistent, multiline, minItems };
		}

		/**
		 * Normalizes a given option value.
		 * @param {string|Object|undefined} options An option value to parse.
		 * @returns {{ArrayExpression: {multiline: boolean, minItems: number}, ArrayPattern: {multiline: boolean, minItems: number}}} Normalized option object.
		 */
		function normalizeOptions(options) {
			const value = normalizeOptionValue(options);

			return { ArrayExpression: value, ArrayPattern: value };
		}

		/**
		 * Reports that there shouldn't be a linebreak after the first token
		 * @param {ASTNode} node The node to report in the event of an error.
		 * @param {Token} token The token to use for the report.
		 * @returns {void}
		 */
		function reportNoBeginningLinebreak(node, token) {
			context.report({
				node,
				loc: token.loc,
				messageId: "unexpectedOpeningLinebreak",
				fix(fixer) {
					const nextToken = sourceCode.getTokenAfter(token, {
						includeComments: true,
					});

					if (astUtils.isCommentToken(nextToken)) {
						return null;
					}

					return fixer.removeRange([
						token.range[1],
						nextToken.range[0],
					]);
				},
			});
		}

		/**
		 * Reports that there shouldn't be a linebreak before the last token
		 * @param {ASTNode} node The node to report in the event of an error.
		 * @param {Token} token The token to use for the report.
		 * @returns {void}
		 */
		function reportNoEndingLinebreak(node, token) {
			context.report({
				node,
				loc: token.loc,
				messageId: "unexpectedClosingLinebreak",
				fix(fixer) {
					const previousToken = sourceCode.getTokenBefore(token, {
						includeComments: true,
					});

					if (astUtils.isCommentToken(previousToken)) {
						return null;
					}

					return fixer.removeRange([
						previousToken.range[1],
						token.range[0],
					]);
				},
			});
		}

		/**
		 * Reports that there should be a linebreak after the first token
		 * @param {ASTNode} node The node to report in the event of an error.
		 * @param {Token} token The token to use for the report.
		 * @returns {void}
		 */
		function reportRequiredBeginningLinebreak(node, token) {
			context.report({
				node,
				loc: token.loc,
				messageId: "missingOpeningLinebreak",
				fix(fixer) {
					return fixer.insertTextAfter(token, "\n");
				},
			});
		}

		/**
		 * Reports that there should be a linebreak before the last token
		 * @param {ASTNode} node The node to report in the event of an error.
		 * @param {Token} token The token to use for the report.
		 * @returns {void}
		 */
		function reportRequiredEndingLinebreak(node, token) {
			context.report({
				node,
				loc: token.loc,
				messageId: "missingClosingLinebreak",
				fix(fixer) {
					return fixer.insertTextBefore(token, "\n");
				},
			});
		}

		/**
		 * Reports a given node if it violated this rule.
		 * @param {ASTNode} node A node to check. This is an ArrayExpression node or an ArrayPattern node.
		 * @returns {void}
		 */
		function check(node) {
			const elements = node.elements;
			const normalizedOptions = normalizeOptions(context.options[0]);
			const options = normalizedOptions[node.type];
			const openBracket = sourceCode.getFirstToken(node);
			const closeBracket = sourceCode.getLastToken(node);
			const firstIncComment = sourceCode.getTokenAfter(openBracket, {
				includeComments: true,
			});
			const lastIncComment = sourceCode.getTokenBefore(closeBracket, {
				includeComments: true,
			});
			const first = sourceCode.getTokenAfter(openBracket);
			const last = sourceCode.getTokenBefore(closeBracket);

			const needsLinebreaks =
				elements.length >= options.minItems ||
				(options.multiline &&
					elements.length > 0 &&
					firstIncComment.loc.start.line !==
						lastIncComment.loc.end.line) ||
				(elements.length === 0 &&
					firstIncComment.type === "Block" &&
					firstIncComment.loc.start.line !==
						lastIncComment.loc.end.line &&
					firstIncComment === lastIncComment) ||
				(options.consistent &&
					openBracket.loc.end.line !== first.loc.start.line);

			/*
			 * Use tokens or comments to check multiline or not.
			 * But use only tokens to check whether linebreaks are needed.
			 * This allows:
			 *     var arr = [ // eslint-disable-line foo
			 *         'a'
			 *     ]
			 */

			if (needsLinebreaks) {
				if (astUtils.isTokenOnSameLine(openBracket, first)) {
					reportRequiredBeginningLinebreak(node, openBracket);
				}
				if (astUtils.isTokenOnSameLine(last, closeBracket)) {
					reportRequiredEndingLinebreak(node, closeBracket);
				}
			} else {
				if (!astUtils.isTokenOnSameLine(openBracket, first)) {
					reportNoBeginningLinebreak(node, openBracket);
				}
				if (!astUtils.isTokenOnSameLine(last, closeBracket)) {
					reportNoEndingLinebreak(node, closeBracket);
				}
			}
		}

		//----------------------------------------------------------------------
		// Public
		//----------------------------------------------------------------------

		return {
			ArrayPattern: check,
			ArrayExpression: check,
		};
	},
};
vxo/**
 * @fileoverview Disallows or enforces spaces inside of array brackets.
 * @author Jamund Ferguson
 * @deprecated in ESLint v8.53.0
 */
"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "array-bracket-spacing",
						url: "https://eslint.style/rules/array-bracket-spacing",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Enforce consistent spacing inside array brackets",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/array-bracket-spacing",
		},

		fixable: "whitespace",

		schema: [
			{
				enum: ["always", "never"],
			},
			{
				type: "object",
				properties: {
					singleValue: {
						type: "boolean",
					},
					objectsInArrays: {
						type: "boolean",
					},
					arraysInArrays: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			unexpectedSpaceAfter:
				"There should be no space after '{{tokenValue}}'.",
			unexpectedSpaceBefore:
				"There should be no space before '{{tokenValue}}'.",
			missingSpaceAfter: "A space is required after '{{tokenValue}}'.",
			missingSpaceBefore: "A space is required before '{{tokenValue}}'.",
		},
	},
	create(context) {
		const spaced = context.options[0] === "always",
			sourceCode = context.sourceCode;

		/**
		 * Determines whether an option is set, relative to the spacing option.
		 * If spaced is "always", then check whether option is set to false.
		 * If spaced is "never", then check whether option is set to true.
		 * @param {Object} option The option to exclude.
		 * @returns {boolean} Whether or not the property is excluded.
		 */
		function isOptionSet(option) {
			return context.options[1]
				? context.options[1][option] === !spaced
				: false;
		}

		const options = {
			spaced,
			singleElementException: isOptionSet("singleValue"),
			objectsInArraysException: isOptionSet("objectsInArrays"),
			arraysInArraysException: isOptionSet("arraysInArrays"),
		};

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Reports that there shouldn't be a space after the first token
		 * @param {ASTNode} node The node to report in the event of an error.
		 * @param {Token} token The token to use for the report.
		 * @returns {void}
		 */
		function reportNoBeginningSpace(node, token) {
			const nextToken = sourceCode.getTokenAfter(token);

			context.report({
				node,
				loc: { start: token.loc.end, end: nextToken.loc.start },
				messageId: "unexpectedSpaceAfter",
				data: {
					tokenValue: token.value,
				},
				fix(fixer) {
					return fixer.removeRange([
						token.range[1],
						nextToken.range[0],
					]);
				},
			});
		}

		/**
		 * Reports that there shouldn't be a space before the last token
		 * @param {ASTNode} node The node to report in the event of an error.
		 * @param {Token} token The token to use for the report.
		 * @returns {void}
		 */
		function reportNoEndingSpace(node, token) {
			const previousToken = sourceCode.getTokenBefore(token);

			context.report({
				node,
				loc: { start: previousToken.loc.end, end: token.loc.start },
				messageId: "unexpectedSpaceBefore",
				data: {
					tokenValue: token.value,
				},
				fix(fixer) {
					return fixer.removeRange([
						previousToken.range[1],
						token.range[0],
					]);
				},
			});
		}

		/**
		 * Reports that there should be a space after the first token
		 * @param {ASTNode} node The node to report in the event of an error.
		 * @param {Token} token The token to use for the report.
		 * @returns {void}
		 */
		function reportRequiredBeginningSpace(node, token) {
			context.report({
				node,
				loc: token.loc,
				messageId: "missingSpaceAfter",
				data: {
					tokenValue: token.value,
				},
				fix(fixer) {
					return fixer.insertTextAfter(token, " ");
				},
			});
		}

		/**
		 * Reports that there should be a space before the last token
		 * @param {ASTNode} node The node to report in the event of an error.
		 * @param {Token} token The token to use for the report.
		 * @returns {void}
		 */
		function reportRequiredEndingSpace(node, token) {
			context.report({
				node,
				loc: token.loc,
				messageId: "missingSpaceBefore",
				data: {
					tokenValue: token.value,
				},
				fix(fixer) {
					return fixer.insertTextBefore(token, " ");
				},
			});
		}

		/**
		 * Determines if a node is an object type
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} Whether or not the node is an object type.
		 */
		function isObjectType(node) {
			return (
				node &&
				(node.type === "ObjectExpression" ||
					node.type === "ObjectPattern")
			);
		}

		/**
		 * Determines if a node is an array type
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} Whether or not the node is an array type.
		 */
		function isArrayType(node) {
			return (
				node &&
				(node.type === "ArrayExpression" ||
					node.type === "ArrayPattern")
			);
		}

		/**
		 * Validates the spacing around array brackets
		 * @param {ASTNode} node The node we're checking for spacing
		 * @returns {void}
		 */
		function validateArraySpacing(node) {
			if (options.spaced && node.elements.length === 0) {
				return;
			}

			const first = sourceCode.getFirstToken(node),
				second = sourceCode.getFirstToken(node, 1),
				last = node.typeAnnotation
					? sourceCode.getTokenBefore(node.typeAnnotation)
					: sourceCode.getLastToken(node),
				penultimate = sourceCode.getTokenBefore(last),
				firstElement = node.elements[0],
				lastElement = node.elements.at(-1);

			const openingBracketMustBeSpaced =
				(options.objectsInArraysException &&
					isObjectType(firstElement)) ||
				(options.arraysInArraysException &&
					isArrayType(firstElement)) ||
				(options.singleElementException && node.elements.length === 1)
					? !options.spaced
					: options.spaced;

			const closingBracketMustBeSpaced =
				(options.objectsInArraysException &&
					isObjectType(lastElement)) ||
				(options.arraysInArraysException && isArrayType(lastElement)) ||
				(options.singleElementException && node.elements.length === 1)
					? !options.spaced
					: options.spaced;

			if (astUtils.isTokenOnSameLine(first, second)) {
				if (
					openingBracketMustBeSpaced &&
					!sourceCode.isSpaceBetween(first, second)
				) {
					reportRequiredBeginningSpace(node, first);
				}
				if (
					!openingBracketMustBeSpaced &&
					sourceCode.isSpaceBetween(first, second)
				) {
					reportNoBeginningSpace(node, first);
				}
			}

			if (
				first !== penultimate &&
				astUtils.isTokenOnSameLine(penultimate, last)
			) {
				if (
					closingBracketMustBeSpaced &&
					!sourceCode.isSpaceBetween(penultimate, last)
				) {
					reportRequiredEndingSpace(node, last);
				}
				if (
					!closingBracketMustBeSpaced &&
					sourceCode.isSpaceBetween(penultimate, last)
				) {
					reportNoEndingSpace(node, last);
				}
			}
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			ArrayPattern: validateArraySpacing,
			ArrayExpression: validateArraySpacing,
		};
	},
};
+vQx2y/**
 * @fileoverview Rule to enforce return statements in callbacks of array's methods
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");
const { isAnySegmentReachable } = require("./utils/code-path-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const TARGET_NODE_TYPE = /^(?:Arrow)?FunctionExpression$/u;
const TARGET_METHODS =
	/^(?:every|filter|find(?:Last)?(?:Index)?|flatMap|forEach|map|reduce(?:Right)?|some|sort|toSorted)$/u;

/**
 * Checks a given node is a member access which has the specified name's
 * property.
 * @param {ASTNode} node A node to check.
 * @returns {boolean} `true` if the node is a member access which has
 *      the specified name's property. The node may be a `(Chain|Member)Expression` node.
 */
function isTargetMethod(node) {
	return astUtils.isSpecificMemberAccess(node, null, TARGET_METHODS);
}

/**
 * Returns a human-legible description of an array method
 * @param {string} arrayMethodName A method name to fully qualify
 * @returns {string} the method name prefixed with `Array.` if it is a class method,
 *      or else `Array.prototype.` if it is an instance method.
 */
function fullMethodName(arrayMethodName) {
	if (["from", "fromAsync", "of", "isArray"].includes(arrayMethodName)) {
		return "Array.".concat(arrayMethodName);
	}
	return "Array.prototype.".concat(arrayMethodName);
}

/**
 * Checks whether or not a given node is a function expression which is the
 * callback of an array method, returning the method name.
 * Generators are excluded. Async functions are allowed only for `Array.fromAsync`.
 * @param {ASTNode} node A node to check. This is one of
 *      FunctionExpression or ArrowFunctionExpression.
 * @returns {string} The method name if the node is a callback method,
 *      null otherwise.
 */
function getArrayMethodName(node) {
	// Generators are not checked for any methods.
	if (node.generator) {
		return null;
	}
	let currentNode = node;

	while (currentNode) {
		const parent = currentNode.parent;

		switch (parent.type) {
			/*
			 * Looks up the destination. e.g.,
			 * foo.every(nativeFoo || function foo() { ... });
			 */
			case "LogicalExpression":
			case "ConditionalExpression":
			case "ChainExpression":
				currentNode = parent;
				break;

			/*
			 * If the upper function is IIFE, checks the destination of the return value.
			 * e.g.
			 *   foo.every((function() {
			 *     // setup...
			 *     return function callback() { ... };
			 *   })());
			 */
			case "ReturnStatement": {
				const func = astUtils.getUpperFunction(parent);

				if (func === null || !astUtils.isCallee(func)) {
					return null;
				}
				currentNode = func.parent;
				break;
			}

			/*
			 * e.g.
			 *   Array.from([], function() {});
			 *   list.every(function() {});
			 */
			case "CallExpression":
				if (!node.async) {
					if (astUtils.isArrayFromMethod(parent.callee)) {
						if (
							parent.arguments.length >= 2 &&
							parent.arguments[1] === currentNode
						) {
							return "from";
						}
					}
					if (isTargetMethod(parent.callee)) {
						if (
							parent.arguments.length >= 1 &&
							parent.arguments[0] === currentNode
						) {
							return astUtils.getStaticPropertyName(
								parent.callee,
							);
						}
					}
				}
				if (astUtils.isArrayFromAsyncMethod(parent.callee)) {
					if (
						parent.arguments.length >= 2 &&
						parent.arguments[1] === currentNode
					) {
						return "fromAsync";
					}
				}
				return null;

			// Otherwise this node is not target.
			default:
				return null;
		}
	}

	/* c8 ignore next */
	return null;
}

/**
 * Checks if the given node is a void expression.
 * @param {ASTNode} node The node to check.
 * @returns {boolean} - `true` if the node is a void expression
 */
function isExpressionVoid(node) {
	return node.type === "UnaryExpression" && node.operator === "void";
}

/**
 * Fixes the linting error by prepending "void " to the given node
 * @param {Object} sourceCode context given by context.sourceCode
 * @param {ASTNode} node The node to fix.
 * @param {Object} fixer The fixer object provided by ESLint.
 * @returns {Array<Object>} - An array of fix objects to apply to the node.
 */
function voidPrependFixer(sourceCode, node, fixer) {
	const requiresParens =
		// prepending `void ` will fail if the node has a lower precedence than void
		astUtils.getPrecedence(node) <
			astUtils.getPrecedence({
				type: "UnaryExpression",
				operator: "void",
			}) &&
		// check if there are parentheses around the node to avoid redundant parentheses
		!astUtils.isParenthesised(sourceCode, node);

	// avoid parentheses issues
	const returnOrArrowToken = sourceCode.getTokenBefore(
		node,
		node.parent.type === "ArrowFunctionExpression"
			? astUtils.isArrowToken
			: // isReturnToken
				token => token.type === "Keyword" && token.value === "return",
	);

	const firstToken = sourceCode.getTokenAfter(returnOrArrowToken);

	const prependSpace =
		// is return token, as => allows void to be adjacent
		returnOrArrowToken.value === "return" &&
		// If two tokens (return and "(") are adjacent
		returnOrArrowToken.range[1] === firstToken.range[0];

	return [
		fixer.insertTextBefore(
			firstToken,
			`${prependSpace ? " " : ""}void ${requiresParens ? "(" : ""}`,
		),
		fixer.insertTextAfter(node, requiresParens ? ")" : ""),
	];
}

/**
 * Fixes the linting error by `wrapping {}` around the given node's body.
 * @param {Object} sourceCode context given by context.sourceCode
 * @param {ASTNode} node The node to fix.
 * @param {Object} fixer The fixer object provided by ESLint.
 * @returns {Array<Object>} - An array of fix objects to apply to the node.
 */
function curlyWrapFixer(sourceCode, node, fixer) {
	const arrowToken = sourceCode.getTokenBefore(
		node.body,
		astUtils.isArrowToken,
	);
	const firstToken = sourceCode.getTokenAfter(arrowToken);
	const lastToken = sourceCode.getLastToken(node);

	return [
		fixer.insertTextBefore(firstToken, "{"),
		fixer.insertTextAfter(lastToken, "}"),
	];
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		defaultOptions: [
			{
				allowImplicit: false,
				checkForEach: false,
				allowVoid: false,
			},
		],

		docs: {
			description:
				"Enforce `return` statements in callbacks of array methods",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/array-callback-return",
		},

		hasSuggestions: true,

		schema: [
			{
				type: "object",
				properties: {
					allowImplicit: {
						type: "boolean",
					},
					checkForEach: {
						type: "boolean",
					},
					allowVoid: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			expectedAtEnd:
				"{{arrayMethodName}}() expects a value to be returned at the end of {{name}}.",
			expectedInside:
				"{{arrayMethodName}}() expects a return value from {{name}}.",
			expectedReturnValue:
				"{{arrayMethodName}}() expects a return value from {{name}}.",
			expectedNoReturnValue:
				"{{arrayMethodName}}() expects no useless return value from {{name}}.",
			wrapBraces: "Wrap the expression in `{}`.",
			prependVoid: "Prepend `void` to the expression.",
		},
	},

	create(context) {
		const [options] = context.options;
		const sourceCode = context.sourceCode;

		let funcInfo = {
			arrayMethodName: null,
			upper: null,
			codePath: null,
			hasReturn: false,
			shouldCheck: false,
			node: null,
		};

		/**
		 * Checks whether or not the last code path segment is reachable.
		 * Then reports this function if the segment is reachable.
		 *
		 * If the last code path segment is reachable, there are paths which are not
		 * returned or thrown.
		 * @param {ASTNode} node A node to check.
		 * @returns {void}
		 */
		function checkLastSegment(node) {
			if (!funcInfo.shouldCheck) {
				return;
			}

			const messageAndSuggestions = { messageId: "", suggest: [] };

			if (funcInfo.arrayMethodName === "forEach") {
				if (
					options.checkForEach &&
					node.type === "ArrowFunctionExpression" &&
					node.expression
				) {
					if (options.allowVoid) {
						if (isExpressionVoid(node.body)) {
							return;
						}

						messageAndSuggestions.messageId =
							"expectedNoReturnValue";
						messageAndSuggestions.suggest = [
							{
								messageId: "wrapBraces",
								fix(fixer) {
									return curlyWrapFixer(
										sourceCode,
										node,
										fixer,
									);
								},
							},
							{
								messageId: "prependVoid",
								fix(fixer) {
									return voidPrependFixer(
										sourceCode,
										node.body,
										fixer,
									);
								},
							},
						];
					} else {
						messageAndSuggestions.messageId =
							"expectedNoReturnValue";
						messageAndSuggestions.suggest = [
							{
								messageId: "wrapBraces",
								fix(fixer) {
									return curlyWrapFixer(
										sourceCode,
										node,
										fixer,
									);
								},
							},
						];
					}
				}
			} else {
				if (
					node.body.type === "BlockStatement" &&
					isAnySegmentReachable(funcInfo.currentSegments)
				) {
					messageAndSuggestions.messageId = funcInfo.hasReturn
						? "expectedAtEnd"
						: "expectedInside";
				}
			}

			if (messageAndSuggestions.messageId) {
				const name = astUtils.getFunctionNameWithKind(node);

				context.report({
					node,
					loc: astUtils.getFunctionHeadLoc(node, sourceCode),
					messageId: messageAndSuggestions.messageId,
					data: {
						name,
						arrayMethodName: fullMethodName(
							funcInfo.arrayMethodName,
						),
					},
					suggest:
						messageAndSuggestions.suggest.length !== 0
							? messageAndSuggestions.suggest
							: null,
				});
			}
		}

		return {
			// Stacks this function's information.
			onCodePathStart(codePath, node) {
				let methodName = null;

				if (TARGET_NODE_TYPE.test(node.type)) {
					methodName = getArrayMethodName(node);
				}

				funcInfo = {
					arrayMethodName: methodName,
					upper: funcInfo,
					codePath,
					hasReturn: false,
					shouldCheck: !!methodName,
					node,
					currentSegments: new Set(),
				};
			},

			// Pops this function's information.
			onCodePathEnd() {
				funcInfo = funcInfo.upper;
			},

			onUnreachableCodePathSegmentStart(segment) {
				funcInfo.currentSegments.add(segment);
			},

			onUnreachableCodePathSegmentEnd(segment) {
				funcInfo.currentSegments.delete(segment);
			},

			onCodePathSegmentStart(segment) {
				funcInfo.currentSegments.add(segment);
			},

			onCodePathSegmentEnd(segment) {
				funcInfo.currentSegments.delete(segment);
			},

			// Checks the return statement is valid.
			ReturnStatement(node) {
				if (!funcInfo.shouldCheck) {
					return;
				}

				funcInfo.hasReturn = true;

				const messageAndSuggestions = { messageId: "", suggest: [] };

				if (funcInfo.arrayMethodName === "forEach") {
					// if checkForEach: true, returning a value at any path inside a forEach is not allowed
					if (options.checkForEach && node.argument) {
						if (options.allowVoid) {
							if (isExpressionVoid(node.argument)) {
								return;
							}

							messageAndSuggestions.messageId =
								"expectedNoReturnValue";
							messageAndSuggestions.suggest = [
								{
									messageId: "prependVoid",
									fix(fixer) {
										return voidPrependFixer(
											sourceCode,
											node.argument,
											fixer,
										);
									},
								},
							];
						} else {
							messageAndSuggestions.messageId =
								"expectedNoReturnValue";
						}
					}
				} else {
					// if allowImplicit: false, should also check node.argument
					if (!options.allowImplicit && !node.argument) {
						messageAndSuggestions.messageId = "expectedReturnValue";
					}
				}

				if (messageAndSuggestions.messageId) {
					context.report({
						node,
						messageId: messageAndSuggestions.messageId,
						data: {
							name: astUtils.getFunctionNameWithKind(
								funcInfo.node,
							),
							arrayMethodName: fullMethodName(
								funcInfo.arrayMethodName,
							),
						},
						suggest:
							messageAndSuggestions.suggest.length !== 0
								? messageAndSuggestions.suggest
								: null,
					});
				}
			},

			// Reports a given function if the last path is reachable.
			"FunctionExpression:exit": checkLastSegment,
			"ArrowFunctionExpression:exit": checkLastSegment,
		};
	},
};
!xn#/**
 * @fileoverview Rule to enforce line breaks after each array element
 * @author Jan Peer Stöcklmair <https://github.com/JPeer264>
 * @deprecated in ESLint v8.53.0
 */

"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "array-element-newline",
						url: "https://eslint.style/rules/array-element-newline",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Enforce line breaks after each array element",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/array-element-newline",
		},

		fixable: "whitespace",

		schema: {
			definitions: {
				basicConfig: {
					oneOf: [
						{
							enum: ["always", "never", "consistent"],
						},
						{
							type: "object",
							properties: {
								multiline: {
									type: "boolean",
								},
								minItems: {
									type: ["integer", "null"],
									minimum: 0,
								},
							},
							additionalProperties: false,
						},
					],
				},
			},
			type: "array",
			items: [
				{
					oneOf: [
						{
							$ref: "#/definitions/basicConfig",
						},
						{
							type: "object",
							properties: {
								ArrayExpression: {
									$ref: "#/definitions/basicConfig",
								},
								ArrayPattern: {
									$ref: "#/definitions/basicConfig",
								},
							},
							additionalProperties: false,
							minProperties: 1,
						},
					],
				},
			],
		},

		messages: {
			unexpectedLineBreak: "There should be no linebreak here.",
			missingLineBreak: "There should be a linebreak after this element.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		//----------------------------------------------------------------------
		// Helpers
		//----------------------------------------------------------------------

		/**
		 * Normalizes a given option value.
		 * @param {string|Object|undefined} providedOption An option value to parse.
		 * @returns {{multiline: boolean, minItems: number}} Normalized option object.
		 */
		function normalizeOptionValue(providedOption) {
			let consistent = false;
			let multiline = false;
			let minItems;

			const option = providedOption || "always";

			if (!option || option === "always" || option.minItems === 0) {
				minItems = 0;
			} else if (option === "never") {
				minItems = Number.POSITIVE_INFINITY;
			} else if (option === "consistent") {
				consistent = true;
				minItems = Number.POSITIVE_INFINITY;
			} else {
				multiline = Boolean(option.multiline);
				minItems = option.minItems || Number.POSITIVE_INFINITY;
			}

			return { consistent, multiline, minItems };
		}

		/**
		 * Normalizes a given option value.
		 * @param {string|Object|undefined} options An option value to parse.
		 * @returns {{ArrayExpression: {multiline: boolean, minItems: number}, ArrayPattern: {multiline: boolean, minItems: number}}} Normalized option object.
		 */
		function normalizeOptions(options) {
			if (options && (options.ArrayExpression || options.ArrayPattern)) {
				let expressionOptions, patternOptions;

				if (options.ArrayExpression) {
					expressionOptions = normalizeOptionValue(
						options.ArrayExpression,
					);
				}

				if (options.ArrayPattern) {
					patternOptions = normalizeOptionValue(options.ArrayPattern);
				}

				return {
					ArrayExpression: expressionOptions,
					ArrayPattern: patternOptions,
				};
			}

			const value = normalizeOptionValue(options);

			return { ArrayExpression: value, ArrayPattern: value };
		}

		/**
		 * Reports that there shouldn't be a line break after the first token
		 * @param {Token} token The token to use for the report.
		 * @returns {void}
		 */
		function reportNoLineBreak(token) {
			const tokenBefore = sourceCode.getTokenBefore(token, {
				includeComments: true,
			});

			context.report({
				loc: {
					start: tokenBefore.loc.end,
					end: token.loc.start,
				},
				messageId: "unexpectedLineBreak",
				fix(fixer) {
					if (astUtils.isCommentToken(tokenBefore)) {
						return null;
					}

					if (!astUtils.isTokenOnSameLine(tokenBefore, token)) {
						return fixer.replaceTextRange(
							[tokenBefore.range[1], token.range[0]],
							" ",
						);
					}

					/*
					 * This will check if the comma is on the same line as the next element
					 * Following array:
					 * [
					 *     1
					 *     , 2
					 *     , 3
					 * ]
					 *
					 * will be fixed to:
					 * [
					 *     1, 2, 3
					 * ]
					 */
					const twoTokensBefore = sourceCode.getTokenBefore(
						tokenBefore,
						{ includeComments: true },
					);

					if (astUtils.isCommentToken(twoTokensBefore)) {
						return null;
					}

					return fixer.replaceTextRange(
						[twoTokensBefore.range[1], tokenBefore.range[0]],
						"",
					);
				},
			});
		}

		/**
		 * Reports that there should be a line break after the first token
		 * @param {Token} token The token to use for the report.
		 * @returns {void}
		 */
		function reportRequiredLineBreak(token) {
			const tokenBefore = sourceCode.getTokenBefore(token, {
				includeComments: true,
			});

			context.report({
				loc: {
					start: tokenBefore.loc.end,
					end: token.loc.start,
				},
				messageId: "missingLineBreak",
				fix(fixer) {
					return fixer.replaceTextRange(
						[tokenBefore.range[1], token.range[0]],
						"\n",
					);
				},
			});
		}

		/**
		 * Reports a given node if it violated this rule.
		 * @param {ASTNode} node A node to check. This is an ObjectExpression node or an ObjectPattern node.
		 * @returns {void}
		 */
		function check(node) {
			const elements = node.elements;
			const normalizedOptions = normalizeOptions(context.options[0]);
			const options = normalizedOptions[node.type];

			if (!options) {
				return;
			}

			let elementBreak = false;

			/*
			 * MULTILINE: true
			 * loop through every element and check
			 * if at least one element has linebreaks inside
			 * this ensures that following is not valid (due to elements are on the same line):
			 *
			 * [
			 *      1,
			 *      2,
			 *      3
			 * ]
			 */
			if (options.multiline) {
				elementBreak = elements
					.filter(element => element !== null)
					.some(
						element =>
							element.loc.start.line !== element.loc.end.line,
					);
			}

			let linebreaksCount = 0;

			for (let i = 0; i < node.elements.length; i++) {
				const element = node.elements[i];

				const previousElement = elements[i - 1];

				if (i === 0 || element === null || previousElement === null) {
					continue;
				}

				const commaToken = sourceCode.getFirstTokenBetween(
					previousElement,
					element,
					astUtils.isCommaToken,
				);
				const lastTokenOfPreviousElement =
					sourceCode.getTokenBefore(commaToken);
				const firstTokenOfCurrentElement =
					sourceCode.getTokenAfter(commaToken);

				if (
					!astUtils.isTokenOnSameLine(
						lastTokenOfPreviousElement,
						firstTokenOfCurrentElement,
					)
				) {
					linebreaksCount++;
				}
			}

			const needsLinebreaks =
				elements.length >= options.minItems ||
				(options.multiline && elementBreak) ||
				(options.consistent &&
					linebreaksCount > 0 &&
					linebreaksCount < node.elements.length);

			elements.forEach((element, i) => {
				const previousElement = elements[i - 1];

				if (i === 0 || element === null || previousElement === null) {
					return;
				}

				const commaToken = sourceCode.getFirstTokenBetween(
					previousElement,
					element,
					astUtils.isCommaToken,
				);
				const lastTokenOfPreviousElement =
					sourceCode.getTokenBefore(commaToken);
				const firstTokenOfCurrentElement =
					sourceCode.getTokenAfter(commaToken);

				if (needsLinebreaks) {
					if (
						astUtils.isTokenOnSameLine(
							lastTokenOfPreviousElement,
							firstTokenOfCurrentElement,
						)
					) {
						reportRequiredLineBreak(firstTokenOfCurrentElement);
					}
				} else {
					if (
						!astUtils.isTokenOnSameLine(
							lastTokenOfPreviousElement,
							firstTokenOfCurrentElement,
						)
					) {
						reportNoLineBreak(firstTokenOfCurrentElement);
					}
				}
			});
		}

		//----------------------------------------------------------------------
		// Public
		//----------------------------------------------------------------------

		return {
			ArrayPattern: check,
			ArrayExpression: check,
		};
	},
};
nsDUx}(/**
 * @fileoverview Rule to require braces in arrow function body.
 * @author Alberto Rodríguez
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: ["as-needed"],

		docs: {
			description: "Require braces around arrow function bodies",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/arrow-body-style",
		},

		schema: {
			anyOf: [
				{
					type: "array",
					items: [
						{
							enum: ["always", "never"],
						},
					],
					minItems: 0,
					maxItems: 1,
				},
				{
					type: "array",
					items: [
						{
							enum: ["as-needed"],
						},
						{
							type: "object",
							properties: {
								requireReturnForObjectLiteral: {
									type: "boolean",
								},
							},
							additionalProperties: false,
						},
					],
					minItems: 0,
					maxItems: 2,
				},
			],
		},

		fixable: "code",

		messages: {
			unexpectedOtherBlock:
				"Unexpected block statement surrounding arrow body.",
			unexpectedEmptyBlock:
				"Unexpected block statement surrounding arrow body; put a value of `undefined` immediately after the `=>`.",
			unexpectedObjectBlock:
				"Unexpected block statement surrounding arrow body; parenthesize the returned value and move it immediately after the `=>`.",
			unexpectedSingleBlock:
				"Unexpected block statement surrounding arrow body; move the returned value immediately after the `=>`.",
			expectedBlock: "Expected block statement surrounding arrow body.",
		},
	},

	create(context) {
		const options = context.options;
		const always = options[0] === "always";
		const asNeeded = options[0] === "as-needed";
		const never = options[0] === "never";
		const requireReturnForObjectLiteral =
			options[1] && options[1].requireReturnForObjectLiteral;
		const sourceCode = context.sourceCode;
		let funcInfo = null;

		/**
		 * Checks whether the given node has ASI problem or not.
		 * @param {Token} token The token to check.
		 * @returns {boolean} `true` if it changes semantics if `;` or `}` followed by the token are removed.
		 */
		function hasASIProblem(token) {
			return (
				token &&
				token.type === "Punctuator" &&
				/^[([/`+-]/u.test(token.value)
			);
		}

		/**
		 * Gets the closing parenthesis by the given node.
		 * @param {ASTNode} node first node after an opening parenthesis.
		 * @returns {Token} The found closing parenthesis token.
		 */
		function findClosingParen(node) {
			let nodeToCheck = node;

			while (!astUtils.isParenthesised(sourceCode, nodeToCheck)) {
				nodeToCheck = nodeToCheck.parent;
			}
			return sourceCode.getTokenAfter(nodeToCheck);
		}

		/**
		 * Check whether the node is inside of a for loop's init
		 * @param {ASTNode} node node is inside for loop
		 * @returns {boolean} `true` if the node is inside of a for loop, else `false`
		 */
		function isInsideForLoopInitializer(node) {
			if (node && node.parent) {
				if (
					node.parent.type === "ForStatement" &&
					node.parent.init === node
				) {
					return true;
				}
				return isInsideForLoopInitializer(node.parent);
			}
			return false;
		}

		/**
		 * Determines whether a arrow function body needs braces
		 * @param {ASTNode} node The arrow function node.
		 * @returns {void}
		 */
		function validate(node) {
			const arrowBody = node.body;

			if (arrowBody.type === "BlockStatement") {
				const blockBody = arrowBody.body;

				if (blockBody.length !== 1 && !never) {
					return;
				}

				if (
					asNeeded &&
					requireReturnForObjectLiteral &&
					blockBody[0].type === "ReturnStatement" &&
					blockBody[0].argument &&
					blockBody[0].argument.type === "ObjectExpression"
				) {
					return;
				}

				if (
					never ||
					(asNeeded && blockBody[0].type === "ReturnStatement")
				) {
					let messageId;

					if (blockBody.length === 0) {
						messageId = "unexpectedEmptyBlock";
					} else if (
						blockBody.length > 1 ||
						blockBody[0].type !== "ReturnStatement"
					) {
						messageId = "unexpectedOtherBlock";
					} else if (blockBody[0].argument === null) {
						messageId = "unexpectedSingleBlock";
					} else if (
						astUtils.isOpeningBraceToken(
							sourceCode.getFirstToken(blockBody[0], { skip: 1 }),
						)
					) {
						messageId = "unexpectedObjectBlock";
					} else {
						messageId = "unexpectedSingleBlock";
					}

					context.report({
						node,
						loc: arrowBody.loc,
						messageId,
						fix(fixer) {
							const fixes = [];

							if (
								blockBody.length !== 1 ||
								blockBody[0].type !== "ReturnStatement" ||
								!blockBody[0].argument ||
								hasASIProblem(
									sourceCode.getTokenAfter(arrowBody),
								)
							) {
								return fixes;
							}

							const openingBrace =
								sourceCode.getFirstToken(arrowBody);
							const closingBrace =
								sourceCode.getLastToken(arrowBody);
							const firstValueToken = sourceCode.getFirstToken(
								blockBody[0],
								1,
							);
							const lastValueToken = sourceCode.getLastToken(
								blockBody[0],
							);
							const commentsExist =
								sourceCode.commentsExistBetween(
									openingBrace,
									firstValueToken,
								) ||
								sourceCode.commentsExistBetween(
									lastValueToken,
									closingBrace,
								);

							/*
							 * Remove tokens around the return value.
							 * If comments don't exist, remove extra spaces as well.
							 */
							if (commentsExist) {
								fixes.push(
									fixer.remove(openingBrace),
									fixer.remove(closingBrace),
									fixer.remove(
										sourceCode.getTokenAfter(openingBrace),
									), // return keyword
								);
							} else {
								fixes.push(
									fixer.removeRange([
										openingBrace.range[0],
										firstValueToken.range[0],
									]),
									fixer.removeRange([
										lastValueToken.range[1],
										closingBrace.range[1],
									]),
								);
							}

							/*
							 * If the first token of the return value is `{` or the return value is a sequence expression,
							 * enclose the return value by parentheses to avoid syntax error.
							 */
							if (
								astUtils.isOpeningBraceToken(firstValueToken) ||
								blockBody[0].argument.type ===
									"SequenceExpression" ||
								(funcInfo.hasInOperator &&
									isInsideForLoopInitializer(node))
							) {
								if (
									!astUtils.isParenthesised(
										sourceCode,
										blockBody[0].argument,
									)
								) {
									fixes.push(
										fixer.insertTextBefore(
											firstValueToken,
											"(",
										),
										fixer.insertTextAfter(
											lastValueToken,
											")",
										),
									);
								}
							}

							/*
							 * If the last token of the return statement is semicolon, remove it.
							 * Non-block arrow body is an expression, not a statement.
							 */
							if (astUtils.isSemicolonToken(lastValueToken)) {
								fixes.push(fixer.remove(lastValueToken));
							}

							return fixes;
						},
					});
				}
			} else {
				if (
					always ||
					(asNeeded &&
						requireReturnForObjectLiteral &&
						arrowBody.type === "ObjectExpression")
				) {
					context.report({
						node,
						loc: arrowBody.loc,
						messageId: "expectedBlock",
						fix(fixer) {
							const fixes = [];
							const arrowToken = sourceCode.getTokenBefore(
								arrowBody,
								astUtils.isArrowToken,
							);
							const [
								firstTokenAfterArrow,
								secondTokenAfterArrow,
							] = sourceCode.getTokensAfter(arrowToken, {
								count: 2,
							});
							const lastToken = sourceCode.getLastToken(node);

							let parenthesisedObjectLiteral = null;

							if (
								astUtils.isOpeningParenToken(
									firstTokenAfterArrow,
								) &&
								astUtils.isOpeningBraceToken(
									secondTokenAfterArrow,
								)
							) {
								const braceNode =
									sourceCode.getNodeByRangeIndex(
										secondTokenAfterArrow.range[0],
									);

								if (braceNode.type === "ObjectExpression") {
									parenthesisedObjectLiteral = braceNode;
								}
							}

							// If the value is object literal, remove parentheses which were forced by syntax.
							if (parenthesisedObjectLiteral) {
								const openingParenToken = firstTokenAfterArrow;
								const openingBraceToken = secondTokenAfterArrow;

								if (
									astUtils.isTokenOnSameLine(
										openingParenToken,
										openingBraceToken,
									)
								) {
									fixes.push(
										fixer.replaceText(
											openingParenToken,
											"{return ",
										),
									);
								} else {
									// Avoid ASI
									fixes.push(
										fixer.replaceText(
											openingParenToken,
											"{",
										),
										fixer.insertTextBefore(
											openingBraceToken,
											"return ",
										),
									);
								}

								// Closing paren for the object doesn't have to be lastToken, e.g.: () => ({}).foo()
								fixes.push(
									fixer.remove(
										findClosingParen(
											parenthesisedObjectLiteral,
										),
									),
								);
								fixes.push(
									fixer.insertTextAfter(lastToken, "}"),
								);
							} else {
								fixes.push(
									fixer.insertTextBefore(
										firstTokenAfterArrow,
										"{return ",
									),
								);
								fixes.push(
									fixer.insertTextAfter(lastToken, "}"),
								);
							}

							return fixes;
						},
					});
				}
			}
		}

		return {
			"BinaryExpression[operator='in']"() {
				let info = funcInfo;

				while (info) {
					info.hasInOperator = true;
					info = info.upper;
				}
			},
			ArrowFunctionExpression() {
				funcInfo = {
					upper: funcInfo,
					hasInOperator: false,
				};
			},
			"ArrowFunctionExpression:exit"(node) {
				validate(node);
				funcInfo = funcInfo.upper;
			},
		};
	},
};

俼x0/**
 * @fileoverview Rule to require parens in arrow function arguments.
 * @author Jxck
 * @deprecated in ESLint v8.53.0
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Determines if the given arrow function has block body.
 * @param {ASTNode} node `ArrowFunctionExpression` node.
 * @returns {boolean} `true` if the function has block body.
 */
function hasBlockBody(node) {
	return node.body.type === "BlockStatement";
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "arrow-parens",
						url: "https://eslint.style/rules/arrow-parens",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Require parentheses around arrow function arguments",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/arrow-parens",
		},

		fixable: "code",

		schema: [
			{
				enum: ["always", "as-needed"],
			},
			{
				type: "object",
				properties: {
					requireForBlockBody: {
						type: "boolean",
						default: false,
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			unexpectedParens:
				"Unexpected parentheses around single function argument.",
			expectedParens:
				"Expected parentheses around arrow function argument.",

			unexpectedParensInline:
				"Unexpected parentheses around single function argument having a body with no curly braces.",
			expectedParensBlock:
				"Expected parentheses around arrow function argument having a body with curly braces.",
		},
	},

	create(context) {
		const asNeeded = context.options[0] === "as-needed";
		const requireForBlockBody =
			asNeeded &&
			context.options[1] &&
			context.options[1].requireForBlockBody === true;

		const sourceCode = context.sourceCode;

		/**
		 * Finds opening paren of parameters for the given arrow function, if it exists.
		 * It is assumed that the given arrow function has exactly one parameter.
		 * @param {ASTNode} node `ArrowFunctionExpression` node.
		 * @returns {Token|null} the opening paren, or `null` if the given arrow function doesn't have parens of parameters.
		 */
		function findOpeningParenOfParams(node) {
			const tokenBeforeParams = sourceCode.getTokenBefore(node.params[0]);

			if (
				tokenBeforeParams &&
				astUtils.isOpeningParenToken(tokenBeforeParams) &&
				node.range[0] <= tokenBeforeParams.range[0]
			) {
				return tokenBeforeParams;
			}

			return null;
		}

		/**
		 * Finds closing paren of parameters for the given arrow function.
		 * It is assumed that the given arrow function has parens of parameters and that it has exactly one parameter.
		 * @param {ASTNode} node `ArrowFunctionExpression` node.
		 * @returns {Token} the closing paren of parameters.
		 */
		function getClosingParenOfParams(node) {
			return sourceCode.getTokenAfter(
				node.params[0],
				astUtils.isClosingParenToken,
			);
		}

		/**
		 * Determines whether the given arrow function has comments inside parens of parameters.
		 * It is assumed that the given arrow function has parens of parameters.
		 * @param {ASTNode} node `ArrowFunctionExpression` node.
		 * @param {Token} openingParen Opening paren of parameters.
		 * @returns {boolean} `true` if the function has at least one comment inside of parens of parameters.
		 */
		function hasCommentsInParensOfParams(node, openingParen) {
			return sourceCode.commentsExistBetween(
				openingParen,
				getClosingParenOfParams(node),
			);
		}

		/**
		 * Determines whether the given arrow function has unexpected tokens before opening paren of parameters,
		 * in which case it will be assumed that the existing parens of parameters are necessary.
		 * Only tokens within the range of the arrow function (tokens that are part of the arrow function) are taken into account.
		 * Example: <T>(a) => b
		 * @param {ASTNode} node `ArrowFunctionExpression` node.
		 * @param {Token} openingParen Opening paren of parameters.
		 * @returns {boolean} `true` if the function has at least one unexpected token.
		 */
		function hasUnexpectedTokensBeforeOpeningParen(node, openingParen) {
			const expectedCount = node.async ? 1 : 0;

			return (
				sourceCode.getFirstToken(node, { skip: expectedCount }) !==
				openingParen
			);
		}

		return {
			"ArrowFunctionExpression[params.length=1]"(node) {
				const shouldHaveParens =
					!asNeeded || (requireForBlockBody && hasBlockBody(node));
				const openingParen = findOpeningParenOfParams(node);
				const hasParens = openingParen !== null;
				const [param] = node.params;

				if (shouldHaveParens && !hasParens) {
					context.report({
						node,
						messageId: requireForBlockBody
							? "expectedParensBlock"
							: "expectedParens",
						loc: param.loc,
						*fix(fixer) {
							yield fixer.insertTextBefore(param, "(");
							yield fixer.insertTextAfter(param, ")");
						},
					});
				}

				if (
					!shouldHaveParens &&
					hasParens &&
					param.type === "Identifier" &&
					!param.typeAnnotation &&
					!node.returnType &&
					!hasCommentsInParensOfParams(node, openingParen) &&
					!hasUnexpectedTokensBeforeOpeningParen(node, openingParen)
				) {
					context.report({
						node,
						messageId: requireForBlockBody
							? "unexpectedParensInline"
							: "unexpectedParens",
						loc: param.loc,
						*fix(fixer) {
							const tokenBeforeOpeningParen =
								sourceCode.getTokenBefore(openingParen);
							const closingParen = getClosingParenOfParams(node);

							if (
								tokenBeforeOpeningParen &&
								tokenBeforeOpeningParen.range[1] ===
									openingParen.range[0] &&
								!astUtils.canTokensBeAdjacent(
									tokenBeforeOpeningParen,
									sourceCode.getFirstToken(param),
								)
							) {
								yield fixer.insertTextBefore(openingParen, " ");
							}

							// remove parens, whitespace inside parens, and possible trailing comma
							yield fixer.removeRange([
								openingParen.range[0],
								param.range[0],
							]);
							yield fixer.removeRange([
								param.range[1],
								closingParen.range[1],
							]);
						},
					});
				}
			},
		};
	},
};
xx
/**
 * @fileoverview Rule to define spacing before/after arrow function's arrow.
 * @author Jxck
 * @deprecated in ESLint v8.53.0
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "arrow-spacing",
						url: "https://eslint.style/rules/arrow-spacing",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description:
				"Enforce consistent spacing before and after the arrow in arrow functions",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/arrow-spacing",
		},

		fixable: "whitespace",

		schema: [
			{
				type: "object",
				properties: {
					before: {
						type: "boolean",
						default: true,
					},
					after: {
						type: "boolean",
						default: true,
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			expectedBefore: "Missing space before =>.",
			unexpectedBefore: "Unexpected space before =>.",

			expectedAfter: "Missing space after =>.",
			unexpectedAfter: "Unexpected space after =>.",
		},
	},

	create(context) {
		// merge rules with default
		const rule = Object.assign({}, context.options[0]);

		rule.before = rule.before !== false;
		rule.after = rule.after !== false;

		const sourceCode = context.sourceCode;

		/**
		 * Get tokens of arrow(`=>`) and before/after arrow.
		 * @param {ASTNode} node The arrow function node.
		 * @returns {Object} Tokens of arrow and before/after arrow.
		 */
		function getTokens(node) {
			const arrow = sourceCode.getTokenBefore(
				node.body,
				astUtils.isArrowToken,
			);

			return {
				before: sourceCode.getTokenBefore(arrow),
				arrow,
				after: sourceCode.getTokenAfter(arrow),
			};
		}

		/**
		 * Count spaces before/after arrow(`=>`) token.
		 * @param {Object} tokens Tokens before/after arrow.
		 * @returns {Object} count of space before/after arrow.
		 */
		function countSpaces(tokens) {
			const before = tokens.arrow.range[0] - tokens.before.range[1];
			const after = tokens.after.range[0] - tokens.arrow.range[1];

			return { before, after };
		}

		/**
		 * Determines whether space(s) before after arrow(`=>`) is satisfy rule.
		 * if before/after value is `true`, there should be space(s).
		 * if before/after value is `false`, there should be no space.
		 * @param {ASTNode} node The arrow function node.
		 * @returns {void}
		 */
		function spaces(node) {
			const tokens = getTokens(node);
			const countSpace = countSpaces(tokens);

			if (rule.before) {
				// should be space(s) before arrow
				if (countSpace.before === 0) {
					context.report({
						node: tokens.before,
						messageId: "expectedBefore",
						fix(fixer) {
							return fixer.insertTextBefore(tokens.arrow, " ");
						},
					});
				}
			} else {
				// should be no space before arrow
				if (countSpace.before > 0) {
					context.report({
						node: tokens.before,
						messageId: "unexpectedBefore",
						fix(fixer) {
							return fixer.removeRange([
								tokens.before.range[1],
								tokens.arrow.range[0],
							]);
						},
					});
				}
			}

			if (rule.after) {
				// should be space(s) after arrow
				if (countSpace.after === 0) {
					context.report({
						node: tokens.after,
						messageId: "expectedAfter",
						fix(fixer) {
							return fixer.insertTextAfter(tokens.arrow, " ");
						},
					});
				}
			} else {
				// should be no space after arrow
				if (countSpace.after > 0) {
					context.report({
						node: tokens.after,
						messageId: "unexpectedAfter",
						fix(fixer) {
							return fixer.removeRange([
								tokens.arrow.range[1],
								tokens.after.range[0],
							]);
						},
					});
				}
			}
		}

		return {
			ArrowFunctionExpression: spaces,
		};
	},
};
<xC/**
 * @fileoverview Rule to check for "block scoped" variables by binding context
 * @author Matt DuVall <http://www.mattduvall.com>
 */
"use strict";

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @typedef {import("eslint-scope").Definition} Definition */
/** @typedef {import("eslint-scope").Reference} Reference */

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Enforce the use of variables within the scope they are defined",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/block-scoped-var",
		},

		schema: [],

		messages: {
			outOfScope:
				"'{{name}}' declared on line {{definitionLine}} column {{definitionColumn}} is used outside of binding context.",
		},
	},

	create(context) {
		let stack = [];
		const sourceCode = context.sourceCode;

		/**
		 * Makes a block scope.
		 * @param {ASTNode} node A node of a scope.
		 * @returns {void}
		 */
		function enterScope(node) {
			stack.push(node.range);
		}

		/**
		 * Pops the last block scope.
		 * @returns {void}
		 */
		function exitScope() {
			stack.pop();
		}

		/**
		 * Reports a given reference.
		 * @param {Reference} reference A reference to report.
		 * @param {Definition} definition A definition for which to report reference.
		 * @returns {void}
		 */
		function report(reference, definition) {
			const identifier = reference.identifier;
			const definitionPosition = definition.name.loc.start;

			context.report({
				node: identifier,
				messageId: "outOfScope",
				data: {
					name: identifier.name,
					definitionLine: definitionPosition.line,
					definitionColumn: definitionPosition.column + 1,
				},
			});
		}

		/**
		 * Finds and reports references which are outside of valid scopes.
		 * @param {ASTNode} node A node to get variables.
		 * @returns {void}
		 */
		function checkForVariables(node) {
			if (node.kind !== "var") {
				return;
			}

			// Defines a predicate to check whether or not a given reference is outside of valid scope.
			const scopeRange = stack.at(-1);

			/**
			 * Check if a reference is out of scope
			 * @param {ASTNode} reference node to examine
			 * @returns {boolean} True is its outside the scope
			 * @private
			 */
			function isOutsideOfScope(reference) {
				const idRange = reference.identifier.range;

				return idRange[0] < scopeRange[0] || idRange[1] > scopeRange[1];
			}

			// Gets declared variables, and checks its references.
			const variables = sourceCode.getDeclaredVariables(node);

			for (let i = 0; i < variables.length; ++i) {
				// Reports.
				variables[i].references.filter(isOutsideOfScope).forEach(ref =>
					report(
						ref,
						variables[i].defs.find(def => def.parent === node),
					),
				);
			}
		}

		return {
			Program(node) {
				stack = [node.range];
			},

			// Manages scopes.
			BlockStatement: enterScope,
			"BlockStatement:exit": exitScope,
			ForStatement: enterScope,
			"ForStatement:exit": exitScope,
			ForInStatement: enterScope,
			"ForInStatement:exit": exitScope,
			ForOfStatement: enterScope,
			"ForOfStatement:exit": exitScope,
			SwitchStatement: enterScope,
			"SwitchStatement:exit": exitScope,
			CatchClause: enterScope,
			"CatchClause:exit": exitScope,
			StaticBlock: enterScope,
			"StaticBlock:exit": exitScope,

			// Finds and reports references which are outside of valid scope.
			VariableDeclaration: checkForVariables,
		};
	},
};
|x!/**
 * @fileoverview A rule to disallow or enforce spaces inside of single line blocks.
 * @author Toru Nagashima
 * @deprecated in ESLint v8.53.0
 */

"use strict";

const util = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "block-spacing",
						url: "https://eslint.style/rules/block-spacing",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description:
				"Disallow or enforce spaces inside of blocks after opening block and before closing block",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/block-spacing",
		},

		fixable: "whitespace",

		schema: [{ enum: ["always", "never"] }],

		messages: {
			missing: "Requires a space {{location}} '{{token}}'.",
			extra: "Unexpected space(s) {{location}} '{{token}}'.",
		},
	},

	create(context) {
		const always = context.options[0] !== "never",
			messageId = always ? "missing" : "extra",
			sourceCode = context.sourceCode;

		/**
		 * Gets the open brace token from a given node.
		 * @param {ASTNode} node A BlockStatement/StaticBlock/SwitchStatement node to get.
		 * @returns {Token} The token of the open brace.
		 */
		function getOpenBrace(node) {
			if (node.type === "SwitchStatement") {
				if (node.cases.length > 0) {
					return sourceCode.getTokenBefore(node.cases[0]);
				}
				return sourceCode.getLastToken(node, 1);
			}

			if (node.type === "StaticBlock") {
				return sourceCode.getFirstToken(node, { skip: 1 }); // skip the `static` token
			}

			// "BlockStatement"
			return sourceCode.getFirstToken(node);
		}

		/**
		 * Checks whether or not:
		 *   - given tokens are on same line.
		 *   - there is/isn't a space between given tokens.
		 * @param {Token} left A token to check.
		 * @param {Token} right The token which is next to `left`.
		 * @returns {boolean}
		 *    When the option is `"always"`, `true` if there are one or more spaces between given tokens.
		 *    When the option is `"never"`, `true` if there are not any spaces between given tokens.
		 *    If given tokens are not on same line, it's always `true`.
		 */
		function isValid(left, right) {
			return (
				!util.isTokenOnSameLine(left, right) ||
				sourceCode.isSpaceBetween(left, right) === always
			);
		}

		/**
		 * Checks and reports invalid spacing style inside braces.
		 * @param {ASTNode} node A BlockStatement/StaticBlock/SwitchStatement node to check.
		 * @returns {void}
		 */
		function checkSpacingInsideBraces(node) {
			// Gets braces and the first/last token of content.
			const openBrace = getOpenBrace(node);
			const closeBrace = sourceCode.getLastToken(node);
			const firstToken = sourceCode.getTokenAfter(openBrace, {
				includeComments: true,
			});
			const lastToken = sourceCode.getTokenBefore(closeBrace, {
				includeComments: true,
			});

			// Skip if the node is invalid or empty.
			if (
				openBrace.type !== "Punctuator" ||
				openBrace.value !== "{" ||
				closeBrace.type !== "Punctuator" ||
				closeBrace.value !== "}" ||
				firstToken === closeBrace
			) {
				return;
			}

			// Skip line comments for option never
			if (!always && firstToken.type === "Line") {
				return;
			}

			// Check.
			if (!isValid(openBrace, firstToken)) {
				let loc = openBrace.loc;

				if (messageId === "extra") {
					loc = {
						start: openBrace.loc.end,
						end: firstToken.loc.start,
					};
				}

				context.report({
					node,
					loc,
					messageId,
					data: {
						location: "after",
						token: openBrace.value,
					},
					fix(fixer) {
						if (always) {
							return fixer.insertTextBefore(firstToken, " ");
						}

						return fixer.removeRange([
							openBrace.range[1],
							firstToken.range[0],
						]);
					},
				});
			}
			if (!isValid(lastToken, closeBrace)) {
				let loc = closeBrace.loc;

				if (messageId === "extra") {
					loc = {
						start: lastToken.loc.end,
						end: closeBrace.loc.start,
					};
				}
				context.report({
					node,
					loc,
					messageId,
					data: {
						location: "before",
						token: closeBrace.value,
					},
					fix(fixer) {
						if (always) {
							return fixer.insertTextAfter(lastToken, " ");
						}

						return fixer.removeRange([
							lastToken.range[1],
							closeBrace.range[0],
						]);
					},
				});
			}
		}

		return {
			BlockStatement: checkSpacingInsideBraces,
			StaticBlock: checkSpacingInsideBraces,
			SwitchStatement: checkSpacingInsideBraces,
		};
	},
};
fxW/**
 * @fileoverview Rule to flag block statements that do not use the one true brace style
 * @author Ian Christian Myers
 * @deprecated in ESLint v8.53.0
 */

"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "brace-style",
						url: "https://eslint.style/rules/brace-style",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Enforce consistent brace style for blocks",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/brace-style",
		},

		schema: [
			{
				enum: ["1tbs", "stroustrup", "allman"],
			},
			{
				type: "object",
				properties: {
					allowSingleLine: {
						type: "boolean",
						default: false,
					},
				},
				additionalProperties: false,
			},
		],

		fixable: "whitespace",

		messages: {
			nextLineOpen:
				"Opening curly brace does not appear on the same line as controlling statement.",
			sameLineOpen:
				"Opening curly brace appears on the same line as controlling statement.",
			blockSameLine:
				"Statement inside of curly braces should be on next line.",
			nextLineClose:
				"Closing curly brace does not appear on the same line as the subsequent block.",
			singleLineClose:
				"Closing curly brace should be on the same line as opening curly brace or on the line after the previous block.",
			sameLineClose:
				"Closing curly brace appears on the same line as the subsequent block.",
		},
	},

	create(context) {
		const style = context.options[0] || "1tbs",
			params = context.options[1] || {},
			sourceCode = context.sourceCode;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Fixes a place where a newline unexpectedly appears
		 * @param {Token} firstToken The token before the unexpected newline
		 * @param {Token} secondToken The token after the unexpected newline
		 * @returns {Function} A fixer function to remove the newlines between the tokens
		 */
		function removeNewlineBetween(firstToken, secondToken) {
			const textRange = [firstToken.range[1], secondToken.range[0]];
			const textBetween = sourceCode.text.slice(
				textRange[0],
				textRange[1],
			);

			// Don't do a fix if there is a comment between the tokens
			if (textBetween.trim()) {
				return null;
			}
			return fixer => fixer.replaceTextRange(textRange, " ");
		}

		/**
		 * Validates a pair of curly brackets based on the user's config
		 * @param {Token} openingCurly The opening curly bracket
		 * @param {Token} closingCurly The closing curly bracket
		 * @returns {void}
		 */
		function validateCurlyPair(openingCurly, closingCurly) {
			const tokenBeforeOpeningCurly =
				sourceCode.getTokenBefore(openingCurly);
			const tokenAfterOpeningCurly =
				sourceCode.getTokenAfter(openingCurly);
			const tokenBeforeClosingCurly =
				sourceCode.getTokenBefore(closingCurly);
			const singleLineException =
				params.allowSingleLine &&
				astUtils.isTokenOnSameLine(openingCurly, closingCurly);

			if (
				style !== "allman" &&
				!astUtils.isTokenOnSameLine(
					tokenBeforeOpeningCurly,
					openingCurly,
				)
			) {
				context.report({
					node: openingCurly,
					messageId: "nextLineOpen",
					fix: removeNewlineBetween(
						tokenBeforeOpeningCurly,
						openingCurly,
					),
				});
			}

			if (
				style === "allman" &&
				astUtils.isTokenOnSameLine(
					tokenBeforeOpeningCurly,
					openingCurly,
				) &&
				!singleLineException
			) {
				context.report({
					node: openingCurly,
					messageId: "sameLineOpen",
					fix: fixer => fixer.insertTextBefore(openingCurly, "\n"),
				});
			}

			if (
				astUtils.isTokenOnSameLine(
					openingCurly,
					tokenAfterOpeningCurly,
				) &&
				tokenAfterOpeningCurly !== closingCurly &&
				!singleLineException
			) {
				context.report({
					node: openingCurly,
					messageId: "blockSameLine",
					fix: fixer => fixer.insertTextAfter(openingCurly, "\n"),
				});
			}

			if (
				tokenBeforeClosingCurly !== openingCurly &&
				!singleLineException &&
				astUtils.isTokenOnSameLine(
					tokenBeforeClosingCurly,
					closingCurly,
				)
			) {
				context.report({
					node: closingCurly,
					messageId: "singleLineClose",
					fix: fixer => fixer.insertTextBefore(closingCurly, "\n"),
				});
			}
		}

		/**
		 * Validates the location of a token that appears before a keyword (e.g. a newline before `else`)
		 * @param {Token} curlyToken The closing curly token. This is assumed to precede a keyword token (such as `else` or `finally`).
		 * @returns {void}
		 */
		function validateCurlyBeforeKeyword(curlyToken) {
			const keywordToken = sourceCode.getTokenAfter(curlyToken);

			if (
				style === "1tbs" &&
				!astUtils.isTokenOnSameLine(curlyToken, keywordToken)
			) {
				context.report({
					node: curlyToken,
					messageId: "nextLineClose",
					fix: removeNewlineBetween(curlyToken, keywordToken),
				});
			}

			if (
				style !== "1tbs" &&
				astUtils.isTokenOnSameLine(curlyToken, keywordToken)
			) {
				context.report({
					node: curlyToken,
					messageId: "sameLineClose",
					fix: fixer => fixer.insertTextAfter(curlyToken, "\n"),
				});
			}
		}

		//--------------------------------------------------------------------------
		// Public API
		//--------------------------------------------------------------------------

		return {
			BlockStatement(node) {
				if (!astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type)) {
					validateCurlyPair(
						sourceCode.getFirstToken(node),
						sourceCode.getLastToken(node),
					);
				}
			},
			StaticBlock(node) {
				validateCurlyPair(
					sourceCode.getFirstToken(node, { skip: 1 }), // skip the `static` token
					sourceCode.getLastToken(node),
				);
			},
			ClassBody(node) {
				validateCurlyPair(
					sourceCode.getFirstToken(node),
					sourceCode.getLastToken(node),
				);
			},
			SwitchStatement(node) {
				const closingCurly = sourceCode.getLastToken(node);
				const openingCurly = sourceCode.getTokenBefore(
					node.cases.length ? node.cases[0] : closingCurly,
				);

				validateCurlyPair(openingCurly, closingCurly);
			},
			IfStatement(node) {
				if (
					node.consequent.type === "BlockStatement" &&
					node.alternate
				) {
					// Handle the keyword after the `if` block (before `else`)
					validateCurlyBeforeKeyword(
						sourceCode.getLastToken(node.consequent),
					);
				}
			},
			TryStatement(node) {
				// Handle the keyword after the `try` block (before `catch` or `finally`)
				validateCurlyBeforeKeyword(sourceCode.getLastToken(node.block));

				if (node.handler && node.finalizer) {
					// Handle the keyword after the `catch` block (before `finally`)
					validateCurlyBeforeKeyword(
						sourceCode.getLastToken(node.handler.body),
					);
				}
			},
		};
	},
};
%Fx/**
 * @fileoverview Enforce return after a callback.
 * @author Jamund Ferguson
 * @deprecated in ESLint v7.0.0
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Node.js rules were moved out of ESLint core.",
			url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
			deprecatedSince: "7.0.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"eslint-plugin-n now maintains deprecated Node.js-related rules.",
					plugin: {
						name: "eslint-plugin-n",
						url: "https://github.com/eslint-community/eslint-plugin-n",
					},
					rule: {
						name: "callback-return",
						url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/callback-return.md",
					},
				},
			],
		},

		type: "suggestion",

		docs: {
			description: "Require `return` statements after callbacks",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/callback-return",
		},

		schema: [
			{
				type: "array",
				items: { type: "string" },
			},
		],

		messages: {
			missingReturn: "Expected return with your callback function.",
		},
	},

	create(context) {
		const callbacks = context.options[0] || ["callback", "cb", "next"],
			sourceCode = context.sourceCode;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Find the closest parent matching a list of types.
		 * @param {ASTNode} node The node whose parents we are searching
		 * @param {Array} types The node types to match
		 * @returns {ASTNode} The matched node or undefined.
		 */
		function findClosestParentOfType(node, types) {
			if (!node.parent) {
				return null;
			}
			if (!types.includes(node.parent.type)) {
				return findClosestParentOfType(node.parent, types);
			}
			return node.parent;
		}

		/**
		 * Check to see if a node contains only identifiers
		 * @param {ASTNode} node The node to check
		 * @returns {boolean} Whether or not the node contains only identifiers
		 */
		function containsOnlyIdentifiers(node) {
			if (node.type === "Identifier") {
				return true;
			}

			if (node.type === "MemberExpression") {
				if (node.object.type === "Identifier") {
					return true;
				}
				if (node.object.type === "MemberExpression") {
					return containsOnlyIdentifiers(node.object);
				}
			}

			return false;
		}

		/**
		 * Check to see if a CallExpression is in our callback list.
		 * @param {ASTNode} node The node to check against our callback names list.
		 * @returns {boolean} Whether or not this function matches our callback name.
		 */
		function isCallback(node) {
			return (
				containsOnlyIdentifiers(node.callee) &&
				callbacks.includes(sourceCode.getText(node.callee))
			);
		}

		/**
		 * Determines whether or not the callback is part of a callback expression.
		 * @param {ASTNode} node The callback node
		 * @param {ASTNode} parentNode The expression node
		 * @returns {boolean} Whether or not this is part of a callback expression
		 */
		function isCallbackExpression(node, parentNode) {
			// ensure the parent node exists and is an expression
			if (!parentNode || parentNode.type !== "ExpressionStatement") {
				return false;
			}

			// cb()
			if (parentNode.expression === node) {
				return true;
			}

			// special case for cb && cb() and similar
			if (
				parentNode.expression.type === "BinaryExpression" ||
				parentNode.expression.type === "LogicalExpression"
			) {
				if (parentNode.expression.right === node) {
					return true;
				}
			}

			return false;
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			CallExpression(node) {
				// if we're not a callback we can return
				if (!isCallback(node)) {
					return;
				}

				// find the closest block, return or loop
				const closestBlock =
					findClosestParentOfType(node, [
						"BlockStatement",
						"ReturnStatement",
						"ArrowFunctionExpression",
					]) || {};

				// if our parent is a return we know we're ok
				if (closestBlock.type === "ReturnStatement") {
					return;
				}

				// arrow functions don't always have blocks and implicitly return
				if (closestBlock.type === "ArrowFunctionExpression") {
					return;
				}

				// block statements are part of functions and most if statements
				if (closestBlock.type === "BlockStatement") {
					// find the last item in the block
					const lastItem = closestBlock.body.at(-1);

					// if the callback is the last thing in a block that might be ok
					if (isCallbackExpression(node, lastItem)) {
						const parentType = closestBlock.parent.type;

						// but only if the block is part of a function
						if (
							parentType === "FunctionExpression" ||
							parentType === "FunctionDeclaration" ||
							parentType === "ArrowFunctionExpression"
						) {
							return;
						}
					}

					// ending a block with a return is also ok
					if (lastItem.type === "ReturnStatement") {
						// but only if the callback is immediately before
						if (
							isCallbackExpression(node, closestBlock.body.at(-2))
						) {
							return;
						}
					}
				}

				// as long as you're the child of a function at this point you should be asked to return
				if (
					findClosestParentOfType(node, [
						"FunctionDeclaration",
						"FunctionExpression",
						"ArrowFunctionExpression",
					])
				) {
					context.report({ node, messageId: "missingReturn" });
				}
			},
		};
	},
};
cx{(/**
 * @fileoverview Rule to flag non-camelcased identifiers
 * @author Nicholas C. Zakas
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				allow: [],
				ignoreDestructuring: false,
				ignoreGlobals: false,
				ignoreImports: false,
				properties: "always",
			},
		],

		docs: {
			description: "Enforce camelcase naming convention",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/camelcase",
		},

		schema: [
			{
				type: "object",
				properties: {
					ignoreDestructuring: {
						type: "boolean",
					},
					ignoreImports: {
						type: "boolean",
					},
					ignoreGlobals: {
						type: "boolean",
					},
					properties: {
						enum: ["always", "never"],
					},
					allow: {
						type: "array",
						items: {
							type: "string",
						},
						minItems: 0,
						uniqueItems: true,
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			notCamelCase: "Identifier '{{name}}' is not in camel case.",
			notCamelCasePrivate: "#{{name}} is not in camel case.",
		},
	},

	create(context) {
		const [
			{
				allow,
				ignoreDestructuring,
				ignoreGlobals,
				ignoreImports,
				properties,
			},
		] = context.options;
		const sourceCode = context.sourceCode;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		// contains reported nodes to avoid reporting twice on destructuring with shorthand notation
		const reported = new Set();

		/**
		 * Checks if a string contains an underscore and isn't all upper-case
		 * @param {string} name The string to check.
		 * @returns {boolean} if the string is underscored
		 * @private
		 */
		function isUnderscored(name) {
			const nameBody = name.replace(/^_+|_+$/gu, "");

			// if there's an underscore, it might be A_CONSTANT, which is okay
			return (
				nameBody.includes("_") && nameBody !== nameBody.toUpperCase()
			);
		}

		/**
		 * Checks if a string match the ignore list
		 * @param {string} name The string to check.
		 * @returns {boolean} if the string is ignored
		 * @private
		 */
		function isAllowed(name) {
			return allow.some(
				entry => name === entry || name.match(new RegExp(entry, "u")),
			);
		}

		/**
		 * Checks if a given name is good or not.
		 * @param {string} name The name to check.
		 * @returns {boolean} `true` if the name is good.
		 * @private
		 */
		function isGoodName(name) {
			return !isUnderscored(name) || isAllowed(name);
		}

		/**
		 * Checks if a given identifier reference or member expression is an assignment
		 * target.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} `true` if the node is an assignment target.
		 */
		function isAssignmentTarget(node) {
			const parent = node.parent;

			switch (parent.type) {
				case "AssignmentExpression":
				case "AssignmentPattern":
					return parent.left === node;

				case "Property":
					return (
						parent.parent.type === "ObjectPattern" &&
						parent.value === node
					);
				case "ArrayPattern":
				case "RestElement":
					return true;

				default:
					return false;
			}
		}

		/**
		 * Checks if a given binding identifier uses the original name as-is.
		 * - If it's in object destructuring or object expression, the original name is its property name.
		 * - If it's in import declaration, the original name is its exported name.
		 * @param {ASTNode} node The `Identifier` node to check.
		 * @returns {boolean} `true` if the identifier uses the original name as-is.
		 */
		function equalsToOriginalName(node) {
			const localName = node.name;
			const valueNode =
				node.parent.type === "AssignmentPattern" ? node.parent : node;
			const parent = valueNode.parent;

			switch (parent.type) {
				case "Property":
					return (
						(parent.parent.type === "ObjectPattern" ||
							parent.parent.type === "ObjectExpression") &&
						parent.value === valueNode &&
						!parent.computed &&
						parent.key.type === "Identifier" &&
						parent.key.name === localName
					);

				case "ImportSpecifier":
					return (
						parent.local === node &&
						astUtils.getModuleExportName(parent.imported) ===
							localName
					);

				default:
					return false;
			}
		}

		/**
		 * Reports an AST node as a rule violation.
		 * @param {ASTNode} node The node to report.
		 * @returns {void}
		 * @private
		 */
		function report(node) {
			if (reported.has(node.range[0])) {
				return;
			}
			reported.add(node.range[0]);

			// Report it.
			context.report({
				node,
				messageId:
					node.type === "PrivateIdentifier"
						? "notCamelCasePrivate"
						: "notCamelCase",
				data: { name: node.name },
			});
		}

		/**
		 * Reports an identifier reference or a binding identifier.
		 * @param {ASTNode} node The `Identifier` node to report.
		 * @returns {void}
		 */
		function reportReferenceId(node) {
			/*
			 * For backward compatibility, if it's in callings then ignore it.
			 * Not sure why it is.
			 */
			if (
				node.parent.type === "CallExpression" ||
				node.parent.type === "NewExpression"
			) {
				return;
			}

			/*
			 * For backward compatibility, if it's a default value of
			 * destructuring/parameters then ignore it.
			 * Not sure why it is.
			 */
			if (
				node.parent.type === "AssignmentPattern" &&
				node.parent.right === node
			) {
				return;
			}

			/*
			 * The `ignoreDestructuring` flag skips the identifiers that uses
			 * the property name as-is.
			 */
			if (ignoreDestructuring && equalsToOriginalName(node)) {
				return;
			}

			/*
			 * Import attribute keys are always ignored
			 */
			if (astUtils.isImportAttributeKey(node)) {
				return;
			}

			report(node);
		}

		return {
			// Report camelcase of global variable references ------------------
			Program(node) {
				const scope = sourceCode.getScope(node);

				if (!ignoreGlobals) {
					// Defined globals in config files or directive comments.
					for (const variable of scope.variables) {
						if (
							variable.identifiers.length > 0 ||
							isGoodName(variable.name)
						) {
							continue;
						}
						for (const reference of variable.references) {
							/*
							 * For backward compatibility, this rule reports read-only
							 * references as well.
							 */
							reportReferenceId(reference.identifier);
						}
					}
				}

				// Undefined globals.
				for (const reference of scope.through) {
					const id = reference.identifier;

					if (
						isGoodName(id.name) ||
						astUtils.isImportAttributeKey(id)
					) {
						continue;
					}

					/*
					 * For backward compatibility, this rule reports read-only
					 * references as well.
					 */
					reportReferenceId(id);
				}
			},

			// Report camelcase of declared variables --------------------------
			[[
				"VariableDeclaration",
				"FunctionDeclaration",
				"FunctionExpression",
				"ArrowFunctionExpression",
				"ClassDeclaration",
				"ClassExpression",
				"CatchClause",
			]](node) {
				for (const variable of sourceCode.getDeclaredVariables(node)) {
					if (isGoodName(variable.name)) {
						continue;
					}
					const id = variable.identifiers[0];

					// Report declaration.
					if (!(ignoreDestructuring && equalsToOriginalName(id))) {
						report(id);
					}

					/*
					 * For backward compatibility, report references as well.
					 * It looks unnecessary because declarations are reported.
					 */
					for (const reference of variable.references) {
						if (reference.init) {
							continue; // Skip the write references of initializers.
						}
						reportReferenceId(reference.identifier);
					}
				}
			},

			// Report camelcase in properties ----------------------------------
			[[
				"ObjectExpression > Property[computed!=true] > Identifier.key",
				"MethodDefinition[computed!=true] > Identifier.key",
				"PropertyDefinition[computed!=true] > Identifier.key",
				"MethodDefinition > PrivateIdentifier.key",
				"PropertyDefinition > PrivateIdentifier.key",
			]](node) {
				if (
					properties === "never" ||
					astUtils.isImportAttributeKey(node) ||
					isGoodName(node.name)
				) {
					return;
				}
				report(node);
			},
			"MemberExpression[computed!=true] > Identifier.property"(node) {
				if (
					properties === "never" ||
					!isAssignmentTarget(node.parent) || // ← ignore read-only references.
					isGoodName(node.name)
				) {
					return;
				}
				report(node);
			},

			// Report camelcase in import --------------------------------------
			ImportDeclaration(node) {
				for (const variable of sourceCode.getDeclaredVariables(node)) {
					if (isGoodName(variable.name)) {
						continue;
					}
					const id = variable.identifiers[0];

					// Report declaration.
					if (!(ignoreImports && equalsToOriginalName(id))) {
						report(id);
					}

					/*
					 * For backward compatibility, report references as well.
					 * It looks unnecessary because declarations are reported.
					 */
					for (const reference of variable.references) {
						reportReferenceId(reference.identifier);
					}
				}
			},

			// Report camelcase in re-export -----------------------------------
			[[
				"ExportAllDeclaration > Identifier.exported",
				"ExportSpecifier > Identifier.exported",
			]](node) {
				if (isGoodName(node.name)) {
					return;
				}
				report(node);
			},

			// Report camelcase in labels --------------------------------------
			[[
				"LabeledStatement > Identifier.label",

				/*
				 * For backward compatibility, report references as well.
				 * It looks unnecessary because declarations are reported.
				 */
				"BreakStatement > Identifier.label",
				"ContinueStatement > Identifier.label",
			]](node) {
				if (isGoodName(node.name)) {
					return;
				}
				report(node);
			},
		};
	},
};
0˴xT$/**
 * @fileoverview enforce or disallow capitalization of the first letter of a comment
 * @author Kevin Partington
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const DEFAULT_IGNORE_PATTERN = astUtils.COMMENTS_IGNORE_PATTERN,
	WHITESPACE = /\s/gu,
	MAYBE_URL = /^\s*[^:/?#\s]+:\/\/[^?#]/u, // TODO: Combine w/ max-len pattern?
	LETTER_PATTERN = /\p{L}/u;

/*
 * Base schema body for defining the basic capitalization rule, ignorePattern,
 * and ignoreInlineComments values.
 * This can be used in a few different ways in the actual schema.
 */
const SCHEMA_BODY = {
	type: "object",
	properties: {
		ignorePattern: {
			type: "string",
		},
		ignoreInlineComments: {
			type: "boolean",
		},
		ignoreConsecutiveComments: {
			type: "boolean",
		},
	},
	additionalProperties: false,
};
const DEFAULTS = {
	ignorePattern: "",
	ignoreInlineComments: false,
	ignoreConsecutiveComments: false,
};

/**
 * Get normalized options for either block or line comments from the given
 * user-provided options.
 * - If the user-provided options is just a string, returns a normalized
 *   set of options using default values for all other options.
 * - If the user-provided options is an object, then a normalized option
 *   set is returned. Options specified in overrides will take priority
 *   over options specified in the main options object, which will in
 *   turn take priority over the rule's defaults.
 * @param {Object|string} rawOptions The user-provided options.
 * @param {string} which Either "line" or "block".
 * @returns {Object} The normalized options.
 */
function getNormalizedOptions(rawOptions, which) {
	return Object.assign({}, DEFAULTS, rawOptions[which] || rawOptions);
}

/**
 * Get normalized options for block and line comments.
 * @param {Object|string} rawOptions The user-provided options.
 * @returns {Object} An object with "Line" and "Block" keys and corresponding
 * normalized options objects.
 */
function getAllNormalizedOptions(rawOptions = {}) {
	return {
		Line: getNormalizedOptions(rawOptions, "line"),
		Block: getNormalizedOptions(rawOptions, "block"),
	};
}

/**
 * Creates a regular expression for each ignorePattern defined in the rule
 * options.
 *
 * This is done in order to avoid invoking the RegExp constructor repeatedly.
 * @param {Object} normalizedOptions The normalized rule options.
 * @returns {void}
 */
function createRegExpForIgnorePatterns(normalizedOptions) {
	Object.keys(normalizedOptions).forEach(key => {
		const ignorePatternStr = normalizedOptions[key].ignorePattern;

		if (ignorePatternStr) {
			const regExp = RegExp(`^\\s*(?:${ignorePatternStr})`, "u");

			normalizedOptions[key].ignorePatternRegExp = regExp;
		}
	});
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Enforce or disallow capitalization of the first letter of a comment",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/capitalized-comments",
		},

		fixable: "code",

		schema: [
			{ enum: ["always", "never"] },
			{
				oneOf: [
					SCHEMA_BODY,
					{
						type: "object",
						properties: {
							line: SCHEMA_BODY,
							block: SCHEMA_BODY,
						},
						additionalProperties: false,
					},
				],
			},
		],

		defaultOptions: ["always"],

		messages: {
			unexpectedLowercaseComment:
				"Comments should not begin with a lowercase character.",
			unexpectedUppercaseComment:
				"Comments should not begin with an uppercase character.",
		},
	},

	create(context) {
		const capitalize = context.options[0],
			normalizedOptions = getAllNormalizedOptions(context.options[1]),
			sourceCode = context.sourceCode;

		createRegExpForIgnorePatterns(normalizedOptions);

		//----------------------------------------------------------------------
		// Helpers
		//----------------------------------------------------------------------

		/**
		 * Checks whether a comment is an inline comment.
		 *
		 * For the purpose of this rule, a comment is inline if:
		 * 1. The comment is preceded by a token on the same line; and
		 * 2. The command is followed by a token on the same line.
		 *
		 * Note that the comment itself need not be single-line!
		 *
		 * Also, it follows from this definition that only block comments can
		 * be considered as possibly inline. This is because line comments
		 * would consume any following tokens on the same line as the comment.
		 * @param {ASTNode} comment The comment node to check.
		 * @returns {boolean} True if the comment is an inline comment, false
		 * otherwise.
		 */
		function isInlineComment(comment) {
			const previousToken = sourceCode.getTokenBefore(comment, {
					includeComments: true,
				}),
				nextToken = sourceCode.getTokenAfter(comment, {
					includeComments: true,
				});

			return Boolean(
				previousToken &&
				nextToken &&
				comment.loc.start.line === previousToken.loc.end.line &&
				comment.loc.end.line === nextToken.loc.start.line,
			);
		}

		/**
		 * Determine if a comment follows another comment.
		 * @param {ASTNode} comment The comment to check.
		 * @returns {boolean} True if the comment follows a valid comment.
		 */
		function isConsecutiveComment(comment) {
			const previousTokenOrComment = sourceCode.getTokenBefore(comment, {
				includeComments: true,
			});

			return Boolean(
				previousTokenOrComment &&
				["Block", "Line"].includes(previousTokenOrComment.type),
			);
		}

		/**
		 * Check a comment to determine if it is valid for this rule.
		 * @param {ASTNode} comment The comment node to process.
		 * @param {Object} options The options for checking this comment.
		 * @returns {boolean} True if the comment is valid, false otherwise.
		 */
		function isCommentValid(comment, options) {
			// 1. Check for default ignore pattern.
			if (DEFAULT_IGNORE_PATTERN.test(comment.value)) {
				return true;
			}

			// 2. Check for custom ignore pattern.
			const commentWithoutAsterisks = comment.value.replace(/\*/gu, "");

			if (
				options.ignorePatternRegExp &&
				options.ignorePatternRegExp.test(commentWithoutAsterisks)
			) {
				return true;
			}

			// 3. Check for inline comments.
			if (options.ignoreInlineComments && isInlineComment(comment)) {
				return true;
			}

			// 4. Is this a consecutive comment (and are we tolerating those)?
			if (
				options.ignoreConsecutiveComments &&
				isConsecutiveComment(comment)
			) {
				return true;
			}

			// 5. Does the comment start with a possible URL?
			if (MAYBE_URL.test(commentWithoutAsterisks)) {
				return true;
			}

			// 6. Is the initial word character a letter?
			const commentWordCharsOnly = commentWithoutAsterisks.replace(
				WHITESPACE,
				"",
			);

			if (commentWordCharsOnly.length === 0) {
				return true;
			}

			// Get the first Unicode character (1 or 2 code units).
			const [firstWordChar] = commentWordCharsOnly;

			if (!LETTER_PATTERN.test(firstWordChar)) {
				return true;
			}

			// 7. Check the case of the initial word character.
			const isUppercase =
					firstWordChar !== firstWordChar.toLocaleLowerCase(),
				isLowercase =
					firstWordChar !== firstWordChar.toLocaleUpperCase();

			if (capitalize === "always" && isLowercase) {
				return false;
			}
			if (capitalize === "never" && isUppercase) {
				return false;
			}

			return true;
		}

		/**
		 * Process a comment to determine if it needs to be reported.
		 * @param {ASTNode} comment The comment node to process.
		 * @returns {void}
		 */
		function processComment(comment) {
			const options = normalizedOptions[comment.type],
				commentValid = isCommentValid(comment, options);

			if (!commentValid) {
				const messageId =
					capitalize === "always"
						? "unexpectedLowercaseComment"
						: "unexpectedUppercaseComment";

				context.report({
					node: null, // Intentionally using loc instead
					loc: comment.loc,
					messageId,
					fix(fixer) {
						const match = comment.value.match(LETTER_PATTERN);
						const char = match[0];

						// Offset match.index by 2 to account for the first 2 characters that start the comment (// or /*)
						const charIndex = comment.range[0] + match.index + 2;

						return fixer.replaceTextRange(
							[charIndex, charIndex + char.length],
							capitalize === "always"
								? char.toLocaleUpperCase()
								: char.toLocaleLowerCase(),
						);
					},
				});
			}
		}

		//----------------------------------------------------------------------
		// Public
		//----------------------------------------------------------------------

		return {
			Program() {
				const comments = sourceCode.getAllComments();

				comments
					.filter(token => token.type !== "Shebang")
					.forEach(processComment);
			},
		};
	},
};
.x/**
 * @fileoverview Rule to enforce that all class methods use 'this'.
 * @author Patrick Williams
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				enforceForClassFields: true,
				exceptMethods: [],
				ignoreOverrideMethods: false,
			},
		],

		docs: {
			description: "Enforce that class methods utilize `this`",
			dialects: ["JavaScript", "TypeScript"],
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/class-methods-use-this",
		},

		schema: [
			{
				type: "object",
				properties: {
					exceptMethods: {
						type: "array",
						items: {
							type: "string",
						},
					},
					enforceForClassFields: {
						type: "boolean",
					},
					ignoreOverrideMethods: {
						type: "boolean",
					},
					ignoreClassesWithImplements: {
						enum: ["all", "public-fields"],
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			missingThis: "Expected 'this' to be used by class {{name}}.",
		},
	},
	create(context) {
		const [options] = context.options;
		const {
			enforceForClassFields,
			ignoreOverrideMethods,
			ignoreClassesWithImplements,
		} = options;
		const exceptMethods = new Set(options.exceptMethods);

		const stack = [];

		/**
		 * Push `this` used flag initialized with `false` onto the stack.
		 * @returns {void}
		 */
		function pushContext() {
			stack.push(false);
		}

		/**
		 * Pop `this` used flag from the stack.
		 * @returns {boolean | undefined} `this` used flag
		 */
		function popContext() {
			return stack.pop();
		}

		/**
		 * Initializes the current context to false and pushes it onto the stack.
		 * These booleans represent whether 'this' has been used in the context.
		 * @returns {void}
		 * @private
		 */
		function enterFunction() {
			pushContext();
		}

		/**
		 * Check if the node is an instance method
		 * @param {ASTNode} node node to check
		 * @returns {boolean} True if its an instance method
		 * @private
		 */
		function isInstanceMethod(node) {
			switch (node.type) {
				case "MethodDefinition":
					return !node.static && node.kind !== "constructor";
				case "AccessorProperty":
				case "PropertyDefinition":
					return !node.static && enforceForClassFields;
				default:
					return false;
			}
		}

		/**
		 * Check if the node's parent class implements any interfaces
		 * @param {ASTNode} node node to check
		 * @returns {boolean} True if parent class implements interfaces
		 * @private
		 */
		function hasImplements(node) {
			const classNode = node.parent.parent;
			return (
				(classNode?.type === "ClassDeclaration" ||
					classNode?.type === "ClassExpression") &&
				classNode.implements?.length > 0
			);
		}

		/**
		 * Check if the node is an instance method not excluded by config
		 * @param {ASTNode} node node to check
		 * @returns {boolean} True if it is an instance method, and not excluded by config
		 * @private
		 */
		function isIncludedInstanceMethod(node) {
			if (isInstanceMethod(node)) {
				if (ignoreOverrideMethods && node.override) {
					return false;
				}

				if (ignoreClassesWithImplements) {
					const implementsInterfaces = hasImplements(node);
					if (implementsInterfaces) {
						if (
							ignoreClassesWithImplements === "all" ||
							(ignoreClassesWithImplements === "public-fields" &&
								node.key.type !== "PrivateIdentifier" &&
								(!node.accessibility ||
									node.accessibility === "public"))
						) {
							return false;
						}
					}
				}

				if (node.computed) {
					return true;
				}

				const hashIfNeeded =
					node.key.type === "PrivateIdentifier" ? "#" : "";
				const name =
					node.key.type === "Literal"
						? astUtils.getStaticStringValue(node.key)
						: node.key.name || "";

				return !exceptMethods.has(hashIfNeeded + name);
			}
			return false;
		}

		/**
		 * Checks if we are leaving a function that is a method, and reports if 'this' has not been used.
		 * Static methods and the constructor are exempt.
		 * Then pops the context off the stack.
		 * @param {ASTNode} node A function node that was entered.
		 * @returns {void}
		 * @private
		 */
		function exitFunction(node) {
			const methodUsesThis = popContext();

			if (isIncludedInstanceMethod(node.parent) && !methodUsesThis) {
				context.report({
					node,
					loc: astUtils.getFunctionHeadLoc(node, context.sourceCode),
					messageId: "missingThis",
					data: {
						name: astUtils.getFunctionNameWithKind(node),
					},
				});
			}
		}

		/**
		 * Mark the current context as having used 'this'.
		 * @returns {void}
		 * @private
		 */
		function markThisUsed() {
			if (stack.length) {
				stack[stack.length - 1] = true;
			}
		}

		return {
			FunctionDeclaration: enterFunction,
			"FunctionDeclaration:exit": exitFunction,
			FunctionExpression: enterFunction,
			"FunctionExpression:exit": exitFunction,

			/*
			 * Class field value are implicit functions.
			 */
			"AccessorProperty > *.key:exit": pushContext,
			"AccessorProperty:exit": popContext,
			"PropertyDefinition > *.key:exit": pushContext,
			"PropertyDefinition:exit": popContext,

			/*
			 * Class static blocks are implicit functions. They aren't required to use `this`,
			 * but we have to push context so that it captures any use of `this` in the static block
			 * separately from enclosing contexts, because static blocks have their own `this` and it
			 * shouldn't count as used `this` in enclosing contexts.
			 */
			StaticBlock: pushContext,
			"StaticBlock:exit": popContext,

			ThisExpression: markThisUsed,
			Super: markThisUsed,
			...(enforceForClassFields && {
				"AccessorProperty > ArrowFunctionExpression.value":
					enterFunction,
				"AccessorProperty > ArrowFunctionExpression.value:exit":
					exitFunction,
				"PropertyDefinition > ArrowFunctionExpression.value":
					enterFunction,
				"PropertyDefinition > ArrowFunctionExpression.value:exit":
					exitFunction,
			}),
		};
	},
};

?x-{/**
 * @fileoverview Rule to forbid or enforce dangling commas.
 * @author Ian Christian Myers
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const DEFAULT_OPTIONS = Object.freeze({
	arrays: "never",
	objects: "never",
	imports: "never",
	exports: "never",
	functions: "never",
});

/**
 * Checks whether or not a trailing comma is allowed in a given node.
 * If the `lastItem` is `RestElement` or `RestProperty`, it disallows trailing commas.
 * @param {ASTNode} lastItem The node of the last element in the given node.
 * @returns {boolean} `true` if a trailing comma is allowed.
 */
function isTrailingCommaAllowed(lastItem) {
	return !(
		lastItem.type === "RestElement" ||
		lastItem.type === "RestProperty" ||
		lastItem.type === "ExperimentalRestProperty"
	);
}

/**
 * Normalize option value.
 * @param {string|Object|undefined} optionValue The 1st option value to normalize.
 * @param {number} ecmaVersion The normalized ECMAScript version.
 * @returns {Object} The normalized option value.
 */
function normalizeOptions(optionValue, ecmaVersion) {
	if (typeof optionValue === "string") {
		return {
			arrays: optionValue,
			objects: optionValue,
			imports: optionValue,
			exports: optionValue,
			functions: ecmaVersion < 2017 ? "ignore" : optionValue,
		};
	}
	if (typeof optionValue === "object" && optionValue !== null) {
		return {
			arrays: optionValue.arrays || DEFAULT_OPTIONS.arrays,
			objects: optionValue.objects || DEFAULT_OPTIONS.objects,
			imports: optionValue.imports || DEFAULT_OPTIONS.imports,
			exports: optionValue.exports || DEFAULT_OPTIONS.exports,
			functions: optionValue.functions || DEFAULT_OPTIONS.functions,
		};
	}

	return DEFAULT_OPTIONS;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "comma-dangle",
						url: "https://eslint.style/rules/comma-dangle",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Require or disallow trailing commas",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/comma-dangle",
		},

		fixable: "code",

		schema: {
			definitions: {
				value: {
					enum: [
						"always-multiline",
						"always",
						"never",
						"only-multiline",
					],
				},
				valueWithIgnore: {
					enum: [
						"always-multiline",
						"always",
						"ignore",
						"never",
						"only-multiline",
					],
				},
			},
			type: "array",
			items: [
				{
					oneOf: [
						{
							$ref: "#/definitions/value",
						},
						{
							type: "object",
							properties: {
								arrays: {
									$ref: "#/definitions/valueWithIgnore",
								},
								objects: {
									$ref: "#/definitions/valueWithIgnore",
								},
								imports: {
									$ref: "#/definitions/valueWithIgnore",
								},
								exports: {
									$ref: "#/definitions/valueWithIgnore",
								},
								functions: {
									$ref: "#/definitions/valueWithIgnore",
								},
							},
							additionalProperties: false,
						},
					],
				},
			],
			additionalItems: false,
		},

		messages: {
			unexpected: "Unexpected trailing comma.",
			missing: "Missing trailing comma.",
		},
	},

	create(context) {
		const options = normalizeOptions(
			context.options[0],
			context.languageOptions.ecmaVersion,
		);

		const sourceCode = context.sourceCode;

		/**
		 * Gets the last item of the given node.
		 * @param {ASTNode} node The node to get.
		 * @returns {ASTNode|null} The last node or null.
		 */
		function getLastItem(node) {
			/**
			 * Returns the last element of an array
			 * @param {any[]} array The input array
			 * @returns {any} The last element
			 */
			function last(array) {
				return array.at(-1);
			}

			switch (node.type) {
				case "ObjectExpression":
				case "ObjectPattern":
					return last(node.properties);
				case "ArrayExpression":
				case "ArrayPattern":
					return last(node.elements);
				case "ImportDeclaration":
				case "ExportNamedDeclaration":
					return last(node.specifiers);
				case "FunctionDeclaration":
				case "FunctionExpression":
				case "ArrowFunctionExpression":
					return last(node.params);
				case "CallExpression":
				case "NewExpression":
					return last(node.arguments);
				default:
					return null;
			}
		}

		/**
		 * Gets the trailing comma token of the given node.
		 * If the trailing comma does not exist, this returns the token which is
		 * the insertion point of the trailing comma token.
		 * @param {ASTNode} node The node to get.
		 * @param {ASTNode} lastItem The last item of the node.
		 * @returns {Token} The trailing comma token or the insertion point.
		 */
		function getTrailingToken(node, lastItem) {
			switch (node.type) {
				case "ObjectExpression":
				case "ArrayExpression":
				case "CallExpression":
				case "NewExpression":
					return sourceCode.getLastToken(node, 1);
				default: {
					const nextToken = sourceCode.getTokenAfter(lastItem);

					if (astUtils.isCommaToken(nextToken)) {
						return nextToken;
					}
					return sourceCode.getLastToken(lastItem);
				}
			}
		}

		/**
		 * Checks whether or not a given node is multiline.
		 * This rule handles a given node as multiline when the closing parenthesis
		 * and the last element are not on the same line.
		 * @param {ASTNode} node A node to check.
		 * @returns {boolean} `true` if the node is multiline.
		 */
		function isMultiline(node) {
			const lastItem = getLastItem(node);

			if (!lastItem) {
				return false;
			}

			const penultimateToken = getTrailingToken(node, lastItem);
			const lastToken = sourceCode.getTokenAfter(penultimateToken);

			return lastToken.loc.end.line !== penultimateToken.loc.end.line;
		}

		/**
		 * Reports a trailing comma if it exists.
		 * @param {ASTNode} node A node to check. Its type is one of
		 *   ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern,
		 *   ImportDeclaration, and ExportNamedDeclaration.
		 * @returns {void}
		 */
		function forbidTrailingComma(node) {
			const lastItem = getLastItem(node);

			if (
				!lastItem ||
				(node.type === "ImportDeclaration" &&
					lastItem.type !== "ImportSpecifier")
			) {
				return;
			}

			const trailingToken = getTrailingToken(node, lastItem);

			if (astUtils.isCommaToken(trailingToken)) {
				context.report({
					node: lastItem,
					loc: trailingToken.loc,
					messageId: "unexpected",
					*fix(fixer) {
						yield fixer.remove(trailingToken);

						/*
						 * Extend the range of the fix to include surrounding tokens to ensure
						 * that the element after which the comma is removed stays _last_.
						 * This intentionally makes conflicts in fix ranges with rules that may be
						 * adding or removing elements in the same autofix pass.
						 * https://github.com/eslint/eslint/issues/15660
						 */
						yield fixer.insertTextBefore(
							sourceCode.getTokenBefore(trailingToken),
							"",
						);
						yield fixer.insertTextAfter(
							sourceCode.getTokenAfter(trailingToken),
							"",
						);
					},
				});
			}
		}

		/**
		 * Reports the last element of a given node if it does not have a trailing
		 * comma.
		 *
		 * If a given node is `ArrayPattern` which has `RestElement`, the trailing
		 * comma is disallowed, so report if it exists.
		 * @param {ASTNode} node A node to check. Its type is one of
		 *   ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern,
		 *   ImportDeclaration, and ExportNamedDeclaration.
		 * @returns {void}
		 */
		function forceTrailingComma(node) {
			const lastItem = getLastItem(node);

			if (
				!lastItem ||
				(node.type === "ImportDeclaration" &&
					lastItem.type !== "ImportSpecifier")
			) {
				return;
			}
			if (!isTrailingCommaAllowed(lastItem)) {
				forbidTrailingComma(node);
				return;
			}

			const trailingToken = getTrailingToken(node, lastItem);

			if (trailingToken.value !== ",") {
				context.report({
					node: lastItem,
					loc: {
						start: trailingToken.loc.end,
						end: astUtils.getNextLocation(
							sourceCode,
							trailingToken.loc.end,
						),
					},
					messageId: "missing",
					*fix(fixer) {
						yield fixer.insertTextAfter(trailingToken, ",");

						/*
						 * Extend the range of the fix to include surrounding tokens to ensure
						 * that the element after which the comma is inserted stays _last_.
						 * This intentionally makes conflicts in fix ranges with rules that may be
						 * adding or removing elements in the same autofix pass.
						 * https://github.com/eslint/eslint/issues/15660
						 */
						yield fixer.insertTextBefore(trailingToken, "");
						yield fixer.insertTextAfter(
							sourceCode.getTokenAfter(trailingToken),
							"",
						);
					},
				});
			}
		}

		/**
		 * If a given node is multiline, reports the last element of a given node
		 * when it does not have a trailing comma.
		 * Otherwise, reports a trailing comma if it exists.
		 * @param {ASTNode} node A node to check. Its type is one of
		 *   ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern,
		 *   ImportDeclaration, and ExportNamedDeclaration.
		 * @returns {void}
		 */
		function forceTrailingCommaIfMultiline(node) {
			if (isMultiline(node)) {
				forceTrailingComma(node);
			} else {
				forbidTrailingComma(node);
			}
		}

		/**
		 * Only if a given node is not multiline, reports the last element of a given node
		 * when it does not have a trailing comma.
		 * Otherwise, reports a trailing comma if it exists.
		 * @param {ASTNode} node A node to check. Its type is one of
		 *   ObjectExpression, ObjectPattern, ArrayExpression, ArrayPattern,
		 *   ImportDeclaration, and ExportNamedDeclaration.
		 * @returns {void}
		 */
		function allowTrailingCommaIfMultiline(node) {
			if (!isMultiline(node)) {
				forbidTrailingComma(node);
			}
		}

		const predicate = {
			always: forceTrailingComma,
			"always-multiline": forceTrailingCommaIfMultiline,
			"only-multiline": allowTrailingCommaIfMultiline,
			never: forbidTrailingComma,
			ignore() {},
		};

		return {
			ObjectExpression: predicate[options.objects],
			ObjectPattern: predicate[options.objects],

			ArrayExpression: predicate[options.arrays],
			ArrayPattern: predicate[options.arrays],

			ImportDeclaration: predicate[options.imports],

			ExportNamedDeclaration: predicate[options.exports],

			FunctionDeclaration: predicate[options.functions],
			FunctionExpression: predicate[options.functions],
			ArrowFunctionExpression: predicate[options.functions],
			CallExpression: predicate[options.functions],
			NewExpression: predicate[options.functions],
		};
	},
};
ݽx!/**
 * @fileoverview Comma spacing - validates spacing before and after comma
 * @author Vignesh Anand aka vegetableman.
 * @deprecated in ESLint v8.53.0
 */
"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "comma-spacing",
						url: "https://eslint.style/rules/comma-spacing",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Enforce consistent spacing before and after commas",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/comma-spacing",
		},

		fixable: "whitespace",

		schema: [
			{
				type: "object",
				properties: {
					before: {
						type: "boolean",
						default: false,
					},
					after: {
						type: "boolean",
						default: true,
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			missing: "A space is required {{loc}} ','.",
			unexpected: "There should be no space {{loc}} ','.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const tokensAndComments = sourceCode.tokensAndComments;

		const options = {
			before: context.options[0] ? context.options[0].before : false,
			after: context.options[0] ? context.options[0].after : true,
		};

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		// list of comma tokens to ignore for the check of leading whitespace
		const commaTokensToIgnore = [];

		/**
		 * Reports a spacing error with an appropriate message.
		 * @param {ASTNode} node The binary expression node to report.
		 * @param {string} loc Is the error "before" or "after" the comma?
		 * @param {ASTNode} otherNode The node at the left or right of `node`
		 * @returns {void}
		 * @private
		 */
		function report(node, loc, otherNode) {
			context.report({
				node,
				fix(fixer) {
					if (options[loc]) {
						if (loc === "before") {
							return fixer.insertTextBefore(node, " ");
						}
						return fixer.insertTextAfter(node, " ");
					}
					let start, end;
					const newText = "";

					if (loc === "before") {
						start = otherNode.range[1];
						end = node.range[0];
					} else {
						start = node.range[1];
						end = otherNode.range[0];
					}

					return fixer.replaceTextRange([start, end], newText);
				},
				messageId: options[loc] ? "missing" : "unexpected",
				data: {
					loc,
				},
			});
		}

		/**
		 * Adds null elements of the given ArrayExpression or ArrayPattern node to the ignore list.
		 * @param {ASTNode} node An ArrayExpression or ArrayPattern node.
		 * @returns {void}
		 */
		function addNullElementsToIgnoreList(node) {
			let previousToken = sourceCode.getFirstToken(node);

			node.elements.forEach(element => {
				let token;

				if (element === null) {
					token = sourceCode.getTokenAfter(previousToken);

					if (astUtils.isCommaToken(token)) {
						commaTokensToIgnore.push(token);
					}
				} else {
					token = sourceCode.getTokenAfter(element);
				}

				previousToken = token;
			});
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			"Program:exit"() {
				tokensAndComments.forEach((token, i) => {
					if (!astUtils.isCommaToken(token)) {
						return;
					}

					const previousToken = tokensAndComments[i - 1];
					const nextToken = tokensAndComments[i + 1];

					if (
						previousToken &&
						!astUtils.isCommaToken(previousToken) && // ignore spacing between two commas
						/*
						 * `commaTokensToIgnore` are ending commas of `null` elements (array holes/elisions).
						 * In addition to spacing between two commas, this can also ignore:
						 *
						 *   - Spacing after `[` (controlled by array-bracket-spacing)
						 *       Example: [ , ]
						 *                 ^
						 *   - Spacing after a comment (for backwards compatibility, this was possibly unintentional)
						 *       Example: [a, /* * / ,]
						 *                          ^
						 */
						!commaTokensToIgnore.includes(token) &&
						astUtils.isTokenOnSameLine(previousToken, token) &&
						options.before !==
							sourceCode.isSpaceBetween(previousToken, token)
					) {
						report(token, "before", previousToken);
					}

					if (
						nextToken &&
						!astUtils.isCommaToken(nextToken) && // ignore spacing between two commas
						!astUtils.isClosingParenToken(nextToken) && // controlled by space-in-parens
						!astUtils.isClosingBracketToken(nextToken) && // controlled by array-bracket-spacing
						!astUtils.isClosingBraceToken(nextToken) && // controlled by object-curly-spacing
						!(!options.after && nextToken.type === "Line") && // special case, allow space before line comment
						astUtils.isTokenOnSameLine(token, nextToken) &&
						options.after !==
							sourceCode.isSpaceBetween(token, nextToken)
					) {
						report(token, "after", nextToken);
					}
				});
			},
			ArrayExpression: addNullElementsToIgnoreList,
			ArrayPattern: addNullElementsToIgnoreList,
		};
	},
};
x(/**
 * @fileoverview Comma style - enforces comma styles of two types: last and first
 * @author Vignesh Anand aka vegetableman
 * @deprecated in ESLint v8.53.0
 */

"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "comma-style",
						url: "https://eslint.style/rules/comma-style",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Enforce consistent comma style",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/comma-style",
		},

		fixable: "code",

		schema: [
			{
				enum: ["first", "last"],
			},
			{
				type: "object",
				properties: {
					exceptions: {
						type: "object",
						additionalProperties: {
							type: "boolean",
						},
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			unexpectedLineBeforeAndAfterComma:
				"Bad line breaking before and after ','.",
			expectedCommaFirst: "',' should be placed first.",
			expectedCommaLast: "',' should be placed last.",
		},
	},

	create(context) {
		const style = context.options[0] || "last",
			sourceCode = context.sourceCode;
		const exceptions = {
			ArrayPattern: true,
			ArrowFunctionExpression: true,
			CallExpression: true,
			FunctionDeclaration: true,
			FunctionExpression: true,
			ImportDeclaration: true,
			ObjectPattern: true,
			NewExpression: true,
		};

		if (
			context.options.length === 2 &&
			Object.hasOwn(context.options[1], "exceptions")
		) {
			const keys = Object.keys(context.options[1].exceptions);

			for (let i = 0; i < keys.length; i++) {
				exceptions[keys[i]] = context.options[1].exceptions[keys[i]];
			}
		}

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Modified text based on the style
		 * @param {string} styleType Style type
		 * @param {string} text Source code text
		 * @returns {string} modified text
		 * @private
		 */
		function getReplacedText(styleType, text) {
			switch (styleType) {
				case "between":
					return `,${text.replace(astUtils.LINEBREAK_MATCHER, "")}`;

				case "first":
					return `${text},`;

				case "last":
					return `,${text}`;

				default:
					return "";
			}
		}

		/**
		 * Determines the fixer function for a given style.
		 * @param {string} styleType comma style
		 * @param {ASTNode} previousItemToken The token to check.
		 * @param {ASTNode} commaToken The token to check.
		 * @param {ASTNode} currentItemToken The token to check.
		 * @returns {Function} Fixer function
		 * @private
		 */
		function getFixerFunction(
			styleType,
			previousItemToken,
			commaToken,
			currentItemToken,
		) {
			const text =
				sourceCode.text.slice(
					previousItemToken.range[1],
					commaToken.range[0],
				) +
				sourceCode.text.slice(
					commaToken.range[1],
					currentItemToken.range[0],
				);
			const range = [
				previousItemToken.range[1],
				currentItemToken.range[0],
			];

			return function (fixer) {
				return fixer.replaceTextRange(
					range,
					getReplacedText(styleType, text),
				);
			};
		}

		/**
		 * Validates the spacing around single items in lists.
		 * @param {Token} previousItemToken The last token from the previous item.
		 * @param {Token} commaToken The token representing the comma.
		 * @param {Token} currentItemToken The first token of the current item.
		 * @param {Token} reportItem The item to use when reporting an error.
		 * @returns {void}
		 * @private
		 */
		function validateCommaItemSpacing(
			previousItemToken,
			commaToken,
			currentItemToken,
			reportItem,
		) {
			// if single line
			if (
				astUtils.isTokenOnSameLine(commaToken, currentItemToken) &&
				astUtils.isTokenOnSameLine(previousItemToken, commaToken)
			) {
				// do nothing.
			} else if (
				!astUtils.isTokenOnSameLine(commaToken, currentItemToken) &&
				!astUtils.isTokenOnSameLine(previousItemToken, commaToken)
			) {
				const comment = sourceCode.getCommentsAfter(commaToken)[0];
				const styleType =
					comment &&
					comment.type === "Block" &&
					astUtils.isTokenOnSameLine(commaToken, comment)
						? style
						: "between";

				// lone comma
				context.report({
					node: reportItem,
					loc: commaToken.loc,
					messageId: "unexpectedLineBeforeAndAfterComma",
					fix: getFixerFunction(
						styleType,
						previousItemToken,
						commaToken,
						currentItemToken,
					),
				});
			} else if (
				style === "first" &&
				!astUtils.isTokenOnSameLine(commaToken, currentItemToken)
			) {
				context.report({
					node: reportItem,
					loc: commaToken.loc,
					messageId: "expectedCommaFirst",
					fix: getFixerFunction(
						style,
						previousItemToken,
						commaToken,
						currentItemToken,
					),
				});
			} else if (
				style === "last" &&
				astUtils.isTokenOnSameLine(commaToken, currentItemToken)
			) {
				context.report({
					node: reportItem,
					loc: commaToken.loc,
					messageId: "expectedCommaLast",
					fix: getFixerFunction(
						style,
						previousItemToken,
						commaToken,
						currentItemToken,
					),
				});
			}
		}

		/**
		 * Checks the comma placement with regards to a declaration/property/element
		 * @param {ASTNode} node The binary expression node to check
		 * @param {string} property The property of the node containing child nodes.
		 * @private
		 * @returns {void}
		 */
		function validateComma(node, property) {
			const items = node[property],
				arrayLiteral =
					node.type === "ArrayExpression" ||
					node.type === "ArrayPattern";

			if (items.length > 1 || arrayLiteral) {
				// seed as opening [
				let previousItemToken = sourceCode.getFirstToken(node);

				items.forEach(item => {
					const commaToken = item
							? sourceCode.getTokenBefore(item)
							: previousItemToken,
						currentItemToken = item
							? sourceCode.getFirstToken(item)
							: sourceCode.getTokenAfter(commaToken),
						reportItem = item || currentItemToken;

					/*
					 * This works by comparing three token locations:
					 * - previousItemToken is the last token of the previous item
					 * - commaToken is the location of the comma before the current item
					 * - currentItemToken is the first token of the current item
					 *
					 * These values get switched around if item is undefined.
					 * previousItemToken will refer to the last token not belonging
					 * to the current item, which could be a comma or an opening
					 * square bracket. currentItemToken could be a comma.
					 *
					 * All comparisons are done based on these tokens directly, so
					 * they are always valid regardless of an undefined item.
					 */
					if (astUtils.isCommaToken(commaToken)) {
						validateCommaItemSpacing(
							previousItemToken,
							commaToken,
							currentItemToken,
							reportItem,
						);
					}

					if (item) {
						const tokenAfterItem = sourceCode.getTokenAfter(
							item,
							astUtils.isNotClosingParenToken,
						);

						previousItemToken = tokenAfterItem
							? sourceCode.getTokenBefore(tokenAfterItem)
							: sourceCode.ast.tokens.at(-1);
					} else {
						previousItemToken = currentItemToken;
					}
				});

				/*
				 * Special case for array literals that have empty last items, such
				 * as [ 1, 2, ]. These arrays only have two items show up in the
				 * AST, so we need to look at the token to verify that there's no
				 * dangling comma.
				 */
				if (arrayLiteral) {
					const lastToken = sourceCode.getLastToken(node),
						nextToLastToken = sourceCode.getTokenBefore(lastToken);

					if (astUtils.isCommaToken(nextToLastToken)) {
						validateCommaItemSpacing(
							sourceCode.getTokenBefore(nextToLastToken),
							nextToLastToken,
							lastToken,
							lastToken,
						);
					}
				}
			}
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		const nodes = {};

		if (!exceptions.VariableDeclaration) {
			nodes.VariableDeclaration = function (node) {
				validateComma(node, "declarations");
			};
		}
		if (!exceptions.ObjectExpression) {
			nodes.ObjectExpression = function (node) {
				validateComma(node, "properties");
			};
		}
		if (!exceptions.ObjectPattern) {
			nodes.ObjectPattern = function (node) {
				validateComma(node, "properties");
			};
		}
		if (!exceptions.ArrayExpression) {
			nodes.ArrayExpression = function (node) {
				validateComma(node, "elements");
			};
		}
		if (!exceptions.ArrayPattern) {
			nodes.ArrayPattern = function (node) {
				validateComma(node, "elements");
			};
		}
		if (!exceptions.FunctionDeclaration) {
			nodes.FunctionDeclaration = function (node) {
				validateComma(node, "params");
			};
		}
		if (!exceptions.FunctionExpression) {
			nodes.FunctionExpression = function (node) {
				validateComma(node, "params");
			};
		}
		if (!exceptions.ArrowFunctionExpression) {
			nodes.ArrowFunctionExpression = function (node) {
				validateComma(node, "params");
			};
		}
		if (!exceptions.CallExpression) {
			nodes.CallExpression = function (node) {
				validateComma(node, "arguments");
			};
		}
		if (!exceptions.ImportDeclaration) {
			nodes.ImportDeclaration = function (node) {
				validateComma(node, "specifiers");
			};
		}
		if (!exceptions.NewExpression) {
			nodes.NewExpression = function (node) {
				validateComma(node, "arguments");
			};
		}

		return nodes;
	},
};
-z xK/**
 * @fileoverview Counts the cyclomatic complexity of each function of the script. See https://en.wikipedia.org/wiki/Cyclomatic_complexity.
 * Counts the number of if, conditional, for, while, try, switch/case,
 * @author Patrick Brosset
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");
const { upperCaseFirst } = require("../shared/string-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

const THRESHOLD_DEFAULT = 20;

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [THRESHOLD_DEFAULT],

		docs: {
			description:
				"Enforce a maximum cyclomatic complexity allowed in a program",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/complexity",
		},

		schema: [
			{
				oneOf: [
					{
						type: "integer",
						minimum: 0,
					},
					{
						type: "object",
						properties: {
							maximum: {
								type: "integer",
								minimum: 0,
							},
							max: {
								type: "integer",
								minimum: 0,
							},
							variant: {
								enum: ["classic", "modified"],
							},
						},
						additionalProperties: false,
					},
				],
			},
		],

		messages: {
			complex:
				"{{name}} has a complexity of {{complexity}}. Maximum allowed is {{max}}.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const option = context.options[0];
		let threshold = THRESHOLD_DEFAULT;
		let VARIANT = "classic";

		if (typeof option === "object") {
			if (
				Object.hasOwn(option, "maximum") ||
				Object.hasOwn(option, "max")
			) {
				threshold = option.maximum || option.max;
			}

			if (Object.hasOwn(option, "variant")) {
				VARIANT = option.variant;
			}
		} else if (typeof option === "number") {
			threshold = option;
		}

		const IS_MODIFIED_COMPLEXITY = VARIANT === "modified";

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		// Using a stack to store complexity per code path
		const complexities = [];

		/**
		 * Increase the complexity of the code path in context
		 * @returns {void}
		 * @private
		 */
		function increaseComplexity() {
			complexities[complexities.length - 1]++;
		}

		//--------------------------------------------------------------------------
		// Public API
		//--------------------------------------------------------------------------

		return {
			onCodePathStart() {
				// The initial complexity is 1, representing one execution path in the CodePath
				complexities.push(1);
			},

			// Each branching in the code adds 1 to the complexity
			CatchClause: increaseComplexity,
			ConditionalExpression: increaseComplexity,
			LogicalExpression: increaseComplexity,
			ForStatement: increaseComplexity,
			ForInStatement: increaseComplexity,
			ForOfStatement: increaseComplexity,
			IfStatement: increaseComplexity,
			WhileStatement: increaseComplexity,
			DoWhileStatement: increaseComplexity,
			AssignmentPattern: increaseComplexity,

			// Avoid `default`
			"SwitchCase[test]": () =>
				IS_MODIFIED_COMPLEXITY || increaseComplexity(),
			SwitchStatement: () =>
				IS_MODIFIED_COMPLEXITY && increaseComplexity(),

			// Logical assignment operators have short-circuiting behavior
			AssignmentExpression(node) {
				if (astUtils.isLogicalAssignmentOperator(node.operator)) {
					increaseComplexity();
				}
			},

			MemberExpression(node) {
				if (node.optional === true) {
					increaseComplexity();
				}
			},

			CallExpression(node) {
				if (node.optional === true) {
					increaseComplexity();
				}
			},

			onCodePathEnd(codePath, node) {
				const complexity = complexities.pop();

				/*
				 * This rule only evaluates complexity of functions, so "program" is excluded.
				 * Class field initializers and class static blocks are implicit functions. Therefore,
				 * they shouldn't contribute to the enclosing function's complexity, but their
				 * own complexity should be evaluated.
				 */
				if (
					codePath.origin !== "function" &&
					codePath.origin !== "class-field-initializer" &&
					codePath.origin !== "class-static-block"
				) {
					return;
				}

				if (complexity > threshold) {
					let name;
					let loc = node.loc;

					if (codePath.origin === "class-field-initializer") {
						name = "class field initializer";
					} else if (codePath.origin === "class-static-block") {
						name = "class static block";
						loc = sourceCode.getFirstToken(node).loc;
					} else {
						name = astUtils.getFunctionNameWithKind(node);
						loc = astUtils.getFunctionHeadLoc(node, sourceCode);
					}

					context.report({
						node,
						loc,
						messageId: "complex",
						data: {
							name: upperCaseFirst(name),
							complexity,
							max: threshold,
						},
					});
				}
			},
		};
	},
};
dwx/**
 * @fileoverview Disallows or enforces spaces inside computed properties.
 * @author Jamund Ferguson
 * @deprecated in ESLint v8.53.0
 */
"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "computed-property-spacing",
						url: "https://eslint.style/rules/computed-property-spacing",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description:
				"Enforce consistent spacing inside computed property brackets",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/computed-property-spacing",
		},

		fixable: "whitespace",

		schema: [
			{
				enum: ["always", "never"],
			},
			{
				type: "object",
				properties: {
					enforceForClassMembers: {
						type: "boolean",
						default: true,
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			unexpectedSpaceBefore:
				"There should be no space before '{{tokenValue}}'.",
			unexpectedSpaceAfter:
				"There should be no space after '{{tokenValue}}'.",

			missingSpaceBefore: "A space is required before '{{tokenValue}}'.",
			missingSpaceAfter: "A space is required after '{{tokenValue}}'.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const propertyNameMustBeSpaced = context.options[0] === "always"; // default is "never"
		const enforceForClassMembers =
			!context.options[1] || context.options[1].enforceForClassMembers;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Reports that there shouldn't be a space after the first token
		 * @param {ASTNode} node The node to report in the event of an error.
		 * @param {Token} token The token to use for the report.
		 * @param {Token} tokenAfter The token after `token`.
		 * @returns {void}
		 */
		function reportNoBeginningSpace(node, token, tokenAfter) {
			context.report({
				node,
				loc: { start: token.loc.end, end: tokenAfter.loc.start },
				messageId: "unexpectedSpaceAfter",
				data: {
					tokenValue: token.value,
				},
				fix(fixer) {
					return fixer.removeRange([
						token.range[1],
						tokenAfter.range[0],
					]);
				},
			});
		}

		/**
		 * Reports that there shouldn't be a space before the last token
		 * @param {ASTNode} node The node to report in the event of an error.
		 * @param {Token} token The token to use for the report.
		 * @param {Token} tokenBefore The token before `token`.
		 * @returns {void}
		 */
		function reportNoEndingSpace(node, token, tokenBefore) {
			context.report({
				node,
				loc: { start: tokenBefore.loc.end, end: token.loc.start },
				messageId: "unexpectedSpaceBefore",
				data: {
					tokenValue: token.value,
				},
				fix(fixer) {
					return fixer.removeRange([
						tokenBefore.range[1],
						token.range[0],
					]);
				},
			});
		}

		/**
		 * Reports that there should be a space after the first token
		 * @param {ASTNode} node The node to report in the event of an error.
		 * @param {Token} token The token to use for the report.
		 * @returns {void}
		 */
		function reportRequiredBeginningSpace(node, token) {
			context.report({
				node,
				loc: token.loc,
				messageId: "missingSpaceAfter",
				data: {
					tokenValue: token.value,
				},
				fix(fixer) {
					return fixer.insertTextAfter(token, " ");
				},
			});
		}

		/**
		 * Reports that there should be a space before the last token
		 * @param {ASTNode} node The node to report in the event of an error.
		 * @param {Token} token The token to use for the report.
		 * @returns {void}
		 */
		function reportRequiredEndingSpace(node, token) {
			context.report({
				node,
				loc: token.loc,
				messageId: "missingSpaceBefore",
				data: {
					tokenValue: token.value,
				},
				fix(fixer) {
					return fixer.insertTextBefore(token, " ");
				},
			});
		}

		/**
		 * Returns a function that checks the spacing of a node on the property name
		 * that was passed in.
		 * @param {string} propertyName The property on the node to check for spacing
		 * @returns {Function} A function that will check spacing on a node
		 */
		function checkSpacing(propertyName) {
			return function (node) {
				if (!node.computed) {
					return;
				}

				const property = node[propertyName];

				const before = sourceCode.getTokenBefore(
						property,
						astUtils.isOpeningBracketToken,
					),
					first = sourceCode.getTokenAfter(before, {
						includeComments: true,
					}),
					after = sourceCode.getTokenAfter(
						property,
						astUtils.isClosingBracketToken,
					),
					last = sourceCode.getTokenBefore(after, {
						includeComments: true,
					});

				if (astUtils.isTokenOnSameLine(before, first)) {
					if (propertyNameMustBeSpaced) {
						if (
							!sourceCode.isSpaceBetween(before, first) &&
							astUtils.isTokenOnSameLine(before, first)
						) {
							reportRequiredBeginningSpace(node, before);
						}
					} else {
						if (sourceCode.isSpaceBetween(before, first)) {
							reportNoBeginningSpace(node, before, first);
						}
					}
				}

				if (astUtils.isTokenOnSameLine(last, after)) {
					if (propertyNameMustBeSpaced) {
						if (
							!sourceCode.isSpaceBetween(last, after) &&
							astUtils.isTokenOnSameLine(last, after)
						) {
							reportRequiredEndingSpace(node, after);
						}
					} else {
						if (sourceCode.isSpaceBetween(last, after)) {
							reportNoEndingSpace(node, after, last);
						}
					}
				}
			};
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		const listeners = {
			Property: checkSpacing("key"),
			MemberExpression: checkSpacing("property"),
		};

		if (enforceForClassMembers) {
			listeners.MethodDefinition = listeners.PropertyDefinition =
				listeners.Property;
		}

		return listeners;
	},
};
-)Gx8/**
 * @fileoverview Rule to flag consistent return values
 * @author Nicholas C. Zakas
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");
const { upperCaseFirst } = require("../shared/string-utils");
const { isAnySegmentReachable } = require("./utils/code-path-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Checks whether a given node is a `constructor` method in an ES6 class
 * @param {ASTNode} node A node to check
 * @returns {boolean} `true` if the node is a `constructor` method
 */
function isClassConstructor(node) {
	return (
		node.type === "FunctionExpression" &&
		node.parent &&
		node.parent.type === "MethodDefinition" &&
		node.parent.kind === "constructor"
	);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Require `return` statements to either always or never specify values",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/consistent-return",
		},

		schema: [
			{
				type: "object",
				properties: {
					treatUndefinedAsUnspecified: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		defaultOptions: [{ treatUndefinedAsUnspecified: false }],

		messages: {
			missingReturn: "Expected to return a value at the end of {{name}}.",
			missingReturnValue: "{{name}} expected a return value.",
			unexpectedReturnValue: "{{name}} expected no return value.",
		},
	},

	create(context) {
		const [{ treatUndefinedAsUnspecified }] = context.options;
		let funcInfo = null;

		/**
		 * Checks whether of not the implicit returning is consistent if the last
		 * code path segment is reachable.
		 * @param {ASTNode} node A program/function node to check.
		 * @returns {void}
		 */
		function checkLastSegment(node) {
			let loc, name;

			/*
			 * Skip if it expected no return value or unreachable.
			 * When unreachable, all paths are returned or thrown.
			 */
			if (
				!funcInfo.hasReturnValue ||
				!isAnySegmentReachable(funcInfo.currentSegments) ||
				astUtils.isES5Constructor(node) ||
				isClassConstructor(node)
			) {
				return;
			}

			// Adjust a location and a message.
			if (node.type === "Program") {
				// The head of program.
				loc = { line: 1, column: 0 };
				name = "program";
			} else if (node.type === "ArrowFunctionExpression") {
				// `=>` token
				loc = context.sourceCode.getTokenBefore(
					node.body,
					astUtils.isArrowToken,
				).loc;
			} else if (
				node.parent.type === "MethodDefinition" ||
				(node.parent.type === "Property" && node.parent.method)
			) {
				// Method name.
				loc = node.parent.key.loc;
			} else {
				// Function name or `function` keyword.
				loc = (node.id || context.sourceCode.getFirstToken(node)).loc;
			}

			if (!name) {
				name = astUtils.getFunctionNameWithKind(node);
			}

			// Reports.
			context.report({
				node,
				loc,
				messageId: "missingReturn",
				data: { name },
			});
		}

		return {
			// Initializes/Disposes state of each code path.
			onCodePathStart(codePath, node) {
				funcInfo = {
					upper: funcInfo,
					codePath,
					hasReturn: false,
					hasReturnValue: false,
					messageId: "",
					node,
					currentSegments: new Set(),
				};
			},
			onCodePathEnd() {
				funcInfo = funcInfo.upper;
			},

			onUnreachableCodePathSegmentStart(segment) {
				funcInfo.currentSegments.add(segment);
			},

			onUnreachableCodePathSegmentEnd(segment) {
				funcInfo.currentSegments.delete(segment);
			},

			onCodePathSegmentStart(segment) {
				funcInfo.currentSegments.add(segment);
			},

			onCodePathSegmentEnd(segment) {
				funcInfo.currentSegments.delete(segment);
			},

			// Reports a given return statement if it's inconsistent.
			ReturnStatement(node) {
				const argument = node.argument;
				let hasReturnValue = Boolean(argument);

				if (treatUndefinedAsUnspecified && hasReturnValue) {
					hasReturnValue =
						!astUtils.isSpecificId(argument, "undefined") &&
						argument.operator !== "void";
				}

				if (!funcInfo.hasReturn) {
					funcInfo.hasReturn = true;
					funcInfo.hasReturnValue = hasReturnValue;
					funcInfo.messageId = hasReturnValue
						? "missingReturnValue"
						: "unexpectedReturnValue";
					funcInfo.data = {
						name:
							funcInfo.node.type === "Program"
								? "Program"
								: upperCaseFirst(
										astUtils.getFunctionNameWithKind(
											funcInfo.node,
										),
									),
					};
				} else if (funcInfo.hasReturnValue !== hasReturnValue) {
					context.report({
						node,
						messageId: funcInfo.messageId,
						data: funcInfo.data,
					});
				}
			},

			// Reports a given program/function if the implicit returning is not consistent.
			"Program:exit": checkLastSegment,
			"FunctionDeclaration:exit": checkLastSegment,
			"FunctionExpression:exit": checkLastSegment,
			"ArrowFunctionExpression:exit": checkLastSegment,
		};
	},
};
 R齔xM/**
 * @fileoverview Rule to enforce consistent naming of "this" context variables
 * @author Raphael Pigulla
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Enforce consistent naming when capturing the current execution context",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/consistent-this",
		},

		schema: {
			type: "array",
			items: {
				type: "string",
				minLength: 1,
			},
			uniqueItems: true,
		},

		defaultOptions: ["that"],

		messages: {
			aliasNotAssignedToThis:
				"Designated alias '{{name}}' is not assigned to 'this'.",
			unexpectedAlias: "Unexpected alias '{{name}}' for 'this'.",
		},
	},

	create(context) {
		const aliases = context.options;
		const sourceCode = context.sourceCode;

		/**
		 * Reports that a variable declarator or assignment expression is assigning
		 * a non-'this' value to the specified alias.
		 * @param {ASTNode} node The assigning node.
		 * @param {string} name the name of the alias that was incorrectly used.
		 * @returns {void}
		 */
		function reportBadAssignment(node, name) {
			context.report({
				node,
				messageId: "aliasNotAssignedToThis",
				data: { name },
			});
		}

		/**
		 * Checks that an assignment to an identifier only assigns 'this' to the
		 * appropriate alias, and the alias is only assigned to 'this'.
		 * @param {ASTNode} node The assigning node.
		 * @param {Identifier} name The name of the variable assigned to.
		 * @param {Expression} value The value of the assignment.
		 * @returns {void}
		 */
		function checkAssignment(node, name, value) {
			const isThis = value.type === "ThisExpression";

			if (aliases.includes(name)) {
				if (!isThis || (node.operator && node.operator !== "=")) {
					reportBadAssignment(node, name);
				}
			} else if (isThis) {
				context.report({
					node,
					messageId: "unexpectedAlias",
					data: { name },
				});
			}
		}

		/**
		 * Ensures that a variable declaration of the alias in a program or function
		 * is assigned to the correct value.
		 * @param {string} alias alias the check the assignment of.
		 * @param {Object} scope scope of the current code we are checking.
		 * @private
		 * @returns {void}
		 */
		function checkWasAssigned(alias, scope) {
			const variable = scope.set.get(alias);

			if (!variable) {
				return;
			}

			if (
				variable.defs.some(
					def =>
						def.node.type === "VariableDeclarator" &&
						def.node.init !== null,
				)
			) {
				return;
			}

			/*
			 * The alias has been declared and not assigned: check it was
			 * assigned later in the same scope.
			 */
			if (
				!variable.references.some(reference => {
					const write = reference.writeExpr;

					return (
						reference.from === scope &&
						write &&
						write.type === "ThisExpression" &&
						write.parent.operator === "="
					);
				})
			) {
				variable.defs
					.map(def => def.node)
					.forEach(node => {
						reportBadAssignment(node, alias);
					});
			}
		}

		/**
		 * Check each alias to ensure that is was assigned to the correct value.
		 * @param {ASTNode} node The node that represents the scope to check.
		 * @returns {void}
		 */
		function ensureWasAssigned(node) {
			const scope = sourceCode.getScope(node);

			// if this is program scope we also need to check module scope
			const extraScope =
				node.type === "Program" && node.sourceType === "module"
					? scope.childScopes[0]
					: null;

			aliases.forEach(alias => {
				checkWasAssigned(alias, scope);

				if (extraScope) {
					checkWasAssigned(alias, extraScope);
				}
			});
		}

		return {
			"Program:exit": ensureWasAssigned,
			"FunctionExpression:exit": ensureWasAssigned,
			"FunctionDeclaration:exit": ensureWasAssigned,

			VariableDeclarator(node) {
				const id = node.id;
				const isDestructuring =
					id.type === "ArrayPattern" || id.type === "ObjectPattern";

				if (node.init !== null && !isDestructuring) {
					checkAssignment(node, id.name, node.init);
				}
			},

			AssignmentExpression(node) {
				if (node.left.type === "Identifier") {
					checkAssignment(node, node.left.name, node.right);
				}
			},
		};
	},
};
w	:x//**
 * @fileoverview A rule to verify `super()` callings in constructor.
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Checks whether or not a given node is a constructor.
 * @param {ASTNode} node A node to check. This node type is one of
 *   `Program`, `FunctionDeclaration`, `FunctionExpression`, and
 *   `ArrowFunctionExpression`.
 * @returns {boolean} `true` if the node is a constructor.
 */
function isConstructorFunction(node) {
	return (
		node.type === "FunctionExpression" &&
		node.parent.type === "MethodDefinition" &&
		node.parent.kind === "constructor"
	);
}

/**
 * Checks whether a given node can be a constructor or not.
 * @param {ASTNode} node A node to check.
 * @returns {boolean} `true` if the node can be a constructor.
 */
function isPossibleConstructor(node) {
	if (!node) {
		return false;
	}

	switch (node.type) {
		case "ClassExpression":
		case "FunctionExpression":
		case "ThisExpression":
		case "MemberExpression":
		case "CallExpression":
		case "NewExpression":
		case "ChainExpression":
		case "YieldExpression":
		case "TaggedTemplateExpression":
		case "MetaProperty":
			return true;

		case "Identifier":
			return node.name !== "undefined";

		case "AssignmentExpression":
			if (["=", "&&="].includes(node.operator)) {
				return isPossibleConstructor(node.right);
			}

			if (["||=", "??="].includes(node.operator)) {
				return (
					isPossibleConstructor(node.left) ||
					isPossibleConstructor(node.right)
				);
			}

			/**
			 * All other assignment operators are mathematical assignment operators (arithmetic or bitwise).
			 * An assignment expression with a mathematical operator can either evaluate to a primitive value,
			 * or throw, depending on the operands. Thus, it cannot evaluate to a constructor function.
			 */
			return false;

		case "LogicalExpression":
			/*
			 * If the && operator short-circuits, the left side was falsy and therefore not a constructor, and if
			 * it doesn't short-circuit, it takes the value from the right side, so the right side must always be a
			 * possible constructor. A future improvement could verify that the left side could be truthy by
			 * excluding falsy literals.
			 */
			if (node.operator === "&&") {
				return isPossibleConstructor(node.right);
			}

			return (
				isPossibleConstructor(node.left) ||
				isPossibleConstructor(node.right)
			);

		case "ConditionalExpression":
			return (
				isPossibleConstructor(node.alternate) ||
				isPossibleConstructor(node.consequent)
			);

		case "SequenceExpression": {
			const lastExpression = node.expressions.at(-1);

			return isPossibleConstructor(lastExpression);
		}

		default:
			return false;
	}
}

/**
 * A class to store information about a code path segment.
 */
class SegmentInfo {
	/**
	 * Indicates if super() is called in all code paths.
	 * @type {boolean}
	 */
	calledInEveryPaths = false;

	/**
	 * Indicates if super() is called in any code paths.
	 * @type {boolean}
	 */
	calledInSomePaths = false;

	/**
	 * The nodes which have been validated and don't need to be reconsidered.
	 * @type {ASTNode[]}
	 */
	validNodes = [];
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description: "Require `super()` calls in constructors",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/constructor-super",
		},

		schema: [],

		messages: {
			missingSome: "Lacked a call of 'super()' in some code paths.",
			missingAll: "Expected to call 'super()'.",

			duplicate: "Unexpected duplicate 'super()'.",
			badSuper:
				"Unexpected 'super()' because 'super' is not a constructor.",
		},
	},

	create(context) {
		/*
		 * {{hasExtends: boolean, scope: Scope, codePath: CodePath}[]}
		 * Information for each constructor.
		 * - upper:      Information of the upper constructor.
		 * - hasExtends: A flag which shows whether own class has a valid `extends`
		 *               part.
		 * - scope:      The scope of own class.
		 * - codePath:   The code path object of the constructor.
		 */
		let funcInfo = null;

		/**
		 * @type {Record<string, SegmentInfo>}
		 */
		const segInfoMap = Object.create(null);

		/**
		 * Gets the flag which shows `super()` is called in some paths.
		 * @param {CodePathSegment} segment A code path segment to get.
		 * @returns {boolean} The flag which shows `super()` is called in some paths
		 */
		function isCalledInSomePath(segment) {
			return (
				segment.reachable && segInfoMap[segment.id].calledInSomePaths
			);
		}

		/**
		 * Determines if a segment has been seen in the traversal.
		 * @param {CodePathSegment} segment A code path segment to check.
		 * @returns {boolean} `true` if the segment has been seen.
		 */
		function hasSegmentBeenSeen(segment) {
			return !!segInfoMap[segment.id];
		}

		/**
		 * Gets the flag which shows `super()` is called in all paths.
		 * @param {CodePathSegment} segment A code path segment to get.
		 * @returns {boolean} The flag which shows `super()` is called in all paths.
		 */
		function isCalledInEveryPath(segment) {
			return (
				segment.reachable && segInfoMap[segment.id].calledInEveryPaths
			);
		}

		return {
			/**
			 * Stacks a constructor information.
			 * @param {CodePath} codePath A code path which was started.
			 * @param {ASTNode} node The current node.
			 * @returns {void}
			 */
			onCodePathStart(codePath, node) {
				if (isConstructorFunction(node)) {
					// Class > ClassBody > MethodDefinition > FunctionExpression
					const classNode = node.parent.parent.parent;
					const superClass = classNode.superClass;

					funcInfo = {
						upper: funcInfo,
						isConstructor: true,
						hasExtends: Boolean(superClass),
						superIsConstructor: isPossibleConstructor(superClass),
						codePath,
						currentSegments: new Set(),
					};
				} else {
					funcInfo = {
						upper: funcInfo,
						isConstructor: false,
						hasExtends: false,
						superIsConstructor: false,
						codePath,
						currentSegments: new Set(),
					};
				}
			},

			/**
			 * Pops a constructor information.
			 * And reports if `super()` lacked.
			 * @param {CodePath} codePath A code path which was ended.
			 * @param {ASTNode} node The current node.
			 * @returns {void}
			 */
			onCodePathEnd(codePath, node) {
				const hasExtends = funcInfo.hasExtends;

				// Pop.
				funcInfo = funcInfo.upper;

				if (!hasExtends) {
					return;
				}

				// Reports if `super()` lacked.
				const returnedSegments = codePath.returnedSegments;
				const calledInEveryPaths =
					returnedSegments.every(isCalledInEveryPath);
				const calledInSomePaths =
					returnedSegments.some(isCalledInSomePath);

				if (!calledInEveryPaths) {
					context.report({
						messageId: calledInSomePaths
							? "missingSome"
							: "missingAll",
						node: node.parent,
					});
				}
			},

			/**
			 * Initialize information of a given code path segment.
			 * @param {CodePathSegment} segment A code path segment to initialize.
			 * @param {CodePathSegment} node Node that starts the segment.
			 * @returns {void}
			 */
			onCodePathSegmentStart(segment, node) {
				funcInfo.currentSegments.add(segment);

				if (!(funcInfo.isConstructor && funcInfo.hasExtends)) {
					return;
				}

				// Initialize info.
				const info = (segInfoMap[segment.id] = new SegmentInfo());

				const seenPrevSegments =
					segment.prevSegments.filter(hasSegmentBeenSeen);

				// When there are previous segments, aggregates these.
				if (seenPrevSegments.length > 0) {
					info.calledInSomePaths =
						seenPrevSegments.some(isCalledInSomePath);
					info.calledInEveryPaths =
						seenPrevSegments.every(isCalledInEveryPath);
				}

				/*
				 * ForStatement > *.update segments are a special case as they are created in advance,
				 * without seen previous segments. Since they logically don't affect `calledInEveryPaths`
				 * calculations, and they can never be a lone previous segment of another one, we'll set
				 * their `calledInEveryPaths` to `true` to effectively ignore them in those calculations.
				 * .
				 */
				if (
					node.parent &&
					node.parent.type === "ForStatement" &&
					node.parent.update === node
				) {
					info.calledInEveryPaths = true;
				}
			},

			onUnreachableCodePathSegmentStart(segment) {
				funcInfo.currentSegments.add(segment);
			},

			onUnreachableCodePathSegmentEnd(segment) {
				funcInfo.currentSegments.delete(segment);
			},

			onCodePathSegmentEnd(segment) {
				funcInfo.currentSegments.delete(segment);
			},

			/**
			 * Update information of the code path segment when a code path was
			 * looped.
			 * @param {CodePathSegment} fromSegment The code path segment of the
			 *      end of a loop.
			 * @param {CodePathSegment} toSegment A code path segment of the head
			 *      of a loop.
			 * @returns {void}
			 */
			onCodePathSegmentLoop(fromSegment, toSegment) {
				if (!(funcInfo.isConstructor && funcInfo.hasExtends)) {
					return;
				}

				funcInfo.codePath.traverseSegments(
					{ first: toSegment, last: fromSegment },
					(segment, controller) => {
						const info = segInfoMap[segment.id];

						// skip segments after the loop
						if (!info) {
							controller.skip();
							return;
						}

						const seenPrevSegments =
							segment.prevSegments.filter(hasSegmentBeenSeen);
						const calledInSomePreviousPaths =
							seenPrevSegments.some(isCalledInSomePath);
						const calledInEveryPreviousPaths =
							seenPrevSegments.every(isCalledInEveryPath);

						info.calledInSomePaths ||= calledInSomePreviousPaths;
						info.calledInEveryPaths ||= calledInEveryPreviousPaths;

						// If flags become true anew, reports the valid nodes.
						if (calledInSomePreviousPaths) {
							const nodes = info.validNodes;

							info.validNodes = [];

							for (let i = 0; i < nodes.length; ++i) {
								const node = nodes[i];

								context.report({
									messageId: "duplicate",
									node,
								});
							}
						}
					},
				);
			},

			/**
			 * Checks for a call of `super()`.
			 * @param {ASTNode} node A CallExpression node to check.
			 * @returns {void}
			 */
			"CallExpression:exit"(node) {
				if (!(funcInfo.isConstructor && funcInfo.hasExtends)) {
					return;
				}

				// Skips except `super()`.
				if (node.callee.type !== "Super") {
					return;
				}

				// Reports if needed.
				const segments = funcInfo.currentSegments;
				let duplicate = false;
				let info = null;

				for (const segment of segments) {
					if (segment.reachable) {
						info = segInfoMap[segment.id];

						duplicate = duplicate || info.calledInSomePaths;
						info.calledInSomePaths = info.calledInEveryPaths = true;
					}
				}

				if (info) {
					if (duplicate) {
						context.report({
							messageId: "duplicate",
							node,
						});
					} else if (!funcInfo.superIsConstructor) {
						context.report({
							messageId: "badSuper",
							node,
						});
					} else {
						info.validNodes.push(node);
					}
				}
			},

			/**
			 * Set the mark to the returned path as `super()` was called.
			 * @param {ASTNode} node A ReturnStatement node to check.
			 * @returns {void}
			 */
			ReturnStatement(node) {
				if (!(funcInfo.isConstructor && funcInfo.hasExtends)) {
					return;
				}

				// Skips if no argument.
				if (!node.argument) {
					return;
				}

				// Returning argument is a substitute of 'super()'.
				const segments = funcInfo.currentSegments;

				for (const segment of segments) {
					if (segment.reachable) {
						const info = segInfoMap[segment.id];

						info.calledInSomePaths = info.calledInEveryPaths = true;
					}
				}
			},
		};
	},
};
OLjx-/**
 * @fileoverview Rule to flag statements without curly braces
 * @author Nicholas C. Zakas
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Enforce consistent brace style for all control statements",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/curly",
		},

		schema: {
			anyOf: [
				{
					type: "array",
					items: [
						{
							enum: ["all"],
						},
					],
					minItems: 0,
					maxItems: 1,
				},
				{
					type: "array",
					items: [
						{
							enum: ["multi", "multi-line", "multi-or-nest"],
						},
						{
							enum: ["consistent"],
						},
					],
					minItems: 0,
					maxItems: 2,
				},
			],
		},

		defaultOptions: ["all"],

		fixable: "code",

		messages: {
			missingCurlyAfter: "Expected { after '{{name}}'.",
			missingCurlyAfterCondition:
				"Expected { after '{{name}}' condition.",
			unexpectedCurlyAfter: "Unnecessary { after '{{name}}'.",
			unexpectedCurlyAfterCondition:
				"Unnecessary { after '{{name}}' condition.",
		},
	},

	create(context) {
		const multiOnly = context.options[0] === "multi";
		const multiLine = context.options[0] === "multi-line";
		const multiOrNest = context.options[0] === "multi-or-nest";
		const consistent = context.options[1] === "consistent";

		const sourceCode = context.sourceCode;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Determines if a given node is a one-liner that's on the same line as it's preceding code.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} True if the node is a one-liner that's on the same line as it's preceding code.
		 * @private
		 */
		function isCollapsedOneLiner(node) {
			const before = sourceCode.getTokenBefore(node);
			const last = sourceCode.getLastToken(node);
			const lastExcludingSemicolon = astUtils.isSemicolonToken(last)
				? sourceCode.getTokenBefore(last)
				: last;

			return (
				before.loc.start.line === lastExcludingSemicolon.loc.end.line
			);
		}

		/**
		 * Determines if a given node is a one-liner.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} True if the node is a one-liner.
		 * @private
		 */
		function isOneLiner(node) {
			if (node.type === "EmptyStatement") {
				return true;
			}

			const first = sourceCode.getFirstToken(node);
			const last = sourceCode.getLastToken(node);
			const lastExcludingSemicolon = astUtils.isSemicolonToken(last)
				? sourceCode.getTokenBefore(last)
				: last;

			return first.loc.start.line === lastExcludingSemicolon.loc.end.line;
		}

		/**
		 * Determines if a semicolon needs to be inserted after removing a set of curly brackets, in order to avoid a SyntaxError.
		 * @param {Token} closingBracket The } token
		 * @returns {boolean} `true` if a semicolon needs to be inserted after the last statement in the block.
		 */
		function needsSemicolon(closingBracket) {
			const tokenBefore = sourceCode.getTokenBefore(closingBracket);
			const tokenAfter = sourceCode.getTokenAfter(closingBracket);
			const lastBlockNode = sourceCode.getNodeByRangeIndex(
				tokenBefore.range[0],
			);

			if (astUtils.isSemicolonToken(tokenBefore)) {
				// If the last statement already has a semicolon, don't add another one.
				return false;
			}

			if (!tokenAfter) {
				// If there are no statements after this block, there is no need to add a semicolon.
				return false;
			}

			if (
				lastBlockNode.type === "BlockStatement" &&
				lastBlockNode.parent.type !== "FunctionExpression" &&
				lastBlockNode.parent.type !== "ArrowFunctionExpression"
			) {
				/*
				 * If the last node surrounded by curly brackets is a BlockStatement (other than a FunctionExpression or an ArrowFunctionExpression),
				 * don't insert a semicolon. Otherwise, the semicolon would be parsed as a separate statement, which would cause
				 * a SyntaxError if it was followed by `else`.
				 */
				return false;
			}

			if (tokenBefore.loc.end.line === tokenAfter.loc.start.line) {
				// If the next token is on the same line, insert a semicolon.
				return true;
			}

			if (/^[([/`+-]/u.test(tokenAfter.value)) {
				// If the next token starts with a character that would disrupt ASI, insert a semicolon.
				return true;
			}

			if (
				tokenBefore.type === "Punctuator" &&
				(tokenBefore.value === "++" || tokenBefore.value === "--")
			) {
				// If the last token is ++ or --, insert a semicolon to avoid disrupting ASI.
				return true;
			}

			// Otherwise, do not insert a semicolon.
			return false;
		}

		/**
		 * Prepares to check the body of a node to see if it's a block statement.
		 * @param {ASTNode} node The node to report if there's a problem.
		 * @param {ASTNode} body The body node to check for blocks.
		 * @param {string} name The name to report if there's a problem.
		 * @param {{ condition: boolean }} opts Options to pass to the report functions
		 * @returns {Object} a prepared check object, with "actual", "expected", "check" properties.
		 *   "actual" will be `true` or `false` whether the body is already a block statement.
		 *   "expected" will be `true` or `false` if the body should be a block statement or not, or
		 *   `null` if it doesn't matter, depending on the rule options. It can be modified to change
		 *   the final behavior of "check".
		 *   "check" will be a function reporting appropriate problems depending on the other
		 *   properties.
		 */
		function prepareCheck(node, body, name, opts) {
			const hasBlock = body.type === "BlockStatement";
			let expected = null;

			if (
				hasBlock &&
				(body.body.length !== 1 ||
					astUtils.areBracesNecessary(body, sourceCode))
			) {
				expected = true;
			} else if (multiOnly) {
				expected = false;
			} else if (multiLine) {
				if (!isCollapsedOneLiner(body)) {
					expected = true;
				}

				// otherwise, the body is allowed to have braces or not to have braces
			} else if (multiOrNest) {
				if (hasBlock) {
					const statement = body.body[0];
					const leadingCommentsInBlock =
						sourceCode.getCommentsBefore(statement);

					expected =
						!isOneLiner(statement) ||
						leadingCommentsInBlock.length > 0;
				} else {
					expected = !isOneLiner(body);
				}
			} else {
				// default "all"
				expected = true;
			}

			return {
				actual: hasBlock,
				expected,
				check() {
					if (
						this.expected !== null &&
						this.expected !== this.actual
					) {
						if (this.expected) {
							context.report({
								node,
								loc: body.loc,
								messageId:
									opts && opts.condition
										? "missingCurlyAfterCondition"
										: "missingCurlyAfter",
								data: {
									name,
								},
								fix: fixer =>
									fixer.replaceText(
										body,
										`{${sourceCode.getText(body)}}`,
									),
							});
						} else {
							context.report({
								node,
								loc: body.loc,
								messageId:
									opts && opts.condition
										? "unexpectedCurlyAfterCondition"
										: "unexpectedCurlyAfter",
								data: {
									name,
								},
								fix(fixer) {
									/*
									 * `do while` expressions sometimes need a space to be inserted after `do`.
									 * e.g. `do{foo()} while (bar)` should be corrected to `do foo() while (bar)`
									 */
									const needsPrecedingSpace =
										node.type === "DoWhileStatement" &&
										sourceCode.getTokenBefore(body)
											.range[1] === body.range[0] &&
										!astUtils.canTokensBeAdjacent(
											"do",
											sourceCode.getFirstToken(body, {
												skip: 1,
											}),
										);

									const openingBracket =
										sourceCode.getFirstToken(body);
									const closingBracket =
										sourceCode.getLastToken(body);
									const lastTokenInBlock =
										sourceCode.getTokenBefore(
											closingBracket,
										);

									if (needsSemicolon(closingBracket)) {
										/*
										 * If removing braces would cause a SyntaxError due to multiple statements on the same line (or
										 * change the semantics of the code due to ASI), don't perform a fix.
										 */
										return null;
									}

									const resultingBodyText =
										sourceCode
											.getText()
											.slice(
												openingBracket.range[1],
												lastTokenInBlock.range[0],
											) +
										sourceCode.getText(lastTokenInBlock) +
										sourceCode
											.getText()
											.slice(
												lastTokenInBlock.range[1],
												closingBracket.range[0],
											);

									return fixer.replaceText(
										body,
										(needsPrecedingSpace ? " " : "") +
											resultingBodyText,
									);
								},
							});
						}
					}
				},
			};
		}

		/**
		 * Prepares to check the bodies of a "if", "else if" and "else" chain.
		 * @param {ASTNode} node The first IfStatement node of the chain.
		 * @returns {Object[]} prepared checks for each body of the chain. See `prepareCheck` for more
		 *   information.
		 */
		function prepareIfChecks(node) {
			const preparedChecks = [];

			for (
				let currentNode = node;
				currentNode;
				currentNode = currentNode.alternate
			) {
				preparedChecks.push(
					prepareCheck(currentNode, currentNode.consequent, "if", {
						condition: true,
					}),
				);
				if (
					currentNode.alternate &&
					currentNode.alternate.type !== "IfStatement"
				) {
					preparedChecks.push(
						prepareCheck(
							currentNode,
							currentNode.alternate,
							"else",
						),
					);
					break;
				}
			}

			if (consistent) {
				/*
				 * If any node should have or already have braces, make sure they
				 * all have braces.
				 * If all nodes shouldn't have braces, make sure they don't.
				 */
				const expected = preparedChecks.some(preparedCheck => {
					if (preparedCheck.expected !== null) {
						return preparedCheck.expected;
					}
					return preparedCheck.actual;
				});

				preparedChecks.forEach(preparedCheck => {
					preparedCheck.expected = expected;
				});
			}

			return preparedChecks;
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			IfStatement(node) {
				const parent = node.parent;
				const isElseIf =
					parent.type === "IfStatement" && parent.alternate === node;

				if (!isElseIf) {
					// This is a top `if`, check the whole `if-else-if` chain
					prepareIfChecks(node).forEach(preparedCheck => {
						preparedCheck.check();
					});
				}

				// Skip `else if`, it's already checked (when the top `if` was visited)
			},

			WhileStatement(node) {
				prepareCheck(node, node.body, "while", {
					condition: true,
				}).check();
			},

			DoWhileStatement(node) {
				prepareCheck(node, node.body, "do").check();
			},

			ForStatement(node) {
				prepareCheck(node, node.body, "for", {
					condition: true,
				}).check();
			},

			ForInStatement(node) {
				prepareCheck(node, node.body, "for-in").check();
			},

			ForOfStatement(node) {
				prepareCheck(node, node.body, "for-of").check();
			},
		};
	},
};
c,DxO/**
 * @fileoverview Rule to enforce `default` clauses in `switch` statements to be last
 * @author Milos Djermanovic
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Enforce `default` clauses in `switch` statements to be last",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/default-case-last",
		},

		schema: [],

		messages: {
			notLast: "Default clause should be the last clause.",
		},
	},

	create(context) {
		return {
			SwitchStatement(node) {
				const cases = node.cases,
					indexOfDefault = cases.findIndex(c => c.test === null);

				if (
					indexOfDefault !== -1 &&
					indexOfDefault !== cases.length - 1
				) {
					const defaultClause = cases[indexOfDefault];

					context.report({
						node: defaultClause,
						messageId: "notLast",
					});
				}
			},
		};
	},
};
;#x	/**
 * @fileoverview require default case in switch statements
 * @author Aliaksei Shytkin
 */
"use strict";

const DEFAULT_COMMENT_PATTERN = /^no default$/iu;

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [{}],

		docs: {
			description: "Require `default` cases in `switch` statements",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/default-case",
		},

		schema: [
			{
				type: "object",
				properties: {
					commentPattern: {
						type: "string",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			missingDefaultCase: "Expected a default case.",
		},
	},

	create(context) {
		const [options] = context.options;
		const commentPattern = options.commentPattern
			? new RegExp(options.commentPattern, "u")
			: DEFAULT_COMMENT_PATTERN;

		const sourceCode = context.sourceCode;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Shortcut to get last element of array
		 * @param {*[]} collection Array
		 * @returns {any} Last element
		 */
		function last(collection) {
			return collection.at(-1);
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			SwitchStatement(node) {
				if (!node.cases.length) {
					/*
					 * skip check of empty switch because there is no easy way
					 * to extract comments inside it now
					 */
					return;
				}

				const hasDefault = node.cases.some(v => v.test === null);

				if (!hasDefault) {
					let comment;

					const lastCase = last(node.cases);
					const comments = sourceCode.getCommentsAfter(lastCase);

					if (comments.length) {
						comment = last(comments);
					}

					if (
						!comment ||
						!commentPattern.test(comment.value.trim())
					) {
						context.report({
							node,
							messageId: "missingDefaultCase",
						});
					}
				}
			},
		};
	},
};
 uZhx~/**
 * @fileoverview enforce default parameters to be last
 * @author Chiawen Chen
 */

"use strict";

/**
 * Checks if node is required: i.e. does not have a default value or ? optional indicator.
 * @param {ASTNode} node the node to be evaluated
 * @returns {boolean} true if the node is required, false if not.
 */
function isRequiredParameter(node) {
	return !(
		node.type === "AssignmentPattern" ||
		node.type === "RestElement" ||
		node.optional
	);
}

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Enforce default parameters to be last",
			dialects: ["JavaScript", "TypeScript"],
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/default-param-last",
		},

		schema: [],

		messages: {
			shouldBeLast: "Default parameters should be last.",
		},
	},

	create(context) {
		/**
		 * Handler for function contexts.
		 * @param {ASTNode} node function node
		 * @returns {void}
		 */
		function handleFunction(node) {
			let hasSeenRequiredParameter = false;

			for (let i = node.params.length - 1; i >= 0; i -= 1) {
				const current = node.params[i];
				const param =
					current.type === "TSParameterProperty"
						? current.parameter
						: current;

				if (isRequiredParameter(param)) {
					hasSeenRequiredParameter = true;
					continue;
				}

				if (hasSeenRequiredParameter) {
					context.report({
						node: current,
						messageId: "shouldBeLast",
					});
				}
			}
		}

		return {
			FunctionDeclaration: handleFunction,
			FunctionExpression: handleFunction,
			ArrowFunctionExpression: handleFunction,
		};
	},
};
R
xL/**
 * @fileoverview Validates newlines before and after dots
 * @author Greg Cochard
 * @deprecated in ESLint v8.53.0
 */

"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "dot-location",
						url: "https://eslint.style/rules/dot-location",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Enforce consistent newlines before and after dots",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/dot-location",
		},

		schema: [
			{
				enum: ["object", "property"],
			},
		],

		fixable: "code",

		messages: {
			expectedDotAfterObject:
				"Expected dot to be on same line as object.",
			expectedDotBeforeProperty:
				"Expected dot to be on same line as property.",
		},
	},

	create(context) {
		const config = context.options[0];

		// default to onObject if no preference is passed
		const onObject = config === "object" || !config;

		const sourceCode = context.sourceCode;

		/**
		 * Reports if the dot between object and property is on the correct location.
		 * @param {ASTNode} node The `MemberExpression` node.
		 * @returns {void}
		 */
		function checkDotLocation(node) {
			const property = node.property;
			const dotToken = sourceCode.getTokenBefore(property);

			if (onObject) {
				// `obj` expression can be parenthesized, but those paren tokens are not a part of the `obj` node.
				const tokenBeforeDot = sourceCode.getTokenBefore(dotToken);

				if (!astUtils.isTokenOnSameLine(tokenBeforeDot, dotToken)) {
					context.report({
						node,
						loc: dotToken.loc,
						messageId: "expectedDotAfterObject",
						*fix(fixer) {
							if (
								dotToken.value.startsWith(".") &&
								astUtils.isDecimalIntegerNumericToken(
									tokenBeforeDot,
								)
							) {
								yield fixer.insertTextAfter(
									tokenBeforeDot,
									` ${dotToken.value}`,
								);
							} else {
								yield fixer.insertTextAfter(
									tokenBeforeDot,
									dotToken.value,
								);
							}
							yield fixer.remove(dotToken);
						},
					});
				}
			} else if (!astUtils.isTokenOnSameLine(dotToken, property)) {
				context.report({
					node,
					loc: dotToken.loc,
					messageId: "expectedDotBeforeProperty",
					*fix(fixer) {
						yield fixer.remove(dotToken);
						yield fixer.insertTextBefore(property, dotToken.value);
					},
				});
			}
		}

		/**
		 * Checks the spacing of the dot within a member expression.
		 * @param {ASTNode} node The node to check.
		 * @returns {void}
		 */
		function checkNode(node) {
			if (!node.computed) {
				checkDotLocation(node);
			}
		}

		return {
			MemberExpression: checkNode,
		};
	},
};
{x]/**
 * @fileoverview Rule to warn about using dot notation instead of square bracket notation when possible.
 * @author Josh Perez
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");
const keywords = require("./utils/keywords");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

const validIdentifier = /^[a-zA-Z_$][\w$]*$/u;

// `null` literal must be handled separately.
const literalTypesToCheck = new Set(["string", "boolean"]);

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				allowKeywords: true,
				allowPattern: "",
			},
		],

		docs: {
			description: "Enforce dot notation whenever possible",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/dot-notation",
		},

		schema: [
			{
				type: "object",
				properties: {
					allowKeywords: {
						type: "boolean",
					},
					allowPattern: {
						type: "string",
					},
				},
				additionalProperties: false,
			},
		],

		fixable: "code",

		messages: {
			useDot: "[{{key}}] is better written in dot notation.",
			useBrackets: ".{{key}} is a syntax error.",
		},
	},

	create(context) {
		const [options] = context.options;
		const allowKeywords = options.allowKeywords;
		const sourceCode = context.sourceCode;

		let allowPattern;

		if (options.allowPattern) {
			allowPattern = new RegExp(options.allowPattern, "u");
		}

		/**
		 * Check if the property is valid dot notation
		 * @param {ASTNode} node The dot notation node
		 * @param {string|boolean|null} value Value which is to be checked
		 * @returns {void}
		 */
		function checkComputedProperty(node, value) {
			if (
				validIdentifier.test(value) &&
				(allowKeywords || !keywords.includes(String(value))) &&
				!(allowPattern && allowPattern.test(value))
			) {
				const formattedValue =
					node.property.type === "Literal"
						? JSON.stringify(value)
						: `\`${value}\``;

				context.report({
					node: node.property,
					messageId: "useDot",
					data: {
						key: formattedValue,
					},
					*fix(fixer) {
						const leftBracket = sourceCode.getTokenAfter(
							node.object,
							astUtils.isOpeningBracketToken,
						);
						const rightBracket = sourceCode.getLastToken(node);
						const nextToken = sourceCode.getTokenAfter(node);

						// Don't perform any fixes if there are comments inside the brackets.
						if (
							sourceCode.commentsExistBetween(
								leftBracket,
								rightBracket,
							)
						) {
							return;
						}

						// Replace the brackets by an identifier.
						if (!node.optional) {
							yield fixer.insertTextBefore(
								leftBracket,
								astUtils.isDecimalInteger(node.object)
									? " ."
									: ".",
							);
						}
						yield fixer.replaceTextRange(
							[leftBracket.range[0], rightBracket.range[1]],
							String(value),
						);

						// Insert a space after the property if it will be connected to the next token.
						if (
							nextToken &&
							rightBracket.range[1] === nextToken.range[0] &&
							!astUtils.canTokensBeAdjacent(
								String(value),
								nextToken,
							)
						) {
							yield fixer.insertTextAfter(node, " ");
						}
					},
				});
			}
		}

		return {
			MemberExpression(node) {
				if (
					node.computed &&
					node.property.type === "Literal" &&
					(literalTypesToCheck.has(typeof node.property.value) ||
						astUtils.isNullLiteral(node.property))
				) {
					checkComputedProperty(node, node.property.value);
				}
				if (
					node.computed &&
					astUtils.isStaticTemplateLiteral(node.property)
				) {
					checkComputedProperty(
						node,
						node.property.quasis[0].value.cooked,
					);
				}
				if (
					!allowKeywords &&
					!node.computed &&
					node.property.type === "Identifier" &&
					keywords.includes(String(node.property.name))
				) {
					context.report({
						node: node.property,
						messageId: "useBrackets",
						data: {
							key: node.property.name,
						},
						*fix(fixer) {
							const dotToken = sourceCode.getTokenBefore(
								node.property,
							);

							// A statement that starts with `let[` is parsed as a destructuring variable declaration, not a MemberExpression.
							if (
								node.object.type === "Identifier" &&
								node.object.name === "let" &&
								!node.optional
							) {
								return;
							}

							// Don't perform any fixes if there are comments between the dot and the property name.
							if (
								sourceCode.commentsExistBetween(
									dotToken,
									node.property,
								)
							) {
								return;
							}

							// Replace the identifier to brackets.
							if (!node.optional) {
								yield fixer.remove(dotToken);
							}
							yield fixer.replaceText(
								node.property,
								`["${node.property.name}"]`,
							);
						},
					});
				}
			},
		};
	},
};
rqx/**
 * @fileoverview Require or disallow newline at the end of files
 * @author Nodeca Team <https://github.com/nodeca>
 * @deprecated in ESLint v8.53.0
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "eol-last",
						url: "https://eslint.style/rules/eol-last",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Require or disallow newline at the end of files",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/eol-last",
		},

		fixable: "whitespace",

		schema: [
			{
				enum: ["always", "never", "unix", "windows"],
			},
		],

		messages: {
			missing: "Newline required at end of file but not found.",
			unexpected: "Newline not allowed at end of file.",
		},
	},
	create(context) {
		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			Program: function checkBadEOF(node) {
				const sourceCode = context.sourceCode,
					src = sourceCode.getText(),
					lastLine = sourceCode.lines.at(-1),
					location = {
						column: lastLine.length,
						line: sourceCode.lines.length,
					},
					LF = "\n",
					CRLF = `\r${LF}`,
					endsWithNewline = src.endsWith(LF);

				/*
				 * Empty source is always valid: No content in file so we don't
				 * need to lint for a newline on the last line of content.
				 */
				if (!src.length) {
					return;
				}

				let mode = context.options[0] || "always",
					appendCRLF = false;

				if (mode === "unix") {
					// `"unix"` should behave exactly as `"always"`
					mode = "always";
				}
				if (mode === "windows") {
					// `"windows"` should behave exactly as `"always"`, but append CRLF in the fixer for backwards compatibility
					mode = "always";
					appendCRLF = true;
				}
				if (mode === "always" && !endsWithNewline) {
					// File is not newline-terminated, but should be
					context.report({
						node,
						loc: location,
						messageId: "missing",
						fix(fixer) {
							return fixer.insertTextAfterRange(
								[0, src.length],
								appendCRLF ? CRLF : LF,
							);
						},
					});
				} else if (mode === "never" && endsWithNewline) {
					const secondLastLine = sourceCode.lines.at(-2);

					// File is newline-terminated, but shouldn't be
					context.report({
						node,
						loc: {
							start: {
								line: sourceCode.lines.length - 1,
								column: secondLastLine.length,
							},
							end: { line: sourceCode.lines.length, column: 0 },
						},
						messageId: "unexpected",
						fix(fixer) {
							const finalEOLs = /(?:\r?\n)+$/u,
								match = finalEOLs.exec(sourceCode.text),
								start = match.index,
								end = sourceCode.text.length;

							return fixer.replaceTextRange([start, end], "");
						},
					});
				}
			},
		};
	},
};
ޏxA/**
 * @fileoverview Rule to flag statements that use != and == instead of !== and ===
 * @author Nicholas C. Zakas
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",
		hasSuggestions: true,

		docs: {
			description: "Require the use of `===` and `!==`",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/eqeqeq",
		},

		schema: {
			anyOf: [
				{
					type: "array",
					items: [
						{
							enum: ["always"],
						},
						{
							type: "object",
							properties: {
								null: {
									enum: ["always", "never", "ignore"],
								},
							},
							additionalProperties: false,
						},
					],
					additionalItems: false,
				},
				{
					type: "array",
					items: [
						{
							enum: ["smart", "allow-null"],
						},
					],
					additionalItems: false,
				},
			],
		},

		defaultOptions: ["always"],

		fixable: "code",

		messages: {
			unexpected:
				"Expected '{{expectedOperator}}' and instead saw '{{actualOperator}}'.",
			replaceOperator:
				"Use '{{expectedOperator}}' instead of '{{actualOperator}}'.",
		},
	},

	create(context) {
		const config = context.options[0];
		const options = context.options[1] || {};
		const sourceCode = context.sourceCode;

		const nullOption =
			config === "always" ? options.null || "always" : "ignore";
		const enforceRuleForNull = nullOption === "always";
		const enforceInverseRuleForNull = nullOption === "never";

		/**
		 * Checks if an expression is a typeof expression
		 * @param {ASTNode} node The node to check
		 * @returns {boolean} if the node is a typeof expression
		 */
		function isTypeOf(node) {
			return (
				node.type === "UnaryExpression" && node.operator === "typeof"
			);
		}

		/**
		 * Checks if either operand of a binary expression is a typeof operation
		 * @param {ASTNode} node The node to check
		 * @returns {boolean} if one of the operands is typeof
		 * @private
		 */
		function isTypeOfBinary(node) {
			return isTypeOf(node.left) || isTypeOf(node.right);
		}

		/**
		 * Gets the type of a literal node.
		 * @param {ASTNode} node The node to check
		 * @returns {string|null} The type of the literal
		 * @private
		 */
		function getLiteralType(node) {
			if (node.type === "Literal") {
				return typeof node.value;
			}

			if (astUtils.isStaticTemplateLiteral(node)) {
				return "string";
			}

			return null;
		}

		/**
		 * Checks if operands are literals of the same type (via typeof)
		 * @param {ASTNode} node The node to check
		 * @returns {boolean} if operands are of same type
		 * @private
		 */
		function areLiteralsAndSameType(node) {
			const leftType = getLiteralType(node.left);

			return leftType !== null && leftType === getLiteralType(node.right);
		}

		/**
		 * Checks if one of the operands is a literal null
		 * @param {ASTNode} node The node to check
		 * @returns {boolean} if operands are null
		 * @private
		 */
		function isNullCheck(node) {
			return (
				astUtils.isNullLiteral(node.right) ||
				astUtils.isNullLiteral(node.left)
			);
		}

		/**
		 * Reports a message for this rule.
		 * @param {ASTNode} node The binary expression node that was checked
		 * @param {string} expectedOperator The operator that was expected (either '==', '!=', '===', or '!==')
		 * @returns {void}
		 * @private
		 */
		function report(node, expectedOperator) {
			const operatorToken = sourceCode.getFirstTokenBetween(
				node.left,
				node.right,
				token => token.value === node.operator,
			);

			const commonReportParams = {
				node,
				loc: operatorToken.loc,
				messageId: "unexpected",
				data: { expectedOperator, actualOperator: node.operator },
			};

			if (isTypeOfBinary(node) || areLiteralsAndSameType(node)) {
				context.report({
					...commonReportParams,
					fix(fixer) {
						return fixer.replaceText(
							operatorToken,
							expectedOperator,
						);
					},
				});
			} else {
				context.report({
					...commonReportParams,
					suggest: [
						{
							messageId: "replaceOperator",
							data: {
								expectedOperator,
								actualOperator: node.operator,
							},
							fix: fixer =>
								fixer.replaceText(
									operatorToken,
									expectedOperator,
								),
						},
					],
				});
			}
		}

		return {
			BinaryExpression(node) {
				const isNull = isNullCheck(node);

				if (node.operator !== "==" && node.operator !== "!=") {
					if (
						enforceInverseRuleForNull &&
						isNull &&
						(node.operator === "===" || node.operator === "!==")
					) {
						report(node, node.operator.slice(0, -1));
					}
					return;
				}

				if (
					config === "smart" &&
					(isTypeOfBinary(node) ||
						areLiteralsAndSameType(node) ||
						isNull)
				) {
					return;
				}

				if (!enforceRuleForNull && isNull) {
					return;
				}

				report(node, `${node.operator}=`);
			},
		};
	},
};
zx/**
 * @fileoverview enforce `for` loop update clause moving the counter in the right direction.(for-direction)
 * @author Aladdin-ADD<hh_2013@foxmail.com>
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const { getStaticValue } = require("@eslint-community/eslint-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description:
				"Enforce `for` loop update clause moving the counter in the right direction",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/for-direction",
		},

		fixable: null,
		schema: [],

		messages: {
			incorrectDirection:
				"The update clause in this loop moves the variable in the wrong direction.",
		},
	},

	create(context) {
		const { sourceCode } = context;

		/**
		 * report an error.
		 * @param {ASTNode} node the node to report.
		 * @returns {void}
		 */
		function report(node) {
			context.report({
				loc: {
					start: node.loc.start,
					end: sourceCode.getTokenBefore(node.body).loc.end,
				},
				messageId: "incorrectDirection",
			});
		}

		/**
		 * check the right side of the assignment
		 * @param {ASTNode} update UpdateExpression to check
		 * @param {number} dir expected direction that could either be turned around or invalidated
		 * @returns {number} return dir, the negated dir, or zero if the counter does not change or the direction is not clear
		 */
		function getRightDirection(update, dir) {
			const staticValue = getStaticValue(
				update.right,
				sourceCode.getScope(update),
			);

			if (
				staticValue &&
				["bigint", "boolean", "number"].includes(
					typeof staticValue.value,
				)
			) {
				const sign = Math.sign(Number(staticValue.value)) || 0; // convert NaN to 0

				return dir * sign;
			}
			return 0;
		}

		/**
		 * check UpdateExpression add/sub the counter
		 * @param {ASTNode} update UpdateExpression to check
		 * @param {string} counter variable name to check
		 * @returns {number} if add return 1, if sub return -1, if nochange, return 0
		 */
		function getUpdateDirection(update, counter) {
			if (
				update.argument.type === "Identifier" &&
				update.argument.name === counter
			) {
				if (update.operator === "++") {
					return 1;
				}
				if (update.operator === "--") {
					return -1;
				}
			}
			return 0;
		}

		/**
		 * check AssignmentExpression add/sub the counter
		 * @param {ASTNode} update AssignmentExpression to check
		 * @param {string} counter variable name to check
		 * @returns {number} if add return 1, if sub return -1, if nochange, return 0
		 */
		function getAssignmentDirection(update, counter) {
			if (update.left.name === counter) {
				if (update.operator === "+=") {
					return getRightDirection(update, 1);
				}
				if (update.operator === "-=") {
					return getRightDirection(update, -1);
				}
			}
			return 0;
		}
		/**
		 * Collects all expressions that modify the counter.
		 * @param {ASTNode} node The expression node to check.
		 * @param {string} counter The name of the counter variable.
		 * @returns {ASTNode[]} An array of modifying expressions.
		 */
		function getModifyingExpressions(node, counter) {
			if (node.type === "SequenceExpression") {
				return node.expressions.flatMap(expr =>
					getModifyingExpressions(expr, counter),
				);
			}
			if (
				node.type === "UpdateExpression" &&
				node.argument.type === "Identifier" &&
				node.argument.name === counter
			) {
				return [node];
			}
			if (
				node.type === "AssignmentExpression" &&
				node.left.type === "Identifier" &&
				node.left.name === counter
			) {
				return [node];
			}
			return [];
		}

		/**
		 * Determines the direction of a single update expression for the counter.
		 * @param {ASTNode} expr An expression node to check (UpdateExpression or AssignmentExpression).
		 * @param {string} counter The variable name of the counter.
		 * @returns {number} 1 if incrementing, -1 if decrementing, 0 if unknown or not modifying the counter.
		 */
		function getDirectionFromExpression(expr, counter) {
			if (expr.type === "UpdateExpression") {
				return getUpdateDirection(expr, counter);
			}
			if (expr.type === "AssignmentExpression") {
				return getAssignmentDirection(expr, counter);
			}
			return 0;
		}

		return {
			ForStatement(node) {
				if (
					node.test &&
					node.test.type === "BinaryExpression" &&
					node.update
				) {
					for (const counterPosition of ["left", "right"]) {
						if (node.test[counterPosition].type !== "Identifier") {
							continue;
						}

						const counter = node.test[counterPosition].name;
						const operator = node.test.operator;
						const update = node.update;

						let wrongDirection;

						if (operator === "<" || operator === "<=") {
							wrongDirection =
								counterPosition === "left" ? -1 : 1;
						} else if (operator === ">" || operator === ">=") {
							wrongDirection =
								counterPosition === "left" ? 1 : -1;
						} else {
							return;
						}

						const mutatingExpressions = getModifyingExpressions(
							update,
							counter,
						);

						if (
							mutatingExpressions.length === 1 &&
							getDirectionFromExpression(
								mutatingExpressions[0],
								counter,
							) === wrongDirection
						) {
							report(node);
						}
					}
				}
			},
		};
	},
};
(xb /**
 * @fileoverview Rule to control spacing within function calls
 * @author Matt DuVall <http://www.mattduvall.com>
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "function-call-spacing",
						url: "https://eslint.style/rules/function-call-spacing",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description:
				"Require or disallow spacing between function identifiers and their invocations",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/func-call-spacing",
		},

		fixable: "whitespace",

		schema: {
			anyOf: [
				{
					type: "array",
					items: [
						{
							enum: ["never"],
						},
					],
					minItems: 0,
					maxItems: 1,
				},
				{
					type: "array",
					items: [
						{
							enum: ["always"],
						},
						{
							type: "object",
							properties: {
								allowNewlines: {
									type: "boolean",
								},
							},
							additionalProperties: false,
						},
					],
					minItems: 0,
					maxItems: 2,
				},
			],
		},

		messages: {
			unexpectedWhitespace:
				"Unexpected whitespace between function name and paren.",
			unexpectedNewline:
				"Unexpected newline between function name and paren.",
			missing: "Missing space between function name and paren.",
		},
	},

	create(context) {
		const never = context.options[0] !== "always";
		const allowNewlines =
			!never && context.options[1] && context.options[1].allowNewlines;
		const sourceCode = context.sourceCode;
		const text = sourceCode.getText();

		/**
		 * Check if open space is present in a function name
		 * @param {ASTNode} node node to evaluate
		 * @param {Token} leftToken The last token of the callee. This may be the closing parenthesis that encloses the callee.
		 * @param {Token} rightToken The first token of the arguments. this is the opening parenthesis that encloses the arguments.
		 * @returns {void}
		 * @private
		 */
		function checkSpacing(node, leftToken, rightToken) {
			const textBetweenTokens = text
				.slice(leftToken.range[1], rightToken.range[0])
				.replace(/\/\*.*?\*\//gu, "");
			const hasWhitespace = /\s/u.test(textBetweenTokens);
			const hasNewline =
				hasWhitespace &&
				astUtils.LINEBREAK_MATCHER.test(textBetweenTokens);

			/*
			 * never allowNewlines hasWhitespace hasNewline message
			 * F     F             F             F          Missing space between function name and paren.
			 * F     F             F             T          (Invalid `!hasWhitespace && hasNewline`)
			 * F     F             T             T          Unexpected newline between function name and paren.
			 * F     F             T             F          (OK)
			 * F     T             T             F          (OK)
			 * F     T             T             T          (OK)
			 * F     T             F             T          (Invalid `!hasWhitespace && hasNewline`)
			 * F     T             F             F          Missing space between function name and paren.
			 * T     T             F             F          (Invalid `never && allowNewlines`)
			 * T     T             F             T          (Invalid `!hasWhitespace && hasNewline`)
			 * T     T             T             T          (Invalid `never && allowNewlines`)
			 * T     T             T             F          (Invalid `never && allowNewlines`)
			 * T     F             T             F          Unexpected space between function name and paren.
			 * T     F             T             T          Unexpected space between function name and paren.
			 * T     F             F             T          (Invalid `!hasWhitespace && hasNewline`)
			 * T     F             F             F          (OK)
			 *
			 * T                   T                        Unexpected space between function name and paren.
			 * F                   F                        Missing space between function name and paren.
			 * F     F                           T          Unexpected newline between function name and paren.
			 */

			if (never && hasWhitespace) {
				context.report({
					node,
					loc: {
						start: leftToken.loc.end,
						end: {
							line: rightToken.loc.start.line,
							column: rightToken.loc.start.column - 1,
						},
					},
					messageId: "unexpectedWhitespace",
					fix(fixer) {
						// Don't remove comments.
						if (
							sourceCode.commentsExistBetween(
								leftToken,
								rightToken,
							)
						) {
							return null;
						}

						// If `?.` exists, it doesn't hide no-unexpected-multiline errors
						if (node.optional) {
							return fixer.replaceTextRange(
								[leftToken.range[1], rightToken.range[0]],
								"?.",
							);
						}

						/*
						 * Only autofix if there is no newline
						 * https://github.com/eslint/eslint/issues/7787
						 */
						if (hasNewline) {
							return null;
						}
						return fixer.removeRange([
							leftToken.range[1],
							rightToken.range[0],
						]);
					},
				});
			} else if (!never && !hasWhitespace) {
				context.report({
					node,
					loc: {
						start: {
							line: leftToken.loc.end.line,
							column: leftToken.loc.end.column - 1,
						},
						end: rightToken.loc.start,
					},
					messageId: "missing",
					fix(fixer) {
						if (node.optional) {
							return null; // Not sure if inserting a space to either before/after `?.` token.
						}
						return fixer.insertTextBefore(rightToken, " ");
					},
				});
			} else if (!never && !allowNewlines && hasNewline) {
				context.report({
					node,
					loc: {
						start: leftToken.loc.end,
						end: rightToken.loc.start,
					},
					messageId: "unexpectedNewline",
					fix(fixer) {
						/*
						 * Only autofix if there is no newline
						 * https://github.com/eslint/eslint/issues/7787
						 * But if `?.` exists, it doesn't hide no-unexpected-multiline errors
						 */
						if (!node.optional) {
							return null;
						}

						// Don't remove comments.
						if (
							sourceCode.commentsExistBetween(
								leftToken,
								rightToken,
							)
						) {
							return null;
						}

						const range = [leftToken.range[1], rightToken.range[0]];
						const qdToken = sourceCode.getTokenAfter(leftToken);

						if (qdToken.range[0] === leftToken.range[1]) {
							return fixer.replaceTextRange(range, "?. ");
						}
						if (qdToken.range[1] === rightToken.range[0]) {
							return fixer.replaceTextRange(range, " ?.");
						}
						return fixer.replaceTextRange(range, " ?. ");
					},
				});
			}
		}

		return {
			"CallExpression, NewExpression"(node) {
				const lastToken = sourceCode.getLastToken(node);
				const lastCalleeToken = sourceCode.getLastToken(node.callee);
				const parenToken = sourceCode.getFirstTokenBetween(
					lastCalleeToken,
					lastToken,
					astUtils.isOpeningParenToken,
				);
				const prevToken =
					parenToken &&
					sourceCode.getTokenBefore(
						parenToken,
						astUtils.isNotQuestionDotToken,
					);

				// Parens in NewExpression are optional
				if (!(parenToken && parenToken.range[1] < node.range[1])) {
					return;
				}

				checkSpacing(node, prevToken, parenToken);
			},

			ImportExpression(node) {
				const leftToken = sourceCode.getFirstToken(node);
				const rightToken = sourceCode.getTokenAfter(leftToken);

				checkSpacing(node, leftToken, rightToken);
			},
		};
	},
};
<max"]/**
 * @fileoverview Rule to require function names to match the name of the variable or property to which they are assigned.
 * @author Annie Zhang, Pavel Strashkin
 */

"use strict";

//--------------------------------------------------------------------------
// Requirements
//--------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");
const esutils = require("esutils");

//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------

/**
 * Determines if a pattern is `module.exports` or `module["exports"]`
 * @param {ASTNode} pattern The left side of the AssignmentExpression
 * @returns {boolean} True if the pattern is `module.exports` or `module["exports"]`
 */
function isModuleExports(pattern) {
	if (
		pattern.type === "MemberExpression" &&
		pattern.object.type === "Identifier" &&
		pattern.object.name === "module"
	) {
		// module.exports
		if (
			pattern.property.type === "Identifier" &&
			pattern.property.name === "exports"
		) {
			return true;
		}

		// module["exports"]
		if (
			pattern.property.type === "Literal" &&
			pattern.property.value === "exports"
		) {
			return true;
		}
	}
	return false;
}

/**
 * Determines if a string name is a valid identifier
 * @param {string} name The string to be checked
 * @param {number} ecmaVersion The ECMAScript version if specified in the parserOptions config
 * @returns {boolean} True if the string is a valid identifier
 */
function isIdentifier(name, ecmaVersion) {
	if (ecmaVersion >= 2015) {
		return esutils.keyword.isIdentifierES6(name);
	}
	return esutils.keyword.isIdentifierES5(name);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

const alwaysOrNever = { enum: ["always", "never"] };
const optionsObject = {
	type: "object",
	properties: {
		considerPropertyDescriptor: {
			type: "boolean",
		},
		includeCommonJSModuleExports: {
			type: "boolean",
		},
	},
	additionalProperties: false,
};

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Require function names to match the name of the variable or property to which they are assigned",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/func-name-matching",
		},

		schema: {
			anyOf: [
				{
					type: "array",
					additionalItems: false,
					items: [alwaysOrNever, optionsObject],
				},
				{
					type: "array",
					additionalItems: false,
					items: [optionsObject],
				},
			],
		},

		defaultOptions: ["always"],

		messages: {
			matchProperty:
				"Function name `{{funcName}}` should match property name `{{name}}`.",
			matchVariable:
				"Function name `{{funcName}}` should match variable name `{{name}}`.",
			notMatchProperty:
				"Function name `{{funcName}}` should not match property name `{{name}}`.",
			notMatchVariable:
				"Function name `{{funcName}}` should not match variable name `{{name}}`.",
		},
	},

	create(context) {
		const options =
			(typeof context.options[0] === "object"
				? context.options[0]
				: context.options[1]) || {};
		const nameMatches =
			typeof context.options[0] === "string"
				? context.options[0]
				: "always";
		const considerPropertyDescriptor = options.considerPropertyDescriptor;
		const includeModuleExports = options.includeCommonJSModuleExports;
		const ecmaVersion = context.languageOptions.ecmaVersion;

		/**
		 * Check whether node is a certain CallExpression.
		 * @param {string} objName object name
		 * @param {string} funcName function name
		 * @param {ASTNode} node The node to check
		 * @returns {boolean} `true` if node matches CallExpression
		 */
		function isPropertyCall(objName, funcName, node) {
			if (!node) {
				return false;
			}
			return (
				node.type === "CallExpression" &&
				astUtils.isSpecificMemberAccess(node.callee, objName, funcName)
			);
		}

		/**
		 * Compares identifiers based on the nameMatches option
		 * @param {string} x the first identifier
		 * @param {string} y the second identifier
		 * @returns {boolean} whether the two identifiers should warn.
		 */
		function shouldWarn(x, y) {
			return (
				(nameMatches === "always" && x !== y) ||
				(nameMatches === "never" && x === y)
			);
		}

		/**
		 * Reports
		 * @param {ASTNode} node The node to report
		 * @param {string} name The variable or property name
		 * @param {string} funcName The function name
		 * @param {boolean} isProp True if the reported node is a property assignment
		 * @returns {void}
		 */
		function report(node, name, funcName, isProp) {
			let messageId;

			if (nameMatches === "always" && isProp) {
				messageId = "matchProperty";
			} else if (nameMatches === "always") {
				messageId = "matchVariable";
			} else if (isProp) {
				messageId = "notMatchProperty";
			} else {
				messageId = "notMatchVariable";
			}
			context.report({
				node,
				messageId,
				data: {
					name,
					funcName,
				},
			});
		}

		/**
		 * Determines whether a given node is a string literal
		 * @param {ASTNode} node The node to check
		 * @returns {boolean} `true` if the node is a string literal
		 */
		function isStringLiteral(node) {
			return node.type === "Literal" && typeof node.value === "string";
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			VariableDeclarator(node) {
				if (
					!node.init ||
					node.init.type !== "FunctionExpression" ||
					node.id.type !== "Identifier"
				) {
					return;
				}
				if (
					node.init.id &&
					shouldWarn(node.id.name, node.init.id.name)
				) {
					report(node, node.id.name, node.init.id.name, false);
				}
			},

			AssignmentExpression(node) {
				if (
					node.right.type !== "FunctionExpression" ||
					(node.left.computed &&
						node.left.property.type !== "Literal") ||
					(!includeModuleExports && isModuleExports(node.left)) ||
					(node.left.type !== "Identifier" &&
						node.left.type !== "MemberExpression")
				) {
					return;
				}

				const isProp = node.left.type === "MemberExpression";
				const name = isProp
					? astUtils.getStaticPropertyName(node.left)
					: node.left.name;

				if (
					node.right.id &&
					name &&
					isIdentifier(name) &&
					shouldWarn(name, node.right.id.name)
				) {
					report(node, name, node.right.id.name, isProp);
				}
			},

			"Property, PropertyDefinition[value]"(node) {
				if (!(
					node.value.type === "FunctionExpression" && node.value.id
				)) {
					return;
				}

				if (node.key.type === "Identifier" && !node.computed) {
					const functionName = node.value.id.name;
					let propertyName = node.key.name;

					if (
						considerPropertyDescriptor &&
						propertyName === "value" &&
						node.parent.type === "ObjectExpression"
					) {
						if (
							isPropertyCall(
								"Object",
								"defineProperty",
								node.parent.parent,
							) ||
							isPropertyCall(
								"Reflect",
								"defineProperty",
								node.parent.parent,
							)
						) {
							const property = node.parent.parent.arguments[1];

							if (
								isStringLiteral(property) &&
								shouldWarn(property.value, functionName)
							) {
								report(
									node,
									property.value,
									functionName,
									true,
								);
							}
						} else if (
							isPropertyCall(
								"Object",
								"defineProperties",
								node.parent.parent.parent.parent,
							)
						) {
							propertyName = node.parent.parent.key.name;
							if (
								!node.parent.parent.computed &&
								shouldWarn(propertyName, functionName)
							) {
								report(node, propertyName, functionName, true);
							}
						} else if (
							isPropertyCall(
								"Object",
								"create",
								node.parent.parent.parent.parent,
							)
						) {
							propertyName = node.parent.parent.key.name;
							if (
								!node.parent.parent.computed &&
								shouldWarn(propertyName, functionName)
							) {
								report(node, propertyName, functionName, true);
							}
						} else if (shouldWarn(propertyName, functionName)) {
							report(node, propertyName, functionName, true);
						}
					} else if (shouldWarn(propertyName, functionName)) {
						report(node, propertyName, functionName, true);
					}
					return;
				}

				if (
					isStringLiteral(node.key) &&
					isIdentifier(node.key.value, ecmaVersion) &&
					shouldWarn(node.key.value, node.value.id.name)
				) {
					report(node, node.key.value, node.value.id.name, true);
				}
			},
		};
	},
};
#-Եx:/**
 * @fileoverview Rule to warn when a function expression does not have a name.
 * @author Kyle T. Nunery
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @typedef {import("eslint-scope").Variable} Variable */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Checks whether or not a given variable is a function name.
 * @param {Variable} variable A variable to check.
 * @returns {boolean} `true` if the variable is a function name.
 */
function isFunctionName(variable) {
	return variable && variable.defs[0].type === "FunctionName";
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: ["always", {}],

		docs: {
			description: "Require or disallow named `function` expressions",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/func-names",
		},

		schema: {
			definitions: {
				value: {
					enum: ["always", "as-needed", "never"],
				},
			},
			type: "array",
			items: [
				{
					$ref: "#/definitions/value",
				},
				{
					type: "object",
					properties: {
						generators: {
							$ref: "#/definitions/value",
						},
					},
					additionalProperties: false,
				},
			],
			additionalItems: false,
		},

		messages: {
			unnamed: "Unexpected unnamed {{name}}.",
			named: "Unexpected named {{name}}.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		/**
		 * Returns the config option for the given node.
		 * @param {ASTNode} node A node to get the config for.
		 * @returns {string} The config option.
		 */
		function getConfigForNode(node) {
			if (node.generator && context.options[1].generators) {
				return context.options[1].generators;
			}

			return context.options[0];
		}

		/**
		 * Determines whether the current FunctionExpression node is a get, set, or
		 * shorthand method in an object literal or a class.
		 * @param {ASTNode} node A node to check.
		 * @returns {boolean} True if the node is a get, set, or shorthand method.
		 */
		function isObjectOrClassMethod(node) {
			const parent = node.parent;

			return (
				parent.type === "MethodDefinition" ||
				(parent.type === "Property" &&
					(parent.method ||
						parent.kind === "get" ||
						parent.kind === "set"))
			);
		}

		/**
		 * Determines whether the current FunctionExpression node has a name that would be
		 * inferred from context in a conforming ES6 environment.
		 * @param {ASTNode} node A node to check.
		 * @returns {boolean} True if the node would have a name assigned automatically.
		 */
		function hasInferredName(node) {
			const parent = node.parent;

			return (
				isObjectOrClassMethod(node) ||
				(parent.type === "VariableDeclarator" &&
					parent.id.type === "Identifier" &&
					parent.init === node) ||
				(parent.type === "Property" && parent.value === node) ||
				(parent.type === "PropertyDefinition" &&
					parent.value === node) ||
				(parent.type === "AssignmentExpression" &&
					parent.left.type === "Identifier" &&
					parent.right === node) ||
				(parent.type === "AssignmentPattern" &&
					parent.left.type === "Identifier" &&
					parent.right === node)
			);
		}

		/**
		 * Reports that an unnamed function should be named
		 * @param {ASTNode} node The node to report in the event of an error.
		 * @returns {void}
		 */
		function reportUnexpectedUnnamedFunction(node) {
			context.report({
				node,
				messageId: "unnamed",
				loc: astUtils.getFunctionHeadLoc(node, sourceCode),
				data: { name: astUtils.getFunctionNameWithKind(node) },
			});
		}

		/**
		 * Reports that a named function should be unnamed
		 * @param {ASTNode} node The node to report in the event of an error.
		 * @returns {void}
		 */
		function reportUnexpectedNamedFunction(node) {
			context.report({
				node,
				messageId: "named",
				loc: astUtils.getFunctionHeadLoc(node, sourceCode),
				data: { name: astUtils.getFunctionNameWithKind(node) },
			});
		}

		/**
		 * The listener for function nodes.
		 * @param {ASTNode} node function node
		 * @returns {void}
		 */
		function handleFunction(node) {
			// Skip recursive functions.
			const nameVar = sourceCode.getDeclaredVariables(node)[0];

			if (isFunctionName(nameVar) && nameVar.references.length > 0) {
				return;
			}

			const hasName = Boolean(node.id && node.id.name);
			const config = getConfigForNode(node);

			if (config === "never") {
				if (hasName && node.type !== "FunctionDeclaration") {
					reportUnexpectedNamedFunction(node);
				}
			} else if (config === "as-needed") {
				if (!hasName && !hasInferredName(node)) {
					reportUnexpectedUnnamedFunction(node);
				}
			} else {
				if (!hasName && !isObjectOrClassMethod(node)) {
					reportUnexpectedUnnamedFunction(node);
				}
			}
		}

		return {
			"FunctionExpression:exit": handleFunction,
			"ExportDefaultDeclaration > FunctionDeclaration": handleFunction,
		};
	},
};
(q6x?/**
 * @fileoverview Rule to enforce a particular function style
 * @author Nicholas C. Zakas
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			"expression",
			{
				allowArrowFunctions: false,
				allowTypeAnnotation: false,
				overrides: {},
			},
		],

		docs: {
			description:
				"Enforce the consistent use of either `function` declarations or expressions assigned to variables",
			dialects: ["JavaScript", "TypeScript"],
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/func-style",
		},

		schema: [
			{
				enum: ["declaration", "expression"],
			},
			{
				type: "object",
				properties: {
					allowArrowFunctions: {
						type: "boolean",
					},
					allowTypeAnnotation: {
						type: "boolean",
					},
					overrides: {
						type: "object",
						properties: {
							namedExports: {
								enum: ["declaration", "expression", "ignore"],
							},
						},
						additionalProperties: false,
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			expression: "Expected a function expression.",
			declaration: "Expected a function declaration.",
		},
	},

	create(context) {
		const [style, { allowArrowFunctions, allowTypeAnnotation, overrides }] =
			context.options;
		const enforceDeclarations = style === "declaration";
		const { namedExports: exportFunctionStyle } = overrides;
		const stack = [];

		/**
		 * Checks if a function declaration is part of an overloaded function
		 * @param {ASTNode} node The function declaration node to check
		 * @returns {boolean} True if the function is overloaded
		 */
		function isOverloadedFunction(node) {
			const functionName = node.id.name;

			if (node.parent.type === "ExportNamedDeclaration") {
				return node.parent.parent.body.some(
					member =>
						member.type === "ExportNamedDeclaration" &&
						member.declaration?.type === "TSDeclareFunction" &&
						member.declaration.id.name === functionName,
				);
			}

			if (node.parent.type === "SwitchCase") {
				return node.parent.parent.cases.some(switchCase =>
					switchCase.consequent.some(
						member =>
							member.type === "TSDeclareFunction" &&
							member.id.name === functionName,
					),
				);
			}

			return (
				Array.isArray(node.parent.body) &&
				node.parent.body.some(
					member =>
						member.type === "TSDeclareFunction" &&
						member.id.name === functionName,
				)
			);
		}

		const nodesToCheck = {
			FunctionDeclaration(node) {
				stack.push(false);

				if (
					!enforceDeclarations &&
					node.parent.type !== "ExportDefaultDeclaration" &&
					(typeof exportFunctionStyle === "undefined" ||
						node.parent.type !== "ExportNamedDeclaration") &&
					!isOverloadedFunction(node)
				) {
					context.report({ node, messageId: "expression" });
				}

				if (
					node.parent.type === "ExportNamedDeclaration" &&
					exportFunctionStyle === "expression" &&
					!isOverloadedFunction(node)
				) {
					context.report({ node, messageId: "expression" });
				}
			},
			"FunctionDeclaration:exit"() {
				stack.pop();
			},

			FunctionExpression(node) {
				stack.push(false);

				if (
					enforceDeclarations &&
					node.parent.type === "VariableDeclarator" &&
					(typeof exportFunctionStyle === "undefined" ||
						node.parent.parent.parent.type !==
							"ExportNamedDeclaration") &&
					!(allowTypeAnnotation && node.parent.id.typeAnnotation)
				) {
					context.report({
						node: node.parent,
						messageId: "declaration",
					});
				}

				if (
					node.parent.type === "VariableDeclarator" &&
					node.parent.parent.parent.type ===
						"ExportNamedDeclaration" &&
					exportFunctionStyle === "declaration" &&
					!(allowTypeAnnotation && node.parent.id.typeAnnotation)
				) {
					context.report({
						node: node.parent,
						messageId: "declaration",
					});
				}
			},
			"FunctionExpression:exit"() {
				stack.pop();
			},

			"ThisExpression, Super"() {
				if (stack.length > 0) {
					stack[stack.length - 1] = true;
				}
			},
		};

		if (!allowArrowFunctions) {
			nodesToCheck.ArrowFunctionExpression = function () {
				stack.push(false);
			};

			nodesToCheck["ArrowFunctionExpression:exit"] = function (node) {
				const hasThisOrSuperExpr = stack.pop();

				if (
					!hasThisOrSuperExpr &&
					node.parent.type === "VariableDeclarator"
				) {
					if (
						enforceDeclarations &&
						(typeof exportFunctionStyle === "undefined" ||
							node.parent.parent.parent.type !==
								"ExportNamedDeclaration") &&
						!(allowTypeAnnotation && node.parent.id.typeAnnotation)
					) {
						context.report({
							node: node.parent,
							messageId: "declaration",
						});
					}

					if (
						node.parent.parent.parent.type ===
							"ExportNamedDeclaration" &&
						exportFunctionStyle === "declaration" &&
						!(allowTypeAnnotation && node.parent.id.typeAnnotation)
					) {
						context.report({
							node: node.parent,
							messageId: "declaration",
						});
					}
				}
			};
		}

		return nodesToCheck;
	},
};
ƾx~/**
 * @fileoverview Rule to enforce line breaks between arguments of a function call
 * @author Alexey Gonchar <https://github.com/finico>
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "function-call-argument-newline",
						url: "https://eslint.style/rules/function-call-argument-newline",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description:
				"Enforce line breaks between arguments of a function call",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/function-call-argument-newline",
		},

		fixable: "whitespace",

		schema: [
			{
				enum: ["always", "never", "consistent"],
			},
		],

		messages: {
			unexpectedLineBreak: "There should be no line break here.",
			missingLineBreak:
				"There should be a line break after this argument.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		const checkers = {
			unexpected: {
				messageId: "unexpectedLineBreak",
				check: (prevToken, currentToken) =>
					prevToken.loc.end.line !== currentToken.loc.start.line,
				createFix: (token, tokenBefore) => fixer =>
					fixer.replaceTextRange(
						[tokenBefore.range[1], token.range[0]],
						" ",
					),
			},
			missing: {
				messageId: "missingLineBreak",
				check: (prevToken, currentToken) =>
					prevToken.loc.end.line === currentToken.loc.start.line,
				createFix: (token, tokenBefore) => fixer =>
					fixer.replaceTextRange(
						[tokenBefore.range[1], token.range[0]],
						"\n",
					),
			},
		};

		/**
		 * Check all arguments for line breaks in the CallExpression
		 * @param {CallExpression} node node to evaluate
		 * @param {{ messageId: string, check: Function }} checker selected checker
		 * @returns {void}
		 * @private
		 */
		function checkArguments(node, checker) {
			for (let i = 1; i < node.arguments.length; i++) {
				const prevArgToken = sourceCode.getLastToken(
					node.arguments[i - 1],
				);
				const currentArgToken = sourceCode.getFirstToken(
					node.arguments[i],
				);

				if (checker.check(prevArgToken, currentArgToken)) {
					const tokenBefore = sourceCode.getTokenBefore(
						currentArgToken,
						{ includeComments: true },
					);

					const hasLineCommentBefore = tokenBefore.type === "Line";

					context.report({
						node,
						loc: {
							start: tokenBefore.loc.end,
							end: currentArgToken.loc.start,
						},
						messageId: checker.messageId,
						fix: hasLineCommentBefore
							? null
							: checker.createFix(currentArgToken, tokenBefore),
					});
				}
			}
		}

		/**
		 * Check if open space is present in a function name
		 * @param {CallExpression} node node to evaluate
		 * @returns {void}
		 * @private
		 */
		function check(node) {
			if (node.arguments.length < 2) {
				return;
			}

			const option = context.options[0] || "always";

			if (option === "never") {
				checkArguments(node, checkers.unexpected);
			} else if (option === "always") {
				checkArguments(node, checkers.missing);
			} else if (option === "consistent") {
				const firstArgToken = sourceCode.getLastToken(
					node.arguments[0],
				);
				const secondArgToken = sourceCode.getFirstToken(
					node.arguments[1],
				);

				if (
					firstArgToken.loc.end.line === secondArgToken.loc.start.line
				) {
					checkArguments(node, checkers.unexpected);
				} else {
					checkArguments(node, checkers.missing);
				}
			}
		}

		return {
			CallExpression: check,
			NewExpression: check,
		};
	},
};
FMx')/**
 * @fileoverview enforce consistent line breaks inside function parentheses
 * @author Teddy Katz
 * @deprecated in ESLint v8.53.0
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "function-paren-newline",
						url: "https://eslint.style/rules/function-paren-newline",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description:
				"Enforce consistent line breaks inside function parentheses",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/function-paren-newline",
		},

		fixable: "whitespace",

		schema: [
			{
				oneOf: [
					{
						enum: [
							"always",
							"never",
							"consistent",
							"multiline",
							"multiline-arguments",
						],
					},
					{
						type: "object",
						properties: {
							minItems: {
								type: "integer",
								minimum: 0,
							},
						},
						additionalProperties: false,
					},
				],
			},
		],

		messages: {
			expectedBefore: "Expected newline before ')'.",
			expectedAfter: "Expected newline after '('.",
			expectedBetween: "Expected newline between arguments/params.",
			unexpectedBefore: "Unexpected newline before ')'.",
			unexpectedAfter: "Unexpected newline after '('.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const rawOption = context.options[0] || "multiline";
		const multilineOption = rawOption === "multiline";
		const multilineArgumentsOption = rawOption === "multiline-arguments";
		const consistentOption = rawOption === "consistent";
		let minItems;

		if (typeof rawOption === "object") {
			minItems = rawOption.minItems;
		} else if (rawOption === "always") {
			minItems = 0;
		} else if (rawOption === "never") {
			minItems = Infinity;
		} else {
			minItems = null;
		}

		//----------------------------------------------------------------------
		// Helpers
		//----------------------------------------------------------------------

		/**
		 * Determines whether there should be newlines inside function parens
		 * @param {ASTNode[]} elements The arguments or parameters in the list
		 * @param {boolean} hasLeftNewline `true` if the left paren has a newline in the current code.
		 * @returns {boolean} `true` if there should be newlines inside the function parens
		 */
		function shouldHaveNewlines(elements, hasLeftNewline) {
			if (multilineArgumentsOption && elements.length === 1) {
				return hasLeftNewline;
			}
			if (multilineOption || multilineArgumentsOption) {
				return elements.some(
					(element, index) =>
						index !== elements.length - 1 &&
						element.loc.end.line !==
							elements[index + 1].loc.start.line,
				);
			}
			if (consistentOption) {
				return hasLeftNewline;
			}
			return elements.length >= minItems;
		}

		/**
		 * Validates parens
		 * @param {Object} parens An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token
		 * @param {ASTNode[]} elements The arguments or parameters in the list
		 * @returns {void}
		 */
		function validateParens(parens, elements) {
			const leftParen = parens.leftParen;
			const rightParen = parens.rightParen;
			const tokenAfterLeftParen = sourceCode.getTokenAfter(leftParen);
			const tokenBeforeRightParen = sourceCode.getTokenBefore(rightParen);
			const hasLeftNewline = !astUtils.isTokenOnSameLine(
				leftParen,
				tokenAfterLeftParen,
			);
			const hasRightNewline = !astUtils.isTokenOnSameLine(
				tokenBeforeRightParen,
				rightParen,
			);
			const needsNewlines = shouldHaveNewlines(elements, hasLeftNewline);

			if (hasLeftNewline && !needsNewlines) {
				context.report({
					node: leftParen,
					messageId: "unexpectedAfter",
					fix(fixer) {
						return sourceCode
							.getText()
							.slice(
								leftParen.range[1],
								tokenAfterLeftParen.range[0],
							)
							.trim()
							? // If there is a comment between the ( and the first element, don't do a fix.
								null
							: fixer.removeRange([
									leftParen.range[1],
									tokenAfterLeftParen.range[0],
								]);
					},
				});
			} else if (!hasLeftNewline && needsNewlines) {
				context.report({
					node: leftParen,
					messageId: "expectedAfter",
					fix: fixer => fixer.insertTextAfter(leftParen, "\n"),
				});
			}

			if (hasRightNewline && !needsNewlines) {
				context.report({
					node: rightParen,
					messageId: "unexpectedBefore",
					fix(fixer) {
						return sourceCode
							.getText()
							.slice(
								tokenBeforeRightParen.range[1],
								rightParen.range[0],
							)
							.trim()
							? // If there is a comment between the last element and the ), don't do a fix.
								null
							: fixer.removeRange([
									tokenBeforeRightParen.range[1],
									rightParen.range[0],
								]);
					},
				});
			} else if (!hasRightNewline && needsNewlines) {
				context.report({
					node: rightParen,
					messageId: "expectedBefore",
					fix: fixer => fixer.insertTextBefore(rightParen, "\n"),
				});
			}
		}

		/**
		 * Validates a list of arguments or parameters
		 * @param {Object} parens An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token
		 * @param {ASTNode[]} elements The arguments or parameters in the list
		 * @returns {void}
		 */
		function validateArguments(parens, elements) {
			const leftParen = parens.leftParen;
			const tokenAfterLeftParen = sourceCode.getTokenAfter(leftParen);
			const hasLeftNewline = !astUtils.isTokenOnSameLine(
				leftParen,
				tokenAfterLeftParen,
			);
			const needsNewlines = shouldHaveNewlines(elements, hasLeftNewline);

			for (let i = 0; i <= elements.length - 2; i++) {
				const currentElement = elements[i];
				const nextElement = elements[i + 1];
				const hasNewLine =
					currentElement.loc.end.line !== nextElement.loc.start.line;

				if (!hasNewLine && needsNewlines) {
					context.report({
						node: currentElement,
						messageId: "expectedBetween",
						fix: fixer => fixer.insertTextBefore(nextElement, "\n"),
					});
				}
			}
		}

		/**
		 * Gets the left paren and right paren tokens of a node.
		 * @param {ASTNode} node The node with parens
		 * @throws {TypeError} Unexpected node type.
		 * @returns {Object} An object with keys `leftParen` for the left paren token, and `rightParen` for the right paren token.
		 * Can also return `null` if an expression has no parens (e.g. a NewExpression with no arguments, or an ArrowFunctionExpression
		 * with a single parameter)
		 */
		function getParenTokens(node) {
			switch (node.type) {
				case "NewExpression":
					if (
						!node.arguments.length &&
						!(
							astUtils.isOpeningParenToken(
								sourceCode.getLastToken(node, { skip: 1 }),
							) &&
							astUtils.isClosingParenToken(
								sourceCode.getLastToken(node),
							) &&
							node.callee.range[1] < node.range[1]
						)
					) {
						// If the NewExpression does not have parens (e.g. `new Foo`), return null.
						return null;
					}

				// falls through

				case "CallExpression":
					return {
						leftParen: sourceCode.getTokenAfter(
							node.callee,
							astUtils.isOpeningParenToken,
						),
						rightParen: sourceCode.getLastToken(node),
					};

				case "FunctionDeclaration":
				case "FunctionExpression": {
					const leftParen = sourceCode.getFirstToken(
						node,
						astUtils.isOpeningParenToken,
					);
					const rightParen = node.params.length
						? sourceCode.getTokenAfter(
								node.params.at(-1),
								astUtils.isClosingParenToken,
							)
						: sourceCode.getTokenAfter(leftParen);

					return { leftParen, rightParen };
				}

				case "ArrowFunctionExpression": {
					const firstToken = sourceCode.getFirstToken(node, {
						skip: node.async ? 1 : 0,
					});

					if (!astUtils.isOpeningParenToken(firstToken)) {
						// If the ArrowFunctionExpression has a single param without parens, return null.
						return null;
					}

					const rightParen = node.params.length
						? sourceCode.getTokenAfter(
								node.params.at(-1),
								astUtils.isClosingParenToken,
							)
						: sourceCode.getTokenAfter(firstToken);

					return {
						leftParen: firstToken,
						rightParen,
					};
				}

				case "ImportExpression": {
					const leftParen = sourceCode.getFirstToken(node, 1);
					const rightParen = sourceCode.getLastToken(node);

					return { leftParen, rightParen };
				}

				default:
					throw new TypeError(
						`unexpected node with type ${node.type}`,
					);
			}
		}

		//----------------------------------------------------------------------
		// Public
		//----------------------------------------------------------------------

		return {
			[[
				"ArrowFunctionExpression",
				"CallExpression",
				"FunctionDeclaration",
				"FunctionExpression",
				"ImportExpression",
				"NewExpression",
			]](node) {
				const parens = getParenTokens(node);
				let params;

				if (node.type === "ImportExpression") {
					params = [node.source];
				} else if (astUtils.isFunction(node)) {
					params = node.params;
				} else {
					params = node.arguments;
				}

				if (parens) {
					validateParens(parens, params);

					if (multilineArgumentsOption) {
						validateArguments(parens, params);
					}
				}
			},
		};
	},
};
KSx\/**
 * @fileoverview Rule to check the spacing around the * in generator functions.
 * @author Jamund Ferguson
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

const OVERRIDE_SCHEMA = {
	oneOf: [
		{
			enum: ["before", "after", "both", "neither"],
		},
		{
			type: "object",
			properties: {
				before: { type: "boolean" },
				after: { type: "boolean" },
			},
			additionalProperties: false,
		},
	],
};

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "generator-star-spacing",
						url: "https://eslint.style/rules/generator-star-spacing",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description:
				"Enforce consistent spacing around `*` operators in generator functions",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/generator-star-spacing",
		},

		fixable: "whitespace",

		schema: [
			{
				oneOf: [
					{
						enum: ["before", "after", "both", "neither"],
					},
					{
						type: "object",
						properties: {
							before: { type: "boolean" },
							after: { type: "boolean" },
							named: OVERRIDE_SCHEMA,
							anonymous: OVERRIDE_SCHEMA,
							method: OVERRIDE_SCHEMA,
						},
						additionalProperties: false,
					},
				],
			},
		],

		messages: {
			missingBefore: "Missing space before *.",
			missingAfter: "Missing space after *.",
			unexpectedBefore: "Unexpected space before *.",
			unexpectedAfter: "Unexpected space after *.",
		},
	},

	create(context) {
		const optionDefinitions = {
			before: { before: true, after: false },
			after: { before: false, after: true },
			both: { before: true, after: true },
			neither: { before: false, after: false },
		};

		/**
		 * Returns resolved option definitions based on an option and defaults
		 * @param {any} option The option object or string value
		 * @param {Object} defaults The defaults to use if options are not present
		 * @returns {Object} the resolved object definition
		 */
		function optionToDefinition(option, defaults) {
			if (!option) {
				return defaults;
			}

			return typeof option === "string"
				? optionDefinitions[option]
				: Object.assign({}, defaults, option);
		}

		const modes = (function (option) {
			const defaults = optionToDefinition(
				option,
				optionDefinitions.before,
			);

			return {
				named: optionToDefinition(option.named, defaults),
				anonymous: optionToDefinition(option.anonymous, defaults),
				method: optionToDefinition(option.method, defaults),
			};
		})(context.options[0] || {});

		const sourceCode = context.sourceCode;

		/**
		 * Checks if the given token is a star token or not.
		 * @param {Token} token The token to check.
		 * @returns {boolean} `true` if the token is a star token.
		 */
		function isStarToken(token) {
			return token.value === "*" && token.type === "Punctuator";
		}

		/**
		 * Gets the generator star token of the given function node.
		 * @param {ASTNode} node The function node to get.
		 * @returns {Token} Found star token.
		 */
		function getStarToken(node) {
			return sourceCode.getFirstToken(
				node.parent.method || node.parent.type === "MethodDefinition"
					? node.parent
					: node,
				isStarToken,
			);
		}

		/**
		 * capitalize a given string.
		 * @param {string} str the given string.
		 * @returns {string} the capitalized string.
		 */
		function capitalize(str) {
			return str[0].toUpperCase() + str.slice(1);
		}

		/**
		 * Checks the spacing between two tokens before or after the star token.
		 * @param {string} kind Either "named", "anonymous", or "method"
		 * @param {string} side Either "before" or "after".
		 * @param {Token} leftToken `function` keyword token if side is "before", or
		 *     star token if side is "after".
		 * @param {Token} rightToken Star token if side is "before", or identifier
		 *     token if side is "after".
		 * @returns {void}
		 */
		function checkSpacing(kind, side, leftToken, rightToken) {
			if (
				!!(rightToken.range[0] - leftToken.range[1]) !==
				modes[kind][side]
			) {
				const after = leftToken.value === "*";
				const spaceRequired = modes[kind][side];
				const node = after ? leftToken : rightToken;
				const messageId = `${spaceRequired ? "missing" : "unexpected"}${capitalize(side)}`;

				context.report({
					node,
					messageId,
					fix(fixer) {
						if (spaceRequired) {
							if (after) {
								return fixer.insertTextAfter(node, " ");
							}
							return fixer.insertTextBefore(node, " ");
						}
						return fixer.removeRange([
							leftToken.range[1],
							rightToken.range[0],
						]);
					},
				});
			}
		}

		/**
		 * Enforces the spacing around the star if node is a generator function.
		 * @param {ASTNode} node A function expression or declaration node.
		 * @returns {void}
		 */
		function checkFunction(node) {
			if (!node.generator) {
				return;
			}

			const starToken = getStarToken(node);
			const prevToken = sourceCode.getTokenBefore(starToken);
			const nextToken = sourceCode.getTokenAfter(starToken);

			let kind = "named";

			if (
				node.parent.type === "MethodDefinition" ||
				(node.parent.type === "Property" && node.parent.method)
			) {
				kind = "method";
			} else if (!node.id) {
				kind = "anonymous";
			}

			// Only check before when preceded by `function`|`static` keyword
			if (!(
				kind === "method" &&
				starToken === sourceCode.getFirstToken(node.parent)
			)) {
				checkSpacing(kind, "before", prevToken, starToken);
			}

			checkSpacing(kind, "after", starToken, nextToken);
		}

		return {
			FunctionDeclaration: checkFunction,
			FunctionExpression: checkFunction,
		};
	},
};
`v׶xV/**
 * @fileoverview Enforces that a return statement is present in property getters.
 * @author Aladdin-ADD(hh_2013@foxmail.com)
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");
const { isAnySegmentReachable } = require("./utils/code-path-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const TARGET_NODE_TYPE = /^(?:Arrow)?FunctionExpression$/u;

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		defaultOptions: [
			{
				allowImplicit: false,
			},
		],

		docs: {
			description: "Enforce `return` statements in getters",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/getter-return",
		},

		fixable: null,

		schema: [
			{
				type: "object",
				properties: {
					allowImplicit: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			expected: "Expected to return a value in {{name}}.",
			expectedAlways: "Expected {{name}} to always return a value.",
		},
	},

	create(context) {
		const [{ allowImplicit }] = context.options;
		const sourceCode = context.sourceCode;

		let funcInfo = {
			upper: null,
			codePath: null,
			hasReturn: false,
			shouldCheck: false,
			node: null,
			currentSegments: [],
		};

		/**
		 * Checks whether or not the last code path segment is reachable.
		 * Then reports this function if the segment is reachable.
		 *
		 * If the last code path segment is reachable, there are paths which are not
		 * returned or thrown.
		 * @param {ASTNode} node A node to check.
		 * @returns {void}
		 */
		function checkLastSegment(node) {
			if (
				funcInfo.shouldCheck &&
				isAnySegmentReachable(funcInfo.currentSegments)
			) {
				context.report({
					node,
					loc: astUtils.getFunctionHeadLoc(node, sourceCode),
					messageId: funcInfo.hasReturn
						? "expectedAlways"
						: "expected",
					data: {
						name: astUtils.getFunctionNameWithKind(funcInfo.node),
					},
				});
			}
		}

		/**
		 * Checks whether a node means a getter function.
		 * @param {ASTNode} node a node to check.
		 * @returns {boolean} if node means a getter, return true; else return false.
		 */
		function isGetter(node) {
			const parent = node.parent;

			if (
				TARGET_NODE_TYPE.test(node.type) &&
				node.body.type === "BlockStatement"
			) {
				if (parent.kind === "get") {
					return true;
				}
				if (
					parent.type === "Property" &&
					astUtils.getStaticPropertyName(parent) === "get" &&
					parent.parent.type === "ObjectExpression"
				) {
					// Object.defineProperty() or Reflect.defineProperty()
					if (parent.parent.parent.type === "CallExpression") {
						const callNode = parent.parent.parent.callee;

						if (
							astUtils.isSpecificMemberAccess(
								callNode,
								"Object",
								"defineProperty",
							) ||
							astUtils.isSpecificMemberAccess(
								callNode,
								"Reflect",
								"defineProperty",
							)
						) {
							return true;
						}
					}

					// Object.defineProperties() or Object.create()
					if (
						parent.parent.parent.type === "Property" &&
						parent.parent.parent.parent.type ===
							"ObjectExpression" &&
						parent.parent.parent.parent.parent.type ===
							"CallExpression"
					) {
						const callNode =
							parent.parent.parent.parent.parent.callee;

						return (
							astUtils.isSpecificMemberAccess(
								callNode,
								"Object",
								"defineProperties",
							) ||
							astUtils.isSpecificMemberAccess(
								callNode,
								"Object",
								"create",
							)
						);
					}
				}
			}
			return false;
		}
		return {
			// Stacks this function's information.
			onCodePathStart(codePath, node) {
				funcInfo = {
					upper: funcInfo,
					codePath,
					hasReturn: false,
					shouldCheck: isGetter(node),
					node,
					currentSegments: new Set(),
				};
			},

			// Pops this function's information.
			onCodePathEnd() {
				funcInfo = funcInfo.upper;
			},
			onUnreachableCodePathSegmentStart(segment) {
				funcInfo.currentSegments.add(segment);
			},

			onUnreachableCodePathSegmentEnd(segment) {
				funcInfo.currentSegments.delete(segment);
			},

			onCodePathSegmentStart(segment) {
				funcInfo.currentSegments.add(segment);
			},

			onCodePathSegmentEnd(segment) {
				funcInfo.currentSegments.delete(segment);
			},

			// Checks the return statement is valid.
			ReturnStatement(node) {
				if (funcInfo.shouldCheck) {
					funcInfo.hasReturn = true;

					// if allowImplicit: false, should also check node.argument
					if (!allowImplicit && !node.argument) {
						context.report({
							node,
							messageId: "expected",
							data: {
								name: astUtils.getFunctionNameWithKind(
									funcInfo.node,
								),
							},
						});
					}
				}
			},

			// Reports a given function if the last path is reachable.
			"FunctionExpression:exit": checkLastSegment,
			"ArrowFunctionExpression:exit": checkLastSegment,
		};
	},
};
x%/**
 * @fileoverview Rule for disallowing require() outside of the top-level module context
 * @author Jamund Ferguson
 * @deprecated in ESLint v7.0.0
 */

"use strict";

const ACCEPTABLE_PARENTS = new Set([
	"AssignmentExpression",
	"VariableDeclarator",
	"MemberExpression",
	"ExpressionStatement",
	"CallExpression",
	"ConditionalExpression",
	"Program",
	"VariableDeclaration",
	"ChainExpression",
]);

/**
 * Finds the eslint-scope reference in the given scope.
 * @param {Object} scope The scope to search.
 * @param {ASTNode} node The identifier node.
 * @returns {Reference|null} Returns the found reference or null if none were found.
 */
function findReference(scope, node) {
	const references = scope.references.filter(
		reference =>
			reference.identifier.range[0] === node.range[0] &&
			reference.identifier.range[1] === node.range[1],
	);

	if (references.length === 1) {
		return references[0];
	}

	/* c8 ignore next */
	return null;
}

/**
 * Checks if the given identifier node is shadowed in the given scope.
 * @param {Object} scope The current scope.
 * @param {ASTNode} node The identifier node to check.
 * @returns {boolean} Whether or not the name is shadowed.
 */
function isShadowed(scope, node) {
	const reference = findReference(scope, node);

	return (
		reference && reference.resolved && reference.resolved.defs.length > 0
	);
}

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Node.js rules were moved out of ESLint core.",
			url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
			deprecatedSince: "7.0.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"eslint-plugin-n now maintains deprecated Node.js-related rules.",
					plugin: {
						name: "eslint-plugin-n",
						url: "https://github.com/eslint-community/eslint-plugin-n",
					},
					rule: {
						name: "global-require",
						url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/global-require.md",
					},
				},
			],
		},

		type: "suggestion",

		docs: {
			description:
				"Require `require()` calls to be placed at top-level module scope",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/global-require",
		},

		schema: [],
		messages: {
			unexpected: "Unexpected require().",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		return {
			CallExpression(node) {
				const currentScope = sourceCode.getScope(node);

				if (
					node.callee.name === "require" &&
					!isShadowed(currentScope, node.callee)
				) {
					const isGoodRequire = sourceCode
						.getAncestors(node)
						.every(parent => ACCEPTABLE_PARENTS.has(parent.type));

					if (!isGoodRequire) {
						context.report({ node, messageId: "unexpected" });
					}
				}
			},
		};
	},
};
x:_x	`W8Zrequire grouped accessor pairs in object literals and classes
 * @author Milos Djermanovicn=	T"anyOrder",
			{
fals.0Require grouped accessor pairs in object literalbUgrouped-'6 enum: ["anyOrder", "getBeforeSet", "setBeforeGet"] },1ynotGrouped:
				"Accessor pair {{ formerName }} and {{ latterName }} should be grouped.",
			invalidOrder:
				"Expected {{ lat5terName }} to be before {{ formerName }}.",
		},
	},
order, { enforceForTSTypes }J{ sourceCode } = context accessor pairId messageIdC} formerNode getter/setter node that is defined before `latterNode`B} latterNode getter/setter node that is defined after `formerNode`&6,report(messageId, formerNode, latterNode) {
!node: latterNode,
				messageId,
%
					latterNode.type !== "TSMethodSignature"
						? latterNode.value
						: latterNode,
					sourceCode,
				),
				data: {
					formerNameP
						formerNode.type !== "TSMethodSignature"
							? formerNode.value
							: formerNode,
					),
					latterName: astUtilsP
						latterNode.type !== "TSMethodSignature"
							? latterNode.value
							: latterNode,
					),
				},
			});
		}

		/**
ln\param {Function} shouldCheck – Predicate that returns `true` if the node should be checked&;
, shouldCheckshouldCheck(node) && // Don't report accessor properties that have duplicate getters or setters.
				if (getters.length === 1 && setters.length === 1) {
					const [getter] = getters,
						[setter] = setters,
						getterIndex = nodes.indexOf(getter),
						setterIndex = nodes.indexOf(setter),
						formerNode =
							getterIndex < setterIndex ? getter : setter,
						latterNode =
							getterIndex < setterIndex ? setter : getter;

					if (Math.abs(getterIndex - setterIndex) > 1) {
						report("notGrouped", formerNode, latterNode);
					} else if (
						(order === "getBeforeSet" &&
							getterIndex > setterIndex) ||
						(order === "setBefkoreGet" && getterIndex < setterIndex)
					) {
						report("invalidOrder", formerNode, latterNode);
					}!"return {
			&"	checkList(node.properties, n => n#G;
			},
			ClassBody(node) {
				checkList(
					node.body,
					n => n@ && !n.static,
				);
				checkList(
					node.body,
					n => n && n.static,
				);
			},
			v+ 
(node) {
	L+ 	checkList(
		)!7
							? node.members
							: node.body,
						n => n.*"		);
				}
			},
		};
	},
};
j쮴xx{/**
 * @fileoverview Rule to flag for-in loops without if statements inside
 * @author Nicholas C. Zakas
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Require `for-in` loops to include an `if` statement",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/guard-for-in",
		},

		schema: [],
		messages: {
			wrap: "The body of a for-in should be wrapped in an if statement to filter unwanted properties from the prototype.",
		},
	},

	create(context) {
		return {
			ForInStatement(node) {
				const body = node.body;

				// empty statement
				if (body.type === "EmptyStatement") {
					return;
				}

				// if statement
				if (body.type === "IfStatement") {
					return;
				}

				// empty block
				if (body.type === "BlockStatement" && body.body.length === 0) {
					return;
				}

				// block with just if statement
				if (
					body.type === "BlockStatement" &&
					body.body.length === 1 &&
					body.body[0].type === "IfStatement"
				) {
					return;
				}

				// block that starts with if statement
				if (
					body.type === "BlockStatement" &&
					body.body.length >= 1 &&
					body.body[0].type === "IfStatement"
				) {
					const i = body.body[0];

					// ... whose consequent is a continue
					if (i.consequent.type === "ContinueStatement") {
						return;
					}

					// ... whose consequent is a block that contains only a continue
					if (
						i.consequent.type === "BlockStatement" &&
						i.consequent.body.length === 1 &&
						i.consequent.body[0].type === "ContinueStatement"
					) {
						return;
					}
				}

				context.report({ node, messageId: "wrap" });
			},
		};
	},
};
!#xP/**
 * @fileoverview Ensure handling of errors when we know they exist.
 * @author Jamund Ferguson
 * @deprecated in ESLint v7.0.0
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Node.js rules were moved out of ESLint core.",
			url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
			deprecatedSince: "7.0.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"eslint-plugin-n now maintains deprecated Node.js-related rules.",
					plugin: {
						name: "eslint-plugin-n",
						url: "https://github.com/eslint-community/eslint-plugin-n",
					},
					rule: {
						name: "handle-callback-err",
						url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/handle-callback-err.md",
					},
				},
			],
		},

		type: "suggestion",

		docs: {
			description: "Require error handling in callbacks",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/handle-callback-err",
		},

		schema: [
			{
				type: "string",
			},
		],
		messages: {
			expected: "Expected error to be handled.",
		},
	},

	create(context) {
		const errorArgument = context.options[0] || "err";
		const sourceCode = context.sourceCode;

		/**
		 * Checks if the given argument should be interpreted as a regexp pattern.
		 * @param {string} stringToCheck The string which should be checked.
		 * @returns {boolean} Whether or not the string should be interpreted as a pattern.
		 */
		function isPattern(stringToCheck) {
			const firstChar = stringToCheck[0];

			return firstChar === "^";
		}

		/**
		 * Checks if the given name matches the configured error argument.
		 * @param {string} name The name which should be compared.
		 * @returns {boolean} Whether or not the given name matches the configured error variable name.
		 */
		function matchesConfiguredErrorName(name) {
			if (isPattern(errorArgument)) {
				const regexp = new RegExp(errorArgument, "u");

				return regexp.test(name);
			}
			return name === errorArgument;
		}

		/**
		 * Get the parameters of a given function scope.
		 * @param {Object} scope The function scope.
		 * @returns {Array} All parameters of the given scope.
		 */
		function getParameters(scope) {
			return scope.variables.filter(
				variable =>
					variable.defs[0] && variable.defs[0].type === "Parameter",
			);
		}

		/**
		 * Check to see if we're handling the error object properly.
		 * @param {ASTNode} node The AST node to check.
		 * @returns {void}
		 */
		function checkForError(node) {
			const scope = sourceCode.getScope(node),
				parameters = getParameters(scope),
				firstParameter = parameters[0];

			if (
				firstParameter &&
				matchesConfiguredErrorName(firstParameter.name)
			) {
				if (firstParameter.references.length === 0) {
					context.report({ node, messageId: "expected" });
				}
			}
		}

		return {
			FunctionDeclaration: checkForError,
			FunctionExpression: checkForError,
			ArrowFunctionExpression: checkForError,
		};
	},
};
.칼x,/**
 * @fileoverview Rule that warns when identifier names that are
 * specified in the configuration are used.
 * @author Keith Cirkel (http://keithcirkel.co.uk)
 * @deprecated in ESLint v7.5.0
 */

"use strict";

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Checks whether the given node represents assignment target in a normal assignment or destructuring.
 * @param {ASTNode} node The node to check.
 * @returns {boolean} `true` if the node is assignment target.
 */
function isAssignmentTarget(node) {
	const parent = node.parent;

	return (
		// normal assignment
		(parent.type === "AssignmentExpression" && parent.left === node) ||
		// destructuring
		parent.type === "ArrayPattern" ||
		parent.type === "RestElement" ||
		(parent.type === "Property" &&
			parent.value === node &&
			parent.parent.type === "ObjectPattern") ||
		(parent.type === "AssignmentPattern" && parent.left === node)
	);
}

/**
 * Checks whether the given node represents an imported name that is renamed in the same import/export specifier.
 *
 * Examples:
 * import { a as b } from 'mod'; // node `a` is renamed import
 * export { a as b } from 'mod'; // node `a` is renamed import
 * @param {ASTNode} node `Identifier` node to check.
 * @returns {boolean} `true` if the node is a renamed import.
 */
function isRenamedImport(node) {
	const parent = node.parent;

	return (
		(parent.type === "ImportSpecifier" &&
			parent.imported !== parent.local &&
			parent.imported === node) ||
		(parent.type === "ExportSpecifier" &&
			parent.parent.source && // re-export
			parent.local !== parent.exported &&
			parent.local === node)
	);
}

/**
 * Checks whether the given node is a renamed identifier node in an ObjectPattern destructuring.
 *
 * Examples:
 * const { a : b } = foo; // node `a` is renamed node.
 * @param {ASTNode} node `Identifier` node to check.
 * @returns {boolean} `true` if the node is a renamed node in an ObjectPattern destructuring.
 */
function isRenamedInDestructuring(node) {
	const parent = node.parent;

	return (
		!parent.computed &&
		parent.type === "Property" &&
		parent.parent.type === "ObjectPattern" &&
		parent.value !== node &&
		parent.key === node
	);
}

/**
 * Checks whether the given node represents shorthand definition of a property in an object literal.
 * @param {ASTNode} node `Identifier` node to check.
 * @returns {boolean} `true` if the node is a shorthand property definition.
 */
function isShorthandPropertyDefinition(node) {
	const parent = node.parent;

	return (
		parent.type === "Property" &&
		parent.parent.type === "ObjectExpression" &&
		parent.shorthand
	);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "The rule was renamed.",
			url: "https://eslint.org/blog/2020/07/eslint-v7.5.0-released/#deprecating-id-blacklist",
			deprecatedSince: "7.5.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					rule: {
						name: "id-denylist",
						url: "https://eslint.org/docs/rules/id-denylist",
					},
				},
			],
		},

		type: "suggestion",

		docs: {
			description: "Disallow specified identifiers",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/id-blacklist",
		},

		schema: {
			type: "array",
			items: {
				type: "string",
			},
			uniqueItems: true,
		},
		messages: {
			restricted: "Identifier '{{name}}' is restricted.",
		},
	},

	create(context) {
		const denyList = new Set(context.options);
		const reportedNodes = new Set();
		const sourceCode = context.sourceCode;

		let globalScope;

		/**
		 * Checks whether the given name is restricted.
		 * @param {string} name The name to check.
		 * @returns {boolean} `true` if the name is restricted.
		 * @private
		 */
		function isRestricted(name) {
			return denyList.has(name);
		}

		/**
		 * Checks whether the given node represents a reference to a global variable that is not declared in the source code.
		 * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables.
		 * @param {ASTNode} node `Identifier` node to check.
		 * @returns {boolean} `true` if the node is a reference to a global variable.
		 */
		function isReferenceToGlobalVariable(node) {
			const variable = globalScope.set.get(node.name);

			return (
				variable &&
				variable.defs.length === 0 &&
				variable.references.some(ref => ref.identifier === node)
			);
		}

		/**
		 * Determines whether the given node should be checked.
		 * @param {ASTNode} node `Identifier` node.
		 * @returns {boolean} `true` if the node should be checked.
		 */
		function shouldCheck(node) {
			const parent = node.parent;

			/*
			 * Member access has special rules for checking property names.
			 * Read access to a property with a restricted name is allowed, because it can be on an object that user has no control over.
			 * Write access isn't allowed, because it potentially creates a new property with a restricted name.
			 */
			if (
				parent.type === "MemberExpression" &&
				parent.property === node &&
				!parent.computed
			) {
				return isAssignmentTarget(parent);
			}

			return (
				parent.type !== "CallExpression" &&
				parent.type !== "NewExpression" &&
				!isRenamedImport(node) &&
				!isRenamedInDestructuring(node) &&
				!(
					isReferenceToGlobalVariable(node) &&
					!isShorthandPropertyDefinition(node)
				)
			);
		}

		/**
		 * Reports an AST node as a rule violation.
		 * @param {ASTNode} node The node to report.
		 * @returns {void}
		 * @private
		 */
		function report(node) {
			/*
			 * We used the range instead of the node because it's possible
			 * for the same identifier to be represented by two different
			 * nodes, with the most clear example being shorthand properties:
			 * { foo }
			 * In this case, "foo" is represented by one node for the name
			 * and one for the value. The only way to know they are the same
			 * is to look at the range.
			 */
			if (!reportedNodes.has(node.range.toString())) {
				context.report({
					node,
					messageId: "restricted",
					data: {
						name: node.name,
					},
				});
				reportedNodes.add(node.range.toString());
			}
		}

		return {
			Program(node) {
				globalScope = sourceCode.getScope(node);
			},

			Identifier(node) {
				if (isRestricted(node.name) && shouldCheck(node)) {
					report(node);
				}
			},
		};
	},
};
:$x*/**
 * @fileoverview Rule that warns when identifier names that are
 * specified in the configuration are used.
 * @author Keith Cirkel (http://keithcirkel.co.uk)
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Checks whether the given node represents assignment target in a normal assignment or destructuring.
 * @param {ASTNode} node The node to check.
 * @returns {boolean} `true` if the node is assignment target.
 */
function isAssignmentTarget(node) {
	const parent = node.parent;

	return (
		// normal assignment
		(parent.type === "AssignmentExpression" && parent.left === node) ||
		// destructuring
		parent.type === "ArrayPattern" ||
		parent.type === "RestElement" ||
		(parent.type === "Property" &&
			parent.value === node &&
			parent.parent.type === "ObjectPattern") ||
		(parent.type === "AssignmentPattern" && parent.left === node)
	);
}

/**
 * Checks whether the given node represents an imported name that is renamed in the same import/export specifier.
 *
 * Examples:
 * import { a as b } from 'mod'; // node `a` is renamed import
 * export { a as b } from 'mod'; // node `a` is renamed import
 * @param {ASTNode} node `Identifier` node to check.
 * @returns {boolean} `true` if the node is a renamed import.
 */
function isRenamedImport(node) {
	const parent = node.parent;

	return (
		(parent.type === "ImportSpecifier" &&
			parent.imported !== parent.local &&
			parent.imported === node) ||
		(parent.type === "ExportSpecifier" &&
			parent.parent.source && // re-export
			parent.local !== parent.exported &&
			parent.local === node)
	);
}

/**
 * Checks whether the given node is an ObjectPattern destructuring.
 *
 * Examples:
 * const { a : b } = foo;
 * @param {ASTNode} node `Identifier` node to check.
 * @returns {boolean} `true` if the node is in an ObjectPattern destructuring.
 */
function isPropertyNameInDestructuring(node) {
	const parent = node.parent;

	return (
		!parent.computed &&
		parent.type === "Property" &&
		parent.parent.type === "ObjectPattern" &&
		parent.key === node
	);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [],

		docs: {
			description: "Disallow specified identifiers",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/id-denylist",
		},

		schema: {
			type: "array",
			items: {
				type: "string",
			},
			uniqueItems: true,
		},
		messages: {
			restricted: "Identifier '{{name}}' is restricted.",
			restrictedPrivate: "Identifier '#{{name}}' is restricted.",
		},
	},

	create(context) {
		const denyList = new Set(context.options);
		const reportedNodes = new Set();
		const sourceCode = context.sourceCode;

		let globalScope;

		/**
		 * Checks whether the given name is restricted.
		 * @param {string} name The name to check.
		 * @returns {boolean} `true` if the name is restricted.
		 * @private
		 */
		function isRestricted(name) {
			return denyList.has(name);
		}

		/**
		 * Checks whether the given node represents a reference to a global variable that is not declared in the source code.
		 * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables.
		 * @param {ASTNode} node `Identifier` node to check.
		 * @returns {boolean} `true` if the node is a reference to a global variable.
		 */
		function isReferenceToGlobalVariable(node) {
			const variable = globalScope.set.get(node.name);

			return (
				variable &&
				variable.defs.length === 0 &&
				variable.references.some(ref => ref.identifier === node)
			);
		}

		/**
		 * Determines whether the given node should be checked.
		 * @param {ASTNode} node `Identifier` node.
		 * @returns {boolean} `true` if the node should be checked.
		 */
		function shouldCheck(node) {
			// Import attributes are defined by environments, so naming conventions shouldn't apply to them
			if (astUtils.isImportAttributeKey(node)) {
				return false;
			}

			const parent = node.parent;

			/*
			 * Member access has special rules for checking property names.
			 * Read access to a property with a restricted name is allowed, because it can be on an object that user has no control over.
			 * Write access isn't allowed, because it potentially creates a new property with a restricted name.
			 */
			if (
				parent.type === "MemberExpression" &&
				parent.property === node &&
				!parent.computed
			) {
				return isAssignmentTarget(parent);
			}

			return (
				parent.type !== "CallExpression" &&
				parent.type !== "NewExpression" &&
				!isRenamedImport(node) &&
				!isPropertyNameInDestructuring(node) &&
				!isReferenceToGlobalVariable(node)
			);
		}

		/**
		 * Reports an AST node as a rule violation.
		 * @param {ASTNode} node The node to report.
		 * @returns {void}
		 * @private
		 */
		function report(node) {
			/*
			 * We used the range instead of the node because it's possible
			 * for the same identifier to be represented by two different
			 * nodes, with the most clear example being shorthand properties:
			 * { foo }
			 * In this case, "foo" is represented by one node for the name
			 * and one for the value. The only way to know they are the same
			 * is to look at the range.
			 */
			if (!reportedNodes.has(node.range.toString())) {
				const isPrivate = node.type === "PrivateIdentifier";

				context.report({
					node,
					messageId: isPrivate ? "restrictedPrivate" : "restricted",
					data: {
						name: node.name,
					},
				});
				reportedNodes.add(node.range.toString());
			}
		}

		return {
			Program(node) {
				globalScope = sourceCode.getScope(node);
			},

			[["Identifier", "PrivateIdentifier"]](node) {
				if (isRestricted(node.name) && shouldCheck(node)) {
					report(node);
				}
			},
		};
	},
};
ڭWx/**
 * @fileoverview Rule that warns when identifier names are shorter or longer
 * than the values provided in configuration.
 * @author Burak Yigit Kaya aka BYK
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const { getGraphemeCount } = require("../shared/string-utils");
const {
	getModuleExportName,
	isImportAttributeKey,
} = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				exceptionPatterns: [],
				exceptions: [],
				min: 2,
				properties: "always",
			},
		],

		docs: {
			description: "Enforce minimum and maximum identifier lengths",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/id-length",
		},

		schema: [
			{
				type: "object",
				properties: {
					min: {
						type: "integer",
					},
					max: {
						type: "integer",
					},
					exceptions: {
						type: "array",
						uniqueItems: true,
						items: {
							type: "string",
						},
					},
					exceptionPatterns: {
						type: "array",
						uniqueItems: true,
						items: {
							type: "string",
						},
					},
					properties: {
						enum: ["always", "never"],
					},
				},
				additionalProperties: false,
			},
		],
		messages: {
			tooShort: "Identifier name '{{name}}' is too short (< {{min}}).",
			tooShortPrivate:
				"Identifier name '#{{name}}' is too short (< {{min}}).",
			tooLong: "Identifier name '{{name}}' is too long (> {{max}}).",
			tooLongPrivate:
				"Identifier name #'{{name}}' is too long (> {{max}}).",
		},
	},

	create(context) {
		const [options] = context.options;
		const { max: maxLength = Infinity, min: minLength } = options;
		const properties = options.properties !== "never";
		const exceptions = new Set(options.exceptions);
		const exceptionPatterns = options.exceptionPatterns.map(
			pattern => new RegExp(pattern, "u"),
		);
		const reportedNodes = new Set();

		/**
		 * Checks if a string matches the provided exception patterns
		 * @param {string} name The string to check.
		 * @returns {boolean} if the string is a match
		 * @private
		 */
		function matchesExceptionPattern(name) {
			return exceptionPatterns.some(pattern => pattern.test(name));
		}

		const SUPPORTED_EXPRESSIONS = {
			MemberExpression:
				properties &&
				function (parent) {
					return (
						!parent.computed &&
						// regular property assignment
						((parent.parent.left === parent &&
							parent.parent.type === "AssignmentExpression") ||
							// or the last identifier in an ObjectPattern destructuring
							(parent.parent.type === "Property" &&
								parent.parent.value === parent &&
								parent.parent.parent.type === "ObjectPattern" &&
								parent.parent.parent.parent.left ===
									parent.parent.parent))
					);
				},
			AssignmentPattern(parent, node) {
				return parent.left === node;
			},
			VariableDeclarator(parent, node) {
				return parent.id === node;
			},
			Property(parent, node) {
				if (parent.parent.type === "ObjectPattern") {
					const isKeyAndValueSame =
						parent.value.name === parent.key.name;

					return (
						(!isKeyAndValueSame && parent.value === node) ||
						(isKeyAndValueSame && parent.key === node && properties)
					);
				}
				return (
					properties &&
					!isImportAttributeKey(node) &&
					!parent.computed &&
					parent.key.name === node.name
				);
			},
			ImportSpecifier(parent, node) {
				return (
					parent.local === node &&
					getModuleExportName(parent.imported) !==
						getModuleExportName(parent.local)
				);
			},
			ImportDefaultSpecifier: true,
			ImportNamespaceSpecifier: true,
			RestElement: true,
			FunctionExpression: true,
			ArrowFunctionExpression: true,
			ClassDeclaration: true,
			FunctionDeclaration: true,
			MethodDefinition: true,
			PropertyDefinition: true,
			CatchClause: true,
			ArrayPattern: true,
		};

		return {
			[["Identifier", "PrivateIdentifier"]](node) {
				const name = node.name;
				const parent = node.parent;

				const nameLength = getGraphemeCount(name);

				const isShort = nameLength < minLength;
				const isLong = nameLength > maxLength;

				if (
					!(isShort || isLong) ||
					exceptions.has(name) ||
					matchesExceptionPattern(name)
				) {
					return; // Nothing to report
				}

				const isValidExpression = SUPPORTED_EXPRESSIONS[parent.type];

				/*
				 * We used the range instead of the node because it's possible
				 * for the same identifier to be represented by two different
				 * nodes, with the most clear example being shorthand properties:
				 * { foo }
				 * In this case, "foo" is represented by one node for the name
				 * and one for the value. The only way to know they are the same
				 * is to look at the range.
				 */
				if (
					isValidExpression &&
					!reportedNodes.has(node.range.toString()) &&
					(isValidExpression === true ||
						isValidExpression(parent, node))
				) {
					reportedNodes.add(node.range.toString());

					let messageId = isShort ? "tooShort" : "tooLong";

					if (node.type === "PrivateIdentifier") {
						messageId += "Private";
					}

					context.report({
						node,
						messageId,
						data: { name, min: minLength, max: maxLength },
					});
				}
			},
		};
	},
};
ux#/**
 * @fileoverview Rule to flag non-matching identifiers
 * @author Matthieu Larcher
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			"^.+$",
			{
				classFields: false,
				ignoreDestructuring: false,
				onlyDeclarations: false,
				properties: false,
			},
		],

		docs: {
			description:
				"Require identifiers to match a specified regular expression",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/id-match",
		},

		schema: [
			{
				type: "string",
			},
			{
				type: "object",
				properties: {
					properties: {
						type: "boolean",
					},
					classFields: {
						type: "boolean",
					},
					onlyDeclarations: {
						type: "boolean",
					},
					ignoreDestructuring: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],
		messages: {
			notMatch:
				"Identifier '{{name}}' does not match the pattern '{{pattern}}'.",
			notMatchPrivate:
				"Identifier '#{{name}}' does not match the pattern '{{pattern}}'.",
		},
	},

	create(context) {
		//--------------------------------------------------------------------------
		// Options
		//--------------------------------------------------------------------------
		const [
			pattern,
			{
				classFields: checkClassFields,
				ignoreDestructuring,
				onlyDeclarations,
				properties: checkProperties,
			},
		] = context.options;
		const regexp = new RegExp(pattern, "u");

		const sourceCode = context.sourceCode;
		let globalScope;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		// contains reported nodes to avoid reporting twice on destructuring with shorthand notation
		const reportedNodes = new Set();
		const ALLOWED_PARENT_TYPES = new Set([
			"CallExpression",
			"NewExpression",
		]);
		const DECLARATION_TYPES = new Set([
			"FunctionDeclaration",
			"VariableDeclarator",
		]);
		const IMPORT_TYPES = new Set([
			"ImportSpecifier",
			"ImportNamespaceSpecifier",
			"ImportDefaultSpecifier",
		]);

		/**
		 * Checks whether the given node represents a reference to a global variable that is not declared in the source code.
		 * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables.
		 * @param {ASTNode} node `Identifier` node to check.
		 * @returns {boolean} `true` if the node is a reference to a global variable.
		 */
		function isReferenceToGlobalVariable(node) {
			const variable = globalScope.set.get(node.name);

			return (
				variable &&
				variable.defs.length === 0 &&
				variable.references.some(ref => ref.identifier === node)
			);
		}

		/**
		 * Checks if a string matches the provided pattern
		 * @param {string} name The string to check.
		 * @returns {boolean} if the string is a match
		 * @private
		 */
		function isInvalid(name) {
			return !regexp.test(name);
		}

		/**
		 * Checks if a parent of a node is an ObjectPattern.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} if the node is inside an ObjectPattern
		 * @private
		 */
		function isInsideObjectPattern(node) {
			let { parent } = node;

			while (parent) {
				if (parent.type === "ObjectPattern") {
					return true;
				}

				parent = parent.parent;
			}

			return false;
		}

		/**
		 * Verifies if we should report an error or not based on the effective
		 * parent node and the identifier name.
		 * @param {ASTNode} effectiveParent The effective parent node of the node to be reported
		 * @param {string} name The identifier name of the identifier node
		 * @returns {boolean} whether an error should be reported or not
		 */
		function shouldReport(effectiveParent, name) {
			return (
				(!onlyDeclarations ||
					DECLARATION_TYPES.has(effectiveParent.type)) &&
				!ALLOWED_PARENT_TYPES.has(effectiveParent.type) &&
				isInvalid(name)
			);
		}

		/**
		 * Reports an AST node as a rule violation.
		 * @param {ASTNode} node The node to report.
		 * @returns {void}
		 * @private
		 */
		function report(node) {
			/*
			 * We used the range instead of the node because it's possible
			 * for the same identifier to be represented by two different
			 * nodes, with the most clear example being shorthand properties:
			 * { foo }
			 * In this case, "foo" is represented by one node for the name
			 * and one for the value. The only way to know they are the same
			 * is to look at the range.
			 */
			if (!reportedNodes.has(node.range.toString())) {
				const messageId =
					node.type === "PrivateIdentifier"
						? "notMatchPrivate"
						: "notMatch";

				context.report({
					node,
					messageId,
					data: {
						name: node.name,
						pattern,
					},
				});
				reportedNodes.add(node.range.toString());
			}
		}

		return {
			Program(node) {
				globalScope = sourceCode.getScope(node);
			},

			Identifier(node) {
				const name = node.name,
					parent = node.parent,
					effectiveParent =
						parent.type === "MemberExpression"
							? parent.parent
							: parent;

				if (
					isReferenceToGlobalVariable(node) ||
					astUtils.isImportAttributeKey(node)
				) {
					return;
				}

				if (parent.type === "MemberExpression") {
					if (!checkProperties) {
						return;
					}

					// Always check object names
					if (
						parent.object.type === "Identifier" &&
						parent.object.name === name
					) {
						if (isInvalid(name)) {
							report(node);
						}

						// Report AssignmentExpressions left side's assigned variable id
					} else if (
						effectiveParent.type === "AssignmentExpression" &&
						effectiveParent.left.type === "MemberExpression" &&
						effectiveParent.left.property.name === node.name
					) {
						if (isInvalid(name)) {
							report(node);
						}

						// Report AssignmentExpressions only if they are the left side of the assignment
					} else if (
						effectiveParent.type === "AssignmentExpression" &&
						effectiveParent.right.type !== "MemberExpression"
					) {
						if (isInvalid(name)) {
							report(node);
						}
					}

					// For https://github.com/eslint/eslint/issues/15123
				} else if (
					parent.type === "Property" &&
					parent.parent.type === "ObjectExpression" &&
					parent.key === node &&
					!parent.computed
				) {
					if (checkProperties && isInvalid(name)) {
						report(node);
					}

					/*
					 * Properties have their own rules, and
					 * AssignmentPattern nodes can be treated like Properties:
					 * e.g.: const { no_camelcased = false } = bar;
					 */
				} else if (
					parent.type === "Property" ||
					parent.type === "AssignmentPattern"
				) {
					if (
						parent.parent &&
						parent.parent.type === "ObjectPattern"
					) {
						if (
							!ignoreDestructuring &&
							parent.shorthand &&
							parent.value.left &&
							isInvalid(name)
						) {
							report(node);
						}

						const assignmentKeyEqualsValue =
							parent.key.name === parent.value.name;

						// prevent checking righthand side of destructured object
						if (!assignmentKeyEqualsValue && parent.key === node) {
							return;
						}

						const valueIsInvalid =
							parent.value.name && isInvalid(name);

						// ignore destructuring if the option is set, unless a new identifier is created
						if (
							valueIsInvalid &&
							!(assignmentKeyEqualsValue && ignoreDestructuring)
						) {
							report(node);
						}
					}

					// never check properties or always ignore destructuring
					if (
						(!checkProperties && !parent.computed) ||
						(ignoreDestructuring && isInsideObjectPattern(node))
					) {
						return;
					}

					// don't check right hand side of AssignmentExpression to prevent duplicate warnings
					if (
						parent.right !== node &&
						shouldReport(effectiveParent, name)
					) {
						report(node);
					}

					// Check if it's an import specifier
				} else if (IMPORT_TYPES.has(parent.type)) {
					// Report only if the local imported identifier is invalid
					if (
						parent.local &&
						parent.local.name === node.name &&
						isInvalid(name)
					) {
						report(node);
					}
				} else if (parent.type === "PropertyDefinition") {
					if (checkClassFields && isInvalid(name)) {
						report(node);
					}

					// Report anything that is invalid that isn't a CallExpression
				} else if (shouldReport(effectiveParent, name)) {
					report(node);
				}
			},

			PrivateIdentifier(node) {
				const isClassField = node.parent.type === "PropertyDefinition";

				if (isClassField && !checkClassFields) {
					return;
				}

				if (isInvalid(node.name)) {
					report(node);
				}
			},
		};
	},
};
\a9xK/**
 * @fileoverview enforce the location of arrow function bodies
 * @author Sharmila Jesupaul
 * @deprecated in ESLint v8.53.0
 */
"use strict";

const { isCommentToken, isNotOpeningParenToken } = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "implicit-arrow-linebreak",
						url: "https://eslint.style/rules/implicit-arrow-linebreak",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Enforce the location of arrow function bodies",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/implicit-arrow-linebreak",
		},

		fixable: "whitespace",

		schema: [
			{
				enum: ["beside", "below"],
			},
		],
		messages: {
			expected: "Expected a linebreak before this expression.",
			unexpected: "Expected no linebreak before this expression.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const option = context.options[0] || "beside";

		/**
		 * Validates the location of an arrow function body
		 * @param {ASTNode} node The arrow function body
		 * @returns {void}
		 */
		function validateExpression(node) {
			if (node.body.type === "BlockStatement") {
				return;
			}

			const arrowToken = sourceCode.getTokenBefore(
				node.body,
				isNotOpeningParenToken,
			);
			const firstTokenOfBody = sourceCode.getTokenAfter(arrowToken);

			if (
				arrowToken.loc.end.line === firstTokenOfBody.loc.start.line &&
				option === "below"
			) {
				context.report({
					node: firstTokenOfBody,
					messageId: "expected",
					fix: fixer =>
						fixer.insertTextBefore(firstTokenOfBody, "\n"),
				});
			} else if (
				arrowToken.loc.end.line !== firstTokenOfBody.loc.start.line &&
				option === "beside"
			) {
				context.report({
					node: firstTokenOfBody,
					messageId: "unexpected",
					fix(fixer) {
						if (
							sourceCode.getFirstTokenBetween(
								arrowToken,
								firstTokenOfBody,
								{
									includeComments: true,
									filter: isCommentToken,
								},
							)
						) {
							return null;
						}

						return fixer.replaceTextRange(
							[arrowToken.range[1], firstTokenOfBody.range[0]],
							" ",
						);
					},
				});
			}
		}

		//----------------------------------------------------------------------
		// Public
		//----------------------------------------------------------------------
		return {
			ArrowFunctionExpression: node => validateExpression(node),
		};
	},
};
x`t/**
 * @fileoverview This option sets a specific tab width for your code
 *
 * This rule has been ported and modified from nodeca.
 * @author Vitaly Puzrin
 * @author Gyandeep Singh
 * @deprecated in ESLint v4.0.0
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
// this rule has known coverage issues, but it's deprecated and shouldn't be updated in the future anyway.
/* c8 ignore next */
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "layout",

		docs: {
			description: "Enforce consistent indentation",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/indent-legacy",
		},

		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "4.0.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "indent",
						url: "https://eslint.style/rules/indent",
					},
				},
			],
		},

		fixable: "whitespace",

		schema: [
			{
				oneOf: [
					{
						enum: ["tab"],
					},
					{
						type: "integer",
						minimum: 0,
					},
				],
			},
			{
				type: "object",
				properties: {
					SwitchCase: {
						type: "integer",
						minimum: 0,
					},
					VariableDeclarator: {
						oneOf: [
							{
								type: "integer",
								minimum: 0,
							},
							{
								type: "object",
								properties: {
									var: {
										type: "integer",
										minimum: 0,
									},
									let: {
										type: "integer",
										minimum: 0,
									},
									const: {
										type: "integer",
										minimum: 0,
									},
								},
							},
						],
					},
					outerIIFEBody: {
						type: "integer",
						minimum: 0,
					},
					MemberExpression: {
						type: "integer",
						minimum: 0,
					},
					FunctionDeclaration: {
						type: "object",
						properties: {
							parameters: {
								oneOf: [
									{
										type: "integer",
										minimum: 0,
									},
									{
										enum: ["first"],
									},
								],
							},
							body: {
								type: "integer",
								minimum: 0,
							},
						},
					},
					FunctionExpression: {
						type: "object",
						properties: {
							parameters: {
								oneOf: [
									{
										type: "integer",
										minimum: 0,
									},
									{
										enum: ["first"],
									},
								],
							},
							body: {
								type: "integer",
								minimum: 0,
							},
						},
					},
					CallExpression: {
						type: "object",
						properties: {
							parameters: {
								oneOf: [
									{
										type: "integer",
										minimum: 0,
									},
									{
										enum: ["first"],
									},
								],
							},
						},
					},
					ArrayExpression: {
						oneOf: [
							{
								type: "integer",
								minimum: 0,
							},
							{
								enum: ["first"],
							},
						],
					},
					ObjectExpression: {
						oneOf: [
							{
								type: "integer",
								minimum: 0,
							},
							{
								enum: ["first"],
							},
						],
					},
				},
				additionalProperties: false,
			},
		],
		messages: {
			expected:
				"Expected indentation of {{expected}} but found {{actual}}.",
		},
	},

	create(context) {
		const DEFAULT_VARIABLE_INDENT = 1;
		const DEFAULT_PARAMETER_INDENT = null; // For backwards compatibility, don't check parameter indentation unless specified in the config
		const DEFAULT_FUNCTION_BODY_INDENT = 1;

		let indentType = "space";
		let indentSize = 4;
		const options = {
			SwitchCase: 0,
			VariableDeclarator: {
				var: DEFAULT_VARIABLE_INDENT,
				let: DEFAULT_VARIABLE_INDENT,
				const: DEFAULT_VARIABLE_INDENT,
			},
			outerIIFEBody: null,
			FunctionDeclaration: {
				parameters: DEFAULT_PARAMETER_INDENT,
				body: DEFAULT_FUNCTION_BODY_INDENT,
			},
			FunctionExpression: {
				parameters: DEFAULT_PARAMETER_INDENT,
				body: DEFAULT_FUNCTION_BODY_INDENT,
			},
			CallExpression: {
				arguments: DEFAULT_PARAMETER_INDENT,
			},
			ArrayExpression: 1,
			ObjectExpression: 1,
		};

		const sourceCode = context.sourceCode;

		if (context.options.length) {
			if (context.options[0] === "tab") {
				indentSize = 1;
				indentType = "tab";
			} /* c8 ignore start */ else if (
				typeof context.options[0] === "number"
			) {
				indentSize = context.options[0];
				indentType = "space";
			} /* c8 ignore stop */

			if (context.options[1]) {
				const opts = context.options[1];

				options.SwitchCase = opts.SwitchCase || 0;
				const variableDeclaratorRules = opts.VariableDeclarator;

				if (typeof variableDeclaratorRules === "number") {
					options.VariableDeclarator = {
						var: variableDeclaratorRules,
						let: variableDeclaratorRules,
						const: variableDeclaratorRules,
					};
				} else if (typeof variableDeclaratorRules === "object") {
					Object.assign(
						options.VariableDeclarator,
						variableDeclaratorRules,
					);
				}

				if (typeof opts.outerIIFEBody === "number") {
					options.outerIIFEBody = opts.outerIIFEBody;
				}

				if (typeof opts.MemberExpression === "number") {
					options.MemberExpression = opts.MemberExpression;
				}

				if (typeof opts.FunctionDeclaration === "object") {
					Object.assign(
						options.FunctionDeclaration,
						opts.FunctionDeclaration,
					);
				}

				if (typeof opts.FunctionExpression === "object") {
					Object.assign(
						options.FunctionExpression,
						opts.FunctionExpression,
					);
				}

				if (typeof opts.CallExpression === "object") {
					Object.assign(options.CallExpression, opts.CallExpression);
				}

				if (
					typeof opts.ArrayExpression === "number" ||
					typeof opts.ArrayExpression === "string"
				) {
					options.ArrayExpression = opts.ArrayExpression;
				}

				if (
					typeof opts.ObjectExpression === "number" ||
					typeof opts.ObjectExpression === "string"
				) {
					options.ObjectExpression = opts.ObjectExpression;
				}
			}
		}

		const caseIndentStore = {};

		/**
		 * Creates an error message for a line, given the expected/actual indentation.
		 * @param {number} expectedAmount The expected amount of indentation characters for this line
		 * @param {number} actualSpaces The actual number of indentation spaces that were found on this line
		 * @param {number} actualTabs The actual number of indentation tabs that were found on this line
		 * @returns {string} An error message for this line
		 */
		function createErrorMessageData(
			expectedAmount,
			actualSpaces,
			actualTabs,
		) {
			const expectedStatement = `${expectedAmount} ${indentType}${expectedAmount === 1 ? "" : "s"}`; // e.g. "2 tabs"
			const foundSpacesWord = `space${actualSpaces === 1 ? "" : "s"}`; // e.g. "space"
			const foundTabsWord = `tab${actualTabs === 1 ? "" : "s"}`; // e.g. "tabs"
			let foundStatement;

			if (actualSpaces > 0 && actualTabs > 0) {
				foundStatement = `${actualSpaces} ${foundSpacesWord} and ${actualTabs} ${foundTabsWord}`; // e.g. "1 space and 2 tabs"
			} else if (actualSpaces > 0) {
				/*
				 * Abbreviate the message if the expected indentation is also spaces.
				 * e.g. 'Expected 4 spaces but found 2' rather than 'Expected 4 spaces but found 2 spaces'
				 */
				foundStatement =
					indentType === "space"
						? actualSpaces
						: `${actualSpaces} ${foundSpacesWord}`;
			} else if (actualTabs > 0) {
				foundStatement =
					indentType === "tab"
						? actualTabs
						: `${actualTabs} ${foundTabsWord}`;
			} else {
				foundStatement = "0";
			}
			return {
				expected: expectedStatement,
				actual: foundStatement,
			};
		}

		/**
		 * Reports a given indent violation
		 * @param {ASTNode} node Node violating the indent rule
		 * @param {number} needed Expected indentation character count
		 * @param {number} gottenSpaces Indentation space count in the actual node/code
		 * @param {number} gottenTabs Indentation tab count in the actual node/code
		 * @param {Object} [loc] Error line and column location
		 * @param {boolean} isLastNodeCheck Is the error for last node check
		 * @returns {void}
		 */
		function report(
			node,
			needed,
			gottenSpaces,
			gottenTabs,
			loc,
			isLastNodeCheck,
		) {
			if (gottenSpaces && gottenTabs) {
				// To avoid conflicts with `no-mixed-spaces-and-tabs`, don't report lines that have both spaces and tabs.
				return;
			}

			const desiredIndent = (indentType === "space" ? " " : "\t").repeat(
				needed,
			);

			const textRange = isLastNodeCheck
				? [
						node.range[1] - node.loc.end.column,
						node.range[1] -
							node.loc.end.column +
							gottenSpaces +
							gottenTabs,
					]
				: [
						node.range[0] - node.loc.start.column,
						node.range[0] -
							node.loc.start.column +
							gottenSpaces +
							gottenTabs,
					];

			context.report({
				node,
				loc,
				messageId: "expected",
				data: createErrorMessageData(needed, gottenSpaces, gottenTabs),
				fix: fixer => fixer.replaceTextRange(textRange, desiredIndent),
			});
		}

		/**
		 * Get the actual indent of node
		 * @param {ASTNode|Token} node Node to examine
		 * @param {boolean} [byLastLine=false] get indent of node's last line
		 * @returns {Object} The node's indent. Contains keys `space` and `tab`, representing the indent of each character. Also
		 * contains keys `goodChar` and `badChar`, where `goodChar` is the amount of the user's desired indentation character, and
		 * `badChar` is the amount of the other indentation character.
		 */
		function getNodeIndent(node, byLastLine) {
			const token = byLastLine
				? sourceCode.getLastToken(node)
				: sourceCode.getFirstToken(node);
			const srcCharsBeforeNode = sourceCode
				.getText(token, token.loc.start.column)
				.split("");
			const indentChars = srcCharsBeforeNode.slice(
				0,
				srcCharsBeforeNode.findIndex(
					char => char !== " " && char !== "\t",
				),
			);
			const spaces = indentChars.filter(char => char === " ").length;
			const tabs = indentChars.filter(char => char === "\t").length;

			return {
				space: spaces,
				tab: tabs,
				goodChar: indentType === "space" ? spaces : tabs,
				badChar: indentType === "space" ? tabs : spaces,
			};
		}

		/**
		 * Checks node is the first in its own start line. By default it looks by start line.
		 * @param {ASTNode} node The node to check
		 * @param {boolean} [byEndLocation=false] Lookup based on start position or end
		 * @returns {boolean} true if its the first in the its start line
		 */
		function isNodeFirstInLine(node, byEndLocation) {
			const firstToken =
					byEndLocation === true
						? sourceCode.getLastToken(node, 1)
						: sourceCode.getTokenBefore(node),
				startLine =
					byEndLocation === true
						? node.loc.end.line
						: node.loc.start.line,
				endLine = firstToken ? firstToken.loc.end.line : -1;

			return startLine !== endLine;
		}

		/**
		 * Check indent for node
		 * @param {ASTNode} node Node to check
		 * @param {number} neededIndent needed indent
		 * @returns {void}
		 */
		function checkNodeIndent(node, neededIndent) {
			const actualIndent = getNodeIndent(node, false);

			if (
				node.type !== "ArrayExpression" &&
				node.type !== "ObjectExpression" &&
				(actualIndent.goodChar !== neededIndent ||
					actualIndent.badChar !== 0) &&
				isNodeFirstInLine(node)
			) {
				report(
					node,
					neededIndent,
					actualIndent.space,
					actualIndent.tab,
				);
			}

			if (node.type === "IfStatement" && node.alternate) {
				const elseToken = sourceCode.getTokenBefore(node.alternate);

				checkNodeIndent(elseToken, neededIndent);

				if (!isNodeFirstInLine(node.alternate)) {
					checkNodeIndent(node.alternate, neededIndent);
				}
			}

			if (node.type === "TryStatement" && node.handler) {
				const catchToken = sourceCode.getFirstToken(node.handler);

				checkNodeIndent(catchToken, neededIndent);
			}

			if (node.type === "TryStatement" && node.finalizer) {
				const finallyToken = sourceCode.getTokenBefore(node.finalizer);

				checkNodeIndent(finallyToken, neededIndent);
			}

			if (node.type === "DoWhileStatement") {
				const whileToken = sourceCode.getTokenAfter(node.body);

				checkNodeIndent(whileToken, neededIndent);
			}
		}

		/**
		 * Check indent for nodes list
		 * @param {ASTNode[]} nodes list of node objects
		 * @param {number} indent needed indent
		 * @returns {void}
		 */
		function checkNodesIndent(nodes, indent) {
			nodes.forEach(node => checkNodeIndent(node, indent));
		}

		/**
		 * Check last node line indent this detects, that block closed correctly
		 * @param {ASTNode} node Node to examine
		 * @param {number} lastLineIndent needed indent
		 * @returns {void}
		 */
		function checkLastNodeLineIndent(node, lastLineIndent) {
			const lastToken = sourceCode.getLastToken(node);
			const endIndent = getNodeIndent(lastToken, true);

			if (
				(endIndent.goodChar !== lastLineIndent ||
					endIndent.badChar !== 0) &&
				isNodeFirstInLine(node, true)
			) {
				report(
					node,
					lastLineIndent,
					endIndent.space,
					endIndent.tab,
					{
						line: lastToken.loc.start.line,
						column: lastToken.loc.start.column,
					},
					true,
				);
			}
		}

		/**
		 * Check last node line indent this detects, that block closed correctly
		 * This function for more complicated return statement case, where closing parenthesis may be followed by ';'
		 * @param {ASTNode} node Node to examine
		 * @param {number} firstLineIndent first line needed indent
		 * @returns {void}
		 */
		function checkLastReturnStatementLineIndent(node, firstLineIndent) {
			/*
			 * in case if return statement ends with ');' we have traverse back to ')'
			 * otherwise we'll measure indent for ';' and replace ')'
			 */
			const lastToken = sourceCode.getLastToken(
				node,
				astUtils.isClosingParenToken,
			);
			const textBeforeClosingParenthesis = sourceCode
				.getText(lastToken, lastToken.loc.start.column)
				.slice(0, -1);

			if (textBeforeClosingParenthesis.trim()) {
				// There are tokens before the closing paren, don't report this case
				return;
			}

			const endIndent = getNodeIndent(lastToken, true);

			if (endIndent.goodChar !== firstLineIndent) {
				report(
					node,
					firstLineIndent,
					endIndent.space,
					endIndent.tab,
					{
						line: lastToken.loc.start.line,
						column: lastToken.loc.start.column,
					},
					true,
				);
			}
		}

		/**
		 * Check first node line indent is correct
		 * @param {ASTNode} node Node to examine
		 * @param {number} firstLineIndent needed indent
		 * @returns {void}
		 */
		function checkFirstNodeLineIndent(node, firstLineIndent) {
			const startIndent = getNodeIndent(node, false);

			if (
				(startIndent.goodChar !== firstLineIndent ||
					startIndent.badChar !== 0) &&
				isNodeFirstInLine(node)
			) {
				report(
					node,
					firstLineIndent,
					startIndent.space,
					startIndent.tab,
					{
						line: node.loc.start.line,
						column: node.loc.start.column,
					},
				);
			}
		}

		/**
		 * Returns a parent node of given node based on a specified type
		 * if not present then return null
		 * @param {ASTNode} node node to examine
		 * @param {string} type type that is being looked for
		 * @param {string} stopAtList end points for the evaluating code
		 * @returns {ASTNode|void} if found then node otherwise null
		 */
		function getParentNodeByType(node, type, stopAtList) {
			let parent = node.parent;
			const stopAtSet = new Set(stopAtList || ["Program"]);

			while (
				parent.type !== type &&
				!stopAtSet.has(parent.type) &&
				parent.type !== "Program"
			) {
				parent = parent.parent;
			}

			return parent.type === type ? parent : null;
		}

		/**
		 * Returns the VariableDeclarator based on the current node
		 * if not present then return null
		 * @param {ASTNode} node node to examine
		 * @returns {ASTNode|void} if found then node otherwise null
		 */
		function getVariableDeclaratorNode(node) {
			return getParentNodeByType(node, "VariableDeclarator");
		}

		/**
		 * Check to see if the node is part of the multi-line variable declaration.
		 * Also if its on the same line as the varNode
		 * @param {ASTNode} node node to check
		 * @param {ASTNode} varNode variable declaration node to check against
		 * @returns {boolean} True if all the above condition satisfy
		 */
		function isNodeInVarOnTop(node, varNode) {
			return (
				varNode &&
				varNode.parent.loc.start.line === node.loc.start.line &&
				varNode.parent.declarations.length > 1
			);
		}

		/**
		 * Check to see if the argument before the callee node is multi-line and
		 * there should only be 1 argument before the callee node
		 * @param {ASTNode} node node to check
		 * @returns {boolean} True if arguments are multi-line
		 */
		function isArgBeforeCalleeNodeMultiline(node) {
			const parent = node.parent;

			if (parent.arguments.length >= 2 && parent.arguments[1] === node) {
				return (
					parent.arguments[0].loc.end.line >
					parent.arguments[0].loc.start.line
				);
			}

			return false;
		}

		/**
		 * Check to see if the node is a file level IIFE
		 * @param {ASTNode} node The function node to check.
		 * @returns {boolean} True if the node is the outer IIFE
		 */
		function isOuterIIFE(node) {
			const parent = node.parent;
			let stmt = parent.parent;

			/*
			 * Verify that the node is an IIEF
			 */
			if (parent.type !== "CallExpression" || parent.callee !== node) {
				return false;
			}

			/*
			 * Navigate legal ancestors to determine whether this IIEF is outer
			 */
			while (
				(stmt.type === "UnaryExpression" &&
					(stmt.operator === "!" ||
						stmt.operator === "~" ||
						stmt.operator === "+" ||
						stmt.operator === "-")) ||
				stmt.type === "AssignmentExpression" ||
				stmt.type === "LogicalExpression" ||
				stmt.type === "SequenceExpression" ||
				stmt.type === "VariableDeclarator"
			) {
				stmt = stmt.parent;
			}

			return (
				(stmt.type === "ExpressionStatement" ||
					stmt.type === "VariableDeclaration") &&
				stmt.parent &&
				stmt.parent.type === "Program"
			);
		}

		/**
		 * Check indent for function block content
		 * @param {ASTNode} node A BlockStatement node that is inside of a function.
		 * @returns {void}
		 */
		function checkIndentInFunctionBlock(node) {
			/*
			 * Search first caller in chain.
			 * Ex.:
			 *
			 * Models <- Identifier
			 *   .User
			 *   .find()
			 *   .exec(function() {
			 *   // function body
			 * });
			 *
			 * Looks for 'Models'
			 */
			const calleeNode = node.parent; // FunctionExpression
			let indent;

			if (
				calleeNode.parent &&
				(calleeNode.parent.type === "Property" ||
					calleeNode.parent.type === "ArrayExpression")
			) {
				// If function is part of array or object, comma can be put at left
				indent = getNodeIndent(calleeNode, false).goodChar;
			} else {
				// If function is standalone, simple calculate indent
				indent = getNodeIndent(calleeNode).goodChar;
			}

			if (calleeNode.parent.type === "CallExpression") {
				const calleeParent = calleeNode.parent;

				if (
					calleeNode.type !== "FunctionExpression" &&
					calleeNode.type !== "ArrowFunctionExpression"
				) {
					if (
						calleeParent &&
						calleeParent.loc.start.line < node.loc.start.line
					) {
						indent = getNodeIndent(calleeParent).goodChar;
					}
				} else {
					if (
						isArgBeforeCalleeNodeMultiline(calleeNode) &&
						calleeParent.callee.loc.start.line ===
							calleeParent.callee.loc.end.line &&
						!isNodeFirstInLine(calleeNode)
					) {
						indent = getNodeIndent(calleeParent).goodChar;
					}
				}
			}

			/*
			 * function body indent should be indent + indent size, unless this
			 * is a FunctionDeclaration, FunctionExpression, or outer IIFE and the corresponding options are enabled.
			 */
			let functionOffset = indentSize;

			if (options.outerIIFEBody !== null && isOuterIIFE(calleeNode)) {
				functionOffset = options.outerIIFEBody * indentSize;
			} else if (calleeNode.type === "FunctionExpression") {
				functionOffset = options.FunctionExpression.body * indentSize;
			} else if (calleeNode.type === "FunctionDeclaration") {
				functionOffset = options.FunctionDeclaration.body * indentSize;
			}
			indent += functionOffset;

			// check if the node is inside a variable
			const parentVarNode = getVariableDeclaratorNode(node);

			if (parentVarNode && isNodeInVarOnTop(node, parentVarNode)) {
				indent +=
					indentSize *
					options.VariableDeclarator[parentVarNode.parent.kind];
			}

			if (node.body.length > 0) {
				checkNodesIndent(node.body, indent);
			}

			checkLastNodeLineIndent(node, indent - functionOffset);
		}

		/**
		 * Checks if the given node starts and ends on the same line
		 * @param {ASTNode} node The node to check
		 * @returns {boolean} Whether or not the block starts and ends on the same line.
		 */
		function isSingleLineNode(node) {
			const lastToken = sourceCode.getLastToken(node),
				startLine = node.loc.start.line,
				endLine = lastToken.loc.end.line;

			return startLine === endLine;
		}

		/**
		 * Check indent for array block content or object block content
		 * @param {ASTNode} node node to examine
		 * @returns {void}
		 */
		function checkIndentInArrayOrObjectBlock(node) {
			// Skip inline
			if (isSingleLineNode(node)) {
				return;
			}

			let elements =
				node.type === "ArrayExpression"
					? node.elements
					: node.properties;

			// filter out empty elements example would be [ , 2] so remove first element as espree considers it as null
			elements = elements.filter(elem => elem !== null);

			let nodeIndent;
			let elementsIndent;
			const parentVarNode = getVariableDeclaratorNode(node);

			// TODO - come up with a better strategy in future
			if (isNodeFirstInLine(node)) {
				const parent = node.parent;

				nodeIndent = getNodeIndent(parent).goodChar;
				if (
					!parentVarNode ||
					parentVarNode.loc.start.line !== node.loc.start.line
				) {
					if (
						parent.type !== "VariableDeclarator" ||
						parentVarNode === parentVarNode.parent.declarations[0]
					) {
						if (
							parent.type === "VariableDeclarator" &&
							parentVarNode.loc.start.line ===
								parent.loc.start.line
						) {
							nodeIndent +=
								indentSize *
								options.VariableDeclarator[
									parentVarNode.parent.kind
								];
						} else if (
							parent.type === "ObjectExpression" ||
							parent.type === "ArrayExpression"
						) {
							const parentElements =
								node.parent.type === "ObjectExpression"
									? node.parent.properties
									: node.parent.elements;

							if (
								parentElements[0] &&
								parentElements[0].loc.start.line ===
									parent.loc.start.line &&
								parentElements[0].loc.end.line !==
									parent.loc.start.line
							) {
								/*
								 * If the first element of the array spans multiple lines, don't increase the expected indentation of the rest.
								 * e.g. [{
								 *        foo: 1
								 *      },
								 *      {
								 *        bar: 1
								 *      }]
								 * the second object is not indented.
								 */
							} else if (
								typeof options[parent.type] === "number"
							) {
								nodeIndent += options[parent.type] * indentSize;
							} else {
								nodeIndent = parentElements[0].loc.start.column;
							}
						} else if (
							parent.type === "CallExpression" ||
							parent.type === "NewExpression"
						) {
							if (
								typeof options.CallExpression.arguments ===
								"number"
							) {
								nodeIndent +=
									options.CallExpression.arguments *
									indentSize;
							} else if (
								options.CallExpression.arguments === "first"
							) {
								if (parent.arguments.includes(node)) {
									nodeIndent =
										parent.arguments[0].loc.start.column;
								}
							} else {
								nodeIndent += indentSize;
							}
						} else if (
							parent.type === "LogicalExpression" ||
							parent.type === "ArrowFunctionExpression"
						) {
							nodeIndent += indentSize;
						}
					}
				}

				checkFirstNodeLineIndent(node, nodeIndent);
			} else {
				nodeIndent = getNodeIndent(node).goodChar;
			}

			if (options[node.type] === "first") {
				elementsIndent = elements.length
					? elements[0].loc.start.column
					: 0; // If there are no elements, elementsIndent doesn't matter.
			} else {
				elementsIndent = nodeIndent + indentSize * options[node.type];
			}

			/*
			 * Check if the node is a multiple variable declaration; if so, then
			 * make sure indentation takes that into account.
			 */
			if (isNodeInVarOnTop(node, parentVarNode)) {
				elementsIndent +=
					indentSize *
					options.VariableDeclarator[parentVarNode.parent.kind];
			}

			checkNodesIndent(elements, elementsIndent);

			if (elements.length > 0) {
				// Skip last block line check if last item in same line
				if (elements.at(-1).loc.end.line === node.loc.end.line) {
					return;
				}
			}

			checkLastNodeLineIndent(
				node,
				nodeIndent +
					(isNodeInVarOnTop(node, parentVarNode)
						? options.VariableDeclarator[
								parentVarNode.parent.kind
							] * indentSize
						: 0),
			);
		}

		/**
		 * Check if the node or node body is a BlockStatement or not
		 * @param {ASTNode} node node to test
		 * @returns {boolean} True if it or its body is a block statement
		 */
		function isNodeBodyBlock(node) {
			return (
				node.type === "BlockStatement" ||
				node.type === "ClassBody" ||
				(node.body && node.body.type === "BlockStatement") ||
				(node.consequent && node.consequent.type === "BlockStatement")
			);
		}

		/**
		 * Check indentation for blocks
		 * @param {ASTNode} node node to check
		 * @returns {void}
		 */
		function blockIndentationCheck(node) {
			// Skip inline blocks
			if (isSingleLineNode(node)) {
				return;
			}

			if (
				node.parent &&
				(node.parent.type === "FunctionExpression" ||
					node.parent.type === "FunctionDeclaration" ||
					node.parent.type === "ArrowFunctionExpression")
			) {
				checkIndentInFunctionBlock(node);
				return;
			}

			let indent;
			let nodesToCheck;

			/*
			 * For this statements we should check indent from statement beginning,
			 * not from the beginning of the block.
			 */
			const statementsWithProperties = [
				"IfStatement",
				"WhileStatement",
				"ForStatement",
				"ForInStatement",
				"ForOfStatement",
				"DoWhileStatement",
				"ClassDeclaration",
				"TryStatement",
			];

			if (
				node.parent &&
				statementsWithProperties.includes(node.parent.type) &&
				isNodeBodyBlock(node)
			) {
				indent = getNodeIndent(node.parent).goodChar;
			} else if (node.parent && node.parent.type === "CatchClause") {
				indent = getNodeIndent(node.parent.parent).goodChar;
			} else {
				indent = getNodeIndent(node).goodChar;
			}

			if (
				node.type === "IfStatement" &&
				node.consequent.type !== "BlockStatement"
			) {
				nodesToCheck = [node.consequent];
			} else if (Array.isArray(node.body)) {
				nodesToCheck = node.body;
			} else {
				nodesToCheck = [node.body];
			}

			if (nodesToCheck.length > 0) {
				checkNodesIndent(nodesToCheck, indent + indentSize);
			}

			if (node.type === "BlockStatement") {
				checkLastNodeLineIndent(node, indent);
			}
		}

		/**
		 * Filter out the elements which are on the same line of each other or the node.
		 * basically have only 1 elements from each line except the variable declaration line.
		 * @param {ASTNode} node Variable declaration node
		 * @returns {ASTNode[]} Filtered elements
		 */
		function filterOutSameLineVars(node) {
			return node.declarations.reduce((finalCollection, elem) => {
				const lastElem = finalCollection.at(-1);

				if (
					(elem.loc.start.line !== node.loc.start.line &&
						!lastElem) ||
					(lastElem &&
						lastElem.loc.start.line !== elem.loc.start.line)
				) {
					finalCollection.push(elem);
				}

				return finalCollection;
			}, []);
		}

		/**
		 * Check indentation for variable declarations
		 * @param {ASTNode} node node to examine
		 * @returns {void}
		 */
		function checkIndentInVariableDeclarations(node) {
			const elements = filterOutSameLineVars(node);
			const nodeIndent = getNodeIndent(node).goodChar;
			const lastElement = elements.at(-1);

			const elementsIndent =
				nodeIndent + indentSize * options.VariableDeclarator[node.kind];

			checkNodesIndent(elements, elementsIndent);

			// Only check the last line if there is any token after the last item
			if (
				sourceCode.getLastToken(node).loc.end.line <=
				lastElement.loc.end.line
			) {
				return;
			}

			const tokenBeforeLastElement =
				sourceCode.getTokenBefore(lastElement);

			if (tokenBeforeLastElement.value === ",") {
				// Special case for comma-first syntax where the semicolon is indented
				checkLastNodeLineIndent(
					node,
					getNodeIndent(tokenBeforeLastElement).goodChar,
				);
			} else {
				checkLastNodeLineIndent(node, elementsIndent - indentSize);
			}
		}

		/**
		 * Check and decide whether to check for indentation for blockless nodes
		 * Scenarios are for or while statements without braces around them
		 * @param {ASTNode} node node to examine
		 * @returns {void}
		 */
		function blockLessNodes(node) {
			if (node.body.type !== "BlockStatement") {
				blockIndentationCheck(node);
			}
		}

		/**
		 * Returns the expected indentation for the case statement
		 * @param {ASTNode} node node to examine
		 * @param {number} [providedSwitchIndent] indent for switch statement
		 * @returns {number} indent size
		 */
		function expectedCaseIndent(node, providedSwitchIndent) {
			const switchNode =
				node.type === "SwitchStatement" ? node : node.parent;
			const switchIndent =
				typeof providedSwitchIndent === "undefined"
					? getNodeIndent(switchNode).goodChar
					: providedSwitchIndent;
			let caseIndent;

			if (caseIndentStore[switchNode.loc.start.line]) {
				return caseIndentStore[switchNode.loc.start.line];
			}

			if (switchNode.cases.length > 0 && options.SwitchCase === 0) {
				caseIndent = switchIndent;
			} else {
				caseIndent = switchIndent + indentSize * options.SwitchCase;
			}

			caseIndentStore[switchNode.loc.start.line] = caseIndent;
			return caseIndent;
		}

		/**
		 * Checks whether a return statement is wrapped in ()
		 * @param {ASTNode} node node to examine
		 * @returns {boolean} the result
		 */
		function isWrappedInParenthesis(node) {
			const regex = /^return\s*\(\s*\)/u;

			const statementWithoutArgument = sourceCode
				.getText(node)
				.replace(sourceCode.getText(node.argument), "");

			return regex.test(statementWithoutArgument);
		}

		return {
			Program(node) {
				if (node.body.length > 0) {
					// Root nodes should have no indent
					checkNodesIndent(node.body, getNodeIndent(node).goodChar);
				}
			},

			ClassBody: blockIndentationCheck,

			BlockStatement: blockIndentationCheck,

			WhileStatement: blockLessNodes,

			ForStatement: blockLessNodes,

			ForInStatement: blockLessNodes,

			ForOfStatement: blockLessNodes,

			DoWhileStatement: blockLessNodes,

			IfStatement(node) {
				if (
					node.consequent.type !== "BlockStatement" &&
					node.consequent.loc.start.line > node.loc.start.line
				) {
					blockIndentationCheck(node);
				}
			},

			VariableDeclaration(node) {
				if (
					node.declarations.at(-1).loc.start.line >
					node.declarations[0].loc.start.line
				) {
					checkIndentInVariableDeclarations(node);
				}
			},

			ObjectExpression(node) {
				checkIndentInArrayOrObjectBlock(node);
			},

			ArrayExpression(node) {
				checkIndentInArrayOrObjectBlock(node);
			},

			MemberExpression(node) {
				if (typeof options.MemberExpression === "undefined") {
					return;
				}

				if (isSingleLineNode(node)) {
					return;
				}

				/*
				 * The typical layout of variable declarations and assignments
				 * alter the expectation of correct indentation. Skip them.
				 * TODO: Add appropriate configuration options for variable
				 * declarations and assignments.
				 */
				if (
					getParentNodeByType(node, "VariableDeclarator", [
						"FunctionExpression",
						"ArrowFunctionExpression",
					])
				) {
					return;
				}

				if (
					getParentNodeByType(node, "AssignmentExpression", [
						"FunctionExpression",
					])
				) {
					return;
				}

				const propertyIndent =
					getNodeIndent(node).goodChar +
					indentSize * options.MemberExpression;

				const checkNodes = [node.property];

				const dot = sourceCode.getTokenBefore(node.property);

				if (dot.type === "Punctuator" && dot.value === ".") {
					checkNodes.push(dot);
				}

				checkNodesIndent(checkNodes, propertyIndent);
			},

			SwitchStatement(node) {
				// Switch is not a 'BlockStatement'
				const switchIndent = getNodeIndent(node).goodChar;
				const caseIndent = expectedCaseIndent(node, switchIndent);

				checkNodesIndent(node.cases, caseIndent);

				checkLastNodeLineIndent(node, switchIndent);
			},

			SwitchCase(node) {
				// Skip inline cases
				if (isSingleLineNode(node)) {
					return;
				}
				const caseIndent = expectedCaseIndent(node);

				checkNodesIndent(node.consequent, caseIndent + indentSize);
			},

			FunctionDeclaration(node) {
				if (isSingleLineNode(node)) {
					return;
				}
				if (
					options.FunctionDeclaration.parameters === "first" &&
					node.params.length
				) {
					checkNodesIndent(
						node.params.slice(1),
						node.params[0].loc.start.column,
					);
				} else if (options.FunctionDeclaration.parameters !== null) {
					checkNodesIndent(
						node.params,
						getNodeIndent(node).goodChar +
							indentSize * options.FunctionDeclaration.parameters,
					);
				}
			},

			FunctionExpression(node) {
				if (isSingleLineNode(node)) {
					return;
				}
				if (
					options.FunctionExpression.parameters === "first" &&
					node.params.length
				) {
					checkNodesIndent(
						node.params.slice(1),
						node.params[0].loc.start.column,
					);
				} else if (options.FunctionExpression.parameters !== null) {
					checkNodesIndent(
						node.params,
						getNodeIndent(node).goodChar +
							indentSize * options.FunctionExpression.parameters,
					);
				}
			},

			ReturnStatement(node) {
				if (isSingleLineNode(node)) {
					return;
				}

				const firstLineIndent = getNodeIndent(node).goodChar;

				// in case if return statement is wrapped in parenthesis
				if (isWrappedInParenthesis(node)) {
					checkLastReturnStatementLineIndent(node, firstLineIndent);
				} else {
					checkNodeIndent(node, firstLineIndent);
				}
			},

			CallExpression(node) {
				if (isSingleLineNode(node)) {
					return;
				}
				if (
					options.CallExpression.arguments === "first" &&
					node.arguments.length
				) {
					checkNodesIndent(
						node.arguments.slice(1),
						node.arguments[0].loc.start.column,
					);
				} else if (options.CallExpression.arguments !== null) {
					checkNodesIndent(
						node.arguments,
						getNodeIndent(node).goodChar +
							indentSize * options.CallExpression.arguments,
					);
				}
			},
		};
	},
};
HἹ x   /**
 * @fileoverview This rule sets a specific indentation style and width for your code
 *
 * @author Teddy Katz
 * @author Vitaly Puzrin
 * @author Gyandeep Singh
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

const KNOWN_NODES = new Set([
	"AssignmentExpression",
	"AssignmentPattern",
	"ArrayExpression",
	"ArrayPattern",
	"ArrowFunctionExpression",
	"AwaitExpression",
	"BlockStatement",
	"BinaryExpression",
	"BreakStatement",
	"CallExpression",
	"CatchClause",
	"ChainExpression",
	"ClassBody",
	"ClassDeclaration",
	"ClassExpression",
	"ConditionalExpression",
	"ContinueStatement",
	"DoWhileStatement",
	"DebuggerStatement",
	"EmptyStatement",
	"ExperimentalRestProperty",
	"ExperimentalSpreadProperty",
	"ExpressionStatement",
	"ForStatement",
	"ForInStatement",
	"ForOfStatement",
	"FunctionDeclaration",
	"FunctionExpression",
	"Identifier",
	"IfStatement",
	"Literal",
	"LabeledStatement",
	"LogicalExpression",
	"MemberExpression",
	"MetaProperty",
	"MethodDefinition",
	"NewExpression",
	"ObjectExpression",
	"ObjectPattern",
	"PrivateIdentifier",
	"Program",
	"Property",
	"PropertyDefinition",
	"RestElement",
	"ReturnStatement",
	"SequenceExpression",
	"SpreadElement",
	"StaticBlock",
	"Super",
	"SwitchCase",
	"SwitchStatement",
	"TaggedTemplateExpression",
	"TemplateElement",
	"TemplateLiteral",
	"ThisExpression",
	"ThrowStatement",
	"TryStatement",
	"UnaryExpression",
	"UpdateExpression",
	"VariableDeclaration",
	"VariableDeclarator",
	"WhileStatement",
	"WithStatement",
	"YieldExpression",
	"JSXFragment",
	"JSXOpeningFragment",
	"JSXClosingFragment",
	"JSXIdentifier",
	"JSXNamespacedName",
	"JSXMemberExpression",
	"JSXEmptyExpression",
	"JSXExpressionContainer",
	"JSXElement",
	"JSXClosingElement",
	"JSXOpeningElement",
	"JSXAttribute",
	"JSXSpreadAttribute",
	"JSXText",
	"ExportDefaultDeclaration",
	"ExportNamedDeclaration",
	"ExportAllDeclaration",
	"ExportSpecifier",
	"ImportDeclaration",
	"ImportSpecifier",
	"ImportDefaultSpecifier",
	"ImportNamespaceSpecifier",
	"ImportExpression",
]);

/*
 * General rule strategy:
 * 1. An OffsetStorage instance stores a map of desired offsets, where each token has a specified offset from another
 *    specified token or to the first column.
 * 2. As the AST is traversed, modify the desired offsets of tokens accordingly. For example, when entering a
 *    BlockStatement, offset all of the tokens in the BlockStatement by 1 indent level from the opening curly
 *    brace of the BlockStatement.
 * 3. After traversing the AST, calculate the expected indentation levels of every token according to the
 *    OffsetStorage container.
 * 4. For each line, compare the expected indentation of the first token to the actual indentation in the file,
 *    and report the token if the two values are not equal.
 */

/**
 * A mutable map that stores (key, value) pairs. The keys are numeric indices, and must be unique.
 * This is intended to be a generic wrapper around a map with non-negative integer keys, so that the underlying implementation
 * can easily be swapped out.
 */
class IndexMap {
	/**
	 * Creates an empty map
	 * @param {number} maxKey The maximum key
	 */
	constructor(maxKey) {
		// Initializing the array with the maximum expected size avoids dynamic reallocations that could degrade performance.
		this._values = Array(maxKey + 1);
	}

	/**
	 * Inserts an entry into the map.
	 * @param {number} key The entry's key
	 * @param {any} value The entry's value
	 * @returns {void}
	 */
	insert(key, value) {
		this._values[key] = value;
	}

	/**
	 * Finds the value of the entry with the largest key less than or equal to the provided key
	 * @param {number} key The provided key
	 * @returns {*|undefined} The value of the found entry, or undefined if no such entry exists.
	 */
	findLastNotAfter(key) {
		const values = this._values;

		for (let index = key; index >= 0; index--) {
			const value = values[index];

			if (value) {
				return value;
			}
		}
		return void 0;
	}

	/**
	 * Deletes all of the keys in the interval [start, end)
	 * @param {number} start The start of the range
	 * @param {number} end The end of the range
	 * @returns {void}
	 */
	deleteRange(start, end) {
		this._values.fill(void 0, start, end);
	}
}

/**
 * A helper class to get token-based info related to indentation
 */
class TokenInfo {
	/**
	 * @param {SourceCode} sourceCode A SourceCode object
	 */
	constructor(sourceCode) {
		this.sourceCode = sourceCode;
		this.firstTokensByLineNumber = new Map();
		const tokens = sourceCode.tokensAndComments;

		for (let i = 0; i < tokens.length; i++) {
			const token = tokens[i];

			if (!this.firstTokensByLineNumber.has(token.loc.start.line)) {
				this.firstTokensByLineNumber.set(token.loc.start.line, token);
			}
			if (
				!this.firstTokensByLineNumber.has(token.loc.end.line) &&
				sourceCode.text
					.slice(
						token.range[1] - token.loc.end.column,
						token.range[1],
					)
					.trim()
			) {
				this.firstTokensByLineNumber.set(token.loc.end.line, token);
			}
		}
	}

	/**
	 * Gets the first token on a given token's line
	 * @param {Token|ASTNode} token a node or token
	 * @returns {Token} The first token on the given line
	 */
	getFirstTokenOfLine(token) {
		return this.firstTokensByLineNumber.get(token.loc.start.line);
	}

	/**
	 * Determines whether a token is the first token in its line
	 * @param {Token} token The token
	 * @returns {boolean} `true` if the token is the first on its line
	 */
	isFirstTokenOfLine(token) {
		return this.getFirstTokenOfLine(token) === token;
	}

	/**
	 * Get the actual indent of a token
	 * @param {Token} token Token to examine. This should be the first token on its line.
	 * @returns {string} The indentation characters that precede the token
	 */
	getTokenIndent(token) {
		return this.sourceCode.text.slice(
			token.range[0] - token.loc.start.column,
			token.range[0],
		);
	}
}

/**
 * A class to store information on desired offsets of tokens from each other
 */
class OffsetStorage {
	/**
	 * @param {TokenInfo} tokenInfo a TokenInfo instance
	 * @param {number} indentSize The desired size of each indentation level
	 * @param {string} indentType The indentation character
	 * @param {number} maxIndex The maximum end index of any token
	 */
	constructor(tokenInfo, indentSize, indentType, maxIndex) {
		this._tokenInfo = tokenInfo;
		this._indentSize = indentSize;
		this._indentType = indentType;

		this._indexMap = new IndexMap(maxIndex);
		this._indexMap.insert(0, { offset: 0, from: null, force: false });

		this._lockedFirstTokens = new WeakMap();
		this._desiredIndentCache = new WeakMap();
		this._ignoredTokens = new WeakSet();
	}

	_getOffsetDescriptor(token) {
		return this._indexMap.findLastNotAfter(token.range[0]);
	}

	/**
	 * Sets the offset column of token B to match the offset column of token A.
	 * - **WARNING**: This matches a *column*, even if baseToken is not the first token on its line. In
	 * most cases, `setDesiredOffset` should be used instead.
	 * @param {Token} baseToken The first token
	 * @param {Token} offsetToken The second token, whose offset should be matched to the first token
	 * @returns {void}
	 */
	matchOffsetOf(baseToken, offsetToken) {
		/*
		 * lockedFirstTokens is a map from a token whose indentation is controlled by the "first" option to
		 * the token that it depends on. For example, with the `ArrayExpression: first` option, the first
		 * token of each element in the array after the first will be mapped to the first token of the first
		 * element. The desired indentation of each of these tokens is computed based on the desired indentation
		 * of the "first" element, rather than through the normal offset mechanism.
		 */
		this._lockedFirstTokens.set(offsetToken, baseToken);
	}

	/**
	 * Sets the desired offset of a token.
	 *
	 * This uses a line-based offset collapsing behavior to handle tokens on the same line.
	 * For example, consider the following two cases:
	 *
	 * (
	 *     [
	 *         bar
	 *     ]
	 * )
	 *
	 * ([
	 *     bar
	 * ])
	 *
	 * Based on the first case, it's clear that the `bar` token needs to have an offset of 1 indent level (4 spaces) from
	 * the `[` token, and the `[` token has to have an offset of 1 indent level from the `(` token. Since the `(` token is
	 * the first on its line (with an indent of 0 spaces), the `bar` token needs to be offset by 2 indent levels (8 spaces)
	 * from the start of its line.
	 *
	 * However, in the second case `bar` should only be indented by 4 spaces. This is because the offset of 1 indent level
	 * between the `(` and the `[` tokens gets "collapsed" because the two tokens are on the same line. As a result, the
	 * `(` token is mapped to the `[` token with an offset of 0, and the rule correctly decides that `bar` should be indented
	 * by 1 indent level from the start of the line.
	 *
	 * This is useful because rule listeners can usually just call `setDesiredOffset` for all the tokens in the node,
	 * without needing to check which lines those tokens are on.
	 *
	 * Note that since collapsing only occurs when two tokens are on the same line, there are a few cases where non-intuitive
	 * behavior can occur. For example, consider the following cases:
	 *
	 * foo(
	 * ).
	 *     bar(
	 *         baz
	 *     )
	 *
	 * foo(
	 * ).bar(
	 *     baz
	 * )
	 *
	 * Based on the first example, it would seem that `bar` should be offset by 1 indent level from `foo`, and `baz`
	 * should be offset by 1 indent level from `bar`. However, this is not correct, because it would result in `baz`
	 * being indented by 2 indent levels in the second case (since `foo`, `bar`, and `baz` are all on separate lines, no
	 * collapsing would occur).
	 *
	 * Instead, the correct way would be to offset `baz` by 1 level from `bar`, offset `bar` by 1 level from the `)`, and
	 * offset the `)` by 0 levels from `foo`. This ensures that the offset between `bar` and the `)` are correctly collapsed
	 * in the second case.
	 * @param {Token} token The token
	 * @param {Token} fromToken The token that `token` should be offset from
	 * @param {number} offset The desired indent level
	 * @returns {void}
	 */
	setDesiredOffset(token, fromToken, offset) {
		return this.setDesiredOffsets(token.range, fromToken, offset);
	}

	/**
	 * Sets the desired offset of all tokens in a range
	 * It's common for node listeners in this file to need to apply the same offset to a large, contiguous range of tokens.
	 * Moreover, the offset of any given token is usually updated multiple times (roughly once for each node that contains
	 * it). This means that the offset of each token is updated O(AST depth) times.
	 * It would not be performant to store and update the offsets for each token independently, because the rule would end
	 * up having a time complexity of O(number of tokens * AST depth), which is quite slow for large files.
	 *
	 * Instead, the offset tree is represented as a collection of contiguous offset ranges in a file. For example, the following
	 * list could represent the state of the offset tree at a given point:
	 *
	 * - Tokens starting in the interval [0, 15) are aligned with the beginning of the file
	 * - Tokens starting in the interval [15, 30) are offset by 1 indent level from the `bar` token
	 * - Tokens starting in the interval [30, 43) are offset by 1 indent level from the `foo` token
	 * - Tokens starting in the interval [43, 820) are offset by 2 indent levels from the `bar` token
	 * - Tokens starting in the interval [820, ∞) are offset by 1 indent level from the `baz` token
	 *
	 * The `setDesiredOffsets` methods inserts ranges like the ones above. The third line above would be inserted by using:
	 * `setDesiredOffsets([30, 43], fooToken, 1);`
	 * @param {[number, number]} range A [start, end] pair. All tokens with range[0] <= token.start < range[1] will have the offset applied.
	 * @param {Token} fromToken The token that this is offset from
	 * @param {number} offset The desired indent level
	 * @param {boolean} force `true` if this offset should not use the normal collapsing behavior. This should almost always be false.
	 * @returns {void}
	 */
	setDesiredOffsets(range, fromToken, offset, force) {
		/*
		 * Offset ranges are stored as a collection of nodes, where each node maps a numeric key to an offset
		 * descriptor. The tree for the example above would have the following nodes:
		 *
		 * * key: 0, value: { offset: 0, from: null }
		 * * key: 15, value: { offset: 1, from: barToken }
		 * * key: 30, value: { offset: 1, from: fooToken }
		 * * key: 43, value: { offset: 2, from: barToken }
		 * * key: 820, value: { offset: 1, from: bazToken }
		 *
		 * To find the offset descriptor for any given token, one needs to find the node with the largest key
		 * which is <= token.start. To make this operation fast, the nodes are stored in a map indexed by key.
		 */

		const descriptorToInsert = { offset, from: fromToken, force };

		const descriptorAfterRange = this._indexMap.findLastNotAfter(range[1]);

		const fromTokenIsInRange =
			fromToken &&
			fromToken.range[0] >= range[0] &&
			fromToken.range[1] <= range[1];
		const fromTokenDescriptor =
			fromTokenIsInRange && this._getOffsetDescriptor(fromToken);

		// First, remove any existing nodes in the range from the map.
		this._indexMap.deleteRange(range[0] + 1, range[1]);

		// Insert a new node into the map for this range
		this._indexMap.insert(range[0], descriptorToInsert);

		/*
		 * To avoid circular offset dependencies, keep the `fromToken` token mapped to whatever it was mapped to previously,
		 * even if it's in the current range.
		 */
		if (fromTokenIsInRange) {
			this._indexMap.insert(fromToken.range[0], fromTokenDescriptor);
			this._indexMap.insert(fromToken.range[1], descriptorToInsert);
		}

		/*
		 * To avoid modifying the offset of tokens after the range, insert another node to keep the offset of the following
		 * tokens the same as it was before.
		 */
		this._indexMap.insert(range[1], descriptorAfterRange);
	}

	/**
	 * Gets the desired indent of a token
	 * @param {Token} token The token
	 * @returns {string} The desired indent of the token
	 */
	getDesiredIndent(token) {
		if (!this._desiredIndentCache.has(token)) {
			if (this._ignoredTokens.has(token)) {
				/*
				 * If the token is ignored, use the actual indent of the token as the desired indent.
				 * This ensures that no errors are reported for this token.
				 */
				this._desiredIndentCache.set(
					token,
					this._tokenInfo.getTokenIndent(token),
				);
			} else if (this._lockedFirstTokens.has(token)) {
				const firstToken = this._lockedFirstTokens.get(token);

				this._desiredIndentCache.set(
					token,

					// (indentation for the first element's line)
					this.getDesiredIndent(
						this._tokenInfo.getFirstTokenOfLine(firstToken),
					) +
						// (space between the start of the first element's line and the first element)
						this._indentType.repeat(
							firstToken.loc.start.column -
								this._tokenInfo.getFirstTokenOfLine(firstToken)
									.loc.start.column,
						),
				);
			} else {
				const offsetInfo = this._getOffsetDescriptor(token);
				const offset =
					offsetInfo.from &&
					offsetInfo.from.loc.start.line === token.loc.start.line &&
					!/^\s*?\n/u.test(token.value) &&
					!offsetInfo.force
						? 0
						: offsetInfo.offset * this._indentSize;

				this._desiredIndentCache.set(
					token,
					(offsetInfo.from
						? this.getDesiredIndent(offsetInfo.from)
						: "") + this._indentType.repeat(offset),
				);
			}
		}
		return this._desiredIndentCache.get(token);
	}

	/**
	 * Ignores a token, preventing it from being reported.
	 * @param {Token} token The token
	 * @returns {void}
	 */
	ignoreToken(token) {
		if (this._tokenInfo.isFirstTokenOfLine(token)) {
			this._ignoredTokens.add(token);
		}
	}

	/**
	 * Gets the first token that the given token's indentation is dependent on
	 * @param {Token} token The token
	 * @returns {Token} The token that the given token depends on, or `null` if the given token is at the top level
	 */
	getFirstDependency(token) {
		return this._getOffsetDescriptor(token).from;
	}
}

const ELEMENT_LIST_SCHEMA = {
	oneOf: [
		{
			type: "integer",
			minimum: 0,
		},
		{
			enum: ["first", "off"],
		},
	],
};

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "indent",
						url: "https://eslint.style/rules/indent",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Enforce consistent indentation",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/indent",
		},

		fixable: "whitespace",

		schema: [
			{
				oneOf: [
					{
						enum: ["tab"],
					},
					{
						type: "integer",
						minimum: 0,
					},
				],
			},
			{
				type: "object",
				properties: {
					SwitchCase: {
						type: "integer",
						minimum: 0,
						default: 0,
					},
					VariableDeclarator: {
						oneOf: [
							ELEMENT_LIST_SCHEMA,
							{
								type: "object",
								properties: {
									var: ELEMENT_LIST_SCHEMA,
									let: ELEMENT_LIST_SCHEMA,
									const: ELEMENT_LIST_SCHEMA,
								},
								additionalProperties: false,
							},
						],
					},
					outerIIFEBody: {
						oneOf: [
							{
								type: "integer",
								minimum: 0,
							},
							{
								enum: ["off"],
							},
						],
					},
					MemberExpression: {
						oneOf: [
							{
								type: "integer",
								minimum: 0,
							},
							{
								enum: ["off"],
							},
						],
					},
					FunctionDeclaration: {
						type: "object",
						properties: {
							parameters: ELEMENT_LIST_SCHEMA,
							body: {
								type: "integer",
								minimum: 0,
							},
						},
						additionalProperties: false,
					},
					FunctionExpression: {
						type: "object",
						properties: {
							parameters: ELEMENT_LIST_SCHEMA,
							body: {
								type: "integer",
								minimum: 0,
							},
						},
						additionalProperties: false,
					},
					StaticBlock: {
						type: "object",
						properties: {
							body: {
								type: "integer",
								minimum: 0,
							},
						},
						additionalProperties: false,
					},
					CallExpression: {
						type: "object",
						properties: {
							arguments: ELEMENT_LIST_SCHEMA,
						},
						additionalProperties: false,
					},
					ArrayExpression: ELEMENT_LIST_SCHEMA,
					ObjectExpression: ELEMENT_LIST_SCHEMA,
					ImportDeclaration: ELEMENT_LIST_SCHEMA,
					flatTernaryExpressions: {
						type: "boolean",
						default: false,
					},
					offsetTernaryExpressions: {
						type: "boolean",
						default: false,
					},
					ignoredNodes: {
						type: "array",
						items: {
							type: "string",
							not: {
								pattern: ":exit$",
							},
						},
					},
					ignoreComments: {
						type: "boolean",
						default: false,
					},
				},
				additionalProperties: false,
			},
		],
		messages: {
			wrongIndentation:
				"Expected indentation of {{expected}} but found {{actual}}.",
		},
	},

	create(context) {
		const DEFAULT_VARIABLE_INDENT = 1;
		const DEFAULT_PARAMETER_INDENT = 1;
		const DEFAULT_FUNCTION_BODY_INDENT = 1;

		let indentType = "space";
		let indentSize = 4;
		const options = {
			SwitchCase: 0,
			VariableDeclarator: {
				var: DEFAULT_VARIABLE_INDENT,
				let: DEFAULT_VARIABLE_INDENT,
				const: DEFAULT_VARIABLE_INDENT,
			},
			outerIIFEBody: 1,
			FunctionDeclaration: {
				parameters: DEFAULT_PARAMETER_INDENT,
				body: DEFAULT_FUNCTION_BODY_INDENT,
			},
			FunctionExpression: {
				parameters: DEFAULT_PARAMETER_INDENT,
				body: DEFAULT_FUNCTION_BODY_INDENT,
			},
			StaticBlock: {
				body: DEFAULT_FUNCTION_BODY_INDENT,
			},
			CallExpression: {
				arguments: DEFAULT_PARAMETER_INDENT,
			},
			MemberExpression: 1,
			ArrayExpression: 1,
			ObjectExpression: 1,
			ImportDeclaration: 1,
			flatTernaryExpressions: false,
			ignoredNodes: [],
			ignoreComments: false,
		};

		if (context.options.length) {
			if (context.options[0] === "tab") {
				indentSize = 1;
				indentType = "tab";
			} else {
				indentSize = context.options[0];
				indentType = "space";
			}

			if (context.options[1]) {
				Object.assign(options, context.options[1]);

				if (
					typeof options.VariableDeclarator === "number" ||
					options.VariableDeclarator === "first"
				) {
					options.VariableDeclarator = {
						var: options.VariableDeclarator,
						let: options.VariableDeclarator,
						const: options.VariableDeclarator,
					};
				}
			}
		}

		const sourceCode = context.sourceCode;
		const tokenInfo = new TokenInfo(sourceCode);
		const offsets = new OffsetStorage(
			tokenInfo,
			indentSize,
			indentType === "space" ? " " : "\t",
			sourceCode.text.length,
		);
		const parameterParens = new WeakSet();

		/**
		 * Creates an error message for a line, given the expected/actual indentation.
		 * @param {number} expectedAmount The expected amount of indentation characters for this line
		 * @param {number} actualSpaces The actual number of indentation spaces that were found on this line
		 * @param {number} actualTabs The actual number of indentation tabs that were found on this line
		 * @returns {string} An error message for this line
		 */
		function createErrorMessageData(
			expectedAmount,
			actualSpaces,
			actualTabs,
		) {
			const expectedStatement = `${expectedAmount} ${indentType}${expectedAmount === 1 ? "" : "s"}`; // e.g. "2 tabs"
			const foundSpacesWord = `space${actualSpaces === 1 ? "" : "s"}`; // e.g. "space"
			const foundTabsWord = `tab${actualTabs === 1 ? "" : "s"}`; // e.g. "tabs"
			let foundStatement;

			if (actualSpaces > 0) {
				/*
				 * Abbreviate the message if the expected indentation is also spaces.
				 * e.g. 'Expected 4 spaces but found 2' rather than 'Expected 4 spaces but found 2 spaces'
				 */
				foundStatement =
					indentType === "space"
						? actualSpaces
						: `${actualSpaces} ${foundSpacesWord}`;
			} else if (actualTabs > 0) {
				foundStatement =
					indentType === "tab"
						? actualTabs
						: `${actualTabs} ${foundTabsWord}`;
			} else {
				foundStatement = "0";
			}
			return {
				expected: expectedStatement,
				actual: foundStatement,
			};
		}

		/**
		 * Reports a given indent violation
		 * @param {Token} token Token violating the indent rule
		 * @param {string} neededIndent Expected indentation string
		 * @returns {void}
		 */
		function report(token, neededIndent) {
			const actualIndent = Array.from(tokenInfo.getTokenIndent(token));
			const numSpaces = actualIndent.filter(char => char === " ").length;
			const numTabs = actualIndent.filter(char => char === "\t").length;

			context.report({
				node: token,
				messageId: "wrongIndentation",
				data: createErrorMessageData(
					neededIndent.length,
					numSpaces,
					numTabs,
				),
				loc: {
					start: { line: token.loc.start.line, column: 0 },
					end: {
						line: token.loc.start.line,
						column: token.loc.start.column,
					},
				},
				fix(fixer) {
					const range = [
						token.range[0] - token.loc.start.column,
						token.range[0],
					];
					const newText = neededIndent;

					return fixer.replaceTextRange(range, newText);
				},
			});
		}

		/**
		 * Checks if a token's indentation is correct
		 * @param {Token} token Token to examine
		 * @param {string} desiredIndent Desired indentation of the string
		 * @returns {boolean} `true` if the token's indentation is correct
		 */
		function validateTokenIndent(token, desiredIndent) {
			const indentation = tokenInfo.getTokenIndent(token);

			return (
				indentation === desiredIndent ||
				// To avoid conflicts with no-mixed-spaces-and-tabs, don't report mixed spaces and tabs.
				(indentation.includes(" ") && indentation.includes("\t"))
			);
		}

		/**
		 * Check to see if the node is a file level IIFE
		 * @param {ASTNode} node The function node to check.
		 * @returns {boolean} True if the node is the outer IIFE
		 */
		function isOuterIIFE(node) {
			/*
			 * Verify that the node is an IIFE
			 */
			if (
				!node.parent ||
				node.parent.type !== "CallExpression" ||
				node.parent.callee !== node
			) {
				return false;
			}

			/*
			 * Navigate legal ancestors to determine whether this IIFE is outer.
			 * A "legal ancestor" is an expression or statement that causes the function to get executed immediately.
			 * For example, `!(function(){})()` is an outer IIFE even though it is preceded by a ! operator.
			 */
			let statement = node.parent && node.parent.parent;

			while (
				(statement.type === "UnaryExpression" &&
					["!", "~", "+", "-"].includes(statement.operator)) ||
				statement.type === "AssignmentExpression" ||
				statement.type === "LogicalExpression" ||
				statement.type === "SequenceExpression" ||
				statement.type === "VariableDeclarator"
			) {
				statement = statement.parent;
			}

			return (
				(statement.type === "ExpressionStatement" ||
					statement.type === "VariableDeclaration") &&
				statement.parent.type === "Program"
			);
		}

		/**
		 * Counts the number of linebreaks that follow the last non-whitespace character in a string
		 * @param {string} string The string to check
		 * @returns {number} The number of JavaScript linebreaks that follow the last non-whitespace character,
		 * or the total number of linebreaks if the string is all whitespace.
		 */
		function countTrailingLinebreaks(string) {
			const trailingWhitespace = string.match(/\s*$/u)[0];
			const linebreakMatches = trailingWhitespace.match(
				astUtils.createGlobalLinebreakMatcher(),
			);

			return linebreakMatches === null ? 0 : linebreakMatches.length;
		}

		/**
		 * Check indentation for lists of elements (arrays, objects, function params)
		 * @param {ASTNode[]} elements List of elements that should be offset
		 * @param {Token} startToken The start token of the list that element should be aligned against, e.g. '['
		 * @param {Token} endToken The end token of the list, e.g. ']'
		 * @param {number|string} offset The amount that the elements should be offset
		 * @returns {void}
		 */
		function addElementListIndent(elements, startToken, endToken, offset) {
			/**
			 * Gets the first token of a given element, including surrounding parentheses.
			 * @param {ASTNode} element A node in the `elements` list
			 * @returns {Token} The first token of this element
			 */
			function getFirstToken(element) {
				let token = sourceCode.getTokenBefore(element);

				while (
					astUtils.isOpeningParenToken(token) &&
					token !== startToken
				) {
					token = sourceCode.getTokenBefore(token);
				}
				return sourceCode.getTokenAfter(token);
			}

			// Run through all the tokens in the list, and offset them by one indent level (mainly for comments, other things will end up overridden)
			offsets.setDesiredOffsets(
				[startToken.range[1], endToken.range[0]],
				startToken,
				typeof offset === "number" ? offset : 1,
			);
			offsets.setDesiredOffset(endToken, startToken, 0);

			// If the preference is "first" but there is no first element (e.g. sparse arrays w/ empty first slot), fall back to 1 level.
			if (offset === "first" && elements.length && !elements[0]) {
				return;
			}
			elements.forEach((element, index) => {
				if (!element) {
					// Skip holes in arrays
					return;
				}
				if (offset === "off") {
					// Ignore the first token of every element if the "off" option is used
					offsets.ignoreToken(getFirstToken(element));
				}

				// Offset the following elements correctly relative to the first element
				if (index === 0) {
					return;
				}
				if (
					offset === "first" &&
					tokenInfo.isFirstTokenOfLine(getFirstToken(element))
				) {
					offsets.matchOffsetOf(
						getFirstToken(elements[0]),
						getFirstToken(element),
					);
				} else {
					const previousElement = elements[index - 1];
					const firstTokenOfPreviousElement =
						previousElement && getFirstToken(previousElement);
					const previousElementLastToken =
						previousElement &&
						sourceCode.getLastToken(previousElement);

					if (
						previousElement &&
						previousElementLastToken.loc.end.line -
							countTrailingLinebreaks(
								previousElementLastToken.value,
							) >
							startToken.loc.end.line
					) {
						offsets.setDesiredOffsets(
							[previousElement.range[1], element.range[1]],
							firstTokenOfPreviousElement,
							0,
						);
					}
				}
			});
		}

		/**
		 * Check and decide whether to check for indentation for blockless nodes
		 * Scenarios are for or while statements without braces around them
		 * @param {ASTNode} node node to examine
		 * @returns {void}
		 */
		function addBlocklessNodeIndent(node) {
			if (node.type !== "BlockStatement") {
				const lastParentToken = sourceCode.getTokenBefore(
					node,
					astUtils.isNotOpeningParenToken,
				);

				let firstBodyToken = sourceCode.getFirstToken(node);
				let lastBodyToken = sourceCode.getLastToken(node);

				while (
					astUtils.isOpeningParenToken(
						sourceCode.getTokenBefore(firstBodyToken),
					) &&
					astUtils.isClosingParenToken(
						sourceCode.getTokenAfter(lastBodyToken),
					)
				) {
					firstBodyToken = sourceCode.getTokenBefore(firstBodyToken);
					lastBodyToken = sourceCode.getTokenAfter(lastBodyToken);
				}

				offsets.setDesiredOffsets(
					[firstBodyToken.range[0], lastBodyToken.range[1]],
					lastParentToken,
					1,
				);
			}
		}

		/**
		 * Checks the indentation for nodes that are like function calls (`CallExpression` and `NewExpression`)
		 * @param {ASTNode} node A CallExpression or NewExpression node
		 * @returns {void}
		 */
		function addFunctionCallIndent(node) {
			let openingParen;

			if (node.arguments.length) {
				openingParen = sourceCode.getFirstTokenBetween(
					node.callee,
					node.arguments[0],
					astUtils.isOpeningParenToken,
				);
			} else {
				openingParen = sourceCode.getLastToken(node, 1);
			}
			const closingParen = sourceCode.getLastToken(node);

			parameterParens.add(openingParen);
			parameterParens.add(closingParen);

			/*
			 * If `?.` token exists, set desired offset for that.
			 * This logic is copied from `MemberExpression`'s.
			 */
			if (node.optional) {
				const dotToken = sourceCode.getTokenAfter(
					node.callee,
					astUtils.isQuestionDotToken,
				);
				const calleeParenCount = sourceCode.getTokensBetween(
					node.callee,
					dotToken,
					{ filter: astUtils.isClosingParenToken },
				).length;
				const firstTokenOfCallee = calleeParenCount
					? sourceCode.getTokenBefore(node.callee, {
							skip: calleeParenCount - 1,
						})
					: sourceCode.getFirstToken(node.callee);
				const lastTokenOfCallee = sourceCode.getTokenBefore(dotToken);
				const offsetBase =
					lastTokenOfCallee.loc.end.line ===
					openingParen.loc.start.line
						? lastTokenOfCallee
						: firstTokenOfCallee;

				offsets.setDesiredOffset(dotToken, offsetBase, 1);
			}

			const offsetAfterToken =
				node.callee.type === "TaggedTemplateExpression"
					? sourceCode.getFirstToken(node.callee.quasi)
					: openingParen;
			const offsetToken = sourceCode.getTokenBefore(offsetAfterToken);

			offsets.setDesiredOffset(openingParen, offsetToken, 0);

			addElementListIndent(
				node.arguments,
				openingParen,
				closingParen,
				options.CallExpression.arguments,
			);
		}

		/**
		 * Checks the indentation of parenthesized values, given a list of tokens in a program
		 * @param {Token[]} tokens A list of tokens
		 * @returns {void}
		 */
		function addParensIndent(tokens) {
			const parenStack = [];
			const parenPairs = [];

			for (let i = 0; i < tokens.length; i++) {
				const nextToken = tokens[i];

				if (astUtils.isOpeningParenToken(nextToken)) {
					parenStack.push(nextToken);
				} else if (astUtils.isClosingParenToken(nextToken)) {
					parenPairs.push({
						left: parenStack.pop(),
						right: nextToken,
					});
				}
			}

			for (let i = parenPairs.length - 1; i >= 0; i--) {
				const leftParen = parenPairs[i].left;
				const rightParen = parenPairs[i].right;

				// We only want to handle parens around expressions, so exclude parentheses that are in function parameters and function call arguments.
				if (
					!parameterParens.has(leftParen) &&
					!parameterParens.has(rightParen)
				) {
					const parenthesizedTokens = new Set(
						sourceCode.getTokensBetween(leftParen, rightParen),
					);

					parenthesizedTokens.forEach(token => {
						if (
							!parenthesizedTokens.has(
								offsets.getFirstDependency(token),
							)
						) {
							offsets.setDesiredOffset(token, leftParen, 1);
						}
					});
				}

				offsets.setDesiredOffset(rightParen, leftParen, 0);
			}
		}

		/**
		 * Ignore all tokens within an unknown node whose offset do not depend
		 * on another token's offset within the unknown node
		 * @param {ASTNode} node Unknown Node
		 * @returns {void}
		 */
		function ignoreNode(node) {
			const unknownNodeTokens = new Set(
				sourceCode.getTokens(node, { includeComments: true }),
			);

			unknownNodeTokens.forEach(token => {
				if (!unknownNodeTokens.has(offsets.getFirstDependency(token))) {
					const firstTokenOfLine =
						tokenInfo.getFirstTokenOfLine(token);

					if (token === firstTokenOfLine) {
						offsets.ignoreToken(token);
					} else {
						offsets.setDesiredOffset(token, firstTokenOfLine, 0);
					}
				}
			});
		}

		/**
		 * Check whether the given token is on the first line of a statement.
		 * @param {Token} token The token to check.
		 * @param {ASTNode} leafNode The expression node that the token belongs directly.
		 * @returns {boolean} `true` if the token is on the first line of a statement.
		 */
		function isOnFirstLineOfStatement(token, leafNode) {
			let node = leafNode;

			while (
				node.parent &&
				!node.parent.type.endsWith("Statement") &&
				!node.parent.type.endsWith("Declaration")
			) {
				node = node.parent;
			}
			node = node.parent;

			return !node || node.loc.start.line === token.loc.start.line;
		}

		/**
		 * Check whether there are any blank (whitespace-only) lines between
		 * two tokens on separate lines.
		 * @param {Token} firstToken The first token.
		 * @param {Token} secondToken The second token.
		 * @returns {boolean} `true` if the tokens are on separate lines and
		 *   there exists a blank line between them, `false` otherwise.
		 */
		function hasBlankLinesBetween(firstToken, secondToken) {
			const firstTokenLine = firstToken.loc.end.line;
			const secondTokenLine = secondToken.loc.start.line;

			if (
				firstTokenLine === secondTokenLine ||
				firstTokenLine === secondTokenLine - 1
			) {
				return false;
			}

			for (
				let line = firstTokenLine + 1;
				line < secondTokenLine;
				++line
			) {
				if (!tokenInfo.firstTokensByLineNumber.has(line)) {
					return true;
				}
			}

			return false;
		}

		const ignoredNodeFirstTokens = new Set();

		const baseOffsetListeners = {
			"ArrayExpression, ArrayPattern"(node) {
				const openingBracket = sourceCode.getFirstToken(node);
				const closingBracket = sourceCode.getTokenAfter(
					[...node.elements].reverse().find(_ => _) || openingBracket,
					astUtils.isClosingBracketToken,
				);

				addElementListIndent(
					node.elements,
					openingBracket,
					closingBracket,
					options.ArrayExpression,
				);
			},

			"ObjectExpression, ObjectPattern"(node) {
				const openingCurly = sourceCode.getFirstToken(node);
				const closingCurly = sourceCode.getTokenAfter(
					node.properties.length
						? node.properties.at(-1)
						: openingCurly,
					astUtils.isClosingBraceToken,
				);

				addElementListIndent(
					node.properties,
					openingCurly,
					closingCurly,
					options.ObjectExpression,
				);
			},

			ArrowFunctionExpression(node) {
				const maybeOpeningParen = sourceCode.getFirstToken(node, {
					skip: node.async ? 1 : 0,
				});

				if (astUtils.isOpeningParenToken(maybeOpeningParen)) {
					const openingParen = maybeOpeningParen;
					const closingParen = sourceCode.getTokenBefore(
						node.body,
						astUtils.isClosingParenToken,
					);

					parameterParens.add(openingParen);
					parameterParens.add(closingParen);
					addElementListIndent(
						node.params,
						openingParen,
						closingParen,
						options.FunctionExpression.parameters,
					);
				}

				addBlocklessNodeIndent(node.body);
			},

			AssignmentExpression(node) {
				const operator = sourceCode.getFirstTokenBetween(
					node.left,
					node.right,
					token => token.value === node.operator,
				);

				offsets.setDesiredOffsets(
					[operator.range[0], node.range[1]],
					sourceCode.getLastToken(node.left),
					1,
				);
				offsets.ignoreToken(operator);
				offsets.ignoreToken(sourceCode.getTokenAfter(operator));
			},

			"BinaryExpression, LogicalExpression"(node) {
				const operator = sourceCode.getFirstTokenBetween(
					node.left,
					node.right,
					token => token.value === node.operator,
				);

				/*
				 * For backwards compatibility, don't check BinaryExpression indents, e.g.
				 * var foo = bar &&
				 *                   baz;
				 */

				const tokenAfterOperator = sourceCode.getTokenAfter(operator);

				offsets.ignoreToken(operator);
				offsets.ignoreToken(tokenAfterOperator);
				offsets.setDesiredOffset(tokenAfterOperator, operator, 0);
			},

			"BlockStatement, ClassBody"(node) {
				let blockIndentLevel;

				if (node.parent && isOuterIIFE(node.parent)) {
					blockIndentLevel = options.outerIIFEBody;
				} else if (
					node.parent &&
					(node.parent.type === "FunctionExpression" ||
						node.parent.type === "ArrowFunctionExpression")
				) {
					blockIndentLevel = options.FunctionExpression.body;
				} else if (
					node.parent &&
					node.parent.type === "FunctionDeclaration"
				) {
					blockIndentLevel = options.FunctionDeclaration.body;
				} else {
					blockIndentLevel = 1;
				}

				/*
				 * For blocks that aren't lone statements, ensure that the opening curly brace
				 * is aligned with the parent.
				 */
				if (!astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type)) {
					offsets.setDesiredOffset(
						sourceCode.getFirstToken(node),
						sourceCode.getFirstToken(node.parent),
						0,
					);
				}

				addElementListIndent(
					node.body,
					sourceCode.getFirstToken(node),
					sourceCode.getLastToken(node),
					blockIndentLevel,
				);
			},

			CallExpression: addFunctionCallIndent,

			"ClassDeclaration[superClass], ClassExpression[superClass]"(node) {
				const classToken = sourceCode.getFirstToken(node);
				const extendsToken = sourceCode.getTokenBefore(
					node.superClass,
					astUtils.isNotOpeningParenToken,
				);

				offsets.setDesiredOffsets(
					[extendsToken.range[0], node.body.range[0]],
					classToken,
					1,
				);
			},

			ConditionalExpression(node) {
				const firstToken = sourceCode.getFirstToken(node);

				// `flatTernaryExpressions` option is for the following style:
				// var a =
				//     foo > 0 ? bar :
				//     foo < 0 ? baz :
				//     /*else*/ qiz ;
				if (
					!options.flatTernaryExpressions ||
					!astUtils.isTokenOnSameLine(node.test, node.consequent) ||
					isOnFirstLineOfStatement(firstToken, node)
				) {
					const questionMarkToken = sourceCode.getFirstTokenBetween(
						node.test,
						node.consequent,
						token =>
							token.type === "Punctuator" && token.value === "?",
					);
					const colonToken = sourceCode.getFirstTokenBetween(
						node.consequent,
						node.alternate,
						token =>
							token.type === "Punctuator" && token.value === ":",
					);

					const firstConsequentToken =
						sourceCode.getTokenAfter(questionMarkToken);
					const lastConsequentToken =
						sourceCode.getTokenBefore(colonToken);
					const firstAlternateToken =
						sourceCode.getTokenAfter(colonToken);

					offsets.setDesiredOffset(questionMarkToken, firstToken, 1);
					offsets.setDesiredOffset(colonToken, firstToken, 1);

					offsets.setDesiredOffset(
						firstConsequentToken,
						firstToken,
						firstConsequentToken.type === "Punctuator" &&
							options.offsetTernaryExpressions
							? 2
							: 1,
					);

					/*
					 * The alternate and the consequent should usually have the same indentation.
					 * If they share part of a line, align the alternate against the first token of the consequent.
					 * This allows the alternate to be indented correctly in cases like this:
					 * foo ? (
					 *   bar
					 * ) : ( // this '(' is aligned with the '(' above, so it's considered to be aligned with `foo`
					 *   baz // as a result, `baz` is offset by 1 rather than 2
					 * )
					 */
					if (
						lastConsequentToken.loc.end.line ===
						firstAlternateToken.loc.start.line
					) {
						offsets.setDesiredOffset(
							firstAlternateToken,
							firstConsequentToken,
							0,
						);
					} else {
						/**
						 * If the alternate and consequent do not share part of a line, offset the alternate from the first
						 * token of the conditional expression. For example:
						 * foo ? bar
						 *   : baz
						 *
						 * If `baz` were aligned with `bar` rather than being offset by 1 from `foo`, `baz` would end up
						 * having no expected indentation.
						 */
						offsets.setDesiredOffset(
							firstAlternateToken,
							firstToken,
							firstAlternateToken.type === "Punctuator" &&
								options.offsetTernaryExpressions
								? 2
								: 1,
						);
					}
				}
			},

			"DoWhileStatement, WhileStatement, ForInStatement, ForOfStatement, WithStatement":
				node => addBlocklessNodeIndent(node.body),

			ExportNamedDeclaration(node) {
				if (node.declaration === null) {
					const closingCurly = sourceCode.getLastToken(
						node,
						astUtils.isClosingBraceToken,
					);

					// Indent the specifiers in `export {foo, bar, baz}`
					addElementListIndent(
						node.specifiers,
						sourceCode.getFirstToken(node, { skip: 1 }),
						closingCurly,
						1,
					);

					if (node.source) {
						// Indent everything after and including the `from` token in `export {foo, bar, baz} from 'qux'`
						offsets.setDesiredOffsets(
							[closingCurly.range[1], node.range[1]],
							sourceCode.getFirstToken(node),
							1,
						);
					}
				}
			},

			ForStatement(node) {
				const forOpeningParen = sourceCode.getFirstToken(node, 1);

				if (node.init) {
					offsets.setDesiredOffsets(
						node.init.range,
						forOpeningParen,
						1,
					);
				}
				if (node.test) {
					offsets.setDesiredOffsets(
						node.test.range,
						forOpeningParen,
						1,
					);
				}
				if (node.update) {
					offsets.setDesiredOffsets(
						node.update.range,
						forOpeningParen,
						1,
					);
				}
				addBlocklessNodeIndent(node.body);
			},

			"FunctionDeclaration, FunctionExpression"(node) {
				const closingParen = sourceCode.getTokenBefore(node.body);
				const openingParen = sourceCode.getTokenBefore(
					node.params.length ? node.params[0] : closingParen,
				);

				parameterParens.add(openingParen);
				parameterParens.add(closingParen);
				addElementListIndent(
					node.params,
					openingParen,
					closingParen,
					options[node.type].parameters,
				);
			},

			IfStatement(node) {
				addBlocklessNodeIndent(node.consequent);
				if (node.alternate) {
					addBlocklessNodeIndent(node.alternate);
				}
			},

			/*
			 * For blockless nodes with semicolon-first style, don't indent the semicolon.
			 * e.g.
			 * if (foo)
			 *     bar()
			 * ; [1, 2, 3].map(foo)
			 *
			 * Traversal into the node sets indentation of the semicolon, so we need to override it on exit.
			 */
			":matches(DoWhileStatement, ForStatement, ForInStatement, ForOfStatement, IfStatement, WhileStatement, WithStatement):exit"(
				node,
			) {
				let nodesToCheck;

				if (node.type === "IfStatement") {
					nodesToCheck = [node.consequent];
					if (node.alternate) {
						nodesToCheck.push(node.alternate);
					}
				} else {
					nodesToCheck = [node.body];
				}

				for (const nodeToCheck of nodesToCheck) {
					const lastToken = sourceCode.getLastToken(nodeToCheck);

					if (astUtils.isSemicolonToken(lastToken)) {
						const tokenBeforeLast =
							sourceCode.getTokenBefore(lastToken);
						const tokenAfterLast =
							sourceCode.getTokenAfter(lastToken);

						// override indentation of `;` only if its line looks like a semicolon-first style line
						if (
							!astUtils.isTokenOnSameLine(
								tokenBeforeLast,
								lastToken,
							) &&
							tokenAfterLast &&
							astUtils.isTokenOnSameLine(
								lastToken,
								tokenAfterLast,
							)
						) {
							offsets.setDesiredOffset(
								lastToken,
								sourceCode.getFirstToken(node),
								0,
							);
						}
					}
				}
			},

			ImportDeclaration(node) {
				if (
					node.specifiers.some(
						specifier => specifier.type === "ImportSpecifier",
					)
				) {
					const openingCurly = sourceCode.getFirstToken(
						node,
						astUtils.isOpeningBraceToken,
					);
					const closingCurly = sourceCode.getLastToken(
						node,
						astUtils.isClosingBraceToken,
					);

					addElementListIndent(
						node.specifiers.filter(
							specifier => specifier.type === "ImportSpecifier",
						),
						openingCurly,
						closingCurly,
						options.ImportDeclaration,
					);
				}

				const fromToken = sourceCode.getLastToken(
					node,
					token =>
						token.type === "Identifier" && token.value === "from",
				);
				const sourceToken = sourceCode.getLastToken(
					node,
					token => token.type === "String",
				);
				const semiToken = sourceCode.getLastToken(
					node,
					token => token.type === "Punctuator" && token.value === ";",
				);

				if (fromToken) {
					const end =
						semiToken && semiToken.range[1] === sourceToken.range[1]
							? node.range[1]
							: sourceToken.range[1];

					offsets.setDesiredOffsets(
						[fromToken.range[0], end],
						sourceCode.getFirstToken(node),
						1,
					);
				}
			},

			ImportExpression(node) {
				const openingParen = sourceCode.getFirstToken(node, 1);
				const closingParen = sourceCode.getLastToken(node);

				parameterParens.add(openingParen);
				parameterParens.add(closingParen);
				offsets.setDesiredOffset(
					openingParen,
					sourceCode.getTokenBefore(openingParen),
					0,
				);

				addElementListIndent(
					[node.source],
					openingParen,
					closingParen,
					options.CallExpression.arguments,
				);
			},

			"MemberExpression, JSXMemberExpression, MetaProperty"(node) {
				const object =
					node.type === "MetaProperty" ? node.meta : node.object;
				const firstNonObjectToken = sourceCode.getFirstTokenBetween(
					object,
					node.property,
					astUtils.isNotClosingParenToken,
				);
				const secondNonObjectToken =
					sourceCode.getTokenAfter(firstNonObjectToken);

				const objectParenCount = sourceCode.getTokensBetween(
					object,
					node.property,
					{ filter: astUtils.isClosingParenToken },
				).length;
				const firstObjectToken = objectParenCount
					? sourceCode.getTokenBefore(object, {
							skip: objectParenCount - 1,
						})
					: sourceCode.getFirstToken(object);
				const lastObjectToken =
					sourceCode.getTokenBefore(firstNonObjectToken);
				const firstPropertyToken = node.computed
					? firstNonObjectToken
					: secondNonObjectToken;

				if (node.computed) {
					// For computed MemberExpressions, match the closing bracket with the opening bracket.
					offsets.setDesiredOffset(
						sourceCode.getLastToken(node),
						firstNonObjectToken,
						0,
					);
					offsets.setDesiredOffsets(
						node.property.range,
						firstNonObjectToken,
						1,
					);
				}

				/*
				 * If the object ends on the same line that the property starts, match against the last token
				 * of the object, to ensure that the MemberExpression is not indented.
				 *
				 * Otherwise, match against the first token of the object, e.g.
				 * foo
				 *   .bar
				 *   .baz // <-- offset by 1 from `foo`
				 */
				const offsetBase =
					lastObjectToken.loc.end.line ===
					firstPropertyToken.loc.start.line
						? lastObjectToken
						: firstObjectToken;

				if (typeof options.MemberExpression === "number") {
					// Match the dot (for non-computed properties) or the opening bracket (for computed properties) against the object.
					offsets.setDesiredOffset(
						firstNonObjectToken,
						offsetBase,
						options.MemberExpression,
					);

					/*
					 * For computed MemberExpressions, match the first token of the property against the opening bracket.
					 * Otherwise, match the first token of the property against the object.
					 */
					offsets.setDesiredOffset(
						secondNonObjectToken,
						node.computed ? firstNonObjectToken : offsetBase,
						options.MemberExpression,
					);
				} else {
					// If the MemberExpression option is off, ignore the dot and the first token of the property.
					offsets.ignoreToken(firstNonObjectToken);
					offsets.ignoreToken(secondNonObjectToken);

					// To ignore the property indentation, ensure that the property tokens depend on the ignored tokens.
					offsets.setDesiredOffset(
						firstNonObjectToken,
						offsetBase,
						0,
					);
					offsets.setDesiredOffset(
						secondNonObjectToken,
						firstNonObjectToken,
						0,
					);
				}
			},

			NewExpression(node) {
				// Only indent the arguments if the NewExpression has parens (e.g. `new Foo(bar)` or `new Foo()`, but not `new Foo`
				if (
					node.arguments.length > 0 ||
					(astUtils.isClosingParenToken(
						sourceCode.getLastToken(node),
					) &&
						astUtils.isOpeningParenToken(
							sourceCode.getLastToken(node, 1),
						))
				) {
					addFunctionCallIndent(node);
				}
			},

			Property(node) {
				if (!node.shorthand && !node.method && node.kind === "init") {
					const colon = sourceCode.getFirstTokenBetween(
						node.key,
						node.value,
						astUtils.isColonToken,
					);

					offsets.ignoreToken(sourceCode.getTokenAfter(colon));
				}
			},

			PropertyDefinition(node) {
				const firstToken = sourceCode.getFirstToken(node);
				const maybeSemicolonToken = sourceCode.getLastToken(node);
				let keyLastToken;

				// Indent key.
				if (node.computed) {
					const bracketTokenL = sourceCode.getTokenBefore(
						node.key,
						astUtils.isOpeningBracketToken,
					);
					const bracketTokenR = (keyLastToken =
						sourceCode.getTokenAfter(
							node.key,
							astUtils.isClosingBracketToken,
						));
					const keyRange = [
						bracketTokenL.range[1],
						bracketTokenR.range[0],
					];

					if (bracketTokenL !== firstToken) {
						offsets.setDesiredOffset(bracketTokenL, firstToken, 0);
					}
					offsets.setDesiredOffsets(keyRange, bracketTokenL, 1);
					offsets.setDesiredOffset(bracketTokenR, bracketTokenL, 0);
				} else {
					const idToken = (keyLastToken = sourceCode.getFirstToken(
						node.key,
					));

					if (idToken !== firstToken) {
						offsets.setDesiredOffset(idToken, firstToken, 1);
					}
				}

				// Indent initializer.
				if (node.value) {
					const eqToken = sourceCode.getTokenBefore(
						node.value,
						astUtils.isEqToken,
					);
					const valueToken = sourceCode.getTokenAfter(eqToken);

					offsets.setDesiredOffset(eqToken, keyLastToken, 1);
					offsets.setDesiredOffset(valueToken, eqToken, 1);
					if (astUtils.isSemicolonToken(maybeSemicolonToken)) {
						offsets.setDesiredOffset(
							maybeSemicolonToken,
							eqToken,
							1,
						);
					}
				} else if (astUtils.isSemicolonToken(maybeSemicolonToken)) {
					offsets.setDesiredOffset(
						maybeSemicolonToken,
						keyLastToken,
						1,
					);
				}
			},

			StaticBlock(node) {
				const openingCurly = sourceCode.getFirstToken(node, {
					skip: 1,
				}); // skip the `static` token
				const closingCurly = sourceCode.getLastToken(node);

				addElementListIndent(
					node.body,
					openingCurly,
					closingCurly,
					options.StaticBlock.body,
				);
			},

			SwitchStatement(node) {
				const openingCurly = sourceCode.getTokenAfter(
					node.discriminant,
					astUtils.isOpeningBraceToken,
				);
				const closingCurly = sourceCode.getLastToken(node);

				offsets.setDesiredOffsets(
					[openingCurly.range[1], closingCurly.range[0]],
					openingCurly,
					options.SwitchCase,
				);

				if (node.cases.length) {
					sourceCode
						.getTokensBetween(node.cases.at(-1), closingCurly, {
							includeComments: true,
							filter: astUtils.isCommentToken,
						})
						.forEach(token => offsets.ignoreToken(token));
				}
			},

			SwitchCase(node) {
				if (!(
					node.consequent.length === 1 &&
					node.consequent[0].type === "BlockStatement"
				)) {
					const caseKeyword = sourceCode.getFirstToken(node);
					const tokenAfterCurrentCase =
						sourceCode.getTokenAfter(node);

					offsets.setDesiredOffsets(
						[caseKeyword.range[1], tokenAfterCurrentCase.range[0]],
						caseKeyword,
						1,
					);
				}
			},

			TemplateLiteral(node) {
				node.expressions.forEach((expression, index) => {
					const previousQuasi = node.quasis[index];
					const nextQuasi = node.quasis[index + 1];
					const tokenToAlignFrom =
						previousQuasi.loc.start.line ===
						previousQuasi.loc.end.line
							? sourceCode.getFirstToken(previousQuasi)
							: null;

					offsets.setDesiredOffsets(
						[previousQuasi.range[1], nextQuasi.range[0]],
						tokenToAlignFrom,
						1,
					);
					offsets.setDesiredOffset(
						sourceCode.getFirstToken(nextQuasi),
						tokenToAlignFrom,
						0,
					);
				});
			},

			VariableDeclaration(node) {
				let variableIndent = Object.hasOwn(
					options.VariableDeclarator,
					node.kind,
				)
					? options.VariableDeclarator[node.kind]
					: DEFAULT_VARIABLE_INDENT;

				const firstToken = sourceCode.getFirstToken(node),
					lastToken = sourceCode.getLastToken(node);

				if (options.VariableDeclarator[node.kind] === "first") {
					if (node.declarations.length > 1) {
						addElementListIndent(
							node.declarations,
							firstToken,
							lastToken,
							"first",
						);
						return;
					}

					variableIndent = DEFAULT_VARIABLE_INDENT;
				}

				if (
					node.declarations.at(-1).loc.start.line >
					node.loc.start.line
				) {
					/*
					 * VariableDeclarator indentation is a bit different from other forms of indentation, in that the
					 * indentation of an opening bracket sometimes won't match that of a closing bracket. For example,
					 * the following indentations are correct:
					 *
					 * var foo = {
					 *   ok: true
					 * };
					 *
					 * var foo = {
					 *     ok: true,
					 *   },
					 *   bar = 1;
					 *
					 * Account for when exiting the AST (after indentations have already been set for the nodes in
					 * the declaration) by manually increasing the indentation level of the tokens in this declarator
					 * on the same line as the start of the declaration, provided that there are declarators that
					 * follow this one.
					 */
					offsets.setDesiredOffsets(
						node.range,
						firstToken,
						variableIndent,
						true,
					);
				} else {
					offsets.setDesiredOffsets(
						node.range,
						firstToken,
						variableIndent,
					);
				}

				if (astUtils.isSemicolonToken(lastToken)) {
					offsets.ignoreToken(lastToken);
				}
			},

			VariableDeclarator(node) {
				if (node.init) {
					const equalOperator = sourceCode.getTokenBefore(
						node.init,
						astUtils.isNotOpeningParenToken,
					);
					const tokenAfterOperator =
						sourceCode.getTokenAfter(equalOperator);

					offsets.ignoreToken(equalOperator);
					offsets.ignoreToken(tokenAfterOperator);
					offsets.setDesiredOffsets(
						[tokenAfterOperator.range[0], node.range[1]],
						equalOperator,
						1,
					);
					offsets.setDesiredOffset(
						equalOperator,
						sourceCode.getLastToken(node.id),
						0,
					);
				}
			},

			"JSXAttribute[value]"(node) {
				const equalsToken = sourceCode.getFirstTokenBetween(
					node.name,
					node.value,
					token => token.type === "Punctuator" && token.value === "=",
				);

				offsets.setDesiredOffsets(
					[equalsToken.range[0], node.value.range[1]],
					sourceCode.getFirstToken(node.name),
					1,
				);
			},

			JSXElement(node) {
				if (node.closingElement) {
					addElementListIndent(
						node.children,
						sourceCode.getFirstToken(node.openingElement),
						sourceCode.getFirstToken(node.closingElement),
						1,
					);
				}
			},

			JSXOpeningElement(node) {
				const firstToken = sourceCode.getFirstToken(node);
				let closingToken;

				if (node.selfClosing) {
					closingToken = sourceCode.getLastToken(node, { skip: 1 });
					offsets.setDesiredOffset(
						sourceCode.getLastToken(node),
						closingToken,
						0,
					);
				} else {
					closingToken = sourceCode.getLastToken(node);
				}
				offsets.setDesiredOffsets(
					node.name.range,
					sourceCode.getFirstToken(node),
				);
				addElementListIndent(
					node.attributes,
					firstToken,
					closingToken,
					1,
				);
			},

			JSXClosingElement(node) {
				const firstToken = sourceCode.getFirstToken(node);

				offsets.setDesiredOffsets(node.name.range, firstToken, 1);
			},

			JSXFragment(node) {
				const firstOpeningToken = sourceCode.getFirstToken(
					node.openingFragment,
				);
				const firstClosingToken = sourceCode.getFirstToken(
					node.closingFragment,
				);

				addElementListIndent(
					node.children,
					firstOpeningToken,
					firstClosingToken,
					1,
				);
			},

			JSXOpeningFragment(node) {
				const firstToken = sourceCode.getFirstToken(node);
				const closingToken = sourceCode.getLastToken(node);

				offsets.setDesiredOffsets(node.range, firstToken, 1);
				offsets.matchOffsetOf(firstToken, closingToken);
			},

			JSXClosingFragment(node) {
				const firstToken = sourceCode.getFirstToken(node);
				const slashToken = sourceCode.getLastToken(node, { skip: 1 });
				const closingToken = sourceCode.getLastToken(node);
				const tokenToMatch = astUtils.isTokenOnSameLine(
					slashToken,
					closingToken,
				)
					? slashToken
					: closingToken;

				offsets.setDesiredOffsets(node.range, firstToken, 1);
				offsets.matchOffsetOf(firstToken, tokenToMatch);
			},

			JSXExpressionContainer(node) {
				const openingCurly = sourceCode.getFirstToken(node);
				const closingCurly = sourceCode.getLastToken(node);

				offsets.setDesiredOffsets(
					[openingCurly.range[1], closingCurly.range[0]],
					openingCurly,
					1,
				);
			},

			JSXSpreadAttribute(node) {
				const openingCurly = sourceCode.getFirstToken(node);
				const closingCurly = sourceCode.getLastToken(node);

				offsets.setDesiredOffsets(
					[openingCurly.range[1], closingCurly.range[0]],
					openingCurly,
					1,
				);
			},

			"*"(node) {
				const firstToken = sourceCode.getFirstToken(node);

				// Ensure that the children of every node are indented at least as much as the first token.
				if (firstToken && !ignoredNodeFirstTokens.has(firstToken)) {
					offsets.setDesiredOffsets(node.range, firstToken, 0);
				}
			},
		};

		const listenerCallQueue = [];

		/*
		 * To ignore the indentation of a node:
		 * 1. Don't call the node's listener when entering it (if it has a listener)
		 * 2. Don't set any offsets against the first token of the node.
		 * 3. Call `ignoreNode` on the node sometime after exiting it and before validating offsets.
		 */
		const offsetListeners = {};

		for (const [selector, listener] of Object.entries(
			baseOffsetListeners,
		)) {
			/*
			 * Offset listener calls are deferred until traversal is finished, and are called as
			 * part of the final `Program:exit` listener. This is necessary because a node might
			 * be matched by multiple selectors.
			 *
			 * Example: Suppose there is an offset listener for `Identifier`, and the user has
			 * specified in configuration that `MemberExpression > Identifier` should be ignored.
			 * Due to selector specificity rules, the `Identifier` listener will get called first. However,
			 * if a given Identifier node is supposed to be ignored, then the `Identifier` offset listener
			 * should not have been called at all. Without doing extra selector matching, we don't know
			 * whether the Identifier matches the `MemberExpression > Identifier` selector until the
			 * `MemberExpression > Identifier` listener is called.
			 *
			 * To avoid this, the `Identifier` listener isn't called until traversal finishes and all
			 * ignored nodes are known.
			 */
			offsetListeners[selector] = node =>
				listenerCallQueue.push({ listener, node });
		}

		// For each ignored node selector, set up a listener to collect it into the `ignoredNodes` set.
		const ignoredNodes = new Set();

		/**
		 * Ignores a node
		 * @param {ASTNode} node The node to ignore
		 * @returns {void}
		 */
		function addToIgnoredNodes(node) {
			ignoredNodes.add(node);
			ignoredNodeFirstTokens.add(sourceCode.getFirstToken(node));
		}

		const ignoredNodeListeners = options.ignoredNodes.reduce(
			(listeners, ignoredSelector) =>
				Object.assign(listeners, {
					[ignoredSelector]: addToIgnoredNodes,
				}),
			{},
		);

		/*
		 * Join the listeners, and add a listener to verify that all tokens actually have the correct indentation
		 * at the end.
		 *
		 * Using Object.assign will cause some offset listeners to be overwritten if the same selector also appears
		 * in `ignoredNodeListeners`. This isn't a problem because all of the matching nodes will be ignored,
		 * so those listeners wouldn't be called anyway.
		 */
		return Object.assign(offsetListeners, ignoredNodeListeners, {
			"*:exit"(node) {
				// If a node's type is nonstandard, we can't tell how its children should be offset, so ignore it.
				if (!KNOWN_NODES.has(node.type)) {
					addToIgnoredNodes(node);
				}
			},
			"Program:exit"() {
				// If ignoreComments option is enabled, ignore all comment tokens.
				if (options.ignoreComments) {
					sourceCode
						.getAllComments()
						.forEach(comment => offsets.ignoreToken(comment));
				}

				// Invoke the queued offset listeners for the nodes that aren't ignored.
				for (let i = 0; i < listenerCallQueue.length; i++) {
					const nodeInfo = listenerCallQueue[i];

					if (!ignoredNodes.has(nodeInfo.node)) {
						nodeInfo.listener(nodeInfo.node);
					}
				}

				// Update the offsets for ignored nodes to prevent their child tokens from being reported.
				ignoredNodes.forEach(ignoreNode);

				addParensIndent(sourceCode.ast.tokens);

				/*
				 * Create a Map from (tokenOrComment) => (precedingToken).
				 * This is necessary because sourceCode.getTokenBefore does not handle a comment as an argument correctly.
				 */
				const precedingTokens = new WeakMap();

				for (let i = 0; i < sourceCode.ast.comments.length; i++) {
					const comment = sourceCode.ast.comments[i];

					const tokenOrCommentBefore = sourceCode.getTokenBefore(
						comment,
						{ includeComments: true },
					);
					const hasToken = precedingTokens.has(tokenOrCommentBefore)
						? precedingTokens.get(tokenOrCommentBefore)
						: tokenOrCommentBefore;

					precedingTokens.set(comment, hasToken);
				}

				for (let i = 1; i < sourceCode.lines.length + 1; i++) {
					if (!tokenInfo.firstTokensByLineNumber.has(i)) {
						// Don't check indentation on blank lines
						continue;
					}

					const firstTokenOfLine =
						tokenInfo.firstTokensByLineNumber.get(i);

					if (firstTokenOfLine.loc.start.line !== i) {
						// Don't check the indentation of multi-line tokens (e.g. template literals or block comments) twice.
						continue;
					}

					if (astUtils.isCommentToken(firstTokenOfLine)) {
						const tokenBefore =
							precedingTokens.get(firstTokenOfLine);
						const tokenAfter = tokenBefore
							? sourceCode.getTokenAfter(tokenBefore)
							: sourceCode.ast.tokens[0];
						const mayAlignWithBefore =
							tokenBefore &&
							!hasBlankLinesBetween(
								tokenBefore,
								firstTokenOfLine,
							);
						const mayAlignWithAfter =
							tokenAfter &&
							!hasBlankLinesBetween(firstTokenOfLine, tokenAfter);

						/*
						 * If a comment precedes a line that begins with a semicolon token, align to that token, i.e.
						 *
						 * let foo
						 * // comment
						 * ;(async () => {})()
						 */
						if (
							tokenAfter &&
							astUtils.isSemicolonToken(tokenAfter) &&
							!astUtils.isTokenOnSameLine(
								firstTokenOfLine,
								tokenAfter,
							)
						) {
							offsets.setDesiredOffset(
	b							firstTokenOfLine,
								tokenAfter,
								0,
							);
						}

						// If a comment matches the expected indentation of the token immediately before or after, don't report it.
						if (
							(mayAlignWithBefore &&
								validateTokenIndent(
									firstTokenOfLine,
									offsets.getDesiredIndent(tokenBefore),
								)) ||
							(mayAlignWithAfter &&
								validateTokenIndent(
									firstTokenOfLine,
									offsets.getDesiredIndent(tokenAfter),
								))
						) {
							continue;
						}
					}

					// If the token matches the expected indentation, don't report it.
					if (
						validateTokenIndent(
							firstTokenOfLine,
							offsets.getDesiredIndent(firstTokenOfLine),
						)
					) {
						continue;
					}

					// Otherwise, report the token/comment.
					report(
						firstTokenOfLine,
						offsets.getDesiredIndent(firstTokenOfLine),
					);
				}
			},
		});
	},
};
kxE/**
 * @fileoverview Collects the built-in rules into a map structure so that they can be imported all at once and without
 * using the file-system directly.
 * @author Peter (Somogyvari) Metz
 */

"use strict";

/* eslint sort-keys: ["error", "asc"] -- More readable for long list */

const { LazyLoadingRuleMap } = require("./utils/lazy-loading-rule-map");

/** @type {Map<string, import("../types").Rule.RuleModule>} */
module.exports = new LazyLoadingRuleMap(
	Object.entries({
		"accessor-pairs": () => require("./accessor-pairs"),
		"array-bracket-newline": () => require("./array-bracket-newline"),
		"array-bracket-spacing": () => require("./array-bracket-spacing"),
		"array-callback-return": () => require("./array-callback-return"),
		"array-element-newline": () => require("./array-element-newline"),
		"arrow-body-style": () => require("./arrow-body-style"),
		"arrow-parens": () => require("./arrow-parens"),
		"arrow-spacing": () => require("./arrow-spacing"),
		"block-scoped-var": () => require("./block-scoped-var"),
		"block-spacing": () => require("./block-spacing"),
		"brace-style": () => require("./brace-style"),
		"callback-return": () => require("./callback-return"),
		camelcase: () => require("./camelcase"),
		"capitalized-comments": () => require("./capitalized-comments"),
		"class-methods-use-this": () => require("./class-methods-use-this"),
		"comma-dangle": () => require("./comma-dangle"),
		"comma-spacing": () => require("./comma-spacing"),
		"comma-style": () => require("./comma-style"),
		complexity: () => require("./complexity"),
		"computed-property-spacing": () =>
			require("./computed-property-spacing"),
		"consistent-return": () => require("./consistent-return"),
		"consistent-this": () => require("./consistent-this"),
		"constructor-super": () => require("./constructor-super"),
		curly: () => require("./curly"),
		"default-case": () => require("./default-case"),
		"default-case-last": () => require("./default-case-last"),
		"default-param-last": () => require("./default-param-last"),
		"dot-location": () => require("./dot-location"),
		"dot-notation": () => require("./dot-notation"),
		"eol-last": () => require("./eol-last"),
		eqeqeq: () => require("./eqeqeq"),
		"for-direction": () => require("./for-direction"),
		"func-call-spacing": () => require("./func-call-spacing"),
		"func-name-matching": () => require("./func-name-matching"),
		"func-names": () => require("./func-names"),
		"func-style": () => require("./func-style"),
		"function-call-argument-newline": () =>
			require("./function-call-argument-newline"),
		"function-paren-newline": () => require("./function-paren-newline"),
		"generator-star-spacing": () => require("./generator-star-spacing"),
		"getter-return": () => require("./getter-return"),
		"global-require": () => require("./global-require"),
		"grouped-accessor-pairs": () => require("./grouped-accessor-pairs"),
		"guard-for-in": () => require("./guard-for-in"),
		"handle-callback-err": () => require("./handle-callback-err"),
		"id-blacklist": () => require("./id-blacklist"),
		"id-denylist": () => require("./id-denylist"),
		"id-length": () => require("./id-length"),
		"id-match": () => require("./id-match"),
		"implicit-arrow-linebreak": () => require("./implicit-arrow-linebreak"),
		indent: () => require("./indent"),
		"indent-legacy": () => require("./indent-legacy"),
		"init-declarations": () => require("./init-declarations"),
		"jsx-quotes": () => require("./jsx-quotes"),
		"key-spacing": () => require("./key-spacing"),
		"keyword-spacing": () => require("./keyword-spacing"),
		"line-comment-position": () => require("./line-comment-position"),
		"linebreak-style": () => require("./linebreak-style"),
		"lines-around-comment": () => require("./lines-around-comment"),
		"lines-around-directive": () => require("./lines-around-directive"),
		"lines-between-class-members": () =>
			require("./lines-between-class-members"),
		"logical-assignment-operators": () =>
			require("./logical-assignment-operators"),
		"max-classes-per-file": () => require("./max-classes-per-file"),
		"max-depth": () => require("./max-depth"),
		"max-len": () => require("./max-len"),
		"max-lines": () => require("./max-lines"),
		"max-lines-per-function": () => require("./max-lines-per-function"),
		"max-nested-callbacks": () => require("./max-nested-callbacks"),
		"max-params": () => require("./max-params"),
		"max-statements": () => require("./max-statements"),
		"max-statements-per-line": () => require("./max-statements-per-line"),
		"multiline-comment-style": () => require("./multiline-comment-style"),
		"multiline-ternary": () => require("./multiline-ternary"),
		"new-cap": () => require("./new-cap"),
		"new-parens": () => require("./new-parens"),
		"newline-after-var": () => require("./newline-after-var"),
		"newline-before-return": () => require("./newline-before-return"),
		"newline-per-chained-call": () => require("./newline-per-chained-call"),
		"no-alert": () => require("./no-alert"),
		"no-array-constructor": () => require("./no-array-constructor"),
		"no-async-promise-executor": () =>
			require("./no-async-promise-executor"),
		"no-await-in-loop": () => require("./no-await-in-loop"),
		"no-bitwise": () => require("./no-bitwise"),
		"no-buffer-constructor": () => require("./no-buffer-constructor"),
		"no-caller": () => require("./no-caller"),
		"no-case-declarations": () => require("./no-case-declarations"),
		"no-catch-shadow": () => require("./no-catch-shadow"),
		"no-class-assign": () => require("./no-class-assign"),
		"no-compare-neg-zero": () => require("./no-compare-neg-zero"),
		"no-cond-assign": () => require("./no-cond-assign"),
		"no-confusing-arrow": () => require("./no-confusing-arrow"),
		"no-console": () => require("./no-console"),
		"no-const-assign": () => require("./no-const-assign"),
		"no-constant-binary-expression": () =>
			require("./no-constant-binary-expression"),
		"no-constant-condition": () => require("./no-constant-condition"),
		"no-constructor-return": () => require("./no-constructor-return"),
		"no-continue": () => require("./no-continue"),
		"no-control-regex": () => require("./no-control-regex"),
		"no-debugger": () => require("./no-debugger"),
		"no-delete-var": () => require("./no-delete-var"),
		"no-div-regex": () => require("./no-div-regex"),
		"no-dupe-args": () => require("./no-dupe-args"),
		"no-dupe-class-members": () => require("./no-dupe-class-members"),
		"no-dupe-else-if": () => require("./no-dupe-else-if"),
		"no-dupe-keys": () => require("./no-dupe-keys"),
		"no-duplicate-case": () => require("./no-duplicate-case"),
		"no-duplicate-imports": () => require("./no-duplicate-imports"),
		"no-else-return": () => require("./no-else-return"),
		"no-empty": () => require("./no-empty"),
		"no-empty-character-class": () => require("./no-empty-character-class"),
		"no-empty-function": () => require("./no-empty-function"),
		"no-empty-pattern": () => require("./no-empty-pattern"),
		"no-empty-static-block": () => require("./no-empty-static-block"),
		"no-eq-null": () => require("./no-eq-null"),
		"no-eval": () => require("./no-eval"),
		"no-ex-assign": () => require("./no-ex-assign"),
		"no-extend-native": () => require("./no-extend-native"),
		"no-extra-bind": () => require("./no-extra-bind"),
		"no-extra-boolean-cast": () => require("./no-extra-boolean-cast"),
		"no-extra-label": () => require("./no-extra-label"),
		"no-extra-parens": () => require("./no-extra-parens"),
		"no-extra-semi": () => require("./no-extra-semi"),
		"no-fallthrough": () => require("./no-fallthrough"),
		"no-floating-decimal": () => require("./no-floating-decimal"),
		"no-func-assign": () => require("./no-func-assign"),
		"no-global-assign": () => require("./no-global-assign"),
		"no-implicit-coercion": () => require("./no-implicit-coercion"),
		"no-implicit-globals": () => require("./no-implicit-globals"),
		"no-implied-eval": () => require("./no-implied-eval"),
		"no-import-assign": () => require("./no-import-assign"),
		"no-inline-comments": () => require("./no-inline-comments"),
		"no-inner-declarations": () => require("./no-inner-declarations"),
		"no-invalid-regexp": () => require("./no-invalid-regexp"),
		"no-invalid-this": () => require("./no-invalid-this"),
		"no-irregular-whitespace": () => require("./no-irregular-whitespace"),
		"no-iterator": () => require("./no-iterator"),
		"no-label-var": () => require("./no-label-var"),
		"no-labels": () => require("./no-labels"),
		"no-lone-blocks": () => require("./no-lone-blocks"),
		"no-lonely-if": () => require("./no-lonely-if"),
		"no-loop-func": () => require("./no-loop-func"),
		"no-loss-of-precision": () => require("./no-loss-of-precision"),
		"no-magic-numbers": () => require("./no-magic-numbers"),
		"no-misleading-character-class": () =>
			require("./no-misleading-character-class"),
		"no-mixed-operators": () => require("./no-mixed-operators"),
		"no-mixed-requires": () => require("./no-mixed-requires"),
		"no-mixed-spaces-and-tabs": () => require("./no-mixed-spaces-and-tabs"),
		"no-multi-assign": () => require("./no-multi-assign"),
		"no-multi-spaces": () => require("./no-multi-spaces"),
		"no-multi-str": () => require("./no-multi-str"),
		"no-multiple-empty-lines": () => require("./no-multiple-empty-lines"),
		"no-native-reassign": () => require("./no-native-reassign"),
		"no-negated-condition": () => require("./no-negated-condition"),
		"no-negated-in-lhs": () => require("./no-negated-in-lhs"),
		"no-nested-ternary": () => require("./no-nested-ternary"),
		"no-new": () => require("./no-new"),
		"no-new-func": () => require("./no-new-func"),
		"no-new-native-nonconstructor": () =>
			require("./no-new-native-nonconstructor"),
		"no-new-object": () => require("./no-new-object"),
		"no-new-require": () => require("./no-new-require"),
		"no-new-symbol": () => require("./no-new-symbol"),
		"no-new-wrappers": () => require("./no-new-wrappers"),
		"no-nonoctal-decimal-escape": () =>
			require("./no-nonoctal-decimal-escape"),
		"no-obj-calls": () => require("./no-obj-calls"),
		"no-object-constructor": () => require("./no-object-constructor"),
		"no-octal": () => require("./no-octal"),
		"no-octal-escape": () => require("./no-octal-escape"),
		"no-param-reassign": () => require("./no-param-reassign"),
		"no-path-concat": () => require("./no-path-concat"),
		"no-plusplus": () => require("./no-plusplus"),
		"no-process-env": () => require("./no-process-env"),
		"no-process-exit": () => require("./no-process-exit"),
		"no-promise-executor-return": () =>
			require("./no-promise-executor-return"),
		"no-proto": () => require("./no-proto"),
		"no-prototype-builtins": () => require("./no-prototype-builtins"),
		"no-redeclare": () => require("./no-redeclare"),
		"no-regex-spaces": () => require("./no-regex-spaces"),
		"no-restricted-exports": () => require("./no-restricted-exports"),
		"no-restricted-globals": () => require("./no-restricted-globals"),
		"no-restricted-imports": () => require("./no-restricted-imports"),
		"no-restricted-modules": () => require("./no-restricted-modules"),
		"no-restricted-properties": () => require("./no-restricted-properties"),
		"no-restricted-syntax": () => require("./no-restricted-syntax"),
		"no-return-assign": () => require("./no-return-assign"),
		"no-return-await": () => require("./no-return-await"),
		"no-script-url": () => require("./no-script-url"),
		"no-self-assign": () => require("./no-self-assign"),
		"no-self-compare": () => require("./no-self-compare"),
		"no-sequences": () => require("./no-sequences"),
		"no-setter-return": () => require("./no-setter-return"),
		"no-shadow": () => require("./no-shadow"),
		"no-shadow-restricted-names": () =>
			require("./no-shadow-restricted-names"),
		"no-spaced-func": () => require("./no-spaced-func"),
		"no-sparse-arrays": () => require("./no-sparse-arrays"),
		"no-sync": () => require("./no-sync"),
		"no-tabs": () => require("./no-tabs"),
		"no-template-curly-in-string": () =>
			require("./no-template-curly-in-string"),
		"no-ternary": () => require("./no-ternary"),
		"no-this-before-super": () => require("./no-this-before-super"),
		"no-throw-literal": () => require("./no-throw-literal"),
		"no-trailing-spaces": () => require("./no-trailing-spaces"),
		"no-unassigned-vars": () => require("./no-unassigned-vars"),
		"no-undef": () => require("./no-undef"),
		"no-undef-init": () => require("./no-undef-init"),
		"no-undefined": () => require("./no-undefined"),
		"no-underscore-dangle": () => require("./no-underscore-dangle"),
		"no-unexpected-multiline": () => require("./no-unexpected-multiline"),
		"no-unmodified-loop-condition": () =>
			require("./no-unmodified-loop-condition"),
		"no-unneeded-ternary": () => require("./no-unneeded-ternary"),
		"no-unreachable": () => require("./no-unreachable"),
		"no-unreachable-loop": () => require("./no-unreachable-loop"),
		"no-unsafe-finally": () => require("./no-unsafe-finally"),
		"no-unsafe-negation": () => require("./no-unsafe-negation"),
		"no-unsafe-optional-chaining": () =>
			require("./no-unsafe-optional-chaining"),
		"no-unused-expressions": () => require("./no-unused-expressions"),
		"no-unused-labels": () => require("./no-unused-labels"),
		"no-unused-private-class-members": () =>
			require("./no-unused-private-class-members"),
		"no-unused-vars": () => require("./no-unused-vars"),
		"no-use-before-define": () => require("./no-use-before-define"),
		"no-useless-assignment": () => require("./no-useless-assignment"),
		"no-useless-backreference": () => require("./no-useless-backreference"),
		"no-useless-call": () => require("./no-useless-call"),
		"no-useless-catch": () => require("./no-useless-catch"),
		"no-useless-computed-key": () => require("./no-useless-computed-key"),
		"no-useless-concat": () => require("./no-useless-concat"),
		"no-useless-constructor": () => require("./no-useless-constructor"),
		"no-useless-escape": () => require("./no-useless-escape"),
		"no-useless-rename": () => require("./no-useless-rename"),
		"no-useless-return": () => require("./no-useless-return"),
		"no-var": () => require("./no-var"),
		"no-void": () => require("./no-void"),
		"no-warning-comments": () => require("./no-warning-comments"),
		"no-whitespace-before-property": () =>
			require("./no-whitespace-before-property"),
		"no-with": () => require("./no-with"),
		"nonblock-statement-body-position": () =>
			require("./nonblock-statement-body-position"),
		"object-curly-newline": () => require("./object-curly-newline"),
		"object-curly-spacing": () => require("./object-curly-spacing"),
		"object-property-newline": () => require("./object-property-newline"),
		"object-shorthand": () => require("./object-shorthand"),
		"one-var": () => require("./one-var"),
		"one-var-declaration-per-line": () =>
			require("./one-var-declaration-per-line"),
		"operator-assignment": () => require("./operator-assignment"),
		"operator-linebreak": () => require("./operator-linebreak"),
		"padded-blocks": () => require("./padded-blocks"),
		"padding-line-between-statements": () =>
			require("./padding-line-between-statements"),
		"prefer-arrow-callback": () => require("./prefer-arrow-callback"),
		"prefer-const": () => require("./prefer-const"),
		"prefer-destructuring": () => require("./prefer-destructuring"),
		"prefer-exponentiation-operator": () =>
			require("./prefer-exponentiation-operator"),
		"prefer-named-capture-group": () =>
			require("./prefer-named-capture-group"),
		"prefer-numeric-literals": () => require("./prefer-numeric-literals"),
		"prefer-object-has-own": () => require("./prefer-object-has-own"),
		"prefer-object-spread": () => require("./prefer-object-spread"),
		"prefer-promise-reject-errors": () =>
			require("./prefer-promise-reject-errors"),
		"prefer-reflect": () => require("./prefer-reflect"),
		"prefer-regex-literals": () => require("./prefer-regex-literals"),
		"prefer-rest-params": () => require("./prefer-rest-params"),
		"prefer-spread": () => require("./prefer-spread"),
		"prefer-template": () => require("./prefer-template"),
		"preserve-caught-error": () => require("./preserve-caught-error"),
		"quote-props": () => require("./quote-props"),
		quotes: () => require("./quotes"),
		radix: () => require("./radix"),
		"require-atomic-updates": () => require("./require-atomic-updates"),
		"require-await": () => require("./require-await"),
		"require-unicode-regexp": () => require("./require-unicode-regexp"),
		"require-yield": () => require("./require-yield"),
		"rest-spread-spacing": () => require("./rest-spread-spacing"),
		semi: () => require("./semi"),
		"semi-spacing": () => require("./semi-spacing"),
		"semi-style": () => require("./semi-style"),
		"sort-imports": () => require("./sort-imports"),
		"sort-keys": () => require("./sort-keys"),
		"sort-vars": () => require("./sort-vars"),
		"space-before-blocks": () => require("./space-before-blocks"),
		"space-before-function-paren": () =>
			require("./space-before-function-paren"),
		"space-in-parens": () => require("./space-in-parens"),
		"space-infix-ops": () => require("./space-infix-ops"),
		"space-unary-ops": () => require("./space-unary-ops"),
		"spaced-comment": () => require("./spaced-comment"),
		strict: () => require("./strict"),
		"switch-colon-spacing": () => require("./switch-colon-spacing"),
		"symbol-description": () => require("./symbol-description"),
		"template-curly-spacing": () => require("./template-curly-spacing"),
		"template-tag-spacing": () => require("./template-tag-spacing"),
		"unicode-bom": () => require("./unicode-bom"),
		"use-isnan": () => require("./use-isnan"),
		"valid-typeof": () => require("./valid-typeof"),
		"vars-on-top": () => require("./vars-on-top"),
		"wrap-iife": () => require("./wrap-iife"),
		"wrap-regex": () => require("./wrap-regex"),
		"yield-star-spacing": () => require("./yield-star-spacing"),
		yoda: () => require("./yoda"),
	}),
);
t6x>/**
 * @fileoverview A rule to control the style of variable initializations.
 * @author Colin Ihrig
 */

"use strict";

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const CONSTANT_BINDINGS = new Set(["const", "using", "await using"]);

/**
 * Checks whether or not a given node is a for loop.
 * @param {ASTNode} block A node to check.
 * @returns {boolean} `true` when the node is a for loop.
 */
function isForLoop(block) {
	return (
		block.type === "ForInStatement" ||
		block.type === "ForOfStatement" ||
		block.type === "ForStatement"
	);
}

/**
 * Checks whether or not a given declarator node has its initializer.
 * @param {ASTNode} node A declarator node to check.
 * @returns {boolean} `true` when the node has its initializer.
 */
function isInitialized(node) {
	const declaration = node.parent;
	const block = declaration.parent;

	if (isForLoop(block)) {
		if (block.type === "ForStatement") {
			return block.init === declaration;
		}
		return block.left === declaration;
	}
	return Boolean(node.init);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Require or disallow initialization in variable declarations",
			dialects: ["JavaScript", "TypeScript"],
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/init-declarations",
		},

		schema: {
			anyOf: [
				{
					type: "array",
					items: [
						{
							enum: ["always"],
						},
					],
					minItems: 0,
					maxItems: 1,
				},
				{
					type: "array",
					items: [
						{
							enum: ["never"],
						},
						{
							type: "object",
							properties: {
								ignoreForLoopInit: {
									type: "boolean",
								},
							},
							additionalProperties: false,
						},
					],
					minItems: 0,
					maxItems: 2,
				},
			],
		},

		defaultOptions: ["always"],

		messages: {
			initialized:
				"Variable '{{idName}}' should be initialized on declaration.",
			notInitialized:
				"Variable '{{idName}}' should not be initialized on declaration.",
		},
	},

	create(context) {
		const mode = context.options[0];
		const params = context.options[1] || {};

		// Track whether we're inside a declared namespace
		let insideDeclaredNamespace = false;

		//--------------------------------------------------------------------------
		// Public API
		//--------------------------------------------------------------------------

		return {
			TSModuleDeclaration(node) {
				if (node.declare) {
					insideDeclaredNamespace = true;
				}
			},

			"TSModuleDeclaration:exit"(node) {
				if (node.declare) {
					insideDeclaredNamespace = false;
				}
			},

			"VariableDeclaration:exit"(node) {
				const kind = node.kind,
					declarations = node.declarations;

				if (node.declare || insideDeclaredNamespace) {
					return;
				}

				for (let i = 0; i < declarations.length; ++i) {
					const declaration = declarations[i],
						id = declaration.id,
						initialized = isInitialized(declaration),
						isIgnoredForLoop =
							params.ignoreForLoopInit && isForLoop(node.parent);
					let messageId = "";

					if (mode === "always" && !initialized) {
						messageId = "initialized";
					} else if (
						mode === "never" &&
						!CONSTANT_BINDINGS.has(kind) &&
						initialized &&
						!isIgnoredForLoop
					) {
						messageId = "notInitialized";
					}

					if (id.type === "Identifier" && messageId) {
						context.report({
							node: declaration,
							messageId,
							data: {
								idName: id.name,
							},
						});
					}
				}
			},
		};
	},
};
3>x*Q/**
 * @fileoverview A rule to choose between single and double quote marks
 * @author Matt DuVall <http://www.mattduvall.com/>, Brandon Payton
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Constants
//------------------------------------------------------------------------------

const QUOTE_SETTINGS = {
	double: {
		quote: '"',
		alternateQuote: "'",
		description: "doublequote",
	},
	single: {
		quote: "'",
		alternateQuote: '"',
		description: "singlequote",
	},
	backtick: {
		quote: "`",
		alternateQuote: '"',
		description: "backtick",
	},
};

// An unescaped newline is a newline preceded by an even number of backslashes.
const UNESCAPED_LINEBREAK_PATTERN = new RegExp(
	String.raw`(^|[^\\])(\\\\)*[${Array.from(astUtils.LINEBREAKS).join("")}]`,
	"u",
);

/**
 * Switches quoting of javascript string between ' " and `
 * escaping and unescaping as necessary.
 * Only escaping of the minimal set of characters is changed.
 * Note: escaping of newlines when switching from backtick to other quotes is not handled.
 * @param {string} str A string to convert.
 * @returns {string} The string with changed quotes.
 * @private
 */
QUOTE_SETTINGS.double.convert =
	QUOTE_SETTINGS.single.convert =
	QUOTE_SETTINGS.backtick.convert =
		function (str) {
			const newQuote = this.quote;
			const oldQuote = str[0];

			if (newQuote === oldQuote) {
				return str;
			}
			return (
				newQuote +
				str
					.slice(1, -1)
					.replace(
						/\\(\$\{|\r\n?|\n|.)|["'`]|\$\{|(\r\n?|\n)/gu,
						(match, escaped, newline) => {
							if (
								escaped === oldQuote ||
								(oldQuote === "`" && escaped === "${")
							) {
								return escaped; // unescape
							}
							if (
								match === newQuote ||
								(newQuote === "`" && match === "${")
							) {
								return `\\${match}`; // escape
							}
							if (newline && oldQuote === "`") {
								return "\\n"; // escape newlines
							}
							return match;
						},
					) +
				newQuote
			);
		};

const AVOID_ESCAPE = "avoid-escape";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "quotes",
						url: "https://eslint.style/rules/quotes",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description:
				"Enforce the consistent use of either backticks, double, or single quotes",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/quotes",
		},

		fixable: "code",

		schema: [
			{
				enum: ["single", "double", "backtick"],
			},
			{
				anyOf: [
					{
						enum: ["avoid-escape"],
					},
					{
						type: "object",
						properties: {
							avoidEscape: {
								type: "boolean",
							},
							allowTemplateLiterals: {
								type: "boolean",
							},
						},
						additionalProperties: false,
					},
				],
			},
		],

		messages: {
			wrongQuotes: "Strings must use {{description}}.",
		},
	},

	create(context) {
		const quoteOption = context.options[0],
			settings = QUOTE_SETTINGS[quoteOption || "double"],
			options = context.options[1],
			allowTemplateLiterals =
				options && options.allowTemplateLiterals === true,
			sourceCode = context.sourceCode;
		let avoidEscape = options && options.avoidEscape === true;

		// deprecated
		if (options === AVOID_ESCAPE) {
			avoidEscape = true;
		}

		/**
		 * Determines if a given node is part of JSX syntax.
		 *
		 * This function returns `true` in the following cases:
		 *
		 * - `<div className="foo"></div>` ... If the literal is an attribute value, the parent of the literal is `JSXAttribute`.
		 * - `<div>foo</div>` ... If the literal is a text content, the parent of the literal is `JSXElement`.
		 * - `<>foo</>` ... If the literal is a text content, the parent of the literal is `JSXFragment`.
		 *
		 * In particular, this function returns `false` in the following cases:
		 *
		 * - `<div className={"foo"}></div>`
		 * - `<div>{"foo"}</div>`
		 *
		 * In both cases, inside of the braces is handled as normal JavaScript.
		 * The braces are `JSXExpressionContainer` nodes.
		 * @param {ASTNode} node The Literal node to check.
		 * @returns {boolean} True if the node is a part of JSX, false if not.
		 * @private
		 */
		function isJSXLiteral(node) {
			return (
				node.parent.type === "JSXAttribute" ||
				node.parent.type === "JSXElement" ||
				node.parent.type === "JSXFragment"
			);
		}

		/**
		 * Checks whether or not a given node is a directive.
		 * The directive is a `ExpressionStatement` which has only a string literal not surrounded by
		 * parentheses.
		 * @param {ASTNode} node A node to check.
		 * @returns {boolean} Whether or not the node is a directive.
		 * @private
		 */
		function isDirective(node) {
			return (
				node.type === "ExpressionStatement" &&
				node.expression.type === "Literal" &&
				typeof node.expression.value === "string" &&
				!astUtils.isParenthesised(sourceCode, node.expression)
			);
		}

		/**
		 * Checks whether a specified node is either part of, or immediately follows a (possibly empty) directive prologue.
		 * @see {@link https://262.ecma-international.org/6.0/#sec-directive-prologues-and-the-use-strict-directive}
		 * @param {ASTNode} node A node to check.
		 * @returns {boolean} Whether a specified node is either part of, or immediately follows a (possibly empty) directive prologue.
		 * @private
		 */
		function isExpressionInOrJustAfterDirectivePrologue(node) {
			if (!astUtils.isTopLevelExpressionStatement(node.parent)) {
				return false;
			}
			const block = node.parent.parent;

			// Check the node is at a prologue.
			for (let i = 0; i < block.body.length; ++i) {
				const statement = block.body[i];

				if (statement === node.parent) {
					return true;
				}
				if (!isDirective(statement)) {
					break;
				}
			}

			return false;
		}

		/**
		 * Checks whether or not a given node is allowed as non backtick.
		 * @param {ASTNode} node A node to check.
		 * @returns {boolean} Whether or not the node is allowed as non backtick.
		 * @private
		 */
		function isAllowedAsNonBacktick(node) {
			const parent = node.parent;

			switch (parent.type) {
				// Directive Prologues.
				case "ExpressionStatement":
					return (
						!astUtils.isParenthesised(sourceCode, node) &&
						isExpressionInOrJustAfterDirectivePrologue(node)
					);

				// LiteralPropertyName.
				case "Property":
				case "PropertyDefinition":
				case "MethodDefinition":
					return parent.key === node && !parent.computed;

				// ModuleSpecifier.
				case "ImportDeclaration":
				case "ExportNamedDeclaration":
					return parent.source === node;

				// ModuleExportName or ModuleSpecifier.
				case "ExportAllDeclaration":
					return parent.exported === node || parent.source === node;

				// ModuleExportName.
				case "ImportSpecifier":
					return parent.imported === node;

				// ModuleExportName.
				case "ExportSpecifier":
					return parent.local === node || parent.exported === node;

				// Others don't allow.
				default:
					return false;
			}
		}

		/**
		 * Checks whether or not a given TemplateLiteral node is actually using any of the special features provided by template literal strings.
		 * @param {ASTNode} node A TemplateLiteral node to check.
		 * @returns {boolean} Whether or not the TemplateLiteral node is using any of the special features provided by template literal strings.
		 * @private
		 */
		function isUsingFeatureOfTemplateLiteral(node) {
			const hasTag =
				node.parent.type === "TaggedTemplateExpression" &&
				node === node.parent.quasi;

			if (hasTag) {
				return true;
			}

			const hasStringInterpolation = node.expressions.length > 0;

			if (hasStringInterpolation) {
				return true;
			}

			const isMultilineString =
				node.quasis.length >= 1 &&
				UNESCAPED_LINEBREAK_PATTERN.test(node.quasis[0].value.raw);

			if (isMultilineString) {
				return true;
			}

			return false;
		}

		return {
			Literal(node) {
				const val = node.value,
					rawVal = node.raw;

				if (settings && typeof val === "string") {
					let isValid =
						(quoteOption === "backtick" &&
							isAllowedAsNonBacktick(node)) ||
						isJSXLiteral(node) ||
						astUtils.isSurroundedBy(rawVal, settings.quote);

					if (!isValid && avoidEscape) {
						isValid =
							astUtils.isSurroundedBy(
								rawVal,
								settings.alternateQuote,
							) && rawVal.includes(settings.quote);
					}

					if (!isValid) {
						context.report({
							node,
							messageId: "wrongQuotes",
							data: {
								description: settings.description,
							},
							fix(fixer) {
								if (
									quoteOption === "backtick" &&
									astUtils.hasOctalOrNonOctalDecimalEscapeSequence(
										rawVal,
									)
								) {
									/*
									 * An octal or non-octal decimal escape sequence in a template literal would
									 * produce syntax error, even in non-strict mode.
									 */
									return null;
								}

								return fixer.replaceText(
									node,
									settings.convert(node.raw),
								);
							},
						});
					}
				}
			},

			TemplateLiteral(node) {
				// Don't throw an error if backticks are expected or a template literal feature is in use.
				if (
					allowTemplateLiterals ||
					quoteOption === "backtick" ||
					isUsingFeatureOfTemplateLiteral(node)
				) {
					return;
				}

				context.report({
					node,
					messageId: "wrongQuotes",
					data: {
						description: settings.description,
					},
					fix(fixer) {
						if (
							astUtils.isTopLevelExpressionStatement(
								node.parent,
							) &&
							!astUtils.isParenthesised(sourceCode, node)
						) {
							/*
							 * TemplateLiterals aren't actually directives, but fixing them might turn
							 * them into directives and change the behavior of the code.
							 */
							return null;
						}
						return fixer.replaceText(
							node,
							settings.convert(sourceCode.getText(node)),
						);
					},
				});
			},
		};
	},
};
tN<xUdensure consistent quotes used in jsx syntax.
 * @author Mathias Schreck <https://github.com/lo1tuma>"prefer-double": {
		q<bsinglequote",
		convert(str) {
			return str.replace(/'/gu, '"');
		},
	},
	"prefer-single": {
		q*=	convert(str) {
			return str.replace(/"/gu, "'");
		},
	},
}	
jsx-quotes#/rules/jsx-Iz&double or single quotes in JSX attribuKjsx-.	whitespacL"^prefer-single", "prefer-double"],
			},
		],
		messages: {
			unexpected: "Unexpected usage ofY || "prefer-double",
			setting\O];

		/**
		 * Checks if the given string literal node uses the expected quotesA string literal node"Ystring literal used the expected quotes.
		 * @public
		 */
		function usesExpectedQuotes!value.includes(setting.quote) ||
#>node.raw, setting.quote)
			);
		}

		return {
			JSXAttribute"attributeValue = node.value;

				if (
					attributeValue &&
					astUtils.isStringLiteral(attributeValue) &&
					!usesExpectedQuotes(attributeValue)
				) {
					context.report({
						node: attributeValue,
						messageId: "unexpected",
						data: {
	(.description,
						},
+%&"qattributeValue,
								setting.convert(attributeValue.raw),
							);
						},
					});
				}
			},
		};
	},
};
*p_
xR/**
 * @fileoverview Rule to specify spacing of object literal keys and values
 * @author Brandon Mills
 * @deprecated in ESLint v8.53.0
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");
const { getGraphemeCount } = require("../shared/string-utils");

/**
 * Checks whether a string contains a line terminator as defined in
 * https://262.ecma-international.org/5.1/#sec-7.3
 * @param {string} str String to test.
 * @returns {boolean} True if str contains a line terminator.
 */
function containsLineTerminator(str) {
	return astUtils.LINEBREAK_MATCHER.test(str);
}

/**
 * Gets the last element of an array.
 * @param {Array} arr An array.
 * @returns {any} Last element of arr.
 */
function last(arr) {
	return arr.at(-1);
}

/**
 * Checks whether a node is contained on a single line.
 * @param {ASTNode} node AST Node being evaluated.
 * @returns {boolean} True if the node is a single line.
 */
function isSingleLine(node) {
	return node.loc.end.line === node.loc.start.line;
}

/**
 * Checks whether the properties on a single line.
 * @param {ASTNode[]} properties List of Property AST nodes.
 * @returns {boolean} True if all properties is on a single line.
 */
function isSingleLineProperties(properties) {
	const [firstProp] = properties,
		lastProp = last(properties);

	return firstProp.loc.start.line === lastProp.loc.end.line;
}

/**
 * Initializes a single option property from the configuration with defaults for undefined values
 * @param {Object} toOptions Object to be initialized
 * @param {Object} fromOptions Object to be initialized from
 * @returns {Object} The object with correctly initialized options and values
 */
function initOptionProperty(toOptions, fromOptions) {
	toOptions.mode = fromOptions.mode || "strict";

	// Set value of beforeColon
	if (typeof fromOptions.beforeColon !== "undefined") {
		toOptions.beforeColon = +fromOptions.beforeColon;
	} else {
		toOptions.beforeColon = 0;
	}

	// Set value of afterColon
	if (typeof fromOptions.afterColon !== "undefined") {
		toOptions.afterColon = +fromOptions.afterColon;
	} else {
		toOptions.afterColon = 1;
	}

	// Set align if exists
	if (typeof fromOptions.align !== "undefined") {
		if (typeof fromOptions.align === "object") {
			toOptions.align = fromOptions.align;
		} else {
			// "string"
			toOptions.align = {
				on: fromOptions.align,
				mode: toOptions.mode,
				beforeColon: toOptions.beforeColon,
				afterColon: toOptions.afterColon,
			};
		}
	}

	return toOptions;
}

/**
 * Initializes all the option values (singleLine, multiLine and align) from the configuration with defaults for undefined values
 * @param {Object} toOptions Object to be initialized
 * @param {Object} fromOptions Object to be initialized from
 * @returns {Object} The object with correctly initialized options and values
 */
function initOptions(toOptions, fromOptions) {
	if (typeof fromOptions.align === "object") {
		// Initialize the alignment configuration
		toOptions.align = initOptionProperty({}, fromOptions.align);
		toOptions.align.on = fromOptions.align.on || "colon";
		toOptions.align.mode = fromOptions.align.mode || "strict";

		toOptions.multiLine = initOptionProperty(
			{},
			fromOptions.multiLine || fromOptions,
		);
		toOptions.singleLine = initOptionProperty(
			{},
			fromOptions.singleLine || fromOptions,
		);
	} else {
		// string or undefined
		toOptions.multiLine = initOptionProperty(
			{},
			fromOptions.multiLine || fromOptions,
		);
		toOptions.singleLine = initOptionProperty(
			{},
			fromOptions.singleLine || fromOptions,
		);

		// If alignment options are defined in multiLine, pull them out into the general align configuration
		if (toOptions.multiLine.align) {
			toOptions.align = {
				on: toOptions.multiLine.align.on,
				mode:
					toOptions.multiLine.align.mode || toOptions.multiLine.mode,
				beforeColon: toOptions.multiLine.align.beforeColon,
				afterColon: toOptions.multiLine.align.afterColon,
			};
		}
	}

	return toOptions;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "key-spacing",
						url: "https://eslint.style/rules/key-spacing",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description:
				"Enforce consistent spacing between keys and values in object literal properties",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/key-spacing",
		},

		fixable: "whitespace",

		schema: [
			{
				anyOf: [
					{
						type: "object",
						properties: {
							align: {
								anyOf: [
									{
										enum: ["colon", "value"],
									},
									{
										type: "object",
										properties: {
											mode: {
												enum: ["strict", "minimum"],
											},
											on: {
												enum: ["colon", "value"],
											},
											beforeColon: {
												type: "boolean",
											},
											afterColon: {
												type: "boolean",
											},
										},
										additionalProperties: false,
									},
								],
							},
							mode: {
								enum: ["strict", "minimum"],
							},
							beforeColon: {
								type: "boolean",
							},
							afterColon: {
								type: "boolean",
							},
						},
						additionalProperties: false,
					},
					{
						type: "object",
						properties: {
							singleLine: {
								type: "object",
								properties: {
									mode: {
										enum: ["strict", "minimum"],
									},
									beforeColon: {
										type: "boolean",
									},
									afterColon: {
										type: "boolean",
									},
								},
								additionalProperties: false,
							},
							multiLine: {
								type: "object",
								properties: {
									align: {
										anyOf: [
											{
												enum: ["colon", "value"],
											},
											{
												type: "object",
												properties: {
													mode: {
														enum: [
															"strict",
															"minimum",
														],
													},
													on: {
														enum: [
															"colon",
															"value",
														],
													},
													beforeColon: {
														type: "boolean",
													},
													afterColon: {
														type: "boolean",
													},
												},
												additionalProperties: false,
											},
										],
									},
									mode: {
										enum: ["strict", "minimum"],
									},
									beforeColon: {
										type: "boolean",
									},
									afterColon: {
										type: "boolean",
									},
								},
								additionalProperties: false,
							},
						},
						additionalProperties: false,
					},
					{
						type: "object",
						properties: {
							singleLine: {
								type: "object",
								properties: {
									mode: {
										enum: ["strict", "minimum"],
									},
									beforeColon: {
										type: "boolean",
									},
									afterColon: {
										type: "boolean",
									},
								},
								additionalProperties: false,
							},
							multiLine: {
								type: "object",
								properties: {
									mode: {
										enum: ["strict", "minimum"],
									},
									beforeColon: {
										type: "boolean",
									},
									afterColon: {
										type: "boolean",
									},
								},
								additionalProperties: false,
							},
							align: {
								type: "object",
								properties: {
									mode: {
										enum: ["strict", "minimum"],
									},
									on: {
										enum: ["colon", "value"],
									},
									beforeColon: {
										type: "boolean",
									},
									afterColon: {
										type: "boolean",
									},
								},
								additionalProperties: false,
							},
						},
						additionalProperties: false,
					},
				],
			},
		],
		messages: {
			extraKey: "Extra space after {{computed}}key '{{key}}'.",
			extraValue:
				"Extra space before value for {{computed}}key '{{key}}'.",
			missingKey: "Missing space after {{computed}}key '{{key}}'.",
			missingValue:
				"Missing space before value for {{computed}}key '{{key}}'.",
		},
	},

	create(context) {
		/**
		 * OPTIONS
		 * "key-spacing": [2, {
		 *     beforeColon: false,
		 *     afterColon: true,
		 *     align: "colon" // Optional, or "value"
		 * }
		 */
		const options = context.options[0] || {},
			ruleOptions = initOptions({}, options),
			multiLineOptions = ruleOptions.multiLine,
			singleLineOptions = ruleOptions.singleLine,
			alignmentOptions = ruleOptions.align || null;

		const sourceCode = context.sourceCode;

		/**
		 * Determines if the given property is key-value property.
		 * @param {ASTNode} property Property node to check.
		 * @returns {boolean} Whether the property is a key-value property.
		 */
		function isKeyValueProperty(property) {
			return !(
				property.method ||
				property.shorthand ||
				property.kind !== "init" ||
				property.type !== "Property" // Could be "ExperimentalSpreadProperty" or "SpreadElement"
			);
		}

		/**
		 * Starting from the given node (a property.key node here) looks forward
		 * until it finds the colon punctuator and returns it.
		 * @param {ASTNode} node The node to start looking from.
		 * @returns {ASTNode} The colon punctuator.
		 */
		function getNextColon(node) {
			return sourceCode.getTokenAfter(node, astUtils.isColonToken);
		}

		/**
		 * Starting from the given node (a property.key node here) looks forward
		 * until it finds the last token before a colon punctuator and returns it.
		 * @param {ASTNode} node The node to start looking from.
		 * @returns {ASTNode} The last token before a colon punctuator.
		 */
		function getLastTokenBeforeColon(node) {
			const colonToken = getNextColon(node);

			return sourceCode.getTokenBefore(colonToken);
		}

		/**
		 * Starting from the given node (a property.key node here) looks forward
		 * until it finds the first token after a colon punctuator and returns it.
		 * @param {ASTNode} node The node to start looking from.
		 * @returns {ASTNode} The first token after a colon punctuator.
		 */
		function getFirstTokenAfterColon(node) {
			const colonToken = getNextColon(node);

			return sourceCode.getTokenAfter(colonToken);
		}

		/**
		 * Checks whether a property is a member of the property group it follows.
		 * @param {ASTNode} lastMember The last Property known to be in the group.
		 * @param {ASTNode} candidate The next Property that might be in the group.
		 * @returns {boolean} True if the candidate property is part of the group.
		 */
		function continuesPropertyGroup(lastMember, candidate) {
			const groupEndLine = lastMember.loc.start.line,
				candidateValueStartLine = (
					isKeyValueProperty(candidate)
						? getFirstTokenAfterColon(candidate.key)
						: candidate
				).loc.start.line;

			if (candidateValueStartLine - groupEndLine <= 1) {
				return true;
			}

			/*
			 * Check that the first comment is adjacent to the end of the group, the
			 * last comment is adjacent to the candidate property, and that successive
			 * comments are adjacent to each other.
			 */
			const leadingComments = sourceCode.getCommentsBefore(candidate);

			if (
				leadingComments.length &&
				leadingComments[0].loc.start.line - groupEndLine <= 1 &&
				candidateValueStartLine - last(leadingComments).loc.end.line <=
					1
			) {
				for (let i = 1; i < leadingComments.length; i++) {
					if (
						leadingComments[i].loc.start.line -
							leadingComments[i - 1].loc.end.line >
						1
					) {
						return false;
					}
				}
				return true;
			}

			return false;
		}

		/**
		 * Gets an object literal property's key as the identifier name or string value.
		 * @param {ASTNode} property Property node whose key to retrieve.
		 * @returns {string} The property's key.
		 */
		function getKey(property) {
			const key = property.key;

			if (property.computed) {
				return sourceCode.getText().slice(key.range[0], key.range[1]);
			}
			return astUtils.getStaticPropertyName(property);
		}

		/**
		 * Reports an appropriately-formatted error if spacing is incorrect on one
		 * side of the colon.
		 * @param {ASTNode} property Key-value pair in an object literal.
		 * @param {string} side Side being verified - either "key" or "value".
		 * @param {string} whitespace Actual whitespace string.
		 * @param {number} expected Expected whitespace length.
		 * @param {string} mode Value of the mode as "strict" or "minimum"
		 * @returns {void}
		 */
		function report(property, side, whitespace, expected, mode) {
			const diff = whitespace.length - expected;

			if (
				((diff && mode === "strict") ||
					(diff < 0 && mode === "minimum") ||
					(diff > 0 && !expected && mode === "minimum")) &&
				!(expected && containsLineTerminator(whitespace))
			) {
				const nextColon = getNextColon(property.key),
					tokenBeforeColon = sourceCode.getTokenBefore(nextColon, {
						includeComments: true,
					}),
					tokenAfterColon = sourceCode.getTokenAfter(nextColon, {
						includeComments: true,
					}),
					isKeySide = side === "key",
					isExtra = diff > 0,
					diffAbs = Math.abs(diff),
					spaces = Array(diffAbs + 1).join(" ");

				const locStart = isKeySide
					? tokenBeforeColon.loc.end
					: nextColon.loc.start;
				const locEnd = isKeySide
					? nextColon.loc.start
					: tokenAfterColon.loc.start;
				const missingLoc = isKeySide
					? tokenBeforeColon.loc
					: tokenAfterColon.loc;
				const loc = isExtra
					? { start: locStart, end: locEnd }
					: missingLoc;

				let fix;

				if (isExtra) {
					let range;

					// Remove whitespace
					if (isKeySide) {
						range = [
							tokenBeforeColon.range[1],
							tokenBeforeColon.range[1] + diffAbs,
						];
					} else {
						range = [
							tokenAfterColon.range[0] - diffAbs,
							tokenAfterColon.range[0],
						];
					}
					fix = function (fixer) {
						return fixer.removeRange(range);
					};
				} else {
					// Add whitespace
					if (isKeySide) {
						fix = function (fixer) {
							return fixer.insertTextAfter(
								tokenBeforeColon,
								spaces,
							);
						};
					} else {
						fix = function (fixer) {
							return fixer.insertTextBefore(
								tokenAfterColon,
								spaces,
							);
						};
					}
				}

				let messageId;

				if (isExtra) {
					messageId = side === "key" ? "extraKey" : "extraValue";
				} else {
					messageId = side === "key" ? "missingKey" : "missingValue";
				}

				context.report({
					node: property[side],
					loc,
					messageId,
					data: {
						computed: property.computed ? "computed " : "",
						key: getKey(property),
					},
					fix,
				});
			}
		}

		/**
		 * Gets the number of characters in a key, including quotes around string
		 * keys and braces around computed property keys.
		 * @param {ASTNode} property Property of on object literal.
		 * @returns {number} Width of the key.
		 */
		function getKeyWidth(property) {
			const startToken = sourceCode.getFirstToken(property);
			const endToken = getLastTokenBeforeColon(property.key);

			return getGraphemeCount(
				sourceCode
					.getText()
					.slice(startToken.range[0], endToken.range[1]),
			);
		}

		/**
		 * Gets the whitespace around the colon in an object literal property.
		 * @param {ASTNode} property Property node from an object literal.
		 * @returns {Object} Whitespace before and after the property's colon.
		 */
		function getPropertyWhitespace(property) {
			const whitespace = /(\s*):(\s*)/u.exec(
				sourceCode
					.getText()
					.slice(property.key.range[1], property.value.range[0]),
			);

			if (whitespace) {
				return {
					beforeColon: whitespace[1],
					afterColon: whitespace[2],
				};
			}
			return null;
		}

		/**
		 * Creates groups of properties.
		 * @param {ASTNode} node ObjectExpression node being evaluated.
		 * @returns {Array<ASTNode[]>} Groups of property AST node lists.
		 */
		function createGroups(node) {
			if (node.properties.length === 1) {
				return [node.properties];
			}

			return node.properties.reduce(
				(groups, property) => {
					const currentGroup = last(groups),
						prev = last(currentGroup);

					if (!prev || continuesPropertyGroup(prev, property)) {
						currentGroup.push(property);
					} else {
						groups.push([property]);
					}

					return groups;
				},
				[[]],
			);
		}

		/**
		 * Verifies correct vertical alignment of a group of properties.
		 * @param {ASTNode[]} properties List of Property AST nodes.
		 * @returns {void}
		 */
		function verifyGroupAlignment(properties) {
			const length = properties.length,
				widths = properties.map(getKeyWidth), // Width of keys, including quotes
				align = alignmentOptions.on; // "value" or "colon"
			let targetWidth = Math.max(...widths),
				beforeColon,
				afterColon,
				mode;

			if (alignmentOptions && length > 1) {
				// When aligning values within a group, use the alignment configuration.
				beforeColon = alignmentOptions.beforeColon;
				afterColon = alignmentOptions.afterColon;
				mode = alignmentOptions.mode;
			} else {
				beforeColon = multiLineOptions.beforeColon;
				afterColon = multiLineOptions.afterColon;
				mode = alignmentOptions.mode;
			}

			// Conditionally include one space before or after colon
			targetWidth += align === "colon" ? beforeColon : afterColon;

			for (let i = 0; i < length; i++) {
				const property = properties[i];
				const whitespace = getPropertyWhitespace(property);

				if (whitespace) {
					// Object literal getters/setters lack a colon
					const width = widths[i];

					if (align === "value") {
						report(
							property,
							"key",
							whitespace.beforeColon,
							beforeColon,
							mode,
						);
						report(
							property,
							"value",
							whitespace.afterColon,
							targetWidth - width,
							mode,
						);
					} else {
						// align = "colon"
						report(
							property,
							"key",
							whitespace.beforeColon,
							targetWidth - width,
							mode,
						);
						report(
							property,
							"value",
							whitespace.afterColon,
							afterColon,
							mode,
						);
					}
				}
			}
		}

		/**
		 * Verifies spacing of property conforms to specified options.
		 * @param {ASTNode} node Property node being evaluated.
		 * @param {Object} lineOptions Configured singleLine or multiLine options
		 * @returns {void}
		 */
		function verifySpacing(node, lineOptions) {
			const actual = getPropertyWhitespace(node);

			if (actual) {
				// Object literal getters/setters lack colons
				report(
					node,
					"key",
					actual.beforeColon,
					lineOptions.beforeColon,
					lineOptions.mode,
				);
				report(
					node,
					"value",
					actual.afterColon,
					lineOptions.afterColon,
					lineOptions.mode,
				);
			}
		}

		/**
		 * Verifies spacing of each property in a list.
		 * @param {ASTNode[]} properties List of Property AST nodes.
		 * @param {Object} lineOptions Configured singleLine or multiLine options
		 * @returns {void}
		 */
		function verifyListSpacing(properties, lineOptions) {
			const length = properties.length;

			for (let i = 0; i < length; i++) {
				verifySpacing(properties[i], lineOptions);
			}
		}

		/**
		 * Verifies vertical alignment, taking into account groups of properties.
		 * @param {ASTNode} node ObjectExpression node being evaluated.
		 * @returns {void}
		 */
		function verifyAlignment(node) {
			createGroups(node).forEach(group => {
				const properties = group.filter(isKeyValueProperty);

				if (
					properties.length > 0 &&
					isSingleLineProperties(properties)
				) {
					verifyListSpacing(properties, multiLineOptions);
				} else {
					verifyGroupAlignment(properties);
				}
			});
		}

		//--------------------------------------------------------------------------
		// Public API
		//--------------------------------------------------------------------------

		if (alignmentOptions) {
			// Verify vertical alignment

			return {
				ObjectExpression(node) {
					if (isSingleLine(node)) {
						verifyListSpacing(
							node.properties.filter(isKeyValueProperty),
							singleLineOptions,
						);
					} else {
						verifyAlignment(node);
					}
				},
			};
		}

		// Obey beforeColon and afterColon in each property as configured
		return {
			Property(node) {
				verifySpacing(
					node,
					isSingleLine(node.parent)
						? singleLineOptions
						: multiLineOptions,
				);
			},
		};
	},
};
9ZAǹ	xOV/**
 * @fileoverview Rule to enforce spacing before and after keywords.
 * @author Toru Nagashima
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils"),
	keywords = require("./utils/keywords");

//------------------------------------------------------------------------------
// Constants
//------------------------------------------------------------------------------

const PREV_TOKEN = /^[)\]}>]$/u;
const NEXT_TOKEN = /^(?:[([{<~!]|\+\+?|--?)$/u;
const PREV_TOKEN_M = /^[)\]}>*]$/u;
const NEXT_TOKEN_M = /^[{*]$/u;
const TEMPLATE_OPEN_PAREN = /\$\{$/u;
const TEMPLATE_CLOSE_PAREN = /^\}/u;
const CHECK_TYPE =
	/^(?:JSXElement|RegularExpression|String|Template|PrivateIdentifier)$/u;
const KEYS = keywords.concat([
	"as",
	"async",
	"await",
	"from",
	"get",
	"let",
	"of",
	"set",
	"yield",
]);

// check duplications.
(function () {
	KEYS.sort();
	for (let i = 1; i < KEYS.length; ++i) {
		if (KEYS[i] === KEYS[i - 1]) {
			throw new Error(
				`Duplication was found in the keyword list: ${KEYS[i]}`,
			);
		}
	}
})();

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Checks whether or not a given token is a "Template" token ends with "${".
 * @param {Token} token A token to check.
 * @returns {boolean} `true` if the token is a "Template" token ends with "${".
 */
function isOpenParenOfTemplate(token) {
	return token.type === "Template" && TEMPLATE_OPEN_PAREN.test(token.value);
}

/**
 * Checks whether or not a given token is a "Template" token starts with "}".
 * @param {Token} token A token to check.
 * @returns {boolean} `true` if the token is a "Template" token starts with "}".
 */
function isCloseParenOfTemplate(token) {
	return token.type === "Template" && TEMPLATE_CLOSE_PAREN.test(token.value);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "keyword-spacing",
						url: "https://eslint.style/rules/keyword-spacing",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Enforce consistent spacing before and after keywords",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/keyword-spacing",
		},

		fixable: "whitespace",

		schema: [
			{
				type: "object",
				properties: {
					before: { type: "boolean", default: true },
					after: { type: "boolean", default: true },
					overrides: {
						type: "object",
						properties: KEYS.reduce((retv, key) => {
							retv[key] = {
								type: "object",
								properties: {
									before: { type: "boolean" },
									after: { type: "boolean" },
								},
								additionalProperties: false,
							};
							return retv;
						}, {}),
						additionalProperties: false,
					},
				},
				additionalProperties: false,
			},
		],
		messages: {
			expectedBefore: 'Expected space(s) before "{{value}}".',
			expectedAfter: 'Expected space(s) after "{{value}}".',
			unexpectedBefore: 'Unexpected space(s) before "{{value}}".',
			unexpectedAfter: 'Unexpected space(s) after "{{value}}".',
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		const tokensToIgnore = new WeakSet();

		/**
		 * Reports a given token if there are not space(s) before the token.
		 * @param {Token} token A token to report.
		 * @param {RegExp} pattern A pattern of the previous token to check.
		 * @returns {void}
		 */
		function expectSpaceBefore(token, pattern) {
			const prevToken = sourceCode.getTokenBefore(token);

			if (
				prevToken &&
				(CHECK_TYPE.test(prevToken.type) ||
					pattern.test(prevToken.value)) &&
				!isOpenParenOfTemplate(prevToken) &&
				!tokensToIgnore.has(prevToken) &&
				astUtils.isTokenOnSameLine(prevToken, token) &&
				!sourceCode.isSpaceBetween(prevToken, token)
			) {
				context.report({
					loc: token.loc,
					messageId: "expectedBefore",
					data: token,
					fix(fixer) {
						return fixer.insertTextBefore(token, " ");
					},
				});
			}
		}

		/**
		 * Reports a given token if there are space(s) before the token.
		 * @param {Token} token A token to report.
		 * @param {RegExp} pattern A pattern of the previous token to check.
		 * @returns {void}
		 */
		function unexpectSpaceBefore(token, pattern) {
			const prevToken = sourceCode.getTokenBefore(token);

			if (
				prevToken &&
				(CHECK_TYPE.test(prevToken.type) ||
					pattern.test(prevToken.value)) &&
				!isOpenParenOfTemplate(prevToken) &&
				!tokensToIgnore.has(prevToken) &&
				astUtils.isTokenOnSameLine(prevToken, token) &&
				sourceCode.isSpaceBetween(prevToken, token)
			) {
				context.report({
					loc: { start: prevToken.loc.end, end: token.loc.start },
					messageId: "unexpectedBefore",
					data: token,
					fix(fixer) {
						return fixer.removeRange([
							prevToken.range[1],
							token.range[0],
						]);
					},
				});
			}
		}

		/**
		 * Reports a given token if there are not space(s) after the token.
		 * @param {Token} token A token to report.
		 * @param {RegExp} pattern A pattern of the next token to check.
		 * @returns {void}
		 */
		function expectSpaceAfter(token, pattern) {
			const nextToken = sourceCode.getTokenAfter(token);

			if (
				nextToken &&
				(CHECK_TYPE.test(nextToken.type) ||
					pattern.test(nextToken.value)) &&
				!isCloseParenOfTemplate(nextToken) &&
				!tokensToIgnore.has(nextToken) &&
				astUtils.isTokenOnSameLine(token, nextToken) &&
				!sourceCode.isSpaceBetween(token, nextToken)
			) {
				context.report({
					loc: token.loc,
					messageId: "expectedAfter",
					data: token,
					fix(fixer) {
						return fixer.insertTextAfter(token, " ");
					},
				});
			}
		}

		/**
		 * Reports a given token if there are space(s) after the token.
		 * @param {Token} token A token to report.
		 * @param {RegExp} pattern A pattern of the next token to check.
		 * @returns {void}
		 */
		function unexpectSpaceAfter(token, pattern) {
			const nextToken = sourceCode.getTokenAfter(token);

			if (
				nextToken &&
				(CHECK_TYPE.test(nextToken.type) ||
					pattern.test(nextToken.value)) &&
				!isCloseParenOfTemplate(nextToken) &&
				!tokensToIgnore.has(nextToken) &&
				astUtils.isTokenOnSameLine(token, nextToken) &&
				sourceCode.isSpaceBetween(token, nextToken)
			) {
				context.report({
					loc: { start: token.loc.end, end: nextToken.loc.start },
					messageId: "unexpectedAfter",
					data: token,
					fix(fixer) {
						return fixer.removeRange([
							token.range[1],
							nextToken.range[0],
						]);
					},
				});
			}
		}

		/**
		 * Parses the option object and determines check methods for each keyword.
		 * @param {Object|undefined} options The option object to parse.
		 * @returns {Object} - Normalized option object.
		 *      Keys are keywords (there are for every keyword).
		 *      Values are instances of `{"before": function, "after": function}`.
		 */
		function parseOptions(options = {}) {
			const before = options.before !== false;
			const after = options.after !== false;
			const defaultValue = {
				before: before ? expectSpaceBefore : unexpectSpaceBefore,
				after: after ? expectSpaceAfter : unexpectSpaceAfter,
			};
			const overrides = (options && options.overrides) || {};
			const retv = Object.create(null);

			for (let i = 0; i < KEYS.length; ++i) {
				const key = KEYS[i];
				const override = overrides[key];

				if (override) {
					const thisBefore =
						"before" in override ? override.before : before;
					const thisAfter =
						"after" in override ? override.after : after;

					retv[key] = {
						before: thisBefore
							? expectSpaceBefore
							: unexpectSpaceBefore,
						after: thisAfter
							? expectSpaceAfter
							: unexpectSpaceAfter,
					};
				} else {
					retv[key] = defaultValue;
				}
			}

			return retv;
		}

		const checkMethodMap = parseOptions(context.options[0]);

		/**
		 * Reports a given token if usage of spacing followed by the token is
		 * invalid.
		 * @param {Token} token A token to report.
		 * @param {RegExp} [pattern] Optional. A pattern of the previous
		 *      token to check.
		 * @returns {void}
		 */
		function checkSpacingBefore(token, pattern) {
			checkMethodMap[token.value].before(token, pattern || PREV_TOKEN);
		}

		/**
		 * Reports a given token if usage of spacing preceded by the token is
		 * invalid.
		 * @param {Token} token A token to report.
		 * @param {RegExp} [pattern] Optional. A pattern of the next
		 *      token to check.
		 * @returns {void}
		 */
		function checkSpacingAfter(token, pattern) {
			checkMethodMap[token.value].after(token, pattern || NEXT_TOKEN);
		}

		/**
		 * Reports a given token if usage of spacing around the token is invalid.
		 * @param {Token} token A token to report.
		 * @returns {void}
		 */
		function checkSpacingAround(token) {
			checkSpacingBefore(token);
			checkSpacingAfter(token);
		}

		/**
		 * Reports the first token of a given node if the first token is a keyword
		 * and usage of spacing around the token is invalid.
		 * @param {ASTNode|null} node A node to report.
		 * @returns {void}
		 */
		function checkSpacingAroundFirstToken(node) {
			const firstToken = node && sourceCode.getFirstToken(node);

			if (firstToken && firstToken.type === "Keyword") {
				checkSpacingAround(firstToken);
			}
		}

		/**
		 * Reports the first token of a given node if the first token is a keyword
		 * and usage of spacing followed by the token is invalid.
		 *
		 * This is used for unary operators (e.g. `typeof`), `function`, and `super`.
		 * Other rules are handling usage of spacing preceded by those keywords.
		 * @param {ASTNode|null} node A node to report.
		 * @returns {void}
		 */
		function checkSpacingBeforeFirstToken(node) {
			const firstToken = node && sourceCode.getFirstToken(node);

			if (firstToken && firstToken.type === "Keyword") {
				checkSpacingBefore(firstToken);
			}
		}

		/**
		 * Reports the previous token of a given node if the token is a keyword and
		 * usage of spacing around the token is invalid.
		 * @param {ASTNode|null} node A node to report.
		 * @returns {void}
		 */
		function checkSpacingAroundTokenBefore(node) {
			if (node) {
				const token = sourceCode.getTokenBefore(
					node,
					astUtils.isKeywordToken,
				);

				checkSpacingAround(token);
			}
		}

		/**
		 * Reports `async` or `function` keywords of a given node if usage of
		 * spacing around those keywords is invalid.
		 * @param {ASTNode} node A node to report.
		 * @returns {void}
		 */
		function checkSpacingForFunction(node) {
			const firstToken = node && sourceCode.getFirstToken(node);

			if (
				firstToken &&
				((firstToken.type === "Keyword" &&
					firstToken.value === "function") ||
					firstToken.value === "async")
			) {
				checkSpacingBefore(firstToken);
			}
		}

		/**
		 * Reports `class` and `extends` keywords of a given node if usage of
		 * spacing around those keywords is invalid.
		 * @param {ASTNode} node A node to report.
		 * @returns {void}
		 */
		function checkSpacingForClass(node) {
			checkSpacingAroundFirstToken(node);
			checkSpacingAroundTokenBefore(node.superClass);
		}

		/**
		 * Reports `if` and `else` keywords of a given node if usage of spacing
		 * around those keywords is invalid.
		 * @param {ASTNode} node A node to report.
		 * @returns {void}
		 */
		function checkSpacingForIfStatement(node) {
			checkSpacingAroundFirstToken(node);
			checkSpacingAroundTokenBefore(node.alternate);
		}

		/**
		 * Reports `try`, `catch`, and `finally` keywords of a given node if usage
		 * of spacing around those keywords is invalid.
		 * @param {ASTNode} node A node to report.
		 * @returns {void}
		 */
		function checkSpacingForTryStatement(node) {
			checkSpacingAroundFirstToken(node);
			checkSpacingAroundFirstToken(node.handler);
			checkSpacingAroundTokenBefore(node.finalizer);
		}

		/**
		 * Reports `do` and `while` keywords of a given node if usage of spacing
		 * around those keywords is invalid.
		 * @param {ASTNode} node A node to report.
		 * @returns {void}
		 */
		function checkSpacingForDoWhileStatement(node) {
			checkSpacingAroundFirstToken(node);
			checkSpacingAroundTokenBefore(node.test);
		}

		/**
		 * Reports `for` and `in` keywords of a given node if usage of spacing
		 * around those keywords is invalid.
		 * @param {ASTNode} node A node to report.
		 * @returns {void}
		 */
		function checkSpacingForForInStatement(node) {
			checkSpacingAroundFirstToken(node);

			const inToken = sourceCode.getTokenBefore(
				node.right,
				astUtils.isNotOpeningParenToken,
			);
			const previousToken = sourceCode.getTokenBefore(inToken);

			if (previousToken.type !== "PrivateIdentifier") {
				checkSpacingBefore(inToken);
			}

			checkSpacingAfter(inToken);
		}

		/**
		 * Reports `for` and `of` keywords of a given node if usage of spacing
		 * around those keywords is invalid.
		 * @param {ASTNode} node A node to report.
		 * @returns {void}
		 */
		function checkSpacingForForOfStatement(node) {
			if (node.await) {
				checkSpacingBefore(sourceCode.getFirstToken(node, 0));
				checkSpacingAfter(sourceCode.getFirstToken(node, 1));
			} else {
				checkSpacingAroundFirstToken(node);
			}

			const ofToken = sourceCode.getTokenBefore(
				node.right,
				astUtils.isNotOpeningParenToken,
			);
			const previousToken = sourceCode.getTokenBefore(ofToken);

			if (previousToken.type !== "PrivateIdentifier") {
				checkSpacingBefore(ofToken);
			}

			checkSpacingAfter(ofToken);
		}

		/**
		 * Reports `import`, `export`, `as`, and `from` keywords of a given node if
		 * usage of spacing around those keywords is invalid.
		 *
		 * This rule handles the `*` token in module declarations.
		 *
		 *     import*as A from "./a"; /*error Expected space(s) after "import".
		 *                               error Expected space(s) before "as".
		 * @param {ASTNode} node A node to report.
		 * @returns {void}
		 */
		function checkSpacingForModuleDeclaration(node) {
			const firstToken = sourceCode.getFirstToken(node);

			checkSpacingBefore(firstToken, PREV_TOKEN_M);
			checkSpacingAfter(firstToken, NEXT_TOKEN_M);

			if (node.type === "ExportDefaultDeclaration") {
				checkSpacingAround(sourceCode.getTokenAfter(firstToken));
			}

			if (node.type === "ExportAllDeclaration" && node.exported) {
				const asToken = sourceCode.getTokenBefore(node.exported);

				checkSpacingBefore(asToken, PREV_TOKEN_M);
				checkSpacingAfter(asToken, NEXT_TOKEN_M);
			}

			if (node.source) {
				const fromToken = sourceCode.getTokenBefore(node.source);

				checkSpacingBefore(fromToken, PREV_TOKEN_M);
				checkSpacingAfter(fromToken, NEXT_TOKEN_M);
			}
		}

		/**
		 * Reports `as` keyword of a given node if usage of spacing around this
		 * keyword is invalid.
		 * @param {ASTNode} node An `ImportSpecifier` node to check.
		 * @returns {void}
		 */
		function checkSpacingForImportSpecifier(node) {
			if (node.imported.range[0] !== node.local.range[0]) {
				const asToken = sourceCode.getTokenBefore(node.local);

				checkSpacingBefore(asToken, PREV_TOKEN_M);
			}
		}

		/**
		 * Reports `as` keyword of a given node if usage of spacing around this
		 * keyword is invalid.
		 * @param {ASTNode} node An `ExportSpecifier` node to check.
		 * @returns {void}
		 */
		function checkSpacingForExportSpecifier(node) {
			if (node.local.range[0] !== node.exported.range[0]) {
				const asToken = sourceCode.getTokenBefore(node.exported);

				checkSpacingBefore(asToken, PREV_TOKEN_M);
				checkSpacingAfter(asToken, NEXT_TOKEN_M);
			}
		}

		/**
		 * Reports `as` keyword of a given node if usage of spacing around this
		 * keyword is invalid.
		 * @param {ASTNode} node A node to report.
		 * @returns {void}
		 */
		function checkSpacingForImportNamespaceSpecifier(node) {
			const asToken = sourceCode.getFirstToken(node, 1);

			checkSpacingBefore(asToken, PREV_TOKEN_M);
		}

		/**
		 * Reports `static`, `get`, and `set` keywords of a given node if usage of
		 * spacing around those keywords is invalid.
		 * @param {ASTNode} node A node to report.
		 * @throws {Error} If unable to find token get, set, or async beside method name.
		 * @returns {void}
		 */
		function checkSpacingForProperty(node) {
			if (node.static) {
				checkSpacingAroundFirstToken(node);
			}
			if (
				node.kind === "get" ||
				node.kind === "set" ||
				((node.method || node.type === "MethodDefinition") &&
					node.value.async)
			) {
				const token = sourceCode.getTokenBefore(node.key, tok => {
					switch (tok.value) {
						case "get":
						case "set":
						case "async":
							return true;
						default:
							return false;
					}
				});

				if (!token) {
					throw new Error(
						"Failed to find token get, set, or async beside method name",
					);
				}

				checkSpacingAround(token);
			}
		}

		/**
		 * Reports `await` keyword of a given node if usage of spacing before
		 * this keyword is invalid.
		 * @param {ASTNode} node A node to report.
		 * @returns {void}
		 */
		function checkSpacingForAwaitExpression(node) {
			checkSpacingBefore(sourceCode.getFirstToken(node));
		}

		return {
			// Statements
			DebuggerStatement: checkSpacingAroundFirstToken,
			WithStatement: checkSpacingAroundFirstToken,

			// Statements - Control flow
			BreakStatement: checkSpacingAroundFirstToken,
			ContinueStatement: checkSpacingAroundFirstToken,
			ReturnStatement: checkSpacingAroundFirstToken,
			ThrowStatement: checkSpacingAroundFirstToken,
			TryStatement: checkSpacingForTryStatement,

			// Statements - Choice
			IfStatement: checkSpacingForIfStatement,
			SwitchStatement: checkSpacingAroundFirstToken,
			SwitchCase: checkSpacingAroundFirstToken,

			// Statements - Loops
			DoWhileStatement: checkSpacingForDoWhileStatement,
			ForInStatement: checkSpacingForForInStatement,
			ForOfStatement: checkSpacingForForOfStatement,
			ForStatement: checkSpacingAroundFirstToken,
			WhileStatement: checkSpacingAroundFirstToken,

			// Statements - Declarations
			ClassDeclaration: checkSpacingForClass,
			ExportNamedDeclaration: checkSpacingForModuleDeclaration,
			ExportDefaultDeclaration: checkSpacingForModuleDeclaration,
			ExportAllDeclaration: checkSpacingForModuleDeclaration,
			FunctionDeclaration: checkSpacingForFunction,
			ImportDeclaration: checkSpacingForModuleDeclaration,
			VariableDeclaration: checkSpacingAroundFirstToken,

			// Expressions
			ArrowFunctionExpression: checkSpacingForFunction,
			AwaitExpression: checkSpacingForAwaitExpression,
			ClassExpression: checkSpacingForClass,
			FunctionExpression: checkSpacingForFunction,
			NewExpression: checkSpacingBeforeFirstToken,
			Super: checkSpacingBeforeFirstToken,
			ThisExpression: checkSpacingBeforeFirstToken,
			UnaryExpression: checkSpacingBeforeFirstToken,
			YieldExpression: checkSpacingBeforeFirstToken,

			// Others
			ImportSpecifier: checkSpacingForImportSpecifier,
			ExportSpecifier: checkSpacingForExportSpecifier,
			ImportNamespaceSpecifier: checkSpacingForImportNamespaceSpecifier,
			MethodDefinition: checkSpacingForProperty,
			PropertyDefinition: checkSpacingForProperty,
			StaticBlock: checkSpacingAroundFirstToken,
			Property: checkSpacingForProperty,

			// To avoid conflicts with `space-infix-ops`, e.g. `a > this.b`
			"BinaryExpression[operator='>']"(node) {
				const operatorToken = sourceCode.getTokenBefore(
					node.right,
					astUtils.isNotOpeningParenToken,
				);

				tokensToIgnore.add(operatorToken);
			},
		};
	},
};
2͸xg/**
 * @fileoverview Rule to enforce the position of line comments
 * @author Alberto Rodríguez
 * @deprecated in ESLint v9.3.0
 */
"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "9.3.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "line-comment-position",
						url: "https://eslint.style/rules/line-comment-position",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Enforce position of line comments",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/line-comment-position",
		},

		schema: [
			{
				oneOf: [
					{
						enum: ["above", "beside"],
					},
					{
						type: "object",
						properties: {
							position: {
								enum: ["above", "beside"],
							},
							ignorePattern: {
								type: "string",
							},
							applyDefaultPatterns: {
								type: "boolean",
							},
							applyDefaultIgnorePatterns: {
								type: "boolean",
							},
						},
						additionalProperties: false,
					},
				],
			},
		],
		messages: {
			above: "Expected comment to be above code.",
			beside: "Expected comment to be beside code.",
		},
	},

	create(context) {
		const options = context.options[0];

		let above,
			ignorePattern,
			applyDefaultIgnorePatterns = true;

		if (!options || typeof options === "string") {
			above = !options || options === "above";
		} else {
			above = !options.position || options.position === "above";
			ignorePattern = options.ignorePattern;

			if (Object.hasOwn(options, "applyDefaultIgnorePatterns")) {
				applyDefaultIgnorePatterns = options.applyDefaultIgnorePatterns;
			} else {
				applyDefaultIgnorePatterns =
					options.applyDefaultPatterns !== false;
			}
		}

		const defaultIgnoreRegExp = astUtils.COMMENTS_IGNORE_PATTERN;
		const fallThroughRegExp = /^\s*falls?\s?through/u;
		const customIgnoreRegExp = new RegExp(ignorePattern, "u");
		const sourceCode = context.sourceCode;

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			Program() {
				const comments = sourceCode.getAllComments();

				comments
					.filter(token => token.type === "Line")
					.forEach(node => {
						if (
							applyDefaultIgnorePatterns &&
							(defaultIgnoreRegExp.test(node.value) ||
								fallThroughRegExp.test(node.value))
						) {
							return;
						}

						if (
							ignorePattern &&
							customIgnoreRegExp.test(node.value)
						) {
							return;
						}

						const previous = sourceCode.getTokenBefore(node, {
							includeComments: true,
						});
						const isOnSameLine =
							previous &&
							previous.loc.end.line === node.loc.start.line;

						if (above) {
							if (isOnSameLine) {
								context.report({
									node,
									messageId: "above",
								});
							}
						} else {
							if (!isOnSameLine) {
								context.report({
									node,
									messageId: "beside",
								});
							}
						}
					});
			},
		};
	},
};
^x/**
 * @fileoverview Rule to enforce a single linebreak style.
 * @author Erik Mueller
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------

/**
 * @import { SourceRange } from "@eslint/core";
 */

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "linebreak-style",
						url: "https://eslint.style/rules/linebreak-style",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Enforce consistent linebreak style",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/linebreak-style",
		},

		fixable: "whitespace",

		schema: [
			{
				enum: ["unix", "windows"],
			},
		],
		messages: {
			expectedLF: "Expected linebreaks to be 'LF' but found 'CRLF'.",
			expectedCRLF: "Expected linebreaks to be 'CRLF' but found 'LF'.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Builds a fix function that replaces text at the specified range in the source text.
		 * @param {SourceRange} range The range to replace
		 * @param {string} text The text to insert.
		 * @returns {Function} Fixer function
		 * @private
		 */
		function createFix(range, text) {
			return function (fixer) {
				return fixer.replaceTextRange(range, text);
			};
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			Program: function checkForLinebreakStyle(node) {
				const linebreakStyle = context.options[0] || "unix",
					expectedLF = linebreakStyle === "unix",
					expectedLFChars = expectedLF ? "\n" : "\r\n",
					source = sourceCode.getText(),
					pattern = astUtils.createGlobalLinebreakMatcher();
				let match;

				let i = 0;

				while ((match = pattern.exec(source)) !== null) {
					i++;
					if (match[0] === expectedLFChars) {
						continue;
					}

					const index = match.index;
					const range = [index, index + match[0].length];

					context.report({
						node,
						loc: {
							start: {
								line: i,
								column: sourceCode.lines[i - 1].length,
							},
							end: {
								line: i + 1,
								column: 0,
							},
						},
						messageId: expectedLF ? "expectedLF" : "expectedCRLF",
						fix: createFix(range, expectedLFChars),
					});
				}
			},
		};
	},
};
%x<v/**
 * @fileoverview Enforces empty lines around comments.
 * @author Jamund Ferguson
 * @deprecated in ESLint v8.53.0
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Return an array with any line numbers that are empty.
 * @param {Array} lines An array of each line of the file.
 * @returns {Array} An array of line numbers.
 */
function getEmptyLineNums(lines) {
	const emptyLines = lines
		.map((line, i) => ({
			code: line.trim(),
			num: i + 1,
		}))
		.filter(line => !line.code)
		.map(line => line.num);

	return emptyLines;
}

/**
 * Return an array with any line numbers that contain comments.
 * @param {Array} comments An array of comment tokens.
 * @returns {Array} An array of line numbers.
 */
function getCommentLineNums(comments) {
	const lines = [];

	comments.forEach(token => {
		const start = token.loc.start.line;
		const end = token.loc.end.line;

		lines.push(start, end);
	});
	return lines;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "lines-around-comment",
						url: "https://eslint.style/rules/lines-around-comment",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Require empty lines around comments",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/lines-around-comment",
		},

		fixable: "whitespace",

		schema: [
			{
				type: "object",
				properties: {
					beforeBlockComment: {
						type: "boolean",
						default: true,
					},
					afterBlockComment: {
						type: "boolean",
						default: false,
					},
					beforeLineComment: {
						type: "boolean",
						default: false,
					},
					afterLineComment: {
						type: "boolean",
						default: false,
					},
					allowBlockStart: {
						type: "boolean",
						default: false,
					},
					allowBlockEnd: {
						type: "boolean",
						default: false,
					},
					allowClassStart: {
						type: "boolean",
					},
					allowClassEnd: {
						type: "boolean",
					},
					allowObjectStart: {
						type: "boolean",
					},
					allowObjectEnd: {
						type: "boolean",
					},
					allowArrayStart: {
						type: "boolean",
					},
					allowArrayEnd: {
						type: "boolean",
					},
					ignorePattern: {
						type: "string",
					},
					applyDefaultIgnorePatterns: {
						type: "boolean",
					},
					afterHashbangComment: {
						type: "boolean",
						default: false,
					},
				},
				additionalProperties: false,
			},
		],
		messages: {
			after: "Expected line after comment.",
			before: "Expected line before comment.",
		},
	},

	create(context) {
		const options = Object.assign({}, context.options[0]);
		const ignorePattern = options.ignorePattern;
		const defaultIgnoreRegExp = astUtils.COMMENTS_IGNORE_PATTERN;
		const customIgnoreRegExp = new RegExp(ignorePattern, "u");
		const applyDefaultIgnorePatterns =
			options.applyDefaultIgnorePatterns !== false;

		options.beforeBlockComment =
			typeof options.beforeBlockComment !== "undefined"
				? options.beforeBlockComment
				: true;

		const sourceCode = context.sourceCode;

		const lines = sourceCode.lines,
			numLines = lines.length + 1,
			comments = sourceCode.getAllComments(),
			commentLines = getCommentLineNums(comments),
			emptyLines = getEmptyLineNums(lines),
			commentAndEmptyLines = new Set(commentLines.concat(emptyLines));

		/**
		 * Returns whether or not comments are on lines starting with or ending with code
		 * @param {token} token The comment token to check.
		 * @returns {boolean} True if the comment is not alone.
		 */
		function codeAroundComment(token) {
			let currentToken = token;

			do {
				currentToken = sourceCode.getTokenBefore(currentToken, {
					includeComments: true,
				});
			} while (currentToken && astUtils.isCommentToken(currentToken));

			if (
				currentToken &&
				astUtils.isTokenOnSameLine(currentToken, token)
			) {
				return true;
			}

			currentToken = token;
			do {
				currentToken = sourceCode.getTokenAfter(currentToken, {
					includeComments: true,
				});
			} while (currentToken && astUtils.isCommentToken(currentToken));

			if (
				currentToken &&
				astUtils.isTokenOnSameLine(token, currentToken)
			) {
				return true;
			}

			return false;
		}

		/**
		 * Returns whether or not comments are inside a node type or not.
		 * @param {ASTNode} parent The Comment parent node.
		 * @param {string} nodeType The parent type to check against.
		 * @returns {boolean} True if the comment is inside nodeType.
		 */
		function isParentNodeType(parent, nodeType) {
			return (
				parent.type === nodeType ||
				(parent.body && parent.body.type === nodeType) ||
				(parent.consequent && parent.consequent.type === nodeType)
			);
		}

		/**
		 * Returns the parent node that contains the given token.
		 * @param {token} token The token to check.
		 * @returns {ASTNode|null} The parent node that contains the given token.
		 */
		function getParentNodeOfToken(token) {
			const node = sourceCode.getNodeByRangeIndex(token.range[0]);

			/*
			 * For the purpose of this rule, the comment token is in a `StaticBlock` node only
			 * if it's inside the braces of that `StaticBlock` node.
			 *
			 * Example where this function returns `null`:
			 *
			 *   static
			 *   // comment
			 *   {
			 *   }
			 *
			 * Example where this function returns `StaticBlock` node:
			 *
			 *   static
			 *   {
			 *   // comment
			 *   }
			 *
			 */
			if (node && node.type === "StaticBlock") {
				const openingBrace = sourceCode.getFirstToken(node, {
					skip: 1,
				}); // skip the `static` token

				return token.range[0] >= openingBrace.range[0] ? node : null;
			}

			return node;
		}

		/**
		 * Returns whether or not comments are at the parent start or not.
		 * @param {token} token The Comment token.
		 * @param {string} nodeType The parent type to check against.
		 * @returns {boolean} True if the comment is at parent start.
		 */
		function isCommentAtParentStart(token, nodeType) {
			const parent = getParentNodeOfToken(token);

			if (parent && isParentNodeType(parent, nodeType)) {
				let parentStartNodeOrToken = parent;

				if (parent.type === "StaticBlock") {
					parentStartNodeOrToken = sourceCode.getFirstToken(parent, {
						skip: 1,
					}); // opening brace of the static block
				} else if (parent.type === "SwitchStatement") {
					parentStartNodeOrToken = sourceCode.getTokenAfter(
						parent.discriminant,
						{
							filter: astUtils.isOpeningBraceToken,
						},
					); // opening brace of the switch statement
				}

				return (
					token.loc.start.line -
						parentStartNodeOrToken.loc.start.line ===
					1
				);
			}

			return false;
		}

		/**
		 * Returns whether or not comments are at the parent end or not.
		 * @param {token} token The Comment token.
		 * @param {string} nodeType The parent type to check against.
		 * @returns {boolean} True if the comment is at parent end.
		 */
		function isCommentAtParentEnd(token, nodeType) {
			const parent = getParentNodeOfToken(token);

			return (
				!!parent &&
				isParentNodeType(parent, nodeType) &&
				parent.loc.end.line - token.loc.end.line === 1
			);
		}

		/**
		 * Returns whether or not comments are at the block start or not.
		 * @param {token} token The Comment token.
		 * @returns {boolean} True if the comment is at block start.
		 */
		function isCommentAtBlockStart(token) {
			return (
				isCommentAtParentStart(token, "ClassBody") ||
				isCommentAtParentStart(token, "BlockStatement") ||
				isCommentAtParentStart(token, "StaticBlock") ||
				isCommentAtParentStart(token, "SwitchCase") ||
				isCommentAtParentStart(token, "SwitchStatement")
			);
		}

		/**
		 * Returns whether or not comments are at the block end or not.
		 * @param {token} token The Comment token.
		 * @returns {boolean} True if the comment is at block end.
		 */
		function isCommentAtBlockEnd(token) {
			return (
				isCommentAtParentEnd(token, "ClassBody") ||
				isCommentAtParentEnd(token, "BlockStatement") ||
				isCommentAtParentEnd(token, "StaticBlock") ||
				isCommentAtParentEnd(token, "SwitchCase") ||
				isCommentAtParentEnd(token, "SwitchStatement")
			);
		}

		/**
		 * Returns whether or not comments are at the class start or not.
		 * @param {token} token The Comment token.
		 * @returns {boolean} True if the comment is at class start.
		 */
		function isCommentAtClassStart(token) {
			return isCommentAtParentStart(token, "ClassBody");
		}

		/**
		 * Returns whether or not comments are at the class end or not.
		 * @param {token} token The Comment token.
		 * @returns {boolean} True if the comment is at class end.
		 */
		function isCommentAtClassEnd(token) {
			return isCommentAtParentEnd(token, "ClassBody");
		}

		/**
		 * Returns whether or not comments are at the object start or not.
		 * @param {token} token The Comment token.
		 * @returns {boolean} True if the comment is at object start.
		 */
		function isCommentAtObjectStart(token) {
			return (
				isCommentAtParentStart(token, "ObjectExpression") ||
				isCommentAtParentStart(token, "ObjectPattern")
			);
		}

		/**
		 * Returns whether or not comments are at the object end or not.
		 * @param {token} token The Comment token.
		 * @returns {boolean} True if the comment is at object end.
		 */
		function isCommentAtObjectEnd(token) {
			return (
				isCommentAtParentEnd(token, "ObjectExpression") ||
				isCommentAtParentEnd(token, "ObjectPattern")
			);
		}

		/**
		 * Returns whether or not comments are at the array start or not.
		 * @param {token} token The Comment token.
		 * @returns {boolean} True if the comment is at array start.
		 */
		function isCommentAtArrayStart(token) {
			return (
				isCommentAtParentStart(token, "ArrayExpression") ||
				isCommentAtParentStart(token, "ArrayPattern")
			);
		}

		/**
		 * Returns whether or not comments are at the array end or not.
		 * @param {token} token The Comment token.
		 * @returns {boolean} True if the comment is at array end.
		 */
		function isCommentAtArrayEnd(token) {
			return (
				isCommentAtParentEnd(token, "ArrayExpression") ||
				isCommentAtParentEnd(token, "ArrayPattern")
			);
		}

		/**
		 * Checks if a comment token has lines around it (ignores inline comments)
		 * @param {token} token The Comment token.
		 * @param {Object} opts Options to determine the newline.
		 * @param {boolean} opts.after Should have a newline after this line.
		 * @param {boolean} opts.before Should have a newline before this line.
		 * @returns {void}
		 */
		function checkForEmptyLine(token, opts) {
			if (
				applyDefaultIgnorePatterns &&
				defaultIgnoreRegExp.test(token.value)
			) {
				return;
			}

			if (ignorePattern && customIgnoreRegExp.test(token.value)) {
				return;
			}

			let after = opts.after,
				before = opts.before;

			const prevLineNum = token.loc.start.line - 1,
				nextLineNum = token.loc.end.line + 1,
				commentIsNotAlone = codeAroundComment(token);

			const blockStartAllowed =
					options.allowBlockStart &&
					isCommentAtBlockStart(token) &&
					!(
						options.allowClassStart === false &&
						isCommentAtClassStart(token)
					),
				blockEndAllowed =
					options.allowBlockEnd &&
					isCommentAtBlockEnd(token) &&
					!(
						options.allowClassEnd === false &&
						isCommentAtClassEnd(token)
					),
				classStartAllowed =
					options.allowClassStart && isCommentAtClassStart(token),
				classEndAllowed =
					options.allowClassEnd && isCommentAtClassEnd(token),
				objectStartAllowed =
					options.allowObjectStart && isCommentAtObjectStart(token),
				objectEndAllowed =
					options.allowObjectEnd && isCommentAtObjectEnd(token),
				arrayStartAllowed =
					options.allowArrayStart && isCommentAtArrayStart(token),
				arrayEndAllowed =
					options.allowArrayEnd && isCommentAtArrayEnd(token);

			const exceptionStartAllowed =
				blockStartAllowed ||
				classStartAllowed ||
				objectStartAllowed ||
				arrayStartAllowed;
			const exceptionEndAllowed =
				blockEndAllowed ||
				classEndAllowed ||
				objectEndAllowed ||
				arrayEndAllowed;

			// ignore top of the file and bottom of the file
			if (prevLineNum < 1) {
				before = false;
			}
			if (nextLineNum >= numLines) {
				after = false;
			}

			// we ignore all inline comments
			if (commentIsNotAlone) {
				return;
			}

			const previousTokenOrComment = sourceCode.getTokenBefore(token, {
				includeComments: true,
			});
			const nextTokenOrComment = sourceCode.getTokenAfter(token, {
				includeComments: true,
			});

			// check for newline before
			if (
				!exceptionStartAllowed &&
				before &&
				!commentAndEmptyLines.has(prevLineNum) &&
				!(
					astUtils.isCommentToken(previousTokenOrComment) &&
					astUtils.isTokenOnSameLine(previousTokenOrComment, token)
				)
			) {
				const lineStart = token.range[0] - token.loc.start.column;
				const range = [lineStart, lineStart];

				context.report({
					node: token,
					messageId: "before",
					fix(fixer) {
						return fixer.insertTextBeforeRange(range, "\n");
					},
				});
			}

			// check for newline after
			if (
				!exceptionEndAllowed &&
				after &&
				!commentAndEmptyLines.has(nextLineNum) &&
				!(
					astUtils.isCommentToken(nextTokenOrComment) &&
					astUtils.isTokenOnSameLine(token, nextTokenOrComment)
				)
			) {
				context.report({
					node: token,
					messageId: "after",
					fix(fixer) {
						return fixer.insertTextAfter(token, "\n");
					},
				});
			}
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			Program() {
				comments.forEach(token => {
					if (token.type === "Line") {
						if (
							options.beforeLineComment ||
							options.afterLineComment
						) {
							checkForEmptyLine(token, {
								after: options.afterLineComment,
								before: options.beforeLineComment,
							});
						}
					} else if (token.type === "Block") {
						if (
							options.beforeBlockComment ||
							options.afterBlockComment
						) {
							checkForEmptyLine(token, {
								after: options.afterBlockComment,
								before: options.beforeBlockComment,
							});
						}
					} else if (token.type === "Shebang") {
						if (options.afterHashbangComment) {
							checkForEmptyLine(token, {
								after: options.afterHashbangComment,
								before: false,
							});
						}
					}
				});
			},
		};
	},
};
f[xo/**
 * @fileoverview Require or disallow newlines around directives.
 * @author Kai Cataldo
 * @deprecated in ESLint v4.0.0
 */

"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "layout",

		docs: {
			description: "Require or disallow newlines around directives",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/lines-around-directive",
		},

		schema: [
			{
				oneOf: [
					{
						enum: ["always", "never"],
					},
					{
						type: "object",
						properties: {
							before: {
								enum: ["always", "never"],
							},
							after: {
								enum: ["always", "never"],
							},
						},
						additionalProperties: false,
						minProperties: 2,
					},
				],
			},
		],

		fixable: "whitespace",
		messages: {
			expected: 'Expected newline {{location}} "{{value}}" directive.',
			unexpected:
				'Unexpected newline {{location}} "{{value}}" directive.',
		},
		deprecated: {
			message: "The rule was replaced with a more general rule.",
			url: "https://eslint.org/blog/2017/06/eslint-v4.0.0-released/",
			deprecatedSince: "4.0.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message: "The new rule moved to a plugin.",
					url: "https://eslint.org/docs/latest/rules/padding-line-between-statements#examples",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "padding-line-between-statements",
						url: "https://eslint.style/rules/padding-line-between-statements",
					},
				},
			],
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const config = context.options[0] || "always";
		const expectLineBefore =
			typeof config === "string" ? config : config.before;
		const expectLineAfter =
			typeof config === "string" ? config : config.after;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Check if node is preceded by a blank newline.
		 * @param {ASTNode} node Node to check.
		 * @returns {boolean} Whether or not the passed in node is preceded by a blank newline.
		 */
		function hasNewlineBefore(node) {
			const tokenBefore = sourceCode.getTokenBefore(node, {
				includeComments: true,
			});
			const tokenLineBefore = tokenBefore ? tokenBefore.loc.end.line : 0;

			return node.loc.start.line - tokenLineBefore >= 2;
		}

		/**
		 * Gets the last token of a node that is on the same line as the rest of the node.
		 * This will usually be the last token of the node, but it will be the second-to-last token if the node has a trailing
		 * semicolon on a different line.
		 * @param {ASTNode} node A directive node
		 * @returns {Token} The last token of the node on the line
		 */
		function getLastTokenOnLine(node) {
			const lastToken = sourceCode.getLastToken(node);
			const secondToLastToken = sourceCode.getTokenBefore(lastToken);

			return astUtils.isSemicolonToken(lastToken) &&
				lastToken.loc.start.line > secondToLastToken.loc.end.line
				? secondToLastToken
				: lastToken;
		}

		/**
		 * Check if node is followed by a blank newline.
		 * @param {ASTNode} node Node to check.
		 * @returns {boolean} Whether or not the passed in node is followed by a blank newline.
		 */
		function hasNewlineAfter(node) {
			const lastToken = getLastTokenOnLine(node);
			const tokenAfter = sourceCode.getTokenAfter(lastToken, {
				includeComments: true,
			});

			return tokenAfter.loc.start.line - lastToken.loc.end.line >= 2;
		}

		/**
		 * Report errors for newlines around directives.
		 * @param {ASTNode} node Node to check.
		 * @param {string} location Whether the error was found before or after the directive.
		 * @param {boolean} expected Whether or not a newline was expected or unexpected.
		 * @returns {void}
		 */
		function reportError(node, location, expected) {
			context.report({
				node,
				messageId: expected ? "expected" : "unexpected",
				data: {
					value: node.expression.value,
					location,
				},
				fix(fixer) {
					const lastToken = getLastTokenOnLine(node);

					if (expected) {
						return location === "before"
							? fixer.insertTextBefore(node, "\n")
							: fixer.insertTextAfter(lastToken, "\n");
					}
					return fixer.removeRange(
						location === "before"
							? [node.range[0] - 1, node.range[0]]
							: [lastToken.range[1], lastToken.range[1] + 1],
					);
				},
			});
		}

		/**
		 * Check lines around directives in node
		 * @param {ASTNode} node node to check
		 * @returns {void}
		 */
		function checkDirectives(node) {
			const directives = astUtils.getDirectivePrologue(node);

			if (!directives.length) {
				return;
			}

			const firstDirective = directives[0];
			const leadingComments =
				sourceCode.getCommentsBefore(firstDirective);

			/*
			 * Only check before the first directive if it is preceded by a comment or if it is at the top of
			 * the file and expectLineBefore is set to "never". This is to not force a newline at the top of
			 * the file if there are no comments as well as for compatibility with padded-blocks.
			 */
			if (leadingComments.length) {
				if (
					expectLineBefore === "always" &&
					!hasNewlineBefore(firstDirective)
				) {
					reportError(firstDirective, "before", true);
				}

				if (
					expectLineBefore === "never" &&
					hasNewlineBefore(firstDirective)
				) {
					reportError(firstDirective, "before", false);
				}
			} else if (
				node.type === "Program" &&
				expectLineBefore === "never" &&
				!leadingComments.length &&
				hasNewlineBefore(firstDirective)
			) {
				reportError(firstDirective, "before", false);
			}

			const lastDirective = directives.at(-1);
			const statements =
				node.type === "Program" ? node.body : node.body.body;

			/*
			 * Do not check after the last directive if the body only
			 * contains a directive prologue and isn't followed by a comment to ensure
			 * this rule behaves well with padded-blocks.
			 */
			if (
				lastDirective === statements.at(-1) &&
				!lastDirective.trailingComments
			) {
				return;
			}

			if (
				expectLineAfter === "always" &&
				!hasNewlineAfter(lastDirective)
			) {
				reportError(lastDirective, "after", true);
			}

			if (expectLineAfter === "never" && hasNewlineAfter(lastDirective)) {
				reportError(lastDirective, "after", false);
			}
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			Program: checkDirectives,
			FunctionDeclaration: checkDirectives,
			FunctionExpression: checkDirectives,
			ArrowFunctionExpression: checkDirectives,
		};
	},
};
l='x'n/**
 * @fileoverview Rule to check empty newline between class members
 * @author 薛定谔的猫<hh_2013@foxmail.com>
 * @deprecated in ESLint v8.53.0
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Types of class members.
 * Those have `test` method to check it matches to the given class member.
 * @private
 */
const ClassMemberTypes = {
	"*": { test: () => true },
	field: { test: node => node.type === "PropertyDefinition" },
	method: { test: node => node.type === "MethodDefinition" },
};

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "lines-between-class-members",
						url: "https://eslint.style/rules/lines-between-class-members",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description:
				"Require or disallow an empty line between class members",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/lines-between-class-members",
		},

		fixable: "whitespace",

		schema: [
			{
				anyOf: [
					{
						type: "object",
						properties: {
							enforce: {
								type: "array",
								items: {
									type: "object",
									properties: {
										blankLine: {
											enum: ["always", "never"],
										},
										prev: {
											enum: ["method", "field", "*"],
										},
										next: {
											enum: ["method", "field", "*"],
										},
									},
									additionalProperties: false,
									required: ["blankLine", "prev", "next"],
								},
								minItems: 1,
							},
						},
						additionalProperties: false,
						required: ["enforce"],
					},
					{
						enum: ["always", "never"],
					},
				],
			},
			{
				type: "object",
				properties: {
					exceptAfterSingleLine: {
						type: "boolean",
						default: false,
					},
				},
				additionalProperties: false,
			},
		],
		messages: {
			never: "Unexpected blank line between class members.",
			always: "Expected blank line between class members.",
		},
	},

	create(context) {
		const options = [];

		options[0] = context.options[0] || "always";
		options[1] = context.options[1] || { exceptAfterSingleLine: false };

		const configureList =
			typeof options[0] === "object"
				? options[0].enforce
				: [{ blankLine: options[0], prev: "*", next: "*" }];
		const sourceCode = context.sourceCode;

		/**
		 * Gets a pair of tokens that should be used to check lines between two class member nodes.
		 *
		 * In most cases, this returns the very last token of the current node and
		 * the very first token of the next node.
		 * For example:
		 *
		 *     class C {
		 *         x = 1;   // curLast: `;` nextFirst: `in`
		 *         in = 2
		 *     }
		 *
		 * There is only one exception. If the given node ends with a semicolon, and it looks like
		 * a semicolon-less style's semicolon - one that is not on the same line as the preceding
		 * token, but is on the line where the next class member starts - this returns the preceding
		 * token and the semicolon as boundary tokens.
		 * For example:
		 *
		 *     class C {
		 *         x = 1    // curLast: `1` nextFirst: `;`
		 *         ;in = 2
		 *     }
		 * When determining the desired layout of the code, we should treat this semicolon as
		 * a part of the next class member node instead of the one it technically belongs to.
		 * @param {ASTNode} curNode Current class member node.
		 * @param {ASTNode} nextNode Next class member node.
		 * @returns {Token} The actual last token of `node`.
		 * @private
		 */
		function getBoundaryTokens(curNode, nextNode) {
			const lastToken = sourceCode.getLastToken(curNode);
			const prevToken = sourceCode.getTokenBefore(lastToken);
			const nextToken = sourceCode.getFirstToken(nextNode); // skip possible lone `;` between nodes

			const isSemicolonLessStyle =
				astUtils.isSemicolonToken(lastToken) &&
				!astUtils.isTokenOnSameLine(prevToken, lastToken) &&
				astUtils.isTokenOnSameLine(lastToken, nextToken);

			return isSemicolonLessStyle
				? { curLast: prevToken, nextFirst: lastToken }
				: { curLast: lastToken, nextFirst: nextToken };
		}

		/**
		 * Return the last token among the consecutive tokens that have no exceed max line difference in between, before the first token in the next member.
		 * @param {Token} prevLastToken The last token in the previous member node.
		 * @param {Token} nextFirstToken The first token in the next member node.
		 * @param {number} maxLine The maximum number of allowed line difference between consecutive tokens.
		 * @returns {Token} The last token among the consecutive tokens.
		 */
		function findLastConsecutiveTokenAfter(
			prevLastToken,
			nextFirstToken,
			maxLine,
		) {
			const after = sourceCode.getTokenAfter(prevLastToken, {
				includeComments: true,
			});

			if (
				after !== nextFirstToken &&
				after.loc.start.line - prevLastToken.loc.end.line <= maxLine
			) {
				return findLastConsecutiveTokenAfter(
					after,
					nextFirstToken,
					maxLine,
				);
			}
			return prevLastToken;
		}

		/**
		 * Return the first token among the consecutive tokens that have no exceed max line difference in between, after the last token in the previous member.
		 * @param {Token} nextFirstToken The first token in the next member node.
		 * @param {Token} prevLastToken The last token in the previous member node.
		 * @param {number} maxLine The maximum number of allowed line difference between consecutive tokens.
		 * @returns {Token} The first token among the consecutive tokens.
		 */
		function findFirstConsecutiveTokenBefore(
			nextFirstToken,
			prevLastToken,
			maxLine,
		) {
			const before = sourceCode.getTokenBefore(nextFirstToken, {
				includeComments: true,
			});

			if (
				before !== prevLastToken &&
				nextFirstToken.loc.start.line - before.loc.end.line <= maxLine
			) {
				return findFirstConsecutiveTokenBefore(
					before,
					prevLastToken,
					maxLine,
				);
			}
			return nextFirstToken;
		}

		/**
		 * Checks if there is a token or comment between two tokens.
		 * @param {Token} before The token before.
		 * @param {Token} after The token after.
		 * @returns {boolean} True if there is a token or comment between two tokens.
		 */
		function hasTokenOrCommentBetween(before, after) {
			return (
				sourceCode.getTokensBetween(before, after, {
					includeComments: true,
				}).length !== 0
			);
		}

		/**
		 * Checks whether the given node matches the given type.
		 * @param {ASTNode} node The class member node to check.
		 * @param {string} type The class member type to check.
		 * @returns {boolean} `true` if the class member node matched the type.
		 * @private
		 */
		function match(node, type) {
			return ClassMemberTypes[type].test(node);
		}

		/**
		 * Finds the last matched configuration from the configureList.
		 * @param {ASTNode} prevNode The previous node to match.
		 * @param {ASTNode} nextNode The current node to match.
		 * @returns {string|null} Padding type or `null` if no matches were found.
		 * @private
		 */
		function getPaddingType(prevNode, nextNode) {
			for (let i = configureList.length - 1; i >= 0; --i) {
				const configure = configureList[i];
				const matched =
					match(prevNode, configure.prev) &&
					match(nextNode, configure.next);

				if (matched) {
					return configure.blankLine;
				}
			}
			return null;
		}

		return {
			ClassBody(node) {
				const body = node.body;

				for (let i = 0; i < body.length - 1; i++) {
					const curFirst = sourceCode.getFirstToken(body[i]);
					const { curLast, nextFirst } = getBoundaryTokens(
						body[i],
						body[i + 1],
					);
					const isMulti = !astUtils.isTokenOnSameLine(
						curFirst,
						curLast,
					);
					const skip = !isMulti && options[1].exceptAfterSingleLine;
					const beforePadding = findLastConsecutiveTokenAfter(
						curLast,
						nextFirst,
						1,
					);
					const afterPadding = findFirstConsecutiveTokenBefore(
						nextFirst,
						curLast,
						1,
					);
					const isPadded =
						afterPadding.loc.start.line -
							beforePadding.loc.end.line >
						1;
					const hasTokenInPadding = hasTokenOrCommentBetween(
						beforePadding,
						afterPadding,
					);
					const curLineLastToken = findLastConsecutiveTokenAfter(
						curLast,
						nextFirst,
						0,
					);
					const paddingType = getPaddingType(body[i], body[i + 1]);

					if (paddingType === "never" && isPadded) {
						context.report({
							node: body[i + 1],
							messageId: "never",

							fix(fixer) {
								if (hasTokenInPadding) {
									return null;
								}
								return fixer.replaceTextRange(
									[
										beforePadding.range[1],
										afterPadding.range[0],
									],
									"\n",
								);
							},
						});
					} else if (paddingType === "always" && !skip && !isPadded) {
						context.report({
							node: body[i + 1],
							messageId: "always",

							fix(fixer) {
								if (hasTokenInPadding) {
									return null;
								}
								return fixer.insertTextAfter(
									curLineLastToken,
									"\n",
								);
							},
						});
					}
				}
			},
		};
	},
};
VH	xfJ/**
 * @fileoverview Rule to replace assignment expressions with logical operator assignment
 * @author Daniel Martens
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils.js");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const baseTypes = new Set(["Identifier", "Super", "ThisExpression"]);

/**
 * Returns true iff either "undefined" or a void expression (eg. "void 0")
 * @param {ASTNode} expression Expression to check
 * @param {import('eslint-scope').Scope} scope Scope of the expression
 * @returns {boolean} True iff "undefined" or "void ..."
 */
function isUndefined(expression, scope) {
	if (expression.type === "Identifier" && expression.name === "undefined") {
		return astUtils.isReferenceToGlobalVariable(scope, expression);
	}

	return (
		expression.type === "UnaryExpression" &&
		expression.operator === "void" &&
		expression.argument.type === "Literal" &&
		expression.argument.value === 0
	);
}

/**
 * Returns true iff the reference is either an identifier or member expression
 * @param {ASTNode} expression Expression to check
 * @returns {boolean} True for identifiers and member expressions
 */
function isReference(expression) {
	return (
		(expression.type === "Identifier" && expression.name !== "undefined") ||
		expression.type === "MemberExpression"
	);
}

/**
 * Returns true iff the expression checks for nullish with loose equals.
 * Examples: value == null, value == void 0
 * @param {ASTNode} expression Test condition
 * @param {import('eslint-scope').Scope} scope Scope of the expression
 * @returns {boolean} True iff implicit nullish comparison
 */
function isImplicitNullishComparison(expression, scope) {
	if (
		expression.type !== "BinaryExpression" ||
		expression.operator !== "=="
	) {
		return false;
	}

	const reference = isReference(expression.left) ? "left" : "right";
	const nullish = reference === "left" ? "right" : "left";

	return (
		isReference(expression[reference]) &&
		(astUtils.isNullLiteral(expression[nullish]) ||
			isUndefined(expression[nullish], scope))
	);
}

/**
 * Condition with two equal comparisons.
 * @param {ASTNode} expression Condition
 * @returns {boolean} True iff matches ? === ? || ? === ?
 */
function isDoubleComparison(expression) {
	return (
		expression.type === "LogicalExpression" &&
		expression.operator === "||" &&
		expression.left.type === "BinaryExpression" &&
		expression.left.operator === "===" &&
		expression.right.type === "BinaryExpression" &&
		expression.right.operator === "==="
	);
}

/**
 * Returns true iff the expression checks for undefined and null.
 * Example: value === null || value === undefined
 * @param {ASTNode} expression Test condition
 * @param {import('eslint-scope').Scope} scope Scope of the expression
 * @returns {boolean} True iff explicit nullish comparison
 */
function isExplicitNullishComparison(expression, scope) {
	if (!isDoubleComparison(expression)) {
		return false;
	}
	const leftReference = isReference(expression.left.left) ? "left" : "right";
	const leftNullish = leftReference === "left" ? "right" : "left";
	const rightReference = isReference(expression.right.left)
		? "left"
		: "right";
	const rightNullish = rightReference === "left" ? "right" : "left";

	return (
		astUtils.isSameReference(
			expression.left[leftReference],
			expression.right[rightReference],
		) &&
		((astUtils.isNullLiteral(expression.left[leftNullish]) &&
			isUndefined(expression.right[rightNullish], scope)) ||
			(isUndefined(expression.left[leftNullish], scope) &&
				astUtils.isNullLiteral(expression.right[rightNullish])))
	);
}

/**
 * Returns true for Boolean(arg) calls
 * @param {ASTNode} expression Test condition
 * @param {import('eslint-scope').Scope} scope Scope of the expression
 * @returns {boolean} Whether the expression is a boolean cast
 */
function isBooleanCast(expression, scope) {
	return (
		expression.type === "CallExpression" &&
		expression.callee.name === "Boolean" &&
		expression.arguments.length === 1 &&
		astUtils.isReferenceToGlobalVariable(scope, expression.callee)
	);
}

/**
 * Returns true for:
 * truthiness checks:  value, Boolean(value), !!value
 * falsiness checks:   !value, !Boolean(value)
 * nullish checks:     value == null, value === undefined || value === null
 * @param {ASTNode} expression Test condition
 * @param {import('eslint-scope').Scope} scope Scope of the expression
 * @returns {?{ reference: ASTNode, operator: '??'|'||'|'&&'}} Null if not a known existence
 */
function getExistence(expression, scope) {
	const isNegated =
		expression.type === "UnaryExpression" && expression.operator === "!";
	const base = isNegated ? expression.argument : expression;

	switch (true) {
		case isReference(base):
			return { reference: base, operator: isNegated ? "||" : "&&" };
		case base.type === "UnaryExpression" &&
			base.operator === "!" &&
			isReference(base.argument):
			return { reference: base.argument, operator: "&&" };
		case isBooleanCast(base, scope) && isReference(base.arguments[0]):
			return {
				reference: base.arguments[0],
				operator: isNegated ? "||" : "&&",
			};
		case isImplicitNullishComparison(expression, scope):
			return {
				reference: isReference(expression.left)
					? expression.left
					: expression.right,
				operator: "??",
			};
		case isExplicitNullishComparison(expression, scope):
			return {
				reference: isReference(expression.left.left)
					? expression.left.left
					: expression.left.right,
				operator: "??",
			};
		default:
			return null;
	}
}

/**
 * Returns true iff the node is inside a with block
 * @param {ASTNode} node Node to check
 * @returns {boolean} True iff passed node is inside a with block
 */
function isInsideWithBlock(node) {
	if (node.type === "Program") {
		return false;
	}

	return node.parent.type === "WithStatement" && node.parent.body === node
		? true
		: isInsideWithBlock(node.parent);
}

/**
 * Gets the leftmost operand of a consecutive logical expression.
 * @param {SourceCode} sourceCode The ESLint source code object
 * @param {LogicalExpression} node LogicalExpression
 * @returns {Expression} Leftmost operand
 */
function getLeftmostOperand(sourceCode, node) {
	let left = node.left;

	while (
		left.type === "LogicalExpression" &&
		left.operator === node.operator
	) {
		if (astUtils.isParenthesised(sourceCode, left)) {
			/*
			 * It should have associativity,
			 * but ignore it if use parentheses to make the evaluation order clear.
			 */
			return left;
		}
		left = left.left;
	}
	return left;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Require or disallow logical assignment operator shorthand",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/logical-assignment-operators",
		},

		schema: {
			type: "array",
			oneOf: [
				{
					items: [
						{ const: "always" },
						{
							type: "object",
							properties: {
								enforceForIfStatements: {
									type: "boolean",
								},
							},
							additionalProperties: false,
						},
					],
					minItems: 0, // 0 for allowing passing no options
					maxItems: 2,
				},
				{
					items: [{ const: "never" }],
					minItems: 1,
					maxItems: 1,
				},
			],
		},

		defaultOptions: ["always"],

		fixable: "code",
		hasSuggestions: true,
		messages: {
			assignment:
				"Assignment (=) can be replaced with operator assignment ({{operator}}).",
			useLogicalOperator:
				"Convert this assignment to use the operator {{ operator }}.",
			logical:
				"Logical expression can be replaced with an assignment ({{ operator }}).",
			convertLogical:
				"Replace this logical expression with an assignment with the operator {{ operator }}.",
			if: "'if' statement can be replaced with a logical operator assignment with operator {{ operator }}.",
			convertIf:
				"Replace this 'if' statement with a logical assignment with operator {{ operator }}.",
			unexpected:
				"Unexpected logical operator assignment ({{operator}}) shorthand.",
			separate:
				"Separate the logical assignment into an assignment with a logical operator.",
		},
	},

	create(context) {
		const mode = context.options[0];
		const checkIf =
			mode === "always" &&
			context.options.length > 1 &&
			context.options[1].enforceForIfStatements;
		const sourceCode = context.sourceCode;
		const isStrict = sourceCode.getScope(sourceCode.ast).isStrict;

		/**
		 * Returns false if the access could be a getter
		 * @param {ASTNode} node Assignment expression
		 * @returns {boolean} True iff the fix is safe
		 */
		function cannotBeGetter(node) {
			return (
				node.type === "Identifier" &&
				(isStrict || !isInsideWithBlock(node))
			);
		}

		/**
		 * Check whether only a single property is accessed
		 * @param {ASTNode} node reference
		 * @returns {boolean} True iff a single property is accessed
		 */
		function accessesSingleProperty(node) {
			if (!isStrict && isInsideWithBlock(node)) {
				return node.type === "Identifier";
			}

			return (
				node.type === "MemberExpression" &&
				baseTypes.has(node.object.type) &&
				(!node.computed ||
					(node.property.type !== "MemberExpression" &&
						node.property.type !== "ChainExpression"))
			);
		}

		/**
		 * Adds a fixer or suggestion whether on the fix is safe.
		 * @param {{ messageId: string, node: ASTNode }} descriptor Report descriptor without fix or suggest
		 * @param {{ messageId: string, fix: Function }} suggestion Adds the fix or the whole suggestion as only element in "suggest" to suggestion
		 * @param {boolean} shouldBeFixed Fix iff the condition is true
		 * @returns {Object} Descriptor with either an added fix or suggestion
		 */
		function createConditionalFixer(descriptor, suggestion, shouldBeFixed) {
			if (shouldBeFixed) {
				return {
					...descriptor,
					fix: suggestion.fix,
				};
			}

			return {
				...descriptor,
				suggest: [suggestion],
			};
		}

		/**
		 * Returns the operator token for assignments and binary expressions
		 * @param {ASTNode} node AssignmentExpression or BinaryExpression
		 * @returns {import('eslint').AST.Token} Operator token between the left and right expression
		 */
		function getOperatorToken(node) {
			return sourceCode.getFirstTokenBetween(
				node.left,
				node.right,
				token => token.value === node.operator,
			);
		}

		if (mode === "never") {
			return {
				// foo ||= bar
				AssignmentExpression(assignment) {
					if (
						!astUtils.isLogicalAssignmentOperator(
							assignment.operator,
						)
					) {
						return;
					}

					const descriptor = {
						messageId: "unexpected",
						node: assignment,
						data: { operator: assignment.operator },
					};
					const suggestion = {
						messageId: "separate",
						*fix(ruleFixer) {
							if (
								sourceCode.getCommentsInside(assignment)
									.length > 0
							) {
								return;
							}

							const operatorToken = getOperatorToken(assignment);

							// -> foo = bar
							yield ruleFixer.replaceText(operatorToken, "=");

							const assignmentText = sourceCode.getText(
								assignment.left,
							);
							const operator = assignment.operator.slice(0, -1);

							// -> foo = foo || bar
							yield ruleFixer.insertTextAfter(
								operatorToken,
								` ${assignmentText} ${operator}`,
							);

							const precedence =
								astUtils.getPrecedence(assignment.right) <=
								astUtils.getPrecedence({
									type: "LogicalExpression",
									operator,
								});

							// ?? and || / && cannot be mixed but have same precedence
							const mixed =
								assignment.operator === "??=" &&
								astUtils.isLogicalExpression(assignment.right);

							if (
								!astUtils.isParenthesised(
									sourceCode,
									assignment.right,
								) &&
								(precedence || mixed)
							) {
								// -> foo = foo || (bar)
								yield ruleFixer.insertTextBefore(
									assignment.right,
									"(",
								);
								yield ruleFixer.insertTextAfter(
									assignment.right,
									")",
								);
							}
						},
					};

					context.report(
						createConditionalFixer(
							descriptor,
							suggestion,
							cannotBeGetter(assignment.left),
						),
					);
				},
			};
		}

		return {
			// foo = foo || bar
			"AssignmentExpression[operator='='][right.type='LogicalExpression']"(
				assignment,
			) {
				const leftOperand = getLeftmostOperand(
					sourceCode,
					assignment.right,
				);

				if (!astUtils.isSameReference(assignment.left, leftOperand)) {
					return;
				}

				const descriptor = {
					messageId: "assignment",
					node: assignment,
					data: { operator: `${assignment.right.operator}=` },
				};
				const suggestion = {
					messageId: "useLogicalOperator",
					data: { operator: `${assignment.right.operator}=` },
					*fix(ruleFixer) {
						if (
							sourceCode.getCommentsInside(assignment).length > 0
						) {
							return;
						}

						// No need for parenthesis around the assignment based on precedence as the precedence stays the same even with changed operator
						const assignmentOperatorToken =
							getOperatorToken(assignment);

						// -> foo ||= foo || bar
						yield ruleFixer.insertTextBefore(
							assignmentOperatorToken,
							assignment.right.operator,
						);

						// -> foo ||= bar
						const logicalOperatorToken = getOperatorToken(
							leftOperand.parent,
						);
						const firstRightOperandToken =
							sourceCode.getTokenAfter(logicalOperatorToken);

						yield ruleFixer.removeRange([
							leftOperand.parent.range[0],
							firstRightOperandToken.range[0],
						]);
					},
				};

				context.report(
					createConditionalFixer(
						descriptor,
						suggestion,
						cannotBeGetter(assignment.left),
					),
				);
			},

			// foo || (foo = bar)
			'LogicalExpression[right.type="AssignmentExpression"][right.operator="="]'(
				logical,
			) {
				// Right side has to be parenthesized, otherwise would be parsed as (foo || foo) = bar which is illegal
				if (
					isReference(logical.left) &&
					astUtils.isSameReference(logical.left, logical.right.left)
				) {
					const descriptor = {
						messageId: "logical",
						node: logical,
						data: { operator: `${logical.operator}=` },
					};
					const suggestion = {
						messageId: "convertLogical",
						data: { operator: `${logical.operator}=` },
						*fix(ruleFixer) {
							if (
								sourceCode.getCommentsInside(logical).length > 0
							) {
								return;
							}

							const parentPrecedence = astUtils.getPrecedence(
								logical.parent,
							);
							const requiresOuterParenthesis =
								logical.parent.type !== "ExpressionStatement" &&
								(parentPrecedence === -1 ||
									astUtils.getPrecedence({
										type: "AssignmentExpression",
									}) < parentPrecedence);

							if (
								!astUtils.isParenthesised(
									sourceCode,
									logical,
								) &&
								requiresOuterParenthesis
							) {
								yield ruleFixer.insertTextBefore(logical, "(");
								yield ruleFixer.insertTextAfter(logical, ")");
							}

							// Also removes all opening parenthesis
							yield ruleFixer.removeRange([
								logical.range[0],
								logical.right.range[0],
							]); // -> foo = bar)

							// Also removes all ending parenthesis
							yield ruleFixer.removeRange([
								logical.right.range[1],
								logical.range[1],
							]); // -> foo = bar

							const operatorToken = getOperatorToken(
								logical.right,
							);

							yield ruleFixer.insertTextBefore(
								operatorToken,
								logical.operator,
							); // -> foo ||= bar
						},
					};
					const fix =
						cannotBeGetter(logical.left) ||
						accessesSingleProperty(logical.left);

					context.report(
						createConditionalFixer(descriptor, suggestion, fix),
					);
				}
			},

			// if (foo) foo = bar
			"IfStatement[alternate=null]"(ifNode) {
				if (!checkIf) {
					return;
				}

				const hasBody = ifNode.consequent.type === "BlockStatement";

				if (hasBody && ifNode.consequent.body.length !== 1) {
					return;
				}

				const body = hasBody
					? ifNode.consequent.body[0]
					: ifNode.consequent;
				const scope = sourceCode.getScope(ifNode);
				const existence = getExistence(ifNode.test, scope);

				if (
					body.type === "ExpressionStatement" &&
					body.expression.type === "AssignmentExpression" &&
					body.expression.operator === "=" &&
					existence !== null &&
					astUtils.isSameReference(
						existence.reference,
						body.expression.left,
					)
				) {
					const descriptor = {
						messageId: "if",
						node: ifNode,
						data: { operator: `${existence.operator}=` },
					};
					const suggestion = {
						messageId: "convertIf",
						data: { operator: `${existence.operator}=` },
						*fix(ruleFixer) {
							if (
								sourceCode.getCommentsInside(ifNode).length > 0
							) {
								return;
							}

							const firstBodyToken =
								sourceCode.getFirstToken(body);
							const prevToken = sourceCode.getTokenBefore(ifNode);

							if (
								prevToken !== null &&
								prevToken.value !== ";" &&
								prevToken.value !== "{" &&
								firstBodyToken.type !== "Identifier" &&
								firstBodyToken.type !== "Keyword"
							) {
								// Do not fix if the fixed statement could be part of the previous statement (eg. fn() if (a == null) (a) = b --> fn()(a) ??= b)
								return;
							}

							const operatorToken = getOperatorToken(
								body.expression,
							);

							yield ruleFixer.insertTextBefore(
								operatorToken,
								existence.operator,
							); // -> if (foo) foo ||= bar

							yield ruleFixer.removeRange([
								ifNode.range[0],
								body.range[0],
							]); // -> foo ||= bar

							yield ruleFixer.removeRange([
								body.range[1],
								ifNode.range[1],
							]); // -> foo ||= bar, only present if "if" had a body

							const nextToken = sourceCode.getTokenAfter(
								body.expression,
							);

							if (
								hasBody &&
								nextToken !== null &&
								nextToken.value !== ";"
							) {
								yield ruleFixer.insertTextAfter(ifNode, ";");
							}
						},
					};
					const shouldBeFixed =
						cannotBeGetter(existence.reference) ||
						(ifNode.test.type !== "LogicalExpression" &&
							accessesSingleProperty(existence.reference));

					context.report(
						createConditionalFixer(
							descriptor,
							suggestion,
							shouldBeFixed,
						),
					);
				}
			},
		};
	},
};
`7n{xL/**
 * @fileoverview Enforce a maximum number of classes per file
 * @author James Garbutt <https://github.com/43081j>
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Enforce a maximum number of classes per file",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/max-classes-per-file",
		},

		schema: [
			{
				oneOf: [
					{
						type: "integer",
						minimum: 1,
					},
					{
						type: "object",
						properties: {
							ignoreExpressions: {
								type: "boolean",
							},
							max: {
								type: "integer",
								minimum: 1,
							},
						},
						additionalProperties: false,
					},
				],
			},
		],

		defaultOptions: [1],

		messages: {
			maximumExceeded:
				"File has too many classes ({{ classCount }}). Maximum allowed is {{ max }}.",
		},
	},
	create(context) {
		const option = context.options[0];
		const [ignoreExpressions, max] =
			typeof option === "number"
				? [false, option]
				: [option.ignoreExpressions, option.max || 1];

		let classCount = 0;

		return {
			Program() {
				classCount = 0;
			},
			"Program:exit"(node) {
				if (classCount > max) {
					context.report({
						node,
						loc: {
							start: node.body[0].loc.start,
							end: node.body.at(-1).loc.end,
						},
						messageId: "maximumExceeded",
						data: {
							classCount,
							max,
						},
					});
				}
			},
			ClassDeclaration() {
				classCount++;
			},
			ClassExpression() {
				if (!ignoreExpressions) {
					classCount++;
				}
			},
		};
	},
};
TEx/**
 * @fileoverview A rule to set the maximum depth block can be nested in a function.
 * @author Ian Christian Myers
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Enforce a maximum depth that blocks can be nested",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/max-depth",
		},

		schema: [
			{
				oneOf: [
					{
						type: "integer",
						minimum: 0,
					},
					{
						type: "object",
						properties: {
							maximum: {
								type: "integer",
								minimum: 0,
							},
							max: {
								type: "integer",
								minimum: 0,
							},
						},
						additionalProperties: false,
					},
				],
			},
		],

		defaultOptions: [4],

		messages: {
			tooDeeply:
				"Blocks are nested too deeply ({{depth}}). Maximum allowed is {{maxDepth}}.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		const functionStack = [],
			option = context.options[0];
		let maxDepth = 4;

		if (
			typeof option === "object" &&
			(Object.hasOwn(option, "maximum") || Object.hasOwn(option, "max"))
		) {
			maxDepth = option.maximum || option.max;
		}
		if (typeof option === "number") {
			maxDepth = option;
		}

		/**
		 * When parsing a new function, store it in our function stack
		 * @returns {void}
		 * @private
		 */
		function startFunction() {
			functionStack.push(0);
		}

		/**
		 * When parsing is done then pop out the reference
		 * @returns {void}
		 * @private
		 */
		function endFunction() {
			functionStack.pop();
		}

		/**
		 * Save the block and Evaluate the node
		 * @param {ASTNode} node node to evaluate
		 * @returns {void}
		 * @private
		 */
		function pushBlock(node) {
			const len = ++functionStack[functionStack.length - 1];

			if (len > maxDepth) {
				context.report({
					node,
					loc: sourceCode.getFirstToken(node).loc,
					messageId: "tooDeeply",
					data: { depth: len, maxDepth },
				});
			}
		}

		/**
		 * Pop the saved block
		 * @returns {void}
		 * @private
		 */
		function popBlock() {
			functionStack[functionStack.length - 1]--;
		}

		/**
		 * Checks whether a node is an else-if statement.
		 * @param {ASTNode} node node to evaluate
		 * @returns {boolean} Whether the node is an else-if statement
		 */
		function isElseIf(node) {
			return (
				node.parent.type === "IfStatement" &&
				node.parent.alternate === node
			);
		}

		//--------------------------------------------------------------------------
		// Public API
		//--------------------------------------------------------------------------

		return {
			Program: startFunction,
			FunctionDeclaration: startFunction,
			FunctionExpression: startFunction,
			ArrowFunctionExpression: startFunction,
			StaticBlock: startFunction,

			IfStatement(node) {
				if (!isElseIf(node)) {
					pushBlock(node);
				}
			},
			SwitchStatement: pushBlock,
			TryStatement: pushBlock,
			DoWhileStatement: pushBlock,
			WhileStatement: pushBlock,
			WithStatement: pushBlock,
			ForStatement: pushBlock,
			ForInStatement: pushBlock,
			ForOfStatement: pushBlock,

			"IfStatement:exit"(node) {
				if (!isElseIf(node)) {
					popBlock();
				}
			},
			"SwitchStatement:exit": popBlock,
			"TryStatement:exit": popBlock,
			"DoWhileStatement:exit": popBlock,
			"WhileStatement:exit": popBlock,
			"WithStatement:exit": popBlock,
			"ForStatement:exit": popBlock,
			"ForInStatement:exit": popBlock,
			"ForOfStatement:exit": popBlock,

			"FunctionDeclaration:exit": endFunction,
			"FunctionExpression:exit": endFunction,
			"ArrowFunctionExpression:exit": endFunction,
			"StaticBlock:exit": endFunction,
			"Program:exit": endFunction,
		};
	},
};
,Ix_5/**
 * @fileoverview Rule to check for max length on a line.
 * @author Matt DuVall <http://www.mattduvall.com>
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Constants
//------------------------------------------------------------------------------

const OPTIONS_SCHEMA = {
	type: "object",
	properties: {
		code: {
			type: "integer",
			minimum: 0,
		},
		comments: {
			type: "integer",
			minimum: 0,
		},
		tabWidth: {
			type: "integer",
			minimum: 0,
		},
		ignorePattern: {
			type: "string",
		},
		ignoreComments: {
			type: "boolean",
		},
		ignoreStrings: {
			type: "boolean",
		},
		ignoreUrls: {
			type: "boolean",
		},
		ignoreTemplateLiterals: {
			type: "boolean",
		},
		ignoreRegExpLiterals: {
			type: "boolean",
		},
		ignoreTrailingComments: {
			type: "boolean",
		},
	},
	additionalProperties: false,
};

const OPTIONS_OR_INTEGER_SCHEMA = {
	anyOf: [
		OPTIONS_SCHEMA,
		{
			type: "integer",
			minimum: 0,
		},
	],
};

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "max-len",
						url: "https://eslint.style/rules/max-len",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Enforce a maximum line length",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/max-len",
		},

		schema: [
			OPTIONS_OR_INTEGER_SCHEMA,
			OPTIONS_OR_INTEGER_SCHEMA,
			OPTIONS_SCHEMA,
		],
		messages: {
			max: "This line has a length of {{lineLength}}. Maximum allowed is {{maxLength}}.",
			maxComment:
				"This line has a comment length of {{lineLength}}. Maximum allowed is {{maxCommentLength}}.",
		},
	},

	create(context) {
		/*
		 * Inspired by https://datatracker.ietf.org/doc/html/rfc3986#appendix-B, however:
		 * - They're matching an entire string that we know is a URI
		 * - We're matching part of a string where we think there *might* be a URL
		 * - We're only concerned about URLs, as picking out any URI would cause
		 *   too many false positives
		 * - We don't care about matching the entire URL, any small segment is fine
		 */
		const URL_REGEXP = /[^:/?#]:\/\/[^?#]/u;

		const sourceCode = context.sourceCode;

		/**
		 * Computes the length of a line that may contain tabs. The width of each
		 * tab will be the number of spaces to the next tab stop.
		 * @param {string} line The line.
		 * @param {number} tabWidth The width of each tab stop in spaces.
		 * @returns {number} The computed line length.
		 * @private
		 */
		function computeLineLength(line, tabWidth) {
			let extraCharacterCount = 0;

			line.replace(/\t/gu, (match, offset) => {
				const totalOffset = offset + extraCharacterCount,
					previousTabStopOffset = tabWidth
						? totalOffset % tabWidth
						: 0,
					spaceCount = tabWidth - previousTabStopOffset;

				extraCharacterCount += spaceCount - 1; // -1 for the replaced tab
			});
			return Array.from(line).length + extraCharacterCount;
		}

		// The options object must be the last option specified…
		const options = Object.assign({}, context.options.at(-1));

		// …but max code length…
		if (typeof context.options[0] === "number") {
			options.code = context.options[0];
		}

		// …and tabWidth can be optionally specified directly as integers.
		if (typeof context.options[1] === "number") {
			options.tabWidth = context.options[1];
		}

		const maxLength = typeof options.code === "number" ? options.code : 80,
			tabWidth =
				typeof options.tabWidth === "number" ? options.tabWidth : 4,
			ignoreComments = !!options.ignoreComments,
			ignoreStrings = !!options.ignoreStrings,
			ignoreTemplateLiterals = !!options.ignoreTemplateLiterals,
			ignoreRegExpLiterals = !!options.ignoreRegExpLiterals,
			ignoreTrailingComments =
				!!options.ignoreTrailingComments || !!options.ignoreComments,
			ignoreUrls = !!options.ignoreUrls,
			maxCommentLength = options.comments;
		let ignorePattern = options.ignorePattern || null;

		if (ignorePattern) {
			ignorePattern = new RegExp(ignorePattern, "u");
		}

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Tells if a given comment is trailing: it starts on the current line and
		 * extends to or past the end of the current line.
		 * @param {string} line The source line we want to check for a trailing comment on
		 * @param {number} lineNumber The one-indexed line number for line
		 * @param {ASTNode} comment The comment to inspect
		 * @returns {boolean} If the comment is trailing on the given line
		 */
		function isTrailingComment(line, lineNumber, comment) {
			return (
				comment &&
				comment.loc.start.line === lineNumber &&
				lineNumber <= comment.loc.end.line &&
				(comment.loc.end.line > lineNumber ||
					comment.loc.end.column === line.length)
			);
		}

		/**
		 * Tells if a comment encompasses the entire line.
		 * @param {string} line The source line with a trailing comment
		 * @param {number} lineNumber The one-indexed line number this is on
		 * @param {ASTNode} comment The comment to remove
		 * @returns {boolean} If the comment covers the entire line
		 */
		function isFullLineComment(line, lineNumber, comment) {
			const start = comment.loc.start,
				end = comment.loc.end,
				isFirstTokenOnLine = !line
					.slice(0, comment.loc.start.column)
					.trim();

			return (
				comment &&
				(start.line < lineNumber ||
					(start.line === lineNumber && isFirstTokenOnLine)) &&
				(end.line > lineNumber ||
					(end.line === lineNumber && end.column === line.length))
			);
		}

		/**
		 * Check if a node is a JSXEmptyExpression contained in a single line JSXExpressionContainer.
		 * @param {ASTNode} node A node to check.
		 * @returns {boolean} True if the node is a JSXEmptyExpression contained in a single line JSXExpressionContainer.
		 */
		function isJSXEmptyExpressionInSingleLineContainer(node) {
			if (
				!node ||
				!node.parent ||
				node.type !== "JSXEmptyExpression" ||
				node.parent.type !== "JSXExpressionContainer"
			) {
				return false;
			}

			const parent = node.parent;

			return parent.loc.start.line === parent.loc.end.line;
		}

		/**
		 * Gets the line after the comment and any remaining trailing whitespace is
		 * stripped.
		 * @param {string} line The source line with a trailing comment
		 * @param {ASTNode} comment The comment to remove
		 * @returns {string} Line without comment and trailing whitespace
		 */
		function stripTrailingComment(line, comment) {
			// loc.column is zero-indexed
			return line.slice(0, comment.loc.start.column).replace(/\s+$/u, "");
		}

		/**
		 * Ensure that an array exists at [key] on `object`, and add `value` to it.
		 * @param {Object} object the object to mutate
		 * @param {string} key the object's key
		 * @param {any} value the value to add
		 * @returns {void}
		 * @private
		 */
		function ensureArrayAndPush(object, key, value) {
			if (!Array.isArray(object[key])) {
				object[key] = [];
			}
			object[key].push(value);
		}

		/**
		 * Retrieves an array containing all strings (" or ') in the source code.
		 * @returns {ASTNode[]} An array of string nodes.
		 */
		function getAllStrings() {
			return sourceCode.ast.tokens.filter(
				token =>
					token.type === "String" ||
					(token.type === "JSXText" &&
						sourceCode.getNodeByRangeIndex(token.range[0] - 1)
							.type === "JSXAttribute"),
			);
		}

		/**
		 * Retrieves an array containing all template literals in the source code.
		 * @returns {ASTNode[]} An array of template literal nodes.
		 */
		function getAllTemplateLiterals() {
			return sourceCode.ast.tokens.filter(
				token => token.type === "Template",
			);
		}

		/**
		 * Retrieves an array containing all RegExp literals in the source code.
		 * @returns {ASTNode[]} An array of RegExp literal nodes.
		 */
		function getAllRegExpLiterals() {
			return sourceCode.ast.tokens.filter(
				token => token.type === "RegularExpression",
			);
		}

		/**
		 *
		 * reduce an array of AST nodes by line number, both start and end.
		 * @param {ASTNode[]} arr array of AST nodes
		 * @returns {Object} accululated AST nodes
		 */
		function groupArrayByLineNumber(arr) {
			const obj = {};

			for (let i = 0; i < arr.length; i++) {
				const node = arr[i];

				for (let j = node.loc.start.line; j <= node.loc.end.line; ++j) {
					ensureArrayAndPush(obj, j, node);
				}
			}
			return obj;
		}

		/**
		 * Returns an array of all comments in the source code.
		 * If the element in the array is a JSXEmptyExpression contained with a single line JSXExpressionContainer,
		 * the element is changed with JSXExpressionContainer node.
		 * @returns {ASTNode[]} An array of comment nodes
		 */
		function getAllComments() {
			const comments = [];

			sourceCode.getAllComments().forEach(commentNode => {
				const containingNode = sourceCode.getNodeByRangeIndex(
					commentNode.range[0],
				);

				if (isJSXEmptyExpressionInSingleLineContainer(containingNode)) {
					// push a unique node only
					if (comments.at(-1) !== containingNode.parent) {
						comments.push(containingNode.parent);
					}
				} else {
					comments.push(commentNode);
				}
			});

			return comments;
		}

		/**
		 * Check the program for max length
		 * @param {ASTNode} node Node to examine
		 * @returns {void}
		 * @private
		 */
		function checkProgramForMaxLength(node) {
			// split (honors line-ending)
			const lines = sourceCode.lines,
				// list of comments to ignore
				comments =
					ignoreComments || maxCommentLength || ignoreTrailingComments
						? getAllComments()
						: [];

			// we iterate over comments in parallel with the lines
			let commentsIndex = 0;

			const strings = getAllStrings();
			const stringsByLine = groupArrayByLineNumber(strings);

			const templateLiterals = getAllTemplateLiterals();
			const templateLiteralsByLine =
				groupArrayByLineNumber(templateLiterals);

			const regExpLiterals = getAllRegExpLiterals();
			const regExpLiteralsByLine = groupArrayByLineNumber(regExpLiterals);

			lines.forEach((line, i) => {
				// i is zero-indexed, line numbers are one-indexed
				const lineNumber = i + 1;

				/*
				 * if we're checking comment length; we need to know whether this
				 * line is a comment
				 */
				let lineIsComment = false;
				let textToMeasure;

				/*
				 * We can short-circuit the comment checks if we're already out of
				 * comments to check.
				 */
				if (commentsIndex < comments.length) {
					let comment;

					// iterate over comments until we find one past the current line
					do {
						comment = comments[++commentsIndex];
					} while (comment && comment.loc.start.line <= lineNumber);

					// and step back by one
					comment = comments[--commentsIndex];

					if (isFullLineComment(line, lineNumber, comment)) {
						lineIsComment = true;
						textToMeasure = line;
					} else if (
						ignoreTrailingComments &&
						isTrailingComment(line, lineNumber, comment)
					) {
						textToMeasure = stripTrailingComment(line, comment);

						// ignore multiple trailing comments in the same line
						let lastIndex = commentsIndex;

						while (
							isTrailingComment(
								textToMeasure,
								lineNumber,
								comments[--lastIndex],
							)
						) {
							textToMeasure = stripTrailingComment(
								textToMeasure,
								comments[lastIndex],
							);
						}
					} else {
						textToMeasure = line;
					}
				} else {
					textToMeasure = line;
				}
				if (
					(ignorePattern && ignorePattern.test(textToMeasure)) ||
					(ignoreUrls && URL_REGEXP.test(textToMeasure)) ||
					(ignoreStrings && stringsByLine[lineNumber]) ||
					(ignoreTemplateLiterals &&
						templateLiteralsByLine[lineNumber]) ||
					(ignoreRegExpLiterals && regExpLiteralsByLine[lineNumber])
				) {
					// ignore this line
					return;
				}

				const lineLength = computeLineLength(textToMeasure, tabWidth);
				const commentLengthApplies = lineIsComment && maxCommentLength;

				if (lineIsComment && ignoreComments) {
					return;
				}

				const loc = {
					start: {
						line: lineNumber,
						column: 0,
					},
					end: {
						line: lineNumber,
						column: textToMeasure.length,
					},
				};

				if (commentLengthApplies) {
					if (lineLength > maxCommentLength) {
						context.report({
							node,
							loc,
							messageId: "maxComment",
							data: {
								lineLength,
								maxCommentLength,
							},
						});
					}
				} else if (lineLength > maxLength) {
					context.report({
						node,
						loc,
						messageId: "max",
						data: {
							lineLength,
							maxLength,
						},
					});
				}
			});
		}

		//--------------------------------------------------------------------------
		// Public API
		//--------------------------------------------------------------------------

		return {
			Program: checkProgramForMaxLength,
		};
	},
};
1R+)x/**
 * @fileoverview A rule to set the maximum number of line of code in a function.
 * @author Pete Ward <peteward44@gmail.com>
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");
const { upperCaseFirst } = require("../shared/string-utils");

//------------------------------------------------------------------------------
// Constants
//------------------------------------------------------------------------------

const OPTIONS_SCHEMA = {
	type: "object",
	properties: {
		max: {
			type: "integer",
			minimum: 0,
		},
		skipComments: {
			type: "boolean",
		},
		skipBlankLines: {
			type: "boolean",
		},
		IIFEs: {
			type: "boolean",
		},
	},
	additionalProperties: false,
};

const OPTIONS_OR_INTEGER_SCHEMA = {
	oneOf: [
		OPTIONS_SCHEMA,
		{
			type: "integer",
			minimum: 1,
		},
	],
};

/**
 * Given a list of comment nodes, return a map with numeric keys (source code line numbers) and comment token values.
 * @param {Array} comments An array of comment nodes.
 * @returns {Map<string, Node>} A map with numeric keys (source code line numbers) and comment token values.
 */
function getCommentLineNumbers(comments) {
	const map = new Map();

	comments.forEach(comment => {
		for (let i = comment.loc.start.line; i <= comment.loc.end.line; i++) {
			map.set(i, comment);
		}
	});
	return map;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Enforce a maximum number of lines of code in a function",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/max-lines-per-function",
		},

		schema: [OPTIONS_OR_INTEGER_SCHEMA],

		defaultOptions: [50],

		messages: {
			exceed: "{{name}} has too many lines ({{lineCount}}). Maximum allowed is {{maxLines}}.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const lines = sourceCode.lines;

		const option = context.options[0];
		let maxLines = 50;
		let skipComments = false;
		let skipBlankLines = false;
		let IIFEs = false;

		if (typeof option === "object") {
			maxLines = typeof option.max === "number" ? option.max : 50;
			skipComments = !!option.skipComments;
			skipBlankLines = !!option.skipBlankLines;
			IIFEs = !!option.IIFEs;
		} else if (typeof option === "number") {
			maxLines = option;
		}

		const commentLineNumbers = getCommentLineNumbers(
			sourceCode.getAllComments(),
		);

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Tells if a comment encompasses the entire line.
		 * @param {string} line The source line with a trailing comment
		 * @param {number} lineNumber The one-indexed line number this is on
		 * @param {ASTNode} comment The comment to remove
		 * @returns {boolean} If the comment covers the entire line
		 */
		function isFullLineComment(line, lineNumber, comment) {
			const start = comment.loc.start,
				end = comment.loc.end,
				isFirstTokenOnLine =
					start.line === lineNumber &&
					!line.slice(0, start.column).trim(),
				isLastTokenOnLine =
					end.line === lineNumber && !line.slice(end.column).trim();

			return (
				comment &&
				(start.line < lineNumber || isFirstTokenOnLine) &&
				(end.line > lineNumber || isLastTokenOnLine)
			);
		}

		/**
		 * Identifies is a node is a FunctionExpression which is part of an IIFE
		 * @param {ASTNode} node Node to test
		 * @returns {boolean} True if it's an IIFE
		 */
		function isIIFE(node) {
			return (
				(node.type === "FunctionExpression" ||
					node.type === "ArrowFunctionExpression") &&
				node.parent &&
				node.parent.type === "CallExpression" &&
				node.parent.callee === node
			);
		}

		/**
		 * Identifies is a node is a FunctionExpression which is embedded within a MethodDefinition or Property
		 * @param {ASTNode} node Node to test
		 * @returns {boolean} True if it's a FunctionExpression embedded within a MethodDefinition or Property
		 */
		function isEmbedded(node) {
			if (!node.parent) {
				return false;
			}
			if (node !== node.parent.value) {
				return false;
			}
			if (node.parent.type === "MethodDefinition") {
				return true;
			}
			if (node.parent.type === "Property") {
				return (
					node.parent.method === true ||
					node.parent.kind === "get" ||
					node.parent.kind === "set"
				);
			}
			return false;
		}

		/**
		 * Count the lines in the function
		 * @param {ASTNode} funcNode Function AST node
		 * @returns {void}
		 * @private
		 */
		function processFunction(funcNode) {
			const node = isEmbedded(funcNode) ? funcNode.parent : funcNode;

			if (!IIFEs && isIIFE(node)) {
				return;
			}
			let lineCount = 0;

			for (let i = node.loc.start.line - 1; i < node.loc.end.line; ++i) {
				const line = lines[i];

				if (skipComments) {
					if (
						commentLineNumbers.has(i + 1) &&
						isFullLineComment(
							line,
							i + 1,
							commentLineNumbers.get(i + 1),
						)
					) {
						continue;
					}
				}

				if (skipBlankLines) {
					if (line.match(/^\s*$/u)) {
						continue;
					}
				}

				lineCount++;
			}

			if (lineCount > maxLines) {
				const name = upperCaseFirst(
					astUtils.getFunctionNameWithKind(funcNode),
				);

				context.report({
					node,
					loc: astUtils.getFunctionHeadLoc(funcNode, sourceCode),
					messageId: "exceed",
					data: { name, lineCount, maxLines },
				});
			}
		}

		//--------------------------------------------------------------------------
		// Public API
		//--------------------------------------------------------------------------

		return {
			FunctionDeclaration: processFunction,
			FunctionExpression: processFunction,
			ArrowFunctionExpression: processFunction,
		};
	},
};
axN/**
 * @fileoverview enforce a maximum file length
 * @author Alberto Rodríguez
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Creates an array of numbers from `start` up to, but not including, `end`
 * @param {number} start The start of the range
 * @param {number} end The end of the range
 * @returns {number[]} The range of numbers
 */
function range(start, end) {
	return [...Array(end - start).keys()].map(x => x + start);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Enforce a maximum number of lines per file",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/max-lines",
		},

		schema: [
			{
				oneOf: [
					{
						type: "integer",
						minimum: 0,
					},
					{
						type: "object",
						properties: {
							max: {
								type: "integer",
								minimum: 0,
							},
							skipComments: {
								type: "boolean",
							},
							skipBlankLines: {
								type: "boolean",
							},
						},
						additionalProperties: false,
					},
				],
			},
		],

		defaultOptions: [300],

		messages: {
			exceed: "File has too many lines ({{actual}}). Maximum allowed is {{max}}.",
		},
	},

	create(context) {
		const option = context.options[0];
		let max = 300;

		if (typeof option === "object" && Object.hasOwn(option, "max")) {
			max = option.max;
		} else if (typeof option === "number") {
			max = option;
		}

		const skipComments = option && option.skipComments;
		const skipBlankLines = option && option.skipBlankLines;

		const sourceCode = context.sourceCode;

		/**
		 * Returns whether or not a token is a comment node type
		 * @param {Token} token The token to check
		 * @returns {boolean} True if the token is a comment node
		 */
		function isCommentNodeType(token) {
			return token && (token.type === "Block" || token.type === "Line");
		}

		/**
		 * Returns the line numbers of a comment that don't have any code on the same line
		 * @param {Node} comment The comment node to check
		 * @returns {number[]} The line numbers
		 */
		function getLinesWithoutCode(comment) {
			let start = comment.loc.start.line;
			let end = comment.loc.end.line;

			let token;

			token = comment;
			do {
				token = sourceCode.getTokenBefore(token, {
					includeComments: true,
				});
			} while (isCommentNodeType(token));

			if (token && astUtils.isTokenOnSameLine(token, comment)) {
				start += 1;
			}

			token = comment;
			do {
				token = sourceCode.getTokenAfter(token, {
					includeComments: true,
				});
			} while (isCommentNodeType(token));

			if (token && astUtils.isTokenOnSameLine(comment, token)) {
				end -= 1;
			}

			if (start <= end) {
				return range(start, end + 1);
			}
			return [];
		}

		return {
			"Program:exit"() {
				let lines = sourceCode.lines.map((text, i) => ({
					lineNumber: i + 1,
					text,
				}));

				/*
				 * If file ends with a linebreak, `sourceCode.lines` will have one extra empty line at the end.
				 * That isn't a real line, so we shouldn't count it.
				 */
				if (lines.length > 1 && lines.at(-1).text === "") {
					lines.pop();
				}

				if (skipBlankLines) {
					lines = lines.filter(l => l.text.trim() !== "");
				}

				if (skipComments) {
					const comments = sourceCode.getAllComments();

					const commentLines = new Set(
						comments.flatMap(getLinesWithoutCode),
					);

					lines = lines.filter(l => !commentLines.has(l.lineNumber));
				}

				if (lines.length > max) {
					const loc = {
						start: {
							line: lines[max].lineNumber,
							column: 0,
						},
						end: {
							line: sourceCode.lines.length,
							column: sourceCode.lines.at(-1).length,
						},
					};

					context.report({
						loc,
						messageId: "exceed",
						data: {
							max,
							actual: lines.length,
						},
					});
				}
			},
		};
	},
};
Vٟx=/**
 * @fileoverview Rule to enforce a maximum number of nested callbacks.
 * @author Ian Christian Myers
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Enforce a maximum depth that callbacks can be nested",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/max-nested-callbacks",
		},

		schema: [
			{
				oneOf: [
					{
						type: "integer",
						minimum: 0,
					},
					{
						type: "object",
						properties: {
							maximum: {
								type: "integer",
								minimum: 0,
							},
							max: {
								type: "integer",
								minimum: 0,
							},
							checkConstructorCallCallbacks: {
								type: "boolean",
							},
						},
						additionalProperties: false,
					},
				],
			},
		],

		defaultOptions: [10],

		messages: {
			exceed: "Too many nested callbacks ({{num}}). Maximum allowed is {{max}}.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		//--------------------------------------------------------------------------
		// Constants
		//--------------------------------------------------------------------------
		const option = context.options[0];
		let THRESHOLD = 10;

		if (
			typeof option === "object" &&
			(Object.hasOwn(option, "maximum") || Object.hasOwn(option, "max"))
		) {
			THRESHOLD = option.maximum || option.max;
		} else if (typeof option === "number") {
			THRESHOLD = option;
		}

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		const callbackStack = [];

		/**
		 * Checks a given function node for too many callbacks.
		 * @param {ASTNode} node The node to check.
		 * @returns {void}
		 * @private
		 */
		function checkFunction(node) {
			const parent = node.parent;

			if (
				(parent.type !== "CallExpression" &&
					!(
						option.checkConstructorCallCallbacks &&
						parent.type === "NewExpression"
					)) ||
				parent.callee === node
			) {
				return;
			}

			callbackStack.push(node);

			if (callbackStack.length > THRESHOLD) {
				const opts = { num: callbackStack.length, max: THRESHOLD };

				context.report({
					node,
					loc: astUtils.getFunctionHeadLoc(node, sourceCode),
					messageId: "exceed",
					data: opts,
				});
			}
		}

		/**
		 * Pops the call stack.
		 * @param {ASTNode} node The node to check.
		 * @returns {void}
		 * @private
		 */
		function popStack(node) {
			if (callbackStack.at(-1) === node) {
				callbackStack.pop();
			}
		}

		//--------------------------------------------------------------------------
		// Public API
		//--------------------------------------------------------------------------

		return {
			ArrowFunctionExpression: checkFunction,
			"ArrowFunctionExpression:exit": popStack,

			FunctionExpression: checkFunction,
			"FunctionExpression:exit": popStack,
		};
	},
};
|x/**
 * @fileoverview Rule to flag when a function has too many parameters
 * @author Ilya Volodin
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");
const { upperCaseFirst } = require("../shared/string-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Enforce a maximum number of parameters in function definitions",
			dialects: ["JavaScript", "TypeScript"],
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/max-params",
		},

		schema: [
			{
				oneOf: [
					{
						type: "integer",
						minimum: 0,
					},
					{
						type: "object",
						properties: {
							maximum: {
								type: "integer",
								minimum: 0,
							},
							max: {
								type: "integer",
								minimum: 0,
							},
							countVoidThis: {
								type: "boolean",
								description:
									"Whether to count a `this` declaration when the type is `void`.",
							},
							countThis: {
								enum: ["never", "except-void", "always"],
								description:
									"Whether to count a `this` declaration.",
							},
						},
						additionalProperties: false,
						not: { required: ["countVoidThis", "countThis"] },
					},
				],
			},
		],

		defaultOptions: [3],

		messages: {
			exceed: "{{name}} has too many parameters ({{count}}). Maximum allowed is {{max}}.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const option = context.options[0];
		let numParams = 3;
		let countThis = "except-void";

		if (typeof option === "object") {
			if (
				Object.hasOwn(option, "maximum") ||
				Object.hasOwn(option, "max")
			) {
				numParams = option.maximum || option.max;
			}

			countThis = option.countThis;
			if (!countThis && Object.hasOwn(option, "countVoidThis")) {
				countThis = option.countVoidThis ? "always" : "except-void";
			}
			countThis ||= "except-void";
		}
		if (typeof option === "number") {
			numParams = option;
		}

		/**
		 * Checks a function to see if it has too many parameters.
		 * @param {ASTNode} node The node to check.
		 * @returns {void}
		 * @private
		 */
		function checkFunction(node) {
			const thisParam =
				node.params.length > 0 &&
				node.params[0].type === "Identifier" &&
				node.params[0].name === "this"
					? node.params[0]
					: null;

			let effectiveParamCount = node.params.length;
			if (thisParam) {
				if (countThis === "never") {
					effectiveParamCount = node.params.length - 1;
				} else if (
					countThis === "except-void" &&
					thisParam.typeAnnotation?.typeAnnotation.type ===
						"TSVoidKeyword"
				) {
					effectiveParamCount = node.params.length - 1;
				}
			}

			if (effectiveParamCount > numParams) {
				context.report({
					loc: astUtils.getFunctionHeadLoc(node, sourceCode),
					node,
					messageId: "exceed",
					data: {
						name: upperCaseFirst(
							astUtils.getFunctionNameWithKind(node),
						),
						count: effectiveParamCount,
						max: numParams,
					},
				});
			}
		}

		return {
			FunctionDeclaration: checkFunction,
			ArrowFunctionExpression: checkFunction,
			FunctionExpression: checkFunction,
			TSDeclareFunction: checkFunction,
			TSFunctionType: checkFunction,
		};
	},
};
/OxR/**
 * @fileoverview Specify the maximum number of statements allowed per line.
 * @author Kenneth Williams
 * @deprecated in ESLint v8.53.0
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "max-statements-per-line",
						url: "https://eslint.style/rules/max-statements-per-line",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description:
				"Enforce a maximum number of statements allowed per line",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/max-statements-per-line",
		},

		schema: [
			{
				type: "object",
				properties: {
					max: {
						type: "integer",
						minimum: 1,
						default: 1,
					},
				},
				additionalProperties: false,
			},
		],
		messages: {
			exceed: "This line has {{numberOfStatementsOnThisLine}} {{statements}}. Maximum allowed is {{maxStatementsPerLine}}.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode,
			options = context.options[0] || {},
			maxStatementsPerLine =
				typeof options.max !== "undefined" ? options.max : 1;

		let lastStatementLine = 0,
			numberOfStatementsOnThisLine = 0,
			firstExtraStatement;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		const SINGLE_CHILD_ALLOWED =
			/^(?:(?:DoWhile|For|ForIn|ForOf|If|Labeled|While)Statement|Export(?:Default|Named)Declaration)$/u;

		/**
		 * Reports with the first extra statement, and clears it.
		 * @returns {void}
		 */
		function reportFirstExtraStatementAndClear() {
			if (firstExtraStatement) {
				context.report({
					node: firstExtraStatement,
					messageId: "exceed",
					data: {
						numberOfStatementsOnThisLine,
						maxStatementsPerLine,
						statements:
							numberOfStatementsOnThisLine === 1
								? "statement"
								: "statements",
					},
				});
			}
			firstExtraStatement = null;
		}

		/**
		 * Gets the actual last token of a given node.
		 * @param {ASTNode} node A node to get. This is a node except EmptyStatement.
		 * @returns {Token} The actual last token.
		 */
		function getActualLastToken(node) {
			return sourceCode.getLastToken(node, astUtils.isNotSemicolonToken);
		}

		/**
		 * Addresses a given node.
		 * It updates the state of this rule, then reports the node if the node violated this rule.
		 * @param {ASTNode} node A node to check.
		 * @returns {void}
		 */
		function enterStatement(node) {
			const line = node.loc.start.line;

			/*
			 * Skip to allow non-block statements if this is direct child of control statements.
			 * `if (a) foo();` is counted as 1.
			 * But `if (a) foo(); else foo();` should be counted as 2.
			 */
			if (
				SINGLE_CHILD_ALLOWED.test(node.parent.type) &&
				node.parent.alternate !== node
			) {
				return;
			}

			// Update state.
			if (line === lastStatementLine) {
				numberOfStatementsOnThisLine += 1;
			} else {
				reportFirstExtraStatementAndClear();
				numberOfStatementsOnThisLine = 1;
				lastStatementLine = line;
			}

			// Reports if the node violated this rule.
			if (numberOfStatementsOnThisLine === maxStatementsPerLine + 1) {
				firstExtraStatement = firstExtraStatement || node;
			}
		}

		/**
		 * Updates the state of this rule with the end line of leaving node to check with the next statement.
		 * @param {ASTNode} node A node to check.
		 * @returns {void}
		 */
		function leaveStatement(node) {
			const line = getActualLastToken(node).loc.end.line;

			// Update state.
			if (line !== lastStatementLine) {
				reportFirstExtraStatementAndClear();
				numberOfStatementsOnThisLine = 1;
				lastStatementLine = line;
			}
		}

		//--------------------------------------------------------------------------
		// Public API
		//--------------------------------------------------------------------------

		return {
			BreakStatement: enterStatement,
			ClassDeclaration: enterStatement,
			ContinueStatement: enterStatement,
			DebuggerStatement: enterStatement,
			DoWhileStatement: enterStatement,
			ExpressionStatement: enterStatement,
			ForInStatement: enterStatement,
			ForOfStatement: enterStatement,
			ForStatement: enterStatement,
			FunctionDeclaration: enterStatement,
			IfStatement: enterStatement,
			ImportDeclaration: enterStatement,
			LabeledStatement: enterStatement,
			ReturnStatement: enterStatement,
			SwitchStatement: enterStatement,
			ThrowStatement: enterStatement,
			TryStatement: enterStatement,
			VariableDeclaration: enterStatement,
			WhileStatement: enterStatement,
			WithStatement: enterStatement,
			ExportNamedDeclaration: enterStatement,
			ExportDefaultDeclaration: enterStatement,
			ExportAllDeclaration: enterStatement,

			"BreakStatement:exit": leaveStatement,
			"ClassDeclaration:exit": leaveStatement,
			"ContinueStatement:exit": leaveStatement,
			"DebuggerStatement:exit": leaveStatement,
			"DoWhileStatement:exit": leaveStatement,
			"ExpressionStatement:exit": leaveStatement,
			"ForInStatement:exit": leaveStatement,
			"ForOfStatement:exit": leaveStatement,
			"ForStatement:exit": leaveStatement,
			"FunctionDeclaration:exit": leaveStatement,
			"IfStatement:exit": leaveStatement,
			"ImportDeclaration:exit": leaveStatement,
			"LabeledStatement:exit": leaveStatement,
			"ReturnStatement:exit": leaveStatement,
			"SwitchStatement:exit": leaveStatement,
			"ThrowStatement:exit": leaveStatement,
			"TryStatement:exit": leaveStatement,
			"VariableDeclaration:exit": leaveStatement,
			"WhileStatement:exit": leaveStatement,
			"WithStatement:exit": leaveStatement,
			"ExportNamedDeclaration:exit": leaveStatement,
			"ExportDefaultDeclaration:exit": leaveStatement,
			"ExportAllDeclaration:exit": leaveStatement,
			"Program:exit": reportFirstExtraStatementAndClear,
		};
	},
};
7}ảx:/**
 * @fileoverview A rule to set the maximum number of statements in a function.
 * @author Ian Christian Myers
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");
const { upperCaseFirst } = require("../shared/string-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Enforce a maximum number of statements allowed in function blocks",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/max-statements",
		},

		schema: [
			{
				oneOf: [
					{
						type: "integer",
						minimum: 0,
					},
					{
						type: "object",
						properties: {
							maximum: {
								type: "integer",
								minimum: 0,
							},
							max: {
								type: "integer",
								minimum: 0,
							},
						},
						additionalProperties: false,
					},
				],
			},
			{
				type: "object",
				properties: {
					ignoreTopLevelFunctions: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		defaultOptions: [10],

		messages: {
			exceed: "{{name}} has too many statements ({{count}}). Maximum allowed is {{max}}.",
		},
	},

	create(context) {
		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		const functionStack = [],
			option = context.options[0],
			ignoreTopLevelFunctions =
				(context.options[1] &&
					context.options[1].ignoreTopLevelFunctions) ||
				false,
			topLevelFunctions = [];
		let maxStatements = 10;

		if (
			typeof option === "object" &&
			(Object.hasOwn(option, "maximum") || Object.hasOwn(option, "max"))
		) {
			maxStatements = option.maximum || option.max;
		} else if (typeof option === "number") {
			maxStatements = option;
		}

		/**
		 * Reports a node if it has too many statements
		 * @param {ASTNode} node node to evaluate
		 * @param {number} count Number of statements in node
		 * @param {number} max Maximum number of statements allowed
		 * @returns {void}
		 * @private
		 */
		function reportIfTooManyStatements(node, count, max) {
			if (count > max) {
				const name = upperCaseFirst(
					astUtils.getFunctionNameWithKind(node),
				);

				context.report({
					node,
					loc: astUtils.getFunctionHeadLoc(node, context.sourceCode),
					messageId: "exceed",
					data: { name, count, max },
				});
			}
		}

		/**
		 * When parsing a new function, store it in our function stack
		 * @returns {void}
		 * @private
		 */
		function startFunction() {
			functionStack.push(0);
		}

		/**
		 * Evaluate the node at the end of function
		 * @param {ASTNode} node node to evaluate
		 * @returns {void}
		 * @private
		 */
		function endFunction(node) {
			const count = functionStack.pop();

			/*
			 * This rule does not apply to class static blocks, but we have to track them so
			 * that statements in them do not count as statements in the enclosing function.
			 */
			if (node.type === "StaticBlock") {
				return;
			}

			if (ignoreTopLevelFunctions && functionStack.length === 0) {
				topLevelFunctions.push({ node, count });
			} else {
				reportIfTooManyStatements(node, count, maxStatements);
			}
		}

		/**
		 * Increment the count of the functions
		 * @param {ASTNode} node node to evaluate
		 * @returns {void}
		 * @private
		 */
		function countStatements(node) {
			functionStack[functionStack.length - 1] += node.body.length;
		}

		//--------------------------------------------------------------------------
		// Public API
		//--------------------------------------------------------------------------

		return {
			FunctionDeclaration: startFunction,
			FunctionExpression: startFunction,
			ArrowFunctionExpression: startFunction,
			StaticBlock: startFunction,

			BlockStatement: countStatements,

			"FunctionDeclaration:exit": endFunction,
			"FunctionExpression:exit": endFunction,
			"ArrowFunctionExpression:exit": endFunction,
			"StaticBlock:exit": endFunction,

			"Program:exit"() {
				if (topLevelFunctions.length === 1) {
					return;
				}

				topLevelFunctions.forEach(element => {
					const count = element.count;
					const node = element.node;

					reportIfTooManyStatements(node, count, maxStatements);
				});
			},
		};
	},
};
r:@xG$/**
 * @fileoverview enforce a particular style for multiline comments
 * @author Teddy Katz
 * @deprecated in ESLint v9.3.0
 */
"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "9.3.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "multiline-comment-style",
						url: "https://eslint.style/rules/multiline-comment-style",
					},
				},
			],
		},
		type: "suggestion",
		docs: {
			description: "Enforce a particular style for multiline comments",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/multiline-comment-style",
		},

		fixable: "whitespace",
		schema: {
			anyOf: [
				{
					type: "array",
					items: [
						{
							enum: ["starred-block", "bare-block"],
						},
					],
					additionalItems: false,
				},
				{
					type: "array",
					items: [
						{
							enum: ["separate-lines"],
						},
						{
							type: "object",
							properties: {
								checkJSDoc: {
									type: "boolean",
								},
							},
							additionalProperties: false,
						},
					],
					additionalItems: false,
				},
			],
		},
		messages: {
			expectedBlock:
				"Expected a block comment instead of consecutive line comments.",
			expectedBareBlock:
				"Expected a block comment without padding stars.",
			startNewline: "Expected a linebreak after '/*'.",
			endNewline: "Expected a linebreak before '*/'.",
			missingStar: "Expected a '*' at the start of this line.",
			alignment:
				"Expected this line to be aligned with the start of the comment.",
			expectedLines:
				"Expected multiple line comments instead of a block comment.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const option = context.options[0] || "starred-block";
		const params = context.options[1] || {};
		const checkJSDoc = !!params.checkJSDoc;

		//----------------------------------------------------------------------
		// Helpers
		//----------------------------------------------------------------------

		/**
		 * Checks if a comment line is starred.
		 * @param {string} line A string representing a comment line.
		 * @returns {boolean} Whether or not the comment line is starred.
		 */
		function isStarredCommentLine(line) {
			return /^\s*\*/u.test(line);
		}

		/**
		 * Checks if a comment group is in starred-block form.
		 * @param {Token[]} commentGroup A group of comments, containing either multiple line comments or a single block comment.
		 * @returns {boolean} Whether or not the comment group is in starred block form.
		 */
		function isStarredBlockComment([firstComment]) {
			if (firstComment.type !== "Block") {
				return false;
			}

			const lines = firstComment.value.split(astUtils.LINEBREAK_MATCHER);

			// The first and last lines can only contain whitespace.
			return (
				lines.length > 0 &&
				lines.every((line, i) =>
					(i === 0 || i === lines.length - 1
						? /^\s*$/u
						: /^\s*\*/u
					).test(line),
				)
			);
		}

		/**
		 * Checks if a comment group is in JSDoc form.
		 * @param {Token[]} commentGroup A group of comments, containing either multiple line comments or a single block comment.
		 * @returns {boolean} Whether or not the comment group is in JSDoc form.
		 */
		function isJSDocComment([firstComment]) {
			if (firstComment.type !== "Block") {
				return false;
			}

			const lines = firstComment.value.split(astUtils.LINEBREAK_MATCHER);

			return (
				/^\*\s*$/u.test(lines[0]) &&
				lines.slice(1, -1).every(line => /^\s* /u.test(line)) &&
				/^\s*$/u.test(lines.at(-1))
			);
		}

		/**
		 * Processes a comment group that is currently in separate-line form, calculating the offset for each line.
		 * @param {Token[]} commentGroup A group of comments containing multiple line comments.
		 * @returns {string[]} An array of the processed lines.
		 */
		function processSeparateLineComments(commentGroup) {
			const allLinesHaveLeadingSpace = commentGroup
				.map(({ value }) => value)
				.filter(line => line.trim().length)
				.every(line => line.startsWith(" "));

			return commentGroup.map(({ value }) =>
				allLinesHaveLeadingSpace ? value.replace(/^ /u, "") : value,
			);
		}

		/**
		 * Processes a comment group that is currently in starred-block form, calculating the offset for each line.
		 * @param {Token} comment A single block comment token in starred-block form.
		 * @returns {string[]} An array of the processed lines.
		 */
		function processStarredBlockComment(comment) {
			const lines = comment.value
				.split(astUtils.LINEBREAK_MATCHER)
				.filter(
					(line, i, linesArr) =>
						!(i === 0 || i === linesArr.length - 1),
				)
				.map(line => line.replace(/^\s*$/u, ""));
			const allLinesHaveLeadingSpace = lines
				.map(line => line.replace(/\s*\*/u, ""))
				.filter(line => line.trim().length)
				.every(line => line.startsWith(" "));

			return lines.map(line =>
				line.replace(
					allLinesHaveLeadingSpace ? /\s*\* ?/u : /\s*\*/u,
					"",
				),
			);
		}

		/**
		 * Processes a comment group that is currently in bare-block form, calculating the offset for each line.
		 * @param {Token} comment A single block comment token in bare-block form.
		 * @returns {string[]} An array of the processed lines.
		 */
		function processBareBlockComment(comment) {
			const lines = comment.value
				.split(astUtils.LINEBREAK_MATCHER)
				.map(line => line.replace(/^\s*$/u, ""));
			const leadingWhitespace = `${sourceCode.text.slice(comment.range[0] - comment.loc.start.column, comment.range[0])}   `;
			let offset = "";

			/*
			 * Calculate the offset of the least indented line and use that as the basis for offsetting all the lines.
			 * The first line should not be checked because it is inline with the opening block comment delimiter.
			 */
			for (const [i, line] of lines.entries()) {
				if (!line.trim().length || i === 0) {
					continue;
				}

				const [, lineOffset] = line.match(/^(\s*\*?\s*)/u);

				if (lineOffset.length < leadingWhitespace.length) {
					const newOffset = leadingWhitespace.slice(
						lineOffset.length - leadingWhitespace.length,
					);

					if (newOffset.length > offset.length) {
						offset = newOffset;
					}
				}
			}

			return lines.map(line => {
				const match = line.match(/^(\s*\*?\s*)(.*)/u);
				const [, lineOffset, lineContents] = match;

				if (lineOffset.length > leadingWhitespace.length) {
					return `${lineOffset.slice(leadingWhitespace.length - (offset.length + lineOffset.length))}${lineContents}`;
				}

				if (lineOffset.length < leadingWhitespace.length) {
					return `${lineOffset.slice(leadingWhitespace.length)}${lineContents}`;
				}

				return lineContents;
			});
		}

		/**
		 * Gets a list of comment lines in a group, formatting leading whitespace as necessary.
		 * @param {Token[]} commentGroup A group of comments containing either multiple line comments or a single block comment.
		 * @returns {string[]} A list of comment lines.
		 */
		function getCommentLines(commentGroup) {
			const [firstComment] = commentGroup;

			if (firstComment.type === "Line") {
				return processSeparateLineComments(commentGroup);
			}

			if (isStarredBlockComment(commentGroup)) {
				return processStarredBlockComment(firstComment);
			}

			return processBareBlockComment(firstComment);
		}

		/**
		 * Gets the initial offset (whitespace) from the beginning of a line to a given comment token.
		 * @param {Token} comment The token to check.
		 * @returns {string} The offset from the beginning of a line to the token.
		 */
		function getInitialOffset(comment) {
			return sourceCode.text.slice(
				comment.range[0] - comment.loc.start.column,
				comment.range[0],
			);
		}

		/**
		 * Converts a comment into starred-block form
		 * @param {Token} firstComment The first comment of the group being converted
		 * @param {string[]} commentLinesList A list of lines to appear in the new starred-block comment
		 * @returns {string} A representation of the comment value in starred-block form, excluding start and end markers
		 */
		function convertToStarredBlock(firstComment, commentLinesList) {
			const initialOffset = getInitialOffset(firstComment);

			return `/*\n${commentLinesList.map(line => `${initialOffset} * ${line}`).join("\n")}\n${initialOffset} */`;
		}

		/**
		 * Converts a comment into separate-line form
		 * @param {Token} firstComment The first comment of the group being converted
		 * @param {string[]} commentLinesList A list of lines to appear in the new starred-block comment
		 * @returns {string} A representation of the comment value in separate-line form
		 */
		function convertToSeparateLines(firstComment, commentLinesList) {
			return commentLinesList
				.map(line => `// ${line}`)
				.join(`\n${getInitialOffset(firstComment)}`);
		}

		/**
		 * Converts a comment into bare-block form
		 * @param {Token} firstComment The first comment of the group being converted
		 * @param {string[]} commentLinesList A list of lines to appear in the new starred-block comment
		 * @returns {string} A representation of the comment value in bare-block form
		 */
		function convertToBlock(firstComment, commentLinesList) {
			return `/* ${commentLinesList.join(`\n${getInitialOffset(firstComment)}   `)} */`;
		}

		/**
		 * Each method checks a group of comments to see if it's valid according to the given option.
		 * @param {Token[]} commentGroup A list of comments that appear together. This will either contain a single
		 * block comment or multiple line comments.
		 * @returns {void}
		 */
		const commentGroupCheckers = {
			"starred-block"(commentGroup) {
				const [firstComment] = commentGroup;
				const commentLines = getCommentLines(commentGroup);

				if (commentLines.some(value => value.includes("*/"))) {
					return;
				}

				if (commentGroup.length > 1) {
					context.report({
						loc: {
							start: firstComment.loc.start,
							end: commentGroup.at(-1).loc.end,
						},
						messageId: "expectedBlock",
						fix(fixer) {
							const range = [
								firstComment.range[0],
								commentGroup.at(-1).range[1],
							];

							return commentLines.some(value =>
								value.startsWith("/"),
							)
								? null
								: fixer.replaceTextRange(
										range,
										convertToStarredBlock(
											firstComment,
											commentLines,
										),
									);
						},
					});
				} else {
					const lines = firstComment.value.split(
						astUtils.LINEBREAK_MATCHER,
					);
					const expectedLeadingWhitespace =
						getInitialOffset(firstComment);
					const expectedLinePrefix = `${expectedLeadingWhitespace} *`;

					if (!/^\*?\s*$/u.test(lines[0])) {
						const start = firstComment.value.startsWith("*")
							? firstComment.range[0] + 1
							: firstComment.range[0];

						context.report({
							loc: {
								start: firstComment.loc.start,
								end: {
									line: firstComment.loc.start.line,
									column: firstComment.loc.start.column + 2,
								},
							},
							messageId: "startNewline",
							fix: fixer =>
								fixer.insertTextAfterRange(
									[start, start + 2],
									`\n${expectedLinePrefix}`,
								),
						});
					}

					if (!/^\s*$/u.test(lines.at(-1))) {
						context.report({
							loc: {
								start: {
									line: firstComment.loc.end.line,
									column: firstComment.loc.end.column - 2,
								},
								end: firstComment.loc.end,
							},
							messageId: "endNewline",
							fix: fixer =>
								fixer.replaceTextRange(
									[
										firstComment.range[1] - 2,
										firstComment.range[1],
									],
									`\n${expectedLinePrefix}/`,
								),
						});
					}

					for (
						let lineNumber = firstComment.loc.start.line + 1;
						lineNumber <= firstComment.loc.end.line;
						lineNumber++
					) {
						const lineText = sourceCode.lines[lineNumber - 1];
						const errorType = isStarredCommentLine(lineText)
							? "alignment"
							: "missingStar";

						if (!lineText.startsWith(expectedLinePrefix)) {
							context.report({
								loc: {
									start: { line: lineNumber, column: 0 },
									end: {
										line: lineNumber,
										column: lineText.length,
									},
								},
								messageId: errorType,
								fix(fixer) {
									const lineStartIndex =
										sourceCode.getIndexFromLoc({
											line: lineNumber,
											column: 0,
										});

									if (errorType === "alignment") {
										const [, commentTextPrefix = ""] =
											lineText.match(/^(\s*\*)/u) || [];
										const commentTextStartIndex =
											lineStartIndex +
											commentTextPrefix.length;

										return fixer.replaceTextRange(
											[
												lineStartIndex,
												commentTextStartIndex,
											],
											expectedLinePrefix,
										);
									}

									const [, commentTextPrefix = ""] =
										lineText.match(/^(\s*)/u) || [];
									const commentTextStartIndex =
										lineStartIndex +
										commentTextPrefix.length;
									let offset;

									for (const [idx, line] of lines.entries()) {
										if (!/\S+/u.test(line)) {
											continue;
										}

										const lineTextToAlignWith =
											sourceCode.lines[
												firstComment.loc.start.line -
													1 +
													idx
											];
										const [
											,
											prefix = "",
											initialOffset = "",
										] =
											lineTextToAlignWith.match(
												/^(\s*(?:\/?\*)?(\s*))/u,
											) || [];

										offset = `${commentTextPrefix.slice(prefix.length)}${initialOffset}`;

										if (
											/^\s*\//u.test(lineText) &&
											offset.length === 0
										) {
											offset += " ";
										}
										break;
									}

									return fixer.replaceTextRange(
										[lineStartIndex, commentTextStartIndex],
										`${expectedLinePrefix}${offset}`,
									);
								},
							});
						}
					}
				}
			},
			"separate-lines"(commentGroup) {
				const [firstComment] = commentGroup;

				const isJSDoc = isJSDocComment(commentGroup);

				if (firstComment.type !== "Block" || (!checkJSDoc && isJSDoc)) {
					return;
				}

				let commentLines = getCommentLines(commentGroup);

				if (isJSDoc) {
					commentLines = commentLines.slice(
						1,
						commentLines.length - 1,
					);
				}

				const tokenAfter = sourceCode.getTokenAfter(firstComment, {
					includeComments: true,
				});

				if (
					tokenAfter &&
					firstComment.loc.end.line === tokenAfter.loc.start.line
				) {
					return;
				}

				context.report({
					loc: {
						start: firstComment.loc.start,
						end: {
							line: firstComment.loc.start.line,
							column: firstComment.loc.start.column + 2,
						},
					},
					messageId: "expectedLines",
					fix(fixer) {
						return fixer.replaceText(
							firstComment,
							convertToSeparateLines(firstComment, commentLines),
						);
					},
				});
			},
			"bare-block"(commentGroup) {
				if (isJSDocComment(commentGroup)) {
					return;
				}

				const [firstComment] = commentGroup;
				const commentLines = getCommentLines(commentGroup);

				// Disallows consecutive line comments in favor of using a block comment.
				if (
					firstComment.type === "Line" &&
					commentLines.length > 1 &&
					!commentLines.some(value => value.includes("*/"))
				) {
					context.report({
						loc: {
							start: firstComment.loc.start,
							end: commentGroup.at(-1).loc.end,
						},
						messageId: "expectedBlock",
						fix(fixer) {
							return fixer.replaceTextRange(
								[
									firstComment.range[0],
									commentGroup.at(-1).range[1],
								],
								convertToBlock(firstComment, commentLines),
							);
						},
					});
				}

				// Prohibits block comments from having a * at the beginning of each line.
				if (isStarredBlockComment(commentGroup)) {
					context.report({
						loc: {
							start: firstComment.loc.start,
							end: {
								line: firstComment.loc.start.line,
								column: firstComment.loc.start.column + 2,
							},
						},
						messageId: "expectedBareBlock",
						fix(fixer) {
							return fixer.replaceText(
								firstComment,
								convertToBlock(firstComment, commentLines),
							);
						},
					});
				}
			},
		};

		//----------------------------------------------------------------------
		// Public
		//----------------------------------------------------------------------

		return {
			Program() {
				return sourceCode
					.getAllComments()
					.filter(comment => comment.type !== "Shebang")
					.filter(
						comment =>
							!astUtils.COMMENTS_IGNORE_PATTERN.test(
								comment.value,
							),
					)
					.filter(comment => {
						const tokenBefore = sourceCode.getTokenBefore(comment, {
							includeComments: true,
						});

						return (
							!tokenBefore ||
							tokenBefore.loc.end.line < comment.loc.start.line
						);
					})
					.reduce((commentGroups, comment, index, commentList) => {
						const tokenBefore = sourceCode.getTokenBefore(comment, {
							includeComments: true,
						});

						if (
							comment.type === "Line" &&
							index &&
							commentList[index - 1].type === "Line" &&
							tokenBefore &&
							tokenBefore.loc.end.line ===
								comment.loc.start.line - 1 &&
							tokenBefore === commentList[index - 1]
						) {
							commentGroups.at(-1).push(comment);
						} else {
							commentGroups.push([comment]);
						}

						return commentGroups;
					}, [])
					.filter(
						commentGroup =>
							!(
								commentGroup.length === 1 &&
								commentGroup[0].loc.start.line ===
									commentGroup[0].loc.end.line
							),
					)
					.forEach(commentGroupCheckers[option]);
			},
		};
	},
};
MЮxr/**
 * @fileoverview Enforce newlines between operands of ternary expressions
 * @author Kai Cataldo
 * @deprecated in ESLint v8.53.0
 */

"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "multiline-ternary",
						url: "https://eslint.style/rules/multiline-ternary",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description:
				"Enforce newlines between operands of ternary expressions",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/multiline-ternary",
		},

		schema: [
			{
				enum: ["always", "always-multiline", "never"],
			},
		],

		messages: {
			expectedTestCons:
				"Expected newline between test and consequent of ternary expression.",
			expectedConsAlt:
				"Expected newline between consequent and alternate of ternary expression.",
			unexpectedTestCons:
				"Unexpected newline between test and consequent of ternary expression.",
			unexpectedConsAlt:
				"Unexpected newline between consequent and alternate of ternary expression.",
		},

		fixable: "whitespace",
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const option = context.options[0];
		const multiline = option !== "never";
		const allowSingleLine = option === "always-multiline";

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			ConditionalExpression(node) {
				const questionToken = sourceCode.getTokenAfter(
					node.test,
					astUtils.isNotClosingParenToken,
				);
				const colonToken = sourceCode.getTokenAfter(
					node.consequent,
					astUtils.isNotClosingParenToken,
				);

				const firstTokenOfTest = sourceCode.getFirstToken(node);
				const lastTokenOfTest =
					sourceCode.getTokenBefore(questionToken);
				const firstTokenOfConsequent =
					sourceCode.getTokenAfter(questionToken);
				const lastTokenOfConsequent =
					sourceCode.getTokenBefore(colonToken);
				const firstTokenOfAlternate =
					sourceCode.getTokenAfter(colonToken);

				const areTestAndConsequentOnSameLine =
					astUtils.isTokenOnSameLine(
						lastTokenOfTest,
						firstTokenOfConsequent,
					);
				const areConsequentAndAlternateOnSameLine =
					astUtils.isTokenOnSameLine(
						lastTokenOfConsequent,
						firstTokenOfAlternate,
					);

				const hasComments = !!sourceCode.getCommentsInside(node).length;

				if (!multiline) {
					if (!areTestAndConsequentOnSameLine) {
						context.report({
							node: node.test,
							loc: {
								start: firstTokenOfTest.loc.start,
								end: lastTokenOfTest.loc.end,
							},
							messageId: "unexpectedTestCons",
							fix(fixer) {
								if (hasComments) {
									return null;
								}
								const fixers = [];
								const areTestAndQuestionOnSameLine =
									astUtils.isTokenOnSameLine(
										lastTokenOfTest,
										questionToken,
									);
								const areQuestionAndConsOnSameLine =
									astUtils.isTokenOnSameLine(
										questionToken,
										firstTokenOfConsequent,
									);

								if (!areTestAndQuestionOnSameLine) {
									fixers.push(
										fixer.removeRange([
											lastTokenOfTest.range[1],
											questionToken.range[0],
										]),
									);
								}
								if (!areQuestionAndConsOnSameLine) {
									fixers.push(
										fixer.removeRange([
											questionToken.range[1],
											firstTokenOfConsequent.range[0],
										]),
									);
								}

								return fixers;
							},
						});
					}

					if (!areConsequentAndAlternateOnSameLine) {
						context.report({
							node: node.consequent,
							loc: {
								start: firstTokenOfConsequent.loc.start,
								end: lastTokenOfConsequent.loc.end,
							},
							messageId: "unexpectedConsAlt",
							fix(fixer) {
								if (hasComments) {
									return null;
								}
								const fixers = [];
								const areConsAndColonOnSameLine =
									astUtils.isTokenOnSameLine(
										lastTokenOfConsequent,
										colonToken,
									);
								const areColonAndAltOnSameLine =
									astUtils.isTokenOnSameLine(
										colonToken,
										firstTokenOfAlternate,
									);

								if (!areConsAndColonOnSameLine) {
									fixers.push(
										fixer.removeRange([
											lastTokenOfConsequent.range[1],
											colonToken.range[0],
										]),
									);
								}
								if (!areColonAndAltOnSameLine) {
									fixers.push(
										fixer.removeRange([
											colonToken.range[1],
											firstTokenOfAlternate.range[0],
										]),
									);
								}

								return fixers;
							},
						});
					}
				} else {
					if (
						allowSingleLine &&
						node.loc.start.line === node.loc.end.line
					) {
						return;
					}

					if (areTestAndConsequentOnSameLine) {
						context.report({
							node: node.test,
							loc: {
								start: firstTokenOfTest.loc.start,
								end: lastTokenOfTest.loc.end,
							},
							messageId: "expectedTestCons",
							fix: fixer =>
								hasComments
									? null
									: fixer.replaceTextRange(
											[
												lastTokenOfTest.range[1],
												questionToken.range[0],
											],
											"\n",
										),
						});
					}

					if (areConsequentAndAlternateOnSameLine) {
						context.report({
							node: node.consequent,
							loc: {
								start: firstTokenOfConsequent.loc.start,
								end: lastTokenOfConsequent.loc.end,
							},
							messageId: "expectedConsAlt",
							fix: fixer =>
								hasComments
									? null
									: fixer.replaceTextRange(
											[
												lastTokenOfConsequent.range[1],
												colonToken.range[0],
											],
											"\n",
										),
						});
					}
				}
			},
		};
	},
};
]]x$/**
 * @fileoverview Rule to flag use of constructors without capital letters
 * @author Nicholas C. Zakas
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const CAPS_ALLOWED = [
	"Array",
	"Boolean",
	"Date",
	"Error",
	"Function",
	"Number",
	"Object",
	"RegExp",
	"String",
	"Symbol",
	"BigInt",
];

/**
 * A reducer function to invert an array to an Object mapping the string form of the key, to `true`.
 * @param {Object} map Accumulator object for the reduce.
 * @param {string} key Object key to set to `true`.
 * @returns {Object} Returns the updated Object for further reduction.
 */
function invert(map, key) {
	map[key] = true;
	return map;
}

/**
 * Creates an object with the cap is new exceptions as its keys and true as their values.
 * @param {Object} config Rule configuration
 * @returns {Object} Object with cap is new exceptions.
 */
function calculateCapIsNewExceptions(config) {
	const capIsNewExceptions = Array.from(
		new Set([...config.capIsNewExceptions, ...CAPS_ALLOWED]),
	);

	return capIsNewExceptions.reduce(invert, {});
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Require constructor names to begin with a capital letter",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/new-cap",
		},

		schema: [
			{
				type: "object",
				properties: {
					newIsCap: {
						type: "boolean",
					},
					capIsNew: {
						type: "boolean",
					},
					newIsCapExceptions: {
						type: "array",
						items: {
							type: "string",
						},
					},
					newIsCapExceptionPattern: {
						type: "string",
					},
					capIsNewExceptions: {
						type: "array",
						items: {
							type: "string",
						},
					},
					capIsNewExceptionPattern: {
						type: "string",
					},
					properties: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		defaultOptions: [
			{
				capIsNew: true,
				capIsNewExceptions: CAPS_ALLOWED,
				newIsCap: true,
				newIsCapExceptions: [],
				properties: true,
			},
		],

		messages: {
			upper: "A function with a name starting with an uppercase letter should only be used as a constructor.",
			lower: "A constructor name should not start with a lowercase letter.",
		},
	},

	create(context) {
		const [config] = context.options;
		const skipProperties = !config.properties;

		const newIsCapExceptions = config.newIsCapExceptions.reduce(invert, {});
		const newIsCapExceptionPattern = config.newIsCapExceptionPattern
			? new RegExp(config.newIsCapExceptionPattern, "u")
			: null;

		const capIsNewExceptions = calculateCapIsNewExceptions(config);
		const capIsNewExceptionPattern = config.capIsNewExceptionPattern
			? new RegExp(config.capIsNewExceptionPattern, "u")
			: null;

		const listeners = {};

		const sourceCode = context.sourceCode;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Get exact callee name from expression
		 * @param {ASTNode} node CallExpression or NewExpression node
		 * @returns {string} name
		 */
		function extractNameFromExpression(node) {
			return node.callee.type === "Identifier"
				? node.callee.name
				: astUtils.getStaticPropertyName(node.callee) || "";
		}

		/**
		 * Returns the capitalization state of the string -
		 * Whether the first character is uppercase, lowercase, or non-alphabetic
		 * @param {string} str String
		 * @returns {string} capitalization state: "non-alpha", "lower", or "upper"
		 */
		function getCap(str) {
			const firstChar = str.charAt(0);

			const firstCharLower = firstChar.toLowerCase();
			const firstCharUpper = firstChar.toUpperCase();

			if (firstCharLower === firstCharUpper) {
				// char has no uppercase variant, so it's non-alphabetic
				return "non-alpha";
			}
			if (firstChar === firstCharLower) {
				return "lower";
			}
			return "upper";
		}

		/**
		 * Check if capitalization is allowed for a CallExpression
		 * @param {Object} allowedMap Object mapping calleeName to a Boolean
		 * @param {ASTNode} node CallExpression node
		 * @param {string} calleeName Capitalized callee name from a CallExpression
		 * @param {Object} pattern RegExp object from options pattern
		 * @returns {boolean} Returns true if the callee may be capitalized
		 */
		function isCapAllowed(allowedMap, node, calleeName, pattern) {
			const sourceText = sourceCode.getText(node.callee);

			if (allowedMap[calleeName] || allowedMap[sourceText]) {
				return true;
			}

			if (pattern && pattern.test(sourceText)) {
				return true;
			}

			const callee = astUtils.skipChainExpression(node.callee);

			if (calleeName === "UTC" && callee.type === "MemberExpression") {
				// allow if callee is Date.UTC
				return (
					callee.object.type === "Identifier" &&
					callee.object.name === "Date"
				);
			}

			return skipProperties && callee.type === "MemberExpression";
		}

		/**
		 * Reports the given messageId for the given node. The location will be the start of the property or the callee.
		 * @param {ASTNode} node CallExpression or NewExpression node.
		 * @param {string} messageId The messageId to report.
		 * @returns {void}
		 */
		function report(node, messageId) {
			let callee = astUtils.skipChainExpression(node.callee);

			if (callee.type === "MemberExpression") {
				callee = callee.property;
			}

			context.report({ node, loc: callee.loc, messageId });
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		if (config.newIsCap) {
			listeners.NewExpression = function (node) {
				const constructorName = extractNameFromExpression(node);

				if (constructorName) {
					const capitalization = getCap(constructorName);
					const isAllowed =
						capitalization !== "lower" ||
						isCapAllowed(
							newIsCapExceptions,
							node,
							constructorName,
							newIsCapExceptionPattern,
						);

					if (!isAllowed) {
						report(node, "lower");
					}
				}
			};
		}

		if (config.capIsNew) {
			listeners.CallExpression = function (node) {
				const calleeName = extractNameFromExpression(node);

				if (calleeName) {
					const capitalization = getCap(calleeName);
					const isAllowed =
						capitalization !== "upper" ||
						isCapAllowed(
							capIsNewExceptions,
							node,
							calleeName,
							capIsNewExceptionPattern,
						);

					if (!isAllowed) {
						report(node, "upper");
					}
				}
			};
		}

		return listeners;
	},
};
ZZ=]ux'7Gflag when using constructor without parentheses
 * @author Ilya VolodinX&}qSxne 2neVQI
				"Enforce or disallow parentheses when invoking a constructor with noRne($M'never"],
			},
		],
		messages: {
			missing: "Missing '()' invoking a constructor.",
			unnecessary:
				"Unnecessary '()' inv$oking a constructor with no argument	*Xoptions = context.options;
		const always = options[0] !== "never"; // Default is always
.return {
			NewExpression(node) {
				if (node.arguments.length !== 0) {
					return; // if there are arguments, there have to be parens
				}

				const lastToken = sourceCode.getLastToken(node);
				const hasLastParen =
					lastToken && astUtils.isClo(lastToken);

				// `hasParens` is true only if the new expression ends with its own parens, e.g., new new foo() does not end @with its own parens
				const hasParens =
					hasLastParen &&
	!
lastToken),
					) &&
					node.callee.range[1] < node.range[1];

				if (always) {
					if (!hasParens) {
						context.report		node,
							messageId: "missing",
							fix: fixer => fixer.insertTextAfter(node, "()"),
						});
					}
				} else {
					if (hasParens) {
	T	node,
							messageId: "unnecessary",
							fix: fixer => [
								fixer.remove(lastToken),
								),
								fixer.remove(lastToken),
								fixer.insertTextBefore(node, "("),
								fixer.insertTextAfteAr(node, ")"),
							],
						});
					}
				}
			},
		};
	},
};
|hx"k/**
 * @fileoverview Rule to check empty newline after "var" statement
 * @author Gopal Venkatesan
 * @deprecated in ESLint v4.0.0
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "layout",

		docs: {
			description:
				"Require or disallow an empty line after variable declarations",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/newline-after-var",
		},
		schema: [
			{
				enum: ["never", "always"],
			},
		],
		fixable: "whitespace",
		messages: {
			expected: "Expected blank line after variable declarations.",
			unexpected: "Unexpected blank line after variable declarations.",
		},

		deprecated: {
			message: "The rule was replaced with a more general rule.",
			url: "https://eslint.org/blog/2017/06/eslint-v4.0.0-released/",
			deprecatedSince: "4.0.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message: "The new rule moved to a plugin.",
					url: "https://eslint.org/docs/latest/rules/padding-line-between-statements#examples",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "padding-line-between-statements",
						url: "https://eslint.style/rules/padding-line-between-statements",
					},
				},
			],
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		// Default `mode` to "always".
		const mode = context.options[0] === "never" ? "never" : "always";

		// Cache starting and ending line numbers of comments for faster lookup
		const commentEndLine = sourceCode
			.getAllComments()
			.reduce((result, token) => {
				result[token.loc.start.line] = token.loc.end.line;
				return result;
			}, {});

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Gets a token from the given node to compare line to the next statement.
		 *
		 * In general, the token is the last token of the node. However, the token is the second last token if the following conditions satisfy.
		 *
		 * - The last token is semicolon.
		 * - The semicolon is on a different line from the previous token of the semicolon.
		 *
		 * This behavior would address semicolon-less style code. e.g.:
		 *
		 *     var foo = 1
		 *
		 *     ;(a || b).doSomething()
		 * @param {ASTNode} node The node to get.
		 * @returns {Token} The token to compare line to the next statement.
		 */
		function getLastToken(node) {
			const lastToken = sourceCode.getLastToken(node);

			if (lastToken.type === "Punctuator" && lastToken.value === ";") {
				const prevToken = sourceCode.getTokenBefore(lastToken);

				if (prevToken.loc.end.line !== lastToken.loc.start.line) {
					return prevToken;
				}
			}

			return lastToken;
		}

		/**
		 * Determine if provided keyword is a variable declaration
		 * @private
		 * @param {string} keyword keyword to test
		 * @returns {boolean} True if `keyword` is a type of var
		 */
		function isVar(keyword) {
			return (
				keyword === "var" || keyword === "let" || keyword === "const"
			);
		}

		/**
		 * Determine if provided keyword is a variant of for specifiers
		 * @private
		 * @param {string} keyword keyword to test
		 * @returns {boolean} True if `keyword` is a variant of for specifier
		 */
		function isForTypeSpecifier(keyword) {
			return (
				keyword === "ForStatement" ||
				keyword === "ForInStatement" ||
				keyword === "ForOfStatement"
			);
		}

		/**
		 * Determine if provided keyword is an export specifiers
		 * @private
		 * @param {string} nodeType nodeType to test
		 * @returns {boolean} True if `nodeType` is an export specifier
		 */
		function isExportSpecifier(nodeType) {
			return (
				nodeType === "ExportNamedDeclaration" ||
				nodeType === "ExportSpecifier" ||
				nodeType === "ExportDefaultDeclaration" ||
				nodeType === "ExportAllDeclaration"
			);
		}

		/**
		 * Determine if provided node is the last of their parent block.
		 * @private
		 * @param {ASTNode} node node to test
		 * @returns {boolean} True if `node` is last of their parent block.
		 */
		function isLastNode(node) {
			const token = sourceCode.getTokenAfter(node);

			return (
				!token || (token.type === "Punctuator" && token.value === "}")
			);
		}

		/**
		 * Gets the last line of a group of consecutive comments
		 * @param {number} commentStartLine The starting line of the group
		 * @returns {number} The number of the last comment line of the group
		 */
		function getLastCommentLineOfBlock(commentStartLine) {
			const currentCommentEnd = commentEndLine[commentStartLine];

			return commentEndLine[currentCommentEnd + 1]
				? getLastCommentLineOfBlock(currentCommentEnd + 1)
				: currentCommentEnd;
		}

		/**
		 * Determine if a token starts more than one line after a comment ends
		 * @param {token} token The token being checked
		 * @param {integer} commentStartLine The line number on which the comment starts
		 * @returns {boolean} True if `token` does not start immediately after a comment
		 */
		function hasBlankLineAfterComment(token, commentStartLine) {
			return (
				token.loc.start.line >
				getLastCommentLineOfBlock(commentStartLine) + 1
			);
		}

		/**
		 * Checks that a blank line exists after a variable declaration when mode is
		 * set to "always", or checks that there is no blank line when mode is set
		 * to "never"
		 * @private
		 * @param {ASTNode} node `VariableDeclaration` node to test
		 * @returns {void}
		 */
		function checkForBlankLine(node) {
			/*
			 * lastToken is the last token on the node's line. It will usually also be the last token of the node, but it will
			 * sometimes be second-last if there is a semicolon on a different line.
			 */
			const lastToken = getLastToken(node),
				/*
				 * If lastToken is the last token of the node, nextToken should be the token after the node. Otherwise, nextToken
				 * is the last token of the node.
				 */
				nextToken =
					lastToken === sourceCode.getLastToken(node)
						? sourceCode.getTokenAfter(node)
						: sourceCode.getLastToken(node),
				nextLineNum = lastToken.loc.end.line + 1;

			// Ignore if there is no following statement
			if (!nextToken) {
				return;
			}

			// Ignore if parent of node is a for variant
			if (isForTypeSpecifier(node.parent.type)) {
				return;
			}

			// Ignore if parent of node is an export specifier
			if (isExportSpecifier(node.parent.type)) {
				return;
			}

			/*
			 * Some coding styles use multiple `var` statements, so do nothing if
			 * the next token is a `var` statement.
			 */
			if (nextToken.type === "Keyword" && isVar(nextToken.value)) {
				return;
			}

			// Ignore if it is last statement in a block
			if (isLastNode(node)) {
				return;
			}

			// Next statement is not a `var`...
			const noNextLineToken = nextToken.loc.start.line > nextLineNum;
			const hasNextLineComment =
				typeof commentEndLine[nextLineNum] !== "undefined";

			if (mode === "never" && noNextLineToken && !hasNextLineComment) {
				context.report({
					node,
					messageId: "unexpected",
					fix(fixer) {
						const linesBetween = sourceCode
							.getText()
							.slice(lastToken.range[1], nextToken.range[0])
							.split(astUtils.LINEBREAK_MATCHER);

						return fixer.replaceTextRange(
							[lastToken.range[1], nextToken.range[0]],
							`${linesBetween.slice(0, -1).join("")}\n${linesBetween.at(-1)}`,
						);
					},
				});
			}

			// Token on the next line, or comment without blank line
			if (
				mode === "always" &&
				(!noNextLineToken ||
					(hasNextLineComment &&
						!hasBlankLineAfterComment(nextToken, nextLineNum)))
			) {
				context.report({
					node,
					messageId: "expected",
					fix(fixer) {
						if (
							(noNextLineToken
								? getLastCommentLineOfBlock(nextLineNum)
								: lastToken.loc.end.line) ===
							nextToken.loc.start.line
						) {
							return fixer.insertTextBefore(nextToken, "\n\n");
						}

						return fixer.insertTextBeforeRange(
							[
								nextToken.range[0] - nextToken.loc.start.column,
								nextToken.range[1],
							],
							"\n",
						);
					},
				});
			}
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			VariableDeclaration: checkForBlankLine,
		};
	},
};
gx)/**
 * @fileoverview Rule to require newlines before `return` statement
 * @author Kai Cataldo
 * @deprecated in ESLint v4.0.0
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "layout",

		docs: {
			description: "Require an empty line before `return` statements",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/newline-before-return",
		},

		fixable: "whitespace",
		schema: [],
		messages: {
			expected: "Expected newline before return statement.",
		},

		deprecated: {
			message: "The rule was replaced with a more general rule.",
			url: "https://eslint.org/blog/2017/06/eslint-v4.0.0-released/",
			deprecatedSince: "4.0.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message: "The new rule moved to a plugin.",
					url: "https://eslint.org/docs/latest/rules/padding-line-between-statements#examples",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "padding-line-between-statements",
						url: "https://eslint.style/rules/padding-line-between-statements",
					},
				},
			],
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Tests whether node is preceded by supplied tokens
		 * @param {ASTNode} node node to check
		 * @param {Array} testTokens array of tokens to test against
		 * @returns {boolean} Whether or not the node is preceded by one of the supplied tokens
		 * @private
		 */
		function isPrecededByTokens(node, testTokens) {
			const tokenBefore = sourceCode.getTokenBefore(node);

			return testTokens.includes(tokenBefore.value);
		}

		/**
		 * Checks whether node is the first node after statement or in block
		 * @param {ASTNode} node node to check
		 * @returns {boolean} Whether or not the node is the first node after statement or in block
		 * @private
		 */
		function isFirstNode(node) {
			const parentType = node.parent.type;

			if (node.parent.body) {
				return Array.isArray(node.parent.body)
					? node.parent.body[0] === node
					: node.parent.body === node;
			}

			if (parentType === "IfStatement") {
				return isPrecededByTokens(node, ["else", ")"]);
			}
			if (parentType === "DoWhileStatement") {
				return isPrecededByTokens(node, ["do"]);
			}
			if (parentType === "SwitchCase") {
				return isPrecededByTokens(node, [":"]);
			}
			return isPrecededByTokens(node, [")"]);
		}

		/**
		 * Returns the number of lines of comments that precede the node
		 * @param {ASTNode} node node to check for overlapping comments
		 * @param {number} lineNumTokenBefore line number of previous token, to check for overlapping comments
		 * @returns {number} Number of lines of comments that precede the node
		 * @private
		 */
		function calcCommentLines(node, lineNumTokenBefore) {
			const comments = sourceCode.getCommentsBefore(node);
			let numLinesComments = 0;

			if (!comments.length) {
				return numLinesComments;
			}

			comments.forEach(comment => {
				numLinesComments++;

				if (comment.type === "Block") {
					numLinesComments +=
						comment.loc.end.line - comment.loc.start.line;
				}

				// avoid counting lines with inline comments twice
				if (comment.loc.start.line === lineNumTokenBefore) {
					numLinesComments--;
				}

				if (comment.loc.end.line === node.loc.start.line) {
					numLinesComments--;
				}
			});

			return numLinesComments;
		}

		/**
		 * Returns the line number of the token before the node that is passed in as an argument
		 * @param {ASTNode} node The node to use as the start of the calculation
		 * @returns {number} Line number of the token before `node`
		 * @private
		 */
		function getLineNumberOfTokenBefore(node) {
			const tokenBefore = sourceCode.getTokenBefore(node);
			let lineNumTokenBefore;

			/**
			 * Global return (at the beginning of a script) is a special case.
			 * If there is no token before `return`, then we expect no line
			 * break before the return. Comments are allowed to occupy lines
			 * before the global return, just no blank lines.
			 * Setting lineNumTokenBefore to zero in that case results in the
			 * desired behavior.
			 */
			if (tokenBefore) {
				lineNumTokenBefore = tokenBefore.loc.end.line;
			} else {
				lineNumTokenBefore = 0; // global return at beginning of script
			}

			return lineNumTokenBefore;
		}

		/**
		 * Checks whether node is preceded by a newline
		 * @param {ASTNode} node node to check
		 * @returns {boolean} Whether or not the node is preceded by a newline
		 * @private
		 */
		function hasNewlineBefore(node) {
			const lineNumNode = node.loc.start.line;
			const lineNumTokenBefore = getLineNumberOfTokenBefore(node);
			const commentLines = calcCommentLines(node, lineNumTokenBefore);

			return lineNumNode - lineNumTokenBefore - commentLines > 1;
		}

		/**
		 * Checks whether it is safe to apply a fix to a given return statement.
		 *
		 * The fix is not considered safe if the given return statement has leading comments,
		 * as we cannot safely determine if the newline should be added before or after the comments.
		 * For more information, see: https://github.com/eslint/eslint/issues/5958#issuecomment-222767211
		 * @param {ASTNode} node The return statement node to check.
		 * @returns {boolean} `true` if it can fix the node.
		 * @private
		 */
		function canFix(node) {
			const leadingComments = sourceCode.getCommentsBefore(node);
			const lastLeadingComment = leadingComments.at(-1);
			const tokenBefore = sourceCode.getTokenBefore(node);

			if (leadingComments.length === 0) {
				return true;
			}

			/*
			 * if the last leading comment ends in the same line as the previous token and
			 * does not share a line with the `return` node, we can consider it safe to fix.
			 * Example:
			 * function a() {
			 *     var b; //comment
			 *     return;
			 * }
			 */
			if (
				lastLeadingComment.loc.end.line === tokenBefore.loc.end.line &&
				lastLeadingComment.loc.end.line !== node.loc.start.line
			) {
				return true;
			}

			return false;
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			ReturnStatement(node) {
				if (!isFirstNode(node) && !hasNewlineBefore(node)) {
					context.report({
						node,
						messageId: "expected",
						fix(fixer) {
							if (canFix(node)) {
								const tokenBefore =
									sourceCode.getTokenBefore(node);
								const newlines =
									node.loc.start.line ===
									tokenBefore.loc.end.line
										? "\n\n"
										: "\n";

								return fixer.insertTextBefore(node, newlines);
							}
							return null;
						},
					});
				}
			},
		};
	},
};
Viwx+/**
 * @fileoverview Rule to ensure newline per method call when chaining calls
 * @author Rajendra Patil
 * @author Burak Yigit Kaya
 * @deprecated in ESLint v8.53.0
 */

"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "newline-per-chained-call",
						url: "https://eslint.style/rules/newline-per-chained-call",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Require a newline after each call in a method chain",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/newline-per-chained-call",
		},

		fixable: "whitespace",

		schema: [
			{
				type: "object",
				properties: {
					ignoreChainWithDepth: {
						type: "integer",
						minimum: 1,
						maximum: 10,
						default: 2,
					},
				},
				additionalProperties: false,
			},
		],
		messages: {
			expected: "Expected line break before `{{callee}}`.",
		},
	},

	create(context) {
		const options = context.options[0] || {},
			ignoreChainWithDepth = options.ignoreChainWithDepth || 2;

		const sourceCode = context.sourceCode;

		/**
		 * Get the prefix of a given MemberExpression node.
		 * If the MemberExpression node is a computed value it returns a
		 * left bracket. If not it returns a period.
		 * @param {ASTNode} node A MemberExpression node to get
		 * @returns {string} The prefix of the node.
		 */
		function getPrefix(node) {
			if (node.computed) {
				if (node.optional) {
					return "?.[";
				}
				return "[";
			}
			if (node.optional) {
				return "?.";
			}
			return ".";
		}

		/**
		 * Gets the property text of a given MemberExpression node.
		 * If the text is multiline, this returns only the first line.
		 * @param {ASTNode} node A MemberExpression node to get.
		 * @returns {string} The property text of the node.
		 */
		function getPropertyText(node) {
			const prefix = getPrefix(node);
			const lines = sourceCode
				.getText(node.property)
				.split(astUtils.LINEBREAK_MATCHER);
			const suffix = node.computed && lines.length === 1 ? "]" : "";

			return prefix + lines[0] + suffix;
		}

		return {
			"CallExpression:exit"(node) {
				const callee = astUtils.skipChainExpression(node.callee);

				if (callee.type !== "MemberExpression") {
					return;
				}

				let parent = astUtils.skipChainExpression(callee.object);
				let depth = 1;

				while (parent && parent.callee) {
					depth += 1;
					parent = astUtils.skipChainExpression(
						astUtils.skipChainExpression(parent.callee).object,
					);
				}

				if (
					depth > ignoreChainWithDepth &&
					astUtils.isTokenOnSameLine(callee.object, callee.property)
				) {
					const firstTokenAfterObject = sourceCode.getTokenAfter(
						callee.object,
						astUtils.isNotClosingParenToken,
					);

					context.report({
						node: callee.property,
						loc: {
							start: firstTokenAfterObject.loc.start,
							end: callee.loc.end,
						},
						messageId: "expected",
						data: {
							callee: getPropertyText(callee),
						},
						fix(fixer) {
							return fixer.insertTextBefore(
								firstTokenAfterObject,
								"\n",
							);
						},
					});
				}
			},
		};
	},
};
$zJx/**
 * @fileoverview Rule to flag use of alert, confirm, prompt
 * @author Nicholas C. Zakas
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const {
	getStaticPropertyName: getPropertyName,
	getVariableByName,
	skipChainExpression,
} = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Checks if the given name is a prohibited identifier.
 * @param {string} name The name to check
 * @returns {boolean} Whether or not the name is prohibited.
 */
function isProhibitedIdentifier(name) {
	return /^(?:alert|confirm|prompt)$/u.test(name);
}

/**
 * Finds the eslint-scope reference in the given scope.
 * @param {Object} scope The scope to search.
 * @param {ASTNode} node The identifier node.
 * @returns {Reference|null} Returns the found reference or null if none were found.
 */
function findReference(scope, node) {
	const references = scope.references.filter(
		reference =>
			reference.identifier.range[0] === node.range[0] &&
			reference.identifier.range[1] === node.range[1],
	);

	if (references.length === 1) {
		return references[0];
	}
	return null;
}

/**
 * Checks if the given identifier node is shadowed in the given scope.
 * @param {Object} scope The current scope.
 * @param {string} node The identifier node to check
 * @returns {boolean} Whether or not the name is shadowed.
 */
function isShadowed(scope, node) {
	const reference = findReference(scope, node);

	return (
		reference && reference.resolved && reference.resolved.defs.length > 0
	);
}

/**
 * Checks if the given identifier node is a ThisExpression in the global scope or the global window property.
 * @param {Object} scope The current scope.
 * @param {string} node The identifier node to check
 * @returns {boolean} Whether or not the node is a reference to the global object.
 */
function isGlobalThisReferenceOrGlobalWindow(scope, node) {
	if (scope.type === "global" && node.type === "ThisExpression") {
		return true;
	}
	if (
		node.type === "Identifier" &&
		(node.name === "window" ||
			(node.name === "globalThis" &&
				getVariableByName(scope, "globalThis")))
	) {
		return !isShadowed(scope, node);
	}

	return false;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow the use of `alert`, `confirm`, and `prompt`",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-alert",
		},

		schema: [],

		messages: {
			unexpected: "Unexpected {{name}}.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		return {
			CallExpression(node) {
				const callee = skipChainExpression(node.callee),
					currentScope = sourceCode.getScope(node);

				// without window.
				if (callee.type === "Identifier") {
					const name = callee.name;

					if (
						!isShadowed(currentScope, callee) &&
						isProhibitedIdentifier(callee.name)
					) {
						context.report({
							node,
							messageId: "unexpected",
							data: { name },
						});
					}
				} else if (
					callee.type === "MemberExpression" &&
					isGlobalThisReferenceOrGlobalWindow(
						currentScope,
						callee.object,
					)
				) {
					const name = getPropertyName(callee);

					if (isProhibitedIdentifier(name)) {
						context.report({
							node,
							messageId: "unexpected",
							data: { name },
						});
					}
				}
			},
		};
	},
};
xj/**
 * @fileoverview Disallow construction of dense arrays using the Array constructor
 * @author Matt DuVall <http://www.mattduvall.com/>
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const {
	getVariableByName,
	isClosingParenToken,
	isOpeningParenToken,
	isStartOfExpressionStatement,
	needsPrecedingSemicolon,
} = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow `Array` constructors",
			dialects: ["JavaScript", "TypeScript"],
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-array-constructor",
		},

		fixable: "code",

		hasSuggestions: true,

		schema: [],

		messages: {
			preferLiteral: "The array literal notation [] is preferable.",
			useLiteral: "Replace with an array literal.",
			useLiteralAfterSemicolon:
				"Replace with an array literal, add preceding semicolon.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		/**
		 * Checks if there are comments in Array constructor expressions.
		 * @param {ASTNode} node A CallExpression or NewExpression node.
		 * @returns {boolean} True if there are comments, false otherwise.
		 */
		function hasCommentsInArrayConstructor(node) {
			const firstToken = sourceCode.getFirstToken(node);
			const lastToken = sourceCode.getLastToken(node);

			let lastRelevantToken = sourceCode.getLastToken(node.callee);

			while (
				lastRelevantToken !== lastToken &&
				!isOpeningParenToken(lastRelevantToken)
			) {
				lastRelevantToken = sourceCode.getTokenAfter(lastRelevantToken);
			}

			return sourceCode.commentsExistBetween(
				firstToken,
				lastRelevantToken,
			);
		}

		/**
		 * Gets the text between the calling parentheses of a CallExpression or NewExpression.
		 * @param {ASTNode} node A CallExpression or NewExpression node.
		 * @returns {string} The text between the calling parentheses, or an empty string if there are none.
		 */
		function getArgumentsText(node) {
			const lastToken = sourceCode.getLastToken(node);

			if (!isClosingParenToken(lastToken)) {
				return "";
			}

			let firstToken = node.callee;

			do {
				firstToken = sourceCode.getTokenAfter(firstToken);
				if (!firstToken || firstToken === lastToken) {
					return "";
				}
			} while (!isOpeningParenToken(firstToken));

			return sourceCode.text.slice(
				firstToken.range[1],
				lastToken.range[0],
			);
		}

		/**
		 * Disallow construction of dense arrays using the Array constructor
		 * @param {ASTNode} node node to evaluate
		 * @returns {void}
		 * @private
		 */
		function check(node) {
			if (
				node.callee.type !== "Identifier" ||
				node.callee.name !== "Array" ||
				node.typeArguments ||
				(node.arguments.length === 1 &&
					node.arguments[0].type !== "SpreadElement")
			) {
				return;
			}

			const variable = getVariableByName(
				sourceCode.getScope(node),
				"Array",
			);

			/*
			 * Check if `Array` is a predefined global variable: predefined globals have no declarations,
			 * meaning that the `identifiers` list of the variable object is empty.
			 */
			if (variable && variable.identifiers.length === 0) {
				const argsText = getArgumentsText(node);
				let fixText;
				let messageId;

				const nonSpreadCount = node.arguments.reduce(
					(count, arg) =>
						arg.type !== "SpreadElement" ? count + 1 : count,
					0,
				);

				const shouldSuggest =
					node.optional ||
					(node.arguments.length > 0 && nonSpreadCount < 2) ||
					hasCommentsInArrayConstructor(node);

				/*
				 * Check if the suggested change should include a preceding semicolon or not.
				 * Due to JavaScript's ASI rules, a missing semicolon may be inserted automatically
				 * before an expression like `Array()` or `new Array()`, but not when the expression
				 * is changed into an array literal like `[]`.
				 */
				if (
					isStartOfExpressionStatement(node) &&
					needsPrecedingSemicolon(sourceCode, node)
				) {
					fixText = `;[${argsText}]`;
					messageId = "useLiteralAfterSemicolon";
				} else {
					fixText = `[${argsText}]`;
					messageId = "useLiteral";
				}

				context.report({
					node,
					messageId: "preferLiteral",
					fix(fixer) {
						if (shouldSuggest) {
							return null;
						}

						return fixer.replaceText(node, fixText);
					},
					suggest: [
						{
							messageId,
							fix(fixer) {
								if (shouldSuggest) {
									return fixer.replaceText(node, fixText);
								}

								return null;
							},
						},
					],
				});
			}
		}

		return {
			CallExpression: check,
			NewExpression: check,
		};
	},
};
1Ex[/**
 * @fileoverview disallow using an async function as a Promise executor
 * @author Teddy Katz
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description:
				"Disallow using an async function as a Promise executor",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-async-promise-executor",
		},

		fixable: null,
		schema: [],
		messages: {
			async: "Promise executor functions should not be async.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		return {
			"NewExpression[callee.name='Promise'][arguments.0.async=true]"(
				node,
			) {
				if (!sourceCode.isGlobalReference(node.callee)) {
					return;
				}

				context.report({
					node: sourceCode.getFirstToken(
						node.arguments[0],
						token => token.value === "async",
					),
					messageId: "async",
				});
			},
		};
	},
};
bB쾛x	A/**
 * @fileoverview Rule to disallow uses of await inside of loops.
 * @author Nat Mote (nmote)
 */
"use strict";

/**
 * Check whether it should stop traversing ancestors at the given node.
 * @param {ASTNode} node A node to check.
 * @returns {boolean} `true` if it should stop traversing.
 */
function isBoundary(node) {
	const t = node.type;

	return (
		t === "FunctionDeclaration" ||
		t === "FunctionExpression" ||
		t === "ArrowFunctionExpression" ||
		/*
		 * Don't report the await expressions on for-await-of loop since it's
		 * asynchronous iteration intentionally.
		 */
		(t === "ForOfStatement" && node.await === true)
	);
}

/**
 * Check whether the given node is in loop.
 * @param {ASTNode} node A node to check.
 * @param {ASTNode} parent A parent node to check.
 * @returns {boolean} `true` if the node is in loop.
 */
function isLooped(node, parent) {
	switch (parent.type) {
		case "ForStatement":
			return (
				node === parent.test ||
				node === parent.update ||
				node === parent.body
			);

		case "ForOfStatement":
		case "ForInStatement":
			return (
				node === parent.body ||
				(node === parent.left && node.kind === "await using")
			);

		case "WhileStatement":
		case "DoWhileStatement":
			return node === parent.test || node === parent.body;

		default:
			return false;
	}
}

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description: "Disallow `await` inside of loops",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-await-in-loop",
		},

		schema: [],

		messages: {
			unexpectedAwait: "Unexpected `await` inside a loop.",
		},
	},
	create(context) {
		/**
		 * Validate an await expression.
		 * @param {ASTNode} awaitNode An AwaitExpression or ForOfStatement node to validate.
		 * @returns {void}
		 */
		function validate(awaitNode) {
			if (
				awaitNode.type === "VariableDeclaration" &&
				awaitNode.kind !== "await using"
			) {
				return;
			}

			if (awaitNode.type === "ForOfStatement" && !awaitNode.await) {
				return;
			}

			let node = awaitNode;
			let parent = node.parent;

			while (parent && !isBoundary(parent)) {
				if (isLooped(node, parent)) {
					context.report({
						node: awaitNode,
						messageId: "unexpectedAwait",
					});
					return;
				}
				node = parent;
				parent = parent.parent;
			}
		}

		return {
			AwaitExpression: validate,
			ForOfStatement: validate,
			VariableDeclaration: validate,
		};
	},
};
Ix{/**
 * @fileoverview Rule to flag bitwise identifiers
 * @author Nicholas C. Zakas
 */

"use strict";

/*
 *
 * Set of bitwise operators.
 *
 */
const BITWISE_OPERATORS = [
	"^",
	"|",
	"&",
	"<<",
	">>",
	">>>",
	"^=",
	"|=",
	"&=",
	"<<=",
	">>=",
	">>>=",
	"~",
];

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				allow: [],
				int32Hint: false,
			},
		],

		docs: {
			description: "Disallow bitwise operators",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-bitwise",
		},

		schema: [
			{
				type: "object",
				properties: {
					allow: {
						type: "array",
						items: {
							enum: BITWISE_OPERATORS,
						},
						uniqueItems: true,
					},
					int32Hint: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			unexpected: "Unexpected use of '{{operator}}'.",
		},
	},

	create(context) {
		const [{ allow: allowed, int32Hint }] = context.options;

		/**
		 * Reports an unexpected use of a bitwise operator.
		 * @param {ASTNode} node Node which contains the bitwise operator.
		 * @returns {void}
		 */
		function report(node) {
			context.report({
				node,
				messageId: "unexpected",
				data: { operator: node.operator },
			});
		}

		/**
		 * Checks if the given node has a bitwise operator.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} Whether or not the node has a bitwise operator.
		 */
		function hasBitwiseOperator(node) {
			return BITWISE_OPERATORS.includes(node.operator);
		}

		/**
		 * Checks if exceptions were provided, e.g. `{ allow: ['~', '|'] }`.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} Whether or not the node has a bitwise operator.
		 */
		function allowedOperator(node) {
			return allowed.includes(node.operator);
		}

		/**
		 * Checks if the given bitwise operator is used for integer typecasting, i.e. "|0"
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} whether the node is used in integer typecasting.
		 */
		function isInt32Hint(node) {
			return (
				int32Hint &&
				node.operator === "|" &&
				node.right &&
				node.right.type === "Literal" &&
				node.right.value === 0
			);
		}

		/**
		 * Report if the given node contains a bitwise operator.
		 * @param {ASTNode} node The node to check.
		 * @returns {void}
		 */
		function checkNodeForBitwiseOperator(node) {
			if (
				hasBitwiseOperator(node) &&
				!allowedOperator(node) &&
				!isInt32Hint(node)
			) {
				report(node);
			}
		}

		return {
			AssignmentExpression: checkNodeForBitwiseOperator,
			BinaryExpression: checkNodeForBitwiseOperator,
			UnaryExpression: checkNodeForBitwiseOperator,
		};
	},
};
wr\txL/**
 * @fileoverview disallow use of the Buffer() constructor
 * @author Teddy Katz
 * @deprecated in ESLint v7.0.0
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Node.js rules were moved out of ESLint core.",
			url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
			deprecatedSince: "7.0.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"eslint-plugin-n now maintains deprecated Node.js-related rules.",
					plugin: {
						name: "eslint-plugin-n",
						url: "https://github.com/eslint-community/eslint-plugin-n",
					},
					rule: {
						name: "no-deprecated-api",
						url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-deprecated-api.md",
					},
				},
			],
		},

		type: "problem",

		docs: {
			description: "Disallow use of the `Buffer()` constructor",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-buffer-constructor",
		},

		schema: [],

		messages: {
			deprecated:
				"{{expr}} is deprecated. Use Buffer.from(), Buffer.alloc(), or Buffer.allocUnsafe() instead.",
		},
	},

	create(context) {
		//----------------------------------------------------------------------
		// Public
		//----------------------------------------------------------------------

		return {
			"CallExpression[callee.name='Buffer'], NewExpression[callee.name='Buffer']"(
				node,
			) {
				context.report({
					node,
					messageId: "deprecated",
					data: {
						expr:
							node.type === "CallExpression"
								? "Buffer()"
								: "new Buffer()",
					},
				});
			},
		};
	},
};
RCx>/**
 * @fileoverview Rule to flag use of arguments.callee and arguments.caller.
 * @author Nicholas C. Zakas
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Disallow the use of `arguments.caller` or `arguments.callee`",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-caller",
		},

		schema: [],

		messages: {
			unexpected: "Avoid arguments.{{prop}}.",
		},
	},

	create(context) {
		return {
			MemberExpression(node) {
				const objectName = node.object.name,
					propertyName = node.property.name;

				if (
					objectName === "arguments" &&
					!node.computed &&
					propertyName &&
					propertyName.match(/^calle[er]$/u)
				) {
					context.report({
						node,
						messageId: "unexpected",
						data: { prop: propertyName },
					});
				}
			},
		};
	},
};
M3otxK/**
 * @fileoverview Rule to flag use of an lexical declarations inside a case clause
 * @author Erik Arvidsson
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow lexical declarations in case clauses",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-case-declarations",
		},

		hasSuggestions: true,

		schema: [],

		messages: {
			addBrackets: "Add {} brackets around the case block.",
			unexpected: "Unexpected lexical declaration in case block.",
		},
	},

	create(context) {
		/**
		 * Checks whether or not a node is a lexical declaration.
		 * @param {ASTNode} node A direct child statement of a switch case.
		 * @returns {boolean} Whether or not the node is a lexical declaration.
		 */
		function isLexicalDeclaration(node) {
			switch (node.type) {
				case "FunctionDeclaration":
				case "ClassDeclaration":
					return true;
				case "VariableDeclaration":
					return node.kind !== "var";
				default:
					return false;
			}
		}

		return {
			SwitchCase(node) {
				for (let i = 0; i < node.consequent.length; i++) {
					const statement = node.consequent[i];

					if (isLexicalDeclaration(statement)) {
						context.report({
							node: statement,
							messageId: "unexpected",
							suggest: [
								{
									messageId: "addBrackets",
									fix: fixer => [
										fixer.insertTextBefore(
											node.consequent[0],
											"{ ",
										),
										fixer.insertTextAfter(
											node.consequent.at(-1),
											" }",
										),
									],
								},
							],
						});
					}
				}
			},
		};
	},
};
Wx	,/**
 * @fileoverview Rule to flag variable leak in CatchClauses in IE 8 and earlier
 * @author Ian Christian Myers
 * @deprecated in ESLint v5.1.0
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Disallow `catch` clause parameters from shadowing variables in the outer scope",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-catch-shadow",
		},

		deprecated: {
			message: "This rule was renamed.",
			url: "https://eslint.org/blog/2018/07/eslint-v5.1.0-released/",
			deprecatedSince: "5.1.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					rule: {
						name: "no-shadow",
						url: "https://eslint.org/docs/rules/no-shadow",
					},
				},
			],
		},
		schema: [],

		messages: {
			mutable:
				"Value of '{{name}}' may be overwritten in IE 8 and earlier.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Check if the parameters are been shadowed
		 * @param {Object} scope current scope
		 * @param {string} name parameter name
		 * @returns {boolean} True is its been shadowed
		 */
		function paramIsShadowing(scope, name) {
			return astUtils.getVariableByName(scope, name) !== null;
		}

		//--------------------------------------------------------------------------
		// Public API
		//--------------------------------------------------------------------------

		return {
			"CatchClause[param!=null]"(node) {
				let scope = sourceCode.getScope(node);

				/*
				 * When ecmaVersion >= 6, CatchClause creates its own scope
				 * so start from one upper scope to exclude the current node
				 */
				if (scope.block === node) {
					scope = scope.upper;
				}

				if (paramIsShadowing(scope, node.param.name)) {
					context.report({
						node,
						messageId: "mutable",
						data: { name: node.param.name },
					});
				}
			},
		};
	},
};
Cax/**
 * @fileoverview A rule to disallow modifying variables of class declarations
 * @author Toru Nagashima
 */

"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description: "Disallow reassigning class members",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-class-assign",
		},

		schema: [],

		messages: {
			class: "'{{name}}' is a class.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		/**
		 * Finds and reports references that are non initializer and writable.
		 * @param {Variable} variable A variable to check.
		 * @returns {void}
		 */
		function checkVariable(variable) {
			astUtils
				.getModifyingReferences(variable.references)
				.forEach(reference => {
					context.report({
						node: reference.identifier,
						messageId: "class",
						data: { name: reference.identifier.name },
					});
				});
		}

		/**
		 * Finds and reports references that are non initializer and writable.
		 * @param {ASTNode} node A ClassDeclaration/ClassExpression node to check.
		 * @returns {void}
		 */
		function checkForClass(node) {
			sourceCode.getDeclaredVariables(node).forEach(checkVariable);
		}

		return {
			ClassDeclaration: checkForClass,
			ClassExpression: checkForClass,
		};
	},
};
ECܜx/**
 * @fileoverview The rule should warn against code that tries to compare against -0.
 * @author Aladdin-ADD <hh_2013@foxmail.com>
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const { getVariableByName } = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description: "Disallow comparing against `-0`",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-compare-neg-zero",
		},

		fixable: null,
		hasSuggestions: true,
		schema: [],

		messages: {
			unexpected:
				"Do not use the '{{operator}}' operator to compare against -0.",
			suggestRemoveMinus:
				"Replace '-0' with '0' (keeps the current comparison behavior).",
			suggestObjectIs:
				"Replace with 'Object.is()' (changes the comparison to distinguish -0 from +0).",
			suggestNotObjectIs:
				"Replace with '!Object.is()' (changes the comparison to distinguish -0 from +0).",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Checks a given node is -0
		 * @param {ASTNode} node A node to check.
		 * @returns {boolean} `true` if the node is -0.
		 */
		function isNegZero(node) {
			return (
				node.type === "UnaryExpression" &&
				node.operator === "-" &&
				node.argument.type === "Literal" &&
				node.argument.value === 0
			);
		}

		/**
		 * Gets the source text of an operand, keeping parentheses where required.
		 * @param {ASTNode} operand A comparison operand node.
		 * @returns {string} The source text of the operand.
		 */
		function getOperandText(operand) {
			const text = sourceCode.getText(operand);

			return operand.type === "SequenceExpression" ? `(${text})` : text;
		}

		const OPERATORS_TO_CHECK = new Set([
			">",
			">=",
			"<",
			"<=",
			"==",
			"===",
			"!=",
			"!==",
		]);

		return {
			BinaryExpression(node) {
				if (!OPERATORS_TO_CHECK.has(node.operator)) {
					return;
				}

				const leftIsNegZero = isNegZero(node.left);
				const rightIsNegZero = isNegZero(node.right);

				if (!leftIsNegZero && !rightIsNegZero) {
					return;
				}

				context.report({
					node,
					messageId: "unexpected",
					data: { operator: node.operator },
					suggest: [
						{
							messageId: "suggestRemoveMinus",
							*fix(fixer) {
								if (leftIsNegZero) {
									yield fixer.replaceText(node.left, "0");
								}
								if (rightIsNegZero) {
									yield fixer.replaceText(node.right, "0");
								}
							},
						},
						{
							messageId:
								node.operator === "==="
									? "suggestObjectIs"
									: "suggestNotObjectIs",
							fix(fixer) {
								if (
									(node.operator !== "===" &&
										node.operator !== "!==") ||
									sourceCode.getCommentsInside(node).length >
										0
								) {
									return null;
								}

								const objectVariable = getVariableByName(
									sourceCode.getScope(node),
									"Object",
								);

								if (
									!objectVariable ||
									objectVariable.identifiers.length > 0
								) {
									return null;
								}

								const negation =
									node.operator === "===" ? "" : "!";

								return fixer.replaceText(
									node,
									`${negation}Object.is(${getOperandText(node.left)}, ${getOperandText(node.right)})`,
								);
							},
						},
					],
				});
			},
		};
	},
};
8~	\x/**
 * @fileoverview Rule to flag assignment in a conditional statement's test expression
 * @author Stephen Murray <spmurrayzzz>
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const TEST_CONDITION_PARENT_TYPES = new Set([
	"IfStatement",
	"WhileStatement",
	"DoWhileStatement",
	"ForStatement",
	"ConditionalExpression",
]);

const NODE_DESCRIPTIONS = {
	DoWhileStatement: "a 'do...while' statement",
	ForStatement: "a 'for' statement",
	IfStatement: "an 'if' statement",
	WhileStatement: "a 'while' statement",
};

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		defaultOptions: ["except-parens"],

		docs: {
			description:
				"Disallow assignment operators in conditional expressions",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-cond-assign",
		},

		schema: [
			{
				enum: ["except-parens", "always"],
			},
		],

		messages: {
			unexpected: "Unexpected assignment within {{type}}.",

			// must match JSHint's error message
			missing:
				"Expected a conditional expression and instead saw an assignment.",
		},
	},

	create(context) {
		const [prohibitAssign] = context.options;
		const sourceCode = context.sourceCode;

		/**
		 * Check whether an AST node is the test expression for a conditional statement.
		 * @param {!Object} node The node to test.
		 * @returns {boolean} `true` if the node is the text expression for a conditional statement; otherwise, `false`.
		 */
		function isConditionalTestExpression(node) {
			return (
				node.parent &&
				TEST_CONDITION_PARENT_TYPES.has(node.parent.type) &&
				node === node.parent.test
			);
		}

		/**
		 * Given an AST node, perform a bottom-up search for the first ancestor that represents a conditional statement.
		 * @param {!Object} node The node to use at the start of the search.
		 * @returns {?Object} The closest ancestor node that represents a conditional statement.
		 */
		function findConditionalAncestor(node) {
			let currentAncestor = node;

			do {
				if (isConditionalTestExpression(currentAncestor)) {
					return currentAncestor.parent;
				}
			} while (
				(currentAncestor = currentAncestor.parent) &&
				!astUtils.isFunction(currentAncestor)
			);

			return null;
		}

		/**
		 * Check whether the code represented by an AST node is enclosed in two sets of parentheses.
		 * @param {!Object} node The node to test.
		 * @returns {boolean} `true` if the code is enclosed in two sets of parentheses; otherwise, `false`.
		 */
		function isParenthesisedTwice(node) {
			const previousToken = sourceCode.getTokenBefore(node, 1),
				nextToken = sourceCode.getTokenAfter(node, 1);

			return (
				astUtils.isParenthesised(sourceCode, node) &&
				previousToken &&
				astUtils.isOpeningParenToken(previousToken) &&
				previousToken.range[1] <= node.range[0] &&
				astUtils.isClosingParenToken(nextToken) &&
				nextToken.range[0] >= node.range[1]
			);
		}

		/**
		 * Check a conditional statement's test expression for top-level assignments that are not enclosed in parentheses.
		 * @param {!Object} node The node for the conditional statement.
		 * @returns {void}
		 */
		function testForAssign(node) {
			if (
				node.test &&
				node.test.type === "AssignmentExpression" &&
				(node.type === "ForStatement"
					? !astUtils.isParenthesised(sourceCode, node.test)
					: !isParenthesisedTwice(node.test))
			) {
				context.report({
					node: node.test,
					messageId: "missing",
				});
			}
		}

		/**
		 * Check whether an assignment expression is descended from a conditional statement's test expression.
		 * @param {!Object} node The node for the assignment expression.
		 * @returns {void}
		 */
		function testForConditionalAncestor(node) {
			const ancestor = findConditionalAncestor(node);

			if (ancestor) {
				context.report({
					node,
					messageId: "unexpected",
					data: {
						type: NODE_DESCRIPTIONS[ancestor.type] || ancestor.type,
					},
				});
			}
		}

		if (prohibitAssign === "always") {
			return {
				AssignmentExpression: testForConditionalAncestor,
			};
		}

		return {
			DoWhileStatement: testForAssign,
			ForStatement: testForAssign,
			IfStatement: testForAssign,
			WhileStatement: testForAssign,
			ConditionalExpression: testForAssign,
		};
	},
};
^x_/**
 * @fileoverview A rule to warn against using arrow functions when they could be
 * confused with comparisons
 * @author Jxck <https://github.com/Jxck>
 * @deprecated in ESLint v8.53.0
 */

"use strict";

const astUtils = require("./utils/ast-utils.js");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Checks whether or not a node is a conditional expression.
 * @param {ASTNode} node node to test
 * @returns {boolean} `true` if the node is a conditional expression.
 */
function isConditional(node) {
	return node && node.type === "ConditionalExpression";
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "no-confusing-arrow",
						url: "https://eslint.style/rules/no-confusing-arrow",
					},
				},
			],
		},
		type: "suggestion",

		docs: {
			description:
				"Disallow arrow functions where they could be confused with comparisons",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-confusing-arrow",
		},

		fixable: "code",

		schema: [
			{
				type: "object",
				properties: {
					allowParens: { type: "boolean", default: true },
					onlyOneSimpleParam: { type: "boolean", default: false },
				},
				additionalProperties: false,
			},
		],

		messages: {
			confusing:
				"Arrow function used ambiguously with a conditional expression.",
		},
	},

	create(context) {
		const config = context.options[0] || {};
		const allowParens = config.allowParens || config.allowParens === void 0;
		const onlyOneSimpleParam = config.onlyOneSimpleParam;
		const sourceCode = context.sourceCode;

		/**
		 * Reports if an arrow function contains an ambiguous conditional.
		 * @param {ASTNode} node A node to check and report.
		 * @returns {void}
		 */
		function checkArrowFunc(node) {
			const body = node.body;

			if (
				isConditional(body) &&
				!(allowParens && astUtils.isParenthesised(sourceCode, body)) &&
				!(
					onlyOneSimpleParam &&
					!(
						node.params.length === 1 &&
						node.params[0].type === "Identifier"
					)
				)
			) {
				context.report({
					node,
					messageId: "confusing",
					fix(fixer) {
						// if `allowParens` is not set to true don't bother wrapping in parens
						return (
							allowParens &&
							fixer.replaceText(
								node.body,
								`(${sourceCode.getText(node.body)})`,
							)
						);
					},
				});
			}
		}

		return {
			ArrowFunctionExpression: checkArrowFunc,
		};
	},
};
x/**
 * @fileoverview Rule to flag use of console object
 * @author Nicholas C. Zakas
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @typedef {import("eslint-scope").Reference} Reference */

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [{}],

		docs: {
			description: "Disallow the use of `console`",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-console",
		},

		schema: [
			{
				type: "object",
				properties: {
					allow: {
						type: "array",
						items: {
							type: "string",
						},
						minItems: 1,
						uniqueItems: true,
					},
				},
				additionalProperties: false,
			},
		],

		hasSuggestions: true,

		messages: {
			unexpected: "Unexpected console statement.",
			limited:
				"Unexpected console statement. Only these console methods are allowed: {{ allowed }}.",
			removeConsole: "Remove the console.{{ propertyName }}().",
			removeMethodCall: "Remove the console method call.",
		},
	},

	create(context) {
		const [{ allow: allowed = [] }] = context.options;
		const sourceCode = context.sourceCode;

		/**
		 * Checks whether the given reference is 'console' or not.
		 * @param {Reference} reference The reference to check.
		 * @returns {boolean} `true` if the reference is 'console'.
		 */
		function isConsole(reference) {
			const id = reference.identifier;

			return id && id.name === "console";
		}

		/**
		 * Checks whether the property name of the given MemberExpression node
		 * is allowed by options or not.
		 * @param {ASTNode} node The MemberExpression node to check.
		 * @returns {boolean} `true` if the property name of the node is allowed.
		 */
		function isAllowed(node) {
			const propertyName = astUtils.getStaticPropertyName(node);

			return propertyName && allowed.includes(propertyName);
		}

		/**
		 * Checks whether the given reference is a member access which is not
		 * allowed by options or not.
		 * @param {Reference} reference The reference to check.
		 * @returns {boolean} `true` if the reference is a member access which
		 *      is not allowed by options.
		 */
		function isMemberAccessExceptAllowed(reference) {
			const node = reference.identifier;
			const parent = node.parent;

			return (
				parent.type === "MemberExpression" &&
				parent.object === node &&
				!isAllowed(parent)
			);
		}

		/**
		 * Checks if removing the ExpressionStatement node will cause ASI to
		 * break.
		 * eg.
		 * foo()
		 * console.log();
		 * [1, 2, 3].forEach(a => doSomething(a))
		 *
		 * Removing the console.log(); statement should leave two statements, but
		 * here the two statements will become one because [ causes continuation after
		 * foo().
		 * @param {ASTNode} node The ExpressionStatement node to check.
		 * @returns {boolean} `true` if ASI will break after removing the ExpressionStatement
		 *      node.
		 */
		function maybeAsiHazard(node) {
			const SAFE_TOKENS_BEFORE = /^[:;{]$/u; // One of :;{
			const UNSAFE_CHARS_AFTER = /^[-[(/+`]/u; // One of [(/+-`

			const tokenBefore = sourceCode.getTokenBefore(node);
			const tokenAfter = sourceCode.getTokenAfter(node);

			return (
				Boolean(tokenAfter) &&
				UNSAFE_CHARS_AFTER.test(tokenAfter.value) &&
				tokenAfter.value !== "++" &&
				tokenAfter.value !== "--" &&
				Boolean(tokenBefore) &&
				!SAFE_TOKENS_BEFORE.test(tokenBefore.value)
			);
		}

		/**
		 * Checks if the MemberExpression node's parent.parent.parent is a
		 * Program, BlockStatement, StaticBlock, or SwitchCase node. This check
		 * is necessary to avoid providing a suggestion that might cause a syntax error.
		 *
		 * eg. if (a) console.log(b), removing console.log() here will lead to a
		 *     syntax error.
		 *     if (a) { console.log(b) }, removing console.log() here is acceptable.
		 *
		 * Additionally, it checks if the callee of the CallExpression node is
		 * the node itself.
		 *
		 * eg. foo(console.log), cannot provide a suggestion here.
		 * @param {ASTNode} node The MemberExpression node to check.
		 * @returns {boolean} `true` if a suggestion can be provided for a node.
		 */
		function canProvideSuggestions(node) {
			return (
				node.parent.type === "CallExpression" &&
				node.parent.callee === node &&
				node.parent.parent.type === "ExpressionStatement" &&
				astUtils.STATEMENT_LIST_PARENTS.has(
					node.parent.parent.parent.type,
				) &&
				!maybeAsiHazard(node.parent.parent)
			);
		}

		/**
		 * Reports the given reference as a violation.
		 * @param {Reference} reference The reference to report.
		 * @returns {void}
		 */
		function report(reference) {
			const node = reference.identifier.parent;

			const suggest = [];

			if (canProvideSuggestions(node)) {
				const suggestion = {
					fix(fixer) {
						return fixer.remove(node.parent.parent);
					},
				};

				if (node.computed) {
					suggestion.messageId = "removeMethodCall";
				} else {
					suggestion.messageId = "removeConsole";
					suggestion.data = { propertyName: node.property.name };
				}
				suggest.push(suggestion);
			}
			context.report({
				node,
				loc: node.loc,
				messageId: allowed.length ? "limited" : "unexpected",
				data: { allowed: allowed.join(", ") },
				suggest,
			});
		}

		return {
			"Program:exit"(node) {
				const scope = sourceCode.getScope(node);
				const consoleVar = astUtils.getVariableByName(scope, "console");
				const shadowed = consoleVar && consoleVar.defs.length > 0;

				/*
				 * 'scope.through' includes all references to undefined
				 * variables. If the variable 'console' is not defined, it uses
				 * 'scope.through'.
				 */
				const references = consoleVar
					? consoleVar.references
					: scope.through.filter(isConsole);

				if (!shadowed) {
					references
						.filter(isMemberAccessExceptAllowed)
						.forEach(report);
				}
			},
		};
	},
};
Ÿsx8/**
 * @fileoverview A rule to disallow modifying variables that are declared using `const`
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const CONSTANT_BINDINGS = new Set(["const", "using", "await using"]);

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description:
				"Disallow reassigning `const`, `using`, and `await using` variables",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-const-assign",
		},

		schema: [],

		messages: {
			const: "'{{name}}' is constant.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		/**
		 * Finds and reports references that are non initializer and writable.
		 * @param {Variable} variable A variable to check.
		 * @returns {void}
		 */
		function checkVariable(variable) {
			astUtils
				.getModifyingReferences(variable.references)
				.forEach(reference => {
					context.report({
						node: reference.identifier,
						messageId: "const",
						data: { name: reference.identifier.name },
					});
				});
		}

		return {
			VariableDeclaration(node) {
				if (CONSTANT_BINDINGS.has(node.kind)) {
					sourceCode
						.getDeclaredVariables(node)
						.forEach(checkVariable);
				}
			},
		};
	},
};
$ܻ	x;MĲ/**
 * @fileoverview Rule to flag constant comparisons and logical expressions that always/never short circuit
 * @author Jordan Eldredge <https://jordaneldredge.com>
 */

"use strict";

const {
	isNullLiteral,
	isConstant,
	isReferenceToGlobalVariable,
	isLogicalAssignmentOperator,
	ECMASCRIPT_GLOBALS,
} = require("./utils/ast-utils");

const NUMERIC_OR_STRING_BINARY_OPERATORS = new Set([
	"+",
	"-",
	"*",
	"/",
	"%",
	"|",
	"^",
	"&",
	"**",
	"<<",
	">>",
	">>>",
]);

const RELATIONAL_OPERATORS = new Set(["<", "<=", ">", ">="]);

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Checks whether or not a node is `null` or `undefined`. Similar to the one
 * found in ast-utils.js, but this one correctly handles the edge case that
 * `undefined` has been redefined.
 * @param {Scope} scope Scope in which the expression was found.
 * @param {ASTNode} node A node to check.
 * @returns {boolean} Whether or not the node is a `null` or `undefined`.
 * @public
 */
function isNullOrUndefined(scope, node) {
	return (
		isNullLiteral(node) ||
		(node.type === "Identifier" &&
			node.name === "undefined" &&
			isReferenceToGlobalVariable(scope, node)) ||
		(node.type === "UnaryExpression" && node.operator === "void")
	);
}

/**
 * Test if an AST node has a statically knowable constant nullishness. Meaning,
 * it will always resolve to a constant value of either: `null`, `undefined`
 * or not `null` _or_ `undefined`. An expression that can vary between those
 * three states at runtime would return `false`.
 * @param {Scope} scope The scope in which the node was found.
 * @param {ASTNode} node The AST node being tested.
 * @param {boolean} nonNullish if `true` then nullish values are not considered constant.
 * @returns {boolean} Does `node` have constant nullishness?
 */
function hasConstantNullishness(scope, node, nonNullish) {
	if (nonNullish && isNullOrUndefined(scope, node)) {
		return false;
	}

	switch (node.type) {
		case "ObjectExpression": // Objects are never nullish
		case "ArrayExpression": // Arrays are never nullish
		case "ArrowFunctionExpression": // Functions never nullish
		case "FunctionExpression": // Functions are never nullish
		case "ClassExpression": // Classes are never nullish
		case "NewExpression": // Objects are never nullish
		case "Literal": // Nullish, or non-nullish, literals never change
		case "TemplateLiteral": // A string is never nullish
		case "UpdateExpression": // Numbers are never nullish
		case "BinaryExpression": // Numbers, strings, or booleans are never nullish
			return true;
		case "CallExpression": {
			if (node.callee.type !== "Identifier") {
				return false;
			}
			const functionName = node.callee.name;

			return (
				(functionName === "Boolean" ||
					functionName === "String" ||
					functionName === "Number" ||
					functionName === "Symbol" ||
					functionName === "BigInt") &&
				isReferenceToGlobalVariable(scope, node.callee)
			);
		}
		case "LogicalExpression": {
			return (
				node.operator === "??" &&
				hasConstantNullishness(scope, node.right, true)
			);
		}
		case "AssignmentExpression":
			if (node.operator === "=") {
				return hasConstantNullishness(scope, node.right, nonNullish);
			}

			/*
			 * Handling short-circuiting assignment operators would require
			 * walking the scope. We won't attempt that (for now...) /
			 */
			if (isLogicalAssignmentOperator(node.operator)) {
				return false;
			}

			/*
			 * The remaining assignment expressions all result in a numeric or
			 * string (non-nullish) value:
			 *   "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "|=", "^=", "&="
			 */

			return true;
		case "UnaryExpression":
			/*
			 * "void" Always returns `undefined`
			 * "typeof" All types are strings, and thus non-nullish
			 * "!" Boolean is never nullish
			 * "delete" Returns a boolean, which is never nullish
			 * Math operators always return numbers or strings, neither of which
			 * are non-nullish "+", "-", "~"
			 */

			return true;
		case "SequenceExpression": {
			const last = node.expressions.at(-1);

			return hasConstantNullishness(scope, last, nonNullish);
		}
		case "Identifier":
			return (
				node.name === "undefined" &&
				isReferenceToGlobalVariable(scope, node)
			);
		case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior.
		case "JSXFragment":
			return false;
		default:
			return false;
	}
}

/**
 * Test if an AST node is a boolean value that never changes. Specifically we
 * test for:
 * 1. Literal booleans (`true` or `false`)
 * 2. Unary `!` expressions with a constant value
 * 3. Constant booleans created via the `Boolean` global function
 * @param {Scope} scope The scope in which the node was found.
 * @param {ASTNode} node The node to test
 * @returns {boolean} Is `node` guaranteed to be a boolean?
 */
function isStaticBoolean(scope, node) {
	switch (node.type) {
		case "Literal":
			return typeof node.value === "boolean";
		case "CallExpression":
			return (
				node.callee.type === "Identifier" &&
				node.callee.name === "Boolean" &&
				isReferenceToGlobalVariable(scope, node.callee) &&
				(node.arguments.length === 0 ||
					isConstant(scope, node.arguments[0], true))
			);
		case "UnaryExpression":
			return (
				node.operator === "!" && isConstant(scope, node.argument, true)
			);
		default:
			return false;
	}
}

/**
 * Test if an AST node will always give the same result when compared to a
 * boolean value. Note that comparison to boolean values is different than
 * truthiness.
 * https://262.ecma-international.org/5.1/#sec-11.9.3
 *
 * JavaScript `==` operator works by converting the boolean to `1` (true) or
 * `+0` (false) and then checks the values `==` equality to that number.
 * @param {Scope} scope The scope in which node was found.
 * @param {ASTNode} node The node to test.
 * @returns {boolean} Will `node` always coerce to the same boolean value?
 */
function hasConstantLooseBooleanComparison(scope, node) {
	switch (node.type) {
		case "ObjectExpression":
		case "ClassExpression":
			/**
			 * In theory objects like:
			 *
			 * `{toString: () => a}`
			 * `{valueOf: () => a}`
			 *
			 * Or a classes like:
			 *
			 * `class { static toString() { return a } }`
			 * `class { static valueOf() { return a } }`
			 *
			 * Are not constant verifiably when `inBooleanPosition` is
			 * false, but it's an edge case we've opted not to handle.
			 */
			return true;
		case "ArrayExpression": {
			const nonSpreadElements = node.elements.filter(
				e =>
					// Elements can be `null` in sparse arrays: `[,,]`;
					e !== null && e.type !== "SpreadElement",
			);

			/*
			 * Possible future direction if needed: We could check if the
			 * single value would result in variable boolean comparison.
			 * For now we will err on the side of caution since `[x]` could
			 * evaluate to `[0]` or `[1]`.
			 */
			return node.elements.length === 0 || nonSpreadElements.length > 1;
		}
		case "ArrowFunctionExpression":
		case "FunctionExpression":
			return true;
		case "UnaryExpression":
			if (
				node.operator === "void" || // Always returns `undefined`
				node.operator === "typeof" // All `typeof` strings, when coerced to number, are not 0 or 1.
			) {
				return true;
			}
			if (node.operator === "!") {
				return isConstant(scope, node.argument, true);
			}

			/*
			 * We won't try to reason about +, -, ~, or delete
			 * In theory, for the mathematical operators, we could look at the
			 * argument and try to determine if it coerces to a constant numeric
			 * value.
			 */
			return false;
		case "NewExpression": // Objects might have custom `.valueOf` or `.toString`.
			return false;
		case "CallExpression": {
			if (
				node.callee.type === "Identifier" &&
				node.callee.name === "Boolean" &&
				isReferenceToGlobalVariable(scope, node.callee)
			) {
				return (
					node.arguments.length === 0 ||
					isConstant(scope, node.arguments[0], true)
				);
			}
			return false;
		}
		case "Literal": // True or false, literals never change
			return true;
		case "Identifier":
			return (
				node.name === "undefined" &&
				isReferenceToGlobalVariable(scope, node)
			);
		case "TemplateLiteral":
			/*
			 * In theory we could try to check if the quasi are sufficient to
			 * prove that the expression will always be true, but it would be
			 * tricky to get right. For example: `000.${foo}000`
			 */
			return node.expressions.length === 0;
		case "AssignmentExpression":
			if (node.operator === "=") {
				return hasConstantLooseBooleanComparison(scope, node.right);
			}

			/*
			 * Handling short-circuiting assignment operators would require
			 * walking the scope. We won't attempt that (for now...)
			 *
			 * The remaining assignment expressions all result in a numeric or
			 * string (non-nullish) values which could be truthy or falsy:
			 *   "+=", "-=", "*=", "/=", "%=", "<<=", ">>=", ">>>=", "|=", "^=", "&="
			 */
			return false;
		case "SequenceExpression": {
			const last = node.expressions.at(-1);

			return hasConstantLooseBooleanComparison(scope, last);
		}
		case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior.
		case "JSXFragment":
			return false;
		default:
			return false;
	}
}

/**
 * Test if an AST node will always give the same result when _strictly_ compared
 * to a boolean value. This can happen if the expression can never be boolean, or
 * if it is always the same boolean value.
 * @param {Scope} scope The scope in which the node was found.
 * @param {ASTNode} node The node to test
 * @returns {boolean} Will `node` always give the same result when compared to a
 * static boolean value?
 */
function hasConstantStrictBooleanComparison(scope, node) {
	switch (node.type) {
		case "ObjectExpression": // Objects are not booleans
		case "ArrayExpression": // Arrays are not booleans
		case "ArrowFunctionExpression": // Functions are not booleans
		case "FunctionExpression":
		case "ClassExpression": // Classes are not booleans
		case "NewExpression": // Objects are not booleans
		case "TemplateLiteral": // Strings are not booleans
		case "Literal": // True, false, or not boolean, literals never change.
		case "UpdateExpression": // Numbers are not booleans
			return true;
		case "BinaryExpression":
			return NUMERIC_OR_STRING_BINARY_OPERATORS.has(node.operator);
		case "UnaryExpression": {
			if (node.operator === "delete") {
				return false;
			}
			if (node.operator === "!") {
				return isConstant(scope, node.argument, true);
			}

			/*
			 * The remaining operators return either strings or numbers, neither
			 * of which are boolean.
			 */
			return true;
		}
		case "SequenceExpression": {
			const last = node.expressions.at(-1);

			return hasConstantStrictBooleanComparison(scope, last);
		}
		case "Identifier":
			return (
				node.name === "undefined" &&
				isReferenceToGlobalVariable(scope, node)
			);
		case "AssignmentExpression":
			if (node.operator === "=") {
				return hasConstantStrictBooleanComparison(scope, node.right);
			}

			/*
			 * Handling short-circuiting assignment operators would require
			 * walking the scope. We won't attempt that (for now...)
			 */
			if (isLogicalAssignmentOperator(node.operator)) {
				return false;
			}

			/*
			 * The remaining assignment expressions all result in either a number
			 * or a string, neither of which can ever be boolean.
			 */
			return true;
		case "CallExpression": {
			if (node.callee.type !== "Identifier") {
				return false;
			}
			const functionName = node.callee.name;

			if (
				(functionName === "String" ||
					functionName === "Number" ||
					functionName === "BigInt" ||
					functionName === "Symbol") &&
				isReferenceToGlobalVariable(scope, node.callee)
			) {
				return true;
			}
			if (
				functionName === "Boolean" &&
				isReferenceToGlobalVariable(scope, node.callee)
			) {
				return (
					node.arguments.length === 0 ||
					isConstant(scope, node.arguments[0], true)
				);
			}
			return false;
		}
		case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior.
		case "JSXFragment":
			return false;
		default:
			return false;
	}
}

/**
 * Test if an AST node will always result in a newly constructed object
 * @param {Scope} scope The scope in which the node was found.
 * @param {ASTNode} node The node to test
 * @returns {boolean} Will `node` always be new?
 */
function isAlwaysNew(scope, node) {
	switch (node.type) {
		case "ObjectExpression":
		case "ArrayExpression":
		case "ArrowFunctionExpression":
		case "FunctionExpression":
		case "ClassExpression":
			return true;
		case "NewExpression": {
			if (node.callee.type !== "Identifier") {
				return false;
			}

			/*
			 * All the built-in constructors are always new, but
			 * user-defined constructors could return a sentinel
			 * object.
			 *
			 * Catching these is especially useful for primitive constructors
			 * which return boxed values, a surprising gotcha' in JavaScript.
			 */
			return (
				Object.hasOwn(ECMASCRIPT_GLOBALS, node.callee.name) &&
				isReferenceToGlobalVariable(scope, node.callee)
			);
		}
		case "Literal":
			// Regular expressions are objects, and thus always new
			return typeof node.regex === "object";
		case "SequenceExpression": {
			const last = node.expressions.at(-1);

			return isAlwaysNew(scope, last);
		}
		case "AssignmentExpression":
			if (node.operator === "=") {
				return isAlwaysNew(scope, node.right);
			}
			return false;
		case "ConditionalExpression":
			return (
				isAlwaysNew(scope, node.consequent) &&
				isAlwaysNew(scope, node.alternate)
			);
		case "JSXElement": // ESLint has a policy of not assuming any specific JSX behavior.
		case "JSXFragment":
			return false;
		default:
			return false;
	}
}

/**
 * Checks if one operand will cause the result to be constant.
 * @param {Scope} scope Scope in which the expression was found.
 * @param {ASTNode} a One side of the expression
 * @param {ASTNode} b The other side of the expression
 * @param {string} operator The binary expression operator
 * @returns {ASTNode | null} The node which will cause the expression to have a constant result.
 */
function findBinaryExpressionConstantOperand(scope, a, b, operator) {
	if (operator === "==" || operator === "!=") {
		if (
			(isNullOrUndefined(scope, a) &&
				hasConstantNullishness(scope, b, false)) ||
			(isStaticBoolean(scope, a) &&
				hasConstantLooseBooleanComparison(scope, b))
		) {
			return b;
		}
	} else if (operator === "===" || operator === "!==") {
		if (
			(isNullOrUndefined(scope, a) &&
				hasConstantNullishness(scope, b, false)) ||
			(isStaticBoolean(scope, a) &&
				hasConstantStrictBooleanComparison(scope, b))
		) {
			return b;
		}
	}
	return null;
}

/**
 * Checks if a node is a statically knowable literal.
 * @param {Scope} scope The scope in which the node was found.
 * @param {ASTNode} node The node to test.
 * @returns {boolean} `true` if the node is a literal.
 */
function isStaticLiteral(scope, node) {
	switch (node.type) {
		case "Literal":
			return true;
		case "UnaryExpression":
			return (
				["-", "+", "~"].includes(node.operator) &&
				node.argument.type === "Literal"
			);
		case "Identifier":
			return (
				node.name === "undefined" &&
				isReferenceToGlobalVariable(scope, node)
			);
		case "TemplateLiteral":
			return node.expressions.length === 0;
		default:
			return false;
	}
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",
		docs: {
			description:
				"Disallow expressions where the operation doesn't affect the value",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-constant-binary-expression",
		},
		defaultOptions: [
			{
				checkRelationalComparisons: false,
			},
		],
		schema: [
			{
				type: "object",
				properties: {
					checkRelationalComparisons: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],
		messages: {
			constantBinaryOperand:
				"Unexpected constant binary expression. Compares constantly with the {{otherSide}}-hand side of the `{{operator}}`.",
			constantShortCircuit:
				"Unexpected constant {{property}} on the left-hand side of a `{{operator}}` expression.",
			alwaysNew:
				"Unexpected comparison to newly constructed object. These two values can never be equal.",
			bothAlwaysNew:
				"Unexpected comparison of two newly constructed objects. These two values can never be equal.",
			constantRelationalComparison:
				"Unexpected constant relational comparison. Both sides of the `{{operator}}` are literal values.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const { checkRelationalComparisons } = context.options[0];

		return {
			LogicalExpression(node) {
				const { operator, left } = node;
				const scope = sourceCode.getScope(node);

				if (
					(operator === "&&" || operator === "||") &&
					isConstant(scope, left, true)
				) {
					context.report({
						node: left,
						messageId: "constantShortCircuit",
						data: { property: "truthiness", operator },
					});
				} else if (
					operator === "??" &&
					hasConstantNullishness(scope, left, false)
				) {
					context.report({
						node: left,
						messageId: "constantShortCircuit",
						data: { property: "nullishness", operator },
					});
				}
			},
			BinaryExpression(node) {
				const scope = sourceCode.getScope(node);
				const { right, left, operator } = node;
				const rightConstantOperand =
					findBinaryExpressionConstantOperand(
						scope,
						left,
						right,
						operator,
					);
				const leftConstantOperand = findBinaryExpressionConstantOperand(
					scope,
					right,
					left,
					operator,
				);

				if (rightConstantOperand) {
					context.report({
						node: rightConstantOperand,
						messageId: "constantBinaryOperand",
						data: { operator, otherSide: "left" },
					});
				} else if (leftConstantOperand) {
					context.report({
						node: leftConstantOperand,
						messageId: "constantBinaryOperand",
						data: { operator, otherSide: "right" },
					});
				} else if (operator === "===" || operator === "!==") {
					if (isAlwaysNew(scope, left)) {
						context.report({ node: left, messageId: "alwaysNew" });
					} else if (isAlwaysNew(scope, right)) {
						context.report({ node: right, messageId: "alwaysNew" });
					}
				} else if (operator === "==" || operator === "!=") {
					/*
					 * If both sides are "new", then both sides are objects and
					 * therefore they will be compared by reference even with `==`
					 * equality.
					 */
					if (isAlwaysNew(scope, left) && isAlwaysNew(scope, right)) {
						context.report({
							node: left,
							messageId: "bothAlwaysNew",
						});
					}
				} else if (
					checkRelationalComparisons &&
					RELATIONAL_OPERATORS.has(operator)
				) {
					if (
						isStaticLiteral(scope, left) &&
						isStaticLiteral(scope, right)
					) {
						context.report({
							node,
							messageId: "constantRelationalComparison",
							data: { operator },
						});
					}
				}
			},

			/*
			 * In theory we could handle short-circuiting assignment operators,
			 * for some constant values, but that would require walking the
			 * scope to find the value of the variable being assigned. This is
			 * dependent on https://github.com/eslint/eslint/issues/13776
			 *
			 * AssignmentExpression() {},
			 */
		};
	},
};
B=xu/**
 * @fileoverview Rule to flag use constant conditions
 * @author Christian Schulz <http://rndm.de>
 */

"use strict";

const { isConstant } = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		defaultOptions: [{ checkLoops: "allExceptWhileTrue" }],

		docs: {
			description: "Disallow constant expressions in conditions",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-constant-condition",
		},

		schema: [
			{
				type: "object",
				properties: {
					checkLoops: {
						enum: [
							"all",
							"allExceptWhileTrue",
							"none",
							true,
							false,
						],
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			unexpected: "Unexpected constant condition.",
		},
	},

	create(context) {
		const loopSetStack = [];
		const sourceCode = context.sourceCode;
		let [{ checkLoops }] = context.options;

		if (checkLoops === true) {
			checkLoops = "all";
		} else if (checkLoops === false) {
			checkLoops = "none";
		}

		let loopsInCurrentScope = new Set();

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Tracks when the given node contains a constant condition.
		 * @param {ASTNode} node The AST node to check.
		 * @returns {void}
		 * @private
		 */
		function trackConstantConditionLoop(node) {
			if (
				node.test &&
				isConstant(sourceCode.getScope(node), node.test, true)
			) {
				loopsInCurrentScope.add(node);
			}
		}

		/**
		 * Reports when the set contains the given constant condition node
		 * @param {ASTNode} node The AST node to check.
		 * @returns {void}
		 * @private
		 */
		function checkConstantConditionLoopInSet(node) {
			if (loopsInCurrentScope.has(node)) {
				loopsInCurrentScope.delete(node);
				context.report({ node: node.test, messageId: "unexpected" });
			}
		}

		/**
		 * Reports when the given node contains a constant condition.
		 * @param {ASTNode} node The AST node to check.
		 * @returns {void}
		 * @private
		 */
		function reportIfConstant(node) {
			if (
				node.test &&
				isConstant(sourceCode.getScope(node), node.test, true)
			) {
				context.report({ node: node.test, messageId: "unexpected" });
			}
		}

		/**
		 * Stores current set of constant loops in loopSetStack temporarily
		 * and uses a new set to track constant loops
		 * @returns {void}
		 * @private
		 */
		function enterFunction() {
			loopSetStack.push(loopsInCurrentScope);
			loopsInCurrentScope = new Set();
		}

		/**
		 * Reports when the set still contains stored constant conditions
		 * @returns {void}
		 * @private
		 */
		function exitFunction() {
			loopsInCurrentScope = loopSetStack.pop();
		}

		/**
		 * Checks node when checkLoops option is enabled
		 * @param {ASTNode} node The AST node to check.
		 * @returns {void}
		 * @private
		 */
		function checkLoop(node) {
			if (checkLoops === "all" || checkLoops === "allExceptWhileTrue") {
				trackConstantConditionLoop(node);
			}
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			ConditionalExpression: reportIfConstant,
			IfStatement: reportIfConstant,
			WhileStatement(node) {
				if (
					node.test.type === "Literal" &&
					node.test.value === true &&
					checkLoops === "allExceptWhileTrue"
				) {
					return;
				}

				checkLoop(node);
			},
			"WhileStatement:exit": checkConstantConditionLoopInSet,
			DoWhileStatement: checkLoop,
			"DoWhileStatement:exit": checkConstantConditionLoopInSet,
			ForStatement: checkLoop,
			"ForStatement > .test": node => checkLoop(node.parent),
			"ForStatement:exit": checkConstantConditionLoopInSet,
			FunctionDeclaration: enterFunction,
			"FunctionDeclaration:exit": exitFunction,
			FunctionExpression: enterFunction,
			"FunctionExpression:exit": exitFunction,
			YieldExpression: () => loopsInCurrentScope.clear(),
		};
	},
};
c־x>/**
 * @fileoverview Rule to disallow returning values from Promise executor functions
 * @author Milos Djermanovic
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const functionTypesToCheck = new Set([
	"ArrowFunctionExpression",
	"FunctionExpression",
]);

/**
 * Determines whether the given function node is used as a Promise executor.
 * @param {ASTNode} node The node to check.
 * @param {SourceCode} sourceCode Source code to which the node belongs.
 * @returns {boolean} `true` if the node is a Promise executor.
 */
function isPromiseExecutor(node, sourceCode) {
	const parent = node.parent;

	return (
		parent.type === "NewExpression" &&
		parent.arguments[0] === node &&
		parent.callee.type === "Identifier" &&
		parent.callee.name === "Promise" &&
		sourceCode.isGlobalReference(parent.callee)
	);
}

/**
 * Checks if the given node is a void expression.
 * @param {ASTNode} node The node to check.
 * @returns {boolean} - `true` if the node is a void expression
 */
function expressionIsVoid(node) {
	return node.type === "UnaryExpression" && node.operator === "void";
}

/**
 * Fixes the linting error by prepending "void " to the given node
 * @param {Object} sourceCode context given by context.sourceCode
 * @param {ASTNode} node The node to fix.
 * @param {Object} fixer The fixer object provided by ESLint.
 * @returns {Array<Object>} - An array of fix objects to apply to the node.
 */
function voidPrependFixer(sourceCode, node, fixer) {
	const requiresParens =
		// prepending `void ` will fail if the node has a lower precedence than void
		astUtils.getPrecedence(node) <
			astUtils.getPrecedence({
				type: "UnaryExpression",
				operator: "void",
			}) &&
		// check if there are parentheses around the node to avoid redundant parentheses
		!astUtils.isParenthesised(sourceCode, node);

	// avoid parentheses issues
	const returnOrArrowToken = sourceCode.getTokenBefore(
		node,
		node.parent.type === "ArrowFunctionExpression"
			? astUtils.isArrowToken
			: // isReturnToken
				token => token.type === "Keyword" && token.value === "return",
	);

	const firstToken = sourceCode.getTokenAfter(returnOrArrowToken);

	const prependSpace =
		// is return token, as => allows void to be adjacent
		returnOrArrowToken.value === "return" &&
		// If two tokens (return and "(") are adjacent
		returnOrArrowToken.range[1] === firstToken.range[0];

	return [
		fixer.insertTextBefore(
			firstToken,
			`${prependSpace ? " " : ""}void ${requiresParens ? "(" : ""}`,
		),
		fixer.insertTextAfter(node, requiresParens ? ")" : ""),
	];
}

/**
 * Fixes the linting error by `wrapping {}` around the given node's body.
 * @param {Object} sourceCode context given by context.sourceCode
 * @param {ASTNode} node The node to fix.
 * @param {Object} fixer The fixer object provided by ESLint.
 * @returns {Array<Object>} - An array of fix objects to apply to the node.
 */
function curlyWrapFixer(sourceCode, node, fixer) {
	// https://github.com/eslint/eslint/pull/17282#issuecomment-1592795923
	const arrowToken = sourceCode.getTokenBefore(
		node.body,
		astUtils.isArrowToken,
	);
	const firstToken = sourceCode.getTokenAfter(arrowToken);
	const lastToken = sourceCode.getLastToken(node);

	return [
		fixer.insertTextBefore(firstToken, "{"),
		fixer.insertTextAfter(lastToken, "}"),
	];
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		defaultOptions: [
			{
				allowVoid: false,
			},
		],

		docs: {
			description:
				"Disallow returning values from Promise executor functions",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-promise-executor-return",
		},

		hasSuggestions: true,

		schema: [
			{
				type: "object",
				properties: {
					allowVoid: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			returnsValue:
				"Return values from promise executor functions cannot be read.",

			// arrow and function suggestions
			prependVoid: "Prepend `void` to the expression.",

			// only arrow suggestions
			wrapBraces: "Wrap the expression in `{}`.",
		},
	},

	create(context) {
		let funcInfo = null;
		const sourceCode = context.sourceCode;
		const [{ allowVoid }] = context.options;

		return {
			onCodePathStart(_, node) {
				funcInfo = {
					upper: funcInfo,
					shouldCheck:
						functionTypesToCheck.has(node.type) &&
						isPromiseExecutor(node, sourceCode),
				};

				if (
					// Is a Promise executor
					funcInfo.shouldCheck &&
					node.type === "ArrowFunctionExpression" &&
					node.expression &&
					// Except void
					!(allowVoid && expressionIsVoid(node.body))
				) {
					const suggest = [];

					// prevent useless refactors
					if (allowVoid) {
						suggest.push({
							messageId: "prependVoid",
							fix(fixer) {
								return voidPrependFixer(
									sourceCode,
									node.body,
									fixer,
								);
							},
						});
					}

					// Do not suggest wrapping an unnamed function or class expression in braces as that would be invalid syntax.
					if (!(
						(node.body.type === "FunctionExpression" ||
							node.body.type === "ClassExpression") &&
						!node.body.id
					)) {
						suggest.push({
							messageId: "wrapBraces",
							fix(fixer) {
								return curlyWrapFixer(sourceCode, node, fixer);
							},
						});
					}

					context.report({
						node: node.body,
						messageId: "returnsValue",
						suggest,
					});
				}
			},

			onCodePathEnd() {
				funcInfo = funcInfo.upper;
			},

			ReturnStatement(node) {
				if (!(funcInfo.shouldCheck && node.argument)) {
					return;
				}

				// node is `return <expression>`
				if (!allowVoid) {
					context.report({ node, messageId: "returnsValue" });
					return;
				}

				if (expressionIsVoid(node.argument)) {
					return;
				}

				// allowVoid && !expressionIsVoid
				context.report({
					node,
					messageId: "returnsValue",
					suggest: [
						{
							messageId: "prependVoid",
							fix(fixer) {
								return voidPrependFixer(
									sourceCode,
									node.argument,
									fixer,
								);
							},
						},
					],
				});
			},
		};
	},
};
dx#Lx84	5( from constructor.
 * @author Pig Fang <g-plane>sjƓ  from constructorKconstructor-return",
		},

		schema: [],

		fixable: null,

		messages: {
			unexpected: "Unexpected return statement in constructor3#const stack = []0Cstack.push(node);
			},
			onCodePathEnd() {
				stack.pop();
			}, 0const last = stack.at(-1);

				if (!last.parentif (
					last.parent.type === "MethodDefinition" &&
					last.parent.kind === "constructor" &&
					node.argument
				) {
				d),
						messageId: "unexpected"o		};
	},
};
Tݬx(/**
 * @fileoverview Rule to flag adding properties to native object's prototypes.
 * @author David Nelson
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [{ exceptions: [] }],

		docs: {
			description: "Disallow extending native types",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-extend-native",
		},

		schema: [
			{
				type: "object",
				properties: {
					exceptions: {
						type: "array",
						items: {
							type: "string",
						},
						uniqueItems: true,
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			unexpected:
				"{{builtin}} prototype is read only, properties should not be added.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const exceptions = new Set(context.options[0].exceptions);
		const modifiedBuiltins = new Set(
			Object.keys(astUtils.ECMASCRIPT_GLOBALS)
				.filter(builtin => builtin[0].toUpperCase() === builtin[0])
				.filter(builtin => !exceptions.has(builtin)),
		);

		/**
		 * Reports a lint error for the given node.
		 * @param {ASTNode} node The node to report.
		 * @param {string} builtin The name of the native builtin being extended.
		 * @returns {void}
		 */
		function reportNode(node, builtin) {
			context.report({
				node,
				messageId: "unexpected",
				data: {
					builtin,
				},
			});
		}

		/**
		 * Check to see if the `prototype` property of the given object
		 * identifier node is being accessed.
		 * @param {ASTNode} identifierNode The Identifier representing the object
		 * to check.
		 * @returns {boolean} True if the identifier is the object of a
		 * MemberExpression and its `prototype` property is being accessed,
		 * false otherwise.
		 */
		function isPrototypePropertyAccessed(identifierNode) {
			return Boolean(
				identifierNode &&
				identifierNode.parent &&
				identifierNode.parent.type === "MemberExpression" &&
				identifierNode.parent.object === identifierNode &&
				astUtils.getStaticPropertyName(identifierNode.parent) ===
					"prototype",
			);
		}

		/**
		 * Check if it's an assignment to the property of the given node.
		 * Example: `*.prop = 0` // the `*` is the given node.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} True if an assignment to the property of the node.
		 */
		function isAssigningToPropertyOf(node) {
			return (
				node.parent.type === "MemberExpression" &&
				node.parent.object === node &&
				node.parent.parent.type === "AssignmentExpression" &&
				node.parent.parent.left === node.parent
			);
		}

		/**
		 * Checks if the given node is at the first argument of the method call of `Object.defineProperty()` or `Object.defineProperties()`.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} True if the node is at the first argument of the method call of `Object.defineProperty()` or `Object.defineProperties()`.
		 */
		function isInDefinePropertyCall(node) {
			return (
				node.parent.type === "CallExpression" &&
				node.parent.arguments[0] === node &&
				astUtils.isSpecificMemberAccess(
					node.parent.callee,
					"Object",
					/^definePropert(?:y|ies)$/u,
				)
			);
		}

		/**
		 * Check to see if object prototype access is part of a prototype
		 * extension. There are three ways a prototype can be extended:
		 * 1. Assignment to prototype property (Object.prototype.foo = 1)
		 * 2. Object.defineProperty()/Object.defineProperties() on a prototype
		 * If prototype extension is detected, report the AssignmentExpression
		 * or CallExpression node.
		 * @param {ASTNode} identifierNode The Identifier representing the object
		 * which prototype is being accessed and possibly extended.
		 * @returns {void}
		 */
		function checkAndReportPrototypeExtension(identifierNode) {
			if (!isPrototypePropertyAccessed(identifierNode)) {
				return; // This is not `*.prototype` access.
			}

			/*
			 * `identifierNode.parent` is a MemberExpression `*.prototype`.
			 * If it's an optional member access, it may be wrapped by a `ChainExpression` node.
			 */
			const prototypeNode =
				identifierNode.parent.parent.type === "ChainExpression"
					? identifierNode.parent.parent
					: identifierNode.parent;

			if (isAssigningToPropertyOf(prototypeNode)) {
				// `*.prototype` -> MemberExpression -> AssignmentExpression
				reportNode(prototypeNode.parent.parent, identifierNode.name);
			} else if (isInDefinePropertyCall(prototypeNode)) {
				// `*.prototype` -> CallExpression
				reportNode(prototypeNode.parent, identifierNode.name);
			}
		}

		return {
			"Program:exit"(node) {
				const globalScope = sourceCode.getScope(node);

				modifiedBuiltins.forEach(builtin => {
					const builtinVar = globalScope.set.get(builtin);

					if (builtinVar && builtinVar.references) {
						builtinVar.references
							.map(ref => ref.identifier)
							.forEach(checkAndReportPrototypeExtension);
					}
				});
			},
		};
	},
};
x6x,*"5use of continue statement
 * @author Borislav Zhivkovjjɓ!`continue` statementfrozen: tru4continue",
		},

		schema: [  & "Unexpected use of continue statement#oreturn {
			ContinueStatement(node) {
				context.report({ node, messageId: "unexpected" });
			},
		};
	},
};
eaxX/**
 * @fileoverview Rule to forbid control characters from regular expressions.
 * @author Nicholas C. Zakas
 */

"use strict";

const RegExpValidator = require("@eslint-community/regexpp").RegExpValidator;
const collector = new (class {
	constructor() {
		this._source = "";
		this._controlChars = [];
		this._validator = new RegExpValidator(this);
	}

	onPatternEnter() {
		/*
		 * `RegExpValidator` may parse the pattern twice in one `validatePattern`.
		 * So `this._controlChars` should be cleared here as well.
		 *
		 * For example, the `/(?<a>\x1f)/` regex will parse the pattern twice.
		 * This is based on the content described in Annex B.
		 * If the regex contains a `GroupName` and the `u` flag is not used, `ParseText` will be called twice.
		 * See https://tc39.es/ecma262/2023/multipage/additional-ecmascript-features-for-web-browsers.html#sec-parsepattern-annexb
		 */
		this._controlChars = [];
	}

	onCharacter(start, end, cp) {
		if (
			cp >= 0x00 &&
			cp <= 0x1f &&
			(this._source.codePointAt(start) === cp ||
				this._source.slice(start, end).startsWith("\\x") ||
				this._source.slice(start, end).startsWith("\\u"))
		) {
			this._controlChars.push(`\\x${`0${cp.toString(16)}`.slice(-2)}`);
		}
	}

	collectControlChars(regexpStr, flags) {
		const uFlag = typeof flags === "string" && flags.includes("u");
		const vFlag = typeof flags === "string" && flags.includes("v");

		this._controlChars = [];
		this._source = regexpStr;

		try {
			this._validator.validatePattern(regexpStr, void 0, void 0, {
				unicode: uFlag,
				unicodeSets: vFlag,
			}); // Call onCharacter hook
		} catch {
			// Ignore syntax errors in RegExp.
		}
		return this._controlChars;
	}
})();

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description: "Disallow control characters in regular expressions",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-control-regex",
		},

		schema: [],

		messages: {
			unexpected:
				"Unexpected control character(s) in regular expression: {{controlChars}}.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		/**
		 * Get the regex expression
		 * @param {ASTNode} node `Literal` node to evaluate
		 * @returns {{ pattern: string, flags: string | null } | null} Regex if found (the given node is either a regex literal
		 * or a string literal that is the pattern argument of a RegExp constructor call). Otherwise `null`. If flags cannot be determined,
		 * the `flags` property will be `null`.
		 * @private
		 */
		function getRegExp(node) {
			if (node.regex) {
				return node.regex;
			}
			if (
				typeof node.value === "string" &&
				(node.parent.type === "NewExpression" ||
					node.parent.type === "CallExpression") &&
				node.parent.callee.type === "Identifier" &&
				node.parent.callee.name === "RegExp" &&
				sourceCode.isGlobalReference(node.parent.callee) &&
				node.parent.arguments[0] === node
			) {
				const pattern = node.value;
				const flags =
					node.parent.arguments.length > 1 &&
					node.parent.arguments[1].type === "Literal" &&
					typeof node.parent.arguments[1].value === "string"
						? node.parent.arguments[1].value
						: null;

				return { pattern, flags };
			}

			return null;
		}

		return {
			Literal(node) {
				const regExp = getRegExp(node);

				if (regExp) {
					const { pattern, flags } = regExp;
					const controlCharacters = collector.collectControlChars(
						pattern,
						flags,
					);

					if (controlCharacters.length > 0) {
						context.report({
							node,
							messageId: "unexpected",
							data: {
								controlChars: controlCharacters.join(", "),
							},
						});
					}
				}
			},
		};
	},
};
21x/**
 * @fileoverview Rule to flag use of a debugger statement
 * @author Nicholas C. Zakas
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description: "Disallow the use of `debugger`",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-debugger",
		},

		fixable: null,
		schema: [],

		messages: {
			unexpected: "Unexpected 'debugger' statement.",
		},
	},

	create(context) {
		return {
			DebuggerStatement(node) {
				context.report({
					node,
					messageId: "unexpected",
				});
			},
		};
	},
};
ݫx/**
 * @fileoverview Rule to flag labels that are the same as an identifier
 * @author Ian Christian Myers
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow labels that share a name with a variable",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/no-label-var",
		},

		schema: [],

		messages: {
			identifierClashWithLabel:
				"Found identifier with same name as label.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Check if the identifier is present inside current scope
		 * @param {Object} scope current scope
		 * @param {string} name To evaluate
		 * @returns {boolean} True if its present
		 * @private
		 */
		function findIdentifier(scope, name) {
			return astUtils.getVariableByName(scope, name) !== null;
		}

		//--------------------------------------------------------------------------
		// Public API
		//--------------------------------------------------------------------------

		return {
			LabeledStatement(node) {
				// Fetch the innermost scope.
				const scope = sourceCode.getScope(node);

				/*
				 * Recursively find the identifier walking up the scope, starting
				 * with the innermost scope.
				 */
				if (findIdentifier(scope, node.label.name)) {
					context.report({
						node,
						messageId: "identifierClashWithLabel",
					});
				}
			},
		};
	},
};
E+-xa"/when deleting variables
 * @author Ilya Volodinjj#deleting variables",
			recommended9delete*-,unexpected: "Variables should not be deleted#return {
			UnaryExpression(node) {
				if (
					node.operator === "delete" &&
					node.argument.type === "Identifier"
				) ; node, messageId: "unexpected" });
				}
			},
		};
	},
};
1ouMx"/**
 * @fileoverview Rule to check for ambiguous div operator in regexes
 * @author Matt DuVall <http://www.mattduvall.com>
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Disallow equal signs explicitly at the beginning of regular expressions",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/no-div-regex",
		},

		fixable: "code",

		schema: [],

		messages: {
			unexpected:
				"A regular expression literal can be confused with '/='.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		return {
			Literal(node) {
				const token = sourceCode.getFirstToken(node);

				if (
					token.type === "RegularExpression" &&
					token.value[1] === "="
				) {
					context.report({
						node,
						messageId: "unexpected",
						fix(fixer) {
							return fixer.replaceTextRange(
								[token.range[0] + 1, token.range[0] + 2],
								"[=]",
							);
						},
					});
				}
			},
		};
	},
};

\qx4
/**
 * @fileoverview Rule to flag duplicate arguments
 * @author Jamund Ferguson
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @typedef {import("eslint-scope").Definition} Definition */

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description:
				"Disallow duplicate arguments in `function` definitions",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-dupe-args",
		},

		schema: [],

		messages: {
			unexpected: "Duplicate param '{{name}}'.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Checks whether or not a given definition is a parameter's.
		 * @param {Definition} def A definition to check.
		 * @returns {boolean} `true` if the definition is a parameter's.
		 */
		function isParameter(def) {
			return def.type === "Parameter";
		}

		/**
		 * Determines if a given node has duplicate parameters.
		 * @param {ASTNode} node The node to check.
		 * @returns {void}
		 * @private
		 */
		function checkParams(node) {
			const variables = sourceCode.getDeclaredVariables(node);

			for (let i = 0; i < variables.length; ++i) {
				const variable = variables[i];

				// Checks and reports duplications.
				const defs = variable.defs.filter(isParameter);
				const loc = {
					start: astUtils.getOpeningParenOfParams(node, sourceCode)
						.loc.start,
					end: sourceCode.getTokenBefore(node.body).loc.end,
				};

				if (defs.length >= 2) {
					context.report({
						loc,
						messageId: "unexpected",
						data: { name: variable.name },
					});
				}
			}
		}

		//--------------------------------------------------------------------------
		// Public API
		//--------------------------------------------------------------------------

		return {
			FunctionDeclaration: checkParams,
			FunctionExpression: checkParams,
		};
	},
};
\x@/**
 * @fileoverview A rule to disallow duplicate name in class members.
 * @author Toru Nagashima
 */

"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description: "Disallow duplicate class members",
			dialects: ["JavaScript", "TypeScript"],
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-dupe-class-members",
		},

		schema: [],

		messages: {
			unexpected: "Duplicate name '{{name}}'.",
		},
	},

	create(context) {
		let stack = [];

		/**
		 * Gets state of a given member name.
		 * @param {string} name A name of a member.
		 * @param {boolean} isStatic A flag which specifies that is a static member.
		 * @returns {Object} A state of a given member name.
		 *   - retv.init {boolean} A flag which shows the name is declared as normal member.
		 *   - retv.get {boolean} A flag which shows the name is declared as getter.
		 *   - retv.set {boolean} A flag which shows the name is declared as setter.
		 */
		function getState(name, isStatic) {
			const stateMap = stack.at(-1);
			const key = `$${name}`; // to avoid "__proto__".

			if (!stateMap[key]) {
				stateMap[key] = {
					nonStatic: { init: false, get: false, set: false },
					static: { init: false, get: false, set: false },
				};
			}

			return stateMap[key][isStatic ? "static" : "nonStatic"];
		}

		return {
			// Initializes the stack of state of member declarations.
			Program() {
				stack = [];
			},

			// Initializes state of member declarations for the class.
			ClassBody() {
				stack.push(Object.create(null));
			},

			// Disposes the state for the class.
			"ClassBody:exit"() {
				stack.pop();
			},

			// Reports the node if its name has been declared already.
			"MethodDefinition, PropertyDefinition"(node) {
				if (
					node.value &&
					node.value.type === "TSEmptyBodyFunctionExpression"
				) {
					return;
				}

				const name = astUtils.getStaticPropertyName(node);
				const kind =
					node.type === "MethodDefinition" ? node.kind : "field";

				if (name === null || kind === "constructor") {
					return;
				}

				const state = getState(name, node.static);
				let isDuplicate;

				if (kind === "get") {
					isDuplicate = state.init || state.get;
					state.get = true;
				} else if (kind === "set") {
					isDuplicate = state.init || state.set;
					state.set = true;
				} else {
					isDuplicate = state.init || state.get || state.set;
					state.init = true;
				}

				if (isDuplicate) {
					context.report({
						loc: node.key.loc,
						messageId: "unexpected",
						data: { name },
					});
				}
			},
		};
	},
};
Xxe/**
 * @fileoverview Rule to disallow duplicate conditions in if-else-if chains
 * @author Milos Djermanovic
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Determines whether the first given array is a subset of the second given array.
 * @param {Function} comparator A function to compare two elements, should return `true` if they are equal.
 * @param {Array} arrA The array to compare from.
 * @param {Array} arrB The array to compare against.
 * @returns {boolean} `true` if the array `arrA` is a subset of the array `arrB`.
 */
function isSubsetByComparator(comparator, arrA, arrB) {
	return arrA.every(a => arrB.some(b => comparator(a, b)));
}

/**
 * Splits the given node by the given logical operator.
 * @param {string} operator Logical operator `||` or `&&`.
 * @param {ASTNode} node The node to split.
 * @returns {ASTNode[]} Array of conditions that makes the node when joined by the operator.
 */
function splitByLogicalOperator(operator, node) {
	if (node.type === "LogicalExpression" && node.operator === operator) {
		return [
			...splitByLogicalOperator(operator, node.left),
			...splitByLogicalOperator(operator, node.right),
		];
	}
	return [node];
}

const splitByOr = splitByLogicalOperator.bind(null, "||");
const splitByAnd = splitByLogicalOperator.bind(null, "&&");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description: "Disallow duplicate conditions in if-else-if chains",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-dupe-else-if",
		},

		schema: [],

		messages: {
			unexpected:
				"This branch can never execute. Its condition is a duplicate or covered by previous conditions in the if-else-if chain.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		/**
		 * Determines whether the two given nodes are considered to be equal. In particular, given that the nodes
		 * represent expressions in a boolean context, `||` and `&&` can be considered as commutative operators.
		 * @param {ASTNode} a First node.
		 * @param {ASTNode} b Second node.
		 * @returns {boolean} `true` if the nodes are considered to be equal.
		 */
		function equal(a, b) {
			if (a.type !== b.type) {
				return false;
			}

			if (
				a.type === "LogicalExpression" &&
				(a.operator === "||" || a.operator === "&&") &&
				a.operator === b.operator
			) {
				return (
					(equal(a.left, b.left) && equal(a.right, b.right)) ||
					(equal(a.left, b.right) && equal(a.right, b.left))
				);
			}

			return astUtils.equalTokens(a, b, sourceCode);
		}

		const isSubset = isSubsetByComparator.bind(null, equal);

		return {
			IfStatement(node) {
				const test = node.test,
					conditionsToCheck =
						test.type === "LogicalExpression" &&
						test.operator === "&&"
							? [test, ...splitByAnd(test)]
							: [test];
				let current = node,
					listToCheck = conditionsToCheck.map(c =>
						splitByOr(c).map(splitByAnd),
					);

				while (
					current.parent &&
					current.parent.type === "IfStatement" &&
					current.parent.alternate === current
				) {
					current = current.parent;

					const currentOrOperands = splitByOr(current.test).map(
						splitByAnd,
					);

					listToCheck = listToCheck.map(orOperands =>
						orOperands.filter(
							orOperand =>
								!currentOrOperands.some(currentOrOperand =>
									isSubset(currentOrOperand, orOperand),
								),
						),
					);

					if (
						listToCheck.some(orOperands => orOperands.length === 0)
					) {
						context.report({ node: test, messageId: "unexpected" });
						break;
					}
				}
			},
		};
	},
};
⼻x{/**
 * @fileoverview Rule to flag use of duplicate keys in an object.
 * @author Ian Christian Myers
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const GET_KIND = /^(?:init|get)$/u;
const SET_KIND = /^(?:init|set)$/u;

/**
 * The class which stores properties' information of an object.
 */
class ObjectInfo {
	/**
	 * @param {ObjectInfo|null} upper The information of the outer object.
	 * @param {ASTNode} node The ObjectExpression node of this information.
	 */
	constructor(upper, node) {
		this.upper = upper;
		this.node = node;
		this.properties = new Map();
	}

	/**
	 * Gets the information of the given Property node.
	 * @param {ASTNode} node The Property node to get.
	 * @returns {{get: boolean, set: boolean}} The information of the property.
	 */
	getPropertyInfo(node) {
		const name = astUtils.getStaticPropertyName(node);

		if (!this.properties.has(name)) {
			this.properties.set(name, { get: false, set: false });
		}
		return this.properties.get(name);
	}

	/**
	 * Checks whether the given property has been defined already or not.
	 * @param {ASTNode} node The Property node to check.
	 * @returns {boolean} `true` if the property has been defined.
	 */
	isPropertyDefined(node) {
		const entry = this.getPropertyInfo(node);

		return (
			(GET_KIND.test(node.kind) && entry.get) ||
			(SET_KIND.test(node.kind) && entry.set)
		);
	}

	/**
	 * Defines the given property.
	 * @param {ASTNode} node The Property node to define.
	 * @returns {void}
	 */
	defineProperty(node) {
		const entry = this.getPropertyInfo(node);

		if (GET_KIND.test(node.kind)) {
			entry.get = true;
		}
		if (SET_KIND.test(node.kind)) {
			entry.set = true;
		}
	}
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description: "Disallow duplicate keys in object literals",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-dupe-keys",
		},

		schema: [],

		messages: {
			unexpected: "Duplicate key '{{name}}'.",
		},
	},

	create(context) {
		let info = null;

		return {
			ObjectExpression(node) {
				info = new ObjectInfo(info, node);
			},
			"ObjectExpression:exit"() {
				info = info.upper;
			},

			Property(node) {
				const name = astUtils.getStaticPropertyName(node);

				// Skip destructuring.
				if (node.parent.type !== "ObjectExpression") {
					return;
				}

				// Skip if the name is not static.
				if (name === null) {
					return;
				}

				/*
				 * Skip if the property node is a proto setter.
				 * Proto setter is a special syntax that sets
				 * object's prototype instead of creating a property.
				 * It can be in one of the following forms:
				 *
				 *    __proto__: <expression>
				 *    '__proto__': <expression>
				 *    "__proto__": <expression>
				 *
				 * Duplicate proto setters produce parsing errors,
				 * so we can just skip them to not interfere with
				 * regular properties named "__proto__".
				 */
				if (
					name === "__proto__" &&
					node.kind === "init" &&
					!node.computed &&
					!node.shorthand &&
					!node.method
				) {
					return;
				}

				// Reports if the name is defined already.
				if (info.isPropertyDefined(node)) {
					context.report({
						node: info.node,
						loc: node.key.loc,
						messageId: "unexpected",
						data: { name },
					});
				}

				// Update info.
				info.defineProperty(node);
			},
		};
	},
};
{wnx/**
 * @fileoverview Rule to disallow a duplicate case label.
 * @author Dieter Oberkofler
 * @author Burak Yigit Kaya
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description: "Disallow duplicate case labels",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-duplicate-case",
		},

		schema: [],

		messages: {
			unexpected: "Duplicate case label.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		/**
		 * Determines whether the two given nodes are considered to be equal.
		 * @param {ASTNode} a First node.
		 * @param {ASTNode} b Second node.
		 * @returns {boolean} `true` if the nodes are considered to be equal.
		 */
		function equal(a, b) {
			if (a.type !== b.type) {
				return false;
			}

			return astUtils.equalTokens(a, b, sourceCode);
		}
		return {
			SwitchStatement(node) {
				const previousTests = [];

				for (const switchCase of node.cases) {
					if (switchCase.test) {
						const test = switchCase.test;

						if (
							previousTests.some(previousTest =>
								equal(previousTest, test),
							)
						) {
							context.report({
								node: switchCase,
								messageId: "unexpected",
							});
						} else {
							previousTests.push(test);
						}
					}
				}
			},
		};
	},
};
bCx'/**
 * @fileoverview Restrict usage of duplicate imports.
 * @author Simen Bekkhus
 */
"use strict";

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const NAMED_TYPES = ["ImportSpecifier", "ExportSpecifier"];
const NAMESPACE_TYPES = [
	"ImportNamespaceSpecifier",
	"ExportNamespaceSpecifier",
];

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/**
 * Check if an import/export type belongs to (ImportSpecifier|ExportSpecifier) or (ImportNamespaceSpecifier|ExportNamespaceSpecifier).
 * @param {string} importExportType An import/export type to check.
 * @param {string} type Can be "named" or "namespace"
 * @returns {boolean} True if import/export type belongs to (ImportSpecifier|ExportSpecifier) or (ImportNamespaceSpecifier|ExportNamespaceSpecifier) and false if it doesn't.
 */
function isImportExportSpecifier(importExportType, type) {
	const arrayToCheck = type === "named" ? NAMED_TYPES : NAMESPACE_TYPES;

	return arrayToCheck.includes(importExportType);
}

/**
 * Return the type of (import|export).
 * @param {ASTNode} node A node to get.
 * @returns {string} The type of the (import|export).
 */
function getImportExportType(node) {
	if (node.specifiers && node.specifiers.length > 0) {
		const nodeSpecifiers = node.specifiers;
		const index = nodeSpecifiers.findIndex(
			({ type }) =>
				isImportExportSpecifier(type, "named") ||
				isImportExportSpecifier(type, "namespace"),
		);
		const i = index > -1 ? index : 0;

		return nodeSpecifiers[i].type;
	}
	if (node.type === "ExportAllDeclaration") {
		if (node.exported) {
			return "ExportNamespaceSpecifier";
		}
		return "ExportAll";
	}
	return "SideEffectImport";
}

/**
 * Returns a boolean indicates if two (import|export) can be merged
 * @param {ASTNode} node1 A node to check.
 * @param {ASTNode} node2 A node to check.
 * @returns {boolean} True if two (import|export) can be merged, false if they can't.
 */
function isImportExportCanBeMerged(node1, node2) {
	const importExportType1 = getImportExportType(node1);
	const importExportType2 = getImportExportType(node2);

	if (
		(node1.importKind === "type" || node1.exportKind === "type") &&
		(node2.importKind === "type" || node2.exportKind === "type")
	) {
		const isDefault1 = importExportType1 === "ImportDefaultSpecifier";
		const isDefault2 = importExportType2 === "ImportDefaultSpecifier";
		const isNamed1 = isImportExportSpecifier(importExportType1, "named");
		const isNamed2 = isImportExportSpecifier(importExportType2, "named");

		if ((isDefault1 && isNamed2) || (isDefault2 && isNamed1)) {
			return false;
		}
	}

	if (
		(importExportType1 === "ExportAll" &&
			importExportType2 !== "ExportAll" &&
			importExportType2 !== "SideEffectImport") ||
		(importExportType1 !== "ExportAll" &&
			importExportType1 !== "SideEffectImport" &&
			importExportType2 === "ExportAll")
	) {
		return false;
	}
	if (
		(isImportExportSpecifier(importExportType1, "namespace") &&
			isImportExportSpecifier(importExportType2, "named")) ||
		(isImportExportSpecifier(importExportType2, "namespace") &&
			isImportExportSpecifier(importExportType1, "named"))
	) {
		return false;
	}
	return true;
}

/**
 * Returns a boolean if we should report (import|export).
 * @param {ASTNode} node A node to be reported or not.
 * @param {[ASTNode]} previousNodes An array contains previous nodes of the module imported or exported.
 * @param {boolean} allowSeparateTypeImports Whether to allow separate type and value imports.
 * @returns {boolean} True if the (import|export) should be reported.
 */
function shouldReportImportExport(
	node,
	previousNodes,
	allowSeparateTypeImports,
) {
	let i = 0;

	while (i < previousNodes.length) {
		const previousNode = previousNodes[i];

		if (allowSeparateTypeImports) {
			const isTypeNode =
				node.importKind === "type" || node.exportKind === "type";
			const isTypePrevious =
				previousNode.importKind === "type" ||
				previousNode.exportKind === "type";

			if (isTypeNode !== isTypePrevious) {
				i++;
				continue;
			}
		}

		if (isImportExportCanBeMerged(node, previousNode)) {
			return true;
		}
		i++;
	}
	return false;
}

/**
 * Returns array contains only nodes with declarations types equal to type.
 * @param {[{node: ASTNode, declarationType: string}]} nodes An array contains objects, each object contains a node and a declaration type.
 * @param {string} type Declaration type.
 * @returns {[ASTNode]} An array contains only nodes with declarations types equal to type.
 */
function getNodesByDeclarationType(nodes, type) {
	return nodes
		.filter(({ declarationType }) => declarationType === type)
		.map(({ node }) => node);
}

/**
 * Returns the name of the module imported or re-exported.
 * @param {ASTNode} node A node to get.
 * @returns {string} The name of the module, or empty string if no name.
 */
function getModule(node) {
	if (node && node.source && node.source.value) {
		return node.source.value.trim();
	}
	return "";
}

/**
 * Checks if the (import|export) can be merged with at least one import or one export, and reports if so.
 * @param {RuleContext} context The ESLint rule context object.
 * @param {ASTNode} node A node to get.
 * @param {Map} modules A Map object contains as a key a module name and as value an array contains objects, each object contains a node and a declaration type.
 * @param {string} declarationType A declaration type can be an import or export.
 * @param {boolean} includeExports Whether or not to check for exports in addition to imports.
 * @param {boolean} allowSeparateTypeImports Whether to allow separate type and value imports.
 * @returns {void} No return value.
 */
function checkAndReport(
	context,
	node,
	modules,
	declarationType,
	includeExports,
	allowSeparateTypeImports,
) {
	const module = getModule(node);

	if (modules.has(module)) {
		const previousNodes = modules.get(module);
		const messagesIds = [];
		const importNodes = getNodesByDeclarationType(previousNodes, "import");
		let exportNodes;

		if (includeExports) {
			exportNodes = getNodesByDeclarationType(previousNodes, "export");
		}
		if (declarationType === "import") {
			if (
				shouldReportImportExport(
					node,
					importNodes,
					allowSeparateTypeImports,
				)
			) {
				messagesIds.push("import");
			}
			if (includeExports) {
				if (
					shouldReportImportExport(
						node,
						exportNodes,
						allowSeparateTypeImports,
					)
				) {
					messagesIds.push("importAs");
				}
			}
		} else if (declarationType === "export") {
			if (
				shouldReportImportExport(
					node,
					exportNodes,
					allowSeparateTypeImports,
				)
			) {
				messagesIds.push("export");
			}
			if (
				shouldReportImportExport(
					node,
					importNodes,
					allowSeparateTypeImports,
				)
			) {
				messagesIds.push("exportAs");
			}
		}
		messagesIds.forEach(messageId =>
			context.report({
				node,
				messageId,
				data: {
					module,
				},
			}),
		);
	}
}

/**
 * @callback nodeCallback
 * @param {ASTNode} node A node to handle.
 */

/**
 * Returns a function handling the (imports|exports) of a given file
 * @param {RuleContext} context The ESLint rule context object.
 * @param {Map} modules A Map object contains as a key a module name and as value an array contains objects, each object contains a node and a declaration type.
 * @param {string} declarationType A declaration type can be an import or export.
 * @param {boolean} includeExports Whether or not to check for exports in addition to imports.
 * @param {boolean} allowSeparateTypeImports Whether to allow separate type and value imports.
 * @returns {nodeCallback} A function passed to ESLint to handle the statement.
 */
function handleImportsExports(
	context,
	modules,
	declarationType,
	includeExports,
	allowSeparateTypeImports,
) {
	return function (node) {
		const module = getModule(node);

		if (module) {
			checkAndReport(
				context,
				node,
				modules,
				declarationType,
				includeExports,
				allowSeparateTypeImports,
			);
			const currentNode = { node, declarationType };
			let nodes = [currentNode];

			if (modules.has(module)) {
				const previousNodes = modules.get(module);

				nodes = [...previousNodes, currentNode];
			}
			modules.set(module, nodes);
		}
	};
}

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		defaultOptions: [
			{
				includeExports: false,
				allowSeparateTypeImports: false,
			},
		],

		docs: {
			description: "Disallow duplicate module imports",
			dialects: ["JavaScript", "TypeScript"],
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-duplicate-imports",
		},

		schema: [
			{
				type: "object",
				properties: {
					includeExports: {
						type: "boolean",
					},
					allowSeparateTypeImports: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			import: "'{{module}}' import is duplicated.",
			importAs: "'{{module}}' import is duplicated as export.",
			export: "'{{module}}' export is duplicated.",
			exportAs: "'{{module}}' export is duplicated as import.",
		},
	},

	create(context) {
		const [{ includeExports, allowSeparateTypeImports }] = context.options;
		const modules = new Map();
		const handlers = {
			ImportDeclaration: handleImportsExports(
				context,
				modules,
				"import",
				includeExports,
				allowSeparateTypeImports,
			),
		};

		if (includeExports) {
			handlers.ExportNamedDeclaration = handleImportsExports(
				context,
				modules,
				"export",
				includeExports,
				allowSeparateTypeImports,
			);
			handlers.ExportAllDeclaration = handleImportsExports(
				context,
				modules,
				"export",
				includeExports,
				allowSeparateTypeImports,
			);
		}
		return handlers;
	},
};
h0x%5/**
 * @fileoverview Rule to flag `else` after a `return` in `if`
 * @author Ian Christian Myers
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");
const FixTracker = require("./utils/fix-tracker");

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @typedef {import("eslint-scope").Scope} Scope */

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [{ allowElseIf: true }],

		docs: {
			description:
				"Disallow `else` blocks after `return` statements in `if` statements",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/no-else-return",
		},

		schema: [
			{
				type: "object",
				properties: {
					allowElseIf: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		fixable: "code",

		messages: {
			unexpected: "Unnecessary 'else' after 'return'.",
		},
	},

	create(context) {
		const [{ allowElseIf }] = context.options;
		const sourceCode = context.sourceCode;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Checks whether the given names can be safely used to declare block-scoped variables
		 * in the given scope. Name collisions can produce redeclaration syntax errors,
		 * or silently change references and modify behavior of the original code.
		 *
		 * This is not a generic function. In particular, it is assumed that the scope is a function scope or
		 * a function's inner scope, and that the names can be valid identifiers in the given scope.
		 * @param {string[]} names Array of variable names.
		 * @param {Scope} scope Function scope or a function's inner scope.
		 * @returns {boolean} True if all names can be safely declared, false otherwise.
		 */
		function isSafeToDeclare(names, scope) {
			if (names.length === 0) {
				return true;
			}

			const functionScope = scope.variableScope;

			/*
			 * If this is a function scope, scope.variables will contain parameters, implicit variables such as "arguments",
			 * all function-scoped variables ('var'), and block-scoped variables defined in the scope.
			 * If this is an inner scope, scope.variables will contain block-scoped variables defined in the scope.
			 *
			 * Redeclaring any of these would cause a syntax error, except for the implicit variables.
			 */
			const declaredVariables = scope.variables.filter(
				({ defs }) => defs.length > 0,
			);

			if (declaredVariables.some(({ name }) => names.includes(name))) {
				return false;
			}

			// Redeclaring a catch variable would also cause a syntax error.
			if (scope !== functionScope && scope.upper.type === "catch") {
				if (
					scope.upper.variables.some(({ name }) =>
						names.includes(name),
					)
				) {
					return false;
				}
			}

			/*
			 * Redeclaring an implicit variable, such as "arguments", would not cause a syntax error.
			 * However, if the variable was used, declaring a new one with the same name would change references
			 * and modify behavior.
			 */
			const usedImplicitVariables = scope.variables.filter(
				({ defs, references }) =>
					defs.length === 0 && references.length > 0,
			);

			if (
				usedImplicitVariables.some(({ name }) => names.includes(name))
			) {
				return false;
			}

			/*
			 * Declaring a variable with a name that was already used to reference a variable from an upper scope
			 * would change references and modify behavior.
			 */
			if (scope.through.some(t => names.includes(t.identifier.name))) {
				return false;
			}

			/*
			 * If the scope is an inner scope (not the function scope), an uninitialized `var` variable declared inside
			 * the scope node (directly or in one of its descendants) is neither declared nor 'through' in the scope.
			 *
			 * For example, this would be a syntax error "Identifier 'a' has already been declared":
			 * function foo() { if (bar) { let a; if (baz) { var a; } } }
			 */
			if (scope !== functionScope) {
				const scopeNodeRange = scope.block.range;
				const variablesToCheck = functionScope.variables.filter(
					({ name }) => names.includes(name),
				);

				if (
					variablesToCheck.some(v =>
						v.defs.some(
							({ node: { range } }) =>
								scopeNodeRange[0] <= range[0] &&
								range[1] <= scopeNodeRange[1],
						),
					)
				) {
					return false;
				}
			}

			return true;
		}

		/**
		 * Checks whether the removal of `else` and its braces is safe from variable name collisions.
		 * @param {Node} node The 'else' node.
		 * @param {Scope} scope The scope in which the node and the whole 'if' statement is.
		 * @returns {boolean} True if it is safe, false otherwise.
		 */
		function isSafeFromNameCollisions(node, scope) {
			if (node.type === "FunctionDeclaration") {
				// Conditional function declaration. Scope and hoisting are unpredictable, different engines work differently.
				return false;
			}

			if (node.type !== "BlockStatement") {
				return true;
			}

			const elseBlockScope = scope.childScopes.find(
				({ block }) => block === node,
			);

			if (!elseBlockScope) {
				// ecmaVersion < 6, `else` block statement cannot have its own scope, no possible collisions.
				return true;
			}

			/*
			 * elseBlockScope is supposed to merge into its upper scope. elseBlockScope.variables array contains
			 * only block-scoped variables (such as let and const variables or class and function declarations)
			 * defined directly in the elseBlockScope. These are exactly the only names that could cause collisions.
			 */
			const namesToCheck = elseBlockScope.variables.map(
				({ name }) => name,
			);

			return isSafeToDeclare(namesToCheck, scope);
		}

		/**
		 * Display the context report if rule is violated
		 * @param {Node} elseNode The 'else' node
		 * @returns {void}
		 */
		function displayReport(elseNode) {
			const currentScope = sourceCode.getScope(elseNode.parent);

			context.report({
				node: elseNode,
				messageId: "unexpected",
				fix(fixer) {
					if (!isSafeFromNameCollisions(elseNode, currentScope)) {
						return null;
					}

					const startToken = sourceCode.getFirstToken(elseNode);
					const elseToken = sourceCode.getTokenBefore(startToken);
					const source = sourceCode.getText(elseNode);
					const lastIfToken = sourceCode.getTokenBefore(elseToken);
					let fixedSource, firstTokenOfElseBlock;

					if (
						startToken.type === "Punctuator" &&
						startToken.value === "{"
					) {
						firstTokenOfElseBlock =
							sourceCode.getTokenAfter(startToken);
					} else {
						firstTokenOfElseBlock = startToken;
					}

					/*
					 * If the if block does not have curly braces and does not end in a semicolon
					 * and the else block starts with (, [, /, +, ` or -, then it is not
					 * safe to remove the else keyword, because ASI will not add a semicolon
					 * after the if block
					 */
					const ifBlockMaybeUnsafe =
						elseNode.parent.consequent.type !== "BlockStatement" &&
						lastIfToken.value !== ";";
					const elseBlockUnsafe = /^[([/+`-]/u.test(
						firstTokenOfElseBlock.value,
					);

					if (ifBlockMaybeUnsafe && elseBlockUnsafe) {
						return null;
					}

					const endToken = sourceCode.getLastToken(elseNode);
					const lastTokenOfElseBlock =
						sourceCode.getTokenBefore(endToken);

					if (lastTokenOfElseBlock.value !== ";") {
						const nextToken = sourceCode.getTokenAfter(endToken);

						const nextTokenUnsafe =
							nextToken && /^[([/+`-]/u.test(nextToken.value);
						const nextTokenOnSameLine =
							nextToken &&
							nextToken.loc.start.line ===
								lastTokenOfElseBlock.loc.start.line;

						/*
						 * If the else block contents does not end in a semicolon,
						 * and the else block starts with (, [, /, +, ` or -, then it is not
						 * safe to remove the else block, because ASI will not add a semicolon
						 * after the remaining else block contents
						 */
						if (
							nextTokenUnsafe ||
							(nextTokenOnSameLine && nextToken.value !== "}")
						) {
							return null;
						}
					}

					if (
						startToken.type === "Punctuator" &&
						startToken.value === "{"
					) {
						fixedSource = source.slice(1, -1);
					} else {
						fixedSource = source;
					}

					/*
					 * Extend the replacement range to include the entire
					 * function to avoid conflicting with no-useless-return.
					 * https://github.com/eslint/eslint/issues/8026
					 *
					 * Also, to avoid name collisions between two else blocks.
					 */
					return new FixTracker(fixer, sourceCode)
						.retainEnclosingFunction(elseNode)
						.replaceTextRange(
							[elseToken.range[0], elseNode.range[1]],
							fixedSource,
						);
				},
			});
		}

		/**
		 * Check to see if the node is a ReturnStatement
		 * @param {Node} node The node being evaluated
		 * @returns {boolean} True if node is a return
		 */
		function checkForReturn(node) {
			return node.type === "ReturnStatement";
		}

		/**
		 * Naive return checking, does not iterate through the whole
		 * BlockStatement because we make the assumption that the ReturnStatement
		 * will be the last node in the body of the BlockStatement.
		 * @param {Node} node The consequent/alternate node
		 * @returns {boolean} True if it has a return
		 */
		function naiveHasReturn(node) {
			if (node.type === "BlockStatement") {
				const body = node.body,
					lastChildNode = body.at(-1);

				return lastChildNode && checkForReturn(lastChildNode);
			}
			return checkForReturn(node);
		}

		/**
		 * Check to see if the node is valid for evaluation,
		 * meaning it has an else.
		 * @param {Node} node The node being evaluated
		 * @returns {boolean} True if the node is valid
		 */
		function hasElse(node) {
			return node.alternate && node.consequent;
		}

		/**
		 * If the consequent is an IfStatement, check to see if it has an else
		 * and both its consequent and alternate path return, meaning this is
		 * a nested case of rule violation.  If-Else not considered currently.
		 * @param {Node} node The consequent node
		 * @returns {boolean} True if this is a nested rule violation
		 */
		function checkForIf(node) {
			return (
				node.type === "IfStatement" &&
				hasElse(node) &&
				naiveHasReturn(node.alternate) &&
				naiveHasReturn(node.consequent)
			);
		}

		/**
		 * Check the consequent/body node to make sure it is not
		 * a ReturnStatement or an IfStatement that returns on both
		 * code paths.
		 * @param {Node} node The consequent or body node
		 * @returns {boolean} `true` if it is a Return/If node that always returns.
		 */
		function checkForReturnOrIf(node) {
			return checkForReturn(node) || checkForIf(node);
		}

		/**
		 * Check whether a node returns in every codepath.
		 * @param {Node} node The node to be checked
		 * @returns {boolean} `true` if it returns on every codepath.
		 */
		function alwaysReturns(node) {
			if (node.type === "BlockStatement") {
				// If we have a BlockStatement, check each consequent body node.
				return node.body.some(checkForReturnOrIf);
			}

			/*
			 * If not a block statement, make sure the consequent isn't a
			 * ReturnStatement or an IfStatement with returns on both paths.
			 */
			return checkForReturnOrIf(node);
		}

		/**
		 * Check the if statement, but don't catch else-if blocks.
		 * @returns {void}
		 * @param {Node} node The node for the if statement to check
		 * @private
		 */
		function checkIfWithoutElse(node) {
			const parent = node.parent;

			/*
			 * Fixing this would require splitting one statement into two, so no error should
			 * be reported if this node is in a position where only one statement is allowed.
			 */
			if (!astUtils.STATEMENT_LIST_PARENTS.has(parent.type)) {
				return;
			}

			const consequents = [];
			let alternate;

			for (
				let currentNode = node;
				currentNode.type === "IfStatement";
				currentNode = currentNode.alternate
			) {
				if (!currentNode.alternate) {
					return;
				}
				consequents.push(currentNode.consequent);
				alternate = currentNode.alternate;
			}

			if (consequents.every(alwaysReturns)) {
				displayReport(alternate);
			}
		}

		/**
		 * Check the if statement
		 * @returns {void}
		 * @param {Node} node The node for the if statement to check
		 * @private
		 */
		function checkIfWithElse(node) {
			const parent = node.parent;

			/*
			 * Fixing this would require splitting one statement into two, so no error should
			 * be reported if this node is in a position where only one statement is allowed.
			 */
			if (!astUtils.STATEMENT_LIST_PARENTS.has(parent.type)) {
				return;
			}

			const alternate = node.alternate;

			if (alternate && alwaysReturns(node.consequent)) {
				displayReport(alternate);
			}
		}

		//--------------------------------------------------------------------------
		// Public API
		//--------------------------------------------------------------------------

		return {
			"IfStatement:exit": allowElseIf
				? checkIfWithoutElse
				: checkIfWithElse,
		};
	},
};
yxm/**
 * @fileoverview Rule to flag the use of empty character classes in regular expressions
 * @author Ian Christian Myers
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const { RegExpParser, visitRegExpAST } = require("@eslint-community/regexpp");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const parser = new RegExpParser();
const QUICK_TEST_REGEX = /\[\]/u;

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description:
				"Disallow empty character classes in regular expressions",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-empty-character-class",
		},

		schema: [],

		messages: {
			unexpected: "Empty class.",
		},
	},

	create(context) {
		return {
			"Literal[regex]"(node) {
				const { pattern, flags } = node.regex;

				if (!QUICK_TEST_REGEX.test(pattern)) {
					return;
				}

				let regExpAST;

				try {
					regExpAST = parser.parsePattern(
						pattern,
						0,
						pattern.length,
						{
							unicode: flags.includes("u"),
							unicodeSets: flags.includes("v"),
						},
					);
				} catch {
					// Ignore regular expressions that regexpp cannot parse
					return;
				}

				visitRegExpAST(regExpAST, {
					onCharacterClassEnter(characterClass) {
						if (
							!characterClass.negate &&
							characterClass.elements.length === 0
						) {
							context.report({ node, messageId: "unexpected" });
						}
					},
				});
			},
		};
	},
};
xa/**
 * @fileoverview Rule to disallow empty functions.
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const ALLOW_OPTIONS = Object.freeze([
	"functions",
	"arrowFunctions",
	"generatorFunctions",
	"methods",
	"generatorMethods",
	"getters",
	"setters",
	"constructors",
	"asyncFunctions",
	"asyncMethods",
	"privateConstructors",
	"protectedConstructors",
	"decoratedFunctions",
	"overrideMethods",
]);

/**
 * Gets the kind of a given function node.
 * @param {ASTNode} node A function node to get. This is one of
 *      an ArrowFunctionExpression, a FunctionDeclaration, or a
 *      FunctionExpression.
 * @returns {string} The kind of the function. This is one of "functions",
 *      "arrowFunctions", "generatorFunctions", "asyncFunctions", "methods",
 *      "generatorMethods", "asyncMethods", "getters", "setters", and
 *      "constructors".
 */
function getKind(node) {
	const parent = node.parent;
	let kind;

	if (node.type === "ArrowFunctionExpression") {
		return "arrowFunctions";
	}

	// Detects main kind.
	if (parent.type === "Property") {
		if (parent.kind === "get") {
			return "getters";
		}
		if (parent.kind === "set") {
			return "setters";
		}
		kind = parent.method ? "methods" : "functions";
	} else if (parent.type === "MethodDefinition") {
		if (parent.kind === "get") {
			return "getters";
		}
		if (parent.kind === "set") {
			return "setters";
		}
		if (parent.kind === "constructor") {
			return "constructors";
		}
		kind = "methods";
	} else {
		kind = "functions";
	}

	// Detects prefix.
	let prefix;

	if (node.generator) {
		prefix = "generator";
	} else if (node.async) {
		prefix = "async";
	} else {
		return kind;
	}
	return prefix + kind[0].toUpperCase() + kind.slice(1);
}

/**
 * Checks if a constructor function has parameter properties.
 * @param {ASTNode} node The function node to examine.
 * @returns {boolean} True if the constructor has parameter properties, false otherwise.
 */
function isParameterPropertiesConstructor(node) {
	return node.params.some(param => param.type === "TSParameterProperty");
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		hasSuggestions: true,
		type: "suggestion",

		defaultOptions: [{ allow: [] }],

		docs: {
			description: "Disallow empty functions",
			dialects: ["JavaScript", "TypeScript"],
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-empty-function",
		},

		schema: [
			{
				type: "object",
				properties: {
					allow: {
						type: "array",
						items: { enum: ALLOW_OPTIONS },
						uniqueItems: true,
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			unexpected: "Unexpected empty {{name}}.",
			suggestComment: "Add comment inside empty {{name}}.",
		},
	},

	create(context) {
		const [{ allow }] = context.options;
		const sourceCode = context.sourceCode;

		/**
		 * Checks if the given function node is allowed to be empty.
		 * @param {ASTNode} node The function node to check.
		 * @returns {boolean} True if the function is allowed to be empty, false otherwise.
		 */
		function isAllowedEmptyFunction(node) {
			const kind = getKind(node);

			if (allow.includes(kind)) {
				return true;
			}

			if (kind === "constructors") {
				if (
					(node.parent.accessibility === "private" &&
						allow.includes("privateConstructors")) ||
					(node.parent.accessibility === "protected" &&
						allow.includes("protectedConstructors")) ||
					isParameterPropertiesConstructor(node)
				) {
					return true;
				}
			}

			if (/(?:g|s)etters|methods$/iu.test(kind)) {
				if (
					(node.parent.decorators?.length &&
						allow.includes("decoratedFunctions")) ||
					(node.parent.override && allow.includes("overrideMethods"))
				) {
					return true;
				}
			}

			return false;
		}

		/**
		 * Reports a given function node if the node matches the following patterns.
		 *
		 * - Not allowed by options.
		 * - The body is empty.
		 * - The body doesn't have any comments.
		 * @param {ASTNode} node A function node to report. This is one of
		 *      an ArrowFunctionExpression, a FunctionDeclaration, or a
		 *      FunctionExpression.
		 * @returns {void}
		 */
		function reportIfEmpty(node) {
			const name = astUtils.getFunctionNameWithKind(node);
			const innerComments = sourceCode.getTokens(node.body, {
				includeComments: true,
				filter: astUtils.isCommentToken,
			});

			if (
				!isAllowedEmptyFunction(node) &&
				node.body.type === "BlockStatement" &&
				node.body.body.length === 0 &&
				innerComments.length === 0
			) {
				context.report({
					node,
					loc: node.body.loc,
					messageId: "unexpected",
					data: { name },
					suggest: [
						{
							messageId: "suggestComment",
							data: { name },
							fix(fixer) {
								const range = [
									node.body.range[0] + 1,
									node.body.range[1] - 1,
								];

								return fixer.replaceTextRange(
									range,
									" /* empty */ ",
								);
							},
						},
					],
				});
			}
		}

		return {
			ArrowFunctionExpression: reportIfEmpty,
			FunctionDeclaration: reportIfEmpty,
			FunctionExpression: reportIfEmpty,
		};
	},
};
asx1/**
 * @fileoverview Rule to disallow an empty pattern
 * @author Alberto Rodríguez
 */
"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		defaultOptions: [
			{
				allowObjectPatternsAsParameters: false,
			},
		],

		docs: {
			description: "Disallow empty destructuring patterns",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-empty-pattern",
		},

		schema: [
			{
				type: "object",
				properties: {
					allowObjectPatternsAsParameters: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			unexpected: "Unexpected empty {{type}} pattern.",
		},
	},

	create(context) {
		const [{ allowObjectPatternsAsParameters }] = context.options;

		return {
			ObjectPattern(node) {
				if (node.properties.length > 0) {
					return;
				}

				// Allow {} and {} = {} empty object patterns as parameters when allowObjectPatternsAsParameters is true
				if (
					allowObjectPatternsAsParameters &&
					(astUtils.isFunction(node.parent) ||
						(node.parent.type === "AssignmentPattern" &&
							astUtils.isFunction(node.parent.parent) &&
							node.parent.right.type === "ObjectExpression" &&
							node.parent.right.properties.length === 0))
				) {
					return;
				}

				context.report({
					node,
					messageId: "unexpected",
					data: { type: "object" },
				});
			},
			ArrayPattern(node) {
				if (node.elements.length === 0) {
					context.report({
						node,
						messageId: "unexpected",
						data: { type: "array" },
					});
				}
			},
		};
	},
};
{Xcx5/**
 * @fileoverview Rule to disallow empty static blocks.
 * @author Sosuke Suzuki
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		hasSuggestions: true,
		type: "suggestion",

		docs: {
			description: "Disallow empty static blocks",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-empty-static-block",
		},

		schema: [],

		messages: {
			unexpected: "Unexpected empty static block.",
			suggestComment: "Add comment inside empty static block.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		return {
			StaticBlock(node) {
				if (node.body.length === 0) {
					const openingBrace = sourceCode.getFirstToken(node, {
						skip: 1,
					});
					const closingBrace = sourceCode.getLastToken(node);

					if (
						sourceCode.getCommentsBefore(closingBrace).length === 0
					) {
						context.report({
							loc: {
								start: openingBrace.loc.start,
								end: closingBrace.loc.end,
							},
							messageId: "unexpected",
							suggest: [
								{
									messageId: "suggestComment",
									fix(fixer) {
										const range = [
											openingBrace.range[1],
											closingBrace.range[0],
										];

										return fixer.replaceTextRange(
											range,
											" /* empty */ ",
										);
									},
								},
							],
						});
					}
				}
			},
		};
	},
};
[BJx}/**
 * @fileoverview Rule to flag use of an empty block statement
 * @author Nicholas C. Zakas
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		hasSuggestions: true,
		type: "suggestion",

		defaultOptions: [
			{
				allowEmptyCatch: false,
			},
		],

		docs: {
			description: "Disallow empty block statements",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-empty",
		},

		schema: [
			{
				type: "object",
				properties: {
					allowEmptyCatch: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			unexpected: "Empty {{type}} statement.",
			suggestComment: "Add comment inside empty {{type}} statement.",
		},
	},

	create(context) {
		const [{ allowEmptyCatch }] = context.options;
		const sourceCode = context.sourceCode;

		return {
			BlockStatement(node) {
				// if the body is not empty, we can just return immediately
				if (node.body.length !== 0) {
					return;
				}

				// a function is generally allowed to be empty
				if (astUtils.isFunction(node.parent)) {
					return;
				}

				if (allowEmptyCatch && node.parent.type === "CatchClause") {
					return;
				}

				// any other block is only allowed to be empty, if it contains a comment
				if (sourceCode.getCommentsInside(node).length > 0) {
					return;
				}

				context.report({
					node,
					messageId: "unexpected",
					data: { type: "block" },
					suggest: [
						{
							messageId: "suggestComment",
							data: { type: "block" },
							fix(fixer) {
								const range = [
									node.range[0] + 1,
									node.range[1] - 1,
								];

								return fixer.replaceTextRange(
									range,
									" /* empty */ ",
								);
							},
						},
					],
				});
			},

			SwitchStatement(node) {
				if (
					typeof node.cases === "undefined" ||
					node.cases.length === 0
				) {
					const openingBrace = sourceCode.getTokenAfter(
						node.discriminant,
						astUtils.isOpeningBraceToken,
					);

					const closingBrace = sourceCode.getLastToken(node);

					if (
						sourceCode.commentsExistBetween(
							openingBrace,
							closingBrace,
						)
					) {
						return;
					}

					context.report({
						node,
						loc: {
							start: openingBrace.loc.start,
							end: closingBrace.loc.end,
						},
						messageId: "unexpected",
						data: { type: "switch" },
						suggest: [
							{
								messageId: "suggestComment",
								data: { type: "switch" },
								fix(fixer) {
									const range = [
										openingBrace.range[1],
										closingBrace.range[0],
									];

									return fixer.replaceTextRange(
										range,
										" /* empty */ ",
									);
								},
							},
						],
					});
				}
			},
		};
	},
};
OEx]/**
 * @fileoverview Rule to flag comparisons to null without a type-checking
 * operator.
 * @author Ian Christian Myers
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Disallow `null` comparisons without type-checking operators",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-eq-null",
		},

		schema: [],

		messages: {
			unexpected: "Use '===' to compare with null.",
		},
	},

	create(context) {
		return {
			BinaryExpression(node) {
				const badOperator =
					node.operator === "==" || node.operator === "!=";

				if (
					(node.right.type === "Literal" &&
						node.right.raw === "null" &&
						badOperator) ||
					(node.left.type === "Literal" &&
						node.left.raw === "null" &&
						badOperator)
				) {
					context.report({ node, messageId: "unexpected" });
				}
			},
		};
	},
};
c:x@/**
 * @fileoverview Rule to flag use of eval() statement
 * @author Nicholas C. Zakas
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @typedef {import("eslint-scope").Scope} Scope */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const candidatesOfGlobalObject = Object.freeze([
	"global",
	"window",
	"globalThis",
]);

/**
 * Checks a given node is a MemberExpression node which has the specified name's
 * property.
 * @param {ASTNode} node A node to check.
 * @param {string} name A name to check.
 * @returns {boolean} `true` if the node is a MemberExpression node which has
 *      the specified name's property
 */
function isMember(node, name) {
	return astUtils.isSpecificMemberAccess(node, null, name);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				allowIndirect: false,
			},
		],

		docs: {
			description: "Disallow the use of `eval()`",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-eval",
		},

		schema: [
			{
				type: "object",
				properties: {
					allowIndirect: { type: "boolean" },
				},
				additionalProperties: false,
			},
		],

		messages: {
			unexpected: "`eval` can be harmful.",
		},
	},

	create(context) {
		const [{ allowIndirect }] = context.options;
		const sourceCode = context.sourceCode;
		let funcInfo = null;

		/**
		 * Pushes a `this` scope (non-arrow function, class static block, or class field initializer) information to the stack.
		 * Top-level scopes are handled separately.
		 *
		 * This is used in order to check whether or not `this` binding is a
		 * reference to the global object.
		 * @param {ASTNode} node A node of the scope.
		 *      For functions, this is one of FunctionDeclaration, FunctionExpression.
		 *      For class static blocks, this is StaticBlock.
		 *      For class field initializers, this can be any node that is PropertyDefinition#value.
		 * @returns {void}
		 */
		function enterThisScope(node) {
			const strict = sourceCode.getScope(node).isStrict;

			funcInfo = {
				upper: funcInfo,
				node,
				strict,
				isTopLevelOfScript: false,
				defaultThis: false,
				initialized: strict,
			};
		}

		/**
		 * Pops a variable scope from the stack.
		 * @returns {void}
		 */
		function exitThisScope() {
			funcInfo = funcInfo.upper;
		}

		/**
		 * Reports a given node.
		 *
		 * `node` is `Identifier` or `MemberExpression`.
		 * The parent of `node` might be `CallExpression`.
		 *
		 * The location of the report is always `eval` `Identifier` (or possibly
		 * `Literal`). The type of the report is `CallExpression` if the parent is
		 * `CallExpression`. Otherwise, it's the given node type.
		 * @param {ASTNode} node A node to report.
		 * @returns {void}
		 */
		function report(node) {
			const parent = node.parent;
			const locationNode =
				node.type === "MemberExpression" ? node.property : node;

			const reportNode =
				parent.type === "CallExpression" && parent.callee === node
					? parent
					: node;

			context.report({
				node: reportNode,
				loc: locationNode.loc,
				messageId: "unexpected",
			});
		}

		/**
		 * Reports accesses of `eval` via the global object.
		 * @param {Scope} globalScope The global scope.
		 * @returns {void}
		 */
		function reportAccessingEvalViaGlobalObject(globalScope) {
			for (let i = 0; i < candidatesOfGlobalObject.length; ++i) {
				const name = candidatesOfGlobalObject[i];
				const variable = astUtils.getVariableByName(globalScope, name);

				if (!variable) {
					continue;
				}

				const references = variable.references;

				for (let j = 0; j < references.length; ++j) {
					const identifier = references[j].identifier;
					let node = identifier.parent;

					// To detect code like `window.window.eval`.
					while (isMember(node, name)) {
						node = node.parent;
					}

					// Reports.
					if (isMember(node, "eval")) {
						report(node);
					}
				}
			}
		}

		/**
		 * Reports all accesses of `eval` (excludes direct calls to eval).
		 * @param {Scope} globalScope The global scope.
		 * @returns {void}
		 */
		function reportAccessingEval(globalScope) {
			const variable = astUtils.getVariableByName(globalScope, "eval");

			if (!variable) {
				return;
			}

			const references = variable.references;

			for (let i = 0; i < references.length; ++i) {
				const reference = references[i];
				const id = reference.identifier;

				if (id.name === "eval" && !astUtils.isCallee(id)) {
					// Is accessing to eval (excludes direct calls to eval)
					report(id);
				}
			}
		}

		if (allowIndirect) {
			// Checks only direct calls to eval. It's simple!
			return {
				"CallExpression:exit"(node) {
					const callee = node.callee;

					/*
					 * Optional call (`eval?.("code")`) is not direct eval.
					 * The direct eval is only step 6.a.vi of https://tc39.es/ecma262/#sec-function-calls-runtime-semantics-evaluation
					 * But the optional call is https://tc39.es/ecma262/#sec-optional-chaining-chain-evaluation
					 */
					if (
						!node.optional &&
						astUtils.isSpecificId(callee, "eval")
					) {
						report(callee);
					}
				},
			};
		}

		return {
			"CallExpression:exit"(node) {
				const callee = node.callee;

				if (astUtils.isSpecificId(callee, "eval")) {
					report(callee);
				}
			},

			Program(node) {
				const scope = sourceCode.getScope(node),
					features =
						context.languageOptions.parserOptions.ecmaFeatures ||
						{},
					strict =
						scope.isStrict ||
						node.sourceType === "module" ||
						(features.globalReturn &&
							scope.childScopes[0].isStrict),
					isTopLevelOfScript =
						node.sourceType !== "module" && !features.globalReturn;

				funcInfo = {
					upper: null,
					node,
					strict,
					isTopLevelOfScript,
					defaultThis: true,
					initialized: true,
				};
			},

			"Program:exit"(node) {
				const globalScope = sourceCode.getScope(node);

				exitThisScope();
				reportAccessingEval(globalScope);
				reportAccessingEvalViaGlobalObject(globalScope);
			},

			FunctionDeclaration: enterThisScope,
			"FunctionDeclaration:exit": exitThisScope,
			FunctionExpression: enterThisScope,
			"FunctionExpression:exit": exitThisScope,
			"PropertyDefinition > *.value": enterThisScope,
			"PropertyDefinition > *.value:exit": exitThisScope,
			StaticBlock: enterThisScope,
			"StaticBlock:exit": exitThisScope,

			ThisExpression(node) {
				if (!isMember(node.parent, "eval")) {
					return;
				}

				/*
				 * `this.eval` is found.
				 * Checks whether or not the value of `this` is the global object.
				 */
				if (!funcInfo.initialized) {
					funcInfo.initialized = true;
					funcInfo.defaultThis = astUtils.isDefaultThisBinding(
						funcInfo.node,
						sourceCode,
					);
				}

				// `this` at the top level of scripts always refers to the global object
				if (
					funcInfo.isTopLevelOfScript ||
					(!funcInfo.strict && funcInfo.defaultThis)
				) {
					// `this.eval` is possible built-in `eval`.
					report(node.parent);
				}
			},
		};
	},
};
{]Yx
ZRule to flag assignment of the exception parameter
 * @author Stephen Murray <spmurrayzzz>kexceptions in `catch` clauseKexT05unexpected: "Do not assign to the exception parameterunexpected"!return {
			CatchClause(node) {
	zC	},
		};
	},
};
]Cxw/**
 * @fileoverview Rule to flag unnecessary bind calls
 * @author Bence Dányi <bence@danyi.me>
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const SIDE_EFFECT_FREE_NODE_TYPES = new Set([
	"Literal",
	"Identifier",
	"ThisExpression",
	"FunctionExpression",
]);

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow unnecessary calls to `.bind()`",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-extra-bind",
		},

		schema: [],
		fixable: "code",

		messages: {
			unexpected: "The function binding is unnecessary.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		let scopeInfo = null;

		/**
		 * Checks if a node is free of side effects.
		 *
		 * This check is stricter than it needs to be, in order to keep the implementation simple.
		 * @param {ASTNode} node A node to check.
		 * @returns {boolean} True if the node is known to be side-effect free, false otherwise.
		 */
		function isSideEffectFree(node) {
			return SIDE_EFFECT_FREE_NODE_TYPES.has(node.type);
		}

		/**
		 * Reports a given function node.
		 * @param {ASTNode} node A node to report. This is a FunctionExpression or
		 *      an ArrowFunctionExpression.
		 * @returns {void}
		 */
		function report(node) {
			const memberNode = node.parent;
			const callNode =
				memberNode.parent.type === "ChainExpression"
					? memberNode.parent.parent
					: memberNode.parent;

			context.report({
				node: callNode,
				messageId: "unexpected",
				loc: memberNode.property.loc,

				fix(fixer) {
					if (!isSideEffectFree(callNode.arguments[0])) {
						return null;
					}

					/*
					 * The list of the first/last token pair of a removal range.
					 * This is two parts because closing parentheses may exist between the method name and arguments.
					 * E.g. `(function(){}.bind ) (obj)`
					 *                    ^^^^^   ^^^^^ < removal ranges
					 * E.g. `(function(){}?.['bind'] ) ?.(obj)`
					 *                    ^^^^^^^^^^   ^^^^^^^ < removal ranges
					 */
					const tokenPairs = [
						[
							// `.`, `?.`, or `[` token.
							sourceCode.getTokenAfter(
								memberNode.object,
								astUtils.isNotClosingParenToken,
							),

							// property name or `]` token.
							sourceCode.getLastToken(memberNode),
						],
						[
							// `?.` or `(` token of arguments.
							sourceCode.getTokenAfter(
								memberNode,
								astUtils.isNotClosingParenToken,
							),

							// `)` token of arguments.
							sourceCode.getLastToken(callNode),
						],
					];
					const firstTokenToRemove = tokenPairs[0][0];
					const lastTokenToRemove = tokenPairs[1][1];

					if (
						sourceCode.commentsExistBetween(
							firstTokenToRemove,
							lastTokenToRemove,
						)
					) {
						return null;
					}

					return tokenPairs.map(([start, end]) =>
						fixer.removeRange([start.range[0], end.range[1]]),
					);
				},
			});
		}

		/**
		 * Checks whether or not a given function node is the callee of `.bind()`
		 * method.
		 *
		 * e.g. `(function() {}.bind(foo))`
		 * @param {ASTNode} node A node to report. This is a FunctionExpression or
		 *      an ArrowFunctionExpression.
		 * @returns {boolean} `true` if the node is the callee of `.bind()` method.
		 */
		function isCalleeOfBindMethod(node) {
			if (!astUtils.isSpecificMemberAccess(node.parent, null, "bind")) {
				return false;
			}

			// The node of `*.bind` member access.
			const bindNode =
				node.parent.parent.type === "ChainExpression"
					? node.parent.parent
					: node.parent;

			return (
				bindNode.parent.type === "CallExpression" &&
				bindNode.parent.callee === bindNode &&
				bindNode.parent.arguments.length === 1 &&
				bindNode.parent.arguments[0].type !== "SpreadElement"
			);
		}

		/**
		 * Adds a scope information object to the stack.
		 * @param {ASTNode} node A node to add. This node is a FunctionExpression
		 *      or a FunctionDeclaration node.
		 * @returns {void}
		 */
		function enterFunction(node) {
			scopeInfo = {
				isBound: isCalleeOfBindMethod(node),
				thisFound: false,
				upper: scopeInfo,
			};
		}

		/**
		 * Removes the scope information object from the top of the stack.
		 * At the same time, this reports the function node if the function has
		 * `.bind()` and the `this` keywords found.
		 * @param {ASTNode} node A node to remove. This node is a
		 *      FunctionExpression or a FunctionDeclaration node.
		 * @returns {void}
		 */
		function exitFunction(node) {
			if (scopeInfo.isBound && !scopeInfo.thisFound) {
				report(node);
			}

			scopeInfo = scopeInfo.upper;
		}

		/**
		 * Reports a given arrow function if the function is callee of `.bind()`
		 * method.
		 * @param {ASTNode} node A node to report. This node is an
		 *      ArrowFunctionExpression.
		 * @returns {void}
		 */
		function exitArrowFunction(node) {
			if (isCalleeOfBindMethod(node)) {
				report(node);
			}
		}

		/**
		 * Set the mark as the `this` keyword was found in this scope.
		 * @returns {void}
		 */
		function markAsThisFound() {
			if (scopeInfo) {
				scopeInfo.thisFound = true;
			}
		}

		return {
			"ArrowFunctionExpression:exit": exitArrowFunction,
			FunctionDeclaration: enterFunction,
			"FunctionDeclaration:exit": exitFunction,
			FunctionExpression: enterFunction,
			"FunctionExpression:exit": exitFunction,
			ThisExpression: markAsThisFound,
		};
	},
};
:tx)=/**
 * @fileoverview Rule to flag unnecessary double negation in Boolean contexts
 * @author Brandon Mills
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");
const eslintUtils = require("@eslint-community/eslint-utils");

const precedence = astUtils.getPrecedence;

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [{}],

		docs: {
			description: "Disallow unnecessary boolean casts",
			recommended: true,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/no-extra-boolean-cast",
		},

		schema: [
			{
				anyOf: [
					{
						type: "object",
						properties: {
							enforceForInnerExpressions: {
								type: "boolean",
							},
						},
						additionalProperties: false,
					},

					// deprecated
					{
						type: "object",
						properties: {
							enforceForLogicalOperands: {
								type: "boolean",
							},
						},
						additionalProperties: false,
					},
				],
			},
		],
		fixable: "code",

		messages: {
			unexpectedCall: "Redundant Boolean call.",
			unexpectedNegation: "Redundant double negation.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const [{ enforceForLogicalOperands, enforceForInnerExpressions }] =
			context.options;

		// Node types which have a test which will coerce values to booleans.
		const BOOLEAN_NODE_TYPES = new Set([
			"IfStatement",
			"DoWhileStatement",
			"WhileStatement",
			"ConditionalExpression",
			"ForStatement",
		]);

		/**
		 * Check if a node is a Boolean function or constructor.
		 * @param {ASTNode} node the node
		 * @returns {boolean} If the node is Boolean function or constructor
		 */
		function isBooleanFunctionOrConstructorCall(node) {
			// Boolean(<bool>) and new Boolean(<bool>)
			return (
				(node.type === "CallExpression" ||
					node.type === "NewExpression") &&
				node.callee.type === "Identifier" &&
				node.callee.name === "Boolean" &&
				sourceCode.isGlobalReference(node.callee)
			);
		}

		/**
		 * Check if a node is in a context where its value would be coerced to a boolean at runtime.
		 * @param {ASTNode} node The node
		 * @returns {boolean} If it is in a boolean context
		 */
		function isInBooleanContext(node) {
			return (
				(isBooleanFunctionOrConstructorCall(node.parent) &&
					node === node.parent.arguments[0]) ||
				(BOOLEAN_NODE_TYPES.has(node.parent.type) &&
					node === node.parent.test) ||
				// !<bool>
				(node.parent.type === "UnaryExpression" &&
					node.parent.operator === "!")
			);
		}

		/**
		 * Checks whether the node is a context that should report an error
		 * Acts recursively if it is in a logical context
		 * @param {ASTNode} node the node
		 * @returns {boolean} If the node is in one of the flagged contexts
		 */
		function isInFlaggedContext(node) {
			if (node.parent.type === "ChainExpression") {
				return isInFlaggedContext(node.parent);
			}

			/*
			 * legacy behavior - enforceForLogicalOperands will only recurse on
			 * logical expressions, not on other contexts.
			 * enforceForInnerExpressions will recurse on logical expressions
			 * as well as the other recursive syntaxes.
			 */

			if (enforceForLogicalOperands || enforceForInnerExpressions) {
				if (node.parent.type === "LogicalExpression") {
					if (
						node.parent.operator === "||" ||
						node.parent.operator === "&&"
					) {
						return isInFlaggedContext(node.parent);
					}

					// Check the right hand side of a `??` operator.
					if (
						enforceForInnerExpressions &&
						node.parent.operator === "??" &&
						node.parent.right === node
					) {
						return isInFlaggedContext(node.parent);
					}
				}
			}

			if (enforceForInnerExpressions) {
				if (
					node.parent.type === "ConditionalExpression" &&
					(node.parent.consequent === node ||
						node.parent.alternate === node)
				) {
					return isInFlaggedContext(node.parent);
				}

				/*
				 * Check last expression only in a sequence, i.e. if ((1, 2, Boolean(3))) {}, since
				 * the others don't affect the result of the expression.
				 */
				if (
					node.parent.type === "SequenceExpression" &&
					node.parent.expressions.at(-1) === node
				) {
					return isInFlaggedContext(node.parent);
				}
			}

			return isInBooleanContext(node);
		}

		/**
		 * Check if a node has comments inside.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} `true` if it has comments inside.
		 */
		function hasCommentsInside(node) {
			return Boolean(sourceCode.getCommentsInside(node).length);
		}

		/**
		 * Checks if the given node is wrapped in grouping parentheses. Parentheses for constructs such as if() don't count.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} `true` if the node is parenthesized.
		 * @private
		 */
		function isParenthesized(node) {
			return eslintUtils.isParenthesized(1, node, sourceCode);
		}

		/**
		 * Determines whether the given node needs to be parenthesized when replacing the previous node.
		 * It assumes that `previousNode` is the node to be reported by this rule, so it has a limited list
		 * of possible parent node types. By the same assumption, the node's role in a particular parent is already known.
		 * @param {ASTNode} previousNode Previous node.
		 * @param {ASTNode} node The node to check.
		 * @throws {Error} (Unreachable.)
		 * @returns {boolean} `true` if the node needs to be parenthesized.
		 */
		function needsParens(previousNode, node) {
			if (previousNode.parent.type === "ChainExpression") {
				return needsParens(previousNode.parent, node);
			}

			if (isParenthesized(previousNode)) {
				// parentheses around the previous node will stay, so there is no need for an additional pair
				return false;
			}

			// parent of the previous node will become parent of the replacement node
			const parent = previousNode.parent;

			switch (parent.type) {
				case "CallExpression":
				case "NewExpression":
					return node.type === "SequenceExpression";
				case "IfStatement":
				case "DoWhileStatement":
				case "WhileStatement":
				case "ForStatement":
				case "SequenceExpression":
					return false;
				case "ConditionalExpression":
					if (previousNode === parent.test) {
						return precedence(node) <= precedence(parent);
					}
					if (
						previousNode === parent.consequent ||
						previousNode === parent.alternate
					) {
						return (
							precedence(node) <
							precedence({ type: "AssignmentExpression" })
						);
					}

					/* c8 ignore next */
					throw new Error(
						"Ternary child must be test, consequent, or alternate.",
					);
				case "UnaryExpression":
					return precedence(node) < precedence(parent);
				case "LogicalExpression":
					if (
						astUtils.isMixedLogicalAndCoalesceExpressions(
							node,
							parent,
						)
					) {
						return true;
					}
					if (previousNode === parent.left) {
						return precedence(node) < precedence(parent);
					}
					return precedence(node) <= precedence(parent);

				/* c8 ignore next */
				default:
					throw new Error(`Unexpected parent type: ${parent.type}`);
			}
		}

		return {
			UnaryExpression(node) {
				const parent = node.parent;

				// Exit early if it's guaranteed not to match
				if (
					node.operator !== "!" ||
					parent.type !== "UnaryExpression" ||
					parent.operator !== "!"
				) {
					return;
				}

				if (isInFlaggedContext(parent)) {
					context.report({
						node: parent,
						messageId: "unexpectedNegation",
						fix(fixer) {
							if (hasCommentsInside(parent)) {
								return null;
							}

							if (needsParens(parent, node.argument)) {
								return fixer.replaceText(
									parent,
									`(${sourceCode.getText(node.argument)})`,
								);
							}

							let prefix = "";
							const tokenBefore =
								sourceCode.getTokenBefore(parent);
							const firstReplacementToken =
								sourceCode.getFirstToken(node.argument);

							if (
								tokenBefore &&
								tokenBefore.range[1] === parent.range[0] &&
								!astUtils.canTokensBeAdjacent(
									tokenBefore,
									firstReplacementToken,
								)
							) {
								prefix = " ";
							}

							return fixer.replaceText(
								parent,
								prefix + sourceCode.getText(node.argument),
							);
						},
					});
				}
			},

			CallExpression(node) {
				if (
					node.callee.type !== "Identifier" ||
					node.callee.name !== "Boolean" ||
					!sourceCode.isGlobalReference(node.callee)
				) {
					return;
				}

				if (isInFlaggedContext(node)) {
					context.report({
						node,
						messageId: "unexpectedCall",
						fix(fixer) {
							const parent = node.parent;

							if (node.arguments.length === 0) {
								if (
									parent.type === "UnaryExpression" &&
									parent.operator === "!"
								) {
									/*
									 * !Boolean() -> true
									 */

									if (hasCommentsInside(parent)) {
										return null;
									}

									const replacement = "true";
									let prefix = "";
									const tokenBefore =
										sourceCode.getTokenBefore(parent);

									if (
										tokenBefore &&
										tokenBefore.range[1] ===
											parent.range[0] &&
										!astUtils.canTokensBeAdjacent(
											tokenBefore,
											replacement,
										)
									) {
										prefix = " ";
									}

									return fixer.replaceText(
										parent,
										prefix + replacement,
									);
								}

								/*
								 * Boolean() -> false
								 */

								if (hasCommentsInside(node)) {
									return null;
								}

								return fixer.replaceText(node, "false");
							}

							if (node.arguments.length === 1) {
								const argument = node.arguments[0];

								if (
									argument.type === "SpreadElement" ||
									hasCommentsInside(node)
								) {
									return null;
								}

								/*
								 * Boolean(expression) -> expression
								 */

								if (needsParens(node, argument)) {
									return fixer.replaceText(
										node,
										`(${sourceCode.getText(argument)})`,
									);
								}

								return fixer.replaceText(
									node,
									sourceCode.getText(argument),
								);
							}

							// two or more arguments
							return null;
						},
					});
				}
			},
		};
	},
};
b\xV/**
 * @fileoverview Rule to disallow unnecessary labels
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow unnecessary labels",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/no-extra-label",
		},

		schema: [],
		fixable: "code",

		messages: {
			unexpected: "This label '{{name}}' is unnecessary.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		let scopeInfo = null;

		/**
		 * Creates a new scope with a breakable statement.
		 * @param {ASTNode} node A node to create. This is a BreakableStatement.
		 * @returns {void}
		 */
		function enterBreakableStatement(node) {
			scopeInfo = {
				label:
					node.parent.type === "LabeledStatement"
						? node.parent.label
						: null,
				breakable: true,
				upper: scopeInfo,
			};
		}

		/**
		 * Removes the top scope of the stack.
		 * @returns {void}
		 */
		function exitBreakableStatement() {
			scopeInfo = scopeInfo.upper;
		}

		/**
		 * Creates a new scope with a labeled statement.
		 *
		 * This ignores it if the body is a breakable statement.
		 * In this case it's handled in the `enterBreakableStatement` function.
		 * @param {ASTNode} node A node to create. This is a LabeledStatement.
		 * @returns {void}
		 */
		function enterLabeledStatement(node) {
			if (!astUtils.isBreakableStatement(node.body)) {
				scopeInfo = {
					label: node.label,
					breakable: false,
					upper: scopeInfo,
				};
			}
		}

		/**
		 * Removes the top scope of the stack.
		 *
		 * This ignores it if the body is a breakable statement.
		 * In this case it's handled in the `exitBreakableStatement` function.
		 * @param {ASTNode} node A node. This is a LabeledStatement.
		 * @returns {void}
		 */
		function exitLabeledStatement(node) {
			if (!astUtils.isBreakableStatement(node.body)) {
				scopeInfo = scopeInfo.upper;
			}
		}

		/**
		 * Reports a given control node if it's unnecessary.
		 * @param {ASTNode} node A node. This is a BreakStatement or a
		 *      ContinueStatement.
		 * @returns {void}
		 */
		function reportIfUnnecessary(node) {
			if (!node.label) {
				return;
			}

			const labelNode = node.label;

			for (let info = scopeInfo; info !== null; info = info.upper) {
				if (
					info.breakable ||
					(info.label && info.label.name === labelNode.name)
				) {
					if (
						info.breakable &&
						info.label &&
						info.label.name === labelNode.name
					) {
						context.report({
							node: labelNode,
							messageId: "unexpected",
							data: labelNode,
							fix(fixer) {
								const breakOrContinueToken =
									sourceCode.getFirstToken(node);

								if (
									sourceCode.commentsExistBetween(
										breakOrContinueToken,
										labelNode,
									)
								) {
									return null;
								}

								return fixer.removeRange([
									breakOrContinueToken.range[1],
									labelNode.range[1],
								]);
							},
						});
					}
					return;
				}
			}
		}

		return {
			WhileStatement: enterBreakableStatement,
			"WhileStatement:exit": exitBreakableStatement,
			DoWhileStatement: enterBreakableStatement,
			"DoWhileStatement:exit": exitBreakableStatement,
			ForStatement: enterBreakableStatement,
			"ForStatement:exit": exitBreakableStatement,
			ForInStatement: enterBreakableStatement,
			"ForInStatement:exit": exitBreakableStatement,
			ForOfStatement: enterBreakableStatement,
			"ForOfStatement:exit": exitBreakableStatement,
			SwitchStatement: enterBreakableStatement,
			"SwitchStatement:exit": exitBreakableStatement,
			LabeledStatement: enterLabeledStatement,
			"LabeledStatement:exit": exitLabeledStatement,
			BreakStatement: reportIfUnnecessary,
			ContinueStatement: reportIfUnnecessary,
		};
	},
};
WexFU/**
 * @fileoverview Disallow parenthesising higher precedence subexpressions.
 * @author Michael Ficarra
 * @deprecated in ESLint v8.53.0
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

const {
	isParenthesized: isParenthesizedRaw,
} = require("@eslint-community/eslint-utils");
const astUtils = require("./utils/ast-utils.js");

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "no-extra-parens",
						url: "https://eslint.style/rules/no-extra-parens",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Disallow unnecessary parentheses",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-extra-parens",
		},

		fixable: "code",

		schema: {
			anyOf: [
				{
					type: "array",
					items: [
						{
							enum: ["functions"],
						},
					],
					minItems: 0,
					maxItems: 1,
				},
				{
					type: "array",
					items: [
						{
							enum: ["all"],
						},
						{
							type: "object",
							properties: {
								conditionalAssign: { type: "boolean" },
								ternaryOperandBinaryExpressions: {
									type: "boolean",
								},
								nestedBinaryExpressions: { type: "boolean" },
								returnAssign: { type: "boolean" },
								ignoreJSX: {
									enum: [
										"none",
										"all",
										"single-line",
										"multi-line",
									],
								},
								enforceForArrowConditionals: {
									type: "boolean",
								},
								enforceForSequenceExpressions: {
									type: "boolean",
								},
								enforceForNewInMemberExpressions: {
									type: "boolean",
								},
								enforceForFunctionPrototypeMethods: {
									type: "boolean",
								},
								allowParensAfterCommentPattern: {
									type: "string",
								},
							},
							additionalProperties: false,
						},
					],
					minItems: 0,
					maxItems: 2,
				},
			],
		},

		messages: {
			unexpected: "Unnecessary parentheses around expression.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		const tokensToIgnore = new WeakSet();
		const precedence = astUtils.getPrecedence;
		const ALL_NODES = context.options[0] !== "functions";
		const EXCEPT_COND_ASSIGN =
			ALL_NODES &&
			context.options[1] &&
			context.options[1].conditionalAssign === false;
		const EXCEPT_COND_TERNARY =
			ALL_NODES &&
			context.options[1] &&
			context.options[1].ternaryOperandBinaryExpressions === false;
		const NESTED_BINARY =
			ALL_NODES &&
			context.options[1] &&
			context.options[1].nestedBinaryExpressions === false;
		const EXCEPT_RETURN_ASSIGN =
			ALL_NODES &&
			context.options[1] &&
			context.options[1].returnAssign === false;
		const IGNORE_JSX =
			ALL_NODES && context.options[1] && context.options[1].ignoreJSX;
		const IGNORE_ARROW_CONDITIONALS =
			ALL_NODES &&
			context.options[1] &&
			context.options[1].enforceForArrowConditionals === false;
		const IGNORE_SEQUENCE_EXPRESSIONS =
			ALL_NODES &&
			context.options[1] &&
			context.options[1].enforceForSequenceExpressions === false;
		const IGNORE_NEW_IN_MEMBER_EXPR =
			ALL_NODES &&
			context.options[1] &&
			context.options[1].enforceForNewInMemberExpressions === false;
		const IGNORE_FUNCTION_PROTOTYPE_METHODS =
			ALL_NODES &&
			context.options[1] &&
			context.options[1].enforceForFunctionPrototypeMethods === false;
		const ALLOW_PARENS_AFTER_COMMENT_PATTERN =
			ALL_NODES &&
			context.options[1] &&
			context.options[1].allowParensAfterCommentPattern;

		const PRECEDENCE_OF_ASSIGNMENT_EXPR = precedence({
			type: "AssignmentExpression",
		});
		const PRECEDENCE_OF_UPDATE_EXPR = precedence({
			type: "UpdateExpression",
		});

		let reportsBuffer;

		/**
		 * Determines whether the given node is a `call` or `apply` method call, invoked directly on a `FunctionExpression` node.
		 * Example: function(){}.call()
		 * @param {ASTNode} node The node to be checked.
		 * @returns {boolean} True if the node is an immediate `call` or `apply` method call.
		 * @private
		 */
		function isImmediateFunctionPrototypeMethodCall(node) {
			const callNode = astUtils.skipChainExpression(node);

			if (callNode.type !== "CallExpression") {
				return false;
			}
			const callee = astUtils.skipChainExpression(callNode.callee);

			return (
				callee.type === "MemberExpression" &&
				callee.object.type === "FunctionExpression" &&
				["call", "apply"].includes(
					astUtils.getStaticPropertyName(callee),
				)
			);
		}

		/**
		 * Determines if this rule should be enforced for a node given the current configuration.
		 * @param {ASTNode} node The node to be checked.
		 * @returns {boolean} True if the rule should be enforced for this node.
		 * @private
		 */
		function ruleApplies(node) {
			if (node.type === "JSXElement" || node.type === "JSXFragment") {
				const isSingleLine = node.loc.start.line === node.loc.end.line;

				switch (IGNORE_JSX) {
					// Exclude this JSX element from linting
					case "all":
						return false;

					// Exclude this JSX element if it is multi-line element
					case "multi-line":
						return isSingleLine;

					// Exclude this JSX element if it is single-line element
					case "single-line":
						return !isSingleLine;

					// Nothing special to be done for JSX elements
					case "none":
						break;

					// no default
				}
			}

			if (
				node.type === "SequenceExpression" &&
				IGNORE_SEQUENCE_EXPRESSIONS
			) {
				return false;
			}

			if (
				isImmediateFunctionPrototypeMethodCall(node) &&
				IGNORE_FUNCTION_PROTOTYPE_METHODS
			) {
				return false;
			}

			return (
				ALL_NODES ||
				node.type === "FunctionExpression" ||
				node.type === "ArrowFunctionExpression"
			);
		}

		/**
		 * Determines if a node is surrounded by parentheses.
		 * @param {ASTNode} node The node to be checked.
		 * @returns {boolean} True if the node is parenthesised.
		 * @private
		 */
		function isParenthesised(node) {
			return isParenthesizedRaw(1, node, sourceCode);
		}

		/**
		 * Determines if a node is surrounded by parentheses twice.
		 * @param {ASTNode} node The node to be checked.
		 * @returns {boolean} True if the node is doubly parenthesised.
		 * @private
		 */
		function isParenthesisedTwice(node) {
			return isParenthesizedRaw(2, node, sourceCode);
		}

		/**
		 * Determines if a node is surrounded by (potentially) invalid parentheses.
		 * @param {ASTNode} node The node to be checked.
		 * @returns {boolean} True if the node is incorrectly parenthesised.
		 * @private
		 */
		function hasExcessParens(node) {
			return ruleApplies(node) && isParenthesised(node);
		}

		/**
		 * Determines if a node that is expected to be parenthesised is surrounded by
		 * (potentially) invalid extra parentheses.
		 * @param {ASTNode} node The node to be checked.
		 * @returns {boolean} True if the node is has an unexpected extra pair of parentheses.
		 * @private
		 */
		function hasDoubleExcessParens(node) {
			return ruleApplies(node) && isParenthesisedTwice(node);
		}

		/**
		 * Determines if a node that is expected to be parenthesised is surrounded by
		 * (potentially) invalid extra parentheses with considering precedence level of the node.
		 * If the preference level of the node is not higher or equal to precedence lower limit, it also checks
		 * whether the node is surrounded by parentheses twice or not.
		 * @param {ASTNode} node The node to be checked.
		 * @param {number} precedenceLowerLimit The lower limit of precedence.
		 * @returns {boolean} True if the node is has an unexpected extra pair of parentheses.
		 * @private
		 */
		function hasExcessParensWithPrecedence(node, precedenceLowerLimit) {
			if (ruleApplies(node) && isParenthesised(node)) {
				if (
					precedence(node) >= precedenceLowerLimit ||
					isParenthesisedTwice(node)
				) {
					return true;
				}
			}
			return false;
		}

		/**
		 * Determines if a node test expression is allowed to have a parenthesised assignment
		 * @param {ASTNode} node The node to be checked.
		 * @returns {boolean} True if the assignment can be parenthesised.
		 * @private
		 */
		function isCondAssignException(node) {
			return (
				EXCEPT_COND_ASSIGN && node.test.type === "AssignmentExpression"
			);
		}

		/**
		 * Determines if a node is in a return statement
		 * @param {ASTNode} node The node to be checked.
		 * @returns {boolean} True if the node is in a return statement.
		 * @private
		 */
		function isInReturnStatement(node) {
			for (
				let currentNode = node;
				currentNode;
				currentNode = currentNode.parent
			) {
				if (
					currentNode.type === "ReturnStatement" ||
					(currentNode.type === "ArrowFunctionExpression" &&
						currentNode.body.type !== "BlockStatement")
				) {
					return true;
				}
			}

			return false;
		}

		/**
		 * Determines if a constructor function is newed-up with parens
		 * @param {ASTNode} newExpression The NewExpression node to be checked.
		 * @returns {boolean} True if the constructor is called with parens.
		 * @private
		 */
		function isNewExpressionWithParens(newExpression) {
			const lastToken = sourceCode.getLastToken(newExpression);
			const penultimateToken = sourceCode.getTokenBefore(lastToken);

			return (
				newExpression.arguments.length > 0 ||
				// The expression should end with its own parens, e.g., new new foo() is not a new expression with parens
				(astUtils.isOpeningParenToken(penultimateToken) &&
					astUtils.isClosingParenToken(lastToken) &&
					newExpression.callee.range[1] < newExpression.range[1])
			);
		}

		/**
		 * Determines if a node is or contains an assignment expression
		 * @param {ASTNode} node The node to be checked.
		 * @returns {boolean} True if the node is or contains an assignment expression.
		 * @private
		 */
		function containsAssignment(node) {
			if (node.type === "AssignmentExpression") {
				return true;
			}
			if (
				node.type === "ConditionalExpression" &&
				(node.consequent.type === "AssignmentExpression" ||
					node.alternate.type === "AssignmentExpression")
			) {
				return true;
			}
			if (
				(node.left && node.left.type === "AssignmentExpression") ||
				(node.right && node.right.type === "AssignmentExpression")
			) {
				return true;
			}

			return false;
		}

		/**
		 * Determines if a node is contained by or is itself a return statement and is allowed to have a parenthesised assignment
		 * @param {ASTNode} node The node to be checked.
		 * @returns {boolean} True if the assignment can be parenthesised.
		 * @private
		 */
		function isReturnAssignException(node) {
			if (!EXCEPT_RETURN_ASSIGN || !isInReturnStatement(node)) {
				return false;
			}

			if (node.type === "ReturnStatement") {
				return node.argument && containsAssignment(node.argument);
			}
			if (
				node.type === "ArrowFunctionExpression" &&
				node.body.type !== "BlockStatement"
			) {
				return containsAssignment(node.body);
			}
			return containsAssignment(node);
		}

		/**
		 * Determines if a node following a [no LineTerminator here] restriction is
		 * surrounded by (potentially) invalid extra parentheses.
		 * @param {Token} token The token preceding the [no LineTerminator here] restriction.
		 * @param {ASTNode} node The node to be checked.
		 * @returns {boolean} True if the node is incorrectly parenthesised.
		 * @private
		 */
		function hasExcessParensNoLineTerminator(token, node) {
			if (token.loc.end.line === node.loc.start.line) {
				return hasExcessParens(node);
			}

			return hasDoubleExcessParens(node);
		}

		/**
		 * Determines whether a node should be preceded by an additional space when removing parens
		 * @param {ASTNode} node node to evaluate; must be surrounded by parentheses
		 * @returns {boolean} `true` if a space should be inserted before the node
		 * @private
		 */
		function requiresLeadingSpace(node) {
			const leftParenToken = sourceCode.getTokenBefore(node);
			const tokenBeforeLeftParen = sourceCode.getTokenBefore(
				leftParenToken,
				{ includeComments: true },
			);
			const tokenAfterLeftParen = sourceCode.getTokenAfter(
				leftParenToken,
				{ includeComments: true },
			);

			return (
				tokenBeforeLeftParen &&
				tokenBeforeLeftParen.range[1] === leftParenToken.range[0] &&
				leftParenToken.range[1] === tokenAfterLeftParen.range[0] &&
				!astUtils.canTokensBeAdjacent(
					tokenBeforeLeftParen,
					tokenAfterLeftParen,
				)
			);
		}

		/**
		 * Determines whether a node should be followed by an additional space when removing parens
		 * @param {ASTNode} node node to evaluate; must be surrounded by parentheses
		 * @returns {boolean} `true` if a space should be inserted after the node
		 * @private
		 */
		function requiresTrailingSpace(node) {
			const nextTwoTokens = sourceCode.getTokensAfter(node, { count: 2 });
			const rightParenToken = nextTwoTokens[0];
			const tokenAfterRightParen = nextTwoTokens[1];
			const tokenBeforeRightParen = sourceCode.getLastToken(node);

			return (
				rightParenToken &&
				tokenAfterRightParen &&
				!sourceCode.isSpaceBetween(
					rightParenToken,
					tokenAfterRightParen,
				) &&
				!astUtils.canTokensBeAdjacent(
					tokenBeforeRightParen,
					tokenAfterRightParen,
				)
			);
		}

		/**
		 * Determines if a given expression node is an IIFE
		 * @param {ASTNode} node The node to check
		 * @returns {boolean} `true` if the given node is an IIFE
		 */
		function isIIFE(node) {
			const maybeCallNode = astUtils.skipChainExpression(node);

			return (
				maybeCallNode.type === "CallExpression" &&
				maybeCallNode.callee.type === "FunctionExpression"
			);
		}

		/**
		 * Determines if the given node can be the assignment target in destructuring or the LHS of an assignment.
		 * This is to avoid an autofix that could change behavior because parsers mistakenly allow invalid syntax,
		 * such as `(a = b) = c` and `[(a = b) = c] = []`. Ideally, this function shouldn't be necessary.
		 * @param {ASTNode} [node] The node to check
		 * @returns {boolean} `true` if the given node can be a valid assignment target
		 */
		function canBeAssignmentTarget(node) {
			return (
				node &&
				(node.type === "Identifier" || node.type === "MemberExpression")
			);
		}

		/**
		 * Checks if a node is fixable.
		 * A node is fixable if removing a single pair of surrounding parentheses does not turn it
		 * into a directive after fixing other nodes.
		 * Almost all nodes are fixable, except if all of the following conditions are met:
		 * The node is a string Literal
		 * It has a single pair of parentheses
		 * It is the only child of an ExpressionStatement
		 * @param {ASTNode} node The node to evaluate.
		 * @returns {boolean} Whether or not the node is fixable.
		 * @private
		 */
		function isFixable(node) {
			// if it's not a string literal it can be autofixed
			if (node.type !== "Literal" || typeof node.value !== "string") {
				return true;
			}
			if (isParenthesisedTwice(node)) {
				return true;
			}
			return !astUtils.isTopLevelExpressionStatement(node.parent);
		}

		/**
		 * Report the node
		 * @param {ASTNode} node node to evaluate
		 * @returns {void}
		 * @private
		 */
		function report(node) {
			const leftParenToken = sourceCode.getTokenBefore(node);
			const rightParenToken = sourceCode.getTokenAfter(node);

			if (!isParenthesisedTwice(node)) {
				if (tokensToIgnore.has(sourceCode.getFirstToken(node))) {
					return;
				}

				if (isIIFE(node) && !isParenthesised(node.callee)) {
					return;
				}

				if (ALLOW_PARENS_AFTER_COMMENT_PATTERN) {
					const commentsBeforeLeftParenToken =
						sourceCode.getCommentsBefore(leftParenToken);
					const totalCommentsBeforeLeftParenTokenCount =
						commentsBeforeLeftParenToken.length;
					const ignorePattern = new RegExp(
						ALLOW_PARENS_AFTER_COMMENT_PATTERN,
						"u",
					);

					if (
						totalCommentsBeforeLeftParenTokenCount > 0 &&
						ignorePattern.test(
							commentsBeforeLeftParenToken[
								totalCommentsBeforeLeftParenTokenCount - 1
							].value,
						)
					) {
						return;
					}
				}
			}

			/**
			 * Finishes reporting
			 * @returns {void}
			 * @private
			 */
			function finishReport() {
				context.report({
					node,
					loc: leftParenToken.loc,
					messageId: "unexpected",
					fix: isFixable(node)
						? fixer => {
								const parenthesizedSource =
									sourceCode.text.slice(
										leftParenToken.range[1],
										rightParenToken.range[0],
									);

								return fixer.replaceTextRange(
									[
										leftParenToken.range[0],
										rightParenToken.range[1],
									],
									(requiresLeadingSpace(node) ? " " : "") +
										parenthesizedSource +
										(requiresTrailingSpace(node)
											? " "
											: ""),
								);
							}
						: null,
				});
			}

			if (reportsBuffer) {
				reportsBuffer.reports.push({ node, finishReport });
				return;
			}

			finishReport();
		}

		/**
		 * Evaluate a argument of the node.
		 * @param {ASTNode} node node to evaluate
		 * @returns {void}
		 * @private
		 */
		function checkArgumentWithPrecedence(node) {
			if (
				hasExcessParensWithPrecedence(node.argument, precedence(node))
			) {
				report(node.argument);
			}
		}

		/**
		 * Check if a member expression contains a call expression
		 * @param {ASTNode} node MemberExpression node to evaluate
		 * @returns {boolean} true if found, false if not
		 */
		function doesMemberExpressionContainCallExpression(node) {
			let currentNode = node.object;
			let currentNodeType = node.object.type;

			while (currentNodeType === "MemberExpression") {
				currentNode = currentNode.object;
				currentNodeType = currentNode.type;
			}

			return currentNodeType === "CallExpression";
		}

		/**
		 * Evaluate a new call
		 * @param {ASTNode} node node to evaluate
		 * @returns {void}
		 * @private
		 */
		function checkCallNew(node) {
			const callee = node.callee;

			if (hasExcessParensWithPrecedence(callee, precedence(node))) {
				if (
					hasDoubleExcessParens(callee) ||
					!(
						isIIFE(node) ||
						// (new A)(); new (new A)();
						(callee.type === "NewExpression" &&
							!isNewExpressionWithParens(callee) &&
							!(
								node.type === "NewExpression" &&
								!isNewExpressionWithParens(node)
							)) ||
						// new (a().b)(); new (a.b().c);
						(node.type === "NewExpression" &&
							callee.type === "MemberExpression" &&
							doesMemberExpressionContainCallExpression(
								callee,
							)) ||
						// (a?.b)(); (a?.())();
						(!node.optional && callee.type === "ChainExpression")
					)
				) {
					report(node.callee);
				}
			}
			node.arguments
				.filter(arg =>
					hasExcessParensWithPrecedence(
						arg,
						PRECEDENCE_OF_ASSIGNMENT_EXPR,
					),
				)
				.forEach(report);
		}

		/**
		 * Evaluate binary logicals
		 * @param {ASTNode} node node to evaluate
		 * @returns {void}
		 * @private
		 */
		function checkBinaryLogical(node) {
			const prec = precedence(node);
			const leftPrecedence = precedence(node.left);
			const rightPrecedence = precedence(node.right);
			const isExponentiation = node.operator === "**";
			const shouldSkipLeft =
				NESTED_BINARY &&
				(node.left.type === "BinaryExpression" ||
					node.left.type === "LogicalExpression");
			const shouldSkipRight =
				NESTED_BINARY &&
				(node.right.type === "BinaryExpression" ||
					node.right.type === "LogicalExpression");

			if (!shouldSkipLeft && hasExcessParens(node.left)) {
				if (
					(!(
						["AwaitExpression", "UnaryExpression"].includes(
							node.left.type,
						) && isExponentiation
					) &&
						!astUtils.isMixedLogicalAndCoalesceExpressions(
							node.left,
							node,
						) &&
						(leftPrecedence > prec ||
							(leftPrecedence === prec && !isExponentiation))) ||
					isParenthesisedTwice(node.left)
				) {
					report(node.left);
				}
			}

			if (!shouldSkipRight && hasExcessParens(node.right)) {
				if (
					(!astUtils.isMixedLogicalAndCoalesceExpressions(
						node.right,
						node,
					) &&
						(rightPrecedence > prec ||
							(rightPrecedence === prec && isExponentiation))) ||
					isParenthesisedTwice(node.right)
				) {
					report(node.right);
				}
			}
		}

		/**
		 * Check the parentheses around the super class of the given class definition.
		 * @param {ASTNode} node The node of class declarations to check.
		 * @returns {void}
		 */
		function checkClass(node) {
			if (!node.superClass) {
				return;
			}

			/*
			 * If `node.superClass` is a LeftHandSideExpression, parentheses are extra.
			 * Otherwise, parentheses are needed.
			 */
			const hasExtraParens =
				precedence(node.superClass) > PRECEDENCE_OF_UPDATE_EXPR
					? hasExcessParens(node.superClass)
					: hasDoubleExcessParens(node.superClass);

			if (hasExtraParens) {
				report(node.superClass);
			}
		}

		/**
		 * Check the parentheses around the argument of the given spread operator.
		 * @param {ASTNode} node The node of spread elements/properties to check.
		 * @returns {void}
		 */
		function checkSpreadOperator(node) {
			if (
				hasExcessParensWithPrecedence(
					node.argument,
					PRECEDENCE_OF_ASSIGNMENT_EXPR,
				)
			) {
				report(node.argument);
			}
		}

		/**
		 * Checks the parentheses for an ExpressionStatement or ExportDefaultDeclaration
		 * @param {ASTNode} node The ExpressionStatement.expression or ExportDefaultDeclaration.declaration node
		 * @returns {void}
		 */
		function checkExpressionOrExportStatement(node) {
			const firstToken = isParenthesised(node)
				? sourceCode.getTokenBefore(node)
				: sourceCode.getFirstToken(node);
			const secondToken = sourceCode.getTokenAfter(
				firstToken,
				astUtils.isNotOpeningParenToken,
			);
			const thirdToken = secondToken
				? sourceCode.getTokenAfter(secondToken)
				: null;
			const tokenAfterClosingParens = secondToken
				? sourceCode.getTokenAfter(
						secondToken,
						astUtils.isNotClosingParenToken,
					)
				: null;

			if (
				astUtils.isOpeningParenToken(firstToken) &&
				(astUtils.isOpeningBraceToken(secondToken) ||
					(secondToken.type === "Keyword" &&
						(secondToken.value === "function" ||
							secondToken.value === "class" ||
							(secondToken.value === "let" &&
								tokenAfterClosingParens &&
								(astUtils.isOpeningBracketToken(
									tokenAfterClosingParens,
								) ||
									tokenAfterClosingParens.type ===
										"Identifier")))) ||
					(secondToken &&
						secondToken.type === "Identifier" &&
						secondToken.value === "async" &&
						thirdToken &&
						thirdToken.type === "Keyword" &&
						thirdToken.value === "function"))
			) {
				tokensToIgnore.add(secondToken);
			}

			const hasExtraParens =
				node.parent.type === "ExportDefaultDeclaration"
					? hasExcessParensWithPrecedence(
							node,
							PRECEDENCE_OF_ASSIGNMENT_EXPR,
						)
					: hasExcessParens(node);

			if (hasExtraParens) {
				report(node);
			}
		}

		/**
		 * Finds the path from the given node to the specified ancestor.
		 * @param {ASTNode} node First node in the path.
		 * @param {ASTNode} ancestor Last node in the path.
		 * @returns {ASTNode[]} Path, including both nodes.
		 * @throws {Error} If the given node does not have the specified ancestor.
		 */
		function pathToAncestor(node, ancestor) {
			const path = [node];
			let currentNode = node;

			while (currentNode !== ancestor) {
				currentNode = currentNode.parent;

				/* c8 ignore start */
				if (currentNode === null) {
					throw new Error(
						"Nodes are not in the ancestor-descendant relationship.",
					);
				} /* c8 ignore stop */

				path.push(currentNode);
			}

			return path;
		}

		/**
		 * Finds the path from the given node to the specified descendant.
		 * @param {ASTNode} node First node in the path.
		 * @param {ASTNode} descendant Last node in the path.
		 * @returns {ASTNode[]} Path, including both nodes.
		 * @throws {Error} If the given node does not have the specified descendant.
		 */
		function pathToDescendant(node, descendant) {
			return pathToAncestor(descendant, node).reverse();
		}

		/**
		 * Checks whether the syntax of the given ancestor of an 'in' expression inside a for-loop initializer
		 * is preventing the 'in' keyword from being interpreted as a part of an ill-formed for-in loop.
		 * @param {ASTNode} node Ancestor of an 'in' expression.
		 * @param {ASTNode} child Child of the node, ancestor of the same 'in' expression or the 'in' expression itself.
		 * @returns {boolean} True if the keyword 'in' would be interpreted as the 'in' operator, without any parenthesis.
		 */
		function isSafelyEnclosingInExpression(node, child) {
			switch (node.type) {
				case "ArrayExpression":
				case "ArrayPattern":
				case "BlockStatement":
				case "ObjectExpression":
				case "ObjectPattern":
				case "TemplateLiteral":
					return true;
				case "ArrowFunctionExpression":
				case "FunctionExpression":
					return node.params.includes(child);
				case "CallExpression":
				case "NewExpression":
					return node.arguments.includes(child);
				case "MemberExpression":
					return node.computed && node.property === child;
				case "ConditionalExpression":
					return node.consequent === child;
				default:
					return false;
			}
		}

		/**
		 * Starts a new reports buffering. Warnings will be stored in a buffer instead of being reported immediately.
		 * An additional logic that requires multiple nodes (e.g. a whole subtree) may dismiss some of the stored warnings.
		 * @returns {void}
		 */
		function startNewReportsBuffering() {
			reportsBuffer = {
				upper: reportsBuffer,
				inExpressionNodes: [],
				reports: [],
			};
		}

		/**
		 * Ends the current reports buffering.
		 * @returns {void}
		 */
		function endCurrentReportsBuffering() {
			const { upper, inExpressionNodes, reports } = reportsBuffer;

			if (upper) {
				upper.inExpressionNodes.push(...inExpressionNodes);
				upper.reports.push(...reports);
			} else {
				// flush remaining reports
				reports.forEach(({ finishReport }) => finishReport());
			}

			reportsBuffer = upper;
		}

		/**
		 * Checks whether the given node is in the current reports buffer.
		 * @param {ASTNode} node Node to check.
		 * @returns {boolean} True if the node is in the current buffer, false otherwise.
		 */
		function isInCurrentReportsBuffer(node) {
			return reportsBuffer.reports.some(r => r.node === node);
		}

		/**
		 * Removes the given node from the current reports buffer.
		 * @param {ASTNode} node Node to remove.
		 * @returns {void}
		 */
		function removeFromCurrentReportsBuffer(node) {
			reportsBuffer.reports = reportsBuffer.reports.filter(
				r => r.node !== node,
			);
		}

		/**
		 * Checks whether a node is a MemberExpression at NewExpression's callee.
		 * @param {ASTNode} node node to check.
		 * @returns {boolean} True if the node is a MemberExpression at NewExpression's callee. false otherwise.
		 */
		function isMemberExpInNewCallee(node) {
			if (node.type === "MemberExpression") {
				return node.parent.type === "NewExpression" &&
					node.parent.callee === node
					? true
					: node.parent.object === node &&
							isMemberExpInNewCallee(node.parent);
			}
			return false;
		}

		/**
		 * Checks if the left-hand side of an assignment is an identifier, the operator is one of
		 * `=`, `&&=`, `||=` or `??=` and the right-hand side is an anonymous class or function.
		 *
		 * As per https://tc39.es/ecma262/#sec-assignment-operators-runtime-semantics-evaluation, an
		 * assignment involving one of the operators `=`, `&&=`, `||=` or `??=` where the right-hand
		 * side is an anonymous class or function and the left-hand side is an *unparenthesized*
		 * identifier has different semantics than other assignments.
		 * Specifically, when an expression like `foo = function () {}` is evaluated, `foo.name`
		 * will be set to the string "foo", i.e. the identifier name. The same thing does not happen
		 * when evaluating `(foo) = function () {}`.
		 * Since the parenthesizing of the identifier in the left-hand side is significant in this
		 * special case, the parentheses, if present, should not be flagged as unnecessary.
		 * @param {ASTNode} node an AssignmentExpression node.
		 * @returns {boolean} `true` if the left-hand side of the assignment is an identifier, the
		 * operator is one of `=`, `&&=`, `||=` or `??=` and the right-hand side is an anonymous
		 * class or function; otherwise, `false`.
		 */
		function isAnonymousFunctionAssignmentException({
			left,
			operator,
			right,
		}) {
			if (
				left.type === "Identifier" &&
				["=", "&&=", "||=", "??="].includes(operator)
			) {
				const rhsType = right.type;

				if (rhsType === "ArrowFunctionExpression") {
					return true;
				}
				if (
					(rhsType === "FunctionExpression" ||
						rhsType === "ClassExpression") &&
					!right.id
				) {
					return true;
				}
			}
			return false;
		}

		return {
			ArrayExpression(node) {
				node.elements
					.filter(
						e =>
							e &&
							hasExcessParensWithPrecedence(
								e,
								PRECEDENCE_OF_ASSIGNMENT_EXPR,
							),
					)
					.forEach(report);
			},

			ArrayPattern(node) {
				node.elements
					.filter(e => canBeAssignmentTarget(e) && hasExcessParens(e))
					.forEach(report);
			},

			ArrowFunctionExpression(node) {
				if (isReturnAssignException(node)) {
					return;
				}

				if (
					node.body.type === "ConditionalExpression" &&
					IGNORE_ARROW_CONDITIONALS
				) {
					return;
				}

				if (node.body.type !== "BlockStatement") {
					const firstBodyToken = sourceCode.getFirstToken(
						node.body,
						astUtils.isNotOpeningParenToken,
					);
					const tokenBeforeFirst =
						sourceCode.getTokenBefore(firstBodyToken);

					if (
						astUtils.isOpeningParenToken(tokenBeforeFirst) &&
						astUtils.isOpeningBraceToken(firstBodyToken)
					) {
						tokensToIgnore.add(firstBodyToken);
					}
					if (
						hasExcessParensWithPrecedence(
							node.body,
							PRECEDENCE_OF_ASSIGNMENT_EXPR,
						)
					) {
						report(node.body);
					}
				}
			},

			AssignmentExpression(node) {
				if (
					canBeAssignmentTarget(node.left) &&
					hasExcessParens(node.left) &&
					(!isAnonymousFunctionAssignmentException(node) ||
						isParenthesisedTwice(node.left))
				) {
					report(node.left);
				}

				if (
					!isReturnAssignException(node) &&
					hasExcessParensWithPrecedence(node.right, precedence(node))
				) {
					report(node.right);
				}
			},

			BinaryExpression(node) {
				if (reportsBuffer && node.operator === "in") {
					reportsBuffer.inExpressionNodes.push(node);
				}

				checkBinaryLogical(node);
			},

			CallExpression: checkCallNew,

			ConditionalExpression(node) {
				if (isReturnAssignException(node)) {
					return;
				}

				const availableTypes = new Set([
					"BinaryExpression",
					"LogicalExpression",
				]);

				if (
					!(
						EXCEPT_COND_TERNARY &&
						availableTypes.has(node.test.type)
					) &&
					!isCondAssignException(node) &&
					hasExcessParensWithPrecedence(
						node.test,
						precedence({
							type: "LogicalExpression",
							operator: "||",
						}),
					)
				) {
					report(node.test);
				}

				if (
					!(
						EXCEPT_COND_TERNARY &&
						availableTypes.has(node.consequent.type)
					) &&
					hasExcessParensWithPrecedence(
						node.consequent,
						PRECEDENCE_OF_ASSIGNMENT_EXPR,
					)
				) {
					report(node.consequent);
				}

				if (
					!(
						EXCEPT_COND_TERNARY &&
						availableTypes.has(node.alternate.type)
					) &&
					hasExcessParensWithPrecedence(
						node.alternate,
						PRECEDENCE_OF_ASSIGNMENT_EXPR,
					)
				) {
					report(node.alternate);
				}
			},

			DoWhileStatement(node) {
				if (
					hasExcessParens(node.test) &&
					!isCondAssignException(node)
				) {
					report(node.test);
				}
			},

			ExportDefaultDeclaration: node =>
				checkExpressionOrExportStatement(node.declaration),
			ExpressionStatement: node =>
				checkExpressionOrExportStatement(node.expression),

			ForInStatement(node) {
				if (node.left.type !== "VariableDeclaration") {
					const firstLeftToken = sourceCode.getFirstToken(
						node.left,
						astUtils.isNotOpeningParenToken,
					);

					if (
						firstLeftToken.value === "let" &&
						astUtils.isOpeningBracketToken(
							sourceCode.getTokenAfter(
								firstLeftToken,
								astUtils.isNotClosingParenToken,
							),
						)
					) {
						// ForInStatement#left expression cannot start with `let[`.
						tokensToIgnore.add(firstLeftToken);
					}
				}

				if (hasExcessParens(node.left)) {
					report(node.left);
				}

				if (hasExcessParens(node.right)) {
					report(node.right);
				}
			},

			ForOfStatement(node) {
				if (node.left.type !== "VariableDeclaration") {
					const firstLeftToken = sourceCode.getFirstToken(
						node.left,
						astUtils.isNotOpeningParenToken,
					);

					if (firstLeftToken.value === "let") {
						// ForOfStatement#left expression cannot start with `let`.
						tokensToIgnore.add(firstLeftToken);
					}
				}

				if (hasExcessParens(node.left)) {
					report(node.left);
				}

				if (
					hasExcessParensWithPrecedence(
						node.right,
						PRECEDENCE_OF_ASSIGNMENT_EXPR,
					)
				) {
					report(node.right);
				}
			},

			ForStatement(node) {
				if (
					node.test &&
					hasExcessParens(node.test) &&
					!isCondAssignException(node)
				) {
					report(node.test);
				}

				if (node.update && hasExcessParens(node.update)) {
					report(node.update);
				}

				if (node.init) {
					if (node.init.type !== "VariableDeclaration") {
						const firstToken = sourceCode.getFirstToken(
							node.init,
							astUtils.isNotOpeningParenToken,
						);

						if (
							firstToken.value === "let" &&
							astUtils.isOpeningBracketToken(
								sourceCode.getTokenAfter(
									firstToken,
									astUtils.isNotClosingParenToken,
								),
							)
						) {
							// ForStatement#init expression cannot start with `let[`.
							tokensToIgnore.add(firstToken);
						}
					}

					startNewReportsBuffering();

					if (hasExcessParens(node.init)) {
						report(node.init);
					}
				}
			},

			"ForStatement > *.init:exit"(node) {
				/*
				 * Removing parentheses around `in` expressions might change semantics and cause errors.
				 *
				 * For example, this valid for loop:
				 *      for (let a = (b in c); ;);
				 * after removing parentheses would be treated as an invalid for-in loop:
				 *      for (let a = b in c; ;);
				 */

				if (reportsBuffer.reports.length) {
					reportsBuffer.inExpressionNodes.forEach(
						inExpressionNode => {
							const path = pathToDescendant(
								node,
								inExpressionNode,
							);
							let nodeToExclude;

							for (let i = 0; i < path.length; i++) {
								const pathNode = path[i];

								if (i < path.length - 1) {
									const nextPathNode = path[i + 1];

									if (
										isSafelyEnclosingInExpression(
											pathNode,
											nextPathNode,
										)
									) {
										// The 'in' expression in safely enclosed by the syntax of its ancestor nodes (e.g. by '{}' or '[]').
										return;
									}
								}

								if (isParenthesised(pathNode)) {
									if (isInCurrentReportsBuffer(pathNode)) {
										// This node was supposed to be reported, but parentheses might be necessary.

										if (isParenthesisedTwice(pathNode)) {
											/*
											 * This node is parenthesised twice, it certainly has at least one pair of `extra` parentheses.
											 * If the --fix option is on, the current fixing iteration will remove only one pair of parentheses.
											 * The remaining pair is safely enclosing the 'in' expression.
											 */
											return;
										}

										// Exclude the outermost node only.
										if (!nodeToExclude) {
											nodeToExclude = pathNode;
										}

										// Don't break the loop here, there might be some safe nodes or parentheses that will stay inside.
									} else {
										// This node will stay parenthesised, the 'in' expression in safely enclosed by '()'.
										return;
									}
								}
							}

							// Exclude the node from the list (i.e. treat parentheses as necessary)
							removeFromCurrentReportsBuffer(nodeToExclude);
						},
					);
				}

				endCurrentReportsBuffering();
			},

			IfStatement(node) {
				if (
					hasExcessParens(node.test) &&
					!isCondAssignException(node)
				) {
					report(node.test);
				}
			},

			ImportExpression(node) {
				const { source } = node;

				if (source.type === "SequenceExpression") {
					if (hasDoubleExcessParens(source)) {
						report(source);
					}
				} else if (hasExcessParens(source)) {
					report(source);
				}
			},

			LogicalExpression: checkBinaryLogical,

			MemberExpression(node) {
				const shouldAllowWrapOnce =
					isMemberExpInNewCallee(node) &&
					doesMemberExpressionContainCallExpression(node);
				const nodeObjHasExcessParens = shouldAllowWrapOnce
					? hasDoubleExcessParens(node.object)
					: hasExcessParens(node.object) &&
						!(
							isImmediateFunctionPrototypeMethodCall(
								node.parent,
							) &&
							node.parent.callee === node &&
							IGNORE_FUNCTION_PROTOTYPE_METHODS
						);

				if (
					nodeObjHasExcessParens &&
					precedence(node.object) >= precedence(node) &&
					(node.computed ||
						!(
							astUtils.isDecimalInteger(node.object) ||
							// RegExp literal is allowed to have parens (#1589)
							(node.object.type === "Literal" &&
								node.object.regex)
						))
				) {
					report(node.object);
				}

				if (
					nodeObjHasExcessParens &&
					node.object.type === "CallExpression"
				) {
					report(node.object);
				}

				if (
					nodeObjHasExcessParens &&
					!IGNORE_NEW_IN_MEMBER_EXPR &&
					node.object.type === "NewExpression" &&
					isNewExpressionWithParens(node.object)
				) {
					report(node.object);
				}

				if (
					nodeObjHasExcessParens &&
					node.optional &&
					node.object.type === "ChainExpression"
				) {
					report(node.object);
				}

				if (node.computed && hasExcessParens(node.property)) {
					report(node.property);
				}
			},

			"MethodDefinition[computed=true]"(node) {
				if (
					hasExcessParensWithPrecedence(
						node.key,
						PRECEDENCE_OF_ASSIGNMENT_EXPR,
					)
				) {
					report(node.key);
				}
			},

			NewExpression: checkCallNew,

			ObjectExpression(node) {
				node.properties
					.filter(
						property =>
							property.value &&
							hasExcessParensWithPrecedence(
								property.value,
								PRECEDENCE_OF_ASSIGNMENT_EXPR,
							),
					)
					.forEach(property => report(property.value));
			},

			ObjectPattern(node) {
				node.properties
					.filter(property => {
						const value = property.value;

						return (
							canBeAssignmentTarget(value) &&
							hasExcessParens(value)
						);
					})
					.forEach(property => report(property.value));
			},

			Property(node) {
				if (node.computed) {
					const { key } = node;

					if (
						key &&
						hasExcessParensWithPrecedence(
							key,
							PRECEDENCE_OF_ASSIGNMENT_EXPR,
						)
					) {
						report(key);
					}
				}
			},

			PropertyDefinition(node) {
				if (
					node.computed &&
					hasExcessParensWithPrecedence(
						node.key,
						PRECEDENCE_OF_ASSIGNMENT_EXPR,
					)
				) {
					report(node.key);
				}

				if (
					node.value &&
					hasExcessParensWithPrecedence(
						node.value,
						PRECEDENCE_OF_ASSIGNMENT_EXPR,
					)
				) {
					report(node.value);
				}
			},

			RestElement(node) {
				const argument = node.argument;

				if (
					canBeAssignmentTarget(argument) &&
					hasExcessParens(argument)
				) {
					report(argument);
				}
			},

			ReturnStatement(node) {
				const returnToken = sourceCode.getFirstToken(node);

				if (isReturnAssignException(node)) {
					return;
				}

				if (
					node.argument &&
					hasExcessParensNoLineTerminator(
						returnToken,
						node.argument,
					) &&
					// RegExp literal is allowed to have parens (#1589)
					!(node.argument.type === "Literal" && node.argument.regex)
				) {
					report(node.argument);
				}
			},

			SequenceExpression(node) {
				const precedenceOfNode = precedence(node);

				node.expressions
					.filter(e =>
						hasExcessParensWithPrecedence(e, precedenceOfNode),
					)
					.forEach(report);
			},

			SwitchCase(node) {
				if (node.test && hasExcessParens(node.test)) {
					report(node.test);
				}
			},

			SwitchStatement(node) {
				if (hasExcessParens(node.discriminant)) {
					report(node.discriminant);
				}
			},

			ThrowStatement(node) {
				const throwToken = sourceCode.getFirstToken(node);

				if (
					hasExcessParensNoLineTerminator(throwToken, node.argument)
				) {
					report(node.argument);
				}
			},

			UnaryExpression: checkArgumentWithPrecedence,
			UpdateExpression(node) {
				if (node.prefix) {
					checkArgumentWithPrecedence(node);
				} else {
					const { argument } = node;
					const operatorToken = sourceCode.getLastToken(node);

					if (
						argument.loc.end.line === operatorToken.loc.start.line
					) {
						checkArgumentWithPrecedence(node);
					} else {
						if (hasDoubleExcessParens(argument)) {
							report(argument);
						}
					}
				}
			},
			AwaitExpression: checkArgumentWithPrecedence,

			VariableDeclarator(node) {
				if (
					node.init &&
					hasExcessParensWithPrecedence(
						node.init,
						PRECEDENCE_OF_ASSIGNMENT_EXPR,
					) &&
					// RegExp literal is allowed to have parens (#1589)
					!(node.init.type === "Literal" && node.init.regex)
				) {
					report(node.init);
				}
			},

			WhileStatement(node) {
				if (
					hasExcessParens(node.test) &&
					!isCondAssignException(node)
				) {
					report(node.test);
				}
			},

			WithStatement(node) {
				if (hasExcessParens(node.object)) {
					report(node.object);
				}
			},

			YieldExpression(node) {
				if (node.argument) {
					const yieldToken = sourceCode.getFirstToken(node);

					if (
						(precedence(node.argument) >= precedence(node) &&
							hasExcessParensNoLineTerminator(
								yieldToken,
								node.argument,
							)) ||
						hasDoubleExcessParens(node.argument)
					) {
						report(node.argument);
					}
				}
			},

			ClassDeclaration: checkClass,
			ClassExpression: checkClass,

			SpreadElement: checkSpreadOperator,
			SpreadProperty: checkSpreadOperator,
			ExperimentalSpreadProperty: checkSpreadOperator,

			TemplateLiteral(node) {
				node.expressions
					.filter(e => e && hasExcessParens(e))
					.forEach(report);
			},

			AssignmentPattern(node) {
				const { left, right } = node;

				if (canBeAssignmentTarget(left) && hasExcessParens(left)) {
					report(left);
				}

				if (
					right &&
					hasExcessParensWithPrecedence(
						right,
						PRECEDENCE_OF_ASSIGNMENT_EXPR,
					)
				) {
					report(right);
				}
			},
		};
	},
};
Sx/**
 * @fileoverview Rule to flag use of unnecessary semicolons
 * @author Nicholas C. Zakas
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const FixTracker = require("./utils/fix-tracker");
const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "no-extra-semi",
						url: "https://eslint.style/rules/no-extra-semi",
					},
				},
			],
		},
		type: "suggestion",

		docs: {
			description: "Disallow unnecessary semicolons",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-extra-semi",
		},

		fixable: "code",
		schema: [],

		messages: {
			unexpected: "Unnecessary semicolon.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		/**
		 * Checks if a node or token is fixable.
		 * A node is fixable if it can be removed without turning a subsequent statement into a directive after fixing other nodes.
		 * @param {Token} nodeOrToken The node or token to check.
		 * @returns {boolean} Whether or not the node is fixable.
		 */
		function isFixable(nodeOrToken) {
			const nextToken = sourceCode.getTokenAfter(nodeOrToken);

			if (!nextToken || nextToken.type !== "String") {
				return true;
			}
			const stringNode = sourceCode.getNodeByRangeIndex(
				nextToken.range[0],
			);

			return !astUtils.isTopLevelExpressionStatement(stringNode.parent);
		}

		/**
		 * Reports an unnecessary semicolon error.
		 * @param {Node|Token} nodeOrToken A node or a token to be reported.
		 * @returns {void}
		 */
		function report(nodeOrToken) {
			context.report({
				node: nodeOrToken,
				messageId: "unexpected",
				fix: isFixable(nodeOrToken)
					? fixer =>
							/*
							 * Expand the replacement range to include the surrounding
							 * tokens to avoid conflicting with semi.
							 * https://github.com/eslint/eslint/issues/7928
							 */
							new FixTracker(fixer, context.sourceCode)
								.retainSurroundingTokens(nodeOrToken)
								.remove(nodeOrToken)
					: null,
			});
		}

		/**
		 * Checks for a part of a class body.
		 * This checks tokens from a specified token to a next MethodDefinition or the end of class body.
		 * @param {Token} firstToken The first token to check.
		 * @returns {void}
		 */
		function checkForPartOfClassBody(firstToken) {
			for (
				let token = firstToken;
				token.type === "Punctuator" &&
				!astUtils.isClosingBraceToken(token);
				token = sourceCode.getTokenAfter(token)
			) {
				if (astUtils.isSemicolonToken(token)) {
					report(token);
				}
			}
		}

		return {
			/**
			 * Reports this empty statement, except if the parent node is a loop.
			 * @param {Node} node A EmptyStatement node to be reported.
			 * @returns {void}
			 */
			EmptyStatement(node) {
				const parent = node.parent,
					allowedParentTypes = [
						"ForStatement",
						"ForInStatement",
						"ForOfStatement",
						"WhileStatement",
						"DoWhileStatement",
						"IfStatement",
						"LabeledStatement",
						"WithStatement",
					];

				if (!allowedParentTypes.includes(parent.type)) {
					report(node);
				}
			},

			/**
			 * Checks tokens from the head of this class body to the first MethodDefinition or the end of this class body.
			 * @param {Node} node A ClassBody node to check.
			 * @returns {void}
			 */
			ClassBody(node) {
				checkForPartOfClassBody(sourceCode.getFirstToken(node, 1)); // 0 is `{`.
			},

			/**
			 * Checks tokens from this MethodDefinition to the next MethodDefinition or the end of this class body.
			 * @param {Node} node A MethodDefinition node of the start point.
			 * @returns {void}
			 */
			"MethodDefinition, PropertyDefinition, StaticBlock"(node) {
				checkForPartOfClassBody(sourceCode.getTokenAfter(node));
			},
		};
	},
};
Jm5x/**
 * @fileoverview Rule to flag fall-through cases in switch statements.
 * @author Matt DuVall <http://mattduvall.com/>
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const { directivesPattern } = require("../shared/directives");
const { isAnySegmentReachable } = require("./utils/code-path-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const DEFAULT_FALLTHROUGH_COMMENT = /falls?\s?through/iu;

/**
 * Checks whether or not a given comment string is really a fallthrough comment and not an ESLint directive.
 * @param {string} comment The comment string to check.
 * @param {RegExp} fallthroughCommentPattern The regular expression used for checking for fallthrough comments.
 * @returns {boolean} `true` if the comment string is truly a fallthrough comment.
 */
function isFallThroughComment(comment, fallthroughCommentPattern) {
	return (
		fallthroughCommentPattern.test(comment) &&
		!directivesPattern.test(comment.trim())
	);
}

/**
 * Checks whether or not a given case has a fallthrough comment.
 * @param {ASTNode} caseWhichFallsThrough SwitchCase node which falls through.
 * @param {ASTNode} subsequentCase The case after caseWhichFallsThrough.
 * @param {RuleContext} context A rule context which stores comments.
 * @param {RegExp} fallthroughCommentPattern A pattern to match comment to.
 * @returns {null | object} the comment if the case has a valid fallthrough comment, otherwise null
 */
function getFallthroughComment(
	caseWhichFallsThrough,
	subsequentCase,
	context,
	fallthroughCommentPattern,
) {
	const sourceCode = context.sourceCode;

	if (
		caseWhichFallsThrough.consequent.length === 1 &&
		caseWhichFallsThrough.consequent[0].type === "BlockStatement"
	) {
		const trailingCloseBrace = sourceCode.getLastToken(
			caseWhichFallsThrough.consequent[0],
		);
		const commentInBlock = sourceCode
			.getCommentsBefore(trailingCloseBrace)
			.pop();

		if (
			commentInBlock &&
			isFallThroughComment(
				commentInBlock.value,
				fallthroughCommentPattern,
			)
		) {
			return commentInBlock;
		}
	}

	const comment = sourceCode.getCommentsBefore(subsequentCase).pop();

	if (
		comment &&
		isFallThroughComment(comment.value, fallthroughCommentPattern)
	) {
		return comment;
	}

	return null;
}

/**
 * Checks whether a node and a token are separated by blank lines
 * @param {ASTNode} node The node to check
 * @param {Token} token The token to compare against
 * @returns {boolean} `true` if there are blank lines between node and token
 */
function hasBlankLinesBetween(node, token) {
	return token.loc.start.line > node.loc.end.line + 1;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		defaultOptions: [
			{
				allowEmptyCase: false,
				reportUnusedFallthroughComment: false,
			},
		],

		docs: {
			description: "Disallow fallthrough of `case` statements",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-fallthrough",
		},

		schema: [
			{
				type: "object",
				properties: {
					commentPattern: {
						type: "string",
					},
					allowEmptyCase: {
						type: "boolean",
					},
					reportUnusedFallthroughComment: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],
		messages: {
			unusedFallthroughComment:
				"Found a comment that would permit fallthrough, but case cannot fall through.",
			case: "Expected a 'break' statement before 'case'.",
			default: "Expected a 'break' statement before 'default'.",
		},
	},

	create(context) {
		const codePathSegments = [];
		let currentCodePathSegments = new Set();
		const sourceCode = context.sourceCode;
		const [
			{ allowEmptyCase, commentPattern, reportUnusedFallthroughComment },
		] = context.options;
		const fallthroughCommentPattern = commentPattern
			? new RegExp(commentPattern, "u")
			: DEFAULT_FALLTHROUGH_COMMENT;

		/*
		 * We need to use leading comments of the next SwitchCase node because
		 * trailing comments is wrong if semicolons are omitted.
		 */
		let previousCase = null;

		return {
			onCodePathStart() {
				codePathSegments.push(currentCodePathSegments);
				currentCodePathSegments = new Set();
			},

			onCodePathEnd() {
				currentCodePathSegments = codePathSegments.pop();
			},

			onUnreachableCodePathSegmentStart(segment) {
				currentCodePathSegments.add(segment);
			},

			onUnreachableCodePathSegmentEnd(segment) {
				currentCodePathSegments.delete(segment);
			},

			onCodePathSegmentStart(segment) {
				currentCodePathSegments.add(segment);
			},

			onCodePathSegmentEnd(segment) {
				currentCodePathSegments.delete(segment);
			},

			SwitchCase(node) {
				/*
				 * Checks whether or not there is a fallthrough comment.
				 * And reports the previous fallthrough node if that does not exist.
				 */

				if (previousCase && previousCase.node.parent === node.parent) {
					const previousCaseFallthroughComment =
						getFallthroughComment(
							previousCase.node,
							node,
							context,
							fallthroughCommentPattern,
						);

					if (
						previousCase.isFallthrough &&
						!previousCaseFallthroughComment
					) {
						context.report({
							messageId: node.test ? "case" : "default",
							node,
						});
					} else if (
						reportUnusedFallthroughComment &&
						!previousCase.isSwitchExitReachable &&
						previousCaseFallthroughComment
					) {
						context.report({
							messageId: "unusedFallthroughComment",
							node: previousCaseFallthroughComment,
						});
					}
				}
				previousCase = null;
			},

			"SwitchCase:exit"(node) {
				const nextToken = sourceCode.getTokenAfter(node);

				/*
				 * `reachable` meant fall through because statements preceded by
				 * `break`, `return`, or `throw` are unreachable.
				 * And allows empty cases and the last case.
				 */
				const isSwitchExitReachable = isAnySegmentReachable(
					currentCodePathSegments,
				);
				const isFallthrough =
					isSwitchExitReachable &&
					(node.consequent.length > 0 ||
						(!allowEmptyCase &&
							hasBlankLinesBetween(node, nextToken))) &&
					node.parent.cases.at(-1) !== node;

				previousCase = {
					node,
					isSwitchExitReachable,
					isFallthrough,
				};
			},
		};
	},
};
ex
/**
 * @fileoverview Rule to flag use of a leading/trailing decimal point in a numeric literal
 * @author James Allardice
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "no-floating-decimal",
						url: "https://eslint.style/rules/no-floating-decimal",
					},
				},
			],
		},
		type: "suggestion",

		docs: {
			description:
				"Disallow leading or trailing decimal points in numeric literals",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-floating-decimal",
		},

		schema: [],
		fixable: "code",
		messages: {
			leading: "A leading decimal point can be confused with a dot.",
			trailing: "A trailing decimal point can be confused with a dot.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		return {
			Literal(node) {
				if (typeof node.value === "number") {
					if (node.raw.startsWith(".")) {
						context.report({
							node,
							messageId: "leading",
							fix(fixer) {
								const tokenBefore =
									sourceCode.getTokenBefore(node);
								const needsSpaceBefore =
									tokenBefore &&
									tokenBefore.range[1] === node.range[0] &&
									!astUtils.canTokensBeAdjacent(
										tokenBefore,
										`0${node.raw}`,
									);

								return fixer.insertTextBefore(
									node,
									needsSpaceBefore ? " 0" : "0",
								);
							},
						});
					}
					if (node.raw.indexOf(".") === node.raw.length - 1) {
						context.report({
							node,
							messageId: "trailing",
							fix: fixer => fixer.insertTextAfter(node, "0"),
						});
					}
				}
			},
		};
	},
};
u2txE/**
 * @fileoverview Rule to flag use of function declaration identifiers as variables.
 * @author Ian Christian Myers
 */

"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description: "Disallow reassigning `function` declarations",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-func-assign",
		},

		schema: [],

		messages: {
			isAFunction: "'{{name}}' is a function.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		/**
		 * Reports a reference if is non initializer and writable.
		 * @param {References} references Collection of reference to check.
		 * @returns {void}
		 */
		function checkReference(references) {
			astUtils.getModifyingReferences(references).forEach(reference => {
				context.report({
					node: reference.identifier,
					messageId: "isAFunction",
					data: {
						name: reference.identifier.name,
					},
				});
			});
		}

		/**
		 * Finds and reports references that are non initializer and writable.
		 * @param {Variable} variable A variable to check.
		 * @returns {void}
		 */
		function checkVariable(variable) {
			if (variable.defs[0].type === "FunctionName") {
				checkReference(variable.references);
			}
		}

		/**
		 * Checks parameters of a given function node.
		 * @param {ASTNode} node A function node to check.
		 * @returns {void}
		 */
		function checkForFunction(node) {
			sourceCode.getDeclaredVariables(node).forEach(checkVariable);
		}

		return {
			FunctionDeclaration: checkForFunction,
			FunctionExpression: checkForFunction,
		};
	},
};
<кxz	/**
 * @fileoverview Rule to disallow assignments to native objects or read-only global variables
 * @author Ilya Volodin
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [{ exceptions: [] }],

		docs: {
			description:
				"Disallow assignments to native objects or read-only global variables",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-global-assign",
		},

		schema: [
			{
				type: "object",
				properties: {
					exceptions: {
						type: "array",
						items: { type: "string" },
						uniqueItems: true,
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			globalShouldNotBeModified:
				"Read-only global '{{name}}' should not be modified.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const [{ exceptions }] = context.options;

		/**
		 * Reports write references.
		 * @param {Reference} reference A reference to check.
		 * @param {number} index The index of the reference in the references.
		 * @param {Reference[]} references The array that the reference belongs to.
		 * @returns {void}
		 */
		function checkReference(reference, index, references) {
			const identifier = reference.identifier;

			if (
				reference.init === false &&
				reference.isWrite() &&
				/*
				 * Destructuring assignments can have multiple default value,
				 * so possibly there are multiple writeable references for the same identifier.
				 */
				(index === 0 || references[index - 1].identifier !== identifier)
			) {
				context.report({
					node: identifier,
					messageId: "globalShouldNotBeModified",
					data: {
						name: identifier.name,
					},
				});
			}
		}

		/**
		 * Reports write references if a given variable is read-only builtin.
		 * @param {Variable} variable A variable to check.
		 * @returns {void}
		 */
		function checkVariable(variable) {
			if (
				variable.writeable === false &&
				!exceptions.includes(variable.name)
			) {
				variable.references.forEach(checkReference);
			}
		}

		return {
			Program(node) {
				const globalScope = sourceCode.getScope(node);

				globalScope.variables.forEach(checkVariable);
			},
		};
	},
};
̨xv3/**
 * @fileoverview A rule to disallow the type conversions with shorter notations.
 * @author Toru Nagashima
 */

"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const INDEX_OF_PATTERN = /^(?:i|lastI)ndexOf$/u;
const ALLOWABLE_OPERATORS = ["~", "!!", "+", "- -", "-", "*"];

/**
 * Checks whether or not a node is a double logical negating.
 * @param {ASTNode} node An UnaryExpression node to check.
 * @returns {boolean} Whether or not the node is a double logical negating.
 */
function isDoubleLogicalNegating(node) {
	return (
		node.operator === "!" &&
		node.argument.type === "UnaryExpression" &&
		node.argument.operator === "!"
	);
}

/**
 * Checks whether or not a node is a binary negating of `.indexOf()` method calling.
 * @param {ASTNode} node An UnaryExpression node to check.
 * @returns {boolean} Whether or not the node is a binary negating of `.indexOf()` method calling.
 */
function isBinaryNegatingOfIndexOf(node) {
	if (node.operator !== "~") {
		return false;
	}
	const callNode = astUtils.skipChainExpression(node.argument);

	return (
		callNode.type === "CallExpression" &&
		astUtils.isSpecificMemberAccess(callNode.callee, null, INDEX_OF_PATTERN)
	);
}

/**
 * Checks whether or not a node is a multiplying by one.
 * @param {BinaryExpression} node A BinaryExpression node to check.
 * @returns {boolean} Whether or not the node is a multiplying by one.
 */
function isMultiplyByOne(node) {
	return (
		node.operator === "*" &&
		((node.left.type === "Literal" && node.left.value === 1) ||
			(node.right.type === "Literal" && node.right.value === 1))
	);
}

/**
 * Checks whether the given node logically represents multiplication by a fraction of `1`.
 * For example, `a * 1` in `a * 1 / b` is technically multiplication by `1`, but the
 * whole expression can be logically interpreted as `a * (1 / b)` rather than `(a * 1) / b`.
 * @param {BinaryExpression} node A BinaryExpression node to check.
 * @param {SourceCode} sourceCode The source code object.
 * @returns {boolean} Whether or not the node is a multiplying by a fraction of `1`.
 */
function isMultiplyByFractionOfOne(node, sourceCode) {
	return (
		node.type === "BinaryExpression" &&
		node.operator === "*" &&
		node.right.type === "Literal" &&
		node.right.value === 1 &&
		node.parent.type === "BinaryExpression" &&
		node.parent.operator === "/" &&
		node.parent.left === node &&
		!astUtils.isParenthesised(sourceCode, node)
	);
}

/**
 * Checks whether the result of a node is numeric or not
 * @param {ASTNode} node The node to test
 * @returns {boolean} true if the node is a number literal or a `Number()`, `parseInt` or `parseFloat` call
 */
function isNumeric(node) {
	return (
		(node.type === "Literal" && typeof node.value === "number") ||
		(node.type === "CallExpression" &&
			(node.callee.name === "Number" ||
				node.callee.name === "parseInt" ||
				node.callee.name === "parseFloat"))
	);
}

/**
 * Returns the first non-numeric operand in a BinaryExpression. Designed to be
 * used from bottom to up since it walks up the BinaryExpression trees using
 * node.parent to find the result.
 * @param {BinaryExpression} node The BinaryExpression node to be walked up on
 * @returns {ASTNode|null} The first non-numeric item in the BinaryExpression tree or null
 */
function getNonNumericOperand(node) {
	const left = node.left,
		right = node.right;

	if (right.type !== "BinaryExpression" && !isNumeric(right)) {
		return right;
	}

	if (left.type !== "BinaryExpression" && !isNumeric(left)) {
		return left;
	}

	return null;
}

/**
 * Checks whether an expression evaluates to a string.
 * @param {ASTNode} node node that represents the expression to check.
 * @returns {boolean} Whether or not the expression evaluates to a string.
 */
function isStringType(node) {
	return (
		astUtils.isStringLiteral(node) ||
		(node.type === "CallExpression" &&
			node.callee.type === "Identifier" &&
			node.callee.name === "String")
	);
}

/**
 * Checks whether a node is an empty string literal or not.
 * @param {ASTNode} node The node to check.
 * @returns {boolean} Whether or not the passed in node is an
 * empty string literal or not.
 */
function isEmptyString(node) {
	return (
		astUtils.isStringLiteral(node) &&
		(node.value === "" ||
			(node.type === "TemplateLiteral" &&
				node.quasis.length === 1 &&
				node.quasis[0].value.cooked === ""))
	);
}

/**
 * Checks whether or not a node is a concatenating with an empty string.
 * @param {ASTNode} node A BinaryExpression node to check.
 * @returns {boolean} Whether or not the node is a concatenating with an empty string.
 */
function isConcatWithEmptyString(node) {
	return (
		node.operator === "+" &&
		((isEmptyString(node.left) && !isStringType(node.right)) ||
			(isEmptyString(node.right) && !isStringType(node.left)))
	);
}

/**
 * Checks whether or not a node is appended with an empty string.
 * @param {ASTNode} node An AssignmentExpression node to check.
 * @returns {boolean} Whether or not the node is appended with an empty string.
 */
function isAppendEmptyString(node) {
	return node.operator === "+=" && isEmptyString(node.right);
}

/**
 * Returns the operand that is not an empty string from a flagged BinaryExpression.
 * @param {ASTNode} node The flagged BinaryExpression node to check.
 * @returns {ASTNode} The operand that is not an empty string from a flagged BinaryExpression.
 */
function getNonEmptyOperand(node) {
	return isEmptyString(node.left) ? node.right : node.left;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		hasSuggestions: true,
		type: "suggestion",

		docs: {
			description: "Disallow shorthand type conversions",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/no-implicit-coercion",
		},

		fixable: "code",

		schema: [
			{
				type: "object",
				properties: {
					boolean: {
						type: "boolean",
					},
					number: {
						type: "boolean",
					},
					string: {
						type: "boolean",
					},
					disallowTemplateShorthand: {
						type: "boolean",
					},
					allow: {
						type: "array",
						items: {
							enum: ALLOWABLE_OPERATORS,
						},
						uniqueItems: true,
					},
				},
				additionalProperties: false,
			},
		],

		defaultOptions: [
			{
				allow: [],
				boolean: true,
				disallowTemplateShorthand: false,
				number: true,
				string: true,
			},
		],

		messages: {
			implicitCoercion:
				"Unexpected implicit coercion encountered. Use `{{recommendation}}` instead.",
			useRecommendation: "Use `{{recommendation}}` instead.",
		},
	},

	create(context) {
		const [options] = context.options;
		const sourceCode = context.sourceCode;

		/**
		 * Gets the source text of a node to be used as the argument of a
		 * `Boolean()`, `Number()`, or `String()` call in a recommendation. A
		 * `SequenceExpression` operand must be parenthesized, otherwise its commas
		 * would be parsed as argument separators, which changes the evaluated
		 * operand (for example `!!(a, b)` becomes `Boolean(a, b)`).
		 * @param {ASTNode} node The operand node.
		 * @returns {string} The source text, parenthesized if needed.
		 */
		function getOperandText(node) {
			const text = sourceCode.getText(node);

			return node.type === "SequenceExpression" ? `(${text})` : text;
		}

		/**
		 * Reports an error and autofixes the node
		 * @param {ASTNode} node An ast node to report the error on.
		 * @param {string} recommendation The recommended code for the issue
		 * @param {bool} shouldSuggest Whether this report should offer a suggestion
		 * @param {bool} shouldFix Whether this report should fix the node
		 * @returns {void}
		 */
		function report(node, recommendation, shouldSuggest, shouldFix) {
			/**
			 * Fix function
			 * @param {RuleFixer} fixer The fixer to fix.
			 * @returns {Fix} The fix object.
			 */
			function fix(fixer) {
				const tokenBefore = sourceCode.getTokenBefore(node);

				if (
					tokenBefore?.range[1] === node.range[0] &&
					!astUtils.canTokensBeAdjacent(tokenBefore, recommendation)
				) {
					return fixer.replaceText(node, ` ${recommendation}`);
				}

				return fixer.replaceText(node, recommendation);
			}

			context.report({
				node,
				messageId: "implicitCoercion",
				data: { recommendation },
				fix(fixer) {
					if (!shouldFix) {
						return null;
					}

					return fix(fixer);
				},
				suggest: [
					{
						messageId: "useRecommendation",
						data: { recommendation },
						fix(fixer) {
							if (shouldFix || !shouldSuggest) {
								return null;
							}

							return fix(fixer);
						},
					},
				],
			});
		}

		return {
			UnaryExpression(node) {
				let operatorAllowed;

				// !!foo
				operatorAllowed = options.allow.includes("!!");
				if (
					!operatorAllowed &&
					options.boolean &&
					isDoubleLogicalNegating(node)
				) {
					const recommendation = `Boolean(${getOperandText(node.argument.argument)})`;
					const variable = astUtils.getVariableByName(
						sourceCode.getScope(node),
						"Boolean",
					);
					const booleanExists = variable?.identifiers.length === 0;

					report(node, recommendation, true, booleanExists);
				}

				// ~foo.indexOf(bar)
				operatorAllowed = options.allow.includes("~");
				if (
					!operatorAllowed &&
					options.boolean &&
					isBinaryNegatingOfIndexOf(node)
				) {
					// `foo?.indexOf(bar) !== -1` will be true (== found) if the `foo` is nullish. So use `>= 0` in that case.
					const comparison =
						node.argument.type === "ChainExpression"
							? ">= 0"
							: "!== -1";
					const recommendation = `${sourceCode.getText(node.argument)} ${comparison}`;

					report(node, recommendation, false, false);
				}

				// +foo
				operatorAllowed = options.allow.includes("+");
				if (
					!operatorAllowed &&
					options.number &&
					node.operator === "+" &&
					!isNumeric(node.argument)
				) {
					const recommendation = `Number(${getOperandText(node.argument)})`;

					report(node, recommendation, true, false);
				}

				// -(-foo)
				operatorAllowed = options.allow.includes("- -");
				if (
					!operatorAllowed &&
					options.number &&
					node.operator === "-" &&
					node.argument.type === "UnaryExpression" &&
					node.argument.operator === "-" &&
					!isNumeric(node.argument.argument)
				) {
					const recommendation = `Number(${getOperandText(node.argument.argument)})`;

					report(node, recommendation, true, false);
				}
			},

			// Use `:exit` to prevent double reporting
			"BinaryExpression:exit"(node) {
				let operatorAllowed;

				// 1 * foo
				operatorAllowed = options.allow.includes("*");
				const nonNumericOperand =
					!operatorAllowed &&
					options.number &&
					isMultiplyByOne(node) &&
					!isMultiplyByFractionOfOne(node, sourceCode) &&
					getNonNumericOperand(node);

				if (nonNumericOperand) {
					const recommendation = `Number(${getOperandText(nonNumericOperand)})`;

					report(node, recommendation, true, false);
				}

				// foo - 0
				operatorAllowed = options.allow.includes("-");
				if (
					!operatorAllowed &&
					options.number &&
					node.operator === "-" &&
					node.right.type === "Literal" &&
					node.right.value === 0 &&
					!isNumeric(node.left)
				) {
					const recommendation = `Number(${getOperandText(node.left)})`;

					report(node, recommendation, true, false);
				}

				// "" + foo
				operatorAllowed = options.allow.includes("+");
				if (
					!operatorAllowed &&
					options.string &&
					isConcatWithEmptyString(node)
				) {
					const recommendation = `String(${getOperandText(getNonEmptyOperand(node))})`;

					report(node, recommendation, true, false);
				}
			},

			AssignmentExpression(node) {
				// foo += ""
				const operatorAllowed = options.allow.includes("+");

				if (
					!operatorAllowed &&
					options.string &&
					isAppendEmptyString(node)
				) {
					const code = sourceCode.getText(getNonEmptyOperand(node));
					const recommendation = `${code} = String(${code})`;

					report(node, recommendation, true, false);
				}
			},

			TemplateLiteral(node) {
				if (!options.disallowTemplateShorthand) {
					return;
				}

				// tag`${foo}`
				if (node.parent.type === "TaggedTemplateExpression") {
					return;
				}

				// `` or `${foo}${bar}`
				if (node.expressions.length !== 1) {
					return;
				}

				//  `prefix${foo}`
				if (node.quasis[0].value.cooked !== "") {
					return;
				}

				//  `${foo}postfix`
				if (node.quasis[1].value.cooked !== "") {
					return;
				}

				// if the expression is already a string, then this isn't a coercion
				if (isStringType(node.expressions[0])) {
					return;
				}

				const recommendation = `String(${getOperandText(node.expressions[0])})`;

				report(node, recommendation, true, false);
			},
		};
	},
};
Vx/**
 * @fileoverview Rule to check for implicit global variables, functions and classes.
 * @author Joshua Peek
 */

"use strict";

const ASSIGNMENT_NODES = new Set([
	"AssignmentExpression",
	"ForInStatement",
	"ForOfStatement",
]);

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				lexicalBindings: false,
			},
		],

		docs: {
			description: "Disallow declarations in the global scope",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-implicit-globals",
		},

		schema: [
			{
				type: "object",
				properties: {
					lexicalBindings: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			globalNonLexicalBinding:
				"Unexpected {{kind}} declaration in the global scope, wrap in an IIFE for a local variable, assign as global property for a global variable.",
			globalLexicalBinding:
				"Unexpected {{kind}} declaration in the global scope, wrap in a block or in an IIFE.",
			globalVariableLeak:
				"Global variable leak, declare the variable if it is intended to be local.",
			assignmentToReadonlyGlobal:
				"Unexpected assignment to read-only global variable.",
			redeclarationOfReadonlyGlobal:
				"Unexpected redeclaration of read-only global variable.",
		},
	},

	create(context) {
		const [{ lexicalBindings: checkLexicalBindings }] = context.options;
		const sourceCode = context.sourceCode;

		/**
		 * Reports the node.
		 * @param {ASTNode} node Node to report.
		 * @param {string} messageId Id of the message to report.
		 * @param {string|undefined} kind Declaration kind, can be 'var', 'const', 'let', function or class.
		 * @returns {void}
		 */
		function report(node, messageId, kind) {
			context.report({
				node,
				messageId,
				data: {
					kind,
				},
			});
		}

		return {
			Program(node) {
				const scope = sourceCode.getScope(node);

				scope.variables.forEach(variable => {
					// Only ESLint global variables have the `writable` key.
					const isReadonlyEslintGlobalVariable =
						variable.writeable === false;
					const isWritableEslintGlobalVariable =
						variable.writeable === true;

					if (isWritableEslintGlobalVariable) {
						// Everything is allowed with writable ESLint global variables.
						return;
					}

					// Variables exported by "exported" block comments
					if (variable.eslintExported) {
						return;
					}

					variable.defs.forEach(def => {
						const defNode = def.node;

						if (
							def.type === "FunctionName" ||
							(def.type === "Variable" &&
								def.parent.kind === "var")
						) {
							if (isReadonlyEslintGlobalVariable) {
								report(
									defNode,
									"redeclarationOfReadonlyGlobal",
								);
							} else {
								report(
									defNode,
									"globalNonLexicalBinding",
									def.type === "FunctionName"
										? "function"
										: `'${def.parent.kind}'`,
								);
							}
						}

						if (checkLexicalBindings) {
							if (
								def.type === "ClassName" ||
								(def.type === "Variable" &&
									(def.parent.kind === "let" ||
										def.parent.kind === "const"))
							) {
								if (isReadonlyEslintGlobalVariable) {
									report(
										defNode,
										"redeclarationOfReadonlyGlobal",
									);
								} else {
									report(
										defNode,
										"globalLexicalBinding",
										def.type === "ClassName"
											? "class"
											: `'${def.parent.kind}'`,
									);
								}
							}
						}
					});

					if (
						isReadonlyEslintGlobalVariable &&
						variable.defs.length === 0
					) {
						variable.references.forEach(reference => {
							if (reference.isWrite() && !reference.isRead()) {
								let assignmentParent =
									reference.identifier.parent;

								while (
									assignmentParent &&
									!ASSIGNMENT_NODES.has(assignmentParent.type)
								) {
									assignmentParent = assignmentParent.parent;
								}

								report(
									assignmentParent ?? reference.identifier,
									"assignmentToReadonlyGlobal",
								);
							}
						});
					}
				});

				// Undeclared assigned variables.
				scope.implicit.variables.forEach(variable => {
					// def.node is an AssignmentExpression, ForInStatement or ForOfStatement.
					variable.defs.forEach(def => {
						report(def.node, "globalVariableLeak");
					});
				});
			},
		};
	},
};
}-x/**
 * @fileoverview Rule to flag use of implied eval via setTimeout and setInterval
 * @author James Allardice
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");
const { getStaticValue } = require("@eslint-community/eslint-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow the use of `eval()`-like methods",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-implied-eval",
		},

		schema: [],

		messages: {
			impliedEval:
				"Implied eval. Consider passing a function instead of a string.",
			execScript: "Implied eval. Do not use execScript().",
		},
	},

	create(context) {
		const GLOBAL_CANDIDATES = Object.freeze([
			"global",
			"window",
			"globalThis",
			"self",
		]);
		const EVAL_LIKE_FUNC_PATTERN =
			/^(?:set(?:Interval|Timeout)|execScript)$/u;
		const sourceCode = context.sourceCode;

		/**
		 * Checks whether a node is evaluated as a string or not.
		 * @param {ASTNode} node A node to check.
		 * @returns {boolean} True if the node is evaluated as a string.
		 */
		function isEvaluatedString(node) {
			if (
				(node.type === "Literal" && typeof node.value === "string") ||
				node.type === "TemplateLiteral"
			) {
				return true;
			}
			if (node.type === "BinaryExpression" && node.operator === "+") {
				return (
					isEvaluatedString(node.left) ||
					isEvaluatedString(node.right)
				);
			}
			return false;
		}

		/**
		 * Reports if the `CallExpression` node has evaluated argument.
		 * @param {ASTNode} node A CallExpression to check.
		 * @returns {void}
		 */
		function reportImpliedEvalCallExpression(node) {
			const [firstArgument] = node.arguments;

			if (firstArgument) {
				const staticValue = getStaticValue(
					firstArgument,
					sourceCode.getScope(node),
				);
				const isStaticString =
					staticValue && typeof staticValue.value === "string";
				const isString =
					isStaticString || isEvaluatedString(firstArgument);

				if (isString) {
					const calleeName =
						node.callee.type === "Identifier"
							? node.callee.name
							: astUtils.getStaticPropertyName(node.callee);
					const isExecScript = calleeName === "execScript";
					context.report({
						node,
						messageId: isExecScript ? "execScript" : "impliedEval",
					});
				}
			}
		}

		/**
		 * Reports calls of `implied eval` via the global references.
		 * @param {Variable} globalVar A global variable to check.
		 * @returns {void}
		 */
		function reportImpliedEvalViaGlobal(globalVar) {
			const { references, name } = globalVar;

			references.forEach(ref => {
				const identifier = ref.identifier;
				let node = identifier.parent;

				while (astUtils.isSpecificMemberAccess(node, null, name)) {
					node = node.parent;
				}

				if (
					astUtils.isSpecificMemberAccess(
						node,
						null,
						EVAL_LIKE_FUNC_PATTERN,
					)
				) {
					const calleeNode =
						node.parent.type === "ChainExpression"
							? node.parent
							: node;
					const parent = calleeNode.parent;

					if (
						parent.type === "CallExpression" &&
						parent.callee === calleeNode
					) {
						reportImpliedEvalCallExpression(parent);
					}
				}
			});
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			CallExpression(node) {
				if (
					astUtils.isSpecificId(
						node.callee,
						EVAL_LIKE_FUNC_PATTERN,
					) &&
					sourceCode.isGlobalReference(node.callee)
				) {
					reportImpliedEvalCallExpression(node);
				}
			},
			"Program:exit"(node) {
				const globalScope = sourceCode.getScope(node);

				GLOBAL_CANDIDATES.map(candidate =>
					astUtils.getVariableByName(globalScope, candidate),
				)
					.filter(
						globalVar => !!globalVar && globalVar.defs.length === 0,
					)
					.forEach(reportImpliedEvalViaGlobal);
			},
		};
	},
};
x#/**
 * @fileoverview Rule to flag updates of imported bindings.
 * @author Toru Nagashima <https://github.com/mysticatea>
 */

"use strict";

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const { findVariable } = require("@eslint-community/eslint-utils");
const astUtils = require("./utils/ast-utils");

const WellKnownMutationFunctions = {
	Object: /^(?:assign|definePropert(?:y|ies)|freeze|setPrototypeOf)$/u,
	Reflect: /^(?:(?:define|delete)Property|set(?:PrototypeOf)?)$/u,
};

/**
 * Check if a given node is LHS of an assignment node.
 * @param {ASTNode} node The node to check.
 * @returns {boolean} `true` if the node is LHS.
 */
function isAssignmentLeft(node) {
	const { parent } = node;

	return (
		(parent.type === "AssignmentExpression" && parent.left === node) ||
		// Destructuring assignments
		parent.type === "ArrayPattern" ||
		(parent.type === "Property" &&
			parent.value === node &&
			parent.parent.type === "ObjectPattern") ||
		parent.type === "RestElement" ||
		(parent.type === "AssignmentPattern" && parent.left === node)
	);
}

/**
 * Check if a given node is the operand of mutation unary operator.
 * @param {ASTNode} node The node to check.
 * @returns {boolean} `true` if the node is the operand of mutation unary operator.
 */
function isOperandOfMutationUnaryOperator(node) {
	const argumentNode =
		node.parent.type === "ChainExpression" ? node.parent : node;
	const { parent } = argumentNode;

	return (
		(parent.type === "UpdateExpression" &&
			parent.argument === argumentNode) ||
		(parent.type === "UnaryExpression" &&
			parent.operator === "delete" &&
			parent.argument === argumentNode)
	);
}

/**
 * Check if a given node is the iteration variable of `for-in`/`for-of` syntax.
 * @param {ASTNode} node The node to check.
 * @returns {boolean} `true` if the node is the iteration variable.
 */
function isIterationVariable(node) {
	const { parent } = node;

	return (
		(parent.type === "ForInStatement" && parent.left === node) ||
		(parent.type === "ForOfStatement" && parent.left === node)
	);
}

/**
 * Check if a given node is at the first argument of a well-known mutation function.
 * - `Object.assign`
 * - `Object.defineProperty`
 * - `Object.defineProperties`
 * - `Object.freeze`
 * - `Object.setPrototypeOf`
 * - `Reflect.defineProperty`
 * - `Reflect.deleteProperty`
 * - `Reflect.set`
 * - `Reflect.setPrototypeOf`
 * @param {ASTNode} node The node to check.
 * @param {Scope} scope A `escope.Scope` object to find variable (whichever).
 * @returns {boolean} `true` if the node is at the first argument of a well-known mutation function.
 */
function isArgumentOfWellKnownMutationFunction(node, scope) {
	const { parent } = node;

	if (parent.type !== "CallExpression" || parent.arguments[0] !== node) {
		return false;
	}
	const callee = astUtils.skipChainExpression(parent.callee);

	if (
		!astUtils.isSpecificMemberAccess(
			callee,
			"Object",
			WellKnownMutationFunctions.Object,
		) &&
		!astUtils.isSpecificMemberAccess(
			callee,
			"Reflect",
			WellKnownMutationFunctions.Reflect,
		)
	) {
		return false;
	}
	const variable = findVariable(scope, callee.object);

	return variable !== null && variable.scope.type === "global";
}

/**
 * Check if the identifier node is placed at to update members.
 * @param {ASTNode} id The Identifier node to check.
 * @param {Scope} scope A `escope.Scope` object to find variable (whichever).
 * @returns {boolean} `true` if the member of `id` was updated.
 */
function isMemberWrite(id, scope) {
	const { parent } = id;

	return (
		(parent.type === "MemberExpression" &&
			parent.object === id &&
			(isAssignmentLeft(parent) ||
				isOperandOfMutationUnaryOperator(parent) ||
				isIterationVariable(parent))) ||
		isArgumentOfWellKnownMutationFunction(id, scope)
	);
}

/**
 * Get the mutation node.
 * @param {ASTNode} id The Identifier node to get.
 * @returns {ASTNode} The mutation node.
 */
function getWriteNode(id) {
	let node = id.parent;

	while (
		node &&
		node.type !== "AssignmentExpression" &&
		node.type !== "UpdateExpression" &&
		node.type !== "UnaryExpression" &&
		node.type !== "CallExpression" &&
		node.type !== "ForInStatement" &&
		node.type !== "ForOfStatement"
	) {
		node = node.parent;
	}

	return node || id;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description: "Disallow assigning to imported bindings",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-import-assign",
		},

		schema: [],

		messages: {
			readonly: "'{{name}}' is read-only.",
			readonlyMember: "The members of '{{name}}' are read-only.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		return {
			ImportDeclaration(node) {
				const scope = sourceCode.getScope(node);

				for (const variable of sourceCode.getDeclaredVariables(node)) {
					const shouldCheckMembers = variable.defs.some(
						d => d.node.type === "ImportNamespaceSpecifier",
					);
					let prevIdNode = null;

					for (const reference of variable.references) {
						const idNode = reference.identifier;

						/*
						 * AssignmentPattern (e.g. `[a = 0] = b`) makes two write
						 * references for the same identifier. This should skip
						 * the one of the two in order to prevent redundant reports.
						 */
						if (idNode === prevIdNode) {
							continue;
						}
						prevIdNode = idNode;

						if (reference.isWrite()) {
							context.report({
								node: getWriteNode(idNode),
								messageId: "readonly",
								data: { name: idNode.name },
							});
						} else if (
							shouldCheckMembers &&
							isMemberWrite(idNode, scope)
						) {
							context.report({
								node: getWriteNode(idNode),
								messageId: "readonlyMember",
								data: { name: idNode.name },
							});
						}
					}
				}
			},
		};
	},
};
Їx
|/**
 * @fileoverview Enforces or disallows inline comments.
 * @author Greg Cochard
 */
"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [{}],

		docs: {
			description: "Disallow inline comments after code",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/no-inline-comments",
		},

		schema: [
			{
				type: "object",
				properties: {
					ignorePattern: {
						type: "string",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			unexpectedInlineComment: "Unexpected comment inline with code.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const [{ ignorePattern }] = context.options;
		const customIgnoreRegExp =
			ignorePattern && new RegExp(ignorePattern, "u");

		/**
		 * Will check that comments are not on lines starting with or ending with code
		 * @param {ASTNode} node The comment node to check
		 * @private
		 * @returns {void}
		 */
		function testCodeAroundComment(node) {
			const startLine = String(sourceCode.lines[node.loc.start.line - 1]),
				endLine = String(sourceCode.lines[node.loc.end.line - 1]),
				preamble = startLine.slice(0, node.loc.start.column).trim(),
				postamble = endLine.slice(node.loc.end.column).trim(),
				isPreambleEmpty = !preamble,
				isPostambleEmpty = !postamble;

			// Nothing on both sides
			if (isPreambleEmpty && isPostambleEmpty) {
				return;
			}

			// Matches the ignore pattern
			if (customIgnoreRegExp && customIgnoreRegExp.test(node.value)) {
				return;
			}

			// JSX Exception
			if (
				(isPreambleEmpty || preamble === "{") &&
				(isPostambleEmpty || postamble === "}")
			) {
				const enclosingNode = sourceCode.getNodeByRangeIndex(
					node.range[0],
				);

				if (
					enclosingNode &&
					enclosingNode.type === "JSXEmptyExpression"
				) {
					return;
				}
			}

			// Don't report ESLint directive comments
			if (astUtils.isDirectiveComment(node)) {
				return;
			}

			context.report({
				node,
				messageId: "unexpectedInlineComment",
			});
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			Program() {
				sourceCode
					.getAllComments()
					.filter(token => token.type !== "Shebang")
					.forEach(testCodeAroundComment);
			},
		};
	},
};
r~xj/**
 * @fileoverview Rule to enforce declarations in program or function body root.
 * @author Brandon Mills
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

const validParent = new Set([
	"Program",
	"StaticBlock",
	"ExportNamedDeclaration",
	"ExportDefaultDeclaration",
]);
const validBlockStatementParent = new Set([
	"FunctionDeclaration",
	"FunctionExpression",
	"ArrowFunctionExpression",
]);

/**
 * Finds the nearest enclosing context where this rule allows declarations and returns its description.
 * @param {ASTNode} node Node to search from.
 * @returns {string} Description. One of "program", "function body", "class static block body".
 */
function getAllowedBodyDescription(node) {
	let { parent } = node;

	while (parent) {
		if (parent.type === "StaticBlock") {
			return "class static block body";
		}

		if (astUtils.isFunction(parent)) {
			return "function body";
		}

		({ parent } = parent);
	}

	return "program";
}

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		defaultOptions: ["functions", { blockScopedFunctions: "allow" }],

		docs: {
			description:
				"Disallow variable or `function` declarations in nested blocks",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-inner-declarations",
		},

		schema: [
			{
				enum: ["functions", "both"],
			},
			{
				type: "object",
				properties: {
					blockScopedFunctions: {
						enum: ["allow", "disallow"],
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			moveDeclToRoot: "Move {{type}} declaration to {{body}} root.",
		},
	},

	create(context) {
		const both = context.options[0] === "both";
		const { blockScopedFunctions } = context.options[1];

		const sourceCode = context.sourceCode;
		const ecmaVersion = context.languageOptions.ecmaVersion;

		/**
		 * Ensure that a given node is at a program or function body's root.
		 * @param {ASTNode} node Declaration node to check.
		 * @returns {void}
		 */
		function check(node) {
			const parent = node.parent;

			if (
				parent.type === "BlockStatement" &&
				validBlockStatementParent.has(parent.parent.type)
			) {
				return;
			}

			if (validParent.has(parent.type)) {
				return;
			}

			context.report({
				node,
				messageId: "moveDeclToRoot",
				data: {
					type:
						node.type === "FunctionDeclaration"
							? "function"
							: "variable",
					body: getAllowedBodyDescription(node),
				},
			});
		}

		return {
			FunctionDeclaration(node) {
				const isInStrictCode = sourceCode.getScope(node).upper.isStrict;

				if (
					blockScopedFunctions === "allow" &&
					ecmaVersion >= 2015 &&
					isInStrictCode
				) {
					return;
				}

				check(node);
			},
			VariableDeclaration(node) {
				if (both && node.kind === "var") {
					check(node);
				}
			},
		};
	},
};
4Fx@/**
 * @fileoverview Validate strings passed to the RegExp constructor
 * @author Michael Ficarra
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const RegExpValidator = require("@eslint-community/regexpp").RegExpValidator;
const validator = new RegExpValidator();
const validFlags = "dgimsuvy";
const undefined1 = void 0;

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		defaultOptions: [{}],

		docs: {
			description:
				"Disallow invalid regular expression strings in `RegExp` constructors",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-invalid-regexp",
		},

		schema: [
			{
				type: "object",
				properties: {
					allowConstructorFlags: {
						type: "array",
						items: {
							type: "string",
						},
						uniqueItems: true,
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			regexMessage: "{{message}}.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const [{ allowConstructorFlags }] = context.options;
		let allowedFlags = [];

		if (allowConstructorFlags) {
			const temp = allowConstructorFlags
				.join("")
				.replace(new RegExp(`[${validFlags}]`, "gu"), "");

			if (temp) {
				allowedFlags = [...new Set(temp)];
			}
		}

		/**
		 * Reports error with the provided message.
		 * @param {ASTNode} node The node holding the invalid RegExp
		 * @param {string} message The message to report.
		 * @returns {void}
		 */
		function report(node, message) {
			context.report({
				node,
				messageId: "regexMessage",
				data: { message },
			});
		}

		/**
		 * Check if node is a string
		 * @param {ASTNode} node node to evaluate
		 * @returns {boolean} True if its a string
		 * @private
		 */
		function isString(node) {
			return (
				node &&
				node.type === "Literal" &&
				typeof node.value === "string"
			);
		}

		/**
		 * Gets flags of a regular expression created by the given `RegExp()` or `new RegExp()` call
		 * Examples:
		 *     new RegExp(".")         // => ""
		 *     new RegExp(".", "gu")   // => "gu"
		 *     new RegExp(".", flags)  // => null
		 * @param {ASTNode} node `CallExpression` or `NewExpression` node
		 * @returns {string|null} flags if they can be determined, `null` otherwise
		 * @private
		 */
		function getFlags(node) {
			if (node.arguments.length < 2) {
				return "";
			}

			if (isString(node.arguments[1])) {
				return node.arguments[1].value;
			}

			return null;
		}

		/**
		 * Check syntax error in a given pattern.
		 * @param {string} pattern The RegExp pattern to validate.
		 * @param {Object} flags The RegExp flags to validate.
		 * @param {boolean} [flags.unicode] The Unicode flag.
		 * @param {boolean} [flags.unicodeSets] The UnicodeSets flag.
		 * @returns {string|null} The syntax error.
		 */
		function validateRegExpPattern(pattern, flags) {
			try {
				validator.validatePattern(
					pattern,
					undefined1,
					undefined1,
					flags,
				);
				return null;
			} catch (err) {
				return err.message;
			}
		}

		/**
		 * Check syntax error in a given flags.
		 * @param {string|null} flags The RegExp flags to validate.
		 * @param {string|null} flagsToCheck The RegExp invalid flags.
		 * @param {string} allFlags all valid and allowed flags.
		 * @returns {string|null} The syntax error.
		 */
		function validateRegExpFlags(flags, flagsToCheck, allFlags) {
			const duplicateFlags = [];

			if (typeof flagsToCheck === "string") {
				for (const flag of flagsToCheck) {
					if (allFlags.includes(flag)) {
						duplicateFlags.push(flag);
					}
				}
			}

			/*
			 * `regexpp` checks the combination of `u` and `v` flags when parsing `Pattern` according to `ecma262`,
			 * but this rule may check only the flag when the pattern is unidentifiable, so check it here.
			 * https://tc39.es/ecma262/multipage/text-processing.html#sec-parsepattern
			 */
			if (flags && flags.includes("u") && flags.includes("v")) {
				return "Regex 'u' and 'v' flags cannot be used together";
			}

			if (duplicateFlags.length > 0) {
				return `Duplicate flags ('${duplicateFlags.join("")}') supplied to RegExp constructor`;
			}

			if (!flagsToCheck) {
				return null;
			}

			return `Invalid flags supplied to RegExp constructor '${flagsToCheck}'`;
		}

		return {
			"CallExpression, NewExpression"(node) {
				if (
					node.callee.type !== "Identifier" ||
					node.callee.name !== "RegExp" ||
					!sourceCode.isGlobalReference(node.callee)
				) {
					return;
				}

				const flags = getFlags(node);
				let flagsToCheck = flags;
				const allFlags =
					allowedFlags.length > 0
						? validFlags.split("").concat(allowedFlags)
						: validFlags.split("");

				if (flags) {
					allFlags.forEach(flag => {
						flagsToCheck = flagsToCheck.replace(flag, "");
					});
				}

				let message = validateRegExpFlags(
					flags,
					flagsToCheck,
					allFlags,
				);

				if (message) {
					report(node, message);
					return;
				}

				if (!isString(node.arguments[0])) {
					return;
				}

				const pattern = node.arguments[0].value;

				message =
					// If flags are unknown, report the regex only if its pattern is invalid both with and without the "u" flag
					flags === null
						? validateRegExpPattern(pattern, {
								unicode: true,
								unicodeSets: false,
							}) &&
							validateRegExpPattern(pattern, {
								unicode: false,
								unicodeSets: true,
							}) &&
							validateRegExpPattern(pattern, {
								unicode: false,
								unicodeSets: false,
							})
						: validateRegExpPattern(pattern, {
								unicode: flags.includes("u"),
								unicodeSets: flags.includes("v"),
							});

				if (message) {
					report(node, message);
				}
			},
		};
	},
};
Rxo/**
 * @fileoverview A rule to disallow `this` keywords in contexts where the value of `this` is `undefined`.
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Determines if the given code path is a code path with lexical `this` binding.
 * That is, if `this` within the code path refers to `this` of surrounding code path.
 * @param {CodePath} codePath Code path.
 * @param {ASTNode} node Node that started the code path.
 * @returns {boolean} `true` if it is a code path with lexical `this` binding.
 */
function isCodePathWithLexicalThis(codePath, node) {
	return (
		codePath.origin === "function" &&
		node.type === "ArrowFunctionExpression"
	);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [{ capIsConstructor: true }],

		docs: {
			description:
				"Disallow use of `this` in contexts where the value of `this` is `undefined`",
			dialects: ["JavaScript", "TypeScript"],
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-invalid-this",
		},

		schema: [
			{
				type: "object",
				properties: {
					capIsConstructor: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			unexpectedThis: "Unexpected 'this'.",
		},
	},

	create(context) {
		const [{ capIsConstructor }] = context.options;
		const stack = [],
			sourceCode = context.sourceCode;

		/**
		 * Gets the current checking context.
		 *
		 * The return value has a flag that whether or not `this` keyword is valid.
		 * The flag is initialized when got at the first time.
		 * @returns {{valid: boolean}}
		 *   an object which has a flag that whether or not `this` keyword is valid.
		 */
		stack.getCurrent = function () {
			const current = this.at(-1);

			if (!current.init) {
				current.init = true;
				current.valid = !astUtils.isDefaultThisBinding(
					current.node,
					sourceCode,
					{ capIsConstructor },
				);
			}
			return current;
		};

		return {
			onCodePathStart(codePath, node) {
				if (isCodePathWithLexicalThis(codePath, node)) {
					return;
				}

				if (codePath.origin === "program") {
					const scope = sourceCode.getScope(node);
					const features =
						context.languageOptions.parserOptions.ecmaFeatures ||
						{};

					// `this` at the top level of scripts always refers to the global object
					stack.push({
						init: true,
						node,
						valid: !(
							node.sourceType === "module" ||
							(features.globalReturn &&
								scope.childScopes[0].isStrict)
						),
					});

					return;
				}

				/*
				 * `init: false` means that `valid` isn't determined yet.
				 * Most functions don't use `this`, and the calculation for `valid`
				 * is relatively costly, so we'll calculate it lazily when the first
				 * `this` within the function is traversed. A special case are non-strict
				 * functions, because `this` refers to the global object and therefore is
				 * always valid, so we can set `init: true` right away.
				 */
				stack.push({
					init: !sourceCode.getScope(node).isStrict,
					node,
					valid: true,
				});
			},

			onCodePathEnd(codePath, node) {
				if (isCodePathWithLexicalThis(codePath, node)) {
					return;
				}

				stack.pop();
			},

			"AccessorProperty > *.value"(node) {
				stack.push({
					init: true,
					node,
					valid: true,
				});
			},

			"AccessorProperty:exit"() {
				stack.pop();
			},

			// Reports if `this` of the current context is invalid.
			ThisExpression(node) {
				// Special case: skip `this` if it's the value of an AccessorProperty
				if (
					node.parent.type === "AccessorProperty" &&
					node.parent.value === node
				) {
					return;
				}

				const current = stack.getCurrent();

				if (current && !current.valid) {
					context.report({
						node,
						messageId: "unexpectedThis",
					});
				}
			},
		};
	},
};
nxR/**
 * @fileoverview Rule to disallow whitespace that is not a tab or space, whitespace inside strings and comments are allowed
 * @author Jonathan Kingston
 * @author Christophe Porteneuve
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Constants
//------------------------------------------------------------------------------

const ALL_IRREGULARS =
	/[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000\u2028\u2029]/u;
const IRREGULAR_WHITESPACE =
	/[\f\v\u0085\ufeff\u00a0\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u202f\u205f\u3000]+/gu;
const IRREGULAR_LINE_TERMINATORS = /[\u2028\u2029]/gu;
const LINE_BREAK = astUtils.createGlobalLinebreakMatcher();

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		defaultOptions: [
			{
				skipComments: false,
				skipJSXText: false,
				skipRegExps: false,
				skipStrings: true,
				skipTemplates: false,
			},
		],

		docs: {
			description: "Disallow irregular whitespace",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-irregular-whitespace",
		},

		schema: [
			{
				type: "object",
				properties: {
					skipComments: {
						type: "boolean",
					},
					skipStrings: {
						type: "boolean",
					},
					skipTemplates: {
						type: "boolean",
					},
					skipRegExps: {
						type: "boolean",
					},
					skipJSXText: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			noIrregularWhitespace: "Irregular whitespace not allowed.",
		},
	},

	create(context) {
		const [
			{
				skipComments,
				skipStrings,
				skipRegExps,
				skipTemplates,
				skipJSXText,
			},
		] = context.options;

		const sourceCode = context.sourceCode;
		const commentNodes = sourceCode.getAllComments();

		// Module store of errors that we have found
		let errors = [];

		/**
		 * Removes errors that occur inside the given node
		 * @param {ASTNode} node to check for matching errors.
		 * @returns {void}
		 * @private
		 */
		function removeWhitespaceError(node) {
			const locStart = node.loc.start;
			const locEnd = node.loc.end;

			errors = errors.filter(
				({ loc: { start: errorLocStart } }) =>
					errorLocStart.line < locStart.line ||
					(errorLocStart.line === locStart.line &&
						errorLocStart.column < locStart.column) ||
					(errorLocStart.line === locEnd.line &&
						errorLocStart.column >= locEnd.column) ||
					errorLocStart.line > locEnd.line,
			);
		}

		/**
		 * Checks literal nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors
		 * @param {ASTNode} node to check for matching errors.
		 * @returns {void}
		 * @private
		 */
		function removeInvalidNodeErrorsInLiteral(node) {
			const shouldCheckStrings =
				skipStrings && typeof node.value === "string";
			const shouldCheckRegExps = skipRegExps && Boolean(node.regex);

			if (shouldCheckStrings || shouldCheckRegExps) {
				// If we have irregular characters remove them from the errors list
				if (ALL_IRREGULARS.test(node.raw)) {
					removeWhitespaceError(node);
				}
			}
		}

		/**
		 * Checks template string literal nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors
		 * @param {ASTNode} node to check for matching errors.
		 * @returns {void}
		 * @private
		 */
		function removeInvalidNodeErrorsInTemplateLiteral(node) {
			if (typeof node.value.raw === "string") {
				if (ALL_IRREGULARS.test(node.value.raw)) {
					removeWhitespaceError(node);
				}
			}
		}

		/**
		 * Checks comment nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors
		 * @param {ASTNode} node to check for matching errors.
		 * @returns {void}
		 * @private
		 */
		function removeInvalidNodeErrorsInComment(node) {
			if (ALL_IRREGULARS.test(node.value)) {
				removeWhitespaceError(node);
			}
		}

		/**
		 * Checks JSX nodes for errors that we are choosing to ignore and calls the relevant methods to remove the errors
		 * @param {ASTNode} node to check for matching errors.
		 * @returns {void}
		 * @private
		 */
		function removeInvalidNodeErrorsInJSXText(node) {
			if (ALL_IRREGULARS.test(node.raw)) {
				removeWhitespaceError(node);
			}
		}

		/**
		 * Checks the program source for irregular whitespace
		 * @param {ASTNode} node The program node
		 * @returns {void}
		 * @private
		 */
		function checkForIrregularWhitespace(node) {
			const sourceLines = sourceCode.lines;

			sourceLines.forEach((sourceLine, lineIndex) => {
				const lineNumber = lineIndex + 1;
				let match;

				while (
					(match = IRREGULAR_WHITESPACE.exec(sourceLine)) !== null
				) {
					errors.push({
						node,
						messageId: "noIrregularWhitespace",
						loc: {
							start: {
								line: lineNumber,
								column: match.index,
							},
							end: {
								line: lineNumber,
								column: match.index + match[0].length,
							},
						},
					});
				}
			});
		}

		/**
		 * Checks the program source for irregular line terminators
		 * @param {ASTNode} node The program node
		 * @returns {void}
		 * @private
		 */
		function checkForIrregularLineTerminators(node) {
			const source = sourceCode.getText(),
				sourceLines = sourceCode.lines,
				linebreaks = source.match(LINE_BREAK);
			let lastLineIndex = -1,
				match;

			while ((match = IRREGULAR_LINE_TERMINATORS.exec(source)) !== null) {
				const lineIndex =
					linebreaks.indexOf(match[0], lastLineIndex + 1) || 0;

				errors.push({
					node,
					messageId: "noIrregularWhitespace",
					loc: {
						start: {
							line: lineIndex + 1,
							column: sourceLines[lineIndex].length,
						},
						end: {
							line: lineIndex + 2,
							column: 0,
						},
					},
				});

				lastLineIndex = lineIndex;
			}
		}

		/**
		 * A no-op function to act as placeholder for comment accumulation when the `skipComments` option is `false`.
		 * @returns {void}
		 * @private
		 */
		function noop() {}

		const nodes = {};

		if (ALL_IRREGULARS.test(sourceCode.getText())) {
			nodes.Program = function (node) {
				/*
				 * As we can easily fire warnings for all white space issues with
				 * all the source its simpler to fire them here.
				 * This means we can check all the application code without having
				 * to worry about issues caused in the parser tokens.
				 * When writing this code also evaluating per node was missing out
				 * connecting tokens in some cases.
				 * We can later filter the errors when they are found to be not an
				 * issue in nodes we don't care about.
				 */
				checkForIrregularWhitespace(node);
				checkForIrregularLineTerminators(node);
			};

			nodes.Literal = removeInvalidNodeErrorsInLiteral;
			nodes.TemplateElement = skipTemplates
				? removeInvalidNodeErrorsInTemplateLiteral
				: noop;
			nodes.JSXText = skipJSXText
				? removeInvalidNodeErrorsInJSXText
				: noop;
			nodes["Program:exit"] = function () {
				if (skipComments) {
					// First strip errors occurring in comment nodes.
					commentNodes.forEach(removeInvalidNodeErrorsInComment);
				}

				// If we have any errors remaining report on them
				errors.forEach(error => context.report(error));
			};
		} else {
			nodes.Program = noop;
		}

		return nodes;
	},
};
-pExV/**
 * @fileoverview Rule to flag usage of __iterator__ property
 * @author Ian Christian Myers
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const { getStaticPropertyName } = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow the use of the `__iterator__` property",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-iterator",
		},

		schema: [],

		messages: {
			noIterator: "Reserved name '__iterator__'.",
		},
	},

	create(context) {
		return {
			MemberExpression(node) {
				if (getStaticPropertyName(node) === "__iterator__") {
					context.report({
						node,
						messageId: "noIterator",
					});
				}
			},
		};
	},
};
z).x%/**
 * @fileoverview Disallow Labeled Statements
 * @author Nicholas C. Zakas
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				allowLoop: false,
				allowSwitch: false,
			},
		],

		docs: {
			description: "Disallow labeled statements",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/no-labels",
		},

		schema: [
			{
				type: "object",
				properties: {
					allowLoop: {
						type: "boolean",
					},
					allowSwitch: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			unexpectedLabel: "Unexpected labeled statement.",
			unexpectedLabelInBreak: "Unexpected label in break statement.",
			unexpectedLabelInContinue:
				"Unexpected label in continue statement.",
		},
	},

	create(context) {
		const [{ allowLoop, allowSwitch }] = context.options;
		let scopeInfo = null;

		/**
		 * Gets the kind of a given node.
		 * @param {ASTNode} node A node to get.
		 * @returns {string} The kind of the node.
		 */
		function getBodyKind(node) {
			if (astUtils.isLoop(node)) {
				return "loop";
			}
			if (node.type === "SwitchStatement") {
				return "switch";
			}
			return "other";
		}

		/**
		 * Checks whether the label of a given kind is allowed or not.
		 * @param {string} kind A kind to check.
		 * @returns {boolean} `true` if the kind is allowed.
		 */
		function isAllowed(kind) {
			switch (kind) {
				case "loop":
					return allowLoop;
				case "switch":
					return allowSwitch;
				default:
					return false;
			}
		}

		/**
		 * Checks whether a given name is a label of a loop or not.
		 * @param {string} label A name of a label to check.
		 * @returns {boolean} `true` if the name is a label of a loop.
		 */
		function getKind(label) {
			let info = scopeInfo;

			while (info) {
				if (info.label === label) {
					return info.kind;
				}
				info = info.upper;
			}

			/* c8 ignore next */
			return "other";
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			LabeledStatement(node) {
				scopeInfo = {
					label: node.label.name,
					kind: getBodyKind(node.body),
					upper: scopeInfo,
				};
			},

			"LabeledStatement:exit"(node) {
				if (!isAllowed(scopeInfo.kind)) {
					context.report({
						node,
						messageId: "unexpectedLabel",
					});
				}

				scopeInfo = scopeInfo.upper;
			},

			BreakStatement(node) {
				if (node.label && !isAllowed(getKind(node.label.name))) {
					context.report({
						node,
						messageId: "unexpectedLabelInBreak",
					});
				}
			},

			ContinueStatement(node) {
				if (node.label && !isAllowed(getKind(node.label.name))) {
					context.report({
						node,
						messageId: "unexpectedLabelInContinue",
					});
				}
			},
		};
	},
};
jx/**
 * @fileoverview Rule to flag blocks with no reason to exist
 * @author Brandon Mills
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow unnecessary nested blocks",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-lone-blocks",
		},

		schema: [],

		messages: {
			redundantBlock: "Block is redundant.",
			redundantNestedBlock: "Nested block is redundant.",
		},
	},

	create(context) {
		// A stack of lone blocks to be checked for block-level bindings
		const loneBlocks = [];
		let ruleDef;
		const sourceCode = context.sourceCode;

		/**
		 * Reports a node as invalid.
		 * @param {ASTNode} node The node to be reported.
		 * @returns {void}
		 */
		function report(node) {
			const messageId =
				node.parent.type === "BlockStatement" ||
				node.parent.type === "StaticBlock"
					? "redundantNestedBlock"
					: "redundantBlock";

			context.report({
				node,
				messageId,
			});
		}

		/**
		 * Checks for any occurrence of a BlockStatement in a place where lists of statements can appear
		 * @param {ASTNode} node The node to check
		 * @returns {boolean} True if the node is a lone block.
		 */
		function isLoneBlock(node) {
			return (
				node.parent.type === "BlockStatement" ||
				node.parent.type === "StaticBlock" ||
				node.parent.type === "Program" ||
				// Don't report blocks in switch cases if the block is the only statement of the case.
				(node.parent.type === "SwitchCase" &&
					!(
						node.parent.consequent[0] === node &&
						node.parent.consequent.length === 1
					))
			);
		}

		/**
		 * Checks the enclosing block of the current node for block-level bindings,
		 * and "marks it" as valid if any.
		 * @param {ASTNode} node The current node to check.
		 * @returns {void}
		 */
		function markLoneBlock(node) {
			if (loneBlocks.length === 0) {
				return;
			}

			const block = node.parent;

			if (loneBlocks.at(-1) === block) {
				loneBlocks.pop();
			}
		}

		// Default rule definition: report all lone blocks
		ruleDef = {
			BlockStatement(node) {
				if (isLoneBlock(node)) {
					report(node);
				}
			},
		};

		// ES6: report blocks without block-level bindings, or that's only child of another block
		if (context.languageOptions.ecmaVersion >= 2015) {
			ruleDef = {
				BlockStatement(node) {
					if (isLoneBlock(node)) {
						loneBlocks.push(node);
					}
				},
				"BlockStatement:exit"(node) {
					if (loneBlocks.length > 0 && loneBlocks.at(-1) === node) {
						loneBlocks.pop();
						report(node);
					} else if (
						(node.parent.type === "BlockStatement" ||
							node.parent.type === "StaticBlock") &&
						node.parent.body.length === 1
					) {
						report(node);
					}
				},
			};

			ruleDef.VariableDeclaration = function (node) {
				if (node.kind !== "var") {
					markLoneBlock(node);
				}
			};

			ruleDef.FunctionDeclaration = function (node) {
				if (sourceCode.getScope(node).isStrict) {
					markLoneBlock(node);
				}
			};

			ruleDef.ClassDeclaration = markLoneBlock;
		}

		return ruleDef;
	},
};
vIx/**
 * @fileoverview Rule to disallow if as the only statement in an else block
 * @author Brandon Mills
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Disallow `if` statements as the only statement in `else` blocks",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/no-lonely-if",
		},

		schema: [],
		fixable: "code",

		messages: {
			unexpectedLonelyIf:
				"Unexpected if as the only statement in an else block.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		return {
			IfStatement(node) {
				const parent = node.parent,
					grandparent = parent.parent;

				if (
					parent &&
					parent.type === "BlockStatement" &&
					parent.body.length === 1 &&
					!astUtils.areBracesNecessary(parent, sourceCode) &&
					grandparent &&
					grandparent.type === "IfStatement" &&
					parent === grandparent.alternate
				) {
					context.report({
						node,
						messageId: "unexpectedLonelyIf",
						fix(fixer) {
							const openingElseCurly =
								sourceCode.getFirstToken(parent);
							const closingElseCurly =
								sourceCode.getLastToken(parent);
							const elseKeyword =
								sourceCode.getTokenBefore(openingElseCurly);
							const tokenAfterElseBlock =
								sourceCode.getTokenAfter(closingElseCurly);
							const lastIfToken = sourceCode.getLastToken(
								node.consequent,
							);
							const sourceText = sourceCode.getText();

							if (
								sourceText
									.slice(
										openingElseCurly.range[1],
										node.range[0],
									)
									.trim() ||
								sourceText
									.slice(
										node.range[1],
										closingElseCurly.range[0],
									)
									.trim()
							) {
								// Don't fix if there are any non-whitespace characters interfering (e.g. comments)
								return null;
							}

							if (
								node.consequent.type !== "BlockStatement" &&
								lastIfToken.value !== ";" &&
								tokenAfterElseBlock &&
								(node.consequent.loc.end.line ===
									tokenAfterElseBlock.loc.start.line ||
									/^[([/+`-]/u.test(
										tokenAfterElseBlock.value,
									) ||
									lastIfToken.value === "++" ||
									lastIfToken.value === "--")
							) {
								/*
								 * If the `if` statement has no block, and is not followed by a semicolon, make sure that fixing
								 * the issue would not change semantics due to ASI. If this would happen, don't do a fix.
								 */
								return null;
							}

							return fixer.replaceTextRange(
								[
									openingElseCurly.range[0],
									closingElseCurly.range[1],
								],
								(elseKeyword.range[1] ===
								openingElseCurly.range[0]
									? " "
									: "") + sourceCode.getText(node),
							);
						},
					});
				}
			},
		};
	},
};
vx2/**
 * @fileoverview Rule to flag creation of function inside a loop
 * @author Ilya Volodin
 */

"use strict";

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @typedef {import("eslint-scope").Reference} Reference */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const CONSTANT_BINDINGS = new Set(["const", "using", "await using"]);

/**
 * Identifies is a node is a FunctionExpression which is part of an IIFE
 * @param {ASTNode} node Node to test
 * @returns {boolean} True if it's an IIFE
 */
function isIIFE(node) {
	return (
		(node.type === "FunctionExpression" ||
			node.type === "ArrowFunctionExpression") &&
		node.parent &&
		node.parent.type === "CallExpression" &&
		node.parent.callee === node
	);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Disallow function declarations that contain unsafe references inside loop statements",
			dialects: ["JavaScript", "TypeScript"],
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-loop-func",
		},

		schema: [],

		messages: {
			unsafeRefs:
				"Function declared in a loop contains unsafe references to variable(s) {{ varNames }}.",
		},
	},

	create(context) {
		const SKIPPED_IIFE_NODES = new Set();
		const sourceCode = context.sourceCode;

		/**
		 * Gets the containing loop node of a specified node.
		 *
		 * We don't need to check nested functions, so this ignores those, with the exception of IIFE.
		 * `Scope.through` contains references of nested functions.
		 * @param {ASTNode} node An AST node to get.
		 * @returns {ASTNode|null} The containing loop node of the specified node, or
		 *      `null`.
		 */
		function getContainingLoopNode(node) {
			for (
				let currentNode = node;
				currentNode.parent;
				currentNode = currentNode.parent
			) {
				const parent = currentNode.parent;

				switch (parent.type) {
					case "WhileStatement":
					case "DoWhileStatement":
						return parent;

					case "ForStatement":
						// `init` is outside of the loop.
						if (parent.init !== currentNode) {
							return parent;
						}
						break;

					case "ForInStatement":
					case "ForOfStatement":
						// `right` is outside of the loop.
						if (parent.right !== currentNode) {
							return parent;
						}
						break;

					case "ArrowFunctionExpression":
					case "FunctionExpression":
					case "FunctionDeclaration":
						// We need to check nested functions only in case of IIFE.
						if (SKIPPED_IIFE_NODES.has(parent)) {
							break;
						}

						return null;
					default:
						break;
				}
			}

			return null;
		}

		/**
		 * Gets the containing loop node of a given node.
		 * If the loop was nested, this returns the most outer loop.
		 * @param {ASTNode} node A node to get. This is a loop node.
		 * @param {ASTNode|null} excludedNode A node that the result node should not
		 *      include.
		 * @returns {ASTNode} The most outer loop node.
		 */
		function getTopLoopNode(node, excludedNode) {
			const border = excludedNode ? excludedNode.range[1] : 0;
			let retv = node;
			let containingLoopNode = node;

			while (
				containingLoopNode &&
				containingLoopNode.range[0] >= border
			) {
				retv = containingLoopNode;
				containingLoopNode = getContainingLoopNode(containingLoopNode);
			}

			return retv;
		}

		/**
		 * Checks whether a given reference which refers to an upper scope's variable is
		 * safe or not.
		 * @param {ASTNode} loopNode A containing loop node.
		 * @param {Reference} reference A reference to check.
		 * @returns {boolean} `true` if the reference is safe or not.
		 */
		function isSafe(loopNode, reference) {
			const variable = reference.resolved;
			const definition = variable && variable.defs[0];
			const declaration = definition && definition.parent;
			const kind =
				declaration && declaration.type === "VariableDeclaration"
					? declaration.kind
					: "";

			// Constant variables are safe.
			if (CONSTANT_BINDINGS.has(kind)) {
				return true;
			}

			/*
			 * Variables which are declared by `let` in the loop is safe.
			 * It's a different instance from the next loop step's.
			 */
			if (
				kind === "let" &&
				declaration.range[0] > loopNode.range[0] &&
				declaration.range[1] < loopNode.range[1]
			) {
				return true;
			}

			/*
			 * WriteReferences which exist after this border are unsafe because those
			 * can modify the variable.
			 */
			const border = getTopLoopNode(
				loopNode,
				kind === "let" ? declaration : null,
			).range[0];

			/**
			 * Checks whether a given reference is safe or not.
			 * The reference is every reference of the upper scope's variable we are
			 * looking now.
			 *
			 * It's safe if the reference matches one of the following condition.
			 * - is readonly.
			 * - doesn't exist inside a local function and after the border.
			 * @param {Reference} upperRef A reference to check.
			 * @returns {boolean} `true` if the reference is safe.
			 */
			function isSafeReference(upperRef) {
				const id = upperRef.identifier;

				return (
					!upperRef.isWrite() ||
					(variable.scope.variableScope ===
						upperRef.from.variableScope &&
						id.range[0] < border)
				);
			}

			return (
				Boolean(variable) && variable.references.every(isSafeReference)
			);
		}

		/**
		 * Reports functions which match the following condition:
		 *
		 * - has a loop node in ancestors.
		 * - has any references which refers to an unsafe variable.
		 * @param {ASTNode} node The AST node to check.
		 * @returns {void}
		 */
		function checkForLoops(node) {
			const loopNode = getContainingLoopNode(node);

			if (!loopNode) {
				return;
			}

			const references = sourceCode.getScope(node).through;

			// Check if the function is not asynchronous or a generator function
			if (!(node.async || node.generator)) {
				if (isIIFE(node)) {
					const isFunctionExpression =
						node.type === "FunctionExpression";

					// Check if the function is referenced elsewhere in the code
					const isFunctionReferenced =
						isFunctionExpression && node.id
							? references.some(
									r => r.identifier.name === node.id.name,
								)
							: false;

					if (!isFunctionReferenced) {
						SKIPPED_IIFE_NODES.add(node);
						return;
					}
				}
			}

			const unsafeRefs = [
				...new Set(
					references
						.filter(r => r.resolved && !isSafe(loopNode, r))
						.map(r => r.identifier.name),
				),
			];

			if (unsafeRefs.length > 0) {
				context.report({
					node,
					messageId: "unsafeRefs",
					data: { varNames: `'${unsafeRefs.join("', '")}'` },
				});
			}
		}

		return {
			ArrowFunctionExpression: checkForLoops,
			FunctionExpression: checkForLoops,
			FunctionDeclaration: checkForLoops,
		};
	},
};
]Gx7/**
 * @fileoverview Rule to flag numbers that will lose significant figure precision at runtime
 * @author Jacob Moore
 */

"use strict";

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/** Class representing a number in scientific notation. */
class ScientificNotation {
	/** @type {string} The digits of the coefficient. A decimal point is implied after the first digit. */
	coefficient;

	/** @type {number} The order of magnitude. */
	magnitude;

	constructor(coefficient, magnitude) {
		this.coefficient = coefficient;
		this.magnitude = magnitude;
	}

	/* c8 ignore start -- debug only */
	toString() {
		return `${this.coefficient[0]}${this.coefficient.length > 1 ? `.${this.coefficient.slice(1)}` : ""}e${this.magnitude}`;
	}
	/* c8 ignore stop */
}

/**
 * Returns whether the node is number literal
 * @param {Node} node the node literal being evaluated
 * @returns {boolean} true if the node is a number literal
 */
function isNumber(node) {
	return typeof node.value === "number";
}

/**
 * Gets the source code of the given number literal. Removes `_` numeric separators from the result.
 * @param {Node} node the number `Literal` node
 * @returns {string} raw source code of the literal, without numeric separators
 */
function getRaw(node) {
	return node.raw.replace(/_/gu, "");
}

/**
 * Checks whether the number is base ten
 * @param {ASTNode} node the node being evaluated
 * @returns {boolean} true if the node is in base ten
 */
function isBaseTen(node) {
	const prefixes = ["0x", "0X", "0b", "0B", "0o", "0O"];

	return (
		prefixes.every(prefix => !node.raw.startsWith(prefix)) &&
		!/^0[0-7]+$/u.test(node.raw)
	);
}

/**
 * Checks that the user-intended non-base ten number equals the actual number after is has been converted to the Number type
 * @param {Node} node the node being evaluated
 * @returns {boolean} true if they do not match
 */
function notBaseTenLosesPrecision(node) {
	const rawString = getRaw(node).toUpperCase();
	let base;

	if (rawString.startsWith("0B")) {
		base = 2;
	} else if (rawString.startsWith("0X")) {
		base = 16;
	} else {
		base = 8;
	}

	return !rawString.endsWith(node.value.toString(base).toUpperCase());
}

/**
 * Returns the number stripped of leading zeros
 * @param {string} numberAsString the string representation of the number
 * @returns {string} the stripped string
 */
function removeLeadingZeros(numberAsString) {
	for (let i = 0; i < numberAsString.length; i++) {
		if (numberAsString[i] !== "0") {
			return numberAsString.slice(i);
		}
	}
	return numberAsString;
}

/**
 * Returns the number stripped of trailing zeros
 * @param {string} numberAsString the string representation of the number
 * @returns {string} the stripped string
 */
function removeTrailingZeros(numberAsString) {
	for (let i = numberAsString.length - 1; i >= 0; i--) {
		if (numberAsString[i] !== "0") {
			return numberAsString.slice(0, i + 1);
		}
	}
	return numberAsString;
}

/**
 * Converts an integer to an object containing the integer's coefficient and order of magnitude
 * @param {string} stringInteger the string representation of the integer being converted
 * @returns {ScientificNotation} the object containing the integer's coefficient and order of magnitude
 */
function normalizeInteger(stringInteger) {
	const trimmedInteger = removeLeadingZeros(stringInteger);
	const significantDigits = removeTrailingZeros(trimmedInteger);

	return new ScientificNotation(significantDigits, trimmedInteger.length - 1);
}

/**
 * Converts a float to an object containing the float's coefficient and order of magnitude
 * @param {string} stringFloat the string representation of the float being converted
 * @returns {ScientificNotation} the object containing the float's coefficient and order of magnitude
 */
function normalizeFloat(stringFloat) {
	const trimmedFloat = removeLeadingZeros(stringFloat);
	const indexOfDecimalPoint = trimmedFloat.indexOf(".");

	switch (indexOfDecimalPoint) {
		case 0: {
			const significantDigits = removeLeadingZeros(trimmedFloat.slice(1));

			return new ScientificNotation(
				significantDigits,
				significantDigits.length - trimmedFloat.length,
			);
		}
		case -1:
			return new ScientificNotation(
				trimmedFloat,
				trimmedFloat.length - 1,
			);
		default:
			return new ScientificNotation(
				trimmedFloat.replace(".", ""),
				indexOfDecimalPoint - 1,
			);
	}
}

/**
 * Converts a base ten number to proper scientific notation
 * @param {string} stringNumber the string representation of the base ten number to be converted
 * @param {boolean} parseAsFloat if true, the coefficient will be always parsed as a float, regardless of whether a decimal point is present
 * @returns {ScientificNotation} the object containing the number's coefficient and order of magnitude
 */
function convertNumberToScientificNotation(stringNumber, parseAsFloat) {
	const splitNumber = stringNumber.split("e");
	const originalCoefficient = splitNumber[0];
	const normalizedNumber =
		parseAsFloat || stringNumber.includes(".")
			? normalizeFloat(originalCoefficient)
			: normalizeInteger(originalCoefficient);
	if (splitNumber.length > 1) {
		normalizedNumber.magnitude += parseInt(splitNumber[1], 10);
	}

	return normalizedNumber;
}

/**
 * Checks that the user-intended base ten number equals the actual number after is has been converted to the Number type
 * @param {Node} node the node being evaluated
 * @returns {boolean} true if they do not match
 */
function baseTenLosesPrecision(node) {
	const rawNumber = getRaw(node).toLowerCase();
	const normalizedRawNumber = convertNumberToScientificNotation(
		rawNumber,
		false,
	);
	const requestedPrecision = normalizedRawNumber.coefficient.length;

	if (requestedPrecision > 100) {
		return true;
	}
	const storedNumber = node.value.toPrecision(requestedPrecision);
	const normalizedStoredNumber = convertNumberToScientificNotation(
		storedNumber,
		true,
	);

	return (
		normalizedRawNumber.magnitude !== normalizedStoredNumber.magnitude ||
		normalizedRawNumber.coefficient !== normalizedStoredNumber.coefficient
	);
}

/**
 * Checks that the user-intended number equals the actual number after is has been converted to the Number type
 * @param {Node} node the node being evaluated
 * @returns {boolean} true if they do not match
 */
function losesPrecision(node) {
	return isBaseTen(node)
		? baseTenLosesPrecision(node)
		: notBaseTenLosesPrecision(node);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description: "Disallow literal numbers that lose precision",
			dialects: ["JavaScript", "TypeScript"],
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-loss-of-precision",
		},
		schema: [],
		messages: {
			noLossOfPrecision:
				"This number literal will lose precision at runtime.",
		},
	},

	create(context) {
		return {
			Literal(node) {
				if (node.value && isNumber(node) && losesPrecision(node)) {
					context.report({
						messageId: "noLossOfPrecision",
						node,
					});
				}
			},
		};
	},
};
[x(L/**
 * @fileoverview Rule to flag statements that use magic numbers (adapted from https://github.com/danielstjules/buddy.js)
 * @author Vincent Lemeunier
 */

"use strict";

const astUtils = require("./utils/ast-utils");

// Maximum array length by the ECMAScript Specification.
const MAX_ARRAY_LENGTH = 2 ** 32 - 1;

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/**
 * Convert the value to bigint if it's a string. Otherwise return the value as-is.
 * @param {bigint|number|string} x The value to normalize.
 * @returns {bigint|number} The normalized value.
 */
function normalizeIgnoreValue(x) {
	if (typeof x === "string") {
		return BigInt(x.slice(0, -1));
	}
	return x;
}

/**
 * Checks if the node parent is a TypeScript enum member
 * @param {ASTNode} node The node to be validated
 * @returns {boolean} True if the node parent is a TypeScript enum member
 */
function isParentTSEnumDeclaration(node) {
	return node.parent.type === "TSEnumMember";
}

/**
 * Checks if the node is a valid TypeScript numeric literal type.
 * @param {ASTNode} node The node to be validated
 * @returns {boolean} True if the node is a TypeScript numeric literal type
 */
function isTSNumericLiteralType(node) {
	let ancestor = node.parent;

	// Go up while we're part of a type union
	while (ancestor.parent.type === "TSUnionType") {
		ancestor = ancestor.parent;
	}

	// Check if the final ancestor is in a type alias declaration
	return ancestor.parent.type === "TSTypeAliasDeclaration";
}

/**
 * Checks if the node parent is a readonly class property
 * @param {ASTNode} node The node to be validated
 * @returns {boolean} True if the node parent is a readonly class property
 */
function isParentTSReadonlyPropertyDefinition(node) {
	if (node.parent?.type === "PropertyDefinition" && node.parent.readonly) {
		return true;
	}

	return false;
}

/**
 * Checks if the node is part of a type indexed access (eg. Foo[4])
 * @param {ASTNode} node The node to be validated
 * @returns {boolean} True if the node is part of an indexed access
 */
function isAncestorTSIndexedAccessType(node) {
	let ancestor = node.parent;

	/*
	 * Go up another level while we're part of a type union (eg. 1 | 2) or
	 * intersection (eg. 1 & 2)
	 */
	while (
		ancestor.parent.type === "TSUnionType" ||
		ancestor.parent.type === "TSIntersectionType"
	) {
		ancestor = ancestor.parent;
	}

	return ancestor.parent.type === "TSIndexedAccessType";
}

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow magic numbers",
			dialects: ["JavaScript", "TypeScript"],
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/no-magic-numbers",
		},

		schema: [
			{
				type: "object",
				properties: {
					detectObjects: {
						type: "boolean",
					},
					enforceConst: {
						type: "boolean",
					},
					ignore: {
						type: "array",
						items: {
							anyOf: [
								{ type: "number" },
								{
									type: "string",
									pattern: "^[+-]?(?:0|[1-9][0-9]*)n$",
								},
							],
						},
						uniqueItems: true,
					},
					ignoreArrayIndexes: {
						type: "boolean",
					},
					ignoreDefaultValues: {
						type: "boolean",
					},
					ignoreClassFieldInitialValues: {
						type: "boolean",
					},
					ignoreEnums: {
						type: "boolean",
					},
					ignoreNumericLiteralTypes: {
						type: "boolean",
					},
					ignoreReadonlyClassProperties: {
						type: "boolean",
					},
					ignoreTypeIndexes: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		defaultOptions: [
			{
				detectObjects: false,
				enforceConst: false,
				ignore: [],
				ignoreArrayIndexes: false,
				ignoreDefaultValues: false,
				ignoreClassFieldInitialValues: false,
				ignoreEnums: false,
				ignoreNumericLiteralTypes: false,
				ignoreReadonlyClassProperties: false,
				ignoreTypeIndexes: false,
			},
		],

		messages: {
			useConst: "Number constants declarations must use 'const'.",
			noMagic: "No magic number: {{raw}}.",
		},
	},

	create(context) {
		const {
			detectObjects,
			enforceConst,
			ignore: rawIgnore,
			ignoreArrayIndexes,
			ignoreDefaultValues,
			ignoreClassFieldInitialValues,
			ignoreEnums,
			ignoreNumericLiteralTypes,
			ignoreReadonlyClassProperties,
			ignoreTypeIndexes,
		} = context.options[0];
		const ignore = new Set(rawIgnore.map(normalizeIgnoreValue));

		const okTypes = detectObjects
			? []
			: ["ObjectExpression", "Property", "AssignmentExpression"];

		/**
		 * Returns whether the rule is configured to ignore the given value
		 * @param {bigint|number} value The value to check
		 * @returns {boolean} true if the value is ignored
		 */
		function isIgnoredValue(value) {
			return ignore.has(value);
		}

		/**
		 * Returns whether the number is a default value assignment.
		 * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node
		 * @returns {boolean} true if the number is a default value
		 */
		function isDefaultValue(fullNumberNode) {
			const parent = fullNumberNode.parent;

			return (
				parent.type === "AssignmentPattern" &&
				parent.right === fullNumberNode
			);
		}

		/**
		 * Returns whether the number is the initial value of a class field.
		 * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node
		 * @returns {boolean} true if the number is the initial value of a class field.
		 */
		function isClassFieldInitialValue(fullNumberNode) {
			const parent = fullNumberNode.parent;

			return (
				parent.type === "PropertyDefinition" &&
				parent.value === fullNumberNode
			);
		}

		/**
		 * Returns whether the given node is used as a radix within parseInt() or Number.parseInt()
		 * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node
		 * @returns {boolean} true if the node is radix
		 */
		function isParseIntRadix(fullNumberNode) {
			const parent = fullNumberNode.parent;

			return (
				parent.type === "CallExpression" &&
				fullNumberNode === parent.arguments[1] &&
				(astUtils.isSpecificId(parent.callee, "parseInt") ||
					astUtils.isSpecificMemberAccess(
						parent.callee,
						"Number",
						"parseInt",
					))
			);
		}

		/**
		 * Returns whether the given node is a direct child of a JSX node.
		 * In particular, it aims to detect numbers used as prop values in JSX tags.
		 * Example: <input maxLength={10} />
		 * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node
		 * @returns {boolean} true if the node is a JSX number
		 */
		function isJSXNumber(fullNumberNode) {
			return fullNumberNode.parent.type.indexOf("JSX") === 0;
		}

		/**
		 * Returns whether the given node is used as an array index.
		 * Value must coerce to a valid array index name: "0", "1", "2" ... "4294967294".
		 *
		 * All other values, like "-1", "2.5", or "4294967295", are just "normal" object properties,
		 * which can be created and accessed on an array in addition to the array index properties,
		 * but they don't affect array's length and are not considered by methods such as .map(), .forEach() etc.
		 *
		 * The maximum array length by the specification is 2 ** 32 - 1 = 4294967295,
		 * thus the maximum valid index is 2 ** 32 - 2 = 4294967294.
		 *
		 * All notations are allowed, as long as the value coerces to one of "0", "1", "2" ... "4294967294".
		 *
		 * Valid examples:
		 * a[0], a[1], a[1.2e1], a[0xAB], a[0n], a[1n]
		 * a[-0] (same as a[0] because -0 coerces to "0")
		 * a[-0n] (-0n evaluates to 0n)
		 *
		 * Invalid examples:
		 * a[-1], a[-0xAB], a[-1n], a[2.5], a[1.23e1], a[12e-1]
		 * a[4294967295] (above the max index, it's an access to a regular property a["4294967295"])
		 * a[999999999999999999999] (even if it wasn't above the max index, it would be a["1e+21"])
		 * a[1e310] (same as a["Infinity"])
		 * @param {ASTNode} fullNumberNode `Literal` or `UnaryExpression` full number node
		 * @param {bigint|number} value Value expressed by the fullNumberNode
		 * @returns {boolean} true if the node is a valid array index
		 */
		function isArrayIndex(fullNumberNode, value) {
			const parent = fullNumberNode.parent;

			return (
				parent.type === "MemberExpression" &&
				parent.property === fullNumberNode &&
				(Number.isInteger(value) || typeof value === "bigint") &&
				value >= 0 &&
				value < MAX_ARRAY_LENGTH
			);
		}

		return {
			Literal(node) {
				if (!astUtils.isNumericLiteral(node)) {
					return;
				}

				let fullNumberNode;
				let value;
				let raw;

				// Treat unary minus/plus as a part of the number
				if (
					node.parent.type === "UnaryExpression" &&
					["-", "+"].includes(node.parent.operator)
				) {
					fullNumberNode = node.parent;
					value =
						node.parent.operator === "-" ? -node.value : node.value;
					raw = `${node.parent.operator}${node.raw}`;
				} else {
					fullNumberNode = node;
					value = node.value;
					raw = node.raw;
				}

				const parent = fullNumberNode.parent;

				// Always allow radix arguments and JSX props
				if (
					isIgnoredValue(value) ||
					(ignoreDefaultValues && isDefaultValue(fullNumberNode)) ||
					(ignoreClassFieldInitialValues &&
						isClassFieldInitialValue(fullNumberNode)) ||
					(ignoreEnums &&
						isParentTSEnumDeclaration(fullNumberNode)) ||
					(ignoreNumericLiteralTypes &&
						isTSNumericLiteralType(fullNumberNode)) ||
					(ignoreTypeIndexes &&
						isAncestorTSIndexedAccessType(fullNumberNode)) ||
					(ignoreReadonlyClassProperties &&
						isParentTSReadonlyPropertyDefinition(fullNumberNode)) ||
					isParseIntRadix(fullNumberNode) ||
					isJSXNumber(fullNumberNode) ||
					(ignoreArrayIndexes && isArrayIndex(fullNumberNode, value))
				) {
					return;
				}

				if (parent.type === "VariableDeclarator") {
					if (enforceConst && parent.parent.kind !== "const") {
						context.report({
							node: fullNumberNode,
							messageId: "useConst",
						});
					}
				} else if (
					!okTypes.includes(parent.type) ||
					(parent.type === "AssignmentExpression" &&
						parent.left.type === "Identifier")
				) {
					context.report({
						node: fullNumberNode,
						messageId: "noMagic",
						data: {
							raw,
						},
					});
				}
			},
		};
	},
};
Mx?/**
 * @author Toru Nagashima <https://github.com/mysticatea>
 */
"use strict";

const {
	CALL,
	CONSTRUCT,
	ReferenceTracker,
	getStaticValue,
	getStringIfConstant,
} = require("@eslint-community/eslint-utils");
const { RegExpParser, visitRegExpAST } = require("@eslint-community/regexpp");
const {
	isCombiningCharacter,
	isEmojiModifier,
	isRegionalIndicatorSymbol,
	isSurrogatePair,
} = require("./utils/unicode");
const astUtils = require("./utils/ast-utils.js");
const { isValidWithUnicodeFlag } = require("./utils/regular-expressions");
const {
	parseStringLiteral,
	parseTemplateToken,
} = require("./utils/char-source");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * @typedef {import('@eslint-community/regexpp').AST.Character} Character
 * @typedef {import('@eslint-community/regexpp').AST.CharacterClassElement} CharacterClassElement
 */

/**
 * Iterate character sequences of a given nodes.
 *
 * CharacterClassRange syntax can steal a part of character sequence,
 * so this function reverts CharacterClassRange syntax and restore the sequence.
 * @param {CharacterClassElement[]} nodes The node list to iterate character sequences.
 * @returns {IterableIterator<Character[]>} The list of character sequences.
 */
function* iterateCharacterSequence(nodes) {
	/** @type {Character[]} */
	let seq = [];

	for (const node of nodes) {
		switch (node.type) {
			case "Character":
				seq.push(node);
				break;

			case "CharacterClassRange":
				seq.push(node.min);
				yield seq;
				seq = [node.max];
				break;

			case "CharacterSet":
			case "CharacterClass": // [[]] nesting character class
			case "ClassStringDisjunction": // \q{...}
			case "ExpressionCharacterClass": // [A--B]
				if (seq.length > 0) {
					yield seq;
					seq = [];
				}
				break;

			// no default
		}
	}

	if (seq.length > 0) {
		yield seq;
	}
}

/**
 * Checks whether the given character node is a Unicode code point escape or not.
 * @param {Character} char the character node to check.
 * @returns {boolean} `true` if the character node is a Unicode code point escape.
 */
function isUnicodeCodePointEscape(char) {
	return /^\\u\{[\da-f]+\}$/iu.test(char.raw);
}

/**
 * Each function returns matched characters if it detects that kind of problem.
 * @type {Record<string, (chars: Character[]) => IterableIterator<Character[]>>}
 */
const findCharacterSequences = {
	*surrogatePairWithoutUFlag(chars) {
		for (const [index, char] of chars.entries()) {
			const previous = chars[index - 1];

			if (
				previous &&
				char &&
				isSurrogatePair(previous.value, char.value) &&
				!isUnicodeCodePointEscape(previous) &&
				!isUnicodeCodePointEscape(char)
			) {
				yield [previous, char];
			}
		}
	},

	*surrogatePair(chars) {
		for (const [index, char] of chars.entries()) {
			const previous = chars[index - 1];

			if (
				previous &&
				char &&
				isSurrogatePair(previous.value, char.value) &&
				(isUnicodeCodePointEscape(previous) ||
					isUnicodeCodePointEscape(char))
			) {
				yield [previous, char];
			}
		}
	},

	*combiningClass(chars, unfilteredChars) {
		/*
		 * When `allowEscape` is `true`, a combined character should only be allowed if the combining mark appears as an escape sequence.
		 * This means that the base character should be considered even if it's escaped.
		 */
		for (const [index, char] of chars.entries()) {
			const previous = unfilteredChars[index - 1];

			if (
				previous &&
				char &&
				isCombiningCharacter(char.value) &&
				!isCombiningCharacter(previous.value)
			) {
				yield [previous, char];
			}
		}
	},

	*emojiModifier(chars) {
		for (const [index, char] of chars.entries()) {
			const previous = chars[index - 1];

			if (
				previous &&
				char &&
				isEmojiModifier(char.value) &&
				!isEmojiModifier(previous.value)
			) {
				yield [previous, char];
			}
		}
	},

	*regionalIndicatorSymbol(chars) {
		for (const [index, char] of chars.entries()) {
			const previous = chars[index - 1];

			if (
				previous &&
				char &&
				isRegionalIndicatorSymbol(char.value) &&
				isRegionalIndicatorSymbol(previous.value)
			) {
				yield [previous, char];
			}
		}
	},

	*zwj(chars) {
		let sequence = null;

		for (const [index, char] of chars.entries()) {
			const previous = chars[index - 1];
			const next = chars[index + 1];

			if (
				previous &&
				char &&
				next &&
				char.value === 0x200d &&
				previous.value !== 0x200d &&
				next.value !== 0x200d
			) {
				if (sequence) {
					if (sequence.at(-1) === previous) {
						sequence.push(char, next); // append to the sequence
					} else {
						yield sequence;
						sequence = chars.slice(index - 1, index + 2);
					}
				} else {
					sequence = chars.slice(index - 1, index + 2);
				}
			}
		}

		if (sequence) {
			yield sequence;
		}
	},
};

const kinds = Object.keys(findCharacterSequences);

/**
 * Gets the value of the given node if it's a static value other than a regular expression object,
 * or the node's `regex` property.
 * The purpose of this method is to provide a replacement for `getStaticValue` in environments where certain regular expressions cannot be evaluated.
 * A known example is Node.js 18 which does not support the `v` flag.
 * Calling `getStaticValue` on a regular expression node with the `v` flag on Node.js 18 always returns `null`.
 * A limitation of this method is that it can only detect a regular expression if the specified node is itself a regular expression literal node.
 * @param {ASTNode | undefined} node The node to be inspected.
 * @param {Scope} initialScope Scope to start finding variables. This function tries to resolve identifier references which are in the given scope.
 * @returns {{ value: any } | { regex: { pattern: string, flags: string } } | null} The static value of the node, or `null`.
 */
function getStaticValueOrRegex(node, initialScope) {
	if (!node) {
		return null;
	}
	if (node.type === "Literal" && node.regex) {
		return { regex: node.regex };
	}

	const staticValue = getStaticValue(node, initialScope);

	if (staticValue?.value instanceof RegExp) {
		return null;
	}
	return staticValue;
}

/**
 * Checks whether a specified regexpp character is represented as an acceptable escape sequence.
 * This function requires the source text of the character to be known.
 * @param {Character} char Character to check.
 * @param {string} charSource Source text of the character to check.
 * @returns {boolean} Whether the specified regexpp character is represented as an acceptable escape sequence.
 */
function checkForAcceptableEscape(char, charSource) {
	if (!charSource.startsWith("\\")) {
		return false;
	}
	const match = /(?<=^\\+).$/su.exec(charSource);

	return match?.[0] !== String.fromCodePoint(char.value);
}

/**
 * Checks whether a specified regexpp character is represented as an acceptable escape sequence.
 * This function works with characters that are produced by a string or template literal.
 * It requires the source text and the CodeUnit list of the literal to be known.
 * @param {Character} char Character to check.
 * @param {string} nodeSource Source text of the string or template literal that produces the character.
 * @param {CodeUnit[]} codeUnits List of CodeUnit objects of the literal that produces the character.
 * @returns {boolean} Whether the specified regexpp character is represented as an acceptable escape sequence.
 */
function checkForAcceptableEscapeInString(char, nodeSource, codeUnits) {
	const firstIndex = char.start;
	const lastIndex = char.end - 1;
	const start = codeUnits[firstIndex].start;
	const end = codeUnits[lastIndex].end;
	const charSource = nodeSource.slice(start, end);

	return checkForAcceptableEscape(char, charSource);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		defaultOptions: [
			{
				allowEscape: false,
			},
		],

		docs: {
			description:
				"Disallow characters which are made with multiple code points in character class syntax",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-misleading-character-class",
		},

		hasSuggestions: true,

		schema: [
			{
				type: "object",
				properties: {
					allowEscape: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			surrogatePairWithoutUFlag:
				"Unexpected surrogate pair in character class. Use 'u' flag.",
			surrogatePair: "Unexpected surrogate pair in character class.",
			combiningClass: "Unexpected combined character in character class.",
			emojiModifier: "Unexpected modified Emoji in character class.",
			regionalIndicatorSymbol:
				"Unexpected national flag in character class.",
			zwj: "Unexpected joined character sequence in character class.",
			suggestUnicodeFlag: "Add unicode 'u' flag to regex.",
		},
	},
	create(context) {
		const [{ allowEscape }] = context.options;
		const sourceCode = context.sourceCode;
		const parser = new RegExpParser();
		const checkedPatternNodes = new Set();

		/**
		 * Verify a given regular expression.
		 * @param {Node} node The node to report.
		 * @param {string} pattern The regular expression pattern to verify.
		 * @param {string} flags The flags of the regular expression.
		 * @param {Function} unicodeFixer Fixer for missing "u" flag.
		 * @returns {void}
		 */
		function verify(node, pattern, flags, unicodeFixer) {
			let patternNode;

			try {
				patternNode = parser.parsePattern(pattern, 0, pattern.length, {
					unicode: flags.includes("u"),
					unicodeSets: flags.includes("v"),
				});
			} catch {
				// Ignore regular expressions with syntax errors
				return;
			}

			let codeUnits = null;

			/**
			 * Checks whether a specified regexpp character is represented as an acceptable escape sequence.
			 * For the purposes of this rule, an escape sequence is considered acceptable if it consists of one or more backslashes followed by the character being escaped.
			 * @param {Character} char Character to check.
			 * @returns {boolean} Whether the specified regexpp character is represented as an acceptable escape sequence.
			 */
			function isAcceptableEscapeSequence(char) {
				if (node.type === "Literal" && node.regex) {
					return checkForAcceptableEscape(char, char.raw);
				}
				if (node.type === "Literal" && typeof node.value === "string") {
					const nodeSource = node.raw;

					codeUnits ??= parseStringLiteral(nodeSource);

					return checkForAcceptableEscapeInString(
						char,
						nodeSource,
						codeUnits,
					);
				}
				if (astUtils.isStaticTemplateLiteral(node)) {
					const nodeSource = sourceCode.getText(node);

					codeUnits ??= parseTemplateToken(nodeSource);

					return checkForAcceptableEscapeInString(
						char,
						nodeSource,
						codeUnits,
					);
				}
				return false;
			}

			const foundKindMatches = new Map();

			visitRegExpAST(patternNode, {
				onCharacterClassEnter(ccNode) {
					for (const unfilteredChars of iterateCharacterSequence(
						ccNode.elements,
					)) {
						let chars;

						if (allowEscape) {
							// Replace escape sequences with null to avoid having them flagged.
							chars = unfilteredChars.map(char =>
								isAcceptableEscapeSequence(char) ? null : char,
							);
						} else {
							chars = unfilteredChars;
						}
						for (const kind of kinds) {
							const matches = findCharacterSequences[kind](
								chars,
								unfilteredChars,
							);

							if (foundKindMatches.has(kind)) {
								foundKindMatches.get(kind).push(...matches);
							} else {
								foundKindMatches.set(kind, [...matches]);
							}
						}
					}
				},
			});

			/**
			 * Finds the report loc(s) for a range of matches.
			 * Only literals and expression-less templates generate granular errors.
			 * @param {Character[][]} matches Lists of individual characters being reported on.
			 * @returns {Location[]} locs for context.report.
			 * @see https://github.com/eslint/eslint/pull/17515
			 */
			function getNodeReportLocations(matches) {
				if (
					!astUtils.isStaticTemplateLiteral(node) &&
					node.type !== "Literal"
				) {
					return matches.length ? [node.loc] : [];
				}
				return matches.map(chars => {
					const firstIndex = chars[0].start;
					const lastIndex = chars.at(-1).end - 1;
					let start;
					let end;

					if (node.type === "TemplateLiteral") {
						const source = sourceCode.getText(node);
						const offset = node.range[0];

						codeUnits ??= parseTemplateToken(source);
						start = offset + codeUnits[firstIndex].start;
						end = offset + codeUnits[lastIndex].end;
					} else if (typeof node.value === "string") {
						// String Literal
						const source = node.raw;
						const offset = node.range[0];

						codeUnits ??= parseStringLiteral(source);
						start = offset + codeUnits[firstIndex].start;
						end = offset + codeUnits[lastIndex].end;
					} else {
						// RegExp Literal
						const offset = node.range[0] + 1; // Add 1 to skip the leading slash.

						start = offset + firstIndex;
						end = offset + lastIndex + 1;
					}

					return {
						start: sourceCode.getLocFromIndex(start),
						end: sourceCode.getLocFromIndex(end),
					};
				});
			}

			for (const [kind, matches] of foundKindMatches) {
				let suggest;

				if (kind === "surrogatePairWithoutUFlag") {
					suggest = [
						{
							messageId: "suggestUnicodeFlag",
							fix: unicodeFixer,
						},
					];
				}

				const locs = getNodeReportLocations(matches);

				for (const loc of locs) {
					context.report({
						node,
						loc,
						messageId: kind,
						suggest,
					});
				}
			}
		}

		return {
			"Literal[regex]"(node) {
				if (checkedPatternNodes.has(node)) {
					return;
				}
				verify(node, node.regex.pattern, node.regex.flags, fixer => {
					if (
						!isValidWithUnicodeFlag(
							context.languageOptions.ecmaVersion,
							node.regex.pattern,
						)
					) {
						return null;
					}

					return fixer.insertTextAfter(node, "u");
				});
			},
			Program(node) {
				const scope = sourceCode.getScope(node);
				const tracker = new ReferenceTracker(scope);

				/*
				 * Iterate calls of RegExp.
				 * E.g., `new RegExp()`, `RegExp()`, `new window.RegExp()`,
				 *       `const {RegExp: a} = window; new a()`, etc...
				 */
				for (const { node: refNode } of tracker.iterateGlobalReferences(
					{
						RegExp: { [CALL]: true, [CONSTRUCT]: true },
					},
				)) {
					let pattern, flags;
					const [patternNode, flagsNode] = refNode.arguments;
					const evaluatedPattern = getStaticValueOrRegex(
						patternNode,
						scope,
					);

					if (!evaluatedPattern) {
						continue;
					}
					if (flagsNode) {
						if (evaluatedPattern.regex) {
							pattern = evaluatedPattern.regex.pattern;
							checkedPatternNodes.add(patternNode);
						} else {
							pattern = String(evaluatedPattern.value);
						}
						flags = getStringIfConstant(flagsNode, scope);
					} else {
						if (evaluatedPattern.regex) {
							continue;
						}
						pattern = String(evaluatedPattern.value);
						flags = "";
					}

					if (typeof flags === "string") {
						verify(patternNode, pattern, flags, fixer => {
							if (
								!isValidWithUnicodeFlag(
									context.languageOptions.ecmaVersion,
									pattern,
								)
							) {
								return null;
							}

							if (refNode.arguments.length === 1) {
								const penultimateToken =
									sourceCode.getLastToken(refNode, {
										skip: 1,
									}); // skip closing parenthesis

								return fixer.insertTextAfter(
									penultimateToken,
									astUtils.isCommaToken(penultimateToken)
										? ' "u",'
										: ', "u"',
								);
							}

							if (
								(flagsNode.type === "Literal" &&
									typeof flagsNode.value === "string") ||
								flagsNode.type === "TemplateLiteral"
							) {
								const range = [
									flagsNode.range[0],
									flagsNode.range[1] - 1,
								];

								return fixer.insertTextAfterRange(range, "u");
							}

							return null;
						});
					}
				}
			},
		};
	},
};
ݭ̻x/**
 * @fileoverview Rule to disallow mixed binary operators.
 * @author Toru Nagashima
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils.js");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const ARITHMETIC_OPERATORS = ["+", "-", "*", "/", "%", "**"];
const BITWISE_OPERATORS = ["&", "|", "^", "~", "<<", ">>", ">>>"];
const COMPARISON_OPERATORS = ["==", "!=", "===", "!==", ">", ">=", "<", "<="];
const LOGICAL_OPERATORS = ["&&", "||"];
const RELATIONAL_OPERATORS = ["in", "instanceof"];
const TERNARY_OPERATOR = ["?:"];
const COALESCE_OPERATOR = ["??"];
const ALL_OPERATORS = [].concat(
	ARITHMETIC_OPERATORS,
	BITWISE_OPERATORS,
	COMPARISON_OPERATORS,
	LOGICAL_OPERATORS,
	RELATIONAL_OPERATORS,
	TERNARY_OPERATOR,
	COALESCE_OPERATOR,
);
const DEFAULT_GROUPS = [
	ARITHMETIC_OPERATORS,
	BITWISE_OPERATORS,
	COMPARISON_OPERATORS,
	LOGICAL_OPERATORS,
	RELATIONAL_OPERATORS,
];
const TARGET_NODE_TYPE = /^(?:Binary|Logical|Conditional)Expression$/u;

/**
 * Normalizes options.
 * @param {Object|undefined} options A options object to normalize.
 * @returns {Object} Normalized option object.
 */
function normalizeOptions(options = {}) {
	const hasGroups = options.groups && options.groups.length > 0;
	const groups = hasGroups ? options.groups : DEFAULT_GROUPS;
	const allowSamePrecedence = options.allowSamePrecedence !== false;

	return {
		groups,
		allowSamePrecedence,
	};
}

/**
 * Checks whether any group which includes both given operator exists or not.
 * @param {Array<string[]>} groups A list of groups to check.
 * @param {string} left An operator.
 * @param {string} right Another operator.
 * @returns {boolean} `true` if such group existed.
 */
function includesBothInAGroup(groups, left, right) {
	return groups.some(group => group.includes(left) && group.includes(right));
}

/**
 * Checks whether the given node is a conditional expression and returns the test node else the left node.
 * @param {ASTNode} node A node which can be a BinaryExpression or a LogicalExpression node.
 * This parent node can be BinaryExpression, LogicalExpression
 *      , or a ConditionalExpression node
 * @returns {ASTNode} node the appropriate node(left or test).
 */
function getChildNode(node) {
	return node.type === "ConditionalExpression" ? node.test : node.left;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "no-mixed-operators",
						url: "https://eslint.style/rules/no-mixed-operators",
					},
				},
			],
		},
		type: "suggestion",

		docs: {
			description: "Disallow mixed binary operators",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-mixed-operators",
		},

		schema: [
			{
				type: "object",
				properties: {
					groups: {
						type: "array",
						items: {
							type: "array",
							items: { enum: ALL_OPERATORS },
							minItems: 2,
							uniqueItems: true,
						},
						uniqueItems: true,
					},
					allowSamePrecedence: {
						type: "boolean",
						default: true,
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			unexpectedMixedOperator:
				"Unexpected mix of '{{leftOperator}}' and '{{rightOperator}}'. Use parentheses to clarify the intended order of operations.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const options = normalizeOptions(context.options[0]);

		/**
		 * Checks whether a given node should be ignored by options or not.
		 * @param {ASTNode} node A node to check. This is a BinaryExpression
		 *      node or a LogicalExpression node. This parent node is one of
		 *      them, too.
		 * @returns {boolean} `true` if the node should be ignored.
		 */
		function shouldIgnore(node) {
			const a = node;
			const b = node.parent;

			return (
				!includesBothInAGroup(
					options.groups,
					a.operator,
					b.type === "ConditionalExpression" ? "?:" : b.operator,
				) ||
				(options.allowSamePrecedence &&
					astUtils.getPrecedence(a) === astUtils.getPrecedence(b))
			);
		}

		/**
		 * Checks whether the operator of a given node is mixed with parent
		 * node's operator or not.
		 * @param {ASTNode} node A node to check. This is a BinaryExpression
		 *      node or a LogicalExpression node. This parent node is one of
		 *      them, too.
		 * @returns {boolean} `true` if the node was mixed.
		 */
		function isMixedWithParent(node) {
			return (
				node.operator !== node.parent.operator &&
				!astUtils.isParenthesised(sourceCode, node)
			);
		}

		/**
		 * Gets the operator token of a given node.
		 * @param {ASTNode} node A node to check. This is a BinaryExpression
		 *      node or a LogicalExpression node.
		 * @returns {Token} The operator token of the node.
		 */
		function getOperatorToken(node) {
			return sourceCode.getTokenAfter(
				getChildNode(node),
				astUtils.isNotClosingParenToken,
			);
		}

		/**
		 * Reports both the operator of a given node and the operator of the
		 * parent node.
		 * @param {ASTNode} node A node to check. This is a BinaryExpression
		 *      node or a LogicalExpression node. This parent node is one of
		 *      them, too.
		 * @returns {void}
		 */
		function reportBothOperators(node) {
			const parent = node.parent;
			const left = getChildNode(parent) === node ? node : parent;
			const right = getChildNode(parent) !== node ? node : parent;
			const data = {
				leftOperator: left.operator || "?:",
				rightOperator: right.operator || "?:",
			};

			context.report({
				node: left,
				loc: getOperatorToken(left).loc,
				messageId: "unexpectedMixedOperator",
				data,
			});
			context.report({
				node: right,
				loc: getOperatorToken(right).loc,
				messageId: "unexpectedMixedOperator",
				data,
			});
		}

		/**
		 * Checks between the operator of this node and the operator of the
		 * parent node.
		 * @param {ASTNode} node A node to check.
		 * @returns {void}
		 */
		function check(node) {
			if (
				TARGET_NODE_TYPE.test(node.parent.type) &&
				isMixedWithParent(node) &&
				!shouldIgnore(node)
			) {
				reportBothOperators(node);
			}
		}

		return {
			BinaryExpression: check,
			LogicalExpression: check,
		};
	},
};
r[fx/**
 * @fileoverview Rule to enforce grouped require statements for Node.JS
 * @author Raphael Pigulla
 * @deprecated in ESLint v7.0.0
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Node.js rules were moved out of ESLint core.",
			url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
			deprecatedSince: "7.0.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"eslint-plugin-n now maintains deprecated Node.js-related rules.",
					plugin: {
						name: "eslint-plugin-n",
						url: "https://github.com/eslint-community/eslint-plugin-n",
					},
					rule: {
						name: "no-mixed-requires",
						url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-mixed-requires.md",
					},
				},
			],
		},

		type: "suggestion",

		docs: {
			description:
				"Disallow `require` calls to be mixed with regular variable declarations",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-mixed-requires",
		},

		schema: [
			{
				oneOf: [
					{
						type: "boolean",
					},
					{
						type: "object",
						properties: {
							grouping: {
								type: "boolean",
							},
							allowCall: {
								type: "boolean",
							},
						},
						additionalProperties: false,
					},
				],
			},
		],

		messages: {
			noMixRequire: "Do not mix 'require' and other declarations.",
			noMixCoreModuleFileComputed:
				"Do not mix core, module, file and computed requires.",
		},
	},

	create(context) {
		const options = context.options[0];
		let grouping = false,
			allowCall = false;

		if (typeof options === "object") {
			grouping = options.grouping;
			allowCall = options.allowCall;
		} else {
			grouping = !!options;
		}

		/**
		 * Returns the list of built-in modules.
		 * @returns {string[]} An array of built-in Node.js modules.
		 */
		function getBuiltinModules() {
			/*
			 * This list is generated using:
			 * `require("repl")._builtinLibs.concat('repl').sort()`
			 * This particular list is as per nodejs v0.12.2 and iojs v0.7.1
			 */
			return [
				"assert",
				"buffer",
				"child_process",
				"cluster",
				"crypto",
				"dgram",
				"dns",
				"domain",
				"events",
				"fs",
				"http",
				"https",
				"net",
				"os",
				"path",
				"punycode",
				"querystring",
				"readline",
				"repl",
				"smalloc",
				"stream",
				"string_decoder",
				"tls",
				"tty",
				"url",
				"util",
				"v8",
				"vm",
				"zlib",
			];
		}

		const BUILTIN_MODULES = getBuiltinModules();

		const DECL_REQUIRE = "require",
			DECL_UNINITIALIZED = "uninitialized",
			DECL_OTHER = "other";

		const REQ_CORE = "core",
			REQ_FILE = "file",
			REQ_MODULE = "module",
			REQ_COMPUTED = "computed";

		/**
		 * Determines the type of a declaration statement.
		 * @param {ASTNode} initExpression The init node of the VariableDeclarator.
		 * @returns {string} The type of declaration represented by the expression.
		 */
		function getDeclarationType(initExpression) {
			if (!initExpression) {
				// "var x;"
				return DECL_UNINITIALIZED;
			}

			if (
				initExpression.type === "CallExpression" &&
				initExpression.callee.type === "Identifier" &&
				initExpression.callee.name === "require"
			) {
				// "var x = require('util');"
				return DECL_REQUIRE;
			}
			if (
				allowCall &&
				initExpression.type === "CallExpression" &&
				initExpression.callee.type === "CallExpression"
			) {
				// "var x = require('diagnose')('sub-module');"
				return getDeclarationType(initExpression.callee);
			}
			if (initExpression.type === "MemberExpression") {
				// "var x = require('glob').Glob;"
				return getDeclarationType(initExpression.object);
			}

			// "var x = 42;"
			return DECL_OTHER;
		}

		/**
		 * Determines the type of module that is loaded via require.
		 * @param {ASTNode} initExpression The init node of the VariableDeclarator.
		 * @returns {string} The module type.
		 */
		function inferModuleType(initExpression) {
			if (initExpression.type === "MemberExpression") {
				// "var x = require('glob').Glob;"
				return inferModuleType(initExpression.object);
			}
			if (initExpression.arguments.length === 0) {
				// "var x = require();"
				return REQ_COMPUTED;
			}

			const arg = initExpression.arguments[0];

			if (arg.type !== "Literal" || typeof arg.value !== "string") {
				// "var x = require(42);"
				return REQ_COMPUTED;
			}

			if (BUILTIN_MODULES.includes(arg.value)) {
				// "var fs = require('fs');"
				return REQ_CORE;
			}
			if (/^\.{0,2}\//u.test(arg.value)) {
				// "var utils = require('./utils');"
				return REQ_FILE;
			}

			// "var async = require('async');"
			return REQ_MODULE;
		}

		/**
		 * Check if the list of variable declarations is mixed, i.e. whether it
		 * contains both require and other declarations.
		 * @param {ASTNode} declarations The list of VariableDeclarators.
		 * @returns {boolean} True if the declarations are mixed, false if not.
		 */
		function isMixed(declarations) {
			const contains = {};

			declarations.forEach(declaration => {
				const type = getDeclarationType(declaration.init);

				contains[type] = true;
			});

			return !!(
				contains[DECL_REQUIRE] &&
				(contains[DECL_UNINITIALIZED] || contains[DECL_OTHER])
			);
		}

		/**
		 * Check if all require declarations in the given list are of the same
		 * type.
		 * @param {ASTNode} declarations The list of VariableDeclarators.
		 * @returns {boolean} True if the declarations are grouped, false if not.
		 */
		function isGrouped(declarations) {
			const found = {};

			declarations.forEach(declaration => {
				if (getDeclarationType(declaration.init) === DECL_REQUIRE) {
					found[inferModuleType(declaration.init)] = true;
				}
			});

			return Object.keys(found).length <= 1;
		}

		return {
			VariableDeclaration(node) {
				if (isMixed(node.declarations)) {
					context.report({
						node,
						messageId: "noMixRequire",
					});
				} else if (grouping && !isGrouped(node.declarations)) {
					context.report({
						node,
						messageId: "noMixCoreModuleFileComputed",
					});
				}
			},
		};
	},
};
z&Pxs/**
 * @fileoverview Disallow mixed spaces and tabs for indentation
 * @author Jary Niebur
 * @deprecated in ESLint v8.53.0
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "no-mixed-spaces-and-tabs",
						url: "https://eslint.style/rules/no-mixed-spaces-and-tabs",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Disallow mixed spaces and tabs for indentation",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-mixed-spaces-and-tabs",
		},

		schema: [
			{
				enum: ["smart-tabs", true, false],
			},
		],

		messages: {
			mixedSpacesAndTabs: "Mixed spaces and tabs.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		let smartTabs;

		switch (context.options[0]) {
			case true: // Support old syntax, maybe add deprecation warning here
			case "smart-tabs":
				smartTabs = true;
				break;
			default:
				smartTabs = false;
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			"Program:exit"(node) {
				const lines = sourceCode.lines,
					comments = sourceCode.getAllComments(),
					ignoredCommentLines = new Set();

				// Add all lines except the first ones.
				comments.forEach(comment => {
					for (
						let i = comment.loc.start.line + 1;
						i <= comment.loc.end.line;
						i++
					) {
						ignoredCommentLines.add(i);
					}
				});

				/*
				 * At least one space followed by a tab
				 * or the reverse before non-tab/-space
				 * characters begin.
				 */
				let regex = /^(?=( +|\t+))\1(?:\t| )/u;

				if (smartTabs) {
					/*
					 * At least one space followed by a tab
					 * before non-tab/-space characters begin.
					 */
					// eslint-disable-next-line regexp/no-empty-lookarounds-assertion -- False positive
					regex = /^(?=(\t*))\1(?=( +))\2\t/u;
				}

				lines.forEach((line, i) => {
					const match = regex.exec(line);

					if (match) {
						const lineNumber = i + 1;
						const loc = {
							start: {
								line: lineNumber,
								column: match[0].length - 2,
							},
							end: {
								line: lineNumber,
								column: match[0].length,
							},
						};

						if (!ignoredCommentLines.has(lineNumber)) {
							const containingNode =
								sourceCode.getNodeByRangeIndex(
									sourceCode.getIndexFromLoc(loc.start),
								);

							if (!(
								containingNode &&
								["Literal", "TemplateElement"].includes(
									containingNode.type,
								)
							)) {
								context.report({
									node,
									loc,
									messageId: "mixedSpacesAndTabs",
								});
							}
						}
					}
				});
			},
		};
	},
};
PRx//**
 * @fileoverview Rule to check use of chained assignment expressions
 * @author Stewart Rand
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				ignoreNonDeclaration: false,
			},
		],

		docs: {
			description: "Disallow use of chained assignment expressions",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-multi-assign",
		},

		schema: [
			{
				type: "object",
				properties: {
					ignoreNonDeclaration: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			unexpectedChain: "Unexpected chained assignment.",
		},
	},

	create(context) {
		const [{ ignoreNonDeclaration }] = context.options;
		const selectors = [
			"VariableDeclarator > AssignmentExpression.init",
			"PropertyDefinition > AssignmentExpression.value",
		];

		if (!ignoreNonDeclaration) {
			selectors.push("AssignmentExpression > AssignmentExpression.right");
		}

		return {
			[selectors](node) {
				context.report({
					node,
					messageId: "unexpectedChain",
				});
			},
		};
	},
};
x/**
 * @fileoverview Disallow use of multiple spaces.
 * @author Nicholas C. Zakas
 * @deprecated in ESLint v8.53.0
 */

"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "no-multi-spaces",
						url: "https://eslint.style/rules/no-multi-spaces",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Disallow multiple spaces",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-multi-spaces",
		},

		fixable: "whitespace",

		schema: [
			{
				type: "object",
				properties: {
					exceptions: {
						type: "object",
						patternProperties: {
							"^([A-Z][a-z]*)+$": {
								type: "boolean",
							},
						},
						additionalProperties: false,
					},
					ignoreEOLComments: {
						type: "boolean",
						default: false,
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			multipleSpaces: "Multiple spaces found before '{{displayValue}}'.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const options = context.options[0] || {};
		const ignoreEOLComments = options.ignoreEOLComments;
		const exceptions = Object.assign(
			{ Property: true },
			options.exceptions,
		);
		const hasExceptions = Object.keys(exceptions).some(
			key => exceptions[key],
		);

		/**
		 * Formats value of given comment token for error message by truncating its length.
		 * @param {Token} token comment token
		 * @returns {string} formatted value
		 * @private
		 */
		function formatReportedCommentValue(token) {
			const valueLines = token.value.split("\n");
			const value = valueLines[0];
			const formattedValue = `${value.slice(0, 12)}...`;

			return valueLines.length === 1 && value.length <= 12
				? value
				: formattedValue;
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			Program() {
				sourceCode.tokensAndComments.forEach(
					(leftToken, leftIndex, tokensAndComments) => {
						if (leftIndex === tokensAndComments.length - 1) {
							return;
						}
						const rightToken = tokensAndComments[leftIndex + 1];

						// Ignore tokens that don't have 2 spaces between them or are on different lines
						if (
							!sourceCode.text
								.slice(leftToken.range[1], rightToken.range[0])
								.includes("  ") ||
							leftToken.loc.end.line < rightToken.loc.start.line
						) {
							return;
						}

						// Ignore comments that are the last token on their line if `ignoreEOLComments` is active.
						if (
							ignoreEOLComments &&
							astUtils.isCommentToken(rightToken) &&
							(leftIndex === tokensAndComments.length - 2 ||
								rightToken.loc.end.line <
									tokensAndComments[leftIndex + 2].loc.start
										.line)
						) {
							return;
						}

						// Ignore tokens that are in a node in the "exceptions" object
						if (hasExceptions) {
							const parentNode = sourceCode.getNodeByRangeIndex(
								rightToken.range[0] - 1,
							);

							if (parentNode && exceptions[parentNode.type]) {
								return;
							}
						}

						let displayValue;

						if (rightToken.type === "Block") {
							displayValue = `/*${formatReportedCommentValue(rightToken)}*/`;
						} else if (rightToken.type === "Line") {
							displayValue = `//${formatReportedCommentValue(rightToken)}`;
						} else {
							displayValue = rightToken.value;
						}

						context.report({
							node: rightToken,
							loc: {
								start: leftToken.loc.end,
								end: rightToken.loc.start,
							},
							messageId: "multipleSpaces",
							data: { displayValue },
							fix: fixer =>
								fixer.replaceTextRange(
									[leftToken.range[1], rightToken.range[0]],
									" ",
								),
						});
					},
				);
			},
		};
	},
};
պdxJ/**
 * @fileoverview Rule to flag when using multiline strings
 * @author Ilya Volodin
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow multiline strings",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/no-multi-str",
		},

		schema: [],

		messages: {
			multilineString:
				"Multiline support is limited to browsers supporting ES5 only.",
		},
	},

	create(context) {
		/**
		 * Determines if a given node is part of JSX syntax.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} True if the node is a JSX node, false if not.
		 * @private
		 */
		function isJSXElement(node) {
			return node.type.indexOf("JSX") === 0;
		}

		//--------------------------------------------------------------------------
		// Public API
		//--------------------------------------------------------------------------

		return {
			Literal(node) {
				if (
					astUtils.LINEBREAK_MATCHER.test(node.raw) &&
					!isJSXElement(node.parent)
				) {
					context.report({
						node,
						messageId: "multilineString",
					});
				}
			},
		};
	},
};
Ex2/**
 * @fileoverview Disallows multiple blank lines.
 * implementation adapted from the no-trailing-spaces rule.
 * @author Greg Cochard
 * @deprecated in ESLint v8.53.0
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "no-multiple-empty-lines",
						url: "https://eslint.style/rules/no-multiple-empty-lines",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Disallow multiple empty lines",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-multiple-empty-lines",
		},

		fixable: "whitespace",

		schema: [
			{
				type: "object",
				properties: {
					max: {
						type: "integer",
						minimum: 0,
					},
					maxEOF: {
						type: "integer",
						minimum: 0,
					},
					maxBOF: {
						type: "integer",
						minimum: 0,
					},
				},
				required: ["max"],
				additionalProperties: false,
			},
		],

		messages: {
			blankBeginningOfFile:
				"Too many blank lines at the beginning of file. Max of {{max}} allowed.",
			blankEndOfFile:
				"Too many blank lines at the end of file. Max of {{max}} allowed.",
			consecutiveBlank:
				"More than {{max}} blank {{pluralizedLines}} not allowed.",
		},
	},

	create(context) {
		// Use options.max or 2 as default
		let max = 2,
			maxEOF = max,
			maxBOF = max;

		if (context.options.length) {
			max = context.options[0].max;
			maxEOF =
				typeof context.options[0].maxEOF !== "undefined"
					? context.options[0].maxEOF
					: max;
			maxBOF =
				typeof context.options[0].maxBOF !== "undefined"
					? context.options[0].maxBOF
					: max;
		}

		const sourceCode = context.sourceCode;

		// Swallow the final newline, as some editors add it automatically and we don't want it to cause an issue
		const allLines =
			sourceCode.lines.at(-1) === ""
				? sourceCode.lines.slice(0, -1)
				: sourceCode.lines;
		const templateLiteralLines = new Set();

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			TemplateLiteral(node) {
				node.quasis.forEach(literalPart => {
					// Empty lines have a semantic meaning if they're inside template literals. Don't count these as empty lines.
					for (
						let ignoredLine = literalPart.loc.start.line;
						ignoredLine < literalPart.loc.end.line;
						ignoredLine++
					) {
						templateLiteralLines.add(ignoredLine);
					}
				});
			},
			"Program:exit"(node) {
				return (
					allLines

						// Given a list of lines, first get a list of line numbers that are non-empty.
						.reduce((nonEmptyLineNumbers, line, index) => {
							if (
								line.trim() ||
								templateLiteralLines.has(index + 1)
							) {
								nonEmptyLineNumbers.push(index + 1);
							}
							return nonEmptyLineNumbers;
						}, [])

						// Add a value at the end to allow trailing empty lines to be checked.
						.concat(allLines.length + 1)

						// Given two line numbers of non-empty lines, report the lines between if the difference is too large.
						.reduce((lastLineNumber, lineNumber) => {
							let messageId, maxAllowed;

							if (lastLineNumber === 0) {
								messageId = "blankBeginningOfFile";
								maxAllowed = maxBOF;
							} else if (lineNumber === allLines.length + 1) {
								messageId = "blankEndOfFile";
								maxAllowed = maxEOF;
							} else {
								messageId = "consecutiveBlank";
								maxAllowed = max;
							}

							if (lineNumber - lastLineNumber - 1 > maxAllowed) {
								context.report({
									node,
									loc: {
										start: {
											line:
												lastLineNumber + maxAllowed + 1,
											column: 0,
										},
										end: { line: lineNumber, column: 0 },
									},
									messageId,
									data: {
										max: maxAllowed,
										pluralizedLines:
											maxAllowed === 1 ? "line" : "lines",
									},
									fix(fixer) {
										const rangeStart =
											sourceCode.getIndexFromLoc({
												line: lastLineNumber + 1,
												column: 0,
											});

										/*
										 * The end of the removal range is usually the start index of the next line.
										 * However, at the end of the file there is no next line, so the end of the
										 * range is just the length of the text.
										 */
										const lineNumberAfterRemovedLines =
											lineNumber - maxAllowed;
										const rangeEnd =
											lineNumberAfterRemovedLines <=
											allLines.length
												? sourceCode.getIndexFromLoc({
														line: lineNumberAfterRemovedLines,
														column: 0,
													})
												: sourceCode.text.length;

										return fixer.removeRange([
											rangeStart,
											rangeEnd,
										]);
									},
								});
							}

							return lineNumber;
						}, 0)
				);
			},
		};
	},
};
RNx$/**
 * @fileoverview Disallow reassigning function parameters.
 * @author Nat Burns
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

const stopNodePattern =
	/(?:Statement|Declaration|Function(?:Expression)?|Program)$/u;

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow reassigning function parameters",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-param-reassign",
		},

		schema: [
			{
				oneOf: [
					{
						type: "object",
						properties: {
							props: {
								enum: [false],
							},
						},
						additionalProperties: false,
					},
					{
						type: "object",
						properties: {
							props: {
								enum: [true],
							},
							ignorePropertyModificationsFor: {
								type: "array",
								items: {
									type: "string",
								},
								uniqueItems: true,
							},
							ignorePropertyModificationsForRegex: {
								type: "array",
								items: {
									type: "string",
								},
								uniqueItems: true,
							},
						},
						additionalProperties: false,
					},
				],
			},
		],

		messages: {
			assignmentToFunctionParam:
				"Assignment to function parameter '{{name}}'.",
			assignmentToFunctionParamProp:
				"Assignment to property of function parameter '{{name}}'.",
		},
	},

	create(context) {
		const props = context.options[0] && context.options[0].props;
		const ignoredPropertyAssignmentsFor =
			(context.options[0] &&
				context.options[0].ignorePropertyModificationsFor) ||
			[];
		const ignoredPropertyAssignmentsForRegex =
			(context.options[0] &&
				context.options[0].ignorePropertyModificationsForRegex) ||
			[];
		const sourceCode = context.sourceCode;

		/**
		 * Checks whether or not the reference modifies properties of its variable.
		 * @param {Reference} reference A reference to check.
		 * @returns {boolean} Whether or not the reference modifies properties of its variable.
		 */
		function isModifyingProp(reference) {
			let node = reference.identifier;
			let parent = node.parent;

			while (
				parent &&
				(!stopNodePattern.test(parent.type) ||
					parent.type === "ForInStatement" ||
					parent.type === "ForOfStatement")
			) {
				switch (parent.type) {
					// e.g. foo.a = 0;
					case "AssignmentExpression":
						return parent.left === node;

					// e.g. ++foo.a;
					case "UpdateExpression":
						return true;

					// e.g. delete foo.a;
					case "UnaryExpression":
						if (parent.operator === "delete") {
							return true;
						}
						break;

					// e.g. for (foo.a in b) {}
					case "ForInStatement":
					case "ForOfStatement":
						if (parent.left === node) {
							return true;
						}

						// this is a stop node for parent.right and parent.body
						return false;

					// EXCLUDES: e.g. cache.get(foo.a).b = 0;
					case "CallExpression":
						if (parent.callee !== node) {
							return false;
						}
						break;

					// EXCLUDES: e.g. cache[foo.a] = 0;
					case "MemberExpression":
						if (parent.property === node) {
							return false;
						}
						break;

					// EXCLUDES: e.g. ({ [foo]: a }) = bar;
					case "Property":
						if (parent.key === node) {
							return false;
						}

						break;

					// EXCLUDES: e.g. (foo ? a : b).c = bar;
					case "ConditionalExpression":
						if (parent.test === node) {
							return false;
						}

						break;

					// no default
				}

				node = parent;
				parent = node.parent;
			}

			return false;
		}

		/**
		 * Tests that an identifier name matches any of the ignored property assignments.
		 * First we test strings in ignoredPropertyAssignmentsFor.
		 * Then we instantiate and test RegExp objects from ignoredPropertyAssignmentsForRegex strings.
		 * @param {string} identifierName A string that describes the name of an identifier to
		 * ignore property assignments for.
		 * @returns {boolean} Whether the string matches an ignored property assignment regular expression or not.
		 */
		function isIgnoredPropertyAssignment(identifierName) {
			return (
				ignoredPropertyAssignmentsFor.includes(identifierName) ||
				ignoredPropertyAssignmentsForRegex.some(ignored =>
					new RegExp(ignored, "u").test(identifierName),
				)
			);
		}

		/**
		 * Reports a reference if is non initializer and writable.
		 * @param {Reference} reference A reference to check.
		 * @param {number} index The index of the reference in the references.
		 * @param {Reference[]} references The array that the reference belongs to.
		 * @returns {void}
		 */
		function checkReference(reference, index, references) {
			const identifier = reference.identifier;

			if (
				identifier &&
				!reference.init &&
				/*
				 * Destructuring assignments can have multiple default value,
				 * so possibly there are multiple writeable references for the same identifier.
				 */
				(index === 0 || references[index - 1].identifier !== identifier)
			) {
				if (reference.isWrite()) {
					context.report({
						node: identifier,
						messageId: "assignmentToFunctionParam",
						data: { name: identifier.name },
					});
				} else if (
					props &&
					isModifyingProp(reference) &&
					!isIgnoredPropertyAssignment(identifier.name)
				) {
					context.report({
						node: identifier,
						messageId: "assignmentToFunctionParamProp",
						data: { name: identifier.name },
					});
				}
			}
		}

		/**
		 * Finds and reports references that are non initializer and writable.
		 * @param {Variable} variable A variable to check.
		 * @returns {void}
		 */
		function checkVariable(variable) {
			if (variable.defs[0].type === "Parameter") {
				variable.references.forEach(checkReference);
			}
		}

		/**
		 * Checks parameters of a given function node.
		 * @param {ASTNode} node A function node to check.
		 * @returns {void}
		 */
		function checkForFunction(node) {
			sourceCode.getDeclaredVariables(node).forEach(checkVariable);
		}

		return {
			// `:exit` is needed for the `node.parent` property of identifier nodes.
			"FunctionDeclaration:exit": checkForFunction,
			"FunctionExpression:exit": checkForFunction,
			"ArrowFunctionExpression:exit": checkForFunction,
		};
	},
};
_mLix;1Rule to disallow assignments to native objects or read-only global variables
 * @author Ilya Volodin
 * @deprecated in ESLint v
3.3.0
 */
WƓv~I
				"Disallow assignments to native objects or read-only global variableLCnative-reassign",
		},

		deprecated: {
			message: "Renamed rule."6blog/2016/08/eslint-v3.3.0-released/#deprecated-rules",
			deprecatedSince: "3.3.0",
			availableUntil: "11.0.0",
			replacedBy:: [
				{
					rule: {
						name: "no-global-assign",
			8!,rules/no-global-assign",
					},
				},
			]xAexceptions: {
items: { type: "string" },

},
				},
$GnativeReassign:
				"Read-only global '{{name}}' should not be modified)config8;
		const exceptions = (config && config.exceptions) || @9Reports writ$G3reference.init === false &&
				reference.isWrite()6@messageId: "nativeReassign",
					data: identifier,
				});
			}?9write references if a given variable is read-only builtin~P
				variable.writeable === false &&
				!exceptions.includes(variable.name)
			Areturn {
			Program(node) {
				const globalScope = sourceCode.getScope(node);

				globalScope.variables.forEach(checkVariable);
			},
		};
	},
};
c}Ͽx	/**
 * @fileoverview Rule to disallow a negated condition
 * @author Alberto Rodríguez
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow negated conditions",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/no-negated-condition",
		},

		schema: [],

		messages: {
			unexpectedNegated: "Unexpected negated condition.",
		},
	},

	create(context) {
		/**
		 * Determines if a given node is an if-else without a condition on the else
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} True if the node has an else without an if.
		 * @private
		 */
		function hasElseWithoutCondition(node) {
			return node.alternate && node.alternate.type !== "IfStatement";
		}

		/**
		 * Determines if a given node is a negated unary expression
		 * @param {Object} test The test object to check.
		 * @returns {boolean} True if the node is a negated unary expression.
		 * @private
		 */
		function isNegatedUnaryExpression(test) {
			return test.type === "UnaryExpression" && test.operator === "!";
		}

		/**
		 * Determines if a given node is a negated binary expression
		 * @param {Test} test The test to check.
		 * @returns {boolean} True if the node is a negated binary expression.
		 * @private
		 */
		function isNegatedBinaryExpression(test) {
			return (
				test.type === "BinaryExpression" &&
				(test.operator === "!=" || test.operator === "!==")
			);
		}

		/**
		 * Determines if a given node has a negated if expression
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} True if the node has a negated if expression.
		 * @private
		 */
		function isNegatedIf(node) {
			return (
				isNegatedUnaryExpression(node.test) ||
				isNegatedBinaryExpression(node.test)
			);
		}

		return {
			IfStatement(node) {
				if (!hasElseWithoutCondition(node)) {
					return;
				}

				if (isNegatedIf(node)) {
					context.report({
						node,
						messageId: "unexpectedNegated",
					});
				}
			},
			ConditionalExpression(node) {
				if (isNegatedIf(node)) {
					context.report({
						node,
						messageId: "unexpectedNegated",
					});
				}
			},
		};
	},
};
 Sx:/**
 * @fileoverview A rule to disallow negated left operands of the `in` operator
 * @author Michael Ficarra
 * @deprecated in ESLint v3.3.0
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description:
				"Disallow negating the left operand in `in` expressions",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-negated-in-lhs",
		},

		deprecated: {
			message: "Renamed rule.",
			url: "https://eslint.org/blog/2016/08/eslint-v3.3.0-released/#deprecated-rules",
			deprecatedSince: "3.3.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					rule: {
						name: "no-unsafe-negation",
						url: "https://eslint.org/docs/rules/no-unsafe-negation",
					},
				},
			],
		},
		schema: [],

		messages: {
			negatedLHS: "The 'in' expression's left operand is negated.",
		},
	},

	create(context) {
		return {
			BinaryExpression(node) {
				if (
					node.operator === "in" &&
					node.left.type === "UnaryExpression" &&
					node.left.operator === "!"
				) {
					context.report({ node, messageId: "negatedLHS" });
				}
			},
		};
	},
};
{9<x?/**
 * @fileoverview Rule to flag nested ternary expressions
 * @author Ian Christian Myers
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow nested ternary expressions",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/no-nested-ternary",
		},

		schema: [],

		messages: {
			noNestedTernary: "Do not nest ternary expressions.",
		},
	},

	create(context) {
		return {
			ConditionalExpression(node) {
				if (
					node.alternate.type === "ConditionalExpression" ||
					node.consequent.type === "ConditionalExpression"
				) {
					context.report({
						node,
						messageId: "noNestedTernary",
					});
				}
			},
		};
	},
};
0xY	/**
 * @fileoverview Rule to flag when using new Function
 * @author Ilya Volodin
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const callMethods = new Set(["apply", "bind", "call"]);

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow `new` operators with the `Function` object",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-new-func",
		},

		schema: [],

		messages: {
			noFunctionConstructor: "The Function constructor is eval.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		return {
			"Program:exit"(node) {
				const globalScope = sourceCode.getScope(node);
				const variable = globalScope.set.get("Function");

				if (variable && variable.defs.length === 0) {
					variable.references.forEach(ref => {
						const idNode = ref.identifier;
						const { parent } = idNode;
						let evalNode;

						if (parent) {
							if (
								idNode === parent.callee &&
								(parent.type === "NewExpression" ||
									parent.type === "CallExpression")
							) {
								evalNode = parent;
							} else if (
								parent.type === "MemberExpression" &&
								idNode === parent.object &&
								callMethods.has(
									astUtils.getStaticPropertyName(parent),
								)
							) {
								const maybeCallee =
									parent.parent.type === "ChainExpression"
										? parent.parent
										: parent;

								if (
									maybeCallee.parent.type ===
										"CallExpression" &&
									maybeCallee.parent.callee === maybeCallee
								) {
									evalNode = maybeCallee.parent;
								}
							}
						}

						if (evalNode) {
							context.report({
								node: evalNode,
								messageId: "noFunctionConstructor",
							});
						}
					});
				}
			},
		};
	},
};
?nmx%/**
 * @fileoverview Rule to disallow use of the new operator with global non-constructor functions
 * @author Sosuke Suzuki
 */

"use strict";

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const nonConstructorGlobalFunctionNames = ["Symbol", "BigInt"];

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description:
				"Disallow `new` operators with global non-constructor functions",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-new-native-nonconstructor",
		},

		schema: [],

		messages: {
			noNewNonconstructor:
				"`{{name}}` cannot be called as a constructor.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		return {
			"Program:exit"(node) {
				const globalScope = sourceCode.getScope(node);

				for (const nonConstructorName of nonConstructorGlobalFunctionNames) {
					const variable = globalScope.set.get(nonConstructorName);

					if (variable && variable.defs.length === 0) {
						variable.references.forEach(ref => {
							const idNode = ref.identifier;
							const parent = idNode.parent;

							if (
								parent &&
								parent.type === "NewExpression" &&
								parent.callee === idNode
							) {
								context.report({
									node: idNode,
									messageId: "noNewNonconstructor",
									data: { name: nonConstructorName },
								});
							}
						});
					}
				}
			},
		};
	},
};
$txJ/**
 * @fileoverview A rule to disallow calls to the Object constructor
 * @author Matt DuVall <http://www.mattduvall.com/>
 * @deprecated in ESLint v8.50.0
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow `Object` constructors",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-new-object",
		},

		deprecated: {
			message:
				"The new rule flags more situations where object literal syntax can be used, and it does not report a problem when the `Object` constructor is invoked with an argument.",
			url: "https://eslint.org/blog/2023/09/eslint-v8.50.0-released/",
			deprecatedSince: "8.50.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					rule: {
						name: "no-object-constructor",
						url: "https://eslint.org/docs/rules/no-object-constructor",
					},
				},
			],
		},

		schema: [],

		messages: {
			preferLiteral: "The object literal notation {} is preferable.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		return {
			NewExpression(node) {
				const variable = astUtils.getVariableByName(
					sourceCode.getScope(node),
					node.callee.name,
				);

				if (variable && variable.identifiers.length > 0) {
					return;
				}

				if (node.callee.name === "Object") {
					context.report({
						node,
						messageId: "preferLiteral",
					});
				}
			},
		};
	},
};
51cx4/**
 * @fileoverview Rule to disallow use of new operator with the `require` function
 * @author Wil Moore III
 * @deprecated in ESLint v7.0.0
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Node.js rules were moved out of ESLint core.",
			url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
			deprecatedSince: "7.0.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"eslint-plugin-n now maintains deprecated Node.js-related rules.",
					plugin: {
						name: "eslint-plugin-n",
						url: "https://github.com/eslint-community/eslint-plugin-n",
					},
					rule: {
						name: "no-new-require",
						url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-new-require.md",
					},
				},
			],
		},

		type: "suggestion",

		docs: {
			description: "Disallow `new` operators with calls to `require`",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-new-require",
		},

		schema: [],

		messages: {
			noNewRequire: "Unexpected use of new with require.",
		},
	},

	create(context) {
		return {
			NewExpression(node) {
				if (
					node.callee.type === "Identifier" &&
					node.callee.name === "require"
				) {
					context.report({
						node,
						messageId: "noNewRequire",
					});
				}
			},
		};
	},
};
˞lx4/**
 * @fileoverview Rule to disallow use of the new operator with the `Symbol` object
 * @author Alberto Rodríguez
 * @deprecated in ESLint v9.0.0
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description: "Disallow `new` operators with the `Symbol` object",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-new-symbol",
		},

		deprecated: {
			message: "The rule was replaced with a more general rule.",
			url: "https://eslint.org/docs/latest/use/migrate-to-9.0.0#eslint-recommended",
			deprecatedSince: "9.0.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					rule: {
						name: "no-new-native-nonconstructor",
						url: "https://eslint.org/docs/latest/rules/no-new-native-nonconstructor",
					},
				},
			],
		},

		schema: [],

		messages: {
			noNewSymbol: "`Symbol` cannot be called as a constructor.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		return {
			"Program:exit"(node) {
				const globalScope = sourceCode.getScope(node);
				const variable = globalScope.set.get("Symbol");

				if (variable && variable.defs.length === 0) {
					variable.references.forEach(ref => {
						const idNode = ref.identifier;
						const parent = idNode.parent;

						if (
							parent &&
							parent.type === "NewExpression" &&
							parent.callee === idNode
						) {
							context.report({
								node: idNode,
								messageId: "noNewSymbol",
							});
						}
					});
				}
			},
		};
	},
};
?[xK/**
 * @fileoverview Rule to flag when using constructor for wrapper objects
 * @author Ilya Volodin
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const { getVariableByName } = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Disallow `new` operators with the `String`, `Number`, and `Boolean` objects",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-new-wrappers",
		},

		schema: [],

		messages: {
			noConstructor: "Do not use {{fn}} as a constructor.",
		},
	},

	create(context) {
		const { sourceCode } = context;

		return {
			NewExpression(node) {
				const wrapperObjects = ["String", "Number", "Boolean"];
				const { name } = node.callee;

				if (wrapperObjects.includes(name)) {
					const variable = getVariableByName(
						sourceCode.getScope(node),
						name,
					);

					if (variable && variable.identifiers.length === 0) {
						context.report({
							node,
							messageId: "noConstructor",
							data: { fn: name },
						});
					}
				}
			},
		};
	},
};
'V8xv/**
 * @fileoverview Rule to flag statements with function invocation preceded by
 * "new" and not part of assignment
 * @author Ilya Volodin
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Disallow `new` operators outside of assignments or comparisons",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-new",
		},

		schema: [],

		messages: {
			noNewStatement: "Do not use 'new' for side effects.",
		},
	},

	create(context) {
		return {
			"ExpressionStatement > NewExpression"(node) {
				context.report({
					node: node.parent,
					messageId: "noNewStatement",
				});
			},
		};
	},
};
hx)/**
 * @fileoverview Rule to disallow `\8` and `\9` escape sequences in string literals.
 * @author Milos Djermanovic
 */

"use strict";

//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------

/**
 * @import { SourceRange } from "@eslint/core";
 */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const QUICK_TEST_REGEX = /\\[89]/u;

/**
 * Returns unicode escape sequence that represents the given character.
 * @param {string} character A single code unit.
 * @returns {string} "\uXXXX" sequence.
 */
function getUnicodeEscape(character) {
	return `\\u${character.charCodeAt(0).toString(16).padStart(4, "0")}`;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Disallow `\\8` and `\\9` escape sequences in string literals",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-nonoctal-decimal-escape",
		},

		hasSuggestions: true,

		schema: [],

		messages: {
			decimalEscape: "Don't use '{{decimalEscape}}' escape sequence.",

			// suggestions
			refactor:
				"Replace '{{original}}' with '{{replacement}}'. This maintains the current functionality.",
			escapeBackslash:
				"Replace '{{original}}' with '{{replacement}}' to include the actual backslash character.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		/**
		 * Creates a new Suggestion object.
		 * @param {string} messageId "refactor" or "escapeBackslash".
		 * @param {SourceRange} range The range to replace.
		 * @param {string} replacement New text for the range.
		 * @returns {Object} Suggestion
		 */
		function createSuggestion(messageId, range, replacement) {
			return {
				messageId,
				data: {
					original: sourceCode.getText().slice(...range),
					replacement,
				},
				fix(fixer) {
					return fixer.replaceTextRange(range, replacement);
				},
			};
		}

		return {
			Literal(node) {
				if (typeof node.value !== "string") {
					return;
				}

				if (!QUICK_TEST_REGEX.test(node.raw)) {
					return;
				}

				const regex =
					/(?:[^\\]|(?<previousEscape>\\.))*?(?<decimalEscape>\\[89])/suy;
				let match;

				while ((match = regex.exec(node.raw))) {
					const { previousEscape, decimalEscape } = match.groups;
					const decimalEscapeRangeEnd =
						node.range[0] + match.index + match[0].length;
					const decimalEscapeRangeStart =
						decimalEscapeRangeEnd - decimalEscape.length;
					const decimalEscapeRange = [
						decimalEscapeRangeStart,
						decimalEscapeRangeEnd,
					];
					const suggest = [];

					// When `regex` is matched, `previousEscape` can only capture characters adjacent to `decimalEscape`
					if (previousEscape === "\\0") {
						/*
						 * Now we have a NULL escape "\0" immediately followed by a decimal escape, e.g.: "\0\8".
						 * Fixing this to "\08" would turn "\0" into a legacy octal escape. To avoid producing
						 * an octal escape while fixing a decimal escape, we provide different suggestions.
						 */
						suggest.push(
							createSuggestion(
								// "\0\8" -> "\u00008"
								"refactor",
								[
									decimalEscapeRangeStart -
										previousEscape.length,
									decimalEscapeRangeEnd,
								],
								`${getUnicodeEscape("\0")}${decimalEscape[1]}`,
							),
							createSuggestion(
								// "\8" -> "\u0038"
								"refactor",
								decimalEscapeRange,
								getUnicodeEscape(decimalEscape[1]),
							),
						);
					} else {
						suggest.push(
							createSuggestion(
								// "\8" -> "8"
								"refactor",
								decimalEscapeRange,
								decimalEscape[1],
							),
						);
					}

					suggest.push(
						createSuggestion(
							// "\8" -> "\\8"
							"escapeBackslash",
							decimalEscapeRange,
							`\\${decimalEscape}`,
						),
					);

					context.report({
						node,
						loc: {
							start: sourceCode.getLocFromIndex(
								decimalEscapeRangeStart,
							),
							end: sourceCode.getLocFromIndex(
								decimalEscapeRangeEnd,
							),
						},
						messageId: "decimalEscape",
						data: {
							decimalEscape,
						},
						suggest,
					});
				}
			},
		};
	},
};
	6x	H/**
 * @fileoverview Rule to flag use of an object property of the global object (Math and JSON) as a function
 * @author James Allardice
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const {
	CALL,
	CONSTRUCT,
	ReferenceTracker,
} = require("@eslint-community/eslint-utils");
const getPropertyName = require("./utils/ast-utils").getStaticPropertyName;

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const nonCallableGlobals = [
	"Atomics",
	"JSON",
	"Math",
	"Reflect",
	"Intl",
	"Temporal",
];

/**
 * Returns the name of the node to report
 * @param {ASTNode} node A node to report
 * @returns {string} name to report
 */
function getReportNodeName(node) {
	if (node.type === "ChainExpression") {
		return getReportNodeName(node.expression);
	}
	if (node.type === "MemberExpression") {
		return getPropertyName(node);
	}
	return node.name;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description:
				"Disallow calling global object properties as functions",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-obj-calls",
		},

		schema: [],

		messages: {
			unexpectedCall: "'{{name}}' is not a function.",
			unexpectedRefCall:
				"'{{name}}' is reference to '{{ref}}', which is not a function.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		return {
			Program(node) {
				const scope = sourceCode.getScope(node);
				const tracker = new ReferenceTracker(scope);
				const traceMap = {};

				for (const g of nonCallableGlobals) {
					traceMap[g] = {
						[CALL]: true,
						[CONSTRUCT]: true,
					};
				}

				for (const {
					node: refNode,
					path,
				} of tracker.iterateGlobalReferences(traceMap)) {
					const name = getReportNodeName(refNode.callee);
					const ref = path[0];
					const messageId =
						name === ref ? "unexpectedCall" : "unexpectedRefCall";

					context.report({
						node: refNode,
						messageId,
						data: { name, ref },
					});
				}
			},
		};
	},
};
xk/**
 * @fileoverview Rule to disallow calls to the `Object` constructor without an argument
 * @author Francesco Trotta
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const {
	getVariableByName,
	isArrowToken,
	isStartOfExpressionStatement,
	needsPrecedingSemicolon,
} = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Disallow calls to the `Object` constructor without an argument",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-object-constructor",
		},

		hasSuggestions: true,

		schema: [],

		messages: {
			preferLiteral: "The object literal notation {} is preferable.",
			useLiteral: "Replace with '{{replacement}}'.",
			useLiteralAfterSemicolon:
				"Replace with '{{replacement}}', add preceding semicolon.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		/**
		 * Determines whether or not an object literal that replaces a specified node needs to be enclosed in parentheses.
		 * @param {ASTNode} node The node to be replaced.
		 * @returns {boolean} Whether or not parentheses around the object literal are required.
		 */
		function needsParentheses(node) {
			if (isStartOfExpressionStatement(node)) {
				return true;
			}

			const prevToken = sourceCode.getTokenBefore(node);

			if (prevToken && isArrowToken(prevToken)) {
				return true;
			}

			return false;
		}

		/**
		 * Reports on nodes where the `Object` constructor is called without arguments.
		 * @param {ASTNode} node The node to evaluate.
		 * @returns {void}
		 */
		function check(node) {
			if (
				node.callee.type !== "Identifier" ||
				node.callee.name !== "Object" ||
				node.arguments.length
			) {
				return;
			}

			const variable = getVariableByName(
				sourceCode.getScope(node),
				"Object",
			);

			if (variable && variable.identifiers.length === 0) {
				let replacement;
				let fixText;
				let messageId = "useLiteral";

				if (needsParentheses(node)) {
					replacement = "({})";
					if (needsPrecedingSemicolon(sourceCode, node)) {
						fixText = ";({})";
						messageId = "useLiteralAfterSemicolon";
					} else {
						fixText = "({})";
					}
				} else {
					replacement = fixText = "{}";
				}

				context.report({
					node,
					messageId: "preferLiteral",
					suggest: [
						{
							messageId,
							data: { replacement },
							fix: fixer => fixer.replaceText(node, fixText),
						},
					],
				});
			}
		}

		return {
			CallExpression: check,
			NewExpression: check,
		};
	},
};
^Ixh/**
 * @fileoverview Rule to flag octal escape sequences in string literals.
 * @author Ian Christian Myers
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow octal escape sequences in string literals",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-octal-escape",
		},

		schema: [],

		messages: {
			octalEscapeSequence:
				"Don't use octal: '\\{{sequence}}'. Use '\\u....' instead.",
		},
	},

	create(context) {
		return {
			Literal(node) {
				if (typeof node.value !== "string") {
					return;
				}

				// \0 represents a valid NULL character if it isn't followed by a digit.
				const match = node.raw.match(
					/^(?:[^\\]|\\.)*?\\([0-3][0-7]{1,2}|[4-7][0-7]|0(?=[89])|[1-7])/su,
				);

				if (match) {
					context.report({
						node,
						messageId: "octalEscapeSequence",
						data: { sequence: match[1] },
					});
				}
			},
		};
	},
};
uJ4x@/**
 * @fileoverview Rule to flag when initializing octal literal
 * @author Ilya Volodin
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow octal literals",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-octal",
		},

		schema: [],

		messages: {
			noOctal: "Octal literals should not be used.",
		},
	},

	create(context) {
		return {
			Literal(node) {
				if (typeof node.value === "number" && /^0\d/u.test(node.raw)) {
					context.report({
						node,
						messageId: "noOctal",
					});
				}
			},
		};
	},
};
}x#/**
 * @fileoverview Disallow string concatenation when using __dirname and __filename
 * @author Nicholas C. Zakas
 * @deprecated in ESLint v7.0.0
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Node.js rules were moved out of ESLint core.",
			url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
			deprecatedSince: "7.0.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"eslint-plugin-n now maintains deprecated Node.js-related rules.",
					plugin: {
						name: "eslint-plugin-n",
						url: "https://github.com/eslint-community/eslint-plugin-n",
					},
					rule: {
						name: "no-path-concat",
						url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-path-concat.md",
					},
				},
			],
		},

		type: "suggestion",

		docs: {
			description:
				"Disallow string concatenation with `__dirname` and `__filename`",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-path-concat",
		},

		schema: [],

		messages: {
			usePathFunctions:
				"Use path.join() or path.resolve() instead of + to create paths.",
		},
	},

	create(context) {
		const MATCHER = /^__(?:dir|file)name$/u;

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			BinaryExpression(node) {
				const left = node.left,
					right = node.right;

				if (
					node.operator === "+" &&
					((left.type === "Identifier" && MATCHER.test(left.name)) ||
						(right.type === "Identifier" &&
							MATCHER.test(right.name)))
				) {
					context.report({
						node,
						messageId: "usePathFunctions",
					});
				}
			},
		};
	},
};
1xp
/**
 * @fileoverview Rule to flag use of unary increment and decrement operators.
 * @author Ian Christian Myers
 * @author Brody McKee (github.com/mrmckeb)
 */

"use strict";

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Determines whether the given node is the update node of a `ForStatement`.
 * @param {ASTNode} node The node to check.
 * @returns {boolean} `true` if the node is `ForStatement` update.
 */
function isForStatementUpdate(node) {
	const parent = node.parent;

	return parent.type === "ForStatement" && parent.update === node;
}

/**
 * Determines whether the given node is considered to be a for loop "afterthought" by the logic of this rule.
 * In particular, it returns `true` if the given node is either:
 *   - The update node of a `ForStatement`: for (;; i++) {}
 *   - An operand of a sequence expression that is the update node: for (;; foo(), i++) {}
 *   - An operand of a sequence expression that is child of another sequence expression, etc.,
 *     up to the sequence expression that is the update node: for (;; foo(), (bar(), (baz(), i++))) {}
 * @param {ASTNode} node The node to check.
 * @returns {boolean} `true` if the node is a for loop afterthought.
 */
function isForLoopAfterthought(node) {
	const parent = node.parent;

	if (parent.type === "SequenceExpression") {
		return isForLoopAfterthought(parent);
	}

	return isForStatementUpdate(node);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				allowForLoopAfterthoughts: false,
			},
		],

		docs: {
			description: "Disallow the unary operators `++` and `--`",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/no-plusplus",
		},

		schema: [
			{
				type: "object",
				properties: {
					allowForLoopAfterthoughts: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			unexpectedUnaryOp: "Unary operator '{{operator}}' used.",
		},
	},

	create(context) {
		const [{ allowForLoopAfterthoughts }] = context.options;

		return {
			UpdateExpression(node) {
				if (allowForLoopAfterthoughts && isForLoopAfterthought(node)) {
					return;
				}

				context.report({
					node,
					messageId: "unexpectedUnaryOp",
					data: {
						operator: node.operator,
					},
				});
			},
		};
	},
};
SV)afxn/**
 * @fileoverview Disallow the use of process.env()
 * @author Vignesh Anand
 * @deprecated in ESLint v7.0.0
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Node.js rules were moved out of ESLint core.",
			url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
			deprecatedSince: "7.0.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"eslint-plugin-n now maintains deprecated Node.js-related rules.",
					plugin: {
						name: "eslint-plugin-n",
						url: "https://github.com/eslint-community/eslint-plugin-n",
					},
					rule: {
						name: "no-process-env",
						url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-process-env.md",
					},
				},
			],
		},

		type: "suggestion",

		docs: {
			description: "Disallow the use of `process.env`",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-process-env",
		},

		schema: [],

		messages: {
			unexpectedProcessEnv: "Unexpected use of process.env.",
		},
	},

	create(context) {
		return {
			MemberExpression(node) {
				const objectName = node.object.name,
					propertyName = node.property.name;

				if (
					objectName === "process" &&
					!node.computed &&
					propertyName &&
					propertyName === "env"
				) {
					context.report({ node, messageId: "unexpectedProcessEnv" });
				}
			},
		};
	},
};
0'ߜlx8/**
 * @fileoverview Disallow the use of process.exit()
 * @author Nicholas C. Zakas
 * @deprecated in ESLint v7.0.0
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Node.js rules were moved out of ESLint core.",
			url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
			deprecatedSince: "7.0.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"eslint-plugin-n now maintains deprecated Node.js-related rules.",
					plugin: {
						name: "eslint-plugin-n",
						url: "https://github.com/eslint-community/eslint-plugin-n",
					},
					rule: {
						name: "no-process-exit",
						url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-process-exit.md",
					},
				},
			],
		},

		type: "suggestion",

		docs: {
			description: "Disallow the use of `process.exit()`",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-process-exit",
		},

		schema: [],

		messages: {
			noProcessExit: "Don't use process.exit(); throw an error instead.",
		},
	},

	create(context) {
		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			"CallExpression > MemberExpression.callee[object.name = 'process'][property.name = 'exit']"(
				node,
			) {
				context.report({
					node: node.parent,
					messageId: "noProcessExit",
				});
			},
		};
	},
};
DxE/**
 * @fileoverview Rule to flag usage of __proto__ property
 * @author Ilya Volodin
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const { getStaticPropertyName } = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow the use of the `__proto__` property",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-proto",
		},

		schema: [],

		messages: {
			unexpectedProto: "The '__proto__' property is deprecated.",
		},
	},

	create(context) {
		return {
			MemberExpression(node) {
				if (getStaticPropertyName(node) === "__proto__") {
					context.report({ node, messageId: "unexpectedProto" });
				}
			},
		};
	},
};
.#xq/**
 * @fileoverview Rule to disallow use of Object.prototype builtins on objects
 * @author Andrew Levine
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Returns true if the node or any of the objects
 * to the left of it in the member/call chain is optional.
 *
 * e.g. `a?.b`, `a?.b.c`, `a?.()`, `a()?.()`
 * @param {ASTNode} node The expression to check
 * @returns {boolean} `true` if there is a short-circuiting optional `?.`
 * in the same option chain to the left of this call or member expression,
 * or the node itself is an optional call or member `?.`.
 */
function isAfterOptional(node) {
	let leftNode;

	if (node.type === "MemberExpression") {
		leftNode = node.object;
	} else if (node.type === "CallExpression") {
		leftNode = node.callee;
	} else {
		return false;
	}
	if (node.optional) {
		return true;
	}
	return isAfterOptional(leftNode);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description:
				"Disallow calling some `Object.prototype` methods directly on objects",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-prototype-builtins",
		},

		hasSuggestions: true,

		schema: [],

		messages: {
			prototypeBuildIn:
				"Do not access Object.prototype method '{{prop}}' from target object.",
			callObjectPrototype: "Call Object.prototype.{{prop}} explicitly.",
		},
	},

	create(context) {
		const DISALLOWED_PROPS = new Set([
			"hasOwnProperty",
			"isPrototypeOf",
			"propertyIsEnumerable",
		]);

		/**
		 * Reports if a disallowed property is used in a CallExpression
		 * @param {ASTNode} node The CallExpression node.
		 * @returns {void}
		 */
		function disallowBuiltIns(node) {
			const callee = astUtils.skipChainExpression(node.callee);

			if (callee.type !== "MemberExpression") {
				return;
			}

			const propName = astUtils.getStaticPropertyName(callee);

			if (propName !== null && DISALLOWED_PROPS.has(propName)) {
				context.report({
					messageId: "prototypeBuildIn",
					loc: callee.property.loc,
					data: { prop: propName },
					node,
					suggest: [
						{
							messageId: "callObjectPrototype",
							data: { prop: propName },
							fix(fixer) {
								const sourceCode = context.sourceCode;

								/*
								 * A call after an optional chain (e.g. a?.b.hasOwnProperty(c))
								 * must be fixed manually because the call can be short-circuited
								 */
								if (isAfterOptional(node)) {
									return null;
								}

								/*
								 * A call on a ChainExpression (e.g. (a?.hasOwnProperty)(c)) will trigger
								 * no-unsafe-optional-chaining which should be fixed before this suggestion
								 */
								if (node.callee.type === "ChainExpression") {
									return null;
								}

								const objectVariable =
									astUtils.getVariableByName(
										sourceCode.getScope(node),
										"Object",
									);

								/*
								 * We can't use Object if the global Object was shadowed,
								 * or Object does not exist in the global scope for some reason
								 */
								if (
									!objectVariable ||
									objectVariable.scope.type !== "global" ||
									objectVariable.defs.length > 0
								) {
									return null;
								}

								let objectText = sourceCode.getText(
									callee.object,
								);

								if (
									astUtils.getPrecedence(callee.object) <=
									astUtils.getPrecedence({
										type: "SequenceExpression",
									})
								) {
									objectText = `(${objectText})`;
								}

								const openParenToken = sourceCode.getTokenAfter(
									node.callee,
									astUtils.isOpeningParenToken,
								);
								const isEmptyParameters =
									node.arguments.length === 0;
								const delim = isEmptyParameters ? "" : ", ";
								const fixes = [
									fixer.replaceText(
										callee,
										`Object.prototype.${propName}.call`,
									),
									fixer.insertTextAfter(
										openParenToken,
										objectText + delim,
									),
								];

								return fixes;
							},
						},
					],
				});
			}
		}

		return {
			CallExpression: disallowBuiltIns,
		};
	},
};
xI/**
 * @fileoverview Rule to flag when the same variable is declared more then once.
 * @author Ilya Volodin
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [{ builtinGlobals: true }],

		docs: {
			description: "Disallow variable redeclaration",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-redeclare",
		},

		messages: {
			redeclared: "'{{id}}' is already defined.",
			redeclaredAsBuiltin:
				"'{{id}}' is already defined as a built-in global variable.",
			redeclaredBySyntax:
				"'{{id}}' is already defined by a variable declaration.",
		},

		schema: [
			{
				type: "object",
				properties: {
					builtinGlobals: { type: "boolean" },
				},
				additionalProperties: false,
			},
		],
	},

	create(context) {
		const [{ builtinGlobals }] = context.options;
		const sourceCode = context.sourceCode;

		/**
		 * Iterate declarations of a given variable.
		 * @param {escope.variable} variable The variable object to iterate declarations.
		 * @returns {IterableIterator<{type:string,node:ASTNode,loc:SourceLocation}>} The declarations.
		 */
		function* iterateDeclarations(variable) {
			if (
				builtinGlobals &&
				(variable.eslintImplicitGlobalSetting === "readonly" ||
					variable.eslintImplicitGlobalSetting === "writable")
			) {
				yield { type: "builtin" };
			}

			for (const id of variable.identifiers) {
				yield { type: "syntax", node: id, loc: id.loc };
			}

			if (variable.eslintExplicitGlobalComments) {
				for (const comment of variable.eslintExplicitGlobalComments) {
					yield {
						type: "comment",
						node: comment,
						loc: astUtils.getNameLocationInGlobalDirectiveComment(
							sourceCode,
							comment,
							variable.name,
						),
					};
				}
			}
		}

		/**
		 * Find variables in a given scope and flag redeclared ones.
		 * @param {Scope} scope An eslint-scope scope object.
		 * @returns {void}
		 * @private
		 */
		function findVariablesInScope(scope) {
			for (const variable of scope.variables) {
				const [declaration, ...extraDeclarations] =
					iterateDeclarations(variable);

				if (extraDeclarations.length === 0) {
					continue;
				}

				/*
				 * If the type of a declaration is different from the type of
				 * the first declaration, it shows the location of the first
				 * declaration.
				 */
				const detailMessageId =
					declaration.type === "builtin"
						? "redeclaredAsBuiltin"
						: "redeclaredBySyntax";
				const data = { id: variable.name };

				// Report extra declarations.
				for (const { type, node, loc } of extraDeclarations) {
					const messageId =
						type === declaration.type
							? "redeclared"
							: detailMessageId;

					context.report({ node, loc, messageId, data });
				}
			}
		}

		/**
		 * Find variables in the current scope.
		 * @param {ASTNode} node The node of the current scope.
		 * @returns {void}
		 * @private
		 */
		function checkForBlock(node) {
			const scope = sourceCode.getScope(node);

			/*
			 * In ES5, some node type such as `BlockStatement` doesn't have that scope.
			 * `scope.block` is a different node in such a case.
			 */
			if (scope.block === node) {
				findVariablesInScope(scope);
			}
		}

		return {
			Program(node) {
				const scope = sourceCode.getScope(node);

				findVariablesInScope(scope);

				// Node.js or ES modules has a special scope.
				if (
					scope.type === "global" &&
					scope.childScopes[0] &&
					// The special scope's block is the Program node.
					scope.block === scope.childScopes[0].block
				) {
					findVariablesInScope(scope.childScopes[0]);
				}
			},

			FunctionDeclaration: checkForBlock,
			FunctionExpression: checkForBlock,
			ArrowFunctionExpression: checkForBlock,

			StaticBlock: checkForBlock,

			BlockStatement: checkForBlock,
			ForStatement: checkForBlock,
			ForInStatement: checkForBlock,
			ForOfStatement: checkForBlock,
			SwitchStatement: checkForBlock,
		};
	},
};
,1xc/**
 * @fileoverview Rule to count multiple spaces in regular expressions
 * @author Matt DuVall <http://www.mattduvall.com/>
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");
const regexpp = require("@eslint-community/regexpp");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const regExpParser = new regexpp.RegExpParser();
const DOUBLE_SPACE = / {2}/u;

/**
 * Check if node is a string
 * @param {ASTNode} node node to evaluate
 * @returns {boolean} True if its a string
 * @private
 */
function isString(node) {
	return node && node.type === "Literal" && typeof node.value === "string";
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow multiple spaces in regular expressions",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-regex-spaces",
		},

		schema: [],
		fixable: "code",

		messages: {
			multipleSpaces: "Spaces are hard to count. Use {{{length}}}.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		/**
		 * Validate regular expression
		 * @param {ASTNode} nodeToReport Node to report.
		 * @param {string} pattern Regular expression pattern to validate.
		 * @param {string} rawPattern Raw representation of the pattern in the source code.
		 * @param {number} rawPatternStartRange Start range of the pattern in the source code.
		 * @param {string} flags Regular expression flags.
		 * @returns {void}
		 * @private
		 */
		function checkRegex(
			nodeToReport,
			pattern,
			rawPattern,
			rawPatternStartRange,
			flags,
		) {
			// Skip if there are no consecutive spaces in the source code, to avoid reporting e.g., RegExp(' \ ').
			if (!DOUBLE_SPACE.test(rawPattern)) {
				return;
			}

			const characterClassNodes = [];
			let regExpAST;

			try {
				regExpAST = regExpParser.parsePattern(
					pattern,
					0,
					pattern.length,
					{
						unicode: flags.includes("u"),
						unicodeSets: flags.includes("v"),
					},
				);
			} catch {
				// Ignore regular expressions with syntax errors
				return;
			}

			regexpp.visitRegExpAST(regExpAST, {
				onCharacterClassEnter(ccNode) {
					characterClassNodes.push(ccNode);
				},
			});

			const spacesPattern = /( {2,})(?: [+*{?]|[^+*{?]|$)/gu;
			let match;

			while ((match = spacesPattern.exec(pattern))) {
				const {
					1: { length },
					index,
				} = match;

				// Report only consecutive spaces that are not in character classes.
				if (
					characterClassNodes.every(
						({ start, end }) => index < start || end <= index,
					)
				) {
					context.report({
						node: nodeToReport,
						messageId: "multipleSpaces",
						data: { length },
						fix(fixer) {
							if (pattern !== rawPattern) {
								return null;
							}
							return fixer.replaceTextRange(
								[
									rawPatternStartRange + index,
									rawPatternStartRange + index + length,
								],
								` {${length}}`,
							);
						},
					});

					// Report only the first occurrence of consecutive spaces
					return;
				}
			}
		}

		/**
		 * Validate regular expression literals
		 * @param {ASTNode} node node to validate
		 * @returns {void}
		 * @private
		 */
		function checkLiteral(node) {
			if (node.regex) {
				const pattern = node.regex.pattern;
				const rawPattern = node.raw.slice(1, node.raw.lastIndexOf("/"));
				const rawPatternStartRange = node.range[0] + 1;
				const flags = node.regex.flags;

				checkRegex(
					node,
					pattern,
					rawPattern,
					rawPatternStartRange,
					flags,
				);
			}
		}

		/**
		 * Validate strings passed to the RegExp constructor
		 * @param {ASTNode} node node to validate
		 * @returns {void}
		 * @private
		 */
		function checkFunction(node) {
			const scope = sourceCode.getScope(node);
			const regExpVar = astUtils.getVariableByName(scope, "RegExp");
			const shadowed = regExpVar && regExpVar.defs.length > 0;
			const patternNode = node.arguments[0];

			if (
				node.callee.type === "Identifier" &&
				node.callee.name === "RegExp" &&
				isString(patternNode) &&
				!shadowed
			) {
				const pattern = patternNode.value;
				const rawPattern = patternNode.raw.slice(1, -1);
				const rawPatternStartRange = patternNode.range[0] + 1;
				let flags;

				if (node.arguments.length < 2) {
					// It has no flags.
					flags = "";
				} else {
					const flagsNode = node.arguments[1];

					if (isString(flagsNode)) {
						flags = flagsNode.value;
					} else {
						// The flags cannot be determined.
						return;
					}
				}

				checkRegex(
					node,
					pattern,
					rawPattern,
					rawPatternStartRange,
					flags,
				);
			}
		}

		return {
			Literal: checkLiteral,
			CallExpression: checkFunction,
			NewExpression: checkFunction,
		};
	},
};
-5xS/**
 * @fileoverview Rule to disallow specified names in exports
 * @author Milos Djermanovic
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow specified names in exports",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-restricted-exports",
		},

		schema: [
			{
				anyOf: [
					{
						type: "object",
						properties: {
							restrictedNamedExports: {
								type: "array",
								items: {
									type: "string",
								},
								uniqueItems: true,
							},
							restrictedNamedExportsPattern: { type: "string" },
						},
						additionalProperties: false,
					},
					{
						type: "object",
						properties: {
							restrictedNamedExports: {
								type: "array",
								items: {
									type: "string",
									pattern: "^(?!default$)",
								},
								uniqueItems: true,
							},
							restrictedNamedExportsPattern: { type: "string" },
							restrictDefaultExports: {
								type: "object",
								properties: {
									// Allow/Disallow `export default foo; export default 42; export default function foo() {}` format
									direct: {
										type: "boolean",
									},

									// Allow/Disallow `export { foo as default };` declarations
									named: {
										type: "boolean",
									},

									//  Allow/Disallow `export { default } from "mod"; export { default as default } from "mod";` declarations
									defaultFrom: {
										type: "boolean",
									},

									//  Allow/Disallow `export { foo as default } from "mod";` declarations
									namedFrom: {
										type: "boolean",
									},

									//  Allow/Disallow `export * as default from "mod"`; declarations
									namespaceFrom: {
										type: "boolean",
									},
								},
								additionalProperties: false,
							},
						},
						additionalProperties: false,
					},
				],
			},
		],

		defaultOptions: [{}],

		messages: {
			restrictedNamed:
				"'{{name}}' is restricted from being used as an exported name.",
			restrictedDefault: "Exporting 'default' is restricted.",
		},
	},

	create(context) {
		const {
			restrictedNamedExports,
			restrictedNamedExportsPattern: restrictedNamePattern,
			restrictDefaultExports,
		} = context.options[0];
		const restrictedNames = new Set(restrictedNamedExports);
		const sourceCode = context.sourceCode;

		/**
		 * Checks and reports given exported name.
		 * @param {ASTNode} node exported `Identifier` or string `Literal` node to check.
		 * @returns {void}
		 */
		function checkExportedName(node) {
			const name = astUtils.getModuleExportName(node);

			let matchesRestrictedNamePattern = false;

			if (restrictedNamePattern && name !== "default") {
				const patternRegex = new RegExp(restrictedNamePattern, "u");

				matchesRestrictedNamePattern = patternRegex.test(name);
			}

			if (matchesRestrictedNamePattern || restrictedNames.has(name)) {
				context.report({
					node,
					messageId: "restrictedNamed",
					data: { name },
				});
				return;
			}

			if (name === "default") {
				if (node.parent.type === "ExportAllDeclaration") {
					if (
						restrictDefaultExports &&
						restrictDefaultExports.namespaceFrom
					) {
						context.report({
							node,
							messageId: "restrictedDefault",
						});
					}
				} else {
					// ExportSpecifier
					const isSourceSpecified = !!node.parent.parent.source;
					const specifierLocalName = astUtils.getModuleExportName(
						node.parent.local,
					);

					if (
						!isSourceSpecified &&
						restrictDefaultExports &&
						restrictDefaultExports.named
					) {
						context.report({
							node,
							messageId: "restrictedDefault",
						});
						return;
					}

					if (isSourceSpecified && restrictDefaultExports) {
						if (
							(specifierLocalName === "default" &&
								restrictDefaultExports.defaultFrom) ||
							(specifierLocalName !== "default" &&
								restrictDefaultExports.namedFrom)
						) {
							context.report({
								node,
								messageId: "restrictedDefault",
							});
						}
					}
				}
			}
		}

		return {
			ExportAllDeclaration(node) {
				if (node.exported) {
					checkExportedName(node.exported);
				}
			},

			ExportDefaultDeclaration(node) {
				if (restrictDefaultExports && restrictDefaultExports.direct) {
					context.report({
						node,
						messageId: "restrictedDefault",
					});
				}
			},

			ExportNamedDeclaration(node) {
				const declaration = node.declaration;

				if (declaration) {
					if (
						declaration.type === "FunctionDeclaration" ||
						declaration.type === "ClassDeclaration"
					) {
						checkExportedName(declaration.id);
					} else if (declaration.type === "VariableDeclaration") {
						sourceCode
							.getDeclaredVariables(declaration)
							.map(v =>
								v.defs.find(d => d.parent === declaration),
							)
							.map(d => d.name) // Identifier nodes
							.forEach(checkExportedName);
					}
				} else {
					node.specifiers
						.map(s => s.exported)
						.forEach(checkExportedName);
				}
			},
		};
	},
};
x</**
 * @fileoverview Restrict usage of specified globals.
 * @author Benoît Zugmeyer
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const TYPE_NODES = new Set([
	"TSTypeReference",
	"TSInterfaceHeritage",
	"TSClassImplements",
	"TSTypeQuery",
	"TSQualifiedName",
]);

const GLOBAL_OBJECTS = new Set(["globalThis", "self", "window"]);

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

const arrayOfGlobals = {
	type: "array",
	items: {
		oneOf: [
			{
				type: "string",
			},
			{
				type: "object",
				properties: {
					name: { type: "string" },
					message: { type: "string" },
				},
				required: ["name"],
				additionalProperties: false,
			},
		],
	},
	uniqueItems: true,
	minItems: 0,
};

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow specified global variables",
			dialects: ["JavaScript", "TypeScript"],
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-restricted-globals",
		},

		schema: {
			anyOf: [
				arrayOfGlobals,
				{
					type: "array",
					items: [
						{
							type: "object",
							properties: {
								globals: arrayOfGlobals,
								checkGlobalObject: {
									type: "boolean",
								},
								globalObjects: {
									type: "array",
									items: {
										type: "string",
									},
									uniqueItems: true,
								},
							},
							required: ["globals"],
							additionalProperties: false,
						},
					],
					additionalItems: false,
				},
			],
		},

		messages: {
			defaultMessage: "Unexpected use of '{{name}}'.",
			// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
			customMessage: "Unexpected use of '{{name}}'. {{customMessage}}",
		},
	},

	create(context) {
		const { sourceCode, options } = context;

		const isGlobalsObject =
			typeof options[0] === "object" &&
			Object.hasOwn(options[0], "globals");

		const restrictedGlobals = isGlobalsObject
			? options[0].globals
			: options;
		const checkGlobalObject = isGlobalsObject
			? options[0].checkGlobalObject
			: false;
		const userGlobalObjects = isGlobalsObject
			? options[0].globalObjects || []
			: [];

		const globalObjects = new Set([
			...GLOBAL_OBJECTS,
			...userGlobalObjects,
		]);

		// If no globals are restricted, we don't need to do anything
		if (restrictedGlobals.length === 0) {
			return {};
		}

		const restrictedGlobalMessages = restrictedGlobals.reduce(
			(memo, option) => {
				if (typeof option === "string") {
					memo[option] = null;
				} else {
					memo[option.name] = option.message;
				}

				return memo;
			},
			{},
		);

		/**
		 * Report a variable to be used as a restricted global.
		 * @param {Reference} reference the variable reference
		 * @returns {void}
		 * @private
		 */
		function reportReference(reference) {
			const name = reference.identifier.name,
				customMessage = restrictedGlobalMessages[name],
				messageId = customMessage ? "customMessage" : "defaultMessage";

			context.report({
				node: reference.identifier,
				messageId,
				data: {
					name,
					customMessage,
				},
			});
		}

		/**
		 * Check if the given name is a restricted global name.
		 * @param {string} name name of a variable
		 * @returns {boolean} whether the variable is a restricted global or not
		 * @private
		 */
		function isRestricted(name) {
			return Object.hasOwn(restrictedGlobalMessages, name);
		}

		/**
		 * Check if the given reference occurs within a TypeScript type context.
		 * @param {Reference} reference The variable reference to check.
		 * @returns {boolean} Whether the reference is in a type context.
		 * @private
		 */
		function isInTypeContext(reference) {
			const parent = reference.identifier.parent;

			return TYPE_NODES.has(parent.type);
		}

		return {
			Program(node) {
				const scope = sourceCode.getScope(node);

				// Report variables declared elsewhere (ex: variables defined as "global" by eslint)
				scope.variables.forEach(variable => {
					if (!variable.defs.length && isRestricted(variable.name)) {
						variable.references.forEach(reference => {
							if (!isInTypeContext(reference)) {
								reportReference(reference);
							}
						});
					}
				});

				// Report variables not declared at all
				scope.through.forEach(reference => {
					if (
						isRestricted(reference.identifier.name) &&
						!isInTypeContext(reference)
					) {
						reportReference(reference);
					}
				});
			},

			"Program:exit"(node) {
				if (!checkGlobalObject) {
					return;
				}

				const globalScope = sourceCode.getScope(node);
				globalObjects.forEach(globalObjectName => {
					const variable = astUtils.getVariableByName(
						globalScope,
						globalObjectName,
					);

					if (!variable) {
						return;
					}

					variable.references.forEach(reference => {
						const identifier = reference.identifier;
						let parent = identifier.parent;

						// To detect code like `window.window.Promise`.
						while (
							astUtils.isSpecificMemberAccess(
								parent,
								null,
								globalObjectName,
							)
						) {
							parent = parent.parent;
						}

						const propertyName =
							astUtils.getStaticPropertyName(parent);
						if (propertyName && isRestricted(propertyName)) {
							const customMessage =
								restrictedGlobalMessages[propertyName];
							const messageId = customMessage
								? "customMessage"
								: "defaultMessage";

							context.report({
								node: parent.property,
								messageId,
								data: {
									name: propertyName,
									customMessage,
								},
							});
						}
					});
				});
			},
		};
	},
};
r6xbh/**
 * @fileoverview Restrict usage of specified node imports.
 * @author Guy Ellis
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Format import names for error messages.
 * @param {string[]} importNames The import names to format.
 * @returns {string} The formatted import names.
 */
function formatImportNames(importNames) {
	return new Intl.ListFormat("en-US").format(
		importNames.map(name => `'${name}'`),
	);
}

/**
 * Returns "is" or "are" based on the number of import names.
 * @param {string[]} importNames The import names to check.
 * @returns {string} "is" if one import name, otherwise "are".
 */
function isOrAre(importNames) {
	return importNames.length === 1 ? "is" : "are";
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

const ignore = require("ignore");

const arrayOfStringsOrObjects = {
	type: "array",
	items: {
		anyOf: [
			{ type: "string" },
			{
				type: "object",
				properties: {
					name: { type: "string" },
					message: {
						type: "string",
						minLength: 1,
					},
					importNames: {
						type: "array",
						items: {
							type: "string",
						},
					},
					allowImportNames: {
						type: "array",
						items: {
							type: "string",
						},
					},
					allowTypeImports: {
						type: "boolean",
						description:
							"Whether to allow type-only imports for a path.",
					},
				},
				additionalProperties: false,
				required: ["name"],
				not: { required: ["importNames", "allowImportNames"] },
			},
		],
	},
	uniqueItems: true,
};

const arrayOfStringsOrObjectPatterns = {
	anyOf: [
		{
			type: "array",
			items: {
				type: "string",
			},
			uniqueItems: true,
		},
		{
			type: "array",
			items: {
				type: "object",
				properties: {
					importNames: {
						type: "array",
						items: {
							type: "string",
						},
						minItems: 1,
						uniqueItems: true,
					},
					allowImportNames: {
						type: "array",
						items: {
							type: "string",
						},
						minItems: 1,
						uniqueItems: true,
					},
					group: {
						type: "array",
						items: {
							type: "string",
						},
						minItems: 1,
						uniqueItems: true,
					},
					regex: {
						type: "string",
					},
					importNamePattern: {
						type: "string",
					},
					allowImportNamePattern: {
						type: "string",
					},
					message: {
						type: "string",
						minLength: 1,
					},
					caseSensitive: {
						type: "boolean",
					},
					allowTypeImports: {
						type: "boolean",
						description:
							"Whether to allow type-only imports for a pattern.",
					},
				},
				additionalProperties: false,
				not: {
					anyOf: [
						{ required: ["importNames", "allowImportNames"] },
						{
							required: [
								"importNamePattern",
								"allowImportNamePattern",
							],
						},
						{ required: ["importNames", "allowImportNamePattern"] },
						{ required: ["importNamePattern", "allowImportNames"] },
						{
							required: [
								"allowImportNames",
								"allowImportNamePattern",
							],
						},
					],
				},
				oneOf: [{ required: ["group"] }, { required: ["regex"] }],
			},
			uniqueItems: true,
		},
	],
};

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow specified modules when loaded by `import`",
			dialects: ["JavaScript", "TypeScript"],
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-restricted-imports",
		},

		messages: {
			path: "'{{importSource}}' import is restricted from being used.",
			pathWithCustomMessage:
				// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
				"'{{importSource}}' import is restricted from being used. {{customMessage}}",

			patterns:
				"'{{importSource}}' import is restricted from being used by a pattern.",
			patternWithCustomMessage:
				// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
				"'{{importSource}}' import is restricted from being used by a pattern. {{customMessage}}",

			patternAndImportName:
				"'{{importName}}' import from '{{importSource}}' is restricted from being used by a pattern.",
			patternAndImportNameWithCustomMessage:
				// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
				"'{{importName}}' import from '{{importSource}}' is restricted from being used by a pattern. {{customMessage}}",

			patternAndEverything:
				"* import is invalid because {{importNames}} from '{{importSource}}' {{isOrAre}} restricted from being used by a pattern.",

			patternAndEverythingWithRegexImportName:
				"* import is invalid because import name matching '{{importNames}}' pattern from '{{importSource}}' is restricted from being used.",
			patternAndEverythingWithCustomMessage:
				// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
				"* import is invalid because {{importNames}} from '{{importSource}}' {{isOrAre}} restricted from being used by a pattern. {{customMessage}}",
			patternAndEverythingWithRegexImportNameAndCustomMessage:
				// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
				"* import is invalid because import name matching '{{importNames}}' pattern from '{{importSource}}' is restricted from being used. {{customMessage}}",

			everything:
				"* import is invalid because {{importNames}} from '{{importSource}}' {{isOrAre}} restricted.",
			everythingWithCustomMessage:
				// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
				"* import is invalid because {{importNames}} from '{{importSource}}' {{isOrAre}} restricted. {{customMessage}}",

			importName:
				"'{{importName}}' import from '{{importSource}}' is restricted.",
			importNameWithCustomMessage:
				// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
				"'{{importName}}' import from '{{importSource}}' is restricted. {{customMessage}}",

			allowedImportName:
				"'{{importName}}' import from '{{importSource}}' is restricted because only {{allowedImportNames}} {{isOrAre}} allowed.",
			allowedImportNameWithCustomMessage:
				// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
				"'{{importName}}' import from '{{importSource}}' is restricted because only {{allowedImportNames}} {{isOrAre}} allowed. {{customMessage}}",

			everythingWithAllowImportNames:
				"* import is invalid because only {{allowedImportNames}} from '{{importSource}}' {{isOrAre}} allowed.",
			everythingWithAllowImportNamesAndCustomMessage:
				// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
				"* import is invalid because only {{allowedImportNames}} from '{{importSource}}' {{isOrAre}} allowed. {{customMessage}}",

			allowedImportNamePattern:
				"'{{importName}}' import from '{{importSource}}' is restricted because only imports that match the pattern '{{allowedImportNamePattern}}' are allowed from '{{importSource}}'.",
			allowedImportNamePatternWithCustomMessage:
				// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
				"'{{importName}}' import from '{{importSource}}' is restricted because only imports that match the pattern '{{allowedImportNamePattern}}' are allowed from '{{importSource}}'. {{customMessage}}",

			everythingWithAllowedImportNamePattern:
				"* import is invalid because only imports that match the pattern '{{allowedImportNamePattern}}' from '{{importSource}}' are allowed.",
			everythingWithAllowedImportNamePatternWithCustomMessage:
				// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
				"* import is invalid because only imports that match the pattern '{{allowedImportNamePattern}}' from '{{importSource}}' are allowed. {{customMessage}}",
		},

		schema: {
			anyOf: [
				arrayOfStringsOrObjects,
				{
					type: "array",
					items: [
						{
							type: "object",
							properties: {
								paths: arrayOfStringsOrObjects,
								patterns: arrayOfStringsOrObjectPatterns,
							},
							additionalProperties: false,
						},
					],
					additionalItems: false,
				},
			],
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const options = Array.isArray(context.options) ? context.options : [];
		const isPathAndPatternsObject =
			typeof options[0] === "object" &&
			(Object.hasOwn(options[0], "paths") ||
				Object.hasOwn(options[0], "patterns"));

		const restrictedPaths =
			(isPathAndPatternsObject ? options[0].paths : context.options) ||
			[];
		const groupedRestrictedPaths = restrictedPaths.reduce(
			(memo, importSource) => {
				const path =
					typeof importSource === "string"
						? importSource
						: importSource.name;

				if (!memo[path]) {
					memo[path] = [];
				}

				if (typeof importSource === "string") {
					memo[path].push({});
				} else {
					memo[path].push({
						message: importSource.message,
						importNames: importSource.importNames,
						allowImportNames: importSource.allowImportNames,
						allowTypeImports: importSource.allowTypeImports,
					});
				}
				return memo;
			},
			Object.create(null),
		);

		// Handle patterns too, either as strings or groups
		let restrictedPatterns =
			(isPathAndPatternsObject ? options[0].patterns : []) || [];

		// standardize to array of objects if we have an array of strings
		if (
			restrictedPatterns.length > 0 &&
			typeof restrictedPatterns[0] === "string"
		) {
			restrictedPatterns = [{ group: restrictedPatterns }];
		}

		// relative paths are supported for this rule
		const restrictedPatternGroups = restrictedPatterns.map(
			({
				group,
				regex,
				message,
				caseSensitive,
				importNames,
				importNamePattern,
				allowImportNames,
				allowImportNamePattern,
				allowTypeImports,
			}) => ({
				...(group
					? {
							matcher: ignore({
								allowRelativePaths: true,
								ignorecase: !caseSensitive,
							}).add(group),
						}
					: {}),
				...(typeof regex === "string"
					? {
							regexMatcher: new RegExp(
								regex,
								caseSensitive ? "u" : "iu",
							),
						}
					: {}),
				customMessage: message,
				importNames,
				importNamePattern,
				allowImportNames,
				allowImportNamePattern,
				allowTypeImports,
			}),
		);

		// if no imports are restricted we don't need to check
		if (
			Object.keys(restrictedPaths).length === 0 &&
			restrictedPatternGroups.length === 0
		) {
			return {};
		}

		/**
		 * Check if the node is a type-only import
		 * @param {ASTNode} node The node to check
		 * @returns {boolean} Whether the node is a type-only import
		 */
		function isTypeOnlyImport(node) {
			return (
				node.importKind === "type" ||
				(node.specifiers?.length > 0 &&
					node.specifiers.every(
						specifier => specifier.importKind === "type",
					))
			);
		}

		/**
		 * Check if a specifier is type-only
		 * @param {ASTNode} specifier The specifier to check
		 * @returns {boolean} Whether the specifier is type-only
		 */
		function isTypeOnlySpecifier(specifier) {
			return (
				specifier.importKind === "type" ||
				specifier.exportKind === "type"
			);
		}

		/**
		 * Check if the node is a type-only export
		 * @param {ASTNode} node The node to check
		 * @returns {boolean} Whether the node is a type-only export
		 */
		function isTypeOnlyExport(node) {
			return (
				node.exportKind === "type" ||
				(node.specifiers?.length > 0 &&
					node.specifiers.every(
						specifier => specifier.exportKind === "type",
					))
			);
		}

		/**
		 * Report a restricted path.
		 * @param {string} importSource path of the import
		 * @param {Map<string,Object[]>} importNames Map of import names that are being imported
		 * @param {node} node representing the restricted path reference
		 * @returns {void}
		 * @private
		 */
		function checkRestrictedPathAndReport(importSource, importNames, node) {
			if (!Object.hasOwn(groupedRestrictedPaths, importSource)) {
				return;
			}

			groupedRestrictedPaths[importSource].forEach(
				restrictedPathEntry => {
					const customMessage = restrictedPathEntry.message;
					const restrictedImportNames =
						restrictedPathEntry.importNames;
					const allowedImportNames =
						restrictedPathEntry.allowImportNames;
					const allowTypeImports =
						restrictedPathEntry.allowTypeImports;

					// Skip if this is a type-only import and it's allowed for this specific entry
					if (
						allowTypeImports &&
						(node.type === "ImportDeclaration" ||
							node.type === "TSImportEqualsDeclaration") &&
						isTypeOnlyImport(node)
					) {
						return;
					}

					// Skip if this is a type-only export and it's allowed for this specific entry
					if (
						allowTypeImports &&
						(node.type === "ExportNamedDeclaration" ||
							node.type === "ExportAllDeclaration") &&
						isTypeOnlyExport(node)
					) {
						return;
					}

					if (!restrictedImportNames && !allowedImportNames) {
						context.report({
							node,
							messageId: customMessage
								? "pathWithCustomMessage"
								: "path",
							data: {
								importSource,
								customMessage,
							},
						});

						return;
					}

					importNames.forEach((specifiers, importName) => {
						if (importName === "*") {
							const [specifier] = specifiers;

							if (restrictedImportNames) {
								context.report({
									node,
									messageId: customMessage
										? "everythingWithCustomMessage"
										: "everything",
									loc: specifier.loc,
									data: {
										importSource,
										importNames: formatImportNames(
											restrictedImportNames,
										),
										isOrAre: isOrAre(restrictedImportNames),
										customMessage,
									},
								});
							} else if (allowedImportNames) {
								context.report({
									node,
									messageId: customMessage
										? "everythingWithAllowImportNamesAndCustomMessage"
										: "everythingWithAllowImportNames",
									loc: specifier.loc,
									data: {
										importSource,
										allowedImportNames:
											formatImportNames(
												allowedImportNames,
											),
										isOrAre: isOrAre(allowedImportNames),
										customMessage,
									},
								});
							}

							return;
						}

						if (
							restrictedImportNames &&
							restrictedImportNames.includes(importName)
						) {
							specifiers.forEach(specifier => {
								// Skip if this is a type-only import specifier and type imports are allowed
								if (
									allowTypeImports &&
									isTypeOnlySpecifier(specifier.specifier)
								) {
									return;
								}

								context.report({
									node,
									messageId: customMessage
										? "importNameWithCustomMessage"
										: "importName",
									loc: specifier.loc,
									data: {
										importSource,
										customMessage,
										importName,
									},
								});
							});
						}

						if (
							allowedImportNames &&
							!allowedImportNames.includes(importName)
						) {
							specifiers.forEach(specifier => {
								// Skip if this is a type-only import specifier and type imports are allowed
								if (
									allowTypeImports &&
									isTypeOnlySpecifier(specifier.specifier)
								) {
									return;
								}

								context.report({
									node,
									loc: specifier.loc,
									messageId: customMessage
										? "allowedImportNameWithCustomMessage"
										: "allowedImportName",
									data: {
										importSource,
										customMessage,
										importName,
										allowedImportNames:
											formatImportNames(
												allowedImportNames,
											),
										isOrAre: isOrAre(allowedImportNames),
									},
								});
							});
						}
					});
				},
			);
		}

		/**
		 * Report a restricted path specifically for patterns.
		 * @param {node} node representing the restricted path reference
		 * @param {Object} group contains an Ignore instance for paths, the customMessage to show on failure,
		 * and any restricted import names that have been specified in the config
		 * @param {Map<string,Object[]>} importNames Map of import names that are being imported
		 * @param {string} importSource the import source string
		 * @returns {void}
		 * @private
		 */
		function reportPathForPatterns(node, group, importNames, importSource) {
			// Skip if this is a type-only import and it's allowed
			if (
				group.allowTypeImports &&
				(node.type === "ImportDeclaration" ||
					node.type === "TSImportEqualsDeclaration") &&
				isTypeOnlyImport(node)
			) {
				return;
			}

			// Skip if this is a type-only export and it's allowed
			if (
				group.allowTypeImports &&
				(node.type === "ExportNamedDeclaration" ||
					node.type === "ExportAllDeclaration") &&
				isTypeOnlyExport(node)
			) {
				return;
			}

			const customMessage = group.customMessage;
			const restrictedImportNames = group.importNames;
			const restrictedImportNamePattern = group.importNamePattern
				? new RegExp(group.importNamePattern, "u")
				: null;
			const allowedImportNames = group.allowImportNames;
			const allowedImportNamePattern = group.allowImportNamePattern
				? new RegExp(group.allowImportNamePattern, "u")
				: null;

			/**
			 * If we are not restricting to any specific import names and just the pattern itself,
			 * report the error and move on
			 */
			if (
				!restrictedImportNames &&
				!allowedImportNames &&
				!restrictedImportNamePattern &&
				!allowedImportNamePattern
			) {
				context.report({
					node,
					messageId: customMessage
						? "patternWithCustomMessage"
						: "patterns",
					data: {
						importSource,
						customMessage,
					},
				});
				return;
			}

			importNames.forEach((specifiers, importName) => {
				if (importName === "*") {
					const [specifier] = specifiers;

					if (restrictedImportNames) {
						context.report({
							node,
							messageId: customMessage
								? "patternAndEverythingWithCustomMessage"
								: "patternAndEverything",
							loc: specifier.loc,
							data: {
								importSource,
								importNames: formatImportNames(
									restrictedImportNames,
								),
								isOrAre: isOrAre(restrictedImportNames),
								customMessage,
							},
						});
					} else if (allowedImportNames) {
						context.report({
							node,
							messageId: customMessage
								? "everythingWithAllowImportNamesAndCustomMessage"
								: "everythingWithAllowImportNames",
							loc: specifier.loc,
							data: {
								importSource,
								allowedImportNames:
									formatImportNames(allowedImportNames),
								isOrAre: isOrAre(allowedImportNames),
								customMessage,
							},
						});
					} else if (allowedImportNamePattern) {
						context.report({
							node,
							messageId: customMessage
								? "everythingWithAllowedImportNamePatternWithCustomMessage"
								: "everythingWithAllowedImportNamePattern",
							loc: specifier.loc,
							data: {
								importSource,
								allowedImportNamePattern,
								customMessage,
							},
						});
					} else {
						context.report({
							node,
							messageId: customMessage
								? "patternAndEverythingWithRegexImportNameAndCustomMessage"
								: "patternAndEverythingWithRegexImportName",
							loc: specifier.loc,
							data: {
								importSource,
								importNames: restrictedImportNamePattern,
								customMessage,
							},
						});
					}

					return;
				}

				if (
					(restrictedImportNames &&
						restrictedImportNames.includes(importName)) ||
					(restrictedImportNamePattern &&
						restrictedImportNamePattern.test(importName))
				) {
					specifiers.forEach(specifier => {
						// Skip if this is a type-only import specifier and type imports are allowed
						if (
							group.allowTypeImports &&
							isTypeOnlySpecifier(specifier.specifier)
						) {
							return;
						}

						context.report({
							node,
							messageId: customMessage
								? "patternAndImportNameWithCustomMessage"
								: "patternAndImportName",
							loc: specifier.loc,
							data: {
								importSource,
								customMessage,
								importName,
							},
						});
					});
				}

				if (
					allowedImportNames &&
					!allowedImportNames.includes(importName)
				) {
					specifiers.forEach(specifier => {
						// Skip if this is a type-only import specifier and type imports are allowed
						if (
							group.allowTypeImports &&
							isTypeOnlySpecifier(specifier.specifier)
						) {
							return;
						}

						context.report({
							node,
							messageId: customMessage
								? "allowedImportNameWithCustomMessage"
								: "allowedImportName",
							loc: specifier.loc,
							data: {
								importSource,
								customMessage,
								importName,
								allowedImportNames:
									formatImportNames(allowedImportNames),
								isOrAre: isOrAre(allowedImportNames),
							},
						});
					});
				} else if (
					allowedImportNamePattern &&
					!allowedImportNamePattern.test(importName)
				) {
					specifiers.forEach(specifier => {
						// Skip if this is a type-only import specifier and type imports are allowed
						if (
							group.allowTypeImports &&
							isTypeOnlySpecifier(specifier.specifier)
						) {
							return;
						}

						context.report({
							node,
							messageId: customMessage
								? "allowedImportNamePatternWithCustomMessage"
								: "allowedImportNamePattern",
							loc: specifier.loc,
							data: {
								importSource,
								customMessage,
								importName,
								allowedImportNamePattern,
							},
						});
					});
				}
			});
		}

		/**
		 * Check if the given importSource is restricted by a pattern.
		 * @param {string} importSource path of the import
		 * @param {Object} group contains a Ignore instance for paths, and the customMessage to show if it fails
		 * @returns {boolean} whether the variable is a restricted pattern or not
		 * @private
		 */
		function isRestrictedPattern(importSource, group) {
			return group.regexMatcher
				? group.regexMatcher.test(importSource)
				: group.matcher.ignores(importSource);
		}

		/**
		 * Checks a node to see if any problems should be reported.
		 * @param {ASTNode} node The node to check.
		 * @returns {void}
		 * @private
		 */
		function checkNode(node) {
			const importSource = node.source.value.trim();
			const importNames = new Map();

			if (node.type === "ExportAllDeclaration") {
				const starToken = sourceCode.getFirstToken(node, 1);

				importNames.set("*", [{ loc: starToken.loc }]);
			} else if (node.specifiers) {
				for (const specifier of node.specifiers) {
					let name;
					const specifierData = { loc: specifier.loc, specifier };

					if (specifier.type === "ImportDefaultSpecifier") {
						name = "default";
					} else if (specifier.type === "ImportNamespaceSpecifier") {
						name = "*";
					} else if (specifier.imported) {
						name = astUtils.getModuleExportName(specifier.imported);
					} else if (specifier.local) {
						name = astUtils.getModuleExportName(specifier.local);
					}

					if (typeof name === "string") {
						if (importNames.has(name)) {
							importNames.get(name).push(specifierData);
						} else {
							importNames.set(name, [specifierData]);
						}
					}
				}
			}

			checkRestrictedPathAndReport(importSource, importNames, node);
			restrictedPatternGroups.forEach(group => {
				if (isRestrictedPattern(importSource, group)) {
					reportPathForPatterns(
						node,
						group,
						importNames,
						importSource,
					);
				}
			});
		}

		return {
			ImportDeclaration: checkNode,
			ExportNamedDeclaration(node) {
				if (node.source) {
					checkNode(node);
				}
			},
			ExportAllDeclaration: checkNode,
			// Add support for TypeScript import equals declarations
			TSImportEqualsDeclaration(node) {
				if (node.moduleReference.type === "TSExternalModuleReference") {
					const importSource = node.moduleReference.expression.value;
					const importNames = new Map();

					// Use existing logic with the actual node
					checkRestrictedPathAndReport(
						importSource,
						importNames,
						node,
					);
					restrictedPatternGroups.forEach(group => {
						if (isRestrictedPattern(importSource, group)) {
							reportPathForPatterns(
								node,
								group,
								importNames,
								importSource,
							);
						}
					});
				}
			},
		};
	},
};
_x/**
 * @fileoverview Restrict usage of specified node modules.
 * @author Christian Schulz
 * @deprecated in ESLint v7.0.0
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

const ignore = require("ignore");

const arrayOfStrings = {
	type: "array",
	items: { type: "string" },
	uniqueItems: true,
};

const arrayOfStringsOrObjects = {
	type: "array",
	items: {
		anyOf: [
			{ type: "string" },
			{
				type: "object",
				properties: {
					name: { type: "string" },
					message: {
						type: "string",
						minLength: 1,
					},
				},
				additionalProperties: false,
				required: ["name"],
			},
		],
	},
	uniqueItems: true,
};

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Node.js rules were moved out of ESLint core.",
			url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
			deprecatedSince: "7.0.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"eslint-plugin-n now maintains deprecated Node.js-related rules.",
					plugin: {
						name: "eslint-plugin-n",
						url: "https://github.com/eslint-community/eslint-plugin-n",
					},
					rule: {
						name: "no-restricted-require",
						url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-restricted-require.md",
					},
				},
			],
		},

		type: "suggestion",

		docs: {
			description: "Disallow specified modules when loaded by `require`",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-restricted-modules",
		},

		schema: {
			anyOf: [
				arrayOfStringsOrObjects,
				{
					type: "array",
					items: {
						type: "object",
						properties: {
							paths: arrayOfStringsOrObjects,
							patterns: arrayOfStrings,
						},
						additionalProperties: false,
					},
					additionalItems: false,
				},
			],
		},

		messages: {
			defaultMessage: "'{{name}}' module is restricted from being used.",
			customMessage:
				// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
				"'{{name}}' module is restricted from being used. {{customMessage}}",
			patternMessage:
				"'{{name}}' module is restricted from being used by a pattern.",
		},
	},

	create(context) {
		const options = Array.isArray(context.options) ? context.options : [];
		const isPathAndPatternsObject =
			typeof options[0] === "object" &&
			(Object.hasOwn(options[0], "paths") ||
				Object.hasOwn(options[0], "patterns"));

		const restrictedPaths =
			(isPathAndPatternsObject ? options[0].paths : context.options) ||
			[];
		const restrictedPatterns =
			(isPathAndPatternsObject ? options[0].patterns : []) || [];

		const restrictedPathMessages = restrictedPaths.reduce(
			(memo, importName) => {
				if (typeof importName === "string") {
					memo[importName] = null;
				} else {
					memo[importName.name] = importName.message;
				}
				return memo;
			},
			{},
		);

		// if no imports are restricted we don't need to check
		if (
			Object.keys(restrictedPaths).length === 0 &&
			restrictedPatterns.length === 0
		) {
			return {};
		}

		// relative paths are supported for this rule
		const ig = ignore({ allowRelativePaths: true }).add(restrictedPatterns);

		/**
		 * Function to check if a node is a string literal.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} If the node is a string literal.
		 */
		function isStringLiteral(node) {
			return (
				node &&
				node.type === "Literal" &&
				typeof node.value === "string"
			);
		}

		/**
		 * Function to check if a node is a require call.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} If the node is a require call.
		 */
		function isRequireCall(node) {
			return (
				node.callee.type === "Identifier" &&
				node.callee.name === "require"
			);
		}

		/**
		 * Extract string from Literal or TemplateLiteral node
		 * @param {ASTNode} node The node to extract from
		 * @returns {string|null} Extracted string or null if node doesn't represent a string
		 */
		function getFirstArgumentString(node) {
			if (isStringLiteral(node)) {
				return node.value.trim();
			}

			if (astUtils.isStaticTemplateLiteral(node)) {
				return node.quasis[0].value.cooked.trim();
			}

			return null;
		}

		/**
		 * Report a restricted path.
		 * @param {node} node representing the restricted path reference
		 * @param {string} name restricted path
		 * @returns {void}
		 * @private
		 */
		function reportPath(node, name) {
			const customMessage = restrictedPathMessages[name];
			const messageId = customMessage
				? "customMessage"
				: "defaultMessage";

			context.report({
				node,
				messageId,
				data: {
					name,
					customMessage,
				},
			});
		}

		/**
		 * Check if the given name is a restricted path name
		 * @param {string} name name of a variable
		 * @returns {boolean} whether the variable is a restricted path or not
		 * @private
		 */
		function isRestrictedPath(name) {
			return Object.hasOwn(restrictedPathMessages, name);
		}

		return {
			CallExpression(node) {
				if (isRequireCall(node)) {
					// node has arguments
					if (node.arguments.length) {
						const name = getFirstArgumentString(node.arguments[0]);

						// if first argument is a string literal or a static string template literal
						if (name) {
							// check if argument value is in restricted modules array
							if (isRestrictedPath(name)) {
								reportPath(node, name);
							}

							if (
								restrictedPatterns.length > 0 &&
								ig.ignores(name)
							) {
								context.report({
									node,
									messageId: "patternMessage",
									data: { name },
								});
							}
						}
					}
				}
			},
		};
	},
};
)3xS/**
 * @fileoverview Rule to disallow certain object properties
 * @author Will Klein & Eli White
 */

"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow certain properties on certain objects",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-restricted-properties",
		},

		schema: {
			type: "array",
			items: {
				type: "object",
				properties: {
					object: {
						type: "string",
					},
					property: {
						type: "string",
					},
					allowObjects: {
						type: "array",
						items: {
							type: "string",
						},
						uniqueItems: true,
					},
					allowProperties: {
						type: "array",
						items: {
							type: "string",
						},
						uniqueItems: true,
					},
					message: {
						type: "string",
					},
				},
				anyOf: [
					{
						required: ["object"],
					},
					{
						required: ["property"],
					},
				],
				not: {
					anyOf: [
						{ required: ["allowObjects", "object"] },
						{ required: ["allowProperties", "property"] },
					],
				},
				additionalProperties: false,
			},
			uniqueItems: true,
		},

		defaultOptions: [],

		messages: {
			restrictedObjectProperty:
				// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
				"'{{objectName}}.{{propertyName}}' is restricted from being used.{{allowedPropertiesMessage}}{{message}}",
			restrictedProperty:
				// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
				"'{{propertyName}}' is restricted from being used.{{allowedObjectsMessage}}{{message}}",
		},
	},

	create(context) {
		const restrictedCalls = context.options;

		if (restrictedCalls.length === 0) {
			return {};
		}

		const restrictedProperties = new Map();
		const globallyRestrictedObjects = new Map();
		const globallyRestrictedProperties = new Map();

		restrictedCalls.forEach(option => {
			const objectName = option.object;
			const propertyName = option.property;

			if (typeof objectName === "undefined") {
				globallyRestrictedProperties.set(propertyName, {
					allowObjects: option.allowObjects,
					message: option.message,
				});
			} else if (typeof propertyName === "undefined") {
				globallyRestrictedObjects.set(objectName, {
					allowProperties: option.allowProperties,
					message: option.message,
				});
			} else {
				if (!restrictedProperties.has(objectName)) {
					restrictedProperties.set(objectName, new Map());
				}

				restrictedProperties.get(objectName).set(propertyName, {
					message: option.message,
				});
			}
		});

		/**
		 * Checks if a name is in the allowed list.
		 * @param {string} name The name to check
		 * @param {string[]} [allowedList] The list of allowed names
		 * @returns {boolean} True if the name is allowed, false otherwise
		 */
		function isAllowed(name, allowedList) {
			if (!allowedList) {
				return false;
			}

			return allowedList.includes(name);
		}

		/**
		 * Checks to see whether a property access is restricted, and reports it if so.
		 * @param {ASTNode} node The node to report
		 * @param {string} objectName The name of the object
		 * @param {string} propertyName The name of the property
		 * @returns {undefined}
		 */
		function checkPropertyAccess(node, objectName, propertyName) {
			if (propertyName === null) {
				return;
			}
			const matchedObject = restrictedProperties.get(objectName);
			const matchedObjectProperty = matchedObject
				? matchedObject.get(propertyName)
				: globallyRestrictedObjects.get(objectName);
			const globalMatchedProperty =
				globallyRestrictedProperties.get(propertyName);

			if (
				matchedObjectProperty &&
				!isAllowed(propertyName, matchedObjectProperty.allowProperties)
			) {
				const message = matchedObjectProperty.message
					? ` ${matchedObjectProperty.message}`
					: "";
				const allowedPropertiesMessage =
					matchedObjectProperty.allowProperties
						? ` Only these properties are allowed: ${matchedObjectProperty.allowProperties.join(", ")}.`
						: "";

				context.report({
					node,
					messageId: "restrictedObjectProperty",
					data: {
						objectName,
						propertyName,
						message,
						allowedPropertiesMessage,
					},
				});
			} else if (
				globalMatchedProperty &&
				!isAllowed(objectName, globalMatchedProperty.allowObjects)
			) {
				const message = globalMatchedProperty.message
					? ` ${globalMatchedProperty.message}`
					: "";
				const allowedObjectsMessage = globalMatchedProperty.allowObjects
					? ` Property '${propertyName}' is only allowed on these objects: ${globalMatchedProperty.allowObjects.join(", ")}.`
					: "";

				context.report({
					node,
					messageId: "restrictedProperty",
					data: {
						propertyName,
						message,
						allowedObjectsMessage,
					},
				});
			}
		}

		return {
			MemberExpression(node) {
				checkPropertyAccess(
					node,
					node.object && node.object.name,
					astUtils.getStaticPropertyName(node),
				);
			},
			ObjectPattern(node) {
				let objectName = null;

				if (node.parent.type === "VariableDeclarator") {
					if (
						node.parent.init &&
						node.parent.init.type === "Identifier"
					) {
						objectName = node.parent.init.name;
					}
				} else if (
					node.parent.type === "AssignmentExpression" ||
					node.parent.type === "AssignmentPattern"
				) {
					if (node.parent.right.type === "Identifier") {
						objectName = node.parent.right.name;
					}
				}

				node.properties.forEach(property => {
					checkPropertyAccess(
						node,
						objectName,
						astUtils.getStaticPropertyName(property),
					);
				});
			},
		};
	},
};
kxF/**
 * @fileoverview Rule to flag use of certain node types
 * @author Burak Yigit Kaya
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow specified syntax",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-restricted-syntax",
		},

		schema: {
			type: "array",
			items: {
				oneOf: [
					{
						type: "string",
					},
					{
						type: "object",
						properties: {
							selector: { type: "string" },
							message: { type: "string" },
						},
						required: ["selector"],
						additionalProperties: false,
					},
				],
			},
			uniqueItems: true,
			minItems: 0,
		},

		defaultOptions: [],

		messages: {
			// eslint-disable-next-line eslint-plugin/report-message-format -- Custom message might not end in a period
			restrictedSyntax: "{{message}}",
		},
	},

	create(context) {
		return context.options.reduce((result, selectorOrObject) => {
			const isStringFormat = typeof selectorOrObject === "string";
			const hasCustomMessage =
				!isStringFormat && Boolean(selectorOrObject.message);

			const selector = isStringFormat
				? selectorOrObject
				: selectorOrObject.selector;
			const message = hasCustomMessage
				? selectorOrObject.message
				: `Using '${selector}' is not allowed.`;

			return Object.assign(result, {
				[selector](node) {
					context.report({
						node,
						messageId: "restrictedSyntax",
						data: { message },
					});
				},
			});
		}, {});
	},
};
W-x,/**
 * @fileoverview Rule to flag when return statement contains assignment
 * @author Ilya Volodin
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const SENTINEL_TYPE =
	/^(?:[a-zA-Z]+?Statement|ArrowFunctionExpression|FunctionExpression|ClassExpression)$/u;

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: ["except-parens"],

		docs: {
			description: "Disallow assignment operators in `return` statements",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-return-assign",
		},

		schema: [
			{
				enum: ["except-parens", "always"],
			},
		],

		messages: {
			returnAssignment: "Return statement should not contain assignment.",
			arrowAssignment: "Arrow function should not return assignment.",
		},
	},

	create(context) {
		const always = context.options[0] !== "except-parens";
		const sourceCode = context.sourceCode;

		return {
			AssignmentExpression(node) {
				if (!always && astUtils.isParenthesised(sourceCode, node)) {
					return;
				}

				let currentChild = node;
				let parent = currentChild.parent;

				// Find ReturnStatement or ArrowFunctionExpression in ancestors.
				while (parent && !SENTINEL_TYPE.test(parent.type)) {
					currentChild = parent;
					parent = parent.parent;
				}

				// Reports.
				if (parent && parent.type === "ReturnStatement") {
					context.report({
						node: parent,
						messageId: "returnAssignment",
					});
				} else if (
					parent &&
					parent.type === "ArrowFunctionExpression" &&
					parent.body === currentChild
				) {
					context.report({
						node: parent,
						messageId: "arrowAssignment",
					});
				}
			},
		};
	},
};
e xi/**
 * @fileoverview Disallows unnecessary `return await`
 * @author Jordan Harband
 * @deprecated in ESLint v8.46.0
 */
"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		hasSuggestions: true,
		type: "suggestion",

		docs: {
			description: "Disallow unnecessary `return await`",

			recommended: false,

			url: "https://eslint.org/docs/latest/rules/no-return-await",
		},

		fixable: null,

		deprecated: {
			message:
				"The original assumption of the rule no longer holds true because of engine optimization.",
			deprecatedSince: "8.46.0",
			availableUntil: null,
			replacedBy: [],
		},

		schema: [],

		messages: {
			removeAwait: "Remove redundant `await`.",
			redundantUseOfAwait: "Redundant use of `await` on a return value.",
		},
	},

	create(context) {
		/**
		 * Reports a found unnecessary `await` expression.
		 * @param {ASTNode} node The node representing the `await` expression to report
		 * @returns {void}
		 */
		function reportUnnecessaryAwait(node) {
			context.report({
				node: context.sourceCode.getFirstToken(node),
				loc: node.loc,
				messageId: "redundantUseOfAwait",
				suggest: [
					{
						messageId: "removeAwait",
						fix(fixer) {
							const sourceCode = context.sourceCode;
							const [awaitToken, tokenAfterAwait] =
								sourceCode.getFirstTokens(node, 2);

							const areAwaitAndAwaitedExpressionOnTheSameLine =
								awaitToken.loc.start.line ===
								tokenAfterAwait.loc.start.line;

							if (!areAwaitAndAwaitedExpressionOnTheSameLine) {
								return null;
							}

							const [startOfAwait, endOfAwait] = awaitToken.range;

							const characterAfterAwait =
								sourceCode.text[endOfAwait];
							const trimLength =
								characterAfterAwait === " " ? 1 : 0;

							const range = [
								startOfAwait,
								endOfAwait + trimLength,
							];

							return fixer.removeRange(range);
						},
					},
				],
			});
		}

		/**
		 * Determines whether a thrown error from this node will be caught/handled within this function rather than immediately halting
		 * this function. For example, a statement in a `try` block will always have an error handler. A statement in
		 * a `catch` block will only have an error handler if there is also a `finally` block.
		 * @param {ASTNode} node A node representing a location where an could be thrown
		 * @returns {boolean} `true` if a thrown error will be caught/handled in this function
		 */
		function hasErrorHandler(node) {
			let ancestor = node;

			while (
				!astUtils.isFunction(ancestor) &&
				ancestor.type !== "Program"
			) {
				if (
					ancestor.parent.type === "TryStatement" &&
					(ancestor === ancestor.parent.block ||
						(ancestor === ancestor.parent.handler &&
							ancestor.parent.finalizer))
				) {
					return true;
				}
				ancestor = ancestor.parent;
			}
			return false;
		}

		/**
		 * Checks if a node is placed in tail call position. Once `return` arguments (or arrow function expressions) can be a complex expression,
		 * an `await` expression could or could not be unnecessary by the definition of this rule. So we're looking for `await` expressions that are in tail position.
		 * @param {ASTNode} node A node representing the `await` expression to check
		 * @returns {boolean} The checking result
		 */
		function isInTailCallPosition(node) {
			if (node.parent.type === "ArrowFunctionExpression") {
				return true;
			}
			if (node.parent.type === "ReturnStatement") {
				return !hasErrorHandler(node.parent);
			}
			if (
				node.parent.type === "ConditionalExpression" &&
				(node === node.parent.consequent ||
					node === node.parent.alternate)
			) {
				return isInTailCallPosition(node.parent);
			}
			if (
				node.parent.type === "LogicalExpression" &&
				node === node.parent.right
			) {
				return isInTailCallPosition(node.parent);
			}
			if (
				node.parent.type === "SequenceExpression" &&
				node === node.parent.expressions.at(-1)
			) {
				return isInTailCallPosition(node.parent);
			}
			return false;
		}

		return {
			AwaitExpression(node) {
				if (isInTailCallPosition(node) && !hasErrorHandler(node)) {
					reportUnnecessaryAwait(node);
				}
			},
		};
	},
};
[Ѻ]x%/**
 * @fileoverview Rule to disallow `javascript:` URLs
 * @author Ilya Volodin
 */
/* eslint no-script-url: 0 -- Code is checking to report such URLs */

"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow `javascript:` URLs",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-script-url",
		},

		schema: [],

		messages: {
			unexpectedScriptURL: "Script URL is a form of eval.",
		},
	},

	create(context) {
		/**
		 * Check whether a node's static value starts with `javascript:` or not.
		 * And report an error for unexpected script URL.
		 * @param {ASTNode} node node to check
		 * @returns {void}
		 */
		function check(node) {
			const value = astUtils.getStaticStringValue(node);

			if (
				typeof value === "string" &&
				value.toLowerCase().indexOf("javascript:") === 0
			) {
				context.report({ node, messageId: "unexpectedScriptURL" });
			}
		}
		return {
			Literal(node) {
				if (node.value && typeof node.value === "string") {
					check(node);
				}
			},
			TemplateLiteral(node) {
				if (!(
					node.parent &&
					node.parent.type === "TaggedTemplateExpression"
				)) {
					check(node);
				}
			},
		};
	},
};
ƴ3x:/**
 * @fileoverview Rule to disallow assignments where both sides are exactly the same
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const SPACES = /\s+/gu;

/**
 * Traverses 2 Pattern nodes in parallel, then reports self-assignments.
 * @param {ASTNode|null} left A left node to traverse. This is a Pattern or
 *      a Property.
 * @param {ASTNode|null} right A right node to traverse. This is a Pattern or
 *      a Property.
 * @param {boolean} props The flag to check member expressions as well.
 * @param {Function} report A callback function to report.
 * @returns {void}
 */
function eachSelfAssignment(left, right, props, report) {
	if (!left || !right) {
		// do nothing
	} else if (
		left.type === "Identifier" &&
		right.type === "Identifier" &&
		left.name === right.name
	) {
		report(right);
	} else if (
		left.type === "ArrayPattern" &&
		right.type === "ArrayExpression"
	) {
		const end = Math.min(left.elements.length, right.elements.length);

		for (let i = 0; i < end; ++i) {
			const leftElement = left.elements[i];
			const rightElement = right.elements[i];

			// Avoid cases such as [...a] = [...a, 1]
			if (
				leftElement &&
				leftElement.type === "RestElement" &&
				i < right.elements.length - 1
			) {
				break;
			}

			eachSelfAssignment(leftElement, rightElement, props, report);

			// After a spread element, those indices are unknown.
			if (rightElement && rightElement.type === "SpreadElement") {
				break;
			}
		}
	} else if (left.type === "RestElement" && right.type === "SpreadElement") {
		eachSelfAssignment(left.argument, right.argument, props, report);
	} else if (
		left.type === "ObjectPattern" &&
		right.type === "ObjectExpression" &&
		right.properties.length >= 1
	) {
		/*
		 * Gets the index of the last spread property.
		 * It's possible to overwrite properties followed by it.
		 */
		let startJ = 0;

		for (let i = right.properties.length - 1; i >= 0; --i) {
			const propType = right.properties[i].type;

			if (
				propType === "SpreadElement" ||
				propType === "ExperimentalSpreadProperty"
			) {
				startJ = i + 1;
				break;
			}
		}

		for (let i = 0; i < left.properties.length; ++i) {
			for (let j = startJ; j < right.properties.length; ++j) {
				eachSelfAssignment(
					left.properties[i],
					right.properties[j],
					props,
					report,
				);
			}
		}
	} else if (
		left.type === "Property" &&
		right.type === "Property" &&
		right.kind === "init" &&
		!right.method
	) {
		const leftName = astUtils.getStaticPropertyName(left);

		if (
			leftName !== null &&
			leftName === astUtils.getStaticPropertyName(right)
		) {
			eachSelfAssignment(left.value, right.value, props, report);
		}
	} else if (
		props &&
		astUtils.skipChainExpression(left).type === "MemberExpression" &&
		astUtils.skipChainExpression(right).type === "MemberExpression" &&
		astUtils.isSameReference(left, right)
	) {
		report(right);
	}
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		defaultOptions: [{ props: true }],

		docs: {
			description:
				"Disallow assignments where both sides are exactly the same",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-self-assign",
		},

		schema: [
			{
				type: "object",
				properties: {
					props: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			selfAssignment: "'{{name}}' is assigned to itself.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const [{ props }] = context.options;

		/**
		 * Reports a given node as self assignments.
		 * @param {ASTNode} node A node to report. This is an Identifier node.
		 * @returns {void}
		 */
		function report(node) {
			context.report({
				node,
				messageId: "selfAssignment",
				data: {
					name: sourceCode.getText(node).replace(SPACES, ""),
				},
			});
		}

		return {
			AssignmentExpression(node) {
				if (["=", "&&=", "||=", "??="].includes(node.operator)) {
					eachSelfAssignment(node.left, node.right, props, report);
				}
			},
		};
	},
};
djxV/**
 * @fileoverview Rule to flag comparison where left part is the same as the right
 * part.
 * @author Ilya Volodin
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description:
				"Disallow comparisons where both sides are exactly the same",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-self-compare",
		},

		schema: [],

		messages: {
			comparingToSelf: "Comparing to itself is potentially pointless.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		/**
		 * Determines whether two nodes are composed of the same tokens.
		 * @param {ASTNode} nodeA The first node
		 * @param {ASTNode} nodeB The second node
		 * @returns {boolean} true if the nodes have identical token representations
		 */
		function hasSameTokens(nodeA, nodeB) {
			const tokensA = sourceCode.getTokens(nodeA);
			const tokensB = sourceCode.getTokens(nodeB);

			return (
				tokensA.length === tokensB.length &&
				tokensA.every(
					(token, index) =>
						token.type === tokensB[index].type &&
						token.value === tokensB[index].value,
				)
			);
		}

		return {
			BinaryExpression(node) {
				const operators = new Set([
					"===",
					"==",
					"!==",
					"!=",
					">",
					"<",
					">=",
					"<=",
				]);

				if (
					operators.has(node.operator) &&
					hasSameTokens(node.left, node.right)
				) {
					context.report({ node, messageId: "comparingToSelf" });
				}
			},
		};
	},
};
oxT/**
 * @fileoverview Rule to flag use of comma operator
 * @author Brandon Mills
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow comma operators",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-sequences",
		},

		schema: [
			{
				type: "object",
				properties: {
					allowInParentheses: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		defaultOptions: [
			{
				allowInParentheses: true,
			},
		],

		messages: {
			unexpectedCommaExpression: "Unexpected use of comma operator.",
		},
	},

	create(context) {
		const [{ allowInParentheses }] = context.options;
		const sourceCode = context.sourceCode;

		/**
		 * Parts of the grammar that are required to have parens.
		 */
		const parenthesized = {
			DoWhileStatement: "test",
			IfStatement: "test",
			SwitchStatement: "discriminant",
			WhileStatement: "test",
			WithStatement: "object",
			ArrowFunctionExpression: "body",

			/*
			 * Omitting CallExpression - commas are parsed as argument separators
			 * Omitting NewExpression - commas are parsed as argument separators
			 * Omitting ForInStatement - parts aren't individually parenthesised
			 * Omitting ForStatement - parts aren't individually parenthesised
			 */
		};

		/**
		 * Determines whether a node is required by the grammar to be wrapped in
		 * parens, e.g. the test of an if statement.
		 * @param {ASTNode} node The AST node
		 * @returns {boolean} True if parens around node belong to parent node.
		 */
		function requiresExtraParens(node) {
			return (
				node.parent &&
				parenthesized[node.parent.type] &&
				node === node.parent[parenthesized[node.parent.type]]
			);
		}

		/**
		 * Check if a node is wrapped in parens.
		 * @param {ASTNode} node The AST node
		 * @returns {boolean} True if the node has a paren on each side.
		 */
		function isParenthesised(node) {
			return astUtils.isParenthesised(sourceCode, node);
		}

		/**
		 * Check if a node is wrapped in two levels of parens.
		 * @param {ASTNode} node The AST node
		 * @returns {boolean} True if two parens surround the node on each side.
		 */
		function isParenthesisedTwice(node) {
			const previousToken = sourceCode.getTokenBefore(node, 1),
				nextToken = sourceCode.getTokenAfter(node, 1);

			return (
				isParenthesised(node) &&
				previousToken &&
				nextToken &&
				astUtils.isOpeningParenToken(previousToken) &&
				previousToken.range[1] <= node.range[0] &&
				astUtils.isClosingParenToken(nextToken) &&
				nextToken.range[0] >= node.range[1]
			);
		}

		return {
			SequenceExpression(node) {
				// Always allow sequences in for statement update
				if (
					node.parent.type === "ForStatement" &&
					(node === node.parent.init || node === node.parent.update)
				) {
					return;
				}

				// Wrapping a sequence in extra parens indicates intent
				if (allowInParentheses) {
					if (requiresExtraParens(node)) {
						if (isParenthesisedTwice(node)) {
							return;
						}
					} else {
						if (isParenthesised(node)) {
							return;
						}
					}
				}

				const firstCommaToken = sourceCode.getTokenAfter(
					node.expressions[0],
					astUtils.isCommaToken,
				);

				context.report({
					node,
					loc: firstCommaToken.loc,
					messageId: "unexpectedCommaExpression",
				});
			},
		};
	},
};
NZx]/**
 * @fileoverview Rule to disallow returning values from setters
 * @author Milos Djermanovic
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Determines whether the given node is an argument of the specified global method call, at the given `index` position.
 * E.g., for given `index === 1`, this function checks for `objectName.methodName(foo, node)`, where objectName is a global variable.
 * @param {ASTNode} node The node to check.
 * @param {SourceCode} sourceCode Source code to which the node belongs.
 * @param {string} objectName Name of the global object.
 * @param {string} methodName Name of the method.
 * @param {number} index The given position.
 * @returns {boolean} `true` if the node is argument at the given position.
 */
function isArgumentOfGlobalMethodCall(
	node,
	sourceCode,
	objectName,
	methodName,
	index,
) {
	const callNode = node.parent;

	return (
		callNode.type === "CallExpression" &&
		callNode.arguments[index] === node &&
		astUtils.isSpecificMemberAccess(
			callNode.callee,
			objectName,
			methodName,
		) &&
		sourceCode.isGlobalReference(
			astUtils.skipChainExpression(callNode.callee).object,
		)
	);
}

/**
 * Determines whether the given node is used as a property descriptor.
 * @param {ASTNode} node The node to check.
 * @param {SourceCode} sourceCode Source code to which the node belongs.
 * @returns {boolean} `true` if the node is a property descriptor.
 */
function isPropertyDescriptor(node, sourceCode) {
	if (
		isArgumentOfGlobalMethodCall(
			node,
			sourceCode,
			"Object",
			"defineProperty",
			2,
		) ||
		isArgumentOfGlobalMethodCall(
			node,
			sourceCode,
			"Reflect",
			"defineProperty",
			2,
		)
	) {
		return true;
	}

	const parent = node.parent;

	if (parent.type === "Property" && parent.value === node) {
		const grandparent = parent.parent;

		if (
			grandparent.type === "ObjectExpression" &&
			(isArgumentOfGlobalMethodCall(
				grandparent,
				sourceCode,
				"Object",
				"create",
				1,
			) ||
				isArgumentOfGlobalMethodCall(
					grandparent,
					sourceCode,
					"Object",
					"defineProperties",
					1,
				))
		) {
			return true;
		}
	}

	return false;
}

/**
 * Determines whether the given function node is used as a setter function.
 * @param {ASTNode} node The node to check.
 * @param {SourceCode} sourceCode Source code to which the node belongs.
 * @returns {boolean} `true` if the node is a setter.
 */
function isSetter(node, sourceCode) {
	const parent = node.parent;

	if (
		(parent.type === "Property" || parent.type === "MethodDefinition") &&
		parent.kind === "set" &&
		parent.value === node
	) {
		// Setter in an object literal or in a class
		return true;
	}

	if (
		parent.type === "Property" &&
		parent.value === node &&
		astUtils.getStaticPropertyName(parent) === "set" &&
		parent.parent.type === "ObjectExpression" &&
		isPropertyDescriptor(parent.parent, sourceCode)
	) {
		// Setter in a property descriptor
		return true;
	}

	return false;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description: "Disallow returning values from setters",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-setter-return",
		},

		schema: [],

		messages: {
			returnsValue: "Setter cannot return a value.",
		},
	},

	create(context) {
		let funcInfo = null;
		const sourceCode = context.sourceCode;

		/**
		 * Creates and pushes to the stack a function info object for the given function node.
		 * @param {ASTNode} node The function node.
		 * @returns {void}
		 */
		function enterFunction(node) {
			funcInfo = {
				upper: funcInfo,
				isSetter: isSetter(node, sourceCode),
			};
		}

		/**
		 * Pops the current function info object from the stack.
		 * @returns {void}
		 */
		function exitFunction() {
			funcInfo = funcInfo.upper;
		}

		/**
		 * Reports the given node.
		 * @param {ASTNode} node Node to report.
		 * @returns {void}
		 */
		function report(node) {
			context.report({ node, messageId: "returnsValue" });
		}

		return {
			/*
			 * Function declarations cannot be setters, but we still have to track them in the `funcInfo` stack to avoid
			 * false positives, because a ReturnStatement node can belong to a function declaration inside a setter.
			 *
			 * Note: A previously declared function can be referenced and actually used as a setter in a property descriptor,
			 * but that's out of scope for this rule.
			 */
			FunctionDeclaration: enterFunction,
			FunctionExpression: enterFunction,
			ArrowFunctionExpression(node) {
				enterFunction(node);

				if (funcInfo.isSetter && node.expression) {
					// { set: foo => bar } property descriptor. Report implicit return 'bar' as the equivalent for a return statement.
					report(node.body);
				}
			},

			"FunctionDeclaration:exit": exitFunction,
			"FunctionExpression:exit": exitFunction,
			"ArrowFunctionExpression:exit": exitFunction,

			ReturnStatement(node) {
				// Global returns (e.g., at the top level of a Node module) don't have `funcInfo`.
				if (funcInfo && funcInfo.isSetter && node.argument) {
					report(node);
				}
			},
		};
	},
};
酿xo
/**
 * @fileoverview Disallow shadowing of globalThis, NaN, undefined, and Infinity (ES2020 section 18.1)
 * @author Michael Ficarra
 */
"use strict";

/**
 * Determines if a variable safely shadows undefined.
 * This is the case when a variable named `undefined` is never assigned to a value (i.e. it always shares the same value
 * as the global).
 * @param {eslintScope.Variable} variable The variable to check
 * @returns {boolean} true if this variable safely shadows `undefined`
 */
function safelyShadowsUndefined(variable) {
	return (
		variable.name === "undefined" &&
		variable.references.every(ref => !ref.isWrite()) &&
		variable.defs.every(
			def =>
				def.node.type === "VariableDeclarator" &&
				def.node.init === null,
		)
	);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				reportGlobalThis: true,
			},
		],

		docs: {
			description: "Disallow identifiers from shadowing restricted names",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-shadow-restricted-names",
		},

		schema: [
			{
				type: "object",
				properties: {
					reportGlobalThis: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			shadowingRestrictedName: "Shadowing of global property '{{name}}'.",
		},
	},

	create(context) {
		const [{ reportGlobalThis }] = context.options;

		const RESTRICTED = new Set([
			"undefined",
			"NaN",
			"Infinity",
			"arguments",
			"eval",
		]);

		if (reportGlobalThis) {
			RESTRICTED.add("globalThis");
		}

		const sourceCode = context.sourceCode;

		// Track reported nodes to avoid duplicate reports. For example, on class declarations.
		const reportedNodes = new Set();

		return {
			"VariableDeclaration, :function, CatchClause, ImportDeclaration, ClassDeclaration, ClassExpression"(
				node,
			) {
				for (const variable of sourceCode.getDeclaredVariables(node)) {
					if (
						variable.defs.length > 0 &&
						RESTRICTED.has(variable.name) &&
						!safelyShadowsUndefined(variable)
					) {
						for (const def of variable.defs) {
							const nodeToReport = def.name;

							if (!reportedNodes.has(nodeToReport)) {
								reportedNodes.add(nodeToReport);
								context.report({
									node: nodeToReport,
									messageId: "shadowingRestrictedName",
									data: {
										name: variable.name,
									},
								});
							}
						}
					}
				}
			},
		};
	},
};
'W	x5Lʳ/**
 * @fileoverview Rule to flag on declaring variables already declared in the outer scope
 * @author Ilya Volodin
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @typedef {import("eslint-scope").Variable} Variable */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const FUNC_EXPR_NODE_TYPES = new Set([
	"ArrowFunctionExpression",
	"FunctionExpression",
]);
const CALL_EXPR_NODE_TYPE = new Set(["CallExpression"]);
const FOR_IN_OF_TYPE = /^For(?:In|Of)Statement$/u;
const SENTINEL_TYPE =
	/^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/u;

// TS-specific node types
const TYPES_HOISTED_NODES = new Set([
	"TSInterfaceDeclaration",
	"TSTypeAliasDeclaration",
]);

// TS-specific function variable def types
const ALLOWED_FUNCTION_VARIABLE_DEF_TYPES = new Set([
	"TSCallSignatureDeclaration",
	"TSFunctionType",
	"TSMethodSignature",
	"TSEmptyBodyFunctionExpression",
	"TSDeclareFunction",
	"TSConstructSignatureDeclaration",
	"TSConstructorType",
]);

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				allow: [],
				builtinGlobals: false,
				hoist: "functions",
				ignoreOnInitialization: false,
				ignoreTypeValueShadow: true,
				ignoreFunctionTypeParameterNameValueShadow: true,
			},
		],

		docs: {
			description:
				"Disallow variable declarations from shadowing variables declared in the outer scope",
			dialects: ["JavaScript", "TypeScript"],
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-shadow",
		},

		schema: [
			{
				type: "object",
				properties: {
					builtinGlobals: { type: "boolean" },
					hoist: {
						enum: [
							"all",
							"functions",
							"never",
							"types",
							"functions-and-types",
						],
					},
					allow: {
						type: "array",
						items: {
							type: "string",
						},
					},
					ignoreOnInitialization: { type: "boolean" },
					ignoreTypeValueShadow: { type: "boolean" },
					ignoreFunctionTypeParameterNameValueShadow: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			noShadow:
				"'{{name}}' is already declared in the upper scope on line {{shadowedLine}} column {{shadowedColumn}}.",
			noShadowGlobal: "'{{name}}' is already a global variable.",
		},
	},

	create(context) {
		const [
			{
				builtinGlobals,
				hoist,
				allow,
				ignoreOnInitialization,
				ignoreTypeValueShadow,
				ignoreFunctionTypeParameterNameValueShadow,
			},
		] = context.options;
		const sourceCode = context.sourceCode;

		/**
		 * Check if a scope is a TypeScript module augmenting the global namespace.
		 * @param {Scope} scope The scope to check
		 * @returns {boolean} Whether the scope is a global augmentation
		 */
		function isGlobalAugmentation(scope) {
			return (
				scope.block.kind === "global" ||
				(!!scope.upper && isGlobalAugmentation(scope.upper))
			);
		}

		/**
		 * Check if variable is a `this` parameter.
		 * @param {Object} variable The variable to check
		 * @returns {boolean} Whether the variable is a this parameter
		 */
		function isThisParam(variable) {
			return variable.name === "this";
		}

		/**
		 * Checks if type and value shadows each other
		 * @param {Object} variable The variable to check
		 * @param {Object} shadowedVariable The shadowed variable
		 * @returns {boolean} Whether it's a type/value shadow case to ignore
		 */
		function isTypeValueShadow(variable, shadowedVariable) {
			if (ignoreTypeValueShadow !== true) {
				return false;
			}

			if (!("isValueVariable" in variable)) {
				return false;
			}

			const firstDefinition = shadowedVariable.defs[0];

			// Check if shadowedVariable is a type import
			const isTypeImport =
				firstDefinition &&
				firstDefinition.parent?.type === "ImportDeclaration" &&
				(firstDefinition.parent.importKind === "type" ||
					firstDefinition.parent.specifiers.some(
						s => s.importKind === "type",
					));

			const isShadowedValue =
				!firstDefinition ||
				(isTypeImport ? false : shadowedVariable.isValueVariable);

			return variable.isValueVariable !== isShadowedValue;
		}

		/**
		 * Checks if it's a function type parameter shadow
		 * @param {Object} variable The variable to check
		 * @returns {boolean} Whether it's a function type parameter shadow case to ignore
		 */
		function isFunctionTypeParameterNameValueShadow(variable) {
			if (ignoreFunctionTypeParameterNameValueShadow !== true) {
				return false;
			}

			return variable.defs.some(def =>
				ALLOWED_FUNCTION_VARIABLE_DEF_TYPES.has(def.node.type),
			);
		}

		/**
		 * Checks if the variable is a generic of a static method
		 * @param {Object} variable The variable to check
		 * @returns {boolean} Whether the variable is a generic of a static method
		 */
		function isTypeParameterOfStaticMethod(variable) {
			const typeParameter = variable.identifiers[0].parent;
			const typeParameterDecl = typeParameter.parent;
			if (typeParameterDecl.type !== "TSTypeParameterDeclaration") {
				return false;
			}
			const functionExpr = typeParameterDecl.parent;
			const methodDefinition = functionExpr.parent;
			return methodDefinition.static;
		}

		/**
		 * Checks for static method generic shadowing class generic
		 * @param {Object} variable The variable to check
		 * @returns {boolean} Whether it's a static method generic shadowing class generic
		 */
		function isGenericOfAStaticMethodShadow(variable) {
			return isTypeParameterOfStaticMethod(variable);
		}

		/**
		 * Checks whether or not a given location is inside of the range of a given node.
		 * @param {ASTNode} node An node to check.
		 * @param {number} location A location to check.
		 * @returns {boolean} `true` if the location is inside of the range of the node.
		 */
		function isInRange(node, location) {
			return (
				node && node.range[0] <= location && location <= node.range[1]
			);
		}

		/**
		 * Searches from the current node through its ancestry to find a matching node.
		 * @param {ASTNode} node a node to get.
		 * @param {(node: ASTNode) => boolean} match a callback that checks whether or not the node verifies its condition or not.
		 * @returns {ASTNode|null} the matching node.
		 */
		function findSelfOrAncestor(node, match) {
			let currentNode = node;

			while (currentNode && !match(currentNode)) {
				currentNode = currentNode.parent;
			}
			return currentNode;
		}

		/**
		 * Finds function's outer scope.
		 * @param {Scope} scope Function's own scope.
		 * @returns {Scope} Function's outer scope.
		 */
		function getOuterScope(scope) {
			const upper = scope.upper;

			if (upper && upper.type === "function-expression-name") {
				return upper.upper;
			}
			return upper;
		}

		/**
		 * Checks if a variable and a shadowedVariable have the same init pattern ancestor.
		 * @param {Object} variable a variable to check.
		 * @param {Object} shadowedVariable a shadowedVariable to check.
		 * @returns {boolean} Whether or not the variable and the shadowedVariable have the same init pattern ancestor.
		 */
		function isInitPatternNode(variable, shadowedVariable) {
			const outerDef = shadowedVariable.defs[0];

			if (!outerDef) {
				return false;
			}

			const { variableScope } = variable.scope;

			if (!(
				FUNC_EXPR_NODE_TYPES.has(variableScope.block.type) &&
				getOuterScope(variableScope) === shadowedVariable.scope
			)) {
				return false;
			}

			const fun = variableScope.block;
			const { parent } = fun;

			const callExpression = findSelfOrAncestor(parent, node =>
				CALL_EXPR_NODE_TYPE.has(node.type),
			);

			if (!callExpression) {
				return false;
			}

			let node = outerDef.name;
			const location = callExpression.range[1];

			while (node) {
				if (node.type === "VariableDeclarator") {
					if (isInRange(node.init, location)) {
						return true;
					}
					if (
						FOR_IN_OF_TYPE.test(node.parent.parent.type) &&
						isInRange(node.parent.parent.right, location)
					) {
						return true;
					}
					break;
				} else if (node.type === "AssignmentPattern") {
					if (isInRange(node.right, location)) {
						return true;
					}
				} else if (SENTINEL_TYPE.test(node.type)) {
					break;
				}

				node = node.parent;
			}

			return false;
		}

		/**
		 * Check if variable name is allowed.
		 * @param {ASTNode} variable The variable to check.
		 * @returns {boolean} Whether or not the variable name is allowed.
		 */
		function isAllowed(variable) {
			return allow.includes(variable.name);
		}

		/**
		 * Checks if a variable of the class name in the class scope of ClassDeclaration.
		 *
		 * ClassDeclaration creates two variables of its name into its outer scope and its class scope.
		 * So we should ignore the variable in the class scope.
		 * @param {Object} variable The variable to check.
		 * @returns {boolean} Whether or not the variable of the class name in the class scope of ClassDeclaration.
		 */
		function isDuplicatedClassNameVariable(variable) {
			const block = variable.scope.block;

			return (
				block.type === "ClassDeclaration" &&
				block.id === variable.identifiers[0]
			);
		}

		/**
		 * Finds the uppermost expression node that can evaluate to the given one.
		 *
		 * Examples:
		 *    If given `a` in `a || foo`, it returns the `a || foo` node.
		 *    If given `a` in `foo ? a : bar`, it returns the `foo ? a : bar` node.
		 *    If given `a` in `foo ? bar : (baz && a)`, it returns the `foo ? bar : (baz && a)` node.
		 *    If given `a` in `a ? foo : bar`, it returns the `a` node.
		 *    If given `a` in `foo(a)`, it returns the `a` node.
		 * @param {ASTNode} expression The expression node to unwrap.
		 * @returns {ASTNode} The uppermost ancestor that can evaluate to the given node
		 *     or the given node if there is no such ancestor.
		 */
		function unwrapExpression(expression) {
			const { parent } = expression;

			const shouldUnwrap =
				parent.type === "LogicalExpression" ||
				(parent.type === "ConditionalExpression" &&
					parent.test !== expression);

			return shouldUnwrap ? unwrapExpression(parent) : expression;
		}

		/**
		 * Checks if inner variable is the name of a function or class
		 * that is assigned to outer variable as its initializer.
		 *
		 * To avoid reporting at declarations such as:
		 *    var a = function a() {};
		 *    var A = class A {};
		 *    var a = foo || function a() {};
		 *    var a = foo ? function a() {} : bar;
		 *    var { a = function a() {} } = foo;
		 *
		 * But it should report at declarations such as:
		 *    var a = function(a) {};
		 *    var a = function() { function a() {} };
		 *    var a = wrap(function a() {});
		 * @param {Object} innerVariable The inner variable to check.
		 * @param {Object} outerVariable The outer variable.
		 * @returns {boolean} Whether or not inner variable is the name of a
		 *   function or class that is assigned to outer variable as its initializer.
		 */
		function isFunctionNameInitializerException(
			innerVariable,
			outerVariable,
		) {
			const outerDef = outerVariable.defs[0];
			const innerDef = innerVariable.defs[0];

			if (!outerDef || !innerDef) {
				return false;
			}

			if (!(
				(innerDef.type === "FunctionName" &&
					innerDef.node.type === "FunctionExpression") ||
				(innerDef.type === "ClassName" &&
					innerDef.node.type === "ClassExpression")
			)) {
				return false;
			}

			const outerIdentifier = outerDef.name;
			let initializerNode;

			if (outerIdentifier.parent.type === "VariableDeclarator") {
				initializerNode = outerIdentifier.parent.init;
			} else if (outerIdentifier.parent.type === "AssignmentPattern") {
				initializerNode = outerIdentifier.parent.right;
			}

			if (!initializerNode) {
				return false;
			}

			const nodeToCheck = innerDef.node; // FunctionExpression or ClassExpression node

			// Exit early if the node to check isn't inside the initializer
			if (!(
				initializerNode.range[0] <= nodeToCheck.range[0] &&
				nodeToCheck.range[1] <= initializerNode.range[1]
			)) {
				return false;
			}

			return initializerNode === unwrapExpression(nodeToCheck);
		}

		/**
		 * Get a range of a variable's identifier node.
		 * @param {Object} variable The variable to get.
		 * @returns {Array|undefined} The range of the variable's identifier node.
		 */
		function getNameRange(variable) {
			const def = variable.defs[0];

			return def && def.name.range;
		}

		/**
		 * Get declared line and column of a variable.
		 * @param {Variable} variable The variable to get.
		 * @returns {Object} The declared line and column of the variable.
		 */
		function getDeclaredLocation(variable) {
			const identifier = variable.identifiers[0];
			let obj;

			if (identifier) {
				obj = {
					global: false,
					line: identifier.loc.start.line,
					column: identifier.loc.start.column + 1,
				};
			} else {
				obj = {
					global: true,
				};
			}
			return obj;
		}

		/**
		 * Checks if a variable is in TDZ of scopeVar.
		 * @param {Object} variable The variable to check.
		 * @param {Object} scopeVar The variable of TDZ.
		 * @returns {boolean} Whether or not the variable is in TDZ of scopeVar.
		 */
		function isInTdz(variable, scopeVar) {
			const outerDef = scopeVar.defs[0];
			const inner = getNameRange(variable);
			const outer = getNameRange(scopeVar);

			if (!outer || inner[1] >= outer[0]) {
				return false;
			}

			if (hoist === "types") {
				return !TYPES_HOISTED_NODES.has(outerDef.node.type);
			}

			if (hoist === "functions-and-types") {
				return (
					outerDef.node.type !== "FunctionDeclaration" &&
					!TYPES_HOISTED_NODES.has(outerDef.node.type)
				);
			}

			return (
				inner &&
				outer &&
				inner[1] < outer[0] &&
				// Excepts FunctionDeclaration if is {"hoist":"function"}.
				(hoist !== "functions" ||
					!outerDef ||
					outerDef.node.type !== "FunctionDeclaration")
			);
		}

		/**
		 * Checks if the initialization of a variable has the declare modifier in a
		 * definition file.
		 * @param {Object} variable The variable to check
		 * @returns {boolean} Whether the variable is declared in a definition file
		 */
		function isDeclareInDTSFile(variable) {
			const fileName = context.filename;
			if (
				!fileName.endsWith(".d.ts") &&
				!fileName.endsWith(".d.cts") &&
				!fileName.endsWith(".d.mts")
			) {
				return false;
			}
			return variable.defs.some(
				def =>
					(def.type === "Variable" && def.parent.declare) ||
					(def.type === "ClassName" && def.node.declare) ||
					(def.type === "TSEnumName" && def.node.declare) ||
					(def.type === "TSModuleName" && def.node.declare),
			);
		}

		/**
		 * Checks if a variable is a duplicate of an enum name in the enum scope
		 * @param {Object} variable The variable to check
		 * @returns {boolean} Whether it's a duplicate enum name variable
		 */
		function isDuplicatedEnumNameVariable(variable) {
			const block = variable.scope.block;

			return (
				block.type === "TSEnumDeclaration" &&
				block.id === variable.identifiers[0]
			);
		}

		/**
		 * Check if this is an external module declaration merging with a type import
		 * @param {Scope} scope Current scope
		 * @param {Object} variable Current variable
		 * @param {Object} shadowedVariable Shadowed variable
		 * @returns {boolean} Whether it's an external declaration merging
		 */
		function isExternalDeclarationMerging(
			scope,
			variable,
			shadowedVariable,
		) {
			const firstDefinition = shadowedVariable.defs[0];

			if (!firstDefinition || !firstDefinition.parent) {
				return false;
			}

			// Check if the shadowed variable is a type import
			const isTypeImport =
				firstDefinition.parent.type === "ImportDeclaration" &&
				(firstDefinition.parent.importKind === "type" ||
					firstDefinition.parent.specifiers?.some(
						s =>
							s.type === "ImportSpecifier" &&
							s.importKind === "type" &&
							s.local.name === shadowedVariable.name,
					));

			if (!isTypeImport) {
				return false;
			}

			// Check if the current variable is within a module declaration
			const moduleDecl = findSelfOrAncestor(
				variable.identifiers[0]?.parent,
				node => node.type === "TSModuleDeclaration",
			);

			if (!moduleDecl) {
				return false;
			}

			/*
			 * Module declaration merging should only happen within the same module
			 * Check if the module name matches the import source
			 */
			const importSource = firstDefinition.parent.source.value;
			const moduleName =
				moduleDecl.id.type === "Literal"
					? moduleDecl.id.value
					: moduleDecl.id.name;

			return importSource === moduleName;
		}

		/**
		 * Checks the current context for shadowed variables.
		 * @param {Scope} scope The scope to check for shadowed variables.
		 * @returns {void}
		 */
		function checkForShadows(scope) {
			// ignore global augmentation
			if (isGlobalAugmentation(scope)) {
				return;
			}

			const variables = scope.variables;

			for (let i = 0; i < variables.length; ++i) {
				const variable = variables[i];

				// Skips "arguments" or variables of a class name in the class scope of ClassDeclaration.
				if (
					variable.identifiers.length === 0 ||
					isDuplicatedClassNameVariable(variable) ||
					isDuplicatedEnumNameVariable(variable) ||
					isAllowed(variable) ||
					isDeclareInDTSFile(variable) ||
					isThisParam(variable)
				) {
					continue;
				}

				// Gets shadowed variable.
				const shadowed = astUtils.getVariableByName(
					scope.upper,
					variable.name,
				);

				if (
					shadowed &&
					(shadowed.identifiers.length > 0 ||
						(builtinGlobals && "writeable" in shadowed)) &&
					!isFunctionNameInitializerException(variable, shadowed) &&
					!(
						ignoreOnInitialization &&
						isInitPatternNode(variable, shadowed)
					) &&
					!(hoist !== "all" && isInTdz(variable, shadowed)) &&
					!isTypeValueShadow(variable, shadowed) &&
					!isFunctionTypeParameterNameValueShadow(variable) &&
					!isGenericOfAStaticMethodShadow(variable, shadowed) &&
					!isExternalDeclarationMerging(scope, variable, shadowed)
				) {
					const location = getDeclaredLocation(shadowed);
					const messageId = location.global
						? "noShadowGlobal"
						: "noShadow";
					const data = { name: variable.name };

					if (!location.global) {
						data.shadowedLine = location.line;
						data.shadowedColumn = location.column;
					}
					context.report({
						node: variable.identifiers[0],
						messageId,
						data,
					});
				}
			}
		}

		return {
			"Program:exit"(node) {
				const globalScope = sourceCode.getScope(node);
				const stack = globalScope.childScopes.slice();

				while (stack.length) {
					const scope = stack.pop();

					stack.push(...scope.childScopes);
					checkForShadows(scope);
				}
			},
		};
	},
};
[x%
/**
 * @fileoverview Rule to check that spaced function application
 * @author Matt DuVall <http://www.mattduvall.com>
 * @deprecated in ESLint v3.3.0
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "layout",

		docs: {
			description:
				"Disallow spacing between function identifiers and their applications (deprecated)",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-spaced-func",
		},

		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2016/08/eslint-v3.3.0-released/#deprecated-rules",
			deprecatedSince: "3.3.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "function-call-spacing",
						url: "https://eslint.style/rules/function-call-spacing",
					},
				},
			],
		},

		fixable: "whitespace",
		schema: [],

		messages: {
			noSpacedFunction:
				"Unexpected space between function name and paren.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		/**
		 * Check if open space is present in a function name
		 * @param {ASTNode} node node to evaluate
		 * @returns {void}
		 * @private
		 */
		function detectOpenSpaces(node) {
			const lastCalleeToken = sourceCode.getLastToken(node.callee);
			let prevToken = lastCalleeToken,
				parenToken = sourceCode.getTokenAfter(lastCalleeToken);

			// advances to an open parenthesis.
			while (
				parenToken &&
				parenToken.range[1] < node.range[1] &&
				parenToken.value !== "("
			) {
				prevToken = parenToken;
				parenToken = sourceCode.getTokenAfter(parenToken);
			}

			// look for a space between the callee and the open paren
			if (
				parenToken &&
				parenToken.range[1] < node.range[1] &&
				sourceCode.isSpaceBetween(prevToken, parenToken)
			) {
				context.report({
					node,
					loc: lastCalleeToken.loc.start,
					messageId: "noSpacedFunction",
					fix(fixer) {
						return fixer.removeRange([
							prevToken.range[1],
							parenToken.range[0],
						]);
					},
				});
			}
		}

		return {
			CallExpression: detectOpenSpaces,
			NewExpression: detectOpenSpaces,
		};
	},
};
׻\x4/**
 * @fileoverview Disallow sparse arrays
 * @author Nicholas C. Zakas
 */
"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description: "Disallow sparse arrays",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-sparse-arrays",
		},

		schema: [],

		messages: {
			unexpectedSparseArray: "Unexpected comma in middle of array.",
		},
	},

	create(context) {
		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			ArrayExpression(node) {
				if (!node.elements.includes(null)) {
					return;
				}

				const { sourceCode } = context;
				let commaToken;

				for (const [index, element] of node.elements.entries()) {
					if (index === node.elements.length - 1 && element) {
						return;
					}

					commaToken = sourceCode.getTokenAfter(
						element ?? commaToken ?? sourceCode.getFirstToken(node),
						astUtils.isCommaToken,
					);

					if (element) {
						continue;
					}

					context.report({
						node,
						loc: commaToken.loc,
						messageId: "unexpectedSparseArray",
					});
				}
			},
		};
	},
};
)Tux_/**
 * @fileoverview Rule to check for properties whose identifier ends with the string Sync
 * @author Matt DuVall<http://mattduvall.com/>
 * @deprecated in ESLint v7.0.0
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Node.js rules were moved out of ESLint core.",
			url: "https://eslint.org/docs/latest/use/migrating-to-7.0.0#deprecate-node-rules",
			deprecatedSince: "7.0.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"eslint-plugin-n now maintains deprecated Node.js-related rules.",
					plugin: {
						name: "eslint-plugin-n",
						url: "https://github.com/eslint-community/eslint-plugin-n",
					},
					rule: {
						name: "no-sync",
						url: "https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-sync.md",
					},
				},
			],
		},

		type: "suggestion",

		docs: {
			description: "Disallow synchronous methods",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-sync",
		},

		schema: [
			{
				type: "object",
				properties: {
					allowAtRootLevel: {
						type: "boolean",
						default: false,
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			noSync: "Unexpected sync method: '{{propertyName}}'.",
		},
	},

	create(context) {
		const selector =
			context.options[0] && context.options[0].allowAtRootLevel
				? ":function MemberExpression[property.name=/.*Sync$/]"
				: "MemberExpression[property.name=/.*Sync$/]";

		return {
			[selector](node) {
				context.report({
					node,
					messageId: "noSync",
					data: {
						propertyName: node.property.name,
					},
				});
			},
		};
	},
};
'x	n/**
 * @fileoverview Rule to check for tabs inside a file
 * @author Gyandeep Singh
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const tabRegex = /\t+/gu;
const anyNonWhitespaceRegex = /\S/u;

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "no-tabs",
						url: "https://eslint.style/rules/no-tabs",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Disallow all tabs",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-tabs",
		},
		schema: [
			{
				type: "object",
				properties: {
					allowIndentationTabs: {
						type: "boolean",
						default: false,
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			unexpectedTab: "Unexpected tab character.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const allowIndentationTabs =
			context.options &&
			context.options[0] &&
			context.options[0].allowIndentationTabs;

		return {
			Program(node) {
				sourceCode.getLines().forEach((line, index) => {
					let match;

					while ((match = tabRegex.exec(line)) !== null) {
						if (
							allowIndentationTabs &&
							!anyNonWhitespaceRegex.test(
								line.slice(0, match.index),
							)
						) {
							continue;
						}

						context.report({
							node,
							loc: {
								start: {
									line: index + 1,
									column: match.index,
								},
								end: {
									line: index + 1,
									column: match.index + match[0].length,
								},
							},
							messageId: "unexpectedTab",
						});
					}
				});
			},
		};
	},
};
kP=x"/**
 * @fileoverview Warn when using template string syntax in regular strings
 * @author Jeroen Engels
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description:
				"Disallow template literal placeholder syntax in regular strings",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-template-curly-in-string",
		},

		schema: [],

		messages: {
			unexpectedTemplateExpression:
				"Unexpected template string expression.",
		},
	},

	create(context) {
		const regex = /\$\{[^}]+\}/u;

		return {
			Literal(node) {
				if (typeof node.value === "string" && regex.test(node.value)) {
					context.report({
						node,
						messageId: "unexpectedTemplateExpression",
					});
				}
			},
		};
	},
};
 1x/**
 * @fileoverview Rule to flag use of ternary operators.
 * @author Ian Christian Myers
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow ternary operators",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/no-ternary",
		},

		schema: [],

		messages: {
			noTernaryOperator: "Ternary operator used.",
		},
	},

	create(context) {
		return {
			ConditionalExpression(node) {
				context.report({ node, messageId: "noTernaryOperator" });
			},
		};
	},
};
gQlx0^F.disallow using `this`/`super` before `super()`GRequirementT2const astUtils = require("./utils/ast-utils");

//QH1>
 * Information for each code path segment.
 * - superCalled: ^ called in all code paths.
 * - invalidNodes: The array of invalid ThisExpression and Super nodes.
 */
/**
 *
 */
class SegmentI|whether*superCalled = false;

	/**
	 * The array of invalid ThisExpression and Super nodes.
	 * @type {ASTNode[]}
	 */
	invalidNodes = 86
				"Disallow `this`/`super` before calling `super()`/Wno-this-before/:noBeforeSuper: "'{{kind}}' is not allowed before 'super()'+,the owner class has a valid
		 *   `extends`'	the owner*f this11g$ */
		le5whether or notaX
(segment) {
			return !segment.reachable || segInfoMap[segment.id]?.superCalled;
		}

		/**
		 * Checks whether or not this is in a constructor
is is in a1CInConstructorOfDerivedClass() {
			return Boolean(
				funcInfo && L--,%jevery segment in a set has been called.
		 * @param {Set<CodePathSegment>} segments The segments to search5rue if every segment has been called; false otherwiseEverySegmentCalled(segments) {
F.)if (!isCalled(segment)) {
					return false;
				}
			}

			return true;
		}

		/**
		 * Checks whether or not this is before `is is beforeBeforeCallOfSuper(=isInConstructorOfDerivedClass() &&
				!isEverySegmentCalled("8)
			);
		}

		/**
		 * Sets a given node as invalid.
		a#Gset as invalid. This is one of
		 *      a ThisExpression and a Super.
#" */
		function setInvalid(node) {
.2I.&p.segInfoMap[segment.id].inZ,G}
			}
		}

		/**
		 * Sets the current segment as `super` was called.
#" */
		function setSuperCalled() {
.2I.&p.5segInfoMap[segment.id].superCalled = true;
				}
			}3Adds information of a constructor into the stack.
	ao!O_a
							classNode.superClass &&
							!astUtils.isNullOrUndefined(classNode.superClass),
						)A7lNRemoves the top of stack item.
			 *
			 * And this traverses all segments of this code path then reports every
			 * invalid node.
	ao/)$
) {
				const isDerivedClasB				if (!isDerivedClasp**
				 * A collection of nodes to avoid duplicate reports.
				 * @type {Set<ASTNode>}
				 */
				const reported = new Set(); 

				codePath.traverseSegments($ .%					const invalidNodes = info.invalidNodes.filter(
						/*
						 * Avoid duplicate reports.
						 * When there is a `finally`, invalidNodes may contain already reported node.
						 */
						node => !reported.has(node),
					);

					for (const inval<idNode of invalidNodes) {
						reported.add(invalidNode);

(messageId: "noBeforeSuper",
							node: invalidNode,
							data: {
								kind:
									invalidNode.type === "Super"
						[				? "super"
										: "this",
							},
						});
					}

					if (info.superCalled) {
h%}
				}(GK$3!/{
isInConstructorOfDerivedClass()q.segInfoMap[segment.id] = {
					superCalled:
	A
 &&
	A&),
					invalidNodes: [],
				}"(9!gisInConstructorOfDerivedClass()q&Update information inside of the loop.$P
							segInfoMap[segment.id] ?? new SegmentInfo();

						if (info.superCalledc%$} else if (
		A
 &&
		A&Y)
						) {
							info.superCalled = true;
						}

						segInfoMap[segment.id] = info;($Reports if this is before(*targe(LThisExpression(node) {
				if (isBeforeCallOfSuper()) {
					setInvalid(node*Reports if this is before(*targe(_Super(node) {
				if (!astUtils.isCallee(node) && isBeforeCallOfSuper()) {
					setInvalid(node*Marks `super()` called.
			atarge(!)&)<=== "Super" && isBeforeCallOfSuper()) {
					setSuperCalled(*Resets statA#"Program:exit"() {
				"			},
		};
	},
};
?7JxS/**
 * @fileoverview Rule to restrict what can be thrown as an exception.
 * @author Dieter Oberkofler
 */

"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow throwing literals as exceptions",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-throw-literal",
		},

		schema: [],

		messages: {
			object: "Expected an error object to be thrown.",
			undef: "Do not throw undefined.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		return {
			ThrowStatement(node) {
				if (!astUtils.couldBeError(node.argument)) {
					context.report({ node, messageId: "object" });
				} else if (node.argument.type === "Identifier") {
					if (
						node.argument.name === "undefined" &&
						sourceCode.isGlobalReference(node.argument)
					) {
						context.report({ node, messageId: "undef" });
					}
				}
			},
		};
	},
};
-^x!/**
 * @fileoverview Disallow trailing spaces at the end of lines.
 * @author Nodeca Team <https://github.com/nodeca>
 * @deprecated in ESLint v8.53.0
 */
"use strict";

//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------

/**
 * @import { SourceLocation, SourceRange } from "@eslint/core";
 */

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "no-trailing-spaces",
						url: "https://eslint.style/rules/no-trailing-spaces",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Disallow trailing whitespace at the end of lines",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-trailing-spaces",
		},

		fixable: "whitespace",

		schema: [
			{
				type: "object",
				properties: {
					skipBlankLines: {
						type: "boolean",
						default: false,
					},
					ignoreComments: {
						type: "boolean",
						default: false,
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			trailingSpace: "Trailing spaces not allowed.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		const BLANK_CLASS =
				"[ \t\u00a0\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u200b\u3000]",
			SKIP_BLANK = `^${BLANK_CLASS}*$`,
			NONBLANK = `${BLANK_CLASS}+$`;

		const options = context.options[0] || {},
			skipBlankLines = options.skipBlankLines || false,
			ignoreComments = options.ignoreComments || false;

		/**
		 * Report the error message
		 * @param {ASTNode} node node to report
		 * @param {SourceLocation} location range information
		 * @param {SourceRange} fixRange Range based on the whole program
		 * @returns {void}
		 */
		function report(node, location, fixRange) {
			/*
			 * Passing node is a bit dirty, because message data will contain big
			 * text in `source`. But... who cares :) ?
			 * One more kludge will not make worse the bloody wizardry of this
			 * plugin.
			 */
			context.report({
				node,
				loc: location,
				messageId: "trailingSpace",
				fix(fixer) {
					return fixer.removeRange(fixRange);
				},
			});
		}

		/**
		 * Given a list of comment nodes, return the line numbers for those comments.
		 * @param {Array} comments An array of comment nodes.
		 * @returns {number[]} An array of line numbers containing comments.
		 */
		function getCommentLineNumbers(comments) {
			const lines = new Set();

			comments.forEach(comment => {
				const endLine =
					comment.type === "Block"
						? comment.loc.end.line - 1
						: comment.loc.end.line;

				for (let i = comment.loc.start.line; i <= endLine; i++) {
					lines.add(i);
				}
			});

			return lines;
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			Program: function checkTrailingSpaces(node) {
				/*
				 * Let's hack. Since Espree does not return whitespace nodes,
				 * fetch the source code and do matching via regexps.
				 */

				const re = new RegExp(NONBLANK, "u"),
					skipMatch = new RegExp(SKIP_BLANK, "u"),
					lines = sourceCode.lines,
					linebreaks = sourceCode
						.getText()
						.match(astUtils.createGlobalLinebreakMatcher()),
					comments = sourceCode.getAllComments(),
					commentLineNumbers = getCommentLineNumbers(comments);

				let totalLength = 0;

				for (let i = 0, ii = lines.length; i < ii; i++) {
					const lineNumber = i + 1;

					/*
					 * Always add linebreak length to line length to accommodate for line break (\n or \r\n)
					 * Because during the fix time they also reserve one spot in the array.
					 * Usually linebreak length is 2 for \r\n (CRLF) and 1 for \n (LF)
					 */
					const linebreakLength =
						linebreaks && linebreaks[i] ? linebreaks[i].length : 1;
					const lineLength = lines[i].length + linebreakLength;

					const matches = re.exec(lines[i]);

					if (matches) {
						const location = {
							start: {
								line: lineNumber,
								column: matches.index,
							},
							end: {
								line: lineNumber,
								column: lineLength - linebreakLength,
							},
						};

						const rangeStart = totalLength + location.start.column;
						const rangeEnd = totalLength + location.end.column;
						const containingNode =
							sourceCode.getNodeByRangeIndex(rangeStart);

						if (
							containingNode &&
							containingNode.type === "TemplateElement" &&
							rangeStart > containingNode.parent.range[0] &&
							rangeEnd < containingNode.parent.range[1]
						) {
							totalLength += lineLength;
							continue;
						}

						/*
						 * If the line has only whitespace, and skipBlankLines
						 * is true, don't report it
						 */
						if (skipBlankLines && skipMatch.test(lines[i])) {
							totalLength += lineLength;
							continue;
						}

						const fixRange = [rangeStart, rangeEnd];

						if (
							!ignoreComments ||
							!commentLineNumbers.has(lineNumber)
						) {
							report(node, location, fixRange);
						}
					}

					totalLength += lineLength;
				}
			},
		};
	},
};
pÕyxm/**
 * @fileoverview Rule to flag variables that are never assigned
 * @author Jacob Bandes-Storch <https://github.com/jtbandes>
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description:
				"Disallow `let` or `var` variables that are read but never assigned",
			dialects: ["JavaScript", "TypeScript"],
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-unassigned-vars",
		},

		schema: [],
		messages: {
			unassigned:
				"'{{name}}' is always 'undefined' because it's never assigned.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		let insideDeclareModule = false;

		return {
			"TSModuleDeclaration[declare=true]"() {
				insideDeclareModule = true;
			},
			"TSModuleDeclaration[declare=true]:exit"() {
				insideDeclareModule = false;
			},
			VariableDeclarator(node) {
				/** @type {import('estree').VariableDeclaration} */
				const declaration = node.parent;
				const shouldSkip =
					node.init ||
					node.id.type !== "Identifier" ||
					declaration.kind === "const" ||
					declaration.declare ||
					insideDeclareModule;
				if (shouldSkip) {
					return;
				}
				const [variable] = sourceCode.getDeclaredVariables(node);
				if (!variable) {
					return;
				}
				let hasRead = false;
				for (const reference of variable.references) {
					if (reference.isWrite()) {
						return;
					}
					if (reference.isRead()) {
						hasRead = true;
					}
				}
				if (!hasRead) {
					// Variables that are never read should be flagged by no-unused-vars instead
					return;
				}
				context.report({
					node,
					messageId: "unassigned",
					data: { name: node.id.name },
				});
			},
		};
	},
};
]9xi	/**
 * @fileoverview Rule to flag when initializing to undefined
 * @author Ilya Volodin
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const CONSTANT_BINDINGS = new Set(["const", "using", "await using"]);

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow initializing variables to `undefined`",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/no-undef-init",
		},

		schema: [],
		fixable: "code",

		messages: {
			unnecessaryUndefinedInit:
				"It's not necessary to initialize '{{name}}' to undefined.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		return {
			VariableDeclarator(node) {
				const name = sourceCode.getText(node.id),
					init = node.init && node.init.name,
					scope = sourceCode.getScope(node),
					undefinedVar = astUtils.getVariableByName(
						scope,
						"undefined",
					),
					shadowed = undefinedVar && undefinedVar.defs.length > 0,
					lastToken = sourceCode.getLastToken(node);

				if (
					init === "undefined" &&
					!CONSTANT_BINDINGS.has(node.parent.kind) &&
					!shadowed
				) {
					context.report({
						node,
						messageId: "unnecessaryUndefinedInit",
						data: { name },
						fix(fixer) {
							if (node.parent.kind === "var") {
								return null;
							}

							if (
								node.id.type === "ArrayPattern" ||
								node.id.type === "ObjectPattern"
							) {
								// Don't fix destructuring assignment to `undefined`.
								return null;
							}

							if (
								sourceCode.commentsExistBetween(
									node.id,
									lastToken,
								)
							) {
								return null;
							}

							return fixer.removeRange([
								node.id.range[1],
								node.range[1],
							]);
						},
					});
				}
			},
		};
	},
};
wkvxk/**
 * @fileoverview Rule to flag references to undeclared variables.
 * @author Mark Macdonald
 */
"use strict";

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Checks if the given node is the argument of a typeof operator.
 * @param {ASTNode} node The AST node being checked.
 * @returns {boolean} Whether or not the node is the argument of a typeof operator.
 */
function hasTypeOfOperator(node) {
	const parent = node.parent;

	return parent.type === "UnaryExpression" && parent.operator === "typeof";
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		defaultOptions: [
			{
				typeof: false,
			},
		],

		docs: {
			description:
				"Disallow the use of undeclared variables unless mentioned in `/*global */` comments",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-undef",
		},

		schema: [
			{
				type: "object",
				properties: {
					typeof: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],
		messages: {
			undef: "'{{name}}' is not defined.",
		},
	},

	create(context) {
		const [{ typeof: considerTypeOf }] = context.options;
		const sourceCode = context.sourceCode;

		return {
			"Program:exit"(node) {
				const globalScope = sourceCode.getScope(node);

				globalScope.through.forEach(ref => {
					const identifier = ref.identifier;

					if (!considerTypeOf && hasTypeOfOperator(identifier)) {
						return;
					}

					context.report({
						node: identifier,
						messageId: "undef",
						data: identifier,
					});
				});
			},
		};
	},
};
w3x/**
 * @fileoverview Rule to flag references to the undefined variable.
 * @author Michael Ficarra
 */
"use strict";

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @typedef {import("eslint-scope").Scope} Scope */

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow the use of `undefined` as an identifier",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/no-undefined",
		},

		schema: [],

		messages: {
			unexpectedUndefined: "Unexpected use of undefined.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		/**
		 * Report an invalid "undefined" identifier node.
		 * @param {ASTNode} node The node to report.
		 * @returns {void}
		 */
		function report(node) {
			context.report({
				node,
				messageId: "unexpectedUndefined",
			});
		}

		/**
		 * Checks the given scope for references to `undefined` and reports
		 * all references found.
		 * @param {Scope} scope The scope to check.
		 * @returns {void}
		 */
		function checkScope(scope) {
			const undefinedVar = scope.set.get("undefined");

			if (!undefinedVar) {
				return;
			}

			const references = undefinedVar.references;

			const defs = undefinedVar.defs;

			// Report non-initializing references (those are covered in defs below)
			references
				.filter(ref => !ref.init)
				.forEach(ref => report(ref.identifier));

			defs.forEach(def => report(def.name));
		}

		return {
			"Program:exit"(node) {
				const globalScope = sourceCode.getScope(node);

				const stack = [globalScope];

				while (stack.length) {
					const scope = stack.pop();

					stack.push(...scope.childScopes);
					checkScope(scope);
				}
			},
		};
	},
};
bY[x?%/**
 * @fileoverview Rule to flag dangling underscores in variable declarations.
 * @author Matt DuVall <http://www.mattduvall.com>
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				allow: [],
				allowAfterSuper: false,
				allowAfterThis: false,
				allowAfterThisConstructor: false,
				allowFunctionParams: true,
				allowInArrayDestructuring: true,
				allowInObjectDestructuring: true,
				enforceInClassFields: false,
				enforceInMethodNames: false,
			},
		],

		docs: {
			description: "Disallow dangling underscores in identifiers",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/no-underscore-dangle",
		},

		schema: [
			{
				type: "object",
				properties: {
					allow: {
						type: "array",
						items: {
							type: "string",
						},
					},
					allowAfterThis: {
						type: "boolean",
					},
					allowAfterSuper: {
						type: "boolean",
					},
					allowAfterThisConstructor: {
						type: "boolean",
					},
					enforceInMethodNames: {
						type: "boolean",
					},
					allowFunctionParams: {
						type: "boolean",
					},
					enforceInClassFields: {
						type: "boolean",
					},
					allowInArrayDestructuring: {
						type: "boolean",
					},
					allowInObjectDestructuring: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			unexpectedUnderscore:
				"Unexpected dangling '_' in '{{identifier}}'.",
		},
	},

	create(context) {
		const [
			{
				allow,
				allowAfterSuper,
				allowAfterThis,
				allowAfterThisConstructor,
				allowFunctionParams,
				allowInArrayDestructuring,
				allowInObjectDestructuring,
				enforceInClassFields,
				enforceInMethodNames,
			},
		] = context.options;
		const sourceCode = context.sourceCode;

		//-------------------------------------------------------------------------
		// Helpers
		//-------------------------------------------------------------------------

		/**
		 * Check if identifier is present inside the allowed option
		 * @param {string} identifier name of the node
		 * @returns {boolean} true if its is present
		 * @private
		 */
		function isAllowed(identifier) {
			return allow.includes(identifier);
		}

		/**
		 * Check if identifier has a dangling underscore
		 * @param {string} identifier name of the node
		 * @returns {boolean} true if its is present
		 * @private
		 */
		function hasDanglingUnderscore(identifier) {
			const len = identifier.length;

			return (
				identifier !== "_" &&
				(identifier[0] === "_" || identifier[len - 1] === "_")
			);
		}

		/**
		 * Check if identifier is a special case member expression
		 * @param {string} identifier name of the node
		 * @returns {boolean} true if its is a special case
		 * @private
		 */
		function isSpecialCaseIdentifierForMemberExpression(identifier) {
			return identifier === "__proto__";
		}

		/**
		 * Check if identifier is a special case variable expression
		 * @param {string} identifier name of the node
		 * @returns {boolean} true if its is a special case
		 * @private
		 */
		function isSpecialCaseIdentifierInVariableExpression(identifier) {
			// Checks for the underscore library usage here
			return identifier === "_";
		}

		/**
		 * Check if a node is a member reference of this.constructor
		 * @param {ASTNode} node node to evaluate
		 * @returns {boolean} true if it is a reference on this.constructor
		 * @private
		 */
		function isThisConstructorReference(node) {
			return (
				node.object.type === "MemberExpression" &&
				node.object.property.name === "constructor" &&
				node.object.object.type === "ThisExpression"
			);
		}

		/**
		 * Check if function parameter has a dangling underscore.
		 * @param {ASTNode} node function node to evaluate
		 * @returns {void}
		 * @private
		 */
		function checkForDanglingUnderscoreInFunctionParameters(node) {
			if (!allowFunctionParams) {
				node.params.forEach(param => {
					const { type } = param;
					let nodeToCheck;

					if (type === "RestElement") {
						nodeToCheck = param.argument;
					} else if (type === "AssignmentPattern") {
						nodeToCheck = param.left;
					} else {
						nodeToCheck = param;
					}

					if (nodeToCheck.type === "Identifier") {
						const identifier = nodeToCheck.name;

						if (
							hasDanglingUnderscore(identifier) &&
							!isAllowed(identifier)
						) {
							context.report({
								node: param,
								messageId: "unexpectedUnderscore",
								data: {
									identifier,
								},
							});
						}
					}
				});
			}
		}

		/**
		 * Check if function has a dangling underscore
		 * @param {ASTNode} node node to evaluate
		 * @returns {void}
		 * @private
		 */
		function checkForDanglingUnderscoreInFunction(node) {
			if (node.type === "FunctionDeclaration" && node.id) {
				const identifier = node.id.name;

				if (
					typeof identifier !== "undefined" &&
					hasDanglingUnderscore(identifier) &&
					!isAllowed(identifier)
				) {
					context.report({
						node,
						messageId: "unexpectedUnderscore",
						data: {
							identifier,
						},
					});
				}
			}
			checkForDanglingUnderscoreInFunctionParameters(node);
		}

		/**
		 * Check if variable expression has a dangling underscore
		 * @param {ASTNode} node node to evaluate
		 * @returns {void}
		 * @private
		 */
		function checkForDanglingUnderscoreInVariableExpression(node) {
			sourceCode.getDeclaredVariables(node).forEach(variable => {
				const definition = variable.defs.find(def => def.node === node);
				const identifierNode = definition.name;
				const identifier = identifierNode.name;
				let parent = identifierNode.parent;

				while (
					![
						"VariableDeclarator",
						"ArrayPattern",
						"ObjectPattern",
					].includes(parent.type)
				) {
					parent = parent.parent;
				}

				if (
					hasDanglingUnderscore(identifier) &&
					!isSpecialCaseIdentifierInVariableExpression(identifier) &&
					!isAllowed(identifier) &&
					!(
						allowInArrayDestructuring &&
						parent.type === "ArrayPattern"
					) &&
					!(
						allowInObjectDestructuring &&
						parent.type === "ObjectPattern"
					)
				) {
					context.report({
						node,
						messageId: "unexpectedUnderscore",
						data: {
							identifier,
						},
					});
				}
			});
		}

		/**
		 * Check if member expression has a dangling underscore
		 * @param {ASTNode} node node to evaluate
		 * @returns {void}
		 * @private
		 */
		function checkForDanglingUnderscoreInMemberExpression(node) {
			const identifier = node.property.name,
				isMemberOfThis = node.object.type === "ThisExpression",
				isMemberOfSuper = node.object.type === "Super",
				isMemberOfThisConstructor = isThisConstructorReference(node);

			if (
				typeof identifier !== "undefined" &&
				hasDanglingUnderscore(identifier) &&
				!(isMemberOfThis && allowAfterThis) &&
				!(isMemberOfSuper && allowAfterSuper) &&
				!(isMemberOfThisConstructor && allowAfterThisConstructor) &&
				!isSpecialCaseIdentifierForMemberExpression(identifier) &&
				!isAllowed(identifier)
			) {
				context.report({
					node,
					messageId: "unexpectedUnderscore",
					data: {
						identifier,
					},
				});
			}
		}

		/**
		 * Check if method declaration or method property has a dangling underscore
		 * @param {ASTNode} node node to evaluate
		 * @returns {void}
		 * @private
		 */
		function checkForDanglingUnderscoreInMethod(node) {
			const identifier = node.key.name;
			const isMethod =
				node.type === "MethodDefinition" ||
				(node.type === "Property" && node.method);

			if (
				typeof identifier !== "undefined" &&
				enforceInMethodNames &&
				isMethod &&
				hasDanglingUnderscore(identifier) &&
				!isAllowed(identifier)
			) {
				context.report({
					node,
					messageId: "unexpectedUnderscore",
					data: {
						identifier:
							node.key.type === "PrivateIdentifier"
								? `#${identifier}`
								: identifier,
					},
				});
			}
		}

		/**
		 * Check if a class field has a dangling underscore
		 * @param {ASTNode} node node to evaluate
		 * @returns {void}
		 * @private
		 */
		function checkForDanglingUnderscoreInClassField(node) {
			const identifier = node.key.name;

			if (
				typeof identifier !== "undefined" &&
				hasDanglingUnderscore(identifier) &&
				enforceInClassFields &&
				!isAllowed(identifier)
			) {
				context.report({
					node,
					messageId: "unexpectedUnderscore",
					data: {
						identifier:
							node.key.type === "PrivateIdentifier"
								? `#${identifier}`
								: identifier,
					},
				});
			}
		}

		//--------------------------------------------------------------------------
		// Public API
		//--------------------------------------------------------------------------

		return {
			FunctionDeclaration: checkForDanglingUnderscoreInFunction,
			VariableDeclarator: checkForDanglingUnderscoreInVariableExpression,
			MemberExpression: checkForDanglingUnderscoreInMemberExpression,
			MethodDefinition: checkForDanglingUnderscoreInMethod,
			PropertyDefinition: checkForDanglingUnderscoreInClassField,
			Property: checkForDanglingUnderscoreInMethod,
			FunctionExpression: checkForDanglingUnderscoreInFunction,
			ArrowFunctionExpression: checkForDanglingUnderscoreInFunction,
		};
	},
};
/{xj/**
 * @fileoverview Rule to spot scenarios where a newline looks like it is ending a statement, but is not.
 * @author Glen Mailer
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description: "Disallow confusing multiline expressions",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-unexpected-multiline",
		},

		schema: [],
		messages: {
			function:
				"Unexpected newline between function and ( of function call.",
			property:
				"Unexpected newline between object and [ of property access.",
			taggedTemplate:
				"Unexpected newline between template tag and template literal.",
			division:
				"Unexpected newline between numerator and division operator.",
		},
	},

	create(context) {
		const REGEX_FLAG_MATCHER = /^[gimsuy]+$/u;

		const sourceCode = context.sourceCode;

		/**
		 * Check to see if there is a newline between the node and the following open bracket
		 * line's expression
		 * @param {ASTNode} node The node to check.
		 * @param {string} messageId The error messageId to use.
		 * @returns {void}
		 * @private
		 */
		function checkForBreakAfter(node, messageId) {
			const openParen = sourceCode.getTokenAfter(
				node,
				astUtils.isNotClosingParenToken,
			);
			const nodeExpressionEnd = sourceCode.getTokenBefore(openParen);

			if (openParen.loc.start.line !== nodeExpressionEnd.loc.end.line) {
				context.report({
					node,
					loc: openParen.loc,
					messageId,
				});
			}
		}

		//--------------------------------------------------------------------------
		// Public API
		//--------------------------------------------------------------------------

		return {
			MemberExpression(node) {
				if (!node.computed || node.optional) {
					return;
				}
				checkForBreakAfter(node.object, "property");
			},

			TaggedTemplateExpression(node) {
				const { quasi } = node;

				// handles common tags, parenthesized tags, and typescript's generic type arguments
				const tokenBefore = sourceCode.getTokenBefore(quasi);

				if (tokenBefore.loc.end.line !== quasi.loc.start.line) {
					context.report({
						node,
						loc: {
							start: quasi.loc.start,
							end: {
								line: quasi.loc.start.line,
								column: quasi.loc.start.column + 1,
							},
						},
						messageId: "taggedTemplate",
					});
				}
			},

			CallExpression(node) {
				if (node.arguments.length === 0 || node.optional) {
					return;
				}
				checkForBreakAfter(node.callee, "function");
			},

			"BinaryExpression[operator='/'] > BinaryExpression[operator='/'].left"(
				node,
			) {
				const secondSlash = sourceCode.getTokenAfter(
					node,
					token => token.value === "/",
				);
				const tokenAfterOperator =
					sourceCode.getTokenAfter(secondSlash);

				if (
					tokenAfterOperator.type === "Identifier" &&
					REGEX_FLAG_MATCHER.test(tokenAfterOperator.value) &&
					secondSlash.range[1] === tokenAfterOperator.range[0]
				) {
					checkForBreakAfter(node.left, "division");
				}
			},
		};
	},
};
H򟳎x(/**
 * @fileoverview Rule to disallow use of unmodified expressions in loop conditions
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const Traverser = require("../shared/traverser"),
	astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @typedef {import("eslint-scope").Variable} Variable */
/** @typedef {import("eslint-scope").Reference} Reference */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const SENTINEL_PATTERN =
	/(?:(?:Call|Class|Function|Member|New|Yield)Expression|Statement|Declaration)$/u;
const LOOP_PATTERN = /^(?:DoWhile|For|While)Statement$/u; // for-in/of statements don't have `test` property.
const GROUP_PATTERN = /^(?:BinaryExpression|ConditionalExpression)$/u;
const SKIP_PATTERN = /^(?:ArrowFunction|Class|Function)Expression$/u;
const DYNAMIC_PATTERN = /^(?:Call|Member|New|TaggedTemplate|Yield)Expression$/u;

/**
 * @typedef {Object} LoopConditionInfo
 * @property {Reference} reference - The reference.
 * @property {ASTNode} group - BinaryExpression or ConditionalExpression nodes
 *      that the reference is belonging to.
 * @property {Function} isInLoop - The predicate which checks a given reference
 *      is in this loop.
 * @property {boolean} modified - The flag that the reference is modified in
 *      this loop.
 */

/**
 * Checks whether or not a given reference is a write reference.
 * @param {Reference} reference A reference to check.
 * @returns {boolean} `true` if the reference is a write reference.
 */
function isWriteReference(reference) {
	if (reference.init) {
		const def = reference.resolved && reference.resolved.defs[0];

		if (!def || def.type !== "Variable" || def.parent.kind !== "var") {
			return false;
		}
	}
	return reference.isWrite();
}

/**
 * Checks whether or not a given loop condition info does not have the modified
 * flag.
 * @param {LoopConditionInfo} condition A loop condition info to check.
 * @returns {boolean} `true` if the loop condition info is "unmodified".
 */
function isUnmodified(condition) {
	return !condition.modified;
}

/**
 * Checks whether or not a given loop condition info does not have the modified
 * flag and does not have the group this condition belongs to.
 * @param {LoopConditionInfo} condition A loop condition info to check.
 * @returns {boolean} `true` if the loop condition info is "unmodified".
 */
function isUnmodifiedAndNotBelongToGroup(condition) {
	return !(condition.modified || condition.group);
}

/**
 * Checks whether or not a given reference is inside of a given node.
 * @param {ASTNode} node A node to check.
 * @param {Reference} reference A reference to check.
 * @returns {boolean} `true` if the reference is inside of the node.
 */
function isInRange(node, reference) {
	const or = node.range;
	const ir = reference.identifier.range;

	return or[0] <= ir[0] && ir[1] <= or[1];
}

/**
 * Checks whether or not a given reference is inside of a loop node's condition.
 * @param {ASTNode} node A node to check.
 * @param {Reference} reference A reference to check.
 * @returns {boolean} `true` if the reference is inside of the loop node's
 *      condition.
 */
const isInLoop = {
	WhileStatement: isInRange,
	DoWhileStatement: isInRange,
	ForStatement(node, reference) {
		return (
			isInRange(node, reference) &&
			!(node.init && isInRange(node.init, reference))
		);
	},
};

/**
 * Gets the function which encloses a given reference.
 * This supports only FunctionDeclaration.
 * @param {Reference} reference A reference to get.
 * @returns {ASTNode|null} The function node or null.
 */
function getEncloseFunctionDeclaration(reference) {
	let node = reference.identifier;

	while (node) {
		if (node.type === "FunctionDeclaration") {
			return node.id ? node : null;
		}

		node = node.parent;
	}

	return null;
}

/**
 * Checks whether a given modifier is in a loop.
 *
 * Besides checking for the condition being in the loop, this also checks
 * whether the function that this modifier is belonging to is called
 * in the loop.
 * @param {LoopConditionInfo} condition The condition to check.
 * @param {Reference} modifier The modifier to check.
 * @returns {boolean} `true` if the modifier is in a loop.
 */
function hasModifierInLoop(condition, modifier) {
	if (condition.isInLoop(modifier)) {
		return true;
	}

	const funcNode = getEncloseFunctionDeclaration(modifier);

	if (!funcNode) {
		return false;
	}

	const funcVar = astUtils.getVariableByName(
		modifier.from.upper,
		funcNode.id.name,
	);

	return Boolean(funcVar && funcVar.references.some(condition.isInLoop));
}

/**
 * Updates the "modified" flags of given loop conditions with given modifiers.
 * @param {LoopConditionInfo[]} conditions The loop conditions to be updated.
 * @param {Reference[]} modifiers The references to update.
 * @returns {void}
 */
function updateModifiedFlag(conditions, modifiers) {
	for (let i = 0; i < conditions.length; ++i) {
		const condition = conditions[i];

		for (let j = 0; !condition.modified && j < modifiers.length; ++j) {
			const modifier = modifiers[j];

			condition.modified = hasModifierInLoop(condition, modifier);
		}
	}
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description: "Disallow unmodified loop conditions",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-unmodified-loop-condition",
		},

		schema: [],

		messages: {
			loopConditionNotModified:
				"'{{name}}' is not modified in this loop.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		let groupMap = null;

		/**
		 * Reports a given condition info.
		 * @param {LoopConditionInfo} condition A loop condition info to report.
		 * @returns {void}
		 */
		function report(condition) {
			const node = condition.reference.identifier;

			context.report({
				node,
				messageId: "loopConditionNotModified",
				data: node,
			});
		}

		/**
		 * Registers given conditions to the group the condition belongs to.
		 * @param {LoopConditionInfo[]} conditions A loop condition info to
		 *      register.
		 * @returns {void}
		 */
		function registerConditionsToGroup(conditions) {
			for (let i = 0; i < conditions.length; ++i) {
				const condition = conditions[i];

				if (condition.group) {
					let group = groupMap.get(condition.group);

					if (!group) {
						group = [];
						groupMap.set(condition.group, group);
					}
					group.push(condition);
				}
			}
		}

		/**
		 * Reports references which are inside of unmodified groups.
		 * @param {LoopConditionInfo[]} conditions A loop condition info to report.
		 * @returns {void}
		 */
		function checkConditionsInGroup(conditions) {
			if (conditions.every(isUnmodified)) {
				conditions.forEach(report);
			}
		}

		/**
		 * Checks whether or not a given group node has any dynamic elements.
		 * @param {ASTNode} root A node to check.
		 *      This node is one of BinaryExpression or ConditionalExpression.
		 * @returns {boolean} `true` if the node is dynamic.
		 */
		function hasDynamicExpressions(root) {
			let retv = false;

			Traverser.traverse(root, {
				visitorKeys: sourceCode.visitorKeys,
				enter(node) {
					if (DYNAMIC_PATTERN.test(node.type)) {
						retv = true;
						this.break();
					} else if (SKIP_PATTERN.test(node.type)) {
						this.skip();
					}
				},
			});

			return retv;
		}

		/**
		 * Creates the loop condition information from a given reference.
		 * @param {Reference} reference A reference to create.
		 * @returns {LoopConditionInfo|null} Created loop condition info, or null.
		 */
		function toLoopCondition(reference) {
			if (reference.init) {
				return null;
			}

			let group = null;
			let child = reference.identifier;
			let node = child.parent;

			while (node) {
				if (SENTINEL_PATTERN.test(node.type)) {
					if (LOOP_PATTERN.test(node.type) && node.test === child) {
						// This reference is inside of a loop condition.
						return {
							reference,
							group,
							isInLoop: isInLoop[node.type].bind(null, node),
							modified: false,
						};
					}

					// This reference is outside of a loop condition.
					break;
				}

				/*
				 * If it's inside of a group, OK if either operand is modified.
				 * So stores the group this reference belongs to.
				 */
				if (GROUP_PATTERN.test(node.type)) {
					// If this expression is dynamic, no need to check.
					if (hasDynamicExpressions(node)) {
						break;
					} else {
						group = node;
					}
				}

				child = node;
				node = node.parent;
			}

			return null;
		}

		/**
		 * Finds unmodified references which are inside of a loop condition.
		 * Then reports the references which are outside of groups.
		 * @param {Variable} variable A variable to report.
		 * @returns {void}
		 */
		function checkReferences(variable) {
			// Gets references that exist in loop conditions.
			const conditions = variable.references
				.map(toLoopCondition)
				.filter(Boolean);

			if (conditions.length === 0) {
				return;
			}

			// Registers the conditions to belonging groups.
			registerConditionsToGroup(conditions);

			// Check the conditions are modified.
			const modifiers = variable.references.filter(isWriteReference);

			if (modifiers.length > 0) {
				updateModifiedFlag(conditions, modifiers);
			}

			/*
			 * Reports the conditions which are not belonging to groups.
			 * Others will be reported after all variables are done.
			 */
			conditions.filter(isUnmodifiedAndNotBelongToGroup).forEach(report);
		}

		return {
			"Program:exit"(node) {
				const queue = [sourceCode.getScope(node)];

				groupMap = new Map();

				let scope;

				while ((scope = queue.pop())) {
					queue.push(...scope.childScopes);
					scope.variables.forEach(checkReferences);
				}

				groupMap.forEach(checkConditionsInGroup);
				groupMap = null;
			},
		};
	},
};
!rx//**
 * @fileoverview Rule to flag no-unneeded-ternary
 * @author Gyandeep Singh
 */

"use strict";

const astUtils = require("./utils/ast-utils");

// Operators that always result in a boolean value
const BOOLEAN_OPERATORS = new Set([
	"==",
	"===",
	"!=",
	"!==",
	">",
	">=",
	"<",
	"<=",
	"in",
	"instanceof",
]);
const OPERATOR_INVERSES = {
	"==": "!=",
	"!=": "==",
	"===": "!==",
	"!==": "===",

	// Operators like < and >= are not true inverses, since both will return false with NaN.
};
const OR_PRECEDENCE = astUtils.getPrecedence({
	type: "LogicalExpression",
	operator: "||",
});

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [{ defaultAssignment: true }],

		docs: {
			description:
				"Disallow ternary operators when simpler alternatives exist",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/no-unneeded-ternary",
		},

		schema: [
			{
				type: "object",
				properties: {
					defaultAssignment: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		fixable: "code",

		messages: {
			unnecessaryConditionalExpression:
				"Unnecessary use of boolean literals in conditional expression.",
			unnecessaryConditionalAssignment:
				"Unnecessary use of conditional expression for default assignment.",
		},
	},

	create(context) {
		const [{ defaultAssignment }] = context.options;
		const sourceCode = context.sourceCode;

		/**
		 * Test if the node is a boolean literal
		 * @param {ASTNode} node The node to report.
		 * @returns {boolean} True if the its a boolean literal
		 * @private
		 */
		function isBooleanLiteral(node) {
			return node.type === "Literal" && typeof node.value === "boolean";
		}

		/**
		 * Creates an expression that represents the boolean inverse of the expression represented by the original node
		 * @param {ASTNode} node A node representing an expression
		 * @returns {string} A string representing an inverted expression
		 */
		function invertExpression(node) {
			if (
				node.type === "BinaryExpression" &&
				Object.hasOwn(OPERATOR_INVERSES, node.operator)
			) {
				const operatorToken = sourceCode.getFirstTokenBetween(
					node.left,
					node.right,
					token => token.value === node.operator,
				);
				const text = sourceCode.getText();

				return (
					text.slice(node.range[0], operatorToken.range[0]) +
					OPERATOR_INVERSES[node.operator] +
					text.slice(operatorToken.range[1], node.range[1])
				);
			}

			if (
				astUtils.getPrecedence(node) <
				astUtils.getPrecedence({ type: "UnaryExpression" })
			) {
				return `!(${astUtils.getParenthesisedText(sourceCode, node)})`;
			}
			return `!${astUtils.getParenthesisedText(sourceCode, node)}`;
		}

		/**
		 * Tests if a given node always evaluates to a boolean value
		 * @param {ASTNode} node An expression node
		 * @returns {boolean} True if it is determined that the node will always evaluate to a boolean value
		 */
		function isBooleanExpression(node) {
			return (
				(node.type === "BinaryExpression" &&
					BOOLEAN_OPERATORS.has(node.operator)) ||
				(node.type === "UnaryExpression" && node.operator === "!")
			);
		}

		/**
		 * Test if the node matches the pattern id ? id : expression
		 * @param {ASTNode} node The ConditionalExpression to check.
		 * @returns {boolean} True if the pattern is matched, and false otherwise
		 * @private
		 */
		function matchesDefaultAssignment(node) {
			return (
				node.test.type === "Identifier" &&
				node.consequent.type === "Identifier" &&
				node.test.name === node.consequent.name
			);
		}

		return {
			ConditionalExpression(node) {
				if (
					isBooleanLiteral(node.alternate) &&
					isBooleanLiteral(node.consequent)
				) {
					context.report({
						node,
						messageId: "unnecessaryConditionalExpression",
						fix(fixer) {
							if (
								node.consequent.value === node.alternate.value
							) {
								// Replace `foo ? true : true` with just `true`, but don't replace `foo() ? true : true`
								return node.test.type === "Identifier"
									? fixer.replaceText(
											node,
											node.consequent.value.toString(),
										)
									: null;
							}
							if (node.alternate.value) {
								// Replace `foo() ? false : true` with `!(foo())`
								return fixer.replaceText(
									node,
									invertExpression(node.test),
								);
							}

							// Replace `foo ? true : false` with `foo` if `foo` is guaranteed to be a boolean, or `!!foo` otherwise.

							return fixer.replaceText(
								node,
								isBooleanExpression(node.test)
									? astUtils.getParenthesisedText(
											sourceCode,
											node.test,
										)
									: `!${invertExpression(node.test)}`,
							);
						},
					});
				} else if (
					!defaultAssignment &&
					matchesDefaultAssignment(node)
				) {
					context.report({
						node,
						messageId: "unnecessaryConditionalAssignment",
						fix(fixer) {
							const shouldParenthesizeAlternate =
								(astUtils.getPrecedence(node.alternate) <
									OR_PRECEDENCE ||
									astUtils.isCoalesceExpression(
										node.alternate,
									)) &&
								!astUtils.isParenthesised(
									sourceCode,
									node.alternate,
								);
							const alternateText = shouldParenthesizeAlternate
								? `(${sourceCode.getText(node.alternate)})`
								: astUtils.getParenthesisedText(
										sourceCode,
										node.alternate,
									);
							const testText = astUtils.getParenthesisedText(
								sourceCode,
								node.test,
							);

							return fixer.replaceText(
								node,
								`${testText} || ${alternateText}`,
							);
						},
					});
				}
			},
		};
	},
};
͸x/**
 * @fileoverview Rule to disallow loops with a body that allows only one iteration
 * @author Milos Djermanovic
 */

"use strict";

const { isAnySegmentReachable } = require("./utils/code-path-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const allLoopTypes = [
	"WhileStatement",
	"DoWhileStatement",
	"ForStatement",
	"ForInStatement",
	"ForOfStatement",
];

/**
 * Determines whether the given node is the first node in the code path to which a loop statement
 * 'loops' for the next iteration.
 * @param {ASTNode} node The node to check.
 * @returns {boolean} `true` if the node is a looping target.
 */
function isLoopingTarget(node) {
	const parent = node.parent;

	if (parent) {
		switch (parent.type) {
			case "WhileStatement":
				return node === parent.test;
			case "DoWhileStatement":
				return node === parent.body;
			case "ForStatement":
				return node === (parent.update || parent.test || parent.body);
			case "ForInStatement":
			case "ForOfStatement":
				return node === parent.left;

			// no default
		}
	}

	return false;
}

/**
 * Creates an array with elements from the first given array that are not included in the second given array.
 * @param {Array} arrA The array to compare from.
 * @param {Array} arrB The array to compare against.
 * @returns {Array} a new array that represents `arrA \ arrB`.
 */
function getDifference(arrA, arrB) {
	return arrA.filter(a => !arrB.includes(a));
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		defaultOptions: [{ ignore: [] }],

		docs: {
			description:
				"Disallow loops with a body that allows only one iteration",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-unreachable-loop",
		},

		schema: [
			{
				type: "object",
				properties: {
					ignore: {
						type: "array",
						items: {
							enum: allLoopTypes,
						},
						uniqueItems: true,
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			invalid: "Invalid loop. Its body allows only one iteration.",
		},
	},

	create(context) {
		const [{ ignore: ignoredLoopTypes }] = context.options;
		const loopTypesToCheck = getDifference(allLoopTypes, ignoredLoopTypes);
		const loopSelector = loopTypesToCheck.join(",");

		if (!loopSelector) {
			return {};
		}

		const loopsByTargetSegments = new Map();
		const loopsToReport = new Set();
		const codePathSegments = [];
		let currentCodePathSegments = new Set();

		return {
			onCodePathStart() {
				codePathSegments.push(currentCodePathSegments);
				currentCodePathSegments = new Set();
			},

			onCodePathEnd() {
				currentCodePathSegments = codePathSegments.pop();
			},

			onUnreachableCodePathSegmentStart(segment) {
				currentCodePathSegments.add(segment);
			},

			onUnreachableCodePathSegmentEnd(segment) {
				currentCodePathSegments.delete(segment);
			},

			onCodePathSegmentEnd(segment) {
				currentCodePathSegments.delete(segment);
			},

			onCodePathSegmentStart(segment, node) {
				currentCodePathSegments.add(segment);

				if (isLoopingTarget(node)) {
					const loop = node.parent;

					loopsByTargetSegments.set(segment, loop);
				}
			},

			onCodePathSegmentLoop(_, toSegment, node) {
				const loop = loopsByTargetSegments.get(toSegment);

				/**
				 * The second iteration is reachable, meaning that the loop is valid by the logic of this rule,
				 * only if there is at least one loop event with the appropriate target (which has been already
				 * determined in the `loopsByTargetSegments` map), raised from either:
				 *
				 * - the end of the loop's body (in which case `node === loop`)
				 * - a `continue` statement
				 *
				 * This condition skips loop events raised from `ForInStatement > .right` and `ForOfStatement > .right` nodes.
				 */
				if (node === loop || node.type === "ContinueStatement") {
					// Removes loop if it exists in the set. Otherwise, `Set#delete` has no effect and doesn't throw.
					loopsToReport.delete(loop);
				}
			},

			[loopSelector](node) {
				/**
				 * Ignore unreachable loop statements to avoid unnecessary complexity in the implementation, or false positives otherwise.
				 * For unreachable segments, the code path analysis does not raise events required for this implementation.
				 */
				if (isAnySegmentReachable(currentCodePathSegments)) {
					loopsToReport.add(node);
				}
			},

			"Program:exit"() {
				loopsToReport.forEach(node =>
					context.report({ node, messageId: "invalid" }),
				);
			},
		};
	},
};
߿x4/**
 * @fileoverview Checks for unreachable code due to return, throws, break, and continue.
 * @author Joel Feenstra
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const { isAnySegmentReachable } = require("./utils/code-path-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * @typedef {Object} ConstructorInfo
 * @property {ConstructorInfo | null} upper Info about the constructor that encloses this constructor.
 * @property {boolean} hasSuperCall The flag about having `super()` expressions.
 */

/**
 * Checks whether or not a given variable declarator has the initializer.
 * @param {ASTNode} node A VariableDeclarator node to check.
 * @returns {boolean} `true` if the node has the initializer.
 */
function isInitialized(node) {
	return Boolean(node.init);
}

/**
 * The class to distinguish consecutive unreachable statements.
 */
class ConsecutiveRange {
	constructor(sourceCode) {
		this.sourceCode = sourceCode;
		this.startNode = null;
		this.endNode = null;
	}

	/**
	 * The location object of this range.
	 * @type {Object}
	 */
	get location() {
		return {
			start: this.startNode.loc.start,
			end: this.endNode.loc.end,
		};
	}

	/**
	 * `true` if this range is empty.
	 * @type {boolean}
	 */
	get isEmpty() {
		return !(this.startNode && this.endNode);
	}

	/**
	 * Checks whether the given node is inside of this range.
	 * @param {ASTNode|Token} node The node to check.
	 * @returns {boolean} `true` if the node is inside of this range.
	 */
	contains(node) {
		return (
			node.range[0] >= this.startNode.range[0] &&
			node.range[1] <= this.endNode.range[1]
		);
	}

	/**
	 * Checks whether the given node is consecutive to this range.
	 * @param {ASTNode} node The node to check.
	 * @returns {boolean} `true` if the node is consecutive to this range.
	 */
	isConsecutive(node) {
		return this.contains(this.sourceCode.getTokenBefore(node));
	}

	/**
	 * Merges the given node to this range.
	 * @param {ASTNode} node The node to merge.
	 * @returns {void}
	 */
	merge(node) {
		this.endNode = node;
	}

	/**
	 * Resets this range by the given node or null.
	 * @param {ASTNode|null} node The node to reset, or null.
	 * @returns {void}
	 */
	reset(node) {
		this.startNode = this.endNode = node;
	}
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description:
				"Disallow unreachable code after `return`, `throw`, `continue`, and `break` statements",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-unreachable",
		},

		schema: [],

		messages: {
			unreachableCode: "Unreachable code.",
		},
	},

	create(context) {
		/** @type {ConstructorInfo | null} */
		let constructorInfo = null;

		/** @type {ConsecutiveRange} */
		const range = new ConsecutiveRange(context.sourceCode);

		/** @type {Array<Set<CodePathSegment>>} */
		const codePathSegments = [];

		/** @type {Set<CodePathSegment>} */
		let currentCodePathSegments = new Set();

		/**
		 * Reports a given node if it's unreachable.
		 * @param {ASTNode} node A statement node to report.
		 * @returns {void}
		 */
		function reportIfUnreachable(node) {
			let nextNode = null;

			if (
				node &&
				(node.type === "PropertyDefinition" ||
					!isAnySegmentReachable(currentCodePathSegments))
			) {
				// Store this statement to distinguish consecutive statements.
				if (range.isEmpty) {
					range.reset(node);
					return;
				}

				// Skip if this statement is inside of the current range.
				if (range.contains(node)) {
					return;
				}

				// Merge if this statement is consecutive to the current range.
				if (range.isConsecutive(node)) {
					range.merge(node);
					return;
				}

				nextNode = node;
			}

			/*
			 * Report the current range since this statement is reachable or is
			 * not consecutive to the current range.
			 */
			if (!range.isEmpty) {
				context.report({
					messageId: "unreachableCode",
					loc: range.location,
					node: range.startNode,
				});
			}

			// Update the current range.
			range.reset(nextNode);
		}

		return {
			// Manages the current code path.
			onCodePathStart() {
				codePathSegments.push(currentCodePathSegments);
				currentCodePathSegments = new Set();
			},

			onCodePathEnd() {
				currentCodePathSegments = codePathSegments.pop();
			},

			onUnreachableCodePathSegmentStart(segment) {
				currentCodePathSegments.add(segment);
			},

			onUnreachableCodePathSegmentEnd(segment) {
				currentCodePathSegments.delete(segment);
			},

			onCodePathSegmentEnd(segment) {
				currentCodePathSegments.delete(segment);
			},

			onCodePathSegmentStart(segment) {
				currentCodePathSegments.add(segment);
			},

			// Registers for all statement nodes (excludes FunctionDeclaration).
			BlockStatement: reportIfUnreachable,
			BreakStatement: reportIfUnreachable,
			ClassDeclaration: reportIfUnreachable,
			ContinueStatement: reportIfUnreachable,
			DebuggerStatement: reportIfUnreachable,
			DoWhileStatement: reportIfUnreachable,
			ExpressionStatement: reportIfUnreachable,
			ForInStatement: reportIfUnreachable,
			ForOfStatement: reportIfUnreachable,
			ForStatement: reportIfUnreachable,
			IfStatement: reportIfUnreachable,
			ImportDeclaration: reportIfUnreachable,
			LabeledStatement: reportIfUnreachable,
			ReturnStatement: reportIfUnreachable,
			SwitchStatement: reportIfUnreachable,
			ThrowStatement: reportIfUnreachable,
			TryStatement: reportIfUnreachable,

			VariableDeclaration(node) {
				if (
					node.kind !== "var" ||
					node.declarations.some(isInitialized)
				) {
					reportIfUnreachable(node);
				}
			},

			WhileStatement: reportIfUnreachable,
			WithStatement: reportIfUnreachable,
			ExportNamedDeclaration: reportIfUnreachable,
			ExportDefaultDeclaration: reportIfUnreachable,
			ExportAllDeclaration: reportIfUnreachable,

			"Program:exit"() {
				reportIfUnreachable();
			},

			/*
			 * Instance fields defined in a subclass are never created if the constructor of the subclass
			 * doesn't call `super()`, so their definitions are unreachable code.
			 */
			"MethodDefinition[kind='constructor']"() {
				constructorInfo = {
					upper: constructorInfo,
					hasSuperCall: false,
				};
			},
			"MethodDefinition[kind='constructor']:exit"(node) {
				const { hasSuperCall } = constructorInfo;

				constructorInfo = constructorInfo.upper;

				// skip typescript constructors without the body
				if (!node.value.body) {
					return;
				}

				const classDefinition = node.parent.parent;

				if (classDefinition.superClass && !hasSuperCall) {
					for (const element of classDefinition.body.body) {
						if (
							element.type === "PropertyDefinition" &&
							!element.static
						) {
							reportIfUnreachable(element);
						}
					}
				}
			},
			"CallExpression > Super.callee"() {
				if (constructorInfo) {
					constructorInfo.hasSuperCall = true;
				}
			},
		};
	},
};
x/**
 * @fileoverview Rule to flag unsafe statements in finally block
 * @author Onur Temizkan
 */

"use strict";

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const SENTINEL_NODE_TYPE_RETURN_THROW =
	/^(?:Program|(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression)$/u;
const SENTINEL_NODE_TYPE_BREAK =
	/^(?:Program|(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|DoWhileStatement|WhileStatement|ForOfStatement|ForInStatement|ForStatement|SwitchStatement)$/u;
const SENTINEL_NODE_TYPE_CONTINUE =
	/^(?:Program|(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|DoWhileStatement|WhileStatement|ForOfStatement|ForInStatement|ForStatement)$/u;

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description: "Disallow control flow statements in `finally` blocks",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-unsafe-finally",
		},

		schema: [],

		messages: {
			unsafeUsage: "Unsafe usage of {{nodeType}}.",
		},
	},
	create(context) {
		/**
		 * Checks if the node is the finalizer of a TryStatement
		 * @param {ASTNode} node node to check.
		 * @returns {boolean} - true if the node is the finalizer of a TryStatement
		 */
		function isFinallyBlock(node) {
			return (
				node.parent.type === "TryStatement" &&
				node.parent.finalizer === node
			);
		}

		/**
		 * Climbs up the tree if the node is not a sentinel node
		 * @param {ASTNode} node node to check.
		 * @param {string} label label of the break or continue statement
		 * @returns {boolean} - return whether the node is a finally block or a sentinel node
		 */
		function isInFinallyBlock(node, label) {
			let labelInside = false;
			let sentinelNodeType;

			if (node.type === "BreakStatement" && !node.label) {
				sentinelNodeType = SENTINEL_NODE_TYPE_BREAK;
			} else if (node.type === "ContinueStatement") {
				sentinelNodeType = SENTINEL_NODE_TYPE_CONTINUE;
			} else {
				sentinelNodeType = SENTINEL_NODE_TYPE_RETURN_THROW;
			}

			for (
				let currentNode = node;
				currentNode && !sentinelNodeType.test(currentNode.type);
				currentNode = currentNode.parent
			) {
				if (
					currentNode.parent.label &&
					label &&
					currentNode.parent.label.name === label.name
				) {
					labelInside = true;
				}
				if (isFinallyBlock(currentNode)) {
					if (label && labelInside) {
						return false;
					}
					return true;
				}
			}
			return false;
		}

		/**
		 * Checks whether the possibly-unsafe statement is inside a finally block.
		 * @param {ASTNode} node node to check.
		 * @returns {void}
		 */
		function check(node) {
			if (isInFinallyBlock(node, node.label)) {
				context.report({
					messageId: "unsafeUsage",
					data: {
						nodeType: node.type,
					},
					node,
					line: node.loc.line,
					column: node.loc.column,
				});
			}
		}

		return {
			ReturnStatement: check,
			ThrowStatement: check,
			BreakStatement: check,
			ContinueStatement: check,
		};
	},
};
YQx{/**
 * @fileoverview Rule to disallow negating the left operand of relational operators
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Checks whether the given operator is `in` or `instanceof`
 * @param {string} op The operator type to check.
 * @returns {boolean} `true` if the operator is `in` or `instanceof`
 */
function isInOrInstanceOfOperator(op) {
	return op === "in" || op === "instanceof";
}

/**
 * Checks whether the given operator is an ordering relational operator or not.
 * @param {string} op The operator type to check.
 * @returns {boolean} `true` if the operator is an ordering relational operator.
 */
function isOrderingRelationalOperator(op) {
	return op === "<" || op === ">" || op === ">=" || op === "<=";
}

/**
 * Checks whether the given node is a logical negation expression or not.
 * @param {ASTNode} node The node to check.
 * @returns {boolean} `true` if the node is a logical negation expression.
 */
function isNegation(node) {
	return node.type === "UnaryExpression" && node.operator === "!";
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		defaultOptions: [
			{
				enforceForOrderingRelations: false,
			},
		],

		docs: {
			description:
				"Disallow negating the left operand of relational operators",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-unsafe-negation",
		},

		hasSuggestions: true,

		schema: [
			{
				type: "object",
				properties: {
					enforceForOrderingRelations: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		fixable: null,

		messages: {
			unexpected:
				"Unexpected negating the left operand of '{{operator}}' operator.",
			suggestNegatedExpression:
				"Negate '{{operator}}' expression instead of its left operand. This changes the current behavior.",
			suggestParenthesisedNegation:
				"Wrap negation in '()' to make the intention explicit. This preserves the current behavior.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const [{ enforceForOrderingRelations }] = context.options;

		return {
			BinaryExpression(node) {
				const operator = node.operator;
				const orderingRelationRuleApplies =
					enforceForOrderingRelations &&
					isOrderingRelationalOperator(operator);

				if (
					(isInOrInstanceOfOperator(operator) ||
						orderingRelationRuleApplies) &&
					isNegation(node.left) &&
					!astUtils.isParenthesised(sourceCode, node.left)
				) {
					context.report({
						node,
						loc: node.left.loc,
						messageId: "unexpected",
						data: { operator },
						suggest: [
							{
								messageId: "suggestNegatedExpression",
								data: { operator },
								fix(fixer) {
									const negationToken =
										sourceCode.getFirstToken(node.left);
									const fixRange = [
										negationToken.range[1],
										node.range[1],
									];
									const text = sourceCode.text.slice(
										fixRange[0],
										fixRange[1],
									);

									return fixer.replaceTextRange(
										fixRange,
										`(${text})`,
									);
								},
							},
							{
								messageId: "suggestParenthesisedNegation",
								fix(fixer) {
									return fixer.replaceText(
										node.left,
										`(${sourceCode.getText(node.left)})`,
									);
								},
							},
						],
					});
				}
			},
		};
	},
};
xrx/**
 * @fileoverview Rule to disallow unsafe optional chaining
 * @author Yeon JuAn
 */

"use strict";

const UNSAFE_ARITHMETIC_OPERATORS = new Set(["+", "-", "/", "*", "%", "**"]);
const UNSAFE_ASSIGNMENT_OPERATORS = new Set([
	"+=",
	"-=",
	"/=",
	"*=",
	"%=",
	"**=",
]);
const UNSAFE_RELATIONAL_OPERATORS = new Set(["in", "instanceof"]);

/**
 * Checks whether a node is a destructuring pattern or not
 * @param {ASTNode} node node to check
 * @returns {boolean} `true` if a node is a destructuring pattern, otherwise `false`
 */
function isDestructuringPattern(node) {
	return node.type === "ObjectPattern" || node.type === "ArrayPattern";
}

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		defaultOptions: [
			{
				disallowArithmeticOperators: false,
			},
		],

		docs: {
			description:
				"Disallow use of optional chaining in contexts where the `undefined` value is not allowed",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-unsafe-optional-chaining",
		},
		schema: [
			{
				type: "object",
				properties: {
					disallowArithmeticOperators: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],
		fixable: null,
		messages: {
			unsafeOptionalChain:
				"Unsafe usage of optional chaining. If it short-circuits with 'undefined' the evaluation will throw TypeError.",
			unsafeArithmetic:
				"Unsafe arithmetic operation on optional chaining. It can result in NaN.",
		},
	},

	create(context) {
		const [{ disallowArithmeticOperators }] = context.options;

		/**
		 * Reports unsafe usage of optional chaining
		 * @param {ASTNode} node node to report
		 * @returns {void}
		 */
		function reportUnsafeUsage(node) {
			context.report({
				messageId: "unsafeOptionalChain",
				node,
			});
		}

		/**
		 * Reports unsafe arithmetic operation on optional chaining
		 * @param {ASTNode} node node to report
		 * @returns {void}
		 */
		function reportUnsafeArithmetic(node) {
			context.report({
				messageId: "unsafeArithmetic",
				node,
			});
		}

		/**
		 * Checks and reports if a node can short-circuit with `undefined` by optional chaining.
		 * @param {ASTNode} [node] node to check
		 * @param {Function} reportFunc report function
		 * @returns {void}
		 */
		function checkUndefinedShortCircuit(node, reportFunc) {
			if (!node) {
				return;
			}
			switch (node.type) {
				case "LogicalExpression":
					if (node.operator === "||" || node.operator === "??") {
						checkUndefinedShortCircuit(node.right, reportFunc);
					} else if (node.operator === "&&") {
						checkUndefinedShortCircuit(node.left, reportFunc);
						checkUndefinedShortCircuit(node.right, reportFunc);
					}
					break;
				case "SequenceExpression":
					checkUndefinedShortCircuit(
						node.expressions.at(-1),
						reportFunc,
					);
					break;
				case "ConditionalExpression":
					checkUndefinedShortCircuit(node.consequent, reportFunc);
					checkUndefinedShortCircuit(node.alternate, reportFunc);
					break;
				case "AwaitExpression":
					checkUndefinedShortCircuit(node.argument, reportFunc);
					break;
				case "ChainExpression":
					reportFunc(node);
					break;
				default:
					break;
			}
		}

		/**
		 * Checks unsafe usage of optional chaining
		 * @param {ASTNode} node node to check
		 * @returns {void}
		 */
		function checkUnsafeUsage(node) {
			checkUndefinedShortCircuit(node, reportUnsafeUsage);
		}

		/**
		 * Checks unsafe arithmetic operations on optional chaining
		 * @param {ASTNode} node node to check
		 * @returns {void}
		 */
		function checkUnsafeArithmetic(node) {
			checkUndefinedShortCircuit(node, reportUnsafeArithmetic);
		}

		return {
			"AssignmentExpression, AssignmentPattern"(node) {
				if (isDestructuringPattern(node.left)) {
					checkUnsafeUsage(node.right);
				}
			},
			"ClassDeclaration, ClassExpression"(node) {
				checkUnsafeUsage(node.superClass);
			},
			CallExpression(node) {
				if (!node.optional) {
					checkUnsafeUsage(node.callee);
				}
			},
			NewExpression(node) {
				checkUnsafeUsage(node.callee);
			},
			VariableDeclarator(node) {
				if (isDestructuringPattern(node.id)) {
					checkUnsafeUsage(node.init);
				}
			},
			MemberExpression(node) {
				if (!node.optional) {
					checkUnsafeUsage(node.object);
				}
			},
			TaggedTemplateExpression(node) {
				checkUnsafeUsage(node.tag);
			},
			ForOfStatement(node) {
				checkUnsafeUsage(node.right);
			},
			SpreadElement(node) {
				if (node.parent && node.parent.type !== "ObjectExpression") {
					checkUnsafeUsage(node.argument);
				}
			},
			BinaryExpression(node) {
				if (UNSAFE_RELATIONAL_OPERATORS.has(node.operator)) {
					checkUnsafeUsage(node.right);
				}
				if (
					disallowArithmeticOperators &&
					UNSAFE_ARITHMETIC_OPERATORS.has(node.operator)
				) {
					checkUnsafeArithmetic(node.right);
					checkUnsafeArithmetic(node.left);
				}
			},
			WithStatement(node) {
				checkUnsafeUsage(node.object);
			},
			UnaryExpression(node) {
				if (
					disallowArithmeticOperators &&
					UNSAFE_ARITHMETIC_OPERATORS.has(node.operator)
				) {
					checkUnsafeArithmetic(node.argument);
				}
			},
			AssignmentExpression(node) {
				if (
					disallowArithmeticOperators &&
					UNSAFE_ASSIGNMENT_OPERATORS.has(node.operator)
				) {
					checkUnsafeArithmetic(node.right);
				}
			},
		};
	},
};
Xhxw/**
 * @fileoverview Flag expressions in statement position that do not side effect
 * @author Michael Ficarra
 */
"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/**
 * Returns `true`.
 * @returns {boolean} `true`.
 */
function alwaysTrue() {
	return true;
}

/**
 * Returns `false`.
 * @returns {boolean} `false`.
 */
function alwaysFalse() {
	return false;
}

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow unused expressions",
			dialects: ["JavaScript", "TypeScript"],
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-unused-expressions",
		},

		schema: [
			{
				type: "object",
				properties: {
					allowShortCircuit: {
						type: "boolean",
					},
					allowTernary: {
						type: "boolean",
					},
					allowTaggedTemplates: {
						type: "boolean",
					},
					enforceForJSX: {
						type: "boolean",
					},
					ignoreDirectives: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		defaultOptions: [
			{
				allowShortCircuit: false,
				allowTernary: false,
				allowTaggedTemplates: false,
				enforceForJSX: false,
				ignoreDirectives: false,
			},
		],

		messages: {
			unusedExpression:
				"Expected an assignment or function call and instead saw an expression.",
		},
	},

	create(context) {
		const [
			{
				allowShortCircuit,
				allowTernary,
				allowTaggedTemplates,
				enforceForJSX,
				ignoreDirectives,
			},
		] = context.options;

		/**
		 * Has AST suggesting a directive.
		 * @param {ASTNode} node any node
		 * @returns {boolean} whether the given node structurally represents a directive
		 */
		function looksLikeDirective(node) {
			return (
				node.type === "ExpressionStatement" &&
				node.expression.type === "Literal" &&
				typeof node.expression.value === "string"
			);
		}

		/**
		 * Gets the leading sequence of members in a list that pass the predicate.
		 * @param {Function} predicate ([a] -> Boolean) the function used to make the determination
		 * @param {a[]} list the input list
		 * @returns {a[]} the leading sequence of members in the given list that pass the given predicate
		 */
		function takeWhile(predicate, list) {
			for (let i = 0; i < list.length; ++i) {
				if (!predicate(list[i])) {
					return list.slice(0, i);
				}
			}
			return list.slice();
		}

		/**
		 * Gets leading directives nodes in a Node body.
		 * @param {ASTNode} node a Program or BlockStatement node
		 * @returns {ASTNode[]} the leading sequence of directive nodes in the given node's body
		 */
		function directives(node) {
			return takeWhile(looksLikeDirective, node.body);
		}

		/**
		 * Detect if a Node is a directive.
		 * @param {ASTNode} node any node
		 * @returns {boolean} whether the given node is considered a directive in its current position
		 */
		function isDirective(node) {
			/**
			 * https://tc39.es/ecma262/#directive-prologue
			 *
			 * Only `FunctionBody`, `ScriptBody` and `ModuleBody` can have directive prologue.
			 * Class static blocks do not have directive prologue.
			 */
			return (
				astUtils.isTopLevelExpressionStatement(node) &&
				directives(node.parent).includes(node)
			);
		}

		/**
		 * The member functions return `true` if the type has no side-effects.
		 * Unknown nodes are handled as `false`, then this rule ignores those.
		 */
		const Checker = Object.assign(Object.create(null), {
			isDisallowed(node) {
				return (Checker[node.type] || alwaysFalse)(node);
			},

			ArrayExpression: alwaysTrue,
			ArrowFunctionExpression: alwaysTrue,
			BinaryExpression: alwaysTrue,
			ChainExpression(node) {
				return Checker.isDisallowed(node.expression);
			},
			ClassExpression: alwaysTrue,
			ConditionalExpression(node) {
				if (allowTernary) {
					return (
						Checker.isDisallowed(node.consequent) ||
						Checker.isDisallowed(node.alternate)
					);
				}
				return true;
			},
			FunctionExpression: alwaysTrue,
			Identifier: alwaysTrue,
			JSXElement() {
				return enforceForJSX;
			},
			JSXFragment() {
				return enforceForJSX;
			},
			Literal: alwaysTrue,
			LogicalExpression(node) {
				if (allowShortCircuit) {
					return Checker.isDisallowed(node.right);
				}
				return true;
			},
			MemberExpression: alwaysTrue,
			MetaProperty: alwaysTrue,
			ObjectExpression: alwaysTrue,
			SequenceExpression: alwaysTrue,
			TaggedTemplateExpression() {
				return !allowTaggedTemplates;
			},
			TemplateLiteral: alwaysTrue,
			ThisExpression: alwaysTrue,
			UnaryExpression(node) {
				return node.operator !== "void" && node.operator !== "delete";
			},
			// TypeScript-specific node types
			TSAsExpression(node) {
				return Checker.isDisallowed(node.expression);
			},
			TSTypeAssertion(node) {
				return Checker.isDisallowed(node.expression);
			},
			TSNonNullExpression(node) {
				return Checker.isDisallowed(node.expression);
			},
			TSInstantiationExpression(node) {
				return Checker.isDisallowed(node.expression);
			},
		});

		return {
			ExpressionStatement(node) {
				if (
					Checker.isDisallowed(node.expression) &&
					!astUtils.isDirective(node) &&
					!(ignoreDirectives && isDirective(node))
				) {
					context.report({ node, messageId: "unusedExpression" });
				}
			},
		};
	},
};
ulx&/**
 * @fileoverview Rule to disallow unused labels.
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow unused labels",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-unused-labels",
		},

		schema: [],

		fixable: "code",

		messages: {
			unused: "'{{name}}:' is defined but never used.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		let scopeInfo = null;

		/**
		 * Adds a scope info to the stack.
		 * @param {ASTNode} node A node to add. This is a LabeledStatement.
		 * @returns {void}
		 */
		function enterLabeledScope(node) {
			scopeInfo = {
				label: node.label.name,
				used: false,
				upper: scopeInfo,
			};
		}

		/**
		 * Checks if a `LabeledStatement` node is fixable.
		 * For a node to be fixable, there must be no comments between the label and the body.
		 * Furthermore, is must be possible to remove the label without turning the body statement into a
		 * directive after other fixes are applied.
		 * @param {ASTNode} node The node to evaluate.
		 * @returns {boolean} Whether or not the node is fixable.
		 */
		function isFixable(node) {
			/*
			 * Only perform a fix if there are no comments between the label and the body. This will be the case
			 * when there is exactly one token/comment (the ":") between the label and the body.
			 */
			if (
				sourceCode.getTokenAfter(node.label, {
					includeComments: true,
				}) !==
				sourceCode.getTokenBefore(node.body, { includeComments: true })
			) {
				return false;
			}

			// Looking for the node's deepest ancestor which is not a `LabeledStatement`.
			let ancestor = node.parent;

			while (ancestor.type === "LabeledStatement") {
				ancestor = ancestor.parent;
			}

			if (
				ancestor.type === "Program" ||
				(ancestor.type === "BlockStatement" &&
					astUtils.isFunction(ancestor.parent))
			) {
				const { body } = node;

				if (
					body.type === "ExpressionStatement" &&
					((body.expression.type === "Literal" &&
						typeof body.expression.value === "string") ||
						astUtils.isStaticTemplateLiteral(body.expression))
				) {
					return false; // potential directive
				}
			}
			return true;
		}

		/**
		 * Removes the top of the stack.
		 * At the same time, this reports the label if it's never used.
		 * @param {ASTNode} node A node to report. This is a LabeledStatement.
		 * @returns {void}
		 */
		function exitLabeledScope(node) {
			if (!scopeInfo.used) {
				context.report({
					node: node.label,
					messageId: "unused",
					data: node.label,
					fix: isFixable(node)
						? fixer =>
								fixer.removeRange([
									node.range[0],
									node.body.range[0],
								])
						: null,
				});
			}

			scopeInfo = scopeInfo.upper;
		}

		/**
		 * Marks the label of a given node as used.
		 * @param {ASTNode} node A node to mark. This is a BreakStatement or
		 *      ContinueStatement.
		 * @returns {void}
		 */
		function markAsUsed(node) {
			if (!node.label) {
				return;
			}

			const label = node.label.name;
			let info = scopeInfo;

			while (info) {
				if (info.label === label) {
					info.used = true;
					break;
				}
				info = info.upper;
			}
		}

		return {
			LabeledStatement: enterLabeledScope,
			"LabeledStatement:exit": exitLabeledScope,
			BreakStatement: markAsUsed,
			ContinueStatement: markAsUsed,
		};
	},
};
t9xd1/**
 * @fileoverview Rule to flag declared but unused private class members
 * @author Tim van der Lippe
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",
		hasSuggestions: true,

		docs: {
			description: "Disallow unused private class members",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-unused-private-class-members",
		},

		schema: [],

		messages: {
			unusedPrivateClassMember:
				"'{{classMemberName}}' is defined but never used.",
			removeUnusedPrivateClassMember:
				"Remove unused private class member '{{classMemberName}}'.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const trackedClasses = [];

		/**
		 * Gets the start index of the line that contains a given token or node.
		 * @param {ASTNode|Token|Comment} nodeOrToken The token or node to check
		 * @returns {number} The line start index
		 */
		function getLineStartIndex(nodeOrToken) {
			return nodeOrToken.range[0] - nodeOrToken.loc.start.column;
		}

		/**
		 * Checks whether a token or node starts on its own line, preceded only by whitespace.
		 * @param {ASTNode|Token|Comment} nodeOrToken The token or node to check
		 * @returns {boolean} Whether the token or node starts on its own line
		 */
		function startsOnOwnLine(nodeOrToken) {
			return (
				sourceCode.getTokenBefore(nodeOrToken, {
					includeComments: true,
				}).loc.end.line !== nodeOrToken.loc.start.line
			);
		}

		/**
		 * Gets leading comments that are directly attached to a class member.
		 * @param {ASTNode} classMemberNode The class member node
		 * @returns {Comment[]} Leading comments to remove with the member
		 */
		function getLeadingComments(classMemberNode) {
			const commentsBefore =
				sourceCode.getCommentsBefore(classMemberNode);
			const lastNonLeadingCommentIndex = commentsBefore.findLastIndex(
				(comment, index, self) => {
					const next =
						index < self.length - 1
							? self[index + 1]
							: classMemberNode;

					return (
						!startsOnOwnLine(comment) ||
						next.loc.start.line - comment.loc.end.line > 1
					);
				},
			);

			return commentsBefore.slice(lastNonLeadingCommentIndex + 1);
		}

		/**
		 * Checks whether a class member shares its line with another token.
		 * @param {ASTNode} classMemberNode The class member node
		 * @returns {boolean} Whether the member shares its line with another token
		 */
		function sharesLineWithAnotherToken(classMemberNode) {
			const previousToken = sourceCode.getTokenBefore(classMemberNode);
			const nextToken = sourceCode.getTokenAfter(classMemberNode);

			return (
				previousToken.loc.end.line === classMemberNode.loc.start.line ||
				nextToken.loc.start.line === classMemberNode.loc.end.line
			);
		}

		/**
		 * Gets trailing comments that are directly attached to a class member.
		 * Same-line trailing comments are preserved when another token shares
		 * the line, because the comment might describe the remaining code rather
		 * than the unused member alone.
		 * @param {ASTNode} classMemberNode The class member node
		 * @returns {Comment[]} Trailing comments to remove with the member
		 */
		function getTrailingComments(classMemberNode) {
			if (sharesLineWithAnotherToken(classMemberNode)) {
				return [];
			}

			return sourceCode
				.getCommentsAfter(classMemberNode)
				.filter(
					comment =>
						comment.loc.start.line === classMemberNode.loc.end.line,
				);
		}

		/**
		 * Gets the token after which a semicolon should be inserted when removing a class member.
		 * @param {ASTNode} classMemberNode The member that would be removed
		 * @returns {Token|null} The token after which a semicolon should be inserted, or null if no semicolon is needed
		 */
		function getSemicolonInsertionToken(classMemberNode) {
			const nextToken = sourceCode.getTokenAfter(classMemberNode);

			if (
				astUtils.canContinueExpressionInClassBody(nextToken) &&
				astUtils.needsPrecedingSemicolon(sourceCode, classMemberNode)
			) {
				return sourceCode.getTokenBefore(classMemberNode);
			}

			return null;
		}

		/**
		 * Gets the replacement range for removing an unused class member.
		 * @param {ASTNode} classMemberNode The member that would be removed
		 * @returns {number[]} The text range to remove
		 */
		function getMemberRemovalRange(classMemberNode) {
			const leadingComments = getLeadingComments(classMemberNode);
			const trailingComments = getTrailingComments(classMemberNode);
			const shouldRemoveLeadingComments =
				leadingComments.length > 0 &&
				!sharesLineWithAnotherToken(classMemberNode);
			const lastItemToRemove =
				trailingComments.length > 0
					? trailingComments.at(-1)
					: classMemberNode;

			const previousToken = sourceCode.getTokenBefore(classMemberNode);
			const nextToken = sourceCode.getTokenAfter(lastItemToRemove, {
				includeComments: true,
			});
			const nextTokenStartsOnNewLine =
				nextToken.loc.start.line > lastItemToRemove.loc.end.line;
			const shouldRemoveOwnLine =
				!shouldRemoveLeadingComments &&
				startsOnOwnLine(classMemberNode) &&
				nextTokenStartsOnNewLine;
			let start = classMemberNode.range[0];
			let end = lastItemToRemove.range[1];

			if (shouldRemoveLeadingComments) {
				start = nextTokenStartsOnNewLine
					? getLineStartIndex(leadingComments[0])
					: leadingComments[0].range[0];
				end = nextTokenStartsOnNewLine
					? getLineStartIndex(nextToken)
					: nextToken.range[0];
			} else if (shouldRemoveOwnLine) {
				start = getLineStartIndex(classMemberNode);
				end = getLineStartIndex(nextToken);
			} else if (
				previousToken.loc.end.line === classMemberNode.loc.start.line
			) {
				start = previousToken.range[1];
			} else if (
				nextToken.loc.start.line === lastItemToRemove.loc.end.line
			) {
				end = nextToken.range[0];
			}

			return [start, end];
		}

		/**
		 * Check whether the current node is in a write only assignment.
		 * @param {ASTNode} privateIdentifierNode Node referring to a private identifier
		 * @returns {boolean} Whether the node is in a write only assignment
		 * @private
		 */
		function isWriteOnlyAssignment(privateIdentifierNode) {
			const parentStatement = privateIdentifierNode.parent.parent;
			const isAssignmentExpression =
				parentStatement.type === "AssignmentExpression";

			if (
				!isAssignmentExpression &&
				parentStatement.type !== "ForInStatement" &&
				parentStatement.type !== "ForOfStatement" &&
				parentStatement.type !== "AssignmentPattern"
			) {
				return false;
			}

			// It is a write-only usage, since we still allow usages on the right for reads
			if (parentStatement.left !== privateIdentifierNode.parent) {
				return false;
			}

			// For any other operator (such as '+=') we still consider it a read operation
			if (isAssignmentExpression && parentStatement.operator !== "=") {
				/*
				 * However, if the read operation is "discarded" in an empty statement, then
				 * we consider it write only.
				 */
				return parentStatement.parent.type === "ExpressionStatement";
			}

			return true;
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			// Collect all declared members up front and assume they are all unused
			ClassBody(classBodyNode) {
				const privateMembers = new Map();

				trackedClasses.unshift(privateMembers);
				for (const bodyMember of classBodyNode.body) {
					if (
						bodyMember.type === "PropertyDefinition" ||
						bodyMember.type === "MethodDefinition"
					) {
						if (bodyMember.key.type === "PrivateIdentifier") {
							privateMembers.set(bodyMember.key.name, {
								declaredNode: bodyMember,
								hasReference: false,
								isAccessor:
									bodyMember.type === "MethodDefinition" &&
									(bodyMember.kind === "set" ||
										bodyMember.kind === "get"),
							});
						}
					}
				}
			},

			/*
			 * Process all usages of the private identifier and remove a member from
			 * `declaredAndUnusedPrivateMembers` if we deem it used.
			 */
			PrivateIdentifier(privateIdentifierNode) {
				const classBody = trackedClasses.find(classProperties =>
					classProperties.has(privateIdentifierNode.name),
				);

				// Can't happen, as it is a parser to have a missing class body, but let's code defensively here.
				if (!classBody) {
					return;
				}

				// In case any other usage was already detected, we can short circuit the logic here.
				const memberDefinition = classBody.get(
					privateIdentifierNode.name,
				);

				if (memberDefinition.isUsed) {
					return;
				}

				// The definition of the class member itself
				if (
					privateIdentifierNode.parent.type ===
						"PropertyDefinition" ||
					privateIdentifierNode.parent.type === "MethodDefinition"
				) {
					return;
				}

				memberDefinition.hasReference = true;

				/*
				 * Any usage of an accessor is considered a read, as the getter/setter can have
				 * side-effects in its definition.
				 */
				if (memberDefinition.isAccessor) {
					memberDefinition.isUsed = true;
					return;
				}

				// Any assignments to this member, except for assignments that also read
				if (isWriteOnlyAssignment(privateIdentifierNode)) {
					return;
				}

				const wrappingExpressionType =
					privateIdentifierNode.parent.parent.type;
				const parentOfWrappingExpressionType =
					privateIdentifierNode.parent.parent.parent.type;

				// A statement which only increments (`this.#x++;`)
				if (
					wrappingExpressionType === "UpdateExpression" &&
					parentOfWrappingExpressionType === "ExpressionStatement"
				) {
					return;
				}

				/*
				 * ({ x: this.#usedInDestructuring } = bar);
				 *
				 * But should treat the following as a read:
				 * ({ [this.#x]: a } = foo);
				 */
				if (
					wrappingExpressionType === "Property" &&
					parentOfWrappingExpressionType === "ObjectPattern" &&
					privateIdentifierNode.parent.parent.value ===
						privateIdentifierNode.parent
				) {
					return;
				}

				// [...this.#unusedInRestPattern] = bar;
				if (wrappingExpressionType === "RestElement") {
					return;
				}

				// [this.#unusedInAssignmentPattern] = bar;
				if (wrappingExpressionType === "ArrayPattern") {
					return;
				}

				/*
				 * We can't delete the memberDefinition, as we need to keep track of which member we are marking as used.
				 * In the case of nested classes, we only mark the first member we encounter as used. If you were to delete
				 * the member, then any subsequent usage could incorrectly mark the member of an encapsulating parent class
				 * as used, which is incorrect.
				 */
				memberDefinition.isUsed = true;
			},

			/*
			 * Post-process the class members and report any remaining members.
			 * Since private members can only be accessed in the current class context,
			 * we can safely assume that all usages are within the current class body.
			 */
			"ClassBody:exit"() {
				const unusedPrivateMembers = trackedClasses.shift();

				for (const [
					classMemberName,
					{ declaredNode, hasReference, isUsed },
				] of unusedPrivateMembers.entries()) {
					if (isUsed) {
						continue;
					}

					context.report({
						node: declaredNode,
						loc: declaredNode.key.loc,
						messageId: "unusedPrivateClassMember",
						data: {
							classMemberName: `#${classMemberName}`,
						},
						suggest: [
							{
								messageId: "removeUnusedPrivateClassMember",
								data: {
									classMemberName: `#${classMemberName}`,
								},
								*fix(fixer) {
									if (hasReference) {
										return;
									}

									const removalRange =
										getMemberRemovalRange(declaredNode);
									const semicolonInsertionToken =
										getSemicolonInsertionToken(
											declaredNode,
										);
									const removalFix = fixer.replaceTextRange(
										removalRange,
										"",
									);

									yield removalFix;

									if (semicolonInsertionToken) {
										yield fixer.insertTextAfter(
											semicolonInsertionToken,
											";",
										);
									}
								},
							},
						],
					});
				}
			},
		};
	},
};
?Sx	B/**
 * @fileoverview Rule to flag declared but unused variables
 * @author Ilya Volodin
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @typedef {import("eslint-scope").Variable} Variable */
/** @typedef {import("eslint-scope").Reference} Reference */

//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------

/**
 * A simple name for the types of variables that this rule supports
 * @typedef {'array-destructure'|'catch-clause'|'parameter'|'variable'} VariableType
 */

/**
 * Bag of data used for formatting the `unusedVar` lint message.
 * @typedef {Object} UnusedVarMessageData
 * @property {string} varName The name of the unused var.
 * @property {'defined'|'assigned a value'} action Description of the vars state.
 * @property {string} additional Any additional info to be appended at the end.
 */

/**
 * Bag of data used for formatting the `usedIgnoredVar` lint message.
 * @typedef {Object} UsedIgnoredVarMessageData
 * @property {string} varName The name of the unused var.
 * @property {string} additional Any additional info to be appended at the end.
 */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const DEFAULT_OPTIONS = {
	vars: "all",
	args: "after-used",
	ignoreRestSiblings: false,
	caughtErrors: "all",
	ignoreClassWithStaticInitBlock: false,
	ignoreUsingDeclarations: false,
	reportUsedIgnorePattern: false,
};

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description: "Disallow unused variables",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-unused-vars",
		},

		hasSuggestions: true,

		schema: [
			{
				oneOf: [
					{
						enum: ["all", "local"],
					},
					{
						type: "object",
						properties: {
							vars: {
								enum: ["all", "local"],
							},
							varsIgnorePattern: {
								type: "string",
							},
							args: {
								enum: ["all", "after-used", "none"],
							},
							ignoreRestSiblings: {
								type: "boolean",
							},
							argsIgnorePattern: {
								type: "string",
							},
							caughtErrors: {
								enum: ["all", "none"],
							},
							caughtErrorsIgnorePattern: {
								type: "string",
							},
							destructuredArrayIgnorePattern: {
								type: "string",
							},
							ignoreClassWithStaticInitBlock: {
								type: "boolean",
							},
							ignoreUsingDeclarations: {
								type: "boolean",
							},
							reportUsedIgnorePattern: {
								type: "boolean",
							},
						},
						additionalProperties: false,
					},
				],
			},
		],

		defaultOptions: [DEFAULT_OPTIONS],

		messages: {
			unusedVar:
				"'{{varName}}' is {{action}} but never used{{additional}}.",
			usedIgnoredVar:
				"'{{varName}}' is marked as ignored but is used{{additional}}.",
			removeVar: "Remove unused variable '{{varName}}'.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		const REST_PROPERTY_TYPE =
			/^(?:RestElement|(?:Experimental)?RestProperty)$/u;

		let config;

		const firstOption = context.options[0];

		if (typeof firstOption === "string") {
			config = {
				...DEFAULT_OPTIONS,
				vars: firstOption,
			};
		} else {
			config = {
				...firstOption,
			};

			if (firstOption.varsIgnorePattern) {
				config.varsIgnorePattern = new RegExp(
					firstOption.varsIgnorePattern,
					"u",
				);
			}

			if (firstOption.argsIgnorePattern) {
				config.argsIgnorePattern = new RegExp(
					firstOption.argsIgnorePattern,
					"u",
				);
			}

			if (firstOption.caughtErrorsIgnorePattern) {
				config.caughtErrorsIgnorePattern = new RegExp(
					firstOption.caughtErrorsIgnorePattern,
					"u",
				);
			}

			if (firstOption.destructuredArrayIgnorePattern) {
				config.destructuredArrayIgnorePattern = new RegExp(
					firstOption.destructuredArrayIgnorePattern,
					"u",
				);
			}
		}

		/**
		 * Determines what variable type a def is.
		 * @param  {Object} def the declaration to check
		 * @returns {VariableType} a simple name for the types of variables that this rule supports
		 */
		function defToVariableType(def) {
			/*
			 * This `destructuredArrayIgnorePattern` error report works differently from the catch
			 * clause and parameter error reports. _Both_ the `varsIgnorePattern` and the
			 * `destructuredArrayIgnorePattern` will be checked for array destructuring. However,
			 * for the purposes of the report, the currently defined behavior is to only inform the
			 * user of the `destructuredArrayIgnorePattern` if it's present (regardless of the fact
			 * that the `varsIgnorePattern` would also apply). If it's not present, the user will be
			 * informed of the `varsIgnorePattern`, assuming that's present.
			 */
			if (
				config.destructuredArrayIgnorePattern &&
				def.name.parent.type === "ArrayPattern"
			) {
				return "array-destructure";
			}

			switch (def.type) {
				case "CatchClause":
					return "catch-clause";
				case "Parameter":
					return "parameter";

				default:
					return "variable";
			}
		}

		/**
		 * Gets a given variable's description and configured ignore pattern
		 * based on the provided variableType
		 * @param {VariableType} variableType a simple name for the types of variables that this rule supports
		 * @throws {Error} (Unreachable)
		 * @returns {[string | undefined, string | undefined]} the given variable's description and
		 * ignore pattern
		 */
		function getVariableDescription(variableType) {
			let pattern;
			let variableDescription;

			switch (variableType) {
				case "array-destructure":
					pattern = config.destructuredArrayIgnorePattern;
					variableDescription = "elements of array destructuring";
					break;

				case "catch-clause":
					pattern = config.caughtErrorsIgnorePattern;
					variableDescription = "caught errors";
					break;

				case "parameter":
					pattern = config.argsIgnorePattern;
					variableDescription = "args";
					break;

				case "variable":
					pattern = config.varsIgnorePattern;
					variableDescription = "vars";
					break;

				default:
					throw new Error(
						`Unexpected variable type: ${variableType}`,
					);
			}

			if (pattern) {
				pattern = pattern.toString();
			}

			return [variableDescription, pattern];
		}

		/**
		 * Generates the message data about the variable being defined and unused,
		 * including the ignore pattern if configured.
		 * @param {Variable} unusedVar eslint-scope variable object.
		 * @returns {UnusedVarMessageData} The message data to be used with this unused variable.
		 */
		function getDefinedMessageData(unusedVar) {
			const def = unusedVar.defs && unusedVar.defs[0];
			let additionalMessageData = "";

			if (def) {
				const [variableDescription, pattern] = getVariableDescription(
					defToVariableType(def),
				);

				if (pattern && variableDescription) {
					additionalMessageData = `. Allowed unused ${variableDescription} must match ${pattern}`;
				}
			}

			return {
				varName: unusedVar.name,
				action: "defined",
				additional: additionalMessageData,
			};
		}

		/**
		 * Generate the warning message about the variable being
		 * assigned and unused, including the ignore pattern if configured.
		 * @param {Variable} unusedVar eslint-scope variable object.
		 * @returns {UnusedVarMessageData} The message data to be used with this unused variable.
		 */
		function getAssignedMessageData(unusedVar) {
			const def = unusedVar.defs && unusedVar.defs[0];
			let additionalMessageData = "";

			if (def) {
				const [variableDescription, pattern] = getVariableDescription(
					defToVariableType(def),
				);

				if (pattern && variableDescription) {
					additionalMessageData = `. Allowed unused ${variableDescription} must match ${pattern}`;
				}
			}

			return {
				varName: unusedVar.name,
				action: "assigned a value",
				additional: additionalMessageData,
			};
		}

		/**
		 * Generate the warning message about a variable being used even though
		 * it is marked as being ignored.
		 * @param {Variable} variable eslint-scope variable object
		 * @param {VariableType} variableType a simple name for the types of variables that this rule supports
		 * @returns {UsedIgnoredVarMessageData} The message data to be used with
		 * this used ignored variable.
		 */
		function getUsedIgnoredMessageData(variable, variableType) {
			const [variableDescription, pattern] =
				getVariableDescription(variableType);

			let additionalMessageData = "";

			if (pattern && variableDescription) {
				additionalMessageData = `. Used ${variableDescription} must not match ${pattern}`;
			}

			return {
				varName: variable.name,
				additional: additionalMessageData,
			};
		}

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		const STATEMENT_TYPE = /(?:Statement|Declaration)$/u;

		/**
		 * Determines if a given variable is being exported from a module.
		 * @param {Variable} variable eslint-scope variable object.
		 * @returns {boolean} True if the variable is exported, false if not.
		 * @private
		 */
		function isExported(variable) {
			const definition = variable.defs[0];

			if (definition) {
				let node = definition.node;

				if (node.type === "VariableDeclarator") {
					node = node.parent;
				} else if (definition.type === "Parameter") {
					return false;
				}

				return node.parent.type.indexOf("Export") === 0;
			}
			return false;
		}

		/**
		 * Determines if a given variable uses the explicit resource management protocol.
		 * @param {Variable} variable eslint-scope variable object.
		 * @returns {boolean} True if the variable is declared with "using" or "await using"
		 * @private
		 */
		function usesExplicitResourceManagement(variable) {
			const [definition] = variable.defs;

			return (
				definition?.type === "Variable" &&
				(definition.parent.kind === "using" ||
					definition.parent.kind === "await using")
			);
		}

		/**
		 * Checks whether a node is a sibling of the rest property or not.
		 * @param {ASTNode} node a node to check
		 * @returns {boolean} True if the node is a sibling of the rest property, otherwise false.
		 */
		function hasRestSibling(node) {
			return (
				node.type === "Property" &&
				node.parent.type === "ObjectPattern" &&
				REST_PROPERTY_TYPE.test(node.parent.properties.at(-1).type)
			);
		}

		/**
		 * Determines if a variable has a sibling rest property
		 * @param {Variable} variable eslint-scope variable object.
		 * @returns {boolean} True if the variable has a sibling rest property, false if not.
		 * @private
		 */
		function hasRestSpreadSibling(variable) {
			if (config.ignoreRestSiblings) {
				const hasRestSiblingDefinition = variable.defs.some(def =>
					hasRestSibling(def.name.parent),
				);
				const hasRestSiblingReference = variable.references.some(ref =>
					hasRestSibling(ref.identifier.parent),
				);

				return hasRestSiblingDefinition || hasRestSiblingReference;
			}

			return false;
		}

		/**
		 * Determines if a reference is a read operation.
		 * @param {Reference} ref An eslint-scope Reference
		 * @returns {boolean} whether the given reference represents a read operation
		 * @private
		 */
		function isReadRef(ref) {
			return ref.isRead();
		}

		/**
		 * Determine if an identifier is referencing an enclosing function name.
		 * @param {Reference} ref The reference to check.
		 * @param {ASTNode[]} nodes The candidate function nodes.
		 * @returns {boolean} True if it's a self-reference, false if not.
		 * @private
		 */
		function isSelfReference(ref, nodes) {
			let scope = ref.from;

			while (scope) {
				if (nodes.includes(scope.block)) {
					return true;
				}

				scope = scope.upper;
			}

			return false;
		}

		/**
		 * Gets a list of function definitions for a specified variable.
		 * @param {Variable} variable eslint-scope variable object.
		 * @returns {ASTNode[]} Function nodes.
		 * @private
		 */
		function getFunctionDefinitions(variable) {
			const functionDefinitions = [];

			variable.defs.forEach(def => {
				const { type, node } = def;

				// FunctionDeclarations
				if (type === "FunctionName") {
					functionDefinitions.push(node);
				}

				// FunctionExpressions
				if (
					type === "Variable" &&
					node.init &&
					(node.init.type === "FunctionExpression" ||
						node.init.type === "ArrowFunctionExpression")
				) {
					functionDefinitions.push(node.init);
				}
			});
			return functionDefinitions;
		}

		/**
		 * Checks the position of given nodes.
		 * @param {ASTNode} inner A node which is expected as inside.
		 * @param {ASTNode} outer A node which is expected as outside.
		 * @returns {boolean} `true` if the `inner` node exists in the `outer` node.
		 * @private
		 */
		function isInside(inner, outer) {
			return (
				inner.range[0] >= outer.range[0] &&
				inner.range[1] <= outer.range[1]
			);
		}

		/**
		 * Checks whether a given node is unused expression or not.
		 * @param {ASTNode} node The node itself
		 * @returns {boolean} The node is an unused expression.
		 * @private
		 */
		function isUnusedExpression(node) {
			const parent = node.parent;

			if (parent.type === "ExpressionStatement") {
				return true;
			}

			if (parent.type === "SequenceExpression") {
				const isLastExpression = parent.expressions.at(-1) === node;

				if (!isLastExpression) {
					return true;
				}
				return isUnusedExpression(parent);
			}

			return false;
		}

		/**
		 * If a given reference is left-hand side of an assignment, this gets
		 * the right-hand side node of the assignment.
		 *
		 * In the following cases, this returns null.
		 *
		 * - The reference is not the LHS of an assignment expression.
		 * - The reference is inside of a loop.
		 * - The reference is inside of a function scope which is different from
		 *   the declaration.
		 * @param {Reference} ref A reference to check.
		 * @param {ASTNode} prevRhsNode The previous RHS node.
		 * @returns {ASTNode|null} The RHS node or null.
		 * @private
		 */
		function getRhsNode(ref, prevRhsNode) {
			const id = ref.identifier;
			const parent = id.parent;
			const refScope = ref.from.variableScope;
			const varScope = ref.resolved.scope.variableScope;
			const canBeUsedLater =
				refScope !== varScope || astUtils.isInLoop(id);

			/*
			 * Inherits the previous node if this reference is in the node.
			 * This is for `a = a + a`-like code.
			 */
			if (prevRhsNode && isInside(id, prevRhsNode)) {
				return prevRhsNode;
			}

			if (
				parent.type === "AssignmentExpression" &&
				isUnusedExpression(parent) &&
				id === parent.left &&
				!canBeUsedLater
			) {
				return parent.right;
			}
			return null;
		}

		/**
		 * Checks whether a given function node is stored to somewhere or not.
		 * If the function node is stored, the function can be used later.
		 * @param {ASTNode} funcNode A function node to check.
		 * @param {ASTNode} rhsNode The RHS node of the previous assignment.
		 * @returns {boolean} `true` if under the following conditions:
		 *      - the funcNode is assigned to a variable.
		 *      - the funcNode is bound as an argument of a function call.
		 *      - the function is bound to a property and the object satisfies above conditions.
		 * @private
		 */
		function isStorableFunction(funcNode, rhsNode) {
			let node = funcNode;
			let parent = funcNode.parent;

			while (parent && isInside(parent, rhsNode)) {
				switch (parent.type) {
					case "SequenceExpression":
						if (parent.expressions.at(-1) !== node) {
							return false;
						}
						break;

					case "CallExpression":
					case "NewExpression":
						return parent.callee !== node;

					case "AssignmentExpression":
					case "TaggedTemplateExpression":
					case "YieldExpression":
						return true;

					default:
						if (STATEMENT_TYPE.test(parent.type)) {
							/*
							 * If it encountered statements, this is a complex pattern.
							 * Since analyzing complex patterns is hard, this returns `true` to avoid false positive.
							 */
							return true;
						}
				}

				node = parent;
				parent = parent.parent;
			}

			return false;
		}

		/**
		 * Checks whether a given Identifier node exists inside of a function node which can be used later.
		 *
		 * "can be used later" means:
		 * - the function is assigned to a variable.
		 * - the function is bound to a property and the object can be used later.
		 * - the function is bound as an argument of a function call.
		 *
		 * If a reference exists in a function which can be used later, the reference is read when the function is called.
		 * @param {ASTNode} id An Identifier node to check.
		 * @param {ASTNode} rhsNode The RHS node of the previous assignment.
		 * @returns {boolean} `true` if the `id` node exists inside of a function node which can be used later.
		 * @private
		 */
		function isInsideOfStorableFunction(id, rhsNode) {
			const funcNode = astUtils.getUpperFunction(id);

			return (
				funcNode &&
				isInside(funcNode, rhsNode) &&
				isStorableFunction(funcNode, rhsNode)
			);
		}

		/**
		 * Checks whether a given reference is a read to update itself or not.
		 * @param {Reference} ref A reference to check.
		 * @param {ASTNode} rhsNode The RHS node of the previous assignment.
		 * @returns {boolean} The reference is a read to update itself.
		 * @private
		 */
		function isReadForItself(ref, rhsNode) {
			const id = ref.identifier;
			const parent = id.parent;

			return (
				ref.isRead() &&
				// self update. e.g. `a += 1`, `a++`
				((parent.type === "AssignmentExpression" &&
					parent.left === id &&
					isUnusedExpression(parent) &&
					!astUtils.isLogicalAssignmentOperator(parent.operator)) ||
					(parent.type === "UpdateExpression" &&
						isUnusedExpression(parent)) ||
					// in RHS of an assignment for itself. e.g. `a = a + 1`
					(rhsNode &&
						isInside(id, rhsNode) &&
						!isInsideOfStorableFunction(id, rhsNode)))
			);
		}

		/**
		 * Determine if an identifier is used either in for-in or for-of loops.
		 * @param {Reference} ref The reference to check.
		 * @returns {boolean} whether reference is used in the for-in loops
		 * @private
		 */
		function isForInOfRef(ref) {
			let target = ref.identifier.parent;

			// "for (var ...) { return; }"
			if (target.type === "VariableDeclarator") {
				target = target.parent.parent;
			}

			if (
				target.type !== "ForInStatement" &&
				target.type !== "ForOfStatement"
			) {
				return false;
			}

			// "for (...) { return; }"
			if (target.body.type === "BlockStatement") {
				target = target.body.body[0];

				// "for (...) return;"
			} else {
				target = target.body;
			}

			// For empty loop body
			if (!target) {
				return false;
			}

			return target.type === "ReturnStatement";
		}

		/**
		 * Determines if the variable is used.
		 * @param {Variable} variable The variable to check.
		 * @returns {boolean} True if the variable is used
		 * @private
		 */
		function isUsedVariable(variable) {
			if (variable.eslintUsed) {
				return true;
			}

			const functionNodes = getFunctionDefinitions(variable);
			const isFunctionDefinition = functionNodes.length > 0;

			let rhsNode = null;

			return variable.references.some(ref => {
				if (isForInOfRef(ref)) {
					return true;
				}

				const forItself = isReadForItself(ref, rhsNode);

				rhsNode = getRhsNode(ref, rhsNode);

				return (
					isReadRef(ref) &&
					!forItself &&
					!(
						isFunctionDefinition &&
						isSelfReference(ref, functionNodes)
					)
				);
			});
		}

		/**
		 * Checks whether the given variable is after the last used parameter.
		 * @param {Variable} variable The variable to check.
		 * @returns {boolean} `true` if the variable is defined after the last
		 * used parameter.
		 */
		function isAfterLastUsedArg(variable) {
			const def = variable.defs[0];
			const params = sourceCode.getDeclaredVariables(def.node);
			const posteriorParams = params.slice(params.indexOf(variable) + 1);

			// If any used parameters occur after this parameter, do not report.
			return !posteriorParams.some(
				v => v.references.length > 0 || v.eslintUsed,
			);
		}

		/**
		 * Gets an array of variables without read references.
		 * @param {Scope} scope an eslint-scope Scope object.
		 * @param {Variable[]} unusedVars an array that saving result.
		 * @returns {Variable[]} unused variables of the scope and descendant scopes.
		 * @private
		 */
		function collectUnusedVariables(scope, unusedVars) {
			const variables = scope.variables;
			const childScopes = scope.childScopes;
			let i, l;

			if (scope.type !== "global" || config.vars === "all") {
				for (i = 0, l = variables.length; i < l; ++i) {
					const variable = variables[i];

					// skip a variable of class itself name in the class scope
					if (
						scope.type === "class" &&
						scope.block.id === variable.identifiers[0]
					) {
						continue;
					}

					// skip function expression names
					if (scope.functionExpressionScope) {
						continue;
					}

					// skip variables marked with markVariableAsUsed()
					if (
						!config.reportUsedIgnorePattern &&
						variable.eslintUsed
					) {
						continue;
					}

					// skip implicit "arguments" variable
					if (
						scope.type === "function" &&
						variable.name === "arguments" &&
						variable.identifiers.length === 0
					) {
						continue;
					}

					// explicit global variables don't have definitions.
					const def = variable.defs[0];

					if (def) {
						const type = def.type;
						const refUsedInArrayPatterns = variable.references.some(
							ref =>
								ref.identifier.parent.type === "ArrayPattern",
						);

						// skip elements of array destructuring patterns
						if (
							(def.name.parent.type === "ArrayPattern" ||
								refUsedInArrayPatterns) &&
							config.destructuredArrayIgnorePattern &&
							config.destructuredArrayIgnorePattern.test(
								def.name.name,
							)
						) {
							if (
								config.reportUsedIgnorePattern &&
								isUsedVariable(variable)
							) {
								context.report({
									node: def.name,
									messageId: "usedIgnoredVar",
									data: getUsedIgnoredMessageData(
										variable,
										"array-destructure",
									),
								});
							}

							continue;
						}

						if (type === "ClassName") {
							const hasStaticBlock = def.node.body.body.some(
								node => node.type === "StaticBlock",
							);

							if (
								config.ignoreClassWithStaticInitBlock &&
								hasStaticBlock
							) {
								continue;
							}
						}

						// skip catch variables
						if (type === "CatchClause") {
							if (config.caughtErrors === "none") {
								continue;
							}

							// skip ignored parameters
							if (
								config.caughtErrorsIgnorePattern &&
								config.caughtErrorsIgnorePattern.test(
									def.name.name,
								)
							) {
								if (
									config.reportUsedIgnorePattern &&
									isUsedVariable(variable)
								) {
									context.report({
										node: def.name,
										messageId: "usedIgnoredVar",
										data: getUsedIgnoredMessageData(
											variable,
											"catch-clause",
										),
									});
								}

								continue;
							}
						} else if (type === "Parameter") {
							// skip any setter argument
							if (
								(def.node.parent.type === "Property" ||
									def.node.parent.type ===
										"MethodDefinition") &&
								def.node.parent.kind === "set"
							) {
								continue;
							}

							// if "args" option is "none", skip any parameter
							if (config.args === "none") {
								continue;
							}

							// skip ignored parameters
							if (
								config.argsIgnorePattern &&
								config.argsIgnorePattern.test(def.name.name)
							) {
								if (
									config.reportUsedIgnorePattern &&
									isUsedVariable(variable)
								) {
									context.report({
										node: def.name,
										messageId: "usedIgnoredVar",
										data: getUsedIgnoredMessageData(
											variable,
											"parameter",
										),
									});
								}

								continue;
							}

							// if "args" option is "after-used", skip used variables
							if (
								config.args === "after-used" &&
								astUtils.isFunction(def.name.parent) &&
								!isAfterLastUsedArg(variable)
							) {
								continue;
							}
						} else {
							// skip ignored variables
							if (
								config.varsIgnorePattern &&
								config.varsIgnorePattern.test(def.name.name)
							) {
								if (
									config.reportUsedIgnorePattern &&
									isUsedVariable(variable)
								) {
									context.report({
										node: def.name,
										messageId: "usedIgnoredVar",
										data: getUsedIgnoredMessageData(
											variable,
											"variable",
										),
									});
								}

								continue;
							}
						}
					}

					if (
						!isUsedVariable(variable) &&
						!isExported(variable) &&
						!(
							config.ignoreUsingDeclarations &&
							usesExplicitResourceManagement(variable)
						) &&
						!hasRestSpreadSibling(variable)
					) {
						unusedVars.push(variable);
					}
				}
			}

			for (i = 0, l = childScopes.length; i < l; ++i) {
				collectUnusedVariables(childScopes[i], unusedVars);
			}

			return unusedVars;
		}

		/**
		 * fixes unused variables
		 * @param {Object} fixer fixer object
		 * @param {Object} unusedVar unused variable to fix
		 * @returns {Object} fixer object
		 */
		function handleFixes(fixer, unusedVar) {
			const id = unusedVar.identifiers[0];
			const parent = id.parent;
			const parentType = parent.type;
			const tokenBefore = sourceCode.getTokenBefore(id);
			const tokenAfter = sourceCode.getTokenAfter(id);
			const isFunction = astUtils.isFunction;
			const isLoop = astUtils.isLoop;
			const allWriteReferences = unusedVar.references.filter(ref =>
				ref.isWrite(),
			);

			/**
			 * get range from token before of a given node
			 * @param {ASTNode} node node of identifier
			 * @param {number} skips number of token to skip
			 * @returns {number} start range of token before the identifier
			 */
			function getPreviousTokenStart(node, skips) {
				return sourceCode.getTokenBefore(node, skips).range[0];
			}

			/**
			 * get range to token after of a given node
			 * @param {ASTNode} node node of identifier
			 * @param {number} skips number of token to skip
			 * @returns {number} end range of token after the identifier
			 */
			function getNextTokenEnd(node, skips) {
				return sourceCode.getTokenAfter(node, skips).range[1];
			}

			/**
			 * get the value of token before of a given node
			 * @param {ASTNode} node node of identifier
			 * @returns {string} value of token before the identifier
			 */
			function getTokenBeforeValue(node) {
				return sourceCode.getTokenBefore(node).value;
			}

			/**
			 * get the value of token after of a given node
			 * @param {ASTNode} node node of identifier
			 * @returns {string} value of token after the identifier
			 */
			function getTokenAfterValue(node) {
				return sourceCode.getTokenAfter(node).value;
			}

			/**
			 * Check if an array has a single element with null as other element.
			 * @param {ASTNode} node ArrayPattern node
			 * @returns {boolean} true if array has single element with other null elements
			 */
			function hasSingleElement(node) {
				return node.elements.filter(e => e !== null).length === 1;
			}

			/**
			 * check whether import specifier has an import of particular type
			 * @param {ASTNode} node ImportDeclaration node
			 * @param {string} type type of import to check
			 * @returns {boolean} true if import specifier has import of specified type
			 */
			function hasImportOfCertainType(node, type) {
				return node.specifiers.some(e => e.type === type);
			}

			/**
			 * Check whether declaration is safe to remove or not
			 * @param {ASTNode} nextToken next token of unused variable
			 * @param {ASTNode} prevToken previous token of unused variable
			 * @returns {boolean} true if declaration is not safe to remove
			 */
			function isDeclarationNotSafeToRemove(nextToken, prevToken) {
				return (
					nextToken.type === "String" ||
					(prevToken &&
						!astUtils.isSemicolonToken(prevToken) &&
						!astUtils.isOpeningBraceToken(prevToken))
				);
			}

			/**
			 * give fixes for unused variables in function parameters
			 * @param {ASTNode} node node to check
			 * @returns {Object} fixer object
			 */
			function fixFunctionParameters(node) {
				const parentNode = node.parent;

				if (isFunction(parentNode)) {
					// remove unused function parameter if there is only a single parameter
					if (parentNode.params.length === 1) {
						return fixer.removeRange(node.range);
					}

					// remove first unused function parameter when there are multiple parameters
					if (
						getTokenBeforeValue(node) === "(" &&
						getTokenAfterValue(node) === ","
					) {
						return fixer.removeRange([
							node.range[0],
							getNextTokenEnd(node),
						]);
					}

					// remove unused function parameters except first one when there are multiple parameters
					return fixer.removeRange([
						getPreviousTokenStart(node),
						node.range[1],
					]);
				}

				return null;
			}

			/**
			 * fix unused variable declarations and function parameters
			 * @param {ASTNode} node parent node to identifier
			 * @returns {Object} fixer object
			 */
			function fixVariables(node) {
				const parentNode = node.parent;

				// remove unused declared variables such as var a = b; or var a = b, c;
				if (parentNode.type === "VariableDeclarator") {
					// skip variable in for (const [ foo ] of bar);
					if (isLoop(parentNode.parent.parent)) {
						return null;
					}

					/*
					 * remove unused declared variable with single declaration such as 'var a = b;'
					 * remove complete declaration when there is an unused variable in 'const { a } = foo;', same for arrays.
					 */
					if (parentNode.parent.declarations.length === 1) {
						// if next token is a string it could become a directive if node is removed -> no suggestion.
						const nextToken = sourceCode.getTokenAfter(
							parentNode.parent,
						);

						// if previous token exists and is not ";" or "{" not sure about ASI rules -> no suggestion.
						const prevToken = sourceCode.getTokenBefore(
							parentNode.parent,
						);

						if (
							nextToken &&
							isDeclarationNotSafeToRemove(nextToken, prevToken)
						) {
							return null;
						}

						return fixer.removeRange(parentNode.parent.range);
					}

					/*
					 * remove unused declared variable with multiple declaration except first one such as 'var a = b, c = d;'
					 * fix 'let bar = "hello", { a } = foo;' to 'let bar = "hello";' if 'a' is unused, same for arrays.
					 */
					if (getTokenBeforeValue(parentNode) === ",") {
						return fixer.removeRange([
							getPreviousTokenStart(parentNode),
							parentNode.range[1],
						]);
					}

					/*
					 * remove first unused declared variable when there are multiple declarations
					 * fix 'let { a } = foo, bar = "hello";' to 'let  bar = "hello";' if 'a' is unused, same for arrays.
					 */
					return fixer.removeRange([
						parentNode.range[0],
						getNextTokenEnd(parentNode),
					]);
				}

				// fixes [{a: {k}}], [{a: [k]}]
				if (getTokenBeforeValue(node) === ":") {
					if (parentNode.parent.type === "ObjectPattern") {
						// eslint-disable-next-line no-use-before-define -- due to interdependency of functions
						return fixObjectWithValueSeparator(node);
					}
				}

				// fix unused function parameters
				return fixFunctionParameters(node);
			}

			/**
			 * fix nested object like { a: { b } }
			 * @param {ASTNode} node parent node to check
			 * @returns {Object} fixer object
			 */
			function fixNestedObjectVariable(node) {
				const parentNode = node.parent;

				// fix for { a: { b: { c: { d } } } }
				if (
					parentNode.parent.parent.parent.type === "ObjectPattern" &&
					parentNode.parent.properties.length === 1
				) {
					return fixNestedObjectVariable(parentNode.parent);
				}

				// fix for { a: { b } }
				if (parentNode.parent.type === "ObjectPattern") {
					// fix for unused variables in destructured object with single property in variable declaration and function parameter
					if (parentNode.parent.properties.length === 1) {
						return fixVariables(parentNode.parent);
					}

					// fix for first unused property when there are multiple properties such as '{ a: { b }, c }'
					if (getTokenBeforeValue(parentNode) === "{") {
						return fixer.removeRange([
							parentNode.range[0],
							getNextTokenEnd(parentNode),
						]);
					}

					// fix for unused property except first one when there are multiple properties such as '{ k, a: { b } }'
					return fixer.removeRange([
						getPreviousTokenStart(parentNode),
						parentNode.range[1],
					]);
				}

				return null;
			}

			/**
			 * fix unused variables in array and nested array
			 * @param {ASTNode} node parent node to check
			 * @returns {Object} fixer object
			 */
			function fixNestedArrayVariable(node) {
				const parentNode = node.parent;

				// fix for nested arrays [[ a ]]
				if (
					parentNode.parent.type === "ArrayPattern" &&
					hasSingleElement(parentNode)
				) {
					return fixNestedArrayVariable(parentNode);
				}

				if (hasSingleElement(parentNode)) {
					// fixes { a: [{ b }] } or { a: [[ b ]] }
					if (getTokenBeforeValue(parentNode) === ":") {
						return fixVariables(parentNode);
					}

					// fixes [a, ...[[ b ]]] or [a, ...[{ b }]]
					if (parentNode.parent.type === "RestElement") {
						// eslint-disable-next-line no-use-before-define -- due to interdependency of functions
						return fixRestInPattern(parentNode.parent);
					}

					// fix unused variables in destructured array in variable declaration or function parameter
					return fixVariables(parentNode);
				}

				// remove last unused array element
				if (
					getTokenBeforeValue(node) === "," &&
					getTokenAfterValue(node) === "]"
				) {
					return fixer.removeRange([
						getPreviousTokenStart(node),
						node.range[1],
					]);
				}

				// remove unused array element
				return fixer.removeRange(node.range);
			}

			/**
			 * fix cases like {a: {k}} or {a: [k]}
			 * @param {ASTNode} node parent node to check
			 * @returns {Object} fixer object
			 */
			function fixObjectWithValueSeparator(node) {
				const parentNode = node.parent.parent;

				// fix cases like [{a : { b }}] or [{a : [ b ]}]
				if (
					parentNode.parent.type === "ArrayPattern" &&
					parentNode.properties.length === 1
				) {
					return fixNestedArrayVariable(parentNode);
				}

				// fix cases like {a: {k}} or {a: [k]}
				return fixNestedObjectVariable(node);
			}

			/**
			 * fix ...[[a]] or ...[{a}] like patterns
			 * @param {ASTNode} node parent node to check
			 * @returns {Object} fixer object
			 */
			function fixRestInPattern(node) {
				const parentNode = node.parent;

				// fix ...[[a]] or ...[{a}] in function parameters
				if (isFunction(parentNode)) {
					if (parentNode.params.length === 1) {
						return fixer.removeRange(node.range);
					}

					return fixer.removeRange([
						getPreviousTokenStart(node),
						node.range[1],
					]);
				}

				// fix rest in nested array pattern like [[a, ...[b]]]
				if (parentNode.type === "ArrayPattern") {
					// fix [[...[b]]]
					if (hasSingleElement(parentNode)) {
						if (parentNode.parent.type === "ArrayPattern") {
							return fixNestedArrayVariable(parentNode);
						}

						// fix 'const [...[b]] = foo; and function foo([...[b]]) {}
						return fixVariables(parentNode);
					}

					// fix [[a, ...[b]]]
					return fixer.removeRange([
						getPreviousTokenStart(node),
						node.range[1],
					]);
				}

				return null;
			}

			// skip fix when variable has references that would be left behind
			if (
				allWriteReferences.some(
					ref => ref.identifier.range[0] !== id.range[0],
				)
			) {
				return null;
			}

			// remove declared variables such as var a; or var a, b;
			if (parentType === "VariableDeclarator") {
				if (parent.parent.declarations.length === 1) {
					// prevent fix of variable in forOf and forIn loops.
					if (
						isLoop(parent.parent.parent) &&
						parent.parent.parent.body !== parent.parent
					) {
						return null;
					}

					// removes only variable not semicolon in 'if (foo()) var bar;' or in 'loops' or in 'with' statement.
					if (
						parent.parent.parent.type === "IfStatement" ||
						isLoop(parent.parent.parent) ||
						(parent.parent.parent.type === "WithStatement" &&
							parent.parent.parent.body === parent.parent)
					) {
						return fixer.replaceText(parent.parent, ";");
					}

					// if next token is a string it could become a directive if node is removed -> no suggestion.
					const nextToken = sourceCode.getTokenAfter(parent.parent);

					// if previous token exists and is not ";" or "{" not sure about ASI rules -> no suggestion.
					const prevToken = sourceCode.getTokenBefore(parent.parent);

					if (
						nextToken &&
						isDeclarationNotSafeToRemove(nextToken, prevToken)
					) {
						return null;
					}

					// remove unused declared variable with single declaration like 'var a = b;'
					return fixer.removeRange(parent.parent.range);
				}

				// remove unused declared variable with multiple declaration except first one like 'var a = b, c = d;'
				if (tokenBefore.value === ",") {
					return fixer.removeRange([
						tokenBefore.range[0],
						parent.range[1],
					]);
				}

				// remove first unused declared variable when there are multiple declarations
				return fixer.removeRange([
					parent.range[0],
					getNextTokenEnd(parent),
				]);
			}

			// remove variables in object patterns
			if (parent.parent.type === "ObjectPattern") {
				if (parent.parent.properties.length === 1) {
					// fix [a, ...{b}]
					if (parent.parent.parent.type === "RestElement") {
						return fixRestInPattern(parent.parent.parent);
					}

					// fix [{ a }]
					if (parent.parent.parent.type === "ArrayPattern") {
						return fixNestedArrayVariable(parent.parent);
					}

					/*
					 * var {a} = foo;
					 * function a({a}) {}
					 * fix const { a: { b } } = foo;
					 */
					return fixVariables(parent.parent);
				}

				// fix const { a:b } = foo;
				if (tokenBefore.value === ":") {
					// remove first unused variable in const { a:b } = foo;
					if (
						getTokenBeforeValue(parent) === "{" &&
						getTokenAfterValue(parent) === ","
					) {
						return fixer.removeRange([
							parent.range[0],
							getNextTokenEnd(parent),
						]);
					}

					// remove unused variables in const { a: b, c: d } = foo; except first one
					return fixer.removeRange([
						getPreviousTokenStart(parent),
						id.range[1],
					]);
				}
			}

			// remove unused variables inside an array
			if (parentType === "ArrayPattern") {
				if (hasSingleElement(parent)) {
					// fix [a, ...[b]]
					if (parent.parent.type === "RestElement") {
						return fixRestInPattern(parent.parent);
					}

					// fix [ [a] ]
					if (parent.parent.type === "ArrayPattern") {
						return fixNestedArrayVariable(parent);
					}

					/*
					 * fix var [a] = foo;
					 * fix function foo([a]) {}
					 * fix const { a: [b] } = foo;
					 */
					return fixVariables(parent);
				}

				// if "a" is unused in [a, b ,c] fixes to [, b, c]
				if (tokenBefore.value === "," && tokenAfter.value === ",") {
					return fixer.removeRange(id.range);
				}
			}

			// remove unused rest elements
			if (parentType === "RestElement") {
				// fix [a, ...rest]
				if (parent.parent.type === "ArrayPattern") {
					if (hasSingleElement(parent.parent)) {
						// fix [[...rest]] when there is only rest element
						if (parent.parent.parent.type === "ArrayPattern") {
							return fixNestedArrayVariable(parent.parent);
						}

						// fix 'const [...rest] = foo;' and 'function foo([...rest]) {}'
						return fixVariables(parent.parent);
					}

					// fix [a, ...rest]
					return fixer.removeRange([
						getPreviousTokenStart(id, 1),
						id.range[1],
					]);
				}

				// fix { a, ...rest}
				if (parent.parent.type === "ObjectPattern") {
					// fix 'const {...rest} = foo;' and 'function foo({...rest}) {}'
					if (parent.parent.properties.length === 1) {
						return fixVariables(parent.parent);
					}

					// fix { a, ...rest} when there are multiple properties
					return fixer.removeRange([
						getPreviousTokenStart(id, 1),
						id.range[1],
					]);
				}

				// fix function foo(...rest) {}
				if (isFunction(parent.parent)) {
					// remove unused rest in function parameter if there is only single parameter
					if (parent.parent.params.length === 1) {
						return fixer.removeRange(parent.range);
					}

					// remove unused rest in function parameter if there multiple parameter
					return fixer.removeRange([
						getPreviousTokenStart(parent),
						parent.range[1],
					]);
				}
			}

			if (parentType === "AssignmentPattern") {
				// fix [a = aDefault]
				if (parent.parent.type === "ArrayPattern") {
					return fixNestedArrayVariable(parent);
				}

				// fix {a = aDefault}
				if (parent.parent.parent.type === "ObjectPattern") {
					if (parent.parent.parent.properties.length === 1) {
						// fixes [{a = aDefault}]
						if (
							parent.parent.parent.parent.type === "ArrayPattern"
						) {
							return fixNestedArrayVariable(parent.parent.parent);
						}

						// fix 'const {a = aDefault} = foo;' and 'function foo({a = aDefault}) {}'
						return fixVariables(parent.parent.parent);
					}

					// fix unused 'a' in {a = aDefault} if it is the first property
					if (
						getTokenBeforeValue(parent.parent) === "{" &&
						getTokenAfterValue(parent.parent) === ","
					) {
						return fixer.removeRange([
							parent.parent.range[0],
							getNextTokenEnd(parent.parent),
						]);
					}

					// fix unused 'b' in {a, b = aDefault} if it is not the first property
					return fixer.removeRange([
						getPreviousTokenStart(parent.parent),
						parent.parent.range[1],
					]);
				}

				// fix unused assignment patterns in function parameters
				if (isFunction(parent.parent)) {
					return fixFunctionParameters(parent);
				}
			}

			// remove unused functions
			if (parentType === "FunctionDeclaration" && parent.id === id) {
				return fixer.removeRange(parent.range);
			}

			// remove unused default import
			if (parentType === "ImportDefaultSpecifier") {
				// remove unused default import when there are not other imports
				if (
					!hasImportOfCertainType(parent.parent, "ImportSpecifier") &&
					!hasImportOfCertainType(
						parent.parent,
						"ImportNamespaceSpecifier",
					)
				) {
					return fixer.removeRange([
						parent.range[0],
						parent.parent.source.range[0],
					]);
				}

				// remove unused default import when there are other imports also
				return fixer.removeRange([id.range[0], tokenAfter.range[1]]);
			}

			if (parentType === "ImportSpecifier") {
				// remove unused imports when there is a single import
				if (
					parent.parent.specifiers.filter(
						e => e.type === "ImportSpecifier",
					).length === 1
				) {
					// remove unused import when there is no default import
					if (
						!hasImportOfCertainType(
							parent.parent,
							"ImportDefaultSpecifier",
						)
					) {
						return fixer.removeRange(parent.parent.range);
					}

					// fixes "import foo from 'module';" to "import 'module';"
					return fixer.removeRange([
						getPreviousTokenStart(parent, 1),
						tokenAfter.range[1],
					]);
				}

				if (getTokenBeforeValue(parent) === "{") {
					return fixer.removeRange([
						parent.range[0],
						getNextTokenEnd(parent),
					]);
				}

				return fixer.removeRange([
					getPreviousTokenStart(parent),
					parent.range[1],
				]);
			}

			if (parentType === "ImportNamespaceSpecifier") {
				if (
					hasImportOfCertainType(
						parent.parent,
						"ImportDefaultSpecifier",
					)
				) {
					return fixer.removeRange([
						getPreviousTokenStart(parent),
						parent.range[1],
					]);
				}

				// fixes "import * as foo from 'module';" to "import 'module';"
				return fixer.removeRange([
					parent.range[0],
					parent.parent.source.range[0],
				]);
			}

			// skip error in catch(error) variable
			if (parentType === "CatchClause") {
				return null;
			}

			// remove unused declared classes
			if (parentType === "ClassDeclaration") {
				return fixer.removeRange(parent.range);
			}

			// remove unused variable that is in a sequence [a,b] fixes to [a]
			if (tokenBefore?.value === ",") {
				return fixer.removeRange([tokenBefore.range[0], id.range[1]]);
			}

			// remove unused variable that is in a sequence inside function arguments and object pattern
			if (tokenAfter.value === ",") {
				// fix function foo(a, b) {}
				if (tokenBefore.value === "(") {
					return fixer.removeRange([
						id.range[0],
						tokenAfter.range[1],
					]);
				}

				// fix const {a, b} = foo;
				if (tokenBefore.value === "{") {
					return fixer.removeRange([
						id.range[0],
						tokenAfter.range[1],
					]);
				}
			}

			if (
				parentType === "ArrowFunctionExpression" &&
				parent.params.length === 1 &&
				tokenAfter?.value !== ")"
			) {
				return fixer.replaceText(id, "()");
			}

			return fixer.removeRange(id.range);
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			"Program:exit"(programNode) {
				const unusedVars = collectUnusedVariables(
					sourceCode.getScope(programNode),
					[],
				);

				for (let i = 0, l = unusedVars.length; i < l; ++i) {
					const unusedVar = unusedVars[i];

					// Report the first declaration.
					if (unusedVar.defs.length > 0) {
						// report last write reference, https://github.com/eslint/eslint/issues/14324
						const writeReferences = unusedVar.references.filter(
							ref =>
								ref.isWrite() &&
								ref.from.variableScope ===
									unusedVar.scope.variableScope,
						);

						let referenceToReport;

						if (writeReferences.length > 0) {
							referenceToReport = writeReferences.at(-1);
						}

						context.report({
							node: referenceToReport
								? referenceToReport.identifier
								: unusedVar.identifiers[0],
							messageId: "unusedVar",
							data: unusedVar.references.some(ref =>
								ref.isWrite(),
							)
								? getAssignedMessageData(unusedVar)
								: getDefinedMessageData(unusedVar),
							suggest: [
								{
									messageId: "removeVar",
									data: {
										varName: unusedVar.name,
									},
									fix(fixer) {
										return handleFixes(fixer, unusedVar);
									},
								},
							],
						});

						// If there are no regular declaration, report the first `/*globals*/` comment directive.
					} else if (unusedVar.eslintExplicitGlobalComments) {
						const directiveComment =
							unusedVar.eslintExplicitGlobalComments[0];

						context.report({
							node: programNode,
							loc: astUtils.getNameLocationInGlobalDirectiveComment(
								sourceCode,
								directiveComment,
								unusedVar.name,
							),
							messageId: "unusedVar",
							data: getDefinedMessageData(unusedVar),
						});
					}
				}
			},
		};
	},
};
 6_@x,//**
 * @fileoverview Rule to flag use of variables before they are defined
 * @author Ilya Volodin
 */

"use strict";

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @typedef {import("eslint-scope").Scope} Scope */
/** @typedef {import("eslint-scope").Reference} Reference */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const SENTINEL_TYPE =
	/^(?:(?:Function|Class)(?:Declaration|Expression)|ArrowFunctionExpression|CatchClause|ImportDeclaration|ExportNamedDeclaration)$/u;
const FOR_IN_OF_TYPE = /^For(?:In|Of)Statement$/u;

/**
 * Parses a given value as options.
 * @param {any} options A value to parse.
 * @returns {Object} The parsed options.
 */
function parseOptions(options) {
	if (typeof options === "object" && options !== null) {
		return options;
	}

	const functions = typeof options === "string" ? options !== "nofunc" : true;

	return {
		functions,
		classes: true,
		variables: true,
		allowNamedExports: false,
		enums: true,
		typedefs: true,
		ignoreTypeReferences: true,
	};
}

/**
 * Checks whether or not a given location is inside of the range of a given node.
 * @param {ASTNode} node An node to check.
 * @param {number} location A location to check.
 * @returns {boolean} `true` if the location is inside of the range of the node.
 */
function isInRange(node, location) {
	return node && node.range[0] <= location && location <= node.range[1];
}

/**
 * Checks whether or not a given location is inside of the range of a class static initializer.
 * Static initializers are static blocks and initializers of static fields.
 * @param {ASTNode} node `ClassBody` node to check static initializers.
 * @param {number} location A location to check.
 * @returns {boolean} `true` if the location is inside of a class static initializer.
 */
function isInClassStaticInitializerRange(node, location) {
	return node.body.some(
		classMember =>
			(classMember.type === "StaticBlock" &&
				isInRange(classMember, location)) ||
			(classMember.type === "PropertyDefinition" &&
				classMember.static &&
				classMember.value &&
				isInRange(classMember.value, location)),
	);
}

/**
 * Checks whether a given scope is the scope of a class static initializer.
 * Static initializers are static blocks and initializers of static fields.
 * @param {Scope} scope A scope to check.
 * @returns {boolean} `true` if the scope is a class static initializer scope.
 */
function isClassStaticInitializerScope(scope) {
	if (scope.type === "class-static-block") {
		return true;
	}

	if (scope.type === "class-field-initializer") {
		// `scope.block` is PropertyDefinition#value node
		const propertyDefinition = scope.block.parent;

		return propertyDefinition.static;
	}

	return false;
}

/**
 * Checks whether a given reference is evaluated in an execution context
 * that isn't the one where the variable it refers to is defined.
 * Execution contexts are:
 * - top-level
 * - functions
 * - class field initializers (implicit functions)
 * - class static blocks (implicit functions)
 * Static class field initializers and class static blocks are automatically run during the class definition evaluation,
 * and therefore we'll consider them as a part of the parent execution context.
 * Example:
 *
 *   const x = 1;
 *
 *   x; // returns `false`
 *   () => x; // returns `true`
 *
 *   class C {
 *       field = x; // returns `true`
 *       static field = x; // returns `false`
 *
 *       method() {
 *           x; // returns `true`
 *       }
 *
 *       static method() {
 *           x; // returns `true`
 *       }
 *
 *       static {
 *           x; // returns `false`
 *       }
 *   }
 * @param {Reference} reference A reference to check.
 * @returns {boolean} `true` if the reference is from a separate execution context.
 */
function isFromSeparateExecutionContext(reference) {
	const variable = reference.resolved;
	let scope = reference.from;

	// Scope#variableScope represents execution context
	while (variable.scope.variableScope !== scope.variableScope) {
		if (isClassStaticInitializerScope(scope.variableScope)) {
			scope = scope.variableScope.upper;
		} else {
			return true;
		}
	}

	return false;
}

/**
 * Checks whether or not a given reference is evaluated during the initialization of its variable.
 *
 * This returns `true` in the following cases:
 *
 *     var a = a
 *     var [a = a] = list
 *     var {a = a} = obj
 *     for (var a in a) {}
 *     for (var a of a) {}
 *     var C = class { [C]; };
 *     var C = class { static foo = C; };
 *     var C = class { static { foo = C; } };
 *     class C extends C {}
 *     class C extends (class { static foo = C; }) {}
 *     class C { [C]; }
 * @param {Reference} reference A reference to check.
 * @returns {boolean} `true` if the reference is evaluated during the initialization.
 */
function isEvaluatedDuringInitialization(reference) {
	if (isFromSeparateExecutionContext(reference)) {
		/*
		 * Even if the reference appears in the initializer, it isn't evaluated during the initialization.
		 * For example, `const x = () => x;` is valid.
		 */
		return false;
	}

	const location = reference.identifier.range[1];
	const definition = reference.resolved.defs[0];

	if (definition.type === "ClassName") {
		// `ClassDeclaration` or `ClassExpression`
		const classDefinition = definition.node;

		return (
			isInRange(classDefinition, location) &&
			/*
			 * Class binding is initialized before running static initializers.
			 * For example, `class C { static foo = C; static { bar = C; } }` is valid.
			 */
			!isInClassStaticInitializerRange(classDefinition.body, location)
		);
	}

	let node = definition.name.parent;

	while (node) {
		if (node.type === "VariableDeclarator") {
			if (isInRange(node.init, location)) {
				return true;
			}
			if (
				FOR_IN_OF_TYPE.test(node.parent.parent.type) &&
				isInRange(node.parent.parent.right, location)
			) {
				return true;
			}
			break;
		} else if (node.type === "AssignmentPattern") {
			if (isInRange(node.right, location)) {
				return true;
			}
		} else if (SENTINEL_TYPE.test(node.type)) {
			break;
		}

		node = node.parent;
	}

	return false;
}

/**
 * check whether the reference contains a type query.
 * @param {ASTNode} node Identifier node to check.
 * @returns {boolean} true if reference contains type query.
 */
function referenceContainsTypeQuery(node) {
	switch (node.type) {
		case "TSTypeQuery":
			return true;

		case "TSQualifiedName":
		case "Identifier":
			return referenceContainsTypeQuery(node.parent);

		default:
			// if we find a different node, there's no chance that we're in a TSTypeQuery
			return false;
	}
}

/**
 * Decorators are transpiled such that the decorator is placed after the class declaration
 * So it is considered safe
 * @param {Variable} variable The variable to check.
 * @param {Reference} reference The reference to check.
 * @returns {boolean} `true` if the reference is in a class decorator.
 */
function isClassRefInClassDecorator(variable, reference) {
	if (variable.defs[0].type !== "ClassName") {
		return false;
	}

	if (
		!variable.defs[0].node.decorators ||
		variable.defs[0].node.decorators.length === 0
	) {
		return false;
	}

	for (const deco of variable.defs[0].node.decorators) {
		if (
			reference.identifier.range[0] >= deco.range[0] &&
			reference.identifier.range[1] <= deco.range[1]
		) {
			return true;
		}
	}

	return false;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description:
				"Disallow the use of variables before they are defined",
			dialects: ["JavaScript", "TypeScript"],
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-use-before-define",
		},

		schema: [
			{
				oneOf: [
					{
						enum: ["nofunc"],
					},
					{
						type: "object",
						properties: {
							functions: { type: "boolean" },
							classes: { type: "boolean" },
							variables: { type: "boolean" },
							allowNamedExports: { type: "boolean" },
							enums: { type: "boolean" },
							typedefs: { type: "boolean" },
							ignoreTypeReferences: { type: "boolean" },
						},
						additionalProperties: false,
					},
				],
			},
		],

		defaultOptions: [
			{
				classes: true,
				functions: true,
				variables: true,
				allowNamedExports: false,
				enums: true,
				typedefs: true,
				ignoreTypeReferences: true,
			},
		],

		messages: {
			usedBeforeDefined: "'{{name}}' was used before it was defined.",
		},
	},

	create(context) {
		const options = parseOptions(context.options[0]);
		const sourceCode = context.sourceCode;

		/**
		 * Determines whether a given reference should be checked.
		 *
		 * Returns `false` if the reference is:
		 * - initialization's (e.g., `let a = 1`).
		 * - referring to an undefined variable (i.e., if it's an unresolved reference).
		 * - referring to a variable that is defined, but not in the given source code
		 *   (e.g., global environment variable or `arguments` in functions).
		 * - allowed by options.
		 * @param {Reference} reference The reference
		 * @returns {boolean} `true` if the reference should be checked
		 */
		function shouldCheck(reference) {
			if (reference.init) {
				return false;
			}

			const { identifier } = reference;

			if (
				options.allowNamedExports &&
				identifier.parent.type === "ExportSpecifier" &&
				identifier.parent.local === identifier
			) {
				return false;
			}

			const variable = reference.resolved;

			if (!variable || variable.defs.length === 0) {
				return false;
			}

			const definitionType = variable.defs[0].type;

			if (!options.functions && definitionType === "FunctionName") {
				return false;
			}

			if (
				((!options.variables && definitionType === "Variable") ||
					(!options.classes && definitionType === "ClassName")) &&
				// don't skip checking the reference if it's in the same execution context, because of TDZ
				isFromSeparateExecutionContext(reference)
			) {
				return false;
			}

			if (!options.enums && definitionType === "TSEnumName") {
				return false;
			}

			if (!options.typedefs && definitionType === "Type") {
				return false;
			}

			if (
				options.ignoreTypeReferences &&
				(referenceContainsTypeQuery(identifier) ||
					identifier.parent.type === "TSTypeReference")
			) {
				return false;
			}

			// skip nested namespace aliases as variable references
			if (identifier.parent.type === "TSQualifiedName") {
				let currentNode = identifier.parent;

				while (currentNode.type === "TSQualifiedName") {
					currentNode = currentNode.left;
				}

				if (currentNode === identifier) {
					return true;
				}

				return false;
			}

			if (isClassRefInClassDecorator(variable, reference)) {
				return false;
			}

			return true;
		}

		/**
		 * Finds and validates all references in a given scope and its child scopes.
		 * @param {Scope} scope The scope object.
		 * @returns {void}
		 */
		function checkReferencesInScope(scope) {
			scope.references.filter(shouldCheck).forEach(reference => {
				const variable = reference.resolved;
				const definitionIdentifier = variable.defs[0].name;

				if (
					reference.identifier.range[1] <
						definitionIdentifier.range[1] ||
					(isEvaluatedDuringInitialization(reference) &&
						reference.identifier.parent.type !== "TSTypeReference")
				) {
					context.report({
						node: reference.identifier,
						messageId: "usedBeforeDefined",
						data: reference.identifier,
					});
				}
			});

			scope.childScopes.forEach(checkReferencesInScope);
		}

		return {
			Program(node) {
				checkReferencesInScope(sourceCode.getScope(node));
			},
		};
	},
};
Ϳ	xL/**
 * @fileoverview A rule to disallow unnecessary assignments`.
 * @author Yosuke Ota
 */

"use strict";

const { findVariable } = require("@eslint-community/eslint-utils");

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @typedef {import("estree").Node} ASTNode */
/** @typedef {import("estree").Pattern} Pattern */
/** @typedef {import("estree").Identifier} Identifier */
/** @typedef {import("estree").VariableDeclarator} VariableDeclarator */
/** @typedef {import("estree").AssignmentExpression} AssignmentExpression */
/** @typedef {import("estree").UpdateExpression} UpdateExpression */
/** @typedef {import("estree").Expression} Expression */
/** @typedef {import("eslint-scope").Scope} Scope */
/** @typedef {import("eslint-scope").Variable} Variable */
/** @typedef {import("../linter/code-path-analysis/code-path")} CodePath */
/** @typedef {import("../linter/code-path-analysis/code-path-segment")} CodePathSegment */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Extract identifier from the given pattern node used on the left-hand side of the assignment.
 * @param {Pattern} pattern The pattern node to extract identifier
 * @returns {Iterable<Identifier>} The extracted identifier
 */
function* extractIdentifiersFromPattern(pattern) {
	switch (pattern.type) {
		case "Identifier":
			yield pattern;
			return;
		case "ObjectPattern":
			for (const property of pattern.properties) {
				yield* extractIdentifiersFromPattern(
					property.type === "Property" ? property.value : property,
				);
			}
			return;
		case "ArrayPattern":
			for (const element of pattern.elements) {
				if (!element) {
					continue;
				}
				yield* extractIdentifiersFromPattern(element);
			}
			return;
		case "RestElement":
			yield* extractIdentifiersFromPattern(pattern.argument);
			return;
		case "AssignmentPattern":
			yield* extractIdentifiersFromPattern(pattern.left);

		// no default
	}
}

/**
 * Checks whether the given identifier node is evaluated after the assignment identifier.
 * @param {AssignmentInfo} assignment The assignment info.
 * @param {Identifier} identifier The identifier to check.
 * @returns {boolean} `true` if the given identifier node is evaluated after the assignment identifier.
 */
function isIdentifierEvaluatedAfterAssignment(assignment, identifier) {
	if (identifier.range[0] < assignment.identifier.range[1]) {
		return false;
	}
	if (
		assignment.expression &&
		assignment.expression.range[0] <= identifier.range[0] &&
		identifier.range[1] <= assignment.expression.range[1]
	) {
		/*
		 * The identifier node is in an expression that is evaluated before the assignment.
		 * e.g. x = id;
		 *          ^^ identifier to check
		 *      ^      assignment identifier
		 */
		return false;
	}

	/*
	 * e.g.
	 *      x = 42; id;
	 *              ^^ identifier to check
	 *      ^          assignment identifier
	 *      let { x, y = id } = obj;
	 *                   ^^  identifier to check
	 *            ^          assignment identifier
	 */
	return true;
}

/**
 * Checks whether the given identifier node is used between the assigned identifier and the equal sign.
 *
 * e.g. let { x, y = x } = obj;
 *                   ^   identifier to check
 *            ^          assigned identifier
 * @param {AssignmentInfo} assignment The assignment info.
 * @param {Identifier} identifier The identifier to check.
 * @returns {boolean} `true` if the given identifier node is used between the assigned identifier and the equal sign.
 */
function isIdentifierUsedBetweenAssignedAndEqualSign(assignment, identifier) {
	if (!assignment.expression) {
		return false;
	}
	return (
		assignment.identifier.range[1] <= identifier.range[0] &&
		identifier.range[1] <= assignment.expression.range[0]
	);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description:
				"Disallow variable assignments when the value is not used",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-useless-assignment",
		},

		schema: [],

		messages: {
			unnecessaryAssignment:
				"The value assigned to '{{name}}' is not used in subsequent statements.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		/**
		 * @typedef {Object} ScopeStack
		 * @property {CodePath} codePath The code path of this scope stack.
		 * @property {Scope} scope The scope of this scope stack.
		 * @property {ScopeStack} upper The upper scope stack.
		 * @property {Record<string, ScopeStackSegmentInfo>} segments The map of ScopeStackSegmentInfo.
		 * @property {Set<CodePathSegment>} currentSegments The current CodePathSegments.
		 * @property {Map<Variable, AssignmentInfo[]>} assignments The map of list of AssignmentInfo for each variable.
		 * @property {Array} tryStatementBlocks The array of TryStatement block nodes in this scope stack.
		 */
		/**
		 * @typedef {Object} ScopeStackSegmentInfo
		 * @property {CodePathSegment} segment The code path segment.
		 * @property {Identifier|null} first The first identifier that appears within the segment.
		 * @property {Identifier|null} last The last identifier that appears within the segment.
		 * `first` and `last` are used to determine whether an identifier exists within the segment position range.
		 * Since it is used as a range of segments, we should originally hold all nodes, not just identifiers,
		 * but since the only nodes to be judged are identifiers, it is sufficient to have a range of identifiers.
		 */
		/**
		 * @typedef {Object} AssignmentInfo
		 * @property {Variable} variable The variable that is assigned.
		 * @property {Identifier} identifier The identifier that is assigned.
		 * @property {VariableDeclarator|AssignmentExpression|UpdateExpression} node The node where the variable was updated.
		 * @property {Expression|null} expression The expression that is evaluated before the assignment.
		 * @property {CodePathSegment[]} segments The code path segments where the assignment was made.
		 */

		/** @type {ScopeStack} */
		let scopeStack = null;

		/** @type {Set<Scope>} */
		const codePathStartScopes = new Set();

		/**
		 * Gets the scope of code path start from given scope
		 * @param {Scope} scope The initial scope
		 * @returns {Scope} The scope of code path start
		 * @throws {Error} Unexpected error
		 */
		function getCodePathStartScope(scope) {
			let target = scope;

			while (target) {
				if (codePathStartScopes.has(target)) {
					return target;
				}
				target = target.upper;
			}

			// Should be unreachable
			return null;
		}

		/**
		 * Verify the given scope stack.
		 * @param {ScopeStack} target The scope stack to verify.
		 * @returns {void}
		 */
		function verify(target) {
			/**
			 * Checks whether the given identifier is used in the segment.
			 * @param {CodePathSegment} segment The code path segment.
			 * @param {Identifier} identifier The identifier to check.
			 * @returns {boolean} `true` if the identifier is used in the segment.
			 */
			function isIdentifierUsedInSegment(segment, identifier) {
				const segmentInfo = target.segments[segment.id];

				return (
					segmentInfo.first &&
					segmentInfo.last &&
					segmentInfo.first.range[0] <= identifier.range[0] &&
					identifier.range[1] <= segmentInfo.last.range[1]
				);
			}

			/**
			 * Verifies whether the given assignment info is an used assignment.
			 * Report if it is an unused assignment.
			 * @param {AssignmentInfo} targetAssignment The assignment info to verify.
			 * @param {AssignmentInfo[]} allAssignments The list of all assignment info for variables.
			 * @returns {void}
			 */
			function verifyAssignmentIsUsed(targetAssignment, allAssignments) {
				// Skip assignment if it is in a try block.
				const isAssignmentInTryBlock = target.tryStatementBlocks.some(
					tryBlock =>
						tryBlock.range[0] <=
							targetAssignment.identifier.range[0] &&
						targetAssignment.identifier.range[1] <=
							tryBlock.range[1],
				);

				if (isAssignmentInTryBlock) {
					return;
				}

				/**
				 * @typedef {Object} SubsequentSegmentData
				 * @property {CodePathSegment} segment The code path segment
				 * @property {AssignmentInfo} [assignment] The first occurrence of the assignment within the segment.
				 * There is no need to check if the variable is used after this assignment,
				 * as the value it was assigned will be used.
				 */

				/**
				 * Information used in `getSubsequentSegments()`.
				 * To avoid unnecessary iterations, cache information that has already been iterated over,
				 * and if additional iterations are needed, start iterating from the retained position.
				 */
				const subsequentSegmentData = {
					/**
					 * Cache of subsequent segment information list that have already been iterated.
					 * @type {SubsequentSegmentData[]}
					 */
					results: [],

					/**
					 * Subsequent segments that have already been iterated on. Used to avoid infinite loops.
					 * @type {Set<CodePathSegment>}
					 */
					subsequentSegments: new Set(),

					/**
					 * Unexplored code path segment.
					 * If additional iterations are needed, consume this information and iterate.
					 * @type {CodePathSegment[]}
					 */
					queueSegments: targetAssignment.segments.flatMap(
						segment => segment.nextSegments,
					),
				};

				/**
				 * Gets the subsequent segments from the segment of
				 * the assignment currently being validated (targetAssignment).
				 * @returns {Iterable<SubsequentSegmentData>} the subsequent segments
				 */
				function* getSubsequentSegments() {
					yield* subsequentSegmentData.results;

					while (subsequentSegmentData.queueSegments.length > 0) {
						const nextSegment =
							subsequentSegmentData.queueSegments.shift();

						if (
							subsequentSegmentData.subsequentSegments.has(
								nextSegment,
							)
						) {
							continue;
						}
						subsequentSegmentData.subsequentSegments.add(
							nextSegment,
						);

						const assignmentInSegment = allAssignments.find(
							otherAssignment =>
								otherAssignment.segments.includes(
									nextSegment,
								) &&
								!isIdentifierUsedBetweenAssignedAndEqualSign(
									otherAssignment,
									targetAssignment.identifier,
								),
						);

						if (!assignmentInSegment) {
							/*
							 * Stores the next segment to explore.
							 * If `assignmentInSegment` exists,
							 * we are guarding it because we don't need to explore the next segment.
							 */
							subsequentSegmentData.queueSegments.push(
								...nextSegment.nextSegments,
							);
						}

						/** @type {SubsequentSegmentData} */
						const result = {
							segment: nextSegment,
							assignment: assignmentInSegment,
						};

						subsequentSegmentData.results.push(result);
						yield result;
					}
				}

				if (
					targetAssignment.variable.references.some(ref => {
						const type = ref.identifier.type;
						return (
							type !== "Identifier" && type !== "JSXIdentifier"
						);
					})
				) {
					/**
					 * Skip checking for a variable that has at least one non-identifier reference.
					 * It's generated by plugins and cannot be handled reliably in the core rule.
					 */
					return;
				}

				const readReferences =
					targetAssignment.variable.references.filter(reference =>
						reference.isRead(),
					);

				if (!readReferences.length) {
					/*
					 * It is not just an unnecessary assignment, but an unnecessary (unused) variable
					 * and thus should not be reported by this rule because it is reported by `no-unused-vars`.
					 */
					return;
				}

				/**
				 * Other assignment on the current segment and after current assignment.
				 */
				const otherAssignmentAfterTargetAssignment =
					allAssignments.find(assignment => {
						if (
							assignment === targetAssignment ||
							(assignment.segments.length &&
								assignment.segments.every(
									segment =>
										!targetAssignment.segments.includes(
											segment,
										),
								))
						) {
							return false;
						}
						if (
							isIdentifierEvaluatedAfterAssignment(
								targetAssignment,
								assignment.identifier,
							)
						) {
							return true;
						}
						if (
							assignment.expression &&
							assignment.expression.range[0] <=
								targetAssignment.identifier.range[0] &&
							targetAssignment.identifier.range[1] <=
								assignment.expression.range[1]
						) {
							/*
							 * The target assignment is in an expression that is evaluated before the assignment.
							 * e.g. x=(x=1);
							 *         ^^^ targetAssignment
							 *      ^^^^^^^ assignment
							 */
							return true;
						}

						return false;
					});

				for (const reference of readReferences) {
					/*
					 * If the scope of the reference is outside the current code path scope,
					 * we cannot track whether this assignment is not used.
					 * For example, it can also be called asynchronously.
					 */
					if (
						target.scope !== getCodePathStartScope(reference.from)
					) {
						return;
					}

					// Checks if it is used in the same segment as the target assignment.
					if (
						isIdentifierEvaluatedAfterAssignment(
							targetAssignment,
							reference.identifier,
						) &&
						(isIdentifierUsedBetweenAssignedAndEqualSign(
							targetAssignment,
							reference.identifier,
						) ||
							targetAssignment.segments.some(segment =>
								isIdentifierUsedInSegment(
									segment,
									reference.identifier,
								),
							))
					) {
						if (
							otherAssignmentAfterTargetAssignment &&
							isIdentifierEvaluatedAfterAssignment(
								otherAssignmentAfterTargetAssignment,
								reference.identifier,
							)
						) {
							// There was another assignment before the reference. Therefore, it has not been used yet.
							continue;
						}

						// Uses in statements after the written identifier.
						return;
					}

					if (otherAssignmentAfterTargetAssignment) {
						/*
						 * The assignment was followed by another assignment in the same segment.
						 * Therefore, there is no need to check the next segment.
						 */
						continue;
					}

					// Check subsequent segments.
					for (const subsequentSegment of getSubsequentSegments()) {
						if (
							isIdentifierUsedInSegment(
								subsequentSegment.segment,
								reference.identifier,
							)
						) {
							if (
								subsequentSegment.assignment &&
								isIdentifierEvaluatedAfterAssignment(
									subsequentSegment.assignment,
									reference.identifier,
								)
							) {
								// There was another assignment before the reference. Therefore, it has not been used yet.
								continue;
							}

							// It is used
							return;
						}
					}
				}
				context.report({
					node: targetAssignment.identifier,
					messageId: "unnecessaryAssignment",
					data: { name: targetAssignment.identifier.name },
				});
			}

			// Verify that each assignment in the code path is used.
			for (const assignments of target.assignments.values()) {
				assignments.sort(
					(a, b) => a.identifier.range[0] - b.identifier.range[0],
				);
				for (const assignment of assignments) {
					verifyAssignmentIsUsed(assignment, assignments);
				}
			}
		}

		return {
			onCodePathStart(codePath, node) {
				const scope = sourceCode.getScope(node);

				scopeStack = {
					upper: scopeStack,
					codePath,
					scope,
					segments: Object.create(null),
					currentSegments: new Set(),
					assignments: new Map(),
					tryStatementBlocks: [],
				};
				codePathStartScopes.add(scopeStack.scope);
			},
			onCodePathEnd() {
				verify(scopeStack);

				scopeStack = scopeStack.upper;
			},
			onCodePathSegmentStart(segment) {
				const segmentInfo = { segment, first: null, last: null };

				scopeStack.segments[segment.id] = segmentInfo;
				scopeStack.currentSegments.add(segment);
			},
			onCodePathSegmentEnd(segment) {
				scopeStack.currentSegments.delete(segment);
			},
			TryStatement(node) {
				scopeStack.tryStatementBlocks.push(node.block);
			},
			"Identifier, JSXIdentifier"(node) {
				for (const segment of scopeStack.currentSegments) {
					const segmentInfo = scopeStack.segments[segment.id];

					if (!segmentInfo.first) {
						segmentInfo.first = node;
					}
					segmentInfo.last = node;
				}
			},
			"VariableDeclarator[init!=null], AssignmentExpression, UpdateExpression:exit"(
				node,
			) {
				if (scopeStack.currentSegments.size === 0) {
					// Ignore unreachable segments
					return;
				}

				const assignments = scopeStack.assignments;

				let pattern;
				let expression = null;

				if (node.type === "VariableDeclarator") {
					pattern = node.id;
					expression = node.init;
				} else if (node.type === "AssignmentExpression") {
					pattern = node.left;
					expression = node.right;
				} else {
					// UpdateExpression
					pattern = node.argument;
				}

				for (const identifier of extractIdentifiersFromPattern(
					pattern,
				)) {
					const scope = sourceCode.getScope(identifier);

					/** @type {Variable} */
					const variable = findVariable(scope, identifier);

					if (!variable) {
						continue;
					}

					// We don't know where global variables are used.
					if (
						variable.scope.type === "global" &&
						variable.defs.length === 0
					) {
						continue;
					}

					/*
					 * If the scope of the variable is outside the current code path scope,
					 * we cannot track whether this assignment is not used.
					 */
					if (
						scopeStack.scope !==
						getCodePathStartScope(variable.scope)
					) {
						continue;
					}

					// Variables marked by `markVariableAsUsed()` or
					// exported by "exported" block comment.
					if (variable.eslintUsed) {
						continue;
					}

					// Variables exported by ESM export syntax
					if (variable.scope.type === "module") {
						if (
							variable.defs.some(
								def =>
									(def.type === "Variable" &&
										def.parent.parent.type ===
											"ExportNamedDeclaration") ||
									(def.type === "FunctionName" &&
										(def.node.parent.type ===
											"ExportNamedDeclaration" ||
											def.node.parent.type ===
												"ExportDefaultDeclaration")) ||
									(def.type === "ClassName" &&
										(def.node.parent.type ===
											"ExportNamedDeclaration" ||
											def.node.parent.type ===
												"ExportDefaultDeclaration")),
							)
						) {
							continue;
						}
						if (
							variable.references.some(
								reference =>
									reference.identifier.parent.type ===
									"ExportSpecifier",
							)
						) {
							// It have `export { ... }` reference.
							continue;
						}
					}

					let list = assignments.get(variable);

					if (!list) {
						list = [];
						assignments.set(variable, list);
					}
					list.push({
						variable,
						identifier,
						node,
						expression,
						segments: [...scopeStack.currentSegments],
					});
				}
			},
		};
	},
};
tq[x/**
 * @fileoverview Rule to disallow useless backreferences in regular expressions
 * @author Milos Djermanovic
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const {
	CALL,
	CONSTRUCT,
	ReferenceTracker,
	getStringIfConstant,
} = require("@eslint-community/eslint-utils");
const { RegExpParser, visitRegExpAST } = require("@eslint-community/regexpp");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const parser = new RegExpParser();

/**
 * Finds the path from the given `regexpp` AST node to the root node.
 * @param {regexpp.Node} node Node.
 * @returns {regexpp.Node[]} Array that starts with the given node and ends with the root node.
 */
function getPathToRoot(node) {
	const path = [];
	let current = node;

	do {
		path.push(current);
		current = current.parent;
	} while (current);

	return path;
}

/**
 * Determines whether the given `regexpp` AST node is a lookaround node.
 * @param {regexpp.Node} node Node.
 * @returns {boolean} `true` if it is a lookaround node.
 */
function isLookaround(node) {
	return (
		node.type === "Assertion" &&
		(node.kind === "lookahead" || node.kind === "lookbehind")
	);
}

/**
 * Determines whether the given `regexpp` AST node is a negative lookaround node.
 * @param {regexpp.Node} node Node.
 * @returns {boolean} `true` if it is a negative lookaround node.
 */
function isNegativeLookaround(node) {
	return isLookaround(node) && node.negate;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		docs: {
			description:
				"Disallow useless backreferences in regular expressions",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-useless-backreference",
		},

		schema: [],

		messages: {
			nested: "Backreference '{{ bref }}' will be ignored. It references group '{{ group }}'{{ otherGroups }} from within that group.",
			forward:
				"Backreference '{{ bref }}' will be ignored. It references group '{{ group }}'{{ otherGroups }} which appears later in the pattern.",
			backward:
				"Backreference '{{ bref }}' will be ignored. It references group '{{ group }}'{{ otherGroups }} which appears before in the same lookbehind.",
			disjunctive:
				"Backreference '{{ bref }}' will be ignored. It references group '{{ group }}'{{ otherGroups }} which is in another alternative.",
			intoNegativeLookaround:
				"Backreference '{{ bref }}' will be ignored. It references group '{{ group }}'{{ otherGroups }} which is in a negative lookaround.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		/**
		 * Checks and reports useless backreferences in the given regular expression.
		 * @param {ASTNode} node Node that represents regular expression. A regex literal or RegExp constructor call.
		 * @param {string} pattern Regular expression pattern.
		 * @param {string} flags Regular expression flags.
		 * @returns {void}
		 */
		function checkRegex(node, pattern, flags) {
			let regExpAST;

			try {
				regExpAST = parser.parsePattern(pattern, 0, pattern.length, {
					unicode: flags.includes("u"),
					unicodeSets: flags.includes("v"),
				});
			} catch {
				// Ignore regular expressions with syntax errors
				return;
			}

			visitRegExpAST(regExpAST, {
				onBackreferenceEnter(bref) {
					const groups = [bref.resolved].flat(),
						brefPath = getPathToRoot(bref);

					const problems = groups.map(group => {
						const groupPath = getPathToRoot(group);

						if (brefPath.includes(group)) {
							// group is bref's ancestor => bref is nested ('nested reference') => group hasn't matched yet when bref starts to match.
							return {
								messageId: "nested",
								group,
							};
						}

						// Start from the root to find the lowest common ancestor.
						let i = brefPath.length - 1,
							j = groupPath.length - 1;

						do {
							i--;
							j--;
						} while (brefPath[i] === groupPath[j]);

						const indexOfLowestCommonAncestor = j + 1,
							groupCut = groupPath.slice(
								0,
								indexOfLowestCommonAncestor,
							),
							commonPath = groupPath.slice(
								indexOfLowestCommonAncestor,
							),
							lowestCommonLookaround =
								commonPath.find(isLookaround),
							isMatchingBackward =
								lowestCommonLookaround &&
								lowestCommonLookaround.kind === "lookbehind";

						if (groupCut.at(-1).type === "Alternative") {
							// group's and bref's ancestor nodes below the lowest common ancestor are sibling alternatives => they're disjunctive.
							return {
								messageId: "disjunctive",
								group,
							};
						}
						if (!isMatchingBackward && bref.end <= group.start) {
							// bref is left, group is right ('forward reference') => group hasn't matched yet when bref starts to match.
							return {
								messageId: "forward",
								group,
							};
						}
						if (isMatchingBackward && group.end <= bref.start) {
							// the opposite of the previous when the regex is matching backward in a lookbehind context.
							return {
								messageId: "backward",
								group,
							};
						}
						if (groupCut.some(isNegativeLookaround)) {
							// group is in a negative lookaround which isn't bref's ancestor => group has already failed when bref starts to match.
							return {
								messageId: "intoNegativeLookaround",
								group,
							};
						}

						return null;
					});

					if (
						problems.length === 0 ||
						problems.some(problem => !problem)
					) {
						// If there are no problems or no problems with any group then do not report it.
						return;
					}

					let problemsToReport;

					// Gets problems that appear in the same disjunction.
					const problemsInSameDisjunction = problems.filter(
						problem => problem.messageId !== "disjunctive",
					);

					if (problemsInSameDisjunction.length) {
						// Only report problems that appear in the same disjunction.
						problemsToReport = problemsInSameDisjunction;
					} else {
						// If all groups appear in different disjunctions, report it.
						problemsToReport = problems;
					}

					const [{ messageId, group }, ...other] = problemsToReport;
					let otherGroups = "";

					if (other.length === 1) {
						otherGroups = " and another group";
					} else if (other.length > 1) {
						otherGroups = ` and other ${other.length} groups`;
					}
					context.report({
						node,
						messageId,
						data: {
							bref: bref.raw,
							group: group.raw,
							otherGroups,
						},
					});
				},
			});
		}

		return {
			"Literal[regex]"(node) {
				const { pattern, flags } = node.regex;

				checkRegex(node, pattern, flags);
			},
			Program(node) {
				const scope = sourceCode.getScope(node),
					tracker = new ReferenceTracker(scope),
					traceMap = {
						RegExp: {
							[CALL]: true,
							[CONSTRUCT]: true,
						},
					};

				for (const { node: refNode } of tracker.iterateGlobalReferences(
					traceMap,
				)) {
					const [patternNode, flagsNode] = refNode.arguments,
						pattern = getStringIfConstant(patternNode, scope),
						flags = getStringIfConstant(flagsNode, scope);

					if (typeof pattern === "string") {
						checkRegex(refNode, pattern, flags || "");
					}
				}
			},
		};
	},
};
Yjx
$/**
 * @fileoverview A rule to disallow unnecessary `.call()` and `.apply()`.
 * @author Toru Nagashima
 */

"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Checks whether or not a node is a `.call()`/`.apply()`.
 * @param {ASTNode} node A CallExpression node to check.
 * @returns {boolean} Whether or not the node is a `.call()`/`.apply()`.
 */
function isCallOrNonVariadicApply(node) {
	const callee = astUtils.skipChainExpression(node.callee);

	return (
		callee.type === "MemberExpression" &&
		callee.property.type === "Identifier" &&
		callee.computed === false &&
		((callee.property.name === "call" && node.arguments.length >= 1) ||
			(callee.property.name === "apply" &&
				node.arguments.length === 2 &&
				node.arguments[1].type === "ArrayExpression"))
	);
}

/**
 * Checks whether or not `thisArg` is not changed by `.call()`/`.apply()`.
 * @param {ASTNode|null} expectedThis The node that is the owner of the applied function.
 * @param {ASTNode} thisArg The node that is given to the first argument of the `.call()`/`.apply()`.
 * @param {SourceCode} sourceCode The ESLint source code object.
 * @returns {boolean} Whether or not `thisArg` is not changed by `.call()`/`.apply()`.
 */
function isValidThisArg(expectedThis, thisArg, sourceCode) {
	if (!expectedThis) {
		return astUtils.isNullOrUndefined(thisArg);
	}
	return astUtils.equalTokens(expectedThis, thisArg, sourceCode);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Disallow unnecessary calls to `.call()` and `.apply()`",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-useless-call",
		},

		schema: [],

		messages: {
			unnecessaryCall: "Unnecessary '.{{name}}()'.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		return {
			CallExpression(node) {
				if (!isCallOrNonVariadicApply(node)) {
					return;
				}

				const callee = astUtils.skipChainExpression(node.callee);
				const applied = astUtils.skipChainExpression(callee.object);
				const expectedThis =
					applied.type === "MemberExpression" ? applied.object : null;
				const thisArg = node.arguments[0];

				if (isValidThisArg(expectedThis, thisArg, sourceCode)) {
					context.report({
						node,
						messageId: "unnecessaryCall",
						data: { name: callee.property.name },
					});
				}
			},
		};
	},
};
QQx/**
 * @fileoverview Reports useless `catch` clauses that just rethrow their error.
 * @author Teddy Katz
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow unnecessary `catch` clauses",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-useless-catch",
		},

		schema: [],

		messages: {
			unnecessaryCatchClause: "Unnecessary catch clause.",
			unnecessaryCatch: "Unnecessary try/catch wrapper.",
		},
	},

	create(context) {
		return {
			CatchClause(node) {
				if (
					node.param &&
					node.param.type === "Identifier" &&
					node.body.body.length &&
					node.body.body[0].type === "ThrowStatement" &&
					node.body.body[0].argument.type === "Identifier" &&
					node.body.body[0].argument.name === node.param.name
				) {
					if (node.parent.finalizer) {
						context.report({
							node,
							messageId: "unnecessaryCatchClause",
						});
					} else {
						context.report({
							node: node.parent,
							messageId: "unnecessaryCatch",
						});
					}
				}
			},
		};
	},
};
\]u8x0/**
 * @fileoverview Rule to disallow unnecessary computed property keys in object literals
 * @author Burak Yigit Kaya
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Determines whether the computed key syntax is unnecessarily used for the given node.
 * In particular, it determines whether removing the square brackets and using the content between them
 * directly as the key (e.g. ['foo'] -> 'foo') would produce valid syntax and preserve the same behavior.
 * Valid non-computed keys are only: identifiers, number literals and string literals.
 * Only literals can preserve the same behavior, with a few exceptions for specific node types:
 * Property
 *   - { ["__proto__"]: foo } defines a property named "__proto__"
 *     { "__proto__": foo } defines object's prototype
 * PropertyDefinition
 *   - class C { ["constructor"]; } defines an instance field named "constructor"
 *     class C { "constructor"; } produces a parsing error
 *   - class C { static ["constructor"]; } defines a static field named "constructor"
 *     class C { static "constructor"; } produces a parsing error
 *   - class C { static ["prototype"]; } produces a runtime error (doesn't break the whole script)
 *     class C { static "prototype"; } produces a parsing error (breaks the whole script)
 * MethodDefinition
 *   - class C { ["constructor"]() {} } defines a prototype method named "constructor"
 *     class C { "constructor"() {} } defines the constructor
 *   - class C { static ["prototype"]() {} } produces a runtime error (doesn't break the whole script)
 *     class C { static "prototype"() {} } produces a parsing error (breaks the whole script)
 * @param {ASTNode} node The node to check. It can be `Property`, `PropertyDefinition` or `MethodDefinition`.
 * @throws {Error} (Unreachable.)
 * @returns {void} `true` if the node has useless computed key.
 */
function hasUselessComputedKey(node) {
	if (!node.computed) {
		return false;
	}

	const { key } = node;

	if (key.type !== "Literal") {
		return false;
	}

	const { value } = key;

	if (typeof value !== "number" && typeof value !== "string") {
		return false;
	}

	switch (node.type) {
		case "Property":
			if (node.parent.type === "ObjectExpression") {
				return value !== "__proto__";
			}
			return true;

		case "PropertyDefinition":
			if (node.static) {
				return value !== "constructor" && value !== "prototype";
			}

			return value !== "constructor";

		case "MethodDefinition":
			if (node.static) {
				return value !== "prototype";
			}

			return value !== "constructor";

		/* c8 ignore next */
		default:
			throw new Error(`Unexpected node type: ${node.type}`);
	}
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				enforceForClassMembers: true,
			},
		],

		docs: {
			description:
				"Disallow unnecessary computed property keys in objects and classes",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/no-useless-computed-key",
		},

		schema: [
			{
				type: "object",
				properties: {
					enforceForClassMembers: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],
		fixable: "code",

		messages: {
			unnecessarilyComputedProperty:
				"Unnecessarily computed property [{{property}}] found.",
		},
	},
	create(context) {
		const sourceCode = context.sourceCode;
		const [{ enforceForClassMembers }] = context.options;

		/**
		 * Reports a given node if it violated this rule.
		 * @param {ASTNode} node The node to check.
		 * @returns {void}
		 */
		function check(node) {
			if (hasUselessComputedKey(node)) {
				const { key } = node;

				context.report({
					node,
					messageId: "unnecessarilyComputedProperty",
					data: { property: sourceCode.getText(key) },
					fix(fixer) {
						const leftSquareBracket = sourceCode.getTokenBefore(
							key,
							astUtils.isOpeningBracketToken,
						);
						const rightSquareBracket = sourceCode.getTokenAfter(
							key,
							astUtils.isClosingBracketToken,
						);

						// If there are comments between the brackets and the property name, don't do a fix.
						if (
							sourceCode.commentsExistBetween(
								leftSquareBracket,
								rightSquareBracket,
							)
						) {
							return null;
						}

						const tokenBeforeLeftBracket =
							sourceCode.getTokenBefore(leftSquareBracket);

						// Insert a space before the key to avoid changing identifiers, e.g. ({ get[2]() {} }) to ({ get2() {} })
						const needsSpaceBeforeKey =
							tokenBeforeLeftBracket.range[1] ===
								leftSquareBracket.range[0] &&
							!astUtils.canTokensBeAdjacent(
								tokenBeforeLeftBracket,
								sourceCode.getFirstToken(key),
							);

						const replacementKey =
							(needsSpaceBeforeKey ? " " : "") + key.raw;

						return fixer.replaceTextRange(
							[
								leftSquareBracket.range[0],
								rightSquareBracket.range[1],
							],
							replacementKey,
						);
					},
				});
			}
		}

		/**
		 * A no-op function to act as placeholder for checking a node when the `enforceForClassMembers` option is `false`.
		 * @returns {void}
		 * @private
		 */
		function noop() {}

		return {
			Property: check,
			MethodDefinition: enforceForClassMembers ? check : noop,
			PropertyDefinition: enforceForClassMembers ? check : noop,
		};
	},
};
%=xk/**
 * @fileoverview disallow unnecessary concatenation of template strings
 * @author Henry Zhu
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Checks whether or not a given node is a concatenation.
 * @param {ASTNode} node A node to check.
 * @returns {boolean} `true` if the node is a concatenation.
 */
function isConcatenation(node) {
	return node.type === "BinaryExpression" && node.operator === "+";
}

/**
 * Checks if the given token is a `+` token or not.
 * @param {Token} token The token to check.
 * @returns {boolean} `true` if the token is a `+` token.
 */
function isConcatOperatorToken(token) {
	return token.value === "+" && token.type === "Punctuator";
}

/**
 * Gets the right most node on the left side of a BinaryExpression with + operator.
 * @param {ASTNode} node A BinaryExpression node to check.
 * @returns {ASTNode} node
 */
function getLeft(node) {
	let left = node.left;

	while (isConcatenation(left)) {
		left = left.right;
	}
	return left;
}

/**
 * Gets the left most node on the right side of a BinaryExpression with + operator.
 * @param {ASTNode} node A BinaryExpression node to check.
 * @returns {ASTNode} node
 */
function getRight(node) {
	let right = node.right;

	while (isConcatenation(right)) {
		right = right.left;
	}
	return right;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Disallow unnecessary concatenation of literals or template literals",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/no-useless-concat",
		},

		schema: [],

		messages: {
			unexpectedConcat: "Unexpected string concatenation of literals.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		return {
			BinaryExpression(node) {
				// check if not concatenation
				if (node.operator !== "+") {
					return;
				}

				// account for the `foo + "a" + "b"` case
				const left = getLeft(node);
				const right = getRight(node);

				if (
					astUtils.isStringLiteral(left) &&
					astUtils.isStringLiteral(right) &&
					astUtils.isTokenOnSameLine(left, right)
				) {
					const operatorToken = sourceCode.getFirstTokenBetween(
						left,
						right,
						isConcatOperatorToken,
					);

					context.report({
						node,
						loc: operatorToken.loc,
						messageId: "unexpectedConcat",
					});
				}
			},
		};
	},
};
ZhѶx/**
 * @fileoverview Rule to flag the use of redundant constructors in classes.
 * @author Alberto Rodríguez
 */
"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Checks whether any of a method's parameters have a decorator or are a parameter property.
 * @param {ASTNode} node A method definition node.
 * @returns {boolean} `true` if any parameter had a decorator or is a parameter property.
 */
function hasDecoratorsOrParameterProperty(node) {
	return node.value.params.some(
		param =>
			param.decorators?.length || param.type === "TSParameterProperty",
	);
}

/**
 * Checks whether a node's accessibility makes it not useless.
 * @param {ASTNode} node A method definition node.
 * @returns {boolean} `true` if the node has a useful accessibility.
 */
function hasUsefulAccessibility(node) {
	switch (node.accessibility) {
		case "protected":
		case "private":
			return true;
		case "public":
			return !!node.parent.parent.superClass;
		default:
			return false;
	}
}

/**
 * Checks whether a given array of statements is a single call of `super`.
 * @param {ASTNode[]} body An array of statements to check.
 * @returns {boolean} `true` if the body is a single call of `super`.
 */
function isSingleSuperCall(body) {
	return (
		body.length === 1 &&
		body[0].type === "ExpressionStatement" &&
		body[0].expression.type === "CallExpression" &&
		body[0].expression.callee.type === "Super"
	);
}

/**
 * Checks whether a given node is a pattern which doesn't have any side effects.
 * Default parameters and Destructuring parameters can have side effects.
 * @param {ASTNode} node A pattern node.
 * @returns {boolean} `true` if the node doesn't have any side effects.
 */
function isSimple(node) {
	return node.type === "Identifier" || node.type === "RestElement";
}

/**
 * Checks whether a given array of expressions is `...arguments` or not.
 * `super(...arguments)` passes all arguments through.
 * @param {ASTNode[]} superArgs An array of expressions to check.
 * @returns {boolean} `true` if the superArgs is `...arguments`.
 */
function isSpreadArguments(superArgs) {
	return (
		superArgs.length === 1 &&
		superArgs[0].type === "SpreadElement" &&
		superArgs[0].argument.type === "Identifier" &&
		superArgs[0].argument.name === "arguments"
	);
}

/**
 * Checks whether given 2 nodes are identifiers which have the same name or not.
 * @param {ASTNode} ctorParam A node to check.
 * @param {ASTNode} superArg A node to check.
 * @returns {boolean} `true` if the nodes are identifiers which have the same
 *      name.
 */
function isValidIdentifierPair(ctorParam, superArg) {
	return (
		ctorParam.type === "Identifier" &&
		superArg.type === "Identifier" &&
		ctorParam.name === superArg.name
	);
}

/**
 * Checks whether given 2 nodes are a rest/spread pair which has the same values.
 * @param {ASTNode} ctorParam A node to check.
 * @param {ASTNode} superArg A node to check.
 * @returns {boolean} `true` if the nodes are a rest/spread pair which has the
 *      same values.
 */
function isValidRestSpreadPair(ctorParam, superArg) {
	return (
		ctorParam.type === "RestElement" &&
		superArg.type === "SpreadElement" &&
		isValidIdentifierPair(ctorParam.argument, superArg.argument)
	);
}

/**
 * Checks whether given 2 nodes have the same value or not.
 * @param {ASTNode} ctorParam A node to check.
 * @param {ASTNode} superArg A node to check.
 * @returns {boolean} `true` if the nodes have the same value or not.
 */
function isValidPair(ctorParam, superArg) {
	return (
		isValidIdentifierPair(ctorParam, superArg) ||
		isValidRestSpreadPair(ctorParam, superArg)
	);
}

/**
 * Checks whether the parameters of a constructor and the arguments of `super()`
 * have the same values or not.
 * @param {ASTNode} ctorParams The parameters of a constructor to check.
 * @param {ASTNode} superArgs The arguments of `super()` to check.
 * @returns {boolean} `true` if those have the same values.
 */
function isPassingThrough(ctorParams, superArgs) {
	if (ctorParams.length !== superArgs.length) {
		return false;
	}

	for (let i = 0; i < ctorParams.length; ++i) {
		if (!isValidPair(ctorParams[i], superArgs[i])) {
			return false;
		}
	}

	return true;
}

/**
 * Checks whether the constructor body is a redundant super call.
 * @param {Array} body constructor body content.
 * @param {Array} ctorParams The params to check against super call.
 * @returns {boolean} true if the constructor body is redundant
 */
function isRedundantSuperCall(body, ctorParams) {
	return (
		isSingleSuperCall(body) &&
		ctorParams.every(isSimple) &&
		(isSpreadArguments(body[0].expression.arguments) ||
			isPassingThrough(ctorParams, body[0].expression.arguments))
	);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow unnecessary constructors",
			dialects: ["JavaScript", "TypeScript"],
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-useless-constructor",
		},

		hasSuggestions: true,

		schema: [],

		messages: {
			noUselessConstructor: "Useless constructor.",
			removeConstructor: "Remove the constructor.",
		},
	},

	create(context) {
		const { sourceCode } = context;

		/**
		 * Checks whether a node is a redundant constructor
		 * @param {ASTNode} node node to check
		 * @returns {void}
		 */
		function checkForConstructor(node) {
			if (
				node.kind !== "constructor" ||
				node.value.type !== "FunctionExpression" ||
				hasDecoratorsOrParameterProperty(node) ||
				hasUsefulAccessibility(node)
			) {
				return;
			}

			/*
			 * Prevent crashing on parsers which do not require class constructor
			 * to have a body, e.g. typescript and flow
			 */
			if (!node.value.body) {
				return;
			}

			const body = node.value.body.body;
			const ctorParams = node.value.params;
			const superClass = node.parent.parent.superClass;
			const parenToken = sourceCode.getFirstToken(
				node,
				astUtils.isOpeningParenToken,
			);
			const loc = {
				start: node.loc.start,
				end: sourceCode.getTokenBefore(parenToken).loc.end,
			};

			if (
				superClass
					? isRedundantSuperCall(body, ctorParams)
					: body.length === 0
			) {
				context.report({
					loc,
					messageId: "noUselessConstructor",
					suggest: [
						{
							messageId: "removeConstructor",
							*fix(fixer) {
								const nextToken =
									sourceCode.getTokenAfter(node);
								const addSemiColon =
									astUtils.canContinueExpressionInClassBody(
										nextToken,
									) &&
									astUtils.needsPrecedingSemicolon(
										sourceCode,
										node,
									);

								yield fixer.replaceText(
									node,
									addSemiColon ? ";" : "",
								);
							},
						},
					],
				});
			}
		}

		return {
			MethodDefinition: checkForConstructor,
		};
	},
};
x9+/**
 * @fileoverview Look for useless escapes in strings and regexes
 * @author Onur Temizkan
 */

"use strict";

const astUtils = require("./utils/ast-utils");
const { RegExpParser, visitRegExpAST } = require("@eslint-community/regexpp");

/**
 * @typedef {import('@eslint-community/regexpp').AST.CharacterClass} CharacterClass
 * @typedef {import('@eslint-community/regexpp').AST.ExpressionCharacterClass} ExpressionCharacterClass
 */
//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/**
 * Returns the union of two sets.
 * @param {Set} setA The first set
 * @param {Set} setB The second set
 * @returns {Set} The union of the two sets
 */
function union(setA, setB) {
	return new Set(
		(function* () {
			yield* setA;
			yield* setB;
		})(),
	);
}

const VALID_STRING_ESCAPES = union(new Set("\\nrvtbfux"), astUtils.LINEBREAKS);
const REGEX_GENERAL_ESCAPES = new Set("\\bcdDfnpPrsStvwWxu0123456789]");
const REGEX_NON_CHARCLASS_ESCAPES = union(
	REGEX_GENERAL_ESCAPES,
	new Set("^/.$*+?[{}|()Bk"),
);

/*
 * Set of characters that require escaping in character classes in `unicodeSets` mode.
 * ( ) [ ] { } / - \ | are ClassSetSyntaxCharacter
 */
const REGEX_CLASSSET_CHARACTER_ESCAPES = union(
	REGEX_GENERAL_ESCAPES,
	new Set("q/[{}|()-"),
);

/*
 * A single character set of ClassSetReservedDoublePunctuator.
 * && !! ## $$ %% ** ++ ,, .. :: ;; << == >> ?? @@ ^^ `` ~~ are ClassSetReservedDoublePunctuator
 */
const REGEX_CLASS_SET_RESERVED_DOUBLE_PUNCTUATOR = new Set(
	"!#$%&*+,.:;<=>?@^`~",
);

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				allowRegexCharacters: [],
			},
		],

		docs: {
			description: "Disallow unnecessary escape characters",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-useless-escape",
		},

		hasSuggestions: true,

		messages: {
			unnecessaryEscape: "Unnecessary escape character: \\{{character}}.",
			removeEscape:
				"Remove the `\\`. This maintains the current functionality.",
			removeEscapeDoNotKeepSemantics:
				"Remove the `\\` if it was inserted by mistake.",
			escapeBackslash:
				"Replace the `\\` with `\\\\` to include the actual backslash character.",
		},

		schema: [
			{
				type: "object",
				properties: {
					allowRegexCharacters: {
						type: "array",
						items: {
							type: "string",
						},
						uniqueItems: true,
					},
				},
				additionalProperties: false,
			},
		],
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const [{ allowRegexCharacters }] = context.options;
		const parser = new RegExpParser();

		/**
		 * Reports a node
		 * @param {ASTNode} node The node to report
		 * @param {number} startOffset The backslash's offset from the start of the node
		 * @param {string} character The uselessly escaped character (not including the backslash)
		 * @param {boolean} [disableEscapeBackslashSuggest] `true` if escapeBackslash suggestion should be turned off.
		 * @returns {void}
		 */
		function report(
			node,
			startOffset,
			character,
			disableEscapeBackslashSuggest,
		) {
			const rangeStart = node.range[0] + startOffset;
			const range = [rangeStart, rangeStart + 1];
			const start = sourceCode.getLocFromIndex(rangeStart);

			context.report({
				node,
				loc: {
					start,
					end: { line: start.line, column: start.column + 1 },
				},
				messageId: "unnecessaryEscape",
				data: { character },
				suggest: [
					{
						// Removing unnecessary `\` characters in a directive is not guaranteed to maintain functionality.
						messageId: astUtils.isDirective(node.parent)
							? "removeEscapeDoNotKeepSemantics"
							: "removeEscape",
						fix(fixer) {
							return fixer.removeRange(range);
						},
					},
					...(disableEscapeBackslashSuggest
						? []
						: [
								{
									messageId: "escapeBackslash",
									fix(fixer) {
										return fixer.insertTextBeforeRange(
											range,
											"\\",
										);
									},
								},
							]),
				],
			});
		}

		/**
		 * Checks if the escape character in given string slice is unnecessary.
		 * @private
		 * @param {ASTNode} node node to validate.
		 * @param {string} match string slice to validate.
		 * @returns {void}
		 */
		function validateString(node, match) {
			const isTemplateElement = node.type === "TemplateElement";
			const escapedChar = match[0][1];
			let isUnnecessaryEscape = !VALID_STRING_ESCAPES.has(escapedChar);
			let isQuoteEscape;

			if (isTemplateElement) {
				isQuoteEscape = escapedChar === "`";

				if (escapedChar === "$") {
					// Warn if `\$` is not followed by `{`
					isUnnecessaryEscape = match.input[match.index + 2] !== "{";
				} else if (escapedChar === "{") {
					/*
					 * Warn if `\{` is not preceded by `$`. If preceded by `$`, escaping
					 * is necessary and the rule should not warn. If preceded by `/$`, the rule
					 * will warn for the `/$` instead, as it is the first unnecessarily escaped character.
					 */
					isUnnecessaryEscape = match.input[match.index - 1] !== "$";
				}
			} else {
				isQuoteEscape = escapedChar === node.raw[0];
			}

			if (isUnnecessaryEscape && !isQuoteEscape) {
				report(node, match.index, match[0].slice(1));
			}
		}

		/**
		 * Checks if the escape character in given regexp is unnecessary.
		 * @private
		 * @param {ASTNode} node node to validate.
		 * @returns {void}
		 */
		function validateRegExp(node) {
			const { pattern, flags } = node.regex;
			let patternNode;
			const unicode = flags.includes("u");
			const unicodeSets = flags.includes("v");

			try {
				patternNode = parser.parsePattern(pattern, 0, pattern.length, {
					unicode,
					unicodeSets,
				});
			} catch {
				// Ignore regular expressions with syntax errors
				return;
			}

			/** @type {(CharacterClass | ExpressionCharacterClass)[]} */
			const characterClassStack = [];

			visitRegExpAST(patternNode, {
				onCharacterClassEnter: characterClassNode =>
					characterClassStack.unshift(characterClassNode),
				onCharacterClassLeave: () => characterClassStack.shift(),
				onExpressionCharacterClassEnter: characterClassNode =>
					characterClassStack.unshift(characterClassNode),
				onExpressionCharacterClassLeave: () =>
					characterClassStack.shift(),
				onCharacterEnter(characterNode) {
					if (!characterNode.raw.startsWith("\\")) {
						// It's not an escaped character.
						return;
					}

					const escapedChar = characterNode.raw.slice(1);

					if (
						escapedChar !==
							String.fromCodePoint(characterNode.value) ||
						allowRegexCharacters.includes(escapedChar)
					) {
						// It's a valid escape.
						return;
					}
					let allowedEscapes;

					if (characterClassStack.length) {
						allowedEscapes = unicodeSets
							? REGEX_CLASSSET_CHARACTER_ESCAPES
							: REGEX_GENERAL_ESCAPES;
					} else {
						allowedEscapes = REGEX_NON_CHARCLASS_ESCAPES;
					}
					if (allowedEscapes.has(escapedChar)) {
						return;
					}

					const reportedIndex = characterNode.start + 1;
					let disableEscapeBackslashSuggest = false;

					if (characterClassStack.length) {
						const characterClassNode = characterClassStack[0];

						if (escapedChar === "^") {
							/*
							 * The '^' character is also a special case; it must always be escaped outside of character classes, but
							 * it only needs to be escaped in character classes if it's at the beginning of the character class. To
							 * account for this, consider it to be a valid escape character outside of character classes, and filter
							 * out '^' characters that appear at the start of a character class.
							 */
							if (
								characterClassNode.start + 1 ===
								characterNode.start
							) {
								return;
							}
						}
						if (!unicodeSets) {
							if (escapedChar === "-") {
								/*
								 * The '-' character is a special case, because it's only valid to escape it if it's in a character
								 * class, and is not at either edge of the character class. To account for this, don't consider '-'
								 * characters to be valid in general, and filter out '-' characters that appear in the middle of a
								 * character class.
								 */
								if (
									characterClassNode.start + 1 !==
										characterNode.start &&
									characterNode.end !==
										characterClassNode.end - 1
								) {
									return;
								}
							}
						} else {
							// unicodeSets mode
							if (
								REGEX_CLASS_SET_RESERVED_DOUBLE_PUNCTUATOR.has(
									escapedChar,
								)
							) {
								// Escaping is valid if it is a ClassSetReservedDoublePunctuator.
								if (
									pattern[characterNode.end] === escapedChar
								) {
									return;
								}
								if (
									pattern[characterNode.start - 1] ===
									escapedChar
								) {
									if (escapedChar !== "^") {
										return;
									}

									// If the previous character is a `negate` caret(`^`), escape to caret is unnecessary.

									if (!characterClassNode.negate) {
										return;
									}
									const negateCaretIndex =
										characterClassNode.start + 1;

									if (
										negateCaretIndex <
										characterNode.start - 1
									) {
										return;
									}
								}
							}

							if (
								characterNode.parent.type ===
									"ClassIntersection" ||
								characterNode.parent.type === "ClassSubtraction"
							) {
								disableEscapeBackslashSuggest = true;
							}
						}
					}

					report(
						node,
						reportedIndex,
						escapedChar,
						disableEscapeBackslashSuggest,
					);
				},
			});
		}

		/**
		 * Checks if a node has an escape.
		 * @param {ASTNode} node node to check.
		 * @returns {void}
		 */
		function check(node) {
			const isTemplateElement = node.type === "TemplateElement";

			if (
				isTemplateElement &&
				node.parent &&
				node.parent.parent &&
				node.parent.parent.type === "TaggedTemplateExpression" &&
				node.parent === node.parent.parent.quasi
			) {
				// Don't report tagged template literals, because the backslash character is accessible to the tag function.
				return;
			}

			if (typeof node.value === "string" || isTemplateElement) {
				/*
				 * JSXAttribute doesn't have any escape sequence: https://facebook.github.io/jsx/.
				 * In addition, backticks are not supported by JSX yet: https://github.com/facebook/jsx/issues/25.
				 */
				if (
					node.parent.type === "JSXAttribute" ||
					node.parent.type === "JSXElement" ||
					node.parent.type === "JSXFragment"
				) {
					return;
				}

				const value = isTemplateElement
					? sourceCode.getText(node)
					: node.raw;
				const pattern = /\\\D/gu;
				let match;

				while ((match = pattern.exec(value))) {
					validateString(node, match);
				}
			} else if (node.regex) {
				validateRegExp(node);
			}
		}

		return {
			Literal: check,
			TemplateElement: check,
		};
	},
};
$ӱxA/**
 * @fileoverview Disallow renaming import, export, and destructured assignments to the same name.
 * @author Kai Cataldo
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				ignoreDestructuring: false,
				ignoreImport: false,
				ignoreExport: false,
			},
		],

		docs: {
			description:
				"Disallow renaming import, export, and destructured assignments to the same name",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-useless-rename",
		},

		fixable: "code",

		schema: [
			{
				type: "object",
				properties: {
					ignoreDestructuring: { type: "boolean" },
					ignoreImport: { type: "boolean" },
					ignoreExport: { type: "boolean" },
				},
				additionalProperties: false,
			},
		],

		messages: {
			unnecessarilyRenamed: "{{type}} {{name}} unnecessarily renamed.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const [{ ignoreDestructuring, ignoreImport, ignoreExport }] =
			context.options;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Reports error for unnecessarily renamed assignments
		 * @param {ASTNode} node node to report
		 * @param {ASTNode} initial node with initial name value
		 * @param {string} type the type of the offending node
		 * @returns {void}
		 */
		function reportError(node, initial, type) {
			const name =
				initial.type === "Identifier" ? initial.name : initial.value;

			return context.report({
				node,
				messageId: "unnecessarilyRenamed",
				data: {
					name,
					type,
				},
				fix(fixer) {
					const replacementNode =
						node.type === "Property" ? node.value : node.local;

					if (
						sourceCode.getCommentsInside(node).length >
						sourceCode.getCommentsInside(replacementNode).length
					) {
						return null;
					}

					// Don't autofix code such as `({foo: (foo) = a} = obj);`, parens are not allowed in shorthand properties.
					if (
						replacementNode.type === "AssignmentPattern" &&
						astUtils.isParenthesised(
							sourceCode,
							replacementNode.left,
						)
					) {
						return null;
					}

					return fixer.replaceText(
						node,
						sourceCode.getText(replacementNode),
					);
				},
			});
		}

		/**
		 * Checks whether a destructured assignment is unnecessarily renamed
		 * @param {ASTNode} node node to check
		 * @returns {void}
		 */
		function checkDestructured(node) {
			if (ignoreDestructuring) {
				return;
			}

			for (const property of node.properties) {
				/**
				 * Properties using shorthand syntax and rest elements can not be renamed.
				 * If the property is computed, we have no idea if a rename is useless or not.
				 */
				if (
					property.type !== "Property" ||
					property.shorthand ||
					property.computed
				) {
					continue;
				}

				const key =
					(property.key.type === "Identifier" && property.key.name) ||
					(property.key.type === "Literal" && property.key.value);
				const renamedKey =
					property.value.type === "AssignmentPattern"
						? property.value.left.name
						: property.value.name;

				if (key === renamedKey) {
					reportError(
						property,
						property.key,
						"Destructuring assignment",
					);
				}
			}
		}

		/**
		 * Checks whether an import is unnecessarily renamed
		 * @param {ASTNode} node node to check
		 * @returns {void}
		 */
		function checkImport(node) {
			if (ignoreImport) {
				return;
			}

			if (
				node.imported.range[0] !== node.local.range[0] &&
				astUtils.getModuleExportName(node.imported) === node.local.name
			) {
				reportError(node, node.imported, "Import");
			}
		}

		/**
		 * Checks whether an export is unnecessarily renamed
		 * @param {ASTNode} node node to check
		 * @returns {void}
		 */
		function checkExport(node) {
			if (ignoreExport) {
				return;
			}

			if (
				node.local.range[0] !== node.exported.range[0] &&
				astUtils.getModuleExportName(node.local) ===
					astUtils.getModuleExportName(node.exported)
			) {
				reportError(node, node.local, "Export");
			}
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			ObjectPattern: checkDestructured,
			ImportSpecifier: checkImport,
			ExportSpecifier: checkExport,
		};
	},
};
MĎx-s/**
 * @fileoverview Disallow redundant return statements
 * @author Teddy Katz
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils"),
	FixTracker = require("./utils/fix-tracker");
const { isAnySegmentReachable } = require("./utils/code-path-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Removes the given element from the array.
 * @param {Array} array The source array to remove.
 * @param {any} element The target item to remove.
 * @returns {void}
 */
function remove(array, element) {
	const index = array.indexOf(element);

	if (index !== -1) {
		array.splice(index, 1);
	}
}

/**
 * Checks whether it can remove the given return statement or not.
 * @param {ASTNode} node The return statement node to check.
 * @returns {boolean} `true` if the node is removable.
 */
function isRemovable(node) {
	return astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type);
}

/**
 * Checks whether the given return statement is in a `finally` block or not.
 * @param {ASTNode} node The return statement node to check.
 * @returns {boolean} `true` if the node is in a `finally` block.
 */
function isInFinally(node) {
	for (
		let currentNode = node;
		currentNode && currentNode.parent && !astUtils.isFunction(currentNode);
		currentNode = currentNode.parent
	) {
		if (
			currentNode.parent.type === "TryStatement" &&
			currentNode.parent.finalizer === currentNode
		) {
			return true;
		}
	}

	return false;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow redundant return statements",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-useless-return",
		},

		fixable: "code",
		schema: [],

		messages: {
			unnecessaryReturn: "Unnecessary return statement.",
		},
	},

	create(context) {
		const segmentInfoMap = new WeakMap();
		const sourceCode = context.sourceCode;
		let scopeInfo = null;

		/**
		 * Checks whether the given segment is terminated by a return statement or not.
		 * @param {CodePathSegment} segment The segment to check.
		 * @returns {boolean} `true` if the segment is terminated by a return statement, or if it's still a part of unreachable.
		 */
		function isReturned(segment) {
			const info = segmentInfoMap.get(segment);

			return !info || info.returned;
		}

		/**
		 * Collects useless return statements from the given previous segments.
		 *
		 * A previous segment may be an unreachable segment.
		 * In that case, the information object of the unreachable segment is not
		 * initialized because `onCodePathSegmentStart` event is not notified for
		 * unreachable segments.
		 * This goes to the previous segments of the unreachable segment recursively
		 * if the unreachable segment was generated by a return statement. Otherwise,
		 * this ignores the unreachable segment.
		 *
		 * This behavior would simulate code paths for the case that the return
		 * statement does not exist.
		 * @param {ASTNode[]} uselessReturns The collected return statements.
		 * @param {CodePathSegment[]} prevSegments The previous segments to traverse.
		 * @param {WeakSet<CodePathSegment>} [providedTraversedSegments] A set of segments that have already been traversed in this call
		 * @returns {ASTNode[]} `uselessReturns`.
		 */
		function getUselessReturns(
			uselessReturns,
			prevSegments,
			providedTraversedSegments,
		) {
			const traversedSegments =
				providedTraversedSegments || new WeakSet();

			for (const segment of prevSegments) {
				if (!segment.reachable) {
					if (!traversedSegments.has(segment)) {
						traversedSegments.add(segment);
						getUselessReturns(
							uselessReturns,
							segment.allPrevSegments.filter(isReturned),
							traversedSegments,
						);
					}
					continue;
				}

				if (segmentInfoMap.has(segment)) {
					uselessReturns.push(
						...segmentInfoMap.get(segment).uselessReturns,
					);
				}
			}

			return uselessReturns;
		}

		/**
		 * Removes the return statements on the given segment from the useless return
		 * statement list.
		 *
		 * This segment may be an unreachable segment.
		 * In that case, the information object of the unreachable segment is not
		 * initialized because `onCodePathSegmentStart` event is not notified for
		 * unreachable segments.
		 * This goes to the previous segments of the unreachable segment recursively
		 * if the unreachable segment was generated by a return statement. Otherwise,
		 * this ignores the unreachable segment.
		 *
		 * This behavior would simulate code paths for the case that the return
		 * statement does not exist.
		 * @param {CodePathSegment} segment The segment to get return statements.
		 * @param {Set<CodePathSegment>} usedUnreachableSegments A set of segments that have already been traversed in this call.
		 * @returns {void}
		 */
		function markReturnStatementsOnSegmentAsUsed(
			segment,
			usedUnreachableSegments,
		) {
			if (!segment.reachable) {
				usedUnreachableSegments.add(segment);
				segment.allPrevSegments
					.filter(isReturned)
					.filter(
						prevSegment =>
							!usedUnreachableSegments.has(prevSegment),
					)
					.forEach(prevSegment =>
						markReturnStatementsOnSegmentAsUsed(
							prevSegment,
							usedUnreachableSegments,
						),
					);
				return;
			}

			const info = segmentInfoMap.get(segment);

			if (!info) {
				return;
			}

			info.uselessReturns = info.uselessReturns.filter(node => {
				if (
					scopeInfo.traversedTryBlockStatements &&
					scopeInfo.traversedTryBlockStatements.length > 0
				) {
					const returnInitialRange = node.range[0];
					const returnFinalRange = node.range[1];

					const areBlocksInRange =
						scopeInfo.traversedTryBlockStatements.some(
							tryBlockStatement => {
								const blockInitialRange =
									tryBlockStatement.range[0];
								const blockFinalRange =
									tryBlockStatement.range[1];

								return (
									returnInitialRange >= blockInitialRange &&
									returnFinalRange <= blockFinalRange
								);
							},
						);

					if (areBlocksInRange) {
						return true;
					}
				}

				remove(scopeInfo.uselessReturns, node);
				return false;
			});
		}

		/**
		 * Removes the return statements on the current segments from the useless
		 * return statement list.
		 *
		 * This function will be called at every statement except FunctionDeclaration,
		 * BlockStatement, and BreakStatement.
		 *
		 * - FunctionDeclarations are always executed whether it's returned or not.
		 * - BlockStatements do nothing.
		 * - BreakStatements go the next merely.
		 * @returns {void}
		 */
		function markReturnStatementsOnCurrentSegmentsAsUsed() {
			scopeInfo.currentSegments.forEach(segment =>
				markReturnStatementsOnSegmentAsUsed(segment, new Set()),
			);
		}

		//----------------------------------------------------------------------
		// Public
		//----------------------------------------------------------------------

		return {
			// Makes and pushes a new scope information.
			onCodePathStart(codePath) {
				scopeInfo = {
					upper: scopeInfo,
					uselessReturns: [],
					traversedTryBlockStatements: [],
					codePath,
					currentSegments: new Set(),
				};
			},

			// Reports useless return statements if exist.
			onCodePathEnd() {
				for (const node of scopeInfo.uselessReturns) {
					context.report({
						node,
						loc: node.loc,
						messageId: "unnecessaryReturn",
						fix(fixer) {
							if (
								isRemovable(node) &&
								!sourceCode.getCommentsInside(node).length
							) {
								/*
								 * Extend the replacement range to include the
								 * entire function to avoid conflicting with
								 * no-else-return.
								 * https://github.com/eslint/eslint/issues/8026
								 */
								return new FixTracker(fixer, sourceCode)
									.retainEnclosingFunction(node)
									.remove(node);
							}
							return null;
						},
					});
				}

				scopeInfo = scopeInfo.upper;
			},

			/*
			 * Initializes segments.
			 * NOTE: This event is notified for only reachable segments.
			 */
			onCodePathSegmentStart(segment) {
				scopeInfo.currentSegments.add(segment);

				const info = {
					uselessReturns: getUselessReturns(
						[],
						segment.allPrevSegments,
					),
					returned: false,
				};

				// Stores the info.
				segmentInfoMap.set(segment, info);
			},

			onUnreachableCodePathSegmentStart(segment) {
				scopeInfo.currentSegments.add(segment);
			},

			onUnreachableCodePathSegmentEnd(segment) {
				scopeInfo.currentSegments.delete(segment);
			},

			onCodePathSegmentEnd(segment) {
				scopeInfo.currentSegments.delete(segment);
			},

			// Adds ReturnStatement node to check whether it's useless or not.
			ReturnStatement(node) {
				if (node.argument) {
					markReturnStatementsOnCurrentSegmentsAsUsed();
				}
				if (
					node.argument ||
					astUtils.isInLoop(node) ||
					isInFinally(node) ||
					// Ignore `return` statements in unreachable places (https://github.com/eslint/eslint/issues/11647).
					!isAnySegmentReachable(scopeInfo.currentSegments)
				) {
					return;
				}

				for (const segment of scopeInfo.currentSegments) {
					const info = segmentInfoMap.get(segment);

					if (info) {
						info.uselessReturns.push(node);
						info.returned = true;
					}
				}
				scopeInfo.uselessReturns.push(node);
			},

			"TryStatement > BlockStatement.block:exit"(node) {
				scopeInfo.traversedTryBlockStatements.push(node);
			},

			"TryStatement:exit"() {
				scopeInfo.traversedTryBlockStatements.pop();
			},

			/*
			 * Registers for all statement nodes except FunctionDeclaration, BlockStatement, BreakStatement.
			 * Removes return statements of the current segments from the useless return statement list.
			 */
			ClassDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed,
			ContinueStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
			DebuggerStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
			DoWhileStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
			EmptyStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
			ExpressionStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
			ForInStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
			ForOfStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
			ForStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
			IfStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
			ImportDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed,
			LabeledStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
			SwitchStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
			ThrowStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
			TryStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
			VariableDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed,
			WhileStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
			WithStatement: markReturnStatementsOnCurrentSegmentsAsUsed,
			ExportNamedDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed,
			ExportDefaultDeclaration:
				markReturnStatementsOnCurrentSegmentsAsUsed,
			ExportAllDeclaration: markReturnStatementsOnCurrentSegmentsAsUsed,
		};
	},
};
kx13/**
 * @fileoverview Rule to check for the usage of var.
 * @author Jamund Ferguson
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @typedef {import("eslint-scope").Scope} Scope */
/** @typedef {import("eslint-scope").Variable} Variable */
/** @typedef {import("eslint-scope").Reference} Reference */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Check whether a given variable is a global variable or not.
 * @param {Variable} variable The variable to check.
 * @returns {boolean} `true` if the variable is a global variable.
 */
function isGlobal(variable) {
	return Boolean(variable.scope) && variable.scope.type === "global";
}

/**
 * Finds the nearest function scope or global scope walking up the scope
 * hierarchy.
 * @param {Scope} scope The scope to traverse.
 * @returns {Scope} a function scope or global scope containing the given
 *      scope.
 */
function getEnclosingFunctionScope(scope) {
	let currentScope = scope;

	while (currentScope.type !== "function" && currentScope.type !== "global") {
		currentScope = currentScope.upper;
	}
	return currentScope;
}

/**
 * Checks whether the given variable has any references from a more specific
 * function expression (i.e. a closure).
 * @param {Variable} variable A variable to check.
 * @returns {boolean} `true` if the variable is used from a closure.
 */
function isReferencedInClosure(variable) {
	const enclosingFunctionScope = getEnclosingFunctionScope(variable.scope);

	return variable.references.some(
		reference =>
			getEnclosingFunctionScope(reference.from) !==
			enclosingFunctionScope,
	);
}

/**
 * Checks whether the given node is the assignee of a loop.
 * @param {ASTNode} node A VariableDeclaration node to check.
 * @returns {boolean} `true` if the declaration is assigned as part of loop
 *      iteration.
 */
function isLoopAssignee(node) {
	return (
		(node.parent.type === "ForOfStatement" ||
			node.parent.type === "ForInStatement") &&
		node === node.parent.left
	);
}

/**
 * Checks whether the given variable declaration is immediately initialized.
 * @param {ASTNode} node A VariableDeclaration node to check.
 * @returns {boolean} `true` if the declaration has an initializer.
 */
function isDeclarationInitialized(node) {
	return node.declarations.every(declarator => declarator.init !== null);
}

const SCOPE_NODE_TYPE =
	/^(?:Program|BlockStatement|SwitchStatement|ForStatement|ForInStatement|ForOfStatement)$/u;

/**
 * Gets the scope node which directly contains a given node.
 * @param {ASTNode} node A node to get. This is a `VariableDeclaration` or
 *      an `Identifier`.
 * @returns {ASTNode} A scope node. This is one of `Program`, `BlockStatement`,
 *      `SwitchStatement`, `ForStatement`, `ForInStatement`, and
 *      `ForOfStatement`.
 */
function getScopeNode(node) {
	for (
		let currentNode = node;
		currentNode;
		currentNode = currentNode.parent
	) {
		if (SCOPE_NODE_TYPE.test(currentNode.type)) {
			return currentNode;
		}
	}

	/* c8 ignore next */
	return null;
}

/**
 * Checks whether a given variable is redeclared or not.
 * @param {Variable} variable A variable to check.
 * @returns {boolean} `true` if the variable is redeclared.
 */
function isRedeclared(variable) {
	return variable.defs.length >= 2;
}

/**
 * Checks whether a given variable is used from outside of the specified scope.
 * @param {ASTNode} scopeNode A scope node to check.
 * @returns {Function} The predicate function which checks whether a given
 *      variable is used from outside of the specified scope.
 */
function isUsedFromOutsideOf(scopeNode) {
	/**
	 * Checks whether a given reference is inside of the specified scope or not.
	 * @param {Reference} reference A reference to check.
	 * @returns {boolean} `true` if the reference is inside of the specified
	 *      scope.
	 */
	function isOutsideOfScope(reference) {
		const scope = scopeNode.range;
		const id = reference.identifier.range;

		return id[0] < scope[0] || id[1] > scope[1];
	}

	return function (variable) {
		return variable.references.some(isOutsideOfScope);
	};
}

/**
 * Creates the predicate function which checks whether a variable has their references in TDZ.
 *
 * The predicate function would return `true`:
 *
 * - if a reference is before the declarator. E.g. (var a = b, b = 1;)(var {a = b, b} = {};)
 * - if a reference is in the expression of their default value.  E.g. (var {a = a} = {};)
 * - if a reference is in the expression of their initializer.  E.g. (var a = a;)
 * @param {ASTNode} node The initializer node of VariableDeclarator.
 * @returns {Function} The predicate function.
 * @private
 */
function hasReferenceInTDZ(node) {
	const initStart = node.range[0];
	const initEnd = node.range[1];

	return variable => {
		const id = variable.defs[0].name;
		const idStart = id.range[0];
		const defaultValue =
			id.parent.type === "AssignmentPattern" ? id.parent.right : null;
		const defaultStart = defaultValue && defaultValue.range[0];
		const defaultEnd = defaultValue && defaultValue.range[1];

		return variable.references.some(reference => {
			const start = reference.identifier.range[0];
			const end = reference.identifier.range[1];

			return (
				!reference.init &&
				(start < idStart ||
					(defaultValue !== null &&
						start >= defaultStart &&
						end <= defaultEnd) ||
					(!astUtils.isFunction(node) &&
						start >= initStart &&
						end <= initEnd))
			);
		});
	};
}

/**
 * Checks whether a given variable has name that is allowed for 'var' declarations,
 * but disallowed for `let` declarations.
 * @param {Variable} variable The variable to check.
 * @returns {boolean} `true` if the variable has a disallowed name.
 */
function hasNameDisallowedForLetDeclarations(variable) {
	return variable.name === "let";
}

/**
 * Checks whether a given variable has any references before its declaration.
 * This is important because var allows hoisting, but let/const do not.
 * @param {Variable} variable The variable to check.
 * @returns {boolean} `true` if the variable is referenced before its declaration.
 */
function hasReferenceBeforeDeclaration(variable) {
	const declarationStart = variable.defs[0].node.range[0];

	return variable.references.some(reference => {
		const referenceStart = reference.identifier.range[0];

		/*
		 * Check if the reference occurs before the declaration.
		 * We don't need to check scopes because all references to this variable
		 * are already in variable.references (which only includes references
		 * that resolve to this specific variable binding).
		 */
		return !reference.init && referenceStart < declarationStart;
	});
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Require `let` or `const` instead of `var`",
			dialects: ["JavaScript", "TypeScript"],
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-var",
		},

		schema: [],
		fixable: "code",

		messages: {
			unexpectedVar: "Unexpected var, use let or const instead.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		/**
		 * Checks whether the variables which are defined by the given declarator node have their references in TDZ.
		 * @param {ASTNode} declarator The VariableDeclarator node to check.
		 * @returns {boolean} `true` if one of the variables which are defined by the given declarator node have their references in TDZ.
		 */
		function hasSelfReferenceInTDZ(declarator) {
			if (!declarator.init) {
				return false;
			}
			const variables = sourceCode.getDeclaredVariables(declarator);

			return variables.some(hasReferenceInTDZ(declarator.init));
		}

		/**
		 * Checks whether it can fix a given variable declaration or not.
		 * It cannot fix if the following cases:
		 *
		 * - A variable is a global variable.
		 * - A variable is declared on a SwitchCase node.
		 * - A variable is redeclared.
		 * - A variable is used from outside the scope.
		 * - A variable is used from a closure within a loop.
		 * - A variable might be used before it is assigned within a loop.
		 * - A variable might be used in TDZ.
		 * - A variable is referenced before its declaration.
		 * - A variable is declared in statement position (e.g. a single-line `IfStatement`)
		 * - A variable has name that is disallowed for `let` declarations.
		 *
		 * ## A variable is declared on a SwitchCase node.
		 *
		 * If this rule modifies 'var' declarations on a SwitchCase node, it
		 * would generate the warnings of 'no-case-declarations' rule. And the
		 * 'eslint:recommended' preset includes 'no-case-declarations' rule, so
		 * this rule doesn't modify those declarations.
		 *
		 * ## A variable is redeclared.
		 *
		 * The language spec disallows redeclarations of `let` declarations.
		 * Those variables would cause syntax errors.
		 *
		 * ## A variable is used from outside the scope.
		 *
		 * The language spec disallows accesses from outside of the scope for
		 * `let` declarations. Those variables would cause reference errors.
		 *
		 * ## A variable is used from a closure within a loop.
		 *
		 * A `var` declaration within a loop shares the same variable instance
		 * across all loop iterations, while a `let` declaration creates a new
		 * instance for each iteration. This means if a variable in a loop is
		 * referenced by any closure, changing it from `var` to `let` would
		 * change the behavior in a way that is generally unsafe.
		 *
		 * ## A variable might be used before it is assigned within a loop.
		 *
		 * Within a loop, a `let` declaration without an initializer will be
		 * initialized to null, while a `var` declaration will retain its value
		 * from the previous iteration, so it is only safe to change `var` to
		 * `let` if we can statically determine that the variable is always
		 * assigned a value before its first access in the loop body. To keep
		 * the implementation simple, we only convert `var` to `let` within
		 * loops when the variable is a loop assignee or the declaration has an
		 * initializer.
		 * @param {ASTNode} node A variable declaration node to check.
		 * @returns {boolean} `true` if it can fix the node.
		 */
		function canFix(node) {
			const variables = sourceCode.getDeclaredVariables(node);
			const scopeNode = getScopeNode(node);
			const parentStatementList = new Set([
				...astUtils.STATEMENT_LIST_PARENTS,
				"TSModuleBlock",
			]);

			if (
				node.parent.type === "SwitchCase" ||
				node.declarations.some(hasSelfReferenceInTDZ) ||
				variables.some(isGlobal) ||
				variables.some(isRedeclared) ||
				variables.some(isUsedFromOutsideOf(scopeNode)) ||
				variables.some(hasNameDisallowedForLetDeclarations) ||
				variables.some(hasReferenceBeforeDeclaration)
			) {
				return false;
			}

			if (astUtils.isInLoop(node)) {
				if (variables.some(isReferencedInClosure)) {
					return false;
				}
				if (!isLoopAssignee(node) && !isDeclarationInitialized(node)) {
					return false;
				}
			}

			if (
				!isLoopAssignee(node) &&
				!(
					node.parent.type === "ForStatement" &&
					node.parent.init === node
				) &&
				!parentStatementList.has(node.parent.type)
			) {
				// If the declaration is not in a block, e.g. `if (foo) var bar = 1;`, then it can't be fixed.
				return false;
			}

			return true;
		}

		/**
		 * Reports a given variable declaration node.
		 * @param {ASTNode} node A variable declaration node to report.
		 * @returns {void}
		 */
		function report(node) {
			context.report({
				node,
				messageId: "unexpectedVar",

				fix(fixer) {
					const varToken = sourceCode.getFirstToken(node, {
						filter: t => t.value === "var",
					});

					return canFix(node)
						? fixer.replaceText(varToken, "let")
						: null;
				},
			});
		}

		return {
			"VariableDeclaration:exit"(node) {
				if (node.kind !== "var") {
					return;
				}

				if (
					node.parent.type === "TSModuleBlock" &&
					node.parent.parent.type === "TSModuleDeclaration" &&
					node.parent.parent.global
				) {
					return;
				}

				report(node);
			},
		};
	},
};
mzǶUxV/**
 * @fileoverview Rule to disallow use of void operator.
 * @author Mike Sidorov
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				allowAsStatement: false,
			},
		],

		docs: {
			description: "Disallow `void` operators",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/no-void",
		},

		messages: {
			noVoid: "Expected 'undefined' and instead saw 'void'.",
		},

		schema: [
			{
				type: "object",
				properties: {
					allowAsStatement: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],
	},

	create(context) {
		const [{ allowAsStatement }] = context.options;

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			'UnaryExpression[operator="void"]'(node) {
				if (
					allowAsStatement &&
					node.parent &&
					node.parent.type === "ExpressionStatement"
				) {
					return;
				}
				context.report({
					node,
					messageId: "noVoid",
				});
			},
		};
	},
};
Zix&/**
 * @fileoverview Rule that warns about used warning comments
 * @author Alexander Schmidt <https://github.com/lxanders>
 */

"use strict";

const escapeRegExp = require("escape-string-regexp");
const astUtils = require("./utils/ast-utils");

const CHAR_LIMIT = 40;

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				location: "start",
				terms: ["todo", "fixme", "xxx"],
			},
		],

		docs: {
			description: "Disallow specified warning terms in comments",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/no-warning-comments",
		},

		schema: [
			{
				type: "object",
				properties: {
					terms: {
						type: "array",
						items: {
							type: "string",
						},
					},
					location: {
						enum: ["start", "anywhere"],
					},
					decoration: {
						type: "array",
						items: {
							type: "string",
							pattern: "^\\S$",
						},
						minItems: 1,
						uniqueItems: true,
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			unexpectedComment:
				"Unexpected '{{matchedTerm}}' comment: '{{comment}}'.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const [{ decoration, location, terms: warningTerms }] = context.options;
		const escapedDecoration = escapeRegExp(
			decoration ? decoration.join("") : "",
		);
		const selfConfigRegEx = /\bno-warning-comments\b/u;

		/**
		 * Convert a warning term into a RegExp which will match a comment containing that whole word in the specified
		 * location ("start" or "anywhere"). If the term starts or ends with non word characters, then the match will not
		 * require word boundaries on that side.
		 * @param {string} term A term to convert to a RegExp
		 * @returns {RegExp} The term converted to a RegExp
		 */
		function convertToRegExp(term) {
			const escaped = escapeRegExp(term);

			/*
			 * When matching at the start, ignore leading whitespace, and
			 * there's no need to worry about word boundaries.
			 *
			 * These expressions for the prefix and suffix are designed as follows:
			 * ^   handles any terms at the beginning of a comment.
			 *     e.g. terms ["TODO"] matches `//TODO something`
			 * $   handles any terms at the end of a comment
			 *     e.g. terms ["TODO"] matches `// something TODO`
			 * \b  handles terms preceded/followed by word boundary
			 *     e.g. terms: ["!FIX", "FIX!"] matches `// FIX!something` or `// something!FIX`
			 *          terms: ["FIX"] matches `// FIX!` or `// !FIX`, but not `// fixed or affix`
			 *
			 * For location start:
			 * [\s]* handles optional leading spaces
			 *     e.g. terms ["TODO"] matches `//    TODO something`
			 * [\s\*]* (where "\*" is the escaped string of decoration)
			 *     handles optional leading spaces or decoration characters (for "start" location only)
			 *     e.g. terms ["TODO"] matches `/**** TODO something ... `
			 */
			const wordBoundary = "\\b";

			let prefix = "";

			if (location === "start") {
				prefix = `^[\\s${escapedDecoration}]*`;
			} else if (/^\w/u.test(term)) {
				prefix = wordBoundary;
			}

			const suffix = /\w$/u.test(term) ? wordBoundary : "";
			const flags = "iu"; // Case-insensitive with Unicode case folding.

			/*
			 * For location "start", the typical regex is:
			 *   /^[\s]*ESCAPED_TERM\b/iu.
			 * Or if decoration characters are specified (e.g. "*"), then any of
			 * those characters may appear in any order at the start:
			 *   /^[\s\*]*ESCAPED_TERM\b/iu.
			 *
			 * For location "anywhere" the typical regex is
			 *   /\bESCAPED_TERM\b/iu
			 *
			 * If it starts or ends with non-word character, the prefix and suffix are empty, respectively.
			 */
			return new RegExp(`${prefix}${escaped}${suffix}`, flags);
		}

		const warningRegExps = warningTerms.map(convertToRegExp);

		/**
		 * Checks the specified comment for matches of the configured warning terms and returns the matches.
		 * @param {string} comment The comment which is checked.
		 * @returns {Array} All matched warning terms for this comment.
		 */
		function commentContainsWarningTerm(comment) {
			const matches = [];

			warningRegExps.forEach((regex, index) => {
				if (regex.test(comment)) {
					matches.push(warningTerms[index]);
				}
			});

			return matches;
		}

		/**
		 * Checks the specified node for matching warning comments and reports them.
		 * @param {ASTNode} node The AST node being checked.
		 * @returns {void} undefined.
		 */
		function checkComment(node) {
			const comment = node.value;

			if (
				astUtils.isDirectiveComment(node) &&
				selfConfigRegEx.test(comment)
			) {
				return;
			}

			const matches = commentContainsWarningTerm(comment);

			matches.forEach(matchedTerm => {
				let commentToDisplay = "";
				let truncated = false;

				for (const c of comment.trim().split(/\s+/u)) {
					const tmp = commentToDisplay
						? `${commentToDisplay} ${c}`
						: c;

					if (tmp.length <= CHAR_LIMIT) {
						commentToDisplay = tmp;
					} else {
						truncated = true;
						break;
					}
				}

				context.report({
					node,
					messageId: "unexpectedComment",
					data: {
						matchedTerm,
						comment: `${commentToDisplay}${truncated ? "..." : ""}`,
					},
				});
			});
		}

		return {
			Program() {
				const comments = sourceCode.getAllComments();

				comments
					.filter(token => token.type !== "Shebang")
					.forEach(checkComment);
			},
		};
	},
};
^x%/**
 * @fileoverview Rule to disallow whitespace before properties
 * @author Kai Cataldo
 * @deprecated in ESLint v8.53.0
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "no-whitespace-before-property",
						url: "https://eslint.style/rules/no-whitespace-before-property",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Disallow whitespace before properties",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/no-whitespace-before-property",
		},

		fixable: "whitespace",
		schema: [],

		messages: {
			unexpectedWhitespace:
				"Unexpected whitespace before property {{propName}}.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Reports whitespace before property token
		 * @param {ASTNode} node the node to report in the event of an error
		 * @param {Token} leftToken the left token
		 * @param {Token} rightToken the right token
		 * @returns {void}
		 * @private
		 */
		function reportError(node, leftToken, rightToken) {
			context.report({
				node,
				messageId: "unexpectedWhitespace",
				data: {
					propName: sourceCode.getText(node.property),
				},
				fix(fixer) {
					let replacementText = "";

					if (
						!node.computed &&
						!node.optional &&
						astUtils.isDecimalInteger(node.object)
					) {
						/*
						 * If the object is a number literal, fixing it to something like 5.toString() would cause a SyntaxError.
						 * Don't fix this case.
						 */
						return null;
					}

					// Don't fix if comments exist.
					if (
						sourceCode.commentsExistBetween(leftToken, rightToken)
					) {
						return null;
					}

					if (node.optional) {
						replacementText = "?.";
					} else if (!node.computed) {
						replacementText = ".";
					}

					return fixer.replaceTextRange(
						[leftToken.range[1], rightToken.range[0]],
						replacementText,
					);
				},
			});
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			MemberExpression(node) {
				let rightToken;
				let leftToken;

				if (!astUtils.isTokenOnSameLine(node.object, node.property)) {
					return;
				}

				if (node.computed) {
					rightToken = sourceCode.getTokenBefore(
						node.property,
						astUtils.isOpeningBracketToken,
					);
					leftToken = sourceCode.getTokenBefore(
						rightToken,
						node.optional ? 1 : 0,
					);
				} else {
					rightToken = sourceCode.getFirstToken(node.property);
					leftToken = sourceCode.getTokenBefore(rightToken, 1);
				}

				if (sourceCode.isSpaceBetween(leftToken, rightToken)) {
					reportError(node, leftToken, rightToken);
				}
			},
		};
	},
};
N=5x\/**
 * @fileoverview Rule to flag use of with statement
 * @author Nicholas C. Zakas
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Disallow `with` statements",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/no-with",
		},

		schema: [],

		messages: {
			unexpectedWith: "Unexpected use of 'with' statement.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		return {
			WithStatement(node) {
				context.report({
					node,
					loc: sourceCode.getFirstToken(node).loc,
					messageId: "unexpectedWith",
				});
			},
		};
	},
};
,xB/**
 * @fileoverview enforce the location of single-line statements
 * @author Teddy Katz
 * @deprecated in ESLint v8.53.0
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

const POSITION_SCHEMA = { enum: ["beside", "below", "any"] };

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "nonblock-statement-body-position",
						url: "https://eslint.style/rules/nonblock-statement-body-position",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Enforce the location of single-line statements",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/nonblock-statement-body-position",
		},

		fixable: "whitespace",

		schema: [
			POSITION_SCHEMA,
			{
				properties: {
					overrides: {
						properties: {
							if: POSITION_SCHEMA,
							else: POSITION_SCHEMA,
							while: POSITION_SCHEMA,
							do: POSITION_SCHEMA,
							for: POSITION_SCHEMA,
						},
						additionalProperties: false,
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			expectNoLinebreak: "Expected no linebreak before this statement.",
			expectLinebreak: "Expected a linebreak before this statement.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		//----------------------------------------------------------------------
		// Helpers
		//----------------------------------------------------------------------

		/**
		 * Gets the applicable preference for a particular keyword
		 * @param {string} keywordName The name of a keyword, e.g. 'if'
		 * @returns {string} The applicable option for the keyword, e.g. 'beside'
		 */
		function getOption(keywordName) {
			return (
				(context.options[1] &&
					context.options[1].overrides &&
					context.options[1].overrides[keywordName]) ||
				context.options[0] ||
				"beside"
			);
		}

		/**
		 * Validates the location of a single-line statement
		 * @param {ASTNode} node The single-line statement
		 * @param {string} keywordName The applicable keyword name for the single-line statement
		 * @returns {void}
		 */
		function validateStatement(node, keywordName) {
			const option = getOption(keywordName);

			if (node.type === "BlockStatement" || option === "any") {
				return;
			}

			const tokenBefore = sourceCode.getTokenBefore(node);

			if (
				tokenBefore.loc.end.line === node.loc.start.line &&
				option === "below"
			) {
				context.report({
					node,
					messageId: "expectLinebreak",
					fix: fixer => fixer.insertTextBefore(node, "\n"),
				});
			} else if (
				tokenBefore.loc.end.line !== node.loc.start.line &&
				option === "beside"
			) {
				context.report({
					node,
					messageId: "expectNoLinebreak",
					fix(fixer) {
						if (
							sourceCode
								.getText()
								.slice(tokenBefore.range[1], node.range[0])
								.trim()
						) {
							return null;
						}
						return fixer.replaceTextRange(
							[tokenBefore.range[1], node.range[0]],
							" ",
						);
					},
				});
			}
		}

		//----------------------------------------------------------------------
		// Public
		//----------------------------------------------------------------------

		return {
			IfStatement(node) {
				validateStatement(node.consequent, "if");

				// Check the `else` node, but don't check 'else if' statements.
				if (node.alternate && node.alternate.type !== "IfStatement") {
					validateStatement(node.alternate, "else");
				}
			},
			WhileStatement: node => validateStatement(node.body, "while"),
			DoWhileStatement: node => validateStatement(node.body, "do"),
			ForStatement: node => validateStatement(node.body, "for"),
			ForInStatement: node => validateStatement(node.body, "for"),
			ForOfStatement: node => validateStatement(node.body, "for"),
		};
	},
};
5x'|/**
 * @fileoverview Rule to require or disallow line breaks inside braces.
 * @author Toru Nagashima
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

// Schema objects.
const OPTION_VALUE = {
	oneOf: [
		{
			enum: ["always", "never"],
		},
		{
			type: "object",
			properties: {
				multiline: {
					type: "boolean",
				},
				minProperties: {
					type: "integer",
					minimum: 0,
				},
				consistent: {
					type: "boolean",
				},
			},
			additionalProperties: false,
			minProperties: 1,
		},
	],
};

/**
 * Normalizes a given option value.
 * @param {string|Object|undefined} value An option value to parse.
 * @returns {{multiline: boolean, minProperties: number, consistent: boolean}} Normalized option object.
 */
function normalizeOptionValue(value) {
	let multiline = false;
	let minProperties = Number.POSITIVE_INFINITY;
	let consistent = false;

	if (value) {
		if (value === "always") {
			minProperties = 0;
		} else if (value === "never") {
			minProperties = Number.POSITIVE_INFINITY;
		} else {
			multiline = Boolean(value.multiline);
			minProperties = value.minProperties || Number.POSITIVE_INFINITY;
			consistent = Boolean(value.consistent);
		}
	} else {
		consistent = true;
	}

	return { multiline, minProperties, consistent };
}

/**
 * Checks if a value is an object.
 * @param {any} value The value to check
 * @returns {boolean} `true` if the value is an object, otherwise `false`
 */
function isObject(value) {
	return typeof value === "object" && value !== null;
}

/**
 * Checks if an option is a node-specific option
 * @param {any} option The option to check
 * @returns {boolean} `true` if the option is node-specific, otherwise `false`
 */
function isNodeSpecificOption(option) {
	return isObject(option) || typeof option === "string";
}

/**
 * Normalizes a given option value.
 * @param {string|Object|undefined} options An option value to parse.
 * @returns {{
 *   ObjectExpression: {multiline: boolean, minProperties: number, consistent: boolean},
 *   ObjectPattern: {multiline: boolean, minProperties: number, consistent: boolean},
 *   ImportDeclaration: {multiline: boolean, minProperties: number, consistent: boolean},
 *   ExportNamedDeclaration : {multiline: boolean, minProperties: number, consistent: boolean}
 * }} Normalized option object.
 */
function normalizeOptions(options) {
	if (
		isObject(options) &&
		Object.values(options).some(isNodeSpecificOption)
	) {
		return {
			ObjectExpression: normalizeOptionValue(options.ObjectExpression),
			ObjectPattern: normalizeOptionValue(options.ObjectPattern),
			ImportDeclaration: normalizeOptionValue(options.ImportDeclaration),
			ExportNamedDeclaration: normalizeOptionValue(
				options.ExportDeclaration,
			),
		};
	}

	const value = normalizeOptionValue(options);

	return {
		ObjectExpression: value,
		ObjectPattern: value,
		ImportDeclaration: value,
		ExportNamedDeclaration: value,
	};
}

/**
 * Determines if ObjectExpression, ObjectPattern, ImportDeclaration or ExportNamedDeclaration
 * node needs to be checked for missing line breaks
 * @param {ASTNode} node Node under inspection
 * @param {Object} options option specific to node type
 * @param {Token} first First object property
 * @param {Token} last Last object property
 * @returns {boolean} `true` if node needs to be checked for missing line breaks
 */
function areLineBreaksRequired(node, options, first, last) {
	let objectProperties;

	if (node.type === "ObjectExpression" || node.type === "ObjectPattern") {
		objectProperties = node.properties;
	} else {
		// is ImportDeclaration or ExportNamedDeclaration
		objectProperties = node.specifiers.filter(
			s => s.type === "ImportSpecifier" || s.type === "ExportSpecifier",
		);
	}

	return (
		objectProperties.length >= options.minProperties ||
		(options.multiline &&
			objectProperties.length > 0 &&
			first.loc.start.line !== last.loc.end.line)
	);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "object-curly-newline",
						url: "https://eslint.style/rules/object-curly-newline",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description:
				"Enforce consistent line breaks after opening and before closing braces",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/object-curly-newline",
		},

		fixable: "whitespace",

		schema: [
			{
				oneOf: [
					OPTION_VALUE,
					{
						type: "object",
						properties: {
							ObjectExpression: OPTION_VALUE,
							ObjectPattern: OPTION_VALUE,
							ImportDeclaration: OPTION_VALUE,
							ExportDeclaration: OPTION_VALUE,
						},
						additionalProperties: false,
						minProperties: 1,
					},
				],
			},
		],

		messages: {
			unexpectedLinebreakBeforeClosingBrace:
				"Unexpected line break before this closing brace.",
			unexpectedLinebreakAfterOpeningBrace:
				"Unexpected line break after this opening brace.",
			expectedLinebreakBeforeClosingBrace:
				"Expected a line break before this closing brace.",
			expectedLinebreakAfterOpeningBrace:
				"Expected a line break after this opening brace.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const normalizedOptions = normalizeOptions(context.options[0]);

		/**
		 * Reports a given node if it violated this rule.
		 * @param {ASTNode} node A node to check. This is an ObjectExpression, ObjectPattern, ImportDeclaration or ExportNamedDeclaration node.
		 * @returns {void}
		 */
		function check(node) {
			const options = normalizedOptions[node.type];

			if (
				(node.type === "ImportDeclaration" &&
					!node.specifiers.some(
						specifier => specifier.type === "ImportSpecifier",
					)) ||
				(node.type === "ExportNamedDeclaration" &&
					!node.specifiers.some(
						specifier => specifier.type === "ExportSpecifier",
					))
			) {
				return;
			}

			const openBrace = sourceCode.getFirstToken(
				node,
				token => token.value === "{",
			);

			let closeBrace;

			if (node.typeAnnotation) {
				closeBrace = sourceCode.getTokenBefore(node.typeAnnotation);
			} else {
				closeBrace = sourceCode.getLastToken(
					node,
					token => token.value === "}",
				);
			}

			let first = sourceCode.getTokenAfter(openBrace, {
				includeComments: true,
			});
			let last = sourceCode.getTokenBefore(closeBrace, {
				includeComments: true,
			});

			const needsLineBreaks = areLineBreaksRequired(
				node,
				options,
				first,
				last,
			);

			const hasCommentsFirstToken = astUtils.isCommentToken(first);
			const hasCommentsLastToken = astUtils.isCommentToken(last);

			/*
			 * Use tokens or comments to check multiline or not.
			 * But use only tokens to check whether line breaks are needed.
			 * This allows:
			 *     var obj = { // eslint-disable-line foo
			 *         a: 1
			 *     }
			 */
			first = sourceCode.getTokenAfter(openBrace);
			last = sourceCode.getTokenBefore(closeBrace);

			if (needsLineBreaks) {
				if (astUtils.isTokenOnSameLine(openBrace, first)) {
					context.report({
						messageId: "expectedLinebreakAfterOpeningBrace",
						node,
						loc: openBrace.loc,
						fix(fixer) {
							if (hasCommentsFirstToken) {
								return null;
							}

							return fixer.insertTextAfter(openBrace, "\n");
						},
					});
				}
				if (astUtils.isTokenOnSameLine(last, closeBrace)) {
					context.report({
						messageId: "expectedLinebreakBeforeClosingBrace",
						node,
						loc: closeBrace.loc,
						fix(fixer) {
							if (hasCommentsLastToken) {
								return null;
							}

							return fixer.insertTextBefore(closeBrace, "\n");
						},
					});
				}
			} else {
				const consistent = options.consistent;
				const hasLineBreakBetweenOpenBraceAndFirst =
					!astUtils.isTokenOnSameLine(openBrace, first);
				const hasLineBreakBetweenCloseBraceAndLast =
					!astUtils.isTokenOnSameLine(last, closeBrace);

				if (
					(!consistent && hasLineBreakBetweenOpenBraceAndFirst) ||
					(consistent &&
						hasLineBreakBetweenOpenBraceAndFirst &&
						!hasLineBreakBetweenCloseBraceAndLast)
				) {
					context.report({
						messageId: "unexpectedLinebreakAfterOpeningBrace",
						node,
						loc: openBrace.loc,
						fix(fixer) {
							if (hasCommentsFirstToken) {
								return null;
							}

							return fixer.removeRange([
								openBrace.range[1],
								first.range[0],
							]);
						},
					});
				}
				if (
					(!consistent && hasLineBreakBetweenCloseBraceAndLast) ||
					(consistent &&
						!hasLineBreakBetweenOpenBraceAndFirst &&
						hasLineBreakBetweenCloseBraceAndLast)
				) {
					context.report({
						messageId: "unexpectedLinebreakBeforeClosingBrace",
						node,
						loc: closeBrace.loc,
						fix(fixer) {
							if (hasCommentsLastToken) {
								return null;
							}

							return fixer.removeRange([
								last.range[1],
								closeBrace.range[0],
							]);
						},
					});
				}
			}
		}

		return {
			ObjectExpression: check,
			ObjectPattern: check,
			ImportDeclaration: check,
			ExportNamedDeclaration: check,
		};
	},
};
}xq(/**
 * @fileoverview Disallows or enforces spaces inside of object literals.
 * @author Jamund Ferguson
 * @deprecated in ESLint v8.53.0
 */
"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "object-curly-spacing",
						url: "https://eslint.style/rules/object-curly-spacing",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Enforce consistent spacing inside braces",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/object-curly-spacing",
		},

		fixable: "whitespace",

		schema: [
			{
				enum: ["always", "never"],
			},
			{
				type: "object",
				properties: {
					arraysInObjects: {
						type: "boolean",
					},
					objectsInObjects: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			requireSpaceBefore: "A space is required before '{{token}}'.",
			requireSpaceAfter: "A space is required after '{{token}}'.",
			unexpectedSpaceBefore:
				"There should be no space before '{{token}}'.",
			unexpectedSpaceAfter: "There should be no space after '{{token}}'.",
		},
	},

	create(context) {
		const spaced = context.options[0] === "always",
			sourceCode = context.sourceCode;

		/**
		 * Determines whether an option is set, relative to the spacing option.
		 * If spaced is "always", then check whether option is set to false.
		 * If spaced is "never", then check whether option is set to true.
		 * @param {Object} option The option to exclude.
		 * @returns {boolean} Whether or not the property is excluded.
		 */
		function isOptionSet(option) {
			return context.options[1]
				? context.options[1][option] === !spaced
				: false;
		}

		const options = {
			spaced,
			arraysInObjectsException: isOptionSet("arraysInObjects"),
			objectsInObjectsException: isOptionSet("objectsInObjects"),
		};

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Reports that there shouldn't be a space after the first token
		 * @param {ASTNode} node The node to report in the event of an error.
		 * @param {Token} token The token to use for the report.
		 * @returns {void}
		 */
		function reportNoBeginningSpace(node, token) {
			const nextToken = context.sourceCode.getTokenAfter(token, {
				includeComments: true,
			});

			context.report({
				node,
				loc: { start: token.loc.end, end: nextToken.loc.start },
				messageId: "unexpectedSpaceAfter",
				data: {
					token: token.value,
				},
				fix(fixer) {
					return fixer.removeRange([
						token.range[1],
						nextToken.range[0],
					]);
				},
			});
		}

		/**
		 * Reports that there shouldn't be a space before the last token
		 * @param {ASTNode} node The node to report in the event of an error.
		 * @param {Token} token The token to use for the report.
		 * @returns {void}
		 */
		function reportNoEndingSpace(node, token) {
			const previousToken = context.sourceCode.getTokenBefore(token, {
				includeComments: true,
			});

			context.report({
				node,
				loc: { start: previousToken.loc.end, end: token.loc.start },
				messageId: "unexpectedSpaceBefore",
				data: {
					token: token.value,
				},
				fix(fixer) {
					return fixer.removeRange([
						previousToken.range[1],
						token.range[0],
					]);
				},
			});
		}

		/**
		 * Reports that there should be a space after the first token
		 * @param {ASTNode} node The node to report in the event of an error.
		 * @param {Token} token The token to use for the report.
		 * @returns {void}
		 */
		function reportRequiredBeginningSpace(node, token) {
			context.report({
				node,
				loc: token.loc,
				messageId: "requireSpaceAfter",
				data: {
					token: token.value,
				},
				fix(fixer) {
					return fixer.insertTextAfter(token, " ");
				},
			});
		}

		/**
		 * Reports that there should be a space before the last token
		 * @param {ASTNode} node The node to report in the event of an error.
		 * @param {Token} token The token to use for the report.
		 * @returns {void}
		 */
		function reportRequiredEndingSpace(node, token) {
			context.report({
				node,
				loc: token.loc,
				messageId: "requireSpaceBefore",
				data: {
					token: token.value,
				},
				fix(fixer) {
					return fixer.insertTextBefore(token, " ");
				},
			});
		}

		/**
		 * Determines if spacing in curly braces is valid.
		 * @param {ASTNode} node The AST node to check.
		 * @param {Token} first The first token to check (should be the opening brace)
		 * @param {Token} second The second token to check (should be first after the opening brace)
		 * @param {Token} penultimate The penultimate token to check (should be last before closing brace)
		 * @param {Token} last The last token to check (should be closing brace)
		 * @returns {void}
		 */
		function validateBraceSpacing(node, first, second, penultimate, last) {
			if (astUtils.isTokenOnSameLine(first, second)) {
				const firstSpaced = sourceCode.isSpaceBetween(first, second);

				if (options.spaced && !firstSpaced) {
					reportRequiredBeginningSpace(node, first);
				}
				if (!options.spaced && firstSpaced && second.type !== "Line") {
					reportNoBeginningSpace(node, first);
				}
			}

			if (astUtils.isTokenOnSameLine(penultimate, last)) {
				const shouldCheckPenultimate =
					(options.arraysInObjectsException &&
						astUtils.isClosingBracketToken(penultimate)) ||
					(options.objectsInObjectsException &&
						astUtils.isClosingBraceToken(penultimate));
				const penultimateType =
					shouldCheckPenultimate &&
					sourceCode.getNodeByRangeIndex(penultimate.range[0]).type;

				const closingCurlyBraceMustBeSpaced =
					(options.arraysInObjectsException &&
						penultimateType === "ArrayExpression") ||
					(options.objectsInObjectsException &&
						(penultimateType === "ObjectExpression" ||
							penultimateType === "ObjectPattern"))
						? !options.spaced
						: options.spaced;

				const lastSpaced = sourceCode.isSpaceBetween(penultimate, last);

				if (closingCurlyBraceMustBeSpaced && !lastSpaced) {
					reportRequiredEndingSpace(node, last);
				}
				if (!closingCurlyBraceMustBeSpaced && lastSpaced) {
					reportNoEndingSpace(node, last);
				}
			}
		}

		/**
		 * Gets '}' token of an object node.
		 *
		 * Because the last token of object patterns might be a type annotation,
		 * this traverses tokens preceded by the last property, then returns the
		 * first '}' token.
		 * @param {ASTNode} node The node to get. This node is an
		 *      ObjectExpression or an ObjectPattern. And this node has one or
		 *      more properties.
		 * @returns {Token} '}' token.
		 */
		function getClosingBraceOfObject(node) {
			const lastProperty = node.properties.at(-1);

			return sourceCode.getTokenAfter(
				lastProperty,
				astUtils.isClosingBraceToken,
			);
		}

		/**
		 * Reports a given object node if spacing in curly braces is invalid.
		 * @param {ASTNode} node An ObjectExpression or ObjectPattern node to check.
		 * @returns {void}
		 */
		function checkForObject(node) {
			if (node.properties.length === 0) {
				return;
			}

			const first = sourceCode.getFirstToken(node),
				last = getClosingBraceOfObject(node),
				second = sourceCode.getTokenAfter(first, {
					includeComments: true,
				}),
				penultimate = sourceCode.getTokenBefore(last, {
					includeComments: true,
				});

			validateBraceSpacing(node, first, second, penultimate, last);
		}

		/**
		 * Reports a given import node if spacing in curly braces is invalid.
		 * @param {ASTNode} node An ImportDeclaration node to check.
		 * @returns {void}
		 */
		function checkForImport(node) {
			if (node.specifiers.length === 0) {
				return;
			}

			let firstSpecifier = node.specifiers[0];
			const lastSpecifier = node.specifiers.at(-1);

			if (lastSpecifier.type !== "ImportSpecifier") {
				return;
			}
			if (firstSpecifier.type !== "ImportSpecifier") {
				firstSpecifier = node.specifiers[1];
			}

			const first = sourceCode.getTokenBefore(firstSpecifier),
				last = sourceCode.getTokenAfter(
					lastSpecifier,
					astUtils.isNotCommaToken,
				),
				second = sourceCode.getTokenAfter(first, {
					includeComments: true,
				}),
				penultimate = sourceCode.getTokenBefore(last, {
					includeComments: true,
				});

			validateBraceSpacing(node, first, second, penultimate, last);
		}

		/**
		 * Reports a given export node if spacing in curly braces is invalid.
		 * @param {ASTNode} node An ExportNamedDeclaration node to check.
		 * @returns {void}
		 */
		function checkForExport(node) {
			if (node.specifiers.length === 0) {
				return;
			}

			const firstSpecifier = node.specifiers[0],
				lastSpecifier = node.specifiers.at(-1),
				first = sourceCode.getTokenBefore(firstSpecifier),
				last = sourceCode.getTokenAfter(
					lastSpecifier,
					astUtils.isNotCommaToken,
				),
				second = sourceCode.getTokenAfter(first, {
					includeComments: true,
				}),
				penultimate = sourceCode.getTokenBefore(last, {
					includeComments: true,
				});

			validateBraceSpacing(node, first, second, penultimate, last);
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			// var {x} = y;
			ObjectPattern: checkForObject,

			// var y = {x: 'y'}
			ObjectExpression: checkForObject,

			// import {y} from 'x';
			ImportDeclaration: checkForImport,

			// export {name} from 'yo';
			ExportNamedDeclaration: checkForExport,
		};
	},
};
AlԾxQ/**
 * @fileoverview Rule to enforce placing object properties on separate lines.
 * @author Vitor Balocco
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "object-property-newline",
						url: "https://eslint.style/rules/object-property-newline",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Enforce placing object properties on separate lines",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/object-property-newline",
		},

		schema: [
			{
				type: "object",
				properties: {
					allowAllPropertiesOnSameLine: {
						type: "boolean",
						default: false,
					},
					allowMultiplePropertiesPerLine: {
						// Deprecated
						type: "boolean",
						default: false,
					},
				},
				additionalProperties: false,
			},
		],

		fixable: "whitespace",

		messages: {
			propertiesOnNewlineAll:
				"Object properties must go on a new line if they aren't all on the same line.",
			propertiesOnNewline: "Object properties must go on a new line.",
		},
	},

	create(context) {
		const allowSameLine =
			context.options[0] &&
			(context.options[0].allowAllPropertiesOnSameLine ||
				context.options[0]
					.allowMultiplePropertiesPerLine); /* Deprecated */
		const messageId = allowSameLine
			? "propertiesOnNewlineAll"
			: "propertiesOnNewline";

		const sourceCode = context.sourceCode;

		return {
			ObjectExpression(node) {
				if (allowSameLine) {
					if (node.properties.length > 1) {
						const firstTokenOfFirstProperty =
							sourceCode.getFirstToken(node.properties[0]);
						const lastTokenOfLastProperty = sourceCode.getLastToken(
							node.properties.at(-1),
						);

						if (
							firstTokenOfFirstProperty.loc.end.line ===
							lastTokenOfLastProperty.loc.start.line
						) {
							// All keys and values are on the same line
							return;
						}
					}
				}

				for (let i = 1; i < node.properties.length; i++) {
					const lastTokenOfPreviousProperty = sourceCode.getLastToken(
						node.properties[i - 1],
					);
					const firstTokenOfCurrentProperty =
						sourceCode.getFirstToken(node.properties[i]);

					if (
						lastTokenOfPreviousProperty.loc.end.line ===
						firstTokenOfCurrentProperty.loc.start.line
					) {
						context.report({
							node,
							loc: firstTokenOfCurrentProperty.loc,
							messageId,
							fix(fixer) {
								const comma = sourceCode.getTokenBefore(
									firstTokenOfCurrentProperty,
								);
								const rangeAfterComma = [
									comma.range[1],
									firstTokenOfCurrentProperty.range[0],
								];

								// Don't perform a fix if there are any comments between the comma and the next property.
								if (
									sourceCode.text
										.slice(
											rangeAfterComma[0],
											rangeAfterComma[1],
										)
										.trim()
								) {
									return null;
								}

								return fixer.replaceTextRange(
									rangeAfterComma,
									"\n",
								);
							},
						});
					}
				}
			},
		};
	},
};
$}7g	x|H/**
 * @fileoverview Rule to enforce concise object methods and properties.
 * @author Jamund Ferguson
 */

"use strict";

const OPTIONS = {
	always: "always",
	never: "never",
	methods: "methods",
	properties: "properties",
	consistent: "consistent",
	consistentAsNeeded: "consistent-as-needed",
};

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------
const astUtils = require("./utils/ast-utils");

//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------
const CTOR_PREFIX_REGEX = /[^_$0-9]/u;
const JSDOC_COMMENT_REGEX = /^\s*\*/u;

/**
 * Determines if the first character of the name is a capital letter.
 * @param {string} name The name of the node to evaluate.
 * @returns {boolean} True if the first character of the property name is a capital letter, false if not.
 * @private
 */
function isConstructor(name) {
	const match = CTOR_PREFIX_REGEX.exec(name);

	// Not a constructor if name has no characters apart from '_', '$' and digits e.g. '_', '$$', '_8'
	if (!match) {
		return false;
	}

	const firstChar = name.charAt(match.index);

	return firstChar === firstChar.toUpperCase();
}

/**
 * Determines if the property can have a shorthand form.
 * @param {ASTNode} property Property AST node
 * @returns {boolean} True if the property can have a shorthand form
 * @private
 */
function canHaveShorthand(property) {
	return (
		property.kind !== "set" &&
		property.kind !== "get" &&
		property.type !== "SpreadElement" &&
		property.type !== "SpreadProperty" &&
		property.type !== "ExperimentalSpreadProperty"
	);
}

/**
 * Checks whether a node is a string literal.
 * @param {ASTNode} node Any AST node.
 * @returns {boolean} `true` if it is a string literal.
 */
function isStringLiteral(node) {
	return node.type === "Literal" && typeof node.value === "string";
}

/**
 * Determines if the property is a shorthand or not.
 * @param {ASTNode} property Property AST node
 * @returns {boolean} True if the property is considered shorthand, false if not.
 * @private
 */
function isShorthand(property) {
	// property.method is true when `{a(){}}`.
	return property.shorthand || property.method;
}

/**
 * Determines if the property's key and method or value are named equally.
 * @param {ASTNode} property Property AST node
 * @returns {boolean} True if the key and value are named equally, false if not.
 * @private
 */
function isRedundant(property) {
	const value = property.value;

	if (value.type === "FunctionExpression") {
		return !value.id; // Only anonymous should be shorthand method.
	}
	if (value.type === "Identifier") {
		return astUtils.getStaticPropertyName(property) === value.name;
	}

	return false;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------
/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Require or disallow method and property shorthand syntax for object literals",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/object-shorthand",
		},

		fixable: "code",

		schema: {
			anyOf: [
				{
					type: "array",
					items: [
						{
							enum: [
								"always",
								"methods",
								"properties",
								"never",
								"consistent",
								"consistent-as-needed",
							],
						},
					],
					minItems: 0,
					maxItems: 1,
				},
				{
					type: "array",
					items: [
						{
							enum: ["always", "methods", "properties"],
						},
						{
							type: "object",
							properties: {
								avoidQuotes: {
									type: "boolean",
								},
							},
							additionalProperties: false,
						},
					],
					minItems: 0,
					maxItems: 2,
				},
				{
					type: "array",
					items: [
						{
							enum: ["always", "methods"],
						},
						{
							type: "object",
							properties: {
								ignoreConstructors: {
									type: "boolean",
								},
								methodsIgnorePattern: {
									type: "string",
								},
								avoidQuotes: {
									type: "boolean",
								},
								avoidExplicitReturnArrows: {
									type: "boolean",
								},
							},
							additionalProperties: false,
						},
					],
					minItems: 0,
					maxItems: 2,
				},
			],
		},

		defaultOptions: ["always"],

		messages: {
			expectedAllPropertiesShorthanded:
				"Expected shorthand for all properties.",
			expectedLiteralMethodLongform:
				"Expected longform method syntax for string literal keys.",
			expectedPropertyShorthand: "Expected property shorthand.",
			expectedPropertyLongform: "Expected longform property syntax.",
			expectedMethodShorthand: "Expected method shorthand.",
			expectedMethodLongform: "Expected longform method syntax.",
			unexpectedMix:
				"Unexpected mix of shorthand and non-shorthand properties.",
		},
	},

	create(context) {
		const APPLY = context.options[0];
		const APPLY_TO_METHODS =
			APPLY === OPTIONS.methods || APPLY === OPTIONS.always;
		const APPLY_TO_PROPS =
			APPLY === OPTIONS.properties || APPLY === OPTIONS.always;
		const APPLY_NEVER = APPLY === OPTIONS.never;
		const APPLY_CONSISTENT = APPLY === OPTIONS.consistent;
		const APPLY_CONSISTENT_AS_NEEDED = APPLY === OPTIONS.consistentAsNeeded;

		const PARAMS = context.options[1] || {};
		const IGNORE_CONSTRUCTORS = PARAMS.ignoreConstructors;
		const METHODS_IGNORE_PATTERN = PARAMS.methodsIgnorePattern
			? new RegExp(PARAMS.methodsIgnorePattern, "u")
			: null;
		const AVOID_QUOTES = PARAMS.avoidQuotes;
		const AVOID_EXPLICIT_RETURN_ARROWS = !!PARAMS.avoidExplicitReturnArrows;
		const sourceCode = context.sourceCode;

		/**
		 * Ensures that an object's properties are consistently shorthand, or not shorthand at all.
		 * @param {ASTNode} node Property AST node
		 * @param {boolean} checkRedundancy Whether to check longform redundancy
		 * @returns {void}
		 */
		function checkConsistency(node, checkRedundancy) {
			// We are excluding getters/setters and spread properties as they are considered neither longform nor shorthand.
			const properties = node.properties.filter(canHaveShorthand);

			// Do we still have properties left after filtering the getters and setters?
			if (properties.length > 0) {
				const shorthandProperties = properties.filter(isShorthand);

				/*
				 * If we do not have an equal number of longform properties as
				 * shorthand properties, we are using the annotations inconsistently
				 */
				if (shorthandProperties.length !== properties.length) {
					// We have at least 1 shorthand property
					if (shorthandProperties.length > 0) {
						context.report({ node, messageId: "unexpectedMix" });
					} else if (checkRedundancy) {
						/*
						 * If all properties of the object contain a method or value with a name matching it's key,
						 * all the keys are redundant.
						 */
						const canAlwaysUseShorthand =
							properties.every(isRedundant);

						if (canAlwaysUseShorthand) {
							context.report({
								node,
								messageId: "expectedAllPropertiesShorthanded",
							});
						}
					}
				}
			}
		}

		/**
		 * Fixes a FunctionExpression node by making it into a shorthand property.
		 * @param {SourceCodeFixer} fixer The fixer object
		 * @param {ASTNode} node A `Property` node that has a `FunctionExpression` or `ArrowFunctionExpression` as its value
		 * @returns {Object} A fix for this node
		 */
		function makeFunctionShorthand(fixer, node) {
			const firstKeyToken = node.computed
				? sourceCode.getFirstToken(node, astUtils.isOpeningBracketToken)
				: sourceCode.getFirstToken(node.key);
			const lastKeyToken = node.computed
				? sourceCode.getFirstTokenBetween(
						node.key,
						node.value,
						astUtils.isClosingBracketToken,
					)
				: sourceCode.getLastToken(node.key);
			const keyText = sourceCode.text.slice(
				firstKeyToken.range[0],
				lastKeyToken.range[1],
			);
			let keyPrefix = "";

			// key: /* */ () => {}
			if (sourceCode.commentsExistBetween(lastKeyToken, node.value)) {
				return null;
			}

			if (node.value.async) {
				keyPrefix += "async ";
			}
			if (node.value.generator) {
				keyPrefix += "*";
			}

			const fixRange = [firstKeyToken.range[0], node.range[1]];
			const methodPrefix = keyPrefix + keyText;

			if (node.value.type === "FunctionExpression") {
				const functionToken = sourceCode
					.getTokens(node.value)
					.find(
						token =>
							token.type === "Keyword" &&
							token.value === "function",
					);
				const tokenBeforeParams = node.value.generator
					? sourceCode.getTokenAfter(functionToken)
					: functionToken;

				return fixer.replaceTextRange(
					fixRange,
					methodPrefix +
						sourceCode.text.slice(
							tokenBeforeParams.range[1],
							node.value.range[1],
						),
				);
			}

			const arrowToken = sourceCode.getTokenBefore(
				node.value.body,
				astUtils.isArrowToken,
			);
			const fnBody = sourceCode.text.slice(
				arrowToken.range[1],
				node.value.range[1],
			);

			// First token should not be `async`
			const firstValueToken = sourceCode.getFirstToken(node.value, {
				skip: node.value.async ? 1 : 0,
			});

			const sliceStart = firstValueToken.range[0];
			const sliceEnd = sourceCode.getTokenBefore(arrowToken).range[1];
			const shouldAddParens =
				node.value.params.length === 1 &&
				node.value.params[0].range[0] === sliceStart;

			const oldParamText = sourceCode.text.slice(sliceStart, sliceEnd);
			const newParamText = shouldAddParens
				? `(${oldParamText})`
				: oldParamText;

			return fixer.replaceTextRange(
				fixRange,
				methodPrefix + newParamText + fnBody,
			);
		}

		/**
		 * Fixes a FunctionExpression node by making it into a longform property.
		 * @param {SourceCodeFixer} fixer The fixer object
		 * @param {ASTNode} node A `Property` node that has a `FunctionExpression` as its value
		 * @returns {Object} A fix for this node
		 */
		function makeFunctionLongform(fixer, node) {
			const firstKeyToken = node.computed
				? sourceCode.getTokens(node).find(token => token.value === "[")
				: sourceCode.getFirstToken(node.key);
			const lastKeyToken = node.computed
				? sourceCode
						.getTokensBetween(node.key, node.value)
						.find(token => token.value === "]")
				: sourceCode.getLastToken(node.key);
			const keyText = sourceCode.text.slice(
				firstKeyToken.range[0],
				lastKeyToken.range[1],
			);
			let functionHeader = "function";

			if (node.value.async) {
				functionHeader = `async ${functionHeader}`;
			}
			if (node.value.generator) {
				functionHeader = `${functionHeader}*`;
			}

			return fixer.replaceTextRange(
				[node.range[0], lastKeyToken.range[1]],
				`${keyText}: ${functionHeader}`,
			);
		}

		/*
		 * To determine whether a given arrow function has a lexical identifier (`this`, `arguments`, `super`, or `new.target`),
		 * create a stack of functions that define these identifiers (i.e. all functions except arrow functions) as the AST is
		 * traversed. Whenever a new function is encountered, create a new entry on the stack (corresponding to a different lexical
		 * scope of `this`), and whenever a function is exited, pop that entry off the stack. When an arrow function is entered,
		 * keep a reference to it on the current stack entry, and remove that reference when the arrow function is exited.
		 * When a lexical identifier is encountered, mark all the arrow functions on the current stack entry by adding them
		 * to an `arrowsWithLexicalIdentifiers` set. Any arrow function in that set will not be reported by this rule,
		 * because converting it into a method would change the value of one of the lexical identifiers.
		 */
		const lexicalScopeStack = [];
		const arrowsWithLexicalIdentifiers = new WeakSet();
		const argumentsIdentifiers = new WeakSet();

		/**
		 * Enters a function. This creates a new lexical identifier scope, so a new Set of arrow functions is pushed onto the stack.
		 * Also, this marks all `arguments` identifiers so that they can be detected later.
		 * @param {ASTNode} node The node representing the function.
		 * @returns {void}
		 */
		function enterFunction(node) {
			lexicalScopeStack.unshift(new Set());
			sourceCode
				.getScope(node)
				.variables.filter(variable => variable.name === "arguments")
				.forEach(variable => {
					variable.references
						.map(ref => ref.identifier)
						.forEach(identifier =>
							argumentsIdentifiers.add(identifier),
						);
				});
		}

		/**
		 * Exits a function. This pops the current set of arrow functions off the lexical scope stack.
		 * @returns {void}
		 */
		function exitFunction() {
			lexicalScopeStack.shift();
		}

		/**
		 * Marks the current function as having a lexical keyword. This implies that all arrow functions
		 * in the current lexical scope contain a reference to this lexical keyword.
		 * @returns {void}
		 */
		function reportLexicalIdentifier() {
			lexicalScopeStack[0].forEach(arrowFunction =>
				arrowsWithLexicalIdentifiers.add(arrowFunction),
			);
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			Program: enterFunction,
			FunctionDeclaration: enterFunction,
			FunctionExpression: enterFunction,
			"Program:exit": exitFunction,
			"FunctionDeclaration:exit": exitFunction,
			"FunctionExpression:exit": exitFunction,

			ArrowFunctionExpression(node) {
				lexicalScopeStack[0].add(node);
			},
			"ArrowFunctionExpression:exit"(node) {
				lexicalScopeStack[0].delete(node);
			},

			ThisExpression: reportLexicalIdentifier,
			Super: reportLexicalIdentifier,
			MetaProperty(node) {
				if (
					node.meta.name === "new" &&
					node.property.name === "target"
				) {
					reportLexicalIdentifier();
				}
			},
			Identifier(node) {
				if (argumentsIdentifiers.has(node)) {
					reportLexicalIdentifier();
				}
			},

			ObjectExpression(node) {
				if (APPLY_CONSISTENT) {
					checkConsistency(node, false);
				} else if (APPLY_CONSISTENT_AS_NEEDED) {
					checkConsistency(node, true);
				}
			},

			"Property:exit"(node) {
				const isConciseProperty = node.method || node.shorthand;

				// Ignore destructuring assignment
				if (node.parent.type === "ObjectPattern") {
					return;
				}

				// getters and setters are ignored
				if (node.kind === "get" || node.kind === "set") {
					return;
				}

				// only computed methods can fail the following checks
				if (
					node.computed &&
					node.value.type !== "FunctionExpression" &&
					node.value.type !== "ArrowFunctionExpression"
				) {
					return;
				}

				//--------------------------------------------------------------
				// Checks for property/method shorthand.
				if (isConciseProperty) {
					if (
						node.method &&
						(APPLY_NEVER ||
							(AVOID_QUOTES && isStringLiteral(node.key)))
					) {
						const messageId = APPLY_NEVER
							? "expectedMethodLongform"
							: "expectedLiteralMethodLongform";

						// { x() {} } should be written as { x: function() {} }
						context.report({
							node,
							messageId,
							fix: fixer => makeFunctionLongform(fixer, node),
						});
					} else if (APPLY_NEVER) {
						// { x } should be written as { x: x }
						context.report({
							node,
							messageId: "expectedPropertyLongform",
							fix: fixer =>
								fixer.insertTextAfter(
									node.key,
									`: ${node.key.name}`,
								),
						});
					}
				} else if (
					APPLY_TO_METHODS &&
					!node.value.id &&
					(node.value.type === "FunctionExpression" ||
						node.value.type === "ArrowFunctionExpression")
				) {
					if (
						IGNORE_CONSTRUCTORS &&
						node.key.type === "Identifier" &&
						isConstructor(node.key.name)
					) {
						return;
					}

					if (METHODS_IGNORE_PATTERN) {
						const propertyName =
							astUtils.getStaticPropertyName(node);

						if (
							propertyName !== null &&
							METHODS_IGNORE_PATTERN.test(propertyName)
						) {
							return;
						}
					}

					if (AVOID_QUOTES && isStringLiteral(node.key)) {
						return;
					}

					// {[x]: function(){}} should be written as {[x]() {}}
					if (
						node.value.type === "FunctionExpression" ||
						(node.value.type === "ArrowFunctionExpression" &&
							node.value.body.type === "BlockStatement" &&
							AVOID_EXPLICIT_RETURN_ARROWS &&
							!arrowsWithLexicalIdentifiers.has(node.value))
					) {
						context.report({
							node,
							messageId: "expectedMethodShorthand",
							fix: fixer => makeFunctionShorthand(fixer, node),
						});
					}
				} else if (
					node.value.type === "Identifier" &&
					node.key.name === node.value.name &&
					APPLY_TO_PROPS
				) {
					// Skip if there are JSDoc comments inside the property (e.g., JSDoc type annotations)
					const comments = sourceCode.getCommentsInside(node);
					if (
						comments.some(
							comment =>
								comment.type === "Block" &&
								JSDOC_COMMENT_REGEX.test(comment.value) &&
								comment.value.includes("@type"),
						)
					) {
						return;
					}

					// {x: x} should be written as {x}
					context.report({
						node,
						messageId: "expectedPropertyShorthand",
						fix(fixer) {
							// x: /* */ x
							// x: (/* */ x)
							if (sourceCode.getCommentsInside(node).length > 0) {
								return null;
							}

							return fixer.replaceText(node, node.value.name);
						},
					});
				} else if (
					node.value.type === "Identifier" &&
					node.key.type === "Literal" &&
					node.key.value === node.value.name &&
					APPLY_TO_PROPS
				) {
					if (AVOID_QUOTES) {
						return;
					}

					const comments = sourceCode.getCommentsInside(node);
					if (
						comments.some(
							comment =>
								comment.type === "Block" &&
								comment.value.startsWith("*") &&
								comment.value.includes("@type"),
						)
					) {
						return;
					}

					// {"x": x} should be written as {x}
					context.report({
						node,
						messageId: "expectedPropertyShorthand",
						fix(fixer) {
							// "x": /* */ x
							// "x": (/* */ x)
							if (sourceCode.getCommentsInside(node).length > 0) {
								return null;
							}

							return fixer.replaceText(node, node.value.name);
						},
					});
				}
			},
		};
	},
};
vxL/**
 * @fileoverview Rule to check multiple var declarations per line
 * @author Alberto Rodríguez
 * @deprecated in ESLint v8.53.0
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "one-var-declaration-per-line",
						url: "https://eslint.style/rules/one-var-declaration-per-line",
					},
				},
			],
		},
		type: "suggestion",

		docs: {
			description:
				"Require or disallow newlines around variable declarations",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/one-var-declaration-per-line",
		},

		schema: [
			{
				enum: ["always", "initializations"],
			},
		],

		fixable: "whitespace",

		messages: {
			expectVarOnNewline:
				"Expected variable declaration to be on a new line.",
		},
	},

	create(context) {
		const always = context.options[0] === "always";

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Determine if provided keyword is a variant of for specifiers
		 * @private
		 * @param {string} keyword keyword to test
		 * @returns {boolean} True if `keyword` is a variant of for specifier
		 */
		function isForTypeSpecifier(keyword) {
			return (
				keyword === "ForStatement" ||
				keyword === "ForInStatement" ||
				keyword === "ForOfStatement"
			);
		}

		/**
		 * Checks newlines around variable declarations.
		 * @private
		 * @param {ASTNode} node `VariableDeclaration` node to test
		 * @returns {void}
		 */
		function checkForNewLine(node) {
			if (isForTypeSpecifier(node.parent.type)) {
				return;
			}

			const declarations = node.declarations;
			let prev;

			declarations.forEach(current => {
				if (prev && prev.loc.end.line === current.loc.start.line) {
					if (always || prev.init || current.init) {
						context.report({
							node,
							messageId: "expectVarOnNewline",
							loc: current.loc,
							fix: fixer => fixer.insertTextBefore(current, "\n"),
						});
					}
				}
				prev = current;
			});
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			VariableDeclaration: checkForNewLine,
		};
	},
};
/V¾	xJ/**
 * @fileoverview A rule to control the use of single variable declarations.
 * @author Ian Christian Myers
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Determines whether the given node is in a statement list.
 * @param {ASTNode} node node to check
 * @returns {boolean} `true` if the given node is in a statement list
 */
function isInStatementList(node) {
	return astUtils.STATEMENT_LIST_PARENTS.has(node.parent.type);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Enforce variables to be declared either together or separately in functions",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/one-var",
		},

		fixable: "code",

		schema: [
			{
				oneOf: [
					{
						enum: ["always", "never", "consecutive"],
					},
					{
						type: "object",
						properties: {
							separateRequires: {
								type: "boolean",
							},
							var: {
								enum: ["always", "never", "consecutive"],
							},
							let: {
								enum: ["always", "never", "consecutive"],
							},
							const: {
								enum: ["always", "never", "consecutive"],
							},
							using: {
								enum: ["always", "never", "consecutive"],
							},
							awaitUsing: {
								enum: ["always", "never", "consecutive"],
							},
						},
						additionalProperties: false,
					},
					{
						type: "object",
						properties: {
							initialized: {
								enum: ["always", "never", "consecutive"],
							},
							uninitialized: {
								enum: ["always", "never", "consecutive"],
							},
						},
						additionalProperties: false,
					},
				],
			},
		],

		defaultOptions: ["always"],

		messages: {
			combineUninitialized:
				"Combine this with the previous '{{type}}' statement with uninitialized variables.",
			combineInitialized:
				"Combine this with the previous '{{type}}' statement with initialized variables.",
			splitUninitialized:
				"Split uninitialized '{{type}}' declarations into multiple statements.",
			splitInitialized:
				"Split initialized '{{type}}' declarations into multiple statements.",
			splitRequires:
				"Split requires to be separated into a single block.",
			combine: "Combine this with the previous '{{type}}' statement.",
			split: "Split '{{type}}' declarations into multiple statements.",
		},
	},

	create(context) {
		const MODE_ALWAYS = "always";
		const MODE_NEVER = "never";
		const MODE_CONSECUTIVE = "consecutive";
		const mode = context.options[0];

		const options = {};

		if (typeof mode === "string") {
			// simple options configuration with just a string
			options.var = { uninitialized: mode, initialized: mode };
			options.let = { uninitialized: mode, initialized: mode };
			options.const = { uninitialized: mode, initialized: mode };
			options.using = { uninitialized: mode, initialized: mode };
			options.awaitUsing = { uninitialized: mode, initialized: mode };
		} else if (typeof mode === "object") {
			// options configuration is an object
			options.separateRequires = !!mode.separateRequires;
			options.var = { uninitialized: mode.var, initialized: mode.var };
			options.let = { uninitialized: mode.let, initialized: mode.let };
			options.const = {
				uninitialized: mode.const,
				initialized: mode.const,
			};
			options.using = {
				uninitialized: mode.using,
				initialized: mode.using,
			};
			options.awaitUsing = {
				uninitialized: mode.awaitUsing,
				initialized: mode.awaitUsing,
			};
			if (Object.hasOwn(mode, "uninitialized")) {
				options.var.uninitialized = mode.uninitialized;
				options.let.uninitialized = mode.uninitialized;
				options.const.uninitialized = mode.uninitialized;
				options.using.uninitialized = mode.uninitialized;
				options.awaitUsing.uninitialized = mode.uninitialized;
			}
			if (Object.hasOwn(mode, "initialized")) {
				options.var.initialized = mode.initialized;
				options.let.initialized = mode.initialized;
				options.const.initialized = mode.initialized;
				options.using.initialized = mode.initialized;
				options.awaitUsing.initialized = mode.initialized;
			}
		}

		const sourceCode = context.sourceCode;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		const functionStack = [];
		const blockStack = [];

		/**
		 * Increments the blockStack counter.
		 * @returns {void}
		 * @private
		 */
		function startBlock() {
			blockStack.push({
				let: { initialized: false, uninitialized: false },
				const: { initialized: false, uninitialized: false },
				using: { initialized: false, uninitialized: false },
				awaitUsing: { initialized: false, uninitialized: false },
			});
		}

		/**
		 * Increments the functionStack counter.
		 * @returns {void}
		 * @private
		 */
		function startFunction() {
			functionStack.push({ initialized: false, uninitialized: false });
			startBlock();
		}

		/**
		 * Decrements the blockStack counter.
		 * @returns {void}
		 * @private
		 */
		function endBlock() {
			blockStack.pop();
		}

		/**
		 * Decrements the functionStack counter.
		 * @returns {void}
		 * @private
		 */
		function endFunction() {
			functionStack.pop();
			endBlock();
		}

		/**
		 * Check if a variable declaration is a require.
		 * @param {ASTNode} decl variable declaration Node
		 * @returns {bool} if decl is a require, return true; else return false.
		 * @private
		 */
		function isRequire(decl) {
			return (
				decl.init &&
				decl.init.type === "CallExpression" &&
				decl.init.callee.name === "require"
			);
		}

		/**
		 * Records whether initialized/uninitialized/required variables are defined in current scope.
		 * @param {string} statementType one of: "var", "let", "const", "using", or "awaitUsing"
		 * @param {ASTNode[]} declarations List of declarations
		 * @param {Object} currentScope The scope being investigated
		 * @returns {void}
		 * @private
		 */
		function recordTypes(statementType, declarations, currentScope) {
			for (let i = 0; i < declarations.length; i++) {
				if (declarations[i].init === null) {
					if (
						options[statementType] &&
						options[statementType].uninitialized === MODE_ALWAYS
					) {
						currentScope.uninitialized = true;
					}
				} else {
					if (
						options[statementType] &&
						options[statementType].initialized === MODE_ALWAYS
					) {
						if (
							options.separateRequires &&
							isRequire(declarations[i])
						) {
							currentScope.required = true;
						} else {
							currentScope.initialized = true;
						}
					}
				}
			}
		}

		/**
		 * Determines the current scope (function or block)
		 * @param {string} statementType one of: "var", "let", "const", "using", or "awaitUsing"
		 * @returns {Object} The scope associated with statementType
		 */
		function getCurrentScope(statementType) {
			let currentScope;

			if (statementType === "var") {
				currentScope = functionStack.at(-1);
			} else if (statementType === "let") {
				currentScope = blockStack.at(-1).let;
			} else if (statementType === "const") {
				currentScope = blockStack.at(-1).const;
			} else if (statementType === "using") {
				currentScope = blockStack.at(-1).using;
			} else if (statementType === "awaitUsing") {
				currentScope = blockStack.at(-1).awaitUsing;
			}
			return currentScope;
		}

		/**
		 * Counts the number of initialized and uninitialized declarations in a list of declarations
		 * @param {ASTNode[]} declarations List of declarations
		 * @returns {Object} Counts of 'uninitialized' and 'initialized' declarations
		 * @private
		 */
		function countDeclarations(declarations) {
			const counts = { uninitialized: 0, initialized: 0 };

			for (let i = 0; i < declarations.length; i++) {
				if (declarations[i].init === null) {
					counts.uninitialized++;
				} else {
					counts.initialized++;
				}
			}
			return counts;
		}

		/**
		 * Determines if there is more than one var statement in the current scope.
		 * @param {string} statementType one of: "var", "let", "const", "using", or "awaitUsing"
		 * @param {ASTNode[]} declarations List of declarations
		 * @returns {boolean} Returns true if it is the first var declaration, false if not.
		 * @private
		 */
		function hasOnlyOneStatement(statementType, declarations) {
			const declarationCounts = countDeclarations(declarations);
			const currentOptions = options[statementType] || {};
			const currentScope = getCurrentScope(statementType);
			const hasRequires = declarations.some(isRequire);

			if (
				currentOptions.uninitialized === MODE_ALWAYS &&
				currentOptions.initialized === MODE_ALWAYS
			) {
				if (currentScope.uninitialized || currentScope.initialized) {
					if (!hasRequires) {
						return false;
					}
				}
			}

			if (declarationCounts.uninitialized > 0) {
				if (
					currentOptions.uninitialized === MODE_ALWAYS &&
					currentScope.uninitialized
				) {
					return false;
				}
			}
			if (declarationCounts.initialized > 0) {
				if (
					currentOptions.initialized === MODE_ALWAYS &&
					currentScope.initialized
				) {
					if (!hasRequires) {
						return false;
					}
				}
			}
			if (currentScope.required && hasRequires) {
				return false;
			}
			recordTypes(statementType, declarations, currentScope);
			return true;
		}

		/**
		 * Fixer to join VariableDeclaration's into a single declaration
		 * @param {VariableDeclarator[]} declarations The `VariableDeclaration` to join
		 * @returns {Function} The fixer function
		 */
		function joinDeclarations(declarations) {
			const declaration = declarations[0];
			const body = Array.isArray(declaration.parent.parent.body)
				? declaration.parent.parent.body
				: [];
			const currentIndex = body.findIndex(
				node => node.range[0] === declaration.parent.range[0],
			);
			const previousNode = body[currentIndex - 1];

			return function* joinDeclarationsFixer(fixer) {
				const type = sourceCode.getFirstToken(declaration.parent);
				const beforeType = sourceCode.getTokenBefore(type);

				if (
					previousNode &&
					previousNode.kind === declaration.parent.kind
				) {
					if (beforeType.value === ";") {
						yield fixer.replaceText(beforeType, ",");
					} else {
						yield fixer.insertTextAfter(beforeType, ",");
					}

					if (declaration.parent.kind === "await using") {
						const usingToken = sourceCode.getTokenAfter(type);
						yield fixer.remove(usingToken);
					}

					yield fixer.replaceText(type, "");
				}
			};
		}

		/**
		 * Fixer to split a VariableDeclaration into individual declarations
		 * @param {VariableDeclaration} declaration The `VariableDeclaration` to split
		 * @returns {Function|null} The fixer function
		 */
		function splitDeclarations(declaration) {
			const { parent } = declaration;

			// don't autofix code such as: if (foo) var x, y;
			if (
				!isInStatementList(
					parent.type === "ExportNamedDeclaration"
						? parent
						: declaration,
				)
			) {
				return null;
			}

			return fixer =>
				declaration.declarations
					.map(declarator => {
						const tokenAfterDeclarator =
							sourceCode.getTokenAfter(declarator);

						if (tokenAfterDeclarator === null) {
							return null;
						}

						const afterComma = sourceCode.getTokenAfter(
							tokenAfterDeclarator,
							{ includeComments: true },
						);

						if (tokenAfterDeclarator.value !== ",") {
							return null;
						}

						const exportPlacement =
							declaration.parent.type === "ExportNamedDeclaration"
								? "export "
								: "";

						/*
						 * `var x,y`
						 * tokenAfterDeclarator ^^ afterComma
						 */
						if (
							afterComma.range[0] ===
							tokenAfterDeclarator.range[1]
						) {
							return fixer.replaceText(
								tokenAfterDeclarator,
								`; ${exportPlacement}${declaration.kind} `,
							);
						}

						/*
						 * `var x,
						 * tokenAfterDeclarator ^
						 *      y`
						 *      ^ afterComma
						 */
						if (
							afterComma.loc.start.line >
								tokenAfterDeclarator.loc.end.line ||
							afterComma.type === "Line" ||
							afterComma.type === "Block"
						) {
							let lastComment = afterComma;

							while (
								lastComment.type === "Line" ||
								lastComment.type === "Block"
							) {
								lastComment = sourceCode.getTokenAfter(
									lastComment,
									{ includeComments: true },
								);
							}

							return fixer.replaceTextRange(
								[
									tokenAfterDeclarator.range[0],
									lastComment.range[0],
								],
								`;${sourceCode.text.slice(
									tokenAfterDeclarator.range[1],
									lastComment.range[0],
								)}${exportPlacement}${declaration.kind} `,
							);
						}

						return fixer.replaceText(
							tokenAfterDeclarator,
							`; ${exportPlacement}${declaration.kind}`,
						);
					})
					.filter(x => x);
		}

		/**
		 * Checks a given VariableDeclaration node for errors.
		 * @param {ASTNode} node The VariableDeclaration node to check
		 * @returns {void}
		 * @private
		 */
		function checkVariableDeclaration(node) {
			const parent = node.parent;
			const type = node.kind;
			const key = type === "await using" ? "awaitUsing" : type;

			if (!options[key]) {
				return;
			}

			const declarations = node.declarations;
			const declarationCounts = countDeclarations(declarations);
			const mixedRequires =
				declarations.some(isRequire) && !declarations.every(isRequire);

			if (options[key].initialized === MODE_ALWAYS) {
				if (options.separateRequires && mixedRequires) {
					context.report({
						node,
						messageId: "splitRequires",
					});
				}
			}

			// consecutive
			const nodeIndex =
				(parent.body &&
					parent.body.length > 0 &&
					parent.body.indexOf(node)) ||
				0;

			if (nodeIndex > 0) {
				const previousNode = parent.body[nodeIndex - 1];
				const isPreviousNodeDeclaration =
					previousNode.type === "VariableDeclaration";
				const declarationsWithPrevious = declarations.concat(
					previousNode.declarations || [],
				);

				if (
					isPreviousNodeDeclaration &&
					previousNode.kind === type &&
					!(
						declarationsWithPrevious.some(isRequire) &&
						!declarationsWithPrevious.every(isRequire)
					)
				) {
					const previousDeclCounts = countDeclarations(
						previousNode.declarations,
					);

					if (
						options[key].initialized === MODE_CONSECUTIVE &&
						options[key].uninitialized === MODE_CONSECUTIVE
					) {
						context.report({
							node,
							messageId: "combine",
							data: {
								type,
							},
							fix: joinDeclarations(declarations),
						});
					} else if (
						options[key].initialized === MODE_CONSECUTIVE &&
						declarationCounts.initialized > 0 &&
						previousDeclCounts.initialized > 0
					) {
						context.report({
							node,
							messageId: "combineInitialized",
							data: {
								type,
							},
							fix: joinDeclarations(declarations),
						});
					} else if (
						options[key].uninitialized === MODE_CONSECUTIVE &&
						declarationCounts.uninitialized > 0 &&
						previousDeclCounts.uninitialized > 0
					) {
						context.report({
							node,
							messageId: "combineUninitialized",
							data: {
								type,
							},
							fix: joinDeclarations(declarations),
						});
					}
				}
			}

			// always
			if (!hasOnlyOneStatement(key, declarations)) {
				if (
					options[key].initialized === MODE_ALWAYS &&
					options[key].uninitialized === MODE_ALWAYS
				) {
					context.report({
						node,
						messageId: "combine",
						data: {
							type,
						},
						fix: joinDeclarations(declarations),
					});
				} else {
					if (
						options[key].initialized === MODE_ALWAYS &&
						declarationCounts.initialized > 0
					) {
						context.report({
							node,
							messageId: "combineInitialized",
							data: {
								type,
							},
							fix: joinDeclarations(declarations),
						});
					}
					if (
						options[key].uninitialized === MODE_ALWAYS &&
						declarationCounts.uninitialized > 0
					) {
						if (
							node.parent.left === node &&
							(node.parent.type === "ForInStatement" ||
								node.parent.type === "ForOfStatement")
						) {
							return;
						}
						context.report({
							node,
							messageId: "combineUninitialized",
							data: {
								type,
							},
							fix: joinDeclarations(declarations),
						});
					}
				}
			}

			// never
			if (parent.type !== "ForStatement" || parent.init !== node) {
				const totalDeclarations =
					declarationCounts.uninitialized +
					declarationCounts.initialized;

				if (totalDeclarations > 1) {
					if (
						options[key].initialized === MODE_NEVER &&
						options[key].uninitialized === MODE_NEVER
					) {
						// both initialized and uninitialized
						context.report({
							node,
							messageId: "split",
							data: {
								type,
							},
							fix: splitDeclarations(node),
						});
					} else if (
						options[key].initialized === MODE_NEVER &&
						declarationCounts.initialized > 0
					) {
						// initialized
						context.report({
							node,
							messageId: "splitInitialized",
							data: {
								type,
							},
							fix: splitDeclarations(node),
						});
					} else if (
						options[key].uninitialized === MODE_NEVER &&
						declarationCounts.uninitialized > 0
					) {
						// uninitialized
						context.report({
							node,
							messageId: "splitUninitialized",
							data: {
								type,
							},
							fix: splitDeclarations(node),
						});
					}
				}
			}
		}

		//--------------------------------------------------------------------------
		// Public API
		//--------------------------------------------------------------------------

		return {
			Program: startFunction,
			FunctionDeclaration: startFunction,
			FunctionExpression: startFunction,
			ArrowFunctionExpression: startFunction,
			StaticBlock: startFunction, // StaticBlock creates a new scope for `var` variables

			BlockStatement: startBlock,
			ForStatement: startBlock,
			ForInStatement: startBlock,
			ForOfStatement: startBlock,
			SwitchStatement: startBlock,
			VariableDeclaration: checkVariableDeclaration,
			"ForStatement:exit": endBlock,
			"ForOfStatement:exit": endBlock,
			"ForInStatement:exit": endBlock,
			"SwitchStatement:exit": endBlock,
			"BlockStatement:exit": endBlock,

			"Program:exit": endFunction,
			"FunctionDeclaration:exit": endFunction,
			"FunctionExpression:exit": endFunction,
			"ArrowFunctionExpression:exit": endFunction,
			"StaticBlock:exit": endFunction,
		};
	},
};
gxp/**
 * @fileoverview Rule to replace assignment expressions with operator assignment
 * @author Brandon Mills
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Checks whether an operator is commutative and has an operator assignment
 * shorthand form.
 * @param {string} operator Operator to check.
 * @returns {boolean} True if the operator is commutative and has a
 *     shorthand form.
 */
function isCommutativeOperatorWithShorthand(operator) {
	return ["*", "&", "^", "|"].includes(operator);
}

/**
 * Checks whether an operator is not commutative and has an operator assignment
 * shorthand form.
 * @param {string} operator Operator to check.
 * @returns {boolean} True if the operator is not commutative and has
 *     a shorthand form.
 */
function isNonCommutativeOperatorWithShorthand(operator) {
	return ["+", "-", "/", "%", "<<", ">>", ">>>", "**"].includes(operator);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/**
 * Determines if the left side of a node can be safely fixed (i.e. if it activates the same getters/setters and)
 * toString calls regardless of whether assignment shorthand is used)
 * @param {ASTNode} node The node on the left side of the expression
 * @returns {boolean} `true` if the node can be fixed
 */
function canBeFixed(node) {
	return (
		node.type === "Identifier" ||
		(node.type === "MemberExpression" &&
			(node.object.type === "Identifier" ||
				node.object.type === "ThisExpression") &&
			(!node.computed || node.property.type === "Literal"))
	);
}

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: ["always"],

		docs: {
			description:
				"Require or disallow assignment operator shorthand where possible",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/operator-assignment",
		},

		schema: [
			{
				enum: ["always", "never"],
			},
		],

		fixable: "code",
		messages: {
			replaced:
				"Assignment (=) can be replaced with operator assignment ({{operator}}).",
			unexpected:
				"Unexpected operator assignment ({{operator}}) shorthand.",
		},
	},

	create(context) {
		const never = context.options[0] === "never";
		const sourceCode = context.sourceCode;

		/**
		 * Returns the operator token of an AssignmentExpression or BinaryExpression
		 * @param {ASTNode} node An AssignmentExpression or BinaryExpression node
		 * @returns {Token} The operator token in the node
		 */
		function getOperatorToken(node) {
			return sourceCode.getFirstTokenBetween(
				node.left,
				node.right,
				token => token.value === node.operator,
			);
		}

		/**
		 * Ensures that an assignment uses the shorthand form where possible.
		 * @param {ASTNode} node An AssignmentExpression node.
		 * @returns {void}
		 */
		function verify(node) {
			if (
				node.operator !== "=" ||
				node.right.type !== "BinaryExpression"
			) {
				return;
			}

			const left = node.left;
			const expr = node.right;
			const operator = expr.operator;

			if (
				isCommutativeOperatorWithShorthand(operator) ||
				isNonCommutativeOperatorWithShorthand(operator)
			) {
				const replacementOperator = `${operator}=`;

				if (astUtils.isSameReference(left, expr.left, true)) {
					context.report({
						node,
						messageId: "replaced",
						data: { operator: replacementOperator },
						fix(fixer) {
							if (canBeFixed(left) && canBeFixed(expr.left)) {
								const equalsToken = getOperatorToken(node);
								const operatorToken = getOperatorToken(expr);
								const leftText = sourceCode
									.getText()
									.slice(node.range[0], equalsToken.range[0]);
								const rightText = sourceCode
									.getText()
									.slice(
										operatorToken.range[1],
										node.right.range[1],
									);

								// Check for comments that would be removed.
								if (
									sourceCode.commentsExistBetween(
										equalsToken,
										operatorToken,
									)
								) {
									return null;
								}

								return fixer.replaceText(
									node,
									`${leftText}${replacementOperator}${rightText}`,
								);
							}
							return null;
						},
					});
				} else if (
					astUtils.isSameReference(left, expr.right, true) &&
					isCommutativeOperatorWithShorthand(operator)
				) {
					/*
					 * This case can't be fixed safely.
					 * If `a` and `b` both have custom valueOf() behavior, then fixing `a = b * a` to `a *= b` would
					 * change the execution order of the valueOf() functions.
					 */
					context.report({
						node,
						messageId: "replaced",
						data: { operator: replacementOperator },
					});
				}
			}
		}

		/**
		 * Warns if an assignment expression uses operator assignment shorthand.
		 * @param {ASTNode} node An AssignmentExpression node.
		 * @returns {void}
		 */
		function prohibit(node) {
			if (
				node.operator !== "=" &&
				!astUtils.isLogicalAssignmentOperator(node.operator)
			) {
				context.report({
					node,
					messageId: "unexpected",
					data: { operator: node.operator },
					fix(fixer) {
						if (canBeFixed(node.left)) {
							const firstToken = sourceCode.getFirstToken(node);
							const operatorToken = getOperatorToken(node);
							const leftText = sourceCode
								.getText()
								.slice(node.range[0], operatorToken.range[0]);
							const newOperator = node.operator.slice(0, -1);
							let rightText;

							// Check for comments that would be duplicated.
							if (
								sourceCode.commentsExistBetween(
									firstToken,
									operatorToken,
								)
							) {
								return null;
							}

							// If this change would modify precedence (e.g. `foo *= bar + 1` => `foo = foo * (bar + 1)`), parenthesize the right side.
							if (
								astUtils.getPrecedence(node.right) <=
									astUtils.getPrecedence({
										type: "BinaryExpression",
										operator: newOperator,
									}) &&
								!astUtils.isParenthesised(
									sourceCode,
									node.right,
								)
							) {
								rightText = `${sourceCode.text.slice(operatorToken.range[1], node.right.range[0])}(${sourceCode.getText(node.right)})`;
							} else {
								const tokenAfterOperator =
									sourceCode.getTokenAfter(operatorToken, {
										includeComments: true,
									});
								let rightTextPrefix = "";

								if (
									operatorToken.range[1] ===
										tokenAfterOperator.range[0] &&
									!astUtils.canTokensBeAdjacent(
										{
											type: "Punctuator",
											value: newOperator,
										},
										tokenAfterOperator,
									)
								) {
									rightTextPrefix = " "; // foo+=+bar -> foo= foo+ +bar
								}

								rightText = `${rightTextPrefix}${sourceCode.text.slice(operatorToken.range[1], node.range[1])}`;
							}

							return fixer.replaceText(
								node,
								`${leftText}= ${leftText}${newOperator}${rightText}`,
							);
						}
						return null;
					},
				});
			}
		}

		return {
			AssignmentExpression: !never ? verify : prohibit,
		};
	},
};
o̵x":/**
 * @fileoverview Operator linebreak - enforces operator linebreak style of two types: after and before
 * @author Benoît Zugmeyer
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "operator-linebreak",
						url: "https://eslint.style/rules/operator-linebreak",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Enforce consistent linebreak style for operators",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/operator-linebreak",
		},

		schema: [
			{
				enum: ["after", "before", "none", null],
			},
			{
				type: "object",
				properties: {
					overrides: {
						type: "object",
						additionalProperties: {
							enum: ["after", "before", "none", "ignore"],
						},
					},
				},
				additionalProperties: false,
			},
		],

		fixable: "code",

		messages: {
			operatorAtBeginning:
				"'{{operator}}' should be placed at the beginning of the line.",
			operatorAtEnd:
				"'{{operator}}' should be placed at the end of the line.",
			badLinebreak: "Bad line breaking before and after '{{operator}}'.",
			noLinebreak:
				"There should be no line break before or after '{{operator}}'.",
		},
	},

	create(context) {
		const usedDefaultGlobal = !context.options[0];
		const globalStyle = context.options[0] || "after";
		const options = context.options[1] || {};
		const styleOverrides = options.overrides
			? Object.assign({}, options.overrides)
			: {};

		if (usedDefaultGlobal && !styleOverrides["?"]) {
			styleOverrides["?"] = "before";
		}

		if (usedDefaultGlobal && !styleOverrides[":"]) {
			styleOverrides[":"] = "before";
		}

		const sourceCode = context.sourceCode;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Gets a fixer function to fix rule issues
		 * @param {Token} operatorToken The operator token of an expression
		 * @param {string} desiredStyle The style for the rule. One of 'before', 'after', 'none'
		 * @returns {Function} A fixer function
		 */
		function getFixer(operatorToken, desiredStyle) {
			return fixer => {
				const tokenBefore = sourceCode.getTokenBefore(operatorToken);
				const tokenAfter = sourceCode.getTokenAfter(operatorToken);
				const textBefore = sourceCode.text.slice(
					tokenBefore.range[1],
					operatorToken.range[0],
				);
				const textAfter = sourceCode.text.slice(
					operatorToken.range[1],
					tokenAfter.range[0],
				);
				const hasLinebreakBefore = !astUtils.isTokenOnSameLine(
					tokenBefore,
					operatorToken,
				);
				const hasLinebreakAfter = !astUtils.isTokenOnSameLine(
					operatorToken,
					tokenAfter,
				);
				let newTextBefore, newTextAfter;

				if (
					hasLinebreakBefore !== hasLinebreakAfter &&
					desiredStyle !== "none"
				) {
					// If there is a comment before and after the operator, don't do a fix.
					if (
						sourceCode.getTokenBefore(operatorToken, {
							includeComments: true,
						}) !== tokenBefore &&
						sourceCode.getTokenAfter(operatorToken, {
							includeComments: true,
						}) !== tokenAfter
					) {
						return null;
					}

					/*
					 * If there is only one linebreak and it's on the wrong side of the operator, swap the text before and after the operator.
					 * foo &&
					 *           bar
					 * would get fixed to
					 * foo
					 *        && bar
					 */
					newTextBefore = textAfter;
					newTextAfter = textBefore;
				} else {
					const LINEBREAK_REGEX =
						astUtils.createGlobalLinebreakMatcher();

					// Otherwise, if no linebreak is desired and no comments interfere, replace the linebreaks with empty strings.
					newTextBefore =
						desiredStyle === "before" || textBefore.trim()
							? textBefore
							: textBefore.replace(LINEBREAK_REGEX, "");
					newTextAfter =
						desiredStyle === "after" || textAfter.trim()
							? textAfter
							: textAfter.replace(LINEBREAK_REGEX, "");

					// If there was no change (due to interfering comments), don't output a fix.
					if (
						newTextBefore === textBefore &&
						newTextAfter === textAfter
					) {
						return null;
					}
				}

				if (
					newTextAfter === "" &&
					tokenAfter.type === "Punctuator" &&
					"+-".includes(operatorToken.value) &&
					tokenAfter.value === operatorToken.value
				) {
					// To avoid accidentally creating a ++ or -- operator, insert a space if the operator is a +/- and the following token is a unary +/-.
					newTextAfter += " ";
				}

				return fixer.replaceTextRange(
					[tokenBefore.range[1], tokenAfter.range[0]],
					newTextBefore + operatorToken.value + newTextAfter,
				);
			};
		}

		/**
		 * Checks the operator placement
		 * @param {ASTNode} node The node to check
		 * @param {ASTNode} rightSide The node that comes after the operator in `node`
		 * @param {string} operator The operator
		 * @private
		 * @returns {void}
		 */
		function validateNode(node, rightSide, operator) {
			/*
			 * Find the operator token by searching from the right side, because between the left side and the operator
			 * there could be additional tokens from type annotations. Search specifically for the token which
			 * value equals the operator, in order to skip possible opening parentheses before the right side node.
			 */
			const operatorToken = sourceCode.getTokenBefore(
				rightSide,
				token => token.value === operator,
			);
			const leftToken = sourceCode.getTokenBefore(operatorToken);
			const rightToken = sourceCode.getTokenAfter(operatorToken);
			const operatorStyleOverride = styleOverrides[operator];
			const style = operatorStyleOverride || globalStyle;
			const fix = getFixer(operatorToken, style);

			// if single line
			if (
				astUtils.isTokenOnSameLine(leftToken, operatorToken) &&
				astUtils.isTokenOnSameLine(operatorToken, rightToken)
			) {
				// do nothing.
			} else if (
				operatorStyleOverride !== "ignore" &&
				!astUtils.isTokenOnSameLine(leftToken, operatorToken) &&
				!astUtils.isTokenOnSameLine(operatorToken, rightToken)
			) {
				// lone operator
				context.report({
					node,
					loc: operatorToken.loc,
					messageId: "badLinebreak",
					data: {
						operator,
					},
					fix,
				});
			} else if (
				style === "before" &&
				astUtils.isTokenOnSameLine(leftToken, operatorToken)
			) {
				context.report({
					node,
					loc: operatorToken.loc,
					messageId: "operatorAtBeginning",
					data: {
						operator,
					},
					fix,
				});
			} else if (
				style === "after" &&
				astUtils.isTokenOnSameLine(operatorToken, rightToken)
			) {
				context.report({
					node,
					loc: operatorToken.loc,
					messageId: "operatorAtEnd",
					data: {
						operator,
					},
					fix,
				});
			} else if (style === "none") {
				context.report({
					node,
					loc: operatorToken.loc,
					messageId: "noLinebreak",
					data: {
						operator,
					},
					fix,
				});
			}
		}

		/**
		 * Validates a binary expression using `validateNode`
		 * @param {BinaryExpression|LogicalExpression|AssignmentExpression} node node to be validated
		 * @returns {void}
		 */
		function validateBinaryExpression(node) {
			validateNode(node, node.right, node.operator);
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			BinaryExpression: validateBinaryExpression,
			LogicalExpression: validateBinaryExpression,
			AssignmentExpression: validateBinaryExpression,
			VariableDeclarator(node) {
				if (node.init) {
					validateNode(node, node.init, "=");
				}
			},
			PropertyDefinition(node) {
				if (node.value) {
					validateNode(node, node.value, "=");
				}
			},
			ConditionalExpression(node) {
				validateNode(node, node.consequent, "?");
				validateNode(node, node.alternate, ":");
			},
		};
	},
};
TGSx"1/**
 * @fileoverview A rule to ensure blank lines within blocks.
 * @author Mathias Schreck <https://github.com/lo1tuma>
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "padded-blocks",
						url: "https://eslint.style/rules/padded-blocks",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Require or disallow padding within blocks",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/padded-blocks",
		},

		fixable: "whitespace",

		schema: [
			{
				oneOf: [
					{
						enum: ["always", "never"],
					},
					{
						type: "object",
						properties: {
							blocks: {
								enum: ["always", "never"],
							},
							switches: {
								enum: ["always", "never"],
							},
							classes: {
								enum: ["always", "never"],
							},
						},
						additionalProperties: false,
						minProperties: 1,
					},
				],
			},
			{
				type: "object",
				properties: {
					allowSingleLineBlocks: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			alwaysPadBlock: "Block must be padded by blank lines.",
			neverPadBlock: "Block must not be padded by blank lines.",
		},
	},

	create(context) {
		const options = {};
		const typeOptions = context.options[0] || "always";
		const exceptOptions = context.options[1] || {};

		if (typeof typeOptions === "string") {
			const shouldHavePadding = typeOptions === "always";

			options.blocks = shouldHavePadding;
			options.switches = shouldHavePadding;
			options.classes = shouldHavePadding;
		} else {
			if (Object.hasOwn(typeOptions, "blocks")) {
				options.blocks = typeOptions.blocks === "always";
			}
			if (Object.hasOwn(typeOptions, "switches")) {
				options.switches = typeOptions.switches === "always";
			}
			if (Object.hasOwn(typeOptions, "classes")) {
				options.classes = typeOptions.classes === "always";
			}
		}

		if (Object.hasOwn(exceptOptions, "allowSingleLineBlocks")) {
			options.allowSingleLineBlocks =
				exceptOptions.allowSingleLineBlocks === true;
		}

		const sourceCode = context.sourceCode;

		/**
		 * Gets the open brace token from a given node.
		 * @param {ASTNode} node A BlockStatement or SwitchStatement node from which to get the open brace.
		 * @returns {Token} The token of the open brace.
		 */
		function getOpenBrace(node) {
			if (node.type === "SwitchStatement") {
				return sourceCode.getTokenBefore(node.cases[0]);
			}

			if (node.type === "StaticBlock") {
				return sourceCode.getFirstToken(node, { skip: 1 }); // skip the `static` token
			}

			// `BlockStatement` or `ClassBody`
			return sourceCode.getFirstToken(node);
		}

		/**
		 * Checks if the given parameter is a comment node
		 * @param {ASTNode|Token} node An AST node or token
		 * @returns {boolean} True if node is a comment
		 */
		function isComment(node) {
			return node.type === "Line" || node.type === "Block";
		}

		/**
		 * Checks if there is padding between two tokens
		 * @param {Token} first The first token
		 * @param {Token} second The second token
		 * @returns {boolean} True if there is at least a line between the tokens
		 */
		function isPaddingBetweenTokens(first, second) {
			return second.loc.start.line - first.loc.end.line >= 2;
		}

		/**
		 * Checks if the given token has a blank line after it.
		 * @param {Token} token The token to check.
		 * @returns {boolean} Whether or not the token is followed by a blank line.
		 */
		function getFirstBlockToken(token) {
			let prev,
				first = token;

			do {
				prev = first;
				first = sourceCode.getTokenAfter(first, {
					includeComments: true,
				});
			} while (
				isComment(first) &&
				first.loc.start.line === prev.loc.end.line
			);

			return first;
		}

		/**
		 * Checks if the given token is preceded by a blank line.
		 * @param {Token} token The token to check
		 * @returns {boolean} Whether or not the token is preceded by a blank line
		 */
		function getLastBlockToken(token) {
			let last = token,
				next;

			do {
				next = last;
				last = sourceCode.getTokenBefore(last, {
					includeComments: true,
				});
			} while (
				isComment(last) &&
				last.loc.end.line === next.loc.start.line
			);

			return last;
		}

		/**
		 * Checks if a node should be padded, according to the rule config.
		 * @param {ASTNode} node The AST node to check.
		 * @throws {Error} (Unreachable)
		 * @returns {boolean} True if the node should be padded, false otherwise.
		 */
		function requirePaddingFor(node) {
			switch (node.type) {
				case "BlockStatement":
				case "StaticBlock":
					return options.blocks;
				case "SwitchStatement":
					return options.switches;
				case "ClassBody":
					return options.classes;

				/* c8 ignore next */
				default:
					throw new Error("unreachable");
			}
		}

		/**
		 * Checks the given BlockStatement node to be padded if the block is not empty.
		 * @param {ASTNode} node The AST node of a BlockStatement.
		 * @returns {void} undefined.
		 */
		function checkPadding(node) {
			const openBrace = getOpenBrace(node),
				firstBlockToken = getFirstBlockToken(openBrace),
				tokenBeforeFirst = sourceCode.getTokenBefore(firstBlockToken, {
					includeComments: true,
				}),
				closeBrace = sourceCode.getLastToken(node),
				lastBlockToken = getLastBlockToken(closeBrace),
				tokenAfterLast = sourceCode.getTokenAfter(lastBlockToken, {
					includeComments: true,
				}),
				blockHasTopPadding = isPaddingBetweenTokens(
					tokenBeforeFirst,
					firstBlockToken,
				),
				blockHasBottomPadding = isPaddingBetweenTokens(
					lastBlockToken,
					tokenAfterLast,
				);

			if (
				options.allowSingleLineBlocks &&
				astUtils.isTokenOnSameLine(tokenBeforeFirst, tokenAfterLast)
			) {
				return;
			}

			if (requirePaddingFor(node)) {
				if (!blockHasTopPadding) {
					context.report({
						node,
						loc: {
							start: tokenBeforeFirst.loc.start,
							end: firstBlockToken.loc.start,
						},
						fix(fixer) {
							return fixer.insertTextAfter(
								tokenBeforeFirst,
								"\n",
							);
						},
						messageId: "alwaysPadBlock",
					});
				}
				if (!blockHasBottomPadding) {
					context.report({
						node,
						loc: {
							end: tokenAfterLast.loc.start,
							start: lastBlockToken.loc.end,
						},
						fix(fixer) {
							return fixer.insertTextBefore(tokenAfterLast, "\n");
						},
						messageId: "alwaysPadBlock",
					});
				}
			} else {
				if (blockHasTopPadding) {
					context.report({
						node,
						loc: {
							start: tokenBeforeFirst.loc.start,
							end: firstBlockToken.loc.start,
						},
						fix(fixer) {
							return fixer.replaceTextRange(
								[
									tokenBeforeFirst.range[1],
									firstBlockToken.range[0] -
										firstBlockToken.loc.start.column,
								],
								"\n",
							);
						},
						messageId: "neverPadBlock",
					});
				}

				if (blockHasBottomPadding) {
					context.report({
						node,
						loc: {
							end: tokenAfterLast.loc.start,
							start: lastBlockToken.loc.end,
						},
						messageId: "neverPadBlock",
						fix(fixer) {
							return fixer.replaceTextRange(
								[
									lastBlockToken.range[1],
									tokenAfterLast.range[0] -
										tokenAfterLast.loc.start.column,
								],
								"\n",
							);
						},
					});
				}
			}
		}

		const rule = {};

		if (Object.hasOwn(options, "switches")) {
			rule.SwitchStatement = function (node) {
				if (node.cases.length === 0) {
					return;
				}
				checkPadding(node);
			};
		}

		if (Object.hasOwn(options, "blocks")) {
			rule.BlockStatement = function (node) {
				if (node.body.length === 0) {
					return;
				}
				checkPadding(node);
			};
			rule.StaticBlock = rule.BlockStatement;
		}

		if (Object.hasOwn(options, "classes")) {
			rule.ClassBody = function (node) {
				if (node.body.length === 0) {
					return;
				}
				checkPadding(node);
			};
		}

		return rule;
	},
};
l--xXB/**
 * @fileoverview Rule to require or disallow newlines between statements
 * @author Toru Nagashima
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const LT = `[${Array.from(astUtils.LINEBREAKS).join("")}]`;
const PADDING_LINE_SEQUENCE = new RegExp(
	String.raw`^(\s*?${LT})\s*${LT}(\s*;?)$`,
	"u",
);
const CJS_EXPORT = /^(?:module\s*\.\s*)?exports(?:\s*\.|\s*\[|$)/u;
const CJS_IMPORT = /^require\(/u;

/**
 * Creates tester which check if a node starts with specific keyword.
 * @param {string} keyword The keyword to test.
 * @returns {Object} the created tester.
 * @private
 */
function newKeywordTester(keyword) {
	return {
		test: (node, sourceCode) =>
			sourceCode.getFirstToken(node).value === keyword,
	};
}

/**
 * Creates tester which check if a node starts with specific keyword and spans a single line.
 * @param {string} keyword The keyword to test.
 * @returns {Object} the created tester.
 * @private
 */
function newSinglelineKeywordTester(keyword) {
	return {
		test: (node, sourceCode) =>
			node.loc.start.line === node.loc.end.line &&
			sourceCode.getFirstToken(node).value === keyword,
	};
}

/**
 * Creates tester which check if a node starts with specific keyword and spans multiple lines.
 * @param {string} keyword The keyword to test.
 * @returns {Object} the created tester.
 * @private
 */
function newMultilineKeywordTester(keyword) {
	return {
		test: (node, sourceCode) =>
			node.loc.start.line !== node.loc.end.line &&
			sourceCode.getFirstToken(node).value === keyword,
	};
}

/**
 * Creates tester which check if a node is specific type.
 * @param {string} type The node type to test.
 * @returns {Object} the created tester.
 * @private
 */
function newNodeTypeTester(type) {
	return {
		test: node => node.type === type,
	};
}

/**
 * Checks the given node is an expression statement of IIFE.
 * @param {ASTNode} node The node to check.
 * @returns {boolean} `true` if the node is an expression statement of IIFE.
 * @private
 */
function isIIFEStatement(node) {
	if (node.type === "ExpressionStatement") {
		let call = astUtils.skipChainExpression(node.expression);

		if (call.type === "UnaryExpression") {
			call = astUtils.skipChainExpression(call.argument);
		}
		return (
			call.type === "CallExpression" && astUtils.isFunction(call.callee)
		);
	}
	return false;
}

/**
 * Checks whether the given node is a block-like statement.
 * This checks the last token of the node is the closing brace of a block.
 * @param {SourceCode} sourceCode The source code to get tokens.
 * @param {ASTNode} node The node to check.
 * @returns {boolean} `true` if the node is a block-like statement.
 * @private
 */
function isBlockLikeStatement(sourceCode, node) {
	// do-while with a block is a block-like statement.
	if (
		node.type === "DoWhileStatement" &&
		node.body.type === "BlockStatement"
	) {
		return true;
	}

	/*
	 * IIFE is a block-like statement specially from
	 * JSCS#disallowPaddingNewLinesAfterBlocks.
	 */
	if (isIIFEStatement(node)) {
		return true;
	}

	// Checks the last token is a closing brace of blocks.
	const lastToken = sourceCode.getLastToken(
		node,
		astUtils.isNotSemicolonToken,
	);
	const belongingNode =
		lastToken && astUtils.isClosingBraceToken(lastToken)
			? sourceCode.getNodeByRangeIndex(lastToken.range[0])
			: null;

	return (
		Boolean(belongingNode) &&
		(belongingNode.type === "BlockStatement" ||
			belongingNode.type === "SwitchStatement")
	);
}

/**
 * Gets the actual last token.
 *
 * If a semicolon is semicolon-less style's semicolon, this ignores it.
 * For example:
 *
 *     foo()
 *     ;[1, 2, 3].forEach(bar)
 * @param {SourceCode} sourceCode The source code to get tokens.
 * @param {ASTNode} node The node to get.
 * @returns {Token} The actual last token.
 * @private
 */
function getActualLastToken(sourceCode, node) {
	const semiToken = sourceCode.getLastToken(node);
	const prevToken = sourceCode.getTokenBefore(semiToken);
	const nextToken = sourceCode.getTokenAfter(semiToken);
	const isSemicolonLessStyle = Boolean(
		prevToken &&
		nextToken &&
		prevToken.range[0] >= node.range[0] &&
		astUtils.isSemicolonToken(semiToken) &&
		semiToken.loc.start.line !== prevToken.loc.end.line &&
		semiToken.loc.end.line === nextToken.loc.start.line,
	);

	return isSemicolonLessStyle ? prevToken : semiToken;
}

/**
 * This returns the concatenation of the first 2 captured strings.
 * @param {string} _ Unused. Whole matched string.
 * @param {string} trailingSpaces The trailing spaces of the first line.
 * @param {string} indentSpaces The indentation spaces of the last line.
 * @returns {string} The concatenation of trailingSpaces and indentSpaces.
 * @private
 */
function replacerToRemovePaddingLines(_, trailingSpaces, indentSpaces) {
	return trailingSpaces + indentSpaces;
}

/**
 * Check and report statements for `any` configuration.
 * It does nothing.
 * @returns {void}
 * @private
 */
function verifyForAny() {}

/**
 * Check and report statements for `never` configuration.
 * This autofix removes blank lines between the given 2 statements.
 * However, if comments exist between 2 blank lines, it does not remove those
 * blank lines automatically.
 * @param {RuleContext} context The rule context to report.
 * @param {ASTNode} _ Unused. The previous node to check.
 * @param {ASTNode} nextNode The next node to check.
 * @param {Array<Token[]>} paddingLines The array of token pairs that blank
 * lines exist between the pair.
 * @returns {void}
 * @private
 */
function verifyForNever(context, _, nextNode, paddingLines) {
	if (paddingLines.length === 0) {
		return;
	}

	context.report({
		node: nextNode,
		messageId: "unexpectedBlankLine",
		fix(fixer) {
			if (paddingLines.length >= 2) {
				return null;
			}

			const prevToken = paddingLines[0][0];
			const nextToken = paddingLines[0][1];
			const start = prevToken.range[1];
			const end = nextToken.range[0];
			const text = context.sourceCode.text
				.slice(start, end)
				.replace(PADDING_LINE_SEQUENCE, replacerToRemovePaddingLines);

			return fixer.replaceTextRange([start, end], text);
		},
	});
}

/**
 * Check and report statements for `always` configuration.
 * This autofix inserts a blank line between the given 2 statements.
 * If the `prevNode` has trailing comments, it inserts a blank line after the
 * trailing comments.
 * @param {RuleContext} context The rule context to report.
 * @param {ASTNode} prevNode The previous node to check.
 * @param {ASTNode} nextNode The next node to check.
 * @param {Array<Token[]>} paddingLines The array of token pairs that blank
 * lines exist between the pair.
 * @returns {void}
 * @private
 */
function verifyForAlways(context, prevNode, nextNode, paddingLines) {
	if (paddingLines.length > 0) {
		return;
	}

	context.report({
		node: nextNode,
		messageId: "expectedBlankLine",
		fix(fixer) {
			const sourceCode = context.sourceCode;
			let prevToken = getActualLastToken(sourceCode, prevNode);
			const nextToken =
				sourceCode.getFirstTokenBetween(prevToken, nextNode, {
					includeComments: true,

					/**
					 * Skip the trailing comments of the previous node.
					 * This inserts a blank line after the last trailing comment.
					 *
					 * For example:
					 *
					 *     foo(); // trailing comment.
					 *     // comment.
					 *     bar();
					 *
					 * Get fixed to:
					 *
					 *     foo(); // trailing comment.
					 *
					 *     // comment.
					 *     bar();
					 * @param {Token} token The token to check.
					 * @returns {boolean} `true` if the token is not a trailing comment.
					 * @private
					 */
					filter(token) {
						if (astUtils.isTokenOnSameLine(prevToken, token)) {
							prevToken = token;
							return false;
						}
						return true;
					},
				}) || nextNode;
			const insertText = astUtils.isTokenOnSameLine(prevToken, nextToken)
				? "\n\n"
				: "\n";

			return fixer.insertTextAfter(prevToken, insertText);
		},
	});
}

/**
 * Types of blank lines.
 * `any`, `never`, and `always` are defined.
 * Those have `verify` method to check and report statements.
 * @private
 */
const PaddingTypes = {
	any: { verify: verifyForAny },
	never: { verify: verifyForNever },
	always: { verify: verifyForAlways },
};

/**
 * Types of statements.
 * Those have `test` method to check it matches to the given statement.
 * @private
 */
const StatementTypes = {
	"*": { test: () => true },
	"block-like": {
		test: (node, sourceCode) => isBlockLikeStatement(sourceCode, node),
	},
	"cjs-export": {
		test: (node, sourceCode) =>
			node.type === "ExpressionStatement" &&
			node.expression.type === "AssignmentExpression" &&
			CJS_EXPORT.test(sourceCode.getText(node.expression.left)),
	},
	"cjs-import": {
		test: (node, sourceCode) =>
			node.type === "VariableDeclaration" &&
			node.declarations.length > 0 &&
			Boolean(node.declarations[0].init) &&
			CJS_IMPORT.test(sourceCode.getText(node.declarations[0].init)),
	},
	directive: {
		test: astUtils.isDirective,
	},
	expression: {
		test: node =>
			node.type === "ExpressionStatement" && !astUtils.isDirective(node),
	},
	iife: {
		test: isIIFEStatement,
	},
	"multiline-block-like": {
		test: (node, sourceCode) =>
			node.loc.start.line !== node.loc.end.line &&
			isBlockLikeStatement(sourceCode, node),
	},
	"multiline-expression": {
		test: node =>
			node.loc.start.line !== node.loc.end.line &&
			node.type === "ExpressionStatement" &&
			!astUtils.isDirective(node),
	},

	"multiline-const": newMultilineKeywordTester("const"),
	"multiline-let": newMultilineKeywordTester("let"),
	"multiline-var": newMultilineKeywordTester("var"),
	"singleline-const": newSinglelineKeywordTester("const"),
	"singleline-let": newSinglelineKeywordTester("let"),
	"singleline-var": newSinglelineKeywordTester("var"),

	block: newNodeTypeTester("BlockStatement"),
	empty: newNodeTypeTester("EmptyStatement"),
	function: newNodeTypeTester("FunctionDeclaration"),

	break: newKeywordTester("break"),
	case: newKeywordTester("case"),
	class: newKeywordTester("class"),
	const: newKeywordTester("const"),
	continue: newKeywordTester("continue"),
	debugger: newKeywordTester("debugger"),
	default: newKeywordTester("default"),
	do: newKeywordTester("do"),
	export: newKeywordTester("export"),
	for: newKeywordTester("for"),
	if: newKeywordTester("if"),
	import: newKeywordTester("import"),
	let: newKeywordTester("let"),
	return: newKeywordTester("return"),
	switch: newKeywordTester("switch"),
	throw: newKeywordTester("throw"),
	try: newKeywordTester("try"),
	var: newKeywordTester("var"),
	while: newKeywordTester("while"),
	with: newKeywordTester("with"),
};

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "padding-line-between-statements",
						url: "https://eslint.style/rules/padding-line-between-statements",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Require or disallow padding lines between statements",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/padding-line-between-statements",
		},

		fixable: "whitespace",

		schema: {
			definitions: {
				paddingType: {
					enum: Object.keys(PaddingTypes),
				},
				statementType: {
					anyOf: [
						{ enum: Object.keys(StatementTypes) },
						{
							type: "array",
							items: { enum: Object.keys(StatementTypes) },
							minItems: 1,
							uniqueItems: true,
						},
					],
				},
			},
			type: "array",
			items: {
				type: "object",
				properties: {
					blankLine: { $ref: "#/definitions/paddingType" },
					prev: { $ref: "#/definitions/statementType" },
					next: { $ref: "#/definitions/statementType" },
				},
				additionalProperties: false,
				required: ["blankLine", "prev", "next"],
			},
		},

		messages: {
			unexpectedBlankLine: "Unexpected blank line before this statement.",
			expectedBlankLine: "Expected blank line before this statement.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const configureList = context.options || [];
		let scopeInfo = null;

		/**
		 * Processes to enter to new scope.
		 * This manages the current previous statement.
		 * @returns {void}
		 * @private
		 */
		function enterScope() {
			scopeInfo = {
				upper: scopeInfo,
				prevNode: null,
			};
		}

		/**
		 * Processes to exit from the current scope.
		 * @returns {void}
		 * @private
		 */
		function exitScope() {
			scopeInfo = scopeInfo.upper;
		}

		/**
		 * Checks whether the given node matches the given type.
		 * @param {ASTNode} node The statement node to check.
		 * @param {string|string[]} type The statement type to check.
		 * @returns {boolean} `true` if the statement node matched the type.
		 * @private
		 */
		function match(node, type) {
			let innerStatementNode = node;

			while (innerStatementNode.type === "LabeledStatement") {
				innerStatementNode = innerStatementNode.body;
			}
			if (Array.isArray(type)) {
				return type.some(match.bind(null, innerStatementNode));
			}
			return StatementTypes[type].test(innerStatementNode, sourceCode);
		}

		/**
		 * Finds the last matched configure from configureList.
		 * @param {ASTNode} prevNode The previous statement to match.
		 * @param {ASTNode} nextNode The current statement to match.
		 * @returns {Object} The tester of the last matched configure.
		 * @private
		 */
		function getPaddingType(prevNode, nextNode) {
			for (let i = configureList.length - 1; i >= 0; --i) {
				const configure = configureList[i];
				const matched =
					match(prevNode, configure.prev) &&
					match(nextNode, configure.next);

				if (matched) {
					return PaddingTypes[configure.blankLine];
				}
			}
			return PaddingTypes.any;
		}

		/**
		 * Gets padding line sequences between the given 2 statements.
		 * Comments are separators of the padding line sequences.
		 * @param {ASTNode} prevNode The previous statement to count.
		 * @param {ASTNode} nextNode The current statement to count.
		 * @returns {Array<Token[]>} The array of token pairs.
		 * @private
		 */
		function getPaddingLineSequences(prevNode, nextNode) {
			const pairs = [];
			let prevToken = getActualLastToken(sourceCode, prevNode);

			if (nextNode.loc.start.line - prevToken.loc.end.line >= 2) {
				do {
					const token = sourceCode.getTokenAfter(prevToken, {
						includeComments: true,
					});

					if (token.loc.start.line - prevToken.loc.end.line >= 2) {
						pairs.push([prevToken, token]);
					}
					prevToken = token;
				} while (prevToken.range[0] < nextNode.range[0]);
			}

			return pairs;
		}

		/**
		 * Verify padding lines between the given node and the previous node.
		 * @param {ASTNode} node The node to verify.
		 * @returns {void}
		 * @private
		 */
		function verify(node) {
			const parentType = node.parent.type;
			const validParent =
				astUtils.STATEMENT_LIST_PARENTS.has(parentType) ||
				parentType === "SwitchStatement";

			if (!validParent) {
				return;
			}

			// Save this node as the current previous statement.
			const prevNode = scopeInfo.prevNode;

			// Verify.
			if (prevNode) {
				const type = getPaddingType(prevNode, node);
				const paddingLines = getPaddingLineSequences(prevNode, node);

				type.verify(context, prevNode, node, paddingLines);
			}

			scopeInfo.prevNode = node;
		}

		/**
		 * Verify padding lines between the given node and the previous node.
		 * Then process to enter to new scope.
		 * @param {ASTNode} node The node to verify.
		 * @returns {void}
		 * @private
		 */
		function verifyThenEnterScope(node) {
			verify(node);
			enterScope();
		}

		return {
			Program: enterScope,
			BlockStatement: enterScope,
			SwitchStatement: enterScope,
			StaticBlock: enterScope,
			"Program:exit": exitScope,
			"BlockStatement:exit": exitScope,
			"SwitchStatement:exit": exitScope,
			"StaticBlock:exit": exitScope,

			":statement": verify,

			SwitchCase: verifyThenEnterScope,
			"SwitchCase:exit": exitScope,
		};
	},
};
)޵x//**
 * @fileoverview A rule to suggest using arrow functions as callbacks.
 * @author Toru Nagashima
 */

"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @typedef {import("eslint-scope").Scope} Scope */
/** @typedef {import("eslint-scope").Variable} Variable */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Checks whether or not a given variable is a function name.
 * @param {Variable} variable A variable to check.
 * @returns {boolean} `true` if the variable is a function name.
 */
function isFunctionName(variable) {
	return variable && variable.defs[0].type === "FunctionName";
}

/**
 * Checks whether or not a given MetaProperty node equals to a given value.
 * @param {ASTNode} node A MetaProperty node to check.
 * @param {string} metaName The name of `MetaProperty.meta`.
 * @param {string} propertyName The name of `MetaProperty.property`.
 * @returns {boolean} `true` if the node is the specific value.
 */
function checkMetaProperty(node, metaName, propertyName) {
	return node.meta.name === metaName && node.property.name === propertyName;
}

/**
 * Gets the variable object of `arguments` which is defined implicitly.
 * @param {Scope} scope A scope to get.
 * @returns {Variable} The found variable object.
 */
function getVariableOfArguments(scope) {
	const variables = scope.variables;

	for (let i = 0; i < variables.length; ++i) {
		const variable = variables[i];

		if (variable.name === "arguments") {
			/*
			 * If there was a parameter which is named "arguments", the
			 * implicit "arguments" is not defined.
			 * So does fast return with null.
			 */
			return variable.identifiers.length === 0 ? variable : null;
		}
	}

	/* c8 ignore next */
	return null;
}

/**
 * Checks whether or not a given node is a callback.
 * @param {ASTNode} node A node to check.
 * @throws {Error} (Unreachable.)
 * @returns {Object}
 *   {boolean} retv.isCallback - `true` if the node is a callback.
 *   {boolean} retv.isLexicalThis - `true` if the node is with `.bind(this)`.
 */
function getCallbackInfo(node) {
	const retv = { isCallback: false, isLexicalThis: false };
	let currentNode = node;
	let parent = node.parent;
	let bound = false;

	while (currentNode) {
		switch (parent.type) {
			// Checks parents recursively.

			case "LogicalExpression":
			case "ChainExpression":
			case "ConditionalExpression":
				break;

			// Checks whether the parent node is `.bind(this)` call.
			case "MemberExpression":
				if (
					parent.object === currentNode &&
					!parent.property.computed &&
					parent.property.type === "Identifier" &&
					parent.property.name === "bind"
				) {
					const maybeCallee =
						parent.parent.type === "ChainExpression"
							? parent.parent
							: parent;

					if (astUtils.isCallee(maybeCallee)) {
						if (!bound) {
							bound = true; // Use only the first `.bind()` to make `isLexicalThis` value.
							retv.isLexicalThis =
								maybeCallee.parent.arguments.length === 1 &&
								maybeCallee.parent.arguments[0].type ===
									"ThisExpression";
						}
						parent = maybeCallee.parent;
					} else {
						return retv;
					}
				} else {
					return retv;
				}
				break;

			// Checks whether the node is a callback.
			case "CallExpression":
			case "NewExpression":
				if (parent.callee !== currentNode) {
					retv.isCallback = true;
				}
				return retv;

			default:
				return retv;
		}

		currentNode = parent;
		parent = parent.parent;
	}

	/* c8 ignore next */
	throw new Error("unreachable");
}

/**
 * Checks whether a simple list of parameters contains any duplicates. This does not handle complex
 * parameter lists (e.g. with destructuring), since complex parameter lists are a SyntaxError with duplicate
 * parameter names anyway. Instead, it always returns `false` for complex parameter lists.
 * @param {ASTNode[]} paramsList The list of parameters for a function
 * @returns {boolean} `true` if the list of parameters contains any duplicates
 */
function hasDuplicateParams(paramsList) {
	return (
		paramsList.every(param => param.type === "Identifier") &&
		paramsList.length !== new Set(paramsList.map(param => param.name)).size
	);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{ allowNamedFunctions: false, allowUnboundThis: true },
		],

		docs: {
			description: "Require using arrow functions for callbacks",
			dialects: ["JavaScript", "TypeScript"],
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/prefer-arrow-callback",
		},

		schema: [
			{
				type: "object",
				properties: {
					allowNamedFunctions: {
						type: "boolean",
					},
					allowUnboundThis: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		fixable: "code",

		messages: {
			preferArrowCallback: "Unexpected function expression.",
		},
	},

	create(context) {
		const [{ allowNamedFunctions, allowUnboundThis }] = context.options;
		const sourceCode = context.sourceCode;

		/*
		 * {Array<{this: boolean, super: boolean, meta: boolean}>}
		 * - this - A flag which shows there are one or more ThisExpression.
		 * - super - A flag which shows there are one or more Super.
		 * - meta - A flag which shows there are one or more MethProperty.
		 */
		let stack = [];

		/**
		 * Pushes new function scope with all `false` flags.
		 * @returns {void}
		 */
		function enterScope() {
			stack.push({ this: false, super: false, meta: false });
		}

		/**
		 * Pops a function scope from the stack.
		 * @returns {{this: boolean, super: boolean, meta: boolean}} The information of the last scope.
		 */
		function exitScope() {
			return stack.pop();
		}

		return {
			// Reset internal state.
			Program() {
				stack = [];
			},

			// If there are below, it cannot replace with arrow functions merely.
			ThisExpression() {
				const info = stack.at(-1);

				if (info) {
					info.this = true;
				}
			},

			Super() {
				const info = stack.at(-1);

				if (info) {
					info.super = true;
				}
			},

			MetaProperty(node) {
				const info = stack.at(-1);

				if (info && checkMetaProperty(node, "new", "target")) {
					info.meta = true;
				}
			},

			// To skip nested scopes.
			FunctionDeclaration: enterScope,
			"FunctionDeclaration:exit": exitScope,

			// Main.
			FunctionExpression: enterScope,
			"FunctionExpression:exit"(node) {
				const scopeInfo = exitScope();

				// Skip named function expressions
				if (allowNamedFunctions && node.id && node.id.name) {
					return;
				}

				// Skip generators.
				if (node.generator) {
					return;
				}

				// Skip recursive functions.
				const nameVar = sourceCode.getDeclaredVariables(node)[0];

				if (isFunctionName(nameVar) && nameVar.references.length > 0) {
					return;
				}

				// Skip if it's using arguments.
				const variable = getVariableOfArguments(
					sourceCode.getScope(node),
				);

				if (variable && variable.references.length > 0) {
					return;
				}

				// Reports if it's a callback which can replace with arrows.
				const callbackInfo = getCallbackInfo(node);

				if (
					callbackInfo.isCallback &&
					(!allowUnboundThis ||
						!scopeInfo.this ||
						callbackInfo.isLexicalThis) &&
					!scopeInfo.super &&
					!scopeInfo.meta
				) {
					context.report({
						node,
						messageId: "preferArrowCallback",
						*fix(fixer) {
							if (
								(!callbackInfo.isLexicalThis &&
									scopeInfo.this) ||
								hasDuplicateParams(node.params)
							) {
								/*
								 * If the callback function does not have .bind(this) and contains a reference to `this`, there
								 * is no way to determine what `this` should be, so don't perform any fixes.
								 * If the callback function has duplicates in its list of parameters (possible in sloppy mode),
								 * don't replace it with an arrow function, because this is a SyntaxError with arrow functions.
								 */
								return;
							}

							if (
								node.params.length &&
								node.params[0].name === "this"
							) {
								return;
							}

							const functionToken = sourceCode.getFirstToken(
								node,
								node.async ? 1 : 0,
							);
							const leftParenToken = sourceCode.getTokenAfter(
								functionToken,
								astUtils.isOpeningParenToken,
							);

							if (node.async) {
								if (
									functionToken.loc.end.line <
									leftParenToken.loc.start.line
								) {
									return;
								}
							}

							// Remove `.bind(this)` if exists.
							if (callbackInfo.isLexicalThis) {
								const memberNode = node.parent;

								/*
								 * If `.bind(this)` exists but the parent is not `.bind(this)`, don't remove it automatically.
								 * E.g. `(foo || function(){}).bind(this)`
								 */
								if (memberNode.type !== "MemberExpression") {
									return;
								}

								const callNode = memberNode.parent;
								const firstTokenToRemove =
									sourceCode.getTokenAfter(
										memberNode.object,
										astUtils.isNotClosingParenToken,
									);
								const lastTokenToRemove =
									sourceCode.getLastToken(callNode);

								/*
								 * If the member expression is parenthesized, don't remove the right paren.
								 * E.g. `(function(){}.bind)(this)`
								 *                    ^^^^^^^^^^^^
								 */
								if (
									astUtils.isParenthesised(
										sourceCode,
										memberNode,
									)
								) {
									return;
								}

								// If comments exist in the `.bind(this)`, don't remove those.
								if (
									sourceCode.commentsExistBetween(
										firstTokenToRemove,
										lastTokenToRemove,
									)
								) {
									return;
								}

								yield fixer.removeRange([
									firstTokenToRemove.range[0],
									lastTokenToRemove.range[1],
								]);
							}

							// Convert the function expression to an arrow function.
							const tokenBeforeBody = sourceCode.getTokenBefore(
								node.body,
							);

							if (
								sourceCode.commentsExistBetween(
									functionToken,
									leftParenToken,
								)
							) {
								// Remove only extra tokens to keep comments.
								yield fixer.remove(functionToken);
								if (node.id) {
									yield fixer.remove(node.id);
								}
							} else {
								// Remove extra tokens and spaces.
								yield fixer.removeRange([
									functionToken.range[0],
									leftParenToken.range[0],
								]);
							}
							yield fixer.insertTextAfter(tokenBeforeBody, " =>");

							// Get the node that will become the new arrow function.
							let replacedNode = callbackInfo.isLexicalThis
								? node.parent.parent
								: node;

							if (replacedNode.type === "ChainExpression") {
								replacedNode = replacedNode.parent;
							}

							/*
							 * If the replaced node is part of a BinaryExpression, LogicalExpression, or MemberExpression, then
							 * the arrow function needs to be parenthesized, because `foo || () => {}` is invalid syntax even
							 * though `foo || function() {}` is valid.
							 */
							if (
								replacedNode.parent.type !== "CallExpression" &&
								replacedNode.parent.type !==
									"ConditionalExpression" &&
								!astUtils.isParenthesised(
									sourceCode,
									replacedNode,
								) &&
								!astUtils.isParenthesised(sourceCode, node)
							) {
								yield fixer.insertTextBefore(replacedNode, "(");
								yield fixer.insertTextAfter(replacedNode, ")");
							}
						},
					});
				}
			},
		};
	},
};
~ǽx>B/**
 * @fileoverview A rule to suggest using of const declaration for variables that are never reassigned after declared.
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const FixTracker = require("./utils/fix-tracker");
const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @typedef {import("eslint-scope").Scope} Scope */
/** @typedef {import("eslint-scope").Variable} Variable */
/** @typedef {import("eslint-scope").Reference} Reference */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const PATTERN_TYPE =
	/^(?:.+?Pattern|RestElement|SpreadProperty|ExperimentalRestProperty|Property)$/u;
const DECLARATION_HOST_TYPE =
	/^(?:Program|BlockStatement|StaticBlock|SwitchCase)$/u;
const DESTRUCTURING_HOST_TYPE =
	/^(?:VariableDeclarator|AssignmentExpression)$/u;

/**
 * Checks whether a given node is located at `ForStatement.init` or not.
 * @param {ASTNode} node A node to check.
 * @returns {boolean} `true` if the node is located at `ForStatement.init`.
 */
function isInitOfForStatement(node) {
	return node.parent.type === "ForStatement" && node.parent.init === node;
}

/**
 * Checks whether a given Identifier node becomes a VariableDeclaration or not.
 * @param {ASTNode} identifier An Identifier node to check.
 * @returns {boolean} `true` if the node can become a VariableDeclaration.
 */
function canBecomeVariableDeclaration(identifier) {
	let node = identifier.parent;

	while (PATTERN_TYPE.test(node.type)) {
		node = node.parent;
	}

	return (
		node.type === "VariableDeclarator" ||
		(node.type === "AssignmentExpression" &&
			node.parent.type === "ExpressionStatement" &&
			DECLARATION_HOST_TYPE.test(node.parent.parent.type))
	);
}

/**
 * Checks if an property or element is from outer scope or function parameters
 * in destructing pattern.
 * @param {string} name A variable name to be checked.
 * @param {Scope} initScope A scope to start find.
 * @returns {boolean} Indicates if the variable is from outer scope or function parameters.
 */
function isOuterVariableInDestructing(name, initScope) {
	if (
		initScope.through.some(
			ref => ref.resolved && ref.resolved.name === name,
		)
	) {
		return true;
	}

	const variable = astUtils.getVariableByName(initScope, name);

	if (variable !== null) {
		return variable.defs.some(def => def.type === "Parameter");
	}

	return false;
}

/**
 * Gets the VariableDeclarator/AssignmentExpression node that a given reference
 * belongs to.
 * This is used to detect a mix of reassigned and never reassigned in a
 * destructuring.
 * @param {Reference} reference A reference to get.
 * @returns {ASTNode|null} A VariableDeclarator/AssignmentExpression node or
 *      null.
 */
function getDestructuringHost(reference) {
	if (!reference.isWrite()) {
		return null;
	}
	let node = reference.identifier.parent;

	while (PATTERN_TYPE.test(node.type)) {
		node = node.parent;
	}

	if (!DESTRUCTURING_HOST_TYPE.test(node.type)) {
		return null;
	}
	return node;
}

/**
 * Determines if a destructuring assignment node contains
 * any MemberExpression nodes. This is used to determine if a
 * variable that is only written once using destructuring can be
 * safely converted into a const declaration.
 * @param {ASTNode} node The ObjectPattern or ArrayPattern node to check.
 * @returns {boolean} True if the destructuring pattern contains
 *      a MemberExpression, false if not.
 */
function hasMemberExpressionAssignment(node) {
	switch (node.type) {
		case "ObjectPattern":
			return node.properties.some(prop => {
				if (prop) {
					/*
					 * Spread elements have an argument property while
					 * others have a value property. Because different
					 * parsers use different node types for spread elements,
					 * we just check if there is an argument property.
					 */
					return hasMemberExpressionAssignment(
						prop.argument || prop.value,
					);
				}

				return false;
			});

		case "ArrayPattern":
			return node.elements.some(element => {
				if (element) {
					return hasMemberExpressionAssignment(element);
				}

				return false;
			});

		case "AssignmentPattern":
			return hasMemberExpressionAssignment(node.left);

		case "MemberExpression":
			return true;

		// no default
	}

	return false;
}

/**
 * Gets an identifier node of a given variable.
 *
 * If the initialization exists or one or more reading references exist before
 * the first assignment, the identifier node is the node of the declaration.
 * Otherwise, the identifier node is the node of the first assignment.
 *
 * If the variable should not change to const, this function returns null.
 * - If the variable is reassigned.
 * - If the variable is never initialized nor assigned.
 * - If the variable is initialized in a different scope from the declaration.
 * - If the unique assignment of the variable cannot change to a declaration.
 *   e.g. `if (a) b = 1` / `return (b = 1)`
 * - If the variable is declared in the global scope and `eslintUsed` is `true`.
 *   `/*exported foo` directive comment makes such variables. This rule does not
 *   warn such variables because this rule cannot distinguish whether the
 *   exported variables are reassigned or not.
 * @param {Variable} variable A variable to get.
 * @param {boolean} ignoreReadBeforeAssign
 *      The value of `ignoreReadBeforeAssign` option.
 * @returns {ASTNode|null}
 *      An Identifier node if the variable should change to const.
 *      Otherwise, null.
 */
function getIdentifierIfShouldBeConst(variable, ignoreReadBeforeAssign) {
	if (variable.eslintUsed && variable.scope.type === "global") {
		return null;
	}

	// Finds the unique WriteReference.
	let writer = null;
	let isReadBeforeInit = false;
	const references = variable.references;

	for (let i = 0; i < references.length; ++i) {
		const reference = references[i];

		if (reference.isWrite()) {
			const isReassigned =
				writer !== null && writer.identifier !== reference.identifier;

			if (isReassigned) {
				return null;
			}

			const destructuringHost = getDestructuringHost(reference);

			if (
				destructuringHost !== null &&
				destructuringHost.left !== void 0
			) {
				const leftNode = destructuringHost.left;
				let hasOuterVariables = false,
					hasNonIdentifiers = false;

				if (leftNode.type === "ObjectPattern") {
					const properties = leftNode.properties;

					hasOuterVariables = properties
						.filter(prop => prop.value)
						.map(prop => prop.value.name)
						.some(name =>
							isOuterVariableInDestructing(name, variable.scope),
						);

					hasNonIdentifiers = hasMemberExpressionAssignment(leftNode);
				} else if (leftNode.type === "ArrayPattern") {
					const elements = leftNode.elements;

					hasOuterVariables = elements
						.map(element => element && element.name)
						.some(name =>
							isOuterVariableInDestructing(name, variable.scope),
						);

					hasNonIdentifiers = hasMemberExpressionAssignment(leftNode);
				}

				if (hasOuterVariables || hasNonIdentifiers) {
					return null;
				}
			}

			writer = reference;
		} else if (reference.isRead() && writer === null) {
			if (ignoreReadBeforeAssign) {
				return null;
			}
			isReadBeforeInit = true;
		}
	}

	/*
	 * If the assignment is from a different scope, ignore it.
	 * If the assignment cannot change to a declaration, ignore it.
	 */
	const shouldBeConst =
		writer !== null &&
		writer.from === variable.scope &&
		canBecomeVariableDeclaration(writer.identifier);

	if (!shouldBeConst) {
		return null;
	}

	if (isReadBeforeInit) {
		return variable.defs[0].name;
	}

	return writer.identifier;
}

/**
 * Groups by the VariableDeclarator/AssignmentExpression node that each
 * reference of given variables belongs to.
 * This is used to detect a mix of reassigned and never reassigned in a
 * destructuring.
 * @param {Variable[]} variables Variables to group by destructuring.
 * @param {boolean} ignoreReadBeforeAssign
 *      The value of `ignoreReadBeforeAssign` option.
 * @returns {Map<ASTNode, ASTNode[]>} Grouped identifier nodes.
 */
function groupByDestructuring(variables, ignoreReadBeforeAssign) {
	const identifierMap = new Map();

	for (let i = 0; i < variables.length; ++i) {
		const variable = variables[i];
		const references = variable.references;
		const identifier = getIdentifierIfShouldBeConst(
			variable,
			ignoreReadBeforeAssign,
		);
		let prevId = null;

		for (let j = 0; j < references.length; ++j) {
			const reference = references[j];
			const id = reference.identifier;

			/*
			 * Avoid counting a reference twice or more for default values of
			 * destructuring.
			 */
			if (id === prevId) {
				continue;
			}
			prevId = id;

			// Add the identifier node into the destructuring group.
			const group = getDestructuringHost(reference);

			if (group) {
				if (identifierMap.has(group)) {
					identifierMap.get(group).push(identifier);
				} else {
					identifierMap.set(group, [identifier]);
				}
			}
		}
	}

	return identifierMap;
}

/**
 * Finds the nearest parent of node with a given type.
 * @param {ASTNode} node The node to search from.
 * @param {string} type The type field of the parent node.
 * @param {Function} shouldStop A predicate that returns true if the traversal should stop, and false otherwise.
 * @returns {ASTNode} The closest ancestor with the specified type; null if no such ancestor exists.
 */
function findUp(node, type, shouldStop) {
	if (!node || shouldStop(node)) {
		return null;
	}
	if (node.type === type) {
		return node;
	}
	return findUp(node.parent, type, shouldStop);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				destructuring: "any",
				ignoreReadBeforeAssign: false,
			},
		],

		docs: {
			description:
				"Require `const` declarations for variables that are never reassigned after declared",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/prefer-const",
		},

		fixable: "code",

		schema: [
			{
				type: "object",
				properties: {
					destructuring: { enum: ["any", "all"] },
					ignoreReadBeforeAssign: { type: "boolean" },
				},
				additionalProperties: false,
			},
		],
		messages: {
			useConst: "'{{name}}' is never reassigned. Use 'const' instead.",
		},
	},

	create(context) {
		const [{ destructuring, ignoreReadBeforeAssign }] = context.options;
		const shouldMatchAnyDestructuredVariable = destructuring !== "all";
		const sourceCode = context.sourceCode;
		const variables = [];
		let reportCount = 0;
		let checkedId = null;
		let checkedName = "";

		/**
		 * Reports given identifier nodes if all of the nodes should be declared
		 * as const.
		 *
		 * The argument 'nodes' is an array of Identifier nodes.
		 * This node is the result of 'getIdentifierIfShouldBeConst()', so it's
		 * nullable. In simple declaration or assignment cases, the length of
		 * the array is 1. In destructuring cases, the length of the array can
		 * be 2 or more.
		 * @param {(Reference|null)[]} nodes
		 *      References which are grouped by destructuring to report.
		 * @returns {void}
		 */
		function checkGroup(nodes) {
			const nodesToReport = nodes.filter(Boolean);

			if (
				nodes.length &&
				(shouldMatchAnyDestructuredVariable ||
					nodesToReport.length === nodes.length)
			) {
				const varDeclParent = findUp(
					nodes[0],
					"VariableDeclaration",
					parentNode => parentNode.type.endsWith("Statement"),
				);
				const isVarDecParentNull = varDeclParent === null;

				if (
					!isVarDecParentNull &&
					varDeclParent.declarations.length > 0
				) {
					const firstDeclaration = varDeclParent.declarations[0];

					if (firstDeclaration.init) {
						const firstDecParent = firstDeclaration.init.parent;

						/*
						 * First we check the declaration type and then depending on
						 * if the type is a "VariableDeclarator" or its an "ObjectPattern"
						 * we compare the name and id from the first identifier, if the names are different
						 * we assign the new name, id and reset the count of reportCount and nodeCount in
						 * order to check each block for the number of reported errors and base our fix
						 * based on comparing nodes.length and nodesToReport.length.
						 */

						if (firstDecParent.type === "VariableDeclarator") {
							if (firstDecParent.id.name !== checkedName) {
								checkedName = firstDecParent.id.name;
								reportCount = 0;
							}

							if (firstDecParent.id.type === "ObjectPattern") {
								if (firstDecParent.init.name !== checkedName) {
									checkedName = firstDecParent.init.name;
									reportCount = 0;
								}
							}

							if (firstDecParent.id !== checkedId) {
								checkedId = firstDecParent.id;
								reportCount = 0;
							}
						}
					}
				}

				let shouldFix =
					varDeclParent &&
					// Don't do a fix unless all variables in the declarations are initialized (or it's in a for-in or for-of loop)
					(varDeclParent.parent.type === "ForInStatement" ||
						varDeclParent.parent.type === "ForOfStatement" ||
						varDeclParent.declarations.every(
							declaration => declaration.init,
						)) &&
					/*
					 * If options.destructuring is "all", then this warning will not occur unless
					 * every assignment in the destructuring should be const. In that case, it's safe
					 * to apply the fix.
					 */
					nodesToReport.length === nodes.length;

				if (
					!isVarDecParentNull &&
					varDeclParent.declarations &&
					varDeclParent.declarations.length !== 1
				) {
					if (
						varDeclParent &&
						varDeclParent.declarations &&
						varDeclParent.declarations.length >= 1
					) {
						/*
						 * Add nodesToReport.length to a count, then comparing the count to the length
						 * of the declarations in the current block.
						 */

						reportCount += nodesToReport.length;

						let totalDeclarationsCount = 0;

						varDeclParent.declarations.forEach(declaration => {
							if (declaration.id.type === "ObjectPattern") {
								totalDeclarationsCount +=
									declaration.id.properties.length;
							} else if (declaration.id.type === "ArrayPattern") {
								totalDeclarationsCount +=
									declaration.id.elements.length;
							} else {
								totalDeclarationsCount += 1;
							}
						});

						shouldFix =
							shouldFix && reportCount === totalDeclarationsCount;
					}
				}

				nodesToReport.forEach(node => {
					context.report({
						node,
						messageId: "useConst",
						data: node,
						fix: shouldFix
							? fixer => {
									const letKeywordToken =
										sourceCode.getFirstToken(
											varDeclParent,
											t => t.value === varDeclParent.kind,
										);

									/**
									 * Extend the replacement range to the whole declaration,
									 * in order to prevent other fixes in the same pass
									 * https://github.com/eslint/eslint/issues/13899
									 */
									return new FixTracker(fixer, sourceCode)
										.retainRange(varDeclParent.range)
										.replaceTextRange(
											letKeywordToken.range,
											"const",
										);
								}
							: null,
					});
				});
			}
		}

		return {
			"Program:exit"() {
				groupByDestructuring(variables, ignoreReadBeforeAssign).forEach(
					checkGroup,
				);
			},

			VariableDeclaration(node) {
				if (node.kind === "let" && !isInitOfForStatement(node)) {
					variables.push(...sourceCode.getDeclaredVariables(node));
				}
			},
		};
	},
};
(ܳx"/**
 * @fileoverview Prefer destructuring from arrays and objects
 * @author Alex LaFroscia
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const PRECEDENCE_OF_ASSIGNMENT_EXPR = astUtils.getPrecedence({
	type: "AssignmentExpression",
});

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Require destructuring from arrays and/or objects",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/prefer-destructuring",
		},

		fixable: "code",

		schema: [
			{
				/*
				 * old support {array: Boolean, object: Boolean}
				 * new support {VariableDeclarator: {}, AssignmentExpression: {}}
				 */
				oneOf: [
					{
						type: "object",
						properties: {
							VariableDeclarator: {
								type: "object",
								properties: {
									array: {
										type: "boolean",
									},
									object: {
										type: "boolean",
									},
								},
								additionalProperties: false,
							},
							AssignmentExpression: {
								type: "object",
								properties: {
									array: {
										type: "boolean",
									},
									object: {
										type: "boolean",
									},
								},
								additionalProperties: false,
							},
						},
						additionalProperties: false,
					},
					{
						type: "object",
						properties: {
							array: {
								type: "boolean",
							},
							object: {
								type: "boolean",
							},
						},
						additionalProperties: false,
					},
				],
			},
			{
				type: "object",
				properties: {
					enforceForRenamedProperties: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			preferDestructuring: "Use {{type}} destructuring.",
		},
	},
	create(context) {
		const enabledTypes = context.options[0];
		const enforceForRenamedProperties =
			context.options[1] &&
			context.options[1].enforceForRenamedProperties;
		let normalizedOptions = {
			VariableDeclarator: { array: true, object: true },
			AssignmentExpression: { array: true, object: true },
		};

		if (enabledTypes) {
			normalizedOptions =
				typeof enabledTypes.array !== "undefined" ||
				typeof enabledTypes.object !== "undefined"
					? {
							VariableDeclarator: enabledTypes,
							AssignmentExpression: enabledTypes,
						}
					: enabledTypes;
		}

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Checks if destructuring type should be checked.
		 * @param {string} nodeType "AssignmentExpression" or "VariableDeclarator"
		 * @param {string} destructuringType "array" or "object"
		 * @returns {boolean} `true` if the destructuring type should be checked for the given node
		 */
		function shouldCheck(nodeType, destructuringType) {
			return (
				normalizedOptions &&
				normalizedOptions[nodeType] &&
				normalizedOptions[nodeType][destructuringType]
			);
		}

		/**
		 * Determines if the given node is accessing an array index
		 *
		 * This is used to differentiate array index access from object property
		 * access.
		 * @param {ASTNode} node the node to evaluate
		 * @returns {boolean} whether or not the node is an integer
		 */
		function isArrayIndexAccess(node) {
			return Number.isInteger(node.property.value);
		}

		/**
		 * Report that the given node should use destructuring
		 * @param {ASTNode} reportNode the node to report
		 * @param {string} type the type of destructuring that should have been done
		 * @param {Function|null} fix the fix function or null to pass to context.report
		 * @returns {void}
		 */
		function report(reportNode, type, fix) {
			context.report({
				node: reportNode,
				messageId: "preferDestructuring",
				data: { type },
				fix,
			});
		}

		/**
		 * Determines if a node should be fixed into object destructuring
		 *
		 * The fixer only fixes the simplest case of object destructuring,
		 * like: `let x = a.x`;
		 *
		 * Assignment expression is not fixed.
		 * Array destructuring is not fixed.
		 * Renamed property is not fixed.
		 * @param {ASTNode} node the node to evaluate
		 * @returns {boolean} whether or not the node should be fixed
		 */
		function shouldFix(node) {
			return (
				node.type === "VariableDeclarator" &&
				node.id.type === "Identifier" &&
				node.init.type === "MemberExpression" &&
				!node.init.computed &&
				node.init.property.type === "Identifier" &&
				node.id.name === node.init.property.name
			);
		}

		/**
		 * Fix a node into object destructuring.
		 * This function only handles the simplest case of object destructuring,
		 * see {@link shouldFix}.
		 * @param {SourceCodeFixer} fixer the fixer object
		 * @param {ASTNode} node the node to be fixed.
		 * @returns {Object} a fix for the node
		 */
		function fixIntoObjectDestructuring(fixer, node) {
			const rightNode = node.init;
			const sourceCode = context.sourceCode;

			// Don't fix if that would remove any comments. Only comments inside `rightNode.object` can be preserved.
			if (
				sourceCode.getCommentsInside(node).length >
				sourceCode.getCommentsInside(rightNode.object).length
			) {
				return null;
			}

			let objectText = sourceCode.getText(rightNode.object);

			if (
				astUtils.getPrecedence(rightNode.object) <
				PRECEDENCE_OF_ASSIGNMENT_EXPR
			) {
				objectText = `(${objectText})`;
			}

			return fixer.replaceText(
				node,
				`{${rightNode.property.name}} = ${objectText}`,
			);
		}

		/**
		 * Check that the `prefer-destructuring` rules are followed based on the
		 * given left- and right-hand side of the assignment.
		 *
		 * Pulled out into a separate method so that VariableDeclarators and
		 * AssignmentExpressions can share the same verification logic.
		 * @param {ASTNode} leftNode the left-hand side of the assignment
		 * @param {ASTNode} rightNode the right-hand side of the assignment
		 * @param {ASTNode} reportNode the node to report the error on
		 * @returns {void}
		 */
		function performCheck(leftNode, rightNode, reportNode) {
			if (
				rightNode.type !== "MemberExpression" ||
				rightNode.object.type === "Super" ||
				rightNode.property.type === "PrivateIdentifier"
			) {
				return;
			}

			if (isArrayIndexAccess(rightNode)) {
				if (shouldCheck(reportNode.type, "array")) {
					report(reportNode, "array", null);
				}
				return;
			}

			const fix = shouldFix(reportNode)
				? fixer => fixIntoObjectDestructuring(fixer, reportNode)
				: null;

			if (
				shouldCheck(reportNode.type, "object") &&
				enforceForRenamedProperties
			) {
				report(reportNode, "object", fix);
				return;
			}

			if (shouldCheck(reportNode.type, "object")) {
				const property = rightNode.property;

				if (
					(property.type === "Literal" &&
						leftNode.name === property.value) ||
					(property.type === "Identifier" &&
						leftNode.name === property.name &&
						!rightNode.computed)
				) {
					report(reportNode, "object", fix);
				}
			}
		}

		/**
		 * Check if a given variable declarator is coming from an property access
		 * that should be using destructuring instead
		 * @param {ASTNode} node the variable declarator to check
		 * @returns {void}
		 */
		function checkVariableDeclarator(node) {
			// Skip if variable is declared without assignment
			if (!node.init) {
				return;
			}

			// Variable declarations using explicit resource management cannot use destructuring (parse error)
			if (
				node.parent.kind === "using" ||
				node.parent.kind === "await using"
			) {
				return;
			}

			// We only care about member expressions past this point
			if (node.init.type !== "MemberExpression") {
				return;
			}

			performCheck(node.id, node.init, node);
		}

		/**
		 * Run the `prefer-destructuring` check on an AssignmentExpression
		 * @param {ASTNode} node the AssignmentExpression node
		 * @returns {void}
		 */
		function checkAssignmentExpression(node) {
			if (node.operator === "=") {
				performCheck(node.left, node.right, node);
			}
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			VariableDeclarator: checkVariableDeclarator,
			AssignmentExpression: checkAssignmentExpression,
		};
	},
};
oU$xy/**
 * @fileoverview Rule to disallow Math.pow in favor of the ** operator
 * @author Milos Djermanovic
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");
const { CALL, ReferenceTracker } = require("@eslint-community/eslint-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const PRECEDENCE_OF_EXPONENTIATION_EXPR = astUtils.getPrecedence({
	type: "BinaryExpression",
	operator: "**",
});

/*
 * Characters that can cause continuation without preceding semi
 */
const continuationChars = new Set(["(", "[", "/", "`"]);

/**
 * Determines whether the given node needs parens if used as the base in an exponentiation binary expression.
 * @param {ASTNode} base The node to check.
 * @returns {boolean} `true` if the node needs to be parenthesised.
 */
function doesBaseNeedParens(base) {
	return (
		// '**' is right-associative, parens are needed when Math.pow(a ** b, c) is converted to (a ** b) ** c
		astUtils.getPrecedence(base) <= PRECEDENCE_OF_EXPONENTIATION_EXPR ||
		// An unary operator cannot be used immediately before an exponentiation expression
		base.type === "AwaitExpression" ||
		base.type === "UnaryExpression"
	);
}

/**
 * Determines whether the given node needs parens if used as the exponent in an exponentiation binary expression.
 * @param {ASTNode} exponent The node to check.
 * @returns {boolean} `true` if the node needs to be parenthesised.
 */
function doesExponentNeedParens(exponent) {
	// '**' is right-associative, there is no need for parens when Math.pow(a, b ** c) is converted to a ** b ** c
	return astUtils.getPrecedence(exponent) < PRECEDENCE_OF_EXPONENTIATION_EXPR;
}

/**
 * Determines whether an exponentiation binary expression at the place of the given node would need parens.
 * @param {ASTNode} node A node that would be replaced by an exponentiation binary expression.
 * @param {SourceCode} sourceCode A SourceCode object.
 * @returns {boolean} `true` if the expression needs to be parenthesised.
 */
function doesExponentiationExpressionNeedParens(node, sourceCode) {
	const parent =
		node.parent.type === "ChainExpression"
			? node.parent.parent
			: node.parent;

	const parentPrecedence = astUtils.getPrecedence(parent);
	const needsParens =
		parent.type === "ClassDeclaration" ||
		(parent.type.endsWith("Expression") &&
			(parentPrecedence === -1 ||
				parentPrecedence >= PRECEDENCE_OF_EXPONENTIATION_EXPR) &&
			!(
				parent.type === "BinaryExpression" &&
				parent.operator === "**" &&
				parent.right === node
			) &&
			!(
				(parent.type === "CallExpression" ||
					parent.type === "NewExpression") &&
				parent.arguments.includes(node)
			) &&
			!(
				parent.type === "MemberExpression" &&
				parent.computed &&
				parent.property === node
			) &&
			!(parent.type === "ArrayExpression"));

	return needsParens && !astUtils.isParenthesised(sourceCode, node);
}

/**
 * Optionally parenthesizes given text.
 * @param {string} text The text to parenthesize.
 * @param {boolean} shouldParenthesize If `true`, the text will be parenthesised.
 * @returns {string} parenthesised or unchanged text.
 */
function parenthesizeIfShould(text, shouldParenthesize) {
	return shouldParenthesize ? `(${text})` : text;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Disallow the use of `Math.pow` in favor of the `**` operator",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/prefer-exponentiation-operator",
		},

		schema: [],
		fixable: "code",

		messages: {
			useExponentiation: "Use the '**' operator instead of 'Math.pow'.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		/**
		 * Reports the given node.
		 * @param {ASTNode} node 'Math.pow()' node to report.
		 * @returns {void}
		 */
		function report(node) {
			context.report({
				node,
				messageId: "useExponentiation",
				fix(fixer) {
					if (
						node.arguments.length !== 2 ||
						node.arguments.some(
							arg => arg.type === "SpreadElement",
						) ||
						sourceCode.getCommentsInside(node).length > 0
					) {
						return null;
					}

					const base = node.arguments[0],
						exponent = node.arguments[1],
						baseText = sourceCode.getText(base),
						exponentText = sourceCode.getText(exponent),
						shouldParenthesizeBase = doesBaseNeedParens(base),
						shouldParenthesizeExponent =
							doesExponentNeedParens(exponent),
						isStartOfExpressionStatement =
							astUtils.isStartOfExpressionStatement(node);

					let shouldParenthesizeAll =
						doesExponentiationExpressionNeedParens(
							node,
							sourceCode,
						);

					/*
					 * `function`, `class`, or `{` token at the start of an expression statement
					 * would cause incorrect parsing.
					 * https://github.com/eslint/eslint/issues/20987
					 */
					if (
						!shouldParenthesizeAll &&
						!shouldParenthesizeBase &&
						isStartOfExpressionStatement
					) {
						const firstTokenOfBase = sourceCode.getFirstToken(base);

						if (
							astUtils.isOpeningBraceToken(firstTokenOfBase) ||
							(firstTokenOfBase.type === "Keyword" &&
								(firstTokenOfBase.value === "function" ||
									firstTokenOfBase.value === "class"))
						) {
							shouldParenthesizeAll = true;
						}
					}

					let prefix = "",
						suffix = "";

					if (!shouldParenthesizeAll) {
						if (!shouldParenthesizeBase) {
							const firstReplacementToken =
									sourceCode.getFirstToken(base),
								tokenBefore = sourceCode.getTokenBefore(node);

							if (
								tokenBefore &&
								tokenBefore.range[1] === node.range[0] &&
								!astUtils.canTokensBeAdjacent(
									tokenBefore,
									firstReplacementToken,
								)
							) {
								prefix = " "; // a+Math.pow(++b, c) -> a+ ++b**c
							}
						}
						if (!shouldParenthesizeExponent) {
							const lastReplacementToken =
									sourceCode.getLastToken(exponent),
								tokenAfter = sourceCode.getTokenAfter(node);

							if (
								tokenAfter &&
								node.range[1] === tokenAfter.range[0] &&
								!astUtils.canTokensBeAdjacent(
									lastReplacementToken,
									tokenAfter,
								)
							) {
								suffix = " "; // Math.pow(a, b)in c -> a**b in c
							}
						}
					}

					const baseReplacement = parenthesizeIfShould(
							baseText,
							shouldParenthesizeBase,
						),
						exponentReplacement = parenthesizeIfShould(
							exponentText,
							shouldParenthesizeExponent,
						),
						replacement = parenthesizeIfShould(
							`${baseReplacement}**${exponentReplacement}`,
							shouldParenthesizeAll,
						);

					if (
						!prefix &&
						isStartOfExpressionStatement &&
						continuationChars.has(replacement[0]) &&
						astUtils.needsPrecedingSemicolon(sourceCode, node)
					) {
						prefix = ";";
					}

					return fixer.replaceText(
						node,
						`${prefix}${replacement}${suffix}`,
					);
				},
			});
		}

		return {
			Program(node) {
				const scope = sourceCode.getScope(node);
				const tracker = new ReferenceTracker(scope);
				const trackMap = {
					Math: {
						pow: { [CALL]: true },
					},
				};

				for (const { node: refNode } of tracker.iterateGlobalReferences(
					trackMap,
				)) {
					report(refNode);
				}
			},
		};
	},
};
88ƸxG/**
 * @fileoverview Rule to enforce requiring named capture groups in regular expression.
 * @author Pig Fang <https://github.com/g-plane>
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const {
	CALL,
	CONSTRUCT,
	ReferenceTracker,
	getStringIfConstant,
} = require("@eslint-community/eslint-utils");
const regexpp = require("@eslint-community/regexpp");

//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------

/** @import { SuggestedEdit } from "@eslint/core"; */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const parser = new regexpp.RegExpParser();

/**
 * Creates fixer suggestions for the regex, if statically determinable.
 * @param {number} groupStart Starting index of the regex group.
 * @param {string} pattern The regular expression pattern to be checked.
 * @param {string} rawText Source text of the regexNode.
 * @param {ASTNode} regexNode AST node which contains the regular expression.
 * @returns {Array<SuggestedEdit>} Fixer suggestions for the regex, if statically determinable.
 */
function suggestIfPossible(groupStart, pattern, rawText, regexNode) {
	switch (regexNode.type) {
		case "Literal":
			if (typeof regexNode.value === "string" && rawText.includes("\\")) {
				return null;
			}
			break;
		case "TemplateLiteral":
			if (
				regexNode.expressions.length ||
				rawText.slice(1, -1) !== pattern
			) {
				return null;
			}
			break;
		default:
			return null;
	}

	const start = regexNode.range[0] + groupStart + 2;

	return [
		{
			fix(fixer) {
				const existingTemps = pattern.match(/temp\d+/gu) || [];
				const highestTempCount = existingTemps.reduce(
					(previous, next) =>
						Math.max(previous, Number(next.slice("temp".length))),
					0,
				);

				return fixer.insertTextBeforeRange(
					[start, start],
					`?<temp${highestTempCount + 1}>`,
				);
			},
			messageId: "addGroupName",
		},
		{
			fix(fixer) {
				return fixer.insertTextBeforeRange([start, start], "?:");
			},
			messageId: "addNonCapture",
		},
	];
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Enforce using named capture group in regular expression",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/prefer-named-capture-group",
		},

		hasSuggestions: true,

		schema: [],

		messages: {
			addGroupName: "Add name to capture group.",
			addNonCapture: "Convert group to non-capturing.",
			required:
				"Capture group '{{group}}' should be converted to a named or non-capturing group.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		/**
		 * Function to check regular expression.
		 * @param {string} pattern The regular expression pattern to be checked.
		 * @param {ASTNode} node AST node which contains the regular expression or a call/new expression.
		 * @param {ASTNode} regexNode AST node which contains the regular expression.
		 * @param {string|null} flags The regular expression flags to be checked.
		 * @returns {void}
		 */
		function checkRegex(pattern, node, regexNode, flags) {
			let ast;

			try {
				ast = parser.parsePattern(pattern, 0, pattern.length, {
					unicode: Boolean(flags && flags.includes("u")),
					unicodeSets: Boolean(flags && flags.includes("v")),
				});
			} catch {
				// ignore regex syntax errors
				return;
			}

			regexpp.visitRegExpAST(ast, {
				onCapturingGroupEnter(group) {
					if (!group.name) {
						const rawText = sourceCode.getText(regexNode);
						const suggest = suggestIfPossible(
							group.start,
							pattern,
							rawText,
							regexNode,
						);

						context.report({
							node,
							messageId: "required",
							data: {
								group: group.raw,
							},
							suggest,
						});
					}
				},
			});
		}

		return {
			Literal(node) {
				if (node.regex) {
					checkRegex(
						node.regex.pattern,
						node,
						node,
						node.regex.flags,
					);
				}
			},
			Program(node) {
				const scope = sourceCode.getScope(node);
				const tracker = new ReferenceTracker(scope);
				const traceMap = {
					RegExp: {
						[CALL]: true,
						[CONSTRUCT]: true,
					},
				};

				for (const { node: refNode } of tracker.iterateGlobalReferences(
					traceMap,
				)) {
					const regex = getStringIfConstant(refNode.arguments[0]);
					const flags = getStringIfConstant(refNode.arguments[1]);

					if (regex) {
						checkRegex(regex, refNode, refNode.arguments[0], flags);
					}
				}
			},
		};
	},
};
*"xV/**
 * @fileoverview Rule to disallow `parseInt()` in favor of binary, octal, and hexadecimal literals
 * @author Annie Zhang, Henry Zhu
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const radixMap = new Map([
	[2, { system: "binary", literalPrefix: "0b" }],
	[8, { system: "octal", literalPrefix: "0o" }],
	[16, { system: "hexadecimal", literalPrefix: "0x" }],
]);

/**
 * Checks to see if a CallExpression's callee node is `parseInt` or
 * `Number.parseInt`.
 * @param {ASTNode} calleeNode The callee node to evaluate.
 * @param {SourceCode} sourceCode The source code object.
 * @returns {boolean} True if the callee is `parseInt` or `Number.parseInt`,
 * false otherwise.
 */
function isParseInt(calleeNode, sourceCode) {
	if (astUtils.isSpecificId(calleeNode, "parseInt")) {
		return sourceCode.isGlobalReference(calleeNode);
	}

	if (astUtils.isSpecificMemberAccess(calleeNode, "Number", "parseInt")) {
		const objectNode = astUtils.skipChainExpression(calleeNode).object;

		return sourceCode.isGlobalReference(objectNode);
	}

	return false;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/prefer-numeric-literals",
		},

		schema: [],

		messages: {
			useLiteral:
				"Use {{system}} literals instead of {{functionName}}().",
		},

		fixable: "code",
	},

	create(context) {
		const sourceCode = context.sourceCode;

		//----------------------------------------------------------------------
		// Public
		//----------------------------------------------------------------------

		return {
			"CallExpression[arguments.length=2]"(node) {
				const [strNode, radixNode] = node.arguments,
					str = astUtils.getStaticStringValue(strNode),
					radix = radixNode.value;

				if (
					str !== null &&
					astUtils.isStringLiteral(strNode) &&
					radixNode.type === "Literal" &&
					typeof radix === "number" &&
					radixMap.has(radix) &&
					isParseInt(node.callee, sourceCode)
				) {
					const { system, literalPrefix } = radixMap.get(radix);

					context.report({
						node,
						messageId: "useLiteral",
						data: {
							system,
							functionName: sourceCode.getText(node.callee),
						},
						fix(fixer) {
							if (sourceCode.getCommentsInside(node).length) {
								return null;
							}

							const replacement = `${literalPrefix}${str}`;

							if (+replacement !== parseInt(str, radix)) {
								/*
								 * If the newly-produced literal would be invalid, (e.g. 0b1234),
								 * or it would yield an incorrect parseInt result for some other reason, don't make a fix.
								 *
								 * If `str` had numeric separators, `+replacement` will evaluate to `NaN` because unary `+`
								 * per the specification doesn't support numeric separators. Thus, the above condition will be `true`
								 * (`NaN !== anything` is always `true`) regardless of the `parseInt(str, radix)` value.
								 * Consequently, no autofixes will be made. This is correct behavior because `parseInt` also
								 * doesn't support numeric separators, but it does parse part of the string before the first `_`,
								 * so the autofix would be invalid:
								 *
								 *   parseInt("1_1", 2) // === 1
								 *   0b1_1 // === 3
								 */
								return null;
							}

							const tokenBefore = sourceCode.getTokenBefore(node),
								tokenAfter = sourceCode.getTokenAfter(node);
							let prefix = "",
								suffix = "";

							if (
								tokenBefore &&
								tokenBefore.range[1] === node.range[0] &&
								!astUtils.canTokensBeAdjacent(
									tokenBefore,
									replacement,
								)
							) {
								prefix = " ";
							}

							if (
								tokenAfter &&
								node.range[1] === tokenAfter.range[0] &&
								!astUtils.canTokensBeAdjacent(
									replacement,
									tokenAfter,
								)
							) {
								suffix = " ";
							}

							return fixer.replaceText(
								node,
								`${prefix}${replacement}${suffix}`,
							);
						},
					});
				}
			},
		};
	},
};
=x1/**
 * @fileoverview Prefers Object.hasOwn() instead of Object.prototype.hasOwnProperty.call()
 * @author Nitin Kumar
 * @author Gautam Arora
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Checks if the given node is considered to be an access to a property of `Object.prototype`.
 * @param {ASTNode} node `MemberExpression` node to evaluate.
 * @returns {boolean} `true` if `node.object` is `Object`, `Object.prototype`, or `{}` (empty 'ObjectExpression' node).
 */
function hasLeftHandObject(node) {
	/*
	 * ({}).hasOwnProperty.call(obj, prop) - `true`
	 * ({ foo }.hasOwnProperty.call(obj, prop)) - `false`, object literal should be empty
	 */
	if (
		node.object.type === "ObjectExpression" &&
		node.object.properties.length === 0
	) {
		return true;
	}

	const objectNodeToCheck =
		node.object.type === "MemberExpression" &&
		astUtils.getStaticPropertyName(node.object) === "prototype"
			? node.object.object
			: node.object;

	if (
		objectNodeToCheck.type === "Identifier" &&
		objectNodeToCheck.name === "Object"
	) {
		return true;
	}

	return false;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",
		docs: {
			description:
				"Disallow use of `Object.prototype.hasOwnProperty.call()` and prefer use of `Object.hasOwn()`",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/prefer-object-has-own",
		},
		schema: [],
		messages: {
			useHasOwn:
				"Use 'Object.hasOwn()' instead of 'Object.prototype.hasOwnProperty.call()'.",
		},
		fixable: "code",
	},
	create(context) {
		const sourceCode = context.sourceCode;

		return {
			CallExpression(node) {
				if (!(
					node.callee.type === "MemberExpression" &&
					node.callee.object.type === "MemberExpression"
				)) {
					return;
				}

				const calleePropertyName = astUtils.getStaticPropertyName(
					node.callee,
				);
				const objectPropertyName = astUtils.getStaticPropertyName(
					node.callee.object,
				);
				const isObject = hasLeftHandObject(node.callee.object);

				// check `Object` scope
				const scope = sourceCode.getScope(node);
				const variable = astUtils.getVariableByName(scope, "Object");

				if (
					calleePropertyName === "call" &&
					objectPropertyName === "hasOwnProperty" &&
					isObject &&
					variable &&
					variable.scope.type === "global"
				) {
					context.report({
						node,
						messageId: "useHasOwn",
						fix(fixer) {
							if (
								sourceCode.getCommentsInside(node.callee)
									.length > 0
							) {
								return null;
							}

							const tokenJustBeforeNode =
								sourceCode.getTokenBefore(node.callee, {
									includeComments: true,
								});

							// for https://github.com/eslint/eslint/pull/15346#issuecomment-991417335
							if (
								tokenJustBeforeNode &&
								tokenJustBeforeNode.range[1] ===
									node.callee.range[0] &&
								!astUtils.canTokensBeAdjacent(
									tokenJustBeforeNode,
									"Object.hasOwn",
								)
							) {
								return fixer.replaceText(
									node.callee,
									" Object.hasOwn",
								);
							}

							return fixer.replaceText(
								node.callee,
								"Object.hasOwn",
							);
						},
					});
				}
			},
		};
	},
};
W.nx%./**
 * @fileoverview Rule to disallow using `Object.assign` with an object literal as the first argument and prefer the use of object spread instead
 * @author Sharmila Jesupaul
 */

"use strict";

const { CALL, ReferenceTracker } = require("@eslint-community/eslint-utils");
const {
	isCommaToken,
	isOpeningParenToken,
	isClosingParenToken,
	isParenthesised,
	isStartOfExpressionStatement,
	needsPrecedingSemicolon,
} = require("./utils/ast-utils");

const ANY_SPACE = /\s/u;

/**
 * Helper that checks if the Object.assign call has array spread
 * @param {ASTNode} node The node that the rule warns on
 * @returns {boolean} - Returns true if the Object.assign call has array spread
 */
function hasArraySpread(node) {
	return node.arguments.some(arg => arg.type === "SpreadElement");
}

/**
 * Determines whether the given node is an accessor property (getter/setter).
 * @param {ASTNode} node Node to check.
 * @returns {boolean} `true` if the node is a getter or a setter.
 */
function isAccessorProperty(node) {
	return (
		node.type === "Property" && (node.kind === "get" || node.kind === "set")
	);
}

/**
 * Determines whether the given object expression node has accessor properties (getters/setters).
 * @param {ASTNode} node `ObjectExpression` node to check.
 * @returns {boolean} `true` if the node has at least one getter/setter.
 */
function hasAccessors(node) {
	return node.properties.some(isAccessorProperty);
}

/**
 * Determines whether the given call expression node has object expression arguments with accessor properties (getters/setters).
 * @param {ASTNode} node `CallExpression` node to check.
 * @returns {boolean} `true` if the node has at least one argument that is an object expression with at least one getter/setter.
 */
function hasArgumentsWithAccessors(node) {
	return node.arguments
		.filter(arg => arg.type === "ObjectExpression")
		.some(hasAccessors);
}

/**
 * Helper that checks if the node needs parentheses to be valid JS.
 * The default is to wrap the node in parentheses to avoid parsing errors.
 * @param {ASTNode} node The node that the rule warns on
 * @param {Object} sourceCode in context sourcecode object
 * @returns {boolean} - Returns true if the node needs parentheses
 */
function needsParens(node, sourceCode) {
	const parent = node.parent;

	switch (parent.type) {
		case "VariableDeclarator":
		case "ArrayExpression":
		case "ReturnStatement":
		case "CallExpression":
		case "Property":
			return false;
		case "AssignmentExpression":
			return parent.left === node && !isParenthesised(sourceCode, node);
		default:
			return !isParenthesised(sourceCode, node);
	}
}

/**
 * Determines if an argument needs parentheses. The default is to not add parens.
 * @param {ASTNode} node The node to be checked.
 * @param {Object} sourceCode in context sourcecode object
 * @returns {boolean} True if the node needs parentheses
 */
function argNeedsParens(node, sourceCode) {
	switch (node.type) {
		case "AssignmentExpression":
		case "ArrowFunctionExpression":
		case "ConditionalExpression":
			return !isParenthesised(sourceCode, node);
		default:
			return false;
	}
}

/**
 * Get the parenthesis tokens of a given ObjectExpression node.
 * This includes the braces of the object literal and enclosing parentheses.
 * @param {ASTNode} node The node to get.
 * @param {Token} leftArgumentListParen The opening paren token of the argument list.
 * @param {SourceCode} sourceCode The source code object to get tokens.
 * @returns {Token[]} The parenthesis tokens of the node. This is sorted by the location.
 */
function getParenTokens(node, leftArgumentListParen, sourceCode) {
	const parens = [
		sourceCode.getFirstToken(node),
		sourceCode.getLastToken(node),
	];
	let leftNext = sourceCode.getTokenBefore(node);
	let rightNext = sourceCode.getTokenAfter(node);

	// Note: don't include the parens of the argument list.
	while (
		leftNext &&
		rightNext &&
		leftNext.range[0] > leftArgumentListParen.range[0] &&
		isOpeningParenToken(leftNext) &&
		isClosingParenToken(rightNext)
	) {
		parens.push(leftNext, rightNext);
		leftNext = sourceCode.getTokenBefore(leftNext);
		rightNext = sourceCode.getTokenAfter(rightNext);
	}

	return parens.sort((a, b) => a.range[0] - b.range[0]);
}

/**
 * Get the range of a given token and around whitespaces.
 * @param {Token} token The token to get range.
 * @param {SourceCode} sourceCode The source code object to get tokens.
 * @returns {number} The end of the range of the token and around whitespaces.
 */
function getStartWithSpaces(token, sourceCode) {
	const text = sourceCode.text;
	let start = token.range[0];

	// If the previous token is a line comment then skip this step to avoid commenting this token out.
	{
		const prevToken = sourceCode.getTokenBefore(token, {
			includeComments: true,
		});

		if (prevToken && prevToken.type === "Line") {
			return start;
		}
	}

	// Detect spaces before the token.
	while (ANY_SPACE.test(text[start - 1] || "")) {
		start -= 1;
	}

	return start;
}

/**
 * Get the range of a given token and around whitespaces.
 * @param {Token} token The token to get range.
 * @param {SourceCode} sourceCode The source code object to get tokens.
 * @returns {number} The start of the range of the token and around whitespaces.
 */
function getEndWithSpaces(token, sourceCode) {
	const text = sourceCode.text;
	let end = token.range[1];

	// Detect spaces after the token.
	while (ANY_SPACE.test(text[end] || "")) {
		end += 1;
	}

	return end;
}

/**
 * Autofixes the Object.assign call to use an object spread instead.
 * @param {ASTNode|null} node The node that the rule warns on, i.e. the Object.assign call
 * @param {string} sourceCode sourceCode of the Object.assign call
 * @returns {Function} autofixer - replaces the Object.assign with a spread object.
 */
function defineFixer(node, sourceCode) {
	return function* (fixer) {
		const leftParen = sourceCode.getTokenAfter(
			node.callee,
			isOpeningParenToken,
		);
		const rightParen = sourceCode.getLastToken(node);

		// Remove everything before the opening paren: callee `Object.assign`, type arguments, and whitespace between the callee and the paren.
		yield fixer.removeRange([node.range[0], leftParen.range[0]]);

		// Replace the parens of argument list to braces.
		if (needsParens(node, sourceCode)) {
			const prefix =
				isStartOfExpressionStatement(node) &&
				needsPrecedingSemicolon(sourceCode, node)
					? ";({"
					: "({";

			yield fixer.replaceText(leftParen, prefix);
			yield fixer.replaceText(rightParen, "})");
		} else {
			yield fixer.replaceText(leftParen, "{");
			yield fixer.replaceText(rightParen, "}");
		}

		// Process arguments.
		for (const argNode of node.arguments) {
			const innerParens = getParenTokens(argNode, leftParen, sourceCode);
			const left = innerParens.shift();
			const right = innerParens.pop();

			if (argNode.type === "ObjectExpression") {
				const maybeTrailingComma = sourceCode.getLastToken(argNode, 1);
				const maybeArgumentComma = sourceCode.getTokenAfter(right);

				/*
				 * Make bare this object literal.
				 * And remove spaces inside of the braces for better formatting.
				 */
				for (const innerParen of innerParens) {
					yield fixer.remove(innerParen);
				}
				const leftRange = [
					left.range[0],
					getEndWithSpaces(left, sourceCode),
				];
				const rightRange = [
					Math.max(
						getStartWithSpaces(right, sourceCode),
						leftRange[1],
					), // Ensure ranges don't overlap
					right.range[1],
				];

				yield fixer.removeRange(leftRange);
				yield fixer.removeRange(rightRange);

				// Remove the comma of this argument if it's duplication.
				if (
					(argNode.properties.length === 0 ||
						isCommaToken(maybeTrailingComma)) &&
					isCommaToken(maybeArgumentComma)
				) {
					yield fixer.remove(maybeArgumentComma);
				}
			} else {
				// Make spread.
				if (argNeedsParens(argNode, sourceCode)) {
					yield fixer.insertTextBefore(left, "...(");
					yield fixer.insertTextAfter(right, ")");
				} else {
					yield fixer.insertTextBefore(left, "...");
				}
			}
		}
	};
}

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Disallow using `Object.assign` with an object literal as the first argument and prefer the use of object spread instead",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/prefer-object-spread",
		},

		schema: [],
		fixable: "code",

		messages: {
			useSpreadMessage:
				"Use an object spread instead of `Object.assign` eg: `{ ...foo }`.",
			useLiteralMessage:
				"Use an object literal instead of `Object.assign`. eg: `{ foo: bar }`.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		return {
			Program(node) {
				const scope = sourceCode.getScope(node);
				const tracker = new ReferenceTracker(scope);
				const trackMap = {
					Object: {
						assign: { [CALL]: true },
					},
				};

				// Iterate all calls of `Object.assign` (only of the global variable `Object`).
				for (const { node: refNode } of tracker.iterateGlobalReferences(
					trackMap,
				)) {
					if (
						refNode.arguments.length >= 1 &&
						refNode.arguments[0].type === "ObjectExpression" &&
						!hasArraySpread(refNode) &&
						!(
							refNode.arguments.length > 1 &&
							hasArgumentsWithAccessors(refNode)
						)
					) {
						const messageId =
							refNode.arguments.length === 1
								? "useLiteralMessage"
								: "useSpreadMessage";
						const fix = defineFixer(refNode, sourceCode);

						context.report({ node: refNode, messageId, fix });
					}
				}
			},
		};
	},
};
@fϵx
/**
 * @fileoverview restrict values that can be used as Promise rejection reasons
 * @author Teddy Katz
 */
"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				allowEmptyReject: false,
			},
		],

		docs: {
			description:
				"Require using Error objects as Promise rejection reasons",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/prefer-promise-reject-errors",
		},

		fixable: null,

		schema: [
			{
				type: "object",
				properties: {
					allowEmptyReject: { type: "boolean" },
				},
				additionalProperties: false,
			},
		],

		messages: {
			rejectAnError:
				"Expected the Promise rejection reason to be an Error.",
		},
	},

	create(context) {
		const [{ allowEmptyReject }] = context.options;
		const sourceCode = context.sourceCode;

		//----------------------------------------------------------------------
		// Helpers
		//----------------------------------------------------------------------

		/**
		 * Checks the argument of a reject() or Promise.reject() CallExpression, and reports it if it can't be an Error
		 * @param {ASTNode} callExpression A CallExpression node which is used to reject a Promise
		 * @returns {void}
		 */
		function checkRejectCall(callExpression) {
			if (!callExpression.arguments.length && allowEmptyReject) {
				return;
			}

			const rejectionReason = callExpression.arguments[0];

			if (
				!callExpression.arguments.length ||
				!astUtils.couldBeError(rejectionReason) ||
				(rejectionReason.type === "Identifier" &&
					rejectionReason.name === "undefined" &&
					sourceCode.isGlobalReference(rejectionReason))
			) {
				context.report({
					node: callExpression,
					messageId: "rejectAnError",
				});
			}
		}

		/**
		 * Determines whether a function call is a Promise.reject() call
		 * @param {ASTNode} node A CallExpression node
		 * @returns {boolean} `true` if the call is a Promise.reject() call
		 */
		function isPromiseRejectCall(node) {
			return (
				astUtils.isSpecificMemberAccess(
					node.callee,
					"Promise",
					"reject",
				) &&
				sourceCode.isGlobalReference(
					astUtils.skipChainExpression(node.callee).object,
				)
			);
		}

		//----------------------------------------------------------------------
		// Public
		//----------------------------------------------------------------------

		return {
			// Check `Promise.reject(value)` calls.
			CallExpression(node) {
				if (isPromiseRejectCall(node)) {
					checkRejectCall(node);
				}
			},

			/*
			 * Check for `new Promise((resolve, reject) => {})`, and check for reject() calls.
			 * This function is run on "NewExpression:exit" instead of "NewExpression" to ensure that
			 * the nodes in the expression already have the `parent` property.
			 */
			"NewExpression:exit"(node) {
				if (
					node.callee.type === "Identifier" &&
					node.callee.name === "Promise" &&
					sourceCode.isGlobalReference(node.callee) &&
					node.arguments.length &&
					astUtils.isFunction(node.arguments[0]) &&
					node.arguments[0].params.length > 1 &&
					node.arguments[0].params[1].type === "Identifier"
				) {
					sourceCode
						.getDeclaredVariables(node.arguments[0])

						/*
						 * Find the first variable that matches the second parameter's name.
						 * If the first parameter has the same name as the second parameter, then the variable will actually
						 * be "declared" when the first parameter is evaluated, but then it will be immediately overwritten
						 * by the second parameter. It's not possible for an expression with the variable to be evaluated before
						 * the variable is overwritten, because functions with duplicate parameters cannot have destructuring or
						 * default assignments in their parameter lists. Therefore, it's not necessary to explicitly account for
						 * this case.
						 */
						.find(
							variable =>
								variable.name ===
								node.arguments[0].params[1].name,
						)

						// Get the references to that variable.
						.references // Only check the references that read the parameter's value.
						.filter(ref => ref.isRead())

						// Only check the references that are used as the callee in a function call, e.g. `reject(foo)`.
						.filter(
							ref =>
								ref.identifier.parent.type ===
									"CallExpression" &&
								ref.identifier === ref.identifier.parent.callee,
						)

						// Check the argument of the function call to determine whether it's an Error.
						.forEach(ref => checkRejectCall(ref.identifier.parent));
				}
			},
		};
	},
};
3մx/**
 * @fileoverview Rule to suggest using "Reflect" api over Function/Object methods
 * @author Keith Cirkel <http://keithcirkel.co.uk>
 * @deprecated in ESLint v3.9.0
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Require `Reflect` methods where applicable",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/prefer-reflect",
		},

		deprecated: {
			message: "The original intention of this rule was misguided.",
			deprecatedSince: "3.9.0",
			availableUntil: null,
			replacedBy: [],
		},

		schema: [
			{
				type: "object",
				properties: {
					exceptions: {
						type: "array",
						items: {
							enum: [
								"apply",
								"call",
								"delete",
								"defineProperty",
								"getOwnPropertyDescriptor",
								"getPrototypeOf",
								"setPrototypeOf",
								"isExtensible",
								"getOwnPropertyNames",
								"preventExtensions",
							],
						},
						uniqueItems: true,
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			preferReflect:
				"Avoid using {{existing}}, instead use {{substitute}}.",
		},
	},

	create(context) {
		const existingNames = {
			apply: "Function.prototype.apply",
			call: "Function.prototype.call",
			defineProperty: "Object.defineProperty",
			getOwnPropertyDescriptor: "Object.getOwnPropertyDescriptor",
			getPrototypeOf: "Object.getPrototypeOf",
			setPrototypeOf: "Object.setPrototypeOf",
			isExtensible: "Object.isExtensible",
			getOwnPropertyNames: "Object.getOwnPropertyNames",
			preventExtensions: "Object.preventExtensions",
		};

		const reflectSubstitutes = {
			apply: "Reflect.apply",
			call: "Reflect.apply",
			defineProperty: "Reflect.defineProperty",
			getOwnPropertyDescriptor: "Reflect.getOwnPropertyDescriptor",
			getPrototypeOf: "Reflect.getPrototypeOf",
			setPrototypeOf: "Reflect.setPrototypeOf",
			isExtensible: "Reflect.isExtensible",
			getOwnPropertyNames: "Reflect.getOwnPropertyNames",
			preventExtensions: "Reflect.preventExtensions",
		};

		const exceptions = (context.options[0] || {}).exceptions || [];

		/**
		 * Reports the Reflect violation based on the `existing` and `substitute`
		 * @param {Object} node The node that violates the rule.
		 * @param {string} existing The existing method name that has been used.
		 * @param {string} substitute The Reflect substitute that should be used.
		 * @returns {void}
		 */
		function report(node, existing, substitute) {
			context.report({
				node,
				messageId: "preferReflect",
				data: {
					existing,
					substitute,
				},
			});
		}

		return {
			CallExpression(node) {
				const methodName = (node.callee.property || {}).name;
				const isReflectCall =
					(node.callee.object || {}).name === "Reflect";
				const hasReflectSubstitute = Object.hasOwn(
					reflectSubstitutes,
					methodName,
				);
				const userConfiguredException = exceptions.includes(methodName);

				if (
					hasReflectSubstitute &&
					!isReflectCall &&
					!userConfiguredException
				) {
					report(
						node,
						existingNames[methodName],
						reflectSubstitutes[methodName],
					);
				}
			},
			UnaryExpression(node) {
				const isDeleteOperator = node.operator === "delete";
				const targetsIdentifier = node.argument.type === "Identifier";
				const userConfiguredException = exceptions.includes("delete");

				if (
					isDeleteOperator &&
					!targetsIdentifier &&
					!userConfiguredException
				) {
					report(
						node,
						"the delete keyword",
						"Reflect.deleteProperty",
					);
				}
			},
		};
	},
};
/ŋx+8/**
 * @fileoverview Rule to disallow use of the `RegExp` constructor in favor of regular expression literals
 * @author Milos Djermanovic
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");
const {
	CALL,
	CONSTRUCT,
	ReferenceTracker,
} = require("@eslint-community/eslint-utils");
const {
	RegExpValidator,
	visitRegExpAST,
	RegExpParser,
} = require("@eslint-community/regexpp");
const { canTokensBeAdjacent } = require("./utils/ast-utils");
const { REGEXPP_LATEST_ECMA_VERSION } = require("./utils/regular-expressions");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Determines whether the given node is a string literal.
 * @param {ASTNode} node Node to check.
 * @returns {boolean} True if the node is a string literal.
 */
function isStringLiteral(node) {
	return node.type === "Literal" && typeof node.value === "string";
}

/**
 * Determines whether the given node is a regex literal.
 * @param {ASTNode} node Node to check.
 * @returns {boolean} True if the node is a regex literal.
 */
function isRegexLiteral(node) {
	return node.type === "Literal" && Object.hasOwn(node, "regex");
}

const validPrecedingTokens = new Set([
	"(",
	";",
	"[",
	",",
	"=",
	"+",
	"*",
	"-",
	"?",
	"~",
	"%",
	"**",
	"!",
	"typeof",
	"instanceof",
	"&&",
	"||",
	"??",
	"return",
	"...",
	"delete",
	"void",
	"in",
	"<",
	">",
	"<=",
	">=",
	"==",
	"===",
	"!=",
	"!==",
	"<<",
	">>",
	">>>",
	"&",
	"|",
	"^",
	":",
	"{",
	"=>",
	"*=",
	"<<=",
	">>=",
	">>>=",
	"^=",
	"|=",
	"&=",
	"??=",
	"||=",
	"&&=",
	"**=",
	"+=",
	"-=",
	"/=",
	"%=",
	"/",
	"do",
	"break",
	"continue",
	"debugger",
	"case",
	"throw",
]);

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				disallowRedundantWrapping: false,
			},
		],

		docs: {
			description:
				"Disallow use of the `RegExp` constructor in favor of regular expression literals",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/prefer-regex-literals",
		},

		hasSuggestions: true,

		schema: [
			{
				type: "object",
				properties: {
					disallowRedundantWrapping: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			unexpectedRegExp:
				"Use a regular expression literal instead of the 'RegExp' constructor.",
			replaceWithLiteral:
				"Replace with an equivalent regular expression literal.",
			replaceWithLiteralAndFlags:
				"Replace with an equivalent regular expression literal with flags '{{ flags }}'.",
			replaceWithIntendedLiteralAndFlags:
				"Replace with a regular expression literal with flags '{{ flags }}'.",
			unexpectedRedundantRegExp:
				"Regular expression literal is unnecessarily wrapped within a 'RegExp' constructor.",
			unexpectedRedundantRegExpWithFlags:
				"Use regular expression literal with flags instead of the 'RegExp' constructor.",
		},
	},

	create(context) {
		const [{ disallowRedundantWrapping }] = context.options;
		const sourceCode = context.sourceCode;

		/**
		 * Determines whether the given node is a String.raw`` tagged template expression
		 * with a static template literal.
		 * @param {ASTNode} node Node to check.
		 * @returns {boolean} True if the node is String.raw`` with a static template.
		 */
		function isStringRawTaggedStaticTemplateLiteral(node) {
			return (
				node.type === "TaggedTemplateExpression" &&
				astUtils.isSpecificMemberAccess(node.tag, "String", "raw") &&
				sourceCode.isGlobalReference(
					astUtils.skipChainExpression(node.tag).object,
				) &&
				astUtils.isStaticTemplateLiteral(node.quasi)
			);
		}

		/**
		 * Gets the value of a string
		 * @param {ASTNode} node The node to get the string of.
		 * @returns {string|null} The value of the node.
		 */
		function getStringValue(node) {
			if (isStringLiteral(node)) {
				return node.value;
			}

			if (astUtils.isStaticTemplateLiteral(node)) {
				return node.quasis[0].value.cooked;
			}

			if (isStringRawTaggedStaticTemplateLiteral(node)) {
				return node.quasi.quasis[0].value.raw;
			}

			return null;
		}

		/**
		 * Determines whether the given node is considered to be a static string by the logic of this rule.
		 * @param {ASTNode} node Node to check.
		 * @returns {boolean} True if the node is a static string.
		 */
		function isStaticString(node) {
			return (
				isStringLiteral(node) ||
				astUtils.isStaticTemplateLiteral(node) ||
				isStringRawTaggedStaticTemplateLiteral(node)
			);
		}

		/**
		 * Determines whether the relevant arguments of the given are all static string literals.
		 * @param {ASTNode} node Node to check.
		 * @returns {boolean} True if all arguments are static strings.
		 */
		function hasOnlyStaticStringArguments(node) {
			const args = node.arguments;

			if (
				(args.length === 1 || args.length === 2) &&
				args.every(isStaticString)
			) {
				return true;
			}

			return false;
		}

		/**
		 * Determines whether the arguments of the given node indicate that a regex literal is unnecessarily wrapped.
		 * @param {ASTNode} node Node to check.
		 * @returns {boolean} True if the node already contains a regex literal argument.
		 */
		function isUnnecessarilyWrappedRegexLiteral(node) {
			const args = node.arguments;

			if (args.length === 1 && isRegexLiteral(args[0])) {
				return true;
			}

			if (
				args.length === 2 &&
				isRegexLiteral(args[0]) &&
				isStaticString(args[1])
			) {
				return true;
			}

			return false;
		}

		/**
		 * Returns a ecmaVersion compatible for regexpp.
		 * @param {number} ecmaVersion The ecmaVersion to convert.
		 * @returns {import("@eslint-community/regexpp/ecma-versions").EcmaVersion} The resulting ecmaVersion compatible for regexpp.
		 */
		function getRegexppEcmaVersion(ecmaVersion) {
			if (ecmaVersion <= 5) {
				return 5;
			}
			return Math.min(ecmaVersion, REGEXPP_LATEST_ECMA_VERSION);
		}

		const regexppEcmaVersion = getRegexppEcmaVersion(
			context.languageOptions.ecmaVersion,
		);

		/**
		 * Makes a character escaped or else returns null.
		 * @param {string} character The character to escape.
		 * @returns {string} The resulting escaped character.
		 */
		function resolveEscapes(character) {
			switch (character) {
				case "\n":
				case "\\\n":
					return "\\n";

				case "\r":
				case "\\\r":
					return "\\r";

				case "\t":
				case "\\\t":
					return "\\t";

				case "\v":
				case "\\\v":
					return "\\v";

				case "\f":
				case "\\\f":
					return "\\f";

				case "/":
					return "\\/";

				default:
					return null;
			}
		}

		/**
		 * Checks whether the given regex and flags are valid for the ecma version or not.
		 * @param {string} pattern The regex pattern to check.
		 * @param {string | undefined} flags The regex flags to check.
		 * @returns {boolean} True if the given regex pattern and flags are valid for the ecma version.
		 */
		function isValidRegexForEcmaVersion(pattern, flags) {
			const validator = new RegExpValidator({
				ecmaVersion: regexppEcmaVersion,
			});

			try {
				validator.validatePattern(pattern, 0, pattern.length, {
					unicode: flags ? flags.includes("u") : false,
					unicodeSets: flags ? flags.includes("v") : false,
				});
				if (flags) {
					validator.validateFlags(flags);
				}
				return true;
			} catch {
				return false;
			}
		}

		/**
		 * Checks whether two given regex flags contain the same flags or not.
		 * @param {string} flagsA The regex flags.
		 * @param {string} flagsB The regex flags.
		 * @returns {boolean} True if two regex flags contain same flags.
		 */
		function areFlagsEqual(flagsA, flagsB) {
			return [...flagsA].sort().join("") === [...flagsB].sort().join("");
		}

		/**
		 * Merges two regex flags.
		 * @param {string} flagsA The regex flags.
		 * @param {string} flagsB The regex flags.
		 * @returns {string} The merged regex flags.
		 */
		function mergeRegexFlags(flagsA, flagsB) {
			const flagsSet = new Set([...flagsA, ...flagsB]);

			return [...flagsSet].join("");
		}

		/**
		 * Checks whether a give node can be fixed to the given regex pattern and flags.
		 * @param {ASTNode} node The node to check.
		 * @param {string} pattern The regex pattern to check.
		 * @param {string} flags The regex flags
		 * @returns {boolean} True if a node can be fixed to the given regex pattern and flags.
		 */
		function canFixTo(node, pattern, flags) {
			const tokenBefore = sourceCode.getTokenBefore(node);

			return (
				sourceCode.getCommentsInside(node).length === 0 &&
				(!tokenBefore || validPrecedingTokens.has(tokenBefore.value)) &&
				isValidRegexForEcmaVersion(pattern, flags)
			);
		}

		/**
		 * Returns a safe output code considering the before and after tokens.
		 * @param {ASTNode} node The regex node.
		 * @param {string} newRegExpValue The new regex expression value.
		 * @returns {string} The output code.
		 */
		function getSafeOutput(node, newRegExpValue) {
			const tokenBefore = sourceCode.getTokenBefore(node);
			const tokenAfter = sourceCode.getTokenAfter(node);

			return (
				(tokenBefore &&
				!canTokensBeAdjacent(tokenBefore, newRegExpValue) &&
				tokenBefore.range[1] === node.range[0]
					? " "
					: "") +
				newRegExpValue +
				(tokenAfter &&
				!canTokensBeAdjacent(newRegExpValue, tokenAfter) &&
				node.range[1] === tokenAfter.range[0]
					? " "
					: "")
			);
		}

		return {
			Program(node) {
				const scope = sourceCode.getScope(node);
				const tracker = new ReferenceTracker(scope);
				const traceMap = {
					RegExp: {
						[CALL]: true,
						[CONSTRUCT]: true,
					},
				};

				for (const { node: refNode } of tracker.iterateGlobalReferences(
					traceMap,
				)) {
					if (
						disallowRedundantWrapping &&
						isUnnecessarilyWrappedRegexLiteral(refNode)
					) {
						const regexNode = refNode.arguments[0];

						if (refNode.arguments.length === 2) {
							const suggests = [];

							const argFlags =
								getStringValue(refNode.arguments[1]) || "";

							if (
								canFixTo(
									refNode,
									regexNode.regex.pattern,
									argFlags,
								)
							) {
								suggests.push({
									messageId: "replaceWithLiteralAndFlags",
									pattern: regexNode.regex.pattern,
									flags: argFlags,
								});
							}

							const literalFlags = regexNode.regex.flags || "";
							const mergedFlags = mergeRegexFlags(
								literalFlags,
								argFlags,
							);

							if (
								!areFlagsEqual(mergedFlags, argFlags) &&
								canFixTo(
									refNode,
									regexNode.regex.pattern,
									mergedFlags,
								)
							) {
								suggests.push({
									messageId:
										"replaceWithIntendedLiteralAndFlags",
									pattern: regexNode.regex.pattern,
									flags: mergedFlags,
								});
							}

							context.report({
								node: refNode,
								messageId: "unexpectedRedundantRegExpWithFlags",
								suggest: suggests.map(
									({ flags, pattern, messageId }) => ({
										messageId,
										data: {
											flags,
										},
										fix(fixer) {
											return fixer.replaceText(
												refNode,
												getSafeOutput(
													refNode,
													`/${pattern}/${flags}`,
												),
											);
										},
									}),
								),
							});
						} else {
							const outputs = [];

							if (
								canFixTo(
									refNode,
									regexNode.regex.pattern,
									regexNode.regex.flags,
								)
							) {
								outputs.push(sourceCode.getText(regexNode));
							}

							context.report({
								node: refNode,
								messageId: "unexpectedRedundantRegExp",
								suggest: outputs.map(output => ({
									messageId: "replaceWithLiteral",
									fix(fixer) {
										return fixer.replaceText(
											refNode,
											getSafeOutput(refNode, output),
										);
									},
								})),
							});
						}
					} else if (hasOnlyStaticStringArguments(refNode)) {
						let regexContent = getStringValue(refNode.arguments[0]);
						let noFix = false;
						let flags;

						if (refNode.arguments[1]) {
							flags = getStringValue(refNode.arguments[1]);
						}

						if (!canFixTo(refNode, regexContent, flags)) {
							noFix = true;
						}

						if (
							!/^[-\w\\[\](){} \t\r\n\v\f!@#$%^&*+=/~`.><?,'"|:;]*$/u.test(
								regexContent,
							)
						) {
							noFix = true;
						}

						if (regexContent && !noFix) {
							let charIncrease = 0;

							const ast = new RegExpParser({
								ecmaVersion: regexppEcmaVersion,
							}).parsePattern(
								regexContent,
								0,
								regexContent.length,
								{
									unicode: flags
										? flags.includes("u")
										: false,
									unicodeSets: flags
										? flags.includes("v")
										: false,
								},
							);

							visitRegExpAST(ast, {
								onCharacterEnter(characterNode) {
									const escaped = resolveEscapes(
										characterNode.raw,
									);

									if (escaped) {
										regexContent =
											regexContent.slice(
												0,
												characterNode.start +
													charIncrease,
											) +
											escaped +
											regexContent.slice(
												characterNode.end +
													charIncrease,
											);

										if (characterNode.raw.length === 1) {
											charIncrease += 1;
										}
									}
								},
							});
						}

						const newRegExpValue = `/${regexContent || "(?:)"}/${flags || ""}`;

						context.report({
							node: refNode,
							messageId: "unexpectedRegExp",
							suggest: noFix
								? []
								: [
										{
											messageId: "replaceWithLiteral",
											fix(fixer) {
												return fixer.replaceText(
													refNode,
													getSafeOutput(
														refNode,
														newRegExpValue,
													),
												);
											},
										},
									],
						});
					}
				}
			},
		};
	},
};
Snx/**
 * @fileoverview Rule to
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @typedef {import("eslint-scope").Scope} Scope */
/** @typedef {import("eslint-scope").Variable} Variable */
/** @typedef {import("eslint-scope").Reference} Reference */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Gets the variable object of `arguments` which is defined implicitly.
 * @param {Scope} scope A scope to get.
 * @returns {Variable} The found variable object.
 */
function getVariableOfArguments(scope) {
	const variables = scope.variables;

	for (let i = 0; i < variables.length; ++i) {
		const variable = variables[i];

		if (variable.name === "arguments") {
			/*
			 * If there was a parameter which is named "arguments", the implicit "arguments" is not defined.
			 * So does fast return with null.
			 */
			return variable.identifiers.length === 0 ? variable : null;
		}
	}

	/* c8 ignore next */
	return null;
}

/**
 * Checks if the given reference is not normal member access.
 *
 * - arguments         .... true    // not member access
 * - arguments[i]      .... true    // computed member access
 * - arguments[0]      .... true    // computed member access
 * - arguments.length  .... false   // normal member access
 * @param {Reference} reference The reference to check.
 * @returns {boolean} `true` if the reference is not normal member access.
 */
function isNotNormalMemberAccess(reference) {
	const id = reference.identifier;
	const parent = id.parent;

	return !(
		parent.type === "MemberExpression" &&
		parent.object === id &&
		!parent.computed
	);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Require rest parameters instead of `arguments`",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/prefer-rest-params",
		},

		schema: [],

		messages: {
			preferRestParams: "Use the rest parameters instead of 'arguments'.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		/**
		 * Reports a given reference.
		 * @param {Reference} reference A reference to report.
		 * @returns {void}
		 */
		function report(reference) {
			context.report({
				node: reference.identifier,
				loc: reference.identifier.loc,
				messageId: "preferRestParams",
			});
		}

		/**
		 * Reports references of the implicit `arguments` variable if exist.
		 * @param {ASTNode} node The node representing the function.
		 * @returns {void}
		 */
		function checkForArguments(node) {
			const argumentsVar = getVariableOfArguments(
				sourceCode.getScope(node),
			);

			if (argumentsVar) {
				argumentsVar.references
					.filter(isNotNormalMemberAccess)
					.forEach(report);
			}
		}

		return {
			"FunctionDeclaration:exit": checkForArguments,
			"FunctionExpression:exit": checkForArguments,
		};
	},
};
奻x	/**
 * @fileoverview A rule to suggest using of the spread operator instead of `.apply()`.
 * @author Toru Nagashima
 */

"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Checks whether or not a node is a `.apply()` for variadic.
 * @param {ASTNode} node A CallExpression node to check.
 * @returns {boolean} Whether or not the node is a `.apply()` for variadic.
 */
function isVariadicApplyCalling(node) {
	return (
		astUtils.isSpecificMemberAccess(node.callee, null, "apply") &&
		node.arguments.length === 2 &&
		node.arguments[1].type !== "ArrayExpression" &&
		node.arguments[1].type !== "SpreadElement"
	);
}

/**
 * Checks whether or not `thisArg` is not changed by `.apply()`.
 * @param {ASTNode|null} expectedThis The node that is the owner of the applied function.
 * @param {ASTNode} thisArg The node that is given to the first argument of the `.apply()`.
 * @param {RuleContext} context The ESLint rule context object.
 * @returns {boolean} Whether or not `thisArg` is not changed by `.apply()`.
 */
function isValidThisArg(expectedThis, thisArg, context) {
	if (!expectedThis) {
		return astUtils.isNullOrUndefined(thisArg);
	}
	return astUtils.equalTokens(expectedThis, thisArg, context);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Require spread operators instead of `.apply()`",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/prefer-spread",
		},

		schema: [],
		fixable: null,

		messages: {
			preferSpread: "Use the spread operator instead of '.apply()'.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		return {
			CallExpression(node) {
				if (!isVariadicApplyCalling(node)) {
					return;
				}

				const applied = astUtils.skipChainExpression(
					astUtils.skipChainExpression(node.callee).object,
				);
				const expectedThis =
					applied.type === "MemberExpression" ? applied.object : null;
				const thisArg = node.arguments[0];

				if (isValidThisArg(expectedThis, thisArg, sourceCode)) {
					context.report({
						node,
						messageId: "preferSpread",
					});
				}
			},
		};
	},
};
vx0)/**
 * @fileoverview A rule to suggest using template literals instead of string concatenation.
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Checks whether or not a given node is a concatenation.
 * @param {ASTNode} node A node to check.
 * @returns {boolean} `true` if the node is a concatenation.
 */
function isConcatenation(node) {
	return node.type === "BinaryExpression" && node.operator === "+";
}

/**
 * Gets the top binary expression node for concatenation in parents of a given node.
 * @param {ASTNode} node A node to get.
 * @returns {ASTNode} the top binary expression node in parents of a given node.
 */
function getTopConcatBinaryExpression(node) {
	let currentNode = node;

	while (isConcatenation(currentNode.parent)) {
		currentNode = currentNode.parent;
	}
	return currentNode;
}

/**
 * Checks whether or not a node contains a string literal with an octal or non-octal decimal escape sequence
 * @param {ASTNode} node A node to check
 * @returns {boolean} `true` if at least one string literal within the node contains
 * an octal or non-octal decimal escape sequence
 */
function hasOctalOrNonOctalDecimalEscapeSequence(node) {
	if (isConcatenation(node)) {
		return (
			hasOctalOrNonOctalDecimalEscapeSequence(node.left) ||
			hasOctalOrNonOctalDecimalEscapeSequence(node.right)
		);
	}

	// No need to check TemplateLiterals – would throw parsing error
	if (node.type === "Literal" && typeof node.value === "string") {
		return astUtils.hasOctalOrNonOctalDecimalEscapeSequence(node.raw);
	}

	return false;
}

/**
 * Checks whether or not a given binary expression has string literals.
 * @param {ASTNode} node A node to check.
 * @returns {boolean} `true` if the node has string literals.
 */
function hasStringLiteral(node) {
	if (isConcatenation(node)) {
		// `left` is deeper than `right` normally.
		return hasStringLiteral(node.right) || hasStringLiteral(node.left);
	}
	return astUtils.isStringLiteral(node);
}

/**
 * Checks whether or not a given binary expression has non string literals.
 * @param {ASTNode} node A node to check.
 * @returns {boolean} `true` if the node has non string literals.
 */
function hasNonStringLiteral(node) {
	if (isConcatenation(node)) {
		// `left` is deeper than `right` normally.
		return (
			hasNonStringLiteral(node.right) || hasNonStringLiteral(node.left)
		);
	}
	return !astUtils.isStringLiteral(node);
}

/**
 * Determines whether a given node will start with a template curly expression (`${}`) when being converted to a template literal.
 * @param {ASTNode} node The node that will be fixed to a template literal
 * @returns {boolean} `true` if the node will start with a template curly.
 */
function startsWithTemplateCurly(node) {
	if (node.type === "BinaryExpression") {
		return startsWithTemplateCurly(node.left);
	}
	if (node.type === "TemplateLiteral") {
		return (
			node.expressions.length &&
			node.quasis.length &&
			node.quasis[0].range[0] === node.quasis[0].range[1]
		);
	}
	return node.type !== "Literal" || typeof node.value !== "string";
}

/**
 * Determines whether a given node end with a template curly expression (`${}`) when being converted to a template literal.
 * @param {ASTNode} node The node that will be fixed to a template literal
 * @returns {boolean} `true` if the node will end with a template curly.
 */
function endsWithTemplateCurly(node) {
	if (node.type === "BinaryExpression") {
		return startsWithTemplateCurly(node.right);
	}
	if (node.type === "TemplateLiteral") {
		return (
			node.expressions.length &&
			node.quasis.length &&
			node.quasis.at(-1).range[0] === node.quasis.at(-1).range[1]
		);
	}
	return node.type !== "Literal" || typeof node.value !== "string";
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Require template literals instead of string concatenation",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/prefer-template",
		},

		schema: [],
		fixable: "code",

		messages: {
			unexpectedStringConcatenation: "Unexpected string concatenation.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		let done = Object.create(null);

		/**
		 * Gets the non-token text between two nodes, ignoring any other tokens that appear between the two tokens.
		 * @param {ASTNode} node1 The first node
		 * @param {ASTNode} node2 The second node
		 * @returns {string} The text between the nodes, excluding other tokens
		 */
		function getTextBetween(node1, node2) {
			const allTokens = [node1]
				.concat(sourceCode.getTokensBetween(node1, node2))
				.concat(node2);
			const sourceText = sourceCode.getText();

			return allTokens
				.slice(0, -1)
				.reduce(
					(accumulator, token, index) =>
						accumulator +
						sourceText.slice(
							token.range[1],
							allTokens[index + 1].range[0],
						),
					"",
				);
		}

		/**
		 * Returns a template literal form of the given node.
		 * @param {ASTNode} currentNode A node that should be converted to a template literal
		 * @param {string} textBeforeNode Text that should appear before the node
		 * @param {string} textAfterNode Text that should appear after the node
		 * @returns {string} A string form of this node, represented as a template literal
		 */
		function getTemplateLiteral(
			currentNode,
			textBeforeNode,
			textAfterNode,
		) {
			if (
				currentNode.type === "Literal" &&
				typeof currentNode.value === "string"
			) {
				/*
				 * If the current node is a string literal, escape any instances of ${ or ` to prevent them from being interpreted
				 * as a template placeholder. However, if the code already contains a backslash before the ${ or `
				 * for some reason, don't add another backslash, because that would change the meaning of the code (it would cause
				 * an actual backslash character to appear before the dollar sign).
				 */
				return `\`${currentNode.raw
					.slice(1, -1)
					.replace(/(?<!\\)\\*(\$\{|`)/gu, matched => {
						if (matched.lastIndexOf("\\") % 2) {
							return `\\${matched}`;
						}
						return matched;

						// Unescape any quotes that appear in the original Literal that no longer need to be escaped.
					})
					.replace(
						new RegExp(`\\\\${currentNode.raw[0]}`, "gu"),
						currentNode.raw[0],
					)}\``;
			}

			if (currentNode.type === "TemplateLiteral") {
				return sourceCode.getText(currentNode);
			}

			if (isConcatenation(currentNode) && hasStringLiteral(currentNode)) {
				const plusSign = sourceCode.getFirstTokenBetween(
					currentNode.left,
					currentNode.right,
					token => token.value === "+",
				);
				const textBeforePlus = getTextBetween(
					currentNode.left,
					plusSign,
				);
				const textAfterPlus = getTextBetween(
					plusSign,
					currentNode.right,
				);
				const leftEndsWithCurly = endsWithTemplateCurly(
					currentNode.left,
				);
				const rightStartsWithCurly = startsWithTemplateCurly(
					currentNode.right,
				);

				if (leftEndsWithCurly) {
					// If the left side of the expression ends with a template curly, add the extra text to the end of the curly bracket.
					// `foo${bar}` /* comment */ + 'baz' --> `foo${bar /* comment */  }${baz}`
					return (
						getTemplateLiteral(
							currentNode.left,
							textBeforeNode,
							textBeforePlus + textAfterPlus,
						).slice(0, -1) +
						getTemplateLiteral(
							currentNode.right,
							null,
							textAfterNode,
						).slice(1)
					);
				}
				if (rightStartsWithCurly) {
					// Otherwise, if the right side of the expression starts with a template curly, add the text there.
					// 'foo' /* comment */ + `${bar}baz` --> `foo${ /* comment */  bar}baz`
					return (
						getTemplateLiteral(
							currentNode.left,
							textBeforeNode,
							null,
						).slice(0, -1) +
						getTemplateLiteral(
							currentNode.right,
							textBeforePlus + textAfterPlus,
							textAfterNode,
						).slice(1)
					);
				}

				/*
				 * Otherwise, these nodes should not be combined into a template curly, since there is nowhere to put
				 * the text between them.
				 */
				return `${getTemplateLiteral(currentNode.left, textBeforeNode, null)}${textBeforePlus}+${textAfterPlus}${getTemplateLiteral(currentNode.right, textAfterNode, null)}`;
			}

			return `\`\${${textBeforeNode || ""}${sourceCode.getText(currentNode)}${textAfterNode || ""}}\``;
		}

		/**
		 * Returns a fixer object that converts a non-string binary expression to a template literal
		 * @param {SourceCodeFixer} fixer The fixer object
		 * @param {ASTNode} node A node that should be converted to a template literal
		 * @returns {Object} A fix for this binary expression
		 */
		function fixNonStringBinaryExpression(fixer, node) {
			const topBinaryExpr = getTopConcatBinaryExpression(node.parent);

			if (hasOctalOrNonOctalDecimalEscapeSequence(topBinaryExpr)) {
				return null;
			}

			return fixer.replaceText(
				topBinaryExpr,
				getTemplateLiteral(topBinaryExpr, null, null),
			);
		}

		/**
		 * Reports if a given node is string concatenation with non string literals.
		 * @param {ASTNode} node A node to check.
		 * @returns {void}
		 */
		function checkForStringConcat(node) {
			if (
				!astUtils.isStringLiteral(node) ||
				!isConcatenation(node.parent)
			) {
				return;
			}

			const topBinaryExpr = getTopConcatBinaryExpression(node.parent);

			// Checks whether or not this node had been checked already.
			if (done[topBinaryExpr.range[0]]) {
				return;
			}
			done[topBinaryExpr.range[0]] = true;

			if (hasNonStringLiteral(topBinaryExpr)) {
				context.report({
					node: topBinaryExpr,
					messageId: "unexpectedStringConcatenation",
					fix: fixer => fixNonStringBinaryExpression(fixer, node),
				});
			}
		}

		return {
			Program() {
				done = Object.create(null);
			},

			Literal: checkForStringConcat,
			TemplateLiteral: checkForStringConcat,
		};
	},
};
 3
x
Q/**
 * @fileoverview Rule to preserve caught errors when re-throwing exceptions
 * @author Amnish Singh Arora
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @typedef {import("estree").Node} ASTNode */
/** @typedef {import("eslint").Rule.Fix} Fix */
/** @typedef {import("eslint").Rule.RuleFixer} RuleFixer */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/*
 * This is an indicator of an error cause node, that is too complicated to be detected and fixed.
 * Eg, when error options is an `Identifier` or a `SpreadElement`.
 */
const UNKNOWN_CAUSE = Symbol("unknown_cause");

const BUILT_IN_ERROR_TYPES = new Set([
	"Error",
	"EvalError",
	"RangeError",
	"ReferenceError",
	"SyntaxError",
	"TypeError",
	"URIError",
	"AggregateError",
]);

/**
 * Finds and returns information about the `cause` property of an error being thrown.
 * @param {ASTNode} throwStatement `ThrowStatement` to be checked.
 * @param {number} optionsIndex The index of the options argument in the error constructor.
 * @returns {{ value: ASTNode; multipleDefinitions: boolean; } | UNKNOWN_CAUSE | null}
 * Information about the `cause` of the error being thrown, such as the value node and
 * whether there are multiple definitions of `cause`. `null` if there is no `cause`.
 */
function getErrorCause(throwStatement, optionsIndex) {
	const throwExpression = throwStatement.argument;

	/*
	 * Make sure there is no `SpreadElement` at or before the `optionsIndex`
	 * as this messes up the effective order of arguments and makes it complicated
	 * to track where the actual error options need to be at
	 */
	const spreadExpressionIndex = throwExpression.arguments.findIndex(
		arg => arg.type === "SpreadElement",
	);
	if (spreadExpressionIndex >= 0 && spreadExpressionIndex <= optionsIndex) {
		return UNKNOWN_CAUSE;
	}

	const errorOptions = throwExpression.arguments[optionsIndex];

	if (errorOptions) {
		if (errorOptions.type === "ObjectExpression") {
			if (
				errorOptions.properties.some(
					prop => prop.type === "SpreadElement",
				)
			) {
				/*
				 * If there is a spread element as part of error options, it is too complicated
				 * to verify if the cause is used properly and auto-fix.
				 */
				return UNKNOWN_CAUSE;
			}

			const causeProperties = errorOptions.properties.filter(
				prop => astUtils.getStaticPropertyName(prop) === "cause",
			);

			const causeProperty = causeProperties.at(-1);
			return causeProperty
				? {
						value: causeProperty.value,
						multipleDefinitions: causeProperties.length > 1,
					}
				: null;
		}

		// Error options exist, but too complicated to be analyzed/fixed
		return UNKNOWN_CAUSE;
	}

	return null;
}

/**
 * Finds and returns the `CatchClause` node, that the `node` is part of.
 * @param {ASTNode} node The AST node to be evaluated.
 * @returns {ASTNode | null } The closest parent `CatchClause` node, `null` if the `node` is not in a catch block.
 */
function findParentCatch(node) {
	let currentNode = node;

	while (currentNode && currentNode.type !== "CatchClause") {
		if (
			[
				"FunctionDeclaration",
				"FunctionExpression",
				"ArrowFunctionExpression",
				"StaticBlock",
			].includes(currentNode.type)
		) {
			/*
			 * Make sure the ThrowStatement is not made inside a function definition or a static block inside a high level catch.
			 * In such cases, the caught error is not directly related to the Throw.
			 *
			 * For example,
			 * try {
			 * } catch (error) {
			 * 	foo = {
			 * 		bar() {
			 *	 	throw new Error();
			 * 	  }
			 * };
			 * }
			 */
			return null;
		}
		currentNode = currentNode.parent;
	}

	return currentNode;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				requireCatchParameter: false,
				errorClassNames: [],
			},
		],

		docs: {
			description:
				"Disallow losing originally caught error when re-throwing custom errors",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/preserve-caught-error", // URL to the documentation page for this rule
		},
		schema: [
			{
				type: "object",
				properties: {
					requireCatchParameter: {
						type: "boolean",
						description:
							"Requires the catch blocks to always have the caught error parameter so it is not discarded.",
					},
					errorClassNames: {
						type: "array",
						description:
							"Additional error class names to check for cause preservation.",
						items: {
							oneOf: [
								{
									type: "string",
								},
								{
									type: "object",
									required: ["name", "argumentPosition"],
									properties: {
										name: {
											type: "string",
										},
										argumentPosition: {
											type: "integer",
											minimum: 1,
										},
									},
									additionalProperties: false,
								},
							],
						},
						uniqueItems: true,
					},
				},
				additionalProperties: false,
			},
		],
		messages: {
			missingCause:
				"There is no `cause` attached to the symptom error being thrown.",
			incorrectCause:
				"The symptom error is being thrown with an incorrect `cause`.",
			includeCause:
				"Include the original caught error as the `cause` of the symptom error.",
			missingCatchErrorParam:
				"The caught error is not accessible because the catch clause lacks the error parameter. Start referencing the caught error using the catch parameter.",
			partiallyLostError:
				"Re-throws cannot preserve the caught error as a part of it is being lost due to destructuring.",
			caughtErrorShadowed:
				"The caught error is being attached as `cause`, but is shadowed by a closer scoped redeclaration.",
		},
		hasSuggestions: true,
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const [{ requireCatchParameter, errorClassNames }] = context.options;

		const errorClassNamesMap = new Map();
		for (const item of errorClassNames) {
			const name = typeof item === "string" ? item : item.name;
			const argumentPosition =
				typeof item === "string" ? 2 : item.argumentPosition;

			errorClassNamesMap.set(name, argumentPosition);
		}

		//----------------------------------------------------------------------
		// Helpers
		//----------------------------------------------------------------------

		/**
		 * Checks if the given callee refers to a built-in global Error constructor.
		 * @param {ASTNode} callee The callee node.
		 * @returns {boolean} `true` if the callee is a built-in global Error constructor.
		 */
		function isBuiltInGlobalError(callee) {
			return (
				callee.type === "Identifier" &&
				BUILT_IN_ERROR_TYPES.has(callee.name) &&
				sourceCode.isGlobalReference(callee)
			);
		}

		/**
		 * Checks if a `ThrowStatement` is constructing and throwing a new `Error` object.
		 *
		 * Covers all the error types on `globalThis` that support `cause` property:
		 * https://github.com/microsoft/TypeScript/blob/main/src/lib/es2022.error.d.ts
		 * @param {ASTNode} throwStatement The `ThrowStatement` that needs to be checked.
		 * @returns {boolean} `true` if a new "Error" is being thrown, else `false`.
		 */
		function isThrowingNewError(throwStatement) {
			if (!(
				throwStatement.argument.type === "NewExpression" ||
				throwStatement.argument.type === "CallExpression"
			)) {
				return false;
			}

			const callee = throwStatement.argument.callee;

			/*
			 * Make sure the thrown Error instance is one of the built-in global error types.
			 * Custom imports could shadow this, which would lead to false positives.
			 * e.g. import { Error } from "./my-custom-error.js";
			 *      throw Error("Failed to perform error prone operations");
			 */
			if (isBuiltInGlobalError(callee)) {
				return true;
			}

			const target =
				callee.type === "MemberExpression" && !callee.computed
					? callee.property
					: callee;

			return (
				target.type === "Identifier" &&
				errorClassNamesMap.has(target.name)
			);
		}

		/**
		 * Inserts `cause: <caughtErrorName>` into an inline options object expression.
		 * @param {RuleFixer} fixer The fixer object.
		 * @param {ASTNode} optionsNode The options object node.
		 * @param {string} caughtErrorName The name of the caught error (e.g., "err").
		 * @returns {Fix} The fix object.
		 */
		function insertCauseIntoOptions(fixer, optionsNode, caughtErrorName) {
			const properties = optionsNode.properties;

			if (properties.length === 0) {
				// Insert inside empty braces: `{}` → `{ cause: err }`
				return fixer.insertTextAfter(
					sourceCode.getFirstToken(optionsNode),
					`cause: ${caughtErrorName}`,
				);
			}

			const lastProp = properties.at(-1);
			return fixer.insertTextAfter(
				lastProp,
				`, cause: ${caughtErrorName}`,
			);
		}

		/**
		 * Finds the first token that isn't followed by a closing parenthesis in a specified range.
		 * This is the token after which new arguments should be inserted.
		 * @param {Token} firstToken The first token to start searching from.
		 * @param {Token} lastToken The last token to scan up to (inclusive).
		 * @returns {Token} The first token that isn't followed by a closing parenthesis, or `lastToken` if none is found.
		 */
		function findInsertionTokenAfterParens(firstToken, lastToken) {
			const lastIndex = lastToken.range[1];
			let token = firstToken;
			let nextToken = sourceCode.getTokenAfter(token);

			while (
				nextToken.range[1] <= lastIndex &&
				astUtils.isClosingParenToken(nextToken)
			) {
				token = nextToken;
				nextToken = sourceCode.getTokenAfter(token);
			}
			return token;
		}

		/**
		 * Adds arguments for a call/new expression with no arguments.
		 * Works for `new Error`, `new (Error)`, and forms that already include empty argument parentheses.
		 * @param {RuleFixer} fixer The fixer instance.
		 * @param {ASTNode & { callee: ASTNode }} throwExpression The thrown CallExpression or NewExpression node.
		 * @param {string} text The arguments to insert.
		 * @returns {Fix} The fixer operation.
		 */
		function addArgumentsToEmptyCall(fixer, throwExpression, text) {
			const callClosingParenToken =
				sourceCode.getLastToken(throwExpression);
			const lastCalleeToken = sourceCode.getLastToken(
				throwExpression.callee,
			);
			const parenToken = sourceCode.getFirstTokenBetween(
				lastCalleeToken,
				callClosingParenToken,
				astUtils.isOpeningParenToken,
			);

			if (parenToken) {
				return fixer.insertTextAfter(parenToken, text);
			}

			const insertionToken = findInsertionTokenAfterParens(
				lastCalleeToken,
				callClosingParenToken,
			);

			return fixer.insertTextAfter(insertionToken, `(${text})`);
		}

		/**
		 * Appends additional arguments after the last argument of a call/new expression,
		 * accounting for any wrapping parentheses around that argument.
		 * @param {RuleFixer} fixer The fixer instance.
		 * @param {ASTNode & { arguments: ASTNode[] }} throwExpression The thrown CallExpression or NewExpression node.
		 * @param {string} text The additional arguments to insert, including the leading comma.
		 * @returns {Fix} The fixer operation.
		 */
		function appendArguments(fixer, throwExpression, text) {
			const lastArgument = throwExpression.arguments.at(-1);
			const lastArgumentToken = sourceCode.getLastToken(lastArgument);
			const lastTokenBeforeArgListParen = sourceCode.getLastToken(
				throwExpression,
				{ skip: 1 },
			);
			const insertionToken = findInsertionTokenAfterParens(
				lastArgumentToken,
				lastTokenBeforeArgListParen,
			);

			return fixer.insertTextAfter(insertionToken, text);
		}

		//----------------------------------------------------------------------
		// Public
		//----------------------------------------------------------------------
		return {
			ThrowStatement(node) {
				// Check if the throw is inside a catch block
				const parentCatch = findParentCatch(node);
				const throwStatement = node;

				// Check if a new error is being thrown in a catch block
				if (parentCatch && isThrowingNewError(throwStatement)) {
					if (
						parentCatch.param &&
						parentCatch.param.type !== "Identifier"
					) {
						/*
						 * When a part of the caught error is being lost at the parameter level, commonly due to destructuring.
						 * e.g. catch({ message, ...rest })
						 */
						context.report({
							messageId: "partiallyLostError",
							node: parentCatch,
						});
						return;
					}

					const caughtError =
						parentCatch.param?.type === "Identifier"
							? parentCatch.param
							: null;

					// Check if there are throw statements and caught error is being ignored
					if (!caughtError) {
						if (requireCatchParameter) {
							context.report({
								node: throwStatement,
								messageId: "missingCatchErrorParam",
							});
							return;
						}
						return;
					}

					// Determine the options argument index
					const callee = throwStatement.argument.callee;
					const errorClassName =
						callee.type === "Identifier"
							? callee.name
							: callee.property.name;

					const builtInGlobalError = isBuiltInGlobalError(callee);

					let optionsIndex;
					if (builtInGlobalError) {
						optionsIndex =
							errorClassName === "AggregateError" ? 2 : 1;
					} else {
						const argumentPosition =
							errorClassNamesMap.get(errorClassName);
						optionsIndex = argumentPosition - 1;
					}

					// Check if there is a cause attached to the new error
					const errorCauseInfo = getErrorCause(
						throwStatement,
						optionsIndex,
					);

					if (errorCauseInfo === UNKNOWN_CAUSE) {
						// Error options exist, but too complicated to be analyzed/fixed
						return;
					}

					if (errorCauseInfo === null) {
						// If there is no `cause` attached to the error being thrown.
						context.report({
							messageId: "missingCause",
							node: throwStatement,
							suggest: [
								{
									messageId: "includeCause",
									fix(fixer) {
										const throwExpression =
											throwStatement.argument;
										const args = throwExpression.arguments;

										/**
										 * Inserts `cause` into the options argument if it is an `ObjectExpression`.
										 * @param {ASTNode} optionsArg The options argument node.
										 * @returns {Fix | null} The fix, or `null` if the argument is not an object.
										 */
										function fixExistingOptions(
											optionsArg,
										) {
											if (
												optionsArg.type ===
												"ObjectExpression"
											) {
												return insertCauseIntoOptions(
													fixer,
													optionsArg,
													caughtError.name,
												);
											}
											return null;
										}

										// AggregateError: errors, message, options
										if (
											builtInGlobalError &&
											errorClassName === "AggregateError"
										) {
											const errorsArg = args[0];
											const messageArg = args[1];
											const optionsArg = args[2];

											if (!errorsArg) {
												// Case: `throw new AggregateError()` → insert all arguments
												return addArgumentsToEmptyCall(
													fixer,
													throwExpression,
													`[], "", { cause: ${caughtError.name} }`,
												);
											}

											if (!messageArg) {
												// Case: `throw new AggregateError([])` → insert message and options
												return appendArguments(
													fixer,
													throwExpression,
													`, "", { cause: ${caughtError.name} }`,
												);
											}

											if (!optionsArg) {
												// Case: `throw new AggregateError([], "")` → insert error options only
												return appendArguments(
													fixer,
													throwExpression,
													`, { cause: ${caughtError.name} }`,
												);
											}

											return fixExistingOptions(
												optionsArg,
											);
										}

										// Normal Error types
										if (builtInGlobalError) {
											const messageArg = args[0];
											const optionsArg = args[1];

											if (!messageArg) {
												// Case: `throw new Error()` → insert both message and options
												return addArgumentsToEmptyCall(
													fixer,
													throwExpression,
													`"", { cause: ${caughtError.name} }`,
												);
											}
											if (!optionsArg) {
												// Case: `throw new Error("Some message")` → insert only options
												return appendArguments(
													fixer,
													throwExpression,
													`, { cause: ${caughtError.name} }`,
												);
											}

											return fixExistingOptions(
												optionsArg,
											);
										}

										// Custom error types
										const optionsArg = args[optionsIndex];

										/*
										 * Custom error signature is unknown, so skip the suggestion rather
										 * than synthesize placeholder values for missing positional args.
										 */
										if (args.length < optionsIndex) {
											return null;
										}

										if (!optionsArg) {
											const lastProvidedArg = args.at(-1);

											if (lastProvidedArg) {
												// Options slot missing, all prior args provided → append options
												return appendArguments(
													fixer,
													throwExpression,
													`, { cause: ${caughtError.name} }`,
												);
											}

											// argumentPosition: 1 and no args → insert options inside parens
											return addArgumentsToEmptyCall(
												fixer,
												throwExpression,
												`{ cause: ${caughtError.name} }`,
											);
										}

										return fixExistingOptions(optionsArg);
									},
								},
							],
						});

						// We don't need to check further
						return;
					}

					const { value: thrownErrorCause } = errorCauseInfo;

					// If there is an attached cause, verify that it matches the caught error
					if (!(
						thrownErrorCause.type === "Identifier" &&
						thrownErrorCause.name === caughtError.name
					)) {
						const suggest = errorCauseInfo.multipleDefinitions
							? null // If there are multiple `cause` definitions, a suggestion could be confusing.
							: [
									{
										messageId: "includeCause",
										fix(fixer) {
											/*
											 * In case `cause` is attached using object property shorthand or as a method or accessor.
											 * e.g. throw Error("fail", { cause });
											 *      throw Error("fail", { cause() { doSomething(); } });
											 *      throw Error("fail", { get cause() { return error; } });
											 */
											if (
												thrownErrorCause.parent
													.method ||
												thrownErrorCause.parent
													.shorthand ||
												thrownErrorCause.parent.kind !==
													"init"
											) {
												return fixer.replaceText(
													thrownErrorCause.parent,
													`cause: ${caughtError.name}`,
												);
											}

											return fixer.replaceText(
												thrownErrorCause,
												caughtError.name,
											);
										},
									},
								];
						context.report({
							messageId: "incorrectCause",
							node: thrownErrorCause,
							suggest,
						});
						return;
					}

					/*
					 * If the attached cause matches the identifier name of the caught error,
					 * make sure it is not being shadowed by a closer scoped redeclaration.
					 *
					 * e.g. try {
					 *      doSomething();
					 * 	  } catch (error) {
					 * 	     if (whatever) {
					 * 	       const error = anotherError;
					 * 	       throw new Error("Something went wrong");
					 * 	     }
					 *   }
					 */
					let scope = sourceCode.getScope(throwStatement);
					do {
						const variable = scope.set.get(caughtError.name);
						if (variable) {
							break;
						}
						scope = scope.upper;
					} while (scope);

					if (scope?.block !== parentCatch) {
						// Caught error is being shadowed
						context.report({
							messageId: "caughtErrorShadowed",
							node: throwStatement,
						});
					}
				}
			},
		};
	},
};
D|x'n/**
 * @fileoverview Rule to flag non-quoted property names in object literals.
 * @author Mathias Bynens <http://mathiasbynens.be/>
 * @deprecated in ESLint v8.53.0
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const espree = require("espree");
const astUtils = require("./utils/ast-utils");
const keywords = require("./utils/keywords");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "quote-props",
						url: "https://eslint.style/rules/quote-props",
					},
				},
			],
		},
		type: "suggestion",

		docs: {
			description: "Require quotes around object literal property names",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/quote-props",
		},

		schema: {
			anyOf: [
				{
					type: "array",
					items: [
						{
							enum: [
								"always",
								"as-needed",
								"consistent",
								"consistent-as-needed",
							],
						},
					],
					minItems: 0,
					maxItems: 1,
				},
				{
					type: "array",
					items: [
						{
							enum: [
								"always",
								"as-needed",
								"consistent",
								"consistent-as-needed",
							],
						},
						{
							type: "object",
							properties: {
								keywords: {
									type: "boolean",
								},
								unnecessary: {
									type: "boolean",
								},
								numbers: {
									type: "boolean",
								},
							},
							additionalProperties: false,
						},
					],
					minItems: 0,
					maxItems: 2,
				},
			],
		},

		fixable: "code",
		messages: {
			requireQuotesDueToReservedWord:
				"Properties should be quoted as '{{property}}' is a reserved word.",
			inconsistentlyQuotedProperty:
				"Inconsistently quoted property '{{key}}' found.",
			unnecessarilyQuotedProperty:
				"Unnecessarily quoted property '{{property}}' found.",
			unquotedReservedProperty:
				"Unquoted reserved word '{{property}}' used as key.",
			unquotedNumericProperty:
				"Unquoted number literal '{{property}}' used as key.",
			unquotedPropertyFound: "Unquoted property '{{property}}' found.",
			redundantQuoting:
				"Properties shouldn't be quoted as all quotes are redundant.",
		},
	},

	create(context) {
		const MODE = context.options[0],
			KEYWORDS = context.options[1] && context.options[1].keywords,
			CHECK_UNNECESSARY =
				!context.options[1] || context.options[1].unnecessary !== false,
			NUMBERS = context.options[1] && context.options[1].numbers,
			sourceCode = context.sourceCode;

		/**
		 * Checks whether a certain string constitutes an ES3 token
		 * @param {string} tokenStr The string to be checked.
		 * @returns {boolean} `true` if it is an ES3 token.
		 */
		function isKeyword(tokenStr) {
			return keywords.includes(tokenStr);
		}

		/**
		 * Checks if an espree-tokenized key has redundant quotes (i.e. whether quotes are unnecessary)
		 * @param {string} rawKey The raw key value from the source
		 * @param {espreeTokens} tokens The espree-tokenized node key
		 * @param {boolean} [skipNumberLiterals=false] Indicates whether number literals should be checked
		 * @returns {boolean} Whether or not a key has redundant quotes.
		 * @private
		 */
		function areQuotesRedundant(rawKey, tokens, skipNumberLiterals) {
			return (
				tokens.length === 1 &&
				tokens[0].start === 0 &&
				tokens[0].end === rawKey.length &&
				(["Identifier", "Keyword", "Null", "Boolean"].includes(
					tokens[0].type,
				) ||
					(tokens[0].type === "Numeric" &&
						!skipNumberLiterals &&
						String(+tokens[0].value) === tokens[0].value))
			);
		}

		/**
		 * Returns a string representation of a property node with quotes removed
		 * @param {ASTNode} key Key AST Node, which may or may not be quoted
		 * @returns {string} A replacement string for this property
		 */
		function getUnquotedKey(key) {
			return key.type === "Identifier" ? key.name : key.value;
		}

		/**
		 * Returns a string representation of a property node with quotes added
		 * @param {ASTNode} key Key AST Node, which may or may not be quoted
		 * @returns {string} A replacement string for this property
		 */
		function getQuotedKey(key) {
			if (key.type === "Literal" && typeof key.value === "string") {
				// If the key is already a string literal, don't replace the quotes with double quotes.
				return sourceCode.getText(key);
			}

			// Otherwise, the key is either an identifier or a number literal.
			return `"${key.type === "Identifier" ? key.name : key.value}"`;
		}

		/**
		 * Ensures that a property's key is quoted only when necessary
		 * @param {ASTNode} node Property AST node
		 * @returns {void}
		 */
		function checkUnnecessaryQuotes(node) {
			const key = node.key;

			if (node.method || node.computed || node.shorthand) {
				return;
			}

			if (key.type === "Literal" && typeof key.value === "string") {
				let tokens;

				try {
					tokens = espree.tokenize(key.value);
				} catch {
					return;
				}

				if (tokens.length !== 1) {
					return;
				}

				const isKeywordToken = isKeyword(tokens[0].value);

				if (isKeywordToken && KEYWORDS) {
					return;
				}

				if (
					CHECK_UNNECESSARY &&
					areQuotesRedundant(key.value, tokens, NUMBERS)
				) {
					context.report({
						node,
						messageId: "unnecessarilyQuotedProperty",
						data: { property: key.value },
						fix: fixer =>
							fixer.replaceText(key, getUnquotedKey(key)),
					});
				}
			} else if (
				KEYWORDS &&
				key.type === "Identifier" &&
				isKeyword(key.name)
			) {
				context.report({
					node,
					messageId: "unquotedReservedProperty",
					data: { property: key.name },
					fix: fixer => fixer.replaceText(key, getQuotedKey(key)),
				});
			} else if (
				NUMBERS &&
				key.type === "Literal" &&
				astUtils.isNumericLiteral(key)
			) {
				context.report({
					node,
					messageId: "unquotedNumericProperty",
					data: { property: key.value },
					fix: fixer => fixer.replaceText(key, getQuotedKey(key)),
				});
			}
		}

		/**
		 * Ensures that a property's key is quoted
		 * @param {ASTNode} node Property AST node
		 * @returns {void}
		 */
		function checkOmittedQuotes(node) {
			const key = node.key;

			if (
				!node.method &&
				!node.computed &&
				!node.shorthand &&
				!(key.type === "Literal" && typeof key.value === "string")
			) {
				context.report({
					node,
					messageId: "unquotedPropertyFound",
					data: { property: key.name || key.value },
					fix: fixer => fixer.replaceText(key, getQuotedKey(key)),
				});
			}
		}

		/**
		 * Ensures that an object's keys are consistently quoted, optionally checks for redundancy of quotes
		 * @param {ASTNode} node Property AST node
		 * @param {boolean} checkQuotesRedundancy Whether to check quotes' redundancy
		 * @returns {void}
		 */
		function checkConsistency(node, checkQuotesRedundancy) {
			const quotedProps = [],
				unquotedProps = [];
			let keywordKeyName = null,
				necessaryQuotes = false;

			node.properties.forEach(property => {
				const key = property.key;

				if (
					!key ||
					property.method ||
					property.computed ||
					property.shorthand
				) {
					return;
				}

				if (key.type === "Literal" && typeof key.value === "string") {
					quotedProps.push(property);

					if (checkQuotesRedundancy) {
						let tokens;

						try {
							tokens = espree.tokenize(key.value);
						} catch {
							necessaryQuotes = true;
							return;
						}

						necessaryQuotes =
							necessaryQuotes ||
							!areQuotesRedundant(key.value, tokens) ||
							(KEYWORDS && isKeyword(tokens[0].value));
					}
				} else if (
					KEYWORDS &&
					checkQuotesRedundancy &&
					key.type === "Identifier" &&
					isKeyword(key.name)
				) {
					unquotedProps.push(property);
					necessaryQuotes = true;
					keywordKeyName = key.name;
				} else {
					unquotedProps.push(property);
				}
			});

			if (
				checkQuotesRedundancy &&
				quotedProps.length &&
				!necessaryQuotes
			) {
				quotedProps.forEach(property => {
					context.report({
						node: property,
						messageId: "redundantQuoting",
						fix: fixer =>
							fixer.replaceText(
								property.key,
								getUnquotedKey(property.key),
							),
					});
				});
			} else if (unquotedProps.length && keywordKeyName) {
				unquotedProps.forEach(property => {
					context.report({
						node: property,
						messageId: "requireQuotesDueToReservedWord",
						data: { property: keywordKeyName },
						fix: fixer =>
							fixer.replaceText(
								property.key,
								getQuotedKey(property.key),
							),
					});
				});
			} else if (quotedProps.length && unquotedProps.length) {
				unquotedProps.forEach(property => {
					context.report({
						node: property,
						messageId: "inconsistentlyQuotedProperty",
						data: { key: property.key.name || property.key.value },
						fix: fixer =>
							fixer.replaceText(
								property.key,
								getQuotedKey(property.key),
							),
					});
				});
			}
		}

		return {
			Property(node) {
				if (MODE === "always" || !MODE) {
					checkOmittedQuotes(node);
				}
				if (MODE === "as-needed") {
					checkUnnecessaryQuotes(node);
				}
			},
			ObjectExpression(node) {
				if (MODE === "consistent") {
					checkConsistency(node, false);
				}
				if (MODE === "consistent-as-needed") {
					checkConsistency(node, true);
				}
			},
		};
	},
};
ѠZx%/**
 * @fileoverview Rule to flag use of parseInt without a radix argument
 * @author James Allardice
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @typedef {import("eslint-scope").Variable} Variable */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const validRadixValues = new Set(
	Array.from({ length: 37 - 2 }, (_, index) => index + 2),
);

/**
 * Checks whether a given variable is shadowed or not.
 * @param {Variable} variable A variable to check.
 * @returns {boolean} `true` if the variable is shadowed.
 */
function isShadowed(variable) {
	return variable.defs.length >= 1;
}

/**
 * Checks whether a given node is a valid value of radix or not.
 *
 * The following values are invalid.
 *
 * - A literal except integers between 2 and 36.
 * - undefined.
 * @param {ASTNode} radix A node of radix to check.
 * @param {SourceCode} sourceCode The source code object.
 * @returns {boolean} `true` if the node is valid.
 */
function isValidRadix(radix, sourceCode) {
	if (
		radix.type === "UnaryExpression" &&
		(radix.operator === "-" || radix.operator === "+") &&
		radix.argument.type === "Literal" &&
		typeof radix.argument.value === "number"
	) {
		const value =
			radix.operator === "-"
				? -radix.argument.value
				: radix.argument.value;

		return validRadixValues.has(value);
	}

	return !(
		(radix.type === "Literal" && !validRadixValues.has(radix.value)) ||
		(radix.type === "Identifier" &&
			radix.name === "undefined" &&
			sourceCode.isGlobalReference(radix))
	);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Enforce the use of the radix argument when using `parseInt()`",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/radix",
		},

		hasSuggestions: true,

		schema: [
			// deprecated
			{
				enum: ["always", "as-needed"],
			},
		],

		messages: {
			missingParameters: "Missing parameters.",
			missingRadix: "Missing radix parameter.",
			invalidRadix:
				"Invalid radix parameter, must be an integer between 2 and 36.",
			addRadixParameter10:
				"Add radix parameter `10` for parsing decimal numbers.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		/**
		 * Checks the arguments of a given CallExpression node and reports it if it
		 * offends this rule.
		 * @param {ASTNode} node A CallExpression node to check.
		 * @returns {void}
		 */
		function checkArguments(node) {
			const args = node.arguments;
			const spreadIndex = args.findIndex(
				arg => arg.type === "SpreadElement",
			);

			if (spreadIndex !== -1 && spreadIndex < 2) {
				return;
			}

			if (args.length === 0) {
				context.report({
					node,
					messageId: "missingParameters",
				});
			} else if (args.length === 1) {
				context.report({
					node,
					messageId: "missingRadix",
					suggest: [
						{
							messageId: "addRadixParameter10",
							fix(fixer) {
								const lastToken = sourceCode.getLastToken(node);
								const prevToken =
									sourceCode.getTokenBefore(lastToken);

								const hasTrailingComma =
									astUtils.isCommaToken(prevToken);

								return fixer.insertTextBefore(
									lastToken,
									hasTrailingComma ? " 10," : ", 10",
								);
							},
						},
					],
				});
			} else if (!isValidRadix(args[1], sourceCode)) {
				context.report({
					node,
					messageId: "invalidRadix",
				});
			}
		}

		return {
			"Program:exit"(node) {
				const scope = sourceCode.getScope(node);
				let variable;

				// Check `parseInt()`
				variable = astUtils.getVariableByName(scope, "parseInt");
				if (variable && !isShadowed(variable)) {
					variable.references.forEach(reference => {
						const idNode = reference.identifier;

						if (astUtils.isCallee(idNode)) {
							checkArguments(idNode.parent);
						}
					});
				}

				// Check `Number.parseInt()`
				variable = astUtils.getVariableByName(scope, "Number");
				if (variable && !isShadowed(variable)) {
					variable.references.forEach(reference => {
						const parentNode = reference.identifier.parent;
						const maybeCallee =
							parentNode.parent.type === "ChainExpression"
								? parentNode.parent
								: parentNode;

						if (
							astUtils.isSpecificMemberAccess(
								parentNode,
								"Number",
								"parseInt",
							) &&
							astUtils.isCallee(maybeCallee)
						) {
							checkArguments(maybeCallee.parent);
						}
					});
				}
			},
		};
	},
};
cxM$/**
 * @fileoverview disallow assignments that can lead to race conditions due to usage of `await` or `yield`
 * @author Teddy Katz
 * @author Toru Nagashima
 */
"use strict";

/**
 * Make the map from identifiers to each reference.
 * @param {escope.Scope} scope The scope to get references.
 * @param {Map<Identifier, escope.Reference>} [outReferenceMap] The map from identifier nodes to each reference object.
 * @returns {Map<Identifier, escope.Reference>} `referenceMap`.
 */
function createReferenceMap(scope, outReferenceMap = new Map()) {
	for (const reference of scope.references) {
		if (reference.resolved === null) {
			continue;
		}

		outReferenceMap.set(reference.identifier, reference);
	}
	for (const childScope of scope.childScopes) {
		if (childScope.type !== "function") {
			createReferenceMap(childScope, outReferenceMap);
		}
	}

	return outReferenceMap;
}

/**
 * Get `reference.writeExpr` of a given reference.
 * If it's the read reference of MemberExpression in LHS, returns RHS in order to address `a.b = await a`
 * @param {escope.Reference} reference The reference to get.
 * @returns {Expression|null} The `reference.writeExpr`.
 */
function getWriteExpr(reference) {
	if (reference.writeExpr) {
		return reference.writeExpr;
	}
	let node = reference.identifier;

	while (node) {
		const t = node.parent.type;

		if (t === "AssignmentExpression" && node.parent.left === node) {
			return node.parent.right;
		}
		if (t === "MemberExpression" && node.parent.object === node) {
			node = node.parent;
			continue;
		}

		break;
	}

	return null;
}

/**
 * Checks if an expression is a variable that can only be observed within the given function.
 * @param {Variable|null} variable The variable to check
 * @param {boolean} isMemberAccess If `true` then this is a member access.
 * @returns {boolean} `true` if the variable is local to the given function, and is never referenced in a closure.
 */
function isLocalVariableWithoutEscape(variable, isMemberAccess) {
	if (!variable) {
		return false; // A global variable which was not defined.
	}

	// If the reference is a property access and the variable is a parameter, it handles the variable is not local.
	if (isMemberAccess && variable.defs.some(d => d.type === "Parameter")) {
		return false;
	}

	const functionScope = variable.scope.variableScope;

	return variable.references.every(
		reference => reference.from.variableScope === functionScope,
	);
}

/**
 * Represents segment information.
 */
class SegmentInfo {
	constructor() {
		this.info = new WeakMap();
	}

	/**
	 * Initialize the segment information.
	 * @param {PathSegment} segment The segment to initialize.
	 * @returns {void}
	 */
	initialize(segment) {
		const outdatedReadVariables = new Set();
		const freshReadVariables = new Set();

		for (const prevSegment of segment.prevSegments) {
			const info = this.info.get(prevSegment);

			if (info) {
				info.outdatedReadVariables.forEach(
					Set.prototype.add,
					outdatedReadVariables,
				);
				info.freshReadVariables.forEach(
					Set.prototype.add,
					freshReadVariables,
				);
			}
		}

		this.info.set(segment, { outdatedReadVariables, freshReadVariables });
	}

	/**
	 * Mark a given variable as read on given segments.
	 * @param {PathSegment[]} segments The segments that it read the variable on.
	 * @param {Variable} variable The variable to be read.
	 * @returns {void}
	 */
	markAsRead(segments, variable) {
		for (const segment of segments) {
			const info = this.info.get(segment);

			if (info) {
				info.freshReadVariables.add(variable);

				// If a variable is freshly read again, then it's no more out-dated.
				info.outdatedReadVariables.delete(variable);
			}
		}
	}

	/**
	 * Move `freshReadVariables` to `outdatedReadVariables`.
	 * @param {PathSegment[]} segments The segments to process.
	 * @returns {void}
	 */
	makeOutdated(segments) {
		for (const segment of segments) {
			const info = this.info.get(segment);

			if (info) {
				info.freshReadVariables.forEach(
					Set.prototype.add,
					info.outdatedReadVariables,
				);
				info.freshReadVariables.clear();
			}
		}
	}

	/**
	 * Check if a given variable is outdated on the current segments.
	 * @param {PathSegment[]} segments The current segments.
	 * @param {Variable} variable The variable to check.
	 * @returns {boolean} `true` if the variable is outdated on the segments.
	 */
	isOutdated(segments, variable) {
		for (const segment of segments) {
			const info = this.info.get(segment);

			if (info && info.outdatedReadVariables.has(variable)) {
				return true;
			}
		}
		return false;
	}
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		defaultOptions: [
			{
				allowProperties: false,
			},
		],

		docs: {
			description:
				"Disallow assignments that can lead to race conditions due to usage of `await` or `yield`",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/require-atomic-updates",
		},

		fixable: null,

		schema: [
			{
				type: "object",
				properties: {
					allowProperties: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			nonAtomicUpdate:
				"Possible race condition: `{{value}}` might be reassigned based on an outdated value of `{{value}}`.",
			nonAtomicObjectUpdate:
				"Possible race condition: `{{value}}` might be assigned based on an outdated state of `{{object}}`.",
		},
	},

	create(context) {
		const [{ allowProperties }] = context.options;

		const sourceCode = context.sourceCode;
		const assignmentReferences = new Map();
		const segmentInfo = new SegmentInfo();
		let stack = null;

		return {
			onCodePathStart(codePath, node) {
				const scope = sourceCode.getScope(node);
				const shouldVerify =
					scope.type === "function" &&
					(scope.block.async || scope.block.generator);

				stack = {
					upper: stack,
					codePath,
					referenceMap: shouldVerify
						? createReferenceMap(scope)
						: null,
					currentSegments: new Set(),
				};
			},
			onCodePathEnd() {
				stack = stack.upper;
			},

			// Initialize the segment information.
			onCodePathSegmentStart(segment) {
				segmentInfo.initialize(segment);
				stack.currentSegments.add(segment);
			},

			onUnreachableCodePathSegmentStart(segment) {
				stack.currentSegments.add(segment);
			},

			onUnreachableCodePathSegmentEnd(segment) {
				stack.currentSegments.delete(segment);
			},

			onCodePathSegmentEnd(segment) {
				stack.currentSegments.delete(segment);
			},

			// Handle references to prepare verification.
			Identifier(node) {
				const { referenceMap } = stack;
				const reference = referenceMap && referenceMap.get(node);

				// Ignore if this is not a valid variable reference.
				if (!reference) {
					return;
				}
				const variable = reference.resolved;
				const writeExpr = getWriteExpr(reference);
				const isMemberAccess =
					reference.identifier.parent.type === "MemberExpression";

				// Add a fresh read variable.
				if (
					reference.isRead() &&
					!(writeExpr && writeExpr.parent.operator === "=")
				) {
					segmentInfo.markAsRead(stack.currentSegments, variable);
				}

				/*
				 * Register the variable to verify after ESLint traversed the `writeExpr` node
				 * if this reference is an assignment to a variable which is referred from other closure.
				 */
				if (
					writeExpr &&
					writeExpr.parent.right === writeExpr && // ← exclude variable declarations.
					!isLocalVariableWithoutEscape(variable, isMemberAccess)
				) {
					let refs = assignmentReferences.get(writeExpr);

					if (!refs) {
						refs = [];
						assignmentReferences.set(writeExpr, refs);
					}

					refs.push(reference);
				}
			},

			/*
			 * Verify assignments.
			 * If the reference exists in `outdatedReadVariables` list, report it.
			 */
			":expression:exit"(node) {
				// referenceMap exists if this is in a resumable function scope.
				if (!stack.referenceMap) {
					return;
				}

				// Mark the read variables on this code path as outdated.
				if (
					node.type === "AwaitExpression" ||
					node.type === "YieldExpression"
				) {
					segmentInfo.makeOutdated(stack.currentSegments);
				}

				// Verify.
				const references = assignmentReferences.get(node);

				if (references) {
					assignmentReferences.delete(node);

					for (const reference of references) {
						const variable = reference.resolved;

						if (
							segmentInfo.isOutdated(
								stack.currentSegments,
								variable,
							)
						) {
							if (node.parent.left === reference.identifier) {
								context.report({
									node: node.parent,
									messageId: "nonAtomicUpdate",
									data: {
										value: variable.name,
									},
								});
							} else if (!allowProperties) {
								context.report({
									node: node.parent,
									messageId: "nonAtomicObjectUpdate",
									data: {
										value: sourceCode.getText(
											node.parent.left,
										),
										object: variable.name,
									},
								});
							}
						}
					}
				}
			},
		};
	},
};
 [x
/**
 * @fileoverview Rule to disallow async functions which have no `await` expression.
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Capitalize the 1st letter of the given text.
 * @param {string} text The text to capitalize.
 * @returns {string} The text that the 1st letter was capitalized.
 */
function capitalizeFirstLetter(text) {
	return text[0].toUpperCase() + text.slice(1);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Disallow async functions which have no `await` expression",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/require-await",
		},

		schema: [],

		messages: {
			missingAwait: "{{name}} has no 'await' expression.",
			removeAsync: "Remove 'async'.",
		},

		hasSuggestions: true,
	},

	create(context) {
		const sourceCode = context.sourceCode;
		let scopeInfo = null;

		/**
		 * Push the scope info object to the stack.
		 * @returns {void}
		 */
		function enterFunction() {
			scopeInfo = {
				upper: scopeInfo,
				hasAwait: false,
			};
		}

		/**
		 * Pop the top scope info object from the stack.
		 * Also, it reports the function if needed.
		 * @param {ASTNode} node The node to report.
		 * @returns {void}
		 */
		function exitFunction(node) {
			if (
				!node.generator &&
				node.async &&
				!scopeInfo.hasAwait &&
				!astUtils.isEmptyFunction(node)
			) {
				/*
				 * If the function belongs to a method definition or
				 * property, then the function's range may not include the
				 * `async` keyword and we should look at the parent instead.
				 */
				const nodeWithAsyncKeyword =
					(node.parent.type === "MethodDefinition" &&
						node.parent.value === node) ||
					(node.parent.type === "Property" &&
						node.parent.method &&
						node.parent.value === node)
						? node.parent
						: node;

				const asyncToken = sourceCode.getFirstToken(
					nodeWithAsyncKeyword,
					token => token.value === "async",
				);
				const asyncRange = [
					asyncToken.range[0],
					sourceCode.getTokenAfter(asyncToken, {
						includeComments: true,
					}).range[0],
				];

				/*
				 * Removing the `async` keyword can cause parsing errors if the current
				 * statement is relying on automatic semicolon insertion. If ASI is currently
				 * being used, then we should replace the `async` keyword with a semicolon.
				 */
				const nextToken = sourceCode.getTokenAfter(asyncToken);
				const addSemiColon =
					((astUtils.isOpeningParenToken(nextToken) &&
						astUtils.isStartOfExpressionStatement(
							nodeWithAsyncKeyword,
						)) ||
						(nodeWithAsyncKeyword.type === "MethodDefinition" &&
							astUtils.canContinueExpressionInClassBody(
								nextToken,
							))) &&
					astUtils.needsPrecedingSemicolon(
						sourceCode,
						nodeWithAsyncKeyword,
					);

				context.report({
					node,
					loc: astUtils.getFunctionHeadLoc(node, sourceCode),
					messageId: "missingAwait",
					data: {
						name: capitalizeFirstLetter(
							astUtils.getFunctionNameWithKind(node),
						),
					},
					suggest: [
						{
							messageId: "removeAsync",
							fix: fixer =>
								fixer.replaceTextRange(
									asyncRange,
									addSemiColon ? ";" : "",
								),
						},
					],
				});
			}

			scopeInfo = scopeInfo.upper;
		}

		return {
			FunctionDeclaration: enterFunction,
			FunctionExpression: enterFunction,
			ArrowFunctionExpression: enterFunction,
			"FunctionDeclaration:exit": exitFunction,
			"FunctionExpression:exit": exitFunction,
			"ArrowFunctionExpression:exit": exitFunction,

			AwaitExpression() {
				if (!scopeInfo) {
					return;
				}

				scopeInfo.hasAwait = true;
			},
			ForOfStatement(node) {
				if (!scopeInfo) {
					return;
				}

				if (node.await) {
					scopeInfo.hasAwait = true;
				}
			},
			VariableDeclaration(node) {
				if (!scopeInfo) {
					return;
				}

				if (node.kind === "await using") {
					scopeInfo.hasAwait = true;
				}
			},
		};
	},
};
0xU/**
 * @fileoverview Rule to enforce the use of `u` or `v` flag on regular expressions.
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const {
	CALL,
	CONSTRUCT,
	ReferenceTracker,
	getStringIfConstant,
} = require("@eslint-community/eslint-utils");
const astUtils = require("./utils/ast-utils.js");
const { isValidWithUnicodeFlag } = require("./utils/regular-expressions");

/**
 * Checks whether the flag configuration should be treated as a missing flag.
 * @param {"u"|"v"|undefined} requireFlag A particular flag to require
 * @param {string} flags The regex flags
 * @returns {boolean} Whether the flag configuration results in a missing flag.
 */
function checkFlags(requireFlag, flags) {
	let missingFlag;

	if (requireFlag === "v") {
		missingFlag = !flags.includes("v");
	} else if (requireFlag === "u") {
		missingFlag = !flags.includes("u");
	} else {
		missingFlag = !flags.includes("u") && !flags.includes("v");
	}

	return missingFlag;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [{}],

		docs: {
			description:
				"Enforce the use of `u` or `v` flag on regular expressions",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/require-unicode-regexp",
		},

		hasSuggestions: true,

		messages: {
			addUFlag: "Add the 'u' flag.",
			addVFlag: "Add the 'v' flag.",
			requireUFlag: "Use the 'u' flag.",
			requireVFlag: "Use the 'v' flag.",
		},

		schema: [
			{
				type: "object",
				properties: {
					requireFlag: {
						enum: ["u", "v"],
					},
				},
				additionalProperties: false,
			},
		],
	},

	create(context) {
		const sourceCode = context.sourceCode;

		const [{ requireFlag }] = context.options;

		return {
			"Literal[regex]"(node) {
				const flags = node.regex.flags || "";

				const missingFlag = checkFlags(requireFlag, flags);

				if (missingFlag) {
					context.report({
						messageId:
							requireFlag === "v"
								? "requireVFlag"
								: "requireUFlag",
						node,
						suggest: isValidWithUnicodeFlag(
							context.languageOptions.ecmaVersion,
							node.regex.pattern,
							requireFlag,
						)
							? [
									{
										fix(fixer) {
											const replaceFlag =
												requireFlag ?? "u";
											const regex =
												sourceCode.getText(node);
											const slashPos =
												regex.lastIndexOf("/");

											if (requireFlag) {
												const flag =
													requireFlag === "u"
														? "v"
														: "u";

												if (
													regex.includes(
														flag,
														slashPos,
													)
												) {
													return fixer.replaceText(
														node,
														regex.slice(
															0,
															slashPos,
														) +
															regex
																.slice(slashPos)
																.replace(
																	flag,
																	requireFlag,
																),
													);
												}
											}

											return fixer.insertTextAfter(
												node,
												replaceFlag,
											);
										},
										messageId:
											requireFlag === "v"
												? "addVFlag"
												: "addUFlag",
									},
								]
							: null,
					});
				}
			},

			Program(node) {
				const scope = sourceCode.getScope(node);
				const tracker = new ReferenceTracker(scope);
				const trackMap = {
					RegExp: { [CALL]: true, [CONSTRUCT]: true },
				};

				for (const { node: refNode } of tracker.iterateGlobalReferences(
					trackMap,
				)) {
					const [patternNode, flagsNode] = refNode.arguments;

					if (patternNode && patternNode.type === "SpreadElement") {
						continue;
					}
					const pattern = getStringIfConstant(patternNode, scope);
					const flags = getStringIfConstant(flagsNode, scope);

					let missingFlag = !flagsNode;

					if (typeof flags === "string") {
						missingFlag = checkFlags(requireFlag, flags);
					}

					if (missingFlag) {
						context.report({
							messageId:
								requireFlag === "v"
									? "requireVFlag"
									: "requireUFlag",
							node: refNode,
							suggest:
								typeof pattern === "string" &&
								isValidWithUnicodeFlag(
									context.languageOptions.ecmaVersion,
									pattern,
									requireFlag,
								)
									? [
											{
												fix(fixer) {
													const replaceFlag =
														requireFlag ?? "u";

													if (flagsNode) {
														if (
															(flagsNode.type ===
																"Literal" &&
																typeof flagsNode.value ===
																	"string") ||
															flagsNode.type ===
																"TemplateLiteral"
														) {
															const flagsNodeText =
																sourceCode.getText(
																	flagsNode,
																);
															const flag =
																requireFlag ===
																"u"
																	? "v"
																	: "u";

															if (
																flags.includes(
																	flag,
																)
															) {
																// Avoid replacing "u" in escapes like `\uXXXX`
																if (
																	flagsNode.type ===
																		"Literal" &&
																	flagsNode.raw.includes(
																		"\\",
																	)
																) {
																	return null;
																}

																// Avoid replacing "u" in expressions like "`${regularFlags}g`"
																if (
																	flagsNode.type ===
																		"TemplateLiteral" &&
																	(flagsNode
																		.expressions
																		.length ||
																		flagsNode.quasis.some(
																			({
																				value: {
																					raw,
																				},
																			}) =>
																				raw.includes(
																					"\\",
																				),
																		))
																) {
																	return null;
																}

																return fixer.replaceText(
																	flagsNode,
																	flagsNodeText.replace(
																		flag,
																		replaceFlag,
																	),
																);
															}

															return fixer.replaceText(
																flagsNode,
																[
																	flagsNodeText.slice(
																		0,
																		flagsNodeText.length -
																			1,
																	),
																	flagsNodeText.slice(
																		flagsNodeText.length -
																			1,
																	),
																].join(
																	replaceFlag,
																),
															);
														}

														// We intentionally don't suggest concatenating + "u" to non-literals
														return null;
													}

													const penultimateToken =
														sourceCode.getLastToken(
															refNode,
															{ skip: 1 },
														); // skip closing parenthesis

													return fixer.insertTextAfter(
														penultimateToken,
														astUtils.isCommaToken(
															penultimateToken,
														)
															? ` "${replaceFlag}",`
															: `, "${replaceFlag}"`,
													);
												},
												messageId:
													requireFlag === "v"
														? "addVFlag"
														: "addUFlag",
											},
										]
									: null,
						});
					}
				}
			},
		};
	},
};
UJXx /**
 * @fileoverview Rule to flag the generator functions that does not have yield.
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Require generator functions to contain `yield`",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/require-yield",
		},

		schema: [],

		messages: {
			missingYield: "This generator function does not have 'yield'.",
		},
	},

	create(context) {
		const stack = [];
		const sourceCode = context.sourceCode;

		/**
		 * If the node is a generator function, start counting `yield` keywords.
		 * @param {Node} node A function node to check.
		 * @returns {void}
		 */
		function beginChecking(node) {
			if (node.generator) {
				stack.push(0);
			}
		}

		/**
		 * If the node is a generator function, end counting `yield` keywords, then
		 * reports result.
		 * @param {Node} node A function node to check.
		 * @returns {void}
		 */
		function endChecking(node) {
			if (!node.generator) {
				return;
			}

			const countYield = stack.pop();

			if (countYield === 0 && node.body.body.length > 0) {
				context.report({
					loc: astUtils.getFunctionHeadLoc(node, sourceCode),
					messageId: "missingYield",
				});
			}
		}

		return {
			FunctionDeclaration: beginChecking,
			"FunctionDeclaration:exit": endChecking,
			FunctionExpression: beginChecking,
			"FunctionExpression:exit": endChecking,

			// Increases the count of `yield` keyword.
			YieldExpression() {
				if (stack.length > 0) {
					stack[stack.length - 1] += 1;
				}
			},
		};
	},
};
U:x{/**
 * @fileoverview Enforce spacing between rest and spread operators and their expressions.
 * @author Kai Cataldo
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "rest-spread-spacing",
						url: "https://eslint.style/rules/rest-spread-spacing",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description:
				"Enforce spacing between rest and spread operators and their expressions",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/rest-spread-spacing",
		},

		fixable: "whitespace",

		schema: [
			{
				enum: ["always", "never"],
			},
		],

		messages: {
			unexpectedWhitespace:
				"Unexpected whitespace after {{type}} operator.",
			expectedWhitespace: "Expected whitespace after {{type}} operator.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode,
			alwaysSpace = context.options[0] === "always";

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Checks whitespace between rest/spread operators and their expressions
		 * @param {ASTNode} node The node to check
		 * @returns {void}
		 */
		function checkWhiteSpace(node) {
			const operator = sourceCode.getFirstToken(node),
				nextToken = sourceCode.getTokenAfter(operator),
				hasWhitespace = sourceCode.isSpaceBetween(operator, nextToken);
			let type;

			switch (node.type) {
				case "SpreadElement":
					type = "spread";
					if (node.parent.type === "ObjectExpression") {
						type += " property";
					}
					break;
				case "RestElement":
					type = "rest";
					if (node.parent.type === "ObjectPattern") {
						type += " property";
					}
					break;
				case "ExperimentalSpreadProperty":
					type = "spread property";
					break;
				case "ExperimentalRestProperty":
					type = "rest property";
					break;
				default:
					return;
			}

			if (alwaysSpace && !hasWhitespace) {
				context.report({
					node,
					loc: operator.loc,
					messageId: "expectedWhitespace",
					data: {
						type,
					},
					fix(fixer) {
						return fixer.replaceTextRange(
							[operator.range[1], nextToken.range[0]],
							" ",
						);
					},
				});
			} else if (!alwaysSpace && hasWhitespace) {
				context.report({
					node,
					loc: {
						start: operator.loc.end,
						end: nextToken.loc.start,
					},
					messageId: "unexpectedWhitespace",
					data: {
						type,
					},
					fix(fixer) {
						return fixer.removeRange([
							operator.range[1],
							nextToken.range[0],
						]);
					},
				});
			}
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			SpreadElement: checkWhiteSpace,
			RestElement: checkWhiteSpace,
			ExperimentalSpreadProperty: checkWhiteSpace,
			ExperimentalRestProperty: checkWhiteSpace,
		};
	},
};
w3x3/**
 * @fileoverview Validates spacing before and after semicolon
 * @author Mathias Schreck
 * @deprecated in ESLint v8.53.0
 */

"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "semi-spacing",
						url: "https://eslint.style/rules/semi-spacing",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description:
				"Enforce consistent spacing before and after semicolons",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/semi-spacing",
		},

		fixable: "whitespace",

		schema: [
			{
				type: "object",
				properties: {
					before: {
						type: "boolean",
						default: false,
					},
					after: {
						type: "boolean",
						default: true,
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			unexpectedWhitespaceBefore:
				"Unexpected whitespace before semicolon.",
			unexpectedWhitespaceAfter: "Unexpected whitespace after semicolon.",
			missingWhitespaceBefore: "Missing whitespace before semicolon.",
			missingWhitespaceAfter: "Missing whitespace after semicolon.",
		},
	},

	create(context) {
		const config = context.options[0],
			sourceCode = context.sourceCode;
		let requireSpaceBefore = false,
			requireSpaceAfter = true;

		if (typeof config === "object") {
			requireSpaceBefore = config.before;
			requireSpaceAfter = config.after;
		}

		/**
		 * Checks if a given token has leading whitespace.
		 * @param {Object} token The token to check.
		 * @returns {boolean} True if the given token has leading space, false if not.
		 */
		function hasLeadingSpace(token) {
			const tokenBefore = sourceCode.getTokenBefore(token);

			return (
				tokenBefore &&
				astUtils.isTokenOnSameLine(tokenBefore, token) &&
				sourceCode.isSpaceBetween(tokenBefore, token)
			);
		}

		/**
		 * Checks if a given token has trailing whitespace.
		 * @param {Object} token The token to check.
		 * @returns {boolean} True if the given token has trailing space, false if not.
		 */
		function hasTrailingSpace(token) {
			const tokenAfter = sourceCode.getTokenAfter(token);

			return (
				tokenAfter &&
				astUtils.isTokenOnSameLine(token, tokenAfter) &&
				sourceCode.isSpaceBetween(token, tokenAfter)
			);
		}

		/**
		 * Checks if the given token is the last token in its line.
		 * @param {Token} token The token to check.
		 * @returns {boolean} Whether or not the token is the last in its line.
		 */
		function isLastTokenInCurrentLine(token) {
			const tokenAfter = sourceCode.getTokenAfter(token);

			return !(
				tokenAfter && astUtils.isTokenOnSameLine(token, tokenAfter)
			);
		}

		/**
		 * Checks if the given token is the first token in its line
		 * @param {Token} token The token to check.
		 * @returns {boolean} Whether or not the token is the first in its line.
		 */
		function isFirstTokenInCurrentLine(token) {
			const tokenBefore = sourceCode.getTokenBefore(token);

			return !(
				tokenBefore && astUtils.isTokenOnSameLine(token, tokenBefore)
			);
		}

		/**
		 * Checks if the next token of a given token is a closing parenthesis.
		 * @param {Token} token The token to check.
		 * @returns {boolean} Whether or not the next token of a given token is a closing parenthesis.
		 */
		function isBeforeClosingParen(token) {
			const nextToken = sourceCode.getTokenAfter(token);

			return (
				(nextToken && astUtils.isClosingBraceToken(nextToken)) ||
				astUtils.isClosingParenToken(nextToken)
			);
		}

		/**
		 * Report location example :
		 *
		 * for unexpected space `before`
		 *
		 * var a = 'b'   ;
		 *            ^^^
		 *
		 * for unexpected space `after`
		 *
		 * var a = 'b';  c = 10;
		 *             ^^
		 *
		 * Reports if the given token has invalid spacing.
		 * @param {Token} token The semicolon token to check.
		 * @param {ASTNode} node The corresponding node of the token.
		 * @returns {void}
		 */
		function checkSemicolonSpacing(token, node) {
			if (astUtils.isSemicolonToken(token)) {
				if (hasLeadingSpace(token)) {
					if (!requireSpaceBefore) {
						const tokenBefore = sourceCode.getTokenBefore(token);
						const loc = {
							start: tokenBefore.loc.end,
							end: token.loc.start,
						};

						context.report({
							node,
							loc,
							messageId: "unexpectedWhitespaceBefore",
							fix(fixer) {
								return fixer.removeRange([
									tokenBefore.range[1],
									token.range[0],
								]);
							},
						});
					}
				} else {
					if (requireSpaceBefore) {
						const loc = token.loc;

						context.report({
							node,
							loc,
							messageId: "missingWhitespaceBefore",
							fix(fixer) {
								return fixer.insertTextBefore(token, " ");
							},
						});
					}
				}

				if (
					!isFirstTokenInCurrentLine(token) &&
					!isLastTokenInCurrentLine(token) &&
					!isBeforeClosingParen(token)
				) {
					if (hasTrailingSpace(token)) {
						if (!requireSpaceAfter) {
							const tokenAfter = sourceCode.getTokenAfter(token);
							const loc = {
								start: token.loc.end,
								end: tokenAfter.loc.start,
							};

							context.report({
								node,
								loc,
								messageId: "unexpectedWhitespaceAfter",
								fix(fixer) {
									return fixer.removeRange([
										token.range[1],
										tokenAfter.range[0],
									]);
								},
							});
						}
					} else {
						if (requireSpaceAfter) {
							const loc = token.loc;

							context.report({
								node,
								loc,
								messageId: "missingWhitespaceAfter",
								fix(fixer) {
									return fixer.insertTextAfter(token, " ");
								},
							});
						}
					}
				}
			}
		}

		/**
		 * Checks the spacing of the semicolon with the assumption that the last token is the semicolon.
		 * @param {ASTNode} node The node to check.
		 * @returns {void}
		 */
		function checkNode(node) {
			const token = sourceCode.getLastToken(node);

			checkSemicolonSpacing(token, node);
		}

		return {
			VariableDeclaration: checkNode,
			ExpressionStatement: checkNode,
			BreakStatement: checkNode,
			ContinueStatement: checkNode,
			DebuggerStatement: checkNode,
			DoWhileStatement: checkNode,
			ReturnStatement: checkNode,
			ThrowStatement: checkNode,
			ImportDeclaration: checkNode,
			ExportNamedDeclaration: checkNode,
			ExportAllDeclaration: checkNode,
			ExportDefaultDeclaration: checkNode,
			ForStatement(node) {
				if (node.init) {
					checkSemicolonSpacing(
						sourceCode.getTokenAfter(node.init),
						node,
					);
				}

				if (node.test) {
					checkSemicolonSpacing(
						sourceCode.getTokenAfter(node.test),
						node,
					);
				}
			},
			PropertyDefinition: checkNode,
		};
	},
};
4x~/**
 * @fileoverview Rule to enforce location of semicolons.
 * @author Toru Nagashima
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

const SELECTOR = [
	"BreakStatement",
	"ContinueStatement",
	"DebuggerStatement",
	"DoWhileStatement",
	"ExportAllDeclaration",
	"ExportDefaultDeclaration",
	"ExportNamedDeclaration",
	"ExpressionStatement",
	"ImportDeclaration",
	"ReturnStatement",
	"ThrowStatement",
	"VariableDeclaration",
	"PropertyDefinition",
].join(",");

/**
 * Get the child node list of a given node.
 * This returns `BlockStatement#body`, `StaticBlock#body`, `Program#body`,
 * `ClassBody#body`, or `SwitchCase#consequent`.
 * This is used to check whether a node is the first/last child.
 * @param {Node} node A node to get child node list.
 * @returns {Node[]|null} The child node list.
 */
function getChildren(node) {
	const t = node.type;

	if (
		t === "BlockStatement" ||
		t === "StaticBlock" ||
		t === "Program" ||
		t === "ClassBody"
	) {
		return node.body;
	}
	if (t === "SwitchCase") {
		return node.consequent;
	}
	return null;
}

/**
 * Check whether a given node is the last statement in the parent block.
 * @param {Node} node A node to check.
 * @returns {boolean} `true` if the node is the last statement in the parent block.
 */
function isLastChild(node) {
	const t = node.parent.type;

	if (
		t === "IfStatement" &&
		node.parent.consequent === node &&
		node.parent.alternate
	) {
		// before `else` keyword.
		return true;
	}
	if (t === "DoWhileStatement") {
		// before `while` keyword.
		return true;
	}
	const nodeList = getChildren(node.parent);

	return nodeList !== null && nodeList.at(-1) === node; // before `}` or etc.
}

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "semi-style",
						url: "https://eslint.style/rules/semi-style",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Enforce location of semicolons",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/semi-style",
		},

		schema: [{ enum: ["last", "first"] }],
		fixable: "whitespace",

		messages: {
			expectedSemiColon: "Expected this semicolon to be at {{pos}}.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const option = context.options[0] || "last";

		/**
		 * Check the given semicolon token.
		 * @param {Token} semiToken The semicolon token to check.
		 * @param {"first"|"last"} expected The expected location to check.
		 * @returns {void}
		 */
		function check(semiToken, expected) {
			const prevToken = sourceCode.getTokenBefore(semiToken);
			const nextToken = sourceCode.getTokenAfter(semiToken);
			const prevIsSameLine =
				!prevToken || astUtils.isTokenOnSameLine(prevToken, semiToken);
			const nextIsSameLine =
				!nextToken || astUtils.isTokenOnSameLine(semiToken, nextToken);

			if (
				(expected === "last" && !prevIsSameLine) ||
				(expected === "first" && !nextIsSameLine)
			) {
				context.report({
					loc: semiToken.loc,
					messageId: "expectedSemiColon",
					data: {
						pos:
							expected === "last"
								? "the end of the previous line"
								: "the beginning of the next line",
					},
					fix(fixer) {
						if (
							prevToken &&
							nextToken &&
							sourceCode.commentsExistBetween(
								prevToken,
								nextToken,
							)
						) {
							return null;
						}

						const start = prevToken
							? prevToken.range[1]
							: semiToken.range[0];
						const end = nextToken
							? nextToken.range[0]
							: semiToken.range[1];
						const text = expected === "last" ? ";\n" : "\n;";

						return fixer.replaceTextRange([start, end], text);
					},
				});
			}
		}

		return {
			[SELECTOR](node) {
				if (option === "first" && isLastChild(node)) {
					return;
				}

				const lastToken = sourceCode.getLastToken(node);

				if (astUtils.isSemicolonToken(lastToken)) {
					check(lastToken, option);
				}
			},

			ForStatement(node) {
				const firstSemi =
					node.init &&
					sourceCode.getTokenAfter(
						node.init,
						astUtils.isSemicolonToken,
					);
				const secondSemi =
					node.test &&
					sourceCode.getTokenAfter(
						node.test,
						astUtils.isSemicolonToken,
					);

				if (firstSemi) {
					check(firstSemi, "last");
				}
				if (secondSemi) {
					check(secondSemi, "last");
				}
			},
		};
	},
};
:"x4/**
 * @fileoverview Rule to flag missing semicolons.
 * @author Nicholas C. Zakas
 * @deprecated in ESLint v8.53.0
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const FixTracker = require("./utils/fix-tracker");
const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "semi",
						url: "https://eslint.style/rules/semi",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Require or disallow semicolons instead of ASI",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/semi",
		},

		fixable: "code",

		schema: {
			anyOf: [
				{
					type: "array",
					items: [
						{
							enum: ["never"],
						},
						{
							type: "object",
							properties: {
								beforeStatementContinuationChars: {
									enum: ["always", "any", "never"],
								},
							},
							additionalProperties: false,
						},
					],
					minItems: 0,
					maxItems: 2,
				},
				{
					type: "array",
					items: [
						{
							enum: ["always"],
						},
						{
							type: "object",
							properties: {
								omitLastInOneLineBlock: { type: "boolean" },
								omitLastInOneLineClassBody: { type: "boolean" },
							},
							additionalProperties: false,
						},
					],
					minItems: 0,
					maxItems: 2,
				},
			],
		},

		messages: {
			missingSemi: "Missing semicolon.",
			extraSemi: "Extra semicolon.",
		},
	},

	create(context) {
		const OPT_OUT_PATTERN = /^[-[(/+`]/u; // One of [(/+-`
		const unsafeClassFieldNames = new Set(["get", "set", "static"]);
		const unsafeClassFieldFollowers = new Set(["*", "in", "instanceof"]);
		const options = context.options[1];
		const never = context.options[0] === "never";
		const exceptOneLine = Boolean(
			options && options.omitLastInOneLineBlock,
		);
		const exceptOneLineClassBody = Boolean(
			options && options.omitLastInOneLineClassBody,
		);
		const beforeStatementContinuationChars =
			(options && options.beforeStatementContinuationChars) || "any";
		const sourceCode = context.sourceCode;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Reports a semicolon error with appropriate location and message.
		 * @param {ASTNode} node The node with an extra or missing semicolon.
		 * @param {boolean} missing True if the semicolon is missing.
		 * @returns {void}
		 */
		function report(node, missing) {
			const lastToken = sourceCode.getLastToken(node);
			let messageId, fix, loc;

			if (!missing) {
				messageId = "missingSemi";
				loc = {
					start: lastToken.loc.end,
					end: astUtils.getNextLocation(
						sourceCode,
						lastToken.loc.end,
					),
				};
				fix = function (fixer) {
					return fixer.insertTextAfter(lastToken, ";");
				};
			} else {
				messageId = "extraSemi";
				loc = lastToken.loc;
				fix = function (fixer) {
					/*
					 * Expand the replacement range to include the surrounding
					 * tokens to avoid conflicting with no-extra-semi.
					 * https://github.com/eslint/eslint/issues/7928
					 */
					return new FixTracker(fixer, sourceCode)
						.retainSurroundingTokens(lastToken)
						.remove(lastToken);
				};
			}

			context.report({
				node,
				loc,
				messageId,
				fix,
			});
		}

		/**
		 * Check whether a given semicolon token is redundant.
		 * @param {Token} semiToken A semicolon token to check.
		 * @returns {boolean} `true` if the next token is `;` or `}`.
		 */
		function isRedundantSemi(semiToken) {
			const nextToken = sourceCode.getTokenAfter(semiToken);

			return (
				!nextToken ||
				astUtils.isClosingBraceToken(nextToken) ||
				astUtils.isSemicolonToken(nextToken)
			);
		}

		/**
		 * Check whether a given token is the closing brace of an arrow function.
		 * @param {Token} lastToken A token to check.
		 * @returns {boolean} `true` if the token is the closing brace of an arrow function.
		 */
		function isEndOfArrowBlock(lastToken) {
			if (!astUtils.isClosingBraceToken(lastToken)) {
				return false;
			}
			const node = sourceCode.getNodeByRangeIndex(lastToken.range[0]);

			return (
				node.type === "BlockStatement" &&
				node.parent.type === "ArrowFunctionExpression"
			);
		}

		/**
		 * Checks if a given PropertyDefinition node followed by a semicolon
		 * can safely remove that semicolon. It is not to safe to remove if
		 * the class field name is "get", "set", or "static", or if
		 * followed by a generator method.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} `true` if the node cannot have the semicolon
		 *      removed.
		 */
		function maybeClassFieldAsiHazard(node) {
			if (node.type !== "PropertyDefinition") {
				return false;
			}

			/*
			 * Computed property names and non-identifiers are always safe
			 * as they can be distinguished from keywords easily.
			 */
			const needsNameCheck =
				!node.computed && node.key.type === "Identifier";

			/*
			 * Certain names are problematic unless they also have a
			 * a way to distinguish between keywords and property
			 * names.
			 */
			if (needsNameCheck && unsafeClassFieldNames.has(node.key.name)) {
				/*
				 * Special case: If the field name is `static`,
				 * it is only valid if the field is marked as static,
				 * so "static static" is okay but "static" is not.
				 */
				const isStaticStatic =
					node.static && node.key.name === "static";

				/*
				 * For other unsafe names, we only care if there is no
				 * initializer. No initializer = hazard.
				 */
				if (!isStaticStatic && !node.value) {
					return true;
				}
			}

			const followingToken = sourceCode.getTokenAfter(node);

			return unsafeClassFieldFollowers.has(followingToken.value);
		}

		/**
		 * Check whether a given node is on the same line with the next token.
		 * @param {Node} node A statement node to check.
		 * @returns {boolean} `true` if the node is on the same line with the next token.
		 */
		function isOnSameLineWithNextToken(node) {
			const prevToken = sourceCode.getLastToken(node, 1);
			const nextToken = sourceCode.getTokenAfter(node);

			return (
				!!nextToken && astUtils.isTokenOnSameLine(prevToken, nextToken)
			);
		}

		/**
		 * Check whether a given node can connect the next line if the next line is unreliable.
		 * @param {Node} node A statement node to check.
		 * @returns {boolean} `true` if the node can connect the next line.
		 */
		function maybeAsiHazardAfter(node) {
			const t = node.type;

			if (
				t === "DoWhileStatement" ||
				t === "BreakStatement" ||
				t === "ContinueStatement" ||
				t === "DebuggerStatement" ||
				t === "ImportDeclaration" ||
				t === "ExportAllDeclaration"
			) {
				return false;
			}
			if (t === "ReturnStatement") {
				return Boolean(node.argument);
			}
			if (t === "ExportNamedDeclaration") {
				return Boolean(node.declaration);
			}
			if (isEndOfArrowBlock(sourceCode.getLastToken(node, 1))) {
				return false;
			}

			return true;
		}

		/**
		 * Check whether a given token can connect the previous statement.
		 * @param {Token} token A token to check.
		 * @returns {boolean} `true` if the token is one of `[`, `(`, `/`, `+`, `-`, ```, `++`, and `--`.
		 */
		function maybeAsiHazardBefore(token) {
			return (
				Boolean(token) &&
				OPT_OUT_PATTERN.test(token.value) &&
				token.value !== "++" &&
				token.value !== "--"
			);
		}

		/**
		 * Check if the semicolon of a given node is unnecessary, only true if:
		 *   - next token is a valid statement divider (`;` or `}`).
		 *   - next token is on a new line and the node is not connectable to the new line.
		 * @param {Node} node A statement node to check.
		 * @returns {boolean} whether the semicolon is unnecessary.
		 */
		function canRemoveSemicolon(node) {
			if (isRedundantSemi(sourceCode.getLastToken(node))) {
				return true; // `;;` or `;}`
			}
			if (maybeClassFieldAsiHazard(node)) {
				return false;
			}
			if (isOnSameLineWithNextToken(node)) {
				return false; // One liner.
			}

			// continuation characters should not apply to class fields
			if (
				node.type !== "PropertyDefinition" &&
				beforeStatementContinuationChars === "never" &&
				!maybeAsiHazardAfter(node)
			) {
				return true; // ASI works. This statement doesn't connect to the next.
			}
			if (!maybeAsiHazardBefore(sourceCode.getTokenAfter(node))) {
				return true; // ASI works. The next token doesn't connect to this statement.
			}

			return false;
		}

		/**
		 * Checks a node to see if it's the last item in a one-liner block.
		 * Block is any `BlockStatement` or `StaticBlock` node. Block is a one-liner if its
		 * braces (and consequently everything between them) are on the same line.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} whether the node is the last item in a one-liner block.
		 */
		function isLastInOneLinerBlock(node) {
			const parent = node.parent;
			const nextToken = sourceCode.getTokenAfter(node);

			if (!nextToken || nextToken.value !== "}") {
				return false;
			}

			if (parent.type === "BlockStatement") {
				return parent.loc.start.line === parent.loc.end.line;
			}

			if (parent.type === "StaticBlock") {
				const openingBrace = sourceCode.getFirstToken(parent, {
					skip: 1,
				}); // skip the `static` token

				return openingBrace.loc.start.line === parent.loc.end.line;
			}

			return false;
		}

		/**
		 * Checks a node to see if it's the last item in a one-liner `ClassBody` node.
		 * ClassBody is a one-liner if its braces (and consequently everything between them) are on the same line.
		 * @param {ASTNode} node The node to check.
		 * @returns {boolean} whether the node is the last item in a one-liner ClassBody.
		 */
		function isLastInOneLinerClassBody(node) {
			const parent = node.parent;
			const nextToken = sourceCode.getTokenAfter(node);

			if (!nextToken || nextToken.value !== "}") {
				return false;
			}

			if (parent.type === "ClassBody") {
				return parent.loc.start.line === parent.loc.end.line;
			}

			return false;
		}

		/**
		 * Checks a node to see if it's followed by a semicolon.
		 * @param {ASTNode} node The node to check.
		 * @returns {void}
		 */
		function checkForSemicolon(node) {
			const isSemi = astUtils.isSemicolonToken(
				sourceCode.getLastToken(node),
			);

			if (never) {
				if (isSemi && canRemoveSemicolon(node)) {
					report(node, true);
				} else if (
					!isSemi &&
					beforeStatementContinuationChars === "always" &&
					node.type !== "PropertyDefinition" &&
					maybeAsiHazardBefore(sourceCode.getTokenAfter(node))
				) {
					report(node);
				}
			} else {
				const oneLinerBlock =
					exceptOneLine && isLastInOneLinerBlock(node);
				const oneLinerClassBody =
					exceptOneLineClassBody && isLastInOneLinerClassBody(node);
				const oneLinerBlockOrClassBody =
					oneLinerBlock || oneLinerClassBody;

				if (isSemi && oneLinerBlockOrClassBody) {
					report(node, true);
				} else if (!isSemi && !oneLinerBlockOrClassBody) {
					report(node);
				}
			}
		}

		/**
		 * Checks to see if there's a semicolon after a variable declaration.
		 * @param {ASTNode} node The node to check.
		 * @returns {void}
		 */
		function checkForSemicolonForVariableDeclaration(node) {
			const parent = node.parent;

			if (
				(parent.type !== "ForStatement" || parent.init !== node) &&
				(!/^For(?:In|Of)Statement/u.test(parent.type) ||
					parent.left !== node)
			) {
				checkForSemicolon(node);
			}
		}

		//--------------------------------------------------------------------------
		// Public API
		//--------------------------------------------------------------------------

		return {
			VariableDeclaration: checkForSemicolonForVariableDeclaration,
			ExpressionStatement: checkForSemicolon,
			ReturnStatement: checkForSemicolon,
			ThrowStatement: checkForSemicolon,
			DoWhileStatement: checkForSemicolon,
			DebuggerStatement: checkForSemicolon,
			BreakStatement: checkForSemicolon,
			ContinueStatement: checkForSemicolon,
			ImportDeclaration: checkForSemicolon,
			ExportAllDeclaration: checkForSemicolon,
			ExportNamedDeclaration(node) {
				if (!node.declaration) {
					checkForSemicolon(node);
				}
			},
			ExportDefaultDeclaration(node) {
				if (
					!/(?:Class|Function)Declaration/u.test(
						node.declaration.type,
					)
				) {
					checkForSemicolon(node);
				}
			},
			PropertyDefinition: checkForSemicolon,
		};
	},
};
ծx!d/**
 * @fileoverview Rule to enforce sorted `import` declarations within modules
 * @author Christian Schuller
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				allowSeparatedGroups: false,
				ignoreCase: false,
				ignoreDeclarationSort: false,
				ignoreMemberSort: false,
				memberSyntaxSortOrder: ["none", "all", "multiple", "single"],
			},
		],

		docs: {
			description: "Enforce sorted `import` declarations within modules",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/sort-imports",
		},

		schema: [
			{
				type: "object",
				properties: {
					ignoreCase: {
						type: "boolean",
					},
					memberSyntaxSortOrder: {
						type: "array",
						items: {
							enum: ["none", "all", "multiple", "single"],
						},
						uniqueItems: true,
						minItems: 4,
						maxItems: 4,
					},
					ignoreDeclarationSort: {
						type: "boolean",
					},
					ignoreMemberSort: {
						type: "boolean",
					},
					allowSeparatedGroups: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		fixable: "code",

		messages: {
			sortImportsAlphabetically:
				"Imports should be sorted alphabetically.",
			sortMembersAlphabetically:
				"Member '{{memberName}}' of the import declaration should be sorted alphabetically.",
			unexpectedSyntaxOrder:
				"Expected '{{syntaxA}}' syntax before '{{syntaxB}}' syntax.",
		},
	},

	create(context) {
		const [
			{
				ignoreCase,
				ignoreDeclarationSort,
				ignoreMemberSort,
				memberSyntaxSortOrder,
				allowSeparatedGroups,
			},
		] = context.options;
		const sourceCode = context.sourceCode;
		let previousDeclaration = null;

		/**
		 * Gets the used member syntax style.
		 *
		 * import "my-module.js" --> none
		 * import * as myModule from "my-module.js" --> all
		 * import {myMember} from "my-module.js" --> single
		 * import {foo, bar} from  "my-module.js" --> multiple
		 * @param {ASTNode} node the ImportDeclaration node.
		 * @returns {string} used member parameter style, ["all", "multiple", "single"]
		 */
		function usedMemberSyntax(node) {
			if (node.specifiers.length === 0) {
				return "none";
			}
			if (node.specifiers[0].type === "ImportNamespaceSpecifier") {
				return "all";
			}
			if (node.specifiers.length === 1) {
				return "single";
			}
			return "multiple";
		}

		/**
		 * Gets the group by member parameter index for given declaration.
		 * @param {ASTNode} node the ImportDeclaration node.
		 * @returns {number} the declaration group by member index.
		 */
		function getMemberParameterGroupIndex(node) {
			return memberSyntaxSortOrder.indexOf(usedMemberSyntax(node));
		}

		/**
		 * Gets the local name of the first imported module.
		 * @param {ASTNode} node the ImportDeclaration node.
		 * @returns {?string} the local name of the first imported module.
		 */
		function getFirstLocalMemberName(node) {
			if (node.specifiers[0]) {
				return node.specifiers[0].local.name;
			}
			return null;
		}

		/**
		 * Calculates number of lines between two nodes. It is assumed that the given `left` node appears before
		 * the given `right` node in the source code. Lines are counted from the end of the `left` node till the
		 * start of the `right` node. If the given nodes are on the same line, it returns `0`, same as if they were
		 * on two consecutive lines.
		 * @param {ASTNode} left node that appears before the given `right` node.
		 * @param {ASTNode} right node that appears after the given `left` node.
		 * @returns {number} number of lines between nodes.
		 */
		function getNumberOfLinesBetween(left, right) {
			return Math.max(right.loc.start.line - left.loc.end.line - 1, 0);
		}

		return {
			ImportDeclaration(node) {
				if (!ignoreDeclarationSort) {
					if (
						previousDeclaration &&
						allowSeparatedGroups &&
						getNumberOfLinesBetween(previousDeclaration, node) > 0
					) {
						// reset declaration sort
						previousDeclaration = null;
					}

					if (previousDeclaration) {
						const currentMemberSyntaxGroupIndex =
								getMemberParameterGroupIndex(node),
							previousMemberSyntaxGroupIndex =
								getMemberParameterGroupIndex(
									previousDeclaration,
								);
						let currentLocalMemberName =
								getFirstLocalMemberName(node),
							previousLocalMemberName =
								getFirstLocalMemberName(previousDeclaration);

						if (ignoreCase) {
							previousLocalMemberName =
								previousLocalMemberName &&
								previousLocalMemberName.toLowerCase();
							currentLocalMemberName =
								currentLocalMemberName &&
								currentLocalMemberName.toLowerCase();
						}

						/*
						 * When the current declaration uses a different member syntax,
						 * then check if the ordering is correct.
						 * Otherwise, make a default string compare (like rule sort-vars to be consistent) of the first used local member name.
						 */
						if (
							currentMemberSyntaxGroupIndex !==
							previousMemberSyntaxGroupIndex
						) {
							if (
								currentMemberSyntaxGroupIndex <
								previousMemberSyntaxGroupIndex
							) {
								context.report({
									node,
									messageId: "unexpectedSyntaxOrder",
									data: {
										syntaxA:
											memberSyntaxSortOrder[
												currentMemberSyntaxGroupIndex
											],
										syntaxB:
											memberSyntaxSortOrder[
												previousMemberSyntaxGroupIndex
											],
									},
								});
							}
						} else {
							if (
								previousLocalMemberName &&
								currentLocalMemberName &&
								currentLocalMemberName < previousLocalMemberName
							) {
								context.report({
									node,
									messageId: "sortImportsAlphabetically",
								});
							}
						}
					}

					previousDeclaration = node;
				}

				if (!ignoreMemberSort) {
					const importSpecifiers = node.specifiers.filter(
						specifier => specifier.type === "ImportSpecifier",
					);
					const getSortableName = ignoreCase
						? specifier => specifier.local.name.toLowerCase()
						: specifier => specifier.local.name;
					const firstUnsortedIndex = importSpecifiers
						.map(getSortableName)
						.findIndex(
							(name, index, array) => array[index - 1] > name,
						);

					if (firstUnsortedIndex !== -1) {
						context.report({
							node: importSpecifiers[firstUnsortedIndex],
							messageId: "sortMembersAlphabetically",
							data: {
								memberName:
									importSpecifiers[firstUnsortedIndex].local
										.name,
							},
							fix(fixer) {
								if (
									importSpecifiers.some(
										specifier =>
											sourceCode.getCommentsBefore(
												specifier,
											).length ||
											sourceCode.getCommentsAfter(
												specifier,
											).length,
									)
								) {
									// If there are comments in the ImportSpecifier list, don't rearrange the specifiers.
									return null;
								}

								return fixer.replaceTextRange(
									[
										importSpecifiers[0].range[0],
										importSpecifiers.at(-1).range[1],
									],
									importSpecifiers

										// Clone the importSpecifiers array to avoid mutating it
										.slice()

										// Sort the array into the desired order
										.sort((specifierA, specifierB) => {
											const aName =
												getSortableName(specifierA);
											const bName =
												getSortableName(specifierB);

											return aName > bName ? 1 : -1;
										})

										// Build a string out of the sorted list of import specifiers and the text between the originals
										.reduce(
											(sourceText, specifier, index) => {
												const textAfterSpecifier =
													index ===
													importSpecifiers.length - 1
														? ""
														: sourceCode
																.getText()
																.slice(
																	importSpecifiers[
																		index
																	].range[1],
																	importSpecifiers[
																		index +
																			1
																	].range[0],
																);

												return (
													sourceText +
													sourceCode.getText(
														specifier,
													) +
													textAfterSpecifier
												);
											},
											"",
										),
								);
							},
						});
					}
				}
			},
		};
	},
};
nWx/**
 * @fileoverview Rule to require object keys to be sorted
 * @author Toru Nagashima
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils"),
	naturalCompare = require("natural-compare");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Gets the property name of the given `Property` node.
 *
 * - If the property's key is an `Identifier` node, this returns the key's name
 *   whether it's a computed property or not.
 * - If the property has a static name, this returns the static name.
 * - Otherwise, this returns null.
 * @param {ASTNode} node The `Property` node to get.
 * @returns {string|null} The property name or null.
 * @private
 */
function getPropertyName(node) {
	const staticName = astUtils.getStaticPropertyName(node);

	if (staticName !== null) {
		return staticName;
	}

	return node.key.name || null;
}

/**
 * Functions which check that the given 2 names are in specific order.
 *
 * Postfix `I` is meant insensitive.
 * Postfix `N` is meant natural.
 * @private
 */
const isValidOrders = {
	asc(a, b) {
		return a <= b;
	},
	ascI(a, b) {
		return a.toLowerCase() <= b.toLowerCase();
	},
	ascN(a, b) {
		return naturalCompare(a, b) <= 0;
	},
	ascIN(a, b) {
		return naturalCompare(a.toLowerCase(), b.toLowerCase()) <= 0;
	},
	desc(a, b) {
		return isValidOrders.asc(b, a);
	},
	descI(a, b) {
		return isValidOrders.ascI(b, a);
	},
	descN(a, b) {
		return isValidOrders.ascN(b, a);
	},
	descIN(a, b) {
		return isValidOrders.ascIN(b, a);
	},
};

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			"asc",
			{
				allowLineSeparatedGroups: false,
				caseSensitive: true,
				ignoreComputedKeys: false,
				minKeys: 2,
				natural: false,
			},
		],

		docs: {
			description: "Require object keys to be sorted",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/sort-keys",
		},

		schema: [
			{
				enum: ["asc", "desc"],
			},
			{
				type: "object",
				properties: {
					caseSensitive: {
						type: "boolean",
					},
					natural: {
						type: "boolean",
					},
					minKeys: {
						type: "integer",
						minimum: 2,
					},
					allowLineSeparatedGroups: {
						type: "boolean",
					},
					ignoreComputedKeys: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			sortKeys:
				"Expected object keys to be in {{natural}}{{insensitive}}{{order}}ending order. '{{thisName}}' should be before '{{prevName}}'.",
		},
	},

	create(context) {
		const [
			order,
			{
				caseSensitive,
				natural,
				minKeys,
				allowLineSeparatedGroups,
				ignoreComputedKeys,
			},
		] = context.options;
		const insensitive = !caseSensitive;
		const isValidOrder =
			isValidOrders[
				order + (insensitive ? "I" : "") + (natural ? "N" : "")
			];

		// The stack to save the previous property's name for each object literals.
		let stack = null;
		const sourceCode = context.sourceCode;

		return {
			ObjectExpression(node) {
				stack = {
					upper: stack,
					prevNode: null,
					prevBlankLine: false,
					prevName: null,
					numKeys: node.properties.length,
				};
			},

			"ObjectExpression:exit"() {
				stack = stack.upper;
			},

			SpreadElement(node) {
				if (node.parent.type === "ObjectExpression") {
					stack.prevName = null;
				}
			},

			Property(node) {
				if (node.parent.type === "ObjectPattern") {
					return;
				}

				if (ignoreComputedKeys && node.computed) {
					stack.prevName = null; // reset sort
					return;
				}

				const prevName = stack.prevName;
				const numKeys = stack.numKeys;
				const thisName = getPropertyName(node);

				// Get tokens between current node and previous node
				const tokens =
					stack.prevNode &&
					sourceCode.getTokensBetween(stack.prevNode, node, {
						includeComments: true,
					});

				let isBlankLineBetweenNodes = stack.prevBlankLine;

				if (tokens) {
					// check blank line between tokens
					tokens.forEach((token, index) => {
						const previousToken = tokens[index - 1];

						if (
							previousToken &&
							token.loc.start.line - previousToken.loc.end.line >
								1
						) {
							isBlankLineBetweenNodes = true;
						}
					});

					// check blank line between the current node and the last token
					if (
						!isBlankLineBetweenNodes &&
						node.loc.start.line - tokens.at(-1).loc.end.line > 1
					) {
						isBlankLineBetweenNodes = true;
					}

					// check blank line between the first token and the previous node
					if (
						!isBlankLineBetweenNodes &&
						tokens[0].loc.start.line - stack.prevNode.loc.end.line >
							1
					) {
						isBlankLineBetweenNodes = true;
					}
				}

				stack.prevNode = node;

				if (thisName !== null) {
					stack.prevName = thisName;
				}

				if (allowLineSeparatedGroups && isBlankLineBetweenNodes) {
					stack.prevBlankLine = thisName === null;
					return;
				}

				if (
					prevName === null ||
					thisName === null ||
					numKeys < minKeys
				) {
					return;
				}

				if (!isValidOrder(prevName, thisName)) {
					context.report({
						node,
						loc: node.key.loc,
						messageId: "sortKeys",
						data: {
							thisName,
							prevName,
							order,
							insensitive: insensitive ? "insensitive " : "",
							natural: natural ? "natural " : "",
						},
					});
				}
			},
		};
	},
};

x/**
 * @fileoverview Rule to require sorting of variables within a single Variable Declaration block
 * @author Ilya Volodin
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			{
				ignoreCase: false,
			},
		],

		docs: {
			description:
				"Require variables within the same declaration block to be sorted",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/sort-vars",
		},

		schema: [
			{
				type: "object",
				properties: {
					ignoreCase: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		fixable: "code",

		messages: {
			sortVars:
				"Variables within the same declaration block should be sorted alphabetically.",
		},
	},

	create(context) {
		const [{ ignoreCase }] = context.options;
		const sourceCode = context.sourceCode;

		return {
			VariableDeclaration(node) {
				const idDeclarations = node.declarations.filter(
					decl => decl.id.type === "Identifier",
				);
				const getSortableName = ignoreCase
					? decl => decl.id.name.toLowerCase()
					: decl => decl.id.name;
				const unfixable = idDeclarations.some(
					decl => decl.init !== null && decl.init.type !== "Literal",
				);
				let fixed = false;

				idDeclarations.slice(1).reduce((memo, decl) => {
					const lastVariableName = getSortableName(memo),
						currentVariableName = getSortableName(decl);

					if (currentVariableName < lastVariableName) {
						context.report({
							node: decl,
							messageId: "sortVars",
							fix(fixer) {
								if (unfixable || fixed) {
									return null;
								}
								return fixer.replaceTextRange(
									[
										idDeclarations[0].range[0],
										idDeclarations.at(-1).range[1],
									],
									idDeclarations

										// Clone the idDeclarations array to avoid mutating it
										.slice()

										// Sort the array into the desired order
										.sort((declA, declB) => {
											const aName =
												getSortableName(declA);
											const bName =
												getSortableName(declB);

											return aName > bName ? 1 : -1;
										})

										// Build a string out of the sorted list of identifier declarations and the text between the originals
										.reduce(
											(sourceText, identifier, index) => {
												const textAfterIdentifier =
													index ===
													idDeclarations.length - 1
														? ""
														: sourceCode
																.getText()
																.slice(
																	idDeclarations[
																		index
																	].range[1],
																	idDeclarations[
																		index +
																			1
																	].range[0],
																);

												return (
													sourceText +
													sourceCode.getText(
														identifier,
													) +
													textAfterIdentifier
												);
											},
											"",
										),
								);
							},
						});
						fixed = true;
						return memo;
					}
					return decl;
				}, idDeclarations[0]);
			},
		};
	},
};
*OxM/**
 * @fileoverview A rule to ensure whitespace before blocks.
 * @author Mathias Schreck <https://github.com/lo1tuma>
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Checks whether the given node represents the body of a function.
 * @param {ASTNode} node the node to check.
 * @returns {boolean} `true` if the node is function body.
 */
function isFunctionBody(node) {
	const parent = node.parent;

	return (
		node.type === "BlockStatement" &&
		astUtils.isFunction(parent) &&
		parent.body === node
	);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "space-before-blocks",
						url: "https://eslint.style/rules/space-before-blocks",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Enforce consistent spacing before blocks",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/space-before-blocks",
		},

		fixable: "whitespace",

		schema: [
			{
				oneOf: [
					{
						enum: ["always", "never"],
					},
					{
						type: "object",
						properties: {
							keywords: {
								enum: ["always", "never", "off"],
							},
							functions: {
								enum: ["always", "never", "off"],
							},
							classes: {
								enum: ["always", "never", "off"],
							},
						},
						additionalProperties: false,
					},
				],
			},
		],

		messages: {
			unexpectedSpace: "Unexpected space before opening brace.",
			missingSpace: "Missing space before opening brace.",
		},
	},

	create(context) {
		const config = context.options[0],
			sourceCode = context.sourceCode;
		let alwaysFunctions = true,
			alwaysKeywords = true,
			alwaysClasses = true,
			neverFunctions = false,
			neverKeywords = false,
			neverClasses = false;

		if (typeof config === "object") {
			alwaysFunctions = config.functions === "always";
			alwaysKeywords = config.keywords === "always";
			alwaysClasses = config.classes === "always";
			neverFunctions = config.functions === "never";
			neverKeywords = config.keywords === "never";
			neverClasses = config.classes === "never";
		} else if (config === "never") {
			alwaysFunctions = false;
			alwaysKeywords = false;
			alwaysClasses = false;
			neverFunctions = true;
			neverKeywords = true;
			neverClasses = true;
		}

		/**
		 * Checks whether the spacing before the given block is already controlled by another rule:
		 * - `arrow-spacing` checks spaces after `=>`.
		 * - `keyword-spacing` checks spaces after keywords in certain contexts.
		 * - `switch-colon-spacing` checks spaces after `:` of switch cases.
		 * @param {Token} precedingToken first token before the block.
		 * @param {ASTNode|Token} node `BlockStatement` node or `{` token of a `SwitchStatement` node.
		 * @returns {boolean} `true` if requiring or disallowing spaces before the given block could produce conflicts with other rules.
		 */
		function isConflicted(precedingToken, node) {
			return (
				astUtils.isArrowToken(precedingToken) ||
				(astUtils.isKeywordToken(precedingToken) &&
					!isFunctionBody(node)) ||
				(astUtils.isColonToken(precedingToken) &&
					node.parent &&
					node.parent.type === "SwitchCase" &&
					precedingToken ===
						astUtils.getSwitchCaseColonToken(
							node.parent,
							sourceCode,
						))
			);
		}

		/**
		 * Checks the given BlockStatement node has a preceding space if it doesn’t start on a new line.
		 * @param {ASTNode|Token} node The AST node of a BlockStatement.
		 * @returns {void} undefined.
		 */
		function checkPrecedingSpace(node) {
			const precedingToken = sourceCode.getTokenBefore(node);

			if (
				precedingToken &&
				!isConflicted(precedingToken, node) &&
				astUtils.isTokenOnSameLine(precedingToken, node)
			) {
				const hasSpace = sourceCode.isSpaceBetween(
					precedingToken,
					node,
				);
				let requireSpace;
				let requireNoSpace;

				if (isFunctionBody(node)) {
					requireSpace = alwaysFunctions;
					requireNoSpace = neverFunctions;
				} else if (node.type === "ClassBody") {
					requireSpace = alwaysClasses;
					requireNoSpace = neverClasses;
				} else {
					requireSpace = alwaysKeywords;
					requireNoSpace = neverKeywords;
				}

				if (requireSpace && !hasSpace) {
					context.report({
						node,
						messageId: "missingSpace",
						fix(fixer) {
							return fixer.insertTextBefore(node, " ");
						},
					});
				} else if (requireNoSpace && hasSpace) {
					context.report({
						node,
						messageId: "unexpectedSpace",
						fix(fixer) {
							return fixer.removeRange([
								precedingToken.range[1],
								node.range[0],
							]);
						},
					});
				}
			}
		}

		/**
		 * Checks if the CaseBlock of an given SwitchStatement node has a preceding space.
		 * @param {ASTNode} node The node of a SwitchStatement.
		 * @returns {void} undefined.
		 */
		function checkSpaceBeforeCaseBlock(node) {
			const cases = node.cases;
			let openingBrace;

			if (cases.length > 0) {
				openingBrace = sourceCode.getTokenBefore(cases[0]);
			} else {
				openingBrace = sourceCode.getLastToken(node, 1);
			}

			checkPrecedingSpace(openingBrace);
		}

		return {
			BlockStatement: checkPrecedingSpace,
			ClassBody: checkPrecedingSpace,
			SwitchStatement: checkSpaceBeforeCaseBlock,
		};
	},
};
Vxq/**
 * @fileoverview Rule to validate spacing before function paren.
 * @author Mathias Schreck <https://github.com/lo1tuma>
 * @deprecated in ESLint v8.53.0
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "space-before-function-paren",
						url: "https://eslint.style/rules/space-before-function-paren",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description:
				"Enforce consistent spacing before `function` definition opening parenthesis",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/space-before-function-paren",
		},

		fixable: "whitespace",

		schema: [
			{
				oneOf: [
					{
						enum: ["always", "never"],
					},
					{
						type: "object",
						properties: {
							anonymous: {
								enum: ["always", "never", "ignore"],
							},
							named: {
								enum: ["always", "never", "ignore"],
							},
							asyncArrow: {
								enum: ["always", "never", "ignore"],
							},
						},
						additionalProperties: false,
					},
				],
			},
		],

		messages: {
			unexpectedSpace: "Unexpected space before function parentheses.",
			missingSpace: "Missing space before function parentheses.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const baseConfig =
			typeof context.options[0] === "string"
				? context.options[0]
				: "always";
		const overrideConfig =
			typeof context.options[0] === "object" ? context.options[0] : {};

		/**
		 * Determines whether a function has a name.
		 * @param {ASTNode} node The function node.
		 * @returns {boolean} Whether the function has a name.
		 */
		function isNamedFunction(node) {
			if (node.id) {
				return true;
			}

			const parent = node.parent;

			return (
				parent.type === "MethodDefinition" ||
				(parent.type === "Property" &&
					(parent.kind === "get" ||
						parent.kind === "set" ||
						parent.method))
			);
		}

		/**
		 * Gets the config for a given function
		 * @param {ASTNode} node The function node
		 * @returns {string} "always", "never", or "ignore"
		 */
		function getConfigForFunction(node) {
			if (node.type === "ArrowFunctionExpression") {
				// Always ignore non-async functions and arrow functions without parens, e.g. async foo => bar
				if (
					node.async &&
					astUtils.isOpeningParenToken(
						sourceCode.getFirstToken(node, { skip: 1 }),
					)
				) {
					return overrideConfig.asyncArrow || baseConfig;
				}
			} else if (isNamedFunction(node)) {
				return overrideConfig.named || baseConfig;

				// `generator-star-spacing` should warn anonymous generators. E.g. `function* () {}`
			} else if (!node.generator) {
				return overrideConfig.anonymous || baseConfig;
			}

			return "ignore";
		}

		/**
		 * Checks the parens of a function node
		 * @param {ASTNode} node A function node
		 * @returns {void}
		 */
		function checkFunction(node) {
			const functionConfig = getConfigForFunction(node);

			if (functionConfig === "ignore") {
				return;
			}

			const rightToken = sourceCode.getFirstToken(
				node,
				astUtils.isOpeningParenToken,
			);
			const leftToken = sourceCode.getTokenBefore(rightToken);
			const hasSpacing = sourceCode.isSpaceBetween(leftToken, rightToken);

			if (hasSpacing && functionConfig === "never") {
				context.report({
					node,
					loc: {
						start: leftToken.loc.end,
						end: rightToken.loc.start,
					},
					messageId: "unexpectedSpace",
					fix(fixer) {
						const comments =
							sourceCode.getCommentsBefore(rightToken);

						// Don't fix anything if there's a single line comment between the left and the right token
						if (comments.some(comment => comment.type === "Line")) {
							return null;
						}
						return fixer.replaceTextRange(
							[leftToken.range[1], rightToken.range[0]],
							comments.reduce(
								(text, comment) =>
									text + sourceCode.getText(comment),
								"",
							),
						);
					},
				});
			} else if (!hasSpacing && functionConfig === "always") {
				context.report({
					node,
					loc: rightToken.loc,
					messageId: "missingSpace",
					fix: fixer => fixer.insertTextAfter(leftToken, " "),
				});
			}
		}

		return {
			ArrowFunctionExpression: checkFunction,
			FunctionDeclaration: checkFunction,
			FunctionExpression: checkFunction,
		};
	},
};
xJ$/**
 * @fileoverview Disallows or enforces spaces inside of parentheses.
 * @author Jonathan Rajavuori
 * @deprecated in ESLint v8.53.0
 */
"use strict";

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "space-in-parens",
						url: "https://eslint.style/rules/space-in-parens",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Enforce consistent spacing inside parentheses",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/space-in-parens",
		},

		fixable: "whitespace",

		schema: [
			{
				enum: ["always", "never"],
			},
			{
				type: "object",
				properties: {
					exceptions: {
						type: "array",
						items: {
							enum: ["{}", "[]", "()", "empty"],
						},
						uniqueItems: true,
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			missingOpeningSpace: "There must be a space after this paren.",
			missingClosingSpace: "There must be a space before this paren.",
			rejectedOpeningSpace: "There should be no space after this paren.",
			rejectedClosingSpace: "There should be no space before this paren.",
		},
	},

	create(context) {
		const ALWAYS = context.options[0] === "always",
			exceptionsArrayOptions =
				(context.options[1] && context.options[1].exceptions) || [],
			options = {};

		let exceptions;

		if (exceptionsArrayOptions.length) {
			options.braceException = exceptionsArrayOptions.includes("{}");
			options.bracketException = exceptionsArrayOptions.includes("[]");
			options.parenException = exceptionsArrayOptions.includes("()");
			options.empty = exceptionsArrayOptions.includes("empty");
		}

		/**
		 * Produces an object with the opener and closer exception values
		 * @returns {Object} `openers` and `closers` exception values
		 * @private
		 */
		function getExceptions() {
			const openers = [],
				closers = [];

			if (options.braceException) {
				openers.push("{");
				closers.push("}");
			}

			if (options.bracketException) {
				openers.push("[");
				closers.push("]");
			}

			if (options.parenException) {
				openers.push("(");
				closers.push(")");
			}

			if (options.empty) {
				openers.push(")");
				closers.push("(");
			}

			return {
				openers,
				closers,
			};
		}

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------
		const sourceCode = context.sourceCode;

		/**
		 * Determines if a token is one of the exceptions for the opener paren
		 * @param {Object} token The token to check
		 * @returns {boolean} True if the token is one of the exceptions for the opener paren
		 */
		function isOpenerException(token) {
			return exceptions.openers.includes(token.value);
		}

		/**
		 * Determines if a token is one of the exceptions for the closer paren
		 * @param {Object} token The token to check
		 * @returns {boolean} True if the token is one of the exceptions for the closer paren
		 */
		function isCloserException(token) {
			return exceptions.closers.includes(token.value);
		}

		/**
		 * Determines if an opening paren is immediately followed by a required space
		 * @param {Object} openingParenToken The paren token
		 * @param {Object} tokenAfterOpeningParen The token after it
		 * @returns {boolean} True if the opening paren is missing a required space
		 */
		function openerMissingSpace(openingParenToken, tokenAfterOpeningParen) {
			if (
				sourceCode.isSpaceBetween(
					openingParenToken,
					tokenAfterOpeningParen,
				)
			) {
				return false;
			}

			if (
				!options.empty &&
				astUtils.isClosingParenToken(tokenAfterOpeningParen)
			) {
				return false;
			}

			if (ALWAYS) {
				return !isOpenerException(tokenAfterOpeningParen);
			}
			return isOpenerException(tokenAfterOpeningParen);
		}

		/**
		 * Determines if an opening paren is immediately followed by a disallowed space
		 * @param {Object} openingParenToken The paren token
		 * @param {Object} tokenAfterOpeningParen The token after it
		 * @returns {boolean} True if the opening paren has a disallowed space
		 */
		function openerRejectsSpace(openingParenToken, tokenAfterOpeningParen) {
			if (
				!astUtils.isTokenOnSameLine(
					openingParenToken,
					tokenAfterOpeningParen,
				)
			) {
				return false;
			}

			if (tokenAfterOpeningParen.type === "Line") {
				return false;
			}

			if (
				!sourceCode.isSpaceBetween(
					openingParenToken,
					tokenAfterOpeningParen,
				)
			) {
				return false;
			}

			if (ALWAYS) {
				return isOpenerException(tokenAfterOpeningParen);
			}
			return !isOpenerException(tokenAfterOpeningParen);
		}

		/**
		 * Determines if a closing paren is immediately preceded by a required space
		 * @param {Object} tokenBeforeClosingParen The token before the paren
		 * @param {Object} closingParenToken The paren token
		 * @returns {boolean} True if the closing paren is missing a required space
		 */
		function closerMissingSpace(
			tokenBeforeClosingParen,
			closingParenToken,
		) {
			if (
				sourceCode.isSpaceBetween(
					tokenBeforeClosingParen,
					closingParenToken,
				)
			) {
				return false;
			}

			if (
				!options.empty &&
				astUtils.isOpeningParenToken(tokenBeforeClosingParen)
			) {
				return false;
			}

			if (ALWAYS) {
				return !isCloserException(tokenBeforeClosingParen);
			}
			return isCloserException(tokenBeforeClosingParen);
		}

		/**
		 * Determines if a closer paren is immediately preceded by a disallowed space
		 * @param {Object} tokenBeforeClosingParen The token before the paren
		 * @param {Object} closingParenToken The paren token
		 * @returns {boolean} True if the closing paren has a disallowed space
		 */
		function closerRejectsSpace(
			tokenBeforeClosingParen,
			closingParenToken,
		) {
			if (
				!astUtils.isTokenOnSameLine(
					tokenBeforeClosingParen,
					closingParenToken,
				)
			) {
				return false;
			}

			if (
				!sourceCode.isSpaceBetween(
					tokenBeforeClosingParen,
					closingParenToken,
				)
			) {
				return false;
			}

			if (ALWAYS) {
				return isCloserException(tokenBeforeClosingParen);
			}
			return !isCloserException(tokenBeforeClosingParen);
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			Program: function checkParenSpaces(node) {
				exceptions = getExceptions();
				const tokens = sourceCode.tokensAndComments;

				tokens.forEach((token, i) => {
					const prevToken = tokens[i - 1];
					const nextToken = tokens[i + 1];

					// if token is not an opening or closing paren token, do nothing
					if (
						!astUtils.isOpeningParenToken(token) &&
						!astUtils.isClosingParenToken(token)
					) {
						return;
					}

					// if token is an opening paren and is not followed by a required space
					if (
						token.value === "(" &&
						openerMissingSpace(token, nextToken)
					) {
						context.report({
							node,
							loc: token.loc,
							messageId: "missingOpeningSpace",
							fix(fixer) {
								return fixer.insertTextAfter(token, " ");
							},
						});
					}

					// if token is an opening paren and is followed by a disallowed space
					if (
						token.value === "(" &&
						openerRejectsSpace(token, nextToken)
					) {
						context.report({
							node,
							loc: {
								start: token.loc.end,
								end: nextToken.loc.start,
							},
							messageId: "rejectedOpeningSpace",
							fix(fixer) {
								return fixer.removeRange([
									token.range[1],
									nextToken.range[0],
								]);
							},
						});
					}

					// if token is a closing paren and is not preceded by a required space
					if (
						token.value === ")" &&
						closerMissingSpace(prevToken, token)
					) {
						context.report({
							node,
							loc: token.loc,
							messageId: "missingClosingSpace",
							fix(fixer) {
								return fixer.insertTextBefore(token, " ");
							},
						});
					}

					// if token is a closing paren and is preceded by a disallowed space
					if (
						token.value === ")" &&
						closerRejectsSpace(prevToken, token)
					) {
						context.report({
							node,
							loc: {
								start: prevToken.loc.end,
								end: token.loc.start,
							},
							messageId: "rejectedClosingSpace",
							fix(fixer) {
								return fixer.removeRange([
									prevToken.range[1],
									token.range[0],
								]);
							},
						});
					}
				});
			},
		};
	},
};
׉*x)/**
 * @fileoverview Require spaces around infix operators
 * @author Michael Ficarra
 * @deprecated in ESLint v8.53.0
 */
"use strict";

const { isEqToken } = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "space-infix-ops",
						url: "https://eslint.style/rules/space-infix-ops",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Require spacing around infix operators",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/space-infix-ops",
		},

		fixable: "whitespace",

		schema: [
			{
				type: "object",
				properties: {
					int32Hint: {
						type: "boolean",
						default: false,
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			missingSpace: "Operator '{{operator}}' must be spaced.",
		},
	},

	create(context) {
		const int32Hint = context.options[0]
			? context.options[0].int32Hint === true
			: false;
		const sourceCode = context.sourceCode;

		/**
		 * Returns the first token which violates the rule
		 * @param {ASTNode} left The left node of the main node
		 * @param {ASTNode} right The right node of the main node
		 * @param {string} op The operator of the main node
		 * @returns {Object} The violator token or null
		 * @private
		 */
		function getFirstNonSpacedToken(left, right, op) {
			const operator = sourceCode.getFirstTokenBetween(
				left,
				right,
				token => token.value === op,
			);
			const prev = sourceCode.getTokenBefore(operator);
			const next = sourceCode.getTokenAfter(operator);

			if (
				!sourceCode.isSpaceBetween(prev, operator) ||
				!sourceCode.isSpaceBetween(operator, next)
			) {
				return operator;
			}

			return null;
		}

		/**
		 * Reports an AST node as a rule violation
		 * @param {ASTNode} mainNode The node to report
		 * @param {Object} culpritToken The token which has a problem
		 * @returns {void}
		 * @private
		 */
		function report(mainNode, culpritToken) {
			context.report({
				node: mainNode,
				loc: culpritToken.loc,
				messageId: "missingSpace",
				data: {
					operator: culpritToken.value,
				},
				fix(fixer) {
					const previousToken =
						sourceCode.getTokenBefore(culpritToken);
					const afterToken = sourceCode.getTokenAfter(culpritToken);
					let fixString = "";

					if (culpritToken.range[0] - previousToken.range[1] === 0) {
						fixString = " ";
					}

					fixString += culpritToken.value;

					if (afterToken.range[0] - culpritToken.range[1] === 0) {
						fixString += " ";
					}

					return fixer.replaceText(culpritToken, fixString);
				},
			});
		}

		/**
		 * Check if the node is binary then report
		 * @param {ASTNode} node node to evaluate
		 * @returns {void}
		 * @private
		 */
		function checkBinary(node) {
			const leftNode = node.left.typeAnnotation
				? node.left.typeAnnotation
				: node.left;
			const rightNode = node.right;

			// search for = in AssignmentPattern nodes
			const operator = node.operator || "=";

			const nonSpacedNode = getFirstNonSpacedToken(
				leftNode,
				rightNode,
				operator,
			);

			if (nonSpacedNode) {
				if (!(int32Hint && sourceCode.getText(node).endsWith("|0"))) {
					report(node, nonSpacedNode);
				}
			}
		}

		/**
		 * Check if the node is conditional
		 * @param {ASTNode} node node to evaluate
		 * @returns {void}
		 * @private
		 */
		function checkConditional(node) {
			const nonSpacedConsequentNode = getFirstNonSpacedToken(
				node.test,
				node.consequent,
				"?",
			);
			const nonSpacedAlternateNode = getFirstNonSpacedToken(
				node.consequent,
				node.alternate,
				":",
			);

			if (nonSpacedConsequentNode) {
				report(node, nonSpacedConsequentNode);
			}

			if (nonSpacedAlternateNode) {
				report(node, nonSpacedAlternateNode);
			}
		}

		/**
		 * Check if the node is a variable
		 * @param {ASTNode} node node to evaluate
		 * @returns {void}
		 * @private
		 */
		function checkVar(node) {
			const leftNode = node.id.typeAnnotation
				? node.id.typeAnnotation
				: node.id;
			const rightNode = node.init;

			if (rightNode) {
				const nonSpacedNode = getFirstNonSpacedToken(
					leftNode,
					rightNode,
					"=",
				);

				if (nonSpacedNode) {
					report(node, nonSpacedNode);
				}
			}
		}

		return {
			AssignmentExpression: checkBinary,
			AssignmentPattern: checkBinary,
			BinaryExpression: checkBinary,
			LogicalExpression: checkBinary,
			ConditionalExpression: checkConditional,
			VariableDeclarator: checkVar,

			PropertyDefinition(node) {
				if (!node.value) {
					return;
				}

				/*
				 * Because of computed properties and type annotations, some
				 * tokens may exist between `node.key` and `=`.
				 * Therefore, find the `=` from the right.
				 */
				const operatorToken = sourceCode.getTokenBefore(
					node.value,
					isEqToken,
				);
				const leftToken = sourceCode.getTokenBefore(operatorToken);
				const rightToken = sourceCode.getTokenAfter(operatorToken);

				if (
					!sourceCode.isSpaceBetween(leftToken, operatorToken) ||
					!sourceCode.isSpaceBetween(operatorToken, rightToken)
				) {
					report(node, operatorToken);
				}
			},
		};
	},
};
1x)k/**
 * @fileoverview This rule should require or disallow spaces before or after unary operations.
 * @author Marcin Kumorek
 * @deprecated in ESLint v8.53.0
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "space-unary-ops",
						url: "https://eslint.style/rules/space-unary-ops",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description:
				"Enforce consistent spacing before or after unary operators",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/space-unary-ops",
		},

		fixable: "whitespace",

		schema: [
			{
				type: "object",
				properties: {
					words: {
						type: "boolean",
						default: true,
					},
					nonwords: {
						type: "boolean",
						default: false,
					},
					overrides: {
						type: "object",
						additionalProperties: {
							type: "boolean",
						},
					},
				},
				additionalProperties: false,
			},
		],
		messages: {
			unexpectedBefore:
				"Unexpected space before unary operator '{{operator}}'.",
			unexpectedAfter:
				"Unexpected space after unary operator '{{operator}}'.",
			unexpectedAfterWord:
				"Unexpected space after unary word operator '{{word}}'.",
			wordOperator:
				"Unary word operator '{{word}}' must be followed by whitespace.",
			operator:
				"Unary operator '{{operator}}' must be followed by whitespace.",
			beforeUnaryExpressions:
				"Space is required before unary expressions '{{token}}'.",
		},
	},

	create(context) {
		const options = context.options[0] || { words: true, nonwords: false };

		const sourceCode = context.sourceCode;

		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Check if the node is the first "!" in a "!!" convert to Boolean expression
		 * @param {ASTnode} node AST node
		 * @returns {boolean} Whether or not the node is first "!" in "!!"
		 */
		function isFirstBangInBangBangExpression(node) {
			return (
				node &&
				node.type === "UnaryExpression" &&
				node.argument.operator === "!" &&
				node.argument &&
				node.argument.type === "UnaryExpression" &&
				node.argument.operator === "!"
			);
		}

		/**
		 * Checks if an override exists for a given operator.
		 * @param {string} operator Operator
		 * @returns {boolean} Whether or not an override has been provided for the operator
		 */
		function overrideExistsForOperator(operator) {
			return (
				options.overrides && Object.hasOwn(options.overrides, operator)
			);
		}

		/**
		 * Gets the value that the override was set to for this operator
		 * @param {string} operator Operator
		 * @returns {boolean} Whether or not an override enforces a space with this operator
		 */
		function overrideEnforcesSpaces(operator) {
			return options.overrides[operator];
		}

		/**
		 * Verify Unary Word Operator has spaces after the word operator
		 * @param {ASTnode} node AST node
		 * @param {Object} firstToken first token from the AST node
		 * @param {Object} secondToken second token from the AST node
		 * @param {string} word The word to be used for reporting
		 * @returns {void}
		 */
		function verifyWordHasSpaces(node, firstToken, secondToken, word) {
			if (secondToken.range[0] === firstToken.range[1]) {
				context.report({
					node,
					messageId: "wordOperator",
					data: {
						word,
					},
					fix(fixer) {
						return fixer.insertTextAfter(firstToken, " ");
					},
				});
			}
		}

		/**
		 * Verify Unary Word Operator doesn't have spaces after the word operator
		 * @param {ASTnode} node AST node
		 * @param {Object} firstToken first token from the AST node
		 * @param {Object} secondToken second token from the AST node
		 * @param {string} word The word to be used for reporting
		 * @returns {void}
		 */
		function verifyWordDoesntHaveSpaces(
			node,
			firstToken,
			secondToken,
			word,
		) {
			if (astUtils.canTokensBeAdjacent(firstToken, secondToken)) {
				if (secondToken.range[0] > firstToken.range[1]) {
					context.report({
						node,
						messageId: "unexpectedAfterWord",
						data: {
							word,
						},
						fix(fixer) {
							return fixer.removeRange([
								firstToken.range[1],
								secondToken.range[0],
							]);
						},
					});
				}
			}
		}

		/**
		 * Check Unary Word Operators for spaces after the word operator
		 * @param {ASTnode} node AST node
		 * @param {Object} firstToken first token from the AST node
		 * @param {Object} secondToken second token from the AST node
		 * @param {string} word The word to be used for reporting
		 * @returns {void}
		 */
		function checkUnaryWordOperatorForSpaces(
			node,
			firstToken,
			secondToken,
			word,
		) {
			if (overrideExistsForOperator(word)) {
				if (overrideEnforcesSpaces(word)) {
					verifyWordHasSpaces(node, firstToken, secondToken, word);
				} else {
					verifyWordDoesntHaveSpaces(
						node,
						firstToken,
						secondToken,
						word,
					);
				}
			} else if (options.words) {
				verifyWordHasSpaces(node, firstToken, secondToken, word);
			} else {
				verifyWordDoesntHaveSpaces(node, firstToken, secondToken, word);
			}
		}

		/**
		 * Verifies YieldExpressions satisfy spacing requirements
		 * @param {ASTnode} node AST node
		 * @returns {void}
		 */
		function checkForSpacesAfterYield(node) {
			const tokens = sourceCode.getFirstTokens(node, 3),
				word = "yield";

			if (!node.argument || node.delegate) {
				return;
			}

			checkUnaryWordOperatorForSpaces(node, tokens[0], tokens[1], word);
		}

		/**
		 * Verifies AwaitExpressions satisfy spacing requirements
		 * @param {ASTNode} node AwaitExpression AST node
		 * @returns {void}
		 */
		function checkForSpacesAfterAwait(node) {
			const tokens = sourceCode.getFirstTokens(node, 3);

			checkUnaryWordOperatorForSpaces(
				node,
				tokens[0],
				tokens[1],
				"await",
			);
		}

		/**
		 * Verifies UnaryExpression, UpdateExpression and NewExpression have spaces before or after the operator
		 * @param {ASTnode} node AST node
		 * @param {Object} firstToken First token in the expression
		 * @param {Object} secondToken Second token in the expression
		 * @returns {void}
		 */
		function verifyNonWordsHaveSpaces(node, firstToken, secondToken) {
			if (node.prefix) {
				if (isFirstBangInBangBangExpression(node)) {
					return;
				}
				if (firstToken.range[1] === secondToken.range[0]) {
					context.report({
						node,
						messageId: "operator",
						data: {
							operator: firstToken.value,
						},
						fix(fixer) {
							return fixer.insertTextAfter(firstToken, " ");
						},
					});
				}
			} else {
				if (firstToken.range[1] === secondToken.range[0]) {
					context.report({
						node,
						messageId: "beforeUnaryExpressions",
						data: {
							token: secondToken.value,
						},
						fix(fixer) {
							return fixer.insertTextBefore(secondToken, " ");
						},
					});
				}
			}
		}

		/**
		 * Verifies UnaryExpression, UpdateExpression and NewExpression don't have spaces before or after the operator
		 * @param {ASTnode} node AST node
		 * @param {Object} firstToken First token in the expression
		 * @param {Object} secondToken Second token in the expression
		 * @returns {void}
		 */
		function verifyNonWordsDontHaveSpaces(node, firstToken, secondToken) {
			if (node.prefix) {
				if (secondToken.range[0] > firstToken.range[1]) {
					context.report({
						node,
						messageId: "unexpectedAfter",
						data: {
							operator: firstToken.value,
						},
						fix(fixer) {
							if (
								astUtils.canTokensBeAdjacent(
									firstToken,
									secondToken,
								)
							) {
								return fixer.removeRange([
									firstToken.range[1],
									secondToken.range[0],
								]);
							}
							return null;
						},
					});
				}
			} else {
				if (secondToken.range[0] > firstToken.range[1]) {
					context.report({
						node,
						messageId: "unexpectedBefore",
						data: {
							operator: secondToken.value,
						},
						fix(fixer) {
							return fixer.removeRange([
								firstToken.range[1],
								secondToken.range[0],
							]);
						},
					});
				}
			}
		}

		/**
		 * Verifies UnaryExpression, UpdateExpression and NewExpression satisfy spacing requirements
		 * @param {ASTnode} node AST node
		 * @returns {void}
		 */
		function checkForSpaces(node) {
			const tokens =
				node.type === "UpdateExpression" && !node.prefix
					? sourceCode.getLastTokens(node, 2)
					: sourceCode.getFirstTokens(node, 2);
			const firstToken = tokens[0];
			const secondToken = tokens[1];

			if (
				(node.type === "NewExpression" || node.prefix) &&
				firstToken.type === "Keyword"
			) {
				checkUnaryWordOperatorForSpaces(
					node,
					firstToken,
					secondToken,
					firstToken.value,
				);
				return;
			}

			const operator = node.prefix ? tokens[0].value : tokens[1].value;

			if (overrideExistsForOperator(operator)) {
				if (overrideEnforcesSpaces(operator)) {
					verifyNonWordsHaveSpaces(node, firstToken, secondToken);
				} else {
					verifyNonWordsDontHaveSpaces(node, firstToken, secondToken);
				}
			} else if (options.nonwords) {
				verifyNonWordsHaveSpaces(node, firstToken, secondToken);
			} else {
				verifyNonWordsDontHaveSpaces(node, firstToken, secondToken);
			}
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			UnaryExpression: checkForSpaces,
			UpdateExpression: checkForSpaces,
			NewExpression: checkForSpaces,
			YieldExpression: checkForSpacesAfterYield,
			AwaitExpression: checkForSpacesAfterAwait,
		};
	},
};
<c쾾x+/**
 * @fileoverview Source code for spaced-comments rule
 * @author Gyandeep Singh
 * @deprecated in ESLint v8.53.0
 */
"use strict";

const escapeRegExp = require("escape-string-regexp");
const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Escapes the control characters of a given string.
 * @param {string} s A string to escape.
 * @returns {string} An escaped string.
 */
function escape(s) {
	return `(?:${escapeRegExp(s)})`;
}

/**
 * Escapes the control characters of a given string.
 * And adds a repeat flag.
 * @param {string} s A string to escape.
 * @returns {string} An escaped string.
 */
function escapeAndRepeat(s) {
	return `${escape(s)}+`;
}

/**
 * Parses `markers` option.
 * If markers don't include `"*"`, this adds `"*"` to allow JSDoc comments.
 * @param {string[]} [markers] A marker list.
 * @returns {string[]} A marker list.
 */
function parseMarkersOption(markers) {
	// `*` is a marker for JSDoc comments.
	if (!markers.includes("*")) {
		return markers.concat("*");
	}

	return markers;
}

/**
 * Creates string pattern for exceptions.
 * Generated pattern:
 *
 * 1. A space or an exception pattern sequence.
 * @param {string[]} exceptions An exception pattern list.
 * @returns {string} A regular expression string for exceptions.
 */
function createExceptionsPattern(exceptions) {
	let pattern = "";

	/*
	 * A space or an exception pattern sequence.
	 * []                 ==> "\s"
	 * ["-"]              ==> "(?:\s|\-+$)"
	 * ["-", "="]         ==> "(?:\s|(?:\-+|=+)$)"
	 * ["-", "=", "--=="] ==> "(?:\s|(?:\-+|=+|(?:\-\-==)+)$)" ==> https://jex.im/regulex/#!embed=false&flags=&re=(%3F%3A%5Cs%7C(%3F%3A%5C-%2B%7C%3D%2B%7C(%3F%3A%5C-%5C-%3D%3D)%2B)%24)
	 */
	if (exceptions.length === 0) {
		// a space.
		pattern += "\\s";
	} else {
		// a space or...
		pattern += "(?:\\s|";

		if (exceptions.length === 1) {
			// a sequence of the exception pattern.
			pattern += escapeAndRepeat(exceptions[0]);
		} else {
			// a sequence of one of the exception patterns.
			pattern += "(?:";
			pattern += exceptions.map(escapeAndRepeat).join("|");
			pattern += ")";
		}
		pattern += `(?:$|[${Array.from(astUtils.LINEBREAKS).join("")}]))`;
	}

	return pattern;
}

/**
 * Creates RegExp object for `always` mode.
 * Generated pattern for beginning of comment:
 *
 * 1. First, a marker or nothing.
 * 2. Next, a space or an exception pattern sequence.
 * @param {string[]} markers A marker list.
 * @param {string[]} exceptions An exception pattern list.
 * @returns {RegExp} A RegExp object for the beginning of a comment in `always` mode.
 */
function createAlwaysStylePattern(markers, exceptions) {
	let pattern = "^";

	/*
	 * A marker or nothing.
	 * ["*"]            ==> "\*?"
	 * ["*", "!"]       ==> "(?:\*|!)?"
	 * ["*", "/", "!<"] ==> "(?:\*|\/|(?:!<))?" ==> https://jex.im/regulex/#!embed=false&flags=&re=(%3F%3A%5C*%7C%5C%2F%7C(%3F%3A!%3C))%3F
	 */
	if (markers.length === 1) {
		// the marker.
		pattern += escape(markers[0]);
	} else {
		// one of markers.
		pattern += "(?:";
		pattern += markers.map(escape).join("|");
		pattern += ")";
	}

	pattern += "?"; // or nothing.
	pattern += createExceptionsPattern(exceptions);

	return new RegExp(pattern, "u");
}

/**
 * Creates RegExp object for `never` mode.
 * Generated pattern for beginning of comment:
 *
 * 1. First, a marker or nothing (captured).
 * 2. Next, a space or a tab.
 * @param {string[]} markers A marker list.
 * @returns {RegExp} A RegExp object for `never` mode.
 */
function createNeverStylePattern(markers) {
	const pattern = `^(${markers.map(escape).join("|")})?[ \t]+`;

	return new RegExp(pattern, "u");
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "spaced-comment",
						url: "https://eslint.style/rules/spaced-comment",
					},
				},
			],
		},
		type: "suggestion",

		docs: {
			description:
				"Enforce consistent spacing after the `//` or `/*` in a comment",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/spaced-comment",
		},

		fixable: "whitespace",

		schema: [
			{
				enum: ["always", "never"],
			},
			{
				type: "object",
				properties: {
					exceptions: {
						type: "array",
						items: {
							type: "string",
						},
					},
					markers: {
						type: "array",
						items: {
							type: "string",
						},
					},
					line: {
						type: "object",
						properties: {
							exceptions: {
								type: "array",
								items: {
									type: "string",
								},
							},
							markers: {
								type: "array",
								items: {
									type: "string",
								},
							},
						},
						additionalProperties: false,
					},
					block: {
						type: "object",
						properties: {
							exceptions: {
								type: "array",
								items: {
									type: "string",
								},
							},
							markers: {
								type: "array",
								items: {
									type: "string",
								},
							},
							balanced: {
								type: "boolean",
								default: false,
							},
						},
						additionalProperties: false,
					},
				},
				additionalProperties: false,
			},
		],

		messages: {
			unexpectedSpaceAfterMarker:
				"Unexpected space or tab after marker ({{refChar}}) in comment.",
			expectedExceptionAfter:
				"Expected exception block, space or tab after '{{refChar}}' in comment.",
			unexpectedSpaceBefore:
				"Unexpected space or tab before '*/' in comment.",
			unexpectedSpaceAfter:
				"Unexpected space or tab after '{{refChar}}' in comment.",
			expectedSpaceBefore:
				"Expected space or tab before '*/' in comment.",
			expectedSpaceAfter:
				"Expected space or tab after '{{refChar}}' in comment.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		// Unless the first option is never, require a space
		const requireSpace = context.options[0] !== "never";

		/*
		 * Parse the second options.
		 * If markers don't include `"*"`, it's added automatically for JSDoc
		 * comments.
		 */
		const config = context.options[1] || {};
		const balanced = config.block && config.block.balanced;

		const styleRules = ["block", "line"].reduce((rule, type) => {
			const markers = parseMarkersOption(
				(config[type] && config[type].markers) || config.markers || [],
			);
			const exceptions =
				(config[type] && config[type].exceptions) ||
				config.exceptions ||
				[];
			const endNeverPattern = "[ \t]+$";

			// Create RegExp object for valid patterns.
			rule[type] = {
				beginRegex: requireSpace
					? createAlwaysStylePattern(markers, exceptions)
					: createNeverStylePattern(markers),
				endRegex:
					balanced && requireSpace
						? new RegExp(
								`${createExceptionsPattern(exceptions)}$`,
								"u",
							)
						: new RegExp(endNeverPattern, "u"),
				hasExceptions: exceptions.length > 0,
				captureMarker: new RegExp(
					`^(${markers.map(escape).join("|")})`,
					"u",
				),
				markers: new Set(markers),
			};

			return rule;
		}, {});

		/**
		 * Reports a beginning spacing error with an appropriate message.
		 * @param {ASTNode} node A comment node to check.
		 * @param {string} messageId An error message to report.
		 * @param {Array} match An array of match results for markers.
		 * @param {string} refChar Character used for reference in the error message.
		 * @returns {void}
		 */
		function reportBegin(node, messageId, match, refChar) {
			const type = node.type.toLowerCase(),
				commentIdentifier = type === "block" ? "/*" : "//";

			context.report({
				node,
				fix(fixer) {
					const start = node.range[0];
					let end = start + 2;

					if (requireSpace) {
						if (match) {
							end += match[0].length;
						}
						return fixer.insertTextAfterRange([start, end], " ");
					}
					end += match[0].length;
					return fixer.replaceTextRange(
						[start, end],
						commentIdentifier + (match[1] ? match[1] : ""),
					);
				},
				messageId,
				data: { refChar },
			});
		}

		/**
		 * Reports an ending spacing error with an appropriate message.
		 * @param {ASTNode} node A comment node to check.
		 * @param {string} messageId An error message to report.
		 * @param {string} match An array of the matched whitespace characters.
		 * @returns {void}
		 */
		function reportEnd(node, messageId, match) {
			context.report({
				node,
				fix(fixer) {
					if (requireSpace) {
						return fixer.insertTextAfterRange(
							[node.range[0], node.range[1] - 2],
							" ",
						);
					}
					const end = node.range[1] - 2,
						start = end - match[0].length;

					return fixer.replaceTextRange([start, end], "");
				},
				messageId,
			});
		}

		/**
		 * Reports a given comment if it's invalid.
		 * @param {ASTNode} node a comment node to check.
		 * @returns {void}
		 */
		function checkCommentForSpace(node) {
			const type = node.type.toLowerCase(),
				rule = styleRules[type],
				commentIdentifier = type === "block" ? "/*" : "//";

			// Ignores empty comments and comments that consist only of a marker.
			if (node.value.length === 0 || rule.markers.has(node.value)) {
				return;
			}

			const beginMatch = rule.beginRegex.exec(node.value);
			const endMatch = rule.endRegex.exec(node.value);

			// Checks.
			if (requireSpace) {
				if (!beginMatch) {
					const hasMarker = rule.captureMarker.exec(node.value);
					const marker = hasMarker
						? commentIdentifier + hasMarker[0]
						: commentIdentifier;

					if (rule.hasExceptions) {
						reportBegin(
							node,
							"expectedExceptionAfter",
							hasMarker,
							marker,
						);
					} else {
						reportBegin(
							node,
							"expectedSpaceAfter",
							hasMarker,
							marker,
						);
					}
				}

				if (balanced && type === "block" && !endMatch) {
					reportEnd(node, "expectedSpaceBefore");
				}
			} else {
				if (beginMatch) {
					if (!beginMatch[1]) {
						reportBegin(
							node,
							"unexpectedSpaceAfter",
							beginMatch,
							commentIdentifier,
						);
					} else {
						reportBegin(
							node,
							"unexpectedSpaceAfterMarker",
							beginMatch,
							beginMatch[1],
						);
					}
				}

				if (balanced && type === "block" && endMatch) {
					reportEnd(node, "unexpectedSpaceBefore", endMatch);
				}
			}
		}

		return {
			Program() {
				const comments = sourceCode.getAllComments();

				comments
					.filter(token => token.type !== "Shebang")
					.forEach(checkCommentForSpace);
			},
		};
	},
};
'Yx$n/**
 * @fileoverview Rule to control usage of strict mode directives.
 * @author Brandon Mills
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Gets all of the Use Strict Directives in the Directive Prologue of a group of
 * statements.
 * @param {ASTNode[]} statements Statements in the program or function body.
 * @returns {ASTNode[]} All of the Use Strict Directives.
 */
function getUseStrictDirectives(statements) {
	const directives = [];

	for (let i = 0; i < statements.length; i++) {
		const statement = statements[i];

		if (
			statement.type === "ExpressionStatement" &&
			statement.expression.type === "Literal" &&
			statement.expression.value === "use strict"
		) {
			directives[i] = statement;
		} else {
			break;
		}
	}

	return directives;
}

/**
 * Checks whether a given parameter is a simple parameter.
 * @param {ASTNode} node A pattern node to check.
 * @returns {boolean} `true` if the node is an Identifier node.
 */
function isSimpleParameter(node) {
	return node.type === "Identifier";
}

/**
 * Checks whether a given parameter list is a simple parameter list.
 * @param {ASTNode[]} params A parameter list to check.
 * @returns {boolean} `true` if the every parameter is an Identifier node.
 */
function isSimpleParameterList(params) {
	return params.every(isSimpleParameter);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: ["safe"],

		docs: {
			description: "Require or disallow strict mode directives",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/strict",
		},

		schema: [
			{
				enum: ["never", "global", "function", "safe"],
			},
		],

		fixable: "code",
		messages: {
			function: "Use the function form of 'use strict'.",
			global: "Use the global form of 'use strict'.",
			multiple: "Multiple 'use strict' directives.",
			never: "Strict mode is not permitted.",
			unnecessary: "Unnecessary 'use strict' directive.",
			module: "'use strict' is unnecessary inside of modules.",
			implied:
				"'use strict' is unnecessary when implied strict mode is enabled.",
			unnecessaryInClasses:
				"'use strict' is unnecessary inside of classes.",
			nonSimpleParameterList:
				"'use strict' directive inside a function with non-simple parameter list throws a syntax error since ES2016.",
			wrap: "Wrap {{name}} in a function with 'use strict' directive.",
		},
	},

	create(context) {
		const ecmaFeatures =
				context.languageOptions.parserOptions.ecmaFeatures || {},
			scopes = [],
			classScopes = [];
		let [mode] = context.options;

		if (ecmaFeatures.impliedStrict) {
			mode = "implied";
		} else if (mode === "safe") {
			mode =
				ecmaFeatures.globalReturn ||
				context.languageOptions.sourceType === "commonjs"
					? "global"
					: "function";
		}

		/**
		 * Determines whether a reported error should be fixed, depending on the error type.
		 * @param {string} errorType The type of error
		 * @returns {boolean} `true` if the reported error should be fixed
		 */
		function shouldFix(errorType) {
			return (
				errorType === "multiple" ||
				errorType === "unnecessary" ||
				errorType === "module" ||
				errorType === "implied" ||
				errorType === "unnecessaryInClasses"
			);
		}

		/**
		 * Gets a fixer function to remove a given 'use strict' directive.
		 * @param {ASTNode} node The directive that should be removed
		 * @returns {Function} A fixer function
		 */
		function getFixFunction(node) {
			return fixer => fixer.remove(node);
		}

		/**
		 * Report a slice of an array of nodes with a given message.
		 * @param {ASTNode[]} nodes Nodes.
		 * @param {string} start Index to start from.
		 * @param {string} end Index to end before.
		 * @param {string} messageId Message to display.
		 * @param {boolean} fix `true` if the directive should be fixed (i.e. removed)
		 * @returns {void}
		 */
		function reportSlice(nodes, start, end, messageId, fix) {
			nodes.slice(start, end).forEach(node => {
				context.report({
					node,
					messageId,
					fix: fix ? getFixFunction(node) : null,
				});
			});
		}

		/**
		 * Report all nodes in an array with a given message.
		 * @param {ASTNode[]} nodes Nodes.
		 * @param {string} messageId Message id to display.
		 * @param {boolean} fix `true` if the directive should be fixed (i.e. removed)
		 * @returns {void}
		 */
		function reportAll(nodes, messageId, fix) {
			reportSlice(nodes, 0, nodes.length, messageId, fix);
		}

		/**
		 * Report all nodes in an array, except the first, with a given message.
		 * @param {ASTNode[]} nodes Nodes.
		 * @param {string} messageId Message id to display.
		 * @param {boolean} fix `true` if the directive should be fixed (i.e. removed)
		 * @returns {void}
		 */
		function reportAllExceptFirst(nodes, messageId, fix) {
			reportSlice(nodes, 1, nodes.length, messageId, fix);
		}

		/**
		 * Entering a function in 'function' mode pushes a new nested scope onto the
		 * stack. The new scope is true if the nested function is strict mode code.
		 * @param {ASTNode} node The function declaration or expression.
		 * @param {ASTNode[]} useStrictDirectives The Use Strict Directives of the node.
		 * @returns {void}
		 */
		function enterFunctionInFunctionMode(node, useStrictDirectives) {
			const isInClass = classScopes.length > 0,
				isParentGlobal =
					scopes.length === 0 && classScopes.length === 0,
				isParentStrict = scopes.length > 0 && scopes.at(-1),
				isStrict = useStrictDirectives.length > 0;

			if (isStrict) {
				if (!isSimpleParameterList(node.params)) {
					context.report({
						node: useStrictDirectives[0],
						messageId: "nonSimpleParameterList",
					});
				} else if (isParentStrict) {
					context.report({
						node: useStrictDirectives[0],
						messageId: "unnecessary",
						fix: getFixFunction(useStrictDirectives[0]),
					});
				} else if (isInClass) {
					context.report({
						node: useStrictDirectives[0],
						messageId: "unnecessaryInClasses",
						fix: getFixFunction(useStrictDirectives[0]),
					});
				}

				reportAllExceptFirst(useStrictDirectives, "multiple", true);
			} else if (isParentGlobal) {
				if (isSimpleParameterList(node.params)) {
					context.report({ node, messageId: "function" });
				} else {
					context.report({
						node,
						messageId: "wrap",
						data: { name: astUtils.getFunctionNameWithKind(node) },
					});
				}
			}

			scopes.push(isParentStrict || isStrict);
		}

		/**
		 * Exiting a function in 'function' mode pops its scope off the stack.
		 * @returns {void}
		 */
		function exitFunctionInFunctionMode() {
			scopes.pop();
		}

		/**
		 * Enter a function and either:
		 * - Push a new nested scope onto the stack (in 'function' mode).
		 * - Report all the Use Strict Directives (in the other modes).
		 * @param {ASTNode} node The function declaration or expression.
		 * @returns {void}
		 */
		function enterFunction(node) {
			const isBlock = node.body.type === "BlockStatement",
				useStrictDirectives = isBlock
					? getUseStrictDirectives(node.body.body)
					: [];

			if (mode === "function") {
				enterFunctionInFunctionMode(node, useStrictDirectives);
			} else if (useStrictDirectives.length > 0) {
				if (isSimpleParameterList(node.params)) {
					reportAll(useStrictDirectives, mode, shouldFix(mode));
				} else {
					context.report({
						node: useStrictDirectives[0],
						messageId: "nonSimpleParameterList",
					});
					reportAllExceptFirst(useStrictDirectives, "multiple", true);
				}
			}
		}

		/** @type {import('../types').Rule.RuleListener} */
		const rule = {
			Program(node) {
				const useStrictDirectives = getUseStrictDirectives(node.body);

				if (node.sourceType === "module") {
					mode = "module";
				}

				if (mode === "global") {
					if (
						node.body.length > 0 &&
						useStrictDirectives.length === 0
					) {
						/*
						 * Report the range as v9 does
						 */
						context.report({
							loc: {
								start: node.body[0].loc.start,
								end: node.body.at(-1).loc.end,
							},
							messageId: "global",
						});
					}
					reportAllExceptFirst(useStrictDirectives, "multiple", true);
				} else {
					reportAll(useStrictDirectives, mode, shouldFix(mode));
				}
			},
			FunctionDeclaration: enterFunction,
			FunctionExpression: enterFunction,
			ArrowFunctionExpression: enterFunction,
		};

		if (mode === "function") {
			Object.assign(rule, {
				// Inside of class bodies are always strict mode.
				ClassBody() {
					classScopes.push(true);
				},
				"ClassBody:exit"() {
					classScopes.pop();
				},

				"FunctionDeclaration:exit": exitFunctionInFunctionMode,
				"FunctionExpression:exit": exitFunctionInFunctionMode,
				"ArrowFunctionExpression:exit": exitFunctionInFunctionMode,
			});
		}

		return rule;
	},
};
LxW/**
 * @fileoverview Rule to enforce spacing around colons of switch statements.
 * @author Toru Nagashima
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "switch-colon-spacing",
						url: "https://eslint.style/rules/switch-colon-spacing",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Enforce spacing around colons of switch statements",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/switch-colon-spacing",
		},

		schema: [
			{
				type: "object",
				properties: {
					before: { type: "boolean", default: false },
					after: { type: "boolean", default: true },
				},
				additionalProperties: false,
			},
		],
		fixable: "whitespace",
		messages: {
			expectedBefore: "Expected space(s) before this colon.",
			expectedAfter: "Expected space(s) after this colon.",
			unexpectedBefore: "Unexpected space(s) before this colon.",
			unexpectedAfter: "Unexpected space(s) after this colon.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const options = context.options[0] || {};
		const beforeSpacing = options.before === true; // false by default
		const afterSpacing = options.after !== false; // true by default

		/**
		 * Check whether the spacing between the given 2 tokens is valid or not.
		 * @param {Token} left The left token to check.
		 * @param {Token} right The right token to check.
		 * @param {boolean} expected The expected spacing to check. `true` if there should be a space.
		 * @returns {boolean} `true` if the spacing between the tokens is valid.
		 */
		function isValidSpacing(left, right, expected) {
			return (
				astUtils.isClosingBraceToken(right) ||
				!astUtils.isTokenOnSameLine(left, right) ||
				sourceCode.isSpaceBetween(left, right) === expected
			);
		}

		/**
		 * Check whether comments exist between the given 2 tokens.
		 * @param {Token} left The left token to check.
		 * @param {Token} right The right token to check.
		 * @returns {boolean} `true` if comments exist between the given 2 tokens.
		 */
		function commentsExistBetween(left, right) {
			return (
				sourceCode.getFirstTokenBetween(left, right, {
					includeComments: true,
					filter: astUtils.isCommentToken,
				}) !== null
			);
		}

		/**
		 * Fix the spacing between the given 2 tokens.
		 * @param {RuleFixer} fixer The fixer to fix.
		 * @param {Token} left The left token of fix range.
		 * @param {Token} right The right token of fix range.
		 * @param {boolean} spacing The spacing style. `true` if there should be a space.
		 * @returns {Fix|null} The fix object.
		 */
		function fix(fixer, left, right, spacing) {
			if (commentsExistBetween(left, right)) {
				return null;
			}
			if (spacing) {
				return fixer.insertTextAfter(left, " ");
			}
			return fixer.removeRange([left.range[1], right.range[0]]);
		}

		return {
			SwitchCase(node) {
				const colonToken = astUtils.getSwitchCaseColonToken(
					node,
					sourceCode,
				);
				const beforeToken = sourceCode.getTokenBefore(colonToken);
				const afterToken = sourceCode.getTokenAfter(colonToken);

				if (!isValidSpacing(beforeToken, colonToken, beforeSpacing)) {
					context.report({
						node,
						loc: colonToken.loc,
						messageId: beforeSpacing
							? "expectedBefore"
							: "unexpectedBefore",
						fix: fixer =>
							fix(fixer, beforeToken, colonToken, beforeSpacing),
					});
				}
				if (!isValidSpacing(colonToken, afterToken, afterSpacing)) {
					context.report({
						node,
						loc: colonToken.loc,
						messageId: afterSpacing
							? "expectedAfter"
							: "unexpectedAfter",
						fix: fixer =>
							fix(fixer, colonToken, afterToken, afterSpacing),
					});
				}
			},
		};
	},
};
K~õjxZ/**
 * @fileoverview Rule to enforce description with the `Symbol` object
 * @author Jarek Rencz
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description: "Require symbol descriptions",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/symbol-description",
		},
		fixable: null,
		schema: [],
		messages: {
			expected: "Expected Symbol to have a description.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		/**
		 * Reports if node does not conform the rule in case rule is set to
		 * report missing description
		 * @param {ASTNode} node A CallExpression node to check.
		 * @returns {void}
		 */
		function checkArgument(node) {
			if (node.arguments.length === 0) {
				context.report({
					node,
					messageId: "expected",
				});
			}
		}

		return {
			"Program:exit"(node) {
				const scope = sourceCode.getScope(node);
				const variable = astUtils.getVariableByName(scope, "Symbol");

				if (variable && variable.defs.length === 0) {
					variable.references.forEach(reference => {
						const idNode = reference.identifier;

						if (astUtils.isCallee(idNode)) {
							checkArgument(idNode.parent);
						}
					});
				}
			},
		};
	},
};
0ox/**
 * @fileoverview Rule to enforce spacing around embedded expressions of template strings
 * @author Toru Nagashima
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "template-curly-spacing",
						url: "https://eslint.style/rules/template-curly-spacing",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description:
				"Require or disallow spacing around embedded expressions of template strings",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/template-curly-spacing",
		},

		fixable: "whitespace",

		schema: [{ enum: ["always", "never"] }],
		messages: {
			expectedBefore: "Expected space(s) before '}'.",
			expectedAfter: "Expected space(s) after '${'.",
			unexpectedBefore: "Unexpected space(s) before '}'.",
			unexpectedAfter: "Unexpected space(s) after '${'.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;
		const always = context.options[0] === "always";

		/**
		 * Checks spacing before `}` of a given token.
		 * @param {Token} token A token to check. This is a Template token.
		 * @returns {void}
		 */
		function checkSpacingBefore(token) {
			if (!token.value.startsWith("}")) {
				return; // starts with a backtick, this is the first template element in the template literal
			}

			const prevToken = sourceCode.getTokenBefore(token, {
					includeComments: true,
				}),
				hasSpace = sourceCode.isSpaceBetween(prevToken, token);

			if (!astUtils.isTokenOnSameLine(prevToken, token)) {
				return;
			}

			if (always && !hasSpace) {
				context.report({
					loc: {
						start: token.loc.start,
						end: {
							line: token.loc.start.line,
							column: token.loc.start.column + 1,
						},
					},
					messageId: "expectedBefore",
					fix: fixer => fixer.insertTextBefore(token, " "),
				});
			}

			if (!always && hasSpace) {
				context.report({
					loc: {
						start: prevToken.loc.end,
						end: token.loc.start,
					},
					messageId: "unexpectedBefore",
					fix: fixer =>
						fixer.removeRange([prevToken.range[1], token.range[0]]),
				});
			}
		}

		/**
		 * Checks spacing after `${` of a given token.
		 * @param {Token} token A token to check. This is a Template token.
		 * @returns {void}
		 */
		function checkSpacingAfter(token) {
			if (!token.value.endsWith("${")) {
				return; // ends with a backtick, this is the last template element in the template literal
			}

			const nextToken = sourceCode.getTokenAfter(token, {
					includeComments: true,
				}),
				hasSpace = sourceCode.isSpaceBetween(token, nextToken);

			if (!astUtils.isTokenOnSameLine(token, nextToken)) {
				return;
			}

			if (always && !hasSpace) {
				context.report({
					loc: {
						start: {
							line: token.loc.end.line,
							column: token.loc.end.column - 2,
						},
						end: token.loc.end,
					},
					messageId: "expectedAfter",
					fix: fixer => fixer.insertTextAfter(token, " "),
				});
			}

			if (!always && hasSpace) {
				context.report({
					loc: {
						start: token.loc.end,
						end: nextToken.loc.start,
					},
					messageId: "unexpectedAfter",
					fix: fixer =>
						fixer.removeRange([token.range[1], nextToken.range[0]]),
				});
			}
		}

		return {
			TemplateElement(node) {
				const token = sourceCode.getFirstToken(node);

				checkSpacingBefore(token);
				checkSpacingAfter(token);
			},
		};
	},
};
Ʀx/**
 * @fileoverview Rule to check spacing between template tags and their literals
 * @author Jonathan Wilsson
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "template-tag-spacing",
						url: "https://eslint.style/rules/template-tag-spacing",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description:
				"Require or disallow spacing between template tags and their literals",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/template-tag-spacing",
		},

		fixable: "whitespace",

		schema: [{ enum: ["always", "never"] }],
		messages: {
			unexpected:
				"Unexpected space between template tag and template literal.",
			missing: "Missing space between template tag and template literal.",
		},
	},

	create(context) {
		const never = context.options[0] !== "always";
		const sourceCode = context.sourceCode;

		/**
		 * Check if a space is present between a template tag and its literal
		 * @param {ASTNode} node node to evaluate
		 * @returns {void}
		 * @private
		 */
		function checkSpacing(node) {
			const tagToken = sourceCode.getTokenBefore(node.quasi);
			const literalToken = sourceCode.getFirstToken(node.quasi);
			const hasWhitespace = sourceCode.isSpaceBetween(
				tagToken,
				literalToken,
			);

			if (never && hasWhitespace) {
				context.report({
					node,
					loc: {
						start: tagToken.loc.end,
						end: literalToken.loc.start,
					},
					messageId: "unexpected",
					fix(fixer) {
						const comments = sourceCode.getCommentsBefore(
							node.quasi,
						);

						// Don't fix anything if there's a single line comment after the template tag
						if (comments.some(comment => comment.type === "Line")) {
							return null;
						}

						return fixer.replaceTextRange(
							[tagToken.range[1], literalToken.range[0]],
							comments.reduce(
								(text, comment) =>
									text + sourceCode.getText(comment),
								"",
							),
						);
					},
				});
			} else if (!never && !hasWhitespace) {
				context.report({
					node,
					loc: {
						start: node.loc.start,
						end: literalToken.loc.start,
					},
					messageId: "missing",
					fix(fixer) {
						return fixer.insertTextAfter(tagToken, " ");
					},
				});
			}
		}

		return {
			TaggedTemplateExpression: checkSpacing,
		};
	},
};
c*fkxK/**
 * @fileoverview Require or disallow Unicode BOM
 * @author Andrew Johnston <https://github.com/ehjay>
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "layout",

		defaultOptions: ["never"],

		docs: {
			description: "Require or disallow Unicode byte order mark (BOM)",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/unicode-bom",
		},

		fixable: "whitespace",

		schema: [
			{
				enum: ["always", "never"],
			},
		],
		messages: {
			expected: "Expected Unicode BOM (Byte Order Mark).",
			unexpected: "Unexpected Unicode BOM (Byte Order Mark).",
		},
	},

	create(context) {
		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			Program: function checkUnicodeBOM(node) {
				const sourceCode = context.sourceCode,
					location = { column: 0, line: 1 };
				const [requireBOM] = context.options;

				if (!sourceCode.hasBOM && requireBOM === "always") {
					context.report({
						node,
						loc: location,
						messageId: "expected",
						fix(fixer) {
							return fixer.insertTextBeforeRange(
								[0, 1],
								"\uFEFF",
							);
						},
					});
				} else if (sourceCode.hasBOM && requireBOM === "never") {
					context.report({
						node,
						loc: location,
						messageId: "unexpected",
						fix(fixer) {
							return fixer.removeRange([-1, 0]);
						},
					});
				}
			},
		};
	},
};
CPɡxB/**
 * @fileoverview Rule to flag comparisons to the value NaN
 * @author James Allardice
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Determines if the given node is a NaN `Identifier` node.
 * @param {ASTNode|null} node The node to check.
 * @param {SourceCode} sourceCode The source code object.
 * @returns {boolean} `true` if the node is a global 'NaN' identifier.
 */
function isNaNIdentifier(node, sourceCode) {
	if (!node) {
		return false;
	}

	const nodeToCheck =
		node.type === "SequenceExpression" ? node.expressions.at(-1) : node;

	if (astUtils.isSpecificId(nodeToCheck, "NaN")) {
		return sourceCode.isGlobalReference(nodeToCheck);
	}

	if (astUtils.isSpecificMemberAccess(nodeToCheck, "Number", "NaN")) {
		const objectNode = astUtils.skipChainExpression(nodeToCheck).object;
		return sourceCode.isGlobalReference(objectNode);
	}

	return false;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		hasSuggestions: true,
		type: "problem",

		docs: {
			description: "Require calls to `isNaN()` when checking for `NaN`",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/use-isnan",
		},

		schema: [
			{
				type: "object",
				properties: {
					enforceForSwitchCase: {
						type: "boolean",
					},
					enforceForIndexOf: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		defaultOptions: [
			{
				enforceForIndexOf: false,
				enforceForSwitchCase: true,
			},
		],

		messages: {
			comparisonWithNaN: "Use the isNaN function to compare with NaN.",
			switchNaN:
				"'switch(NaN)' can never match a case clause. Use Number.isNaN instead of the switch.",
			caseNaN:
				"'case NaN' can never match. Use Number.isNaN before the switch.",
			indexOfNaN:
				"Array prototype method '{{ methodName }}' cannot find NaN.",
			replaceWithIsNaN: "Replace with Number.isNaN.",
			replaceWithCastingAndIsNaN:
				"Replace with Number.isNaN and cast to a Number.",
			replaceWithFindIndex:
				"Replace with Array.prototype.{{ methodName }}.",
		},
	},

	create(context) {
		const [{ enforceForIndexOf, enforceForSwitchCase }] = context.options;
		const sourceCode = context.sourceCode;

		const fixableOperators = new Set(["==", "===", "!=", "!=="]);
		const castableOperators = new Set(["==", "!="]);

		/**
		 * Get a fixer for a binary expression that compares to NaN.
		 * @param  {ASTNode} node The node to fix.
		 * @param {function(string): string} wrapValue A function that wraps the compared value with a fix.
		 * @returns {function(Fixer): Fix} The fixer function.
		 */
		function getBinaryExpressionFixer(node, wrapValue) {
			return fixer => {
				const comparedValue = isNaNIdentifier(node.left, sourceCode)
					? node.right
					: node.left;
				const shouldWrap = comparedValue.type === "SequenceExpression";
				const shouldNegate = node.operator[0] === "!";

				const negation = shouldNegate ? "!" : "";
				let comparedValueText = sourceCode.getText(comparedValue);

				if (shouldWrap) {
					comparedValueText = `(${comparedValueText})`;
				}

				const fixedValue = wrapValue(comparedValueText);

				return fixer.replaceText(node, `${negation}${fixedValue}`);
			};
		}

		/**
		 * Checks the given `BinaryExpression` node for `foo === NaN` and other comparisons.
		 * @param {ASTNode} node The node to check.
		 * @returns {void}
		 */
		function checkBinaryExpression(node) {
			if (
				/^(?:[<>]|[!=]=)=?$/u.test(node.operator) &&
				(isNaNIdentifier(node.left, sourceCode) ||
					isNaNIdentifier(node.right, sourceCode))
			) {
				const suggestedFixes = [];
				const NaNNode = isNaNIdentifier(node.left, sourceCode)
					? node.left
					: node.right;

				const isSequenceExpression =
					NaNNode.type === "SequenceExpression";
				const isSuggestable =
					fixableOperators.has(node.operator) &&
					!isSequenceExpression;
				const isCastable = castableOperators.has(node.operator);

				if (isSuggestable) {
					suggestedFixes.push({
						messageId: "replaceWithIsNaN",
						fix: getBinaryExpressionFixer(
							node,
							value => `Number.isNaN(${value})`,
						),
					});

					if (isCastable) {
						suggestedFixes.push({
							messageId: "replaceWithCastingAndIsNaN",
							fix: getBinaryExpressionFixer(
								node,
								value => `Number.isNaN(Number(${value}))`,
							),
						});
					}
				}

				context.report({
					node,
					messageId: "comparisonWithNaN",
					suggest: suggestedFixes,
				});
			}
		}

		/**
		 * Checks the discriminant and all case clauses of the given `SwitchStatement` node for `switch(NaN)` and `case NaN:`
		 * @param {ASTNode} node The node to check.
		 * @returns {void}
		 */
		function checkSwitchStatement(node) {
			if (isNaNIdentifier(node.discriminant, sourceCode)) {
				context.report({ node, messageId: "switchNaN" });
			}

			for (const switchCase of node.cases) {
				if (isNaNIdentifier(switchCase.test, sourceCode)) {
					context.report({ node: switchCase, messageId: "caseNaN" });
				}
			}
		}

		/**
		 * Checks the given `CallExpression` node for `.indexOf(NaN)` and `.lastIndexOf(NaN)`.
		 * @param {ASTNode} node The node to check.
		 * @returns {void}
		 */
		function checkCallExpression(node) {
			const callee = astUtils.skipChainExpression(node.callee);

			if (callee.type === "MemberExpression") {
				const methodName = astUtils.getStaticPropertyName(callee);

				if (
					(methodName === "indexOf" ||
						methodName === "lastIndexOf") &&
					node.arguments.length <= 2 &&
					isNaNIdentifier(node.arguments[0], sourceCode)
				) {
					/*
					 * To retain side effects, it's essential to address `NaN` beforehand, which
					 * is not possible with fixes like `arr.findIndex(Number.isNaN)`.
					 */
					const isSuggestable =
						node.arguments[0].type !== "SequenceExpression" &&
						!node.arguments[1];
					const suggestedFixes = [];

					if (isSuggestable) {
						const shouldWrap = callee.computed;
						const findIndexMethod =
							methodName === "indexOf"
								? "findIndex"
								: "findLastIndex";
						const propertyName = shouldWrap
							? `"${findIndexMethod}"`
							: findIndexMethod;

						suggestedFixes.push({
							messageId: "replaceWithFindIndex",
							data: { methodName: findIndexMethod },
							fix: fixer => [
								fixer.replaceText(
									callee.property,
									propertyName,
								),
								fixer.replaceText(
									node.arguments[0],
									"Number.isNaN",
								),
							],
						});
					}

					context.report({
						node,
						messageId: "indexOfNaN",
						data: { methodName },
						suggest: suggestedFixes,
					});
				}
			}
		}

		const listeners = {
			BinaryExpression: checkBinaryExpression,
		};

		if (enforceForSwitchCase) {
			listeners.SwitchStatement = checkSwitchStatement;
		}

		if (enforceForIndexOf) {
			listeners.CallExpression = checkCallExpression;
		}

		return listeners;
	},
};
xY100644 ast-utils.js (Ҿ6EՔHE>&4p100644 char-source.js z%{3aOG:=U100644 code-path-utils.js VFFoz?=t^%3	(]100644 fix-tracker.js W!q{WX{шFUk!m100644 keywords.js n݌ĤS_Y100644 lazy-loading-rule-map.js 3	[o}{100644 regular-expressions.js meKnO\{	*ס
8"40000 unicode ?4<ORazڶ(x   /**
 * @fileoverview Common utils for AST.
 * @author Gyandeep Singh
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const { KEYS: eslintVisitorKeys } = require("eslint-visitor-keys");
const esutils = require("esutils");
const espree = require("espree");
const escapeRegExp = require("escape-string-regexp");
const {
	breakableTypePattern,
	createGlobalLinebreakMatcher,
	lineBreakPattern,
	shebangPattern,
} = require("../../shared/ast-utils");
const globals = require("../../../conf/globals");
const { LATEST_ECMA_VERSION } = require("../../../conf/ecma-version");

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @typedef {import("eslint-scope").Scope} Scope */
/** @typedef {import("eslint-scope").Variable} Variable */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const anyFunctionPattern =
	/^(?:Function(?:Declaration|Expression)|ArrowFunctionExpression)$/u;
const anyLoopPattern = /^(?:DoWhile|For|ForIn|ForOf|While)Statement$/u;
const arrayMethodWithThisArgPattern =
	/^(?:every|filter|find(?:Last)?(?:Index)?|flatMap|forEach|map|some)$/u;
const arrayOrTypedArrayPattern = /Array$/u;
const bindOrCallOrApplyPattern = /^(?:bind|call|apply)$/u;
const thisTagPattern = /^[\s*]*@this/mu;

const COMMENTS_IGNORE_PATTERN =
	/^\s*(?:eslint|jshint\s+|jslint\s+|istanbul\s+|globals?\s+|exported\s+|jscs)/u;
const ESLINT_DIRECTIVE_PATTERN = /^(?:eslint[- ]|(?:globals?|exported) )/u;
const LINEBREAKS = new Set(["\r\n", "\r", "\n", "\u2028", "\u2029"]);

// A set of node types that can contain a list of statements
const STATEMENT_LIST_PARENTS = new Set([
	"Program",
	"BlockStatement",
	"StaticBlock",
	"SwitchCase",
]);
const LEXICAL_DECLARATION_KINDS = new Set([
	"let",
	"const",
	"using",
	"await using",
]);

const DECIMAL_INTEGER_PATTERN = /^(?:0|0[0-7]*[89]\d*|[1-9](?:_?\d)*)$/u;

// Tests the presence of at least one LegacyOctalEscapeSequence or NonOctalDecimalEscapeSequence in a raw string
const OCTAL_OR_NON_OCTAL_DECIMAL_ESCAPE_PATTERN =
	/^(?:[^\\]|\\.)*\\(?:[1-9]|0\d)/su;

const LOGICAL_ASSIGNMENT_OPERATORS = new Set(["&&=", "||=", "??="]);

/**
 * All builtin global variables defined in the latest ECMAScript specification.
 * @type {Record<string,boolean>} Key is the name of the variable. Value is `true` if the variable is considered writable, `false` otherwise.
 */
const ECMASCRIPT_GLOBALS = globals[`es${LATEST_ECMA_VERSION}`];

/**
 * Checks reference if is non initializer and writable.
 * @param {Reference} reference A reference to check.
 * @param {number} index The index of the reference in the references.
 * @param {Reference[]} references The array that the reference belongs to.
 * @returns {boolean} Success/Failure
 * @private
 */
function isModifyingReference(reference, index, references) {
	const identifier = reference.identifier;

	/*
	 * Destructuring assignments can have multiple default value, so
	 * possibly there are multiple writeable references for the same
	 * identifier.
	 */
	const modifyingDifferentIdentifier =
		index === 0 || references[index - 1].identifier !== identifier;

	return (
		identifier &&
		reference.init === false &&
		reference.isWrite() &&
		modifyingDifferentIdentifier
	);
}

/**
 * Checks whether the given string starts with uppercase or not.
 * @param {string} s The string to check.
 * @returns {boolean} `true` if the string starts with uppercase.
 */
function startsWithUpperCase(s) {
	return s[0] !== s[0].toLocaleLowerCase();
}

/**
 * Checks whether or not a node is a constructor.
 * @param {ASTNode} node A function node to check.
 * @returns {boolean} Whether or not a node is a constructor.
 */
function isES5Constructor(node) {
	return node.id && startsWithUpperCase(node.id.name);
}

/**
 * Finds a function node from ancestors of a node.
 * @param {ASTNode} node A start node to find.
 * @returns {Node|null} A found function node.
 */
function getUpperFunction(node) {
	for (
		let currentNode = node;
		currentNode;
		currentNode = currentNode.parent
	) {
		if (anyFunctionPattern.test(currentNode.type)) {
			return currentNode;
		}
	}
	return null;
}

/**
 * Checks whether a given node is a function node or not.
 * The following types are function nodes:
 *
 * - ArrowFunctionExpression
 * - FunctionDeclaration
 * - FunctionExpression
 * @param {ASTNode|null} node A node to check.
 * @returns {boolean} `true` if the node is a function node.
 */
function isFunction(node) {
	return Boolean(node && anyFunctionPattern.test(node.type));
}

/**
 * Checks whether a given node is a loop node or not.
 * The following types are loop nodes:
 *
 * - DoWhileStatement
 * - ForInStatement
 * - ForOfStatement
 * - ForStatement
 * - WhileStatement
 * @param {ASTNode|null} node A node to check.
 * @returns {boolean} `true` if the node is a loop node.
 */
function isLoop(node) {
	return Boolean(node && anyLoopPattern.test(node.type));
}

/**
 * Checks whether the given node is in a loop or not.
 * @param {ASTNode} node The node to check.
 * @returns {boolean} `true` if the node is in a loop.
 */
function isInLoop(node) {
	for (
		let currentNode = node;
		currentNode && !isFunction(currentNode);
		currentNode = currentNode.parent
	) {
		if (isLoop(currentNode)) {
			return true;
		}
	}

	return false;
}

/**
 * Determines whether the given node is a `null` literal.
 * @param {ASTNode} node The node to check
 * @returns {boolean} `true` if the node is a `null` literal
 */
function isNullLiteral(node) {
	/*
	 * Checking `node.value === null` does not guarantee that a literal is a null literal.
	 * When parsing values that cannot be represented in the current environment (e.g. unicode
	 * regexes in Node 4), `node.value` is set to `null` because it wouldn't be possible to
	 * set `node.value` to a unicode regex. To make sure a literal is actually `null`, check
	 * `node.regex` instead. Also see: https://github.com/eslint/eslint/issues/8020
	 */
	return (
		node.type === "Literal" &&
		node.value === null &&
		!node.regex &&
		!node.bigint
	);
}

/**
 * Checks whether or not a node is `null` or `undefined`.
 * @param {ASTNode} node A node to check.
 * @returns {boolean} Whether or not the node is a `null` or `undefined`.
 * @public
 */
function isNullOrUndefined(node) {
	return (
		isNullLiteral(node) ||
		(node.type === "Identifier" && node.name === "undefined") ||
		(node.type === "UnaryExpression" && node.operator === "void")
	);
}

/**
 * Checks whether or not a node is callee.
 * @param {ASTNode} node A node to check.
 * @returns {boolean} Whether or not the node is callee.
 */
function isCallee(node) {
	return node.parent.type === "CallExpression" && node.parent.callee === node;
}

/**
 * Returns the result of the string conversion applied to the evaluated value of the given expression node,
 * if it can be determined statically.
 *
 * This function returns a `string` value for all `Literal` nodes and simple `TemplateLiteral` nodes only.
 * In all other cases, this function returns `null`.
 * @param {ASTNode} node Expression node.
 * @returns {string|null} String value if it can be determined. Otherwise, `null`.
 */
function getStaticStringValue(node) {
	switch (node.type) {
		case "Literal":
			if (node.value === null) {
				if (isNullLiteral(node)) {
					return String(node.value); // "null"
				}
				if (node.regex) {
					return `/${node.regex.pattern}/${node.regex.flags}`;
				}
				if (node.bigint) {
					return node.bigint;
				}

				// Otherwise, this is an unknown literal. The function will return null.
			} else {
				return String(node.value);
			}
			break;
		case "TemplateLiteral":
			if (node.expressions.length === 0 && node.quasis.length === 1) {
				return node.quasis[0].value.cooked;
			}
			break;

		// no default
	}

	return null;
}

/**
 * Gets the property name of a given node.
 * The node can be a MemberExpression, a Property, or a MethodDefinition.
 *
 * If the name is dynamic, this returns `null`.
 *
 * For examples:
 *
 *     a.b           // => "b"
 *     a["b"]        // => "b"
 *     a['b']        // => "b"
 *     a[`b`]        // => "b"
 *     a[100]        // => "100"
 *     a[b]          // => null
 *     a["a" + "b"]  // => null
 *     a[tag`b`]     // => null
 *     a[`${b}`]     // => null
 *
 *     let a = {b: 1}            // => "b"
 *     let a = {["b"]: 1}        // => "b"
 *     let a = {['b']: 1}        // => "b"
 *     let a = {[`b`]: 1}        // => "b"
 *     let a = {[100]: 1}        // => "100"
 *     let a = {[b]: 1}          // => null
 *     let a = {["a" + "b"]: 1}  // => null
 *     let a = {[tag`b`]: 1}     // => null
 *     let a = {[`${b}`]: 1}     // => null
 * @param {ASTNode} node The node to get.
 * @returns {string|null} The property name if static. Otherwise, null.
 */
function getStaticPropertyName(node) {
	let prop;

	switch (node && node.type) {
		case "ChainExpression":
			return getStaticPropertyName(node.expression);

		case "Property":
		case "PropertyDefinition":
		case "MethodDefinition":
		case "TSPropertySignature":
		case "TSMethodSignature":
			prop = node.key;
			break;

		case "MemberExpression":
			prop = node.property;
			break;

		// no default
	}

	if (prop) {
		if (prop.type === "Identifier" && !node.computed) {
			return prop.name;
		}

		return getStaticStringValue(prop);
	}

	return null;
}

/**
 * Retrieve `ChainExpression#expression` value if the given node a `ChainExpression` node. Otherwise, pass through it.
 * @param {ASTNode} node The node to address.
 * @returns {ASTNode} The `ChainExpression#expression` value if the node is a `ChainExpression` node. Otherwise, the node.
 */
function skipChainExpression(node) {
	return node && node.type === "ChainExpression" ? node.expression : node;
}

/**
 * Check if the `actual` is an expected value.
 * @param {string} actual The string value to check.
 * @param {string | RegExp} expected The expected string value or pattern.
 * @returns {boolean} `true` if the `actual` is an expected value.
 */
function checkText(actual, expected) {
	return typeof expected === "string"
		? actual === expected
		: expected.test(actual);
}

/**
 * Check if a given node is an Identifier node with a given name.
 * @param {ASTNode} node The node to check.
 * @param {string | RegExp} name The expected name or the expected pattern of the object name.
 * @returns {boolean} `true` if the node is an Identifier node with the name.
 */
function isSpecificId(node, name) {
	return node.type === "Identifier" && checkText(node.name, name);
}

/**
 * Check if a given node is member access with a given object name and property name pair.
 * This is regardless of optional or not.
 * @param {ASTNode} node The node to check.
 * @param {string | RegExp | null} objectName The expected name or the expected pattern of the object name. If this is nullish, this method doesn't check object.
 * @param {string | RegExp | null} propertyName The expected name or the expected pattern of the property name. If this is nullish, this method doesn't check property.
 * @returns {boolean} `true` if the node is member access with the object name and property name pair.
 * The node is a `MemberExpression` or `ChainExpression`.
 */
function isSpecificMemberAccess(node, objectName, propertyName) {
	const checkNode = skipChainExpression(node);

	if (checkNode.type !== "MemberExpression") {
		return false;
	}

	if (objectName && !isSpecificId(checkNode.object, objectName)) {
		return false;
	}

	if (propertyName) {
		const actualPropertyName = getStaticPropertyName(checkNode);

		if (
			typeof actualPropertyName !== "string" ||
			!checkText(actualPropertyName, propertyName)
		) {
			return false;
		}
	}

	return true;
}

/**
 * Check if two literal nodes are the same value.
 * @param {ASTNode} left The Literal node to compare.
 * @param {ASTNode} right The other Literal node to compare.
 * @returns {boolean} `true` if the two literal nodes are the same value.
 */
function equalLiteralValue(left, right) {
	// RegExp literal.
	if (left.regex || right.regex) {
		return Boolean(
			left.regex &&
			right.regex &&
			left.regex.pattern === right.regex.pattern &&
			left.regex.flags === right.regex.flags,
		);
	}

	// BigInt literal.
	if (left.bigint || right.bigint) {
		return left.bigint === right.bigint;
	}

	return left.value === right.value;
}

/**
 * Check if two expressions reference the same value. For example:
 *     a = a
 *     a.b = a.b
 *     a[0] = a[0]
 *     a['b'] = a['b']
 * @param {ASTNode} left The left side of the comparison.
 * @param {ASTNode} right The right side of the comparison.
 * @param {boolean} [disableStaticComputedKey] Don't address `a.b` and `a["b"]` are the same if `true`. For backward compatibility.
 * @returns {boolean} `true` if both sides match and reference the same value.
 */
function isSameReference(left, right, disableStaticComputedKey = false) {
	if (left.type !== right.type) {
		// Handle `a.b` and `a?.b` are samely.
		if (left.type === "ChainExpression") {
			return isSameReference(
				left.expression,
				right,
				disableStaticComputedKey,
			);
		}
		if (right.type === "ChainExpression") {
			return isSameReference(
				left,
				right.expression,
				disableStaticComputedKey,
			);
		}

		return false;
	}

	switch (left.type) {
		case "Super":
		case "ThisExpression":
			return true;

		case "Identifier":
		case "PrivateIdentifier":
			return left.name === right.name;
		case "Literal":
			return equalLiteralValue(left, right);

		case "ChainExpression":
			return isSameReference(
				left.expression,
				right.expression,
				disableStaticComputedKey,
			);

		case "MemberExpression": {
			if (!disableStaticComputedKey) {
				const nameA = getStaticPropertyName(left);

				// x.y = x["y"]
				if (nameA !== null) {
					return (
						isSameReference(
							left.object,
							right.object,
							disableStaticComputedKey,
						) && nameA === getStaticPropertyName(right)
					);
				}
			}

			/*
			 * x[0] = x[0]
			 * x[y] = x[y]
			 * x.y = x.y
			 */
			return (
				left.computed === right.computed &&
				isSameReference(
					left.object,
					right.object,
					disableStaticComputedKey,
				) &&
				isSameReference(
					left.property,
					right.property,
					disableStaticComputedKey,
				)
			);
		}

		default:
			return false;
	}
}

/**
 * Checks whether or not a node is `Reflect.apply`.
 * @param {ASTNode} node A node to check.
 * @returns {boolean} Whether or not the node is a `Reflect.apply`.
 */
function isReflectApply(node) {
	return isSpecificMemberAccess(node, "Reflect", "apply");
}

/**
 * Checks whether or not a node is `Array.from`.
 * @param {ASTNode} node A node to check.
 * @returns {boolean} Whether or not the node is a `Array.from`.
 */
function isArrayFromMethod(node) {
	return isSpecificMemberAccess(node, arrayOrTypedArrayPattern, "from");
}

/**
 * Checks whether or not a node is `Array.fromAsync`.
 * @param {ASTNode} node A node to check.
 * @returns {boolean} Whether or not the node is a `Array.fromAsync`.
 */
function isArrayFromAsyncMethod(node) {
	return isSpecificMemberAccess(node, "Array", "fromAsync");
}

/**
 * Checks whether or not a node is a method which expects a function as a first argument, and `thisArg` as a second argument.
 * @param {ASTNode} node A node to check.
 * @returns {boolean} Whether or not the node is a method which expects a function as a first argument, and `thisArg` as a second argument.
 */
function isMethodWhichHasThisArg(node) {
	return isSpecificMemberAccess(node, null, arrayMethodWithThisArgPattern);
}

/**
 * Creates the negate function of the given function.
 * @param {Function} f The function to negate.
 * @returns {Function} Negated function.
 */
function negate(f) {
	return token => !f(token);
}

/**
 * Determines if a node is surrounded by parentheses.
 * @param {SourceCode} sourceCode The ESLint source code object
 * @param {ASTNode} node The node to be checked.
 * @returns {boolean} True if the node is parenthesised.
 * @private
 */
function isParenthesised(sourceCode, node) {
	const previousToken = sourceCode.getTokenBefore(node),
		nextToken = sourceCode.getTokenAfter(node);

	return (
		Boolean(previousToken && nextToken) &&
		previousToken.value === "(" &&
		previousToken.range[1] <= node.range[0] &&
		nextToken.value === ")" &&
		nextToken.range[0] >= node.range[1]
	);
}

/**
 * Checks if the given token is a `=` token or not.
 * @param {Token} token The token to check.
 * @returns {boolean} `true` if the token is a `=` token.
 */
function isEqToken(token) {
	return token.value === "=" && token.type === "Punctuator";
}

/**
 * Checks if the given token is an arrow token or not.
 * @param {Token} token The token to check.
 * @returns {boolean} `true` if the token is an arrow token.
 */
function isArrowToken(token) {
	return token.value === "=>" && token.type === "Punctuator";
}

/**
 * Checks if the given token is a comma token or not.
 * @param {Token} token The token to check.
 * @returns {boolean} `true` if the token is a comma token.
 */
function isCommaToken(token) {
	return token.value === "," && token.type === "Punctuator";
}

/**
 * Checks if the given token is a dot token or not.
 * @param {Token} token The token to check.
 * @returns {boolean} `true` if the token is a dot token.
 */
function isDotToken(token) {
	return token.value === "." && token.type === "Punctuator";
}

/**
 * Checks if the given token is a `?.` token or not.
 * @param {Token} token The token to check.
 * @returns {boolean} `true` if the token is a `?.` token.
 */
function isQuestionDotToken(token) {
	return token.value === "?." && token.type === "Punctuator";
}

/**
 * Checks if the given token is a semicolon token or not.
 * @param {Token} token The token to check.
 * @returns {boolean} `true` if the token is a semicolon token.
 */
function isSemicolonToken(token) {
	return token.value === ";" && token.type === "Punctuator";
}

/**
 * Checks if the given token is a colon token or not.
 * @param {Token} token The token to check.
 * @returns {boolean} `true` if the token is a colon token.
 */
function isColonToken(token) {
	return token.value === ":" && token.type === "Punctuator";
}

/**
 * Checks if the given token is an opening parenthesis token or not.
 * @param {Token} token The token to check.
 * @returns {boolean} `true` if the token is an opening parenthesis token.
 */
function isOpeningParenToken(token) {
	return token.value === "(" && token.type === "Punctuator";
}

/**
 * Checks if the given token is a closing parenthesis token or not.
 * @param {Token} token The token to check.
 * @returns {boolean} `true` if the token is a closing parenthesis token.
 */
function isClosingParenToken(token) {
	return token.value === ")" && token.type === "Punctuator";
}

/**
 * Checks if the given token is an opening square bracket token or not.
 * @param {Token} token The token to check.
 * @returns {boolean} `true` if the token is an opening square bracket token.
 */
function isOpeningBracketToken(token) {
	return token.value === "[" && token.type === "Punctuator";
}

/**
 * Checks if the given token is a closing square bracket token or not.
 * @param {Token} token The token to check.
 * @returns {boolean} `true` if the token is a closing square bracket token.
 */
function isClosingBracketToken(token) {
	return token.value === "]" && token.type === "Punctuator";
}

/**
 * Checks if the given token is an opening brace token or not.
 * @param {Token} token The token to check.
 * @returns {boolean} `true` if the token is an opening brace token.
 */
function isOpeningBraceToken(token) {
	return token.value === "{" && token.type === "Punctuator";
}

/**
 * Checks if the given token is a closing brace token or not.
 * @param {Token} token The token to check.
 * @returns {boolean} `true` if the token is a closing brace token.
 */
function isClosingBraceToken(token) {
	return token.value === "}" && token.type === "Punctuator";
}

/**
 * Checks if the given token is a comment token or not.
 * @param {Token} token The token to check.
 * @returns {boolean} `true` if the token is a comment token.
 */
function isCommentToken(token) {
	return (
		token.type === "Line" ||
		token.type === "Block" ||
		token.type === "Shebang"
	);
}

/**
 * Checks if the given token is a keyword token or not.
 * @param {Token} token The token to check.
 * @returns {boolean} `true` if the token is a keyword token.
 */
function isKeywordToken(token) {
	return token.type === "Keyword";
}

/**
 * Checks whether the given node represents an ES6 export declaration.
 * @param {ASTNode} node A node to check.
 * @returns {boolean} `true` if the node is an export declaration.
 * @private
 */
function isExportDeclaration(node) {
	return (
		node.type === "ExportDefaultDeclaration" ||
		node.type === "ExportNamedDeclaration" ||
		node.type === "ExportAllDeclaration"
	);
}

/**
 * Checks for the presence of a JSDoc comment for the given node and returns it.
 * @param {ASTNode} node The node to get the comment for.
 * @param {SourceCode} sourceCode A SourceCode instance to get comments.
 * @returns {Token|null} The Block comment token containing the JSDoc comment for the given node or null if not found.
 * @private
 */
function findJSDocComment(node, sourceCode) {
	const tokenBefore = sourceCode.getTokenBefore(node, {
		includeComments: true,
	});

	if (
		tokenBefore &&
		tokenBefore.type === "Block" &&
		tokenBefore.value.charAt(0) === "*" &&
		node.loc.start.line - tokenBefore.loc.end.line <= 1
	) {
		return tokenBefore;
	}

	return null;
}

/**
 * Retrieves the JSDoc comment for a given node.
 * @param {ASTNode} node The node to get the comment for.
 * @param {SourceCode} sourceCode A SourceCode instance to get comments.
 * @returns {Token|null} The Block comment token containing the JSDoc comment for the given node or null if not found.
 * @private
 */
function getJSDocComment(node, sourceCode) {
	let parent = node.parent;

	switch (node.type) {
		case "ClassDeclaration":
		case "FunctionDeclaration":
			return findJSDocComment(
				isExportDeclaration(parent) ? parent : node,
				sourceCode,
			);

		case "ClassExpression":
			return findJSDocComment(parent.parent, sourceCode);

		case "ArrowFunctionExpression":
		case "FunctionExpression":
			if (
				parent.type !== "CallExpression" &&
				parent.type !== "NewExpression"
			) {
				while (
					!sourceCode.getCommentsBefore(parent).length &&
					!/Function/u.test(parent.type) &&
					parent.type !== "MethodDefinition" &&
					parent.type !== "Property"
				) {
					parent = parent.parent;

					if (!parent) {
						break;
					}
				}

				if (
					parent &&
					parent.type !== "FunctionDeclaration" &&
					parent.type !== "Program"
				) {
					return findJSDocComment(parent, sourceCode);
				}
			}

			return findJSDocComment(node, sourceCode);

		// falls through
		default:
			return null;
	}
}

/**
 * Checks whether or not a node has a `@this` tag in its comments.
 * @param {ASTNode} node A node to check.
 * @param {SourceCode} sourceCode A SourceCode instance to get comments.
 * @returns {boolean} Whether or not the node has a `@this` tag in its comments.
 */
function hasJSDocThisTag(node, sourceCode) {
	const jsdocComment = getJSDocComment(node, sourceCode);

	if (jsdocComment && thisTagPattern.test(jsdocComment.value)) {
		return true;
	}

	// Checks `@this` in its leading comments for callbacks,
	// because callbacks don't have its JSDoc comment.
	// e.g.
	//     sinon.test(/* @this sinon.Sandbox */function() { this.spy(); });
	return sourceCode
		.getCommentsBefore(node)
		.some(comment => thisTagPattern.test(comment.value));
}

/**
 * Gets the `(` token of the given function node.
 * @param {ASTNode} node The function node to get.
 * @param {SourceCode} sourceCode The source code object to get tokens.
 * @returns {Token} `(` token.
 */
function getOpeningParenOfParams(node, sourceCode) {
	// If the node is an arrow function and doesn't have parens, this returns the identifier of the first param.
	if (node.type === "ArrowFunctionExpression" && node.params.length === 1) {
		const argToken = sourceCode.getFirstToken(node.params[0]);
		const maybeParenToken = sourceCode.getTokenBefore(argToken);

		return isOpeningParenToken(maybeParenToken)
			? maybeParenToken
			: argToken;
	}

	// Otherwise, returns paren.
	return node.id
		? sourceCode.getTokenAfter(node.id, isOpeningParenToken)
		: sourceCode.getFirstToken(node, isOpeningParenToken);
}

/**
 * Checks whether or not the tokens of two given nodes are same.
 * @param {ASTNode} left A node 1 to compare.
 * @param {ASTNode} right A node 2 to compare.
 * @param {SourceCode} sourceCode The ESLint source code object.
 * @returns {boolean} the source code for the given node.
 */
function equalTokens(left, right, sourceCode) {
	const tokensL = sourceCode.getTokens(left);
	const tokensR = sourceCode.getTokens(right);

	if (tokensL.length !== tokensR.length) {
		return false;
	}
	for (let i = 0; i < tokensL.length; ++i) {
		if (
			tokensL[i].type !== tokensR[i].type ||
			tokensL[i].value !== tokensR[i].value
		) {
			return false;
		}
	}

	return true;
}

/**
 * Check if the given node is a true logical expression or not.
 *
 * The three binary expressions logical-or (`||`), logical-and (`&&`), and
 * coalesce (`??`) are known as `ShortCircuitExpression`.
 * But ESTree represents those by `LogicalExpression` node.
 *
 * This function rejects coalesce expressions of `LogicalExpression` node.
 * @param {ASTNode} node The node to check.
 * @returns {boolean} `true` if the node is `&&` or `||`.
 * @see https://tc39.es/ecma262/#prod-ShortCircuitExpression
 */
function isLogicalExpression(node) {
	return (
		node.type === "LogicalExpression" &&
		(node.operator === "&&" || node.operator === "||")
	);
}

/**
 * Check if the given node is a nullish coalescing expression or not.
 *
 * The three binary expressions logical-or (`||`), logical-and (`&&`), and
 * coalesce (`??`) are known as `ShortCircuitExpression`.
 * But ESTree represents those by `LogicalExpression` node.
 *
 * This function finds only coalesce expressions of `LogicalExpression` node.
 * @param {ASTNode} node The node to check.
 * @returns {boolean} `true` if the node is `??`.
 */
function isCoalesceExpression(node) {
	return node.type === "LogicalExpression" && node.operator === "??";
}

/**
 * Check if given two nodes are the pair of a logical expression and a coalesce expression.
 * @param {ASTNode} left A node to check.
 * @param {ASTNode} right Another node to check.
 * @returns {boolean} `true` if the two nodes are the pair of a logical expression and a coalesce expression.
 */
function isMixedLogicalAndCoalesceExpressions(left, right) {
	return (
		(isLogicalExpression(left) && isCoalesceExpression(right)) ||
		(isCoalesceExpression(left) && isLogicalExpression(right))
	);
}

/**
 * Checks if the given operator is a logical assignment operator.
 * @param {string} operator The operator to check.
 * @returns {boolean} `true` if the operator is a logical assignment operator.
 */
function isLogicalAssignmentOperator(operator) {
	return LOGICAL_ASSIGNMENT_OPERATORS.has(operator);
}

/**
 * Get the colon token of the given SwitchCase node.
 * @param {ASTNode} node The SwitchCase node to get.
 * @param {SourceCode} sourceCode The source code object to get tokens.
 * @returns {Token} The colon token of the node.
 */
function getSwitchCaseColonToken(node, sourceCode) {
	if (node.test) {
		return sourceCode.getTokenAfter(node.test, isColonToken);
	}
	return sourceCode.getFirstToken(node, 1);
}

/**
 * Gets ESM module export name represented by the given node.
 * @param {ASTNode} node `Identifier` or string `Literal` node in a position
 * that represents a module export name:
 *   - `ImportSpecifier#imported`
 *   - `ExportSpecifier#local` (if it is a re-export from another module)
 *   - `ExportSpecifier#exported`
 *   - `ExportAllDeclaration#exported`
 * @returns {string} The module export name.
 */
function getModuleExportName(node) {
	if (node.type === "Identifier") {
		return node.name;
	}

	// string literal
	return node.value;
}

/**
 * Returns literal's value converted to the Boolean type
 * @param {ASTNode} node any `Literal` node
 * @returns {boolean | null} `true` when node is truthy, `false` when node is falsy,
 *  `null` when it cannot be determined.
 */
function getBooleanValue(node) {
	if (node.value === null) {
		/*
		 * it might be a null literal or bigint/regex literal in unsupported environments .
		 * https://github.com/estree/estree/blob/14df8a024956ea289bd55b9c2226a1d5b8a473ee/es5.md#regexpliteral
		 * https://github.com/estree/estree/blob/14df8a024956ea289bd55b9c2226a1d5b8a473ee/es2020.md#bigintliteral
		 */

		if (node.raw === "null") {
			return false;
		}

		// regex is always truthy
		if (typeof node.regex === "object") {
			return true;
		}

		return null;
	}

	return !!node.value;
}

/**
 * Checks if a branch node of LogicalExpression short circuits the whole condition
 * @param {ASTNode} node The branch of main condition which needs to be checked
 * @param {string} operator The operator of the main LogicalExpression.
 * @returns {boolean} true when condition short circuits whole condition
 */
function isLogicalIdentity(node, operator) {
	switch (node.type) {
		case "Literal":
			return (
				(operator === "||" && getBooleanValue(node) === true) ||
				(operator === "&&" && getBooleanValue(node) === false)
			);

		case "UnaryExpression":
			return operator === "&&" && node.operator === "void";

		case "LogicalExpression":
			/*
			 * handles `a && false || b`
			 * `false` is an identity element of `&&` but not `||`
			 */
			return (
				operator === node.operator &&
				(isLogicalIdentity(node.left, operator) ||
					isLogicalIdentity(node.right, operator))
			);

		case "AssignmentExpression":
			return (
				["||=", "&&="].includes(node.operator) &&
				operator === node.operator.slice(0, -1) &&
				isLogicalIdentity(node.right, operator)
			);

		// no default
	}
	return false;
}

/**
 * Checks if an identifier is a reference to a global variable.
 * @param {Scope} scope The scope in which the identifier is referenced.
 * @param {ASTNode} node An identifier node to check.
 * @returns {boolean} `true` if the identifier is a reference to a global variable.
 */
function isReferenceToGlobalVariable(scope, node) {
	const reference = scope.references.find(ref => ref.identifier === node);

	return Boolean(
		reference &&
		reference.resolved &&
		reference.resolved.scope.type === "global" &&
		reference.resolved.defs.length === 0,
	);
}

/**
 * Checks if a  node has a constant truthiness value.
 * @param {Scope} scope Scope in which the node appears.
 * @param {ASTNode} node The AST node to check.
 * @param {boolean} inBooleanPosition `true` if checking the test of a
 * condition. `false` in all other cases. When `false`, checks if -- for
 * both string and number -- if coerced to that type, the value will
 * be constant.
 * @returns {boolean} true when node's truthiness is constant
 * @private
 */
function isConstant(scope, node, inBooleanPosition) {
	// node.elements can return null values in the case of sparse arrays ex. [,]
	if (!node) {
		return true;
	}
	switch (node.type) {
		case "Literal":
		case "ArrowFunctionExpression":
		case "FunctionExpression":
			return true;
		case "ClassExpression":
		case "ObjectExpression":
			/**
			 * In theory objects like:
			 *
			 * `{toString: () => a}`
			 * `{valueOf: () => a}`
			 *
			 * Or a classes like:
			 *
			 * `class { static toString() { return a } }`
			 * `class { static valueOf() { return a } }`
			 *
			 * Are not constant verifiably when `inBooleanPosition` is
			 * false, but it's an edge case we've opted not to handle.
			 */
			return true;
		case "TemplateLiteral":
			return (
				(inBooleanPosition &&
					node.quasis.some(quasi => quasi.value.cooked.length)) ||
				node.expressions.every(exp => isConstant(scope, exp, false))
			);

		case "ArrayExpression": {
			if (!inBooleanPosition) {
				return node.elements.every(element =>
					isConstant(scope, element, false),
				);
			}
			return true;
		}

		case "UnaryExpression":
			if (
				node.operator === "void" ||
				(node.operator === "typeof" && inBooleanPosition)
			) {
				return true;
			}

			if (node.operator === "!") {
				return isConstant(scope, node.argument, true);
			}

			return isConstant(scope, node.argument, false);

		case "BinaryExpression":
			return (
				isConstant(scope, node.left, false) &&
				isConstant(scope, node.right, false) &&
				node.operator !== "in"
			);

		case "LogicalExpression": {
			const isLeftConstant = isConstant(
				scope,
				node.left,
				inBooleanPosition,
			);
			const isRightConstant = isConstant(
				scope,
				node.right,
				inBooleanPosition,
			);
			const isLeftShortCircuit =
				isLeftConstant && isLogicalIdentity(node.left, node.operator);
			const isRightShortCircuit =
				inBooleanPosition &&
				isRightConstant &&
				isLogicalIdentity(node.right, node.operator);

			return (
				(isLeftConstant && isRightConstant) ||
				isLeftShortCircuit ||
				isRightShortCircuit
			);
		}
		case "NewExpression":
			return inBooleanPosition;
		case "AssignmentExpression":
			if (node.operator === "=") {
				return isConstant(scope, node.right, inBooleanPosition);
			}

			if (["||=", "&&="].includes(node.operator) && inBooleanPosition) {
				return isLogicalIdentity(
					node.right,
					node.operator.slice(0, -1),
				);
			}

			return false;

		case "SequenceExpression":
			return isConstant(
				scope,
				node.expressions.at(-1),
				inBooleanPosition,
			);
		case "SpreadElement":
			return isConstant(scope, node.argument, inBooleanPosition);
		case "CallExpression":
			if (
				node.callee.type === "Identifier" &&
				node.callee.name === "Boolean"
			) {
				if (
					node.arguments.length === 0 ||
					isConstant(scope, node.arguments[0], true)
				) {
					return isReferenceToGlobalVariable(scope, node.callee);
				}
			}
			return false;
		case "Identifier":
			return (
				node.name === "undefined" &&
				isReferenceToGlobalVariable(scope, node)
			);

		// no default
	}
	return false;
}

/**
 * Checks whether a node is an ExpressionStatement at the top level of a file, function body, or TypeScript module block.
 * A top-level ExpressionStatement node is a directive if it contains a single unparenthesized
 * string literal and if it occurs either as the first sibling or immediately after another
 * directive.
 * @param {ASTNode} node The node to check.
 * @returns {boolean} Whether or not the node is an ExpressionStatement at the top level of a
 * file, function body, or TypeScript module block.
 */
function isTopLevelExpressionStatement(node) {
	if (node.type !== "ExpressionStatement") {
		return false;
	}
	const parent = node.parent;

	return (
		parent.type === "Program" ||
		parent.type === "TSModuleBlock" ||
		(parent.type === "BlockStatement" && isFunction(parent.parent))
	);
}

/**
 * Check whether the given node is a part of a directive prologue or not.
 * @param {ASTNode} node The node to check.
 * @returns {boolean} `true` if the node is a part of directive prologue.
 */
function isDirective(node) {
	return (
		node.type === "ExpressionStatement" &&
		typeof node.directive === "string"
	);
}

/**
 * Tests if a node appears at the beginning of an ancestor ExpressionStatement node.
 * @param {ASTNode} node The node to check.
 * @returns {boolean} Whether the node appears at the beginning of an ancestor ExpressionStatement node.
 */
function isStartOfExpressionStatement(node) {
	const start = node.range[0];
	let ancestor = node;

	while ((ancestor = ancestor.parent) && ancestor.range[0] === start) {
		if (ancestor.type === "ExpressionStatement") {
			return true;
		}
	}
	return false;
}

/**
 * Checks whether a token can cause continuation of a preceding expression
 * (for example, of a class field initializer expression) in a class body.
 * This function checks specifically for tokens that can appear at the start
 * of a class member: `[` (computed key), `*` (generator method), `in` or `instanceof` (valid keys)
 * Without a preceding semicolon, these tokens would be parsed as index access or operators.
 * @param {Token} token The token to check.
 * @returns {boolean} Whether the token can cause continuation of a preceding expression.
 */
function canContinueExpressionInClassBody(token) {
	return (
		(token.type === "Punctuator" &&
			(token.value === "[" || token.value === "*")) ||
		// Different parsers may return these tokens as either "Identifier" or "Keyword"
		((token.type === "Identifier" || token.type === "Keyword") &&
			(token.value === "in" || token.value === "instanceof"))
	);
}

/**
 * Determines whether an opening parenthesis `(`, bracket `[`, asterisk `*`, or backtick ``` ` ``` needs to be preceded by a semicolon.
 * This opening parenthesis or bracket should be at the start of an `ExpressionStatement`, a `MethodDefinition`, a `PropertyDefinition`,
 * or at the start of the body of an `ArrowFunctionExpression`.
 * @type {(sourceCode: SourceCode, node: ASTNode) => boolean}
 * @param {SourceCode} sourceCode The source code object.
 * @param {ASTNode} node A node at the position where an opening parenthesis, bracket, or asterisk will be inserted.
 * @returns {boolean} Whether a semicolon is required before the opening parenthesis or bracket.
 */
let needsPrecedingSemicolon;

{
	const BREAK_OR_CONTINUE = new Set(["BreakStatement", "ContinueStatement"]);

	// Declaration types that cannot be continued by a punctuator when ending with a string Literal that is a direct child.
	const DECLARATIONS = new Set([
		"ExportAllDeclaration",
		"ExportNamedDeclaration",
		"ImportDeclaration",
	]);

	const IDENTIFIER_OR_KEYWORD = new Set(["Identifier", "Keyword"]);

	// Keywords that can immediately precede an ExpressionStatement node, mapped to the their node types.
	const NODE_TYPES_BY_KEYWORD = {
		__proto__: null,
		break: "BreakStatement",
		continue: "ContinueStatement",
		debugger: "DebuggerStatement",
		do: "DoWhileStatement",
		else: "IfStatement",
		return: "ReturnStatement",
		yield: "YieldExpression",
	};

	/*
	 * Before an opening parenthesis, postfix `++` and `--` always trigger ASI;
	 * the tokens `:`, `;`, `{` and `=>` don't expect a semicolon, as that would count as an empty statement.
	 */
	const PUNCTUATORS = new Set([":", ";", "{", "=>", "++", "--"]);

	/*
	 * Statements that can contain an `ExpressionStatement` after a closing parenthesis.
	 * DoWhileStatement is an exception in that it always triggers ASI after the closing parenthesis.
	 */
	const STATEMENTS = new Set([
		"DoWhileStatement",
		"ForInStatement",
		"ForOfStatement",
		"ForStatement",
		"IfStatement",
		"WhileStatement",
		"WithStatement",
	]);

	const TS_TYPE_NODE_TYPES = new Set([
		"TSAsExpression",
		"TSSatisfiesExpression",
		"TSTypeAliasDeclaration",
		"TSTypeAnnotation",
	]);

	/**
	 * Determines whether a specified node is inside a TypeScript type context.
	 * @param {ASTNode} node The node to check.
	 * @returns {boolean} Whether the node is inside a TypeScript type context.
	 */
	function isInType(node) {
		for (let currNode = node; ;) {
			const { parent } = currNode;
			if (!parent) {
				break;
			}
			if (
				TS_TYPE_NODE_TYPES.has(parent.type) &&
				currNode === parent.typeAnnotation
			) {
				return true;
			}
			currNode = parent;
		}
		return false;
	}

	needsPrecedingSemicolon = function (sourceCode, node) {
		const prevToken = sourceCode.getTokenBefore(node);

		if (
			!prevToken ||
			(prevToken.type === "Punctuator" &&
				PUNCTUATORS.has(prevToken.value))
		) {
			return false;
		}

		const prevNode = sourceCode.getNodeByRangeIndex(prevToken.range[0]);

		// Uninitialized class fields don't need a semicolon
		if (
			// Key
			(prevNode.parent.type === "PropertyDefinition" &&
				prevNode.parent.key === prevNode) ||
			// Closing bracket of a computed key
			(prevNode.type === "PropertyDefinition" &&
				isClosingBracketToken(prevToken))
		) {
			return false;
		}

		if (
			prevNode.type === "TSDeclareFunction" ||
			prevNode.parent.type === "TSImportEqualsDeclaration" ||
			prevNode.parent.parent?.type === "TSImportEqualsDeclaration" ||
			TS_TYPE_NODE_TYPES.has(prevNode.type) ||
			isInType(prevNode)
		) {
			return false;
		}

		if (isClosingParenToken(prevToken)) {
			return !STATEMENTS.has(prevNode.type);
		}

		if (isClosingBraceToken(prevToken)) {
			return (
				(prevNode.type === "BlockStatement" &&
					prevNode.parent.type === "FunctionExpression" &&
					prevNode.parent.parent.type !== "MethodDefinition") ||
				(prevNode.type === "ClassBody" &&
					prevNode.parent.type === "ClassExpression") ||
				prevNode.type === "ObjectExpression"
			);
		}

		if (IDENTIFIER_OR_KEYWORD.has(prevToken.type)) {
			if (
				prevNode.parent.type === "VariableDeclarator" &&
				!prevNode.parent.init
			) {
				return false;
			}
			if (BREAK_OR_CONTINUE.has(prevNode.parent.type)) {
				return false;
			}

			const keyword = prevToken.value;
			const nodeType = NODE_TYPES_BY_KEYWORD[keyword];

			return prevNode.type !== nodeType;
		}

		if (prevToken.type === "String") {
			return !DECLARATIONS.has(prevNode.parent.type);
		}

		return true;
	};
}

/**
 * Checks if a node is used as an import attribute key, either in a static or dynamic import.
 * @param {ASTNode} node The node to check.
 * @returns {boolean} Whether the node is used as an import attribute key.
 */
function isImportAttributeKey(node) {
	const { parent } = node;

	// static import/re-export
	if (parent.type === "ImportAttribute" && parent.key === node) {
		return true;
	}

	// dynamic import
	if (
		parent.type === "Property" &&
		!parent.computed &&
		(parent.key === node ||
			(parent.value === node && parent.shorthand && !parent.method)) &&
		parent.parent.type === "ObjectExpression"
	) {
		const objectExpression = parent.parent;
		const objectExpressionParent = objectExpression.parent;

		if (
			objectExpressionParent.type === "ImportExpression" &&
			objectExpressionParent.options === objectExpression
		) {
			return true;
		}

		// nested key
		if (
			objectExpressionParent.type === "Property" &&
			objectExpressionParent.value === objectExpression
		) {
			return isImportAttributeKey(objectExpressionParent.key);
		}
	}

	return false;
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

module.exports = {
	COMMENTS_IGNORE_PATTERN,
	LINEBREAKS,
	LINEBREAK_MATCHER: lineBreakPattern,
	SHEBANG_MATCHER: shebangPattern,
	STATEMENT_LIST_PARENTS,
	ECMASCRIPT_GLOBALS,

	/**
	 * Determines whether two adjacent tokens are on the same line.
	 * @param {Object} left The left token object.
	 * @param {Object} right The right token object.
	 * @returns {boolean} Whether or not the tokens are on the same line.
	 * @public
	 */
	isTokenOnSameLine(left, right) {
		return left.loc.end.line === right.loc.start.line;
	},

	isNullOrUndefined,
	isCallee,
	isES5Constructor,
	getUpperFunction,
	isFunction,
	isLoop,
	isInLoop,
	isArrayFromMethod,
	isArrayFromAsyncMethod,
	isParenthesised,
	createGlobalLinebreakMatcher,
	equalTokens,

	isArrowToken,
	isClosingBraceToken,
	isClosingBracketToken,
	isClosingParenToken,
	isColonToken,
	isCommaToken,
	isCommentToken,
	isDotToken,
	isQuestionDotToken,
	isKeywordToken,
	isNotClosingBraceToken: negate(isClosingBraceToken),
	isNotClosingBracketToken: negate(isClosingBracketToken),
	isNotClosingParenToken: negate(isClosingParenToken),
	isNotColonToken: negate(isColonToken),
	isNotCommaToken: negate(isCommaToken),
	isNotDotToken: negate(isDotToken),
	isNotQuestionDotToken: negate(isQuestionDotToken),
	isNotOpeningBraceToken: negate(isOpeningBraceToken),
	isNotOpeningBracketToken: negate(isOpeningBracketToken),
	isNotOpeningParenToken: negate(isOpeningParenToken),
	isNotSemicolonToken: negate(isSemicolonToken),
	isOpeningBraceToken,
	isOpeningBracketToken,
	isOpeningParenToken,
	isSemicolonToken,
	isEqToken,

	/**
	 * Checks whether or not a given node is a string literal.
	 * @param {ASTNode} node A node to check.
	 * @returns {boolean} `true` if the node is a string literal.
	 */
	isStringLiteral(node) {
		return (
			(node.type === "Literal" && typeof node.value === "string") ||
			node.type === "TemplateLiteral"
		);
	},

	/**
	 * Checks whether a given node is a breakable statement or not.
	 * The node is breakable if the node is one of the following type:
	 *
	 * - DoWhileStatement
	 * - ForInStatement
	 * - ForOfStatement
	 * - ForStatement
	 * - SwitchStatement
	 * - WhileStatement
	 * @param {ASTNode} node A node to check.
	 * @returns {boolean} `true` if the node is breakable.
	 */
	isBreakableStatement(node) {
		return breakableTypePattern.test(node.type);
	},

	/**
	 * Gets references which are non initializer and writable.
	 * @param {Reference[]} references An array of references.
	 * @returns {Reference[]} An array of only references which are non initializer and writable.
	 * @public
	 */
	getModifyingReferences(references) {
		return references.filter(isModifyingReference);
	},

	/**
	 * Validate that a string passed in is surrounded by the specified character
	 * @param {string} val The text to check.
	 * @param {string} character The character to see if it's surrounded by.
	 * @returns {boolean} True if the text is surrounded by the character, false if not.
	 * @private
	 */
	isSurroundedBy(val, character) {
		return val[0] === character && val.at(-1) === character;
	},

	/**
	 * Returns whether the provided node is an ESLint directive comment or not
	 * @param {Line|Block} node The comment token to be checked
	 * @returns {boolean} `true` if the node is an ESLint directive comment
	 */
	isDirectiveComment(node) {
		const comment = node.value.trim();

		return (
			(node.type === "Line" && comment.startsWith("eslint-")) ||
			(node.type === "Block" && ESLINT_DIRECTIVE_PATTERN.test(comment))
		);
	},

	/**
	 * Gets the trailing statement of a given node.
	 *
	 *     if (code)
	 *         consequent;
	 *
	 * When taking this `IfStatement`, returns `consequent;` statement.
	 * @param {ASTNode} A node to get.
	 * @returns {ASTNode|null} The trailing statement's node.
	 */
	getTrailingStatement: esutils.ast.trailingStatement,

	/**
	 * Finds the variable by a given name in a given scope and its upper scopes.
	 * @param {Scope} initScope A scope to start find.
	 * @param {string} name A variable name to find.
	 * @returns {Variable|null} A found variable or `null`.
	 */
	getVariableByName(initScope, name) {
		let scope = initScope;

		while (scope) {
			const variable = scope.set.get(name);

			if (variable) {
				return variable;
			}

			scope = scope.upper;
		}

		return null;
	},

	/**
	 * Checks whether or not a given function node is the default `this` binding.
	 *
	 * First, this checks the node:
	 *
	 * - The given node is not in `PropertyDefinition#value` position.
	 * - The given node is not `StaticBlock`.
	 * - The function name does not start with uppercase. It's a convention to capitalize the names
	 *   of constructor functions. This check is not performed if `capIsConstructor` is set to `false`.
	 * - The function does not have a JSDoc comment that has a `@this` tag.
	 *
	 * Next, this checks the location of the node.
	 * If the location is below, this judges `this` is valid.
	 *
	 * - The location is not on an object literal.
	 * - The location is not assigned to a variable which starts with an uppercase letter. Applies to anonymous
	 *   functions only, as the name of the variable is considered to be the name of the function in this case.
	 *   This check is not performed if `capIsConstructor` is set to `false`.
	 * - The location is not on an ES2015 class.
	 * - Its `bind`/`call`/`apply` method is not called directly.
	 * - The function is not a callback of array methods (such as `.forEach()`) if `thisArg` is given.
	 * @param {ASTNode} node A function node to check. It also can be an implicit function, like `StaticBlock`
	 * or any expression that is `PropertyDefinition#value` node.
	 * @param {SourceCode} sourceCode A SourceCode instance to get comments.
	 * @param {boolean} [capIsConstructor = true] `false` disables the assumption that functions which name starts
	 * with an uppercase or are assigned to a variable which name starts with an uppercase are constructors.
	 * @returns {boolean} The function node is the default `this` binding.
	 */
	isDefaultThisBinding(node, sourceCode, { capIsConstructor = true } = {}) {
		/*
		 * Class field initializers are implicit functions, but ESTree doesn't have the AST node of field initializers.
		 * Therefore, A expression node at `PropertyDefinition#value` is a function.
		 * In this case, `this` is always not default binding.
		 */
		if (
			node.parent.type === "PropertyDefinition" &&
			node.parent.value === node
		) {
			return false;
		}

		// Class static blocks are implicit functions. In this case, `this` is always not default binding.
		if (node.type === "StaticBlock") {
			return false;
		}

		// Check if the function has a parameter named `this`.
		if (
			(node.type === "FunctionDeclaration" ||
				node.type === "FunctionExpression") &&
			node.params.some(
				param => param.type === "Identifier" && param.name === "this",
			)
		) {
			return false;
		}

		if (
			(capIsConstructor && isES5Constructor(node)) ||
			hasJSDocThisTag(node, sourceCode)
		) {
			return false;
		}
		const isAnonymous = node.id === null;
		let currentNode = node;

		while (currentNode) {
			const parent = currentNode.parent;

			switch (parent.type) {
				/*
				 * Looks up the destination.
				 * e.g., obj.foo = nativeFoo || function foo() { ... };
				 */
				case "LogicalExpression":
				case "ConditionalExpression":
				case "ChainExpression":
					currentNode = parent;
					break;

				/*
				 * If the upper function is IIFE, checks the destination of the return value.
				 * e.g.
				 *   obj.foo = (function() {
				 *     // setup...
				 *     return function foo() { ... };
				 *   })();
				 *   obj.foo = (() =>
				 *     function foo() { ... }
				 *   )();
				 */
				case "ReturnStatement": {
					const func = getUpperFunction(parent);

					if (func === null || !isCallee(func)) {
						return true;
					}
					currentNode = func.parent;
					break;
				}
				case "ArrowFunctionExpression":
					if (currentNode !== parent.body || !isCallee(parent)) {
						return true;
					}
					currentNode = parent.parent;
					break;

				/*
				 * e.g.
				 *   var obj = { foo() { ... } };
				 *   var obj = { foo: function() { ... } };
				 *   class A { constructor() { ... } }
				 *   class A { foo() { ... } }
				 *   class A { get foo() { ... } }
				 *   class A { set foo() { ... } }
				 *   class A { static foo() { ... } }
				 *   class A { foo = function() { ... } }
				 */
				case "Property":
				case "PropertyDefinition":
				case "MethodDefinition":
					return parent.value !== currentNode;

				/*
				 * e.g.
				 *   obj.foo = function foo() { ... };
				 *   Foo = function() { ... };
				 *   [obj.foo = function foo() { ... }] = a;
				 *   [Foo = function() { ... }] = a;
				 */
				case "AssignmentExpression":
				case "AssignmentPattern":
					if (parent.left.type === "MemberExpression") {
						return false;
					}
					if (
						capIsConstructor &&
						isAnonymous &&
						parent.left.type === "Identifier" &&
						startsWithUpperCase(parent.left.name)
					) {
						return false;
					}
					return true;

				/*
				 * e.g.
				 *   var Foo = function() { ... };
				 */
				case "VariableDeclarator":
					return !(
						capIsConstructor &&
						isAnonymous &&
						parent.init === currentNode &&
						parent.id.type === "Identifier" &&
						startsWithUpperCase(parent.id.name)
					);

				/*
				 * e.g.
				 *   var foo = function foo() { ... }.bind(obj);
				 *   (function foo() { ... }).call(obj);
				 *   (function foo() { ... }).apply(obj, []);
				 */
				case "MemberExpression":
					if (
						parent.object === currentNode &&
						isSpecificMemberAccess(
							parent,
							null,
							bindOrCallOrApplyPattern,
						)
					) {
						const maybeCalleeNode =
							parent.parent.type === "ChainExpression"
								? parent.parent
								: parent;

						return !(
							isCallee(maybeCalleeNode) &&
							maybeCalleeNode.parent.arguments.length >= 1 &&
							!isNullOrUndefined(
								maybeCalleeNode.parent.arguments[0],
							)
						);
					}
					return true;

				/*
				 * e.g.
				 *   Reflect.apply(function() {}, obj, []);
				 *   Array.from([], function() {}, obj);
				 *   list.forEach(function() {}, obj);
				 */
				case "CallExpression":
					if (isReflectApply(parent.callee)) {
						return (
							parent.arguments.length !== 3 ||
							parent.arguments[0] !== currentNode ||
							isNullOrUndefined(parent.arguments[1])
						);
					}
					if (
						isArrayFromMethod(parent.callee) ||
						isArrayFromAsyncMethod(parent.callee)
					) {
						return (
							parent.arguments.length !== 3 ||
							parent.arguments[1] !== currentNode ||
							isNullOrUndefined(parent.arguments[2])
						);
					}
					if (isMethodWhichHasThisArg(parent.callee)) {
						return (
							parent.arguments.length !== 2 ||
							parent.arguments[0] !== currentNode ||
							isNullOrUndefined(parent.arguments[1])
						);
					}
					return true;

				// Otherwise `this` is default.
				default:
					return true;
			}
		}

		/* c8 ignore next */
		return true;
	},

	/**
	 * Get the precedence level based on the node type
	 * @param {ASTNode} node node to evaluate
	 * @returns {number} precedence level
	 * @private
	 */
	getPrecedence(node) {
		switch (node.type) {
			case "SequenceExpression":
				return 0;

			case "AssignmentExpression":
			case "ArrowFunctionExpression":
			case "YieldExpression":
				return 1;

			case "ConditionalExpression":
				return 3;

			case "LogicalExpression":
				switch (node.operator) {
					case "||":
					case "??":
						return 4;
					case "&&":
						return 5;

					// no default
				}

			/* falls through */

			case "BinaryExpression":
				switch (node.operator) {
					case "|":
						return 6;
					case "^":
						return 7;
					case "&":
						return 8;
					case "==":
					case "!=":
					case "===":
					case "!==":
						return 9;
					case "<":
					case "<=":
					case ">":
					case ">=":
					case "in":
					case "instanceof":
						return 10;
					case "<<":
					case ">>":
					case ">>>":
						return 11;
					case "+":
					case "-":
						return 12;
					case "*":
					case "/":
					case "%":
						return 13;
					case "**":
						return 15;

					// no default
				}

			/* falls through */

			case "UnaryExpression":
			case "AwaitExpression":
				return 16;

			case "UpdateExpression":
				return 17;

			case "CallExpression":
			case "ChainExpression":
			case "ImportExpression":
				return 18;

			case "NewExpression":
				return 19;

			default:
				if (node.type in eslintVisitorKeys) {
					return 20;
				}

				/*
				 * if the node is not a standard node that we know about, then assume it has the lowest precedence
				 * this will mean that rules will wrap unknown nodes in parentheses where applicable instead of
				 * unwrapping them and potentially changing the meaning of the code or introducing a syntax error.
				 */
				return -1;
		}
	},

	/**
	 * Checks whether the given node is an empty block node or not.
	 * @param {ASTNode|null} node The node to check.
	 * @returns {boolean} `true` if the node is an empty block.
	 */
	isEmptyBlock(node) {
		return Boolean(
			node && node.type === "BlockStatement" && node.body.length === 0,
		);
	},

	/**
	 * Checks whether the given node is an empty function node or not.
	 * @param {ASTNode|null} node The node to check.
	 * @returns {boolean} `true` if the node is an empty function.
	 */
	isEmptyFunction(node) {
		return isFunction(node) && module.exports.isEmptyBlock(node.body);
	},

	/**
	 * Get directives from directive prologue of a Program or Function node.
	 * @param {ASTNode} node The node to check.
	 * @returns {ASTNode[]} The directives found in the directive prologue.
	 */
	getDirectivePrologue(node) {
		const directives = [];

		// Directive prologues only occur at the top of files or functions.
		if (
			node.type === "Program" ||
			node.type === "FunctionDeclaration" ||
			node.type === "FunctionExpression" ||
			/*
			 * Do not check arrow functions with implicit return.
			 * `() => "use strict";` returns the string `"use strict"`.
			 */
			(node.type === "ArrowFunctionExpression" &&
				node.body.type === "BlockStatement")
		) {
			const statements =
				node.type === "Program" ? node.body : node.body.body;

			for (const statement of statements) {
				if (
					statement.type === "ExpressionStatement" &&
					statement.expression.type === "Literal"
				) {
					directives.push(statement);
				} else {
					break;
				}
			}
		}

		return directives;
	},

	/**
	 * Determines whether this node is a decimal integer literal. If a node is a decimal integer literal, a dot added
	 * after the node will be parsed as a decimal point, rather than a property-access dot.
	 * @param {ASTNode} node The node to check.
	 * @returns {boolean} `true` if this node is a decimal integer.
	 * @example
	 *
	 * 0         // true
	 * 5         // true
	 * 50        // true
	 * 5_000     // true
	 * 1_234_56  // true
	 * 08        // true
	 * 0192      // true
	 * 5.        // false
	 * .5        // false
	 * 5.0       // false
	 * 5.00_00   // false
	 * 05        // false
	 * 0x5       // false
	 * 0b101     // false
	 * 0b11_01   // false
	 * 0o5       // false
	 * 5e0       // false
	 * 5e1_000   // false
	 * 5n        // false
	 * 1_000n    // false
	 * "5"       // false
	 *
	 */
	isDecimalInteger(node) {
		return (
			node.type === "Literal" &&
			typeof node.value === "number" &&
			DECIMAL_INTEGER_PATTERN.test(node.raw)
		);
	},

	/**
	 * Determines whether this token is a decimal integer numeric token.
	 * This is similar to isDecimalInteger(), but for tokens.
	 * @param {Token} token The token to check.
	 * @returns {boolean} `true` if this token is a decimal integer.
	 */
	isDecimalIntegerNumericToken(token) {
		return (
			token.type === "Numeric" &&
			DECIMAL_INTEGER_PATTERN.test(token.value)
		);
	},

	/**
	 * Gets the name and kind of the given function node.
	 *
	 * - `function foo() {}`  .................... `function 'foo'`
	 * - `(function foo() {})`  .................. `function 'foo'`
	 * - `(function() {})`  ...................... `function`
	 * - `function* foo() {}`  ................... `generator function 'foo'`
	 * - `(function* foo() {})`  ................. `generator function 'foo'`
	 * - `(function*() {})`  ..................... `generator function`
	 * - `() => {}`  ............................. `arrow function`
	 * - `async () => {}`  ....................... `async arrow function`
	 * - `({ foo: function foo() {} })`  ......... `method 'foo'`
	 * - `({ foo: function() {} })`  ............. `method 'foo'`
	 * - `({ ['foo']: function() {} })`  ......... `method 'foo'`
	 * - `({ [foo]: function() {} })`  ........... `method`
	 * - `({ foo() {} })`  ....................... `method 'foo'`
	 * - `({ foo: function* foo() {} })`  ........ `generator method 'foo'`
	 * - `({ foo: function*() {} })`  ............ `generator method 'foo'`
	 * - `({ ['foo']: function*() {} })`  ........ `generator method 'foo'`
	 * - `({ [foo]: function*() {} })`  .......... `generator method`
	 * - `({ *foo() {} })`  ...................... `generator method 'foo'`
	 * - `({ foo: async function foo() {} })`  ... `async method 'foo'`
	 * - `({ foo: async function() {} })`  ....... `async method 'foo'`
	 * - `({ ['foo']: async function() {} })`  ... `async method 'foo'`
	 * - `({ [foo]: async function() {} })`  ..... `async method`
	 * - `({ async foo() {} })`  ................. `async method 'foo'`
	 * - `({ get foo() {} })`  ................... `getter 'foo'`
	 * - `({ set foo(a) {} })`  .................. `setter 'foo'`
	 * - `class A { constructor() {} }`  ......... `constructor`
	 * - `class A { foo() {} }`  ................. `method 'foo'`
	 * - `class A { *foo() {} }`  ................ `generator method 'foo'`
	 * - `class A { async foo() {} }`  ........... `async method 'foo'`
	 * - `class A { ['foo']() {} }`  ............. `method 'foo'`
	 * - `class A { *['foo']() {} }`  ............ `generator method 'foo'`
	 * - `class A { async ['foo']() {} }`  ....... `async method 'foo'`
	 * - `class A { [foo]() {} }`  ............... `method`
	 * - `class A { *[foo]() {} }`  .............. `generator method`
	 * - `class A { async [foo]() {} }`  ......... `async method`
	 * - `class A { get foo() {} }`  ............. `getter 'foo'`
	 * - `class A { set foo(a) {} }`  ............ `setter 'foo'`
	 * - `class A { static foo() {} }`  .......... `static method 'foo'`
	 * - `class A { static *foo() {} }`  ......... `static generator method 'foo'`
	 * - `class A { static async foo() {} }`  .... `static async method 'foo'`
	 * - `class A { static get foo() {} }`  ...... `static getter 'foo'`
	 * - `class A { static set foo(a) {} }`  ..... `static setter 'foo'`
	 * - `class A { foo = () => {}; }`  .......... `method 'foo'`
	 * - `class A { foo = function() {}; }`  ..... `method 'foo'`
	 * - `class A { foo = function bar() {}; }`  . `method 'foo'`
	 * - `class A { static foo = () => {}; }`  ... `static method 'foo'`
	 * - `class A { '#foo' = () => {}; }`  ....... `method '#foo'`
	 * - `class A { #foo = () => {}; }`  ......... `private method #foo`
	 * - `class A { static #foo = () => {}; }`  .. `static private method #foo`
	 * - `class A { '#foo'() {} }`  .............. `method '#foo'`
	 * - `class A { #foo() {} }`  ................ `private method #foo`
	 * - `class A { static #foo() {} }`  ......... `static private method #foo`
	 * @param {ASTNode} node The function node to get.
	 * @returns {string} The name and kind of the function node.
	 */
	getFunctionNameWithKind(node) {
		const parent = node.parent;
		const tokens = [];

		if (
			parent.type === "MethodDefinition" ||
			parent.type === "PropertyDefinition" ||
			node.type === "TSPropertySignature" ||
			node.type === "TSMethodSignature"
		) {
			// The proposal uses `static` word consistently before visibility words: https://github.com/tc39/proposal-static-class-features
			if (parent.static) {
				tokens.push("static");
			}
			if (!parent.computed && parent.key?.type === "PrivateIdentifier") {
				tokens.push("private");
			}
		}
		if (node.async) {
			tokens.push("async");
		}
		if (node.generator) {
			tokens.push("generator");
		}

		if (parent.type === "Property" || parent.type === "MethodDefinition") {
			if (parent.kind === "constructor") {
				return "constructor";
			}
			if (parent.kind === "get") {
				tokens.push("getter");
			} else if (parent.kind === "set") {
				tokens.push("setter");
			} else {
				tokens.push("method");
			}
		} else if (node.type === "TSMethodSignature") {
			if (node.kind === "get") {
				tokens.push("getter");
			} else if (node.kind === "set") {
				tokens.push("setter");
			} else {
				tokens.push("method");
			}
		} else if (parent.type === "PropertyDefinition") {
			tokens.push("method");
		} else {
			if (node.type === "ArrowFunctionExpression") {
				tokens.push("arrow");
			}
			tokens.push("function");
		}

		if (
			parent.type === "Property" ||
			parent.type === "MethodDefinition" ||
			parent.type === "PropertyDefinition"
		) {
			if (!parent.computed && parent.key.type === "PrivateIdentifier") {
				tokens.push(`#${parent.key.name}`);
			} else {
				const name = getStaticPropertyName(parent);

				if (name !== null) {
					tokens.push(`'${name}'`);
				} else if (node.id) {
					tokens.push(`'${node.id.name}'`);
				}
			}
		} else if (node.type === "TSMethodSignature") {
			tokens.push(`'${getStaticPropertyName(node)}'`);
		} else if (node.id) {
			tokens.push(`'${node.id.name}'`);
		}

		return tokens.join(" ");
	},

	/**
	 * Gets the location of the given function node for reporting.
	 *
	 * - `function foo() {}`
	 *    ^^^^^^^^^^^^
	 * - `(function foo() {})`
	 *     ^^^^^^^^^^^^
	 * - `(function() {})`
	 *     ^^^^^^^^
	 * - `function* foo() {}`
	 *    ^^^^^^^^^^^^^
	 * - `(function* foo() {})`
	 *     ^^^^^^^^^^^^^
	 * - `(function*() {})`
	 *     ^^^^^^^^^
	 * - `() => {}`
	 *       ^^
	 * - `async () => {}`
	 *             ^^
	 * - `({ foo: function foo() {} })`
	 *       ^^^^^^^^^^^^^^^^^
	 * - `({ foo: function() {} })`
	 *       ^^^^^^^^^^^^^
	 * - `({ ['foo']: function() {} })`
	 *       ^^^^^^^^^^^^^^^^^
	 * - `({ [foo]: function() {} })`
	 *       ^^^^^^^^^^^^^^^
	 * - `({ foo() {} })`
	 *       ^^^
	 * - `({ foo: function* foo() {} })`
	 *       ^^^^^^^^^^^^^^^^^^
	 * - `({ foo: function*() {} })`
	 *       ^^^^^^^^^^^^^^
	 * - `({ ['foo']: function*() {} })`
	 *       ^^^^^^^^^^^^^^^^^^
	 * - `({ [foo]: functiF(on*() {} })`
	 *       ^^^^^^^^^^^^^^^^
	 * - `({ *foo() {} })`
	 *       ^^^^
	 * - `({ foo: async function foo() {} })`
	 *       ^^^^^^^^^^^^^^^^^^^^^^^
	 * - `({ foo: async function() {} })`
	 *       ^^^^^^^^^^^^^^^^^^^
	 * - `({ ['foo']: async function() {} })`
	 *       ^^^^^^^^^^^^^^^^^^^^^^^
	 * - `({ [foo]: async function() {} })`
	 *       ^^^^^^^^^^^^^^^^^^^^^
	 * - `({ async foo() {} })`
	 *       ^^^^^^^^^
	 * - `({ get foo() {} })`
	 *       ^^^^^^^
	 * - `({ set foo(a) {} })`
	 *       ^^^^^^^
	 * - `class A { constructor() {} }`
	 *              ^^^^^^^^^^^
	 * - `class A { foo() {} }`
	 *              ^^^
	 * - `class A { *foo() {} }`
	 *              ^^^^
	 * - `class A { async foo() {} }`
	 *              ^^^^^^^^^
	 * - `class A { ['foo']() {} }`
	 *              ^^^^^^^
	 * - `class A { *['foo']() {} }`
	 *              ^^^^^^^^
	 * - `class A { async ['foo']() {} }`
	 *              ^^^^^^^^^^^^^
	 * - `class A { [foo]() {} }`
	 *              ^^^^^
	 * - `class A { *[foo]() {} }`
	 *              ^^^^^^
	 * - `class A { async [foo]() {} }`
	 *              ^^^^^^^^^^^
	 * - `class A { get foo() {} }`
	 *              ^^^^^^^
	 * - `class A { set foo(a) {} }`
	 *              ^^^^^^^
	 * - `class A { static foo() {} }`
	 *              ^^^^^^^^^^
	 * - `class A { static *foo() {} }`
	 *              ^^^^^^^^^^^
	 * - `class A { static async foo() {} }`
	 *              ^^^^^^^^^^^^^^^^
	 * - `class A { static get foo() {} }`
	 *              ^^^^^^^^^^^^^^
	 * - `class A { static set foo(a) {} }`
	 *              ^^^^^^^^^^^^^^
	 * - `class A { foo = function() {} }`
	 *              ^^^^^^^^^^^^^^
	 * - `class A { static foo = function() {} }`
	 *              ^^^^^^^^^^^^^^^^^^^^^
	 * - `class A { foo = (a, b) => {} }`
	 *              ^^^^^^
	 * @param {ASTNode} node The function node to get.
	 * @param {SourceCode} sourceCode The source code object to get tokens.
	 * @returns {string} The location of the function node for reporting.
	 */
	getFunctionHeadLoc(node, sourceCode) {
		const parent = node.parent;
		let start;
		let end;

		if (
			parent.type === "Property" ||
			parent.type === "MethodDefinition" ||
			parent.type === "PropertyDefinition" ||
			parent.type === "TSPropertySignature" ||
			parent.type === "TSMethodSignature"
		) {
			start = parent.loc.start;
			end = getOpeningParenOfParams(node, sourceCode).loc.start;
		} else if (node.type === "ArrowFunctionExpression") {
			const arrowToken = sourceCode.getTokenBefore(
				node.body,
				isArrowToken,
			);

			start = arrowToken.loc.start;
			end = arrowToken.loc.end;
		} else {
			start = node.loc.start;
			end = getOpeningParenOfParams(node, sourceCode).loc.start;
		}

		return {
			start: Object.assign({}, start),
			end: Object.assign({}, end),
		};
	},

	/**
	 * Gets next location when the result is not out of bound, otherwise returns null.
	 *
	 * Assumptions:
	 *
	 * - The given location represents a valid location in the given source code.
	 * - Columns are 0-based.
	 * - Lines are 1-based.
	 * - Column immediately after the last character in a line (not incl. linebreaks) is considered to be a valid location.
	 * - If the source code ends with a linebreak, `sourceCode.lines` array will have an extra element (empty string) at the end.
	 *   The start (column 0) of that extra line is considered to be a valid location.
	 *
	 * Examples of successive locations (line, column):
	 *
	 * code: foo
	 * locations: (1, 0) -> (1, 1) -> (1, 2) -> (1, 3) -> null
	 *
	 * code: foo<LF>
	 * locations: (1, 0) -> (1, 1) -> (1, 2) -> (1, 3) -> (2, 0) -> null
	 *
	 * code: foo<CR><LF>
	 * locations: (1, 0) -> (1, 1) -> (1, 2) -> (1, 3) -> (2, 0) -> null
	 *
	 * code: a<LF>b
	 * locations: (1, 0) -> (1, 1) -> (2, 0) -> (2, 1) -> null
	 *
	 * code: a<LF>b<LF>
	 * locations: (1, 0) -> (1, 1) -> (2, 0) -> (2, 1) -> (3, 0) -> null
	 *
	 * code: a<CR><LF>b<CR><LF>
	 * locations: (1, 0) -> (1, 1) -> (2, 0) -> (2, 1) -> (3, 0) -> null
	 *
	 * code: a<LF><LF>
	 * locations: (1, 0) -> (1, 1) -> (2, 0) -> (3, 0) -> null
	 *
	 * code: <LF>
	 * locations: (1, 0) -> (2, 0) -> null
	 *
	 * code:
	 * locations: (1, 0) -> null
	 * @param {SourceCode} sourceCode The sourceCode
	 * @param {{line: number, column: number}} location The location
	 * @returns {{line: number, column: number} | null} Next location
	 */
	getNextLocation(sourceCode, { line, column }) {
		if (column < sourceCode.lines[line - 1].length) {
			return {
				line,
				column: column + 1,
			};
		}

		if (line < sourceCode.lines.length) {
			return {
				line: line + 1,
				column: 0,
			};
		}

		return null;
	},

	/**
	 * Gets the parenthesized text of a node. This is similar to sourceCode.getText(node), but it also includes any parentheses
	 * surrounding the node.
	 * @param {SourceCode} sourceCode The source code object
	 * @param {ASTNode} node An expression node
	 * @returns {string} The text representing the node, with all surrounding parentheses included
	 */
	getParenthesisedText(sourceCode, node) {
		let leftToken = sourceCode.getFirstToken(node);
		let rightToken = sourceCode.getLastToken(node);

		while (
			sourceCode.getTokenBefore(leftToken) &&
			sourceCode.getTokenBefore(leftToken).type === "Punctuator" &&
			sourceCode.getTokenBefore(leftToken).value === "(" &&
			sourceCode.getTokenAfter(rightToken) &&
			sourceCode.getTokenAfter(rightToken).type === "Punctuator" &&
			sourceCode.getTokenAfter(rightToken).value === ")"
		) {
			leftToken = sourceCode.getTokenBefore(leftToken);
			rightToken = sourceCode.getTokenAfter(rightToken);
		}

		return sourceCode
			.getText()
			.slice(leftToken.range[0], rightToken.range[1]);
	},

	/**
	 * Determine if a node has a possibility to be an Error object
	 * @param {ASTNode} node ASTNode to check
	 * @returns {boolean} True if there is a chance it contains an Error obj
	 */
	couldBeError(node) {
		switch (node.type) {
			case "Identifier":
			case "CallExpression":
			case "NewExpression":
			case "MemberExpression":
			case "TaggedTemplateExpression":
			case "YieldExpression":
			case "AwaitExpression":
			case "ChainExpression":
				return true; // possibly an error object.

			case "AssignmentExpression":
				if (["=", "&&="].includes(node.operator)) {
					return module.exports.couldBeError(node.right);
				}

				if (["||=", "??="].includes(node.operator)) {
					return (
						module.exports.couldBeError(node.left) ||
						module.exports.couldBeError(node.right)
					);
				}

				/**
				 * All other assignment operators are mathematical assignment operators (arithmetic or bitwise).
				 * An assignment expression with a mathematical operator can either evaluate to a primitive value,
				 * or throw, depending on the operands. Thus, it cannot evaluate to an `Error` object.
				 */
				return false;

			case "SequenceExpression": {
				const exprs = node.expressions;

				return (
					exprs.length !== 0 &&
					module.exports.couldBeError(exprs.at(-1))
				);
			}

			case "LogicalExpression":
				/*
				 * If the && operator short-circuits, the left side was falsy and therefore not an error, and if it
				 * doesn't short-circuit, it takes the value from the right side, so the right side must always be
				 * a plausible error. A future improvement could verify that the left side could be truthy by
				 * excluding falsy literals.
				 */
				if (node.operator === "&&") {
					return module.exports.couldBeError(node.right);
				}

				return (
					module.exports.couldBeError(node.left) ||
					module.exports.couldBeError(node.right)
				);

			case "ConditionalExpression":
				return (
					module.exports.couldBeError(node.consequent) ||
					module.exports.couldBeError(node.alternate)
				);

			default:
				return false;
		}
	},

	/**
	 * Check if a given node is a numeric literal or not.
	 * @param {ASTNode} node The node to check.
	 * @returns {boolean} `true` if the node is a number or bigint literal.
	 */
	isNumericLiteral(node) {
		return (
			node.type === "Literal" &&
			(typeof node.value === "number" || Boolean(node.bigint))
		);
	},

	/**
	 * Determines whether two tokens can safely be placed next to each other without merging into a single token
	 * @param {Token|string} leftValue The left token. If this is a string, it will be tokenized and the last token will be used.
	 * @param {Token|string} rightValue The right token. If this is a string, it will be tokenized and the first token will be used.
	 * @returns {boolean} If the tokens cannot be safely placed next to each other, returns `false`. If the tokens can be placed
	 * next to each other, behavior is undefined (although it should return `true` in most cases).
	 */
	canTokensBeAdjacent(leftValue, rightValue) {
		const espreeOptions = {
			ecmaVersion: espree.latestEcmaVersion,
			comment: true,
			range: true,
		};

		let leftToken;

		if (typeof leftValue === "string") {
			let tokens;

			try {
				tokens = espree.tokenize(leftValue, espreeOptions);
			} catch {
				return false;
			}

			const comments = tokens.comments;

			leftToken = tokens.at(-1);
			if (comments.length) {
				const lastComment = comments.at(-1);

				if (!leftToken || lastComment.range[0] > leftToken.range[0]) {
					leftToken = lastComment;
				}
			}
		} else {
			leftToken = leftValue;
		}

		/*
		 * If a hashbang comment was passed as a token object from SourceCode,
		 * its type will be "Shebang" because of the way ESLint itself handles hashbangs.
		 * If a hashbang comment was passed in a string and then tokenized in this function,
		 * its type will be "Hashbang" because of the way Espree tokenizes hashbangs.
		 */
		if (leftToken.type === "Shebang" || leftToken.type === "Hashbang") {
			return false;
		}

		let rightToken;

		if (typeof rightValue === "string") {
			let tokens;

			try {
				tokens = espree.tokenize(rightValue, espreeOptions);
			} catch {
				return false;
			}

			const comments = tokens.comments;

			rightToken = tokens[0];
			if (comments.length) {
				const firstComment = comments[0];

				if (
					!rightToken ||
					firstComment.range[0] < rightToken.range[0]
				) {
					rightToken = firstComment;
				}
			}
		} else {
			rightToken = rightValue;
		}

		if (
			leftToken.type === "Punctuator" ||
			rightToken.type === "Punctuator"
		) {
			if (
				leftToken.type === "Punctuator" &&
				rightToken.type === "Punctuator"
			) {
				const PLUS_TOKENS = new Set(["+", "++"]);
				const MINUS_TOKENS = new Set(["-", "--"]);

				return !(
					(PLUS_TOKENS.has(leftToken.value) &&
						PLUS_TOKENS.has(rightToken.value)) ||
					(MINUS_TOKENS.has(leftToken.value) &&
						MINUS_TOKENS.has(rightToken.value))
				);
			}
			if (leftToken.type === "Punctuator" && leftToken.value === "/") {
				return !["Block", "Line", "RegularExpression"].includes(
					rightToken.type,
				);
			}
			return true;
		}

		if (
			leftToken.type === "String" ||
			rightToken.type === "String" ||
			leftToken.type === "Template" ||
			rightToken.type === "Template"
		) {
			return true;
		}

		if (
			leftToken.type !== "Numeric" &&
			rightToken.type === "Numeric" &&
			rightToken.value.startsWith(".")
		) {
			return true;
		}

		if (
			leftToken.type === "Block" ||
			rightToken.type === "Block" ||
			rightToken.type === "Line"
		) {
			return true;
		}

		if (rightToken.type === "PrivateIdentifier") {
			return true;
		}

		return false;
	},

	/**
	 * Get the `loc` object of a given name in a `/*globals` directive comment.
	 * @param {SourceCode} sourceCode The source code to convert index to loc.
	 * @param {Comment} comment The `/*globals` directive comment which include the name.
	 * @param {string} name The name to find.
	 * @returns {SourceLocation} The `loc` object.
	 */
	getNameLocationInGlobalDirectiveComment(sourceCode, comment, name) {
		const namePattern = new RegExp(
			`[\\s,]${escapeRegExp(name)}(?:$|[\\s,:])`,
			"gu",
		);

		// To ignore the first text "global".
		namePattern.lastIndex = comment.value.indexOf("global") + 6;

		// Search a given variable name.
		const match = namePattern.exec(comment.value);

		// Convert the index to loc.
		const start = sourceCode.getLocFromIndex(
			comment.range[0] + "/*".length + (match ? match.index + 1 : 0),
		);
		const end = {
			line: start.line,
			column: start.column + (match ? name.length : 1),
		};

		return { start, end };
	},

	/**
	 * Determines whether the given raw string contains an octal escape sequence
	 * or a non-octal decimal escape sequence ("\8", "\9").
	 *
	 * "\1", "\2" ... "\7", "\8", "\9"
	 * "\00", "\01" ... "\07", "\08", "\09"
	 *
	 * "\0", when not followed by a digit, is not an octal escape sequence.
	 * @param {string} rawString A string in its raw representation.
	 * @returns {boolean} `true` if the string contains at least one octal escape sequence
	 * or at least one non-octal decimal escape sequence.
	 */
	hasOctalOrNonOctalDecimalEscapeSequence(rawString) {
		return OCTAL_OR_NON_OCTAL_DECIMAL_ESCAPE_PATTERN.test(rawString);
	},

	/**
	 * Determines whether the given node is a template literal without expressions.
	 * @param {ASTNode} node Node to check.
	 * @returns {boolean} True if the node is a template literal without expressions.
	 */
	isStaticTemplateLiteral(node) {
		return node.type === "TemplateLiteral" && node.expressions.length === 0;
	},

	/**
	 * Determines whether the existing curly braces around the single statement are necessary to preserve the semantics of the code.
	 * The braces, which make the given block body, are necessary in either of the following situations:
	 *
	 * 1. The statement is a lexical declaration.
	 * 2. Without the braces, an `if` within the statement would become associated with an `else` after the closing brace:
	 *
	 *     if (a) {
	 *         if (b)
	 *             foo();
	 *     }
	 *     else
	 *         bar();
	 *
	 *     if (a)
	 *         while (b)
	 *             while (c) {
	 *                 while (d)
	 *                     if (e)
	 *                         while(f)
	 *                             foo();
	 *            }
	 *     else
	 *         bar();
	 * @param {ASTNode} node `BlockStatement` body with exactly one statement directly inside. The statement can have its own nested statements.
	 * @param {SourceCode} sourceCode The source code
	 * @returns {boolean} `true` if the braces are necessary - removing them (replacing the given `BlockStatement` body with its single statement content)
	 * would change the semantics of the code or produce a syntax error.
	 */
	areBracesNecessary(node, sourceCode) {
		/**
		 * Determines if the given node is a lexical declaration (let, const, using, await using, function, or class)
		 * @param {ASTNode} nodeToCheck The node to check
		 * @returns {boolean} True if the node is a lexical declaration
		 * @private
		 */
		function isLexicalDeclaration(nodeToCheck) {
			if (nodeToCheck.type === "VariableDeclaration") {
				return LEXICAL_DECLARATION_KINDS.has(nodeToCheck.kind);
			}

			return (
				nodeToCheck.type === "FunctionDeclaration" ||
				nodeToCheck.type === "ClassDeclaration"
			);
		}

		/**
		 * Checks if the given token is an `else` token or not.
		 * @param {Token} token The token to check.
		 * @returns {boolean} `true` if the token is an `else` token.
		 */
		function isElseKeywordToken(token) {
			return token.value === "else" && token.type === "Keyword";
		}

		/**
		 * Determines whether the given node has an `else` keyword token as the first token after.
		 * @param {ASTNode} nodeToCheck The node to check.
		 * @returns {boolean} `true` if the node is followed by an `else` keyword token.
		 */
		function isFollowedByElseKeyword(nodeToCheck) {
			const nextToken = sourceCode.getTokenAfter(nodeToCheck);

			return Boolean(nextToken) && isElseKeywordToken(nextToken);
		}

		/**
		 * Determines whether the code represented by the given node contains an `if` statement
		 * that would become associated with an `else` keyword directly appended to that code.
		 *
		 * Examples where it returns `true`:
		 *
		 *    if (a)
		 *        foo();
		 *
		 *    if (a) {
		 *        foo();
		 *    }
		 *
		 *    if (a)
		 *        foo();
		 *    else if (b)
		 *        bar();
		 *
		 *    while (a)
		 *        if (b)
		 *            if(c)
		 *                foo();
		 *            else
		 *                bar();
		 *
		 * Examples where it returns `false`:
		 *
		 *    if (a)
		 *        foo();
		 *    else
		 *        bar();
		 *
		 *    while (a) {
		 *        if (b)
		 *            if(c)
		 *                foo();
		 *            else
		 *                bar();
		 *    }
		 *
		 *    while (a)
		 *        if (b) {
		 *            if(c)
		 *                foo();
		 *        }
		 *        else
		 *            bar();
		 * @param {ASTNode} nodeToCheck Node representing the code to check.
		 * @returns {boolean} `true` if an `if` statement within the code would become associated with an `else` appended to that code.
		 */
		function hasUnsafeIf(nodeToCheck) {
			switch (nodeToCheck.type) {
				case "IfStatement":
					if (!nodeToCheck.alternate) {
						return true;
					}
					return hasUnsafeIf(nodeToCheck.alternate);
				case "ForStatement":
				case "ForInStatement":
				case "ForOfStatement":
				case "LabeledStatement":
				case "WithStatement":
				case "WhileStatement":
					return hasUnsafeIf(nodeToCheck.body);
				default:
					return false;
			}
		}

		const statement = node.body[0];

		return (
			isLexicalDeclaration(statement) ||
			(hasUnsafeIf(statement) && isFollowedByElseKeyword(node))
		);
	},

	isReferenceToGlobalVariable,
	isLogicalExpression,
	isCoalesceExpression,
	isMixedLogicalAndCoalesceExpressions,
	isNullLiteral,
	getStaticStringValue,
	getStaticPropertyName,
	skipChainExpression,
	isSpecificId,
	isSpecificMemberAccess,
	equalLiteralValue,
	isSameReference,
	isLogicalAssignmentOperator,
	getSwitchCaseColonToken,
	getModuleExportName,
	isConstant,
	isTopLevelExpressionStatement,
	isDirective,
	isStartOfExpressionStatement,
	canContinueExpressionInClassBody,
	needsPrecedingSemicolon,
	isImportAttributeKey,
	getOpeningParenOfParams,
};
h
x/**
 * @fileoverview Utility functions to locate the source text of each code unit in the value of a string literal or template token.
 * @author Francesco Trotta
 */

"use strict";

/**
 * Represents a code unit produced by the evaluation of a JavaScript common token like a string
 * literal or template token.
 */
class CodeUnit {
	constructor(start, source) {
		this.start = start;
		this.source = source;
	}

	get end() {
		return this.start + this.length;
	}

	get length() {
		return this.source.length;
	}
}

/**
 * An object used to keep track of the position in a source text where the next characters will be read.
 */
class TextReader {
	constructor(source) {
		this.source = source;
		this.pos = 0;
	}

	/**
	 * Advances the reading position of the specified number of characters.
	 * @param {number} length Number of characters to advance.
	 * @returns {void}
	 */
	advance(length) {
		this.pos += length;
	}

	/**
	 * Reads characters from the source.
	 * @param {number} [offset=0] The offset where reading starts, relative to the current position.
	 * @param {number} [length=1] Number of characters to read.
	 * @returns {string} A substring of source characters.
	 */
	read(offset = 0, length = 1) {
		const start = offset + this.pos;

		return this.source.slice(start, start + length);
	}
}

const SIMPLE_ESCAPE_SEQUENCES = {
	__proto__: null,
	b: "\b",
	f: "\f",
	n: "\n",
	r: "\r",
	t: "\t",
	v: "\v",
};

/**
 * Reads a hex escape sequence.
 * @param {TextReader} reader The reader should be positioned on the first hexadecimal digit.
 * @param {number} length The number of hexadecimal digits.
 * @returns {string} A code unit.
 */
function readHexSequence(reader, length) {
	const str = reader.read(0, length);
	const charCode = parseInt(str, 16);

	reader.advance(length);
	return String.fromCharCode(charCode);
}

/**
 * Reads a Unicode escape sequence.
 * @param {TextReader} reader The reader should be positioned after the "u".
 * @returns {string} A code unit.
 */
function readUnicodeSequence(reader) {
	const regExp = /\{(?<hexDigits>[\dA-F]+)\}/iuy;

	regExp.lastIndex = reader.pos;
	const match = regExp.exec(reader.source);

	if (match) {
		const codePoint = parseInt(match.groups.hexDigits, 16);

		reader.pos = regExp.lastIndex;
		return String.fromCodePoint(codePoint);
	}
	return readHexSequence(reader, 4);
}

/**
 * Reads an octal escape sequence.
 * @param {TextReader} reader The reader should be positioned after the first octal digit.
 * @param {number} maxLength The maximum number of octal digits.
 * @returns {string} A code unit.
 */
function readOctalSequence(reader, maxLength) {
	const [octalStr] = reader.read(-1, maxLength).match(/^[0-7]+/u);

	reader.advance(octalStr.length - 1);
	const octal = parseInt(octalStr, 8);

	return String.fromCharCode(octal);
}

/**
 * Reads an escape sequence or line continuation.
 * @param {TextReader} reader The reader should be positioned on the backslash.
 * @returns {string} A string of zero, one or two code units.
 */
function readEscapeSequenceOrLineContinuation(reader) {
	const char = reader.read(1);

	reader.advance(2);
	const unitChar = SIMPLE_ESCAPE_SEQUENCES[char];

	if (unitChar) {
		return unitChar;
	}
	switch (char) {
		case "x":
			return readHexSequence(reader, 2);
		case "u":
			return readUnicodeSequence(reader);
		case "\r":
			if (reader.read() === "\n") {
				reader.advance(1);
			}

		// fallthrough
		case "\n":
		case "\u2028":
		case "\u2029":
			return "";
		case "0":
		case "1":
		case "2":
		case "3":
			return readOctalSequence(reader, 3);
		case "4":
		case "5":
		case "6":
		case "7":
			return readOctalSequence(reader, 2);
		default:
			return char;
	}
}

/**
 * Reads an escape sequence or line continuation and generates the respective `CodeUnit` elements.
 * @param {TextReader} reader The reader should be positioned on the backslash.
 * @returns {Generator<CodeUnit>} Zero, one or two `CodeUnit` elements.
 */
function* mapEscapeSequenceOrLineContinuation(reader) {
	const start = reader.pos;
	const str = readEscapeSequenceOrLineContinuation(reader);
	const end = reader.pos;
	const source = reader.source.slice(start, end);

	switch (str.length) {
		case 0:
			break;
		case 1:
			yield new CodeUnit(start, source);
			break;
		default:
			yield new CodeUnit(start, source);
			yield new CodeUnit(start, source);
			break;
	}
}

/**
 * Parses a string literal.
 * @param {string} source The string literal to parse, including the delimiting quotes.
 * @returns {CodeUnit[]} A list of code units produced by the string literal.
 */
function parseStringLiteral(source) {
	const reader = new TextReader(source);
	const quote = reader.read();

	reader.advance(1);
	const codeUnits = [];

	for (;;) {
		const char = reader.read();

		if (char === quote) {
			break;
		}
		if (char === "\\") {
			codeUnits.push(...mapEscapeSequenceOrLineContinuation(reader));
		} else {
			codeUnits.push(new CodeUnit(reader.pos, char));
			reader.advance(1);
		}
	}
	return codeUnits;
}

/**
 * Parses a template token.
 * @param {string} source The template token to parse, including the delimiting sequences `` ` ``, `${` and `}`.
 * @returns {CodeUnit[]} A list of code units produced by the template token.
 */
function parseTemplateToken(source) {
	const reader = new TextReader(source);

	reader.advance(1);
	const codeUnits = [];

	for (;;) {
		const char = reader.read();

		if (char === "`" || (char === "$" && reader.read(1) === "{")) {
			break;
		}
		if (char === "\\") {
			codeUnits.push(...mapEscapeSequenceOrLineContinuation(reader));
		} else {
			let unitSource;

			if (char === "\r" && reader.read(1) === "\n") {
				unitSource = "\r\n";
			} else {
				unitSource = char;
			}
			codeUnits.push(new CodeUnit(reader.pos, unitSource));
			reader.advance(unitSource.length);
		}
	}
	return codeUnits;
}

module.exports = { parseStringLiteral, parseTemplateToken };
сx/**
 * @fileoverview Code path related utilities.
 */

"use strict";

/**
 * Checks all segments in a set and returns true if any are reachable.
 * @param {Set<CodePathSegment>} segments The segments to check.
 * @returns {boolean} `true` if any segment is reachable; `false` otherwise.
 */
function isAnySegmentReachable(segments) {
	for (const segment of segments) {
		if (segment.reachable) {
			return true;
		}
	}

	return false;
}

module.exports = { isAnySegmentReachable };
,0xA/**
 * @fileoverview Helper class to aid in constructing fix commands.
 * @author Alan Pierce
 */
"use strict";

//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------

/**
 * @import { SourceRange } from "@eslint/core";
 */

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./ast-utils");

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

/**
 * A helper class to combine fix options into a fix command. Currently, it
 * exposes some "retain" methods that extend the range of the text being
 * replaced so that other fixes won't touch that region in the same pass.
 */
class FixTracker {
	/**
	 * Create a new FixTracker.
	 * @param {ruleFixer} fixer A ruleFixer instance.
	 * @param {SourceCode} sourceCode A SourceCode object for the current code.
	 */
	constructor(fixer, sourceCode) {
		this.fixer = fixer;
		this.sourceCode = sourceCode;
		this.retainedRange = null;
	}

	/**
	 * Mark the given range as "retained", meaning that other fixes may not
	 * may not modify this region in the same pass.
	 * @param {SourceRange} range The range to retain.
	 * @returns {FixTracker} The same RuleFixer, for chained calls.
	 */
	retainRange(range) {
		this.retainedRange = range;
		return this;
	}

	/**
	 * Given a node, find the function containing it (or the entire program) and
	 * mark it as retained, meaning that other fixes may not modify it in this
	 * pass. This is useful for avoiding conflicts in fixes that modify control
	 * flow.
	 * @param {ASTNode} node The node to use as a starting point.
	 * @returns {FixTracker} The same RuleFixer, for chained calls.
	 */
	retainEnclosingFunction(node) {
		const functionNode = astUtils.getUpperFunction(node);

		return this.retainRange(
			functionNode ? functionNode.range : this.sourceCode.ast.range,
		);
	}

	/**
	 * Given a node or token, find the token before and afterward, and mark that
	 * range as retained, meaning that other fixes may not modify it in this
	 * pass. This is useful for avoiding conflicts in fixes that make a small
	 * change to the code where the AST should not be changed.
	 * @param {ASTNode|Token} nodeOrToken The node or token to use as a starting
	 *      point. The token to the left and right are use in the range.
	 * @returns {FixTracker} The same RuleFixer, for chained calls.
	 */
	retainSurroundingTokens(nodeOrToken) {
		const tokenBefore =
			this.sourceCode.getTokenBefore(nodeOrToken) || nodeOrToken;
		const tokenAfter =
			this.sourceCode.getTokenAfter(nodeOrToken) || nodeOrToken;

		return this.retainRange([tokenBefore.range[0], tokenAfter.range[1]]);
	}

	/**
	 * Create a fix command that replaces the given range with the given text,
	 * accounting for any retained ranges.
	 * @param {SourceRange} range The range to remove in the fix.
	 * @param {string} text The text to insert in place of the range.
	 * @returns {Object} The fix command.
	 */
	replaceTextRange(range, text) {
		let actualRange;

		if (this.retainedRange) {
			actualRange = [
				Math.min(this.retainedRange[0], range[0]),
				Math.max(this.retainedRange[1], range[1]),
			];
		} else {
			actualRange = range;
		}

		return this.fixer.replaceTextRange(
			actualRange,
			this.sourceCode.text.slice(actualRange[0], range[0]) +
				text +
				this.sourceCode.text.slice(range[1], actualRange[1]),
		);
	}

	/**
	 * Create a fix command that removes the given node or token, accounting for
	 * any retained ranges.
	 * @param {ASTNode|Token} nodeOrToken The node or token to remove.
	 * @returns {Object} The fix command.
	 */
	remove(nodeOrToken) {
		return this.replaceTextRange(nodeOrToken.range, "");
	}
}

module.exports = FixTracker;
|.x/**
 * @fileoverview A shared list of ES3 keywords.
 * @author Josh Perez
 */
"use strict";

module.exports = [
	"abstract",
	"boolean",
	"break",
	"byte",
	"case",
	"catch",
	"char",
	"class",
	"const",
	"continue",
	"debugger",
	"default",
	"delete",
	"do",
	"double",
	"else",
	"enum",
	"export",
	"extends",
	"false",
	"final",
	"finally",
	"float",
	"for",
	"function",
	"goto",
	"if",
	"implements",
	"import",
	"in",
	"instanceof",
	"int",
	"interface",
	"long",
	"native",
	"new",
	"null",
	"package",
	"private",
	"protected",
	"public",
	"return",
	"short",
	"static",
	"super",
	"switch",
	"synchronized",
	"this",
	"throw",
	"throws",
	"transient",
	"true",
	"try",
	"typeof",
	"var",
	"void",
	"volatile",
	"while",
	"with",
];
U;x>
/**
 * @fileoverview `Map` to load rules lazily.
 * @author Toru Nagashima <https://github.com/mysticatea>
 */
"use strict";

const debug = require("debug")("eslint:rules");

/** @typedef {import("../../types").Rule.RuleModule} Rule */

/**
 * The `Map` object that loads each rule when it's accessed.
 * @example
 * const rules = new LazyLoadingRuleMap([
 *     ["eqeqeq", () => require("eqeqeq")],
 *     ["semi", () => require("semi")],
 *     ["no-unused-vars", () => require("no-unused-vars")]
 * ]);
 *
 * rules.get("semi"); // call `() => require("semi")` here.
 *
 * @extends {Map<string, Rule>}
 */
class LazyLoadingRuleMap extends Map {
	/**
	 * Initialize this map.
	 * @param {Array<[string, function(): Rule]>} loaders The rule loaders.
	 */
	constructor(loaders) {
		let remaining = loaders.length;

		super(
			debug.enabled
				? loaders.map(([ruleId, load]) => {
						let cache = null;

						return [
							ruleId,
							() => {
								if (!cache) {
									debug(
										"Loading rule %o (remaining=%d)",
										ruleId,
										--remaining,
									);
									cache = load();
								}
								return cache;
							},
						];
					})
				: loaders,
		);

		// `super(...iterable)` uses `this.set()`, so disable it here.
		Object.defineProperty(LazyLoadingRuleMap.prototype, "set", {
			configurable: true,
			value: void 0,
		});
	}

	/**
	 * Get a rule.
	 * Each rule will be loaded on the first access.
	 * @param {string} ruleId The rule ID to get.
	 * @returns {Rule|undefined} The rule.
	 */
	get(ruleId) {
		const load = super.get(ruleId);

		return load && load();
	}

	/**
	 * Iterate rules.
	 * @returns {IterableIterator<Rule>} Rules.
	 */
	*values() {
		for (const load of super.values()) {
			yield load();
		}
	}

	/**
	 * Iterate rules.
	 * @returns {IterableIterator<[string, Rule]>} Rules.
	 */
	*entries() {
		for (const [ruleId, load] of super.entries()) {
			yield [ruleId, load()];
		}
	}

	/**
	 * Call a function with each rule.
	 * @param {Function} callbackFn The callback function.
	 * @param {any} [thisArg] The object to pass to `this` of the callback function.
	 * @returns {void}
	 */
	forEach(callbackFn, thisArg) {
		for (const [ruleId, load] of super.entries()) {
			callbackFn.call(thisArg, load(), ruleId, this);
		}
	}
}

// Forbid mutation.
Object.defineProperties(LazyLoadingRuleMap.prototype, {
	clear: { configurable: true, value: void 0 },
	delete: { configurable: true, value: void 0 },
	[Symbol.iterator]: {
		configurable: true,
		writable: true,
		value: LazyLoadingRuleMap.prototype.entries,
	},
});

module.exports = { LazyLoadingRuleMap };
vfVxd/**
 * @fileoverview Common utils for regular expressions.
 * @author Josh Goldberg
 * @author Toru Nagashima
 */

"use strict";

const { RegExpValidator } = require("@eslint-community/regexpp");

const REGEXPP_LATEST_ECMA_VERSION = 2025;

/**
 * Checks if the given regular expression pattern would be valid with the `u` flag.
 * @param {number} ecmaVersion ECMAScript version to parse in.
 * @param {string} pattern The regular expression pattern to verify.
 * @param {"u"|"v"} flag The type of Unicode flag
 * @returns {boolean} `true` if the pattern would be valid with the `u` flag.
 * `false` if the pattern would be invalid with the `u` flag or the configured
 * ecmaVersion doesn't support the `u` flag.
 */
function isValidWithUnicodeFlag(ecmaVersion, pattern, flag = "u") {
	if (flag === "u" && ecmaVersion <= 5) {
		// ecmaVersion <= 5 doesn't support the 'u' flag
		return false;
	}
	if (flag === "v" && ecmaVersion <= 2023) {
		return false;
	}

	const validator = new RegExpValidator({
		ecmaVersion: Math.min(ecmaVersion, REGEXPP_LATEST_ECMA_VERSION),
	});

	try {
		validator.validatePattern(
			pattern,
			void 0,
			void 0,
			flag === "u"
				? {
						unicode: /* uFlag = */ true,
					}
				: {
						unicodeSets: true,
					},
		);
	} catch {
		return false;
	}

	return true;
}

module.exports = {
	isValidWithUnicodeFlag,
	REGEXPP_LATEST_ECMA_VERSION,
};
zVx 100644 index.js }]SHA
c)aaa3100644 is-combining-character.js n)49LJyA100644 is-emoji-modifier.js Rjkw2:9<)A100644 is-regional-indicator-symbol.js {(f"|100644 is-surrogate-pair.js |oeӵ'\Wpry\xxA/**
 * @author Toru Nagashima <https://github.com/mysticatea>
 */
"use strict";

const isCombiningCharacter = require("./is-combining-character");
const isEmojiModifier = require("./is-emoji-modifier");
const isRegionalIndicatorSymbol = require("./is-regional-indicator-symbol");
const isSurrogatePair = require("./is-surrogate-pair");

module.exports = {
	isCombiningCharacter,
	isEmojiModifier,
	isRegionalIndicatorSymbol,
	isSurrogatePair,
};
ל
x2/**
 * @author Toru Nagashima <https://github.com/mysticatea>
 */
"use strict";

/**
 * Check whether a given character is a combining mark or not.
 * @param {number} codePoint The character code to check.
 * @returns {boolean} `true` if the character has the General Category of Combining Mark (M), consisting of `Mc`, `Me`, and `Mn`.
 */
module.exports = function isCombiningCharacter(codePoint) {
	return /^\p{M}$/u.test(String.fromCodePoint(codePoint));
};

imxl/**
 * @author Toru Nagashima <https://github.com/mysticatea>
 */
"use strict";

/**
 * Check whether a given character is an emoji modifier.
 * @param {number} code The character code to check.
 * @returns {boolean} `true` if the character is an emoji modifier.
 */
module.exports = function isEmojiModifier(code) {
	return code >= 0x1f3fb && code <= 0x1f3ff;
};
y#xu/**
 * @author Toru Nagashima <https://github.com/mysticatea>
 */
"use strict";

/**
 * Check whether a given character is a regional indicator symbol.
 * @param {number} code The character code to check.
 * @returns {boolean} `true` if the character is a regional indicator symbol.
 */
module.exports = function isRegionalIndicatorSymbol(code) {
	return code >= 0x1f1e6 && code <= 0x1f1ff;
};
x+/**
 * @author Toru Nagashima <https://github.com/mysticatea>
 */
"use strict";

/**
 * Check whether given two characters are a surrogate pair.
 * @param {number} lead The code of the lead character.
 * @param {number} tail The code of the tail character.
 * @returns {boolean} `true` if the character pair is a surrogate pair.
 */
module.exports = function isSurrogatePair(lead, tail) {
	return lead >= 0xd800 && lead < 0xdc00 && tail >= 0xdc00 && tail < 0xe000;
};
+xY/**
 * @fileoverview Ensures that the results of typeof are compared against a valid string
 * @author Ian Christian Myers
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "problem",

		defaultOptions: [
			{
				requireStringLiterals: false,
			},
		],

		docs: {
			description:
				"Enforce comparing `typeof` expressions against valid strings",
			recommended: true,
			url: "https://eslint.org/docs/latest/rules/valid-typeof",
		},

		hasSuggestions: true,

		schema: [
			{
				type: "object",
				properties: {
					requireStringLiterals: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],
		messages: {
			invalidValue: "Invalid typeof comparison value.",
			notString: "Typeof comparisons should be to string literals.",
			suggestString: 'Use `"{{type}}"` instead of `{{type}}`.',
		},
	},

	create(context) {
		const VALID_TYPES = new Set([
				"symbol",
				"undefined",
				"object",
				"boolean",
				"number",
				"string",
				"function",
				"bigint",
			]),
			OPERATORS = new Set(["==", "===", "!=", "!=="]);
		const sourceCode = context.sourceCode;
		const [{ requireStringLiterals }] = context.options;

		let globalScope;

		/**
		 * Checks whether the given node represents a reference to a global variable that is not declared in the source code.
		 * These identifiers will be allowed, as it is assumed that user has no control over the names of external global variables.
		 * @param {ASTNode} node `Identifier` node to check.
		 * @returns {boolean} `true` if the node is a reference to a global variable.
		 */
		function isReferenceToGlobalVariable(node) {
			const variable = globalScope.set.get(node.name);

			return (
				variable &&
				variable.defs.length === 0 &&
				variable.references.some(ref => ref.identifier === node)
			);
		}

		/**
		 * Determines whether a node is a typeof expression.
		 * @param {ASTNode} node The node
		 * @returns {boolean} `true` if the node is a typeof expression
		 */
		function isTypeofExpression(node) {
			return (
				node.type === "UnaryExpression" && node.operator === "typeof"
			);
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			Program(node) {
				globalScope = sourceCode.getScope(node);
			},

			UnaryExpression(node) {
				if (isTypeofExpression(node)) {
					const { parent } = node;

					if (
						parent.type === "BinaryExpression" &&
						OPERATORS.has(parent.operator)
					) {
						const sibling =
							parent.left === node ? parent.right : parent.left;

						if (
							sibling.type === "Literal" ||
							astUtils.isStaticTemplateLiteral(sibling)
						) {
							const value =
								sibling.type === "Literal"
									? sibling.value
									: sibling.quasis[0].value.cooked;

							if (!VALID_TYPES.has(value)) {
								context.report({
									node: sibling,
									messageId: "invalidValue",
								});
							}
						} else if (
							sibling.type === "Identifier" &&
							sibling.name === "undefined" &&
							isReferenceToGlobalVariable(sibling)
						) {
							context.report({
								node: sibling,
								messageId: requireStringLiterals
									? "notString"
									: "invalidValue",
								suggest: [
									{
										messageId: "suggestString",
										data: { type: "undefined" },
										fix(fixer) {
											return fixer.replaceText(
												sibling,
												'"undefined"',
											);
										},
									},
								],
							});
						} else if (
							requireStringLiterals &&
							!isTypeofExpression(sibling)
						) {
							context.report({
								node: sibling,
								messageId: "notString",
							});
						}
					}
				}
			},
		};
	},
};
$瑼x//**
 * @fileoverview Rule to enforce var declarations are only at the top of a function.
 * @author Danny Fritz
 * @author Gyandeep Singh
 */
"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		docs: {
			description:
				"Require `var` declarations be placed at the top of their containing scope",
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/vars-on-top",
		},

		schema: [],
		messages: {
			top: "All 'var' declarations must be at the top of the function scope.",
		},
	},

	create(context) {
		//--------------------------------------------------------------------------
		// Helpers
		//--------------------------------------------------------------------------

		/**
		 * Has AST suggesting a directive.
		 * @param {ASTNode} node any node
		 * @returns {boolean} whether the given node structurally represents a directive
		 */
		function looksLikeDirective(node) {
			return (
				node.type === "ExpressionStatement" &&
				node.expression.type === "Literal" &&
				typeof node.expression.value === "string"
			);
		}

		/**
		 * Check to see if its a ES6 import declaration
		 * @param {ASTNode} node any node
		 * @returns {boolean} whether the given node represents a import declaration
		 */
		function looksLikeImport(node) {
			return (
				node.type === "ImportDeclaration" ||
				node.type === "ImportSpecifier" ||
				node.type === "ImportDefaultSpecifier" ||
				node.type === "ImportNamespaceSpecifier"
			);
		}

		/**
		 * Checks whether a given node is a variable declaration or not.
		 * @param {ASTNode} node any node
		 * @returns {boolean} `true` if the node is a variable declaration.
		 */
		function isVariableDeclaration(node) {
			return (
				node.type === "VariableDeclaration" ||
				(node.type === "ExportNamedDeclaration" &&
					node.declaration &&
					node.declaration.type === "VariableDeclaration")
			);
		}

		/**
		 * Checks whether this variable is on top of the block body
		 * @param {ASTNode} node The node to check
		 * @param {ASTNode[]} statements collection of ASTNodes for the parent node block
		 * @returns {boolean} True if var is on top otherwise false
		 */
		function isVarOnTop(node, statements) {
			const l = statements.length;
			let i = 0;

			// Skip over directives and imports. Static blocks don't have either.
			if (node.parent.type !== "StaticBlock") {
				for (; i < l; ++i) {
					if (
						!looksLikeDirective(statements[i]) &&
						!looksLikeImport(statements[i])
					) {
						break;
					}
				}
			}

			for (; i < l; ++i) {
				if (!isVariableDeclaration(statements[i])) {
					return false;
				}
				if (statements[i] === node) {
					return true;
				}
			}

			return false;
		}

		/**
		 * Checks whether variable is on top at the global level
		 * @param {ASTNode} node The node to check
		 * @param {ASTNode} parent Parent of the node
		 * @returns {void}
		 */
		function globalVarCheck(node, parent) {
			if (!isVarOnTop(node, parent.body)) {
				context.report({ node, messageId: "top" });
			}
		}

		/**
		 * Checks whether variable is on top at functional block scope level
		 * @param {ASTNode} node The node to check
		 * @returns {void}
		 */
		function blockScopeVarCheck(node) {
			const { parent } = node;

			if (
				parent.type === "BlockStatement" &&
				/Function/u.test(parent.parent.type) &&
				isVarOnTop(node, parent.body)
			) {
				return;
			}

			if (
				parent.type === "StaticBlock" &&
				isVarOnTop(node, parent.body)
			) {
				return;
			}

			context.report({ node, messageId: "top" });
		}

		//--------------------------------------------------------------------------
		// Public API
		//--------------------------------------------------------------------------

		return {
			"VariableDeclaration[kind='var']"(node) {
				if (node.parent.type === "ExportNamedDeclaration") {
					globalVarCheck(node.parent, node.parent.parent);
				} else if (node.parent.type === "Program") {
					globalVarCheck(node, node.parent);
				} else {
					blockScopeVarCheck(node);
				}
			},
		};
	},
};
Qnꈲx/**
 * @fileoverview Rule to flag when IIFE is not wrapped in parens
 * @author Ilya Volodin
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");
const eslintUtils = require("@eslint-community/eslint-utils");

//----------------------------------------------------------------------
// Helpers
//----------------------------------------------------------------------

/**
 * Check if the given node is callee of a `NewExpression` node
 * @param {ASTNode} node node to check
 * @returns {boolean} True if the node is callee of a `NewExpression` node
 * @private
 */
function isCalleeOfNewExpression(node) {
	const maybeCallee =
		node.parent.type === "ChainExpression" ? node.parent : node;

	return (
		maybeCallee.parent.type === "NewExpression" &&
		maybeCallee.parent.callee === maybeCallee
	);
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "wrap-iife",
						url: "https://eslint.style/rules/wrap-iife",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description:
				"Require parentheses around immediate `function` invocations",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/wrap-iife",
		},

		schema: [
			{
				enum: ["outside", "inside", "any"],
			},
			{
				type: "object",
				properties: {
					functionPrototypeMethods: {
						type: "boolean",
						default: false,
					},
				},
				additionalProperties: false,
			},
		],

		fixable: "code",
		messages: {
			wrapInvocation:
				"Wrap an immediate function invocation in parentheses.",
			wrapExpression: "Wrap only the function expression in parens.",
			moveInvocation:
				"Move the invocation into the parens that contain the function.",
		},
	},

	create(context) {
		const style = context.options[0] || "outside";
		const includeFunctionPrototypeMethods =
			context.options[1] && context.options[1].functionPrototypeMethods;

		const sourceCode = context.sourceCode;

		/**
		 * Check if the node is wrapped in any (). All parens count: grouping parens and parens for constructs such as if()
		 * @param {ASTNode} node node to evaluate
		 * @returns {boolean} True if it is wrapped in any parens
		 * @private
		 */
		function isWrappedInAnyParens(node) {
			return astUtils.isParenthesised(sourceCode, node);
		}

		/**
		 * Check if the node is wrapped in grouping (). Parens for constructs such as if() don't count
		 * @param {ASTNode} node node to evaluate
		 * @returns {boolean} True if it is wrapped in grouping parens
		 * @private
		 */
		function isWrappedInGroupingParens(node) {
			return eslintUtils.isParenthesized(1, node, sourceCode);
		}

		/**
		 * Get the function node from an IIFE
		 * @param {ASTNode} node node to evaluate
		 * @returns {ASTNode} node that is the function expression of the given IIFE, or null if none exist
		 */
		function getFunctionNodeFromIIFE(node) {
			const callee = astUtils.skipChainExpression(node.callee);

			if (callee.type === "FunctionExpression") {
				return callee;
			}

			if (
				includeFunctionPrototypeMethods &&
				callee.type === "MemberExpression" &&
				callee.object.type === "FunctionExpression" &&
				(astUtils.getStaticPropertyName(callee) === "call" ||
					astUtils.getStaticPropertyName(callee) === "apply")
			) {
				return callee.object;
			}

			return null;
		}

		return {
			CallExpression(node) {
				const innerNode = getFunctionNodeFromIIFE(node);

				if (!innerNode) {
					return;
				}

				const isCallExpressionWrapped = isWrappedInAnyParens(node),
					isFunctionExpressionWrapped =
						isWrappedInAnyParens(innerNode);

				if (!isCallExpressionWrapped && !isFunctionExpressionWrapped) {
					context.report({
						node,
						messageId: "wrapInvocation",
						fix(fixer) {
							const nodeToSurround =
								style === "inside" ? innerNode : node;

							return fixer.replaceText(
								nodeToSurround,
								`(${sourceCode.getText(nodeToSurround)})`,
							);
						},
					});
				} else if (style === "inside" && !isFunctionExpressionWrapped) {
					context.report({
						node,
						messageId: "wrapExpression",
						fix(fixer) {
							// The outer call expression will always be wrapped at this point.

							if (
								isWrappedInGroupingParens(node) &&
								!isCalleeOfNewExpression(node)
							) {
								/*
								 * Parenthesize the function expression and remove unnecessary grouping parens around the call expression.
								 * Replace the range between the end of the function expression and the end of the call expression.
								 * for example, in `(function(foo) {}(bar))`, the range `(bar))` should get replaced with `)(bar)`.
								 */

								const parenAfter =
									sourceCode.getTokenAfter(node);

								return fixer.replaceTextRange(
									[innerNode.range[1], parenAfter.range[1]],
									`)${sourceCode.getText().slice(innerNode.range[1], parenAfter.range[0])}`,
								);
							}

							/*
							 * Call expression is wrapped in mandatory parens such as if(), or in necessary grouping parens.
							 * These parens cannot be removed, so just parenthesize the function expression.
							 */

							return fixer.replaceText(
								innerNode,
								`(${sourceCode.getText(innerNode)})`,
							);
						},
					});
				} else if (style === "outside" && !isCallExpressionWrapped) {
					context.report({
						node,
						messageId: "moveInvocation",
						fix(fixer) {
							/*
							 * The inner function expression will always be wrapped at this point.
							 * It's only necessary to replace the range between the end of the function expression
							 * and the call expression. For example, in `(function(foo) {})(bar)`, the range `)(bar)`
							 * should get replaced with `(bar))`.
							 */
							const parenAfter =
								sourceCode.getTokenAfter(innerNode);

							return fixer.replaceTextRange(
								[parenAfter.range[0], node.range[1]],
								`${sourceCode.getText().slice(parenAfter.range[1], node.range[1])})`,
							);
						},
					});
				}
			},
		};
	},
};
xw/**
 * @fileoverview Rule to flag when regex literals are not wrapped in parens
 * @author Matt DuVall <http://www.mattduvall.com>
 * @deprecated in ESLint v8.53.0
 */

"use strict";

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		deprecated: {
			message: "Formatting rules are being moved out of ESLint core.",
			url: "https://eslint.org/blog/2023/10/deprecating-formatting-rules/",
			deprecatedSince: "8.53.0",
			availableUntil: "11.0.0",
			replacedBy: [
				{
					message:
						"ESLint Stylistic now maintains deprecated stylistic core rules.",
					url: "https://eslint.style/guide/migration",
					plugin: {
						name: "@stylistic/eslint-plugin",
						url: "https://eslint.style",
					},
					rule: {
						name: "wrap-regex",
						url: "https://eslint.style/rules/wrap-regex",
					},
				},
			],
		},
		type: "layout",

		docs: {
			description: "Require parenthesis around regex literals",
			recommended: false,
			url: "https://eslint.org/docs/latest/rules/wrap-regex",
		},

		schema: [],
		fixable: "code",

		messages: {
			requireParens:
				"Wrap the regexp literal in parens to disambiguate the slash.",
		},
	},

	create(context) {
		const sourceCode = context.sourceCode;

		return {
			Literal(node) {
				const token = sourceCode.getFirstToken(node),
					nodeType = token.type;

				if (nodeType === "RegularExpression") {
					const beforeToken = sourceCode.getTokenBefore(node);
					const afterToken = sourceCode.getTokenAfter(node);
					const { parent } = node;

					if (
						parent.type === "MemberExpression" &&
						parent.object === node &&
						!(
							beforeToken &&
							beforeToken.value === "(" &&
							afterToken &&
							afterToken.value === ")"
						)
					) {
						context.report({
							node,
							messageId: "requireParens",
							fix: fixer =>
								fixer.replaceText(
									node,
									`(${sourceCode.getText(node)})`,
								),
						});
					}
				}
			},
		};
	},
};
q`d<Xx41?*yield* expressions.
 * @author Bryan SmithnTByield7yield\>Require or disallow spacing around the `*` in `yield*` express}LyieldC@$
const mode-<if (!option || typeof option === "string") {
				return {
		.		aft	
true },
		+	.-		}[option || "after"];
			}
			return option]);h;+9sourceCode.isSpaceBetween(leftToken, rightToken) !== modeQW=let messageId;

				if (spaceRequired) {
					messageId =
						side === "before" ? "missingBefore" : "missingAfter";
				} elsje {
					messageId =
						side === "before"
							? "unexpectedBefore"
							: "unexpectedAfter";
				}?yield* express"yield express.5(Expression(node) {
			if (!node.delegatetokens =,s(node, 3);
			const yieldToken = tokens[0];tokens[1];
			const nextToken = tokens[2];

			checkSpacing("before", yieldToken, starToken);
			checkSpacing("after", starToke+".YieldExpression: checkExpression,
		};
	},
};
_4x%/**
 * @fileoverview Rule to require or disallow yoda comparisons
 * @author Nicholas C. Zakas
 */
"use strict";

//--------------------------------------------------------------------------
// Requirements
//--------------------------------------------------------------------------

const astUtils = require("./utils/ast-utils");

//--------------------------------------------------------------------------
// Helpers
//--------------------------------------------------------------------------

/**
 * Determines whether an operator is a comparison operator.
 * @param {string} operator The operator to check.
 * @returns {boolean} Whether or not it is a comparison operator.
 */
function isComparisonOperator(operator) {
	return /^(?:==|===|!=|!==|<|>|<=|>=)$/u.test(operator);
}

/**
 * Determines whether an operator is an equality operator.
 * @param {string} operator The operator to check.
 * @returns {boolean} Whether or not it is an equality operator.
 */
function isEqualityOperator(operator) {
	return /^(?:==|===)$/u.test(operator);
}

/**
 * Determines whether an operator is one used in a range test.
 * Allowed operators are `<` and `<=`.
 * @param {string} operator The operator to check.
 * @returns {boolean} Whether the operator is used in range tests.
 */
function isRangeTestOperator(operator) {
	return ["<", "<="].includes(operator);
}

/**
 * Determines whether a non-Literal node is a negative number that should be
 * treated as if it were a single Literal node.
 * @param {ASTNode} node Node to test.
 * @returns {boolean} True if the node is a negative number that looks like a
 *                    real literal and should be treated as such.
 */
function isNegativeNumericLiteral(node) {
	return (
		node.type === "UnaryExpression" &&
		node.operator === "-" &&
		node.prefix &&
		astUtils.isNumericLiteral(node.argument)
	);
}

/**
 * Determines whether a non-Literal node should be treated as a single Literal node.
 * @param {ASTNode} node Node to test
 * @returns {boolean} True if the node should be treated as a single Literal node.
 */
function looksLikeLiteral(node) {
	return (
		isNegativeNumericLiteral(node) || astUtils.isStaticTemplateLiteral(node)
	);
}

/**
 * Attempts to derive a Literal node from nodes that are treated like literals.
 * @param {ASTNode} node Node to normalize.
 * @returns {ASTNode} One of the following options.
 *  1. The original node if the node is already a Literal
 *  2. A normalized Literal node with the negative number as the value if the
 *     node represents a negative number literal.
 *  3. A normalized Literal node with the string as the value if the node is
 *     a Template Literal without expression.
 *  4. Otherwise `null`.
 */
function getNormalizedLiteral(node) {
	if (node.type === "Literal") {
		return node;
	}

	if (isNegativeNumericLiteral(node)) {
		return {
			type: "Literal",
			value: -node.argument.value,
			raw: `-${node.argument.value}`,
		};
	}

	if (astUtils.isStaticTemplateLiteral(node)) {
		return {
			type: "Literal",
			value: node.quasis[0].value.cooked,
			raw: node.quasis[0].value.raw,
		};
	}

	return null;
}

//------------------------------------------------------------------------------
// Rule Definition
//------------------------------------------------------------------------------

/** @type {import('../types').Rule.RuleModule} */
module.exports = {
	meta: {
		type: "suggestion",

		defaultOptions: [
			"never",
			{
				exceptRange: false,
				onlyEquality: false,
			},
		],

		docs: {
			description: 'Require or disallow "Yoda" conditions',
			recommended: false,
			frozen: true,
			url: "https://eslint.org/docs/latest/rules/yoda",
		},

		schema: [
			{
				enum: ["always", "never"],
			},
			{
				type: "object",
				properties: {
					exceptRange: {
						type: "boolean",
					},
					onlyEquality: {
						type: "boolean",
					},
				},
				additionalProperties: false,
			},
		],

		fixable: "code",
		messages: {
			expected:
				"Expected literal to be on the {{expectedSide}} side of {{operator}}.",
		},
	},

	create(context) {
		const [when, { exceptRange, onlyEquality }] = context.options;
		const always = when === "always";
		const sourceCode = context.sourceCode;

		/**
		 * Determines whether node represents a range test.
		 * A range test is a "between" test like `(0 <= x && x < 1)` or an "outside"
		 * test like `(x < 0 || 1 <= x)`. It must be wrapped in parentheses, and
		 * both operators must be `<` or `<=`. Finally, the literal on the left side
		 * must be less than or equal to the literal on the right side so that the
		 * test makes any sense.
		 * @param {ASTNode} node LogicalExpression node to test.
		 * @returns {boolean} Whether node is a range test.
		 */
		function isRangeTest(node) {
			const left = node.left,
				right = node.right;

			/**
			 * Determines whether node is of the form `0 <= x && x < 1`.
			 * @returns {boolean} Whether node is a "between" range test.
			 */
			function isBetweenTest() {
				if (
					node.operator === "&&" &&
					astUtils.isSameReference(left.right, right.left)
				) {
					const leftLiteral = getNormalizedLiteral(left.left);
					const rightLiteral = getNormalizedLiteral(right.right);

					if (leftLiteral === null && rightLiteral === null) {
						return false;
					}

					if (rightLiteral === null || leftLiteral === null) {
						return true;
					}

					if (leftLiteral.value <= rightLiteral.value) {
						return true;
					}
				}
				return false;
			}

			/**
			 * Determines whether node is of the form `x < 0 || 1 <= x`.
			 * @returns {boolean} Whether node is an "outside" range test.
			 */
			function isOutsideTest() {
				if (
					node.operator === "||" &&
					astUtils.isSameReference(left.left, right.right)
				) {
					const leftLiteral = getNormalizedLiteral(left.right);
					const rightLiteral = getNormalizedLiteral(right.left);

					if (leftLiteral === null && rightLiteral === null) {
						return false;
					}

					if (rightLiteral === null || leftLiteral === null) {
						return true;
					}

					if (leftLiteral.value <= rightLiteral.value) {
						return true;
					}
				}

				return false;
			}

			/**
			 * Determines whether node is wrapped in parentheses.
			 * @returns {boolean} Whether node is preceded immediately by an open
			 *                    paren token and followed immediately by a close
			 *                    paren token.
			 */
			function isParenWrapped() {
				return astUtils.isParenthesised(sourceCode, node);
			}

			return (
				node.type === "LogicalExpression" &&
				left.type === "BinaryExpression" &&
				right.type === "BinaryExpression" &&
				isRangeTestOperator(left.operator) &&
				isRangeTestOperator(right.operator) &&
				(isBetweenTest() || isOutsideTest()) &&
				isParenWrapped()
			);
		}

		const OPERATOR_FLIP_MAP = {
			"===": "===",
			"!==": "!==",
			"==": "==",
			"!=": "!=",
			"<": ">",
			">": "<",
			"<=": ">=",
			">=": "<=",
		};

		/**
		 * Returns a string representation of a BinaryExpression node with its sides/operator flipped around.
		 * @param {ASTNode} node The BinaryExpression node
		 * @returns {string} A string representation of the node with the sides and operator flipped
		 */
		function getFlippedString(node) {
			const operatorToken = sourceCode.getFirstTokenBetween(
				node.left,
				node.right,
				token => token.value === node.operator,
			);
			const lastLeftToken = sourceCode.getTokenBefore(operatorToken);
			const firstRightToken = sourceCode.getTokenAfter(operatorToken);

			const source = sourceCode.getText();

			const leftText = source.slice(
				node.range[0],
				lastLeftToken.range[1],
			);
			const textBeforeOperator = source.slice(
				lastLeftToken.range[1],
				operatorToken.range[0],
			);
			const textAfterOperator = source.slice(
				operatorToken.range[1],
				firstRightToken.range[0],
			);
			const rightText = source.slice(
				firstRightToken.range[0],
				node.range[1],
			);

			const tokenBefore = sourceCode.getTokenBefore(node);
			const tokenAfter = sourceCode.getTokenAfter(node);
			let prefix = "";
			let suffix = "";

			if (
				tokenBefore &&
				tokenBefore.range[1] === node.range[0] &&
				!astUtils.canTokensBeAdjacent(tokenBefore, firstRightToken)
			) {
				prefix = " ";
			}

			if (
				tokenAfter &&
				node.range[1] === tokenAfter.range[0] &&
				!astUtils.canTokensBeAdjacent(lastLeftToken, tokenAfter)
			) {
				suffix = " ";
			}

			return (
				prefix +
				rightText +
				textBeforeOperator +
				OPERATOR_FLIP_MAP[operatorToken.value] +
				textAfterOperator +
				leftText +
				suffix
			);
		}

		//--------------------------------------------------------------------------
		// Public
		//--------------------------------------------------------------------------

		return {
			BinaryExpression(node) {
				const expectedLiteral = always ? node.left : node.right;
				const expectedNonLiteral = always ? node.right : node.left;

				// If `expectedLiteral` is not a literal, and `expectedNonLiteral` is a literal, raise an error.
				if (
					(expectedNonLiteral.type === "Literal" ||
						looksLikeLiteral(expectedNonLiteral)) &&
					!(
						expectedLiteral.type === "Literal" ||
						looksLikeLiteral(expectedLiteral)
					) &&
					!(!isEqualityOperator(node.operator) && onlyEquality) &&
					isComparisonOperator(node.operator) &&
					!(exceptRange && isRangeTest(node.parent))
				) {
					context.report({
						node,
						messageId: "expected",
						data: {
							operator: node.operator,
							expectedSide: always ? "left" : "right",
						},
						fix: fixer =>
							fixer.replaceText(node, getFlippedString(node)),
					});
				}
			},
		};
	},
};
&mx A100644 parser-service.js zn<ތY$)@"100644 processor-service.js o{i]NAF ?#=[100644 suppressions-service.js an>)Xia	jp+CR9~100644 warning-service.js ̋PkO$>=C<Gox/**
 * @fileoverview ESLint Parser
 * @author Nicholas C. Zakas
 */
/* eslint class-methods-use-this: off -- Anticipate future constructor arguments. */

"use strict";

//-----------------------------------------------------------------------------
// Types
//-----------------------------------------------------------------------------

/** @typedef {import("../linter/vfile.js").VFile} VFile */
/** @typedef {import("@eslint/core").Language} Language */
/** @typedef {import("@eslint/core").LanguageOptions} LanguageOptions */

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * The parser for ESLint.
 */
class ParserService {
	/**
	 * Parses the given file synchronously.
	 * @param {VFile} file The file to parse.
	 * @param {{language:Language,languageOptions:LanguageOptions}} config The configuration to use.
	 * @returns {Object} An object with the parsed source code or errors.
	 * @throws {Error} If the parser returns a promise.
	 */
	parseSync(file, config) {
		const { language, languageOptions } = config;
		const result = language.parse(file, { languageOptions });

		if (typeof result.then === "function") {
			throw new Error("Unsupported: Language parser returned a promise.");
		}

		if (result.ok) {
			return {
				ok: true,
				sourceCode: language.createSourceCode(file, result, {
					languageOptions,
				}),
			};
		}

		// if we made it to here there was an error
		return {
			ok: false,
			errors: result.errors.map(error => ({
				ruleId: null,
				fatal: true,
				severity: 2,
				message: `Parsing error: ${error.message}`,
				line: error.line,
				column: error.column,
			})),
		};
	}
}

module.exports = { ParserService };
Cuxv/**
 * @fileoverview ESLint Processor Service
 * @author Nicholas C. Zakas
 */
/* eslint class-methods-use-this: off -- Anticipate future constructor arguments. */

"use strict";

//-----------------------------------------------------------------------------
// Requirements
//-----------------------------------------------------------------------------

const path = require("node:path");
const { VFile } = require("../linter/vfile.js");

//-----------------------------------------------------------------------------
// Types
//-----------------------------------------------------------------------------

/** @typedef {import("../types").Linter.LintMessage} LintMessage */
/** @typedef {import("../linter/vfile.js").VFile} VFile */
/** @typedef {import("@eslint/core").Language} Language */
/** @typedef {import("eslint").Linter.Processor} Processor */

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * The service that applies processors to files.
 */
class ProcessorService {
	/**
	 * Preprocesses the given file synchronously.
	 * @param {VFile} file The file to preprocess.
	 * @param {{processor:Processor}} config The configuration to use.
	 * @returns {{ok:boolean, files?: Array<VFile>, errors?: Array<LintMessage>}} An array of preprocessed files or errors.
	 * @throws {Error} If the preprocessor returns a promise.
	 */
	preprocessSync(file, config) {
		const { processor } = config;
		let blocks;

		try {
			blocks = processor.preprocess(file.rawBody, file.path);
		} catch (ex) {
			// If the message includes a leading line number, strip it:
			const message = `Preprocessing error: ${ex.message.replace(/^line \d+:/iu, "").trim()}`;

			return {
				ok: false,
				errors: [
					{
						ruleId: null,
						fatal: true,
						severity: 2,
						message,
						line: ex.lineNumber,
						column: ex.column,
					},
				],
			};
		}

		if (typeof blocks.then === "function") {
			throw new Error("Unsupported: Preprocessor returned a promise.");
		}

		return {
			ok: true,
			files: blocks.map((block, i) => {
				// Legacy behavior: return the block as a string
				if (typeof block === "string") {
					return block;
				}

				const filePath = path.join(file.path, `${i}_${block.filename}`);

				return new VFile(filePath, block.text, {
					physicalPath: file.physicalPath,
				});
			}),
		};
	}

	/**
	 * Postprocesses the given messages synchronously.
	 * @param {VFile} file The file to postprocess.
	 * @param {LintMessage[][]} messages The messages to postprocess.
	 * @param {{processor:Processor}} config The configuration to use.
	 * @returns {LintMessage[]} The postprocessed messages.
	 */
	postprocessSync(file, messages, config) {
		const { processor } = config;

		return processor.postprocess(messages, file.path);
	}
}

module.exports = { ProcessorService };
ntx"/**
 * @fileoverview Manages the suppressed violations.
 * @author Iacovos Constantinou
 */

"use strict";

//-----------------------------------------------------------------------------
// Requirements
//-----------------------------------------------------------------------------

const fs = require("node:fs");
const path = require("node:path");
const { calculateStatsPerFile } = require("../shared/message-counts");
const stringify = require("json-stable-stringify-without-jsonify");

//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------

// For VSCode IntelliSense
/** @typedef {import("../types").Linter.LintMessage} LintMessage */
/** @typedef {import("../types").ESLint.LintResult} LintResult */
/** @typedef {Record<string, Record<string, { count: number; }>>} SuppressedViolations */

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * Manages the suppressed violations.
 */
class SuppressionsService {
	static DEFAULT_SUPPRESSIONS_FILENAME = "eslint-suppressions.json";

	filePath = "";
	cwd = "";

	/**
	 * Creates a new instance of SuppressionsService.
	 * @param {Object} options The options.
	 * @param {string} [options.filePath] The location of the suppressions file.
	 * @param {string} [options.cwd] The current working directory.
	 */
	constructor({ filePath, cwd }) {
		this.filePath = filePath;
		this.cwd = cwd;
	}

	/**
	 * Updates the suppressions file based on the current violations and the provided rules.
	 * If no rules are provided, all violations are suppressed.
	 * @param {LintResult[]|undefined} results The lint results.
	 * @param {string[]|undefined} rules The rules to suppress.
	 * @returns {Promise<void>}
	 */
	async suppress(results, rules) {
		const suppressions = await this.load();

		for (const result of results) {
			const relativeFilePath = this.getRelativeFilePath(result.filePath);
			const violationsByRule = SuppressionsService.countViolationsByRule(
				result.messages,
			);

			for (const ruleId in violationsByRule) {
				if (rules && !rules.includes(ruleId)) {
					continue;
				}

				suppressions[relativeFilePath] ??= {};
				suppressions[relativeFilePath][ruleId] =
					violationsByRule[ruleId];
			}
		}

		return this.save(suppressions);
	}

	/**
	 * Removes old, unused suppressions for violations that do not occur anymore.
	 * @param {LintResult[]} results The lint results.
	 * @returns {Promise<void>} No return value.
	 */
	async prune(results) {
		const suppressions = await this.load();
		const { unused } = this.applySuppressions(results, suppressions);

		for (const file in unused) {
			if (!suppressions[file]) {
				continue;
			}

			for (const rule in unused[file]) {
				if (!suppressions[file][rule]) {
					continue;
				}

				const suppressionsCount = suppressions[file][rule].count;
				const violationsCount = unused[file][rule].count;

				if (suppressionsCount === violationsCount) {
					// Remove unused rules
					delete suppressions[file][rule];
				} else {
					// Update the count to match the new number of violations
					suppressions[file][rule].count -= violationsCount;
				}
			}

			// Cleanup files with no rules
			if (Object.keys(suppressions[file]).length === 0) {
				delete suppressions[file];
			}
		}

		for (const file of Object.keys(suppressions)) {
			const absolutePath = path.resolve(this.cwd, file);

			if (!fs.existsSync(absolutePath)) {
				delete suppressions[file];
			}
		}

		return this.save(suppressions);
	}

	/**
	 * Checks the provided suppressions against the lint results.
	 *
	 * For each file, counts the number of violations per rule.
	 * For each rule in each file, compares the number of violations against the counter from the suppressions file.
	 * If the number of violations is less or equal to the counter, messages are moved to `LintResult#suppressedMessages` and ignored.
	 * Otherwise, all violations are reported as usual.
	 * @param {LintResult[]} results The lint results.
	 * @param {SuppressedViolations} suppressions The suppressions.
	 * @returns {{
	 *   results: LintResult[],
	 *   unused: SuppressedViolations
	 * }} The updated results and the unused suppressions.
	 */
	applySuppressions(results, suppressions) {
		/**
		 * We copy the results to avoid modifying the original objects
		 * We remove only result messages that are matched and hence suppressed
		 * We leave the rest untouched to minimize the risk of losing parts of the original data
		 */
		const filtered = structuredClone(results);
		const unused = {};

		for (const result of filtered) {
			const relativeFilePath = this.getRelativeFilePath(result.filePath);

			if (!suppressions[relativeFilePath]) {
				continue;
			}

			const violationsByRule = SuppressionsService.countViolationsByRule(
				result.messages,
			);
			let wasSuppressed = false;

			for (const ruleId in violationsByRule) {
				if (!suppressions[relativeFilePath][ruleId]) {
					continue;
				}

				const suppressionsCount =
					suppressions[relativeFilePath][ruleId].count;
				const violationsCount = violationsByRule[ruleId].count;

				// Suppress messages if the number of violations is less or equal to the suppressions count
				if (violationsCount <= suppressionsCount) {
					SuppressionsService.suppressMessagesByRule(result, ruleId);
					wasSuppressed = true;
				}

				// Update the count to match the new number of violations, otherwise remove the rule entirely
				if (violationsCount < suppressionsCount) {
					unused[relativeFilePath] ??= {};
					unused[relativeFilePath][ruleId] ??= {};
					unused[relativeFilePath][ruleId].count =
						suppressionsCount - violationsCount;
				}
			}

			// Mark as unused all the suppressions that were not matched against a rule
			for (const ruleId in suppressions[relativeFilePath]) {
				if (violationsByRule[ruleId]) {
					continue;
				}

				unused[relativeFilePath] ??= {};
				unused[relativeFilePath][ruleId] =
					suppressions[relativeFilePath][ruleId];
			}

			// Recalculate stats if messages were suppressed
			if (wasSuppressed) {
				Object.assign(result, calculateStatsPerFile(result.messages));
			}
		}

		return {
			results: filtered,
			unused,
		};
	}

	/**
	 * Loads the suppressions file.
	 * @throws {Error} If the suppressions file cannot be parsed.
	 * @returns {Promise<SuppressedViolations>} The suppressions.
	 */
	async load() {
		try {
			const data = await fs.promises.readFile(this.filePath, "utf8");

			return JSON.parse(data);
		} catch (err) {
			if (err.code === "ENOENT") {
				return {};
			}
			throw new Error(
				`Failed to parse suppressions file at ${this.filePath}`,
				{
					cause: err,
				},
			);
		}
	}

	/**
	 * Updates the suppressions file.
	 * @param {SuppressedViolations} suppressions The suppressions to save.
	 * @returns {Promise<void>}
	 * @private
	 */
	save(suppressions) {
		return fs.promises.writeFile(
			this.filePath,
			stringify(suppressions, { space: 2 }),
		);
	}

	/**
	 * Counts the violations by rule, ignoring warnings.
	 * @param {LintMessage[]} messages The messages to count.
	 * @returns {Record<string, number>} The number of violations by rule.
	 */
	static countViolationsByRule(messages) {
		return messages.reduce((totals, message) => {
			if (message.severity === 2 && message.ruleId) {
				totals[message.ruleId] ??= { count: 0 };
				totals[message.ruleId].count++;
			}
			return totals;
		}, {});
	}

	/**
	 * Returns the relative path of a file to the current working directory.
	 * Always in POSIX format for consistency and interoperability.
	 * @param {string} filePath The file path.
	 * @returns {string} The relative file path.
	 */
	getRelativeFilePath(filePath) {
		return path
			.relative(this.cwd, filePath)
			.split(path.sep)
			.join(path.posix.sep);
	}

	/**
	 * Moves the messages matching the rule to `LintResult#suppressedMessages` and updates the stats.
	 * @param {LintResult} result The result to update.
	 * @param {string} ruleId The rule to suppress.
	 * @returns {void}
	 */
	static suppressMessagesByRule(result, ruleId) {
		const suppressedMessages = result.messages.filter(
			message => message.ruleId === ruleId,
		);

		result.suppressedMessages = result.suppressedMessages.concat(
			suppressedMessages.map(message => {
				message.suppressions = [
					{
						kind: "file",
						justification: "",
					},
				];

				return message;
			}),
		);

		result.messages = result.messages.filter(
			message => message.ruleId !== ruleId,
		);
	}
}

module.exports = { SuppressionsService };
>x
!/**
 * @fileoverview Emits warnings for ESLint.
 * @author Francesco Trotta
 */

"use strict";

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * A service that emits warnings for ESLint.
 */
class WarningService {
	/**
	 * Creates a new instance of the service.
	 * @param {{ emitWarning?: ((warning: string, type: string) => void) | undefined }} [options] A function called internally to emit warnings using API provided by the runtime.
	 */
	constructor({
		emitWarning = globalThis.process?.emitWarning ?? (() => {}),
	} = {}) {
		this.emitWarning = emitWarning;
	}

	/**
	 * Emits a warning when circular fixes are detected while fixing a file.
	 * This method is used by the Linter and is safe to call outside Node.js.
	 * @param {string} filename The name of the file being fixed.
	 * @returns {void}
	 */
	emitCircularFixesWarning(filename) {
		this.emitWarning(
			`Circular fixes detected while fixing ${filename}. It is likely that you have conflicting rules in your configuration.`,
			"ESLintCircularFixesWarning",
		);
	}

	/**
	 * Emits a warning when an empty config file has been loaded.
	 * @param {string} configFilePath The path to the config file.
	 * @returns {void}
	 */
	emitEmptyConfigWarning(configFilePath) {
		this.emitWarning(
			`Running ESLint with an empty config (from ${configFilePath}). Please double-check that this is what you want. If you want to run ESLint with an empty config, export [{}] to remove this warning.`,
			"ESLintEmptyConfigWarning",
		);
	}

	/**
	 * Emits a warning when an ".eslintignore" file is found.
	 * @returns {void}
	 */
	emitESLintIgnoreWarning() {
		this.emitWarning(
			'The ".eslintignore" file is no longer supported. Switch to using the "ignores" property in "eslint.config.js": https://eslint.org/docs/latest/use/configure/migration-guide#ignore-files',
			"ESLintIgnoreWarning",
		);
	}

	/**
	 * Emits a warning when an inactive flag is used.
	 * This method is used by the Linter and is safe to call outside Node.js.
	 * @param {string} flag The name of the flag.
	 * @param {string} message The warning message.
	 * @returns {void}
	 */
	emitInactiveFlagWarning(flag, message) {
		this.emitWarning(message, `ESLintInactiveFlag_${flag}`);
	}

	/**
	 * Emits a warning when a suboptimal concurrency setting is detected.
	 * Currently, this is only used to warn when the net linting ratio is low.
	 * @param {string} notice A notice about how to improve performance.
	 * @returns {void}
	 */
	emitPoorConcurrencyWarning(notice) {
		this.emitWarning(
			`You may ${notice} to improve performance.`,
			"ESLintPoorConcurrencyWarning",
		);
	}
}

module.exports = { WarningService };
ĊO1x100644 ajv.js \\Atpʫ:V100644 assert.js MضU8A=&100644 ast-utils.js sh(~PIZr100644 deep-merge-arrays.js JnyXDD4_100644 directives.js Y}#<-Bd100644 flags.js PEmkiV6{k100644 logging.js >e19j޸5100644 message-counts.js ~Ic-^'NTD100644 naming.js jϣ7P{c.100644 option-utils.js 	RFoOgr100644 relative-module-resolver.js mZ@@L100644 runtime-info.js Tv	ڒΖ F100644 serialization.js ˊ>$p/m!I100644 severity.js 8'oJ\ƭhnҥ"100644 stats.js yw3w`^kcr100644 string-utils.js L[ۣ.0:t100644 text-table.js HkPDoNPG[ 100644 translate-cli-options.js GsΏjP100644 traverser.js ;,^lO_\?T%Α35:x\/**
 * @fileoverview The instance of Ajv validator.
 * @author Evgeny Poberezkin
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const Ajv = require("ajv"),
	metaSchema = require("ajv/lib/refs/json-schema-draft-04.json");

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

module.exports = (additionalOptions = {}) => {
	const ajv = new Ajv({
		meta: false,
		useDefaults: true,
		validateSchema: false,
		missingRefs: "ignore",
		verbose: true,
		schemaId: "auto",
		...additionalOptions,
	});

	ajv.addMetaSchema(metaSchema);
	// eslint-disable-next-line no-underscore-dangle -- Ajv's API
	ajv._opts.defaultMeta = metaSchema.id;

	return ajv;
};
Dw x/**
 * @fileoverview Assertion utilities equivalent to the Node.js node:asserts module.
 * @author Josh Goldberg
 */

"use strict";

/**
 * Throws an error if the input is not truthy.
 * @param {unknown} value The input that is checked for being truthy.
 * @param {string} message Message to throw if the input is not truthy.
 * @returns {void}
 * @throws {Error} When the condition is not truthy.
 */
function ok(value, message = "Assertion failed.") {
	if (!value) {
		throw new Error(message);
	}
}

module.exports = ok;
28x~/**
 * @fileoverview Common utils for AST.
 *
 * This file contains only shared items for core and rules.
 * If you make a utility for rules, please see `../rules/utils/ast-utils.js`.
 *
 * @author Toru Nagashima <https://github.com/mysticatea>
 */
"use strict";

const breakableTypePattern =
	/^(?:(?:Do)?While|For(?:In|Of)?|Switch)Statement$/u;
const lineBreakPattern = /\r\n|[\r\n\u2028\u2029]/u;
const shebangPattern = /^#!([^\r\n]+)/u;

/**
 * Creates a version of the `lineBreakPattern` regex with the global flag.
 * Global regexes are mutable, so this needs to be a function instead of a constant.
 * @returns {RegExp} A global regular expression that matches line terminators
 */
function createGlobalLinebreakMatcher() {
	return new RegExp(lineBreakPattern.source, "gu");
}

module.exports = {
	breakableTypePattern,
	lineBreakPattern,
	createGlobalLinebreakMatcher,
	shebangPattern,
};
3Ebx&/**
 * @fileoverview Applies default rule options
 * @author JoshuaKGoldberg
 */

"use strict";

/**
 * Check if the variable contains an object strictly rejecting arrays
 * @param {unknown} value an object
 * @returns {boolean} Whether value is an object
 */
function isObjectNotArray(value) {
	return typeof value === "object" && value !== null && !Array.isArray(value);
}

/**
 * Deeply merges second on top of first, creating a new {} object if needed.
 * @param {T} first Base, default value.
 * @param {U} second User-specified value.
 * @returns {T | U | (T & U)} Merged equivalent of second on top of first.
 */
function deepMergeObjects(first, second) {
	if (second === void 0) {
		return first;
	}

	if (!isObjectNotArray(first) || !isObjectNotArray(second)) {
		return second;
	}

	const result = { ...first, ...second };

	for (const key of Object.keys(second)) {
		if (Object.prototype.propertyIsEnumerable.call(first, key)) {
			result[key] = deepMergeObjects(first[key], second[key]);
		}
	}

	return result;
}

/**
 * Deeply merges second on top of first, creating a new [] array if needed.
 * @param {T[]} first Base, default values.
 * @param {U[]} second User-specified values.
 * @returns {(T | U | (T & U))[]} Merged equivalent of second on top of first.
 */
function deepMergeArrays(first, second) {
	if (!first || !second) {
		return second || first || [];
	}

	return [
		...first.map((value, i) =>
			deepMergeObjects(value, i < second.length ? second[i] : void 0),
		),
		...second.slice(first.length),
	];
}

module.exports = { deepMergeArrays };
>xb/**
 * @fileoverview Common utils for directives.
 *
 * This file contains only shared items for directives.
 * If you make a utility for rules, please see `../rules/utils/ast-utils.js`.
 *
 * @author gfyoung <https://github.com/gfyoung>
 */
"use strict";

const directivesPattern =
	/^(eslint(?:-env|-enable|-disable(?:(?:-next)?-line)?)?|exported|globals?)(?:\s|$)/u;

module.exports = {
	directivesPattern,
};
rAx	/**
 * @fileoverview Shared flags for ESLint.
 */

"use strict";

//------------------------------------------------------------------------------
// Typedefs
//------------------------------------------------------------------------------

/**
 * @typedef {Object} InactiveFlagData
 * @property {string} description Flag description
 * @property {string | null} [replacedBy] Can be either:
 *   - An active flag (string) that enables the same feature.
 *   - `null` if the feature is now enabled by default.
 *   - Omitted if the feature has been abandoned.
 */

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

/**
 * The set of flags that change ESLint behavior with a description.
 * @type {Map<string, string>}
 */
const activeFlags = new Map([
	["test_only", "Used only for testing."],
	["test_only_2", "Used only for testing."],
	[
		"unstable_native_nodejs_ts_config",
		"Use native Node.js to load TypeScript configuration.",
	],
]);

/**
 * The set of flags that used to be active.
 * @type {Map<string, InactiveFlagData>}
 */
const inactiveFlags = new Map([
	[
		"test_only_replaced",
		{
			description:
				"Used only for testing flags that have been replaced by other flags.",
			replacedBy: "test_only",
		},
	],
	[
		"test_only_enabled_by_default",
		{
			description:
				"Used only for testing flags whose features have been enabled by default.",
			replacedBy: null,
		},
	],
	[
		"test_only_abandoned",
		{
			description:
				"Used only for testing flags whose features have been abandoned.",
		},
	],
]);

/**
 * Creates a message that describes the reason the flag is inactive.
 * @param {InactiveFlagData} inactiveFlagData Data for the inactive flag.
 * @returns {string} Message describing the reason the flag is inactive.
 */
function getInactivityReasonMessage({ replacedBy }) {
	if (typeof replacedBy === "undefined") {
		return "This feature has been abandoned.";
	}

	if (typeof replacedBy === "string") {
		return `This flag has been renamed '${replacedBy}' to reflect its stabilization. Please use '${replacedBy}' instead.`;
	}

	// null
	return "This feature is now enabled by default.";
}

module.exports = {
	activeFlags,
	inactiveFlags,
	getInactivityReasonMessage,
};
̛'x{/**
 * @fileoverview Handle logging for ESLint
 * @author Gyandeep Singh
 */

"use strict";

/* eslint no-console: "off" -- Logging util */

/* c8 ignore next */
module.exports = {
	/**
	 * Cover for console.info
	 * @param {...any} args The elements to log.
	 * @returns {void}
	 */
	info(...args) {
		console.log(...args);
	},

	/**
	 * Cover for console.warn
	 * @param {...any} args The elements to log.
	 * @returns {void}
	 */
	warn(...args) {
		console.warn(...args);
	},

	/**
	 * Cover for console.error
	 * @param {...any} args The elements to log.
	 * @returns {void}
	 */
	error(...args) {
		console.error(...args);
	},
};
T:xR/**
 * @fileoverview Helpers for counting errors and warnings in lint messages.
 * @author Nicholas C. Zakas
 * @author Blake Sager
 */

"use strict";

/**
 * It will calculate the error and warning count for collection of messages per file
 * @param {LintMessage[]} messages Collection of messages
 * @returns {Object} Contains the stats
 */
function calculateStatsPerFile(messages) {
	const stat = {
		errorCount: 0,
		fatalErrorCount: 0,
		warningCount: 0,
		fixableErrorCount: 0,
		fixableWarningCount: 0,
	};

	for (let i = 0; i < messages.length; i++) {
		const message = messages[i];

		if (message.fatal || message.severity === 2) {
			stat.errorCount++;
			if (message.fatal) {
				stat.fatalErrorCount++;
			}
			if (message.fix) {
				stat.fixableErrorCount++;
			}
		} else {
			stat.warningCount++;
			if (message.fix) {
				stat.fixableWarningCount++;
			}
		}
	}
	return stat;
}

module.exports = {
	calculateStatsPerFile,
};
Q/pxx/**
 * @fileoverview Common helpers for naming of plugins, formatters and configs
 */

"use strict";

const NAMESPACE_REGEX = /^@.*\//u;

/**
 * Brings package name to correct format based on prefix
 * @param {string} name The name of the package.
 * @param {string} prefix Can be either "eslint-plugin", "eslint-config" or "eslint-formatter"
 * @returns {string} Normalized name of the package
 * @private
 */
function normalizePackageName(name, prefix) {
	let normalizedName = name;

	/**
	 * On Windows, name can come in with Windows slashes instead of Unix slashes.
	 * Normalize to Unix first to avoid errors later on.
	 * https://github.com/eslint/eslint/issues/5644
	 */
	if (normalizedName.includes("\\")) {
		normalizedName = normalizedName.replace(/\\/gu, "/");
	}

	if (normalizedName.charAt(0) === "@") {
		/**
		 * it's a scoped package
		 * package name is the prefix, or just a username
		 */
		const scopedPackageShortcutRegex = new RegExp(
				`^(@[^/]+)(?:/(?:${prefix})?)?$`,
				"u",
			),
			scopedPackageNameRegex = new RegExp(`^${prefix}(-|$)`, "u");

		if (scopedPackageShortcutRegex.test(normalizedName)) {
			normalizedName = normalizedName.replace(
				scopedPackageShortcutRegex,
				`$1/${prefix}`,
			);
		} else if (!scopedPackageNameRegex.test(normalizedName.split("/")[1])) {
			/*
			 * for scoped packages, insert the prefix after the first / unless
			 * the path is already @scope/eslint or @scope/eslint-xxx-yyy
			 */
			normalizedName = normalizedName.replace(
				/^@([^/]+)\/(.*)$/u,
				`@$1/${prefix}-$2`,
			);
		}
	} else if (!normalizedName.startsWith(`${prefix}-`)) {
		normalizedName = `${prefix}-${normalizedName}`;
	}

	return normalizedName;
}

/**
 * Removes the prefix from a fullname.
 * @param {string} fullname The term which may have the prefix.
 * @param {string} prefix The prefix to remove.
 * @returns {string} The term without prefix.
 */
function getShorthandName(fullname, prefix) {
	if (fullname[0] === "@") {
		let matchResult = new RegExp(`^(@[^/]+)/${prefix}$`, "u").exec(
			fullname,
		);

		if (matchResult) {
			return matchResult[1];
		}

		matchResult = new RegExp(`^(@[^/]+)/${prefix}-(.+)$`, "u").exec(
			fullname,
		);
		if (matchResult) {
			return `${matchResult[1]}/${matchResult[2]}`;
		}
	} else if (fullname.startsWith(`${prefix}-`)) {
		return fullname.slice(prefix.length + 1);
	}

	return fullname;
}

/**
 * Gets the scope (namespace) of a term.
 * @param {string} term The term which may have the namespace.
 * @returns {string} The namespace of the term if it has one.
 */
function getNamespaceFromTerm(term) {
	const match = term.match(NAMESPACE_REGEX);

	return match ? match[0] : "";
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

module.exports = {
	normalizePackageName,
	getShorthandName,
	getNamespaceFromTerm,
};
Ox/**
 * @fileoverview Utilities to operate on option objects.
 * @author Josh Goldberg
 */

"use strict";

/**
 * Determines whether any of input's properties are different
 * from values that already exist in original.
 * @template T
 * @param {Partial<T>} input New value.
 * @param {T} original Original value.
 * @returns {boolean} Whether input includes an explicit difference.
 */
function containsDifferentProperty(input, original) {
	if (input === original) {
		return false;
	}

	if (
		typeof input !== typeof original ||
		Array.isArray(input) !== Array.isArray(original)
	) {
		return true;
	}

	if (Array.isArray(input)) {
		return (
			input.length !== original.length ||
			input.some((value, i) =>
				containsDifferentProperty(value, original[i]),
			)
		);
	}

	if (typeof input === "object") {
		if (input === null || original === null) {
			return true;
		}

		const inputKeys = Object.keys(input);
		const originalKeys = Object.keys(original);

		return (
			inputKeys.length !== originalKeys.length ||
			inputKeys.some(
				inputKey =>
					!Object.hasOwn(original, inputKey) ||
					containsDifferentProperty(
						input[inputKey],
						original[inputKey],
					),
			)
		);
	}

	return true;
}

module.exports = {
	containsDifferentProperty,
};
=M@x/**
 * Utility for resolving a module relative to another module
 * @author Teddy Katz
 */

"use strict";

const Module = require("node:module");

/*
 * `Module.createRequire` is added in v12.2.0. It supports URL as well.
 * We only support the case where the argument is a filepath, not a URL.
 */
const createRequire = Module.createRequire;

/**
 * Resolves a Node module relative to another module
 * @param {string} moduleName The name of a Node module, or a path to a Node module.
 * @param {string} relativeToPath An absolute path indicating the module that `moduleName` should be resolved relative to. This must be
 * a file rather than a directory, but the file need not actually exist.
 * @returns {string} The absolute path that would result from calling `require.resolve(moduleName)` in a file located at `relativeToPath`
 * @throws {Error} When the module cannot be resolved.
 */
function resolve(moduleName, relativeToPath) {
	return createRequire(relativeToPath).resolve(moduleName);
}

exports.resolve = resolve;
Vlex/**
 * @fileoverview Utility to get information about the execution environment.
 * @author Kai Cataldo
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const path = require("node:path");
const spawn = require("cross-spawn");
const os = require("node:os");
const log = require("../shared/logging");
const packageJson = require("../../package.json");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Generates and returns execution environment information.
 * @returns {string} A string that contains execution environment information.
 */
function environment() {
	const cache = new Map();

	/**
	 * Checks if a path is a child of a directory.
	 * @param {string} parentPath The parent path to check.
	 * @param {string} childPath The path to check.
	 * @returns {boolean} Whether or not the given path is a child of a directory.
	 */
	function isChildOfDirectory(parentPath, childPath) {
		return !path.relative(parentPath, childPath).startsWith("..");
	}

	/**
	 * Synchronously executes a shell command and formats the result.
	 * @param {string} cmd The command to execute.
	 * @param {Array} args The arguments to be executed with the command.
	 * @throws {Error} As may be collected by `cross-spawn.sync`.
	 * @returns {string} The version returned by the command.
	 */
	function execCommand(cmd, args) {
		const key = [cmd, ...args].join(" ");

		if (cache.has(key)) {
			return cache.get(key);
		}

		const process = spawn.sync(cmd, args, { encoding: "utf8" });

		if (process.error) {
			throw process.error;
		}

		const result = process.stdout.trim();

		cache.set(key, result);
		return result;
	}

	/**
	 * Normalizes a version number.
	 * @param {string} versionStr The string to normalize.
	 * @returns {string} The normalized version number.
	 */
	function normalizeVersionStr(versionStr) {
		return versionStr.startsWith("v") ? versionStr : `v${versionStr}`;
	}

	/**
	 * Gets bin version.
	 * @param {string} bin The bin to check.
	 * @throws {Error} As may be collected by `cross-spawn.sync`.
	 * @returns {string} The normalized version returned by the command.
	 */
	function getBinVersion(bin) {
		const binArgs = ["--version"];

		try {
			return normalizeVersionStr(execCommand(bin, binArgs));
		} catch (e) {
			log.error(
				`Error finding ${bin} version running the command \`${bin} ${binArgs.join(" ")}\``,
			);
			throw e;
		}
	}

	/**
	 * Gets installed npm package version.
	 * @param {string} pkg The package to check.
	 * @param {boolean} global Whether to check globally or not.
	 * @throws {Error} As may be collected by `cross-spawn.sync`.
	 * @returns {string} The normalized version returned by the command.
	 */
	function getNpmPackageVersion(pkg, { global = false } = {}) {
		const npmBinArgs = ["bin", "-g"];
		const npmLsArgs = ["ls", "--depth=0", "--json", pkg];

		if (global) {
			npmLsArgs.push("-g");
		}

		try {
			const parsedStdout = JSON.parse(execCommand("npm", npmLsArgs));

			/*
			 * Checking globally returns an empty JSON object, while local checks
			 * include the name and version of the local project.
			 */
			if (
				Object.keys(parsedStdout).length === 0 ||
				!(parsedStdout.dependencies && parsedStdout.dependencies.eslint)
			) {
				return "Not found";
			}

			const [, processBinPath] = process.argv;
			let npmBinPath;

			try {
				npmBinPath = execCommand("npm", npmBinArgs);
			} catch (e) {
				log.error(
					`Error finding npm binary path when running command \`npm ${npmBinArgs.join(" ")}\``,
				);
				throw e;
			}

			const isGlobal = isChildOfDirectory(npmBinPath, processBinPath);
			let pkgVersion = parsedStdout.dependencies.eslint.version;

			if ((global && isGlobal) || (!global && !isGlobal)) {
				pkgVersion += " (Currently used)";
			}

			return normalizeVersionStr(pkgVersion);
		} catch (e) {
			log.error(
				`Error finding ${pkg} version running the command \`npm ${npmLsArgs.join(" ")}\``,
			);
			throw e;
		}
	}

	return [
		"Environment Info:",
		"",
		`Node version: ${process.version}`,
		`npm version: ${getBinVersion("npm")}`,
		`Local ESLint version: ${getNpmPackageVersion("eslint", { global: false })}`,
		`Global ESLint version: ${getNpmPackageVersion("eslint", { global: true })}`,
		`Operating System: ${os.platform()} ${os.release()}`,
	].join("\n");
}

/**
 * Returns version of currently executing ESLint.
 * @returns {string} The version from the currently executing ESLint's package.json.
 */
function version() {
	return `v${packageJson.version}`;
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

module.exports = {
	__esModule: true, // Indicate intent for imports, remove ambiguity for Knip (see: https://github.com/eslint/eslint/pull/18005#discussion_r1484422616)
	environment,
	version,
};
 HxA/**
 * @fileoverview Serialization utils.
 * @author Bryan Mishkin
 */

"use strict";

/**
 * Check if a value is a primitive or plain object created by the Object constructor.
 * @param {any} val the value to check
 * @returns {boolean} `true` if so
 * @private
 */
function isSerializablePrimitiveOrPlainObject(val) {
	return (
		val === null ||
		typeof val === "string" ||
		typeof val === "boolean" ||
		typeof val === "number" ||
		(typeof val === "object" && val.constructor === Object) ||
		Array.isArray(val)
	);
}

/**
 * Check if a value is serializable.
 * Functions or objects like RegExp cannot be serialized by JSON.stringify().
 * Inspired by: https://stackoverflow.com/questions/30579940/reliable-way-to-check-if-objects-is-serializable-in-javascript
 * @param {any} val The value
 * @param {Set<Object>} seenObjects Objects already seen in this path from the root object.
 * @returns {boolean} `true` if the value is serializable
 */
function isSerializable(val, seenObjects = new Set()) {
	if (!isSerializablePrimitiveOrPlainObject(val)) {
		return false;
	}
	if (typeof val === "object" && val !== null) {
		if (seenObjects.has(val)) {
			/*
			 * Since this is a depth-first traversal, encountering
			 * the same object again means there is a circular reference.
			 * Objects with circular references are not serializable.
			 */
			return false;
		}
		for (const property in val) {
			if (Object.hasOwn(val, property)) {
				if (!isSerializablePrimitiveOrPlainObject(val[property])) {
					return false;
				}
				if (
					typeof val[property] === "object" &&
					val[property] !== null
				) {
					if (
						/*
						 * We're creating a new Set of seen objects because we want to
						 * ensure that `val` doesn't appear again in this path, but it can appear
						 * in other paths. This allows for reusing objects in the graph, as long as
						 * there are no cycles.
						 */
						!isSerializable(
							val[property],
							new Set([...seenObjects, val]),
						)
					) {
						return false;
					}
				}
			}
		}
	}
	return true;
}

module.exports = {
	isSerializable,
};
qIxf/**
 * @fileoverview Helpers for severity values (e.g. normalizing different types).
 * @author Bryan Mishkin
 */

"use strict";

/**
 * Convert severity value of different types to a string.
 * @param {string|number} severity severity value
 * @throws error if severity is invalid
 * @returns {string} severity string
 */
function normalizeSeverityToString(severity) {
	if ([2, "2", "error"].includes(severity)) {
		return "error";
	}
	if ([1, "1", "warn"].includes(severity)) {
		return "warn";
	}
	if ([0, "0", "off"].includes(severity)) {
		return "off";
	}
	throw new Error(`Invalid severity value: ${severity}`);
}

/**
 * Convert severity value of different types to a number.
 * @param {string|number} severity severity value
 * @throws error if severity is invalid
 * @returns {number} severity number
 */
function normalizeSeverityToNumber(severity) {
	if ([2, "2", "error"].includes(severity)) {
		return 2;
	}
	if ([1, "1", "warn"].includes(severity)) {
		return 1;
	}
	if ([0, "0", "off"].includes(severity)) {
		return 0;
	}
	throw new Error(`Invalid severity value: ${severity}`);
}

module.exports = {
	normalizeSeverityToString,
	normalizeSeverityToNumber,
};
:/'x~/**
 * @fileoverview Provides helper functions to start/stop the time measurements
 * that are provided by the ESLint 'stats' option.
 * @author Mara Kiefer <http://github.com/mnkiefer>
 */
"use strict";

/**
 * Start time measurement
 * @returns {[number, number]} t variable for tracking time
 */
function startTime() {
	return process.hrtime();
}

/**
 * End time measurement
 * @param {[number, number]} t Variable for tracking time
 * @returns {number} The measured time in milliseconds
 */
function endTime(t) {
	const time = process.hrtime(t);

	return time[0] * 1e3 + time[1] / 1e6;
}

module.exports = {
	startTime,
	endTime,
};
֒`x/**
 * @fileoverview Utilities to operate on strings.
 * @author Stephen Wade
 */

"use strict";

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

// eslint-disable-next-line no-control-regex -- intentionally including control characters
const ASCII_REGEX = /^[\u0000-\u007f]*$/u;

/** @type {Intl.Segmenter | undefined} */
let segmenter;

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

/**
 * Converts the first letter of a string to uppercase.
 * @param {string} string The string to operate on
 * @returns {string} The converted string
 */
function upperCaseFirst(string) {
	if (string.length <= 1) {
		return string.toUpperCase();
	}
	return string[0].toUpperCase() + string.slice(1);
}

/**
 * Counts graphemes in a given string.
 * @param {string} value A string to count graphemes.
 * @returns {number} The number of graphemes in `value`.
 */
function getGraphemeCount(value) {
	if (ASCII_REGEX.test(value)) {
		return value.length;
	}

	segmenter ??= new Intl.Segmenter("en-US"); // en-US locale should be supported everywhere
	let graphemeCount = 0;

	// eslint-disable-next-line no-unused-vars -- for-of needs a variable
	for (const unused of segmenter.segment(value)) {
		graphemeCount++;
	}

	return graphemeCount;
}

module.exports = {
	upperCaseFirst,
	getGraphemeCount,
};
xZ/**
 * @fileoverview Optimized version of the `text-table` npm module to improve performance by replacing inefficient regex-based
 * whitespace trimming with a modern built-in method.
 *
 * This modification addresses a performance issue reported in https://github.com/eslint/eslint/issues/18709
 *
 * The `text-table` module is published under the MIT License. For the original source, refer to:
 * https://www.npmjs.com/package/text-table.
 */

/*
 *
 * This software is released under the MIT license:
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy of
 * this software and associated documentation files (the "Software"), to deal in
 * the Software without restriction, including without limitation the rights to
 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
 * the Software, and to permit persons to whom the Software is furnished to do so,
 * subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

"use strict";

module.exports = function (rows_, opts) {
	const hsep = "  ";
	const align = opts.align;
	const stringLength = opts.stringLength;

	const sizes = rows_.reduce((acc, row) => {
		row.forEach((c, ix) => {
			const n = stringLength(c);

			if (!acc[ix] || n > acc[ix]) {
				acc[ix] = n;
			}
		});
		return acc;
	}, []);

	return rows_
		.map(row =>
			row
				.map((c, ix) => {
					const n = sizes[ix] - stringLength(c) || 0;
					const s = Array(Math.max(n + 1, 1)).join(" ");

					if (align[ix] === "r") {
						return s + c;
					}

					return c + s;
				})
				.join(hsep)
				.trimEnd(),
		)
		.join("\n");
};
vPxw/**
 * @fileoverview Translates CLI options into ESLint constructor options.
 * @author Nicholas C. Zakas
 * @author Francesco Trotta
 */

"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const { normalizeSeverityToString } = require("./severity");
const { getShorthandName, normalizePackageName } = require("./naming");
const { ModuleImporter } = require("@humanwhocodes/module-importer");

//------------------------------------------------------------------------------
// Types
//------------------------------------------------------------------------------

/** @typedef {import("../types").ESLint.Options} ESLintOptions */
/** @typedef {import("../types").Linter.LintMessage} LintMessage */
/** @typedef {import("../options").ParsedCLIOptions} ParsedCLIOptions */
/** @typedef {import("../types").ESLint.Plugin} Plugin */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Loads plugins with the specified names.
 * @param {{ "import": (name: string) => Promise<any> }} importer An object with an `import` method called once for each plugin.
 * @param {string[]} pluginNames The names of the plugins to be loaded, with or without the "eslint-plugin-" prefix.
 * @returns {Promise<Record<string, Plugin>>} A mapping of plugin short names to implementations.
 */
async function loadPlugins(importer, pluginNames) {
	const plugins = {};

	await Promise.all(
		pluginNames.map(async pluginName => {
			const longName = normalizePackageName(pluginName, "eslint-plugin");
			const module = await importer.import(longName);

			if (!("default" in module)) {
				throw new Error(
					`"${longName}" cannot be used with the \`--plugin\` option because its default module does not provide a \`default\` export`,
				);
			}

			const shortName = getShorthandName(pluginName, "eslint-plugin");

			plugins[shortName] = module.default;
		}),
	);

	return plugins;
}

/**
 * Predicate function for whether or not to apply fixes in quiet mode.
 * If a message is a warning, do not apply a fix.
 * @param {LintMessage} message The lint result.
 * @returns {boolean} `true` if the lint message is an error (and thus should be
 * autofixed), `false` otherwise.
 */
function quietFixPredicate(message) {
	return message.severity === 2;
}

/**
 * Predicate function for whether or not to run a rule in quiet mode.
 * If a rule is set to warning, do not run it.
 * @param {{ ruleId: string; severity: number; }} rule The rule id and severity.
 * @returns {boolean} `true` if the lint rule should run, `false` otherwise.
 */
function quietRuleFilter(rule) {
	return rule.severity === 2;
}

//------------------------------------------------------------------------------
// Public Interface
//------------------------------------------------------------------------------

/**
 * Translates the CLI options into the options expected by the ESLint constructor.
 * @param {ParsedCLIOptions} cliOptions The CLI options to translate.
 * @returns {Promise<ESLintOptions>} The options object for the ESLint constructor.
 */
async function translateOptions({
	cache,
	cacheFile,
	cacheLocation,
	cacheStrategy,
	concurrency,
	config,
	configLookup,
	errorOnUnmatchedPattern,
	ext,
	fix,
	fixDryRun,
	fixType,
	flag,
	global,
	ignore,
	ignorePattern,
	inlineConfig,
	parser,
	parserOptions,
	plugin,
	quiet,
	reportUnusedDisableDirectives,
	reportUnusedDisableDirectivesSeverity,
	reportUnusedInlineConfigs,
	rule,
	stats,
	warnIgnored,
	passOnNoPatterns,
	maxWarnings,
}) {
	const importer = new ModuleImporter();

	let overrideConfigFile =
		typeof config === "string" ? config : !configLookup;
	if (overrideConfigFile === false) {
		overrideConfigFile = void 0;
	}

	const languageOptions = {};

	if (global) {
		languageOptions.globals = global.reduce((obj, name) => {
			if (name.endsWith(":true")) {
				obj[name.slice(0, -5)] = "writable";
			} else {
				obj[name] = "readonly";
			}
			return obj;
		}, {});
	}

	if (parserOptions) {
		languageOptions.parserOptions = parserOptions;
	}

	if (parser) {
		languageOptions.parser = await importer.import(parser);
	}

	const overrideConfig = [
		{
			...(Object.keys(languageOptions).length > 0
				? { languageOptions }
				: {}),
			rules: rule ? rule : {},
		},
	];

	if (
		reportUnusedDisableDirectives ||
		reportUnusedDisableDirectivesSeverity !== void 0
	) {
		overrideConfig[0].linterOptions = {
			reportUnusedDisableDirectives: reportUnusedDisableDirectives
				? "error"
				: normalizeSeverityToString(
						reportUnusedDisableDirectivesSeverity,
					),
		};
	}

	if (reportUnusedInlineConfigs !== void 0) {
		overrideConfig[0].linterOptions = {
			...overrideConfig[0].linterOptions,
			reportUnusedInlineConfigs: normalizeSeverityToString(
				reportUnusedInlineConfigs,
			),
		};
	}

	if (plugin) {
		overrideConfig[0].plugins = await loadPlugins(importer, plugin);
	}

	if (ext) {
		overrideConfig.push({
			files: ext.map(
				extension =>
					`**/*${extension.startsWith(".") ? "" : "."}${extension}`,
			),
		});
	}

	/*
	 * For performance reasons rules not marked as 'error' are filtered out in quiet mode. As maxWarnings
	 * requires rules set to 'warn' to be run, we only filter out 'warn' rules if maxWarnings is not specified.
	 */
	const ruleFilter =
		quiet && maxWarnings === -1 ? quietRuleFilter : () => true;

	const options = {
		allowInlineConfig: inlineConfig,
		cache,
		cacheLocation: cacheLocation || cacheFile,
		cacheStrategy,
		concurrency,
		errorOnUnmatchedPattern,
		fix: (fix || fixDryRun) && (quiet ? quietFixPredicate : true),
		fixTypes: fixType,
		flags: flag,
		ignore,
		ignorePatterns: ignorePattern,
		overrideConfig,
		overrideConfigFile,
		passOnNoPatterns,
		ruleFilter,
		stats,
		warnIgnored,
	};

	return options;
}

module.exports = translateOptions;
B4qDx/**
 * @fileoverview Traverser to traverse AST trees.
 * @author Nicholas C. Zakas
 * @author Toru Nagashima
 */
"use strict";

//------------------------------------------------------------------------------
// Requirements
//------------------------------------------------------------------------------

const vk = require("eslint-visitor-keys");
const debug = require("debug")("eslint:traverser");

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

/**
 * Do nothing.
 * @returns {void}
 */
function noop() {
	// do nothing.
}

/**
 * Check whether the given value is an ASTNode or not.
 * @param {any} x The value to check.
 * @returns {boolean} `true` if the value is an ASTNode.
 */
function isNode(x) {
	return x !== null && typeof x === "object" && typeof x.type === "string";
}

/**
 * Get the visitor keys of a given node.
 * @param {Object} visitorKeys The map of visitor keys.
 * @param {ASTNode} node The node to get their visitor keys.
 * @returns {string[]} The visitor keys of the node.
 */
function getVisitorKeys(visitorKeys, node) {
	let keys = visitorKeys[node.type];

	if (!keys) {
		keys = vk.getKeys(node);
		debug(
			'Unknown node type "%s": Estimated visitor keys %j',
			node.type,
			keys,
		);
	}

	return keys;
}

/**
 * The traverser class to traverse AST trees.
 */
class Traverser {
	constructor() {
		this._current = null;
		this._parents = [];
		this._skipped = false;
		this._broken = false;
		this._visitorKeys = null;
		this._enter = null;
		this._leave = null;
	}

	/**
	 * Gives current node.
	 * @returns {ASTNode} The current node.
	 */
	current() {
		return this._current;
	}

	/**
	 * Gives a copy of the ancestor nodes.
	 * @returns {ASTNode[]} The ancestor nodes.
	 */
	parents() {
		return this._parents.slice(0);
	}

	/**
	 * Break the current traversal.
	 * @returns {void}
	 */
	break() {
		this._broken = true;
	}

	/**
	 * Skip child nodes for the current traversal.
	 * @returns {void}
	 */
	skip() {
		this._skipped = true;
	}

	/**
	 * Traverse the given AST tree.
	 * @param {ASTNode} node The root node to traverse.
	 * @param {Object} options The option object.
	 * @param {Object} [options.visitorKeys=DEFAULT_VISITOR_KEYS] The keys of each node types to traverse child nodes. Default is `./default-visitor-keys.json`.
	 * @param {Function} [options.enter=noop] The callback function which is called on entering each node.
	 * @param {Function} [options.leave=noop] The callback function which is called on leaving each node.
	 * @returns {void}
	 */
	traverse(node, options) {
		this._current = null;
		this._parents = [];
		this._skipped = false;
		this._broken = false;
		this._visitorKeys = options.visitorKeys || vk.KEYS;
		this._enter = options.enter || noop;
		this._leave = options.leave || noop;
		this._traverse(node, null);
	}

	/**
	 * Traverse the given AST tree recursively.
	 * @param {ASTNode} node The current node.
	 * @param {ASTNode|null} parent The parent node.
	 * @returns {void}
	 * @private
	 */
	_traverse(node, parent) {
		if (!isNode(node)) {
			return;
		}

		this._current = node;
		this._skipped = false;
		this._enter(node, parent);

		if (!this._skipped && !this._broken) {
			const keys = getVisitorKeys(this._visitorKeys, node);

			if (keys.length >= 1) {
				this._parents.push(node);
				for (let i = 0; i < keys.length && !this._broken; ++i) {
					const child = node[keys[i]];

					if (Array.isArray(child)) {
						for (
							let j = 0;
							j < child.length && !this._broken;
							++j
						) {
							this._traverse(child[j], node);
						}
					} else {
						this._traverse(child, node);
					}
				}
				this._parents.pop();
			}
		}

		if (!this._broken) {
			this._leave(node, parent);
		}

		this._current = parent;
	}

	/**
	 * Calculates the keys to use for traversal.
	 * @param {ASTNode} node The node to read keys from.
	 * @returns {string[]} An array of keys to visit on the node.
	 * @private
	 */
	static getKeys(node) {
		return vk.getKeys(node);
	}

	/**
	 * Traverse the given AST tree.
	 * @param {ASTNode} node The root node to traverse.
	 * @param {Object} options The option object.
	 * @param {Object} [options.visitorKeys=DEFAULT_VISITOR_KEYS] The keys of each node types to traverse child nodes. Default is `./default-visitor-keys.json`.
	 * @param {Function} [options.enter=noop] The callback function which is called on entering each node.
	 * @param {Function} [options.leave=noop] The callback function which is called on leaving each node.
	 * @returns {void}
	 */
	static traverse(node, options) {
		new Traverser().traverse(node, options);
	}

	/**
	 * The default visitor keys.
	 * @type {Object}
	 */
	static get DEFAULT_VISITOR_KEYS() {
		return vk.KEYS;
	}
}

module.exports = Traverser;
8Ix )100644 config-api.d.ts }Չε	èF100644 index.d.ts ՐG	RdҼ<Z100644 rules.d.ts ${Qv]i100644 universal.d.ts Oͧ]cGp9I100644 use-at-your-own-risk.d.ts gU+=|*i'$Tlx;/**
 * @fileoverview typings for "eslint/config" module
 * @author Nicholas C. Zakas
 */

import {
	type Config,
	type ConfigObject,
	defineConfig,
	globalIgnores,
	includeIgnoreFile,
} from "@eslint/config-helpers";

export {
	type Config,
	type ConfigObject,
	defineConfig,
	globalIgnores,
	includeIgnoreFile,
};
ix`/**
 * @fileoverview This file contains the core types for ESLint. It was initially extracted
 * from the `@types/eslint` package.
 */

/*
 * MIT License
 * Copyright (c) Microsoft Corporation.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE
 */

import * as ESTree from "estree";
import type {
	DeprecatedInfo,
	LanguageOptions as GenericLanguageOptions,
	RuleContext as CoreRuleContext,
	RuleDefinition,
	SourceRange,
	TextSourceCode,
	TraversalStep,
	RulesConfig,
	GlobalAccess,
	GlobalsConfig,
	LinterOptionsConfig,
	EnvironmentConfig,
	ObjectMetaProperties as CoreObjectMetaProperties,
	Plugin as CorePlugin,
	LintMessage as CoreLintMessage,
	Processor as CoreProcessor,
	ConfigObject,
	LegacyConfigObject,
	SeverityName,
	SeverityLevel,
	Severity as CoreSeverity,
	EcmaVersion as CoreEcmaVersion,
	ConfigOverride as CoreConfigOverride,
	ProcessorFile as CoreProcessorFile,
	RulesMeta,
	RuleConfig,
	RuleTextEditor,
	RuleTextEdit,
	RuleVisitor,
	BaseConfig as CoreBaseConfig,
	RuleFixer as CoreRuleFixer,
	ViolationReportBase,
	ViolationMessage,
	ViolationLocation,
	SuggestionMessage,
	LintSuggestion as CoreLintSuggestion,
	JavaScriptSourceType,
	HasRules as CoreHasRules,
	SuggestedEditBase,
	SuggestedEdit,
	ViolationReport,
	MessagePlaceholderData,
} from "@eslint/core";
import type {
	CustomRuleDefinitionType,
	CustomRuleTypeDefinitions,
	CustomRuleVisitorWithExit,
} from "@eslint/plugin-kit";

//------------------------------------------------------------------------------
// Exports
//------------------------------------------------------------------------------

export namespace AST {
	type TokenType =
		| "Boolean"
		| "Null"
		| "Identifier"
		| "PrivateIdentifier"
		| "Keyword"
		| "Punctuator"
		| "JSXIdentifier"
		| "JSXText"
		| "Numeric"
		| "String"
		| "Template"
		| "RegularExpression";

	interface Token {
		type: TokenType;
		value: string;
		range: Range;
		loc: SourceLocation;
	}

	interface SourceLocation {
		start: ESTree.Position;
		end: ESTree.Position;
	}

	type Range = SourceRange;

	interface Program extends ESTree.Program {
		comments: ESTree.Comment[];
		tokens: Token[];
		loc: SourceLocation;
		range: Range;
	}
}

interface JSXIdentifier extends ESTree.BaseNode {
	type: "JSXIdentifier";
	name: string;
}

export namespace Scope {
	interface ScopeManager {
		scopes: Scope[];
		globalScope: Scope | null;

		acquire(node: ESTree.Node, inner?: boolean): Scope | null;

		getDeclaredVariables(node: ESTree.Node): Variable[];

		addGlobals(names: ReadonlyArray<string>): void;
	}

	interface Scope {
		type:
			| "block"
			| "catch"
			| "class"
			| "class-field-initializer"
			| "class-static-block"
			| "for"
			| "function"
			| "function-expression-name"
			| "global"
			| "module"
			| "switch"
			| "with";
		isStrict: boolean;
		upper: Scope | null;
		childScopes: Scope[];
		variableScope: Scope;
		block: ESTree.Node;
		variables: Variable[];
		set: Map<string, Variable>;
		references: Reference[];
		through: Reference[];
		functionExpressionScope: boolean;
		implicit?: {
			variables: Variable[];
			set: Map<string, Variable>;
		};
	}

	interface Variable {
		name: string;
		scope: Scope;
		identifiers: ESTree.Identifier[];
		references: Reference[];
		defs: Definition[];
	}

	interface Reference {
		identifier: ESTree.Identifier | JSXIdentifier;
		from: Scope;
		resolved: Variable | null;
		writeExpr?: ESTree.Expression | null;
		init?: boolean;

		isWrite(): boolean;

		isRead(): boolean;

		isWriteOnly(): boolean;

		isReadOnly(): boolean;

		isReadWrite(): boolean;
	}

	type DefinitionType =
		| { type: "CatchClause"; node: ESTree.CatchClause; parent: null }
		| {
				type: "ClassName";
				node: ESTree.ClassDeclaration | ESTree.ClassExpression;
				parent: null;
		  }
		| {
				type: "FunctionName";
				node: ESTree.FunctionDeclaration | ESTree.FunctionExpression;
				parent: null;
		  }
		| {
				type: "ImplicitGlobalVariable";
				node:
					| ESTree.AssignmentExpression
					| ESTree.ForInStatement
					| ESTree.ForOfStatement;
				parent: null;
		  }
		| {
				type: "ImportBinding";
				node:
					| ESTree.ImportSpecifier
					| ESTree.ImportDefaultSpecifier
					| ESTree.ImportNamespaceSpecifier;
				parent: ESTree.ImportDeclaration;
		  }
		| {
				type: "Parameter";
				node:
					| ESTree.FunctionDeclaration
					| ESTree.FunctionExpression
					| ESTree.ArrowFunctionExpression;
				parent: null;
		  }
		| {
				type: "Variable";
				node: ESTree.VariableDeclarator;
				parent: ESTree.VariableDeclaration;
		  };

	type Definition = DefinitionType & { name: ESTree.Identifier };
}

// #region SourceCode

export class SourceCode implements TextSourceCode<{
	LangOptions: Linter.LanguageOptions;
	RootNode: AST.Program;
	SyntaxElementWithLoc: AST.Token | ESTree.Node;
	ConfigNode: ESTree.Comment;
}> {
	text: string;
	ast: AST.Program;
	lines: string[];
	hasBOM: boolean;
	parserServices: SourceCode.ParserServices;
	scopeManager: Scope.ScopeManager;
	visitorKeys: SourceCode.VisitorKeys;

	constructor(text: string, ast: AST.Program);
	constructor(config: SourceCode.Config);

	static splitLines(text: string): string[];

	getLoc(syntaxElement: AST.Token | ESTree.Node): ESTree.SourceLocation;
	getRange(syntaxElement: AST.Token | ESTree.Node): SourceRange;

	getText(
		node?: ESTree.Node,
		beforeCount?: number,
		afterCount?: number,
	): string;

	getLines(): string[];

	getAllComments(): ESTree.Comment[];

	getAncestors(node: ESTree.Node): ESTree.Node[];

	getDeclaredVariables(node: ESTree.Node): Scope.Variable[];

	getNodeByRangeIndex(index: number): ESTree.Node | null;

	getLocFromIndex(index: number): ESTree.Position;

	getIndexFromLoc(location: ESTree.Position): number;

	// Inherited methods from TokenStore
	// ---------------------------------

	getTokenByRangeStart(
		offset: number,
		options?: { includeComments: false },
	): AST.Token | null;
	getTokenByRangeStart(
		offset: number,
		options: { includeComments: boolean },
	): AST.Token | ESTree.Comment | null;

	getFirstToken: SourceCode.UnaryNodeCursorWithSkipOptions;

	getFirstTokens: SourceCode.UnaryNodeCursorWithCountOptions;

	getLastToken: SourceCode.UnaryNodeCursorWithSkipOptions;

	getLastTokens: SourceCode.UnaryNodeCursorWithCountOptions;

	getTokenBefore: SourceCode.UnaryCursorWithSkipOptions;

	getTokensBefore: SourceCode.UnaryCursorWithCountOptions;

	getTokenAfter: SourceCode.UnaryCursorWithSkipOptions;

	getTokensAfter: SourceCode.UnaryCursorWithCountOptions;

	getFirstTokenBetween: SourceCode.BinaryCursorWithSkipOptions;

	getFirstTokensBetween: SourceCode.BinaryCursorWithCountOptions;

	getLastTokenBetween: SourceCode.BinaryCursorWithSkipOptions;

	getLastTokensBetween: SourceCode.BinaryCursorWithCountOptions;

	getTokensBetween: SourceCode.BinaryCursorWithCountOptions;

	getTokens: ((
		node: ESTree.Node,
		beforeCount?: number,
		afterCount?: number,
	) => AST.Token[]) &
		SourceCode.UnaryNodeCursorWithCountOptions;

	commentsExistBetween(
		left: ESTree.Node | AST.Token | ESTree.Comment,
		right: ESTree.Node | AST.Token | ESTree.Comment,
	): boolean;

	getCommentsBefore(nodeOrToken: ESTree.Node | AST.Token): ESTree.Comment[];

	getCommentsAfter(nodeOrToken: ESTree.Node | AST.Token): ESTree.Comment[];

	getCommentsInside(node: ESTree.Node): ESTree.Comment[];

	getScope(node: ESTree.Node): Scope.Scope;

	isSpaceBetween(
		first: ESTree.Node | AST.Token,
		second: ESTree.Node | AST.Token,
	): boolean;

	isGlobalReference(node: ESTree.Identifier): boolean;

	markVariableAsUsed(name: string, refNode?: ESTree.Node): boolean;

	traverse(): Iterable<TraversalStep>;
}

export namespace SourceCode {
	interface Config {
		text: string;
		ast: AST.Program;
		hasBOM?: boolean | undefined;
		parserServices?: ParserServices | null | undefined;
		scopeManager?: Scope.ScopeManager | null | undefined;
		visitorKeys?: VisitorKeys | null | undefined;
	}

	type ParserServices = any;

	interface VisitorKeys {
		[nodeType: string]: string[];
	}

	interface UnaryNodeCursorWithSkipOptions {
		<T extends AST.Token>(
			node: ESTree.Node,
			options:
				| ((token: AST.Token) => token is T)
				| {
						filter: (token: AST.Token) => token is T;
						includeComments?: false | undefined;
						skip?: number | undefined;
				  },
		): T | null;
		<T extends AST.Token | ESTree.Comment>(
			node: ESTree.Node,
			options: {
				filter: (
					tokenOrComment: AST.Token | ESTree.Comment,
				) => tokenOrComment is T;
				includeComments: boolean;
				skip?: number | undefined;
			},
		): T | null;
		(
			node: ESTree.Node,
			options?:
				| {
						filter?: ((token: AST.Token) => boolean) | undefined;
						includeComments?: false | undefined;
						skip?: number | undefined;
				  }
				| ((token: AST.Token) => boolean)
				| number,
		): AST.Token | null;
		(
			node: ESTree.Node,
			options: {
				filter?:
					| ((token: AST.Token | ESTree.Comment) => boolean)
					| undefined;
				includeComments: boolean;
				skip?: number | undefined;
			},
		): AST.Token | ESTree.Comment | null;
	}

	interface UnaryNodeCursorWithCountOptions {
		<T extends AST.Token>(
			node: ESTree.Node,
			options:
				| ((token: AST.Token) => token is T)
				| {
						filter: (token: AST.Token) => token is T;
						includeComments?: false | undefined;
						count?: number | undefined;
				  },
		): T[];
		<T extends AST.Token | ESTree.Comment>(
			node: ESTree.Node,
			options: {
				filter: (
					tokenOrComment: AST.Token | ESTree.Comment,
				) => tokenOrComment is T;
				includeComments: boolean;
				count?: number | undefined;
			},
		): T[];
		(
			node: ESTree.Node,
			options?:
				| {
						filter?: ((token: AST.Token) => boolean) | undefined;
						includeComments?: false | undefined;
						count?: number | undefined;
				  }
				| ((token: AST.Token) => boolean)
				| number,
		): AST.Token[];
		(
			node: ESTree.Node,
			options: {
				filter?:
					| ((token: AST.Token | ESTree.Comment) => boolean)
					| undefined;
				includeComments: boolean;
				count?: number | undefined;
			},
		): Array<AST.Token | ESTree.Comment>;
	}

	interface UnaryCursorWithSkipOptions {
		<T extends AST.Token>(
			node: ESTree.Node | AST.Token | ESTree.Comment,
			options:
				| ((token: AST.Token) => token is T)
				| {
						filter: (token: AST.Token) => token is T;
						includeComments?: false | undefined;
						skip?: number | undefined;
				  },
		): T | null;
		<T extends AST.Token | ESTree.Comment>(
			node: ESTree.Node | AST.Token | ESTree.Comment,
			options: {
				filter: (
					tokenOrComment: AST.Token | ESTree.Comment,
				) => tokenOrComment is T;
				includeComments: boolean;
				skip?: number | undefined;
			},
		): T | null;
		(
			node: ESTree.Node | AST.Token | ESTree.Comment,
			options?:
				| {
						filter?: ((token: AST.Token) => boolean) | undefined;
						includeComments?: false | undefined;
						skip?: number | undefined;
				  }
				| ((token: AST.Token) => boolean)
				| number,
		): AST.Token | null;
		(
			node: ESTree.Node | AST.Token | ESTree.Comment,
			options: {
				filter?:
					| ((token: AST.Token | ESTree.Comment) => boolean)
					| undefined;
				includeComments: boolean;
				skip?: number | undefined;
			},
		): AST.Token | ESTree.Comment | null;
	}

	interface UnaryCursorWithCountOptions {
		<T extends AST.Token>(
			node: ESTree.Node | AST.Token | ESTree.Comment,
			options:
				| ((token: AST.Token) => token is T)
				| {
						filter: (token: AST.Token) => token is T;
						includeComments?: false | undefined;
						count?: number | undefined;
				  },
		): T[];
		<T extends AST.Token | ESTree.Comment>(
			node: ESTree.Node | AST.Token | ESTree.Comment,
			options: {
				filter: (
					tokenOrComment: AST.Token | ESTree.Comment,
				) => tokenOrComment is T;
				includeComments: boolean;
				count?: number | undefined;
			},
		): T[];
		(
			node: ESTree.Node | AST.Token | ESTree.Comment,
			options?:
				| {
						filter?: ((token: AST.Token) => boolean) | undefined;
						includeComments?: false | undefined;
						count?: number | undefined;
				  }
				| ((token: AST.Token) => boolean)
				| number,
		): AST.Token[];
		(
			node: ESTree.Node | AST.Token | ESTree.Comment,
			options: {
				filter?:
					| ((token: AST.Token | ESTree.Comment) => boolean)
					| undefined;
				includeComments: boolean;
				count?: number | undefined;
			},
		): Array<AST.Token | ESTree.Comment>;
	}

	interface BinaryCursorWithSkipOptions {
		<T extends AST.Token>(
			left: ESTree.Node | AST.Token | ESTree.Comment,
			right: ESTree.Node | AST.Token | ESTree.Comment,
			options:
				| ((token: AST.Token) => token is T)
				| {
						filter: (token: AST.Token) => token is T;
						includeComments?: false | undefined;
						skip?: number | undefined;
				  },
		): T | null;
		<T extends AST.Token | ESTree.Comment>(
			left: ESTree.Node | AST.Token | ESTree.Comment,
			right: ESTree.Node | AST.Token | ESTree.Comment,
			options: {
				filter: (
					tokenOrComment: AST.Token | ESTree.Comment,
				) => tokenOrComment is T;
				includeComments: boolean;
				skip?: number | undefined;
			},
		): T | null;
		(
			left: ESTree.Node | AST.Token | ESTree.Comment,
			right: ESTree.Node | AST.Token | ESTree.Comment,
			options?:
				| {
						filter?: ((token: AST.Token) => boolean) | undefined;
						includeComments?: false | undefined;
						skip?: number | undefined;
				  }
				| ((token: AST.Token) => boolean)
				| number,
		): AST.Token | null;
		(
			left: ESTree.Node | AST.Token | ESTree.Comment,
			right: ESTree.Node | AST.Token | ESTree.Comment,
			options: {
				filter?:
					| ((token: AST.Token | ESTree.Comment) => boolean)
					| undefined;
				includeComments: boolean;
				skip?: number | undefined;
			},
		): AST.Token | ESTree.Comment | null;
	}

	interface BinaryCursorWithCountOptions {
		<T extends AST.Token>(
			left: ESTree.Node | AST.Token | ESTree.Comment,
			right: ESTree.Node | AST.Token | ESTree.Comment,
			options:
				| ((token: AST.Token) => token is T)
				| {
						filter: (token: AST.Token) => token is T;
						includeComments?: false | undefined;
						count?: number | undefined;
				  },
		): T[];
		<T extends AST.Token | ESTree.Comment>(
			left: ESTree.Node | AST.Token | ESTree.Comment,
			right: ESTree.Node | AST.Token | ESTree.Comment,
			options: {
				filter: (
					tokenOrComment: AST.Token | ESTree.Comment,
				) => tokenOrComment is T;
				includeComments: boolean;
				count?: number | undefined;
			},
		): T[];
		(
			left: ESTree.Node | AST.Token | ESTree.Comment,
			right: ESTree.Node | AST.Token | ESTree.Comment,
			options?:
				| {
						filter?: ((token: AST.Token) => boolean) | undefined;
						includeComments?: false | undefined;
						count?: number | undefined;
				  }
				| ((token: AST.Token) => boolean)
				| number,
		): AST.Token[];
		(
			left: ESTree.Node | AST.Token | ESTree.Comment,
			right: ESTree.Node | AST.Token | ESTree.Comment,
			options: {
				filter?:
					| ((token: AST.Token | ESTree.Comment) => boolean)
					| undefined;
				includeComments: boolean;
				count?: number | undefined;
			},
		): Array<AST.Token | ESTree.Comment>;
	}
}

// #endregion

export type JSSyntaxElement = {
	type: string;
	loc?: ESTree.SourceLocation | null | undefined;
};

export namespace Rule {
	interface RuleModule extends RuleDefinition<{
		LangOptions: Linter.LanguageOptions;
		Code: SourceCode;
		RuleOptions: any[];
		Visitor: RuleListener;
		Node: JSSyntaxElement;
		MessageIds: string;
		ExtRuleDocs: {};
	}> {
		create(context: RuleContext): RuleListener;
	}

	type NodeTypes = ESTree.Node["type"];

	interface NodeListener extends CustomRuleVisitorWithExit<
		{
			[Node in Rule.Node as Node["type"]]?:
				((node: Node) => void) | undefined;
		} & {
			// A `Program` visitor's node type has no `parent` property.
			Program?: ((node: AST.Program) => void) | undefined;
		}
	> {}

	interface NodeParentExtension {
		parent: Node;
	}

	type Node =
		| (AST.Program & { parent: null })
		| (Exclude<ESTree.Node, ESTree.Program> & NodeParentExtension);

	interface RuleListener extends NodeListener {
		onCodePathStart?(codePath: CodePath, node: Node): void;

		onCodePathEnd?(codePath: CodePath, node: Node): void;

		onCodePathSegmentStart?(segment: CodePathSegment, node: Node): void;

		onCodePathSegmentEnd?(segment: CodePathSegment, node: Node): void;

		onUnreachableCodePathSegmentStart?(
			segment: CodePathSegment,
			node: Node,
		): void;

		onUnreachableCodePathSegmentEnd?(
			segment: CodePathSegment,
			node: Node,
		): void;

		onCodePathSegmentLoop?(
			fromSegment: CodePathSegment,
			toSegment: CodePathSegment,
			node: Node,
		): void;

		[key: string]:
			| ((codePath: CodePath, node: Node) => void)
			| ((segment: CodePathSegment, node: Node) => void)
			| ((
					fromSegment: CodePathSegment,
					toSegment: CodePathSegment,
					node: Node,
			  ) => void)
			| ((node: Node) => void)
			| NodeListener[keyof NodeListener]
			| undefined;
	}

	type CodePathOrigin =
		| "program"
		| "function"
		| "class-field-initializer"
		| "class-static-block";

	interface CodePathSegmentTraversalController {
		skip(): void;
		break(): void;
	}

	type CodePathSegmentTraversalCallback = (
		this: CodePath,
		segment: CodePathSegment,
		controller: CodePathSegmentTraversalController,
	) => void;

	interface CodePathTraversalOptions {
		first?: CodePathSegment | undefined;
		last?: CodePathSegment | undefined;
	}

	interface CodePath {
		id: string;
		origin: CodePathOrigin;
		initialSegment: CodePathSegment;
		finalSegments: CodePathSegment[];
		returnedSegments: CodePathSegment[];
		thrownSegments: CodePathSegment[];
		upper: CodePath | null;
		childCodePaths: CodePath[];
		traverseSegments(callback: CodePathSegmentTraversalCallback): void;
		traverseSegments(
			options: CodePathTraversalOptions,
			callback: CodePathSegmentTraversalCallback,
		): void;
	}

	interface CodePathSegment {
		id: string;
		nextSegments: CodePathSegment[];
		prevSegments: CodePathSegment[];
		allNextSegments: CodePathSegment[];
		allPrevSegments: CodePathSegment[];
		reachable: boolean;
	}

	type RuleMetaData = RulesMeta;

	interface RuleContext extends CoreRuleContext<{
		LangOptions: Linter.LanguageOptions;
		Code: SourceCode;
		RuleOptions: any[];
		Node: JSSyntaxElement;
		MessageIds: string;
	}> {}

	type ReportFixer = CoreRuleFixer;

	/** @deprecated Use `ReportDescriptorOptions` instead. */
	type ReportDescriptorOptionsBase = Omit<ViolationReportBase, "suggest">;

	type SuggestionReportOptions = SuggestedEditBase;
	type SuggestionDescriptorMessage = SuggestionMessage;
	type SuggestionReportDescriptor = SuggestedEdit;

	// redundant with ReportDescriptorOptionsBase but kept for clarity
	type ReportDescriptorOptions = ViolationReportBase;

	type ReportDescriptor = ViolationReport<JSSyntaxElement>;
	type ReportDescriptorMessage = ViolationMessage;
	type ReportDescriptorLocation = ViolationLocation<JSSyntaxElement>;

	type RuleFixer = RuleTextEditor<ESTree.Node | AST.Token>;
	type Fix = RuleTextEdit;
}

export type JSRuleDefinitionTypeOptions = CustomRuleTypeDefinitions;

export type JSRuleDefinition<
	Options extends Partial<JSRuleDefinitionTypeOptions> = {},
> = CustomRuleDefinitionType<
	{
		LangOptions: Linter.LanguageOptions;
		Code: SourceCode;
		Visitor: Rule.RuleListener;
		Node: JSSyntaxElement;
	},
	Options
>;

// #region Linter

export class Linter {
	static readonly version: string;

	version: string;

	constructor(options?: { cwd?: string | undefined; configType?: "flat" });

	verify(
		code: SourceCode | string,
		config: Linter.Config | Linter.Config[],
		filename?: string,
	): Linter.LintMessage[];
	verify(
		code: SourceCode | string,
		config: Linter.Config | Linter.Config[],
		options: Linter.LintOptions,
	): Linter.LintMessage[];

	verifyAndFix(
		code: string,
		config: Linter.Config | Linter.Config[],
		filename?: string,
	): Linter.FixReport;
	verifyAndFix(
		code: string,
		config: Linter.Config | Linter.Config[],
		options: Linter.FixOptions,
	): Linter.FixReport;

	getSourceCode(): SourceCode;

	getTimes(): Linter.Stats["times"];

	getFixPassCount(): Linter.Stats["fixPasses"];
}

export namespace Linter {
	/**
	 * The numeric severity level for a rule.
	 *
	 * - `0` means off.
	 * - `1` means warn.
	 * - `2` means error.
	 *
	 * @see [Rule Severities](https://eslint.org/docs/latest/use/configure/rules#rule-severities)
	 */
	type Severity = SeverityLevel;

	/**
	 * The human readable severity level for a rule.
	 *
	 * @see [Rule Severities](https://eslint.org/docs/latest/use/configure/rules#rule-severities)
	 */
	type StringSeverity = SeverityName;

	/**
	 * The numeric or human readable severity level for a rule.
	 *
	 * @see [Rule Severities](https://eslint.org/docs/latest/use/configure/rules#rule-severities)
	 */
	type RuleSeverity = CoreSeverity;

	/**
	 * An array containing the rule severity level, followed by the rule options.
	 *
	 * @see [Rules](https://eslint.org/docs/latest/use/configure/rules)
	 */
	type RuleSeverityAndOptions<Options extends any[] = any[]> = [
		RuleSeverity,
		...Partial<Options>,
	];

	/**
	 * The severity level for the rule or an array containing the rule severity level, followed by the rule options.
	 *
	 * @see [Rules](https://eslint.org/docs/latest/use/configure/rules)
	 */
	type RuleEntry<Options extends any[] = any[]> = RuleConfig<Options>;

	/**
	 * The rules config object is a key/value map of rule names and their severity and options.
	 */
	type RulesRecord = RulesConfig;

	/**
	 * A configuration object that may have a `rules` block.
	 */
	type HasRules<Rules extends RulesConfig = RulesConfig> =
		CoreHasRules<Rules>;

	/**
	 * The ECMAScript version of the code being linted.
	 */
	type EcmaVersion = CoreEcmaVersion;

	/**
	 * The type of JavaScript source code.
	 */
	type SourceType = JavaScriptSourceType;

	/**
	 * ESLint legacy configuration.
	 *
	 * @see [ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/)
	 */
	type BaseConfig<
		Rules extends RulesConfig = RulesConfig,
		OverrideRules extends RulesConfig = Rules,
	> = CoreBaseConfig<Rules, OverrideRules>;

	/**
	 * The overwrites that apply more differing configuration to specific files or directories.
	 */
	type ConfigOverride<Rules extends RulesConfig = RulesConfig> =
		CoreConfigOverride<Rules>;

	/**
	 * ESLint legacy configuration.
	 *
	 * @see [ESLint Legacy Configuration](https://eslint.org/docs/latest/use/configure/)
	 */
	// https://github.com/eslint/eslint/blob/v8.57.0/conf/config-schema.js
	type LegacyConfig<
		Rules extends RulesConfig = RulesConfig,
		OverrideRules extends RulesConfig = Rules,
	> = LegacyConfigObject<Rules, OverrideRules>;

	/**
	 * Parser options.
	 *
	 * @see [Specifying Parser Options](https://eslint.org/docs/latest/use/configure/language-options#specifying-parser-options)
	 */
	interface ParserOptions {
		/**
		 * Allow the use of reserved words as identifiers (if `ecmaVersion` is 3).
		 *
		 * @default false
		 */
		allowReserved?: boolean | undefined;
		/**
		 * An object indicating which additional language features you'd like to use.
		 *
		 * @see https://eslint.org/docs/latest/use/configure/language-options#specifying-parser-options
		 */
		ecmaFeatures?:
			| {
					/**
					 * Allow `return` statements in the global scope.
					 *
					 * @default false
					 */
					globalReturn?: boolean | undefined;
					/**
					 * Enable global [strict mode](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode) (if `ecmaVersion` is 5 or greater).
					 *
					 * @default false
					 */
					impliedStrict?: boolean | undefined;
					/**
					 * Enable [JSX](https://facebook.github.io/jsx/).
					 *
					 * @default false
					 */
					jsx?: boolean | undefined;
					[key: string]: any;
			  }
			| undefined;
		[key: string]: any;
	}

	/**
	 * Options used for linting code with `Linter#verify` and `Linter#verifyAndFix`.
	 */
	interface LintOptions {
		filename?: string | undefined;
		preprocess?: ((code: string) => string[]) | undefined;
		postprocess?:
			((problemLists: LintMessage[][]) => LintMessage[]) | undefined;
		filterCodeBlock?:
			((filename: string, text: string) => boolean) | undefined;
		disableFixes?: boolean | undefined;
		allowInlineConfig?: boolean | undefined;
		reportUnusedDisableDirectives?: boolean | undefined;
	}

	type LintSuggestion = CoreLintSuggestion;
	type LintMessage = CoreLintMessage;

	interface LintSuppression {
		kind: string;
		justification: string;
	}

	interface SuppressedLintMessage extends LintMessage {
		/** The suppression info. */
		suppressions: LintSuppression[];
	}

	interface FixOptions extends LintOptions {
		fix?: boolean | undefined;
	}

	interface FixReport {
		fixed: boolean;
		output: string;
		messages: LintMessage[];
	}

	// Temporarily loosen type for just flat config files (see https://github.com/DefinitelyTyped/DefinitelyTyped/pull/68232)
	type NonESTreeParser = ESLint.ObjectMetaProperties &
		(
			| {
					parse(text: string, options?: any): unknown;
			  }
			| {
					parseForESLint(
						text: string,
						options?: any,
					): Omit<ESLintParseResult, "ast" | "scopeManager"> & {
						ast: unknown;
						scopeManager?: unknown;
					};
			  }
		);

	type ESTreeParser = ESLint.ObjectMetaProperties &
		(
			| { parse(text: string, options?: any): AST.Program }
			| { parseForESLint(text: string, options?: any): ESLintParseResult }
		);

	type Parser = NonESTreeParser | ESTreeParser;

	interface ESLintParseResult {
		/** The AST object. */
		ast: AST.Program;

		/** The services that the parser provides. */
		services?: SourceCode.ParserServices | undefined;

		/** The scope manager of the AST. */
		scopeManager?: Scope.ScopeManager | undefined;

		/** The visitor keys of the AST. */
		visitorKeys?: SourceCode.VisitorKeys | undefined;
	}

	type ProcessorFile = CoreProcessorFile;

	// https://eslint.org/docs/latest/extend/plugins#processors-in-plugins
	type Processor<T extends string | ProcessorFile = string | ProcessorFile> =
		CoreProcessor<T>;

	type Config<Rules extends RulesConfig = RulesConfig> = ConfigObject<Rules>;

	/** @deprecated  Use `Config` instead of `FlatConfig` */
	type FlatConfig<Rules extends RulesConfig = RulesConfig> = Config<Rules>;

	type GlobalConf = GlobalAccess;
	type Globals = GlobalsConfig;

	interface LanguageOptions extends GenericLanguageOptions {
		/**
		 * The version of ECMAScript to support. May be any year (i.e., 2022) or
		 * version (i.e., 5). Set to "latest" for the most recent supported version.
		 * @default "latest"
		 */
		ecmaVersion?: EcmaVersion | undefined;

		/**
		 * The type of JavaScript source code. Possible values are "script" for
		 * traditional script files, "module" for ECMAScript modules (ESM), and
		 * "commonjs" for CommonJS files. (default: "module" for .js and .mjs
		 * files; "commonjs" for .cjs files)
		 */
		sourceType?: SourceType | undefined;

		/**
		 * An object specifying additional objects that should be added to the
		 * global scope during linting.
		 */
		globals?: Globals | undefined;

		/**
		 * An object containing a parse() or parseForESLint() method.
		 * If not configured, the default ESLint parser (Espree) will be used.
		 */
		parser?: Parser | undefined;

		/**
		 * An object specifying additional options that are passed directly to the
		 * parser() method on the parser. The available options are parser-dependent
		 */
		parserOptions?: Linter.ParserOptions | undefined;
	}

	type LinterOptions = LinterOptionsConfig;

	/**
	 * Performance statistics.
	 */
	interface Stats {
		/**
		 * The number of times ESLint has applied at least one fix after linting.
		 */
		fixPasses: number;

		/**
		 * The times spent on (parsing, fixing, linting) a file, where the linting refers to the timing information for each rule.
		 */
		times: { passes: TimePass[] };
	}

	interface TimePass {
		/**
		 * The parse object containing all parse time information.
		 */
		parse: { total: number };

		/**
		 * The rules object containing all lint time information for each rule.
		 */
		rules?: Record<string, { total: number }>;

		/**
		 * The fix object containing all fix time information.
		 */
		fix: { total: number };

		/**
		 * The total time that is spent on (parsing, fixing, linting) a file.
		 */
		total: number;
	}
}

// #endregion

// #region ESLint

export class ESLint {
	static configType: "flat";

	static readonly version: string;

	/**
	 * The default configuration that ESLint uses internally. This is provided for tooling that wants to calculate configurations using the same defaults as ESLint.
	 * Keep in mind that the default configuration may change from version to version, so you shouldn't rely on any particular keys or values to be present.
	 */
	static readonly defaultConfig: Linter.Config[];

	static outputFixes(results: ESLint.LintResult[]): Promise<void>;

	static getErrorResults(results: ESLint.LintResult[]): ESLint.LintResult[];

	constructor(options?: ESLint.Options);

	lintFiles(patterns: string | string[]): Promise<ESLint.LintResult[]>;

	lintText(
		code: string,
		options?: {
			filePath?: string | undefined;
			warnIgnored?: boolean | undefined;
		},
	): Promise<ESLint.LintResult[]>;

	getRulesMetaForResults(
		results: ESLint.LintResult[],
	): ESLint.LintResultData["rulesMeta"];

	hasFlag(flag: string): boolean;

	calculateConfigForFile(filePath: string): Promise<any>;

	findConfigFile(filePath?: string): Promise<string | undefined>;

	isPathIgnored(filePath: string): Promise<boolean>;

	loadFormatter(nameOrPath?: string): Promise<ESLint.LoadedFormatter>;

	static fromOptionsModule(optionsURL: {
		readonly href: string;
	}): Promise<ESLint>;
}

export namespace ESLint {
	type ConfigData<Rules extends Linter.RulesRecord = RulesConfig> = Omit<
		Linter.LegacyConfig<Rules>,
		"$schema"
	>;

	type Environment = EnvironmentConfig;
	type ObjectMetaProperties = CoreObjectMetaProperties;
	type Plugin = CorePlugin;

	type FixType = "directive" | "problem" | "suggestion" | "layout";

	type CacheStrategy = "content" | "metadata";

	/** The options with which to configure the ESLint instance. */
	interface Options {
		// File enumeration

		/** The value to use for the current working directory. */
		cwd?: string | undefined;

		/** If `false` then `ESLint#lintFiles()` doesn't throw even if no target files found. Defaults to `true`. */
		errorOnUnmatchedPattern?: boolean | undefined;

		/**
		 * Set to false to skip glob resolution of input file paths to lint (default: true).
		 * If false, each input file path is assumed to be a non-glob path to an existing file.
		 */
		globInputPaths?: boolean | undefined;

		/** False disables all ignore patterns except for the default ones. */
		ignore?: boolean | undefined;

		/** Ignore file patterns to use in addition to config ignores. These patterns are relative to `cwd`. */
		ignorePatterns?: string[] | null | undefined;

		/** When set to true, missing patterns cause the linting operation to short circuit and not report any failures. */
		passOnNoPatterns?: boolean | undefined;

		/** Show warnings when the file list includes ignored files. */
		warnIgnored?: boolean | undefined;

		// Linting

		/** Enable or disable inline configuration comments. */
		allowInlineConfig?: boolean | undefined;

		/** Base config, extended by all configs used with this instance. */
		baseConfig?: Linter.Config | Linter.Config[] | null | undefined;

		/** Override config, overrides all configs used with this instance. */
		overrideConfig?: Linter.Config | Linter.Config[] | null | undefined;

		/**
		 * Searches for default config file when falsy; doesn't do any config file lookup when `true`; considered to be a config filename when a string.
		 */
		overrideConfigFile?: string | true | null | undefined;

		/** An array of plugin implementations. */
		plugins?: Record<string, Plugin> | null | undefined;

		/**
		 * Default is `() => true`. A predicate function that filters rules to be run.
		 * This function is called with an object containing `ruleId` and `severity`, and returns `true` if the rule should be run.
		 */
		ruleFilter?:
			| ((arg: {
					ruleId: string;
					severity: Exclude<Linter.Severity, 0>;
			  }) => boolean)
			| undefined;

		/** True enables added statistics on lint results. */
		stats?: boolean | undefined;

		// Autofix

		/** Execute in autofix mode. If a function, should return a boolean. */
		fix?: boolean | ((message: Linter.LintMessage) => boolean) | undefined;

		/** Array of rule types to apply fixes for. */
		fixTypes?: FixType[] | null | undefined;

		// Cache-related

		/** Enable result caching. */
		cache?: boolean | undefined;

		/** The cache file to use instead of .eslintcache. */
		cacheLocation?: string | undefined;

		/** The strategy used to detect changed files. */
		cacheStrategy?: CacheStrategy | undefined;

		/** If true, apply suppressions automatically. Defaults to false. */
		applySuppressions?: boolean | undefined;

		/** Path to suppressions file. Relative to cwd. Defaults to eslint-suppressions.json in cwd. */
		suppressionsLocation?: string | undefined;

		// Other Options

		/** Maximum number of linting threads, "auto" to choose automatically, "off" for no multithreading. */
		concurrency?: number | "auto" | "off" | undefined;

		/** Array of feature flags to enable. */
		flags?: string[] | undefined;
	}

	/** A linting result. */
	interface LintResult {
		/** The path to the file that was linted. */
		filePath: string;

		/** All of the messages for the result. */
		messages: Linter.LintMessage[];

		/** All of the suppressed messages for the result. */
		suppressedMessages: Linter.SuppressedLintMessage[];

		/** Number of errors for the result. */
		errorCount: number;

		/** Number of fatal errors for the result. */
		fatalErrorCount: number;

		/** Number of warnings for the result. */
		warningCount: number;

		/** Number of fixable errors for the result. */
		fixableErrorCount: number;

		/** Number of fixable warnings for the result. */
		fixableWarningCount: number;

		/** The source code of the file that was linted, with as many fixes applied as possible. */
		output?: string | undefined;

		/** The source code of the file that was linted. */
		source?: string | undefined;

		/** The performance statistics collected with the `stats` flag. */
		stats?: Linter.Stats | undefined;

		/** The list of used deprecated rules. */
		usedDeprecatedRules: DeprecatedRuleUse[];
	}

	/**
	 * Information provided when the maximum warning threshold is exceeded.
	 */
	interface MaxWarningsExceeded {
		/**
		 * Number of warnings to trigger nonzero exit code.
		 */
		maxWarnings: number;

		/**
		 * Number of warnings found while linting.
		 */
		foundWarnings: number;
	}

	interface LintResultData extends ResultsMeta {
		cwd: string;
		rulesMeta: {
			[ruleId: string]: Rule.RuleMetaData;
		};
	}

	/**
	 * Information about deprecated rules.
	 */
	interface DeprecatedRuleUse {
		/**
		 * The rule ID.
		 */
		ruleId: string;

		/**
		 * The rule IDs that replace this deprecated rule.
		 */
		replacedBy: string[];

		/**
		 * The raw deprecated info provided by the rule.
		 * - Undefined if the rule's `meta.deprecated` property is a boolean.
		 * - Unset when using the legacy eslintrc configuration.
		 */
		info?: DeprecatedInfo | undefined;
	}

	/**
	 * Metadata about results for formatters.
	 */
	interface ResultsMeta {
		/**
		 * Whether or not to use color in the formatter output.
		 * - If `--color` was set, this property is `true`.
		 * - If `--no-color` was set, it is `false`.
		 * - If neither option was provided, the property is omitted.
		 */
		color?: boolean | undefined;

		/**
		 * Present if the maxWarnings threshold was exceeded.
		 */
		maxWarningsExceeded?: MaxWarningsExceeded | undefined;
	}

	/** The type of an object resolved by {@link ESLint.loadFormatter}. */
	interface LoadedFormatter {
		/**
		 * Used to call the underlying formatter.
		 * @param results An array of lint results to format.
		 * @param resultsMeta An object with optional `color` and `maxWarningsExceeded` properties that will be
		 * passed to the underlying formatter function along with other properties set by ESLint.
		 * This argument can be omitted if `color` and `maxWarningsExceeded` are not needed.
		 * @return The formatter output.
		 */
		format(
			results: LintResult[],
			resultsMeta?: ResultsMeta,
		): string | Promise<string>;
	}

	// The documented type name is `LoadedFormatter`, but `Formatter` has been historically more used.
	type Formatter = LoadedFormatter;

	/**
	 * The expected signature of a custom formatter.
	 * @param results An array of lint results to format.
	 * @param context Additional information for the formatter.
	 * @return The formatter output.
	 */
	type FormatterFunction = (
		results: LintResult[],
		context: LintResultData,
	) => string | Promise<string>;

	// Docs reference the types by those name
	type EditInfo = Rule.Fix;
}

// #endregion

/**
 * Loads the correct `ESLint` constructor.
 */
export function loadESLint(): Promise<typeof ESLint>;

// #region RuleTester

export class RuleTester {
	static describe: ((...args: any) => any) | null;
	static it: ((...args: any) => any) | null;
	static itOnly: ((...args: any) => any) | null;
	static setDefaultConfig(config: Linter.Config): void;
	static getDefaultConfig(): Linter.Config;
	static resetDefaultConfig(): void;

	constructor(config?: Linter.Config);

	run(
		name: string,
		rule: RuleDefinition,
		tests: {
			valid: Array<string | RuleTester.ValidTestCase>;
			invalid: RuleTester.InvalidTestCase[];
			/**
			 * Additional assertions for the "error" matchers of invalid test cases to enforce consistency.
			 */
			assertionOptions?: {
				/**
				 * If true, each `errors` block must check the expected error
				 * message, either via a string in the `errors` array, or via
				 * `message`/`messageId` in an errors object.
				 * `"message"`/`"messageId"` can be used to further limit the
				 * message assertions to the respective versions.
				 */
				requireMessage?: boolean | "message" | "messageId";
				/**
				 * If true, each `errors` block must be an array of objects,
				 * that each check all location properties `line`, `column`,
				 * `endLine`, `endColumn`, the later may be omitted, if the
				 * error does not contain them.
				 */
				requireLocation?: boolean;
				/**
				 * If true, each error and suggestion with a `messageId` must specify a `data`
				 * property if the referenced message contains placeholders.
				 * `"error"` and `"suggestion" limit the assertion to errors and suggestions respectively.
				 */
				requireData?: boolean | "error" | "suggestion";
			};
		},
	): void;

	static only(
		item: string | RuleTester.ValidTestCase | RuleTester.InvalidTestCase,
	): RuleTester.ValidTestCase | RuleTester.InvalidTestCase;
}

export namespace RuleTester {
	interface ValidTestCase extends Omit<
		Linter.Config,
		| "name"
		| "basePath"
		| "files"
		| "ignores"
		| "linterOptions"
		| "plugins"
		| "rules"
	> {
		name?: string;
		code: string;
		options?: any[];
		filename?: string | undefined;
		only?: boolean;
		before?: () => void;
		after?: () => void;
	}

	interface SuggestionOutput {
		messageId?: string;
		desc?: string;
		data?: MessagePlaceholderData | undefined;
		output: string;
	}

	interface InvalidTestCase extends ValidTestCase {
		errors: number | Array<TestCaseError | string | RegExp>;
		output?: string | null | undefined;
	}

	interface TestCaseError {
		message?: string | RegExp;
		messageId?: string;
		data?: MessagePlaceholderData | undefined;
		line?: number | undefined;
		column?: number | undefined;
		endLine?: number | undefined;
		endColumn?: number | undefined;
		suggestions?: SuggestionOutput[] | number | undefined;
	}
}

// #endregion
<?x   /**
 * @fileoverview This file contains the rule types for ESLint. It was initially extracted
 * from the `@types/eslint` package.
 */

/*
 * MIT License
 * Copyright (c) Microsoft Corporation.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE
 */

//------------------------------------------------------------------------------
// Imports
//------------------------------------------------------------------------------

import { Linter } from "./index";

//-----------------------------------------------------------------------------
// Helper types
//-----------------------------------------------------------------------------

interface NoRestrictedImportPathCommonOptions {
	name: string;
	message?: string;
	allowTypeImports?: boolean;
}

type EitherImportNamesOrAllowImportName =
	| { importNames?: string[]; allowImportNames?: never }
	| { allowImportNames?: string[]; importNames?: never };

type ValidNoRestrictedImportPathOptions = NoRestrictedImportPathCommonOptions &
	EitherImportNamesOrAllowImportName;

interface NoRestrictedImportPatternCommonOptions {
	message?: string;
	caseSensitive?: boolean;
	allowTypeImports?: boolean;
}

// Base type for group or regex constraint, ensuring mutual exclusivity
type EitherGroupOrRegEx =
	{ group: string[]; regex?: never } | { regex: string; group?: never };

// Base type for import name specifiers, ensuring mutual exclusivity
type EitherNameSpecifiers =
	| {
			importNames?: string[];
			importNamePattern?: string;
			allowImportNames?: never;
			allowImportNamePattern?: never;
	  }
	| {
			allowImportNames?: string[];
			importNames?: never;
			importNamePattern?: never;
			allowImportNamePattern?: never;
	  }
	| {
			allowImportNamePattern?: string;
			importNames?: never;
			allowImportNames?: never;
			importNamePattern?: never;
	  };

// Adds oneOf and not constraints, ensuring group or regex are present and mutually exclusive sets for importNames, allowImportNames, etc., as per the schema.
type ValidNoRestrictedImportPatternOptions =
	NoRestrictedImportPatternCommonOptions &
		EitherGroupOrRegEx &
		EitherNameSpecifiers;

interface CapitalizedCommentsCommonOptions {
	ignorePattern?: string;
	/**
	 * @default false
	 */
	ignoreInlineComments?: boolean;
	/**
	 * @default false
	 */
	ignoreConsecutiveComments?: boolean;
}

//-----------------------------------------------------------------------------
// Public types
//-----------------------------------------------------------------------------

export interface ESLintRules extends Linter.RulesRecord {
	/**
	 * Rule to enforce getter and setter pairs in objects and classes.
	 *
	 * @since 0.22.0
	 * @see https://eslint.org/docs/latest/rules/accessor-pairs
	 */
	"accessor-pairs": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default true
				 */
				setWithoutGet: boolean;
				/**
				 * @default false
				 */
				getWithoutSet: boolean;
				/**
				 * @default true
				 */
				enforceForClassMembers: boolean;
				/**
				 * @default false
				 */
				enforceForTSTypes: boolean;
			}>,
		]
	>;

	/**
	 * Rule to enforce linebreaks after opening and before closing array brackets.
	 *
	 * @since 4.0.0-alpha.1
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`array-bracket-newline`](https://eslint.style/rules/array-bracket-newline) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/array-bracket-newline
	 */
	"array-bracket-newline": Linter.RuleEntry<
		[
			| "always"
			| "never"
			| "consistent"
			| Partial<{
					/**
					 * @default true
					 */
					multiline: boolean;
					/**
					 * @default null
					 */
					minItems: number | null;
			  }>,
		]
	>;

	/**
	 * Rule to enforce consistent spacing inside array brackets.
	 *
	 * @since 0.24.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`array-bracket-spacing`](https://eslint.style/rules/array-bracket-spacing) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/array-bracket-spacing
	 */
	"array-bracket-spacing":
		| Linter.RuleEntry<
				[
					"never",
					Partial<{
						/**
						 * @default false
						 */
						singleValue: boolean;
						/**
						 * @default false
						 */
						objectsInArrays: boolean;
						/**
						 * @default false
						 */
						arraysInArrays: boolean;
					}>,
				]
		  >
		| Linter.RuleEntry<
				[
					"always",
					Partial<{
						/**
						 * @default true
						 */
						singleValue: boolean;
						/**
						 * @default true
						 */
						objectsInArrays: boolean;
						/**
						 * @default true
						 */
						arraysInArrays: boolean;
					}>,
				]
		  >;

	/**
	 * Rule to enforce `return` statements in callbacks of array methods.
	 *
	 * @since 2.0.0-alpha-1
	 * @see https://eslint.org/docs/latest/rules/array-callback-return
	 */
	"array-callback-return": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				allowImplicit: boolean;
				/**
				 * @default false
				 */
				checkForEach: boolean;
				/**
				 * @default false
				 */
				allowVoid: boolean;
			}>,
		]
	>;

	/**
	 * Rule to enforce line breaks after each array element.
	 *
	 * @since 4.0.0-rc.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`array-element-newline`](https://eslint.style/rules/array-element-newline) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/array-element-newline
	 */
	"array-element-newline": Linter.RuleEntry<
		[
			| "always"
			| "never"
			| "consistent"
			| Partial<{
					/**
					 * @default true
					 */
					multiline: boolean;
					/**
					 * @default null
					 */
					minItems: number | null;
			  }>,
		]
	>;

	/**
	 * Rule to require braces around arrow function bodies.
	 *
	 * @since 1.8.0
	 * @see https://eslint.org/docs/latest/rules/arrow-body-style
	 */
	"arrow-body-style":
		| Linter.RuleEntry<
				[
					"as-needed",
					Partial<{
						/**
						 * @default false
						 */
						requireReturnForObjectLiteral: boolean;
					}>,
				]
		  >
		| Linter.RuleEntry<["always" | "never"]>;

	/**
	 * Rule to require parentheses around arrow function arguments.
	 *
	 * @since 1.0.0-rc-1
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`arrow-parens`](https://eslint.style/rules/arrow-parens) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/arrow-parens
	 */
	"arrow-parens":
		| Linter.RuleEntry<["always"]>
		| Linter.RuleEntry<
				[
					"as-needed",
					Partial<{
						/**
						 * @default false
						 */
						requireForBlockBody: boolean;
					}>,
				]
		  >;

	/**
	 * Rule to enforce consistent spacing before and after the arrow in arrow functions.
	 *
	 * @since 1.0.0-rc-1
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`arrow-spacing`](https://eslint.style/rules/arrow-spacing) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/arrow-spacing
	 */
	"arrow-spacing": Linter.RuleEntry<[]>;

	/**
	 * Rule to enforce the use of variables within the scope they are defined.
	 *
	 * @since 0.1.0
	 * @see https://eslint.org/docs/latest/rules/block-scoped-var
	 */
	"block-scoped-var": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow or enforce spaces inside of blocks after opening block and before closing block.
	 *
	 * @since 1.2.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`block-spacing`](https://eslint.style/rules/block-spacing) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/block-spacing
	 */
	"block-spacing": Linter.RuleEntry<["always" | "never"]>;

	/**
	 * Rule to enforce consistent brace style for blocks.
	 *
	 * @since 0.0.7
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`brace-style`](https://eslint.style/rules/brace-style) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/brace-style
	 */
	"brace-style": Linter.RuleEntry<
		[
			"1tbs" | "stroustrup" | "allman",
			Partial<{
				/**
				 * @default false
				 */
				allowSingleLine: boolean;
			}>,
		]
	>;

	/**
	 * Rule to require `return` statements after callbacks.
	 *
	 * @since 1.0.0-rc-1
	 * @deprecated since 7.0.0.
	 * Node.js rules were moved out of ESLint core.
	 * Please, use [`callback-return`](https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/callback-return.md) in [`eslint-plugin-n`](https://github.com/eslint-community/eslint-plugin-n).
	 * @see https://eslint.org/docs/latest/rules/callback-return
	 */
	"callback-return": Linter.RuleEntry<[string[]]>;

	/**
	 * Rule to enforce camelcase naming convention.
	 *
	 * @since 0.0.2
	 * @see https://eslint.org/docs/latest/rules/camelcase
	 */
	camelcase: Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default 'always'
				 */
				properties: "always" | "never";
				/**
				 * @default false
				 */
				ignoreDestructuring: boolean;
				/**
				 * @since 6.7.0
				 * @default false
				 */
				ignoreImports: boolean;
				/**
				 * @since 7.4.0
				 * @default false
				 */
				ignoreGlobals: boolean;
				/**
				 * @remarks
				 * Also accept for regular expression patterns
				 */
				allow: string[];
			}>,
		]
	>;

	/**
	 * Rule to enforce or disallow capitalization of the first letter of a comment.
	 *
	 * @since 3.11.0
	 * @see https://eslint.org/docs/latest/rules/capitalized-comments
	 */
	"capitalized-comments": Linter.RuleEntry<
		[
			"always" | "never",
			(
				| CapitalizedCommentsCommonOptions
				| Partial<{
						line: CapitalizedCommentsCommonOptions;
						block: CapitalizedCommentsCommonOptions;
				  }>
			),
		]
	>;

	/**
	 * Rule to enforce that class methods utilize `this`.
	 *
	 * @since 3.4.0
	 * @see https://eslint.org/docs/latest/rules/class-methods-use-this
	 */
	"class-methods-use-this": Linter.RuleEntry<
		[
			Partial<{
				exceptMethods: string[];
				/**
				 * @default true
				 */
				enforceForClassFields: boolean;
				/**
				 * @default false
				 */
				ignoreOverrideMethods: boolean;
				ignoreClassesWithImplements: "all" | "public-fields";
			}>,
		]
	>;

	/**
	 * Rule to require or disallow trailing commas.
	 *
	 * @since 0.16.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`comma-dangle`](https://eslint.style/rules/comma-dangle) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/comma-dangle
	 */
	"comma-dangle": Linter.RuleEntry<
		[
			| "never"
			| "always"
			| "always-multiline"
			| "only-multiline"
			| Partial<{
					/**
					 * @default 'never'
					 */
					arrays:
						| "never"
						| "always"
						| "always-multiline"
						| "only-multiline";
					/**
					 * @default 'never'
					 */
					objects:
						| "never"
						| "always"
						| "always-multiline"
						| "only-multiline";
					/**
					 * @default 'never'
					 */
					imports:
						| "never"
						| "always"
						| "always-multiline"
						| "only-multiline";
					/**
					 * @default 'never'
					 */
					exports:
						| "never"
						| "always"
						| "always-multiline"
						| "only-multiline";
					/**
					 * @default 'never'
					 */
					functions:
						| "never"
						| "always"
						| "always-multiline"
						| "only-multiline";
			  }>,
		]
	>;

	/**
	 * Rule to enforce consistent spacing before and after commas.
	 *
	 * @since 0.9.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`comma-spacing`](https://eslint.style/rules/comma-spacing) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/comma-spacing
	 */
	"comma-spacing": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				before: boolean;
				/**
				 * @default true
				 */
				after: boolean;
			}>,
		]
	>;

	/**
	 * Rule to enforce consistent comma style.
	 *
	 * @since 0.9.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`comma-style`](https://eslint.style/rules/comma-style) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/comma-style
	 */
	"comma-style": Linter.RuleEntry<
		[
			"last" | "first",
			Partial<{
				exceptions: Record<string, boolean>;
			}>,
		]
	>;

	/**
	 * Rule to enforce a maximum cyclomatic complexity allowed in a program.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/complexity
	 */
	complexity: Linter.RuleEntry<
		[
			| Partial<{
					/**
					 * @default 20
					 */
					max: number;
					/**
					 * @deprecated
					 * @default 20
					 */
					maximum: number;
					/**
					 * @default "classic"
					 * @since 9.12.0
					 */
					variant: "classic" | "modified";
			  }>
			| number,
		]
	>;

	/**
	 * Rule to enforce consistent spacing inside computed property brackets.
	 *
	 * @since 0.23.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`computed-property-spacing`](https://eslint.style/rules/computed-property-spacing) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/computed-property-spacing
	 */
	"computed-property-spacing": Linter.RuleEntry<["never" | "always"]>;

	/**
	 * Rule to require `return` statements to either always or never specify values.
	 *
	 * @since 0.4.0
	 * @see https://eslint.org/docs/latest/rules/consistent-return
	 */
	"consistent-return": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				treatUndefinedAsUnspecified: boolean;
			}>,
		]
	>;

	/**
	 * Rule to enforce consistent naming when capturing the current execution context.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/consistent-this
	 */
	"consistent-this": Linter.RuleEntry<[...string[]]>;

	/**
	 * Rule to require `super()` calls in constructors.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.24.0
	 * @see https://eslint.org/docs/latest/rules/constructor-super
	 */
	"constructor-super": Linter.RuleEntry<[]>;

	/**
	 * Rule to enforce consistent brace style for all control statements.
	 *
	 * @since 0.0.2
	 * @see https://eslint.org/docs/latest/rules/curly
	 */
	curly: Linter.RuleEntry<
		["all"] | ["multi" | "multi-line" | "multi-or-nest", "consistent"?]
	>;

	/**
	 * Rule to require `default` cases in `switch` statements.
	 *
	 * @since 0.6.0
	 * @see https://eslint.org/docs/latest/rules/default-case
	 */
	"default-case": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default '^no default$'
				 */
				commentPattern: string;
			}>,
		]
	>;

	/**
	 * Rule to enforce `default` clauses in `switch` statements to be last.
	 *
	 * @since 7.0.0-alpha.0
	 * @see https://eslint.org/docs/latest/rules/default-case-last
	 */
	"default-case-last": Linter.RuleEntry<[]>;

	/**
	 * Rule to enforce default parameters to be last.
	 *
	 * @since 6.4.0
	 * @see https://eslint.org/docs/latest/rules/default-param-last
	 */
	"default-param-last": Linter.RuleEntry<[]>;

	/**
	 * Rule to enforce consistent newlines before and after dots.
	 *
	 * @since 0.21.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`dot-location`](https://eslint.style/rules/dot-location) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/dot-location
	 */
	"dot-location": Linter.RuleEntry<["object" | "property"]>;

	/**
	 * Rule to enforce dot notation whenever possible.
	 *
	 * @since 0.0.7
	 * @see https://eslint.org/docs/latest/rules/dot-notation
	 */
	"dot-notation": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default true
				 */
				allowKeywords: boolean;
				allowPattern: string;
			}>,
		]
	>;

	/**
	 * Rule to require or disallow newline at the end of files.
	 *
	 * @since 0.7.1
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`eol-last`](https://eslint.style/rules/eol-last) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/eol-last
	 */
	"eol-last": Linter.RuleEntry<
		[
			"always" | "never", // | 'unix' | 'windows'
		]
	>;

	/**
	 * Rule to require the use of `===` and `!==`.
	 *
	 * @since 0.0.2
	 * @see https://eslint.org/docs/latest/rules/eqeqeq
	 */
	eqeqeq:
		| Linter.RuleEntry<
				[
					"always",
					Partial<{
						/**
						 * @default 'always'
						 */
						null: "always" | "never" | "ignore";
					}>,
				]
		  >
		| Linter.RuleEntry<["smart" | "allow-null"]>;

	/**
	 * Rule to enforce `for` loop update clause moving the counter in the right direction.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 4.0.0-beta.0
	 * @see https://eslint.org/docs/latest/rules/for-direction
	 */
	"for-direction": Linter.RuleEntry<[]>;

	/**
	 * Rule to require or disallow spacing between function identifiers and their invocations.
	 *
	 * @since 3.3.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`function-call-spacing`](https://eslint.style/rules/function-call-spacing) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/func-call-spacing
	 */
	"func-call-spacing": Linter.RuleEntry<["never" | "always"]>;

	/**
	 * Rule to require function names to match the name of the variable or property to which they are assigned.
	 *
	 * @since 3.8.0
	 * @see https://eslint.org/docs/latest/rules/func-name-matching
	 */
	"func-name-matching":
		| Linter.RuleEntry<
				[
					"always" | "never",
					Partial<{
						/**
						 * @default false
						 */
						considerPropertyDescriptor: boolean;
						/**
						 * @default false
						 */
						includeCommonJSModuleExports: boolean;
					}>,
				]
		  >
		| Linter.RuleEntry<
				[
					Partial<{
						/**
						 * @default false
						 */
						considerPropertyDescriptor: boolean;
						/**
						 * @default false
						 */
						includeCommonJSModuleExports: boolean;
					}>,
				]
		  >;

	/**
	 * Rule to require or disallow named `function` expressions.
	 *
	 * @since 0.4.0
	 * @see https://eslint.org/docs/latest/rules/func-names
	 */
	"func-names": Linter.RuleEntry<
		[
			"always" | "as-needed" | "never",
			Partial<{
				generators: "always" | "as-needed" | "never";
			}>,
		]
	>;

	/**
	 * Rule to enforce the consistent use of either `function` declarations or expressions assigned to variables.
	 *
	 * @since 0.2.0
	 * @see https://eslint.org/docs/latest/rules/func-style
	 */
	"func-style": Linter.RuleEntry<
		[
			"expression" | "declaration",
			Partial<{
				/**
				 * @default false
				 */
				allowArrowFunctions: boolean;
				/**
				 * @default false
				 */
				allowTypeAnnotation: boolean;
				overrides: {
					namedExports: "declaration" | "expression" | "ignore";
				};
			}>,
		]
	>;

	/**
	 * Rule to enforce line breaks between arguments of a function call.
	 *
	 * @since 6.2.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`function-call-argument-newline`](https://eslint.style/rules/function-call-argument-newline) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/function-call-argument-newline
	 */
	"function-call-argument-newline": Linter.RuleEntry<
		[
			/**
			 * @default "always"
			 */
			"always" | "never" | "consistent",
		]
	>;

	/**
	 * Rule to enforce consistent line breaks inside function parentheses.
	 *
	 * @since 4.6.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`function-paren-newline`](https://eslint.style/rules/function-paren-newline) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/function-paren-newline
	 */
	"function-paren-newline": Linter.RuleEntry<
		[
			| "always"
			| "never"
			| "multiline"
			| "multiline-arguments"
			| "consistent"
			| Partial<{
					minItems: number;
			  }>,
		]
	>;

	/**
	 * Rule to enforce consistent spacing around `*` operators in generator functions.
	 *
	 * @since 0.17.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`generator-star-spacing`](https://eslint.style/rules/generator-star-spacing) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/generator-star-spacing
	 */
	"generator-star-spacing": Linter.RuleEntry<
		[
			| Partial<{
					before: boolean;
					after: boolean;
					named:
						| Partial<{
								before: boolean;
								after: boolean;
						  }>
						| "before"
						| "after"
						| "both"
						| "neither";
					anonymous:
						| Partial<{
								before: boolean;
								after: boolean;
						  }>
						| "before"
						| "after"
						| "both"
						| "neither";
					method:
						| Partial<{
								before: boolean;
								after: boolean;
						  }>
						| "before"
						| "after"
						| "both"
						| "neither";
			  }>
			| "before"
			| "after"
			| "both"
			| "neither",
		]
	>;

	/**
	 * Rule to enforce `return` statements in getters.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 4.2.0
	 * @see https://eslint.org/docs/latest/rules/getter-return
	 */
	"getter-return": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				allowImplicit: boolean;
			}>,
		]
	>;

	/**
	 * Rule to require `require()` calls to be placed at top-level module scope.
	 *
	 * @since 1.4.0
	 * @deprecated since 7.0.0.
	 * Node.js rules were moved out of ESLint core.
	 * Please, use [`global-require`](https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/global-require.md) in [`eslint-plugin-n`](https://github.com/eslint-community/eslint-plugin-n).
	 * @see https://eslint.org/docs/latest/rules/global-require
	 */
	"global-require": Linter.RuleEntry<[]>;

	/**
	 * Rule to require grouped accessor pairs in object literals and classes.
	 *
	 * @since 6.7.0
	 * @see https://eslint.org/docs/latest/rules/grouped-accessor-pairs
	 */
	"grouped-accessor-pairs": Linter.RuleEntry<
		[
			"anyOrder" | "getBeforeSet" | "setBeforeGet",
			Partial<{
				/**
				 * @default false
				 */
				enforceForTSTypes: boolean;
			}>,
		]
	>;

	/**
	 * Rule to require `for-in` loops to include an `if` statement.
	 *
	 * @since 0.0.6
	 * @see https://eslint.org/docs/latest/rules/guard-for-in
	 */
	"guard-for-in": Linter.RuleEntry<[]>;

	/**
	 * Rule to require error handling in callbacks.
	 *
	 * @since 0.4.5
	 * @deprecated since 7.0.0.
	 * Node.js rules were moved out of ESLint core.
	 * Please, use [`handle-callback-err`](https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/handle-callback-err.md) in [`eslint-plugin-n`](https://github.com/eslint-community/eslint-plugin-n).
	 * @see https://eslint.org/docs/latest/rules/handle-callback-err
	 */
	"handle-callback-err": Linter.RuleEntry<[string]>;

	/**
	 * Rule to disallow specified identifiers.
	 *
	 * @since 2.0.0-beta.2
	 * @deprecated since 7.5.0.
	 * The rule was renamed.
	 * Please, use [`id-denylist`](https://eslint.org/docs/rules/id-denylist).
	 * @see https://eslint.org/docs/latest/rules/id-blacklist
	 */
	"id-blacklist": Linter.RuleEntry<[...string[]]>;

	/**
	 * Rule to disallow specified identifiers.
	 *
	 * @since 7.4.0
	 * @see https://eslint.org/docs/latest/rules/id-denylist
	 */
	"id-denylist": Linter.RuleEntry<string[]>;

	/**
	 * Rule to enforce minimum and maximum identifier lengths.
	 *
	 * @since 1.0.0
	 * @see https://eslint.org/docs/latest/rules/id-length
	 */
	"id-length": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default 2
				 */
				min: number;
				/**
				 * @default Infinity
				 */
				max: number;
				/**
				 * @default 'always'
				 */
				properties: "always" | "never";
				exceptions: string[];
				exceptionPatterns: string[];
			}>,
		]
	>;

	/**
	 * Rule to require identifiers to match a specified regular expression.
	 *
	 * @since 1.0.0
	 * @see https://eslint.org/docs/latest/rules/id-match
	 */
	"id-match": Linter.RuleEntry<
		[
			string,
			Partial<{
				/**
				 * @default false
				 */
				properties: boolean;
				/**
				 * @default false
				 */
				classFields: boolean;
				/**
				 * @default false
				 */
				onlyDeclarations: boolean;
				/**
				 * @default false
				 */
				ignoreDestructuring: boolean;
			}>,
		]
	>;

	/**
	 * Rule to enforce the location of arrow function bodies.
	 *
	 * @since 4.12.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`implicit-arrow-linebreak`](https://eslint.style/rules/implicit-arrow-linebreak) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/implicit-arrow-linebreak
	 */
	"implicit-arrow-linebreak": Linter.RuleEntry<["beside" | "below"]>;

	/**
	 * Rule to enforce consistent indentation.
	 *
	 * @since 0.14.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`indent`](https://eslint.style/rules/indent) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/indent
	 */
	indent: Linter.RuleEntry<
		[
			number | "tab",
			Partial<{
				/**
				 * @default 0
				 */
				SwitchCase: number;
				/**
				 * @default 1
				 */
				VariableDeclarator:
					| Partial<{
							/**
							 * @default 1
							 */
							var: number | "first";
							/**
							 * @default 1
							 */
							let: number | "first";
							/**
							 * @default 1
							 */
							const: number | "first";
					  }>
					| number
					| "first";
				/**
				 * @default 1
				 */
				outerIIFEBody: number;
				/**
				 * @default 1
				 */
				MemberExpression: number | "off";
				/**
				 * @default { parameters: 1, body: 1 }
				 */
				FunctionDeclaration: Partial<{
					/**
					 * @default 1
					 */
					parameters: number | "first" | "off";
					/**
					 * @default 1
					 */
					body: number;
				}>;
				/**
				 * @default { parameters: 1, body: 1 }
				 */
				FunctionExpression: Partial<{
					/**
					 * @default 1
					 */
					parameters: number | "first" | "off";
					/**
					 * @default 1
					 */
					body: number;
				}>;
				/**
				 * @default { arguments: 1 }
				 */
				CallExpression: Partial<{
					/**
					 * @default 1
					 */
					arguments: number | "first" | "off";
				}>;
				/**
				 * @default 1
				 */
				ArrayExpression: number | "first" | "off";
				/**
				 * @default 1
				 */
				ObjectExpression: number | "first" | "off";
				/**
				 * @default 1
				 */
				ImportDeclaration: number | "first" | "off";
				/**
				 * @default false
				 */
				flatTernaryExpressions: boolean;
				ignoredNodes: string[];
				/**
				 * @default false
				 */
				ignoreComments: boolean;
			}>,
		]
	>;

	/**
	 * Rule to enforce consistent indentation.
	 *
	 * @since 4.0.0-alpha.0
	 * @deprecated since 4.0.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`indent`](https://eslint.style/rules/indent) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/indent-legacy
	 */
	"indent-legacy": Linter.RuleEntry<
		[
			number | "tab",
			Partial<{
				/**
				 * @default 0
				 */
				SwitchCase: number;
				/**
				 * @default 1
				 */
				VariableDeclarator:
					| Partial<{
							/**
							 * @default 1
							 */
							var: number | "first";
							/**
							 * @default 1
							 */
							let: number | "first";
							/**
							 * @default 1
							 */
							const: number | "first";
					  }>
					| number
					| "first";
				/**
				 * @default 1
				 */
				outerIIFEBody: number;
				/**
				 * @default 1
				 */
				MemberExpression: number | "off";
				/**
				 * @default { parameters: 1, body: 1 }
				 */
				FunctionDeclaration: Partial<{
					/**
					 * @default 1
					 */
					parameters: number | "first" | "off";
					/**
					 * @default 1
					 */
					body: number;
				}>;
				/**
				 * @default { parameters: 1, body: 1 }
				 */
				FunctionExpression: Partial<{
					/**
					 * @default 1
					 */
					parameters: number | "first" | "off";
					/**
					 * @default 1
					 */
					body: number;
				}>;
				/**
				 * @default { arguments: 1 }
				 */
				CallExpression: Partial<{
					/**
					 * @default 1
					 */
					arguments: number | "first" | "off";
				}>;
				/**
				 * @default 1
				 */
				ArrayExpression: number | "first" | "off";
				/**
				 * @default 1
				 */
				ObjectExpression: number | "first" | "off";
				/**
				 * @default 1
				 */
				ImportDeclaration: number | "first" | "off";
				/**
				 * @default false
				 */
				flatTernaryExpressions: boolean;
				ignoredNodes: string[];
				/**
				 * @default false
				 */
				ignoreComments: boolean;
			}>,
		]
	>;

	/**
	 * Rule to require or disallow initialization in variable declarations.
	 *
	 * @since 1.0.0-rc-1
	 * @see https://eslint.org/docs/latest/rules/init-declarations
	 */
	"init-declarations":
		| Linter.RuleEntry<["always"]>
		| Linter.RuleEntry<
				[
					"never",
					Partial<{
						ignoreForLoopInit: boolean;
					}>,
				]
		  >;

	/**
	 * Rule to enforce the consistent use of either double or single quotes in JSX attributes.
	 *
	 * @since 1.4.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`jsx-quotes`](https://eslint.style/rules/jsx-quotes) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/jsx-quotes
	 */
	"jsx-quotes": Linter.RuleEntry<["prefer-double" | "prefer-single"]>;

	/**
	 * Rule to enforce consistent spacing between keys and values in object literal properties.
	 *
	 * @since 0.9.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`key-spacing`](https://eslint.style/rules/key-spacing) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/key-spacing
	 */
	"key-spacing": Linter.RuleEntry<
		[
			| Partial<
					| {
							/**
							 * @default false
							 */
							beforeColon: boolean;
							/**
							 * @default true
							 */
							afterColon: boolean;
							/**
							 * @default 'strict'
							 */
							mode: "strict" | "minimum";
							align:
								| Partial<{
										/**
										 * @default false
										 */
										beforeColon: boolean;
										/**
										 * @default true
										 */
										afterColon: boolean;
										/**
										 * @default 'colon'
										 */
										on: "value" | "colon";
										/**
										 * @default 'strict'
										 */
										mode: "strict" | "minimum";
								  }>
								| "value"
								| "colon";
					  }
					| {
							singleLine?:
								| Partial<{
										/**
										 * @default false
										 */
										beforeColon: boolean;
										/**
										 * @default true
										 */
										afterColon: boolean;
										/**
										 * @default 'strict'
										 */
										mode: "strict" | "minimum";
								  }>
								| undefined;
							multiLine?:
								| Partial<{
										/**
										 * @default false
										 */
										beforeColon: boolean;
										/**
										 * @default true
										 */
										afterColon: boolean;
										/**
										 * @default 'strict'
										 */
										mode: "strict" | "minimum";
										align:
											| Partial<{
													/**
													 * @default false
													 */
													beforeColon: boolean;
													/**
													 * @default true
													 */
													afterColon: boolean;
													/**
													 * @default 'colon'
													 */
													on: "value" | "colon";
													/**
													 * @default 'strict'
													 */
													mode: "strict" | "minimum";
											  }>
											| "value"
											| "colon";
								  }>
								| undefined;
					  }
			  >
			| {
					align: Partial<{
						/**
						 * @default false
						 */
						beforeColon: boolean;
						/**
						 * @default true
						 */
						afterColon: boolean;
						/**
						 * @default 'colon'
						 */
						on: "value" | "colon";
						/**
						 * @default 'strict'
						 */
						mode: "strict" | "minimum";
					}>;
					singleLine?:
						| Partial<{
								/**
								 * @default false
								 */
								beforeColon: boolean;
								/**
								 * @default true
								 */
								afterColon: boolean;
								/**
								 * @default 'strict'
								 */
								mode: "strict" | "minimum";
						  }>
						| undefined;
					multiLine?:
						| Partial<{
								/**
								 * @default false
								 */
								beforeColon: boolean;
								/**
								 * @default true
								 */
								afterColon: boolean;
								/**
								 * @default 'strict'
								 */
								mode: "strict" | "minimum";
						  }>
						| undefined;
			  },
		]
	>;

	/**
	 * Rule to enforce consistent spacing before and after keywords.
	 *
	 * @since 2.0.0-beta.1
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`keyword-spacing`](https://eslint.style/rules/keyword-spacing) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/keyword-spacing
	 */
	"keyword-spacing": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default true
				 */
				before: boolean;
				/**
				 * @default true
				 */
				after: boolean;
				overrides: Record<
					string,
					Partial<{
						before: boolean;
						after: boolean;
					}>
				>;
			}>,
		]
	>;

	/**
	 * Rule to enforce position of line comments.
	 *
	 * @since 3.5.0
	 * @deprecated since 9.3.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`line-comment-position`](https://eslint.style/rules/line-comment-position) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/line-comment-position
	 */
	"line-comment-position": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default 'above'
				 */
				position: "above" | "beside";
				ignorePattern: string;
				/**
				 * @default true
				 */
				applyDefaultIgnorePatterns: boolean;
			}>,
		]
	>;

	/**
	 * Rule to enforce consistent linebreak style.
	 *
	 * @since 0.21.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`linebreak-style`](https://eslint.style/rules/linebreak-style) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/linebreak-style
	 */
	"linebreak-style": Linter.RuleEntry<["unix" | "windows"]>;

	/**
	 * Rule to require empty lines around comments.
	 *
	 * @since 0.22.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`lines-around-comment`](https://eslint.style/rules/lines-around-comment) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/lines-around-comment
	 */
	"lines-around-comment": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default true
				 */
				beforeBlockComment: boolean;
				/**
				 * @default false
				 */
				afterBlockComment: boolean;
				/**
				 * @default false
				 */
				beforeLineComment: boolean;
				/**
				 * @default false
				 */
				afterLineComment: boolean;
				/**
				 * @default false
				 */
				allowBlockStart: boolean;
				/**
				 * @default false
				 */
				allowBlockEnd: boolean;
				/**
				 * @default false
				 */
				allowObjectStart: boolean;
				/**
				 * @default false
				 */
				allowObjectEnd: boolean;
				/**
				 * @default false
				 */
				allowArrayStart: boolean;
				/**
				 * @default false
				 */
				allowArrayEnd: boolean;
				/**
				 * @default false
				 */
				allowClassStart: boolean;
				/**
				 * @default false
				 */
				allowClassEnd: boolean;
				ignorePattern: string;
				/**
				 * @default true
				 */
				applyDefaultIgnorePatterns: boolean;
			}>,
		]
	>;

	/**
	 * Rule to require or disallow newlines around directives.
	 *
	 * @since 3.5.0
	 * @deprecated since 4.0.0.
	 * The rule was replaced with a more general rule.
	 * Please, use [`padding-line-between-statements`](https://eslint.style/rules/padding-line-between-statements) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/lines-around-directive
	 */
	"lines-around-directive": Linter.RuleEntry<["always" | "never"]>;

	/**
	 * Rule to require or disallow an empty line between class members.
	 *
	 * @since 4.9.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`lines-between-class-members`](https://eslint.style/rules/lines-between-class-members) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/lines-between-class-members
	 */
	"lines-between-class-members": Linter.RuleEntry<
		[
			(
				| "always"
				| "never"
				| {
						enforce: Array<{
							blankLine: "always" | "never";
							prev: "method" | "field" | "*";
							next: "method" | "field" | "*";
						}>;
				  }
			),
			Partial<{
				/**
				 * @default false
				 */
				exceptAfterSingleLine: boolean;
			}>,
		]
	>;

	/**
	 * Rule to require or disallow logical assignment operator shorthand.
	 *
	 * @since 8.24.0
	 * @see https://eslint.org/docs/latest/rules/logical-assignment-operators
	 */
	"logical-assignment-operators":
		| Linter.RuleEntry<
				[
					"always",
					Partial<{
						/**
						 * @default false
						 */
						enforceForIfStatements: boolean;
					}>,
				]
		  >
		| Linter.RuleEntry<["never"]>;

	/**
	 * Rule to enforce a maximum number of classes per file.
	 *
	 * @since 5.0.0-alpha.3
	 * @see https://eslint.org/docs/latest/rules/max-classes-per-file
	 */
	"max-classes-per-file": Linter.RuleEntry<
		[
			| number
			| Partial<{
					/**
					 * @default false
					 */
					ignoreExpressions: boolean;
					/**
					 * @default 1
					 */
					max: number;
			  }>,
		]
	>;

	/**
	 * Rule to enforce a maximum depth that blocks can be nested.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/max-depth
	 */
	"max-depth": Linter.RuleEntry<
		[
			| number
			| Partial<{
					/**
					 * @deprecated
					 * @default 4
					 */
					maximum: number;
					/**
					 * @default 4
					 */
					max: number;
			  }>,
		]
	>;

	/**
	 * Rule to enforce a maximum line length.
	 *
	 * @since 0.0.9
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`max-len`](https://eslint.style/rules/max-len) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/max-len
	 */
	"max-len": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default 80
				 */
				code: number;
				/**
				 * @default 4
				 */
				tabWidth: number;
				comments: number;
				ignorePattern: string;
				/**
				 * @default false
				 */
				ignoreComments: boolean;
				/**
				 * @default false
				 */
				ignoreTrailingComments: boolean;
				/**
				 * @default false
				 */
				ignoreUrls: boolean;
				/**
				 * @default false
				 */
				ignoreStrings: boolean;
				/**
				 * @default false
				 */
				ignoreTemplateLiterals: boolean;
				/**
				 * @default false
				 */
				ignoreRegExpLiterals: boolean;
			}>,
		]
	>;

	/**
	 * Rule to enforce a maximum number of lines per file.
	 *
	 * @since 2.12.0
	 * @see https://eslint.org/docs/latest/rules/max-lines
	 */
	"max-lines": Linter.RuleEntry<
		[
			| Partial<{
					/**
					 * @default 300
					 */
					max: number;
					/**
					 * @default false
					 */
					skipBlankLines: boolean;
					/**
					 * @default false
					 */
					skipComments: boolean;
			  }>
			| number,
		]
	>;

	/**
	 * Rule to enforce a maximum number of lines of code in a function.
	 *
	 * @since 5.0.0
	 * @see https://eslint.org/docs/latest/rules/max-lines-per-function
	 */
	"max-lines-per-function": Linter.RuleEntry<
		[
			| number
			| Partial<{
					/**
					 * @default 50
					 */
					max: number;
					/**
					 * @default false
					 */
					skipBlankLines: boolean;
					/**
					 * @default false
					 */
					skipComments: boolean;
					/**
					 * @default false
					 */
					IIFEs: boolean;
			  }>,
		]
	>;

	/**
	 * Rule to enforce a maximum depth that callbacks can be nested.
	 *
	 * @since 0.2.0
	 * @see https://eslint.org/docs/latest/rules/max-nested-callbacks
	 */
	"max-nested-callbacks": Linter.RuleEntry<
		[
			| number
			| Partial<{
					/**
					 * @deprecated
					 * @default 10
					 */
					maximum: number;
					/**
					 * @default 10
					 */
					max: number;
					/**
					 * @default false
					 */
					checkConstructorCallCallbacks: boolean;
			  }>,
		]
	>;

	/**
	 * Rule to enforce a maximum number of parameters in function definitions.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/max-params
	 */
	"max-params": Linter.RuleEntry<
		[
			| number
			| Partial<{
					/**
					 * @deprecated
					 * @default 3
					 */
					maximum: number;
					/**
					 * @default 3
					 */
					max: number;
					/**
					 * @deprecated Replaced with `countThis'
					 * @default false
					 */
					countVoidThis: boolean;
					/**
					 * @default "except-void"
					 */
					countThis: "always" | "never" | "except-void";
			  }>,
		]
	>;

	/**
	 * Rule to enforce a maximum number of statements allowed in function blocks.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/max-statements
	 */
	"max-statements": Linter.RuleEntry<
		[
			(
				| number
				| Partial<{
						/**
						 * @deprecated
						 * @default 10
						 */
						maximum: number;
						/**
						 * @default 10
						 */
						max: number;
				  }>
			),
			Partial<{
				/**
				 * @default false
				 */
				ignoreTopLevelFunctions: boolean;
			}>,
		]
	>;

	/**
	 * Rule to enforce a maximum number of statements allowed per line.
	 *
	 * @since 2.5.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`max-statements-per-line`](https://eslint.style/rules/max-statements-per-line) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/max-statements-per-line
	 */
	"max-statements-per-line": Linter.RuleEntry<
		[
			| Partial<{
					/**
					 * @default 1
					 */
					max: number;
			  }>
			| number,
		]
	>;

	/**
	 * Rule to enforce a particular style for multiline comments.
	 *
	 * @since 4.10.0
	 * @deprecated since 9.3.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`multiline-comment-style`](https://eslint.style/rules/multiline-comment-style) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/multiline-comment-style
	 */
	"multiline-comment-style": Linter.RuleEntry<
		["starred-block" | "bare-block" | "separate-lines"]
	>;

	/**
	 * Rule to enforce newlines between operands of ternary expressions.
	 *
	 * @since 3.1.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`multiline-ternary`](https://eslint.style/rules/multiline-ternary) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/multiline-ternary
	 */
	"multiline-ternary": Linter.RuleEntry<
		["always" | "always-multiline" | "never"]
	>;

	/**
	 * Rule to require constructor names to begin with a capital letter.
	 *
	 * @since 0.0.3-0
	 * @see https://eslint.org/docs/latest/rules/new-cap
	 */
	"new-cap": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default true
				 */
				newIsCap: boolean;
				/**
				 * @default true
				 */
				capIsNew: boolean;
				newIsCapExceptions: string[];
				newIsCapExceptionPattern: string;
				capIsNewExceptions: string[];
				capIsNewExceptionPattern: string;
				/**
				 * @default true
				 */
				properties: boolean;
			}>,
		]
	>;

	/**
	 * Rule to enforce or disallow parentheses when invoking a constructor with no arguments.
	 *
	 * @since 0.0.6
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`new-parens`](https://eslint.style/rules/new-parens) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/new-parens
	 */
	"new-parens": Linter.RuleEntry<["always" | "never"]>;

	/**
	 * Rule to require or disallow an empty line after variable declarations.
	 *
	 * @since 0.18.0
	 * @deprecated since 4.0.0.
	 * The rule was replaced with a more general rule.
	 * Please, use [`padding-line-between-statements`](https://eslint.style/rules/padding-line-between-statements) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/newline-after-var
	 */
	"newline-after-var": Linter.RuleEntry<["always" | "never"]>;

	/**
	 * Rule to require an empty line before `return` statements.
	 *
	 * @since 2.3.0
	 * @deprecated since 4.0.0.
	 * The rule was replaced with a more general rule.
	 * Please, use [`padding-line-between-statements`](https://eslint.style/rules/padding-line-between-statements) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/newline-before-return
	 */
	"newline-before-return": Linter.RuleEntry<[]>;

	/**
	 * Rule to require a newline after each call in a method chain.
	 *
	 * @since 2.0.0-rc.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`newline-per-chained-call`](https://eslint.style/rules/newline-per-chained-call) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/newline-per-chained-call
	 */
	"newline-per-chained-call": Linter.RuleEntry<
		[
			{
				/**
				 * @default 2
				 */
				ignoreChainWithDepth: number;
			},
		]
	>;

	/**
	 * Rule to disallow the use of `alert`, `confirm`, and `prompt`.
	 *
	 * @since 0.0.5
	 * @see https://eslint.org/docs/latest/rules/no-alert
	 */
	"no-alert": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow `Array` constructors.
	 *
	 * @since 0.4.0
	 * @see https://eslint.org/docs/latest/rules/no-array-constructor
	 */
	"no-array-constructor": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow using an async function as a Promise executor.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 5.3.0
	 * @see https://eslint.org/docs/latest/rules/no-async-promise-executor
	 */
	"no-async-promise-executor": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow `await` inside of loops.
	 *
	 * @since 3.12.0
	 * @see https://eslint.org/docs/latest/rules/no-await-in-loop
	 */
	"no-await-in-loop": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow bitwise operators.
	 *
	 * @since 0.0.2
	 * @see https://eslint.org/docs/latest/rules/no-bitwise
	 */
	"no-bitwise": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default []
				 */
				allow: Array<
					| "^"
					| "|"
					| "&"
					| "<<"
					| ">>"
					| ">>>"
					| "^="
					| "|="
					| "&="
					| "<<="
					| ">>="
					| ">>>="
					| "~"
				>;
				/**
				 * @default false
				 */
				int32Hint: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow use of the `Buffer()` constructor.
	 *
	 * @since 4.0.0-alpha.0
	 * @deprecated since 7.0.0.
	 * Node.js rules were moved out of ESLint core.
	 * Please, use [`no-deprecated-api`](https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-deprecated-api.md) in [`eslint-plugin-n`](https://github.com/eslint-community/eslint-plugin-n).
	 * @see https://eslint.org/docs/latest/rules/no-buffer-constructor
	 */
	"no-buffer-constructor": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow the use of `arguments.caller` or `arguments.callee`.
	 *
	 * @since 0.0.6
	 * @see https://eslint.org/docs/latest/rules/no-caller
	 */
	"no-caller": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow lexical declarations in case clauses.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 1.9.0
	 * @see https://eslint.org/docs/latest/rules/no-case-declarations
	 */
	"no-case-declarations": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow `catch` clause parameters from shadowing variables in the outer scope.
	 *
	 * @since 0.0.9
	 * @deprecated since 5.1.0.
	 * This rule was renamed.
	 * Please, use [`no-shadow`](https://eslint.org/docs/rules/no-shadow).
	 * @see https://eslint.org/docs/latest/rules/no-catch-shadow
	 */
	"no-catch-shadow": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow reassigning class members.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 1.0.0-rc-1
	 * @see https://eslint.org/docs/latest/rules/no-class-assign
	 */
	"no-class-assign": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow comparing against `-0`.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 3.17.0
	 * @see https://eslint.org/docs/latest/rules/no-compare-neg-zero
	 */
	"no-compare-neg-zero": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow assignment operators in conditional expressions.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-cond-assign
	 */
	"no-cond-assign": Linter.RuleEntry<["except-parens" | "always"]>;

	/**
	 * Rule to disallow arrow functions where they could be confused with comparisons.
	 *
	 * @since 2.0.0-alpha-2
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`no-confusing-arrow`](https://eslint.style/rules/no-confusing-arrow) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/no-confusing-arrow
	 */
	"no-confusing-arrow": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default true
				 */
				allowParens: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow the use of `console`.
	 *
	 * @since 0.0.2
	 * @see https://eslint.org/docs/latest/rules/no-console
	 */
	"no-console": Linter.RuleEntry<
		[
			Partial<{
				allow: Array<keyof Console>;
			}>,
		]
	>;

	/**
	 * Rule to disallow reassigning `const`, `using`, and `await using` variables.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 1.0.0-rc-1
	 * @see https://eslint.org/docs/latest/rules/no-const-assign
	 */
	"no-const-assign": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow expressions where the operation doesn't affect the value.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 8.14.0
	 * @see https://eslint.org/docs/latest/rules/no-constant-binary-expression
	 */
	"no-constant-binary-expression": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				checkRelationalComparisons: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow constant expressions in conditions.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.4.1
	 * @see https://eslint.org/docs/latest/rules/no-constant-condition
	 */
	"no-constant-condition": Linter.RuleEntry<
		[
			{
				/**
				 * @default "allExceptWhileTrue"
				 */
				checkLoops: "all" | "allExceptWhileTrue" | "none" | boolean;
			},
		]
	>;

	/**
	 * Rule to disallow returning value from constructor.
	 *
	 * @since 6.7.0
	 * @see https://eslint.org/docs/latest/rules/no-constructor-return
	 */
	"no-constructor-return": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow `continue` statements.
	 *
	 * @since 0.19.0
	 * @see https://eslint.org/docs/latest/rules/no-continue
	 */
	"no-continue": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow control characters in regular expressions.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.1.0
	 * @see https://eslint.org/docs/latest/rules/no-control-regex
	 */
	"no-control-regex": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow the use of `debugger`.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.0.2
	 * @see https://eslint.org/docs/latest/rules/no-debugger
	 */
	"no-debugger": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow deleting variables.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-delete-var
	 */
	"no-delete-var": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow equal signs explicitly at the beginning of regular expressions.
	 *
	 * @since 0.1.0
	 * @see https://eslint.org/docs/latest/rules/no-div-regex
	 */
	"no-div-regex": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow duplicate arguments in `function` definitions.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.16.0
	 * @see https://eslint.org/docs/latest/rules/no-dupe-args
	 */
	"no-dupe-args": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow duplicate class members.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 1.2.0
	 * @see https://eslint.org/docs/latest/rules/no-dupe-class-members
	 */
	"no-dupe-class-members": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow duplicate conditions in if-else-if chains.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 6.7.0
	 * @see https://eslint.org/docs/latest/rules/no-dupe-else-if
	 */
	"no-dupe-else-if": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow duplicate keys in object literals.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-dupe-keys
	 */
	"no-dupe-keys": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow duplicate case labels.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.17.0
	 * @see https://eslint.org/docs/latest/rules/no-duplicate-case
	 */
	"no-duplicate-case": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow duplicate module imports.
	 *
	 * @since 2.5.0
	 * @see https://eslint.org/docs/latest/rules/no-duplicate-imports
	 */
	"no-duplicate-imports": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				includeExports: boolean;
				/**
				 * @default false
				 */
				allowSeparateTypeImports: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow `else` blocks after `return` statements in `if` statements.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-else-return
	 */
	"no-else-return": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default true
				 */
				allowElseIf: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow empty block statements.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.0.2
	 * @see https://eslint.org/docs/latest/rules/no-empty
	 */
	"no-empty": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				allowEmptyCatch: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow empty character classes in regular expressions.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.22.0
	 * @see https://eslint.org/docs/latest/rules/no-empty-character-class
	 */
	"no-empty-character-class": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow empty functions.
	 *
	 * @since 2.0.0
	 * @see https://eslint.org/docs/latest/rules/no-empty-function
	 */
	"no-empty-function": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default []
				 */
				allow: Array<
					| "functions"
					| "arrowFunctions"
					| "generatorFunctions"
					| "methods"
					| "generatorMethods"
					| "getters"
					| "setters"
					| "constructors"
					| "asyncFunctions"
					| "asyncMethods"
					| "privateConstructors"
					| "protectedConstructors"
					| "decoratedFunctions"
					| "overrideMethods"
				>;
			}>,
		]
	>;

	/**
	 * Rule to disallow empty destructuring patterns.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 1.7.0
	 * @see https://eslint.org/docs/latest/rules/no-empty-pattern
	 */
	"no-empty-pattern": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				allowObjectPatternsAsParameters: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow empty static blocks.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 8.27.0
	 * @see https://eslint.org/docs/latest/rules/no-empty-static-block
	 */
	"no-empty-static-block": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow `null` comparisons without type-checking operators.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-eq-null
	 */
	"no-eq-null": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow the use of `eval()`.
	 *
	 * @since 0.0.2
	 * @see https://eslint.org/docs/latest/rules/no-eval
	 */
	"no-eval": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				allowIndirect: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow reassigning exceptions in `catch` clauses.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-ex-assign
	 */
	"no-ex-assign": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow extending native types.
	 *
	 * @since 0.1.4
	 * @see https://eslint.org/docs/latest/rules/no-extend-native
	 */
	"no-extend-native": Linter.RuleEntry<
		[
			Partial<{
				exceptions: string[];
			}>,
		]
	>;

	/**
	 * Rule to disallow unnecessary calls to `.bind()`.
	 *
	 * @since 0.8.0
	 * @see https://eslint.org/docs/latest/rules/no-extra-bind
	 */
	"no-extra-bind": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow unnecessary boolean casts.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.4.0
	 * @see https://eslint.org/docs/latest/rules/no-extra-boolean-cast
	 */
	"no-extra-boolean-cast": Linter.RuleEntry<
		[
			| Partial<{
					/**
					 * @since 9.3.0
					 * @default false
					 */
					enforceForInnerExpressions: boolean;
					/**
					 * @deprecated
					 */
					enforceForLogicalOperands: never;
			  }>
			| Partial<{
					/**
					 * @deprecated
					 * @since 7.0.0-alpha.2
					 * @default false
					 */
					enforceForLogicalOperands: boolean;
					enforceForInnerExpressions: never;
			  }>,
		]
	>;

	/**
	 * Rule to disallow unnecessary labels.
	 *
	 * @since 2.0.0-rc.0
	 * @see https://eslint.org/docs/latest/rules/no-extra-label
	 */
	"no-extra-label": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow unnecessary parentheses.
	 *
	 * @since 0.1.4
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`no-extra-parens`](https://eslint.style/rules/no-extra-parens) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/no-extra-parens
	 */
	"no-extra-parens":
		| Linter.RuleEntry<
				[
					"all",
					Partial<{
						/**
						 * @default true,
						 */
						conditionalAssign: boolean;
						/**
						 * @default true
						 */
						returnAssign: boolean;
						/**
						 * @default true
						 */
						nestedBinaryExpressions: boolean;
						/**
						 * @default 'none'
						 */
						ignoreJSX:
							"none" | "all" | "multi-line" | "single-line";
						/**
						 * @default true
						 */
						enforceForArrowConditionals: boolean;
					}>,
				]
		  >
		| Linter.RuleEntry<["functions"]>;

	/**
	 * Rule to disallow unnecessary semicolons.
	 *
	 * @since 0.0.9
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`no-extra-semi`](https://eslint.style/rules/no-extra-semi) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/no-extra-semi
	 */
	"no-extra-semi": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow fallthrough of `case` statements.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.0.7
	 * @see https://eslint.org/docs/latest/rules/no-fallthrough
	 */
	"no-fallthrough": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default 'falls?\s?through'
				 */
				commentPattern: string;
				/**
				 * @default false
				 */
				allowEmptyCase: boolean;
				/**
				 * @default false
				 */
				reportUnusedFallthroughComment: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow leading or trailing decimal points in numeric literals.
	 *
	 * @since 0.0.6
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`no-floating-decimal`](https://eslint.style/rules/no-floating-decimal) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/no-floating-decimal
	 */
	"no-floating-decimal": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow reassigning `function` declarations.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-func-assign
	 */
	"no-func-assign": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow assignments to native objects or read-only global variables.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 3.3.0
	 * @see https://eslint.org/docs/latest/rules/no-global-assign
	 */
	"no-global-assign": Linter.RuleEntry<
		[
			Partial<{
				exceptions: string[];
			}>,
		]
	>;

	/**
	 * Rule to disallow shorthand type conversions.
	 *
	 * @since 1.0.0-rc-2
	 * @see https://eslint.org/docs/latest/rules/no-implicit-coercion
	 */
	"no-implicit-coercion": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default true
				 */
				boolean: boolean;
				/**
				 * @default true
				 */
				number: boolean;
				/**
				 * @default true
				 */
				string: boolean;
				/**
				 * @default false
				 */
				disallowTemplateShorthand: boolean;
				/**
				 * @default []
				 */
				allow: Array<"~" | "!!" | "+" | "- -" | "-" | "*">;
			}>,
		]
	>;

	/**
	 * Rule to disallow declarations in the global scope.
	 *
	 * @since 2.0.0-alpha-1
	 * @see https://eslint.org/docs/latest/rules/no-implicit-globals
	 */
	"no-implicit-globals": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				lexicalBindings: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow the use of `eval()`-like methods.
	 *
	 * @since 0.0.7
	 * @see https://eslint.org/docs/latest/rules/no-implied-eval
	 */
	"no-implied-eval": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow assigning to imported bindings.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 6.4.0
	 * @see https://eslint.org/docs/latest/rules/no-import-assign
	 */
	"no-import-assign": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow inline comments after code.
	 *
	 * @since 0.10.0
	 * @see https://eslint.org/docs/latest/rules/no-inline-comments
	 */
	"no-inline-comments": Linter.RuleEntry<
		[
			Partial<{
				ignorePattern: string;
			}>,
		]
	>;

	/**
	 * Rule to disallow variable or `function` declarations in nested blocks.
	 *
	 * @since 0.6.0
	 * @see https://eslint.org/docs/latest/rules/no-inner-declarations
	 * /
	"no-inner-declarations": Linter.RuleEntry<
		[
			"functions" | "both",
			Partial<{
				/**
				 * @default "allow"
				 */
				blockScopedFunctions: "allow" | "disallow";
			}>,
		]
	>;

	/**
	 * Rule to disallow invalid regular expression strings in `RegExp` constructors.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.1.4
	 * @see https://eslint.org/docs/latest/rules/no-invalid-regexp
	 */
	"no-invalid-regexp": Linter.RuleEntry<
		[
			Partial<{
				allowConstructorFlags: string[];
			}>,
		]
	>;

	/**
	 * Rule to disallow use of `this` in contexts where the value of `this` is `undefined`.
	 *
	 * @since 1.0.0-rc-2
	 * @see https://eslint.org/docs/latest/rules/no-invalid-this
	 */
	"no-invalid-this": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default true
				 */
				capIsConstructor: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow irregular whitespace.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.9.0
	 * @see https://eslint.org/docs/latest/rules/no-irregular-whitespace
	 */
	"no-irregular-whitespace": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default true
				 */
				skipStrings: boolean;
				/**
				 * @default false
				 */
				skipComments: boolean;
				/**
				 * @default false
				 */
				skipRegExps: boolean;
				/**
				 * @default false
				 */
				skipTemplates: boolean;
				/**
				 * @default false
				 */
				skipJSXText: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow the use of the `__iterator__` property.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-iterator
	 */
	"no-iterator": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow labels that share a name with a variable.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-label-var
	 */
	"no-label-var": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow labeled statements.
	 *
	 * @since 0.4.0
	 * @see https://eslint.org/docs/latest/rules/no-labels
	 */
	"no-labels": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				allowLoop: boolean;
				/**
				 * @default false
				 */
				allowSwitch: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow unnecessary nested blocks.
	 *
	 * @since 0.4.0
	 * @see https://eslint.org/docs/latest/rules/no-lone-blocks
	 */
	"no-lone-blocks": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow `if` statements as the only statement in `else` blocks.
	 *
	 * @since 0.6.0
	 * @see https://eslint.org/docs/latest/rules/no-lonely-if
	 */
	"no-lonely-if": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow function declarations that contain unsafe references inside loop statements.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-loop-func
	 */
	"no-loop-func": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow literal numbers that lose precision.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 7.1.0
	 * @see https://eslint.org/docs/latest/rules/no-loss-of-precision
	 */
	"no-loss-of-precision": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow magic numbers.
	 *
	 * @since 1.7.0
	 * @see https://eslint.org/docs/latest/rules/no-magic-numbers
	 */
	"no-magic-numbers": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default []
				 */
				ignore: Array<number | string>;
				/**
				 * @default false
				 */
				ignoreArrayIndexes: boolean;
				/**
				 * @default false
				 */
				ignoreDefaultValues: boolean;
				/**
				 * @default false
				 */
				ignoreClassFieldInitialValues: boolean;
				/**
				 * @default false
				 */
				enforceConst: boolean;
				/**
				 * @default false
				 */
				detectObjects: boolean;
				/**
				 * @default false
				 */
				ignoreEnums: boolean;
				/**
				 * @default false
				 */
				ignoreNumericLiteralTypes: boolean;
				/**
				 * @default false
				 */
				ignoreReadonlyClassProperties: boolean;
				/**
				 * @default false
				 */
				ignoreTypeIndexes: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow characters which are made with multiple code points in character class syntax.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 5.3.0
	 * @see https://eslint.org/docs/latest/rules/no-misleading-character-class
	 */
	"no-misleading-character-class": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @since 9.3.0
				 * @default false
				 */
				allowEscape: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow mixed binary operators.
	 *
	 * @since 2.12.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`no-mixed-operators`](https://eslint.style/rules/no-mixed-operators) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/no-mixed-operators
	 */
	"no-mixed-operators": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default
				 * [
				 *     ["+", "-", "*", "/", "%", "**"],
				 *     ["&", "|", "^", "~", "<<", ">>", ">>>"],
				 *     ["==", "!=", "===", "!==", ">", ">=", "<", "<="],
				 *     ["&&", "||"],
				 *     ["in", "instanceof"]
				 * ]
				 */
				groups: string[][];
				/**
				 * @default true
				 */
				allowSamePrecedence: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow `require` calls to be mixed with regular variable declarations.
	 *
	 * @since 0.0.9
	 * @deprecated since 7.0.0.
	 * Node.js rules were moved out of ESLint core.
	 * Please, use [`no-mixed-requires`](https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-mixed-requires.md) in [`eslint-plugin-n`](https://github.com/eslint-community/eslint-plugin-n).
	 * @see https://eslint.org/docs/latest/rules/no-mixed-requires
	 */
	"no-mixed-requires": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				grouping: boolean;
				/**
				 * @default false
				 */
				allowCall: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow mixed spaces and tabs for indentation.
	 *
	 * @since 0.7.1
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`no-mixed-spaces-and-tabs`](https://eslint.style/rules/no-mixed-spaces-and-tabs) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/no-mixed-spaces-and-tabs
	 */
	"no-mixed-spaces-and-tabs": Linter.RuleEntry<["smart-tabs"]>;

	/**
	 * Rule to disallow use of chained assignment expressions.
	 *
	 * @since 3.14.0
	 * @see https://eslint.org/docs/latest/rules/no-multi-assign
	 */
	"no-multi-assign": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				ignoreNonDeclaration: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow multiple spaces.
	 *
	 * @since 0.9.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`no-multi-spaces`](https://eslint.style/rules/no-multi-spaces) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/no-multi-spaces
	 */
	"no-multi-spaces": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				ignoreEOLComments: boolean;
				/**
				 * @default { Property: true }
				 */
				exceptions: Record<string, boolean>;
			}>,
		]
	>;

	/**
	 * Rule to disallow multiline strings.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-multi-str
	 */
	"no-multi-str": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow multiple empty lines.
	 *
	 * @since 0.9.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`no-multiple-empty-lines`](https://eslint.style/rules/no-multiple-empty-lines) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/no-multiple-empty-lines
	 */
	"no-multiple-empty-lines": Linter.RuleEntry<
		[
			| Partial<{
					/**
					 * @default 2
					 */
					max: number;
					maxEOF: number;
					maxBOF: number;
			  }>
			| number,
		]
	>;

	/**
	 * Rule to disallow assignments to native objects or read-only global variables.
	 *
	 * @since 0.0.9
	 * @deprecated since 3.3.0.
	 * Renamed rule.
	 * Please, use [`no-global-assign`](https://eslint.org/docs/rules/no-global-assign).
	 * @see https://eslint.org/docs/latest/rules/no-native-reassign
	 */
	"no-native-reassign": Linter.RuleEntry<
		[
			Partial<{
				exceptions: string[];
			}>,
		]
	>;

	/**
	 * Rule to disallow negated conditions.
	 *
	 * @since 1.6.0
	 * @see https://eslint.org/docs/latest/rules/no-negated-condition
	 */
	"no-negated-condition": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow negating the left operand in `in` expressions.
	 *
	 * @since 0.1.2
	 * @deprecated since 3.3.0.
	 * Renamed rule.
	 * Please, use [`no-unsafe-negation`](https://eslint.org/docs/rules/no-unsafe-negation).
	 * @see https://eslint.org/docs/latest/rules/no-negated-in-lhs
	 */
	"no-negated-in-lhs": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow nested ternary expressions.
	 *
	 * @since 0.2.0
	 * @see https://eslint.org/docs/latest/rules/no-nested-ternary
	 */
	"no-nested-ternary": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow `new` operators outside of assignments or comparisons.
	 *
	 * @since 0.0.7
	 * @see https://eslint.org/docs/latest/rules/no-new
	 */
	"no-new": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow `new` operators with the `Function` object.
	 *
	 * @since 0.0.7
	 * @see https://eslint.org/docs/latest/rules/no-new-func
	 */
	"no-new-func": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow `new` operators with global non-constructor functions.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 8.27.0
	 * @see https://eslint.org/docs/latest/rules/no-new-native-nonconstructor
	 */
	"no-new-native-nonconstructor": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow `Object` constructors.
	 *
	 * @since 0.0.9
	 * @deprecated since 8.50.0.
	 * The new rule flags more situations where object literal syntax can be used, and it does not report a problem when the `Object` constructor is invoked with an argument.
	 * Please, use [`no-object-constructor`](https://eslint.org/docs/rules/no-object-constructor).
	 * @see https://eslint.org/docs/latest/rules/no-new-object
	 */
	"no-new-object": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow `new` operators with calls to `require`.
	 *
	 * @since 0.6.0
	 * @deprecated since 7.0.0.
	 * Node.js rules were moved out of ESLint core.
	 * Please, use [`no-new-require`](https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-new-require.md) in [`eslint-plugin-n`](https://github.com/eslint-community/eslint-plugin-n).
	 * @see https://eslint.org/docs/latest/rules/no-new-require
	 */
	"no-new-require": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow `new` operators with the `Symbol` object.
	 *
	 * @since 2.0.0-beta.1
	 * @deprecated since 9.0.0.
	 * The rule was replaced with a more general rule.
	 * Please, use [`no-new-native-nonconstructor`](https://eslint.org/docs/latest/rules/no-new-native-nonconstructor).
	 * @see https://eslint.org/docs/latest/rules/no-new-symbol
	 */
	"no-new-symbol": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow `new` operators with the `String`, `Number`, and `Boolean` objects.
	 *
	 * @since 0.0.6
	 * @see https://eslint.org/docs/latest/rules/no-new-wrappers
	 */
	"no-new-wrappers": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow `\8` and `\9` escape sequences in string literals.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 7.14.0
	 * @see https://eslint.org/docs/latest/rules/no-nonoctal-decimal-escape
	 */
	"no-nonoctal-decimal-escape": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow calling global object properties as functions.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-obj-calls
	 */
	"no-obj-calls": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow calls to the `Object` constructor without an argument.
	 *
	 * @since 8.50.0
	 * @see https://eslint.org/docs/latest/rules/no-object-constructor
	 */
	"no-object-constructor": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow octal literals.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.0.6
	 * @see https://eslint.org/docs/latest/rules/no-octal
	 */
	"no-octal": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow octal escape sequences in string literals.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-octal-escape
	 */
	"no-octal-escape": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow reassigning function parameters.
	 *
	 * @since 0.18.0
	 * @see https://eslint.org/docs/latest/rules/no-param-reassign
	 */
	"no-param-reassign": Linter.RuleEntry<
		[
			| {
					props?: false;
			  }
			| ({
					props: true;
			  } & Partial<{
					/**
					 * @default []
					 */
					ignorePropertyModificationsFor: string[];
					/**
					 * @since 6.6.0
					 * @default []
					 */
					ignorePropertyModificationsForRegex: string[];
			  }>),
		]
	>;

	/**
	 * Rule to disallow string concatenation with `__dirname` and `__filename`.
	 *
	 * @since 0.4.0
	 * @deprecated since 7.0.0.
	 * Node.js rules were moved out of ESLint core.
	 * Please, use [`no-path-concat`](https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-path-concat.md) in [`eslint-plugin-n`](https://github.com/eslint-community/eslint-plugin-n).
	 * @see https://eslint.org/docs/latest/rules/no-path-concat
	 */
	"no-path-concat": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow the unary operators `++` and `--`.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-plusplus
	 */
	"no-plusplus": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				allowForLoopAfterthoughts: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow the use of `process.env`.
	 *
	 * @since 0.9.0
	 * @deprecated since 7.0.0.
	 * Node.js rules were moved out of ESLint core.
	 * Please, use [`no-process-env`](https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-process-env.md) in [`eslint-plugin-n`](https://github.com/eslint-community/eslint-plugin-n).
	 * @see https://eslint.org/docs/latest/rules/no-process-env
	 */
	"no-process-env": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow the use of `process.exit()`.
	 *
	 * @since 0.4.0
	 * @deprecated since 7.0.0.
	 * Node.js rules were moved out of ESLint core.
	 * Please, use [`no-process-exit`](https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-process-exit.md) in [`eslint-plugin-n`](https://github.com/eslint-community/eslint-plugin-n).
	 * @see https://eslint.org/docs/latest/rules/no-process-exit
	 */
	"no-process-exit": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow returning values from Promise executor functions.
	 *
	 * @since 7.3.0
	 * @see https://eslint.org/docs/latest/rules/no-promise-executor-return
	 */
	"no-promise-executor-return": Linter.RuleEntry<
		[
			{
				/**
				 * @default false
				 */
				allowVoid?: boolean;
			},
		]
	>;

	/**
	 * Rule to disallow the use of the `__proto__` property.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-proto
	 */
	"no-proto": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow calling some `Object.prototype` methods directly on objects.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 2.11.0
	 * @see https://eslint.org/docs/latest/rules/no-prototype-builtins
	 */
	"no-prototype-builtins": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow variable redeclaration.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-redeclare
	 */
	"no-redeclare": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default true
				 */
				builtinGlobals: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow multiple spaces in regular expressions.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.4.0
	 * @see https://eslint.org/docs/latest/rules/no-regex-spaces
	 */
	"no-regex-spaces": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow specified names in exports.
	 *
	 * @since 7.0.0-alpha.0
	 * @see https://eslint.org/docs/latest/rules/no-restricted-exports
	 */
	"no-restricted-exports": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default []
				 */
				restrictedNamedExports: string[];
				/**
				 * @since 9.3.0
				 */
				restrictedNamedExportsPattern: string;
				/**
				 * @since 8.33.0
				 */
				restrictDefaultExports: Partial<{
					/**
					 * @default false
					 */
					direct: boolean;
					/**
					 * @default false
					 */
					named: boolean;
					/**
					 * @default false
					 */
					defaultFrom: boolean;
					/**
					 * @default false
					 */
					namedFrom: boolean;
					/**
					 * @default false
					 */
					namespaceFrom: boolean;
				}>;
			}>,
		]
	>;

	/**
	 * Rule to disallow specified global variables.
	 *
	 * @since 2.3.0
	 * @see https://eslint.org/docs/latest/rules/no-restricted-globals
	 */
	"no-restricted-globals": Linter.RuleEntry<
		[
			...(
				| Array<
						| string
						| {
								name: string;
								message?: string | undefined;
						  }
				  >
				| Array<{
						globals: Array<
							| string
							| {
									name: string;
									message?: string | undefined;
							  }
						>;
						checkGlobalObject?: boolean;
						globalObjects?: string[];
				  }>
			),
		]
	>;

	/**
	 * Rule to disallow specified modules when loaded by `import`.
	 *
	 * @since 2.0.0-alpha-1
	 * @see https://eslint.org/docs/latest/rules/no-restricted-imports
	 */
	"no-restricted-imports": Linter.RuleEntry<
		[
			...Array<
				| string
				| ValidNoRestrictedImportPathOptions
				| Partial<{
						paths: Array<
							string | ValidNoRestrictedImportPathOptions
						>;
						patterns:
							| Array<string>
							| Array<ValidNoRestrictedImportPatternOptions>;
				  }>
			>,
		]
	>;

	/**
	 * Rule to disallow specified modules when loaded by `require`.
	 *
	 * @since 0.6.0
	 * @deprecated since 7.0.0.
	 * Node.js rules were moved out of ESLint core.
	 * Please, use [`no-restricted-require`](https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-restricted-require.md) in [`eslint-plugin-n`](https://github.com/eslint-community/eslint-plugin-n).
	 * @see https://eslint.org/docs/latest/rules/no-restricted-modules
	 */
	"no-restricted-modules": Linter.RuleEntry<
		[
			...Array<
				| string
				| {
						name: string;
						message?: string | undefined;
				  }
				| Partial<{
						paths: Array<
							| string
							| {
									name: string;
									message?: string | undefined;
							  }
						>;
						patterns: string[];
				  }>
			>,
		]
	>;

	/**
	 * Rule to disallow certain properties on certain objects.
	 *
	 * @since 3.5.0
	 * @see https://eslint.org/docs/latest/rules/no-restricted-properties
	 */
	"no-restricted-properties": Linter.RuleEntry<
		[
			...Array<
				| {
						object: string;
						property?: string | undefined;
						message?: string | undefined;
				  }
				| {
						property: string;
						allowObjects?: string[];
						message?: string | undefined;
				  }
				| {
						object: string;
						allowProperties?: string[];
						message?: string | undefined;
				  }
			>,
		]
	>;

	/**
	 * Rule to disallow specified syntax.
	 *
	 * @since 1.4.0
	 * @see https://eslint.org/docs/latest/rules/no-restricted-syntax
	 */
	"no-restricted-syntax": Linter.RuleEntry<
		[
			...Array<
				| string
				| {
						selector: string;
						message?: string | undefined;
				  }
			>,
		]
	>;

	/**
	 * Rule to disallow assignment operators in `return` statements.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-return-assign
	 */
	"no-return-assign": Linter.RuleEntry<["except-parens" | "always"]>;

	/**
	 * Rule to disallow unnecessary `return await`.
	 *
	 * @since 3.10.0
	 * @deprecated since 8.46.0.
	 * The original assumption of the rule no longer holds true because of engine optimization.
	 * @see https://eslint.org/docs/latest/rules/no-return-await
	 */
	"no-return-await": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow `javascript:` URLs.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-script-url
	 */
	"no-script-url": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow assignments where both sides are exactly the same.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 2.0.0-rc.0
	 * @see https://eslint.org/docs/latest/rules/no-self-assign
	 */
	"no-self-assign": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default true
				 */
				props: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow comparisons where both sides are exactly the same.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-self-compare
	 */
	"no-self-compare": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow comma operators.
	 *
	 * @since 0.5.1
	 * @see https://eslint.org/docs/latest/rules/no-sequences
	 */
	"no-sequences": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @since 7.23.0
				 * @default true
				 */
				allowInParentheses: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow returning values from setters.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 6.7.0
	 * @see https://eslint.org/docs/latest/rules/no-setter-return
	 */
	"no-setter-return": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow variable declarations from shadowing variables declared in the outer scope.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-shadow
	 */
	"no-shadow": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				builtinGlobals: boolean;
				/**
				 * @default 'functions'
				 */
				hoist:
					| "functions"
					| "all"
					| "never"
					| "types"
					| "functions-and-types";
				allow: string[];
				/**
				 * @since 8.10.0
				 * @default false
				 */
				ignoreOnInitialization: boolean;
				/**
				 * @default true
				 */
				ignoreTypeValueShadow: boolean;
				/**
				 * @default true
				 */
				ignoreFunctionTypeParameterNameValueShadow: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow identifiers from shadowing restricted names.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.1.4
	 * @see https://eslint.org/docs/latest/rules/no-shadow-restricted-names
	 */
	"no-shadow-restricted-names": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default true
				 */
				reportGlobalThis: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow spacing between function identifiers and their applications (deprecated).
	 *
	 * @since 0.1.2
	 * @deprecated since 3.3.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`function-call-spacing`](https://eslint.style/rules/function-call-spacing) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/no-spaced-func
	 */
	"no-spaced-func": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow sparse arrays.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.4.0
	 * @see https://eslint.org/docs/latest/rules/no-sparse-arrays
	 */
	"no-sparse-arrays": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow synchronous methods.
	 *
	 * @since 0.0.9
	 * @deprecated since 7.0.0.
	 * Node.js rules were moved out of ESLint core.
	 * Please, use [`no-sync`](https://github.com/eslint-community/eslint-plugin-n/tree/master/docs/rules/no-sync.md) in [`eslint-plugin-n`](https://github.com/eslint-community/eslint-plugin-n).
	 * @see https://eslint.org/docs/latest/rules/no-sync
	 */
	"no-sync": Linter.RuleEntry<
		[
			{
				/**
				 * @default false
				 */
				allowAtRootLevel: boolean;
			},
		]
	>;

	/**
	 * Rule to disallow all tabs.
	 *
	 * @since 3.2.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`no-tabs`](https://eslint.style/rules/no-tabs) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/no-tabs
	 */
	"no-tabs": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				allowIndentationTabs: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow template literal placeholder syntax in regular strings.
	 *
	 * @since 3.3.0
	 * @see https://eslint.org/docs/latest/rules/no-template-curly-in-string
	 */
	"no-template-curly-in-string": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow ternary operators.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-ternary
	 */
	"no-ternary": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow `this`/`super` before calling `super()` in constructors.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.24.0
	 * @see https://eslint.org/docs/latest/rules/no-this-before-super
	 */
	"no-this-before-super": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow throwing literals as exceptions.
	 *
	 * @since 0.15.0
	 * @see https://eslint.org/docs/latest/rules/no-throw-literal
	 */
	"no-throw-literal": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow trailing whitespace at the end of lines.
	 *
	 * @since 0.7.1
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`no-trailing-spaces`](https://eslint.style/rules/no-trailing-spaces) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/no-trailing-spaces
	 */
	"no-trailing-spaces": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				skipBlankLines: boolean;
				/**
				 * @default false
				 */
				ignoreComments: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow `let` or `var` variables that are read but never assigned.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 9.27.0
	 * @see https://eslint.org/docs/latest/rules/no-unassigned-vars
	 */
	"no-unassigned-vars": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow the use of undeclared variables unless mentioned in \/*global *\/ comments.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-undef
	 */
	"no-undef": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				typeof: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow initializing variables to `undefined`.
	 *
	 * @since 0.0.6
	 * @see https://eslint.org/docs/latest/rules/no-undef-init
	 */
	"no-undef-init": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow the use of `undefined` as an identifier.
	 *
	 * @since 0.7.1
	 * @see https://eslint.org/docs/latest/rules/no-undefined
	 */
	"no-undefined": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow dangling underscores in identifiers.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-underscore-dangle
	 */
	"no-underscore-dangle": Linter.RuleEntry<
		[
			Partial<{
				allow: string[];
				/**
				 * @default false
				 */
				allowAfterThis: boolean;
				/**
				 * @default false
				 */
				allowAfterSuper: boolean;
				/**
				 * @since 6.7.0
				 * @default false
				 */
				allowAfterThisConstructor: boolean;
				/**
				 * @default false
				 */
				enforceInMethodNames: boolean;
				/**
				 * @since 8.15.0
				 * @default false
				 */
				enforceInClassFields: boolean;
				/**
				 * @since 8.31.0
				 * @default true
				 */
				allowInArrayDestructuring: boolean;
				/**
				 * @since 8.31.0
				 * @default true
				 */
				allowInObjectDestructuring: boolean;
				/**
				 * @since 7.7.0
				 * @default true
				 */
				allowFunctionParams: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow confusing multiline expressions.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.24.0
	 * @see https://eslint.org/docs/latest/rules/no-unexpected-multiline
	 */
	"no-unexpected-multiline": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow unmodified loop conditions.
	 *
	 * @since 2.0.0-alpha-2
	 * @see https://eslint.org/docs/latest/rules/no-unmodified-loop-condition
	 */
	"no-unmodified-loop-condition": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow ternary operators when simpler alternatives exist.
	 *
	 * @since 0.21.0
	 * @see https://eslint.org/docs/latest/rules/no-unneeded-ternary
	 */
	"no-unneeded-ternary": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default true
				 */
				defaultAssignment: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow unreachable code after `return`, `throw`, `continue`, and `break` statements.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.0.6
	 * @see https://eslint.org/docs/latest/rules/no-unreachable
	 */
	"no-unreachable": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow loops with a body that allows only one iteration.
	 *
	 * @since 7.3.0
	 * @see https://eslint.org/docs/latest/rules/no-unreachable-loop
	 */
	"no-unreachable-loop": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default []
				 */
				ignore: Array<
					| "WhileStatement"
					| "DoWhileStatement"
					| "ForStatement"
					| "ForInStatement"
					| "ForOfStatement"
				>;
			}>,
		]
	>;

	/**
	 * Rule to disallow control flow statements in `finally` blocks.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 2.9.0
	 * @see https://eslint.org/docs/latest/rules/no-unsafe-finally
	 */
	"no-unsafe-finally": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow negating the left operand of relational operators.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 3.3.0
	 * @see https://eslint.org/docs/latest/rules/no-unsafe-negation
	 */
	"no-unsafe-negation": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @since 6.6.0
				 * @default false
				 */
				enforceForOrderingRelations: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow use of optional chaining in contexts where the `undefined` value is not allowed.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 7.15.0
	 * @see https://eslint.org/docs/latest/rules/no-unsafe-optional-chaining
	 */
	"no-unsafe-optional-chaining": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				disallowArithmeticOperators: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow unused expressions.
	 *
	 * @since 0.1.0
	 * @see https://eslint.org/docs/latest/rules/no-unused-expressions
	 */
	"no-unused-expressions": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				allowShortCircuit: boolean;
				/**
				 * @default false
				 */
				allowTernary: boolean;
				/**
				 * @default false
				 */
				allowTaggedTemplates: boolean;
				/**
				 * @since 7.20.0
				 * @default false
				 */
				enforceForJSX: boolean;
				/**
				 * @default false
				 */
				ignoreDirectives: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow unused labels.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 2.0.0-rc.0
	 * @see https://eslint.org/docs/latest/rules/no-unused-labels
	 */
	"no-unused-labels": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow unused private class members.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 8.1.0
	 * @see https://eslint.org/docs/latest/rules/no-unused-private-class-members
	 */
	"no-unused-private-class-members": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow unused variables.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-unused-vars
	 */
	"no-unused-vars": Linter.RuleEntry<
		[
			| "all"
			| "local"
			| Partial<{
					/**
					 * @default 'all'
					 */
					vars: "all" | "local";
					varsIgnorePattern: string;
					/**
					 * @default 'after-used'
					 */
					args: "after-used" | "all" | "none";
					/**
					 * @default false
					 */
					ignoreRestSiblings: boolean;
					argsIgnorePattern: string;
					/**
					 * @default 'all'
					 */
					caughtErrors: "none" | "all";
					caughtErrorsIgnorePattern: string;
					destructuredArrayIgnorePattern: string;
					/**
					 * @default false
					 */
					ignoreClassWithStaticInitBlock: boolean;
					/**
					 * @default false
					 */
					ignoreUsingDeclarations: boolean;
					/**
					 * @default false
					 */
					reportUsedIgnorePattern: boolean;
			  }>,
		]
	>;

	/**
	 * Rule to disallow the use of variables before they are defined.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/no-use-before-define
	 */
	"no-use-before-define": Linter.RuleEntry<
		[
			| Partial<{
					/**
					 * @default true
					 */
					functions: boolean;
					/**
					 * @default true
					 */
					classes: boolean;
					/**
					 * @default true
					 */
					variables: boolean;
					/**
					 * @default false
					 */
					allowNamedExports: boolean;
					/**
					 * @default true
					 */
					enums: boolean;
					/**
					 * @default true
					 */
					typedefs: boolean;
					/**
					 * @default true
					 */
					ignoreTypeReferences: boolean;
			  }>
			| "nofunc",
		]
	>;

	/**
	 * Rule to disallow variable assignments when the value is not used.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 9.0.0-alpha.1
	 * @see https://eslint.org/docs/latest/rules/no-useless-assignment
	 */
	"no-useless-assignment": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow useless backreferences in regular expressions.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 7.0.0-alpha.0
	 * @see https://eslint.org/docs/latest/rules/no-useless-backreference
	 */
	"no-useless-backreference": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow unnecessary calls to `.call()` and `.apply()`.
	 *
	 * @since 1.0.0-rc-1
	 * @see https://eslint.org/docs/latest/rules/no-useless-call
	 */
	"no-useless-call": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow unnecessary `catch` clauses.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 5.11.0
	 * @see https://eslint.org/docs/latest/rules/no-useless-catch
	 */
	"no-useless-catch": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow unnecessary computed property keys in objects and classes.
	 *
	 * @since 2.9.0
	 * @see https://eslint.org/docs/latest/rules/no-useless-computed-key
	 */
	"no-useless-computed-key": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default true
				 */
				enforceForClassMembers: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow unnecessary concatenation of literals or template literals.
	 *
	 * @since 1.3.0
	 * @see https://eslint.org/docs/latest/rules/no-useless-concat
	 */
	"no-useless-concat": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow unnecessary constructors.
	 *
	 * @since 2.0.0-beta.1
	 * @see https://eslint.org/docs/latest/rules/no-useless-constructor
	 */
	"no-useless-constructor": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow unnecessary escape characters.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 2.5.0
	 * @see https://eslint.org/docs/latest/rules/no-useless-escape
	 */
	"no-useless-escape": Linter.RuleEntry<
		[
			Partial<{
				allowRegexCharacters: string[];
			}>,
		]
	>;

	/**
	 * Rule to disallow renaming import, export, and destructured assignments to the same name.
	 *
	 * @since 2.11.0
	 * @see https://eslint.org/docs/latest/rules/no-useless-rename
	 */
	"no-useless-rename": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				ignoreImport: boolean;
				/**
				 * @default false
				 */
				ignoreExport: boolean;
				/**
				 * @default false
				 */
				ignoreDestructuring: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow redundant return statements.
	 *
	 * @since 3.9.0
	 * @see https://eslint.org/docs/latest/rules/no-useless-return
	 */
	"no-useless-return": Linter.RuleEntry<[]>;

	/**
	 * Rule to require `let` or `const` instead of `var`.
	 *
	 * @since 0.12.0
	 * @see https://eslint.org/docs/latest/rules/no-var
	 */
	"no-var": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow `void` operators.
	 *
	 * @since 0.8.0
	 * @see https://eslint.org/docs/latest/rules/no-void
	 */
	"no-void": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				allowAsStatement: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow specified warning terms in comments.
	 *
	 * @since 0.4.4
	 * @see https://eslint.org/docs/latest/rules/no-warning-comments
	 */
	"no-warning-comments": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default ["todo", "fixme", "xxx"]
				 */
				terms: string[];
				/**
				 * @default 'start'
				 */
				location: "start" | "anywhere";
				decoration: string[];
			}>,
		]
	>;

	/**
	 * Rule to disallow whitespace before properties.
	 *
	 * @since 2.0.0-beta.1
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`no-whitespace-before-property`](https://eslint.style/rules/no-whitespace-before-property) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/no-whitespace-before-property
	 */
	"no-whitespace-before-property": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow `with` statements.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.0.2
	 * @see https://eslint.org/docs/latest/rules/no-with
	 */
	"no-with": Linter.RuleEntry<[]>;

	/**
	 * Rule to enforce the location of single-line statements.
	 *
	 * @since 3.17.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`nonblock-statement-body-position`](https://eslint.style/rules/nonblock-statement-body-position) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/nonblock-statement-body-position
	 */
	"nonblock-statement-body-position": Linter.RuleEntry<
		[
			"beside" | "below" | "any",
			Partial<{
				overrides: Record<string, "beside" | "below" | "any">;
			}>,
		]
	>;

	/**
	 * Rule to enforce consistent line breaks after opening and before closing braces.
	 *
	 * @since 2.12.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`object-curly-newline`](https://eslint.style/rules/object-curly-newline) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/object-curly-newline
	 */
	"object-curly-newline": Linter.RuleEntry<
		[
			| "always"
			| "never"
			| Partial<{
					/**
					 * @default false
					 */
					multiline: boolean;
					minProperties: number;
					/**
					 * @default true
					 */
					consistent: boolean;
			  }>
			| Partial<
					Record<
						| "ObjectExpression"
						| "ObjectPattern"
						| "ImportDeclaration"
						| "ExportDeclaration",
						| "always"
						| "never"
						| Partial<{
								/**
								 * @default false
								 */
								multiline: boolean;
								minProperties: number;
								/**
								 * @default true
								 */
								consistent: boolean;
						  }>
					>
			  >,
		]
	>;

	/**
	 * Rule to enforce consistent spacing inside braces.
	 *
	 * @since 0.22.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`object-curly-spacing`](https://eslint.style/rules/object-curly-spacing) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/object-curly-spacing
	 */
	"object-curly-spacing":
		| Linter.RuleEntry<
				[
					"never",
					{
						/**
						 * @default false
						 */
						arraysInObjects: boolean;
						/**
						 * @default false
						 */
						objectsInObjects: boolean;
					},
				]
		  >
		| Linter.RuleEntry<
				[
					"always",
					{
						/**
						 * @default true
						 */
						arraysInObjects: boolean;
						/**
						 * @default true
						 */
						objectsInObjects: boolean;
					},
				]
		  >;

	/**
	 * Rule to enforce placing object properties on separate lines.
	 *
	 * @since 2.10.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`object-property-newline`](https://eslint.style/rules/object-property-newline) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/object-property-newline
	 */
	"object-property-newline": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				allowAllPropertiesOnSameLine: boolean;
			}>,
		]
	>;

	/**
	 * Rule to require or disallow method and property shorthand syntax for object literals.
	 *
	 * @since 0.20.0
	 * @see https://eslint.org/docs/latest/rules/object-shorthand
	 */
	"object-shorthand":
		| Linter.RuleEntry<
				[
					"always" | "methods",
					Partial<{
						/**
						 * @default false
						 */
						avoidQuotes: boolean;
						/**
						 * @default false
						 */
						ignoreConstructors: boolean;
						/**
						 * @since 8.22.0
						 */
						methodsIgnorePattern: string;
						/**
						 * @default false
						 */
						avoidExplicitReturnArrows: boolean;
					}>,
				]
		  >
		| Linter.RuleEntry<
				[
					"properties",
					Partial<{
						/**
						 * @default false
						 */
						avoidQuotes: boolean;
					}>,
				]
		  >
		| Linter.RuleEntry<["never" | "consistent" | "consistent-as-needed"]>;

	/**
	 * Rule to enforce variables to be declared either together or separately in functions.
	 *
	 * @since 0.0.9
	 * @see https://eslint.org/docs/latest/rules/one-var
	 */
	"one-var": Linter.RuleEntry<
		[
			| "always"
			| "never"
			| "consecutive"
			| Partial<
					{
						/**
						 * @default false
						 */
						separateRequires: boolean;
					} & Record<
						"var" | "let" | "const" | "using" | "awaitUsing",
						"always" | "never" | "consecutive"
					>
			  >
			| Partial<
					Record<
						"initialized" | "uninitialized",
						"always" | "never" | "consecutive"
					>
			  >,
		]
	>;

	/**
	 * Rule to require or disallow newlines around variable declarations.
	 *
	 * @since 2.0.0-beta.3
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`one-var-declaration-per-line`](https://eslint.style/rules/one-var-declaration-per-line) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/one-var-declaration-per-line
	 */
	"one-var-declaration-per-line": Linter.RuleEntry<
		["initializations" | "always"]
	>;

	/**
	 * Rule to require or disallow assignment operator shorthand where possible.
	 *
	 * @since 0.10.0
	 * @see https://eslint.org/docs/latest/rules/operator-assignment
	 */
	"operator-assignment": Linter.RuleEntry<["always" | "never"]>;

	/**
	 * Rule to enforce consistent linebreak style for operators.
	 *
	 * @since 0.19.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`operator-linebreak`](https://eslint.style/rules/operator-linebreak) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/operator-linebreak
	 */
	"operator-linebreak": Linter.RuleEntry<
		[
			"after" | "before" | "none",
			Partial<{
				overrides: Record<string, "after" | "before" | "none">;
			}>,
		]
	>;

	/**
	 * Rule to require or disallow padding within blocks.
	 *
	 * @since 0.9.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`padded-blocks`](https://eslint.style/rules/padded-blocks) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/padded-blocks
	 */
	"padded-blocks": Linter.RuleEntry<
		[
			(
				| "always"
				| "never"
				| Partial<
						Record<
							"blocks" | "classes" | "switches",
							"always" | "never"
						>
				  >
			),
			{
				/**
				 * @default false
				 */
				allowSingleLineBlocks: boolean;
			},
		]
	>;

	/**
	 * Rule to require or disallow padding lines between statements.
	 *
	 * @since 4.0.0-beta.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`padding-line-between-statements`](https://eslint.style/rules/padding-line-between-statements) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/padding-line-between-statements
	 */
	"padding-line-between-statements": Linter.RuleEntry<
		[
			...Array<
				{
					blankLine: "any" | "never" | "always";
				} & Record<"prev" | "next", string | string[]>
			>,
		]
	>;

	/**
	 * Rule to require using arrow functions for callbacks.
	 *
	 * @since 1.2.0
	 * @see https://eslint.org/docs/latest/rules/prefer-arrow-callback
	 */
	"prefer-arrow-callback": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				allowNamedFunctions: boolean;
				/**
				 * @default true
				 */
				allowUnboundThis: boolean;
			}>,
		]
	>;

	/**
	 * Rule to require `const` declarations for variables that are never reassigned after declared.
	 *
	 * @since 0.23.0
	 * @see https://eslint.org/docs/latest/rules/prefer-const
	 */
	"prefer-const": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default 'any'
				 */
				destructuring: "any" | "all";
				/**
				 * @default false
				 */
				ignoreReadBeforeAssign: boolean;
			}>,
		]
	>;

	/**
	 * Rule to require destructuring from arrays and/or objects.
	 *
	 * @since 3.13.0
	 * @see https://eslint.org/docs/latest/rules/prefer-destructuring
	 */
	"prefer-destructuring": Linter.RuleEntry<
		[
			Partial<
				| {
						VariableDeclarator: Partial<{
							array: boolean;
							object: boolean;
						}>;
						AssignmentExpression: Partial<{
							array: boolean;
							object: boolean;
						}>;
				  }
				| {
						array: boolean;
						object: boolean;
				  }
			>,
			Partial<{
				enforceForRenamedProperties: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow the use of `Math.pow` in favor of the `**` operator.
	 *
	 * @since 6.7.0
	 * @see https://eslint.org/docs/latest/rules/prefer-exponentiation-operator
	 */
	"prefer-exponentiation-operator": Linter.RuleEntry<[]>;

	/**
	 * Rule to enforce using named capture group in regular expression.
	 *
	 * @since 5.15.0
	 * @see https://eslint.org/docs/latest/rules/prefer-named-capture-group
	 */
	"prefer-named-capture-group": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals.
	 *
	 * @since 3.5.0
	 * @see https://eslint.org/docs/latest/rules/prefer-numeric-literals
	 */
	"prefer-numeric-literals": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow use of `Object.prototype.hasOwnProperty.call()` and prefer use of `Object.hasOwn()`.
	 *
	 * @since 8.5.0
	 * @see https://eslint.org/docs/latest/rules/prefer-object-has-own
	 */
	"prefer-object-has-own": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow using `Object.assign` with an object literal as the first argument and prefer the use of object spread instead.
	 *
	 * @since 5.0.0-alpha.3
	 * @see https://eslint.org/docs/latest/rules/prefer-object-spread
	 */
	"prefer-object-spread": Linter.RuleEntry<[]>;

	/**
	 * Rule to require using Error objects as Promise rejection reasons.
	 *
	 * @since 3.14.0
	 * @see https://eslint.org/docs/latest/rules/prefer-promise-reject-errors
	 */
	"prefer-promise-reject-errors": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				allowEmptyReject: boolean;
			}>,
		]
	>;

	/**
	 * Rule to require `Reflect` methods where applicable.
	 *
	 * @since 1.0.0-rc-2
	 * @deprecated since 3.9.0.
	 * The original intention of this rule was misguided.
	 * @see https://eslint.org/docs/latest/rules/prefer-reflect
	 */
	"prefer-reflect": Linter.RuleEntry<
		[
			Partial<{
				exceptions: string[];
			}>,
		]
	>;

	/**
	 * Rule to disallow use of the `RegExp` constructor in favor of regular expression literals.
	 *
	 * @since 6.4.0
	 * @see https://eslint.org/docs/latest/rules/prefer-regex-literals
	 */
	"prefer-regex-literals": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				disallowRedundantWrapping: boolean;
			}>,
		]
	>;

	/**
	 * Rule to require rest parameters instead of `arguments`.
	 *
	 * @since 2.0.0-alpha-1
	 * @see https://eslint.org/docs/latest/rules/prefer-rest-params
	 */
	"prefer-rest-params": Linter.RuleEntry<[]>;

	/**
	 * Rule to require spread operators instead of `.apply()`.
	 *
	 * @since 1.0.0-rc-1
	 * @see https://eslint.org/docs/latest/rules/prefer-spread
	 */
	"prefer-spread": Linter.RuleEntry<[]>;

	/**
	 * Rule to require template literals instead of string concatenation.
	 *
	 * @since 1.2.0
	 * @see https://eslint.org/docs/latest/rules/prefer-template
	 */
	"prefer-template": Linter.RuleEntry<[]>;

	/**
	 * Rule to disallow losing originally caught error when re-throwing custom errors.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 9.35.0
	 * @see https://eslint.org/docs/latest/rules/preserve-caught-error
	 */
	"preserve-caught-error": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				requireCatchParameter: boolean;
				/**
				 * @default []
				 */
				errorClassNames: Array<
					| string
					| {
							name: string;
							argumentPosition: number;
					  }
				>;
			}>,
		]
	>;

	/**
	 * Rule to require quotes around object literal property names.
	 *
	 * @since 0.0.6
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`quote-props`](https://eslint.style/rules/quote-props) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/quote-props
	 */
	"quote-props":
		| Linter.RuleEntry<["always" | "consistent"]>
		| Linter.RuleEntry<
				[
					"as-needed",
					Partial<{
						/**
						 * @default false
						 */
						keywords: boolean;
						/**
						 * @default true
						 */
						unnecessary: boolean;
						/**
						 * @default false
						 */
						numbers: boolean;
					}>,
				]
		  >
		| Linter.RuleEntry<
				[
					"consistent-as-needed",
					Partial<{
						/**
						 * @default false
						 */
						keywords: boolean;
					}>,
				]
		  >;

	/**
	 * Rule to enforce the consistent use of either backticks, double, or single quotes.
	 *
	 * @since 0.0.7
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`quotes`](https://eslint.style/rules/quotes) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/quotes
	 */
	quotes: Linter.RuleEntry<
		[
			"double" | "single" | "backtick",
			Partial<{
				/**
				 * @default false
				 */
				avoidEscape: boolean;
				/**
				 * @default false
				 */
				allowTemplateLiterals: boolean;
			}>,
		]
	>;

	/**
	 * Rule to enforce the use of the radix argument when using `parseInt()`.
	 *
	 * @since 0.0.7
	 * @see https://eslint.org/docs/latest/rules/radix
	 */
	radix: Linter.RuleEntry<["always" | "as-needed"]>;

	/**
	 * Rule to disallow assignments that can lead to race conditions due to usage of `await` or `yield`.
	 *
	 * @since 5.3.0
	 * @see https://eslint.org/docs/latest/rules/require-atomic-updates
	 */
	"require-atomic-updates": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @since 8.3.0
				 * @default false
				 */
				allowProperties: boolean;
			}>,
		]
	>;

	/**
	 * Rule to disallow async functions which have no `await` expression.
	 *
	 * @since 3.11.0
	 * @see https://eslint.org/docs/latest/rules/require-await
	 */
	"require-await": Linter.RuleEntry<[]>;

	/**
	 * Rule to enforce the use of `u` or `v` flag on regular expressions.
	 *
	 * @since 5.3.0
	 * @see https://eslint.org/docs/latest/rules/require-unicode-regexp
	 */
	"require-unicode-regexp": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				requireFlag: "u" | "v";
			}>,
		]
	>;

	/**
	 * Rule to require generator functions to contain `yield`.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 1.0.0-rc-1
	 * @see https://eslint.org/docs/latest/rules/require-yield
	 */
	"require-yield": Linter.RuleEntry<[]>;

	/**
	 * Rule to enforce spacing between rest and spread operators and their expressions.
	 *
	 * @since 2.12.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`rest-spread-spacing`](https://eslint.style/rules/rest-spread-spacing) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/rest-spread-spacing
	 */
	"rest-spread-spacing": Linter.RuleEntry<["never" | "always"]>;

	/**
	 * Rule to require or disallow semicolons instead of ASI.
	 *
	 * @since 0.0.6
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`semi`](https://eslint.style/rules/semi) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/semi
	 */
	semi:
		| Linter.RuleEntry<
				[
					"always",
					Partial<{
						/**
						 * @default false
						 */
						omitLastInOneLineBlock: boolean;
					}>,
				]
		  >
		| Linter.RuleEntry<
				[
					"never",
					Partial<{
						/**
						 * @default 'any'
						 */
						beforeStatementContinuationChars:
							"any" | "always" | "never";
					}>,
				]
		  >;

	/**
	 * Rule to enforce consistent spacing before and after semicolons.
	 *
	 * @since 0.16.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`semi-spacing`](https://eslint.style/rules/semi-spacing) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/semi-spacing
	 */
	"semi-spacing": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				before: boolean;
				/**
				 * @default true
				 */
				after: boolean;
			}>,
		]
	>;

	/**
	 * Rule to enforce location of semicolons.
	 *
	 * @since 4.0.0-beta.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`semi-style`](https://eslint.style/rules/semi-style) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/semi-style
	 */
	"semi-style": Linter.RuleEntry<["last" | "first"]>;

	/**
	 * Rule to enforce sorted `import` declarations within modules.
	 *
	 * @since 2.0.0-beta.1
	 * @see https://eslint.org/docs/latest/rules/sort-imports
	 */
	"sort-imports": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				ignoreCase: boolean;
				/**
				 * @default false
				 */
				ignoreDeclarationSort: boolean;
				/**
				 * @default false
				 */
				ignoreMemberSort: boolean;
				/**
				 * @default ['none', 'all', 'multiple', 'single']
				 */
				memberSyntaxSortOrder: Array<
					"none" | "all" | "multiple" | "single"
				>;
				/**
				 * @default false
				 */
				allowSeparatedGroups: boolean;
			}>,
		]
	>;

	/**
	 * Rule to require object keys to be sorted.
	 *
	 * @since 3.3.0
	 * @see https://eslint.org/docs/latest/rules/sort-keys
	 */
	"sort-keys": Linter.RuleEntry<
		[
			"asc" | "desc",
			Partial<{
				/**
				 * @default true
				 */
				caseSensitive: boolean;
				/**
				 * @default 2
				 */
				minKeys: number;
				/**
				 * @default false
				 */
				natural: boolean;
				/**
				 * @default false
				 */
				allowLineSeparatedGroups: boolean;
				/**
				 * @default false
				 */
				ignoreComputedKeys: boolean;
			}>,
		]
	>;

	/**
	 * Rule to require variables within the same declaration block to be sorted.
	 *
	 * @since 0.2.0
	 * @see https://eslint.org/docs/latest/rules/sort-vars
	 */
	"sort-vars": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				ignoreCase: boolean;
			}>,
		]
	>;

	/**
	 * Rule to enforce consistent spacing before blocks.
	 *
	 * @since 0.9.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`space-before-blocks`](https://eslint.style/rules/space-before-blocks) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/space-before-blocks
	 */
	"space-before-blocks": Linter.RuleEntry<
		[
			| "always"
			| "never"
			| Partial<
					Record<
						"functions" | "keywords" | "classes",
						"always" | "never" | "off"
					>
			  >,
		]
	>;

	/**
	 * Rule to enforce consistent spacing before `function` definition opening parenthesis.
	 *
	 * @since 0.18.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`space-before-function-paren`](https://eslint.style/rules/space-before-function-paren) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/space-before-function-paren
	 */
	"space-before-function-paren": Linter.RuleEntry<
		[
			| "always"
			| "never"
			| Partial<
					Record<
						"anonymous" | "named" | "asyncArrow",
						"always" | "never" | "ignore"
					>
			  >,
		]
	>;

	/**
	 * Rule to enforce consistent spacing inside parentheses.
	 *
	 * @since 0.8.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`space-in-parens`](https://eslint.style/rules/space-in-parens) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/space-in-parens
	 */
	"space-in-parens": Linter.RuleEntry<
		[
			"never" | "always",
			Partial<{
				exceptions: string[];
			}>,
		]
	>;

	/**
	 * Rule to require spacing around infix operators.
	 *
	 * @since 0.2.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`space-infix-ops`](https://eslint.style/rules/space-infix-ops) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/space-infix-ops
	 */
	"space-infix-ops": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				int32Hint: boolean;
			}>,
		]
	>;

	/**
	 * Rule to enforce consistent spacing before or after unary operators.
	 *
	 * @since 0.10.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`space-unary-ops`](https://eslint.style/rules/space-unary-ops) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/space-unary-ops
	 */
	"space-unary-ops": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default true
				 */
				words: boolean;
				/**
				 * @default false
				 */
				nonwords: boolean;
				overrides: Record<string, boolean>;
			}>,
		]
	>;

	/**
	 * Rule to enforce consistent spacing after the `//` or `/*` in a comment.
	 *
	 * @since 0.23.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`spaced-comment`](https://eslint.style/rules/spaced-comment) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/spaced-comment
	 */
	"spaced-comment": Linter.RuleEntry<
		[
			"always" | "never",
			{
				exceptions: string[];
				markers: string[];
				line: {
					exceptions: string[];
					markers: string[];
				};
				block: {
					exceptions: string[];
					markers: string[];
					/**
					 * @default false
					 */
					balanced: boolean;
				};
			},
		]
	>;

	/**
	 * Rule to require or disallow strict mode directives.
	 *
	 * @since 0.1.0
	 * @see https://eslint.org/docs/latest/rules/strict
	 */
	strict: Linter.RuleEntry<["safe" | "global" | "function" | "never"]>;

	/**
	 * Rule to enforce spacing around colons of switch statements.
	 *
	 * @since 4.0.0-beta.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`switch-colon-spacing`](https://eslint.style/rules/switch-colon-spacing) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/switch-colon-spacing
	 */
	"switch-colon-spacing": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				before: boolean;
				/**
				 * @default true
				 */
				after: boolean;
			}>,
		]
	>;

	/**
	 * Rule to require symbol descriptions.
	 *
	 * @since 3.4.0
	 * @see https://eslint.org/docs/latest/rules/symbol-description
	 */
	"symbol-description": Linter.RuleEntry<[]>;

	/**
	 * Rule to require or disallow spacing around embedded expressions of template strings.
	 *
	 * @since 2.0.0-rc.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`template-curly-spacing`](https://eslint.style/rules/template-curly-spacing) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/template-curly-spacing
	 */
	"template-curly-spacing": Linter.RuleEntry<["never" | "always"]>;

	/**
	 * Rule to require or disallow spacing between template tags and their literals.
	 *
	 * @since 3.15.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`template-tag-spacing`](https://eslint.style/rules/template-tag-spacing) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/template-tag-spacing
	 */
	"template-tag-spacing": Linter.RuleEntry<["never" | "always"]>;

	/**
	 * Rule to require or disallow Unicode byte order mark (BOM).
	 *
	 * @since 2.11.0
	 * @see https://eslint.org/docs/latest/rules/unicode-bom
	 */
	"unicode-bom": Linter.RuleEntry<["never" | "always"]>;

	/**
	 * Rule to require calls to `isNaN()` when checking for `NaN`.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.0.6
	 * @see https://eslint.org/docs/latest/rules/use-isnan
	 */
	"use-isnan": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default true
				 */
				enforceForSwitchCase: boolean;
				/**
				 * @default false
				 */
				enforceForIndexOf: boolean;
			}>,
		]
	>;

	/**
	 * Rule to enforce comparing `typeof` expressions against valid strings.
	 *
	 * @remarks
	 * Recommended by ESLint, the rule was enabled in `eslint:recommended`.
	 *
	 * @since 0.5.0
	 * @see https://eslint.org/docs/latest/rules/valid-typeof
	 */
	"valid-typeof": Linter.RuleEntry<
		[
			Partial<{
				/**
				 * @default false
				 */
				requireStringLiterals: boolean;
			}>,
		]
	>;

	/**
	 * Rule to require `var` declarations be placed at the top of their containing scope.
	 *
	 * @since 0.8.0
	 * @see https://eslint.org/docs/latest/rules/vars-on-top
	 */
	"vars-on-top": Linter.RuleEntry<[]>;

	/**
	 * Rule to require parentheses around immediate `function` invocations.
	 *
	 * @since 0.0.9
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`wrap-iife`](https://eslint.style/rules/wrap-iife) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/wrap-iife
	 */
	"wrap-iife": Linter.RuleEntry<
		[
			"outside" | "inside" | "any",
			Partial<{
				/**
				 * @default false
				 */
				functionPrototypeMethods: boolean;
			}>,
		]
	>;

	/**
	 * Rule to require parenthesis around regex literals.
	 *
	 * @since 0.1.0
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`wrap-regex`](https://eslint.style/rules/wrap-regex) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/wrap-regex
	 */
	"wrap-regex": Linter.RuleEntry<[]>;

	/**
	 * Rule to require or disallow spacing around the `*` in `yield*` expressions.
	 *
	 * @since 2.0.0-alpha-1
	 * @deprecated since 8.53.0.
	 * Formatting rules are being moved out of ESLint core.
	 * Please, use [`yield-star-spacing`](https://eslint.style/rules/yield-star-spacing) in [`@stylistic/eslint-plugin`](https://eslint.style).
	 * @see https://eslint.org/docs/latest/rules/yield-star-spacing
	 */
	"yield-star-spacing": Linter.RuleEntry<
		[
			| Partial<{
					before: boolean;
					after: boolean;
			  }>
			| "before"
			| "after"
			| "both"
			| "neither",
		]
	>;

	/**
	 * Rule to require or disallow "Yoda" conditions.
	 *
	 * @since 0.7.1
	 * @see https://eslint.org/docs/latest/rules/yoda
	 */
	yoda:
		| Linter.RuleEntry<
				[
					"never",
					Partial<{
						exceptRange: boolean;
						onlyEquality: boolean;
					}>,
				]
		  >
		| Linter.RuleEntry<["always"]>;
}
eǼx s/**
 * @fileoverview typings for "eslint/universal" module
 * @author 唯然<weiran.zsd@outlook.com>
 */

export { Linter } from "./index";
1_\x7/**
 * @fileoverview This file contains the types for the use-at-your-own-risk
 * entrypoint. It was initially extracted from the `@types/eslint` package.
 */

/*
 * MIT License
 * Copyright (c) Microsoft Corporation.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 * SOFTWARE
 */

import { Rule } from "./index.js";

/** @deprecated */
export const builtinRules: Map<string, Rule.RuleModule>;

/** @deprecated */
export function shouldUseFlatConfig(): Promise<true>;
x J/**
 * @fileoverview exports for browsers
 * @author 唯然<weiran.zsd@outlook.com>
 */

"use strict";

const { Linter } = require("./linter/linter");

module.exports = { Linter };
>,x5/**
 * @fileoverview APIs that are not officially supported by ESLint.
 *      These APIs may change or be removed at any time. Use at your
 *      own risk.
 * @author Nicholas C. Zakas
 */

"use strict";

//-----------------------------------------------------------------------------
// Requirements
//-----------------------------------------------------------------------------

const { shouldUseFlatConfig } = require("./eslint/eslint");
const builtinRules = require("./rules");

//-----------------------------------------------------------------------------
// Exports
//-----------------------------------------------------------------------------

module.exports = { builtinRules, shouldUseFlatConfig };
DԹ7xq100644 all-matched-files-ignored.js F-آ@k߹100644 config-file-missing.js bAwg100644 config-plugin-missing.js  sgI11}|'9100644 config-serialize-function.js C ~E*ɨ/E100644 eslintrc-incompat.js l_,L2m%b100644 eslintrc-plugins.js ŮUǃS( I2ZDMw100644 extend-config-missing.js 2.EЁg}i:100644 failed-to-read-json.js 2DBg\tb8ʛPn#100644 file-not-found.js P䃼?5gWFӪj^100644 invalid-rule-options.js PmLBN:?5'&100644 invalid-rule-severity.js EW#qTVז100644 no-config-found.js D! mHn~4b8&3[100644 plugin-conflict.js h;TKjAW100644 plugin-invalid.js Q̒aZԗ䗗100644 plugin-missing.js aRG!wﴢ5}pS!L f100644 rule-unsupported-language.js 
3g<j["	M100644 shared.js BDh &4ھ84100644 whitespace-found.js ^fp\5i6VCTb?x"use strict";

module.exports = function (it) {
	const { pattern } = it;

	return `
You are linting "${pattern}", but all of the files matching the glob pattern "${pattern}" are ignored.

If you don't want to lint these files, remove the pattern "${pattern}" from the list of arguments passed to ESLint.

If you do want to lint these files, explicitly list one or more of the files from this glob that you'd like to lint to see more details about why they are ignored.

  * If the file is ignored because of a matching ignore pattern, check global ignores in your config file.
    https://eslint.org/docs/latest/use/configure/ignore

  * If the file is ignored because no matching configuration was supplied, check file patterns in your config file.
    https://eslint.org/docs/latest/use/configure/configuration-files#specify-files-with-arbitrary-extensions

  * If the file is ignored because it is located outside of the base path, change the location of your config file to be in a parent directory.
`.trimStart();
};
qg x"use strict";

module.exports = function () {
	return `
ESLint couldn't find an eslint.config.(js|mjs|cjs) file.

From ESLint v9.0.0, the default configuration file is now eslint.config.js.
If you are using a .eslintrc.* file, please follow the migration guide
to update your configuration file to the new format:

https://eslint.org/docs/latest/use/configure/migration-guide

If you still have problems after following the migration guide, please stop by
https://eslint.org/chat/help to chat with the team.
`.trimStart();
};
h*xB"use strict";

module.exports = function (it) {
	const { pluginName, ruleId } = it;

	return `
A configuration object specifies rule "${ruleId}", but could not find plugin "${pluginName}".

Common causes of this problem include:

1. The "${pluginName}" plugin is not defined in your configuration file.
2. The "${pluginName}" plugin is not defined within the same configuration object in which the "${ruleId}" rule is applied.
`.trimStart();
};
bE:xQ"use strict";

module.exports = function ({ key, objectKey }) {
	// special case for parsers
	const isParser =
		objectKey === "parser" && (key === "parse" || key === "parseForESLint");
	const parserMessage = `
    This typically happens when you're using a custom parser that does not
provide a "meta" property, which is how ESLint determines the serialized
representation. Please open an issue with the maintainer of the custom parser
and share this link:

https://eslint.org/docs/latest/extend/custom-parsers#meta-data-in-custom-parsers
`.trim();

	return `
The requested operation requires ESLint to serialize configuration data,
but the configuration key "${objectKey}.${key}" contains a function value,
which cannot be serialized.

${
	isParser
		? parserMessage
		: "Please double-check your configuration for errors."
}

If you still have problems, please stop by https://eslint.org/chat/help to chat
with the team.
`.trimStart();
};
IxY"use strict";

/* eslint consistent-return: 0 -- no default case */

const messages = {
	env: `
A config object is using the "env" key, which is not supported in flat config system.

Flat config uses "languageOptions.globals" to define global variables for your files.

Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#configure-language-options

If you're not using "env" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#use-eslintrc-configs-in-flat-config
`,

	extends: `
A config object is using the "extends" key, which is not supported in flat config system.

Instead of "extends", you can include config objects that you'd like to extend from directly in the flat config array.

If you're using "extends" in your config file, please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#predefined-and-shareable-configs

If you're not using "extends" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#use-eslintrc-configs-in-flat-config
`,

	globals: `
A config object is using the "globals" key, which is not supported in flat config system.

Flat config uses "languageOptions.globals" to define global variables for your files.

Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#configure-language-options

If you're not using "globals" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#use-eslintrc-configs-in-flat-config
`,

	ignorePatterns: `
A config object is using the "ignorePatterns" key, which is not supported in flat config system.

Flat config uses "ignores" to specify files to ignore.

Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#ignore-files

If you're not using "ignorePatterns" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#use-eslintrc-configs-in-flat-config
`,

	noInlineConfig: `
A config object is using the "noInlineConfig" key, which is not supported in flat config system.

Flat config uses "linterOptions.noInlineConfig" to specify files to ignore.

Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#linter-options
`,

	overrides: `
A config object is using the "overrides" key, which is not supported in flat config system.

Flat config is an array that acts like the eslintrc "overrides" array.

Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#glob-based-configs

If you're not using "overrides" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#use-eslintrc-configs-in-flat-config
`,

	parser: `
A config object is using the "parser" key, which is not supported in flat config system.

Flat config uses "languageOptions.parser" to override the default parser.

Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#custom-parsers

If you're not using "parser" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#use-eslintrc-configs-in-flat-config
`,

	parserOptions: `
A config object is using the "parserOptions" key, which is not supported in flat config system.

Flat config uses "languageOptions.parserOptions" to specify parser options.

Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#configure-language-options

If you're not using "parserOptions" directly (it may be coming from a plugin), please see the following:
https://eslint.org/docs/latest/use/configure/migration-guide#use-eslintrc-configs-in-flat-config
`,

	reportUnusedDisableDirectives: `
A config object is using the "reportUnusedDisableDirectives" key, which is not supported in flat config system.

Flat config uses "linterOptions.reportUnusedDisableDirectives" to specify files to ignore.

Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#linter-options
`,

	root: `
A config object is using the "root" key, which is not supported in flat config system.

Flat configs always act as if they are the root config file, so this key can be safely removed.
`,
};

module.exports = function ({ key }) {
	return messages[key].trim();
};
VL9x`"use strict";

module.exports = function ({ plugins }) {
	const isArrayOfStrings = typeof plugins[0] === "string";

	return `
A config object has a "plugins" key defined as an array${isArrayOfStrings ? " of strings" : ""}. It looks something like this:

    {
        "plugins": ${JSON.stringify(plugins)}
    }

Flat config requires "plugins" to be an object, like this:

    {
        plugins: {
            ${isArrayOfStrings && plugins[0] ? plugins[0] : "namespace"}: pluginObject
        }
    }

Please see the following page for information on how to convert your config object into the correct format:
https://eslint.org/docs/latest/use/configure/migration-guide#import-plugins-and-custom-parsers

If you're using a shareable config that you cannot rewrite in flat config format, then use the compatibility utility:
https://eslint.org/docs/latest/use/configure/migration-guide#use-eslintrc-configs-in-flat-config
`;
};
V=x]"use strict";

module.exports = function (it) {
	const { configName, importerName } = it;

	return `
ESLint couldn't find the config "${configName}" to extend from. Please check that the name of the config is correct.

The config "${configName}" was referenced from the config file in "${importerName}".

If you still have problems, please stop by https://eslint.org/chat/help to chat with the team.
`.trimStart();
};
l	x b"use strict";

module.exports = function (it) {
	const { path, message } = it;

	return `
Failed to read JSON file at ${path}:

${message}
`.trimStart();
};
3x"use strict";

module.exports = function (it) {
	const { pattern, globDisabled } = it;

	return `
No files matching the pattern "${pattern}"${globDisabled ? " (with disabling globs)" : ""} were found.
Please check for typing mistakes in the pattern.
`.trimStart();
};
7[E(xy"use strict";

const { stringifyValueForError } = require("./shared");

module.exports = function ({ ruleId, value }) {
	return `
Configuration for rule "${ruleId}" is invalid. Each rule must have a severity ("off", 0, "warn", 1, "error", or 2) and may be followed by additional options for the rule.

You passed '${stringifyValueForError(value, 4)}', which doesn't contain a valid severity.

If you're attempting to configure rule options, perhaps you meant:

    "${ruleId}": ["error", ${stringifyValueForError(value, 8)}]

See https://eslint.org/docs/latest/use/configure/rules#use-configuration-files for configuring rules.
`.trimStart();
};
w+xi"use strict";

const { stringifyValueForError } = require("./shared");

module.exports = function ({ ruleId, value }) {
	return `
Configuration for rule "${ruleId}" is invalid. Expected severity of "off", 0, "warn", 1, "error", or 2.

You passed '${stringifyValueForError(value, 4)}'.

See https://eslint.org/docs/latest/use/configure/rules#use-configuration-files for configuring rules.
`.trimStart();
};
 x"use strict";

module.exports = function (it) {
	const { directoryPath } = it;

	return `
ESLint couldn't find a configuration file. To set up a configuration file for this project, please run:

    npm init @eslint/config@latest

ESLint looked for configuration files in ${directoryPath} and its ancestors. If it found none, it then looked in your home directory.

If you think you already have a configuration file or if you need more help, please stop by the ESLint Discord server: https://eslint.org/chat
`.trimStart();
};
ם x"use strict";

module.exports = function (it) {
	const { pluginId, plugins } = it;

	let result = `ESLint couldn't determine the plugin "${pluginId}" uniquely.
`;

	for (const { filePath, importerName } of plugins) {
		result += `
- ${filePath} (loaded in "${importerName}")`;
	}

	result += `

Please remove the "plugins" setting from either config or remove either plugin installation.

If you still can't figure out the problem, please see https://eslint.org/docs/latest/use/troubleshooting.
`;

	return result;
};
0(xr"use strict";

module.exports = function (it) {
	const { configName, importerName } = it;

	return `
"${configName}" is invalid syntax for a config specifier.

* If your intention is to extend from a configuration exported from the plugin, add the configuration name after a slash: e.g. "${configName}/myConfig".
* If this is the name of a shareable config instead of a plugin, remove the "plugin:" prefix: i.e. "${configName.slice("plugin:".length)}".

"${configName}" was referenced from the config file in "${importerName}".

If you still can't figure out the problem, please see https://eslint.org/docs/latest/use/troubleshooting.
`.trimStart();
};
rs)xl"use strict";

module.exports = function (it) {
	const { pluginName, resolvePluginsRelativeTo, importerName } = it;

	return `
ESLint couldn't find the plugin "${pluginName}".

(The package "${pluginName}" was not found when loaded as a Node module from the directory "${resolvePluginsRelativeTo}".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

    npm install ${pluginName}@latest --save-dev

The plugin "${pluginName}" was referenced from the config file in "${importerName}".

If you still can't figure out the problem, please see https://eslint.org/docs/latest/use/troubleshooting.
`.trimStart();
};
赹"x)"use strict";

module.exports = function ({ ruleIds, language }) {
	return `
The following rules do not support the language "${language}":
${ruleIds.map(id => `\t- "${id}"`).join("\n")}

To fix this error, either:
- Remove the rule from your configuration, or set its severity to "off".
- Use the "files" option to apply the rule only to files of the supported language, for example:
  {
    files: ["**/*.js"],
    rules: { "${ruleIds[0]}": "error" }
  }

See https://eslint.org/docs/latest/use/configure/rules for more information.
`.trimStart();
};
"x"/**
 * @fileoverview Shared utilities for error messages.
 * @author Josh Goldberg
 */

"use strict";

/**
 * Converts a value to a string that may be printed in errors.
 * @param {any} value The invalid value.
 * @param {number} indentation How many spaces to indent
 * @returns {string} The value, stringified.
 */
function stringifyValueForError(value, indentation) {
	return value
		? JSON.stringify(value, null, 4).replace(
				/\n/gu,
				`\n${" ".repeat(indentation)}`,
			)
		: `${value}`;
}

module.exports = { stringifyValueForError };
T7x}"use strict";

module.exports = function (it) {
	const { pluginName } = it;

	return `
ESLint couldn't find the plugin "${pluginName}". because there is whitespace in the name. Please check your configuration and remove all whitespace from the plugin name.

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.
`.trimStart();
};
x{
  "name": "eslint",
  "version": "10.8.0",
  "author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
  "description": "An AST-based pattern checker for JavaScript.",
  "type": "commonjs",
  "bin": {
    "eslint": "./bin/eslint.js"
  },
  "main": "./lib/api.js",
  "types": "./lib/types/index.d.ts",
  "exports": {
    ".": {
      "types": "./lib/types/index.d.ts",
      "default": "./lib/api.js"
    },
    "./config": {
      "types": "./lib/types/config-api.d.ts",
      "default": "./lib/config-api.js"
    },
    "./package.json": "./package.json",
    "./use-at-your-own-risk": {
      "types": "./lib/types/use-at-your-own-risk.d.ts",
      "default": "./lib/unsupported-api.js"
    },
    "./rules": {
      "types": "./lib/types/rules.d.ts"
    },
    "./universal": {
      "types": "./lib/types/universal.d.ts",
      "default": "./lib/universal.js"
    }
  },
  "typesVersions": {
    "*": {
      "use-at-your-own-risk": [
        "./lib/types/use-at-your-own-risk.d.ts"
      ],
      "rules": [
        "./lib/types/rules.d.ts"
      ],
      "universal": [
        "./lib/types/universal.d.ts"
      ],
      "config": [
        "./lib/types/config-api.d.ts"
      ]
    }
  },
  "scripts": {
    "build:docs:update-links": "node tools/fetch-docs-links.js",
    "build:site": "node Makefile.js gensite",
    "build:webpack": "node Makefile.js webpack",
    "build:readme": "node tools/update-readme.js",
    "build:rules-index": "node Makefile.js generateRuleIndexPage",
    "fmt": "prettier --write .",
    "fmt:check": "prettier --check .",
    "lint": "node Makefile.js lint",
    "lint:docs:js": "node Makefile.js lintDocsJS",
    "lint:docs:rule-examples": "node Makefile.js checkRuleExamples",
    "lint:unused": "knip",
    "lint:fix": "node Makefile.js lint -- fix",
    "lint:fix:docs:js": "node Makefile.js lintDocsJS -- fix",
    "lint:rule-types": "node tools/update-rule-type-headers.js --check",
    "lint:types": "attw --pack",
    "release:generate:alpha": "node Makefile.js generatePrerelease -- alpha",
    "release:generate:beta": "node Makefile.js generatePrerelease -- beta",
    "release:generate:latest": "node Makefile.js generateRelease -- latest",
    "release:generate:maintenance": "node Makefile.js generateRelease -- maintenance",
    "release:generate:rc": "node Makefile.js generatePrerelease -- rc",
    "release:publish": "node Makefile.js publishRelease",
    "test": "node Makefile.js test",
    "test:browser": "node Makefile.js cypress",
    "test:cli": "mocha",
    "test:ecosystem": "node tools/test-ecosystem/index.mjs",
    "test:ecosystem:update": "node tools/test-ecosystem/update.mjs",
    "test:emfile": "node tools/check-emfile-handling.js",
    "test:fuzz": "node Makefile.js fuzz",
    "test:performance": "node Makefile.js perf",
    "test:pnpm": "cd tests/pnpm && node check.js && pnpm install && pnpm exec tsc",
    "test:types": "tsc -p tests/lib/types/tsconfig.json && npm run test:types --workspaces --if-present",
    "test:types:5.3": "npx -p typescript@5.3 -y -- tsc -p tsconfig.types-legacy.json",
    "test:types:5.x": "npx -p typescript@5.x -y -- tsc -p tsconfig.types.json",
    "test:types:7.x": "npx -p @typescript/native-preview@latest -y -- tsgo -p tsconfig.types.json",
    "test:types:all": "npm run test:types && npm run test:types:5.3 && npm run test:types:5.x && npm run test:types:7.x"
  },
  "workspaces": [
    "packages/*"
  ],
  "gitHooks": {
    "pre-commit": "lint-staged"
  },
  "lint-staged": {
    "*.{js,json,jsonc,json5,yml,yaml}": [
      "eslint --fix",
      "prettier --write"
    ],
    "docs/src/**/*.md": [
      "markdownlint-cli2 --fix",
      "prettier --write"
    ],
    "!({{*.,**/*.}{js,json,jsonc,json5,yml,yaml},docs/src/**/*.md})": "prettier --write --ignore-unknown",
    "lib/rules/*.js": [
      "node tools/update-eslint-all.js",
      "node tools/update-eslint-recommended.js",
      "node tools/update-rule-type-headers.js",
      "git add packages/js/src/configs/*.js lib/types/rules.d.ts"
    ],
    "docs/src/rules/*.md": [
      "node tools/check-rule-examples.js",
      "node tools/fetch-docs-links.js",
      "git add docs/src/_data/further_reading_links.json"
    ],
    "docs/**/*.svg": "npx -y svgo -r --multipass"
  },
  "files": [
    "LICENSE",
    "README.md",
    "bin",
    "conf",
    "lib",
    "messages"
  ],
  "repository": "eslint/eslint",
  "funding": "https://eslint.org/donate",
  "homepage": "https://eslint.org",
  "bugs": "https://github.com/eslint/eslint/issues/",
  "dependencies": {
    "@eslint-community/eslint-utils": "^4.8.0",
    "@eslint-community/regexpp": "^4.12.2",
    "@eslint/config-array": "^0.23.5",
    "@eslint/config-helpers": "^0.7.0",
    "@eslint/core": "^1.2.1",
    "@eslint/plugin-kit": "^0.7.2",
    "@humanfs/node": "^0.16.6",
    "@humanwhocodes/module-importer": "^1.0.1",
    "@humanwhocodes/retry": "^0.4.2",
    "@types/estree": "^1.0.6",
    "ajv": "^6.14.0",
    "cross-spawn": "^7.0.6",
    "debug": "^4.3.2",
    "escape-string-regexp": "^4.0.0",
    "eslint-scope": "^9.1.2",
    "eslint-visitor-keys": "^5.0.1",
    "espree": "^11.2.0",
    "esquery": "^1.7.0",
    "esutils": "^2.0.2",
    "fast-deep-equal": "^3.1.3",
    "file-entry-cache": "^8.0.0",
    "find-up": "^5.0.0",
    "glob-parent": "^6.0.2",
    "ignore": "^5.2.0",
    "imurmurhash": "^0.1.4",
    "is-glob": "^4.0.0",
    "json-stable-stringify-without-jsonify": "^1.0.1",
    "minimatch": "^10.2.5",
    "natural-compare": "^1.4.0",
    "optionator": "^0.9.3"
  },
  "devDependencies": {
    "@arethetypeswrong/cli": "^0.18.3",
    "@babel/core": "^7.4.3",
    "@babel/preset-env": "^7.4.3",
    "@cypress/webpack-preprocessor": "^6.0.2",
    "@eslint/eslintrc": "^3.3.6",
    "@eslint/json": "^2.0.1",
    "@types/esquery": "^1.5.4",
    "@types/node": "^22.13.14",
    "@typescript-eslint/parser": "^8.58.2",
    "babel-loader": "^8.0.5",
    "c8": "^11.0.0",
    "chai": "^4.0.1",
    "cheerio": "^0.22.0",
    "common-tags": "^1.8.0",
    "core-js": "^3.1.3",
    "cypress": "^14.1.0",
    "ejs": "^3.0.2",
    "eslint": "file:.",
    "eslint-config-eslint": "file:packages/eslint-config-eslint",
    "eslint-plugin-eslint-plugin": "^7.3.2",
    "eslint-plugin-expect-type": "^0.6.0",
    "eslint-plugin-yml": "^1.14.0",
    "eslint-release": "^3.3.0",
    "eslint-rule-extender": "^0.0.1",
    "eslump": "^3.0.0",
    "esprima": "^4.0.1",
    "fs-teardown": "^0.1.3",
    "glob": "^10.0.0",
    "globals": "^16.2.0",
    "got": "^11.8.3",
    "gray-matter": "^4.0.3",
    "jiti": "^2.6.1",
    "knip": "^6.13.1",
    "lint-staged": "^11.0.0",
    "markdown-it": "^14.2.0",
    "markdown-it-container": "^4.0.0",
    "markdownlint-cli2": "^0.22.0",
    "marked": "^4.0.8",
    "metascraper": "^5.25.7",
    "metascraper-description": "^5.25.7",
    "metascraper-image": "^5.29.3",
    "metascraper-logo": "^5.25.7",
    "metascraper-logo-favicon": "^5.25.7",
    "metascraper-title": "^5.25.7",
    "mocha": "^11.7.1",
    "node-polyfill-webpack-plugin": "^1.0.3",
    "npm-license": "^0.3.3",
    "prettier": "3.9.5",
    "progress": "^2.0.3",
    "proxyquire": "^2.0.1",
    "regenerator-runtime": "^0.14.0",
    "semver": "^7.5.3",
    "shelljs": "^0.10.0",
    "sinon": "^11.0.0",
    "typescript": "^6.0.3",
    "webpack": "5.108.4",
    "webpack-cli": "^4.5.0",
    "yorkie": "^2.0.0"
  },
  "peerDependencies": {
    "jiti": "*"
  },
  "peerDependenciesMeta": {
    "jiti": {
      "optional": true
    }
  },
  "keywords": [
    "ast",
    "lint",
    "javascript",
    "ecmascript",
    "espree"
  ],
  "license": "MIT",
  "engines": {
    "node": "^20.19.0 || ^22.13.0 || >=24"
  }
}
x -100644 LICENSE i/7EcPI?p100644 README.md >t?w kdh40000 dist 'KB(٢ s	l>100644 espree.js '_uaC0{w40000 lib A Jim@Q100644 package.json G[yP=f(cV:x2

JBSD 2-Clause License

Copyright (c) Open JS Foundation
All rights reserved1.2? notice, this
  
0.

2.B notice,
  }5 in the documentation
  S ARE
q7THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY B	
DAMAGES B
SERVICES; L@
CAUSED AND B	
OR TORT E
OF ,BCXزx3[![npm version](https://img.shields.io/npm/v/espree.svg)](https://www.npmjs.com/package/espree)
[![npm downloads](https://img.shields.io/npm/dm/espree.svg)](https://www.npmjs.com/package/espree)
[![Build Status](https://github.com/eslint/js/workflows/CI/badge.svg)](https://github.com/js/espree/actions)
[![Bountysource](https://www.bountysource.com/badge/tracker?tracker_id=9348450)](https://www.bountysource.com/trackers/9348450-eslint?utm_source=9348450&utm_medium=shield&utm_campaign=TRACKER_BADGE)

# Espree

Espree started out as a fork of [Esprima](http://esprima.org) v1.2.2, the last stable published released of Esprima before work on ECMAScript 6 began. Espree is now built on top of [Acorn](https://github.com/ternjs/acorn), which has a modular architecture that allows extension of core functionality. The goal of Espree is to produce output that is similar to Esprima with a similar API so that it can be used in place of Esprima.

## Usage

Install:

```
npm i espree
```

To use in an ESM file:

```js
import * as espree from "espree";

const ast = espree.parse(code);
```

To use in a Common JS file:

```js
const espree = require("espree");

const ast = espree.parse(code);
```

## API

### `parse()`

`parse` parses the given code and returns a abstract syntax tree (AST). It takes two parameters.

- `code` [string]() - the code which needs to be parsed.
- `options (Optional)` [Object]() - read more about this [here](#options).

```js
import * as espree from "espree";

const ast = espree.parse(code);
```

**Example :**

```js
const ast = espree.parse('let foo = "bar"', { ecmaVersion: 6 });
console.log(ast);
```

<details><summary>Output</summary>
<p>

```
Node {
  type: 'Program',
  start: 0,
  end: 15,
  body: [
    Node {
      type: 'VariableDeclaration',
      start: 0,
      end: 15,
      declarations: [Array],
      kind: 'let'
    }
  ],
  sourceType: 'script'
}
```

</p>
</details>

### `tokenize()`

`tokenize` returns the tokens of a given code. It takes two parameters.

- `code` [string]() - the code which needs to be parsed.
- `options (Optional)` [Object]() - read more about this [here](#options).

Even if `options` is empty or undefined or `options.tokens` is `false`, it assigns it to `true` in order to get the `tokens` array

**Example :**

```js
import * as espree from "espree";

const tokens = espree.tokenize('let foo = "bar"', { ecmaVersion: 6 });
console.log(tokens);
```

<details><summary>Output</summary>
<p>

```
Token { type: 'Keyword', value: 'let', start: 0, end: 3 },
Token { type: 'Identifier', value: 'foo', start: 4, end: 7 },
Token { type: 'Punctuator', value: '=', start: 8, end: 9 },
Token { type: 'String', value: '"bar"', start: 10, end: 15 }
```

</p>
</details>

### `version`

Returns the current `espree` version

### `VisitorKeys`

Returns all visitor keys for traversing the AST from [eslint-visitor-keys](https://github.com/eslint/js/tree/main/packages/eslint-visitor-keys)

### `latestEcmaVersion`

Returns the latest ECMAScript supported by `espree`

### `supportedEcmaVersions`

Returns an array of all supported ECMAScript versions

## Options

```js
const options = {
	// attach range information to each node
	range: false,

	// attach line/column location information to each node
	loc: false,

	// create a top-level comments array containing all comments
	comment: false,

	// create a top-level tokens array containing all tokens
	tokens: false,

	// Set to 3, 5 (the default), 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16 or 17 to specify the version of ECMAScript syntax you want to use.
	// You can also set to 2015 (same as 6), 2016 (same as 7), 2017 (same as 8), 2018 (same as 9), 2019 (same as 10), 2020 (same as 11), 2021 (same as 12), 2022 (same as 13), 2023 (same as 14), 2024 (same as 15), 2025 (same as 16) or 2026 (same as 17) to use the year-based naming.
	// You can also set "latest" to use the most recently supported version.
	ecmaVersion: 3,

	allowReserved: true, // only allowed when ecmaVersion is 3

	// specify which type of script you're parsing ("script", "module", or "commonjs")
	sourceType: "script",

	// specify additional language features
	ecmaFeatures: {
		// enable JSX parsing
		jsx: false,

		// enable return in global scope (set to true automatically when sourceType is "commonjs")
		globalReturn: false,

		// enable implied strict mode (if ecmaVersion >= 5)
		impliedStrict: false,
	},
};
```

## Esprima Compatibility Going Forward

The primary goal is to produce the exact same AST structure and tokens as Esprima, and that takes precedence over anything else. (The AST structure being the [ESTree](https://github.com/estree/estree) API with JSX extensions.) Separate from that, Espree may deviate from what Esprima outputs in terms of where and how comments are attached, as well as what additional information is available on AST nodes. That is to say, Espree may add more things to the AST nodes than Esprima does but the overall AST structure produced will be the same.

Espree may also deviate from Esprima in the interface it exposes.

## Contributing

Issues and pull requests will be triaged and responded to as quickly as possible. We operate under the [ESLint Contributor Guidelines](http://eslint.org/docs/developer-guide/contributing), so please be sure to read them before contributing. If you're not sure where to dig in, check out the [issues](https://github.com/eslint/js/issues).

Espree is licensed under a permissive BSD 2-clause license.

## Security Policy

We work hard to ensure that Espree is safe for everyone and that security issues are addressed quickly and responsibly. Read the full [security policy](https://github.com/eslint/.github/blob/master/SECURITY.md).

## Build Commands

- `npm test` - run all tests
- `npm run lint` - run all linting

## Differences from Espree 2.x

- The `tokenize()` method does not use `ecmaFeatures`. Any string will be tokenized completely based on ECMAScript 6 semantics.
- Trailing whitespace no longer is counted as part of a node.
- `let` and `const` declarations are no longer parsed by default. You must opt-in by using an `ecmaVersion` newer than `5` or setting `sourceType` to `module`.
- The `esparse` and `esvalidate` binary scripts have been removed.
- There is no `tolerant` option. We will investigate adding this back in the future.

## Known Incompatibilities

In an effort to help those wanting to transition from other parsers to Espree, the following is a list of noteworthy incompatibilities with other parsers. These are known differences that we do not intend to change.

### Esprima 1.2.2

- Esprima counts trailing whitespace as part of each AST node while Espree does not. In Espree, the end of a node is where the last token occurs.
- Espree does not parse `let` and `const` declarations by default.
- Error messages returned for parsing errors are different.
- There are two addition properties on every node and token: `start` and `end`. These represent the same data as `range` and are used internally by Acorn.

### Esprima 2.x

- Esprima 2.x uses a different comment attachment algorithm that results in some comments being added in different places than Espree. The algorithm Espree uses is the same one used in Esprima 1.2.2.

## Frequently Asked Questions

### Why another parser

[ESLint](http://eslint.org) had been relying on Esprima as its parser from the beginning. While that was fine when the JavaScript language was evolving slowly, the pace of development increased dramatically and Esprima had fallen behind. ESLint, like many other tools reliant on Esprima, has been stuck in using new JavaScript language features until Esprima updates, and that caused our users frustration.

We decided the only way for us to move forward was to create our own parser, bringing us inline with JSHint and JSLint, and allowing us to keep implementing new features as we need them. We chose to fork Esprima instead of starting from scratch in order to move as quickly as possible with a compatible API.

With Espree 2.0.0, we are no longer a fork of Esprima but rather a translation layer between Acorn and Esprima syntax. This allows us to put work back into a community-supported parser (Acorn) that is continuing to grow and evolve while maintaining an Esprima-compatible parser for those utilities still built on Esprima.

### Have you tried working with Esprima?

Yes. Since the start of ESLint, we've regularly filed bugs and feature requests with Esprima and will continue to do so. However, there are some different philosophies around how the projects work that need to be worked through. The initial goal was to have Espree track Esprima and eventually merge the two back together, but we ultimately decided that building on top of Acorn was a better choice due to Acorn's plugin support.

### Why don't you just use Acorn?

Acorn is a great JavaScript parser that produces an AST that is compatible with Esprima. Unfortunately, ESLint relies on more than just the AST to do its job. It relies on Esprima's tokens and comment attachment features to get a complete picture of the source code. We investigated switching to Acorn, but the inconsistencies between Esprima and Acorn created too much work for a project like ESLint.

We are building on top of Acorn, however, so that we can contribute back and help make Acorn even better.

### What ECMAScript features do you support?

Espree supports all ECMAScript 2025 features and partially supports ECMAScript 2026 features.

Because ECMAScript 2026 is still under development, we are implementing features as they are finalized. Currently, Espree supports:

- [Explicit Resource Management](https://github.com/tc39/proposal-explicit-resource-management)

See [finished-proposals.md](https://github.com/tc39/proposals/blob/master/finished-proposals.md) to know what features are finalized.

### How do you determine which experimental features to support?

In general, we do not support experimental JavaScript features. We may make exceptions from time to time depending on the maturity of the features.

<!-- NOTE: This section is autogenerated. Do not manually edit.-->
<!--sponsorsstart-->

## Sponsors

The following companies, organizations, and individuals support ESLint's ongoing maintenance and development. [Become a Sponsor](https://eslint.org/donate)
to get your logo on our READMEs and [website](https://eslint.org/sponsors).

<h3>Platinum Sponsors</h3>
<p><a href="https://automattic.com"><img src="https://images.opencollective.com/automattic/d0ef3e1/logo.png" alt="Automattic" height="128"></a></p><h3>Gold Sponsors</h3>
<p><a href="https://qlty.sh/"><img src="https://images.opencollective.com/qltysh/33d157d/logo.png" alt="Qlty Software" height="96"></a></p><h3>Silver Sponsors</h3>
<p><a href="https://vite.dev/"><img src="https://images.opencollective.com/vite/d472863/logo.png" alt="Vite" height="64"></a> <a href="https://liftoff.io/"><img src="https://images.opencollective.com/liftoff/2d6c3b6/logo.png" alt="Liftoff" height="64"></a> <a href="https://stackblitz.com"><img src="https://avatars.githubusercontent.com/u/28635252" alt="StackBlitz" height="64"></a></p><h3>Bronze Sponsors</h3>
<p><a href="https://cybozu.co.jp/"><img src="https://images.opencollective.com/cybozu/933e46d/logo.png" alt="Cybozu" height="32"></a> <a href="https://opensource.sap.com"><img src="https://avatars.githubusercontent.com/u/2531208" alt="SAP" height="32"></a> <a href="https://www.crawljobs.com/"><img src="https://images.opencollective.com/crawljobs-poland/fa43a17/logo.png" alt="CrawlJobs" height="32"></a> <a href="https://depot.dev"><img src="https://images.opencollective.com/depot/39125a1/logo.png" alt="Depot" height="32"></a> <a href="https://www.n-ix.com/"><img src="https://images.opencollective.com/n-ix-ltd/575a7a5/logo.png" alt="N-iX Ltd" height="32"></a> <a href="https://icons8.com/"><img src="https://images.opencollective.com/icons8/7fa1641/logo.png" alt="Icons8" height="32"></a> <a href="https://discord.com"><img src="https://images.opencollective.com/discordapp/f9645d9/logo.png" alt="Discord" height="32"></a> <a href="https://www.gitbook.com"><img src="https://avatars.githubusercontent.com/u/7111340" alt="GitBook" height="32"></a> <a href="https://herocoders.com"><img src="https://avatars.githubusercontent.com/u/37549774" alt="HeroCoders" height="32"></a> <a href="https://www.lambdatest.com"><img src="https://avatars.githubusercontent.com/u/171592363" alt="TestMu AI Open Source Office (Formerly LambdaTest)" height="32"></a></p>
<h3>Technology Sponsors</h3>
Technology sponsors allow us to use their products and services for free as part of a contribution to the open source ecosystem and our work.
<p><a href="https://netlify.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/netlify-icon.svg" alt="Netlify" height="32"></a> <a href="https://algolia.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/algolia-icon.svg" alt="Algolia" height="32"></a> <a href="https://1password.com"><img src="https://raw.githubusercontent.com/eslint/eslint.org/main/src/assets/images/techsponsors/1password-icon.svg" alt="1Password" height="32"></a></p>
<!--sponsorsend-->
=x 3100644 espree.cjs U|ptD100644 espree.d.cts XpHW@|~100644 espree.d.cts.map M[CxX(|100644 espree.d.ts !nrCkR٬B100644 espree.d.ts.map Sp\x(6UteT}Vkx]s'use strict';

var acorn = require('acorn');
var jsx = require('acorn-jsx');
var eslintVisitorKeys = require('eslint-visitor-keys');

function _interopNamespaceDefault(e) {
	var n = Object.create(null);
	if (e) {
		Object.keys(e).forEach(function (k) {
			if (k !== 'default') {
				var d = Object.getOwnPropertyDescriptor(e, k);
				Object.defineProperty(n, k, d.get ? d : {
					enumerable: true,
					get: function () { return e[k]; }
				});
			}
		});
	}
	n.default = e;
	return Object.freeze(n);
}

var acorn__namespace = /*#__PURE__*/_interopNamespaceDefault(acorn);

/**
 * @fileoverview Translates tokens between Acorn format and Esprima format.
 * @author Nicholas C. Zakas
 */

/**
 * @import * as acorn from "acorn";
 * @import { EnhancedTokTypes } from "./espree.js"
 * @import { NormalizedEcmaVersion } from "./options.js";
 * @import { EspreeToken as EsprimaToken } from "../espree.js";
 */
/**
 * Based on the `acorn.Token` class, but without a fixed `type` (since we need
 * it to be a string). Avoiding `type` lets us make one extending interface
 * more strict and another more lax.
 *
 * We could make `value` more strict to `string` even though the original is
 * `any`.
 *
 * `start` and `end` are required in `acorn.Token`
 *
 * `loc` and `range` are from `acorn.Token`
 *
 * Adds `regex`.
 */
/**
 * @typedef {{
 *   jsxAttrValueToken: boolean;
 *   ecmaVersion: NormalizedEcmaVersion;
 * }} ExtraNoTokens
 * @typedef {{
 *   tokens: EsprimaToken[]
 * } & ExtraNoTokens} Extra
 */

//------------------------------------------------------------------------------
// Private
//------------------------------------------------------------------------------

// Esprima Token Types
const Token = {
	Boolean: "Boolean",
	EOF: "<end>",
	Identifier: "Identifier",
	PrivateIdentifier: "PrivateIdentifier",
	Keyword: "Keyword",
	Null: "Null",
	Numeric: "Numeric",
	Punctuator: "Punctuator",
	String: "String",
	RegularExpression: "RegularExpression",
	Template: "Template",
	JSXIdentifier: "JSXIdentifier",
	JSXText: "JSXText",
};

/**
 * Converts part of a template into an Esprima token.
 * @param {acorn.Token[]} tokens The Acorn tokens representing the template.
 * @param {string} code The source code.
 * @returns {EsprimaToken} The Esprima equivalent of the template token.
 * @private
 */
function convertTemplatePart(tokens, code) {
	const firstToken = tokens[0],
		lastTemplateToken =
			/** @type {acorn.Token & { loc: acorn.SourceLocation, range: [number, number] }} */ (
				tokens.at(-1)
			);

	/** @type {EsprimaToken} */
	const token = {
		type: Token.Template,
		value: code.slice(firstToken.start, lastTemplateToken.end),
	};

	if (firstToken.loc) {
		token.loc = {
			start: firstToken.loc.start,
			end: lastTemplateToken.loc.end,
		};
	}

	if (firstToken.range) {
		token.start = firstToken.range[0];
		token.end = lastTemplateToken.range[1];
		token.range = [token.start, token.end];
	}

	return token;
}

/* eslint-disable jsdoc/check-types -- The API allows either */
/**
 * Contains logic to translate Acorn tokens into Esprima tokens.
 */
class TokenTranslator {
	/**
	 * Contains logic to translate Acorn tokens into Esprima tokens.
	 * @param {EnhancedTokTypes} acornTokTypes The Acorn token types.
	 * @param {string|String} code The source code Acorn is parsing. This is necessary
	 *      to correct the "value" property of some tokens.
	 */
	constructor(acornTokTypes, code) {
		/* eslint-enable jsdoc/check-types -- The API allows either */

		// token types
		this._acornTokTypes = acornTokTypes;

		// token buffer for templates
		/** @type {acorn.Token[]} */
		this._tokens = [];

		// track the last curly brace
		this._curlyBrace = null;

		// the source code
		this._code = code;
	}

	/**
	 * Translates a single Esprima token to a single Acorn token. This may be
	 * inaccurate due to how templates are handled differently in Esprima and
	 * Acorn, but should be accurate for all other tokens.
	 * @param {acorn.Token} token The Acorn token to translate.
	 * @param {ExtraNoTokens} extra Espree extra object.
	 * @returns {EsprimaToken} The Esprima version of the token.
	 */
	translate(token, extra) {
		const type = token.type,
			tt = this._acornTokTypes,
			// We use an unknown type because `acorn.Token` is a class whose
			//   `type` property we cannot override to our desired `string`;
			//   this also allows us to define a stricter `EsprimaToken` with
			//   a string-only `type` property
			unknownTokenType = /** @type {unknown} */ (token),
			newToken = /** @type {EsprimaToken} */ (unknownTokenType);

		if (type === tt.name) {
			newToken.type = Token.Identifier;

			// TODO: See if this is an Acorn bug
			if ("value" in token && token.value === "static") {
				newToken.type = Token.Keyword;
			}

			if (
				extra.ecmaVersion > 5 &&
				"value" in token &&
				(token.value === "yield" || token.value === "let")
			) {
				newToken.type = Token.Keyword;
			}
		} else if (type === tt.privateId) {
			newToken.type = Token.PrivateIdentifier;
		} else if (
			type === tt.semi ||
			type === tt.comma ||
			type === tt.parenL ||
			type === tt.parenR ||
			type === tt.braceL ||
			type === tt.braceR ||
			type === tt.dot ||
			type === tt.bracketL ||
			type === tt.colon ||
			type === tt.question ||
			type === tt.bracketR ||
			type === tt.ellipsis ||
			type === tt.arrow ||
			type === tt.jsxTagStart ||
			type === tt.incDec ||
			type === tt.starstar ||
			type === tt.jsxTagEnd ||
			type === tt.prefix ||
			type === tt.questionDot ||
			("binop" in type && type.binop && !type.keyword) ||
			("isAssign" in type && type.isAssign)
		) {
			newToken.type = Token.Punctuator;
			newToken.value = this._code.slice(token.start, token.end);
		} else if (type === tt.jsxName) {
			newToken.type = Token.JSXIdentifier;
		} else if (type.label === "jsxText" || type === tt.jsxAttrValueToken) {
			newToken.type = Token.JSXText;
		} else if (type.keyword) {
			if (type.keyword === "true" || type.keyword === "false") {
				newToken.type = Token.Boolean;
			} else if (type.keyword === "null") {
				newToken.type = Token.Null;
			} else {
				newToken.type = Token.Keyword;
			}
		} else if (type === tt.num) {
			newToken.type = Token.Numeric;
			newToken.value = this._code.slice(token.start, token.end);
		} else if (type === tt.string) {
			if (extra.jsxAttrValueToken) {
				extra.jsxAttrValueToken = false;
				newToken.type = Token.JSXText;
			} else {
				newToken.type = Token.String;
			}

			newToken.value = this._code.slice(token.start, token.end);
		} else if (type === tt.regexp) {
			newToken.type = Token.RegularExpression;
			const value = /** @type {{flags: string, pattern: string}} */ (
				"value" in token && token.value
			);

			newToken.regex = {
				flags: value.flags,
				pattern: value.pattern,
			};
			newToken.value = `/${value.pattern}/${value.flags}`;
		}

		return newToken;
	}

	/**
	 * Function to call during Acorn's onToken handler.
	 * @param {acorn.Token} token The Acorn token.
	 * @param {Extra} extra The Espree extra object.
	 * @returns {void}
	 */
	onToken(token, extra) {
		const tt = this._acornTokTypes,
			tokens = extra.tokens,
			templateTokens = this._tokens;

		/**
		 * Flushes the buffered template tokens and resets the template
		 * tracking.
		 * @returns {void}
		 * @private
		 */
		const translateTemplateTokens = () => {
			tokens.push(convertTemplatePart(this._tokens, this._code));
			this._tokens = [];
		};

		if (token.type === tt.eof) {
			// might be one last curlyBrace
			if (this._curlyBrace) {
				tokens.push(this.translate(this._curlyBrace, extra));
			}

			return;
		}

		if (token.type === tt.backQuote) {
			// if there's already a curly, it's not part of the template
			if (this._curlyBrace) {
				tokens.push(this.translate(this._curlyBrace, extra));
				this._curlyBrace = null;
			}

			templateTokens.push(token);

			// it's the end
			if (templateTokens.length > 1) {
				translateTemplateTokens();
			}

			return;
		}
		if (token.type === tt.dollarBraceL) {
			templateTokens.push(token);
			translateTemplateTokens();
			return;
		}
		if (token.type === tt.braceR) {
			// if there's already a curly, it's not part of the template
			if (this._curlyBrace) {
				tokens.push(this.translate(this._curlyBrace, extra));
			}

			// store new curly for later
			this._curlyBrace = token;
			return;
		}
		if (token.type === tt.template || token.type === tt.invalidTemplate) {
			if (this._curlyBrace) {
				templateTokens.push(this._curlyBrace);
				this._curlyBrace = null;
			}

			templateTokens.push(token);
			return;
		}

		if (this._curlyBrace) {
			tokens.push(this.translate(this._curlyBrace, extra));
			this._curlyBrace = null;
		}

		tokens.push(this.translate(token, extra));
	}
}

/**
 * @fileoverview A collection of methods for processing Espree's options.
 * @author Kai Cataldo
 */

/**
 * @import { EcmaVersion, Options } from "../espree.js";
 */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const SUPPORTED_VERSIONS = /** @type {const} */ ([
	3,
	5,
	6, // 2015
	7, // 2016
	8, // 2017
	9, // 2018
	10, // 2019
	11, // 2020
	12, // 2021
	13, // 2022
	14, // 2023
	15, // 2024
	16, // 2025
	17, // 2026
]);

/**
 * @typedef {typeof SUPPORTED_VERSIONS[number]} NormalizedEcmaVersion
 */

const LATEST_ECMA_VERSION =
	/* eslint-disable jsdoc/valid-types -- Bug */
	/** @type {typeof SUPPORTED_VERSIONS extends readonly [...unknown[], infer L] ? L : never} */ (
		SUPPORTED_VERSIONS.at(-1)
		/* eslint-enable jsdoc/valid-types -- Bug */
	);

/**
 * Get the latest ECMAScript version supported by Espree.
 * @returns {typeof LATEST_ECMA_VERSION} The latest ECMAScript version.
 */
function getLatestEcmaVersion() {
	return LATEST_ECMA_VERSION;
}

/**
 * Get the list of ECMAScript versions supported by Espree.
 * @returns {[...typeof SUPPORTED_VERSIONS]} An array containing the supported ECMAScript versions.
 */
function getSupportedEcmaVersions() {
	return [...SUPPORTED_VERSIONS];
}

/**
 * Normalize ECMAScript version from the initial config
 * @param {EcmaVersion} ecmaVersion ECMAScript version from the initial config
 * @throws {Error} throws an error if the ecmaVersion is invalid.
 * @returns {NormalizedEcmaVersion} normalized ECMAScript version
 */
function normalizeEcmaVersion(ecmaVersion = 5) {
	let version =
		ecmaVersion === "latest" ? getLatestEcmaVersion() : ecmaVersion;

	if (typeof version !== "number") {
		throw new Error(
			`ecmaVersion must be a number or "latest". Received value of type ${typeof ecmaVersion} instead.`,
		);
	}

	// Calculate ECMAScript edition number from official year version starting with
	// ES2015, which corresponds with ES6 (or a difference of 2009).
	if (version >= 2015) {
		version -= 2009;
	}

	if (
		!SUPPORTED_VERSIONS.includes(
			/** @type {NormalizedEcmaVersion} */
			(version),
		)
	) {
		throw new Error("Invalid ecmaVersion.");
	}

	return /** @type {NormalizedEcmaVersion} */ (version);
}

/**
 * Normalize sourceType from the initial config
 * @param {string} sourceType to normalize
 * @throws {Error} throw an error if sourceType is invalid
 * @returns {"script"|"module"|"commonjs"} normalized sourceType
 */
function normalizeSourceType(sourceType = "script") {
	if (
		sourceType === "script" ||
		sourceType === "module" ||
		sourceType === "commonjs"
	) {
		return sourceType;
	}

	throw new Error("Invalid sourceType.");
}

/**
 * @typedef {{
 *   ecmaVersion: NormalizedEcmaVersion,
 *   sourceType: "script"|"module"|"commonjs",
 *   range?: boolean,
 *   loc?: boolean,
 *   allowReserved: boolean | "never",
 *   ecmaFeatures?: {
 *     jsx?: boolean,
 *     globalReturn?: boolean,
 *     impliedStrict?: boolean
 *   },
 *   ranges: boolean,
 *   locations: boolean,
 *   allowReturnOutsideFunction: boolean,
 *   tokens?: boolean,
 *   comment?: boolean
 * }} NormalizedParserOptions
 */

/**
 * Normalize parserOptions
 * @param {Options} options the parser options to normalize
 * @throws {Error} throw an error if found invalid option.
 * @returns {NormalizedParserOptions} normalized options
 */
function normalizeOptions(options) {
	const ecmaVersion = normalizeEcmaVersion(options.ecmaVersion);
	const sourceType = normalizeSourceType(options.sourceType);
	const ranges = options.range === true;
	const locations = options.loc === true;

	if (ecmaVersion !== 3 && options.allowReserved) {
		// a value of `false` is intentionally allowed here, so a shared config can overwrite it when needed
		throw new Error(
			"`allowReserved` is only supported when ecmaVersion is 3",
		);
	}
	if (
		typeof options.allowReserved !== "undefined" &&
		typeof options.allowReserved !== "boolean"
	) {
		throw new Error(
			"`allowReserved`, when present, must be `true` or `false`",
		);
	}
	const allowReserved =
		ecmaVersion === 3 ? options.allowReserved || "never" : false;
	const ecmaFeatures = options.ecmaFeatures || {};
	const allowReturnOutsideFunction =
		options.sourceType === "commonjs" || Boolean(ecmaFeatures.globalReturn);

	if (sourceType === "module" && ecmaVersion < 6) {
		throw new Error(
			"sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options.",
		);
	}

	return Object.assign({}, options, {
		ecmaVersion,
		sourceType,
		ranges,
		locations,
		allowReserved,
		allowReturnOutsideFunction,
	});
}

/* eslint no-param-reassign: 0 -- stylistic choice */


/**
 * @import {
 *   CommentType,
 *   EspreeParserCtor,
 *   EsprimaNode,
 *   AcornJsxParserCtorEnhanced,
 *   TokTypes
 * } from "./types.js";
 * @import {
 *   Options,
 *   EspreeToken as EsprimaToken,
 *   EspreeTokens as EsprimaTokens,
 *   EspreeComment as EsprimaComment
 * } from "../espree.js";
 * @import { NormalizedEcmaVersion } from "./options.js";
 * @import * as acorn from "acorn";
 */

/**
 * @typedef {{
 *   originalSourceType: "script" | "module" | "commonjs" | undefined
 *   tokens: EsprimaToken[] | null,
 *   comments: EsprimaComment[] | null,
 *   impliedStrict: boolean,
 *   ecmaVersion: NormalizedEcmaVersion,
 *   jsxAttrValueToken: boolean,
 *   lastToken: acorn.Token | null,
 *   templateElements: acorn.TemplateElement[]
 * }} State
 */

/**
 * @typedef {{
 *   sourceType?: "script"|"module"|"commonjs";
 *   comments?: EsprimaComment[];
 *   tokens?: EsprimaToken[];
 *   body: acorn.Node[];
 * } & acorn.Program} EsprimaProgramNode
 */

// ----------------------------------------------------------------------------
// Types exported from file
// ----------------------------------------------------------------------------
/**
 * @typedef {{
 *   index?: number;
 *   lineNumber?: number;
 *   column?: number;
 * } & SyntaxError} EnhancedSyntaxError
 */

// We add `jsxAttrValueToken` ourselves.
/**
 * @typedef {{
 *   jsxAttrValueToken?: acorn.TokenType;
 * } & TokTypes} EnhancedTokTypes
 */

const STATE = Symbol("espree's internal state");
const ESPRIMA_FINISH_NODE = Symbol("espree's esprimaFinishNode");

/**
 * Converts an Acorn comment to a Esprima comment.
 * @param {boolean} block True if it's a block comment, false if not.
 * @param {string} text The text of the comment.
 * @param {number} start The index at which the comment starts.
 * @param {number} end The index at which the comment ends.
 * @param {acorn.Position | undefined} startLoc The location at which the comment starts.
 * @param {acorn.Position | undefined} endLoc The location at which the comment ends.
 * @param {string} code The source code being parsed.
 * @returns {EsprimaComment} The comment object.
 * @private
 */
function convertAcornCommentToEsprimaComment(
	block,
	text,
	start,
	end,
	startLoc,
	endLoc,
	code,
) {
	/** @type {CommentType} */
	let type;

	if (block) {
		type = "Block";
	} else if (code.slice(start, start + 2) === "#!") {
		type = "Hashbang";
	} else {
		type = "Line";
	}

	/**
	 * @type {{
	 *   type: CommentType,
	 *   value: string,
	 *   start?: number,
	 *   end?: number,
	 *   range?: [number, number],
	 *   loc?: {
	 *     start: acorn.Position | undefined,
	 *     end: acorn.Position | undefined
	 *   }
	 * }}
	 */
	const comment = {
		type,
		value: text,
	};

	if (typeof start === "number") {
		comment.start = start;
		comment.end = end;
		comment.range = [start, end];
	}

	if (typeof startLoc === "object") {
		comment.loc = {
			start: startLoc,
			end: endLoc,
		};
	}

	return comment;
}

// eslint-disable-next-line arrow-body-style -- For TS
var espree = () => {
	/**
	 * Returns the Espree parser.
	 * @param {AcornJsxParserCtorEnhanced} Parser The Acorn parser. The `acorn` property is missing from acorn's
	 *   TypeScript but is present statically on the class.
	 * @returns {EspreeParserCtor} The Espree Parser constructor.
	 */
	return Parser => {
		const tokTypes = /** @type {EnhancedTokTypes} */ (
			Object.assign({}, Parser.acorn.tokTypes)
		);

		if (Parser.acornJsx) {
			Object.assign(tokTypes, Parser.acornJsx.tokTypes);
		}

		return class Espree extends Parser {
			/**
			 * @param {Options | null | undefined} opts The parser options
			 * @param {string | object} code The code which will be converted to a string.
			 */
			constructor(opts, code) {
				if (typeof opts !== "object" || opts === null) {
					opts = {};
				}
				if (typeof code !== "string" && !(code instanceof String)) {
					code = String(code);
				}

				// save original source type in case of commonjs
				const originalSourceType = opts.sourceType;
				const options = normalizeOptions(opts);
				const ecmaFeatures = options.ecmaFeatures || {};
				const tokenTranslator =
					options.tokens === true
						? new TokenTranslator(
								tokTypes,

								// @ts-expect-error Appears to be a TS bug since the type is indeed string|String
								code,
							)
						: null;

				/**
				 * Data that is unique to Espree and is not represented internally
				 * in Acorn.
				 *
				 * For ES2023 hashbangs, Espree will call `onComment()` during the
				 * constructor, so we must define state before having access to
				 * `this`.
				 * @type {State}
				 */
				const state = {
					originalSourceType:
						originalSourceType || options.sourceType,
					tokens: tokenTranslator ? [] : null,
					comments: options.comment === true ? [] : null,
					impliedStrict:
						ecmaFeatures.impliedStrict === true &&
						options.ecmaVersion >= 5,
					ecmaVersion: options.ecmaVersion,
					jsxAttrValueToken: false,
					lastToken: null,
					templateElements: [],
				};

				// Initialize acorn parser.
				super(
					{
						// do not use spread, because we don't want to pass any unknown options to acorn
						ecmaVersion: options.ecmaVersion,
						sourceType: options.sourceType,
						ranges: options.ranges,
						locations: options.locations,
						allowReserved: options.allowReserved,

						// Truthy value is true for backward compatibility.
						allowReturnOutsideFunction:
							options.allowReturnOutsideFunction,

						// Collect tokens
						onToken(token) {
							if (tokenTranslator) {
								// Use `tokens`, `ecmaVersion`, and `jsxAttrValueToken` in the state.
								tokenTranslator.onToken(
									token,

									/**
									 * @type {Omit<State, "tokens"> & {
									 *   tokens: EsprimaToken[]
									 * }}
									 */
									(state),
								);
							}
							if (token.type !== tokTypes.eof) {
								state.lastToken = token;
							}
						},

						// Collect comments
						onComment(block, text, start, end, startLoc, endLoc) {
							if (state.comments) {
								const comment =
									convertAcornCommentToEsprimaComment(
										block,
										text,
										start,
										end,
										startLoc,
										endLoc,

										// @ts-expect-error Appears to be a TS bug
										//   since the type is indeed string|String
										code,
									);

								state.comments.push(comment);
							}
						},
					},
					// @ts-expect-error Appears to be a TS bug
					//   since the type is indeed string|String
					code,
				);

				/*
				 * We put all of this data into a symbol property as a way to avoid
				 * potential naming conflicts with future versions of Acorn.
				 */
				this[STATE] = state;
			}

			/**
			 * Returns Espree tokens.
			 * @returns {EsprimaTokens} The Esprima-compatible tokens
			 */
			tokenize() {
				do {
					this.next();
				} while (this.type !== tokTypes.eof);

				// Consume the final eof token
				this.next();

				const extra = this[STATE];
				const tokens = /** @type {EsprimaTokens} */ (extra.tokens);

				if (extra.comments) {
					tokens.comments = extra.comments;
				}

				return tokens;
			}

			/**
			 * Calls parent.
			 * @param {acorn.Node} node The node
			 * @param {string} type The type
			 * @returns {acorn.Node} The altered Node
			 */
			finishNode(node, type) {
				const result = super.finishNode(node, type);

				return this[ESPRIMA_FINISH_NODE](result);
			}

			/**
			 * Calls parent.
			 * @param {acorn.Node} node The node
			 * @param {string} type The type
			 * @param {number} pos The position
			 * @param {acorn.Position} loc The location
			 * @returns {acorn.Node} The altered Node
			 */
			finishNodeAt(node, type, pos, loc) {
				const result = super.finishNodeAt(node, type, pos, loc);

				return this[ESPRIMA_FINISH_NODE](result);
			}

			/**
			 * Parses.
			 * @returns {EsprimaProgramNode} The program Node
			 */
			parse() {
				const extra = this[STATE];
				const prog = super.parse();

				const program = /** @type {EsprimaProgramNode} */ (prog);

				// @ts-expect-error TS bug? We've already converted to `EsprimaProgramNode`
				program.sourceType = extra.originalSourceType;

				if (extra.comments) {
					program.comments = extra.comments;
				}
				if (extra.tokens) {
					program.tokens = extra.tokens;
				}

				/*
				 * https://github.com/eslint/espree/issues/349
				 * Ensure that template elements have correct range information.
				 * This is one location where Acorn produces a different value
				 * for its start and end properties vs. the values present in the
				 * range property. In order to avoid confusion, we set the start
				 * and end properties to the values that are present in range.
				 * This is done here, instead of in finishNode(), because Acorn
				 * uses the values of start and end internally while parsing, making
				 * it dangerous to change those values while parsing is ongoing.
				 * By waiting until the end of parsing, we can safely change these
				 * values without affect any other part of the process.
				 */
				this[STATE].templateElements.forEach(templateElement => {
					const startOffset = -1;
					const endOffset = templateElement.tail ? 1 : 2;

					templateElement.start += startOffset;
					templateElement.end += endOffset;

					if (templateElement.range) {
						templateElement.range[0] += startOffset;
						templateElement.range[1] += endOffset;
					}

					if (templateElement.loc) {
						templateElement.loc.start.column += startOffset;
						templateElement.loc.end.column += endOffset;
					}
				});

				return program;
			}

			/**
			 * Parses top level.
			 * @param {acorn.Node} node AST Node
			 * @returns {acorn.Node} The changed node
			 */
			parseTopLevel(node) {
				if (this[STATE].impliedStrict) {
					this.strict = true;
				}
				return super.parseTopLevel(node);
			}

			/**
			 * Overwrites the default raise method to throw Esprima-style errors.
			 * @param {number} pos The position of the error.
			 * @param {string} message The error message.
			 * @throws {EnhancedSyntaxError} A syntax error.
			 * @returns {void}
			 */
			raise(pos, message) {
				const loc = Parser.acorn.getLineInfo(this.input, pos);
				const err = /** @type {EnhancedSyntaxError} */ (
					new SyntaxError(message)
				);

				err.index = pos;
				err.lineNumber = loc.line;
				err.column = loc.column + 1; // acorn uses 0-based columns
				throw err;
			}

			/**
			 * Overwrites the default raise method to throw Esprima-style errors.
			 * @param {number} pos The position of the error.
			 * @param {string} message The error message.
			 * @throws {SyntaxError} A syntax error.
			 * @returns {void}
			 */
			raiseRecoverable(pos, message) {
				this.raise(pos, message);
			}

			/**
			 * Overwrites the default unexpected method to throw Esprima-style errors.
			 * @param {number} pos The position of the error.
			 * @throws {SyntaxError} A syntax error.
			 * @returns {void}
			 */
			unexpected(pos) {
				let message = "Unexpected token";

				if (pos !== null && pos !== void 0) {
					this.pos = pos;

					if (this.options.locations) {
						while (this.pos < this.lineStart) {
							this.lineStart =
								this.input.lastIndexOf(
									"\n",
									this.lineStart - 2,
								) + 1;
							--this.curLine;
						}
					}

					this.nextToken();
				}

				if (this.end > this.start) {
					message += ` ${this.input.slice(this.start, this.end)}`;
				}

				this.raise(this.start, message);
			}

			/**
			 * Esprima-FB represents JSX strings as tokens called "JSXText", but Acorn-JSX
			 * uses regular tt.string without any distinction between this and regular JS
			 * strings. As such, we intercept an attempt to read a JSX string and set a flag
			 * on extra so that when tokens are converted, the next token will be switched
			 * to JSXText via onToken.
			 * @param {number} quote A character code
			 * @returns {void}
			 */ // eslint-disable-next-line camelcase -- required by API
			jsx_readString(quote) {
				const result = super.jsx_readString(quote);

				if (this.type === tokTypes.string) {
					this[STATE].jsxAttrValueToken = true;
				}
				return result;
			}

			/**
			 * Performs last-minute Esprima-specific compatibility checks and fixes.
			 * @param {acorn.Node} result The node to check.
			 * @returns {EsprimaNode} The finished node.
			 */
			[ESPRIMA_FINISH_NODE](result) {
				// Acorn doesn't count the opening and closing backticks as part of templates
				// so we have to adjust ranges/locations appropriately.
				if (result.type === "TemplateElement") {
					// save template element references to fix start/end later
					this[STATE].templateElements.push(
						/** @type {acorn.TemplateElement} */
						(result),
					);
				}

				if (
					result.type.includes("Function") &&
					!("generator" in result)
				) {
					/**
					 * @type {acorn.FunctionDeclaration|acorn.FunctionExpression|
					 *   acorn.ArrowFunctionExpression}
					 */
					(result).generator = false;
				}

				return result;
			}
		};
	};
};

/**
 * @fileoverview Main Espree file that converts Acorn into Esprima output.
 *
 * This file contains code from the following MIT-licensed projects:
 * 1. Acorn
 * 2. Babylon
 * 3. Babel-ESLint
 *
 * This file also contains code from Esprima, which is BSD licensed.
 *
 * Acorn is Copyright 2012-2015 Acorn Contributors (https://github.com/marijnh/acorn/blob/master/AUTHORS)
 * Babylon is Copyright 2014-2015 various contributors (https://github.com/babel/babel/blob/master/packages/babylon/AUTHORS)
 * Babel-ESLint is Copyright 2014-2015 Sebastian McKenzie <sebmck@gmail.com>
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * * Redistributions of source code must retain the above copyright
 *   notice, this list of conditions and the following disclaimer.
 * * Redistributions in binary form must reproduce the above copyright
 *   notice, this list of conditions and the following disclaimer in the
 *   documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * Esprima is Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   * Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *   * Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in the
 *     documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */


/**
 * @import { EspreeParserCtor, EspreeParserJsxCtor } from "./lib/types.js";
 */

// ----------------------------------------------------------------------------
// Types exported from file
// ----------------------------------------------------------------------------
/**
 * @typedef {3|5|6|7|8|9|10|11|12|13|14|15|16|17|2015|2016|2017|2018|2019|2020|2021|2022|2023|2024|2025|2026|'latest'} EcmaVersion
 */

/**
 * @typedef {{
 *   type: string;
 *   value: any;
 *   start?: number;
 *   end?: number;
 *   loc?: acorn.SourceLocation;
 *   range?: [number, number];
 *   regex?: {flags: string, pattern: string};
 * }} EspreeToken
 */

/**
 * @typedef {{
 *   type: "Block" | "Hashbang" | "Line",
 *   value: string,
 *   range?: [number, number],
 *   start?: number,
 *   end?: number,
 *   loc?: {
 *     start: acorn.Position | undefined,
 *     end: acorn.Position | undefined
 *   }
 * }} EspreeComment
 */

/**
 * @typedef {{
 *   comments?: EspreeComment[]
 * } & EspreeToken[]} EspreeTokens
 */

/**
 * `allowReserved` is as in `acorn.Options`
 *
 * `ecmaVersion` currently as in `acorn.Options` though optional
 *
 * `sourceType` as in `acorn.Options` but also allows `commonjs`
 *
 * `ecmaFeatures`, `range`, `loc`, `tokens` are not in `acorn.Options`
 *
 * `comment` is not in `acorn.Options` and doesn't err without it, but is used
 */
/**
 * @typedef {{
 *   allowReserved?: boolean,
 *   ecmaVersion?: EcmaVersion,
 *   sourceType?: "script"|"module"|"commonjs",
 *   ecmaFeatures?: {
 *     jsx?: boolean,
 *     globalReturn?: boolean,
 *     impliedStrict?: boolean
 *   },
 *   range?: boolean,
 *   loc?: boolean,
 *   tokens?: boolean,
 *   comment?: boolean,
 * }} Options
 */

// To initialize lazily.
const parsers = {
	/** @type {EspreeParserCtor|null} */
	_regular: null,

	/** @type {EspreeParserJsxCtor|null} */
	_jsx: null,

	/**
	 * Returns regular Parser
	 * @returns {EspreeParserCtor} Regular Acorn parser
	 */
	get regular() {
		if (this._regular === null) {
			const espreeParserFactory = /** @type {unknown} */ (espree());

			this._regular = /** @type {EspreeParserCtor} */ (
				// Without conversion, types are incompatible, as
				// acorn's has a protected constructor
				/** @type {unknown} */
				(
					acorn__namespace.Parser.extend(
						/**
						 * @type {(
						 *   BaseParser: typeof acorn.Parser
						 * ) => typeof acorn.Parser}
						 */ (espreeParserFactory),
					)
				)
			);
		}
		return this._regular;
	},

	/**
	 * Returns JSX Parser
	 * @returns {EspreeParserJsxCtor} JSX Acorn parser
	 */
	get jsx() {
		if (this._jsx === null) {
			const espreeParserFactory = /** @type {unknown} */ (espree());
			const jsxFactory = jsx();

			this._jsx = /** @type {EspreeParserJsxCtor} */ (
				// Without conversion, types are incompatible, as
				// acorn's has a protected constructor
				/** @type {unknown} */
				(
					acorn__namespace.Parser.extend(
						jsxFactory,

						/** @type {(BaseParser: typeof acorn.Parser) => typeof acorn.Parser} */
						(espreeParserFactory),
					)
				)
			);
		}
		return this._jsx;
	},

	/**
	 * Gets the parser object based on the supplied options.
	 * @param {Options} [options] The parser options.
	 * @returns {EspreeParserJsxCtor|EspreeParserCtor} Regular or JSX Acorn parser
	 */
	get(options) {
		const useJsx = Boolean(
			options && options.ecmaFeatures && options.ecmaFeatures.jsx,
		);

		return useJsx ? this.jsx : this.regular;
	},
};

//------------------------------------------------------------------------------
// Tokenizer
//------------------------------------------------------------------------------

/**
 * Tokenizes the given code.
 * @param {string} code The code to tokenize.
 * @param {Options} [options] Options defining how to tokenize.
 * @returns {EspreeTokens} An array of tokens.
 * @throws {EnhancedSyntaxError} If the input code is invalid.
 * @private
 */
function tokenize(code, options) {
	const Parser = parsers.get(options);

	// Ensure to collect tokens.
	if (!options || options.tokens !== true) {
		options = Object.assign({}, options, { tokens: true }); // eslint-disable-line no-param-reassign -- stylistic choice
	}

	return /** @type {EspreeTokens} */ (new Parser(options, code).tokenize());
}

//------------------------------------------------------------------------------
// Parser
//------------------------------------------------------------------------------

/**
 * Parses the given code.
 * @param {string} code The code to tokenize.
 * @param {Options} [options] Options defining how to tokenize.
 * @returns {acorn.Program} The "Program" AST node.
 * @throws {EnhancedSyntaxError} If the input code is invalid.
 */
function parse(code, options) {
	const Parser = parsers.get(options);

	return new Parser(options, code).parse();
}

//------------------------------------------------------------------------------
// Public
//------------------------------------------------------------------------------

/** @type {string} */
const version = "11.2.0"; // x-release-please-version
const name = "espree";

// Derive node types from VisitorKeys
const Syntax = /* #__PURE__ */ (function () {
	let key,
		/** @type {Record<string,string>} */
		types = {};

	if (typeof Object.create === "function") {
		types = Object.create(null);
	}

	for (key in eslintVisitorKeys.KEYS) {
		if (Object.hasOwn(eslintVisitorKeys.KEYS, key)) {
			types[key] = key;
		}
	}

	if (typeof Object.freeze === "function") {
		Object.freeze(types);
	}

	return types;
})();

const latestEcmaVersion = /* #__PURE__ */ getLatestEcmaVersion();

const supportedEcmaVersions = /* #__PURE__ */ getSupportedEcmaVersions();

Object.defineProperty(exports, "VisitorKeys", {
	enumerable: true,
	get: function () { return eslintVisitorKeys.KEYS; }
});
exports.Syntax = Syntax;
exports.latestEcmaVersion = latestEcmaVersion;
exports.name = name;
exports.parse = parse;
exports.supportedEcmaVersions = supportedEcmaVersions;
exports.tokenize = tokenize;
exports.version = version;
ioֽx] import * as espree from "./espree.js";
export = espree;
//# sourceMappingURL=espree.d.cts.map%	x `{"version":3,"file":"espree.d.cts","sourceRoot":"","sources":["../espree.cts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,SAAS,MAAM,CAAC"}ָ02xf/**
 * Tokenizes the given code.
 * @param {string} code The code to tokenize.
 * @param {Options} [options] Options defining how to tokenize.
 * @returns {EspreeTokens} An array of tokens.
 * @throws {EnhancedSyntaxError} If the input code is invalid.
 * @private
 */
export function tokenize(code: string, options?: Options): EspreeTokens;
/**
 * Parses the given code.
 * @param {string} code The code to tokenize.
 * @param {Options} [options] Options defining how to tokenize.
 * @returns {acorn.Program} The "Program" AST node.
 * @throws {EnhancedSyntaxError} If the input code is invalid.
 */
export function parse(code: string, options?: Options): acorn.Program;
/** @type {string} */
export const version: string;
export const name: "espree";
export const Syntax: Record<string, string>;
export const latestEcmaVersion: 17;
export const supportedEcmaVersions: [3, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17];
export { KEYS as VisitorKeys } from "eslint-visitor-keys";
export type EcmaVersion = 3 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 2015 | 2016 | 2017 | 2018 | 2019 | 2020 | 2021 | 2022 | 2023 | 2024 | 2025 | 2026 | "latest";
export type EspreeToken = {
    type: string;
    value: any;
    start?: number;
    end?: number;
    loc?: acorn.SourceLocation;
    range?: [number, number];
    regex?: {
        flags: string;
        pattern: string;
    };
};
export type EspreeComment = {
    type: "Block" | "Hashbang" | "Line";
    value: string;
    range?: [number, number];
    start?: number;
    end?: number;
    loc?: {
        start: acorn.Position | undefined;
        end: acorn.Position | undefined;
    };
};
export type EspreeTokens = {
    comments?: EspreeComment[];
} & EspreeToken[];
export type Options = {
    allowReserved?: boolean;
    ecmaVersion?: EcmaVersion;
    sourceType?: "script" | "module" | "commonjs";
    ecmaFeatures?: {
        jsx?: boolean;
        globalReturn?: boolean;
        impliedStrict?: boolean;
    };
    range?: boolean;
    loc?: boolean;
    tokens?: boolean;
    comment?: boolean;
};
import * as acorn from "acorn";
//# sourceMappingURL=espree.d.ts.mapZDvgxr{"version":3,"file":"espree.d.ts","sourceRoot":"","sources":["../espree.js"],"names":[],"mappings":"AAuNA;;;;;;;GAOG;AACH,+BANW,MAAM,YACN,OAAO,GACL,YAAY,CAaxB;AAMD;;;;;;GAMG;AACH,4BALW,MAAM,YACN,OAAO,GACL,KAAK,CAAC,OAAO,CAOzB;AAMD,qBAAqB;AACrB,sBADW,MAAM,CACe;AAChC,mBAAoB,QAAQ,CAAC;AAG7B,4CAoBK;AAEL,mCAAwE;AAExE,uFAAgF;;0BAlNnE,CAAC,GAAC,CAAC,GAAC,CAAC,GAAC,CAAC,GAAC,CAAC,GAAC,CAAC,GAAC,EAAE,GAAC,EAAE,GAAC,EAAE,GAAC,EAAE,GAAC,EAAE,GAAC,EAAE,GAAC,EAAE,GAAC,EAAE,GAAC,IAAI,GAAC,IAAI,GAAC,IAAI,GAAC,IAAI,GAAC,IAAI,GAAC,IAAI,GAAC,IAAI,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,CAAC,EAAE,OAAO,CAAC;IACjB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;uBA7EmB,OAAO"}{x#/**
 * @fileoverview Main Espree file that converts Acorn into Esprima output.
 *
 * This file contains code from the following MIT-licensed projects:
 * 1. Acorn
 * 2. Babylon
 * 3. Babel-ESLint
 *
 * This file also contains code from Esprima, which is BSD licensed.
 *
 * Acorn is Copyright 2012-2015 Acorn Contributors (https://github.com/marijnh/acorn/blob/master/AUTHORS)
 * Babylon is Copyright 2014-2015 various contributors (https://github.com/babel/babel/blob/master/packages/babylon/AUTHORS)
 * Babel-ESLint is Copyright 2014-2015 Sebastian McKenzie <sebmck@gmail.com>
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * * Redistributions of source code must retain the above copyright
 *   notice, this list of conditions and the following disclaimer.
 * * Redistributions in binary form must reproduce the above copyright
 *   notice, this list of conditions and the following disclaimer in the
 *   documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * Esprima is Copyright (c) jQuery Foundation, Inc. and Contributors, All Rights Reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 *   * Redistributions of source code must retain the above copyright
 *     notice, this list of conditions and the following disclaimer.
 *   * Redistributions in binary form must reproduce the above copyright
 *     notice, this list of conditions and the following disclaimer in the
 *     documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

import * as acorn from "acorn";
import jsx from "acorn-jsx";
import espree from "./lib/espree.js";
import { KEYS as VisitorKeys } from "eslint-visitor-keys";
import {
	getLatestEcmaVersion,
	getSupportedEcmaVersions,
} from "./lib/options.js";

/**
 * @import { EspreeParserCtor, EspreeParserJsxCtor } from "./lib/types.js";
 */

// ----------------------------------------------------------------------------
// Types exported from file
// ----------------------------------------------------------------------------
/**
 * @typedef {3|5|6|7|8|9|10|11|12|13|14|15|16|17|2015|2016|2017|2018|2019|2020|2021|2022|2023|2024|2025|2026|'latest'} EcmaVersion
 */

/**
 * @typedef {{
 *   type: string;
 *   value: any;
 *   start?: number;
 *   end?: number;
 *   loc?: acorn.SourceLocation;
 *   range?: [number, number];
 *   regex?: {flags: string, pattern: string};
 * }} EspreeToken
 */

/**
 * @typedef {{
 *   type: "Block" | "Hashbang" | "Line",
 *   value: string,
 *   range?: [number, number],
 *   start?: number,
 *   end?: number,
 *   loc?: {
 *     start: acorn.Position | undefined,
 *     end: acorn.Position | undefined
 *   }
 * }} EspreeComment
 */

/**
 * @typedef {{
 *   comments?: EspreeComment[]
 * } & EspreeToken[]} EspreeTokens
 */

/**
 * `allowReserved` is as in `acorn.Options`
 *
 * `ecmaVersion` currently as in `acorn.Options` though optional
 *
 * `sourceType` as in `acorn.Options` but also allows `commonjs`
 *
 * `ecmaFeatures`, `range`, `loc`, `tokens` are not in `acorn.Options`
 *
 * `comment` is not in `acorn.Options` and doesn't err without it, but is used
 */
/**
 * @typedef {{
 *   allowReserved?: boolean,
 *   ecmaVersion?: EcmaVersion,
 *   sourceType?: "script"|"module"|"commonjs",
 *   ecmaFeatures?: {
 *     jsx?: boolean,
 *     globalReturn?: boolean,
 *     impliedStrict?: boolean
 *   },
 *   range?: boolean,
 *   loc?: boolean,
 *   tokens?: boolean,
 *   comment?: boolean,
 * }} Options
 */

// To initialize lazily.
const parsers = {
	/** @type {EspreeParserCtor|null} */
	_regular: null,

	/** @type {EspreeParserJsxCtor|null} */
	_jsx: null,

	/**
	 * Returns regular Parser
	 * @returns {EspreeParserCtor} Regular Acorn parser
	 */
	get regular() {
		if (this._regular === null) {
			const espreeParserFactory = /** @type {unknown} */ (espree());

			this._regular = /** @type {EspreeParserCtor} */ (
				// Without conversion, types are incompatible, as
				// acorn's has a protected constructor
				/** @type {unknown} */
				(
					acorn.Parser.extend(
						/**
						 * @type {(
						 *   BaseParser: typeof acorn.Parser
						 * ) => typeof acorn.Parser}
						 */ (espreeParserFactory),
					)
				)
			);
		}
		return this._regular;
	},

	/**
	 * Returns JSX Parser
	 * @returns {EspreeParserJsxCtor} JSX Acorn parser
	 */
	get jsx() {
		if (this._jsx === null) {
			const espreeParserFactory = /** @type {unknown} */ (espree());
			const jsxFactory = jsx();

			this._jsx = /** @type {EspreeParserJsxCtor} */ (
				// Without conversion, types are incompatible, as
				// acorn's has a protected constructor
				/** @type {unknown} */
				(
					acorn.Parser.extend(
						jsxFactory,

						/** @type {(BaseParser: typeof acorn.Parser) => typeof acorn.Parser} */
						(espreeParserFactory),
					)
				)
			);
		}
		return this._jsx;
	},

	/**
	 * Gets the parser object based on the supplied options.
	 * @param {Options} [options] The parser options.
	 * @returns {EspreeParserJsxCtor|EspreeParserCtor} Regular or JSX Acorn parser
	 */
	get(options) {
		const useJsx = Boolean(
			options && options.ecmaFeatures && options.ecmaFeatures.jsx,
		);

		return useJsx ? this.jsx : this.regular;
	},
};

//------------------------------------------------------------------------------
// Tokenizer
//------------------------------------------------------------------------------

/**
 * Tokenizes the given code.
 * @param {string} code The code to tokenize.
 * @param {Options} [options] Options defining how to tokenize.
 * @returns {EspreeTokens} An array of tokens.
 * @throws {EnhancedSyntaxError} If the input code is invalid.
 * @private
 */
export function tokenize(code, options) {
	const Parser = parsers.get(options);

	// Ensure to collect tokens.
	if (!options || options.tokens !== true) {
		options = Object.assign({}, options, { tokens: true }); // eslint-disable-line no-param-reassign -- stylistic choice
	}

	return /** @type {EspreeTokens} */ (new Parser(options, code).tokenize());
}

//------------------------------------------------------------------------------
// Parser
//------------------------------------------------------------------------------

/**
 * Parses the given code.
 * @param {string} code The code to tokenize.
 * @param {Options} [options] Options defining how to tokenize.
 * @returns {acorn.Program} The "Program" AST node.
 * @throws {EnhancedSyntaxError} If the input code is invalid.
 */
export function parse(code, options) {
	const Parser = parsers.get(options);

	return new Parser(options, code).parse();
}

//------------------------------------------------------------------------------
// Public
//------------------------------------------------------------------------------

/** @type {string} */
export const version = "11.2.0"; // x-release-please-version
export const name = "espree";

// Derive node types from VisitorKeys
export const Syntax = /* #__PURE__ */ (function () {
	let key,
		/** @type {Record<string,string>} */
		types = {};

	if (typeof Object.create === "function") {
		types = Object.create(null);
	}

	for (key in VisitorKeys) {
		if (Object.hasOwn(VisitorKeys, key)) {
			types[key] = key;
		}
	}

	if (typeof Object.freeze === "function") {
		Object.freeze(types);
	}

	return types;
})();

export const latestEcmaVersion = /* #__PURE__ */ getLatestEcmaVersion();

export const supportedEcmaVersions = /* #__PURE__ */ getSupportedEcmaVersions();

export { KEYS as VisitorKeys } from "eslint-visitor-keys";
-튮	x a100644 espree.js Ȩ7dKp<Q nC100644 options.js 'ΰn
Wk)3100644 token-translator.js 3kc;)̠m100644 types.js zFx'Kǰ5nҫ4AVx3/* eslint no-param-reassign: 0 -- stylistic choice */

import TokenTranslator from "./token-translator.js";
import { normalizeOptions } from "./options.js";

/**
 * @import {
 *   CommentType,
 *   EspreeParserCtor,
 *   EsprimaNode,
 *   AcornJsxParserCtorEnhanced,
 *   TokTypes
 * } from "./types.js";
 * @import {
 *   Options,
 *   EspreeToken as EsprimaToken,
 *   EspreeTokens as EsprimaTokens,
 *   EspreeComment as EsprimaComment
 * } from "../espree.js";
 * @import { NormalizedEcmaVersion } from "./options.js";
 * @import * as acorn from "acorn";
 */

/**
 * @typedef {{
 *   originalSourceType: "script" | "module" | "commonjs" | undefined
 *   tokens: EsprimaToken[] | null,
 *   comments: EsprimaComment[] | null,
 *   impliedStrict: boolean,
 *   ecmaVersion: NormalizedEcmaVersion,
 *   jsxAttrValueToken: boolean,
 *   lastToken: acorn.Token | null,
 *   templateElements: acorn.TemplateElement[]
 * }} State
 */

/**
 * @typedef {{
 *   sourceType?: "script"|"module"|"commonjs";
 *   comments?: EsprimaComment[];
 *   tokens?: EsprimaToken[];
 *   body: acorn.Node[];
 * } & acorn.Program} EsprimaProgramNode
 */

// ----------------------------------------------------------------------------
// Types exported from file
// ----------------------------------------------------------------------------
/**
 * @typedef {{
 *   index?: number;
 *   lineNumber?: number;
 *   column?: number;
 * } & SyntaxError} EnhancedSyntaxError
 */

// We add `jsxAttrValueToken` ourselves.
/**
 * @typedef {{
 *   jsxAttrValueToken?: acorn.TokenType;
 * } & TokTypes} EnhancedTokTypes
 */

const STATE = Symbol("espree's internal state");
const ESPRIMA_FINISH_NODE = Symbol("espree's esprimaFinishNode");

/**
 * Converts an Acorn comment to a Esprima comment.
 * @param {boolean} block True if it's a block comment, false if not.
 * @param {string} text The text of the comment.
 * @param {number} start The index at which the comment starts.
 * @param {number} end The index at which the comment ends.
 * @param {acorn.Position | undefined} startLoc The location at which the comment starts.
 * @param {acorn.Position | undefined} endLoc The location at which the comment ends.
 * @param {string} code The source code being parsed.
 * @returns {EsprimaComment} The comment object.
 * @private
 */
function convertAcornCommentToEsprimaComment(
	block,
	text,
	start,
	end,
	startLoc,
	endLoc,
	code,
) {
	/** @type {CommentType} */
	let type;

	if (block) {
		type = "Block";
	} else if (code.slice(start, start + 2) === "#!") {
		type = "Hashbang";
	} else {
		type = "Line";
	}

	/**
	 * @type {{
	 *   type: CommentType,
	 *   value: string,
	 *   start?: number,
	 *   end?: number,
	 *   range?: [number, number],
	 *   loc?: {
	 *     start: acorn.Position | undefined,
	 *     end: acorn.Position | undefined
	 *   }
	 * }}
	 */
	const comment = {
		type,
		value: text,
	};

	if (typeof start === "number") {
		comment.start = start;
		comment.end = end;
		comment.range = [start, end];
	}

	if (typeof startLoc === "object") {
		comment.loc = {
			start: startLoc,
			end: endLoc,
		};
	}

	return comment;
}

// eslint-disable-next-line arrow-body-style -- For TS
export default () => {
	/**
	 * Returns the Espree parser.
	 * @param {AcornJsxParserCtorEnhanced} Parser The Acorn parser. The `acorn` property is missing from acorn's
	 *   TypeScript but is present statically on the class.
	 * @returns {EspreeParserCtor} The Espree Parser constructor.
	 */
	return Parser => {
		const tokTypes = /** @type {EnhancedTokTypes} */ (
			Object.assign({}, Parser.acorn.tokTypes)
		);

		if (Parser.acornJsx) {
			Object.assign(tokTypes, Parser.acornJsx.tokTypes);
		}

		return class Espree extends Parser {
			/**
			 * @param {Options | null | undefined} opts The parser options
			 * @param {string | object} code The code which will be converted to a string.
			 */
			constructor(opts, code) {
				if (typeof opts !== "object" || opts === null) {
					opts = {};
				}
				if (typeof code !== "string" && !(code instanceof String)) {
					code = String(code);
				}

				// save original source type in case of commonjs
				const originalSourceType = opts.sourceType;
				const options = normalizeOptions(opts);
				const ecmaFeatures = options.ecmaFeatures || {};
				const tokenTranslator =
					options.tokens === true
						? new TokenTranslator(
								tokTypes,

								// @ts-expect-error Appears to be a TS bug since the type is indeed string|String
								code,
							)
						: null;

				/**
				 * Data that is unique to Espree and is not represented internally
				 * in Acorn.
				 *
				 * For ES2023 hashbangs, Espree will call `onComment()` during the
				 * constructor, so we must define state before having access to
				 * `this`.
				 * @type {State}
				 */
				const state = {
					originalSourceType:
						originalSourceType || options.sourceType,
					tokens: tokenTranslator ? [] : null,
					comments: options.comment === true ? [] : null,
					impliedStrict:
						ecmaFeatures.impliedStrict === true &&
						options.ecmaVersion >= 5,
					ecmaVersion: options.ecmaVersion,
					jsxAttrValueToken: false,
					lastToken: null,
					templateElements: [],
				};

				// Initialize acorn parser.
				super(
					{
						// do not use spread, because we don't want to pass any unknown options to acorn
						ecmaVersion: options.ecmaVersion,
						sourceType: options.sourceType,
						ranges: options.ranges,
						locations: options.locations,
						allowReserved: options.allowReserved,

						// Truthy value is true for backward compatibility.
						allowReturnOutsideFunction:
							options.allowReturnOutsideFunction,

						// Collect tokens
						onToken(token) {
							if (tokenTranslator) {
								// Use `tokens`, `ecmaVersion`, and `jsxAttrValueToken` in the state.
								tokenTranslator.onToken(
									token,

									/**
									 * @type {Omit<State, "tokens"> & {
									 *   tokens: EsprimaToken[]
									 * }}
									 */
									(state),
								);
							}
							if (token.type !== tokTypes.eof) {
								state.lastToken = token;
							}
						},

						// Collect comments
						onComment(block, text, start, end, startLoc, endLoc) {
							if (state.comments) {
								const comment =
									convertAcornCommentToEsprimaComment(
										block,
										text,
										start,
										end,
										startLoc,
										endLoc,

										// @ts-expect-error Appears to be a TS bug
										//   since the type is indeed string|String
										code,
									);

								state.comments.push(comment);
							}
						},
					},
					// @ts-expect-error Appears to be a TS bug
					//   since the type is indeed string|String
					code,
				);

				/*
				 * We put all of this data into a symbol property as a way to avoid
				 * potential naming conflicts with future versions of Acorn.
				 */
				this[STATE] = state;
			}

			/**
			 * Returns Espree tokens.
			 * @returns {EsprimaTokens} The Esprima-compatible tokens
			 */
			tokenize() {
				do {
					this.next();
				} while (this.type !== tokTypes.eof);

				// Consume the final eof token
				this.next();

				const extra = this[STATE];
				const tokens = /** @type {EsprimaTokens} */ (extra.tokens);

				if (extra.comments) {
					tokens.comments = extra.comments;
				}

				return tokens;
			}

			/**
			 * Calls parent.
			 * @param {acorn.Node} node The node
			 * @param {string} type The type
			 * @returns {acorn.Node} The altered Node
			 */
			finishNode(node, type) {
				const result = super.finishNode(node, type);

				return this[ESPRIMA_FINISH_NODE](result);
			}

			/**
			 * Calls parent.
			 * @param {acorn.Node} node The node
			 * @param {string} type The type
			 * @param {number} pos The position
			 * @param {acorn.Position} loc The location
			 * @returns {acorn.Node} The altered Node
			 */
			finishNodeAt(node, type, pos, loc) {
				const result = super.finishNodeAt(node, type, pos, loc);

				return this[ESPRIMA_FINISH_NODE](result);
			}

			/**
			 * Parses.
			 * @returns {EsprimaProgramNode} The program Node
			 */
			parse() {
				const extra = this[STATE];
				const prog = super.parse();

				const program = /** @type {EsprimaProgramNode} */ (prog);

				// @ts-expect-error TS bug? We've already converted to `EsprimaProgramNode`
				program.sourceType = extra.originalSourceType;

				if (extra.comments) {
					program.comments = extra.comments;
				}
				if (extra.tokens) {
					program.tokens = extra.tokens;
				}

				/*
				 * https://github.com/eslint/espree/issues/349
				 * Ensure that template elements have correct range information.
				 * This is one location where Acorn produces a different value
				 * for its start and end properties vs. the values present in the
				 * range property. In order to avoid confusion, we set the start
				 * and end properties to the values that are present in range.
				 * This is done here, instead of in finishNode(), because Acorn
				 * uses the values of start and end internally while parsing, making
				 * it dangerous to change those values while parsing is ongoing.
				 * By waiting until the end of parsing, we can safely change these
				 * values without affect any other part of the process.
				 */
				this[STATE].templateElements.forEach(templateElement => {
					const startOffset = -1;
					const endOffset = templateElement.tail ? 1 : 2;

					templateElement.start += startOffset;
					templateElement.end += endOffset;

					if (templateElement.range) {
						templateElement.range[0] += startOffset;
						templateElement.range[1] += endOffset;
					}

					if (templateElement.loc) {
						templateElement.loc.start.column += startOffset;
						templateElement.loc.end.column += endOffset;
					}
				});

				return program;
			}

			/**
			 * Parses top level.
			 * @param {acorn.Node} node AST Node
			 * @returns {acorn.Node} The changed node
			 */
			parseTopLevel(node) {
				if (this[STATE].impliedStrict) {
					this.strict = true;
				}
				return super.parseTopLevel(node);
			}

			/**
			 * Overwrites the default raise method to throw Esprima-style errors.
			 * @param {number} pos The position of the error.
			 * @param {string} message The error message.
			 * @throws {EnhancedSyntaxError} A syntax error.
			 * @returns {void}
			 */
			raise(pos, message) {
				const loc = Parser.acorn.getLineInfo(this.input, pos);
				const err = /** @type {EnhancedSyntaxError} */ (
					new SyntaxError(message)
				);

				err.index = pos;
				err.lineNumber = loc.line;
				err.column = loc.column + 1; // acorn uses 0-based columns
				throw err;
			}

			/**
			 * Overwrites the default raise method to throw Esprima-style errors.
			 * @param {number} pos The position of the error.
			 * @param {string} message The error message.
			 * @throws {SyntaxError} A syntax error.
			 * @returns {void}
			 */
			raiseRecoverable(pos, message) {
				this.raise(pos, message);
			}

			/**
			 * Overwrites the default unexpected method to throw Esprima-style errors.
			 * @param {number} pos The position of the error.
			 * @throws {SyntaxError} A syntax error.
			 * @returns {void}
			 */
			unexpected(pos) {
				let message = "Unexpected token";

				if (pos !== null && pos !== void 0) {
					this.pos = pos;

					if (this.options.locations) {
						while (this.pos < this.lineStart) {
							this.lineStart =
								this.input.lastIndexOf(
									"\n",
									this.lineStart - 2,
								) + 1;
							--this.curLine;
						}
					}

					this.nextToken();
				}

				if (this.end > this.start) {
					message += ` ${this.input.slice(this.start, this.end)}`;
				}

				this.raise(this.start, message);
			}

			/**
			 * Esprima-FB represents JSX strings as tokens called "JSXText", but Acorn-JSX
			 * uses regular tt.string without any distinction between this and regular JS
			 * strings. As such, we intercept an attempt to read a JSX string and set a flag
			 * on extra so that when tokens are converted, the next token will be switched
			 * to JSXText via onToken.
			 * @param {number} quote A character code
			 * @returns {void}
			 */ // eslint-disable-next-line camelcase -- required by API
			jsx_readString(quote) {
				const result = super.jsx_readString(quote);

				if (this.type === tokTypes.string) {
					this[STATE].jsxAttrValueToken = true;
				}
				return result;
			}

			/**
			 * Performs last-minute Esprima-specific compatibility checks and fixes.
			 * @param {acorn.Node} result The node to check.
			 * @returns {EsprimaNode} The finished node.
			 */
			[ESPRIMA_FINISH_NODE](result) {
				// Acorn doesn't count the opening and closing backticks as part of templates
				// so we have to adjust ranges/locations appropriately.
				if (result.type === "TemplateElement") {
					// save template element references to fix start/end later
					this[STATE].templateElements.push(
						/** @type {acorn.TemplateElement} */
						(result),
					);
				}

				if (
					result.type.includes("Function") &&
					!("generator" in result)
				) {
					/**
					 * @type {acorn.FunctionDeclaration|acorn.FunctionExpression|
					 *   acorn.ArrowFunctionExpression}
					 */
					(result).generator = false;
				}

				return result;
			}
		};
	};
};
qʧxv/**
 * @fileoverview A collection of methods for processing Espree's options.
 * @author Kai Cataldo
 */

/**
 * @import { EcmaVersion, Options } from "../espree.js";
 */

//------------------------------------------------------------------------------
// Helpers
//------------------------------------------------------------------------------

const SUPPORTED_VERSIONS = /** @type {const} */ ([
	3,
	5,
	6, // 2015
	7, // 2016
	8, // 2017
	9, // 2018
	10, // 2019
	11, // 2020
	12, // 2021
	13, // 2022
	14, // 2023
	15, // 2024
	16, // 2025
	17, // 2026
]);

/**
 * @typedef {typeof SUPPORTED_VERSIONS[number]} NormalizedEcmaVersion
 */

const LATEST_ECMA_VERSION =
	/* eslint-disable jsdoc/valid-types -- Bug */
	/** @type {typeof SUPPORTED_VERSIONS extends readonly [...unknown[], infer L] ? L : never} */ (
		SUPPORTED_VERSIONS.at(-1)
		/* eslint-enable jsdoc/valid-types -- Bug */
	);

/**
 * Get the latest ECMAScript version supported by Espree.
 * @returns {typeof LATEST_ECMA_VERSION} The latest ECMAScript version.
 */
export function getLatestEcmaVersion() {
	return LATEST_ECMA_VERSION;
}

/**
 * Get the list of ECMAScript versions supported by Espree.
 * @returns {[...typeof SUPPORTED_VERSIONS]} An array containing the supported ECMAScript versions.
 */
export function getSupportedEcmaVersions() {
	return [...SUPPORTED_VERSIONS];
}

/**
 * Normalize ECMAScript version from the initial config
 * @param {EcmaVersion} ecmaVersion ECMAScript version from the initial config
 * @throws {Error} throws an error if the ecmaVersion is invalid.
 * @returns {NormalizedEcmaVersion} normalized ECMAScript version
 */
function normalizeEcmaVersion(ecmaVersion = 5) {
	let version =
		ecmaVersion === "latest" ? getLatestEcmaVersion() : ecmaVersion;

	if (typeof version !== "number") {
		throw new Error(
			`ecmaVersion must be a number or "latest". Received value of type ${typeof ecmaVersion} instead.`,
		);
	}

	// Calculate ECMAScript edition number from official year version starting with
	// ES2015, which corresponds with ES6 (or a difference of 2009).
	if (version >= 2015) {
		version -= 2009;
	}

	if (
		!SUPPORTED_VERSIONS.includes(
			/** @type {NormalizedEcmaVersion} */
			(version),
		)
	) {
		throw new Error("Invalid ecmaVersion.");
	}

	return /** @type {NormalizedEcmaVersion} */ (version);
}

/**
 * Normalize sourceType from the initial config
 * @param {string} sourceType to normalize
 * @throws {Error} throw an error if sourceType is invalid
 * @returns {"script"|"module"|"commonjs"} normalized sourceType
 */
function normalizeSourceType(sourceType = "script") {
	if (
		sourceType === "script" ||
		sourceType === "module" ||
		sourceType === "commonjs"
	) {
		return sourceType;
	}

	throw new Error("Invalid sourceType.");
}

/**
 * @typedef {{
 *   ecmaVersion: NormalizedEcmaVersion,
 *   sourceType: "script"|"module"|"commonjs",
 *   range?: boolean,
 *   loc?: boolean,
 *   allowReserved: boolean | "never",
 *   ecmaFeatures?: {
 *     jsx?: boolean,
 *     globalReturn?: boolean,
 *     impliedStrict?: boolean
 *   },
 *   ranges: boolean,
 *   locations: boolean,
 *   allowReturnOutsideFunction: boolean,
 *   tokens?: boolean,
 *   comment?: boolean
 * }} NormalizedParserOptions
 */

/**
 * Normalize parserOptions
 * @param {Options} options the parser options to normalize
 * @throws {Error} throw an error if found invalid option.
 * @returns {NormalizedParserOptions} normalized options
 */
export function normalizeOptions(options) {
	const ecmaVersion = normalizeEcmaVersion(options.ecmaVersion);
	const sourceType = normalizeSourceType(options.sourceType);
	const ranges = options.range === true;
	const locations = options.loc === true;

	if (ecmaVersion !== 3 && options.allowReserved) {
		// a value of `false` is intentionally allowed here, so a shared config can overwrite it when needed
		throw new Error(
			"`allowReserved` is only supported when ecmaVersion is 3",
		);
	}
	if (
		typeof options.allowReserved !== "undefined" &&
		typeof options.allowReserved !== "boolean"
	) {
		throw new Error(
			"`allowReserved`, when present, must be `true` or `false`",
		);
	}
	const allowReserved =
		ecmaVersion === 3 ? options.allowReserved || "never" : false;
	const ecmaFeatures = options.ecmaFeatures || {};
	const allowReturnOutsideFunction =
		options.sourceType === "commonjs" || Boolean(ecmaFeatures.globalReturn);

	if (sourceType === "module" && ecmaVersion < 6) {
		throw new Error(
			"sourceType 'module' is not supported when ecmaVersion < 2015. Consider adding `{ ecmaVersion: 2015 }` to the parser options.",
		);
	}

	return Object.assign({}, options, {
		ecmaVersion,
		sourceType,
		ranges,
		locations,
		allowReserved,
		allowReturnOutsideFunction,
	});
}
@
x 4/**
 * @fileoverview Translates tokens between Acorn format and Esprima format.
 * @author Nicholas C. Zakas
 */

/**
 * @import * as acorn from "acorn";
 * @import { EnhancedTokTypes } from "./espree.js"
 * @import { NormalizedEcmaVersion } from "./options.js";
 * @import { EspreeToken as EsprimaToken } from "../espree.js";
 */
/**
 * Based on the `acorn.Token` class, but without a fixed `type` (since we need
 * it to be a string). Avoiding `type` lets us make one extending interface
 * more strict and another more lax.
 *
 * We could make `value` more strict to `string` even though the original is
 * `any`.
 *
 * `start` and `end` are required in `acorn.Token`
 *
 * `loc` and `range` are from `acorn.Token`
 *
 * Adds `regex`.
 */
/**
 * @typedef {{
 *   jsxAttrValueToken: boolean;
 *   ecmaVersion: NormalizedEcmaVersion;
 * }} ExtraNoTokens
 * @typedef {{
 *   tokens: EsprimaToken[]
 * } & ExtraNoTokens} Extra
 */

//------------------------------------------------------------------------------
// Private
//------------------------------------------------------------------------------

// Esprima Token Types
const Token = {
	Boolean: "Boolean",
	EOF: "<end>",
	Identifier: "Identifier",
	PrivateIdentifier: "PrivateIdentifier",
	Keyword: "Keyword",
	Null: "Null",
	Numeric: "Numeric",
	Punctuator: "Punctuator",
	String: "String",
	RegularExpression: "RegularExpression",
	Template: "Template",
	JSXIdentifier: "JSXIdentifier",
	JSXText: "JSXText",
};

/**
 * Converts part of a template into an Esprima token.
 * @param {acorn.Token[]} tokens The Acorn tokens representing the template.
 * @param {string} code The source code.
 * @returns {EsprimaToken} The Esprima equivalent of the template token.
 * @private
 */
function convertTemplatePart(tokens, code) {
	const firstToken = tokens[0],
		lastTemplateToken =
			/** @type {acorn.Token & { loc: acorn.SourceLocation, range: [number, number] }} */ (
				tokens.at(-1)
			);

	/** @type {EsprimaToken} */
	const token = {
		type: Token.Template,
		value: code.slice(firstToken.start, lastTemplateToken.end),
	};

	if (firstToken.loc) {
		token.loc = {
			start: firstToken.loc.start,
			end: lastTemplateToken.loc.end,
		};
	}

	if (firstToken.range) {
		token.start = firstToken.range[0];
		token.end = lastTemplateToken.range[1];
		token.range = [token.start, token.end];
	}

	return token;
}

/* eslint-disable jsdoc/check-types -- The API allows either */
/**
 * Contains logic to translate Acorn tokens into Esprima tokens.
 */
class TokenTranslator {
	/**
	 * Contains logic to translate Acorn tokens into Esprima tokens.
	 * @param {EnhancedTokTypes} acornTokTypes The Acorn token types.
	 * @param {string|String} code The source code Acorn is parsing. This is necessary
	 *      to correct the "value" property of some tokens.
	 */
	constructor(acornTokTypes, code) {
		/* eslint-enable jsdoc/check-types -- The API allows either */

		// token types
		this._acornTokTypes = acornTokTypes;

		// token buffer for templates
		/** @type {acorn.Token[]} */
		this._tokens = [];

		// track the last curly brace
		this._curlyBrace = null;

		// the source code
		this._code = code;
	}

	/**
	 * Translates a single Esprima token to a single Acorn token. This may be
	 * inaccurate due to how templates are handled differently in Esprima and
	 * Acorn, but should be accurate for all other tokens.
	 * @param {acorn.Token} token The Acorn token to translate.
	 * @param {ExtraNoTokens} extra Espree extra object.
	 * @returns {EsprimaToken} The Esprima version of the token.
	 */
	translate(token, extra) {
		const type = token.type,
			tt = this._acornTokTypes,
			// We use an unknown type because `acorn.Token` is a class whose
			//   `type` property we cannot override to our desired `string`;
			//   this also allows us to define a stricter `EsprimaToken` with
			//   a string-only `type` property
			unknownTokenType = /** @type {unknown} */ (token),
			newToken = /** @type {EsprimaToken} */ (unknownTokenType);

		if (type === tt.name) {
			newToken.type = Token.Identifier;

			// TODO: See if this is an Acorn bug
			if ("value" in token && token.value === "static") {
				newToken.type = Token.Keyword;
			}

			if (
				extra.ecmaVersion > 5 &&
				"value" in token &&
				(token.value === "yield" || token.value === "let")
			) {
				newToken.type = Token.Keyword;
			}
		} else if (type === tt.privateId) {
			newToken.type = Token.PrivateIdentifier;
		} else if (
			type === tt.semi ||
			type === tt.comma ||
			type === tt.parenL ||
			type === tt.parenR ||
			type === tt.braceL ||
			type === tt.braceR ||
			type === tt.dot ||
			type === tt.bracketL ||
			type === tt.colon ||
			type === tt.question ||
			type === tt.bracketR ||
			type === tt.ellipsis ||
			type === tt.arrow ||
			type === tt.jsxTagStart ||
			type === tt.incDec ||
			type === tt.starstar ||
			type === tt.jsxTagEnd ||
			type === tt.prefix ||
			type === tt.questionDot ||
			("binop" in type && type.binop && !type.keyword) ||
			("isAssign" in type && type.isAssign)
		) {
			newToken.type = Token.Punctuator;
			newToken.value = this._code.slice(token.start, token.end);
		} else if (type === tt.jsxName) {
			newToken.type = Token.JSXIdentifier;
		} else if (type.label === "jsxText" || type === tt.jsxAttrValueToken) {
			newToken.type = Token.JSXText;
		} else if (type.keyword) {
			if (type.keyword === "true" || type.keyword === "false") {
				newToken.type = Token.Boolean;
			} else if (type.keyword === "null") {
				newToken.type = Token.Null;
			} else {
				newToken.type = Token.Keyword;
			}
		} else if (type === tt.num) {
			newToken.type = Token.Numeric;
			newToken.value = this._code.slice(token.start, token.end);
		} else if (type === tt.string) {
			if (extra.jsxAttrValueToken) {
				extra.jsxAttrValueToken = false;
				newToken.type = Token.JSXText;
			} else {
				newToken.type = Token.String;
			}

			newToken.value = this._code.slice(token.start, token.end);
		} else if (type === tt.regexp) {
			newToken.type = Token.RegularExpression;
			const value = /** @type {{flags: string, pattern: string}} */ (
				"value" in token && token.value
			);

			newToken.regex = {
				flags: value.flags,
				pattern: value.pattern,
			};
			newToken.value = `/${value.pattern}/${value.flags}`;
		}

		return newToken;
	}

	/**
	 * Function to call during Acorn's onToken handler.
	 * @param {acorn.Token} token The Acorn token.
	 * @param {Extra} extra The Espree extra object.
	 * @returns {void}
	 */
	onToken(token, extra) {
		const tt = this._acornTokTypes,
			tokens = extra.tokens,
			templateTokens = this._tokens;

		/**
		 * Flushes the buffered template tokens and resets the template
		 * tracking.
		 * @returns {void}
		 * @private
		 */
		const translateTemplateTokens = () => {
			tokens.push(convertTemplatePart(this._tokens, this._code));
			this._tokens = [];
		};

		if (token.type === tt.eof) {
			// might be one last curlyBrace
			if (this._curlyBrace) {
				tokens.push(this.translate(this._curlyBrace, extra));
			}

			return;
		}

		if (token.type === tt.backQuote) {
			// if there's already a curly, it's not part of the template
			if (this._curlyBrace) {
				tokens.push(this.translate(this._curlyBrace, extra));
				this._curlyBrace = null;
			}

			templateTokens.push(token);

			// it's the end
			if (templateTokens.length > 1) {
				translateTemplateTokens();
			}

			return;
		}
		if (token.type === tt.dollarBraceL) {
			templateTokens.push(token);
			translateTemplateTokens();
			return;
		}
		if (token.type === tt.braceR) {
			// if there's already a curly, it's not part of the template
			if (this._curlyBrace) {
				tokens.push(this.translate(this._curlyBrace, extra));
			}

			// store new curly for later
			this._curlyBrace = token;
			return;
		}
		if (token.type === tt.template || token.type === tt.invalidTemplate) {
			if (this._curlyBrace) {
				templateTokens.push(this._curlyBrace);
				this._curlyBrace = null;
			}

			templateTokens.push(token);
			return;
		}

		if (this._curlyBrace) {
			tokens.push(this.translate(this._curlyBrace, extra));
			this._curlyBrace = null;
		}

		tokens.push(this.translate(token, extra));
	}
}

//------------------------------------------------------------------------------
// Public
//------------------------------------------------------------------------------

export default TokenTranslator;
i[xV/**
 * @import * as acorn from "acorn";
 * @import { Options, EspreeTokens } from "../espree.js";
 */

/**
 * @typedef {acorn.tokTypes & {
 *   jsxName: acorn.TokenType,
 *   jsxText: acorn.TokenType,
 *   jsxTagEnd: acorn.TokenType,
 *   jsxTagStart: acorn.TokenType
 * }} TokTypes
 */

/**
 * @typedef {new (
 *   token: string,
 *   isExpr: boolean,
 *   preserveSpace: boolean,
 *   override?: (parser: any) => void
 * ) => void} TokContext
 */

/**
 * @typedef {{
 *   tc_oTag: TokContext,
 *   tc_cTag: TokContext,
 *   tc_expr: TokContext
 * }} TokContexts
 */

/**
 * @typedef {{
 *   generator?: boolean
 * } & acorn.Node} EsprimaNode
 */

/**
 * @typedef {"Block"|"Hashbang"|"Line"} CommentType
 */

/**
 * @typedef {{
 *   tokenize: () => EspreeTokens,
 *   parse: () => acorn.Program
 * }} EspreeParser
 */

/* eslint-disable jsdoc/valid-types -- Waiting on jsdoc plugin update */
/**
 * @typedef {acorn.Parser & {
 *   jsx_readToken(): string;
 *   jsx_readNewLine(normalizeCRLF: boolean): void;
 *   jsx_readString(quote: number): void;
 *   jsx_readEntity(): string;
 *   jsx_readWord(): void;
 *   jsx_parseIdentifier(): acorn.Node;
 *   jsx_parseNamespacedName(): acorn.Node;
 *   jsx_parseElementName(): acorn.Node | string;
 *   jsx_parseAttributeValue(): acorn.Node;
 *   jsx_parseEmptyExpression(): acorn.Node;
 *   jsx_parseExpressionContainer(): acorn.Node;
 *   jsx_parseAttribute(): acorn.Node;
 *   jsx_parseOpeningElementAt(startPos: number, startLoc?: acorn.SourceLocation): acorn.Node;
 *   jsx_parseClosingElementAt(startPos: number, startLoc?: acorn.SourceLocation): acorn.Node;
 *   jsx_parseElementAt(startPos: number, startLoc?: acorn.SourceLocation): acorn.Node;
 *   jsx_parseText(): acorn.Node;
 *   jsx_parseElement(): acorn.Node;
 * }} AcornJsxParser
 */

/**
 * We pick (statics) from acorn rather than plain extending to avoid complaint
 *   about base constructors needing the same return type (i.e., we return
 *   `AcornJsxParser` here)
 * @typedef {Pick<typeof acorn.Parser, keyof typeof acorn.Parser> & {
 *   readonly acornJsx: {
 *     tokTypes: TokTypes;
 *     tokContexts: TokContexts
 *   };
 *   new (options: acorn.Options, input: string, startPos?: number): AcornJsxParser;
 * }} AcornJsxParserCtor
 */
/**
 * @typedef {{
 *   new (opts: Options | null | undefined, code: string | object): EspreeParser
 * } & Pick<typeof acorn.Parser, keyof typeof acorn.Parser>} EspreeParserCtor
 */
/**
 * @typedef {{
 *   new (opts: Options | null | undefined, code: string | object): EspreeParser
 * } & Pick<AcornJsxParserCtor, keyof AcornJsxParserCtor>} EspreeParserJsxCtor
 */

/**
 * @typedef {Pick<AcornJsxParserCtor, keyof AcornJsxParserCtor> & {
 *   acorn: {
 *     tokTypes: TokTypes,
 *     getLineInfo: (input: string, pos: number) => {
 *       line: number,
 *       column: number
 *     }
 *   }
 *   new (options: acorn.Options, input: string, startPos?: number): AcornJsxParser & {
 *     next: () => void,
 *     type: acorn.TokenType,
 *     curLine: number,
 *     start: number,
 *     end: number,
 *     finishNode (node: acorn.Node, type: string): acorn.Node,
 *     finishNodeAt (node: acorn.Node, type: string, pos: number, loc: acorn.Position): acorn.Node,
 *     parseTopLevel (node: acorn.Node): acorn.Node,
 *     nextToken (): void
 *   }
 * }} AcornJsxParserCtorEnhanced
 */

/* eslint-enable jsdoc/valid-types -- Bug in older versions */
\M}x#{
  "name": "espree",
  "description": "An Esprima-compatible JavaScript parser built on Acorn",
  "author": "Nicholas C. Zakas <nicholas+npm@nczconsulting.com>",
  "homepage": "https://github.com/eslint/js/blob/main/packages/espree/README.md",
  "main": "dist/espree.cjs",
  "types": "./dist/espree.d.cts",
  "type": "module",
  "exports": {
    ".": {
      "types": {
        "import": "./dist/espree.d.ts",
        "require": "./dist/espree.d.cts"
      },
      "import": "./espree.js",
      "require": "./dist/espree.cjs",
      "default": "./dist/espree.cjs"
    },
    "./package.json": "./package.json"
  },
  "version": "11.2.0",
  "files": [
    "lib",
    "dist",
    "espree.js"
  ],
  "engines": {
    "node": "^20.19.0 || ^22.13.0 || >=24"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/eslint/js.git",
    "directory": "packages/espree"
  },
  "bugs": {
    "url": "https://github.com/eslint/js/issues"
  },
  "funding": "https://opencollective.com/eslint",
  "license": "BSD-2-Clause",
  "dependencies": {
    "acorn": "^8.16.0",
    "acorn-jsx": "^5.3.2",
    "eslint-visitor-keys": "^5.0.1"
  },
  "devDependencies": {
    "shelljs": "^0.8.5",
    "tsd": "^0.33.0"
  },
  "keywords": [
    "ast",
    "ecmascript",
    "javascript",
    "parser",
    "syntax",
    "acorn"
  ],
  "scripts": {
    "build": "rollup -c rollup.config.js && npm run build:types && node -e \"fs.rmSync('dist/lib', { recursive: true })\"",
    "build:debug": "npm run build -- -m",
    "build:docs": "node tools/sync-docs.js",
    "build:types": "tsc && tsc -p tsconfig-cjs.json",
    "lint:types": "attw --pack",
    "pretest": "npm run build",
    "test": "npm run test:types && npm run test:cjs && npm run test:esm",
    "test:cjs": "mocha --color --reporter progress --timeout 30000 \"tests/**/*.test.cjs\"",
    "test:esm": "c8 mocha --color --reporter progress --timeout 30000 \"tests/**/*.test.js\"",
    "test:types": "tsd --typings dist/espree.d.ts"
  },
  "sideEffects": false
}
0Pvx G100644 README.md m\9Nne@3NT'40000 dist nX&NKTb100644 license.txt Rh@Ns~C100644 package.json +wn6Xs-100644 parser.js t敕f)gi0!MxyESQuery is a library for querying the AST output by Esprima for patterns of syntax using a CSS style selector system. Check out the demo:

[demo](https://estools.github.io/esquery/)

The following selectors are supported:
* AST node type: `ForStatement`
* [wildcard](http://dev.w3.org/csswg/selectors4/#universal-selector): `*`
* [attribute existence](http://dev.w3.org/csswg/selectors4/#attribute-selectors): `[attr]`
* [attribute value](http://dev.w3.org/csswg/selectors4/#attribute-selectors): `[attr="foo"]` or `[attr=123]`
* attribute regex: `[attr=/foo.*/]` or (with flags) `[attr=/foo.*/is]`
* attribute conditions: `[attr!="foo"]`, `[attr>2]`, `[attr<3]`, `[attr>=2]`, or `[attr<=3]`
* nested attribute: `[attr.level2="foo"]`
* field: `FunctionDeclaration > Identifier.id`
* [First](http://dev.w3.org/csswg/selectors4/#the-first-child-pseudo) or [last](http://dev.w3.org/csswg/selectors4/#the-last-child-pseudo) child: `:first-child` or `:last-child`
* [nth-child](http://dev.w3.org/csswg/selectors4/#the-nth-child-pseudo) (no ax+b support): `:nth-child(2)`
* [nth-last-child](http://dev.w3.org/csswg/selectors4/#the-nth-last-child-pseudo) (no ax+b support): `:nth-last-child(1)`
* [descendant](http://dev.w3.org/csswg/selectors4/#descendant-combinators): `ancestor descendant`
* [child](http://dev.w3.org/csswg/selectors4/#child-combinators): `parent > child`
* [following sibling](http://dev.w3.org/csswg/selectors4/#general-sibling-combinators): `node ~ sibling`
* [adjacent sibling](http://dev.w3.org/csswg/selectors4/#adjacent-sibling-combinators): `node + adjacent`
* [negation](http://dev.w3.org/csswg/selectors4/#negation-pseudo): `:not(ForStatement)`
* [has](https://drafts.csswg.org/selectors-4/#has-pseudo): `:has(ForStatement)`, `:has(> ForStatement)`
* [matches-any](http://dev.w3.org/csswg/selectors4/#matches): `:is([attr] > :first-child, :last-child)`
* [subject indicator](http://dev.w3.org/csswg/selectors4/#subject): `!IfStatement > [name="foo"]`
* class of AST node: `:statement`, `:expression`, `:declaration`, `:function`, or `:pattern`

[![Build Status](https://travis-ci.org/estools/esquery.png?branch=master)](https://travis-ci.org/estools/esquery)
;xj100644 esquery.esm.js p	2oUfv100644 esquery.esm.min.js 9)`)*1R100644 esquery.esm.min.js.map 2%أ_:X100644 esquery.js $	Ǿ^=100644 esquery.lite.js ChGo> xT100644 esquery.lite.min.js 9Lϐx60ѽJ100644 esquery.lite.min.js.map ŋ$Ez-OqE100644 esquery.min.js rt~m̭B100644 esquery.min.js.map =f,7&j{@x   function _arrayLikeToArray(r, a) {
  (null == a || a > r.length) && (a = r.length);
  for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
  return n;
}
function _arrayWithHoles(r) {
  if (Array.isArray(r)) return r;
}
function _arrayWithoutHoles(r) {
  if (Array.isArray(r)) return _arrayLikeToArray(r);
}
function _iterableToArray(r) {
  if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
}
function _iterableToArrayLimit(r, l) {
  var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
  if (null != t) {
    var e,
      n,
      i,
      u,
      a = [],
      f = !0,
      o = !1;
    try {
      if (i = (t = t.call(r)).next, 0 === l) {
        if (Object(t) !== t) return;
        f = !1;
      } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
    } catch (r) {
      o = !0, n = r;
    } finally {
      try {
        if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
      } finally {
        if (o) throw n;
      }
    }
    return a;
  }
}
function _nonIterableRest() {
  throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _nonIterableSpread() {
  throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
}
function _slicedToArray(r, e) {
  return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
}
function _toConsumableArray(r) {
  return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
}
function _typeof(o) {
  "@babel/helpers - typeof";

  return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
    return typeof o;
  } : function (o) {
    return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
  }, _typeof(o);
}
function _unsupportedIterableToArray(r, a) {
  if (r) {
    if ("string" == typeof r) return _arrayLikeToArray(r, a);
    var t = {}.toString.call(r).slice(8, -1);
    return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
  }
}

var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};

function createCommonjsModule(fn, module) {
	return module = { exports: {} }, fn(module, module.exports), module.exports;
}

var estraverse = createCommonjsModule(function (module, exports) {
  /*
    Copyright (C) 2012-2013 Yusuke Suzuki <utatane.tea@gmail.com>
    Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
  
    Redistribution and use in source and binary forms, with or without
    modification, are permitted provided that the following conditions are met:
  
      * Redistributions of source code must retain the above copyright
        notice, this list of conditions and the following disclaimer.
      * Redistributions in binary form must reproduce the above copyright
        notice, this list of conditions and the following disclaimer in the
        documentation and/or other materials provided with the distribution.
  
    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
    ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
    DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
    LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
    ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
    (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
    THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
  /*jslint vars:false, bitwise:true*/
  /*jshint indent:4*/
  /*global exports:true*/
  (function clone(exports) {

    var Syntax, VisitorOption, VisitorKeys, BREAK, SKIP, REMOVE;
    function deepCopy(obj) {
      var ret = {},
        key,
        val;
      for (key in obj) {
        if (obj.hasOwnProperty(key)) {
          val = obj[key];
          if (typeof val === 'object' && val !== null) {
            ret[key] = deepCopy(val);
          } else {
            ret[key] = val;
          }
        }
      }
      return ret;
    }

    // based on LLVM libc++ upper_bound / lower_bound
    // MIT License

    function upperBound(array, func) {
      var diff, len, i, current;
      len = array.length;
      i = 0;
      while (len) {
        diff = len >>> 1;
        current = i + diff;
        if (func(array[current])) {
          len = diff;
        } else {
          i = current + 1;
          len -= diff + 1;
        }
      }
      return i;
    }
    Syntax = {
      AssignmentExpression: 'AssignmentExpression',
      AssignmentPattern: 'AssignmentPattern',
      ArrayExpression: 'ArrayExpression',
      ArrayPattern: 'ArrayPattern',
      ArrowFunctionExpression: 'ArrowFunctionExpression',
      AwaitExpression: 'AwaitExpression',
      // CAUTION: It's deferred to ES7.
      BlockStatement: 'BlockStatement',
      BinaryExpression: 'BinaryExpression',
      BreakStatement: 'BreakStatement',
      CallExpression: 'CallExpression',
      CatchClause: 'CatchClause',
      ChainExpression: 'ChainExpression',
      ClassBody: 'ClassBody',
      ClassDeclaration: 'ClassDeclaration',
      ClassExpression: 'ClassExpression',
      ComprehensionBlock: 'ComprehensionBlock',
      // CAUTION: It's deferred to ES7.
      ComprehensionExpression: 'ComprehensionExpression',
      // CAUTION: It's deferred to ES7.
      ConditionalExpression: 'ConditionalExpression',
      ContinueStatement: 'ContinueStatement',
      DebuggerStatement: 'DebuggerStatement',
      DirectiveStatement: 'DirectiveStatement',
      DoWhileStatement: 'DoWhileStatement',
      EmptyStatement: 'EmptyStatement',
      ExportAllDeclaration: 'ExportAllDeclaration',
      ExportDefaultDeclaration: 'ExportDefaultDeclaration',
      ExportNamedDeclaration: 'ExportNamedDeclaration',
      ExportSpecifier: 'ExportSpecifier',
      ExpressionStatement: 'ExpressionStatement',
      ForStatement: 'ForStatement',
      ForInStatement: 'ForInStatement',
      ForOfStatement: 'ForOfStatement',
      FunctionDeclaration: 'FunctionDeclaration',
      FunctionExpression: 'FunctionExpression',
      GeneratorExpression: 'GeneratorExpression',
      // CAUTION: It's deferred to ES7.
      Identifier: 'Identifier',
      IfStatement: 'IfStatement',
      ImportExpression: 'ImportExpression',
      ImportDeclaration: 'ImportDeclaration',
      ImportDefaultSpecifier: 'ImportDefaultSpecifier',
      ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',
      ImportSpecifier: 'ImportSpecifier',
      Literal: 'Literal',
      LabeledStatement: 'LabeledStatement',
      LogicalExpression: 'LogicalExpression',
      MemberExpression: 'MemberExpression',
      MetaProperty: 'MetaProperty',
      MethodDefinition: 'MethodDefinition',
      ModuleSpecifier: 'ModuleSpecifier',
      NewExpression: 'NewExpression',
      ObjectExpression: 'ObjectExpression',
      ObjectPattern: 'ObjectPattern',
      PrivateIdentifier: 'PrivateIdentifier',
      Program: 'Program',
      Property: 'Property',
      PropertyDefinition: 'PropertyDefinition',
      RestElement: 'RestElement',
      ReturnStatement: 'ReturnStatement',
      SequenceExpression: 'SequenceExpression',
      SpreadElement: 'SpreadElement',
      Super: 'Super',
      SwitchStatement: 'SwitchStatement',
      SwitchCase: 'SwitchCase',
      TaggedTemplateExpression: 'TaggedTemplateExpression',
      TemplateElement: 'TemplateElement',
      TemplateLiteral: 'TemplateLiteral',
      ThisExpression: 'ThisExpression',
      ThrowStatement: 'ThrowStatement',
      TryStatement: 'TryStatement',
      UnaryExpression: 'UnaryExpression',
      UpdateExpression: 'UpdateExpression',
      VariableDeclaration: 'VariableDeclaration',
      VariableDeclarator: 'VariableDeclarator',
      WhileStatement: 'WhileStatement',
      WithStatement: 'WithStatement',
      YieldExpression: 'YieldExpression'
    };
    VisitorKeys = {
      AssignmentExpression: ['left', 'right'],
      AssignmentPattern: ['left', 'right'],
      ArrayExpression: ['elements'],
      ArrayPattern: ['elements'],
      ArrowFunctionExpression: ['params', 'body'],
      AwaitExpression: ['argument'],
      // CAUTION: It's deferred to ES7.
      BlockStatement: ['body'],
      BinaryExpression: ['left', 'right'],
      BreakStatement: ['label'],
      CallExpression: ['callee', 'arguments'],
      CatchClause: ['param', 'body'],
      ChainExpression: ['expression'],
      ClassBody: ['body'],
      ClassDeclaration: ['id', 'superClass', 'body'],
      ClassExpression: ['id', 'superClass', 'body'],
      ComprehensionBlock: ['left', 'right'],
      // CAUTION: It's deferred to ES7.
      ComprehensionExpression: ['blocks', 'filter', 'body'],
      // CAUTION: It's deferred to ES7.
      ConditionalExpression: ['test', 'consequent', 'alternate'],
      ContinueStatement: ['label'],
      DebuggerStatement: [],
      DirectiveStatement: [],
      DoWhileStatement: ['body', 'test'],
      EmptyStatement: [],
      ExportAllDeclaration: ['source'],
      ExportDefaultDeclaration: ['declaration'],
      ExportNamedDeclaration: ['declaration', 'specifiers', 'source'],
      ExportSpecifier: ['exported', 'local'],
      ExpressionStatement: ['expression'],
      ForStatement: ['init', 'test', 'update', 'body'],
      ForInStatement: ['left', 'right', 'body'],
      ForOfStatement: ['left', 'right', 'body'],
      FunctionDeclaration: ['id', 'params', 'body'],
      FunctionExpression: ['id', 'params', 'body'],
      GeneratorExpression: ['blocks', 'filter', 'body'],
      // CAUTION: It's deferred to ES7.
      Identifier: [],
      IfStatement: ['test', 'consequent', 'alternate'],
      ImportExpression: ['source'],
      ImportDeclaration: ['specifiers', 'source'],
      ImportDefaultSpecifier: ['local'],
      ImportNamespaceSpecifier: ['local'],
      ImportSpecifier: ['imported', 'local'],
      Literal: [],
      LabeledStatement: ['label', 'body'],
      LogicalExpression: ['left', 'right'],
      MemberExpression: ['object', 'property'],
      MetaProperty: ['meta', 'property'],
      MethodDefinition: ['key', 'value'],
      ModuleSpecifier: [],
      NewExpression: ['callee', 'arguments'],
      ObjectExpression: ['properties'],
      ObjectPattern: ['properties'],
      PrivateIdentifier: [],
      Program: ['body'],
      Property: ['key', 'value'],
      PropertyDefinition: ['key', 'value'],
      RestElement: ['argument'],
      ReturnStatement: ['argument'],
      SequenceExpression: ['expressions'],
      SpreadElement: ['argument'],
      Super: [],
      SwitchStatement: ['discriminant', 'cases'],
      SwitchCase: ['test', 'consequent'],
      TaggedTemplateExpression: ['tag', 'quasi'],
      TemplateElement: [],
      TemplateLiteral: ['quasis', 'expressions'],
      ThisExpression: [],
      ThrowStatement: ['argument'],
      TryStatement: ['block', 'handler', 'finalizer'],
      UnaryExpression: ['argument'],
      UpdateExpression: ['argument'],
      VariableDeclaration: ['declarations'],
      VariableDeclarator: ['id', 'init'],
      WhileStatement: ['test', 'body'],
      WithStatement: ['object', 'body'],
      YieldExpression: ['argument']
    };

    // unique id
    BREAK = {};
    SKIP = {};
    REMOVE = {};
    VisitorOption = {
      Break: BREAK,
      Skip: SKIP,
      Remove: REMOVE
    };
    function Reference(parent, key) {
      this.parent = parent;
      this.key = key;
    }
    Reference.prototype.replace = function replace(node) {
      this.parent[this.key] = node;
    };
    Reference.prototype.remove = function remove() {
      if (Array.isArray(this.parent)) {
        this.parent.splice(this.key, 1);
        return true;
      } else {
        this.replace(null);
        return false;
      }
    };
    function Element(node, path, wrap, ref) {
      this.node = node;
      this.path = path;
      this.wrap = wrap;
      this.ref = ref;
    }
    function Controller() {}

    // API:
    // return property path array from root to current node
    Controller.prototype.path = function path() {
      var i, iz, j, jz, result, element;
      function addToPath(result, path) {
        if (Array.isArray(path)) {
          for (j = 0, jz = path.length; j < jz; ++j) {
            result.push(path[j]);
          }
        } else {
          result.push(path);
        }
      }

      // root node
      if (!this.__current.path) {
        return null;
      }

      // first node is sentinel, second node is root element
      result = [];
      for (i = 2, iz = this.__leavelist.length; i < iz; ++i) {
        element = this.__leavelist[i];
        addToPath(result, element.path);
      }
      addToPath(result, this.__current.path);
      return result;
    };

    // API:
    // return type of current node
    Controller.prototype.type = function () {
      var node = this.current();
      return node.type || this.__current.wrap;
    };

    // API:
    // return array of parent elements
    Controller.prototype.parents = function parents() {
      var i, iz, result;

      // first node is sentinel
      result = [];
      for (i = 1, iz = this.__leavelist.length; i < iz; ++i) {
        result.push(this.__leavelist[i].node);
      }
      return result;
    };

    // API:
    // return current node
    Controller.prototype.current = function current() {
      return this.__current.node;
    };
    Controller.prototype.__execute = function __execute(callback, element) {
      var previous, result;
      result = undefined;
      previous = this.__current;
      this.__current = element;
      this.__state = null;
      if (callback) {
        result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node);
      }
      this.__current = previous;
      return result;
    };

    // API:
    // notify control skip / break
    Controller.prototype.notify = function notify(flag) {
      this.__state = flag;
    };

    // API:
    // skip child nodes of current node
    Controller.prototype.skip = function () {
      this.notify(SKIP);
    };

    // API:
    // break traversals
    Controller.prototype['break'] = function () {
      this.notify(BREAK);
    };

    // API:
    // remove node
    Controller.prototype.remove = function () {
      this.notify(REMOVE);
    };
    Controller.prototype.__initialize = function (root, visitor) {
      this.visitor = visitor;
      this.root = root;
      this.__worklist = [];
      this.__leavelist = [];
      this.__current = null;
      this.__state = null;
      this.__fallback = null;
      if (visitor.fallback === 'iteration') {
        this.__fallback = Object.keys;
      } else if (typeof visitor.fallback === 'function') {
        this.__fallback = visitor.fallback;
      }
      this.__keys = VisitorKeys;
      if (visitor.keys) {
        this.__keys = Object.assign(Object.create(this.__keys), visitor.keys);
      }
    };
    function isNode(node) {
      if (node == null) {
        return false;
      }
      return typeof node === 'object' && typeof node.type === 'string';
    }
    function isProperty(nodeType, key) {
      return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key;
    }
    function candidateExistsInLeaveList(leavelist, candidate) {
      for (var i = leavelist.length - 1; i >= 0; --i) {
        if (leavelist[i].node === candidate) {
          return true;
        }
      }
      return false;
    }
    Controller.prototype.traverse = function traverse(root, visitor) {
      var worklist, leavelist, element, node, nodeType, ret, key, current, current2, candidates, candidate, sentinel;
      this.__initialize(root, visitor);
      sentinel = {};

      // reference
      worklist = this.__worklist;
      leavelist = this.__leavelist;

      // initialize
      worklist.push(new Element(root, null, null, null));
      leavelist.push(new Element(null, null, null, null));
      while (worklist.length) {
        element = worklist.pop();
        if (element === sentinel) {
          element = leavelist.pop();
          ret = this.__execute(visitor.leave, element);
          if (this.__state === BREAK || ret === BREAK) {
            return;
          }
          continue;
        }
        if (element.node) {
          ret = this.__execute(visitor.enter, element);
          if (this.__state === BREAK || ret === BREAK) {
            return;
          }
          worklist.push(sentinel);
          leavelist.push(element);
          if (this.__state === SKIP || ret === SKIP) {
            continue;
          }
          node = element.node;
          nodeType = node.type || element.wrap;
          candidates = this.__keys[nodeType];
          if (!candidates) {
            if (this.__fallback) {
              candidates = this.__fallback(node);
            } else {
              throw new Error('Unknown node type ' + nodeType + '.');
            }
          }
          current = candidates.length;
          while ((current -= 1) >= 0) {
            key = candidates[current];
            candidate = node[key];
            if (!candidate) {
              continue;
            }
            if (Array.isArray(candidate)) {
              current2 = candidate.length;
              while ((current2 -= 1) >= 0) {
                if (!candidate[current2]) {
                  continue;
                }
                if (candidateExistsInLeaveList(leavelist, candidate[current2])) {
                  continue;
                }
                if (isProperty(nodeType, candidates[current])) {
                  element = new Element(candidate[current2], [key, current2], 'Property', null);
                } else if (isNode(candidate[current2])) {
                  element = new Element(candidate[current2], [key, current2], null, null);
                } else {
                  continue;
                }
                worklist.push(element);
              }
            } else if (isNode(candidate)) {
              if (candidateExistsInLeaveList(leavelist, candidate)) {
                continue;
              }
              worklist.push(new Element(candidate, key, null, null));
            }
          }
        }
      }
    };
    Controller.prototype.replace = function replace(root, visitor) {
      var worklist, leavelist, node, nodeType, target, element, current, current2, candidates, candidate, sentinel, outer, key;
      function removeElem(element) {
        var i, key, nextElem, parent;
        if (element.ref.remove()) {
          // When the reference is an element of an array.
          key = element.ref.key;
          parent = element.ref.parent;

          // If removed from array, then decrease following items' keys.
          i = worklist.length;
          while (i--) {
            nextElem = worklist[i];
            if (nextElem.ref && nextElem.ref.parent === parent) {
              if (nextElem.ref.key < key) {
                break;
              }
              --nextElem.ref.key;
            }
          }
        }
      }
      this.__initialize(root, visitor);
      sentinel = {};

      // reference
      worklist = this.__worklist;
      leavelist = this.__leavelist;

      // initialize
      outer = {
        root: root
      };
      element = new Element(root, null, null, new Reference(outer, 'root'));
      worklist.push(element);
      leavelist.push(element);
      while (worklist.length) {
        element = worklist.pop();
        if (element === sentinel) {
          element = leavelist.pop();
          target = this.__execute(visitor.leave, element);

          // node may be replaced with null,
          // so distinguish between undefined and null in this place
          if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {
            // replace
            element.ref.replace(target);
          }
          if (this.__state === REMOVE || target === REMOVE) {
            removeElem(element);
          }
          if (this.__state === BREAK || target === BREAK) {
            return outer.root;
          }
          continue;
        }
        target = this.__execute(visitor.enter, element);

        // node may be replaced with null,
        // so distinguish between undefined and null in this place
        if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {
          // replace
          element.ref.replace(target);
          element.node = target;
        }
        if (this.__state === REMOVE || target === REMOVE) {
          removeElem(element);
          element.node = null;
        }
        if (this.__state === BREAK || target === BREAK) {
          return outer.root;
        }

        // node may be null
        node = element.node;
        if (!node) {
          continue;
        }
        worklist.push(sentinel);
        leavelist.push(element);
        if (this.__state === SKIP || target === SKIP) {
          continue;
        }
        nodeType = node.type || element.wrap;
        candidates = this.__keys[nodeType];
        if (!candidates) {
          if (this.__fallback) {
            candidates = this.__fallback(node);
          } else {
            throw new Error('Unknown node type ' + nodeType + '.');
          }
        }
        current = candidates.length;
        while ((current -= 1) >= 0) {
          key = candidates[current];
          candidate = node[key];
          if (!candidate) {
            continue;
          }
          if (Array.isArray(candidate)) {
            current2 = candidate.length;
            while ((current2 -= 1) >= 0) {
              if (!candidate[current2]) {
                continue;
              }
              if (isProperty(nodeType, candidates[current])) {
                element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2));
              } else if (isNode(candidate[current2])) {
                element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2));
              } else {
                continue;
              }
              worklist.push(element);
            }
          } else if (isNode(candidate)) {
            worklist.push(new Element(candidate, key, null, new Reference(node, key)));
          }
        }
      }
      return outer.root;
    };
    function traverse(root, visitor) {
      var controller = new Controller();
      return controller.traverse(root, visitor);
    }
    function replace(root, visitor) {
      var controller = new Controller();
      return controller.replace(root, visitor);
    }
    function extendCommentRange(comment, tokens) {
      var target;
      target = upperBound(tokens, function search(token) {
        return token.range[0] > comment.range[0];
      });
      comment.extendedRange = [comment.range[0], comment.range[1]];
      if (target !== tokens.length) {
        comment.extendedRange[1] = tokens[target].range[0];
      }
      target -= 1;
      if (target >= 0) {
        comment.extendedRange[0] = tokens[target].range[1];
      }
      return comment;
    }
    function attachComments(tree, providedComments, tokens) {
      // At first, we should calculate extended comment ranges.
      var comments = [],
        comment,
        len,
        i,
        cursor;
      if (!tree.range) {
        throw new Error('attachComments needs range information');
      }

      // tokens array is empty, we attach comments to tree as 'leadingComments'
      if (!tokens.length) {
        if (providedComments.length) {
          for (i = 0, len = providedComments.length; i < len; i += 1) {
            comment = deepCopy(providedComments[i]);
            comment.extendedRange = [0, tree.range[0]];
            comments.push(comment);
          }
          tree.leadingComments = comments;
        }
        return tree;
      }
      for (i = 0, len = providedComments.length; i < len; i += 1) {
        comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens));
      }

      // This is based on John Freeman's implementation.
      cursor = 0;
      traverse(tree, {
        enter: function (node) {
          var comment;
          while (cursor < comments.length) {
            comment = comments[cursor];
            if (comment.extendedRange[1] > node.range[0]) {
              break;
            }
            if (comment.extendedRange[1] === node.range[0]) {
              if (!node.leadingComments) {
                node.leadingComments = [];
              }
              node.leadingComments.push(comment);
              comments.splice(cursor, 1);
            } else {
              cursor += 1;
            }
          }

          // already out of owned node
          if (cursor === comments.length) {
            return VisitorOption.Break;
          }
          if (comments[cursor].extendedRange[0] > node.range[1]) {
            return VisitorOption.Skip;
          }
        }
      });
      cursor = 0;
      traverse(tree, {
        leave: function (node) {
          var comment;
          while (cursor < comments.length) {
            comment = comments[cursor];
            if (node.range[1] < comment.extendedRange[0]) {
              break;
            }
            if (node.range[1] === comment.extendedRange[0]) {
              if (!node.trailingComments) {
                node.trailingComments = [];
              }
              node.trailingComments.push(comment);
              comments.splice(cursor, 1);
            } else {
              cursor += 1;
            }
          }

          // already out of owned node
          if (cursor === comments.length) {
            return VisitorOption.Break;
          }
          if (comments[cursor].extendedRange[0] > node.range[1]) {
            return VisitorOption.Skip;
          }
        }
      });
      return tree;
    }
    exports.Syntax = Syntax;
    exports.traverse = traverse;
    exports.replace = replace;
    exports.attachComments = attachComments;
    exports.VisitorKeys = VisitorKeys;
    exports.VisitorOption = VisitorOption;
    exports.Controller = Controller;
    exports.cloneEnvironment = function () {
      return clone({});
    };
    return exports;
  })(exports);
  /* vim: set sw=4 ts=4 et tw=80 : */
});

var parser = createCommonjsModule(function (module) {
  /*
   * Generated by PEG.js 0.10.0.
   *
   * http://pegjs.org/
   */
  (function (root, factory) {
    if ( module.exports) {
      module.exports = factory();
    }
  })(commonjsGlobal, function () {

    function peg$subclass(child, parent) {
      function ctor() {
        this.constructor = child;
      }
      ctor.prototype = parent.prototype;
      child.prototype = new ctor();
    }
    function peg$SyntaxError(message, expected, found, location) {
      this.message = message;
      this.expected = expected;
      this.found = found;
      this.location = location;
      this.name = "SyntaxError";
      if (typeof Error.captureStackTrace === "function") {
        Error.captureStackTrace(this, peg$SyntaxError);
      }
    }
    peg$subclass(peg$SyntaxError, Error);
    peg$SyntaxError.buildMessage = function (expected, found) {
      var DESCRIBE_EXPECTATION_FNS = {
        literal: function literal(expectation) {
          return "\"" + literalEscape(expectation.text) + "\"";
        },
        "class": function _class(expectation) {
          var escapedParts = "",
            i;
          for (i = 0; i < expectation.parts.length; i++) {
            escapedParts += expectation.parts[i] instanceof Array ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1]) : classEscape(expectation.parts[i]);
          }
          return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
        },
        any: function any(expectation) {
          return "any character";
        },
        end: function end(expectation) {
          return "end of input";
        },
        other: function other(expectation) {
          return expectation.description;
        }
      };
      function hex(ch) {
        return ch.charCodeAt(0).toString(16).toUpperCase();
      }
      function literalEscape(s) {
        return s.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\0/g, '\\0').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/[\x00-\x0F]/g, function (ch) {
          return '\\x0' + hex(ch);
        }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) {
          return '\\x' + hex(ch);
        });
      }
      function classEscape(s) {
        return s.replace(/\\/g, '\\\\').replace(/\]/g, '\\]').replace(/\^/g, '\\^').replace(/-/g, '\\-').replace(/\0/g, '\\0').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/[\x00-\x0F]/g, function (ch) {
          return '\\x0' + hex(ch);
        }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) {
          return '\\x' + hex(ch);
        });
      }
      function describeExpectation(expectation) {
        return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
      }
      function describeExpected(expected) {
        var descriptions = new Array(expected.length),
          i,
          j;
        for (i = 0; i < expected.length; i++) {
          descriptions[i] = describeExpectation(expected[i]);
        }
        descriptions.sort();
        if (descriptions.length > 0) {
          for (i = 1, j = 1; i < descriptions.length; i++) {
            if (descriptions[i - 1] !== descriptions[i]) {
              descriptions[j] = descriptions[i];
              j++;
            }
          }
          descriptions.length = j;
        }
        switch (descriptions.length) {
          case 1:
            return descriptions[0];
          case 2:
            return descriptions[0] + " or " + descriptions[1];
          default:
            return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1];
        }
      }
      function describeFound(found) {
        return found ? "\"" + literalEscape(found) + "\"" : "end of input";
      }
      return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
    };
    function peg$parse(input, options) {
      options = options !== void 0 ? options : {};
      var peg$FAILED = {},
        peg$startRuleFunctions = {
          start: peg$parsestart
        },
        peg$startRuleFunction = peg$parsestart,
        peg$c0 = function peg$c0(ss) {
          return ss.length === 1 ? ss[0] : {
            type: 'matches',
            selectors: ss
          };
        },
        peg$c1 = function peg$c1() {
          return void 0;
        },
        peg$c2 = " ",
        peg$c3 = peg$literalExpectation(" ", false),
        peg$c4 = /^[^ [\],():#!=><~+.]/,
        peg$c5 = peg$classExpectation([" ", "[", "]", ",", "(", ")", ":", "#", "!", "=", ">", "<", "~", "+", "."], true, false),
        peg$c6 = function peg$c6(i) {
          return i.join('');
        },
        peg$c7 = ">",
        peg$c8 = peg$literalExpectation(">", false),
        peg$c9 = function peg$c9() {
          return 'child';
        },
        peg$c10 = "~",
        peg$c11 = peg$literalExpectation("~", false),
        peg$c12 = function peg$c12() {
          return 'sibling';
        },
        peg$c13 = "+",
        peg$c14 = peg$literalExpectation("+", false),
        peg$c15 = function peg$c15() {
          return 'adjacent';
        },
        peg$c16 = function peg$c16() {
          return 'descendant';
        },
        peg$c17 = ",",
        peg$c18 = peg$literalExpectation(",", false),
        peg$c19 = function peg$c19(s, ss) {
          return [s].concat(ss.map(function (s) {
            return s[3];
          }));
        },
        peg$c20 = function peg$c20(op, s) {
          if (!op) return s;
          return {
            type: op,
            left: {
              type: 'exactNode'
            },
            right: s
          };
        },
        peg$c21 = function peg$c21(a, ops) {
          return ops.reduce(function (memo, rhs) {
            return {
              type: rhs[0],
              left: memo,
              right: rhs[1]
            };
          }, a);
        },
        peg$c22 = "!",
        peg$c23 = peg$literalExpectation("!", false),
        peg$c24 = function peg$c24(subject, as) {
          var b = as.length === 1 ? as[0] : {
            type: 'compound',
            selectors: as
          };
          if (subject) b.subject = true;
          return b;
        },
        peg$c25 = "*",
        peg$c26 = peg$literalExpectation("*", false),
        peg$c27 = function peg$c27(a) {
          return {
            type: 'wildcard',
            value: a
          };
        },
        peg$c28 = "#",
        peg$c29 = peg$literalExpectation("#", false),
        peg$c30 = function peg$c30(i) {
          return {
            type: 'identifier',
            value: i
          };
        },
        peg$c31 = "[",
        peg$c32 = peg$literalExpectation("[", false),
        peg$c33 = "]",
        peg$c34 = peg$literalExpectation("]", false),
        peg$c35 = function peg$c35(v) {
          return v;
        },
        peg$c36 = /^[><!]/,
        peg$c37 = peg$classExpectation([">", "<", "!"], false, false),
        peg$c38 = "=",
        peg$c39 = peg$literalExpectation("=", false),
        peg$c40 = function peg$c40(a) {
          return (a || '') + '=';
        },
        peg$c41 = /^[><]/,
        peg$c42 = peg$classExpectation([">", "<"], false, false),
        peg$c43 = ".",
        peg$c44 = peg$literalExpectation(".", false),
        peg$c45 = function peg$c45(a, as) {
          return [].concat.apply([a], as).join('');
        },
        peg$c46 = function peg$c46(name, op, value) {
          return {
            type: 'attribute',
            name: name,
            operator: op,
            value: value
          };
        },
        peg$c47 = function peg$c47(name) {
          return {
            type: 'attribute',
            name: name
          };
        },
        peg$c48 = "\"",
        peg$c49 = peg$literalExpectation("\"", false),
        peg$c50 = /^[^\\"]/,
        peg$c51 = peg$classExpectation(["\\", "\""], true, false),
        peg$c52 = "\\",
        peg$c53 = peg$literalExpectation("\\", false),
        peg$c54 = peg$anyExpectation(),
        peg$c55 = function peg$c55(a, b) {
          return a + b;
        },
        peg$c56 = function peg$c56(d) {
          return {
            type: 'literal',
            value: strUnescape(d.join(''))
          };
        },
        peg$c57 = "'",
        peg$c58 = peg$literalExpectation("'", false),
        peg$c59 = /^[^\\']/,
        peg$c60 = peg$classExpectation(["\\", "'"], true, false),
        peg$c61 = /^[0-9]/,
        peg$c62 = peg$classExpectation([["0", "9"]], false, false),
        peg$c63 = function peg$c63(a, b) {
          // Can use `a.flat().join('')` once supported
          var leadingDecimals = a ? [].concat.apply([], a).join('') : '';
          return {
            type: 'literal',
            value: parseFloat(leadingDecimals + b.join(''))
          };
        },
        peg$c64 = function peg$c64(i) {
          return {
            type: 'literal',
            value: i
          };
        },
        peg$c65 = "type(",
        peg$c66 = peg$literalExpectation("type(", false),
        peg$c67 = /^[^ )]/,
        peg$c68 = peg$classExpectation([" ", ")"], true, false),
        peg$c69 = ")",
        peg$c70 = peg$literalExpectation(")", false),
        peg$c71 = function peg$c71(t) {
          return {
            type: 'type',
            value: t.join('')
          };
        },
        peg$c72 = /^[imsu]/,
        peg$c73 = peg$classExpectation(["i", "m", "s", "u"], false, false),
        peg$c74 = "/",
        peg$c75 = peg$literalExpectation("/", false),
        peg$c76 = function peg$c76(pattern, flgs) {
          return {
            type: 'regexp',
            value: new RegExp(pattern.join(''), flgs ? flgs.join('') : '')
          };
        },
        peg$c77 = /^[^\]\\]/,
        peg$c78 = peg$classExpectation(["]", "\\"], true, false),
        peg$c79 = function peg$c79(cs) {
          return '[' + cs.join('') + ']';
        },
        peg$c80 = function peg$c80(a) {
          return '\\' + a;
        },
        peg$c81 = /^[^\/\\[]/,
        peg$c82 = peg$classExpectation(["/", "\\", "["], true, false),
        peg$c83 = function peg$c83(cs) {
          return cs.join('');
        },
        peg$c84 = function peg$c84(i, is) {
          return {
            type: 'field',
            name: is.reduce(function (memo, p) {
              return memo + p[0] + p[1];
            }, i)
          };
        },
        peg$c85 = ":not(",
        peg$c86 = peg$literalExpectation(":not(", false),
        peg$c87 = function peg$c87(ss) {
          return {
            type: 'not',
            selectors: ss
          };
        },
        peg$c88 = ":matches(",
        peg$c89 = peg$literalExpectation(":matches(", false),
        peg$c90 = function peg$c90(ss) {
          return {
            type: 'matches',
            selectors: ss
          };
        },
        peg$c91 = ":is(",
        peg$c92 = peg$literalExpectation(":is(", false),
        peg$c93 = ":has(",
        peg$c94 = peg$literalExpectation(":has(", false),
        peg$c95 = function peg$c95(ss) {
          return {
            type: 'has',
            selectors: ss
          };
        },
        peg$c96 = ":first-child",
        peg$c97 = peg$literalExpectation(":first-child", false),
        peg$c98 = function peg$c98() {
          return nth(1);
        },
        peg$c99 = ":last-child",
        peg$c100 = peg$literalExpectation(":last-child", false),
        peg$c101 = function peg$c101() {
          return nthLast(1);
        },
        peg$c102 = ":nth-child(",
        peg$c103 = peg$literalExpectation(":nth-child(", false),
        peg$c104 = function peg$c104(n) {
          return nth(parseInt(n.join(''), 10));
        },
        peg$c105 = ":nth-last-child(",
        peg$c106 = peg$literalExpectation(":nth-last-child(", false),
        peg$c107 = function peg$c107(n) {
          return nthLast(parseInt(n.join(''), 10));
        },
        peg$c108 = ":",
        peg$c109 = peg$literalExpectation(":", false),
        peg$c110 = function peg$c110(c) {
          return {
            type: 'class',
            name: c
          };
        },
        peg$currPos = 0,
        peg$posDetailsCache = [{
          line: 1,
          column: 1
        }],
        peg$maxFailPos = 0,
        peg$maxFailExpected = [],
        peg$resultsCache = {},
        peg$result;
      if ("startRule" in options) {
        if (!(options.startRule in peg$startRuleFunctions)) {
          throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
        }
        peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
      }
      function peg$literalExpectation(text, ignoreCase) {
        return {
          type: "literal",
          text: text,
          ignoreCase: ignoreCase
        };
      }
      function peg$classExpectation(parts, inverted, ignoreCase) {
        return {
          type: "class",
          parts: parts,
          inverted: inverted,
          ignoreCase: ignoreCase
        };
      }
      function peg$anyExpectation() {
        return {
          type: "any"
        };
      }
      function peg$endExpectation() {
        return {
          type: "end"
        };
      }
      function peg$computePosDetails(pos) {
        var details = peg$posDetailsCache[pos],
          p;
        if (details) {
          return details;
        } else {
          p = pos - 1;
          while (!peg$posDetailsCache[p]) {
            p--;
          }
          details = peg$posDetailsCache[p];
          details = {
            line: details.line,
            column: details.column
          };
          while (p < pos) {
            if (input.charCodeAt(p) === 10) {
              details.line++;
              details.column = 1;
            } else {
              details.column++;
            }
            p++;
          }
          peg$posDetailsCache[pos] = details;
          return details;
        }
      }
      function peg$computeLocation(startPos, endPos) {
        var startPosDetails = peg$computePosDetails(startPos),
          endPosDetails = peg$computePosDetails(endPos);
        return {
          start: {
            offset: startPos,
            line: startPosDetails.line,
            column: startPosDetails.column
          },
          end: {
            offset: endPos,
            line: endPosDetails.line,
            column: endPosDetails.column
          }
        };
      }
      function peg$fail(expected) {
        if (peg$currPos < peg$maxFailPos) {
          return;
        }
        if (peg$currPos > peg$maxFailPos) {
          peg$maxFailPos = peg$currPos;
          peg$maxFailExpected = [];
        }
        peg$maxFailExpected.push(expected);
      }
      function peg$buildStructuredError(expected, found, location) {
        return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location);
      }
      function peg$parsestart() {
        var s0, s1, s2, s3;
        var key = peg$currPos * 36 + 0,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        s1 = peg$parse_();
        if (s1 !== peg$FAILED) {
          s2 = peg$parseselectors();
          if (s2 !== peg$FAILED) {
            s3 = peg$parse_();
            if (s3 !== peg$FAILED) {
              s1 = peg$c0(s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        if (s0 === peg$FAILED) {
          s0 = peg$currPos;
          s1 = peg$parse_();
          if (s1 !== peg$FAILED) {
            s1 = peg$c1();
          }
          s0 = s1;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parse_() {
        var s0, s1;
        var key = peg$currPos * 36 + 1,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = [];
        if (input.charCodeAt(peg$currPos) === 32) {
          s1 = peg$c2;
          peg$currPos++;
        } else {
          s1 = peg$FAILED;
          {
            peg$fail(peg$c3);
          }
        }
        while (s1 !== peg$FAILED) {
          s0.push(s1);
          if (input.charCodeAt(peg$currPos) === 32) {
            s1 = peg$c2;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c3);
            }
          }
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parseidentifierName() {
        var s0, s1, s2;
        var key = peg$currPos * 36 + 2,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        s1 = [];
        if (peg$c4.test(input.charAt(peg$currPos))) {
          s2 = input.charAt(peg$currPos);
          peg$currPos++;
        } else {
          s2 = peg$FAILED;
          {
            peg$fail(peg$c5);
          }
        }
        if (s2 !== peg$FAILED) {
          while (s2 !== peg$FAILED) {
            s1.push(s2);
            if (peg$c4.test(input.charAt(peg$currPos))) {
              s2 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s2 = peg$FAILED;
              {
                peg$fail(peg$c5);
              }
            }
          }
        } else {
          s1 = peg$FAILED;
        }
        if (s1 !== peg$FAILED) {
          s1 = peg$c6(s1);
        }
        s0 = s1;
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parsebinaryOp() {
        var s0, s1, s2, s3;
        var key = peg$currPos * 36 + 3,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        s1 = peg$parse_();
        if (s1 !== peg$FAILED) {
          if (input.charCodeAt(peg$currPos) === 62) {
            s2 = peg$c7;
            peg$currPos++;
          } else {
            s2 = peg$FAILED;
            {
              peg$fail(peg$c8);
            }
          }
          if (s2 !== peg$FAILED) {
            s3 = peg$parse_();
            if (s3 !== peg$FAILED) {
              s1 = peg$c9();
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        if (s0 === peg$FAILED) {
          s0 = peg$currPos;
          s1 = peg$parse_();
          if (s1 !== peg$FAILED) {
            if (input.charCodeAt(peg$currPos) === 126) {
              s2 = peg$c10;
              peg$currPos++;
            } else {
              s2 = peg$FAILED;
              {
                peg$fail(peg$c11);
              }
            }
            if (s2 !== peg$FAILED) {
              s3 = peg$parse_();
              if (s3 !== peg$FAILED) {
                s1 = peg$c12();
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          if (s0 === peg$FAILED) {
            s0 = peg$currPos;
            s1 = peg$parse_();
            if (s1 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 43) {
                s2 = peg$c13;
                peg$currPos++;
              } else {
                s2 = peg$FAILED;
                {
                  peg$fail(peg$c14);
                }
              }
              if (s2 !== peg$FAILED) {
                s3 = peg$parse_();
                if (s3 !== peg$FAILED) {
                  s1 = peg$c15();
                  s0 = s1;
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
            if (s0 === peg$FAILED) {
              s0 = peg$currPos;
              if (input.charCodeAt(peg$currPos) === 32) {
                s1 = peg$c2;
                peg$currPos++;
              } else {
                s1 = peg$FAILED;
                {
                  peg$fail(peg$c3);
                }
              }
              if (s1 !== peg$FAILED) {
                s2 = peg$parse_();
                if (s2 !== peg$FAILED) {
                  s1 = peg$c16();
                  s0 = s1;
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            }
          }
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parsehasSelectors() {
        var s0, s1, s2, s3, s4, s5, s6, s7;
        var key = peg$currPos * 36 + 4,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        s1 = peg$parsehasSelector();
        if (s1 !== peg$FAILED) {
          s2 = [];
          s3 = peg$currPos;
          s4 = peg$parse_();
          if (s4 !== peg$FAILED) {
            if (input.charCodeAt(peg$currPos) === 44) {
              s5 = peg$c17;
              peg$currPos++;
            } else {
              s5 = peg$FAILED;
              {
                peg$fail(peg$c18);
              }
            }
            if (s5 !== peg$FAILED) {
              s6 = peg$parse_();
              if (s6 !== peg$FAILED) {
                s7 = peg$parsehasSelector();
                if (s7 !== peg$FAILED) {
                  s4 = [s4, s5, s6, s7];
                  s3 = s4;
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
          while (s3 !== peg$FAILED) {
            s2.push(s3);
            s3 = peg$currPos;
            s4 = peg$parse_();
            if (s4 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 44) {
                s5 = peg$c17;
                peg$currPos++;
              } else {
                s5 = peg$FAILED;
                {
                  peg$fail(peg$c18);
                }
              }
              if (s5 !== peg$FAILED) {
                s6 = peg$parse_();
                if (s6 !== peg$FAILED) {
                  s7 = peg$parsehasSelector();
                  if (s7 !== peg$FAILED) {
                    s4 = [s4, s5, s6, s7];
                    s3 = s4;
                  } else {
                    peg$currPos = s3;
                    s3 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
          }
          if (s2 !== peg$FAILED) {
            s1 = peg$c19(s1, s2);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parseselectors() {
        var s0, s1, s2, s3, s4, s5, s6, s7;
        var key = peg$currPos * 36 + 5,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        s1 = peg$parseselector();
        if (s1 !== peg$FAILED) {
          s2 = [];
          s3 = peg$currPos;
          s4 = peg$parse_();
          if (s4 !== peg$FAILED) {
            if (input.charCodeAt(peg$currPos) === 44) {
              s5 = peg$c17;
              peg$currPos++;
            } else {
              s5 = peg$FAILED;
              {
                peg$fail(peg$c18);
              }
            }
            if (s5 !== peg$FAILED) {
              s6 = peg$parse_();
              if (s6 !== peg$FAILED) {
                s7 = peg$parseselector();
                if (s7 !== peg$FAILED) {
                  s4 = [s4, s5, s6, s7];
                  s3 = s4;
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
          while (s3 !== peg$FAILED) {
            s2.push(s3);
            s3 = peg$currPos;
            s4 = peg$parse_();
            if (s4 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 44) {
                s5 = peg$c17;
                peg$currPos++;
              } else {
                s5 = peg$FAILED;
                {
                  peg$fail(peg$c18);
                }
              }
              if (s5 !== peg$FAILED) {
                s6 = peg$parse_();
                if (s6 !== peg$FAILED) {
                  s7 = peg$parseselector();
                  if (s7 !== peg$FAILED) {
                    s4 = [s4, s5, s6, s7];
                    s3 = s4;
                  } else {
                    peg$currPos = s3;
                    s3 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
          }
          if (s2 !== peg$FAILED) {
            s1 = peg$c19(s1, s2);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parsehasSelector() {
        var s0, s1, s2;
        var key = peg$currPos * 36 + 6,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        s1 = peg$parsebinaryOp();
        if (s1 === peg$FAILED) {
          s1 = null;
        }
        if (s1 !== peg$FAILED) {
          s2 = peg$parseselector();
          if (s2 !== peg$FAILED) {
            s1 = peg$c20(s1, s2);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parseselector() {
        var s0, s1, s2, s3, s4, s5;
        var key = peg$currPos * 36 + 7,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        s1 = peg$parsesequence();
        if (s1 !== peg$FAILED) {
          s2 = [];
          s3 = peg$currPos;
          s4 = peg$parsebinaryOp();
          if (s4 !== peg$FAILED) {
            s5 = peg$parsesequence();
            if (s5 !== peg$FAILED) {
              s4 = [s4, s5];
              s3 = s4;
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
          while (s3 !== peg$FAILED) {
            s2.push(s3);
            s3 = peg$currPos;
            s4 = peg$parsebinaryOp();
            if (s4 !== peg$FAILED) {
              s5 = peg$parsesequence();
              if (s5 !== peg$FAILED) {
                s4 = [s4, s5];
                s3 = s4;
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
          }
          if (s2 !== peg$FAILED) {
            s1 = peg$c21(s1, s2);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parsesequence() {
        var s0, s1, s2, s3;
        var key = peg$currPos * 36 + 8,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        if (input.charCodeAt(peg$currPos) === 33) {
          s1 = peg$c22;
          peg$currPos++;
        } else {
          s1 = peg$FAILED;
          {
            peg$fail(peg$c23);
          }
        }
        if (s1 === peg$FAILED) {
          s1 = null;
        }
        if (s1 !== peg$FAILED) {
          s2 = [];
          s3 = peg$parseatom();
          if (s3 !== peg$FAILED) {
            while (s3 !== peg$FAILED) {
              s2.push(s3);
              s3 = peg$parseatom();
            }
          } else {
            s2 = peg$FAILED;
          }
          if (s2 !== peg$FAILED) {
            s1 = peg$c24(s1, s2);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parseatom() {
        var s0;
        var key = peg$currPos * 36 + 9,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$parsewildcard();
        if (s0 === peg$FAILED) {
          s0 = peg$parseidentifier();
          if (s0 === peg$FAILED) {
            s0 = peg$parseattr();
            if (s0 === peg$FAILED) {
              s0 = peg$parsefield();
              if (s0 === peg$FAILED) {
                s0 = peg$parsenegation();
                if (s0 === peg$FAILED) {
                  s0 = peg$parsematches();
                  if (s0 === peg$FAILED) {
                    s0 = peg$parseis();
                    if (s0 === peg$FAILED) {
                      s0 = peg$parsehas();
                      if (s0 === peg$FAILED) {
                        s0 = peg$parsefirstChild();
                        if (s0 === peg$FAILED) {
                          s0 = peg$parselastChild();
                          if (s0 === peg$FAILED) {
                            s0 = peg$parsenthChild();
                            if (s0 === peg$FAILED) {
                              s0 = peg$parsenthLastChild();
                              if (s0 === peg$FAILED) {
                                s0 = peg$parseclass();
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parsewildcard() {
        var s0, s1;
        var key = peg$currPos * 36 + 10,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        if (input.charCodeAt(peg$currPos) === 42) {
          s1 = peg$c25;
          peg$currPos++;
        } else {
          s1 = peg$FAILED;
          {
            peg$fail(peg$c26);
          }
        }
        if (s1 !== peg$FAILED) {
          s1 = peg$c27(s1);
        }
        s0 = s1;
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parseidentifier() {
        var s0, s1, s2;
        var key = peg$currPos * 36 + 11,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        if (input.charCodeAt(peg$currPos) === 35) {
          s1 = peg$c28;
          peg$currPos++;
        } else {
          s1 = peg$FAILED;
          {
            peg$fail(peg$c29);
          }
        }
        if (s1 === peg$FAILED) {
          s1 = null;
        }
        if (s1 !== peg$FAILED) {
          s2 = peg$parseidentifierName();
          if (s2 !== peg$FAILED) {
            s1 = peg$c30(s2);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parseattr() {
        var s0, s1, s2, s3, s4, s5;
        var key = peg$currPos * 36 + 12,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        if (input.charCodeAt(peg$currPos) === 91) {
          s1 = peg$c31;
          peg$currPos++;
        } else {
          s1 = peg$FAILED;
          {
            peg$fail(peg$c32);
          }
        }
        if (s1 !== peg$FAILED) {
          s2 = peg$parse_();
          if (s2 !== peg$FAILED) {
            s3 = peg$parseattrValue();
            if (s3 !== peg$FAILED) {
              s4 = peg$parse_();
              if (s4 !== peg$FAILED) {
                if (input.charCodeAt(peg$currPos) === 93) {
                  s5 = peg$c33;
                  peg$currPos++;
                } else {
                  s5 = peg$FAILED;
                  {
                    peg$fail(peg$c34);
                  }
                }
                if (s5 !== peg$FAILED) {
                  s1 = peg$c35(s3);
                  s0 = s1;
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parseattrOps() {
        var s0, s1, s2;
        var key = peg$currPos * 36 + 13,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        if (peg$c36.test(input.charAt(peg$currPos))) {
          s1 = input.charAt(peg$currPos);
          peg$currPos++;
        } else {
          s1 = peg$FAILED;
          {
            peg$fail(peg$c37);
          }
        }
        if (s1 === peg$FAILED) {
          s1 = null;
        }
        if (s1 !== peg$FAILED) {
          if (input.charCodeAt(peg$currPos) === 61) {
            s2 = peg$c38;
            peg$currPos++;
          } else {
            s2 = peg$FAILED;
            {
              peg$fail(peg$c39);
            }
          }
          if (s2 !== peg$FAILED) {
            s1 = peg$c40(s1);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        if (s0 === peg$FAILED) {
          if (peg$c41.test(input.charAt(peg$currPos))) {
            s0 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s0 = peg$FAILED;
            {
              peg$fail(peg$c42);
            }
          }
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parseattrEqOps() {
        var s0, s1, s2;
        var key = peg$currPos * 36 + 14,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
           s0 = peg$currPos;
        if (input.charCodeAt(peg$currPos) === 33) {
          s1 = peg$c22;
          peg$currPos++;
        } else {
          s1 = peg$FAILED;
          {
            peg$fail(peg$c23);
          }
        }
        if (s1 === peg$FAILED) {
          s1 = null;
        }
        if (s1 !== peg$FAILED) {
          if (input.charCodeAt(peg$currPos) === 61) {
            s2 = peg$c38;
            peg$currPos++;
          } else {
            s2 = peg$FAILED;
            {
              peg$fail(peg$c39);
            }
          }
          if (s2 !== peg$FAILED) {
            s1 = peg$c40(s1);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parseattrName() {
        var s0, s1, s2, s3, s4, s5;
        var key = peg$currPos * 36 + 15,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        s1 = peg$parseidentifierName();
        if (s1 !== peg$FAILED) {
          s2 = [];
          s3 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 46) {
            s4 = peg$c43;
            peg$currPos++;
          } else {
            s4 = peg$FAILED;
            {
              peg$fail(peg$c44);
            }
          }
          if (s4 !== peg$FAILED) {
            s5 = peg$parseidentifierName();
            if (s5 !== peg$FAILED) {
              s4 = [s4, s5];
              s3 = s4;
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
          while (s3 !== peg$FAILED) {
            s2.push(s3);
            s3 = peg$currPos;
            if (input.charCodeAt(peg$currPos) === 46) {
              s4 = peg$c43;
              peg$currPos++;
            } else {
              s4 = peg$FAILED;
              {
                peg$fail(peg$c44);
              }
            }
            if (s4 !== peg$FAILED) {
              s5 = peg$parseidentifierName();
              if (s5 !== peg$FAILED) {
                s4 = [s4, s5];
                s3 = s4;
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
          }
          if (s2 !== peg$FAILED) {
            s1 = peg$c45(s1, s2);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parseattrValue() {
        var s0, s1, s2, s3, s4, s5;
        var key = peg$currPos * 36 + 16,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        s1 = peg$parseattrName();
        if (s1 !== peg$FAILED) {
          s2 = peg$parse_();
          if (s2 !== peg$FAILED) {
            s3 = peg$parseattrEqOps();
            if (s3 !== peg$FAILED) {
              s4 = peg$parse_();
              if (s4 !== peg$FAILED) {
                s5 = peg$parsetype();
                if (s5 === peg$FAILED) {
                  s5 = peg$parseregex();
                }
                if (s5 !== peg$FAILED) {
                  s1 = peg$c46(s1, s3, s5);
                  s0 = s1;
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        if (s0 === peg$FAILED) {
          s0 = peg$currPos;
          s1 = peg$parseattrName();
          if (s1 !== peg$FAILED) {
            s2 = peg$parse_();
            if (s2 !== peg$FAILED) {
              s3 = peg$parseattrOps();
              if (s3 !== peg$FAILED) {
                s4 = peg$parse_();
                if (s4 !== peg$FAILED) {
                  s5 = peg$parsestring();
                  if (s5 === peg$FAILED) {
                    s5 = peg$parsenumber();
                    if (s5 === peg$FAILED) {
                      s5 = peg$parsepath();
                    }
                  }
                  if (s5 !== peg$FAILED) {
                    s1 = peg$c46(s1, s3, s5);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          if (s0 === peg$FAILED) {
            s0 = peg$currPos;
            s1 = peg$parseattrName();
            if (s1 !== peg$FAILED) {
              s1 = peg$c47(s1);
            }
            s0 = s1;
          }
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parsestring() {
        var s0, s1, s2, s3, s4, s5;
        var key = peg$currPos * 36 + 17,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        if (input.charCodeAt(peg$currPos) === 34) {
          s1 = peg$c48;
          peg$currPos++;
        } else {
          s1 = peg$FAILED;
          {
            peg$fail(peg$c49);
          }
        }
        if (s1 !== peg$FAILED) {
          s2 = [];
          if (peg$c50.test(input.charAt(peg$currPos))) {
            s3 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s3 = peg$FAILED;
            {
              peg$fail(peg$c51);
            }
          }
          if (s3 === peg$FAILED) {
            s3 = peg$currPos;
            if (input.charCodeAt(peg$currPos) === 92) {
              s4 = peg$c52;
              peg$currPos++;
            } else {
              s4 = peg$FAILED;
              {
                peg$fail(peg$c53);
              }
            }
            if (s4 !== peg$FAILED) {
              if (input.length > peg$currPos) {
                s5 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s5 = peg$FAILED;
                {
                  peg$fail(peg$c54);
                }
              }
              if (s5 !== peg$FAILED) {
                s4 = peg$c55(s4, s5);
                s3 = s4;
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
          }
          while (s3 !== peg$FAILED) {
            s2.push(s3);
            if (peg$c50.test(input.charAt(peg$currPos))) {
              s3 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s3 = peg$FAILED;
              {
                peg$fail(peg$c51);
              }
            }
            if (s3 === peg$FAILED) {
              s3 = peg$currPos;
              if (input.charCodeAt(peg$currPos) === 92) {
                s4 = peg$c52;
                peg$currPos++;
              } else {
                s4 = peg$FAILED;
                {
                  peg$fail(peg$c53);
                }
              }
              if (s4 !== peg$FAILED) {
                if (input.length > peg$currPos) {
                  s5 = input.charAt(peg$currPos);
                  peg$currPos++;
                } else {
                  s5 = peg$FAILED;
                  {
                    peg$fail(peg$c54);
                  }
                }
                if (s5 !== peg$FAILED) {
                  s4 = peg$c55(s4, s5);
                  s3 = s4;
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            }
          }
          if (s2 !== peg$FAILED) {
            if (input.charCodeAt(peg$currPos) === 34) {
              s3 = peg$c48;
              peg$currPos++;
            } else {
              s3 = peg$FAILED;
              {
                peg$fail(peg$c49);
              }
            }
            if (s3 !== peg$FAILED) {
              s1 = peg$c56(s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        if (s0 === peg$FAILED) {
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 39) {
            s1 = peg$c57;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c58);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = [];
            if (peg$c59.test(input.charAt(peg$currPos))) {
              s3 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s3 = peg$FAILED;
              {
                peg$fail(peg$c60);
              }
            }
            if (s3 === peg$FAILED) {
              s3 = peg$currPos;
              if (input.charCodeAt(peg$currPos) === 92) {
                s4 = peg$c52;
                peg$currPos++;
              } else {
                s4 = peg$FAILED;
                {
                  peg$fail(peg$c53);
                }
              }
              if (s4 !== peg$FAILED) {
                if (input.length > peg$currPos) {
                  s5 = input.charAt(peg$currPos);
                  peg$currPos++;
                } else {
                  s5 = peg$FAILED;
                  {
                    peg$fail(peg$c54);
                  }
                }
                if (s5 !== peg$FAILED) {
                  s4 = peg$c55(s4, s5);
                  s3 = s4;
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            }
            while (s3 !== peg$FAILED) {
              s2.push(s3);
              if (peg$c59.test(input.charAt(peg$currPos))) {
                s3 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s3 = peg$FAILED;
                {
                  peg$fail(peg$c60);
                }
              }
              if (s3 === peg$FAILED) {
                s3 = peg$currPos;
                if (input.charCodeAt(peg$currPos) === 92) {
                  s4 = peg$c52;
                  peg$currPos++;
                } else {
                  s4 = peg$FAILED;
                  {
                    peg$fail(peg$c53);
                  }
                }
                if (s4 !== peg$FAILED) {
                  if (input.length > peg$currPos) {
                    s5 = input.charAt(peg$currPos);
                    peg$currPos++;
                  } else {
                    s5 = peg$FAILED;
                    {
                      peg$fail(peg$c54);
                    }
                  }
                  if (s5 !== peg$FAILED) {
                    s4 = peg$c55(s4, s5);
                    s3 = s4;
                  } else {
                    peg$currPos = s3;
                    s3 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              }
            }
            if (s2 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 39) {
                s3 = peg$c57;
                peg$currPos++;
              } else {
                s3 = peg$FAILED;
                {
                  peg$fail(peg$c58);
                }
              }
              if (s3 !== peg$FAILED) {
                s1 = peg$c56(s2);
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parsenumber() {
        var s0, s1, s2, s3;
        var key = peg$currPos * 36 + 18,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        s1 = peg$currPos;
        s2 = [];
        if (peg$c61.test(input.charAt(peg$currPos))) {
          s3 = input.charAt(peg$currPos);
          peg$currPos++;
        } else {
          s3 = peg$FAILED;
          {
            peg$fail(peg$c62);
          }
        }
        while (s3 !== peg$FAILED) {
          s2.push(s3);
          if (peg$c61.test(input.charAt(peg$currPos))) {
            s3 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s3 = peg$FAILED;
            {
              peg$fail(peg$c62);
            }
          }
        }
        if (s2 !== peg$FAILED) {
          if (input.charCodeAt(peg$currPos) === 46) {
            s3 = peg$c43;
            peg$currPos++;
          } else {
            s3 = peg$FAILED;
            {
              peg$fail(peg$c44);
            }
          }
          if (s3 !== peg$FAILED) {
            s2 = [s2, s3];
            s1 = s2;
          } else {
            peg$currPos = s1;
            s1 = peg$FAILED;
          }
        } else {
          peg$currPos = s1;
          s1 = peg$FAILED;
        }
        if (s1 === peg$FAILED) {
          s1 = null;
        }
        if (s1 !== peg$FAILED) {
          s2 = [];
          if (peg$c61.test(input.charAt(peg$currPos))) {
            s3 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s3 = peg$FAILED;
            {
              peg$fail(peg$c62);
            }
          }
          if (s3 !== peg$FAILED) {
            while (s3 !== peg$FAILED) {
              s2.push(s3);
              if (peg$c61.test(input.charAt(peg$currPos))) {
                s3 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s3 = peg$FAILED;
                {
                  peg$fail(peg$c62);
                }
              }
            }
          } else {
            s2 = peg$FAILED;
          }
          if (s2 !== peg$FAILED) {
            s1 = peg$c63(s1, s2);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parsepath() {
        var s0, s1;
        var key = peg$currPos * 36 + 19,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        s1 = peg$parseidentifierName();
        if (s1 !== peg$FAILED) {
          s1 = peg$c64(s1);
        }
        s0 = s1;
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parsetype() {
        var s0, s1, s2, s3, s4, s5;
        var key = peg$currPos * 36 + 20,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        if (input.substr(peg$currPos, 5) === peg$c65) {
          s1 = peg$c65;
          peg$currPos += 5;
        } else {
          s1 = peg$FAILED;
          {
            peg$fail(peg$c66);
          }
        }
        if (s1 !== peg$FAILED) {
          s2 = peg$parse_();
          if (s2 !== peg$FAILED) {
            s3 = [];
            if (peg$c67.test(input.charAt(peg$currPos))) {
              s4 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s4 = peg$FAILED;
              {
                peg$fail(peg$c68);
              }
            }
            if (s4 !== peg$FAILED) {
              while (s4 !== peg$FAILED) {
                s3.push(s4);
                if (peg$c67.test(input.charAt(peg$currPos))) {
                  s4 = input.charAt(peg$currPos);
                  peg$currPos++;
                } else {
                  s4 = peg$FAILED;
                  {
                    peg$fail(peg$c68);
                  }
                }
              }
            } else {
              s3 = peg$FAILED;
            }
            if (s3 !== peg$FAILED) {
              s4 = peg$parse_();
              if (s4 !== peg$FAILED) {
                if (input.charCodeAt(peg$currPos) === 41) {
                  s5 = peg$c69;
                  peg$currPos++;
                } else {
                  s5 = peg$FAILED;
                  {
                    peg$fail(peg$c70);
                  }
                }
                if (s5 !== peg$FAILED) {
                  s1 = peg$c71(s3);
                  s0 = s1;
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parseflags() {
        var s0, s1;
        var key = peg$currPos * 36 + 21,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = [];
        if (peg$c72.test(input.charAt(peg$currPos))) {
          s1 = input.charAt(peg$currPos);
          peg$currPos++;
        } else {
          s1 = peg$FAILED;
          {
            peg$fail(peg$c73);
          }
        }
        if (s1 !== peg$FAILED) {
          while (s1 !== peg$FAILED) {
            s0.push(s1);
            if (peg$c72.test(input.charAt(peg$currPos))) {
              s1 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s1 = peg$FAILED;
              {
                peg$fail(peg$c73);
              }
            }
          }
        } else {
          s0 = peg$FAILED;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parseregex() {
        var s0, s1, s2, s3, s4;
        var key = peg$currPos * 36 + 22,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        if (input.charCodeAt(peg$currPos) === 47) {
          s1 = peg$c74;
          peg$currPos++;
        } else {
          s1 = peg$FAILED;
          {
            peg$fail(peg$c75);
          }
        }
        if (s1 !== peg$FAILED) {
          s2 = [];
          s3 = peg$parsere_character_class();
          if (s3 === peg$FAILED) {
            s3 = peg$parsere_escape();
            if (s3 === peg$FAILED) {
              s3 = peg$parsere_chars();
            }
          }
          if (s3 !== peg$FAILED) {
            while (s3 !== peg$FAILED) {
              s2.push(s3);
              s3 = peg$parsere_character_class();
              if (s3 === peg$FAILED) {
                s3 = peg$parsere_escape();
                if (s3 === peg$FAILED) {
                  s3 = peg$parsere_chars();
                }
              }
            }
          } else {
            s2 = peg$FAILED;
          }
          if (s2 !== peg$FAILED) {
            if (input.charCodeAt(peg$currPos) === 47) {
              s3 = peg$c74;
              peg$currPos++;
            } else {
              s3 = peg$FAILED;
              {
                peg$fail(peg$c75);
              }
            }
            if (s3 !== peg$FAILED) {
              s4 = peg$parseflags();
              if (s4 === peg$FAILED) {
                s4 = null;
              }
              if (s4 !== peg$FAILED) {
                s1 = peg$c76(s2, s4);
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parsere_character_class() {
        var s0, s1, s2, s3;
        var key = peg$currPos * 36 + 23,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        if (input.charCodeAt(peg$currPos) === 91) {
          s1 = peg$c31;
          peg$currPos++;
        } else {
          s1 = peg$FAILED;
          {
            peg$fail(peg$c32);
          }
        }
        if (s1 !== peg$FAILED) {
          s2 = [];
          if (peg$c77.test(input.charAt(peg$currPos))) {
            s3 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s3 = peg$FAILED;
            {
              peg$fail(peg$c78);
            }
          }
          if (s3 === peg$FAILED) {
            s3 = peg$parsere_escape();
          }
          if (s3 !== peg$FAILED) {
            while (s3 !== peg$FAILED) {
              s2.push(s3);
              if (peg$c77.test(input.charAt(peg$currPos))) {
                s3 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s3 = peg$FAILED;
                {
                  peg$fail(peg$c78);
                }
              }
              if (s3 === peg$FAILED) {
                s3 = peg$parsere_escape();
              }
            }
          } else {
            s2 = peg$FAILED;
          }
          if (s2 !== peg$FAILED) {
            if (input.charCodeAt(peg$currPos) === 93) {
              s3 = peg$c33;
              peg$currPos++;
            } else {
              s3 = peg$FAILED;
              {
                peg$fail(peg$c34);
              }
            }
            if (s3 !== peg$FAILED) {
              s1 = peg$c79(s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parsere_escape() {
        var s0, s1, s2;
        var key = peg$currPos * 36 + 24,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        if (input.charCodeAt(peg$currPos) === 92) {
          s1 = peg$c52;
          peg$currPos++;
        } else {
          s1 = peg$FAILED;
          {
            peg$fail(peg$c53);
          }
        }
        if (s1 !== peg$FAILED) {
          if (input.length > peg$currPos) {
            s2 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s2 = peg$FAILED;
            {
              peg$fail(peg$c54);
            }
          }
          if (s2 !== peg$FAILED) {
            s1 = peg$c80(s2);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parsere_chars() {
        var s0, s1, s2;
        var key = peg$currPos * 36 + 25,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        s1 = [];
        if (peg$c81.test(input.charAt(peg$currPos))) {
          s2 = input.charAt(peg$currPos);
          peg$currPos++;
        } else {
          s2 = peg$FAILED;
          {
            peg$fail(peg$c82);
          }
        }
        if (s2 !== peg$FAILED) {
          while (s2 !== peg$FAILED) {
            s1.push(s2);
            if (peg$c81.test(input.charAt(peg$currPos))) {
              s2 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s2 = peg$FAILED;
              {
                peg$fail(peg$c82);
              }
            }
          }
        } else {
          s1 = peg$FAILED;
        }
        if (s1 !== peg$FAILED) {
          s1 = peg$c83(s1);
        }
        s0 = s1;
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parsefield() {
        var s0, s1, s2, s3, s4, s5, s6;
        var key = peg$currPos * 36 + 26,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        if (input.charCodeAt(peg$currPos) === 46) {
          s1 = peg$c43;
          peg$currPos++;
        } else {
          s1 = peg$FAILED;
          {
            peg$fail(peg$c44);
          }
        }
        if (s1 !== peg$FAILED) {
          s2 = peg$parseidentifierName();
          if (s2 !== peg$FAILED) {
            s3 = [];
            s4 = peg$currPos;
            if (input.charCodeAt(peg$currPos) === 46) {
              s5 = peg$c43;
              peg$currPos++;
            } else {
              s5 = peg$FAILED;
              {
                peg$fail(peg$c44);
              }
            }
            if (s5 !== peg$FAILED) {
              s6 = peg$parseidentifierName();
              if (s6 !== peg$FAILED) {
                s5 = [s5, s6];
                s4 = s5;
              } else {
                peg$currPos = s4;
                s4 = peg$FAILED;
              }
            } else {
              peg$currPos = s4;
              s4 = peg$FAILED;
            }
            while (s4 !== peg$FAILED) {
              s3.push(s4);
              s4 = peg$currPos;
              if (input.charCodeAt(peg$currPos) === 46) {
                s5 = peg$c43;
                peg$currPos++;
              } else {
                s5 = peg$FAILED;
                {
                  peg$fail(peg$c44);
                }
              }
              if (s5 !== peg$FAILED) {
                s6 = peg$parseidentifierName();
                if (s6 !== peg$FAILED) {
                  s5 = [s5, s6];
                  s4 = s5;
                } else {
                  peg$currPos = s4;
                  s4 = peg$FAILED;
                }
              } else {
                peg$currPos = s4;
                s4 = peg$FAILED;
              }
            }
            if (s3 !== peg$FAILED) {
              s1 = peg$c84(s2, s3);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parsenegation() {
        var s0, s1, s2, s3, s4, s5;
        var key = peg$currPos * 36 + 27,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        if (input.substr(peg$currPos, 5) === peg$c85) {
          s1 = peg$c85;
          peg$currPos += 5;
        } else {
          s1 = peg$FAILED;
          {
            peg$fail(peg$c86);
          }
        }
        if (s1 !== peg$FAILED) {
          s2 = peg$parse_();
          if (s2 !== peg$FAILED) {
            s3 = peg$parseselectors();
            if (s3 !== peg$FAILED) {
              s4 = peg$parse_();
              if (s4 !== peg$FAILED) {
                if (input.charCodeAt(peg$currPos) === 41) {
                  s5 = peg$c69;
                  peg$currPos++;
                } else {
                  s5 = peg$FAILED;
                  {
                    peg$fail(peg$c70);
                  }
                }
                if (s5 !== peg$FAILED) {
                  s1 = peg$c87(s3);
                  s0 = s1;
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parsematches() {
        var s0, s1, s2, s3, s4, s5;
        var key = peg$currPos * 36 + 28,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        if (input.substr(peg$currPos, 9) === peg$c88) {
          s1 = peg$c88;
          peg$currPos += 9;
        } else {
          s1 = peg$FAILED;
          {
            peg$fail(peg$c89);
          }
        }
        if (s1 !== peg$FAILED) {
          s2 = peg$parse_();
          if (s2 !== peg$FAILED) {
            s3 = peg$parseselectors();
            if (s3 !== peg$FAILED) {
              s4 = peg$parse_();
              if (s4 !== peg$FAILED) {
                if (input.charCodeAt(peg$currPos) === 41) {
                  s5 = peg$c69;
                  peg$currPos++;
                } else {
                  s5 = peg$FAILED;
                  {
                    peg$fail(peg$c70);
                  }
                }
                if (s5 !== peg$FAILED) {
                  s1 = peg$c90(s3);
                  s0 = s1;
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parseis() {
        var s0, s1, s2, s3, s4, s5;
        var key = peg$currPos * 36 + 29,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        if (input.substr(peg$currPos, 4) === peg$c91) {
          s1 = peg$c91;
          peg$currPos += 4;
        } else {
          s1 = peg$FAILED;
          {
            peg$fail(peg$c92);
          }
        }
        if (s1 !== peg$FAILED) {
          s2 = peg$parse_();
          if (s2 !== peg$FAILED) {
            s3 = peg$parseselectors();
            if (s3 !== peg$FAILED) {
              s4 = peg$parse_();
              if (s4 !== peg$FAILED) {
                if (input.charCodeAt(peg$currPos) === 41) {
                  s5 = peg$c69;
                  peg$currPos++;
                } else {
                  s5 = peg$FAILED;
                  {
                    peg$fail(peg$c70);
                  }
                }
                if (s5 !== peg$FAILED) {
                  s1 = peg$c90(s3);
                  s0 = s1;
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parsehas() {
        var s0, s1, s2, s3, s4, s5;
        var key = peg$currPos * 36 + 30,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        if (input.substr(peg$currPos, 5) === peg$c93) {
          s1 = peg$c93;
          peg$currPos += 5;
        } else {
          s1 = peg$FAILED;
          {
            peg$fail(peg$c94);
          }
        }
        if (s1 !== peg$FAILED) {
          s2 = peg$parse_();
          if (s2 !== peg$FAILED) {
            s3 = peg$parsehasSelectors();
            if (s3 !== peg$FAILED) {
              s4 = peg$parse_();
              if (s4 !== peg$FAILED) {
                if (input.charCodeAt(peg$currPos) === 41) {
                  s5 = peg$c69;
                  peg$currPos++;
                } else {
                  s5 = peg$FAILED;
                  {
                    peg$fail(peg$c70);
                  }
                }
                if (s5 !== peg$FAILED) {
                  s1 = peg$c95(s3);
                  s0 = s1;
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parsefirstChild() {
        var s0, s1;
        var key = peg$currPos * 36 + 31,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        if (input.substr(peg$currPos, 12) === peg$c96) {
          s1 = peg$c96;
          peg$currPos += 12;
        } else {
          s1 = peg$FAILED;
          {
            peg$fail(peg$c97);
          }
        }
        if (s1 !== peg$FAILED) {
          s1 = peg$c98();
        }
        s0 = s1;
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parselastChild() {
        var s0, s1;
        var key = peg$currPos * 36 + 32,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        if (input.substr(peg$currPos, 11) === peg$c99) {
          s1 = peg$c99;
          peg$currPos += 11;
        } else {
          s1 = peg$FAILED;
          {
            peg$fail(peg$c100);
          }
        }
        if (s1 !== peg$FAILED) {
          s1 = peg$c101();
        }
        s0 = s1;
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parsenthChild() {
        var s0, s1, s2, s3, s4, s5;
        var key = peg$currPos * 36 + 33,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        if (input.substr(peg$currPos, 11) === peg$c102) {
          s1 = peg$c102;
          peg$currPos += 11;
        } else {
          s1 = peg$FAILED;
          {
            peg$fail(peg$c103);
          }
        }
        if (s1 !== peg$FAILED) {
          s2 = peg$parse_();
          if (s2 !== peg$FAILED) {
            s3 = [];
            if (peg$c61.test(input.charAt(peg$currPos))) {
              s4 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s4 = peg$FAILED;
              {
                peg$fail(peg$c62);
              }
            }
            if (s4 !== peg$FAILED) {
              while (s4 !== peg$FAILED) {
                s3.push(s4);
                if (peg$c61.test(input.charAt(peg$currPos))) {
                  s4 = input.charAt(peg$currPos);
                  peg$currPos++;
                } else {
                  s4 = peg$FAILED;
                  {
                    peg$fail(peg$c62);
                  }
                }
              }
            } else {
              s3 = peg$FAILED;
            }
            if (s3 !== peg$FAILED) {
              s4 = peg$parse_();
              if (s4 !== peg$FAILED) {
                if (input.charCodeAt(peg$currPos) === 41) {
                  s5 = peg$c69;
                  peg$currPos++;
                } else {
                  s5 = peg$FAILED;
                  {
                    peg$fail(peg$c70);
                  }
                }
                if (s5 !== peg$FAILED) {
                  s1 = peg$c104(s3);
                  s0 = s1;
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parsenthLastChild() {
        var s0, s1, s2, s3, s4, s5;
        var key = peg$currPos * 36 + 34,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        if (input.substr(peg$currPos, 16) === peg$c105) {
          s1 = peg$c105;
          peg$currPos += 16;
        } else {
          s1 = peg$FAILED;
          {
            peg$fail(peg$c106);
          }
        }
        if (s1 !== peg$FAILED) {
          s2 = peg$parse_();
          if (s2 !== peg$FAILED) {
            s3 = [];
            if (peg$c61.test(input.charAt(peg$currPos))) {
              s4 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s4 = peg$FAILED;
              {
                peg$fail(peg$c62);
              }
            }
            if (s4 !== peg$FAILED) {
              while (s4 !== peg$FAILED) {
                s3.push(s4);
                if (peg$c61.test(input.charAt(peg$currPos))) {
                  s4 = input.charAt(peg$currPos);
                  peg$currPos++;
                } else {
                  s4 = peg$FAILED;
                  {
                    peg$fail(peg$c62);
                  }
                }
              }
            } else {
              s3 = peg$FAILED;
            }
            if (s3 !== peg$FAILED) {
              s4 = peg$parse_();
              if (s4 !== peg$FAILED) {
                if (input.charCodeAt(peg$currPos) === 41) {
                  s5 = peg$c69;
                  peg$currPos++;
                } else {
                  s5 = peg$FAILED;
                  {
                    peg$fail(peg$c70);
                  }
                }
                if (s5 !== peg$FAILED) {
                  s1 = peg$c107(s3);
                  s0 = s1;
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function peg$parseclass() {
        var s0, s1, s2;
        var key = peg$currPos * 36 + 35,
          cached = peg$resultsCache[key];
        if (cached) {
          peg$currPos = cached.nextPos;
          return cached.result;
        }
        s0 = peg$currPos;
        if (input.charCodeAt(peg$currPos) === 58) {
          s1 = peg$c108;
          peg$currPos++;
        } else {
          s1 = peg$FAILED;
          {
            peg$fail(peg$c109);
          }
        }
        if (s1 !== peg$FAILED) {
          s2 = peg$parseidentifierName();
          if (s2 !== peg$FAILED) {
            s1 = peg$c110(s2);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        peg$resultsCache[key] = {
          nextPos: peg$currPos,
          result: s0
        };
        return s0;
      }
      function nth(n) {
        return {
          type: 'nth-child',
          index: {
            type: 'literal',
            value: n
          }
        };
      }
      function nthLast(n) {
        return {
          type: 'nth-last-child',
          index: {
            type: 'literal',
            value: n
          }
        };
      }
      function strUnescape(s) {
        return s.replace(/\\(.)/g, function (match, ch) {
          switch (ch) {
            case 'b':
              return '\b';
            case 'f':
              return '\f';
            case 'n':
              return '\n';
            case 'r':
              return '\r';
            case 't':
              return '\t';
            case 'v':
              return '\v';
            default:
              return ch;
          }
        });
      }
      peg$result = peg$startRuleFunction();
      if (peg$result !== peg$FAILED && peg$currPos === input.length) {
        return peg$result;
      } else {
        if (peg$result !== peg$FAILED && peg$currPos < input.length) {
          peg$fail(peg$endExpectation());
        }
        throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
      }
    }
    return {
      SyntaxError: peg$SyntaxError,
      parse: peg$parse
    };
  });
});

/**
* @typedef {"LEFT_SIDE"|"RIGHT_SIDE"} Side
*/

var LEFT_SIDE = 'LEFT_SIDE';
var RIGHT_SIDE = 'RIGHT_SIDE';

/**
 * @external AST
 * @see https://esprima.readthedocs.io/en/latest/syntax-tree-format.html
 */

/**
 * One of the rules of `grammar.pegjs`
 * @typedef {PlainObject} SelectorAST
 * @see grammar.pegjs
*/

/**
 * The `sequence` production of `grammar.pegjs`
 * @typedef {PlainObject} SelectorSequenceAST
*/

/**
 * Get the value of a property which may be multiple levels down
 * in the object.
 * @param {?PlainObject} obj
 * @param {string[]} keys
 * @returns {undefined|boolean|string|number|external:AST}
 */
function getPath(obj, keys) {
  for (var i = 0; i < keys.length; ++i) {
    if (obj == null) {
      return obj;
    }
    obj = obj[keys[i]];
  }
  return obj;
}

/**
 * Determine whether `node` can be reached by following `path`,
 * starting at `ancestor`.
 * @param {?external:AST} node
 * @param {?external:AST} ancestor
 * @param {string[]} path
 * @param {Integer} fromPathIndex
 * @returns {boolean}
 */
function inPath(node, ancestor, path, fromPathIndex) {
  var current = ancestor;
  for (var i = fromPathIndex; i < path.length; ++i) {
    if (current == null) {
      return false;
    }
    var field = current[path[i]];
    if (Array.isArray(field)) {
      for (var k = 0; k < field.length; ++k) {
        if (inPath(node, field[k], path, i + 1)) {
          return true;
        }
      }
      return false;
    }
    current = field;
  }
  return node === current;
}

/**
 * A generated matcher function for a selector.
 * @callback SelectorMatcher
 * @param {?SelectorAST} selector
 * @param {external:AST[]} [ancestry=[]]
 * @param {ESQueryOptions} [options]
 * @returns {void}
*/

/**
 * A WeakMap for holding cached matcher functions for selectors.
 * @type {WeakMap<SelectorAST, SelectorMatcher>}
*/
var MATCHER_CACHE = typeof WeakMap === 'function' ? new WeakMap() : null;

/**
 * Look up a matcher function for `selector` in the cache.
 * If it does not exist, generate it with `generateMatcher` and add it to the cache.
 * In engines without WeakMap, the caching is skipped and matchers are generated with every call.
 * @param {?SelectorAST} selector
 * @returns {SelectorMatcher}
 */
function getMatcher(selector) {
  if (selector == null) {
    return function () {
      return true;
    };
  }
  if (MATCHER_CACHE != null) {
    var matcher = MATCHER_CACHE.get(selector);
    if (matcher != null) {
      return matcher;
    }
    matcher = generateMatcher(selector);
    MATCHER_CACHE.set(selector, matcher);
    return matcher;
  }
  return generateMatcher(selector);
}

/**
 * Create a matcher function for `selector`,
 * @param {?SelectorAST} selector
 * @returns {SelectorMatcher}
 */
function generateMatcher(selector) {
  switch (selector.type) {
    case 'wildcard':
      return function () {
        return true;
      };
    case 'identifier':
      {
        var value = selector.value.toLowerCase();
        return function (node, ancestry, options) {
          var nodeTypeKey = options && options.nodeTypeKey || 'type';
          return value === node[nodeTypeKey].toLowerCase();
        };
      }
    case 'exactNode':
      return function (node, ancestry) {
        return ancestry.length === 0;
      };
    case 'field':
      {
        var path = selector.name.split('.');
        return function (node, ancestry) {
          var ancestor = ancestry[path.length - 1];
          return inPath(node, ancestor, path, 0);
        };
      }
    case 'matches':
      {
        var matchers = selector.selectors.map(getMatcher);
        return function (node, ancestry, options) {
          for (var i = 0; i < matchers.length; ++i) {
            if (matchers[i](node, ancestry, options)) {
              return true;
            }
          }
          return false;
        };
      }
    case 'compound':
      {
        var _matchers = selector.selectors.map(getMatcher);
        return function (node, ancestry, options) {
          for (var i = 0; i < _matchers.length; ++i) {
            if (!_matchers[i](node, ancestry, options)) {
              return false;
            }
          }
          return true;
        };
      }
    case 'not':
      {
        var _matchers2 = selector.selectors.map(getMatcher);
        return function (node, ancestry, options) {
          for (var i = 0; i < _matchers2.length; ++i) {
            if (_matchers2[i](node, ancestry, options)) {
              return false;
            }
          }
          return true;
        };
      }
    case 'has':
      {
        var _matchers3 = selector.selectors.map(getMatcher);
        return function (node, ancestry, options) {
          var result = false;
          var a = [];
          estraverse.traverse(node, {
            enter: function enter(node, parent) {
              if (parent != null) {
                a.unshift(parent);
              }
              for (var i = 0; i < _matchers3.length; ++i) {
                if (_matchers3[i](node, a, options)) {
                  result = true;
                  this["break"]();
                  return;
                }
              }
            },
            leave: function leave() {
              a.shift();
            },
            keys: options && options.visitorKeys,
            fallback: options && options.fallback || 'iteration'
          });
          return result;
        };
      }
    case 'child':
      {
        var left = getMatcher(selector.left);
        var right = getMatcher(selector.right);
        return function (node, ancestry, options) {
          if (ancestry.length > 0 && right(node, ancestry, options)) {
            return left(ancestry[0], ancestry.slice(1), options);
          }
          return false;
        };
      }
    case 'descendant':
      {
        var _left = getMatcher(selector.left);
        var _right = getMatcher(selector.right);
        return function (node, ancestry, options) {
          if (_right(node, ancestry, options)) {
            for (var i = 0, l = ancestry.length; i < l; ++i) {
              if (_left(ancestry[i], ancestry.slice(i + 1), options)) {
                return true;
              }
            }
          }
          return false;
        };
      }
    case 'attribute':
      {
        var _path = selector.name.split('.');
        switch (selector.operator) {
          case void 0:
            return function (node) {
              return getPath(node, _path) != null;
            };
          case '=':
            switch (selector.value.type) {
              case 'regexp':
                return function (node) {
                  var p = getPath(node, _path);
                  return typeof p === 'string' && selector.value.value.test(p);
                };
              case 'literal':
                {
                  var literal = "".concat(selector.value.value);
                  return function (node) {
                    return literal === "".concat(getPath(node, _path));
                  };
                }
              case 'type':
                return function (node) {
                  return selector.value.value === _typeof(getPath(node, _path));
                };
            }
            throw new Error("Unknown selector value type: ".concat(selector.value.type));
          case '!=':
            switch (selector.value.type) {
              case 'regexp':
                return function (node) {
                  return !selector.value.value.test(getPath(node, _path));
                };
              case 'literal':
                {
                  var _literal = "".concat(selector.value.value);
                  return function (node) {
                    return _literal !== "".concat(getPath(node, _path));
                  };
                }
              case 'type':
                return function (node) {
                  return selector.value.value !== _typeof(getPath(node, _path));
                };
            }
            throw new Error("Unknown selector value type: ".concat(selector.value.type));
          case '<=':
            return function (node) {
              return getPath(node, _path) <= selector.value.value;
            };
          case '<':
            return function (node) {
              return getPath(node, _path) < selector.value.value;
            };
          case '>':
            return function (node) {
              return getPath(node, _path) > selector.value.value;
            };
          case '>=':
            return function (node) {
              return getPath(node, _path) >= selector.value.value;
            };
        }
        throw new Error("Unknown operator: ".concat(selector.operator));
      }
    case 'sibling':
      {
        var _left2 = getMatcher(selector.left);
        var _right2 = getMatcher(selector.right);
        return function (node, ancestry, options) {
          return _right2(node, ancestry, options) && sibling(node, _left2, ancestry, LEFT_SIDE, options) || selector.left.subject && _left2(node, ancestry, options) && sibling(node, _right2, ancestry, RIGHT_SIDE, options);
        };
      }
    case 'adjacent':
      {
        var _left3 = getMatcher(selector.left);
        var _right3 = getMatcher(selector.right);
        return function (node, ancestry, options) {
          return _right3(node, ancestry, options) && adjacent(node, _left3, ancestry, LEFT_SIDE, options) || selector.right.subject && _left3(node, ancestry, options) && adjacent(node, _right3, ancestry, RIGHT_SIDE, options);
        };
      }
    case 'nth-child':
      {
        var nth = selector.index.value;
        var _right4 = getMatcher(selector.right);
        return function (node, ancestry, options) {
          return _right4(node, ancestry, options) && nthChild(node, ancestry, nth, options);
        };
      }
    case 'nth-last-child':
      {
        var _nth = -selector.index.value;
        var _right5 = getMatcher(selector.right);
        return function (node, ancestry, options) {
          return _right5(node, ancestry, options) && nthChild(node, ancestry, _nth, options);
        };
      }
    case 'class':
      {
        var name = selector.name.toLowerCase();
        return function (node, ancestry, options) {
          if (options && options.matchClass) {
            return options.matchClass(selector.name, node, ancestry);
          }
          if (options && options.nodeTypeKey) return false;
          switch (name) {
            case 'statement':
              if (node.type.slice(-9) === 'Statement') return true;
            // fallthrough: interface Declaration <: Statement { }
            case 'declaration':
              return node.type.slice(-11) === 'Declaration';
            case 'pattern':
              if (node.type.slice(-7) === 'Pattern') return true;
            // fallthrough: interface Expression <: Node, Pattern { }
            case 'expression':
              return node.type.slice(-10) === 'Expression' || node.type.slice(-7) === 'Literal' || node.type === 'Identifier' && (ancestry.length === 0 || ancestry[0].type !== 'MetaProperty') || node.type === 'MetaProperty';
            case 'function':
              return node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression';
          }
          throw new Error("Unknown class name: ".concat(selector.name));
        };
      }
  }
  throw new Error("Unknown selector type: ".concat(selector.type));
}

/**
 * @callback TraverseOptionFallback
 * @param {external:AST} node The given node.
 * @returns {string[]} An array of visitor keys for the given node.
 */

/**
 * @callback ClassMatcher
 * @param {string} className The name of the class to match.
 * @param {external:AST} node The node to match against.
 * @param {Array<external:AST>} ancestry The ancestry of the node.
 * @returns {boolean} True if the node matches the class, false if not.
 */

/**
 * @typedef {object} ESQueryOptions
 * @property {string} [nodeTypeKey="type"] By passing `nodeTypeKey`, we can allow other ASTs to use ESQuery.
 * @property { { [nodeType: string]: string[] } } [visitorKeys] By passing `visitorKeys` mapping, we can extend the properties of the nodes that traverse the node.
 * @property {TraverseOptionFallback} [fallback] By passing `fallback` option, we can control the properties of traversing nodes when encountering unknown nodes.
 * @property {ClassMatcher} [matchClass] By passing `matchClass` option, we can customize the interpretation of classes.
 */

/**
 * Given a `node` and its ancestors, determine if `node` is matched
 * by `selector`.
 * @param {?external:AST} node
 * @param {?SelectorAST} selector
 * @param {external:AST[]} [ancestry=[]]
 * @param {ESQueryOptions} [options]
 * @throws {Error} Unknowns (operator, class name, selector type, or
 * selector value type)
 * @returns {boolean}
 */
function matches(node, selector, ancestry, options) {
  if (!selector) {
    return true;
  }
  if (!node) {
    return false;
  }
  if (!ancestry) {
    ancestry = [];
  }
  return getMatcher(selector)(node, ancestry, options);
}

/**
 * Get visitor keys of a given node.
 * @param {external:AST} node The AST node to get keys.
 * @param {ESQueryOptions|undefined} options
 * @returns {string[]} Visitor keys of the node.
 */
function getVisitorKeys(node, options) {
  var nodeTypeKey = options && options.nodeTypeKey || 'type';
  var nodeType = node[nodeTypeKey];
  if (options && options.visitorKeys && options.visitorKeys[nodeType]) {
    return options.visitorKeys[nodeType];
  }
  if (estraverse.VisitorKeys[nodeType]) {
    return estraverse.VisitorKeys[nodeType];
  }
  if (options && typeof options.fallback === 'function') {
    return options.fallback(node);
  }
  // 'iteration' fallback
  return Object.keys(node).filter(function (key) {
    return key !== nodeTypeKey;
  });
}

/**
 * Check whether the given value is an ASTNode or not.
 * @param {any} node The value to check.
 * @param {ESQueryOptions|undefined} options The options to use.
 * @returns {boolean} `true` if the value is an ASTNode.
 */
function isNode(node, options) {
  var nodeTypeKey = options && options.nodeTypeKey || 'type';
  return node !== null && _typeof(node) === 'object' && typeof node[nodeTypeKey] === 'string';
}

/**
 * Determines if the given node has a sibling that matches the
 * given selector matcher.
 * @param {external:AST} node
 * @param {SelectorMatcher} matcher
 * @param {external:AST[]} ancestry
 * @param {Side} side
 * @param {ESQueryOptions|undefined} options
 * @returns {boolean}
 */
function sibling(node, matcher, ancestry, side, options) {
  var _ancestry = _slicedToArray(ancestry, 1),
    parent = _ancestry[0];
  if (!parent) {
    return false;
  }
  var keys = getVisitorKeys(parent, options);
  for (var i = 0; i < keys.length; ++i) {
    var listProp = parent[keys[i]];
    if (Array.isArray(listProp)) {
      var startIndex = listProp.indexOf(node);
      if (startIndex < 0) {
        continue;
      }
      var lowerBound = void 0,
        upperBound = void 0;
      if (side === LEFT_SIDE) {
        lowerBound = 0;
        upperBound = startIndex;
      } else {
        lowerBound = startIndex + 1;
        upperBound = listProp.length;
      }
      for (var k = lowerBound; k < upperBound; ++k) {
        if (isNode(listProp[k], options) && matcher(listProp[k], ancestry, options)) {
          return true;
        }
      }
    }
  }
  return false;
}

/**
 * Determines if the given node has an adjacent sibling that matches
 * the given selector matcher.
 * @param {external:AST} node
 * @param {SelectorMatcher} matcher
 * @param {external:AST[]} ancestry
 * @param {Side} side
 * @param {ESQueryOptions|undefined} options
 * @returns {boolean}
 */
function adjacent(node, matcher, ancestry, side, options) {
  var _ancestry2 = _slicedToArray(ancestry, 1),
    parent = _ancestry2[0];
  if (!parent) {
    return false;
  }
  var keys = getVisitorKeys(parent, options);
  for (var i = 0; i < keys.length; ++i) {
    var listProp = parent[keys[i]];
    if (Array.isArray(listProp)) {
      var idx = listProp.indexOf(node);
      if (idx < 0) {
        continue;
      }
      if (side === LEFT_SIDE && idx > 0 && isNode(listProp[idx - 1], options) && matcher(listProp[idx - 1], ancestry, options)) {
        return true;
      }
      if (side === RIGHT_SIDE && idx < listProp.length - 1 && isNode(listProp[idx + 1], options) && matcher(listProp[idx + 1], ancestry, options)) {
        return true;
      }
    }
  }
  return false;
}

/**
 * Determines if the given node is the `nth` child.
 * If `nth` is negative then the position is counted
 * from the end of the list of children.
 * @param {external:AST} node
 * @param {external:AST[]} ancestry
 * @param {Integer} nth
 * @param {ESQueryOptions|undefined} options
 * @returns {boolean}
 */
function nthChild(node, ancestry, nth, options) {
  if (nth === 0) {
    return false;
  }
  var _ancestry3 = _slicedToArray(ancestry, 1),
    parent = _ancestry3[0];
  if (!parent) {
    return false;
  }
  var keys = getVisitorKeys(parent, options);
  for (var i = 0; i < keys.length; ++i) {
    var listProp = parent[keys[i]];
    if (Array.isArray(listProp)) {
      var idx = nth < 0 ? listProp.length + nth : nth - 1;
      if (idx >= 0 && idx < listProp.length && listProp[idx] === node) {
        return true;
      }
    }
  }
  return false;
}

/**
 * For each selector node marked as a subject, find the portion of the
 * selector that the subject must match.
 * @param {SelectorAST} selector
 * @param {SelectorAST} [ancestor] Defaults to `selector`
 * @returns {SelectorAST[]}
 */
function subjects(selector, ancestor) {
  if (selector == null || _typeof(selector) != 'object') {
    return [];
  }
  if (ancestor == null) {
    ancestor = selector;
  }
  var results = selector.subject ? [ancestor] : [];
  var keys = Object.keys(selector);
  for (var i = 0; i < keys.length; ++i) {
    var p = keys[i];
    var sel = selector[p];
    results.push.apply(results, _toConsumableArray(subjects(sel, p === 'left' ? sel : ancestor)));
  }
  return results;
}

/**
* @callback TraverseVisitor
* @param {?external:AST} node
* @param {?external:AST} parent
* @param {external:AST[]} ancestry
*/

/**
 * From a JS AST and a selector AST, collect all JS AST nodes that
 * match the selector.
 * @param {external:AST} ast
 * @param {?SelectorAST} selector
 * @param {TraverseVisitor} visitor
 * @param {ESQueryOptions} [options]
 * @returns {external:AST[]}
 */
function traverse(ast, selector, visitor, options) {
  if (!selector) {
    return;
  }
  var ancestry = [];
  var matcher = getMatcher(selector);
  var altSubjects = subjects(selector).map(getMatcher);
  estraverse.traverse(ast, {
    enter: function enter(node, parent) {
      if (parent != null) {
        ancestry.unshift(parent);
      }
      if (matcher(node, ancestry, options)) {
        if (altSubjects.length) {
          for (var i = 0, l = altSubjects.length; i < l; ++i) {
            if (altSubjects[i](node, ancestry, options)) {
              visitor(node, parent, ancestry);
            }
            for (var k = 0, m = ancestry.length; k < m; ++k) {
              var succeedingAncestry = ancestry.slice(k + 1);
              if (altSubjects[i](ancestry[k], succeedingAncestry, options)) {
                visitor(ancestry[k], parent, succeedingAncestry);
              }
            }
          }
        } else {
          visitor(node, parent, ancestry);
        }
      }
    },
    leave: function leave() {
      ancestry.shift();
    },
    keys: options && options.visitorKeys,
    fallback: options && options.fallback || 'iteration'
  });
}

/**
 * From a JS AST and a selector AST, collect all JS AST nodes that
 * match the selector.
 * @param {external:AST} ast
 * @param {?SelectorAST} selector
 * @param {ESQueryOptions} [options]
 * @returns {external:AST[]}
 */
function match(ast, selector, options) {
  var results = [];
  traverse(ast, selector, function (node) {
    results.push(node);
  }, options);
  return results;
}

/**
 * Parse a selector string and !return its AST.
 * @param {string} selector
 * @returns {SelectorAST}
 */
function parse(selector) {
  return parser.parse(selector);
}

/**
 * Query the code AST using the selector string.
 * @param {external:AST} ast
 * @param {string} selector
 * @param {ESQueryOptions} [options]
 * @returns {external:AST[]}
 */
function query(ast, selector, options) {
  return match(ast, parse(selector), options);
}
query.parse = parse;
query.match = match;
query.traverse = traverse;
query.matches = matches;
query.query = query;

export default query;
TxƎ9qfunction e(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],u=!0,l=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return s}}(e,t)||o(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||o(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(t,r){if(t){if("string"==typeof t)return e(t,r);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function a(e,t){return e(t={exports:{}},t.exports),t.exports}var i=a((function(e,t){!function e(t){var r,n,o,a,i,s;function u(e){var t,r,n={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],n[t]="object"==typeof r&&null!==r?u(r):r);return n}function l(e,t){this.parent=e,this.key=t}function c(e,t,r,n){this.node=e,this.path=t,this.wrap=r,this.ref=n}function f(){}function p(e){return null!=e&&("object"==typeof e&&"string"==typeof e.type)}function h(e,t){return(e===r.ObjectExpression||e===r.ObjectPattern)&&"properties"===t}function y(e,t){for(var r=e.length-1;r>=0;--r)if(e[r].node===t)return!0;return!1}function d(e,t){return(new f).traverse(e,t)}function m(e,t){var r;return r=function(e,t){var r,n,o,a;for(n=e.length,o=0;n;)t(e[a=o+(r=n>>>1)])?n=r:(o=a+1,n-=r+1);return o}(t,(function(t){return t.range[0]>e.range[0]})),e.extendedRange=[e.range[0],e.range[1]],r!==t.length&&(e.extendedRange[1]=t[r].range[0]),(r-=1)>=0&&(e.extendedRange[0]=t[r].range[1]),e}return r={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ChainExpression:"ChainExpression",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",PrivateIdentifier:"PrivateIdentifier",Program:"Program",Property:"Property",PropertyDefinition:"PropertyDefinition",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},o={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},n={Break:a={},Skip:i={},Remove:s={}},l.prototype.replace=function(e){this.parent[this.key]=e},l.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},f.prototype.path=function(){var e,t,r,n,o;function a(e,t){if(Array.isArray(t))for(r=0,n=t.length;r<n;++r)e.push(t[r]);else e.push(t)}if(!this.__current.path)return null;for(o=[],e=2,t=this.__leavelist.length;e<t;++e)a(o,this.__leavelist[e].path);return a(o,this.__current.path),o},f.prototype.type=function(){return this.current().type||this.__current.wrap},f.prototype.parents=function(){var e,t,r;for(r=[],e=1,t=this.__leavelist.length;e<t;++e)r.push(this.__leavelist[e].node);return r},f.prototype.current=function(){return this.__current.node},f.prototype.__execute=function(e,t){var r,n;return n=void 0,r=this.__current,this.__current=t,this.__state=null,e&&(n=e.call(this,t.node,this.__leavelist[this.__leavelist.length-1].node)),this.__current=r,n},f.prototype.notify=function(e){this.__state=e},f.prototype.skip=function(){this.notify(i)},f.prototype.break=function(){this.notify(a)},f.prototype.remove=function(){this.notify(s)},f.prototype.__initialize=function(e,t){this.visitor=t,this.root=e,this.__worklist=[],this.__leavelist=[],this.__current=null,this.__state=null,this.__fallback=null,"iteration"===t.fallback?this.__fallback=Object.keys:"function"==typeof t.fallback&&(this.__fallback=t.fallback),this.__keys=o,t.keys&&(this.__keys=Object.assign(Object.create(this.__keys),t.keys))},f.prototype.traverse=function(e,t){var r,n,o,s,u,l,f,d,m,x,v,g;for(this.__initialize(e,t),g={},r=this.__worklist,n=this.__leavelist,r.push(new c(e,null,null,null)),n.push(new c(null,null,null,null));r.length;)if((o=r.pop())!==g){if(o.node){if(l=this.__execute(t.enter,o),this.__state===a||l===a)return;if(r.push(g),n.push(o),this.__state===i||l===i)continue;if(u=(s=o.node).type||o.wrap,!(x=this.__keys[u])){if(!this.__fallback)throw new Error("Unknown node type "+u+".");x=this.__fallback(s)}for(d=x.length;(d-=1)>=0;)if(v=s[f=x[d]])if(Array.isArray(v)){for(m=v.length;(m-=1)>=0;)if(v[m]&&!y(n,v[m])){if(h(u,x[d]))o=new c(v[m],[f,m],"Property",null);else{if(!p(v[m]))continue;o=new c(v[m],[f,m],null,null)}r.push(o)}}else if(p(v)){if(y(n,v))continue;r.push(new c(v,f,null,null))}}}else if(o=n.pop(),l=this.__execute(t.leave,o),this.__state===a||l===a)return},f.prototype.replace=function(e,t){var r,n,o,u,f,y,d,m,x,v,g,A,E;function b(e){var t,n,o,a;if(e.ref.remove())for(n=e.ref.key,a=e.ref.parent,t=r.length;t--;)if((o=r[t]).ref&&o.ref.parent===a){if(o.ref.key<n)break;--o.ref.key}}for(this.__initialize(e,t),g={},r=this.__worklist,n=this.__leavelist,y=new c(e,null,null,new l(A={root:e},"root")),r.push(y),n.push(y);r.length;)if((y=r.pop())!==g){if(void 0!==(f=this.__execute(t.enter,y))&&f!==a&&f!==i&&f!==s&&(y.ref.replace(f),y.node=f),this.__state!==s&&f!==s||(b(y),y.node=null),this.__state===a||f===a)return A.root;if((o=y.node)&&(r.push(g),n.push(y),this.__state!==i&&f!==i)){if(u=o.type||y.wrap,!(x=this.__keys[u])){if(!this.__fallback)throw new Error("Unknown node type "+u+".");x=this.__fallback(o)}for(d=x.length;(d-=1)>=0;)if(v=o[E=x[d]])if(Array.isArray(v)){for(m=v.length;(m-=1)>=0;)if(v[m]){if(h(u,x[d]))y=new c(v[m],[E,m],"Property",new l(v,m));else{if(!p(v[m]))continue;y=new c(v[m],[E,m],null,new l(v,m))}r.push(y)}}else p(v)&&r.push(new c(v,E,null,new l(o,E)))}}else if(y=n.pop(),void 0!==(f=this.__execute(t.leave,y))&&f!==a&&f!==i&&f!==s&&y.ref.replace(f),this.__state!==s&&f!==s||b(y),this.__state===a||f===a)return A.root;return A.root},t.Syntax=r,t.traverse=d,t.replace=function(e,t){return(new f).replace(e,t)},t.attachComments=function(e,t,r){var o,a,i,s,l=[];if(!e.range)throw new Error("attachComments needs range information");if(!r.length){if(t.length){for(i=0,a=t.length;i<a;i+=1)(o=u(t[i])).extendedRange=[0,e.range[0]],l.push(o);e.leadingComments=l}return e}for(i=0,a=t.length;i<a;i+=1)l.push(m(u(t[i]),r));return s=0,d(e,{enter:function(e){for(var t;s<l.length&&!((t=l[s]).extendedRange[1]>e.range[0]);)t.extendedRange[1]===e.range[0]?(e.leadingComments||(e.leadingComments=[]),e.leadingComments.push(t),l.splice(s,1)):s+=1;return s===l.length?n.Break:l[s].extendedRange[0]>e.range[1]?n.Skip:void 0}}),s=0,d(e,{leave:function(e){for(var t;s<l.length&&(t=l[s],!(e.range[1]<t.extendedRange[0]));)e.range[1]===t.extendedRange[0]?(e.trailingComments||(e.trailingComments=[]),e.trailingComments.push(t),l.splice(s,1)):s+=1;return s===l.length?n.Break:l[s].extendedRange[0]>e.range[1]?n.Skip:void 0}}),e},t.VisitorKeys=o,t.VisitorOption=n,t.Controller=f,t.cloneEnvironment=function(){return e({})},t}(t)})),s=a((function(e){e.exports&&(e.exports=function(){function e(t,r,n,o){this.message=t,this.expected=r,this.found=n,this.location=o,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),e.buildMessage=function(e,t){var r={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t,r="";for(t=0;t<e.parts.length;t++)r+=e.parts[t]instanceof Array?a(e.parts[t][0])+"-"+a(e.parts[t][1]):a(e.parts[t]);return"["+(e.inverted?"^":"")+r+"]"},any:function(e){return"any character"},end:function(e){return"end of input"},other:function(e){return e.description}};function n(e){return e.charCodeAt(0).toString(16).toUpperCase()}function o(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function a(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}return"Expected "+function(e){var t,n,o,a=new Array(e.length);for(t=0;t<e.length;t++)a[t]=(o=e[t],r[o.type](o));if(a.sort(),a.length>0){for(t=1,n=1;t<a.length;t++)a[t-1]!==a[t]&&(a[n]=a[t],n++);a.length=n}switch(a.length){case 1:return a[0];case 2:return a[0]+" or "+a[1];default:return a.slice(0,-1).join(", ")+", or "+a[a.length-1]}}(e)+" but "+function(e){return e?'"'+o(e)+'"':"end of input"}(t)+" found."},{SyntaxError:e,parse:function(t,r){r=void 0!==r?r:{};var n,o,a,i,s={},u={start:Ae},l=Ae,c=de(" ",!1),f=/^[^ [\],():#!=><~+.]/,p=me([" ","[","]",",","(",")",":","#","!","=",">","<","~","+","."],!0,!1),h=de(">",!1),y=de("~",!1),d=de("+",!1),m=de(",",!1),x=function(e,t){return[e].concat(t.map((function(e){return e[3]})))},v=de("!",!1),g=de("*",!1),A=de("#",!1),E=de("[",!1),b=de("]",!1),S=/^[><!]/,_=me([">","<","!"],!1,!1),C=de("=",!1),P=function(e){return(e||"")+"="},w=/^[><]/,k=me([">","<"],!1,!1),D=de(".",!1),I=function(e,t,r){return{type:"attribute",name:e,operator:t,value:r}},j=de('"',!1),T=/^[^\\"]/,F=me(["\\",'"'],!0,!1),R=de("\\",!1),O={type:"any"},L=function(e,t){return e+t},M=function(e){return{type:"literal",value:(t=e.join(""),t.replace(/\\(.)/g,(function(e,t){switch(t){case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";default:return t}})))};var t},B=de("'",!1),U=/^[^\\']/,K=me(["\\","'"],!0,!1),N=/^[0-9]/,W=me([["0","9"]],!1,!1),V=de("type(",!1),q=/^[^ )]/,G=me([" ",")"],!0,!1),z=de(")",!1),H=/^[imsu]/,Y=me(["i","m","s","u"],!1,!1),$=de("/",!1),J=/^[^\]\\]/,Q=me(["]","\\"],!0,!1),X=/^[^\/\\[]/,Z=me(["/","\\","["],!0,!1),ee=de(":not(",!1),te=de(":matches(",!1),re=function(e){return{type:"matches",selectors:e}},ne=de(":is(",!1),oe=de(":has(",!1),ae=de(":first-child",!1),ie=de(":last-child",!1),se=de(":nth-child(",!1),ue=de(":nth-last-child(",!1),le=de(":",!1),ce=0,fe=[{line:1,column:1}],pe=0,he=[],ye={};if("startRule"in r){if(!(r.startRule in u))throw new Error("Can't start parsing from rule \""+r.startRule+'".');l=u[r.startRule]}function de(e,t){return{type:"literal",text:e,ignoreCase:t}}function me(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function xe(e){var r,n=fe[e];if(n)return n;for(r=e-1;!fe[r];)r--;for(n={line:(n=fe[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return fe[e]=n,n}function ve(e,t){var r=xe(e),n=xe(t);return{start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:n.line,column:n.column}}}function ge(e){ce<pe||(ce>pe&&(pe=ce,he=[]),he.push(e))}function Ae(){var e,t,r,n,o=36*ce+0,a=ye[o];return a?(ce=a.nextPos,a.result):(e=ce,(t=Ee())!==s&&(r=_e())!==s&&Ee()!==s?e=t=1===(n=r).length?n[0]:{type:"matches",selectors:n}:(ce=e,e=s),e===s&&(e=ce,(t=Ee())!==s&&(t=void 0),e=t),ye[o]={nextPos:ce,result:e},e)}function Ee(){var e,r,n=36*ce+1,o=ye[n];if(o)return ce=o.nextPos,o.result;for(e=[],32===t.charCodeAt(ce)?(r=" ",ce++):(r=s,ge(c));r!==s;)e.push(r),32===t.charCodeAt(ce)?(r=" ",ce++):(r=s,ge(c));return ye[n]={nextPos:ce,result:e},e}function be(){var e,r,n,o=36*ce+2,a=ye[o];if(a)return ce=a.nextPos,a.result;if(r=[],f.test(t.charAt(ce))?(n=t.charAt(ce),ce++):(n=s,ge(p)),n!==s)for(;n!==s;)r.push(n),f.test(t.charAt(ce))?(n=t.charAt(ce),ce++):(n=s,ge(p));else r=s;return r!==s&&(r=r.join("")),e=r,ye[o]={nextPos:ce,result:e},e}function Se(){var e,r,n,o=36*ce+3,a=ye[o];return a?(ce=a.nextPos,a.result):(e=ce,(r=Ee())!==s?(62===t.charCodeAt(ce)?(n=">",ce++):(n=s,ge(h)),n!==s&&Ee()!==s?e=r="child":(ce=e,e=s)):(ce=e,e=s),e===s&&(e=ce,(r=Ee())!==s?(126===t.charCodeAt(ce)?(n="~",ce++):(n=s,ge(y)),n!==s&&Ee()!==s?e=r="sibling":(ce=e,e=s)):(ce=e,e=s),e===s&&(e=ce,(r=Ee())!==s?(43===t.charCodeAt(ce)?(n="+",ce++):(n=s,ge(d)),n!==s&&Ee()!==s?e=r="adjacent":(ce=e,e=s)):(ce=e,e=s),e===s&&(e=ce,32===t.charCodeAt(ce)?(r=" ",ce++):(r=s,ge(c)),r!==s&&(n=Ee())!==s?e=r="descendant":(ce=e,e=s)))),ye[o]={nextPos:ce,result:e},e)}function _e(){var e,r,n,o,a,i,u,l,c=36*ce+5,f=ye[c];if(f)return ce=f.nextPos,f.result;if(e=ce,(r=Pe())!==s){for(n=[],o=ce,(a=Ee())!==s?(44===t.charCodeAt(ce)?(i=",",ce++):(i=s,ge(m)),i!==s&&(u=Ee())!==s&&(l=Pe())!==s?o=a=[a,i,u,l]:(ce=o,o=s)):(ce=o,o=s);o!==s;)n.push(o),o=ce,(a=Ee())!==s?(44===t.charCodeAt(ce)?(i=",",ce++):(i=s,ge(m)),i!==s&&(u=Ee())!==s&&(l=Pe())!==s?o=a=[a,i,u,l]:(ce=o,o=s)):(ce=o,o=s);n!==s?e=r=x(r,n):(ce=e,e=s)}else ce=e,e=s;return ye[c]={nextPos:ce,result:e},e}function Ce(){var e,t,r,n,o,a=36*ce+6,i=ye[a];return i?(ce=i.nextPos,i.result):(e=ce,(t=Se())===s&&(t=null),t!==s&&(r=Pe())!==s?(o=r,e=t=(n=t)?{type:n,left:{type:"exactNode"},right:o}:o):(ce=e,e=s),ye[a]={nextPos:ce,result:e},e)}function Pe(){var e,t,r,n,o,a,i,u=36*ce+7,l=ye[u];if(l)return ce=l.nextPos,l.result;if(e=ce,(t=we())!==s){for(r=[],n=ce,(o=Se())!==s&&(a=we())!==s?n=o=[o,a]:(ce=n,n=s);n!==s;)r.push(n),n=ce,(o=Se())!==s&&(a=we())!==s?n=o=[o,a]:(ce=n,n=s);r!==s?(i=t,e=t=r.reduce((function(e,t){return{type:t[0],left:e,right:t[1]}}),i)):(ce=e,e=s)}else ce=e,e=s;return ye[u]={nextPos:ce,result:e},e}function we(){var e,r,n,o,a,i,u,l=36*ce+8,c=ye[l];if(c)return ce=c.nextPos,c.result;if(e=ce,33===t.charCodeAt(ce)?(r="!",ce++):(r=s,ge(v)),r===s&&(r=null),r!==s){if(n=[],(o=ke())!==s)for(;o!==s;)n.push(o),o=ke();else n=s;n!==s?(a=r,u=1===(i=n).length?i[0]:{type:"compound",selectors:i},a&&(u.subject=!0),e=r=u):(ce=e,e=s)}else ce=e,e=s;return ye[l]={nextPos:ce,result:e},e}function ke(){var e,r=36*ce+9,n=ye[r];return n?(ce=n.nextPos,n.result):((e=function(){var e,r,n=36*ce+10,o=ye[n];return o?(ce=o.nextPos,o.result):(42===t.charCodeAt(ce)?(r="*",ce++):(r=s,ge(g)),r!==s&&(r={type:"wildcard",value:r}),e=r,ye[n]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,o=36*ce+11,a=ye[o];return a?(ce=a.nextPos,a.result):(e=ce,35===t.charCodeAt(ce)?(r="#",ce++):(r=s,ge(A)),r===s&&(r=null),r!==s&&(n=be())!==s?e=r={type:"identifier",value:n}:(ce=e,e=s),ye[o]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,o,a=36*ce+12,i=ye[a];return i?(ce=i.nextPos,i.result):(e=ce,91===t.charCodeAt(ce)?(r="[",ce++):(r=s,ge(E)),r!==s&&Ee()!==s&&(n=function(){var e,r,n,o,a=36*ce+16,i=ye[a];return i?(ce=i.nextPos,i.result):(e=ce,(r=De())!==s&&Ee()!==s&&(n=function(){var e,r,n,o=36*ce+14,a=ye[o];return a?(ce=a.nextPos,a.result):(e=ce,33===t.charCodeAt(ce)?(r="!",ce++):(r=s,ge(v)),r===s&&(r=null),r!==s?(61===t.charCodeAt(ce)?(n="=",ce++):(n=s,ge(C)),n!==s?(r=P(r),e=r):(ce=e,e=s)):(ce=e,e=s),ye[o]={nextPos:ce,result:e},e)}())!==s&&Ee()!==s?((o=function(){var e,r,n,o,a,i=36*ce+20,u=ye[i];if(u)return ce=u.nextPos,u.result;if(e=ce,"type("===t.substr(ce,5)?(r="type(",ce+=5):(r=s,ge(V)),r!==s)if(Ee()!==s){if(n=[],q.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(G)),o!==s)for(;o!==s;)n.push(o),q.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(G));else n=s;n!==s&&(o=Ee())!==s?(41===t.charCodeAt(ce)?(a=")",ce++):(a=s,ge(z)),a!==s?(r={type:"type",value:n.join("")},e=r):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;else ce=e,e=s;return ye[i]={nextPos:ce,result:e},e}())===s&&(o=function(){var e,r,n,o,a,i,u=36*ce+22,l=ye[u];if(l)return ce=l.nextPos,l.result;if(e=ce,47===t.charCodeAt(ce)?(r="/",ce++):(r=s,ge($)),r!==s){if(n=[],(o=Ie())===s&&(o=je())===s&&(o=Te()),o!==s)for(;o!==s;)n.push(o),(o=Ie())===s&&(o=je())===s&&(o=Te());else n=s;n!==s?(47===t.charCodeAt(ce)?(o="/",ce++):(o=s,ge($)),o!==s?((a=function(){var e,r,n=36*ce+21,o=ye[n];if(o)return ce=o.nextPos,o.result;if(e=[],H.test(t.charAt(ce))?(r=t.charAt(ce),ce++):(r=s,ge(Y)),r!==s)for(;r!==s;)e.push(r),H.test(t.charAt(ce))?(r=t.charAt(ce),ce++):(r=s,ge(Y));else e=s;return ye[n]={nextPos:ce,result:e},e}())===s&&(a=null),a!==s?(i=a,r={type:"regexp",value:new RegExp(n.join(""),i?i.join(""):"")},e=r):(ce=e,e=s)):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;return ye[u]={nextPos:ce,result:e},e}()),o!==s?(r=I(r,n,o),e=r):(ce=e,e=s)):(ce=e,e=s),e===s&&(e=ce,(r=De())!==s&&Ee()!==s&&(n=function(){var e,r,n,o=36*ce+13,a=ye[o];return a?(ce=a.nextPos,a.result):(e=ce,S.test(t.charAt(ce))?(r=t.charAt(ce),ce++):(r=s,ge(_)),r===s&&(r=null),r!==s?(61===t.charCodeAt(ce)?(n="=",ce++):(n=s,ge(C)),n!==s?(r=P(r),e=r):(ce=e,e=s)):(ce=e,e=s),e===s&&(w.test(t.charAt(ce))?(e=t.charAt(ce),ce++):(e=s,ge(k))),ye[o]={nextPos:ce,result:e},e)}())!==s&&Ee()!==s?((o=function(){var e,r,n,o,a,i,u=36*ce+17,l=ye[u];if(l)return ce=l.nextPos,l.result;if(e=ce,34===t.charCodeAt(ce)?(r='"',ce++):(r=s,ge(j)),r!==s){for(n=[],T.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(F)),o===s&&(o=ce,92===t.charCodeAt(ce)?(a="\\",ce++):(a=s,ge(R)),a!==s?(t.length>ce?(i=t.charAt(ce),ce++):(i=s,ge(O)),i!==s?(a=L(a,i),o=a):(ce=o,o=s)):(ce=o,o=s));o!==s;)n.push(o),T.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(F)),o===s&&(o=ce,92===t.charCodeAt(ce)?(a="\\",ce++):(a=s,ge(R)),a!==s?(t.length>ce?(i=t.charAt(ce),ce++):(i=s,ge(O)),i!==s?(a=L(a,i),o=a):(ce=o,o=s)):(ce=o,o=s));n!==s?(34===t.charCodeAt(ce)?(o='"',ce++):(o=s,ge(j)),o!==s?(r=M(n),e=r):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;if(e===s)if(e=ce,39===t.charCodeAt(ce)?(r="'",ce++):(r=s,ge(B)),r!==s){for(n=[],U.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(K)),o===s&&(o=ce,92===t.charCodeAt(ce)?(a="\\",ce++):(a=s,ge(R)),a!==s?(t.length>ce?(i=t.charAt(ce),ce++):(i=s,ge(O)),i!==s?(a=L(a,i),o=a):(ce=o,o=s)):(ce=o,o=s));o!==s;)n.push(o),U.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(K)),o===s&&(o=ce,92===t.charCodeAt(ce)?(a="\\",ce++):(a=s,ge(R)),a!==s?(t.length>ce?(i=t.charAt(ce),ce++):(i=s,ge(O)),i!==s?(a=L(a,i),o=a):(ce=o,o=s)):(ce=o,o=s));n!==s?(39===t.charCodeAt(ce)?(o="'",ce++):(o=s,ge(B)),o!==s?(r=M(n),e=r):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;return ye[u]={nextPos:ce,result:e},e}())===s&&(o=function(){var e,r,n,o,a,i,u,l=36*ce+18,c=ye[l];if(c)return ce=c.nextPos,c.result;for(e=ce,r=ce,n=[],N.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(W));o!==s;)n.push(o),N.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(W));if(n!==s?(46===t.charCodeAt(ce)?(o=".",ce++):(o=s,ge(D)),o!==s?r=n=[n,o]:(ce=r,r=s)):(ce=r,r=s),r===s&&(r=null),r!==s){if(n=[],N.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(W)),o!==s)for(;o!==s;)n.push(o),N.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(W));else n=s;n!==s?(i=n,u=(a=r)?[].concat.apply([],a).join(""):"",r={type:"literal",value:parseFloat(u+i.join(""))},e=r):(ce=e,e=s)}else ce=e,e=s;return ye[l]={nextPos:ce,result:e},e}())===s&&(o=function(){var e,t,r=36*ce+19,n=ye[r];return n?(ce=n.nextPos,n.result):((t=be())!==s&&(t={type:"literal",value:t}),e=t,ye[r]={nextPos:ce,result:e},e)}()),o!==s?(r=I(r,n,o),e=r):(ce=e,e=s)):(ce=e,e=s),e===s&&(e=ce,(r=De())!==s&&(r={type:"attribute",name:r}),e=r)),ye[a]={nextPos:ce,result:e},e)}())!==s&&Ee()!==s?(93===t.charCodeAt(ce)?(o="]",ce++):(o=s,ge(b)),o!==s?e=r=n:(ce=e,e=s)):(ce=e,e=s),ye[a]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,o,a,i,u,l,c=36*ce+26,f=ye[c];if(f)return ce=f.nextPos,f.result;if(e=ce,46===t.charCodeAt(ce)?(r=".",ce++):(r=s,ge(D)),r!==s)if((n=be())!==s){for(o=[],a=ce,46===t.charCodeAt(ce)?(i=".",ce++):(i=s,ge(D)),i!==s&&(u=be())!==s?a=i=[i,u]:(ce=a,a=s);a!==s;)o.push(a),a=ce,46===t.charCodeAt(ce)?(i=".",ce++):(i=s,ge(D)),i!==s&&(u=be())!==s?a=i=[i,u]:(ce=a,a=s);o!==s?(l=n,r={type:"field",name:o.reduce((function(e,t){return e+t[0]+t[1]}),l)},e=r):(ce=e,e=s)}else ce=e,e=s;else ce=e,e=s;return ye[c]={nextPos:ce,result:e},e}())===s&&(e=function(){var e,r,n,o,a=36*ce+27,i=ye[a];return i?(ce=i.nextPos,i.result):(e=ce,":not("===t.substr(ce,5)?(r=":not(",ce+=5):(r=s,ge(ee)),r!==s&&Ee()!==s&&(n=_e())!==s&&Ee()!==s?(41===t.charCodeAt(ce)?(o=")",ce++):(o=s,ge(z)),o!==s?e=r={type:"not",selectors:n}:(ce=e,e=s)):(ce=e,e=s),ye[a]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,o,a=36*ce+28,i=ye[a];return i?(ce=i.nextPos,i.result):(e=ce,":matches("===t.substr(ce,9)?(r=":matches(",ce+=9):(r=s,ge(te)),r!==s&&Ee()!==s&&(n=_e())!==s&&Ee()!==s?(41===t.charCodeAt(ce)?(o=")",ce++):(o=s,ge(z)),o!==s?(r=re(n),e=r):(ce=e,e=s)):(ce=e,e=s),ye[a]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,o,a=36*ce+29,i=ye[a];return i?(ce=i.nextPos,i.result):(e=ce,":is("===t.substr(ce,4)?(r=":is(",ce+=4):(r=s,ge(ne)),r!==s&&Ee()!==s&&(n=_e())!==s&&Ee()!==s?(41===t.charCodeAt(ce)?(o=")",ce++):(o=s,ge(z)),o!==s?(r=re(n),e=r):(ce=e,e=s)):(ce=e,e=s),ye[a]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,o,a=36*ce+30,i=ye[a];return i?(ce=i.nextPos,i.result):(e=ce,":has("===t.substr(ce,5)?(r=":has(",ce+=5):(r=s,ge(oe)),r!==s&&Ee()!==s&&(n=function(){var e,r,n,o,a,i,u,l,c=36*ce+4,f=ye[c];if(f)return ce=f.nextPos,f.result;if(e=ce,(r=Ce())!==s){for(n=[],o=ce,(a=Ee())!==s?(44===t.charCodeAt(ce)?(i=",",ce++):(i=s,ge(m)),i!==s&&(u=Ee())!==s&&(l=Ce())!==s?o=a=[a,i,u,l]:(ce=o,o=s)):(ce=o,o=s);o!==s;)n.push(o),o=ce,(a=Ee())!==s?(44===t.charCodeAt(ce)?(i=",",ce++):(i=s,ge(m)),i!==s&&(u=Ee())!==s&&(l=Ce())!==s?o=a=[a,i,u,l]:(ce=o,o=s)):(ce=o,o=s);n!==s?e=r=x(r,n):(ce=e,e=s)}else ce=e,e=s;return ye[c]={nextPos:ce,result:e},e}())!==s&&Ee()!==s?(41===t.charCodeAt(ce)?(o=")",ce++):(o=s,ge(z)),o!==s?e=r={type:"has",selectors:n}:(ce=e,e=s)):(ce=e,e=s),ye[a]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n=36*ce+31,o=ye[n];return o?(ce=o.nextPos,o.result):(":first-child"===t.substr(ce,12)?(r=":first-child",ce+=12):(r=s,ge(ae)),r!==s&&(r=Fe(1)),e=r,ye[n]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n=36*ce+32,o=ye[n];return o?(ce=o.nextPos,o.result):(":last-child"===t.substr(ce,11)?(r=":last-child",ce+=11):(r=s,ge(ie)),r!==s&&(r=Re(1)),e=r,ye[n]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,o,a,i=36*ce+33,u=ye[i];if(u)return ce=u.nextPos,u.result;if(e=ce,":nth-child("===t.substr(ce,11)?(r=":nth-child(",ce+=11):(r=s,ge(se)),r!==s)if(Ee()!==s){if(n=[],N.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(W)),o!==s)for(;o!==s;)n.push(o),N.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(W));else n=s;n!==s&&(o=Ee())!==s?(41===t.charCodeAt(ce)?(a=")",ce++):(a=s,ge(z)),a!==s?(r=Fe(parseInt(n.join(""),10)),e=r):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;else ce=e,e=s;return ye[i]={nextPos:ce,result:e},e}())===s&&(e=function(){var e,r,n,o,a,i=36*ce+34,u=ye[i];if(u)return ce=u.nextPos,u.result;if(e=ce,":nth-last-child("===t.substr(ce,16)?(r=":nth-last-child(",ce+=16):(r=s,ge(ue)),r!==s)if(Ee()!==s){if(n=[],N.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(W)),o!==s)for(;o!==s;)n.push(o),N.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(W));else n=s;n!==s&&(o=Ee())!==s?(41===t.charCodeAt(ce)?(a=")",ce++):(a=s,ge(z)),a!==s?(r=Re(parseInt(n.join(""),10)),e=r):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;else ce=e,e=s;return ye[i]={nextPos:ce,result:e},e}())===s&&(e=function(){var e,r,n,o=36*ce+35,a=ye[o];return a?(ce=a.nextPos,a.result):(e=ce,58===t.charCodeAt(ce)?(r=":",ce++):(r=s,ge(le)),r!==s&&(n=be())!==s?e=r={type:"class",name:n}:(ce=e,e=s),ye[o]={nextPos:ce,result:e},e)}()),ye[r]={nextPos:ce,result:e},e)}function De(){var e,r,n,o,a,i,u,l,c=36*ce+15,f=ye[c];if(f)return ce=f.nextPos,f.result;if(e=ce,(r=be())!==s){for(n=[],o=ce,46===t.charCodeAt(ce)?(a=".",ce++):(a=s,ge(D)),a!==s&&(i=be())!==s?o=a=[a,i]:(ce=o,o=s);o!==s;)n.push(o),o=ce,46===t.charCodeAt(ce)?(a=".",ce++):(a=s,ge(D)),a!==s&&(i=be())!==s?o=a=[a,i]:(ce=o,o=s);n!==s?(u=r,l=n,e=r=[].concat.apply([u],l).join("")):(ce=e,e=s)}else ce=e,e=s;return ye[c]={nextPos:ce,result:e},e}function Ie(){var e,r,n,o,a=36*ce+23,i=ye[a];if(i)return ce=i.nextPos,i.result;if(e=ce,91===t.charCodeAt(ce)?(r="[",ce++):(r=s,ge(E)),r!==s){if(n=[],J.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(Q)),o===s&&(o=je()),o!==s)for(;o!==s;)n.push(o),J.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(Q)),o===s&&(o=je());else n=s;n!==s?(93===t.charCodeAt(ce)?(o="]",ce++):(o=s,ge(b)),o!==s?e=r="["+n.join("")+"]":(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;return ye[a]={nextPos:ce,result:e},e}function je(){var e,r,n,o=36*ce+24,a=ye[o];return a?(ce=a.nextPos,a.result):(e=ce,92===t.charCodeAt(ce)?(r="\\",ce++):(r=s,ge(R)),r!==s?(t.length>ce?(n=t.charAt(ce),ce++):(n=s,ge(O)),n!==s?e=r="\\"+n:(ce=e,e=s)):(ce=e,e=s),ye[o]={nextPos:ce,result:e},e)}function Te(){var e,r,n,o=36*ce+25,a=ye[o];if(a)return ce=a.nextPos,a.result;if(r=[],X.test(t.charAt(ce))?(n=t.charAt(ce),ce++):(n=s,ge(Z)),n!==s)for(;n!==s;)r.push(n),X.test(t.charAt(ce))?(n=t.charAt(ce),ce++):(n=s,ge(Z));else r=s;return r!==s&&(r=r.join("")),e=r,ye[o]={nextPos:ce,result:e},e}function Fe(e){return{type:"nth-child",index:{type:"literal",value:e}}}function Re(e){return{type:"nth-last-child",index:{type:"literal",value:e}}}if((n=l())!==s&&ce===t.length)return n;throw n!==s&&ce<t.length&&ge({type:"end"}),o=he,a=pe<t.length?t.charAt(pe):null,i=pe<t.length?ve(pe,pe+1):ve(pe,pe),new e(e.buildMessage(o,a),o,a,i)}}}())}));function u(e,t){for(var r=0;r<t.length;++r){if(null==e)return e;e=e[t[r]]}return e}var l="function"==typeof WeakMap?new WeakMap:null;function c(e){if(null==e)return function(){return!0};if(null!=l){var t=l.get(e);return null!=t||(t=f(e),l.set(e,t)),t}return f(e)}function f(e){switch(e.type){case"wildcard":return function(){return!0};case"identifier":var t=e.value.toLowerCase();return function(e,r,n){var o=n&&n.nodeTypeKey||"type";return t===e[o].toLowerCase()};case"exactNode":return function(e,t){return 0===t.length};case"field":var r=e.name.split(".");return function(e,t){return function e(t,r,n,o){for(var a=r,i=o;i<n.length;++i){if(null==a)return!1;var s=a[n[i]];if(Array.isArray(s)){for(var u=0;u<s.length;++u)if(e(t,s[u],n,i+1))return!0;return!1}a=s}return t===a}(e,t[r.length-1],r,0)};case"matches":var o=e.selectors.map(c);return function(e,t,r){for(var n=0;n<o.length;++n)if(o[n](e,t,r))return!0;return!1};case"compound":var a=e.selectors.map(c);return function(e,t,r){for(var n=0;n<a.length;++n)if(!a[n](e,t,r))return!1;return!0};case"not":var s=e.selectors.map(c);return function(e,t,r){for(var n=0;n<s.length;++n)if(s[n](e,t,r))return!1;return!0};case"has":var l=e.selectors.map(c);return function(e,t,r){var n=!1,o=[];return i.traverse(e,{enter:function(e,t){null!=t&&o.unshift(t);for(var a=0;a<l.length;++a)if(l[a](e,o,r))return n=!0,void this.break()},leave:function(){o.shift()},keys:r&&r.visitorKeys,fallback:r&&r.fallback||"iteration"}),n};case"child":var f=c(e.left),p=c(e.right);return function(e,t,r){return!!(t.length>0&&p(e,t,r))&&f(t[0],t.slice(1),r)};case"descendant":var h=c(e.left),x=c(e.right);return function(e,t,r){if(x(e,t,r))for(var n=0,o=t.length;n<o;++n)if(h(t[n],t.slice(n+1),r))return!0;return!1};case"attribute":var v=e.name.split(".");switch(e.operator){case void 0:return function(e){return null!=u(e,v)};case"=":switch(e.value.type){case"regexp":return function(t){var r=u(t,v);return"string"==typeof r&&e.value.value.test(r)};case"literal":var g="".concat(e.value.value);return function(e){return g==="".concat(u(e,v))};case"type":return function(t){return e.value.value===n(u(t,v))}}throw new Error("Unknown selector value type: ".concat(e.value.type));case"!=":switch(e.value.type){case"regexp":return function(t){return!e.value.value.test(u(t,v))};case"literal":var A="".concat(e.value.value);return function(e){return A!=="".concat(u(e,v))};case"type":return function(t){return e.value.value!==n(u(t,v))}}throw new Error("Unknown selector value type: ".concat(e.value.type));case"<=":return function(t){return u(t,v)<=e.value.value};case"<":return function(t){return u(t,v)<e.value.value};case">":return function(t){return u(t,v)>e.value.value};case">=":return function(t){return u(t,v)>=e.value.value}}throw new Error("Unknown operator: ".concat(e.operator));case"sibling":var E=c(e.left),b=c(e.right);return function(t,r,n){return b(t,r,n)&&y(t,E,r,"LEFT_SIDE",n)||e.left.subject&&E(t,r,n)&&y(t,b,r,"RIGHT_SIDE",n)};case"adjacent":var S=c(e.left),_=c(e.right);return function(t,r,n){return _(t,r,n)&&d(t,S,r,"LEFT_SIDE",n)||e.right.subject&&S(t,r,n)&&d(t,_,r,"RIGHT_SIDE",n)};case"nth-child":var C=e.index.value,P=c(e.right);return function(e,t,r){return P(e,t,r)&&m(e,t,C,r)};case"nth-last-child":var w=-e.index.value,k=c(e.right);return function(e,t,r){return k(e,t,r)&&m(e,t,w,r)};case"class":var D=e.name.toLowerCase();return function(t,r,n){if(n&&n.matchClass)return n.matchClass(e.name,t,r);if(n&&n.nodeTypeKey)return!1;switch(D){case"statement":if("Statement"===t.type.slice(-9))return!0;case"declaration":return"Declaration"===t.type.slice(-11);case"pattern":if("Pattern"===t.type.slice(-7))return!0;case"expression":return"Expression"===t.type.slice(-10)||"Literal"===t.type.slice(-7)||"Identifier"===t.type&&(0===r.length||"MetaProperty"!==r[0].type)||"MetaProperty"===t.type;case"function":return"FunctionDeclaration"===t.type||"FunctionExpression"===t.type||"ArrowFunctionExpression"===t.type}throw new Error("Unknown class name: ".concat(e.name))}}throw new Error("Unknown selector type: ".concat(e.type))}function p(e,t){var r=t&&t.nodeTypeKey||"type",n=e[r];return t&&t.visitorKeys&&t.visitorKeys[n]?t.visitorKeys[n]:i.VisitorKeys[n]?i.VisitorKeys[n]:t&&"function"==typeof t.fallback?t.fallback(e):Object.keys(e).filter((function(e){return e!==r}))}function h(e,t){var r=t&&t.nodeTypeKey||"type";return null!==e&&"object"===n(e)&&"string"==typeof e[r]}function y(e,r,n,o,a){var i=t(n,1)[0];if(!i)return!1;for(var s=p(i,a),u=0;u<s.length;++u){var l=i[s[u]];if(Array.isArray(l)){var c=l.indexOf(e);if(c<0)continue;var f=void 0,y=void 0;"LEFT_SIDE"===o?(f=0,y=c):(f=c+1,y=l.length);for(var d=f;d<y;++d)if(h(l[d],a)&&r(l[d],n,a))return!0}}return!1}function d(e,r,n,o,a){var i=t(n,1)[0];if(!i)return!1;for(var s=p(i,a),u=0;u<s.length;++u){var l=i[s[u]];if(Array.isArray(l)){var c=l.indexOf(e);if(c<0)continue;if("LEFT_SIDE"===o&&c>0&&h(l[c-1],a)&&r(l[c-1],n,a))return!0;if("RIGHT_SIDE"===o&&c<l.length-1&&h(l[c+1],a)&&r(l[c+1],n,a))return!0}}return!1}function m(e,r,n,o){if(0===n)return!1;var a=t(r,1)[0];if(!a)return!1;for(var i=p(a,o),s=0;s<i.length;++s){var u=a[i[s]];if(Array.isArray(u)){var l=n<0?u.length+n:n-1;if(l>=0&&l<u.length&&u[l]===e)return!0}}return!1}function x(e,t,o,a){if(t){var s=[],u=c(t),l=function e(t,o){if(null==t||"object"!=n(t))return[];null==o&&(o=t);for(var a=t.subject?[o]:[],i=Object.keys(t),s=0;s<i.length;++s){var u=i[s],l=t[u];a.push.apply(a,r(e(l,"left"===u?l:o)))}return a}(t).map(c);i.traverse(e,{enter:function(e,t){if(null!=t&&s.unshift(t),u(e,s,a))if(l.length)for(var r=0,n=l.length;r<n;++r){l[r](e,s,a)&&o(e,t,s);for(var i=0,c=s.length;i<c;++i){var f=s.slice(i+1);l[r](s[i],f,a)&&o(s[i],t,f)}}else o(e,t,s)},leave:function(){s.shift()},keys:a&&a.visitorKeys,fallback:a&&a.fallback||"iteration"})}}function v(e,t,r){var n=[];return x(e,t,(function(e){n.push(e)}),r),n}function g(e){return s.parse(e)}function A(e,t,r){return v(e,g(t),r)}A.parse=g,A.match=v,A.traverse=x,A.matches=function(e,t,r,n){return!t||!!e&&(r||(r=[]),c(t)(e,r,n))},A.query=A;export default A;
//# sourceMappingURL=esquery.esm.min.js.map
Iӽ\x   {"version":3,"file":"esquery.esm.min.js","sources":["../node_modules/estraverse/estraverse.js","../parser.js","../esquery.js"],"sourcesContent":["/*\n  Copyright (C) 2012-2013 Yusuke Suzuki <utatane.tea@gmail.com>\n  Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>\n\n  Redistribution and use in source and binary forms, with or without\n  modification, are permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright\n      notice, this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright\n      notice, this list of conditions and the following disclaimer in the\n      documentation and/or other materials provided with the distribution.\n\n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\n  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n/*jslint vars:false, bitwise:true*/\n/*jshint indent:4*/\n/*global exports:true*/\n(function clone(exports) {\n    'use strict';\n\n    var Syntax,\n        VisitorOption,\n        VisitorKeys,\n        BREAK,\n        SKIP,\n        REMOVE;\n\n    function deepCopy(obj) {\n        var ret = {}, key, val;\n        for (key in obj) {\n            if (obj.hasOwnProperty(key)) {\n                val = obj[key];\n                if (typeof val === 'object' && val !== null) {\n                    ret[key] = deepCopy(val);\n                } else {\n                    ret[key] = val;\n                }\n            }\n        }\n        return ret;\n    }\n\n    // based on LLVM libc++ upper_bound / lower_bound\n    // MIT License\n\n    function upperBound(array, func) {\n        var diff, len, i, current;\n\n        len = array.length;\n        i = 0;\n\n        while (len) {\n            diff = len >>> 1;\n            current = i + diff;\n            if (func(array[current])) {\n                len = diff;\n            } else {\n                i = current + 1;\n                len -= diff + 1;\n            }\n        }\n        return i;\n    }\n\n    Syntax = {\n        AssignmentExpression: 'AssignmentExpression',\n        AssignmentPattern: 'AssignmentPattern',\n        ArrayExpression: 'ArrayExpression',\n        ArrayPattern: 'ArrayPattern',\n        ArrowFunctionExpression: 'ArrowFunctionExpression',\n        AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7.\n        BlockStatement: 'BlockStatement',\n        BinaryExpression: 'BinaryExpression',\n        BreakStatement: 'BreakStatement',\n        CallExpression: 'CallExpression',\n        CatchClause: 'CatchClause',\n        ChainExpression: 'ChainExpression',\n        ClassBody: 'ClassBody',\n        ClassDeclaration: 'ClassDeclaration',\n        ClassExpression: 'ClassExpression',\n        ComprehensionBlock: 'ComprehensionBlock',  // CAUTION: It's deferred to ES7.\n        ComprehensionExpression: 'ComprehensionExpression',  // CAUTION: It's deferred to ES7.\n        ConditionalExpression: 'ConditionalExpression',\n        ContinueStatement: 'ContinueStatement',\n        DebuggerStatement: 'DebuggerStatement',\n        DirectiveStatement: 'DirectiveStatement',\n        DoWhileStatement: 'DoWhileStatement',\n        EmptyStatement: 'EmptyStatement',\n        ExportAllDeclaration: 'ExportAllDeclaration',\n        ExportDefaultDeclaration: 'ExportDefaultDeclaration',\n        ExportNamedDeclaration: 'ExportNamedDeclaration',\n        ExportSpecifier: 'ExportSpecifier',\n        ExpressionStatement: 'ExpressionStatement',\n        ForStatement: 'ForStatement',\n        ForInStatement: 'ForInStatement',\n        ForOfStatement: 'ForOfStatement',\n        FunctionDeclaration: 'FunctionDeclaration',\n        FunctionExpression: 'FunctionExpression',\n        GeneratorExpression: 'GeneratorExpression',  // CAUTION: It's deferred to ES7.\n        Identifier: 'Identifier',\n        IfStatement: 'IfStatement',\n        ImportExpression: 'ImportExpression',\n        ImportDeclaration: 'ImportDeclaration',\n        ImportDefaultSpecifier: 'ImportDefaultSpecifier',\n        ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',\n        ImportSpecifier: 'ImportSpecifier',\n        Literal: 'Literal',\n        LabeledStatement: 'LabeledStatement',\n        LogicalExpression: 'LogicalExpression',\n        MemberExpression: 'MemberExpression',\n        MetaProperty: 'MetaProperty',\n        MethodDefinition: 'MethodDefinition',\n        ModuleSpecifier: 'ModuleSpecifier',\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        Super: 'Super',\n        SwitchStatement: 'SwitchStatement',\n        SwitchCase: 'SwitchCase',\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    };\n\n    VisitorKeys = {\n        AssignmentExpression: ['left', 'right'],\n        AssignmentPattern: ['left', 'right'],\n        ArrayExpression: ['elements'],\n        ArrayPattern: ['elements'],\n        ArrowFunctionExpression: ['params', 'body'],\n        AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7.\n        BlockStatement: ['body'],\n        BinaryExpression: ['left', 'right'],\n        BreakStatement: ['label'],\n        CallExpression: ['callee', 'arguments'],\n        CatchClause: ['param', 'body'],\n        ChainExpression: ['expression'],\n        ClassBody: ['body'],\n        ClassDeclaration: ['id', 'superClass', 'body'],\n        ClassExpression: ['id', 'superClass', 'body'],\n        ComprehensionBlock: ['left', 'right'],  // CAUTION: It's deferred to ES7.\n        ComprehensionExpression: ['blocks', 'filter', 'body'],  // CAUTION: It's deferred to ES7.\n        ConditionalExpression: ['test', 'consequent', 'alternate'],\n        ContinueStatement: ['label'],\n        DebuggerStatement: [],\n        DirectiveStatement: [],\n        DoWhileStatement: ['body', 'test'],\n        EmptyStatement: [],\n        ExportAllDeclaration: ['source'],\n        ExportDefaultDeclaration: ['declaration'],\n        ExportNamedDeclaration: ['declaration', 'specifiers', 'source'],\n        ExportSpecifier: ['exported', 'local'],\n        ExpressionStatement: ['expression'],\n        ForStatement: ['init', 'test', 'update', 'body'],\n        ForInStatement: ['left', 'right', 'body'],\n        ForOfStatement: ['left', 'right', 'body'],\n        FunctionDeclaration: ['id', 'params', 'body'],\n        FunctionExpression: ['id', 'params', 'body'],\n        GeneratorExpression: ['blocks', 'filter', 'body'],  // CAUTION: It's deferred to ES7.\n        Identifier: [],\n        IfStatement: ['test', 'consequent', 'alternate'],\n        ImportExpression: ['source'],\n        ImportDeclaration: ['specifiers', 'source'],\n        ImportDefaultSpecifier: ['local'],\n        ImportNamespaceSpecifier: ['local'],\n        ImportSpecifier: ['imported', 'local'],\n        Literal: [],\n        LabeledStatement: ['label', 'body'],\n        LogicalExpression: ['left', 'right'],\n        MemberExpression: ['object', 'property'],\n        MetaProperty: ['meta', 'property'],\n        MethodDefinition: ['key', 'value'],\n        ModuleSpecifier: [],\n        NewExpression: ['callee', 'arguments'],\n        ObjectExpression: ['properties'],\n        ObjectPattern: ['properties'],\n        PrivateIdentifier: [],\n        Program: ['body'],\n        Property: ['key', 'value'],\n        PropertyDefinition: ['key', 'value'],\n        RestElement: [ 'argument' ],\n        ReturnStatement: ['argument'],\n        SequenceExpression: ['expressions'],\n        SpreadElement: ['argument'],\n        Super: [],\n        SwitchStatement: ['discriminant', 'cases'],\n        SwitchCase: ['test', 'consequent'],\n        TaggedTemplateExpression: ['tag', 'quasi'],\n        TemplateElement: [],\n        TemplateLiteral: ['quasis', 'expressions'],\n        ThisExpression: [],\n        ThrowStatement: ['argument'],\n        TryStatement: ['block', 'handler', 'finalizer'],\n        UnaryExpression: ['argument'],\n        UpdateExpression: ['argument'],\n        VariableDeclaration: ['declarations'],\n        VariableDeclarator: ['id', 'init'],\n        WhileStatement: ['test', 'body'],\n        WithStatement: ['object', 'body'],\n        YieldExpression: ['argument']\n    };\n\n    // unique id\n    BREAK = {};\n    SKIP = {};\n    REMOVE = {};\n\n    VisitorOption = {\n        Break: BREAK,\n        Skip: SKIP,\n        Remove: REMOVE\n    };\n\n    function Reference(parent, key) {\n        this.parent = parent;\n        this.key = key;\n    }\n\n    Reference.prototype.replace = function replace(node) {\n        this.parent[this.key] = node;\n    };\n\n    Reference.prototype.remove = function remove() {\n        if (Array.isArray(this.parent)) {\n            this.parent.splice(this.key, 1);\n            return true;\n        } else {\n            this.replace(null);\n            return false;\n        }\n    };\n\n    function Element(node, path, wrap, ref) {\n        this.node = node;\n        this.path = path;\n        this.wrap = wrap;\n        this.ref = ref;\n    }\n\n    function Controller() { }\n\n    // API:\n    // return property path array from root to current node\n    Controller.prototype.path = function path() {\n        var i, iz, j, jz, result, element;\n\n        function addToPath(result, path) {\n            if (Array.isArray(path)) {\n                for (j = 0, jz = path.length; j < jz; ++j) {\n                    result.push(path[j]);\n                }\n            } else {\n                result.push(path);\n            }\n        }\n\n        // root node\n        if (!this.__current.path) {\n            return null;\n        }\n\n        // first node is sentinel, second node is root element\n        result = [];\n        for (i = 2, iz = this.__leavelist.length; i < iz; ++i) {\n            element = this.__leavelist[i];\n            addToPath(result, element.path);\n        }\n        addToPath(result, this.__current.path);\n        return result;\n    };\n\n    // API:\n    // return type of current node\n    Controller.prototype.type = function () {\n        var node = this.current();\n        return node.type || this.__current.wrap;\n    };\n\n    // API:\n    // return array of parent elements\n    Controller.prototype.parents = function parents() {\n        var i, iz, result;\n\n        // first node is sentinel\n        result = [];\n        for (i = 1, iz = this.__leavelist.length; i < iz; ++i) {\n            result.push(this.__leavelist[i].node);\n        }\n\n        return result;\n    };\n\n    // API:\n    // return current node\n    Controller.prototype.current = function current() {\n        return this.__current.node;\n    };\n\n    Controller.prototype.__execute = function __execute(callback, element) {\n        var previous, result;\n\n        result = undefined;\n\n        previous  = this.__current;\n        this.__current = element;\n        this.__state = null;\n        if (callback) {\n            result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node);\n        }\n        this.__current = previous;\n\n        return result;\n    };\n\n    // API:\n    // notify control skip / break\n    Controller.prototype.notify = function notify(flag) {\n        this.__state = flag;\n    };\n\n    // API:\n    // skip child nodes of current node\n    Controller.prototype.skip = function () {\n        this.notify(SKIP);\n    };\n\n    // API:\n    // break traversals\n    Controller.prototype['break'] = function () {\n        this.notify(BREAK);\n    };\n\n    // API:\n    // remove node\n    Controller.prototype.remove = function () {\n        this.notify(REMOVE);\n    };\n\n    Controller.prototype.__initialize = function(root, visitor) {\n        this.visitor = visitor;\n        this.root = root;\n        this.__worklist = [];\n        this.__leavelist = [];\n        this.__current = null;\n        this.__state = null;\n        this.__fallback = null;\n        if (visitor.fallback === 'iteration') {\n            this.__fallback = Object.keys;\n        } else if (typeof visitor.fallback === 'function') {\n            this.__fallback = visitor.fallback;\n        }\n\n        this.__keys = VisitorKeys;\n        if (visitor.keys) {\n            this.__keys = Object.assign(Object.create(this.__keys), visitor.keys);\n        }\n    };\n\n    function isNode(node) {\n        if (node == null) {\n            return false;\n        }\n        return typeof node === 'object' && typeof node.type === 'string';\n    }\n\n    function isProperty(nodeType, key) {\n        return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key;\n    }\n  \n    function candidateExistsInLeaveList(leavelist, candidate) {\n        for (var i = leavelist.length - 1; i >= 0; --i) {\n            if (leavelist[i].node === candidate) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    Controller.prototype.traverse = function traverse(root, visitor) {\n        var worklist,\n            leavelist,\n            element,\n            node,\n            nodeType,\n            ret,\n            key,\n            current,\n            current2,\n            candidates,\n            candidate,\n            sentinel;\n\n        this.__initialize(root, visitor);\n\n        sentinel = {};\n\n        // reference\n        worklist = this.__worklist;\n        leavelist = this.__leavelist;\n\n        // initialize\n        worklist.push(new Element(root, null, null, null));\n        leavelist.push(new Element(null, null, null, null));\n\n        while (worklist.length) {\n            element = worklist.pop();\n\n            if (element === sentinel) {\n                element = leavelist.pop();\n\n                ret = this.__execute(visitor.leave, element);\n\n                if (this.__state === BREAK || ret === BREAK) {\n                    return;\n                }\n                continue;\n            }\n\n            if (element.node) {\n\n                ret = this.__execute(visitor.enter, element);\n\n                if (this.__state === BREAK || ret === BREAK) {\n                    return;\n                }\n\n                worklist.push(sentinel);\n                leavelist.push(element);\n\n                if (this.__state === SKIP || ret === SKIP) {\n                    continue;\n                }\n\n                node = element.node;\n                nodeType = node.type || element.wrap;\n                candidates = this.__keys[nodeType];\n                if (!candidates) {\n                    if (this.__fallback) {\n                        candidates = this.__fallback(node);\n                    } else {\n                        throw new Error('Unknown node type ' + nodeType + '.');\n                    }\n                }\n\n                current = candidates.length;\n                while ((current -= 1) >= 0) {\n                    key = candidates[current];\n                    candidate = node[key];\n                    if (!candidate) {\n                        continue;\n                    }\n\n                    if (Array.isArray(candidate)) {\n                        current2 = candidate.length;\n                        while ((current2 -= 1) >= 0) {\n                            if (!candidate[current2]) {\n                                continue;\n                            }\n\n                            if (candidateExistsInLeaveList(leavelist, candidate[current2])) {\n                              continue;\n                            }\n\n                            if (isProperty(nodeType, candidates[current])) {\n                                element = new Element(candidate[current2], [key, current2], 'Property', null);\n                            } else if (isNode(candidate[current2])) {\n                                element = new Element(candidate[current2], [key, current2], null, null);\n                            } else {\n                                continue;\n                            }\n                            worklist.push(element);\n                        }\n                    } else if (isNode(candidate)) {\n                        if (candidateExistsInLeaveList(leavelist, candidate)) {\n                          continue;\n                        }\n\n                        worklist.push(new Element(candidate, key, null, null));\n                    }\n                }\n            }\n        }\n    };\n\n    Controller.prototype.replace = function replace(root, visitor) {\n        var worklist,\n            leavelist,\n            node,\n            nodeType,\n            target,\n            element,\n            current,\n            current2,\n            candidates,\n            candidate,\n            sentinel,\n            outer,\n            key;\n\n        function removeElem(element) {\n            var i,\n                key,\n                nextElem,\n                parent;\n\n            if (element.ref.remove()) {\n                // When the reference is an element of an array.\n                key = element.ref.key;\n                parent = element.ref.parent;\n\n                // If removed from array, then decrease following items' keys.\n                i = worklist.length;\n                while (i--) {\n                    nextElem = worklist[i];\n                    if (nextElem.ref && nextElem.ref.parent === parent) {\n                        if  (nextElem.ref.key < key) {\n                            break;\n                        }\n                        --nextElem.ref.key;\n                    }\n                }\n            }\n        }\n\n        this.__initialize(root, visitor);\n\n        sentinel = {};\n\n        // reference\n        worklist = this.__worklist;\n        leavelist = this.__leavelist;\n\n        // initialize\n        outer = {\n            root: root\n        };\n        element = new Element(root, null, null, new Reference(outer, 'root'));\n        worklist.push(element);\n        leavelist.push(element);\n\n        while (worklist.length) {\n            element = worklist.pop();\n\n            if (element === sentinel) {\n                element = leavelist.pop();\n\n                target = this.__execute(visitor.leave, element);\n\n                // node may be replaced with null,\n                // so distinguish between undefined and null in this place\n                if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {\n                    // replace\n                    element.ref.replace(target);\n                }\n\n                if (this.__state === REMOVE || target === REMOVE) {\n                    removeElem(element);\n                }\n\n                if (this.__state === BREAK || target === BREAK) {\n                    return outer.root;\n                }\n                continue;\n            }\n\n            target = this.__execute(visitor.enter, element);\n\n            // node may be replaced with null,\n            // so distinguish between undefined and null in this place\n            if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {\n                // replace\n                element.ref.replace(target);\n                element.node = target;\n            }\n\n            if (this.__state === REMOVE || target === REMOVE) {\n                removeElem(element);\n                element.node = null;\n            }\n\n            if (this.__state === BREAK || target === BREAK) {\n                return outer.root;\n            }\n\n            // node may be null\n            node = element.node;\n            if (!node) {\n                continue;\n            }\n\n            worklist.push(sentinel);\n            leavelist.push(element);\n\n            if (this.__state === SKIP || target === SKIP) {\n                continue;\n            }\n\n            nodeType = node.type || element.wrap;\n            candidates = this.__keys[nodeType];\n            if (!candidates) {\n                if (this.__fallback) {\n                    candidates = this.__fallback(node);\n                } else {\n                    throw new Error('Unknown node type ' + nodeType + '.');\n                }\n            }\n\n            current = candidates.length;\n            while ((current -= 1) >= 0) {\n                key = candidates[current];\n                candidate = node[key];\n                if (!candidate) {\n                    continue;\n                }\n\n                if (Array.isArray(candidate)) {\n                    current2 = candidate.length;\n                    while ((current2 -= 1) >= 0) {\n                        if (!candidate[current2]) {\n                            continue;\n                        }\n                        if (isProperty(nodeType, candidates[current])) {\n                            element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2));\n                        } else if (isNode(candidate[current2])) {\n                            element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2));\n                        } else {\n                            continue;\n                        }\n                        worklist.push(element);\n                    }\n                } else if (isNode(candidate)) {\n                    worklist.push(new Element(candidate, key, null, new Reference(node, key)));\n                }\n            }\n        }\n\n        return outer.root;\n    };\n\n    function traverse(root, visitor) {\n        var controller = new Controller();\n        return controller.traverse(root, visitor);\n    }\n\n    function replace(root, visitor) {\n        var controller = new Controller();\n        return controller.replace(root, visitor);\n    }\n\n    function extendCommentRange(comment, tokens) {\n        var target;\n\n        target = upperBound(tokens, function search(token) {\n            return token.range[0] > comment.range[0];\n        });\n\n        comment.extendedRange = [comment.range[0], comment.range[1]];\n\n        if (target !== tokens.length) {\n            comment.extendedRange[1] = tokens[target].range[0];\n        }\n\n        target -= 1;\n        if (target >= 0) {\n            comment.extendedRange[0] = tokens[target].range[1];\n        }\n\n        return comment;\n    }\n\n    function attachComments(tree, providedComments, tokens) {\n        // At first, we should calculate extended comment ranges.\n        var comments = [], comment, len, i, cursor;\n\n        if (!tree.range) {\n            throw new Error('attachComments needs range information');\n        }\n\n        // tokens array is empty, we attach comments to tree as 'leadingComments'\n        if (!tokens.length) {\n            if (providedComments.length) {\n                for (i = 0, len = providedComments.length; i < len; i += 1) {\n                    comment = deepCopy(providedComments[i]);\n                    comment.extendedRange = [0, tree.range[0]];\n                    comments.push(comment);\n                }\n                tree.leadingComments = comments;\n            }\n            return tree;\n        }\n\n        for (i = 0, len = providedComments.length; i < len; i += 1) {\n            comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens));\n        }\n\n        // This is based on John Freeman's implementation.\n        cursor = 0;\n        traverse(tree, {\n            enter: function (node) {\n                var comment;\n\n                while (cursor < comments.length) {\n                    comment = comments[cursor];\n                    if (comment.extendedRange[1] > node.range[0]) {\n                        break;\n                    }\n\n                    if (comment.extendedRange[1] === node.range[0]) {\n                        if (!node.leadingComments) {\n                            node.leadingComments = [];\n                        }\n                        node.leadingComments.push(comment);\n                        comments.splice(cursor, 1);\n                    } else {\n                        cursor += 1;\n                    }\n                }\n\n                // already out of owned node\n                if (cursor === comments.length) {\n                    return VisitorOption.Break;\n                }\n\n                if (comments[cursor].extendedRange[0] > node.range[1]) {\n                    return VisitorOption.Skip;\n                }\n            }\n        });\n\n        cursor = 0;\n        traverse(tree, {\n            leave: function (node) {\n                var comment;\n\n                while (cursor < comments.length) {\n                    comment = comments[cursor];\n                    if (node.range[1] < comment.extendedRange[0]) {\n                        break;\n                    }\n\n                    if (node.range[1] === comment.extendedRange[0]) {\n                        if (!node.trailingComments) {\n                            node.trailingComments = [];\n                        }\n                        node.trailingComments.push(comment);\n                        comments.splice(cursor, 1);\n                    } else {\n                        cursor += 1;\n                    }\n                }\n\n                // already out of owned node\n                if (cursor === comments.length) {\n                    return VisitorOption.Break;\n                }\n\n                if (comments[cursor].extendedRange[0] > node.range[1]) {\n                    return VisitorOption.Skip;\n                }\n            }\n        });\n\n        return tree;\n    }\n\n    exports.Syntax = Syntax;\n    exports.traverse = traverse;\n    exports.replace = replace;\n    exports.attachComments = attachComments;\n    exports.VisitorKeys = VisitorKeys;\n    exports.VisitorOption = VisitorOption;\n    exports.Controller = Controller;\n    exports.cloneEnvironment = function () { return clone({}); };\n\n    return exports;\n}(exports));\n/* vim: set sw=4 ts=4 et tw=80 : */\n","/*\n * Generated by PEG.js 0.10.0.\n *\n * http://pegjs.org/\n */\n(function(root, factory) {\n  if (typeof define === \"function\" && define.amd) {\n    define([], factory);\n  } else if (typeof module === \"object\" && module.exports) {\n    module.exports = factory();\n  }\n})(this, function() {\n  \"use strict\";\n\n  function peg$subclass(child, parent) {\n    function ctor() { this.constructor = child; }\n    ctor.prototype = parent.prototype;\n    child.prototype = new ctor();\n  }\n\n  function peg$SyntaxError(message, expected, found, location) {\n    this.message  = message;\n    this.expected = expected;\n    this.found    = found;\n    this.location = location;\n    this.name     = \"SyntaxError\";\n\n    if (typeof Error.captureStackTrace === \"function\") {\n      Error.captureStackTrace(this, peg$SyntaxError);\n    }\n  }\n\n  peg$subclass(peg$SyntaxError, Error);\n\n  peg$SyntaxError.buildMessage = function(expected, found) {\n    var DESCRIBE_EXPECTATION_FNS = {\n          literal: function(expectation) {\n            return \"\\\"\" + literalEscape(expectation.text) + \"\\\"\";\n          },\n\n          \"class\": function(expectation) {\n            var escapedParts = \"\",\n                i;\n\n            for (i = 0; i < expectation.parts.length; i++) {\n              escapedParts += expectation.parts[i] instanceof Array\n                ? classEscape(expectation.parts[i][0]) + \"-\" + classEscape(expectation.parts[i][1])\n                : classEscape(expectation.parts[i]);\n            }\n\n            return \"[\" + (expectation.inverted ? \"^\" : \"\") + escapedParts + \"]\";\n          },\n\n          any: function(expectation) {\n            return \"any character\";\n          },\n\n          end: function(expectation) {\n            return \"end of input\";\n          },\n\n          other: function(expectation) {\n            return expectation.description;\n          }\n        };\n\n    function hex(ch) {\n      return ch.charCodeAt(0).toString(16).toUpperCase();\n    }\n\n    function literalEscape(s) {\n      return s\n        .replace(/\\\\/g, '\\\\\\\\')\n        .replace(/\"/g,  '\\\\\"')\n        .replace(/\\0/g, '\\\\0')\n        .replace(/\\t/g, '\\\\t')\n        .replace(/\\n/g, '\\\\n')\n        .replace(/\\r/g, '\\\\r')\n        .replace(/[\\x00-\\x0F]/g,          function(ch) { return '\\\\x0' + hex(ch); })\n        .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return '\\\\x'  + hex(ch); });\n    }\n\n    function classEscape(s) {\n      return s\n        .replace(/\\\\/g, '\\\\\\\\')\n        .replace(/\\]/g, '\\\\]')\n        .replace(/\\^/g, '\\\\^')\n        .replace(/-/g,  '\\\\-')\n        .replace(/\\0/g, '\\\\0')\n        .replace(/\\t/g, '\\\\t')\n        .replace(/\\n/g, '\\\\n')\n        .replace(/\\r/g, '\\\\r')\n        .replace(/[\\x00-\\x0F]/g,          function(ch) { return '\\\\x0' + hex(ch); })\n        .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return '\\\\x'  + hex(ch); });\n    }\n\n    function describeExpectation(expectation) {\n      return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);\n    }\n\n    function describeExpected(expected) {\n      var descriptions = new Array(expected.length),\n          i, j;\n\n      for (i = 0; i < expected.length; i++) {\n        descriptions[i] = describeExpectation(expected[i]);\n      }\n\n      descriptions.sort();\n\n      if (descriptions.length > 0) {\n        for (i = 1, j = 1; i < descriptions.length; i++) {\n          if (descriptions[i - 1] !== descriptions[i]) {\n            descriptions[j] = descriptions[i];\n            j++;\n          }\n        }\n        descriptions.length = j;\n      }\n\n      switch (descriptions.length) {\n        case 1:\n          return descriptions[0];\n\n        case 2:\n          return descriptions[0] + \" or \" + descriptions[1];\n\n        default:\n          return descriptions.slice(0, -1).join(\", \")\n            + \", or \"\n            + descriptions[descriptions.length - 1];\n      }\n    }\n\n    function describeFound(found) {\n      return found ? \"\\\"\" + literalEscape(found) + \"\\\"\" : \"end of input\";\n    }\n\n    return \"Expected \" + describeExpected(expected) + \" but \" + describeFound(found) + \" found.\";\n  };\n\n  function peg$parse(input, options) {\n    options = options !== void 0 ? options : {};\n\n    var peg$FAILED = {},\n\n        peg$startRuleFunctions = { start: peg$parsestart },\n        peg$startRuleFunction  = peg$parsestart,\n\n        peg$c0 = function(ss) {\n            return ss.length === 1 ? ss[0] : { type: 'matches', selectors: ss };\n          },\n        peg$c1 = function() { return void 0; },\n        peg$c2 = \" \",\n        peg$c3 = peg$literalExpectation(\" \", false),\n        peg$c4 = /^[^ [\\],():#!=><~+.]/,\n        peg$c5 = peg$classExpectation([\" \", \"[\", \"]\", \",\", \"(\", \")\", \":\", \"#\", \"!\", \"=\", \">\", \"<\", \"~\", \"+\", \".\"], true, false),\n        peg$c6 = function(i) { return i.join(''); },\n        peg$c7 = \">\",\n        peg$c8 = peg$literalExpectation(\">\", false),\n        peg$c9 = function() { return 'child'; },\n        peg$c10 = \"~\",\n        peg$c11 = peg$literalExpectation(\"~\", false),\n        peg$c12 = function() { return 'sibling'; },\n        peg$c13 = \"+\",\n        peg$c14 = peg$literalExpectation(\"+\", false),\n        peg$c15 = function() { return 'adjacent'; },\n        peg$c16 = function() { return 'descendant'; },\n        peg$c17 = \",\",\n        peg$c18 = peg$literalExpectation(\",\", false),\n        peg$c19 = function(s, ss) {\n          return [s].concat(ss.map(function (s) { return s[3]; }));\n        },\n        peg$c20 = function(op, s) {\n            if (!op) return s;\n            return { type: op, left: { type: 'exactNode' }, right: s };\n          },\n        peg$c21 = function(a, ops) {\n            return ops.reduce(function (memo, rhs) {\n              return { type: rhs[0], left: memo, right: rhs[1] };\n            }, a);\n          },\n        peg$c22 = \"!\",\n        peg$c23 = peg$literalExpectation(\"!\", false),\n        peg$c24 = function(subject, as) {\n            const b = as.length === 1 ? as[0] : { type: 'compound', selectors: as };\n            if(subject) b.subject = true;\n            return b;\n          },\n        peg$c25 = \"*\",\n        peg$c26 = peg$literalExpectation(\"*\", false),\n        peg$c27 = function(a) { return { type: 'wildcard', value: a }; },\n        peg$c28 = \"#\",\n        peg$c29 = peg$literalExpectation(\"#\", false),\n        peg$c30 = function(i) { return { type: 'identifier', value: i }; },\n        peg$c31 = \"[\",\n        peg$c32 = peg$literalExpectation(\"[\", false),\n        peg$c33 = \"]\",\n        peg$c34 = peg$literalExpectation(\"]\", false),\n        peg$c35 = function(v) { return v; },\n        peg$c36 = /^[><!]/,\n        peg$c37 = peg$classExpectation([\">\", \"<\", \"!\"], false, false),\n        peg$c38 = \"=\",\n        peg$c39 = peg$literalExpectation(\"=\", false),\n        peg$c40 = function(a) { return (a || '') + '='; },\n        peg$c41 = /^[><]/,\n        peg$c42 = peg$classExpectation([\">\", \"<\"], false, false),\n        peg$c43 = \".\",\n        peg$c44 = peg$literalExpectation(\".\", false),\n        peg$c45 = function(a, as) {\n            return [].concat.apply([a], as).join('');\n          },\n        peg$c46 = function(name, op, value) {\n              return { type: 'attribute', name: name, operator: op, value: value };\n            },\n        peg$c47 = function(name) { return { type: 'attribute', name: name }; },\n        peg$c48 = \"\\\"\",\n        peg$c49 = peg$literalExpectation(\"\\\"\", false),\n        peg$c50 = /^[^\\\\\"]/,\n        peg$c51 = peg$classExpectation([\"\\\\\", \"\\\"\"], true, false),\n        peg$c52 = \"\\\\\",\n        peg$c53 = peg$literalExpectation(\"\\\\\", false),\n        peg$c54 = peg$anyExpectation(),\n        peg$c55 = function(a, b) { return a + b; },\n        peg$c56 = function(d) {\n                return { type: 'literal', value: strUnescape(d.join('')) };\n              },\n        peg$c57 = \"'\",\n        peg$c58 = peg$literalExpectation(\"'\", false),\n        peg$c59 = /^[^\\\\']/,\n        peg$c60 = peg$classExpectation([\"\\\\\", \"'\"], true, false),\n        peg$c61 = /^[0-9]/,\n        peg$c62 = peg$classExpectation([[\"0\", \"9\"]], false, false),\n        peg$c63 = function(a, b) {\n                // Can use `a.flat().join('')` once supported\n                const leadingDecimals = a ? [].concat.apply([], a).join('') : '';\n                return { type: 'literal', value: parseFloat(leadingDecimals + b.join('')) };\n              },\n        peg$c64 = function(i) { return { type: 'literal', value: i }; },\n        peg$c65 = \"type(\",\n        peg$c66 = peg$literalExpectation(\"type(\", false),\n        peg$c67 = /^[^ )]/,\n        peg$c68 = peg$classExpectation([\" \", \")\"], true, false),\n        peg$c69 = \")\",\n        peg$c70 = peg$literalExpectation(\")\", false),\n        peg$c71 = function(t) { return { type: 'type', value: t.join('') }; },\n        peg$c72 = /^[imsu]/,\n        peg$c73 = peg$classExpectation([\"i\", \"m\", \"s\", \"u\"], false, false),\n        peg$c74 = \"/\",\n        peg$c75 = peg$literalExpectation(\"/\", false),\n        peg$c76 = function(pattern, flgs) {\n              return {\n                type: 'regexp', value: new RegExp(pattern.join(''), flgs ? flgs.join('') : '')\n              };\n            },\n        peg$c77 = /^[^\\]\\\\]/,\n        peg$c78 = peg$classExpectation([\"]\", \"\\\\\"], true, false),\n        peg$c79 = function(cs) { return '[' + cs.join('') + ']'; },\n        peg$c80 = function(a) { return '\\\\' + a; },\n        peg$c81 = /^[^\\/\\\\[]/,\n        peg$c82 = peg$classExpectation([\"/\", \"\\\\\", \"[\"], true, false),\n        peg$c83 = function(cs) { return cs.join(''); },\n        peg$c84 = function(i, is) {\n          return { type: 'field', name: is.reduce(function(memo, p){ return memo + p[0] + p[1]; }, i)};\n        },\n        peg$c85 = \":not(\",\n        peg$c86 = peg$literalExpectation(\":not(\", false),\n        peg$c87 = function(ss) { return { type: 'not', selectors: ss }; },\n        peg$c88 = \":matches(\",\n        peg$c89 = peg$literalExpectation(\":matches(\", false),\n        peg$c90 = function(ss) { return { type: 'matches', selectors: ss }; },\n        peg$c91 = \":is(\",\n        peg$c92 = peg$literalExpectation(\":is(\", false),\n        peg$c93 = \":has(\",\n        peg$c94 = peg$literalExpectation(\":has(\", false),\n        peg$c95 = function(ss) { return { type: 'has', selectors: ss }; },\n        peg$c96 = \":first-child\",\n        peg$c97 = peg$literalExpectation(\":first-child\", false),\n        peg$c98 = function() { return nth(1); },\n        peg$c99 = \":last-child\",\n        peg$c100 = peg$literalExpectation(\":last-child\", false),\n        peg$c101 = function() { return nthLast(1); },\n        peg$c102 = \":nth-child(\",\n        peg$c103 = peg$literalExpectation(\":nth-child(\", false),\n        peg$c104 = function(n) { return nth(parseInt(n.join(''), 10)); },\n        peg$c105 = \":nth-last-child(\",\n        peg$c106 = peg$literalExpectation(\":nth-last-child(\", false),\n        peg$c107 = function(n) { return nthLast(parseInt(n.join(''), 10)); },\n        peg$c108 = \":\",\n        peg$c109 = peg$literalExpectation(\":\", false),\n        peg$c110 = function(c) {\n          return { type: 'class', name: c };\n        },\n\n        peg$currPos          = 0,\n        peg$savedPos         = 0,\n        peg$posDetailsCache  = [{ line: 1, column: 1 }],\n        peg$maxFailPos       = 0,\n        peg$maxFailExpected  = [],\n        peg$silentFails      = 0,\n\n        peg$resultsCache = {},\n\n        peg$result;\n\n    if (\"startRule\" in options) {\n      if (!(options.startRule in peg$startRuleFunctions)) {\n        throw new Error(\"Can't start parsing from rule \\\"\" + options.startRule + \"\\\".\");\n      }\n\n      peg$startRuleFunction = peg$startRuleFunctions[options.startRule];\n    }\n\n    function text() {\n      return input.substring(peg$savedPos, peg$currPos);\n    }\n\n    function location() {\n      return peg$computeLocation(peg$savedPos, peg$currPos);\n    }\n\n    function expected(description, location) {\n      location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)\n\n      throw peg$buildStructuredError(\n        [peg$otherExpectation(description)],\n        input.substring(peg$savedPos, peg$currPos),\n        location\n      );\n    }\n\n    function error(message, location) {\n      location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)\n\n      throw peg$buildSimpleError(message, location);\n    }\n\n    function peg$literalExpectation(text, ignoreCase) {\n      return { type: \"literal\", text: text, ignoreCase: ignoreCase };\n    }\n\n    function peg$classExpectation(parts, inverted, ignoreCase) {\n      return { type: \"class\", parts: parts, inverted: inverted, ignoreCase: ignoreCase };\n    }\n\n    function peg$anyExpectation() {\n      return { type: \"any\" };\n    }\n\n    function peg$endExpectation() {\n      return { type: \"end\" };\n    }\n\n    function peg$otherExpectation(description) {\n      return { type: \"other\", description: description };\n    }\n\n    function peg$computePosDetails(pos) {\n      var details = peg$posDetailsCache[pos], p;\n\n      if (details) {\n        return details;\n      } else {\n        p = pos - 1;\n        while (!peg$posDetailsCache[p]) {\n          p--;\n        }\n\n        details = peg$posDetailsCache[p];\n        details = {\n          line:   details.line,\n          column: details.column\n        };\n\n        while (p < pos) {\n          if (input.charCodeAt(p) === 10) {\n            details.line++;\n            details.column = 1;\n          } else {\n            details.column++;\n          }\n\n          p++;\n        }\n\n        peg$posDetailsCache[pos] = details;\n        return details;\n      }\n    }\n\n    function peg$computeLocation(startPos, endPos) {\n      var startPosDetails = peg$computePosDetails(startPos),\n          endPosDetails   = peg$computePosDetails(endPos);\n\n      return {\n        start: {\n          offset: startPos,\n          line:   startPosDetails.line,\n          column: startPosDetails.column\n        },\n        end: {\n          offset: endPos,\n          line:   endPosDetails.line,\n          column: endPosDetails.column\n        }\n      };\n    }\n\n    function peg$fail(expected) {\n      if (peg$currPos < peg$maxFailPos) { return; }\n\n      if (peg$currPos > peg$maxFailPos) {\n        peg$maxFailPos = peg$currPos;\n        peg$maxFailExpected = [];\n      }\n\n      peg$maxFailExpected.push(expected);\n    }\n\n    function peg$buildSimpleError(message, location) {\n      return new peg$SyntaxError(message, null, null, location);\n    }\n\n    function peg$buildStructuredError(expected, found, location) {\n      return new peg$SyntaxError(\n        peg$SyntaxError.buildMessage(expected, found),\n        expected,\n        found,\n        location\n      );\n    }\n\n    function peg$parsestart() {\n      var s0, s1, s2, s3;\n\n      var key    = peg$currPos * 36 + 0,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parse_();\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parseselectors();\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parse_();\n          if (s3 !== peg$FAILED) {\n            peg$savedPos = s0;\n            s1 = peg$c0(s2);\n            s0 = s1;\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n      if (s0 === peg$FAILED) {\n        s0 = peg$currPos;\n        s1 = peg$parse_();\n        if (s1 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c1();\n        }\n        s0 = s1;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parse_() {\n      var s0, s1;\n\n      var key    = peg$currPos * 36 + 1,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = [];\n      if (input.charCodeAt(peg$currPos) === 32) {\n        s1 = peg$c2;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c3); }\n      }\n      while (s1 !== peg$FAILED) {\n        s0.push(s1);\n        if (input.charCodeAt(peg$currPos) === 32) {\n          s1 = peg$c2;\n          peg$currPos++;\n        } else {\n          s1 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c3); }\n        }\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseidentifierName() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 2,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = [];\n      if (peg$c4.test(input.charAt(peg$currPos))) {\n        s2 = input.charAt(peg$currPos);\n        peg$currPos++;\n      } else {\n        s2 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c5); }\n      }\n      if (s2 !== peg$FAILED) {\n        while (s2 !== peg$FAILED) {\n          s1.push(s2);\n          if (peg$c4.test(input.charAt(peg$currPos))) {\n            s2 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s2 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c5); }\n          }\n        }\n      } else {\n        s1 = peg$FAILED;\n      }\n      if (s1 !== peg$FAILED) {\n        peg$savedPos = s0;\n        s1 = peg$c6(s1);\n      }\n      s0 = s1;\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsebinaryOp() {\n      var s0, s1, s2, s3;\n\n      var key    = peg$currPos * 36 + 3,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parse_();\n      if (s1 !== peg$FAILED) {\n        if (input.charCodeAt(peg$currPos) === 62) {\n          s2 = peg$c7;\n          peg$currPos++;\n        } else {\n          s2 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c8); }\n        }\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parse_();\n          if (s3 !== peg$FAILED) {\n            peg$savedPos = s0;\n            s1 = peg$c9();\n            s0 = s1;\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n      if (s0 === peg$FAILED) {\n        s0 = peg$currPos;\n        s1 = peg$parse_();\n        if (s1 !== peg$FAILED) {\n          if (input.charCodeAt(peg$currPos) === 126) {\n            s2 = peg$c10;\n            peg$currPos++;\n          } else {\n            s2 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c11); }\n          }\n          if (s2 !== peg$FAILED) {\n            s3 = peg$parse_();\n            if (s3 !== peg$FAILED) {\n              peg$savedPos = s0;\n              s1 = peg$c12();\n              s0 = s1;\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n        if (s0 === peg$FAILED) {\n          s0 = peg$currPos;\n          s1 = peg$parse_();\n          if (s1 !== peg$FAILED) {\n            if (input.charCodeAt(peg$currPos) === 43) {\n              s2 = peg$c13;\n              peg$currPos++;\n            } else {\n              s2 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c14); }\n            }\n            if (s2 !== peg$FAILED) {\n              s3 = peg$parse_();\n              if (s3 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c15();\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n          if (s0 === peg$FAILED) {\n            s0 = peg$currPos;\n            if (input.charCodeAt(peg$currPos) === 32) {\n              s1 = peg$c2;\n              peg$currPos++;\n            } else {\n              s1 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c3); }\n            }\n            if (s1 !== peg$FAILED) {\n              s2 = peg$parse_();\n              if (s2 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c16();\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          }\n        }\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsehasSelectors() {\n      var s0, s1, s2, s3, s4, s5, s6, s7;\n\n      var key    = peg$currPos * 36 + 4,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parsehasSelector();\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        s3 = peg$currPos;\n        s4 = peg$parse_();\n        if (s4 !== peg$FAILED) {\n          if (input.charCodeAt(peg$currPos) === 44) {\n            s5 = peg$c17;\n            peg$currPos++;\n          } else {\n            s5 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c18); }\n          }\n          if (s5 !== peg$FAILED) {\n            s6 = peg$parse_();\n            if (s6 !== peg$FAILED) {\n              s7 = peg$parsehasSelector();\n              if (s7 !== peg$FAILED) {\n                s4 = [s4, s5, s6, s7];\n                s3 = s4;\n              } else {\n                peg$currPos = s3;\n                s3 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s3;\n          s3 = peg$FAILED;\n        }\n        while (s3 !== peg$FAILED) {\n          s2.push(s3);\n          s3 = peg$currPos;\n          s4 = peg$parse_();\n          if (s4 !== peg$FAILED) {\n            if (input.charCodeAt(peg$currPos) === 44) {\n              s5 = peg$c17;\n              peg$currPos++;\n            } else {\n              s5 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c18); }\n            }\n            if (s5 !== peg$FAILED) {\n              s6 = peg$parse_();\n              if (s6 !== peg$FAILED) {\n                s7 = peg$parsehasSelector();\n                if (s7 !== peg$FAILED) {\n                  s4 = [s4, s5, s6, s7];\n                  s3 = s4;\n                } else {\n                  peg$currPos = s3;\n                  s3 = peg$FAILED;\n                }\n              } else {\n                peg$currPos = s3;\n                s3 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c19(s1, s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseselectors() {\n      var s0, s1, s2, s3, s4, s5, s6, s7;\n\n      var key    = peg$currPos * 36 + 5,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parseselector();\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        s3 = peg$currPos;\n        s4 = peg$parse_();\n        if (s4 !== peg$FAILED) {\n          if (input.charCodeAt(peg$currPos) === 44) {\n            s5 = peg$c17;\n            peg$currPos++;\n          } else {\n            s5 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c18); }\n          }\n          if (s5 !== peg$FAILED) {\n            s6 = peg$parse_();\n            if (s6 !== peg$FAILED) {\n              s7 = peg$parseselector();\n              if (s7 !== peg$FAILED) {\n                s4 = [s4, s5, s6, s7];\n                s3 = s4;\n              } else {\n                peg$currPos = s3;\n                s3 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s3;\n          s3 = peg$FAILED;\n        }\n        while (s3 !== peg$FAILED) {\n          s2.push(s3);\n          s3 = peg$currPos;\n          s4 = peg$parse_();\n          if (s4 !== peg$FAILED) {\n            if (input.charCodeAt(peg$currPos) === 44) {\n              s5 = peg$c17;\n              peg$currPos++;\n            } else {\n              s5 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c18); }\n            }\n            if (s5 !== peg$FAILED) {\n              s6 = peg$parse_();\n              if (s6 !== peg$FAILED) {\n                s7 = peg$parseselector();\n                if (s7 !== peg$FAILED) {\n                  s4 = [s4, s5, s6, s7];\n                  s3 = s4;\n                } else {\n                  peg$currPos = s3;\n                  s3 = peg$FAILED;\n                }\n              } else {\n                peg$currPos = s3;\n                s3 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c19(s1, s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsehasSelector() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 6,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parsebinaryOp();\n      if (s1 === peg$FAILED) {\n        s1 = null;\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parseselector();\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c20(s1, s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseselector() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 7,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parsesequence();\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        s3 = peg$currPos;\n        s4 = peg$parsebinaryOp();\n        if (s4 !== peg$FAILED) {\n          s5 = peg$parsesequence();\n          if (s5 !== peg$FAILED) {\n            s4 = [s4, s5];\n            s3 = s4;\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s3;\n          s3 = peg$FAILED;\n        }\n        while (s3 !== peg$FAILED) {\n          s2.push(s3);\n          s3 = peg$currPos;\n          s4 = peg$parsebinaryOp();\n          if (s4 !== peg$FAILED) {\n            s5 = peg$parsesequence();\n            if (s5 !== peg$FAILED) {\n              s4 = [s4, s5];\n              s3 = s4;\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c21(s1, s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsesequence() {\n      var s0, s1, s2, s3;\n\n      var key    = peg$currPos * 36 + 8,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 33) {\n        s1 = peg$c22;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c23); }\n      }\n      if (s1 === peg$FAILED) {\n        s1 = null;\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        s3 = peg$parseatom();\n        if (s3 !== peg$FAILED) {\n          while (s3 !== peg$FAILED) {\n            s2.push(s3);\n            s3 = peg$parseatom();\n          }\n        } else {\n          s2 = peg$FAILED;\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c24(s1, s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseatom() {\n      var s0;\n\n      var key    = peg$currPos * 36 + 9,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$parsewildcard();\n      if (s0 === peg$FAILED) {\n        s0 = peg$parseidentifier();\n        if (s0 === peg$FAILED) {\n          s0 = peg$parseattr();\n          if (s0 === peg$FAILED) {\n            s0 = peg$parsefield();\n            if (s0 === peg$FAILED) {\n              s0 = peg$parsenegation();\n              if (s0 === peg$FAILED) {\n                s0 = peg$parsematches();\n                if (s0 === peg$FAILED) {\n                  s0 = peg$parseis();\n                  if (s0 === peg$FAILED) {\n                    s0 = peg$parsehas();\n                    if (s0 === peg$FAILED) {\n                      s0 = peg$parsefirstChild();\n                      if (s0 === peg$FAILED) {\n                        s0 = peg$parselastChild();\n                        if (s0 === peg$FAILED) {\n                          s0 = peg$parsenthChild();\n                          if (s0 === peg$FAILED) {\n                            s0 = peg$parsenthLastChild();\n                            if (s0 === peg$FAILED) {\n                              s0 = peg$parseclass();\n                            }\n                          }\n                        }\n                      }\n                    }\n                  }\n                }\n              }\n            }\n          }\n        }\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsewildcard() {\n      var s0, s1;\n\n      var key    = peg$currPos * 36 + 10,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 42) {\n        s1 = peg$c25;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c26); }\n      }\n      if (s1 !== peg$FAILED) {\n        peg$savedPos = s0;\n        s1 = peg$c27(s1);\n      }\n      s0 = s1;\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseidentifier() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 11,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 35) {\n        s1 = peg$c28;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c29); }\n      }\n      if (s1 === peg$FAILED) {\n        s1 = null;\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parseidentifierName();\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c30(s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseattr() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 12,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 91) {\n        s1 = peg$c31;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c32); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parseattrValue();\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 93) {\n                s5 = peg$c33;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c34); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c35(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseattrOps() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 13,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (peg$c36.test(input.charAt(peg$currPos))) {\n        s1 = input.charAt(peg$currPos);\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c37); }\n      }\n      if (s1 === peg$FAILED) {\n        s1 = null;\n      }\n      if (s1 !== peg$FAILED) {\n        if (input.charCodeAt(peg$currPos) === 61) {\n          s2 = peg$c38;\n          peg$currPos++;\n        } else {\n          s2 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c39); }\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c40(s1);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n      if (s0 === peg$FAILED) {\n        if (peg$c41.tes   t(input.charAt(peg$currPos))) {\n          s0 = input.charAt(peg$currPos);\n          peg$currPos++;\n        } else {\n          s0 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c42); }\n        }\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseattrEqOps() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 14,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 33) {\n        s1 = peg$c22;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c23); }\n      }\n      if (s1 === peg$FAILED) {\n        s1 = null;\n      }\n      if (s1 !== peg$FAILED) {\n        if (input.charCodeAt(peg$currPos) === 61) {\n          s2 = peg$c38;\n          peg$currPos++;\n        } else {\n          s2 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c39); }\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c40(s1);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseattrName() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 15,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parseidentifierName();\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        s3 = peg$currPos;\n        if (input.charCodeAt(peg$currPos) === 46) {\n          s4 = peg$c43;\n          peg$currPos++;\n        } else {\n          s4 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c44); }\n        }\n        if (s4 !== peg$FAILED) {\n          s5 = peg$parseidentifierName();\n          if (s5 !== peg$FAILED) {\n            s4 = [s4, s5];\n            s3 = s4;\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s3;\n          s3 = peg$FAILED;\n        }\n        while (s3 !== peg$FAILED) {\n          s2.push(s3);\n          s3 = peg$currPos;\n          if (input.charCodeAt(peg$currPos) === 46) {\n            s4 = peg$c43;\n            peg$currPos++;\n          } else {\n            s4 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c44); }\n          }\n          if (s4 !== peg$FAILED) {\n            s5 = peg$parseidentifierName();\n            if (s5 !== peg$FAILED) {\n              s4 = [s4, s5];\n              s3 = s4;\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c45(s1, s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseattrValue() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 16,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parseattrName();\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parseattrEqOps();\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              s5 = peg$parsetype();\n              if (s5 === peg$FAILED) {\n                s5 = peg$parseregex();\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c46(s1, s3, s5);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n      if (s0 === peg$FAILED) {\n        s0 = peg$currPos;\n        s1 = peg$parseattrName();\n        if (s1 !== peg$FAILED) {\n          s2 = peg$parse_();\n          if (s2 !== peg$FAILED) {\n            s3 = peg$parseattrOps();\n            if (s3 !== peg$FAILED) {\n              s4 = peg$parse_();\n              if (s4 !== peg$FAILED) {\n                s5 = peg$parsestring();\n                if (s5 === peg$FAILED) {\n                  s5 = peg$parsenumber();\n                  if (s5 === peg$FAILED) {\n                    s5 = peg$parsepath();\n                  }\n                }\n                if (s5 !== peg$FAILED) {\n                  peg$savedPos = s0;\n                  s1 = peg$c46(s1, s3, s5);\n                  s0 = s1;\n                } else {\n                  peg$currPos = s0;\n                  s0 = peg$FAILED;\n                }\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n        if (s0 === peg$FAILED) {\n          s0 = peg$currPos;\n          s1 = peg$parseattrName();\n          if (s1 !== peg$FAILED) {\n            peg$savedPos = s0;\n            s1 = peg$c47(s1);\n          }\n          s0 = s1;\n        }\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsestring() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 17,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 34) {\n        s1 = peg$c48;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c49); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        if (peg$c50.test(input.charAt(peg$currPos))) {\n          s3 = input.charAt(peg$currPos);\n          peg$currPos++;\n        } else {\n          s3 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c51); }\n        }\n        if (s3 === peg$FAILED) {\n          s3 = peg$currPos;\n          if (input.charCodeAt(peg$currPos) === 92) {\n            s4 = peg$c52;\n            peg$currPos++;\n          } else {\n            s4 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c53); }\n          }\n          if (s4 !== peg$FAILED) {\n            if (input.length > peg$currPos) {\n              s5 = input.charAt(peg$currPos);\n              peg$currPos++;\n            } else {\n              s5 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c54); }\n            }\n            if (s5 !== peg$FAILED) {\n              peg$savedPos = s3;\n              s4 = peg$c55(s4, s5);\n              s3 = s4;\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        }\n        while (s3 !== peg$FAILED) {\n          s2.push(s3);\n          if (peg$c50.test(input.charAt(peg$currPos))) {\n            s3 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s3 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c51); }\n          }\n          if (s3 === peg$FAILED) {\n            s3 = peg$currPos;\n            if (input.charCodeAt(peg$currPos) === 92) {\n              s4 = peg$c52;\n              peg$currPos++;\n            } else {\n              s4 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c53); }\n            }\n            if (s4 !== peg$FAILED) {\n              if (input.length > peg$currPos) {\n                s5 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c54); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s3;\n                s4 = peg$c55(s4, s5);\n                s3 = s4;\n              } else {\n                peg$currPos = s3;\n                s3 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          }\n        }\n        if (s2 !== peg$FAILED) {\n          if (input.charCodeAt(peg$currPos) === 34) {\n            s3 = peg$c48;\n            peg$currPos++;\n          } else {\n            s3 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c49); }\n          }\n          if (s3 !== peg$FAILED) {\n            peg$savedPos = s0;\n            s1 = peg$c56(s2);\n            s0 = s1;\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n      if (s0 === peg$FAILED) {\n        s0 = peg$currPos;\n        if (input.charCodeAt(peg$currPos) === 39) {\n          s1 = peg$c57;\n          peg$currPos++;\n        } else {\n          s1 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c58); }\n        }\n        if (s1 !== peg$FAILED) {\n          s2 = [];\n          if (peg$c59.test(input.charAt(peg$currPos))) {\n            s3 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s3 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c60); }\n          }\n          if (s3 === peg$FAILED) {\n            s3 = peg$currPos;\n            if (input.charCodeAt(peg$currPos) === 92) {\n              s4 = peg$c52;\n              peg$currPos++;\n            } else {\n              s4 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c53); }\n            }\n            if (s4 !== peg$FAILED) {\n              if (input.length > peg$currPos) {\n                s5 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c54); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s3;\n                s4 = peg$c55(s4, s5);\n                s3 = s4;\n              } else {\n                peg$currPos = s3;\n                s3 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          }\n          while (s3 !== peg$FAILED) {\n            s2.push(s3);\n            if (peg$c59.test(input.charAt(peg$currPos))) {\n              s3 = input.charAt(peg$currPos);\n              peg$currPos++;\n            } else {\n              s3 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c60); }\n            }\n            if (s3 === peg$FAILED) {\n              s3 = peg$currPos;\n              if (input.charCodeAt(peg$currPos) === 92) {\n                s4 = peg$c52;\n                peg$currPos++;\n              } else {\n                s4 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c53); }\n              }\n              if (s4 !== peg$FAILED) {\n                if (input.length > peg$currPos) {\n                  s5 = input.charAt(peg$currPos);\n                  peg$currPos++;\n                } else {\n                  s5 = peg$FAILED;\n                  if (peg$silentFails === 0) { peg$fail(peg$c54); }\n                }\n                if (s5 !== peg$FAILED) {\n                  peg$savedPos = s3;\n                  s4 = peg$c55(s4, s5);\n                  s3 = s4;\n                } else {\n                  peg$currPos = s3;\n                  s3 = peg$FAILED;\n                }\n              } else {\n                peg$currPos = s3;\n                s3 = peg$FAILED;\n              }\n            }\n          }\n          if (s2 !== peg$FAILED) {\n            if (input.charCodeAt(peg$currPos) === 39) {\n              s3 = peg$c57;\n              peg$currPos++;\n            } else {\n              s3 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c58); }\n            }\n            if (s3 !== peg$FAILED) {\n              peg$savedPos = s0;\n              s1 = peg$c56(s2);\n              s0 = s1;\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsenumber() {\n      var s0, s1, s2, s3;\n\n      var key    = peg$currPos * 36 + 18,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$currPos;\n      s2 = [];\n      if (peg$c61.test(input.charAt(peg$currPos))) {\n        s3 = input.charAt(peg$currPos);\n        peg$currPos++;\n      } else {\n        s3 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c62); }\n      }\n      while (s3 !== peg$FAILED) {\n        s2.push(s3);\n        if (peg$c61.test(input.charAt(peg$currPos))) {\n          s3 = input.charAt(peg$currPos);\n          peg$currPos++;\n        } else {\n          s3 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c62); }\n        }\n      }\n      if (s2 !== peg$FAILED) {\n        if (input.charCodeAt(peg$currPos) === 46) {\n          s3 = peg$c43;\n          peg$currPos++;\n        } else {\n          s3 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c44); }\n        }\n        if (s3 !== peg$FAILED) {\n          s2 = [s2, s3];\n          s1 = s2;\n        } else {\n          peg$currPos = s1;\n          s1 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s1;\n        s1 = peg$FAILED;\n      }\n      if (s1 === peg$FAILED) {\n        s1 = null;\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        if (peg$c61.test(input.charAt(peg$currPos))) {\n          s3 = input.charAt(peg$currPos);\n          peg$currPos++;\n        } else {\n          s3 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c62); }\n        }\n        if (s3 !== peg$FAILED) {\n          while (s3 !== peg$FAILED) {\n            s2.push(s3);\n            if (peg$c61.test(input.charAt(peg$currPos))) {\n              s3 = input.charAt(peg$currPos);\n              peg$currPos++;\n            } else {\n              s3 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c62); }\n            }\n          }\n        } else {\n          s2 = peg$FAILED;\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c63(s1, s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsepath() {\n      var s0, s1;\n\n      var key    = peg$currPos * 36 + 19,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parseidentifierName();\n      if (s1 !== peg$FAILED) {\n        peg$savedPos = s0;\n        s1 = peg$c64(s1);\n      }\n      s0 = s1;\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsetype() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 20,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 5) === peg$c65) {\n        s1 = peg$c65;\n        peg$currPos += 5;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c66); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = [];\n          if (peg$c67.test(input.charAt(peg$currPos))) {\n            s4 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s4 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c68); }\n          }\n          if (s4 !== peg$FAILED) {\n            while (s4 !== peg$FAILED) {\n              s3.push(s4);\n              if (peg$c67.test(input.charAt(peg$currPos))) {\n                s4 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s4 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c68); }\n              }\n            }\n          } else {\n            s3 = peg$FAILED;\n          }\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 41) {\n                s5 = peg$c69;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c70); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c71(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseflags() {\n      var s0, s1;\n\n      var key    = peg$currPos * 36 + 21,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = [];\n      if (peg$c72.test(input.charAt(peg$currPos))) {\n        s1 = input.charAt(peg$currPos);\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c73); }\n      }\n      if (s1 !== peg$FAILED) {\n        while (s1 !== peg$FAILED) {\n          s0.push(s1);\n          if (peg$c72.test(input.charAt(peg$currPos))) {\n            s1 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s1 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c73); }\n          }\n        }\n      } else {\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseregex() {\n      var s0, s1, s2, s3, s4;\n\n      var key    = peg$currPos * 36 + 22,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 47) {\n        s1 = peg$c74;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c75); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        s3 = peg$parsere_character_class();\n        if (s3 === peg$FAILED) {\n          s3 = peg$parsere_escape();\n          if (s3 === peg$FAILED) {\n            s3 = peg$parsere_chars();\n          }\n        }\n        if (s3 !== peg$FAILED) {\n          while (s3 !== peg$FAILED) {\n            s2.push(s3);\n            s3 = peg$parsere_character_class();\n            if (s3 === peg$FAILED) {\n              s3 = peg$parsere_escape();\n              if (s3 === peg$FAILED) {\n                s3 = peg$parsere_chars();\n              }\n            }\n          }\n        } else {\n          s2 = peg$FAILED;\n        }\n        if (s2 !== peg$FAILED) {\n          if (input.charCodeAt(peg$currPos) === 47) {\n            s3 = peg$c74;\n            peg$currPos++;\n          } else {\n            s3 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c75); }\n          }\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parseflags();\n            if (s4 === peg$FAILED) {\n              s4 = null;\n            }\n            if (s4 !== peg$FAILED) {\n              peg$savedPos = s0;\n              s1 = peg$c76(s2, s4);\n              s0 = s1;\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsere_character_class() {\n      var s0, s1, s2, s3;\n\n      var key    = peg$currPos * 36 + 23,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 91) {\n        s1 = peg$c31;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c32); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        if (peg$c77.test(input.charAt(peg$currPos))) {\n          s3 = input.charAt(peg$currPos);\n          peg$currPos++;\n        } else {\n          s3 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c78); }\n        }\n        if (s3 === peg$FAILED) {\n          s3 = peg$parsere_escape();\n        }\n        if (s3 !== peg$FAILED) {\n          while (s3 !== peg$FAILED) {\n            s2.push(s3);\n            if (peg$c77.test(input.charAt(peg$currPos))) {\n              s3 = input.charAt(peg$currPos);\n              peg$currPos++;\n            } else {\n              s3 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c78); }\n            }\n            if (s3 === peg$FAILED) {\n              s3 = peg$parsere_escape();\n            }\n          }\n        } else {\n          s2 = peg$FAILED;\n        }\n        if (s2 !== peg$FAILED) {\n          if (input.charCodeAt(peg$currPos) === 93) {\n            s3 = peg$c33;\n            peg$currPos++;\n          } else {\n            s3 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c34); }\n          }\n          if (s3 !== peg$FAILED) {\n            peg$savedPos = s0;\n            s1 = peg$c79(s2);\n            s0 = s1;\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsere_escape() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 24,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 92) {\n        s1 = peg$c52;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c53); }\n      }\n      if (s1 !== peg$FAILED) {\n        if (input.length > peg$currPos) {\n          s2 = input.charAt(peg$currPos);\n          peg$currPos++;\n        } else {\n          s2 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c54); }\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c80(s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsere_chars() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 25,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = [];\n      if (peg$c81.test(input.charAt(peg$currPos))) {\n        s2 = input.charAt(peg$currPos);\n        peg$currPos++;\n      } else {\n        s2 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c82); }\n      }\n      if (s2 !== peg$FAILED) {\n        while (s2 !== peg$FAILED) {\n          s1.push(s2);\n          if (peg$c81.test(input.charAt(peg$currPos))) {\n            s2 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s2 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c82); }\n          }\n        }\n      } else {\n        s1 = peg$FAILED;\n      }\n      if (s1 !== peg$FAILED) {\n        peg$savedPos = s0;\n        s1 = peg$c83(s1);\n      }\n      s0 = s1;\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsefield() {\n      var s0, s1, s2, s3, s4, s5, s6;\n\n      var key    = peg$currPos * 36 + 26,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 46) {\n        s1 = peg$c43;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c44); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parseidentifierName();\n        if (s2 !== peg$FAILED) {\n          s3 = [];\n          s4 = peg$currPos;\n          if (input.charCodeAt(peg$currPos) === 46) {\n            s5 = peg$c43;\n            peg$currPos++;\n          } else {\n            s5 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c44); }\n          }\n          if (s5 !== peg$FAILED) {\n            s6 = peg$parseidentifierName();\n            if (s6 !== peg$FAILED) {\n              s5 = [s5, s6];\n              s4 = s5;\n            } else {\n              peg$currPos = s4;\n              s4 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s4;\n            s4 = peg$FAILED;\n          }\n          while (s4 !== peg$FAILED) {\n            s3.push(s4);\n            s4 = peg$currPos;\n            if (input.charCodeAt(peg$currPos) === 46) {\n              s5 = peg$c43;\n              peg$currPos++;\n            } else {\n              s5 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c44); }\n            }\n            if (s5 !== peg$FAILED) {\n              s6 = peg$parseidentifierName();\n              if (s6 !== peg$FAILED) {\n                s5 = [s5, s6];\n                s4 = s5;\n              } else {\n                peg$currPos = s4;\n                s4 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s4;\n              s4 = peg$FAILED;\n            }\n          }\n          if (s3 !== peg$FAILED) {\n            peg$savedPos = s0;\n            s1 = peg$c84(s2, s3);\n            s0 = s1;\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsenegation() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 27,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 5) === peg$c85) {\n        s1 = peg$c85;\n        peg$currPos += 5;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c86); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parseselectors();\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 41) {\n                s5 = peg$c69;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c70); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c87(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsematches() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 28,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 9) === peg$c88) {\n        s1 = peg$c88;\n        peg$currPos += 9;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c89); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parseselectors();\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 41) {\n                s5 = peg$c69;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c70); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c90(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseis() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 29,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 4) === peg$c91) {\n        s1 = peg$c91;\n        peg$currPos += 4;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c92); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parseselectors();\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 41) {\n                s5 = peg$c69;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c70); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c90(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsehas() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 30,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 5) === peg$c93) {\n        s1 = peg$c93;\n        peg$currPos += 5;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c94); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parsehasSelectors();\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 41) {\n                s5 = peg$c69;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c70); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c95(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsefirstChild() {\n      var s0, s1;\n\n      var key    = peg$currPos * 36 + 31,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 12) === peg$c96) {\n        s1 = peg$c96;\n        peg$currPos += 12;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c97); }\n      }\n      if (s1 !== peg$FAILED) {\n        peg$savedPos = s0;\n        s1 = peg$c98();\n      }\n      s0 = s1;\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parselastChild() {\n      var s0, s1;\n\n      var key    = peg$currPos * 36 + 32,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 11) === peg$c99) {\n        s1 = peg$c99;\n        peg$currPos += 11;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c100); }\n      }\n      if (s1 !== peg$FAILED) {\n        peg$savedPos = s0;\n        s1 = peg$c101();\n      }\n      s0 = s1;\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsenthChild() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 33,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 11) === peg$c102) {\n        s1 = peg$c102;\n        peg$currPos += 11;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c103); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = [];\n          if (peg$c61.test(input.charAt(peg$currPos))) {\n            s4 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s4 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c62); }\n          }\n          if (s4 !== peg$FAILED) {\n            while (s4 !== peg$FAILED) {\n              s3.push(s4);\n              if (peg$c61.test(input.charAt(peg$currPos))) {\n                s4 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s4 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c62); }\n              }\n            }\n          } else {\n            s3 = peg$FAILED;\n          }\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 41) {\n                s5 = peg$c69;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c70); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c104(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsenthLastChild() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 34,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 16) === peg$c105) {\n        s1 = peg$c105;\n        peg$currPos += 16;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c106); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = [];\n          if (peg$c61.test(input.charAt(peg$currPos))) {\n            s4 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s4 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c62); }\n          }\n          if (s4 !== peg$FAILED) {\n            while (s4 !== peg$FAILED) {\n              s3.push(s4);\n              if (peg$c61.test(input.charAt(peg$currPos))) {\n                s4 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s4 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c62); }\n              }\n            }\n          } else {\n            s3 = peg$FAILED;\n          }\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 41) {\n                s5 = peg$c69;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c70); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c107(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseclass() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 35,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 58) {\n        s1 = peg$c108;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c109); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parseidentifierName();\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c110(s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n\n      function nth(n) { return { type: 'nth-child', index: { type: 'literal', value: n } }; }\n      function nthLast(n) { return { type: 'nth-last-child', index: { type: 'literal', value: n } }; }\n      function strUnescape(s) {\n        return s.replace(/\\\\(.)/g, function(match, ch) {\n          switch(ch) {\n            case 'b': return '\\b';\n            case 'f': return '\\f';\n            case 'n': return '\\n';\n            case 'r': return '\\r';\n            case 't': return '\\t';\n            case 'v': return '\\v';\n            default: return ch;\n          }\n        });\n      }\n\n\n    peg$result = peg$startRuleFunction();\n\n    if (peg$result !== peg$FAILED && peg$currPos === input.length) {\n      return peg$result;\n    } else {\n      if (peg$result !== peg$FAILED && peg$currPos < input.length) {\n        peg$fail(peg$endExpectation());\n      }\n\n      throw peg$buildStructuredError(\n        peg$maxFailExpected,\n        peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,\n        peg$maxFailPos < input.length\n          ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)\n          : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)\n      );\n    }\n  }\n\n  return {\n    SyntaxError: peg$SyntaxError,\n    parse:       peg$parse\n  };\n});\n","/* vim: set sw=4 sts=4 : */\nimport estraverse from 'estraverse';\nimport parser from './parser.js';\n\n/**\n* @typedef {\"LEFT_SIDE\"|\"RIGHT_SIDE\"} Side\n*/\n\nconst LEFT_SIDE = 'LEFT_SIDE';\nconst RIGHT_SIDE = 'RIGHT_SIDE';\n\n/**\n * @external AST\n * @see https://esprima.readthedocs.io/en/latest/syntax-tree-format.html\n */\n\n/**\n * One of the rules of `grammar.pegjs`\n * @typedef {PlainObject} SelectorAST\n * @see grammar.pegjs\n*/\n\n/**\n * The `sequence` production of `grammar.pegjs`\n * @typedef {PlainObject} SelectorSequenceAST\n*/\n\n/**\n * Get the value of a property which may be multiple levels down\n * in the object.\n * @param {?PlainObject} obj\n * @param {string[]} keys\n * @returns {undefined|boolean|string|number|external:AST}\n */\nfunction getPath(obj, keys) {\n    for (let i = 0; i < keys.length; ++i) {\n        if (obj == null) { return obj; }\n        obj = obj[keys[i]];\n    }\n    return obj;\n}\n\n/**\n * Determine whether `node` can be reached by following `path`,\n * starting at `ancestor`.\n * @param {?external:AST} node\n * @param {?external:AST} ancestor\n * @param {string[]} path\n * @param {Integer} fromPathIndex\n * @returns {boolean}\n */\nfunction inPath(node, ancestor, path, fromPathIndex) {\n    let current = ancestor;\n    for (let i = fromPathIndex; i < path.length; ++i) {\n        if (current == null) {\n            return false;\n        }\n        const field = current[path[i]];\n        if (Array.isArray(field)) {\n            for (let k = 0; k < field.length; ++k) {\n                if (inPath(node, field[k], path, i + 1)) {\n                    return true;\n                }\n            }\n            return false;\n        }\n        current = field;\n    }\n    return node === current;\n}\n\n/**\n * A generated matcher function for a selector.\n * @callback SelectorMatcher\n * @param {?SelectorAST} selector\n * @param {external:AST[]} [ancestry=[]]\n * @param {ESQueryOptions} [options]\n * @returns {void}\n*/\n\n/**\n * A WeakMap for holding cached matcher functions for selectors.\n * @type {WeakMap<SelectorAST, SelectorMatcher>}\n*/\nconst MATCHER_CACHE = typeof WeakMap === 'function' ? new WeakMap : null;\n\n/**\n * Look up a matcher function for `selector` in the cache.\n * If it does not exist, generate it with `generateMatcher` and add it to the cache.\n * In engines without WeakMap, the caching is skipped and matchers are generated with every call.\n * @param {?SelectorAST} selector\n * @returns {SelectorMatcher}\n */\nfunction getMatcher(selector) {\n    if (selector == null) {\n        return () => true;\n    }\n\n    if (MATCHER_CACHE != null) {\n        let matcher = MATCHER_CACHE.get(selector);\n        if (matcher != null) {\n            return matcher;\n        }\n        matcher = generateMatcher(selector);\n        MATCHER_CACHE.set(selector, matcher);\n        return matcher;\n    }\n\n    return generateMatcher(selector);\n}\n\n/**\n * Create a matcher function for `selector`,\n * @param {?SelectorAST} selector\n * @returns {SelectorMatcher}\n */\nfunction generateMatcher(selector) {\n    switch(selector.type) {\n        case 'wildcard':\n            return () => true;\n\n        case 'identifier': {\n            const value = selector.value.toLowerCase();\n            return (node, ancestry, options) => {\n                const nodeTypeKey = (options && options.nodeTypeKey) || 'type';\n                return value === node[nodeTypeKey].toLowerCase();\n            };\n        }\n\n        case 'exactNode':\n            return (node, ancestry) => {\n                return ancestry.length === 0;\n            };\n\n        case 'field': {\n            const path = selector.name.split('.');\n            return (node, ancestry) => {\n                const ancestor = ancestry[path.length - 1];\n                return inPath(node, ancestor, path, 0);\n            };\n        }\n\n        case 'matches': {\n            const matchers = selector.selectors.map(getMatcher);\n            return (node, ancestry, options) => {\n                for (let i = 0; i < matchers.length; ++i) {\n                    if (matchers[i](node, ancestry, options)) { return true; }\n                }\n                return false;\n            };\n        }\n\n        case 'compound': {\n            const matchers = selector.selectors.map(getMatcher);\n            return (node, ancestry, options) => {\n                for (let i = 0; i < matchers.length; ++i) {\n                    if (!matchers[i](node, ancestry, options)) { return false; }\n                }\n                return true;\n            };\n        }\n\n        case 'not': {\n            const matchers = selector.selectors.map(getMatcher);\n            return (node, ancestry, options) => {\n                for (let i = 0; i < matchers.length; ++i) {\n                    if (matchers[i](node, ancestry, options)) { return false; }\n                }\n                return true;\n            };\n        }\n\n        case 'has': {\n            const matchers = selector.selectors.map(getMatcher);\n            return (node, ancestry, options) => {\n                let result = false;\n\n                const a = [];\n                estraverse.traverse(node, {\n                    enter (node, parent) {\n                        if (parent != null) { a.unshift(parent); }\n\n                        for (let i = 0; i < matchers.length; ++i) {\n                            if (matchers[i](node, a, options)) {\n                                result = true;\n                                this.break();\n                                return;\n                            }\n                        }\n                    },\n                    leave () { a.shift(); },\n                    keys: options && options.visitorKeys,\n                    fallback: options && options.fallback || 'iteration'\n                });\n\n                return result;\n            };\n        }\n\n        case 'child': {\n            const left = getMatcher(selector.left);\n            const right = getMatcher(selector.right);\n            return (node, ancestry, options) => {\n                if (ancestry.length > 0 && right(node, ancestry, options)) {\n                    return left(ancestry[0], ancestry.slice(1), options);\n                }\n                return false;\n            };\n        }\n\n        case 'descendant': {\n            const left = getMatcher(selector.left);\n            const right = getMatcher(selector.right);\n            return (node, ancestry, options) => {\n                if (right(node, ancestry, options)) {\n                    for (let i = 0, l = ancestry.length; i < l; ++i) {\n                        if (left(ancestry[i], ancestry.slice(i + 1), options)) {\n                            return true;\n                        }\n                    }\n                }\n                return false;\n            };\n        }\n\n        case 'attribute': {\n            const path = selector.name.split('.');\n            switch (selector.operator) {\n                case void 0:\n                    return (node) => getPath(node, path) != null;\n                case '=':\n                    switch (selector.value.type) {\n                        case 'regexp':\n                            return (node) => {\n                                const p = getPath(node, path);\n                                return typeof p === 'string' && selector.value.value.test(p);\n                            };\n                        case 'literal': {\n                            const literal = `${selector.value.value}`;\n                            return (node) => literal === `${getPath(node, path)}`;\n                        }\n                        case 'type':\n                            return (node) => selector.value.value === typeof getPath(node, path);\n                    }\n                    throw new Error(`Unknown selector value type: ${selector.value.type}`);\n                case '!=':\n                    switch (selector.value.type) {\n                        case 'regexp':\n                            return (node) => !selector.value.value.test(getPath(node, path));\n                        case 'literal': {\n                            const literal = `${selector.value.value}`;\n                            return (node) => literal !== `${getPath(node, path)}`;\n                        }\n                        case 'type':\n                            return (node) => selector.value.value !== typeof getPath(node, path);\n                    }\n                    throw new Error(`Unknown selector value type: ${selector.value.type}`);\n                case '<=':\n                    return (node) => getPath(node, path) <= selector.value.value;\n                case '<':\n                    return (node) => getPath(node, path) < selector.value.value;\n                case '>':\n                    return (node) => getPath(node, path) > selector.value.value;\n                case '>=':\n                    return (node) => getPath(node, path) >= selector.value.value;\n            }\n            throw new Error(`Unknown operator: ${selector.operator}`);\n        }\n\n        case 'sibling': {\n            const left = getMatcher(selector.left);\n            const right = getMatcher(selector.right);\n            return (node, ancestry, options) =>\n                right(node, ancestry, options) &&\n                    sibling(node, left, ancestry, LEFT_SIDE, options) ||\n                    selector.left.subject &&\n                    left(node, ancestry, options) &&\n                    sibling(node, right, ancestry, RIGHT_SIDE, options);\n        }\n\n        case 'adjacent': {\n            const left = getMatcher(selector.left);\n            const right = getMatcher(selector.right);\n            return (node, ancestry, options) =>\n                right(node, ancestry, options) &&\n                    adjacent(node, left, ancestry, LEFT_SIDE, options) ||\n                    selector.right.subject &&\n                    left(node, ancestry, options) &&\n                    adjacent(node, right, ancestry, RIGHT_SIDE, options);\n        }\n\n        case 'nth-child': {\n            const nth = selector.index.value;\n            const right = getMatcher(selector.right);\n            return (node, ancestry, options) =>\n                right(node, ancestry, options) &&\n                    nthChild(node, ancestry, nth, options);\n        }\n\n        case 'nth-last-child': {\n            const nth = -selector.index.value;\n            const right = getMatcher(selector.right);\n            return (node, ancestry, options) =>\n                right(node, ancestry, options) &&\n                    nthChild(node, ancestry, nth, options);\n        }\n\n        case 'class': {\n            \n            const name = selector.name.toLowerCase();\n\n            return (node, ancestry, options) => {\n                \n                if (options && options.matchClass) {\n                    return options.matchClass(selector.name, node, ancestry);\n                }\n                \n                if (options && options.nodeTypeKey) return false;    \n\n                switch(name){\n                    case 'statement':\n                        if(node.type.slice(-9) === 'Statement') return true;\n                        // fallthrough: interface Declaration <: Statement { }\n                    case 'declaration':\n                        return node.type.slice(-11) === 'Declaration';\n                    case 'pattern':\n                        if(node.type.slice(-7) === 'Pattern') return true;\n                        // fallthrough: interface Expression <: Node, Pattern { }\n                    case 'expression':\n                        return node.type.slice(-10) === 'Expression' ||\n                            node.type.slice(-7) === 'Literal' ||\n                            (\n                                node.type === 'Identifier' &&\n                                (ancestry.length === 0 || ancestry[0].type !== 'MetaProperty')\n                            ) ||\n                            node.type === 'MetaProperty';\n                    case 'function':\n                        return node.type === 'FunctionDeclaration' ||\n                            node.type === 'FunctionExpression' ||\n                            node.type === 'ArrowFunctionExpression';\n                }\n                throw new Error(`Unknown class name: ${selector.name}`);\n            };\n        }\n    }\n\n    throw new Error(`Unknown selector type: ${selector.type}`);\n}\n\n/**\n * @callback TraverseOptionFallback\n * @param {external:AST} node The given node.\n * @returns {string[]} An array of visitor keys for the given node.\n */\n\n/**\n * @callback ClassMatcher\n * @param {string} className The name of the class to match.\n * @param {external:AST} node The node to match against.\n * @param {Array<external:AST>} ancestry The ancestry of the node.\n * @returns {boolean} True if the node matches the class, false if not.\n */\n\n/**\n * @typedef {object} ESQueryOptions\n * @property {string} [nodeTypeKey=\"type\"] By passing `nodeTypeKey`, we can allow other ASTs to use ESQuery.\n * @property { { [nodeType: string]: string[] } } [visitorKeys] By passing `visitorKeys` mapping, we can extend the properties of the nodes that traverse the node.\n * @property {TraverseOptionFallback} [fallback] By passing `fallback` option, we can control the properties of traversing nodes when encountering unknown nodes.\n * @property {ClassMatcher} [matchClass] By passing `matchClass` option, we can customize the interpretation of classes.\n */\n\n/**\n * Given a `node` and its ancestors, determine if `node` is matched\n * by `selector`.\n * @param {?external:AST} node\n * @param {?SelectorAST} selector\n * @param {external:AST[]} [ancestry=[]]\n * @param {ESQueryOptions} [options]\n * @throws {Error} Unknowns (operator, class name, selector type, or\n * selector value type)\n * @returns {boolean}\n */\nfunction matches(node, selector, ancestry, options) {\n    if (!selector) { return true; }\n    if (!node) { return false; }\n    if (!ancestry) { ancestry = []; }\n\n    return getMatcher(selector)(node, ancestry, options);\n}\n\n/**\n * Get visitor keys of a given node.\n * @param {external:AST} node The AST node to get keys.\n * @param {ESQueryOptions|undefined} options\n * @returns {string[]} Visitor keys of the node.\n */\nfunction getVisitorKeys(node, options) {\n    const nodeTypeKey = (options && options.nodeTypeKey) || 'type';\n\n    const nodeType = node[nodeTypeKey];\n    if (options && options.visitorKeys && options.visitorKeys[nodeType]) {\n        return options.visitorKeys[nodeType];\n    }\n    if (estraverse.VisitorKeys[nodeType]) {\n        return estraverse.VisitorKeys[nodeType];\n    }\n    if (options && typeof options.fallback === 'function') {\n        return options.fallback(node);\n    }\n    // 'iteration' fallback\n    return Object.keys(node).filter(function (key) {\n        return key !== nodeTypeKey;\n    });\n}\n\n\n/**\n * Check whether the given value is an ASTNode or not.\n * @param {any} node The value to check.\n * @param {ESQueryOptions|undefined} options The options to use.\n * @returns {boolean} `true` if the value is an ASTNode.\n */\nfunction isNode(node, options) {\n    const nodeTypeKey = (options && options.nodeTypeKey) || 'type';\n    return node !== null && typeof node === 'object' && typeof node[nodeTypeKey] === 'string';\n}\n\n/**\n * Determines if the given node has a sibling that matches the\n * given selector matcher.\n * @param {external:AST} node\n * @param {SelectorMatcher} matcher\n * @param {external:AST[]} ancestry\n * @param {Side} side\n * @param {ESQueryOptions|undefined} options\n * @returns {boolean}\n */\nfunction sibling(node, matcher, ancestry, side, options) {\n    const [parent] = ancestry;\n    if (!parent) { return false; }\n    const keys = getVisitorKeys(parent, options);\n    for (let i = 0; i < keys.length; ++i) {\n        const listProp = parent[keys[i]];\n        if (Array.isArray(listProp)) {\n            const startIndex = listProp.indexOf(node);\n            if (startIndex < 0) { continue; }\n            let lowerBound, upperBound;\n            if (side === LEFT_SIDE) {\n                lowerBound = 0;\n                upperBound = startIndex;\n            } else {\n                lowerBound = startIndex + 1;\n                upperBound = listProp.length;\n            }\n            for (let k = lowerBound; k < upperBound; ++k) {\n                if (isNode(listProp[k], options) && matcher(listProp[k], ancestry, options)) {\n                    return true;\n                }\n            }\n        }\n    }\n    return false;\n}\n\n/**\n * Determines if the given node has an adjacent sibling that matches\n * the given selector matcher.\n * @param {external:AST} node\n * @param {SelectorMatcher} matcher\n * @param {external:AST[]} ancestry\n * @param {Side} side\n * @param {ESQueryOptions|undefined} options\n * @returns {boolean}\n */\nfunction adjacent(node, matcher, ancestry, side, options) {\n    const [parent] = ancestry;\n    if (!parent) { return false; }\n    const keys = getVisitorKeys(parent, options);\n    for (let i = 0; i < keys.length; ++i) {\n        const listProp = parent[keys[i]];\n        if (Array.isArray(listProp)) {\n            const idx = listProp.indexOf(node);\n            if (idx < 0) { continue; }\n            if (side === LEFT_SIDE && idx > 0 && isNode(listProp[idx - 1], options) && matcher(listProp[idx - 1], ancestry, options)) {\n                return true;\n            }\n            if (side === RIGHT_SIDE && idx < listProp.length - 1 && isNode(listProp[idx + 1], options) &&  matcher(listProp[idx + 1], ancestry, options)) {\n                return true;\n            }\n        }\n    }\n    return false;\n}\n\n/**\n * Determines if the given node is the `nth` child.\n * If `nth` is negative then the position is counted\n * from the end of the list of children.\n * @param {external:AST} node\n * @param {external:AST[]} ancestry\n * @param {Integer} nth\n * @param {ESQueryOptions|undefined} options\n * @returns {boolean}\n */\nfunction nthChild(node, ancestry, nth, options) {\n    if (nth === 0) { return false; }\n    const [parent] = ancestry;\n    if (!parent) { return false; }\n    const keys = getVisitorKeys(parent, options);\n    for (let i = 0; i < keys.length; ++i) {\n        const listProp = parent[keys[i]];\n        if (Array.isArray(listProp)){\n            const idx = nth < 0 ? listProp.length + nth : nth - 1;\n            if (idx >= 0 && idx < listProp.length && listProp[idx] === node) {\n                return true;\n            }\n        }\n    }\n    return false;\n}\n\n/**\n * For each selector node marked as a subject, find the portion of the\n * selector that the subject must match.\n * @param {SelectorAST} selector\n * @param {SelectorAST} [ancestor] Defaults to `selector`\n * @returns {SelectorAST[]}\n */\nfunction subjects(selector, ancestor) {\n    if (selector == null || typeof selector != 'object') { return []; }\n    if (ancestor == null) { ancestor = selector; }\n    const results = selector.subject ? [ancestor] : [];\n    const keys = Object.keys(selector);\n    for (let i = 0; i < keys.length; ++i) {\n        const p = keys[i];\n        const sel = selector[p];\n        results.push(...subjects(sel, p === 'left' ? sel : ancestor));\n    }\n    return results;\n}\n\n/**\n* @callback TraverseVisitor\n* @param {?external:AST} node\n* @param {?external:AST} parent\n* @param {external:AST[]} ancestry\n*/\n\n/**\n * From a JS AST and a selector AST, collect all JS AST nodes that\n * match the selector.\n * @param {external:AST} ast\n * @param {?SelectorAST} selector\n * @param {TraverseVisitor} visitor\n * @param {ESQueryOptions} [options]\n * @returns {external:AST[]}\n */\nfunction traverse(ast, selector, visitor, options) {\n    if (!selector) { return; }\n    const ancestry = [];\n    const matcher = getMatcher(selector);\n    const altSubjects = subjects(selector).map(getMatcher);\n    estraverse.traverse(ast, {\n        enter (node, parent) {\n            if (parent != null) { ancestry.unshift(parent); }\n            if (matcher(node, ancestry, options)) {\n                if (altSubjects.length) {\n                    for (let i = 0, l = altSubjects.length; i < l; ++i) {\n V                       if (altSubjects[i](node, ancestry, options)) {\n                            visitor(node, parent, ancestry);\n                        }\n                        for (let k = 0, m = ancestry.length; k < m; ++k) {\n                            const succeedingAncestry = ancestry.slice(k + 1);\n                            if (altSubjects[i](ancestry[k], succeedingAncestry, options)) {\n                                visitor(ancestry[k], parent, succeedingAncestry);\n                            }\n                        }\n                    }\n                } else {\n                    visitor(node, parent, ancestry);\n                }\n            }\n        },\n        leave () { ancestry.shift(); },\n        keys: options && options.visitorKeys,\n        fallback: options && options.fallback || 'iteration'\n    });\n}\n\n\n/**\n * From a JS AST and a selector AST, collect all JS AST nodes that\n * match the selector.\n * @param {external:AST} ast\n * @param {?SelectorAST} selector\n * @param {ESQueryOptions} [options]\n * @returns {external:AST[]}\n */\nfunction match(ast, selector, options) {\n    const results = [];\n    traverse(ast, selector, function (node) {\n        results.push(node);\n    }, options);\n    return results;\n}\n\n/**\n * Parse a selector string and return its AST.\n * @param {string} selector\n * @returns {SelectorAST}\n */\nfunction parse(selector) {\n    return parser.parse(selector);\n}\n\n/**\n * Query the code AST using the selector string.\n * @param {external:AST} ast\n * @param {string} selector\n * @param {ESQueryOptions} [options]\n * @returns {external:AST[]}\n */\nfunction query(ast, selector, options) {\n    return match(ast, parse(selector), options);\n}\n\nquery.parse = parse;\nquery.match = match;\nquery.traverse = traverse;\nquery.matches = matches;\nquery.query = query;\n\nexport default query;\n"],"names":["clone","exports","Syntax","VisitorOption","VisitorKeys","BREAK","SKIP","REMOVE","deepCopy","obj","key","val","ret","hasOwnProperty","Reference","parent","this","Element","node","path","wrap","ref","Controller","isNode","type","isProperty","nodeType","ObjectExpression","ObjectPattern","candidateExistsInLeaveList","leavelist","candidate","i","length","traverse","root","visitor","extendCommentRange","comment","tokens","target","array","func","diff","len","current","upperBound","token","range","extendedRange","AssignmentExpression","AssignmentPattern","ArrayExpression","ArrayPattern","ArrowFunctionExpression","AwaitExpression","BlockStatement","BinaryExpression","BreakStatement","CallExpression","CatchClause","ChainExpression","ClassBody","ClassDeclaration","ClassExpression","ComprehensionBlock","ComprehensionExpression","ConditionalExpression","ContinueStatement","DebuggerStatement","DirectiveStatement","DoWhileStatement","EmptyStatement","ExportAllDeclaration","ExportDefaultDeclaration","ExportNamedDeclaration","ExportSpecifier","ExpressionStatement","ForStatement","ForInStatement","ForOfStatement","FunctionDeclaration","FunctionExpression","GeneratorExpression","Identifier","IfStatement","ImportExpression","ImportDeclaration","ImportDefaultSpecifier","ImportNamespaceSpecifier","ImportSpecifier","Literal","LabeledStatement","LogicalExpression","MemberExpression","MetaProperty","MethodDefinition","ModuleSpecifier","NewExpression","PrivateIdentifier","Program","Property","PropertyDefinition","RestElement","ReturnStatement","SequenceExpression","SpreadElement","Super","SwitchStatement","SwitchCase","TaggedTemplateExpression","TemplateElement","TemplateLiteral","ThisExpression","ThrowStatement","TryStatement","UnaryExpression","UpdateExpression","VariableDeclaration","VariableDeclarator","WhileStatement","WithStatement","YieldExpression","Break","Skip","Remove","prototype","replace","remove","Array","isArray","splice","iz","j","jz","result","addToPath","push","__current","__leavelist","parents","__execute","callback","element","previous","undefined","__state","call","notify","flag","skip","__initialize","__worklist","__fallback","fallback","Object","keys","__keys","assign","create","worklist","current2","candidates","sentinel","pop","enter","Error","leave","outer","removeElem","nextElem","attachComments","tree","providedComments","cursor","comments","leadingComments","trailingComments","cloneEnvironment","module","peg$SyntaxError","message","expected","found","location","name","captureStackTrace","child","ctor","constructor","peg$subclass","buildMessage","DESCRIBE_EXPECTATION_FNS","literal","expectation","literalEscape","text","class","escapedParts","parts","classEscape","inverted","any","end","other","description","hex","ch","charCodeAt","toString","toUpperCase","s","descriptions","sort","slice","join","describeExpected","describeFound","SyntaxError","parse","input","options","peg$result","peg$FAILED","peg$startRuleFunctions","start","peg$parsestart","peg$startRuleFunction","peg$c3","peg$literalExpectation","peg$c4","peg$c5","peg$classExpectation","peg$c8","peg$c11","peg$c14","peg$c18","peg$c19","ss","concat","map","peg$c23","peg$c26","peg$c29","peg$c32","peg$c34","peg$c36","peg$c37","peg$c39","peg$c40","a","peg$c41","peg$c42","peg$c44","peg$c46","op","value","operator","peg$c49","peg$c50","peg$c51","peg$c53","peg$c54","peg$c55","b","peg$c56","d","match","peg$c58","peg$c59","peg$c60","peg$c61","peg$c62","peg$c66","peg$c67","peg$c68","peg$c70","peg$c72","peg$c73","peg$c75","peg$c77","peg$c78","peg$c81","peg$c82","peg$c86","peg$c89","peg$c90","selectors","peg$c92","peg$c94","peg$c97","peg$c100","peg$c103","peg$c106","peg$c109","peg$currPos","peg$posDetailsCache","line","column","peg$maxFailPos","peg$maxFailExpected","peg$silentFails","startRule","ignoreCase","peg$computePosDetails","pos","p","details","peg$computeLocation","startPos","endPos","startPosDetails","endPosDetails","offset","peg$fail","s0","s1","s2","cached","peg$resultsCache","nextPos","peg$parse_","peg$parseselectors","peg$c1","peg$parseidentifierName","test","charAt","peg$parsebinaryOp","s3","s4","s5","s6","s7","peg$parseselector","peg$parsehasSelector","left","right","peg$parsesequence","reduce","memo","rhs","subject","as","peg$parseatom","peg$parsewildcard","peg$parseidentifier","peg$parseattrName","peg$parseattrEqOps","substr","peg$parsetype","flgs","peg$parsere_character_class","peg$parsere_escape","peg$parsere_chars","peg$parseflags","RegExp","peg$parseregex","peg$parseattrOps","peg$parsestring","leadingDecimals","apply","parseFloat","peg$parsenumber","peg$parsepath","peg$parseattrValue","peg$parseattr","peg$parsefield","peg$parsenegation","peg$parsematches","peg$parseis","peg$parsehasSelectors","peg$parsehas","nth","peg$parsefirstChild","nthLast","peg$parselastChild","parseInt","peg$parsenthChild","peg$parsenthLastChild","peg$parseclass","n","index","factory","getPath","MATCHER_CACHE","WeakMap","getMatcher","selector","matcher","get","generateMatcher","set","toLowerCase","ancestry","nodeTypeKey","split","inPath","ancestor","fromPathIndex","field","k","matchers","estraverse","unshift","shift","visitorKeys","l","_typeof","sibling","adjacent","nthChild","matchClass","getVisitorKeys","filter","side","_slicedToArray","listProp","startIndex","indexOf","lowerBound","idx","ast","altSubjects","subjects","results","sel","_toConsumableArray","m","succeedingAncestry","parser","query","matches"],"mappings":"qzDA2BC,SAASA,EAAMC,GAGZ,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EAEJ,SAASC,EAASC,GACd,IAAcC,EAAKC,EAAfC,EAAM,GACV,IAAKF,KAAOD,EACJA,EAAII,eAAeH,KACnBC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,eAajD,SAASiH,EAAM0J,EAAKlC,EAAUtK,GAC1B,IAAM2M,EAAU,GAIhB,OAHAtY,EAASmY,EAAKlC,GAAU,SAAUjX,GAC9BsZ,EAAQ/R,KAAKvH,KACd2M,GACI2M,EAQX,SAAS7M,EAAMwK,GACX,OAAO0C,EAAOlN,MAAMwK,GAUxB,SAAS2C,EAAMT,EAAKlC,EAAUtK,GAC1B,OAAO8C,EAAM0J,EAAK1M,EAAMwK,GAAWtK,GAGvCiN,EAAMnN,MAAQA,EACdmN,EAAMnK,MAAQA,EACdmK,EAAM5Y,SAAWA,EACjB4Y,EAAMC,QAvPN,SAAiB7Z,EAAMiX,EAAUM,EAAU5K,GACvC,OAAKsK,KACAjX,IACAuX,IAAYA,EAAW,IAErBP,EAAWC,EAAXD,CAAqBhX,EAAMuX,EAAU5K,KAmPhDiN,EAAMA,MAAQA"}Dx   (function (global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
  typeof define === 'function' && define.amd ? define(factory) :
  (global = global || self, global.esquery = factory());
}(this, (function () { 'use strict';

  function _arrayLikeToArray(r, a) {
    (null == a || a > r.length) && (a = r.length);
    for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
    return n;
  }
  function _arrayWithHoles(r) {
    if (Array.isArray(r)) return r;
  }
  function _arrayWithoutHoles(r) {
    if (Array.isArray(r)) return _arrayLikeToArray(r);
  }
  function _iterableToArray(r) {
    if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
  }
  function _iterableToArrayLimit(r, l) {
    var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
    if (null != t) {
      var e,
        n,
        i,
        u,
        a = [],
        f = !0,
        o = !1;
      try {
        if (i = (t = t.call(r)).next, 0 === l) {
          if (Object(t) !== t) return;
          f = !1;
        } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
      } catch (r) {
        o = !0, n = r;
      } finally {
        try {
          if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
        } finally {
          if (o) throw n;
        }
      }
      return a;
    }
  }
  function _nonIterableRest() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _nonIterableSpread() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _slicedToArray(r, e) {
    return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
  }
  function _toConsumableArray(r) {
    return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
  }
  function _typeof(o) {
    "@babel/helpers - typeof";

    return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
      return typeof o;
    } : function (o) {
      return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
    }, _typeof(o);
  }
  function _unsupportedIterableToArray(r, a) {
    if (r) {
      if ("string" == typeof r) return _arrayLikeToArray(r, a);
      var t = {}.toString.call(r).slice(8, -1);
      return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
    }
  }

  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};

  function createCommonjsModule(fn, module) {
  	return module = { exports: {} }, fn(module, module.exports), module.exports;
  }

  var estraverse = createCommonjsModule(function (module, exports) {
    /*
      Copyright (C) 2012-2013 Yusuke Suzuki <utatane.tea@gmail.com>
      Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>
    
      Redistribution and use in source and binary forms, with or without
      modification, are permitted provided that the following conditions are met:
    
        * Redistributions of source code must retain the above copyright
          notice, this list of conditions and the following disclaimer.
        * Redistributions in binary form must reproduce the above copyright
          notice, this list of conditions and the following disclaimer in the
          documentation and/or other materials provided with the distribution.
    
      THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
      AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
      IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
      ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
      DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
      (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
      LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
      ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
      (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
      THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
    */
    /*jslint vars:false, bitwise:true*/
    /*jshint indent:4*/
    /*global exports:true*/
    (function clone(exports) {

      var Syntax, VisitorOption, VisitorKeys, BREAK, SKIP, REMOVE;
      function deepCopy(obj) {
        var ret = {},
          key,
          val;
        for (key in obj) {
          if (obj.hasOwnProperty(key)) {
            val = obj[key];
            if (typeof val === 'object' && val !== null) {
              ret[key] = deepCopy(val);
            } else {
              ret[key] = val;
            }
          }
        }
        return ret;
      }

      // based on LLVM libc++ upper_bound / lower_bound
      // MIT License

      function upperBound(array, func) {
        var diff, len, i, current;
        len = array.length;
        i = 0;
        while (len) {
          diff = len >>> 1;
          current = i + diff;
          if (func(array[current])) {
            len = diff;
          } else {
            i = current + 1;
            len -= diff + 1;
          }
        }
        return i;
      }
      Syntax = {
        AssignmentExpression: 'AssignmentExpression',
        AssignmentPattern: 'AssignmentPattern',
        ArrayExpression: 'ArrayExpression',
        ArrayPattern: 'ArrayPattern',
        ArrowFunctionExpression: 'ArrowFunctionExpression',
        AwaitExpression: 'AwaitExpression',
        // CAUTION: It's deferred to ES7.
        BlockStatement: 'BlockStatement',
        BinaryExpression: 'BinaryExpression',
        BreakStatement: 'BreakStatement',
        CallExpression: 'CallExpression',
        CatchClause: 'CatchClause',
        ChainExpression: 'ChainExpression',
        ClassBody: 'ClassBody',
        ClassDeclaration: 'ClassDeclaration',
        ClassExpression: 'ClassExpression',
        ComprehensionBlock: 'ComprehensionBlock',
        // CAUTION: It's deferred to ES7.
        ComprehensionExpression: 'ComprehensionExpression',
        // CAUTION: It's deferred to ES7.
        ConditionalExpression: 'ConditionalExpression',
        ContinueStatement: 'ContinueStatement',
        DebuggerStatement: 'DebuggerStatement',
        DirectiveStatement: 'DirectiveStatement',
        DoWhileStatement: 'DoWhileStatement',
        EmptyStatement: 'EmptyStatement',
        ExportAllDeclaration: 'ExportAllDeclaration',
        ExportDefaultDeclaration: 'ExportDefaultDeclaration',
        ExportNamedDeclaration: 'ExportNamedDeclaration',
        ExportSpecifier: 'ExportSpecifier',
        ExpressionStatement: 'ExpressionStatement',
        ForStatement: 'ForStatement',
        ForInStatement: 'ForInStatement',
        ForOfStatement: 'ForOfStatement',
        FunctionDeclaration: 'FunctionDeclaration',
        FunctionExpression: 'FunctionExpression',
        GeneratorExpression: 'GeneratorExpression',
        // CAUTION: It's deferred to ES7.
        Identifier: 'Identifier',
        IfStatement: 'IfStatement',
        ImportExpression: 'ImportExpression',
        ImportDeclaration: 'ImportDeclaration',
        ImportDefaultSpecifier: 'ImportDefaultSpecifier',
        ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',
        ImportSpecifier: 'ImportSpecifier',
        Literal: 'Literal',
        LabeledStatement: 'LabeledStatement',
        LogicalExpression: 'LogicalExpression',
        MemberExpression: 'MemberExpression',
        MetaProperty: 'MetaProperty',
        MethodDefinition: 'MethodDefinition',
        ModuleSpecifier: 'ModuleSpecifier',
        NewExpression: 'NewExpression',
        ObjectExpression: 'ObjectExpression',
        ObjectPattern: 'ObjectPattern',
        PrivateIdentifier: 'PrivateIdentifier',
        Program: 'Program',
        Property: 'Property',
        PropertyDefinition: 'PropertyDefinition',
        RestElement: 'RestElement',
        ReturnStatement: 'ReturnStatement',
        SequenceExpression: 'SequenceExpression',
        SpreadElement: 'SpreadElement',
        Super: 'Super',
        SwitchStatement: 'SwitchStatement',
        SwitchCase: 'SwitchCase',
        TaggedTemplateExpression: 'TaggedTemplateExpression',
        TemplateElement: 'TemplateElement',
        TemplateLiteral: 'TemplateLiteral',
        ThisExpression: 'ThisExpression',
        ThrowStatement: 'ThrowStatement',
        TryStatement: 'TryStatement',
        UnaryExpression: 'UnaryExpression',
        UpdateExpression: 'UpdateExpression',
        VariableDeclaration: 'VariableDeclaration',
        VariableDeclarator: 'VariableDeclarator',
        WhileStatement: 'WhileStatement',
        WithStatement: 'WithStatement',
        YieldExpression: 'YieldExpression'
      };
      VisitorKeys = {
        AssignmentExpression: ['left', 'right'],
        AssignmentPattern: ['left', 'right'],
        ArrayExpression: ['elements'],
        ArrayPattern: ['elements'],
        ArrowFunctionExpression: ['params', 'body'],
        AwaitExpression: ['argument'],
        // CAUTION: It's deferred to ES7.
        BlockStatement: ['body'],
        BinaryExpression: ['left', 'right'],
        BreakStatement: ['label'],
        CallExpression: ['callee', 'arguments'],
        CatchClause: ['param', 'body'],
        ChainExpression: ['expression'],
        ClassBody: ['body'],
        ClassDeclaration: ['id', 'superClass', 'body'],
        ClassExpression: ['id', 'superClass', 'body'],
        ComprehensionBlock: ['left', 'right'],
        // CAUTION: It's deferred to ES7.
        ComprehensionExpression: ['blocks', 'filter', 'body'],
        // CAUTION: It's deferred to ES7.
        ConditionalExpression: ['test', 'consequent', 'alternate'],
        ContinueStatement: ['label'],
        DebuggerStatement: [],
        DirectiveStatement: [],
        DoWhileStatement: ['body', 'test'],
        EmptyStatement: [],
        ExportAllDeclaration: ['source'],
        ExportDefaultDeclaration: ['declaration'],
        ExportNamedDeclaration: ['declaration', 'specifiers', 'source'],
        ExportSpecifier: ['exported', 'local'],
        ExpressionStatement: ['expression'],
        ForStatement: ['init', 'test', 'update', 'body'],
        ForInStatement: ['left', 'right', 'body'],
        ForOfStatement: ['left', 'right', 'body'],
        FunctionDeclaration: ['id', 'params', 'body'],
        FunctionExpression: ['id', 'params', 'body'],
        GeneratorExpression: ['blocks', 'filter', 'body'],
        // CAUTION: It's deferred to ES7.
        Identifier: [],
        IfStatement: ['test', 'consequent', 'alternate'],
        ImportExpression: ['source'],
        ImportDeclaration: ['specifiers', 'source'],
        ImportDefaultSpecifier: ['local'],
        ImportNamespaceSpecifier: ['local'],
        ImportSpecifier: ['imported', 'local'],
        Literal: [],
        LabeledStatement: ['label', 'body'],
        LogicalExpression: ['left', 'right'],
        MemberExpression: ['object', 'property'],
        MetaProperty: ['meta', 'property'],
        MethodDefinition: ['key', 'value'],
        ModuleSpecifier: [],
        NewExpression: ['callee', 'arguments'],
        ObjectExpression: ['properties'],
        ObjectPattern: ['properties'],
        PrivateIdentifier: [],
        Program: ['body'],
        Property: ['key', 'value'],
        PropertyDefinition: ['key', 'value'],
        RestElement: ['argument'],
        ReturnStatement: ['argument'],
        SequenceExpression: ['expressions'],
        SpreadElement: ['argument'],
        Super: [],
        SwitchStatement: ['discriminant', 'cases'],
        SwitchCase: ['test', 'consequent'],
        TaggedTemplateExpression: ['tag', 'quasi'],
        TemplateElement: [],
        TemplateLiteral: ['quasis', 'expressions'],
        ThisExpression: [],
        ThrowStatement: ['argument'],
        TryStatement: ['block', 'handler', 'finalizer'],
        UnaryExpression: ['argument'],
        UpdateExpression: ['argument'],
        VariableDeclaration: ['declarations'],
        VariableDeclarator: ['id', 'init'],
        WhileStatement: ['test', 'body'],
        WithStatement: ['object', 'body'],
        YieldExpression: ['argument']
      };

      // unique id
      BREAK = {};
      SKIP = {};
      REMOVE = {};
      VisitorOption = {
        Break: BREAK,
        Skip: SKIP,
        Remove: REMOVE
      };
      function Reference(parent, key) {
        this.parent = parent;
        this.key = key;
      }
      Reference.prototype.replace = function replace(node) {
        this.parent[this.key] = node;
      };
      Reference.prototype.remove = function remove() {
        if (Array.isArray(this.parent)) {
          this.parent.splice(this.key, 1);
          return true;
        } else {
          this.replace(null);
          return false;
        }
      };
      function Element(node, path, wrap, ref) {
        this.node = node;
        this.path = path;
        this.wrap = wrap;
        this.ref = ref;
      }
      function Controller() {}

      // API:
      // return property path array from root to current node
      Controller.prototype.path = function path() {
        var i, iz, j, jz, result, element;
        function addToPath(result, path) {
          if (Array.isArray(path)) {
            for (j = 0, jz = path.length; j < jz; ++j) {
              result.push(path[j]);
            }
          } else {
            result.push(path);
          }
        }

        // root node
        if (!this.__current.path) {
          return null;
        }

        // first node is sentinel, second node is root element
        result = [];
        for (i = 2, iz = this.__leavelist.length; i < iz; ++i) {
          element = this.__leavelist[i];
          addToPath(result, element.path);
        }
        addToPath(result, this.__current.path);
        return result;
      };

      // API:
      // return type of current node
      Controller.prototype.type = function () {
        var node = this.current();
        return node.type || this.__current.wrap;
      };

      // API:
      // return array of parent elements
      Controller.prototype.parents = function parents() {
        var i, iz, result;

        // first node is sentinel
        result = [];
        for (i = 1, iz = this.__leavelist.length; i < iz; ++i) {
          result.push(this.__leavelist[i].node);
        }
        return result;
      };

      // API:
      // return current node
      Controller.prototype.current = function current() {
        return this.__current.node;
      };
      Controller.prototype.__execute = function __execute(callback, element) {
        var previous, result;
        result = undefined;
        previous = this.__current;
        this.__current = element;
        this.__state = null;
        if (callback) {
          result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node);
        }
        this.__current = previous;
        return result;
      };

      // API:
      // notify control skip / break
      Controller.prototype.notify = function notify(flag) {
        this.__state = flag;
      };

      // API:
      // skip child nodes of current node
      Controller.prototype.skip = function () {
        this.notify(SKIP);
      };

      // API:
      // break traversals
      Controller.prototype['break'] = function () {
        this.notify(BREAK);
      };

      // API:
      // remove node
      Controller.prototype.remove = function () {
        this.notify(REMOVE);
      };
      Controller.prototype.__initialize = function (root, visitor) {
        this.visitor = visitor;
        this.root = root;
        this.__worklist = [];
        this.__leavelist = [];
        this.__current = null;
        this.__state = null;
        this.__fallback = null;
        if (visitor.fallback === 'iteration') {
          this.__fallback = Object.keys;
        } else if (typeof visitor.fallback === 'function') {
          this.__fallback = visitor.fallback;
        }
        this.__keys = VisitorKeys;
        if (visitor.keys) {
          this.__keys = Object.assign(Object.create(this.__keys), visitor.keys);
        }
      };
      function isNode(node) {
        if (node == null) {
          return false;
        }
        return typeof node === 'object' && typeof node.type === 'string';
      }
      function isProperty(nodeType, key) {
        return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key;
      }
      function candidateExistsInLeaveList(leavelist, candidate) {
        for (var i = leavelist.length - 1; i >= 0; --i) {
          if (leavelist[i].node === candidate) {
            return true;
          }
        }
        return false;
      }
      Controller.prototype.traverse = function traverse(root, visitor) {
        var worklist, leavelist, element, node, nodeType, ret, key, current, current2, candidates, candidate, sentinel;
        this.__initialize(root, visitor);
        sentinel = {};

        // reference
        worklist = this.__worklist;
        leavelist = this.__leavelist;

        // initialize
        worklist.push(new Element(root, null, null, null));
        leavelist.push(new Element(null, null, null, null));
        while (worklist.length) {
          element = worklist.pop();
          if (element === sentinel) {
            element = leavelist.pop();
            ret = this.__execute(visitor.leave, element);
            if (this.__state === BREAK || ret === BREAK) {
              return;
            }
            continue;
          }
          if (element.node) {
            ret = this.__execute(visitor.enter, element);
            if (this.__state === BREAK || ret === BREAK) {
              return;
            }
            worklist.push(sentinel);
            leavelist.push(element);
            if (this.__state === SKIP || ret === SKIP) {
              continue;
            }
            node = element.node;
            nodeType = node.type || element.wrap;
            candidates = this.__keys[nodeType];
            if (!candidates) {
              if (this.__fallback) {
                candidates = this.__fallback(node);
              } else {
                throw new Error('Unknown node type ' + nodeType + '.');
              }
            }
            current = candidates.length;
            while ((current -= 1) >= 0) {
              key = candidates[current];
              candidate = node[key];
              if (!candidate) {
                continue;
              }
              if (Array.isArray(candidate)) {
                current2 = candidate.length;
                while ((current2 -= 1) >= 0) {
                  if (!candidate[current2]) {
                    continue;
                  }
                  if (candidateExistsInLeaveList(leavelist, candidate[current2])) {
                    continue;
                  }
                  if (isProperty(nodeType, candidates[current])) {
                    element = new Element(candidate[current2], [key, current2], 'Property', null);
                  } else if (isNode(candidate[current2])) {
                    element = new Element(candidate[current2], [key, current2], null, null);
                  } else {
                    continue;
                  }
                  worklist.push(element);
                }
              } else if (isNode(candidate)) {
                if (candidateExistsInLeaveList(leavelist, candidate)) {
                  continue;
                }
                worklist.push(new Element(candidate, key, null, null));
              }
            }
          }
        }
      };
      Controller.prototype.replace = function replace(root, visitor) {
        var worklist, leavelist, node, nodeType, target, element, current, current2, candidates, candidate, sentinel, outer, key;
        function removeElem(element) {
          var i, key, nextElem, parent;
          if (element.ref.remove()) {
            // When the reference is an element of an array.
            key = element.ref.key;
            parent = element.ref.parent;

            // If removed from array, then decrease following items' keys.
            i = worklist.length;
            while (i--) {
              nextElem = worklist[i];
              if (nextElem.ref && nextElem.ref.parent === parent) {
                if (nextElem.ref.key < key) {
                  break;
                }
                --nextElem.ref.key;
              }
            }
          }
        }
        this.__initialize(root, visitor);
        sentinel = {};

        // reference
        worklist = this.__worklist;
        leavelist = this.__leavelist;

        // initialize
        outer = {
          root: root
        };
        element = new Element(root, null, null, new Reference(outer, 'root'));
        worklist.push(element);
        leavelist.push(element);
        while (worklist.length) {
          element = worklist.pop();
          if (element === sentinel) {
            element = leavelist.pop();
            target = this.__execute(visitor.leave, element);

            // node may be replaced with null,
            // so distinguish between undefined and null in this place
            if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {
              // replace
              element.ref.replace(target);
            }
            if (this.__state === REMOVE || target === REMOVE) {
              removeElem(element);
            }
            if (this.__state === BREAK || target === BREAK) {
              return outer.root;
            }
            continue;
          }
          target = this.__execute(visitor.enter, element);

          // node may be replaced with null,
          // so distinguish between undefined and null in this place
          if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {
            // replace
            element.ref.replace(target);
            element.node = target;
          }
          if (this.__state === REMOVE || target === REMOVE) {
            removeElem(element);
            element.node = null;
          }
          if (this.__state === BREAK || target === BREAK) {
            return outer.root;
          }

          // node may be null
          node = element.node;
          if (!node) {
            continue;
          }
          worklist.push(sentinel);
          leavelist.push(element);
          if (this.__state === SKIP || target === SKIP) {
            continue;
          }
          nodeType = node.type || element.wrap;
          candidates = this.__keys[nodeType];
          if (!candidates) {
            if (this.__fallback) {
              candidates = this.__fallback(node);
            } else {
              throw new Error('Unknown node type ' + nodeType + '.');
            }
          }
          current = candidates.length;
          while ((current -= 1) >= 0) {
            key = candidates[current];
            candidate = node[key];
            if (!candidate) {
              continue;
            }
            if (Array.isArray(candidate)) {
              current2 = candidate.length;
              while ((current2 -= 1) >= 0) {
                if (!candidate[current2]) {
                  continue;
                }
                if (isProperty(nodeType, candidates[current])) {
                  element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2));
                } else if (isNode(candidate[current2])) {
                  element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2));
                } else {
                  continue;
                }
                worklist.push(element);
              }
            } else if (isNode(candidate)) {
              worklist.push(new Element(candidate, key, null, new Reference(node, key)));
            }
          }
        }
        return outer.root;
      };
      function traverse(root, visitor) {
        var controller = new Controller();
        return controller.traverse(root, visitor);
      }
      function replace(root, visitor) {
        var controller = new Controller();
        return controller.replace(root, visitor);
      }
      function extendCommentRange(comment, tokens) {
        var target;
        target = upperBound(tokens, function search(token) {
          return token.range[0] > comment.range[0];
        });
        comment.extendedRange = [comment.range[0], comment.range[1]];
        if (target !== tokens.length) {
          comment.extendedRange[1] = tokens[target].range[0];
        }
        target -= 1;
        if (target >= 0) {
          comment.extendedRange[0] = tokens[target].range[1];
        }
        return comment;
      }
      function attachComments(tree, providedComments, tokens) {
        // At first, we should calculate extended comment ranges.
        var comments = [],
          comment,
          len,
          i,
          cursor;
        if (!tree.range) {
          throw new Error('attachComments needs range information');
        }

        // tokens array is empty, we attach comments to tree as 'leadingComments'
        if (!tokens.length) {
          if (providedComments.length) {
            for (i = 0, len = providedComments.length; i < len; i += 1) {
              comment = deepCopy(providedComments[i]);
              comment.extendedRange = [0, tree.range[0]];
              comments.push(comment);
            }
            tree.leadingComments = comments;
          }
          return tree;
        }
        for (i = 0, len = providedComments.length; i < len; i += 1) {
          comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens));
        }

        // This is based on John Freeman's implementation.
        cursor = 0;
        traverse(tree, {
          enter: function (node) {
            var comment;
            while (cursor < comments.length) {
              comment = comments[cursor];
              if (comment.extendedRange[1] > node.range[0]) {
                break;
              }
              if (comment.extendedRange[1] === node.range[0]) {
                if (!node.leadingComments) {
                  node.leadingComments = [];
                }
                node.leadingComments.push(comment);
                comments.splice(cursor, 1);
              } else {
                cursor += 1;
              }
            }

            // already out of owned node
            if (cursor === comments.length) {
              return VisitorOption.Break;
            }
            if (comments[cursor].extendedRange[0] > node.range[1]) {
              return VisitorOption.Skip;
            }
          }
        });
        cursor = 0;
        traverse(tree, {
          leave: function (node) {
            var comment;
            while (cursor < comments.length) {
              comment = comments[cursor];
              if (node.range[1] < comment.extendedRange[0]) {
                break;
              }
              if (node.range[1] === comment.extendedRange[0]) {
                if (!node.trailingComments) {
                  node.trailingComments = [];
                }
                node.trailingComments.push(comment);
                comments.splice(cursor, 1);
              } else {
                cursor += 1;
              }
            }

            // already out of owned node
            if (cursor === comments.length) {
              return VisitorOption.Break;
            }
            if (comments[cursor].extendedRange[0] > node.range[1]) {
              return VisitorOption.Skip;
            }
          }
        });
        return tree;
      }
      exports.Syntax = Syntax;
      exports.traverse = traverse;
      exports.replace = replace;
      exports.attachComments = attachComments;
      exports.VisitorKeys = VisitorKeys;
      exports.VisitorOption = VisitorOption;
      exports.Controller = Controller;
      exports.cloneEnvironment = function () {
        return clone({});
      };
      return exports;
    })(exports);
    /* vim: set sw=4 ts=4 et tw=80 : */
  });

  var parser = createCommonjsModule(function (module) {
    /*
     * Generated by PEG.js 0.10.0.
     *
     * http://pegjs.org/
     */
    (function (root, factory) {
      if ( module.exports) {
        module.exports = factory();
      }
    })(commonjsGlobal, function () {

      function peg$subclass(child, parent) {
        function ctor() {
          this.constructor = child;
        }
        ctor.prototype = parent.prototype;
        child.prototype = new ctor();
      }
      function peg$SyntaxError(message, expected, found, location) {
        this.message = message;
        this.expected = expected;
        this.found = found;
        this.location = location;
        this.name = "SyntaxError";
        if (typeof Error.captureStackTrace === "function") {
          Error.captureStackTrace(this, peg$SyntaxError);
        }
      }
      peg$subclass(peg$SyntaxError, Error);
      peg$SyntaxError.buildMessage = function (expected, found) {
        var DESCRIBE_EXPECTATION_FNS = {
          literal: function literal(expectation) {
            return "\"" + literalEscape(expectation.text) + "\"";
          },
          "class": function _class(expectation) {
            var escapedParts = "",
              i;
            for (i = 0; i < expectation.parts.length; i++) {
              escapedParts += expectation.parts[i] instanceof Array ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1]) : classEscape(expectation.parts[i]);
            }
            return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
          },
          any: function any(expectation) {
            return "any character";
          },
          end: function end(expectation) {
            return "end of input";
          },
          other: function other(expectation) {
            return expectation.description;
          }
        };
        function hex(ch) {
          return ch.charCodeAt(0).toString(16).toUpperCase();
        }
        function literalEscape(s) {
          return s.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\0/g, '\\0').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/[\x00-\x0F]/g, function (ch) {
            return '\\x0' + hex(ch);
          }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) {
            return '\\x' + hex(ch);
          });
        }
        function classEscape(s) {
          return s.replace(/\\/g, '\\\\').replace(/\]/g, '\\]').replace(/\^/g, '\\^').replace(/-/g, '\\-').replace(/\0/g, '\\0').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/[\x00-\x0F]/g, function (ch) {
            return '\\x0' + hex(ch);
          }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) {
            return '\\x' + hex(ch);
          });
        }
        function describeExpectation(expectation) {
          return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
        }
        function describeExpected(expected) {
          var descriptions = new Array(expected.length),
            i,
            j;
          for (i = 0; i < expected.length; i++) {
            descriptions[i] = describeExpectation(expected[i]);
          }
          descriptions.sort();
          if (descriptions.length > 0) {
            for (i = 1, j = 1; i < descriptions.length; i++) {
              if (descriptions[i - 1] !== descriptions[i]) {
                descriptions[j] = descriptions[i];
                j++;
              }
            }
            descriptions.length = j;
          }
          switch (descriptions.length) {
            case 1:
              return descriptions[0];
            case 2:
              return descriptions[0] + " or " + descriptions[1];
            default:
              return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1];
          }
        }
        function describeFound(found) {
          return found ? "\"" + literalEscape(found) + "\"" : "end of input";
        }
        return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
      };
      function peg$parse(input, options) {
        options = options !== void 0 ? options : {};
        var peg$FAILED = {},
          peg$startRuleFunctions = {
            start: peg$parsestart
          },
          peg$startRuleFunction = peg$parsestart,
          peg$c0 = function peg$c0(ss) {
            return ss.length === 1 ? ss[0] : {
              type: 'matches',
              selectors: ss
            };
          },
          peg$c1 = function peg$c1() {
            return void 0;
          },
          peg$c2 = " ",
          peg$c3 = peg$literalExpectation(" ", false),
          peg$c4 = /^[^ [\],():#!=><~+.]/,
          peg$c5 = peg$classExpectation([" ", "[", "]", ",", "(", ")", ":", "#", "!", "=", ">", "<", "~", "+", "."], true, false),
          peg$c6 = function peg$c6(i) {
            return i.join('');
          },
          peg$c7 = ">",
          peg$c8 = peg$literalExpectation(">", false),
          peg$c9 = function peg$c9() {
            return 'child';
          },
          peg$c10 = "~",
          peg$c11 = peg$literalExpectation("~", false),
          peg$c12 = function peg$c12() {
            return 'sibling';
          },
          peg$c13 = "+",
          peg$c14 = peg$literalExpectation("+", false),
          peg$c15 = function peg$c15() {
            return 'adjacent';
          },
          peg$c16 = function peg$c16() {
            return 'descendant';
          },
          peg$c17 = ",",
          peg$c18 = peg$literalExpectation(",", false),
          peg$c19 = function peg$c19(s, ss) {
            return [s].concat(ss.map(function (s) {
              return s[3];
            }));
          },
          peg$c20 = function peg$c20(op, s) {
            if (!op) return s;
            return {
              type: op,
              left: {
                type: 'exactNode'
              },
              right: s
            };
          },
          peg$c21 = function peg$c21(a, ops) {
            return ops.reduce(function (memo, rhs) {
              return {
                type: rhs[0],
                left: memo,
                right: rhs[1]
              };
            }, a);
          },
          peg$c22 = "!",
          peg$c23 = peg$literalExpectation("!", false),
          peg$c24 = function peg$c24(subject, as) {
            var b = as.length === 1 ? as[0] : {
              type: 'compound',
              selectors: as
            };
            if (subject) b.subject = true;
            return b;
          },
          peg$c25 = "*",
          peg$c26 = peg$literalExpectation("*", false),
          peg$c27 = function peg$c27(a) {
            return {
              type: 'wildcard',
              value: a
            };
          },
          peg$c28 = "#",
          peg$c29 = peg$literalExpectation("#", false),
          peg$c30 = function peg$c30(i) {
            return {
              type: 'identifier',
              value: i
            };
          },
          peg$c31 = "[",
          peg$c32 = peg$literalExpectation("[", false),
          peg$c33 = "]",
          peg$c34 = peg$literalExpectation("]", false),
          peg$c35 = function peg$c35(v) {
            return v;
          },
          peg$c36 = /^[><!]/,
          peg$c37 = peg$classExpectation([">", "<", "!"], false, false),
          peg$c38 = "=",
          peg$c39 = peg$literalExpectation("=", false),
          peg$c40 = function peg$c40(a) {
            return (a || '') + '=';
          },
          peg$c41 = /^[><]/,
          peg$c42 = peg$classExpectation([">", "<"], false, false),
          peg$c43 = ".",
          peg$c44 = peg$literalExpectation(".", false),
          peg$c45 = function peg$c45(a, as) {
            return [].concat.apply([a], as).join('');
          },
          peg$c46 = function peg$c46(name, op, value) {
            return {
              type: 'attribute',
              name: name,
              operator: op,
              value: value
            };
          },
          peg$c47 = function peg$c47(name) {
            return {
              type: 'attribute',
              name: name
            };
          },
          peg$c48 = "\"",
          peg$c49 = peg$literalExpectation("\"", false),
          peg$c50 = /^[^\\"]/,
          peg$c51 = peg$classExpectation(["\\", "\""], true, false),
          peg$c52 = "\\",
          peg$c53 = peg$literalExpectation("\\", false),
          peg$c54 = peg$anyExpectation(),
          peg$c55 = function peg$c55(a, b) {
            return a + b;
          },
          peg$c56 = function peg$c56(d) {
            return {
              type: 'literal',
              value: strUnescape(d.join(''))
            };
          },
          peg$c57 = "'",
          peg$c58 = peg$literalExpectation("'", false),
          peg$c59 = /^[^\\']/,
          peg$c60 = peg$classExpectation(["\\", "'"], true, false),
          peg$c61 = /^[0-9]/,
          peg$c62 = peg$classExpectation([["0", "9"]], false, false),
          peg$c63 = function peg$c63(a, b) {
            // Can use `a.flat().join('')` once supported
            var leadingDecimals = a ? [].concat.apply([], a).join('') : '';
            return {
              type: 'literal',
              value: parseFloat(leadingDecimals + b.join(''))
            };
          },
          peg$c64 = function peg$c64(i) {
            return {
              type: 'literal',
              value: i
            };
          },
          peg$c65 = "type(",
          peg$c66 = peg$literalExpectation("type(", false),
          peg$c67 = /^[^ )]/,
          peg$c68 = peg$classExpectation([" ", ")"], true, false),
          peg$c69 = ")",
          peg$c70 = peg$literalExpectation(")", false),
          peg$c71 = function peg$c71(t) {
            return {
              type: 'type',
              value: t.join('')
            };
          },
          peg$c72 = /^[imsu]/,
          peg$c73 = peg$classExpectation(["i", "m", "s", "u"], false, false),
          peg$c74 = "/",
          peg$c75 = peg$literalExpectation("/", false),
          peg$c76 = function peg$c76(pattern, flgs) {
            return {
              type: 'regexp',
              value: new RegExp(pattern.join(''), flgs ? flgs.join('') : '')
            };
          },
          peg$c77 = /^[^\]\\]/,
          peg$c78 = peg$classExpectation(["]", "\\"], true, false),
          peg$c79 = function peg$c79(cs) {
            return '[' + cs.join('') + ']';
          },
          peg$c80 = function peg$c80(a) {
            return '\\' + a;
          },
          peg$c81 = /^[^\/\\[]/,
          peg$c82 = peg$classExpectation(["/", "\\", "["], true, false),
          peg$c83 = function peg$c83(cs) {
            return cs.join('');
          },
          peg$c84 = function peg$c84(i, is) {
            return {
              type: 'field',
              name: is.reduce(function (memo, p) {
                return memo + p[0] + p[1];
              }, i)
            };
          },
          peg$c85 = ":not(",
          peg$c86 = peg$literalExpectation(":not(", false),
          peg$c87 = function peg$c87(ss) {
            return {
              type: 'not',
              selectors: ss
            };
          },
          peg$c88 = ":matches(",
          peg$c89 = peg$literalExpectation(":matches(", false),
          peg$c90 = function peg$c90(ss) {
            return {
              type: 'matches',
              selectors: ss
            };
          },
          peg$c91 = ":is(",
          peg$c92 = peg$literalExpectation(":is(", false),
          peg$c93 = ":has(",
          peg$c94 = peg$literalExpectation(":has(", false),
          peg$c95 = function peg$c95(ss) {
            return {
              type: 'has',
              selectors: ss
            };
          },
          peg$c96 = ":first-child",
          peg$c97 = peg$literalExpectation(":first-child", false),
          peg$c98 = function peg$c98() {
            return nth(1);
          },
          peg$c99 = ":last-child",
          peg$c100 = peg$literalExpectation(":last-child", false),
          peg$c101 = function peg$c101() {
            return nthLast(1);
          },
          peg$c102 = ":nth-child(",
          peg$c103 = peg$literalExpectation(":nth-child(", false),
          peg$c104 = function peg$c104(n) {
            return nth(parseInt(n.join(''), 10));
          },
          peg$c105 = ":nth-last-child(",
          peg$c106 = peg$literalExpectation(":nth-last-child(", false),
          peg$c107 = function peg$c107(n) {
            return nthLast(parseInt(n.join(''), 10));
          },
          peg$c108 = ":",
          peg$c109 = peg$literalExpectation(":", false),
          peg$c110 = function peg$c110(c) {
            return {
              type: 'class',
              name: c
            };
          },
          peg$currPos = 0,
          peg$posDetailsCache = [{
            line: 1,
            column: 1
          }],
          peg$maxFailPos = 0,
          peg$maxFailExpected = [],
          peg$resultsCache = {},
          peg$result;
        if ("startRule" in options) {
          if (!(options.startRule in peg$startRuleFunctions)) {
            throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
          }
          peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
        }
        function peg$literalExpectation(text, ignoreCase) {
          return {
            type: "literal",
            text: text,
            ignoreCase: ignoreCase
          };
        }
        function peg$classExpectation(parts, inverted, ignoreCase) {
          return {
            type: "class",
            parts: parts,
            inverted: inverted,
            ignoreCase: ignoreCase
          };
        }
        function peg$anyExpectation() {
          return {
            type: "any"
          };
        }
        function peg$endExpectation() {
          return {
            type: "end"
          };
        }
        function peg$computePosDetails(pos) {
          var details = peg$posDetailsCache[pos],
            p;
          if (details) {
            return details;
          } else {
            p = pos - 1;
            while (!peg$posDetailsCache[p]) {
              p--;
            }
            details = peg$posDetailsCache[p];
            details = {
              line: details.line,
              column: details.column
            };
            while (p < pos) {
              if (input.charCodeAt(p) === 10) {
                details.line++;
                details.column = 1;
              } else {
                details.column++;
              }
              p++;
            }
            peg$posDetailsCache[pos] = details;
            return details;
          }
        }
        function peg$computeLocation(startPos, endPos) {
          var startPosDetails = peg$computePosDetails(startPos),
            endPosDetails = peg$computePosDetails(endPos);
          return {
            start: {
              offset: startPos,
              line: startPosDetails.line,
              column: startPosDetails.column
            },
            end: {
              offset: endPos,
              line: endPosDetails.line,
              column: endPosDetails.column
            }
          };
        }
        function peg$fail(expected) {
          if (peg$currPos < peg$maxFailPos) {
            return;
          }
          if (peg$currPos > peg$maxFailPos) {
            peg$maxFailPos = peg$currPos;
            peg$maxFailExpected = [];
          }
          peg$maxFailExpected.push(expected);
        }
        function peg$buildStructuredError(expected, found, location) {
          return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location);
        }
        function peg$parsestart() {
          var s0, s1, s2, s3;
          var key = peg$currPos * 36 + 0,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = peg$parse_();
          if (s1 !== peg$FAILED) {
            s2 = peg$parseselectors();
            if (s2 !== peg$FAILED) {
              s3 = peg$parse_();
              if (s3 !== peg$FAILED) {
                s1 = peg$c0(s2);
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          if (s0 === peg$FAILED) {
            s0 = peg$currPos;
            s1 = peg$parse_();
            if (s1 !== peg$FAILED) {
              s1 = peg$c1();
            }
            s0 = s1;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parse_() {
          var s0, s1;
          var key = peg$currPos * 36 + 1,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = [];
          if (input.charCodeAt(peg$currPos) === 32) {
            s1 = peg$c2;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c3);
            }
          }
          while (s1 !== peg$FAILED) {
            s0.push(s1);
            if (input.charCodeAt(peg$currPos) === 32) {
              s1 = peg$c2;
              peg$currPos++;
            } else {
              s1 = peg$FAILED;
              {
                peg$fail(peg$c3);
              }
            }
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseidentifierName() {
          var s0, s1, s2;
          var key = peg$currPos * 36 + 2,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = [];
          if (peg$c4.test(input.charAt(peg$currPos))) {
            s2 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s2 = peg$FAILED;
            {
              peg$fail(peg$c5);
            }
          }
          if (s2 !== peg$FAILED) {
            while (s2 !== peg$FAILED) {
              s1.push(s2);
              if (peg$c4.test(input.charAt(peg$currPos))) {
                s2 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s2 = peg$FAILED;
                {
                  peg$fail(peg$c5);
                }
              }
            }
          } else {
            s1 = peg$FAILED;
          }
          if (s1 !== peg$FAILED) {
            s1 = peg$c6(s1);
          }
          s0 = s1;
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsebinaryOp() {
          var s0, s1, s2, s3;
          var key = peg$currPos * 36 + 3,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = peg$parse_();
          if (s1 !== peg$FAILED) {
            if (input.charCodeAt(peg$currPos) === 62) {
              s2 = peg$c7;
              peg$currPos++;
            } else {
              s2 = peg$FAILED;
              {
                peg$fail(peg$c8);
              }
            }
            if (s2 !== peg$FAILED) {
              s3 = peg$parse_();
              if (s3 !== peg$FAILED) {
                s1 = peg$c9();
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          if (s0 === peg$FAILED) {
            s0 = peg$currPos;
            s1 = peg$parse_();
            if (s1 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 126) {
                s2 = peg$c10;
                peg$currPos++;
              } else {
                s2 = peg$FAILED;
                {
                  peg$fail(peg$c11);
                }
              }
              if (s2 !== peg$FAILED) {
                s3 = peg$parse_();
                if (s3 !== peg$FAILED) {
                  s1 = peg$c12();
                  s0 = s1;
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
            if (s0 === peg$FAILED) {
              s0 = peg$currPos;
              s1 = peg$parse_();
              if (s1 !== peg$FAILED) {
                if (input.charCodeAt(peg$currPos) === 43) {
                  s2 = peg$c13;
                  peg$currPos++;
                } else {
                  s2 = peg$FAILED;
                  {
                    peg$fail(peg$c14);
                  }
                }
                if (s2 !== peg$FAILED) {
                  s3 = peg$parse_();
                  if (s3 !== peg$FAILED) {
                    s1 = peg$c15();
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
              if (s0 === peg$FAILED) {
                s0 = peg$currPos;
                if (input.charCodeAt(peg$currPos) === 32) {
                  s1 = peg$c2;
                  peg$currPos++;
                } else {
                  s1 = peg$FAILED;
                  {
                    peg$fail(peg$c3);
                  }
                }
                if (s1 !== peg$FAILED) {
                  s2 = peg$parse_();
                  if (s2 !== peg$FAILED) {
                    s1 = peg$c16();
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              }
            }
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsehasSelectors() {
          var s0, s1, s2, s3, s4, s5, s6, s7;
          var key = peg$currPos * 36 + 4,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = peg$parsehasSelector();
          if (s1 !== peg$FAILED) {
            s2 = [];
            s3 = peg$currPos;
            s4 = peg$parse_();
            if (s4 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 44) {
                s5 = peg$c17;
                peg$currPos++;
              } else {
                s5 = peg$FAILED;
                {
                  peg$fail(peg$c18);
                }
              }
              if (s5 !== peg$FAILED) {
                s6 = peg$parse_();
                if (s6 !== peg$FAILED) {
                  s7 = peg$parsehasSelector();
                  if (s7 !== peg$FAILED) {
                    s4 = [s4, s5, s6, s7];
                    s3 = s4;
                  } else {
                    peg$currPos = s3;
                    s3 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
            while (s3 !== peg$FAILED) {
              s2.push(s3);
              s3 = peg$currPos;
              s4 = peg$parse_();
              if (s4 !== peg$FAILED) {
                if (input.charCodeAt(peg$currPos) === 44) {
                  s5 = peg$c17;
                  peg$currPos++;
                } else {
                  s5 = peg$FAILED;
                  {
                    peg$fail(peg$c18);
                  }
                }
                if (s5 !== peg$FAILED) {
                  s6 = peg$parse_();
                  if (s6 !== peg$FAILED) {
                    s7 = peg$parsehasSelector();
                    if (s7 !== peg$FAILED) {
                      s4 = [s4, s5, s6, s7];
                      s3 = s4;
                    } else {
                      peg$currPos = s3;
                      s3 = peg$FAILED;
                    }
                  } else {
                    peg$currPos = s3;
                    s3 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            }
            if (s2 !== peg$FAILED) {
              s1 = peg$c19(s1, s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseselectors() {
          var s0, s1, s2, s3, s4, s5, s6, s7;
          var key = peg$currPos * 36 + 5,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = peg$parseselector();
          if (s1 !== peg$FAILED) {
            s2 = [];
            s3 = peg$currPos;
            s4 = peg$parse_();
            if (s4 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 44) {
                s5 = peg$c17;
                peg$currPos++;
              } else {
                s5 = peg$FAILED;
                {
                  peg$fail(peg$c18);
                }
              }
              if (s5 !== peg$FAILED) {
                s6 = peg$parse_();
                if (s6 !== peg$FAILED) {
                  s7 = peg$parseselector();
                  if (s7 !== peg$FAILED) {
                    s4 = [s4, s5, s6, s7];
                    s3 = s4;
                  } else {
                    peg$currPos = s3;
                    s3 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
            while (s3 !== peg$FAILED) {
              s2.push(s3);
              s3 = peg$currPos;
              s4 = peg$parse_();
              if (s4 !== peg$FAILED) {
                if (input.charCodeAt(peg$currPos) === 44) {
                  s5 = peg$c17;
                  peg$currPos++;
                } else {
                  s5 = peg$FAILED;
                  {
                    peg$fail(peg$c18);
                  }
                }
                if (s5 !== peg$FAILED) {
                  s6 = peg$parse_();
                  if (s6 !== peg$FAILED) {
                    s7 = peg$parseselector();
                    if (s7 !== peg$FAILED) {
                      s4 = [s4, s5, s6, s7];
                      s3 = s4;
                    } else {
                      peg$currPos = s3;
                      s3 = peg$FAILED;
                    }
                  } else {
                    peg$currPos = s3;
                    s3 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            }
            if (s2 !== peg$FAILED) {
              s1 = peg$c19(s1, s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsehasSelector() {
          var s0, s1, s2;
          var key = peg$currPos * 36 + 6,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = peg$parsebinaryOp();
          if (s1 === peg$FAILED) {
            s1 = null;
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parseselector();
            if (s2 !== peg$FAILED) {
              s1 = peg$c20(s1, s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseselector() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 7,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = peg$parsesequence();
          if (s1 !== peg$FAILED) {
            s2 = [];
            s3 = peg$currPos;
            s4 = peg$parsebinaryOp();
            if (s4 !== peg$FAILED) {
              s5 = peg$parsesequence();
              if (s5 !== peg$FAILED) {
                s4 = [s4, s5];
                s3 = s4;
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
            while (s3 !== peg$FAILED) {
              s2.push(s3);
              s3 = peg$currPos;
              s4 = peg$parsebinaryOp();
              if (s4 !== peg$FAILED) {
                s5 = peg$parsesequence();
                if (s5 !== peg$FAILED) {
                  s4 = [s4, s5];
                  s3 = s4;
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            }
            if (s2 !== peg$FAILED) {
              s1 = peg$c21(s1, s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsesequence() {
          var s0, s1, s2, s3;
          var key = peg$currPos * 36 + 8,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 33) {
            s1 = peg$c22;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c23);
            }
          }
          if (s1 === peg$FAILED) {
            s1 = null;
          }
          if (s1 !== peg$FAILED) {
            s2 = [];
            s3 = peg$parseatom();
            if (s3 !== peg$FAILED) {
              while (s3 !== peg$FAILED) {
                s2.push(s3);
                s3 = peg$parseatom();
              }
            } else {
              s2 = peg$FAILED;
            }
            if (s2 !== peg$FAILED) {
              s1 = peg$c24(s1, s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseatom() {
          var s0;
          var key = peg$currPos * 36 + 9,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$parsewildcard();
          if (s0 === peg$FAILED) {
            s0 = peg$parseidentifier();
            if (s0 === peg$FAILED) {
              s0 = peg$parseattr();
              if (s0 === peg$FAILED) {
                s0 = peg$parsefield();
                if (s0 === peg$FAILED) {
                  s0 = peg$parsenegation();
                  if (s0 === peg$FAILED) {
                    s0 = peg$parsematches();
                    if (s0 === peg$FAILED) {
                      s0 = peg$parseis();
                      if (s0 === peg$FAILED) {
                        s0 = peg$parsehas();
                        if (s0 === peg$FAILED) {
                          s0 = peg$parsefirstChild();
                          if (s0 === peg$FAILED) {
                            s0 = peg$parselastChild();
                            if (s0 === peg$FAILED) {
                              s0 = peg$parsenthChild();
                              if (s0 === peg$FAILED) {
                                s0 = peg$parsenthLastChild();
                                if (s0 === peg$FAILED) {
                                  s0 = peg$parseclass();
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsewildcard() {
          var s0, s1;
          var key = peg$currPos * 36 + 10,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 42) {
            s1 = peg$c25;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c26);
            }
          }
          if (s1 !== peg$FAILED) {
            s1 = peg$c27(s1);
          }
          s0 = s1;
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseidentifier() {
          var s0, s1, s2;
          var key = peg$currPos * 36 + 11,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 35) {
            s1 = peg$c28;
            peg$currPos++;
          } else {
               s1 = peg$FAILED;
            {
              peg$fail(peg$c29);
            }
          }
          if (s1 === peg$FAILED) {
            s1 = null;
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parseidentifierName();
            if (s2 !== peg$FAILED) {
              s1 = peg$c30(s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseattr() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 12,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 91) {
            s1 = peg$c31;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c32);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parse_();
            if (s2 !== peg$FAILED) {
              s3 = peg$parseattrValue();
              if (s3 !== peg$FAILED) {
                s4 = peg$parse_();
                if (s4 !== peg$FAILED) {
                  if (input.charCodeAt(peg$currPos) === 93) {
                    s5 = peg$c33;
                    peg$currPos++;
                  } else {
                    s5 = peg$FAILED;
                    {
                      peg$fail(peg$c34);
                    }
                  }
                  if (s5 !== peg$FAILED) {
                    s1 = peg$c35(s3);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseattrOps() {
          var s0, s1, s2;
          var key = peg$currPos * 36 + 13,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (peg$c36.test(input.charAt(peg$currPos))) {
            s1 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c37);
            }
          }
          if (s1 === peg$FAILED) {
            s1 = null;
          }
          if (s1 !== peg$FAILED) {
            if (input.charCodeAt(peg$currPos) === 61) {
              s2 = peg$c38;
              peg$currPos++;
            } else {
              s2 = peg$FAILED;
              {
                peg$fail(peg$c39);
              }
            }
            if (s2 !== peg$FAILED) {
              s1 = peg$c40(s1);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          if (s0 === peg$FAILED) {
            if (peg$c41.test(input.charAt(peg$currPos))) {
              s0 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s0 = peg$FAILED;
              {
                peg$fail(peg$c42);
              }
            }
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseattrEqOps() {
          var s0, s1, s2;
          var key = peg$currPos * 36 + 14,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 33) {
            s1 = peg$c22;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c23);
            }
          }
          if (s1 === peg$FAILED) {
            s1 = null;
          }
          if (s1 !== peg$FAILED) {
            if (input.charCodeAt(peg$currPos) === 61) {
              s2 = peg$c38;
              peg$currPos++;
            } else {
              s2 = peg$FAILED;
              {
                peg$fail(peg$c39);
              }
            }
            if (s2 !== peg$FAILED) {
              s1 = peg$c40(s1);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseattrName() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 15,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = peg$parseidentifierName();
          if (s1 !== peg$FAILED) {
            s2 = [];
            s3 = peg$currPos;
            if (input.charCodeAt(peg$currPos) === 46) {
              s4 = peg$c43;
              peg$currPos++;
            } else {
              s4 = peg$FAILED;
              {
                peg$fail(peg$c44);
              }
            }
            if (s4 !== peg$FAILED) {
              s5 = peg$parseidentifierName();
              if (s5 !== peg$FAILED) {
                s4 = [s4, s5];
                s3 = s4;
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
            while (s3 !== peg$FAILED) {
              s2.push(s3);
              s3 = peg$currPos;
              if (input.charCodeAt(peg$currPos) === 46) {
                s4 = peg$c43;
                peg$currPos++;
              } else {
                s4 = peg$FAILED;
                {
                  peg$fail(peg$c44);
                }
              }
              if (s4 !== peg$FAILED) {
                s5 = peg$parseidentifierName();
                if (s5 !== peg$FAILED) {
                  s4 = [s4, s5];
                  s3 = s4;
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            }
            if (s2 !== peg$FAILED) {
              s1 = peg$c45(s1, s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseattrValue() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 16,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = peg$parseattrName();
          if (s1 !== peg$FAILED) {
            s2 = peg$parse_();
            if (s2 !== peg$FAILED) {
              s3 = peg$parseattrEqOps();
              if (s3 !== peg$FAILED) {
                s4 = peg$parse_();
                if (s4 !== peg$FAILED) {
                  s5 = peg$parsetype();
                  if (s5 === peg$FAILED) {
                    s5 = peg$parseregex();
                  }
                  if (s5 !== peg$FAILED) {
                    s1 = peg$c46(s1, s3, s5);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          if (s0 === peg$FAILED) {
            s0 = peg$currPos;
            s1 = peg$parseattrName();
            if (s1 !== peg$FAILED) {
              s2 = peg$parse_();
              if (s2 !== peg$FAILED) {
                s3 = peg$parseattrOps();
                if (s3 !== peg$FAILED) {
                  s4 = peg$parse_();
                  if (s4 !== peg$FAILED) {
                    s5 = peg$parsestring();
                    if (s5 === peg$FAILED) {
                      s5 = peg$parsenumber();
                      if (s5 === peg$FAILED) {
                        s5 = peg$parsepath();
                      }
                    }
                    if (s5 !== peg$FAILED) {
                      s1 = peg$c46(s1, s3, s5);
                      s0 = s1;
                    } else {
                      peg$currPos = s0;
                      s0 = peg$FAILED;
                    }
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
            if (s0 === peg$FAILED) {
              s0 = peg$currPos;
              s1 = peg$parseattrName();
              if (s1 !== peg$FAILED) {
                s1 = peg$c47(s1);
              }
              s0 = s1;
            }
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsestring() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 17,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 34) {
            s1 = peg$c48;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c49);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = [];
            if (peg$c50.test(input.charAt(peg$currPos))) {
              s3 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s3 = peg$FAILED;
              {
                peg$fail(peg$c51);
              }
            }
            if (s3 === peg$FAILED) {
              s3 = peg$currPos;
              if (input.charCodeAt(peg$currPos) === 92) {
                s4 = peg$c52;
                peg$currPos++;
              } else {
                s4 = peg$FAILED;
                {
                  peg$fail(peg$c53);
                }
              }
              if (s4 !== peg$FAILED) {
                if (input.length > peg$currPos) {
                  s5 = input.charAt(peg$currPos);
                  peg$currPos++;
                } else {
                  s5 = peg$FAILED;
                  {
                    peg$fail(peg$c54);
                  }
                }
                if (s5 !== peg$FAILED) {
                  s4 = peg$c55(s4, s5);
                  s3 = s4;
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            }
            while (s3 !== peg$FAILED) {
              s2.push(s3);
              if (peg$c50.test(input.charAt(peg$currPos))) {
                s3 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s3 = peg$FAILED;
                {
                  peg$fail(peg$c51);
                }
              }
              if (s3 === peg$FAILED) {
                s3 = peg$currPos;
                if (input.charCodeAt(peg$currPos) === 92) {
                  s4 = peg$c52;
                  peg$currPos++;
                } else {
                  s4 = peg$FAILED;
                  {
                    peg$fail(peg$c53);
                  }
                }
                if (s4 !== peg$FAILED) {
                  if (input.length > peg$currPos) {
                    s5 = input.charAt(peg$currPos);
                    peg$currPos++;
                  } else {
                    s5 = peg$FAILED;
                    {
                      peg$fail(peg$c54);
                    }
                  }
                  if (s5 !== peg$FAILED) {
                    s4 = peg$c55(s4, s5);
                    s3 = s4;
                  } else {
                    peg$currPos = s3;
                    s3 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              }
            }
            if (s2 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 34) {
                s3 = peg$c48;
                peg$currPos++;
              } else {
                s3 = peg$FAILED;
                {
                  peg$fail(peg$c49);
                }
              }
              if (s3 !== peg$FAILED) {
                s1 = peg$c56(s2);
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          if (s0 === peg$FAILED) {
            s0 = peg$currPos;
            if (input.charCodeAt(peg$currPos) === 39) {
              s1 = peg$c57;
              peg$currPos++;
            } else {
              s1 = peg$FAILED;
              {
                peg$fail(peg$c58);
              }
            }
            if (s1 !== peg$FAILED) {
              s2 = [];
              if (peg$c59.test(input.charAt(peg$currPos))) {
                s3 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s3 = peg$FAILED;
                {
                  peg$fail(peg$c60);
                }
              }
              if (s3 === peg$FAILED) {
                s3 = peg$currPos;
                if (input.charCodeAt(peg$currPos) === 92) {
                  s4 = peg$c52;
                  peg$currPos++;
                } else {
                  s4 = peg$FAILED;
                  {
                    peg$fail(peg$c53);
                  }
                }
                if (s4 !== peg$FAILED) {
                  if (input.length > peg$currPos) {
                    s5 = input.charAt(peg$currPos);
                    peg$currPos++;
                  } else {
                    s5 = peg$FAILED;
                    {
                      peg$fail(peg$c54);
                    }
                  }
                  if (s5 !== peg$FAILED) {
                    s4 = peg$c55(s4, s5);
                    s3 = s4;
                  } else {
                    peg$currPos = s3;
                    s3 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              }
              while (s3 !== peg$FAILED) {
                s2.push(s3);
                if (peg$c59.test(input.charAt(peg$currPos))) {
                  s3 = input.charAt(peg$currPos);
                  peg$currPos++;
                } else {
                  s3 = peg$FAILED;
                  {
                    peg$fail(peg$c60);
                  }
                }
                if (s3 === peg$FAILED) {
                  s3 = peg$currPos;
                  if (input.charCodeAt(peg$currPos) === 92) {
                    s4 = peg$c52;
                    peg$currPos++;
                  } else {
                    s4 = peg$FAILED;
                    {
                      peg$fail(peg$c53);
                    }
                  }
                  if (s4 !== peg$FAILED) {
                    if (input.length > peg$currPos) {
                      s5 = input.charAt(peg$currPos);
                      peg$currPos++;
                    } else {
                      s5 = peg$FAILED;
                      {
                        peg$fail(peg$c54);
                      }
                    }
                    if (s5 !== peg$FAILED) {
                      s4 = peg$c55(s4, s5);
                      s3 = s4;
                    } else {
                      peg$currPos = s3;
                      s3 = peg$FAILED;
                    }
                  } else {
                    peg$currPos = s3;
                    s3 = peg$FAILED;
                  }
                }
              }
              if (s2 !== peg$FAILED) {
                if (input.charCodeAt(peg$currPos) === 39) {
                  s3 = peg$c57;
                  peg$currPos++;
                } else {
                  s3 = peg$FAILED;
                  {
                    peg$fail(peg$c58);
                  }
                }
                if (s3 !== peg$FAILED) {
                  s1 = peg$c56(s2);
                  s0 = s1;
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsenumber() {
          var s0, s1, s2, s3;
          var key = peg$currPos * 36 + 18,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = peg$currPos;
          s2 = [];
          if (peg$c61.test(input.charAt(peg$currPos))) {
            s3 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s3 = peg$FAILED;
            {
              peg$fail(peg$c62);
            }
          }
          while (s3 !== peg$FAILED) {
            s2.push(s3);
            if (peg$c61.test(input.charAt(peg$currPos))) {
              s3 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s3 = peg$FAILED;
              {
                peg$fail(peg$c62);
              }
            }
          }
          if (s2 !== peg$FAILED) {
            if (input.charCodeAt(peg$currPos) === 46) {
              s3 = peg$c43;
              peg$currPos++;
            } else {
              s3 = peg$FAILED;
              {
                peg$fail(peg$c44);
              }
            }
            if (s3 !== peg$FAILED) {
              s2 = [s2, s3];
              s1 = s2;
            } else {
              peg$currPos = s1;
              s1 = peg$FAILED;
            }
          } else {
            peg$currPos = s1;
            s1 = peg$FAILED;
          }
          if (s1 === peg$FAILED) {
            s1 = null;
          }
          if (s1 !== peg$FAILED) {
            s2 = [];
            if (peg$c61.test(input.charAt(peg$currPos))) {
              s3 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s3 = peg$FAILED;
              {
                peg$fail(peg$c62);
              }
            }
            if (s3 !== peg$FAILED) {
              while (s3 !== peg$FAILED) {
                s2.push(s3);
                if (peg$c61.test(input.charAt(peg$currPos))) {
                  s3 = input.charAt(peg$currPos);
                  peg$currPos++;
                } else {
                  s3 = peg$FAILED;
                  {
                    peg$fail(peg$c62);
                  }
                }
              }
            } else {
              s2 = peg$FAILED;
            }
            if (s2 !== peg$FAILED) {
              s1 = peg$c63(s1, s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsepath() {
          var s0, s1;
          var key = peg$currPos * 36 + 19,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = peg$parseidentifierName();
          if (s1 !== peg$FAILED) {
            s1 = peg$c64(s1);
          }
          s0 = s1;
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsetype() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 20,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.substr(peg$currPos, 5) === peg$c65) {
            s1 = peg$c65;
            peg$currPos += 5;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c66);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parse_();
            if (s2 !== peg$FAILED) {
              s3 = [];
              if (peg$c67.test(input.charAt(peg$currPos))) {
                s4 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s4 = peg$FAILED;
                {
                  peg$fail(peg$c68);
                }
              }
              if (s4 !== peg$FAILED) {
                while (s4 !== peg$FAILED) {
                  s3.push(s4);
                  if (peg$c67.test(input.charAt(peg$currPos))) {
                    s4 = input.charAt(peg$currPos);
                    peg$currPos++;
                  } else {
                    s4 = peg$FAILED;
                    {
                      peg$fail(peg$c68);
                    }
                  }
                }
              } else {
                s3 = peg$FAILED;
              }
              if (s3 !== peg$FAILED) {
                s4 = peg$parse_();
                if (s4 !== peg$FAILED) {
                  if (input.charCodeAt(peg$currPos) === 41) {
                    s5 = peg$c69;
                    peg$currPos++;
                  } else {
                    s5 = peg$FAILED;
                    {
                      peg$fail(peg$c70);
                    }
                  }
                  if (s5 !== peg$FAILED) {
                    s1 = peg$c71(s3);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseflags() {
          var s0, s1;
          var key = peg$currPos * 36 + 21,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = [];
          if (peg$c72.test(input.charAt(peg$currPos))) {
            s1 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c73);
            }
          }
          if (s1 !== peg$FAILED) {
            while (s1 !== peg$FAILED) {
              s0.push(s1);
              if (peg$c72.test(input.charAt(peg$currPos))) {
                s1 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s1 = peg$FAILED;
                {
                  peg$fail(peg$c73);
                }
              }
            }
          } else {
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseregex() {
          var s0, s1, s2, s3, s4;
          var key = peg$currPos * 36 + 22,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 47) {
            s1 = peg$c74;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c75);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = [];
            s3 = peg$parsere_character_class();
            if (s3 === peg$FAILED) {
              s3 = peg$parsere_escape();
              if (s3 === peg$FAILED) {
                s3 = peg$parsere_chars();
              }
            }
            if (s3 !== peg$FAILED) {
              while (s3 !== peg$FAILED) {
                s2.push(s3);
                s3 = peg$parsere_character_class();
                if (s3 === peg$FAILED) {
                  s3 = peg$parsere_escape();
                  if (s3 === peg$FAILED) {
                    s3 = peg$parsere_chars();
                  }
                }
              }
            } else {
              s2 = peg$FAILED;
            }
            if (s2 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 47) {
                s3 = peg$c74;
                peg$currPos++;
              } else {
                s3 = peg$FAILED;
                {
                  peg$fail(peg$c75);
                }
              }
              if (s3 !== peg$FAILED) {
                s4 = peg$parseflags();
                if (s4 === peg$FAILED) {
                  s4 = null;
                }
                if (s4 !== peg$FAILED) {
                  s1 = peg$c76(s2, s4);
                  s0 = s1;
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsere_character_class() {
          var s0, s1, s2, s3;
          var key = peg$currPos * 36 + 23,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 91) {
            s1 = peg$c31;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c32);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = [];
            if (peg$c77.test(input.charAt(peg$currPos))) {
              s3 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s3 = peg$FAILED;
              {
                peg$fail(peg$c78);
              }
            }
            if (s3 === peg$FAILED) {
              s3 = peg$parsere_escape();
            }
            if (s3 !== peg$FAILED) {
              while (s3 !== peg$FAILED) {
                s2.push(s3);
                if (peg$c77.test(input.charAt(peg$currPos))) {
                  s3 = input.charAt(peg$currPos);
                  peg$currPos++;
                } else {
                  s3 = peg$FAILED;
                  {
                    peg$fail(peg$c78);
                  }
                }
                if (s3 === peg$FAILED) {
                  s3 = peg$parsere_escape();
                }
              }
            } else {
              s2 = peg$FAILED;
            }
            if (s2 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 93) {
                s3 = peg$c33;
                peg$currPos++;
              } else {
                s3 = peg$FAILED;
                {
                  peg$fail(peg$c34);
                }
              }
              if (s3 !== peg$FAILED) {
                s1 = peg$c79(s2);
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsere_escape() {
          var s0, s1, s2;
          var key = peg$currPos * 36 + 24,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 92) {
            s1 = peg$c52;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c53);
            }
          }
          if (s1 !== peg$FAILED) {
            if (input.length > peg$currPos) {
              s2 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s2 = peg$FAILED;
              {
                peg$fail(peg$c54);
              }
            }
            if (s2 !== peg$FAILED) {
              s1 = peg$c80(s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsere_chars() {
          var s0, s1, s2;
          var key = peg$currPos * 36 + 25,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = [];
          if (peg$c81.test(input.charAt(peg$currPos))) {
            s2 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s2 = peg$FAILED;
            {
              peg$fail(peg$c82);
            }
          }
          if (s2 !== peg$FAILED) {
            while (s2 !== peg$FAILED) {
              s1.push(s2);
              if (peg$c81.test(input.charAt(peg$currPos))) {
                s2 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s2 = peg$FAILED;
                {
                  peg$fail(peg$c82);
                }
              }
            }
          } else {
            s1 = peg$FAILED;
          }
          if (s1 !== peg$FAILED) {
            s1 = peg$c83(s1);
          }
          s0 = s1;
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsefield() {
          var s0, s1, s2, s3, s4, s5, s6;
          var key = peg$currPos * 36 + 26,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 46) {
            s1 = peg$c43;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c44);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parseidentifierName();
            if (s2 !== peg$FAILED) {
              s3 = [];
              s4 = peg$currPos;
              if (input.charCodeAt(peg$currPos) === 46) {
                s5 = peg$c43;
                peg$currPos++;
              } else {
                s5 = peg$FAILED;
                {
                  peg$fail(peg$c44);
                }
              }
              if (s5 !== peg$FAILED) {
                s6 = peg$parseidentifierName();
                if (s6 !== peg$FAILED) {
                  s5 = [s5, s6];
                  s4 = s5;
                } else {
                  peg$currPos = s4;
                  s4 = peg$FAILED;
                }
              } else {
                peg$currPos = s4;
                s4 = peg$FAILED;
              }
              while (s4 !== peg$FAILED) {
                s3.push(s4);
                s4 = peg$currPos;
                if (input.charCodeAt(peg$currPos) === 46) {
                  s5 = peg$c43;
                  peg$currPos++;
                } else {
                  s5 = peg$FAILED;
                  {
                    peg$fail(peg$c44);
                  }
                }
                if (s5 !== peg$FAILED) {
                  s6 = peg$parseidentifierName();
                  if (s6 !== peg$FAILED) {
                    s5 = [s5, s6];
                    s4 = s5;
                  } else {
                    peg$currPos = s4;
                    s4 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s4;
                  s4 = peg$FAILED;
                }
              }
              if (s3 !== peg$FAILED) {
                s1 = peg$c84(s2, s3);
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsenegation() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 27,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.substr(peg$currPos, 5) === peg$c85) {
            s1 = peg$c85;
            peg$currPos += 5;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c86);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parse_();
            if (s2 !== peg$FAILED) {
              s3 = peg$parseselectors();
              if (s3 !== peg$FAILED) {
                s4 = peg$parse_();
                if (s4 !== peg$FAILED) {
                  if (input.charCodeAt(peg$currPos) === 41) {
                    s5 = peg$c69;
                    peg$currPos++;
                  } else {
                    s5 = peg$FAILED;
                    {
                      peg$fail(peg$c70);
                    }
                  }
                  if (s5 !== peg$FAILED) {
                    s1 = peg$c87(s3);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsematches() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 28,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.substr(peg$currPos, 9) === peg$c88) {
            s1 = peg$c88;
            peg$currPos += 9;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c89);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parse_();
            if (s2 !== peg$FAILED) {
              s3 = peg$parseselectors();
              if (s3 !== peg$FAILED) {
                s4 = peg$parse_();
                if (s4 !== peg$FAILED) {
                  if (input.charCodeAt(peg$currPos) === 41) {
                    s5 = peg$c69;
                    peg$currPos++;
                  } else {
                    s5 = peg$FAILED;
                    {
                      peg$fail(peg$c70);
                    }
                  }
                  if (s5 !== peg$FAILED) {
                    s1 = peg$c90(s3);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseis() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 29,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.substr(peg$currPos, 4) === peg$c91) {
            s1 = peg$c91;
            peg$currPos += 4;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c92);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parse_();
            if (s2 !== peg$FAILED) {
              s3 = peg$parseselectors();
              if (s3 !== peg$FAILED) {
                s4 = peg$parse_();
                if (s4 !== peg$FAILED) {
                  if (input.charCodeAt(peg$currPos) === 41) {
                    s5 = peg$c69;
                    peg$currPos++;
                  } else {
                    s5 = peg$FAILED;
                    {
                      peg$fail(peg$c70);
                    }
                  }
                  if (s5 !== peg$FAILED) {
                    s1 = peg$c90(s3);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsehas() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 30,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.substr(peg$currPos, 5) === peg$c93) {
            s1 = peg$c93;
            peg$currPos += 5;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c94);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parse_();
            if (s2 !== peg$FAILED) {
              s3 = peg$parsehasSelectors();
              if (s3 !== peg$FAILED) {
                s4 = peg$parse_();
                if (s4 !== peg$FAILED) {
                  if (input.charCodeAt(peg$currPos) === 41) {
                    s5 = peg$c69;
                    peg$currPos++;
                  } else {
                    s5 = peg$FAILED;
                    {
                      peg$fail(peg$c70);
                    }
                  }
                  if (s5 !== peg$FAILED) {
                    s1 = peg$c95(s3);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsefirstChild() {
          var s0, s1;
          var key = peg$currPos * 36 + 31,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.substr(peg$currPos, 12) === peg$c96) {
            s1 = peg$c96;
            peg$currPos += 12;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c97);
            }
          }
          if (s1 !== peg$FAILED) {
            s1 = peg$c98();
          }
          s0 = s1;
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parselastChild() {
          var s0, s1;
          var key = peg$currPos * 36 + 32,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.substr(peg$currPos, 11) === peg$c99) {
            s1 = peg$c99;
            peg$currPos += 11;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c100);
            }
          }
          if (s1 !== peg$FAILED) {
            s1 = peg$c101();
          }
          s0 = s1;
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsenthChild() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 33,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.substr(peg$currPos, 11) === peg$c102) {
            s1 = peg$c102;
            peg$currPos += 11;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c103);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parse_();
            if (s2 !== peg$FAILED) {
              s3 = [];
              if (peg$c61.test(input.charAt(peg$currPos))) {
                s4 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s4 = peg$FAILED;
                {
                  peg$fail(peg$c62);
                }
              }
              if (s4 !== peg$FAILED) {
                while (s4 !== peg$FAILED) {
                  s3.push(s4);
                  if (peg$c61.test(input.charAt(peg$currPos))) {
                    s4 = input.charAt(peg$currPos);
                    peg$currPos++;
                  } else {
                    s4 = peg$FAILED;
                    {
                      peg$fail(peg$c62);
                    }
                  }
                }
              } else {
                s3 = peg$FAILED;
              }
              if (s3 !== peg$FAILED) {
                s4 = peg$parse_();
                if (s4 !== peg$FAILED) {
                  if (input.charCodeAt(peg$currPos) === 41) {
                    s5 = peg$c69;
                    peg$currPos++;
                  } else {
                    s5 = peg$FAILED;
                    {
                      peg$fail(peg$c70);
                    }
                  }
                  if (s5 !== peg$FAILED) {
                    s1 = peg$c104(s3);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsenthLastChild() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 34,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.substr(peg$currPos, 16) === peg$c105) {
            s1 = peg$c105;
            peg$currPos += 16;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c106);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parse_();
            if (s2 !== peg$FAILED) {
              s3 = [];
              if (peg$c61.test(input.charAt(peg$currPos))) {
                s4 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s4 = peg$FAILED;
                {
                  peg$fail(peg$c62);
                }
              }
              if (s4 !== peg$FAILED) {
                while (s4 !== peg$FAILED) {
                  s3.push(s4);
                  if (peg$c61.test(input.charAt(peg$currPos))) {
                    s4 = input.charAt(peg$currPos);
                    peg$currPos++;
                  } else {
                    s4 = peg$FAILED;
                    {
                      peg$fail(peg$c62);
                    }
                  }
                }
              } else {
                s3 = peg$FAILED;
              }
              if (s3 !== peg$FAILED) {
                s4 = peg$parse_();
                if (s4 !== peg$FAILED) {
                  if (input.charCodeAt(peg$currPos) === 41) {
                    s5 = peg$c69;
                    peg$currPos++;
                  } else {
                    s5 = peg$FAILED;
                    {
                      peg$fail(peg$c70);
                    }
                  }
                  if (s5 !== peg$FAILED) {
                    s1 = peg$c107(s3);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseclass() {
          var s0, s1, s2;
          var key = peg$currPos * 36 + 35,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 58) {
            s1 = peg$c108;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c109);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parseidentifierName();
            if (s2 !== peg$FAILED) {
              s1 = peg$c110(s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function nth(n) {
          return {
            type: 'nth-child',
            index: {
              type: 'literal',
              value: n
            }
          };
        }
        function nthLast(n) {
          return {
            type: 'nth-last-child',
            index: {
              type: 'literal',
              value: n
            }
          };
        }
        function strUnescape(s) {
          return s.replace(/\\(.)/g, function (match, ch) {
            switch (ch) {
              case 'b':
                return '\b';
              case 'f':
                return '\f';
              case 'n':
                return '\n';
              case 'r':
                return '\r';
              case 't':
                return '\t';
              case 'v':
                return '\v';
              default:
                return ch;
            }
          });
        }
        peg$result = peg$startRuleFunction();
        if (peg$result !== peg$FAILED && peg$currPos === input.length) {
          return peg$result;
        } else {
          if (peg$result !== peg$FAILED && peg$currPos < input.length) {
            peg$fail(peg$endExpectation());
          }
          throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
        }
      }
      return {
        SyntaxError: peg$SyntaxError,
        parse: peg$parse
      };
    });
  });

  /**
  * @typedef {"LEFT_SIDE"|"RIGHT_SIDE"} Side
  */

  var LEFT_SIDE = 'LEFT_SIDE';
  var RIGHT_SIDE = 'RIGHT_SIDE';

  /**
   * @external AST
   * @see https://esprima.readthedocs.io/en/latest/syntax-tree-format.html
   */

  /**
   * One of the rules of `grammar.pegjs`
   * @typedef {PlainObject} SelectorAST
   * @see grammar.pegjs
  */

  /**
   * The `sequence` production of `grammar.pegjs`
   * @typedef {PlainObject} SelectorSequenceAST
  */

  /**
   * Get the value of a property which may be multiple levels down
   * in the object.
   * @param {?PlainObject} obj
   * @param {string[]} keys
   * @returns {undefined|boolean|string|number|external:AST}
   */
  function getPath(obj, keys) {
    for (var i = 0; i < keys.length; ++i) {
      if (obj == null) {
        return obj;
      }
      obj = obj[keys[i]];
    }
    return obj;
  }

  /**
   * Determine whether `node` can be reached by following `path`,
   * starting at `ancestor`.
   * @param {?external:AST} node
   * @param {?external:AST} ancestor
   * @param {string[]} path
   * @param {Integer} fromPathIndex
   * @returns {boolean}
   */
  function inPath(node, ancestor, path, fromPathIndex) {
    var current = ancestor;
    for (var i = fromPathIndex; i < path.length; ++i) {
      if (current == null) {
        return false;
      }
      var field = current[path[i]];
      if (Array.isArray(field)) {
        for (var k = 0; k < field.length; ++k) {
          if (inPath(node, field[k], path, i + 1)) {
            return true;
          }
        }
        return false;
      }
      current = field;
    }
    return node === current;
  }

  /**
   * A generated matcher function for a selector.
   * @callback SelectorMatcher
   * @param {?SelectorAST} selector
   * @param {external:AST[]} [ancestry=[]]
   * @param {ESQueryOptions} [options]
   * @returns {void}
  */

  /**
   * A WeakMap for holding cached matcher functions for selectors.
   * @type {WeakMap<SelectorAST, SelectorMatcher>}
  */
  var MATCHER_CACHE = typeof WeakMap === 'function' ? new WeakMap() : null;

  /**
   * Look up a matcher function for `selector` in the cache.
   * If it does not exist, generate it with `generateMatcher` and add it to the cache.
   * In engines without WeakMap, the caching is skipped and matchers are generated with every call.
   * @param {?SelectorAST} selector
   * @returns {SelectorMatcher}
   */
  function getMatcher(selector) {
    if (selector == null) {
      return function () {
        return true;
      };
    }
    if (MATCHER_CACHE != null) {
      var matcher = MATCHER_CACHE.get(selector);
      if (matcher != null) {
        return matcher;
      }
      matcher = generateMatcher(selector);
      MATCHER_CACHE.set(selector, matcher);
      return matcher;
    }
    return generateMatcher(selector);
  }

  /**
   * Create a matcher function for `selector`,
   * @param {?SelectorAST} selector
   * @returns {SelectorMatcher}
   */
  function generateMatcher(selector) {
    switch (selector.type) {
      case 'wildcard':
        return function () {
          return true;
        };
      case 'identifier':
        {
          var value = selector.value.toLowerCase();
          return function (node, ancestry, options) {
            var nodeTypeKey = options && options.nodeTypeKey || 'type';
            return value === node[nodeTypeKey].toLowerCase();
          };
        }
      case 'exactNode':
        return function (node, ancestry) {
          return ancestry.length === 0;
        };
      case 'field':
        {
          var path = selector.name.split('.');
          return function (node, ancestry) {
            var ancestor = ancestry[path.length - 1];
            return inPath(node, ancestor, path, 0);
          };
        }
      case 'matches':
        {
          var matchers = selector.selectors.map(getMatcher);
          return function (node, ancestry, options) {
            for (var i = 0; i < matchers.length; ++i) {
              if (matchers[i](node, ancestry, options)) {
                return true;
              }
            }
            return false;
          };
        }
      case 'compound':
        {
          var _matchers = selector.selectors.map(getMatcher);
          return function (node, ancestry, options) {
            for (var i = 0; i < _matchers.length; ++i) {
              if (!_matchers[i](node, ancestry, options)) {
                return false;
              }
            }
            return true;
          };
        }
      case 'not':
        {
          var _matchers2 = selector.selectors.map(getMatcher);
          return function (node, ancestry, options) {
            for (var i = 0; i < _matchers2.length; ++i) {
              if (_matchers2[i](node, ancestry, options)) {
                return false;
              }
            }
            return true;
          };
        }
      case 'has':
        {
          var _matchers3 = selector.selectors.map(getMatcher);
          return function (node, ancestry, options) {
            var result = false;
            var a = [];
            estraverse.traverse(node, {
              enter: function enter(node, parent) {
                if (parent != null) {
                  a.unshift(parent);
                }
                for (var i = 0; i < _matchers3.length; ++i) {
                  if (_matchers3[i](node, a, options)) {
                    result = true;
                    this["break"]();
                    return;
                  }
                }
              },
              leave: function leave() {
                a.shift();
              },
              keys: options && options.visitorKeys,
              fallback: options && options.fallback || 'iteration'
            });
            return result;
          };
        }
      case 'child':
        {
          var left = getMatcher(selector.left);
          var right = getMatcher(selector.right);
          return function (node, ancestry, options) {
            if (ancestry.length > 0 && right(node, ancestry, options)) {
              return left(ancestry[0], ancestry.slice(1), options);
            }
            return false;
          };
        }
      case 'descendant':
        {
          var _left = getMatcher(selector.left);
          var _right = getMatcher(selector.right);
          return function (node, ancestry, options) {
            if (_right(node, ancestry, options)) {
              for (var i = 0, l = ancestry.length; i < l; ++i) {
                if (_left(ancestry[i], ancestry.slice(i + 1), options)) {
                  return true;
                }
              }
            }
            return false;
          };
        }
      case 'attribute':
        {
          var _path = selector.name.split('.');
          switch (selector.operator) {
            case void 0:
              return function (node) {
                return getPath(node, _path) != null;
              };
            case '=':
              switch (selector.value.type) {
                case 'regexp':
                  return function (node) {
                    var p = getPath(node, _path);
                    return typeof p === 'string' && selector.value.value.test(p);
                  };
                case 'literal':
                  {
                    var literal = "".concat(selector.value.value);
                    return function (node) {
                      return literal === "".concat(getPath(node, _path));
                    };
                  }
                case 'type':
                  return function (node) {
                    return selector.value.value === _typeof(getPath(node, _path));
                  };
              }
              throw new Error("Unknown selector value type: ".concat(selector.value.type));
            case '!=':
              switch (selector.value.type) {
                case 'regexp':
                  return function (node) {
                    return !selector.value.value.test(getPath(node, _path));
                  };
                case 'literal':
                  {
                    var _literal = "".concat(selector.value.value);
                    return function (node) {
                      return _literal !== "".concat(getPath(node, _path));
                    };
                  }
                case 'type':
                  return function (node) {
                    return selector.value.value !== _typeof(getPath(node, _path));
                  };
              }
              throw new Error("Unknown selector value type: ".concat(selector.value.type));
            case '<=':
              return function (node) {
                return getPath(node, _path) <= selector.value.value;
              };
            case '<':
              return function (node) {
                return getPath(node, _path) < selector.value.value;
              };
            case '>':
              return function (node) {
                return getPath(node, _path) > selector.value.value;
              };
            case '>=':
              return function (node) {
                return getPath(node, _path) >= selector.value.value;
              };
          }
          throw new Error("Unknown operator: ".concat(selector.operator));
        }
      case 'sibling':
        {
          var _left2 = getMatcher(selector.left);
          var _right2 = getMatcher(selector.right);
          return function (node, ancestry, options) {
            return _right2(node, ancestry, options) && sibling(node, _left2, ancestry, LEFT_SIDE, options) || selector.left.subject && _left2(node, ancestry, options) && sibling(node, _right2, ancestry, RIGHT_SIDE, options);
          };
        }
      case 'adjacent':
        {
          var _left3 = getMatcher(selector.left);
          var _right3 = getMatcher(selector.right);
          return function (node, ancestry, options) {
            return _right3(node, ancestry, options) && adjacent(node, _left3, ancestry, LEFT_SIDE, options) || selector.right.subject && _left3(node, ancestry, options) && adjacent(node, _right3, ancestry, RIGHT_SIDE, options);
          };
        }
      case 'nth-child':
        {
          var nth = selector.index.value;
          var _right4 = getMatcher(selector.right);
          return function (node, ancestry, options) {
            return _right4(node, ancestry, options) && nthChild(node, ancestry, nth, options);
          };
        }
      case 'nth-last-child':
        {
          var _nth = -selector.index.value;
          var _right5 = getMatcher(selector.right);
          return function (node, ancestry, options) {
            return _right5(node, ancestry, options) && nthChild(node, ancestry, _nth, options);
          };
        }
      case 'class':
        {
          var name = selector.name.toLowerCase();
          return function (node, ancestry, options) {
            if (options && options.matchClass) {
              return options.matchClass(selector.name, node, ancestry);
            }
            if (options && options.nodeTypeKey) return false;
            switch (name) {
              case 'statement':
                if (node.type.slice(-9) === 'Statement') return true;
              // fallthrough: interface Declaration <: Statement { }
              case 'declaration':
                return node.type.slice(-11) === 'Declaration';
              case 'pattern':
                if (node.type.slice(-7) === 'Pattern') return true;
              // fallthrough: interface Expression <: Node, Pattern { }
              case 'expression':
                return node.type.slice(-10) === 'Expression' || node.type.slice(-7) === 'Literal' || node.type === 'Identifier' && (ancestry.length === 0 || ancestry[0].type !== 'MetaProperty') || node.type === 'MetaProperty';
              case 'function':
                return node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression';
            }
            throw new Error("Unknown class name: ".concat(selector.name));
          };
        }
    }
    throw new Error("Unknown selector type: ".concat(selector.type));
  }

  /**
   * @callback TraverseOptionFallback
   * @param {external:AST} node The given node.
   * @returns {string[]} An array of visitor keys for the given node.
   */

  /**
   * @callback ClassMatcher
   * @param {string} className The name of thH%e class to match.
   * @param {external:AST} node The node to match against.
   * @param {Array<external:AST>} ancestry The ancestry of the node.
   * @returns {boolean} True if the node matches the class, false if not.
   */

  /**
   * @typedef {object} ESQueryOptions
   * @property {string} [nodeTypeKey="type"] By passing `nodeTypeKey`, we can allow other ASTs to use ESQuery.
   * @property { { [nodeType: string]: string[] } } [visitorKeys] By passing `visitorKeys` mapping, we can extend the properties of the nodes that traverse the node.
   * @property {TraverseOptionFallback} [fallback] By passing `fallback` option, we can control the properties of traversing nodes when encountering unknown nodes.
   * @property {ClassMatcher} [matchClass] By passing `matchClass` option, we can customize the interpretation of classes.
   */

  /**
   * Given a `node` and its ancestors, determine if `node` is matched
   * by `selector`.
   * @param {?external:AST} node
   * @param {?SelectorAST} selector
   * @param {external:AST[]} [ancestry=[]]
   * @param {ESQueryOptions} [options]
   * @throws {Error} Unknowns (operator, class name, selector type, or
   * selector value type)
   * @returns {boolean}
   */
  function matches(node, selector, ancestry, options) {
    if (!selector) {
      return true;
    }
    if (!node) {
      return false;
    }
    if (!ancestry) {
      ancestry = [];
    }
    return getMatcher(selector)(node, ancestry, options);
  }

  /**
   * Get visitor keys of a given node.
   * @param {external:AST} node The AST node to get keys.
   * @param {ESQueryOptions|undefined} options
   * @returns {string[]} Visitor keys of the node.
   */
  function getVisitorKeys(node, options) {
    var nodeTypeKey = options && options.nodeTypeKey || 'type';
    var nodeType = node[nodeTypeKey];
    if (options && options.visitorKeys && options.visitorKeys[nodeType]) {
      return options.visitorKeys[nodeType];
    }
    if (estraverse.VisitorKeys[nodeType]) {
      return estraverse.VisitorKeys[nodeType];
    }
    if (options && typeof options.fallback === 'function') {
      return options.fallback(node);
    }
    // 'iteration' fallback
    return Object.keys(node).filter(function (key) {
      return key !== nodeTypeKey;
    });
  }

  /**
   * Check whether the given value is an ASTNode or not.
   * @param {any} node The value to check.
   * @param {ESQueryOptions|undefined} options The options to use.
   * @returns {boolean} `true` if the value is an ASTNode.
   */
  function isNode(node, options) {
    var nodeTypeKey = options && options.nodeTypeKey || 'type';
    return node !== null && _typeof(node) === 'object' && typeof node[nodeTypeKey] === 'string';
  }

  /**
   * Determines if the given node has a sibling that matches the
   * given selector matcher.
   * @param {external:AST} node
   * @param {SelectorMatcher} matcher
   * @param {external:AST[]} ancestry
   * @param {Side} side
   * @param {ESQueryOptions|undefined} options
   * @returns {boolean}
   */
  function sibling(node, matcher, ancestry, side, options) {
    var _ancestry = _slicedToArray(ancestry, 1),
      parent = _ancestry[0];
    if (!parent) {
      return false;
    }
    var keys = getVisitorKeys(parent, options);
    for (var i = 0; i < keys.length; ++i) {
      var listProp = parent[keys[i]];
      if (Array.isArray(listProp)) {
        var startIndex = listProp.indexOf(node);
        if (startIndex < 0) {
          continue;
        }
        var lowerBound = void 0,
          upperBound = void 0;
        if (side === LEFT_SIDE) {
          lowerBound = 0;
          upperBound = startIndex;
        } else {
          lowerBound = startIndex + 1;
          upperBound = listProp.length;
        }
        for (var k = lowerBound; k < upperBound; ++k) {
          if (isNode(listProp[k], options) && matcher(listProp[k], ancestry, options)) {
            return true;
          }
        }
      }
    }
    return false;
  }

  /**
   * Determines if the given node has an adjacent sibling that matches
   * the given selector matcher.
   * @param {external:AST} node
   * @param {SelectorMatcher} matcher
   * @param {external:AST[]} ancestry
   * @param {Side} side
   * @param {ESQueryOptions|undefined} options
   * @returns {boolean}
   */
  function adjacent(node, matcher, ancestry, side, options) {
    var _ancestry2 = _slicedToArray(ancestry, 1),
      parent = _ancestry2[0];
    if (!parent) {
      return false;
    }
    var keys = getVisitorKeys(parent, options);
    for (var i = 0; i < keys.length; ++i) {
      var listProp = parent[keys[i]];
      if (Array.isArray(listProp)) {
        var idx = listProp.indexOf(node);
        if (idx < 0) {
          continue;
        }
        if (side === LEFT_SIDE && idx > 0 && isNode(listProp[idx - 1], options) && matcher(listProp[idx - 1], ancestry, options)) {
          return true;
        }
        if (side === RIGHT_SIDE && idx < listProp.length - 1 && isNode(listProp[idx + 1], options) && matcher(listProp[idx + 1], ancestry, options)) {
          return true;
        }
      }
    }
    return false;
  }

  /**
   * Determines if the given node is the `nth` child.
   * If `nth` is negative then the position is counted
   * from the end of the list of children.
   * @param {external:AST} node
   * @param {external:AST[]} ancestry
   * @param {Integer} nth
   * @param {ESQueryOptions|undefined} options
   * @returns {boolean}
   */
  function nthChild(node, ancestry, nth, options) {
    if (nth === 0) {
      return false;
    }
    var _ancestry3 = _slicedToArray(ancestry, 1),
      parent = _ancestry3[0];
    if (!parent) {
      return false;
    }
    var keys = getVisitorKeys(parent, options);
    for (var i = 0; i < keys.length; ++i) {
      var listProp = parent[keys[i]];
      if (Array.isArray(listProp)) {
        var idx = nth < 0 ? listProp.length + nth : nth - 1;
        if (idx >= 0 && idx < listProp.length && listProp[idx] === node) {
          return true;
        }
      }
    }
    return false;
  }

  /**
   * For each selector node marked as a subject, find the portion of the
   * selector that the subject must match.
   * @param {SelectorAST} selector
   * @param {SelectorAST} [ancestor] Defaults to `selector`
   * @returns {SelectorAST[]}
   */
  function subjects(selector, ancestor) {
    if (selector == null || _typeof(selector) != 'object') {
      return [];
    }
    if (ancestor == null) {
      ancestor = selector;
    }
    var results = selector.subject ? [ancestor] : [];
    var keys = Object.keys(selector);
    for (var i = 0; i < keys.length; ++i) {
      var p = keys[i];
      var sel = selector[p];
      results.push.apply(results, _toConsumableArray(subjects(sel, p === 'left' ? sel : ancestor)));
    }
    return results;
  }

  /**
  * @callback TraverseVisitor
  * @param {?external:AST} node
  * @param {?external:AST} parent
  * @param {external:AST[]} ancestry
  */

  /**
   * From a JS AST and a selector AST, collect all JS AST nodes that
   * match the selector.
   * @param {external:AST} ast
   * @param {?SelectorAST} selector
   * @param {TraverseVisitor} visitor
   * @param {ESQueryOptions} [options]
   * @returns {external:AST[]}
   */
  function traverse(ast, selector, visitor, options) {
    if (!selector) {
      return;
    }
    var ancestry = [];
    var matcher = getMatcher(selector);
    var altSubjects = subjects(selector).map(getMatcher);
    estraverse.traverse(ast, {
      enter: function enter(node, parent) {
        if (parent != null) {
          ancestry.unshift(parent);
        }
        if (matcher(node, ancestry, options)) {
          if (altSubjects.length) {
            for (var i = 0, l = altSubjects.length; i < l; ++i) {
              if (altSubjects[i](node, ancestry, options)) {
                visitor(node, parent, ancestry);
              }
              for (var k = 0, m = ancestry.length; k < m; ++k) {
                var succeedingAncestry = ancestry.slice(k + 1);
                if (altSubjects[i](ancestry[k], succeedingAncestry, options)) {
                  visitor(ancestry[k], parent, succeedingAncestry);
                }
              }
            }
          } else {
            visitor(node, parent, ancestry);
          }
        }
      },
      leave: function leave() {
        ancestry.shift();
      },
      keys: options && options.visitorKeys,
      fallback: options && options.fallback || 'iteration'
    });
  }

  /**
   * From a JS AST and a selector AST, collect all JS AST nodes that
   * match the selector.
   * @param {external:AST} ast
   * @param {?SelectorAST} selector
   * @param {ESQueryOptions} [options]
   * @returns {external:AST[]}
   */
  function match(ast, selector, options) {
    var results = [];
    traverse(ast, selector, function (node) {
      results.push(node);
    }, options);
    return results;
  }

  /**
   * Parse a selector string and return its AST.
   * @param {string} selector
   * @returns {SelectorAST}
   */
  function parse(selector) {
    return parser.parse(selector);
  }

  /**
   * Query the code AST using the selector string.
   * @param {external:AST} ast
   * @param {string} selector
   * @param {ESQueryOptions} [options]
   * @returns {external:AST[]}
   */
  function query(ast, selector, options) {
    return match(ast, parse(selector), options);
  }
  query.parse = parse;
  query.match = match;
  query.traverse = traverse;
  query.matches = matches;
  query.query = query;

  return query;

})));
8x   (function (global, factory) {
  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory(require('estraverse')) :
  typeof define === 'function' && define.amd ? define(['estraverse'], factory) :
  (global = global || self, global.esquery = factory(global.estraverse));
}(this, (function (estraverse) { 'use strict';

  estraverse = estraverse && Object.prototype.hasOwnProperty.call(estraverse, 'default') ? estraverse['default'] : estraverse;

  function _arrayLikeToArray(r, a) {
    (null == a || a > r.length) && (a = r.length);
    for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
    return n;
  }
  function _arrayWithHoles(r) {
    if (Array.isArray(r)) return r;
  }
  function _arrayWithoutHoles(r) {
    if (Array.isArray(r)) return _arrayLikeToArray(r);
  }
  function _iterableToArray(r) {
    if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
  }
  function _iterableToArrayLimit(r, l) {
    var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
    if (null != t) {
      var e,
        n,
        i,
        u,
        a = [],
        f = !0,
        o = !1;
      try {
        if (i = (t = t.call(r)).next, 0 === l) {
          if (Object(t) !== t) return;
          f = !1;
        } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
      } catch (r) {
        o = !0, n = r;
      } finally {
        try {
          if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return;
        } finally {
          if (o) throw n;
        }
      }
      return a;
    }
  }
  function _nonIterableRest() {
    throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _nonIterableSpread() {
    throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
  }
  function _slicedToArray(r, e) {
    return _arrayWithHoles(r) || _iterableToArrayLimit(r, e) || _unsupportedIterableToArray(r, e) || _nonIterableRest();
  }
  function _toConsumableArray(r) {
    return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
  }
  function _typeof(o) {
    "@babel/helpers - typeof";

    return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
      return typeof o;
    } : function (o) {
      return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
    }, _typeof(o);
  }
  function _unsupportedIterableToArray(r, a) {
    if (r) {
      if ("string" == typeof r) return _arrayLikeToArray(r, a);
      var t = {}.toString.call(r).slice(8, -1);
      return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
    }
  }

  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};

  function createCommonjsModule(fn, module) {
  	return module = { exports: {} }, fn(module, module.exports), module.exports;
  }

  var parser = createCommonjsModule(function (module) {
    /*
     * Generated by PEG.js 0.10.0.
     *
     * http://pegjs.org/
     */
    (function (root, factory) {
      if ( module.exports) {
        module.exports = factory();
      }
    })(commonjsGlobal, function () {

      function peg$subclass(child, parent) {
        function ctor() {
          this.constructor = child;
        }
        ctor.prototype = parent.prototype;
        child.prototype = new ctor();
      }
      function peg$SyntaxError(message, expected, found, location) {
        this.message = message;
        this.expected = expected;
        this.found = found;
        this.location = location;
        this.name = "SyntaxError";
        if (typeof Error.captureStackTrace === "function") {
          Error.captureStackTrace(this, peg$SyntaxError);
        }
      }
      peg$subclass(peg$SyntaxError, Error);
      peg$SyntaxError.buildMessage = function (expected, found) {
        var DESCRIBE_EXPECTATION_FNS = {
          literal: function literal(expectation) {
            return "\"" + literalEscape(expectation.text) + "\"";
          },
          "class": function _class(expectation) {
            var escapedParts = "",
              i;
            for (i = 0; i < expectation.parts.length; i++) {
              escapedParts += expectation.parts[i] instanceof Array ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1]) : classEscape(expectation.parts[i]);
            }
            return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
          },
          any: function any(expectation) {
            return "any character";
          },
          end: function end(expectation) {
            return "end of input";
          },
          other: function other(expectation) {
            return expectation.description;
          }
        };
        function hex(ch) {
          return ch.charCodeAt(0).toString(16).toUpperCase();
        }
        function literalEscape(s) {
          return s.replace(/\\/g, '\\\\').replace(/"/g, '\\"').replace(/\0/g, '\\0').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/[\x00-\x0F]/g, function (ch) {
            return '\\x0' + hex(ch);
          }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) {
            return '\\x' + hex(ch);
          });
        }
        function classEscape(s) {
          return s.replace(/\\/g, '\\\\').replace(/\]/g, '\\]').replace(/\^/g, '\\^').replace(/-/g, '\\-').replace(/\0/g, '\\0').replace(/\t/g, '\\t').replace(/\n/g, '\\n').replace(/\r/g, '\\r').replace(/[\x00-\x0F]/g, function (ch) {
            return '\\x0' + hex(ch);
          }).replace(/[\x10-\x1F\x7F-\x9F]/g, function (ch) {
            return '\\x' + hex(ch);
          });
        }
        function describeExpectation(expectation) {
          return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
        }
        function describeExpected(expected) {
          var descriptions = new Array(expected.length),
            i,
            j;
          for (i = 0; i < expected.length; i++) {
            descriptions[i] = describeExpectation(expected[i]);
          }
          descriptions.sort();
          if (descriptions.length > 0) {
            for (i = 1, j = 1; i < descriptions.length; i++) {
              if (descriptions[i - 1] !== descriptions[i]) {
                descriptions[j] = descriptions[i];
                j++;
              }
            }
            descriptions.length = j;
          }
          switch (descriptions.length) {
            case 1:
              return descriptions[0];
            case 2:
              return descriptions[0] + " or " + descriptions[1];
            default:
              return descriptions.slice(0, -1).join(", ") + ", or " + descriptions[descriptions.length - 1];
          }
        }
        function describeFound(found) {
          return found ? "\"" + literalEscape(found) + "\"" : "end of input";
        }
        return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
      };
      function peg$parse(input, options) {
        options = options !== void 0 ? options : {};
        var peg$FAILED = {},
          peg$startRuleFunctions = {
            start: peg$parsestart
          },
          peg$startRuleFunction = peg$parsestart,
          peg$c0 = function peg$c0(ss) {
            return ss.length === 1 ? ss[0] : {
              type: 'matches',
              selectors: ss
            };
          },
          peg$c1 = function peg$c1() {
            return void 0;
          },
          peg$c2 = " ",
          peg$c3 = peg$literalExpectation(" ", false),
          peg$c4 = /^[^ [\],():#!=><~+.]/,
          peg$c5 = peg$classExpectation([" ", "[", "]", ",", "(", ")", ":", "#", "!", "=", ">", "<", "~", "+", "."], true, false),
          peg$c6 = function peg$c6(i) {
            return i.join('');
          },
          peg$c7 = ">",
          peg$c8 = peg$literalExpectation(">", false),
          peg$c9 = function peg$c9() {
            return 'child';
          },
          peg$c10 = "~",
          peg$c11 = peg$literalExpectation("~", false),
          peg$c12 = function peg$c12() {
            return 'sibling';
          },
          peg$c13 = "+",
          peg$c14 = peg$literalExpectation("+", false),
          peg$c15 = function peg$c15() {
            return 'adjacent';
          },
          peg$c16 = function peg$c16() {
            return 'descendant';
          },
          peg$c17 = ",",
          peg$c18 = peg$literalExpectation(",", false),
          peg$c19 = function peg$c19(s, ss) {
            return [s].concat(ss.map(function (s) {
              return s[3];
            }));
          },
          peg$c20 = function peg$c20(op, s) {
            if (!op) return s;
            return {
              type: op,
              left: {
                type: 'exactNode'
              },
              right: s
            };
          },
          peg$c21 = function peg$c21(a, ops) {
            return ops.reduce(function (memo, rhs) {
              return {
                type: rhs[0],
                left: memo,
                right: rhs[1]
              };
            }, a);
          },
          peg$c22 = "!",
          peg$c23 = peg$literalExpectation("!", false),
          peg$c24 = function peg$c24(subject, as) {
            var b = as.length === 1 ? as[0] : {
              type: 'compound',
              selectors: as
            };
            if (subject) b.subject = true;
            return b;
          },
          peg$c25 = "*",
          peg$c26 = peg$literalExpectation("*", false),
          peg$c27 = function peg$c27(a) {
            return {
              type: 'wildcard',
              value: a
            };
          },
          peg$c28 = "#",
          peg$c29 = peg$literalExpectation("#", false),
          peg$c30 = function peg$c30(i) {
            return {
              type: 'identifier',
              value: i
            };
          },
          peg$c31 = "[",
          peg$c32 = peg$literalExpectation("[", false),
          peg$c33 = "]",
          peg$c34 = peg$literalExpectation("]", false),
          peg$c35 = function peg$c35(v) {
            return v;
          },
          peg$c36 = /^[><!]/,
          peg$c37 = peg$classExpectation([">", "<", "!"], false, false),
          peg$c38 = "=",
          peg$c39 = peg$literalExpectation("=", false),
          peg$c40 = function peg$c40(a) {
            return (a || '') + '=';
          },
          peg$c41 = /^[><]/,
          peg$c42 = peg$classExpectation([">", "<"], false, false),
          peg$c43 = ".",
          peg$c44 = peg$literalExpectation(".", false),
          peg$c45 = function peg$c45(a, as) {
            return [].concat.apply([a], as).join('');
          },
          peg$c46 = function peg$c46(name, op, value) {
            return {
              type: 'attribute',
              name: name,
              operator: op,
              value: value
            };
          },
          peg$c47 = function peg$c47(name) {
            return {
              type: 'attribute',
              name: name
            };
          },
          peg$c48 = "\"",
          peg$c49 = peg$literalExpectation("\"", false),
          peg$c50 = /^[^\\"]/,
          peg$c51 = peg$classExpectation(["\\", "\""], true, false),
          peg$c52 = "\\",
          peg$c53 = peg$literalExpectation("\\", false),
          peg$c54 = peg$anyExpectation(),
          peg$c55 = function peg$c55(a, b) {
            return a + b;
          },
          peg$c56 = function peg$c56(d) {
            return {
              type: 'literal',
              value: strUnescape(d.join(''))
            };
          },
          peg$c57 = "'",
          peg$c58 = peg$literalExpectation("'", false),
          peg$c59 = /^[^\\']/,
          peg$c60 = peg$classExpectation(["\\", "'"], true, false),
          peg$c61 = /^[0-9]/,
          peg$c62 = peg$classExpectation([["0", "9"]], false, false),
          peg$c63 = function peg$c63(a, b) {
            // Can use `a.flat().join('')` once supported
            var leadingDecimals = a ? [].concat.apply([], a).join('') : '';
            return {
              type: 'literal',
              value: parseFloat(leadingDecimals + b.join(''))
            };
          },
          peg$c64 = function peg$c64(i) {
            return {
              type: 'literal',
              value: i
            };
          },
          peg$c65 = "type(",
          peg$c66 = peg$literalExpectation("type(", false),
          peg$c67 = /^[^ )]/,
          peg$c68 = peg$classExpectation([" ", ")"], true, false),
          peg$c69 = ")",
          peg$c70 = peg$literalExpectation(")", false),
          peg$c71 = function peg$c71(t) {
            return {
              type: 'type',
              value: t.join('')
            };
          },
          peg$c72 = /^[imsu]/,
          peg$c73 = peg$classExpectation(["i", "m", "s", "u"], false, false),
          peg$c74 = "/",
          peg$c75 = peg$literalExpectation("/", false),
          peg$c76 = function peg$c76(pattern, flgs) {
            return {
              type: 'regexp',
              value: new RegExp(pattern.join(''), flgs ? flgs.join('') : '')
            };
          },
          peg$c77 = /^[^\]\\]/,
          peg$c78 = peg$classExpectation(["]", "\\"], true, false),
          peg$c79 = function peg$c79(cs) {
            return '[' + cs.join('') + ']';
          },
          peg$c80 = function peg$c80(a) {
            return '\\' + a;
          },
          peg$c81 = /^[^\/\\[]/,
          peg$c82 = peg$classExpectation(["/", "\\", "["], true, false),
          peg$c83 = function peg$c83(cs) {
            return cs.join('');
          },
          peg$c84 = function peg$c84(i, is) {
            return {
              type: 'field',
              name: is.reduce(function (memo, p) {
                return memo + p[0] + p[1];
              }, i)
            };
          },
          peg$c85 = ":not(",
          peg$c86 = peg$literalExpectation(":not(", false),
          peg$c87 = function peg$c87(ss) {
            return {
              type: 'not',
              selectors: ss
            };
          },
          peg$c88 = ":matches(",
          peg$c89 = peg$literalExpectation(":matches(", false),
          peg$c90 = function peg$c90(ss) {
            return {
              type: 'matches',
              selectors: ss
            };
          },
          peg$c91 = ":is(",
          peg$c92 = peg$literalExpectation(":is(", false),
          peg$c93 = ":has(",
          peg$c94 = peg$literalExpectation(":has(", false),
          peg$c95 = function peg$c95(ss) {
            return {
              type: 'has',
              selectors: ss
            };
          },
          peg$c96 = ":first-child",
          peg$c97 = peg$literalExpectation(":first-child", false),
          peg$c98 = function peg$c98() {
            return nth(1);
          },
          peg$c99 = ":last-child",
          peg$c100 = peg$literalExpectation(":last-child", false),
          peg$c101 = function peg$c101() {
            return nthLast(1);
          },
          peg$c102 = ":nth-child(",
          peg$c103 = peg$literalExpectation(":nth-child(", false),
          peg$c104 = function peg$c104(n) {
            return nth(parseInt(n.join(''), 10));
          },
          peg$c105 = ":nth-last-child(",
          peg$c106 = peg$literalExpectation(":nth-last-child(", false),
          peg$c107 = function peg$c107(n) {
            return nthLast(parseInt(n.join(''), 10));
          },
          peg$c108 = ":",
          peg$c109 = peg$literalExpectation(":", false),
          peg$c110 = function peg$c110(c) {
            return {
              type: 'class',
              name: c
            };
          },
          peg$currPos = 0,
          peg$posDetailsCache = [{
            line: 1,
            column: 1
          }],
          peg$maxFailPos = 0,
          peg$maxFailExpected = [],
          peg$resultsCache = {},
          peg$result;
        if ("startRule" in options) {
          if (!(options.startRule in peg$startRuleFunctions)) {
            throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
          }
          peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
        }
        function peg$literalExpectation(text, ignoreCase) {
          return {
            type: "literal",
            text: text,
            ignoreCase: ignoreCase
          };
        }
        function peg$classExpectation(parts, inverted, ignoreCase) {
          return {
            type: "class",
            parts: parts,
            inverted: inverted,
            ignoreCase: ignoreCase
          };
        }
        function peg$anyExpectation() {
          return {
            type: "any"
          };
        }
        function peg$endExpectation() {
          return {
            type: "end"
          };
        }
        function peg$computePosDetails(pos) {
          var details = peg$posDetailsCache[pos],
            p;
          if (details) {
            return details;
          } else {
            p = pos - 1;
            while (!peg$posDetailsCache[p]) {
              p--;
            }
            details = peg$posDetailsCache[p];
            details = {
              line: details.line,
              column: details.column
            };
            while (p < pos) {
              if (input.charCodeAt(p) === 10) {
                details.line++;
                details.column = 1;
              } else {
                details.column++;
              }
              p++;
            }
            peg$posDetailsCache[pos] = details;
            return details;
          }
        }
        function peg$computeLocation(startPos, endPos) {
          var startPosDetails = peg$computePosDetails(startPos),
            endPosDetails = peg$computePosDetails(endPos);
          return {
            start: {
              offset: startPos,
              line: startPosDetails.line,
              column: startPosDetails.column
            },
            end: {
              offset: endPos,
              line: endPosDetails.line,
              column: endPosDetails.column
            }
          };
        }
        function peg$fail(expected) {
          if (peg$currPos < peg$maxFailPos) {
            return;
          }
          if (peg$currPos > peg$maxFailPos) {
            peg$maxFailPos = peg$currPos;
            peg$maxFailExpected = [];
          }
          peg$maxFailExpected.push(expected);
        }
        function peg$buildStructuredError(expected, found, location) {
          return new peg$SyntaxError(peg$SyntaxError.buildMessage(expected, found), expected, found, location);
        }
        function peg$parsestart() {
          var s0, s1, s2, s3;
          var key = peg$currPos * 36 + 0,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = peg$parse_();
          if (s1 !== peg$FAILED) {
            s2 = peg$parseselectors();
            if (s2 !== peg$FAILED) {
              s3 = peg$parse_();
              if (s3 !== peg$FAILED) {
                s1 = peg$c0(s2);
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          if (s0 === peg$FAILED) {
            s0 = peg$currPos;
            s1 = peg$parse_();
            if (s1 !== peg$FAILED) {
              s1 = peg$c1();
            }
            s0 = s1;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parse_() {
          var s0, s1;
          var key = peg$currPos * 36 + 1,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = [];
          if (input.charCodeAt(peg$currPos) === 32) {
            s1 = peg$c2;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c3);
            }
          }
          while (s1 !== peg$FAILED) {
            s0.push(s1);
            if (input.charCodeAt(peg$currPos) === 32) {
              s1 = peg$c2;
              peg$currPos++;
            } else {
              s1 = peg$FAILED;
              {
                peg$fail(peg$c3);
              }
            }
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseidentifierName() {
          var s0, s1, s2;
          var key = peg$currPos * 36 + 2,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = [];
          if (peg$c4.test(input.charAt(peg$currPos))) {
            s2 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s2 = peg$FAILED;
            {
              peg$fail(peg$c5);
            }
          }
          if (s2 !== peg$FAILED) {
            while (s2 !== peg$FAILED) {
              s1.push(s2);
              if (peg$c4.test(input.charAt(peg$currPos))) {
                s2 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s2 = peg$FAILED;
                {
                  peg$fail(peg$c5);
                }
              }
            }
          } else {
            s1 = peg$FAILED;
          }
          if (s1 !== peg$FAILED) {
            s1 = peg$c6(s1);
          }
          s0 = s1;
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsebinaryOp() {
          var s0, s1, s2, s3;
          var key = peg$currPos * 36 + 3,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = peg$parse_();
          if (s1 !== peg$FAILED) {
            if (input.charCodeAt(peg$currPos) === 62) {
              s2 = peg$c7;
              peg$currPos++;
            } else {
              s2 = peg$FAILED;
              {
                peg$fail(peg$c8);
              }
            }
            if (s2 !== peg$FAILED) {
              s3 = peg$parse_();
              if (s3 !== peg$FAILED) {
                s1 = peg$c9();
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          if (s0 === peg$FAILED) {
            s0 = peg$currPos;
            s1 = peg$parse_();
            if (s1 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 126) {
                s2 = peg$c10;
                peg$currPos++;
              } else {
                s2 = peg$FAILED;
                {
                  peg$fail(peg$c11);
                }
              }
              if (s2 !== peg$FAILED) {
                s3 = peg$parse_();
                if (s3 !== peg$FAILED) {
                  s1 = peg$c12();
                  s0 = s1;
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
            if (s0 === peg$FAILED) {
              s0 = peg$currPos;
              s1 = peg$parse_();
              if (s1 !== peg$FAILED) {
                if (input.charCodeAt(peg$currPos) === 43) {
                  s2 = peg$c13;
                  peg$currPos++;
                } else {
                  s2 = peg$FAILED;
                  {
                    peg$fail(peg$c14);
                  }
                }
                if (s2 !== peg$FAILED) {
                  s3 = peg$parse_();
                  if (s3 !== peg$FAILED) {
                    s1 = peg$c15();
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
              if (s0 === peg$FAILED) {
                s0 = peg$currPos;
                if (input.charCodeAt(peg$currPos) === 32) {
                  s1 = peg$c2;
                  peg$currPos++;
                } else {
                  s1 = peg$FAILED;
                  {
                    peg$fail(peg$c3);
                  }
                }
                if (s1 !== peg$FAILED) {
                  s2 = peg$parse_();
                  if (s2 !== peg$FAILED) {
                    s1 = peg$c16();
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              }
            }
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsehasSelectors() {
          var s0, s1, s2, s3, s4, s5, s6, s7;
          var key = peg$currPos * 36 + 4,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = peg$parsehasSelector();
          if (s1 !== peg$FAILED) {
            s2 = [];
            s3 = peg$currPos;
            s4 = peg$parse_();
            if (s4 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 44) {
                s5 = peg$c17;
                peg$currPos++;
              } else {
                s5 = peg$FAILED;
                {
                  peg$fail(peg$c18);
                }
              }
              if (s5 !== peg$FAILED) {
                s6 = peg$parse_();
                if (s6 !== peg$FAILED) {
                  s7 = peg$parsehasSelector();
                  if (s7 !== peg$FAILED) {
                    s4 = [s4, s5, s6, s7];
                    s3 = s4;
                  } else {
                    peg$currPos = s3;
                    s3 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
            while (s3 !== peg$FAILED) {
              s2.push(s3);
              s3 = peg$currPos;
              s4 = peg$parse_();
              if (s4 !== peg$FAILED) {
                if (input.charCodeAt(peg$currPos) === 44) {
                  s5 = peg$c17;
                  peg$currPos++;
                } else {
                  s5 = peg$FAILED;
                  {
                    peg$fail(peg$c18);
                  }
                }
                if (s5 !== peg$FAILED) {
                  s6 = peg$parse_();
                  if (s6 !== peg$FAILED) {
                    s7 = peg$parsehasSelector();
                    if (s7 !== peg$FAILED) {
                      s4 = [s4, s5, s6, s7];
                      s3 = s4;
                    } else {
                      peg$currPos = s3;
                      s3 = peg$FAILED;
                    }
                  } else {
                    peg$currPos = s3;
                    s3 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            }
            if (s2 !== peg$FAILED) {
              s1 = peg$c19(s1, s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseselectors() {
          var s0, s1, s2, s3, s4, s5, s6, s7;
          var key = peg$currPos * 36 + 5,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = peg$parseselector();
          if (s1 !== peg$FAILED) {
            s2 = [];
            s3 = peg$currPos;
            s4 = peg$parse_();
            if (s4 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 44) {
                s5 = peg$c17;
                peg$currPos++;
              } else {
                s5 = peg$FAILED;
                {
                  peg$fail(peg$c18);
                }
              }
              if (s5 !== peg$FAILED) {
                s6 = peg$parse_();
                if (s6 !== peg$FAILED) {
                  s7 = peg$parseselector();
                  if (s7 !== peg$FAILED) {
                    s4 = [s4, s5, s6, s7];
                    s3 = s4;
                  } else {
                    peg$currPos = s3;
                    s3 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
            while (s3 !== peg$FAILED) {
              s2.push(s3);
              s3 = peg$currPos;
              s4 = peg$parse_();
              if (s4 !== peg$FAILED) {
                if (input.charCodeAt(peg$currPos) === 44) {
                  s5 = peg$c17;
                  peg$currPos++;
                } else {
                  s5 = peg$FAILED;
                  {
                    peg$fail(peg$c18);
                  }
                }
                if (s5 !== peg$FAILED) {
                  s6 = peg$parse_();
                  if (s6 !== peg$FAILED) {
                    s7 = peg$parseselector();
                    if (s7 !== peg$FAILED) {
                      s4 = [s4, s5, s6, s7];
                      s3 = s4;
                    } else {
                      peg$currPos = s3;
                      s3 = peg$FAILED;
                    }
                  } else {
                    peg$currPos = s3;
                    s3 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            }
            if (s2 !== peg$FAILED) {
              s1 = peg$c19(s1, s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsehasSelector() {
          var s0, s1, s2;
          var key = peg$currPos * 36 + 6,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = peg$parsebinaryOp();
          if (s1 === peg$FAILED) {
            s1 = null;
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parseselector();
            if (s2 !== peg$FAILED) {
              s1 = peg$c20(s1, s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseselector() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 7,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = peg$parsesequence();
          if (s1 !== peg$FAILED) {
            s2 = [];
            s3 = peg$currPos;
            s4 = peg$parsebinaryOp();
            if (s4 !== peg$FAILED) {
              s5 = peg$parsesequence();
              if (s5 !== peg$FAILED) {
                s4 = [s4, s5];
                s3 = s4;
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
            while (s3 !== peg$FAILED) {
              s2.push(s3);
              s3 = peg$currPos;
              s4 = peg$parsebinaryOp();
              if (s4 !== peg$FAILED) {
                s5 = peg$parsesequence();
                if (s5 !== peg$FAILED) {
                  s4 = [s4, s5];
                  s3 = s4;
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            }
            if (s2 !== peg$FAILED) {
              s1 = peg$c21(s1, s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsesequence() {
          var s0, s1, s2, s3;
          var key = peg$currPos * 36 + 8,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 33) {
            s1 = peg$c22;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c23);
            }
          }
          if (s1 === peg$FAILED) {
            s1 = null;
          }
          if (s1 !== peg$FAILED) {
            s2 = [];
            s3 = peg$parseatom();
            if (s3 !== peg$FAILED) {
              while (s3 !== peg$FAILED) {
                s2.push(s3);
                s3 = peg$parseatom();
              }
            } else {
              s2 = peg$FAILED;
            }
            if (s2 !== peg$FAILED) {
              s1 = peg$c24(s1, s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseatom() {
          var s0;
          var key = peg$currPos * 36 + 9,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$parsewildcard();
          if (s0 === peg$FAILED) {
            s0 = peg$parseidentifier();
            if (s0 === peg$FAILED) {
              s0 = peg$parseattr();
              if (s0 === peg$FAILED) {
                s0 = peg$parsefield();
                if (s0 === peg$FAILED) {
                  s0 = peg$parsenegation();
                  if (s0 === peg$FAILED) {
                    s0 = peg$parsematches();
                    if (s0 === peg$FAILED) {
                      s0 = peg$parseis();
                      if (s0 === peg$FAILED) {
                        s0 = peg$parsehas();
                        if (s0 === peg$FAILED) {
                          s0 = peg$parsefirstChild();
                          if (s0 === peg$FAILED) {
                            s0 = peg$parselastChild();
                            if (s0 === peg$FAILED) {
                              s0 = peg$parsenthChild();
                              if (s0 === peg$FAILED) {
                                s0 = peg$parsenthLastChild();
                                if (s0 === peg$FAILED) {
                                  s0 = peg$parseclass();
                                }
                              }
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsewildcard() {
          var s0, s1;
          var key = peg$currPos * 36 + 10,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 42) {
            s1 = peg$c25;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c26);
            }
          }
          if (s1 !== peg$FAILED) {
            s1 = peg$c27(s1);
          }
          s0 = s1;
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseidentifier() {
          var s0, s1, s2;
          var key = peg$currPos * 36 + 11,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 35) {
            s1 = peg$c28;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c29);
            }
          }
          if (s1 === peg$FAILED) {
            s1 = null;
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parseidentifierName();
            if (s2 !== peg$FAILED) {
              s1 = peg$c30(s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseattr() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 12,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 91) {
            s1 = peg$c31;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c32);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parse_();
            if (s2 !== peg$FAILED) {
              s3 = peg$parseattrValue();
              if (s3 !== peg$FAILED) {
                s4 = peg$parse_();
                if (s4 !== peg$FAILED) {
                  if (input.charCodeAt(peg$currPos) === 93) {
                    s5 = peg$c33;
                    peg$currPos++;
                  } else {
                    s5 = peg$FAILED;
                    {
                      peg$fail(peg$c34);
                    }
                  }
                  if (s5 !== peg$FAILED) {
                    s1 = peg$c35(s3);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseattrOps() {
          var s0, s1, s2;
          var key = peg$currPos * 36 + 13,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (peg$c36.test(input.charAt(peg$currPos))) {
            s1 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c37);
            }
          }
          if (s1 === peg$FAILED) {
            s1 = null;
          }
          if (s1 !== peg$FAILED) {
            if (input.charCodeAt(peg$currPos) === 61) {
              s2 = peg$c38;
              peg$currPos++;
            } else {
              s2 = peg$FAILED;
              {
                peg$fail(peg$c39);
              }
            }
            if (s2 !== peg$FAILED) {
              s1 = peg$c40(s1);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          if (s0 === peg$FAILED) {
            if (peg$c41.test(input.charAt(peg$currPos))) {
              s0 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s0 = peg$FAILED;
              {
                peg$fail(peg$c42);
              }
            }
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseattrEqOps() {
          var s0, s1, s2;
          var key = peg$currPos * 36 + 14,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 33) {
            s1 = peg$c22;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c23);
            }
          }
          if (s1 === peg$FAILED) {
            s1 = null;
          }
          if (s1 !== peg$FAILED) {
            if (input.charCodeAt(peg$currPos) === 61) {
              s2 = peg$c38;
              peg$currPos++;
            } else {
              s2 = peg$FAILED;
              {
                peg$fail(peg$c39);
              }
            }
            if (s2 !== peg$FAILED) {
              s1 = peg$c40(s1);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseattrName() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 15,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = peg$parseidentifierName();
          if (s1 !== peg$FAILED) {
            s2 = [];
            s3 = peg$currPos;
            if (input.charCodeAt(peg$currPos) === 46) {
              s4 = peg$c43;
              peg$currPos++;
            } else {
              s4 = peg$FAILED;
              {
                peg$fail(peg$c44);
              }
            }
            if (s4 !== peg$FAILED) {
              s5 = peg$parseidentifierName();
              if (s5 !== peg$FAILED) {
                s4 = [s4, s5];
                s3 = s4;
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
            while (s3 !== peg$FAILED) {
              s2.push(s3);
              s3 = peg$currPos;
              if (input.charCodeAt(peg$currPos) === 46) {
                s4 = peg$c43;
                peg$currPos++;
              } else {
                s4 = peg$FAILED;
                {
                  peg$fail(peg$c44);
                }
              }
              if (s4 !== peg$FAILED) {
                s5 = peg$parseidentifierName();
                if (s5 !== peg$FAILED) {
                  s4 = [s4, s5];
                  s3 = s4;
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            }
            if (s2 !== peg$FAILED) {
              s1 = peg$c45(s1, s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseattrValue() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 16,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = peg$parseattrName();
          if (s1 !== peg$FAILED) {
            s2 = peg$parse_();
            if (s2 !== peg$FAILED) {
              s3 = peg$parseattrEqOps();
              if (s3 !== peg$FAILED) {
                s4 = peg$parse_();
                if (s4 !== peg$FAILED) {
                  s5 = peg$parsetype();
                  if (s5 === peg$FAILED) {
                    s5 = peg$parseregex();
                  }
                  if (s5 !== peg$FAILED) {
                    s1 = peg$c46(s1, s3, s5);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          if (s0 === peg$FAILED) {
            s0 = peg$currPos;
            s1 = peg$parseattrName();
            if (s1 !== peg$FAILED) {
              s2 = peg$parse_();
              if (s2 !== peg$FAILED) {
                s3 = peg$parseattrOps();
                if (s3 !== peg$FAILED) {
                  s4 = peg$parse_();
                  if (s4 !== peg$FAILED) {
                    s5 = peg$parsestring();
                    if (s5 === peg$FAILED) {
                      s5 = peg$parsenumber();
                      if (s5 === peg$FAILED) {
                        s5 = peg$parsepath();
                      }
                    }
                    if (s5 !== peg$FAILED) {
                      s1 = peg$c46(s1, s3, s5);
                      s0 = s1;
                    } else {
                      peg$currPos = s0;
                      s0 = peg$FAILED;
                    }
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
            if (s0 === peg$FAILED) {
              s0 = peg$currPos;
              s1 = peg$parseattrName();
              if (s1 !== peg$FAILED) {
                s1 = peg$c47(s1);
              }
              s0 = s1;
            }
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsestring() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 17,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 34) {
            s1 = peg$c48;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c49);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = [];
            if (peg$c50.test(input.charAt(peg$currPos))) {
              s3 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s3 = peg$FAILED;
              {
                peg$fail(peg$c51);
              }
            }
            if (s3 === peg$FAILED) {
              s3 = peg$currPos;
              if (input.charCodeAt(peg$currPos) === 92) {
                s4 = peg$c52;
                peg$currPos++;
              } else {
                s4 = peg$FAILED;
                {
                  peg$fail(peg$c53);
                }
              }
              if (s4 !== peg$FAILED) {
                if (input.length > peg$currPos) {
                  s5 = input.charAt(peg$currPos);
                  peg$currPos++;
                } else {
                  s5 = peg$FAILED;
                  {
                    peg$fail(peg$c54);
                  }
                }
                if (s5 !== peg$FAILED) {
                  s4 = peg$c55(s4, s5);
                  s3 = s4;
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            }
            while (s3 !== peg$FAILED) {
              s2.push(s3);
              if (peg$c50.test(input.charAt(peg$currPos))) {
                s3 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s3 = peg$FAILED;
                {
                  peg$fail(peg$c51);
                }
              }
              if (s3 === peg$FAILED) {
                s3 = peg$currPos;
                if (input.charCodeAt(peg$currPos) === 92) {
                  s4 = peg$c52;
                  peg$currPos++;
                } else {
                  s4 = peg$FAILED;
                  {
                    peg$fail(peg$c53);
                  }
                }
                if (s4 !== peg$FAILED) {
                  if (input.length > peg$currPos) {
                    s5 = input.charAt(peg$currPos);
                    peg$currPos++;
                  } else {
                    s5 = peg$FAILED;
                    {
                      peg$fail(peg$c54);
                    }
                  }
                  if (s5 !== peg$FAILED) {
                    s4 = peg$c55(s4, s5);
                    s3 = s4;
                  } else {
                    peg$currPos = s3;
                    s3 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              }
            }
            if (s2 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 34) {
                s3 = peg$c48;
                peg$currPos++;
              } else {
                s3 = peg$FAILED;
                {
                  peg$fail(peg$c49);
                }
              }
              if (s3 !== peg$FAILED) {
                s1 = peg$c56(s2);
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          if (s0 === peg$FAILED) {
            s0 = peg$currPos;
            if (input.charCodeAt(peg$currPos) === 39) {
              s1 = peg$c57;
              peg$currPos++;
            } else {
              s1 = peg$FAILED;
              {
                peg$fail(peg$c58);
              }
            }
            if (s1 !== peg$FAILED) {
              s2 = [];
              if (peg$c59.test(input.charAt(peg$currPos))) {
                s3 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s3 = peg$FAILED;
                {
                  peg$fail(peg$c60);
                }
              }
              if (s3 === peg$FAILED) {
                s3 = peg$currPos;
                if (input.charCodeAt(peg$currPos) === 92) {
                  s4 = peg$c52;
                  peg$currPos++;
                } else {
                  s4 = peg$FAILED;
                  {
                    peg$fail(peg$c53);
                  }
                }
                if (s4 !== peg$FAILED) {
                  if (input.length > peg$currPos) {
                    s5 = input.charAt(peg$currPos);
                    peg$currPos++;
                  } else {
                    s5 = peg$FAILED;
                    {
                      peg$fail(peg$c54);
                    }
                  }
                  if (s5 !== peg$FAILED) {
                    s4 = peg$c55(s4, s5);
                    s3 = s4;
                  } else {
                    peg$currPos = s3;
                    s3 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              }
              while (s3 !== peg$FAILED) {
                s2.push(s3);
                if (peg$c59.test(input.charAt(peg$currPos))) {
                  s3 = input.charAt(peg$currPos);
                  peg$currPos++;
                } else {
                  s3 = peg$FAILED;
                  {
                    peg$fail(peg$c60);
                  }
                }
                if (s3 === peg$FAILED) {
                  s3 = peg$currPos;
                  if (input.charCodeAt(peg$currPos) === 92) {
                    s4 = peg$c52;
                    peg$currPos++;
                  } else {
                    s4 = peg$FAILED;
                    {
                      peg$fail(peg$c53);
                    }
                  }
                  if (s4 !== peg$FAILED) {
                    if (input.length > peg$currPos) {
                      s5 = input.charAt(peg$currPos);
                      peg$currPos++;
                    } else {
                      s5 = peg$FAILED;
                      {
                        peg$fail(peg$c54);
                      }
                    }
                    if (s5 !== peg$FAILED) {
                      s4 = peg$c55(s4, s5);
                      s3 = s4;
                    } else {
                      peg$currPos = s3;
                      s3 = peg$FAILED;
                    }
                  } else {
                    peg$currPos = s3;
                    s3 = peg$FAILED;
                  }
                }
              }
              if (s2 !== peg$FAILED) {
                if (input.charCodeAt(peg$currPos) === 39) {
                  s3 = peg$c57;
                  peg$currPos++;
                } else {
                  s3 = peg$FAILED;
                  {
                    peg$fail(peg$c58);
                  }
                }
                if (s3 !== peg$FAILED) {
                  s1 = peg$c56(s2);
                  s0 = s1;
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsenumber() {
          var s0, s1, s2, s3;
          var key = peg$currPos * 36 + 18,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = peg$currPos;
          s2 = [];
          if (peg$c61.test(input.charAt(peg$currPos))) {
            s3 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s3 = peg$FAILED;
            {
              peg$fail(peg$c62);
            }
          }
          while (s3 !== peg$FAILED) {
            s2.push(s3);
            if (peg$c61.test(input.charAt(peg$currPos))) {
              s3 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s3 = peg$FAILED;
              {
                peg$fail(peg$c62);
              }
            }
          }
          if (s2 !== peg$FAILED) {
            if (input.charCodeAt(peg$currPos) === 46) {
              s3 = peg$c43;
              peg$currPos++;
            } else {
              s3 = peg$FAILED;
              {
                peg$fail(peg$c44);
              }
            }
            if (s3 !== peg$FAILED) {
              s2 = [s2, s3];
              s1 = s2;
            } else {
              peg$currPos = s1;
              s1 = peg$FAILED;
            }
          } else {
            peg$currPos = s1;
            s1 = peg$FAILED;
          }
          if (s1 === peg$FAILED) {
            s1 = null;
          }
          if (s1 !== peg$FAILED) {
            s2 = [];
            if (peg$c61.test(input.charAt(peg$currPos))) {
              s3 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s3 = peg$FAILED;
              {
                peg$fail(peg$c62);
              }
            }
            if (s3 !== peg$FAILED) {
              while (s3 !== peg$FAILED) {
                s2.push(s3);
                if (peg$c61.test(input.charAt(peg$currPos))) {
                  s3 = input.charAt(peg$currPos);
                  peg$currPos++;
                } else {
                  s3 = peg$FAILED;
                  {
                    peg$fail(peg$c62);
                  }
                }
              }
            } else {
              s2 = peg$FAILED;
            }
            if (s2 !== peg$FAILED) {
              s1 = peg$c63(s1, s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsepath() {
          var s0, s1;
          var key = peg$currPos * 36 + 19,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = peg$parseidentifierName();
          if (s1 !== peg$FAILED) {
            s1 = peg$c64(s1);
          }
          s0 = s1;
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsetype() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 20,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.substr(peg$currPos, 5) === peg$c65) {
            s1 = peg$c65;
            peg$currPos += 5;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c66);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parse_();
            if (s2 !== peg$FAILED) {
              s3 = [];
              if (peg$c67.test(input.charAt(peg$currPos))) {
                s4 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s4 = peg$FAILED;
                {
                  peg$fail(peg$c68);
                }
              }
              if (s4 !== peg$FAILED) {
                while (s4 !== peg$FAILED) {
                  s3.push(s4);
                  if (peg$c67.test(input.charAt(peg$currPos))) {
                    s4 = input.charAt(peg$currPos);
                    peg$currPos++;
                  } else {
                    s4 = peg$FAILED;
                    {
                      peg$fail(peg$c68);
                    }
                  }
                }
              } else {
                s3 = peg$FAILED;
              }
              if (s3 !== peg$FAILED) {
                s4 = peg$parse_();
                if (s4 !== peg$FAILED) {
                  if (input.charCodeAt(peg$currPos) === 41) {
                    s5 = peg$c69;
                    peg$currPos++;
                  } else {
                    s5 = peg$FAILED;
                    {
                      peg$fail(peg$c70);
                    }
                  }
                  if (s5 !== peg$FAILED) {
                    s1 = peg$c71(s3);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseflags() {
          var s0, s1;
          var key = peg$currPos * 36 + 21,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = [];
          if (peg$c72.test(input.charAt(peg$currPos))) {
            s1 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c73);
            }
          }
          if (s1 !== peg$FAILED) {
            w~>hile (s1 !== peg$FAILED) {
              s0.push(s1);
              if (peg$c72.test(input.charAt(peg$currPos))) {
                s1 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s1 = peg$FAILED;
                {
                  peg$fail(peg$c73);
                }
              }
            }
          } else {
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseregex() {
          var s0, s1, s2, s3, s4;
          var key = peg$currPos * 36 + 22,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 47) {
            s1 = peg$c74;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c75);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = [];
            s3 = peg$parsere_character_class();
            if (s3 === peg$FAILED) {
              s3 = peg$parsere_escape();
              if (s3 === peg$FAILED) {
                s3 = peg$parsere_chars();
              }
            }
            if (s3 !== peg$FAILED) {
              while (s3 !== peg$FAILED) {
                s2.push(s3);
                s3 = peg$parsere_character_class();
                if (s3 === peg$FAILED) {
                  s3 = peg$parsere_escape();
                  if (s3 === peg$FAILED) {
                    s3 = peg$parsere_chars();
                  }
                }
              }
            } else {
              s2 = peg$FAILED;
            }
            if (s2 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 47) {
                s3 = peg$c74;
                peg$currPos++;
              } else {
                s3 = peg$FAILED;
                {
                  peg$fail(peg$c75);
                }
              }
              if (s3 !== peg$FAILED) {
                s4 = peg$parseflags();
                if (s4 === peg$FAILED) {
                  s4 = null;
                }
                if (s4 !== peg$FAILED) {
                  s1 = peg$c76(s2, s4);
                  s0 = s1;
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsere_character_class() {
          var s0, s1, s2, s3;
          var key = peg$currPos * 36 + 23,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 91) {
            s1 = peg$c31;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c32);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = [];
            if (peg$c77.test(input.charAt(peg$currPos))) {
              s3 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s3 = peg$FAILED;
              {
                peg$fail(peg$c78);
              }
            }
            if (s3 === peg$FAILED) {
              s3 = peg$parsere_escape();
            }
            if (s3 !== peg$FAILED) {
              while (s3 !== peg$FAILED) {
                s2.push(s3);
                if (peg$c77.test(input.charAt(peg$currPos))) {
                  s3 = input.charAt(peg$currPos);
                  peg$currPos++;
                } else {
                  s3 = peg$FAILED;
                  {
                    peg$fail(peg$c78);
                  }
                }
                if (s3 === peg$FAILED) {
                  s3 = peg$parsere_escape();
                }
              }
            } else {
              s2 = peg$FAILED;
            }
            if (s2 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 93) {
                s3 = peg$c33;
                peg$currPos++;
              } else {
                s3 = peg$FAILED;
                {
                  peg$fail(peg$c34);
                }
              }
              if (s3 !== peg$FAILED) {
                s1 = peg$c79(s2);
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsere_escape() {
          var s0, s1, s2;
          var key = peg$currPos * 36 + 24,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 92) {
            s1 = peg$c52;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c53);
            }
          }
          if (s1 !== peg$FAILED) {
            if (input.length > peg$currPos) {
              s2 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s2 = peg$FAILED;
              {
                peg$fail(peg$c54);
              }
            }
            if (s2 !== peg$FAILED) {
              s1 = peg$c80(s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsere_chars() {
          var s0, s1, s2;
          var key = peg$currPos * 36 + 25,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          s1 = [];
          if (peg$c81.test(input.charAt(peg$currPos))) {
            s2 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s2 = peg$FAILED;
            {
              peg$fail(peg$c82);
            }
          }
          if (s2 !== peg$FAILED) {
            while (s2 !== peg$FAILED) {
              s1.push(s2);
              if (peg$c81.test(input.charAt(peg$currPos))) {
                s2 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s2 = peg$FAILED;
                {
                  peg$fail(peg$c82);
                }
              }
            }
          } else {
            s1 = peg$FAILED;
          }
          if (s1 !== peg$FAILED) {
            s1 = peg$c83(s1);
          }
          s0 = s1;
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsefield() {
          var s0, s1, s2, s3, s4, s5, s6;
          var key = peg$currPos * 36 + 26,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 46) {
            s1 = peg$c43;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c44);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parseidentifierName();
            if (s2 !== peg$FAILED) {
              s3 = [];
              s4 = peg$currPos;
              if (input.charCodeAt(peg$currPos) === 46) {
                s5 = peg$c43;
                peg$currPos++;
              } else {
                s5 = peg$FAILED;
                {
                  peg$fail(peg$c44);
                }
              }
              if (s5 !== peg$FAILED) {
                s6 = peg$parseidentifierName();
                if (s6 !== peg$FAILED) {
                  s5 = [s5, s6];
                  s4 = s5;
                } else {
                  peg$currPos = s4;
                  s4 = peg$FAILED;
                }
              } else {
                peg$currPos = s4;
                s4 = peg$FAILED;
              }
              while (s4 !== peg$FAILED) {
                s3.push(s4);
                s4 = peg$currPos;
                if (input.charCodeAt(peg$currPos) === 46) {
                  s5 = peg$c43;
                  peg$currPos++;
                } else {
                  s5 = peg$FAILED;
                  {
                    peg$fail(peg$c44);
                  }
                }
                if (s5 !== peg$FAILED) {
                  s6 = peg$parseidentifierName();
                  if (s6 !== peg$FAILED) {
                    s5 = [s5, s6];
                    s4 = s5;
                  } else {
                    peg$currPos = s4;
                    s4 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s4;
                  s4 = peg$FAILED;
                }
              }
              if (s3 !== peg$FAILED) {
                s1 = peg$c84(s2, s3);
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsenegation() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 27,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.substr(peg$currPos, 5) === peg$c85) {
            s1 = peg$c85;
            peg$currPos += 5;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c86);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parse_();
            if (s2 !== peg$FAILED) {
              s3 = peg$parseselectors();
              if (s3 !== peg$FAILED) {
                s4 = peg$parse_();
                if (s4 !== peg$FAILED) {
                  if (input.charCodeAt(peg$currPos) === 41) {
                    s5 = peg$c69;
                    peg$currPos++;
                  } else {
                    s5 = peg$FAILED;
                    {
                      peg$fail(peg$c70);
                    }
                  }
                  if (s5 !== peg$FAILED) {
                    s1 = peg$c87(s3);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsematches() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 28,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.substr(peg$currPos, 9) === peg$c88) {
            s1 = peg$c88;
            peg$currPos += 9;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c89);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parse_();
            if (s2 !== peg$FAILED) {
              s3 = peg$parseselectors();
              if (s3 !== peg$FAILED) {
                s4 = peg$parse_();
                if (s4 !== peg$FAILED) {
                  if (input.charCodeAt(peg$currPos) === 41) {
                    s5 = peg$c69;
                    peg$currPos++;
                  } else {
                    s5 = peg$FAILED;
                    {
                      peg$fail(peg$c70);
                    }
                  }
                  if (s5 !== peg$FAILED) {
                    s1 = peg$c90(s3);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseis() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 29,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.substr(peg$currPos, 4) === peg$c91) {
            s1 = peg$c91;
            peg$currPos += 4;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c92);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parse_();
            if (s2 !== peg$FAILED) {
              s3 = peg$parseselectors();
              if (s3 !== peg$FAILED) {
                s4 = peg$parse_();
                if (s4 !== peg$FAILED) {
                  if (input.charCodeAt(peg$currPos) === 41) {
                    s5 = peg$c69;
                    peg$currPos++;
                  } else {
                    s5 = peg$FAILED;
                    {
                      peg$fail(peg$c70);
                    }
                  }
                  if (s5 !== peg$FAILED) {
                    s1 = peg$c90(s3);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsehas() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 30,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.substr(peg$currPos, 5) === peg$c93) {
            s1 = peg$c93;
            peg$currPos += 5;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c94);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parse_();
            if (s2 !== peg$FAILED) {
              s3 = peg$parsehasSelectors();
              if (s3 !== peg$FAILED) {
                s4 = peg$parse_();
                if (s4 !== peg$FAILED) {
                  if (input.charCodeAt(peg$currPos) === 41) {
                    s5 = peg$c69;
                    peg$currPos++;
                  } else {
                    s5 = peg$FAILED;
                    {
                      peg$fail(peg$c70);
                    }
                  }
                  if (s5 !== peg$FAILED) {
                    s1 = peg$c95(s3);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsefirstChild() {
          var s0, s1;
          var key = peg$currPos * 36 + 31,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.substr(peg$currPos, 12) === peg$c96) {
            s1 = peg$c96;
            peg$currPos += 12;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c97);
            }
          }
          if (s1 !== peg$FAILED) {
            s1 = peg$c98();
          }
          s0 = s1;
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parselastChild() {
          var s0, s1;
          var key = peg$currPos * 36 + 32,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.substr(peg$currPos, 11) === peg$c99) {
            s1 = peg$c99;
            peg$currPos += 11;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c100);
            }
          }
          if (s1 !== peg$FAILED) {
            s1 = peg$c101();
          }
          s0 = s1;
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsenthChild() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 33,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.substr(peg$currPos, 11) === peg$c102) {
            s1 = peg$c102;
            peg$currPos += 11;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c103);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parse_();
            if (s2 !== peg$FAILED) {
              s3 = [];
              if (peg$c61.test(input.charAt(peg$currPos))) {
                s4 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s4 = peg$FAILED;
                {
                  peg$fail(peg$c62);
                }
              }
              if (s4 !== peg$FAILED) {
                while (s4 !== peg$FAILED) {
                  s3.push(s4);
                  if (peg$c61.test(input.charAt(peg$currPos))) {
                    s4 = input.charAt(peg$currPos);
                    peg$currPos++;
                  } else {
                    s4 = peg$FAILED;
                    {
                      peg$fail(peg$c62);
                    }
                  }
                }
              } else {
                s3 = peg$FAILED;
              }
              if (s3 !== peg$FAILED) {
                s4 = peg$parse_();
                if (s4 !== peg$FAILED) {
                  if (input.charCodeAt(peg$currPos) === 41) {
                    s5 = peg$c69;
                    peg$currPos++;
                  } else {
                    s5 = peg$FAILED;
                    {
                      peg$fail(peg$c70);
                    }
                  }
                  if (s5 !== peg$FAILED) {
                    s1 = peg$c104(s3);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parsenthLastChild() {
          var s0, s1, s2, s3, s4, s5;
          var key = peg$currPos * 36 + 34,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.substr(peg$currPos, 16) === peg$c105) {
            s1 = peg$c105;
            peg$currPos += 16;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c106);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parse_();
            if (s2 !== peg$FAILED) {
              s3 = [];
              if (peg$c61.test(input.charAt(peg$currPos))) {
                s4 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s4 = peg$FAILED;
                {
                  peg$fail(peg$c62);
                }
              }
              if (s4 !== peg$FAILED) {
                while (s4 !== peg$FAILED) {
                  s3.push(s4);
                  if (peg$c61.test(input.charAt(peg$currPos))) {
                    s4 = input.charAt(peg$currPos);
                    peg$currPos++;
                  } else {
                    s4 = peg$FAILED;
                    {
                      peg$fail(peg$c62);
                    }
                  }
                }
              } else {
                s3 = peg$FAILED;
              }
              if (s3 !== peg$FAILED) {
                s4 = peg$parse_();
                if (s4 !== peg$FAILED) {
                  if (input.charCodeAt(peg$currPos) === 41) {
                    s5 = peg$c69;
                    peg$currPos++;
                  } else {
                    s5 = peg$FAILED;
                    {
                      peg$fail(peg$c70);
                    }
                  }
                  if (s5 !== peg$FAILED) {
                    s1 = peg$c107(s3);
                    s0 = s1;
                  } else {
                    peg$currPos = s0;
                    s0 = peg$FAILED;
                  }
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function peg$parseclass() {
          var s0, s1, s2;
          var key = peg$currPos * 36 + 35,
            cached = peg$resultsCache[key];
          if (cached) {
            peg$currPos = cached.nextPos;
            return cached.result;
          }
          s0 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 58) {
            s1 = peg$c108;
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            {
              peg$fail(peg$c109);
            }
          }
          if (s1 !== peg$FAILED) {
            s2 = peg$parseidentifierName();
            if (s2 !== peg$FAILED) {
              s1 = peg$c110(s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          peg$resultsCache[key] = {
            nextPos: peg$currPos,
            result: s0
          };
          return s0;
        }
        function nth(n) {
          return {
            type: 'nth-child',
            index: {
              type: 'literal',
              value: n
            }
          };
        }
        function nthLast(n) {
          return {
            type: 'nth-last-child',
            index: {
              type: 'literal',
              value: n
            }
          };
        }
        function strUnescape(s) {
          return s.replace(/\\(.)/g, function (match, ch) {
            switch (ch) {
              case 'b':
                return '\b';
              case 'f':
                return '\f';
              case 'n':
                return '\n';
              case 'r':
                return '\r';
              case 't':
                return '\t';
              case 'v':
                return '\v';
              default:
                return ch;
            }
          });
        }
        peg$result = peg$startRuleFunction();
        if (peg$result !== peg$FAILED && peg$currPos === input.length) {
          return peg$result;
        } else {
          if (peg$result !== peg$FAILED && peg$currPos < input.length) {
            peg$fail(peg$endExpectation());
          }
          throw peg$buildStructuredError(peg$maxFailExpected, peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null, peg$maxFailPos < input.length ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1) : peg$computeLocation(peg$maxFailPos, peg$maxFailPos));
        }
      }
      return {
        SyntaxError: peg$SyntaxError,
        parse: peg$parse
      };
    });
  });

  /**
  * @typedef {"LEFT_SIDE"|"RIGHT_SIDE"} Side
  */

  var LEFT_SIDE = 'LEFT_SIDE';
  var RIGHT_SIDE = 'RIGHT_SIDE';

  /**
   * @external AST
   * @see https://esprima.readthedocs.io/en/latest/syntax-tree-format.html
   */

  /**
   * One of the rules of `grammar.pegjs`
   * @typedef {PlainObject} SelectorAST
   * @see grammar.pegjs
  */

  /**
   * The `sequence` production of `grammar.pegjs`
   * @typedef {PlainObject} SelectorSequenceAST
  */

  /**
   * Get the value of a property which may be multiple levels down
   * in the object.
   * @param {?PlainObject} obj
   * @param {string[]} keys
   * @returns {undefined|boolean|string|number|external:AST}
   */
  function getPath(obj, keys) {
    for (var i = 0; i < keys.length; ++i) {
      if (obj == null) {
        return obj;
      }
      obj = obj[keys[i]];
    }
    return obj;
  }

  /**
   * Determine whether `node` can be reached by following `path`,
   * starting at `ancestor`.
   * @param {?external:AST} node
   * @param {?external:AST} ancestor
   * @param {string[]} path
   * @param {Integer} fromPathIndex
   * @returns {boolean}
   */
  function inPath(node, ancestor, path, fromPathIndex) {
    var current = ancestor;
    for (var i = fromPathIndex; i < path.length; ++i) {
      if (current == null) {
        return false;
      }
      var field = current[path[i]];
      if (Array.isArray(field)) {
        for (var k = 0; k < field.length; ++k) {
          if (inPath(node, field[k], path, i + 1)) {
            return true;
          }
        }
        return false;
      }
      current = field;
    }
    return node === current;
  }

  /**
   * A generated matcher function for a selector.
   * @callback SelectorMatcher
   * @param {?SelectorAST} selector
   * @param {external:AST[]} [ancestry=[]]
   * @param {ESQueryOptions} [options]
   * @returns {void}
  */

  /**
   * A WeakMap for holding cached matcher functions for selectors.
   * @type {WeakMap<SelectorAST, SelectorMatcher>}
  */
  var MATCHER_CACHE = typeof WeakMap === 'function' ? new WeakMap() : null;

  /**
   * Look up a matcher function for `selector` in the cache.
   * If it does not exist, generate it with `generateMatcher` and add it to the cache.
   * In engines without WeakMap, the caching is skipped and matchers are generated with every call.
   * @param {?SelectorAST} selector
   * @returns {SelectorMatcher}
   */
  function getMatcher(selector) {
    if (selector == null) {
      return function () {
        return true;
      };
    }
    if (MATCHER_CACHE != null) {
      var matcher = MATCHER_CACHE.get(selector);
      if (matcher != null) {
        return matcher;
      }
      matcher = generateMatcher(selector);
      MATCHER_CACHE.set(selector, matcher);
      return matcher;
    }
    return generateMatcher(selector);
  }

  /**
   * Create a matcher function for `selector`,
   * @param {?SelectorAST} selector
   * @returns {SelectorMatcher}
   */
  function generateMatcher(selector) {
    switch (selector.type) {
      case 'wildcard':
        return function () {
          return true;
        };
      case 'identifier':
        {
          var value = selector.value.toLowerCase();
          return function (node, ancestry, options) {
            var nodeTypeKey = options && options.nodeTypeKey || 'type';
            return value === node[nodeTypeKey].toLowerCase();
          };
        }
      case 'exactNode':
        return function (node, ancestry) {
          return ancestry.length === 0;
        };
      case 'field':
        {
          var path = selector.name.split('.');
          return function (node, ancestry) {
            var ancestor = ancestry[path.length - 1];
            return inPath(node, ancestor, path, 0);
          };
        }
      case 'matches':
        {
          var matchers = selector.selectors.map(getMatcher);
          return function (node, ancestry, options) {
            for (var i = 0; i < matchers.length; ++i) {
              if (matchers[i](node, ancestry, options)) {
                return true;
              }
            }
            return false;
          };
        }
      case 'compound':
        {
          var _matchers = selector.selectors.map(getMatcher);
          return function (node, ancestry, options) {
            for (var i = 0; i < _matchers.length; ++i) {
              if (!_matchers[i](node, ancestry, options)) {
                return false;
              }
            }
            return true;
          };
        }
      case 'not':
        {
          var _matchers2 = selector.selectors.map(getMatcher);
          return function (node, ancestry, options) {
            for (var i = 0; i < _matchers2.length; ++i) {
              if (_matchers2[i](node, ancestry, options)) {
                return false;
              }
            }
            return true;
          };
        }
      case 'has':
        {
          var _matchers3 = selector.selectors.map(getMatcher);
          return function (node, ancestry, options) {
            var result = false;
            var a = [];
            estraverse.traverse(node, {
              enter: function enter(node, parent) {
                if (parent != null) {
                  a.unshift(parent);
                }
                for (var i = 0; i < _matchers3.length; ++i) {
                  if (_matchers3[i](node, a, options)) {
                    result = true;
                    this["break"]();
                    return;
                  }
                }
              },
              leave: function leave() {
                a.shift();
              },
              keys: options && options.visitorKeys,
              fallback: options && options.fallback || 'iteration'
            });
            return result;
          };
        }
      case 'child':
        {
          var left = getMatcher(selector.left);
          var right = getMatcher(selector.right);
          return function (node, ancestry, options) {
            if (ancestry.length > 0 && right(node, ancestry, options)) {
              return left(ancestry[0], ancestry.slice(1), options);
            }
            return false;
          };
        }
      case 'descendant':
        {
          var _left = getMatcher(selector.left);
          var _right = getMatcher(selector.right);
          return function (node, ancestry, options) {
            if (_right(node, ancestry, options)) {
              for (var i = 0, l = ancestry.length; i < l; ++i) {
                if (_left(ancestry[i], ancestry.slice(i + 1), options)) {
                  return true;
                }
              }
            }
            return false;
          };
        }
      case 'attribute':
        {
          var _path = selector.name.split('.');
          switch (selector.operator) {
            case void 0:
              return function (node) {
                return getPath(node, _path) != null;
              };
            case '=':
              switch (selector.value.type) {
                case 'regexp':
                  return function (node) {
                    var p = getPath(node, _path);
                    return typeof p === 'string' && selector.value.value.test(p);
                  };
                case 'literal':
                  {
                    var literal = "".concat(selector.value.value);
                    return function (node) {
                      return literal === "".concat(getPath(node, _path));
                    };
                  }
                case 'type':
                  return function (node) {
                    return selector.value.value === _typeof(getPath(node, _path));
                  };
              }
              throw new Error("Unknown selector value type: ".concat(selector.value.type));
            case '!=':
              switch (selector.value.type) {
                case 'regexp':
                  return function (node) {
                    return !selector.value.value.test(getPath(node, _path));
                  };
                case 'literal':
                  {
                    var _literal = "".concat(selector.value.value);
                    return function (node) {
                      return _literal !== "".concat(getPath(node, _path));
                    };
                  }
                case 'type':
                  return function (node) {
                    return selector.value.value !== _typeof(getPath(node, _path));
                  };
              }
              throw new Error("Unknown selector value type: ".concat(selector.value.type));
            case '<=':
              return function (node) {
                return getPath(node, _path) <= selector.value.value;
              };
            case '<':
              return function (node) {
                return getPath(node, _path) < selector.value.value;
              };
            case '>':
              return function (node) {
                return getPath(node, _path) > selector.value.value;
              };
            case '>=':
              return function (node) {
                return getPath(node, _path) >= selector.value.value;
              };
          }
          throw new Error("Unknown operator: ".concat(selector.operator));
        }
      case 'sibling':
        {
          var _left2 = getMatcher(selector.left);
          var _right2 = getMatcher(selector.right);
          return function (node, ancestry, options) {
            return _right2(node, ancestry, options) && sibling(node, _left2, ancestry, LEFT_SIDE, options) || selector.left.subject && _left2(node, ancestry, options) && sibling(node, _right2, ancestry, RIGHT_SIDE, options);
          };
        }
      case 'adjacent':
        {
          var _left3 = getMatcher(selector.left);
          var _right3 = getMatcher(selector.right);
          return function (node, ancestry, options) {
            return _right3(node, ancestry, options) && adjacent(node, _left3, ancestry, LEFT_SIDE, options) || selector.right.subject && _left3(node, ancestry, options) && adjacent(node, _right3, ancestry, RIGHT_SIDE, options);
          };
        }
      case 'nth-child':
        {
          var nth = selector.index.value;
          var _right4 = getMatcher(selector.right);
          return function (node, ancestry, options) {
            return _right4(node, ancestry, options) && nthChild(node, ancestry, nth, options);
          };
        }
      case 'nth-last-child':
        {
          var _nth = -selector.index.value;
          var _right5 = getMatcher(selector.right);
          return function (node, ancestry, options) {
            return _right5(node, ancestry, options) && nthChild(node, ancestry, _nth, options);
          };
        }
      case 'class':
        {
          var name = selector.name.toLowerCase();
          return function (node, ancestry, options) {
            if (options && options.matchClass) {
              return options.matchClass(selector.name, node, ancestry);
            }
            if (options && options.nodeTypeKey) return false;
            switch (name) {
              case 'statement':
                if (node.type.slice(-9) === 'Statement') return true;
              // fallthrough: interface Declaration <: Statement { }
              case 'declaration':
                return node.type.slice(-11) === 'Declaration';
              case 'pattern':
                if (node.type.slice(-7) === 'Pattern') return true;
              // fallthrough: interface Expression <: Node, Pattern { }
              case 'expression':
                return node.type.slice(-10) === 'Expression' || node.type.slice(-7) === 'Literal' || node.type === 'Identifier' && (ancestry.length === 0 || ancestry[0].type !== 'MetaProperty') || node.type === 'MetaProperty';
              case 'function':
                return node.type === 'FunctionDeclaration' || node.type === 'FunctionExpression' || node.type === 'ArrowFunctionExpression';
            }
            throw new Error("Unknown class name: ".concat(selector.name));
          };
        }
    }
    throw new Error("Unknown selector type: ".concat(selector.type));
  }

  /**
   * @callback TraverseOptionFallback
   * @param {external:AST} node The given node.
   * @returns {string[]} An array of visitor keys for the given node.
   */

  /**
   * @callback ClassMatcher
   * @param {string} className The name of the class to match.
   * @param {external:AST} node The node to match against.
   * @param {Array<external:AST>} ancestry The ancestry of the node.
   * @returns {boolean} True if the node matches the class, false if not.
   */

  /**
   * @typedef {object} ESQueryOptions
   * @property {string} [nodeTypeKey="type"] By passing `nodeTypeKey`, we can allow other ASTs to use ESQuery.
   * @property { { [nodeType: string]: string[] } } [visitorKeys] By passing `visitorKeys` mapping, we can extend the properties of the nodes that traverse the node.
   * @property {TraverseOptionFallback} [fallback] By passing `fallback` option, we can control the properties of traversing nodes when encountering unknown nodes.
   * @property {ClassMatcher} [matchClass] By passing `matchClass` option, we can customize the interpretation of classes.
   */

  /**
   * Given a `node` and its ancestors, determine if `node` is matched
   * by `selector`.
   * @param {?external:AST} node
   * @param {?SelectorAST} selector
   * @param {external:AST[]} [ancestry=[]]
   * @param {ESQueryOptions} [options]
   * @throws {Error} Unknowns (operator, class name, selector type, or
   * selector value type)
   * @returns {boolean}
   */
  function matches(node, selector, ancestry, options) {
    if (!selector) {
      return true;
    }
    if (!node) {
      return false;
    }
    if (!ancestry) {
      ancestry = [];
    }
    return getMatcher(selector)(node, ancestry, options);
  }

  /**
   * Get visitor keys of a given node.
   * @param {external:AST} node The AST node to get keys.
   * @param {ESQueryOptions|undefined} options
   * @returns {string[]} Visitor keys of the node.
   */
  function getVisitorKeys(node, options) {
    var nodeTypeKey = options && options.nodeTypeKey || 'type';
    var nodeType = node[nodeTypeKey];
    if (options && options.visitorKeys && options.visitorKeys[nodeType]) {
      return options.visitorKeys[nodeType];
    }
    if (estraverse.VisitorKeys[nodeType]) {
      return estraverse.VisitorKeys[nodeType];
    }
    if (options && typeof options.fallback === 'function') {
      return options.fallback(node);
    }
    // 'iteration' fallback
    return Object.keys(node).filter(function (key) {
      return key !== nodeTypeKey;
    });
  }

  /**
   * Check whether the given value is an ASTNode or not.
   * @param {any} node The value to check.
   * @param {ESQueryOptions|undefined} options The options to use.
   * @returns {boolean} `true` if the value is an ASTNode.
   */
  function isNode(node, options) {
    var nodeTypeKey = options && options.nodeTypeKey || 'type';
    return node !== null && _typeof(node) === 'object' && typeof node[nodeTypeKey] === 'string';
  }

  /**
   * Determines if the given node has a sibling that matches the
   * given selector matcher.
   * @param {external:AST} node
   * @param {SelectorMatcher} matcher
   * @param {external:AST[]} ancestry
   * @param {Side} side
   * @param {ESQueryOptions|undefined} options
   * @returns {boolean}
   */
  function sibling(node, matcher, ancestry, side, options) {
    var _ancestry = _slicedToArray(ancestry, 1),
      parent = _ancestry[0];
    if (!parent) {
      return false;
    }
    var keys = getVisitorKeys(parent, options);
    for (var i = 0; i < keys.length; ++i) {
      var listProp = parent[keys[i]];
      if (Array.isArray(listProp)) {
        var startIndex = listProp.indexOf(node);
        if (startIndex < 0) {
          continue;
        }
        var lowerBound = void 0,
          upperBound = void 0;
        if (side === LEFT_SIDE) {
          lowerBound = 0;
          upperBound = startIndex;
        } else {
          lowerBound = startIndex + 1;
          upperBound = listProp.length;
        }
        for (var k = lowerBound; k < upperBound; ++k) {
          if (isNode(listProp[k], options) && matcher(listProp[k], ancestry, options)) {
            return true;
          }
        }
      }
    }
    return false;
  }

  /**
   * Determines if the given node has an adjacent sibling that matches
   * the given selector matcher.
   * @param {external:AST} node
   * @param {SelectorMatcher} matcher
   * @param {external:AST[]} ancestry
   * @param {Side} side
   * @param {ESQueryOptions|undefined} options
   * @returns {boolean}
   */
  function adjacent(node, matcher, ancestry, side, options) {
    var _ancestry2 = _slicedToArray(ancestry, 1),
      parent = _ancestry2[0];
    if (!parent) {
      return false;
    }
    var keys = getVisitorKeys(parent, options);
    for (var i = 0; i < keys.length; ++i) {
      var listProp = parent[keys[i]];
      if (Array.isArray(listProp)) {
        var idx = listProp.indexOf(node);
        if (idx < 0) {
          continue;
        }
        if (side === LEFT_SIDE && idx > 0 && isNode(listProp[idx - 1], options) && matcher(listProp[idx - 1], ancestry, options)) {
          return true;
        }
        if (side === RIGHT_SIDE && idx < listProp.length - 1 && isNode(listProp[idx + 1], options) && matcher(listProp[idx + 1], ancestry, options)) {
          return true;
        }
      }
    }
    return false;
  }

  /**
   * Determines if the given node is the `nth` child.
   * If `nth` is negative then the position is counted
   * from the end of the list of children.
   * @param {external:AST} node
   * @param {external:AST[]} ancestry
   * @param {Integer} nth
   * @param {ESQueryOptions|undefined} options
   * @returns {boolean}
   */
  function nthChild(node, ancestry, nth, options) {
    if (nth === 0) {
      return false;
    }
    var _ancestry3 = _slicedToArray(ancestry, 1),
      parent = _ancestry3[0];
    if (!parent) {
      return false;
    }
    var keys = getVisitorKeys(parent, options);
    for (var i = 0; i < keys.length; ++i) {
      var listProp = parent[keys[i]];
      if (Array.isArray(listProp)) {
        var idx = nth < 0 ? listProp.length + nth : nth - 1;
        if (idx >= 0 && idx < listProp.length && listProp[idx] === node) {
          return true;
        }
      }
    }
    return false;
  }

  /**
   * For each selector node marked as a subject, find the portion of the
   * selector that the subject must match.
   * @param {SelectorAST} selector
   * @param {SelectorAST} [ancestor] Defaults to `selector`
   * @returns {SelectorAST[]}
   */
  function subjects(selector, ancestor) {
    if (selector == null || _typeof(selector) != 'object') {
      return [];
    }
    if (ancestor == null) {
      ancestor = selector;
    }
    var results = selector.subject ? [ancestor] : [];
    var keys = Object.keys(selector);
    for (var i = 0; i < keys.length; ++i) {
      var p = keys[i];
      var sel = selector[p];
      results.push.apply(results, _toConsumableArray(subjects(sel, p === 'left' ? sel : ancestor)));
    }
    return results;
  }

  /**
  * @callback TraverseVisitor
  * @param {?external:AST} node
  * @param {?external:AST} parent
  * @param {external:AST[]} ancestry
  */

  /**
   * From a JS AST and a selector AST, collect all JS AST nodes that
   * match the selector.
   * @param {external:AST} ast
   * @param {?SelectorAST} selector
   * @param {TraverseVisitor} visitor
   * @param {ESQueryOptions} [options]
   * @returns {external:AST[]}
   */
  function traverse(ast, selector, visitor, options) {
    if (!selector) {
      return;
    }
    var ancestry = [];
    var matcher = getMatcher(selector);
    var altSubjects = subjects(selector).map(getMatcher);
    estraverse.traverse(ast, {
      enter: function enter(node, parent) {
        if (parent != null) {
          ancestry.unshift(parent);
        }
        if (matcher(node, ancestry, options)) {
          if (altSubjects.length) {
            for (var i = 0, l = altSubjects.length; i < l; ++i) {
              if (altSubjects[i](node, ancestry, options)) {
                visitor(node, parent, ancestry);
              }
              for (var k = 0, m = ancestry.length; k < m; ++k) {
                var succeedingAncestry = ancestry.slice(k + 1);
                if (altSubjects[i](ancestry[k], succeedingAncestry, options)) {
                  visitor(ancestry[k], parent, succeedingAncestry);
                }
              }
            }
          } else {
            visitor(node, parent, ancestry);
          }
        }
      },
      leave: function leave() {
        ancestry.shift();
      },
      keys: options && options.visitorKeys,
      fallback: options && options.fallback || 'iteration'
    });
  }

  /**
   * From a JS AST and a selector AST, collect all JS AST nodes that
   * match the selector.
   * @param {external:AST} ast
   * @param {?SelectorAST} selector
   * @param {ESQueryOptions} [options]
   * @returns {external:AST[]}
   */
  function match(ast, selector, options) {
    var results = [];
    traverse(ast, selector, function (node) {
      results.push(node);
    }, options);
    return results;
  }

  /**
   * Parse a selector string and return its AST.
   * @param {string} selector
   * @returns {SelectorAST}
   */
  function parse(selector) {
    return parser.parse(selector);
  }

  /**
   * Query the code AST using the selector string.
   * @param {external:AST} ast
   * @param {string} selector
   * @param {ESQueryOptions} [options]
   * @returns {external:AST[]}
   */
  function query(ast, selector, options) {
    return match(ast, parse(selector), options);
  }
  query.parse = parse;
  query.match = match;
  query.traverse = traverse;
  query.matches = matches;
  query.query = query;

  return query;

})));
Iu
x[f!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("estraverse")):"function"==typeof define&&define.amd?define(["estraverse"],e):(t=t||self).esquery=e(t.estraverse)}(this,(function(t){"use strict";function e(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n}function r(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var r=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=r){var n,u,o,a,s=[],c=!0,i=!1;try{if(o=(r=r.call(t)).next,0===e){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=o.call(r)).done)&&(s.push(n.value),s.length!==e);c=!0);}catch(t){i=!0,u=t}finally{try{if(!c&&null!=r.return&&(a=r.return(),Object(a)!==a))return}finally{if(i)throw u}}return s}}(t,e)||o(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||o(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,r){if(t){if("string"==typeof t)return e(t,r);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}}t=t&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t;"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;var a=function(t,e){return t(e={exports:{}},e.exports),e.exports}((function(t){t.exports&&(t.exports=function(){function t(e,r,n,u){this.message=e,this.expected=r,this.found=n,this.location=u,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,t)}return function(t,e){function r(){this.constructor=t}r.prototype=e.prototype,t.prototype=new r}(t,Error),t.buildMessage=function(t,e){var r={literal:function(t){return'"'+u(t.text)+'"'},class:function(t){var e,r="";for(e=0;e<t.parts.length;e++)r+=t.parts[e]instanceof Array?o(t.parts[e][0])+"-"+o(t.parts[e][1]):o(t.parts[e]);return"["+(t.inverted?"^":"")+r+"]"},any:function(t){return"any character"},end:function(t){return"end of input"},other:function(t){return t.description}};function n(t){return t.charCodeAt(0).toString(16).toUpperCase()}function u(t){return t.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}function o(t){return t.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(t){return"\\x0"+n(t)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(t){return"\\x"+n(t)}))}return"Expected "+function(t){var e,n,u,o=new Array(t.length);for(e=0;e<t.length;e++)o[e]=(u=t[e],r[u.type](u));if(o.sort(),o.length>0){for(e=1,n=1;e<o.length;e++)o[e-1]!==o[e]&&(o[n]=o[e],n++);o.length=n}switch(o.length){case 1:return o[0];case 2:return o[0]+" or "+o[1];default:return o.slice(0,-1).join(", ")+", or "+o[o.length-1]}}(t)+" but "+function(t){return t?'"'+u(t)+'"':"end of input"}(e)+" found."},{SyntaxError:t,parse:function(e,r){r=void 0!==r?r:{};var n,u,o,a,s={},c={start:Pt},i=Pt,l=dt(" ",!1),f=/^[^ [\],():#!=><~+.]/,h=yt([" ","[","]",",","(",")",":","#","!","=",">","<","~","+","."],!0,!1),p=dt(">",!1),v=dt("~",!1),d=dt("+",!1),y=dt(",",!1),A=function(t,e){return[t].concat(e.map((function(t){return t[3]})))},x=dt("!",!1),g=dt("*",!1),P=dt("#",!1),m=dt("[",!1),b=dt("]",!1),C=/^[><!]/,w=yt([">","<","!"],!1,!1),j=dt("=",!1),E=function(t){return(t||"")+"="},S=/^[><]/,k=yt([">","<"],!1,!1),I=dt(".",!1),T=function(t,e,r){return{type:"attribute",name:t,operator:e,value:r}},F=dt('"',!1),K=/^[^\\"]/,D=yt(["\\",'"'],!0,!1),O=dt("\\",!1),L={type:"any"},R=function(t,e){return t+e},M=function(t){return{type:"literal",value:(e=t.join(""),e.replace(/\\(.)/g,(function(t,e){switch(e){case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";default:return e}})))};var e},U=dt("'",!1),_=/^[^\\']/,q=yt(["\\","'"],!0,!1),G=/^[0-9]/,H=yt([["0","9"]],!1,!1),N=dt("type(",!1),V=/^[^ )]/,W=yt([" ",")"],!0,!1),$=dt(")",!1),z=/^[imsu]/,B=yt(["i","m","s","u"],!1,!1),J=dt("/",!1),Q=/^[^\]\\]/,X=yt(["]","\\"],!0,!1),Y=/^[^\/\\[]/,Z=yt(["/","\\","["],!0,!1),tt=dt(":not(",!1),et=dt(":matches(",!1),rt=function(t){return{type:"matches",selectors:t}},nt=dt(":is(",!1),ut=dt(":has(",!1),ot=dt(":first-child",!1),at=dt(":last-child",!1),st=dt(":nth-child(",!1),ct=dt(":nth-last-child(",!1),it=dt(":",!1),lt=0,ft=[{line:1,column:1}],ht=0,pt=[],vt={};if("startRule"in r){if(!(r.startRule in c))throw new Error("Can't start parsing from rule \""+r.startRule+'".');i=c[r.startRule]}function dt(t,e){return{type:"literal",text:t,ignoreCase:e}}function yt(t,e,r){return{type:"class",parts:t,inverted:e,ignoreCase:r}}function At(t){var r,n=ft[t];if(n)return n;for(r=t-1;!ft[r];)r--;for(n={line:(n=ft[r]).line,column:n.column};r<t;)10===e.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return ft[t]=n,n}function xt(t,e){var r=At(t),n=At(e);return{start:{offset:t,line:r.line,column:r.column},end:{offset:e,line:n.line,column:n.column}}}function gt(t){lt<ht||(lt>ht&&(ht=lt,pt=[]),pt.push(t))}function Pt(){var t,e,r,n,u=36*lt+0,o=vt[u];return o?(lt=o.nextPos,o.result):(t=lt,(e=mt())!==s&&(r=wt())!==s&&mt()!==s?t=e=1===(n=r).length?n[0]:{type:"matches",selectors:n}:(lt=t,t=s),t===s&&(t=lt,(e=mt())!==s&&(e=void 0),t=e),vt[u]={nextPos:lt,result:t},t)}function mt(){var t,r,n=36*lt+1,u=vt[n];if(u)return lt=u.nextPos,u.result;for(t=[],32===e.charCodeAt(lt)?(r=" ",lt++):(r=s,gt(l));r!==s;)t.push(r),32===e.charCodeAt(lt)?(r=" ",lt++):(r=s,gt(l));return vt[n]={nextPos:lt,result:t},t}function bt(){var t,r,n,u=36*lt+2,o=vt[u];if(o)return lt=o.nextPos,o.result;if(r=[],f.test(e.charAt(lt))?(n=e.charAt(lt),lt++):(n=s,gt(h)),n!==s)for(;n!==s;)r.push(n),f.test(e.charAt(lt))?(n=e.charAt(lt),lt++):(n=s,gt(h));else r=s;return r!==s&&(r=r.join("")),t=r,vt[u]={nextPos:lt,result:t},t}function Ct(){var t,r,n,u=36*lt+3,o=vt[u];return o?(lt=o.nextPos,o.result):(t=lt,(r=mt())!==s?(62===e.charCodeAt(lt)?(n=">",lt++):(n=s,gt(p)),n!==s&&mt()!==s?t=r="child":(lt=t,t=s)):(lt=t,t=s),t===s&&(t=lt,(r=mt())!==s?(126===e.charCodeAt(lt)?(n="~",lt++):(n=s,gt(v)),n!==s&&mt()!==s?t=r="sibling":(lt=t,t=s)):(lt=t,t=s),t===s&&(t=lt,(r=mt())!==s?(43===e.charCodeAt(lt)?(n="+",lt++):(n=s,gt(d)),n!==s&&mt()!==s?t=r="adjacent":(lt=t,t=s)):(lt=t,t=s),t===s&&(t=lt,32===e.charCodeAt(lt)?(r=" ",lt++):(r=s,gt(l)),r!==s&&(n=mt())!==s?t=r="descendant":(lt=t,t=s)))),vt[u]={nextPos:lt,result:t},t)}function wt(){var t,r,n,u,o,a,c,i,l=36*lt+5,f=vt[l];if(f)return lt=f.nextPos,f.result;if(t=lt,(r=Et())!==s){for(n=[],u=lt,(o=mt())!==s?(44===e.charCodeAt(lt)?(a=",",lt++):(a=s,gt(y)),a!==s&&(c=mt())!==s&&(i=Et())!==s?u=o=[o,a,c,i]:(lt=u,u=s)):(lt=u,u=s);u!==s;)n.push(u),u=lt,(o=mt())!==s?(44===e.charCodeAt(lt)?(a=",",lt++):(a=s,gt(y)),a!==s&&(c=mt())!==s&&(i=Et())!==s?u=o=[o,a,c,i]:(lt=u,u=s)):(lt=u,u=s);n!==s?t=r=A(r,n):(lt=t,t=s)}else lt=t,t=s;return vt[l]={nextPos:lt,result:t},t}function jt(){var t,e,r,n,u,o=36*lt+6,a=vt[o];return a?(lt=a.nextPos,a.result):(t=lt,(e=Ct())===s&&(e=null),e!==s&&(r=Et())!==s?(u=r,t=e=(n=e)?{type:n,left:{type:"exactNode"},right:u}:u):(lt=t,t=s),vt[o]={nextPos:lt,result:t},t)}function Et(){var t,e,r,n,u,o,a,c=36*lt+7,i=vt[c];if(i)return lt=i.nextPos,i.result;if(t=lt,(e=St())!==s){for(r=[],n=lt,(u=Ct())!==s&&(o=St())!==s?n=u=[u,o]:(lt=n,n=s);n!==s;)r.push(n),n=lt,(u=Ct())!==s&&(o=St())!==s?n=u=[u,o]:(lt=n,n=s);r!==s?(a=e,t=e=r.reduce((function(t,e){return{type:e[0],left:t,right:e[1]}}),a)):(lt=t,t=s)}else lt=t,t=s;return vt[c]={nextPos:lt,result:t},t}function St(){var t,r,n,u,o,a,c,i=36*lt+8,l=vt[i];if(l)return lt=l.nextPos,l.result;if(t=lt,33===e.charCodeAt(lt)?(r="!",lt++):(r=s,gt(x)),r===s&&(r=null),r!==s){if(n=[],(u=kt())!==s)for(;u!==s;)n.push(u),u=kt();else n=s;n!==s?(o=r,c=1===(a=n).length?a[0]:{type:"compound",selectors:a},o&&(c.subject=!0),t=r=c):(lt=t,t=s)}else lt=t,t=s;return vt[i]={nextPos:lt,result:t},t}function kt(){var t,r=36*lt+9,n=vt[r];return n?(lt=n.nextPos,n.result):((t=function(){var t,r,n=36*lt+10,u=vt[n];return u?(lt=u.nextPos,u.result):(42===e.charCodeAt(lt)?(r="*",lt++):(r=s,gt(g)),r!==s&&(r={type:"wildcard",value:r}),t=r,vt[n]={nextPos:lt,result:t},t)}())===s&&(t=function(){var t,r,n,u=36*lt+11,o=vt[u];return o?(lt=o.nextPos,o.result):(t=lt,35===e.charCodeAt(lt)?(r="#",lt++):(r=s,gt(P)),r===s&&(r=null),r!==s&&(n=bt())!==s?t=r={type:"identifier",value:n}:(lt=t,t=s),vt[u]={nextPos:lt,result:t},t)}())===s&&(t=function(){var t,r,n,u,o=36*lt+12,a=vt[o];return a?(lt=a.nextPos,a.result):(t=lt,91===e.charCodeAt(lt)?(r="[",lt++):(r=s,gt(m)),r!==s&&mt()!==s&&(n=function(){var t,r,n,u,o=36*lt+16,a=vt[o];return a?(lt=a.nextPos,a.result):(t=lt,(r=It())!==s&&mt()!==s&&(n=function(){var t,r,n,u=36*lt+14,o=vt[u];return o?(lt=o.nextPos,o.result):(t=lt,33===e.charCodeAt(lt)?(r="!",lt++):(r=s,gt(x)),r===s&&(r=null),r!==s?(61===e.charCodeAt(lt)?(n="=",lt++):(n=s,gt(j)),n!==s?(r=E(r),t=r):(lt=t,t=s)):(lt=t,t=s),vt[u]={nextPos:lt,result:t},t)}())!==s&&mt()!==s?((u=function(){var t,r,n,u,o,a=36*lt+20,c=vt[a];if(c)return lt=c.nextPos,c.result;if(t=lt,"type("===e.substr(lt,5)?(r="type(",lt+=5):(r=s,gt(N)),r!==s)if(mt()!==s){if(n=[],V.test(e.charAt(lt))?(u=e.charAt(lt),lt++):(u=s,gt(W)),u!==s)for(;u!==s;)n.push(u),V.test(e.charAt(lt))?(u=e.charAt(lt),lt++):(u=s,gt(W));else n=s;n!==s&&(u=mt())!==s?(41===e.charCodeAt(lt)?(o=")",lt++):(o=s,gt($)),o!==s?(r={type:"type",value:n.join("")},t=r):(lt=t,t=s)):(lt=t,t=s)}else lt=t,t=s;else lt=t,t=s;return vt[a]={nextPos:lt,result:t},t}())===s&&(u=function(){var t,r,n,u,o,a,c=36*lt+22,i=vt[c];if(i)return lt=i.nextPos,i.result;if(t=lt,47===e.charCodeAt(lt)?(r="/",lt++):(r=s,gt(J)),r!==s){if(n=[],(u=Tt())===s&&(u=Ft())===s&&(u=Kt()),u!==s)for(;u!==s;)n.push(u),(u=Tt())===s&&(u=Ft())===s&&(u=Kt());else n=s;n!==s?(47===e.charCodeAt(lt)?(u="/",lt++):(u=s,gt(J)),u!==s?((o=function(){var t,r,n=36*lt+21,u=vt[n];if(u)return lt=u.nextPos,u.result;if(t=[],z.test(e.charAt(lt))?(r=e.charAt(lt),lt++):(r=s,gt(B)),r!==s)for(;r!==s;)t.push(r),z.test(e.charAt(lt))?(r=e.charAt(lt),lt++):(r=s,gt(B));else t=s;return vt[n]={nextPos:lt,result:t},t}())===s&&(o=null),o!==s?(a=o,r={type:"regexp",value:new RegExp(n.join(""),a?a.join(""):"")},t=r):(lt=t,t=s)):(lt=t,t=s)):(lt=t,t=s)}else lt=t,t=s;return vt[c]={nextPos:lt,result:t},t}()),u!==s?(r=T(r,n,u),t=r):(lt=t,t=s)):(lt=t,t=s),t===s&&(t=lt,(r=It())!==s&&mt()!==s&&(n=function(){var t,r,n,u=36*lt+13,o=vt[u];return o?(lt=o.nextPos,o.result):(t=lt,C.test(e.charAt(lt))?(r=e.charAt(lt),lt++):(r=s,gt(w)),r===s&&(r=null),r!==s?(61===e.charCodeAt(lt)?(n="=",lt++):(n=s,gt(j)),n!==s?(r=E(r),t=r):(lt=t,t=s)):(lt=t,t=s),t===s&&(S.test(e.charAt(lt))?(t=e.charAt(lt),lt++):(t=s,gt(k))),vt[u]={nextPos:lt,result:t},t)}())!==s&&mt()!==s?((u=function(){var t,r,n,u,o,a,c=36*lt+17,i=vt[c];if(i)return lt=i.nextPos,i.result;if(t=lt,34===e.charCodeAt(lt)?(r='"',lt++):(r=s,gt(F)),r!==s){for(n=[],K.test(e.charAt(lt))?(u=e.charAt(lt),lt++):(u=s,gt(D)),u===s&&(u=lt,92===e.charCodeAt(lt)?(o="\\",lt++):(o=s,gt(O)),o!==s?(e.length>lt?(a=e.charAt(lt),lt++):(a=s,gt(L)),a!==s?(o=R(o,a),u=o):(lt=u,u=s)):(lt=u,u=s));u!==s;)n.push(u),K.test(e.charAt(lt))?(u=e.charAt(lt),lt++):(u=s,gt(D)),u===s&&(u=lt,92===e.charCodeAt(lt)?(o="\\",lt++):(o=s,gt(O)),o!==s?(e.length>lt?(a=e.charAt(lt),lt++):(a=s,gt(L)),a!==s?(o=R(o,a),u=o):(lt=u,u=s)):(lt=u,u=s));n!==s?(34===e.charCodeAt(lt)?(u='"',lt++):(u=s,gt(F)),u!==s?(r=M(n),t=r):(lt=t,t=s)):(lt=t,t=s)}else lt=t,t=s;if(t===s)if(t=lt,39===e.charCodeAt(lt)?(r="'",lt++):(r=s,gt(U)),r!==s){for(n=[],_.test(e.charAt(lt))?(u=e.charAt(lt),lt++):(u=s,gt(q)),u===s&&(u=lt,92===e.charCodeAt(lt)?(o="\\",lt++):(o=s,gt(O)),o!==s?(e.length>lt?(a=e.charAt(lt),lt++):(a=s,gt(L)),a!==s?(o=R(o,a),u=o):(lt=u,u=s)):(lt=u,u=s));u!==s;)n.push(u),_.test(e.charAt(lt))?(u=e.charAt(lt),lt++):(u=s,gt(q)),u===s&&(u=lt,92===e.charCodeAt(lt)?(o="\\",lt++):(o=s,gt(O)),o!==s?(e.length>lt?(a=e.charAt(lt),lt++):(a=s,gt(L)),a!==s?(o=R(o,a),u=o):(lt=u,u=s)):(lt=u,u=s));n!==s?(39===e.charCodeAt(lt)?(u="'",lt++):(u=s,gt(U)),u!==s?(r=M(n),t=r):(lt=t,t=s)):(lt=t,t=s)}else lt=t,t=s;return vt[c]={nextPos:lt,result:t},t}())===s&&(u=function(){var t,r,n,u,o,a,c,i=36*lt+18,l=vt[i];if(l)return lt=l.nextPos,l.result;for(t=lt,r=lt,n=[],G.test(e.charAt(lt))?(u=e.charAt(lt),lt++):(u=s,gt(H));u!==s;)n.push(u),G.test(e.charAt(lt))?(u=e.charAt(lt),lt++):(u=s,gt(H));if(n!==s?(46===e.charCodeAt(lt)?(u=".",lt++):(u=s,gt(I)),u!==s?r=n=[n,u]:(lt=r,r=s)):(lt=r,r=s),r===s&&(r=null),r!==s){if(n=[],G.test(e.charAt(lt))?(u=e.charAt(lt),lt++):(u=s,gt(H)),u!==s)for(;u!==s;)n.push(u),G.test(e.charAt(lt))?(u=e.charAt(lt),lt++):(u=s,gt(H));else n=s;n!==s?(a=n,c=(o=r)?[].concat.apply([],o).join(""):"",r={type:"literal",value:parseFloat(c+a.join(""))},t=r):(lt=t,t=s)}else lt=t,t=s;return vt[i]={nextPos:lt,result:t},t}())===s&&(u=function(){var t,e,r=36*lt+19,n=vt[r];return n?(lt=n.nextPos,n.result):((e=bt())!==s&&(e={type:"literal",value:e}),t=e,vt[r]={nextPos:lt,result:t},t)}()),u!==s?(r=T(r,n,u),t=r):(lt=t,t=s)):(lt=t,t=s),t===s&&(t=lt,(r=It())!==s&&(r={type:"attribute",name:r}),t=r)),vt[o]={nextPos:lt,result:t},t)}())!==s&&mt()!==s?(93===e.charCodeAt(lt)?(u="]",lt++):(u=s,gt(b)),u!==s?t=r=n:(lt=t,t=s)):(lt=t,t=s),vt[o]={nextPos:lt,result:t},t)}())===s&&(t=function(){var t,r,n,u,o,a,c,i,l=36*lt+26,f=vt[l];if(f)return lt=f.nextPos,f.result;if(t=lt,46===e.charCodeAt(lt)?(r=".",lt++):(r=s,gt(I)),r!==s)if((n=bt())!==s){for(u=[],o=lt,46===e.charCodeAt(lt)?(a=".",lt++):(a=s,gt(I)),a!==s&&(c=bt())!==s?o=a=[a,c]:(lt=o,o=s);o!==s;)u.push(o),o=lt,46===e.charCodeAt(lt)?(a=".",lt++):(a=s,gt(I)),a!==s&&(c=bt())!==s?o=a=[a,c]:(lt=o,o=s);u!==s?(i=n,r={type:"field",name:u.reduce((function(t,e){return t+e[0]+e[1]}),i)},t=r):(lt=t,t=s)}else lt=t,t=s;else lt=t,t=s;return vt[l]={nextPos:lt,result:t},t}())===s&&(t=function(){var t,r,n,u,o=36*lt+27,a=vt[o];return a?(lt=a.nextPos,a.result):(t=lt,":not("===e.substr(lt,5)?(r=":not(",lt+=5):(r=s,gt(tt)),r!==s&&mt()!==s&&(n=wt())!==s&&mt()!==s?(41===e.charCodeAt(lt)?(u=")",lt++):(u=s,gt($)),u!==s?t=r={type:"not",selectors:n}:(lt=t,t=s)):(lt=t,t=s),vt[o]={nextPos:lt,result:t},t)}())===s&&(t=function(){var t,r,n,u,o=36*lt+28,a=vt[o];return a?(lt=a.nextPos,a.result):(t=lt,":matches("===e.substr(lt,9)?(r=":matches(",lt+=9):(r=s,gt(et)),r!==s&&mt()!==s&&(n=wt())!==s&&mt()!==s?(41===e.charCodeAt(lt)?(u=")",lt++):(u=s,gt($)),u!==s?(r=rt(n),t=r):(lt=t,t=s)):(lt=t,t=s),vt[o]={nextPos:lt,result:t},t)}())===s&&(t=function(){var t,r,n,u,o=36*lt+29,a=vt[o];return a?(lt=a.nextPos,a.result):(t=lt,":is("===e.substr(lt,4)?(r=":is(",lt+=4):(r=s,gt(nt)),r!==s&&mt()!==s&&(n=wt())!==s&&mt()!==s?(41===e.charCodeAt(lt)?(u=")",lt++):(u=s,gt($)),u!==s?(r=rt(n),t=r):(lt=t,t=s)):(lt=t,t=s),vt[o]={nextPos:lt,result:t},t)}())===s&&(t=function(){var t,r,n,u,o=36*lt+30,a=vt[o];return a?(lt=a.nextPos,a.result):(t=lt,":has("===e.substr(lt,5)?(r=":has(",lt+=5):(r=s,gt(ut)),r!==s&&mt()!==s&&(n=function(){var t,r,n,u,o,a,c,i,l=36*lt+4,f=vt[l];if(f)return lt=f.nextPos,f.result;if(t=lt,(r=jt())!==s){for(n=[],u=lt,(o=mt())!==s?(44===e.charCodeAt(lt)?(a=",",lt++):(a=s,gt(y)),a!==s&&(c=mt())!==s&&(i=jt())!==s?u=o=[o,a,c,i]:(lt=u,u=s)):(lt=u,u=s);u!==s;)n.push(u),u=lt,(o=mt())!==s?(44===e.charCodeAt(lt)?(a=",",lt++):(a=s,gt(y)),a!==s&&(c=mt())!==s&&(i=jt())!==s?u=o=[o,a,c,i]:(lt=u,u=s)):(lt=u,u=s);n!==s?t=r=A(r,n):(lt=t,t=s)}else lt=t,t=s;return vt[l]={nextPos:lt,result:t},t}())!==s&&mt()!==s?(41===e.charCodeAt(lt)?(u=")",lt++):(u=s,gt($)),u!==s?t=r={type:"has",selectors:n}:(lt=t,t=s)):(lt=t,t=s),vt[o]={nextPos:lt,result:t},t)}())===s&&(t=function(){var t,r,n=36*lt+31,u=vt[n];return u?(lt=u.nextPos,u.result):(":first-child"===e.substr(lt,12)?(r=":first-child",lt+=12):(r=s,gt(ot)),r!==s&&(r=Dt(1)),t=r,vt[n]={nextPos:lt,result:t},t)}())===s&&(t=function(){var t,r,n=36*lt+32,u=vt[n];return u?(lt=u.nextPos,u.result):(":last-child"===e.substr(lt,11)?(r=":last-child",lt+=11):(r=s,gt(at)),r!==s&&(r=Ot(1)),t=r,vt[n]={nextPos:lt,result:t},t)}())===s&&(t=function(){var t,r,n,u,o,a=36*lt+33,c=vt[a];if(c)return lt=c.nextPos,c.result;if(t=lt,":nth-child("===e.substr(lt,11)?(r=":nth-child(",lt+=11):(r=s,gt(st)),r!==s)if(mt()!==s){if(n=[],G.test(e.charAt(lt))?(u=e.charAt(lt),lt++):(u=s,gt(H)),u!==s)for(;u!==s;)n.push(u),G.test(e.charAt(lt))?(u=e.charAt(lt),lt++):(u=s,gt(H));else n=s;n!==s&&(u=mt())!==s?(41===e.charCodeAt(lt)?(o=")",lt++):(o=s,gt($)),o!==s?(r=Dt(parseInt(n.join(""),10)),t=r):(lt=t,t=s)):(lt=t,t=s)}else lt=t,t=s;else lt=t,t=s;return vt[a]={nextPos:lt,result:t},t}())===s&&(t=function(){var t,r,n,u,o,a=36*lt+34,c=vt[a];if(c)return lt=c.nextPos,c.result;if(t=lt,":nth-last-child("===e.substr(lt,16)?(r=":nth-last-child(",lt+=16):(r=s,gt(ct)),r!==s)if(mt()!==s){if(n=[],G.test(e.charAt(lt))?(u=e.charAt(lt),lt++):(u=s,gt(H)),u!==s)for(;u!==s;)n.push(u),G.test(e.charAt(lt))?(u=e.charAt(lt),lt++):(u=s,gt(H));else n=s;n!==s&&(u=mt())!==s?(41===e.charCodeAt(lt)?(o=")",lt++):(o=s,gt($)),o!==s?(r=Ot(parseInt(n.join(""),10)),t=r):(lt=t,t=s)):(lt=t,t=s)}else lt=t,t=s;else lt=t,t=s;return vt[a]={nextPos:lt,result:t},t}())===s&&(t=function(){var t,r,n,u=36*lt+35,o=vt[u];return o?(lt=o.nextPos,o.result):(t=lt,58===e.charCodeAt(lt)?(r=":",lt++):(r=s,gt(it)),r!==s&&(n=bt())!==s?t=r={type:"class",name:n}:(lt=t,t=s),vt[u]={nextPos:lt,result:t},t)}()),vt[r]={nextPos:lt,result:t},t)}function It(){var t,r,n,u,o,a,c,i,l=36*lt+15,f=vt[l];if(f)return lt=f.nextPos,f.result;if(t=lt,(r=bt())!==s){for(n=[],u=lt,46===e.charCodeAt(lt)?(o=".",lt++):(o=s,gt(I)),o!==s&&(a=bt())!==s?u=o=[o,a]:(lt=u,u=s);u!==s;)n.push(u),u=lt,46===e.charCodeAt(lt)?(o=".",lt++):(o=s,gt(I)),o!==s&&(a=bt())!==s?u=o=[o,a]:(lt=u,u=s);n!==s?(c=r,i=n,t=r=[].concat.apply([c],i).join("")):(lt=t,t=s)}else lt=t,t=s;return vt[l]={nextPos:lt,result:t},t}function Tt(){var t,r,n,u,o=36*lt+23,a=vt[o];if(a)return lt=a.nextPos,a.result;if(t=lt,91===e.charCodeAt(lt)?(r="[",lt++):(r=s,gt(m)),r!==s){if(n=[],Q.test(e.charAt(lt))?(u=e.charAt(lt),lt++):(u=s,gt(X)),u===s&&(u=Ft()),u!==s)for(;u!==s;)n.push(u),Q.test(e.charAt(lt))?(u=e.charAt(lt),lt++):(u=s,gt(X)),u===s&&(u=Ft());else n=s;n!==s?(93===e.charCodeAt(lt)?(u="]",lt++):(u=s,gt(b)),u!==s?t=r="["+n.join("")+"]":(lt=t,t=s)):(lt=t,t=s)}else lt=t,t=s;return vt[o]={nextPos:lt,result:t},t}function Ft(){var t,r,n,u=36*lt+24,o=vt[u];return o?(lt=o.nextPos,o.result):(t=lt,92===e.charCodeAt(lt)?(r="\\",lt++):(r=s,gt(O)),r!==s?(e.length>lt?(n=e.charAt(lt),lt++):(n=s,gt(L)),n!==s?t=r="\\"+n:(lt=t,t=s)):(lt=t,t=s),vt[u]={nextPos:lt,result:t},t)}function Kt(){var t,r,n,u=36*lt+25,o=vt[u];if(o)return lt=o.nextPos,o.result;if(r=[],Y.test(e.charAt(lt))?(n=e.charAt(lt),lt++):(n=s,gt(Z)),n!==s)for(;n!==s;)r.push(n),Y.test(e.charAt(lt))?(n=e.charAt(lt),lt++):(n=s,gt(Z));else r=s;return r!==s&&(r=r.join("")),t=r,vt[u]={nextPos:lt,result:t},t}function Dt(t){return{type:"nth-child",index:{type:"literal",value:t}}}function Ot(t){return{type:"nth-last-child",index:{type:"literal",value:t}}}if((n=i())!==s&&lt===e.length)return n;throw n!==s&&lt<e.length&&gt({type:"end"}),u=pt,o=ht<e.length?e.charAt(ht):null,a=ht<e.length?xt(ht,ht+1):xt(ht,ht),new t(t.buildMessage(u,o),u,o,a)}}}())}));function s(t,e){for(var r=0;r<e.length;++r){if(null==t)return t;t=t[e[r]]}return t}var c="function"==typeof WeakMap?new WeakMap:null;function i(t){if(null==t)return function(){return!0};if(null!=c){var e=c.get(t);return null!=e||(e=l(t),c.set(t,e)),e}return l(t)}function l(e){switch(e.type){case"wildcard":return function(){return!0};case"identifier":var r=e.value.toLowerCase();return function(t,e,n){var u=n&&n.nodeTypeKey||"type";return r===t[u].toLowerCase()};case"exactNode":return function(t,e){return 0===e.length};case"field":var n=e.name.split(".");return function(t,e){return function t(e,r,n,u){for(var o=r,a=u;a<n.length;++a){if(null==o)return!1;var s=o[n[a]];if(Array.isArray(s)){for(var c=0;c<s.length;++c)if(t(e,s[c],n,a+1))return!0;return!1}o=s}return e===o}(t,e[n.length-1],n,0)};case"matches":var o=e.selectors.map(i);return function(t,e,r){for(var n=0;n<o.length;++n)if(o[n](t,e,r))return!0;return!1};case"compound":var a=e.selectors.map(i);return function(t,e,r){for(var n=0;n<a.length;++n)if(!a[n](t,e,r))return!1;return!0};case"not":var c=e.selectors.map(i);return function(t,e,r){for(var n=0;n<c.length;++n)if(c[n](t,e,r))return!1;return!0};case"has":var l=e.selectors.map(i);return function(e,r,n){var u=!1,o=[];return t.traverse(e,{enter:function(t,e){null!=e&&o.unshift(e);for(var r=0;r<l.length;++r)if(l[r](t,o,n))return u=!0,void this.break()},leave:function(){o.shift()},keys:n&&n.visitorKeys,fallback:n&&n.fallback||"iteration"}),u};case"child":var f=i(e.left),h=i(e.right);return function(t,e,r){return!!(e.length>0&&h(t,e,r))&&f(e[0],e.slice(1),r)};case"descendant":var y=i(e.left),A=i(e.right);return function(t,e,r){if(A(t,e,r))for(var n=0,u=e.length;n<u;++n)if(y(e[n],e.slice(n+1),r))return!0;return!1};case"attribute":var x=e.name.split(".");switch(e.operator){case void 0:return function(t){return null!=s(t,x)};case"=":switch(e.value.type){case"regexp":return function(t){var r=s(t,x);return"string"==typeof r&&e.value.value.test(r)};case"literal":var g="".concat(e.value.value);return function(t){return g==="".concat(s(t,x))};case"type":return function(t){return e.value.value===u(s(t,x))}}throw new Error("Unknown selector value type: ".concat(e.value.type));case"!=":switch(e.value.type){case"regexp":return function(t){return!e.value.value.test(s(t,x))};case"literal":var P="".concat(e.value.value);return function(t){return P!=="".concat(s(t,x))};case"type":return function(t){return e.value.value!==u(s(t,x))}}throw new Error("Unknown selector value type: ".concat(e.value.type));case"<=":return function(t){return s(t,x)<=e.value.value};case"<":return function(t){return s(t,x)<e.value.value};case">":return function(t){return s(t,x)>e.value.value};case">=":return function(t){return s(t,x)>=e.value.value}}throw new Error("Unknown operator: ".concat(e.operator));case"sibling":var m=i(e.left),b=i(e.right);return function(t,r,n){return b(t,r,n)&&p(t,m,r,"LEFT_SIDE",n)||e.left.subject&&m(t,r,n)&&p(t,b,r,"RIGHT_SIDE",n)};case"adjacent":var C=i(e.left),w=i(e.right);return function(t,r,n){return w(t,r,n)&&v(t,C,r,"LEFT_SIDE",n)||e.right.subject&&C(t,r,n)&&v(t,w,r,"RIGHT_SIDE",n)};case"nth-child":var j=e.index.value,E=i(e.right);return function(t,e,r){return E(t,e,r)&&d(t,e,j,r)};case"nth-last-child":var S=-e.index.value,k=i(e.right);return function(t,e,r){return k(t,e,r)&&d(t,e,S,r)};case"class":var I=e.name.toLowerCase();return function(t,r,n){if(n&&n.matchClass)return n.matchClass(e.name,t,r);if(n&&n.nodeTypeKey)return!1;switch(I){case"statement":if("Statement"===t.type.slice(-9))return!0;case"declaration":return"Declaration"===t.type.slice(-11);case"pattern":if("Pattern"===t.type.slice(-7))return!0;case"expression":return"Expression"===t.type.slice(-10)||"Literal"===t.type.slice(-7)||"Identifier"===t.type&&(0===r.length||"MetaProperty"!==r[0].type)||"MetaProperty"===t.type;case"function":return"FunctionDeclaration"===t.type||"FunctionExpression"===t.type||"ArrowFunctionExpression"===t.type}throw new Error("Unknown class name: ".concat(e.name))}}throw new Error("Unknown selector type: ".concat(e.type))}function f(e,r){var n=r&&r.nodeTypeKey||"type",u=e[n];return r&&r.visitorKeys&&r.visitorKeys[u]?r.visitorKeys[u]:t.VisitorKeys[u]?t.VisitorKeys[u]:r&&"function"==typeof r.fallback?r.fallback(e):Object.keys(e).filter((function(t){return t!==n}))}function h(t,e){var r=e&&e.nodeTypeKey||"type";return null!==t&&"object"===u(t)&&"string"==typeof t[r]}function p(t,e,n,u,o){var a=r(n,1)[0];if(!a)return!1;for(var s=f(a,o),c=0;c<s.length;++c){var i=a[s[c]];if(Array.isArray(i)){var l=i.indexOf(t);if(l<0)continue;var p=void 0,v=void 0;"LEFT_SIDE"===u?(p=0,v=l):(p=l+1,v=i.length);for(var d=p;d<v;++d)if(h(i[d],o)&&e(i[d],n,o))return!0}}return!1}function v(t,e,n,u,o){var a=r(n,1)[0];if(!a)return!1;for(var s=f(a,o),c=0;c<s.length;++c){var i=a[s[c]];if(Array.isArray(i)){var l=i.indexOf(t);if(l<0)continue;if("LEFT_SIDE"===u&&l>0&&h(i[l-1],o)&&e(i[l-1],n,o))return!0;if("RIGHT_SIDE"===u&&l<i.length-1&&h(i[l+1],o)&&e(i[l+1],n,o))return!0}}return!1}function d(t,e,n,u){if(0===n)return!1;var o=r(e,1)[0];if(!o)return!1;for(var a=f(o,u),s=0;s<a.length;++s){var c=o[a[s]];if(Array.isArray(c)){var i=n<0?c.length+n:n-1;if(i>=0&&i<c.length&&c[i]===t)return!0}}return!1}function y(e,r,o,a){if(r){var s=[],c=i(r),l=function t(e,r){if(null==e||"object"!=u(e))return[];null==r&&(r=e);for(var o=e.subject?[r]:[],a=Object.keys(e),s=0;s<a.length;++s){var c=a[s],i=e[c];o.push.apply(o,n(t(i,"left"===c?i:r)))}return o}(r).map(i);t.traverse(e,{enter:function(t,e){if(null!=e&&s.unshift(e),c(t,s,a))if(l.length)for(var r=0,n=l.length;r<n;++r){l[r](t,s,a)&&o(t,e,s);for(var u=0,i=s.length;u<i;++u){var f=s.slice(u+1);l[r](s[u],f,a)&&o(s[u],e,f)}}else o(t,e,s)},leave:function(){s.shift()},keys:a&&a.visitorKeys,fallback:a&&a.fallback||"iteration"})}}function A(t,e,r){var n=[];return y(t,e,(function(t){n.push(t)}),r),n}function x(t){return a.parse(t)}function g(t,e,r){return A(t,x(e),r)}return g.parse=x,g.match=A,g.traverse=y,g.matches=function(t,e,r,n){return!e||!!t&&(r||(r=[]),i(e)(t,r,n))},g.query=g,g}));
//# sourceMappingURL=esquery.lite.min.js.map
RΑ¼Hx   {"version":3,"file":"esquery.lite.min.js","sources":["../parser.js","../esquery.js"],"sourcesContent":["/*\n * Generated by PEG.js 0.10.0.\n *\n * http://pegjs.org/\n */\n(function(root, factory) {\n  if (typeof define === \"function\" && define.amd) {\n    define([], factory);\n  } else if (typeof module === \"object\" && module.exports) {\n    module.exports = factory();\n  }\n})(this, function() {\n  \"use strict\";\n\n  function peg$subclass(child, parent) {\n    function ctor() { this.constructor = child; }\n    ctor.prototype = parent.prototype;\n    child.prototype = new ctor();\n  }\n\n  function peg$SyntaxError(message, expected, found, location) {\n    this.message  = message;\n    this.expected = expected;\n    this.found    = found;\n    this.location = location;\n    this.name     = \"SyntaxError\";\n\n    if (typeof Error.captureStackTrace === \"function\") {\n      Error.captureStackTrace(this, peg$SyntaxError);\n    }\n  }\n\n  peg$subclass(peg$SyntaxError, Error);\n\n  peg$SyntaxError.buildMessage = function(expected, found) {\n    var DESCRIBE_EXPECTATION_FNS = {\n          literal: function(expectation) {\n            return \"\\\"\" + literalEscape(expectation.text) + \"\\\"\";\n          },\n\n          \"class\": function(expectation) {\n            var escapedParts = \"\",\n                i;\n\n            for (i = 0; i < expectation.parts.length; i++) {\n              escapedParts += expectation.parts[i] instanceof Array\n                ? classEscape(expectation.parts[i][0]) + \"-\" + classEscape(expectation.parts[i][1])\n                : classEscape(expectation.parts[i]);\n            }\n\n            return \"[\" + (expectation.inverted ? \"^\" : \"\") + escapedParts + \"]\";\n          },\n\n          any: function(expectation) {\n            return \"any character\";\n          },\n\n          end: function(expectation) {\n            return \"end of input\";\n          },\n\n          other: function(expectation) {\n            return expectation.description;\n          }\n        };\n\n    function hex(ch) {\n      return ch.charCodeAt(0).toString(16).toUpperCase();\n    }\n\n    function literalEscape(s) {\n      return s\n        .replace(/\\\\/g, '\\\\\\\\')\n        .replace(/\"/g,  '\\\\\"')\n        .replace(/\\0/g, '\\\\0')\n        .replace(/\\t/g, '\\\\t')\n        .replace(/\\n/g, '\\\\n')\n        .replace(/\\r/g, '\\\\r')\n        .replace(/[\\x00-\\x0F]/g,          function(ch) { return '\\\\x0' + hex(ch); })\n        .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return '\\\\x'  + hex(ch); });\n    }\n\n    function classEscape(s) {\n      return s\n        .replace(/\\\\/g, '\\\\\\\\')\n        .replace(/\\]/g, '\\\\]')\n        .replace(/\\^/g, '\\\\^')\n        .replace(/-/g,  '\\\\-')\n        .replace(/\\0/g, '\\\\0')\n        .replace(/\\t/g, '\\\\t')\n        .replace(/\\n/g, '\\\\n')\n        .replace(/\\r/g, '\\\\r')\n        .replace(/[\\x00-\\x0F]/g,          function(ch) { return '\\\\x0' + hex(ch); })\n        .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return '\\\\x'  + hex(ch); });\n    }\n\n    function describeExpectation(expectation) {\n      return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);\n    }\n\n    function describeExpected(expected) {\n      var descriptions = new Array(expected.length),\n          i, j;\n\n      for (i = 0; i < expected.length; i++) {\n        descriptions[i] = describeExpectation(expected[i]);\n      }\n\n      descriptions.sort();\n\n      if (descriptions.length > 0) {\n        for (i = 1, j = 1; i < descriptions.length; i++) {\n          if (descriptions[i - 1] !== descriptions[i]) {\n            descriptions[j] = descriptions[i];\n            j++;\n          }\n        }\n        descriptions.length = j;\n      }\n\n      switch (descriptions.length) {\n        case 1:\n          return descriptions[0];\n\n        case 2:\n          return descriptions[0] + \" or \" + descriptions[1];\n\n        default:\n          return descriptions.slice(0, -1).join(\", \")\n            + \", or \"\n            + descriptions[descriptions.length - 1];\n      }\n    }\n\n    function describeFound(found) {\n      return found ? \"\\\"\" + literalEscape(found) + \"\\\"\" : \"end of input\";\n    }\n\n    return \"Expected \" + describeExpected(expected) + \" but \" + describeFound(found) + \" found.\";\n  };\n\n  function peg$parse(input, options) {\n    options = options !== void 0 ? options : {};\n\n    var peg$FAILED = {},\n\n        peg$startRuleFunctions = { start: peg$parsestart },\n        peg$startRuleFunction  = peg$parsestart,\n\n        peg$c0 = function(ss) {\n            return ss.length === 1 ? ss[0] : { type: 'matches', selectors: ss };\n          },\n        peg$c1 = function() { return void 0; },\n        peg$c2 = \" \",\n        peg$c3 = peg$literalExpectation(\" \", false),\n        peg$c4 = /^[^ [\\],():#!=><~+.]/,\n        peg$c5 = peg$classExpectation([\" \", \"[\", \"]\", \",\", \"(\", \")\", \":\", \"#\", \"!\", \"=\", \">\", \"<\", \"~\", \"+\", \".\"], true, false),\n        peg$c6 = function(i) { return i.join(''); },\n        peg$c7 = \">\",\n        peg$c8 = peg$literalExpectation(\">\", false),\n        peg$c9 = function() { return 'child'; },\n        peg$c10 = \"~\",\n        peg$c11 = peg$literalExpectation(\"~\", false),\n        peg$c12 = function() { return 'sibling'; },\n        peg$c13 = \"+\",\n        peg$c14 = peg$literalExpectation(\"+\", false),\n        peg$c15 = function() { return 'adjacent'; },\n        peg$c16 = function() { return 'descendant'; },\n        peg$c17 = \",\",\n        peg$c18 = peg$literalExpectation(\",\", false),\n        peg$c19 = function(s, ss) {\n          return [s].concat(ss.map(function (s) { return s[3]; }));\n        },\n        peg$c20 = function(op, s) {\n            if (!op) return s;\n            return { type: op, left: { type: 'exactNode' }, right: s };\n          },\n        peg$c21 = function(a, ops) {\n            return ops.reduce(function (memo, rhs) {\n              return { type: rhs[0], left: memo, right: rhs[1] };\n            }, a);\n          },\n        peg$c22 = \"!\",\n        peg$c23 = peg$literalExpectation(\"!\", false),\n        peg$c24 = function(subject, as) {\n            const b = as.length === 1 ? as[0] : { type: 'compound', selectors: as };\n            if(subject) b.subject = true;\n            return b;\n          },\n        peg$c25 = \"*\",\n        peg$c26 = peg$literalExpectation(\"*\", false),\n        peg$c27 = function(a) { return { type: 'wildcard', value: a }; },\n        peg$c28 = \"#\",\n        peg$c29 = peg$literalExpectation(\"#\", false),\n        peg$c30 = function(i) { return { type: 'identifier', value: i }; },\n        peg$c31 = \"[\",\n        peg$c32 = peg$literalExpectation(\"[\", false),\n        peg$c33 = \"]\",\n        peg$c34 = peg$literalExpectation(\"]\", false),\n        peg$c35 = function(v) { return v; },\n        peg$c36 = /^[><!]/,\n        peg$c37 = peg$classExpectation([\">\", \"<\", \"!\"], false, false),\n        peg$c38 = \"=\",\n        peg$c39 = peg$literalExpectation(\"=\", false),\n        peg$c40 = function(a) { return (a || '') + '='; },\n        peg$c41 = /^[><]/,\n        peg$c42 = peg$classExpectation([\">\", \"<\"], false, false),\n        peg$c43 = \".\",\n        peg$c44 = peg$literalExpectation(\".\", false),\n        peg$c45 = function(a, as) {\n            return [].concat.apply([a], as).join('');\n          },\n        peg$c46 = function(name, op, value) {\n              return { type: 'attribute', name: name, operator: op, value: value };\n            },\n        peg$c47 = function(name) { return { type: 'attribute', name: name }; },\n        peg$c48 = \"\\\"\",\n        peg$c49 = peg$literalExpectation(\"\\\"\", false),\n        peg$c50 = /^[^\\\\\"]/,\n        peg$c51 = peg$classExpectation([\"\\\\\", \"\\\"\"], true, false),\n        peg$c52 = \"\\\\\",\n        peg$c53 = peg$literalExpectation(\"\\\\\", false),\n        peg$c54 = peg$anyExpectation(),\n        peg$c55 = function(a, b) { return a + b; },\n        peg$c56 = function(d) {\n                return { type: 'literal', value: strUnescape(d.join('')) };\n              },\n        peg$c57 = \"'\",\n        peg$c58 = peg$literalExpectation(\"'\", false),\n        peg$c59 = /^[^\\\\']/,\n        peg$c60 = peg$classExpectation([\"\\\\\", \"'\"], true, false),\n        peg$c61 = /^[0-9]/,\n        peg$c62 = peg$classExpectation([[\"0\", \"9\"]], false, false),\n        peg$c63 = function(a, b) {\n                // Can use `a.flat().join('')` once supported\n                const leadingDecimals = a ? [].concat.apply([], a).join('') : '';\n                return { type: 'literal', value: parseFloat(leadingDecimals + b.join('')) };\n              },\n        peg$c64 = function(i) { return { type: 'literal', value: i }; },\n        peg$c65 = \"type(\",\n        peg$c66 = peg$literalExpectation(\"type(\", false),\n        peg$c67 = /^[^ )]/,\n        peg$c68 = peg$classExpectation([\" \", \")\"], true, false),\n        peg$c69 = \")\",\n        peg$c70 = peg$literalExpectation(\")\", false),\n        peg$c71 = function(t) { return { type: 'type', value: t.join('') }; },\n        peg$c72 = /^[imsu]/,\n        peg$c73 = peg$classExpectation([\"i\", \"m\", \"s\", \"u\"], false, false),\n        peg$c74 = \"/\",\n        peg$c75 = peg$literalExpectation(\"/\", false),\n        peg$c76 = function(pattern, flgs) {\n              return {\n                type: 'regexp', value: new RegExp(pattern.join(''), flgs ? flgs.join('') : '')\n              };\n            },\n        peg$c77 = /^[^\\]\\\\]/,\n        peg$c78 = peg$classExpectation([\"]\", \"\\\\\"], true, false),\n        peg$c79 = function(cs) { return '[' + cs.join('') + ']'; },\n        peg$c80 = function(a) { return '\\\\' + a; },\n        peg$c81 = /^[^\\/\\\\[]/,\n        peg$c82 = peg$classExpectation([\"/\", \"\\\\\", \"[\"], true, false),\n        peg$c83 = function(cs) { return cs.join(''); },\n        peg$c84 = function(i, is) {\n          return { type: 'field', name: is.reduce(function(memo, p){ return memo + p[0] + p[1]; }, i)};\n        },\n        peg$c85 = \":not(\",\n        peg$c86 = peg$literalExpectation(\":not(\", false),\n        peg$c87 = function(ss) { return { type: 'not', selectors: ss }; },\n        peg$c88 = \":matches(\",\n        peg$c89 = peg$literalExpectation(\":matches(\", false),\n        peg$c90 = function(ss) { return { type: 'matches', selectors: ss }; },\n        peg$c91 = \":is(\",\n        peg$c92 = peg$literalExpectation(\":is(\", false),\n        peg$c93 = \":has(\",\n        peg$c94 = peg$literalExpectation(\":has(\", false),\n        peg$c95 = function(ss) { return { type: 'has', selectors: ss }; },\n        peg$c96 = \":first-child\",\n        peg$c97 = peg$literalExpectation(\":first-child\", false),\n        peg$c98 = function() { return nth(1); },\n        peg$c99 = \":last-child\",\n        peg$c100 = peg$literalExpectation(\":last-child\", false),\n        peg$c101 = function() { return nthLast(1); },\n        peg$c102 = \":nth-child(\",\n        peg$c103 = peg$literalExpectation(\":nth-child(\", false),\n        peg$c104 = function(n) { return nth(parseInt(n.join(''), 10)); },\n        peg$c105 = \":nth-last-child(\",\n        peg$c106 = peg$literalExpectation(\":nth-last-child(\", false),\n        peg$c107 = function(n) { return nthLast(parseInt(n.join(''), 10)); },\n        peg$c108 = \":\",\n        peg$c109 = peg$literalExpectation(\":\", false),\n        peg$c110 = function(c) {\n          return { type: 'class', name: c };\n        },\n\n        peg$currPos          = 0,\n        peg$savedPos         = 0,\n        peg$posDetailsCache  = [{ line: 1, column: 1 }],\n        peg$maxFailPos       = 0,\n        peg$maxFailExpected  = [],\n        peg$silentFails      = 0,\n\n        peg$resultsCache = {},\n\n        peg$result;\n\n    if (\"startRule\" in options) {\n      if (!(options.startRule in peg$startRuleFunctions)) {\n        throw new Error(\"Can't start parsing from rule \\\"\" + options.startRule + \"\\\".\");\n      }\n\n      peg$startRuleFunction = peg$startRuleFunctions[options.startRule];\n    }\n\n    function text() {\n      return input.substring(peg$savedPos, peg$currPos);\n    }\n\n    function location() {\n      return peg$computeLocation(peg$savedPos, peg$currPos);\n    }\n\n    function expected(description, location) {\n      location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)\n\n      throw peg$buildStructuredError(\n        [peg$otherExpectation(description)],\n        input.substring(peg$savedPos, peg$currPos),\n        location\n      );\n    }\n\n    function error(message, location) {\n      location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)\n\n      throw peg$buildSimpleError(message, location);\n    }\n\n    function peg$literalExpectation(text, ignoreCase) {\n      return { type: \"literal\", text: text, ignoreCase: ignoreCase };\n    }\n\n    function peg$classExpectation(parts, inverted, ignoreCase) {\n      return { type: \"class\", parts: parts, inverted: inverted, ignoreCase: ignoreCase };\n    }\n\n    function peg$anyExpectation() {\n      return { type: \"any\" };\n    }\n\n    function peg$endExpectation() {\n      return { type: \"end\" };\n    }\n\n    function peg$otherExpectation(description) {\n      return { type: \"other\", description: description };\n    }\n\n    function peg$computePosDetails(pos) {\n      var details = peg$posDetailsCache[pos], p;\n\n      if (details) {\n        return details;\n      } else {\n        p = pos - 1;\n        while (!peg$posDetailsCache[p]) {\n          p--;\n        }\n\n        details = peg$posDetailsCache[p];\n        details = {\n          line:   details.line,\n          column: details.column\n        };\n\n        while (p < pos) {\n          if (input.charCodeAt(p) === 10) {\n            details.line++;\n            details.column = 1;\n          } else {\n            details.column++;\n          }\n\n          p++;\n        }\n\n        peg$posDetailsCache[pos] = details;\n        return details;\n      }\n    }\n\n    function peg$computeLocation(startPos, endPos) {\n      var startPosDetails = peg$computePosDetails(startPos),\n          endPosDetails   = peg$computePosDetails(endPos);\n\n      return {\n        start: {\n          offset: startPos,\n          line:   startPosDetails.line,\n          column: startPosDetails.column\n        },\n        end: {\n          offset: endPos,\n          line:   endPosDetails.line,\n          column: endPosDetails.column\n        }\n      };\n    }\n\n    function peg$fail(expected) {\n      if (peg$currPos < peg$maxFailPos) { return; }\n\n      if (peg$currPos > peg$maxFailPos) {\n        peg$maxFailPos = peg$currPos;\n        peg$maxFailExpected = [];\n      }\n\n      peg$maxFailExpected.push(expected);\n    }\n\n    function peg$buildSimpleError(message, location) {\n      return new peg$SyntaxError(message, null, null, location);\n    }\n\n    function peg$buildStructuredError(expected, found, location) {\n      return new peg$SyntaxError(\n        peg$SyntaxError.buildMessage(expected, found),\n        expected,\n        found,\n        location\n      );\n    }\n\n    function peg$parsestart() {\n      var s0, s1, s2, s3;\n\n      var key    = peg$currPos * 36 + 0,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parse_();\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parseselectors();\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parse_();\n          if (s3 !== peg$FAILED) {\n            peg$savedPos = s0;\n            s1 = peg$c0(s2);\n            s0 = s1;\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n      if (s0 === peg$FAILED) {\n        s0 = peg$currPos;\n        s1 = peg$parse_();\n        if (s1 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c1();\n        }\n        s0 = s1;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parse_() {\n      var s0, s1;\n\n      var key    = peg$currPos * 36 + 1,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = [];\n      if (input.charCodeAt(peg$currPos) === 32) {\n        s1 = peg$c2;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c3); }\n      }\n      while (s1 !== peg$FAILED) {\n        s0.push(s1);\n        if (input.charCodeAt(peg$currPos) === 32) {\n          s1 = peg$c2;\n          peg$currPos++;\n        } else {\n          s1 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c3); }\n        }\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseidentifierName() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 2,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = [];\n      if (peg$c4.test(input.charAt(peg$currPos))) {\n        s2 = input.charAt(peg$currPos);\n        peg$currPos++;\n      } else {\n        s2 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c5); }\n      }\n      if (s2 !== peg$FAILED) {\n        while (s2 !== peg$FAILED) {\n          s1.push(s2);\n          if (peg$c4.test(input.charAt(peg$currPos))) {\n            s2 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s2 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c5); }\n          }\n        }\n      } else {\n        s1 = peg$FAILED;\n      }\n      if (s1 !== peg$FAILED) {\n        peg$savedPos = s0;\n        s1 = peg$c6(s1);\n      }\n      s0 = s1;\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsebinaryOp() {\n      var s0, s1, s2, s3;\n\n      var key    = peg$currPos * 36 + 3,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parse_();\n      if (s1 !== peg$FAILED) {\n        if (input.charCodeAt(peg$currPos) === 62) {\n          s2 = peg$c7;\n          peg$currPos++;\n        } else {\n          s2 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c8); }\n        }\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parse_();\n          if (s3 !== peg$FAILED) {\n            peg$savedPos = s0;\n            s1 = peg$c9();\n            s0 = s1;\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n      if (s0 === peg$FAILED) {\n        s0 = peg$currPos;\n        s1 = peg$parse_();\n        if (s1 !== peg$FAILED) {\n          if (input.charCodeAt(peg$currPos) === 126) {\n            s2 = peg$c10;\n            peg$currPos++;\n          } else {\n            s2 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c11); }\n          }\n          if (s2 !== peg$FAILED) {\n            s3 = peg$parse_();\n            if (s3 !== peg$FAILED) {\n              peg$savedPos = s0;\n              s1 = peg$c12();\n              s0 = s1;\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n        if (s0 === peg$FAILED) {\n          s0 = peg$currPos;\n          s1 = peg$parse_();\n          if (s1 !== peg$FAILED) {\n            if (input.charCodeAt(peg$currPos) === 43) {\n              s2 = peg$c13;\n              peg$currPos++;\n            } else {\n              s2 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c14); }\n            }\n            if (s2 !== peg$FAILED) {\n              s3 = peg$parse_();\n              if (s3 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c15();\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n          if (s0 === peg$FAILED) {\n            s0 = peg$currPos;\n            if (input.charCodeAt(peg$currPos) === 32) {\n              s1 = peg$c2;\n              peg$currPos++;\n            } else {\n              s1 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c3); }\n            }\n            if (s1 !== peg$FAILED) {\n              s2 = peg$parse_();\n              if (s2 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c16();\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          }\n        }\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsehasSelectors() {\n      var s0, s1, s2, s3, s4, s5, s6, s7;\n\n      var key    = peg$currPos * 36 + 4,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parsehasSelector();\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        s3 = peg$currPos;\n        s4 = peg$parse_();\n        if (s4 !== peg$FAILED) {\n          if (input.charCodeAt(peg$currPos) === 44) {\n            s5 = peg$c17;\n            peg$currPos++;\n          } else {\n            s5 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c18); }\n          }\n          if (s5 !== peg$FAILED) {\n            s6 = peg$parse_();\n            if (s6 !== peg$FAILED) {\n              s7 = peg$parsehasSelector();\n              if (s7 !== peg$FAILED) {\n                s4 = [s4, s5, s6, s7];\n                s3 = s4;\n              } else {\n                peg$currPos = s3;\n                s3 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s3;\n          s3 = peg$FAILED;\n        }\n        while (s3 !== peg$FAILED) {\n          s2.push(s3);\n          s3 = peg$currPos;\n          s4 = peg$parse_();\n          if (s4 !== peg$FAILED) {\n            if (input.charCodeAt(peg$currPos) === 44) {\n              s5 = peg$c17;\n              peg$currPos++;\n            } else {\n              s5 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c18); }\n            }\n            if (s5 !== peg$FAILED) {\n              s6 = peg$parse_();\n              if (s6 !== peg$FAILED) {\n                s7 = peg$parsehasSelector();\n                if (s7 !== peg$FAILED) {\n                  s4 = [s4, s5, s6, s7];\n                  s3 = s4;\n                } else {\n                  peg$currPos = s3;\n                  s3 = peg$FAILED;\n                }\n              } else {\n                peg$currPos = s3;\n                s3 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c19(s1, s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseselectors() {\n      var s0, s1, s2, s3, s4, s5, s6, s7;\n\n      var key    = peg$currPos * 36 + 5,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parseselector();\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        s3 = peg$currPos;\n        s4 = peg$parse_();\n        if (s4 !== peg$FAILED) {\n          if (input.charCodeAt(peg$currPos) === 44) {\n            s5 = peg$c17;\n            peg$currPos++;\n          } else {\n            s5 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c18); }\n          }\n          if (s5 !== peg$FAILED) {\n            s6 = peg$parse_();\n            if (s6 !== peg$FAILED) {\n              s7 = peg$parseselector();\n              if (s7 !== peg$FAILED) {\n                s4 = [s4, s5, s6, s7];\n                s3 = s4;\n              } else {\n                peg$currPos = s3;\n                s3 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s3;\n          s3 = peg$FAILED;\n        }\n        while (s3 !== peg$FAILED) {\n          s2.push(s3);\n          s3 = peg$currPos;\n          s4 = peg$parse_();\n          if (s4 !== peg$FAILED) {\n            if (input.charCodeAt(peg$currPos) === 44) {\n              s5 = peg$c17;\n              peg$currPos++;\n            } else {\n              s5 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c18); }\n            }\n            if (s5 !== peg$FAILED) {\n              s6 = peg$parse_();\n              if (s6 !== peg$FAILED) {\n                s7 = peg$parseselector();\n                if (s7 !== peg$FAILED) {\n                  s4 = [s4, s5, s6, s7];\n                  s3 = s4;\n                } else {\n                  peg$currPos = s3;\n                  s3 = peg$FAILED;\n                }\n              } else {\n                peg$currPos = s3;\n                s3 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c19(s1, s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsehasSelector() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 6,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parsebinaryOp();\n      if (s1 === peg$FAILED) {\n        s1 = null;\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parseselector();\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c20(s1, s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseselector() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 7,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parsesequence();\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        s3 = peg$currPos;\n        s4 = peg$parsebinaryOp();\n        if (s4 !== peg$FAILED) {\n          s5 = peg$parsesequence();\n          if (s5 !== peg$FAILED) {\n            s4 = [s4, s5];\n            s3 = s4;\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s3;\n          s3 = peg$FAILED;\n        }\n        while (s3 !== peg$FAILED) {\n          s2.push(s3);\n          s3 = peg$currPos;\n          s4 = peg$parsebinaryOp();\n          if (s4 !== peg$FAILED) {\n            s5 = peg$parsesequence();\n            if (s5 !== peg$FAILED) {\n              s4 = [s4, s5];\n              s3 = s4;\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c21(s1, s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsesequence() {\n      var s0, s1, s2, s3;\n\n      var key    = peg$currPos * 36 + 8,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 33) {\n        s1 = peg$c22;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c23); }\n      }\n      if (s1 === peg$FAILED) {\n        s1 = null;\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        s3 = peg$parseatom();\n        if (s3 !== peg$FAILED) {\n          while (s3 !== peg$FAILED) {\n            s2.push(s3);\n            s3 = peg$parseatom();\n          }\n        } else {\n          s2 = peg$FAILED;\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c24(s1, s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseatom() {\n      var s0;\n\n      var key    = peg$currPos * 36 + 9,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$parsewildcard();\n      if (s0 === peg$FAILED) {\n        s0 = peg$parseidentifier();\n        if (s0 === peg$FAILED) {\n          s0 = peg$parseattr();\n          if (s0 === peg$FAILED) {\n            s0 = peg$parsefield();\n            if (s0 === peg$FAILED) {\n              s0 = peg$parsenegation();\n              if (s0 === peg$FAILED) {\n                s0 = peg$parsematches();\n                if (s0 === peg$FAILED) {\n                  s0 = peg$parseis();\n                  if (s0 === peg$FAILED) {\n                    s0 = peg$parsehas();\n                    if (s0 === peg$FAILED) {\n                      s0 = peg$parsefirstChild();\n                      if (s0 === peg$FAILED) {\n                        s0 = peg$parselastChild();\n                        if (s0 === peg$FAILED) {\n                          s0 = peg$parsenthChild();\n                          if (s0 === peg$FAILED) {\n                            s0 = peg$parsenthLastChild();\n                            if (s0 === peg$FAILED) {\n                              s0 = peg$parseclass();\n                            }\n                          }\n                        }\n                      }\n                    }\n                  }\n                }\n              }\n            }\n          }\n        }\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsewildcard() {\n      var s0, s1;\n\n      var key    = peg$currPos * 36 + 10,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 42) {\n        s1 = peg$c25;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c26); }\n      }\n      if (s1 !== peg$FAILED) {\n        peg$savedPos = s0;\n        s1 = peg$c27(s1);\n      }\n      s0 = s1;\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseidentifier() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 11,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 35) {\n        s1 = peg$c28;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c29); }\n      }\n      if (s1 === peg$FAILED) {\n        s1 = null;\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parseidentifierName();\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c30(s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseattr() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 12,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 91) {\n        s1 = peg$c31;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c32); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parseattrValue();\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 93) {\n                s5 = peg$c33;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c34); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c35(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseattrOps() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 13,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (peg$c36.test(input.charAt(peg$currPos))) {\n        s1 = input.charAt(peg$currPos);\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c37); }\n      }\n      if (s1 === peg$FAILED) {\n        s1 = null;\n      }\n      if (s1 !== peg$FAILED) {\n        if (input.charCodeAt(peg$currPos) === 61) {\n          s2 = peg$c38;\n          peg$currPos++;\n        } else {\n          s2 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c39); }\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c40(s1);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n      if (s0 === peg$FAILED) {\n        if (peg$c41.test(input.charAt(peg$currPos))) {\n          s0 = input.charAt(peg$currPos);\n          peg$currPos++;\n        } else {\n          s0 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c42); }\n        }\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseattrEqOps() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 14,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 33) {\n        s1 = peg$c22;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c23); }\n      }\n      if (s1 === peg$FAILED) {\n        s1 = null;\n      }\n      if (s1 !== peg$FAILED) {\n        if (input.charCodeAt(peg$currPos) === 61) {\n          s2 = peg$c38;\n          peg$currPos++;\n        } else {\n          s2 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c39); }\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c40(s1);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseattrName() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 15,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parseidentifierName();\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        s3 = peg$currPos;\n        if (input.charCodeAt(peg$currPos) === 46) {\n          s4 = peg$c43;\n          peg$currPos++;\n        } else {\n          s4 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c44); }\n        }\n        if (s4 !== peg$FAILED) {\n          s5 = peg$parseidentifierName();\n          if (s5 !== peg$FAILED) {\n            s4 = [s4, s5];\n            s3 = s4;\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s3;\n          s3 = peg$FAILED;\n        }\n        while (s3 !== peg$FAILED) {\n          s2.push(s3);\n          s3 = peg$currPos;\n          if (input.charCodeAt(peg$currPos) === 46) {\n            s4 = peg$c43;\n            peg$currPos++;\n          } else {\n            s4 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c44); }\n          }\n          if (s4 !== peg$FAILED) {\n            s5 = peg$parseidentifierName();\n            if (s5 !== peg$FAILED) {\n              s4 = [s4, s5];\n              s3 = s4;\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c45(s1, s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseattrValue() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 16,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parseattrName();\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parseattrEqOps();\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              s5 = peg$parsetype();\n              if (s5 === peg$FAILED) {\n                s5 = peg$parseregex();\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c46(s1, s3, s5);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n      if (s0 === peg$FAILED) {\n        s0 = peg$currPos;\n        s1 = peg$parseattrName();\n        if (s1 !== peg$FAILED) {\n          s2 = peg$parse_();\n          if (s2 !== peg$FAILED) {\n            s3 = peg$parseattrOps();\n            if (s3 !== peg$FAILED) {\n              s4 = peg$parse_();\n              if (s4 !== peg$FAILED) {\n                s5 = peg$parsestring();\n                if (s5 === peg$FAILED) {\n                  s5 = peg$parsenumber();\n                  if (s5 === peg$FAILED) {\n                    s5 = peg$parsepath();\n                  }\n                }\n                if (s5 !== peg$FAILED) {\n                  peg$savedPos = s0;\n                  s1 = peg$c46(s1, s3, s5);\n                  s0 = s1;\n                } else {\n                  peg$currPos = s0;\n                  s0 = peg$FAILED;\n                }\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n        if (s0 === peg$FAILED) {\n          s0 = peg$currPos;\n          s1 = peg$parseattrName();\n          if (s1 !== peg$FAILED) {\n            peg$savedPos = s0;\n            s1 = peg$c47(s1);\n          }\n          s0 = s1;\n        }\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsestring() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 17,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 34) {\n        s1 = peg$c48;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c49); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        if (peg$c50.test(input.charAt(peg$currPos))) {\n          s3 = input.charAt(peg$currPos);\n          peg$currPos++;\n        } else {\n          s3 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c51); }\n        }\n        if (s3 === peg$FAILED) {\n          s3 = peg$currPos;\n          if (input.charCodeAt(peg$currPos) === 92) {\n            s4 = peg$c52;\n            peg$currPos++;\n          } else {\n            s4 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c53); }\n          }\n          if (s4 !== peg$FAILED) {\n            if (input.length > peg$currPos) {\n              s5 = input.charAt(peg$currPos);\n              peg$currPos++;\n            } else {\n              s5 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c54); }\n            }\n            if (s5 !== peg$FAILED) {\n              peg$savedPos = s3;\n              s4 = peg$c55(s4, s5);\n              s3 = s4;\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        }\n        while (s3 !== peg$FAILED) {\n          s2.push(s3);\n          if (peg$c50.test(input.charAt(peg$currPos))) {\n            s3 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s3 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c51); }\n          }\n          if (s3 === peg$FAILED) {\n            s3 = peg$currPos;\n            if (input.charCodeAt(peg$currPos) === 92) {\n              s4 = peg$c52;\n              peg$currPos++;\n            } else {\n              s4 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c53); }\n            }\n            if (s4 !== peg$FAILED) {\n              if (input.length > peg$currPos) {\n                s5 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c54); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s3;\n                s4 = peg$c55(s4, s5);\n                s3 = s4;\n              } else {\n                peg$currPos = s3;\n                s3 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          }\n        }\n        if (s2 !== peg$FAILED) {\n          if (input.charCodeAt(peg$currPos) === 34) {\n            s3 = peg$c48;\n            peg$currPos++;\n          } else {\n            s3 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c49); }\n          }\n          if (s3 !== peg$FAILED) {\n            peg$savedPos = s0;\n            s1 = peg$c56(s2);\n            s0 = s1;\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n      if (s0 === peg$FAILED) {\n        s0 = peg$currPos;\n        if (input.charCodeAt(peg$currPos) === 39) {\n          s1 = peg$c57;\n          peg$currPos++;\n        } else {\n          s1 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c58); }\n        }\n        if (s1 !== peg$FAILED) {\n          s2 = [];\n          if (peg$c59.test(input.charAt(peg$currPos))) {\n            s3 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s3 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c60); }\n          }\n          if (s3 === peg$FAILED) {\n            s3 = peg$currPos;\n            if (input.charCodeAt(peg$currPos) === 92) {\n              s4 = peg$c52;\n              peg$currPos++;\n            } else {\n              s4 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c53); }\n            }\n            if (s4 !== peg$FAILED) {\n              if (input.length > peg$currPos) {\n                s5 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c54); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s3;\n                s4 = peg$c55(s4, s5);\n                s3 = s4;\n              } else {\n                peg$currPos = s3;\n                s3 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          }\n          while (s3 !== peg$FAILED) {\n            s2.push(s3);\n            if (peg$c59.test(input.charAt(peg$currPos))) {\n              s3 = input.charAt(peg$currPos);\n              peg$currPos++;\n            } else {\n              s3 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c60); }\n            }\n            if (s3 === peg$FAILED) {\n              s3 = peg$currPos;\n              if (input.charCodeAt(peg$currPos) === 92) {\n                s4 = peg$c52;\n                peg$currPos++;\n              } else {\n                s4 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c53); }\n              }\n              if (s4 !== peg$FAILED) {\n                if (input.length > peg$currPos) {\n                  s5 = input.charAt(peg$currPos);\n                  peg$currPos++;\n                } else {\n                  s5 = peg$FAILED;\n                  if (peg$silentFails === 0) { peg$fail(peg$c54); }\n                }\n                if (s5 !== peg$FAILED) {\n                  peg$savedPos = s3;\n                  s4 = peg$c55(s4, s5);\n                  s3 = s4;\n                } else {\n                  peg$currPos = s3;\n                  s3 = peg$FAILED;\n                }\n              } else {\n                peg$currPos = s3;\n                s3 = peg$FAILED;\n              }\n            }\n          }\n          if (s2 !== peg$FAILED) {\n            if (input.charCodeAt(peg$currPos) === 39) {\n              s3 = peg$c57;\n              peg$currPos++;\n            } else {\n              s3 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c58); }\n            }\n            if (s3 !== peg$FAILED) {\n              peg$savedPos = s0;\n              s1 = peg$c56(s2);\n              s0 = s1;\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsenumber() {\n      var s0, s1, s2, s3;\n\n      var key    = peg$currPos * 36 + 18,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$currPos;\n      s2 = [];\n      if (peg$c61.test(input.charAt(peg$currPos))) {\n        s3 = input.charAt(peg$currPos);\n        peg$currPos++;\n      } else {\n        s3 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c62); }\n      }\n      while (s3 !== peg$FAILED) {\n        s2.push(s3);\n        if (peg$c61.test(input.charAt(peg$currPos))) {\n          s3 = input.charAt(peg$currPos);\n          peg$currPos++;\n        } else {\n          s3 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c62); }\n        }\n      }\n      if (s2 !== peg$FAILED) {\n        if (input.charCodeAt(peg$currPos) === 46) {\n          s3 = peg$c43;\n          peg$currPos++;\n        } else {\n          s3 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c44); }\n        }\n        if (s3 !== peg$FAILED) {\n          s2 = [s2, s3];\n          s1 = s2;\n        } else {\n          peg$currPos = s1;\n          s1 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s1;\n        s1 = peg$FAILED;\n      }\n      if (s1 === peg$FAILED) {\n        s1 = null;\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        if (peg$c61.test(input.charAt(peg$currPos))) {\n          s3 = input.charAt(peg$currPos);\n          peg$currPos++;\n        } else {\n          s3 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c62); }\n        }\n        if (s3 !== peg$FAILED) {\n          while (s3 !== peg$FAILED) {\n            s2.push(s3);\n            if (peg$c61.test(input.charAt(peg$currPos))) {\n              s3 = input.charAt(peg$currPos);\n              peg$currPos++;\n            } else {\n              s3 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c62); }\n            }\n          }\n        } else {\n          s2 = peg$FAILED;\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c63(s1, s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsepath() {\n      var s0, s1;\n\n      var key    = peg$currPos * 36 + 19,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parseidentifierName();\n      if (s1 !== peg$FAILED) {\n        peg$savedPos = s0;\n        s1 = peg$c64(s1);\n      }\n      s0 = s1;\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsetype() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 20,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 5) === peg$c65) {\n        s1 = peg$c65;\n        peg$currPos += 5;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c66); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = [];\n          if (peg$c67.test(input.charAt(peg$currPos))) {\n            s4 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s4 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c68); }\n          }\n          if (s4 !== peg$FAILED) {\n            while (s4 !== peg$FAILED) {\n              s3.push(s4);\n              if (peg$c67.test(input.charAt(peg$currPos))) {\n                s4 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s4 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c68); }\n              }\n            }\n          } else {\n            s3 = peg$FAILED;\n          }\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 41) {\n                s5 = peg$c69;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c70); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c71(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseflags() {\n      var s0, s1;\n\n      var key    = peg$currPos * 36 + 21,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = [];\n      if (peg$c72.test(input.charAt(peg$currPos))) {\n        s1 = input.charAt(peg$currPos);\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c73); }\n      }\n      if (s1 !== peg$FAILED) {\n        while (s1 !== peg$FAILED) {\n          s0.push(s1);\n          if (peg$c72.test(input.charAt(peg$currPos))) {\n            s1 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s1 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c73); }\n          }\n        }\n      } else {\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseregex() {\n      var s0, s1, s2, s3, s4;\n\n      var key    = peg$currPos * 36 + 22,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 47) {\n        s1 = peg$c74;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c75); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        s3 = peg$parsere_character_class();\n        if (s3 === peg$FAILED) {\n          s3 = peg$parsere_escape();\n          if (s3 === peg$FAILED) {\n            s3 = peg$parsere_chars();\n          }\n        }\n        if (s3 !== peg$FAILED) {\n          while (s3 !== peg$FAILED) {\n            s2.push(s3);\n            s3 = peg$parsere_character_class();\n            if (s3 === peg$FAILED) {\n              s3 = peg$parsere_escape();\n              if (s3 === peg$FAILED) {\n                s3 = peg$parsere_chars();\n              }\n            }\n          }\n        } else {\n          s2 = peg$FAILED;\n        }\n        if (s2 !== peg$FAILED) {\n          if (input.charCodeAt(peg$currPos) === 47) {\n            s3 = peg$c74;\n            peg$currPos++;\n          } else {\n            s3 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c75); }\n          }\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parseflags();\n            if (s4 === peg$FAILED) {\n              s4 = null;\n            }\n            if (s4 !== peg$FAILED) {\n              peg$savedPos = s0;\n              s1 = peg$c76(s2, s4);\n              s0 = s1;\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsere_character_class() {\n      var s0, s1, s2, s3;\n\n      var key    = peg$currPos * 36 + 23,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 91) {\n        s1 = peg$c31;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c32); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        if (peg$c77.test(input.charAt(peg$currPos))) {\n          s3 = input.charAt(peg$currPos);\n          peg$currPos++;\n        } else {\n          s3 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c78); }\n        }\n        if (s3 === peg$FAILED) {\n          s3 = peg$parsere_escape();\n        }\n        if (s3 !== peg$FAILED) {\n          while (s3 !== peg$FAILED) {\n            s2.push(s3);\n            if (peg$c77.test(input.charAt(peg$currPos))) {\n              s3 = input.charAt(peg$currPos);\n              peg$currPos++;\n            } else {\n              s3 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c78); }\n            }\n            if (s3 === peg$FAILED) {\n              s3 = peg$parsere_escape();\n            }\n          }\n        } else {\n          s2 = peg$FAILED;\n        }\n        if (s2 !== peg$FAILED) {\n          if (input.charCodeAt(peg$currPos) === 93) {\n            s3 = peg$c33;\n            peg$currPos++;\n          } else {\n            s3 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c34); }\n          }\n          if (s3 !== peg$FAILED) {\n            peg$savedPos = s0;\n            s1 = peg$c79(s2);\n            s0 = s1;\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsere_escape() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 24,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 92) {\n        s1 = peg$c52;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c53); }\n      }\n      if (s1 !== peg$FAILED) {\n        if (input.length > peg$currPos) {\n          s2 = input.charAt(peg$currPos);\n          peg$currPos++;\n        } else {\n          s2 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c54); }\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c80(s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsere_chars() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 25,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = [];\n      if (peg$c81.test(input.charAt(peg$currPos))) {\n        s2 = input.charAt(peg$currPos);\n        peg$currPos++;\n      } else {\n        s2 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c82); }\n      }\n      if (s2 !== peg$FAILED) {\n        while (s2 !== peg$FAILED) {\n          s1.push(s2);\n          if (peg$c81.test(input.charAt(peg$currPos))) {\n            s2 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s2 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c82); }\n          }\n        }\n      } else {\n        s1 = peg$FAILED;\n      }\n      if (s1 !== peg$FAILED) {\n        peg$savedPos = s0;\n        s1 = peg$c83(s1);\n      }\n      s0 = s1;\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsefield() {\n      var s0, s1, s2, s3, s4, s5, s6;\n\n      var key    = peg$currPos * 36 + 26,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 46) {\n        s1 = peg$c43;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c44); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parseidentifierName();\n        if (s2 !== peg$FAILED) {\n          s3 = [];\n          s4 = peg$currPos;\n          if (input.charCodeAt(peg$currPos) === 46) {\n            s5 = peg$c43;\n               peg$currPos++;\n          } else {\n            s5 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c44); }\n          }\n          if (s5 !== peg$FAILED) {\n            s6 = peg$parseidentifierName();\n            if (s6 !== peg$FAILED) {\n              s5 = [s5, s6];\n              s4 = s5;\n            } else {\n              peg$currPos = s4;\n              s4 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s4;\n            s4 = peg$FAILED;\n          }\n          while (s4 !== peg$FAILED) {\n            s3.push(s4);\n            s4 = peg$currPos;\n            if (input.charCodeAt(peg$currPos) === 46) {\n              s5 = peg$c43;\n              peg$currPos++;\n            } else {\n              s5 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c44); }\n            }\n            if (s5 !== peg$FAILED) {\n              s6 = peg$parseidentifierName();\n              if (s6 !== peg$FAILED) {\n                s5 = [s5, s6];\n                s4 = s5;\n              } else {\n                peg$currPos = s4;\n                s4 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s4;\n              s4 = peg$FAILED;\n            }\n          }\n          if (s3 !== peg$FAILED) {\n            peg$savedPos = s0;\n            s1 = peg$c84(s2, s3);\n            s0 = s1;\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsenegation() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 27,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 5) === peg$c85) {\n        s1 = peg$c85;\n        peg$currPos += 5;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c86); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parseselectors();\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 41) {\n                s5 = peg$c69;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c70); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c87(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsematches() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 28,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 9) === peg$c88) {\n        s1 = peg$c88;\n        peg$currPos += 9;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c89); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parseselectors();\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 41) {\n                s5 = peg$c69;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c70); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c90(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseis() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 29,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 4) === peg$c91) {\n        s1 = peg$c91;\n        peg$currPos += 4;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c92); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parseselectors();\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 41) {\n                s5 = peg$c69;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c70); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c90(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsehas() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 30,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 5) === peg$c93) {\n        s1 = peg$c93;\n        peg$currPos += 5;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c94); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parsehasSelectors();\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 41) {\n                s5 = peg$c69;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c70); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c95(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsefirstChild() {\n      var s0, s1;\n\n      var key    = peg$currPos * 36 + 31,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 12) === peg$c96) {\n        s1 = peg$c96;\n        peg$currPos += 12;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c97); }\n      }\n      if (s1 !== peg$FAILED) {\n        peg$savedPos = s0;\n        s1 = peg$c98();\n      }\n      s0 = s1;\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parselastChild() {\n      var s0, s1;\n\n      var key    = peg$currPos * 36 + 32,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 11) === peg$c99) {\n        s1 = peg$c99;\n        peg$currPos += 11;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c100); }\n      }\n      if (s1 !== peg$FAILED) {\n        peg$savedPos = s0;\n        s1 = peg$c101();\n      }\n      s0 = s1;\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsenthChild() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 33,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 11) === peg$c102) {\n        s1 = peg$c102;\n        peg$currPos += 11;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c103); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = [];\n          if (peg$c61.test(input.charAt(peg$currPos))) {\n            s4 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s4 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c62); }\n          }\n          if (s4 !== peg$FAILED) {\n            while (s4 !== peg$FAILED) {\n              s3.push(s4);\n              if (peg$c61.test(input.charAt(peg$currPos))) {\n                s4 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s4 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c62); }\n              }\n            }\n          } else {\n            s3 = peg$FAILED;\n          }\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 41) {\n                s5 = peg$c69;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c70); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c104(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsenthLastChild() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 34,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 16) === peg$c105) {\n        s1 = peg$c105;\n        peg$currPos += 16;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c106); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = [];\n          if (peg$c61.test(input.charAt(peg$currPos))) {\n            s4 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s4 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c62); }\n          }\n          if (s4 !== peg$FAILED) {\n            while (s4 !== peg$FAILED) {\n              s3.push(s4);\n              if (peg$c61.test(input.charAt(peg$currPos))) {\n                s4 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s4 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c62); }\n              }\n            }\n          } else {\n            s3 = peg$FAILED;\n          }\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 41) {\n                s5 = peg$c69;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c70); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c107(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseclass() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 35,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 58) {\n        s1 = peg$c108;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c109); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parseidentifierName();\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c110(s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n\n      function nth(n) { return { type: 'nth-child', index: { type: 'literal', value: n } }; }\n      function nthLast(n) { return { type: 'nth-last-child', index: { type: 'literal', value: n } }; }\n      function strUnescape(s) {\n        return s.replace(/\\\\(.)/g, function(match, ch) {\n          switch(ch) {\n            case 'b': return '\\b';\n            case 'f': return '\\f';\n            case 'n': return '\\n';\n            case 'r': return '\\r';\n            case 't': return '\\t';\n            case 'v': return '\\v';\n            default: return ch;\n          }\n        });\n      }\n\n\n    peg$result = peg$startRuleFunction();\n\n    if (peg$result !== peg$FAILED && peg$currPos === input.length) {\n      return peg$result;\n    } else {\n      if (peg$result !== peg$FAILED && peg$currPos < input.length) {\n        peg$fail(peg$endExpectation());\n      }\n\n      throw peg$buildStructuredError(\n        peg$maxFailExpected,\n        peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,\n        peg$maxFailPos < input.length\n          ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)\n          : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)\n      );\n    }\n  }\n\n  return {\n    SyntaxError: peg$SyntaxError,\n    parse:       peg$parse\n  };\n});\n","/* vim: set sw=4 sts=4 : */\nimport estraverse from 'estraverse';\nimport parser from './parser.js';\n\n/**\n* @typedef {\"LEFT_SIDE\"|\"RIGHT_SIDE\"} Side\n*/\n\nconst LEFT_SIDE = 'LEFT_SIDE';\nconst RIGHT_SIDE = 'RIGHT_SIDE';\n\n/**\n * @external AST\n * @see https://esprima.readthedocs.io/en/latest/syntax-tree-format.html\n */\n\n/**\n * One of the rules of `grammar.pegjs`\n * @typedef {PlainObject} SelectorAST\n * @see grammar.pegjs\n*/\n\n/**\n * The `sequence` production of `grammar.pegjs`\n * @typedef {PlainObject} SelectorSequenceAST\n*/\n\n/**\n * Get the value of a property which may be multiple levels down\n * in the object.\n * @param {?PlainObject} obj\n * @param {string[]} keys\n * @returns {undefined|boolean|string|number|external:AST}\n */\nfunction getPath(obj, keys) {\n    for (let i = 0; i < keys.length; ++i) {\n        if (obj == null) { return obj; }\n        obj = obj[keys[i]];\n    }\n    return obj;\n}\n\n/**\n * Determine whether `node` can be reached by following `path`,\n * starting at `ancestor`.\n * @param {?external:AST} node\n * @param {?external:AST} ancestor\n * @param {string[]} path\n * @param {Integer} fromPathIndex\n * @returns {boolean}\n */\nfunction inPath(node, ancestor, path, fromPathIndex) {\n    let current = ancestor;\n    for (let i = fromPathIndex; i < path.length; ++i) {\n        if (current == null) {\n            return false;\n        }\n        const field = current[path[i]];\n        if (Array.isArray(field)) {\n            for (let k = 0; k < field.length; ++k) {\n                if (inPath(node, field[k], path, i + 1)) {\n                    return true;\n                }\n            }\n            return false;\n        }\n        current = field;\n    }\n    return node === current;\n}\n\n/**\n * A generated matcher function for a selector.\n * @callback SelectorMatcher\n * @param {?SelectorAST} selector\n * @param {external:AST[]} [ancestry=[]]\n * @param {ESQueryOptions} [options]\n * @returns {void}\n*/\n\n/**\n * A WeakMap for holding cached matcher functions for selectors.\n * @type {WeakMap<SelectorAST, SelectorMatcher>}\n*/\nconst MATCHER_CACHE = typeof WeakMap === 'function' ? new WeakMap : null;\n\n/**\n * Look up a matcher function for `selector` in the cache.\n * If it does not exist, generate it with `generateMatcher` and add it to the cache.\n * In engines without WeakMap, the caching is skipped and matchers are generated with every call.\n * @param {?SelectorAST} selector\n * @returns {SelectorMatcher}\n */\nfunction getMatcher(selector) {\n    if (selector == null) {\n        return () => true;\n    }\n\n    if (MATCHER_CACHE != null) {\n        let matcher = MATCHER_CACHE.get(selector);\n        if (matcher != null) {\n            return matcher;\n        }\n        matcher = generateMatcher(selector);\n        MATCHER_CACHE.set(selector, matcher);\n        return matcher;\n    }\n\n    return generateMatcher(selector);\n}\n\n/**\n * Create a matcher function for `selector`,\n * @param {?SelectorAST} selector\n * @returns {SelectorMatcher}\n */\nfunction generateMatcher(selector) {\n    switch(selector.type) {\n        case 'wildcard':\n            return () => true;\n\n        case 'identifier': {\n            const value = selector.value.toLowerCase();\n            return (node, ancestry, options) => {\n                const nodeTypeKey = (options && options.nodeTypeKey) || 'type';\n                return value === node[nodeTypeKey].toLowerCase();\n            };\n        }\n\n        case 'exactNode':\n            return (node, ancestry) => {\n                return ancestry.length === 0;\n            };\n\n        case 'field': {\n            const path = selector.name.split('.');\n            return (node, ancestry) => {\n                const ancestor = ancestry[path.length - 1];\n                return inPath(node, ancestor, path, 0);\n            };\n        }\n\n        case 'matches': {\n            const matchers = selector.selectors.map(getMatcher);\n            return (node, ancestry, options) => {\n                for (let i = 0; i < matchers.length; ++i) {\n                    if (matchers[i](node, ancestry, options)) { return true; }\n                }\n                return false;\n            };\n        }\n\n        case 'compound': {\n            const matchers = selector.selectors.map(getMatcher);\n            return (node, ancestry, options) => {\n                for (let i = 0; i < matchers.length; ++i) {\n                    if (!matchers[i](node, ancestry, options)) { return false; }\n                }\n                return true;\n            };\n        }\n\n        case 'not': {\n            const matchers = selector.selectors.map(getMatcher);\n            return (node, ancestry, options) => {\n                for (let i = 0; i < matchers.length; ++i) {\n                    if (matchers[i](node, ancestry, options)) { return false; }\n                }\n                return true;\n            };\n        }\n\n        case 'has': {\n            const matchers = selector.selectors.map(getMatcher);\n            return (node, ancestry, options) => {\n                let result = false;\n\n                const a = [];\n                estraverse.traverse(node, {\n                    enter (node, parent) {\n                        if (parent != null) { a.unshift(parent); }\n\n                        for (let i = 0; i < matchers.length; ++i) {\n                            if (matchers[i](node, a, options)) {\n                                result = true;\n                                this.break();\n                                return;\n                            }\n                        }\n                    },\n                    leave () { a.shift(); },\n                    keys: options && options.visitorKeys,\n                    fallback: options && options.fallback || 'iteration'\n                });\n\n                return result;\n            };\n        }\n\n        case 'child': {\n            const left = getMatcher(selector.left);\n            const right = getMatcher(selector.right);\n            return (node, ancestry, options) => {\n                if (ancestry.length > 0 && right(node, ancestry, options)) {\n                    return left(ancestry[0], ancestry.slice(1), options);\n                }\n                return false;\n            };\n        }\n\n        case 'descendant': {\n            const left = getMatcher(selector.left);\n            const right = getMatcher(selector.right);\n            return (node, ancestry, options) => {\n                if (right(node, ancestry, options)) {\n                    for (let i = 0, l = ancestry.length; i < l; ++i) {\n                        if (left(ancestry[i], ancestry.slice(i + 1), options)) {\n                            return true;\n                        }\n                    }\n                }\n                return false;\n            };\n        }\n\n        case 'attribute': {\n            const path = selector.name.split('.');\n            switch (selector.operator) {\n                case void 0:\n                    return (node) => getPath(node, path) != null;\n                case '=':\n                    switch (selector.value.type) {\n                        case 'regexp':\n                            return (node) => {\n                                const p = getPath(node, path);\n                                return typeof p === 'string' && selector.value.value.test(p);\n                            };\n                        case 'literal': {\n                            const literal = `${selector.value.value}`;\n                            return (node) => literal === `${getPath(node, path)}`;\n                        }\n                        case 'type':\n                            return (node) => selector.value.value === typeof getPath(node, path);\n                    }\n                    throw new Error(`Unknown selector value type: ${selector.value.type}`);\n                case '!=':\n                    switch (selector.value.type) {\n                        case 'regexp':\n                            return (node) => !selector.value.value.test(getPath(node, path));\n                        case 'literal': {\n                            const literal = `${selector.value.value}`;\n                            return (node) => literal !== `${getPath(node, path)}`;\n                        }\n                        case 'type':\n                            return (node) => selector.value.value !== typeof getPath(node, path);\n                    }\n                    throw new Error(`Unknown selector value type: ${selector.value.type}`);\n                case '<=':\n                    return (node) => getPath(node, path) <= selector.value.value;\n                case '<':\n                    return (node) => getPath(node, path) < selector.value.value;\n                case '>':\n                    return (node) => getPath(node, path) > selector.value.value;\n                case '>=':\n                    return (node) => getPath(node, path) >= selector.value.value;\n            }\n            throw new Error(`Unknown operator: ${selector.operator}`);\n        }\n\n        case 'sibling': {\n            const left = getMatcher(selector.left);\n            const right = getMatcher(selector.right);\n            return (node, ancestry, options) =>\n                right(node, ancestry, options) &&\n                    sibling(node, left, ancestry, LEFT_SIDE, options) ||\n                    selector.left.subject &&\n                    left(node, ancestry, options) &&\n                    sibling(node, right, ancestry, RIGHT_SIDE, options);\n        }\n\n        case 'adjacent': {\n            const left = getMatcher(selector.left);\n            const right = getMatcher(selector.right);\n            return (node, ancestry, options) =>\n                right(node, ancestry, options) &&\n                    adjacent(node, left, ancestry, LEFT_SIDE, options) ||\n                    selector.right.subject &&\n                    left(node, ancestry, options) &&\n                    adjacent(node, right, ancestry, RIGHT_SIDE, options);\n        }\n\n        case 'nth-child': {\n            const nth = selector.index.value;\n            const right = getMatcher(selector.right);\n            return (node, ancestry, options) =>\n                right(node, ancestry, options) &&\n                    nthChild(node, ancestry, nth, options);\n        }\n\n        case 'nth-last-child': {\n            const nth = -selector.index.value;\n            const right = getMatcher(selector.right);\n            return (node, ancestry, options) =>\n                right(node, ancestry, options) &&\n                    nthChild(node, ancestry, nth, options);\n        }\n\n        case 'class': {\n            \n            const name = selector.name.toLowerCase();\n\n            return (node, ancestry, options) => {\n                \n                if (options && options.matchClass) {\n                    return options.matchClass(selector.name, node, ancestry);\n                }\n                \n                if (options && options.nodeTypeKey) return false;    \n\n                switch(name){\n                    case 'statement':\n                        if(node.type.slice(-9) === 'Statement') return true;\n                        // fallthrough: interface Declaration <: Statement { }\n                    case 'declaration':\n                        return node.type.slice(-11) === 'Declaration';\n                    case 'pattern':\n                        if(node.type.slice(-7) === 'Pattern') return true;\n                        // fallthrough: interface Expression <: Node, Pattern { }\n                    case 'expression':\n                        return node.type.slice(-10) === 'Expression' ||\n                            node.type.slice(-7) === 'Literal' ||\n                            (\n                                node.type === 'Identifier' &&\n                                (ancestry.length === 0 || ancestry[0].type !== 'MetaProperty')\n                            ) ||\n                            node.type === 'MetaProperty';\n                    case 'function':\n                        return node.type === 'FunctionDeclaration' ||\n                            node.type === 'FunctionExpression' ||\n                            node.type === 'ArrowFunctionExpression';\n                }\n                throw new Error(`Unknown class name: ${selector.name}`);\n            };\n        }\n    }\n\n    throw new Error(`Unknown selector type: ${selector.type}`);\n}\n\n/**\n * @callback TraverseOptionFallback\n * @param {external:AST} node The given node.\n * @returns {string[]} An array of visitor keys for the given node.\n */\n\n/**\n * @callback ClassMatcher\n * @param {string} className The name of the class to match.\n * @param {external:AST} node The node to match against.\n * @param {Array<external:AST>} ancestry The ancestry of the node.\n * @returns {boolean} True if the node matches the class, false if not.\n */\n\n/**\n * @typedef {object} ESQueryOptions\n * @property {string} [nodeTypeKey=\"type\"] By passing `nodeTypeKey`, we can allow other ASTs to use ESQuery.\n * @property { { [nodeType: string]: string[] } } [visitorKeys] By passing `visitorKeys` mapping, we can extend the properties of the nodes that traverse the node.\n * @property {TraverseOptionFallback} [fallback] By passing `fallback` option, we can control the properties of traversing nodes when encountering unknown nodes.\n * @property {ClassMatcher} [matchClass] By passing `matchClass` option, we can customize the interpretation of classes.\n */\n\n/**\n * Given a `node` and its ancestors, determine if `node` is matched\n * by `selector`.\n * @param {?external:AST} node\n * @param {?SelectorAST} selector\n * @param {external:AST[]} [ancestry=[]]\n * @param {ESQueryOptions} [options]\n * @throws {Error} Unknowns (operator, class name, selector type, or\n * selector value type)\n * @returns {boolean}\n */\nfunction matches(node, selector, ancestry, options) {\n    if (!selector) { return true; }\n    if (!node) { return false; }\n    if (!ancestry) { ancestry = []; }\n\n    return getMatcher(selector)(node, ancestry, options);\n}\n\n/**\n * Get visitor keys of a given node.\n * @param {external:AST} node The AST node to get keys.\n * @param {ESQueryOptions|undefined} options\n * @returns {string[]} Visitor keys of the node.\n */\nfunction getVisitorKeys(node, options) {\n    const nodeTypeKey = (options && options.nodeTypeKey) || 'type';\n\n    const nodeType = node[nodeTypeKey];\n    if (options && options.visitorKeys && options.visitorKeys[nodeType]) {\n        return options.visitorKeys[nodeType];\n    }\n    if (estraverse.VisitorKeys[nodeType]) {\n        return estraverse.VisitorKeys[nodeType];\n    }\n    if (options && typeof options.fallback === 'function') {\n        return options.fallback(node);\n    }\n    // 'iteration' fallback\n    return Object.keys(node).filter(function (key) {\n        return key !== nodeTypeKey;\n    });\n}\n\n\n/**\n * Check whether the given value is an ASTNode or not.\n * @param {any} node The value to check.\n * @param {ESQueryOptions|undefined} options The options to use.\n * @returns {boolean} `true` if the value is an ASTNode.\n */\nfunction isNode(node, options) {\n    const nodeTypeKey = (options && options.nodeTypeKey) || 'type';\n    return node !== null && typeof node === 'object' && typeof node[nodeTypeKey] === 'string';\n}\n\n/**\n * Determines if the given node has a sibling that matches the\n * given selector matcher.\n * @param {external:AST} node\n * @param {SelectorMatcher} matcher\n * @param {external:AST[]} ancestry\n * @param {Side} side\n * @param {ESQueryOptions|undefined} options\n * @returns {boolean}\n */\nfunction sibling(node, matcher, ancestry, side, options) {\n    const [parent] = ancestry;\n    if (!parent) { return false; }\n    const keys = getVisitorKeys(parent, options);\n    for (let i = 0; i < keys.length; ++i) {\n        const listProp = parent[keys[i]];\n        if (Array.isArray(listProp)) {\n            const startIndex = listProp.indexOf(node);\n            if (startIndex < 0) { continue; }\n            let lowerBound, upperBound;\n            if (side === LEFT_SIDE) {\n                lowerBound = 0;\n                upperBound = startIndex;\n            } else {\n                lowerBound = startIndex + 1;\n                upperBound = listProp.length;\n            }\n            for (let k = lowerBound; k < upperBound; ++k) {\n                if (isNode(listProp[k], options) && matcher(listProp[k], ancestry, options)) {\n                    return true;\n                }\n            }\n        }\n    }\n    return false;\n}\n\n/**\n * Determines if the given node has an adjacent sibling that matches\n * the given selector matcher.\n * @param {external:AST} node\n * @param {SelectorMatcher} matcher\n * @param {external:AST[]} ancestry\n * @param {Side} side\n * @param {ESQueryOptions|undefined} options\n * @returns {boolean}\n */\nfunction adjacent(node, matcher, ancestry, side, options) {\n    const [parent] = ancestry;\n    if (!parent) { return false; }\n    const keys = getVisitorKeys(parent, options);\n    for (let i = 0; i < keys.length; ++i) {\n        const listProp = parent[keys[i]];\n        if (Array.isArray(listProp)) {\n            const idx = listProp.indexOf(node);\n            if (idx < 0) { continue; }\n            if (side === LEFT_SIDE && idx > 0 && isNode(listProp[idx - 1], options) && matcher(listProp[idx - 1], ancestry, options)) {\n                return true;\n            }\n            if (side === RIGHT_SIDE && idx < listProp.length - 1 && isNode(listProp[idx + 1], options) &&  matcher(listProp[idx + 1], ancestry, options)) {\n                return true;\n            }\n        }\n    }\n    return false;\n}\n\n/**\n * Determines if the given node is the `nth` child.\n * If `nth` is negative then the position is counted\n * from the end of the list of children.\n * @param {external:AST} node\n * @param {external:AST[]} ancestry\n * @param {Integer} nth\n * @param {ESQueryOptions|undefined} options\n * @returns {boolean}\n */\nfunction nthChild(node, ancestry, nth, options) {\n    if (nth === 0) { return false; }\n    const [parent] = ancestry;\n    if (!parent) { return false; }\n    const keys = getVisitorKeys(parent, options);\n    for (let i = 0; i < keys.length; ++i) {\n        const listProp = parent[keys[i]];\n        if (Array.isArray(listProp)){\n            const idx = nth < 0 ? listProp.length + nth : nth - 1;\n            if (idx >= 0 && idx < listProp.length && listProp[idx] === node) {\n                return true;\n            }\n        }\n    }\n    return false;\n}\n\n/**\n * For each selector node marked as a subject, find the portion of the\n * selector that the subject must match.\n * @param {SelectorAST} selector\n * @param {SelectorAST} [ancestor] Defaults to `selector`\n * @returns {SelectorAST[]}\n */\nfunction subjects(selector, ancestor) {\n    if (selector == null || typeof selector != 'object') { return []; }\n    if (ancestor == null) { ancestor = selector; }\n    const results = selector.subject ? [ancestor] : [];\n    const keys = Object.keys(selector);\n    for (let i = 0; i < keys.length; ++i) {\n        const p = keys[i];\n        const sel = selector[p];\n        results.push(...subjects(sel, p === 'left' ? sel : ancestor));\n    }\n    return results;\n}\n\n/**\n* @callback TraverseVisitor\n* @param {?external:AST} node\n* @param {?external:AST} parent\n* @param {external:AST[]} ancestry\n*/\n\n/**\n * From a JS AST and a selector AST, collect all JS AST nodes that\n * match the selector.\n * @param {external:AST} ast\n * @param {?SelectorAST} selector\n * @param {TraverseVisitor} visitor\n * @param {ESQueryOptions} [options]\n * @returns {external:AST[]}\n */\nfunction traverse(ast, selector, visitor, options) {\n    if (!selector) { return; }\n    const ancestry = [];\n    const matcher = getMatcher(selector);\n    const altSubjects = subjects(selector).map(getMatcher);\n    estraverse.traverse(ast, {\n        enter (node, parent) {\n            if (parent != null) { ancestry.unshift(parent); }\n            if (matcher(node, ancestry, options)) {\n                if (altSubjects.length) {\n                    for (let i = 0, l = altSubjects.length; i < l; ++i) {\n                        if (altSubjects[i](node, ancestry, options)) {\n                            visitor(node, parent, ancestry);\n                        }\n                        for (let k = 0, m = ancestry.length; k < m; ++k) {\n                            const succeedingAncestry = ancestry.slice(k + 1);\n                            if (altSubjects[i](ancestry[k], succeedingAncestry, options)) {\n                                visitor(ancestry[k], parent, succeedingAncestry);\n                            }\n                        }\n                    }\n                } else {\n                    visitor(node, parent, ancestry);\n                }\n            }\n        },\n        leave () { ancestry.shift(); },\n        keys: options && options.visitorKeys,\n        fallback: options && options.fallback || 'iteration'\n    });\n}\n\n\n/**\n * From a JS AST and a selector AST, collect all JS AST nodes that\n * match the selector.\n * @param {external:AST} ast\n * @param {?SelectorAST} selector\n * @param {ESQueryOptions} [options]\n * @returns {external:AST[]}\n */\nfunction match(ast, selector, options) {\n    const results = [];\n    traverse(ast, selector, function (node) {\n        results.push(node);\n    }, options);\n    return results;\n}\n\n/**\n * Parse a selector string and return its AST.\n * @param {string} selector\n * @returns {SelectorAST}\n */\nfunction parse(selector) {\n    return parser.parse(selector);\n}\n\n/**\n * Query the code AST using the selector string.\n * @param {external:AST} ast\n * @param {string} selector\n * @param {ESQueryOptions} [options]\n * @returns {external:AST[]}\n */\nfunction query(ast, selector, options) {\n    return match(ast, parse(selector), options);\n}\n\nquery.parse = parse;\nquery.match = match;\nquery.traverse = traverse;\nquery.matches = matches;\nquery.query = query;\n\nexport default query;\n"],"names":["module","exports","peg$SyntaxError","message","expected","found","location","this","name","Error","captureStackTrace","child","parent","ctor","constructor","prototype","peg$subclass","buildMessage","DESCRIBE_EXPECTATION_FNS","literal","expectation","literalEscape","text","class","i","escapedParts","parts","length","Array","classEscape","inverted","any","end","other","description","hex","ch","charCodeAt","toString","toUpperCase","s","replace","j","descriptions","type","sort","slice","join","describeExpected","describeFound","SyntaxError","parse","input","options","peg$result","peg$FAILED","peg$startRuleFunctions","start","peg$parsestart","peg$startRuleFunction","peg$c3","peg$literalExpectation","peg$c4","peg$c5","peg$classExpectation","peg$c8","peg$c11","peg$c14","peg$c18","peg$c19","ss","concat","map","peg$c23","peg$c26","peg$c29","peg$c32","peg$c34","peg$c36","peg$c37","peg$c39","peg$c40","a","peg$c41","peg$c42","peg$c44","peg$c46","op","value","operator","peg$c49","peg$c50","peg$c51","peg$c53","peg$c54","peg$c55","b","peg$c56","d","match","peg$c58","peg$c59","peg$c60","peg$c61","peg$c62","peg$c66","peg$c67","peg$c68","peg$c70","peg$c72","peg$c73","peg$c75","peg$c77","peg$c78","peg$c81","peg$c82","peg$c86","peg$c89","peg$c90","selectors","peg$c92","peg$c94","peg$c97","peg$c100","peg$c103","peg$c106","peg$c109","peg$currPos","peg$posDetailsCache","line","column","peg$maxFailPos","peg$maxFailExpected","peg$resultsCache","startRule","ignoreCase","peg$computePosDetails","pos","p","details","peg$computeLocation","startPos","endPos","startPosDetails","endPosDetails","offset","peg$fail","push","s0","s1","s2","key","cached","nextPos","result","peg$parse_","peg$parseselectors","peg$c1","peg$parseidentifierName","test","charAt","peg$parsebinaryOp","s3","s4","s5","s6","s7","peg$parseselector","peg$parsehasSelector","left","right","peg$parsesequence","reduce","memo","rhs","subject","as","peg$parseatom","peg$parsewildcard","peg$parseidentifier","peg$parseattrName","peg$parseattrEqOps","substr","peg$parsetype","flgs","peg$parsere_character_class","peg$parsere_escape","peg$parsere_chars","peg$parseflags","RegExp","peg$parseregex","peg$parseattrOps","peg$parsestring","leadingDecimals","apply","parseFloat","peg$parsenumber","peg$parsepath","peg$parseattrValue","peg$parseattr","peg$parsefield","peg$parsenegation","peg$parsematches","peg$parseis","peg$parsehasSelectors","peg$parsehas","nth","peg$parsefirstChild","nthLast","peg$parselastChild","parseInt","peg$parsenthChild","peg$parsenthLastChild","peg$parseclass","n","index","factory","getPath","obj","keys","MATCHER_CACHE","WeakMap","getMatcher","selector","matcher","get","generateMatcher","set","toLowerCase","node","ancestry","nodeTypeKey","path","split","inPath","ancestor","fromPathIndex","current","field","isArray","k","matchers","estraverse","traverse","enter","unshift","leave","shift","visitorKeys","fallback","l","_typeof","sibling","adjacent","nthChild","matchClass","getVisitorKeys","nodeType","VisitorKeys","Object","filter","isNode","side","_slicedToArray","listProp","startIndex","indexOf","lowerBound","upperBound","idx","ast","visitor","altSubjects","subjects","results","sel","_toConsumableArray","m","succeedingAncestry","parser","query","mat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AO8C,EAAM2K,EAAK3N,EAAM4K,GAAW1K,UAGvCmO,EAAMrO,MAAQA,EACdqO,EAAMrL,MAAQA,EACdqL,EAAMrC,SAAWA,EACjBqC,EAAMC,QAvPN,SAAiBpD,EAAMN,EAAUO,EAAUjL,GACvC,OAAK0K,KACAM,IACAC,IAAYA,EAAW,IAErBR,EAAWC,EAAXD,CAAqBO,EAAMC,EAAUjL,KAmPhDmO,EAAMA,MAAQA"}dDx{p!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e=e||self).esquery=t()}(this,(function(){"use strict";function e(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function t(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],u=!0,l=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;u=!1}else for(;!(u=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);u=!0);}catch(e){l=!0,o=e}finally{try{if(!u&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return s}}(e,t)||o(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function r(t){return function(t){if(Array.isArray(t))return e(t)}(t)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(t)||o(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(t,r){if(t){if("string"==typeof t)return e(t,r);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function a(e,t){return e(t={exports:{}},t.exports),t.exports}var i=a((function(e,t){!function e(t){var r,n,o,a,i,s;function u(e){var t,r,n={};for(t in e)e.hasOwnProperty(t)&&(r=e[t],n[t]="object"==typeof r&&null!==r?u(r):r);return n}function l(e,t){this.parent=e,this.key=t}function c(e,t,r,n){this.node=e,this.path=t,this.wrap=r,this.ref=n}function f(){}function p(e){return null!=e&&("object"==typeof e&&"string"==typeof e.type)}function h(e,t){return(e===r.ObjectExpression||e===r.ObjectPattern)&&"properties"===t}function d(e,t){for(var r=e.length-1;r>=0;--r)if(e[r].node===t)return!0;return!1}function y(e,t){return(new f).traverse(e,t)}function m(e,t){var r;return r=function(e,t){var r,n,o,a;for(n=e.length,o=0;n;)t(e[a=o+(r=n>>>1)])?n=r:(o=a+1,n-=r+1);return o}(t,(function(t){return t.range[0]>e.range[0]})),e.extendedRange=[e.range[0],e.range[1]],r!==t.length&&(e.extendedRange[1]=t[r].range[0]),(r-=1)>=0&&(e.extendedRange[0]=t[r].range[1]),e}return r={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ChainExpression:"ChainExpression",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",PrivateIdentifier:"PrivateIdentifier",Program:"Program",Property:"Property",PropertyDefinition:"PropertyDefinition",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},o={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},n={Break:a={},Skip:i={},Remove:s={}},l.prototype.replace=function(e){this.parent[this.key]=e},l.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},f.prototype.path=function(){var e,t,r,n,o;function a(e,t){if(Array.isArray(t))for(r=0,n=t.length;r<n;++r)e.push(t[r]);else e.push(t)}if(!this.__current.path)return null;for(o=[],e=2,t=this.__leavelist.length;e<t;++e)a(o,this.__leavelist[e].path);return a(o,this.__current.path),o},f.prototype.type=function(){return this.current().type||this.__current.wrap},f.prototype.parents=function(){var e,t,r;for(r=[],e=1,t=this.__leavelist.length;e<t;++e)r.push(this.__leavelist[e].node);return r},f.prototype.current=function(){return this.__current.node},f.prototype.__execute=function(e,t){var r,n;return n=void 0,r=this.__current,this.__current=t,this.__state=null,e&&(n=e.call(this,t.node,this.__leavelist[this.__leavelist.length-1].node)),this.__current=r,n},f.prototype.notify=function(e){this.__state=e},f.prototype.skip=function(){this.notify(i)},f.prototype.break=function(){this.notify(a)},f.prototype.remove=function(){this.notify(s)},f.prototype.__initialize=function(e,t){this.visitor=t,this.root=e,this.__worklist=[],this.__leavelist=[],this.__current=null,this.__state=null,this.__fallback=null,"iteration"===t.fallback?this.__fallback=Object.keys:"function"==typeof t.fallback&&(this.__fallback=t.fallback),this.__keys=o,t.keys&&(this.__keys=Object.assign(Object.create(this.__keys),t.keys))},f.prototype.traverse=function(e,t){var r,n,o,s,u,l,f,y,m,x,v,g;for(this.__initialize(e,t),g={},r=this.__worklist,n=this.__leavelist,r.push(new c(e,null,null,null)),n.push(new c(null,null,null,null));r.length;)if((o=r.pop())!==g){if(o.node){if(l=this.__execute(t.enter,o),this.__state===a||l===a)return;if(r.push(g),n.push(o),this.__state===i||l===i)continue;if(u=(s=o.node).type||o.wrap,!(x=this.__keys[u])){if(!this.__fallback)throw new Error("Unknown node type "+u+".");x=this.__fallback(s)}for(y=x.length;(y-=1)>=0;)if(v=s[f=x[y]])if(Array.isArray(v)){for(m=v.length;(m-=1)>=0;)if(v[m]&&!d(n,v[m])){if(h(u,x[y]))o=new c(v[m],[f,m],"Property",null);else{if(!p(v[m]))continue;o=new c(v[m],[f,m],null,null)}r.push(o)}}else if(p(v)){if(d(n,v))continue;r.push(new c(v,f,null,null))}}}else if(o=n.pop(),l=this.__execute(t.leave,o),this.__state===a||l===a)return},f.prototype.replace=function(e,t){var r,n,o,u,f,d,y,m,x,v,g,A,E;function b(e){var t,n,o,a;if(e.ref.remove())for(n=e.ref.key,a=e.ref.parent,t=r.length;t--;)if((o=r[t]).ref&&o.ref.parent===a){if(o.ref.key<n)break;--o.ref.key}}for(this.__initialize(e,t),g={},r=this.__worklist,n=this.__leavelist,d=new c(e,null,null,new l(A={root:e},"root")),r.push(d),n.push(d);r.length;)if((d=r.pop())!==g){if(void 0!==(f=this.__execute(t.enter,d))&&f!==a&&f!==i&&f!==s&&(d.ref.replace(f),d.node=f),this.__state!==s&&f!==s||(b(d),d.node=null),this.__state===a||f===a)return A.root;if((o=d.node)&&(r.push(g),n.push(d),this.__state!==i&&f!==i)){if(u=o.type||d.wrap,!(x=this.__keys[u])){if(!this.__fallback)throw new Error("Unknown node type "+u+".");x=this.__fallback(o)}for(y=x.length;(y-=1)>=0;)if(v=o[E=x[y]])if(Array.isArray(v)){for(m=v.length;(m-=1)>=0;)if(v[m]){if(h(u,x[y]))d=new c(v[m],[E,m],"Property",new l(v,m));else{if(!p(v[m]))continue;d=new c(v[m],[E,m],null,new l(v,m))}r.push(d)}}else p(v)&&r.push(new c(v,E,null,new l(o,E)))}}else if(d=n.pop(),void 0!==(f=this.__execute(t.leave,d))&&f!==a&&f!==i&&f!==s&&d.ref.replace(f),this.__state!==s&&f!==s||b(d),this.__state===a||f===a)return A.root;return A.root},t.Syntax=r,t.traverse=y,t.replace=function(e,t){return(new f).replace(e,t)},t.attachComments=function(e,t,r){var o,a,i,s,l=[];if(!e.range)throw new Error("attachComments needs range information");if(!r.length){if(t.length){for(i=0,a=t.length;i<a;i+=1)(o=u(t[i])).extendedRange=[0,e.range[0]],l.push(o);e.leadingComments=l}return e}for(i=0,a=t.length;i<a;i+=1)l.push(m(u(t[i]),r));return s=0,y(e,{enter:function(e){for(var t;s<l.length&&!((t=l[s]).extendedRange[1]>e.range[0]);)t.extendedRange[1]===e.range[0]?(e.leadingComments||(e.leadingComments=[]),e.leadingComments.push(t),l.splice(s,1)):s+=1;return s===l.length?n.Break:l[s].extendedRange[0]>e.range[1]?n.Skip:void 0}}),s=0,y(e,{leave:function(e){for(var t;s<l.length&&(t=l[s],!(e.range[1]<t.extendedRange[0]));)e.range[1]===t.extendedRange[0]?(e.trailingComments||(e.trailingComments=[]),e.trailingComments.push(t),l.splice(s,1)):s+=1;return s===l.length?n.Break:l[s].extendedRange[0]>e.range[1]?n.Skip:void 0}}),e},t.VisitorKeys=o,t.VisitorOption=n,t.Controller=f,t.cloneEnvironment=function(){return e({})},t}(t)})),s=a((function(e){e.exports&&(e.exports=function(){function e(t,r,n,o){this.message=t,this.expected=r,this.found=n,this.location=o,this.name="SyntaxError","function"==typeof Error.captureStackTrace&&Error.captureStackTrace(this,e)}return function(e,t){function r(){this.constructor=e}r.prototype=t.prototype,e.prototype=new r}(e,Error),e.buildMessage=function(e,t){var r={literal:function(e){return'"'+o(e.text)+'"'},class:function(e){var t,r="";for(t=0;t<e.parts.length;t++)r+=e.parts[t]instanceof Array?a(e.parts[t][0])+"-"+a(e.parts[t][1]):a(e.parts[t]);return"["+(e.inverted?"^":"")+r+"]"},any:function(e){return"any character"},end:function(e){return"end of input"},other:function(e){return e.description}};function n(e){return e.charCodeAt(0).toString(16).toUpperCase()}function o(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}function a(e){return e.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(e){return"\\x0"+n(e)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(e){return"\\x"+n(e)}))}return"Expected "+function(e){var t,n,o,a=new Array(e.length);for(t=0;t<e.length;t++)a[t]=(o=e[t],r[o.type](o));if(a.sort(),a.length>0){for(t=1,n=1;t<a.length;t++)a[t-1]!==a[t]&&(a[n]=a[t],n++);a.length=n}switch(a.length){case 1:return a[0];case 2:return a[0]+" or "+a[1];default:return a.slice(0,-1).join(", ")+", or "+a[a.length-1]}}(e)+" but "+function(e){return e?'"'+o(e)+'"':"end of input"}(t)+" found."},{SyntaxError:e,parse:function(t,r){r=void 0!==r?r:{};var n,o,a,i,s={},u={start:Ae},l=Ae,c=ye(" ",!1),f=/^[^ [\],():#!=><~+.]/,p=me([" ","[","]",",","(",")",":","#","!","=",">","<","~","+","."],!0,!1),h=ye(">",!1),d=ye("~",!1),y=ye("+",!1),m=ye(",",!1),x=function(e,t){return[e].concat(t.map((function(e){return e[3]})))},v=ye("!",!1),g=ye("*",!1),A=ye("#",!1),E=ye("[",!1),b=ye("]",!1),S=/^[><!]/,_=me([">","<","!"],!1,!1),C=ye("=",!1),P=function(e){return(e||"")+"="},w=/^[><]/,k=me([">","<"],!1,!1),D=ye(".",!1),I=function(e,t,r){return{type:"attribute",name:e,operator:t,value:r}},j=ye('"',!1),T=/^[^\\"]/,F=me(["\\",'"'],!0,!1),R=ye("\\",!1),O={type:"any"},L=function(e,t){return e+t},M=function(e){return{type:"literal",value:(t=e.join(""),t.replace(/\\(.)/g,(function(e,t){switch(t){case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";case"v":return"\v";default:return t}})))};var t},B=ye("'",!1),U=/^[^\\']/,K=me(["\\","'"],!0,!1),N=/^[0-9]/,W=me([["0","9"]],!1,!1),q=ye("type(",!1),V=/^[^ )]/,G=me([" ",")"],!0,!1),z=ye(")",!1),H=/^[imsu]/,Y=me(["i","m","s","u"],!1,!1),$=ye("/",!1),J=/^[^\]\\]/,Q=me(["]","\\"],!0,!1),X=/^[^\/\\[]/,Z=me(["/","\\","["],!0,!1),ee=ye(":not(",!1),te=ye(":matches(",!1),re=function(e){return{type:"matches",selectors:e}},ne=ye(":is(",!1),oe=ye(":has(",!1),ae=ye(":first-child",!1),ie=ye(":last-child",!1),se=ye(":nth-child(",!1),ue=ye(":nth-last-child(",!1),le=ye(":",!1),ce=0,fe=[{line:1,column:1}],pe=0,he=[],de={};if("startRule"in r){if(!(r.startRule in u))throw new Error("Can't start parsing from rule \""+r.startRule+'".');l=u[r.startRule]}function ye(e,t){return{type:"literal",text:e,ignoreCase:t}}function me(e,t,r){return{type:"class",parts:e,inverted:t,ignoreCase:r}}function xe(e){var r,n=fe[e];if(n)return n;for(r=e-1;!fe[r];)r--;for(n={line:(n=fe[r]).line,column:n.column};r<e;)10===t.charCodeAt(r)?(n.line++,n.column=1):n.column++,r++;return fe[e]=n,n}function ve(e,t){var r=xe(e),n=xe(t);return{start:{offset:e,line:r.line,column:r.column},end:{offset:t,line:n.line,column:n.column}}}function ge(e){ce<pe||(ce>pe&&(pe=ce,he=[]),he.push(e))}function Ae(){var e,t,r,n,o=36*ce+0,a=de[o];return a?(ce=a.nextPos,a.result):(e=ce,(t=Ee())!==s&&(r=_e())!==s&&Ee()!==s?e=t=1===(n=r).length?n[0]:{type:"matches",selectors:n}:(ce=e,e=s),e===s&&(e=ce,(t=Ee())!==s&&(t=void 0),e=t),de[o]={nextPos:ce,result:e},e)}function Ee(){var e,r,n=36*ce+1,o=de[n];if(o)return ce=o.nextPos,o.result;for(e=[],32===t.charCodeAt(ce)?(r=" ",ce++):(r=s,ge(c));r!==s;)e.push(r),32===t.charCodeAt(ce)?(r=" ",ce++):(r=s,ge(c));return de[n]={nextPos:ce,result:e},e}function be(){var e,r,n,o=36*ce+2,a=de[o];if(a)return ce=a.nextPos,a.result;if(r=[],f.test(t.charAt(ce))?(n=t.charAt(ce),ce++):(n=s,ge(p)),n!==s)for(;n!==s;)r.push(n),f.test(t.charAt(ce))?(n=t.charAt(ce),ce++):(n=s,ge(p));else r=s;return r!==s&&(r=r.join("")),e=r,de[o]={nextPos:ce,result:e},e}function Se(){var e,r,n,o=36*ce+3,a=de[o];return a?(ce=a.nextPos,a.result):(e=ce,(r=Ee())!==s?(62===t.charCodeAt(ce)?(n=">",ce++):(n=s,ge(h)),n!==s&&Ee()!==s?e=r="child":(ce=e,e=s)):(ce=e,e=s),e===s&&(e=ce,(r=Ee())!==s?(126===t.charCodeAt(ce)?(n="~",ce++):(n=s,ge(d)),n!==s&&Ee()!==s?e=r="sibling":(ce=e,e=s)):(ce=e,e=s),e===s&&(e=ce,(r=Ee())!==s?(43===t.charCodeAt(ce)?(n="+",ce++):(n=s,ge(y)),n!==s&&Ee()!==s?e=r="adjacent":(ce=e,e=s)):(ce=e,e=s),e===s&&(e=ce,32===t.charCodeAt(ce)?(r=" ",ce++):(r=s,ge(c)),r!==s&&(n=Ee())!==s?e=r="descendant":(ce=e,e=s)))),de[o]={nextPos:ce,result:e},e)}function _e(){var e,r,n,o,a,i,u,l,c=36*ce+5,f=de[c];if(f)return ce=f.nextPos,f.result;if(e=ce,(r=Pe())!==s){for(n=[],o=ce,(a=Ee())!==s?(44===t.charCodeAt(ce)?(i=",",ce++):(i=s,ge(m)),i!==s&&(u=Ee())!==s&&(l=Pe())!==s?o=a=[a,i,u,l]:(ce=o,o=s)):(ce=o,o=s);o!==s;)n.push(o),o=ce,(a=Ee())!==s?(44===t.charCodeAt(ce)?(i=",",ce++):(i=s,ge(m)),i!==s&&(u=Ee())!==s&&(l=Pe())!==s?o=a=[a,i,u,l]:(ce=o,o=s)):(ce=o,o=s);n!==s?e=r=x(r,n):(ce=e,e=s)}else ce=e,e=s;return de[c]={nextPos:ce,result:e},e}function Ce(){var e,t,r,n,o,a=36*ce+6,i=de[a];return i?(ce=i.nextPos,i.result):(e=ce,(t=Se())===s&&(t=null),t!==s&&(r=Pe())!==s?(o=r,e=t=(n=t)?{type:n,left:{type:"exactNode"},right:o}:o):(ce=e,e=s),de[a]={nextPos:ce,result:e},e)}function Pe(){var e,t,r,n,o,a,i,u=36*ce+7,l=de[u];if(l)return ce=l.nextPos,l.result;if(e=ce,(t=we())!==s){for(r=[],n=ce,(o=Se())!==s&&(a=we())!==s?n=o=[o,a]:(ce=n,n=s);n!==s;)r.push(n),n=ce,(o=Se())!==s&&(a=we())!==s?n=o=[o,a]:(ce=n,n=s);r!==s?(i=t,e=t=r.reduce((function(e,t){return{type:t[0],left:e,right:t[1]}}),i)):(ce=e,e=s)}else ce=e,e=s;return de[u]={nextPos:ce,result:e},e}function we(){var e,r,n,o,a,i,u,l=36*ce+8,c=de[l];if(c)return ce=c.nextPos,c.result;if(e=ce,33===t.charCodeAt(ce)?(r="!",ce++):(r=s,ge(v)),r===s&&(r=null),r!==s){if(n=[],(o=ke())!==s)for(;o!==s;)n.push(o),o=ke();else n=s;n!==s?(a=r,u=1===(i=n).length?i[0]:{type:"compound",selectors:i},a&&(u.subject=!0),e=r=u):(ce=e,e=s)}else ce=e,e=s;return de[l]={nextPos:ce,result:e},e}function ke(){var e,r=36*ce+9,n=de[r];return n?(ce=n.nextPos,n.result):((e=function(){var e,r,n=36*ce+10,o=de[n];return o?(ce=o.nextPos,o.result):(42===t.charCodeAt(ce)?(r="*",ce++):(r=s,ge(g)),r!==s&&(r={type:"wildcard",value:r}),e=r,de[n]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,o=36*ce+11,a=de[o];return a?(ce=a.nextPos,a.result):(e=ce,35===t.charCodeAt(ce)?(r="#",ce++):(r=s,ge(A)),r===s&&(r=null),r!==s&&(n=be())!==s?e=r={type:"identifier",value:n}:(ce=e,e=s),de[o]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,o,a=36*ce+12,i=de[a];return i?(ce=i.nextPos,i.result):(e=ce,91===t.charCodeAt(ce)?(r="[",ce++):(r=s,ge(E)),r!==s&&Ee()!==s&&(n=function(){var e,r,n,o,a=36*ce+16,i=de[a];return i?(ce=i.nextPos,i.result):(e=ce,(r=De())!==s&&Ee()!==s&&(n=function(){var e,r,n,o=36*ce+14,a=de[o];return a?(ce=a.nextPos,a.result):(e=ce,33===t.charCodeAt(ce)?(r="!",ce++):(r=s,ge(v)),r===s&&(r=null),r!==s?(61===t.charCodeAt(ce)?(n="=",ce++):(n=s,ge(C)),n!==s?(r=P(r),e=r):(ce=e,e=s)):(ce=e,e=s),de[o]={nextPos:ce,result:e},e)}())!==s&&Ee()!==s?((o=function(){var e,r,n,o,a,i=36*ce+20,u=de[i];if(u)return ce=u.nextPos,u.result;if(e=ce,"type("===t.substr(ce,5)?(r="type(",ce+=5):(r=s,ge(q)),r!==s)if(Ee()!==s){if(n=[],V.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(G)),o!==s)for(;o!==s;)n.push(o),V.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(G));else n=s;n!==s&&(o=Ee())!==s?(41===t.charCodeAt(ce)?(a=")",ce++):(a=s,ge(z)),a!==s?(r={type:"type",value:n.join("")},e=r):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;else ce=e,e=s;return de[i]={nextPos:ce,result:e},e}())===s&&(o=function(){var e,r,n,o,a,i,u=36*ce+22,l=de[u];if(l)return ce=l.nextPos,l.result;if(e=ce,47===t.charCodeAt(ce)?(r="/",ce++):(r=s,ge($)),r!==s){if(n=[],(o=Ie())===s&&(o=je())===s&&(o=Te()),o!==s)for(;o!==s;)n.push(o),(o=Ie())===s&&(o=je())===s&&(o=Te());else n=s;n!==s?(47===t.charCodeAt(ce)?(o="/",ce++):(o=s,ge($)),o!==s?((a=function(){var e,r,n=36*ce+21,o=de[n];if(o)return ce=o.nextPos,o.result;if(e=[],H.test(t.charAt(ce))?(r=t.charAt(ce),ce++):(r=s,ge(Y)),r!==s)for(;r!==s;)e.push(r),H.test(t.charAt(ce))?(r=t.charAt(ce),ce++):(r=s,ge(Y));else e=s;return de[n]={nextPos:ce,result:e},e}())===s&&(a=null),a!==s?(i=a,r={type:"regexp",value:new RegExp(n.join(""),i?i.join(""):"")},e=r):(ce=e,e=s)):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;return de[u]={nextPos:ce,result:e},e}()),o!==s?(r=I(r,n,o),e=r):(ce=e,e=s)):(ce=e,e=s),e===s&&(e=ce,(r=De())!==s&&Ee()!==s&&(n=function(){var e,r,n,o=36*ce+13,a=de[o];return a?(ce=a.nextPos,a.result):(e=ce,S.test(t.charAt(ce))?(r=t.charAt(ce),ce++):(r=s,ge(_)),r===s&&(r=null),r!==s?(61===t.charCodeAt(ce)?(n="=",ce++):(n=s,ge(C)),n!==s?(r=P(r),e=r):(ce=e,e=s)):(ce=e,e=s),e===s&&(w.test(t.charAt(ce))?(e=t.charAt(ce),ce++):(e=s,ge(k))),de[o]={nextPos:ce,result:e},e)}())!==s&&Ee()!==s?((o=function(){var e,r,n,o,a,i,u=36*ce+17,l=de[u];if(l)return ce=l.nextPos,l.result;if(e=ce,34===t.charCodeAt(ce)?(r='"',ce++):(r=s,ge(j)),r!==s){for(n=[],T.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(F)),o===s&&(o=ce,92===t.charCodeAt(ce)?(a="\\",ce++):(a=s,ge(R)),a!==s?(t.length>ce?(i=t.charAt(ce),ce++):(i=s,ge(O)),i!==s?(a=L(a,i),o=a):(ce=o,o=s)):(ce=o,o=s));o!==s;)n.push(o),T.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(F)),o===s&&(o=ce,92===t.charCodeAt(ce)?(a="\\",ce++):(a=s,ge(R)),a!==s?(t.length>ce?(i=t.charAt(ce),ce++):(i=s,ge(O)),i!==s?(a=L(a,i),o=a):(ce=o,o=s)):(ce=o,o=s));n!==s?(34===t.charCodeAt(ce)?(o='"',ce++):(o=s,ge(j)),o!==s?(r=M(n),e=r):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;if(e===s)if(e=ce,39===t.charCodeAt(ce)?(r="'",ce++):(r=s,ge(B)),r!==s){for(n=[],U.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(K)),o===s&&(o=ce,92===t.charCodeAt(ce)?(a="\\",ce++):(a=s,ge(R)),a!==s?(t.length>ce?(i=t.charAt(ce),ce++):(i=s,ge(O)),i!==s?(a=L(a,i),o=a):(ce=o,o=s)):(ce=o,o=s));o!==s;)n.push(o),U.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(K)),o===s&&(o=ce,92===t.charCodeAt(ce)?(a="\\",ce++):(a=s,ge(R)),a!==s?(t.length>ce?(i=t.charAt(ce),ce++):(i=s,ge(O)),i!==s?(a=L(a,i),o=a):(ce=o,o=s)):(ce=o,o=s));n!==s?(39===t.charCodeAt(ce)?(o="'",ce++):(o=s,ge(B)),o!==s?(r=M(n),e=r):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;return de[u]={nextPos:ce,result:e},e}())===s&&(o=function(){var e,r,n,o,a,i,u,l=36*ce+18,c=de[l];if(c)return ce=c.nextPos,c.result;for(e=ce,r=ce,n=[],N.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(W));o!==s;)n.push(o),N.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(W));if(n!==s?(46===t.charCodeAt(ce)?(o=".",ce++):(o=s,ge(D)),o!==s?r=n=[n,o]:(ce=r,r=s)):(ce=r,r=s),r===s&&(r=null),r!==s){if(n=[],N.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(W)),o!==s)for(;o!==s;)n.push(o),N.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(W));else n=s;n!==s?(i=n,u=(a=r)?[].concat.apply([],a).join(""):"",r={type:"literal",value:parseFloat(u+i.join(""))},e=r):(ce=e,e=s)}else ce=e,e=s;return de[l]={nextPos:ce,result:e},e}())===s&&(o=function(){var e,t,r=36*ce+19,n=de[r];return n?(ce=n.nextPos,n.result):((t=be())!==s&&(t={type:"literal",value:t}),e=t,de[r]={nextPos:ce,result:e},e)}()),o!==s?(r=I(r,n,o),e=r):(ce=e,e=s)):(ce=e,e=s),e===s&&(e=ce,(r=De())!==s&&(r={type:"attribute",name:r}),e=r)),de[a]={nextPos:ce,result:e},e)}())!==s&&Ee()!==s?(93===t.charCodeAt(ce)?(o="]",ce++):(o=s,ge(b)),o!==s?e=r=n:(ce=e,e=s)):(ce=e,e=s),de[a]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,o,a,i,u,l,c=36*ce+26,f=de[c];if(f)return ce=f.nextPos,f.result;if(e=ce,46===t.charCodeAt(ce)?(r=".",ce++):(r=s,ge(D)),r!==s)if((n=be())!==s){for(o=[],a=ce,46===t.charCodeAt(ce)?(i=".",ce++):(i=s,ge(D)),i!==s&&(u=be())!==s?a=i=[i,u]:(ce=a,a=s);a!==s;)o.push(a),a=ce,46===t.charCodeAt(ce)?(i=".",ce++):(i=s,ge(D)),i!==s&&(u=be())!==s?a=i=[i,u]:(ce=a,a=s);o!==s?(l=n,r={type:"field",name:o.reduce((function(e,t){return e+t[0]+t[1]}),l)},e=r):(ce=e,e=s)}else ce=e,e=s;else ce=e,e=s;return de[c]={nextPos:ce,result:e},e}())===s&&(e=function(){var e,r,n,o,a=36*ce+27,i=de[a];return i?(ce=i.nextPos,i.result):(e=ce,":not("===t.substr(ce,5)?(r=":not(",ce+=5):(r=s,ge(ee)),r!==s&&Ee()!==s&&(n=_e())!==s&&Ee()!==s?(41===t.charCodeAt(ce)?(o=")",ce++):(o=s,ge(z)),o!==s?e=r={type:"not",selectors:n}:(ce=e,e=s)):(ce=e,e=s),de[a]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,o,a=36*ce+28,i=de[a];return i?(ce=i.nextPos,i.result):(e=ce,":matches("===t.substr(ce,9)?(r=":matches(",ce+=9):(r=s,ge(te)),r!==s&&Ee()!==s&&(n=_e())!==s&&Ee()!==s?(41===t.charCodeAt(ce)?(o=")",ce++):(o=s,ge(z)),o!==s?(r=re(n),e=r):(ce=e,e=s)):(ce=e,e=s),de[a]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,o,a=36*ce+29,i=de[a];return i?(ce=i.nextPos,i.result):(e=ce,":is("===t.substr(ce,4)?(r=":is(",ce+=4):(r=s,ge(ne)),r!==s&&Ee()!==s&&(n=_e())!==s&&Ee()!==s?(41===t.charCodeAt(ce)?(o=")",ce++):(o=s,ge(z)),o!==s?(r=re(n),e=r):(ce=e,e=s)):(ce=e,e=s),de[a]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,o,a=36*ce+30,i=de[a];return i?(ce=i.nextPos,i.result):(e=ce,":has("===t.substr(ce,5)?(r=":has(",ce+=5):(r=s,ge(oe)),r!==s&&Ee()!==s&&(n=function(){var e,r,n,o,a,i,u,l,c=36*ce+4,f=de[c];if(f)return ce=f.nextPos,f.result;if(e=ce,(r=Ce())!==s){for(n=[],o=ce,(a=Ee())!==s?(44===t.charCodeAt(ce)?(i=",",ce++):(i=s,ge(m)),i!==s&&(u=Ee())!==s&&(l=Ce())!==s?o=a=[a,i,u,l]:(ce=o,o=s)):(ce=o,o=s);o!==s;)n.push(o),o=ce,(a=Ee())!==s?(44===t.charCodeAt(ce)?(i=",",ce++):(i=s,ge(m)),i!==s&&(u=Ee())!==s&&(l=Ce())!==s?o=a=[a,i,u,l]:(ce=o,o=s)):(ce=o,o=s);n!==s?e=r=x(r,n):(ce=e,e=s)}else ce=e,e=s;return de[c]={nextPos:ce,result:e},e}())!==s&&Ee()!==s?(41===t.charCodeAt(ce)?(o=")",ce++):(o=s,ge(z)),o!==s?e=r={type:"has",selectors:n}:(ce=e,e=s)):(ce=e,e=s),de[a]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n=36*ce+31,o=de[n];return o?(ce=o.nextPos,o.result):(":first-child"===t.substr(ce,12)?(r=":first-child",ce+=12):(r=s,ge(ae)),r!==s&&(r=Fe(1)),e=r,de[n]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n=36*ce+32,o=de[n];return o?(ce=o.nextPos,o.result):(":last-child"===t.substr(ce,11)?(r=":last-child",ce+=11):(r=s,ge(ie)),r!==s&&(r=Re(1)),e=r,de[n]={nextPos:ce,result:e},e)}())===s&&(e=function(){var e,r,n,o,a,i=36*ce+33,u=de[i];if(u)return ce=u.nextPos,u.result;if(e=ce,":nth-child("===t.substr(ce,11)?(r=":nth-child(",ce+=11):(r=s,ge(se)),r!==s)if(Ee()!==s){if(n=[],N.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(W)),o!==s)for(;o!==s;)n.push(o),N.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(W));else n=s;n!==s&&(o=Ee())!==s?(41===t.charCodeAt(ce)?(a=")",ce++):(a=s,ge(z)),a!==s?(r=Fe(parseInt(n.join(""),10)),e=r):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;else ce=e,e=s;return de[i]={nextPos:ce,result:e},e}())===s&&(e=function(){var e,r,n,o,a,i=36*ce+34,u=de[i];if(u)return ce=u.nextPos,u.result;if(e=ce,":nth-last-child("===t.substr(ce,16)?(r=":nth-last-child(",ce+=16):(r=s,ge(ue)),r!==s)if(Ee()!==s){if(n=[],N.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(W)),o!==s)for(;o!==s;)n.push(o),N.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(W));else n=s;n!==s&&(o=Ee())!==s?(41===t.charCodeAt(ce)?(a=")",ce++):(a=s,ge(z)),a!==s?(r=Re(parseInt(n.join(""),10)),e=r):(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;else ce=e,e=s;return de[i]={nextPos:ce,result:e},e}())===s&&(e=function(){var e,r,n,o=36*ce+35,a=de[o];return a?(ce=a.nextPos,a.result):(e=ce,58===t.charCodeAt(ce)?(r=":",ce++):(r=s,ge(le)),r!==s&&(n=be())!==s?e=r={type:"class",name:n}:(ce=e,e=s),de[o]={nextPos:ce,result:e},e)}()),de[r]={nextPos:ce,result:e},e)}function De(){var e,r,n,o,a,i,u,l,c=36*ce+15,f=de[c];if(f)return ce=f.nextPos,f.result;if(e=ce,(r=be())!==s){for(n=[],o=ce,46===t.charCodeAt(ce)?(a=".",ce++):(a=s,ge(D)),a!==s&&(i=be())!==s?o=a=[a,i]:(ce=o,o=s);o!==s;)n.push(o),o=ce,46===t.charCodeAt(ce)?(a=".",ce++):(a=s,ge(D)),a!==s&&(i=be())!==s?o=a=[a,i]:(ce=o,o=s);n!==s?(u=r,l=n,e=r=[].concat.apply([u],l).join("")):(ce=e,e=s)}else ce=e,e=s;return de[c]={nextPos:ce,result:e},e}function Ie(){var e,r,n,o,a=36*ce+23,i=de[a];if(i)return ce=i.nextPos,i.result;if(e=ce,91===t.charCodeAt(ce)?(r="[",ce++):(r=s,ge(E)),r!==s){if(n=[],J.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(Q)),o===s&&(o=je()),o!==s)for(;o!==s;)n.push(o),J.test(t.charAt(ce))?(o=t.charAt(ce),ce++):(o=s,ge(Q)),o===s&&(o=je());else n=s;n!==s?(93===t.charCodeAt(ce)?(o="]",ce++):(o=s,ge(b)),o!==s?e=r="["+n.join("")+"]":(ce=e,e=s)):(ce=e,e=s)}else ce=e,e=s;return de[a]={nextPos:ce,result:e},e}function je(){var e,r,n,o=36*ce+24,a=de[o];return a?(ce=a.nextPos,a.result):(e=ce,92===t.charCodeAt(ce)?(r="\\",ce++):(r=s,ge(R)),r!==s?(t.length>ce?(n=t.charAt(ce),ce++):(n=s,ge(O)),n!==s?e=r="\\"+n:(ce=e,e=s)):(ce=e,e=s),de[o]={nextPos:ce,result:e},e)}function Te(){var e,r,n,o=36*ce+25,a=de[o];if(a)return ce=a.nextPos,a.result;if(r=[],X.test(t.charAt(ce))?(n=t.charAt(ce),ce++):(n=s,ge(Z)),n!==s)for(;n!==s;)r.push(n),X.test(t.charAt(ce))?(n=t.charAt(ce),ce++):(n=s,ge(Z));else r=s;return r!==s&&(r=r.join("")),e=r,de[o]={nextPos:ce,result:e},e}function Fe(e){return{type:"nth-child",index:{type:"literal",value:e}}}function Re(e){return{type:"nth-last-child",index:{type:"literal",value:e}}}if((n=l())!==s&&ce===t.length)return n;throw n!==s&&ce<t.length&&ge({type:"end"}),o=he,a=pe<t.length?t.charAt(pe):null,i=pe<t.length?ve(pe,pe+1):ve(pe,pe),new e(e.buildMessage(o,a),o,a,i)}}}())}));function u(e,t){for(var r=0;r<t.length;++r){if(null==e)return e;e=e[t[r]]}return e}var l="function"==typeof WeakMap?new WeakMap:null;function c(e){if(null==e)return function(){return!0};if(null!=l){var t=l.get(e);return null!=t||(t=f(e),l.set(e,t)),t}return f(e)}function f(e){switch(e.type){case"wildcard":return function(){return!0};case"identifier":var t=e.value.toLowerCase();return function(e,r,n){var o=n&&n.nodeTypeKey||"type";return t===e[o].toLowerCase()};case"exactNode":return function(e,t){return 0===t.length};case"field":var r=e.name.split(".");return function(e,t){return function e(t,r,n,o){for(var a=r,i=o;i<n.length;++i){if(null==a)return!1;var s=a[n[i]];if(Array.isArray(s)){for(var u=0;u<s.length;++u)if(e(t,s[u],n,i+1))return!0;return!1}a=s}return t===a}(e,t[r.length-1],r,0)};case"matches":var o=e.selectors.map(c);return function(e,t,r){for(var n=0;n<o.length;++n)if(o[n](e,t,r))return!0;return!1};case"compound":var a=e.selectors.map(c);return function(e,t,r){for(var n=0;n<a.length;++n)if(!a[n](e,t,r))return!1;return!0};case"not":var s=e.selectors.map(c);return function(e,t,r){for(var n=0;n<s.length;++n)if(s[n](e,t,r))return!1;return!0};case"has":var l=e.selectors.map(c);return function(e,t,r){var n=!1,o=[];return i.traverse(e,{enter:function(e,t){null!=t&&o.unshift(t);for(var a=0;a<l.length;++a)if(l[a](e,o,r))return n=!0,void this.break()},leave:function(){o.shift()},keys:r&&r.visitorKeys,fallback:r&&r.fallback||"iteration"}),n};case"child":var f=c(e.left),p=c(e.right);return function(e,t,r){return!!(t.length>0&&p(e,t,r))&&f(t[0],t.slice(1),r)};case"descendant":var h=c(e.left),x=c(e.right);return function(e,t,r){if(x(e,t,r))for(var n=0,o=t.length;n<o;++n)if(h(t[n],t.slice(n+1),r))return!0;return!1};case"attribute":var v=e.name.split(".");switch(e.operator){case void 0:return function(e){return null!=u(e,v)};case"=":switch(e.value.type){case"regexp":return function(t){var r=u(t,v);return"string"==typeof r&&e.value.value.test(r)};case"literal":var g="".concat(e.value.value);return function(e){return g==="".concat(u(e,v))};case"type":return function(t){return e.value.value===n(u(t,v))}}throw new Error("Unknown selector value type: ".concat(e.value.type));case"!=":switch(e.value.type){case"regexp":return function(t){return!e.value.value.test(u(t,v))};case"literal":var A="".concat(e.value.value);return function(e){return A!=="".concat(u(e,v))};case"type":return function(t){return e.value.value!==n(u(t,v))}}throw new Error("Unknown selector value type: ".concat(e.value.type));case"<=":return function(t){return u(t,v)<=e.value.value};case"<":return function(t){return u(t,v)<e.value.value};case">":return function(t){return u(t,v)>e.value.value};case">=":return function(t){return u(t,v)>=e.value.value}}throw new Error("Unknown operator: ".concat(e.operator));case"sibling":var E=c(e.left),b=c(e.right);return function(t,r,n){return b(t,r,n)&&d(t,E,r,"LEFT_SIDE",n)||e.left.subject&&E(t,r,n)&&d(t,b,r,"RIGHT_SIDE",n)};case"adjacent":var S=c(e.left),_=c(e.right);return function(t,r,n){return _(t,r,n)&&y(t,S,r,"LEFT_SIDE",n)||e.right.subject&&S(t,r,n)&&y(t,_,r,"RIGHT_SIDE",n)};case"nth-child":var C=e.index.value,P=c(e.right);return function(e,t,r){return P(e,t,r)&&m(e,t,C,r)};case"nth-last-child":var w=-e.index.value,k=c(e.right);return function(e,t,r){return k(e,t,r)&&m(e,t,w,r)};case"class":var D=e.name.toLowerCase();return function(t,r,n){if(n&&n.matchClass)return n.matchClass(e.name,t,r);if(n&&n.nodeTypeKey)return!1;switch(D){case"statement":if("Statement"===t.type.slice(-9))return!0;case"declaration":return"Declaration"===t.type.slice(-11);case"pattern":if("Pattern"===t.type.slice(-7))return!0;case"expression":return"Expression"===t.type.slice(-10)||"Literal"===t.type.slice(-7)||"Identifier"===t.type&&(0===r.length||"MetaProperty"!==r[0].type)||"MetaProperty"===t.type;case"function":return"FunctionDeclaration"===t.type||"FunctionExpression"===t.type||"ArrowFunctionExpression"===t.type}throw new Error("Unknown class name: ".concat(e.name))}}throw new Error("Unknown selector type: ".concat(e.type))}function p(e,t){var r=t&&t.nodeTypeKey||"type",n=e[r];return t&&t.visitorKeys&&t.visitorKeys[n]?t.visitorKeys[n]:i.VisitorKeys[n]?i.VisitorKeys[n]:t&&"function"==typeof t.fallback?t.fallback(e):Object.keys(e).filter((function(e){return e!==r}))}function h(e,t){var r=t&&t.nodeTypeKey||"type";return null!==e&&"object"===n(e)&&"string"==typeof e[r]}function d(e,r,n,o,a){var i=t(n,1)[0];if(!i)return!1;for(var s=p(i,a),u=0;u<s.length;++u){var l=i[s[u]];if(Array.isArray(l)){var c=l.indexOf(e);if(c<0)continue;var f=void 0,d=void 0;"LEFT_SIDE"===o?(f=0,d=c):(f=c+1,d=l.length);for(var y=f;y<d;++y)if(h(l[y],a)&&r(l[y],n,a))return!0}}return!1}function y(e,r,n,o,a){var i=t(n,1)[0];if(!i)return!1;for(var s=p(i,a),u=0;u<s.length;++u){var l=i[s[u]];if(Array.isArray(l)){var c=l.indexOf(e);if(c<0)continue;if("LEFT_SIDE"===o&&c>0&&h(l[c-1],a)&&r(l[c-1],n,a))return!0;if("RIGHT_SIDE"===o&&c<l.length-1&&h(l[c+1],a)&&r(l[c+1],n,a))return!0}}return!1}function m(e,r,n,o){if(0===n)return!1;var a=t(r,1)[0];if(!a)return!1;for(var i=p(a,o),s=0;s<i.length;++s){var u=a[i[s]];if(Array.isArray(u)){var l=n<0?u.length+n:n-1;if(l>=0&&l<u.length&&u[l]===e)return!0}}return!1}function x(e,t,o,a){if(t){var s=[],u=c(t),l=function e(t,o){if(null==t||"object"!=n(t))return[];null==o&&(o=t);for(var a=t.subject?[o]:[],i=Object.keys(t),s=0;s<i.length;++s){var u=i[s],l=t[u];a.push.apply(a,r(e(l,"left"===u?l:o)))}return a}(t).map(c);i.traverse(e,{enter:function(e,t){if(null!=t&&s.unshift(t),u(e,s,a))if(l.length)for(var r=0,n=l.length;r<n;++r){l[r](e,s,a)&&o(e,t,s);for(var i=0,c=s.length;i<c;++i){var f=s.slice(i+1);l[r](s[i],f,a)&&o(s[i],t,f)}}else o(e,t,s)},leave:function(){s.shift()},keys:a&&a.visitorKeys,fallback:a&&a.fallback||"iteration"})}}function v(e,t,r){var n=[];return x(e,t,(function(e){n.push(e)}),r),n}function g(e){return s.parse(e)}function A(e,t,r){return v(e,g(t),r)}return A.parse=g,A.match=v,A.traverse=x,A.matches=function(e,t,r,n){return!t||!!e&&(r||(r=[]),c(t)(e,r,n))},A.query=A,A}));
//# sourceMappingURL=esquery.min.js.map
%\x   {"version":3,"file":"esquery.min.js","sources":["../node_modules/estraverse/estraverse.js","../parser.js","../esquery.js"],"sourcesContent":["/*\n  Copyright (C) 2012-2013 Yusuke Suzuki <utatane.tea@gmail.com>\n  Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>\n\n  Redistribution and use in source and binary forms, with or without\n  modification, are permitted provided that the following conditions are met:\n\n    * Redistributions of source code must retain the above copyright\n      notice, this list of conditions and the following disclaimer.\n    * Redistributions in binary form must reproduce the above copyright\n      notice, this list of conditions and the following disclaimer in the\n      documentation and/or other materials provided with the distribution.\n\n  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY\n  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;\n  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND\n  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\n/*jslint vars:false, bitwise:true*/\n/*jshint indent:4*/\n/*global exports:true*/\n(function clone(exports) {\n    'use strict';\n\n    var Syntax,\n        VisitorOption,\n        VisitorKeys,\n        BREAK,\n        SKIP,\n        REMOVE;\n\n    function deepCopy(obj) {\n        var ret = {}, key, val;\n        for (key in obj) {\n            if (obj.hasOwnProperty(key)) {\n                val = obj[key];\n                if (typeof val === 'object' && val !== null) {\n                    ret[key] = deepCopy(val);\n                } else {\n                    ret[key] = val;\n                }\n            }\n        }\n        return ret;\n    }\n\n    // based on LLVM libc++ upper_bound / lower_bound\n    // MIT License\n\n    function upperBound(array, func) {\n        var diff, len, i, current;\n\n        len = array.length;\n        i = 0;\n\n        while (len) {\n            diff = len >>> 1;\n            current = i + diff;\n            if (func(array[current])) {\n                len = diff;\n            } else {\n                i = current + 1;\n                len -= diff + 1;\n            }\n        }\n        return i;\n    }\n\n    Syntax = {\n        AssignmentExpression: 'AssignmentExpression',\n        AssignmentPattern: 'AssignmentPattern',\n        ArrayExpression: 'ArrayExpression',\n        ArrayPattern: 'ArrayPattern',\n        ArrowFunctionExpression: 'ArrowFunctionExpression',\n        AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7.\n        BlockStatement: 'BlockStatement',\n        BinaryExpression: 'BinaryExpression',\n        BreakStatement: 'BreakStatement',\n        CallExpression: 'CallExpression',\n        CatchClause: 'CatchClause',\n        ChainExpression: 'ChainExpression',\n        ClassBody: 'ClassBody',\n        ClassDeclaration: 'ClassDeclaration',\n        ClassExpression: 'ClassExpression',\n        ComprehensionBlock: 'ComprehensionBlock',  // CAUTION: It's deferred to ES7.\n        ComprehensionExpression: 'ComprehensionExpression',  // CAUTION: It's deferred to ES7.\n        ConditionalExpression: 'ConditionalExpression',\n        ContinueStatement: 'ContinueStatement',\n        DebuggerStatement: 'DebuggerStatement',\n        DirectiveStatement: 'DirectiveStatement',\n        DoWhileStatement: 'DoWhileStatement',\n        EmptyStatement: 'EmptyStatement',\n        ExportAllDeclaration: 'ExportAllDeclaration',\n        ExportDefaultDeclaration: 'ExportDefaultDeclaration',\n        ExportNamedDeclaration: 'ExportNamedDeclaration',\n        ExportSpecifier: 'ExportSpecifier',\n        ExpressionStatement: 'ExpressionStatement',\n        ForStatement: 'ForStatement',\n        ForInStatement: 'ForInStatement',\n        ForOfStatement: 'ForOfStatement',\n        FunctionDeclaration: 'FunctionDeclaration',\n        FunctionExpression: 'FunctionExpression',\n        GeneratorExpression: 'GeneratorExpression',  // CAUTION: It's deferred to ES7.\n        Identifier: 'Identifier',\n        IfStatement: 'IfStatement',\n        ImportExpression: 'ImportExpression',\n        ImportDeclaration: 'ImportDeclaration',\n        ImportDefaultSpecifier: 'ImportDefaultSpecifier',\n        ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',\n        ImportSpecifier: 'ImportSpecifier',\n        Literal: 'Literal',\n        LabeledStatement: 'LabeledStatement',\n        LogicalExpression: 'LogicalExpression',\n        MemberExpression: 'MemberExpression',\n        MetaProperty: 'MetaProperty',\n        MethodDefinition: 'MethodDefinition',\n        ModuleSpecifier: 'ModuleSpecifier',\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        Super: 'Super',\n        SwitchStatement: 'SwitchStatement',\n        SwitchCase: 'SwitchCase',\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    };\n\n    VisitorKeys = {\n        AssignmentExpression: ['left', 'right'],\n        AssignmentPattern: ['left', 'right'],\n        ArrayExpression: ['elements'],\n        ArrayPattern: ['elements'],\n        ArrowFunctionExpression: ['params', 'body'],\n        AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7.\n        BlockStatement: ['body'],\n        BinaryExpression: ['left', 'right'],\n        BreakStatement: ['label'],\n        CallExpression: ['callee', 'arguments'],\n        CatchClause: ['param', 'body'],\n        ChainExpression: ['expression'],\n        ClassBody: ['body'],\n        ClassDeclaration: ['id', 'superClass', 'body'],\n        ClassExpression: ['id', 'superClass', 'body'],\n        ComprehensionBlock: ['left', 'right'],  // CAUTION: It's deferred to ES7.\n        ComprehensionExpression: ['blocks', 'filter', 'body'],  // CAUTION: It's deferred to ES7.\n        ConditionalExpression: ['test', 'consequent', 'alternate'],\n        ContinueStatement: ['label'],\n        DebuggerStatement: [],\n        DirectiveStatement: [],\n        DoWhileStatement: ['body', 'test'],\n        EmptyStatement: [],\n        ExportAllDeclaration: ['source'],\n        ExportDefaultDeclaration: ['declaration'],\n        ExportNamedDeclaration: ['declaration', 'specifiers', 'source'],\n        ExportSpecifier: ['exported', 'local'],\n        ExpressionStatement: ['expression'],\n        ForStatement: ['init', 'test', 'update', 'body'],\n        ForInStatement: ['left', 'right', 'body'],\n        ForOfStatement: ['left', 'right', 'body'],\n        FunctionDeclaration: ['id', 'params', 'body'],\n        FunctionExpression: ['id', 'params', 'body'],\n        GeneratorExpression: ['blocks', 'filter', 'body'],  // CAUTION: It's deferred to ES7.\n        Identifier: [],\n        IfStatement: ['test', 'consequent', 'alternate'],\n        ImportExpression: ['source'],\n        ImportDeclaration: ['specifiers', 'source'],\n        ImportDefaultSpecifier: ['local'],\n        ImportNamespaceSpecifier: ['local'],\n        ImportSpecifier: ['imported', 'local'],\n        Literal: [],\n        LabeledStatement: ['label', 'body'],\n        LogicalExpression: ['left', 'right'],\n        MemberExpression: ['object', 'property'],\n        MetaProperty: ['meta', 'property'],\n        MethodDefinition: ['key', 'value'],\n        ModuleSpecifier: [],\n        NewExpression: ['callee', 'arguments'],\n        ObjectExpression: ['properties'],\n        ObjectPattern: ['properties'],\n        PrivateIdentifier: [],\n        Program: ['body'],\n        Property: ['key', 'value'],\n        PropertyDefinition: ['key', 'value'],\n        RestElement: [ 'argument' ],\n        ReturnStatement: ['argument'],\n        SequenceExpression: ['expressions'],\n        SpreadElement: ['argument'],\n        Super: [],\n        SwitchStatement: ['discriminant', 'cases'],\n        SwitchCase: ['test', 'consequent'],\n        TaggedTemplateExpression: ['tag', 'quasi'],\n        TemplateElement: [],\n        TemplateLiteral: ['quasis', 'expressions'],\n        ThisExpression: [],\n        ThrowStatement: ['argument'],\n        TryStatement: ['block', 'handler', 'finalizer'],\n        UnaryExpression: ['argument'],\n        UpdateExpression: ['argument'],\n        VariableDeclaration: ['declarations'],\n        VariableDeclarator: ['id', 'init'],\n        WhileStatement: ['test', 'body'],\n        WithStatement: ['object', 'body'],\n        YieldExpression: ['argument']\n    };\n\n    // unique id\n    BREAK = {};\n    SKIP = {};\n    REMOVE = {};\n\n    VisitorOption = {\n        Break: BREAK,\n        Skip: SKIP,\n        Remove: REMOVE\n    };\n\n    function Reference(parent, key) {\n        this.parent = parent;\n        this.key = key;\n    }\n\n    Reference.prototype.replace = function replace(node) {\n        this.parent[this.key] = node;\n    };\n\n    Reference.prototype.remove = function remove() {\n        if (Array.isArray(this.parent)) {\n            this.parent.splice(this.key, 1);\n            return true;\n        } else {\n            this.replace(null);\n            return false;\n        }\n    };\n\n    function Element(node, path, wrap, ref) {\n        this.node = node;\n        this.path = path;\n        this.wrap = wrap;\n        this.ref = ref;\n    }\n\n    function Controller() { }\n\n    // API:\n    // return property path array from root to current node\n    Controller.prototype.path = function path() {\n        var i, iz, j, jz, result, element;\n\n        function addToPath(result, path) {\n            if (Array.isArray(path)) {\n                for (j = 0, jz = path.length; j < jz; ++j) {\n                    result.push(path[j]);\n                }\n            } else {\n                result.push(path);\n            }\n        }\n\n        // root node\n        if (!this.__current.path) {\n            return null;\n        }\n\n        // first node is sentinel, second node is root element\n        result = [];\n        for (i = 2, iz = this.__leavelist.length; i < iz; ++i) {\n            element = this.__leavelist[i];\n            addToPath(result, element.path);\n        }\n        addToPath(result, this.__current.path);\n        return result;\n    };\n\n    // API:\n    // return type of current node\n    Controller.prototype.type = function () {\n        var node = this.current();\n        return node.type || this.__current.wrap;\n    };\n\n    // API:\n    // return array of parent elements\n    Controller.prototype.parents = function parents() {\n        var i, iz, result;\n\n        // first node is sentinel\n        result = [];\n        for (i = 1, iz = this.__leavelist.length; i < iz; ++i) {\n            result.push(this.__leavelist[i].node);\n        }\n\n        return result;\n    };\n\n    // API:\n    // return current node\n    Controller.prototype.current = function current() {\n        return this.__current.node;\n    };\n\n    Controller.prototype.__execute = function __execute(callback, element) {\n        var previous, result;\n\n        result = undefined;\n\n        previous  = this.__current;\n        this.__current = element;\n        this.__state = null;\n        if (callback) {\n            result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node);\n        }\n        this.__current = previous;\n\n        return result;\n    };\n\n    // API:\n    // notify control skip / break\n    Controller.prototype.notify = function notify(flag) {\n        this.__state = flag;\n    };\n\n    // API:\n    // skip child nodes of current node\n    Controller.prototype.skip = function () {\n        this.notify(SKIP);\n    };\n\n    // API:\n    // break traversals\n    Controller.prototype['break'] = function () {\n        this.notify(BREAK);\n    };\n\n    // API:\n    // remove node\n    Controller.prototype.remove = function () {\n        this.notify(REMOVE);\n    };\n\n    Controller.prototype.__initialize = function(root, visitor) {\n        this.visitor = visitor;\n        this.root = root;\n        this.__worklist = [];\n        this.__leavelist = [];\n        this.__current = null;\n        this.__state = null;\n        this.__fallback = null;\n        if (visitor.fallback === 'iteration') {\n            this.__fallback = Object.keys;\n        } else if (typeof visitor.fallback === 'function') {\n            this.__fallback = visitor.fallback;\n        }\n\n        this.__keys = VisitorKeys;\n        if (visitor.keys) {\n            this.__keys = Object.assign(Object.create(this.__keys), visitor.keys);\n        }\n    };\n\n    function isNode(node) {\n        if (node == null) {\n            return false;\n        }\n        return typeof node === 'object' && typeof node.type === 'string';\n    }\n\n    function isProperty(nodeType, key) {\n        return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key;\n    }\n  \n    function candidateExistsInLeaveList(leavelist, candidate) {\n        for (var i = leavelist.length - 1; i >= 0; --i) {\n            if (leavelist[i].node === candidate) {\n                return true;\n            }\n        }\n        return false;\n    }\n\n    Controller.prototype.traverse = function traverse(root, visitor) {\n        var worklist,\n            leavelist,\n            element,\n            node,\n            nodeType,\n            ret,\n            key,\n            current,\n            current2,\n            candidates,\n            candidate,\n            sentinel;\n\n        this.__initialize(root, visitor);\n\n        sentinel = {};\n\n        // reference\n        worklist = this.__worklist;\n        leavelist = this.__leavelist;\n\n        // initialize\n        worklist.push(new Element(root, null, null, null));\n        leavelist.push(new Element(null, null, null, null));\n\n        while (worklist.length) {\n            element = worklist.pop();\n\n            if (element === sentinel) {\n                element = leavelist.pop();\n\n                ret = this.__execute(visitor.leave, element);\n\n                if (this.__state === BREAK || ret === BREAK) {\n                    return;\n                }\n                continue;\n            }\n\n            if (element.node) {\n\n                ret = this.__execute(visitor.enter, element);\n\n                if (this.__state === BREAK || ret === BREAK) {\n                    return;\n                }\n\n                worklist.push(sentinel);\n                leavelist.push(element);\n\n                if (this.__state === SKIP || ret === SKIP) {\n                    continue;\n                }\n\n                node = element.node;\n                nodeType = node.type || element.wrap;\n                candidates = this.__keys[nodeType];\n                if (!candidates) {\n                    if (this.__fallback) {\n                        candidates = this.__fallback(node);\n                    } else {\n                        throw new Error('Unknown node type ' + nodeType + '.');\n                    }\n                }\n\n                current = candidates.length;\n                while ((current -= 1) >= 0) {\n                    key = candidates[current];\n                    candidate = node[key];\n                    if (!candidate) {\n                        continue;\n                    }\n\n                    if (Array.isArray(candidate)) {\n                        current2 = candidate.length;\n                        while ((current2 -= 1) >= 0) {\n                            if (!candidate[current2]) {\n                                continue;\n                            }\n\n                            if (candidateExistsInLeaveList(leavelist, candidate[current2])) {\n                              continue;\n                            }\n\n                            if (isProperty(nodeType, candidates[current])) {\n                                element = new Element(candidate[current2], [key, current2], 'Property', null);\n                            } else if (isNode(candidate[current2])) {\n                                element = new Element(candidate[current2], [key, current2], null, null);\n                            } else {\n                                continue;\n                            }\n                            worklist.push(element);\n                        }\n                    } else if (isNode(candidate)) {\n                        if (candidateExistsInLeaveList(leavelist, candidate)) {\n                          continue;\n                        }\n\n                        worklist.push(new Element(candidate, key, null, null));\n                    }\n                }\n            }\n        }\n    };\n\n    Controller.prototype.replace = function replace(root, visitor) {\n        var worklist,\n            leavelist,\n            node,\n            nodeType,\n            target,\n            element,\n            current,\n            current2,\n            candidates,\n            candidate,\n            sentinel,\n            outer,\n            key;\n\n        function removeElem(element) {\n            var i,\n                key,\n                nextElem,\n                parent;\n\n            if (element.ref.remove()) {\n                // When the reference is an element of an array.\n                key = element.ref.key;\n                parent = element.ref.parent;\n\n                // If removed from array, then decrease following items' keys.\n                i = worklist.length;\n                while (i--) {\n                    nextElem = worklist[i];\n                    if (nextElem.ref && nextElem.ref.parent === parent) {\n                        if  (nextElem.ref.key < key) {\n                            break;\n                        }\n                        --nextElem.ref.key;\n                    }\n                }\n            }\n        }\n\n        this.__initialize(root, visitor);\n\n        sentinel = {};\n\n        // reference\n        worklist = this.__worklist;\n        leavelist = this.__leavelist;\n\n        // initialize\n        outer = {\n            root: root\n        };\n        element = new Element(root, null, null, new Reference(outer, 'root'));\n        worklist.push(element);\n        leavelist.push(element);\n\n        while (worklist.length) {\n            element = worklist.pop();\n\n            if (element === sentinel) {\n                element = leavelist.pop();\n\n                target = this.__execute(visitor.leave, element);\n\n                // node may be replaced with null,\n                // so distinguish between undefined and null in this place\n                if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {\n                    // replace\n                    element.ref.replace(target);\n                }\n\n                if (this.__state === REMOVE || target === REMOVE) {\n                    removeElem(element);\n                }\n\n                if (this.__state === BREAK || target === BREAK) {\n                    return outer.root;\n                }\n                continue;\n            }\n\n            target = this.__execute(visitor.enter, element);\n\n            // node may be replaced with null,\n            // so distinguish between undefined and null in this place\n            if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {\n                // replace\n                element.ref.replace(target);\n                element.node = target;\n            }\n\n            if (this.__state === REMOVE || target === REMOVE) {\n                removeElem(element);\n                element.node = null;\n            }\n\n            if (this.__state === BREAK || target === BREAK) {\n                return outer.root;\n            }\n\n            // node may be null\n            node = element.node;\n            if (!node) {\n                continue;\n            }\n\n            worklist.push(sentinel);\n            leavelist.push(element);\n\n            if (this.__state === SKIP || target === SKIP) {\n                continue;\n            }\n\n            nodeType = node.type || element.wrap;\n            candidates = this.__keys[nodeType];\n            if (!candidates) {\n                if (this.__fallback) {\n                    candidates = this.__fallback(node);\n                } else {\n                    throw new Error('Unknown node type ' + nodeType + '.');\n                }\n            }\n\n            current = candidates.length;\n            while ((current -= 1) >= 0) {\n                key = candidates[current];\n                candidate = node[key];\n                if (!candidate) {\n                    continue;\n                }\n\n                if (Array.isArray(candidate)) {\n                    current2 = candidate.length;\n                    while ((current2 -= 1) >= 0) {\n                        if (!candidate[current2]) {\n                            continue;\n                        }\n                        if (isProperty(nodeType, candidates[current])) {\n                            element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2));\n                        } else if (isNode(candidate[current2])) {\n                            element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2));\n                        } else {\n                            continue;\n                        }\n                        worklist.push(element);\n                    }\n                } else if (isNode(candidate)) {\n                    worklist.push(new Element(candidate, key, null, new Reference(node, key)));\n                }\n            }\n        }\n\n        return outer.root;\n    };\n\n    function traverse(root, visitor) {\n        var controller = new Controller();\n        return controller.traverse(root, visitor);\n    }\n\n    function replace(root, visitor) {\n        var controller = new Controller();\n        return controller.replace(root, visitor);\n    }\n\n    function extendCommentRange(comment, tokens) {\n        var target;\n\n        target = upperBound(tokens, function search(token) {\n            return token.range[0] > comment.range[0];\n        });\n\n        comment.extendedRange = [comment.range[0], comment.range[1]];\n\n        if (target !== tokens.length) {\n            comment.extendedRange[1] = tokens[target].range[0];\n        }\n\n        target -= 1;\n        if (target >= 0) {\n            comment.extendedRange[0] = tokens[target].range[1];\n        }\n\n        return comment;\n    }\n\n    function attachComments(tree, providedComments, tokens) {\n        // At first, we should calculate extended comment ranges.\n        var comments = [], comment, len, i, cursor;\n\n        if (!tree.range) {\n            throw new Error('attachComments needs range information');\n        }\n\n        // tokens array is empty, we attach comments to tree as 'leadingComments'\n        if (!tokens.length) {\n            if (providedComments.length) {\n                for (i = 0, len = providedComments.length; i < len; i += 1) {\n                    comment = deepCopy(providedComments[i]);\n                    comment.extendedRange = [0, tree.range[0]];\n                    comments.push(comment);\n                }\n                tree.leadingComments = comments;\n            }\n            return tree;\n        }\n\n        for (i = 0, len = providedComments.length; i < len; i += 1) {\n            comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens));\n        }\n\n        // This is based on John Freeman's implementation.\n        cursor = 0;\n        traverse(tree, {\n            enter: function (node) {\n                var comment;\n\n                while (cursor < comments.length) {\n                    comment = comments[cursor];\n                    if (comment.extendedRange[1] > node.range[0]) {\n                        break;\n                    }\n\n                    if (comment.extendedRange[1] === node.range[0]) {\n                        if (!node.leadingComments) {\n                            node.leadingComments = [];\n                        }\n                        node.leadingComments.push(comment);\n                        comments.splice(cursor, 1);\n                    } else {\n                        cursor += 1;\n                    }\n                }\n\n                // already out of owned node\n                if (cursor === comments.length) {\n                    return VisitorOption.Break;\n                }\n\n                if (comments[cursor].extendedRange[0] > node.range[1]) {\n                    return VisitorOption.Skip;\n                }\n            }\n        });\n\n        cursor = 0;\n        traverse(tree, {\n            leave: function (node) {\n                var comment;\n\n                while (cursor < comments.length) {\n                    comment = comments[cursor];\n                    if (node.range[1] < comment.extendedRange[0]) {\n                        break;\n                    }\n\n                    if (node.range[1] === comment.extendedRange[0]) {\n                        if (!node.trailingComments) {\n                            node.trailingComments = [];\n                        }\n                        node.trailingComments.push(comment);\n                        comments.splice(cursor, 1);\n                    } else {\n                        cursor += 1;\n                    }\n                }\n\n                // already out of owned node\n                if (cursor === comments.length) {\n                    return VisitorOption.Break;\n                }\n\n                if (comments[cursor].extendedRange[0] > node.range[1]) {\n                    return VisitorOption.Skip;\n                }\n            }\n        });\n\n        return tree;\n    }\n\n    exports.Syntax = Syntax;\n    exports.traverse = traverse;\n    exports.replace = replace;\n    exports.attachComments = attachComments;\n    exports.VisitorKeys = VisitorKeys;\n    exports.VisitorOption = VisitorOption;\n    exports.Controller = Controller;\n    exports.cloneEnvironment = function () { return clone({}); };\n\n    return exports;\n}(exports));\n/* vim: set sw=4 ts=4 et tw=80 : */\n","/*\n * Generated by PEG.js 0.10.0.\n *\n * http://pegjs.org/\n */\n(function(root, factory) {\n  if (typeof define === \"function\" && define.amd) {\n    define([], factory);\n  } else if (typeof module === \"object\" && module.exports) {\n    module.exports = factory();\n  }\n})(this, function() {\n  \"use strict\";\n\n  function peg$subclass(child, parent) {\n    function ctor() { this.constructor = child; }\n    ctor.prototype = parent.prototype;\n    child.prototype = new ctor();\n  }\n\n  function peg$SyntaxError(message, expected, found, location) {\n    this.message  = message;\n    this.expected = expected;\n    this.found    = found;\n    this.location = location;\n    this.name     = \"SyntaxError\";\n\n    if (typeof Error.captureStackTrace === \"function\") {\n      Error.captureStackTrace(this, peg$SyntaxError);\n    }\n  }\n\n  peg$subclass(peg$SyntaxError, Error);\n\n  peg$SyntaxError.buildMessage = function(expected, found) {\n    var DESCRIBE_EXPECTATION_FNS = {\n          literal: function(expectation) {\n            return \"\\\"\" + literalEscape(expectation.text) + \"\\\"\";\n          },\n\n          \"class\": function(expectation) {\n            var escapedParts = \"\",\n                i;\n\n            for (i = 0; i < expectation.parts.length; i++) {\n              escapedParts += expectation.parts[i] instanceof Array\n                ? classEscape(expectation.parts[i][0]) + \"-\" + classEscape(expectation.parts[i][1])\n                : classEscape(expectation.parts[i]);\n            }\n\n            return \"[\" + (expectation.inverted ? \"^\" : \"\") + escapedParts + \"]\";\n          },\n\n          any: function(expectation) {\n            return \"any character\";\n          },\n\n          end: function(expectation) {\n            return \"end of input\";\n          },\n\n          other: function(expectation) {\n            return expectation.description;\n          }\n        };\n\n    function hex(ch) {\n      return ch.charCodeAt(0).toString(16).toUpperCase();\n    }\n\n    function literalEscape(s) {\n      return s\n        .replace(/\\\\/g, '\\\\\\\\')\n        .replace(/\"/g,  '\\\\\"')\n        .replace(/\\0/g, '\\\\0')\n        .replace(/\\t/g, '\\\\t')\n        .replace(/\\n/g, '\\\\n')\n        .replace(/\\r/g, '\\\\r')\n        .replace(/[\\x00-\\x0F]/g,          function(ch) { return '\\\\x0' + hex(ch); })\n        .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return '\\\\x'  + hex(ch); });\n    }\n\n    function classEscape(s) {\n      return s\n        .replace(/\\\\/g, '\\\\\\\\')\n        .replace(/\\]/g, '\\\\]')\n        .replace(/\\^/g, '\\\\^')\n        .replace(/-/g,  '\\\\-')\n        .replace(/\\0/g, '\\\\0')\n        .replace(/\\t/g, '\\\\t')\n        .replace(/\\n/g, '\\\\n')\n        .replace(/\\r/g, '\\\\r')\n        .replace(/[\\x00-\\x0F]/g,          function(ch) { return '\\\\x0' + hex(ch); })\n        .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return '\\\\x'  + hex(ch); });\n    }\n\n    function describeExpectation(expectation) {\n      return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);\n    }\n\n    function describeExpected(expected) {\n      var descriptions = new Array(expected.length),\n          i, j;\n\n      for (i = 0; i < expected.length; i++) {\n        descriptions[i] = describeExpectation(expected[i]);\n      }\n\n      descriptions.sort();\n\n      if (descriptions.length > 0) {\n        for (i = 1, j = 1; i < descriptions.length; i++) {\n          if (descriptions[i - 1] !== descriptions[i]) {\n            descriptions[j] = descriptions[i];\n            j++;\n          }\n        }\n        descriptions.length = j;\n      }\n\n      switch (descriptions.length) {\n        case 1:\n          return descriptions[0];\n\n        case 2:\n          return descriptions[0] + \" or \" + descriptions[1];\n\n        default:\n          return descriptions.slice(0, -1).join(\", \")\n            + \", or \"\n            + descriptions[descriptions.length - 1];\n      }\n    }\n\n    function describeFound(found) {\n      return found ? \"\\\"\" + literalEscape(found) + \"\\\"\" : \"end of input\";\n    }\n\n    return \"Expected \" + describeExpected(expected) + \" but \" + describeFound(found) + \" found.\";\n  };\n\n  function peg$parse(input, options) {\n    options = options !== void 0 ? options : {};\n\n    var peg$FAILED = {},\n\n        peg$startRuleFunctions = { start: peg$parsestart },\n        peg$startRuleFunction  = peg$parsestart,\n\n        peg$c0 = function(ss) {\n            return ss.length === 1 ? ss[0] : { type: 'matches', selectors: ss };\n          },\n        peg$c1 = function() { return void 0; },\n        peg$c2 = \" \",\n        peg$c3 = peg$literalExpectation(\" \", false),\n        peg$c4 = /^[^ [\\],():#!=><~+.]/,\n        peg$c5 = peg$classExpectation([\" \", \"[\", \"]\", \",\", \"(\", \")\", \":\", \"#\", \"!\", \"=\", \">\", \"<\", \"~\", \"+\", \".\"], true, false),\n        peg$c6 = function(i) { return i.join(''); },\n        peg$c7 = \">\",\n        peg$c8 = peg$literalExpectation(\">\", false),\n        peg$c9 = function() { return 'child'; },\n        peg$c10 = \"~\",\n        peg$c11 = peg$literalExpectation(\"~\", false),\n        peg$c12 = function() { return 'sibling'; },\n        peg$c13 = \"+\",\n        peg$c14 = peg$literalExpectation(\"+\", false),\n        peg$c15 = function() { return 'adjacent'; },\n        peg$c16 = function() { return 'descendant'; },\n        peg$c17 = \",\",\n        peg$c18 = peg$literalExpectation(\",\", false),\n        peg$c19 = function(s, ss) {\n          return [s].concat(ss.map(function (s) { return s[3]; }));\n        },\n        peg$c20 = function(op, s) {\n            if (!op) return s;\n            return { type: op, left: { type: 'exactNode' }, right: s };\n          },\n        peg$c21 = function(a, ops) {\n            return ops.reduce(function (memo, rhs) {\n              return { type: rhs[0], left: memo, right: rhs[1] };\n            }, a);\n          },\n        peg$c22 = \"!\",\n        peg$c23 = peg$literalExpectation(\"!\", false),\n        peg$c24 = function(subject, as) {\n            const b = as.length === 1 ? as[0] : { type: 'compound', selectors: as };\n            if(subject) b.subject = true;\n            return b;\n          },\n        peg$c25 = \"*\",\n        peg$c26 = peg$literalExpectation(\"*\", false),\n        peg$c27 = function(a) { return { type: 'wildcard', value: a }; },\n        peg$c28 = \"#\",\n        peg$c29 = peg$literalExpectation(\"#\", false),\n        peg$c30 = function(i) { return { type: 'identifier', value: i }; },\n        peg$c31 = \"[\",\n        peg$c32 = peg$literalExpectation(\"[\", false),\n        peg$c33 = \"]\",\n        peg$c34 = peg$literalExpectation(\"]\", false),\n        peg$c35 = function(v) { return v; },\n        peg$c36 = /^[><!]/,\n        peg$c37 = peg$classExpectation([\">\", \"<\", \"!\"], false, false),\n        peg$c38 = \"=\",\n        peg$c39 = peg$literalExpectation(\"=\", false),\n        peg$c40 = function(a) { return (a || '') + '='; },\n        peg$c41 = /^[><]/,\n        peg$c42 = peg$classExpectation([\">\", \"<\"], false, false),\n        peg$c43 = \".\",\n        peg$c44 = peg$literalExpectation(\".\", false),\n        peg$c45 = function(a, as) {\n            return [].concat.apply([a], as).join('');\n          },\n        peg$c46 = function(name, op, value) {\n              return { type: 'attribute', name: name, operator: op, value: value };\n            },\n        peg$c47 = function(name) { return { type: 'attribute', name: name }; },\n        peg$c48 = \"\\\"\",\n        peg$c49 = peg$literalExpectation(\"\\\"\", false),\n        peg$c50 = /^[^\\\\\"]/,\n        peg$c51 = peg$classExpectation([\"\\\\\", \"\\\"\"], true, false),\n        peg$c52 = \"\\\\\",\n        peg$c53 = peg$literalExpectation(\"\\\\\", false),\n        peg$c54 = peg$anyExpectation(),\n        peg$c55 = function(a, b) { return a + b; },\n        peg$c56 = function(d) {\n                return { type: 'literal', value: strUnescape(d.join('')) };\n              },\n        peg$c57 = \"'\",\n        peg$c58 = peg$literalExpectation(\"'\", false),\n        peg$c59 = /^[^\\\\']/,\n        peg$c60 = peg$classExpectation([\"\\\\\", \"'\"], true, false),\n        peg$c61 = /^[0-9]/,\n        peg$c62 = peg$classExpectation([[\"0\", \"9\"]], false, false),\n        peg$c63 = function(a, b) {\n                // Can use `a.flat().join('')` once supported\n                const leadingDecimals = a ? [].concat.apply([], a).join('') : '';\n                return { type: 'literal', value: parseFloat(leadingDecimals + b.join('')) };\n              },\n        peg$c64 = function(i) { return { type: 'literal', value: i }; },\n        peg$c65 = \"type(\",\n        peg$c66 = peg$literalExpectation(\"type(\", false),\n        peg$c67 = /^[^ )]/,\n        peg$c68 = peg$classExpectation([\" \", \")\"], true, false),\n        peg$c69 = \")\",\n        peg$c70 = peg$literalExpectation(\")\", false),\n        peg$c71 = function(t) { return { type: 'type', value: t.join('') }; },\n        peg$c72 = /^[imsu]/,\n        peg$c73 = peg$classExpectation([\"i\", \"m\", \"s\", \"u\"], false, false),\n        peg$c74 = \"/\",\n        peg$c75 = peg$literalExpectation(\"/\", false),\n        peg$c76 = function(pattern, flgs) {\n              return {\n                type: 'regexp', value: new RegExp(pattern.join(''), flgs ? flgs.join('') : '')\n              };\n            },\n        peg$c77 = /^[^\\]\\\\]/,\n        peg$c78 = peg$classExpectation([\"]\", \"\\\\\"], true, false),\n        peg$c79 = function(cs) { return '[' + cs.join('') + ']'; },\n        peg$c80 = function(a) { return '\\\\' + a; },\n        peg$c81 = /^[^\\/\\\\[]/,\n        peg$c82 = peg$classExpectation([\"/\", \"\\\\\", \"[\"], true, false),\n        peg$c83 = function(cs) { return cs.join(''); },\n        peg$c84 = function(i, is) {\n          return { type: 'field', name: is.reduce(function(memo, p){ return memo + p[0] + p[1]; }, i)};\n        },\n        peg$c85 = \":not(\",\n        peg$c86 = peg$literalExpectation(\":not(\", false),\n        peg$c87 = function(ss) { return { type: 'not', selectors: ss }; },\n        peg$c88 = \":matches(\",\n        peg$c89 = peg$literalExpectation(\":matches(\", false),\n        peg$c90 = function(ss) { return { type: 'matches', selectors: ss }; },\n        peg$c91 = \":is(\",\n        peg$c92 = peg$literalExpectation(\":is(\", false),\n        peg$c93 = \":has(\",\n        peg$c94 = peg$literalExpectation(\":has(\", false),\n        peg$c95 = function(ss) { return { type: 'has', selectors: ss }; },\n        peg$c96 = \":first-child\",\n        peg$c97 = peg$literalExpectation(\":first-child\", false),\n        peg$c98 = function() { return nth(1); },\n        peg$c99 = \":last-child\",\n        peg$c100 = peg$literalExpectation(\":last-child\", false),\n        peg$c101 = function() { return nthLast(1); },\n        peg$c102 = \":nth-child(\",\n        peg$c103 = peg$literalExpectation(\":nth-child(\", false),\n        peg$c104 = function(n) { return nth(parseInt(n.join(''), 10)); },\n        peg$c105 = \":nth-last-child(\",\n        peg$c106 = peg$literalExpectation(\":nth-last-child(\", false),\n        peg$c107 = function(n) { return nthLast(parseInt(n.join(''), 10)); },\n        peg$c108 = \":\",\n        peg$c109 = peg$literalExpectation(\":\", false),\n        peg$c110 = function(c) {\n          return { type: 'class', name: c };\n        },\n\n        peg$currPos          = 0,\n        peg$savedPos         = 0,\n        peg$posDetailsCache  = [{ line: 1, column: 1 }],\n        peg$maxFailPos       = 0,\n        peg$maxFailExpected  = [],\n        peg$silentFails      = 0,\n\n        peg$resultsCache = {},\n\n        peg$result;\n\n    if (\"startRule\" in options) {\n      if (!(options.startRule in peg$startRuleFunctions)) {\n        throw new Error(\"Can't start parsing from rule \\\"\" + options.startRule + \"\\\".\");\n      }\n\n      peg$startRuleFunction = peg$startRuleFunctions[options.startRule];\n    }\n\n    function text() {\n      return input.substring(peg$savedPos, peg$currPos);\n    }\n\n    function location() {\n      return peg$computeLocation(peg$savedPos, peg$currPos);\n    }\n\n    function expected(description, location) {\n      location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)\n\n      throw peg$buildStructuredError(\n        [peg$otherExpectation(description)],\n        input.substring(peg$savedPos, peg$currPos),\n        location\n      );\n    }\n\n    function error(message, location) {\n      location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)\n\n      throw peg$buildSimpleError(message, location);\n    }\n\n    function peg$literalExpectation(text, ignoreCase) {\n      return { type: \"literal\", text: text, ignoreCase: ignoreCase };\n    }\n\n    function peg$classExpectation(parts, inverted, ignoreCase) {\n      return { type: \"class\", parts: parts, inverted: inverted, ignoreCase: ignoreCase };\n    }\n\n    function peg$anyExpectation() {\n      return { type: \"any\" };\n    }\n\n    function peg$endExpectation() {\n      return { type: \"end\" };\n    }\n\n    function peg$otherExpectation(description) {\n      return { type: \"other\", description: description };\n    }\n\n    function peg$computePosDetails(pos) {\n      var details = peg$posDetailsCache[pos], p;\n\n      if (details) {\n        return details;\n      } else {\n        p = pos - 1;\n        while (!peg$posDetailsCache[p]) {\n          p--;\n        }\n\n        details = peg$posDetailsCache[p];\n        details = {\n          line:   details.line,\n          column: details.column\n        };\n\n        while (p < pos) {\n          if (input.charCodeAt(p) === 10) {\n            details.line++;\n            details.column = 1;\n          } else {\n            details.column++;\n          }\n\n          p++;\n        }\n\n        peg$posDetailsCache[pos] = details;\n        return details;\n      }\n    }\n\n    function peg$computeLocation(startPos, endPos) {\n      var startPosDetails = peg$computePosDetails(startPos),\n          endPosDetails   = peg$computePosDetails(endPos);\n\n      return {\n        start: {\n          offset: startPos,\n          line:   startPosDetails.line,\n          column: startPosDetails.column\n        },\n        end: {\n          offset: endPos,\n          line:   endPosDetails.line,\n          column: endPosDetails.column\n        }\n      };\n    }\n\n    function peg$fail(expected) {\n      if (peg$currPos < peg$maxFailPos) { return; }\n\n      if (peg$currPos > peg$maxFailPos) {\n        peg$maxFailPos = peg$currPos;\n        peg$maxFailExpected = [];\n      }\n\n      peg$maxFailExpected.push(expected);\n    }\n\n    function peg$buildSimpleError(message, location) {\n      return new peg$SyntaxError(message, null, null, location);\n    }\n\n    function peg$buildStructuredError(expected, found, location) {\n      return new peg$SyntaxError(\n        peg$SyntaxError.buildMessage(expected, found),\n        expected,\n        found,\n        location\n      );\n    }\n\n    function peg$parsestart() {\n      var s0, s1, s2, s3;\n\n      var key    = peg$currPos * 36 + 0,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parse_();\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parseselectors();\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parse_();\n          if (s3 !== peg$FAILED) {\n            peg$savedPos = s0;\n            s1 = peg$c0(s2);\n            s0 = s1;\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n      if (s0 === peg$FAILED) {\n        s0 = peg$currPos;\n        s1 = peg$parse_();\n        if (s1 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c1();\n        }\n        s0 = s1;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parse_() {\n      var s0, s1;\n\n      var key    = peg$currPos * 36 + 1,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = [];\n      if (input.charCodeAt(peg$currPos) === 32) {\n        s1 = peg$c2;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c3); }\n      }\n      while (s1 !== peg$FAILED) {\n        s0.push(s1);\n        if (input.charCodeAt(peg$currPos) === 32) {\n          s1 = peg$c2;\n          peg$currPos++;\n        } else {\n          s1 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c3); }\n        }\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseidentifierName() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 2,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = [];\n      if (peg$c4.test(input.charAt(peg$currPos))) {\n        s2 = input.charAt(peg$currPos);\n        peg$currPos++;\n      } else {\n        s2 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c5); }\n      }\n      if (s2 !== peg$FAILED) {\n        while (s2 !== peg$FAILED) {\n          s1.push(s2);\n          if (peg$c4.test(input.charAt(peg$currPos))) {\n            s2 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s2 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c5); }\n          }\n        }\n      } else {\n        s1 = peg$FAILED;\n      }\n      if (s1 !== peg$FAILED) {\n        peg$savedPos = s0;\n        s1 = peg$c6(s1);\n      }\n      s0 = s1;\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsebinaryOp() {\n      var s0, s1, s2, s3;\n\n      var key    = peg$currPos * 36 + 3,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parse_();\n      if (s1 !== peg$FAILED) {\n        if (input.charCodeAt(peg$currPos) === 62) {\n          s2 = peg$c7;\n          peg$currPos++;\n        } else {\n          s2 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c8); }\n        }\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parse_();\n          if (s3 !== peg$FAILED) {\n            peg$savedPos = s0;\n            s1 = peg$c9();\n            s0 = s1;\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n      if (s0 === peg$FAILED) {\n        s0 = peg$currPos;\n        s1 = peg$parse_();\n        if (s1 !== peg$FAILED) {\n          if (input.charCodeAt(peg$currPos) === 126) {\n            s2 = peg$c10;\n            peg$currPos++;\n          } else {\n            s2 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c11); }\n          }\n          if (s2 !== peg$FAILED) {\n            s3 = peg$parse_();\n            if (s3 !== peg$FAILED) {\n              peg$savedPos = s0;\n              s1 = peg$c12();\n              s0 = s1;\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n        if (s0 === peg$FAILED) {\n          s0 = peg$currPos;\n          s1 = peg$parse_();\n          if (s1 !== peg$FAILED) {\n            if (input.charCodeAt(peg$currPos) === 43) {\n              s2 = peg$c13;\n              peg$currPos++;\n            } else {\n              s2 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c14); }\n            }\n            if (s2 !== peg$FAILED) {\n              s3 = peg$parse_();\n              if (s3 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c15();\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n          if (s0 === peg$FAILED) {\n            s0 = peg$currPos;\n            if (input.charCodeAt(peg$currPos) === 32) {\n              s1 = peg$c2;\n              peg$currPos++;\n            } else {\n              s1 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c3); }\n            }\n            if (s1 !== peg$FAILED) {\n              s2 = peg$parse_();\n              if (s2 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c16();\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          }\n        }\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsehasSelectors() {\n      var s0, s1, s2, s3, s4, s5, s6, s7;\n\n      var key    = peg$currPos * 36 + 4,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parsehasSelector();\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        s3 = peg$currPos;\n        s4 = peg$parse_();\n        if (s4 !== peg$FAILED) {\n          if (input.charCodeAt(peg$currPos) === 44) {\n            s5 = peg$c17;\n            peg$currPos++;\n          } else {\n            s5 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c18); }\n          }\n          if (s5 !== peg$FAILED) {\n            s6 = peg$parse_();\n            if (s6 !== peg$FAILED) {\n              s7 = peg$parsehasSelector();\n              if (s7 !== peg$FAILED) {\n                s4 = [s4, s5, s6, s7];\n                s3 = s4;\n              } else {\n                peg$currPos = s3;\n                s3 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s3;\n          s3 = peg$FAILED;\n        }\n        while (s3 !== peg$FAILED) {\n          s2.push(s3);\n          s3 = peg$currPos;\n          s4 = peg$parse_();\n          if (s4 !== peg$FAILED) {\n            if (input.charCodeAt(peg$currPos) === 44) {\n              s5 = peg$c17;\n              peg$currPos++;\n            } else {\n              s5 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c18); }\n            }\n            if (s5 !== peg$FAILED) {\n              s6 = peg$parse_();\n              if (s6 !== peg$FAILED) {\n                s7 = peg$parsehasSelector();\n                if (s7 !== peg$FAILED) {\n                  s4 = [s4, s5, s6, s7];\n                  s3 = s4;\n                } else {\n                  peg$currPos = s3;\n                  s3 = peg$FAILED;\n                }\n              } else {\n                peg$currPos = s3;\n                s3 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c19(s1, s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseselectors() {\n      var s0, s1, s2, s3, s4, s5, s6, s7;\n\n      var key    = peg$currPos * 36 + 5,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parseselector();\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        s3 = peg$currPos;\n        s4 = peg$parse_();\n        if (s4 !== peg$FAILED) {\n          if (input.charCodeAt(peg$currPos) === 44) {\n            s5 = peg$c17;\n            peg$currPos++;\n          } else {\n            s5 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c18); }\n          }\n          if (s5 !== peg$FAILED) {\n            s6 = peg$parse_();\n            if (s6 !== peg$FAILED) {\n              s7 = peg$parseselector();\n              if (s7 !== peg$FAILED) {\n                s4 = [s4, s5, s6, s7];\n                s3 = s4;\n              } else {\n                peg$currPos = s3;\n                s3 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s3;\n          s3 = peg$FAILED;\n        }\n        while (s3 !== peg$FAILED) {\n          s2.push(s3);\n          s3 = peg$currPos;\n          s4 = peg$parse_();\n          if (s4 !== peg$FAILED) {\n            if (input.charCodeAt(peg$currPos) === 44) {\n              s5 = peg$c17;\n              peg$currPos++;\n            } else {\n              s5 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c18); }\n            }\n            if (s5 !== peg$FAILED) {\n              s6 = peg$parse_();\n              if (s6 !== peg$FAILED) {\n                s7 = peg$parseselector();\n                if (s7 !== peg$FAILED) {\n                  s4 = [s4, s5, s6, s7];\n                  s3 = s4;\n                } else {\n                  peg$currPos = s3;\n                  s3 = peg$FAILED;\n                }\n              } else {\n                peg$currPos = s3;\n                s3 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c19(s1, s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsehasSelector() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 6,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parsebinaryOp();\n      if (s1 === peg$FAILED) {\n        s1 = null;\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parseselector();\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c20(s1, s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseselector() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 7,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parsesequence();\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        s3 = peg$currPos;\n        s4 = peg$parsebinaryOp();\n        if (s4 !== peg$FAILED) {\n          s5 = peg$parsesequence();\n          if (s5 !== peg$FAILED) {\n            s4 = [s4, s5];\n            s3 = s4;\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s3;\n          s3 = peg$FAILED;\n        }\n        while (s3 !== peg$FAILED) {\n          s2.push(s3);\n          s3 = peg$currPos;\n          s4 = peg$parsebinaryOp();\n          if (s4 !== peg$FAILED) {\n            s5 = peg$parsesequence();\n            if (s5 !== peg$FAILED) {\n              s4 = [s4, s5];\n              s3 = s4;\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c21(s1, s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsesequence() {\n      var s0, s1, s2, s3;\n\n      var key    = peg$currPos * 36 + 8,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 33) {\n        s1 = peg$c22;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c23); }\n      }\n      if (s1 === peg$FAILED) {\n        s1 = null;\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        s3 = peg$parseatom();\n        if (s3 !== peg$FAILED) {\n          while (s3 !== peg$FAILED) {\n            s2.push(s3);\n            s3 = peg$parseatom();\n          }\n        } else {\n          s2 = peg$FAILED;\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c24(s1, s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseatom() {\n      var s0;\n\n      var key    = peg$currPos * 36 + 9,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$parsewildcard();\n      if (s0 === peg$FAILED) {\n        s0 = peg$parseidentifier();\n        if (s0 === peg$FAILED) {\n          s0 = peg$parseattr();\n          if (s0 === peg$FAILED) {\n            s0 = peg$parsefield();\n            if (s0 === peg$FAILED) {\n              s0 = peg$parsenegation();\n              if (s0 === peg$FAILED) {\n                s0 = peg$parsematches();\n                if (s0 === peg$FAILED) {\n                  s0 = peg$parseis();\n                  if (s0 === peg$FAILED) {\n                    s0 = peg$parsehas();\n                    if (s0 === peg$FAILED) {\n                      s0 = peg$parsefirstChild();\n                      if (s0 === peg$FAILED) {\n                        s0 = peg$parselastChild();\n                        if (s0 === peg$FAILED) {\n                          s0 = peg$parsenthChild();\n                          if (s0 === peg$FAILED) {\n                            s0 = peg$parsenthLastChild();\n                            if (s0 === peg$FAILED) {\n                              s0 = peg$parseclass();\n                            }\n                          }\n                        }\n                      }\n                    }\n                  }\n                }\n              }\n            }\n          }\n        }\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsewildcard() {\n      var s0, s1;\n\n      var key    = peg$currPos * 36 + 10,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 42) {\n        s1 = peg$c25;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c26); }\n      }\n      if (s1 !== peg$FAILED) {\n        peg$savedPos = s0;\n        s1 = peg$c27(s1);\n      }\n      s0 = s1;\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseidentifier() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 11,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 35) {\n        s1 = peg$c28;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c29); }\n      }\n      if (s1 === peg$FAILED) {\n        s1 = null;\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parseidentifierName();\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c30(s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseattr() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 12,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 91) {\n        s1 = peg$c31;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c32); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parseattrValue();\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 93) {\n                s5 = peg$c33;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c34); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c35(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseattrOps() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 13,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (peg$c36.test(input.charAt(peg$currPos))) {\n        s1 = input.charAt(peg$currPos);\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c37); }\n      }\n      if (s1 === peg$FAILED) {\n        s1 = null;\n      }\n      if (s1 !== peg$FAILED) {\n        if (input.charCodeAt(peg$currPos) === 61) {\n          s2 = peg$c38;\n          peg$currPos++;\n        } else {\n          s2 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c39); }\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c40(s1);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n      if (s0 === peg$FAILED) {\n        if (peg$c41.test(in   put.charAt(peg$currPos))) {\n          s0 = input.charAt(peg$currPos);\n          peg$currPos++;\n        } else {\n          s0 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c42); }\n        }\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseattrEqOps() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 14,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 33) {\n        s1 = peg$c22;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c23); }\n      }\n      if (s1 === peg$FAILED) {\n        s1 = null;\n      }\n      if (s1 !== peg$FAILED) {\n        if (input.charCodeAt(peg$currPos) === 61) {\n          s2 = peg$c38;\n          peg$currPos++;\n        } else {\n          s2 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c39); }\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c40(s1);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseattrName() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 15,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parseidentifierName();\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        s3 = peg$currPos;\n        if (input.charCodeAt(peg$currPos) === 46) {\n          s4 = peg$c43;\n          peg$currPos++;\n        } else {\n          s4 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c44); }\n        }\n        if (s4 !== peg$FAILED) {\n          s5 = peg$parseidentifierName();\n          if (s5 !== peg$FAILED) {\n            s4 = [s4, s5];\n            s3 = s4;\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s3;\n          s3 = peg$FAILED;\n        }\n        while (s3 !== peg$FAILED) {\n          s2.push(s3);\n          s3 = peg$currPos;\n          if (input.charCodeAt(peg$currPos) === 46) {\n            s4 = peg$c43;\n            peg$currPos++;\n          } else {\n            s4 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c44); }\n          }\n          if (s4 !== peg$FAILED) {\n            s5 = peg$parseidentifierName();\n            if (s5 !== peg$FAILED) {\n              s4 = [s4, s5];\n              s3 = s4;\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c45(s1, s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseattrValue() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 16,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parseattrName();\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parseattrEqOps();\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              s5 = peg$parsetype();\n              if (s5 === peg$FAILED) {\n                s5 = peg$parseregex();\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c46(s1, s3, s5);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n      if (s0 === peg$FAILED) {\n        s0 = peg$currPos;\n        s1 = peg$parseattrName();\n        if (s1 !== peg$FAILED) {\n          s2 = peg$parse_();\n          if (s2 !== peg$FAILED) {\n            s3 = peg$parseattrOps();\n            if (s3 !== peg$FAILED) {\n              s4 = peg$parse_();\n              if (s4 !== peg$FAILED) {\n                s5 = peg$parsestring();\n                if (s5 === peg$FAILED) {\n                  s5 = peg$parsenumber();\n                  if (s5 === peg$FAILED) {\n                    s5 = peg$parsepath();\n                  }\n                }\n                if (s5 !== peg$FAILED) {\n                  peg$savedPos = s0;\n                  s1 = peg$c46(s1, s3, s5);\n                  s0 = s1;\n                } else {\n                  peg$currPos = s0;\n                  s0 = peg$FAILED;\n                }\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n        if (s0 === peg$FAILED) {\n          s0 = peg$currPos;\n          s1 = peg$parseattrName();\n          if (s1 !== peg$FAILED) {\n            peg$savedPos = s0;\n            s1 = peg$c47(s1);\n          }\n          s0 = s1;\n        }\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsestring() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 17,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 34) {\n        s1 = peg$c48;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c49); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        if (peg$c50.test(input.charAt(peg$currPos))) {\n          s3 = input.charAt(peg$currPos);\n          peg$currPos++;\n        } else {\n          s3 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c51); }\n        }\n        if (s3 === peg$FAILED) {\n          s3 = peg$currPos;\n          if (input.charCodeAt(peg$currPos) === 92) {\n            s4 = peg$c52;\n            peg$currPos++;\n          } else {\n            s4 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c53); }\n          }\n          if (s4 !== peg$FAILED) {\n            if (input.length > peg$currPos) {\n              s5 = input.charAt(peg$currPos);\n              peg$currPos++;\n            } else {\n              s5 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c54); }\n            }\n            if (s5 !== peg$FAILED) {\n              peg$savedPos = s3;\n              s4 = peg$c55(s4, s5);\n              s3 = s4;\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s3;\n            s3 = peg$FAILED;\n          }\n        }\n        while (s3 !== peg$FAILED) {\n          s2.push(s3);\n          if (peg$c50.test(input.charAt(peg$currPos))) {\n            s3 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s3 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c51); }\n          }\n          if (s3 === peg$FAILED) {\n            s3 = peg$currPos;\n            if (input.charCodeAt(peg$currPos) === 92) {\n              s4 = peg$c52;\n              peg$currPos++;\n            } else {\n              s4 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c53); }\n            }\n            if (s4 !== peg$FAILED) {\n              if (input.length > peg$currPos) {\n                s5 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c54); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s3;\n                s4 = peg$c55(s4, s5);\n                s3 = s4;\n              } else {\n                peg$currPos = s3;\n                s3 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          }\n        }\n        if (s2 !== peg$FAILED) {\n          if (input.charCodeAt(peg$currPos) === 34) {\n            s3 = peg$c48;\n            peg$currPos++;\n          } else {\n            s3 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c49); }\n          }\n          if (s3 !== peg$FAILED) {\n            peg$savedPos = s0;\n            s1 = peg$c56(s2);\n            s0 = s1;\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n      if (s0 === peg$FAILED) {\n        s0 = peg$currPos;\n        if (input.charCodeAt(peg$currPos) === 39) {\n          s1 = peg$c57;\n          peg$currPos++;\n        } else {\n          s1 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c58); }\n        }\n        if (s1 !== peg$FAILED) {\n          s2 = [];\n          if (peg$c59.test(input.charAt(peg$currPos))) {\n            s3 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s3 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c60); }\n          }\n          if (s3 === peg$FAILED) {\n            s3 = peg$currPos;\n            if (input.charCodeAt(peg$currPos) === 92) {\n              s4 = peg$c52;\n              peg$currPos++;\n            } else {\n              s4 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c53); }\n            }\n            if (s4 !== peg$FAILED) {\n              if (input.length > peg$currPos) {\n                s5 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c54); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s3;\n                s4 = peg$c55(s4, s5);\n                s3 = s4;\n              } else {\n                peg$currPos = s3;\n                s3 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s3;\n              s3 = peg$FAILED;\n            }\n          }\n          while (s3 !== peg$FAILED) {\n            s2.push(s3);\n            if (peg$c59.test(input.charAt(peg$currPos))) {\n              s3 = input.charAt(peg$currPos);\n              peg$currPos++;\n            } else {\n              s3 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c60); }\n            }\n            if (s3 === peg$FAILED) {\n              s3 = peg$currPos;\n              if (input.charCodeAt(peg$currPos) === 92) {\n                s4 = peg$c52;\n                peg$currPos++;\n              } else {\n                s4 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c53); }\n              }\n              if (s4 !== peg$FAILED) {\n                if (input.length > peg$currPos) {\n                  s5 = input.charAt(peg$currPos);\n                  peg$currPos++;\n                } else {\n                  s5 = peg$FAILED;\n                  if (peg$silentFails === 0) { peg$fail(peg$c54); }\n                }\n                if (s5 !== peg$FAILED) {\n                  peg$savedPos = s3;\n                  s4 = peg$c55(s4, s5);\n                  s3 = s4;\n                } else {\n                  peg$currPos = s3;\n                  s3 = peg$FAILED;\n                }\n              } else {\n                peg$currPos = s3;\n                s3 = peg$FAILED;\n              }\n            }\n          }\n          if (s2 !== peg$FAILED) {\n            if (input.charCodeAt(peg$currPos) === 39) {\n              s3 = peg$c57;\n              peg$currPos++;\n            } else {\n              s3 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c58); }\n            }\n            if (s3 !== peg$FAILED) {\n              peg$savedPos = s0;\n              s1 = peg$c56(s2);\n              s0 = s1;\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsenumber() {\n      var s0, s1, s2, s3;\n\n      var key    = peg$currPos * 36 + 18,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$currPos;\n      s2 = [];\n      if (peg$c61.test(input.charAt(peg$currPos))) {\n        s3 = input.charAt(peg$currPos);\n        peg$currPos++;\n      } else {\n        s3 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c62); }\n      }\n      while (s3 !== peg$FAILED) {\n        s2.push(s3);\n        if (peg$c61.test(input.charAt(peg$currPos))) {\n          s3 = input.charAt(peg$currPos);\n          peg$currPos++;\n        } else {\n          s3 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c62); }\n        }\n      }\n      if (s2 !== peg$FAILED) {\n        if (input.charCodeAt(peg$currPos) === 46) {\n          s3 = peg$c43;\n          peg$currPos++;\n        } else {\n          s3 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c44); }\n        }\n        if (s3 !== peg$FAILED) {\n          s2 = [s2, s3];\n          s1 = s2;\n        } else {\n          peg$currPos = s1;\n          s1 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s1;\n        s1 = peg$FAILED;\n      }\n      if (s1 === peg$FAILED) {\n        s1 = null;\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        if (peg$c61.test(input.charAt(peg$currPos))) {\n          s3 = input.charAt(peg$currPos);\n          peg$currPos++;\n        } else {\n          s3 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c62); }\n        }\n        if (s3 !== peg$FAILED) {\n          while (s3 !== peg$FAILED) {\n            s2.push(s3);\n            if (peg$c61.test(input.charAt(peg$currPos))) {\n              s3 = input.charAt(peg$currPos);\n              peg$currPos++;\n            } else {\n              s3 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c62); }\n            }\n          }\n        } else {\n          s2 = peg$FAILED;\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c63(s1, s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsepath() {\n      var s0, s1;\n\n      var key    = peg$currPos * 36 + 19,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = peg$parseidentifierName();\n      if (s1 !== peg$FAILED) {\n        peg$savedPos = s0;\n        s1 = peg$c64(s1);\n      }\n      s0 = s1;\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsetype() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 20,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 5) === peg$c65) {\n        s1 = peg$c65;\n        peg$currPos += 5;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c66); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = [];\n          if (peg$c67.test(input.charAt(peg$currPos))) {\n            s4 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s4 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c68); }\n          }\n          if (s4 !== peg$FAILED) {\n            while (s4 !== peg$FAILED) {\n              s3.push(s4);\n              if (peg$c67.test(input.charAt(peg$currPos))) {\n                s4 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s4 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c68); }\n              }\n            }\n          } else {\n            s3 = peg$FAILED;\n          }\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 41) {\n                s5 = peg$c69;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c70); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c71(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseflags() {\n      var s0, s1;\n\n      var key    = peg$currPos * 36 + 21,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = [];\n      if (peg$c72.test(input.charAt(peg$currPos))) {\n        s1 = input.charAt(peg$currPos);\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c73); }\n      }\n      if (s1 !== peg$FAILED) {\n        while (s1 !== peg$FAILED) {\n          s0.push(s1);\n          if (peg$c72.test(input.charAt(peg$currPos))) {\n            s1 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s1 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c73); }\n          }\n        }\n      } else {\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseregex() {\n      var s0, s1, s2, s3, s4;\n\n      var key    = peg$currPos * 36 + 22,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 47) {\n        s1 = peg$c74;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c75); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        s3 = peg$parsere_character_class();\n        if (s3 === peg$FAILED) {\n          s3 = peg$parsere_escape();\n          if (s3 === peg$FAILED) {\n            s3 = peg$parsere_chars();\n          }\n        }\n        if (s3 !== peg$FAILED) {\n          while (s3 !== peg$FAILED) {\n            s2.push(s3);\n            s3 = peg$parsere_character_class();\n            if (s3 === peg$FAILED) {\n              s3 = peg$parsere_escape();\n              if (s3 === peg$FAILED) {\n                s3 = peg$parsere_chars();\n              }\n            }\n          }\n        } else {\n          s2 = peg$FAILED;\n        }\n        if (s2 !== peg$FAILED) {\n          if (input.charCodeAt(peg$currPos) === 47) {\n            s3 = peg$c74;\n            peg$currPos++;\n          } else {\n            s3 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c75); }\n          }\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parseflags();\n            if (s4 === peg$FAILED) {\n              s4 = null;\n            }\n            if (s4 !== peg$FAILED) {\n              peg$savedPos = s0;\n              s1 = peg$c76(s2, s4);\n              s0 = s1;\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsere_character_class() {\n      var s0, s1, s2, s3;\n\n      var key    = peg$currPos * 36 + 23,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 91) {\n        s1 = peg$c31;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c32); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = [];\n        if (peg$c77.test(input.charAt(peg$currPos))) {\n          s3 = input.charAt(peg$currPos);\n          peg$currPos++;\n        } else {\n          s3 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c78); }\n        }\n        if (s3 === peg$FAILED) {\n          s3 = peg$parsere_escape();\n        }\n        if (s3 !== peg$FAILED) {\n          while (s3 !== peg$FAILED) {\n            s2.push(s3);\n            if (peg$c77.test(input.charAt(peg$currPos))) {\n              s3 = input.charAt(peg$currPos);\n              peg$currPos++;\n            } else {\n              s3 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c78); }\n            }\n            if (s3 === peg$FAILED) {\n              s3 = peg$parsere_escape();\n            }\n          }\n        } else {\n          s2 = peg$FAILED;\n        }\n        if (s2 !== peg$FAILED) {\n          if (input.charCodeAt(peg$currPos) === 93) {\n            s3 = peg$c33;\n            peg$currPos++;\n          } else {\n            s3 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c34); }\n          }\n          if (s3 !== peg$FAILED) {\n            peg$savedPos = s0;\n            s1 = peg$c79(s2);\n            s0 = s1;\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsere_escape() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 24,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 92) {\n        s1 = peg$c52;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c53); }\n      }\n      if (s1 !== peg$FAILED) {\n        if (input.length > peg$currPos) {\n          s2 = input.charAt(peg$currPos);\n          peg$currPos++;\n        } else {\n          s2 = peg$FAILED;\n          if (peg$silentFails === 0) { peg$fail(peg$c54); }\n        }\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c80(s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsere_chars() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 25,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      s1 = [];\n      if (peg$c81.test(input.charAt(peg$currPos))) {\n        s2 = input.charAt(peg$currPos);\n        peg$currPos++;\n      } else {\n        s2 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c82); }\n      }\n      if (s2 !== peg$FAILED) {\n        while (s2 !== peg$FAILED) {\n          s1.push(s2);\n          if (peg$c81.test(input.charAt(peg$currPos))) {\n            s2 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s2 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c82); }\n          }\n        }\n      } else {\n        s1 = peg$FAILED;\n      }\n      if (s1 !== peg$FAILED) {\n        peg$savedPos = s0;\n        s1 = peg$c83(s1);\n      }\n      s0 = s1;\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsefield() {\n      var s0, s1, s2, s3, s4, s5, s6;\n\n      var key    = peg$currPos * 36 + 26,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 46) {\n        s1 = peg$c43;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c44); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parseidentifierName();\n        if (s2 !== peg$FAILED) {\n          s3 = [];\n          s4 = peg$currPos;\n          if (input.charCodeAt(peg$currPos) === 46) {\n            s5 = peg$c43;\n            peg$currPos++;\n          } else {\n            s5 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c44); }\n          }\n          if (s5 !== peg$FAILED) {\n            s6 = peg$parseidentifierName();\n            if (s6 !== peg$FAILED) {\n              s5 = [s5, s6];\n              s4 = s5;\n            } else {\n              peg$currPos = s4;\n              s4 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s4;\n            s4 = peg$FAILED;\n          }\n          while (s4 !== peg$FAILED) {\n            s3.push(s4);\n            s4 = peg$currPos;\n            if (input.charCodeAt(peg$currPos) === 46) {\n              s5 = peg$c43;\n              peg$currPos++;\n            } else {\n              s5 = peg$FAILED;\n              if (peg$silentFails === 0) { peg$fail(peg$c44); }\n            }\n            if (s5 !== peg$FAILED) {\n              s6 = peg$parseidentifierName();\n              if (s6 !== peg$FAILED) {\n                s5 = [s5, s6];\n                s4 = s5;\n              } else {\n                peg$currPos = s4;\n                s4 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s4;\n              s4 = peg$FAILED;\n            }\n          }\n          if (s3 !== peg$FAILED) {\n            peg$savedPos = s0;\n            s1 = peg$c84(s2, s3);\n            s0 = s1;\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsenegation() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 27,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 5) === peg$c85) {\n        s1 = peg$c85;\n        peg$currPos += 5;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c86); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parseselectors();\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 41) {\n                s5 = peg$c69;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c70); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c87(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsematches() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 28,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 9) === peg$c88) {\n        s1 = peg$c88;\n        peg$currPos += 9;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c89); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parseselectors();\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 41) {\n                s5 = peg$c69;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c70); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c90(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseis() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 29,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 4) === peg$c91) {\n        s1 = peg$c91;\n        peg$currPos += 4;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c92); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parseselectors();\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 41) {\n                s5 = peg$c69;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c70); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c90(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsehas() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 30,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 5) === peg$c93) {\n        s1 = peg$c93;\n        peg$currPos += 5;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c94); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = peg$parsehasSelectors();\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 41) {\n                s5 = peg$c69;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c70); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c95(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsefirstChild() {\n      var s0, s1;\n\n      var key    = peg$currPos * 36 + 31,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 12) === peg$c96) {\n        s1 = peg$c96;\n        peg$currPos += 12;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c97); }\n      }\n      if (s1 !== peg$FAILED) {\n        peg$savedPos = s0;\n        s1 = peg$c98();\n      }\n      s0 = s1;\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parselastChild() {\n      var s0, s1;\n\n      var key    = peg$currPos * 36 + 32,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 11) === peg$c99) {\n        s1 = peg$c99;\n        peg$currPos += 11;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c100); }\n      }\n      if (s1 !== peg$FAILED) {\n        peg$savedPos = s0;\n        s1 = peg$c101();\n      }\n      s0 = s1;\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsenthChild() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 33,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 11) === peg$c102) {\n        s1 = peg$c102;\n        peg$currPos += 11;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c103); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = [];\n          if (peg$c61.test(input.charAt(peg$currPos))) {\n            s4 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s4 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c62); }\n          }\n          if (s4 !== peg$FAILED) {\n            while (s4 !== peg$FAILED) {\n              s3.push(s4);\n              if (peg$c61.test(input.charAt(peg$currPos))) {\n                s4 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s4 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c62); }\n              }\n            }\n          } else {\n            s3 = peg$FAILED;\n          }\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 41) {\n                s5 = peg$c69;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c70); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c104(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parsenthLastChild() {\n      var s0, s1, s2, s3, s4, s5;\n\n      var key    = peg$currPos * 36 + 34,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.substr(peg$currPos, 16) === peg$c105) {\n        s1 = peg$c105;\n        peg$currPos += 16;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c106); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parse_();\n        if (s2 !== peg$FAILED) {\n          s3 = [];\n          if (peg$c61.test(input.charAt(peg$currPos))) {\n            s4 = input.charAt(peg$currPos);\n            peg$currPos++;\n          } else {\n            s4 = peg$FAILED;\n            if (peg$silentFails === 0) { peg$fail(peg$c62); }\n          }\n          if (s4 !== peg$FAILED) {\n            while (s4 !== peg$FAILED) {\n              s3.push(s4);\n              if (peg$c61.test(input.charAt(peg$currPos))) {\n                s4 = input.charAt(peg$currPos);\n                peg$currPos++;\n              } else {\n                s4 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c62); }\n              }\n            }\n          } else {\n            s3 = peg$FAILED;\n          }\n          if (s3 !== peg$FAILED) {\n            s4 = peg$parse_();\n            if (s4 !== peg$FAILED) {\n              if (input.charCodeAt(peg$currPos) === 41) {\n                s5 = peg$c69;\n                peg$currPos++;\n              } else {\n                s5 = peg$FAILED;\n                if (peg$silentFails === 0) { peg$fail(peg$c70); }\n              }\n              if (s5 !== peg$FAILED) {\n                peg$savedPos = s0;\n                s1 = peg$c107(s3);\n                s0 = s1;\n              } else {\n                peg$currPos = s0;\n                s0 = peg$FAILED;\n              }\n            } else {\n              peg$currPos = s0;\n              s0 = peg$FAILED;\n            }\n          } else {\n            peg$currPos = s0;\n            s0 = peg$FAILED;\n          }\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n    function peg$parseclass() {\n      var s0, s1, s2;\n\n      var key    = peg$currPos * 36 + 35,\n          cached = peg$resultsCache[key];\n\n      if (cached) {\n        peg$currPos = cached.nextPos;\n\n        return cached.result;\n      }\n\n      s0 = peg$currPos;\n      if (input.charCodeAt(peg$currPos) === 58) {\n        s1 = peg$c108;\n        peg$currPos++;\n      } else {\n        s1 = peg$FAILED;\n        if (peg$silentFails === 0) { peg$fail(peg$c109); }\n      }\n      if (s1 !== peg$FAILED) {\n        s2 = peg$parseidentifierName();\n        if (s2 !== peg$FAILED) {\n          peg$savedPos = s0;\n          s1 = peg$c110(s2);\n          s0 = s1;\n        } else {\n          peg$currPos = s0;\n          s0 = peg$FAILED;\n        }\n      } else {\n        peg$currPos = s0;\n        s0 = peg$FAILED;\n      }\n\n      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };\n\n      return s0;\n    }\n\n\n      function nth(n) { return { type: 'nth-child', index: { type: 'literal', value: n } }; }\n      function nthLast(n) { return { type: 'nth-last-child', index: { type: 'literal', value: n } }; }\n      function strUnescape(s) {\n        return s.replace(/\\\\(.)/g, function(match, ch) {\n          switch(ch) {\n            case 'b': return '\\b';\n            case 'f': return '\\f';\n            case 'n': return '\\n';\n            case 'r': return '\\r';\n            case 't': return '\\t';\n            case 'v': return '\\v';\n            default: return ch;\n          }\n        });\n      }\n\n\n    peg$result = peg$startRuleFunction();\n\n    if (peg$result !== peg$FAILED && peg$currPos === input.length) {\n      return peg$result;\n    } else {\n      if (peg$result !== peg$FAILED && peg$currPos < input.length) {\n        peg$fail(peg$endExpectation());\n      }\n\n      throw peg$buildStructuredError(\n        peg$maxFailExpected,\n        peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,\n        peg$maxFailPos < input.length\n          ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)\n          : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)\n      );\n    }\n  }\n\n  return {\n    SyntaxError: peg$SyntaxError,\n    parse:       peg$parse\n  };\n});\n","/* vim: set sw=4 sts=4 : */\nimport estraverse from 'estraverse';\nimport parser from './parser.js';\n\n/**\n* @typedef {\"LEFT_SIDE\"|\"RIGHT_SIDE\"} Side\n*/\n\nconst LEFT_SIDE = 'LEFT_SIDE';\nconst RIGHT_SIDE = 'RIGHT_SIDE';\n\n/**\n * @external AST\n * @see https://esprima.readthedocs.io/en/latest/syntax-tree-format.html\n */\n\n/**\n * One of the rules of `grammar.pegjs`\n * @typedef {PlainObject} SelectorAST\n * @see grammar.pegjs\n*/\n\n/**\n * The `sequence` production of `grammar.pegjs`\n * @typedef {PlainObject} SelectorSequenceAST\n*/\n\n/**\n * Get the value of a property which may be multiple levels down\n * in the object.\n * @param {?PlainObject} obj\n * @param {string[]} keys\n * @returns {undefined|boolean|string|number|external:AST}\n */\nfunction getPath(obj, keys) {\n    for (let i = 0; i < keys.length; ++i) {\n        if (obj == null) { return obj; }\n        obj = obj[keys[i]];\n    }\n    return obj;\n}\n\n/**\n * Determine whether `node` can be reached by following `path`,\n * starting at `ancestor`.\n * @param {?external:AST} node\n * @param {?external:AST} ancestor\n * @param {string[]} path\n * @param {Integer} fromPathIndex\n * @returns {boolean}\n */\nfunction inPath(node, ancestor, path, fromPathIndex) {\n    let current = ancestor;\n    for (let i = fromPathIndex; i < path.length; ++i) {\n        if (current == null) {\n            return false;\n        }\n        const field = current[path[i]];\n        if (Array.isArray(field)) {\n            for (let k = 0; k < field.length; ++k) {\n                if (inPath(node, field[k], path, i + 1)) {\n                    return true;\n                }\n            }\n            return false;\n        }\n        current = field;\n    }\n    return node === current;\n}\n\n/**\n * A generated matcher function for a selector.\n * @callback SelectorMatcher\n * @param {?SelectorAST} selector\n * @param {external:AST[]} [ancestry=[]]\n * @param {ESQueryOptions} [options]\n * @returns {void}\n*/\n\n/**\n * A WeakMap for holding cached matcher functions for selectors.\n * @type {WeakMap<SelectorAST, SelectorMatcher>}\n*/\nconst MATCHER_CACHE = typeof WeakMap === 'function' ? new WeakMap : null;\n\n/**\n * Look up a matcher function for `selector` in the cache.\n * If it does not exist, generate it with `generateMatcher` and add it to the cache.\n * In engines without WeakMap, the caching is skipped and matchers are generated with every call.\n * @param {?SelectorAST} selector\n * @returns {SelectorMatcher}\n */\nfunction getMatcher(selector) {\n    if (selector == null) {\n        return () => true;\n    }\n\n    if (MATCHER_CACHE != null) {\n        let matcher = MATCHER_CACHE.get(selector);\n        if (matcher != null) {\n            return matcher;\n        }\n        matcher = generateMatcher(selector);\n        MATCHER_CACHE.set(selector, matcher);\n        return matcher;\n    }\n\n    return generateMatcher(selector);\n}\n\n/**\n * Create a matcher function for `selector`,\n * @param {?SelectorAST} selector\n * @returns {SelectorMatcher}\n */\nfunction generateMatcher(selector) {\n    switch(selector.type) {\n        case 'wildcard':\n            return () => true;\n\n        case 'identifier': {\n            const value = selector.value.toLowerCase();\n            return (node, ancestry, options) => {\n                const nodeTypeKey = (options && options.nodeTypeKey) || 'type';\n                return value === node[nodeTypeKey].toLowerCase();\n            };\n        }\n\n        case 'exactNode':\n            return (node, ancestry) => {\n                return ancestry.length === 0;\n            };\n\n        case 'field': {\n            const path = selector.name.split('.');\n            return (node, ancestry) => {\n                const ancestor = ancestry[path.length - 1];\n                return inPath(node, ancestor, path, 0);\n            };\n        }\n\n        case 'matches': {\n            const matchers = selector.selectors.map(getMatcher);\n            return (node, ancestry, options) => {\n                for (let i = 0; i < matchers.length; ++i) {\n                    if (matchers[i](node, ancestry, options)) { return true; }\n                }\n                return false;\n            };\n        }\n\n        case 'compound': {\n            const matchers = selector.selectors.map(getMatcher);\n            return (node, ancestry, options) => {\n                for (let i = 0; i < matchers.length; ++i) {\n                    if (!matchers[i](node, ancestry, options)) { return false; }\n                }\n                return true;\n            };\n        }\n\n        case 'not': {\n            const matchers = selector.selectors.map(getMatcher);\n            return (node, ancestry, options) => {\n                for (let i = 0; i < matchers.length; ++i) {\n                    if (matchers[i](node, ancestry, options)) { return false; }\n                }\n                return true;\n            };\n        }\n\n        case 'has': {\n            const matchers = selector.selectors.map(getMatcher);\n            return (node, ancestry, options) => {\n                let result = false;\n\n                const a = [];\n                estraverse.traverse(node, {\n                    enter (node, parent) {\n                        if (parent != null) { a.unshift(parent); }\n\n                        for (let i = 0; i < matchers.length; ++i) {\n                            if (matchers[i](node, a, options)) {\n                                result = true;\n                                this.break();\n                                return;\n                            }\n                        }\n                    },\n                    leave () { a.shift(); },\n                    keys: options && options.visitorKeys,\n                    fallback: options && options.fallback || 'iteration'\n                });\n\n                return result;\n            };\n        }\n\n        case 'child': {\n            const left = getMatcher(selector.left);\n            const right = getMatcher(selector.right);\n            return (node, ancestry, options) => {\n                if (ancestry.length > 0 && right(node, ancestry, options)) {\n                    return left(ancestry[0], ancestry.slice(1), options);\n                }\n                return false;\n            };\n        }\n\n        case 'descendant': {\n            const left = getMatcher(selector.left);\n            const right = getMatcher(selector.right);\n            return (node, ancestry, options) => {\n                if (right(node, ancestry, options)) {\n                    for (let i = 0, l = ancestry.length; i < l; ++i) {\n                        if (left(ancestry[i], ancestry.slice(i + 1), options)) {\n                            return true;\n                        }\n                    }\n                }\n                return false;\n            };\n        }\n\n        case 'attribute': {\n            const path = selector.name.split('.');\n            switch (selector.operator) {\n                case void 0:\n                    return (node) => getPath(node, path) != null;\n                case '=':\n                    switch (selector.value.type) {\n                        case 'regexp':\n                            return (node) => {\n                                const p = getPath(node, path);\n                                return typeof p === 'string' && selector.value.value.test(p);\n                            };\n                        case 'literal': {\n                            const literal = `${selector.value.value}`;\n                            return (node) => literal === `${getPath(node, path)}`;\n                        }\n                        case 'type':\n                            return (node) => selector.value.value === typeof getPath(node, path);\n                    }\n                    throw new Error(`Unknown selector value type: ${selector.value.type}`);\n                case '!=':\n                    switch (selector.value.type) {\n                        case 'regexp':\n                            return (node) => !selector.value.value.test(getPath(node, path));\n                        case 'literal': {\n                            const literal = `${selector.value.value}`;\n                            return (node) => literal !== `${getPath(node, path)}`;\n                        }\n                        case 'type':\n                            return (node) => selector.value.value !== typeof getPath(node, path);\n                    }\n                    throw new Error(`Unknown selector value type: ${selector.value.type}`);\n                case '<=':\n                    return (node) => getPath(node, path) <= selector.value.value;\n                case '<':\n                    return (node) => getPath(node, path) < selector.value.value;\n                case '>':\n                    return (node) => getPath(node, path) > selector.value.value;\n                case '>=':\n                    return (node) => getPath(node, path) >= selector.value.value;\n            }\n            throw new Error(`Unknown operator: ${selector.operator}`);\n        }\n\n        case 'sibling': {\n            const left = getMatcher(selector.left);\n            const right = getMatcher(selector.right);\n            return (node, ancestry, options) =>\n                right(node, ancestry, options) &&\n                    sibling(node, left, ancestry, LEFT_SIDE, options) ||\n                    selector.left.subject &&\n                    left(node, ancestry, options) &&\n                    sibling(node, right, ancestry, RIGHT_SIDE, options);\n        }\n\n        case 'adjacent': {\n            const left = getMatcher(selector.left);\n            const right = getMatcher(selector.right);\n            return (node, ancestry, options) =>\n                right(node, ancestry, options) &&\n                    adjacent(node, left, ancestry, LEFT_SIDE, options) ||\n                    selector.right.subject &&\n                    left(node, ancestry, options) &&\n                    adjacent(node, right, ancestry, RIGHT_SIDE, options);\n        }\n\n        case 'nth-child': {\n            const nth = selector.index.value;\n            const right = getMatcher(selector.right);\n            return (node, ancestry, options) =>\n                right(node, ancestry, options) &&\n                    nthChild(node, ancestry, nth, options);\n        }\n\n        case 'nth-last-child': {\n            const nth = -selector.index.value;\n            const right = getMatcher(selector.right);\n            return (node, ancestry, options) =>\n                right(node, ancestry, options) &&\n                    nthChild(node, ancestry, nth, options);\n        }\n\n        case 'class': {\n            \n            const name = selector.name.toLowerCase();\n\n            return (node, ancestry, options) => {\n                \n                if (options && options.matchClass) {\n                    return options.matchClass(selector.name, node, ancestry);\n                }\n                \n                if (options && options.nodeTypeKey) return false;    \n\n                switch(name){\n                    case 'statement':\n                        if(node.type.slice(-9) === 'Statement') return true;\n                        // fallthrough: interface Declaration <: Statement { }\n                    case 'declaration':\n                        return node.type.slice(-11) === 'Declaration';\n                    case 'pattern':\n                        if(node.type.slice(-7) === 'Pattern') return true;\n                        // fallthrough: interface Expression <: Node, Pattern { }\n                    case 'expression':\n                        return node.type.slice(-10) === 'Expression' ||\n                            node.type.slice(-7) === 'Literal' ||\n                            (\n                                node.type === 'Identifier' &&\n                                (ancestry.length === 0 || ancestry[0].type !== 'MetaProperty')\n                            ) ||\n                            node.type === 'MetaProperty';\n                    case 'function':\n                        return node.type === 'FunctionDeclaration' ||\n                            node.type === 'FunctionExpression' ||\n                            node.type === 'ArrowFunctionExpression';\n                }\n                throw new Error(`Unknown class name: ${selector.name}`);\n            };\n        }\n    }\n\n    throw new Error(`Unknown selector type: ${selector.type}`);\n}\n\n/**\n * @callback TraverseOptionFallback\n * @param {external:AST} node The given node.\n * @returns {string[]} An array of visitor keys for the given node.\n */\n\n/**\n * @callback ClassMatcher\n * @param {string} className The name of the class to match.\n * @param {external:AST} node The node to match against.\n * @param {Array<external:AST>} ancestry The ancestry of the node.\n * @returns {boolean} True if the node matches the class, false if not.\n */\n\n/**\n * @typedef {object} ESQueryOptions\n * @property {string} [nodeTypeKey=\"type\"] By passing `nodeTypeKey`, we can allow other ASTs to use ESQuery.\n * @property { { [nodeType: string]: string[] } } [visitorKeys] By passing `visitorKeys` mapping, we can extend the properties of the nodes that traverse the node.\n * @property {TraverseOptionFallback} [fallback] By passing `fallback` option, we can control the properties of traversing nodes when encountering unknown nodes.\n * @property {ClassMatcher} [matchClass] By passing `matchClass` option, we can customize the interpretation of classes.\n */\n\n/**\n * Given a `node` and its ancestors, determine if `node` is matched\n * by `selector`.\n * @param {?external:AST} node\n * @param {?SelectorAST} selector\n * @param {external:AST[]} [ancestry=[]]\n * @param {ESQueryOptions} [options]\n * @throws {Error} Unknowns (operator, class name, selector type, or\n * selector value type)\n * @returns {boolean}\n */\nfunction matches(node, selector, ancestry, options) {\n    if (!selector) { return true; }\n    if (!node) { return false; }\n    if (!ancestry) { ancestry = []; }\n\n    return getMatcher(selector)(node, ancestry, options);\n}\n\n/**\n * Get visitor keys of a given node.\n * @param {external:AST} node The AST node to get keys.\n * @param {ESQueryOptions|undefined} options\n * @returns {string[]} Visitor keys of the node.\n */\nfunction getVisitorKeys(node, options) {\n    const nodeTypeKey = (options && options.nodeTypeKey) || 'type';\n\n    const nodeType = node[nodeTypeKey];\n    if (options && options.visitorKeys && options.visitorKeys[nodeType]) {\n        return options.visitorKeys[nodeType];\n    }\n    if (estraverse.VisitorKeys[nodeType]) {\n        return estraverse.VisitorKeys[nodeType];\n    }\n    if (options && typeof options.fallback === 'function') {\n        return options.fallback(node);\n    }\n    // 'iteration' fallback\n    return Object.keys(node).filter(function (key) {\n        return key !== nodeTypeKey;\n    });\n}\n\n\n/**\n * Check whether the given value is an ASTNode or not.\n * @param {any} node The value to check.\n * @param {ESQueryOptions|undefined} options The options to use.\n * @returns {boolean} `true` if the value is an ASTNode.\n */\nfunction isNode(node, options) {\n    const nodeTypeKey = (options && options.nodeTypeKey) || 'type';\n    return node !== null && typeof node === 'object' && typeof node[nodeTypeKey] === 'string';\n}\n\n/**\n * Determines if the given node has a sibling that matches the\n * given selector matcher.\n * @param {external:AST} node\n * @param {SelectorMatcher} matcher\n * @param {external:AST[]} ancestry\n * @param {Side} side\n * @param {ESQueryOptions|undefined} options\n * @returns {boolean}\n */\nfunction sibling(node, matcher, ancestry, side, options) {\n    const [parent] = ancestry;\n    if (!parent) { return false; }\n    const keys = getVisitorKeys(parent, options);\n    for (let i = 0; i < keys.length; ++i) {\n        const listProp = parent[keys[i]];\n        if (Array.isArray(listProp)) {\n            const startIndex = listProp.indexOf(node);\n            if (startIndex < 0) { continue; }\n            let lowerBound, upperBound;\n            if (side === LEFT_SIDE) {\n                lowerBound = 0;\n                upperBound = startIndex;\n            } else {\n                lowerBound = startIndex + 1;\n                upperBound = listProp.length;\n            }\n            for (let k = lowerBound; k < upperBound; ++k) {\n                if (isNode(listProp[k], options) && matcher(listProp[k], ancestry, options)) {\n                    return true;\n                }\n            }\n        }\n    }\n    return false;\n}\n\n/**\n * Determines if the given node has an adjacent sibling that matches\n * the given selector matcher.\n * @param {external:AST} node\n * @param {SelectorMatcher} matcher\n * @param {external:AST[]} ancestry\n * @param {Side} side\n * @param {ESQueryOptions|undefined} options\n * @returns {boolean}\n */\nfunction adjacent(node, matcher, ancestry, side, options) {\n    const [parent] = ancestry;\n    if (!parent) { return false; }\n    const keys = getVisitorKeys(parent, options);\n    for (let i = 0; i < keys.length; ++i) {\n        const listProp = parent[keys[i]];\n        if (Array.isArray(listProp)) {\n            const idx = listProp.indexOf(node);\n            if (idx < 0) { continue; }\n            if (side === LEFT_SIDE && idx > 0 && isNode(listProp[idx - 1], options) && matcher(listProp[idx - 1], ancestry, options)) {\n                return true;\n            }\n            if (side === RIGHT_SIDE && idx < listProp.length - 1 && isNode(listProp[idx + 1], options) &&  matcher(listProp[idx + 1], ancestry, options)) {\n                return true;\n            }\n        }\n    }\n    return false;\n}\n\n/**\n * Determines if the given node is the `nth` child.\n * If `nth` is negative then the position is counted\n * from the end of the list of children.\n * @param {external:AST} node\n * @param {external:AST[]} ancestry\n * @param {Integer} nth\n * @param {ESQueryOptions|undefined} options\n * @returns {boolean}\n */\nfunction nthChild(node, ancestry, nth, options) {\n    if (nth === 0) { return false; }\n    const [parent] = ancestry;\n    if (!parent) { return false; }\n    const keys = getVisitorKeys(parent, options);\n    for (let i = 0; i < keys.length; ++i) {\n        const listProp = parent[keys[i]];\n        if (Array.isArray(listProp)){\n            const idx = nth < 0 ? listProp.length + nth : nth - 1;\n            if (idx >= 0 && idx < listProp.length && listProp[idx] === node) {\n                return true;\n            }\n        }\n    }\n    return false;\n}\n\n/**\n * For each selector node marked as a subject, find the portion of the\n * selector that the subject must match.\n * @param {SelectorAST} selector\n * @param {SelectorAST} [ancestor] Defaults to `selector`\n * @returns {SelectorAST[]}\n */\nfunction subjects(selector, ancestor) {\n    if (selector == null || typeof selector != 'object') { return []; }\n    if (ancestor == null) { ancestor = selector; }\n    const results = selector.subject ? [ancestor] : [];\n    const keys = Object.keys(selector);\n    for (let i = 0; i < keys.length; ++i) {\n        const p = keys[i];\n        const sel = selector[p];\n        results.push(...subjects(sel, p === 'left' ? sel : ancestor));\n    }\n    return results;\n}\n\n/**\n* @callback TraverseVisitor\n* @param {?external:AST} node\n* @param {?external:AST} parent\n* @param {external:AST[]} ancestry\n*/\n\n/**\n * From a JS AST and a selector AST, collect all JS AST nodes that\n * match the selector.\n * @param {external:AST} ast\n * @param {?SelectorAST} selector\n * @param {TraverseVisitor} visitor\n * @param {ESQueryOptions} [options]\n * @returns {external:AST[]}\n */\nfunction traverse(ast, selector, visitor, options) {\n    if (!selector) { return; }\n    const ancestry = [];\n    const matcher = getMatcher(selector);\n    const altSubjects = subjects(selector).map(getMatcher);\n    estraverse.traverse(ast, {\n        enter (node, parent) {\n            if (parent != null) { ancestry.unshift(parent); }\n            if (matcher(node, ancestry, options)) {\n                if (altSubjects.length) {\n                    for (let i = 0, l = altSubjects.length; i < l; ++i) {\n     R                   if (altSubjects[i](node, ancestry, options)) {\n                            visitor(node, parent, ancestry);\n                        }\n                        for (let k = 0, m = ancestry.length; k < m; ++k) {\n                            const succeedingAncestry = ancestry.slice(k + 1);\n                            if (altSubjects[i](ancestry[k], succeedingAncestry, options)) {\n                                visitor(ancestry[k], parent, succeedingAncestry);\n                            }\n                        }\n                    }\n                } else {\n                    visitor(node, parent, ancestry);\n                }\n            }\n        },\n        leave () { ancestry.shift(); },\n        keys: options && options.visitorKeys,\n        fallback: options && options.fallback || 'iteration'\n    });\n}\n\n\n/**\n * From a JS AST and a selector AST, collect all JS AST nodes that\n * match the selector.\n * @param {external:AST} ast\n * @param {?SelectorAST} selector\n * @param {ESQueryOptions} [options]\n * @returns {external:AST[]}\n */\nfunction match(ast, selector, options) {\n    const results = [];\n    traverse(ast, selector, function (node) {\n        results.push(node);\n    }, options);\n    return results;\n}\n\n/**\n * Parse a selector string and return its AST.\n * @param {string} selector\n * @returns {SelectorAST}\n */\nfunction parse(selector) {\n    return parser.parse(selector);\n}\n\n/**\n * Query the code AST using the selector string.\n * @param {external:AST} ast\n * @param {string} selector\n * @param {ESQueryOptions} [options]\n * @returns {external:AST[]}\n */\nfunction query(ast, selector, options) {\n    return match(ast, parse(selector), options);\n}\n\nquery.parse = parse;\nquery.match = match;\nquery.traverse = traverse;\nquery.matches = matches;\nquery.query = query;\n\nexport default query;\n"],"names":["clone","exports","Syntax","VisitorOption","VisitorKeys","BREAK","SKIP","REMOVE","deepCopy","obj","key","val","ret","hasOwnProperty","Reference","parent","this","Element","node","path","wrap","ref","Controller","isNode","type","isProperty","nodeType","ObjectExpression","ObjectPattern","candidateExistsInLeaveList","leavelist","candidate","i","length","traverse","root","visitor","extendCommentRange","comment","tokens","target","array","func","diff","len","current","upperBound","token","range","extendedRange","AssignmentExpression","AssignmentPattern","ArrayExpression","ArrayPattern","ArrowFunctionExpression","AwaitExpression","BlockStatement","BinaryExpression","BreakStatement","CallExpression","CatchClause","ChainExpression","ClassBody","ClassDeclaration","ClassExpression","ComprehensionBlock","ComprehensionExpression","ConditionalExpression","ContinueStatement","DebuggerStatement","DirectiveStatement","DoWhileStatement","EmptyStatement","ExportAllDeclaration","ExportDefaultDeclaration","ExportNamedDeclaration","ExportSpecifier","ExpressionStatement","ForStatement","ForInStatement","ForOfStatement","FunctionDeclaration","FunctionExpression","GeneratorExpression","Identifier","IfStatement","ImportExpression","ImportDeclaration","ImportDefaultSpecifier","ImportNamespaceSpecifier","ImportSpecifier","Literal","LabeledStatement","LogicalExpression","MemberExpression","MetaProperty","MethodDefinition","ModuleSpecifier","NewExpression","PrivateIdentifier","Program","Property","PropertyDefinition","RestElement","ReturnStatement","SequenceExpression","SpreadElement","Super","SwitchStatement","SwitchCase","TaggedTemplateExpression","TemplateElement","TemplateLiteral","ThisExpression","ThrowStatement","TryStatement","UnaryExpression","UpdateExpression","VariableDeclaration","VariableDeclarator","WhileStatement","WithStatement","YieldExpression","Break","Skip","Remove","prototype","replace","remove","Array","isArray","splice","iz","j","jz","result","addToPath","push","__current","__leavelist","parents","__execute","callback","element","previous","undefined","__state","call","notify","flag","skip","__initialize","__worklist","__fallback","fallback","Object","keys","__keys","assign","create","worklist","current2","candidates","sentinel","pop","enter","Error","leave","outer","removeElem","nextElem","attachComments","tree","providedComments","cursor","comments","leadingComments","trailingComments","cloneEnvironment","module","peg$SyntaxError","message","expected","found","location","name","captureStackTrace","child","ctor","constructor","peg$subclass","buildMessage","DESCRIBE_EXPECTATION_FNS","literal","expectation","literalEscape","text","class","escapedParts","parts","classEscape","inverted","any","end","other","description","hex","ch","charCodeAt","toString","toUpperCase","s","descriptions","sort","slice","join","describeExpected","describeFound","SyntaxError","parse","input","options","peg$result","peg$FAILED","peg$startRuleFunctions","start","peg$parsestart","peg$startRuleFunction","peg$c3","peg$literalExpectation","peg$c4","peg$c5","peg$classExpectation","peg$c8","peg$c11","peg$c14","peg$c18","peg$c19","ss","concat","map","peg$c23","peg$c26","peg$c29","peg$c32","peg$c34","peg$c36","peg$c37","peg$c39","peg$c40","a","peg$c41","peg$c42","peg$c44","peg$c46","op","value","operator","peg$c49","peg$c50","peg$c51","peg$c53","peg$c54","peg$c55","b","peg$c56","d","match","peg$c58","peg$c59","peg$c60","peg$c61","peg$c62","peg$c66","peg$c67","peg$c68","peg$c70","peg$c72","peg$c73","peg$c75","peg$c77","peg$c78","peg$c81","peg$c82","peg$c86","peg$c89","peg$c90","selectors","peg$c92","peg$c94","peg$c97","peg$c100","peg$c103","peg$c106","peg$c109","peg$currPos","peg$posDetailsCache","line","column","peg$maxFailPos","peg$maxFailExpected","peg$silentFails","startRule","ignoreCase","peg$computePosDetails","pos","p","details","peg$computeLocation","startPos","endPos","startPosDetails","endPosDetails","offset","peg$fail","s0","s1","s2","cached","peg$resultsCache","nextPos","peg$parse_","peg$parseselectors","peg$c1","peg$parseidentifierName","test","charAt","peg$parsebinaryOp","s3","s4","s5","s6","s7","peg$parseselector","peg$parsehasSelector","left","right","peg$parsesequence","reduce","memo","rhs","subject","as","peg$parseatom","peg$parsewildcard","peg$parseidentifier","peg$parseattrName","peg$parseattrEqOps","substr","peg$parsetype","flgs","peg$parsere_character_class","peg$parsere_escape","peg$parsere_chars","peg$parseflags","RegExp","peg$parseregex","peg$parseattrOps","peg$parsestring","leadingDecimals","apply","parseFloat","peg$parsenumber","peg$parsepath","peg$parseattrValue","peg$parseattr","peg$parsefield","peg$parsenegation","peg$parsematches","peg$parseis","peg$parsehasSelectors","peg$parsehas","nth","peg$parsefirstChild","nthLast","peg$parselastChild","parseInt","peg$parsenthChild","peg$parsenthLastChild","peg$parseclass","n","index","factory","getPath","MATCHER_CACHE","WeakMap","getMatcher","selector","matcher","get","generateMatcher","set","toLowerCase","ancestry","nodeTypeKey","split","inPath","ancestor","fromPathIndex","field","k","matchers","estraverse","unshift","shift","visitorKeys","l","_typeof","sibling","adjacent","nthChild","matchClass","getVisitorKeys","filter","side","_slicedToArray","listProp","startIndex","indexOf","lowerBound","idx","ast","altSubjects","subjects","results","sel","_toConsumableArray","m","succeedingAncestry","parser","query","matches"],"mappings":"m/DA2BC,SAASA,EAAMC,GAGZ,IAAIC,EACAC,EACAC,EACAC,EACAC,EACAC,EAEJ,SAASC,EAASC,GACd,IAAcC,EAAKC,EAAfC,EAAM,GACV,IAAKF,KAAOD,EACJA,EAAII,eAAeH,KACnBC,EAAMF,EAAIC,GAENE,EAAIF,GADW,iBAARC,GAA4B,OAARA,EAChBH,EAASG,GAETA,GAIvB,OAAOC,EAgMX,SAASE,EAAUC,EAAQL,GACvBM,KAAKD,OAASA,EACdC,KAAKN,IAAMA,EAiBf,SA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AAMwK,GACX,OAAO0C,EAAOlN,MAAMwK,GAUxB,SAAS2C,EAAMT,EAAKlC,EAAUtK,GAC1B,OAAO8C,EAAM0J,EAAK1M,EAAMwK,GAAWtK,UAGvCiN,EAAMnN,MAAQA,EACdmN,EAAMnK,MAAQA,EACdmK,EAAM5Y,SAAWA,EACjB4Y,EAAMC,QAvPN,SAAiB7Z,EAAMiX,EAAUM,EAAU5K,GACvC,OAAKsK,KACAjX,IACAuX,IAAYA,EAAW,IAErBP,EAAWC,EAAXD,CAAqBhX,EAAMuX,EAAU5K,KAmPhDiN,EAAMA,MAAQA"}0D]x/Copyright (c) 2013, Joel Feenstra
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.
    * Neither the name of the ESQuery nor the names of its contributors may
      be used to endorse or promote products derived from this software without
      specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL JOEL FEENSTRA BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
}~x{
  "name": "esquery",
  "version": "1.7.0",
  "author": "Joel Feenstra <jrfeenst+esquery@gmail.com>",
  "contributors": [],
  "description": "A query library for ECMAScript AST using a CSS selector like query language.",
  "main": "dist/esquery.min.js",
  "module": "dist/esquery.esm.min.js",
  "files": [
    "dist/*.js",
    "dist/*.map",
    "parser.js",
    "license.txt",
    "README.md"
  ],
  "nyc": {
    "branches": 100,
    "lines": 100,
    "functions": 100,
    "statements": 100,
    "reporter": [
      "html",
      "text"
    ],
    "exclude": [
      "parser.js",
      "dist",
      "tests"
    ]
  },
  "scripts": {
    "prepublishOnly": "npm run build && npm test",
    "build:parser": "rm parser.js && pegjs --cache --format umd -o \"parser.js\" \"grammar.pegjs\"",
    "build:browser": "rollup -c",
    "build": "npm run build:parser && npm run build:browser",
    "mocha": "mocha --require chai/register-assert --require @babel/register tests",
    "test": "nyc npm run mocha && npm run lint",
    "test:ci": "npm run mocha",
    "lint": "eslint ."
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/estools/esquery.git"
  },
  "bugs": "https://github.com/estools/esquery/issues",
  "homepage": "https://github.com/estools/esquery/",
  "keywords": [
    "ast",
    "ecmascript",
    "javascript",
    "query"
  ],
  "devDependencies": {
    "@babel/core": "^7.9.0",
    "@babel/preset-env": "^7.9.5",
    "@babel/register": "^7.9.0",
    "@rollup/plugin-commonjs": "^11.1.0",
    "@rollup/plugin-json": "^4.0.2",
    "@rollup/plugin-node-resolve": "^7.1.3",
    "babel-plugin-transform-es2017-object-entries": "0.0.5",
    "chai": "4.2.0",
    "eslint": "^6.8.0",
    "esprima": "~4.0.1",
    "mocha": "7.1.1",
    "nyc": "^15.0.1",
    "pegjs": "~0.10.0",
    "rollup": "^1.32.1",
    "rollup-plugin-babel": "^4.4.0",
    "rollup-plugin-terser": "^5.3.0"
  },
  "license": "BSD-3-Clause",
  "engines": {
    "node": ">=0.10"
  },
  "dependencies": {
    "estraverse": "^5.1.0"
  }
}
?D&x   /*
 * Generated by PEG.js 0.10.0.
 *
 * http://pegjs.org/
 */
(function(root, factory) {
  if (typeof define === "function" && define.amd) {
    define([], factory);
  } else if (typeof module === "object" && module.exports) {
    module.exports = factory();
  }
})(this, function() {
  "use strict";

  function peg$subclass(child, parent) {
    function ctor() { this.constructor = child; }
    ctor.prototype = parent.prototype;
    child.prototype = new ctor();
  }

  function peg$SyntaxError(message, expected, found, location) {
    this.message  = message;
    this.expected = expected;
    this.found    = found;
    this.location = location;
    this.name     = "SyntaxError";

    if (typeof Error.captureStackTrace === "function") {
      Error.captureStackTrace(this, peg$SyntaxError);
    }
  }

  peg$subclass(peg$SyntaxError, Error);

  peg$SyntaxError.buildMessage = function(expected, found) {
    var DESCRIBE_EXPECTATION_FNS = {
          literal: function(expectation) {
            return "\"" + literalEscape(expectation.text) + "\"";
          },

          "class": function(expectation) {
            var escapedParts = "",
                i;

            for (i = 0; i < expectation.parts.length; i++) {
              escapedParts += expectation.parts[i] instanceof Array
                ? classEscape(expectation.parts[i][0]) + "-" + classEscape(expectation.parts[i][1])
                : classEscape(expectation.parts[i]);
            }

            return "[" + (expectation.inverted ? "^" : "") + escapedParts + "]";
          },

          any: function(expectation) {
            return "any character";
          },

          end: function(expectation) {
            return "end of input";
          },

          other: function(expectation) {
            return expectation.description;
          }
        };

    function hex(ch) {
      return ch.charCodeAt(0).toString(16).toUpperCase();
    }

    function literalEscape(s) {
      return s
        .replace(/\\/g, '\\\\')
        .replace(/"/g,  '\\"')
        .replace(/\0/g, '\\0')
        .replace(/\t/g, '\\t')
        .replace(/\n/g, '\\n')
        .replace(/\r/g, '\\r')
        .replace(/[\x00-\x0F]/g,          function(ch) { return '\\x0' + hex(ch); })
        .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x'  + hex(ch); });
    }

    function classEscape(s) {
      return s
        .replace(/\\/g, '\\\\')
        .replace(/\]/g, '\\]')
        .replace(/\^/g, '\\^')
        .replace(/-/g,  '\\-')
        .replace(/\0/g, '\\0')
        .replace(/\t/g, '\\t')
        .replace(/\n/g, '\\n')
        .replace(/\r/g, '\\r')
        .replace(/[\x00-\x0F]/g,          function(ch) { return '\\x0' + hex(ch); })
        .replace(/[\x10-\x1F\x7F-\x9F]/g, function(ch) { return '\\x'  + hex(ch); });
    }

    function describeExpectation(expectation) {
      return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);
    }

    function describeExpected(expected) {
      var descriptions = new Array(expected.length),
          i, j;

      for (i = 0; i < expected.length; i++) {
        descriptions[i] = describeExpectation(expected[i]);
      }

      descriptions.sort();

      if (descriptions.length > 0) {
        for (i = 1, j = 1; i < descriptions.length; i++) {
          if (descriptions[i - 1] !== descriptions[i]) {
            descriptions[j] = descriptions[i];
            j++;
          }
        }
        descriptions.length = j;
      }

      switch (descriptions.length) {
        case 1:
          return descriptions[0];

        case 2:
          return descriptions[0] + " or " + descriptions[1];

        default:
          return descriptions.slice(0, -1).join(", ")
            + ", or "
            + descriptions[descriptions.length - 1];
      }
    }

    function describeFound(found) {
      return found ? "\"" + literalEscape(found) + "\"" : "end of input";
    }

    return "Expected " + describeExpected(expected) + " but " + describeFound(found) + " found.";
  };

  function peg$parse(input, options) {
    options = options !== void 0 ? options : {};

    var peg$FAILED = {},

        peg$startRuleFunctions = { start: peg$parsestart },
        peg$startRuleFunction  = peg$parsestart,

        peg$c0 = function(ss) {
            return ss.length === 1 ? ss[0] : { type: 'matches', selectors: ss };
          },
        peg$c1 = function() { return void 0; },
        peg$c2 = " ",
        peg$c3 = peg$literalExpectation(" ", false),
        peg$c4 = /^[^ [\],():#!=><~+.]/,
        peg$c5 = peg$classExpectation([" ", "[", "]", ",", "(", ")", ":", "#", "!", "=", ">", "<", "~", "+", "."], true, false),
        peg$c6 = function(i) { return i.join(''); },
        peg$c7 = ">",
        peg$c8 = peg$literalExpectation(">", false),
        peg$c9 = function() { return 'child'; },
        peg$c10 = "~",
        peg$c11 = peg$literalExpectation("~", false),
        peg$c12 = function() { return 'sibling'; },
        peg$c13 = "+",
        peg$c14 = peg$literalExpectation("+", false),
        peg$c15 = function() { return 'adjacent'; },
        peg$c16 = function() { return 'descendant'; },
        peg$c17 = ",",
        peg$c18 = peg$literalExpectation(",", false),
        peg$c19 = function(s, ss) {
          return [s].concat(ss.map(function (s) { return s[3]; }));
        },
        peg$c20 = function(op, s) {
            if (!op) return s;
            return { type: op, left: { type: 'exactNode' }, right: s };
          },
        peg$c21 = function(a, ops) {
            return ops.reduce(function (memo, rhs) {
              return { type: rhs[0], left: memo, right: rhs[1] };
            }, a);
          },
        peg$c22 = "!",
        peg$c23 = peg$literalExpectation("!", false),
        peg$c24 = function(subject, as) {
            const b = as.length === 1 ? as[0] : { type: 'compound', selectors: as };
            if(subject) b.subject = true;
            return b;
          },
        peg$c25 = "*",
        peg$c26 = peg$literalExpectation("*", false),
        peg$c27 = function(a) { return { type: 'wildcard', value: a }; },
        peg$c28 = "#",
        peg$c29 = peg$literalExpectation("#", false),
        peg$c30 = function(i) { return { type: 'identifier', value: i }; },
        peg$c31 = "[",
        peg$c32 = peg$literalExpectation("[", false),
        peg$c33 = "]",
        peg$c34 = peg$literalExpectation("]", false),
        peg$c35 = function(v) { return v; },
        peg$c36 = /^[><!]/,
        peg$c37 = peg$classExpectation([">", "<", "!"], false, false),
        peg$c38 = "=",
        peg$c39 = peg$literalExpectation("=", false),
        peg$c40 = function(a) { return (a || '') + '='; },
        peg$c41 = /^[><]/,
        peg$c42 = peg$classExpectation([">", "<"], false, false),
        peg$c43 = ".",
        peg$c44 = peg$literalExpectation(".", false),
        peg$c45 = function(a, as) {
            return [].concat.apply([a], as).join('');
          },
        peg$c46 = function(name, op, value) {
              return { type: 'attribute', name: name, operator: op, value: value };
            },
        peg$c47 = function(name) { return { type: 'attribute', name: name }; },
        peg$c48 = "\"",
        peg$c49 = peg$literalExpectation("\"", false),
        peg$c50 = /^[^\\"]/,
        peg$c51 = peg$classExpectation(["\\", "\""], true, false),
        peg$c52 = "\\",
        peg$c53 = peg$literalExpectation("\\", false),
        peg$c54 = peg$anyExpectation(),
        peg$c55 = function(a, b) { return a + b; },
        peg$c56 = function(d) {
                return { type: 'literal', value: strUnescape(d.join('')) };
              },
        peg$c57 = "'",
        peg$c58 = peg$literalExpectation("'", false),
        peg$c59 = /^[^\\']/,
        peg$c60 = peg$classExpectation(["\\", "'"], true, false),
        peg$c61 = /^[0-9]/,
        peg$c62 = peg$classExpectation([["0", "9"]], false, false),
        peg$c63 = function(a, b) {
                // Can use `a.flat().join('')` once supported
                const leadingDecimals = a ? [].concat.apply([], a).join('') : '';
                return { type: 'literal', value: parseFloat(leadingDecimals + b.join('')) };
              },
        peg$c64 = function(i) { return { type: 'literal', value: i }; },
        peg$c65 = "type(",
        peg$c66 = peg$literalExpectation("type(", false),
        peg$c67 = /^[^ )]/,
        peg$c68 = peg$classExpectation([" ", ")"], true, false),
        peg$c69 = ")",
        peg$c70 = peg$literalExpectation(")", false),
        peg$c71 = function(t) { return { type: 'type', value: t.join('') }; },
        peg$c72 = /^[imsu]/,
        peg$c73 = peg$classExpectation(["i", "m", "s", "u"], false, false),
        peg$c74 = "/",
        peg$c75 = peg$literalExpectation("/", false),
        peg$c76 = function(pattern, flgs) {
              return {
                type: 'regexp', value: new RegExp(pattern.join(''), flgs ? flgs.join('') : '')
              };
            },
        peg$c77 = /^[^\]\\]/,
        peg$c78 = peg$classExpectation(["]", "\\"], true, false),
        peg$c79 = function(cs) { return '[' + cs.join('') + ']'; },
        peg$c80 = function(a) { return '\\' + a; },
        peg$c81 = /^[^\/\\[]/,
        peg$c82 = peg$classExpectation(["/", "\\", "["], true, false),
        peg$c83 = function(cs) { return cs.join(''); },
        peg$c84 = function(i, is) {
          return { type: 'field', name: is.reduce(function(memo, p){ return memo + p[0] + p[1]; }, i)};
        },
        peg$c85 = ":not(",
        peg$c86 = peg$literalExpectation(":not(", false),
        peg$c87 = function(ss) { return { type: 'not', selectors: ss }; },
        peg$c88 = ":matches(",
        peg$c89 = peg$literalExpectation(":matches(", false),
        peg$c90 = function(ss) { return { type: 'matches', selectors: ss }; },
        peg$c91 = ":is(",
        peg$c92 = peg$literalExpectation(":is(", false),
        peg$c93 = ":has(",
        peg$c94 = peg$literalExpectation(":has(", false),
        peg$c95 = function(ss) { return { type: 'has', selectors: ss }; },
        peg$c96 = ":first-child",
        peg$c97 = peg$literalExpectation(":first-child", false),
        peg$c98 = function() { return nth(1); },
        peg$c99 = ":last-child",
        peg$c100 = peg$literalExpectation(":last-child", false),
        peg$c101 = function() { return nthLast(1); },
        peg$c102 = ":nth-child(",
        peg$c103 = peg$literalExpectation(":nth-child(", false),
        peg$c104 = function(n) { return nth(parseInt(n.join(''), 10)); },
        peg$c105 = ":nth-last-child(",
        peg$c106 = peg$literalExpectation(":nth-last-child(", false),
        peg$c107 = function(n) { return nthLast(parseInt(n.join(''), 10)); },
        peg$c108 = ":",
        peg$c109 = peg$literalExpectation(":", false),
        peg$c110 = function(c) {
          return { type: 'class', name: c };
        },

        peg$currPos          = 0,
        peg$savedPos         = 0,
        peg$posDetailsCache  = [{ line: 1, column: 1 }],
        peg$maxFailPos       = 0,
        peg$maxFailExpected  = [],
        peg$silentFails      = 0,

        peg$resultsCache = {},

        peg$result;

    if ("startRule" in options) {
      if (!(options.startRule in peg$startRuleFunctions)) {
        throw new Error("Can't start parsing from rule \"" + options.startRule + "\".");
      }

      peg$startRuleFunction = peg$startRuleFunctions[options.startRule];
    }

    function text() {
      return input.substring(peg$savedPos, peg$currPos);
    }

    function location() {
      return peg$computeLocation(peg$savedPos, peg$currPos);
    }

    function expected(description, location) {
      location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)

      throw peg$buildStructuredError(
        [peg$otherExpectation(description)],
        input.substring(peg$savedPos, peg$currPos),
        location
      );
    }

    function error(message, location) {
      location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)

      throw peg$buildSimpleError(message, location);
    }

    function peg$literalExpectation(text, ignoreCase) {
      return { type: "literal", text: text, ignoreCase: ignoreCase };
    }

    function peg$classExpectation(parts, inverted, ignoreCase) {
      return { type: "class", parts: parts, inverted: inverted, ignoreCase: ignoreCase };
    }

    function peg$anyExpectation() {
      return { type: "any" };
    }

    function peg$endExpectation() {
      return { type: "end" };
    }

    function peg$otherExpectation(description) {
      return { type: "other", description: description };
    }

    function peg$computePosDetails(pos) {
      var details = peg$posDetailsCache[pos], p;

      if (details) {
        return details;
      } else {
        p = pos - 1;
        while (!peg$posDetailsCache[p]) {
          p--;
        }

        details = peg$posDetailsCache[p];
        details = {
          line:   details.line,
          column: details.column
        };

        while (p < pos) {
          if (input.charCodeAt(p) === 10) {
            details.line++;
            details.column = 1;
          } else {
            details.column++;
          }

          p++;
        }

        peg$posDetailsCache[pos] = details;
        return details;
      }
    }

    function peg$computeLocation(startPos, endPos) {
      var startPosDetails = peg$computePosDetails(startPos),
          endPosDetails   = peg$computePosDetails(endPos);

      return {
        start: {
          offset: startPos,
          line:   startPosDetails.line,
          column: startPosDetails.column
        },
        end: {
          offset: endPos,
          line:   endPosDetails.line,
          column: endPosDetails.column
        }
      };
    }

    function peg$fail(expected) {
      if (peg$currPos < peg$maxFailPos) { return; }

      if (peg$currPos > peg$maxFailPos) {
        peg$maxFailPos = peg$currPos;
        peg$maxFailExpected = [];
      }

      peg$maxFailExpected.push(expected);
    }

    function peg$buildSimpleError(message, location) {
      return new peg$SyntaxError(message, null, null, location);
    }

    function peg$buildStructuredError(expected, found, location) {
      return new peg$SyntaxError(
        peg$SyntaxError.buildMessage(expected, found),
        expected,
        found,
        location
      );
    }

    function peg$parsestart() {
      var s0, s1, s2, s3;

      var key    = peg$currPos * 36 + 0,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      s1 = peg$parse_();
      if (s1 !== peg$FAILED) {
        s2 = peg$parseselectors();
        if (s2 !== peg$FAILED) {
          s3 = peg$parse_();
          if (s3 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c0(s2);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
      if (s0 === peg$FAILED) {
        s0 = peg$currPos;
        s1 = peg$parse_();
        if (s1 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c1();
        }
        s0 = s1;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parse_() {
      var s0, s1;

      var key    = peg$currPos * 36 + 1,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = [];
      if (input.charCodeAt(peg$currPos) === 32) {
        s1 = peg$c2;
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c3); }
      }
      while (s1 !== peg$FAILED) {
        s0.push(s1);
        if (input.charCodeAt(peg$currPos) === 32) {
          s1 = peg$c2;
          peg$currPos++;
        } else {
          s1 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c3); }
        }
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parseidentifierName() {
      var s0, s1, s2;

      var key    = peg$currPos * 36 + 2,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      s1 = [];
      if (peg$c4.test(input.charAt(peg$currPos))) {
        s2 = input.charAt(peg$currPos);
        peg$currPos++;
      } else {
        s2 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c5); }
      }
      if (s2 !== peg$FAILED) {
        while (s2 !== peg$FAILED) {
          s1.push(s2);
          if (peg$c4.test(input.charAt(peg$currPos))) {
            s2 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s2 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c5); }
          }
        }
      } else {
        s1 = peg$FAILED;
      }
      if (s1 !== peg$FAILED) {
        peg$savedPos = s0;
        s1 = peg$c6(s1);
      }
      s0 = s1;

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parsebinaryOp() {
      var s0, s1, s2, s3;

      var key    = peg$currPos * 36 + 3,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      s1 = peg$parse_();
      if (s1 !== peg$FAILED) {
        if (input.charCodeAt(peg$currPos) === 62) {
          s2 = peg$c7;
          peg$currPos++;
        } else {
          s2 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c8); }
        }
        if (s2 !== peg$FAILED) {
          s3 = peg$parse_();
          if (s3 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c9();
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
      if (s0 === peg$FAILED) {
        s0 = peg$currPos;
        s1 = peg$parse_();
        if (s1 !== peg$FAILED) {
          if (input.charCodeAt(peg$currPos) === 126) {
            s2 = peg$c10;
            peg$currPos++;
          } else {
            s2 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c11); }
          }
          if (s2 !== peg$FAILED) {
            s3 = peg$parse_();
            if (s3 !== peg$FAILED) {
              peg$savedPos = s0;
              s1 = peg$c12();
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        if (s0 === peg$FAILED) {
          s0 = peg$currPos;
          s1 = peg$parse_();
          if (s1 !== peg$FAILED) {
            if (input.charCodeAt(peg$currPos) === 43) {
              s2 = peg$c13;
              peg$currPos++;
            } else {
              s2 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c14); }
            }
            if (s2 !== peg$FAILED) {
              s3 = peg$parse_();
              if (s3 !== peg$FAILED) {
                peg$savedPos = s0;
                s1 = peg$c15();
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
          if (s0 === peg$FAILED) {
            s0 = peg$currPos;
            if (input.charCodeAt(peg$currPos) === 32) {
              s1 = peg$c2;
              peg$currPos++;
            } else {
              s1 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c3); }
            }
            if (s1 !== peg$FAILED) {
              s2 = peg$parse_();
              if (s2 !== peg$FAILED) {
                peg$savedPos = s0;
                s1 = peg$c16();
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          }
        }
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parsehasSelectors() {
      var s0, s1, s2, s3, s4, s5, s6, s7;

      var key    = peg$currPos * 36 + 4,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      s1 = peg$parsehasSelector();
      if (s1 !== peg$FAILED) {
        s2 = [];
        s3 = peg$currPos;
        s4 = peg$parse_();
        if (s4 !== peg$FAILED) {
          if (input.charCodeAt(peg$currPos) === 44) {
            s5 = peg$c17;
            peg$currPos++;
          } else {
            s5 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c18); }
          }
          if (s5 !== peg$FAILED) {
            s6 = peg$parse_();
            if (s6 !== peg$FAILED) {
              s7 = peg$parsehasSelector();
              if (s7 !== peg$FAILED) {
                s4 = [s4, s5, s6, s7];
                s3 = s4;
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
        while (s3 !== peg$FAILED) {
          s2.push(s3);
          s3 = peg$currPos;
          s4 = peg$parse_();
          if (s4 !== peg$FAILED) {
            if (input.charCodeAt(peg$currPos) === 44) {
              s5 = peg$c17;
              peg$currPos++;
            } else {
              s5 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c18); }
            }
            if (s5 !== peg$FAILED) {
              s6 = peg$parse_();
              if (s6 !== peg$FAILED) {
                s7 = peg$parsehasSelector();
                if (s7 !== peg$FAILED) {
                  s4 = [s4, s5, s6, s7];
                  s3 = s4;
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        }
        if (s2 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c19(s1, s2);
          s0 = s1;
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parseselectors() {
      var s0, s1, s2, s3, s4, s5, s6, s7;

      var key    = peg$currPos * 36 + 5,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      s1 = peg$parseselector();
      if (s1 !== peg$FAILED) {
        s2 = [];
        s3 = peg$currPos;
        s4 = peg$parse_();
        if (s4 !== peg$FAILED) {
          if (input.charCodeAt(peg$currPos) === 44) {
            s5 = peg$c17;
            peg$currPos++;
          } else {
            s5 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c18); }
          }
          if (s5 !== peg$FAILED) {
            s6 = peg$parse_();
            if (s6 !== peg$FAILED) {
              s7 = peg$parseselector();
              if (s7 !== peg$FAILED) {
                s4 = [s4, s5, s6, s7];
                s3 = s4;
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
        while (s3 !== peg$FAILED) {
          s2.push(s3);
          s3 = peg$currPos;
          s4 = peg$parse_();
          if (s4 !== peg$FAILED) {
            if (input.charCodeAt(peg$currPos) === 44) {
              s5 = peg$c17;
              peg$currPos++;
            } else {
              s5 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c18); }
            }
            if (s5 !== peg$FAILED) {
              s6 = peg$parse_();
              if (s6 !== peg$FAILED) {
                s7 = peg$parseselector();
                if (s7 !== peg$FAILED) {
                  s4 = [s4, s5, s6, s7];
                  s3 = s4;
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        }
        if (s2 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c19(s1, s2);
          s0 = s1;
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parsehasSelector() {
      var s0, s1, s2;

      var key    = peg$currPos * 36 + 6,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      s1 = peg$parsebinaryOp();
      if (s1 === peg$FAILED) {
        s1 = null;
      }
      if (s1 !== peg$FAILED) {
        s2 = peg$parseselector();
        if (s2 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c20(s1, s2);
          s0 = s1;
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parseselector() {
      var s0, s1, s2, s3, s4, s5;

      var key    = peg$currPos * 36 + 7,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      s1 = peg$parsesequence();
      if (s1 !== peg$FAILED) {
        s2 = [];
        s3 = peg$currPos;
        s4 = peg$parsebinaryOp();
        if (s4 !== peg$FAILED) {
          s5 = peg$parsesequence();
          if (s5 !== peg$FAILED) {
            s4 = [s4, s5];
            s3 = s4;
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
        while (s3 !== peg$FAILED) {
          s2.push(s3);
          s3 = peg$currPos;
          s4 = peg$parsebinaryOp();
          if (s4 !== peg$FAILED) {
            s5 = peg$parsesequence();
            if (s5 !== peg$FAILED) {
              s4 = [s4, s5];
              s3 = s4;
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        }
        if (s2 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c21(s1, s2);
          s0 = s1;
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parsesequence() {
      var s0, s1, s2, s3;

      var key    = peg$currPos * 36 + 8,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      if (input.charCodeAt(peg$currPos) === 33) {
        s1 = peg$c22;
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c23); }
      }
      if (s1 === peg$FAILED) {
        s1 = null;
      }
      if (s1 !== peg$FAILED) {
        s2 = [];
        s3 = peg$parseatom();
        if (s3 !== peg$FAILED) {
          while (s3 !== peg$FAILED) {
            s2.push(s3);
            s3 = peg$parseatom();
          }
        } else {
          s2 = peg$FAILED;
        }
        if (s2 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c24(s1, s2);
          s0 = s1;
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parseatom() {
      var s0;

      var key    = peg$currPos * 36 + 9,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$parsewildcard();
      if (s0 === peg$FAILED) {
        s0 = peg$parseidentifier();
        if (s0 === peg$FAILED) {
          s0 = peg$parseattr();
          if (s0 === peg$FAILED) {
            s0 = peg$parsefield();
            if (s0 === peg$FAILED) {
              s0 = peg$parsenegation();
              if (s0 === peg$FAILED) {
                s0 = peg$parsematches();
                if (s0 === peg$FAILED) {
                  s0 = peg$parseis();
                  if (s0 === peg$FAILED) {
                    s0 = peg$parsehas();
                    if (s0 === peg$FAILED) {
                      s0 = peg$parsefirstChild();
                      if (s0 === peg$FAILED) {
                        s0 = peg$parselastChild();
                        if (s0 === peg$FAILED) {
                          s0 = peg$parsenthChild();
                          if (s0 === peg$FAILED) {
                            s0 = peg$parsenthLastChild();
                            if (s0 === peg$FAILED) {
                              s0 = peg$parseclass();
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parsewildcard() {
      var s0, s1;

      var key    = peg$currPos * 36 + 10,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      if (input.charCodeAt(peg$currPos) === 42) {
        s1 = peg$c25;
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c26); }
      }
      if (s1 !== peg$FAILED) {
        peg$savedPos = s0;
        s1 = peg$c27(s1);
      }
      s0 = s1;

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parseidentifier() {
      var s0, s1, s2;

      var key    = peg$currPos * 36 + 11,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      if (input.charCodeAt(peg$currPos) === 35) {
        s1 = peg$c28;
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c29); }
      }
      if (s1 === peg$FAILED) {
        s1 = null;
      }
      if (s1 !== peg$FAILED) {
        s2 = peg$parseidentifierName();
        if (s2 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c30(s2);
          s0 = s1;
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parseattr() {
      var s0, s1, s2, s3, s4, s5;

      var key    = peg$currPos * 36 + 12,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      if (input.charCodeAt(peg$currPos) === 91) {
        s1 = peg$c31;
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c32); }
      }
      if (s1 !== peg$FAILED) {
        s2 = peg$parse_();
        if (s2 !== peg$FAILED) {
          s3 = peg$parseattrValue();
          if (s3 !== peg$FAILED) {
            s4 = peg$parse_();
            if (s4 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 93) {
                s5 = peg$c33;
                peg$currPos++;
              } else {
                s5 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c34); }
              }
              if (s5 !== peg$FAILED) {
                peg$savedPos = s0;
                s1 = peg$c35(s3);
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parseattrOps() {
      var s0, s1, s2;

      var key    = peg$currPos * 36 + 13,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      if (peg$c36.test(input.charAt(peg$currPos))) {
        s1 = input.charAt(peg$currPos);
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c37); }
      }
      if (s1 === peg$FAILED) {
        s1 = null;
      }
      if (s1 !== peg$FAILED) {
        if (input.charCodeAt(peg$currPos) === 61) {
          s2 = peg$c38;
          peg$currPos++;
        } else {
          s2 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c39); }
        }
        if (s2 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c40(s1);
          s0 = s1;
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
      if (s0 === peg$FAILED) {
        if (peg$c41.test(input.charAt(peg$currPos))) {
          s0 = input.charAt(peg$currPos);
          peg$currPos++;
        } else {
          s0 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c42); }
        }
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parseattrEqOps() {
      var s0, s1, s2;

      var key    = peg$currPos * 36 + 14,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      if (input.charCodeAt(peg$currPos) === 33) {
        s1 = peg$c22;
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c23); }
      }
      if (s1 === peg$FAILED) {
        s1 = null;
      }
      if (s1 !== peg$FAILED) {
        if (input.charCodeAt(peg$currPos) === 61) {
          s2 = peg$c38;
          peg$currPos++;
        } else {
          s2 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c39); }
        }
        if (s2 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c40(s1);
          s0 = s1;
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parseattrName() {
      var s0, s1, s2, s3, s4, s5;

      var key    = peg$currPos * 36 + 15,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      s1 = peg$parseidentifierName();
      if (s1 !== peg$FAILED) {
        s2 = [];
        s3 = peg$currPos;
        if (input.charCodeAt(peg$currPos) === 46) {
          s4 = peg$c43;
          peg$currPos++;
        } else {
          s4 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c44); }
        }
        if (s4 !== peg$FAILED) {
          s5 = peg$parseidentifierName();
          if (s5 !== peg$FAILED) {
            s4 = [s4, s5];
            s3 = s4;
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        } else {
          peg$currPos = s3;
          s3 = peg$FAILED;
        }
        while (s3 !== peg$FAILED) {
          s2.push(s3);
          s3 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 46) {
            s4 = peg$c43;
            peg$currPos++;
          } else {
            s4 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c44); }
          }
          if (s4 !== peg$FAILED) {
            s5 = peg$parseidentifierName();
            if (s5 !== peg$FAILED) {
              s4 = [s4, s5];
              s3 = s4;
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        }
        if (s2 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c45(s1, s2);
          s0 = s1;
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parseattrValue() {
      var s0, s1, s2, s3, s4, s5;

      var key    = peg$currPos * 36 + 16,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      s1 = peg$parseattrName();
      if (s1 !== peg$FAILED) {
        s2 = peg$parse_();
        if (s2 !== peg$FAILED) {
          s3 = peg$parseattrEqOps();
          if (s3 !== peg$FAILED) {
            s4 = peg$parse_();
            if (s4 !== peg$FAILED) {
              s5 = peg$parsetype();
              if (s5 === peg$FAILED) {
                s5 = peg$parseregex();
              }
              if (s5 !== peg$FAILED) {
                peg$savedPos = s0;
                s1 = peg$c46(s1, s3, s5);
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
      if (s0 === peg$FAILED) {
        s0 = peg$currPos;
        s1 = peg$parseattrName();
        if (s1 !== peg$FAILED) {
          s2 = peg$parse_();
          if (s2 !== peg$FAILED) {
            s3 = peg$parseattrOps();
            if (s3 !== peg$FAILED) {
              s4 = peg$parse_();
              if (s4 !== peg$FAILED) {
                s5 = peg$parsestring();
                if (s5 === peg$FAILED) {
                  s5 = peg$parsenumber();
                  if (s5 === peg$FAILED) {
                    s5 = peg$parsepath();
                  }
                }
                if (s5 !== peg$FAILED) {
                  peg$savedPos = s0;
                  s1 = peg$c46(s1, s3, s5);
                  s0 = s1;
                } else {
                  peg$currPos = s0;
                  s0 = peg$FAILED;
                }
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
        if (s0 === peg$FAILED) {
          s0 = peg$currPos;
          s1 = peg$parseattrName();
          if (s1 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c47(s1);
          }
          s0 = s1;
        }
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parsestring() {
      var s0, s1, s2, s3, s4, s5;

      var key    = peg$currPos * 36 + 17,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      if (input.charCodeAt(peg$currPos) === 34) {
        s1 = peg$c48;
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c49); }
      }
      if (s1 !== peg$FAILED) {
        s2 = [];
        if (peg$c50.test(input.charAt(peg$currPos))) {
          s3 = input.charAt(peg$currPos);
          peg$currPos++;
        } else {
          s3 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c51); }
        }
        if (s3 === peg$FAILED) {
          s3 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 92) {
            s4 = peg$c52;
            peg$currPos++;
          } else {
            s4 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c53); }
          }
          if (s4 !== peg$FAILED) {
            if (input.length > peg$currPos) {
              s5 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s5 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c54); }
            }
            if (s5 !== peg$FAILED) {
              peg$savedPos = s3;
              s4 = peg$c55(s4, s5);
              s3 = s4;
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
          } else {
            peg$currPos = s3;
            s3 = peg$FAILED;
          }
        }
        while (s3 !== peg$FAILED) {
          s2.push(s3);
          if (peg$c50.test(input.charAt(peg$currPos))) {
            s3 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s3 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c51); }
          }
          if (s3 === peg$FAILED) {
            s3 = peg$currPos;
            if (input.charCodeAt(peg$currPos) === 92) {
              s4 = peg$c52;
              peg$currPos++;
            } else {
              s4 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c53); }
            }
            if (s4 !== peg$FAILED) {
              if (input.length > peg$currPos) {
                s5 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s5 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c54); }
              }
              if (s5 !== peg$FAILED) {
                peg$savedPos = s3;
                s4 = peg$c55(s4, s5);
                s3 = s4;
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
          }
        }
        if (s2 !== peg$FAILED) {
          if (input.charCodeAt(peg$currPos) === 34) {
            s3 = peg$c48;
            peg$currPos++;
          } else {
            s3 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c49); }
          }
          if (s3 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c56(s2);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }
      if (s0 === peg$FAILED) {
        s0 = peg$currPos;
        if (input.charCodeAt(peg$currPos) === 39) {
          s1 = peg$c57;
          peg$currPos++;
        } else {
          s1 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c58); }
        }
        if (s1 !== peg$FAILED) {
          s2 = [];
          if (peg$c59.test(input.charAt(peg$currPos))) {
            s3 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s3 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c60); }
          }
          if (s3 === peg$FAILED) {
            s3 = peg$currPos;
            if (input.charCodeAt(peg$currPos) === 92) {
              s4 = peg$c52;
              peg$currPos++;
            } else {
              s4 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c53); }
            }
            if (s4 !== peg$FAILED) {
              if (input.length > peg$currPos) {
                s5 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s5 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c54); }
              }
              if (s5 !== peg$FAILED) {
                peg$savedPos = s3;
                s4 = peg$c55(s4, s5);
                s3 = s4;
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            } else {
              peg$currPos = s3;
              s3 = peg$FAILED;
            }
          }
          while (s3 !== peg$FAILED) {
            s2.push(s3);
            if (peg$c59.test(input.charAt(peg$currPos))) {
              s3 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s3 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c60); }
            }
            if (s3 === peg$FAILED) {
              s3 = peg$currPos;
              if (input.charCodeAt(peg$currPos) === 92) {
                s4 = peg$c52;
                peg$currPos++;
              } else {
                s4 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c53); }
              }
              if (s4 !== peg$FAILED) {
                if (input.length > peg$currPos) {
                  s5 = input.charAt(peg$currPos);
                  peg$currPos++;
                } else {
                  s5 = peg$FAILED;
                  if (peg$silentFails === 0) { peg$fail(peg$c54); }
                }
                if (s5 !== peg$FAILED) {
                  peg$savedPos = s3;
                  s4 = peg$c55(s4, s5);
                  s3 = s4;
                } else {
                  peg$currPos = s3;
                  s3 = peg$FAILED;
                }
              } else {
                peg$currPos = s3;
                s3 = peg$FAILED;
              }
            }
          }
          if (s2 !== peg$FAILED) {
            if (input.charCodeAt(peg$currPos) === 39) {
              s3 = peg$c57;
              peg$currPos++;
            } else {
              s3 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c58); }
            }
            if (s3 !== peg$FAILED) {
              peg$savedPos = s0;
              s1 = peg$c56(s2);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parsenumber() {
      var s0, s1, s2, s3;

      var key    = peg$currPos * 36 + 18,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      s1 = peg$currPos;
      s2 = [];
      if (peg$c61.test(input.charAt(peg$currPos))) {
        s3 = input.charAt(peg$currPos);
        peg$currPos++;
      } else {
        s3 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c62); }
      }
      while (s3 !== peg$FAILED) {
        s2.push(s3);
        if (peg$c61.test(input.charAt(peg$currPos))) {
          s3 = input.charAt(peg$currPos);
          peg$currPos++;
        } else {
          s3 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c62); }
        }
      }
      if (s2 !== peg$FAILED) {
        if (input.charCodeAt(peg$currPos) === 46) {
          s3 = peg$c43;
          peg$currPos++;
        } else {
          s3 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c44); }
        }
        if (s3 !== peg$FAILED) {
          s2 = [s2, s3];
          s1 = s2;
        } else {
          peg$currPos = s1;
          s1 = peg$FAILED;
        }
      } else {
        peg$currPos = s1;
        s1 = peg$FAILED;
      }
      if (s1 === peg$FAILED) {
        s1 = null;
      }
      if (s1 !== peg$FAILED) {
        s2 = [];
        if (peg$c61.test(input.charAt(peg$currPos))) {
          s3 = input.charAt(peg$currPos);
          peg$currPos++;
        } else {
          s3 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c62); }
        }
        if (s3 !== peg$FAILED) {
          while (s3 !== peg$FAILED) {
            s2.push(s3);
            if (peg$c61.test(input.charAt(peg$currPos))) {
              s3 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s3 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c62); }
            }
          }
        } else {
          s2 = peg$FAILED;
        }
        if (s2 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c63(s1, s2);
          s0 = s1;
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parsepath() {
      var s0, s1;

      var key    = peg$currPos * 36 + 19,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      s1 = peg$parseidentifierName();
      if (s1 !== peg$FAILED) {
        peg$savedPos = s0;
        s1 = peg$c64(s1);
      }
      s0 = s1;

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parsetype() {
      var s0, s1, s2, s3, s4, s5;

      var key    = peg$currPos * 36 + 20,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      if (input.substr(peg$currPos, 5) === peg$c65) {
        s1 = peg$c65;
        peg$currPos += 5;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c66); }
      }
      if (s1 !== peg$FAILED) {
        s2 = peg$parse_();
        if (s2 !== peg$FAILED) {
          s3 = [];
          if (peg$c67.test(input.charAt(peg$currPos))) {
            s4 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s4 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c68); }
          }
          if (s4 !== peg$FAILED) {
            while (s4 !== peg$FAILED) {
              s3.push(s4);
              if (peg$c67.test(input.charAt(peg$currPos))) {
                s4 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s4 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c68); }
              }
            }
          } else {
            s3 = peg$FAILED;
          }
          if (s3 !== peg$FAILED) {
            s4 = peg$parse_();
            if (s4 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 41) {
                s5 = peg$c69;
                peg$currPos++;
              } else {
                s5 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c70); }
              }
              if (s5 !== peg$FAILED) {
                peg$savedPos = s0;
                s1 = peg$c71(s3);
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parseflags() {
      var s0, s1;

      var key    = peg$currPos * 36 + 21,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = [];
      if (peg$c72.test(input.charAt(peg$currPos))) {
        s1 = input.charAt(peg$currPos);
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c73); }
      }
      if (s1 !== peg$FAILED) {
        while (s1 !== peg$FAILED) {
          s0.push(s1);
          if (peg$c72.test(input.charAt(peg$currPos))) {
            s1 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s1 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c73); }
          }
        }
      } else {
        s0 = peg$FAILED;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parseregex() {
      var s0, s1, s2, s3, s4;

      var key    = peg$currPos * 36 + 22,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      if (input.charCodeAt(peg$currPos) === 47) {
        s1 = peg$c74;
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c75); }
      }
      if (s1 !== peg$FAILED) {
        s2 = [];
        s3 = peg$parsere_character_class();
        if (s3 === peg$FAILED) {
          s3 = peg$parsere_escape();
          if (s3 === peg$FAILED) {
            s3 = peg$parsere_chars();
          }
        }
        if (s3 !== peg$FAILED) {
          while (s3 !== peg$FAILED) {
            s2.push(s3);
            s3 = peg$parsere_character_class();
            if (s3 === peg$FAILED) {
              s3 = peg$parsere_escape();
              if (s3 === peg$FAILED) {
                s3 = peg$parsere_chars();
              }
            }
          }
        } else {
          s2 = peg$FAILED;
        }
        if (s2 !== peg$FAILED) {
          if (input.charCodeAt(peg$currPos) === 47) {
            s3 = peg$c74;
            peg$currPos++;
          } else {
            s3 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c75); }
          }
          if (s3 !== peg$FAILED) {
            s4 = peg$parseflags();
            if (s4 === peg$FAILED) {
              s4 = null;
            }
            if (s4 !== peg$FAILED) {
              peg$savedPos = s0;
              s1 = peg$c76(s2, s4);
              s0 = s1;
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parsere_character_class() {
      var s0, s1, s2, s3;

      var key    = peg$currPos * 36 + 23,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      if (input.charCodeAt(peg$currPos) === 91) {
        s1 = peg$c31;
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c32); }
      }
      if (s1 !== peg$FAILED) {
        s2 = [];
        if (peg$c77.test(input.charAt(peg$currPos))) {
          s3 = input.charAt(peg$currPos);
          peg$currPos++;
        } else {
          s3 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c78); }
        }
        if (s3 === peg$FAILED) {
          s3 = peg$parsere_escape();
        }
        if (s3 !== peg$FAILED) {
          while (s3 !== peg$FAILED) {
            s2.push(s3);
            if (peg$c77.test(input.charAt(peg$currPos))) {
              s3 = input.charAt(peg$currPos);
              peg$currPos++;
            } else {
              s3 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c78); }
            }
            if (s3 === peg$FAILED) {
              s3 = peg$parsere_escape();
            }
          }
        } else {
          s2 = peg$FAILED;
        }
        if (s2 !== peg$FAILED) {
          if (input.charCodeAt(peg$currPos) === 93) {
            s3 = peg$c33;
            peg$currPos++;
          } else {
            s3 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c34); }
          }
          if (s3 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c79(s2);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parsere_escape() {
      var s0, s1, s2;

      var key    = peg$currPos * 36 + 24,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      if (input.charCodeAt(peg$currPos) === 92) {
        s1 = peg$c52;
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c53); }
      }
      if (s1 !== peg$FAILED) {
        if (input.length > peg$currPos) {
          s2 = input.charAt(peg$currPos);
          peg$currPos++;
        } else {
          s2 = peg$FAILED;
          if (peg$silentFails === 0) { peg$fail(peg$c54); }
        }
        if (s2 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c80(s2);
          s0 = s1;
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parsere_chars() {
      var s0, s1, s2;

      var key    = peg$currPos * 36 + 25,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      s1 = [];
      if (peg$c81.test(input.charAt(peg$currPos))) {
        s2 = input.charAt(peg$currPos);
        peg$currPos++;
      } else {
        s2 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c82); }
      }
      if (s2 !== peg$FAILED) {
        while (s2 !== peg$FAILED) {
          s1.push(s2);
          if (peg$c81.test(input.charAt(peg$currPos))) {
            s2 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s2 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c82); }
          }
        }
      } else {
        s1 = peg$FAILED;
      }
      if (s1 !== peg$FAILED) {
        peg$savedPos = s0;
        s1 = peg$c83(s1);
      }
      s0 = s1;

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parsefield() {
      var s0, s1, s2, s3, s4, s5, s6;

      var key    = peg$currPos * 36 + 26,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      if (input.charCodeAt(peg$currPos) === 46) {
        s1 = peg$c43;
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c44); }
      }
      if (s1 !== peg$FAILED) {
        s2 = peg$parseidentifierName();
        if (s2 !== peg$FAILED) {
          s3 = [];
          s4 = peg$currPos;
          if (input.charCodeAt(peg$currPos) === 46) {
            s5 = peg$c43;
            peg$currPos++;
          } else {
            s5 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c44); }
          }
          if (s5 !== peg$FAILED) {
            s6 = peg$parseidentifierName();
            if (s6 !== peg$FAILED) {
              s5 = [s5, s6];
              s4 = s5;
            } else {
              peg$currPos = s4;
              s4 = peg$FAILED;
            }
          } else {
            peg$currPos = s4;
            s4 = peg$FAILED;
          }
          while (s4 !== peg$FAILED) {
            s3.push(s4);
            s4 = peg$currPos;
            if (input.charCodeAt(peg$currPos) === 46) {
              s5 = peg$c43;
              peg$currPos++;
            } else {
              s5 = peg$FAILED;
              if (peg$silentFails === 0) { peg$fail(peg$c44); }
            }
            if (s5 !== peg$FAILED) {
              s6 = peg$parseidentifierName();
              if (s6 !== peg$FAILED) {
                s5 = [s5, s6];
                s4 = s5;
              } else {
                peg$currPos = s4;
                s4 = peg$FAILED;
              }
            } else {
              peg$currPos = s4;
              s4 = peg$FAILED;
            }
          }
          if (s3 !== peg$FAILED) {
            peg$savedPos = s0;
            s1 = peg$c84(s2, s3);
            s0 = s1;
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parsenegation() {
      var s0, s1, s2, s3, s4, s5;

      var key    = peg$currPos * 36 + 27,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      if (input.substr(peg$currPos, 5) === peg$c85) {
        s1 = peg$c85;
        peg$currPos += 5;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c86); }
      }
      if (s1 !== peg$FAILED) {
        s2 = peg$parse_();
        if (s2 !== peg$FAILED) {
          s3 = peg$parseselectors();
          if (s3 !== peg$FAILED) {
            s4 = peg$parse_();
            if (s4 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 41) {
                s5 = peg$c69;
                peg$currPos++;
              } else {
                s5 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c70); }
              }
              if (s5 !== peg$FAILED) {
                peg$savedPos = s0;
                s1 = peg$c87(s3);
 5t               s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parsematches() {
      var s0, s1, s2, s3, s4, s5;

      var key    = peg$currPos * 36 + 28,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      if (input.substr(peg$currPos, 9) === peg$c88) {
        s1 = peg$c88;
        peg$currPos += 9;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c89); }
      }
      if (s1 !== peg$FAILED) {
        s2 = peg$parse_();
        if (s2 !== peg$FAILED) {
          s3 = peg$parseselectors();
          if (s3 !== peg$FAILED) {
            s4 = peg$parse_();
            if (s4 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 41) {
                s5 = peg$c69;
                peg$currPos++;
              } else {
                s5 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c70); }
              }
              if (s5 !== peg$FAILED) {
                peg$savedPos = s0;
                s1 = peg$c90(s3);
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parseis() {
      var s0, s1, s2, s3, s4, s5;

      var key    = peg$currPos * 36 + 29,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      if (input.substr(peg$currPos, 4) === peg$c91) {
        s1 = peg$c91;
        peg$currPos += 4;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c92); }
      }
      if (s1 !== peg$FAILED) {
        s2 = peg$parse_();
        if (s2 !== peg$FAILED) {
          s3 = peg$parseselectors();
          if (s3 !== peg$FAILED) {
            s4 = peg$parse_();
            if (s4 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 41) {
                s5 = peg$c69;
                peg$currPos++;
              } else {
                s5 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c70); }
              }
              if (s5 !== peg$FAILED) {
                peg$savedPos = s0;
                s1 = peg$c90(s3);
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parsehas() {
      var s0, s1, s2, s3, s4, s5;

      var key    = peg$currPos * 36 + 30,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      if (input.substr(peg$currPos, 5) === peg$c93) {
        s1 = peg$c93;
        peg$currPos += 5;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c94); }
      }
      if (s1 !== peg$FAILED) {
        s2 = peg$parse_();
        if (s2 !== peg$FAILED) {
          s3 = peg$parsehasSelectors();
          if (s3 !== peg$FAILED) {
            s4 = peg$parse_();
            if (s4 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 41) {
                s5 = peg$c69;
                peg$currPos++;
              } else {
                s5 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c70); }
              }
              if (s5 !== peg$FAILED) {
                peg$savedPos = s0;
                s1 = peg$c95(s3);
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parsefirstChild() {
      var s0, s1;

      var key    = peg$currPos * 36 + 31,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      if (input.substr(peg$currPos, 12) === peg$c96) {
        s1 = peg$c96;
        peg$currPos += 12;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c97); }
      }
      if (s1 !== peg$FAILED) {
        peg$savedPos = s0;
        s1 = peg$c98();
      }
      s0 = s1;

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parselastChild() {
      var s0, s1;

      var key    = peg$currPos * 36 + 32,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      if (input.substr(peg$currPos, 11) === peg$c99) {
        s1 = peg$c99;
        peg$currPos += 11;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c100); }
      }
      if (s1 !== peg$FAILED) {
        peg$savedPos = s0;
        s1 = peg$c101();
      }
      s0 = s1;

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parsenthChild() {
      var s0, s1, s2, s3, s4, s5;

      var key    = peg$currPos * 36 + 33,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      if (input.substr(peg$currPos, 11) === peg$c102) {
        s1 = peg$c102;
        peg$currPos += 11;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c103); }
      }
      if (s1 !== peg$FAILED) {
        s2 = peg$parse_();
        if (s2 !== peg$FAILED) {
          s3 = [];
          if (peg$c61.test(input.charAt(peg$currPos))) {
            s4 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s4 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c62); }
          }
          if (s4 !== peg$FAILED) {
            while (s4 !== peg$FAILED) {
              s3.push(s4);
              if (peg$c61.test(input.charAt(peg$currPos))) {
                s4 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s4 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c62); }
              }
            }
          } else {
            s3 = peg$FAILED;
          }
          if (s3 !== peg$FAILED) {
            s4 = peg$parse_();
            if (s4 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 41) {
                s5 = peg$c69;
                peg$currPos++;
              } else {
                s5 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c70); }
              }
              if (s5 !== peg$FAILED) {
                peg$savedPos = s0;
                s1 = peg$c104(s3);
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parsenthLastChild() {
      var s0, s1, s2, s3, s4, s5;

      var key    = peg$currPos * 36 + 34,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      if (input.substr(peg$currPos, 16) === peg$c105) {
        s1 = peg$c105;
        peg$currPos += 16;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c106); }
      }
      if (s1 !== peg$FAILED) {
        s2 = peg$parse_();
        if (s2 !== peg$FAILED) {
          s3 = [];
          if (peg$c61.test(input.charAt(peg$currPos))) {
            s4 = input.charAt(peg$currPos);
            peg$currPos++;
          } else {
            s4 = peg$FAILED;
            if (peg$silentFails === 0) { peg$fail(peg$c62); }
          }
          if (s4 !== peg$FAILED) {
            while (s4 !== peg$FAILED) {
              s3.push(s4);
              if (peg$c61.test(input.charAt(peg$currPos))) {
                s4 = input.charAt(peg$currPos);
                peg$currPos++;
              } else {
                s4 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c62); }
              }
            }
          } else {
            s3 = peg$FAILED;
          }
          if (s3 !== peg$FAILED) {
            s4 = peg$parse_();
            if (s4 !== peg$FAILED) {
              if (input.charCodeAt(peg$currPos) === 41) {
                s5 = peg$c69;
                peg$currPos++;
              } else {
                s5 = peg$FAILED;
                if (peg$silentFails === 0) { peg$fail(peg$c70); }
              }
              if (s5 !== peg$FAILED) {
                peg$savedPos = s0;
                s1 = peg$c107(s3);
                s0 = s1;
              } else {
                peg$currPos = s0;
                s0 = peg$FAILED;
              }
            } else {
              peg$currPos = s0;
              s0 = peg$FAILED;
            }
          } else {
            peg$currPos = s0;
            s0 = peg$FAILED;
          }
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }

    function peg$parseclass() {
      var s0, s1, s2;

      var key    = peg$currPos * 36 + 35,
          cached = peg$resultsCache[key];

      if (cached) {
        peg$currPos = cached.nextPos;

        return cached.result;
      }

      s0 = peg$currPos;
      if (input.charCodeAt(peg$currPos) === 58) {
        s1 = peg$c108;
        peg$currPos++;
      } else {
        s1 = peg$FAILED;
        if (peg$silentFails === 0) { peg$fail(peg$c109); }
      }
      if (s1 !== peg$FAILED) {
        s2 = peg$parseidentifierName();
        if (s2 !== peg$FAILED) {
          peg$savedPos = s0;
          s1 = peg$c110(s2);
          s0 = s1;
        } else {
          peg$currPos = s0;
          s0 = peg$FAILED;
        }
      } else {
        peg$currPos = s0;
        s0 = peg$FAILED;
      }

      peg$resultsCache[key] = { nextPos: peg$currPos, result: s0 };

      return s0;
    }


      function nth(n) { return { type: 'nth-child', index: { type: 'literal', value: n } }; }
      function nthLast(n) { return { type: 'nth-last-child', index: { type: 'literal', value: n } }; }
      function strUnescape(s) {
        return s.replace(/\\(.)/g, function(match, ch) {
          switch(ch) {
            case 'b': return '\b';
            case 'f': return '\f';
            case 'n': return '\n';
            case 'r': return '\r';
            case 't': return '\t';
            case 'v': return '\v';
            default: return ch;
          }
        });
      }


    peg$result = peg$startRuleFunction();

    if (peg$result !== peg$FAILED && peg$currPos === input.length) {
      return peg$result;
    } else {
      if (peg$result !== peg$FAILED && peg$currPos < input.length) {
        peg$fail(peg$endExpectation());
      }

      throw peg$buildStructuredError(
        peg$maxFailExpected,
        peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,
        peg$maxFailPos < input.length
          ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)
          : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)
      );
    }
  }

  return {
    SyntaxError: peg$SyntaxError,
    parse:       peg$parse
  };
});
-E&x 9100644 .babelrc v^];jv	)H.:RcC100644 README.md kCJJc0 5)w i100644 esrecurse.js }`6\_&"g100644 gulpfile.babel.js >Dg6:k100644 package.json űӬCMzW\ƻSDMx {
    "presets": ["es2015"]
}
{׾x### Esrecurse [![Build Status](https://travis-ci.org/estools/esrecurse.svg?branch=master)](https://travis-ci.org/estools/esrecurse)

Esrecurse ([esrecurse](https://github.com/estools/esrecurse)) is
[ECMAScript](https://www.ecma-international.org/publications/standards/Ecma-262.htm)
recursive traversing functionality.

### Example Usage

The following code will output all variables declared at the root of a file.

```javascript
esrecurse.visit(ast, {
    XXXStatement: function (node) {
        this.visit(node.left);
        // do something...
        this.visit(node.right);
    }
});
```

We can use `Visitor` instance.

```javascript
var visitor = new esrecurse.Visitor({
    XXXStatement: function (node) {
        this.visit(node.left);
        // do something...
        this.visit(node.right);
    }
});

visitor.visit(ast);
```

We can inherit `Visitor` instance easily.

```javascript
class Derived extends esrecurse.Visitor {
    constructor()
    {
        super(null);
    }

    XXXStatement(node) {
    }
}
```

```javascript
function DerivedVisitor() {
    esrecurse.Visitor.call(/* this for constructor */  this  /* visitor object automatically becomes this. */);
}
util.inherits(DerivedVisitor, esrecurse.Visitor);
DerivedVisitor.prototype.XXXStatement = function (node) {
    this.visit(node.left);
    // do something...
    this.visit(node.right);
};
```

And you can invoke default visiting operation inside custom visit operation.

```javascript
function DerivedVisitor() {
    esrecurse.Visitor.call(/* this for constructor */  this  /* visitor object automatically becomes this. */);
}
util.inherits(DerivedVisitor, esrecurse.Visitor);
DerivedVisitor.prototype.XXXStatement = function (node) {
    // do something...
    this.visitChildren(node);
};
```

The `childVisitorKeys` option does customize the behaviour of `this.visitChildren(node)`.
We can use user-defined node types.

```javascript
// This tree contains a user-defined `TestExpression` node.
var tree = {
    type: 'TestExpression',

    // This 'argument' is the property containing the other **node**.
    argument: {
        type: 'Literal',
        value: 20
    },

    // This 'extended' is the property not containing the other **node**.
    extended: true
};
esrecurse.visit(
    ast,
    {
        Literal: function (node) {
            // do something...
        }
    },
    {
        // Extending the existing traversing rules.
        childVisitorKeys: {
            // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ]
            TestExpression: ['argument']
        }
    }
);
```

We can use the `fallback` option as well.
If the `fallback` option is `"iteration"`, `esrecurse` would visit all enumerable properties of unknown nodes.
Please note circular references cause the stack overflow. AST might have circular references in additional properties for some purpose (e.g. `node.parent`).

```javascript
esrecurse.visit(
    ast,
    {
        Literal: function (node) {
            // do something...
        }
    },
    {
        fallback: 'iteration'
    }
);
```

If the `fallback` option is a function, `esrecurse` calls this function to determine the enumerable properties of unknown nodes.
Please note circular references cause the stack overflow. AST might have circular references in additional properties for some purpose (e.g. `node.parent`).

```javascript
esrecurse.visit(
    ast,
    {
        Literal: function (node) {
            // do something...
        }
    },
    {
        fallback: function (node) {
            return Object.keys(node).filter(function(key) {
                return key !== 'argument'
            });
        }
    }
);
```

### License

Copyright (C) 2014 [Yusuke Suzuki](https://github.com/Constellation)
 (twitter: [@Constellation](https://twitter.com/Constellation)) and other contributors.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

  * Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.

  * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*h!xy/*
  Copyright (C) 2014 Yusuke Suzuki <utatane.tea@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
(function () {
    'use strict';

    var estraverse = require('estraverse');

    function isNode(node) {
        if (node == null) {
            return false;
        }
        return typeof node === 'object' && typeof node.type === 'string';
    }

    function isProperty(nodeType, key) {
        return (nodeType === estraverse.Syntax.ObjectExpression || nodeType === estraverse.Syntax.ObjectPattern) && key === 'properties';
    }

    function Visitor(visitor, options) {
        options = options || {};

        this.__visitor = visitor ||  this;
        this.__childVisitorKeys = options.childVisitorKeys
            ? Object.assign({}, estraverse.VisitorKeys, options.childVisitorKeys)
            : estraverse.VisitorKeys;
        if (options.fallback === 'iteration') {
            this.__fallback = Object.keys;
        } else if (typeof options.fallback === 'function') {
            this.__fallback = options.fallback;
        }
    }

    /* Default method for visiting children.
     * When you need to call default visiting operation inside custom visiting
     * operation, you can use it with `this.visitChildren(node)`.
     */
    Visitor.prototype.visitChildren = function (node) {
        var type, children, i, iz, j, jz, child;

        if (node == null) {
            return;
        }

        type = node.type || estraverse.Syntax.Property;

        children = this.__childVisitorKeys[type];
        if (!children) {
            if (this.__fallback) {
                children = this.__fallback(node);
            } else {
                throw new Error('Unknown node type ' + type + '.');
            }
        }

        for (i = 0, iz = children.length; i < iz; ++i) {
            child = node[children[i]];
            if (child) {
                if (Array.isArray(child)) {
                    for (j = 0, jz = child.length; j < jz; ++j) {
                        if (child[j]) {
                            if (isNode(child[j]) || isProperty(type, children[i])) {
                                this.visit(child[j]);
                            }
                        }
                    }
                } else if (isNode(child)) {
                    this.visit(child);
                }
            }
        }
    };

    /* Dispatching node. */
    Visitor.prototype.visit = function (node) {
        var type;

        if (node == null) {
            return;
        }

        type = node.type || estraverse.Syntax.Property;
        if (this.__visitor[type]) {
            this.__visitor[type].call(this, node);
            return;
        }
        this.visitChildren(node);
    };

    exports.version = require('./package.json').version;
    exports.Visitor = Visitor;
    exports.visit = function (node, visitor, options) {
        var v = new Visitor(visitor, options);
        v.visit(node);
    };
}());
/* vim: set sw=4 ts=4 et tw=80 : */
0~xG// Copyright (C) 2014 Yusuke Suzuki <utatane.tea@gmail.com>
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
//   * Redistributions of source code must retain the above copyright
//     notice, this list of conditions and the following disclaimer.
//   * Redistributions in binary form must reproduce the above copyright
//     notice, this list of conditions and the following disclaimer in the
//     documentation and/or other materials provided with the distribution.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
// ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
// DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
// ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
// THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

import gulp from 'gulp';
import mocha from 'gulp-mocha';
import eslint from 'gulp-eslint';
import minimist from 'minimist';
import git from 'gulp-git';
import bump from 'gulp-bump';
import filter from 'gulp-filter';
import tagVersion from 'gulp-tag-version';
import 'babel-register';

const SOURCE = [
    '*.js'
];

let ESLINT_OPTION = {
    parser: 'babel-eslint',
    parserOptions: {
        'sourceType': 'module'
    },
    rules: {
        'quotes': 0,
        'eqeqeq': 0,
        'no-use-before-define': 0,
        'no-shadow': 0,
        'no-new': 0,
        'no-underscore-dangle': 0,
        'no-multi-spaces': 0,
        'no-native-reassign': 0,
        'no-loop-func': 0
    },
    env: {
        'node': true
    }
};

gulp.task('test', function() {
    let options = minimist(process.argv.slice(2), {
        string: 'test',
        default: {
            test: 'test/*.js'
        }
    }
    );
    return gulp.src(options.test).pipe(mocha({reporter: 'spec'}));
});

gulp.task('lint', () =>
    gulp.src(SOURCE)
    .pipe(eslint(ESLINT_OPTION))
    .pipe(eslint.formatEach('stylish', process.stderr))
    .pipe(eslint.failOnError())
);

let inc = importance =>
    gulp.src(['./package.json'])
        .pipe(bump({type: importance}))
        .pipe(gulp.dest('./'))
        .pipe(git.commit('Bumps package version'))
        .pipe(filter('package.json'))
        .pipe(tagVersion({
            prefix: ''
        }))
;

gulp.task('travis', [ 'lint', 'test' ]);
gulp.task('default', [ 'travis' ]);

gulp.task('patch', [ ], () => inc('patch'));
gulp.task('minor', [ ], () => inc('minor'));
gulp.task('major', [ ], () => inc('major'));
H,zHxr{
  "name": "esrecurse",
  "description": "ECMAScript AST recursive visitor",
  "homepage": "https://github.com/estools/esrecurse",
  "main": "esrecurse.js",
  "version": "4.3.0",
  "engines": {
    "node": ">=4.0"
  },
  "maintainers": [
    {
      "name": "Yusuke Suzuki",
      "email": "utatane.tea@gmail.com",
      "web": "https://github.com/Constellation"
    }
  ],
  "repository": {
    "type": "git",
    "url": "https://github.com/estools/esrecurse.git"
  },
  "dependencies": {
    "estraverse": "^5.2.0"
  },
  "devDependencies": {
    "babel-cli": "^6.24.1",
    "babel-eslint": "^7.2.3",
    "babel-preset-es2015": "^6.24.1",
    "babel-register": "^6.24.1",
    "chai": "^4.0.2",
    "esprima": "^4.0.0",
    "gulp": "^3.9.0",
    "gulp-bump": "^2.7.0",
    "gulp-eslint": "^4.0.0",
    "gulp-filter": "^5.0.0",
    "gulp-git": "^2.4.1",
    "gulp-mocha": "^4.3.1",
    "gulp-tag-version": "^1.2.1",
    "jsdoc": "^3.3.0-alpha10",
    "minimist": "^1.1.0"
  },
  "license": "BSD-2-Clause",
  "scripts": {
    "test": "gulp travis",
    "unit-test": "gulp test",
    "lint": "gulp lint"
  },
  "babel": {
    "presets": [
      "es2015"
    ]
  }
}
R<x 100644 .jshintrc Bh;U;WL/{d100644 LICENSE.BSD >X5Z嫌OJ-b(}100644 README.md 7>ITwin?m#100644 estraverse.js ٯFͥQez/i100644 gulpfile.js r̥BCUjD&100644 package.json c!N8uNM2'ᩣyy6^ex {
  "curly": true,
  "eqeqeq": true,
  "immed": true,
  "eqnull": true,
  "latedef": true,
  "noarg": true,
  "noempty": true,
  "quotmark": "single",
  "undef": true,
  "unused": true,
  "strict": true,
  "trailing": true,

  "node": true
}
GLx0Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

  * Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.
  * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
v*x### Estraverse [![Build Status](https://secure.travis-ci.org/estools/estraverse.svg)](http://travis-ci.org/estools/estraverse)

Estraverse ([estraverse](http://github.com/estools/estraverse)) is
[ECMAScript](http://www.ecma-international.org/publications/standards/Ecma-262.htm)
traversal functions from [esmangle project](http://github.com/estools/esmangle).

### Documentation

You can find usage docs at [wiki page](https://github.com/estools/estraverse/wiki/Usage).

### Example Usage

The following code will output all variables declared at the root of a file.

```javascript
estraverse.traverse(ast, {
    enter: function (node, parent) {
        if (node.type == 'FunctionExpression' || node.type == 'FunctionDeclaration')
            return estraverse.VisitorOption.Skip;
    },
    leave: function (node, parent) {
        if (node.type == 'VariableDeclarator')
          console.log(node.id.name);
    }
});
```

We can use `this.skip`, `this.remove` and `this.break` functions instead of using Skip, Remove and Break.

```javascript
estraverse.traverse(ast, {
    enter: function (node) {
        this.break();
    }
});
```

And estraverse provides `estraverse.replace` function. When returning node from `enter`/`leave`, current node is replaced with it.

```javascript
result = estraverse.replace(tree, {
    enter: function (node) {
        // Replace it with replaced.
        if (node.type === 'Literal')
            return replaced;
    }
});
```

By passing `visitor.keys` mapping, we can extend estraverse traversing functionality.

```javascript
// This tree contains a user-defined `TestExpression` node.
var tree = {
    type: 'TestExpression',

    // This 'argument' is the property containing the other **node**.
    argument: {
        type: 'Literal',
        value: 20
    },

    // This 'extended' is the property not containing the other **node**.
    extended: true
};
estraverse.traverse(tree, {
    enter: function (node) { },

    // Extending the existing traversing rules.
    keys: {
        // TargetNodeName: [ 'keys', 'containing', 'the', 'other', '**node**' ]
        TestExpression: ['argument']
    }
});
```

By passing `visitor.fallback` option, we can control the behavior when encountering unknown nodes.

```javascript
// This tree contains a user-defined `TestExpression` node.
var tree = {
    type: 'TestExpression',

    // This 'argument' is the property containing the other **node**.
    argument: {
        type: 'Literal',
        value: 20
    },

    // This 'extended' is the property not containing the other **node**.
    extended: true
};
estraverse.traverse(tree, {
    enter: function (node) { },

    // Iterating the child **nodes** of unknown nodes.
    fallback: 'iteration'
});
```

When `visitor.fallback` is a function, we can determine which keys to visit on each node.

```javascript
// This tree contains a user-defined `TestExpression` node.
var tree = {
    type: 'TestExpression',

    // This 'argument' is the property containing the other **node**.
    argument: {
        type: 'Literal',
        value: 20
    },

    // This 'extended' is the property not containing the other **node**.
    extended: true
};
estraverse.traverse(tree, {
    enter: function (node) { },

    // Skip the `argument` property of each node
    fallback: function(node) {
        return Object.keys(node).filter(function(key) {
            return key !== 'argument';
        });
    }
});
```

### License

Copyright (C) 2012-2016 [Yusuke Suzuki](http://github.com/Constellation)
 (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

  * Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.

  * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
` txMi/*
  Copyright (C) 2012-2013 Yusuke Suzuki <utatane.tea@gmail.com>
  Copyright (C) 2012 Ariya Hidayat <ariya.hidayat@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/*jslint vars:false, bitwise:true*/
/*jshint indent:4*/
/*global exports:true*/
(function clone(exports) {
    'use strict';

    var Syntax,
        VisitorOption,
        VisitorKeys,
        BREAK,
        SKIP,
        REMOVE;

    function deepCopy(obj) {
        var ret = {}, key, val;
        for (key in obj) {
            if (obj.hasOwnProperty(key)) {
                val = obj[key];
                if (typeof val === 'object' && val !== null) {
                    ret[key] = deepCopy(val);
                } else {
                    ret[key] = val;
                }
            }
        }
        return ret;
    }

    // based on LLVM libc++ upper_bound / lower_bound
    // MIT License

    function upperBound(array, func) {
        var diff, len, i, current;

        len = array.length;
        i = 0;

        while (len) {
            diff = len >>> 1;
            current = i + diff;
            if (func(array[current])) {
                len = diff;
            } else {
                i = current + 1;
                len -= diff + 1;
            }
        }
        return i;
    }

    Syntax = {
        AssignmentExpression: 'AssignmentExpression',
        AssignmentPattern: 'AssignmentPattern',
        ArrayExpression: 'ArrayExpression',
        ArrayPattern: 'ArrayPattern',
        ArrowFunctionExpression: 'ArrowFunctionExpression',
        AwaitExpression: 'AwaitExpression', // CAUTION: It's deferred to ES7.
        BlockStatement: 'BlockStatement',
        BinaryExpression: 'BinaryExpression',
        BreakStatement: 'BreakStatement',
        CallExpression: 'CallExpression',
        CatchClause: 'CatchClause',
        ChainExpression: 'ChainExpression',
        ClassBody: 'ClassBody',
        ClassDeclaration: 'ClassDeclaration',
        ClassExpression: 'ClassExpression',
        ComprehensionBlock: 'ComprehensionBlock',  // CAUTION: It's deferred to ES7.
        ComprehensionExpression: 'ComprehensionExpression',  // CAUTION: It's deferred to ES7.
        ConditionalExpression: 'ConditionalExpression',
        ContinueStatement: 'ContinueStatement',
        DebuggerStatement: 'DebuggerStatement',
        DirectiveStatement: 'DirectiveStatement',
        DoWhileStatement: 'DoWhileStatement',
        EmptyStatement: 'EmptyStatement',
        ExportAllDeclaration: 'ExportAllDeclaration',
        ExportDefaultDeclaration: 'ExportDefaultDeclaration',
        ExportNamedDeclaration: 'ExportNamedDeclaration',
        ExportSpecifier: 'ExportSpecifier',
        ExpressionStatement: 'ExpressionStatement',
        ForStatement: 'ForStatement',
        ForInStatement: 'ForInStatement',
        ForOfStatement: 'ForOfStatement',
        FunctionDeclaration: 'FunctionDeclaration',
        FunctionExpression: 'FunctionExpression',
        GeneratorExpression: 'GeneratorExpression',  // CAUTION: It's deferred to ES7.
        Identifier: 'Identifier',
        IfStatement: 'IfStatement',
        ImportExpression: 'ImportExpression',
        ImportDeclaration: 'ImportDeclaration',
        ImportDefaultSpecifier: 'ImportDefaultSpecifier',
        ImportNamespaceSpecifier: 'ImportNamespaceSpecifier',
        ImportSpecifier: 'ImportSpecifier',
        Literal: 'Literal',
        LabeledStatement: 'LabeledStatement',
        LogicalExpression: 'LogicalExpression',
        MemberExpression: 'MemberExpression',
        MetaProperty: 'MetaProperty',
        MethodDefinition: 'MethodDefinition',
        ModuleSpecifier: 'ModuleSpecifier',
        NewExpression: 'NewExpression',
        ObjectExpression: 'ObjectExpression',
        ObjectPattern: 'ObjectPattern',
        PrivateIdentifier: 'PrivateIdentifier',
        Program: 'Program',
        Property: 'Property',
        PropertyDefinition: 'PropertyDefinition',
        RestElement: 'RestElement',
        ReturnStatement: 'ReturnStatement',
        SequenceExpression: 'SequenceExpression',
        SpreadElement: 'SpreadElement',
        Super: 'Super',
        SwitchStatement: 'SwitchStatement',
        SwitchCase: 'SwitchCase',
        TaggedTemplateExpression: 'TaggedTemplateExpression',
        TemplateElement: 'TemplateElement',
        TemplateLiteral: 'TemplateLiteral',
        ThisExpression: 'ThisExpression',
        ThrowStatement: 'ThrowStatement',
        TryStatement: 'TryStatement',
        UnaryExpression: 'UnaryExpression',
        UpdateExpression: 'UpdateExpression',
        VariableDeclaration: 'VariableDeclaration',
        VariableDeclarator: 'VariableDeclarator',
        WhileStatement: 'WhileStatement',
        WithStatement: 'WithStatement',
        YieldExpression: 'YieldExpression'
    };

    VisitorKeys = {
        AssignmentExpression: ['left', 'right'],
        AssignmentPattern: ['left', 'right'],
        ArrayExpression: ['elements'],
        ArrayPattern: ['elements'],
        ArrowFunctionExpression: ['params', 'body'],
        AwaitExpression: ['argument'], // CAUTION: It's deferred to ES7.
        BlockStatement: ['body'],
        BinaryExpression: ['left', 'right'],
        BreakStatement: ['label'],
        CallExpression: ['callee', 'arguments'],
        CatchClause: ['param', 'body'],
        ChainExpression: ['expression'],
        ClassBody: ['body'],
        ClassDeclaration: ['id', 'superClass', 'body'],
        ClassExpression: ['id', 'superClass', 'body'],
        ComprehensionBlock: ['left', 'right'],  // CAUTION: It's deferred to ES7.
        ComprehensionExpression: ['blocks', 'filter', 'body'],  // CAUTION: It's deferred to ES7.
        ConditionalExpression: ['test', 'consequent', 'alternate'],
        ContinueStatement: ['label'],
        DebuggerStatement: [],
        DirectiveStatement: [],
        DoWhileStatement: ['body', 'test'],
        EmptyStatement: [],
        ExportAllDeclaration: ['source'],
        ExportDefaultDeclaration: ['declaration'],
        ExportNamedDeclaration: ['declaration', 'specifiers', 'source'],
        ExportSpecifier: ['exported', 'local'],
        ExpressionStatement: ['expression'],
        ForStatement: ['init', 'test', 'update', 'body'],
        ForInStatement: ['left', 'right', 'body'],
        ForOfStatement: ['left', 'right', 'body'],
        FunctionDeclaration: ['id', 'params', 'body'],
        FunctionExpression: ['id', 'params', 'body'],
        GeneratorExpression: ['blocks', 'filter', 'body'],  // CAUTION: It's deferred to ES7.
        Identifier: [],
        IfStatement: ['test', 'consequent', 'alternate'],
        ImportExpression: ['source'],
        ImportDeclaration: ['specifiers', 'source'],
        ImportDefaultSpecifier: ['local'],
        ImportNamespaceSpecifier: ['local'],
        ImportSpecifier: ['imported', 'local'],
        Literal: [],
        LabeledStatement: ['label', 'body'],
        LogicalExpression: ['left', 'right'],
        MemberExpression: ['object', 'property'],
        MetaProperty: ['meta', 'property'],
        MethodDefinition: ['key', 'value'],
        ModuleSpecifier: [],
        NewExpression: ['callee', 'arguments'],
        ObjectExpression: ['properties'],
        ObjectPattern: ['properties'],
        PrivateIdentifier: [],
        Program: ['body'],
        Property: ['key', 'value'],
        PropertyDefinition: ['key', 'value'],
        RestElement: [ 'argument' ],
        ReturnStatement: ['argument'],
        SequenceExpression: ['expressions'],
        SpreadElement: ['argument'],
        Super: [],
        SwitchStatement: ['discriminant', 'cases'],
        SwitchCase: ['test', 'consequent'],
        TaggedTemplateExpression: ['tag', 'quasi'],
        TemplateElement: [],
        TemplateLiteral: ['quasis', 'expressions'],
        ThisExpression: [],
        ThrowStatement: ['argument'],
        TryStatement: ['block', 'handler', 'finalizer'],
        UnaryExpression: ['argument'],
        UpdateExpression: ['argument'],
        VariableDeclaration: ['declarations'],
        VariableDeclarator: ['id', 'init'],
        WhileStatement: ['test', 'body'],
        WithStatement: ['object', 'body'],
        YieldExpression: ['argument']
    };

    // unique id
    BREAK = {};
    SKIP = {};
    REMOVE = {};

    VisitorOption = {
        Break: BREAK,
        Skip: SKIP,
        Remove: REMOVE
    };

    function Reference(parent, key) {
        this.parent = parent;
        this.key = key;
    }

    Reference.prototype.replace = function replace(node) {
        this.parent[this.key] = node;
    };

    Reference.prototype.remove = function remove() {
        if (Array.isArray(this.parent)) {
            this.parent.splice(this.key, 1);
            return true;
        } else {
            this.replace(null);
            return false;
        }
    };

    function Element(node, path, wrap, ref) {
        this.node = node;
        this.path = path;
        this.wrap = wrap;
        this.ref = ref;
    }

    function Controller() { }

    // API:
    // return property path array from root to current node
    Controller.prototype.path = function path() {
        var i, iz, j, jz, result, element;

        function addToPath(result, path) {
            if (Array.isArray(path)) {
                for (j = 0, jz = path.length; j < jz; ++j) {
                    result.push(path[j]);
                }
            } else {
                result.push(path);
            }
        }

        // root node
        if (!this.__current.path) {
            return null;
        }

        // first node is sentinel, second node is root element
        result = [];
        for (i = 2, iz = this.__leavelist.length; i < iz; ++i) {
            element = this.__leavelist[i];
            addToPath(result, element.path);
        }
        addToPath(result, this.__current.path);
        return result;
    };

    // API:
    // return type of current node
    Controller.prototype.type = function () {
        var node = this.current();
        return node.type || this.__current.wrap;
    };

    // API:
    // return array of parent elements
    Controller.prototype.parents = function parents() {
        var i, iz, result;

        // first node is sentinel
        result = [];
        for (i = 1, iz = this.__leavelist.length; i < iz; ++i) {
            result.push(this.__leavelist[i].node);
        }

        return result;
    };

    // API:
    // return current node
    Controller.prototype.current = function current() {
        return this.__current.node;
    };

    Controller.prototype.__execute = function __execute(callback, element) {
        var previous, result;

        result = undefined;

        previous  = this.__current;
        this.__current = element;
        this.__state = null;
        if (callback) {
            result = callback.call(this, element.node, this.__leavelist[this.__leavelist.length - 1].node);
        }
        this.__current = previous;

        return result;
    };

    // API:
    // notify control skip / break
    Controller.prototype.notify = function notify(flag) {
        this.__state = flag;
    };

    // API:
    // skip child nodes of current node
    Controller.prototype.skip = function () {
        this.notify(SKIP);
    };

    // API:
    // break traversals
    Controller.prototype['break'] = function () {
        this.notify(BREAK);
    };

    // API:
    // remove node
    Controller.prototype.remove = function () {
        this.notify(REMOVE);
    };

    Controller.prototype.__initialize = function(root, visitor) {
        this.visitor = visitor;
        this.root = root;
        this.__worklist = [];
        this.__leavelist = [];
        this.__current = null;
        this.__state = null;
        this.__fallback = null;
        if (visitor.fallback === 'iteration') {
            this.__fallback = Object.keys;
        } else if (typeof visitor.fallback === 'function') {
            this.__fallback = visitor.fallback;
        }

        this.__keys = VisitorKeys;
        if (visitor.keys) {
            this.__keys = Object.assign(Object.create(this.__keys), visitor.keys);
        }
    };

    function isNode(node) {
        if (node == null) {
            return false;
        }
        return typeof node === 'object' && typeof node.type === 'string';
    }

    function isProperty(nodeType, key) {
        return (nodeType === Syntax.ObjectExpression || nodeType === Syntax.ObjectPattern) && 'properties' === key;
    }
  
    function candidateExistsInLeaveList(leavelist, candidate) {
        for (var i = leavelist.length - 1; i >= 0; --i) {
            if (leavelist[i].node === candidate) {
                return true;
            }
        }
        return false;
    }

    Controller.prototype.traverse = function traverse(root, visitor) {
        var worklist,
            leavelist,
            element,
            node,
            nodeType,
            ret,
            key,
            current,
            current2,
            candidates,
            candidate,
            sentinel;

        this.__initialize(root, visitor);

        sentinel = {};

        // reference
        worklist = this.__worklist;
        leavelist = this.__leavelist;

        // initialize
        worklist.push(new Element(root, null, null, null));
        leavelist.push(new Element(null, null, null, null));

        while (worklist.length) {
            element = worklist.pop();

            if (element === sentinel) {
                element = leavelist.pop();

                ret = this.__execute(visitor.leave, element);

                if (this.__state === BREAK || ret === BREAK) {
                    return;
                }
                continue;
            }

            if (element.node) {

                ret = this.__execute(visitor.enter, element);

                if (this.__state === BREAK || ret === BREAK) {
                    return;
                }

                worklist.push(sentinel);
                leavelist.push(element);

                if (this.__state === SKIP || ret === SKIP) {
                    continue;
                }

                node = element.node;
                nodeType = node.type || element.wrap;
                candidates = this.__keys[nodeType];
                if (!candidates) {
                    if (this.__fallback) {
                        candidates = this.__fallback(node);
                    } else {
                        throw new Error('Unknown node type ' + nodeType + '.');
                    }
                }

                current = candidates.length;
                while ((current -= 1) >= 0) {
                    key = candidates[current];
                    candidate = node[key];
                    if (!candidate) {
                        continue;
                    }

                    if (Array.isArray(candidate)) {
                        current2 = candidate.length;
                        while ((current2 -= 1) >= 0) {
                            if (!candidate[current2]) {
                                continue;
                            }

                            if (candidateExistsInLeaveList(leavelist, candidate[current2])) {
                              continue;
                            }

                            if (isProperty(nodeType, candidates[current])) {
                                element = new Element(candidate[current2], [key, current2], 'Property', null);
                            } else if (isNode(candidate[current2])) {
                                element = new Element(candidate[current2], [key, current2], null, null);
                            } else {
                                continue;
                            }
                            worklist.push(element);
                        }
                    } else if (isNode(candidate)) {
                        if (candidateExistsInLeaveList(leavelist, candidate)) {
                          continue;
                        }

                        worklist.push(new Element(candidate, key, null, null));
                    }
                }
            }
        }
    };

    Controller.prototype.replace = function replace(root, visitor) {
        var worklist,
            leavelist,
            node,
            nodeType,
            target,
            element,
            current,
            current2,
            candidates,
            candidate,
            sentinel,
            outer,
            key;

        function removeElem(element) {
            var i,
                key,
                nextElem,
                parent;

            if (element.ref.remove()) {
                // When the reference is an element of an array.
                key = element.ref.key;
                parent = element.ref.parent;

                // If removed from array, then decrease following items' keys.
                i = worklist.length;
                while (i--) {
                    nextElem = worklist[i];
                    if (nextElem.ref && nextElem.ref.parent === parent) {
                        if  (nextElem.ref.key < key) {
                            break;
                        }
                        --nextElem.ref.key;
                    }
                }
            }
        }

        this.__initialize(root, visitor);

        sentinel = {};

        // reference
        worklist = this.__worklist;
        leavelist = this.__leavelist;

        // initialize
        outer = {
            root: root
        };
        element = new Element(root, null, null, new Reference(outer, 'root'));
        worklist.push(element);
        leavelist.push(element);

        while (worklist.length) {
            element = worklist.pop();

            if (element === sentinel) {
                element = leavelist.pop();

                target = this.__execute(visitor.leave, element);

                // node may be replaced with null,
                // so distinguish between undefined and null in this place
                if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {
                    // replace
                    element.ref.replace(target);
                }

                if (this.__state === REMOVE || target === REMOVE) {
                    removeElem(element);
                }

                if (this.__state === BREAK || target === BREAK) {
                    return outer.root;
                }
                continue;
            }

            target = this.__execute(visitor.enter, element);

            // node may be replaced with null,
            // so distinguish between undefined and null in this place
            if (target !== undefined && target !== BREAK && target !== SKIP && target !== REMOVE) {
                // replace
                element.ref.replace(target);
                element.node = target;
            }

            if (this.__state === REMOVE || target === REMOVE) {
                removeElem(element);
                element.node = null;
            }

            if (this.__state === BREAK || target === BREAK) {
                return outer.root;
            }

            // node may be null
            node = element.node;
            if (!node) {
                continue;
            }

            worklist.push(sentinel);
            leavelist.push(element);

            if (this.__state === SKIP || target === SKIP) {
                continue;
            }

            nodeType = node.type || element.wrap;
            candidates = this.__keys[nodeType];
            if (!candidates) {
                if (this.__fallback) {
                    candidates = this.__fallback(node);
                } else {
                    throw new Error('Unknown node type ' + nodeType + '.');
                }
            }

            current = candidates.length;
            while ((current -= 1) >= 0) {
                key = candidates[current];
                candidate = node[key];
                if (!candidate) {
                    continue;
                }

                if (Array.isArray(candidate)) {
                    current2 = candidate.length;
                    while ((current2 -= 1) >= 0) {
                        if (!candidate[current2]) {
                            continue;
                        }
                        if (isProperty(nodeType, candidates[current])) {
                            element = new Element(candidate[current2], [key, current2], 'Property', new Reference(candidate, current2));
                        } else if (isNode(candidate[current2])) {
                            element = new Element(candidate[current2], [key, current2], null, new Reference(candidate, current2));
                        } else {
                            continue;
                        }
                        worklist.push(element);
                    }
                } else if (isNode(candidate)) {
                    worklist.push(new Element(candidate, key, null, new Reference(node, key)));
                }
            }
        }

        return outer.root;
    };

    function traverse(root, visitor) {
        var controller = new Controller();
        return controller.traverse(root, visitor);
    }

    function replace(root, visitor) {
        var controller = new Controller();
        return controller.replace(root, visitor);
    }

    function extendCommentRange(comment, tokens) {
        var target;

        target = upperBound(tokens, function search(token) {
            return token.range[0] > comment.range[0];
        });

        comment.extendedRange = [comment.range[0], comment.range[1]];

        if (target !== tokens.length) {
            comment.extendedRange[1] = tokens[target].range[0];
        }

        target -= 1;
        if (target >= 0) {
            comment.extendedRange[0] = tokens[target].range[1];
        }

        return comment;
    }

    function attachComments(tree, providedComments, tokens) {
        // At first, we should calculate extended comment ranges.
        var comments = [], comment, len, i, cursor;

        if (!tree.range) {
            throw new Error('attachComments needs range information');
        }

        // tokens array is empty, we attach comments to tree as 'leadingComments'
        if (!tokens.length) {
            if (providedComments.length) {
                for (i = 0, len = providedComments.length; i < len; i += 1) {
                    comment = deepCopy(providedComments[i]);
                    comment.extendedRange = [0, tree.range[0]];
                    comments.push(comment);
                }
                tree.leadingComments = comments;
            }
            return tree;
        }

        for (i = 0, len = providedComments.length; i < len; i += 1) {
            comments.push(extendCommentRange(deepCopy(providedComments[i]), tokens));
        }

        // This is based on John Freeman's implementation.
        cursor = 0;
        traverse(tree, {
            enter: function (node) {
                var comment;

                while (cursor < comments.length) {
                    comment = comments[cursor];
                    if (comment.extendedRange[1] > node.range[0]) {
                        break;
                    }

                    if (comment.extendedRange[1] === node.range[0]) {
                        if (!node.leadingComments) {
                            node.leadingComments = [];
                        }
                        node.leadingComments.push(comment);
                        comments.splice(cursor, 1);
                    } else {
                        cursor += 1;
                    }
                }

                // already out of owned node
                if (cursor === comments.length) {
                    return VisitorOption.Break;
                }

                if (comments[cursor].extendedRange[0] > node.range[1]) {
                    return VisitorOption.Skip;
                }
            }
        });

        cursor = 0;
        traverse(tree, {
            leave: function (node) {
                var comment;

                while (cursor < comments.length) {
                    comment = comments[cursor];
                    if (node.range[1] < comment.extendedRange[0]) {
                        break;
                    }

                    if (node.range[1] === comment.extendedRange[0]) {
                        if (!node.trailingComments) {
                            node.trailingComments = [];
                        }
                        node.trailingComments.push(comment);
                        comments.splice(cursor, 1);
                    } else {
                        cursor += 1;
                    }
                }

                // already out of owned node
                if (cursor === comments.length) {
                    return VisitorOption.Break;
                }

                if (comments[cursor].extendedRange[0] > node.range[1]) {
                    return VisitorOption.Skip;
                }
            }
        });

        return tree;
    }

    exports.Syntax = Syntax;
    exports.traverse = traverse;
    exports.replace = replace;
    exports.attachComments = attachComments;
    exports.VisitorKeys = VisitorKeys;
    exports.VisitorOption = VisitorOption;
    exports.Controller = Controller;
    exports.cloneEnvironment = function () { return clone({}); };

    return exports;
}(exports));
/* vim: set sw=4 ts=4 et tw=80 : */
yx
/*
  Copyright (C) 2014 Yusuke Suzuki <utatane.tea@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

'use strict';

var gulp = require('gulp'),
    git = require('gulp-git'),
    bump = require('gulp-bump'),
    filter = require('gulp-filter'),
    tagVersion = require('gulp-tag-version');

var TEST = [ 'test/*.js' ];
var POWERED = [ 'powered-test/*.js' ];
var SOURCE = [ 'src/**/*.js' ];

/**
 * Bumping version number and tagging the repository with it.
 * Please read http://semver.org/
 *
 * You can use the commands
 *
 *     gulp patch     # makes v0.1.0 -> v0.1.1
 *     gulp feature   # makes v0.1.1 -> v0.2.0
 *     gulp release   # makes v0.2.1 -> v1.0.0
 *
 * To bump the version numbers accordingly after you did a patch,
 * introduced a feature or made a backwards-incompatible release.
 */

function inc(importance) {
    // get all the files to bump version in
    return gulp.src(['./package.json'])
        // bump the version number in those files
        .pipe(bump({type: importance}))
        // save it back to filesystem
        .pipe(gulp.dest('./'))
        // commit the changed version number
        .pipe(git.commit('Bumps package version'))
        // read only one file to get the version number
        .pipe(filter('package.json'))
        // **tag it in the repository**
        .pipe(tagVersion({
            prefix: ''
        }));
}

gulp.task('patch', [ ], function () { return inc('patch'); })
gulp.task('minor', [ ], function () { return inc('minor'); })
gulp.task('major', [ ], function () { return inc('major'); })
HKݱ?x{
  "name": "estraverse",
  "description": "ECMAScript JS AST traversal functions",
  "homepage": "https://github.com/estools/estraverse",
  "main": "estraverse.js",
  "version": "5.3.0",
  "engines": {
    "node": ">=4.0"
  },
  "maintainers": [
    {
      "name": "Yusuke Suzuki",
      "email": "utatane.tea@gmail.com",
      "web": "http://github.com/Constellation"
    }
  ],
  "repository": {
    "type": "git",
    "url": "http://github.com/estools/estraverse.git"
  },
  "devDependencies": {
    "babel-preset-env": "^1.6.1",
    "babel-register": "^6.3.13",
    "chai": "^2.1.1",
    "espree": "^1.11.0",
    "gulp": "^3.8.10",
    "gulp-bump": "^0.2.2",
    "gulp-filter": "^2.0.0",
    "gulp-git": "^1.0.1",
    "gulp-tag-version": "^1.3.0",
    "jshint": "^2.5.6",
    "mocha": "^2.1.0"
  },
  "license": "BSD-2-Clause",
  "scripts": {
    "test": "npm run-script lint && npm run-script unit-test",
    "lint": "jshint estraverse.js",
    "unit-test": "mocha --compilers js:babel-register"
  }
}
!	x m100644 LICENSE.BSD >X5Z嫌OJ-b(}100644 README.md Qu&Ϲ-4nM4~40000 lib Cyԋ97ǩp100644 package.json =Ko8cPei;ּxS### esutils [![Build Status](https://secure.travis-ci.org/estools/esutils.svg)](http://travis-ci.org/estools/esutils)
esutils ([esutils](http://github.com/estools/esutils)) is
utility box for ECMAScript language tools.

### API

### ast

#### ast.isExpression(node)

Returns true if `node` is an Expression as defined in ECMA262 edition 5.1 section
[11](https://es5.github.io/#x11).

#### ast.isStatement(node)

Returns true if `node` is a Statement as defined in ECMA262 edition 5.1 section
[12](https://es5.github.io/#x12).

#### ast.isIterationStatement(node)

Returns true if `node` is an IterationStatement as defined in ECMA262 edition
5.1 section [12.6](https://es5.github.io/#x12.6).

#### ast.isSourceElement(node)

Returns true if `node` is a SourceElement as defined in ECMA262 edition 5.1
section [14](https://es5.github.io/#x14).

#### ast.trailingStatement(node)

Returns `Statement?` if `node` has trailing `Statement`.
```js
if (cond)
    consequent;
```
When taking this `IfStatement`, returns `consequent;` statement.

#### ast.isProblematicIfStatement(node)

Returns true if `node` is a problematic IfStatement. If `node` is a problematic `IfStatement`, `node` cannot be represented as an one on one JavaScript code.
```js
{
    type: 'IfStatement',
    consequent: {
        type: 'WithStatement',
        body: {
            type: 'IfStatement',
            consequent: {type: 'EmptyStatement'}
        }
    },
    alternate: {type: 'EmptyStatement'}
}
```
The above node cannot be represented as a JavaScript code, since the top level `else` alternate belongs to an inner `IfStatement`.


### code

#### code.isDecimalDigit(code)

Return true if provided code is decimal digit.

#### code.isHexDigit(code)

Return true if provided code is hexadecimal digit.

#### code.isOctalDigit(code)

Return true if provided code is octal digit.

#### code.isWhiteSpace(code)

Return true if provided code is white space. White space characters are formally defined in ECMA262.

#### code.isLineTerminator(code)

Return true if provided code is line terminator. Line terminator characters are formally defined in ECMA262.

#### code.isIdentifierStart(code)

Return true if provided code can be the first character of ECMA262 Identifier. They are formally defined in ECMA262.

#### code.isIdentifierPart(code)

Return true if provided code can be the trailing character of ECMA262 Identifier. They are formally defined in ECMA262.

### keyword

#### keyword.isKeywordES5(id, strict)

Returns `true` if provided identifier string is a Keyword or Future Reserved Word
in ECMA262 edition 5.1. They are formally defined in ECMA262 sections
[7.6.1.1](http://es5.github.io/#x7.6.1.1) and [7.6.1.2](http://es5.github.io/#x7.6.1.2),
respectively. If the `strict` flag is truthy, this function additionally checks whether
`id` is a Keyword or Future Reserved Word under strict mode.

#### keyword.isKeywordES6(id, strict)

Returns `true` if provided identifier string is a Keyword or Future Reserved Word
in ECMA262 edition 6. They are formally defined in ECMA262 sections
[11.6.2.1](http://ecma-international.org/ecma-262/6.0/#sec-keywords) and
[11.6.2.2](http://ecma-international.org/ecma-262/6.0/#sec-future-reserved-words),
respectively. If the `strict` flag is truthy, this function additionally checks whether
`id` is a Keyword or Future Reserved Word under strict mode.

#### keyword.isReservedWordES5(id, strict)

Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 5.1.
They are formally defined in ECMA262 section [7.6.1](http://es5.github.io/#x7.6.1).
If the `strict` flag is truthy, this function additionally checks whether `id`
is a Reserved Word under strict mode.

#### keyword.isReservedWordES6(id, strict)

Returns `true` if provided identifier string is a Reserved Word in ECMA262 edition 6.
They are formally defined in ECMA262 section [11.6.2](http://ecma-international.org/ecma-262/6.0/#sec-reserved-words).
If the `strict` flag is truthy, this function additionally checks whether `id`
is a Reserved Word under strict mode.

#### keyword.isRestrictedWord(id)

Returns `true` if provided identifier string is one of `eval` or `arguments`.
They are restricted in strict mode code throughout ECMA262 edition 5.1 and
in ECMA262 edition 6 section [12.1.1](http://ecma-international.org/ecma-262/6.0/#sec-identifiers-static-semantics-early-errors).

#### keyword.isIdentifierNameES5(id)

Return true if provided identifier string is an IdentifierName as specified in
ECMA262 edition 5.1 section [7.6](https://es5.github.io/#x7.6).

#### keyword.isIdentifierNameES6(id)

Return true if provided identifier string is an IdentifierName as specified in
ECMA262 edition 6 section [11.6](http://ecma-international.org/ecma-262/6.0/#sec-names-and-keywords).

#### keyword.isIdentifierES5(id, strict)

Return true if provided identifier string is an Identifier as specified in
ECMA262 edition 5.1 section [7.6](https://es5.github.io/#x7.6). If the `strict`
flag is truthy, this function additionally checks whether `id` is an Identifier
under strict mode.

#### keyword.isIdentifierES6(id, strict)

Return true if provided identifier string is an Identifier as specified in
ECMA262 edition 6 section [12.1](http://ecma-international.org/ecma-262/6.0/#sec-identifiers).
If the `strict` flag is truthy, this function additionally checks whether `id`
is an Identifier under strict mode.

### License

Copyright (C) 2013 [Yusuke Suzuki](http://github.com/Constellation)
 (twitter: [@Constellation](http://twitter.com/Constellation)) and other contributors.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

  * Redistributions of source code must retain the above copyright
    notice, this list of conditions and the following disclaimer.

  * Redistributions in binary form must reproduce the above copyright
    notice, this list of conditions and the following disclaimer in the
    documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
zx p100644 ast.js sm7f\PT100644 code.js #j3c*"L_cT100644 keyword.js ƩgI&pRfSh100644 utils.js ԯh* <xx/*
  Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS'
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

(function () {
    'use strict';

    function isExpression(node) {
        if (node == null) { return false; }
        switch (node.type) {
            case 'ArrayExpression':
            case 'AssignmentExpression':
            case 'BinaryExpression':
            case 'CallExpression':
            case 'ConditionalExpression':
            case 'FunctionExpression':
            case 'Identifier':
            case 'Literal':
            case 'LogicalExpression':
            case 'MemberExpression':
            case 'NewExpression':
            case 'ObjectExpression':
            case 'SequenceExpression':
            case 'ThisExpression':
            case 'UnaryExpression':
            case 'UpdateExpression':
                return true;
        }
        return false;
    }

    function isIterationStatement(node) {
        if (node == null) { return false; }
        switch (node.type) {
            case 'DoWhileStatement':
            case 'ForInStatement':
            case 'ForStatement':
            case 'WhileStatement':
                return true;
        }
        return false;
    }

    function isStatement(node) {
        if (node == null) { return false; }
        switch (node.type) {
            case 'BlockStatement':
            case 'BreakStatement':
            case 'ContinueStatement':
            case 'DebuggerStatement':
            case 'DoWhileStatement':
            case 'EmptyStatement':
            case 'ExpressionStatement':
            case 'ForInStatement':
            case 'ForStatement':
            case 'IfStatement':
            case 'LabeledStatement':
            case 'ReturnStatement':
            case 'SwitchStatement':
            case 'ThrowStatement':
            case 'TryStatement':
            case 'VariableDeclaration':
            case 'WhileStatement':
            case 'WithStatement':
                return true;
        }
        return false;
    }

    function isSourceElement(node) {
      return isStatement(node) || node != null && node.type === 'FunctionDeclaration';
    }

    function trailingStatement(node) {
        switch (node.type) {
        case 'IfStatement':
            if (node.alternate != null) {
                return node.alternate;
            }
            return node.consequent;

        case 'LabeledStatement':
        case 'ForStatement':
        case 'ForInStatement':
        case 'WhileStatement':
        case 'WithStatement':
            return node.body;
        }
        return null;
    }

    function isProblematicIfStatement(node) {
        var current;

        if (node.type !== 'IfStatement') {
            return false;
        }
        if (node.alternate == null) {
            return false;
        }
        current = node.consequent;
        do {
            if (current.type === 'IfStatement') {
                if (current.alternate == null)  {
                    return true;
                }
            }
            current = trailingStatement(current);
        } while (current);

        return false;
    }

    module.exports = {
        isExpression: isExpression,
        isStatement: isStatement,
        isIterationStatement: isIterationStatement,
        isSourceElement: isSourceElement,
        isProblematicIfStatement: isProblematicIfStatement,

        trailingStatement: trailingStatement
    };
}());
/* vim: set sw=4 ts=4 et tw=80 : */
iIxsU/*
  Copyright (C) 2013-2014 Yusuke Suzuki <utatane.tea@gmail.com>
  Copyright (C) 2014 Ivan Nikulin <ifaaan@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

(function () {
    'use strict';

    var ES6Regex, ES5Regex, NON_ASCII_WHITESPACES, IDENTIFIER_START, IDENTIFIER_PART, ch;

    // See `tools/generate-identifier-regex.js`.
    ES5Regex = {
        // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierStart:
        NonAsciiIdentifierStart: /[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\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\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\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\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\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\u2160-\u2188\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-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\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]/,
        // ECMAScript 5.1/Unicode v9.0.0 NonAsciiIdentifierPart:
        NonAsciiIdentifierPart: /[\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\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\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19D9\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u2E2F\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099\u309A\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\uFE76-\uFEFC\uFF10-\uFF19\uFF21-\uFF3A\uFF3F\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]/
    };

    ES6Regex = {
        // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierStart:
        NonAsciiIdentifierStart: /[\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\u0561-\u0587\u05D0-\u05EA\u05F0-\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\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\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\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1877\u1880-\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\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\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\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\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-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD40-\uDD74\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF30-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE33\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF19]|\uD806[\uDCA0-\uDCDF\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1]|\uD87E[\uDC00-\uDE1D]/,
        // ECMAScript 6/Unicode v9.0.0 NonAsciiIdentifierPart:
        NonAsciiIdentifierPart: /[\xAA\xB5\xB7\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0300-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u0483-\u0487\u048A-\u052F\u0531-\u0556\u0559\u0561-\u0587\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u05D0-\u05EA\u05F0-\u05F2\u0610-\u061A\u0620-\u0669\u066E-\u06D3\u06D5-\u06DC\u06DF-\u06E8\u06EA-\u06FC\u06FF\u0710-\u074A\u074D-\u07B1\u07C0-\u07F5\u07FA\u0800-\u082D\u0840-\u085B\u08A0-\u08B4\u08B6-\u08BD\u08D4-\u08E1\u08E3-\u0963\u0966-\u096F\u0971-\u0983\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BC-\u09C4\u09C7\u09C8\u09CB-\u09CE\u09D7\u09DC\u09DD\u09DF-\u09E3\u09E6-\u09F1\u0A01-\u0A03\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A59-\u0A5C\u0A5E\u0A66-\u0A75\u0A81-\u0A83\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABC-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AD0\u0AE0-\u0AE3\u0AE6-\u0AEF\u0AF9\u0B01-\u0B03\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3C-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B5C\u0B5D\u0B5F-\u0B63\u0B66-\u0B6F\u0B71\u0B82\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD0\u0BD7\u0BE6-\u0BEF\u0C00-\u0C03\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C58-\u0C5A\u0C60-\u0C63\u0C66-\u0C6F\u0C80-\u0C83\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBC-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CDE\u0CE0-\u0CE3\u0CE6-\u0CEF\u0CF1\u0CF2\u0D01-\u0D03\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D-\u0D44\u0D46-\u0D48\u0D4A-\u0D4E\u0D54-\u0D57\u0D5F-\u0D63\u0D66-\u0D6F\u0D7A-\u0D7F\u0D82\u0D83\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E01-\u0E3A\u0E40-\u0E4E\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB9\u0EBB-\u0EBD\u0EC0-\u0EC4\u0EC6\u0EC8-\u0ECD\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E-\u0F47\u0F49-\u0F6C\u0F71-\u0F84\u0F86-\u0F97\u0F99-\u0FBC\u0FC6\u1000-\u1049\u1050-\u109D\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\u135D-\u135F\u1369-\u1371\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1714\u1720-\u1734\u1740-\u1753\u1760-\u176C\u176E-\u1770\u1772\u1773\u1780-\u17D3\u17D7\u17DC\u17DD\u17E0-\u17E9\u180B-\u180D\u1810-\u1819\u1820-\u1877\u1880-\u18AA\u18B0-\u18F5\u1900-\u191E\u1920-\u192B\u1930-\u193B\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A1B\u1A20-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AA7\u1AB0-\u1ABD\u1B00-\u1B4B\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1BF3\u1C00-\u1C37\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1CD0-\u1CD2\u1CD4-\u1CF6\u1CF8\u1CF9\u1D00-\u1DF5\u1DFB-\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\u200C\u200D\u203F\u2040\u2054\u2071\u207F\u2090-\u209C\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D7F-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2DE0-\u2DFF\u3005-\u3007\u3021-\u302F\u3031-\u3035\u3038-\u303C\u3041-\u3096\u3099-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FD5\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66F\uA674-\uA67D\uA67F-\uA6F1\uA717-\uA71F\uA722-\uA788\uA78B-\uA7AE\uA7B0-\uA7B7\uA7F7-\uA827\uA840-\uA873\uA880-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F7\uA8FB\uA8FD\uA900-\uA92D\uA930-\uA953\uA960-\uA97C\uA980-\uA9C0\uA9CF-\uA9D9\uA9E0-\uA9FE\uAA00-\uAA36\uAA40-\uAA4D\uAA50-\uAA59\uAA60-\uAA76\uAA7A-\uAAC2\uAADB-\uAADD\uAAE0-\uAAEF\uAAF2-\uAAF6\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABEA\uABEC\uABED\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFE70-\uFE74\u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\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEEA\uDEF0-\uDEF9\uDF00-\uDF03\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3C-\uDF44\uDF47\uDF48\uDF4B-\uDF4D\uDF50\uDF57\uDF5D-\uDF63\uDF66-\uDF6C\uDF70-\uDF74]|\uD805[\uDC00-\uDC4A\uDC50-\uDC59\uDC80-\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDB5\uDDB8-\uDDC0\uDDD8-\uDDDD\uDE00-\uDE40\uDE44\uDE50-\uDE59\uDE80-\uDEB7\uDEC0-\uDEC9\uDF00-\uDF19\uDF1D-\uDF2B\uDF30-\uDF39]|\uD806[\uDCA0-\uDCE9\uDCFF\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC36\uDC38-\uDC40\uDC50-\uDC59\uDC72-\uDC8F\uDC92-\uDCA7\uDCA9-\uDCB6]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDEF0-\uDEF4\uDF00-\uDF36\uDF40-\uDF43\uDF50-\uDF59\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDF00-\uDF44\uDF50-\uDF7E\uDF8F-\uDF9F\uDFE0]|\uD821[\uDC00-\uDFEC]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00\uDC01]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99\uDC9D\uDC9E]|\uD834[\uDD65-\uDD69\uDD6D-\uDD72\uDD7B-\uDD82\uDD85-\uDD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/
    };

    function isDecimalDigit(ch) {
        return 0x30 <= ch && ch <= 0x39;  // 0..9
    }

    function isHexDigit(ch) {
        return 0x30 <= ch && ch <= 0x39 ||  // 0..9
            0x61 <= ch && ch <= 0x66 ||     // a..f
            0x41 <= ch && ch <= 0x46;       // A..F
    }

    function isOctalDigit(ch) {
        return ch >= 0x30 && ch <= 0x37;  // 0..7
    }

    // 7.2 White Space

    NON_ASCII_WHITESPACES = [
        0x1680,
        0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200A,
        0x202F, 0x205F,
        0x3000,
        0xFEFF
    ];

    function isWhiteSpace(ch) {
        return ch === 0x20 || ch === 0x09 || ch === 0x0B || ch === 0x0C || ch === 0xA0 ||
            ch >= 0x1680 && NON_ASCII_WHITESPACES.indexOf(ch) >= 0;
    }

    // 7.3 Line Terminators

    function isLineTerminator(ch) {
        return ch === 0x0A || ch === 0x0D || ch === 0x2028 || ch === 0x2029;
    }

    // 7.6 Identifier Names and Identifiers

    function fromCodePoint(cp) {
        if (cp <= 0xFFFF) { return String.fromCharCode(cp); }
        var cu1 = String.fromCharCode(Math.floor((cp - 0x10000) / 0x400) + 0xD800);
        var cu2 = String.fromCharCode(((cp - 0x10000) % 0x400) + 0xDC00);
        return cu1 + cu2;
    }

    IDENTIFIER_START = new Array(0x80);
    for(ch = 0; ch < 0x80; ++ch) {
        IDENTIFIER_START[ch] =
            ch >= 0x61 && ch <= 0x7A ||  // a..z
            ch >= 0x41 && ch <= 0x5A ||  // A..Z
            ch === 0x24 || ch === 0x5F;  // $ (dollar) and _ (underscore)
    }

    IDENTIFIER_PART = new Array(0x80);
    for(ch = 0; ch < 0x80; ++ch) {
        IDENTIFIER_PART[ch] =
            ch >= 0x61 && ch <= 0x7A ||  // a..z
            ch >= 0x41 && ch <= 0x5A ||  // A..Z
            ch >= 0x30 && ch <= 0x39 ||  // 0..9
            ch === 0x24 || ch === 0x5F;  // $ (dollar) and _ (underscore)
    }

    function isIdentifierStartES5(ch) {
        return ch < 0x80 ? IDENTIFIER_START[ch] : ES5Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch));
    }

    function isIdentifierPartES5(ch) {
        return ch < 0x80 ? IDENTIFIER_PART[ch] : ES5Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch));
    }

    function isIdentifierStartES6(ch) {
        return ch < 0x80 ? IDENTIFIER_START[ch] : ES6Regex.NonAsciiIdentifierStart.test(fromCodePoint(ch));
    }

    function isIdentifierPartES6(ch) {
        return ch < 0x80 ? IDENTIFIER_PART[ch] : ES6Regex.NonAsciiIdentifierPart.test(fromCodePoint(ch));
    }

    module.exports = {
        isDecimalDigit: isDecimalDigit,
        isHexDigit: isHexDigit,
        isOctalDigit: isOctalDigit,
        isWhiteSpace: isWhiteSpace,
        isLineTerminator: isLineTerminator,
        isIdentifierStartES5: isIdentifierStartES5,
        isIdentifierPartES5: isIdentifierPartES5,
        isIdentifierStartES6: isIdentifierStartES6,
        isIdentifierPartES6: isIdentifierPartES6
    };
}());
/* vim: set sw=4 ts=4 et tw=80 : */
/[˰x/*
  Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

(function () {
    'use strict';

    var code = require('./code');

    function isStrictModeReservedWordES6(id) {
        switch (id) {
        case 'implements':
        case 'interface':
        case 'package':
        case 'private':
        case 'protected':
        case 'public':
        case 'static':
        case 'let':
            return true;
        default:
            return false;
        }
    }

    function isKeywordES5(id, strict) {
        // yield should not be treated as keyword under non-strict mode.
        if (!strict && id === 'yield') {
            return false;
        }
        return isKeywordES6(id, strict);
    }

    function isKeywordES6(id, strict) {
        if (strict && isStrictModeReservedWordES6(id)) {
            return true;
        }

        switch (id.length) {
        case 2:
            return (id === 'if') || (id === 'in') || (id === 'do');
        case 3:
            return (id === 'var') || (id === 'for') || (id === 'new') || (id === 'try');
        case 4:
            return (id === 'this') || (id === 'else') || (id === 'case') ||
                (id === 'void') || (id === 'with') || (id === 'enum');
        case 5:
            return (id === 'while') || (id === 'break') || (id === 'catch') ||
                (id === 'throw') || (id === 'const') || (id === 'yield') ||
                (id === 'class') || (id === 'super');
        case 6:
            return (id === 'return') || (id === 'typeof') || (id === 'delete') ||
                (id === 'switch') || (id === 'export') || (id === 'import');
        case 7:
            return (id === 'default') || (id === 'finally') || (id === 'extends');
        case 8:
            return (id === 'function') || (id === 'continue') || (id === 'debugger');
        case 10:
            return (id === 'instanceof');
        default:
            return false;
        }
    }

    function isReservedWordES5(id, strict) {
        return id === 'null' || id === 'true' || id === 'false' || isKeywordES5(id, strict);
    }

    function isReservedWordES6(id, strict) {
        return id === 'null' || id === 'true' || id === 'false' || isKeywordES6(id, strict);
    }

    function isRestrictedWord(id) {
        return id === 'eval' || id === 'arguments';
    }

    function isIdentifierNameES5(id) {
        var i, iz, ch;

        if (id.length === 0) { return false; }

        ch = id.charCodeAt(0);
        if (!code.isIdentifierStartES5(ch)) {
            return false;
        }

        for (i = 1, iz = id.length; i < iz; ++i) {
            ch = id.charCodeAt(i);
            if (!code.isIdentifierPartES5(ch)) {
                return false;
            }
        }
        return true;
    }

    function decodeUtf16(lead, trail) {
        return (lead - 0xD800) * 0x400 + (trail - 0xDC00) + 0x10000;
    }

    function isIdentifierNameES6(id) {
        var i, iz, ch, lowCh, check;

        if (id.length === 0) { return false; }

        check = code.isIdentifierStartES6;
        for (i = 0, iz = id.length; i < iz; ++i) {
            ch = id.charCodeAt(i);
            if (0xD800 <= ch && ch <= 0xDBFF) {
                ++i;
                if (i >= iz) { return false; }
                lowCh = id.charCodeAt(i);
                if (!(0xDC00 <= lowCh && lowCh <= 0xDFFF)) {
                    return false;
                }
                ch = decodeUtf16(ch, lowCh);
            }
            if (!check(ch)) {
                return false;
            }
            check = code.isIdentifierPartES6;
        }
        return true;
    }

    function isIdentifierES5(id, strict) {
        return isIdentifierNameES5(id) && !isReservedWordES5(id, strict);
    }

    function isIdentifierES6(id, strict) {
        return isIdentifierNameES6(id) && !isReservedWordES6(id, strict);
    }

    module.exports = {
        isKeywordES5: isKeywordES5,
        isKeywordES6: isKeywordES6,
        isReservedWordES5: isReservedWordES5,
        isReservedWordES6: isReservedWordES6,
        isRestrictedWord: isRestrictedWord,
        isIdentifierNameES5: isIdentifierNameES5,
        isIdentifierNameES6: isIdentifierNameES6,
        isIdentifierES5: isIdentifierES5,
        isIdentifierES6: isIdentifierES6
    };
}());
/* vim: set sw=4 ts=4 et tw=80 : */
(4_x/*
  Copyright (C) 2013 Yusuke Suzuki <utatane.tea@gmail.com>

  Redistribution and use in source and binary forms, with or without
  modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright
      notice, this list of conditions and the following disclaimer.
    * Redistributions in binary form must reproduce the above copyright
      notice, this list of conditions and the following disclaimer in the
      documentation and/or other materials provided with the distribution.

  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT HOLDER> BE LIABLE FOR ANY
  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/


(function () {
    'use strict';

    exports.ast = require('./ast');
    exports.code = require('./code');
    exports.keyword = require('./keyword');
}());
/* vim: set sw=4 ts=4 et tw=80 : */
Ax{
  "name": "esutils",
  "description": "utility box for ECMAScript language tools",
  "homepage": "https://github.com/estools/esutils",
  "main": "lib/utils.js",
  "version": "2.0.3",
  "engines": {
    "node": ">=0.10.0"
  },
  "directories": {
    "lib": "./lib"
  },
  "files": [
    "LICENSE.BSD",
    "README.md",
    "lib"
  ],
  "maintainers": [
    {
      "name": "Yusuke Suzuki",
      "email": "utatane.tea@gmail.com",
      "web": "http://github.com/Constellation"
    }
  ],
  "repository": {
    "type": "git",
    "url": "http://github.com/estools/esutils.git"
  },
  "devDependencies": {
    "chai": "~1.7.2",
    "coffee-script": "~1.6.3",
    "jshint": "2.6.3",
    "mocha": "~2.2.1",
    "regenerate": "~1.3.1",
    "unicode-9.0.0": "~0.7.0"
  },
  "license": "BSD-2-Clause",
  "scripts": {
    "test": "npm run-script lint && npm run-script unit-test",
    "lint": "jshint lib/*.js",
    "unit-test": "mocha --compilers coffee:coffee-script -R spec",
    "generate-regex": "node tools/generate-identifier-regex.js"
  }
}
*x"100644 LICENSE CVojuM&Qω100644 README.md 1oZYeGӔ40000 es6 1.|kb100644 index.d.ts <,}YӤy100644 index.js 0g"ٺl100644 package.json <fƎ+(9^ԓI.estA100644 react.d.ts yiL#-80zn b100644 react.js 4?8x|[4 av8t|sGGx )	1MIT License

Copyright (c) 2017 Evgeny PoberezkinN
of &J
in tI
to F
copies of ;
furnished to do so, b9	
FITNESS C
AUTHORS OR ;
LIABILITY, WHETHER B:
OUT OF OR IN @
SOFTWARE.
T>*x# fast-deep-equal
The fastest deep equal with ES6 Map, Set and Typed arrays support.

[![Build Status](https://travis-ci.org/epoberezkin/fast-deep-equal.svg?branch=master)](https://travis-ci.org/epoberezkin/fast-deep-equal)
[![npm](https://img.shields.io/npm/v/fast-deep-equal.svg)](https://www.npmjs.com/package/fast-deep-equal)
[![Coverage Status](https://coveralls.io/repos/github/epoberezkin/fast-deep-equal/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/fast-deep-equal?branch=master)


## Install

```bash
npm install fast-deep-equal
```


## Features

- ES5 compatible
- works in node.js (8+) and browsers (IE9+)
- checks equality of Date and RegExp objects by value.

ES6 equal (`require('fast-deep-equal/es6')`) also supports:
- Maps
- Sets
- Typed arrays


## Usage

```javascript
var equal = require('fast-deep-equal');
console.log(equal({foo: 'bar'}, {foo: 'bar'})); // true
```

To support ES6 Maps, Sets and Typed arrays equality use:

```javascript
var equal = require('fast-deep-equal/es6');
console.log(equal(Int16Array([1, 2]), Int16Array([1, 2]))); // true
```

To use with React (avoiding the traversal of React elements' _owner
property that contains circular references and is not needed when
comparing the elements - borrowed from [react-fast-compare](https://github.com/FormidableLabs/react-fast-compare)):

```javascript
var equal = require('fast-deep-equal/react');
var equal = require('fast-deep-equal/es6/react');
```


## Performance benchmark

Node.js v12.6.0:

```
fast-deep-equal x 261,950 ops/sec ±0.52% (89 runs sampled)
fast-deep-equal/es6 x 212,991 ops/sec ±0.34% (92 runs sampled)
fast-equals x 230,957 ops/sec ±0.83% (85 runs sampled)
nano-equal x 187,995 ops/sec ±0.53% (88 runs sampled)
shallow-equal-fuzzy x 138,302 ops/sec ±0.49% (90 runs sampled)
underscore.isEqual x 74,423 ops/sec ±0.38% (89 runs sampled)
lodash.isEqual x 36,637 ops/sec ±0.72% (90 runs sampled)
deep-equal x 2,310 ops/sec ±0.37% (90 runs sampled)
deep-eql x 35,312 ops/sec ±0.67% (91 runs sampled)
ramda.equals x 12,054 ops/sec ±0.40% (91 runs sampled)
util.isDeepStrictEqual x 46,440 ops/sec ±0.43% (90 runs sampled)
assert.deepStrictEqual x 456 ops/sec ±0.71% (88 runs sampled)

The fastest is fast-deep-equal
```

To run benchmark (requires node.js 6+):

```bash
npm run benchmark
```

__Please note__: this benchmark runs against the available test cases. To choose the most performant library for your application, it is recommended to benchmark against your data and to NOT expect this benchmark to reflect the performance difference in your application.


## Enterprise support

fast-deep-equal package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-fast-deep-equal?utm_source=npm-fast-deep-equal&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers.


## Security contact

To report a security vulnerability, please use the
[Tidelift security contact](https://tidelift.com/security).
Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues.


## License

[MIT](https://github.com/epoberezkin/fast-deep-equal/blob/master/LICENSE)
ڗ~-	x k100644 index.d.ts yiL#-80zn b100644 index.js ـ%untC>=cҔ100644 react.d.ts yiL#-80zn b100644 react.js )v%A8fxB declare const equal: (a: any, b: any) => boolean;
export = equal;
xxp'use strict';

// do not edit .js files directly - edit src/index.jst


  var envHasBigInt64Array = typeof BigInt64Array !== 'undefined';


module.exports = function equal(a, b) {
  if (a === b) return true;

  if (a && b && typeof a == 'object' && typeof b == 'object') {
    if (a.constructor !== b.constructor) return false;

    var length, i, keys;
    if (Array.isArray(a)) {
      length = a.length;
      if (length != b.length) return false;
      for (i = length; i-- !== 0;)
        if (!equal(a[i], b[i])) return false;
      return true;
    }


    if ((a instanceof Map) && (b instanceof Map)) {
      if (a.size !== b.size) return false;
      for (i of a.entries())
        if (!b.has(i[0])) return false;
      for (i of a.entries())
        if (!equal(i[1], b.get(i[0]))) return false;
      return true;
    }

    if ((a instanceof Set) && (b instanceof Set)) {
      if (a.size !== b.size) return false;
      for (i of a.entries())
        if (!b.has(i[0])) return false;
      return true;
    }

    if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
      length = a.length;
      if (length != b.length) return false;
      for (i = length; i-- !== 0;)
        if (a[i] !== b[i]) return false;
      return true;
    }


    if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
    if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
    if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();

    keys = Object.keys(a);
    length = keys.length;
    if (length !== Object.keys(b).length) return false;

    for (i = length; i-- !== 0;)
      if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;

    for (i = length; i-- !== 0;) {
      var key = keys[i];

      if (!equal(a[key], b[key])) return false;
    }

    return true;
  }

  // true if both NaN, false otherwise
  return a!==a && b!==b;
};
;x^'use strict';

// do not edit .js files directly - edit src/index.jst


  var envHasBigInt64Array = typeof BigInt64Array !== 'undefined';


module.exports = function equal(a, b) {
  if (a === b) return true;

  if (a && b && typeof a == 'object' && typeof b == 'object') {
    if (a.constructor !== b.constructor) return false;

    var length, i, keys;
    if (Array.isArray(a)) {
      length = a.length;
      if (length != b.length) return false;
      for (i = length; i-- !== 0;)
        if (!equal(a[i], b[i])) return false;
      return true;
    }


    if ((a instanceof Map) && (b instanceof Map)) {
      if (a.size !== b.size) return false;
      for (i of a.entries())
        if (!b.has(i[0])) return false;
      for (i of a.entries())
        if (!equal(i[1], b.get(i[0]))) return false;
      return true;
    }

    if ((a instanceof Set) && (b instanceof Set)) {
      if (a.size !== b.size) return false;
      for (i of a.entries())
        if (!b.has(i[0])) return false;
      return true;
    }

    if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {
      length = a.length;
      if (length != b.length) return false;
      for (i = length; i-- !== 0;)
        if (a[i] !== b[i]) return false;
      return true;
    }


    if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
    if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
    if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();

    keys = Object.keys(a);
    length = keys.length;
    if (length !== Object.keys(b).length) return false;

    for (i = length; i-- !== 0;)
      if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;

    for (i = length; i-- !== 0;) {
      var key = keys[i];

      if (key === '_owner' && a.$$typeof) {
        // React-specific: avoid traversing React elements' _owner.
        //  _owner contains circular references
        // and is not needed when comparing the actual elements (and not their owners)
        continue;
      }

      if (!equal(a[key], b[key])) return false;
    }

    return true;
  }

  // true if both NaN, false otherwise
  return a!==a && b!==b;
};
5xg declare module 'fast-deep-equal' {
    const equal: (a: any, b: any) => boolean;
    export = equal;
}
 Ixf'use strict';

// do not edit .js files directly - edit src/index.jst



module.exports = function equal(a, b) {
  if (a === b) return true;

  if (a && b && typeof a == 'object' && typeof b == 'object') {
    if (a.constructor !== b.constructor) return false;

    var length, i, keys;
    if (Array.isArray(a)) {
      length = a.length;
      if (length != b.length) return false;
      for (i = length; i-- !== 0;)
        if (!equal(a[i], b[i])) return false;
      return true;
    }



    if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
    if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
    if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();

    keys = Object.keys(a);
    length = keys.length;
    if (length !== Object.keys(b).length) return false;

    for (i = length; i-- !== 0;)
      if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;

    for (i = length; i-- !== 0;) {
      var key = keys[i];

      if (!equal(a[key], b[key])) return false;
    }

    return true;
  }

  // true if both NaN, false otherwise
  return a!==a && b!==b;
};
*b]x'{
  "name": "fast-deep-equal",
  "version": "3.1.3",
  "description": "Fast deep equal",
  "main": "index.js",
  "scripts": {
    "eslint": "eslint *.js benchmark/*.js spec/*.js",
    "build": "node build",
    "benchmark": "npm i && npm run build && cd ./benchmark && npm i && node ./",
    "test-spec": "mocha spec/*.spec.js -R spec",
    "test-cov": "nyc npm run test-spec",
    "test-ts": "tsc --target ES5 --noImplicitAny index.d.ts",
    "test": "npm run build && npm run eslint && npm run test-ts && npm run test-cov",
    "prepublish": "npm run build"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/epoberezkin/fast-deep-equal.git"
  },
  "keywords": [
    "fast",
    "equal",
    "deep-equal"
  ],
  "author": "Evgeny Poberezkin",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/epoberezkin/fast-deep-equal/issues"
  },
  "homepage": "https://github.com/epoberezkin/fast-deep-equal#readme",
  "devDependencies": {
    "coveralls": "^3.1.0",
    "dot": "^1.1.2",
    "eslint": "^7.2.0",
    "mocha": "^7.2.0",
    "nyc": "^15.1.0",
    "pre-commit": "^1.2.2",
    "react": "^16.12.0",
    "react-test-renderer": "^16.12.0",
    "sinon": "^9.0.2",
    "typescript": "^3.9.5"
  },
  "nyc": {
    "exclude": [
      "**/spec/**",
      "node_modules"
    ],
    "reporter": [
      "lcov",
      "text-summary"
    ]
  },
  "files": [
    "index.js",
    "index.d.ts",
    "react.js",
    "react.d.ts",
    "es6/"
  ],
  "types": "index.d.ts"
}
HbZxT'use strict';

// do not edit .js files directly - edit src/index.jst



module.exports = function equal(a, b) {
  if (a === b) return true;

  if (a && b && typeof a == 'object' && typeof b == 'object') {
    if (a.constructor !== b.constructor) return false;

    var length, i, keys;
    if (Array.isArray(a)) {
      length = a.length;
      if (length != b.length) return false;
      for (i = length; i-- !== 0;)
        if (!equal(a[i], b[i])) return false;
      return true;
    }



    if (a.constructor === RegExp) return a.source === b.source && a.flags === b.flags;
    if (a.valueOf !== Object.prototype.valueOf) return a.valueOf() === b.valueOf();
    if (a.toString !== Object.prototype.toString) return a.toString() === b.toString();

    keys = Object.keys(a);
    length = keys.length;
    if (length !== Object.keys(b).length) return false;

    for (i = length; i-- !== 0;)
      if (!Object.prototype.hasOwnProperty.call(b, keys[i])) return false;

    for (i = length; i-- !== 0;) {
      var key = keys[i];

      if (key === '_owner' && a.$$typeof) {
        // React-specific: avoid traversing React elements' _owner.
        //  _owner contains circular references
        // and is not needed when comparing the actual elements (and not their owners)
        continue;
      }

      if (!equal(a[key], b[key])) return false;
    }

    return true;
  }

  // true if both NaN, false otherwise
  return a!==a && b!==b;
};
Fxn100644 .eslintrc.yml wyYX e	/Ik40000 .github ?U2:rL100644 .travis.yml լۓWc[qU(100644 LICENSE 2";,/<N1L [100644 README.md I8[x|.#ؒj40000 benchmark >y4DS9t40000 example m&cu!zE䐌@J3>100644 index.d.ts #l@K4AO100644 index.js NjA7!,wIc. 100644 package.json ,|a$QFg}40000 test *X$ȁÈ?w3ͬx'f#x2extends: eslint:recommended
env:
  node: true
  browser: true
rules:
  block-scoped-var: 2
  callback-return: 2
  dot-notation: 2
  indent: 2
  linebreak-style: [2, unix]
  new-cap: 2
  no-console: [2, allow: [warn, error]]
  no-else-return: 2
  no-eq-null: 2
  no-fallthrough: 2
  no-invalid-this: 2
  no-return-assign: 2
  no-shadow: 1
  no-trailing-spaces: 2
  no-use-before-define: [2, nofunc]
  quotes: [2, single, avoid-escape]
  semi: [2, always]
  strict: [2, global]
  valid-jsdoc: [2, requireReturn: false]
  no-control-regex: 0
  no-useless-escape: 2
hx' 100644 FUNDING.yml aکUq8tpPR:x+ tidelift: "npm/fast-json-stable-stringify"
_&xo language: node_js
node_js:
  - "8"
  - "10"
  - "12"
  - "13"
after_script:
  - coveralls < coverage/lcov.info
չxThis software is released under the MIT license:

Copyright (c) 2017 Evgeny Poberezkin
Copyright (c) 2013 James Halliday

PermiJ6 
* "
the Software without 7
use, 5A copies of
/ 
 K included in all
Fp EXPRESS OR
4: OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND 01
COPYRIGHT l<	 WHETHER
4 FROM, OUT OF OR IN
* $ >txB# fast-json-stable-stringify

Deterministic `JSON.stringify()` - a faster version of [@substack](https://github.com/substack)'s json-stable-strigify without [jsonify](https://github.com/substack/jsonify).

You can also pass in a custom comparison function.

[![Build Status](https://travis-ci.org/epoberezkin/fast-json-stable-stringify.svg?branch=master)](https://travis-ci.org/epoberezkin/fast-json-stable-stringify)
[![Coverage Status](https://coveralls.io/repos/github/epoberezkin/fast-json-stable-stringify/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/fast-json-stable-stringify?branch=master)

# example

``` js
var stringify = require('fast-json-stable-stringify');
var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 };
console.log(stringify(obj));
```

output:

```
{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8}
```


# methods

``` js
var stringify = require('fast-json-stable-stringify')
```

## var str = stringify(obj, opts)

Return a deterministic stringified string `str` from the object `obj`.


## options

### cmp

If `opts` is given, you can supply an `opts.cmp` to have a custom comparison
function for object keys. Your function `opts.cmp` is called with these
parameters:

``` js
opts.cmp({ key: akey, value: avalue }, { key: bkey, value: bvalue })
```

For example, to sort on the object key names in reverse order you could write:

``` js
var stringify = require('fast-json-stable-stringify');

var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 };
var s = stringify(obj, function (a, b) {
    return a.key < b.key ? 1 : -1;
});
console.log(s);
```

which results in the output string:

```
{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3}
```

Or if you wanted to sort on the object values in reverse order, you could write:

```
var stringify = require('fast-json-stable-stringify');

var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 };
var s = stringify(obj, function (a, b) {
    return a.value < b.value ? 1 : -1;
});
console.log(s);
```

which outputs:

```
{"d":6,"c":5,"b":[{"z":3,"y":2,"x":1},9],"a":10}
```

### cycles

Pass `true` in `opts.cycles` to stringify circular property as `__cycle__` - the result will not be a valid JSON string in this case.

TypeError will be thrown in case of circular object without this option.


# install

With [npm](https://npmjs.org) do:

```
npm install fast-json-stable-stringify
```


# benchmark

To run benchmark (requires Node.js 6+):
```
node benchmark
```

Results:
```
fast-json-stable-stringify x 17,189 ops/sec ±1.43% (83 runs sampled)
json-stable-stringify x 13,634 ops/sec ±1.39% (85 runs sampled)
fast-stable-stringify x 20,212 ops/sec ±1.20% (84 runs sampled)
faster-stable-stringify x 15,549 ops/sec ±1.12% (84 runs sampled)
The fastest is fast-stable-stringify
```


## Enterprise support

fast-json-stable-stringify package is a part of [Tidelift enterprise subscription](https://tidelift.com/subscription/pkg/npm-fast-json-stable-stringify?utm_source=npm-fast-json-stable-stringify&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) - it provides a centralised commercial support to open-source software users, in addition to the support provided by software maintainers.


## Security contact

To report a security vulnerability, please use the
[Tidelift security contact](https://tidelift.com/security).
Tidelift will coordinate the fix and disclosure. Please do NOT report security vulnerability via GitHub issues.


# license

[MIT](https://github.com/epoberezkin/fast-json-stable-stringify/blob/master/LICENSE)
iéxI 100644 index.js %_ɴG*%100644 test.json [WT j3.x'use strict';

const Benchmark = require('benchmark');
const suite = new Benchmark.Suite;
const testData = require('./test.json');


const stringifyPackages = {
  // 'JSON.stringify': JSON.stringify,
  'fast-json-stable-stringify': require('../index'),
  'json-stable-stringify': true,
  'fast-stable-stringify': true,
  'faster-stable-stringify': true
};


for (const name in stringifyPackages) {
  let func = stringifyPackages[name];
  if (func === true) func = require(name);

  suite.add(name, function() {
    func(testData);
  });
}

suite
  .on('cycle', (event) => console.log(String(event.target)))
  .on('complete', function () {
    console.log('The fastest is ' + this.filter('fastest').map('name'));
  })
  .run({async: true});
x[
  {
    "_id": "59ef4a83ee8364808d761beb",
    "index": 0,
    "guid": "e50ffae9-7128-4148-9ee5-40c3fc523c5d",
    "isActive": false,
    "balance": "$2,341.81",
    "picture": "http://placehold.it/32x32",
    "age": 28,
    "eyeColor": "brown",
    "name": "Carey Savage",
    "gender": "female",
    "company": "VERAQ",
    "email": "careysavage@veraq.com",
    "phone": "+1 (897) 574-3014",
    "address": "458 Willow Street, Henrietta, California, 7234",
    "about": "Nisi reprehenderit nulla ad officia pariatur non dolore laboris irure cupidatat laborum. Minim eu ex Lorem adipisicing exercitation irure minim sunt est enim mollit incididunt voluptate nulla. Ut mollit anim reprehenderit et aliqua ex esse aliquip. Aute sit duis deserunt do incididunt consequat minim qui dolor commodo deserunt et voluptate.\r\n",
    "registered": "2014-05-21T01:56:51 -01:00",
    "latitude": 63.89502,
    "longitude": 62.369807,
    "tags": [
      "nostrud",
      "nisi",
      "consectetur",
      "ullamco",
      "cupidatat",
      "culpa",
      "commodo"
    ],
    "friends": [
      {
        "id": 0,
        "name": "Henry Walls"
      },
      {
        "id": 1,
        "name": "Janice Baker"
      },
      {
        "id": 2,
        "name": "Russell Bush"
      }
    ],
    "greeting": "Hello, Carey Savage! You have 4 unread messages.",
    "favoriteFruit": "banana"
  },
  {
    "_id": "59ef4a83ff5774a691454e89",
    "index": 1,
    "guid": "2bee9efc-4095-4c2e-87ef-d08c8054c89d",
    "isActive": true,
    "balance": "$1,618.15",
    "picture": "http://placehold.it/32x32",
    "age": 35,
    "eyeColor": "blue",
    "name": "Elinor Pearson",
    "gender": "female",
    "company": "FLEXIGEN",
    "email": "elinorpearson@flexigen.com",
    "phone": "+1 (923) 548-3751",
    "address": "600 Bayview Avenue, Draper, Montana, 3088",
    "about": "Mollit commodo ea sit Lorem velit. Irure anim esse Lorem sint quis officia ut. Aliqua nisi dolore in aute deserunt mollit ex ea in mollit.\r\n",
    "registered": "2017-04-22T07:58:41 -01:00",
    "latitude": -87.824919,
    "longitude": 69.538927,
    "tags": [
      "fugiat",
      "labore",
      "proident",
      "quis",
      "eiusmod",
      "qui",
      "est"
    ],
    "friends": [
      {
        "id": 0,
        "name": "Massey Wagner"
      },
      {
        "id": 1,
        "name": "Marcella Ferrell"
      },
      {
        "id": 2,
        "name": "Evans Mckee"
      }
    ],
    "greeting": "Hello, Elinor Pearson! You have 3 unread messages.",
    "favoriteFruit": "strawberry"
  },
  {
    "_id": "59ef4a839ec8a4be4430b36b",
    "index": 2,
    "guid": "ddd6e8c0-95bd-416d-8b46-a768d6363809",
    "isActive": false,
    "balance": "$2,046.95",
    "picture": "http://placehold.it/32x32",
    "age": 40,
    "eyeColor": "green",
    "name": "Irwin Davidson",
    "gender": "male",
    "company": "DANJA",
    "email": "irwindavidson@danja.com",
    "phone": "+1 (883) 537-2041",
    "address": "439 Cook Street, Chapin, Kentucky, 7398",
    "about": "Irure velit non commodo aliqua exercitation ut nostrud minim magna. Dolor ad ad ut irure eu. Non pariatur dolor eiusmod ipsum do et exercitation cillum. Et amet laboris minim eiusmod ullamco magna ea reprehenderit proident sunt.\r\n",
    "registered": "2016-09-01T07:49:08 -01:00",
    "latitude": -49.803812,
    "longitude": 104.93279,
    "tags": [
      "consequat",
      "enim",
      "quis",
      "magna",
      "est",
      "culpa",
      "tempor"
    ],
    "friends": [
      {
        "id": 0,
        "name": "Ruth Hansen"
      },
      {
        "id": 1,
        "name": "Kathrine Austin"
      },
      {
        "id": 2,
        "name": "Rivera Munoz"
      }
    ],
    "greeting": "Hello, Irwin Davidson! You have 2 unread messages.",
    "favoriteFruit": "banana"
  }
]
IL	x j100644 key_cmp.js gR.kh1Qy=^100644 nested.js g/_.WqdzF100644 str.js K<҉WiC!JlgK100644 value_cmp.js 	!g0
8ן&$ d9dx Nvar stringify = require('../');

var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 };
var s = stringify(obj, function (a, b) {
    return a.key < b.key ? 1 : -1;
});
console.log(s);
|47xm var stringify = require('../');
var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 };
console.log(stringify(obj));
C!xa var stringify = require('../');
var obj = { c: 6, b: [4,5], a: 3 };
console.log(stringify(obj));
0x Cvar stringify = require('../');

var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 };
var s = stringify(obj, function (a, b) {
    return a.value < b.value ? 1 : -1;
});
console.log(s);
K7Cxn declare module 'fast-json-stable-stringify' {
  function stringify(obj: any): string;
  export = stringify;
}
&渮x
module.exports = function (obj, opts) {
    if (!opts) opts = {};
    if (typeof opts === 'function') opts = { cmp: opts };
    var space = opts.space || '';
    if (typeof space === 'number') space = Array(space+1).join(' ');
    var cycles = (typeof opts.cycles === 'boolean') ? opts.cycles : false;
    var replacer = opts.replacer || function(key, value) { return value; };

    var cmp = opts.cmp && (function (f) {
        return function (node) {
            return function (a, b) {
                var aobj = { key: a, value: node[a] };
                var bobj = { key: b, value: node[b] };
                return f(aobj, bobj);
            };
        };
    })(opts.cmp);

    var seen = [];
    return (function stringify (parent, key, node, level) {
        var indent = space ? ('\n' + new Array(level + 1).join(space)) : '';
        var colonSeparator = space ? ': ' : ':';

        if (node && node.toJSON && typeof node.toJSON === 'function') {
            node = node.toJSON();
        }

        node = replacer.call(parent, key, node);

        if (node === undefined) {
            return;
        }
        if (typeof node !== 'object' || node === null) {
            return JSON.stringify(node);
        }
        if (isArray(node)) {
            var out = [];
            for (var i = 0; i < node.length; i++) {
                var item = stringify(node, i, node[i], level+1) || JSON.stringify(null);
                out.push(indent + space + item);
            }
            return '[' + out.join(',') + indent + ']';
        }
        else {
            if (seen.indexOf(node) !== -1) {
                if (cycles) return JSON.stringify('__cycle__');
                throw new TypeError('Converting circular structure to JSON');
            }
            else seen.push(node);

            var keys = objectKeys(node).sort(cmp && cmp(node));
            var out = [];
            for (var i = 0; i < keys.length; i++) {
                var key = keys[i];
                var value = stringify(node, key, node[key], level+1);

                if(!value) continue;

                var keyValue = JSON.stringify(key)
                    + colonSeparator
                    + value;
                ;
                out.push(indent + space + keyValue);
            }
            seen.splice(seen.indexOf(node), 1);
            return '{' + out.join(',') + indent + '}';
        }
    })({ '': obj }, '', obj, 0);
};

var isArray = Array.isArray || function (x) {
    return {}.toString.call(x) === '[object Array]';
};

var objectKeys = Object.keys || function (obj) {
    var has = Object.prototype.hasOwnProperty || function () { return true };
    var keys = [];
    for (var key in obj) {
        if (has.call(obj, key)) keys.push(key);
    }
    return keys;
};
gy*vx]'use strict';

datafCzenode) {y~)return;`8== 'number') return isFinite(node) ? '' + node : 'null';`%F) return JSON.stringify(node);

        var i, out;
        if (Array.out = '[';
            for (/if (i) out += ','  += stringify(node[i]) || 'null'#out + ']';
        }null) return 'null';

$5]<F@var seenIndex = seen.push(node) - 1;
        var keys = Object.k**out = '';
        for ({+[key]);

            if (!value) continue;
            if (out) out += ',';
            out += JSON.stringify(key) + ':' + valueLseen.splice(seenIndex, 1);
        return '{' + out + '}';
    })(data);
};
헽aNx{
  "name": "fast-json-stable-stringify",
  "version": "2.1.0",
  "description": "deterministic `JSON.stringify()` - a faster version of substack's json-stable-strigify without jsonify",
  "main": "index.js",
  "types": "index.d.ts",
  "dependencies": {},
  "devDependencies": {
    "benchmark": "^2.1.4",
    "coveralls": "^3.0.0",
    "eslint": "^6.7.0",
    "fast-stable-stringify": "latest",
    "faster-stable-stringify": "latest",
    "json-stable-stringify": "latest",
    "nyc": "^14.1.0",
    "pre-commit": "^1.2.2",
    "tape": "^4.11.0"
  },
  "scripts": {
    "eslint": "eslint index.js test",
    "test-spec": "tape test/*.js",
    "test": "npm run eslint && nyc npm run test-spec"
  },
  "repository": {
    "type": "git",
    "url": "git://github.com/epoberezkin/fast-json-stable-stringify.git"
  },
  "homepage": "https://github.com/epoberezkin/fast-json-stable-stringify",
  "keywords": [
    "json",
    "stringify",
    "deterministic",
    "hash",
    "stable"
  ],
  "author": {
    "name": "James Halliday",
    "email": "mail@substack.net",
    "url": "http://substack.net"
  },
  "license": "MIT",
  "nyc": {
    "exclude": [
      "test",
      "node_modules"
    ],
    "reporter": [
      "lcov",
      "text-summary"
    ]
  }
}
R@rx p100644 cmp.js NkYrZ솒9iU100644 nested.js z5	7\'+100644 str.js ዸW`sv^100644 to-json.js /ϣuJ]hԯD:<x^'use strict';

var test = require('tape');
var stringify = require('../');

test('custom comparison function', function (t) {
    t.plan(1);
    var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 };
    var s = stringify(obj, function (a, b) {
        return a.key < b.key ? 1 : -1;
    });
    t.equal(s, '{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3}');
});
Jd3Gx{'use strict';

var test = require('tape');
var stringify = require('../');

test('nested', function (t) {
    t.plan(1);
    var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 };
    t.equal(stringify(obj), '{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8}');
});

test('cyclic (default)', function (t) {
    t.plan(1);
    var one = { a: 1 };
    var two = { a: 2, one: one };
    one.two = two;
    try {
        stringify(one);
    } catch (ex) {
        t.equal(ex.toString(), 'TypeError: Converting circular structure to JSON');
    }
});

test('cyclic (specifically allowed)', function (t) {
    t.plan(1);
    var one = { a: 1 };
    var two = { a: 2, one: one };
    one.two = two;
    t.equal(stringify(one, {cycles:true}), '{"a":1,"two":{"a":2,"one":"__cycle__"}}');
});

test('repeated non-cyclic value', function(t) {
    t.plan(1);
    var one = { x: 1 };
    var two = { a: one, b: one };
    t.equal(stringify(two), '{"a":{"x":1},"b":{"x":1}}');
});

test('acyclic but with reused obj-property pointers', function (t) {
    t.plan(1);
    var x = { a: 1 };
    var y = { b: x, c: x };
    t.equal(stringify(y), '{"b":{"a":1},"c":{"a":1}}');
});
,]P˶Fxf'use strict';

var test = require('tape');
var stringify = require('../');

test('simple object', function (t) {
    t.plan(1);
    var obj = { c: 6, b: [4,5], a: 3, z: null };
    t.equal(stringify(obj), '{"a":3,"b":[4,5],"c":6,"z":null}');
});

test('object with undefined', function (t) {
    t.plan(1);
    var obj = { a: 3, z: undefined };
    t.equal(stringify(obj), '{"a":3}');
});

test('object with null', function (t) {
    t.plan(1);
    var obj = { a: 3, z: null };
    t.equal(stringify(obj), '{"a":3,"z":null}');
});

test('object with NaN and Infinity', function (t) {
    t.plan(1);
    var obj = { a: 3, b: NaN, c: Infinity };
    t.equal(stringify(obj), '{"a":3,"b":null,"c":null}');
});

test('array with undefined', function (t) {
    t.plan(1);
    var obj = [4, undefined, 6];
    t.equal(stringify(obj), '[4,null,6]');
});

test('object with empty string', function (t) {
    t.plan(1);
    var obj = { a: 3, z: '' };
    t.equal(stringify(obj), '{"a":3,"z":""}');
});

test('array with empty string', function (t) {
    t.plan(1);
    var obj = [4, '', 6];
    t.equal(stringify(obj), '[4,"",6]');
});
Ka%x_'use strict';

var test = require('tape');
var stringify = require('../');

test('toJSON function', function (t) {
    t.plan(1);
    var obj = { one: 1, two: 2, toJSON: function() { return { one: 1 }; } };
    t.equal(stringify(obj), '{"one":1}' );
});

test('toJSON returns string', function (t) {
    t.plan(1);
    var obj = { one: 1, two: 2, toJSON: function() { return 'one'; } };
    t.equal(stringify(obj), '"one"');
});

test('toJSON returns array', function (t) {
    t.plan(1);
    var obj = { one: 1, two: 2, toJSON: function() { return ['one']; } };
    t.equal(stringify(obj), '["one"]');
});
۟	x b100644 LICENSE.md b@kA;zB$uZ100644 README.md xS/ǄF`Z100644 levenshtein.js bQ83į100644 package.json [G6Sz^ҭ@u\@@=XDxL(MIT License)

Copyright (c) 2013 [Ramesh Nair](http://www.hiddentao.com/)

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

^ExV# fast-levenshtein - Levenshtein algorithm in Javascript

[![Build Status](https://secure.travis-ci.org/hiddentao/fast-levenshtein.png)](http://travis-ci.org/hiddentao/fast-levenshtein)
[![NPM module](https://badge.fury.io/js/fast-levenshtein.png)](https://badge.fury.io/js/fast-levenshtein)
[![NPM downloads](https://img.shields.io/npm/dm/fast-levenshtein.svg?maxAge=2592000)](https://www.npmjs.com/package/fast-levenshtein)
[![Follow on Twitter](https://img.shields.io/twitter/url/http/shields.io.svg?style=social&label=Follow&maxAge=2592000)](https://twitter.com/hiddentao)

An efficient Javascript implementation of the [Levenshtein algorithm](http://en.wikipedia.org/wiki/Levenshtein_distance) with locale-specific collator support.

## Features

* Works in node.js and in the browser.
* Better performance than other implementations by not needing to store the whole matrix ([more info](http://www.codeproject.com/Articles/13525/Fast-memory-efficient-Levenshtein-algorithm)).
* Locale-sensitive string comparisions if needed.
* Comprehensive test suite and performance benchmark.
* Small: <1 KB minified and gzipped

## Installation

### node.js

Install using [npm](http://npmjs.org/):

```bash
$ npm install fast-levenshtein
```

### Browser

Using bower:

```bash
$ bower install fast-levenshtein
```

If you are not using any module loader system then the API will then be accessible via the `window.Levenshtein` object.

## Examples

**Default usage**

```javascript
var levenshtein = require('fast-levenshtein');

var distance = levenshtein.get('back', 'book');   // 2
var distance = levenshtein.get('我愛你', '我叫你');   // 1
```

**Locale-sensitive string comparisons**

It supports using [Intl.Collator](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Collator) for locale-sensitive  string comparisons:

```javascript
var levenshtein = require('fast-levenshtein');

levenshtein.get('mikailovitch', 'Mikhaïlovitch', { useCollator: true});
// 1
```

## Building and Testing

To build the code and run the tests:

```bash
$ npm install -g grunt-cli
$ npm install
$ npm run build
```

## Performance

_Thanks to [Titus Wormer](https://github.com/wooorm) for [encouraging me](https://github.com/hiddentao/fast-levenshtein/issues/1) to do this._

Benchmarked against other node.js levenshtein distance modules (on Macbook Air 2012, Core i7, 8GB RAM):

```bash
Running suite Implementation comparison [benchmark/speed.js]...
>> levenshtein-edit-distance x 234 ops/sec ±3.02% (73 runs sampled)
>> levenshtein-component x 422 ops/sec ±4.38% (83 runs sampled)
>> levenshtein-deltas x 283 ops/sec ±3.83% (78 runs sampled)
>> natural x 255 ops/sec ±0.76% (88 runs sampled)
>> levenshtein x 180 ops/sec ±3.55% (86 runs sampled)
>> fast-levenshtein x 1,792 ops/sec ±2.72% (95 runs sampled)
Benchmark done.
Fastest test is fast-levenshtein at 4.2x faster than levenshtein-component
```

You can run this benchmark yourself by doing:

```bash
$ npm install
$ npm run build
$ npm run benchmark
```

## Contributing

If you wish to submit a pull request please update and/or create new tests for any changes you make and ensure the grunt build passes.

See [CONTRIBUTING.md](https://github.com/hiddentao/fast-levenshtein/blob/master/CONTRIBUTING.md) for details.

## License

MIT - see [LICENSE.md](https://github.com/hiddentao/fast-levenshtein/blob/master/LICENSE.md)
5ʬUx\(function() {
  'use strict';
  
  var collator;
  try {
    collator = (typeof Intl !== "undefined" && typeof Intl.Collator !== "undefined") ? Intl.Collator("generic", { sensitivity: "base" }) : null;
  } catch (err){
    console.log("Collator could not be initialized and wouldn't be used");
  }
  // arrays to re-use
  var prevRow = [],
    str2Char = [];
  
  /**
   * Based on the algorithm at http://en.wikipedia.org/wiki/Levenshtein_distance.
   */
  var Levenshtein = {
    /**
     * Calculate levenshtein distance of the two strings.
     *
     * @param str1 String the first string.
     * @param str2 String the second string.
     * @param [options] Additional options.
     * @param [options.useCollator] Use `Intl.Collator` for locale-sensitive string comparison.
     * @return Integer the levenshtein distance (0 and above).
     */
    get: function(str1, str2, options) {
      var useCollator = (options && collator && options.useCollator);
      
      var str1Len = str1.length,
        str2Len = str2.length;
      
      // base cases
      if (str1Len === 0) return str2Len;
      if (str2Len === 0) return str1Len;

      // two rows
      var curCol, nextCol, i, j, tmp;

      // initialise previous row
      for (i=0; i<str2Len; ++i) {
        prevRow[i] = i;
        str2Char[i] = str2.charCodeAt(i);
      }
      prevRow[str2Len] = str2Len;

      var strCmp;
      if (useCollator) {
        // calculate current row distance from previous row using collator
        for (i = 0; i < str1Len; ++i) {
          nextCol = i + 1;

          for (j = 0; j < str2Len; ++j) {
            curCol = nextCol;

            // substution
            strCmp = 0 === collator.compare(str1.charAt(i), String.fromCharCode(str2Char[j]));

            nextCol = prevRow[j] + (strCmp ? 0 : 1);

            // insertion
            tmp = curCol + 1;
            if (nextCol > tmp) {
              nextCol = tmp;
            }
            // deletion
            tmp = prevRow[j + 1] + 1;
            if (nextCol > tmp) {
              nextCol = tmp;
            }

            // copy current col value into previous (in preparation for next iteration)
            prevRow[j] = curCol;
          }

          // copy last col value into previous (in preparation for next iteration)
          prevRow[j] = nextCol;
        }
      }
      else {
        // calculate current row distance from previous row without collator
        for (i = 0; i < str1Len; ++i) {
          nextCol = i + 1;

          for (j = 0; j < str2Len; ++j) {
            curCol = nextCol;

            // substution
            strCmp = str1.charCodeAt(i) === str2Char[j];

            nextCol = prevRow[j] + (strCmp ? 0 : 1);

            // insertion
            tmp = curCol + 1;
            if (nextCol > tmp) {
              nextCol = tmp;
            }
            // deletion
            tmp = prevRow[j + 1] + 1;
            if (nextCol > tmp) {
              nextCol = tmp;
            }

            // copy current col value into previous (in preparation for next iteration)
            prevRow[j] = curCol;
          }

          // copy last col value into previous (in preparation for next iteration)
          prevRow[j] = nextCol;
        }
      }
      return nextCol;
    }

  };

  // amd
  if (typeof define !== "undefined" && define !== null && define.amd) {
    define(function() {
      return Levenshtein;
    });
  }
  // commonjs
  else if (typeof module !== "undefined" && module !== null && typeof exports !== "undefined" && module.exports === exports) {
    module.exports = Levenshtein;
  }
  // web worker
  else if (typeof self !== "undefined" && typeof self.postMessage === 'function' && typeof self.importScripts === 'function') {
    self.Levenshtein = Levenshtein;
  }
  // browser main thread
  else if (typeof window !== "undefined" && window !== null) {
    window.Levenshtein = Levenshtein;
  }
}());

lu>x{
  "name": "fast-levenshtein",
  "version": "2.0.6",
  "description": "Efficient implementation of Levenshtein algorithm  with locale-specific collator support.",
  "main": "levenshtein.js",
  "files": [
    "levenshtein.js"
  ],
  "scripts": {
    "build": "grunt build",
    "prepublish": "npm run build",
    "benchmark": "grunt benchmark",
    "test": "mocha"
  },
  "devDependencies": {
    "chai": "~1.5.0",
    "grunt": "~0.4.1",
    "grunt-benchmark": "~0.2.0",
    "grunt-cli": "^1.2.0",
    "grunt-contrib-jshint": "~0.4.3",
    "grunt-contrib-uglify": "~0.2.0",
    "grunt-mocha-test": "~0.2.2",
    "grunt-npm-install": "~0.1.0",
    "load-grunt-tasks": "~0.6.0",
    "lodash": "^4.0.1",
    "mocha": "~1.9.0"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/hiddentao/fast-levenshtein.git"
  },
  "keywords": [
    "levenshtein",
    "distance",
    "string"
  ],
  "author": "Ramesh Nair <ram@hiddentao.com> (http://www.hiddentao.com/)",
  "license": "MIT"
}
X}#x E100644 index.d.ts  ɷ~p~y$.fGMl100644 index.js ߫[pj+L!J100644 license 2<tD?U100644 package.json /_<#UZ^Z100644 readme.md 3^ߪ9c{?I
Wxq/**
 * Create a new `EConstructor`, with the formatted `format` as a first argument.
 *
 * @template {Error} Fault
 * @template {new (reason: string) => Fault} Class
 * @param {Class} Constructor
 */
export function create<
  Fault extends Error,
  Class extends new (reason: string) => Fault
>(
  Constructor: Class
): {
  (format?: string | null | undefined, ...values: unknown[]): Fault
  /** @type {string} */
  displayName: string
}
export const fault: {
  (format?: string | null | undefined, ...values: unknown[]): Error
  /** @type {string} */
  displayName: string
} & {
  eval: {
    (format?: string | null | undefined, ...values: unknown[]): Error
    /** @type {string} */
    displayName: string
  }
  range: {
    (format?: string | null | undefined, ...values: unknown[]): Error
    /** @type {string} */
    displayName: string
  }
  reference: {
    (format?: string | null | undefined, ...values: unknown[]): Error
    /** @type {string} */
    displayName: string
  }
  syntax: {
    (format?: string | null | undefined, ...values: unknown[]): Error
    /** @type {string} */
    displayName: string
  }
  type: {
    (format?: string | null | undefined, ...values: unknown[]): Error
    /** @type {string} */
    displayName: string
  }
  uri: {
    (format?: string | null | undefined, ...values: unknown[]): Error
    /** @type {string} */
    displayName: string
  }
}
ӴܲCx2// @ts-expect-error
import formatter from 'format'

export const fault = Object.assign(create(Error), {
  eval: create(EvalError),
  range: create(RangeError),
  reference: create(ReferenceError),
  syntax: create(SyntaxError),
  type: create(TypeError),
  uri: create(URIError)
})

/**
 * Create a new `EConstructor`, with the formatted `format` as a first argument.
 *
 * @template {Error} Fault
 * @template {new (reason: string) => Fault} Class
 * @param {Class} Constructor
 */
export function create(Constructor) {
  /** @type {string} */
  // @ts-expect-error
  FormattedError.displayName = Constructor.displayName || Constructor.name

  return FormattedError

  /**
   * Create an error with a printf-like formatted message.
   *
   * @param {string|null} [format]
   *   Template string.
   * @param {...unknown} values
   *   Values to render in `format`.
   * @returns {Fault}
   */
  function FormattedError(format, ...values) {
    /** @type {string} */
    const reason = format ? formatter(format, ...values) : format
    return new Constructor(reason)
  }
}
)fx9# fault

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]

Functional errors with formatted output.

## Contents

*   [What is this?](#what-is-this)
*   [When should I use this?](#when-should-i-use-this)
*   [Install](#install)
*   [Use](#use)
*   [API](#api)
    *   [`fault(format?[, values…])`](#faultformat-values)
*   [Types](#types)
*   [Compatibility](#compatibility)
*   [Security](#security)
*   [Related](#related)
*   [Contribute](#contribute)
*   [License](#license)

## What is this?

This package adds printf-like interpolation to errors.

## When should I use this?

This package useful when you frequently display parameters in error messages
and manual string concatenation is becoming verbose.

## Install

This package is [ESM only][esm].
In Node.js (version 12.20+, 14.14+, or 16.0+), install with [npm][]:

```sh
npm install fault
```

In Deno with [Skypack][]:

```js
import {fault} from 'https://cdn.skypack.dev/fault@2?dts'
```

In browsers with [Skypack][]:

```html
<script type="module">
  import {fault} from 'https://cdn.skypack.dev/fault@2?min'
</script>
```

## Use

```js
import {fault} from 'fault'

throw fault('Hello %s!', 'Eric')
```

Yields:

```text
Error: Hello Eric!
    at FormattedError (~/node_modules/fault/index.js:30:12)
    at Object.<anonymous> (~/example.js:3:7)
    …
```

Or, format a float in a type error:

```js
import {fault} from 'fault'

throw fault.type('Who doesn’t like %f? 🍰', Math.PI)
```

Yields:

```text
TypeError: Who doesn’t like 3.141593? 🍰
    at Function.FormattedError [as type] (~/node_modules/fault/index.js:30:12)
    at Object.<anonymous> (~/example.js:3:7)
```

## API

This package exports the following identifiers: `fault` and `create`.
There is no default export.

### `fault(format?[, values…])`

Create an error with a printf-like formatted message.

###### Parameters

*   `format` (`string`, optional)
    — template string
*   `values` (`*`, optional)
    — values to render in `format`

###### Returns

An [`Error`][error] instance.

###### Formatters

The following formatters are supported in `format`:

*   `%s` — string
*   `%b` — binary
*   `%c` — character
*   `%d` — decimal
*   `%f` — floating point
*   `%o` — octal
*   `%x` — lowercase hexadecimal
*   `%X` — uppercase hexadecimal
*   `%` followed by any other character, prints that character

See [`samsonjs/format`][fmt] for argument parsing.

###### Other errors

*   `fault.eval(format?[, values…])` — [EvalError][]
*   `fault.range(format?[, values…])` — [RangeError][]
*   `fault.reference(format?[, values…])` — [ReferenceError][]
*   `fault.syntax(format?[, values…])` — [SyntaxError][]
*   `fault.type(format?[, values…])` — [TypeError][]
*   `fault.uri(format?[, values…])` — [URIError][]

#### `create(Constructor)`

Factory to create instances of `ErrorConstructor` with support for formatting.
Used internally to wrap the global error constructors and exposed for custom
errors.
Returns a function just like `fault`.

## Types

This package is fully typed with [TypeScript][].
There are no extra exported types.

## Compatibility

This package is at least compatible with all maintained versions of Node.js.
As of now, that is Node.js 12.20+, 14.14+, and 16.0+.
It also works in Deno and modern browsers.

## Security

This package is safe.

## Related

*   [`wooorm/bail`](https://github.com/wooorm/bail)
    — throw if given an error

## Contribute

Yes please!
See [How to Contribute to Open Source][contribute].

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/wooorm/fault/workflows/main/badge.svg

[build]: https://github.com/wooorm/fault/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/fault.svg

[coverage]: https://codecov.io/github/wooorm/fault

[downloads-badge]: https://img.shields.io/npm/dm/fault.svg

[downloads]: https://www.npmjs.com/package/fault

[size-badge]: https://img.shields.io/bundlephobia/minzip/fault.svg

[size]: https://bundlephobia.com/result?p=fault

[npm]: https://docs.npmjs.com/cli/install

[skypack]: https://www.skypack.dev

[license]: license

[author]: https://wooorm.com

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[typescript]: https://www.typescriptlang.org

[contribute]: https://opensource.guide/how-to-contribute/

[fmt]: https://github.com/samsonjs/format

[error]: https://developer.mozilla.org/JavaScript/Reference/Global_Objects/Error

[evalerror]: https://developer.mozilla.org/JavaScript/Reference/Global_Objects/EvalError

[rangeerror]: https://developer.mozilla.org/JavaScript/Reference/Global_Objects/RangeError

[referenceerror]: https://developer.mozilla.org/JavaScript/Reference/Global_Objects/ReferenceError

[syntaxerror]: https://developer.mozilla.org/JavaScript/Reference/Global_Objects/SyntaxError

[typeerror]: https://developer.mozilla.org/JavaScript/Reference/Global_Objects/TypeError

[urierror]: https://developer.mozilla.org/JavaScript/Reference/Global_Objects/URIError.
=7	x k100644 LICENSE 9Eͧ$v+?i4w100644 README.md O렇&Vr?yV~100644 cache.js kv~ON>mf,Q0100644 package.json c5}V?ɥ@9#xa <The MIT License (MIT)

Copyright (c) Roy Riojas & Jared Wrayn all
q THE
SOFTWARE.

Yxw# file-entry-cache
> Super simple cache for file metadata, useful for process that work on a given series of files
> and that only need to repeat the job on the changed ones since the previous run of the process — Edit

[![NPM Version](https://img.shields.io/npm/v/file-entry-cache.svg?style=flat)](https://npmjs.org/package/file-entry-cache)
[![tests](https://github.com/jaredwray/file-entry-cache/actions/workflows/tests.yaml/badge.svg?branch=master)](https://github.com/jaredwray/file-entry-cache/actions/workflows/tests.yaml)
[![codecov](https://codecov.io/github/jaredwray/file-entry-cache/graph/badge.svg?token=37tZMQE0Sy)](https://codecov.io/github/jaredwray/file-entry-cache)
[![npm](https://img.shields.io/npm/dm/file-entry-cache)](https://npmjs.com/package/file-entry-cache)


## install

```bash
npm i --save file-entry-cache
```

## Usage

The module exposes two functions `create` and `createFromFile`.

## `create(cacheName, [directory, useCheckSum])`
- **cacheName**: the name of the cache to be created
- **directory**: Optional the directory to load the cache from
- **usecheckSum**: Whether to use md5 checksum to verify if file changed. If false the default will be to use the mtime and size of the file.

## `createFromFile(pathToCache, [useCheckSum])`
- **pathToCache**: the path to the cache file (this combines the cache name and directory)
- **useCheckSum**: Whether to use md5 checksum to verify if file changed. If false the default will be to use the mtime and size of the file.

```js
// loads the cache, if one does not exists for the given
// Id a new one will be prepared to be created
var fileEntryCache = require('file-entry-cache');

var cache = fileEntryCache.create('testCache');

var files = expand('../fixtures/*.txt');

// the first time this method is called, will return all the files
var oFiles = cache.getUpdatedFiles(files);

// this will persist this to disk checking each file stats and
// updating the meta attributes `size` and `mtime`.
// custom fields could also be added to the meta object and will be persisted
// in order to retrieve them later
cache.reconcile();

// use this if you want the non visited file entries to be kept in the cache
// for more than one execution
//
// cache.reconcile( true /* noPrune */)

// on a second run
var cache2 = fileEntryCache.create('testCache');

// will return now only the files that were modified or none
// if no files were modified previous to the execution of this function
var oFiles = cache.getUpdatedFiles(files);

// if you want to prevent a file from being considered non modified
// something useful if a file failed some sort of validation
// you can then remove the entry from the cache doing
cache.removeEntry('path/to/file'); // path to file should be the same path of the file received on `getUpdatedFiles`
// that will effectively make the file to appear again as modified until the validation is passed. In that
// case you should not remove it from the cache

// if you need all the files, so you can determine what to do with the changed ones
// you can call
var oFiles = cache.normalizeEntries(files);

// oFiles will be an array of objects like the following
entry = {
  key: 'some/name/file', the path to the file
  changed: true, // if the file was changed since previous run
  meta: {
    size: 3242, // the size of the file
    mtime: 231231231, // the modification time of the file
    data: {} // some extra field stored for this file (useful to save the result of a transformation on the file
  }
}

```

## Motivation for this module

I needed a super simple and dumb **in-memory cache** with optional disk persistence (write-back cache) in order to make
a script that will beautify files with `esformatter` to execute only on the files that were changed since the last run.

In doing so the process of beautifying files was reduced from several seconds to a small fraction of a second.

This module uses [flat-cache](https://www.npmjs.com/package/flat-cache) a super simple `key/value` cache storage with
optional file persistance.

The main idea is to read the files when the task begins, apply the transforms required, and if the process succeed,
then store the new state of the files. The next time this module request for `getChangedFiles` will return only
the files that were modified. Making the process to end faster.

This module could also be used by processes that modify the files applying a transform, in that case the result of the
transform could be stored in the `meta` field, of the entries. Anything added to the meta field will be persisted.
Those processes won't need to call `getChangedFiles` they will instead call `normalizeEntries` that will return the
entries with a `changed` field that can be used to determine if the file was changed or not. If it was not changed
the transformed stored data could be used instead of actually applying the transformation, saving time in case of only
a few files changed.

In the worst case scenario all the files will be processed. In the best case scenario only a few of them will be processed.

## Important notes
- The values set on the meta attribute of the entries should be `stringify-able` ones if possible, flat-cache uses `circular-json` to try to persist circular structures, but this should be considered experimental. The best results are always obtained with non circular values
- All the changes to the cache state are done to memory first and only persisted after reconcile.

## License

MIT


Ĉ;x+var path = require('path');
var crypto = require('crypto');

module.exports = {
  createFromFile: function (filePath, useChecksum) {
    var fname = path.basename(filePath);
    var dir = path.dirname(filePath);
    return this.create(fname, dir, useChecksum);
  },

  create: function (cacheId, _path, useChecksum) {
    var fs = require('fs');
    var flatCache = require('flat-cache');
    var cache = flatCache.load(cacheId, _path);
    var normalizedEntries = {};

    var removeNotFoundFiles = function removeNotFoundFiles() {
      const cachedEntries = cache.keys();
      // remove not found entries
      cachedEntries.forEach(function remover(fPath) {
        try {
          fs.statSync(fPath);
        } catch (err) {
          if (err.code === 'ENOENT') {
            cache.removeKey(fPath);
          }
        }
      });
    };

    removeNotFoundFiles();

    return {
      /**
       * the flat cache storage used to persist the metadata of the `files
       * @type {Object}
       */
      cache: cache,

      /**
       * Given a buffer, calculate md5 hash of its content.
       * @method getHash
       * @param  {Buffer} buffer   buffer to calculate hash on
       * @return {String}          content hash digest
       */
      getHash: function (buffer) {
        return crypto.createHash('md5').update(buffer).digest('hex');
      },

      /**
       * Return whether or not a file has changed since last time reconcile was called.
       * @method hasFileChanged
       * @param  {String}  file  the filepath to check
       * @return {Boolean}       wheter or not the file has changed
       */
      hasFileChanged: function (file) {
        return this.getFileDescriptor(file).changed;
      },

      /**
       * given an array of file paths it return and object with three arrays:
       *  - changedFiles: Files that changed since previous run
       *  - notChangedFiles: Files that haven't change
       *  - notFoundFiles: Files that were not found, probably deleted
       *
       * @param  {Array} files the files to analyze and compare to the previous seen files
       * @return {[type]}       [description]
       */
      analyzeFiles: function (files) {
        var me = this;
        files = files || [];

        var res = {
          changedFiles: [],
          notFoundFiles: [],
          notChangedFiles: [],
        };

        me.normalizeEntries(files).forEach(function (entry) {
          if (entry.changed) {
            res.changedFiles.push(entry.key);
            return;
          }
          if (entry.notFound) {
            res.notFoundFiles.push(entry.key);
            return;
          }
          res.notChangedFiles.push(entry.key);
        });
        return res;
      },

      getFileDescriptor: function (file) {
        var fstat;

        try {
          fstat = fs.statSync(file);
        } catch (ex) {
          this.removeEntry(file);
          return { key: file, notFound: true, err: ex };
        }

        if (useChecksum) {
          return this._getFileDescriptorUsingChecksum(file);
        }

        return this._getFileDescriptorUsingMtimeAndSize(file, fstat);
      },

      _getFileDescriptorUsingMtimeAndSize: function (file, fstat) {
        var meta = cache.getKey(file);
        var cacheExists = !!meta;

        var cSize = fstat.size;
        var cTime = fstat.mtime.getTime();

        var isDifferentDate;
        var isDifferentSize;

        if (!meta) {
          meta = { size: cSize, mtime: cTime };
        } else {
          isDifferentDate = cTime !== meta.mtime;
          isDifferentSize = cSize !== meta.size;
        }

        var nEntry = (normalizedEntries[file] = {
          key: file,
          changed: !cacheExists || isDifferentDate || isDifferentSize,
          meta: meta,
        });

        return nEntry;
      },

      _getFileDescriptorUsingChecksum: function (file) {
        var meta = cache.getKey(file);
        var cacheExists = !!meta;

        var contentBuffer;
        try {
          contentBuffer = fs.readFileSync(file);
        } catch (ex) {
          contentBuffer = '';
        }

        var isDifferent = true;
        var hash = this.getHash(contentBuffer);

        if (!meta) {
          meta = { hash: hash };
        } else {
          isDifferent = hash !== meta.hash;
        }

        var nEntry = (normalizedEntries[file] = {
          key: file,
          changed: !cacheExists || isDifferent,
          meta: meta,
        });

        return nEntry;
      },

      /**
       * Return the list o the files that changed compared
       * against the ones stored in the cache
       *
       * @method getUpdated
       * @param files {Array} the array of files to compare against the ones in the cache
       * @returns {Array}
       */
      getUpdatedFiles: function (files) {
        var me = this;
        files = files || [];

        return me
          .normalizeEntries(files)
          .filter(function (entry) {
            return entry.changed;
          })
          .map(function (entry) {
            return entry.key;
          });
      },

      /**
       * return the list of files
       * @method normalizeEntries
       * @param files
       * @returns {*}
       */
      normalizeEntries: function (files) {
        files = files || [];

        var me = this;
        var nEntries = files.map(function (file) {
          return me.getFileDescriptor(file);
        });

        //normalizeEntries = nEntries;
        return nEntries;
      },

      /**
       * Remove an entry from the file-entry-cache. Useful to force the file to still be considered
       * modified the next time the process is run
       *
       * @method removeEntry
       * @param entryName
       */
      removeEntry: function (entryName) {
        delete normalizedEntries[entryName];
        cache.removeKey(entryName);
      },

      /**
       * Delete the cache file from the disk
       * @method deleteCacheFile
       */
      deleteCacheFile: function () {
        cache.removeCacheFile();
      },

      /**
       * remove the cache from the file and clear the memory cache
       */
      destroy: function () {
        normalizedEntries = {};
        cache.destroy();
      },

      _getMetaForFileUsingCheckSum: function (cacheEntry) {
        var contentBuffer = fs.readFileSync(cacheEntry.key);
        var hash = this.getHash(contentBuffer);
        var meta = Object.assign(cacheEntry.meta, { hash: hash });
        delete meta.size;
        delete meta.mtime;
        return meta;
      },

      _getMetaForFileUsingMtimeAndSize: function (cacheEntry) {
        var stat = fs.statSync(cacheEntry.key);
        var meta = Object.assign(cacheEntry.meta, {
          size: stat.size,
          mtime: stat.mtime.getTime(),
        });
        delete meta.hash;
        return meta;
      },

      /**
       * Sync the files and persist them to the cache
       * @method reconcile
       */
      reconcile: function (noPrune) {
        removeNotFoundFiles();

        noPrune = typeof noPrune === 'undefined' ? true : noPrune;

        var entries = normalizedEntries;
        var keys = Object.keys(entries);

        if (keys.length === 0) {
          return;
        }

        var me = this;

        keys.forEach(function (entryName) {
          var cacheEntry = entries[entryName];

          try {
            var meta = useChecksum
              ? me._getMetaForFileUsingCheckSum(cacheEntry)
              : me._getMetaForFileUsingMtimeAndSize(cacheEntry);
            cache.setKey(entryName, meta);
          } catch (err) {
            // if the file does not exists we don't save it
            // other errors are just thrown
            if (err.code !== 'ENOENT') {
              throw err;
            }
          }
        });

        cache.save(noPrune);
      },
    };
  },
};
icx9{
  "name": "flat-cache",
  "version": "4.0.1",
  "description": "A stupidly simple key/value storage using files to persist some data",
  "repository": "jaredwray/flat-cache",
  "license": "MIT",
  "author": {
    "name": "Jared Wray",
    "url": "https://jaredwray.com"
  },
  "main": "src/cache.js",
  "files": [
    "src/cache.js",
    "src/del.js",
    "src/utils.js"
  ],
  "engines": {
    "node": ">=16"
  },
  "precommit": [
    "npm run verify --silent"
  ],
  "prepush": [
    "npm run verify --silent"
  ],
  "scripts": {
    "eslint": "eslint --cache --cache-location=node_modules/.cache/ ./src/**/*.js ./test/**/*.js",
    "clean": "rimraf ./node_modules ./package-lock.json ./yarn.lock ./coverage",
    "eslint-fix": "npm run eslint -- --fix",
    "autofix": "npm run eslint-fix",
    "check": "npm run eslint",
    "verify": "npm run eslint && npm run test:cache",
    "test:cache": "c8 mocha -R spec test/specs",
    "test:ci:cache": "c8 --reporter=lcov mocha -R spec test/specs",
    "test": "npm run verify --silent",
    "format": "prettier --write ."
  },
  "keywords": [
    "json cache",
    "simple cache",
    "file cache",
    "key par",
    "key value",
    "cache"
  ],
  "devDependencies": {
    "c8": "^9.1.0",
    "chai": "^4.3.10",
    "eslint": "^8.56.0",
    "eslint-config-prettier": "^9.1.0",
    "eslint-plugin-mocha": "^10.2.0",
    "glob-expand": "^0.2.1",
    "mocha": "^10.3.0",
    "prettier": "^3.2.4",
    "rimraf": "^5.0.5",
    "sinon": "^17.0.1",
    "write": "^2.0.0"
  },
  "dependencies": {
    "flatted": "^3.2.9",
    "keyv": "^4.5.4"
  }
}
På-Fx!{
  "name": "file-entry8.0.0",
  "description": "Super simple cache for file metadata, useful for process that work o a given series of files and thatV only need to repeat the job on the changed ones since the previous run of the process	ile-entryx"cache.js",
  "files": [
    "cachep*	.0.0"
  }U#'cache.js' 'test/**/*.js' 'perf.js'!~>-",
    "test": "npm run eslint --silent && c8%":ci": "npm run eslint --silent && 3Kperf": "node perf.js"
  },
  "prepush": [
    "npm run eslint --silent"
  ] Meslint --silent"
  ],
  "keywords": [
    "file cache",
    "task cache fileshi8.0.16prettier": "^5.0.1T252.0",
    "prettier": "^3.1.1",
    "rimraf": "^5.0.5;-cache": "^4.0.0"
  }
}
x E100644 index.d.ts gFrJP])100644 index.js VN]2(Gm	sBm100644 license |JW?z100644 package.json Vm
<N.I&Q100644 readme.md z1_YChM²xM/* eslint-disable @typescript-eslint/unified-signatures */
import {Options as LocatePathOptions} from 'locate-path';

declare const stop: unique symbol;

declare namespace findUp {
	interface Options extends LocatePathOptions {}

	type StopSymbol = typeof stop;

	type Match = string | StopSymbol | undefined;
}

declare const findUp: {
	sync: {
		/**
		Synchronously check if a path exists.

		@param path - Path to the file or directory.
		@returns Whether the path exists.

		@example
		```
		import findUp = require('find-up');

		console.log(findUp.sync.exists('/Users/sindresorhus/unicorn.png'));
		//=> true
		```
		*/
		exists: (path: string) => boolean;

		/**
		Synchronously find a file or directory by walking up parent directories.

		@param name - Name of the file or directory to find. Can be multiple.
		@returns The first path found (by respecting the order of `name`s) or `undefined` if none could be found.
		*/
		(name: string | readonly string[], options?: findUp.Options): string | undefined;

		/**
		Synchronously find a file or directory by walking up parent directories.

		@param matcher - Called for each directory in the search. Return a path or `findUp.stop` to stop the search.
		@returns The first path found or `undefined` if none could be found.

		@example
		```
		import path = require('path');
		import findUp = require('find-up');

		console.log(findUp.sync(directory => {
			const hasUnicorns = findUp.sync.exists(path.join(directory, 'unicorn.png'));
			return hasUnicorns && directory;
		}, {type: 'directory'}));
		//=> '/Users/sindresorhus'
		```
		*/
		(matcher: (directory: string) => findUp.Match, options?: findUp.Options): string | undefined;
	};

	/**
	Check if a path exists.

	@param path - Path to a file or directory.
	@returns Whether the path exists.

	@example
	```
	import findUp = require('find-up');

	(async () => {
		console.log(await findUp.exists('/Users/sindresorhus/unicorn.png'));
		//=> true
	})();
	```
	*/
	exists: (path: string) => Promise<boolean>;

	/**
	Return this in a `matcher` function to stop the search and force `findUp` to immediately return `undefined`.
	*/
	readonly stop: findUp.StopSymbol;

	/**
	Find a file or directory by walking up parent directories.

	@param name - Name of the file or directory to find. Can be multiple.
	@returns The first path found (by respecting the order of `name`s) or `undefined` if none could be found.

	@example
	```
	// /
	// └── Users
	//     └── sindresorhus
	//         ├── unicorn.png
	//         └── foo
	//             └── bar
	//                 ├── baz
	//                 └── example.js

	// example.js
	import findUp = require('find-up');

	(async () => {
		console.log(await findUp('unicorn.png'));
		//=> '/Users/sindresorhus/unicorn.png'

		console.log(await findUp(['rainbow.png', 'unicorn.png']));
		//=> '/Users/sindresorhus/unicorn.png'
	})();
	```
	*/
	(name: string | readonly string[], options?: findUp.Options): Promise<string | undefined>;

	/**
	Find a file or directory by walking up parent directories.

	@param matcher - Called for each directory in the search. Return a path or `findUp.stop` to stop the search.
	@returns The first path found or `undefined` if none could be found.

	@example
	```
	import path = require('path');
	import findUp = require('find-up');

	(async () => {
		console.log(await findUp(async directory => {
			const hasUnicorns = await findUp.exists(path.join(directory, 'unicorn.png'));
			return hasUnicorns && directory;
		}, {type: 'directory'}));
		//=> '/Users/sindresorhus'
	})();
	```
	*/
	(matcher: (directory: string) => (findUp.Match | Promise<findUp.Match>), options?: findUp.Options): Promise<string | undefined>;
};

export = findUp;
<櫴yxk'use strict';
const path = require('path');
const locatePath = require('locate-path');
const pathExists = require('path-exists');

const stop = Symbol('findUp.stop');

module.exports = async (name, options = {}) => {
	let directory = path.resolve(options.cwd || '');
	const {root} = path.parse(directory);
	const paths = [].concat(name);

	const runMatcher = async locateOptions => {
		if (typeof name !== 'function') {
			return locatePath(paths, locateOptions);
		}

		const foundPath = await name(locateOptions.cwd);
		if (typeof foundPath === 'string') {
			return locatePath([foundPath], locateOptions);
		}

		return foundPath;
	};

	// eslint-disable-next-line no-constant-condition
	while (true) {
		// eslint-disable-next-line no-await-in-loop
		const foundPath = await runMatcher({...options, cwd: directory});

		if (foundPath === stop) {
			return;
		}

		if (foundPath) {
			return path.resolve(directory, foundPath);
		}

		if (directory === root) {
			return;
		}

		directory = path.dirname(directory);
	}
};

module.exports.sync = (name, options = {}) => {
	let directory = path.resolve(options.cwd || '');
	const {root} = path.parse(directory);
	const paths = [].concat(name);

	const runMatcher = locateOptions => {
		if (typeof name !== 'function') {
			return locatePath.sync(paths, locateOptions);
		}

		const foundPath = name(locateOptions.cwd);
		if (typeof foundPath === 'string') {
			return locatePath.sync([foundPath], locateOptions);
		}

		return foundPath;
	};

	// eslint-disable-next-line no-constant-condition
	while (true) {
		const foundPath = runMatcher({...options, cwd: directory});

		if (foundPath === stop) {
			return;
		}

		if (foundPath) {
			return path.resolve(directory, foundPath);
		}

		if (directory === root) {
			return;
		}

		directory = path.dirname(directory);
	}
};

module.exports.exists = pathExists;

module.exports.sync.exists = pathExists.sync;

module.exports.stop = stop;
E9xj{
	"name": "find-up",
	"version": "5.0.0",
	"description": "Find a file or directory by walking up parent directories",
	"license": "MIT",
	"repository": "sindresorhus/find-up",
	"funding": "https://github.com/sponsors/sindresorhus",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "https://sindresorhus.com"
	},
	"engines": {
		"node": ">=10"
	},
	"scripts": {
		"test": "xo && ava && tsd"
	},
	"files": [
		"index.js",
		"index.d.ts"
	],
	"keywords": [
		"find",
		"up",
		"find-up",
		"findup",
		"look-up",
		"look",
		"file",
		"search",
		"match",
		"package",
		"resolve",
		"parent",
		"parents",
		"folder",
		"directory",
		"walk",
		"walking",
		"path"
	],
	"dependencies": {
		"locate-path": "^6.0.0",
		"path-exists": "^4.0.0"
	},
	"devDependencies": {
		"ava": "^2.1.0",
		"is-path-inside": "^2.1.0",
		"tempy": "^0.6.0",
		"tsd": "^0.13.1",
		"xo": "^0.33.0"
	}
}
xF# find-up [![Build Status](https://travis-ci.com/sindresorhus/find-up.svg?branch=master)](https://travis-ci.com/github/sindresorhus/find-up)

> Find a file or directory by walking up parent directories

## Install

```
$ npm install find-up
```

## Usage

```
/
└── Users
    └── sindresorhus
        ├── unicorn.png
        └── foo
            └── bar
                ├── baz
                └── example.js
```

`example.js`

```js
const path = require('path');
const findUp = require('find-up');

(async () => {
	console.log(await findUp('unicorn.png'));
	//=> '/Users/sindresorhus/unicorn.png'

	console.log(await findUp(['rainbow.png', 'unicorn.png']));
	//=> '/Users/sindresorhus/unicorn.png'

	console.log(await findUp(async directory => {
		const hasUnicorns = await findUp.exists(path.join(directory, 'unicorn.png'));
		return hasUnicorns && directory;
	}, {type: 'directory'}));
	//=> '/Users/sindresorhus'
})();
```

## API

### findUp(name, options?)
### findUp(matcher, options?)

Returns a `Promise` for either the path or `undefined` if it couldn't be found.

### findUp([...name], options?)

Returns a `Promise` for either the first path found (by respecting the order of the array) or `undefined` if none could be found.

### findUp.sync(name, options?)
### findUp.sync(matcher, options?)

Returns a path or `undefined` if it couldn't be found.

### findUp.sync([...name], options?)

Returns the first path found (by respecting the order of the array) or `undefined` if none could be found.

#### name

Type: `string`

Name of the file or directory to find.

#### matcher

Type: `Function`

A function that will be called with each directory until it returns a `string` with the path, which stops the search, or the root directory has been reached and nothing was found. Useful if you want to match files with certain patterns, set of permissions, or other advanced use-cases.

When using async mode, the `matcher` may optionally be an async or promise-returning function that returns the path.

#### options

Type: `object`

##### cwd

Type: `string`\
Default: `process.cwd()`

Directory to start from.

##### type

Type: `string`\
Default: `'file'`\
Values: `'file'` `'directory'`

The type of paths that can match.

##### allowSymlinks

Type: `boolean`\
Default: `true`

Allow symbolic links to match if they point to the chosen path type.

### findUp.exists(path)

Returns a `Promise<boolean>` of whether the path exists.

### findUp.sync.exists(path)

Returns a `boolean` of whether the path exists.

#### path

Type: `string`

Path to a file or directory.

### findUp.stop

A [`Symbol`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol) that can be returned by a `matcher` function to stop the search and cause `findUp` to immediately return `undefined`. Useful as a performance optimization in case the current working directory is deeply nested in the filesystem.

```js
const path = require('path');
const findUp = require('find-up');

(async () => {
	await findUp(directory => {
		return path.basename(directory) === 'work' ? findUp.stop : 'logo.png';
	});
})();
```

## Related

- [find-up-cli](https://github.com/sindresorhus/find-up-cli) - CLI for this module
- [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file
- [pkg-dir](https://github.com/sindresorhus/pkg-dir) - Find the root directory of an npm package
- [resolve-from](https://github.com/sindresorhus/resolve-from) - Resolve the path of a module like `require.resolve()` but from a given path

---

<div align="center">
	<b>
		<a href="https://tidelift.com/subscription/pkg/npm-find-up?utm_source=npm-find-up&utm_medium=referral&utm_campaign=readme">Get professional support for 'find-up' with a Tidelift subscription</a>
	</b>
	<br>
	<sub>
		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
	</sub>
</div>
<lx I100644 LICENSE s~,=a ]15100644 README.md =wmQ؞V100644 changelog.md ok @\W100644 package.json $7T4r>dyb40000 src Q>x-b#/T=ι^Dxc >The MIT License (MIT)

Copyright (c) Roy Riojas and Jared Wrayn all
q THE
SOFTWARE.

Wjx# flat-cache

> A stupidly simple key/value storage using files to persist the data

[![NPM Version](https://img.shields.io/npm/v/flat-cache.svg?style=flat)](https://npmjs.org/package/flat-cache)
[![tests](https://github.com/jaredwray/flat-cache/actions/workflows/tests.yaml/badge.svg?branch=master)](https://github.com/jaredwray/flat-cache/actions/workflows/tests.yaml)
[![codecov](https://codecov.io/github/jaredwray/flat-cache/branch/master/graph/badge.svg?token=KxR95XT3NF)](https://codecov.io/github/jaredwray/flat-cache)
[![npm](https://img.shields.io/npm/dm/flat-cache)](https://npmjs.com/package/flat-cache)

## install

```bash
npm i --save flat-cache
```

## Usage

```js
const flatCache = require('flat-cache');
// loads the cache, if one does not exists for the given
// Id a new one will be prepared to be created
const cache = flatCache.load('cacheId');

// sets a key on the cache
cache.setKey('key', { foo: 'var' });

// get a key from the cache
cache.getKey('key'); // { foo: 'var' }

// fetch the entire persisted object
cache.all(); // { 'key': { foo: 'var' } }

// remove a key
cache.removeKey('key'); // removes a key from the cache

// save it to disk
cache.save(); // very important, if you don't save no changes will be persisted.
// cache.save( true /* noPrune */) // can be used to prevent the removal of non visited keys

// loads the cache from a given directory, if one does
// not exists for the given Id a new one will be prepared to be created
const cache = flatCache.load('cacheId', path.resolve('./path/to/folder'));

// The following methods are useful to clear the cache
// delete a given cache
flatCache.clearCacheById('cacheId'); // removes the cacheId document if one exists.

// delete all cache
flatCache.clearAll(); // remove the cache directory
```

## Motivation for this module

I needed a super simple and dumb **in-memory cache** with optional disk persistance in order to make
a script that will beutify files with `esformatter` only execute on the files that were changed since the last run.
To make that possible we need to store the `fileSize` and `modificationTime` of the files. So a simple `key/value`
storage was needed and Bam! this module was born.

## Important notes

- If no directory is especified when the `load` method is called, a folder named `.cache` will be created
  inside the module directory when `cache.save` is called. If you're committing your `node_modules` to any vcs, you
  might want to ignore the default `.cache` folder, or specify a custom directory.
- The values set on the keys of the cache should be `stringify-able` ones, meaning no circular references
- All the changes to the cache state are done to memory
- I could have used a timer or `Object.observe` to deliver the changes to disk, but I wanted to keep this module
  intentionally dumb and simple
- Non visited keys are removed when `cache.save()` is called. If this is not desired, you can pass `true` to the save call
  like: `cache.save( true /* noPrune */ )`.

## License

MIT

## Changelog

[changelog](./changelog.md)
=!x>e# flat-cache - Changelog

## v3.0.4

- **Refactoring**
  - add files by name to the list of exported files - [89a2698](https://github.com/royriojas/flat-cache/commit/89a2698), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 02:35:39

## v3.0.3

- **Bug Fixes**
  - Fix wrong eslint command - [f268e42](https://github.com/royriojas/flat-cache/commit/f268e42), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 02:15:04

## v3.0.2

- **Refactoring**

  - Update the files paths - [6983a80](https://github.com/royriojas/flat-cache/commit/6983a80), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 01:58:39
  - Move code to src/ - [18ed6e8](https://github.com/royriojas/flat-cache/commit/18ed6e8), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 01:57:17
  - Change eslint-cache location - [beed74c](https://github.com/royriojas/flat-cache/commit/beed74c), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 01:48:32

## v3.0.1

- **Refactoring**
  - Remove unused deps - [8c6d9dc](https://github.com/royriojas/flat-cache/commit/8c6d9dc), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 01:43:29

## v3.0.0

- **Refactoring**
  - Fix engines - [52b824c](https://github.com/royriojas/flat-cache/commit/52b824c), [Roy Riojas](https://github.com/Roy Riojas), 08/11/2020 01:01:52
- **Other changes**

  - Replace write with combination of mkdir and writeFile ([#49](https://github.com/royriojas/flat-cache/issues/49)) - [ef48276](https://github.com/royriojas/flat-cache/commit/ef48276), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 08/11/2020 00:17:15

    Node v10 introduced a great "recursive" option for mkdir which allows to
    get rid from mkdirp package and easily rewrite "write" package usage
    with two function calls.

    https://nodejs.org/api/fs.html#fs_fs_mkdir_path_options_callback

  - Added a testcase for clearAll ([#48](https://github.com/royriojas/flat-cache/issues/48)) - [45b51ca](https://github.com/royriojas/flat-cache/commit/45b51ca), [Aaron Chen](https://github.com/Aaron Chen), 21/05/2020 08:40:03
  - requet node>=10 - [a5c482c](https://github.com/royriojas/flat-cache/commit/a5c482c), [yumetodo](https://github.com/yumetodo), 10/04/2020 23:14:53

    thanks @SuperITMan

  - Update README.md - [29fe40b](https://github.com/royriojas/flat-cache/commit/29fe40b), [Roy Riojas](https://github.com/Roy Riojas), 10/04/2020 20:08:05
  - reduce vulnerability to 1 - [e9db1b2](https://github.com/royriojas/flat-cache/commit/e9db1b2), [yumetodo](https://github.com/yumetodo), 30/03/2020 11:10:43
  - reduce vulnerabilities dependencies to 8 - [b58d196](https://github.com/royriojas/flat-cache/commit/b58d196), [yumetodo](https://github.com/yumetodo), 30/03/2020 10:54:56
  - use prettier instead of esbeautifier - [03b1db7](https://github.com/royriojas/flat-cache/commit/03b1db7), [yumetodo](https://github.com/yumetodo), 30/03/2020 10:27:14
  - update proxyquire - [c2f048d](https://github.com/royriojas/flat-cache/commit/c2f048d), [yumetodo](https://github.com/yumetodo), 30/03/2020 10:16:16
  - update flatted and mocha - [a0e56da](https://github.com/royriojas/flat-cache/commit/a0e56da), [yumetodo](https://github.com/yumetodo), 30/03/2020 09:46:45

    mocha > mkdirp is updated
    istanble >>> optimist > minimist is not updated

  - drop support node.js < 10 in develop - [beba691](https://github.com/royriojas/flat-cache/commit/beba691), [yumetodo](https://github.com/yumetodo), 18/03/2020 01:31:09

    see mkdirp

  - npm aufit fix(still remains) - [ce166cb](https://github.com/royriojas/flat-cache/commit/ce166cb), [yumetodo](https://github.com/yumetodo), 18/03/2020 01:18:08

    37 vulnerabilities required manual review and could not be updated

  - updtate sinon - [9f2d1b6](https://github.com/royriojas/flat-cache/commit/9f2d1b6), [yumetodo](https://github.com/yumetodo), 18/03/2020 01:17:51
  - apply eslint-plugin-mocha - [07343b5](https://github.com/royriojas/flat-cache/commit/07343b5), [yumetodo](https://github.com/yumetodo), 13/03/2020 22:17:21
  - Less strint version check ([#44](https://github.com/royriojas/flat-cache/issues/44)) - [92aca1c](https://github.com/royriojas/flat-cache/commit/92aca1c), [Wojciech Maj](https://github.com/Wojciech Maj), 13/11/2019 16:18:25

    - Use ^ version matching for production dependencies
    - Run npm audit fix

- **Bug Fixes**
  - update dependencies and use eslint directly - [73fbed2](https://github.com/royriojas/flat-cache/commit/73fbed2), [yumetodo](https://github.com/yumetodo), 18/03/2020 01:17:27

## v2.0.1

- **Refactoring**
  - upgrade node modules to latest versions - [6402ed3](https://github.com/royriojas/flat-cache/commit/6402ed3), [Roy Riojas](https://github.com/Roy Riojas), 08/01/2019 18:47:05

## v2.0.0

- **Bug Fixes**

  - upgrade package.json lock file - [8d21c7b](https://github.com/royriojas/flat-cache/commit/8d21c7b), [Roy Riojas](https://github.com/Roy Riojas), 08/01/2019 17:03:13
  - Use the same versions of node_js that eslint use - [8d23379](https://github.com/royriojas/flat-cache/commit/8d23379), [Roy Riojas](https://github.com/Roy Riojas), 08/01/2019 16:25:11

- **Other changes**

  - Replace circular-json with flatted ([#36](https://github.com/royriojas/flat-cache/issues/36)) - [b93aced](https://github.com/royriojas/flat-cache/commit/b93aced), [C. K. Tang](https://github.com/C. K. Tang), 08/01/2019 17:03:01
  - Change JSON parser from circular-json to flatted & 1 more changes ([#37](https://github.com/royriojas/flat-cache/issues/37)) - [745e65a](https://github.com/royriojas/flat-cache/commit/745e65a), [Andy Chen](https://github.com/Andy Chen), 08/01/2019 16:17:20

    - Change JSON parser from circular-json to flatted & 1 more changes
    - Change JSON parser from circular-json
    - Audited 2 vulnerabilities
    - Update package.json
    - Update Engine require
    - There's a bunch of dependencies in this pkg requires node >=4, so I changed it to 4
    - Remove and add node versions
    - I have seen this pkg is not available with node 0.12 so I removed it
    - I have added a popular used LTS version of node - 10

## v1.3.4

- **Refactoring**
  - Add del.js and utils.js to the list of files to be beautified - [9d0ca9b](https://github.com/royriojas/flat-cache/commit/9d0ca9b), [Roy Riojas](https://github.com/Roy Riojas), 14/11/2018 12:19:02

## v1.3.3

- **Refactoring**
  - Make sure package-lock.json is up to date - [a7d2598](https://github.com/royriojas/flat-cache/commit/a7d2598), [Roy Riojas](https://github.com/Roy Riojas), 14/11/2018 11:36:08
- **Other changes**

  - Removed the need for del ([#33](https://github.com/royriojas/flat-cache/issues/33)) - [c429012](https://github.com/royriojas/flat-cache/commit/c429012), [S. Gilroy](https://github.com/S. Gilroy), 13/11/2018 13:56:37

    - Removed the need for del

    Removed the need for del as newer versions have broken backwards
    compatibility. del mainly uses rimraf for deleting folders
    and files, replaceing it with rimraf only is a minimal change.

    - Disable glob on rimraf calls
    - Added glob disable to wrong call
    - Wrapped rimraf to simplify solution

## v1.3.2

- **Refactoring**
  - remove yarn.lock file - [704c6c4](https://github.com/royriojas/flat-cache/commit/704c6c4), [Roy Riojas](https://github.com/Roy Riojas), 07/11/2018 15:41:08
- **Other changes**

  - replace circular-json with flatted ([#23](https://github.com/royriojas/flat-cache/issues/23))" - [db12d74](https://github.com/royriojas/flat-cache/commit/db12d74), [Roy Riojas](https://github.com/Roy Riojas), 07/11/2018 15:40:39

    This reverts commit 00f689277a75e85fef28e6a048fad227afc525e6.

## v1.3.1

- **Refactoring**
  - upgrade deps to remove some security warnings - [f405719](https://github.com/royriojas/flat-cache/commit/f405719), [Roy Riojas](https://github.com/Roy Riojas), 06/11/2018 12:07:31
- **Bug Fixes**
  - replace circular-json with flatted ([#23](https://github.com/royriojas/flat-cache/issues/23)) - [00f6892](https://github.com/royriojas/flat-cache/commit/00f6892), [Terry](https://github.com/Terry), 05/11/2018 18:44:16
- **Other changes**

  - update del to v3.0.0 ([#26](https://github.com/royriojas/flat-cache/issues/26)) - [d42883f](https://github.com/royriojas/flat-cache/commit/d42883f), [Patrick Silva](https://github.com/Patrick Silva), 03/11/2018 01:00:44

    Closes <a target="_blank" class="info-link" href="https://github.com/royriojas/flat-cache/issues/25"><span>#25</span></a>

## v1.3.0

- **Other changes**

  - Added #all method ([#16](https://github.com/royriojas/flat-cache/issues/16)) - [12293be](https://github.com/royriojas/flat-cache/commit/12293be), [Ozair Patel](https://github.com/Ozair Patel), 25/09/2017 14:46:38

    - Added #all method
    - Added #all method test
    - Updated readme
    - Added yarn.lock
    - Added more keys for #all test
    - Beautified file

  - fix changelog title style ([#14](https://github.com/royriojas/flat-cache/issues/14)) - [af8338a](https://github.com/royriojas/flat-cache/commit/af8338a), [前端小武](https://github.com/前端小武), 19/12/2016 20:34:48

## v1.2.2

- **Bug Fixes**

  - Do not crash if cache file is invalid JSON. ([#13](https://github.com/royriojas/flat-cache/issues/13)) - [87beaa6](https://github.com/royriojas/flat-cache/commit/87beaa6), [Roy Riojas](https://github.com/Roy Riojas), 19/12/2016 18:03:35

    Fixes <a target="_blank" class="info-link" href="https://github.com/royriojas/flat-cache/issues/12"><span>#12</span></a>

    Not sure under which situations a cache file might exist that does
    not contain a valid JSON structure, but just in case to cover
    the possibility of this happening a try catch block has been added

    If the cache is somehow not valid the cache will be discarded an a
    a new cache will be stored instead

- **Other changes**

  - Added travis ci support for modern node versions ([#11](https://github.com/royriojas/flat-cache/issues/11)) - [1c2b1f7](https://github.com/royriojas/flat-cache/commit/1c2b1f7), [Amila Welihinda](https://github.com/Amila Welihinda), 10/11/2016 23:47:52
  - Bumping `circular-son` version ([#10](https://github.com/royriojas/flat-cache/issues/10)) - [4d5e861](https://github.com/royriojas/flat-cache/commit/4d5e861), [Andrea Giammarchi](https://github.com/Andrea Giammarchi), 02/08/2016 07:13:52

    As mentioned in https://github.com/WebReflection/circular-json/issues/25 `circular-json` wan't rightly implementing the license field.

    Latest version bump changed only that bit so that ESLint should now be happy.

## v1.2.1

- **Bug Fixes**
  - Add missing utils.js file to the package. closes [#8](https://github.com/royriojas/flat-cache/issues/8) - [ec10cf2](https://github.com/royriojas/flat-cache/commit/ec10cf2), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 02:18:57

## v1.2.0

- **Documentation**
  - Add documentation about noPrune option - [23e11f9](https://github.com/royriojas/flat-cache/commit/23e11f9), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 02:06:49

## v1.0.11

- **Features**

  - Add noPrune option to cache.save() method. closes [#7](https://github.com/royriojas/flat-cache/issues/7) - [2c8016a](https://github.com/royriojas/flat-cache/commit/2c8016a), [Roy Riojas](https://github.com/Roy Riojas), 01/08/2016 02:00:29
  - Add json read and write utility based on circular-json - [c31081e](https://github.com/royriojas/flat-cache/commit/c31081e), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 08:58:17

- **Bug Fixes**

  - Remove UTF16 BOM stripping - [4a41e22](https://github.com/royriojas/flat-cache/commit/4a41e22), [Jean Ponchon](https://github.com/Jean Ponchon), 29/07/2016 02:18:06

    Since we control both writing and reading of JSON stream, there no needs
    to handle unicode BOM.

  - Use circular-json to handle circular references (fix [#5](https://github.com/royriojas/flat-cache/issues/5)) - [cd7aeed](https://github.com/royriojas/flat-cache/commit/cd7aeed), [Jean Ponchon](https://github.com/Jean Ponchon), 25/07/2016 11:11:59

- **Tests Related fixes**

  - Add missing file from eslint test - [d6fa3c3](https://github.com/royriojas/flat-cache/commit/d6fa3c3), [Jean Ponchon](https://github.com/Jean Ponchon), 29/07/2016 02:15:51
  - Add test for circular json serialization / deserialization - [07d2ddd](https://github.com/royriojas/flat-cache/commit/07d2ddd), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 08:59:36

- **Refactoring**
  - Remove unused read-json-sync - [2be1c24](https://github.com/royriojas/flat-cache/commit/2be1c24), [Jean Ponchon](https://github.com/Jean Ponchon), 28/07/2016 08:59:18
- **Build Scripts Changes**
  - travis tests on 0.12 and 4x - [3a613fd](https://github.com/royriojas/flat-cache/commit/3a613fd), [royriojas](https://github.com/royriojas), 15/11/2015 14:34:40

## v1.0.10

- **Build Scripts Changes**

  - add eslint-fix task - [fd29e52](https://github.com/royriojas/flat-cache/commit/fd29e52), [royriojas](https://github.com/royriojas), 01/11/2015 15:04:08
  - make sure the test script also verify beautification and linting of files before running tests - [e94e176](https://github.com/royriojas/flat-cache/commit/e94e176), [royriojas](https://github.com/royriojas), 01/11/2015 11:54:48

- **Other changes**
  - add clearAll for cacheDir - [97383d9](https://github.com/royriojas/flat-cache/commit/97383d9), [xieyaowu](https://github.com/xieyaowu), 31/10/2015 21:02:18

## v1.0.9

- **Bug Fixes**
  - wrong default values for changelogx user repo name - [7bb52d1](https://github.com/royriojas/flat-cache/commit/7bb52d1), [royriojas](https://github.com/royriojas), 11/09/2015 15:59:30

## v1.0.8

- **Build Scripts Changes**
  - test against node 4 - [c395b66](https://github.com/royriojas/flat-cache/commit/c395b66), [royriojas](https://github.com/royriojas), 11/09/2015 15:51:39

## v1.0.7

- **Other changes**
  - Move dependencies into devDep - [7e47099](https://github.com/royriojas/flat-cache/commit/7e47099), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 15:10:57
- **Documentation**
  - Add missing changelog link - [f51197a](https://github.com/royriojas/flat-cache/commit/f51197a), [royriojas](https://github.com/royriojas), 11/09/2015 14:48:05

## v1.0.6

- **Build Scripts Changes**
  - Add helpers/code check scripts - [bdb82f3](https://github.com/royriojas/flat-cache/commit/bdb82f3), [royriojas](https://github.com/royriojas), 11/09/2015 14:44:31

## v1.0.5

- **Documentation**
  - better description for the module - [436817f](https://github.com/royriojas/flat-cache/commit/436817f), [royriojas](https://github.com/royriojas), 11/09/2015 14:35:33
- **Other changes**
  - Update dependencies - [be88aa3](https://github.com/royriojas/flat-cache/commit/be88aa3), [Bogdan Chadkin](https://github.com/Bogdan Chadkin), 11/09/2015 13:47:41

## v1.0.4

- **Refactoring**
  - load a cache file using the full filepath - [b8f68c2](https://github.com/royriojas/flat-cache/commit/b8f68c2), [Roy Riojas](https://github.com/Roy Riojas), 30/08/2015 04:19:14
- **Documentation**
  - Add documentation about `clearAll` and `clearCacheById` - [13947c1](https://github.com/royriojas/flat-cache/commit/13947c1), [Roy Riojas](https://github.com/Roy Riojas), 01/03/2015 23:44:05
- **Features**
  - Add methods to remove the cache documents created - [af40443](https://github.com/royriojas/flat-cache/commit/af40443), [Roy Riojas](https://github.com/Roy Riojas), 01/03/2015 23:39:27

## v1.0.1

- **Other changes**
  - Update README.md - [c2b6805](https://github.com/royriojas/flat-cache/commit/c2b6805), [Roy Riojas](https://github.com/Roy Riojas), 26/02/2015 04:28:07

## v1.0.0

- **Refactoring**
  - flat-cache v.1.0.0 - [c984274](https://github.com/royriojas/flat-cache/commit/c984274), [Roy Riojas](https://github.com/Roy Riojas), 26/02/2015 04:11:50
- **Other changes**
  - Initial commit - [d43cccf](https://github.com/royriojas/flat-cache/commit/d43cccf), [Roy Riojas](https://github.com/Roy Riojas), 26/02/2015 01:12:16
b,xj 100644 cache.js ،3QUHcQf100644 del.js \6
Kѿ|rI100644 utils.js _[~GU,5xconst path = require('path');
const fs = require('fs');
const Keyv = require('keyv');
const { writeJSON, tryParse } = require('./utils');
const { del } = require('./del');

const cache = {
  /**
   * Load a cache identified by the given Id. If the element does not exists, then initialize an empty
   * cache storage. If specified `cacheDir` will be used as the directory to persist the data to. If omitted
   * then the cache module directory `./cache` will be used instead
   *
   * @method load
   * @param docId {String} the id of the cache, would also be used as the name of the file cache
   * @param [cacheDir] {String} directory for the cache entry
   */
  load: function (docId, cacheDir) {
    const me = this;
    me.keyv = new Keyv();

    me.__visited = {};
    me.__persisted = {};

    me._pathToFile = cacheDir ? path.resolve(cacheDir, docId) : path.resolve(__dirname, '../.cache/', docId);

    if (fs.existsSync(me._pathToFile)) {
      me._persisted = tryParse(me._pathToFile, {});
    }
  },

  get _persisted() {
    return this.__persisted;
  },

  set _persisted(value) {
    this.__persisted = value;
  },

  get _visited() {
    return this.__visited;
  },

  set _visited(value) {
    this.__visited = value;
  },

  /**
   * Load the cache from the provided file
   * @method loadFile
   * @param  {String} pathToFile the path to the file containing the info for the cache
   */
  loadFile: function (pathToFile) {
    const me = this;
    const dir = path.dirname(pathToFile);
    const fName = path.basename(pathToFile);

    me.load(fName, dir);
  },

  /**
   * Returns the entire persisted object
   * @method all
   * @returns {*}
   */
  all: function () {
    return this._persisted;
  },

  keys: function () {
    return Object.keys(this._persisted);
  },
  /**
   * sets a key to a given value
   * @method setKey
   * @param key {string} the key to set
   * @param value {object} the value of the key. Could be any object that can be serialized with JSON.stringify
   */
  setKey: function (key, value) {
    this._visited[key] = true;
    this._persisted[key] = value;
  },
  /**
   * remove a given key from the cache
   * @method removeKey
   * @param key {String} the key to remove from the object
   */
  removeKey: function (key) {
    delete this._visited[key]; // esfmt-ignore-line
    delete this._persisted[key]; // esfmt-ignore-line
  },
  /**
   * Return the value of the provided key
   * @method getKey
   * @param key {String} the name of the key to retrieve
   * @returns {*} the value from the key
   */
  getKey: function (key) {
    this._visited[key] = true;
    return this._persisted[key];
  },

  /**
   * Remove keys that were not accessed/set since the
   * last time the `prune` method was called.
   * @method _prune
   * @private
   */
  _prune: function () {
    const me = this;
    const obj = {};

    const keys = Object.keys(me._visited);

    // no keys visited for either get or set value
    if (keys.length === 0) {
      return;
    }

    keys.forEach(function (key) {
      obj[key] = me._persisted[key];
    });

    me._visited = {};
    me._persisted = obj;
  },

  /**
   * Save the state of the cache identified by the docId to disk
   * as a JSON structure
   * @param [noPrune=false] {Boolean} whether to remove from cache the non visited files
   * @method save
   */
  save: function (noPrune) {
    const me = this;
    !noPrune && me._prune();
    writeJSON(me._pathToFile, me._persisted);
  },

  /**
   * remove the file where the cache is persisted
   * @method removeCacheFile
   * @return {Boolean} true or false if the file was successfully deleted
   */
  removeCacheFile: function () {
    return del(this._pathToFile);
  },
  /**
   * Destroy the file cache and cache content.
   * @method destroy
   */
  destroy: function () {
    const me = this;
    me._visited = {};
    me._persisted = {};

    me.removeCacheFile();
  },
};

module.exports = {
  /**
   * Alias for create. Should be considered depreacted. Will be removed in next releases
   *
   * @method load
   * @param docId {String} the id of the cache, would also be used as the name of the file cache
   * @param [cacheDir] {String} directory for the cache entry
   * @returns {cache} cache instance
   */
  load: function (docId, cacheDir) {
    return this.create(docId, cacheDir);
  },

  /**
   * Load a cache identified by the given Id. If the element does not exists, then initialize an empty
   * cache storage.
   *
   * @method create
   * @param docId {String} the id of the cache, would also be used as the name of the file cache
   * @param [cacheDir] {String} directory for the cache entry
   * @returns {cache} cache instance
   */
  create: function (docId, cacheDir) {
    const obj = Object.create(cache);
    obj.load(docId, cacheDir);
    return obj;
  },

  createFromFile: function (filePath) {
    const obj = Object.create(cache);
    obj.loadFile(filePath);
    return obj;
  },
  /**
   * Clear the cache identified by the given id. Caches stored in a different cache directory can be deleted directly
   *
   * @method clearCache
   * @param docId {String} the id of the cache, would also be used as the name of the file cache
   * @param cacheDir {String} the directory where the cache file was written
   * @returns {Boolean} true if the cache folder was deleted. False otherwise
   */
  clearCacheById: function (docId, cacheDir) {
    const filePath = cacheDir ? path.resolve(cacheDir, docId) : path.resolve(__dirname, '../.cache/', docId);
    return del(filePath);
  },
  /**
   * Remove all cache stored in the cache directory
   * @method clearAll
   * @returns {Boolean} true if the cache folder was deleted. False otherwise
   */
  clearAll: function (cacheDir) {
    const filePath = cacheDir ? path.resolve(cacheDir) : path.resolve(__dirname, '../.cache/');
    return del(filePath);
  },
};
9]Z0x	const fs = require('fs');
const path = require('path');

function del(targetPath) {
  if (!fs.existsSync(targetPath)) {
    return false;
  }

  try {
    if (fs.statSync(targetPath).isDirectory()) {
      // If it's a directory, delete its contents first
      fs.readdirSync(targetPath).forEach(file => {
        const curPath = path.join(targetPath, file);

        if (fs.statSync(curPath).isFile()) {
          fs.unlinkSync(curPath); // Delete file
        }
      });
      fs.rmdirSync(targetPath); // Delete the now-empty directory
    } else {
      fs.unlinkSync(targetPath); // If it's a file, delete it directly
    }

    return true;
  } catch (error) {
    console.error(`Error while deleting ${targetPath}: ${error.message}`);
  }
}

module.exports = { del };
36xlconst fs = require('fs');
const path = require('path');
const flatted = require('flatted');

function tryParse(filePath, defaultValue) {
  let result;
  try {
    result = readJSON(filePath);
  } catch (ex) {
    result = defaultValue;
  }
  return result;
}

/**
 * Read json file synchronously using flatted
 *
 * @param  {String} filePath Json filepath
 * @returns {*} parse result
 */
function readJSON(filePath) {
  return flatted.parse(
    fs.readFileSync(filePath, {
      encoding: 'utf8',
    })
  );
}

/**
 * Write json file synchronously using circular-json
 *
 * @param  {String} filePath Json filepath
 * @param  {*} data Object to serialize
 */
function writeJSON(filePath, data) {
  fs.mkdirSync(path.dirname(filePath), {
    recursive: true,
  });
  fs.writeFileSync(filePath, flatted.stringify(data));
}

module.exports = { tryParse, readJSON, writeJSON };
xJ100644 LICENSE PmyƳH/2򄿼}100644 README.md B$KI!L)J}oM40000 cjs li/,6zȁIm100644 es.js >Mw~BUVS100644 esm.js %c\jī]3`f?40000 esm O:aM`XDe40000 golang 7j!UU?g|l100644 index.js T-n7E100644 min.js ө|MhGn100644 package.json ^.]	8*1{umO40000 php љɓR	ߴ,a}40000 python >rUh1^40000 types \nmEu4Ǟ$Ca,=0xISC License

Copyright (c) 2018-2020, Andrea Giammarchi, @WebReflection

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
8_x3# flatted

[![Downloads](https://img.shields.io/npm/dm/flatted.svg)](https://www.npmjs.com/package/flatted) [![Coverage Status](https://coveralls.io/repos/github/WebReflection/flatted/badge.svg?branch=main)](https://coveralls.io/github/WebReflection/flatted?branch=main) [![License: ISC](https://img.shields.io/badge/License-ISC-yellow.svg)](https://opensource.org/licenses/ISC) ![WebReflection status](https://offline.report/status/webreflection.svg)

![snow flake](./flatted.jpg)

<sup>**Social Media Photo by [Matt Seymour](https://unsplash.com/@mattseymour) on [Unsplash](https://unsplash.com/)**</sup>

A super light (0.5K) and fast circular JSON parser, directly from the creator of [CircularJSON](https://github.com/WebReflection/circular-json/#circularjson).

Available also for **[PHP](./php/flatted.php)**.

Available also for **[Python](./python/flatted.py)**.

Available also for **[Go](./golang/README.md)**.

- - -

## ℹ️ JSON only values

If you need anything more complex than values JSON understands, there is a standard approach to recursion and more data-types than what JSON allows, and it's part of the [Structured Clone polyfill](https://github.com/ungap/structured-clone/#readme).

- - -

```js
npm i flatted
```

Usable via [CDN](https://unpkg.com/flatted) or as regular module.

```js
// ESM
import {parse, stringify, toJSON, fromJSON} from 'flatted';

// CJS
const {parse, stringify, toJSON, fromJSON} = require('flatted');

const a = [{}];
a[0].a = a;
a.push(a);

stringify(a); // [["1","0"],{"a":"0"}]
```

## toJSON and fromJSON

If you'd like to implicitly survive JSON serialization, these two helpers helps:

```js
import {toJSON, fromJSON} from 'flatted';

class RecursiveMap extends Map {
  static fromJSON(any) {
    return new this(fromJSON(any));
  }
  toJSON() {
    return toJSON([...this.entries()]);
  }
}

const recursive = new RecursiveMap;
const same = {};
same.same = same;
recursive.set('same', same);

const asString = JSON.stringify(recursive);
const asMap = RecursiveMap.fromJSON(JSON.parse(asString));
asMap.get('same') === asMap.get('same').same;
// true
```


## Flatted VS JSON

As it is for every other specialized format capable of serializing and deserializing circular data, you should never `JSON.parse(Flatted.stringify(data))`, and you should never `Flatted.parse(JSON.stringify(data))`.

The only way this could work is to `Flatted.parse(Flatted.stringify(data))`, as it is also for _CircularJSON_ or any other, otherwise there's no granted data integrity.

Also please note this project serializes and deserializes only data compatible with JSON, so that sockets, or anything else with internal classes different from those allowed by JSON standard, won't be serialized and unserialized as expected.


### New in V1: Exact same JSON API

  * Added a [reviver](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Syntax) parameter to `.parse(string, reviver)` and revive your own objects.
  * Added a [replacer](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify#Syntax) and a `space` parameter to `.stringify(object, replacer, space)` for feature parity with JSON signature.


### Compatibility
All ECMAScript engines compatible with `Map`, `Set`, `Object.keys`, and `Array.prototype.reduce` will work, even if polyfilled.


### How does it work ?
While stringifying, all Objects, including Arrays, and strings, are flattened out and replaced as unique index. `*`

Once parsed, all indexes will be replaced through the flattened collection.

<sup><sub>`*` represented as string to avoid conflicts with numbers</sub></sup>

```js
// logic example
var a = [{one: 1}, {two: '2'}];
a[0].a = a;
// a is the main object, will be at index '0'
// {one: 1} is the second object, index '1'
// {two: '2'} the third, in '2', and it has a string
// which will be found at index '3'

Flatted.stringify(a);
// [["1","2"],{"one":1,"a":"0"},{"two":"3"},"2"]
// a[one,two]    {one: 1, a}    {two: '2'}  '2'
```
zexL 100644 index.js :[D&|~100644 package.json o.@=9s:yx'use strict';
/// <reference types="../types/index.d.ts" />

// (c) 2020-present Andrea Giammarchi

const {parse: $parse, stringify: $stringify} = JSON;
const {keys} = Object;

const Primitive = String;   // it could be Number
const primitive = 'string'; // it could be 'number'

const ignore = {};
const object = 'object';

const noop = (_, value) => value;

const primitives = value => (
  value instanceof Primitive ? Primitive(value) : value
);

const Primitives = (_, value) => (
  typeof value === primitive ? new Primitive(value) : value
);

const resolver = (input, lazy, parsed, $) => output => {
  for (let ke = keys(output), {length} = ke, y = 0; y < length; y++) {
    const k = ke[y];
    const value = output[k];
    if (value instanceof Primitive) {
      const tmp = input[+value];
      if (typeof tmp === object && !parsed.has(tmp)) {
        parsed.add(tmp);
        output[k] = ignore;
        lazy.push({ o: output, k, r: tmp });
      }
      else
        output[k] = $.call(output, k, tmp);
    }
    else if (output[k] !== ignore)
      output[k] = $.call(output, k, value);
  }
  return output;
};

const set = (known, input, value) => {
  const index = Primitive(input.push(value) - 1);
  known.set(value, index);
  return index;
};

/**
 * Converts a specialized flatted string into a JS value.
 * @param {string} text
 * @param {(this: any, key: string, value: any) => any} [reviver]
 * @returns {any}
 */
const parse = (text, reviver) => {
  const input = $parse(text, Primitives).map(primitives);
  const $ = reviver || noop;

  let value = input[0];

  if (typeof value === object && value) {
    const lazy = [];
    const revive = resolver(input, lazy, new Set, $);
    value = revive(value);

    let i = 0;
    while (i < lazy.length) {
      // it could be a lazy.shift() but that's costly
      const {o, k, r} = lazy[i++];
      o[k] = $.call(o, k, revive(r));
    }
  }

  return $.call({'': value}, '', value);
};
exports.parse = parse;

/**
 * Converts a JS value into a specialized flatted string.
 * @param {any} value
 * @param {((this: any, key: string, value: any) => any) | (string | number)[] | null | undefined} [replacer]
 * @param {string | number | undefined} [space]
 * @returns {string}
 */
const stringify = (value, replacer, space) => {
  const $ = replacer && typeof replacer === object ?
            (k, v) => (k === '' || -1 < replacer.indexOf(k) ? v : void 0) :
            (replacer || noop);
  const known = new Map;
  const input = [];
  const output = [];
  let i = +set(known, input, $.call({'': value}, '', value));
  let firstRun = !i;
  while (i < input.length) {
    firstRun = true;
    output[i] = $stringify(input[i++], replace, space);
  }
  return '[' + output.join(',') + ']';
  function replace(key, value) {
    if (firstRun) {
      firstRun = !firstRun;
      return value;
    }
    const after = $.call(this, key, value);
    switch (typeof after) {
      case object:
        if (after === null) return after;
      case primitive:
        return known.get(after) || set(known, input, after);
    }
    return after;
  }
};
exports.stringify = stringify;

/**
 * Converts a generic value into a JSON serializable object without losing recursion.
 * @param {any} value
 * @returns {any}
 */
const toJSON = value => $parse(stringify(value));
exports.toJSON = toJSON;

/**
 * Converts a previously serialized object with recursion into a recursive one.
 * @param {any} value
 * @returns {any}
 */
const fromJSON = value => parse($stringify(value));
exports.fromJSON = fromJSON;
=bx {"type":"commonjs"}CFxmself.Flatted=function(t){"use strict";const{parse:e,stringify:n}=JSON,{keys:r}=Object,o=String,s="string",c={},l="object",f=(t,e)=>e,i=t=>t instanceof o?o(t):t,a=(t,e)=>typeof e===s?new o(e):e,u=(t,e,n)=>{const r=o(e.push(n)-1);return t.set(n,r),r},p=(t,n)=>{const s=e(t,a).map(i),u=n||f;let p=s[0];if(typeof p===l&&p){const t=[],e=((t,e,n,s)=>f=>{for(let i=r(f),{length:a}=i,u=0;u<a;u++){const r=i[u],a=f[r];if(a instanceof o){const o=t[+a];typeof o!==l||n.has(o)?f[r]=s.call(f,r,o):(n.add(o),f[r]=c,e.push({o:f,k:r,r:o}))}else f[r]!==c&&(f[r]=s.call(f,r,a))}return f})(s,t,new Set,u);p=e(p);let n=0;for(;n<t.length;){const{o:r,k:o,r:s}=t[n++];r[o]=u.call(r,o,e(s))}}return u.call({"":p},"",p)},g=(t,e,r)=>{const o=e&&typeof e===l?(t,n)=>""===t||-1<e.indexOf(t)?n:void 0:e||f,c=new Map,i=[],a=[];let p=+u(c,i,o.call({"":t},"",t)),g=!p;for(;p<i.length;)g=!0,a[p]=n(i[p++],h,r);return"["+a.join(",")+"]";function h(t,e){if(g)return g=!g,e;const n=o.call(this,t,e);switch(typeof n){case l:if(null===n)return n;case s:return c.get(n)||u(c,i,n)}return n}};return t.fromJSON=t=>p(n(t)),t.parse=p,t.stringify=g,t.toJSON=t=>e(g(t)),t}({});
jyDxMconst{parse:t,stringify:e}=JSON,{keys:n}=Object,o=String,r="string",s={},c="object",l=(t,e)=>e,f=t=>t instanceof o?o(t):t,i=(t,e)=>typeof e===r?new o(e):e,a=(t,e,n)=>{const r=o(e.push(n)-1);return t.set(n,r),r},u=(e,r)=>{const a=t(e,i).map(f),u=r||l;let p=a[0];if(typeof p===c&&p){const t=[],e=((t,e,r,l)=>f=>{for(let i=n(f),{length:a}=i,u=0;u<a;u++){const n=i[u],a=f[n];if(a instanceof o){const o=t[+a];typeof o!==c||r.has(o)?f[n]=l.call(f,n,o):(r.add(o),f[n]=s,e.push({o:f,k:n,r:o}))}else f[n]!==s&&(f[n]=l.call(f,n,a))}return f})(a,t,new Set,u);p=e(p);let r=0;for(;r<t.length;){const{o:n,k:o,r:s}=t[r++];n[o]=u.call(n,o,e(s))}}return u.call({"":p},"",p)},p=(t,n,o)=>{const s=n&&typeof n===c?(t,e)=>""===t||-1<n.indexOf(t)?e:void 0:n||l,f=new Map,i=[],u=[];let p=+a(f,i,s.call({"":t},"",t)),h=!p;for(;p<i.length;)h=!0,u[p]=e(i[p++],g,o);return"["+u.join(",")+"]";function g(t,e){if(h)return h=!h,e;const n=s.call(this,t,e);switch(typeof n){case c:if(null===n)return n;case r:return f.get(n)||a(f,i,n)}return n}},h=e=>t(p(e)),g=t=>u(e(t));export{g as fromJSON,u as parse,p as stringify,h as toJSON};
`mMx$ 100644 index.js -L^e9°/y]xx/// <reference types="../types/index.d.ts" />

// (c) 2020-present Andrea Giammarchi

const {parse: $parse, stringify: $stringify} = JSON;
const {keys} = Object;

const Primitive = String;   // it could be Number
const primitive = 'string'; // it could be 'number'

const ignore = {};
const object = 'object';

const noop = (_, value) => value;

const primitives = value => (
  value instanceof Primitive ? Primitive(value) : value
);

const Primitives = (_, value) => (
  typeof value === primitive ? new Primitive(value) : value
);

const resolver = (input, lazy, parsed, $) => output => {
  for (let ke = keys(output), {length} = ke, y = 0; y < length; y++) {
    const k = ke[y];
    const value = output[k];
    if (value instanceof Primitive) {
      const tmp = input[+value];
      if (typeof tmp === object && !parsed.has(tmp)) {
        parsed.add(tmp);
        output[k] = ignore;
        lazy.push({ o: output, k, r: tmp });
      }
      else
        output[k] = $.call(output, k, tmp);
    }
    else if (output[k] !== ignore)
      output[k] = $.call(output, k, value);
  }
  return output;
};

const set = (known, input, value) => {
  const index = Primitive(input.push(value) - 1);
  known.set(value, index);
  return index;
};

/**
 * Converts a specialized flatted string into a JS value.
 * @param {string} text
 * @param {(this: any, key: string, value: any) => any} [reviver]
 * @returns {any}
 */
export const parse = (text, reviver) => {
  const input = $parse(text, Primitives).map(primitives);
  const $ = reviver || noop;

  let value = input[0];

  if (typeof value === object && value) {
    const lazy = [];
    const revive = resolver(input, lazy, new Set, $);
    value = revive(value);

    let i = 0;
    while (i < lazy.length) {
      // it could be a lazy.shift() but that's costly
      const {o, k, r} = lazy[i++];
      o[k] = $.call(o, k, revive(r));
    }
  }

  return $.call({'': value}, '', value);
};

/**
 * Converts a JS value into a specialized flatted string.
 * @param {any} value
 * @param {((this: any, key: string, value: any) => any) | (string | number)[] | null | undefined} [replacer]
 * @param {string | number | undefined} [space]
 * @returns {string}
 */
export const stringify = (value, replacer, space) => {
  const $ = replacer && typeof replacer === object ?
            (k, v) => (k === '' || -1 < replacer.indexOf(k) ? v : void 0) :
            (replacer || noop);
  const known = new Map;
  const input = [];
  const output = [];
  let i = +set(known, input, $.call({'': value}, '', value));
  let firstRun = !i;
  while (i < input.length) {
    firstRun = true;
    output[i] = $stringify(input[i++], replace, space);
  }
  return '[' + output.join(',') + ']';
  function replace(key, value) {
    if (firstRun) {
      firstRun = !firstRun;
      return value;
    }
    const after = $.call(this, key, value);
    switch (typeof after) {
      case object:
        if (after === null) return after;
      case primitive:
        return known.get(after) || set(known, input, after);
    }
    return after;
  }
};

/**
 * Converts a generic value into a JSON serializable object without losing recursion.
 * @param {any} value
 * @returns {any}
 */
export const toJSON = value => $parse(stringify(value));

/**
 * Converts a previously serialized object with recursion into a recursive one.
 * @param {any} value
 * @returns {any}
 */
export const fromJSON = value => parse($stringify(value));
C;xC 100644 README.md AxHMis40000 pkg 7<M&_Gxx# flatted (Go)

A super light and fast circular JSON parser.

## Usage

```go
package main

import (
	"fmt"
	"github.com/WebReflection/flatted/golang/pkg/flatted"
)

type Group struct {
	Name string `json:"name"`
}

type User struct {
	Name   string `json:"name"`
	Friend *User  `json:"friend"`
	Group  *Group `json:"group"`
}

func main() {
	group := &Group{Name: "Developers"}
	alice := &User{Name: "Alice", Group: group}
	bob := &User{Name: "Bob", Group: group}

	alice.Friend = bob
	bob.Friend = alice // Circular reference

	// Stringify Alice
	s, _ := flatted.Stringify(alice)
	fmt.Println(s)
	// Output: [{"name":"Alice","friend":"1","group":"2"},{"name":"Bob","friend":"0","group":"2"},{"name":"Developers"}]

	// Flattening in action:
	// Index "0" is Alice, Index "1" is Bob, Index "2" is the shared Group.

	// Parse back into a generic map structure
	res, _ := flatted.Parse(s)
	aliceMap := res.(map[string]any)
	fmt.Println(aliceMap["name"]) // Alice
}
```

## CLI

Build the binary using the provided Makefile:

```bash
make build
```

Then use it to parse flatted JSON from stdin:

```bash
echo '[{"a":"1"},"b"]' | ./flatted
```
נlx" 40000 flatted J;4Ԋ:n#?t:ٽtx& 100644 flatted.go gxѽ>?p*++xvpackage flatted

import (
	"encoding/json"
	"reflect"
	"sort"
	"strconv"
	"strings"
)

// flattedIndex is a internal type used to distinguish between
// actual strings and flatted indices during the reconstruction phase.
type flattedIndex string

// Stringify converts a Go value into a specialized flatted JSON string.
func Stringify(value, replacer, space any) (string, error) {
	knownKeys := []any{}
	knownValues := []string{}
	input := []any{}

	index := func(v any) string {
		input = append(input, v)
		idx := strconv.Itoa(len(input) - 1)
		knownKeys = append(knownKeys, v)
		knownValues = append(knownValues, idx)
		return idx
	}

	relate := func(v any) any {
		if v == nil {
			return nil
		}
		rv := reflect.ValueOf(v)
		kind := rv.Kind()
		if kind == reflect.String || kind == reflect.Slice || kind == reflect.Map || kind == reflect.Pointer {
			for i, k := range knownKeys {
				if kind == reflect.String {
					if k == v {
						return knownValues[i]
					}
				} else {
					rk := reflect.ValueOf(k)
					if rk.Kind() == kind && rk.Pointer() == rv.Pointer() {
						return knownValues[i]
					}
				}
			}
			return index(v)
		}
		return v
	}

	transform := func(v any) any {
		rv := reflect.ValueOf(v)
		if !rv.IsValid() {
			return nil
		}
		if _, ok := v.(json.Marshaler); ok {
			return v
		}
		// Dereference pointers to process the underlying Slice, Map, or Array
		for rv.Kind() == reflect.Pointer && !rv.IsNil() {
			rv = rv.Elem()
		}
		switch rv.Kind() {
		case reflect.Slice, reflect.Array:
			res := make([]any, rv.Len())
			for i := 0; i < rv.Len(); i++ {
				res[i] = relate(rv.Index(i).Interface())
			}
			return res
		case reflect.Map:
			res := make(map[string]any)
			keys := rv.MapKeys()
			sort.Slice(keys, func(i, j int) bool {
				return keys[i].String() < keys[j].String()
			})

			whitelist, isWhitelist := replacer.([]string)
			for _, key := range keys {
				kStr := key.String()
				if isWhitelist {
					found := false
					for _, w := range whitelist {
						if w == kStr {
							found = true
							break
						}
					}
					if !found {
						continue
					}
				}
				res[kStr] = relate(rv.MapIndex(key).Interface())
			}
			return res
		case reflect.Struct:
			res := make(map[string]any)
			t := rv.Type()
			for i := 0; i < rv.NumField(); i++ {
				field := t.Field(i)
				if field.PkgPath != "" {
					continue
				}
				name := field.Name
				if tag := field.Tag.Get("json"); tag != "" {
					name = strings.Split(tag, ",")[0]
				}
				res[name] = relate(rv.Field(i).Interface())
			}
			return res
		default:
			return v
		}
	}

	index(value)
	output := []any{}
	for i := 0; i < len(input); i++ {
		output = append(output, transform(input[i]))
	}

	var b []byte
	var err error
	indent := ""
	switch v := space.(type) {
	case string:
		indent = v
	case int:
		indent = strings.Repeat(" ", v)
	}

	if indent != "" {
		b, err = json.MarshalIndent(output, "", indent)
	} else {
		b, err = json.Marshal(output)
	}

	if err != nil {
		return "", err
	}
	return string(b), nil
}

// Parse converts a specialized flatted string into a Go value.
func Parse(text string, reviver func(key string, value any) any) (any, error) {
	var jsonInput []any
	if err := json.Unmarshal([]byte(text), &jsonInput); err != nil {
		return nil, err
	}

	var wrap func(any) any
	wrap = func(v any) any {
		if s, ok := v.(string); ok {
			return flattedIndex(s)
		}
		if arr, ok := v.([]any); ok {
			for i, item := range arr {
				arr[i] = wrap(item)
			}
			return arr
		}
		if m, ok := v.(map[string]any); ok {
			for k, item := range m {
				m[k] = wrap(item)
			}
			return m
		}
		return v
	}

	wrapped := make([]any, len(jsonInput))
	for i, v := range jsonInput {
		wrapped[i] = wrap(v)
	}

	input := make([]any, len(wrapped))
	for i, v := range wrapped {
		if fi, ok := v.(flattedIndex); ok {
			input[i] = string(fi)
		} else {
			input[i] = v
		}
	}

	if len(input) == 0 {
		return nil, nil
	}

	value := input[0]
	rv := reflect.ValueOf(value)
	if rv.IsValid() && (rv.Kind() == reflect.Slice || rv.Kind() == reflect.Map) {
		set := make(map[uintptr]bool)
		set[rv.Pointer()] = true
		res := loop(value, input, set)
		if reviver != nil {
			return revive("", res, reviver), nil
		}
		return res, nil
	}

	if reviver != nil {
		return reviver("", value), nil
	}
	return value, nil
}

func revive(key string, value any, reviver func(k string, v any) any) any {
	switch v := value.(type) {
	case []any:
		for i, el := range v {
			v[i] = revive(strconv.Itoa(i), el, reviver)
		}
	case map[string]any:
		keys := make([]string, 0, len(v))
		for k := range v {
			keys = append(keys, k)
		}
		sort.Strings(keys)
		for _, k := range keys {
			v[k] = revive(k, v[k], reviver)
		}
	}
	return reviver(key, value)
}

func loop(value any, input []any, set map[uintptr]bool) any {
	if arr, ok := value.([]any); ok {
		for i, v := range arr {
			if fi, ok := v.(flattedIndex); ok {
				idx, _ := strconv.Atoi(string(fi))
				arr[i] = ref(input[idx], input, set)
			}
		}
		return arr
	}
	if m, ok := value.(map[string]any); ok {
		for k, v := range m {
			if fi, ok := v.(flattedIndex); ok {
				idx, _ := strconv.Atoi(string(fi))
				m[k] = ref(input[idx], input, set)
			}
		}
		return m
	}
	return value
}

func ref(value any, input []any, set map[uintptr]bool) any {
	rv := reflect.ValueOf(value)
	if rv.IsValid() && (rv.Kind() == reflect.Slice || rv.Kind() == reflect.Map) {
		ptr := rv.Pointer()
		if !set[ptr] {
			set[ptr] = true
			return loop(value, input, set)
		}
	}
	return value
}

// ToJSON converts a generic value into a JSON serializable object without losing recursion.
func ToJSON(value any) (any, error) {
	s, err := Stringify(value, nil, nil)
	if err != nil {
		return nil, err
	}
	var res any
	err = json.Unmarshal([]byte(s), &res)
	return res, err
}

// FromJSON converts a previously serialized object with recursion into a recursive one.
func FromJSON(value any) (any, error) {
	b, err := json.Marshal(value)
	if err != nil {
		return nil, err
	}
	return Parse(string(b), nil)
}
ۦ0䳛xLself.Flatted = (function (exports) {
  'use strict';

  function _typeof(o) {
    "@babel/helpers - typeof";

    return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
      return typeof o;
    } : function (o) {
      return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
    }, _typeof(o);
  }

  /// <reference types="../types/index.d.ts" />

  // (c) 2020-present Andrea Giammarchi

  var $parse = JSON.parse,
    $stringify = JSON.stringify;
  var keys = Object.keys;
  var Primitive = String; // it could be Number
  var primitive = 'string'; // it could be 'number'

  var ignore = {};
  var object = 'object';
  var noop = function noop(_, value) {
    return value;
  };
  var primitives = function primitives(value) {
    return value instanceof Primitive ? Primitive(value) : value;
  };
  var Primitives = function Primitives(_, value) {
    return _typeof(value) === primitive ? new Primitive(value) : value;
  };
  var resolver = function resolver(input, lazy, parsed, $) {
    return function (output) {
      for (var ke = keys(output), length = ke.length, y = 0; y < length; y++) {
        var k = ke[y];
        var value = output[k];
        if (value instanceof Primitive) {
          var tmp = input[+value];
          if (_typeof(tmp) === object && !parsed.has(tmp)) {
            parsed.add(tmp);
            output[k] = ignore;
            lazy.push({
              o: output,
              k: k,
              r: tmp
            });
          } else output[k] = $.call(output, k, tmp);
        } else if (output[k] !== ignore) output[k] = $.call(output, k, value);
      }
      return output;
    };
  };
  var set = function set(known, input, value) {
    var index = Primitive(input.push(value) - 1);
    known.set(value, index);
    return index;
  };

  /**
   * Converts a specialized flatted string into a JS value.
   * @param {string} text
   * @param {(this: any, key: string, value: any) => any} [reviver]
   * @returns {any}
   */
  var parse = function parse(text, reviver) {
    var input = $parse(text, Primitives).map(primitives);
    var $ = reviver || noop;
    var value = input[0];
    if (_typeof(value) === object && value) {
      var lazy = [];
      var revive = resolver(input, lazy, new Set(), $);
      value = revive(value);
      var i = 0;
      while (i < lazy.length) {
        // it could be a lazy.shift() but that's costly
        var _lazy$i = lazy[i++],
          o = _lazy$i.o,
          k = _lazy$i.k,
          r = _lazy$i.r;
        o[k] = $.call(o, k, revive(r));
      }
    }
    return $.call({
      '': value
    }, '', value);
  };

  /**
   * Converts a JS value into a specialized flatted string.
   * @param {any} value
   * @param {((this: any, key: string, value: any) => any) | (string | number)[] | null | undefined} [replacer]
   * @param {string | number | undefined} [space]
   * @returns {string}
   */
  var stringify = function stringify(value, replacer, space) {
    var $ = replacer && _typeof(replacer) === object ? function (k, v) {
      return k === '' || -1 < replacer.indexOf(k) ? v : void 0;
    } : replacer || noop;
    var known = new Map();
    var input = [];
    var output = [];
    var i = +set(known, input, $.call({
      '': value
    }, '', value));
    var firstRun = !i;
    while (i < input.length) {
      firstRun = true;
      output[i] = $stringify(input[i++], replace, space);
    }
    return '[' + output.join(',') + ']';
    function replace(key, value) {
      if (firstRun) {
        firstRun = !firstRun;
        return value;
      }
      var after = $.call(this, key, value);
      switch (_typeof(after)) {
        case object:
          if (after === null) return after;
        case primitive:
          return known.get(after) || set(known, input, after);
      }
      return after;
    }
  };

  /**
   * Converts a generic value into a JSON serializable object without losing recursion.
   * @param {any} value
   * @returns {any}
   */
  var toJSON = function toJSON(value) {
    return $parse(stringify(value));
  };

  /**
   * Converts a previously serialized object with recursion into a recursive one.
   * @param {any} value
   * @returns {any}
   */
  var fromJSON = function fromJSON(value) {
    return parse($stringify(value));
  };

  exports.fromJSON = fromJSON;
  exports.parse = parse;
  exports.stringify = stringify;
  exports.toJSON = toJSON;

  return exports;

})({});
hbZxPself.Flatted=function(n){"use strict";function t(n){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(n){return typeof n}:function(n){return n&&"function"==typeof Symbol&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},t(n)}var r=JSON.parse,e=JSON.stringify,o=Object.keys,u=String,f="string",i={},c="object",a=function(n,t){return t},l=function(n){return n instanceof u?u(n):n},s=function(n,r){return t(r)===f?new u(r):r},y=function(n,t,r){var e=u(t.push(r)-1);return n.set(r,e),e},p=function(n,e){var f=r(n,s).map(l),y=e||a,p=f[0];if(t(p)===c&&p){var v=[],S=function(n,r,e,f){return function(a){for(var l=o(a),s=l.length,y=0;y<s;y++){var p=l[y],v=a[p];if(v instanceof u){var S=n[+v];t(S)!==c||e.has(S)?a[p]=f.call(a,p,S):(e.add(S),a[p]=i,r.push({o:a,k:p,r:S}))}else a[p]!==i&&(a[p]=f.call(a,p,v))}return a}}(f,v,new Set,y);p=S(p);for(var b=0;b<v.length;){var m=v[b++],g=m.o,h=m.k,O=m.r;g[h]=y.call(g,h,S(O))}}return y.call({"":p},"",p)},v=function(n,r,o){for(var u=r&&t(r)===c?function(n,t){return""===n||-1<r.indexOf(n)?t:void 0}:r||a,i=new Map,l=[],s=[],p=+y(i,l,u.call({"":n},"",n)),v=!p;p<l.length;)v=!0,s[p]=e(l[p++],S,o);return"["+s.join(",")+"]";function S(n,r){if(v)return v=!v,r;var e=u.call(this,n,r);switch(t(e)){case c:if(null===e)return e;case f:return i.get(e)||y(i,l,e)}return e}};return n.fromJSON=function(n){return p(e(n))},n.parse=p,n.stringify=v,n.toJSON=function(n){return r(v(n))},n}({});^ͽx	2{
  "name": "flatted",
  "version": "3.4.4",
  "description": "A super light and fast circular JSON parser.",
  "unpkg": "min.js",
  "main": "./cjs/index.js",
  "scripts": {
    "build": "npm run cjs && npm run rollup:esm && npm run rollup:es && npm run rollup:babel && npm run min && npm run test && npm run size",
    "cjs": "ascjs esm cjs",
    "rollup:es": "rollup --config rollup/es.config.js && sed -i.bck 's/^var /self./' es.js && rm -rf es.js.bck",
    "rollup:esm": "rollup --config rollup/esm.config.js",
    "rollup:babel": "rollup --config rollup/babel.config.js && sed -i.bck 's/^var /self./' index.js && rm -rf index.js.bck",
    "min": "terser index.js -c -m -o min.js",
    "size": "cat index.js | wc -c;cat min.js | wc -c;gzip -c9 min.js | wc -c;cat min.js | brotli | wc -c; cat es.js | brotli | wc -c; cat esm.js | brotli | wc -c",
    "test": "c8 node test/index.js",
    "test:php": "php php/test.php",
    "test:py": "python python/test.py",
    "ts": "tsc -p .",
    "coverage": "mkdir -p ./coverage; c8 report --reporter=text-lcov > ./coverage/lcov.info"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/WebReflection/flatted.git"
  },
  "files": [
    "LICENSE",
    "README.md",
    "cjs/",
    "es.js",
    "esm.js",
    "esm/",
    "index.js",
    "min.js",
    "php/flatted.php",
    "python/flatted.py",
    "golang/pkg/flatted/flatted.go",
    "types/"
  ],
  "keywords": [
    "circular",
    "JSON",
    "fast",
    "parser",
    "minimal"
  ],
  "author": "Andrea Giammarchi",
  "license": "ISC",
  "bugs": {
    "url": "https://github.com/WebReflection/flatted/issues"
  },
  "homepage": "https://github.com/WebReflection/flatted#readme",
  "devDependencies": {
    "@babel/core": "^7.29.0",
    "@babel/preset-env": "^7.29.2",
    "@rollup/plugin-babel": "^7.0.0",
    "@rollup/plugin-terser": "^1.0.0",
    "@ungap/structured-clone": "^1.3.0",
    "ascjs": "^6.0.3",
    "c8": "^11.0.0",
    "circular-json": "^0.5.9",
    "circular-json-es6": "^2.0.2",
    "flatted-view": "^0.1.6",
    "jsan": "^3.1.14",
    "rollup": "^4.60.1",
    "terser": "^5.46.1",
    "typescript": "^5.9.3"
  },
  "overrides": {
    "c8": {
      "yargs": "^18.0.0"
    }
  },
  "module": "./esm/index.js",
  "type": "module",
  "exports": {
    ".": {
      "types": "./types/index.d.ts",
      "import": "./esm/index.js",
      "default": "./cjs/index.js"
    },
    "./esm": "./esm.js",
    "./package.json": "./package.json"
  },
  "types": "./types/index.d.ts"
}
lSx' 100644 flatted.php "ejtlw͉HP_Owr=x<?php

/*!
 * ISC License
 * 
 * Copyright (c) 2018-2021, Andrea Giammarchi, @WebReflection
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice appear in all copies.
 *
 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
 * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */

class FlattedString {
  public $value = '';
  public function __construct($value) {
    $this->value = $value;
  }
}

class Flatted {

  // public utilities
  public static function parse($json, $assoc = false, $depth = 512, $options = 0) {
    $input = array_map(
      'Flatted::asString',
      array_map(
        'Flatted::wrap',
        json_decode($json, $assoc, $depth, $options)
      )
    );
    $value = &$input[0];
    $set = array();
    $set[] = &$value;
    if (is_array($value))
      return Flatted::loop(false, array_keys($value), $input, $set, $value);
    if (is_object($value))
      return Flatted::loop(true, Flatted::keys($value), $input, $set, $value);
    return $value;
  }

  public static function stringify($value, $options = 0, $depth = 512) {
    $known = new stdClass;
    $known->key = array();
    $known->value = array();
    $input = array();
    $output = array();
    $i = intval(Flatted::index($known, $input, $value));
    while ($i < count($input)) {
      $output[$i] = Flatted::transform($known, $input, $input[$i]);
      $i++;
    }
    return json_encode($output, $options, $depth);
  }

  // private helpers
  private static function asString($value) {
    return $value instanceof FlattedString ? $value->value : $value;
  }

  private static function index(&$known, &$input, &$value) {
    $input[] = &$value;
    $index = strval(count($input) - 1);
    $known->key[] = &$value;
    $known->value[] = &$index;
    return $index;
  }

  private static function keys(&$value) {
    $obj = new ReflectionObject($value);
    $props = $obj->getProperties();
    $keys = array();
    foreach ($props as $prop)
      $keys[] = $prop->getName();
    return $keys;
  }

  private static function loop($obj, $keys, &$input, &$set, &$output) {
    foreach ($keys as $key) {
      $value = $obj ? $output->$key : $output[$key];
      if ($value instanceof FlattedString)
        Flatted::ref($obj, $key, $input[$value->value], $input, $set, $output);
    }
    return $output;
  }

  private static function relate(&$known, &$input, &$value) {
    if (is_string($value) || is_array($value) || is_object($value)) {
      $key = array_search($value, $known->key, true);
      if ($key !== false)
        return $known->value[$key];
      return Flatted::index($known, $input, $value);
    }
    return $value;
  }

  private static function ref($obj, &$key, &$value, &$input, &$set, &$output) {
    if (is_array($value) && !in_array($value, $set, true)) {
      $set[] = $value;
      $value = Flatted::loop(false, array_keys($value), $input, $set, $value);
    }
    elseif (is_object($value) && !in_array($value, $set, true)) {
      $set[] = $value;
      $value = Flatted::loop(true, Flatted::keys($value), $input, $set, $value);
    }
    if ($obj) {
      $output->$key = &$value;
    }
    else {
      $output[$key] = &$value;
    }
  }

  private static function transform(&$known, &$input, &$value) {
    if (is_array($value)) {
      return array_map(
        function ($value) use(&$known, &$input) {
          return Flatted::relate($known, $input, $value);
        },
        $value
      );
    }
    if (is_object($value)) {
      $object = new stdClass;
      $keys = Flatted::keys($value);
      foreach ($keys as $key)
        $object->$key = Flatted::relate($known, $input, $value->$key);
      return $object;
    }
    return $value;
  }

  private static function wrap($value) {
    if (is_string($value)) {
      return new FlattedString($value);
    }
    if (is_array($value)) {
      return array_map('Flatted::wrap', $value);
    }
    if (is_object($value)) {
      $keys = Flatted::keys($value);
      foreach ($keys as $key) {
        $value->$key = self::wrap($value->$key);
      }
    }
    return $value;
  }
}
?>c/d4x& 100644 flatted.py &Ԯ9ʦW|Vs|xB# ISC License
#
# Copyright (c) 2018-2025, Andrea Giammarchi, @WebReflection
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
# REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
# AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
# INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
# LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.

import json as _json

class _Known:
    def __init__(self):
        self.key = []
        self.value = []

class _String:
    def __init__(self, value):
        self.value = value

def _array_keys(value):
    for i in range(len(value)):
        yield i

def _object_keys(value):
    for key in value:
        yield key

def _is_array(value):
    return isinstance(value, (list, tuple))

def _is_object(value):
    return isinstance(value, dict)

def _is_string(value):
    return isinstance(value, str)

def _index(known, input, value):
    input.append(value)
    index = str(len(input) - 1)
    known.key.append(value)
    known.value.append(index)
    return index

def _relate(known, input, value):
    if _is_string(value) or _is_array(value) or _is_object(value):
        try:
            return known.value[known.key.index(value)]
        except:
            return _index(known, input, value)

    return value

def _resolver(input, lazy, parsed):
    def resolver(output):
        keys = _array_keys(output) if _is_array(output) else _object_keys(output) if _is_object(output) else []
        for key in keys:
            value = output[key]
            if isinstance(value, _String):
                tmp = input[int(value.value)]
                output[key] = tmp
                if (_is_array(tmp) or _is_object(tmp)) and tmp not in parsed:
                    parsed.append(tmp)
                    lazy.append([output, key])

        return output

    return resolver

def _transform(known, input, value):
    if _is_array(value):
        output = []
        for val in value:
            output.append(_relate(known, input, val))
        return output

    if _is_object(value):
        obj = {}
        for key in value:
            obj[key] = _relate(known, input, value[key])
        return obj

    return value

def _wrap(value):
    if _is_string(value):
        return _String(value)

    if _is_array(value):
        i = 0
        for val in value:
            value[i] = _wrap(val)
            i += 1

    elif _is_object(value):
        for key in value:
            value[key] = _wrap(value[key])

    return value

def parse(value, *args, **kwargs):
    json = _json.loads(value, *args, **kwargs)
    wrapped = []
    for value in json:
        wrapped.append(_wrap(value))

    input = []
    for value in wrapped:
        if isinstance(value, _String):
            input.append(value.value)
        else:
            input.append(value)

    value = input[0]
    lazy = []
    revive = _resolver(input, lazy, [value])

    value = revive(value)

    i = 0
    while i < len(lazy):
        o, k = lazy[i]
        i += 1
        o[k] = revive(o[k])

    return value


def stringify(value, *args, **kwargs):
    known = _Known()
    input = []
    output = []
    i = int(_index(known, input, value))
    while i < len(input):
        output.append(_transform(known, input, input[i]))
        i += 1
    return _json.dumps(output, *args, **kwargs)
fvx& 100644 index.d.ts ga)nt#
k$Ccxlexport function parse(text: string, reviver?: (this: any, key: string, value: any) => any): any;
export function stringify(value: any, replacer?: (string | number)[] | null | undefined | ((this: any, key: string, value: any) => any), space?: string | number | undefined): string;
export function toJSON(value: any): any;
export function fromJSON(value: any): any;
P~x9100644 .npmignore X{BxLm"kb5=100644 Makefile le2Jюuk+100644 Readme.md Qni~$4i{??C100644 component.json QimHRE2J8100644 format-min.js 8f<ӝ.: nU2X100644 format.js w*yt]41dcW!k;100644 package.json \.U.dD`100644 test_format.js uMSll	:+xv9x	 *.tmproj
x minify: real-minify test-minified

real-minify: format.js
	rm -f format-min.js
	closure <format.js >|format-min.js

test:
	node test_format.js

test-minified:
	node test_format.js ./format-min.js

.PHONY: test test-minified
NAxformat
======

printf, sprintf, and vsprintf for JavaScript


Installation
============

npm install format

The code works in browsers as well, you can copy these functions into your project
or otherwise include them with your other JavaScript.

Usage
=====

    var format = require('format')
      , printf = format.printf
      , vsprintf = format.vsprintf
      // or if you want to keep it old school
      , sprintf = format

    // Print 'hello world'
    printf('%s world', 'hello')

    var what = 'life, the universe, and everything'
    format('%d is the answer to %s', 42, what)
    // => '42 is the answer to life, the universe, and everything'

    vsprintf('%d is the answer to %s', [42, what])
    // => '42 is the answer to life, the universe, and everything'

Supported format specifiers: b, c, d, f, o, s, x, and X.

See `man 3 printf` or `man 1 printf` for details.

Precision is supported for floating point numbers.

License
=======

Copyright 2010 - 2014 Sami Samhuri sami@samhuri.net

[MIT license](http://sjs.mit-license.org)

ISx{
  "name": "format",
  "repo": "samsonjs/format",
  "description": "printf, sprintf, and vsprintf for JavaScript",
  "keywords": ["format", "printf", "sprintf", "vsprintf", "string"],
  "version": "0.2.2",
  "main": "format.js",
  "scripts": ["format.js"]
}
P@x(function(){function f(){console.log(e.apply(null,arguments))}function e(h){for(var e=1,d=[].slice.call(arguments),g=0,f=h.length,a="",b,i=!1,j,c=function(){return d[e++]},k=function(){for(var a="";h[g].match(/\d/);)a+=h[g++];return a.length>0?parseInt(a):null};g<f;++g)if(b=h[g],i)switch(i=!1,j=k(),b){case "b":a+=parseInt(c(),10).toString(2);break;case "c":b=c();a+=typeof b==="string"||b instanceof String?b:String.fromCharCode(parseInt(b,10));break;case "d":a+=parseInt(c(),10);break;case "f":a+=parseFloat(c()).toFixed(j||
6);break;case "o":a+="0"+parseInt(c(),10).toString(8);break;case "s":a+=c();break;case "x":a+="0x"+parseInt(c(),10).toString(16);break;case "X":a+="0x"+parseInt(c(),10).toString(16).toUpperCase();break;default:a+=b}else b==="%"?i=!0:a+=b;return a}var d;d=typeof module!=="undefined"?module.exports=e:function(){return this||(0,eval)("this")}();d.format=e;d.vsprintf=function(d,f){return e.apply(null,[d].concat(f))};if(typeof console!=="undefined"&&typeof console.log==="function")d.printf=f})();
Vx//
// format - printf-like string formatting for JavaScript
// github.com/samsonjs/format
// @_sjs
//
// Copyright 2010 - 2013 Sami Samhuri <sami@samhuri.net>
//
// MIT License
// http://sjs.mit-license.org
//

;(function() {

  //// Export the API
  var namespace;

  // CommonJS / Node module
  if (typeof module !== 'undefined') {
    namespace = module.exports = format;
  }

  // Browsers and other environments
  else {
    // Get the global object. Works in ES3, ES5, and ES5 strict mode.
    namespace = (function(){ return this || (1,eval)('this') }());
  }

  namespace.format = format;
  namespace.vsprintf = vsprintf;

  if (typeof console !== 'undefined' && typeof console.log === 'function') {
    namespace.printf = printf;
  }

  function printf(/* ... */) {
    console.log(format.apply(null, arguments));
  }

  function vsprintf(fmt, replacements) {
    return format.apply(null, [fmt].concat(replacements));
  }

  function format(fmt) {
    var argIndex = 1 // skip initial format argument
      , args = [].slice.call(arguments)
      , i = 0
      , n = fmt.length
      , result = ''
      , c
      , escaped = false
      , arg
      , tmp
      , leadingZero = false
      , precision
      , nextArg = function() { return args[argIndex++]; }
      , slurpNumber = function() {
          var digits = '';
          while (/\d/.test(fmt[i])) {
            digits += fmt[i++];
            c = fmt[i];
          }
          return digits.length > 0 ? parseInt(digits) : null;
        }
      ;
    for (; i < n; ++i) {
      c = fmt[i];
      if (escaped) {
        escaped = false;
        if (c == '.') {
          leadingZero = false;
          c = fmt[++i];
        }
        else if (c == '0' && fmt[i + 1] == '.') {
          leadingZero = true;
          i += 2;
          c = fmt[i];
        }
        else {
          leadingZero = true;
        }
        precision = slurpNumber();
        switch (c) {
        case 'b': // number in binary
          result += parseInt(nextArg(), 10).toString(2);
          break;
        case 'c': // character
          arg = nextArg();
          if (typeof arg === 'string' || arg instanceof String)
            result += arg;
          else
            result += String.fromCharCode(parseInt(arg, 10));
          break;
        case 'd': // number in decimal
          result += parseInt(nextArg(), 10);
          break;
        case 'f': // floating point number
          tmp = String(parseFloat(nextArg()).toFixed(precision || 6));
          result += leadingZero ? tmp : tmp.replace(/^0/, '');
          break;
        case 'j': // JSON
          result += JSON.stringify(nextArg());
          break;
        case 'o': // number in octal
          result += '0' + parseInt(nextArg(), 10).toString(8);
          break;
        case 's': // string
          result += nextArg();
          break;
        case 'x': // lowercase hexadecimal
          result += '0x' + parseInt(nextArg(), 10).toString(16);
          break;
        case 'X': // uppercase hexadecimal
          result += '0x' + parseInt(nextArg(), 10).toString(16).toUpperCase();
          break;
        default:
          result += c;
          break;
        }
      } else if (c === '%') {
        escaped = true;
      } else {
        result += c;
      }
    }
    return result;
  }

}());
0ǜ)&xd{
  "name": "format",
  "description": "printf, sprintf, and vsprintf for JavaScript",
  "version": "0.2.2",
  "homepage": "http://samhuri.net/proj/format",
  "author": "Sami Samhuri <sami@samhuri.net>",
  "repository": {
    "type": "git",
    "url": "git://github.com/samsonjs/format.git"
  },
  "bugs": {
    "email": "sami@samhuri.net",
    "url": "https://github.com/samsonjs/format/issues"
  },
  "main": "./format.js",
  "engines": {
    "node": ">=0.4.x"
  },
  "licenses": [
    {
      "type": "MIT",
      "url": "http://sjs.mit-license.org"
    }
  ],
  "dependencies": {},
  "devDependencies": {}
}
hbx!var filename = process.argv[2] || './format.js'
  , format = require(filename)
  , printf = format.printf
  ;

function desc(x, indentLevel) {
  indentLevel = indentLevel || 0;
  var indent = new Array(indentLevel).join('  ');
  if (typeof x == 'string' || (x && x.__proto__ == String.prototype)) {
    return indent + '"' + x + '"';
  }
  else if (Array.isArray(x)) {
    return indent + '[ ' + x.map(desc).join(', ') + ' ]';
  }
  else {
    return '' + x;
  }
}

function assertFormat(args, expected) {
  var fmt = args[0];
  var result = format.format.apply(format, args);
  if (result !== expected) {
    console.log('FORMAT: "' + fmt + '"');
    console.log('ARGS:   ' + desc(args.slice(1)));
    console.log('RESULT: "' + result + '"');
    throw new Error('assertion failed, ' + result + ' !== ' + expected);
  }
}

console.log('Testing format:');

var tests = [
  [['hello'], 'hello'],
  [['hello %s', 'sami'], 'hello sami'],
  [
    ['b: %b\nc: %c\nd: %d\nf: %f\no: %o\ns: %s\nx: %x\nX: %X', 42, 65, 42*42, 42*42*42/1000000000, 255, 'sami', 0xfeedface, 0xc0ffee],
    "b: 101010\nc: A\nd: 1764\nf: 0.000074\no: 0377\ns: sami\nx: 0xfeedface\nX: 0xC0FFEE"
  ],
  [['%.2f', 3.14159], '3.14'],
  [['%0.2f', 3.14159], '3.14'],
  [['%.2f', 0.1234], '.12'],
  [['%0.2f', 0.1234], '0.12'],
  [['foo %j', 42], 'foo 42'],
  [['foo %j', '42'], 'foo "42"']
];
tests.forEach(function(spec) {
  var args = spec[0];
  var expected = spec[1];
  assertFormat(args, expected);
  console.log('pass (format ' + args[0] + ' == ' + expected + ')');
});

console.log('all passed');
svx100644 LICENSE sI<)3ۨvA100644 README.md +h16Jk4.1E100644 index.d.ts @G|ʚgr
B$100644 index.js ܌?`ej$;{.100644 package.json Վmdurޥi)Ǩ0T100644 regex.d.ts v-
OumǠ{100644 regex.js k0d|:⛽8[f.xCopyright (c) 2015, Dan Flettre <fletd01@yahoo.com>

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
UBsx8# github-slugger

[![npm][npm-image]][npm-url]
[![Build][build-badge]][build]

[npm-image]: https://img.shields.io/npm/v/github-slugger.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/github-slugger
[build-badge]: https://github.com/Flet/github-slugger/workflows/main/badge.svg
[build]: https://github.com/Flet/github-slugger/actions

Generate a slug just like GitHub does for markdown headings. It also ensures slugs are unique in the same way GitHub does it. The overall goal of this package is to emulate the way GitHub handles generating markdown heading anchors as close as possible.

This project is not a markdown or HTML parser: passing `alpha *bravo* charlie`
or `alpha <em>bravo</em> charlie` doesn’t work.
Instead pass the plain text value of the heading: `alpha bravo charlie`.

## Install

```
npm install github-slugger
```

## Usage

```js
import GithubSlugger from 'github-slugger'

const slugger = new GithubSlugger()

slugger.slug('foo')
// returns 'foo'

slugger.slug('foo')
// returns 'foo-1'

slugger.slug('bar')
// returns 'bar'

slugger.slug('foo')
// returns 'foo-2'

slugger.slug('Привет non-latin 你好')
// returns 'привет-non-latin-你好'

slugger.slug('😄 emoji')
// returns '-emoji'

slugger.reset()

slugger.slug('foo')
// returns 'foo'
```

Check [`test/fixtures.json`](test/fixtures.json) for more examples.

If you need, you can also use the underlying implementation which does not keep
track of the previously slugged strings (not recommended):

```js
import GithubSlugger, {slug} from 'github-slugger'

slug('foo bar baz')
// returns 'foo-bar-baz'

slug('foo bar baz')
// returns the same slug 'foo-bar-baz' because it does not keep track
```

## Contributing

Contributions welcome! Please read the [contributing guidelines](CONTRIBUTING.md) first.

## License

[ISC](LICENSE)
I7Nx/**
 * Generate a slug.
 *
 * Does not track previously generated slugs: repeated calls with the same value
 * will result in the exact same slug.
 * Use the `GithubSlugger` class to get unique slugs.
 *
 * @param  {string} value
 *   String of text to slugify
 * @param  {boolean} [maintainCase=false]
 *   Keep the current case, otherwise make all lowercase
 * @return {string}
 *   A unique slug string
 */
export function slug(value: string, maintainCase?: boolean | undefined): string;
/**
 * Slugger.
 */
export default class BananaSlug {
    /** @type {Record<string, number>} */
    occurrences: Record<string, number>;
    /**
     * Generate a unique slug.
    *
    * Tracks previously generated slugs: repeated calls with the same value
    * will result in different slugs.
    * Use the `slug` function to get same slugs.
     *
     * @param  {string} value
     *   String of text to slugify
     * @param  {boolean} [maintainCase=false]
     *   Keep the current case, otherwise make all lowercase
     * @return {string}
     *   A unique slug string
     */
    slug(value: string, maintainCase?: boolean | undefined): string;
    /**
     * Reset - Forget all previous slugs
     *
     * @return void
     */
    reset(): void;
}
f;sx3import { regex } from './regex.js'

const own = Object.hasOwnProperty

/**
 * Slugger.
 */
export default class BananaSlug {
  /**
   * Create a new slug class.
   */
  constructor () {
    /** @type {Record<string, number>} */
    // eslint-disable-next-line no-unused-expressions
    this.occurrences

    this.reset()
  }

  /**
   * Generate a unique slug.
  *
  * Tracks previously generated slugs: repeated calls with the same value
  * will result in different slugs.
  * Use the `slug` function to get same slugs.
   *
   * @param  {string} value
   *   String of text to slugify
   * @param  {boolean} [maintainCase=false]
   *   Keep the current case, otherwise make all lowercase
   * @return {string}
   *   A unique slug string
   */
  slug (value, maintainCase) {
    const self = this
    let result = slug(value, maintainCase === true)
    const originalSlug = result

    while (own.call(self.occurrences, result)) {
      self.occurrences[originalSlug]++
      result = originalSlug + '-' + self.occurrences[originalSlug]
    }

    self.occurrences[result] = 0

    return result
  }

  /**
   * Reset - Forget all previous slugs
   *
   * @return void
   */
  reset () {
    this.occurrences = Object.create(null)
  }
}

/**
 * Generate a slug.
 *
 * Does not track previously generated slugs: repeated calls with the same value
 * will result in the exact same slug.
 * Use the `GithubSlugger` class to get unique slugs.
 *
 * @param  {string} value
 *   String of text to slugify
 * @param  {boolean} [maintainCase=false]
 *   Keep the current case, otherwise make all lowercase
 * @return {string}
 *   A unique slug string
 */
export function slug (value, maintainCase) {
  if (typeof value !== 'string') return ''
  if (!maintainCase) value = value.toLowerCase()
  return value.replace(regex, '').replace(/ /g, '-')
}
dTtxC{
  "name": "github-slugger",
  "description": "Generate a slug just like GitHub does for markdown headings.",
  "version": "2.0.0",
  "author": "Dan Flettre <flettre@gmail.com>",
  "contributors": [
    "Dan Flettre <flettre@gmail.com>",
    "Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)"
  ],
  "bugs": {
    "url": "https://github.com/Flet/github-slugger/issues"
  },
  "type": "module",
  "main": "index.js",
  "types": "index.d.ts",
  "files": [
    "index.d.ts",
    "index.js",
    "regex.d.ts",
    "regex.js"
  ],
  "devDependencies": {
    "@octokit/rest": "^19.0.0",
    "@types/regenerate": "^1.0.0",
    "@types/tape": "^4.0.0",
    "@unicode/unicode-13.0.0": "^1.0.0",
    "c8": "^7.0.0",
    "hast-util-select": "^5.0.0",
    "mdast-util-gfm": "^2.0.0",
    "mdast-util-to-markdown": "^1.0.0",
    "node-fetch": "^3.0.0",
    "regenerate": "^1.0.0",
    "rehype-parse": "^8.0.0",
    "rimraf": "^3.0.0",
    "standard": "*",
    "tap-spec": "^5.0.0",
    "tape": "^5.0.0",
    "type-coverage": "^2.0.0",
    "typescript": "^4.0.0",
    "unified": "^10.0.0"
  },
  "homepage": "https://github.com/Flet/github-slugger",
  "keywords": [
    "anchor",
    "github",
    "hash",
    "heading",
    "markdown",
    "slug",
    "slugger",
    "url"
  ],
  "license": "ISC",
  "repository": {
    "type": "git",
    "url": "https://github.com/Flet/github-slugger.git"
  },
  "scripts": {
    "prepack": "npm run build && npm run format",
    "build": "rimraf \"{script,test}/**/*.d.ts\" \"*.d.ts\" && tsc && type-coverage",
    "format": "standard --fix",
    "test-api": "tape test | tap-spec",
    "test-coverage": "c8 --check-coverage --100 --reporter lcov npm run test-api",
    "test": "npm run build && npm run format && npm run test-coverage"
  },
  "typeCoverage": {
    "atLeast": 100,
    "detail": true,
    "strict": true
  }
}
x export const regex: RegExp;

x ~// This module is generated by `script/`.
/* eslint-disable no-control-regex, no-misleading-character-class, no-useless-escape */
export const regex = /[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0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104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC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B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g
rv	x k100644 LICENSE $MTS@+F#100644 README.md jU~qn.100644 index.js 	K,tfkZp100644 package.json !z6P+T:85xYThe ISC License

Copyright (c) 2015, 2019 Elan Shanker, 2021 Blaine Bublitz <blaine.bublitz@gmail.com>, Eric Schoffstall <yo@contra.io> and other contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
oxf<p align="center">
  <a href="https://gulpjs.com">
    <img height="257" width="114" src="https://raw.githubusercontent.com/gulpjs/artwork/master/gulp-2x.png">
  </a>
</p>

# glob-parent

[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Coveralls Status][coveralls-image]][coveralls-url]

Extract the non-magic parent path from a glob string.

## Usage

```js
var globParent = require('glob-parent');

globParent('path/to/*.js'); // 'path/to'
globParent('/root/path/to/*.js'); // '/root/path/to'
globParent('/*.js'); // '/'
globParent('*.js'); // '.'
globParent('**/*.js'); // '.'
globParent('path/{to,from}'); // 'path'
globParent('path/!(to|from)'); // 'path'
globParent('path/?(to|from)'); // 'path'
globParent('path/+(to|from)'); // 'path'
globParent('path/*(to|from)'); // 'path'
globParent('path/@(to|from)'); // 'path'
globParent('path/**/*'); // 'path'

// if provided a non-glob path, returns the nearest dir
globParent('path/foo/bar.js'); // 'path/foo'
globParent('path/foo/'); // 'path/foo'
globParent('path/foo'); // 'path' (see issue #3 for details)
```

## API

### `globParent(maybeGlobString, [options])`

Takes a string and returns the part of the path before the glob begins. Be aware of Escaping rules and Limitations below.

#### options

```js
{
  // Disables the automatic conversion of slashes for Windows
  flipBackslashes: true;
}
```

## Escaping

The following characters have special significance in glob patterns and must be escaped if you want them to be treated as regular path characters:

- `?` (question mark) unless used as a path segment alone
- `*` (asterisk)
- `|` (pipe)
- `(` (opening parenthesis)
- `)` (closing parenthesis)
- `{` (opening curly brace)
- `}` (closing curly brace)
- `[` (opening bracket)
- `]` (closing bracket)

**Example**

```js
globParent('foo/[bar]/'); // 'foo'
globParent('foo/\\[bar]/'); // 'foo/[bar]'
```

## Limitations

### Braces & Brackets

This library attempts a quick and imperfect method of determining which path
parts have glob magic without fully parsing/lexing the pattern. There are some
advanced use cases that can trip it up, such as nested braces where the outer
pair is escaped and the inner one contains a path separator. If you find
yourself in the unlikely circumstance of being affected by this or need to
ensure higher-fidelity glob handling in your library, it is recommended that you
pre-process your input with [expand-braces] and/or [expand-brackets].

### Windows

Backslashes are not valid path separators for globs. If a path with backslashes
is provided anyway, for simple cases, glob-parent will replace the path
separator for you and return the non-glob parent path (now with
forward-slashes, which are still valid as Windows path separators).

This cannot be used in conjunction with escape characters.

```js
// BAD
globParent('C:\\Program Files \\(x86\\)\\*.ext'); // 'C:/Program Files /(x86/)'

// GOOD
globParent('C:/Program Files\\(x86\\)/*.ext'); // 'C:/Program Files (x86)'
```

If you are using escape characters for a pattern without path parts (i.e.
relative to `cwd`), prefix with `./` to avoid confusing glob-parent.

```js
// BAD
globParent('foo \\[bar]'); // 'foo '
globParent('foo \\[bar]*'); // 'foo '

// GOOD
globParent('./foo \\[bar]'); // 'foo [bar]'
globParent('./foo \\[bar]*'); // '.'
```

## License

ISC

<!-- prettier-ignore-start -->
[downloads-image]: https://img.shields.io/npm/dm/glob-parent.svg?style=flat-square
[npm-url]: https://www.npmjs.com/package/glob-parent
[npm-image]: https://img.shields.io/npm/v/glob-parent.svg?style=flat-square

[ci-url]: https://github.com/gulpjs/glob-parent/actions?query=workflow:dev
[ci-image]: https://img.shields.io/github/workflow/status/gulpjs/glob-parent/dev?style=flat-square

[coveralls-url]: https://coveralls.io/r/gulpjs/glob-parent
[coveralls-image]: https://img.shields.io/coveralls/gulpjs/glob-parent/master.svg?style=flat-square
<!-- prettier-ignore-end -->

<!-- prettier-ignore-start -->
[expand-braces]: https://github.com/jonschlinkert/expand-braces
[expand-brackets]: https://github.com/jonschlinkert/expand-brackets
<!-- prettier-ignore-end -->
jȾdxN'use strict';

var isGlob = require('is-glob');
var pathPosixDirname = require('path').posix.dirname;
var isWin32 = require('os').platform() === 'win32';

var slash = '/';
var backslash = /\\/g;
var escaped = /\\([!*?|[\](){}])/g;

/**
 * @param {string} str
 * @param {Object} opts
 * @param {boolean} [opts.flipBackslashes=true]
 */
module.exports = function globParent(str, opts) {
  var options = Object.assign({ flipBackslashes: true }, opts);

  // flip windows path separators
  if (options.flipBackslashes && isWin32 && str.indexOf(slash) < 0) {
    str = str.replace(backslash, slash);
  }

  // special case for strings ending in enclosure containing path separator
  if (isEnclosure(str)) {
    str += slash;
  }

  // preserves full path in case of trailing path separator
  str += 'a';

  // remove path parts that are globby
  do {
    str = pathPosixDirname(str);
  } while (isGlobby(str));

  // remove escape chars and return result
  return str.replace(escaped, '$1');
};

function isEnclosure(str) {
  var lastChar = str.slice(-1);

  var enclosureStart;
  switch (lastChar) {
    case '}':
      enclosureStart = '{';
      break;
    case ']':
      enclosureStart = '[';
      break;
    default:
      return false;
  }

  var foundIndex = str.indexOf(enclosureStart);
  if (foundIndex < 0) {
    return false;
  }

  return str.slice(foundIndex + 1, -1).includes(slash);
}

function isGlobby(str) {
  if (/\([^()]+$/.test(str)) {
    return true;
  }
  if (str[0] === '{' || str[0] === '[') {
    return true;
  }
  if (/[^\\][{[]/.test(str)) {
    return true;
  }
  return isGlob(str);
}
L Ax{
  "name": "glob-parent",
  "version": "6.0.2",
  "description": "Extract the non-magic parent path from a glob string.",
  "author": "Gulp Team <team@gulpjs.com> (https://gulpjs.com/)",
  "contributors": [
    "Elan Shanker (https://github.com/es128)",
    "Blaine Bublitz <blaine.bublitz@gmail.com>"
  ],
  "repository": "gulpjs/glob-parent",
  "license": "ISC",
  "engines": {
    "node": ">=10.13.0"
  },
  "main": "index.js",
  "files": [
    "LICENSE",
    "index.js"
  ],
  "scripts": {
    "lint": "eslint .",
    "pretest": "npm run lint",
    "test": "nyc mocha --async-only"
  },
  "dependencies": {
    "is-glob": "^4.0.3"
  },
  "devDependencies": {
    "eslint": "^7.0.0",
    "eslint-config-gulp": "^5.0.0",
    "expect": "^26.0.1",
    "mocha": "^7.1.2",
    "nyc": "^15.0.1"
  },
  "nyc": {
    "reporter": [
      "lcov",
      "text-summary"
    ]
  },
  "prettier": {
    "singleQuote": true
  },
  "keywords": [
    "glob",
    "parent",
    "strip",
    "path",
    "dirname",
    "directory",
    "base",
    "wildcard"
  ]
}
{5"jx 100644 globals.json 757Hʮ100644 index.d.ts "qjlf%y100644 index.js QX.Av`ɓ#=[100644 license |JW?z100644 package.json CYdra100644 readme.md 4_A9yXY]93x   {
	"amd": {
		"define": false,
		"require": false
	},
	"applescript": {
		"$": false,
		"Application": false,
		"Automation": false,
		"console": false,
		"delay": false,
		"Library": false,
		"ObjC": false,
		"ObjectSpecifier": false,
		"Path": false,
		"Progress": false,
		"Ref": false
	},
	"astro": {
		"Astro": false
	},
	"atomtest": {
		"advanceClock": false,
		"atom": false,
		"fakeClearInterval": false,
		"fakeClearTimeout": false,
		"fakeSetInterval": false,
		"fakeSetTimeout": false,
		"resetTimeouts": false,
		"waitsForPromise": false
	},
	"audioWorklet": {
		"AbortController": false,
		"AbortSignal": false,
		"AudioWorkletGlobalScope": false,
		"AudioWorkletProcessor": false,
		"ByteLengthQueuingStrategy": false,
		"CompressionStream": false,
		"console": false,
		"CountQueuingStrategy": false,
		"CSSImageValue": false,
		"CSSKeywordValue": false,
		"CSSMathClamp": false,
		"CSSMathInvert": false,
		"CSSMathMax": false,
		"CSSMathMin": false,
		"CSSMathNegate": false,
		"CSSMathProduct": false,
		"CSSMathSum": false,
		"CSSMathValue": false,
		"CSSNumericArray": false,
		"CSSNumericValue": false,
		"CSSStyleValue": false,
		"CSSUnitValue": false,
		"CSSUnparsedValue": false,
		"CSSVariableReferenceValue": false,
		"currentFrame": false,
		"currentTime": false,
		"DecompressionStream": false,
		"Event": false,
		"EventTarget": false,
		"MessageEvent": false,
		"MessagePort": false,
		"PaintWorkletGlobalScope": false,
		"port": false,
		"QuotaExceededError": false,
		"ReadableByteStreamController": false,
		"ReadableStream": false,
		"ReadableStreamBYOBReader": false,
		"ReadableStreamBYOBRequest": false,
		"ReadableStreamDefaultController": false,
		"ReadableStreamDefaultReader": false,
		"registerProcessor": false,
		"sampleRate": false,
		"StylePropertyMapReadOnly": false,
		"Temporal": false,
		"TextDecoderStream": false,
		"TextEncoderStream": false,
		"TransformStream": false,
		"TransformStreamDefaultController": false,
		"UserActivation": false,
		"WebAssembly": false,
		"WorkletGlobalScope": false,
		"WritableStream": false,
		"WritableStreamDefaultController": false,
		"WritableStreamDefaultWriter": false
	},
	"browser": {
		"AbortController": false,
		"AbortSignal": false,
		"AbsoluteOrientationSensor": false,
		"AbstractRange": false,
		"Accelerometer": false,
		"addEventListener": false,
		"ai": false,
		"AI": false,
		"AICreateMonitor": false,
		"AITextSession": false,
		"alert": false,
		"AnalyserNode": false,
		"Animation": false,
		"AnimationEffect": false,
		"AnimationEvent": false,
		"AnimationPlaybackEvent": false,
		"AnimationTimeline": false,
		"atob": false,
		"Attr": false,
		"Audio": false,
		"AudioBuffer": false,
		"AudioBufferSourceNode": false,
		"AudioContext": false,
		"AudioData": false,
		"AudioDecoder": false,
		"AudioDestinationNode": false,
		"AudioEncoder": false,
		"AudioListener": false,
		"AudioNode": false,
		"AudioParam": false,
		"AudioParamMap": false,
		"AudioPlaybackStats": false,
		"AudioProcessingEvent": false,
		"AudioScheduledSourceNode": false,
		"AudioSinkInfo": false,
		"AudioWorklet": false,
		"AudioWorkletNode": false,
		"AuthenticatorAssertionResponse": false,
		"AuthenticatorAttestationResponse": false,
		"AuthenticatorResponse": false,
		"BackgroundFetchManager": false,
		"BackgroundFetchRecord": false,
		"BackgroundFetchRegistration": false,
		"BarcodeDetector": false,
		"BarProp": false,
		"BaseAudioContext": false,
		"BatteryManager": false,
		"BeforeUnloadEvent": false,
		"BiquadFilterNode": false,
		"Blob": false,
		"BlobEvent": false,
		"Bluetooth": false,
		"BluetoothCharacteristicProperties": false,
		"BluetoothDevice": false,
		"BluetoothRemoteGATTCharacteristic": false,
		"BluetoothRemoteGATTDescriptor": false,
		"BluetoothRemoteGATTServer": false,
		"BluetoothRemoteGATTService": false,
		"BluetoothUUID": false,
		"blur": false,
		"BroadcastChannel": false,
		"BrowserCaptureMediaStreamTrack": false,
		"btoa": false,
		"ByteLengthQueuingStrategy": false,
		"Cache": false,
		"caches": false,
		"CacheStorage": false,
		"cancelAnimationFrame": false,
		"cancelIdleCallback": false,
		"CanvasCaptureMediaStream": false,
		"CanvasCaptureMediaStreamTrack": false,
		"CanvasGradient": false,
		"CanvasPattern": false,
		"CanvasRenderingContext2D": false,
		"CaptureController": false,
		"CaretPosition": false,
		"CDATASection": false,
		"ChannelMergerNode": false,
		"ChannelSplitterNode": false,
		"ChapterInformation": false,
		"CharacterBoundsUpdateEvent": false,
		"CharacterData": false,
		"clearInterval": false,
		"clearTimeout": false,
		"clientInformation": false,
		"Clipboard": false,
		"ClipboardChangeEvent": false,
		"ClipboardEvent": false,
		"ClipboardItem": false,
		"close": false,
		"closed": false,
		"CloseEvent": false,
		"CloseWatcher": false,
		"CommandEvent": false,
		"Comment": false,
		"CompositionEvent": false,
		"CompressionStream": false,
		"confirm": false,
		"console": false,
		"ConstantSourceNode": false,
		"ContentVisibilityAutoStateChangeEvent": false,
		"ConvolverNode": false,
		"CookieChangeEvent": false,
		"CookieDeprecationLabel": false,
		"cookieStore": false,
		"CookieStore": false,
		"CookieStoreManager": false,
		"CountQueuingStrategy": false,
		"crashReport": false,
		"CrashReportContext": false,
		"createImageBitmap": false,
		"CreateMonitor": false,
		"Credential": false,
		"credentialless": false,
		"CredentialsContainer": false,
		"CropTarget": false,
		"crossOriginIsolated": false,
		"crypto": false,
		"Crypto": false,
		"CryptoKey": false,
		"CSPViolationReportBody": false,
		"CSS": false,
		"CSSAnimation": false,
		"CSSConditionRule": false,
		"CSSContainerRule": false,
		"CSSCounterStyleRule": false,
		"CSSFontFaceDescriptors": false,
		"CSSFontFaceRule": false,
		"CSSFontFeatureValuesRule": false,
		"CSSFontPaletteValuesRule": false,
		"CSSFunctionDeclarations": false,
		"CSSFunctionDescriptors": false,
		"CSSFunctionRule": false,
		"CSSGroupingRule": false,
		"CSSImageValue": false,
		"CSSImportRule": false,
		"CSSKeyframeRule": false,
		"CSSKeyframesRule": false,
		"CSSKeywordValue": false,
		"CSSLayerBlockRule": false,
		"CSSLayerStatementRule": false,
		"CSSMarginRule": false,
		"CSSMathClamp": false,
		"CSSMathInvert": false,
		"CSSMathMax": false,
		"CSSMathMin": false,
		"CSSMathNegate": false,
		"CSSMathProduct": false,
		"CSSMathSum": false,
		"CSSMathValue": false,
		"CSSMatrixComponent": false,
		"CSSMediaRule": false,
		"CSSNamespaceRule": false,
		"CSSNestedDeclarations": false,
		"CSSNumericArray": false,
		"CSSNumericValue": false,
		"CSSPageDescriptors": false,
		"CSSPageRule": false,
		"CSSPerspective": false,
		"CSSPositionTryDescriptors": false,
		"CSSPositionTryRule": false,
		"CSSPositionValue": false,
		"CSSPropertyRule": false,
		"CSSPseudoElement": false,
		"CSSRotate": false,
		"CSSRule": false,
		"CSSRuleList": false,
		"CSSScale": false,
		"CSSScopeRule": false,
		"CSSSkew": false,
		"CSSSkewX": false,
		"CSSSkewY": false,
		"CSSStartingStyleRule": false,
		"CSSStyleDeclaration": false,
		"CSSStyleProperties": false,
		"CSSStyleRule": false,
		"CSSStyleSheet": false,
		"CSSStyleValue": false,
		"CSSSupportsRule": false,
		"CSSTransformComponent": false,
		"CSSTransformValue": false,
		"CSSTransition": false,
		"CSSTranslate": false,
		"CSSUnitValue": false,
		"CSSUnparsedValue": false,
		"CSSVariableReferenceValue": false,
		"CSSViewTransitionRule": false,
		"CustomElementRegistry": false,
		"customElements": false,
		"CustomEvent": false,
		"CustomStateSet": false,
		"DataTransfer": false,
		"DataTransferItem": false,
		"DataTransferItemList": false,
		"DecompressionStream": false,
		"DelayNode": false,
		"DelegatedInkTrailPresenter": false,
		"DeviceMotionEvent": false,
		"DeviceMotionEventAcceleration": false,
		"DeviceMotionEventRotationRate": false,
		"DeviceOrientationEvent": false,
		"devicePixelRatio": false,
		"DevicePosture": false,
		"DigitalCredential": false,
		"dispatchEvent": false,
		"document": false,
		"Document": false,
		"DocumentFragment": false,
		"documentPictureInPicture": false,
		"DocumentPictureInPicture": false,
		"DocumentPictureInPictureEvent": false,
		"DocumentTimeline": false,
		"DocumentType": false,
		"DOMError": false,
		"DOMException": false,
		"DOMImplementation": false,
		"DOMMatrix": false,
		"DOMMatrixReadOnly": false,
		"DOMParser": false,
		"DOMPoint": false,
		"DOMPointReadOnly": false,
		"DOMQuad": false,
		"DOMRect": false,
		"DOMRectList": false,
		"DOMRectReadOnly": false,
		"DOMStringList": false,
		"DOMStringMap": false,
		"DOMTokenList": false,
		"DragEvent": false,
		"DynamicsCompressorNode": false,
		"EditContext": false,
		"Element": false,
		"ElementInternals": false,
		"EncodedAudioChunk": false,
		"EncodedVideoChunk": false,
		"ErrorEvent": false,
		"event": false,
		"Event": false,
		"EventCounts": false,
		"EventSource": false,
		"EventTarget": false,
		"external": false,
		"External": false,
		"EyeDropper": false,
		"FeaturePolicy": false,
		"FederatedCredential": false,
		"fence": false,
		"Fence": false,
		"FencedFrameConfig": false,
		"fetch": false,
		"fetchLater": false,
		"FetchLaterResult": false,
		"File": false,
		"FileList": false,
		"FileReader": false,
		"FileSystem": false,
		"FileSystemDirectoryEntry": false,
		"FileSystemDirectoryHandle": false,
		"FileSystemDirectoryReader": false,
		"FileSystemEntry": false,
		"FileSystemFileEntry": false,
		"FileSystemFileHandle": false,
		"FileSystemHandle": false,
		"FileSystemObserver": false,
		"FileSystemWritableFileStream": false,
		"find": false,
		"focus": false,
		"FocusEvent": false,
		"FontData": false,
		"FontFace": false,
		"FontFaceSet": false,
		"FontFaceSetLoadEvent": false,
		"FormData": false,
		"FormDataEvent": false,
		"FragmentDirective": false,
		"frameElement": false,
		"frames": false,
		"GainNode": false,
		"Gamepad": false,
		"GamepadAxisMoveEvent": false,
		"GamepadButton": false,
		"GamepadButtonEvent": false,
		"GamepadEvent": false,
		"GamepadHapticActuator": false,
		"GamepadPose": false,
		"Geolocation": false,
		"GeolocationCoordinates": false,
		"GeolocationPosition": false,
		"GeolocationPositionError": false,
		"getComputedStyle": false,
		"getScreenDetails": false,
		"getSelection": false,
		"GPU": false,
		"GPUAdapter": false,
		"GPUAdapterInfo": false,
		"GPUBindGroup": false,
		"GPUBindGroupLayout": false,
		"GPUBuffer": false,
		"GPUBufferUsage": false,
		"GPUCanvasContext": false,
		"GPUColorWrite": false,
		"GPUCommandBuffer": false,
		"GPUCommandEncoder": false,
		"GPUCompilationInfo": false,
		"GPUCompilationMessage": false,
		"GPUComputePassEncoder": false,
		"GPUComputePipeline": false,
		"GPUDevice": false,
		"GPUDeviceLostInfo": false,
		"GPUError": false,
		"GPUExternalTexture": false,
		"GPUInternalError": false,
		"GPUMapMode": false,
		"GPUOutOfMemoryError": false,
		"GPUPipelineError": false,
		"GPUPipelineLayout": false,
		"GPUQuerySet": false,
		"GPUQueue": false,
		"GPURenderBundle": false,
		"GPURenderBundleEncoder": false,
		"GPURenderPassEncoder": false,
		"GPURenderPipeline": false,
		"GPUSampler": false,
		"GPUShaderModule": false,
		"GPUShaderStage": false,
		"GPUSupportedFeatures": false,
		"GPUSupportedLimits": false,
		"GPUTexture": false,
		"GPUTextureUsage": false,
		"GPUTextureView": false,
		"GPUUncapturedErrorEvent": false,
		"GPUValidationError": false,
		"GravitySensor": false,
		"Gyroscope": false,
		"HashChangeEvent": false,
		"Headers": false,
		"HID": false,
		"HIDConnectionEvent": false,
		"HIDDevice": false,
		"HIDInputReportEvent": false,
		"Highlight": false,
		"HighlightRegistry": false,
		"history": false,
		"History": false,
		"HTMLAllCollection": false,
		"HTMLAnchorElement": false,
		"HTMLAreaElement": false,
		"HTMLAudioElement": false,
		"HTMLBaseElement": false,
		"HTMLBodyElement": false,
		"HTMLBRElement": false,
		"HTMLButtonElement": false,
		"HTMLCanvasElement": false,
		"HTMLCollection": false,
		"HTMLDataElement": false,
		"HTMLDataListElement": false,
		"HTMLDetailsElement": false,
		"HTMLDialogElement": false,
		"HTMLDirectoryElement": false,
		"HTMLDivElement": false,
		"HTMLDListElement": false,
		"HTMLDocument": false,
		"HTMLElement": false,
		"HTMLEmbedElement": false,
		"HTMLFencedFrameElement": false,
		"HTMLFieldSetElement": false,
		"HTMLFontElement": false,
		"HTMLFormControlsCollection": false,
		"HTMLFormElement": false,
		"HTMLFrameElement": false,
		"HTMLFrameSetElement": false,
		"HTMLGeolocationElement": false,
		"HTMLHeadElement": false,
		"HTMLHeadingElement": false,
		"HTMLHRElement": false,
		"HTMLHtmlElement": false,
		"HTMLIFrameElement": false,
		"HTMLImageElement": false,
		"HTMLInputElement": false,
		"HTMLLabelElement": false,
		"HTMLLegendElement": false,
		"HTMLLIElement": false,
		"HTMLLinkElement": false,
		"HTMLMapElement": false,
		"HTMLMarqueeElement": false,
		"HTMLMediaElement": false,
		"HTMLMenuElement": false,
		"HTMLMetaElement": false,
		"HTMLMeterElement": false,
		"HTMLModElement": false,
		"HTMLObjectElement": false,
		"HTMLOListElement": false,
		"HTMLOptGroupElement": false,
		"HTMLOptionElement": false,
		"HTMLOptionsCollection": false,
		"HTMLOutputElement": false,
		"HTMLParagraphElement": false,
		"HTMLParamElement": false,
		"HTMLPictureElement": false,
		"HTMLPreElement": false,
		"HTMLProgressElement": false,
		"HTMLQuoteElement": false,
		"HTMLScriptElement": false,
		"HTMLSelectedContentElement": false,
		"HTMLSelectElement": false,
		"HTMLSlotElement": false,
		"HTMLSourceElement": false,
		"HTMLSpanElement": false,
		"HTMLStyleElement": false,
		"HTMLTableCaptionElement": false,
		"HTMLTableCellElement": false,
		"HTMLTableColElement": false,
		"HTMLTableElement": false,
		"HTMLTableRowElement": false,
		"HTMLTableSectionElement": false,
		"HTMLTemplateElement": false,
		"HTMLTextAreaElement": false,
		"HTMLTimeElement": false,
		"HTMLTitleElement": false,
		"HTMLTrackElement": false,
		"HTMLUListElement": false,
		"HTMLUnknownElement": false,
		"HTMLUserMediaElement": false,
		"HTMLVideoElement": false,
		"IDBCursor": false,
		"IDBCursorWithValue": false,
		"IDBDatabase": false,
		"IDBFactory": false,
		"IDBIndex": false,
		"IDBKeyRange": false,
		"IDBObjectStore": false,
		"IDBOpenDBRequest": false,
		"IDBRecord": false,
		"IDBRequest": false,
		"IDBTransaction": false,
		"IDBVersionChangeEvent": false,
		"IdentityCredential": false,
		"IdentityCredentialError": false,
		"IdentityProvider": false,
		"IdleDeadline": false,
		"IdleDetector": false,
		"IIRFilterNode": false,
		"Image": false,
		"ImageBitmap": false,
		"ImageBitmapRenderingContext": false,
		"ImageCapture": false,
		"ImageData": false,
		"ImageDecoder": false,
		"ImageTrack": false,
		"ImageTrackList": false,
		"indexedDB": false,
		"Ink": false,
		"innerHeight": false,
		"innerWidth": false,
		"InputDeviceCapabilities": false,
		"InputDeviceInfo": false,
		"InputEvent": false,
		"IntegrityViolationReportBody": false,
		"InteractionContentfulPaint": false,
		"InterestEvent": false,
		"IntersectionObserver": false,
		"IntersectionObserverEntry": false,
		"isSecureContext": false,
		"Keyboard": false,
		"KeyboardEvent": false,
		"KeyboardLayoutMap": false,
		"KeyframeEffect": false,
		"LanguageDetector": false,
		"LanguageModel": false,
		"LargestContentfulPaint": false,
		"LaunchParams": false,
		"launchQueue": false,
		"LaunchQueue": false,
		"LayoutShift": false,
		"LayoutShiftAttribution": false,
		"length": false,
		"LinearAccelerationSensor": false,
		"localStorage": false,
		"location": true,
		"Location": false,
		"locationbar": false,
		"Lock": false,
		"LockManager": false,
		"matchMedia": false,
		"MathMLElement": false,
		"MediaCapabilities": false,
		"MediaCapabilitiesInfo": false,
		"MediaDeviceInfo": false,
		"MediaDevices": false,
		"MediaElementAudioSourceNode": false,
		"MediaEncryptedEvent": false,
		"MediaError": false,
		"MediaKeyError": false,
		"MediaKeyMessageEvent": false,
		"MediaKeys": false,
		"MediaKeySession": false,
		"MediaKeyStatusMap": false,
		"MediaKeySystemAccess": false,
		"MediaList": false,
		"MediaMetadata": false,
		"MediaQueryList": false,
		"MediaQueryListEvent": false,
		"MediaRecorder": false,
		"MediaRecorderErrorEvent": false,
		"MediaSession": false,
		"MediaSource": false,
		"MediaSourceHandle": false,
		"MediaStream": false,
		"MediaStreamAudioDestinationNode": false,
		"MediaStreamAudioSourceNode": false,
		"MediaStreamEvent": false,
		"MediaStreamTrack": false,
		"MediaStreamTrackAudioSourceNode": false,
		"MediaStreamTrackAudioStats": false,
		"MediaStreamTrackEvent": false,
		"MediaStreamTrackGenerator": false,
		"MediaStreamTrackProcessor": false,
		"MediaStreamTrackVideoStats": false,
		"menubar": false,
		"MessageChannel": false,
		"MessageEvent": false,
		"MessagePort": false,
		"MIDIAccess": false,
		"MIDIConnectionEvent": false,
		"MIDIInput": false,
		"MIDIInputMap": false,
		"MIDIMessageEvent": false,
		"MIDIOutput": false,
		"MIDIOutputMap": false,
		"MIDIPort": false,
		"MimeType": false,
		"MimeTypeArray": false,
		"model": false,
		"ModelContext": false,
		"ModelGenericSession": false,
		"ModelManager": false,
		"MouseEvent": false,
		"moveBy": false,
		"moveTo": false,
		"MutationEvent": false,
		"MutationObserver": false,
		"MutationRecord": false,
		"name": false,
		"NamedNodeMap": false,
		"NavigateEvent": false,
		"navigation": false,
		"Navigation": false,
		"NavigationActivation": false,
		"NavigationCurrentEntryChangeEvent": false,
		"NavigationDestination": false,
		"NavigationHistoryEntry": false,
		"NavigationPrecommitController": false,
		"NavigationPreloadManager": false,
		"NavigationTransition": false,
		"navigator": false,
		"Navigator": false,
		"NavigatorLogin": false,
		"NavigatorManagedData": false,
		"NavigatorUAData": false,
		"NetworkInformation": false,
		"Node": false,
		"NodeFilter": false,
		"NodeIterator": false,
		"NodeList": false,
		"Notification": false,
		"NotifyPaintEvent": false,
		"NotRestoredReasonDetails": false,
		"NotRestoredReasons": false,
		"Observable": false,
		"OfflineAudioCompletionEvent": false,
		"OfflineAudioContext": false,
		"offscreenBuffering": false,
		"OffscreenCanvas": false,
		"OffscreenCanvasRenderingContext2D": false,
		"onabort": true,
		"onafterprint": true,
		"onanimationcancel": true,
		"onanimationend": true,
		"onanimationiteration": true,
		"onanimationstart": true,
		"onappinstalled": true,
		"onauxclick": true,
		"onbeforeinput": true,
		"onbeforeinstallprompt": true,
		"onbeforematch": true,
		"onbeforeprint": true,
		"onbeforetoggle": true,
		"onbeforeunload": true,
		"onbeforexrselect": true,
		"onblur": true,
		"oncancel": true,
		"oncanplay": true,
		"oncanplaythrough": true,
		"onchange": true,
		"onclick": true,
		"onclose": true,
		"oncommand": true,
		"oncontentvisibilityautostatechange": true,
		"oncontextlost": true,
		"oncontextmenu": true,
		"oncontextrestored": true,
		"oncopy": true,
		"oncuechange": true,
		"oncut": true,
		"ondblclick": true,
		"ondevicemotion": true,
		"ondeviceorientation": true,
		"ondeviceorientationabsolute": true,
		"ondrag": true,
		"ondragend": true,
		"ondragenter": true,
		"ondragleave": true,
		"ondragover": true,
		"ondragstart": true,
		"ondrop": true,
		"ondurationchange": true,
		"onemptied": true,
		"onended": true,
		"onerror": true,
		"onfocus": true,
		"onformdata": true,
		"ongamepadconnected": true,
		"ongamepaddisconnected": true,
		"ongotpointercapture": true,
		"onhashchange": true,
		"oninput": true,
		"oninvalid": true,
		"onkeydown": true,
		"onkeypress": true,
		"onkeyup": true,
		"onlanguagechange": true,
		"onload": true,
		"onloadeddata": true,
		"onloadedmetadata": true,
		"onloadstart": true,
		"onlostpointercapture": true,
		"onmessage": true,
		"onmessageerror": true,
		"onmousedown": true,
		"onmouseenter": true,
		"onmouseleave": true,
		"onmousemove": true,
		"onmouseout": true,
		"onmouseover": true,
		"onmouseup": true,
		"onmousewheel": true,
		"onoffline": true,
		"ononline": true,
		"onpagehide": true,
		"onpagereveal": true,
		"onpageshow": true,
		"onpageswap": true,
		"onpaste": true,
		"onpause": true,
		"onplay": true,
		"onplaying": true,
		"onpointercancel": true,
		"onpointerdown": true,
		"onpointerenter": true,
		"onpointerleave": true,
		"onpointermove": true,
		"onpointerout": true,
		"onpointerover": true,
		"onpointerrawupdate": true,
		"onpointerup": true,
		"onpopstate": true,
		"onprogress": true,
		"onratechange": true,
		"onrejectionhandled": true,
		"onreset": true,
		"onresize": true,
		"onscroll": true,
		"onscrollend": true,
		"onscrollsnapchange": true,
		"onscrollsnapchanging": true,
		"onsearch": true,
		"onsecuritypolicyviolation": true,
		"onseeked": true,
		"onseeking": true,
		"onselect": true,
		"onselectionchange": true,
		"onselectstart": true,
		"onslotchange": true,
		"onstalled": true,
		"onstorage": true,
		"onsubmit": true,
		"onsuspend": true,
		"ontimeupdate": true,
		"ontoggle": true,
		"ontransitioncancel": true,
		"ontransitionend": true,
		"ontransitionrun": true,
		"ontransitionstart": true,
		"onunhandledrejection": true,
		"onunload": true,
		"onvolumechange": true,
		"onwaiting": true,
		"onwheel": true,
		"open": false,
		"opener": false,
		"Option": false,
		"OrientationSensor": false,
		"origin": false,
		"Origin": false,
		"originAgentCluster": false,
		"OscillatorNode": false,
		"OTPCredential": false,
		"outerHeight": false,
		"outerWidth": false,
		"OverconstrainedError": false,
		"PageRevealEvent": false,
		"PageSwapEvent": false,
		"PageTransitionEvent": false,
		"pageXOffset": false,
		"pageYOffset": false,
		"PannerNode": false,
		"parent": false,
		"PasswordCredential": false,
		"Path2D": false,
		"PaymentAddress": false,
		"PaymentManager": false,
		"PaymentMethodChangeEvent": false,
		"PaymentRequest": false,
		"PaymentRequestUpdateEvent": false,
		"PaymentResponse": false,
		"performance": false,
		"Performance": false,
		"PerformanceElementTiming": false,
		"PerformanceEntry": false,
		"PerformanceEventTiming": false,
		"PerformanceLongAnimationFrameTiming": false,
		"PerformanceLongTaskTiming": false,
		"PerformanceMark": false,
		"PerformanceMarkConditional": false,
		"PerformanceMeasure": false,
		"PerformanceNavigation": false,
		"PerformanceNavigationTiming": false,
		"PerformanceObserver": false,
		"PerformanceObserverEntryList": false,
		"PerformancePaintTiming": false,
		"PerformanceResourceTiming": false,
		"PerformanceScriptTiming": false,
		"PerformanceServerTiming": false,
		"PerformanceSoftNavigation": false,
		"PerformanceTiming": false,
		"PerformanceTimingConfidence": false,
		"PeriodicSyncManager": false,
		"PeriodicWave": false,
		"Permissions": false,
		"PermissionsPolicy": false,
		"PermissionStatus": false,
		"PERSISTENT": false,
		"personalbar": false,
		"PictureInPictureEvent": false,
		"PictureInPictureWindow": false,
		"Plugin": false,
		"PluginArray": false,
		"PointerEvent": false,
		"PopStateEvent": false,
		"postMessage": false,
		"Presentation": false,
		"PresentationAvailability": false,
		"PresentationConnection": false,
		"PresentationConnectionAvailableEvent": false,
		"PresentationConnectionCloseEvent": false,
		"PresentationConnectionList": false,
		"PresentationReceiver": false,
		"PresentationRequest": false,
		"PressureObserver": false,
		"PressureRecord": false,
		"print": false,
		"ProcessingInstruction": false,
		"Profiler": false,
		"ProgressEvent": false,
		"PromiseRejectionEvent": false,
		"prompt": false,
		"ProtectedAudience": false,
		"PublicKeyCredential": false,
		"PushManager": false,
		"PushSubscription": false,
		"PushSubscriptionOptions": false,
		"queryLocalFonts": false,
		"queueMicrotask": false,
		"QuotaExceededError": false,
		"RadioNodeList": false,
		"Range": false,
		"ReadableByteStreamController": false,
		"ReadableStream": false,
		"ReadableStreamBYOBReader": false,
		"ReadableStreamBYOBRequest": false,
		"ReadableStreamDefaultController": false,
		"ReadableStreamDefaultReader": false,
		"RelativeOrientationSensor": false,
		"RemotePlayback": false,
		"removeEventListener": false,
		"ReportBody": false,
		"reportError": false,
		"ReportingObserver": false,
		"Request": false,
		"requestAnimationFrame": false,
		"requestIdleCallback": false,
		"resizeBy": false,
		"ResizeObserver": false,
		"ResizeObserverEntry": false,
		"ResizeObserverSize": false,
		"resizeTo": false,
		"Response": false,
		"RestrictionTarget": false,
		"RTCCertificate": false,
		"RTCDataChannel": false,
		"RTCDataChannelEvent": false,
		"RTCDtlsTransport": false,
		"RTCDTMFSender": false,
		"RTCDTMFToneChangeEvent": false,
		"RTCEncodedAudioFrame": false,
		"RTCEncodedVideoFrame": false,
		"RTCError": false,
		"RTCErrorEvent": false,
		"RTCIceCandidate": false,
		"RTCIceCandidatePair": false,
		"RTCIceTransport": false,
		"RTCPeerConnection": false,
		"RTCPeerConnectionIceErrorEvent": false,
		"RTCPeerConnectionIceEvent": false,
		"RTCRtpReceiver": false,
		"RTCRtpScriptTransform": false,
		"RTCRtpSender": false,
		"RTCRtpTransceiver": false,
		"RTCSctpTransport": false,
		"RTCSessionDescription": false,
		"RTCStatsReport": false,
		"RTCTrackEvent": false,
		"Sanitizer": false,
		"scheduler": false,
		"Scheduler": false,
		"Scheduling": false,
		"screen": false,
		"Screen": false,
		"ScreenDetailed": false,
		"ScreenDetails": false,
		"screenLeft": false,
		"ScreenOrientation": false,
		"screenTop": false,
		"screenX": false,
		"screenY": false,
		"ScriptProcessorNode": false,
		"scroll": false,
		"scrollbars": false,
		"scrollBy": false,
		"ScrollTimeline": false,
		"scrollTo": false,
		"scrollX": false,
		"scrollY": false,
		"SecurityPolicyViolationEvent": false,
		"Selection": false,
		"self": false,
		"Sensor": false,
		"SensorErrorEvent": false,
		"Serial": false,
		"SerialPort": false,
		"ServiceWorker": false,
		"ServiceWorkerContainer": false,
		"ServiceWorkerRegistration": false,
		"sessionStorage": false,
		"setInterval": false,
		"setTimeout": false,
		"ShadowRoot": false,
		"sharedStorage": false,
		"SharedStorage": false,
		"SharedStorageAppendMethod": false,
		"SharedStorageClearMethod": false,
		"SharedStorageDeleteMethod": false,
		"SharedStorageModifierMethod": false,
		"SharedStorageSetMethod": false,
		"SharedStorageWorklet": false,
		"SharedWorker": false,
		"showDirectoryPicker": false,
		"showOpenFilePicker": false,
		"showSaveFilePicker": false,
		"SnapEvent": false,
		"SourceBuffer": false,
		"SourceBufferList": false,
		"SpeechGrammar": false,
		"SpeechGrammarList": false,
		"SpeechRecognition": false,
		"SpeechRecognitionErrorEvent": false,
		"SpeechRecognitionEvent": false,
		"SpeechRecognitionPhrase": false,
		"speechSynthesis": false,
		"SpeechSynthesis": false,
		"SpeechSynthesisErrorEvent": false,
		"SpeechSynthesisEvent": false,
		"SpeechSynthesisUtterance": false,
		"SpeechSynthesisVoice": false,
		"StaticRange": false,
		"status": false,
		"statusbar": false,
		"StereoPannerNode": false,
		"stop": false,
		"Storage": false,
		"StorageBucket": false,
		"StorageBucketManager": false,
		"StorageEvent": false,
		"StorageManager": false,
		"structuredClone": false,
		"styleMedia": false,
		"StylePropertyMap": false,
		"StylePropertyMapReadOnly": false,
		"StyleSheet": false,
		"StyleSheetList": false,
		"SubmitEvent": false,
		"Subscriber": false,
		"SubtleCrypto": false,
		"Summarizer": false,
		"SVGAElement": false,
		"SVGAngle": false,
		"SVGAnimatedAngle": false,
		"SVGAnimatedBoolean": false,
		"SVGAnimatedEnumeration": false,
		"SVGAnimatedInteger": false,
		"SVGAnimatedLength": false,
		"SVGAnimatedLengthList": false,
		"SVGAnimatedNumber": false,
		"SVGAnimatedNumberList": false,
		"SVGAnimatedPreserveAspectRatio": false,
		"SVGAnimatedRect": false,
		"SVGAnimatedString": false,
		"SVGAnimatedTransformList": false,
		"SVGAnimateElement": false,
		"SVGAnimateMotionElement": false,
		"SVGAnimateTransformElement": false,
		"SVGAnimationElement": false,
		"SVGCircleElement": false,
		"SVGClipPathElement": false,
		"SVGComponentTransferFunctionElement": false,
		"SVGDefsElement": false,
		"SVGDescElement": false,
		"SVGElement": false,
		"SVGEllipseElement": false,
		"SVGFEBlendElement": false,
		"SVGFEColorMatrixElement": false,
		"SVGFEComponentTransferElement": false,
		"SVGFECompositeElement": false,
		"SVGFEConvolveMatrixElement": false,
		"SVGFEDiffuseLightingElement": false,
		"SVGFEDisplacementMapElement": false,
		"SVGFEDistantLightElement": false,
		"SVGFEDropShadowElement": false,
		"SVGFEFloodElement": false,
		"SVGFEFuncAElement": false,
		"SVGFEFuncBElement": false,
		"SVGFEFuncGElement": false,
		"SVGFEFuncRElement": false,
		"SVGFEGaussianBlurElement": false,
		"SVGFEImageElement": false,
		"SVGFEMergeElement": false,
		"SVGFEMergeNodeElement": false,
		"SVGFEMorphologyElement": false,
		"SVGFEOffsetElement": false,
		"SVGFEPointLightElement": false,
		"SVGFESpecularLightingElement": false,
		"SVGFESpotLightElement": false,
		"SVGFETileElement": false,
		"SVGFETurbulenceElement": false,
		"SVGFilterElement": false,
		"SVGForeignObjectElement": false,
		"SVGGElement": false,
		"SVGGeometryElement": false,
		"SVGGradientElement": false,
		"SVGGraphicsElement": false,
		"SVGImageElement": false,
		"SVGLength": false,
		"SVGLengthList": false,
		"SVGLinearGradientElement": false,
		"SVGLineElement": false,
		"SVGMarkerElement": false,
		"SVGMaskElement": false,
		"SVGMatrix": false,
		"SVGMetadataElement": false,
		"SVGMPathElement": false,
		"SVGNumber": false,
		"SVGNumberList": false,
		"SVGPathElement": false,
		"SVGPatternElement": false,
		"SVGPoint": false,
		"SVGPointList": false,
		"SVGPolygonElement": false,
		"SVGPolylineElement": false,
		"SVGPreserveAspectRatio": false,
		"SVGRadialGradientElement": false,
		"SVGRect": false,
		"SVGRectElement": false,
		"SVGScriptElement": false,
		"SVGSetElement": false,
		"SVGStopElement": false,
		"SVGStringList": false,
		"SVGStyleElement": false,
		"SVGSVGElement": false,
		"SVGSwitchElement": false,
		"SVGSymbolElement": false,
		"SVGTextContentElement": false,
		"SVGTextElement": false,
		"SVGTextPathElement": false,
		"SVGTextPositioningElement": false,
		"SVGTitleElement": false,
		"SVGTransform": false,
		"SVGTransformList": false,
		"SVGTSpanElement": false,
		"SVGUnitTypes": false,
		"SVGUseElement": false,
		"SVGViewElement": false,
		"SyncManager": false,
		"TaskAttributionTiming": false,
		"TaskController": false,
		"TaskPriorityChangeEvent": false,
		"TaskSignal": false,
		"Temporal": false,
		"TEMPORARY": false,
		"Text": false,
		"TextDecoder": false,
		"TextDecoderStream": false,
		"TextEncoder": false,
		"TextEncoderStream": false,
		"TextEvent": false,
		"TextFormat": false,
		"TextFormatUpdateEvent": false,
		"TextMetrics": false,
		"TextTrack": false,
		"TextTrackCue": false,
		"TextTrackCueList": false,
		"TextTrackList": false,
		"TextUpdateEvent": false,
		"TimeEvent": false,
		"TimelineTrigger": false,
		"TimelineTriggerRange": false,
		"TimelineTriggerRangeList": false,
		"TimeRanges": false,
		"ToggleEvent": false,
		"toolbar": false,
		"top": false,
		"Touch": false,
		"TouchEvent": false,
		"TouchList": false,
		"TrackEvent": false,
		"TransformStream": false,
		"TransformStreamDefaultController": false,
		"TransitionEvent": false,
		"Translator": false,
		"TreeWalker": false,
		"TrustedHTML": false,
		"TrustedScript": false,
		"TrustedScriptURL": false,
		"TrustedTypePolicy": false,
		"TrustedTypePolicyFactory": false,
		"trustedTypes": false,
		"UIEvent": false,
		"URL": false,
		"URLPattern": false,
		"URLSearchParams": false,
		"USB": false,
		"USBAlternateInterface": false,
		"USBConfiguration": false,
		"USBConnectionEvent": false,
		"USBDevice": false,
		"USBEndpoint": false,
		"USBInterface": false,
		"USBInTransferResult": false,
		"USBIsochronousInTransferPacket": false,
		"USBIsochronousInTransferResult": false,
		"USBIsochronousOutTransferPacket": false,
		"USBIsochronousOutTransferResult": false,
		"USBOutTransferResult": false,
		"UserActivation": false,
		"ValidityState": false,
		"VideoColorSpace": false,
		"VideoDecoder": false,
		"VideoEncoder": false,
		"VideoFrame": false,
		"VideoPlaybackQuality": false,
		"viewport": false,
		"Viewport": false,
		"ViewTimeline": false,
		"ViewTransition": false,
		"ViewTransitionTypeSet": false,
		"VirtualKeyboard": false,
		"VirtualKeyboardGeometryChangeEvent": false,
		"VisibilityStateEntry": false,
		"visualViewport": false,
		"VisualViewport": false,
		"VTTCue": false,
		"VTTRegion": false,
		"WakeLock": false,
		"WakeLockSentinel": false,
		"WaveShaperNode": false,
		"WebAssembly": false,
		"WebGL2RenderingContext": false,
		"WebGLActiveInfo": false,
		"WebGLBuffer": false,
		"WebGLContextEvent": false,
		"WebGLFramebuffer": false,
		"WebGLObject": false,
		"WebGLProgram": false,
		"WebGLQuery": false,
		"WebGLRenderbuffer": false,
		"WebGLRenderingContext": false,
		"WebGLSampler": false,
		"WebGLShader": false,
		"WebGLShaderPrecisionFormat": false,
		"WebGLSync": false,
		"WebGLTexture": false,
		"WebGLTransformFeedback": false,
		"WebGLUniformLocation": false,
		"WebGLVertexArrayObject": false,
		"WebMCPEvent": false,
		"WebSocket": false,
		"WebSocketError": false,
		"WebSocketStream": false,
		"WebTransport": false,
		"WebTransportBidirectionalStream": false,
		"WebTransportDatagramDuplexStream": false,
		"WebTransportDatagramsWritable": false,
		"WebTransportError": false,
		"WebTransportReceiveStream": false,
		"WebTransportSendGroup": false,
		"WebTransportSendStream": false,
		"WGSLLanguageFeatures": false,
		"WheelEvent": false,
		"when": false,
		"window": false,
		"Window": false,
		"WindowControlsOverlay": false,
		"WindowControlsOverlayGeometryChangeEvent": false,
		"Worker": false,
		"Worklet": false,
		"WritableStream": false,
		"WritableStreamDefaultController": false,
		"WritableStreamDefaultWriter": false,
		"XMLDocument": false,
		"XMLHttpRequest": false,
		"XMLHttpRequestEventTarget": false,
		"XMLHttpRequestUpload": false,
		"XMLSerializer": false,
		"XPathEvaluator": false,
		"XPathExpression": false,
		"XPathResult": false,
		"XRAnchor": false,
		"XRAnchorSet": false,
		"XRBoundedReferenceSpace": false,
		"XRCamera": false,
		"XRCompositionLayer": false,
		"XRCPUDepthInformation": false,
		"XRCubeLayer": false,
		"XRCylinderLayer": false,
		"XRDepthInformation": false,
		"XRDOMOverlayState": false,
		"XREquirectLayer": false,
		"XRFrame": false,
		"XRHand": false,
		"XRHitTestResult": false,
		"XRHitTestSource": false,
		"XRInputSource": false,
		"XRInputSourceArray": false,
		"XRInputSourceEvent": false,
		"XRInputSourcesChangeEvent": false,
		"XRJointPose": false,
		"XRJointSpace": false,
		"XRLayer": false,
		"XRLayerEvent": false,
		"XRLightEstimate": false,
		"XRLightProbe": false,
		"XRPlane": false,
		"XRPlaneSet": false,
		"XRPose": false,
		"XRProjectionLayer": false,
		"XRQuadLayer": false,
		"XRRay": false,
		"XRReferenceSpace": false,
		"XRReferenceSpaceEvent": false,
		"XRRenderState": false,
		"XRRigidTransform": false,
		"XRSession": false,
		"XRSessionEvent": false,
		"XRSpace": false,
		"XRSubImage": false,
		"XRSystem": false,
		"XRTransientInputHitTestResult": false,
		"XRTransientInputHitTestSource": false,
		"XRView": false,
		"XRViewerPose": false,
		"XRViewport": false,
		"XRVisibilityMaskChangeEvent": false,
		"XRWebGLBinding": false,
		"XRWebGLDepthInformation": false,
		"XRWebGLLayer": false,
		"XRWebGLSubImage": false,
		"XSLTProcessor": false
	},
	"builtin": {
		"AggregateError": false,
		"Array": false,
		"ArrayBuffer": false,
		"AsyncDisposableStack": false,
		"Atomics": false,
		"BigInt": false,
		"BigInt64Array": false,
		"BigUint64Array": false,
		"Boolean": false,
		"DataView": false,
		"Date": false,
		"decodeURI": false,
		"decodeURIComponent": false,
		"DisposableStack": false,
		"encodeURI": false,
		"encodeURIComponent": false,
		"Error": false,
		"escape": false,
		"eval": false,
		"EvalError": false,
		"FinalizationRegistry": false,
		"Float16Array": false,
		"Float32Array": false,
		"Float64Array": false,
		"Function": false,
		"globalThis": false,
		"Infinity": false,
		"Int16Array": false,
		"Int32Array": false,
		"Int8Array": false,
		"Intl": false,
		"isFinite": false,
		"isNaN": false,
		"Iterator": false,
		"JSON": false,
		"Map": false,
		"Math": false,
		"NaN": false,
		"Number": false,
		"Object": false,
		"parseFloat": false,
		"parseInt": false,
		"Promise": false,
		"Proxy": false,
		"RangeError": false,
		"ReferenceError": false,
		"Reflect": false,
		"RegExp": false,
		"Set": false,
		"SharedArrayBuffer": false,
		"String": false,
		"SuppressedError": false,
		"Symbol": false,
		"SyntaxError": false,
		"TypeError": false,
		"Uint16Array": false,
		"Uint32Array": false,
		"Uint8Array": false,
		"Uint8ClampedArray": false,
		"undefined": false,
		"unescape": false,
		"URIError": false,
		"WeakMap": false,
		"WeakRef": false,
		"WeakSet": false
	},
	"bunBuiltin": {
		"AbortController": false,
		"AbortSignal": false,
		"addEventListener": false,
		"alert": false,
		"atob": false,
		"Blob": false,
		"BroadcastChannel": false,
		"btoa": false,
		"Buffer": false,
		"BuildError": false,
		"BuildMessage": false,
		"Bun": false,
		"ByteLengthQueuingStrategy": false,
		"clearImmediate": false,
		"clearInterval": false,
		"clearTimeout": false,
		"CloseEvent": false,
		"CompressionStream": false,
		"confirm": false,
		"console": false,
		"CountQueuingStrategy": false,
		"crypto": false,
		"Crypto": false,
		"CryptoKey": false,
		"CustomEvent": false,
		"DecompressionStream": false,
		"dispatchEvent": false,
		"DOMException": false,
		"ErrorEvent": false,
		"Event": false,
		"EventTarget": false,
		"fetch": false,
		"File": false,
		"FormData": false,
		"global": false,
		"Headers": false,
		"HTMLRewriter": false,
		"Loader": false,
		"MessageChannel": false,
		"MessageEvent": false,
		"MessagePort": false,
		"navigator": false,
		"onerror": true,
		"onmessage": true,
		"performance": false,
		"Performance": false,
		"PerformanceEntry": false,
		"PerformanceMark": false,
		"PerformanceMeasure": false,
		"PerformanceObserver": false,
		"PerformanceObserverEntryList": false,
		"PerformanceResourceTiming": false,
		"PerformanceServerTiming": false,
		"PerformanceTiming": false,
		"postMessage": false,
		"process": false,
		"prompt": false,
		"queueMicrotask": false,
		"ReadableByteStreamController": false,
		"ReadableStream": false,
		"ReadableStreamBYOBReader": false,
		"ReadableStreamBYOBRequest": false,
		"ReadableStreamDefaultController": false,
		"ReadableStreamDefaultReader": false,
		"removeEventListener": false,
		"reportError": false,
		"Request": false,
		"ResolveError": false,
		"ResolveMessage": false,
		"Response": false,
		"self": false,
		"setImmediate": false,
		"setInterval": false,
		"setTimeout": false,
		"ShadowRealm": false,
		"structuredClone": false,
		"SubtleCrypto": false,
		"TextDecoder": false,
		"TextDecoderStream": false,
		"TextEncoder": false,
		"TextEncoderStream": false,
		"TransformStream": false,
		"TransformStreamDefaultController": false,
		"URL": false,
		"URLPattern": false,
		"URLSearchParams": false,
		"WebAssembly": false,
		"WebSocket": false,
		"Worker": false,
		"WritableStream": false,
		"WritableStreamDefaultController": false,
		"WritableStreamDefaultWriter": false
	},
	"chai": {
		"assert": true,
		"expect": true,
		"should": true
	},
	"commonjs": {
		"exports": true,
		"global": false,
		"module": false,
		"require": false
	},
	"couch": {
		"emit": false,
		"exports": false,
		"getRow": false,
		"log": false,
		"module": false,
		"provides": false,
		"require": false,
		"respond": false,
		"send": false,
		"start": false,
		"sum": false
	},
	"denoBuiltin": {
		"AbortController": false,
		"AbortSignal": false,
		"addEventListener": false,
		"alert": false,
		"atob": false,
		"Blob": false,
		"BroadcastChannel": false,
		"btoa": false,
		"Buffer": false,
		"ByteLengthQueuingStrategy": false,
		"Cache": false,
		"caches": false,
		"CacheStorage": false,
		"clearImmediate": false,
		"clearInterval": false,
		"clearTimeout": false,
		"close": false,
		"closed": false,
		"CloseEvent": false,
		"CompressionStream": false,
		"confirm": false,
		"console": false,
		"CountQueuingStrategy": false,
		"createImageBitmap": false,
		"crypto": false,
		"Crypto": false,
		"CryptoKey": false,
		"CustomEvent": false,
		"DecompressionStream": false,
		"Deno": false,
		"dispatchEvent": false,
		"DOMException": false,
		"DOMMatrix": false,
		"DOMMatrixReadOnly": false,
		"DOMPoint": false,
		"DOMPointReadOnly": false,
		"DOMQuad": false,
		"DOMRect": false,
		"DOMRectReadOnly": false,
		"ErrorEvent": false,
		"Event": false,
		"EventSource": false,
		"EventTarget": false,
		"fetch": false,
		"File": false,
		"FileReader": false,
		"FormData": false,
		"getParent": false,
		"global": false,
		"GPU": false,
		"GPUAdapter": false,
		"GPUAdapterInfo": false,
		"GPUBindGroup": false,
		"GPUBindGroupLayout": false,
		"GPUBuffer": false,
		"GPUBufferUsage": false,
		"GPUCanvasContext": false,
		"GPUColorWrite": false,
		"GPUCommandBuffer": false,
		"GPUCommandEncoder": false,
		"GPUCompilationInfo": false,
		"GPUCompilationMessage": false,
		"GPUComputePassEncoder": false,
		"GPUComputePipeline": false,
		"GPUDevice": false,
		"GPUDeviceLostInfo": false,
		"GPUError": false,
		"GPUInternalError": false,
		"GPUMapMode": false,
		"GPUOutOfMemoryError": false,
		"GPUPipelineError": false,
		"GPUPipelineLayout": false,
		"GPUQuerySet": false,
		"GPUQueue": false,
		"GPURenderBundle": false,
		"GPURenderBundleEncoder": false,
		"GPURenderPassEncoder": false,
		"GPURenderPipeline": false,
		"GPUSampler": false,
		"GPUShaderModule": false,
		"GPUShaderStage": false,
		"GPUSupportedFeatures": false,
		"GPUSupportedLimits": false,
		"GPUTexture": false,
		"GPUTextureUsage": false,
		"GPUTextureView": false,
		"GPUUncapturedErrorEvent": false,
		"GPUValidationError": false,
		"Headers": false,
		"ImageBitmap": false,
		"ImageBitmapRenderingContext": false,
		"ImageData": false,
		"localStorage": false,
		"location": false,
		"Location": false,
		"Lock": false,
		"LockManager": false,
		"MessageChannel": false,
		"MessageEvent": false,
		"MessagePort": false,
		"name": false,
		"navigator": false,
		"Navigator": false,
		"NavigatorUAData": false,
		"nodeBootstrap": false,
		"OffscreenCanvas": false,
		"onbeforeunload": true,
		"onerror": true,
		"onload": true,
		"onunhandledrejection": true,
		"onunload": true,
		"performance": false,
		"Performance": false,
		"PerformanceEntry": false,
		"PerformanceMark": false,
		"PerformanceMeasure": false,
		"PerformanceObserver": false,
		"PerformanceObserverEntryList": false,
		"process": false,
		"ProgressEvent": false,
		"PromiseRejectionEvent": false,
		"prompt": false,
		"queueMicrotask": false,
		"QuotaExceededError": false,
		"ReadableByteStreamController": false,
		"ReadableStream": false,
		"ReadableStreamBYOBReader": false,
		"ReadableStreamBYOBRequest": false,
		"ReadableStreamDefaultController": false,
		"ReadableStreamDefaultReader": false,
		"removeEventListener": false,
		"reportError": false,
		"Request": false,
		"Response": false,
		"self": false,
		"sessionStorage": false,
		"setImmediate": false,
		"setInterval": false,
		"setTimeout": false,
		"Storage": false,
		"structuredClone": false,
		"SubtleCrypto": false,
		"Temporal": false,
		"TextDecoder": false,
		"TextDecoderStream": false,
		"TextEncoder": false,
		"TextEncoderStream": false,
		"TransformStream": false,
		"TransformStreamDefaultController": false,
		"URL": false,
		"URLPattern": false,
		"URLSearchParams": false,
		"WebAssembly": false,
		"WebSocket": false,
		"Window": false,
		"Worker": false,
		"WritableStream": false,
		"WritableStreamDefaultController": false,
		"WritableStreamDefaultWriter": false
	},
	"devtools": {
		"$": false,
		"$_": false,
		"$$": false,
		"$0": false,
		"$1": false,
		"$2": false,
		"$3": false,
		"$4": false,
		"$x": false,
		"chrome": false,
		"clear": false,
		"copy": false,
		"debug": false,
		"dir": false,
		"dirxml": false,
		"getEventListeners": false,
		"inspect": false,
		"keys": false,
		"monitor": false,
		"monitorEvents": false,
		"profile": false,
		"profileEnd": false,
		"queryObjects": false,
		"table": false,
		"undebug": false,
		"unmonitor": false,
		"unmonitorEvents": false,
		"values": false
	},
	"embertest": {
		"andThen": false,
		"click": false,
		"currentPath": false,
		"currentRouteName": false,
		"currentURL": false,
		"fillIn": false,
		"find": false,
		"findAll": false,
		"findWithAssert": false,
		"keyEvent": false,
		"pauseTest": false,
		"resumeTest": false,
		"triggerEvent": false,
		"visit": false,
		"wait": false
	},
	"es2015": {
		"Array": false,
		"ArrayBuffer": false,
		"Boolean": false,
		"DataView": false,
		"Date": false,
		"decodeURI": false,
		"decodeURIComponent": false,
		"encodeURI": false,
		"encodeURIComponent": false,
		"Error": false,
		"escape": false,
		"eval": false,
		"EvalError": false,
		"Float32Array": false,
		"Float64Array": false,
		"Function": false,
		"Infinity": false,
		"Int16Array": false,
		"Int32Array": false,
		"Int8Array": false,
		"Intl": false,
		"isFinite": false,
		"isNaN": false,
		"JSON": false,
		"Map": false,
		"Math": false,
		"NaN": false,
		"Number": false,
		"Object": false,
		"parseFloat": false,
		"parseInt": false,
		"Promise": false,
		"Proxy": false,
		"RangeError": false,
		"ReferenceError": false,
		"Reflect": false,
		"RegExp": false,
		"Set": false,
		"String": false,
		"Symbol": false,
		"SyntaxError": false,
		"TypeError": false,
		"Uint16Array": false,
		"Uint32Array": false,
		"Uint8Array": false,
		"Uint8ClampedArray": false,
		"undefined": false,
		"unescape": false,
		"URIError": false,
		"WeakMap": false,
		"WeakSet": false
	},
	"es2016": {
		"Array": false,
		"ArrayBuffer": false,
		"Boolean": false,
		"DataView": false,
		"Date": false,
		"decodeURI": false,
		"decodeURIComponent": false,
		"encodeURI": false,
		"encodeURIComponent": false,
		"Error": false,
		"escape": false,
		"eval": false,
		"EvalError": false,
		"Float32Array": false,
		"Float64Array": false,
		"Function": false,
		"Infinity": false,
		"Int16Array": false,
		"Int32Array": false,
		"Int8Array": false,
		"Intl": false,
		"isFinite": false,
		"isNaN": false,
		"JSON": false,
		"Map": false,
		"Math": false,
		"NaN": false,
		"Number": false,
		"Object": false,
		"parseFloat": false,
		"parseInt": false,
		"Promise": false,
		"Proxy": false,
		"RangeError": false,
		"ReferenceError": false,
		"Reflect": false,
		"RegExp": false,
		"Set": false,
		"String": false,
		"Symbol": false,
		"SyntaxError": false,
		"TypeError": false,
		"Uint16Array": false,
		"Uint32Array": false,
		"Uint8Array": false,
		"Uint8ClampedArray": false,
		"undefined": false,
		"unescape": false,
		"URIError": false,
		"WeakMap": false,
		"WeakSet": false
	},
	"es2017": {
		"Array": false,
		"ArrayBuffer": false,
		"Atomics": false,
		"Boolean": false,
		"DataView": false,
		"Date": false,
		"decodeURI": false,
		"decodeURIComponent": false,
		"encodeURI": false,
		"encodeURIComponent": false,
		"Error": false,
		"escape": false,
		"eval": false,
		"EvalError": false,
		"Float32Array": false,
		"Float64Array": false,
		"Function": false,
		"Infinity": false,
		"Int16Array": false,
		"Int32Array": false,
		"Int8Array": false,
		"Intl": false,
		"isFinite": false,
		"isNaN": false,
		"JSON": false,
		"Map": false,
		"Math": false,
		"NaN": false,
		"Number": false,
		"Object": false,
		"parseFloat": false,
		"parseInt": false,
		"Promise": false,
		"Proxy": false,
		"RangeError": false,
		"ReferenceError": false,
		"Reflect": false,
		"RegExp": false,
		"Set": false,
		"SharedArrayBuffer": false,
		"String": false,
		"Symbol": false,
		"SyntaxError": false,
		"TypeError": false,
		"Uint16Array": false,
		"Uint32Array": false,
		"Uint8Array": false,
		"Uint8ClampedArray": false,
		"undefined": false,
		"unescape": false,
		"URIError": false,
		"WeakMap": false,
		"WeakSet": false
	},
	"es2018": {
		"Array": false,
		"ArrayBuffer": false,
		"Atomics": false,
		"Boolean": false,
		"DataView": false,
		"Date": false,
		"decodeURI": false,
		"decodeURIComponent": false,
		"encodeURI": false,
		"encodeURIComponent": false,
		"Error": false,
		"escape": false,
		"eval": false,
		"EvalError": false,
		"Float32Array": false,
		"Float64Array": false,
		"Function": false,
		"Infinity": false,
		"Int16Array": false,
		"Int32Array": false,
		"Int8Array": false,
		"Intl": false,
		"isFinite": false,
		"isNaN": false,
		"JSON": false,
		"Map": false,
		"Math": false,
		"NaN": false,
		"Number": false,
		"Object": false,
		"parseFloat": false,
		"parseInt": false,
		"Promise": false,
		"Proxy": false,
		"RangeError": false,
		"ReferenceError": false,
		"Reflect": false,
		"RegExp": false,
		"Set": false,
		"SharedArrayBuffer": false,
		"String": false,
		"Symbol": false,
		"SyntaxError": false,
		"TypeError": false,
		"Uint16Array": false,
		"Uint32Array": false,
		"Uint8Array": false,
		"Uint8ClampedArray": false,
		"undefined": false,
		"unescape": false,
		"URIError": false,
		"WeakMap": false,
		"WeakSet": false
	},
	"es2019": {
		"Array": false,
		"ArrayBuffer": false,
		"Atomics": false,
		"Boolean": false,
		"DataView": false,
		"Date": false,
		"decodeURI": false,
		"decodeURIComponent": false,
		"encodeURI": false,
		"encodeURIComponent": false,
		"Error": false,
		"escape": false,
		"eval": false,
		"EvalError": false,
		"Float32Array": false,
		"Float64Array": false,
		"Function": false,
		"Infinity": false,
		"Int16Array": false,
		"Int32Array": false,
		"Int8Array": false,
		"Intl": false,
		"isFinite": false,
		"isNaN": false,
		"JSON": false,
		"Map": false,
		"Math": false,
		"NaN": false,
		"Number": false,
		"Object": false,
		"parseFloat": false,
		"parseInt": false,
		"Promise": false,
		"Proxy": false,
		"RangeError": false,
		"ReferenceError": false,
		"Reflect": false,
		"RegExp": false,
		"Set": false,
		"SharedArrayBuffer": false,
		"String": false,
		"Symbol": false,
		"SyntaxError": false,
		"TypeError": false,
		"Uint16Array": false,
		"Uint32Array": false,
		"Uint8Array": false,
		"Uint8ClampedArray": false,
		"undefined": false,
		"unescape": false,
		"URIError": false,
		"WeakMap": false,
		"WeakSet": false
	},
	"es2020": {
		"Array": false,
		"ArrayBuffer": false,
		"Atomics": false,
		"BigInt": false,
		"BigInt64Array": false,
		"BigUint64Array": false,
		"Boolean": false,
		"DataView": false,
		"Date": false,
		"decodeURI": false,
		"decodeURIComponent": false,
		"encodeURI": false,
		"encodeURIComponent": false,
		"Error": false,
		"escape": false,
		"eval": false,
		"EvalError": false,
		"Float32Array": false,
		"Float64Array": false,
		"Function": false,
		"globalThis": false,
		"Infinity": false,
		"Int16Array": false,
		"Int32Array": false,
		"Int8Array": false,
		"Intl": false,
		"isFinite": false,
		"isNaN": false,
		"JSON": false,
		"Map": false,
		"Math": false,
		"NaN": false,
		"Number": false,
		"Object": false,
		"parseFloat": false,
		"parseInt": false,
		"Promise": false,
		"Proxy": false,
		"RangeError": false,
		"ReferenceError": false,
		"Reflect": false,
		"RegExp": false,
		"Set": false,
		"SharedArrayBuffer": false,
		"String": false,
		"Symbol": false,
		"SyntaxError": false,
		"TypeError": false,
		"Uint16Array": false,
		"Uint32Array": false,
		"Uint8Array": false,
		"Uint8ClampedArray": false,
		"undefined": false,
		"unescape": false,
		"URIError": false,
		"WeakMap": false,
		"WeakSet": false
	},
	"es2021": {
		"AggregateError": false,
		"Array": false,
		"ArrayBuffer": false,
		"Atomics": false,
		"BigInt": false,
		"BigInt64Array": false,
		"BigUint64Array": false,
		"Boolean": false,
		"DataView": false,
		"Date": false,
		"decodeURI": false,
		"decodeURIComponent": false,
		"encodeURI": false,
		"encodeURIComponent": false,
		"Error": false,
		"escape": false,
		"eval": false,
		"EvalError": false,
		"FinalizationRegistry": false,
		"Float32Array": false,
		"Float64Array": false,
		"Function": false,
		"globalThis": false,
		"Infinity": false,
		"Int16Array": false,
		"Int32Array": false,
		"Int8Array": false,
		"Intl": false,
		"isFinite": false,
		"isNaN": false,
		"JSON": false,
		"Map": false,
		"Math": false,
		"NaN": false,
		"Number": false,
		"Object": false,
		"parseFloat": false,
		"parseInt": false,
		"Promise": false,
		"Proxy": false,
		"RangeError": false,
		"ReferenceError": false,
		"Reflect": false,
		"RegExp": false,
		"Set": false,
		"SharedArrayBuffer": false,
		"String": false,
		"Symbol": false,
		"SyntaxError": false,
		"TypeError": false,
		"Uint16Array": false,
		"Uint32Array": false,
		"Uint8Array": false,
		"Uint8ClampedArray": false,
		"undefined": false,
		"unescape": false,
		"URIError": false,
		"WeakMap": false,
		"WeakRef": false,
		"WeakSet": false
	},
	"es2022": {
		"AggregateError": false,
		"Array": false,
		"ArrayBuffer": false,
		"Atomics": false,
		"BigInt": false,
		"BigInt64Array": false,
		"BigUint64Array": false,
		"Boolean": false,
		"DataView": false,
		"Date": false,
		"decodeURI": false,
		"decodeURIComponent": false,
		"encodeURI": false,
		"encodeURIComponent": false,
		"Error": false,
		"escape": false,
		"eval": false,
		"EvalError": false,
		"FinalizationRegistry": false,
		"Float32Array": false,
		"Float64Array": false,
		"Function": false,
		"globalThis": false,
		"Infinity": false,
		"Int16Array": false,
		"Int32Array": false,
		"Int8Array": false,
		"Intl": false,
		"isFinite": false,
		"isNaN": false,
		"JSON": false,
		"Map": false,
		"Math": false,
		"NaN": false,
		"Number": false,
		"Object": false,
		"parseFloat": false,
		"parseInt": false,
		"Promise": false,
		"Proxy": false,
		"RangeError": false,
		"ReferenceError": false,
		"Reflect": false,
		"RegExp": false,
		"Set": false,
		"SharedArrayBuffer": false,
		"String": false,
		"Symbol": false,
		"SyntaxError": false,
		"TypeError": false,
		"Uint16Array": false,
		"Uint32Array": false,
		"Uint8Array": false,
		"Uint8ClampedArray": false,
		"undefined": false,
		"unescape": false,
		"URIError": false,
		"WeakMap": false,
		"WeakRef": false,
		"WeakSet": false
	},
	"es2023": {
		"AggregateError": false,
		"Array": false,
		"ArrayBuffer": false,
		"Atomics": false,
		"BigInt": false,
		"BigInt64Array": false,
		"BigUint64Array": false,
		"Boolean": false,
		"DataView": false,
		"Date": false,
		"decodeURI": false,
		"decodeURIComponent": false,
		"encodeURI": false,
		"encodeURIComponent": false,
		"Error": false,
		"escape": false,
		"eval": false,
		"EvalError": false,
		"FinalizationRegistry": false,
		"Float32Array": false,
		"Float64Array": false,
		"Function": false,
		"globalThis": false,
		"Infinity": false,
		"Int16Array": false,
		"Int32Array": false,
		"Int8Array": false,
		"Intl": false,
		"isFinite": false,
		"isNaN": false,
		"JSON": false,
		"Map": false,
		"Math": false,
		"NaN": false,
		"Number": false,
		"Object": false,
		"parseFloat": false,
		"parseInt": false,
		"Promise": false,
		"Proxy": false,
		"RangeError": false,
		"ReferenceError": false,
		"Reflect": false,
		"RegExp": false,
		"Set": false,
		"SharedArrayBuffer": false,
		"String": false,
		"Symbol": false,
		"SyntaxError": false,
		"TypeError": false,
		"Uint16Array": false,
		"Uint32Array": false,
		"Uint8Array": false,
		"Uint8ClampedArray": false,
		"undefined": false,
		"unescape": false,
		"URIError": false,
		"WeakMap": false,
		"WeakRef": false,
		"WeakSet": false
	},
	"es2024": {
		"AggregateError": false,
		"Array": false,
		"ArrayBuffer": false,
		"Atomics": false,
		"BigInt": false,
		"BigInt64Array": false,
		"BigUint64Array": false,
		"Boolean": false,
		"DataView": false,
		"Date": false,
		"decodeURI": false,
		"decodeURIComponent": false,
		"encodeURI": false,
		"encodeURIComponent": false,
		"Error": false,
		"escape": false,
		"eval": false,
		"EvalError": false,
		"FinalizationRegistry": false,
		"Float32Array": false,
		"Float64Array": false,
		"Function": false,
		"globalThis": false,
		"Infinity": false,
		"Int16Array": false,
		"Int32Array": false,
		"Int8Array": false,
		"Intl": false,
		"isFinite": false,
		"isNaN": false,
		"JSON": false,
		"Map": false,
		"Math": false,
		"NaN": false,
		"Number": false,
		"Object": false,
		"parseFloat": false,
		"parseInt": false,
		"Promise": false,
		"Proxy": false,
		"RangeError": false,
		"ReferenceError": false,
		"Reflect": false,
		"RegExp": false,
		"Set": false,
		"SharedArrayBuffer": false,
		"String": false,
		"Symbol": false,
		"SyntaxError": false,
		"TypeError": false,
		"Uint16Array": false,
		"Uint32Array": false,
		"Uint8Array": false,
		"Uint8ClampedArray": false,
		"undefined": false,
		"unescape": false,
		"URIError": false,
		"WeakMap": false,
		"WeakRef": false,
		"WeakSet": false
	},
	"es2025": {
		"AggregateError": false,
		"Array": false,
		"ArrayBuffer": false,
		"Atomics": false,
		"BigInt": false,
		"BigInt64Array": false,
		"BigUint64Array": false,
		"Boolean": false,
		"DataView": false,
		"Date": false,
		"decodeURI": false,
		"decodeURIComponent": false,
		"encodeURI": false,
		"encodeURIComponent": false,
		"Error": false,
		"escape": false,
		"eval": false,
		"EvalError": false,
		"FinalizationRegistry": false,
		"Float16Array": false,
		"Float32Array": false,
		"Float64Array": false,
		"Function": false,
		"globalThis": false,
		"Infinity": false,
		"Int16Array": false,
		"Int32Array": false,
		"Int8Array": false,
		"Intl": false,
		"isFinite": false,
		"isNaN": false,
		"Iterator": false,
		"JSON": false,
		"Map": false,
		"Math": false,
		"NaN": false,
		"Number": false,
		"Object": false,
		"parseFloat": false,
		"parseInt": false,
		"Promise": false,
		"Proxy": false,
		"RangeError": false,
		"ReferenceError": false,
		"Reflect": false,
		"RegExp": false,
		"Set": false,
		"SharedArrayBuffer": false,
		"String": false,
		"Symbol": false,
		"SyntaxError": false,
		"TypeError": false,
		"Uint16Array": false,
		"Uint32Array": false,
		"Uint8Array": false,
		"Uint8ClampedArray": false,
		"undefined": false,
		"unescape": false,
		"URIError": false,
		"WeakMap": false,
		"WeakRef": false,
		"WeakSet": false
	},
	"es2026": {
		"AggregateError": false,
		"Array": false,
		"ArrayBuffer": false,
		"Atomics": false,
		"BigInt": false,
		"BigInt64Array": false,
		"BigUint64Array": false,
		"Boolean": false,
		"DataView": false,
		"Date": false,
		"decodeURI": false,
		"decodeURIComponent": false,
		"encodeURI": false,
		"encodeURIComponent": false,
		"Error": false,
		"escape": false,
		"eval": false,
		"EvalError": false,
		"FinalizationRegistry": false,
		"Float16Array": false,
		"Float32Array": false,
		"Float64Array": false,
		"Function": false,
		"globalThis": false,
		"Infinity": false,
		"Int16Array": false,
		"Int32Array": false,
		"Int8Array": false,
		"Intl": false,
		"isFinite": false,
		"isNaN": false,
		"Iterator": false,
		"JSON": false,
		"Map": false,
		"Math": false,
		"NaN": false,
		"Number": false,
		"Object": false,
		"parseFloat": false,
		"parseInt": false,
		"Promise": false,
		"Proxy": false,
		"RangeError": false,
		"ReferenceError": false,
		"Reflect": false,
		"RegExp": false,
		"Set": false,
		"SharedArrayBuffer": false,
		"String": false,
		"Symbol": false,
		"SyntaxError": false,
		"TypeError": false,
		"Uint16Array": false,
		"Uint32Array": false,
		"Uint8Array": false,
		"Uint8ClampedArray": false,
		"undefined": false,
		"unescape": false,
		"URIError": false,
		"WeakMap": false,
		"WeakRef": false,
		"WeakSet": false
	},
	"es2027": {
		"AggregateError": false,
		"Array": false,
		"ArrayBuffer": false,
		"AsyncDisposableStack": false,
		"Atomics": false,
		"BigInt": false,
		"BigInt64Array": false,
		"BigUint64Array": false,
		"Boolean": false,
		"DataView": false,
		"Date": false,
		"decodeURI": false,
		"decodeURIComponent": false,
		"DisposableStack": false,
		"encodeURI": false,
		"encodeURIComponent": false,
		"Error": false,
		"escape": false,
		"eval": false,
		"EvalError": false,
		"FinalizationRegistry": false,
		"Float16Array": false,
		"Float32Array": false,
		"Float64Array": false,
		"Function": false,
		"globalThis": false,
		"Infinity": false,
		"Int16Array": false,
		"Int32Array": false,
		"Int8Array": false,
		"Intl": false,
		"isFinite": false,
		"isNaN": false,
		"Iterator": false,
		"JSON": false,
		"Map": false,
		"Math": false,
		"NaN": false,
		"Number": false,
		"Object": false,
		"parseFloat": false,
		"parseInt": false,
		"Promise": false,
		"Proxy": false,
		"RangeError": false,
		"ReferenceError": false,
		"Reflect": false,
		"RegExp": false,
		"Set": false,
		"SharedArrayBuffer": false,
		"String": false,
		"SuppressedError": false,
		"Symbol": false,
		"SyntaxError": false,
		"TypeError": false,
		"Uint16Array": false,
		"Uint32Array": false,
		"Uint8Array": false,
		"Uint8ClampedArray": false,
		"undefined": false,
		"unescape": false,
		"URIError": false,
		"WeakMap": false,
		"WeakRef": false,
		"WeakSet": false
	},
	"es3": {
		"Array": false,
		"Boolean": false,
		"Date": false,
		"decodeURI": false,
		"decodeURIComponent": false,
		"encodeURI": false,
		"encodeURIComponent": false,
		"Error": false,
		"escape": false,
		"eval": false,
		"EvalError": false,
		"Function": false,
		"Infinity": false,
		"isFinite": false,
		"isNaN": false,
		"Math": false,
		"NaN": false,
		"Number": false,
		"Object": false,
		"parseFloat": false,
		"parseInt": false,
		"RangeError": false,
		"ReferenceError": false,
		"RegExp": false,
		"String": false,
		"SyntaxError": false,
		"TypeError": false,
		"undefined": false,
		"unescape": false,
		"URIError": false
	},
	"es5": {
		"Array": false,
		"Boolean": false,
		"Date": false,
		"decodeURI": false,
		"decodeURIComponent": false,
		"encodeURI": false,
		"encodeURIComponent": false,
		"Error": false,
		"escape": false,
		"eval": false,
		"EvalError": false,
		"Function": false,
		"Infinity": false,
		"isFinite": false,
		"isNaN": false,
		"JSON": false,
		"Math": false,
		"NaN": false,
		"Number": false,
		"Object": false,
		"parseFloat": false,
		"parseInt": false,
		"RangeError": false,
		"ReferenceError": false,
		"RegExp": false,
		"String": false,
		"SyntaxError": false,
		"TypeError": false,
		"undefined": false,
		"unescape": false,
		"URIError": false
	},
	"greasemonkey": {
		"cloneInto": false,
		"createObjectIn": false,
		"exportFunction": false,
		"GM": false,
		"GM_addElement": false,
		"GM_addStyle": false,
		"GM_addValueChangeListener": false,
		"GM_deleteValue": false,
		"GM_deleteValues": false,
		"GM_download": false,
		"GM_getResourceText": false,
		"GM_getResourceURL": false,
		"GM_getTab": false,
		"GM_getTabs": false,
		"GM_getValue": false,
		"GM_getValues": false,
		"GM_info": false,
		"GM_listValues": false,
		"GM_log": false,
		"GM_notification": false,
		"GM_openInTab": false,
		"GM_registerMenuCommand": false,
		"GM_removeValueChangeListener": false,
		"GM_saveTab": false,
		"GM_setClipboard": false,
		"GM_setValue": false,
		"GM_setValues": false,
		"GM_unregisterMenuCommand": false,
		"GM_xmlhttpRequest": false,
		"unsafeWindow": false
	},
	"jasmine": {
		"afterAll": false,
		"afterEach": false,
		"beforeAll": false,
		"beforeEach": false,
		"describe": false,
		"expect": false,
		"expectAsync": false,
		"fail": false,
		"fdescribe": false,
		"fit": false,
		"it": false,
		"jasmine": false,
		"pending": false,
		"runs": false,
		"spyOn": false,
		"spyOnAllFunctions": false,
		"spyOnProperty": false,
		"throwUnless": false,
		"throwUnlessAsync": false,
		"waits": false,
		"waitsFor": false,
		"xdescribe": false,
		"xit": false
	},
	"jest": {
		"afterAll": false,
		"afterEach": false,
		"beforeAll": false,
		"beforeEach": false,
		"describe": false,
		"expect": false,
		"fit": false,
		"it": false,
		"jest": false,
		"test": false,
		"xdescribe": false,
		"xit": false,
		"xtest": false
	},
	"jquery": {
		"$": false,
		"jQuery": false
	},
	"meteor": {
		"$": false,
		"Accounts": false,
		"AccountsClient": false,
		"AccountsCommon": false,
		"AccountsServer": false,
		"App": false,
		"Assets": false,
		"Blaze": false,
		"check": false,
		"Cordova": false,
		"DDP": false,
		"DDPRateLimiter": false,
		"DDPServer": false,
		"Deps": false,
		"EJSON": false,
		"Email": false,
		"HTTP": false,
		"Log": false,
		"Match": false,
		"Meteor": false,
		"Mongo": false,
		"MongoInternals": false,
		"Npm": false,
		"Package": false,
		"Plugin": false,
		"process": false,
		"Random": false,
		"ReactiveDict": false,
		"ReactiveVar": false,
		"Router": false,
		"ServiceConfiguration": false,
		"Session": false,
		"share": false,
		"Spacebars": false,
		"Template": false,
		"Tinytest": false,
		"Tracker": false,
		"UI": false,
		"Utils": false,
		"WebApp": false,
		"WebAppInternals": false
	},
	"mocha": {
		"after": false,
		"afterEach": false,
		"before": false,
		"beforeEach": false,
		"context": false,
		"describe": false,
		"it": false,
		"mocha": false,
		"run": false,
		"setup": false,
		"specify": false,
		"suite": false,
		"suiteSetup": false,
		"suiteTeardown": false,
		"teardown": false,
		"test": false,
		"xcontext": false,
		"xdescribe": false,
		"xit": false,
		"xspecify": false
	},
	"mongo": {
		"_isWindows": false,
		"_rand": false,
		"BulkWriteResult": false,
		"cat": false,
		"cd": false,
		"connect": false,
		"db": false,
		"getHostName": false,
		"getMemInfo": false,
		"hostname": false,
		"ISODatejc": false,
		"listFiles": false,
		"load": false,
		"ls": false,
		"md5sumFile": false,
		"mkdir": false,
		"Mongo": false,
		"NumberInt": false,
		"NumberLong": false,
		"ObjectId": false,
		"PlanCache": false,
		"print": false,
		"printjson": false,
		"pwd": false,
		"quit": false,
		"removeFile": false,
		"rs": false,
		"sh": false,
		"UUID": false,
		"version": false,
		"WriteResult": false
	},
	"nashorn": {
		"__DIR__": false,
		"__FILE__": false,
		"__LINE__": false,
		"com": false,
		"edu": false,
		"exit": false,
		"java": false,
		"Java": false,
		"javafx": false,
		"JavaImporter": false,
		"javax": false,
		"JSAdapter": false,
		"load": false,
		"loadWithNewGlobal": false,
		"org": false,
		"Packages": false,
		"print": false,
		"quit": false
	},
	"node": {
		"__dirname": false,
		"__filename": false,
		"AbortController": false,
		"AbortSignal": false,
		"atob": false,
		"Blob": false,
		"BroadcastChannel": false,
		"btoa": false,
		"Buffer": false,
		"ByteLengthQueuingStrategy": false,
		"clearImmediate": false,
		"clearInterval": false,
		"clearTimeout": false,
		"CloseEvent": false,
		"CompressionStream": false,
		"console": false,
		"CountQueuingStrategy": false,
		"crypto": false,
		"Crypto": false,
		"CryptoKey": false,
		"CustomEvent": false,
		"DecompressionStream": false,
		"DOMException": false,
		"ErrorEvent": false,
		"Event": false,
		"EventTarget": false,
		"exports": true,
		"fetch": false,
		"File": false,
		"FormData": false,
		"global": false,
		"Headers": false,
		"localStorage": false,
		"MessageChannel": false,
		"MessageEvent": false,
		"MessagePort": false,
		"module": false,
		"navigator": false,
		"Navigator": false,
		"performance": false,
		"Performance": false,
		"PerformanceEntry": false,
		"PerformanceMark": false,
		"PerformanceMeasure": false,
		"PerformanceObserver": false,
		"PerformanceObserverEntryList": false,
		"PerformanceResourceTiming": false,
		"process": false,
		"queueMicrotask": false,
		"QuotaExceededError": false,
		"ReadableByteStreamController": false,
		"ReadableStream": false,
		"ReadableStreamBYOBReader": false,
		"ReadableStreamBYOBRequest": false,
		"ReadableStreamDefaultController": false,
		"ReadableStreamDefaultReader": false,
		"Request": false,
		"require": false,
		"Response": false,
		"sessionStorage": false,
		"setImmediate": false,
		"setInterval": false,
		"setTimeout": false,
		"Storage": false,
		"structuredClone": false,
		"SubtleCrypto": false,
		"Temporal": false,
		"TextDecoder": false,
		"TextDecoderStream": false,
		"TextEncoder": false,
		"TextEncoderStream": false,
		"TransformStream": false,
		"TransformStreamDefaultController": false,
		"URL": false,
		"URLPattern": false,
		"URLSearchParams": false,
		"WebAssembly": false,
		"WebSocket": false,
		"WritableStream": false,
		"WritableStreamDefaultController": false,
		"WritableStreamDefaultWriter": false
	},
	"nodeBuiltin": {
		"AbortController": false,
		"AbortSignal": false,
		"atob": false,
		"Blob": false,
		"BroadcastChannel": false,
		"btoa": false,
		"Buffer": false,
		"ByteLengthQueuingStrategy": false,
		"clearImmediate": false,
		"clearInterval": false,
		"clearTimeout": false,
		"CloseEvent": false,
		"CompressionStream": false,
		"console": false,
		"CountQueuingStrategy": false,
		"crypto": false,
		"Crypto": false,
		"CryptoKey": false,
		"CustomEvent": false,
		"DecompressionStream": false,
		"DOMException": false,
		"ErrorEvent": false,
		"Event": false,
		"EventTarget": false,
		"fetch": false,
		"File": false,
		"FormData": false,
		"global": false,
		"Headers": false,
		"localStorage": false,
		"MessageChannel": false,
		"MessageEvent": false,
		"MessagePort": false,
		"navigator": false,
		"Navigator": false,
		"performance": false,
		"Performance": false,
		"PerformanceEntry": false,
		"PerformanceMark": false,
		"PerformanceMeasure": false,
		"PerformanceObserver": false,
		"PerformanceObserverEntryList": false,
		"PerformanceResourceTiming": false,
		"process": false,
		"queueMicrotask": false,
		"QuotaExceededError": false,
		"ReadableByteStreamController": false,
		"ReadableStream": false,
		"ReadableStreamBYOBReader": false,
		"ReadableStreamBYOBRequest": false,
		"ReadableStreamDefaultController": false,
		"ReadableStreamDefaultReader": false,
		"Request": false,
		"Response": false,
		"sessionStorage": false,
		"setImmediate": false,
		"setInterval": false,
		"setTimeout": false,
		"Storage": false,
		"structuredClone": false,
		"SubtleCrypto": false,
		"Temporal": false,
		"TextDecoder": false,
		"TextDecoderStream": false,
		"TextEncoder": false,
		"TextEncoderStream": false,
		"TransformStream": false,
		"TransformStreamDefaultController": false,
		"URL": false,
		"URLPattern": false,
		"URLSearchParams": false,
		"WebAssembly": false,
		"WebSocket": false,
		"WritableStream": false,
		"WritableStreamDefaultController": false,
		"WritableStreamDefaultWriter": false
	},
	"paintWorklet": {
		"ByteLengthQueuingStrategy": false,
		"console": false,
		"CountQueuingStrategy": false,
		"CSSImageValue": false,
		"CSSKeywordValue": false,
		"CSSMathClamp": false,
		"CSSMathInvert": false,
		"CSSMathMax": false,
		"CSSMathMin": false,
		"CSSMathNegate": false,
		"CSSMathProduct": false,
		"CSSMathSum": false,
		"CSSMathValue": false,
		"CSSMatrixComponent": false,
		"CSSNumericArray": false,
		"CSSNumericValue": false,
		"CSSPerspective": false,
		"CSSPositionValue": false,
		"CSSRotate": false,
		"CSSScale": false,
		"CSSSkew": false,
		"CSSSkewX": false,
		"CSSSkewY": false,
		"CSSStyleValue": false,
		"CSSTransformComponent": false,
		"CSSTransformValue": false,
		"CSSTranslate": false,
		"CSSUnitValue": false,
		"CSSUnparsedValue": false,
		"CSSVariableReferenceValue": false,
		"devicePixelRatio": false,
		"PaintRenderingContext2D": false,
		"PaintSize": false,
		"PaintWorkletGlobalScope": false,
		"Path2D": false,
		"QuotaExceededError": false,
		"ReadableByteStreamController": false,
		"ReadableStream": false,
		"ReadableStreamBYOBReader": false,
		"ReadableStreamBYOBRequest": false,
		"ReadableStreamDefaultController": false,
		"ReadableStreamDefaultReader": false,
		"registerPaint": false,
		"StylePropertyMapReadOnly": false,
		"Temporal": false,
		"TransformStream": false,
		"TransformStreamDefaultController": false,
		"WebAssembly": false,
		"WorkletGlobalScope": false,
		"WritableStream": false,
		"WritableStreamDefaultController": false,
		"WritableStreamDefaultWriter": false
	},
	"phantomjs": {
		"console": true,
		"exports": true,
		"phantom": true,
		"require": true,
		"WebPage": true
	},
	"prototypejs": {
		"$": false,
		"$$": false,
		"$A": false,
		"$break": false,
		"$continue": false,
		"$F": false,
		"$H": false,
		"$R": false,
		"$w": false,
		"Abstract": false,
		"Ajax": false,
		"Autocompleter": false,
		"Builder": false,
		"Class": false,
		"Control": false,
		"Draggable": false,
		"Draggables": false,
		"Droppables": false,
		"Effect": false,
		"Element": false,
		"Enumerable": false,
		"Event": false,
		"Field": false,
		"Form": false,
		"Hash": false,
		"Insertion": false,
		"ObjectRange": false,
		"PeriodicalExecuter": false,
		"Position": false,
		"Prototype": false,
		"Scriptaculous": false,
		"Selector": false,
		"Sortable": false,
		"SortableObserver": false,
		"Sound": false,
		"Template": false,
		"Toggle": false,
		"Try": false
	},
	"protractor": {
		"$": false,
		"$$": false,
		"browser": false,
		"by": false,
		"By": false,
		"DartObject": false,
		"element": false,
		"protractor": false
	},
	"qunit": {
		"asyncTest": false,
		"deepEqual": false,
		"equal": false,
		"expect": false,
		"module": false,
		"notDeepEqual": false,
		"notEqual": false,
		"notOk": false,
		"notPropEqual": false,
		"notStrictEqual": false,
		"ok": false,
		"propEqual": false,
		"QUnit": false,
		"raises": false,
		"start": false,
		"stop": false,
		"strictEqual": false,
		"test": false,
		"throws": false
	},
	"rhino": {
		"defineClass": false,
		"deserialize": false,
		"gc": false,
		"help": false,
		"importClass": false,
		"importPackage": false,
		"java": false,
		"load": false,
		"loadClass": false,
		"Packages": false,
		"print": false,
		"quit": false,
		"readFile": false,
		"readUrl": false,
		"runCommand": false,
		"seal": false,
		"serialize": false,
		"spawn": false,
		"sync": false,
		"toint32": false,
		"version": false
	},
	"rspack": {
		"__non_webpack_require__": false,
		"__resourceQuery": false,
		"__rspack_unique_id__": false,
		"__rspack_version__": false,
		"__system_context__": false,
		"__webpack_base_uri__": true,
		"__webpack_chunk_load__": true,
		"__webpack_chunkname__": false,
		"__webpack_exports_info__": false,
		"__webpack_get_script_filename__": true,
		"__webpack_hash__": false,
		"__webpack_init_sharing__": false,
		"__webpack_is_included__": false,
		"__webpack_module__": false,
		"__webpack_modules__": false,
		"__webpack_nonce__": true,
		"__webpack_public_path__": true,
		"__webpack_require__": false,
		"__webpack_runtime_id__": false,
		"__webpack_share_scopes__": false
	},
	"serviceworker": {
		"AbortController": false,
		"AbortPaymentEvent": false,
		"AbortSignal": false,
		"addEventListener": false,
		"ai": false,
		"AI": false,
		"AICreateMonitor": false,
		"atob": false,
		"BackgroundFetchEvent": false,
		"BackgroundFetchManager": false,
		"BackgroundFetchRecord": false,
		"BackgroundFetchRegistration": false,
		"BackgroundFetchUpdateUIEvent": false,
		"BarcodeDetector": false,
		"Blob": false,
		"BroadcastChannel": false,
		"btoa": false,
		"ByteLengthQueuingStrategy": false,
		"Cache": false,
		"caches": false,
		"CacheStorage": false,
		"CanMakePaymentEvent": false,
		"CanvasGradient": false,
		"CanvasPattern": false,
		"clearInterval": false,
		"clearTimeout": false,
		"Client": false,
		"clients": false,
		"Clients": false,
		"CloseEvent": false,
		"CompressionStream": false,
		"console": false,
		"cookieStore": false,
		"CookieStore": false,
		"CookieStoreManager": false,
		"CountQueuingStrategy": false,
		"createImageBitmap": false,
		"CreateMonitor": false,
		"CropTarget": false,
		"crossOriginIsolated": false,
		"crypto": false,
		"Crypto": false,
		"CryptoKey": false,
		"CSSImageValue": false,
		"CSSKeywordValue": false,
		"CSSMathClamp": false,
		"CSSMathInvert": false,
		"CSSMathMax": false,
		"CSSMathMin": false,
		"CSSMathNegate": false,
		"CSSMathProduct": false,
		"CSSMathSum": false,
		"CSSMathValue": false,
		"CSSMatrixComponent": false,
		"CSSNumericArray": false,
		"CSSNumericValue": false,
		"CSSPerspective": false,
		"CSSRotate": false,
		"CSSScale": false,
		"CSSSkew": false,
		"CSSSkewX": false,
		"CSSSkewY": false,
		"CSSStyleValue": false,
		"CSSTransformComponent": false,
		"CSSTransformValue": false,
		"CSSTranslate": false,
		"CSSUnitValue": false,
		"CSSUnparsedValue": false,
		"CSSVariableReferenceValue": false,
		"CustomEvent": false,
		"DecompressionStream": false,
		"dispatchEvent": false,
		"DOMException": false,
		"DOMMatrix": false,
		"DOMMatrixReadOnly": false,
		"DOMPoint": false,
		"DOMPointReadOnly": false,
		"DOMQuad": false,
		"DOMRect": false,
		"DOMRectReadOnly": false,
		"DOMStringList": false,
		"ErrorEvent": false,
		"Event": false,
		"EventSource": false,
		"EventTarget": false,
		"ExtendableCookieChangeEvent": false,
		"ExtendableEvent": false,
		"ExtendableMessageEvent": false,
		"fetch": false,
		"FetchEvent": false,
		"File": false,
		"FileList": false,
		"FileReader": false,
		"FileSystemDirectoryHandle": false,
		"FileSystemFileHandle": false,
		"FileSystemHandle": false,
		"FileSystemWritableFileStream": false,
		"FontFace": false,
		"FontFaceSet": false,
		"FontFaceSetLoadEvent": false,
		"fonts": false,
		"FormData": false,
		"GPU": false,
		"GPUAdapter": false,
		"GPUAdapterInfo": false,
		"GPUBindGroup": false,
		"GPUBindGroupLayout": false,
		"GPUBuffer": false,
		"GPUBufferUsage": false,
		"GPUCanvasContext": false,
		"GPUColorWrite": false,
		"GPUCommandBuffer": false,
		"GPUCommandEncoder": false,
		"GPUCompilationInfo": false,
		"GPUCompilationMessage": false,
		"GPUComputePassEncoder": false,
		"GPUComputePipeline": false,
		"GPUDevice": false,
		"GPUDeviceLostInfo": false,
		"GPUError": false,
		"GPUExternalTexture": false,
		"GPUInternalError": false,
		"GPUMapMode": false,
		"GPUOutOfMemoryError": false,
		"GPUPipelineError": false,
		"GPUPipelineLayout": false,
		"GPUQuerySet": false,
		"GPUQueue": false,
		"GPURenderBundle": false,
		"GPURenderBundleEncoder": false,
		"GPURenderPassEncoder": false,
		"GPURenderPipeline": false,
		"GPUSampler": false,
		"GPUShaderModule": false,
		"GPUShaderStage": false,
		"GPUSupportedFeatures": false,
		"GPUSupportedLimits": false,
		"GPUTexture": false,
		"GPUTextureUsage": false,
		"GPUTextureView": false,
		"GPUUncapturedErrorEvent": false,
		"GPUValidationError": false,
		"Headers": false,
		"IDBCursor": false,
		"IDBCursorWithValue": false,
		"IDBDatabase": false,
		"IDBFactory": false,
		"IDBIndex": false,
		"IDBKeyRange": false,
		"IDBObjectStore": false,
		"IDBOpenDBRequest": false,
		"IDBRecord": false,
		"IDBRequest": false,
		"IDBTransaction": false,
		"IDBVersionChangeEvent": false,
		"ImageBitmap": false,
		"ImageBitmapRenderingContext": false,
		"ImageData": false,
		"importScripts": false,
		"indexedDB": false,
		"InstallEvent": false,
		"isSecureContext": false,
		"LanguageDetector": false,
		"location": false,
		"Lock": false,
		"LockManager": false,
		"MediaCapabilities": false,
		"MessageChannel": false,
		"MessageEvent": false,
		"MessagePort": false,
		"NavigationPreloadManager": false,
		"navigator": false,
		"NavigatorUAData": false,
		"NetworkInformation": false,
		"Notification": false,
		"NotificationEvent": false,
		"Observable": false,
		"OffscreenCanvas": false,
		"OffscreenCanvasRenderingContext2D": false,
		"onabortpayment": true,
		"onactivate": true,
		"onbackgroundfetchabort": true,
		"onbackgroundfetchclick": true,
		"onbackgroundfetchfail": true,
		"onbackgroundfetchsuccess": true,
		"oncanmakepayment": true,
		"oncookiechange": true,
		"onerror": true,
		"onfetch": true,
		"oninstall": true,
		"onlanguagechange": true,
		"onmessage": true,
		"onmessageerror": true,
		"onnotificationclick": true,
		"onnotificationclose": true,
		"onoffline": true,
		"ononline": true,
		"onpaymentrequest": true,
		"onperiodicsync": true,
		"onpush": true,
		"onpushsubscriptionchange": true,
		"onrejectionhandled": true,
		"onsync": true,
		"onunhandledrejection": true,
		"origin": false,
		"Origin": false,
		"Path2D": false,
		"PaymentRequestEvent": false,
		"performance": false,
		"Performance": false,
		"PerformanceEntry": false,
		"PerformanceMark": false,
		"PerformanceMeasure": false,
		"PerformanceObserver": false,
		"PerformanceObserverEntryList": false,
		"PerformanceResourceTiming": false,
		"PerformanceServerTiming": false,
		"PeriodicSyncEvent": false,
		"PeriodicSyncManager": false,
		"Permissions": false,
		"PermissionStatus": false,
		"ProgressEvent": false,
		"PromiseRejectionEvent": false,
		"PushEvent": false,
		"PushManager": false,
		"PushMessageData": false,
		"PushSubscription": false,
		"PushSubscriptionChangeEvent": false,
		"PushSubscriptionOptions": false,
		"queueMicrotask": false,
		"QuotaExceededError": false,
		"ReadableByteStreamController": false,
		"ReadableStream": false,
		"ReadableStreamBYOBReader": false,
		"ReadableStreamBYOBRequest": false,
		"ReadableStreamDefaultController": false,
		"ReadableStreamDefaultReader": false,
		"registration": false,
		"removeEventListener": false,
		"ReportBody": false,
		"reportError": false,
		"ReportingObserver": false,
		"Request": false,
		"Response": false,
		"RestrictionTarget": false,
		"scheduler": false,
		"Scheduler": false,
		"SecurityPolicyViolationEvent": false,
		"self": false,
		"serviceWorker": false,
		"ServiceWorker": false,
		"ServiceWorkerContainer": false,
		"ServiceWorkerGlobalScope": false,
		"ServiceWorkerRegistration": false,
		"setInterval": false,
		"setTimeout": false,
		"skipWaiting": false,
		"StorageBucket": false,
		"StorageBucketManager": false,
		"StorageManager": false,
		"structuredClone": false,
		"StylePropertyMapReadOnly": false,
		"Subscriber": false,
		"SubtleCrypto": false,
		"SyncEvent": false,
		"SyncManager": false,
		"TaskController": false,
		"TaskPriorityChangeEvent": false,
		"TaskSignal": false,
		"Temporal": false,
		"TextDecoder": false,
		"TextDecoderStream": false,
		"TextEncoder": false,
		"TextEncoderStream": false,
		"TextMetrics": false,
		"TransformStream": false,
		"TransformStreamDefaultController": false,
		"TrustedHTML": false,
		"TrustedScript": false,
		"TrustedScriptURL": false,
		"TrustedTypePolicy": false,
		"TrustedTypePolicyFactory": false,
		"trustedTypes": false,
		"URL": false,
		"URLPattern": false,
		"URLSearchParams": false,
		"UserActivation": false,
		"WebAssembly": false,
		"WebGL2RenderingContext": false,
		"WebGLActiveInfo": false,
		"WebGLBuffer": false,
		"WebGLContextEvent": false,
		"WebGLFramebuffer": false,
		"WebGLObject": false,
		"WebGLProgram": false,
		"WebGLQuery": false,
		"WebGLRenderbuffer": false,
		"WebGLRenderingContext": false,
		"WebGLSampler": false,
		"WebGLShader": false,
		"WebGLShaderPrecisionFormat": false,
		"WebGLSync": false,
		"WebGLTexture": false,
		"WebGLTransformFeedback": false,
		"WebGLUniformLocation": false,
		"WebGLVertexArrayObject": false,
		"WebSocket": false,
		"WebSocketError": false,
		"WebSocketStream": false,
		"WebTransport": false,
		"WebTransportBidirectionalStream": false,
		"WebTransportDatagramDuplexStream": false,
		"WebTransportDatagramsWritable": false,
		"WebTransportError": false,
		"WebTransportReceiveStream": false,
		"WebTransportSendGroup": false,
		"WebTransportSendStream": false,
		"WGSLLanguageFeatures": false,
		"when": false,
		"WindowClient": false,
		"WorkerGlobalScope": false,
		"WorkerLocation": false,
		"WorkerNavigator": false,
		"WritableStream": false,
		"WritableStreamDefaultController": false,
		"WritableStreamDefaultWriter": false
	},
	"shared-node-browser": {
		"AbortController": false,
		"AbortSignal": false,
		"atob": false,
		"Blob": false,
		"BroadcastChannel": false,
		"btoa": false,
		"ByteLengthQueuingStrategy": false,
		"clearInterval": false,
		"clearTimeout": false,
		"CloseEvent": false,
		"CompressionStream": false,
		"console": false,
		"CountQueuingStrategy": false,
		"crypto": false,
		"Crypto": false,
		"CryptoKey": false,
		"CustomEvent": false,
		"DecompressionStream": false,
		"DOMException": false,
		"ErrorEvent": false,
		"Event": false,
		"EventTarget": false,
		"fetch": false,
		"File": false,
		"FormData": false,
		"Headers": false,
		"localStorage": false,
		"MessageChannel": false,
		"MessageEvent": false,
		"MessagePort": false,
		"navigator": false,
		"Navigator": false,
		"performance": false,
		"Performance": false,
		"PerformanceEntry": false,
		"PerformanceMark": false,
		"PerformanceMeasure": false,
		"PerformanceObserver": false,
		"PerformanceObserverEntryList": false,
		"PerformanceResourceTiming": false,
		"queueMicrotask": false,
		"QuotaExceededError": false,
		"ReadableByteStreamController": false,
		"ReadableStream": false,
		"ReadableStreamBYOBReader": false,
		"ReadableStreamBYOBRequest": false,
		"ReadableStreamDefaultController": false,
		"ReadableStreamDefaultReader": false,
		"Request": false,
		"Response": false,
		"sessionStorage": false,
		"setInterval": false,
		"setTimeout": false,
		"Storage": false,
		"structuredClone": false,
		"SubtleCrypto": false,
		"Temporal": false,
		"TextDecoder": false,
		"TextDecoderStream": false,
		"TextEncoder": false,
		"TextEncoderStream": false,
		"TransformStream": false,
		"TransformStreamDefaultController": false,
		"URL": false,
		"URLPattern": false,
		"URLSearchParams": false,
		"WebAssembly": false,
		"WebSocket": false,
		"WritableStream": false,
		"WritableStreamDefaultController": false,
		"WritableStreamDefaultWriter": false
	},
	"sharedWorker": {
		"AbortController": false,
		"AbortSignal": false,
		"addEventListener": false,
		"atob": false,
		"BackgroundFetchManager": false,
		"BackgroundFetchRecord": false,
		"BackgroundFetchRegistration": false,
		"BarcodeDetector": false,
		"Blob": false,
		"BroadcastChannel": false,
		"btoa": false,
		"ByteLengthQueuingStrategy": false,
		"Cache": false,
		"caches": false,
		"CacheStorage": false,
		"CanvasGradient": false,
		"CanvasPattern": false,
		"clearInterval": false,
		"clearTimeout": false,
		"close": false,
		"CloseEvent": false,
		"CompressionStream": false,
		"console": false,
		"CountQueuingStrategy": false,
		"createImageBitmap": false,
		"CreateMonitor": false,
		"CropTarget": false,
		"crossOriginIsolated": false,
		"crypto": false,
		"Crypto": false,
		"CryptoKey": false,
		"CSSImageValue": false,
		"CSSKeywordValue": false,
		"CSSMathClamp": false,
		"CSSMathInvert": false,
		"CSSMathMax": false,
		"CSSMathMin": false,
		"CSSMathNegate": false,
		"CSSMathProduct": false,
		"CSSMathSum": false,
		"CSSMathValue": false,
		"CSSMatrixComponent": false,
		"CSSNumericArray": false,
		"CSSNumericValue": false,
		"CSSPerspective": false,
		"CSSRotate": false,
		"CSSScale": false,
		"CSSSkew": false,
		"CSSSkewX": false,
		"CSSSkewY": false,
		"CSSStyleValue": false,
		"CSSTransformComponent": false,
		"CSSTransformValue": false,
		"CSSTranslate": false,
		"CSSUnitValue": false,
		"CSSUnparsedValue": false,
		"CSSVariableReferenceValue": false,
		"CustomEvent": false,
		"DecompressionStream": false,
		"dispatchEvent": false,
		"DOMException": false,
		"DOMMatrix": false,
		"DOMMatrixReadOnly": false,
		"DOMPoint": false,
		"DOMPointReadOnly": false,
		"DOMQuad": false,
		"DOMRect": false,
		"DOMRectReadOnly": false,
		"DOMStringList": false,
		"ErrorEvent": false,
		"Event": false,
		"EventSource": false,
		"EventTarget": false,
		"fetch": false,
		"File": false,
		"FileList": false,
		"FileReader": false,
		"FileReaderSync": false,
		"FileSystemDirectoryHandle": false,
		"FileSystemFileHandle": false,
		"FileSystemHandle": false,
		"FileSystemObserver": false,
		"FileSystemWritableFileStream": false,
		"FontFace": false,
		"FontFaceSet": false,
		"FontFaceSetLoadEvent": false,
		"fonts": false,
		"FormData": false,
		"GPU": false,
		"GPUAdapter": false,
		"GPUAdapterInfo": false,
		"GPUBindGroup": false,
		"GPUBindGroupLayout": false,
		"GPUBuffer": false,
		"GPUBufferUsage": false,
		"GPUCanvasContext": false,
		"GPUColorWrite": false,
		"GPUCommandBuffer": false,
		"GPUCommandEncoder": false,
		"GPUCompilationInfo": false,
		"GPUCompilationMessage": false,
		"GPUComputePassEncoder": false,
		"GPUComputePipeline": false,
		"GPUDevice": false,
		"GPUDeviceLostInfo": false,
		"GPUError": false,
		"GPUExternalTexture": false,
		"GPUInternalError": false,
		"GPUMapMode": false,
		"GPUOutOfMemoryError": false,
		"GPUPipelineError": false,
		"GPUPipelineLayout": false,
		"GPUQuerySet": false,
		"GPUQueue": false,
		"GPURenderBundle": false,
		"GPURenderBundleEncoder": false,
		"GPURenderPassEncoder": false,
		"GPURenderPipeline": false,
		"GPUSampler": false,
		"GPUShaderModule": false,
		"GPUShaderStage": false,
		"GPUSupportedFeatures": false,
		"GPUSupportedLimits": false,
		"GPUTexture": false,
		"GPUTextureUsage": false,
		"GPUTextureView": false,
		"GPUUncapturedErrorEvent": false,
		"GPUValidationError": false,
		"Headers": false,
		"IDBCursor": false,
		"IDBCursorWithValue": false,
		"IDBDatabase": false,
		"IDBFactory": false,
		"IDBIndex": false,
		"IDBKeyRange": false,
		"IDBObjectStore": false,
		"IDBOpenDBRequest": false,
		"IDBRecord": false,
		"IDBRequest": false,
		"IDBTransaction": false,
		"IDBVersionChangeEvent": false,
		"ImageBitmap": false,
		"ImageBitmapRenderingContext": false,
		"ImageData": false,
		"importScripts": false,
		"indexedDB": false,
		"isSecureContext": false,
		"location": false,
		"Lock": false,
		"LockManager": false,
		"MediaCapabilities": false,
		"MessageChannel": false,
		"MessageEvent": false,
		"MessagePort": false,
		"name": false,
		"NavigationPreloadManager": false,
		"navigator": false,
		"NavigatorUAData": false,
		"NetworkInformation": false,
		"Notification": false,
		"Observable": false,
		"OffscreenCanvas": false,
		"OffscreenCanvasRenderingContext2D": false,
		"onconnect": true,
		"onerror": true,
		"onlanguagechange": true,
		"onoffline": true,
		"ononline": true,
		"onrejectionhandled": true,
		"onunhandledrejection": true,
		"origin": false,
		"Origin": false,
		"Path2D": false,
		"performance": false,
		"Performance": false,
		"PerformanceEntry": false,
		"PerformanceMark": false,
		"PerformanceMeasure": false,
		"PerformanceObserver": false,
		"PerformanceObserverEntryList": false,
		"PerformanceResourceTiming": false,
		"PerformanceServerTiming": false,
		"PeriodicSyncManager": false,
		"Permissions": false,
		"PermissionStatus": false,
		"PERSISTENT": false,
		"PressureObserver": false,
		"PressureRecord": false,
		"ProgressEvent": false,
		"PromiseRejectionEvent": false,
		"PushManager": false,
		"PushSubscription": false,
		"PushSubscriptionOptions": false,
		"queueMicrotask": false,
		"QuotaExceededError": false,
		"ReadableByteStreamController": false,
		"ReadableStream": false,
		"ReadableStreamBYOBReader": false,
		"ReadableStreamBYOBRequest": false,
		"ReadableStreamDefaultController": false,
		"ReadableStreamDefaultReader": false,
		"removeEventListener": false,
		"ReportBody": false,
		"reportError": false,
		"ReportingObserver": false,
		"Request": false,
		"Response": false,
		"RestrictionTarget": false,
		"scheduler": false,
		"Scheduler": false,
		"SecurityPolicyViolationEvent": false,
		"self": false,
		"ServiceWorker": false,
		"ServiceWorkerContainer": false,
		"ServiceWorkerRegistration": false,
		"setInterval": false,
		"setTimeout": false,
		"SharedWorkerGlobalScope": false,
		"StorageBucket": false,
		"StorageBucketManager": false,
		"StorageManager": false,
		"structuredClone": false,
		"StylePropertyMapReadOnly": false,
		"Subscriber": false,
		"SubtleCrypto": false,
		"SyncManager": false,
		"TaskController": false,
		"TaskPriorityChangeEvent": false,
		"TaskSignal": false,
		"Temporal": false,
		"TEMPORARY": false,
		"TextDecoder": false,
		"TextDecoderStream": false,
		"TextEncoder": false,
		"TextEncoderStream": false,
		"TextMetrics": false,
		"TransformStream": false,
		"TransformStreamDefaultController": false,
		"TrustedHTML": false,
		"TrustedScript": false,
		"TrustedScriptURL": false,
		"TrustedTypePolicy": false,
		"TrustedTypePolicyFactory": false,
		"trustedTypes": false,
		"URL": false,
		"URLPattern": false,
		"URLSearchParams": false,
		"UserActivation": false,
		"WebAssembly": false,
		"WebGL2RenderingContext": false,
		"WebGLActiveInfo": false,
		"WebGLBuffer": false,
		"WebGLContextEvent": false,
		"WebGLFramebuffer": false,
		"WebGLObject": false,
		"WebGLProgram": false,
		"WebGLQuery": false,
		"WebGLRenderbuffer": false,
		"WebGLRenderingContext": false,
		"WebGLSampler": false,
		"WebGLShader": false,
		"WebGLShaderPrecisionFormat": false,
		"WebGLSync": false,
		"WebGLTexture": false,
		"WebGLTransformFeedback": false,
		"WebGLUniformLocation": false,
		"WebGLVertexArrayObject": false,
		"webkitRequestFileSystem": false,
		"webkitRequestFileSystemSync": false,
		"webkitResolveLocalFileSystemSyncURL": false,
		"webkitResolveLocalFileSystemURL": false,
		"WebSocket": false,
		"WebSocketError": false,
		"WebSocketStream": false,
		"WebTransport": false,
		"WebTransportBidirectionalStream": false,
		"WebTransportDatagramDuplexStream": false,
		"WebTransportDatagramsWritable": false,
		"WebTransportError": false,
		"WebTransportReceiveStream": false,
		"WebTransportSendGroup": false,
		"WebTransportSendStream": false,
		"WGSLLanguageFeatures": false,
		"when": false,
		"Worker": false,
		"WorkerGlobalScope": false,
		"WorkerLocation": false,
		"WorkerNavigator": false,
		"WritableStream": false,
		"WritableStreamDefaultController": false,
		"WritableStreamDefaultWriter": false,
		"XMLHttpRequest": false,
		"XMLHttpRequestEventTarget": false,
		"XMLHttpRequestUpload": false
	},
	"shelljs": {
		"cat": false,
		"cd": false,
		"chmod": false,
		"cmd": false,
		"config": false,
		"cp": false,
		"dirs": false,
		"echo": false,
		"env": false,
		"error": false,
		"errorCode": false,
		"exec": false,
		"exit": false,
		"find": false,
		"grep": false,
		"head": false,
		"ln": false,
		"ls": false,
		"mkdir": false,
		"mv": false,
		"popd": false,
		"pushd": false,
		"pwd": false,
		"rm": false,
		"sed": false,
		"set": false,
		"ShellString": false,
		"sort": false,
		"tail": false,
		"tempdir": false,
		"test": false,
		"touch": false,
		"uniq": false,
		"which": false
	},
	"svelte": {
		"$bindable": false,
		"$derived": false,
		"$effect": false,
		"$host": false,
		"$inspect": false,
		"$props": false,
		"$state": false
	},
	"vitest": {
		"afterAll": false,
		"afterEach": false,
		"assert": false,
		"assertType": false,
		"beforeAll": false,
		"beforeEach": false,
		"chai": false,
		"describe": false,
		"expect": false,
		"expectTypeOf": false,
		"it": false,
		"onTestFailed": false,
		"onTestFinished": false,
		"suite": false,
		"test": false,
		"vi": false,
		"vitest": false
	},
	"vue": {
		"defineEmits": false,
		"defineExpose": false,
		"defineModel": false,
		"defineOptions": false,
		"defineProps": false,
		"defineSlots": false,
		"withDefaults": false
	},
	"webextensions": {
		"browser": false,
		"chrome": false,
		"opr": false
	},
	"webpack": {
		"__non_webpack_require__": false,
		"__resourceQuery": false,
		"__webpack_base_uri__": true,
		"__webpack_chunk_load__": true,
		"__webpack_exports_info__": false,
		"__webpack_get_script_filename__": true,
		"__webpack_hash__": false,
		"__webpack_is_included__": false,
		"__webpack_module__": false,
		"__webpack_modules__": false,
		"__webpack_public_path__": true,
		"__webpack_require__": false,
		"__webpack_runtime_id__": false
	},
	"worker": {
		"AbortController": false,
		"AbortSignal": false,
		"addEventListener": false,
		"ai": false,
		"AI": false,
		"AICreateMonitor": false,
		"atob": false,
		"AudioData": false,
		"AudioDecoder": false,
		"AudioEncoder": false,
		"BackgroundFetchManager": false,
		"BackgroundFetchRecord": false,
		"BackgroundFetchRegistration": false,
		"BarcodeDetector": false,
		"Blob": false,
		"BroadcastChannel": false,
		"btoa": false,
		"ByteLengthQueuingStrategy": false,
		"Cache": false,
		"caches": false,
		"CacheStorage": false,
		"cancelAnimationFrame": false,
		"CanvasGradient": false,
		"CanvasPattern": false,
		"clearInterval": false,
		"clearTimeout": false,
		"close": false,
		"CloseEvent": false,
		"CompressionStream": false,
		"console": false,
		"CountQueuingStrategy": false,
		"createImageBitmap": false,
		"CreateMonitor": false,
		"CropTarget": false,
		"crossOriginIsolated": false,
		"crypto": false,
		"Crypto": false,
		"CryptoKey": false,
		"CSSImageValue": false,
		"CSSKeywordValue": false,
		"CSSMathClamp": false,
		"CSSMathInvert": false,
		"CSSMathMax": false,
		"CSSMathMin": false,
		"CSSMathNegate": false,
		"CSSMathProduct": false,
		"CSSMathSum": false,
		"CSSMathValue": false,
		"CSSMatrixComponent": false,
		"CSSNumericArray": false,
		"CSSNumericValue": false,
		"CSSPerspective": false,
		"CSSRotate": false,
		"CSSScale": false,
		"CSSSkew": false,
		"CSSSkewX": false,
		"CSSSkewY": false,
		"CSSStyleValue": false,
		"CSSTransformComponent": false,
		"CSSTransformValue": false,
		"CSSTranslate": false,
		"CSSUnitValue": false,
		"CSSUnparsedValue": false,
		"CSSVariableReferenceValue": false,
		"CustomEvent": false,
		"DecompressionStream": false,
		"DedicatedWorkerGlobalScope": false,
		"dispatchEvent": false,
		"DOMException": false,
		"DOMMatrix": false,
		"DOMMatrixReadOnly": false,
		"DOMPoint": false,
		"DOMPointReadOnly": false,
		"DOMQuad": false,
		"DOMRect": false,
		"DOMRectReadOnly": false,
		"DOMStringList": false,
		"EncodedAudioChunk": false,
		"EncodedVideoChunk": false,
		"ErrorEvent": false,
		"Event": false,
		"EventSource": false,
		"EventTarget": false,
		"fetch": false,
		"File": false,
		"FileList": false,
		"FileReader": false,
		"FileReaderSync": false,
		"FileSystemDirectoryHandle": false,
		"FileSystemFileHandle": false,
		"FileSystemHandle": false,
		"FileSystemObserver": false,
		"FileSystemSyncAccessHandle": false,
		"FileSystemWritableFileStream": false,
		"FontFace": false,
		"FontFaceSet": false,
		"FontFaceSetLoadEvent": false,
		"fonts": false,
		"FormData": false,
		"GPU": false,
		"GPUAdapter": false,
		"GPUAdapterInfo": false,
		"GPUBindGroup": false,
		"GPUBindGroupLayout": false,
		"GPUBuffer": false,
		"GPUBufferUsage": false,
		"GPUCanvasContext": false,
		"GPUColorWrite": false,
		"GPUCommandBuffer": false,
		"GPUCommandEncoder": false,
		"GPUCompilationInfo": false,
		"GPUCompilationMessage": false,
		"GPUComputePassEncoder": false,
		"GPUComputePipeline": false,
		"GPUDevice": false,
		"GPUDeviceLostInfo": false,
		"GPUError": false,
		"GPUExternalTexture": false,
		"GPUInternalError": false,
		"GPUMapMode": false,
		"GPUOutOfMemoryError": false,
		"GPUPipelineError": false,
		"GPUPipelineLayout": false,
		"GPUQuerySet": false,
		"GPUQueue": false,
		"GPURenderBundle": false,
		"GPURenderBundleEncoder": false,
		"GPURenderPassEncoder": false,
		"GPURenderPipeline": false,
		"GPUSampler": false,
		"GPUShaderModule": false,
		"GPUShaderStage": false,
		"GPUSupportedFeatures": false,
		"GPUSupportedLimits": false,
		"GPUTexture": false,
		"GPUTextureUsage": false,
		"GPUTextureView": false,
		"GPUUncapturedErrorEvent": false,
		"GPUValidationError": false,
		"Headers": false,
		"HID": false,
		"HIDConnectionEvent": false,
		"HIDDevice": false,
		"HIDInputReportEvent": false,
		"IDBCursor": false,
		"IDBCursorWithValue": false,
		"IDBDatabase": false,
		"IDBFactory": false,
		"IDBIndex": false,
		"IDBKeyRange": false,
		"IDBObjectStore": false,
		"IDBOpenDBRequest": false,
		"IDBRecord": false,
		"IDBRequest": false,
		"IDBTransaction": false,
		"IDBVersionChangeEvent": false,
		"IdleDetector": false,
		"ImageBitmap": false,
		"ImageBitmapRenderingContext": false,
		"ImageData": false,
		"ImageDecoder": false,
		"ImageTrack": false,
		"ImageTrackList": false,
		"importScripts": false,
		"indexedDB": false,
		"isSecureContext": false,
		"LanguageDetector": false,
		"location": false,
		"Lock": false,
		"LockManager": false,
		"MediaCapabilities": false,
		"MediaSource": false,
		"MediaSourceHandle": false,
		"MessageChannel": false,
		"MessageEvent": false,
		"MessagePort": false,
		"name": false,
		"NavigationPreloadManager": false,
		"navigator": false,
		"NavigatorUAData": false,
		"NetworkInformation": false,
		"Notification": false,
		"Observable": false,
		"OffscreenCanvas": false,
		"OffscreenCanvasRenderingContext2D": false,
		"onerror": true,
		"onlanguagechange": true,
		"onmessage": true,
		"onmessageerror": true,
		"onoffline": true,
		"ononline": true,
		"onrejectionhandled": true,
		"onrtctransform": true,
		"onunhandledrejection": true,
		"origin": false,
		"Origin": false,
		"Path2D": false,
		"performance": false,
		"Performance": false,
		"PerformanceEntry": false,
		"PerformanceMark": false,
		"PerformanceMeasure": false,
		"PerformanceObserver": false,
		"PerformanceObserverEntryList": false,
		"PerformanceResourceTiming": false,
		"PerformanceServerTiming": false,
		"PeriodicSyncManager": false,
		"Permissions": false,
		"PermissionStatus": false,
		"PERSISTENT": false,
		"postMessage": false,
		"PressureObserver": false,
		"PressureRecord": false,
		"ProgressEvent": false,
		"PromiseRejectionEvent": false,
		"PushManager": false,
		"PushSubscription": false,
		"PushSubscriptionOptions": false,
		"queueMicrotask": false,
		"QuotaExceededError": false,
		"ReadableByteStreamController": false,
		"ReadableStream": false,
		"ReadableStreamBYOBReader": false,
		"ReadableStreamBYOBRequest": false,
		"ReadableStreamDefaultController": false,
		"ReadableStreamDefaultReader": false,
		"removeEventListener": false,
		"ReportBody": false,
		"reportError": false,
		"ReportingObserver": false,
		"Request": false,
		"requestAnimationFrame": false,
		"Response": false,
		"RestrictionTarget": false,
		"RTCDataChannel": false,
		"RTCEncodedAudioFrame": false,
		"RTCEncodedVideoFrame": false,
		"RTCError": false,
		"RTCErrorEvent": false,
		"RTCRtpScriptTransformer": false,
		"RTCTransformEvent": false,
		"scheduler": false,
		"Scheduler": false,
		"SecurityPolicyViolationEvent": false,
		"self": false,
		"Serial": false,
		"SerialPort": false,
		"ServiceWorker": false,
		"ServiceWorkerContainer": false,
		"ServiceWorkerRegistration": false,
		"setInterval": false,
		"setTimeout": false,
		"SourceBuffer": false,
		"SourceBufferList": false,
		"StorageBucket": false,
		"StorageBucketManager": false,
		"StorageManager": false,
		"structuredClone": false,
		"StylePropertyMapReadOnly": false,
		"Subscriber": false,
		"SubtleCrypto": false,
		"SyncManager": false,
		"TaskController": false,
		"TaskPriorityChangeEvent": false,
		"TaskSignal": false,
		"Temporal": false,
		"TEMPORARY": false,
		"TextDecoder": false,
		"TextDecoderStream": false,
		"TextEncoder": false,
		"TextEncoderStream": false,
		"TextMetrics": false,
		"TransformStream": false,
		"TransformStreamDefaultController": false,
		"TrustedHTML": false,
		"TrustedScript": false,
		"TrustedScriptURL": false,
		"TrustedTypePolicy": false,
		"TrustedTypePolicyFactory": false,
		"trustedTypes": false,
		"URL": false,
		"URLPattern": false,
		"URLSearchParams": false,
		"USB": false,
		"USBAlternateInterface": false,
		"USBConfiguration": false,
		"USBConnectionEvent": false,
		"USBDevice": false,
		"USBEndpoint": false,
		"USBInterface": false,
		"USBInTransferResult": false,
		"USBIsochronousInTransferPacket": false,
		"USBIsochronousInTransferResult": false,
		"USBIsochronousOutTransferPacket": false,
		"USBIsochronousOutTransferResult": false,
		"USBOutTransferResult": false,
		"UserActivation": false,
		"VideoColorSpace": false,
		"VideoDecoder": false,
		"VideoEncoder": false,
		"VideoFrame": false,
		"WebAssembly": false,
		"WebGL2RenderingContext": false,
		"WebGLActiveInfo": false,
		"WebGLBuffer": false,
		"WebGLContextEvent": false,
		"WebGLFramebuffer": false,
		"WebGLObject": false,
		"WebGLProgram": false,
		"WebGLQuery": false,
		"WebGLRenderbuffer": false,
		"WebGLRenderingContext": false,
		"WebGLSampler": false,
		"WebGLShader": false,
		"WebGLShaderPrecisionFormat": false,
		"WebGLSync": false,
		"WebGLTexture": false,
		"WebGLTransformFeedback": false,
		"WebGLUniformLocation": false,
		"WebGLVertexArrayObject": false,
		"webkitRequestFileSystem": false,
		"webkitRequestFileSystemSync": false,
		"webkitResolveLocalFileSystemSyncURL": false,
		"webkitResolveLocalFileSystemURL": false,
		"WebSocket": false,
		"WebSocketError": false,
		"WebSocketStream": false,
		"WebTransport": false,
		"WebTransportBidirectionalStream": false,
		"WebTransportDatagramDuplexStream": false,
		"WebTransportDatagramsWritable": false,
		"WebTransportError": false,
		"WebTransportReceiveStream": false,
		"WebTransportSendGroup": false,
		"WebTransportSendStream": false,
		"WGSLLanguageFeatures": false,
		"when": false,
		"Worker": false,
		"WorkerGlobalScope": false,
		"WorkerLocation": false,
		"WorkerNavigator": false,
		"WritableStream": false,
		"WritableStreamDefaultController": false,
		"WritableStreamDefaultWriter": false,
		"XMLHttpRequest": false,
		"XMLHttpRequestEventTarget": false,
		"XMLHttpRequestUpload": false
	},
	"wsh": {
		"ActiveXObject": false,
		"CollectGarbage": false,
		"Debug": false,
		"Enumerator": false,
		"GetObject": false,
		"RuntimeObject": false,
		"ScriptEngine": false,
		"ScriptEngineBuildVersion": false,
		"ScriptEngineMajorVersion": false,
		"ScriptEngineMinorVersion": false,
		"VBArray": false,
		"WScript": false,
		"WSH": false
	},
	"yui": {
		"YAHOO": false,
		"YAHOO_config": false,
		"YUI": false,
		"YUI_config": false
	}
}
Y(vDx   // This file is autogenerated by scripts/generate-types.mjs
// Do NOT modify this file manually

type GlobalsAmd = {
	readonly 'define': false;
	readonly 'require': false;
}

type GlobalsApplescript = {
	readonly '$': false;
	readonly 'Application': false;
	readonly 'Automation': false;
	readonly 'console': false;
	readonly 'delay': false;
	readonly 'Library': false;
	readonly 'ObjC': false;
	readonly 'ObjectSpecifier': false;
	readonly 'Path': false;
	readonly 'Progress': false;
	readonly 'Ref': false;
}

type GlobalsAstro = {
	readonly 'Astro': false;
}

type GlobalsAtomtest = {
	readonly 'advanceClock': false;
	readonly 'atom': false;
	readonly 'fakeClearInterval': false;
	readonly 'fakeClearTimeout': false;
	readonly 'fakeSetInterval': false;
	readonly 'fakeSetTimeout': false;
	readonly 'resetTimeouts': false;
	readonly 'waitsForPromise': false;
}

type GlobalsAudioWorklet = {
	readonly 'AbortController': false;
	readonly 'AbortSignal': false;
	readonly 'AudioWorkletGlobalScope': false;
	readonly 'AudioWorkletProcessor': false;
	readonly 'ByteLengthQueuingStrategy': false;
	readonly 'CompressionStream': false;
	readonly 'console': false;
	readonly 'CountQueuingStrategy': false;
	readonly 'CSSImageValue': false;
	readonly 'CSSKeywordValue': false;
	readonly 'CSSMathClamp': false;
	readonly 'CSSMathInvert': false;
	readonly 'CSSMathMax': false;
	readonly 'CSSMathMin': false;
	readonly 'CSSMathNegate': false;
	readonly 'CSSMathProduct': false;
	readonly 'CSSMathSum': false;
	readonly 'CSSMathValue': false;
	readonly 'CSSNumericArray': false;
	readonly 'CSSNumericValue': false;
	readonly 'CSSStyleValue': false;
	readonly 'CSSUnitValue': false;
	readonly 'CSSUnparsedValue': false;
	readonly 'CSSVariableReferenceValue': false;
	readonly 'currentFrame': false;
	readonly 'currentTime': false;
	readonly 'DecompressionStream': false;
	readonly 'Event': false;
	readonly 'EventTarget': false;
	readonly 'MessageEvent': false;
	readonly 'MessagePort': false;
	readonly 'PaintWorkletGlobalScope': false;
	readonly 'port': false;
	readonly 'QuotaExceededError': false;
	readonly 'ReadableByteStreamController': false;
	readonly 'ReadableStream': false;
	readonly 'ReadableStreamBYOBReader': false;
	readonly 'ReadableStreamBYOBRequest': false;
	readonly 'ReadableStreamDefaultController': false;
	readonly 'ReadableStreamDefaultReader': false;
	readonly 'registerProcessor': false;
	readonly 'sampleRate': false;
	readonly 'StylePropertyMapReadOnly': false;
	readonly 'Temporal': false;
	readonly 'TextDecoderStream': false;
	readonly 'TextEncoderStream': false;
	readonly 'TransformStream': false;
	readonly 'TransformStreamDefaultController': false;
	readonly 'UserActivation': false;
	readonly 'WebAssembly': false;
	readonly 'WorkletGlobalScope': false;
	readonly 'WritableStream': false;
	readonly 'WritableStreamDefaultController': false;
	readonly 'WritableStreamDefaultWriter': false;
}

type GlobalsBrowser = {
	readonly 'AbortController': false;
	readonly 'AbortSignal': false;
	readonly 'AbsoluteOrientationSensor': false;
	readonly 'AbstractRange': false;
	readonly 'Accelerometer': false;
	readonly 'addEventListener': false;
	readonly 'ai': false;
	readonly 'AI': false;
	readonly 'AICreateMonitor': false;
	readonly 'AITextSession': false;
	readonly 'alert': false;
	readonly 'AnalyserNode': false;
	readonly 'Animation': false;
	readonly 'AnimationEffect': false;
	readonly 'AnimationEvent': false;
	readonly 'AnimationPlaybackEvent': false;
	readonly 'AnimationTimeline': false;
	readonly 'atob': false;
	readonly 'Attr': false;
	readonly 'Audio': false;
	readonly 'AudioBuffer': false;
	readonly 'AudioBufferSourceNode': false;
	readonly 'AudioContext': false;
	readonly 'AudioData': false;
	readonly 'AudioDecoder': false;
	readonly 'AudioDestinationNode': false;
	readonly 'AudioEncoder': false;
	readonly 'AudioListener': false;
	readonly 'AudioNode': false;
	readonly 'AudioParam': false;
	readonly 'AudioParamMap': false;
	readonly 'AudioPlaybackStats': false;
	readonly 'AudioProcessingEvent': false;
	readonly 'AudioScheduledSourceNode': false;
	readonly 'AudioSinkInfo': false;
	readonly 'AudioWorklet': false;
	readonly 'AudioWorkletNode': false;
	readonly 'AuthenticatorAssertionResponse': false;
	readonly 'AuthenticatorAttestationResponse': false;
	readonly 'AuthenticatorResponse': false;
	readonly 'BackgroundFetchManager': false;
	readonly 'BackgroundFetchRecord': false;
	readonly 'BackgroundFetchRegistration': false;
	readonly 'BarcodeDetector': false;
	readonly 'BarProp': false;
	readonly 'BaseAudioContext': false;
	readonly 'BatteryManager': false;
	readonly 'BeforeUnloadEvent': false;
	readonly 'BiquadFilterNode': false;
	readonly 'Blob': false;
	readonly 'BlobEvent': false;
	readonly 'Bluetooth': false;
	readonly 'BluetoothCharacteristicProperties': false;
	readonly 'BluetoothDevice': false;
	readonly 'BluetoothRemoteGATTCharacteristic': false;
	readonly 'BluetoothRemoteGATTDescriptor': false;
	readonly 'BluetoothRemoteGATTServer': false;
	readonly 'BluetoothRemoteGATTService': false;
	readonly 'BluetoothUUID': false;
	readonly 'blur': false;
	readonly 'BroadcastChannel': false;
	readonly 'BrowserCaptureMediaStreamTrack': false;
	readonly 'btoa': false;
	readonly 'ByteLengthQueuingStrategy': false;
	readonly 'Cache': false;
	readonly 'caches': false;
	readonly 'CacheStorage': false;
	readonly 'cancelAnimationFrame': false;
	readonly 'cancelIdleCallback': false;
	readonly 'CanvasCaptureMediaStream': false;
	readonly 'CanvasCaptureMediaStreamTrack': false;
	readonly 'CanvasGradient': false;
	readonly 'CanvasPattern': false;
	readonly 'CanvasRenderingContext2D': false;
	readonly 'CaptureController': false;
	readonly 'CaretPosition': false;
	readonly 'CDATASection': false;
	readonly 'ChannelMergerNode': false;
	readonly 'ChannelSplitterNode': false;
	readonly 'ChapterInformation': false;
	readonly 'CharacterBoundsUpdateEvent': false;
	readonly 'CharacterData': false;
	readonly 'clearInterval': false;
	readonly 'clearTimeout': false;
	readonly 'clientInformation': false;
	readonly 'Clipboard': false;
	readonly 'ClipboardChangeEvent': false;
	readonly 'ClipboardEvent': false;
	readonly 'ClipboardItem': false;
	readonly 'close': false;
	readonly 'closed': false;
	readonly 'CloseEvent': false;
	readonly 'CloseWatcher': false;
	readonly 'CommandEvent': false;
	readonly 'Comment': false;
	readonly 'CompositionEvent': false;
	readonly 'CompressionStream': false;
	readonly 'confirm': false;
	readonly 'console': false;
	readonly 'ConstantSourceNode': false;
	readonly 'ContentVisibilityAutoStateChangeEvent': false;
	readonly 'ConvolverNode': false;
	readonly 'CookieChangeEvent': false;
	readonly 'CookieDeprecationLabel': false;
	readonly 'cookieStore': false;
	readonly 'CookieStore': false;
	readonly 'CookieStoreManager': false;
	readonly 'CountQueuingStrategy': false;
	readonly 'crashReport': false;
	readonly 'CrashReportContext': false;
	readonly 'createImageBitmap': false;
	readonly 'CreateMonitor': false;
	readonly 'Credential': false;
	readonly 'credentialless': false;
	readonly 'CredentialsContainer': false;
	readonly 'CropTarget': false;
	readonly 'crossOriginIsolated': false;
	readonly 'crypto': false;
	readonly 'Crypto': false;
	readonly 'CryptoKey': false;
	readonly 'CSPViolationReportBody': false;
	readonly 'CSS': false;
	readonly 'CSSAnimation': false;
	readonly 'CSSConditionRule': false;
	readonly 'CSSContainerRule': false;
	readonly 'CSSCounterStyleRule': false;
	readonly 'CSSFontFaceDescriptors': false;
	readonly 'CSSFontFaceRule': false;
	readonly 'CSSFontFeatureValuesRule': false;
	readonly 'CSSFontPaletteValuesRule': false;
	readonly 'CSSFunctionDeclarations': false;
	readonly 'CSSFunctionDescriptors': false;
	readonly 'CSSFunctionRule': false;
	readonly 'CSSGroupingRule': false;
	readonly 'CSSImageValue': false;
	readonly 'CSSImportRule': false;
	readonly 'CSSKeyframeRule': false;
	readonly 'CSSKeyframesRule': false;
	readonly 'CSSKeywordValue': false;
	readonly 'CSSLayerBlockRule': false;
	readonly 'CSSLayerStatementRule': false;
	readonly 'CSSMarginRule': false;
	readonly 'CSSMathClamp': false;
	readonly 'CSSMathInvert': false;
	readonly 'CSSMathMax': false;
	readonly 'CSSMathMin': false;
	readonly 'CSSMathNegate': false;
	readonly 'CSSMathProduct': false;
	readonly 'CSSMathSum': false;
	readonly 'CSSMathValue': false;
	readonly 'CSSMatrixComponent': false;
	readonly 'CSSMediaRule': false;
	readonly 'CSSNamespaceRule': false;
	readonly 'CSSNestedDeclarations': false;
	readonly 'CSSNumericArray': false;
	readonly 'CSSNumericValue': false;
	readonly 'CSSPageDescriptors': false;
	readonly 'CSSPageRule': false;
	readonly 'CSSPerspective': false;
	readonly 'CSSPositionTryDescriptors': false;
	readonly 'CSSPositionTryRule': false;
	readonly 'CSSPositionValue': false;
	readonly 'CSSPropertyRule': false;
	readonly 'CSSPseudoElement': false;
	readonly 'CSSRotate': false;
	readonly 'CSSRule': false;
	readonly 'CSSRuleList': false;
	readonly 'CSSScale': false;
	readonly 'CSSScopeRule': false;
	readonly 'CSSSkew': false;
	readonly 'CSSSkewX': false;
	readonly 'CSSSkewY': false;
	readonly 'CSSStartingStyleRule': false;
	readonly 'CSSStyleDeclaration': false;
	readonly 'CSSStyleProperties': false;
	readonly 'CSSStyleRule': false;
	readonly 'CSSStyleSheet': false;
	readonly 'CSSStyleValue': false;
	readonly 'CSSSupportsRule': false;
	readonly 'CSSTransformComponent': false;
	readonly 'CSSTransformValue': false;
	readonly 'CSSTransition': false;
	readonly 'CSSTranslate': false;
	readonly 'CSSUnitValue': false;
	readonly 'CSSUnparsedValue': false;
	readonly 'CSSVariableReferenceValue': false;
	readonly 'CSSViewTransitionRule': false;
	readonly 'CustomElementRegistry': false;
	readonly 'customElements': false;
	readonly 'CustomEvent': false;
	readonly 'CustomStateSet': false;
	readonly 'DataTransfer': false;
	readonly 'DataTransferItem': false;
	readonly 'DataTransferItemList': false;
	readonly 'DecompressionStream': false;
	readonly 'DelayNode': false;
	readonly 'DelegatedInkTrailPresenter': false;
	readonly 'DeviceMotionEvent': false;
	readonly 'DeviceMotionEventAcceleration': false;
	readonly 'DeviceMotionEventRotationRate': false;
	readonly 'DeviceOrientationEvent': false;
	readonly 'devicePixelRatio': false;
	readonly 'DevicePosture': false;
	readonly 'DigitalCredential': false;
	readonly 'dispatchEvent': false;
	readonly 'document': false;
	readonly 'Document': false;
	readonly 'DocumentFragment': false;
	readonly 'documentPictureInPicture': false;
	readonly 'DocumentPictureInPicture': false;
	readonly 'DocumentPictureInPictureEvent': false;
	readonly 'DocumentTimeline': false;
	readonly 'DocumentType': false;
	readonly 'DOMError': false;
	readonly 'DOMException': false;
	readonly 'DOMImplementation': false;
	readonly 'DOMMatrix': false;
	readonly 'DOMMatrixReadOnly': false;
	readonly 'DOMParser': false;
	readonly 'DOMPoint': false;
	readonly 'DOMPointReadOnly': false;
	readonly 'DOMQuad': false;
	readonly 'DOMRect': false;
	readonly 'DOMRectList': false;
	readonly 'DOMRectReadOnly': false;
	readonly 'DOMStringList': false;
	readonly 'DOMStringMap': false;
	readonly 'DOMTokenList': false;
	readonly 'DragEvent': false;
	readonly 'DynamicsCompressorNode': false;
	readonly 'EditContext': false;
	readonly 'Element': false;
	readonly 'ElementInternals': false;
	readonly 'EncodedAudioChunk': false;
	readonly 'EncodedVideoChunk': false;
	readonly 'ErrorEvent': false;
	readonly 'event': false;
	readonly 'Event': false;
	readonly 'EventCounts': false;
	readonly 'EventSource': false;
	readonly 'EventTarget': false;
	readonly 'external': false;
	readonly 'External': false;
	readonly 'EyeDropper': false;
	readonly 'FeaturePolicy': false;
	readonly 'FederatedCredential': false;
	readonly 'fence': false;
	readonly 'Fence': false;
	readonly 'FencedFrameConfig': false;
	readonly 'fetch': false;
	readonly 'fetchLater': false;
	readonly 'FetchLaterResult': false;
	readonly 'File': false;
	readonly 'FileList': false;
	readonly 'FileReader': false;
	readonly 'FileSystem': false;
	readonly 'FileSystemDirectoryEntry': false;
	readonly 'FileSystemDirectoryHandle': false;
	readonly 'FileSystemDirectoryReader': false;
	readonly 'FileSystemEntry': false;
	readonly 'FileSystemFileEntry': false;
	readonly 'FileSystemFileHandle': false;
	readonly 'FileSystemHandle': false;
	readonly 'FileSystemObserver': false;
	readonly 'FileSystemWritableFileStream': false;
	readonly 'find': false;
	readonly 'focus': false;
	readonly 'FocusEvent': false;
	readonly 'FontData': false;
	readonly 'FontFace': false;
	readonly 'FontFaceSet': false;
	readonly 'FontFaceSetLoadEvent': false;
	readonly 'FormData': false;
	readonly 'FormDataEvent': false;
	readonly 'FragmentDirective': false;
	readonly 'frameElement': false;
	readonly 'frames': false;
	readonly 'GainNode': false;
	readonly 'Gamepad': false;
	readonly 'GamepadAxisMoveEvent': false;
	readonly 'GamepadButton': false;
	readonly 'GamepadButtonEvent': false;
	readonly 'GamepadEvent': false;
	readonly 'GamepadHapticActuator': false;
	readonly 'GamepadPose': false;
	readonly 'Geolocation': false;
	readonly 'GeolocationCoordinates': false;
	readonly 'GeolocationPosition': false;
	readonly 'GeolocationPositionError': false;
	readonly 'getComputedStyle': false;
	readonly 'getScreenDetails': false;
	readonly 'getSelection': false;
	readonly 'GPU': false;
	readonly 'GPUAdapter': false;
	readonly 'GPUAdapterInfo': false;
	readonly 'GPUBindGroup': false;
	readonly 'GPUBindGroupLayout': false;
	readonly 'GPUBuffer': false;
	readonly 'GPUBufferUsage': false;
	readonly 'GPUCanvasContext': false;
	readonly 'GPUColorWrite': false;
	readonly 'GPUCommandBuffer': false;
	readonly 'GPUCommandEncoder': false;
	readonly 'GPUCompilationInfo': false;
	readonly 'GPUCompilationMessage': false;
	readonly 'GPUComputePassEncoder': false;
	readonly 'GPUComputePipeline': false;
	readonly 'GPUDevice': false;
	readonly 'GPUDeviceLostInfo': false;
	readonly 'GPUError': false;
	readonly 'GPUExternalTexture': false;
	readonly 'GPUInternalError': false;
	readonly 'GPUMapMode': false;
	readonly 'GPUOutOfMemoryError': false;
	readonly 'GPUPipelineError': false;
	readonly 'GPUPipelineLayout': false;
	readonly 'GPUQuerySet': false;
	readonly 'GPUQueue': false;
	readonly 'GPURenderBundle': false;
	readonly 'GPURenderBundleEncoder': false;
	readonly 'GPURenderPassEncoder': false;
	readonly 'GPURenderPipeline': false;
	readonly 'GPUSampler': false;
	readonly 'GPUShaderModule': false;
	readonly 'GPUShaderStage': false;
	readonly 'GPUSupportedFeatures': false;
	readonly 'GPUSupportedLimits': false;
	readonly 'GPUTexture': false;
	readonly 'GPUTextureUsage': false;
	readonly 'GPUTextureView': false;
	readonly 'GPUUncapturedErrorEvent': false;
	readonly 'GPUValidationError': false;
	readonly 'GravitySensor': false;
	readonly 'Gyroscope': false;
	readonly 'HashChangeEvent': false;
	readonly 'Headers': false;
	readonly 'HID': false;
	readonly 'HIDConnectionEvent': false;
	readonly 'HIDDevice': false;
	readonly 'HIDInputReportEvent': false;
	readonly 'Highlight': false;
	readonly 'HighlightRegistry': false;
	readonly 'history': false;
	readonly 'History': false;
	readonly 'HTMLAllCollection': false;
	readonly 'HTMLAnchorElement': false;
	readonly 'HTMLAreaElement': false;
	readonly 'HTMLAudioElement': false;
	readonly 'HTMLBaseElement': false;
	readonly 'HTMLBodyElement': false;
	readonly 'HTMLBRElement': false;
	readonly 'HTMLButtonElement': false;
	readonly 'HTMLCanvasElement': false;
	readonly 'HTMLCollection': false;
	readonly 'HTMLDataElement': false;
	readonly 'HTMLDataListElement': false;
	readonly 'HTMLDetailsElement': false;
	readonly 'HTMLDialogElement': false;
	readonly 'HTMLDirectoryElement': false;
	readonly 'HTMLDivElement': false;
	readonly 'HTMLDListElement': false;
	readonly 'HTMLDocument': false;
	readonly 'HTMLElement': false;
	readonly 'HTMLEmbedElement': false;
	readonly 'HTMLFencedFrameElement': false;
	readonly 'HTMLFieldSetElement': false;
	readonly 'HTMLFontElement': false;
	readonly 'HTMLFormControlsCollection': false;
	readonly 'HTMLFormElement': false;
	readonly 'HTMLFrameElement': false;
	readonly 'HTMLFrameSetElement': false;
	readonly 'HTMLGeolocationElement': false;
	readonly 'HTMLHeadElement': false;
	readonly 'HTMLHeadingElement': false;
	readonly 'HTMLHRElement': false;
	readonly 'HTMLHtmlElement': false;
	readonly 'HTMLIFrameElement': false;
	readonly 'HTMLImageElement': false;
	readonly 'HTMLInputElement': false;
	readonly 'HTMLLabelElement': false;
	readonly 'HTMLLegendElement': false;
	readonly 'HTMLLIElement': false;
	readonly 'HTMLLinkElement': false;
	readonly 'HTMLMapElement': false;
	readonly 'HTMLMarqueeElement': false;
	readonly 'HTMLMediaElement': false;
	readonly 'HTMLMenuElement': false;
	readonly 'HTMLMetaElement': false;
	readonly 'HTMLMeterElement': false;
	readonly 'HTMLModElement': false;
	readonly 'HTMLObjectElement': false;
	readonly 'HTMLOListElement': false;
	readonly 'HTMLOptGroupElement': false;
	readonly 'HTMLOptionElement': false;
	readonly 'HTMLOptionsCollection': false;
	readonly 'HTMLOutputElement': false;
	readonly 'HTMLParagraphElement': false;
	readonly 'HTMLParamElement': false;
	readonly 'HTMLPictureElement': false;
	readonly 'HTMLPreElement': false;
	readonly 'HTMLProgressElement': false;
	readonly 'HTMLQuoteElement': false;
	readonly 'HTMLScriptElement': false;
	readonly 'HTMLSelectedContentElement': false;
	readonly 'HTMLSelectElement': false;
	readonly 'HTMLSlotElement': false;
	readonly 'HTMLSourceElement': false;
	readonly 'HTMLSpanElement': false;
	readonly 'HTMLStyleElement': false;
	readonly 'HTMLTableCaptionElement': false;
	readonly 'HTMLTableCellElement': false;
	readonly 'HTMLTableColElement': false;
	readonly 'HTMLTableElement': false;
	readonly 'HTMLTableRowElement': false;
	readonly 'HTMLTableSectionElement': false;
	readonly 'HTMLTemplateElement': false;
	readonly 'HTMLTextAreaElement': false;
	readonly 'HTMLTimeElement': false;
	readonly 'HTMLTitleElement': false;
	readonly 'HTMLTrackElement': false;
	readonly 'HTMLUListElement': false;
	readonly 'HTMLUnknownElement': false;
	readonly 'HTMLUserMediaElement': false;
	readonly 'HTMLVideoElement': false;
	readonly 'IDBCursor': false;
	readonly 'IDBCursorWithValue': false;
	readonly 'IDBDatabase': false;
	readonly 'IDBFactory': false;
	readonly 'IDBIndex': false;
	readonly 'IDBKeyRange': false;
	readonly 'IDBObjectStore': false;
	readonly 'IDBOpenDBRequest': false;
	readonly 'IDBRecord': false;
	readonly 'IDBRequest': false;
	readonly 'IDBTransaction': false;
	readonly 'IDBVersionChangeEvent': false;
	readonly 'IdentityCredential': false;
	readonly 'IdentityCredentialError': false;
	readonly 'IdentityProvider': false;
	readonly 'IdleDeadline': false;
	readonly 'IdleDetector': false;
	readonly 'IIRFilterNode': false;
	readonly 'Image': false;
	readonly 'ImageBitmap': false;
	readonly 'ImageBitmapRenderingContext': false;
	readonly 'ImageCapture': false;
	readonly 'ImageData': false;
	readonly 'ImageDecoder': false;
	readonly 'ImageTrack': false;
	readonly 'ImageTrackList': false;
	readonly 'indexedDB': false;
	readonly 'Ink': false;
	readonly 'innerHeight': false;
	readonly 'innerWidth': false;
	readonly 'InputDeviceCapabilities': false;
	readonly 'InputDeviceInfo': false;
	readonly 'InputEvent': false;
	readonly 'IntegrityViolationReportBody': false;
	readonly 'InteractionContentfulPaint': false;
	readonly 'InterestEvent': false;
	readonly 'IntersectionObserver': false;
	readonly 'IntersectionObserverEntry': false;
	readonly 'isSecureContext': false;
	readonly 'Keyboard': false;
	readonly 'KeyboardEvent': false;
	readonly 'KeyboardLayoutMap': false;
	readonly 'KeyframeEffect': false;
	readonly 'LanguageDetector': false;
	readonly 'LanguageModel': false;
	readonly 'LargestContentfulPaint': false;
	readonly 'LaunchParams': false;
	readonly 'launchQueue': false;
	readonly 'LaunchQueue': false;
	readonly 'LayoutShift': false;
	readonly 'LayoutShiftAttribution': false;
	readonly 'length': false;
	readonly 'LinearAccelerationSensor': false;
	readonly 'localStorage': false;
	readonly 'location': true;
	readonly 'Location': false;
	readonly 'locationbar': false;
	readonly 'Lock': false;
	readonly 'LockManager': false;
	readonly 'matchMedia': false;
	readonly 'MathMLElement': false;
	readonly 'MediaCapabilities': false;
	readonly 'MediaCapabilitiesInfo': false;
	readonly 'MediaDeviceInfo': false;
	readonly 'MediaDevices': false;
	readonly 'MediaElementAudioSourceNode': false;
	readonly 'MediaEncryptedEvent': false;
	readonly 'MediaError': false;
	readonly 'MediaKeyError': false;
	readonly 'MediaKeyMessageEvent': false;
	readonly 'MediaKeys': false;
	readonly 'MediaKeySession': false;
	readonly 'MediaKeyStatusMap': false;
	readonly 'MediaKeySystemAccess': false;
	readonly 'MediaList': false;
	readonly 'MediaMetadata': false;
	readonly 'MediaQueryList': false;
	readonly 'MediaQueryListEvent': false;
	readonly 'MediaRecorder': false;
	readonly 'MediaRecorderErrorEvent': false;
	readonly 'MediaSession': false;
	readonly 'MediaSource': false;
	readonly 'MediaSourceHandle': false;
	readonly 'MediaStream': false;
	readonly 'MediaStreamAudioDestinationNode': false;
	readonly 'MediaStreamAudioSourceNode': false;
	readonly 'MediaStreamEvent': false;
	readonly 'MediaStreamTrack': false;
	readonly 'MediaStreamTrackAudioSourceNode': false;
	readonly 'MediaStreamTrackAudioStats': false;
	readonly 'MediaStreamTrackEvent': false;
	readonly 'MediaStreamTrackGenerator': false;
	readonly 'MediaStreamTrackProcessor': false;
	readonly 'MediaStreamTrackVideoStats': false;
	readonly 'menubar': false;
	readonly 'MessageChannel': false;
	readonly 'MessageEvent': false;
	readonly 'MessagePort': false;
	readonly 'MIDIAccess': false;
	readonly 'MIDIConnectionEvent': false;
	readonly 'MIDIInput': false;
	readonly 'MIDIInputMap': false;
	readonly 'MIDIMessageEvent': false;
	readonly 'MIDIOutput': false;
	readonly 'MIDIOutputMap': false;
	readonly 'MIDIPort': false;
	readonly 'MimeType': false;
	readonly 'MimeTypeArray': false;
	readonly 'model': false;
	readonly 'ModelContext': false;
	readonly 'ModelGenericSession': false;
	readonly 'ModelManager': false;
	readonly 'MouseEvent': false;
	readonly 'moveBy': false;
	readonly 'moveTo': false;
	readonly 'MutationEvent': false;
	readonly 'MutationObserver': false;
	readonly 'MutationRecord': false;
	readonly 'name': false;
	readonly 'NamedNodeMap': false;
	readonly 'NavigateEvent': false;
	readonly 'navigation': false;
	readonly 'Navigation': false;
	readonly 'NavigationActivation': false;
	readonly 'NavigationCurrentEntryChangeEvent': false;
	readonly 'NavigationDestination': false;
	readonly 'NavigationHistoryEntry': false;
	readonly 'NavigationPrecommitController': false;
	readonly 'NavigationPreloadManager': false;
	readonly 'NavigationTransition': false;
	readonly 'navigator': false;
	readonly 'Navigator': false;
	readonly 'NavigatorLogin': false;
	readonly 'NavigatorManagedData': false;
	readonly 'NavigatorUAData': false;
	readonly 'NetworkInformation': false;
	readonly 'Node': false;
	readonly 'NodeFilter': false;
	readonly 'NodeIterator': false;
	readonly 'NodeList': false;
	readonly 'Notification': false;
	readonly 'NotifyPaintEvent': false;
	readonly 'NotRestoredReasonDetails': false;
	readonly 'NotRestoredReasons': false;
	readonly 'Observable': false;
	readonly 'OfflineAudioCompletionEvent': false;
	readonly 'OfflineAudioContext': false;
	readonly 'offscreenBuffering': false;
	readonly 'OffscreenCanvas': false;
	readonly 'OffscreenCanvasRenderingContext2D': false;
	readonly 'onabort': true;
	readonly 'onafterprint': true;
	readonly 'onanimationcancel': true;
	readonly 'onanimationend': true;
	readonly 'onanimationiteration': true;
	readonly 'onanimationstart': true;
	readonly 'onappinstalled': true;
	readonly 'onauxclick': true;
	readonly 'onbeforeinput': true;
	readonly 'onbeforeinstallprompt': true;
	readonly 'onbeforematch': true;
	readonly 'onbeforeprint': true;
	readonly 'onbeforetoggle': true;
	readonly 'onbeforeunload': true;
	readonly 'onbeforexrselect': true;
	readonly 'onblur': true;
	readonly 'oncancel': true;
	readonly 'oncanplay': true;
	readonly 'oncanplaythrough': true;
	readonly 'onchange': true;
	readonly 'onclick': true;
	readonly 'onclose': true;
	readonly 'oncommand': true;
	readonly 'oncontentvisibilityautostatechange': true;
	readonly 'oncontextlost': true;
	readonly 'oncontextmenu': true;
	readonly 'oncontextrestored': true;
	readonly 'oncopy': true;
	readonly 'oncuechange': true;
	readonly 'oncut': true;
	readonly 'ondblclick': true;
	readonly 'ondevicemotion': true;
	readonly 'ondeviceorientation': true;
	readonly 'ondeviceorientationabsolute': true;
	readonly 'ondrag': true;
	readonly 'ondragend': true;
	readonly 'ondragenter': true;
	readonly 'ondragleave': true;
	readonly 'ondragover': true;
	readonly 'ondragstart': true;
	readonly 'ondrop': true;
	readonly 'ondurationchange': true;
	readonly 'onemptied': true;
	readonly 'onended': true;
	readonly 'onerror': true;
	readonly 'onfocus': true;
	readonly 'onformdata': true;
	readonly 'ongamepadconnected': true;
	readonly 'ongamepaddisconnected': true;
	readonly 'ongotpointercapture': true;
	readonly 'onhashchange': true;
	readonly 'oninput': true;
	readonly 'oninvalid': true;
	readonly 'onkeydown': true;
	readonly 'onkeypress': true;
	readonly 'onkeyup': true;
	readonly 'onlanguagechange': true;
	readonly 'onload': true;
	readonly 'onloadeddata': true;
	readonly 'onloadedmetadata': true;
	readonly 'onloadstart': true;
	readonly 'onlostpointercapture': true;
	readonly 'onmessage': true;
	readonly 'onmessageerror': true;
	readonly 'onmousedown': true;
	readonly 'onmouseenter': true;
	readonly 'onmouseleave': true;
	readonly 'onmousemove': true;
	readonly 'onmouseout': true;
	readonly 'onmouseover': true;
	readonly 'onmouseup': true;
	readonly 'onmousewheel': true;
	readonly 'onoffline': true;
	readonly 'ononline': true;
	readonly 'onpagehide': true;
	readonly 'onpagereveal': true;
	readonly 'onpageshow': true;
	readonly 'onpageswap': true;
	readonly 'onpaste': true;
	readonly 'onpause': true;
	readonly 'onplay': true;
	readonly 'onplaying': true;
	readonly 'onpointercancel': true;
	readonly 'onpointerdown': true;
	readonly 'onpointerenter': true;
	readonly 'onpointerleave': true;
	readonly 'onpointermove': true;
	readonly 'onpointerout': true;
	readonly 'onpointerover': true;
	readonly 'onpointerrawupdate': true;
	readonly 'onpointerup': true;
	readonly 'onpopstate': true;
	readonly 'onprogress': true;
	readonly 'onratechange': true;
	readonly 'onrejectionhandled': true;
	readonly 'onreset': true;
	readonly 'onresize': true;
	readonly 'onscroll': true;
	readonly 'onscrollend': true;
	readonly 'onscrollsnapchange': true;
	readonly 'onscrollsnapchanging': true;
	readonly 'onsearch': true;
	readonly 'onsecuritypolicyviolation': true;
	readonly 'onseeked': true;
	readonly 'onseeking': true;
	readonly 'onselect': true;
	readonly 'onselectionchange': true;
	readonly 'onselectstart': true;
	readonly 'onslotchange': true;
	readonly 'onstalled': true;
	readonly 'onstorage': true;
	readonly 'onsubmit': true;
	readonly 'onsuspend': true;
	readonly 'ontimeupdate': true;
	readonly 'ontoggle': true;
	readonly 'ontransitioncancel': true;
	readonly 'ontransitionend': true;
	readonly 'ontransitionrun': true;
	readonly 'ontransitionstart': true;
	readonly 'onunhandledrejection': true;
	readonly 'onunload': true;
	readonly 'onvolumechange': true;
	readonly 'onwaiting': true;
	readonly 'onwheel': true;
	readonly 'open': false;
	readonly 'opener': false;
	readonly 'Option': false;
	readonly 'OrientationSensor': false;
	readonly 'origin': false;
	readonly 'Origin': false;
	readonly 'originAgentCluster': false;
	readonly 'OscillatorNode': false;
	readonly 'OTPCredential': false;
	readonly 'outerHeight': false;
	readonly 'outerWidth': false;
	readonly 'OverconstrainedError': false;
	readonly 'PageRevealEvent': false;
	readonly 'PageSwapEvent': false;
	readonly 'PageTransitionEvent': false;
	readonly 'pageXOffset': false;
	readonly 'pageYOffset': false;
	readonly 'PannerNode': false;
	readonly 'parent': false;
	readonly 'PasswordCredential': false;
	readonly 'Path2D': false;
	readonly 'PaymentAddress': false;
	readonly 'PaymentManager': false;
	readonly 'PaymentMethodChangeEvent': false;
	readonly 'PaymentRequest': false;
	readonly 'PaymentRequestUpdateEvent': false;
	readonly 'PaymentResponse': false;
	readonly 'performance': false;
	readonly 'Performance': false;
	readonly 'PerformanceElementTiming': false;
	readonly 'PerformanceEntry': false;
	readonly 'PerformanceEventTiming': false;
	readonly 'PerformanceLongAnimationFrameTiming': false;
	readonly 'PerformanceLongTaskTiming': false;
	readonly 'PerformanceMark': false;
	readonly 'PerformanceMarkConditional': false;
	readonly 'PerformanceMeasure': false;
	readonly 'PerformanceNavigation': false;
	readonly 'PerformanceNavigationTiming': false;
	readonly 'PerformanceObserver': false;
	readonly 'PerformanceObserverEntryList': false;
	readonly 'PerformancePaintTiming': false;
	readonly 'PerformanceResourceTiming': false;
	readonly 'PerformanceScriptTiming': false;
	readonly 'PerformanceServerTiming': false;
	readonly 'PerformanceSoftNavigation': false;
	readonly 'PerformanceTiming': false;
	readonly 'PerformanceTimingConfidence': false;
	readonly 'PeriodicSyncManager': false;
	readonly 'PeriodicWave': false;
	readonly 'Permissions': false;
	readonly 'PermissionsPolicy': false;
	readonly 'PermissionStatus': false;
	readonly 'PERSISTENT': false;
	readonly 'personalbar': false;
	readonly 'PictureInPictureEvent': false;
	readonly 'PictureInPictureWindow': false;
	readonly 'Plugin': false;
	readonly 'PluginArray': false;
	readonly 'PointerEvent': false;
	readonly 'PopStateEvent': false;
	readonly 'postMessage': false;
	readonly 'Presentation': false;
	readonly 'PresentationAvailability': false;
	readonly 'PresentationConnection': false;
	readonly 'PresentationConnectionAvailableEvent': false;
	readonly 'PresentationConnectionCloseEvent': false;
	readonly 'PresentationConnectionList': false;
	readonly 'PresentationReceiver': false;
	readonly 'PresentationRequest': false;
	readonly 'PressureObserver': false;
	readonly 'PressureRecord': false;
	readonly 'print': false;
	readonly 'ProcessingInstruction': false;
	readonly 'Profiler': false;
	readonly 'ProgressEvent': false;
	readonly 'PromiseRejectionEvent': false;
	readonly 'prompt': false;
	readonly 'ProtectedAudience': false;
	readonly 'PublicKeyCredential': false;
	readonly 'PushManager': false;
	readonly 'PushSubscription': false;
	readonly 'PushSubscriptionOptions': false;
	readonly 'queryLocalFonts': false;
	readonly 'queueMicrotask': false;
	readonly 'QuotaExceededError': false;
	readonly 'RadioNodeList': false;
	readonly 'Range': false;
	readonly 'ReadableByteStreamController': false;
	readonly 'ReadableStream': false;
	readonly 'ReadableStreamBYOBReader': false;
	readonly 'ReadableStreamBYOBRequest': false;
	readonly 'ReadableStreamDefaultController': false;
	readonly 'ReadableStreamDefaultReader': false;
	readonly 'RelativeOrientationSensor': false;
	readonly 'RemotePlayback': false;
	readonly 'removeEventListener': false;
	readonly 'ReportBody': false;
	readonly 'reportError': false;
	readonly 'ReportingObserver': false;
	readonly 'Request': false;
	readonly 'requestAnimationFrame': false;
	readonly 'requestIdleCallback': false;
	readonly 'resizeBy': false;
	readonly 'ResizeObserver': false;
	readonly 'ResizeObserverEntry': false;
	readonly 'ResizeObserverSize': false;
	readonly 'resizeTo': false;
	readonly 'Response': false;
	readonly 'RestrictionTarget': false;
	readonly 'RTCCertificate': false;
	readonly 'RTCDataChannel': false;
	readonly 'RTCDataChannelEvent': false;
	readonly 'RTCDtlsTransport': false;
	readonly 'RTCDTMFSender': false;
	readonly 'RTCDTMFToneChangeEvent': false;
	readonly 'RTCEncodedAudioFrame': false;
	readonly 'RTCEncodedVideoFrame': false;
	readonly 'RTCError': false;
	readonly 'RTCErrorEvent': false;
	readonly 'RTCIceCandidate': false;
	readonly 'RTCIceCandidatePair': false;
	readonly 'RTCIceTransport': false;
	readonly 'RTCPeerConnection': false;
	readonly 'RTCPeerConnectionIceErrorEvent': false;
	readonly 'RTCPeerConnectionIceEvent': false;
	readonly 'RTCRtpReceiver': false;
	readonly 'RTCRtpScriptTransform': false;
	readonly 'RTCRtpSender': false;
	readonly 'RTCRtpTransceiver': false;
	readonly 'RTCSctpTransport': false;
	readonly 'RTCSessionDescription': false;
	readonly 'RTCStatsReport': false;
	readonly 'RTCTrackEvent': false;
	readonly 'Sanitizer': false;
	readonly 'scheduler': false;
	readonly 'Scheduler': false;
	readonly 'Scheduling': false;
	readonly 'screen': false;
	readonly 'Screen': false;
	readonly 'ScreenDetailed': false;
	readonly 'ScreenDetails': false;
	readonly 'screenLeft': false;
	readonly 'ScreenOrientation': false;
	readonly 'screenTop': false;
	readonly 'screenX': false;
	readonly 'screenY': false;
	readonly 'ScriptProcessorNode': false;
	readonly 'scroll': false;
	readonly 'scrollbars': false;
	readonly 'scrollBy': false;
	readonly 'ScrollTimeline': false;
	readonly 'scrollTo': false;
	readonly 'scrollX': false;
	readonly 'scrollY': false;
	readonly 'SecurityPolicyViolationEvent': false;
	readonly 'Selection': false;
	readonly 'self': false;
	readonly 'Sensor': false;
	readonly 'SensorErrorEvent': false;
	readonly 'Serial': false;
	readonly 'SerialPort': false;
	readonly 'ServiceWorker': false;
	readonly 'ServiceWorkerContainer': false;
	readonly 'ServiceWorkerRegistration': false;
	readonly 'sessionStorage': false;
	readonly 'setInterval': false;
	readonly 'setTimeout': false;
	readonly 'ShadowRoot': false;
	readonly 'sharedStorage': false;
	readonly 'SharedStorage': false;
	readonly 'SharedStorageAppendMethod': false;
	readonly 'SharedStorageClearMethod': false;
	readonly 'SharedStorageDeleteMethod': false;
	readonly 'SharedStorageModifierMethod': false;
	readonly 'SharedStorageSetMethod': false;
	readonly 'SharedStorageWorklet': false;
	readonly 'SharedWorker': false;
	readonly 'showDirectoryPicker': false;
	readonly 'showOpenFilePicker': false;
	readonly 'showSaveFilePicker': false;
	readonly 'SnapEvent': false;
	readonly 'SourceBuffer': false;
	readonly 'SourceBufferList': false;
	readonly 'SpeechGrammar': false;
	readonly 'SpeechGrammarList': false;
	readonly 'SpeechRecognition': false;
	readonly 'SpeechRecognitionErrorEvent': false;
	readonly 'SpeechRecognitionEvent': false;
	readonly 'SpeechRecognitionPhrase': false;
	readonly 'speechSynthesis': false;
	readonly 'SpeechSynthesis': false;
	readonly 'SpeechSynthesisErrorEvent': false;
	readonly 'SpeechSynthesisEvent': false;
	readonly 'SpeechSynthesisUtterance': false;
	readonly 'SpeechSynthesisVoice': false;
	readonly 'StaticRange': false;
	readonly 'status': false;
	readonly 'statusbar': false;
	readonly 'StereoPannerNode': false;
	readonly 'stop': false;
	readonly 'Storage': false;
	readonly 'StorageBucket': false;
	readonly 'StorageBucketManager': false;
	readonly 'StorageEvent': false;
	readonly 'StorageManager': false;
	readonly 'structuredClone': false;
	readonly 'styleMedia': false;
	readonly 'StylePropertyMap': false;
	readonly 'StylePropertyMapReadOnly': false;
	readonly 'StyleSheet': false;
	readonly 'StyleSheetList': false;
	readonly 'SubmitEvent': false;
	readonly 'Subscriber': false;
	readonly 'SubtleCrypto': false;
	readonly 'Summarizer': false;
	readonly 'SVGAElement': false;
	readonly 'SVGAngle': false;
	readonly 'SVGAnimatedAngle': false;
	readonly 'SVGAnimatedBoolean': false;
	readonly 'SVGAnimatedEnumeration': false;
	readonly 'SVGAnimatedInteger': false;
	readonly 'SVGAnimatedLength': false;
	readonly 'SVGAnimatedLengthList': false;
	readonly 'SVGAnimatedNumber': false;
	readonly 'SVGAnimatedNumberList': false;
	readonly 'SVGAnimatedPreserveAspectRatio': false;
	readonly 'SVGAnimatedRect': false;
	readonly 'SVGAnimatedString': false;
	readonly 'SVGAnimatedTransformList': false;
	readonly 'SVGAnimateElement': false;
	readonly 'SVGAnimateMotionElement': false;
	readonly 'SVGAnimateTransformElement': false;
	readonly 'SVGAnimationElement': false;
	readonly 'SVGCircleElement': false;
	readonly 'SVGClipPathElement': false;
	readonly 'SVGComponentTransferFunctionElement': false;
	readonly 'SVGDefsElement': false;
	readonly 'SVGDescElement': false;
	readonly 'SVGElement': false;
	readonly 'SVGEllipseElement': false;
	readonly 'SVGFEBlendElement': false;
	readonly 'SVGFEColorMatrixElement': false;
	readonly 'SVGFEComponentTransferElement': false;
	readonly 'SVGFECompositeElement': false;
	readonly 'SVGFEConvolveMatrixElement': false;
	readonly 'SVGFEDiffuseLightingElement': false;
	readonly 'SVGFEDisplacementMapElement': false;
	readonly 'SVGFEDistantLightElement': false;
	readonly 'SVGFEDropShadowElement': false;
	readonly 'SVGFEFloodElement': false;
	readonly 'SVGFEFuncAElement': false;
	readonly 'SVGFEFuncBElement': false;
	readonly 'SVGFEFuncGElement': false;
	readonly 'SVGFEFuncRElement': false;
	readonly 'SVGFEGaussianBlurElement': false;
	readonly 'SVGFEImageElement': false;
	readonly 'SVGFEMergeElement': false;
	readonly 'SVGFEMergeNodeElement': false;
	readonly 'SVGFEMorphologyElement': false;
	readonly 'SVGFEOffsetElement': false;
	readonly 'SVGFEPointLightElement': false;
	readonly 'SVGFESpecularLightingElement': false;
	readonly 'SVGFESpotLightElement': false;
	readonly 'SVGFETileElement': false;
	readonly 'SVGFETurbulenceElement': false;
	readonly 'SVGFilterElement': false;
	readonly 'SVGForeignObjectElement': false;
	readonly 'SVGGElement': false;
	readonly 'SVGGeometryElement': false;
	readonly 'SVGGradientElement': false;
	readonly 'SVGGraphicsElement': false;
	readonly 'SVGImageElement': false;
	readonly 'SVGLength': false;
	readonly 'SVGLengthList': false;
	readonly 'SVGLinearGradientElement': false;
	readonly 'SVGLineElement': false;
	readonly 'SVGMarkerElement': false;
	readonly 'SVGMaskElement': false;
	readonly 'SVGMatrix': false;
	readonly 'SVGMetadataElement': false;
	readonly 'SVGMPathElement': false;
	readonly 'SVGNumber': false;
	readonly 'SVGNumberList': false;
	readonly 'SVGPathElement': false;
	readonly 'SVGPatternElement': false;
	readonly 'SVGPoint': false;
	readonly 'SVGPointList': false;
	readonly 'SVGPolygonElement': false;
	readonly 'SVGPolylineElement': false;
	readonly 'SVGPreserveAspectRatio': false;
	readonly 'SVGRadialGradientElement': false;
	readonly 'SVGRect': false;
	readonly 'SVGRectElement': false;
	readonly 'SVGScriptElement': false;
	readonly 'SVGSetElement': false;
	readonly 'SVGStopElement': false;
	readonly 'SVGStringList': false;
	readonly 'SVGStyleElement': false;
	readonly 'SVGSVGElement': false;
	readonly 'SVGSwitchElement': false;
	readonly 'SVGSymbolElement': false;
	readonly 'SVGTextContentElement': false;
	readonly 'SVGTextElement': false;
	readonly 'SVGTextPathElement': false;
	readonly 'SVGTextPositioningElement': false;
	readonly 'SVGTitleElement': false;
	readonly 'SVGTransform': false;
	readonly 'SVGTransformList': false;
	readonly 'SVGTSpanElement': false;
	readonly 'SVGUnitTypes': false;
	readonly 'SVGUseElement': false;
	readonly 'SVGViewElement': false;
	readonly 'SyncManager': false;
	readonly 'TaskAttributionTiming': false;
	readonly 'TaskController': false;
	readonly 'TaskPriorityChangeEvent': false;
	readonly 'TaskSignal': false;
	readonly 'Temporal': false;
	readonly 'TEMPORARY': false;
	readonly 'Text': false;
	readonly 'TextDecoder': false;
	readonly 'TextDecoderStream': false;
	readonly 'TextEncoder': false;
	readonly 'TextEncoderStream': false;
	readonly 'TextEvent': false;
	readonly 'TextFormat': false;
	readonly 'TextFormatUpdateEvent': false;
	readonly 'TextMetrics': false;
	readonly 'TextTrack': false;
	readonly 'TextTrackCue': false;
	readonly 'TextTrackCueList': false;
	readonly 'TextTrackList': false;
	readonly 'TextUpdateEvent': false;
	readonly 'TimeEvent': false;
	readonly 'TimelineTrigger': false;
	readonly 'TimelineTriggerRange': false;
	readonly 'TimelineTriggerRangeList': false;
	readonly 'TimeRanges': false;
	readonly 'ToggleEvent': false;
	readonly 'toolbar': false;
	readonly 'top': false;
	readonly 'Touch': false;
	readonly 'TouchEvent': false;
	readonly 'TouchList': false;
	readonly 'TrackEvent': false;
	readonly 'TransformStream': false;
	readonly 'TransformStreamDefaultController': false;
	readonly 'TransitionEvent': false;
	readonly 'Translator': false;
	readonly 'TreeWalker': false;
	readonly 'TrustedHTML': false;
	readonly 'TrustedScript': false;
	readonly 'TrustedScriptURL': false;
	readonly 'TrustedTypePolicy': false;
	readonly 'TrustedTypePolicyFactory': false;
	readonly 'trustedTypes': false;
	readonly 'UIEvent': false;
	readonly 'URL': false;
	readonly 'URLPattern': false;
	readonly 'URLSearchParams': false;
	readonly 'USB': false;
	readonly 'USBAlternateInterface': false;
	readonly 'USBConfiguration': false;
	readonly 'USBConnectionEvent': false;
	readonly 'USBDevice': false;
	readonly 'USBEndpoint': false;
	readonly 'USBInterface': false;
	readonly 'USBInTransferResult': false;
	readonly 'USBIsochronousInTransferPacket': false;
	readonly 'USBIsochronousInTransferResult': false;
	readonly 'USBIsochronousOutTransferPacket': false;
	readonly 'USBIsochronousOutTransferResult': false;
	readonly 'USBOutTransferResult': false;
	readonly 'UserActivation': false;
	readonly 'ValidityState': false;
	readonly 'VideoColorSpace': false;
	readonly 'VideoDecoder': false;
	readonly 'VideoEncoder': false;
	readonly 'VideoFrame': false;
	readonly 'VideoPlaybackQuality': false;
	readonly 'viewport': false;
	readonly 'Viewport': false;
	readonly 'ViewTimeline': false;
	readonly 'ViewTransition': false;
	readonly 'ViewTransitionTypeSet': false;
	readonly 'VirtualKeyboard': false;
	readonly 'VirtualKeyboardGeometryChangeEvent': false;
	readonly 'VisibilityStateEntry': false;
	readonly 'visualViewport': false;
	readonly 'VisualViewport': false;
	readonly 'VTTCue': false;
	readonly 'VTTRegion': false;
	readonly 'WakeLock': false;
	readonly 'WakeLockSentinel': false;
	readonly 'WaveShaperNode': false;
	readonly 'WebAssembly': false;
	readonly 'WebGL2RenderingContext': false;
	readonly 'WebGLActiveInfo': false;
	readonly 'WebGLBuffer': false;
	readonly 'WebGLContextEvent': false;
	readonly 'WebGLFramebuffer': false;
	readonly 'WebGLObject': false;
	readonly 'WebGLProgram': false;
	readonly 'WebGLQuery': false;
	readonly 'WebGLRenderbuffer': false;
	readonly 'WebGLRenderingContext': false;
	readonly 'WebGLSampler': false;
	readonly 'WebGLShader': false;
	readonly 'WebGLShaderPrecisionFormat': false;
	readonly 'WebGLSync': false;
	readonly 'WebGLTexture': false;
	readonly 'WebGLTransformFeedback': false;
	readonly 'WebGLUniformLocation': false;
	readonly 'WebGLVertexArrayObject': false;
	readonly 'WebMCPEvent': false;
	readonly 'WebSocket': false;
	readonly 'WebSocketError': false;
	readonly 'WebSocketStream': false;
	readonly 'WebTransport': false;
	readonly 'WebTransportBidirectionalStream': false;
	readonly 'WebTransportDatagramDuplexStream': false;
	readonly 'WebTransportDatagramsWritable': false;
	readonly 'WebTransportError': false;
	readonly 'WebTransportReceiveStream': false;
	readonly 'WebTransportSendGroup': false;
	readonly 'WebTransportSendStream': false;
	readonly 'WGSLLanguageFeatures': false;
	readonly 'WheelEvent': false;
	readonly 'when': false;
	readonly 'window': false;
	readonly 'Window': false;
	readonly 'WindowControlsOverlay': false;
	readonly 'WindowControlsOverlayGeometryChangeEvent': false;
	readonly 'Worker': false;
	readonly 'Worklet': false;
	readonly 'WritableStream': false;
	readonly 'WritableStreamDefaultController': false;
	readonly 'WritableStreamDefaultWriter': false;
	readonly 'XMLDocument': false;
	readonly 'XMLHttpRequest': false;
	readonly 'XMLHttpRequestEventTarget': false;
	readonly 'XMLHttpRequestUpload': false;
	readonly 'XMLSerializer': false;
	readonly 'XPathEvaluator': false;
	readonly 'XPathExpression': false;
	readonly 'XPathResult': false;
	readonly 'XRAnchor': false;
	readonly 'XRAnchorSet': false;
	readonly 'XRBoundedReferenceSpace': false;
	readonly 'XRCamera': false;
	readonly 'XRCompositionLayer': false;
	readonly 'XRCPUDepthInformation': false;
	readonly 'XRCubeLayer': false;
	readonly 'XRCylinderLayer': false;
	readonly 'XRDepthInformation': false;
	readonly 'XRDOMOverlayState': false;
	readonly 'XREquirectLayer': false;
	readonly 'XRFrame': false;
	readonly 'XRHand': false;
	readonly 'XRHitTestResult': false;
	readonly 'XRHitTestSource': false;
	readonly 'XRInputSource': false;
	readonly 'XRInputSourceArray': false;
	readonly 'XRInputSourceEvent': false;
	readonly 'XRInputSourcesChangeEvent': false;
	readonly 'XRJointPose': false;
	readonly 'XRJointSpace': false;
	readonly 'XRLayer': false;
	readonly 'XRLayerEvent': false;
	readonly 'XRLightEstimate': false;
	readonly 'XRLightProbe': false;
	readonly 'XRPlane': false;
	readonly 'XRPlaneSet': false;
	readonly 'XRPose': false;
	readonly 'XRProjectionLayer': false;
	readonly 'XRQuadLayer': false;
	readonly 'XRRay': false;
	readonly 'XRReferenceSpace': false;
	readonly 'XRReferenceSpaceEvent': false;
	readonly 'XRRenderState': false;
	readonly 'XRRigidTransform': false;
	readonly 'XRSession': false;
	readonly 'XRSessionEvent': false;
	readonly 'XRSpace': false;
	readonly 'XRSubImage': false;
	readonly 'XRSystem': false;
	readonly 'XRTransientInputHitTestResult': false;
	readonly 'XRTransientInputHitTestSource': false;
	readonly 'XRView': false;
	readonly 'XRViewerPose': false;
	readonly 'XRViewport': false;
	readonly 'XRVisibilityMaskChangeEvent': false;
	readonly 'XRWebGLBinding': false;
	readonly 'XRWebGLDepthInformation': false;
	readonly 'XRWebGLLayer': false;
	readonly 'XRWebGLSubImage': false;
	readonly 'XSLTProcessor': false;
}

type GlobalsBuiltin = {
	readonly 'AggregateError': false;
	readonly 'Array': false;
	readonly 'ArrayBuffer': false;
	readonly 'AsyncDisposableStack': false;
	readonly 'Atomics': false;
	readonly 'BigInt': false;
	readonly 'BigInt64Array': false;
	readonly 'BigUint64Array': false;
	readonly 'Boolean': false;
	readonly 'DataView': false;
	readonly 'Date': false;
	readonly 'decodeURI': false;
	readonly 'decodeURIComponent': false;
	readonly 'DisposableStack': false;
	readonly 'encodeURI': false;
	readonly 'encodeURIComponent': false;
	readonly 'Error': false;
	readonly 'escape': false;
	readonly 'eval': false;
	readonly 'EvalError': false;
	readonly 'FinalizationRegistry': false;
	readonly 'Float16Array': false;
	readonly 'Float32Array': false;
	readonly 'Float64Array': false;
	readonly 'Function': false;
	readonly 'globalThis': false;
	readonly 'Infinity': false;
	readonly 'Int16Array': false;
	readonly 'Int32Array': false;
	readonly 'Int8Array': false;
	readonly 'Intl': false;
	readonly 'isFinite': false;
	readonly 'isNaN': false;
	readonly 'Iterator': false;
	readonly 'JSON': false;
	readonly 'Map': false;
	readonly 'Math': false;
	readonly 'NaN': false;
	readonly 'Number': false;
	readonly 'Object': false;
	readonly 'parseFloat': false;
	readonly 'parseInt': false;
	readonly 'Promise': false;
	readonly 'Proxy': false;
	readonly 'RangeError': false;
	readonly 'ReferenceError': false;
	readonly 'Reflect': false;
	readonly 'RegExp': false;
	readonly 'Set': false;
	readonly 'SharedArrayBuffer': false;
	readonly 'String': false;
	readonly 'SuppressedError': false;
	readonly 'Symbol': false;
	readonly 'SyntaxError': false;
	readonly 'TypeError': false;
	readonly 'Uint16Array': false;
	readonly 'Uint32Array': false;
	readonly 'Uint8Array': false;
	readonly 'Uint8ClampedArray': false;
	readonly 'undefined': false;
	readonly 'unescape': false;
	readonly 'URIError': false;
	readonly 'WeakMap': false;
	readonly 'WeakRef': false;
	readonly 'WeakSet': false;
}

type GlobalsBunBuiltin = {
	readonly 'AbortController': false;
	readonly 'AbortSignal': false;
	readonly 'addEventListener': false;
	readonly 'alert': false;
	readonly 'atob': false;
	readonly 'Blob': false;
	readonly 'BroadcastChannel': false;
	readonly 'btoa': false;
	readonly 'Buffer': false;
	readonly 'BuildError': false;
	readonly 'BuildMessage': false;
	readonly 'Bun': false;
	readonly 'ByteLengthQueuingStrategy': false;
	readonly 'clearImmediate': false;
	readonly 'clearInterval': false;
	readonly 'clearTimeout': false;
	readonly 'CloseEvent': false;
	readonly 'CompressionStream': false;
	readonly 'confirm': false;
	readonly 'console': false;
	readonly 'CountQueuingStrategy': false;
	readonly 'crypto': false;
	readonly 'Crypto': false;
	readonly 'CryptoKey': false;
	readonly 'CustomEvent': false;
	readonly 'DecompressionStream': false;
	readonly 'dispatchEvent': false;
	readonly 'DOMException': false;
	readonly 'ErrorEvent': false;
	readonly 'Event': false;
	readonly 'EventTarget': false;
	readonly 'fetch': false;
	readonly 'File': false;
	readonly 'FormData': false;
	readonly 'global': false;
	readonly 'Headers': false;
	readonly 'HTMLRewriter': false;
	readonly 'Loader': false;
	readonly 'MessageChannel': false;
	readonly 'MessageEvent': false;
	readonly 'MessagePort': false;
	readonly 'navigator': false;
	readonly 'onerror': true;
	readonly 'onmessage': true;
	readonly 'performance': false;
	readonly 'Performance': false;
	readonly 'PerformanceEntry': false;
	readonly 'PerformanceMark': false;
	readonly 'PerformanceMeasure': false;
	readonly 'PerformanceObserver': false;
	readonly 'PerformanceObserverEntryList': false;
	readonly 'PerformanceResourceTiming': false;
	readonly 'PerformanceServerTiming': false;
	readonly 'PerformanceTiming': false;
	readonly 'postMessage': false;
	readonly 'process': false;
	readonly 'prompt': false;
	readonly 'queueMicrotask': false;
	readonly 'ReadableByteStreamController': false;
	readonly 'ReadableStream': false;
	readonly 'ReadableStreamBYOBReader': false;
	readonly 'ReadableStreamBYOBRequest': false;
	readonly 'ReadableStreamDefaultController': false;
	readonly 'ReadableStreamDefaultReader': false;
	readonly 'removeEventListener': false;
	readonly 'reportError': false;
	readonly 'Request': false;
	readonly 'ResolveError': false;
	readonly 'ResolveMessage': false;
	readonly 'Response': false;
	readonly 'self': false;
	readonly 'setImmediate': false;
	readonly 'setInterval': false;
	readonly 'setTimeout': false;
	readonly 'ShadowRealm': false;
	readonly 'structuredClone': false;
	readonly 'SubtleCrypto': false;
	readonly 'TextDecoder': false;
	readonly 'TextDecoderStream': false;
	readonly 'TextEncoder': false;
	readonly 'TextEncoderStream': false;
	readonly 'TransformStream': false;
	readonly 'TransformStreamDefaultController': false;
	readonly 'URL': false;
	readonly 'URLPattern': false;
	readonly 'URLSearchParams': false;
	readonly 'WebAssembly': false;
	readonly 'WebSocket': false;
	readonly 'Worker': false;
	readonly 'WritableStream': false;
	readonly 'WritableStreamDefaultController': false;
	readonly 'WritableStreamDefaultWriter': false;
}

type GlobalsChai = {
	readonly 'assert': true;
	readonly 'expect': true;
	readonly 'should': true;
}

type GlobalsCommonjs = {
	readonly 'exports': true;
	readonly 'global': false;
	readonly 'module': false;
	readonly 'require': false;
}

type GlobalsCouch = {
	readonly 'emit': false;
	readonly 'exports': false;
	readonly 'getRow': false;
	readonly 'log': false;
	readonly 'module': false;
	readonly 'provides': false;
	readonly 'require': false;
	readonly 'respond': false;
	readonly 'send': false;
	readonly 'start': false;
	readonly 'sum': false;
}

type GlobalsDenoBuiltin = {
	readonly 'AbortController': false;
	readonly 'AbortSignal': false;
	readonly 'addEventListener': false;
	readonly 'alert': false;
	readonly 'atob': false;
	readonly 'Blob': false;
	readonly 'BroadcastChannel': false;
	readonly 'btoa': false;
	readonly 'Buffer': false;
	readonly 'ByteLengthQueuingStrategy': false;
	readonly 'Cache': false;
	readonly 'caches': false;
	readonly 'CacheStorage': false;
	readonly 'clearImmediate': false;
	readonly 'clearInterval': false;
	readonly 'clearTimeout': false;
	readonly 'close': false;
	readonly 'closed': false;
	readonly 'CloseEvent': false;
	readonly 'CompressionStream': false;
	readonly 'confirm': false;
	readonly 'console': false;
	readonly 'CountQueuingStrategy': false;
	readonly 'createImageBitmap': false;
	readonly 'crypto': false;
	readonly 'Crypto': false;
	readonly 'CryptoKey': false;
	readonly 'CustomEvent': false;
	readonly 'DecompressionStream': false;
	readonly 'Deno': false;
	readonly 'dispatchEvent': false;
	readonly 'DOMException': false;
	readonly 'DOMMatrix': false;
	readonly 'DOMMatrixReadOnly': false;
	readonly 'DOMPoint': false;
	readonly 'DOMPointReadOnly': false;
	readonly 'DOMQuad': false;
	readonly 'DOMRect': false;
	readonly 'DOMRectReadOnly': false;
	readonly 'ErrorEvent': false;
	readonly 'Event': false;
	readonly 'EventSource': false;
	readonly 'EventTarget': false;
	readonly 'fetch': false;
	readonly 'File': false;
	readonly 'FileReader': false;
	readonly 'FormData': false;
	readonly 'getParent': false;
	readonly 'global': false;
	readonly 'GPU': false;
	readonly 'GPUAdapter': false;
	readonly 'GPUAdapterInfo': false;
	readonly 'GPUBindGroup': false;
	readonly 'GPUBindGroupLayout': false;
	readonly 'GPUBuffer': false;
	readonly 'GPUBufferUsage': false;
	readonly 'GPUCanvasContext': false;
	readonly 'GPUColorWrite': false;
	readonly 'GPUCommandBuffer': false;
	readonly 'GPUCommandEncoder': false;
	readonly 'GPUCompilationInfo': false;
	readonly 'GPUCompilationMessage': false;
	readonly 'GPUComputePassEncoder': false;
	readonly 'GPUComputePipeline': false;
	readonly 'GPUDevice': false;
	readonly 'GPUDeviceLostInfo': false;
	readonly 'GPUError': false;
	readonly 'GPUInternalError': false;
	readonly 'GPUMapMode': false;
	readonly 'GPUOutOfMemoryError': false;
	readonly 'GPUPipelineError': false;
	readonly 'GPUPipelineLayout': false;
	readonly 'GPUQuerySet': false;
	readonly 'GPUQueue': false;
	readonly 'GPURenderBundle': false;
	readonly 'GPURenderBundleEncoder': false;
	readonly 'GPURenderPassEncoder': false;
	readonly 'GPURenderPipeline': false;
	readonly 'GPUSampler': false;
	readonly 'GPUShaderModule': false;
	readonly 'GPUShaderStage': false;
	readonly 'GPUSupportedFeatures': false;
	readonly 'GPUSupportedLimits': false;
	readonly 'GPUTexture': false;
	readonly 'GPUTextureUsage': false;
	readonly 'GPUTextureView': false;
	readonly 'GPUUncapturedErrorEvent': false;
	readonly 'GPUValidationError': false;
	readonly 'Headers': false;
	readonly 'ImageBitmap': false;
	readonly 'ImageBitmapRenderingContext': false;
	readonly 'ImageData': false;
	readonly 'localStorage': false;
	readonly 'location': false;
	readonly 'Location': false;
	readonly 'Lock': false;
	readonly 'LockManager': false;
	readonly 'MessageChannel': false;
	readonly 'MessageEvent': false;
	readonly 'MessagePort': false;
	readonly 'name': false;
	readonly 'navigator': false;
	readonly 'Navigator': false;
	readonly 'NavigatorUAData': false;
	readonly 'nodeBootstrap': false;
	readonly 'OffscreenCanvas': false;
	readonly 'onbeforeunload': true;
	readonly 'onerror': true;
	readonly 'onload': true;
	readonly 'onunhandledrejection': true;
	readonly 'onunload': true;
	readonly 'performance': false;
	readonly 'Performance': false;
	readonly 'PerformanceEntry': false;
	readonly 'PerformanceMark': false;
	readonly 'PerformanceMeasure': false;
	readonly 'PerformanceObserver': false;
	readonly 'PerformanceObserverEntryList': false;
	readonly 'process': false;
	readonly 'ProgressEvent': false;
	readonly 'PromiseRejectionEvent': false;
	readonly 'prompt': false;
	readonly 'queueMicrotask': false;
	readonly 'QuotaExceededError': false;
	readonly 'ReadableByteStreamController': false;
	readonly 'ReadableStream': false;
	readonly 'ReadableStreamBYOBReader': false;
	readonly 'ReadableStreamBYOBRequest': false;
	readonly 'ReadableStreamDefaultController': false;
	readonly 'ReadableStreamDefaultReader': false;
	readonly 'removeEventListener': false;
	readonly 'reportError': false;
	readonly 'Request': false;
	readonly 'Response': false;
	readonly 'self': false;
	readonly 'sessionStorage': false;
	readonly 'setImmediate': false;
	readonly 'setInterval': false;
	readonly 'setTimeout': false;
	readonly 'Storage': false;
	readonly 'structuredClone': false;
	readonly 'SubtleCrypto': false;
	readonly 'Temporal': false;
	readonly 'TextDecoder': false;
	readonly 'TextDecoderStream': false;
	readonly 'TextEncoder': false;
	readonly 'TextEncoderStream': false;
	readonly 'TransformStream': false;
	readonly 'TransformStreamDefaultController': false;
	readonly 'URL': false;
	readonly 'URLPattern': false;
	readonly 'URLSearchParams': false;
	readonly 'WebAssembly': false;
	readonly 'WebSocket': false;
	readonly 'Window': false;
	readonly 'Worker': false;
	readonly 'WritableStream': false;
	readonly 'WritableStreamDefaultController': false;
	readonly 'WritableStreamDefaultWriter': false;
}

type GlobalsDevtools = {
	readonly '$': false;
	readonly '$_': false;
	readonly '$$': false;
	readonly '$0': false;
	readonly '$1': false;
	readonly '$2': false;
	readonly '$3': false;
	readonly '$4': false;
	readonly '$x': false;
	readonly 'chrome': false;
	readonly 'clear': false;
	readonly 'copy': false;
	readonly 'debug': false;
	readonly 'dir': false;
	readonly 'dirxml': false;
	readonly 'getEventListeners': false;
	readonly 'inspect': false;
	readonly 'keys': false;
	readonly 'monitor': false;
	readonly 'monitorEvents': false;
	readonly 'profile': false;
	readonly 'profileEnd': false;
	readonly 'queryObjects': false;
	readonly 'table': false;
	readonly 'undebug': false;
	readonly 'unmonitor': false;
	readonly 'unmonitorEvents': false;
	readonly 'values': false;
}

type GlobalsEmbertest = {
	readonly 'andThen': false;
	readonly 'click': false;
	readonly 'currentPath': false;
	readonly 'currentRouteName': false;
	readonly 'currentURL': false;
	readonly 'fillIn': false;
	readonly 'find': false;
	readonly 'findAll': false;
	readonly 'findWithAssert': false;
	readonly 'keyEvent': false;
	readonly 'pauseTest': false;
	readonly 'resumeTest': false;
	readonly 'triggerEvent': false;
	readonly 'visit': false;
	readonly 'wait': false;
}

type GlobalsEs2015 = {
	readonly 'Array': false;
	readonly 'ArrayBuffer': false;
	readonly 'Boolean': false;
	readonly 'DataView': false;
	readonly 'Date': false;
	readonly 'decodeURI': false;
	readonly 'decodeURIComponent': false;
	readonly 'encodeURI': false;
	readonly 'encodeURIComponent': false;
	readonly 'Error': false;
	readonly 'escape': false;
	readonly 'eval': false;
	readonly 'EvalError': false;
	readonly 'Float32Array': false;
	readonly 'Float64Array': false;
	readonly 'Function': false;
	readonly 'Infinity': false;
	readonly 'Int16Array': false;
	readonly 'Int32Array': false;
	readonly 'Int8Array': false;
	readonly 'Intl': false;
	readonly 'isFinite': false;
	readonly 'isNaN': false;
	readonly 'JSON': false;
	readonly 'Map': false;
	readonly 'Math': false;
	readonly 'NaN': false;
	readonly 'Number': false;
	readonly 'Object': false;
	readonly 'parseFloat': false;
	readonly 'parseInt': false;
	readonly 'Promise': false;
	readonly 'Proxy': false;
	readonly 'RangeError': false;
	readonly 'ReferenceError': false;
	readonly 'Reflect': false;
	readonly 'RegExp': false;
	readonly 'Set': false;
	readonly 'String': false;
	readonly 'Symbol': false;
	readonly 'SyntaxError': false;
	readonly 'TypeError': false;
	readonly 'Uint16Array': false;
	readonly 'Uint32Array': false;
	readonly 'Uint8Array': false;
	readonly 'Uint8ClampedArray': false;
	readonly 'undefined': false;
	readonly 'unescape': false;
	readonly 'URIError': false;
	readonly 'WeakMap': false;
	readonly 'WeakSet': false;
}

type GlobalsEs2016 = {
	readonly 'Array': false;
	readonly 'ArrayBuffer': false;
	readonly 'Boolean': false;
	readonly 'DataView': false;
	readonly 'Date': false;
	readonly 'decodeURI': false;
	readonly 'decodeURIComponent': false;
	readonly 'encodeURI': false;
	readonly 'encodeURIComponent': false;
	readonly 'Error': false;
	readonly 'escape': false;
	readonly 'eval': false;
	readonly 'EvalError': false;
	readonly 'Float32Array': false;
	readonly 'Float64Array': false;
	readonly 'Function': false;
	readonly 'Infinity': false;
	readonly 'Int16Array': false;
	readonly 'Int32Array': false;
	readonly 'Int8Array': false;
	readonly 'Intl': false;
	readonly 'isFinite': false;
	readonly 'isNaN': false;
	readonly 'JSON': false;
	readonly 'Map': false;
	readonly 'Math': false;
	readonly 'NaN': false;
	readonly 'Number': false;
	readonly 'Object': false;
	readonly 'parseFloat': false;
	readonly 'parseInt': false;
	readonly 'Promise': false;
	readonly 'Proxy': false;
	readonly 'RangeError': false;
	readonly 'ReferenceError': false;
	readonly 'Reflect': false;
	readonly 'RegExp': false;
	readonly 'Set': false;
	readonly 'String': false;
	readonly 'Symbol': false;
	readonly 'SyntaxError': false;
	readonly 'TypeError': false;
	readonly 'Uint16Array': false;
	readonly 'Uint32Array': false;
	readonly 'Uint8Array': false;
	readonly 'Uint8ClampedArray': false;
	readonly 'undefined': false;
	readonly 'unescape': false;
	readonly 'URIError': false;
	readonly 'WeakMap': false;
	readonly 'WeakSet': false;
}

type GlobalsEs2017 = {
	readonly 'Array': false;
	readonly 'ArrayBuffer': false;
	readonly 'Atomics': false;
	readonly 'Boolean': false;
	readonly 'DataView': false;
	readonly 'Date': false;
	readonly 'decodeURI': false;
	readonly 'decodeURIComponent': false;
	readonly 'encodeURI': false;
	readonly 'encodeURIComponent': false;
	readonly 'Error': false;
	readonly 'escape': false;
	readonly 'eval': false;
	readonly 'EvalError': false;
	readonly 'Float32Array': false;
	readonly 'Float64Array': false;
	readonly 'Function': false;
	readonly 'Infinity': false;
	readonly 'Int16Array': false;
	readonly 'Int32Array': false;
	readonly 'Int8Array': false;
	readonly 'Intl': false;
	readonly 'isFinite': false;
	readonly 'isNaN': false;
	readonly 'JSON': false;
	readonly 'Map': false;
	readonly 'Math': false;
	readonly 'NaN': false;
	readonly 'Number': false;
	readonly 'Object': false;
	readonly 'parseFloat': false;
	readonly 'parseInt': false;
	readonly 'Promise': false;
	readonly 'Proxy': false;
	readonly 'RangeError': false;
	readonly 'ReferenceError': false;
	readonly 'Reflect': false;
	readonly 'RegExp': false;
	readonly 'Set': false;
	readonly 'SharedArrayBuffer': false;
	readonly 'String': false;
	readonly 'Symbol': false;
	readonly 'SyntaxError': false;
	readonly 'TypeError': false;
	readonly 'Uint16Array': false;
	readonly 'Uint32Array': false;
	readonly 'Uint8Array': false;
	readonly 'Uint8ClampedArray': false;
	readonly 'undefined': false;
	readonly 'unescape': false;
	readonly 'URIError': false;
	readonly 'WeakMap': false;
	readonly 'WeakSet': false;
}

type GlobalsEs2018 = {
	readonly 'Array': false;
	readonly 'ArrayBuffer': false;
	readonly 'Atomics': false;
	readonly 'Boolean': false;
	readonly 'DataView': false;
	readonly 'Date': false;
	readonly 'decodeURI': false;
	readonly 'decodeURIComponent': false;
	readonly 'encodeURI': false;
	readonly 'encodeURIComponent': false;
	readonly 'Error': false;
	readonly 'escape': false;
	readonly 'eval': false;
	readonly 'EvalError': false;
	readonly 'Float32Array': false;
	readonly 'Float64Array': false;
	readonly 'Function': false;
	readonly 'Infinity': false;
	readonly 'Int16Array': false;
	readonly 'Int32Array': false;
	readonly 'Int8Array': false;
	readonly 'Intl': false;
	readonly 'isFinite': false;
	readonly 'isNaN': false;
	readonly 'JSON': false;
	readonly 'Map': false;
	readonly 'Math': false;
	readonly 'NaN': false;
	readonly 'Number': false;
	readonly 'Object': false;
	readonly 'parseFloat': false;
	readonly 'parseInt': false;
	readonly 'Promise': false;
	readonly 'Proxy': false;
	readonly 'RangeError': false;
	readonly 'ReferenceError': false;
	readonly 'Reflect': false;
	readonly 'RegExp': false;
	readonly 'Set': false;
	readonly 'SharedArrayBuffer': false;
	readonly 'String': false;
	readonly 'Symbol': false;
	readonly 'SyntaxError': false;
	readonly 'TypeError': false;
	readonly 'Uint16Array': false;
	readonly 'Uint32Array': false;
	readonly 'Uint8Array': false;
	readonly 'Uint8ClampedArray': false;
	readonly 'undefined': false;
	readonly 'unescape': false;
	readonly 'URIError': false;
	readonly 'WeakMap': false;
	readonly 'WeakSet': false;
}

type GlobalsEs2019 = {
	readonly 'Array': false;
	readonly 'ArrayBuffer': false;
	readonly 'Atomics': false;
	readonly 'Boolean': false;
	readonly 'DataView': false;
	readonly 'Date': false;
	readonly 'decodeURI': false;
	readonly 'decodeURIComponent': false;
	readonly 'encodeURI': false;
	readonly 'encodeURIComponent': false;
	readonly 'Error': false;
	readonly 'escape': false;
	readonly 'eval': false;
	readonly 'EvalError': false;
	readonly 'Float32Array': false;
	readonly 'Float64Array': false;
	readonly 'Function': false;
	readonly 'Infinity': false;
	readonly 'Int16Array': false;
	readonly 'Int32Array': false;
	readonly 'Int8Array': false;
	readonly 'Intl': false;
	readonly 'isFinite': false;
	readonly 'isNaN': false;
	readonly 'JSON': false;
	readonly 'Map': false;
	readonly 'Math': false;
	readonly 'NaN': false;
	readonly 'Number': false;
	readonly 'Object': false;
	readonly 'parseFloat': false;
	readonly 'parseInt': false;
	readonly 'Promise': false;
	readonly 'Proxy': false;
	readonly 'RangeError': false;
	readonly 'ReferenceError': false;
	readonly 'Reflect': false;
	readonly 'RegExp': false;
	readonly 'Set': f   alse;
	readonly 'SharedArrayBuffer': false;
	readonly 'String': false;
	readonly 'Symbol': false;
	readonly 'SyntaxError': false;
	readonly 'TypeError': false;
	readonly 'Uint16Array': false;
	readonly 'Uint32Array': false;
	readonly 'Uint8Array': false;
	readonly 'Uint8ClampedArray': false;
	readonly 'undefined': false;
	readonly 'unescape': false;
	readonly 'URIError': false;
	readonly 'WeakMap': false;
	readonly 'WeakSet': false;
}

type GlobalsEs2020 = {
	readonly 'Array': false;
	readonly 'ArrayBuffer': false;
	readonly 'Atomics': false;
	readonly 'BigInt': false;
	readonly 'BigInt64Array': false;
	readonly 'BigUint64Array': false;
	readonly 'Boolean': false;
	readonly 'DataView': false;
	readonly 'Date': false;
	readonly 'decodeURI': false;
	readonly 'decodeURIComponent': false;
	readonly 'encodeURI': false;
	readonly 'encodeURIComponent': false;
	readonly 'Error': false;
	readonly 'escape': false;
	readonly 'eval': false;
	readonly 'EvalError': false;
	readonly 'Float32Array': false;
	readonly 'Float64Array': false;
	readonly 'Function': false;
	readonly 'globalThis': false;
	readonly 'Infinity': false;
	readonly 'Int16Array': false;
	readonly 'Int32Array': false;
	readonly 'Int8Array': false;
	readonly 'Intl': false;
	readonly 'isFinite': false;
	readonly 'isNaN': false;
	readonly 'JSON': false;
	readonly 'Map': false;
	readonly 'Math': false;
	readonly 'NaN': false;
	readonly 'Number': false;
	readonly 'Object': false;
	readonly 'parseFloat': false;
	readonly 'parseInt': false;
	readonly 'Promise': false;
	readonly 'Proxy': false;
	readonly 'RangeError': false;
	readonly 'ReferenceError': false;
	readonly 'Reflect': false;
	readonly 'RegExp': false;
	readonly 'Set': false;
	readonly 'SharedArrayBuffer': false;
	readonly 'String': false;
	readonly 'Symbol': false;
	readonly 'SyntaxError': false;
	readonly 'TypeError': false;
	readonly 'Uint16Array': false;
	readonly 'Uint32Array': false;
	readonly 'Uint8Array': false;
	readonly 'Uint8ClampedArray': false;
	readonly 'undefined': false;
	readonly 'unescape': false;
	readonly 'URIError': false;
	readonly 'WeakMap': false;
	readonly 'WeakSet': false;
}

type GlobalsEs2021 = {
	readonly 'AggregateError': false;
	readonly 'Array': false;
	readonly 'ArrayBuffer': false;
	readonly 'Atomics': false;
	readonly 'BigInt': false;
	readonly 'BigInt64Array': false;
	readonly 'BigUint64Array': false;
	readonly 'Boolean': false;
	readonly 'DataView': false;
	readonly 'Date': false;
	readonly 'decodeURI': false;
	readonly 'decodeURIComponent': false;
	readonly 'encodeURI': false;
	readonly 'encodeURIComponent': false;
	readonly 'Error': false;
	readonly 'escape': false;
	readonly 'eval': false;
	readonly 'EvalError': false;
	readonly 'FinalizationRegistry': false;
	readonly 'Float32Array': false;
	readonly 'Float64Array': false;
	readonly 'Function': false;
	readonly 'globalThis': false;
	readonly 'Infinity': false;
	readonly 'Int16Array': false;
	readonly 'Int32Array': false;
	readonly 'Int8Array': false;
	readonly 'Intl': false;
	readonly 'isFinite': false;
	readonly 'isNaN': false;
	readonly 'JSON': false;
	readonly 'Map': false;
	readonly 'Math': false;
	readonly 'NaN': false;
	readonly 'Number': false;
	readonly 'Object': false;
	readonly 'parseFloat': false;
	readonly 'parseInt': false;
	readonly 'Promise': false;
	readonly 'Proxy': false;
	readonly 'RangeError': false;
	readonly 'ReferenceError': false;
	readonly 'Reflect': false;
	readonly 'RegExp': false;
	readonly 'Set': false;
	readonly 'SharedArrayBuffer': false;
	readonly 'String': false;
	readonly 'Symbol': false;
	readonly 'SyntaxError': false;
	readonly 'TypeError': false;
	readonly 'Uint16Array': false;
	readonly 'Uint32Array': false;
	readonly 'Uint8Array': false;
	readonly 'Uint8ClampedArray': false;
	readonly 'undefined': false;
	readonly 'unescape': false;
	readonly 'URIError': false;
	readonly 'WeakMap': false;
	readonly 'WeakRef': false;
	readonly 'WeakSet': false;
}

type GlobalsEs2022 = {
	readonly 'AggregateError': false;
	readonly 'Array': false;
	readonly 'ArrayBuffer': false;
	readonly 'Atomics': false;
	readonly 'BigInt': false;
	readonly 'BigInt64Array': false;
	readonly 'BigUint64Array': false;
	readonly 'Boolean': false;
	readonly 'DataView': false;
	readonly 'Date': false;
	readonly 'decodeURI': false;
	readonly 'decodeURIComponent': false;
	readonly 'encodeURI': false;
	readonly 'encodeURIComponent': false;
	readonly 'Error': false;
	readonly 'escape': false;
	readonly 'eval': false;
	readonly 'EvalError': false;
	readonly 'FinalizationRegistry': false;
	readonly 'Float32Array': false;
	readonly 'Float64Array': false;
	readonly 'Function': false;
	readonly 'globalThis': false;
	readonly 'Infinity': false;
	readonly 'Int16Array': false;
	readonly 'Int32Array': false;
	readonly 'Int8Array': false;
	readonly 'Intl': false;
	readonly 'isFinite': false;
	readonly 'isNaN': false;
	readonly 'JSON': false;
	readonly 'Map': false;
	readonly 'Math': false;
	readonly 'NaN': false;
	readonly 'Number': false;
	readonly 'Object': false;
	readonly 'parseFloat': false;
	readonly 'parseInt': false;
	readonly 'Promise': false;
	readonly 'Proxy': false;
	readonly 'RangeError': false;
	readonly 'ReferenceError': false;
	readonly 'Reflect': false;
	readonly 'RegExp': false;
	readonly 'Set': false;
	readonly 'SharedArrayBuffer': false;
	readonly 'String': false;
	readonly 'Symbol': false;
	readonly 'SyntaxError': false;
	readonly 'TypeError': false;
	readonly 'Uint16Array': false;
	readonly 'Uint32Array': false;
	readonly 'Uint8Array': false;
	readonly 'Uint8ClampedArray': false;
	readonly 'undefined': false;
	readonly 'unescape': false;
	readonly 'URIError': false;
	readonly 'WeakMap': false;
	readonly 'WeakRef': false;
	readonly 'WeakSet': false;
}

type GlobalsEs2023 = {
	readonly 'AggregateError': false;
	readonly 'Array': false;
	readonly 'ArrayBuffer': false;
	readonly 'Atomics': false;
	readonly 'BigInt': false;
	readonly 'BigInt64Array': false;
	readonly 'BigUint64Array': false;
	readonly 'Boolean': false;
	readonly 'DataView': false;
	readonly 'Date': false;
	readonly 'decodeURI': false;
	readonly 'decodeURIComponent': false;
	readonly 'encodeURI': false;
	readonly 'encodeURIComponent': false;
	readonly 'Error': false;
	readonly 'escape': false;
	readonly 'eval': false;
	readonly 'EvalError': false;
	readonly 'FinalizationRegistry': false;
	readonly 'Float32Array': false;
	readonly 'Float64Array': false;
	readonly 'Function': false;
	readonly 'globalThis': false;
	readonly 'Infinity': false;
	readonly 'Int16Array': false;
	readonly 'Int32Array': false;
	readonly 'Int8Array': false;
	readonly 'Intl': false;
	readonly 'isFinite': false;
	readonly 'isNaN': false;
	readonly 'JSON': false;
	readonly 'Map': false;
	readonly 'Math': false;
	readonly 'NaN': false;
	readonly 'Number': false;
	readonly 'Object': false;
	readonly 'parseFloat': false;
	readonly 'parseInt': false;
	readonly 'Promise': false;
	readonly 'Proxy': false;
	readonly 'RangeError': false;
	readonly 'ReferenceError': false;
	readonly 'Reflect': false;
	readonly 'RegExp': false;
	readonly 'Set': false;
	readonly 'SharedArrayBuffer': false;
	readonly 'String': false;
	readonly 'Symbol': false;
	readonly 'SyntaxError': false;
	readonly 'TypeError': false;
	readonly 'Uint16Array': false;
	readonly 'Uint32Array': false;
	readonly 'Uint8Array': false;
	readonly 'Uint8ClampedArray': false;
	readonly 'undefined': false;
	readonly 'unescape': false;
	readonly 'URIError': false;
	readonly 'WeakMap': false;
	readonly 'WeakRef': false;
	readonly 'WeakSet': false;
}

type GlobalsEs2024 = {
	readonly 'AggregateError': false;
	readonly 'Array': false;
	readonly 'ArrayBuffer': false;
	readonly 'Atomics': false;
	readonly 'BigInt': false;
	readonly 'BigInt64Array': false;
	readonly 'BigUint64Array': false;
	readonly 'Boolean': false;
	readonly 'DataView': false;
	readonly 'Date': false;
	readonly 'decodeURI': false;
	readonly 'decodeURIComponent': false;
	readonly 'encodeURI': false;
	readonly 'encodeURIComponent': false;
	readonly 'Error': false;
	readonly 'escape': false;
	readonly 'eval': false;
	readonly 'EvalError': false;
	readonly 'FinalizationRegistry': false;
	readonly 'Float32Array': false;
	readonly 'Float64Array': false;
	readonly 'Function': false;
	readonly 'globalThis': false;
	readonly 'Infinity': false;
	readonly 'Int16Array': false;
	readonly 'Int32Array': false;
	readonly 'Int8Array': false;
	readonly 'Intl': false;
	readonly 'isFinite': false;
	readonly 'isNaN': false;
	readonly 'JSON': false;
	readonly 'Map': false;
	readonly 'Math': false;
	readonly 'NaN': false;
	readonly 'Number': false;
	readonly 'Object': false;
	readonly 'parseFloat': false;
	readonly 'parseInt': false;
	readonly 'Promise': false;
	readonly 'Proxy': false;
	readonly 'RangeError': false;
	readonly 'ReferenceError': false;
	readonly 'Reflect': false;
	readonly 'RegExp': false;
	readonly 'Set': false;
	readonly 'SharedArrayBuffer': false;
	readonly 'String': false;
	readonly 'Symbol': false;
	readonly 'SyntaxError': false;
	readonly 'TypeError': false;
	readonly 'Uint16Array': false;
	readonly 'Uint32Array': false;
	readonly 'Uint8Array': false;
	readonly 'Uint8ClampedArray': false;
	readonly 'undefined': false;
	readonly 'unescape': false;
	readonly 'URIError': false;
	readonly 'WeakMap': false;
	readonly 'WeakRef': false;
	readonly 'WeakSet': false;
}

type GlobalsEs2025 = {
	readonly 'AggregateError': false;
	readonly 'Array': false;
	readonly 'ArrayBuffer': false;
	readonly 'Atomics': false;
	readonly 'BigInt': false;
	readonly 'BigInt64Array': false;
	readonly 'BigUint64Array': false;
	readonly 'Boolean': false;
	readonly 'DataView': false;
	readonly 'Date': false;
	readonly 'decodeURI': false;
	readonly 'decodeURIComponent': false;
	readonly 'encodeURI': false;
	readonly 'encodeURIComponent': false;
	readonly 'Error': false;
	readonly 'escape': false;
	readonly 'eval': false;
	readonly 'EvalError': false;
	readonly 'FinalizationRegistry': false;
	readonly 'Float16Array': false;
	readonly 'Float32Array': false;
	readonly 'Float64Array': false;
	readonly 'Function': false;
	readonly 'globalThis': false;
	readonly 'Infinity': false;
	readonly 'Int16Array': false;
	readonly 'Int32Array': false;
	readonly 'Int8Array': false;
	readonly 'Intl': false;
	readonly 'isFinite': false;
	readonly 'isNaN': false;
	readonly 'Iterator': false;
	readonly 'JSON': false;
	readonly 'Map': false;
	readonly 'Math': false;
	readonly 'NaN': false;
	readonly 'Number': false;
	readonly 'Object': false;
	readonly 'parseFloat': false;
	readonly 'parseInt': false;
	readonly 'Promise': false;
	readonly 'Proxy': false;
	readonly 'RangeError': false;
	readonly 'ReferenceError': false;
	readonly 'Reflect': false;
	readonly 'RegExp': false;
	readonly 'Set': false;
	readonly 'SharedArrayBuffer': false;
	readonly 'String': false;
	readonly 'Symbol': false;
	readonly 'SyntaxError': false;
	readonly 'TypeError': false;
	readonly 'Uint16Array': false;
	readonly 'Uint32Array': false;
	readonly 'Uint8Array': false;
	readonly 'Uint8ClampedArray': false;
	readonly 'undefined': false;
	readonly 'unescape': false;
	readonly 'URIError': false;
	readonly 'WeakMap': false;
	readonly 'WeakRef': false;
	readonly 'WeakSet': false;
}

type GlobalsEs2026 = {
	readonly 'AggregateError': false;
	readonly 'Array': false;
	readonly 'ArrayBuffer': false;
	readonly 'Atomics': false;
	readonly 'BigInt': false;
	readonly 'BigInt64Array': false;
	readonly 'BigUint64Array': false;
	readonly 'Boolean': false;
	readonly 'DataView': false;
	readonly 'Date': false;
	readonly 'decodeURI': false;
	readonly 'decodeURIComponent': false;
	readonly 'encodeURI': false;
	readonly 'encodeURIComponent': false;
	readonly 'Error': false;
	readonly 'escape': false;
	readonly 'eval': false;
	readonly 'EvalError': false;
	readonly 'FinalizationRegistry': false;
	readonly 'Float16Array': false;
	readonly 'Float32Array': false;
	readonly 'Float64Array': false;
	readonly 'Function': false;
	readonly 'globalThis': false;
	readonly 'Infinity': false;
	readonly 'Int16Array': false;
	readonly 'Int32Array': false;
	readonly 'Int8Array': false;
	readonly 'Intl': false;
	readonly 'isFinite': false;
	readonly 'isNaN': false;
	readonly 'Iterator': false;
	readonly 'JSON': false;
	readonly 'Map': false;
	readonly 'Math': false;
	readonly 'NaN': false;
	readonly 'Number': false;
	readonly 'Object': false;
	readonly 'parseFloat': false;
	readonly 'parseInt': false;
	readonly 'Promise': false;
	readonly 'Proxy': false;
	readonly 'RangeError': false;
	readonly 'ReferenceError': false;
	readonly 'Reflect': false;
	readonly 'RegExp': false;
	readonly 'Set': false;
	readonly 'SharedArrayBuffer': false;
	readonly 'String': false;
	readonly 'Symbol': false;
	readonly 'SyntaxError': false;
	readonly 'TypeError': false;
	readonly 'Uint16Array': false;
	readonly 'Uint32Array': false;
	readonly 'Uint8Array': false;
	readonly 'Uint8ClampedArray': false;
	readonly 'undefined': false;
	readonly 'unescape': false;
	readonly 'URIError': false;
	readonly 'WeakMap': false;
	readonly 'WeakRef': false;
	readonly 'WeakSet': false;
}

type GlobalsEs2027 = {
	readonly 'AggregateError': false;
	readonly 'Array': false;
	readonly 'ArrayBuffer': false;
	readonly 'AsyncDisposableStack': false;
	readonly 'Atomics': false;
	readonly 'BigInt': false;
	readonly 'BigInt64Array': false;
	readonly 'BigUint64Array': false;
	readonly 'Boolean': false;
	readonly 'DataView': false;
	readonly 'Date': false;
	readonly 'decodeURI': false;
	readonly 'decodeURIComponent': false;
	readonly 'DisposableStack': false;
	readonly 'encodeURI': false;
	readonly 'encodeURIComponent': false;
	readonly 'Error': false;
	readonly 'escape': false;
	readonly 'eval': false;
	readonly 'EvalError': false;
	readonly 'FinalizationRegistry': false;
	readonly 'Float16Array': false;
	readonly 'Float32Array': false;
	readonly 'Float64Array': false;
	readonly 'Function': false;
	readonly 'globalThis': false;
	readonly 'Infinity': false;
	readonly 'Int16Array': false;
	readonly 'Int32Array': false;
	readonly 'Int8Array': false;
	readonly 'Intl': false;
	readonly 'isFinite': false;
	readonly 'isNaN': false;
	readonly 'Iterator': false;
	readonly 'JSON': false;
	readonly 'Map': false;
	readonly 'Math': false;
	readonly 'NaN': false;
	readonly 'Number': false;
	readonly 'Object': false;
	readonly 'parseFloat': false;
	readonly 'parseInt': false;
	readonly 'Promise': false;
	readonly 'Proxy': false;
	readonly 'RangeError': false;
	readonly 'ReferenceError': false;
	readonly 'Reflect': false;
	readonly 'RegExp': false;
	readonly 'Set': false;
	readonly 'SharedArrayBuffer': false;
	readonly 'String': false;
	readonly 'SuppressedError': false;
	readonly 'Symbol': false;
	readonly 'SyntaxError': false;
	readonly 'TypeError': false;
	readonly 'Uint16Array': false;
	readonly 'Uint32Array': false;
	readonly 'Uint8Array': false;
	readonly 'Uint8ClampedArray': false;
	readonly 'undefined': false;
	readonly 'unescape': false;
	readonly 'URIError': false;
	readonly 'WeakMap': false;
	readonly 'WeakRef': false;
	readonly 'WeakSet': false;
}

type GlobalsEs3 = {
	readonly 'Array': false;
	readonly 'Boolean': false;
	readonly 'Date': false;
	readonly 'decodeURI': false;
	readonly 'decodeURIComponent': false;
	readonly 'encodeURI': false;
	readonly 'encodeURIComponent': false;
	readonly 'Error': false;
	readonly 'escape': false;
	readonly 'eval': false;
	readonly 'EvalError': false;
	readonly 'Function': false;
	readonly 'Infinity': false;
	readonly 'isFinite': false;
	readonly 'isNaN': false;
	readonly 'Math': false;
	readonly 'NaN': false;
	readonly 'Number': false;
	readonly 'Object': false;
	readonly 'parseFloat': false;
	readonly 'parseInt': false;
	readonly 'RangeError': false;
	readonly 'ReferenceError': false;
	readonly 'RegExp': false;
	readonly 'String': false;
	readonly 'SyntaxError': false;
	readonly 'TypeError': false;
	readonly 'undefined': false;
	readonly 'unescape': false;
	readonly 'URIError': false;
}

type GlobalsEs5 = {
	readonly 'Array': false;
	readonly 'Boolean': false;
	readonly 'Date': false;
	readonly 'decodeURI': false;
	readonly 'decodeURIComponent': false;
	readonly 'encodeURI': false;
	readonly 'encodeURIComponent': false;
	readonly 'Error': false;
	readonly 'escape': false;
	readonly 'eval': false;
	readonly 'EvalError': false;
	readonly 'Function': false;
	readonly 'Infinity': false;
	readonly 'isFinite': false;
	readonly 'isNaN': false;
	readonly 'JSON': false;
	readonly 'Math': false;
	readonly 'NaN': false;
	readonly 'Number': false;
	readonly 'Object': false;
	readonly 'parseFloat': false;
	readonly 'parseInt': false;
	readonly 'RangeError': false;
	readonly 'ReferenceError': false;
	readonly 'RegExp': false;
	readonly 'String': false;
	readonly 'SyntaxError': false;
	readonly 'TypeError': false;
	readonly 'undefined': false;
	readonly 'unescape': false;
	readonly 'URIError': false;
}

type GlobalsGreasemonkey = {
	readonly 'cloneInto': false;
	readonly 'createObjectIn': false;
	readonly 'exportFunction': false;
	readonly 'GM': false;
	readonly 'GM_addElement': false;
	readonly 'GM_addStyle': false;
	readonly 'GM_addValueChangeListener': false;
	readonly 'GM_deleteValue': false;
	readonly 'GM_deleteValues': false;
	readonly 'GM_download': false;
	readonly 'GM_getResourceText': false;
	readonly 'GM_getResourceURL': false;
	readonly 'GM_getTab': false;
	readonly 'GM_getTabs': false;
	readonly 'GM_getValue': false;
	readonly 'GM_getValues': false;
	readonly 'GM_info': false;
	readonly 'GM_listValues': false;
	readonly 'GM_log': false;
	readonly 'GM_notification': false;
	readonly 'GM_openInTab': false;
	readonly 'GM_registerMenuCommand': false;
	readonly 'GM_removeValueChangeListener': false;
	readonly 'GM_saveTab': false;
	readonly 'GM_setClipboard': false;
	readonly 'GM_setValue': false;
	readonly 'GM_setValues': false;
	readonly 'GM_unregisterMenuCommand': false;
	readonly 'GM_xmlhttpRequest': false;
	readonly 'unsafeWindow': false;
}

type GlobalsJasmine = {
	readonly 'afterAll': false;
	readonly 'afterEach': false;
	readonly 'beforeAll': false;
	readonly 'beforeEach': false;
	readonly 'describe': false;
	readonly 'expect': false;
	readonly 'expectAsync': false;
	readonly 'fail': false;
	readonly 'fdescribe': false;
	readonly 'fit': false;
	readonly 'it': false;
	readonly 'jasmine': false;
	readonly 'pending': false;
	readonly 'runs': false;
	readonly 'spyOn': false;
	readonly 'spyOnAllFunctions': false;
	readonly 'spyOnProperty': false;
	readonly 'throwUnless': false;
	readonly 'throwUnlessAsync': false;
	readonly 'waits': false;
	readonly 'waitsFor': false;
	readonly 'xdescribe': false;
	readonly 'xit': false;
}

type GlobalsJest = {
	readonly 'afterAll': false;
	readonly 'afterEach': false;
	readonly 'beforeAll': false;
	readonly 'beforeEach': false;
	readonly 'describe': false;
	readonly 'expect': false;
	readonly 'fit': false;
	readonly 'it': false;
	readonly 'jest': false;
	readonly 'test': false;
	readonly 'xdescribe': false;
	readonly 'xit': false;
	readonly 'xtest': false;
}

type GlobalsJquery = {
	readonly '$': false;
	readonly 'jQuery': false;
}

type GlobalsMeteor = {
	readonly '$': false;
	readonly 'Accounts': false;
	readonly 'AccountsClient': false;
	readonly 'AccountsCommon': false;
	readonly 'AccountsServer': false;
	readonly 'App': false;
	readonly 'Assets': false;
	readonly 'Blaze': false;
	readonly 'check': false;
	readonly 'Cordova': false;
	readonly 'DDP': false;
	readonly 'DDPRateLimiter': false;
	readonly 'DDPServer': false;
	readonly 'Deps': false;
	readonly 'EJSON': false;
	readonly 'Email': false;
	readonly 'HTTP': false;
	readonly 'Log': false;
	readonly 'Match': false;
	readonly 'Meteor': false;
	readonly 'Mongo': false;
	readonly 'MongoInternals': false;
	readonly 'Npm': false;
	readonly 'Package': false;
	readonly 'Plugin': false;
	readonly 'process': false;
	readonly 'Random': false;
	readonly 'ReactiveDict': false;
	readonly 'ReactiveVar': false;
	readonly 'Router': false;
	readonly 'ServiceConfiguration': false;
	readonly 'Session': false;
	readonly 'share': false;
	readonly 'Spacebars': false;
	readonly 'Template': false;
	readonly 'Tinytest': false;
	readonly 'Tracker': false;
	readonly 'UI': false;
	readonly 'Utils': false;
	readonly 'WebApp': false;
	readonly 'WebAppInternals': false;
}

type GlobalsMocha = {
	readonly 'after': false;
	readonly 'afterEach': false;
	readonly 'before': false;
	readonly 'beforeEach': false;
	readonly 'context': false;
	readonly 'describe': false;
	readonly 'it': false;
	readonly 'mocha': false;
	readonly 'run': false;
	readonly 'setup': false;
	readonly 'specify': false;
	readonly 'suite': false;
	readonly 'suiteSetup': false;
	readonly 'suiteTeardown': false;
	readonly 'teardown': false;
	readonly 'test': false;
	readonly 'xcontext': false;
	readonly 'xdescribe': false;
	readonly 'xit': false;
	readonly 'xspecify': false;
}

type GlobalsMongo = {
	readonly '_isWindows': false;
	readonly '_rand': false;
	readonly 'BulkWriteResult': false;
	readonly 'cat': false;
	readonly 'cd': false;
	readonly 'connect': false;
	readonly 'db': false;
	readonly 'getHostName': false;
	readonly 'getMemInfo': false;
	readonly 'hostname': false;
	readonly 'ISODate': false;
	readonly 'listFiles': false;
	readonly 'load': false;
	readonly 'ls': false;
	readonly 'md5sumFile': false;
	readonly 'mkdir': false;
	readonly 'Mongo': false;
	readonly 'NumberInt': false;
	readonly 'NumberLong': false;
	readonly 'ObjectId': false;
	readonly 'PlanCache': false;
	readonly 'print': false;
	readonly 'printjson': false;
	readonly 'pwd': false;
	readonly 'quit': false;
	readonly 'removeFile': false;
	readonly 'rs': false;
	readonly 'sh': false;
	readonly 'UUID': false;
	readonly 'version': false;
	readonly 'WriteResult': false;
}

type GlobalsNashorn = {
	readonly '__DIR__': false;
	readonly '__FILE__': false;
	readonly '__LINE__': false;
	readonly 'com': false;
	readonly 'edu': false;
	readonly 'exit': false;
	readonly 'java': false;
	readonly 'Java': false;
	readonly 'javafx': false;
	readonly 'JavaImporter': false;
	readonly 'javax': false;
	readonly 'JSAdapter': false;
	readonly 'load': false;
	readonly 'loadWithNewGlobal': false;
	readonly 'org': false;
	readonly 'Packages': false;
	readonly 'print': false;
	readonly 'quit': false;
}

type GlobalsNode = {
	readonly '__dirname': false;
	readonly '__filename': false;
	readonly 'AbortController': false;
	readonly 'AbortSignal': false;
	readonly 'atob': false;
	readonly 'Blob': false;
	readonly 'BroadcastChannel': false;
	readonly 'btoa': false;
	readonly 'Buffer': false;
	readonly 'ByteLengthQueuingStrategy': false;
	readonly 'clearImmediate': false;
	readonly 'clearInterval': false;
	readonly 'clearTimeout': false;
	readonly 'CloseEvent': false;
	readonly 'CompressionStream': false;
	readonly 'console': false;
	readonly 'CountQueuingStrategy': false;
	readonly 'crypto': false;
	readonly 'Crypto': false;
	readonly 'CryptoKey': false;
	readonly 'CustomEvent': false;
	readonly 'DecompressionStream': false;
	readonly 'DOMException': false;
	readonly 'ErrorEvent': false;
	readonly 'Event': false;
	readonly 'EventTarget': false;
	readonly 'exports': true;
	readonly 'fetch': false;
	readonly 'File': false;
	readonly 'FormData': false;
	readonly 'global': false;
	readonly 'Headers': false;
	readonly 'localStorage': false;
	readonly 'MessageChannel': false;
	readonly 'MessageEvent': false;
	readonly 'MessagePort': false;
	readonly 'module': false;
	readonly 'navigator': false;
	readonly 'Navigator': false;
	readonly 'performance': false;
	readonly 'Performance': false;
	readonly 'PerformanceEntry': false;
	readonly 'PerformanceMark': false;
	readonly 'PerformanceMeasure': false;
	readonly 'PerformanceObserver': false;
	readonly 'PerformanceObserverEntryList': false;
	readonly 'PerformanceResourceTiming': false;
	readonly 'process': false;
	readonly 'queueMicrotask': false;
	readonly 'QuotaExceededError': false;
	readonly 'ReadableByteStreamController': false;
	readonly 'ReadableStream': false;
	readonly 'ReadableStreamBYOBReader': false;
	readonly 'ReadableStreamBYOBRequest': false;
	readonly 'ReadableStreamDefaultController': false;
	readonly 'ReadableStreamDefaultReader': false;
	readonly 'Request': false;
	readonly 'require': false;
	readonly 'Response': false;
	readonly 'sessionStorage': false;
	readonly 'setImmediate': false;
	readonly 'setInterval': false;
	readonly 'setTimeout': false;
	readonly 'Storage': false;
	readonly 'structuredClone': false;
	readonly 'SubtleCrypto': false;
	readonly 'Temporal': false;
	readonly 'TextDecoder': false;
	readonly 'TextDecoderStream': false;
	readonly 'TextEncoder': false;
	readonly 'TextEncoderStream': false;
	readonly 'TransformStream': false;
	readonly 'TransformStreamDefaultController': false;
	readonly 'URL': false;
	readonly 'URLPattern': false;
	readonly 'URLSearchParams': false;
	readonly 'WebAssembly': false;
	readonly 'WebSocket': false;
	readonly 'WritableStream': false;
	readonly 'WritableStreamDefaultController': false;
	readonly 'WritableStreamDefaultWriter': false;
}

type GlobalsNodeBuiltin = {
	readonly 'AbortController': false;
	readonly 'AbortSignal': false;
	readonly 'atob': false;
	readonly 'Blob': false;
	readonly 'BroadcastChannel': false;
	readonly 'btoa': false;
	readonly 'Buffer': false;
	readonly 'ByteLengthQueuingStrategy': false;
	readonly 'clearImmediate': false;
	readonly 'clearInterval': false;
	readonly 'clearTimeout': false;
	readonly 'CloseEvent': false;
	readonly 'CompressionStream': false;
	readonly 'console': false;
	readonly 'CountQueuingStrategy': false;
	readonly 'crypto': false;
	readonly 'Crypto': false;
	readonly 'CryptoKey': false;
	readonly 'CustomEvent': false;
	readonly 'DecompressionStream': false;
	readonly 'DOMException': false;
	readonly 'ErrorEvent': false;
	readonly 'Event': false;
	readonly 'EventTarget': false;
	readonly 'fetch': false;
	readonly 'File': false;
	readonly 'FormData': false;
	readonly 'global': false;
	readonly 'Headers': false;
	readonly 'localStorage': false;
	readonly 'MessageChannel': false;
	readonly 'MessageEvent': false;
	readonly 'MessagePort': false;
	readonly 'navigator': false;
	readonly 'Navigator': false;
	readonly 'performance': false;
	readonly 'Performance': false;
	readonly 'PerformanceEntry': false;
	readonly 'PerformanceMark': false;
	readonly 'PerformanceMeasure': false;
	readonly 'PerformanceObserver': false;
	readonly 'PerformanceObserverEntryList': false;
	readonly 'PerformanceResourceTiming': false;
	readonly 'process': false;
	readonly 'queueMicrotask': false;
	readonly 'QuotaExceededError': false;
	readonly 'ReadableByteStreamController': false;
	readonly 'ReadableStream': false;
	readonly 'ReadableStreamBYOBReader': false;
	readonly 'ReadableStreamBYOBRequest': false;
	readonly 'ReadableStreamDefaultController': false;
	readonly 'ReadableStreamDefaultReader': false;
	readonly 'Request': false;
	readonly 'Response': false;
	readonly 'sessionStorage': false;
	readonly 'setImmediate': false;
	readonly 'setInterval': false;
	readonly 'setTimeout': false;
	readonly 'Storage': false;
	readonly 'structuredClone': false;
	readonly 'SubtleCrypto': false;
	readonly 'Temporal': false;
	readonly 'TextDecoder': false;
	readonly 'TextDecoderStream': false;
	readonly 'TextEncoder': false;
	readonly 'TextEncoderStream': false;
	readonly 'TransformStream': false;
	readonly 'TransformStreamDefaultController': false;
	readonly 'URL': false;
	readonly 'URLPattern': false;
	readonly 'URLSearchParams': false;
	readonly 'WebAssembly': false;
	readonly 'WebSocket': false;
	readonly 'WritableStream': false;
	readonly 'WritableStreamDefaultController': false;
	readonly 'WritableStreamDefaultWriter': false;
}

type GlobalsPaintWorklet = {
	readonly 'ByteLengthQueuingStrategy': false;
	readonly 'console': false;
	readonly 'CountQueuingStrategy': false;
	readonly 'CSSImageValue': false;
	readonly 'CSSKeywordValue': false;
	readonly 'CSSMathClamp': false;
	readonly 'CSSMathInvert': false;
	readonly 'CSSMathMax': false;
	readonly 'CSSMathMin': false;
	readonly 'CSSMathNegate': false;
	readonly 'CSSMathProduct': false;
	readonly 'CSSMathSum': false;
	readonly 'CSSMathValue': false;
	readonly 'CSSMatrixComponent': false;
	readonly 'CSSNumericArray': false;
	readonly 'CSSNumericValue': false;
	readonly 'CSSPerspective': false;
	readonly 'CSSPositionValue': false;
	readonly 'CSSRotate': false;
	readonly 'CSSScale': false;
	readonly 'CSSSkew': false;
	readonly 'CSSSkewX': false;
	readonly 'CSSSkewY': false;
	readonly 'CSSStyleValue': false;
	readonly 'CSSTransformComponent': false;
	readonly 'CSSTransformValue': false;
	readonly 'CSSTranslate': false;
	readonly 'CSSUnitValue': false;
	readonly 'CSSUnparsedValue': false;
	readonly 'CSSVariableReferenceValue': false;
	readonly 'devicePixelRatio': false;
	readonly 'PaintRenderingContext2D': false;
	readonly 'PaintSize': false;
	readonly 'PaintWorkletGlobalScope': false;
	readonly 'Path2D': false;
	readonly 'QuotaExceededError': false;
	readonly 'ReadableByteStreamController': false;
	readonly 'ReadableStream': false;
	readonly 'ReadableStreamBYOBReader': false;
	readonly 'ReadableStreamBYOBRequest': false;
	readonly 'ReadableStreamDefaultController': false;
	readonly 'ReadableStreamDefaultReader': false;
	readonly 'registerPaint': false;
	readonly 'StylePropertyMapReadOnly': false;
	readonly 'Temporal': false;
	readonly 'TransformStream': false;
	readonly 'TransformStreamDefaultController': false;
	readonly 'WebAssembly': false;
	readonly 'WorkletGlobalScope': false;
	readonly 'WritableStream': false;
	readonly 'WritableStreamDefaultController': false;
	readonly 'WritableStreamDefaultWriter': false;
}

type GlobalsPhantomjs = {
	readonly 'console': true;
	readonly 'exports': true;
	readonly 'phantom': true;
	readonly 'require': true;
	readonly 'WebPage': true;
}

type GlobalsPrototypejs = {
	readonly '$': false;
	readonly '$$': false;
	readonly '$A': false;
	readonly '$break': false;
	readonly '$continue': false;
	readonly '$F': false;
	readonly '$H': false;
	readonly '$R': false;
	readonly '$w': false;
	readonly 'Abstract': false;
	readonly 'Ajax': false;
	readonly 'Autocompleter': false;
	readonly 'Builder': false;
	readonly 'Class': false;
	readonly 'Control': false;
	readonly 'Draggable': false;
	readonly 'Draggables': false;
	readonly 'Droppables': false;
	readonly 'Effect': false;
	readonly 'Element': false;
	readonly 'Enumerable': false;
	readonly 'Event': false;
	readonly 'Field': false;
	readonly 'Form': false;
	readonly 'Hash': false;
	readonly 'Insertion': false;
	readonly 'ObjectRange': false;
	readonly 'PeriodicalExecuter': false;
	readonly 'Position': false;
	readonly 'Prototype': false;
	readonly 'Scriptaculous': false;
	readonly 'Selector': false;
	readonly 'Sortable': false;
	readonly 'SortableObserver': false;
	readonly 'Sound': false;
	readonly 'Template': false;
	readonly 'Toggle': false;
	readonly 'Try': false;
}

type GlobalsProtractor = {
	readonly '$': false;
	readonly '$$': false;
	readonly 'browser': false;
	readonly 'by': false;
	readonly 'By': false;
	readonly 'DartObject': false;
	readonly 'element': false;
	readonly 'protractor': false;
}

type GlobalsQunit = {
	readonly 'asyncTest': false;
	readonly 'deepEqual': false;
	readonly 'equal': false;
	readonly 'expect': false;
	readonly 'module': false;
	readonly 'notDeepEqual': false;
	readonly 'notEqual': false;
	readonly 'notOk': false;
	readonly 'notPropEqual': false;
	readonly 'notStrictEqual': false;
	readonly 'ok': false;
	readonly 'propEqual': false;
	readonly 'QUnit': false;
	readonly 'raises': false;
	readonly 'start': false;
	readonly 'stop': false;
	readonly 'strictEqual': false;
	readonly 'test': false;
	readonly 'throws': false;
}

type GlobalsRhino = {
	readonly 'defineClass': false;
	readonly 'deserialize': false;
	readonly 'gc': false;
	readonly 'help': false;
	readonly 'importClass': false;
	readonly 'importPackage': false;
	readonly 'java': false;
	readonly 'load': false;
	readonly 'loadClass': false;
	readonly 'Packages': false;
	readonly 'print': false;
	readonly 'quit': false;
	readonly 'readFile': false;
	readonly 'readUrl': false;
	readonly 'runCommand': false;
	readonly 'seal': false;
	readonly 'serialize': false;
	readonly 'spawn': false;
	readonly 'sync': false;
	readonly 'toint32': false;
	readonly 'version': false;
}

type GlobalsRspack = {
	readonly '__non_webpack_require__': false;
	readonly '__resourceQuery': false;
	readonly '__rspack_unique_id__': false;
	readonly '__rspack_version__': false;
	readonly '__system_context__': false;
	readonly '__webpack_base_uri__': true;
	readonly '__webpack_chunk_load__': true;
	readonly '__webpack_chunkname__': false;
	readonly '__webpack_exports_info__': false;
	readonly '__webpack_get_script_filename__': true;
	readonly '__webpack_hash__': false;
	readonly '__webpack_init_sharing__': false;
	readonly '__webpack_is_included__': false;
	readonly '__webpack_module__': false;
	readonly '__webpack_modules__': false;
	readonly '__webpack_nonce__': true;
	readonly '__webpack_public_path__': true;
	readonly '__webpack_require__': false;
	readonly '__webpack_runtime_id__': false;
	readonly '__webpack_share_scopes__': false;
}

type GlobalsServiceworker = {
	readonly 'AbortController': false;
	readonly 'AbortPaymentEvent': false;
	readonly 'AbortSignal': false;
	readonly 'addEventListener': false;
	readonly 'ai': false;
	readonly 'AI': false;
	readonly 'AICreateMonitor': false;
	readonly 'atob': false;
	readonly 'BackgroundFetchEvent': false;
	readonly 'BackgroundFetchManager': false;
	readonly 'BackgroundFetchRecord': false;
	readonly 'BackgroundFetchRegistration': false;
	readonly 'BackgroundFetchUpdateUIEvent': false;
	readonly 'BarcodeDetector': false;
	readonly 'Blob': false;
	readonly 'BroadcastChannel': false;
	readonly 'btoa': false;
	readonly 'ByteLengthQueuingStrategy': false;
	readonly 'Cache': false;
	readonly 'caches': false;
	readonly 'CacheStorage': false;
	readonly 'CanMakePaymentEvent': false;
	readonly 'CanvasGradient': false;
	readonly 'CanvasPattern': false;
	readonly 'clearInterval': false;
	readonly 'clearTimeout': false;
	readonly 'Client': false;
	readonly 'clients': false;
	readonly 'Clients': false;
	readonly 'CloseEvent': false;
	readonly 'CompressionStream': false;
	readonly 'console': false;
	readonly 'cookieStore': false;
	readonly 'CookieStore': false;
	readonly 'CookieStoreManager': false;
	readonly 'CountQueuingStrategy': false;
	readonly 'createImageBitmap': false;
	readonly 'CreateMonitor': false;
	readonly 'CropTarget': false;
	readonly 'crossOriginIsolated': false;
	readonly 'crypto': false;
	readonly 'Crypto': false;
	readonly 'CryptoKey': false;
	readonly 'CSSImageValue': false;
	readonly 'CSSKeywordValue': false;
	readonly 'CSSMathClamp': false;
	readonly 'CSSMathInvert': false;
	readonly 'CSSMathMax': false;
	readonly 'CSSMathMin': false;
	readonly 'CSSMathNegate': false;
	readonly 'CSSMathProduct': false;
	readonly 'CSSMathSum': false;
	readonly 'CSSMathValue': false;
	readonly 'CSSMatrixComponent': false;
	readonly 'CSSNumericArray': false;
	readonly 'CSSNumericValue': false;
	readonly 'CSSPerspective': false;
	readonly 'CSSRotate': false;
	readonly 'CSSScale': false;
	readonly 'CSSSkew': false;
	readonly 'CSSSkewX': false;
	readonly 'CSSSkewY': false;
	readonly 'CSSStyleValue': false;
	readonly 'CSSTransformComponent': false;
	readonly 'CSSTransformValue': false;
	readonly 'CSSTranslate': false;
	readonly 'CSSUnitValue': false;
	readonly 'CSSUnparsedValue': false;
	readonly 'CSSVariableReferenceValue': false;
	readonly 'CustomEvent': false;
	readonly 'DecompressionStream': false;
	readonly 'dispatchEvent': false;
	readonly 'DOMException': false;
	readonly 'DOMMatrix': false;
	readonly 'DOMMatrixReadOnly': false;
	readonly 'DOMPoint': false;
	readonly 'DOMPointReadOnly': false;
	readonly 'DOMQuad': false;
	readonly 'DOMRect': false;
	readonly 'DOMRectReadOnly': false;
	readonly 'DOMStringList': false;
	readonly 'ErrorEvent': false;
	readonly 'Event': false;
	readonly 'EventSource': false;
	readonly 'EventTarget': false;
	readonly 'ExtendableCookieChangeEvent': false;
	readonly 'ExtendableEvent': false;
	readonly 'ExtendableMessageEvent': false;
	readonly 'fetch': false;
	readonly 'FetchEvent': false;
	readonly 'File': false;
	readonly 'FileList': false;
	readonly 'FileReader': false;
	readonly 'FileSystemDirectoryHandle': false;
	readonly 'FileSystemFileHandle': false;
	readonly 'FileSystemHandle': false;
	readonly 'FileSystemWritableFileStream': false;
	readonly 'FontFace': false;
	readonly 'FontFaceSet': false;
	readonly 'FontFaceSetLoadEvent': false;
	readonly 'fonts': false;
	readonly 'FormData': false;
	readonly 'GPU': false;
	readonly 'GPUAdapter': false;
	readonly 'GPUAdapterInfo': false;
	readonly 'GPUBindGroup': false;
	readonly 'GPUBindGroupLayout': false;
	readonly 'GPUBuffer': false;
	readonly 'GPUBufferUsage': false;
	readonly 'GPUCanvasContext': false;
	readonly 'GPUColorWrite': false;
	readonly 'GPUCommandBuffer': false;
	readonly 'GPUCommandEncoder': false;
	readonly 'GPUCompilationInfo': false;
	readonly 'GPUCompilationMessage': false;
	readonly 'GPUComputePassEncoder': false;
	readonly 'GPUComputePipeline': false;
	readonly 'GPUDevice': false;
	readonly 'GPUDeviceLostInfo': false;
	readonly 'GPUError': false;
	readonly 'GPUExternalTexture': false;
	readonly 'GPUInternalError': false;
	readonly 'GPUMapMode': false;
	readonly 'GPUOutOfMemoryError': false;
	readonly 'GPUPipelineError': false;
	readonly 'GPUPipelineLayout': false;
	readonly 'GPUQuerySet': false;
	readonly 'GPUQueue': false;
	readonly 'GPURenderBundle': false;
	readonly 'GPURenderBundleEncoder': false;
	readonly 'GPURenderPassEncoder': false;
	readonly 'GPURenderPipeline': false;
	readonly 'GPUSampler': false;
	readonly 'GPUShaderModule': false;
	readonly 'GPUShaderStage': false;
	readonly 'GPUSupportedFeatures': false;
	readonly 'GPUSupportedLimits': false;
	readonly 'GPUTexture': false;
	readonly 'GPUTextureUsage': false;
	readonly 'GPUTextureView': false;
	readonly 'GPUUncapturedErrorEvent': false;
	readonly 'GPUValidationError': false;
	readonly 'Headers': false;
	readonly 'IDBCursor': false;
	readonly 'IDBCursorWithValue': false;
	readonly 'IDBDatabase': false;
	readonly 'IDBFactory': false;
	readonly 'IDBIndex': false;
	readonly 'IDBKeyRange': false;
	readonly 'IDBObjectStore': false;
	readonly 'IDBOpenDBRequest': false;
	readonly 'IDBRecord': false;
	readonly 'IDBRequest': false;
	readonly 'IDBTransaction': false;
	readonly 'IDBVersionChangeEvent': false;
	readonly 'ImageBitmap': false;
	readonly 'ImageBitmapRenderingContext': false;
	readonly 'ImageData': false;
	readonly 'importScripts': false;
	readonly 'indexedDB': false;
	readonly 'InstallEvent': false;
	readonly 'isSecureContext': false;
	readonly 'LanguageDetector': false;
	readonly 'location': false;
	readonly 'Lock': false;
	readonly 'LockManager': false;
	readonly 'MediaCapabilities': false;
	readonly 'MessageChannel': false;
	readonly 'MessageEvent': false;
	readonly 'MessagePort': false;
	readonly 'NavigationPreloadManager': false;
	readonly 'navigator': false;
	readonly 'NavigatorUAData': false;
	readonly 'NetworkInformation': false;
	readonly 'Notification': false;
	readonly 'NotificationEvent': false;
	readonly 'Observable': false;
	readonly 'OffscreenCanvas': false;
	readonly 'OffscreenCanvasRenderingContext2D': false;
	readonly 'onabortpayment': true;
	readonly 'onactivate': true;
	readonly 'onbackgroundfetchabort': true;
	readonly 'onbackgroundfetchclick': true;
	readonly 'onbackgroundfetchfail': true;
	readonly 'onbackgroundfetchsuccess': true;
	readonly 'oncanmakepayment': true;
	readonly 'oncookiechange': true;
	readonly 'onerror': true;
	readonly 'onfetch': true;
	readonly 'oninstall': true;
	readonly 'onlanguagechange': true;
	readonly 'onmessage': true;
	readonly 'onmessageerror': true;
	readonly 'onnotificationclick': true;
	readonly 'onnotificationclose': true;
	readonly 'onoffline': true;
	readonly 'ononline': true;
	readonly 'onpaymentrequest': true;
	readonly 'onperiodicsync': true;
	readonly 'onpush': true;
	readonly 'onpushsubscriptionchange': true;
	readonly 'onrejectionhandled': true;
	readonly 'onsync': true;
	readonly 'onunhandledrejection': true;
	readonly 'origin': false;
	readonly 'Origin': false;
	readonly 'Path2D': false;
	readonly 'PaymentRequestEvent': false;
	readonly 'performance': false;
	readonly 'Performance': false;
	readonly 'PerformanceEntry': false;
	readonly 'PerformanceMark': false;
	readonly 'PerformanceMeasure': false;
	readonly 'PerformanceObserver': false;
	readonly 'PerformanceObserverEntryList': false;
	readonly 'PerformanceResourceTiming': false;
	readonly 'PerformanceServerTiming': false;
	readonly 'PeriodicSyncEvent': false;
	readonly 'PeriodicSyncManager': false;
	readonly 'Permissions': false;
	readonly 'PermissionStatus': false;
	readonly 'ProgressEvent': false;
	readonly 'PromiseRejectionEvent': false;
	readonly 'PushEvent': false;
	readonly 'PushManager': false;
	readonly 'PushMessageData': false;
	readonly 'PushSubscription': false;
	readonly 'PushSubscriptionChangeEvent': false;
	readonly 'PushSubscriptionOptions': false;
	readonly 'queueMicrotask': false;
	readonly 'QuotaExceededError': false;
	readonly 'ReadableByteStreamController': false;
	readonly 'ReadableStream': false;
	readonly 'ReadableStreamBYOBReader': false;
	readonly 'ReadableStreamBYOBRequest': false;
	readonly 'ReadableStreamDefaultController': false;
	readonly 'ReadableStreamDefaultReader': false;
	readonly 'registration': false;
	readonly 'removeEventListener': false;
	readonly 'ReportBody': false;
	readonly 'reportError': false;
	readonly 'ReportingObserver': false;
	readonly 'Request': false;
	readonly 'Response': false;
	readonly 'RestrictionTarget': false;
	readonly 'scheduler': false;
	readonly 'Scheduler': false;
	readonly 'SecurityPolicyViolationEvent': false;
	readonly 'self': false;
	readonly 'serviceWorker': false;
	readonly 'ServiceWorker': false;
	readonly 'ServiceWorkerContainer': false;
	readonly 'ServiceWorkerGlobalScope': false;
	readonly 'ServiceWorkerRegistration': false;
	readonly 'setInterval': false;
	readonly 'setTimeout': false;
	readonly 'skipWaiting': false;
	readonly 'StorageBucket': false;
	readonly 'StorageBucketManager': false;
	readonly 'StorageManager': false;
	readonly 'structuredClone': false;
	readonly 'StylePropertyMapReadOnly': false;
	readonly 'Subscriber': false;
	readonly 'SubtleCrypto': false;
	readonly 'SyncEvent': false;
	readonly 'SyncManager': false;
	readonly 'TaskController': false;
	readonly 'TaskPriorityChangeEvent': false;
	readonly 'TaskSignal': false;
	readonly 'Temporal': false;
	readonly 'TextDecoder': false;
	readonly 'TextDecoderStream': false;
	readonly 'TextEncoder': false;
	readonly 'TextEncoderStream': false;
	readonly 'TextMetrics': false;
	readonly 'TransformStream': false;
	readonly 'TransformStreamDefaultController': false;
	readonly 'TrustedHTML': false;
	readonly 'TrustedScript': false;
	readonly 'TrustedScriptURL': false;
	readonly 'TrustedTypePolicy': false;
	readonly 'TrustedTypePolicyFactory': false;
	readonly 'trustedTypes': false;
	readonly 'URL': false;
	readonly 'URLPattern': false;
	readonly 'URLSearchParams': false;
	readonly 'UserActivation': false;
	readonly 'WebAssembly': false;
	readonly 'WebGL2RenderingContext': false;
	readonly 'WebGLActiveInfo': false;
	readonly 'WebGLBuffer': false;
	readonly 'WebGLContextEvent': false;
	readonly 'WebGLFramebuffer': false;
	readonly 'WebGLObject': false;
	readonly 'WebGLProgram': false;
	readonly 'WebGLQuery': false;
	readonly 'WebGLRenderbuffer': false;
	readonly 'WebGLRenderingContext': false;
	readonly 'WebGLSampler': false;
	readonly 'WebGLShader': false;
	readonly 'WebGLShaderPrecisionFormat': false;
	readonly 'WebGLSync': false;
	readonly 'WebGLTexture': false;
	readonly 'WebGLTransformFeedback': false;
	readonly 'WebGLUniformLocation': false;
	readonly 'WebGLVertexArrayObject': false;
	readonly 'WebSocket': false;
	readonly 'WebSocketError': false;
	readonly 'WebSocketStream': false;
	readonly 'WebTransport': false;
	readonly 'WebTransportBidirectionalStream': false;
	readonly 'WebTransportDatagramDuplexStream': false;
	readonly 'WebTransportDatagramsWritable': false;
	readonly 'WebTransportError': false;
	readonly 'WebTransportReceiveStream': false;
	readonly 'WebTransportSendGroup': false;
	readonly 'WebTransportSendStream': false;
	readonly 'WGSLLanguageFeatures': false;
	readonly 'when': false;
	readonly 'WindowClient': false;
	readonly 'WorkerGlobalScope': false;
	readonly 'WorkerLocation': false;
	readonly 'WorkerNavigator': false;
	readonly 'WritableStream': false;
	readonly 'WritableStreamDefaultController': false;
	readonly 'WritableStreamDefaultWriter': false;
}

type GlobalsSharednodebrowser = {
	readonly 'AbortController': false;
	readonly 'AbortSignal': false;
	readonly 'atob': false;
	readonly 'Blob': false;
	readonly 'BroadcastChannel': false;
	readonly 'btoa': false;
	readonly 'ByteLengthQueuingStrategy': false;
	readonly 'clearInterval': false;
	readonly 'clearTimeout': false;
	readonly 'CloseEvent': false;
	readonly 'CompressionStream': false;
	readonly 'console': false;
	readonly 'CountQueuingStrategy': false;
	readonly 'crypto': false;
	readonly 'Crypto': false;
	readonly 'CryptoKey': false;
	readonly 'CustomEvent': false;
	readonly 'DecompressionStream': false;
	readonly 'DOMException': false;
	readonly 'ErrorEvent': false;
	readonly 'Event': false;
	readonly 'EventTarget': false;
	readonly 'fetch': false;
	readonly 'File': false;
	readonly 'FormData': false;
	readonly 'Headers': false;
	readonly 'localStorage': false;
	readonly 'MessageChannel': false;
	readonly 'MessageEvent': false;
	readonly 'MessagePort': false;
	readonly 'navigator': false;
	readonly 'Navigator': false;
	readonly 'performance': false;
	readonly 'Performance': false;
	readonly 'PerformanceEntry': false;
	readonly 'PerformanceMark': false;
	readonly 'PerformanceMeasure': false;
	readonly 'PerformanceObserver': false;
	readonly 'PerformanceObserverEntryList': false;
	readonly 'PerformanceResourceTiming': false;
	readonly 'queueMicrotask': false;
	readonly 'QuotaExceededError': false;
	readonly 'ReadableByteStreamController': false;
	readonly 'ReadableStream': false;
	readonly 'ReadableStreamBYOBReader': false;
	readonly 'ReadableStreamBYOBRequest': false;
	readonly 'ReadableStreamDefaultController': false;
	readonly 'ReadableStreamDefaultReader': false;
	readonly 'Request': false;
	readonly 'Response': false;
	readonly 'sessionStorage': false;
	readonly 'setInterval': false;
	readonly 'setTimeout': false;
	readonly 'Storage': false;
	readonly 'structuredClone': false;
	readonly 'SubtleCrypto': false;
	readonly 'Temporal': false;
	readonly 'TextDecoder': false;
	readonly 'TextDecoderStream': false;
	readonly 'TextEncoder': false;
	readonly 'TextEncoderStream': false;
	readonly 'TransformStream': false;
	readonly 'TransformStreamDefaultController': false;
	readonly 'URL': false;
	readonly 'URLPattern': false;
	readonly 'URLSearchParams': false;
	readonly 'WebAssembly': false;
	readonly 'WebSocket': false;
	readonly 'WritableStream': false;
	readonly 'WritableStreamDefaultController': false;
	readonly 'WritableStreamDefaultWriter': false;
}

type GlobalsSharedWorker = {
	readonly 'AbortController': false;
	readonly 'AbortSignal': false;
	readonly 'addEventListener': false;
	readonly 'atob': false;
	readonly 'BackgroundFetchManager': false;
	readonly 'BackgroundFetchRecord': false;
	readonly 'BackgroundFetchRegistration': false;
	readonly 'BarcodeDetector': false;
	readonly 'Blob': false;
	readonly 'BroadcastChannel': false;
	readonly 'btoa': false;
	readonly 'ByteLengthQueuingStrategy': false;
	readonly 'Cache': false;
	readonly 'caches': false;
	readonly 'CacheStorage': false;
	readonly 'CanvasGradient': false;
	readonly 'CanvasPattern': false;
	readonly 'clearInterval': false;
	readonly 'clearTimeout': false;
	readonly 'close': false;
	readonly 'CloseEvent': false;
	readonly 'CompressionStream': false;
	readonly 'console': false;
	readonly 'CountQueuingStrategy': false;
	readonly 'createImageBitmap': false;
	readonly 'CreateMonitor': false;
	readonly 'CropTarget': false;
	readonly 'crossOriginIsolated': false;
	readonly 'crypto': false;
	readonly 'Crypto': false;
	readonly 'CryptoKey': false;
	readonly 'CSSImageValue': false;
	readonly 'CSSKeywordValue': false;
	readonly 'CSSMathClamp': false;
	readonly 'CSSMathInvert': false;
	readonly 'CSSMathMax': false;
	readonly 'CSSMathMin': false;
	readonly 'CSSMathNegate': false;
	readonly 'CSSMathProduct': false;
	readonly 'CSSMathSum': false;
	readonly 'CSSMathValue': false;
	readonly 'CSSMatrixComponent': false;
	readonly 'CSSNumericArray': false;
	readonly 'CSSNumericValue': false;
	readonly 'CSSPerspective': false;
	readonly 'CSSRotate': false;
	readonly 'CSSScale': false;
	readonly 'CSSSkew': false;
	readonly 'CSSSkewX': false;
	readonly 'CSSSkewY': false;
	readonly 'CSSStyleValue': false;
	readonly 'CSSTransformComponent': false;
	readonly 'CSSTransformValue': false;
	readonly 'CSSTranslate': false;
	readonly 'CSSUnitValue': false;
	readonly 'CSSUnparsedValue': false;
	readonly 'CSSVariableReferenceValue': false;
	readonly 'CustomEvent': false;
	readonly 'DecompressionStream': false;
	readonly 'dispatchEvent': false;
	readonly 'DOMException': false;
	readonly 'DOMMatrix': false;
	readonly 'DOMMatrixReadOnly': false;
	readonly 'DOMPoint': false;
	readonly 'DOMPointReadOnly': false;
	readonly 'DOMQuad': false;
	readonly 'DOMRect': false;
	readonly 'DOMRectReadOnly': false;
	readonly 'DOMStringList': false;
	readonly 'ErrorEvent': false;
	readonly 'Event': false;
	readonly 'EventSource': false;
	readonly 'EventTarget': false;
	readonly 'fetch': false;
	readonly 'File': false;
	readonly 'FileList': false;
	readonly 'FileReader': false;
	readonly 'FileReaderSync': false;
	readonly 'FileSystemDirectoryHandle': false;
	readonly 'FileSystemFileHandle': false;
	readonly 'FileSystemHandle': false;
	readonly 'FileSystemObserver': false;
	readonly 'FileSystemWritableFileStream': false;
	readonly 'FontFace': false;
	readonly 'FontFaceSet': false;
	readonly 'FontFaceSetLoadEvent': false;
	readonly 'fonts': false;
	readonly 'FormData': false;
	readonly 'GPU': false;
	readonly 'GPUAdapter': false;
	readonly 'GPUAdapterInfo': false;
	readonly 'GPUBindGroup': false;
	readonly 'GPUBindGroupLayout': false;
	readonly 'GPUBuffer': false;
	readonly 'GPUBufferUsage': false;
	readonly 'GPUCanvasContext': false;
	readonly 'GPUColorWrite': false;
	readonly 'GPUCommandBuffer': false;
	readonly 'GPUCommandEncoder': false;
	readonly 'GPUCompilationInfo': false;
	readonly 'GPUCompilationMessage': false;
	readonly 'GPUComputePassEncoder': false;
	readonly 'GPUComputePipeline': false;
	readonly 'GPUDevice': false;
	readonly 'GPUDeviceLostInfo': false;
	readonly 'GPUError': false;
	readonly 'GPUExternalTexture': false;
	readonly 'GPUInternalError': false;
	readonly 'GPUMapMode': false;
	readonly 'GPUOutOfMemoryError': false;
	readonly 'GPUPipelineError': false;
	readonly 'GPUPipelineLayout': false;
	readonly 'GPUQuerySet': false;
	readonly 'GPUQueue': false;
	readonly 'GPURenderBundle': false;
	readonly 'GPURenderBundleEncoder': false;
	readonly 'GPURenderPassEncoder': false;
	readonly 'GPURenderPipeline': false;
	readonly 'GPUSampler': false;
	readonly 'GPUShaderModule': false;
	readonly 'GPUShaderStage': false;
	readonly 'GPUSupportedFeatures': false;
	readonly 'GPUSupportedLimits': false;
	readonly 'GPUTexture': false;
	readonly 'GPUTextureUsage': false;
	readonly 'GPUTextureView': false;
	readonly 'GPUUncapturedErrorEvent': false;
	readonly 'GPUValidationError': false;
	readonly 'Headers': false;
	readonly 'IDBCursor': false;
	readonly 'IDBCursorWithValue': false;
	readonly 'IDBDatabase': false;
	readonly 'IDBFactory': false;
	readonly 'IDBIndex': false;
	readonly 'IDBKeyRange': false;
	readonly 'IDBObjectStore': false;
	readonly 'IDBOpenDBRequest': false;
	readonly 'IDBRecord': false;
	readonly 'IDBRequest': false;
	readonly 'IDBTransaction': false;
	readonly 'IDBVersionChangeEvent': false;
	readonly 'ImageBitmap': false;
	readonly 'ImageBitmapRenderingContext': false;
	readonly 'ImageData': false;
	readonly 'importScripts': false;
	readonly 'indexedDB': false;
	readonly 'isSecureContext': false;
	readonly 'location': false;
	readonly 'Lock': false;
	readonly 'LockManager': false;
	readonly 'MediaCapabilities': false;
	readonly 'MessageChannel': false;
	readonly 'MessageEvent': false;
	readonly 'MessagePort': false;
	readonly 'name': false;
	readonly 'NavigationPreloadManager': false;
	readonly 'navigator': false;
	readonly 'NavigatorUAData': false;
	readonly 'NetworkInformation': false;
	readonly 'Notification': false;
	readonly 'Observable': false;
	readonly 'OffscreenCanvas': false;
	readonly 'OffscreenCanvasRenderingContext2D': false;
	readonly 'onconnect': true;
	readonly 'onerror': true;
	readonly 'onlanguagechange': true;
	readonly 'onoffline': true;
	readonly 'ononline': true;
	readonly 'onrejectionhandled': true;
	readonly 'onunhandledrejection': true;
	readonly 'origin': false;
	readonly 'Origin': false;
	readonly 'Path2D': false;
	readonly 'performance': false;
	readonly 'Performance': false;
	readonly 'PerformanceEntry': false;
	readonly 'PerformanceMark': false;
	readonly 'PerformanceMeasure': false;
	readonly 'PerformanceObserver': false;
	readonly 'PerformanceObserverEntryList': false;
	readonly 'PerformanceResourceTiming': false;
	readonly 'PerformanceServerTiming': false;
	readonly 'PeriodicSyncManager': false;
	readonly 'Permissions': false;
	readonly 'PermissionStatus': false;
	readonly 'PERSISTENT': false;
	readonly 'PressureObserver': false;
	readonly 'PressureRecord': false;
	readonly 'ProgressEvent': false;
	readonly 'PromiseRejectionEvent': false;
	readonly 'PushManager': false;
	readonly 'PushSubscription': false;
	readonly 'PushSubscriptionOptions': false;
	readonly 'queueMicrotask': false;
	readonly 'QuotaExceededError': false;
	readonly 'ReadableByteStreamController': false;
	readonly 'ReadableStream': false;
	readonly 'ReadableStreamBYOBReader': false;
	readonly 'ReadableStreamBYOBRequest': false;
	readonly 'ReadableStreamDefaultController': false;
	readonly 'ReadableStreamDefaultReader': false;
	readonly 'removeEventListener': false;
	readonly 'ReportBody': false;
	readonly 'reportError': false;
	readonly 'ReportingObserver': false;
	readonly 'Request': false;
	readonly 'Response': false;
	readonly 'RestrictionTarget': false;
	readonly 'scheduler': false;
	readonly 'Scheduler': false;
	readonly 'SecurityPolicyViolationEvent': false;
	readonly 'self': false;
	readonly 'ServiceWorker': false;
	readonly 'ServiceWorkerContainer': false;
	readonly 'ServiceWorkerRegistration': false;
	readonly 'setInterval': false;
	readonly 'setTimeout': false;
	readonly 'SharedWorkerGlobalScope': false;
	readonly 'StorageBucket': false;
	readonly 'StorageBucketManager': false;
	readonly 'StorageManager': false;
	readonly 'structuredClone': false;
	readonly 'StylePropertyMapReadOnly': false;
	readonly 'Subscriber': false;
	readonly 'SubtleCrypto': false;
	readonly 'SyncManager': false;
	readonly 'TaskController': false;
	readonly 'TaskPriorityChangeEvent': false;
	readonly 'TaskSignal': false;
	readonly 'Temporal': false;
	readonly 'TEMPORARY': false;
	readonly 'TextDecoder': false;
	readonly 'TextDecoderStream': false;
	readonly 'TextEncoder': false;
	readonly 'TextEncoderStream': false;
	readonly 'TextMetrics': false;
	readonly 'TransformStream': false;
	readonly 'TransformStreamDefaultController': false;
	readonly 'TrustedHTML': false;
	readonly 'TrustedScript': false;
	readonly 'TrustedScriptURL': false;
	readonly 'TrustedTypePolicy': false;
	readonly 'TrustedTypePolicyFactory': false;
	readonly 'trustedTypes': false;
	readonly 'URL': false;
	readonly 'URLPattern': false;
	readonly 'URLSearchParams': false;
	readonly 'UserActivation': false;
	readonly 'WebAssembly': false;
	readonly 'WebGL2RenderingContext': false;
	readonly 'WebGLActiveInfo': false;
	readonly 'WebGLBuffer': false;
	readonly 'WebGLContextEvent': false;
	readonly 'WebGLFramebuffer': false;
	readonly 'WebGLObject': false;
	readonly 'WebGLProgram': false;
	readonly 'WebGLQuery': false;
	readonly 'WebGLRenderbuffer': false;
	readonly 'WebGLRenderingContext': false;
	readonly 'WebGLSampler': false;
	readonly 'WebGLShader': false;
	readonly 'WebGLShaderPrecisionFormat': false;
	readonly 'WebGLSync': false;
	readonly 'WebGLTexture': false;
	readonly 'WebGLTransformFeedback': false;
	readonly 'WebGLUniformLocation': false;
	readonly 'WebGLVertexArrayObject': false;
	readonly 'webkitRequestFileSystem': false;
	readonly 'webkitRequestFileSystemSync': false;
	readonly 'webkitResolveLocalFileSystemSyncURL': false;
	readonly 'webkitResolveLocalFileSystemURL': false;
	readonly 'WebSocket': false;
	readonly 'WebSocketError': false;
	readonly 'WebSocketStream': false;
	readonly 'WebTransport': false;
	readonly 'WebTransportBidirectionalStream': false;
	readonly 'WebTransportDatagramDuplexStream': false;
	readonly 'WebTransportDatagramsWritable': false;
	readonly 'WebTransportError': false;
	readonly 'WebTransportReceiveStream': false;
	readonly 'WebTransportSendGroup': false;
	readonly 'WebTransportSendStream': false;
	readonly 'WGSLLanguageFeatures': false;
	readonly 'when': false;
	readonly 'Worker': false;
	readonly 'WorkerGlobalScope': false;
	readonly 'WorkerLocation': false;
	readonly 'WorkerNavigator': false;
	readonly 'WritableStream': false;
	readonly 'WritableStreamDefaultController': false;
	readonly 'WritableStreamDefaultWriter': false;
	readonly 'XMLHttpRequest': false;
	readonly 'XMLHttpRequestEventTarget': false;
	readonly 'XMLHttpRequestUpload': false;
}

type GlobalsShelljs = {
	readonly 'cat': false;
	readonly 'cd': false;
	readonly 'chmod': false;
	readonly 'cmd': false;
	readonly 'config': false;
	readonly 'cp': false;
	readonly 'dirs': false;
	readonly 'echo': false;
	readonly 'env': false;
	readonly 'error': false;
	readonly 'errorCode': false;
	readonly 'exec': false;
	readonly 'exit': false;
	readonly 'find': false;
	readonly 'grep': false;
	readonly 'head': false;
	readonly 'ln': false;
	readonly 'ls': false;
	readonly 'mkdir': false;
	readonly 'mv': false;
	readonly 'popd': false;
	readonly 'pushd': false;
	readonly 'pwd': false;
	readonly 'rm': false;
	readonly 'sed': false;
	readonly 'set': false;
	readonly 'ShellString': false;
	readonly 'sort': false;
	readonly 'tail': false;
	readonly 'tempdir': false;
	readonly 'test': false;
	readonly 'touch': false;
	readonly 'uniq': false;
	readonly 'which': false;
}

type GlobalsSvelte = {
	readonly '$bindable': false;
	readonly '$derived': false;
	readonly '$effect': false;
	readonly '$host': false;
	readonly '$inspect': false;
	readonly '$props': false;
	readonly '$state': false;
}

type GlobalsVitest = {
	readonly 'afterAll': false;
	readonly 'afterEach': false;
	readonly 'assert': false;
	readonly 'assertType': false;
	readonly 'beforeAll': false;
	readonly 'beforeEach': false;
	readonly 'chai': false;
	readonly 'describe': false;
	readonly 'expect': false;
	readonly 'expectTypeOf': false;
	readonly 'it': false;
	readonly 'onTestFailed': false;
	readonly 'onTestFinished': false;
	readonly 'suite': false;
	readonly 'test': false;
	readonly 'vi': false;
	readonly 'vitest': false;
}

type GlobalsVue = {
	readonly 'defineEmits': false;
	readonly 'defineExpose': false;
	readonly 'defineModel': false;
	readonly 'defineOptions': false;
	readonly 'defineProps': false;
	readonly 'defineSlots': false;
	readonly 'withDefaults': false;
}

type GlobalsWebextensions = {
	readonly 'browser': false;
	readonly 'chrome': false;
	readonly 'opr': false;
}

type GlobalsWebpack = {
	readonly '__non_webpack_require__': false;
	readonly '__resourceQuery': false;
	readonly '__webpack_base_uri__': true;
	readonly '__webpack_chunk_load__': true;
	readonly '__webpack_exports_info__': false;
	readonly '__webpack_get_script_filename__': true;
	readonly '__webpack_hash__': false;
	readonly '__webpack_is_included__': false;
	readonly '__webpack_module__': false;
	readonly '__webpack_modules__': false;
	readonly '__webpack_public_path__': true;
	readonly '__webpack_require__': false;
	readonly '__webpack_runtime_id__': false;
}

type GlobalsWorker = {
	readonly 'AbortController': false;
	readonly 'AbortSignal': false;
	readonly 'addEventListener': false;
	readonly 'ai': false;
	readonly 'AI': false;
	readonly 'AICreateMonitor': false;
	readonly 'atob': false;
	readonly 'AudioData': false;
	readonly 'AudioDecoder': false;
	readonly 'AudioEncoder': false;
	readonly 'BackgroundFetchManager': false;
	readonly 'BackgroundFetchRecord': false;
	readonly 'BackgroundFetchRegistration': false;
	readonly 'BarcodeDetector': false;
	readonly 'Blob': false;
	readonly 'BroadcastChannel': false;
	readonly 'btoa': false;
	readonly 'ByteLengthQueuingStrategy': false;
	readonly 'Cache': false;
	readonly 'caches': false;
	readonly 'CacheStorage': false;
	readonly 'cancelAnimationFrame': false;
	readonly 'CanvasGradient': false;
	readonly 'CanvasPattern': false;
	readonly 'clearInterval': false;
	readonly 'clearTimeout': false;
	readonly 'close': false;
	readonly 'CloseEvent': false;
	readonly 'CompressionStream': false;
	readonly 'console': false;
	readonly 'CountQueuingStrategy': false;
	readonly 'createImageBitmap': false;
	readonly 'CreateMonitor': false;
	readonly 'CropTarget': false;
	readonly 'crossOriginIsolated': false;
	readonly 'crypto': false;
	readonly 'Crypto': false;
	readonly 'CryptoKey': false;
	readonly 'CSSImageValue': false;
	readonly 'CSSKeywordValue': false;
	readonly 'CSSMathClamp': false;
	readonly 'CSSMathInvert': false;
	readonly 'CSSMathMax': false;
	readonly 'CSSMathMin': false;
	readonly 'CSSMathNegate': false;
	readonly 'CSSMathProduct': false;
	readonly 'CSSMathSum': false;
	readonly 'CSSMathValue': false;
	readonly 'CSSMatrixComponent': false;
	readonly 'CSSNumericArray': false;
	readonly 'CSSNumericValue': false;
	readonly 'CSSPerspective': false;
	readonly 'CSSRotate': false;
	readonly 'CSSScale': false;
	readonly 'CSSSkew': false;
	readonly 'CSSSkewX': false;
	readonly 'CSSSkewY': false;
	readonly 'CSSStyleValue': false;
	readonly 'CSSTransformComponent': false;
	readonly 'CSSTransformValue': false;
	readonly 'CSSTranslate': false;
	readonly 'CSSUnitValue': false;
	readonly 'CSSUnparsedValue': false;
	readonly 'CSSVariableReferenceValue': false;
	readonly 'CustomEvent': false;
	readonly 'DecompressionStream': false;
	readonly 'DedicatedWorkerGlobalScope': false;
	readonly 'dispatchEvent': false;
	readonly 'DOMException': false;
	readonly 'DOMMatrix': false;
	readonly 'DOMMatrixReadOnly': false;
	readonly 'DOMPoint': false;
	readonly 'DOMPointReadOnly': false;
	readonly 'DOMQuad': false;
	readonly 'DOMRect': false;
	readonly 'DOMRectReadOnly': false;
	readonly 'DOMStringList': false;
	readonly 'EncodedAudioChunk': false;
	readonly 'EncodedVideoChunk': false;
	readonly 'ErrorEvent': false;
	readonly 'Event': false;
	readonly 'EventSource': false;
	readonly 'EventTarget': false;
	readonly 'fetch': false;
	readonly 'File': false;
	readonly 'FileList': false;
	readonly 'FileReader': false;
	readonly 'FileReaderSync': false;
	readonly 'FileSystemDirectoryHandle': false;
	readonly 'FileSystemFileHandle': false;
	readonly 'FileSystemHandle': false;
	readonly 'FileSystemObserver': false;
	readonly 'FileSystemSyncAccessHandle': false;
	readonly 'FileSystemWritableFileStream': false;
	readonly 'FontFace': false;
	readonly 'FontFaceSet': false;
	readonly 'FontFaceSetLoadEvent': false;
	readonly 'fonts': false;
	readonly 'FormData': false;
	readonly 'GPU': false;
	readonly 'GPUAdapter': false;
	readonly 'GPUAdapterInfo': false;
	readonly 'GPUBindGroup': false;
	readonly 'GPUBindGroupLayout': false;
	readonly 'GPUBuffer': false;
	readonly 'GPUBufferUsage': false;
	readonly 'GPUCanvasContext': false;
	readonly 'GPUColorWrite': false;
	readonly 'GPUCommandBuffer': false;
	readonly 'GPUCommandEncoder': false;
	readonly 'GPUCompilationInfo': false;
	readonly 'GPUCompilationMessage': false;
	readonly 'GPUComputePassEncoder': false;
	readonly 'GPUComputePipeline': false;
	readonly 'GPUDevice': false;
	readonly 'GPUDeviceLostInfo': false;
	readonly 'GPUError': false;
	readonly 'GPUExternalTexture': false;
	readonly 'GPUInternalError': false;
	readonly 'GPUMapMode': false;
	readonly 'GPUOutOfMemoryError': false;
	readonly 'GPUPipelineError': false;
	readonly 'GPUPipelineLayout': false;
	readonly 'GPUQuerySet': false;
	readonly 'GPUQueue': false;
	readonly 'GPURenderBundle': false;
	readonly 'GPURenderBundleEncoder': false;
	readonly 'GPURenderPassEncoder': false;
	readonly 'GPURenderPipeline': false;
	readonly 'GPUSampler': false;
	readonly 'GPUShaderModule': false;
	readonly 'GPUShaderStage': false;
	readonly 'GPUSupportedFeatures': false;
	readonly 'GPUSupportedLimits': false;
	readonly 'GPUTexture': false;
	readonly 'GPUTextureUsage': false;
	readonly 'GPUTextureView': false;
	readonly 'GPUUncapturedErrorEvent': false;
	readonly 'GPUValidationError': false;
	readonly 'Headers': false;
	readonly 'HID': false;
	readonly 'HIDConnectionEvent': false;
	readonly 'HIDDevice': false;
	readonly 'HIDInputReportEvent': false;
	readonly 'IDBCursor': false;
	readonly 'IDBCursorWithValue': false;
	readonly 'IDBDatabase': false;
	readonly 'IDBFactory': false;
'd	readonly 'IDBIndex': false;
	readonly 'IDBKeyRange': false;
	readonly 'IDBObjectStore': false;
	readonly 'IDBOpenDBRequest': false;
	readonly 'IDBRecord': false;
	readonly 'IDBRequest': false;
	readonly 'IDBTransaction': false;
	readonly 'IDBVersionChangeEvent': false;
	readonly 'IdleDetector': false;
	readonly 'ImageBitmap': false;
	readonly 'ImageBitmapRenderingContext': false;
	readonly 'ImageData': false;
	readonly 'ImageDecoder': false;
	readonly 'ImageTrack': false;
	readonly 'ImageTrackList': false;
	readonly 'importScripts': false;
	readonly 'indexedDB': false;
	readonly 'isSecureContext': false;
	readonly 'LanguageDetector': false;
	readonly 'location': false;
	readonly 'Lock': false;
	readonly 'LockManager': false;
	readonly 'MediaCapabilities': false;
	readonly 'MediaSource': false;
	readonly 'MediaSourceHandle': false;
	readonly 'MessageChannel': false;
	readonly 'MessageEvent': false;
	readonly 'MessagePort': false;
	readonly 'name': false;
	readonly 'NavigationPreloadManager': false;
	readonly 'navigator': false;
	readonly 'NavigatorUAData': false;
	readonly 'NetworkInformation': false;
	readonly 'Notification': false;
	readonly 'Observable': false;
	readonly 'OffscreenCanvas': false;
	readonly 'OffscreenCanvasRenderingContext2D': false;
	readonly 'onerror': true;
	readonly 'onlanguagechange': true;
	readonly 'onmessage': true;
	readonly 'onmessageerror': true;
	readonly 'onoffline': true;
	readonly 'ononline': true;
	readonly 'onrejectionhandled': true;
	readonly 'onrtctransform': true;
	readonly 'onunhandledrejection': true;
	readonly 'origin': false;
	readonly 'Origin': false;
	readonly 'Path2D': false;
	readonly 'performance': false;
	readonly 'Performance': false;
	readonly 'PerformanceEntry': false;
	readonly 'PerformanceMark': false;
	readonly 'PerformanceMeasure': false;
	readonly 'PerformanceObserver': false;
	readonly 'PerformanceObserverEntryList': false;
	readonly 'PerformanceResourceTiming': false;
	readonly 'PerformanceServerTiming': false;
	readonly 'PeriodicSyncManager': false;
	readonly 'Permissions': false;
	readonly 'PermissionStatus': false;
	readonly 'PERSISTENT': false;
	readonly 'postMessage': false;
	readonly 'PressureObserver': false;
	readonly 'PressureRecord': false;
	readonly 'ProgressEvent': false;
	readonly 'PromiseRejectionEvent': false;
	readonly 'PushManager': false;
	readonly 'PushSubscription': false;
	readonly 'PushSubscriptionOptions': false;
	readonly 'queueMicrotask': false;
	readonly 'QuotaExceededError': false;
	readonly 'ReadableByteStreamController': false;
	readonly 'ReadableStream': false;
	readonly 'ReadableStreamBYOBReader': false;
	readonly 'ReadableStreamBYOBRequest': false;
	readonly 'ReadableStreamDefaultController': false;
	readonly 'ReadableStreamDefaultReader': false;
	readonly 'removeEventListener': false;
	readonly 'ReportBody': false;
	readonly 'reportError': false;
	readonly 'ReportingObserver': false;
	readonly 'Request': false;
	readonly 'requestAnimationFrame': false;
	readonly 'Response': false;
	readonly 'RestrictionTarget': false;
	readonly 'RTCDataChannel': false;
	readonly 'RTCEncodedAudioFrame': false;
	readonly 'RTCEncodedVideoFrame': false;
	readonly 'RTCError': false;
	readonly 'RTCErrorEvent': false;
	readonly 'RTCRtpScriptTransformer': false;
	readonly 'RTCTransformEvent': false;
	readonly 'scheduler': false;
	readonly 'Scheduler': false;
	readonly 'SecurityPolicyViolationEvent': false;
	readonly 'self': false;
	readonly 'Serial': false;
	readonly 'SerialPort': false;
	readonly 'ServiceWorker': false;
	readonly 'ServiceWorkerContainer': false;
	readonly 'ServiceWorkerRegistration': false;
	readonly 'setInterval': false;
	readonly 'setTimeout': false;
	readonly 'SourceBuffer': false;
	readonly 'SourceBufferList': false;
	readonly 'StorageBucket': false;
	readonly 'StorageBucketManager': false;
	readonly 'StorageManager': false;
	readonly 'structuredClone': false;
	readonly 'StylePropertyMapReadOnly': false;
	readonly 'Subscriber': false;
	readonly 'SubtleCrypto': false;
	readonly 'SyncManager': false;
	readonly 'TaskController': false;
	readonly 'TaskPriorityChangeEvent': false;
	readonly 'TaskSignal': false;
	readonly 'Temporal': false;
	readonly 'TEMPORARY': false;
	readonly 'TextDecoder': false;
	readonly 'TextDecoderStream': false;
	readonly 'TextEncoder': false;
	readonly 'TextEncoderStream': false;
	readonly 'TextMetrics': false;
	readonly 'TransformStream': false;
	readonly 'TransformStreamDefaultController': false;
	readonly 'TrustedHTML': false;
	readonly 'TrustedScript': false;
	readonly 'TrustedScriptURL': false;
	readonly 'TrustedTypePolicy': false;
	readonly 'TrustedTypePolicyFactory': false;
	readonly 'trustedTypes': false;
	readonly 'URL': false;
	readonly 'URLPattern': false;
	readonly 'URLSearchParams': false;
	readonly 'USB': false;
	readonly 'USBAlternateInterface': false;
	readonly 'USBConfiguration': false;
	readonly 'USBConnectionEvent': false;
	readonly 'USBDevice': false;
	readonly 'USBEndpoint': false;
	readonly 'USBInterface': false;
	readonly 'USBInTransferResult': false;
	readonly 'USBIsochronousInTransferPacket': false;
	readonly 'USBIsochronousInTransferResult': false;
	readonly 'USBIsochronousOutTransferPacket': false;
	readonly 'USBIsochronousOutTransferResult': false;
	readonly 'USBOutTransferResult': false;
	readonly 'UserActivation': false;
	readonly 'VideoColorSpace': false;
	readonly 'VideoDecoder': false;
	readonly 'VideoEncoder': false;
	readonly 'VideoFrame': false;
	readonly 'WebAssembly': false;
	readonly 'WebGL2RenderingContext': false;
	readonly 'WebGLActiveInfo': false;
	readonly 'WebGLBuffer': false;
	readonly 'WebGLContextEvent': false;
	readonly 'WebGLFramebuffer': false;
	readonly 'WebGLObject': false;
	readonly 'WebGLProgram': false;
	readonly 'WebGLQuery': false;
	readonly 'WebGLRenderbuffer': false;
	readonly 'WebGLRenderingContext': false;
	readonly 'WebGLSampler': false;
	readonly 'WebGLShader': false;
	readonly 'WebGLShaderPrecisionFormat': false;
	readonly 'WebGLSync': false;
	readonly 'WebGLTexture': false;
	readonly 'WebGLTransformFeedback': false;
	readonly 'WebGLUniformLocation': false;
	readonly 'WebGLVertexArrayObject': false;
	readonly 'webkitRequestFileSystem': false;
	readonly 'webkitRequestFileSystemSync': false;
	readonly 'webkitResolveLocalFileSystemSyncURL': false;
	readonly 'webkitResolveLocalFileSystemURL': false;
	readonly 'WebSocket': false;
	readonly 'WebSocketError': false;
	readonly 'WebSocketStream': false;
	readonly 'WebTransport': false;
	readonly 'WebTransportBidirectionalStream': false;
	readonly 'WebTransportDatagramDuplexStream': false;
	readonly 'WebTransportDatagramsWritable': false;
	readonly 'WebTransportError': false;
	readonly 'WebTransportReceiveStream': false;
	readonly 'WebTransportSendGroup': false;
	readonly 'WebTransportSendStream': false;
	readonly 'WGSLLanguageFeatures': false;
	readonly 'when': false;
	readonly 'Worker': false;
	readonly 'WorkerGlobalScope': false;
	readonly 'WorkerLocation': false;
	readonly 'WorkerNavigator': false;
	readonly 'WritableStream': false;
	readonly 'WritableStreamDefaultController': false;
	readonly 'WritableStreamDefaultWriter': false;
	readonly 'XMLHttpRequest': false;
	readonly 'XMLHttpRequestEventTarget': false;
	readonly 'XMLHttpRequestUpload': false;
}

type GlobalsWsh = {
	readonly 'ActiveXObject': false;
	readonly 'CollectGarbage': false;
	readonly 'Debug': false;
	readonly 'Enumerator': false;
	readonly 'GetObject': false;
	readonly 'RuntimeObject': false;
	readonly 'ScriptEngine': false;
	readonly 'ScriptEngineBuildVersion': false;
	readonly 'ScriptEngineMajorVersion': false;
	readonly 'ScriptEngineMinorVersion': false;
	readonly 'VBArray': false;
	readonly 'WScript': false;
	readonly 'WSH': false;
}

type GlobalsYui = {
	readonly 'YAHOO': false;
	readonly 'YAHOO_config': false;
	readonly 'YUI': false;
	readonly 'YUI_config': false;
}

type Globals = {
	readonly 'amd': GlobalsAmd;
	readonly 'applescript': GlobalsApplescript;
	readonly 'astro': GlobalsAstro;
	readonly 'atomtest': GlobalsAtomtest;
	readonly 'audioWorklet': GlobalsAudioWorklet;
	readonly 'browser': GlobalsBrowser;
	readonly 'builtin': GlobalsBuiltin;
	readonly 'bunBuiltin': GlobalsBunBuiltin;
	readonly 'chai': GlobalsChai;
	readonly 'commonjs': GlobalsCommonjs;
	readonly 'couch': GlobalsCouch;
	readonly 'denoBuiltin': GlobalsDenoBuiltin;
	readonly 'devtools': GlobalsDevtools;
	readonly 'embertest': GlobalsEmbertest;
	readonly 'es2015': GlobalsEs2015;
	readonly 'es2016': GlobalsEs2016;
	readonly 'es2017': GlobalsEs2017;
	readonly 'es2018': GlobalsEs2018;
	readonly 'es2019': GlobalsEs2019;
	readonly 'es2020': GlobalsEs2020;
	readonly 'es2021': GlobalsEs2021;
	readonly 'es2022': GlobalsEs2022;
	readonly 'es2023': GlobalsEs2023;
	readonly 'es2024': GlobalsEs2024;
	readonly 'es2025': GlobalsEs2025;
	readonly 'es2026': GlobalsEs2026;
	readonly 'es2027': GlobalsEs2027;
	readonly 'es3': GlobalsEs3;
	readonly 'es5': GlobalsEs5;
	readonly 'greasemonkey': GlobalsGreasemonkey;
	readonly 'jasmine': GlobalsJasmine;
	readonly 'jest': GlobalsJest;
	readonly 'jquery': GlobalsJquery;
	readonly 'meteor': GlobalsMeteor;
	readonly 'mocha': GlobalsMocha;
	readonly 'mongo': GlobalsMongo;
	readonly 'nashorn': GlobalsNashorn;
	readonly 'node': GlobalsNode;
	readonly 'nodeBuiltin': GlobalsNodeBuiltin;
	readonly 'paintWorklet': GlobalsPaintWorklet;
	readonly 'phantomjs': GlobalsPhantomjs;
	readonly 'prototypejs': GlobalsPrototypejs;
	readonly 'protractor': GlobalsProtractor;
	readonly 'qunit': GlobalsQunit;
	readonly 'rhino': GlobalsRhino;
	readonly 'rspack': GlobalsRspack;
	readonly 'serviceworker': GlobalsServiceworker;
	readonly 'shared-node-browser': GlobalsSharednodebrowser;
	readonly 'sharedWorker': GlobalsSharedWorker;
	readonly 'shelljs': GlobalsShelljs;
	readonly 'svelte': GlobalsSvelte;
	readonly 'vitest': GlobalsVitest;
	readonly 'vue': GlobalsVue;
	readonly 'webextensions': GlobalsWebextensions;
	readonly 'webpack': GlobalsWebpack;
	readonly 'worker': GlobalsWorker;
	readonly 'wsh': GlobalsWsh;
	readonly 'yui': GlobalsYui;
}

declare const globals: Globals;

export = globals;^gx: 'use strict';
module.exports = require('./globals.json');
^&굹xj{
	"name": "globals",
	"version": "17.9.0",
	"description": "Global identifiers from different JavaScript environments",
	"license": "MIT",
	"repository": "sindresorhus/globals",
	"funding": "https://github.com/sponsors/sindresorhus",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "https://sindresorhus.com"
	},
	"sideEffects": false,
	"engines": {
		"node": ">=18"
	},
	"scripts": {
		"test": "npm run build && xo && ava && tsd",
		"prepare": "npm run build",
		"update": "node scripts/update.mjs",
		"update:browser": "node scripts/update.mjs --job=browser",
		"update:builtin": "node scripts/update.mjs --job=builtin",
		"update:builtin-yearly": "node scripts/update.mjs --job=builtin-yearly",
		"update:nodeBuiltin": "node scripts/update.mjs --job=nodeBuiltin",
		"update:bunBuiltin": "node scripts/update.mjs --job=bunBuiltin",
		"update:denoBuiltin": "node scripts/update.mjs --job=denoBuiltin",
		"update:worker": "node scripts/update.mjs --job=worker",
		"update:serviceworker": "node scripts/update.mjs --job=serviceworker",
		"update:sharedWorker": "node scripts/update.mjs --job=sharedWorker",
		"update:audioWorklet": "node scripts/update.mjs --job=audioWorklet",
		"update:shelljs": "node scripts/update.mjs --job=shelljs",
		"update:jest": "node scripts/update.mjs --job=jest",
		"update:vitest": "node scripts/update.mjs --job=vitest",
		"build": "run-s build:data build:types",
		"build:data": "node scripts/generate-data.mjs",
		"build:types": "node scripts/generate-types.mjs"
	},
	"files": [
		"index.js",
		"index.d.ts",
		"globals.json"
	],
	"keywords": [
		"globals",
		"global",
		"identifiers",
		"variables",
		"vars",
		"jshint",
		"eslint",
		"environments"
	],
	"devDependencies": {
		"@vitest/eslint-plugin": "^1.1.44",
		"ava": "^6.3.0",
		"cheerio": "^1.0.0",
		"eslint-plugin-jest": "^28.11.0",
		"get-port": "^7.1.0",
		"is-identifier": "^1.0.1",
		"nano-spawn": "^0.2.0",
		"npm-run-all2": "^8.0.1",
		"outdent": "^0.8.0",
		"puppeteer": "^25.4.0",
		"shelljs": "^0.9.2",
		"tsd": "^0.32.0",
		"type-fest": "^4.41.0",
		"xo": "^0.60.0"
	},
	"xo": {
		"rules": {
			"unicorn/prefer-module": "off"
		},
		"overrides": [
			{
				"files": [
					"data/*.mjs"
				],
				"rules": {
					"import/no-anonymous-default-export": "off",
					"camelcase": "off",
					"unicorn/filename-case": [
						"error",
						{
							"cases": {
								"camelCase": true,
								"kebabCase": true
							}
						}
					]
				}
			},
			{
				"files": [
					"scripts/*.mjs"
				],
				"rules": {
					"n/no-unsupported-features/node-builtins": "off"
				}
			},
			{
				"files": [
					"scripts/browser/assets/**/*.mjs"
				],
				"envs": [
					"browser",
					"worker",
					"serviceworker"
				],
				"rules": {
					"n/no-unsupported-features/node-builtins": "off",
					"unicorn/prefer-add-event-listener": "off"
				}
			}
		]
	},
	"tsd": {
		"compilerOptions": {
			"resolveJsonModule": true
		}
	}
}
gexW# globals

> Global identifiers from different JavaScript environments

It's just a [JSON file](globals.json), so you can use it in any environment.

This package is used by ESLint 8 and earlier. For ESLint 9 and later, you should depend on this package directly in [your ESLint config](https://eslint.org/docs/latest/use/configure/language-options#predefined-global-variables).

## Install

```sh
npm install globals
```

## Usage

```js
import globals from 'globals';

console.log(globals.browser);
/*
{
	addEventListener: false,
	applicationCache: false,
	ArrayBuffer: false,
	atob: false,
	…
}
*/
```

Each global is given a value of `true` or `false`. A value of `true` indicates that the variable may be overwritten. A value of `false` indicates that the variable should be considered read-only. This information is used by static analysis tools to flag incorrect behavior. We assume all variables should be `false` unless we hear otherwise.

For Node.js this package provides two sets of globals:

- `globals.nodeBuiltin`: Globals available to all code running in Node.js.
	These will usually be available as properties on the `globalThis` object and include `process`, `Buffer`, but not CommonJS arguments like `require`.
	See: https://nodejs.org/api/globals.html
- `globals.node`: A combination of the globals from `nodeBuiltin` plus all CommonJS arguments ("CommonJS module scope").
	See: https://nodejs.org/api/modules.html#modules_the_module_scope

When analyzing code that is known to run outside of a CommonJS wrapper, for example, JavaScript modules, `nodeBuiltin` can find accidental CommonJS references.
?lx 100644 LICENSE-MIT U37op1JR`%100644 README.md P؈"_{Kȥ*f100644 index.d.ts 1fXu9Mَ\NJ100644 index.js 8uFw100644 legacy.js ?fΉT2i09100644 package.json [ 5{0;R#Z0xxGCopyright (c) 2013 Kael Zhang <i@kael.me>, contributors
http://kael.me/C= obtaining
4 files (the
, restriction, including
% copy, modify, merge, publish,
S# w
permit persons to whom the *
the following  OF
q HOLDERS BE
w1 WHETHER IN AN ACTION
'^ FROM, OUT OF OR IN CONNECTION
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.@u׶x.<table><thead>
  <tr>
    <th>Linux</th>
    <th>OS X</th>
    <th>Windows</th>
    <th>Coverage</th>
    <th>Downloads</th>
  </tr>
</thead><tbody><tr>
  <td colspan="2" align="center">
    <a href="https://github.com/kaelzhang/node-ignore/actions/workflows/nodejs.yml">
    <img
      src="https://github.com/kaelzhang/node-ignore/actions/workflows/nodejs.yml/badge.svg"
      alt="Build Status" /></a>
  </td>
  <td align="center">
    <a href="https://ci.appveyor.com/project/kaelzhang/node-ignore">
    <img
      src="https://ci.appveyor.com/api/projects/status/github/kaelzhang/node-ignore?branch=master&svg=true"
      alt="Windows Build Status" /></a>
  </td>
  <td align="center">
    <a href="https://codecov.io/gh/kaelzhang/node-ignore">
    <img
      src="https://codecov.io/gh/kaelzhang/node-ignore/branch/master/graph/badge.svg"
      alt="Coverage Status" /></a>
  </td>
  <td align="center">
    <a href="https://www.npmjs.org/package/ignore">
    <img
      src="http://img.shields.io/npm/dm/ignore.svg"
      alt="npm module downloads per month" /></a>
  </td>
</tr></tbody></table>

# ignore

`ignore` is a manager, filter and parser which implemented in pure JavaScript according to the [.gitignore spec 2.22.1](http://git-scm.com/docs/gitignore).

`ignore` is used by eslint, gitbook and [many others](https://www.npmjs.com/browse/depended/ignore).

Pay **ATTENTION** that [`minimatch`](https://www.npmjs.org/package/minimatch) (which used by `fstream-ignore`) does not follow the gitignore spec.

To filter filenames according to a .gitignore file, I recommend this npm package, `ignore`.

To parse an `.npmignore` file, you should use `minimatch`, because an `.npmignore` file is parsed by npm using `minimatch` and it does not work in the .gitignore way.

### Tested on

`ignore` is fully tested, and has more than **five hundreds** of unit tests.

- Linux + Node: `0.8` - `7.x`
- Windows + Node: `0.10` - `7.x`, node < `0.10` is not tested due to the lack of support of appveyor.

Actually, `ignore` does not rely on any versions of node specially.

Since `4.0.0`, ignore will no longer support `node < 6` by default, to use in node < 6, `require('ignore/legacy')`. For details, see [CHANGELOG](https://github.com/kaelzhang/node-ignore/blob/master/CHANGELOG.md).

## Table Of Main Contents

- [Usage](#usage)
- [`Pathname` Conventions](#pathname-conventions)
- See Also:
  - [`glob-gitignore`](https://www.npmjs.com/package/glob-gitignore) matches files using patterns and filters them according to gitignore rules.
- [Upgrade Guide](#upgrade-guide)

## Install

```sh
npm i ignore
```

## Usage

```js
import ignore from 'ignore'
const ig = ignore().add(['.abc/*', '!.abc/d/'])
```

### Filter the given paths

```js
const paths = [
  '.abc/a.js',    // filtered out
  '.abc/d/e.js'   // included
]

ig.filter(paths)        // ['.abc/d/e.js']
ig.ignores('.abc/a.js') // true
```

### As the filter function

```js
paths.filter(ig.createFilter()); // ['.abc/d/e.js']
```

### Win32 paths will be handled

```js
ig.filter(['.abc\\a.js', '.abc\\d\\e.js'])
// if the code above runs on windows, the result will be
// ['.abc\\d\\e.js']
```

## Why another ignore?

- `ignore` is a standalone module, and is much simpler so that it could easy work with other programs, unlike [isaacs](https://npmjs.org/~isaacs)'s [fstream-ignore](https://npmjs.org/package/fstream-ignore) which must work with the modules of the fstream family.

- `ignore` only contains utility methods to filter paths according to the specified ignore rules, so
  - `ignore` never try to find out ignore rules by traversing directories or fetching from git configurations.
  - `ignore` don't cares about sub-modules of git projects.

- Exactly according to [gitignore man page](http://git-scm.com/docs/gitignore), fixes some known matching issues of fstream-ignore, such as:
  - '`/*.js`' should only match '`a.js`', but not '`abc/a.js`'.
  - '`**/foo`' should match '`foo`' anywhere.
  - Prevent re-including a file if a parent directory of that file is excluded.
  - Handle trailing whitespaces:
    - `'a '`(one space) should not match `'a  '`(two spaces).
    - `'a \ '` matches `'a  '`
  - All test cases are verified with the result of `git check-ignore`.

# Methods

## .add(pattern: string | Ignore): this
## .add(patterns: Array<string | Ignore>): this

- **pattern** `String | Ignore` An ignore pattern string, or the `Ignore` instance
- **patterns** `Array<String | Ignore>` Array of ignore patterns.

Adds a rule or several rules to the current manager.

Returns `this`

Notice that a line starting with `'#'`(hash) is treated as a comment. Put a backslash (`'\'`) in front of the first hash for patterns that begin with a hash, if you want to ignore a file with a hash at the beginning of the filename.

```js
ignore().add('#abc').ignores('#abc')    // false
ignore().add('\\#abc').ignores('#abc')   // true
```

`pattern` could either be a line of ignore pattern or a string of multiple ignore patterns, which means we could just `ignore().add()` the content of a ignore file:

```js
ignore()
.add(fs.readFileSync(filenameOfGitignore).toString())
.filter(filenames)
```

`pattern` could also be an `ignore` instance, so that we could easily inherit the rules of another `Ignore` instance.

## <strike>.addIgnoreFile(path)</strike>

REMOVED in `3.x` for now.

To upgrade `ignore@2.x` up to `3.x`, use

```js
import fs from 'fs'

if (fs.existsSync(filename)) {
  ignore().add(fs.readFileSync(filename).toString())
}
```

instead.

## .filter(paths: Array&lt;Pathname&gt;): Array&lt;Pathname&gt;

```ts
type Pathname = string
```

Filters the given array of pathnames, and returns the filtered array.

- **paths** `Array.<Pathname>` The array of `pathname`s to be filtered.

### `Pathname` Conventions:

#### 1. `Pathname` should be a `path.relative()`d pathname

`Pathname` should be a string that have been `path.join()`ed, or the return value of `path.relative()` to the current directory,

```js
// WRONG, an error will be thrown
ig.ignores('./abc')

// WRONG, for it will never happen, and an error will be thrown
// If the gitignore rule locates at the root directory,
// `'/abc'` should be changed to `'abc'`.
// ```
// path.relative('/', '/abc')  -> 'abc'
// ```
ig.ignores('/abc')

// WRONG, that it is an absolute path on Windows, an error will be thrown
ig.ignores('C:\\abc')

// Right
ig.ignores('abc')

// Right
ig.ignores(path.join('./abc'))  // path.join('./abc') -> 'abc'
```

In other words, each `Pathname` here should be a relative path to the directory of the gitignore rules.

Suppose the dir structure is:

```
/path/to/your/repo
    |-- a
    |   |-- a.js
    |
    |-- .b
    |
    |-- .c
         |-- .DS_store
```

Then the `paths` might be like this:

```js
[
  'a/a.js'
  '.b',
  '.c/.DS_store'
]
```

#### 2. filenames and dirnames

`node-ignore` does NO `fs.stat` during path matching, so for the example below:

```js
// First, we add a ignore pattern to ignore a directory
ig.add('config/')

// `ig` does NOT know if 'config', in the real world,
//   is a normal file, directory or something.

ig.ignores('config')
// `ig` treats `config` as a file, so it returns `false`

ig.ignores('config/')
// returns `true`
```

Specially for people who develop some library based on `node-ignore`, it is important to understand that.

Usually, you could use [`glob`](http://npmjs.org/package/glob) with `option.mark = true` to fetch the structure of the current directory:

```js
import glob from 'glob'

glob('**', {
  // Adds a / character to directory matches.
  mark: true
}, (err, files) => {
  if (err) {
    return console.error(err)
  }

  let filtered = ignore().add(patterns).filter(files)
  console.log(filtered)
})
```

## .ignores(pathname: Pathname): boolean

> new in 3.2.0

Returns `Boolean` whether `pathname` should be ignored.

```js
ig.ignores('.abc/a.js')    // true
```

## .createFilter()

Creates a filter function which could filter an array of paths with `Array.prototype.filter`.

Returns `function(path)` the filter function.

## .test(pathname: Pathname) since 5.0.0

Returns `TestResult`

```ts
interface TestResult {
  ignored: boolean
  // true if the `pathname` is finally unignored by some negative pattern
  unignored: boolean
}
```

- `{ignored: true, unignored: false}`: the `pathname` is ignored
- `{ignored: false, unignored: true}`: the `pathname` is unignored
- `{ignored: false, unignored: false}`: the `pathname` is never matched by any ignore rules.

## static `ignore.isPathValid(pathname): boolean` since 5.0.0

Check whether the `pathname` is an valid `path.relative()`d path according to the [convention](#1-pathname-should-be-a-pathrelatived-pathname).

This method is **NOT** used to check if an ignore pattern is valid.

```js
ignore.isPathValid('./foo')  // false
```

## ignore(options)

### `options.ignorecase` since 4.0.0

Similar as the `core.ignorecase` option of [git-config](https://git-scm.com/docs/git-config), `node-ignore` will be case insensitive if `options.ignorecase` is set to `true` (the default value), otherwise case sensitive.

```js
const ig = ignore({
  ignorecase: false
})

ig.add('*.png')

ig.ignores('*.PNG')  // false
```

### `options.ignoreCase?: boolean` since 5.2.0

Which is alternative to `options.ignoreCase`

### `options.allowRelativePaths?: boolean` since 5.2.0

This option brings backward compatibility with projects which based on `ignore@4.x`. If `options.allowRelativePaths` is `true`, `ignore` will not check whether the given path to be tested is [`path.relative()`d](#pathname-conventions).

However, passing a relative path, such as `'./foo'` or `'../foo'`, to test if it is ignored or not is not a good practise, which might lead to unexpected behavior

```js
ignore({
  allowRelativePaths: true
}).ignores('../foo/bar.js') // And it will not throw
```

****

# Upgrade Guide

## Upgrade 4.x -> 5.x

Since `5.0.0`, if an invalid `Pathname` passed into `ig.ignores()`, an error will be thrown, unless `options.allowRelative = true` is passed to the `Ignore` factory.

While `ignore < 5.0.0` did not make sure what the return value was, as well as

```ts
.ignores(pathname: Pathname): boolean

.filter(pathnames: Array<Pathname>): Array<Pathname>

.createFilter(): (pathname: Pathname) => boolean

.test(pathname: Pathname): {ignored: boolean, unignored: boolean}
```

See the convention [here](#1-pathname-should-be-a-pathrelatived-pathname) for details.

If there are invalid pathnames, the conversion and filtration should be done by users.

```js
import {isPathValid} from 'ignore' // introduced in 5.0.0

const paths = [
  // invalid
  //////////////////
  '',
  false,
  '../foo',
  '.',
  //////////////////

  // valid
  'foo'
]
.filter(isValidPath)

ig.filter(paths)
```

## Upgrade 3.x -> 4.x

Since `4.0.0`, `ignore` will no longer support node < 6, to use `ignore` in node < 6:

```js
var ignore = require('ignore/legacy')
```

## Upgrade 2.x -> 3.x

- All `options` of 2.x are unnecessary and removed, so just remove them.
- `ignore()` instance is no longer an [`EventEmitter`](nodejs.org/api/events.html), and all events are unnecessary and removed.
- `.addIgnoreFile()` is removed, see the [.addIgnoreFile](#addignorefilepath) section for details.

****

# Collaborators

- [@whitecolor](https://github.com/whitecolor) *Alex*
- [@SamyPesse](https://github.com/SamyPesse) *Samy Pessé*
- [@azproduction](https://github.com/azproduction) *Mikhail Davydov*
- [@TrySound](https://github.com/TrySound) *Bogdan Chadkin*
- [@JanMattner](https://github.com/JanMattner) *Jan Mattner*
- [@ntwb](https://github.com/ntwb) *Stephen Edgar*
- [@kasperisager](https://github.com/kasperisager) *Kasper Isager*
- [@sandersn](https://github.com/sandersn) *Nathan Shively-Sanders*
Srû]x$type Pathname = string

interface TestResult {
  ignored: boolean
  unignored: boolean
}

export interface Ignore {
  /**
   * Adds one or several rules to the current manager.
   * @param  {string[]} patterns
   * @returns IgnoreBase
   */
  add(patterns: string | Ignore | readonly (string | Ignore)[]): this

  /**
   * Filters the given array of pathnames, and returns the filtered array.
   * NOTICE that each path here should be a relative path to the root of your repository.
   * @param paths the array of paths to be filtered.
   * @returns The filtered array of paths
   */
  filter(pathnames: readonly Pathname[]): Pathname[]

  /**
   * Creates a filter function which could filter
   * an array of paths with Array.prototype.filter.
   */
  createFilter(): (pathname: Pathname) => boolean

  /**
   * Returns Boolean whether pathname should be ignored.
   * @param  {string} pathname a path to check
   * @returns boolean
   */
  ignores(pathname: Pathname): boolean

  /**
   * Returns whether pathname should be ignored or unignored
   * @param  {string} pathname a path to check
   * @returns TestResult
   */
  test(pathname: Pathname): TestResult
}

export interface Options {
  ignorecase?: boolean
  // For compatibility
  ignoreCase?: boolean
  allowRelativePaths?: boolean
}

/**
 * Creates new ignore manager.
 */
declare function ignore(options?: Options): Ignore

declare namespace ignore {
  export function isPathValid (pathname: string): boolean
}

export default ignore
ix@// A simple implementation of make-array
function makeArray (subject) {
  return Array.isArray(subject)
    ? subject
    : [subject]
}

const EMPTY = ''
const SPACE = ' '
const ESCAPE = '\\'
const REGEX_TEST_BLANK_LINE = /^\s+$/
const REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/
const REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/
const REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/
const REGEX_SPLITALL_CRLF = /\r?\n/g
// /foo,
// ./foo,
// ../foo,
// .
// ..
const REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/

const SLASH = '/'

// Do not use ternary expression here, since "istanbul ignore next" is buggy
let TMP_KEY_IGNORE = 'node-ignore'
/* istanbul ignore else */
if (typeof Symbol !== 'undefined') {
  TMP_KEY_IGNORE = Symbol.for('node-ignore')
}
const KEY_IGNORE = TMP_KEY_IGNORE

const define = (object, key, value) =>
  Object.defineProperty(object, key, {value})

const REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g

const RETURN_FALSE = () => false

// Sanitize the range of a regular expression
// The cases are complicated, see test cases for details
const sanitizeRange = range => range.replace(
  REGEX_REGEXP_RANGE,
  (match, from, to) => from.charCodeAt(0) <= to.charCodeAt(0)
    ? match
    // Invalid range (out of order) which is ok for gitignore rules but
    //   fatal for JavaScript regular expression, so eliminate it.
    : EMPTY
)

// See fixtures #59
const cleanRangeBackSlash = slashes => {
  const {length} = slashes
  return slashes.slice(0, length - length % 2)
}

// > If the pattern ends with a slash,
// > it is removed for the purpose of the following description,
// > but it would only find a match with a directory.
// > In other words, foo/ will match a directory foo and paths underneath it,
// > but will not match a regular file or a symbolic link foo
// >  (this is consistent with the way how pathspec works in general in Git).
// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`'
// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call
//      you could use option `mark: true` with `glob`

// '`foo/`' should not continue with the '`..`'
const REPLACERS = [

  [
    // remove BOM
    // TODO:
    // Other similar zero-width characters?
    /^\uFEFF/,
    () => EMPTY
  ],

  // > Trailing spaces are ignored unless they are quoted with backslash ("\")
  [
    // (a\ ) -> (a )
    // (a  ) -> (a)
    // (a ) -> (a)
    // (a \ ) -> (a  )
    /((?:\\\\)*?)(\\?\s+)$/,
    (_, m1, m2) => m1 + (
      m2.indexOf('\\') === 0
        ? SPACE
        : EMPTY
    )
  ],

  // replace (\ ) with ' '
  // (\ ) -> ' '
  // (\\ ) -> '\\ '
  // (\\\ ) -> '\\ '
  [
    /(\\+?)\s/g,
    (_, m1) => {
      const {length} = m1
      return m1.slice(0, length - length % 2) + SPACE
    }
  ],

  // Escape metacharacters
  // which is written down by users but means special for regular expressions.

  // > There are 12 characters with special meanings:
  // > - the backslash \,
  // > - the caret ^,
  // > - the dollar sign $,
  // > - the period or dot .,
  // > - the vertical bar or pipe symbol |,
  // > - the question mark ?,
  // > - the asterisk or star *,
  // > - the plus sign +,
  // > - the opening parenthesis (,
  // > - the closing parenthesis ),
  // > - and the opening square bracket [,
  // > - the opening curly brace {,
  // > These special characters are often called "metacharacters".
  [
    /[\\$.|*+(){^]/g,
    match => `\\${match}`
  ],

  [
    // > a question mark (?) matches a single character
    /(?!\\)\?/g,
    () => '[^/]'
  ],

  // leading slash
  [

    // > A leading slash matches the beginning of the pathname.
    // > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".
    // A leading slash matches the beginning of the pathname
    /^\//,
    () => '^'
  ],

  // replace special metacharacter slash after the leading slash
  [
    /\//g,
    () => '\\/'
  ],

  [
    // > A leading "**" followed by a slash means match in all directories.
    // > For example, "**/foo" matches file or directory "foo" anywhere,
    // > the same as pattern "foo".
    // > "**/foo/bar" matches file or directory "bar" anywhere that is directly
    // >   under directory "foo".
    // Notice that the '*'s have been replaced as '\\*'
    /^\^*\\\*\\\*\\\//,

    // '**/foo' <-> 'foo'
    () => '^(?:.*\\/)?'
  ],

  // starting
  [
    // there will be no leading '/'
    //   (which has been replaced by section "leading slash")
    // If starts with '**', adding a '^' to the regular expression also works
    /^(?=[^^])/,
    function startingReplacer () {
      // If has a slash `/` at the beginning or middle
      return !/\/(?!$)/.test(this)
        // > Prior to 2.22.1
        // > If the pattern does not contain a slash /,
        // >   Git treats it as a shell glob pattern
        // Actually, if there is only a trailing slash,
        //   git also treats it as a shell glob pattern

        // After 2.22.1 (compatible but clearer)
        // > If there is a separator at the beginning or middle (or both)
        // > of the pattern, then the pattern is relative to the directory
        // > level of the particular .gitignore file itself.
        // > Otherwise the pattern may also match at any level below
        // > the .gitignore level.
        ? '(?:^|\\/)'

        // > Otherwise, Git treats the pattern as a shell glob suitable for
        // >   consumption by fnmatch(3)
        : '^'
    }
  ],

  // two globstars
  [
    // Use lookahead assertions so that we could match more than one `'/**'`
    /\\\/\\\*\\\*(?=\\\/|$)/g,

    // Zero, one or several directories
    // should not use '*', or it will be replaced by the next replacer

    // Check if it is not the last `'/**'`
    (_, index, str) => index + 6 < str.length

      // case: /**/
      // > A slash followed by two consecutive asterisks then a slash matches
      // >   zero or more directories.
      // > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on.
      // '/**/'
      ? '(?:\\/[^\\/]+)*'

      // case: /**
      // > A trailing `"/**"` matches everything inside.

      // #21: everything inside but it should not include the current folder
      : '\\/.+'
  ],

  // normal intermediate wildcards
  [
    // Never replace escaped '*'
    // ignore rule '\*' will match the path '*'

    // 'abc.*/' -> go
    // 'abc.*'  -> skip this rule,
    //    coz trailing single wildcard will be handed by [trailing wildcard]
    /(^|[^\\]+)(\\\*)+(?=.+)/g,

    // '*.js' matches '.js'
    // '*.js' doesn't match 'abc'
    (_, p1, p2) => {
      // 1.
      // > An asterisk "*" matches anything except a slash.
      // 2.
      // > Other consecutive asterisks are considered regular asterisks
      // > and will match according to the previous rules.
      const unescaped = p2.replace(/\\\*/g, '[^\\/]*')
      return p1 + unescaped
    }
  ],

  [
    // unescape, revert step 3 except for back slash
    // For example, if a user escape a '\\*',
    // after step 3, the result will be '\\\\\\*'
    /\\\\\\(?=[$.|*+(){^])/g,
    () => ESCAPE
  ],

  [
    // '\\\\' -> '\\'
    /\\\\/g,
    () => ESCAPE
  ],

  [
    // > The range notation, e.g. [a-zA-Z],
    // > can be used to match one of the characters in a range.

    // `\` is escaped by step 3
    /(\\)?\[([^\]/]*?)(\\*)($|\])/g,
    (match, leadEscape, range, endEscape, close) => leadEscape === ESCAPE
      // '\\[bar]' -> '\\\\[bar\\]'
      ? `\\[${range}${cleanRangeBackSlash(endEscape)}${close}`
      : close === ']'
        ? endEscape.length % 2 === 0
          // A normal case, and it is a range notation
          // '[bar]'
          // '[bar\\\\]'
          ? `[${sanitizeRange(range)}${endEscape}]`
          // Invalid range notaton
          // '[bar\\]' -> '[bar\\\\]'
          : '[]'
        : '[]'
  ],

  // ending
  [
    // 'js' will not match 'js.'
    // 'ab' will not match 'abc'
    /(?:[^*])$/,

    // WTF!
    // https://git-scm.com/docs/gitignore
    // changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1)
    // which re-fixes #24, #38

    // > If there is a separator at the end of the pattern then the pattern
    // > will only match directories, otherwise the pattern can match both
    // > files and directories.

    // 'js*' will not match 'a.js'
    // 'js/' will not match 'a.js'
    // 'js' will match 'a.js' and 'a.js/'
    match => /\/$/.test(match)
      // foo/ will not match 'foo'
      ? `${match}$`
      // foo matches 'foo' and 'foo/'
      : `${match}(?=$|\\/$)`
  ],

  // trailing wildcard
  [
    /(\^|\\\/)?\\\*$/,
    (_, p1) => {
      const prefix = p1
        // '\^':
        // '/*' does not match EMPTY
        // '/*' does not match everything

        // '\\\/':
        // 'abc/*' does not match 'abc/'
        ? `${p1}[^/]+`

        // 'a*' matches 'a'
        // 'a*' matches 'aa'
        : '[^/]*'

      return `${prefix}(?=$|\\/$)`
    }
  ],
]

// A simple cache, because an ignore rule only has only one certain meaning
const regexCache = Object.create(null)

// @param {pattern}
const makeRegex = (pattern, ignoreCase) => {
  let source = regexCache[pattern]

  if (!source) {
    source = REPLACERS.reduce(
      (prev, [matcher, replacer]) =>
        prev.replace(matcher, replacer.bind(pattern)),
      pattern
    )
    regexCache[pattern] = source
  }

  return ignoreCase
    ? new RegExp(source, 'i')
    : new RegExp(source)
}

const isString = subject => typeof subject === 'string'

// > A blank line matches no files, so it can serve as a separator for readability.
const checkPattern = pattern => pattern
  && isString(pattern)
  && !REGEX_TEST_BLANK_LINE.test(pattern)
  && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern)

  // > A line starting with # serves as a comment.
  && pattern.indexOf('#') !== 0

const splitPattern = pattern => pattern.split(REGEX_SPLITALL_CRLF)

class IgnoreRule {
  constructor (
    origin,
    pattern,
    negative,
    regex
  ) {
    this.origin = origin
    this.pattern = pattern
    this.negative = negative
    this.regex = regex
  }
}

const createRule = (pattern, ignoreCase) => {
  const origin = pattern
  let negative = false

  // > An optional prefix "!" which negates the pattern;
  if (pattern.indexOf('!') === 0) {
    negative = true
    pattern = pattern.substr(1)
  }

  pattern = pattern
  // > Put a backslash ("\") in front of the first "!" for patterns that
  // >   begin with a literal "!", for example, `"\!important!.txt"`.
  .replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, '!')
  // > Put a backslash ("\") in front of the first hash for patterns that
  // >   begin with a hash.
  .replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#')

  const regex = makeRegex(pattern, ignoreCase)

  return new IgnoreRule(
    origin,
    pattern,
    negative,
    regex
  )
}

const throwError = (message, Ctor) => {
  throw new Ctor(message)
}

const checkPath = (path, originalPath, doThrow) => {
  if (!isString(path)) {
    return doThrow(
      `path must be a string, but got \`${originalPath}\``,
      TypeError
    )
  }

  // We don't know if we should ignore EMPTY, so throw
  if (!path) {
    return doThrow(`path must not be empty`, TypeError)
  }

  // Check if it is a relative path
  if (checkPath.isNotRelative(path)) {
    const r = '`path.relative()`d'
    return doThrow(
      `path should be a ${r} string, but got "${originalPath}"`,
      RangeError
    )
  }

  return true
}

const isNotRelative = path => REGEX_TEST_INVALID_PATH.test(path)

checkPath.isNotRelative = isNotRelative
checkPath.convert = p => p

class Ignore {
  constructor ({
    ignorecase = true,
    ignoreCase = ignorecase,
    allowRelativePaths = false
  } = {}) {
    define(this, KEY_IGNORE, true)

    this._rules = []
    this._ignoreCase = ignoreCase
    this._allowRelativePaths = allowRelativePaths
    this._initCache()
  }

  _initCache () {
    this._ignoreCache = Object.create(null)
    this._testCache = Object.create(null)
  }

  _addPattern (pattern) {
    // #32
    if (pattern && pattern[KEY_IGNORE]) {
      this._rules = this._rules.concat(pattern._rules)
      this._added = true
      return
    }

    if (checkPattern(pattern)) {
      const rule = createRule(pattern, this._ignoreCase)
      this._added = true
      this._rules.push(rule)
    }
  }

  // @param {Array<string> | string | Ignore} pattern
  add (pattern) {
    this._added = false

    makeArray(
      isString(pattern)
        ? splitPattern(pattern)
        : pattern
    ).forEach(this._addPattern, this)

    // Some rules have just added to the ignore,
    // making the behavior changed.
    if (this._added) {
      this._initCache()
    }

    return this
  }

  // legacy
  addPattern (pattern) {
    return this.add(pattern)
  }

  //          |           ignored : unignored
  // negative |   0:0   |   0:1   |   1:0   |   1:1
  // -------- | ------- | ------- | ------- | --------
  //     0    |  TEST   |  TEST   |  SKIP   |    X
  //     1    |  TESTIF |  SKIP   |  TEST   |    X

  // - SKIP: always skip
  // - TEST: always test
  // - TESTIF: only test if checkUnignored
  // - X: that never happen

  // @param {boolean} whether should check if the path is unignored,
  //   setting `checkUnignored` to `false` could reduce additional
  //   path matching.

  // @returns {TestResult} true if a file is ignored
  _testOne (path, checkUnignored) {
    let ignored = false
    let unignored = false

    this._rules.forEach(rule => {
      const {negative} = rule
      if (
        unignored === negative && ignored !== unignored
        || negative && !ignored && !unignored && !checkUnignored
      ) {
        return
      }

      const matched = rule.regex.test(path)

      if (matched) {
        ignored = !negative
        unignored = negative
      }
    })

    return {
      ignored,
      unignored
    }
  }

  // @returns {TestResult}
  _test (originalPath, cache, checkUnignored, slices) {
    const path = originalPath
      // Supports nullable path
      && checkPath.convert(originalPath)

    checkPath(
      path,
      originalPath,
      this._allowRelativePaths
        ? RETURN_FALSE
        : throwError
    )

    return this._t(path, cache, checkUnignored, slices)
  }

  _t (path, cache, checkUnignored, slices) {
    if (path in cache) {
      return cache[path]
    }

    if (!slices) {
      // path/to/a.js
      // ['path', 'to', 'a.js']
      slices = path.split(SLASH)
    }

    slices.pop()

    // If the path has no parent directory, just test it
    if (!slices.length) {
      return cache[path] = this._testOne(path, checkUnignored)
    }

    const parent = this._t(
      slices.join(SLASH) + SLASH,
      cache,
      checkUnignored,
      slices
    )

    // If the path contains a parent directory, check the parent first
    return cache[path] = parent.ignored
      // > It is not possible to re-include a file if a parent directory of
      // >   that file is excluded.
      ? parent
      : this._testOne(path, checkUnignored)
  }

  ignores (path) {
    return this._test(path, this._ignoreCache, false).ignored
  }

  createFilter () {
    return path => !this.ignores(path)
  }

  filter (paths) {
    return makeArray(paths).filter(this.createFilter())
  }

  // @returns {TestResult}
  test (path) {
    return this._test(path, this._testCache, true)
  }
}

const factory = options => new Ignore(options)

const isPathValid = path =>
  checkPath(path && checkPath.convert(path), path, RETURN_FALSE)

factory.isPathValid = isPathValid

// Fixes typescript
factory.default = factory

module.exports = factory

// Windows
// --------------------------------------------------------------
/* istanbul ignore if */
if (
  // Detect `process` so that it can run in browsers.
  typeof process !== 'undefined'
  && (
    process.env && process.env.IGNORE_TEST_WIN32
    || process.platform === 'win32'
  )
) {
  /* eslint no-control-regex: "off" */
  const makePosix = str => /^\\\\\?\\/.test(str)
  || /["<>|\u0000-\u001F]+/u.test(str)
    ? str
    : str.replace(/\\/g, '/')

  checkPath.convert = makePosix

  // 'C:\\foo'     <- 'C:\\foo' has been converted to 'C:/'
  // 'd:\\foo'
  const REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i
  checkPath.isNotRelative = path =>
    REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path)
    || isNotRelative(path)
}

xQ"use strict";

function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i["return"] && (_r = _i["return"](), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
// A simple implementation of make-array
function makeArray(subject) {
  return Array.isArray(subject) ? subject : [subject];
}
var EMPTY = '';
var SPACE = ' ';
var ESCAPE = '\\';
var REGEX_TEST_BLANK_LINE = /^\s+$/;
var REGEX_INVALID_TRAILING_BACKSLASH = /(?:[^\\]|^)\\$/;
var REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION = /^\\!/;
var REGEX_REPLACE_LEADING_EXCAPED_HASH = /^\\#/;
var REGEX_SPLITALL_CRLF = /\r?\n/g;
// /foo,
// ./foo,
// ../foo,
// .
// ..
var REGEX_TEST_INVALID_PATH = /^\.*\/|^\.+$/;
var SLASH = '/';

// Do not use ternary expression here, since "istanbul ignore next" is buggy
var TMP_KEY_IGNORE = 'node-ignore';
/* istanbul ignore else */
if (typeof Symbol !== 'undefined') {
  TMP_KEY_IGNORE = Symbol["for"]('node-ignore');
}
var KEY_IGNORE = TMP_KEY_IGNORE;
var define = function define(object, key, value) {
  return Object.defineProperty(object, key, {
    value: value
  });
};
var REGEX_REGEXP_RANGE = /([0-z])-([0-z])/g;
var RETURN_FALSE = function RETURN_FALSE() {
  return false;
};

// Sanitize the range of a regular expression
// The cases are complicated, see test cases for details
var sanitizeRange = function sanitizeRange(range) {
  return range.replace(REGEX_REGEXP_RANGE, function (match, from, to) {
    return from.charCodeAt(0) <= to.charCodeAt(0) ? match
    // Invalid range (out of order) which is ok for gitignore rules but
    //   fatal for JavaScript regular expression, so eliminate it.
    : EMPTY;
  });
};

// See fixtures #59
var cleanRangeBackSlash = function cleanRangeBackSlash(slashes) {
  var length = slashes.length;
  return slashes.slice(0, length - length % 2);
};

// > If the pattern ends with a slash,
// > it is removed for the purpose of the following description,
// > but it would only find a match with a directory.
// > In other words, foo/ will match a directory foo and paths underneath it,
// > but will not match a regular file or a symbolic link foo
// >  (this is consistent with the way how pathspec works in general in Git).
// '`foo/`' will not match regular file '`foo`' or symbolic link '`foo`'
// -> ignore-rules will not deal with it, because it costs extra `fs.stat` call
//      you could use option `mark: true` with `glob`

// '`foo/`' should not continue with the '`..`'
var REPLACERS = [[
// remove BOM
// TODO:
// Other similar zero-width characters?
/^\uFEFF/, function () {
  return EMPTY;
}],
// > Trailing spaces are ignored unless they are quoted with backslash ("\")
[
// (a\ ) -> (a )
// (a  ) -> (a)
// (a ) -> (a)
// (a \ ) -> (a  )
/((?:\\\\)*?)(\\?\s+)$/, function (_, m1, m2) {
  return m1 + (m2.indexOf('\\') === 0 ? SPACE : EMPTY);
}],
// replace (\ ) with ' '
// (\ ) -> ' '
// (\\ ) -> '\\ '
// (\\\ ) -> '\\ '
[/(\\+?)\s/g, function (_, m1) {
  var length = m1.length;
  return m1.slice(0, length - length % 2) + SPACE;
}],
// Escape metacharacters
// which is written down by users but means special for regular expressions.

// > There are 12 characters with special meanings:
// > - the backslash \,
// > - the caret ^,
// > - the dollar sign $,
// > - the period or dot .,
// > - the vertical bar or pipe symbol |,
// > - the question mark ?,
// > - the asterisk or star *,
// > - the plus sign +,
// > - the opening parenthesis (,
// > - the closing parenthesis ),
// > - and the opening square bracket [,
// > - the opening curly brace {,
// > These special characters are often called "metacharacters".
[/[\\$.|*+(){^]/g, function (match) {
  return "\\".concat(match);
}], [
// > a question mark (?) matches a single character
/(?!\\)\?/g, function () {
  return '[^/]';
}],
// leading slash
[
// > A leading slash matches the beginning of the pathname.
// > For example, "/*.c" matches "cat-file.c" but not "mozilla-sha1/sha1.c".
// A leading slash matches the beginning of the pathname
/^\//, function () {
  return '^';
}],
// replace special metacharacter slash after the leading slash
[/\//g, function () {
  return '\\/';
}], [
// > A leading "**" followed by a slash means match in all directories.
// > For example, "**/foo" matches file or directory "foo" anywhere,
// > the same as pattern "foo".
// > "**/foo/bar" matches file or directory "bar" anywhere that is directly
// >   under directory "foo".
// Notice that the '*'s have been replaced as '\\*'
/^\^*\\\*\\\*\\\//,
// '**/foo' <-> 'foo'
function () {
  return '^(?:.*\\/)?';
}],
// starting
[
// there will be no leading '/'
//   (which has been replaced by section "leading slash")
// If starts with '**', adding a '^' to the regular expression also works
/^(?=[^^])/, function startingReplacer() {
  // If has a slash `/` at the beginning or middle
  return !/\/(?!$)/.test(this)
  // > Prior to 2.22.1
  // > If the pattern does not contain a slash /,
  // >   Git treats it as a shell glob pattern
  // Actually, if there is only a trailing slash,
  //   git also treats it as a shell glob pattern

  // After 2.22.1 (compatible but clearer)
  // > If there is a separator at the beginning or middle (or both)
  // > of the pattern, then the pattern is relative to the directory
  // > level of the particular .gitignore file itself.
  // > Otherwise the pattern may also match at any level below
  // > the .gitignore level.
  ? '(?:^|\\/)'

  // > Otherwise, Git treats the pattern as a shell glob suitable for
  // >   consumption by fnmatch(3)
  : '^';
}],
// two globstars
[
// Use lookahead assertions so that we could match more than one `'/**'`
/\\\/\\\*\\\*(?=\\\/|$)/g,
// Zero, one or several directories
// should not use '*', or it will be replaced by the next replacer

// Check if it is not the last `'/**'`
function (_, index, str) {
  return index + 6 < str.length

  // case: /**/
  // > A slash followed by two consecutive asterisks then a slash matches
  // >   zero or more directories.
  // > For example, "a/**/b" matches "a/b", "a/x/b", "a/x/y/b" and so on.
  // '/**/'
  ? '(?:\\/[^\\/]+)*'

  // case: /**
  // > A trailing `"/**"` matches everything inside.

  // #21: everything inside but it should not include the current folder
  : '\\/.+';
}],
// normal intermediate wildcards
[
// Never replace escaped '*'
// ignore rule '\*' will match the path '*'

// 'abc.*/' -> go
// 'abc.*'  -> skip this rule,
//    coz trailing single wildcard will be handed by [trailing wildcard]
/(^|[^\\]+)(\\\*)+(?=.+)/g,
// '*.js' matches '.js'
// '*.js' doesn't match 'abc'
function (_, p1, p2) {
  // 1.
  // > An asterisk "*" matches anything except a slash.
  // 2.
  // > Other consecutive asterisks are considered regular asterisks
  // > and will match according to the previous rules.
  var unescaped = p2.replace(/\\\*/g, '[^\\/]*');
  return p1 + unescaped;
}], [
// unescape, revert step 3 except for back slash
// For example, if a user escape a '\\*',
// after step 3, the result will be '\\\\\\*'
/\\\\\\(?=[$.|*+(){^])/g, function () {
  return ESCAPE;
}], [
// '\\\\' -> '\\'
/\\\\/g, function () {
  return ESCAPE;
}], [
// > The range notation, e.g. [a-zA-Z],
// > can be used to match one of the characters in a range.

// `\` is escaped by step 3
/(\\)?\[([^\]/]*?)(\\*)($|\])/g, function (match, leadEscape, range, endEscape, close) {
  return leadEscape === ESCAPE
  // '\\[bar]' -> '\\\\[bar\\]'
  ? "\\[".concat(range).concat(cleanRangeBackSlash(endEscape)).concat(close) : close === ']' ? endEscape.length % 2 === 0
  // A normal case, and it is a range notation
  // '[bar]'
  // '[bar\\\\]'
  ? "[".concat(sanitizeRange(range)).concat(endEscape, "]") // Invalid range notaton
  // '[bar\\]' -> '[bar\\\\]'
  : '[]' : '[]';
}],
// ending
[
// 'js' will not match 'js.'
// 'ab' will not match 'abc'
/(?:[^*])$/,
// WTF!
// https://git-scm.com/docs/gitignore
// changes in [2.22.1](https://git-scm.com/docs/gitignore/2.22.1)
// which re-fixes #24, #38

// > If there is a separator at the end of the pattern then the pattern
// > will only match directories, otherwise the pattern can match both
// > files and directories.

// 'js*' will not match 'a.js'
// 'js/' will not match 'a.js'
// 'js' will match 'a.js' and 'a.js/'
function (match) {
  return /\/$/.test(match)
  // foo/ will not match 'foo'
  ? "".concat(match, "$") // foo matches 'foo' and 'foo/'
  : "".concat(match, "(?=$|\\/$)");
}],
// trailing wildcard
[/(\^|\\\/)?\\\*$/, function (_, p1) {
  var prefix = p1
  // '\^':
  // '/*' does not match EMPTY
  // '/*' does not match everything

  // '\\\/':
  // 'abc/*' does not match 'abc/'
  ? "".concat(p1, "[^/]+") // 'a*' matches 'a'
  // 'a*' matches 'aa'
  : '[^/]*';
  return "".concat(prefix, "(?=$|\\/$)");
}]];

// A simple cache, because an ignore rule only has only one certain meaning
var regexCache = Object.create(null);

// @param {pattern}
var makeRegex = function makeRegex(pattern, ignoreCase) {
  var source = regexCache[pattern];
  if (!source) {
    source = REPLACERS.reduce(function (prev, _ref) {
      var _ref2 = _slicedToArray(_ref, 2),
        matcher = _ref2[0],
        replacer = _ref2[1];
      return prev.replace(matcher, replacer.bind(pattern));
    }, pattern);
    regexCache[pattern] = source;
  }
  return ignoreCase ? new RegExp(source, 'i') : new RegExp(source);
};
var isString = function isString(subject) {
  return typeof subject === 'string';
};

// > A blank line matches no files, so it can serve as a separator for readability.
var checkPattern = function checkPattern(pattern) {
  return pattern && isString(pattern) && !REGEX_TEST_BLANK_LINE.test(pattern) && !REGEX_INVALID_TRAILING_BACKSLASH.test(pattern)

  // > A line starting with # serves as a comment.
  && pattern.indexOf('#') !== 0;
};
var splitPattern = function splitPattern(pattern) {
  return pattern.split(REGEX_SPLITALL_CRLF);
};
var IgnoreRule = /*#__PURE__*/_createClass(function IgnoreRule(origin, pattern, negative, regex) {
  _classCallCheck(this, IgnoreRule);
  this.origin = origin;
  this.pattern = pattern;
  this.negative = negative;
  this.regex = regex;
});
var createRule = function createRule(pattern, ignoreCase) {
  var origin = pattern;
  var negative = false;

  // > An optional prefix "!" which negates the pattern;
  if (pattern.indexOf('!') === 0) {
    negative = true;
    pattern = pattern.substr(1);
  }
  pattern = pattern
  // > Put a backslash ("\") in front of the first "!" for patterns that
  // >   begin with a literal "!", for example, `"\!important!.txt"`.
  .replace(REGEX_REPLACE_LEADING_EXCAPED_EXCLAMATION, '!')
  // > Put a backslash ("\") in front of the first hash for patterns that
  // >   begin with a hash.
  .replace(REGEX_REPLACE_LEADING_EXCAPED_HASH, '#');
  var regex = makeRegex(pattern, ignoreCase);
  return new IgnoreRule(origin, pattern, negative, regex);
};
var throwError = function throwError(message, Ctor) {
  throw new Ctor(message);
};
var checkPath = function checkPath(path, originalPath, doThrow) {
  if (!isString(path)) {
    return doThrow("path must be a string, but got `".concat(originalPath, "`"), TypeError);
  }

  // We don't know if we should ignore EMPTY, so throw
  if (!path) {
    return doThrow("path must not be empty", TypeError);
  }

  // Check if it is a relative path
  if (checkPath.isNotRelative(path)) {
    var r = '`path.relative()`d';
    return doThrow("path should be a ".concat(r, " string, but got \"").concat(originalPath, "\""), RangeError);
  }
  return true;
};
var isNotRelative = function isNotRelative(path) {
  return REGEX_TEST_INVALID_PATH.test(path);
};
checkPath.isNotRelative = isNotRelative;
checkPath.convert = function (p) {
  return p;
};
var Ignore = /*#__PURE__*/function () {
  function Ignore() {
    var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
      _ref3$ignorecase = _ref3.ignorecase,
      ignorecase = _ref3$ignorecase === void 0 ? true : _ref3$ignorecase,
      _ref3$ignoreCase = _ref3.ignoreCase,
      ignoreCase = _ref3$ignoreCase === void 0 ? ignorecase : _ref3$ignoreCase,
      _ref3$allowRelativePa = _ref3.allowRelativePaths,
      allowRelativePaths = _ref3$allowRelativePa === void 0 ? false : _ref3$allowRelativePa;
    _classCallCheck(this, Ignore);
    define(this, KEY_IGNORE, true);
    this._rules = [];
    this._ignoreCase = ignoreCase;
    this._allowRelativePaths = allowRelativePaths;
    this._initCache();
  }
  _createClass(Ignore, [{
    key: "_initCache",
    value: function _initCache() {
      this._ignoreCache = Object.create(null);
      this._testCache = Object.create(null);
    }
  }, {
    key: "_addPattern",
    value: function _addPattern(pattern) {
      // #32
      if (pattern && pattern[KEY_IGNORE]) {
        this._rules = this._rules.concat(pattern._rules);
        this._added = true;
        return;
      }
      if (checkPattern(pattern)) {
        var rule = createRule(pattern, this._ignoreCase);
        this._added = true;
        this._rules.push(rule);
      }
    }

    // @param {Array<string> | string | Ignore} pattern
  }, {
    key: "add",
    value: function add(pattern) {
      this._added = false;
      makeArray(isString(pattern) ? splitPattern(pattern) : pattern).forEach(this._addPattern, this);

      // Some rules have just added to the ignore,
      // making the behavior changed.
      if (this._added) {
        this._initCache();
      }
      return this;
    }

    // legacy
  }, {
    key: "addPattern",
    value: function addPattern(pattern) {
      return this.add(pattern);
    }

    //          |           ignored : unignored
    // negative |   0:0   |   0:1   |   1:0   |   1:1
    // -------- | ------- | ------- | ------- | --------
    //     0    |  TEST   |  TEST   |  SKIP   |    X
    //     1    |  TESTIF |  SKIP   |  TEST   |    X

    // - SKIP: always skip
    // - TEST: always test
    // - TESTIF: only test if checkUnignored
    // - X: that never happen

    // @param {boolean} whether should check if the path is unignored,
    //   setting `checkUnignored` to `false` could reduce additional
    //   path matching.

    // @returns {TestResult} true if a file is ignored
  }, {
    key: "_testOne",
    value: function _testOne(path, checkUnignored) {
      var ignored = false;
      var unignored = false;
      this._rules.forEach(function (rule) {
        var negative = rule.negative;
        if (unignored === negative && ignored !== unignored || negative && !ignored && !unignored && !checkUnignored) {
          return;
        }
        var matched = rule.regex.test(path);
        if (matched) {
          ignored = !negative;
          unignored = negative;
        }
      });
      return {
        ignored: ignored,
        unignored: unignored
      };
    }

    // @returns {TestResult}
  }, {
    key: "_test",
    value: function _test(originalPath, cache, checkUnignored, slices) {
      var path = originalPath
      // Supports nullable path
      && checkPath.convert(originalPath);
      checkPath(path, originalPath, this._allowRelativePaths ? RETURN_FALSE : throwError);
      return this._t(path, cache, checkUnignored, slices);
    }
  }, {
    key: "_t",
    value: function _t(path, cache, checkUnignored, slices) {
      if (path in cache) {
        return cache[path];
      }
      if (!slices) {
        // path/to/a.js
        // ['path', 'to', 'a.js']
        slices = path.split(SLASH);
      }
      slices.pop();

      // If the path has no parent directory, just test it
      if (!slices.length) {
        return cache[path] = this._testOne(path, checkUnignored);
      }
      var parent = this._t(slices.join(SLASH) + SLASH, cache, checkUnignored, slices);

      // If the path contains a parent directory, check the parent first
      return cache[path] = parent.ignored
      // > It is not possible to re-include a file if a parent directory of
      // >   that file is excluded.
      ? parent : this._testOne(path, checkUnignored);
    }
  }, {
    key: "ignores",
    value: function ignores(path) {
      return this._test(path, this._ignoreCache, false).ignored;
    }
  }, {
    key: "createFilter",
    value: function createFilter() {
      var _this = this;
      return function (path) {
        return !_this.ignores(path);
      };
    }
  }, {
    key: "filter",
    value: function filter(paths) {
      return makeArray(paths).filter(this.createFilter());
    }

    // @returns {TestResult}
  }, {
    key: "test",
    value: function test(path) {
      return this._test(path, this._testCache, true);
    }
  }]);
  return Ignore;
}();
var factory = function factory(options) {
  return new Ignore(options);
};
var isPathValid = function isPathValid(path) {
  return checkPath(path && checkPath.convert(path), path, RETURN_FALSE);
};
factory.isPathValid = isPathValid;

// Fixes typescript
factory["default"] = factory;
module.exports = factory;

// Windows
// --------------------------------------------------------------
/* istanbul ignore if */
if (
// Detect `process` so that it can run in browsers.
typeof process !== 'undefined' && (process.env && process.env.IGNORE_TEST_WIN32 || process.platform === 'win32')) {
  /* eslint no-control-regex: "off" */
  var makePosix = function makePosix(str) {
    return /^\\\\\?\\/.test(str) || /[\0-\x1F"<>\|]+/.test(str) ? str : str.replace(/\\/g, '/');
  };
  checkPath.convert = makePosix;

  // 'C:\\foo'     <- 'C:\\foo' has been converted to 'C:/'
  // 'd:\\foo'
  var REGIX_IS_WINDOWS_PATH_ABSOLUTE = /^[a-z]:\//i;
  checkPath.isNotRelative = function (path) {
    return REGIX_IS_WINDOWS_PATH_ABSOLUTE.test(path) || isNotRelative(path);
  };
}
ϖx{
  "name": "ignore",
  "version": "5.3.2",
  "description": "Ignore is a manager and filter for .gitignore rules, the one used by eslint, gitbook and many others.",
  "files": [
    "legacy.js",
    "index.js",
    "index.d.ts",
    "LICENSE-MIT"
  ],
  "scripts": {
    "prepublishOnly": "npm run build",
    "build": "babel -o legacy.js index.js",
    "test:lint": "eslint .",
    "test:tsc": "tsc ./test/ts/simple.ts --lib ES6",
    "test:ts": "node ./test/ts/simple.js",
    "tap": "tap --reporter classic",
    "test:git": "npm run tap test/git-check-ignore.js",
    "test:ignore": "npm run tap test/ignore.js",
    "test:ignore:only": "IGNORE_ONLY_IGNORES=1 npm run tap test/ignore.js",
    "test:others": "npm run tap test/others.js",
    "test:cases": "npm run tap test/*.js -- --coverage",
    "test:no-coverage": "npm run tap test/*.js -- --no-check-coverage",
    "test:only": "npm run test:lint && npm run test:tsc && npm run test:ts && npm run test:cases",
    "test": "npm run test:only",
    "test:win32": "IGNORE_TEST_WIN32=1 npm run test",
    "report": "tap --coverage-report=html",
    "posttest": "npm run report && codecov"
  },
  "repository": {
    "type": "git",
    "url": "git@github.com:kaelzhang/node-ignore.git"
  },
  "keywords": [
    "ignore",
    ".gitignore",
    "gitignore",
    "npmignore",
    "rules",
    "manager",
    "filter",
    "regexp",
    "regex",
    "fnmatch",
    "glob",
    "asterisks",
    "regular-expression"
  ],
  "author": "kael",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/kaelzhang/node-ignore/issues"
  },
  "devDependencies": {
    "@babel/cli": "^7.22.9",
    "@babel/core": "^7.22.9",
    "@babel/preset-env": "^7.22.9",
    "codecov": "^3.8.2",
    "debug": "^4.3.4",
    "eslint": "^8.46.0",
    "eslint-config-ostai": "^3.0.0",
    "eslint-plugin-import": "^2.28.0",
    "mkdirp": "^3.0.1",
    "pre-suf": "^1.1.1",
    "rimraf": "^6.0.1",
    "spawn-sync": "^2.0.0",
    "tap": "^16.3.9",
    "tmp": "0.2.3",
    "typescript": "^5.1.6"
  },
  "engines": {
    "node": ">= 4"
  }
}
U
x Z100644 README.md [ [ioP4;100644 imurmurhash.js 1Fn'w;Wf100644 imurmurhash.min.js ki{~#g^oA_100644 package.json Z"E,d<歎șCxdiMurmurHash.js
==============

An incremental implementation of the MurmurHash3 (32-bit) hashing algorithm for JavaScript based on [Gary Court's implementation](https://github.com/garycourt/murmurhash-js) with [kazuyukitanimura's modifications](https://github.com/kazuyukitanimura/murmurhash-js).

This version works significantly faster than the non-incremental version if you need to hash many small strings into a single hash, since string concatenation (to build the single string to pass the non-incremental version) is fairly costly. In one case tested, using the incremental version was about 50% faster than concatenating 5-10 strings and then hashing.

Installation
------------

To use iMurmurHash in the browser, [download the latest version](https://raw.github.com/jensyt/imurmurhash-js/master/imurmurhash.min.js) and include it as a script on your site.

```html
<script type="text/javascript" src="/scripts/imurmurhash.min.js"></script>
<script>
// Your code here, access iMurmurHash using the global object MurmurHash3
</script>
```

---

To use iMurmurHash in Node.js, install the module using NPM:

```bash
npm install imurmurhash
```

Then simply include it in your scripts:

```javascript
MurmurHash3 = require('imurmurhash');
```

Quick Example
-------------

```javascript
// Create the initial hash
var hashState = MurmurHash3('string');

// Incrementally add text
hashState.hash('more strings');
hashState.hash('even more strings');

// All calls can be chained if desired
hashState.hash('and').hash('some').hash('more');

// Get a result
hashState.result();
// returns 0xe4ccfe6b
```

Functions
---------

### MurmurHash3 ([string], [seed])
Get a hash state object, optionally initialized with the given _string_ and _seed_. _Seed_ must be a positive integer if provided. Calling this function without the `new` keyword will return a cached state object that has been reset. This is safe to use as long as the object is only used from a single thread and no other hashes are created while operating on this one. If this constraint cannot be met, you can use `new` to create a new state object. For example:

```javascript
// Use the cached object, calling the function again will return the same
// object (but reset, so the current state would be lost)
hashState = MurmurHash3();
...

// Create a new object that can be safely used however you wish. Calling the
// function again will simply return a new state object, and no state loss
// will occur, at the cost of creating more objects.
hashState = new MurmurHash3();
```

Both methods can be mixed however you like if you have different use cases.

---

### MurmurHash3.prototype.hash (string)
Incrementally add _string_ to the hash. This can be called as many times as you want for the hash state object, including after a call to `result()`. Returns `this` so calls can be chained.

---

### MurmurHash3.prototype.result ()
Get the result of the hash as a 32-bit positive integer. This performs the tail and finalizer portions of the algorithm, but does not store the result in the state object. This means that it is perfectly safe to get results and then continue adding strings via `hash`.

```javascript
// Do the whole string at once
MurmurHash3('this is a test string').result();
// 0x70529328

// Do part of the string, get a result, then the other part
var m = MurmurHash3('this is a');
m.result();
// 0xbfc4f834
m.hash(' test string').result();
// 0x70529328 (same as above)
```

---

### MurmurHash3.prototype.reset ([seed])
Reset the state object for reuse, optionally using the given _seed_ (defaults to 0 like the constructor). Returns `this` so calls can be chained.

---

License (MIT)
-------------
Copyright (c) 2013 Gary Court, Jens Taylor

Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
h*Tʼx</**
 * @preserve
 * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
 *
 * @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
 * @see http://github.com/homebrewing/brauhaus-diff
 * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
 * @see http://github.com/garycourt/murmurhash-js
 * @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
 * @see http://sites.google.com/site/murmurhash/
 */
(function(){
    var cache;

    // Call this function without `new` to use the cached object (good for
    // single-threaded environments), or with `new` to create a new object.
    //
    // @param {string} key A UTF-16 or ASCII string
    // @param {number} seed An optional positive integer
    // @return {object} A MurmurHash3 object for incremental hashing
    function MurmurHash3(key, seed) {
        var m = this instanceof MurmurHash3 ? this : cache;
        m.reset(seed)
        if (typeof key === 'string' && key.length > 0) {
            m.hash(key);
        }

        if (m !== this) {
            return m;
        }
    };

    // Incrementally add a string to this hash
    //
    // @param {string} key A UTF-16 or ASCII string
    // @return {object} this
    MurmurHash3.prototype.hash = function(key) {
        var h1, k1, i, top, len;

        len = key.length;
        this.len += len;

        k1 = this.k1;
        i = 0;
        switch (this.rem) {
            case 0: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) : 0;
            case 1: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 8 : 0;
            case 2: k1 ^= len > i ? (key.charCodeAt(i++) & 0xffff) << 16 : 0;
            case 3:
                k1 ^= len > i ? (key.charCodeAt(i) & 0xff) << 24 : 0;
                k1 ^= len > i ? (key.charCodeAt(i++) & 0xff00) >> 8 : 0;
        }

        this.rem = (len + this.rem) & 3; // & 3 is same as % 4
        len -= this.rem;
        if (len > 0) {
            h1 = this.h1;
            while (1) {
                k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff;
                k1 = (k1 << 15) | (k1 >>> 17);
                k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff;

                h1 ^= k1;
                h1 = (h1 << 13) | (h1 >>> 19);
                h1 = (h1 * 5 + 0xe6546b64) & 0xffffffff;

                if (i >= len) {
                    break;
                }

                k1 = ((key.charCodeAt(i++) & 0xffff)) ^
                     ((key.charCodeAt(i++) & 0xffff) << 8) ^
                     ((key.charCodeAt(i++) & 0xffff) << 16);
                top = key.charCodeAt(i++);
                k1 ^= ((top & 0xff) << 24) ^
                      ((top & 0xff00) >> 8);
            }

            k1 = 0;
            switch (this.rem) {
                case 3: k1 ^= (key.charCodeAt(i + 2) & 0xffff) << 16;
                case 2: k1 ^= (key.charCodeAt(i + 1) & 0xffff) << 8;
                case 1: k1 ^= (key.charCodeAt(i) & 0xffff);
            }

            this.h1 = h1;
        }

        this.k1 = k1;
        return this;
    };

    // Get the result of this hash
    //
    // @return {number} The 32-bit hash
    MurmurHash3.prototype.result = function() {
        var k1, h1;
        
        k1 = this.k1;
        h1 = this.h1;

        if (k1 > 0) {
            k1 = (k1 * 0x2d51 + (k1 & 0xffff) * 0xcc9e0000) & 0xffffffff;
            k1 = (k1 << 15) | (k1 >>> 17);
            k1 = (k1 * 0x3593 + (k1 & 0xffff) * 0x1b870000) & 0xffffffff;
            h1 ^= k1;
        }

        h1 ^= this.len;

        h1 ^= h1 >>> 16;
        h1 = (h1 * 0xca6b + (h1 & 0xffff) * 0x85eb0000) & 0xffffffff;
        h1 ^= h1 >>> 13;
        h1 = (h1 * 0xae35 + (h1 & 0xffff) * 0xc2b20000) & 0xffffffff;
        h1 ^= h1 >>> 16;

        return h1 >>> 0;
    };

    // Reset the hash object for reuse
    //
    // @param {number} seed An optional positive integer
    MurmurHash3.prototype.reset = function(seed) {
        this.h1 = typeof seed === 'number' ? seed : 0;
        this.rem = this.k1 = this.len = 0;
        return this;
    };

    // A cached object to use. This can be safely used if you're in a single-
    // threaded environment, otherwise you need to create new hashes to use.
    cache = new MurmurHash3();

    if (typeof(module) != 'undefined') {
        module.exports = MurmurHash3;
    } else {
        this.MurmurHash3 = MurmurHash3;
    }
}());
vxf/**
 * @preserve
 * JS Implementation of incremental MurmurHash3 (r150) (as of May 10, 2013)
 *
 * @author <a href="mailto:jensyt@gmail.com">Jens Taylor</a>
 * @see http://github.com/homebrewing/brauhaus-diff
 * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
 * @see http://github.com/garycourt/murmurhash-js
 * @author <a href="mailto:aappleby@gmail.com">Austin Appleby</a>
 * @see http://sites.google.com/site/murmurhash/
 */
!function(){function t(h,r){var s=this instanceof t?this:e;return s.reset(r),"string"==typeof h&&h.length>0&&s.hash(h),s!==this?s:void 0}var e;t.prototype.hash=function(t){var e,h,r,s,i;switch(i=t.length,this.len+=i,h=this.k1,r=0,this.rem){case 0:h^=i>r?65535&t.charCodeAt(r++):0;case 1:h^=i>r?(65535&t.charCodeAt(r++))<<8:0;case 2:h^=i>r?(65535&t.charCodeAt(r++))<<16:0;case 3:h^=i>r?(255&t.charCodeAt(r))<<24:0,h^=i>r?(65280&t.charCodeAt(r++))>>8:0}if(this.rem=3&i+this.rem,i-=this.rem,i>0){for(e=this.h1;;){if(h=4294967295&11601*h+3432906752*(65535&h),h=h<<15|h>>>17,h=4294967295&13715*h+461832192*(65535&h),e^=h,e=e<<13|e>>>19,e=4294967295&5*e+3864292196,r>=i)break;h=65535&t.charCodeAt(r++)^(65535&t.charCodeAt(r++))<<8^(65535&t.charCodeAt(r++))<<16,s=t.charCodeAt(r++),h^=(255&s)<<24^(65280&s)>>8}switch(h=0,this.rem){case 3:h^=(65535&t.charCodeAt(r+2))<<16;case 2:h^=(65535&t.charCodeAt(r+1))<<8;case 1:h^=65535&t.charCodeAt(r)}this.h1=e}return this.k1=h,this},t.prototype.result=function(){var t,e;return t=this.k1,e=this.h1,t>0&&(t=4294967295&11601*t+3432906752*(65535&t),t=t<<15|t>>>17,t=4294967295&13715*t+461832192*(65535&t),e^=t),e^=this.len,e^=e>>>16,e=4294967295&51819*e+2246770688*(65535&e),e^=e>>>13,e=4294967295&44597*e+3266445312*(65535&e),e^=e>>>16,e>>>0},t.prototype.reset=function(t){return this.h1="number"==typeof t?t:0,this.rem=this.k1=this.len=0,this},e=new t,"undefined"!=typeof module?module.exports=t:this.MurmurHash3=t}();OJ3x2{
  "name": "imurmurhash",
  "version": "0.1.4",
  "description": "An incremental implementation of MurmurHash3",
  "homepage": "https://github.com/jensyt/imurmurhash-js",
  "main": "imurmurhash.js",
  "files": [
    "imurmurhash.js",
    "imurmurhash.min.js",
    "package.json",
    "README.md"
  ],
  "repository": {
    "type": "git",
    "url": "https://github.com/jensyt/imurmurhash-js"
  },
  "bugs": {
    "url": "https://github.com/jensyt/imurmurhash-js/issues"
  },
  "keywords": [
    "murmur",
    "murmurhash",
    "murmurhash3",
    "hash",
    "incremental"
  ],
  "author": {
    "name": "Jens Taylor",
    "email": "jensyt@gmail.com",
    "url": "https://github.com/homebrewing"
  },
  "license": "MIT",
  "dependencies": {
  },
  "devDependencies": {
  },
  "engines": {
    "node": ">=0.8.19"
  }
}
XbQ	x k100644 LICENSE "	&0^!t7R100644 README.md \2is1$100644 index.js نQ 0eO2An100644 package.json ziӟU(4]؛'-Mi<A3RCx?The MIT License (MIT)

Copyright (c) 2014-2016, Jon Schlinkert

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
_Xxr# is-extglob [![NPM version](https://img.shields.io/npm/v/is-extglob.svg?style=flat)](https://www.npmjs.com/package/is-extglob) [![NPM downloads](https://img.shields.io/npm/dm/is-extglob.svg?style=flat)](https://npmjs.org/package/is-extglob) [![Build Status](https://img.shields.io/travis/jonschlinkert/is-extglob.svg?style=flat)](https://travis-ci.org/jonschlinkert/is-extglob)

> Returns true if a string has an extglob.

## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm install --save is-extglob
```

## Usage

```js
var isExtglob = require('is-extglob');
```

**True**

```js
isExtglob('?(abc)');
isExtglob('@(abc)');
isExtglob('!(abc)');
isExtglob('*(abc)');
isExtglob('+(abc)');
```

**False**

Escaped extglobs:

```js
isExtglob('\\?(abc)');
isExtglob('\\@(abc)');
isExtglob('\\!(abc)');
isExtglob('\\*(abc)');
isExtglob('\\+(abc)');
```

Everything else...

```js
isExtglob('foo.js');
isExtglob('!foo.js');
isExtglob('*.js');
isExtglob('**/abc.js');
isExtglob('abc/*.js');
isExtglob('abc/(aaa|bbb).js');
isExtglob('abc/[a-z].js');
isExtglob('abc/{a,b}.js');
isExtglob('abc/?.js');
isExtglob('abc.js');
isExtglob('abc/def/ghi.js');
```

## History

**v2.0**

Adds support for escaping. Escaped exglobs no longer return true.

## About

### Related projects

* [has-glob](https://www.npmjs.com/package/has-glob): Returns `true` if an array has a glob pattern. | [homepage](https://github.com/jonschlinkert/has-glob "Returns `true` if an array has a glob pattern.")
* [is-glob](https://www.npmjs.com/package/is-glob): Returns `true` if the given string looks like a glob pattern or an extglob pattern… [more](https://github.com/jonschlinkert/is-glob) | [homepage](https://github.com/jonschlinkert/is-glob "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a bet")
* [micromatch](https://www.npmjs.com/package/micromatch): Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch. | [homepage](https://github.com/jonschlinkert/micromatch "Glob matching for javascript/node.js. A drop-in replacement and faster alternative to minimatch and multimatch.")

### Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

### Building docs

_(This document was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme) (a [verb](https://github.com/verbose/verb) generator), please don't edit the readme directly. Any changes to the readme must be made in [.verb.md](.verb.md).)_

To generate the readme and API documentation with [verb](https://github.com/verbose/verb):

```sh
$ npm install -g verb verb-generate-readme && verb
```

### Running tests

Install dev dependencies:

```sh
$ npm install -d && npm test
```

### Author

**Jon Schlinkert**

* [github/jonschlinkert](https://github.com/jonschlinkert)
* [twitter/jonschlinkert](http://twitter.com/jonschlinkert)

### License

Copyright © 2016, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT license](https://github.com/jonschlinkert/is-extglob/blob/master/LICENSE).

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.1.31, on October 12, 2016._ÚŹxF/*!
 * is-extglob <https://github.com/jonschlinkert/is-extglob>
 *
 * Copyright (c) 2014-2016, Jon Schlinkert.
 * Licensed under the MIT License.
 */

module.exports = function isExtglob(str) {
  if (typeof str !== 'string' || str === '') {
    return false;
  }

  var match;
  while ((match = /(\\).|([@?!+*]\(.*\))/g.exec(str))) {
    if (match[2]) return true;
    str = str.slice(match.index + match[0].length);
  }

  return false;
};
AtLx;{
  "name": "is-extglob",
  "description": "Returns true if a string has an extglob.",
  "version": "2.1.1",
  "homepage": "https://github.com/jonschlinkert/is-extglob",
  "author": "Jon Schlinkert (https://github.com/jonschlinkert)",
  "repository": "jonschlinkert/is-extglob",
  "bugs": {
    "url": "https://github.com/jonschlinkert/is-extglob/issues"
  },
  "license": "MIT",
  "files": [
    "index.js"
  ],
  "main": "index.js",
  "engines": {
    "node": ">=0.10.0"
  },
  "scripts": {
    "test": "mocha"
  },
  "devDependencies": {
    "gulp-format-md": "^0.1.10",
    "mocha": "^3.0.2"
  },
  "keywords": [
    "bash",
    "braces",
    "check",
    "exec",
    "expression",
    "extglob",
    "glob",
    "globbing",
    "globstar",
    "is",
    "match",
    "matches",
    "pattern",
    "regex",
    "regular",
    "string",
    "test"
  ],
  "verb": {
    "toc": false,
    "layout": "default",
    "tasks": [
      "readme"
    ],
    "plugins": [
      "gulp-format-md"
    ],
    "related": {
      "list": [
        "has-glob",
        "is-glob",
        "micromatch"
      ]
    },
    "reflinks": [
      "verb",
      "verb-generate-readme"
    ],
    "lint": {
      "reflinks": true
    }
  }
}
`#L	x k100644 LICENSE ?.1t,Q-100644 README.md t$v≮NΙ*KH100644 index.js bV>-ݥɘw100644 package.json 763SqȎ2w:x -7, Jon Schlinkert.>	bx# is-glob [![NPM version](https://img.shields.io/npm/v/is-glob.svg?style=flat)](https://www.npmjs.com/package/is-glob) [![NPM monthly downloads](https://img.shields.io/npm/dm/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![NPM total downloads](https://img.shields.io/npm/dt/is-glob.svg?style=flat)](https://npmjs.org/package/is-glob) [![Build Status](https://img.shields.io/github/workflow/status/micromatch/is-glob/dev)](https://github.com/micromatch/is-glob/actions)

> Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.

Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.

## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm install --save is-glob
```

You might also be interested in [is-valid-glob](https://github.com/jonschlinkert/is-valid-glob) and [has-glob](https://github.com/jonschlinkert/has-glob).

## Usage

```js
var isGlob = require('is-glob');
```

### Default behavior

**True**

Patterns that have glob characters or regex patterns will return `true`:

```js
isGlob('!foo.js');
isGlob('*.js');
isGlob('**/abc.js');
isGlob('abc/*.js');
isGlob('abc/(aaa|bbb).js');
isGlob('abc/[a-z].js');
isGlob('abc/{a,b}.js');
//=> true
```

Extglobs

```js
isGlob('abc/@(a).js');
isGlob('abc/!(a).js');
isGlob('abc/+(a).js');
isGlob('abc/*(a).js');
isGlob('abc/?(a).js');
//=> true
```

**False**

Escaped globs or extglobs return `false`:

```js
isGlob('abc/\\@(a).js');
isGlob('abc/\\!(a).js');
isGlob('abc/\\+(a).js');
isGlob('abc/\\*(a).js');
isGlob('abc/\\?(a).js');
isGlob('\\!foo.js');
isGlob('\\*.js');
isGlob('\\*\\*/abc.js');
isGlob('abc/\\*.js');
isGlob('abc/\\(aaa|bbb).js');
isGlob('abc/\\[a-z].js');
isGlob('abc/\\{a,b}.js');
//=> false
```

Patterns that do not have glob patterns return `false`:

```js
isGlob('abc.js');
isGlob('abc/def/ghi.js');
isGlob('foo.js');
isGlob('abc/@.js');
isGlob('abc/+.js');
isGlob('abc/?.js');
isGlob();
isGlob(null);
//=> false
```

Arrays are also `false` (If you want to check if an array has a glob pattern, use [has-glob](https://github.com/jonschlinkert/has-glob)):

```js
isGlob(['**/*.js']);
isGlob(['foo.js']);
//=> false
```

### Option strict

When `options.strict === false` the behavior is less strict in determining if a pattern is a glob. Meaning that
some patterns that would return `false` may return `true`. This is done so that matching libraries like [micromatch](https://github.com/micromatch/micromatch) have a chance at determining if the pattern is a glob or not.

**True**

Patterns that have glob characters or regex patterns will return `true`:

```js
isGlob('!foo.js', {strict: false});
isGlob('*.js', {strict: false});
isGlob('**/abc.js', {strict: false});
isGlob('abc/*.js', {strict: false});
isGlob('abc/(aaa|bbb).js', {strict: false});
isGlob('abc/[a-z].js', {strict: false});
isGlob('abc/{a,b}.js', {strict: false});
//=> true
```

Extglobs

```js
isGlob('abc/@(a).js', {strict: false});
isGlob('abc/!(a).js', {strict: false});
isGlob('abc/+(a).js', {strict: false});
isGlob('abc/*(a).js', {strict: false});
isGlob('abc/?(a).js', {strict: false});
//=> true
```

**False**

Escaped globs or extglobs return `false`:

```js
isGlob('\\!foo.js', {strict: false});
isGlob('\\*.js', {strict: false});
isGlob('\\*\\*/abc.js', {strict: false});
isGlob('abc/\\*.js', {strict: false});
isGlob('abc/\\(aaa|bbb).js', {strict: false});
isGlob('abc/\\[a-z].js', {strict: false});
isGlob('abc/\\{a,b}.js', {strict: false});
//=> false
```

## About

<details>
<summary><strong>Contributing</strong></summary>

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

</details>

<details>
<summary><strong>Running Tests</strong></summary>

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

```sh
$ npm install && npm test
```

</details>

<details>
<summary><strong>Building docs</strong></summary>

_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_

To generate the readme, run the following command:

```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```

</details>

### Related projects

You might also be interested in these projects:

* [assemble](https://www.npmjs.com/package/assemble): Get the rocks out of your socks! Assemble makes you fast at creating web projects… [more](https://github.com/assemble/assemble) | [homepage](https://github.com/assemble/assemble "Get the rocks out of your socks! Assemble makes you fast at creating web projects. Assemble is used by thousands of projects for rapid prototyping, creating themes, scaffolds, boilerplates, e-books, UI components, API documentation, blogs, building websit")
* [base](https://www.npmjs.com/package/base): Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks | [homepage](https://github.com/node-base/base "Framework for rapidly creating high quality, server-side node.js applications, using plugins like building blocks")
* [update](https://www.npmjs.com/package/update): Be scalable! Update is a new, open source developer framework and CLI for automating updates… [more](https://github.com/update/update) | [homepage](https://github.com/update/update "Be scalable! Update is a new, open source developer framework and CLI for automating updates of any kind in code projects.")
* [verb](https://www.npmjs.com/package/verb): Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used… [more](https://github.com/verbose/verb) | [homepage](https://github.com/verbose/verb "Documentation generator for GitHub projects. Verb is extremely powerful, easy to use, and is used on hundreds of projects of all sizes to generate everything from API docs to readmes.")

### Contributors

| **Commits** | **Contributor** |  
| --- | --- |  
| 47 | [jonschlinkert](https://github.com/jonschlinkert) |  
| 5  | [doowb](https://github.com/doowb) |  
| 1  | [phated](https://github.com/phated) |  
| 1  | [danhper](https://github.com/danhper) |  
| 1  | [paulmillr](https://github.com/paulmillr) |  

### Author

**Jon Schlinkert**

* [GitHub Profile](https://github.com/jonschlinkert)
* [Twitter Profile](https://twitter.com/jonschlinkert)
* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)

### License

Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on March 27, 2019._6x,/*!
 * is-glob <https://github.com/jonschlinkert/is-glob>
 *
 * Copyright (c) 2014-2017, Jon Schlinkert.
 * Released under the MIT License.
 */

var isExtglob = require('is-extglob');
var chars = { '{': '}', '(': ')', '[': ']'};
var strictCheck = function(str) {
  if (str[0] === '!') {
    return true;
  }
  var index = 0;
  var pipeIndex = -2;
  var closeSquareIndex = -2;
  var closeCurlyIndex = -2;
  var closeParenIndex = -2;
  var backSlashIndex = -2;
  while (index < str.length) {
    if (str[index] === '*') {
      return true;
    }

    if (str[index + 1] === '?' && /[\].+)]/.test(str[index])) {
      return true;
    }

    if (closeSquareIndex !== -1 && str[index] === '[' && str[index + 1] !== ']') {
      if (closeSquareIndex < index) {
        closeSquareIndex = str.indexOf(']', index);
      }
      if (closeSquareIndex > index) {
        if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
          return true;
        }
        backSlashIndex = str.indexOf('\\', index);
        if (backSlashIndex === -1 || backSlashIndex > closeSquareIndex) {
          return true;
        }
      }
    }

    if (closeCurlyIndex !== -1 && str[index] === '{' && str[index + 1] !== '}') {
      closeCurlyIndex = str.indexOf('}', index);
      if (closeCurlyIndex > index) {
        backSlashIndex = str.indexOf('\\', index);
        if (backSlashIndex === -1 || backSlashIndex > closeCurlyIndex) {
          return true;
        }
      }
    }

    if (closeParenIndex !== -1 && str[index] === '(' && str[index + 1] === '?' && /[:!=]/.test(str[index + 2]) && str[index + 3] !== ')') {
      closeParenIndex = str.indexOf(')', index);
      if (closeParenIndex > index) {
        backSlashIndex = str.indexOf('\\', index);
        if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
          return true;
        }
      }
    }

    if (pipeIndex !== -1 && str[index] === '(' && str[index + 1] !== '|') {
      if (pipeIndex < index) {
        pipeIndex = str.indexOf('|', index);
      }
      if (pipeIndex !== -1 && str[pipeIndex + 1] !== ')') {
        closeParenIndex = str.indexOf(')', pipeIndex);
        if (closeParenIndex > pipeIndex) {
          backSlashIndex = str.indexOf('\\', pipeIndex);
          if (backSlashIndex === -1 || backSlashIndex > closeParenIndex) {
            return true;
          }
        }
      }
    }

    if (str[index] === '\\') {
      var open = str[index + 1];
      index += 2;
      var close = chars[open];

      if (close) {
        var n = str.indexOf(close, index);
        if (n !== -1) {
          index = n + 1;
        }
      }

      if (str[index] === '!') {
        return true;
      }
    } else {
      index++;
    }
  }
  return false;
};

var relaxedCheck = function(str) {
  if (str[0] === '!') {
    return true;
  }
  var index = 0;
  while (index < str.length) {
    if (/[*?{}()[\]]/.test(str[index])) {
      return true;
    }

    if (str[index] === '\\') {
      var open = str[index + 1];
      index += 2;
      var close = chars[open];

      if (close) {
        var n = str.indexOf(close, index);
        if (n !== -1) {
          index = n + 1;
        }
      }

      if (str[index] === '!') {
        return true;
      }
    } else {
      index++;
    }
  }
  return false;
};

module.exports = function isGlob(str, options) {
  if (typeof str !== 'string' || str === '') {
    return false;
  }

  if (isExtglob(str)) {
    return true;
  }

  var check = strictCheck;

  // optionally relax check
  if (options && options.strict === false) {
    check = relaxedCheck;
  }

  return check(str);
};
Emx+{
  "name": "is-glob",
  "description": "Returns `true` if the given string looks like a glob pattern or an extglob pattern. This makes it easy to create code that only uses external modules like node-glob when necessary, resulting in much faster code execution and initialization time, and a better user experience.",
  "version": "4.0.3",
  "homepage": "https://github.com/micromatch/is-glob",
  "author": "Jon Schlinkert (https://github.com/jonschlinkert)",
  "contributors": [
    "Brian Woodward (https://twitter.com/doowb)",
    "Daniel Perez (https://tuvistavie.com)",
    "Jon Schlinkert (http://twitter.com/jonschlinkert)"
  ],
  "repository": "micromatch/is-glob",
  "bugs": {
    "url": "https://github.com/micromatch/is-glob/issues"
  },
  "license": "MIT",
  "files": [
    "index.js"
  ],
  "main": "index.js",
  "engines": {
    "node": ">=0.10.0"
  },
  "scripts": {
    "test": "mocha && node benchmark.js"
  },
  "dependencies": {
    "is-extglob": "^2.1.1"
  },
  "devDependencies": {
    "gulp-format-md": "^0.1.10",
    "mocha": "^3.0.2"
  },
  "keywords": [
    "bash",
    "braces",
    "check",
    "exec",
    "expression",
    "extglob",
    "glob",
    "globbing",
    "globstar",
    "is",
    "match",
    "matches",
    "pattern",
    "regex",
    "regular",
    "string",
    "test"
  ],
  "verb": {
    "layout": "default",
    "plugins": [
      "gulp-format-md"
    ],
    "related": {
      "list": [
        "assemble",
        "base",
        "update",
        "verb"
      ]
    },
    "reflinks": [
      "assemble",
      "bach",
      "base",
      "composer",
      "gulp",
      "has-glob",
      "is-valid-glob",
      "micromatch",
      "npm",
      "scaffold",
      "verb",
      "vinyl"
    ]
  }
}
Yx"100644 .npmignore uzXl,,<-_100644 LICENSE 1_哖Z/PS.100644 README.md 5v@erNԣa100644 index.js U?+.>C100644 mode.js JPe	Ad9100644 package.json RhB+\jny40000 test @L2[i
 F˅7&k	n100644 windows.js 4g49!YgmyŌ:Aox .nyc_output/
coverage/
hG/xThe ISC License

Copyright (c) Isaac Z. Schlueter and Contributors

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
4_Wxs# isexe

Minimal module to check if a file is executable, and a normal file.

Uses `fs.stat` and tests against the `PATHEXT` environment variable on
Windows.

## USAGE

```javascript
var isexe = require('isexe')
isexe('some-file-name', function (err, isExe) {
  if (err) {
    console.error('probably file does not exist or something', err)
  } else if (isExe) {
    console.error('this thing can be run')
  } else {
    console.error('cannot be run')
  }
})

// same thing but synchronous, throws errors
var isExe = isexe.sync('some-file-name')

// treat errors as just "not executable"
isexe('maybe-missing-file', { ignoreErrors: true }, callback)
var isExe = isexe.sync('maybe-missing-file', { ignoreErrors: true })
```

## API

### `isexe(path, [options], [callback])`

Check if the path is executable.  If no callback provided, and a
global `Promise` object is available, then a Promise will be returned.

Will raise whatever errors may be raised by `fs.stat`, unless
`options.ignoreErrors` is set to true.

### `isexe.sync(path, [options])`

Same as `isexe` but returns the value and throws any errors raised.

### Options

* `ignoreErrors` Treat all errors as "no, this is not executable", but
  don't raise them.
* `uid` Number to use as the user id
* `gid` Number to use as the group id
* `pathExt` List of path extensions to use instead of `PATHEXT`
  environment variable on Windows.
7ڞJxWvar fs = require('fs')
var core
if (process.platform === 'win32' || global.TESTING_WINDOWS) {
  core = require('./windows.js')
} else {
  core = require('./mode.js')
}

module.exports = isexe
isexe.sync = sync

function isexe (path, options, cb) {
  if (typeof options === 'function') {
    cb = options
    options = {}
  }

  if (!cb) {
    if (typeof Promise !== 'function') {
      throw new TypeError('callback not provided')
    }

    return new Promise(function (resolve, reject) {
      isexe(path, options || {}, function (er, is) {
        if (er) {
          reject(er)
        } else {
          resolve(is)
        }
      })
    })
  }

  core(path, options || {}, function (er, is) {
    // ignore EACCES because that just means we aren't allowed to run it
    if (er) {
      if (er.code === 'EACCES' || options && options.ignoreErrors) {
        er = null
        is = false
      }
    }
    cb(er, is)
  })
}

function sync (path, options) {
  // my kingdom for a filtered catch
  try {
    return core.sync(path, options || {})
  } catch (er) {
    if (options && options.ignoreErrors || er.code === 'EACCES') {
      return false
    } else {
      throw er
    }
  }
}
be8xrmodule.exports = isexe
isexe.sync = sync

var fs = require('fs')

function isexe (path, options, cb) {
  fs.stat(path, function (er, stat) {
    cb(er, er ? false : checkStat(stat, options))
  })
}

function sync (path, options) {
  return checkStat(fs.statSync(path), options)
}

function checkStat (stat, options) {
  return stat.isFile() && checkMode(stat, options)
}

function checkMode (stat, options) {
  var mod = stat.mode
  var uid = stat.uid
  var gid = stat.gid

  var myUid = options.uid !== undefined ?
    options.uid : process.getuid && process.getuid()
  var myGid = options.gid !== undefined ?
    options.gid : process.getgid && process.getgid()

  var u = parseInt('100', 8)
  var g = parseInt('010', 8)
  var o = parseInt('001', 8)
  var ug = u | g

  var ret = (mod & o) ||
    (mod & g) && gid === myGid ||
    (mod & u) && uid === myUid ||
    (mod & ug) && myUid === 0

  return ret
}
!1x{
  "name": "isexe",
  "version": "2.0.0",
  "description": "Minimal module to check if a file is executable.",
  "main": "index.js",
  "directories": {
    "test": "test"
  },
  "devDependencies": {
    "mkdirp": "^0.5.1",
    "rimraf": "^2.5.0",
    "tap": "^10.3.0"
  },
  "scripts": {
    "test": "tap test/*.js --100",
    "preversion": "npm test",
    "postversion": "npm publish",
    "postpublish": "git push origin --all; git push origin --tags"
  },
  "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
  "license": "ISC",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/isaacs/isexe.git"
  },
  "keywords": [],
  "bugs": {
    "url": "https://github.com/isaacs/isexe/issues"
  },
  "homepage": "https://github.com/isaacs/isexe#readme"
}
x$ 100644 basic.js &dE|)%~ʜgSܴδx{var t = require('tap')
var fs = require('fs')
var path = require('path')
var fixture = path.resolve(__dirname, 'fixtures')
var meow = fixture + '/meow.cat'
var mine = fixture + '/mine.cat'
var ours = fixture + '/ours.cat'
var fail = fixture + '/fail.false'
var noent = fixture + '/enoent.exe'
var mkdirp = require('mkdirp')
var rimraf = require('rimraf')

var isWindows = process.platform === 'win32'
var hasAccess = typeof fs.access === 'function'
var winSkip = isWindows && 'windows'
var accessSkip = !hasAccess && 'no fs.access function'
var hasPromise = typeof Promise === 'function'
var promiseSkip = !hasPromise && 'no global Promise'

function reset () {
  delete require.cache[require.resolve('../')]
  return require('../')
}

t.test('setup fixtures', function (t) {
  rimraf.sync(fixture)
  mkdirp.sync(fixture)
  fs.writeFileSync(meow, '#!/usr/bin/env cat\nmeow\n')
  fs.chmodSync(meow, parseInt('0755', 8))
  fs.writeFileSync(fail, '#!/usr/bin/env false\n')
  fs.chmodSync(fail, parseInt('0644', 8))
  fs.writeFileSync(mine, '#!/usr/bin/env cat\nmine\n')
  fs.chmodSync(mine, parseInt('0744', 8))
  fs.writeFileSync(ours, '#!/usr/bin/env cat\nours\n')
  fs.chmodSync(ours, parseInt('0754', 8))
  t.end()
})

t.test('promise', { skip: promiseSkip }, function (t) {
  var isexe = reset()
  t.test('meow async', function (t) {
    isexe(meow).then(function (is) {
      t.ok(is)
      t.end()
    })
  })
  t.test('fail async', function (t) {
    isexe(fail).then(function (is) {
      t.notOk(is)
      t.end()
    })
  })
  t.test('noent async', function (t) {
    isexe(noent).catch(function (er) {
      t.ok(er)
      t.end()
    })
  })
  t.test('noent ignore async', function (t) {
    isexe(noent, { ignoreErrors: true }).then(function (is) {
      t.notOk(is)
      t.end()
    })
  })
  t.end()
})

t.test('no promise', function (t) {
  global.Promise = null
  var isexe = reset()
  t.throws('try to meow a promise', function () {
    isexe(meow)
  })
  t.end()
})

t.test('access', { skip: accessSkip || winSkip }, function (t) {
  runTest(t)
})

t.test('mode', { skip: winSkip }, function (t) {
  delete fs.access
  delete fs.accessSync
  var isexe = reset()
  t.ok(isexe.sync(ours, { uid: 0, gid: 0 }))
  t.ok(isexe.sync(mine, { uid: 0, gid: 0 }))
  runTest(t)
})

t.test('windows', function (t) {
  global.TESTING_WINDOWS = true
  var pathExt = '.EXE;.CAT;.CMD;.COM'
  t.test('pathExt option', function (t) {
    runTest(t, { pathExt: '.EXE;.CAT;.CMD;.COM' })
  })
  t.test('pathExt env', function (t) {
    process.env.PATHEXT = pathExt
    runTest(t)
  })
  t.test('no pathExt', function (t) {
    // with a pathExt of '', any filename is fine.
    // so the "fail" one would still pass.
    runTest(t, { pathExt: '', skipFail: true })
  })
  t.test('pathext with empty entry', function (t) {
    // with a pathExt of '', any filename is fine.
    // so the "fail" one would still pass.
    runTest(t, { pathExt: ';' + pathExt, skipFail: true })
  })
  t.end()
})

t.test('cleanup', function (t) {
  rimraf.sync(fixture)
  t.end()
})

function runTest (t, options) {
  var isexe = reset()

  var optionsIgnore = Object.create(options || {})
  optionsIgnore.ignoreErrors = true

  if (!options || !options.skipFail) {
    t.notOk(isexe.sync(fail, options))
  }
  t.notOk(isexe.sync(noent, optionsIgnore))
  if (!options) {
    t.ok(isexe.sync(meow))
  } else {
    t.ok(isexe.sync(meow, options))
  }

  t.ok(isexe.sync(mine, options))
  t.ok(isexe.sync(ours, options))
  t.throws(function () {
    isexe.sync(noent, options)
  })

  t.test('meow async', function (t) {
    if (!options) {
      isexe(meow, function (er, is) {
        if (er) {
          throw er
        }
        t.ok(is)
        t.end()
      })
    } else {
      isexe(meow, options, function (er, is) {
        if (er) {
          throw er
        }
        t.ok(is)
        t.end()
      })
    }
  })

  t.test('mine async', function (t) {
    isexe(mine, options, function (er, is) {
      if (er) {
        throw er
      }
      t.ok(is)
      t.end()
    })
  })

  t.test('ours async', function (t) {
    isexe(ours, options, function (er, is) {
      if (er) {
        throw er
      }
      t.ok(is)
      t.end()
    })
  })

  if (!options || !options.skipFail) {
    t.test('fail async', function (t) {
      isexe(fail, options, function (er, is) {
        if (er) {
          throw er
        }
        t.notOk(is)
        t.end()
      })
    })
  }

  t.test('noent async', function (t) {
    isexe(noent, options, function (er, is) {
      t.ok(er)
      t.notOk(is)
      t.end()
    })
  })

  t.test('noent ignore async', function (t) {
    isexe(noent, optionsIgnore, function (er, is) {
      if (er) {
        throw er
      }
      t.notOk(is)
      t.end()
    })
  })

  t.test('directory is not executable', function (t) {
    isexe(__dirname, options, function (er, is) {
      if (er) {
        throw er
      }
      t.notOk(is)
      t.end()
    })
  })

  t.end()
}
{禺7xzmodule.exports = isexe
isexe.sync = sync

var fs = require('fs')

function checkPathExt (path, options) {
  var pathext = options.pathExt !== undefined ?
    options.pathExt : process.env.PATHEXT

  if (!pathext) {
    return true
  }

  pathext = pathext.split(';')
  if (pathext.indexOf('') !== -1) {
    return true
  }
  for (var i = 0; i < pathext.length; i++) {
    var p = pathext[i].toLowerCase()
    if (p && path.substr(-p.length).toLowerCase() === p) {
      return true
    }
  }
  return false
}

function checkStat (stat, path, options) {
  if (!stat.isSymbolicLink() && !stat.isFile()) {
    return false
  }
  return checkPathExt(path, options)
}

function isexe (path, options, cb) {
  fs.stat(path, function (er, stat) {
    cb(er, er ? false : checkStat(stat, path, options))
  })
}

function sync (path, options) {
  return checkStat(fs.statSync(path), path, options)
}
px %100644 .travis.yml $K~'<Ͻ:TQYX100644 LICENSE  ĖqBӚ&100644 README.md Gs1;w}Q W5100644 index.js sI"Śl100644 package.json 4gGBDB%40000 test ͢8>c$yDEY@vQ1x& language: node_js
node_js:
  - '0.10'
UQxVCopyright (c) 2013 Dominic Tarr0
to any person [&
 6
deal in the Software without restriction, including 
% copy, modify, 
3 P7
the  
subject to the following C

shall be  @ 9 NONINFRINGEMENT. 
* HOLDERS BE LIABLE FOR 
\& "
TORT OR OTHERWISE, ARISING '
SOFTWARE OR THE USE OR  -f)xl# json-buffer

JSON functions that can convert buffers!

[![build status](https://secure.travis-ci.org/dominictarr/json-buffer.png)](http://travis-ci.org/dominictarr/json-buffer)

[![testling badge](https://ci.testling.com/dominictarr/json-buffer.png)](https://ci.testling.com/dominictarr/json-buffer)

JSON mangles buffers by converting to an array...
which isn't helpful. json-buffers converts to base64 instead,
and deconverts base64 to a buffer.

``` js
var JSONB = require('json-buffer')
var Buffer = require('buffer').Buffer

var str = JSONB.stringify(Buffer.from('hello there!'))

console.log(JSONB.parse(str)) //GET a BUFFER back
```

## License

MIT
F|^x//TODO: handle reviver/dehydrate function like normal
//and handle indentation, like normal.
//if anyone needs this... please send pull request.

exports.stringify = function stringify (o) {
  if('undefined' == typeof o) return o

  if(o && Buffer.isBuffer(o))
    return JSON.stringify(':base64:' + o.toString('base64'))

  if(o && o.toJSON)
    o =  o.toJSON()

  if(o && 'object' === typeof o) {
    var s = ''
    var array = Array.isArray(o)
    s = array ? '[' : '{'
    var first = true

    for(var k in o) {
      var ignore = 'function' == typeof o[k] || (!array && 'undefined' === typeof o[k])
      if(Object.hasOwnProperty.call(o, k) && !ignore) {
        if(!first)
          s += ','
        first = false
        if (array) {
          if(o[k] == undefined)
            s += 'null'
          else
            s += stringify(o[k])
        } else if (o[k] !== void(0)) {
          s += stringify(k) + ':' + stringify(o[k])
        }
      }
    }

    s += array ? ']' : '}'

    return s
  } else if ('string' === typeof o) {
    return JSON.stringify(/^:/.test(o) ? ':' + o : o)
  } else if ('undefined' === typeof o) {
    return 'null';
  } else
    return JSON.stringify(o)
}

exports.parse = function (s) {
  return JSON.parse(s, function (key, value) {
    if('string' === typeof value) {
      if(/^:base64:/.test(value))
        return Buffer.from(value.substring(8), 'base64')
      else
        return /^:/.test(value) ? value.substring(1) : value 
    }
    return value
  })
}
da<6xn{
  "name": "json-buffer",
  "description": "JSON parse & stringify that supports binary via bops & base64",
  "version": "3.0.1",
  "homepage": "https://github.com/dominictarr/json-buffer",
  "repository": {
    "type": "git",
    "url": "git://github.com/dominictarr/json-buffer.git"
  },
  "devDependencies": {
    "tape": "^4.6.3"
  },
  "scripts": {
    "test": "set -e; for t in test/*.js; do node $t; done"
  },
  "author": "Dominic Tarr <dominic.tarr@gmail.com> (http://dominictarr.com)",
  "license": "MIT",
  "testling": {
    "files": "test/*.js",
    "browsers": [
      "ie/8..latest",
      "firefox/17..latest",
      "firefox/nightly",
      "chrome/22..latest",
      "chrome/canary",
      "opera/12..latest",
      "opera/next",
      "safari/5.1..latest",
      "ipad/6.0..latest",
      "iphone/6.0..latest",
      "android-browser/4.2..latest"
    ]
  }
}
դx$ 100644 index.js 7 }VHbH4\܀Nx
var test = require('tape')
var _JSON = require('../')

function clone (o) {
  return JSON.parse(JSON.stringify(o))
}

var examples = {
  simple: { foo: [], bar: {}, baz: Buffer.from('some binary data') },
  just_buffer: Buffer.from('JUST A BUFFER'),
  all_types: {
    string:'hello',
    number: 3145,
    null: null,
    object: {},
    array: [],
    boolean: true,
    boolean2: false
  },
  foo: Buffer.from('foo'),
  foo2: Buffer.from('foo2'),
  escape: {
    buffer: Buffer.from('x'),
    string: _JSON.stringify(Buffer.from('x'))
  },
  escape2: {
    buffer: Buffer.from('x'),
    string: ':base64:'+ Buffer.from('x').toString('base64')
  },
  undefined: {
    empty: undefined, test: true
  },
  undefined2: {
    first: 1, empty: undefined, test: true
  },
  undefinedArray: {
    array: [undefined, 1, 'two']
  },
  fn: {
    fn: function () {}    
  },
  undefined: undefined
}

for(k in examples)
(function (value, k) { 
  test(k, function (t) {
    var s = _JSON.stringify(value)
    console.log('parse', s)
    if(JSON.stringify(value) !== undefined) {
      console.log(s)
      var _value = _JSON.parse(s)
      t.deepEqual(clone(_value), clone(value))
    }
    else
      t.equal(s, undefined)
    t.end()
  })
})(examples[k], k)



yx100644 .eslintrc.yml bڜ6B	qmId100644 .travis.yml }KO+ooogli100644 LICENSE CVojuM&Qω100644 README.md ̯E
*+ZwW%c100644 index.js ԡ{S/bjK%`J100644 package.json f2{Ţ=k640000 spec χzL(;/v~Xe#'xvextends: eslint:recommended
env:
  node: true
  browser: true
rules:
  block-scoped-var: 2
  complexity: [2, 13]
  curly: [2, multi-or-nest, consistent]
  dot-location: [2, property]
  dot-notation: 2
  indent: [2, 2, SwitchCase: 1]
  linebreak-style: [2, unix]
  new-cap: 2
  no-console: [2, allow: [warn, error]]
  no-else-return: 2
  no-eq-null: 2
  no-fallthrough: 2
  no-invalid-this: 2
  no-return-assign: 2
  no-shadow: 1
  no-trailing-spaces: 2
  no-use-before-define: [2, nofunc]
  quotes: [2, single, avoid-escape]
  semi: [2, always]
  strict: [2, global]
  valid-jsdoc: [2, requireReturn: false]
  no-control-regex: 0
̵xl language: node_js
node_js:
  - "4"
  - "6"
  - "7"
  - "8"
after_script:
  - coveralls < coverage/lcov.info
i'x
y# json-schema-traverse
Traverse JSON Schema passing each schema object to callback

[![Build Status](https://travis-ci.org/epoberezkin/json-schema-traverse.svg?branch=master)](https://travis-ci.org/epoberezkin/json-schema-traverse)
[![npm version](https://badge.fury.io/js/json-schema-traverse.svg)](https://www.npmjs.com/package/json-schema-traverse)
[![Coverage Status](https://coveralls.io/repos/github/epoberezkin/json-schema-traverse/badge.svg?branch=master)](https://coveralls.io/github/epoberezkin/json-schema-traverse?branch=master)


## Install

```
npm install json-schema-traverse
```


## Usage

```javascript
const traverse = require('json-schema-traverse');
const schema = {
  properties: {
    foo: {type: 'string'},
    bar: {type: 'integer'}
  }
};

traverse(schema, {cb});
// cb is called 3 times with:
// 1. root schema
// 2. {type: 'string'}
// 3. {type: 'integer'}

// Or:

traverse(schema, {cb: {pre, post}});
// pre is called 3 times with:
// 1. root schema
// 2. {type: 'string'}
// 3. {type: 'integer'}
//
// post is called 3 times with:
// 1. {type: 'string'}
// 2. {type: 'integer'}
// 3. root schema

```

Callback function `cb` is called for each schema object (not including draft-06 boolean schemas), including the root schema, in pre-order traversal. Schema references ($ref) are not resolved, they are passed as is.  Alternatively, you can pass a `{pre, post}` object as `cb`, and then `pre` will be called before traversing child elements, and `post` will be called after all child elements have been traversed.

Callback is passed these parameters:

- _schema_: the current schema object
- _JSON pointer_: from the root schema to the current schema object
- _root schema_: the schema passed to `traverse` object
- _parent JSON pointer_: from the root schema to the parent schema object (see below)
- _parent keyword_: the keyword inside which this schema appears (e.g. `properties`, `anyOf`, etc.)
- _parent schema_: not necessarily parent object/array; in the example above the parent schema for `{type: 'string'}` is the root schema
- _index/property_: index or property name in the array/object containing multiple schemas; in the example above for `{type: 'string'}` the property name is `'foo'`


## Traverse objects in all unknown keywords

```javascript
const traverse = require('json-schema-traverse');
const schema = {
  mySchema: {
    minimum: 1,
    maximum: 2
  }
};

traverse(schema, {allKeys: true, cb});
// cb is called 2 times with:
// 1. root schema
// 2. mySchema
```

Without option `allKeys: true` callback will be called only with root schema.


## License

[MIT](https://github.com/epoberezkin/json-schema-traverse/blob/master/LICENSE)
ԵxE	'use strict';

var traverse = module.exports = function (schema, opts, cb) {
  // Legacy support for v0.3.1 and earlier.
  if (typeof opts == 'function') {
    cb = opts;
    opts = {};
  }

  cb = opts.cb || cb;
  var pre = (typeof cb == 'function') ? cb : cb.pre || function() {};
  var post = cb.post || function() {};

  _traverse(opts, pre, post, schema, '', schema);
};


traverse.keywords = {
  additionalItems: true,
  items: true,
  contains: true,
  additionalProperties: true,
  propertyNames: true,
  not: true
};

traverse.arrayKeywords = {
  items: true,
  allOf: true,
  anyOf: true,
  oneOf: true
};

traverse.propsKeywords = {
  definitions: true,
  properties: true,
  patternProperties: true,
  dependencies: true
};

traverse.skipKeywords = {
  default: true,
  enum: true,
  const: true,
  required: true,
  maximum: true,
  minimum: true,
  exclusiveMaximum: true,
  exclusiveMinimum: true,
  multipleOf: true,
  maxLength: true,
  minLength: true,
  pattern: true,
  format: true,
  maxItems: true,
  minItems: true,
  uniqueItems: true,
  maxProperties: true,
  minProperties: true
};


function _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {
  if (schema && typeof schema == 'object' && !Array.isArray(schema)) {
    pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
    for (var key in schema) {
      var sch = schema[key];
      if (Array.isArray(sch)) {
        if (key in traverse.arrayKeywords) {
          for (var i=0; i<sch.length; i++)
            _traverse(opts, pre, post, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i);
        }
      } else if (key in traverse.propsKeywords) {
        if (sch && typeof sch == 'object') {
          for (var prop in sch)
            _traverse(opts, pre, post, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);
        }
      } else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) {
        _traverse(opts, pre, post, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema);
      }
    }
    post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);
  }
}


function escapeJsonPtr(str) {
  return str.replace(/~/g, '~0').replace(/\//g, '~1');
}
,T?x{
  "name": "json-schema-traverse",
  "version": "0.4.1",
  "description": "Traverse JSON Schema passing each schema object to callback",
  "main": "index.js",
  "scripts": {
    "eslint": "eslint index.js spec",
    "test-spec": "mocha spec -R spec",
    "test": "npm run eslint && nyc npm run test-spec"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/epoberezkin/json-schema-traverse.git"
  },
  "keywords": [
    "JSON-Schema",
    "traverse",
    "iterate"
  ],
  "author": "Evgeny Poberezkin",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/epoberezkin/json-schema-traverse/issues"
  },
  "homepage": "https://github.com/epoberezkin/json-schema-traverse#readme",
  "devDependencies": {
    "coveralls": "^2.13.1",
    "eslint": "^3.19.0",
    "mocha": "^3.4.2",
    "nyc": "^11.0.2",
    "pre-commit": "^1.2.2"
  },
  "nyc": {
    "exclude": [
      "**/spec/**",
      "node_modules"
    ],
    "reporter": [
      "lcov",
      "text-summary"
    ]
  }
}
%xu 100644 .eslintrc.yml 3D~#Mops@40000 fixtures P/bV#100644 index.spec.js kdg|b
VU033˻x[ parserOptions:
  ecmaVersion: 6
globals:
  beforeEach: false
  describe: false
  it: false
Kx% 100644 schema.js 0O(<|G/<K,xW'use strict';

var schema = {
  additionalItems: subschema('additionalItems'),
  items: subschema('items'),
  contains: subschema('contains'),
  additionalProperties: subschema('additionalProperties'),
  propertyNames: subschema('propertyNames'),
  not: subschema('not'),
  allOf: [
    subschema('allOf_0'),
    subschema('allOf_1'),
    {
      items: [
        subschema('items_0'),
        subschema('items_1'),
      ]
    }
  ],
  anyOf: [
    subschema('anyOf_0'),
    subschema('anyOf_1'),
  ],
  oneOf: [
    subschema('oneOf_0'),
    subschema('oneOf_1'),
  ],
  definitions: {
    foo: subschema('definitions_foo'),
    bar: subschema('definitions_bar'),
  },
  properties: {
    foo: subschema('properties_foo'),
    bar: subschema('properties_bar'),
  },
  patternProperties: {
    foo: subschema('patternProperties_foo'),
    bar: subschema('patternProperties_bar'),
  },
  dependencies: {
    foo: subschema('dependencies_foo'),
    bar: subschema('dependencies_bar'),
  },
  required: ['foo', 'bar']
};


function subschema(keyword) {
  var sch = {
    properties: {},
    additionalProperties: false,
    additionalItems: false,
    anyOf: [
      {format: 'email'},
      {format: 'hostname'}
    ]
  };
  sch.properties['foo_' + keyword] = {title: 'foo'};
  sch.properties['bar_' + keyword] = {title: 'bar'};
  return sch;
}


module.exports = {
  schema: schema,

  // schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex
  expectedCalls: [[schema, '', schema, undefined, undefined, undefined, undefined]]
    .concat(expectedCalls('additionalItems'))
    .concat(expectedCalls('items'))
    .concat(expectedCalls('contains'))
    .concat(expectedCalls('additionalProperties'))
    .concat(expectedCalls('propertyNames'))
    .concat(expectedCalls('not'))
    .concat(expectedCallsChild('allOf', 0))
    .concat(expectedCallsChild('allOf', 1))
    .concat([
      [schema.allOf[2], '/allOf/2', schema, '', 'allOf', schema, 2],
      [schema.allOf[2].items[0], '/allOf/2/items/0', schema, '/allOf/2', 'items', schema.allOf[2], 0],
      [schema.allOf[2].items[0].properties.foo_items_0, '/allOf/2/items/0/properties/foo_items_0', schema, '/allOf/2/items/0', 'properties', schema.allOf[2].items[0], 'foo_items_0'],
      [schema.allOf[2].items[0].properties.bar_items_0, '/allOf/2/items/0/properties/bar_items_0', schema, '/allOf/2/items/0', 'properties', schema.allOf[2].items[0], 'bar_items_0'],
      [schema.allOf[2].items[0].anyOf[0], '/allOf/2/items/0/anyOf/0', schema, '/allOf/2/items/0', 'anyOf', schema.allOf[2].items[0], 0],
      [schema.allOf[2].items[0].anyOf[1], '/allOf/2/items/0/anyOf/1', schema, '/allOf/2/items/0', 'anyOf', schema.allOf[2].items[0], 1],

      [schema.allOf[2].items[1], '/allOf/2/items/1', schema, '/allOf/2', 'items', schema.allOf[2], 1],
      [schema.allOf[2].items[1].properties.foo_items_1, '/allOf/2/items/1/properties/foo_items_1', schema, '/allOf/2/items/1', 'properties', schema.allOf[2].items[1], 'foo_items_1'],
      [schema.allOf[2].items[1].properties.bar_items_1, '/allOf/2/items/1/properties/bar_items_1', schema, '/allOf/2/items/1', 'properties', schema.allOf[2].items[1], 'bar_items_1'],
      [schema.allOf[2].items[1].anyOf[0], '/allOf/2/items/1/anyOf/0', schema, '/allOf/2/items/1', 'anyOf', schema.allOf[2].items[1], 0],
      [schema.allOf[2].items[1].anyOf[1], '/allOf/2/items/1/anyOf/1', schema, '/allOf/2/items/1', 'anyOf', schema.allOf[2].items[1], 1]
    ])
    .concat(expectedCallsChild('anyOf', 0))
    .concat(expectedCallsChild('anyOf', 1))
    .concat(expectedCallsChild('oneOf', 0))
    .concat(expectedCallsChild('oneOf', 1))
    .concat(expectedCallsChild('definitions', 'foo'))
    .concat(expectedCallsChild('definitions', 'bar'))
    .concat(expectedCallsChild('properties', 'foo'))
    .concat(expectedCallsChild('properties', 'bar'))
    .concat(expectedCallsChild('patternProperties', 'foo'))
    .concat(expectedCallsChild('patternProperties', 'bar'))
    .concat(expectedCallsChild('dependencies', 'foo'))
    .concat(expectedCallsChild('dependencies', 'bar'))
};


function expectedCalls(keyword) {
  return [
    [schema[keyword], `/${keyword}`, schema, '', keyword, schema, undefined],
    [schema[keyword].properties[`foo_${keyword}`], `/${keyword}/properties/foo_${keyword}`, schema, `/${keyword}`, 'properties', schema[keyword], `foo_${keyword}`],
    [schema[keyword].properties[`bar_${keyword}`], `/${keyword}/properties/bar_${keyword}`, schema, `/${keyword}`, 'properties', schema[keyword], `bar_${keyword}`],
    [schema[keyword].anyOf[0], `/${keyword}/anyOf/0`, schema, `/${keyword}`, 'anyOf', schema[keyword], 0],
    [schema[keyword].anyOf[1], `/${keyword}/anyOf/1`, schema, `/${keyword}`, 'anyOf', schema[keyword], 1]
  ];
}


function expectedCallsChild(keyword, i) {
  return [
    [schema[keyword][i], `/${keyword}/${i}`, schema, '', keyword, schema, i],
    [schema[keyword][i].properties[`foo_${keyword}_${i}`], `/${keyword}/${i}/properties/foo_${keyword}_${i}`, schema, `/${keyword}/${i}`, 'properties', schema[keyword][i], `foo_${keyword}_${i}`],
    [schema[keyword][i].properties[`bar_${keyword}_${i}`], `/${keyword}/${i}/properties/bar_${keyword}_${i}`, schema, `/${keyword}/${i}`, 'properties', schema[keyword][i], `bar_${keyword}_${i}`],
    [schema[keyword][i].anyOf[0], `/${keyword}/${i}/anyOf/0`, schema, `/${keyword}/${i}`, 'anyOf', schema[keyword][i], 0],
    [schema[keyword][i].anyOf[1], `/${keyword}/${i}/anyOf/1`, schema, `/${keyword}/${i}`, 'anyOf', schema[keyword][i], 1]
  ];
}
 Exe'use strict';

var traverse = require('../index');
var assert = require('assert');

describe('json-schema-traverse', function() {
  var calls;

  beforeEach(function() {
    calls = [];
  });

  it('should traverse all keywords containing schemas recursively', function() {
    var schema = require('./fixtures/schema').schema;
    var expectedCalls = require('./fixtures/schema').expectedCalls;

    traverse(schema, {cb: callback});
    assert.deepStrictEqual(calls, expectedCalls);
  });

  describe('Legacy v0.3.1 API', function() {
    it('should traverse all keywords containing schemas recursively', function() {
      var schema = require('./fixtures/schema').schema;
      var expectedCalls = require('./fixtures/schema').expectedCalls;

      traverse(schema, callback);
      assert.deepStrictEqual(calls, expectedCalls);
    });

    it('should work when an options object is provided', function() {
      // schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex
      var schema = require('./fixtures/schema').schema;
      var expectedCalls = require('./fixtures/schema').expectedCalls;

      traverse(schema, {}, callback);
      assert.deepStrictEqual(calls, expectedCalls);
    });
  });


  describe('allKeys option', function() {
    var schema = {
      someObject: {
        minimum: 1,
        maximum: 2
      }
    };

    it('should traverse objects with allKeys: true option', function() {
      // schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex
      var expectedCalls = [
        [schema, '', schema, undefined, undefined, undefined, undefined],
        [schema.someObject, '/someObject', schema, '', 'someObject', schema, undefined]
      ];

      traverse(schema, {allKeys: true, cb: callback});
      assert.deepStrictEqual(calls, expectedCalls);
    });


    it('should NOT traverse objects with allKeys: false option', function() {
      // schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex
      var expectedCalls = [
        [schema, '', schema, undefined, undefined, undefined, undefined]
      ];

      traverse(schema, {allKeys: false, cb: callback});
      assert.deepStrictEqual(calls, expectedCalls);
    });


    it('should NOT traverse objects without allKeys option', function() {
      // schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex
      var expectedCalls = [
        [schema, '', schema, undefined, undefined, undefined, undefined]
      ];

      traverse(schema, {cb: callback});
      assert.deepStrictEqual(calls, expectedCalls);
    });


    it('should NOT travers objects in standard keywords which value is not a schema', function() {
      var schema2 = {
        const: {foo: 'bar'},
        enum: ['a', 'b'],
        required: ['foo'],
        another: {

        },
        patternProperties: {}, // will not traverse - no properties
        dependencies: true, // will not traverse - invalid
        properties: {
          smaller: {
            type: 'number'
          },
          larger: {
            type: 'number',
            minimum: {$data: '1/smaller'}
          }
        }
      };

      // schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex
      var expectedCalls = [
        [schema2, '', schema2, undefined, undefined, undefined, undefined],
        [schema2.another, '/another', schema2, '', 'another', schema2, undefined],
        [schema2.properties.smaller, '/properties/smaller', schema2, '', 'properties', schema2, 'smaller'],
        [schema2.properties.larger, '/properties/larger', schema2, '', 'properties', schema2, 'larger'],
      ];

      traverse(schema2, {allKeys: true, cb: callback});
      assert.deepStrictEqual(calls, expectedCalls);
    });
  });

  describe('pre and post', function() {
    var schema = {
      type: 'object',
      properties: {
        name: {type: 'string'},
        age: {type: 'number'}
      }
    };

    it('should traverse schema in pre-order', function() {
      traverse(schema, {cb: {pre}});
      var expectedCalls = [
        ['pre', schema, '', schema, undefined, undefined, undefined, undefined],
        ['pre', schema.properties.name, '/properties/name', schema, '', 'properties', schema, 'name'],
        ['pre', schema.properties.age, '/properties/age', schema, '', 'properties', schema, 'age'],
      ];
      assert.deepStrictEqual(calls, expectedCalls);
    });

    it('should traverse schema in post-order', function() {
      traverse(schema, {cb: {post}});
      var expectedCalls = [
        ['post', schema.properties.name, '/properties/name', schema, '', 'properties', schema, 'name'],
        ['post', schema.properties.age, '/properties/age', schema, '', 'properties', schema, 'age'],
        ['post', schema, '', schema, undefined, undefined, undefined, undefined],
      ];
      assert.deepStrictEqual(calls, expectedCalls);
    });

    it('should traverse schema in pre- and post-order at the same time', function() {
      traverse(schema, {cb: {pre, post}});
      var expectedCalls = [
        ['pre', schema, '', schema, undefined, undefined, undefined, undefined],
        ['pre', schema.properties.name, '/properties/name', schema, '', 'properties', schema, 'name'],
        ['post', schema.properties.name, '/properties/name', schema, '', 'properties', schema, 'name'],
        ['pre', schema.properties.age, '/properties/age', schema, '', 'properties', schema, 'age'],
        ['post', schema.properties.age, '/properties/age', schema, '', 'properties', schema, 'age'],
        ['post', schema, '', schema, undefined, undefined, undefined, undefined],
      ];
      assert.deepStrictEqual(calls, expectedCalls);
    });
  });

  function callback() {
    calls.push(Array.prototype.slice.call(arguments));
  }

  function pre() {
    calls.push(['pre'].concat(Array.prototype.slice.call(arguments)));
  }

  function post() {
    calls.push(['post'].concat(Array.prototype.slice.call(arguments)));
  }
});
qިx(100644 .npmignore <6)G%H.3{&4100644 .travis.yml M)Y{[100644 LICENSE 'KDZؠf40000 example m&cu!zE䐌@J3>100644 index.js {qV5SPfqJ100644 package.json Ŝ\3Y4pn8&100644 readme.markdown [F#/.-$ф40000 test %ۖ_Њ;_,o&0y=x node_modules
%M	x0 language: node_js
node_js:
  - "0.8"
  - "0.10"
{Sx10This software is released under the MIT license:C= 
* "
the Software without 7
use, 5A copies of
/ 
 K included in all
Fp EXPRESS OR
4: OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND 01
COPYRIGHT l<	 WHETHER
4 FROM, OUT OF OR IN
* $ Z̿=x {
  "name": "json-stable-stringify-without-jsonify",
  "version": "1.0.1",
  "description": "deterministic JSON.stringify() with custom sorting to get deterministic hashes from stringified results, with no public domain dependencies",
  "main": "index.js",
  "dependencies": {
  },
  "devDependencies": {
    "tape": "~1.0.4"
  },
  "scripts": {
    "test": "tape test/*.js"
  },
  "testling": {
    "files": "test/*.js",
    "browsers": [
      "ie/8..latest",
      "ff/5", "ff/latest",
      "chrome/15", "chrome/latest",
      "safari/latest",
      "opera/latest"
    ]
  },
  "repository": {
    "type": "git",
    "url": "git://github.com/samn/json-stable-stringify.git"
  },
  "homepage": "https://github.com/samn/json-stable-stringify",
  "keywords": [
    "json",
    "stringify",
    "deterministic",
    "hash",
    "sort",
    "stable"
  ],
  "author": {
    "name": "James Halliday",
    "email": "mail@substack.net",
    "url": "http://substack.net"
  },
  "license": "MIT"
}
J'x
0# json-stable-stringify

This is the same as https://github.com/substack/json-stable-stringify but it doesn't depend on libraries without licenses (jsonify).

deterministic version of `JSON.stringify()` so you can get a consistent hash
from stringified results

You can also pass in a custom comparison function.

[![browser support](https://ci.testling.com/substack/json-stable-stringify.png)](https://ci.testling.com/substack/json-stable-stringify)

[![build status](https://secure.travis-ci.org/substack/json-stable-stringify.png)](http://travis-ci.org/substack/json-stable-stringify)

# example

``` js
var stringify = require('json-stable-stringify');
var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 };
console.log(stringify(obj));
```

output:

```
{"a":3,"b":[{"x":4,"y":5,"z":6},7],"c":8}
```

# methods

``` js
var stringify = require('json-stable-stringify')
```

## var str = stringify(obj, opts)

Return a deterministic stringified string `str` from the object `obj`.

## options

### cmp

If `opts` is given, you can supply an `opts.cmp` to have a custom comparison
function for object keys. Your function `opts.cmp` is called with these
parameters:

``` js
opts.cmp({ key: akey, value: avalue }, { key: bkey, value: bvalue })
```

For example, to sort on the object key names in reverse order you could write:

``` js
var stringify = require('json-stable-stringify');

var obj = { c: 8, b: [{z:6,y:5,x:4},7], a: 3 };
var s = stringify(obj, function (a, b) {
    return a.key < b.key ? 1 : -1;
});
console.log(s);
```

which results in the output string:

```
{"c":8,"b":[{"z":6,"y":5,"x":4},7],"a":3}
```

Or if you wanted to sort on the object values in reverse order, you could write:

```
var stringify = require('json-stable-stringify');

var obj = { d: 6, c: 5, b: [{z:3,y:2,x:1},9], a: 10 };
var s = stringify(obj, function (a, b) {
    return a.value < b.value ? 1 : -1;
});
console.log(s);
```

which outputs:

```
{"d":6,"c":5,"b":[{"z":3,"y":2,"x":1},9],"a":10}
```

### space

If you specify `opts.space`, it will indent the output for pretty-printing.
Valid values are strings (e.g. `{space: \t}`) or a number of spaces
(`{space: 3}`).

For example:

```js
var obj = { b: 1, a: { foo: 'bar', and: [1, 2, 3] } };
var s = stringify(obj, { space: '  ' });
console.log(s);
```

which outputs:

```
{
  "a": {
    "and": [
      1,
      2,
      3
    ],
    "foo": "bar"
  },
  "b": 1
}
```

### replacer

The replacer parameter is a function `opts.replacer(key, value)` that behaves
the same as the replacer
[from the core JSON object](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Using_native_JSON#The_replacer_parameter).

# install

With [npm](https://npmjs.org) do:

```
npm install json-stable-stringify
```

# license

MIT
'x %100644 cmp.js -95\e+=Z:%H,S100644 nested.js ,}d;)b>Q,
-rH100644 replacer.js *r^ǸJ100644 space.js &!*wX$*,+Nc100644 str.js gBk"ecw100644 to-json.js 	)*G :` fOhx OzCx5 	'	d
    var y = { b: x, c: x }>=kmx.var test = require('tape');
var stringify = require('../');

test('replace root', function (t) {
	t.plan(1);

	var obj = { a: 1, b: 2, c: false };
	var replacer = function(key, value) { return 'one'; };

	t.equal(stringify(obj, { replacer: replacer }), '"one"');
});

test('replace numbers', function (t) {
	t.plan(1);

	var obj = { a: 1, b: 2, c: false };
	var replacer = function(key, value) {
		if(value === 1) return 'one';
		if(value === 2) return 'two';
		return value;
	};

	t.equal(stringify(obj, { replacer: replacer }), '{"a":"one","b":"two","c":false}');
});

test('replace with object', function (t) {
	t.plan(1);

	var obj = { a: 1, b: 2, c: false };
	var replacer = function(key, value) {
		if(key === 'b') return { d: 1 };
		if(value === 1) return 'one';
		return value;
	};

	t.equal(stringify(obj, { replacer: replacer }), '{"a":"one","b":{"d":"one"},"c":false}');
});

test('replace with undefined', function (t) {
	t.plan(1);

	var obj = { a: 1, b: 2, c: false };
	var replacer = function(key, value) {
		if(value === false) return;
		return value;
	};

	t.equal(stringify(obj, { replacer: replacer }), '{"a":1,"b":2}');
});

test('replace with array', function (t) {
	t.plan(1);

	var obj = { a: 1, b: 2, c: false };
	var replacer = function(key, value) {
		if(key === 'b') return ['one', 'two'];
		return value;
	};

	t.equal(stringify(obj, { replacer: replacer }), '{"a":1,"b":["one","two"],"c":false}');
});

test('replace array item', function (t) {
	t.plan(1);

	var obj = { a: 1, b: 2, c: [1,2] };
	var replacer = function(key, value) {
		if(value === 1) return 'one';
		if(value === 2) return 'two';
		return value;
	};

	t.equal(stringify(obj, { replacer: replacer }), '{"a":"one","b":"two","c":["one","two"]}');
});
KƹYxfvar test = require('tape');
var stringify = require('../');

test('space parameter', function (t) {
    t.plan(1);
    var obj = { one: 1, two: 2 };
    t.equal(stringify(obj, {space: '  '}), ''
        + '{\n'
        + '  "one": 1,\n'
        + '  "two": 2\n'
        + '}'
    );
});

test('space parameter (with tabs)', function (t) {
    t.plan(1);
    var obj = { one: 1, two: 2 };
    t.equal(stringify(obj, {space: '\t'}), ''
        + '{\n'
        + '\t"one": 1,\n'
        + '\t"two": 2\n'
        + '}'
    );
});

test('space parameter (with a number)', function (t) {
    t.plan(1);
    var obj = { one: 1, two: 2 };
    t.equal(stringify(obj, {space: 3}), ''
        + '{\n'
        + '   "one": 1,\n'
        + '   "two": 2\n'
        + '}'
    );
});

test('space parameter (nested objects)', function (t) {
    t.plan(1);
    var obj = { one: 1, two: { b: 4, a: [2,3] } };
    t.equal(stringify(obj, {space: '  '}), ''
        + '{\n'
        + '  "one": 1,\n'
        + '  "two": {\n'
        + '    "a": [\n'
        + '      2,\n'
        + '      3\n'
        + '    ],\n'
        + '    "b": 4\n'
        + '  }\n'
        + '}'
    );
});

test('space parameter (same as native)', function (t) {
    t.plan(1);
    // for this test, properties need to be in alphabetical order
    var obj = { one: 1, two: { a: [2,3], b: 4 } };
    t.equal(stringify(obj, {space: '  '}), JSON.stringify(obj, null, '  '));
});
+sL
x T	t.plan(1);
	L	|&+	t.plan(1);
	var obj = [4, undefined, 6];
	<C	t.plan(1);
	'' };
	_$	t.plan(1);
	var obj = [4, '', 6];
	Vۍ-LxF 	t.plan(1);
	?D	S	t.plan(1);
	?8['one']; } };
	7(x5100644 LICENSE 7C>;z]X*_{100644 README.md xeI 3G0100644 cli.js Qэ>bchK840000 contrib | M,Q40000 dist uVI@c,evp100644 katex.ts Ga8n-Pe100644 package.json ӏ>|MPˉ40000 src xTL}OHI_p$E_Xgv40000 types 0xFMfr8߳ExSThe MIT License (MIT)

Copyright (c) 2013-2020 Khan Academy and other contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
'`x]<h1><a href="https://katex.org/">
  <picture>
    <source media="(prefers-color-scheme: dark)" srcset="https://katex.org/img/katex-logo.svg">
    <img alt="KaTeX" width=130 src="https://katex.org/img/katex-logo-black.svg">
  </picture>
</a></h1>

[![npm](https://img.shields.io/npm/v/katex.svg)](https://www.npmjs.com/package/katex)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![CI](https://github.com/KaTeX/KaTeX/workflows/CI/badge.svg?branch=main&event=push)](https://github.com/KaTeX/KaTeX/actions?query=workflow%3ACI)
[![codecov](https://codecov.io/gh/KaTeX/KaTeX/branch/main/graph/badge.svg)](https://codecov.io/gh/KaTeX/KaTeX)
[![Discussions](https://img.shields.io/badge/Discussions-join-brightgreen)](https://github.com/KaTeX/KaTeX/discussions)
[![jsDelivr](https://data.jsdelivr.com/v1/package/npm/katex/badge?style=rounded)](https://www.jsdelivr.com/package/npm/katex)
![katex.min.js size](https://img.badgesize.io/https://unpkg.com/katex/dist/katex.min.js?compression=gzip)
[![Gitpod ready-to-code](https://img.shields.io/badge/Gitpod-ready--to--code-blue?logo=gitpod)](https://gitpod.io/#https://github.com/KaTeX/KaTeX)
[![Financial Contributors on Open Collective](https://opencollective.com/katex/all/badge.svg?label=financial+contributors)](https://opencollective.com/katex)

KaTeX is a fast, easy-to-use JavaScript library for TeX math rendering on the web.

 * **Fast:** KaTeX renders its math synchronously and doesn't need to reflow the page. See how it compares to a competitor in [this speed test](https://www.intmath.com/cg5/katex-mathjax-comparison.php).
 * **Print quality:** KaTeX's layout is based on Donald Knuth's TeX, the gold standard for math typesetting.
 * **Self contained:** KaTeX has no dependencies and can easily be bundled with your website resources.
 * **Server side rendering:** KaTeX produces the same output regardless of browser or environment, so you can pre-render expressions using Node.js and send them as plain HTML.

KaTeX is compatible with all major browsers, including Chrome, Safari, Firefox, Opera, and Edge.

KaTeX supports much (but not all) of LaTeX and many LaTeX packages. See the [list of supported functions](https://katex.org/docs/supported.html).

Try out KaTeX [on the demo page](https://katex.org/#demo)!

## Getting started

### Starter template

```html
<!DOCTYPE html>
<!-- KaTeX requires the use of the HTML5 doctype. Without it, KaTeX may not render properly -->
<html>
  <head>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.47/dist/katex.min.css" integrity="sha384-nH0MfJ44wi1dd7w6jinlyBgljjS8EJAh2JBoRad8a3VDw2K69vfaaqm4WnR+gXtA" crossorigin="anonymous">

    <!-- The loading of KaTeX is deferred to speed up page rendering -->
    <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.47/dist/katex.min.js" integrity="sha384-CwjPRVHTvLiMBFjEoij+QZViMV5rhTOIp7CJzl24JEqpRDA1sJFHVXXLURktbYYp" crossorigin="anonymous"></script>

    <!-- To automatically render math in text elements, include the auto-render extension: -->
    <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.47/dist/contrib/auto-render.min.js" integrity="sha384-bjyGPfbij8/NDKJhSGZNP/khQVgtHUE5exjm4Ydllo42FwIgYsdLO2lXGmRBf5Mz" crossorigin="anonymous"
        onload="renderMathInElement(document.body);"></script>
  </head>
  ...
</html>
```

You can also [download KaTeX](https://github.com/KaTeX/KaTeX/releases) and host it yourself.

For details on how to configure auto-render extension, refer to [the documentation](https://katex.org/docs/autorender.html).

### API

Call `katex.render` to render a TeX expression directly into a DOM element.
For example:

```js
katex.render("c = \\pm\\sqrt{a^2 + b^2}", element, {
    throwOnError: false
});
```

Call `katex.renderToString` to generate an HTML string of the rendered math,
e.g., for server-side rendering.  For example:

```js
var html = katex.renderToString("c = \\pm\\sqrt{a^2 + b^2}", {
    throwOnError: false
});
// '<span class="katex">...</span>'
```

Make sure to include the CSS and font files in both cases.
If you are doing all rendering on the server, there is no need to include the
JavaScript on the client.

The examples above use the `throwOnError: false` option, which renders invalid
inputs as the TeX source code in red (by default), with the error message as
hover text.  For other available options, see the
[API documentation](https://katex.org/docs/api.html),
[options documentation](https://katex.org/docs/options.html), and
[handling errors documentation](https://katex.org/docs/error.html).

## Demo and Documentation

Learn more about using KaTeX [on the website](https://katex.org)!

## Contributors

### Code Contributors

This project exists thanks to all the people who contribute code. If you'd like to help, see [our guide to contributing code](CONTRIBUTING.md).
<a href="https://github.com/KaTeX/KaTeX/graphs/contributors"><img src="https://contributors-svg.opencollective.com/katex/contributors.svg?width=890&button=false" alt="Code contributors" /></a>

### Financial Contributors

Become a financial contributor and help us sustain our community.

#### Individuals

<a href="https://opencollective.com/katex"><img src="https://opencollective.com/katex/individuals.svg?width=890" alt="Contribute on Open Collective"></a>

#### Organizations

Support this project with your organization. Your logo will show up here with a link to your website.

<a href="https://opencollective.com/katex/organization/0/website"><img src="https://opencollective.com/katex/organization/0/avatar.svg" alt="Organization 1"></a>
<a href="https://opencollective.com/katex/organization/1/website"><img src="https://opencollective.com/katex/organization/1/avatar.svg" alt="Organization 2"></a>
<a href="https://opencollective.com/katex/organization/2/website"><img src="https://opencollective.com/katex/organization/2/avatar.svg" alt="Organization 3"></a>
<a href="https://opencollective.com/katex/organization/3/website"><img src="https://opencollective.com/katex/organization/3/avatar.svg" alt="Organization 4"></a>
<a href="https://opencollective.com/katex/organization/4/website"><img src="https://opencollective.com/katex/organization/4/avatar.svg" alt="Organization 5"></a>
<a href="https://opencollective.com/katex/organization/5/website"><img src="https://opencollective.com/katex/organization/5/avatar.svg" alt="Organization 6"></a>
<a href="https://opencollective.com/katex/organization/6/website"><img src="https://opencollective.com/katex/organization/6/avatar.svg" alt="Organization 7"></a>
<a href="https://opencollective.com/katex/organization/7/website"><img src="https://opencollective.com/katex/organization/7/avatar.svg" alt="Organization 8"></a>
<a href="https://opencollective.com/katex/organization/8/website"><img src="https://opencollective.com/katex/organization/8/avatar.svg" alt="Organization 9"></a>
<a href="https://opencollective.com/katex/organization/9/website"><img src="https://opencollective.com/katex/organization/9/avatar.svg" alt="Organization 10"></a>

## License

KaTeX is licensed under the [MIT License](https://opensource.org/licenses/MIT).
%Ax#!/usr/bin/env node
// Simple CLI for KaTeX.
// Reads TeX from stdin, outputs HTML to stdout.
// To run this from the repository, you must first build KaTeX by running
// `yarn` and `yarn build`.

/* eslint no-console:0 */

let katex;
try {
    katex = require("./");
} catch (e) {
    console.error(
        "KaTeX could not import, likely because dist/katex.js is missing.");
    console.error("Please run 'yarn' and 'yarn build' before running");
    console.error("cli.js from the KaTeX repository.");
    console.error();
    throw e;
}
const {version} = require("./package.json");
const fs = require("fs");

const {program} = require("commander");
program.version(version);

for (const prop in katex.SETTINGS_SCHEMA) {
    if (katex.SETTINGS_SCHEMA.hasOwnProperty(prop)) {
        const opt = katex.SETTINGS_SCHEMA[prop];
        if (opt.cli !== false) {
            program.option(opt.cli || "--" + prop, opt.cliDescription ||
                opt.description, opt.cliProcessor, opt.cliDefault);
        }
    }
}
program.option("-f, --macro-file <path>",
        "Read macro definitions, one per line, from the given file.")
    .option("-i, --input <path>", "Read LaTeX input from the given file.")
    .option("-o, --output <path>", "Write html output to the given file.");

let options;

function readMacros() {
    if (options.macroFile) {
        fs.readFile(options.macroFile, "utf-8", function(err, data) {
            if (err) {throw err;}
            splitMacros(data.toString().split('\n'));
        });
    } else {
        splitMacros([]);
    }
}

function splitMacros(macroStrings) {
    // Override macros from macro file (if any)
    // with macros from command line (if any)
    macroStrings = macroStrings.concat(options.macro);

    const macros = {};

    for (const m of macroStrings) {
        const i = m.search(":");
        if (i !== -1) {
            macros[m.substring(0, i).trim()] = m.substring(i + 1).trim();
        }
    }

    options.macros = macros;
    readInput();
}

function readInput() {
    let input = "";

    if (options.input) {
        fs.readFile(options.input, "utf-8", function(err, data) {
            if (err) {throw err;}
            input = data.toString();
            writeOutput(input);
        });
    } else {
        process.stdin.on("data", function(chunk) {
            input += chunk.toString();
        });

        process.stdin.on("end", function() {
            writeOutput(input);
        });
    }
}

function writeOutput(input) {
    // --format specifies the KaTeX output
    const outputFile = options.output;
    options.output = options.format;

    const output = katex.renderToString(input, options) + "\n";

    if (outputFile) {
        fs.writeFile(outputFile, output, function(err) {
            if (err) {
                return console.log(err);
            }
        });
    } else {
        console.log(output);
    }
}

if (require.main !== module) {
    module.exports = program;
} else {
    options = program.parse(process.argv).opts();
    readMacros();
}
Ux :40000 auto-render x?{j_F;40000 copy-tex +f%(40000 mathtex-script-type X5 K ,f,*40000 mhchem ۗfk?Nd]40000 render-a11y-string v  ( XCB_T@Ox ;100644 README.md y?	vM: %100644 auto-render.ts x i4~d8:100644 index.html \ q
JW;VU100644 splitAtDelimiters.ts WiPTYn%40000 test wpb{_jʚwJYx=# Auto-render extension

This is an extension to automatically render all of the math inside of text. It
searches all of the text nodes in a given element for the given delimiters, and
renders the math in place.

See [Auto-render extension documentation](https://katex.org/docs/autorender.html)
for more information.
rOxZ/* eslint no-console:0 */

import katex from "katex";
import splitAtDelimiters from "./splitAtDelimiters";
import type {DelimiterSpec} from "./splitAtDelimiters";

interface RenderMathInElementOptions {
    delimiters?: DelimiterSpec[];
    preProcess?: (math: string) => string;
    ignoredTags?: string[];
    ignoredClasses?: string[];
    errorCallback?: (msg: string, err: Error) => void;
    displayMode?: boolean;
    macros?: Record<string, string>;
}

interface RenderMathInElementOptionsCopy {
    delimiters: DelimiterSpec[];
    preProcess?: (math: string) => string;
    ignoredTags: Set<string>;
    ignoredClasses: string[];
    errorCallback: (msg: string, err: Error) => void;
    displayMode?: boolean;
    macros?: Record<string, string>;
}

/* Note: optionsCopy is mutated by this method. If it is ever exposed in the
 * API, we should copy it before mutating.
 */
const renderMathInText = function(
    text: string,
    optionsCopy: RenderMathInElementOptionsCopy
) {
    const data = splitAtDelimiters(text, optionsCopy.delimiters);
    if (data.length === 1 && data[0].type === 'text') {
        // There is no formula in the text.
        // Let's return null which means there is no need to replace
        // the current text node with a new one.
        return null;
    }

    const fragment = document.createDocumentFragment();

    for (let i = 0; i < data.length; i++) {
        if (data[i].type === "text") {
            fragment.appendChild(document.createTextNode(data[i].data));
        } else {
            const span = document.createElement("span");
            let math = data[i].data;
            // Override any display mode defined in the settings with that
            // defined by the text itself
            optionsCopy.displayMode = data[i].display;
            try {
                if (optionsCopy.preProcess) {
                    math = optionsCopy.preProcess(math);
                }
                katex.render(math, span, optionsCopy);
            } catch (e) {
                if (!(e instanceof katex.ParseError)) {
                    throw e;
                }
                optionsCopy.errorCallback(
                    "KaTeX auto-render: Failed to parse `" + data[i].data +
                        "` with ",
                    e
                );
                fragment.appendChild(document.createTextNode(data[i].rawData!));
                continue;
            }
            fragment.appendChild(span);
        }
    }

    return fragment;
};

const renderElem = function(
    elem: HTMLElement,
    optionsCopy: RenderMathInElementOptionsCopy
) {
    for (let i = 0; i < elem.childNodes.length; i++) {
        const childNode = elem.childNodes[i];
        if (childNode.nodeType === 3) {
            // Text node
            // Concatenate all sibling text nodes.
            // Webkit browsers split very large text nodes into smaller ones,
            // so the delimiters may be split across different nodes.
            let textContentConcat = childNode.textContent ?? "";
            let sibling = childNode.nextSibling;
            let nSiblings = 0;
            while (sibling && (sibling.nodeType === Node.TEXT_NODE)) {
                textContentConcat += sibling.textContent ?? "";
                sibling = sibling.nextSibling;
                nSiblings++;
            }
            const frag = renderMathInText(textContentConcat, optionsCopy);
            if (frag) {
                // Remove extra text nodes
                for (let j = 0; j < nSiblings; j++) {
                    childNode.nextSibling!.remove();
                }
                i += frag.childNodes.length - 1;
                elem.replaceChild(frag, childNode);
            } else {
                // If the concatenated text does not contain math
                // the siblings will not either
                i += nSiblings;
            }
        } else if (childNode.nodeType === 1) {
            // Element node
            const className = ' ' + (childNode as HTMLElement).className + ' ';
            const shouldRender = !optionsCopy.ignoredTags.has(
                childNode.nodeName.toLowerCase()) &&
                  optionsCopy.ignoredClasses.every(
                      (x: string) => !className.includes(' ' + x + ' '));

            if (shouldRender) {
                renderElem(childNode as HTMLElement, optionsCopy);
            }
        }
        // Otherwise, it's something else, and ignore it.
    }
};

const renderMathInElement = function(elem: HTMLElement, options?: RenderMathInElementOptions) {
    if (!elem) {
        throw new Error("No element provided to render");
    }

    const optionsCopy: Partial<RenderMathInElementOptionsCopy> = {};

    Object.assign(optionsCopy, options);

    // default options
    optionsCopy.delimiters = optionsCopy.delimiters || [
        {left: "$$", right: "$$", display: true},
        {left: "\\(", right: "\\)", display: false},
        // LaTeX uses $…$, but it ruins the display of normal `$` in text:
        // {left: "$", right: "$", display: false},
        // $ must come after $$

        // Render AMS environments even if outside $$…$$ delimiters.
        {left: "\\begin{equation}", right: "\\end{equation}", display: true},
        {left: "\\begin{align}", right: "\\end{align}", display: true},
        {left: "\\begin{alignat}", right: "\\end{alignat}", display: true},
        {left: "\\begin{gather}", right: "\\end{gather}", display: true},
        {left: "\\begin{CD}", right: "\\end{CD}", display: true},

        {left: "\\[", right: "\\]", display: true},
    ];
    optionsCopy.ignoredTags = new Set<string>(options?.ignoredTags || [
        "script", "noscript", "style", "textarea", "pre", "code", "option",
    ]);
    optionsCopy.ignoredClasses = optionsCopy.ignoredClasses || [];
    optionsCopy.errorCallback = optionsCopy.errorCallback || console.error;

    // Enable sharing of global macros defined via `\gdef` between different
    // math elements within a single call to `renderMathInElement`.
    optionsCopy.macros = optionsCopy.macros || {};

    renderElem(elem, optionsCopy as RenderMathInElementOptionsCopy);
};

export default renderMathInElement;
Z{xE<!DOCTYPE html>
<!--To run this example from a clone of the repository, run `yarn start`
    in the root KaTeX directory and then visit with your web browser:
    http://localhost:7936/contrib/auto-render/index.html
  -->
<html>
  <head>
    <meta charset="UTF-8">
    <title>Auto-render test</title>
    <script src="/katex.js" type="text/javascript"></script>
    <script src="/contrib/auto-render.js" type="text/javascript"></script>
    <style type="text/css">
      body {
          margin: 0px;
          padding: 0px;
          font-size: 36px;
      }

      #test > .blue {
          color: blue;
      }
    </style>
  </head>
  <body>
    <div id="test">
      This is some text $math \frac12$ other text $\unsupported$
      <span class="blue">
        Other node \[ \text{displaymath} \frac{1}{2} \] blah $$ \int_2^3 $$
      </span>
      and some <!-- comment --> more text \(and math\) blah. And $math with a
      \$ sign$.
      <pre>
        Stuff in a $pre tag$
      </pre>
      <p>An AMS environment without <code>$$…$$</code> delimiters.</p>
      <p>\begin{equation} \begin{split} a &=b+c\\ &=e+f \end{split} \end{equation}</p>
    </div>
    <script>
      renderMathInElement(
          document.getElementById("test"),
          {
              delimiters: [
                  {left: "$$", right: "$$", display: true},
                  {left: "$", right: "$", display: false},
                  {left: "\\begin{equation}", right: "\\end{equation}", display: true},
                  {left: "\\begin{align}", right: "\\end{align}", display: true},
                  {left: "\\begin{alignat}", right: "\\end{alignat}", display: true},
                  {left: "\\begin{gather}", right: "\\end{gather}", display: true},
                  {left: "\\(", right: "\\)", display: false},
                  {left: "\\[", right: "\\]", display: true},
              ],
              throwOnError: false,
          }
      );
    </script>
  </body>
</html>
cbCx5
/* eslint no-constant-condition:0 */

export interface DelimiterSpec {
    left: string;
    right: string;
    display: boolean;
}

export interface SplitAtDelimiterData {
    type: "text" | "math";
    data: string;
    rawData?: string;
    display?: boolean;
}

const findEndOfMath = function(delimiter: string, text: string, startIndex: number): number {
    // Adapted from
    // https://github.com/Khan/perseus/blob/master/src/perseus-markdown.jsx
    let index = startIndex;
    let braceLevel = 0;

    const delimLength = delimiter.length;

    while (index < text.length) {
        const character = text[index];

        if (braceLevel <= 0 &&
            text.slice(index, index + delimLength) === delimiter) {
            return index;
        } else if (character === "\\") {
            index++;
        } else if (character === "{") {
            braceLevel++;
        } else if (character === "}") {
            braceLevel--;
        }

        index++;
    }

    return -1;
};

const escapeRegex = function(string: string): string {
    return string.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
};

const amsRegex = /^\\begin{/;

const splitAtDelimiters = function(text: string, delimiters: DelimiterSpec[]): SplitAtDelimiterData[] {
    let index;
    const data: SplitAtDelimiterData[] = [];

    const regexLeft = new RegExp(
        "(" + delimiters.map((x) => escapeRegex(x.left)).join("|") + ")"
    );

    while (true) {
        index = text.search(regexLeft);
        if (index === -1) {
            break;
        }
        if (index > 0) {
            data.push({
                type: "text",
                data: text.slice(0, index),
            });
            text = text.slice(index); // now text starts with delimiter
        }
        // ... so this always succeeds:
        const i = delimiters.findIndex((delim) => text.startsWith(delim.left));
        index = findEndOfMath(delimiters[i].right, text, delimiters[i].left.length);
        if (index === -1) {
            break;
        }
        const rawData = text.slice(0, index + delimiters[i].right.length);
        const math = amsRegex.test(rawData)
            ? rawData
            : text.slice(delimiters[i].left.length, index);
        data.push({
            type: "math",
            data: math,
            rawData,
            display: delimiters[i].display,
        });
        text = text.slice(index + delimiters[i].right.length);
    }

    if (text !== "") {
        data.push({
            type: "text",
            data: text,
        });
    }

    return data;
};

export default splitAtDelimiters;
֜x/ 100644 auto-render-spec.ts M+Xz a,2_ [q!*xX3/**
 * @jest-environment jsdom
 */
import splitAtDelimiters from "../splitAtDelimiters";
import renderMathInElement from "../auto-render";
import type {
    DelimiterSpec,
    SplitAtDelimiterData,
} from "../splitAtDelimiters";

beforeEach(function() {
    expect.extend({
        toSplitInto: function(
            actual: string,
            result: SplitAtDelimiterData[],
            delimiters: DelimiterSpec[],
        ) {
            const message = {
                pass: true,
                message: () => "'" + actual + "' split correctly",
            };

            const split =
                  splitAtDelimiters(actual, delimiters);

            if (split.length !== result.length) {
                message.pass = false;
                message.message = () => "Different number of splits: " +
                    split.length + " vs. " + result.length + " (" +
                    JSON.stringify(split) + " vs. " +
                    JSON.stringify(result) + ")";
                return message;
            }

            for (let i = 0; i < split.length; i++) {
                const real = split[i];
                const correct = result[i];

                let good = true;
                let diff = "";

                if (real.type !== correct.type) {
                    good = false;
                    diff = "type";
                } else if (real.data !== correct.data) {
                    good = false;
                    diff = "data";
                } else if (real.display !== correct.display) {
                    good = false;
                    diff = "display";
                }

                if (!good) {
                    message.pass = false;
                    message.message = () => "Difference at split " +
                        (i + 1) + ": " + JSON.stringify(real) +
                        " vs. " + JSON.stringify(correct) +
                        " (" + diff + " differs)";
                    break;
                }
            }

            return message;
        },
    });
});

describe("A delimiter splitter", function() {
    it("doesn't split when there are no delimiters", function() {
        expect("hello").toSplitInto(
            [
                {type: "text", data: "hello"},
            ],
            [
                {left: "(", right: ")", display: false},
            ]);
    });

    it("doesn't create a math node with only one left delimiter", function() {
        expect("hello ( world").toSplitInto(
            [
                {type: "text", data: "hello "},
                {type: "text", data: "( world"},
            ],
            [
                {left: "(", right: ")", display: false},
            ]);
    });

    it("doesn't split when there's only a right delimiter", function() {
        expect("hello ) world").toSplitInto(
            [
                {type: "text", data: "hello ) world"},
            ],
            [
                {left: "(", right: ")", display: false},
            ]);
    });

    it("splits when there are both delimiters", function() {
        expect("hello ( world ) boo").toSplitInto(
            [
                {type: "text", data: "hello "},
                {type: "math", data: " world ",
                    rawData: "( world )", display: false},
                {type: "text", data: " boo"},
            ],
            [
                {left: "(", right: ")", display: false},
            ]);
    });

    it("splits on multi-character delimiters", function() {
        expect("hello [[ world ]] boo").toSplitInto(
            [
                {type: "text", data: "hello "},
                {type: "math", data: " world ",
                    rawData: "[[ world ]]", display: false},
                {type: "text", data: " boo"},
            ],
            [
                {left: "[[", right: "]]", display: false},
            ]);
        expect("hello \\begin{equation} world \\end{equation} boo").toSplitInto(
            [
                {type: "text", data: "hello "},
                {type: "math", data: "\\begin{equation} world \\end{equation}",
                    rawData: "\\begin{equation} world \\end{equation}",
                    display: false},
                {type: "text", data: " boo"},
            ],
            [
                {left: "\\begin{equation}", right: "\\end{equation}",
                    display: false},
            ]);
    });

    it("splits multiple times", function() {
        expect("hello ( world ) boo ( more ) stuff").toSplitInto(
            [
                {type: "text", data: "hello "},
                {type: "math", data: " world ",
                    rawData: "( world )", display: false},
                {type: "text", data: " boo "},
                {type: "math", data: " more ",
                    rawData: "( more )", display: false},
                {type: "text", data: " stuff"},
            ],
            [
                {left: "(", right: ")", display: false},
            ]);
    });

    it("leaves the ending when there's only a left delimiter", function() {
        expect("hello ( world ) boo ( left").toSplitInto(
            [
                {type: "text", data: "hello "},
                {type: "math", data: " world ",
                    rawData: "( world )", display: false},
                {type: "text", data: " boo "},
                {type: "text", data: "( left"},
            ],
            [
                {left: "(", right: ")", display: false},
            ]);
    });

    it("doesn't split when close delimiters are in {}s", function() {
        expect("hello ( world { ) } ) boo").toSplitInto(
            [
                {type: "text", data: "hello "},
                {type: "math", data: " world { ) } ",
                    rawData: "( world { ) } )", display: false},
                {type: "text", data: " boo"},
            ],
            [
                {left: "(", right: ")", display: false},
            ]);

        expect("hello ( world { { } ) } ) boo").toSplitInto(
            [
                {type: "text", data: "hello "},
                {type: "math", data: " world { { } ) } ",
                    rawData: "( world { { } ) } )", display: false},
                {type: "text", data: " boo"},
            ],
            [
                {left: "(", right: ")", display: false},
            ]);
    });

    it("correctly processes sequences of $..$", function() {
        expect("$hello$$world$$boo$").toSplitInto(
            [
                {type: "math", data: "hello",
                    rawData: "$hello$", display: false},
                {type: "math", data: "world",
                    rawData: "$world$", display: false},
                {type: "math", data: "boo",
                    rawData: "$boo$", display: false},
            ],
            [
                {left: "$", right: "$", display: false},
            ]);
    });

    it("doesn't split at escaped delimiters", function() {
        expect("hello ( world \\) ) boo").toSplitInto(
            [
                {type: "text", data: "hello "},
                {type: "math", data: " world \\) ",
                    rawData: "( world \\) )", display: false},
                {type: "text", data: " boo"},
            ],
            [
                {left: "(", right: ")", display: false},
            ]);

        /* TODO(emily): make this work maybe?
           expect("hello \\( ( world ) boo").toSplitInto(
           "(", ")",
           [
           {type: "text", data: "hello \\( "},
           {type: "math", data: " world ",
           rawData: "( world )", display: false},
           {type: "text", data: " boo"},
           ]);
        */
    });

    it("splits when the right and left delimiters are the same", function() {
        expect("hello $ world $ boo").toSplitInto(
            [
                {type: "text", data: "hello "},
                {type: "math", data: " world ",
                    rawData: "$ world $", display: false},
                {type: "text", data: " boo"},
            ],
            [
                {left: "$", right: "$", display: false},
            ]);
    });

    it("ignores \\$", function() {
        expect("$x = \\$5$").toSplitInto(
            [
                {type: "math", data: "x = \\$5",
                    rawData: "$x = \\$5$", display: false},
            ],
            [
                {left: "$", right: "$", display: false},
            ]);
    });

    it("remembers which delimiters are display-mode", function() {
        const startData = "hello ( world ) boo";

        expect(splitAtDelimiters(startData,
                                 [{left:"(", right:")", display:true}])).toEqual(
            [
                {type: "text", data: "hello "},
                {type: "math", data: " world ",
                    rawData: "( world )", display: true},
                {type: "text", data: " boo"},
            ]);
    });

    it("handles nested delimiters irrespective of order", function() {
        expect(splitAtDelimiters("$\\fbox{\\(hi\\)}$",
            [
                                     {left:"\\(", right:"\\)", display:false},
                                     {left:"$", right:"$", display:false},
            ])).toEqual(
            [
                {type: "math", data: "\\fbox{\\(hi\\)}",
                    rawData: "$\\fbox{\\(hi\\)}$", display: false},
            ]);
        expect(splitAtDelimiters("\\(\\fbox{$hi$}\\)",
            [
                {left:"\\(", right:"\\)", display:false},
                {left:"$", right:"$", display:false},
            ])).toEqual(
            [
                {type: "math", data: "\\fbox{$hi$}",
                    rawData: "\\(\\fbox{$hi$}\\)", display: false},
            ]);
    });

    it("handles a mix of $ and $$", function() {
        expect(splitAtDelimiters("$hello$world$$boo$$",
            [
                {left:"$$", right:"$$", display:true},
                {left:"$", right:"$", display:false},
            ])).toEqual(
            [
                {type: "math", data: "hello",
                    rawData: "$hello$", display: false},
                                         {type: "text", data: "world"},
                {type: "math", data: "boo",
                    rawData: "$$boo$$", display: true},
            ]);
        expect(splitAtDelimiters("$hello$$world$$$boo$$",
            [
                {left:"$$", right:"$$", display:true},
                {left:"$", right:"$", display:false},
            ])).toEqual(
            [
                {type: "math", data: "hello",
                    rawData: "$hello$", display: false},
                {type: "math", data: "world",
                    rawData: "$world$", display: false},
                {type: "math", data: "boo",
                    rawData: "$$boo$$", display: true},
            ]);
    });
});

describe("Pre-process callback", function() {
    it("replace `-squared` with `^2 `", function() {
        const el1 = document.createElement('div');
        el1.textContent = 'Circle equation: $x-squared + y-squared = r-squared$.';
        const el2 = document.createElement('div');
        el2.textContent = 'Circle equation: $x^2 + y^2 = r^2$.';
        const delimiters = [{left: "$", right: "$", display: false}];
        renderMathInElement(el1, {
            delimiters,
            preProcess: math => math.replace(/-squared/g, '^2'),
        });
        renderMathInElement(el2, {delimiters});
        expect(el1.innerHTML).toEqual(el2.innerHTML);
    });
});

describe("Parse adjacent text nodes", function() {
    it("parse adjacent text nodes with math", function() {
        const textNodes = ['\\[',
            'x^2 + y^2 = r^2',
            '\\]'];
        const el = document.createElement('div');
        for (let i = 0; i < textNodes.length; i++) {
            const txt = document.createTextNode(textNodes[i]);
            el.appendChild(txt);
        }
        const el2 = document.createElement('div');
        const txt = document.createTextNode(textNodes.join(''));
        el2.appendChild(txt);
        const delimiters = [{left: "\\[", right: "\\]", display: true}];
        renderMathInElement(el, {delimiters});
        renderMathInElement(el2, {delimiters});
        expect(el).toStrictEqual(el2);
    });

    it("parse adjacent text nodes without math", function() {
        const textNodes = ['Lorem ipsum dolor',
            'sit amet',
            'consectetur adipiscing elit'];
        const el = document.createElement('div');
        for (let i = 0; i < textNodes.length; i++) {
            const txt = document.createTextNode(textNodes[i]);
            el.appendChild(txt);
        }
        const el2 = document.createElement('div');
        for (let i = 0; i < textNodes.length; i++) {
            const txt = document.createTextNode(textNodes[i]);
            el2.appendChild(txt);
        }
        const delimiters = [{left: "\\[", right: "\\]", display: true}];
        renderMathInElement(el, {delimiters});
        expect(el).toStrictEqual(el2);
    });
});
ų_C	x e100644 README.md KOhkhsKܔ100644 copy-tex.ts Rj,EL.nJ 100644 index.html Ys&~O100644 katex2tex.ts X&.P]dIq}w:sO;Zvxi# Copy-tex extension

This extension modifies the copy/paste behavior in any browser supporting the
[Clipboard API](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent)
so that, when selecting and copying KaTeX-rendered elements, the text
content of the resulting clipboard renders KaTeX elements as their LaTeX source
surrounded by specified delimiters.  (The HTML content of the resulting
clipboard remains the selected HTML content, as it normally would.)
The default delimiters are `$...$` for inline math and `$$...$$` for display
math, but you can easy switch them to e.g. `\(...\)` and `\[...\]` by
modifying `copyDelimiters` in [the source code](copy-tex.js).
Note that a selection containing part of a KaTeX formula gets extended to
include the entire KaTeX formula.

## Usage

This extension isn't part of KaTeX proper, so the script should be separately
included in the page.

```html
<script src="https://cdn.jsdelivr.net/npm/katex@0.16.47/dist/contrib/copy-tex.min.js" integrity="sha384-Pe2JWbaShhSRT0SESJ9XLPeAsi4yrNi7r/CiH0Coq7giBjK5a6Ae7XcybE8rNlQP" crossorigin="anonymous"></script>
```

(Note that, as of KaTeX 0.16.0, there is no longer a corresponding CSS file.)

See [index.html](index.html) for an example.
(To run this example from a clone of the repository, run `yarn start`
in the root KaTeX directory, and then visit
http://localhost:7936/contrib/copy-tex/index.html
with your web browser.)

If you want to build your own custom copy handler based on this one,
copy the `copy-tex.js` into your codebase and replace the `require`
statement with `require('katex/contrib/copy-tex/katex2tex.js')`.

ECMAScript module is also available:
```html
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.16.47/dist/contrib/copy-tex.mjs" integrity="sha384-PTy3nbMSATx5Ifo/k1ErbnbMVEp3koLGaqTD+zBo5H0fPFue/mKr1M3//74Fu6Tf" crossorigin="anonymous"></script>
```
xx}import katexReplaceWithTex from "./katex2tex";

// Return <div class="katex"> element containing node, or null if not found.
function closestKatex(node: Node): Element | null | undefined {
    // If node is a Text Node, for example, go up to containing Element,
    // where we can apply the `closest` method.
    const element: Element | null | undefined =
        (node instanceof Element ? node : node.parentElement);
    return element && element.closest('.katex');
}

// Global copy handler to modify behavior on/within .katex elements.
document.addEventListener('copy', function(event: ClipboardEvent) {
    const selection = window.getSelection();
    if (!selection || selection.isCollapsed || !event.clipboardData) {
        return; // default action OK if selection is empty or unchangeable
    }
    const clipboardData = event.clipboardData;
    const range = selection.getRangeAt(0);

    // When start point is within a formula, expand to entire formula.
    const startKatex = closestKatex(range.startContainer);
    if (startKatex) {
        range.setStartBefore(startKatex);
    }

    // Similarly, when end point is within a formula, expand to entire formula.
    const endKatex = closestKatex(range.endContainer);
    if (endKatex) {
        range.setEndAfter(endKatex);
    }

    const fragment = range.cloneContents();
    if (!fragment.querySelector('.katex-mathml')) {
        return; // default action OK if no .katex-mathml elements
    }

    const htmlContents = Array.prototype.map.call(fragment.childNodes,
        (el) => (el instanceof Text ? el.textContent : el.outerHTML)
    ).join('');

    // Preserve usual HTML copy/paste behavior.
    clipboardData.setData('text/html', htmlContents);
    // Rewrite plain-text version.
    clipboardData.setData('text/plain',
        katexReplaceWithTex(fragment).textContent);
    // Prevent normal copy handling.
    event.preventDefault();
});
i~IAx<!DOCTYPE html>
<!--To run this example from a clone of the repository, run `yarn start`
    in the root KaTeX directory and then visit with your web browser:
    http://localhost:7936/contrib/copy-tex/index.html
  -->
<html>
  <head>
    <meta charset="UTF-8">
    <title>Copy-tex test</title>
    <script src="/katex.js" type="text/javascript"></script>
    <script src="/contrib/auto-render.js" type="text/javascript"></script>
    <script src="/contrib/copy-tex.js" type="text/javascript"></script>
    <style type="text/css">
      body {
          margin: 0px;
          padding: 0px;
          font-size: 36px;
      }

      #test > .blue {
          color: blue;
      }
    </style>
  </head>
  <body>
    <h1>Copy-tex test</h1>
    <h2>Try copy/pasting some of the text below!</h2>
    <p>
    Here is some \(\KaTeX\) math: $$ x^2+y^2=z^2 $$
    The variables are \(x\), \(y\), and \(z\),
    which are all in \(\mathbb{R}^+\).
    Q.E.D.
    </p>
    <script>
      renderMathInElement(document.body);
    </script>
  </body>
</html>
>Axc	
export interface CopyDelimiters {
    inline: [string, string];
    display: [string, string];
}

// Set these to how you want inline and display math to be delimited.
export const defaultCopyDelimiters: CopyDelimiters = {
    inline: ['$', '$'],    // alternative: ['\(', '\)']
    display: ['$$', '$$'], // alternative: ['\[', '\]']
};

// Replace .katex elements with their TeX source (<annotation> element).
// Modifies fragment in-place.  Useful for writing your own 'copy' handler,
// as in copy-tex.js.
export function katexReplaceWithTex(
    fragment: DocumentFragment,
    copyDelimiters: CopyDelimiters = defaultCopyDelimiters
): DocumentFragment {
    // Remove .katex-html blocks that are preceded by .katex-mathml blocks
    // (which will get replaced below).
    const katexHtml = fragment.querySelectorAll('.katex-mathml + .katex-html');
    for (let i = 0; i < katexHtml.length; i++) {
        const element = katexHtml[i];
        if (element.remove) {
            element.remove();
        } else if (element.parentNode) {
            element.parentNode.removeChild(element);
        }
    }
    // Replace .katex-mathml elements with their annotation (TeX source)
    // descendant, with inline delimiters.
    const katexMathml = fragment.querySelectorAll('.katex-mathml');
    for (let i = 0; i < katexMathml.length; i++) {
        const element = katexMathml[i];
        const texSource = element.querySelector('annotation');
        if (texSource) {
            if (element.replaceWith) {
                element.replaceWith(texSource);
            } else if (element.parentNode) {
                element.parentNode.replaceChild(texSource, element);
            }
            texSource.innerHTML = copyDelimiters.inline[0] +
                texSource.innerHTML + copyDelimiters.inline[1];
        }
    }
    // Switch display math to display delimiters.
    const displays = fragment.querySelectorAll('.katex-display annotation');
    for (let i = 0; i < displays.length; i++) {
        const element = displays[i];
        element.innerHTML = copyDelimiters.display[0] +
            element.innerHTML.substr(copyDelimiters.inline[0].length,
                element.innerHTML.length - copyDelimiters.inline[0].length
                - copyDelimiters.inline[1].length)
            + copyDelimiters.display[1];
    }
    return fragment;
}

export default katexReplaceWithTex;
:xW 100644 README.md 8☡c8I
&100644 mathtex-script-type.js s-GIU?SM/.kQ D}x-# `math/tex` Custom Script Type Extension

This is an extension to automatically display code inside `script` tags with `type=math/tex` using KaTeX.
This script type is commonly used by MathJax, so this can be used to support compatibility with MathJax.

### Usage

This extension isn't part of KaTeX proper, so the script should be separately
included in the page, in addition to KaTeX.

Load the extension by adding the following line to your HTML file.

```html
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.47/dist/contrib/mathtex-script-type.min.js" integrity="sha384-W8gaN87yMtPe/iAcxlyIDA8OVOzZvVD4c/HEE6QHhIyo8yHnVSXLzzy+eNWwpivm" crossorigin="anonymous"></script>
```
You can download the script and use it locally, or from a local KaTeX installation instead.

For example, in the following simple page, we first load KaTeX as usual.
Then, in the body, we use a `math/tex` script to typeset the equation `x+\sqrt{1-x^2}`.


```html
<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.47/dist/katex.min.css" integrity="sha384-nH0MfJ44wi1dd7w6jinlyBgljjS8EJAh2JBoRad8a3VDw2K69vfaaqm4WnR+gXtA" crossorigin="anonymous">
        <script src="https://cdn.jsdelivr.net/npm/katex@0.16.47/dist/katex.min.js" integrity="sha384-CwjPRVHTvLiMBFjEoij+QZViMV5rhTOIp7CJzl24JEqpRDA1sJFHVXXLURktbYYp" crossorigin="anonymous"></script>
        <script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.47/dist/contrib/mathtex-script-type.min.js" integrity="sha384-W8gaN87yMtPe/iAcxlyIDA8OVOzZvVD4c/HEE6QHhIyo8yHnVSXLzzy+eNWwpivm" crossorigin="anonymous"></script>
    </head>
    <body>
        <script type="math/tex">x+\sqrt{1-x^2}</script>
    </body>
</html>
```

ECMAScript module is also available:
```html
<script type="module" src="https://cdn.jsdelivr.net/npm/katex@0.16.47/dist/contrib/mathtex-script-type.mjs" integrity="sha384-4pY6Hczg2Rj0O1719BbDGKN5JSkitfLp1BU8Jke61b3VKMgoKu1lE6al9tMzy3q2" crossorigin="anonymous"></script>
;mx|(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("katex"));
	else if(typeof define === 'function' && define.amd)
		define(["katex"], factory);
	else {
		var a = typeof exports === 'object' ? factory(require("katex")) : factory(root["katex"]);
		for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
	}
})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__757__) {
return /******/ (function() { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ 757:
/***/ (function(module) {

module.exports = __WEBPACK_EXTERNAL_MODULE__757__;

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};
/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(757);
/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(katex__WEBPACK_IMPORTED_MODULE_0__);

let scripts = document.body.getElementsByTagName("script");
scripts = Array.prototype.slice.call(scripts);
scripts.forEach(function (script) {
  if (!script.type || !script.type.match(/math\/tex/i)) {
    return -1;
  }
  const display = script.type.match(/mode\s*=\s*display(;|\s|\n|$)/) != null;
  const katexElement = document.createElement(display ? "div" : "span");
  katexElement.setAttribute("class", display ? "equation" : "inline-equation");
  try {
    katex__WEBPACK_IMPORTED_MODULE_0___default().render(script.text, katexElement, {
      displayMode: display
    });
  } catch (err) {
    // eslint-disable-next-line no-console
    console.error(err);
    katexElement.textContent = script.text;
  }
  script.parentNode.replaceChild(katexElement, script);
});
__webpack_exports__ = __webpack_exports__["default"];
/******/ 	return __webpack_exports__;
/******/ })()
;
});
sP
x import katex from "katex"(script) {
  >4    return -1;
    }
    const display =
          (:);

  3K|$
                             .  try {
        katex$0displayMode: display});
    } catch (err) {
    ^/.  }
  <nD8xJ 100644 README.md 	0Ē/T100644 mhchem.js nØ-w:qMWx~# mhchem extension

This extension adds to KaTeX the `\ce` and `\pu` functions from the [mhchem](https://mhchem.github.io/MathJax-mhchem/) package.

### Usage

This extension isn't part of core KaTeX, so the script should be separately included. Write the following line into the HTML page's `<head>`. Place it *after* the line that calls `katex.js`, and if you make use of the [auto-render](https://katex.org/docs/autorender.html) extension, place it *before* the line that calls `auto-render.js`.

```html
<script defer src="https://cdn.jsdelivr.net/npm/katex@0.16.47/dist/contrib/mhchem.min.js" integrity="sha384-fB8BH//9nBzROkMUsu/Dr35jWHIbnKesUo9rW0hfEgw8mZGnkAyBAjKX9F98OVuo"  crossorigin="anonymous"></script>
```

If you remove the `defer` attribute from this tag, then you must also remove the `defer` attribute from the `<script src="https://../katex.min.js">` tag.

### Syntax

See the [mhchem Manual](https://mhchem.github.io/MathJax-mhchem/) for a full explanation of the input syntax, with working examples. The manual also includes a demonstration box.

Note that old versions of `mhchem.sty` used `\cf` for chemical formula and `\ce` for chemical equations, but `\cf` has been deprecated in place of `\ce`. This extension supports only `\ce`. You can define a macro mapping `\cf` to `\ce` if needed.

### Browser Support

This extension has been tested on Chrome, Firefox, Opera, and Edge.
Ne쌼!x   ﻿/* eslint-disable */
/* -*- Mode: JavaScript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */

/*************************************************************
 *
 *  KaTeX mhchem.js
 *
 *  This file implements a KaTeX version of mhchem version 3.3.0.
 *  It is adapted from MathJax/extensions/TeX/mhchem.js
 *  It differs from the MathJax version as follows:
 *    1. The interface is changed so that it can be called from KaTeX, not MathJax.
 *    2. \rlap and \llap are replaced with \mathrlap and \mathllap.
 *    3. Four lines of code are edited in order to use \raisebox instead of \raise.
 *    4. The reaction arrow code is simplified. All reaction arrows are rendered
 *       using KaTeX extensible arrows instead of building non-extensible arrows.
 *    5. \tripledash vertical alignment is slightly adjusted.
 *
 *    This code, as other KaTeX code, is released under the MIT license.
 * 
 * /*************************************************************
 *
 *  MathJax/extensions/TeX/mhchem.js
 *
 *  Implements the \ce command for handling chemical formulas
 *  from the mhchem LaTeX package.
 *
 *  ---------------------------------------------------------------------
 *
 *  Copyright (c) 2011-2015 The MathJax Consortium
 *  Copyright (c) 2015-2018 Martin Hensel
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

//
// Coding Style
//   - use '' for identifiers that can by minified/uglified
//   - use "" for strings that need to stay untouched

// version: "3.3.0" for MathJax and KaTeX


// Add \ce, \pu, and \tripledash to the KaTeX macros.

katex.__defineMacro("\\ce", function(context) {
  return chemParse(context.consumeArgs(1)[0], "ce")
});

katex.__defineMacro("\\pu", function(context) {
  return chemParse(context.consumeArgs(1)[0], "pu");
});

//  Needed for \bond for the ~ forms
//  Raise by 2.56mu, not 2mu. We're raising a hyphen-minus, U+002D, not 
//  a mathematical minus, U+2212. So we need that extra 0.56.
katex.__defineMacro("\\tripledash", "{\\vphantom{-}\\raisebox{2.56mu}{$\\mkern2mu"
+ "\\tiny\\text{-}\\mkern1mu\\text{-}\\mkern1mu\\text{-}\\mkern2mu$}}");

import katex from "katex";

  //
  //  This is the main function for handing the \ce and \pu commands.
  //  It takes the argument to \ce or \pu and returns the corresponding TeX string.
  //

  var chemParse = function (tokens, stateMachine) {
    // Recreate the argument string from KaTeX's array of tokens.
    var str = "";
    var expectedLoc = tokens.length && tokens[tokens.length - 1].loc.start
    for (var i = tokens.length - 1; i >= 0; i--) {
      if(tokens[i].loc.start > expectedLoc) {
        // context.consumeArgs has eaten a space.
        str += " ";
        expectedLoc = tokens[i].loc.start;
      }
      str += tokens[i].text;
      expectedLoc += tokens[i].text.length;
    }
    var tex = texify.go(mhchemParser.go(str, stateMachine));
    return tex;
  };

  //
  // Core parser for mhchem syntax  (recursive)
  //
  /** @type {MhchemParser} */
  var mhchemParser = {
    //
    // Parses mchem \ce syntax
    //
    // Call like
    //   go("H2O");
    //
    go: function (input, stateMachine) {
      if (!input) { return []; }
      if (stateMachine === undefined) { stateMachine = 'ce'; }
      var state = '0';

      //
      // String buffers for parsing:
      //
      // buffer.a == amount
      // buffer.o == element
      // buffer.b == left-side superscript
      // buffer.p == left-side subscript
      // buffer.q == right-side subscript
      // buffer.d == right-side superscript
      //
      // buffer.r == arrow
      // buffer.rdt == arrow, script above, type
      // buffer.rd == arrow, script above, content
      // buffer.rqt == arrow, script below, type
      // buffer.rq == arrow, script below, content
      //
      // buffer.text_
      // buffer.rm
      // etc.
      //
      // buffer.parenthesisLevel == int, starting at 0
      // buffer.sb == bool, space before
      // buffer.beginsWithBond == bool
      //
      // These letters are also used as state names.
      //
      // Other states:
      // 0 == begin of main part (arrow/operator unlikely)
      // 1 == next entity
      // 2 == next entity (arrow/operator unlikely)
      // 3 == next atom
      // c == macro
      //
      /** @type {Buffer} */
      var buffer = {};
      buffer['parenthesisLevel'] = 0;

      input = input.replace(/\n/g, " ");
      input = input.replace(/[\u2212\u2013\u2014\u2010]/g, "-");
      input = input.replace(/[\u2026]/g, "...");

      //
      // Looks through mhchemParser.transitions, to execute a matching action
      // (recursive)
      //
      var lastInput;
      var watchdog = 10;
      /** @type {ParserOutput[]} */
      var output = [];
      while (true) {
        if (lastInput !== input) {
          watchdog = 10;
          lastInput = input;
        } else {
          watchdog--;
        }
        //
        // Find actions in transition table
        //
        var machine = mhchemParser.stateMachines[stateMachine];
        var t = machine.transitions[state] || machine.transitions['*'];
        iterateTransitions:
        for (var i=0; i<t.length; i++) {
          var matches = mhchemParser.patterns.match_(t[i].pattern, input);
          if (matches) {
            //
            // Execute actions
            //
            var task = t[i].task;
            for (var iA=0; iA<task.action_.length; iA++) {
              var o;
              //
              // Find and execute action
              //
              if (machine.actions[task.action_[iA].type_]) {
                o = machine.actions[task.action_[iA].type_](buffer, matches.match_, task.action_[iA].option);
              } else if (mhchemParser.actions[task.action_[iA].type_]) {
                o = mhchemParser.actions[task.action_[iA].type_](buffer, matches.match_, task.action_[iA].option);
              } else {
                throw ["MhchemBugA", "mhchem bug A. Please report. (" + task.action_[iA].type_ + ")"];  // Trying to use non-existing action
              }
              //
              // Add output
              //
              mhchemParser.concatArray(output, o);
            }
            //
            // Set next state,
            // Shorten input,
            // Continue with next character
            //   (= apply only one transition per position)
            //
            state = task.nextState || state;
            if (input.length > 0) {
              if (!task.revisit) {
                input = matches.remainder;
              }
              if (!task.toContinue) {
                break iterateTransitions;
              }
            } else {
              return output;
            }
          }
        }
        //
        // Prevent infinite loop
        //
        if (watchdog <= 0) {
          throw ["MhchemBugU", "mhchem bug U. Please report."];  // Unexpected character
        }
      }
    },
    concatArray: function (a, b) {
      if (b) {
        if (Array.isArray(b)) {
          for (var iB=0; iB<b.length; iB++) {
            a.push(b[iB]);
          }
        } else {
          a.push(b);
        }
      }
    },

    patterns: {
      //
      // Matching patterns
      // either regexps or function that return null or {match_:"a", remainder:"bc"}
      //
      patterns: {
        // property names must not look like integers ("2") for correct property traversal order, later on
        'empty': /^$/,
        'else': /^./,
        'else2': /^./,
        'space': /^\s/,
        'space A': /^\s(?=[A-Z\\$])/,
        'space$': /^\s$/,
        'a-z': /^[a-z]/,
        'x': /^x/,
        'x$': /^x$/,
        'i$': /^i$/,
        'letters': /^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,
        '\\greek': /^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,
        'one lowercase latin letter $': /^(?:([a-z])(?:$|[^a-zA-Z]))$/,
        '$one lowercase latin letter$ $': /^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,
        'one lowercase greek letter $': /^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,
        'digits': /^[0-9]+/,
        '-9.,9': /^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,
        '-9.,9 no missing 0': /^[+\-]?[0-9]+(?:[.,][0-9]+)?/,
        '(-)(9.,9)(e)(99)': function (input) {
          var m = input.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:([eE]|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);
          if (m && m[0]) {
            return { match_: m.splice(1), remainder: input.substr(m[0].length) };
          }
          return null;
        },
        '(-)(9)^(-9)': function (input) {
          var m = input.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);
          if (m && m[0]) {
            return { match_: m.splice(1), remainder: input.substr(m[0].length) };
          }
          return null;
        },
        'state of aggregation $': function (input) {  // ... or crystal system
          var a = mhchemParser.patterns.findObserveGroups(input, "", /^\([a-z]{1,3}(?=[\),])/, ")", "");  // (aq), (aq,$\infty$), (aq, sat)
          if (a  &&  a.remainder.match(/^($|[\s,;\)\]\}])/)) { return a; }  //  AND end of 'phrase'
          var m = input.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);  // OR crystal system ($o$) (\ca$c$)
          if (m) {
            return { match_: m[0], remainder: input.substr(m[0].length) };
          }
          return null;
        },
        '_{(state of aggregation)}$': /^_\{(\([a-z]{1,3}\))\}/,
        '{[(': /^(?:\\\{|\[|\()/,
        ')]}': /^(?:\)|\]|\\\})/,
        ', ': /^[,;]\s*/,
        ',': /^[,;]/,
        '.': /^[.]/,
        '. ': /^([.\u22C5\u00B7\u2022])\s*/,
        '...': /^\.\.\.(?=$|[^.])/,
        '* ': /^([*])\s*/,
        '^{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "^{", "", "", "}"); },
        '^($...$)': function (input) { return mhchemParser.patterns.findObserveGroups(input, "^", "$", "$", ""); },
        '^a': /^\^([0-9]+|[^\\_])/,
        '^\\x{}{}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "^", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true); },
        '^\\x{}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "^", /^\\[a-zA-Z]+\{/, "}", ""); },
        '^\\x': /^\^(\\[a-zA-Z]+)\s*/,
        '^(-1)': /^\^(-?\d+)/,
        '\'': /^'/,
        '_{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "_{", "", "", "}"); },
        '_($...$)': function (input) { return mhchemParser.patterns.findObserveGroups(input, "_", "$", "$", ""); },
        '_9': /^_([+\-]?[0-9]+|[^\\])/,
        '_\\x{}{}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "_", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true); },
        '_\\x{}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "_", /^\\[a-zA-Z]+\{/, "}", ""); },
        '_\\x': /^_(\\[a-zA-Z]+)\s*/,
        '^_': /^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,
        '{}': /^\{\}/,
        '{...}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "", "{", "}", ""); },
        '{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "{", "", "", "}"); },
        '$...$': function (input) { return mhchemParser.patterns.findObserveGroups(input, "", "$", "$", ""); },
        '${(...)}$': function (input) { return mhchemParser.patterns.findObserveGroups(input, "${", "", "", "}$"); },
        '$(...)$': function (input) { return mhchemParser.patterns.findObserveGroups(input, "$", "", "", "$"); },
        '=<>': /^[=<>]/,
        '#': /^[#\u2261]/,
        '+': /^\+/,
        '-$': /^-(?=[\s_},;\]/]|$|\([a-z]+\))/,  // -space -, -; -] -/ -$ -state-of-aggregation
        '-9': /^-(?=[0-9])/,
        '- orbital overlap': /^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,
        '-': /^-/,
        'pm-operator': /^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,
        'operator': /^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,
        'arrowUpDown': /^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,
        '\\bond{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\bond{", "", "", "}"); },
        '->': /^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,
        'CMT': /^[CMT](?=\[)/,
        '[(...)]': function (input) { return mhchemParser.patterns.findObserveGroups(input, "[", "", "", "]"); },
        '1st-level escape': /^(&|\\\\|\\hline)\s*/,
        '\\,': /^(?:\\[,\ ;:])/,  // \\x - but output no space before
        '\\x{}{}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true); },
        '\\x{}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "", /^\\[a-zA-Z]+\{/, "}", ""); },
        '\\ca': /^\\ca(?:\s+|(?![a-zA-Z]))/,
        '\\x': /^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,
        'orbital': /^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,  // only those with numbers in front, because the others will be formatted correctly anyway
        'others': /^[\/~|]/,
        '\\frac{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\frac{", "", "", "}", "{", "", "", "}"); },
        '\\overset{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\overset{", "", "", "}", "{", "", "", "}"); },
        '\\underset{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\underset{", "", "", "}", "{", "", "", "}"); },
        '\\underbrace{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\underbrace{", "", "", "}_", "{", "", "", "}"); },
        '\\color{(...)}0': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\color{", "", "", "}"); },
        '\\color{(...)}{(...)}1': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\color{", "", "", "}", "{", "", "", "}"); },
        '\\color(...){(...)}2': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\color", "\\", "", /^(?=\{)/, "{", "", "", "}"); },
        '\\ce{(...)}': function (input) { return mhchemParser.patterns.findObserveGroups(input, "\\ce{", "", "", "}"); },
        'oxidation$': /^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,
        'd-oxidation$': /^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,  // 0 could be oxidation or charge
        'roman numeral': /^[IVX]+/,
        '1/2$': /^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,
        'amount': function (input) {
          var match;
          // e.g. 2, 0.5, 1/2, -2, n/2, +;  $a$ could be added later in parsing
          match = input.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/);
          if (match) {
            return { match_: match[0], remainder: input.substr(match[0].length) };
          }
          var a = mhchemParser.patterns.findObserveGroups(input, "", "$", "$", "");
          if (a) {  // e.g. $2n-1$, $-$
            match = a.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/);
            if (match) {
              return { match_: match[0], remainder: input.substr(match[0].length) };
            }
          }
          return null;
        },
        'amount2': function (input) { return this['amount'](input); },
        '(KV letters),': /^(?:[A-Z][a-z]{0,2}|i)(?=,)/,
        'formula$': function (input) {
          if (input.match(/^\([a-z]+\)$/)) { return null; }  // state of aggregation = no formula
          var match = input.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);
          if (match) {
            return { match_: match[0], remainder: input.substr(match[0].length) };
          }
          return null;
        },
        'uprightEntities': /^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,
        '/': /^\s*(\/)\s*/,
        '//': /^\s*(\/\/)\s*/,
        '*': /^\s*[*.]\s*/
      },
      findObserveGroups: function (input, begExcl, begIncl, endIncl, endExcl, beg2Excl, beg2Incl, end2Incl, end2Excl, combine) {
        /** @type {{(input: string, pattern: string | RegExp): string | string[] | null;}} */
        var _match = function (input, pattern) {
          if (typeof pattern === "string") {
            if (input.indexOf(pattern) !== 0) { return null; }
            return pattern;
          } else {
            var match = input.match(pattern);
            if (!match) { return null; }
            return match[0];
          }
        };
        /** @type {{(input: string, i: number, endChars: string | RegExp): {endMatchBegin: number, endMatchEnd: number} | null;}} */
        var _findObserveGroups = function (input, i, endChars) {
          var braces = 0;
          while (i < input.length) {
            var a = input.charAt(i);
            var match = _match(input.substr(i), endChars);
            if (match !== null  &&  braces === 0) {
              return { endMatchBegin: i, endMatchEnd: i + match.length };
            } else if (a === "{") {
              braces++;
            } else if (a === "}") {
              if (braces === 0) {
                throw ["ExtraCloseMissingOpen", "Extra close brace or missing open brace"];
              } else {
                braces--;
              }
            }
            i++;
          }
          if (braces > 0) {
            return null;
          }
          return null;
        };
        var match = _match(input, begExcl);
        if (match === null) { return null; }
        input = input.substr(match.length);
        match = _match(input, begIncl);
        if (match === null) { return null; }
        var e = _findObserveGroups(input, match.length, endIncl || endExcl);
        if (e === null) { return null; }
        var match1 = input.substring(0, (endIncl ? e.endMatchEnd : e.endMatchBegin));
        if (!(beg2Excl || beg2Incl)) {
          return {
            match_: match1,
            remainder: input.substr(e.endMatchEnd)
          };
        } else {
          var group2 = this.findObserveGroups(input.substr(e.endMatchEnd), beg2Excl, beg2Incl, end2Incl, end2Excl);
          if (group2 === null) { return null; }
          /** @type {string[]} */
          var matchRet = [match1, group2.match_];
          return {
            match_: (combine ? matchRet.join("") : matchRet),
            remainder: group2.remainder
          };
        }
      },

      //
      // Matching function
      // e.g. match("a", input) will look for the regexp called "a" and see if it matches
      // returns null or {match_:"a", remainder:"bc"}
      //
      match_: function (m, input) {
        var pattern = mhchemParser.patterns.patterns[m];
        if (pattern === undefined) {
          throw ["MhchemBugP", "mhchem bug P. Please report. (" + m + ")"];  // Trying to use non-existing pattern
        } else if (typeof pattern === "function") {
          return mhchemParser.patterns.patterns[m](input);  // cannot use cached var pattern here, because some pattern functions need this===mhchemParser
        } else {  // RegExp
          var match = input.match(pattern);
          if (match) {
            var mm;
            if (match[2]) {
              mm = [ match[1], match[2] ];
            } else if (match[1]) {
              mm = match[1];
            } else {
              mm = match[0];
            }
            return { match_: mm, remainder: input.substr(match[0].length) };
          }
          return null;
        }
      }
    },

    //
    // Generic state machine actions
    //
    actions: {
      'a=': function (buffer, m) { buffer.a = (buffer.a || "") + m; },
      'b=': function (buffer, m) { buffer.b = (buffer.b || "") + m; },
      'p=': function (buffer, m) { buffer.p = (buffer.p || "") + m; },
      'o=': function (buffer, m) { buffer.o = (buffer.o || "") + m; },
      'q=': function (buffer, m) { buffer.q = (buffer.q || "") + m; },
      'd=': function (buffer, m) { buffer.d = (buffer.d || "") + m; },
      'rm=': function (buffer, m) { buffer.rm = (buffer.rm || "") + m; },
      'text=': function (buffer, m) { buffer.text_ = (buffer.text_ || "") + m; },
      'insert': function (buffer, m, a) { return { type_: a }; },
      'insert+p1': function (buffer, m, a) { return { type_: a, p1: m }; },
      'insert+p1+p2': function (buffer, m, a) { return { type_: a, p1: m[0], p2: m[1] }; },
      'copy': function (buffer, m) { return m; },
      'rm': function (buffer, m) { return { type_: 'rm', p1: m || ""}; },
      'text': function (buffer, m) { return mhchemParser.go(m, 'text'); },
      '{text}': function (buffer, m) {
        var ret = [ "{" ];
        mhchemParser.concatArray(ret, mhchemParser.go(m, 'text'));
        ret.push("}");
        return ret;
      },
      'tex-math': function (buffer, m) { return mhchemParser.go(m, 'tex-math'); },
      'tex-math tight': function (buffer, m) { return mhchemParser.go(m, 'tex-math tight'); },
      'bond': function (buffer, m, k) { return { type_: 'bond', kind_: k || m }; },
      'color0-output': function (buffer, m) { return { type_: 'color0', color: m[0] }; },
      'ce': function (buffer, m) { return mhchemParser.go(m); },
      '1/2': function (buffer, m) {
        /** @type {ParserOutput[]} */
        var ret = [];
        if (m.match(/^[+\-]/)) {
          ret.push(m.substr(0, 1));
          m = m.substr(1);
        }
        var n = m.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);
        n[1] = n[1].replace(/\$/g, "");
        ret.push({ type_: 'frac', p1: n[1], p2: n[2] });
        if (n[3]) {
          n[3] = n[3].replace(/\$/g, "");
          ret.push({ type_: 'tex-math', p1: n[3] });
        }
        return ret;
      },
      '9,9': function (buffer, m) { return mhchemParser.go(m, '9,9'); }
    },
    //
    // createTransitions
    // convert  { 'letter': { 'state': { action_: 'output' } } }  to  { 'state' => [ { pattern: 'letter', task: { action_: [{type_: 'output'}] } } ] }
    // with expansion of 'a|b' to 'a' and 'b' (at 2 places)
    //
    createTransitions: function (o) {
      var pattern, state;
      /** @type {string[]} */
      var stateArray;
      var i;
      //
      // 1. Collect all states
      //
      /** @type {Transitions} */
      var transitions = {};
      for (pattern in o) {
        for (state in o[pattern]) {
          stateArray = state.split("|");
          o[pattern][state].stateArray = stateArray;
          for (i=0; i<stateArray.length; i++) {
            transitions[stateArray[i]] = [];
          }
        }
      }
      //
      // 2. Fill states
      //
      for (pattern in o) {
        for (state in o[pattern]) {
          stateArray = o[pattern][state].stateArray || [];
          for (i=0; i<stateArray.length; i++) {
            //
            // 2a. Normalize actions into array:  'text=' ==> [{type_:'text='}]
            // (Note to myself: Resolving the function here would be problematic. It would need .bind (for *this*) and currying (for *option*).)
            //
            /** @type {any} */
            var p = o[pattern][state];
            if (p.action_) {
              p.action_ = [].concat(p.action_);
              for (var k=0; k<p.action_.length; k++) {
                if (typeof p.action_[k] === "string") {
                  p.action_[k] = { type_: p.action_[k] };
                }
              }
            } else {
              p.action_ = [];
            }
            //
            // 2.b Multi-insert
            //
            var patternArray = pattern.split("|");
            for (var j=0; j<patternArray.length; j++) {
              if (stateArray[i] === '*') {  // insert into all
                for (var t in transitions) {
                  transitions[t].push({ pattern: patternArray[j], task: p });
                }
              } else {
                transitions[stateArray[i]].push({ pattern: patternArray[j], task: p });
              }
            }
          }
        }
      }
      return transitions;
    },
    stateMachines: {}
  };

  //
  // Definition of state machines
  //
  mhchemParser.stateMachines = {
    //
    // \ce state machines
    //
    //#region ce
    'ce': {  // main parser
      transitions: mhchemParser.createTransitions({
        'empty': {
          '*': { action_: 'output' } },
        'else':  {
          '0|1|2': { action_: 'beginsWithBond=false', revisit: true, toContinue: true } },
        'oxidation$': {
          '0': { action_: 'oxidation-output' } },
        'CMT': {
          'r': { action_: 'rdt=', nextState: 'rt' },
          'rd': { action_: 'rqt=', nextState: 'rdt' } },
        'arrowUpDown': {
          '0|1|2|as': { action_: [ 'sb=false', 'output', 'operator' ], nextState: '1' } },
        'uprightEntities': {
          '0|1|2': { action_: [ 'o=', 'output' ], nextState: '1' } },
        'orbital': {
          '0|1|2|3': { action_: 'o=', nextState: 'o' } },
        '->': {
          '0|1|2|3': { action_: 'r=', nextState: 'r' },
          'a|as': { action_: [ 'output', 'r=' ], nextState: 'r' },
          '*': { action_: [ 'output', 'r=' ], nextState: 'r' } },
        '+': {
          'o': { action_: 'd= kv',  nextState: 'd' },
          'd|D': { action_: 'd=', nextState: 'd' },
          'q': { action_: 'd=',  nextState: 'qd' },
          'qd|qD': { action_: 'd=', nextState: 'qd' },
          'dq': { action_: [ 'output', 'd=' ], nextState: 'd' },
          '3': { action_: [ 'sb=false', 'output', 'operator' ], nextState: '0' } },
        'amount': {
          '0|2': { action_: 'a=', nextState: 'a' } },
        'pm-operator': {
          '0|1|2|a|as': { action_: [ 'sb=false', 'output', { type_: 'operator', option: '\\pm' } ], nextState: '0' } },
        'operator': {
          '0|1|2|a|as': { action_: [ 'sb=false', 'output', 'operator' ], nextState: '0' } },
        '-$': {
          'o|q': { action_: [ 'charge or bond', 'output' ],  nextState: 'qd' },
          'd': { action_: 'd=', nextState: 'd' },
          'D': { action_: [ 'output', { type_: 'bond', option: "-" } ], nextState: '3' },
          'q': { action_: 'd=',  nextState: 'qd' },
          'qd': { action_: 'd=', nextState: 'qd' },
          'qD|dq': { action_: [ 'output', { type_: 'bond', option: "-" } ], nextState: '3' } },
        '-9': {
          '3|o': { action_: [ 'output', { type_: 'insert', option: 'hyphen' } ], nextState: '3' } },
        '- orbital overlap': {
          'o': { action_: [ 'output', { type_: 'insert', option: 'hyphen' } ], nextState: '2' },
          'd': { action_: [ 'output', { type_: 'insert', option: 'hyphen' } ], nextState: '2' } },
        '-': {
          '0|1|2': { action_: [ { type_: 'output', option: 1 }, 'beginsWithBond=true', { type_: 'bond', option: "-" } ], nextState: '3' },
          '3': { action_: { type_: 'bond', option: "-" } },
          'a': { action_: [ 'output', { type_: 'insert', option: 'hyphen' } ], nextState: '2' },
          'as': { action_: [ { type_: 'output', option: 2 }, { type_: 'bond', option: "-" } ], nextState: '3' },
          'b': { action_: 'b=' },
          'o': { action_: { type_: '- after o/d', option: false }, nextState: '2' },
          'q': { action_: { type_: '- after o/d', option: false }, nextState: '2' },
          'd|qd|dq': { action_: { type_: '- after o/d', option: true }, nextState: '2' },
          'D|qD|p': { action_: [ 'output', { type_: 'bond', option: "-" } ], nextState: '3' } },
        'amount2': {
          '1|3': { action_: 'a=', nextState: 'a' } },
        'letters': {
          '0|1|2|3|a|as|b|p|bp|o': { action_: 'o=', nextState: 'o' },
          'q|dq': { action_: ['output', 'o='], nextState: 'o' },
          'd|D|qd|qD': { action_: 'o after d', nextState: 'o' } },
        'digits': {
          'o': { action_: 'q=', nextState: 'q' },
          'd|D': { action_: 'q=', nextState: 'dq' },
          'q': { action_: [ 'output', 'o=' ], nextState: 'o' },
          'a': { action_: 'o=', nextState: 'o' } },
        'space A': {
          'b|p|bp': {} },
        'space': {
          'a': { nextState: 'as' },
          '0': { action_: 'sb=false' },
          '1|2': { action_: 'sb=true' },
          'r|rt|rd|rdt|rdq': { action_: 'output', nextState: '0' },
          '*': { action_: [ 'output', 'sb=true' ], nextState: '1'} },
        '1st-level escape': {
          '1|2': { action_: [ 'output', { type_: 'insert+p1', option: '1st-level escape' } ] },
          '*': { action_: [ 'output', { type_: 'insert+p1', option: '1st-level escape' } ], nextState: '0' } },
        '[(...)]': {
          'r|rt': { action_: 'rd=', nextState: 'rd' },
          'rd|rdt': { action_: 'rq=', nextState: 'rdq' } },
        '...': {
          'o|d|D|dq|qd|qD': { action_: [ 'output', { type_: 'bond', option: "..." } ], nextState: '3' },
          '*': { action_: [ { type_: 'output', option: 1 }, { type_: 'insert', option: 'ellipsis' } ], nextState: '1' } },
        '. |* ': {
          '*': { action_: [ 'output', { type_: 'insert', option: 'addition compound' } ], nextState: '1' } },
        'state of aggregation $': {
          '*': { action_: [ 'output', 'state of aggregation' ], nextState: '1' } },
        '{[(': {
          'a|as|o': { action_: [ 'o=', 'output', 'parenthesisLevel++' ], nextState: '2' },
          '0|1|2|3': { action_: [ 'o=', 'output', 'parenthesisLevel++' ], nextState: '2' },
          '*': { action_: [ 'output', 'o=', 'output', 'parenthesisLevel++' ], nextState: '2' } },
        ')]}': {
          '0|1|2|3|b|p|bp|o': { action_: [ 'o=', 'parenthesisLevel--' ], nextState: 'o' },
          'a|as|d|D|q|qd|qD|dq': { action_: [ 'output', 'o=', 'parenthesisLevel--' ], nextState: 'o' } },
        ', ': {
          '*': { action_: [ 'output', 'comma' ], nextState: '0' } },
        '^_': {  // ^ and _ without a sensible argument
          '*': { } },
        '^{(...)}|^($...$)': {
          '0|1|2|as': { action_: 'b=', nextState: 'b' },
          'p': { action_: 'b=', nextState: 'bp' },
          '3|o': { action_: 'd= kv', nextState: 'D' },
          'q': { action_: 'd=', nextState: 'qD' },
          'd|D|qd|qD|dq': { action_: [ 'output', 'd=' ], nextState: 'D' } },
        '^a|^\\x{}{}|^\\x{}|^\\x|\'': {
          '0|1|2|as': { action_: 'b=', nextState: 'b' },
          'p': { action_: 'b=', nextState: 'bp' },
          '3|o': { action_: 'd= kv', nextState: 'd' },
          'q': { action_: 'd=', nextState: 'qd' },
          'd|qd|D|qD': { action_: 'd=' },
          'dq': { action_: [ 'output', 'd=' ], nextState: 'd' } },
        '_{(state of aggregation)}$': {
          'd|D|q|qd|qD|dq': { action_: [ 'output', 'q=' ], nextState: 'q' } },
        '_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x': {
          '0|1|2|as': { action_: 'p=', nextState: 'p' },
          'b': { action_: 'p=', nextState: 'bp' },
          '3|o': { action_: 'q=', nextState: 'q' },
          'd|D': { action_: 'q=', nextState: 'dq' },
          'q|qd|qD|dq': { action_: [ 'output', 'q=' ], nextState: 'q' } },
        '=<>': {
          '0|1|2|3|a|as|o|q|d|D|qd|qD|dq': { action_: [ { type_: 'output', option: 2 }, 'bond' ], nextState: '3' } },
        '#': {
          '0|1|2|3|a|as|o': { action_: [ { type_: 'output', option: 2 }, { type_: 'bond', option: "#" } ], nextState: '3' } },
        '{}': {
          '*': { action_: { type_: 'output', option: 1 },  nextState: '1' } },
        '{...}': {
          '0|1|2|3|a|as|b|p|bp': { action_: 'o=', nextState: 'o' },
          'o|d|D|q|qd|qD|dq': { action_: [ 'output', 'o=' ], nextState: 'o' } },
        '$...$': {
          'a': { action_: 'a=' },  // 2$n$
          '0|1|2|3|as|b|p|bp|o': { action_: 'o=', nextState: 'o' },  // not 'amount'
          'as|o': { action_: 'o=' },
          'q|d|D|qd|qD|dq': { action_: [ 'output', 'o=' ], nextState: 'o' } },
        '\\bond{(...)}': {
          '*': { action_: [ { type_: 'output', option: 2 }, 'bond' ], nextState: "3" } },
        '\\frac{(...)}': {
          '*': { action_: [ { type_: 'output', option: 1 }, 'frac-output' ], nextState: '3' } },
        '\\overset{(...)}': {
          '*': { action_: [ { type_: 'output', option: 2 }, 'overset-output' ], nextState: '3' } },
        '\\underset{(...)}': {
          '*': { action_: [ { type_: 'output', option: 2 }, 'underset-output' ], nextState: '3' } },
        '\\underbrace{(...)}': {
          '*': { action_: [ { type_: 'output', option: 2 }, 'underbrace-output' ], nextState: '3' } },
        '\\color{(...)}{(...)}1|\\color(...){(...)}2': {
          '*': { action_: [ { type_: 'output', option: 2 }, 'color-output' ], nextState: '3' } },
        '\\color{(...)}0': {
          '*': { action_: [ { type_: 'output', option: 2 }, 'color0-output' ] } },
        '\\ce{(...)}': {
          '*': { action_: [ { type_: 'output', option: 2 }, 'ce' ], nextState: '3' } },
        '\\,': {
          '*': { action_: [ { type_: 'output', option: 1 }, 'copy' ], nextState: '1' } },
        '\\x{}{}|\\x{}|\\x': {
          '0|1|2|3|a|as|b|p|bp|o|c0': { action_: [ 'o=', 'output' ], nextState: '3' },
          '*': { action_: ['output', 'o=', 'output' ], nextState: '3' } },
        'others': {
          '*': { action_: [ { type_: 'output', option: 1 }, 'copy' ], nextState: '3' } },
        'else2': {
          'a': { action_: 'a to o', nextState: 'o', revisit: true },
          'as': { action_: [ 'output', 'sb=true' ], nextState: '1', revisit: true },
          'r|rt|rd|rdt|rdq': { action_: [ 'output' ], nextState: '0', revisit: true },
          '*': { action_: [ 'output', 'copy' ], nextState: '3' } }
      }),
      actions: {
        'o after d': function (buffer, m) {
          var ret;
          if ((buffer.d || "").match(/^[0-9]+$/)) {
            var tmp = buffer.d;
            buffer.d = undefined;
            ret = this['output'](buffer);
            buffer.b = tmp;
          } else {
            ret = this['output'](buffer);
          }
          mhchemParser.actions['o='](buffer, m);
          return ret;
        },
        'd= kv': function (buffer, m) {
          buffer.d = m;
          buffer.dType = 'kv';
        },
        'charge or bond': function (buffer, m) {
          if (buffer['beginsWithBond']) {
            /** @type {ParserOutput[]} */
            var ret = [];
            mhchemParser.concatArray(ret, this['output'](buffer));
            mhchemParser.concatArray(ret, mhchemParser.actions['bond'](buffer, m, "-"));
            return ret;
          } else {
            buffer.d = m;
          }
        },
        '- after o/d': function (buffer, m, isAfterD) {
          var c1 = mhchemParser.patterns.match_('orbital', buffer.o || "");
          var c2 = mhchemParser.patterns.match_('one lowercase greek letter $', buffer.o || "");
          var c3 = mhchemParser.patterns.match_('one lowercase latin letter $', buffer.o || "");
          var c4 = mhchemParser.patterns.match_('$one lowercase latin letter$ $', buffer.o || "");
          var hyphenFollows =  m==="-" && ( c1 && c1.remainder===""  ||  c2  ||  c3  ||  c4 );
          if (hyphenFollows && !buffer.a && !buffer.b && !buffer.p && !buffer.d && !buffer.q && !c1 && c3) {
            buffer.o = '$' + buffer.o + '$';
          }
          /** @type {ParserOutput[]} */
          var ret = [];
          if (hyphenFollows) {
            mhchemParser.concatArray(ret, this['output'](buffer));
            ret.push({ type_: 'hyphen' });
          } else {
            c1 = mhchemParser.patterns.match_('digits', buffer.d || "");
            if (isAfterD && c1 && c1.remainder==='') {
              mhchemParser.concatArray(ret, mhchemParser.actions['d='](buffer, m));
              mhchemParser.concatArray(ret, this['output'](buffer));
            } else {
              mhchemParser.concatArray(ret, this['output'](buffer));
              mhchemParser.concatArray(ret, mhchemParser.actions['bond'](buffer, m, "-"));
            }
          }
          return ret;
        },
        'a to o': function (buffer) {
          buffer.o = buffer.a;
          buffer.a = undefined;
        },
        'sb=true': function (buffer) { buffer.sb = true; },
        'sb=false': function (buffer) { buffer.sb = false; },
        'beginsWithBond=true': function (buffer) { buffer['beginsWithBond'] = true; },
        'beginsWithBond=false': function (buffer) { buffer['beginsWithBond'] = false; },
        'parenthesisLevel++': function (buffer) { buffer['parenthesisLevel']++; },
        'parenthesisLevel--': function (buffer) { buffer['parenthesisLevel']--; },
        'state of aggregation': function (buffer, m) {
          return { type_: 'state of aggregation', p1: mhchemParser.go(m, 'o') };
        },
        'comma': function (buffer, m) {
          var a = m.replace(/\s*$/, '');
          var withSpace = (a !== m);
          if (withSpace  &&  buffer['parenthesisLevel'] === 0) {
            return { type_: 'comma enumeration L', p1: a };
          } else {
            return { type_: 'comma enumeration M', p1: a };
          }
        },
        'output': function (buffer, m, entityFollows) {
          // entityFollows:
          //   undefined = if we have nothing else to output, also ignore the just read space (buffer.sb)
          //   1 = an entity follows, never omit the space if there was one just read before (can only apply to state 1)
          //   2 = 1 + the entity can have an amount, so output a\, instead of converting it to o (can only apply to states a|as)
          /** @type {ParserOutput | ParserOutput[]} */
          var ret;
          if (!buffer.r) {
            ret = [];
            if (!buffer.a && !buffer.b && !buffer.p && !buffer.o && !buffer.q && !buffer.d && !entityFollows) {
              //ret = [];
            } else {
              if (buffer.sb) {
                ret.push({ type_: 'entitySkip' });
              }
              if (!buffer.o && !buffer.q && !buffer.d && !buffer.b && !buffer.p && entityFollows!==2) {
                buffer.o = buffer.a;
                buffer.a = undefined;
              } else if (!buffer.o && !buffer.q && !buffer.d && (buffer.b || buffer.p)) {
                buffer.o = buffer.a;
                buffer.d = buffer.b;
                buffer.q = buffer.p;
                buffer.a = buffer.b = buffer.p = undefined;
              } else {
                if (buffer.o && buffer.dType==='kv' && mhchemParser.patterns.match_('d-oxidation$', buffer.d || "")) {
                  buffer.dType = 'oxidation';
                } else if (buffer.o && buffer.dType==='kv' && !buffer.q) {
                  buffer.dType = undefined;
                }
              }
              ret.push({
                type_: 'chemfive',
                a: mhchemParser.go(buffer.a, 'a'),
                b: mhchemParser.go(buffer.b, 'bd'),
                p: mhchemParser.go(buffer.p, 'pq'),
                o: mhchemParser.go(buffer.o, 'o'),
                q: mhchemParser.go(buffer.q, 'pq'),
                d: mhchemParser.go(buffer.d, (buffer.dType === 'oxidation' ? 'oxidation' : 'bd')),
                dType: buffer.dType
              });
            }
          } else {  // r
            /** @type {ParserOutput[]} */
            var rd;
            if (buffer.rdt === 'M') {
              rd = mhchemParser.go(buffer.rd, 'tex-math');
            } else if (buffer.rdt === 'T') {
              rd = [ { type_: 'text', p1: buffer.rd || "" } ];
            } else {
              rd = mhchemParser.go(buffer.rd);
            }
            /** @type {ParserOutput[]} */
            var rq;
            if (buffer.rqt === 'M') {
              rq = mhchemParser.go(buffer.rq, 'tex-math');
            } else if (buffer.rqt === 'T') {
              rq = [ { type_: 'text', p1: buffer.rq || ""} ];
            } else {
              rq = mhchemParser.go(buffer.rq);
            }
            ret = {
              type_: 'arrow',
              r: buffer.r,
              rd: rd,
              rq: rq
            };
          }
          for (var p in buffer) {
            if (p !== 'parenthesisLevel'  &&  p !== 'beginsWithBond') {
              delete buffer[p];
            }
          }
          return ret;
        },
        'oxidation-output': function (buffer, m) {
          var ret = [ "{" ];
          mhchemParser.concatArray(ret, mhchemParser.go(m, 'oxidation'));
          ret.push("}");
          return ret;
        },
        'frac-output': function (buffer, m) {
          return { type_: 'frac-ce', p1: mhchemParser.go(m[0]), p2: mhchemParser.go(m[1]) };
        },
        'overset-output': function (buffer, m) {
          return { type_: 'overset', p1: mhchemParser.go(m[0]), p2: mhchemParser.go(m[1]) };
        },
        'underset-output': function (buffer, m) {
          return { type_: 'underset', p1: mhchemParser.go(m[0]), p2: mhchemParser.go(m[1]) };
        },
        'underbrace-output': function (buffer, m) {
          return { type_: 'underbrace', p1: mhchemParser.go(m[0]), p2: mhchemParser.go(m[1]) };
        },
        'color-output': function (buffer, m) {
          return { type_: 'color', color1: m[0], color2: mhchemParser.go(m[1]) };
        },
        'r=': function (buffer, m) { buffer.r = m; },
        'rdt=': function (buffer, m) { buffer.rdt = m; },
        'rd=': function (buffer, m) { buffer.rd = m; },
        'rqt=': function (buffer, m) { buffer.rqt = m; },
        'rq=': function (buffer, m) { buffer.rq = m; },
        'operator': function (buffer, m, p1) { return { type_: 'operator', kind_: (p1 || m) }; }
      }
    },
    'a': {
      transitions: mhchemParser.createTransitions({
        'empty': {
          '*': {} },
        '1/2$': {
          '0': { action_: '1/2' } },
        'else': {
          '0': { nextState: '1', revisit: true } },
        '$(...)$': {
          '*': { action_: 'tex-math tight', nextState: '1' } },
        ',': {
          '*': { action_: { type_: 'insert', option: 'commaDecimal' } } },
        'else2': {
          '*': { action_: 'copy' } }
      }),
      actions: {}
    },
    'o': {
      transitions: mhchemParser.createTransitions({
        'empty': {
          '*': {} },
        '1/2$': {
          '0': { action_: '1/2' } },
        'else': {
          '0': { nextState: '1', revisit: true } },
        'letters': {
          '*': { action_: 'rm' } },
        '\\ca': {
          '*': { action_: { type_: 'insert', option: 'circa' } } },
        '\\x{}{}|\\x{}|\\x': {
          '*': { action_: 'copy' } },
        '${(...)}$|$(...)$': {
          '*': { action_: 'tex-math' } },
        '{(...)}': {
          '*': { action_: '{text}' } },
        'else2': {
          '*': { action_: 'copy' } }
      }),
      actions: {}
    },
    'text': {
      transitions: mhchemParser.createTransitions({
        'empty': {
          '*': { action_: 'output' } },
        '{...}': {
          '*': { action_: 'text=' } },
        '${(...)}$|$(...)$': {
          '*': { action_: 'tex-math' } },
        '\\greek': {
          '*': { action_: [ 'output', 'rm' ] } },
        '\\,|\\x{}{}|\\x{}|\\x': {
          '*': { action_: [ 'output', 'copy' ] } },
        'else': {
          '*': { action_: 'text=' } }
      }),
      actions: {
        'output': function (buffer) {
          if (buffer.text_) {
            /** @type {ParserOutput} */
            var ret = { type_: 'text', p1: buffer.text_ };
            for (var p in buffer) { delete buffer[p]; }
            return ret;
          }
        }
      }
    },
    'pq': {
      transitions: mhchemParser.createTransitions({
        'empty': {
          '*': {} },
        'state of aggregation $': {
          '*': { action_: 'state of aggregation' } },
        'i$': {
          '0': { nextState: '!f', revisit: true } },
        '(KV letters),': {
          '0': { action_: 'rm', nextState: '0' } },
        'formula$': {
          '0': { nextState: 'f', revisit: true } },
        '1/2$': {
          '0': { action_: '1/2' } },
        'else': {
          '0': { nextState: '!f', revisit: true } },
        '${(...)}$|$(...)$': {
          '*': { action_: 'tex-math' } },
        '{(...)}': {
          '*': { action_: 'text' } },
        'a-z': {
          'f': { action_: 'tex-math' } },
        'letters': {
          '*': { action_: 'rm' } },
        '-9.,9': {
          '*': { action_: '9,9'  } },
        ',': {
          '*': { action_: { type_: 'insert+p1', option: 'comma enumeration S' } } },
        '\\color{(...)}{(...)}1|\\color(...){(...)}2': {
          '*': { action_: 'color-output' } },
        '\\color{(...)}0': {
          '*': { action_: 'color0-output' } },
        '\\ce{(...)}': {
          '*': { action_: 'ce' } },
        '\\,|\\x{}{}|\\x{}|\\x': {
          '*': { action_: 'copy' } },
        'else2': {
          '*': { action_: 'copy' } }
      }),
      actions: {
        'state of aggregation': function (buffer, m) {
          return { type_: 'state of aggregation subscript', p1: mhchemParser.go(m, 'o') };
        },
        'color-output': function (buffer, m) {
          return { type_: 'color', color1: m[0], color2: mhchemParser.go(m[1], 'pq') };
        }
      }
    },
    'bd': {
      transitions: mhchemParser.createTransitions({
        'empty': {
          '*': {} },
        'x$': {
          '0': { nextState: '!f', revisit: true } },
        'formula$': {
          '0': { nextState: 'f', revisit: true } },
        'else': {
          '0': { nextState: '!f', revisit: true } },
        '-9.,9 no missing 0': {
          '*': { action_: '9,9' } },
        '.': {
          '*': { action_: { type_: 'insert', option: 'electron dot' } } },
        'a-z': {
          'f': { action_: 'tex-math' } },
        'x': {
          '*': { action_: { type_: 'insert', option: 'KV x' } } },
        'letters': {
          '*': { action_: 'rm' } },
        '\'': {
          '*': { action_: { type_: 'insert', option: 'prime' } } },
        '${(...)}$|$(...)$': {
          '*': { action_: 'tex-math' } },
        '{(...)}': {
          '*': { action_: 'text' } },
        '\\color{(...)}{(...)}1|\\color(...){(...)}2': {
          '*': { action_: 'color-output' } },
        '\\color{(...)}0': {
          '*': { action_: 'color0-output' } },
        '\\ce{(...)}': {
          '*': { action_: 'ce' } },
        '\\,|\\x{}{}|\\x{}|\\x': {
          '*': { action_: 'copy' } },
        'else2': {
          '*': { action_: 'copy' } }
      }),
      actions: {
        'color-output': function (buffer, m) {
          return { type_: 'color', color1: m[0], color2: mhchemParser.go(m[1], 'bd') };
        }
      }
    },
    'oxidation': {
      transitions: mhchemParser.createTransitions({
        'empty': {
          '*': {} },
        'roman numeral': {
          '*': { action_: 'roman-numeral' } },
        '${(...)}$|$(...)$': {
          '*': { action_: 'tex-math' } },
        'else': {
          '*': { action_: 'copy' } }
      }),
      actions: {
        'roman-numeral': function (buffer, m) { return { type_: 'roman numeral', p1: m || "" }; }
      }
    },
    'tex-math': {
      transitions: mhchemParser.createTransitions({
        'empty': {
          '*': { action_: 'output' } },
        '\\ce{(...)}': {
          '*': { action_: [ 'output', 'ce' ] } },
        '{...}|\\,|\\x{}{}|\\x{}|\\x': {
          '*': { action_: 'o=' } },
        'else': {
          '*': { action_: 'o=' } }
      }),
      actions: {
        'output': function (buffer) {
          if (buffer.o) {
            /** @type {ParserOutput} */
            var ret = { type_: 'tex-math', p1: buffer.o };
            for (var p in buffer) { delete buffer[p]; }
            return ret;
          }
        }
      }
    },
    'tex-math tight': {
      transitions: mhchemParser.createTransitions({
        'empty': {
          '*': { action_: 'output' } },
        '\\ce{(...)}': {
          '*': { action_: [ 'output', 'ce' ] } },
        '{...}|\\,|\\x{}{}|\\x{}|\\x': {
          '*': { action_: 'o=' } },
        '-|+': {
          '*': { action_: 'tight operator' } },
        'else': {
          '*': { action_: 'o=' } }
      }),
      actions: {
        'tight operator': function (buffer, m) { buffer.o = (buffer.o || "") + "{"+m+"}"; },
        'output': function (buffer) {
          if (buffer.o) {
            /** @type {ParserOutput} */
            var ret = { type_: 'tex-math', p1: buffer.o };
            for (var p in buffer) { delete buffer[p]; }
            return ret;
          }
        }
      }
    },
    '9,9': {
      transitions: mhchemParser.createTransitions({
        'empty': {
          '*': {} },
        ',': {
          '*': { action_: 'comma' } },
        'else': {
          '*': { action_: 'copy' } }
      }),
      actions: {
        'comma': function () { return { type_: 'commaDecimal' }; }
      }
    },
    //#endregion
    //
    // \pu state machines
    //
    //#region pu
    'pu': {
      transitions: mhchemParser.createTransitions({
        'empty': {
          '*': { action_: 'output' } },
        'space$': {
          '*': { action_: [ 'output', 'space' ] } },
        '{[(|)]}': {
          '0|a': { action_: 'copy' } },
        '(-)(9)^(-9)': {
          '0': { action_: 'number^', nextState: 'a' } },
        '(-)(9.,9)(e)(99)': {
          '0': { action_: 'enumber', nextState: 'a' } },
        'space': {
          '0|a': {} },
        'pm-operator': {
          '0|a': { action_: { type_: 'operator', option: '\\pm' }, nextState: '0' } },
        'operator': {
          '0|a': { action_: 'copy', nextState: '0' } },
        '//': {
          'd': { action_: 'o=', nextState: '/' } },
        '/': {
          'd': { action_: 'o=', nextState: '/' } },
        '{...}|else': {
          '0|d': { action_: 'd=', nextState: 'd' },
          'a': { action_: [ 'space', 'd=' ], nextState: 'd' },
          '/|q': { action_: 'q=', nextState: 'q' } }
      }),
      actions: {
        'enumber': function (buffer, m) {
          /** @type {ParserOutput[]} */
          var ret = [];
          if (m[0] === "+-"  ||  m[0] === "+/-") {
            ret.push("\\pm ");
          } else if (m[0]) {
            ret.push(m[0]);
          }
          if (m[1]) {
            mhchemParser.concatArray(ret, mhchemParser.go(m[1], 'pu-9,9'));
            if (m[2]) {
              if (m[2].match(/[,.]/)) {
                mhchemParser.concatArray(ret, mhchemParser.go(m[2], 'pu-9,9'));
              } else {
                ret.push(m[2]);
              }
            }
            m[3] = m[4] || m[3];
            if (m[3]) {
              m[3] = m[3].trim();
              if (m[3] === "e"  ||  m[3].substr(0, 1) === "*") {
                ret.push({ type_: 'cdot' });
              } else {
                ret.push({ type_: 'times' });
              }
            }
          }
          if (m[3]) {
            ret.push("10^{"+m[5]+"}");
          }
          return ret;
        },
        'number^': function (buffer, m) {
          /** @type {ParserOutput[]} */
          var ret = [];
          if (m[0] === "+-"  ||  m[0] === "+/-") {
            ret.push("\\pm ");
          } else if (m[0]) {
            ret.push(m[0]);
          }
          mhchemParser.concatArray(ret, mhchemParser.go(m[1], 'pu-9,9'));
          ret.push("^{"+m[2]+"}");
          return ret;
        },
        'operator': function (buffer, m, p1) { return { type_: 'operator', kind_: (p1 || m) }; },
        'space': function () { return { type_: 'pu-space-1' }; },
        'output': function (buffer) {
          /** @type {ParserOutput | ParserOutput[]} */
          var ret;
          var md = mhchemParser.patterns.match_('{(...)}', buffer.d || "");
          if (md  &&  md.remainder === '') { buffer.d = md.match_; }
          var mq = mhchemParser.patterns.match_('{(...)}', buffer.q || "");
          if (mq  &&  mq.remainder === '') { buffer.q = mq.match_; }
          if (buffer.d) {
            buffer.d = buffer.d.replace(/\u00B0C|\^oC|\^{o}C/g, "{}^{\\circ}C");
            buffer.d = buffer.d.replace(/\u00B0F|\^oF|\^{o}F/g, "{}^{\\circ}F");
          }
          if (buffer.q) {  // fraction
            buffer.q = buffer.q.replace(/\u00B0C|\^oC|\^{o}C/g, "{}^{\\circ}C");
            buffer.q = buffer.q.replace(/\u00B0F|\^oF|\^{o}F/g, "{}^{\\circ}F");
            var b5 = {
              d: mhchemParser.go(buffer.d, 'pu'),
              q: mhchemParser.go(buffer.q, 'pu')
            };
            if (buffer.o === '//') {
              ret = { type_: 'pu-frac', p1: b5.d, p2: b5.q };
            } else {
              ret = b5.d;
              if (b5.d.length > 1  ||  b5.q.length > 1) {
                ret.push({ type_: ' / ' });
              } else {
                ret.push({ type_: '/' });
              }
              mhchemParser.concatArray(ret, b5.q);
            }
          } else {  // no fraction
            ret = mhchemParser.go(buffer.d, 'pu-2');
          }
          for (var p in buffer) { delete buffer[p]; }
          return ret;
        }
      }
    },
    'pu-2': {
      transitions: mhchemParser.createTransitions({
        'empty': {
          '*': { action_: 'output' } },
        '*': {
          '*': { action_: [ 'output', 'cdot' ], nextState: '0' } },
        '\\x': {
          '*': { action_: 'rm=' } },
        'space': {
          '*': { action_: [ 'output', 'space' ], nextState: '0' } },
        '^{(...)}|^(-1)': {
          '1': { action_: '^(-1)' } },
        '-9.,9': {
          '0': { action_: 'rm=', nextState: '0' },
          '1': { action_: '^(-1)', nextState: '0' } },
        '{...}|else': {
          '*': { action_: 'rm=', nextState: '1' } }
      }),
      actions: {
        'cdot': function () { return { type_: 'tight cdot' }; },
        '^(-1)': function (buffer, m) { buffer.rm += "^{"+m+"}"; },
        'space': function () { return { type_: 'pu-space-2' }; },
        'output': function (buffer) {
          /** @type {ParserOutput | ParserOutput[]} */
          var ret = [];
          if (buffer.rm) {
            var mrm = mhchemParser.patterns.match_('{(...)}', buffer.rm || "");
            if (mrm  &&  mrm.remainder === '') {
              ret = mhchemParser.go(mrm.match_, 'pu');
            } else {
              ret = { type_: 'rm', p1: buffer.rm };
            }
          }
          for (var p in buffer) { delete buffer[p]; }
          return ret;
        }
      }
    },
    'pu-9,9': {
      transitions: mhchemParser.createTransitions({
        'empty': {
          '0': { action_: 'output-0' },
          'o': { action_: 'output-o' } },
        ',': {
          '0': { action_: [ 'output-0', 'comma' ], nextState: 'o' } },
        '.': {
          '0': { action_: [ 'output-0', 'copy' ], nextState: 'o' } },
        'else': {
          '*': { action_: 'text=' } }
      }),
      actions: {
        'comma': function () { return { type_: 'commaDecimal' }; },
        'output-0': function (buffer) {
          /** @type {ParserOutput[]} */
          var ret = [];
          buffer.text_ = buffer.text_ || "";
          if (buffer.text_.length > 4) {
            var a = buffer.text_.length % 3;
            if (a === 0) { a = 3; }
            for (var i=buffer.text_.length-3; i>0; i-=3) {
              ret.push(buffer.text_.substr(i, 3));
              ret.push({ type_: '1000 separator' });
            }
            ret.push(buffer.text_.substr(0, a));
            ret.reverse();
          } else {
            ret.push(buffer.text_);
          }
          for (var p in buffer) { delete buffer[p]; }
          return ret;
        },
        'output-o': function (buffer) {
          /** @type {ParserOutput[]} */
          var ret = [];
          buffer.text_ = buffer.text_ || "";
          if (buffer.text_.length > 4) {
            var a = buffer.text_.length - 3;
            for (var i=0; i<a; i+=3) {
              ret.push(buffer.text_.substr(i, 3));
              ret.push({ type_: '1000 separator' });
            }
            ret.push(buffer.text_.substr(i));
          } else {
            ret.push(buffer.text_);
          }
          for (var p in buffer) { delete buffer[p]; }
          return ret;
        }
      }
    }
    //#endregion
  };

  //
  // texify: Take MhchemParser output and convert it to TeX
  //
  /** @type {Texify} */
  var texify = {
    go: function (input, isInner) {  // (recursive, max 4 levels)
      if (!input) { return ""; }
      var res = "";
      var cee = false;
      for (var i=0; i < input.length; i++) {
        var inputi = input[i];
        if (typeof inputi === "string") {
          res += inputi;
        } else {
          res += texify._go2(inputi);
          if (inputi.type_ === '1st-level escape') { cee = true; }
        }
      }
      if (!isInner && !cee && res) {
        res = "{" + res + "}";
      }
      return res;
    },
    _goInner: function (input) {
      if (!input) { return input; }
      return texify.go(input, true);
    },
    _go2: function (buf) {
      /** @type {undefined | string} */
      var res;
      switch (buf.type_) {
        case 'chemfive':
          res = "";
          var b5 = {
            a: texify._goInner(buf.a),
            b: texify._goInner(buf.b),
            p: texify._goInner(buf.p),
            o: texify._goInner(buf.o),
            q: texify._goInner(buf.q),
            d: texify._goInner(buf.d)
          };
          //
          // a
          //
          if (b5.a) {
            if (b5.a.match(/^[+\-]/)) { b5.a = "{"+b5.a+"}"; }
            res += b5.a + "\\,";
          }
          //
          // b and p
          //
          if (b5.b || b5.p) {
            res += "{\\vphantom{X}}";
            res += "^{\\hphantom{"+(b5.b||"")+"}}_{\\hphantom{"+(b5.p||"")+"}}";
            res += "{\\vphantom{X}}";
            res += "^{\\smash[t]{\\vphantom{2}}\\mathllap{"+(b5.b||"")+"}}";
            res += "_{\\vphantom{2}\\mathllap{\\smash[t]{"+(b5.p||"")+"}}}";
          }
          //
          // o
          //
          if (b5.o) {
            if (b5.o.match(/^[+\-]/)) { b5.o = "{"+b5.o+"}"; }
            res += b5.o;
          }
          //
          // q and d
          //
          if (buf.dType === 'kv') {
            if (b5.d || b5.q) {
              res += "{\\vphantom{X}}";
            }
            if (b5.d) {
              res += "^{"+b5.d+"}";
            }
            if (b5.q) {
              res += "_{\\smash[t]{"+b5.q+"}}";
            }
          } else if (buf.dType === 'oxidation') {
            if (b5.d) {
              res += "{\\vphantom{X}}";
              res += "^{"+b5.d+"}";
            }
            if (b5.q) {
              res += "{\\vphantom{X}}";
              res += "_{\\smash[t]{"+b5.q+"}}";
            }
          } else {
            if (b5.q) {
              res += "{\\vphantom{X}}";
              res += "_{\\smash[t]{"+b5.q+"}}";
            }
            if (b5.d) {
              res += "{\\vphantom{X}}";
              res += "^{"+b5.d+"}";
            }
          }
          break;
        case 'rm':
          res = "\\mathrm{"+buf.p1+"}";
          break;
        case 'text':
          if (buf.p1.match(/[\^_]/)) {
            buf.p1 = buf.p1.replace(" ", "~").replace("-", "\\text{-}");
            res = "\\mathrm{"+buf.p1+"}";
          } else {
            res = "\\text{"+buf.p1+"}";
          }
          break;
        case 'roman numeral':
          res = "\\mathrm{"+buf.p1+"}";
          break;
        case 'state of aggregation':
          res = "\\mskip2mu "+texify._goInner(buf.p1);
          break;
        case 'state of aggregation subscript':
          res = "\\mskip1mu "+texify._goInner(buf.p1);
          break;
        case 'bond':
          res = texify._getBond(buf.kind_);
          if (!res) {
            throw ["MhchemErrorBond", "mhchem Error. Unknown bond type (" + buf.kind_ + ")"];
          }
          break;
        case 'frac':
          var c = "\\frac{" + buf.p1 + "}{" + buf.p2 + "}";
          res = "\\mathchoice{\\textstyle"+c+"}{"+c+"}{"+c+"}{"+c+"}";
          break;
        case 'pu-frac':
          var d = "\\frac{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
          res = "\\mathchoice{\\textstyle"+d+"}{"+d+"}{"+d+"}{"+d+"}";
          break;
        case 'tex-math':
          res = buf.p1 + " ";
          break;
        case 'frac-ce':
          res = "\\frac{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
          break;
        case 'overset':
          res = "\\overset{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
          break;
        case 'underset':
          res = "\\underset{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
          break;
        case 'underbrace':
          res =  "\\underbrace{" + texify._goInner(buf.p1) + "}_{" + texify._goInner(buf.p2) + "}";
          break;
        case 'color':
          res = "{\\color{" + buf.color1 + "}{" + texify._goInner(buf.color2) + "}}";
          break;
        case 'color0':
          res = "\\color{" + buf.color + "}";
          break;
        case 'arrow':
          var b6 = {
            rd: texify._goInner(buf.rd),
            rq: texify._goInner(buf.rq)
          };
          var arrow = "\\x" + texify._getArrow(buf.r);
          if (b6.rq) { arrow += "[{" + b6.rq + "}]"; }
          if (b6.rd) {
            arrow += "{" + b6.rd + "}";
          } else {
            arrow += "{}";
          }
          res = arrow;
          break;
        case 'operator':
          res = texify._getOperator(buf.kind_);
          break;
        case '1st-level escape':
          res = buf.p1+" ";  // &, \\\\, \\hlin
          break;
        case 'space':
          res = " ";
          break;
        case 'entitySkip':
          res = "~";
          break;
        case 'pu-space-1':
          res = "~";
          break;
        case 'pu-space-2':
          res = "\\mkern3mu ";
          break;
        case '1000 separator':
          res = "\\mkern2mu ";
          break;
        case 'commaDecimal':
          res = "{,}";
          break;
          case 'comma enumeration L':
          res = "{"+buf.p1+"}\\mkern6mu ";
          break;
        case 'comma enumeration M':
          res = "{"+buf.p1+"}\\mkern3mu ";
          break;
        case 'comma enumeration S':
          res = "{"+buf.p1+"}\\mkern1mu ";
          break;
        case 'hyphen':
          res = "\\text{-}";
          break;
        case 'addition compound':
          res = "\\,{\\cdot}\\,";
          break;
        case 'electron dot':
          res = "\\mkern1mu \\bullet\\mkern1mu ";
          break;
        case 'KV x':
          res = "{\\times}";
          break;
        case 'prime':
          res = "\\prime ";
          break;
        case 'cdot':
          res = "\\cdot ";
          break;
        case 'tight cdot':
          res = "\\mkern1mu{\\cdot}\\mkern1mu ";
          break;
        case 'times':
          res = "\\times ";
          break;
        case 'circa':
          res = "{\\sim}";
          break;
        case '^':
          res = "uparrow";
          break;
        case 'v':
          res = "downarrow";
          break;
        case 'ellipsis':
          res = "\\ldots ";
          break;
        case '/':
          res = "/";
          break;
        case ' / ':
          res = "\\,/\\,";
          break;
        default:
          assertNever(buf);
          throw ["MhchemBugT", "mhchem bug T. Please report."];  // Missing texify rule or unknown MhchemParser output
      }
      assertString(res);
      return res;
    },
    _getArrow: function (a) {
      switch (a) {
        case "->": return "rightarrow";
        case "\u2192": return "rightarrow";
        case "\u27F6": return "rightarrow";
        case "<-": return "leftarrow";
        case "<->": return "leftrightarrow";
        case "<-->": return "rightleftarrows";
        case "<=>": return "rightleftharpoons";
        case "\u21CC": return "rightleftharpoons";
        case "<=>>": return "rightequilibrium";
        case "<<=>": return "leftequilibrium";
        default:
          assertNever(a);
     m     throw ["MhchemBugT", "mhchem bug T. Please report."];
      }
    },
    _getBond: function (a) {
      switch (a) {
        case "-": return "{-}";
        case "1": return "{-}";
        case "=": return "{=}";
        case "2": return "{=}";
        case "#": return "{\\equiv}";
        case "3": return "{\\equiv}";
        case "~": return "{\\tripledash}";
        case "~-": return "{\\mathrlap{\\raisebox{-.1em}{$-$}}\\raisebox{.1em}{$\\tripledash$}}";
        case "~=": return "{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$\\tripledash$}}-}";
        case "~--": return "{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$\\tripledash$}}-}";
        case "-~-": return "{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$-$}}\\tripledash}";
        case "...": return "{{\\cdot}{\\cdot}{\\cdot}}";
        case "....": return "{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";
        case "->": return "{\\rightarrow}";
        case "<-": return "{\\leftarrow}";
        case "<": return "{<}";
        case ">": return "{>}";
        default:
          assertNever(a);
          throw ["MhchemBugT", "mhchem bug T. Please report."];
      }
    },
    _getOperator: function (a) {
      switch (a) {
        case "+": return " {}+{} ";
        case "-": return " {}-{} ";
        case "=": return " {}={} ";
        case "<": return " {}<{} ";
        case ">": return " {}>{} ";
        case "<<": return " {}\\ll{} ";
        case ">>": return " {}\\gg{} ";
        case "\\pm": return " {}\\pm{} ";
        case "\\approx": return " {}\\approx{} ";
        case "$\\approx$": return " {}\\approx{} ";
        case "v": return " \\downarrow{} ";
        case "(v)": return " \\downarrow{} ";
        case "^": return " \\uparrow{} ";
        case "(^)": return " \\uparrow{} ";
        default:
          assertNever(a);
          throw ["MhchemBugT", "mhchem bug T. Please report."];
      }
    }
  };

  //
  // Helpers for code analysis
  // Will show type error at calling position
  //
  /** @param {number} a */
  function assertNever(a) {}
  /** @param {string} a */
  function assertString(a) {}
,xP 100644 render-a11y-string.ts o(X99%7h{ۗ40000 test vE&$xX//**
 * renderA11yString returns a readable string.
 *
 * In some cases the string will have the proper semantic math
 * meaning,:
 *   renderA11yString("\\frac{1}{2}"")
 *   -> "start fraction, 1, divided by, 2, end fraction"
 *
 * However, other cases do not:
 *   renderA11yString("f(x) = x^2")
 *   -> "f, left parenthesis, x, right parenthesis, equals, x, squared"
 *
 * The commas in the string aim to increase ease of understanding
 * when read by a screenreader.
 */

import {isAtom, type Atom} from "../../src/atoms";
import type {AnyParseNode} from "../../src/parseNode";
import type {SettingsOptions} from "../../src/Settings";
import katex from "katex";
const stringMap: Record<string, string> = {
    "(": "left parenthesis",
    ")": "right parenthesis",
    "[": "open bracket",
    "]": "close bracket",
    "\\{": "left brace",
    "\\}": "right brace",
    "\\lvert": "open vertical bar",
    "\\rvert": "close vertical bar",
    "|": "vertical bar",
    "\\uparrow": "up arrow",
    "\\Uparrow": "up arrow",
    "\\downarrow": "down arrow",
    "\\Downarrow": "down arrow",
    "\\updownarrow": "up down arrow",
    "\\leftarrow": "left arrow",
    "\\Leftarrow": "left arrow",
    "\\rightarrow": "right arrow",
    "\\Rightarrow": "right arrow",
    "\\langle": "open angle",
    "\\rangle": "close angle",
    "\\lfloor": "open floor",
    "\\rfloor": "close floor",
    "\\int": "integral",
    "\\intop": "integral",
    "\\lim": "limit",
    "\\ln": "natural log",
    "\\log": "log",
    "\\sin": "sine",
    "\\cos": "cosine",
    "\\tan": "tangent",
    "\\cot": "cotangent",
    "\\sum": "sum",
    "/": "slash",
    ",": "comma",
    ".": "point",
    "-": "negative",
    "+": "plus",
    "~": "tilde",
    ":": "colon",
    "?": "question mark",
    "'": "apostrophe",
    "\\%": "percent",
    " ": "space",
    "\\ ": "space",
    "\\$": "dollar sign",
    "\\angle": "angle",
    "\\degree": "degree",
    "\\circ": "circle",
    "\\vec": "vector",
    "\\triangle": "triangle",
    "\\pi": "pi",
    "\\prime": "prime",
    "\\infty": "infinity",
    "\\alpha": "alpha",
    "\\beta": "beta",
    "\\gamma": "gamma",
    "\\omega": "omega",
    "\\theta": "theta",
    "\\sigma": "sigma",
    "\\lambda": "lambda",
    "\\tau": "tau",
    "\\Delta": "delta",
    "\\delta": "delta",
    "\\mu": "mu",
    "\\rho": "rho",
    "\\nabla": "del",
    "\\ell": "ell",
    "\\ldots": "dots",
    // TODO: add entries for all accents
    "\\hat": "hat",
    "\\acute": "acute",
};
const powerMap: Record<string, string> = {
    "prime": "prime",
    "degree": "degrees",
    "circle": "degrees",
    "2": "squared",
    "3": "cubed",
};
const openMap: Record<string, string> = {
    "|": "open vertical bar",
    ".": "",
};
const closeMap: Record<string, string> = {
    "|": "close vertical bar",
    ".": "",
};
const binMap: Record<string, string> = {
    "+": "plus",
    "-": "minus",
    "\\pm": "plus minus",
    "\\cdot": "dot",
    "*": "times",
    "/": "divided by",
    "\\times": "times",
    "\\div": "divided by",
    "\\circ": "circle",
    "\\bullet": "bullet",
};
const relMap: Record<string, string> = {
    "=": "equals",
    "\\approx": "approximately equals",
    "≠": "does not equal",
    "\\geq": "is greater than or equal to",
    "\\ge": "is greater than or equal to",
    "\\leq": "is less than or equal to",
    "\\le": "is less than or equal to",
    ">": "is greater than",
    "<": "is less than",
    "\\leftarrow": "left arrow",
    "\\Leftarrow": "left arrow",
    "\\rightarrow": "right arrow",
    "\\Rightarrow": "right arrow",
    ":": "colon",
};
const accentUnderMap: Record<string, string> = {
    "\\underleftarrow": "left arrow",
    "\\underrightarrow": "right arrow",
    "\\underleftrightarrow": "left-right arrow",
    "\\undergroup": "group",
    "\\underlinesegment": "line segment",
    "\\utilde": "tilde",
};
type NestedArray<T> = Array<T | NestedArray<T>>;

const buildString = (
    str: string,
    type: Atom | "normal",
    a11yStrings: NestedArray<string>,
) => {
    if (!str) {
        return;
    }

    let ret;

    if (type === "open") {
        ret = str in openMap ? openMap[str] : stringMap[str] || str;
    } else if (type === "close") {
        ret = str in closeMap ? closeMap[str] : stringMap[str] || str;
    } else if (type === "bin") {
        ret = binMap[str] || str;
    } else if (type === "rel") {
        ret = relMap[str] || str;
    } else {
        ret = stringMap[str] || str;
    }

    // If the text to add is a number and there is already a string
    // in the list and the last string is a number then we should
    // combine them into a single number
    const last = a11yStrings[a11yStrings.length - 1];
    if (
        /^\d+$/.test(ret) &&
        a11yStrings.length > 0 &&
        typeof last === "string" &&
        /^\d+$/.test(last)
    ) {
        a11yStrings[a11yStrings.length - 1] += ret;
    } else if (ret) {
        a11yStrings.push(ret);
    }
};

const buildRegion = (
    a11yStrings: NestedArray<string>,
    callback: (regionStrings: NestedArray<string>) => void,
) => {
    const regionStrings: NestedArray<string> = [];
    a11yStrings.push(regionStrings);
    callback(regionStrings);
};

const handleObject = (
    tree: AnyParseNode,
    a11yStrings: NestedArray<string>,
    atomType: Atom | "normal",
) => {
     // Everything else is assumed to be an object...
    switch (tree.type) {
        case "accent": {
            buildRegion(a11yStrings, (a11yStrings) => {
                buildA11yStrings(tree.base, a11yStrings, atomType);
                a11yStrings.push("with");
                buildString(tree.label, "normal", a11yStrings);
                a11yStrings.push("on top");
            });
            break;
        }

        case "accentUnder": {
            buildRegion(a11yStrings, (a11yStrings) => {
                buildA11yStrings(tree.base, a11yStrings, atomType);
                a11yStrings.push("with");
                buildString(accentUnderMap[tree.label], "normal", a11yStrings);
                a11yStrings.push("underneath");
            });
            break;
        }

        case "accent-token": {
            // Used internally by accent symbols.
            break;
        }

        case "atom": {
            const {text} = tree;
            switch (tree.family) {
                case "bin": {
                    buildString(text, "bin", a11yStrings);
                    break;
                }
                case "close": {
                    buildString(text, "close", a11yStrings);
                    break;
                }
                // TODO(kevinb): figure out what should be done for inner
                case "inner": {
                    buildString(tree.text, "inner", a11yStrings);
                    break;
                }
                case "open": {
                    buildString(text, "open", a11yStrings);
                    break;
                }
                case "punct": {
                    buildString(text, "punct", a11yStrings);
                    break;
                }
                case "rel": {
                    buildString(text, "rel", a11yStrings);
                    break;
                }
                default: {
                    (tree.family as never);
                    throw new Error(`"${tree.family}" is not a valid atom type`);
                }
            }
            break;
        }

        case "color": {
            const color = tree.color.replace(/katex-/, "");

            buildRegion(a11yStrings, (regionStrings) => {
                regionStrings.push("start color " + color);
                buildA11yStrings(tree.body, regionStrings, atomType);
                regionStrings.push("end color " + color);
            });
            break;
        }

        case "color-token": {
            // Used by \color, \colorbox, and \fcolorbox but not directly rendered.
            // It's a leaf node and has no children so just break.
            break;
        }

        case "delimsizing": {
            if (tree.delim && tree.delim !== ".") {
                buildString(tree.delim, "normal", a11yStrings);
            }
            break;
        }

        case "genfrac": {
            buildRegion(a11yStrings, (regionStrings) => {
                // genfrac can have unbalanced delimiters
                const {leftDelim, rightDelim} = tree;

                // NOTE: Not sure if this is a safe assumption
                // hasBarLine true -> fraction, false -> binomial
                if (tree.hasBarLine) {
                    regionStrings.push("start fraction");
                    leftDelim && buildString(leftDelim, "open", regionStrings);
                    buildA11yStrings(tree.numer, regionStrings, atomType);
                    regionStrings.push("divided by");
                    buildA11yStrings(tree.denom, regionStrings, atomType);
                    rightDelim && buildString(rightDelim, "close", regionStrings);
                    regionStrings.push("end fraction");
                } else {
                    regionStrings.push("start binomial");
                    leftDelim && buildString(leftDelim, "open", regionStrings);
                    buildA11yStrings(tree.numer, regionStrings, atomType);
                    regionStrings.push("over");
                    buildA11yStrings(tree.denom, regionStrings, atomType);
                    rightDelim && buildString(rightDelim, "close", regionStrings);
                    regionStrings.push("end binomial");
                }
            });
            break;
        }

        case "hbox": {
            buildA11yStrings(tree.body, a11yStrings, atomType);
            break;
        }

        case "kern": {
            // No op: we don't attempt to present kerning information
            // to the screen reader.
            break;
        }

        case "leftright": {
            buildRegion(a11yStrings, (regionStrings) => {
                buildString(tree.left, "open", regionStrings);
                buildA11yStrings(tree.body, regionStrings, atomType);
                buildString(tree.right, "close", regionStrings);
            });
            break;
        }

        case "leftright-right": {
            // TODO: double check that this is a no-op
            break;
        }

        case "lap": {
            buildA11yStrings(tree.body, a11yStrings, atomType);
            break;
        }

        case "mathord": {
            buildString(tree.text, "normal", a11yStrings);
            break;
        }

        case "op": {
            const {body, name} = tree;
            if (body) {
                buildA11yStrings(body, a11yStrings, atomType);
            } else if (name) {
                buildString(name, "normal", a11yStrings);
            }
            break;
        }

        case "op-token": {
            // Used internally by operator symbols.
            buildString(tree.text, atomType, a11yStrings);
            break;
        }

        case "ordgroup": {
            buildA11yStrings(tree.body, a11yStrings, atomType);
            break;
        }

        case "overline": {
            buildRegion(a11yStrings, function(a11yStrings) {
                a11yStrings.push("start overline");
                buildA11yStrings(tree.body, a11yStrings, atomType);
                a11yStrings.push("end overline");
            });
            break;
        }

        case "pmb": {
            a11yStrings.push("bold");
            break;
        }

        case "phantom": {
            a11yStrings.push("empty space");
            break;
        }

        case "raisebox": {
            buildA11yStrings(tree.body, a11yStrings, atomType);
            break;
        }

        case "rule": {
            a11yStrings.push("rectangle");
            break;
        }

        case "sizing": {
            buildA11yStrings(tree.body, a11yStrings, atomType);
            break;
        }

        case "spacing": {
            a11yStrings.push("space");
            break;
        }

        case "styling": {
            // We ignore the styling and just pass through the contents
            buildA11yStrings(tree.body, a11yStrings, atomType);
            break;
        }

        case "sqrt": {
            buildRegion(a11yStrings, (regionStrings) => {
                const {body, index} = tree;
                if (index) {
                    const indexString = flatten(
                        buildA11yStrings(index, [], atomType)).join(",");
                    if (indexString === "3") {
                        regionStrings.push("cube root of");
                        buildA11yStrings(body, regionStrings, atomType);
                        regionStrings.push("end cube root");
                        return;
                    }

                    regionStrings.push("root");
                    regionStrings.push("start index");
                    buildA11yStrings(index, regionStrings, atomType);
                    regionStrings.push("end index");
                    return;
                }

                regionStrings.push("square root of");
                buildA11yStrings(body, regionStrings, atomType);
                regionStrings.push("end square root");
            });
            break;
        }

        case "supsub": {
            const {base, sub, sup} = tree;
            let isLog = false;

            if (base) {
                buildA11yStrings(base, a11yStrings, atomType);
                isLog = base.type === "op" && base.name === "\\log";
            }

            if (sub) {
                const regionName = isLog ? "base" : "subscript";
                buildRegion(a11yStrings, function(regionStrings) {
                    regionStrings.push(`start ${regionName}`);
                    buildA11yStrings(sub, regionStrings, atomType);
                    regionStrings.push(`end ${regionName}`);
                });
            }

            if (sup) {
                buildRegion(a11yStrings, function(regionStrings) {
                    const supString = flatten(
                        buildA11yStrings(sup, [], atomType)).join(",");

                    if (supString in powerMap) {
                        regionStrings.push(powerMap[supString]);
                        return;
                    }

                    regionStrings.push("start superscript");
                    buildA11yStrings(sup, regionStrings, atomType);
                    regionStrings.push("end superscript");
                });
            }
            break;
        }

        case "text": {
            // TODO: handle other fonts
            if (tree.font === "\\textbf") {
                buildRegion(a11yStrings, function(regionStrings) {
                    regionStrings.push("start bold text");
                    buildA11yStrings(tree.body, regionStrings, atomType);
                    regionStrings.push("end bold text");
                });
                break;
            }
            buildRegion(a11yStrings, function(regionStrings) {
                regionStrings.push("start text");
                buildA11yStrings(tree.body, regionStrings, atomType);
                regionStrings.push("end text");
            });
            break;
        }

        case "textord": {
            buildString(tree.text, atomType, a11yStrings);
            break;
        }

        case "smash": {
            buildA11yStrings(tree.body, a11yStrings, atomType);
            break;
        }

        case "enclose": {
            // TODO: create a map for these.
            // TODO: differentiate between a body with a single atom, e.g.
            // "cancel a" instead of "start cancel, a, end cancel"
            if (/cancel/.test(tree.label)) {
                buildRegion(a11yStrings, function(regionStrings) {
                    regionStrings.push("start cancel");
                    buildA11yStrings(tree.body, regionStrings, atomType);
                    regionStrings.push("end cancel");
                });
                break;
            } else if (/box/.test(tree.label)) {
                buildRegion(a11yStrings, function(regionStrings) {
                    regionStrings.push("start box");
                    buildA11yStrings(tree.body, regionStrings, atomType);
                    regionStrings.push("end box");
                });
                break;
            } else if (/sout/.test(tree.label)) {
                buildRegion(a11yStrings, function(regionStrings) {
                    regionStrings.push("start strikeout");
                    buildA11yStrings(tree.body, regionStrings, atomType);
                    regionStrings.push("end strikeout");
                });
                break;
            } else if (/phase/.test(tree.label)) {
                buildRegion(a11yStrings, function(regionStrings) {
                    regionStrings.push("start phase angle");
                    buildA11yStrings(tree.body, regionStrings, atomType);
                    regionStrings.push("end phase angle");
                });
                break;
            }
            throw new Error(
                `KaTeX-a11y: enclose node with ${tree.label} not supported yet`);
        }

        case "vcenter": {
            buildA11yStrings(tree.body, a11yStrings, atomType);
            break;
        }

        case "vphantom": {
            throw new Error("KaTeX-a11y: vphantom not implemented yet");
        }

        case "operatorname": {
            buildA11yStrings(tree.body, a11yStrings, atomType);
            break;
        }

        case "array": {
            throw new Error("KaTeX-a11y: array not implemented yet");
        }

        case "raw": {
            throw new Error("KaTeX-a11y: raw not implemented yet");
        }

        case "size": {
            // Although there are nodes of type "size" in the parse tree, they have
            // no semantic meaning and should be ignored.
            break;
        }

        case "url": {
            throw new Error("KaTeX-a11y: url not implemented yet");
        }

        case "tag": {
            throw new Error("KaTeX-a11y: tag not implemented yet");
        }

        case "verb": {
            buildString(`start verbatim`, "normal", a11yStrings);
            buildString(tree.body, "normal", a11yStrings);
            buildString(`end verbatim`, "normal", a11yStrings);
            break;
        }

        case "environment": {
            throw new Error("KaTeX-a11y: environment not implemented yet");
        }

        case "horizBrace": {
            buildString(`start ${tree.label.slice(1)}`, "normal", a11yStrings);
            buildA11yStrings(tree.base, a11yStrings, atomType);
            buildString(`end ${tree.label.slice(1)}`, "normal", a11yStrings);
            break;
        }

        case "infix": {
            // All infix nodes are replace with other nodes.
            break;
        }

        case "includegraphics": {
            throw new Error("KaTeX-a11y: includegraphics not implemented yet");
        }

        case "font": {
            // TODO: callout the start/end of specific fonts
            // TODO: map \BBb{N} to "the naturals" or something like that
            buildA11yStrings(tree.body, a11yStrings, atomType);
            break;
        }

        case "href": {
            throw new Error("KaTeX-a11y: href not implemented yet");
        }

        case "cr": {
            // This is used by environments.
            throw new Error("KaTeX-a11y: cr not implemented yet");
        }

        case "underline": {
            buildRegion(a11yStrings, function(a11yStrings) {
                a11yStrings.push("start underline");
                buildA11yStrings(tree.body, a11yStrings, atomType);
                a11yStrings.push("end underline");
            });
            break;
        }

        case "xArrow": {
            throw new Error("KaTeX-a11y: xArrow not implemented yet");
        }

        case "cdlabel": {
            throw new Error("KaTeX-a11y: cdlabel not implemented yet");
        }

        case "cdlabelparent": {
            throw new Error("KaTeX-a11y: cdlabelparent not implemented yet");
        }

        case "mclass": {
            // \neq and \ne are macros so we let "htmlmathml" render the mathmal
            // side of things and extract the text from that.
            // mclass values are prefixed with "m" (e.g. "mrel" -> "rel")
            const atomType = tree.mclass.slice(1);
            if (atomType === "normal" || isAtom(atomType)) {
                buildA11yStrings(tree.body, a11yStrings, atomType);
            } else {
                throw new Error(`Unexpected mclass atom type: "${atomType}"`);
            }
            break;
        }

        case "mathchoice": {
            // TODO: track which style we're using, e.g. display, text, etc.
            // default to text style if even that may not be the correct style
            buildA11yStrings(tree.text, a11yStrings, atomType);
            break;
        }

        case "htmlmathml": {
            buildA11yStrings(tree.mathml, a11yStrings, atomType);
            break;
        }

        case "middle": {
            buildString(tree.delim, atomType, a11yStrings);
            break;
        }

        case "internal": {
            // internal nodes are never included in the parse tree
            break;
        }

        case "html": {
            buildA11yStrings(tree.body, a11yStrings, atomType);
            break;
        }

        default:
            throw new Error("KaTeX a11y un-recognized type: " + (tree as AnyParseNode).type);
    }
};

const buildA11yStrings = (
    tree: AnyParseNode | AnyParseNode[],
    a11yStrings: NestedArray<string> = [],
    atomType: Atom | "normal",
) => {
    if (tree instanceof Array) {
        for (let i = 0; i < tree.length; i++) {
            buildA11yStrings(tree[i], a11yStrings, atomType);
        }
    } else {
        handleObject(tree, a11yStrings, atomType);
    }

    return a11yStrings;
};

const flatten = function(array: NestedArray<string>): string[] {
    let result: string[] = [];

    array.forEach(function(item) {
        if (Array.isArray(item)) {
            result = result.concat(flatten(item));
        } else {
            result.push(item);
        }
    });

    return result;
};

const renderA11yString = function(
    text: string,
    settings?: SettingsOptions,
): string {
    const tree = katex.__parse(text, settings);
    const a11yStrings = buildA11yStrings(tree, [], "normal");

    return flatten(a11yStrings).join(", ");
};

export default renderA11yString;
+x6 100644 render-a11y-string-spec.ts Yuf09gSt(	xCKimport renderA11yString from "../render-a11y-string";

describe("renderA11yString", () => {
    describe("basic expressions", () => {
        test("simple addition", () => {
            const result = renderA11yString("1 + 2");
            expect(result).toMatchInlineSnapshot(`"1, plus, 2"`);
        });
    });

    describe("accent", () => {
        test("\\vec", () => {
            const result = renderA11yString("\\vec{a}");
            expect(result).toMatchInlineSnapshot(`"a, with, vector, on top"`);
        });

        test("\\acute{a}", () => {
            const result = renderA11yString("\\acute{a}");
            expect(result).toMatchInlineSnapshot(`"a, with, acute, on top"`);
        });

        test("\\hat{a}", () => {
            const result = renderA11yString("\\hat{a}");
            expect(result).toMatchInlineSnapshot(`"a, with, hat, on top"`);
        });
    });

    describe("accentUnder", () => {
        test("\\underleftarrow", () => {
            const result = renderA11yString("\\underleftarrow{1+2}");
            expect(result).toMatchInlineSnapshot(
                `"1, plus, 2, with, left arrow, underneath"`,
            );
        });

        test("\\underlinesegment", () => {
            const result = renderA11yString("\\underlinesegment{1+2}");
            expect(result).toMatchInlineSnapshot(
                `"1, plus, 2, with, line segment, underneath"`,
            );
        });
    });

    describe("atom", () => {
        test("punct", () => {
            const result = renderA11yString("1, 2, 3");
            expect(result).toMatchInlineSnapshot(`"1, comma, 2, comma, 3"`);
        });
    });

    describe("color", () => {
        test("\\color{red}", () => {
            const result = renderA11yString("\\color{red}1+2");
            expect(result).toMatchInlineSnapshot(
                `"start color red, 1, plus, 2, end color red"`,
            );
        });

        test("\\color{FF0000}", () => {
            const result = renderA11yString("\\color{FF0000}1+2");
            expect(result).toMatchInlineSnapshot(
                `"start color #FF0000, 1, plus, 2, end color #FF0000"`,
            );
        });

        // colorIsTextColor is an option added in KaTeX 0.9.0 for backward
        // compatibility. It makes \color parse like \textcolor. We use it
        // in the KA webapp, and need it here because the tests are written
        // assuming it is set.
        test("\\color{red} with {colorIsTextColor: true}", () => {
            const result = renderA11yString("\\color{red}1+2", {
                colorIsTextColor: true,
            });
            expect(result).toMatchInlineSnapshot(
                `"start color red, 1, end color red, plus, 2"`,
            );
        });

        test("\\textcolor{red}", () => {
            const result = renderA11yString("\\textcolor{red}1+2");
            expect(result).toMatchInlineSnapshot(
                `"start color red, 1, end color red, plus, 2"`,
            );
        });
    });

    describe("delimiters", () => {
        test("simple parens", () => {
            const result = renderA11yString("(1 + 3)");
            expect(result).toMatchInlineSnapshot(
                `"left parenthesis, 1, plus, 3, right parenthesis"`,
            );
        });

        test("simple brackets", () => {
            const result = renderA11yString("[1 + 3]");
            expect(result).toMatchInlineSnapshot(
                `"open bracket, 1, plus, 3, close bracket"`,
            );
        });

        test("nested parens", () => {
            const result = renderA11yString("(a + (b + c))");
            expect(result).toMatchInlineSnapshot(
                `"left parenthesis, a, plus, left parenthesis, b, plus, c, right parenthesis, right parenthesis"`,
            );
        });

        test("stretchy parens around fractions", () => {
            const result = renderA11yString("\\left(\\frac{1}{x}\\right)");
            expect(result).toMatchInlineSnapshot(
                `"left parenthesis, start fraction, 1, divided by, x, end fraction, right parenthesis"`,
            );
        });
    });

    describe("delimsizing", () => {
        test("\\bigl(1+2\\bigr)", () => {
            const result = renderA11yString("\\bigl(1+2\\bigr)");
            expect(result).toMatchInlineSnapshot(
                `"left parenthesis, 1, plus, 2, right parenthesis"`,
            );
        });
    });

    describe("enclose", () => {
        test("\\cancel", () => {
            const result = renderA11yString("\\cancel{a}");
            expect(result).toMatchInlineSnapshot(
                `"start cancel, a, end cancel"`,
            );
        });

        test("\\fbox", () => {
            const result = renderA11yString("\\fbox{a}");
            expect(result).toMatchInlineSnapshot(`"start box, a, end box"`);
        });

        test("\\boxed", () => {
            const result = renderA11yString("\\boxed{a}");
            expect(result).toMatchInlineSnapshot(`"start box, a, end box"`);
        });

        test("\\sout", () => {
            const result = renderA11yString("\\text{\\sout{a}}");
            expect(result).toMatchInlineSnapshot(
                `"start text, start strikeout, a, end strikeout, end text"`,
            );
        });
    });

    describe("phase", () => {
        test("\\phase", () => {
            const result = renderA11yString("\\phase{a}");
            expect(result).toMatchInlineSnapshot(
                `"start phase angle, a, end phase angle"`,
            );
        });
    });

    describe("exponents", () => {
        test("simple exponent", () => {
            const result = renderA11yString("e^x");
            expect(result).toMatchInlineSnapshot(
                `"e, start superscript, x, end superscript"`,
            );
        });

        test("^{\\circ} => degrees", () => {
            const result = renderA11yString("90^{\\circ}");
            expect(result).toMatchInlineSnapshot(`"90, degrees"`);
        });

        test("^{\\degree} => degrees", () => {
            const result = renderA11yString("90^{\\degree}");
            expect(result).toMatchInlineSnapshot(`"90, degrees"`);
        });

        test("^{\\prime} => prime", () => {
            const result = renderA11yString("f^{\\prime}");
            expect(result).toMatchInlineSnapshot(`"f, prime"`);
        });

        test("^2 => squared", () => {
            const result = renderA11yString("x^2");
            expect(result).toMatchInlineSnapshot(`"x, squared"`);
        });

        test("^3 => cubed", () => {
            const result = renderA11yString("x^3");
            expect(result).toMatchInlineSnapshot(`"x, cubed"`);
        });

        test("log_2", () => {
            const result = renderA11yString("\\log_2{x+1}");
            expect(result).toMatchInlineSnapshot(
                `"log, start base, 2, end base, x, plus, 1"`,
            );
        });

        test("a_{n+1}", () => {
            const result = renderA11yString("a_{n+1}");
            expect(result).toMatchInlineSnapshot(
                `"a, start subscript, n, plus, 1, end subscript"`,
            );
        });
    });

    describe("genfrac", () => {
        test("simple fractions", () => {
            const result = renderA11yString("\\frac{2}{3}");
            expect(result).toMatchInlineSnapshot(
                `"start fraction, 2, divided by, 3, end fraction"`,
            );
        });

        test("nested fractions", () => {
            const result = renderA11yString("\\frac{1}{1+\\frac{1}{x}}");
            // TODO: this result is ambiguous, we need to fix this
            expect(result).toMatchInlineSnapshot(
                `"start fraction, 1, divided by, 1, plus, start fraction, 1, divided by, x, end fraction, end fraction"`,
            );
        });

        test("binomials", () => {
            const result = renderA11yString("\\binom{n}{k}");
            // TODO: drop the parenthesis as they're not normally read
            expect(result).toMatchInlineSnapshot(
                `"start binomial, left parenthesis, n, over, k, right parenthesis, end binomial"`,
            );
        });
    });

    describe("horizBrace", () => {
        test("\\overbrace", () => {
            const result = renderA11yString("\\overbrace{1+2}");
            expect(result).toMatchInlineSnapshot(
                `"start overbrace, 1, plus, 2, end overbrace"`,
            );
        });

        test("\\underbrace", () => {
            const result = renderA11yString("\\underbrace{1+2}");
            expect(result).toMatchInlineSnapshot(
                `"start underbrace, 1, plus, 2, end underbrace"`,
            );
        });

        test("\\overbracket", () => {
            const result = renderA11yString("\\overbracket{1+2}");
            expect(result).toMatchInlineSnapshot(
                `"start overbracket, 1, plus, 2, end overbracket"`,
            );
        });

        test("\\underbracket", () => {
            const result = renderA11yString("\\underbracket{1+2}");
            expect(result).toMatchInlineSnapshot(
                `"start underbracket, 1, plus, 2, end underbracket"`,
            );
        });
    });

    describe("infix", () => {
        test("\\over", () => {
            const result = renderA11yString("a \\over b");
            expect(result).toMatchInlineSnapshot(
                `"start fraction, a, divided by, b, end fraction"`,
            );
        });

        test("\\choose", () => {
            const result = renderA11yString("a \\choose b");
            expect(result).toMatchInlineSnapshot(
                `"start binomial, left parenthesis, a, over, b, right parenthesis, end binomial"`,
            );
        });

        test("\\above", () => {
            const result = renderA11yString("a \\above{2pt} b");
            expect(result).toMatchInlineSnapshot(
                `"start fraction, a, divided by, b, end fraction"`,
            );
        });
    });

    describe("hbox", () => {
        test("\\hbox", () => {
            const result = renderA11yString("x+\\hbox{y}");
            expect(result).toMatchInlineSnapshot(`"x, plus, y"`);
        });
    });

    describe("inner", () => {
        test("\\ldots", () => {
            const result = renderA11yString("\\ldots");
            expect(result).toMatchInlineSnapshot(`"dots"`);
        });
    });

    describe("lap", () => {
        test("\\llap", () => {
            const result = renderA11yString("a\\llap{b}");
            expect(result).toMatchInlineSnapshot(
                `"a, start text, b, end text"`,
            );
        });

        test("\\rlap", () => {
            const result = renderA11yString("a\\rlap{b}");
            expect(result).toMatchInlineSnapshot(
                `"a, start text, b, end text"`,
            );
        });
    });

    describe("middle", () => {
        test("\\middle", () => {
            const result = renderA11yString("\\left(a\\middle|b\\right)");
            expect(result).toMatchInlineSnapshot(
                `"left parenthesis, a, vertical bar, b, right parenthesis"`,
            );
        });
    });

    describe("mod", () => {
        test("\\mod", () => {
            const result = renderA11yString("\\mod{23}");
            // TODO: drop the "space"
            // TODO: collate m, o, d... we should fix this inside of KaTeX since
            // this affects the HTML and MathML output as well
            expect(result).toMatchInlineSnapshot(`"space, m, o, d, 23"`);
        });
    });

    describe("op", () => {
        test("\\lim", () => {
            const result = renderA11yString("\\lim{x+1}");
            // TODO: add begin/end to track argument of operators
            expect(result).toMatchInlineSnapshot(`"limit, x, plus, 1"`);
        });

        test("\\sin 2\\pi", () => {
            const result = renderA11yString("\\sin{2\\pi}");
            // TODO: add begin/end to track argument of operators
            expect(result).toMatchInlineSnapshot(`"sine, 2, pi"`);
        });

        test("\\sum_{i=0}", () => {
            const result = renderA11yString("\\sum_{i=0}");
            expect(result).toMatchInlineSnapshot(
                `"sum, start subscript, i, equals, 0, end subscript"`,
            );
        });

        test("\u2211_{i=0}", () => {
            const result = renderA11yString("\u2211_{i=0}");
            expect(result).toMatchInlineSnapshot(
                `"sum, start subscript, i, equals, 0, end subscript"`,
            );
        });
    });

    describe("operatorname", () => {
        test("\\limsup", () => {
            const result = renderA11yString("\\limsup");
            // TODO: collate strings so that this is "lim, sup"
            // NOTE: this also affect HTML and MathML output
            expect(result).toMatchInlineSnapshot(`"l, i, m, s, u, p"`);
        });

        test("\\liminf", () => {
            const result = renderA11yString("\\liminf");
            expect(result).toMatchInlineSnapshot(`"l, i, m, i, n, f"`);
        });

        test("\\argmin", () => {
            const result = renderA11yString("\\argmin");
            expect(result).toMatchInlineSnapshot(`"a, r, g, m, i, n"`);
        });
    });

    describe("overline", () => {
        test("\\overline", () => {
            const result = renderA11yString("\\overline{1+2}");
            expect(result).toMatchInlineSnapshot(
                `"start overline, 1, plus, 2, end overline"`,
            );
        });
    });

    describe("phantom", () => {
        test("\\phantom", () => {
            const result = renderA11yString("1+\\phantom{2}");
            expect(result).toMatchInlineSnapshot(`"1, plus, empty space"`);
        });
    });

    describe("raisebox", () => {
        test("\\raisebox", () => {
            const result = renderA11yString("x+\\raisebox{1em}{y}");
            expect(result).toMatchInlineSnapshot(`"x, plus, y"`);
        });
    });

    describe("relations", () => {
        test("1 \\neq 2", () => {
            const result = renderA11yString("1 \\neq 2");
            expect(result).toMatchInlineSnapshot(`"1, does not equal, 2"`);
        });

        test("1 \\ne 2", () => {
            const result = renderA11yString("1 \\ne 2");
            expect(result).toMatchInlineSnapshot(`"1, does not equal, 2"`);
        });

        test("1 \\geq 2", () => {
            const result = renderA11yString("1 \\geq 2");
            expect(result).toMatchInlineSnapshot(
                `"1, is greater than or equal to, 2"`,
            );
        });

        test("1 \\ge 2", () => {
            const result = renderA11yString("1 \\ge 2");
            expect(result).toMatchInlineSnapshot(
                `"1, is greater than or equal to, 2"`,
            );
        });

        test("1 \\leq 2", () => {
            const result = renderA11yString("1 \\leq 3");
            expect(result).toMatchInlineSnapshot(
                `"1, is less than or equal to, 3"`,
            );
        });

        test("1 \\le 2", () => {
            const result = renderA11yString("1 \\le 3");
            expect(result).toMatchInlineSnapshot(
                `"1, is less than or equal to, 3"`,
            );
        });
    });

    describe("rule", () => {
        test("\\rule", () => {
            const result = renderA11yString("\\rule{1em}{1em}");
            expect(result).toMatchInlineSnapshot(`"rectangle"`);
        });
    });

    describe("smash", () => {
        test("1 + \\smash{2}", () => {
            const result = renderA11yString("1 + \\smash{2}");
            expect(result).toMatchInlineSnapshot(`"1, plus, 2"`);
        });
    });

    describe("sqrt", () => {
        test("square root", () => {
            const result = renderA11yString("\\sqrt{x + 1}");
            expect(result).toMatchInlineSnapshot(
                `"square root of, x, plus, 1, end square root"`,
            );
        });

        test("nest square root", () => {
            const result = renderA11yString("\\sqrt{x + \\sqrt{y}}");
            // TODO: this sounds ambiguous as well... we should probably say "start square root"
            expect(result).toMatchInlineSnapshot(
                `"square root of, x, plus, square root of, y, end square root, end square root"`,
            );
        });

        test("cube root", () => {
            const result = renderA11yString("\\sqrt[3]{x + 1}");
            expect(result).toMatchInlineSnapshot(
                `"cube root of, x, plus, 1, end cube root"`,
            );
        });

        test("nth root", () => {
            const result = renderA11yString("\\sqrt[n]{x + 1}");
            expect(result).toMatchInlineSnapshot(
                `"root, start index, n, end index"`,
            );
        });
    });

    describe("sizing", () => {
        test("\\Huge is ignored", () => {
            const result = renderA11yString("\\Huge{a+b}");
            expect(result).toMatchInlineSnapshot(`"a, plus, b"`);
        });

        test("\\small is ignored", () => {
            const result = renderA11yString("\\small{a+b}");
            expect(result).toMatchInlineSnapshot(`"a, plus, b"`);
        });

        // We don't need to test all sizing commands since all style
        // nodes are treated in the same way.
    });

    describe("styling", () => {
        test("\\displaystyle is ignored", () => {
            const result = renderA11yString("\\displaystyle{a+b}");
            expect(result).toMatchInlineSnapshot(`"a, plus, b"`);
        });

        test("\\textstyle is ignored", () => {
            const result = renderA11yString("\\textstyle{a+b}");
            expect(result).toMatchInlineSnapshot(`"a, plus, b"`);
        });

        // We don't need to test all styling commands since all style
        // nodes are treated in the same way.
    });

    describe("text", () => {
        test("\\text", () => {
            const result = renderA11yString("\\text{hello}");
            expect(result).toMatchInlineSnapshot(
                `"start text, h, e, l, l, o, end text"`,
            );
        });

        test("\\textbf", () => {
            const result = renderA11yString("\\textbf{hello}");
            expect(result).toMatchInlineSnapshot(
                `"start bold text, h, e, l, l, o, end bold text"`,
            );
        });
    });

    describe("underline", () => {
        test("\\underline", () => {
            const result = renderA11yString("\\underline{1+2}");
            expect(result).toMatchInlineSnapshot(
                `"start underline, 1, plus, 2, end underline"`,
            );
        });
    });

    describe("vcenter", () => {
        test("\\vcenter", () => {
            const result = renderA11yString("x+\\vcenter{y}");
            expect(result).toMatchInlineSnapshot(`"x, plus, y"`);
        });
    });

    describe("verb", () => {
        test("\\verb", () => {
            const result = renderA11yString("\\verb|hello|");
            expect(result).toMatchInlineSnapshot(
                `"start verbatim, hello, end verbatim"`,
            );
        });
    });
});
Hܮx~100644 README.md xeI 3G040000 contrib N`eͮl.40000 fonts 9	+4!g^+hqk^Y_100644 katex-swap.css ź9ٹ0B100644 katex-swap.min.css W
ٲqIݸ100644 katex.css $ b{B sO[h100644 katex.js - 2QݡI÷BY100644 katex.min.css lFj*dp;100644 katex.min.js 8b/~SiBe_100644 katex.mjs ;K{1D~Dx#sAa	*x[100644 auto-render.js 6ϟp+g|X4Mg100644 auto-render.min.js 
5Th4leqpV100644 auto-render.mjs {ӌl6Uij斃J100644 copy-tex.js ˚CvMS100644 copy-tex.min.js  U4\%c+=MR100644 copy-tex.mjs Ιw܄n7`#*cH100644 mathtex-script-type.js leSW˙E)빶100644 mathtex-script-type.min.js tu|bo|v100644 mathtex-script-type.mjs OeS#+VC{100644 mhchem.js 
Jm\&CTVf^|z100644 mhchem.min.js +?T@]Fkق[$100644 mhchem.mjs 6]H M_h100644 render-a11y-string.js U۲e$hwVO1100644 render-a11y-string.min.js =u``b2j100644 render-a11y-string.mjs 
rސ5_ؘoŅJƱx!)(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("katex"));
	else if(typeof define === 'function' && define.amd)
		define(["katex"], factory);
	else if(typeof exports === 'object')
		exports["renderMathInElement"] = factory(require("katex"));
	else
		root["renderMathInElement"] = factory(root["katex"]);
})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__757__) {
return /******/ (function() { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ 757:
/***/ (function(module) {

module.exports = __WEBPACK_EXTERNAL_MODULE__757__;

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": function() { return /* binding */ auto_render; }
});

// EXTERNAL MODULE: external "katex"
var external_katex_ = __webpack_require__(757);
var external_katex_default = /*#__PURE__*/__webpack_require__.n(external_katex_);
;// ./contrib/auto-render/splitAtDelimiters.ts
/* eslint no-constant-condition:0 */

const findEndOfMath = function (delimiter, text, startIndex) {
  // Adapted from
  // https://github.com/Khan/perseus/blob/master/src/perseus-markdown.jsx
  let index = startIndex;
  let braceLevel = 0;
  const delimLength = delimiter.length;
  while (index < text.length) {
    const character = text[index];
    if (braceLevel <= 0 && text.slice(index, index + delimLength) === delimiter) {
      return index;
    } else if (character === "\\") {
      index++;
    } else if (character === "{") {
      braceLevel++;
    } else if (character === "}") {
      braceLevel--;
    }
    index++;
  }
  return -1;
};
const escapeRegex = function (string) {
  return string.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
};
const amsRegex = /^\\begin{/;
const splitAtDelimiters = function (text, delimiters) {
  let index;
  const data = [];
  const regexLeft = new RegExp("(" + delimiters.map(x => escapeRegex(x.left)).join("|") + ")");
  while (true) {
    index = text.search(regexLeft);
    if (index === -1) {
      break;
    }
    if (index > 0) {
      data.push({
        type: "text",
        data: text.slice(0, index)
      });
      text = text.slice(index); // now text starts with delimiter
    }
    // ... so this always succeeds:
    const i = delimiters.findIndex(delim => text.startsWith(delim.left));
    index = findEndOfMath(delimiters[i].right, text, delimiters[i].left.length);
    if (index === -1) {
      break;
    }
    const rawData = text.slice(0, index + delimiters[i].right.length);
    const math = amsRegex.test(rawData) ? rawData : text.slice(delimiters[i].left.length, index);
    data.push({
      type: "math",
      data: math,
      rawData,
      display: delimiters[i].display
    });
    text = text.slice(index + delimiters[i].right.length);
  }
  if (text !== "") {
    data.push({
      type: "text",
      data: text
    });
  }
  return data;
};
/* harmony default export */ var auto_render_splitAtDelimiters = (splitAtDelimiters);
;// ./contrib/auto-render/auto-render.ts
/* eslint no-console:0 */



/* Note: optionsCopy is mutated by this method. If it is ever exposed in the
 * API, we should copy it before mutating.
 */
const renderMathInText = function (text, optionsCopy) {
  const data = auto_render_splitAtDelimiters(text, optionsCopy.delimiters);
  if (data.length === 1 && data[0].type === 'text') {
    // There is no formula in the text.
    // Let's return null which means there is no need to replace
    // the current text node with a new one.
    return null;
  }
  const fragment = document.createDocumentFragment();
  for (let i = 0; i < data.length; i++) {
    if (data[i].type === "text") {
      fragment.appendChild(document.createTextNode(data[i].data));
    } else {
      const span = document.createElement("span");
      let math = data[i].data;
      // Override any display mode defined in the settings with that
      // defined by the text itself
      optionsCopy.displayMode = data[i].display;
      try {
        if (optionsCopy.preProcess) {
          math = optionsCopy.preProcess(math);
        }
        external_katex_default().render(math, span, optionsCopy);
      } catch (e) {
        if (!(e instanceof (external_katex_default()).ParseError)) {
          throw e;
        }
        optionsCopy.errorCallback("KaTeX auto-render: Failed to parse `" + data[i].data + "` with ", e);
        fragment.appendChild(document.createTextNode(data[i].rawData));
        continue;
      }
      fragment.appendChild(span);
    }
  }
  return fragment;
};
const renderElem = function (elem, optionsCopy) {
  for (let i = 0; i < elem.childNodes.length; i++) {
    const childNode = elem.childNodes[i];
    if (childNode.nodeType === 3) {
      var _childNode$textConten;
      // Text node
      // Concatenate all sibling text nodes.
      // Webkit browsers split very large text nodes into smaller ones,
      // so the delimiters may be split across different nodes.
      let textContentConcat = (_childNode$textConten = childNode.textContent) != null ? _childNode$textConten : "";
      let sibling = childNode.nextSibling;
      let nSiblings = 0;
      while (sibling && sibling.nodeType === Node.TEXT_NODE) {
        var _sibling$textContent;
        textContentConcat += (_sibling$textContent = sibling.textContent) != null ? _sibling$textContent : "";
        sibling = sibling.nextSibling;
        nSiblings++;
      }
      const frag = renderMathInText(textContentConcat, optionsCopy);
      if (frag) {
        // Remove extra text nodes
        for (let j = 0; j < nSiblings; j++) {
          childNode.nextSibling.remove();
        }
        i += frag.childNodes.length - 1;
        elem.replaceChild(frag, childNode);
      } else {
        // If the concatenated text does not contain math
        // the siblings will not either
        i += nSiblings;
      }
    } else if (childNode.nodeType === 1) {
      // Element node
      const className = ' ' + childNode.className + ' ';
      const shouldRender = !optionsCopy.ignoredTags.has(childNode.nodeName.toLowerCase()) && optionsCopy.ignoredClasses.every(x => !className.includes(' ' + x + ' '));
      if (shouldRender) {
        renderElem(childNode, optionsCopy);
      }
    }
    // Otherwise, it's something else, and ignore it.
  }
};
const renderMathInElement = function (elem, options) {
  if (!elem) {
    throw new Error("No element provided to render");
  }
  const optionsCopy = {};
  Object.assign(optionsCopy, options);

  // default options
  optionsCopy.delimiters = optionsCopy.delimiters || [{
    left: "$$",
    right: "$$",
    display: true
  }, {
    left: "\\(",
    right: "\\)",
    display: false
  },
  // LaTeX uses $…$, but it ruins the display of normal `$` in text:
  // {left: "$", right: "$", display: false},
  // $ must come after $$

  // Render AMS environments even if outside $$…$$ delimiters.
  {
    left: "\\begin{equation}",
    right: "\\end{equation}",
    display: true
  }, {
    left: "\\begin{align}",
    right: "\\end{align}",
    display: true
  }, {
    left: "\\begin{alignat}",
    right: "\\end{alignat}",
    display: true
  }, {
    left: "\\begin{gather}",
    right: "\\end{gather}",
    display: true
  }, {
    left: "\\begin{CD}",
    right: "\\end{CD}",
    display: true
  }, {
    left: "\\[",
    right: "\\]",
    display: true
  }];
  optionsCopy.ignoredTags = new Set((options == null ? void 0 : options.ignoredTags) || ["script", "noscript", "style", "textarea", "pre", "code", "option"]);
  optionsCopy.ignoredClasses = optionsCopy.ignoredClasses || [];
  optionsCopy.errorCallback = optionsCopy.errorCallback || console.error;

  // Enable sharing of global macros defined via `\gdef` between different
  // math elements within a single call to `renderMathInElement`.
  optionsCopy.macros = optionsCopy.macros || {};
  renderElem(elem, optionsCopy);
};
/* harmony default export */ var auto_render = (renderMathInElement);
__webpack_exports__ = __webpack_exports__["default"];
/******/ 	return __webpack_exports__;
/******/ })()
;
});_xa!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("katex")):"function"==typeof define&&define.amd?define(["katex"],t):"object"==typeof exports?exports.renderMathInElement=t(require("katex")):e.renderMathInElement=t(e.katex)}("undefined"!=typeof self?self:this,function(e){return function(){"use strict";var t={757:function(t){t.exports=e}},n={};function r(e){var o=n[e];if(void 0!==o)return o.exports;var i=n[e]={exports:{}};return t[e](i,i.exports,r),i.exports}r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,{a:t}),t},r.d=function(e,t){for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o={};r.d(o,{default:function(){return p}});var i=r(757),a=r.n(i);const l=function(e,t,n){let r=n,o=0;const i=e.length;for(;r<t.length;){const n=t[r];if(o<=0&&t.slice(r,r+i)===e)return r;"\\"===n?r++:"{"===n?o++:"}"===n&&o--,r++}return-1},s=/^\\begin{/;var d=function(e,t){let n;const r=[],o=new RegExp("("+t.map(e=>e.left.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")).join("|")+")");for(;n=e.search(o),-1!==n;){n>0&&(r.push({type:"text",data:e.slice(0,n)}),e=e.slice(n));const o=t.findIndex(t=>e.startsWith(t.left));if(n=l(t[o].right,e,t[o].left.length),-1===n)break;const i=e.slice(0,n+t[o].right.length),a=s.test(i)?i:e.slice(t[o].left.length,n);r.push({type:"math",data:a,rawData:i,display:t[o].display}),e=e.slice(n+t[o].right.length)}return""!==e&&r.push({type:"text",data:e}),r};const c=function(e,t){const n=d(e,t.delimiters);if(1===n.length&&"text"===n[0].type)return null;const r=document.createDocumentFragment();for(let e=0;e<n.length;e++)if("text"===n[e].type)r.appendChild(document.createTextNode(n[e].data));else{const o=document.createElement("span");let i=n[e].data;t.displayMode=n[e].display;try{t.preProcess&&(i=t.preProcess(i)),a().render(i,o,t)}catch(o){if(!(o instanceof a().ParseError))throw o;t.errorCallback("KaTeX auto-render: Failed to parse `"+n[e].data+"` with ",o),r.appendChild(document.createTextNode(n[e].rawData));continue}r.appendChild(o)}return r},f=function(e,t){for(let o=0;o<e.childNodes.length;o++){const i=e.childNodes[o];if(3===i.nodeType){var n;let a=null!=(n=i.textContent)?n:"",l=i.nextSibling,s=0;for(;l&&l.nodeType===Node.TEXT_NODE;){var r;a+=null!=(r=l.textContent)?r:"",l=l.nextSibling,s++}const d=c(a,t);if(d){for(let e=0;e<s;e++)i.nextSibling.remove();o+=d.childNodes.length-1,e.replaceChild(d,i)}else o+=s}else if(1===i.nodeType){const e=" "+i.className+" ";!t.ignoredTags.has(i.nodeName.toLowerCase())&&t.ignoredClasses.every(t=>!e.includes(" "+t+" "))&&f(i,t)}}};var p=function(e,t){if(!e)throw new Error("No element provided to render");const n={};Object.assign(n,t),n.delimiters=n.delimiters||[{left:"$$",right:"$$",display:!0},{left:"\\(",right:"\\)",display:!1},{left:"\\begin{equation}",right:"\\end{equation}",display:!0},{left:"\\begin{align}",right:"\\end{align}",display:!0},{left:"\\begin{alignat}",right:"\\end{alignat}",display:!0},{left:"\\begin{gather}",right:"\\end{gather}",display:!0},{left:"\\begin{CD}",right:"\\end{CD}",display:!0},{left:"\\[",right:"\\]",display:!0}],n.ignoredTags=new Set((null==t?void 0:t.ignoredTags)||["script","noscript","style","textarea","pre","code","option"]),n.ignoredClasses=n.ignoredClasses||[],n.errorCallback=n.errorCallback||console.error,n.macros=n.macros||{},f(e,n)};return o=o.default}()});2%Աximport katex from '../katex.mjs';

/* eslint no-constant-condition:0 */
var findEndOfMath = function findEndOfMath(delimiter, text, startIndex) {
  // Adapted from
  // https://github.com/Khan/perseus/blob/master/src/perseus-markdown.jsx
  var index = startIndex;
  var braceLevel = 0;
  var delimLength = delimiter.length;
  while (index < text.length) {
    var character = text[index];
    if (braceLevel <= 0 && text.slice(index, index + delimLength) === delimiter) {
      return index;
    } else if (character === "\\") {
      index++;
    } else if (character === "{") {
      braceLevel++;
    } else if (character === "}") {
      braceLevel--;
    }
    index++;
  }
  return -1;
};
var escapeRegex = function escapeRegex(string) {
  return string.replace(/[-/\\^$*+?.()|[\]{}]/g, "\\$&");
};
var amsRegex = /^\\begin{/;
var splitAtDelimiters = function splitAtDelimiters(text, delimiters) {
  var index;
  var data = [];
  var regexLeft = new RegExp("(" + delimiters.map(x => escapeRegex(x.left)).join("|") + ")");
  while (true) {
    index = text.search(regexLeft);
    if (index === -1) {
      break;
    }
    if (index > 0) {
      data.push({
        type: "text",
        data: text.slice(0, index)
      });
      text = text.slice(index); // now text starts with delimiter
    }
    // ... so this always succeeds:
    var i = delimiters.findIndex(delim => text.startsWith(delim.left));
    index = findEndOfMath(delimiters[i].right, text, delimiters[i].left.length);
    if (index === -1) {
      break;
    }
    var rawData = text.slice(0, index + delimiters[i].right.length);
    var math = amsRegex.test(rawData) ? rawData : text.slice(delimiters[i].left.length, index);
    data.push({
      type: "math",
      data: math,
      rawData,
      display: delimiters[i].display
    });
    text = text.slice(index + delimiters[i].right.length);
  }
  if (text !== "") {
    data.push({
      type: "text",
      data: text
    });
  }
  return data;
};

/* eslint no-console:0 */
/* Note: optionsCopy is mutated by this method. If it is ever exposed in the
 * API, we should copy it before mutating.
 */
var renderMathInText = function renderMathInText(text, optionsCopy) {
  var data = splitAtDelimiters(text, optionsCopy.delimiters);
  if (data.length === 1 && data[0].type === 'text') {
    // There is no formula in the text.
    // Let's return null which means there is no need to replace
    // the current text node with a new one.
    return null;
  }
  var fragment = document.createDocumentFragment();
  for (var i = 0; i < data.length; i++) {
    if (data[i].type === "text") {
      fragment.appendChild(document.createTextNode(data[i].data));
    } else {
      var span = document.createElement("span");
      var math = data[i].data;
      // Override any display mode defined in the settings with that
      // defined by the text itself
      optionsCopy.displayMode = data[i].display;
      try {
        if (optionsCopy.preProcess) {
          math = optionsCopy.preProcess(math);
        }
        katex.render(math, span, optionsCopy);
      } catch (e) {
        if (!(e instanceof katex.ParseError)) {
          throw e;
        }
        optionsCopy.errorCallback("KaTeX auto-render: Failed to parse `" + data[i].data + "` with ", e);
        fragment.appendChild(document.createTextNode(data[i].rawData));
        continue;
      }
      fragment.appendChild(span);
    }
  }
  return fragment;
};
var _renderElem = function renderElem(elem, optionsCopy) {
  var _loop = function _loop(_i) {
    var childNode = elem.childNodes[_i];
    if (childNode.nodeType === 3) {
      var _childNode$textConten;
      // Text node
      // Concatenate all sibling text nodes.
      // Webkit browsers split very large text nodes into smaller ones,
      // so the delimiters may be split across different nodes.
      var textContentConcat = (_childNode$textConten = childNode.textContent) != null ? _childNode$textConten : "";
      var sibling = childNode.nextSibling;
      var nSiblings = 0;
      while (sibling && sibling.nodeType === Node.TEXT_NODE) {
        var _sibling$textContent;
        textContentConcat += (_sibling$textContent = sibling.textContent) != null ? _sibling$textContent : "";
        sibling = sibling.nextSibling;
        nSiblings++;
      }
      var frag = renderMathInText(textContentConcat, optionsCopy);
      if (frag) {
        // Remove extra text nodes
        for (var j = 0; j < nSiblings; j++) {
          childNode.nextSibling.remove();
        }
        _i += frag.childNodes.length - 1;
        elem.replaceChild(frag, childNode);
      } else {
        // If the concatenated text does not contain math
        // the siblings will not either
        _i += nSiblings;
      }
    } else if (childNode.nodeType === 1) {
      // Element node
      var className = ' ' + childNode.className + ' ';
      var shouldRender = !optionsCopy.ignoredTags.has(childNode.nodeName.toLowerCase()) && optionsCopy.ignoredClasses.every(x => !className.includes(' ' + x + ' '));
      if (shouldRender) {
        _renderElem(childNode, optionsCopy);
      }
    }
    // Otherwise, it's something else, and ignore it.
    i = _i;
  };
  for (var i = 0; i < elem.childNodes.length; i++) {
    _loop(i);
  }
};
var renderMathInElement = function renderMathInElement(elem, options) {
  if (!elem) {
    throw new Error("No element provided to render");
  }
  var optionsCopy = {};
  Object.assign(optionsCopy, options);
  // default options
  optionsCopy.delimiters = optionsCopy.delimiters || [{
    left: "$$",
    right: "$$",
    display: true
  }, {
    left: "\\(",
    right: "\\)",
    display: false
  },
  // LaTeX uses $…$, but it ruins the display of normal `$` in text:
  // {left: "$", right: "$", display: false},
  // $ must come after $$
  // Render AMS environments even if outside $$…$$ delimiters.
  {
    left: "\\begin{equation}",
    right: "\\end{equation}",
    display: true
  }, {
    left: "\\begin{align}",
    right: "\\end{align}",
    display: true
  }, {
    left: "\\begin{alignat}",
    right: "\\end{alignat}",
    display: true
  }, {
    left: "\\begin{gather}",
    right: "\\end{gather}",
    display: true
  }, {
    left: "\\begin{CD}",
    right: "\\end{CD}",
    display: true
  }, {
    left: "\\[",
    right: "\\]",
    display: true
  }];
  optionsCopy.ignoredTags = new Set((options == null ? void 0 : options.ignoredTags) || ["script", "noscript", "style", "textarea", "pre", "code", "option"]);
  optionsCopy.ignoredClasses = optionsCopy.ignoredClasses || [];
  optionsCopy.errorCallback = optionsCopy.errorCallback || console.error;
  // Enable sharing of global macros defined via `\gdef` between different
  // math elements within a single call to `renderMathInElement`.
  optionsCopy.macros = optionsCopy.macros || {};
  _renderElem(elem, optionsCopy);
};

export { renderMathInElement as default };
 굗xu(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory();
	else if(typeof define === 'function' && define.amd)
		define([], factory);
	else {
		var a = factory();
		for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
	}
})((typeof self !== 'undefined' ? self : this), function() {
return /******/ (function() { // webpackBootstrap
/******/ 	"use strict";
var __webpack_exports__ = {};

;// ./contrib/copy-tex/katex2tex.ts
// Set these to how you want inline and display math to be delimited.
const defaultCopyDelimiters = {
  inline: ['$', '$'],
  // alternative: ['\(', '\)']
  display: ['$$', '$$'] // alternative: ['\[', '\]']
};

// Replace .katex elements with their TeX source (<annotation> element).
// Modifies fragment in-place.  Useful for writing your own 'copy' handler,
// as in copy-tex.js.
function katexReplaceWithTex(fragment, copyDelimiters) {
  if (copyDelimiters === void 0) {
    copyDelimiters = defaultCopyDelimiters;
  }
  // Remove .katex-html blocks that are preceded by .katex-mathml blocks
  // (which will get replaced below).
  const katexHtml = fragment.querySelectorAll('.katex-mathml + .katex-html');
  for (let i = 0; i < katexHtml.length; i++) {
    const element = katexHtml[i];
    if (element.remove) {
      element.remove();
    } else if (element.parentNode) {
      element.parentNode.removeChild(element);
    }
  }
  // Replace .katex-mathml elements with their annotation (TeX source)
  // descendant, with inline delimiters.
  const katexMathml = fragment.querySelectorAll('.katex-mathml');
  for (let i = 0; i < katexMathml.length; i++) {
    const element = katexMathml[i];
    const texSource = element.querySelector('annotation');
    if (texSource) {
      if (element.replaceWith) {
        element.replaceWith(texSource);
      } else if (element.parentNode) {
        element.parentNode.replaceChild(texSource, element);
      }
      texSource.innerHTML = copyDelimiters.inline[0] + texSource.innerHTML + copyDelimiters.inline[1];
    }
  }
  // Switch display math to display delimiters.
  const displays = fragment.querySelectorAll('.katex-display annotation');
  for (let i = 0; i < displays.length; i++) {
    const element = displays[i];
    element.innerHTML = copyDelimiters.display[0] + element.innerHTML.substr(copyDelimiters.inline[0].length, element.innerHTML.length - copyDelimiters.inline[0].length - copyDelimiters.inline[1].length) + copyDelimiters.display[1];
  }
  return fragment;
}
/* harmony default export */ var katex2tex = (katexReplaceWithTex);
;// ./contrib/copy-tex/copy-tex.ts


// Return <div class="katex"> element containing node, or null if not found.
function closestKatex(node) {
  // If node is a Text Node, for example, go up to containing Element,
  // where we can apply the `closest` method.
  const element = node instanceof Element ? node : node.parentElement;
  return element && element.closest('.katex');
}

// Global copy handler to modify behavior on/within .katex elements.
document.addEventListener('copy', function (event) {
  const selection = window.getSelection();
  if (!selection || selection.isCollapsed || !event.clipboardData) {
    return; // default action OK if selection is empty or unchangeable
  }
  const clipboardData = event.clipboardData;
  const range = selection.getRangeAt(0);

  // When start point is within a formula, expand to entire formula.
  const startKatex = closestKatex(range.startContainer);
  if (startKatex) {
    range.setStartBefore(startKatex);
  }

  // Similarly, when end point is within a formula, expand to entire formula.
  const endKatex = closestKatex(range.endContainer);
  if (endKatex) {
    range.setEndAfter(endKatex);
  }
  const fragment = range.cloneContents();
  if (!fragment.querySelector('.katex-mathml')) {
    return; // default action OK if no .katex-mathml elements
  }
  const htmlContents = Array.prototype.map.call(fragment.childNodes, el => el instanceof Text ? el.textContent : el.outerHTML).join('');

  // Preserve usual HTML copy/paste behavior.
  clipboardData.setData('text/html', htmlContents);
  // Rewrite plain-text version.
  clipboardData.setData('text/plain', katex2tex(fragment).textContent);
  // Prevent normal copy handling.
  event.preventDefault();
});
__webpack_exports__ = __webpack_exports__["default"];
/******/ 	return __webpack_exports__;
/******/ })()
;
});'߷hxx!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var n=t();for(var o in n)("object"==typeof exports?exports:e)[o]=n[o]}}("undefined"!=typeof self?self:this,function(){return function(){"use strict";var e={};const t={inline:["$","$"],display:["$$","$$"]};var n=function(e,n){void 0===n&&(n=t);const o=e.querySelectorAll(".katex-mathml + .katex-html");for(let e=0;e<o.length;e++){const t=o[e];t.remove?t.remove():t.parentNode&&t.parentNode.removeChild(t)}const r=e.querySelectorAll(".katex-mathml");for(let e=0;e<r.length;e++){const t=r[e],o=t.querySelector("annotation");o&&(t.replaceWith?t.replaceWith(o):t.parentNode&&t.parentNode.replaceChild(o,t),o.innerHTML=n.inline[0]+o.innerHTML+n.inline[1])}const l=e.querySelectorAll(".katex-display annotation");for(let e=0;e<l.length;e++){const t=l[e];t.innerHTML=n.display[0]+t.innerHTML.substr(n.inline[0].length,t.innerHTML.length-n.inline[0].length-n.inline[1].length)+n.display[1]}return e};function o(e){const t=e instanceof Element?e:e.parentElement;return t&&t.closest(".katex")}return document.addEventListener("copy",function(e){const t=window.getSelection();if(!t||t.isCollapsed||!e.clipboardData)return;const r=e.clipboardData,l=t.getRangeAt(0),i=o(l.startContainer);i&&l.setStartBefore(i);const a=o(l.endContainer);a&&l.setEndAfter(a);const s=l.cloneContents();if(!s.querySelector(".katex-mathml"))return;const c=Array.prototype.map.call(s.childNodes,e=>e instanceof Text?e.textContent:e.outerHTML).join("");r.setData("text/html",c),r.setData("text/plain",n(s).textContent),e.preventDefault()}),e=e.default}()});7Rx|// Set these to how you want inline and display math to be delimited.
var defaultCopyDelimiters = {
  inline: ['$', '$'],
  // alternative: ['\(', '\)']
  display: ['$$', '$$'] // alternative: ['\[', '\]']
};
// Replace .katex elements with their TeX source (<annotation> element).
// Modifies fragment in-place.  Useful for writing your own 'copy' handler,
// as in copy-tex.js.
function katexReplaceWithTex(fragment, copyDelimiters) {
  if (copyDelimiters === void 0) {
    copyDelimiters = defaultCopyDelimiters;
  }
  // Remove .katex-html blocks that are preceded by .katex-mathml blocks
  // (which will get replaced below).
  var katexHtml = fragment.querySelectorAll('.katex-mathml + .katex-html');
  for (var i = 0; i < katexHtml.length; i++) {
    var element = katexHtml[i];
    if (element.remove) {
      element.remove();
    } else if (element.parentNode) {
      element.parentNode.removeChild(element);
    }
  }
  // Replace .katex-mathml elements with their annotation (TeX source)
  // descendant, with inline delimiters.
  var katexMathml = fragment.querySelectorAll('.katex-mathml');
  for (var _i = 0; _i < katexMathml.length; _i++) {
    var _element = katexMathml[_i];
    var texSource = _element.querySelector('annotation');
    if (texSource) {
      if (_element.replaceWith) {
        _element.replaceWith(texSource);
      } else if (_element.parentNode) {
        _element.parentNode.replaceChild(texSource, _element);
      }
      texSource.innerHTML = copyDelimiters.inline[0] + texSource.innerHTML + copyDelimiters.inline[1];
    }
  }
  // Switch display math to display delimiters.
  var displays = fragment.querySelectorAll('.katex-display annotation');
  for (var _i2 = 0; _i2 < displays.length; _i2++) {
    var _element2 = displays[_i2];
    _element2.innerHTML = copyDelimiters.display[0] + _element2.innerHTML.substr(copyDelimiters.inline[0].length, _element2.innerHTML.length - copyDelimiters.inline[0].length - copyDelimiters.inline[1].length) + copyDelimiters.display[1];
  }
  return fragment;
}

// Return <div class="katex"> element containing node, or null if not found.
function closestKatex(node) {
  // If node is a Text Node, for example, go up to containing Element,
  // where we can apply the `closest` method.
  var element = node instanceof Element ? node : node.parentElement;
  return element && element.closest('.katex');
}
// Global copy handler to modify behavior on/within .katex elements.
document.addEventListener('copy', function (event) {
  var selection = window.getSelection();
  if (!selection || selection.isCollapsed || !event.clipboardData) {
    return; // default action OK if selection is empty or unchangeable
  }
  var clipboardData = event.clipboardData;
  var range = selection.getRangeAt(0);
  // When start point is within a formula, expand to entire formula.
  var startKatex = closestKatex(range.startContainer);
  if (startKatex) {
    range.setStartBefore(startKatex);
  }
  // Similarly, when end point is within a formula, expand to entire formula.
  var endKatex = closestKatex(range.endContainer);
  if (endKatex) {
    range.setEndAfter(endKatex);
  }
  var fragment = range.cloneContents();
  if (!fragment.querySelector('.katex-mathml')) {
    return; // default action OK if no .katex-mathml elements
  }
  var htmlContents = Array.prototype.map.call(fragment.childNodes, el => el instanceof Text ? el.textContent : el.outerHTML).join('');
  // Preserve usual HTML copy/paste behavior.
  clipboardData.setData('text/html', htmlContents);
  // Rewrite plain-text version.
  clipboardData.setData('text/plain', katexReplaceWithTex(fragment).textContent);
  // Prevent normal copy handling.
  event.preventDefault();
});
 Qx!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],t);else{var r="object"==typeof exports?t(require("katex")):t(e.katex);for(var n in r)("object"==typeof exports?exports:e)[n]=r[n]}}("undefined"!=typeof self?self:this,function(e){return function(){"use strict";var t={757:function(t){t.exports=e}},r={};function n(e){var o=r[e];if(void 0!==o)return o.exports;var i=r[e]={exports:{}};return t[e](i,i.exports,n),i.exports}n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)};var o={},i=n(757),a=n.n(i);let u=document.body.getElementsByTagName("script");return u=Array.prototype.slice.call(u),u.forEach(function(e){if(!e.type||!e.type.match(/math\/tex/i))return-1;const t=null!=e.type.match(/mode\s*=\s*display(;|\s|\n|$)/),r=document.createElement(t?"div":"span");r.setAttribute("class",t?"equation":"inline-equation");try{a().render(e.text,r,{displayMode:t})}catch(t){console.error(t),r.textContent=e.text}e.parentNode.replaceChild(r,e)}),o=o.default}()});ZL/ximport katex from '../katex.mjs';

var scripts = document.body.getElementsByTagName("script");
scripts = Array.prototype.slice.call(scripts);
scripts.forEach(function (script) {
  if (!script.type || !script.type.match(/math\/tex/i)) {
    return -1;
  }
  var display = script.type.match(/mode\s*=\s*display(;|\s|\n|$)/) != null;
  var katexElement = document.createElement(display ? "div" : "span");
  katexElement.setAttribute("class", display ? "equation" : "inline-equation");
  try {
    katex.render(script.text, katexElement, {
      displayMode: display
    });
  } catch (err) {
    // eslint-disable-next-line no-console
    console.error(err);
    katexElement.textContent = script.text;
  }
  script.parentNode.replaceChild(katexElement, script);
});
zYx!~(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("katex"));
	else if(typeof define === 'function' && define.amd)
		define(["katex"], factory);
	else {
		var a = typeof exports === 'object' ? factory(require("katex")) : factory(root["katex"]);
		for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
	}
})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__757__) {
return /******/ (function() { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ 757:
/***/ (function(module) {

module.exports = __WEBPACK_EXTERNAL_MODULE__757__;

/***/ })

/******/ 	});
/*********0/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/****o**/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/9/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, propY) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/9/
var __webpack_exports__ = {};
/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(757);
/* harmony import */ var katex__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(katex__WEBPACK_IMPORTED_MODULE_0__);
<'__WEBPACK_IMPORTED_MODULE_0___default()N m?2;
});
katex__WEBPACK_IMPORTED_MODULE_0___default() m;	'__WEBPACK_IMPORTED_MODULE_0___default()	M 
J
//

D
R//

(4^@var str = "";
H;
5if 4,b0'}
(}
$=return tex;
};

//
|.//
//
)//
  // Call like
  //   go("H2O");
  //
?+%if (!input) {
      return [];
    }
%?
      stateMachine = 'ce';
    }
    var state = '0';

    //
'//
// buffer.o == element
P-'(*//
    // buffer.r == arrow
3S1/1//
 // buffer.rm
    // etc.
    //
/9j'%//
7//
9Sm2/// c == macro
    //
    /** @type {Buffer} */
Г = 0;
,+0p(0p//
P#//
=var watchdog = 10;
!&while (true) {
)watchdog--;]Y'8:F for (var i = 0; i < A\I<< for (var iA = 0; iA < 3)Po;
'=j pBo >W OPaݐ0>oh*:<+F$l#'_p&@܉FFM]//
#h%}
    }
  },
:%	if (b) {
l&(for (var iB = 0; iB < b.length; iB++) {
!}
3a.push(b);
      }
    }
  },
  patterns: {
    //
:YS//g6'else': /^./,
]'space': /^\s/,
*'space$': /^\s$/,
'x': /^x/,
      'x$': /^x$/,
 ( C!"?"7'$1""0"铱##F$<T$/($ϓ&Mm.splice(1)K&%
          }[Z>'},
&0($D&/&Mm.splice(1)K&%
          }[Z>'},
Q'2
      '#?;'$(*if (a &&>(*a;
        }u(!(:(,)Mm[0]K&%
          }[Z>'},
|$) ) ) *!',': /^[,;]/,
      '.': /^[.]/,
N*1*"**
|O%p++

      },
.+$
|O%p+,

      },
+('^P.
|O%p+,?,

      },
_,"
|O%p+,

      },
,+-'\'': /^'/,
8-$
|O%p+-

      },
-$
|O%p+.

      },
 .,N.
|O%p+;/?,

      },
."
|O%p+;/

      },
`/*/,'{}': /^\{\}/,
/!
|O%p+$0

      },
;0#
|O%p+0

      },
0!
|O%p+1

      },
1%
|O%`1-

      },
1#
|O%`11!
      },
      '=<>': /^[=<>]/,
2'+': /^\+/,
M2-
    z272l2.3(35_3U3AJ-
|O%p+T4

      },
q4L44
|O%p+35

      },
<td55
    5,'P.
|O%p+'6?,

      },
[6!
|O%p+'6

      },
617.;7AC~7a77#
|O%p+Y8)

      },
8,
|O%p+8,

      },
9-
|O%p+:9&

      },
؃J-
|O%p+:0

      },
al:
|O%p+>;);
      },
a1
|O%p+>;*

      },
n;0
|O%p+>;;*

      },
гJ-
|O%p+l<
      },
      '<<'<=
    
=*6="Z=P=%==N8>ٓgPMmatch[0]K&_?
          };
        }
?Zif (a) {
        ? @xB!M  match_: match[0],
  K$_?$p
oZ>'},
!A#0
        return this['amount'](input);
      },
qA%A'A">'B.EIBpgPMmatch[0]K&_?
          }[Z>'},
afdC2'/': /^\s*(\/)\s*/,
C#C},
C-FD@D1	E-A
BEE>'I~E\	E#if (!B>'IF}
      };
'FFAFG%6G#\	GJsG!B	G
&&GEM!  endMatchBegin: i,
             G>
H:H=HbH{H>HPI@i++;
        }
TI$>'fZ>'};
      varAJIif (match === null) {
/'}
J0BJ&if (match === null) {
/'}
JQJ
/'}
K&.K*;
]K-MKpQ=L
        };
LrL>'
џ\L2Mmatch_: "M&,
MM.};//
MMXN4//
SN([N,N%hN1 O,NO4O1Oe
// RegExp
E2gPvar mmBPmm = [match[1], match[2]]1PQ=b2Q}?nMmmK&_?
          }[Z>'}
    }
  },
  //
Q%//
  actions: {
R >R 
    },
    'bRR 
    },
R R 
    },
    'oRm;
    },
    'qRZS 
    },
S S 
    },
    'rmRS"
    },
T#5T(
    },
    'inserU, a) {
Ltype_: a
      };
    },
T*
L(type_: a,
        p1: m
      };
    },
T-
L=type_: a,
        p1: m[0],
        p2: m[1]
      };
    },
MU"return m;
    },
U M9type_: 'rm',
        p1: m || ""
      };
    },
    'tex!OV
    },
    '{text}a var ret = ["{"];
1$zV#%7},
V&OV
-math');ɿ6WOV
kW
    },
W%
L5type_: 'bond',
        kind_: k || m
      };
    },
W+M5type_: 'color0',
        color: m[0]
      };
    },
-X OV
);
    },
nX(%$gX!X"m = m.substr(1);
      }
8YWY&Oret.push({
        type_: 'frac',
        p1: n[1],
        p2: n[2]
      });
YZ(0type_: 'tex-math',
          p1: n[3]
        })N@},
    '9,9a OV9,9');
    }
  },
  //
ZZ[://
[(var pattern, state;
\ 1\var i;
    //
Y\!//
\#var transitions = {};
^!^$G^].]3for (i = 0; i < o]$])z
    //
]//
^!^$G^9for (i = 0; i < o]$<^K_<
__%_`	!`%	k = 0; k < X`'E`,`#type_: p.action_[k]
    1n!`	]mda<a1for (var j = 0; j < a(a%b!>b-mbI
                  pattern: patternArray[j],
                  task: p
  7nQmbbB
                pattern: patternArray[j],
                task: p6,_	9
    return transitions;
  },
  stateMachines: {}
};

//
c //
c!L//
  // \ce state machines
  //
  //#region ce
  'ce': {
    // main parser
8%action_: 'output'
        }
      },
A'0|1|2': {
         d!
          revisit: true,
          toContinue: true
        }
      },
      'oxidation$': {
        '0': {
          action_:Se
        }
      },
ne;'r': {
          action_: 'rdt=',
          nextState: 'rt'aPrd': {
          action_: 'rqt=',
          nextState: 'rdt'
        }
      },
3,{
        '0|1|2|as': {
          action_: [i /],
          nextState: '1'
        }
      },
af#'0|1|2': {
          action_: ['o=', 'output'],
          nextState: '1'
        }
      },
      'orbital': {
        '0|1|2|3': {
          action_: 'o=',
          nextState: 'o'
        }
      },
      '->': {
        '0|1|2|3': {
          action_: 'r=',
          nextState: 'r'aFa|as': {
          action_: ['output', 'r='],
          nextState: 'r'aGaction_: ['output', 'r='],
          nextState: 'r'
        }
      },
g;'o': {
          action_: 'd= kv',
          nextState: 'd'a9d|D': {
          action_: 'd=',
          nextState: 'd'a8q': {
          action_: 'd=',
          nextState: 'qd'a<qd|qD': {
          action_: 'd=',
          nextState: 'qd'aDdq': {
          action_: ['output', 'd='],
          nextState: 'd'a3': {
          action_: [i ],
          nextState: '0'
        }
      },
      'amount': {
        '0|2': {
          action_: 'a=',
          nextState: 'a'
        }
      },
Y$'0|1|2|a|as': {
          action_: [i
            type_: 'operator',
            option: '\\pm'
          }],
          nextState: '0'
        }
      },
      'ope$'0|1|2|a|as': {
          action_: [i ],
          nextState: '0'
        }
      },
      '-$': {
        'o|q': {
          action_: ['charge or bond', 'output'],
          nextState: 'qd'a7d': {
          action_: 'd=',
          nextState: 'd'aD': {
          action_: ['output', {
            type_: 'bond',
            option: "-"
          }],
          nextState: '3'a8q': {
          action_: 'd=',
          nextState: 'qd'a9qd': {
          action_: 'd=',
          nextState: 'qd'aqD|dq': {
          action_: ['output', {
            type_: 'bond',
            option: "-"
          }],
          nextState: '3'
        }
      },
      '-9': {
        '3|o': {
          action_: ['output', {
            type_: 'insert',
           L option: 'hyphen'
          }],
          nextState: '3'
        }
      },
l%'o': {
          action_: ['output', {
            type_: 'insert',
            option: 'hyphen'
          }],
          nextState: '2'ad': {
          action_: ['output', {
            type_: 'insert',
            option: 'hyphen'
          }],
          nextState: '2'
        }
      },
      '-': {
        '0|1|2': {
          action_: [{
            type_: 'output',
            option: 1
         mZ
            type_: 'bond',
            option: "-"
          }],
          nextState: '3'aM3': {
          action_: {
            type_: 'bond',
            option: "-"-a': {
          action_: ['output', {
            type_: 'insert',
            option: 'hyphen'
          }],
          nextState: '2'aas': {
          action_: [{
            type_: 'output',
            option: 2
          }, {
            type_: 'bond',
     9       option: "-"
          }],
          nextState: '3'ab': {
          action_: 'b='aYo': {
          action_: {
            type_: '- after o/d',
            option: false
  a  nextState: '2'aYq': {
          action_: {
            type_: '- after o/d',
            option: false
  a  nextState: '2'a^d|qd|dq': {
          action_: {
            type_: '- after o/d',
            option: true
  a  nextState: '2'ap

          action_: ['output', {
            type_: 'bond',
            option: "-"
          }],
          nextState: '3'
        }
      },
      'amount2': {
        '1|3': {
          action_: 'a=',
          nextState: 'a'
        }
      },
      'W~|`q2
          action_: 'o=',
          nextState: 'o'aq|dq': {
         ˆ],
          nextState: 'o'ad|D|qd|qD': {
         q-
          nextState: 'o'
        }
      },
r8'o': {
          action_: 'q=',
          nextState: 'q'a:d|D': {
          action_: 'q=',
          nextState: 'dq'aq': {
         ˆ],
          nextState: 'o'aKa': {
          action_: 'o=',
          nextState: 'o'
        }
      },
rs

      },
/ 'a': {
          nextState: 'as'a#0': {
          action_: 'sb=false'a$1|2': {
          action_: 'sb=true'aIr|rt|rd|rdt|rdq': {
          action_: 'output',
          nextState: '0'aLaction_: ['output', 'sb=true'],
          nextState: '1'
        }
      },
<t$4'1|2': {
          action_: ['output', {
           t
            option:At
          }]a!action_: ['output', {
           t
            option:At;
          }],
          nextState: '0'
        }
      },
*u='r|rt': {
          action_: 'rd=',
          nextState: 'rd'ard|rdt': {
          action_: 'rq=',
          nextState: 'rdq'
        }
      },
      '...': {
        'o|d|D|dq|qd|qD': {
          action_: ['output', {
            type_: 'bond',
            option: "..."
          }],
          nextState: '3'
    faction_: [{
            type_: 'output',
            option: 1
          }, {
            type_: 'insert',
            option: U'ellipsis'
          }],
          nextState: '1'
        }
      },
      '. |* ': {>action_: ['output', {
            type_: 'insert',
           v;
          }],
          nextState: '1'
        }
      },
Q' {
action_: [fw /],
          nextState: '1'
        }
      },
ww
          action_: [w$],
          nextState: '2'a 0|1|2|3': {
          action_: [w$],
          nextState: '2'ă"w>],
          nextState: '2'
        }
      },
      ')]}': {
x
          action_: [ly],
          nextState: 'o'a?y

         ˆsy/],
          nextState: 'o'
        }
      },
y^action_: ['output', 'comma'],
          nextState: '0'
        }
      },
      '^_': {
      z1'*': {}
      },
Cz%?'0|1|2|as': {
          action_: 'b=',
          nextState: 'b'a8p': {
          action_: 'b=',
          nextState: 'bp'a<3|o': {
          action_: 'd= kv',
          nextState: 'D'a8q': {
          action_: 'd=',
          nextState: 'qD'abd|D|qd|qD|dq': {
          action_: ['output', 'd='],
          nextState: 'D'
        }
      },
{.?'0|1|2|as': {
          action_: 'b=',
          nextState: 'b'a8p': {
          action_: 'b=',
          nextState: 'bp'a<3|o': {
          action_: 'd= kv',
          nextState: 'd'a8q': {
          action_: 'd=',
          nextState: 'qd'a%d|qd|D|qD': {
          action_: 'd='aXdq': {
          action_: ['output', 'd='],
          nextState: 'd'
        }
      },
|.e'd|D|q|qd|qD|dq': {
          action_: ['output', 'q='],
          nextState: 'q'
        }
      },
g}=?'0|1|2|as': {
          action_: 'p=',
          nextState: 'p'a8b': {
          action_: 'p=',
          nextState: 'bp'a93|o': {
          action_: 'q=',
          nextState: 'q'a:d|D': {
          action_: 'q=',
          nextState: 'dq'a`q|qd|qD|dq': {
          action_: ['output', 'q='],
          nextState: 'q'
        }
      },
~~"
          action_: [{
            type_: 'output',
            option: 2
          }, 'bond'],
          nextState: '3'
        }
      },
      '#': {
~': {
          action_: [{
            type_: 'output',
            option: 2
          }, {
            type_: 'bond',
       X     option: "#"
          }],
          nextState: '3'
        }
      },
      '{}': {@action_: {
            type_: 'output',
            option: 1
  a5  nextState: '1'
        }
      },
      '{...}': {
~[
2
          action_: 'o=',
          nextState: 'o'a

         ˆf],
          nextState: 'o'
        }
      },
      '$...$': {
        'a': {
          action_: 'a='a// 2$n$
 2
          action_: 'o=',
          nextState: 'o'a9// not 'amount'
        'as|o': {
          action_: 'o='aq|d|D|qd|qD|dq': {
         ˆ/],
          nextState: 'o'
        }
      },
!action_: [{
            type_: 'output',
            option: 2
          }, 'bond'],
          nextState: "3"
        }
      },
V!action_: [{
            type_: 'output',
            option: 1
          }, 'frac-output'],
          nextState: '3'
        }
      },
      '\\ov`action_: [{
            type_: 'output',
            option: 2
          }, 'overset-output'],
          nextState: '3'
        }
      },
9o
action_: [{
            type_: 'output',
            option: 2
          }, 'underset-output'],
          nextState: '3'
        }
      },
؃'Haction_: [{
            type_: 'output',
            option: 2
         //],
          nextState: '3'
        }
      },
a?action_: [{
            type_: 'output',
            option: 2
          }, 'color-output'],
          nextState: '3'
        }

      },
aaction_: [{
            type_: 'output',
            option: 2
          }, 'color0-output']
        }
      },
      '\\ce{(..߳action_: [{
            type_: 'output',
            option: 2
          }, 'ce'],
          nextState: '3'
        }
      },
      '\\,': {action_: [{
            type_: 'output',
            option: 1
          }, 'copy'],
          nextState: '1'
        }
      }	,
      '~|>
          action_: ['o=', 'output'],
          nextState: '3'ă"@],
          nextState: '3'
        }
      },
      'others': {action_: [{
            type_: 'output',
            option: 1
          }, 'copy'],
          nextState: '3'
        }
      },
      'else2': {
        'a': {
          action_: 'a to o',
          nextState: 'o',
          revisit: true
        },
   pbas': {
          action_: ['output', 'sb=true'],
          nextState: '1',
          revisit: trueadr|rt|rd|rdt|rdq': {
          action_: ['output'],
          nextState: '0',
          revisit: truea5action_: ['output', 'copy'],
          nextState: '3'q),
мވ,	var ret;
<Uu (&}
	:},
n.H},
؊7*Ml#l+,>}
      },
o>J_\_a <m === "-" && (c1 && c1.remainder === "" || c2 || c3 || c4);
]\"}
џ.Xil#k
type_: 'hyphen'
          })GP"ݐݐA=bݐCݐ9>
p
oZ%4S},
v$޾	$buffer.sb = true;
      },
      'sb\޾	buffer.sb = false;
      },
0޾	! 

      },
]޾	!false;
      },
/޾	Г

      },

޾	Г--;
      },
Q'Ĵ"M',
         @/
        };
      },
ٔ.	'var withSpace = a !== m;
O&&ϓM	!L',
            p1: a
          }M	3
            p1: a
          };
        }
      },
 RrhwqٟX;
5#Z=|d=b#entitySkip'6+qT
 !== 2) {
ϙ1ݙZ p1Oݙ#ݙyޚݙ1O === 'kv' &&+3* === %Ep!12%2Y1ޝ2,
.}1// r8|-	Ξ7=&"2rd = [{
              type_: 'text',
             a
            }]1b>-|"]="Urq = [{
              type_: 'text',
              p1: buffer.rq || ""
            }]1b+>8Ki};
        }
`ݡ&&'4MmZ2var ret = ["{"QV=%},
W4Mtype_: 'frac-ce',
         @
          pP)
        };
      },
7Mtype_: 'overset',
         @
          pP)
        };
      },
8Mtype_: 'underset',
         @
          pP)
        };
      },
!:Mtype_: 'underbrace',
         @
          pP)
        };
      },
5M	(olor',
          color1: m[0],
         
        };
      },
L"	!buffer.r = m;
      },
      'rdtR	buffer.rdt = m;
      },
#	"buffer.rd = m;
      },
      'rqtR	buffer.rqt = m;
      },
.#	buffer.rq = m;
      },
      ', p1) {
LStype_: 'operator',
          kind_: p1 || m
        };
      }
    }
  },
  'a': {
8'*': {}
      },
=3'0': {
          action_: '1/2'
        }
      },
AL'0': {
          nextState: '1',
          revisit: true
        }
      },
B-
          nextState: '1'
        }
      },
aJaction_: {
            type_: 'insert',
            option: 'commaDecimal'	,
      'else2': {action_: 'copy'q!),
    actions: {}
  },
  'o': {
8'*': {}
      },
=3'0': {
          action_: '1/2'
        }
      },
AL'0': {
          nextState: '1',
          revisit: true
        }
      },
P!action_: 'rm'
        }
      },
Caction_: {
            type_: 'insert',
            option: 'circa'		,
      '#action_: 'copy'
        }
      },
ݸ%B
        }
      },
ѱ5action_: '{text}'
        }
      },
      'else2': {action_: 'copy'q$),
    actions: {}
  },
  'text': {
85action_: 'output'
        }
      },
      '{...}': {$action_: 'text='
        }
      },
ݸ%B
        }
      },
]-action_: ['output', 'rm']
        }
      },
Q)/action_: ['output', 'copy']
        }
      },
Aaction_: 'text='q),
м&yM
G{
            type_: 'text',
            p1: buffer.text_
          };
^!ݡ4}?n#
  },
  'pq': {
8'*': {}
      },
Q' {action_:ow
        }
      },
      'i$': {
        '0': {
          nextState: '!f',
          revisit: true
        }
      },
      '(yL'0': {
          action_: 'rm',
          nextState: '0'
        }
      },
L'0': {
          nextState: 'f',
          revisit: true
        }
      },
=3'0': {
          action_: '1/2'
        }
      },
AM'0': {
          nextState: '!f',
          revisit: true
        }
      },
ݸ%B
        }
      },
ѱJaction_: 'text'
        }
      },
      'a-z': {
        'f': {
         A
        }
      },
P!action_: 'rm'
        }
      },
"action_: '9,9'
        }
      },
aaction_: {
           t*
            option: 'comma enumeration S'	,
a?+action_: 'color-output'
        }
      },
a
        }
      },
г!action_: 'ce'
        }
      },
Q)3action_: 'copy'
        }
      },
      'else2': {action_: 'copy'q),
мW'Ĵ"M(

         @/
        };
      },
5M	(olor',
          color1: m[0],
         )
        };
      }
    }
  },
  'bd': {
8'*': {}
      },
NM'0': {
          nextState: '!f',
          revisit: true
        }
      },
L'0': {
          nextState: 'f',
          revisit: true
        }
      },
AM'0': {
          nextState: '!f',
          revisit: true
        }
      },
$@
"action_: '9,9'
        }
      },
Jaction_: {
            type_: 'insert',
            option: 'electron dot'	),
      'a-z': {
        'f': {
         A 
        }
      },
      'x': {Baction_: {
            type_: 'insert',
            option: 'KV x'	,
P.action_: 'rm'
        }
      },
      '\'': {Caction_: {
            type_: 'insert',
            option: 'prime'	,
ݸ%B
        }
      },
ѱ#action_: 'text'
        }
      },
a?+action_: 'color-output'
        }
      },
a
        }
      },
г!action_: 'ce'
        }
      },
Q)3action_: 'copy'
        }
      },
      'else2': {action_: 'copy'q),
мƥ/M	(olor',
          color1: m[0],
         7, 'bd')
        };
      }
    }
  },
  'oxidation': {
8'*': {}
      },
0={,action_: 'roman-numeral'
        }
      },
ݸ%B
        }
      },
Aaction_: 'copy'q),
м'	M\type_: 'roman numeral',
          p1: m || ""
        };
      }
    }
  },
  'tex-math': {
8%action_: 'output'
        }
      },
г-action_: ['output', 'ce']
        }
      },
/!action_: 'o='
        }
      },
Aaction_: 'o='q),
м&M
G{
            type_: 'tex-math',
            p1: buffer.o
          };
^!ݡ4}?n#
  },
  'tex-math tight': {
8%action_: 'output'
        }
      },
г-action_: ['output', 'ce']
        }
      },
//action_: 'o='
        }
      },
      '-|+': {
        }
      },
Aaction_: 'o='q),
м(	! + m + "}";
      },
,M
G{
            type_: 'tex-math',
            p1: buffer.o
          };
^!ݡ4}?n#
  },
  '9,9': {
8'*': {}
      },
a$action_: 'comma'
        }
      },
Aaction_: 'copy'q),
м
L	i
        };
      }
    }
  },
  //#endregion
  //
  // \pu state machines
  //
  //#region pu
  'pu': {
8%action_: 'output'
        }
      },
0action_: ['output', 'space']
        }
      },
I6'0|a': {
          action_: 'copy'
        }
      },
&
Q'0': {
          action_: 'number^',
          nextState: 'a'
        }
      },
N$[{
        '0': {
          action_: 'enumber',
          nextState: 'a'
        }
      },
/'0|a': {}
      },
YZ'0|a': {
          action_: {
            type_: 'operator',
            option: '\\pm'
  a$  nextState: '0'
        }
      },
'0|a': {
          action_: 'copy',
          nextState: '0'
        }
      },
      '//': {
        'd': {
          action_: 'o=',
          nextState: '/'
        }
      },
      '/': {
        'd': {
          action_: 'o=',
          nextState: '/'
        }
      },
:'0|d': {
          action_: 'd=',
          nextState: 'd'aBa': {
          action_: ['space', 'd='],
          nextState: 'd'a9/|q': {
          action_: 'q=',
          nextState: 'q'q),
м*ٟ&X||k	)iIk	O}
zlJ(ݐZ 	@	P0	||=,$dot'6 times'6,_	p
k	"10^{" + m[5] + "}"ZZ1number^a"ٟ&X||k	)iIk	O}
3mret.push("^{" + m[2] + "}");

},
      ', p1) {
L@type_: 'operator',
          kind_: p1 || m
        };
      },

L(type_: 'pu-space-1'
        };
      },
,ٟX;
Rif (md && mdd.match_;
        }
Rif (mq && mqq = mq.match_;
        }
;o,;}
q) {
          // fraction
h-o,rO0-};qW;7pu-frac',
              p1: b5.d,
              p2: b5.>b^||"# / '6 /'6+ې >
1}
`ݡ4eZ
    }
  },
  'pu-2': {
81action_: 'output'
        }
      },
      '*': {Waction_: ['output', 'cdot'],
          nextState: '0'
        }
      },
      '\\x': {"action_: 'rm='
        }
      },
/Jaction_: ['output', 'space'],
          nextState: '0'
        }
      },
"5'1': {
          action_: '^(-1)'
        }
      },
9'0': {
          action_: 'rm=',
          nextState: '0'aN1': {
          action_: '^(-1)',
          nextState: '0'
        }
      },
(action_: 'rm=',
          nextState: '1'q),
м 
L(type_: 'tight cdot'
        };
      },
[%	&buffer.rm += "^{" + m + "}";
      },

L(type_: 'pu-space-2'
        };
      },
,ٟXi{N
if (mrm &&%=b; rm',
              p1: buffer.rm$p
hݡ4eZ
    }
  },
  'pu-9,9': {
8$'0': {
          action_: 'output-0'a7o': {
          action_: 'output-o'
        }
      },
a]'0': {
          action_: ['output-0', 'comma'],
          nextState: 'o'
        }
      },
\'0': {
          action_: ['output-0', 'copy'],
          nextState: 'o'
        }
      },
Aaction_: 'text='q),
м
L	
        };
      },
.ٟ&X+y)Jif (aHa = 3q?
for (var iO i > 0; i -= 3O
p
            }1n&k	}
`ݡ4eZ&'ٟ&X+y)J+for (var i = 0; i < a; i += 3O
p
            }1ni))k	}
`ݡ4eZ!
    }
  }
  //#endregion
};

//
:(//
/** @type {Texify} */
var texify = {
?|

  #7if (!input) {
      return "";
    }
    var res = "";
for (var i = 0; i < inpuA&E*q$*
          cee = truep
)9!}
    return res;
  },
  _goInner9-
    if (!input) {
      return input;
    }
%},
  _go2: function (buf) {
*	var res;
6Wraaa),
/%%9%Ad)
        };qaqif (b5.a) {
%X  b5.a = "{" + b5.a + !ALzk$(
; + (b5.b || "") + "}}_{\\hphantom{" + (b5.p || "") + "}}";
.(/ + (b5.b || "") + "}}";
k8 + (b5.p || "") + "}}}"7"
zX  b5.o = "{" + b5.o + !res += b5.o7"q and dq$ $res += "^{" + b5.d + !d1 + b5.q + "$0" + b5.d + !d.9 + b5.q + "d.9 + b5.q + "0" + b5.d + !p
case 'rm':
qrm{" + buf.p1 + "}";
D['Gk + buf.p1 + "}"k	!text{" + buf.p1 + "}";
        }
Kyrm{" + buf.p1 + "}";
%Rk
:
1mu Qk
NL}
case 'frac':
gBy - + c + "}{" + c + "}{" + c + "}{" + c + "}";
\y - + d + "}{" + d + "}{" + d + "}{" + d + "}";
1Z]$?^res =\>VTcase 'color0':
4)@'i$};
=if (b6.rq) {
          
        }
        if (b6.rd) {
.^}
{case 'operator':
6!res = buf.p1 + " ";8eres = " ";
res = "~";
res = "~";
#@nres = "{,}";
$9buf.p1 + "}\\mkern6mu ";
d$9buf.p1 + "}\\mkern3mu ";
$9buf.p1 + "}\\mkern1mu ";
$=i" 0case 'KV x':
-#ay/BZE`case '/':
        res = "/";
h<i:}
return res;
  },
 case "->":
       case "\u2192":
       f
       case "<-":
        case "<->":
        return "leftQHcase "<-->":
        return "rightleftarrows";
      case "<=>":
        #case "\u21CC":
        #case "<=>>":
       " case "<<=>":
        return "lef@h:}
  },
Kcase "-":
        return "{-}";
      case "1":
        return "{-}";
      case "=":
        return "{=}";
      case "2":
   *     return "{=}";
      case "#":
       0case "3":
       0case "~":
        return "{case "~-":
        return "{6case "~=":
        return "{Ccase "~--":
        return "{Ccase "-~-":
        return "{Ccase "...":
       n"}";
      case "....":
       n4case "->":
        case "<-":
       Fcase "<":
        return "{<}";
      case ">":
        return "{>}";
@h:}
  },
#case "+":
        return " {}+{} ";
      case "-":
        return " {}-{} ";
      case "=":
        return " {}={} ";
      case "<":
       ^jcase ">":
        return " {}>{} ";
      case "<<":
        return " {}\\ll{} ";
      case ">>":
       case "\\pm":
       
       [ case "$\\approx$":
       [ case "v":
       !case "(v)":
       !case "^":
       case "(^)":
       @h:}
  }
};

//
,//
4function assertNever(a) {}
/** @param {string} a */
Po__webpack_exports__ = __webpack_exports__["default"];
/******/ 	return __webpack_exports__;
/******/ })()
;
});i麺xU|!function(t,e){if("object"==typeof exports&&"object"==typeof module)module.exports=e(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],e);else{var n="object"==typeof exports?e(require("katex")):e(t.katex);for(var o in n)("object"==typeof exports?exports:t)[o]=n[o]}}("undefined"!=typeof self?self:this,function(t){return function(){"use strict";var e={757:function(e){e.exports=t}},n={};function o(t){var a=n[t];if(void 0!==a)return a.exports;var r=n[t]={exports:{}};return e[t](r,r.exports,o),r.exports}o.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return o.d(e,{a:e}),e},o.d=function(t,e){for(var n in e)o.o(e,n)&&!o.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var a={},r=o(757),i=o.n(r);i().__defineMacro("\\ce",function(t){return c(t.consumeArgs(1)[0],"ce")}),i().__defineMacro("\\pu",function(t){return c(t.consumeArgs(1)[0],"pu")}),i().__defineMacro("\\tripledash","{\\vphantom{-}\\raisebox{2.56mu}{$\\mkern2mu\\tiny\\text{-}\\mkern1mu\\text{-}\\mkern1mu\\text{-}\\mkern2mu$}}");var c=function(t,e){for(var n="",o=t.length&&t[t.length-1].loc.start,a=t.length-1;a>=0;a--)t[a].loc.start>o&&(n+=" ",o=t[a].loc.start),n+=t[a].text,o+=t[a].text.length;return p.go(u.go(n,e))},u={go:function(t,e){if(!t)return[];void 0===e&&(e="ce");var n,o="0",a={};a.parenthesisLevel=0,t=(t=(t=t.replace(/\n/g," ")).replace(/[\u2212\u2013\u2014\u2010]/g,"-")).replace(/[\u2026]/g,"...");for(var r=10,i=[];;){n!==t?(r=10,n=t):r--;var c=u.stateMachines[e],p=c.transitions[o]||c.transitions["*"];t:for(var s=0;s<p.length;s++){var _=u.patterns.match_(p[s].pattern,t);if(_){for(var d=p[s].task,m=0;m<d.action_.length;m++){var l;if(c.actions[d.action_[m].type_])l=c.actions[d.action_[m].type_](a,_.match_,d.action_[m].option);else{if(!u.actions[d.action_[m].type_])throw["MhchemBugA","mhchem bug A. Please report. ("+d.action_[m].type_+")"];l=u.actions[d.action_[m].type_](a,_.match_,d.action_[m].option)}u.concatArray(i,l)}if(o=d.nextState||o,!(t.length>0))return i;if(d.revisit||(t=_.remainder),!d.toContinue)break t}}if(r<=0)throw["MhchemBugU","mhchem bug U. Please report."]}},concatArray:function(t,e){if(e)if(Array.isArray(e))for(var n=0;n<e.length;n++)t.push(e[n]);else t.push(e)},patterns:{patterns:{empty:/^$/,else:/^./,else2:/^./,space:/^\s/,"space A":/^\s(?=[A-Z\\$])/,space$:/^\s$/,"a-z":/^[a-z]/,x:/^x/,x$:/^x$/,i$:/^i$/,letters:/^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,"\\greek":/^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,"one lowercase latin letter $":/^(?:([a-z])(?:$|[^a-zA-Z]))$/,"$one lowercase latin letter$ $":/^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,"one lowercase greek letter $":/^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,digits:/^[0-9]+/,"-9.,9":/^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,"-9.,9 no missing 0":/^[+\-]?[0-9]+(?:[.,][0-9]+)?/,"(-)(9.,9)(e)(99)":function(t){var e=t.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:([eE]|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);return e&&e[0]?{match_:e.splice(1),remainder:t.substr(e[0].length)}:null},"(-)(9)^(-9)":function(t){var e=t.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);return e&&e[0]?{match_:e.splice(1),remainder:t.substr(e[0].length)}:null},"state of aggregation $":function(t){var e=u.patterns.findObserveGroups(t,"",/^\([a-z]{1,3}(?=[\),])/,")","");if(e&&e.remainder.match(/^($|[\s,;\)\]\}])/))return e;var n=t.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/);return n?{match_:n[0],remainder:t.substr(n[0].length)}:null},"_{(state of aggregation)}$":/^_\{(\([a-z]{1,3}\))\}/,"{[(":/^(?:\\\{|\[|\()/,")]}":/^(?:\)|\]|\\\})/,", ":/^[,;]\s*/,",":/^[,;]/,".":/^[.]/,". ":/^([.\u22C5\u00B7\u2022])\s*/,"...":/^\.\.\.(?=$|[^.])/,"* ":/^([*])\s*/,"^{(...)}":function(t){return u.patterns.findObserveGroups(t,"^{","","","}")},"^($...$)":function(t){return u.patterns.findObserveGroups(t,"^","$","$","")},"^a":/^\^([0-9]+|[^\\_])/,"^\\x{}{}":function(t){return u.patterns.findObserveGroups(t,"^",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"^\\x{}":function(t){return u.patterns.findObserveGroups(t,"^",/^\\[a-zA-Z]+\{/,"}","")},"^\\x":/^\^(\\[a-zA-Z]+)\s*/,"^(-1)":/^\^(-?\d+)/,"'":/^'/,"_{(...)}":function(t){return u.patterns.findObserveGroups(t,"_{","","","}")},"_($...$)":function(t){return u.patterns.findObserveGroups(t,"_","$","$","")},_9:/^_([+\-]?[0-9]+|[^\\])/,"_\\x{}{}":function(t){return u.patterns.findObserveGroups(t,"_",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"_\\x{}":function(t){return u.patterns.findObserveGroups(t,"_",/^\\[a-zA-Z]+\{/,"}","")},"_\\x":/^_(\\[a-zA-Z]+)\s*/,"^_":/^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,"{}":/^\{\}/,"{...}":function(t){return u.patterns.findObserveGroups(t,"","{","}","")},"{(...)}":function(t){return u.patterns.findObserveGroups(t,"{","","","}")},"$...$":function(t){return u.patterns.findObserveGroups(t,"","$","$","")},"${(...)}$":function(t){return u.patterns.findObserveGroups(t,"${","","","}$")},"$(...)$":function(t){return u.patterns.findObserveGroups(t,"$","","","$")},"=<>":/^[=<>]/,"#":/^[#\u2261]/,"+":/^\+/,"-$":/^-(?=[\s_},;\]/]|$|\([a-z]+\))/,"-9":/^-(?=[0-9])/,"- orbital overlap":/^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,"-":/^-/,"pm-operator":/^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,operator:/^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,arrowUpDown:/^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,"\\bond{(...)}":function(t){return u.patterns.findObserveGroups(t,"\\bond{","","","}")},"->":/^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,CMT:/^[CMT](?=\[)/,"[(...)]":function(t){return u.patterns.findObserveGroups(t,"[","","","]")},"1st-level escape":/^(&|\\\\|\\hline)\s*/,"\\,":/^(?:\\[,\ ;:])/,"\\x{}{}":function(t){return u.patterns.findObserveGroups(t,"",/^\\[a-zA-Z]+\{/,"}","","","{","}","",!0)},"\\x{}":function(t){return u.patterns.findObserveGroups(t,"",/^\\[a-zA-Z]+\{/,"}","")},"\\ca":/^\\ca(?:\s+|(?![a-zA-Z]))/,"\\x":/^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,orbital:/^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,others:/^[\/~|]/,"\\frac{(...)}":function(t){return u.patterns.findObserveGroups(t,"\\frac{","","","}","{","","","}")},"\\overset{(...)}":function(t){return u.patterns.findObserveGroups(t,"\\overset{","","","}","{","","","}")},"\\underset{(...)}":function(t){return u.patterns.findObserveGroups(t,"\\underset{","","","}","{","","","}")},"\\underbrace{(...)}":function(t){return u.patterns.findObserveGroups(t,"\\underbrace{","","","}_","{","","","}")},"\\color{(...)}0":function(t){return u.patterns.findObserveGroups(t,"\\color{","","","}")},"\\color{(...)}{(...)}1":function(t){return u.patterns.findObserveGroups(t,"\\color{","","","}","{","","","}")},"\\color(...){(...)}2":function(t){return u.patterns.findObserveGroups(t,"\\color","\\","",/^(?=\{)/,"{","","","}")},"\\ce{(...)}":function(t){return u.patterns.findObserveGroups(t,"\\ce{","","","}")},oxidation$:/^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"d-oxidation$":/^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,"roman numeral":/^[IVX]+/,"1/2$":/^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,amount:function(t){var e;if(e=t.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/))return{match_:e[0],remainder:t.substr(e[0].length)};var n=u.patterns.findObserveGroups(t,"","$","$","");return n&&(e=n.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/))?{match_:e[0],remainder:t.substr(e[0].length)}:null},amount2:function(t){return this.amount(t)},"(KV letters),":/^(?:[A-Z][a-z]{0,2}|i)(?=,)/,formula$:function(t){if(t.match(/^\([a-z]+\)$/))return null;var e=t.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);return e?{match_:e[0],remainder:t.substr(e[0].length)}:null},uprightEntities:/^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,"/":/^\s*(\/)\s*/,"//":/^\s*(\/\/)\s*/,"*":/^\s*[*.]\s*/},findObserveGroups:function(t,e,n,o,a,r,i,c,u,p){var s=function(t,e){if("string"==typeof e)return 0!==t.indexOf(e)?null:e;var n=t.match(e);return n?n[0]:null},_=s(t,e);if(null===_)return null;if(t=t.substr(_.length),null===(_=s(t,n)))return null;var d=function(t,e,n){for(var o=0;e<t.length;){var a=t.charAt(e),r=s(t.substr(e),n);if(null!==r&&0===o)return{endMatchBegin:e,endMatchEnd:e+r.length};if("{"===a)o++;else if("}"===a){if(0===o)throw["ExtraCloseMissingOpen","Extra close brace or missing open brace"];o--}e++}return null}(t,_.length,o||a);if(null===d)return null;var m=t.substring(0,o?d.endMatchEnd:d.endMatchBegin);if(r||i){var l=this.findObserveGroups(t.substr(d.endMatchEnd),r,i,c,u);if(null===l)return null;var f=[m,l.match_];return{match_:p?f.join(""):f,remainder:l.remainder}}return{match_:m,remainder:t.substr(d.endMatchEnd)}},match_:function(t,e){var n=u.patterns.patterns[t];if(void 0===n)throw["MhchemBugP","mhchem bug P. Please report. ("+t+")"];if("function"==typeof n)return u.patterns.patterns[t](e);var o=e.match(n);return o?{match_:o[2]?[o[1],o[2]]:o[1]?o[1]:o[0],remainder:e.substr(o[0].length)}:null}},actions:{"a=":function(t,e){t.a=(t.a||"")+e},"b=":function(t,e){t.b=(t.b||"")+e},"p=":function(t,e){t.p=(t.p||"")+e},"o=":function(t,e){t.o=(t.o||"")+e},"q=":function(t,e){t.q=(t.q||"")+e},"d=":function(t,e){t.d=(t.d||"")+e},"rm=":function(t,e){t.rm=(t.rm||"")+e},"text=":function(t,e){t.text_=(t.text_||"")+e},insert:function(t,e,n){return{type_:n}},"insert+p1":function(t,e,n){return{type_:n,p1:e}},"insert+p1+p2":function(t,e,n){return{type_:n,p1:e[0],p2:e[1]}},copy:function(t,e){return e},rm:function(t,e){return{type_:"rm",p1:e||""}},text:function(t,e){return u.go(e,"text")},"{text}":function(t,e){var n=["{"];return u.concatArray(n,u.go(e,"text")),n.push("}"),n},"tex-math":function(t,e){return u.go(e,"tex-math")},"tex-math tight":function(t,e){return u.go(e,"tex-math tight")},bond:function(t,e,n){return{type_:"bond",kind_:n||e}},"color0-output":function(t,e){return{type_:"color0",color:e[0]}},ce:function(t,e){return u.go(e)},"1/2":function(t,e){var n=[];e.match(/^[+\-]/)&&(n.push(e.substr(0,1)),e=e.substr(1));var o=e.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);return o[1]=o[1].replace(/\$/g,""),n.push({type_:"frac",p1:o[1],p2:o[2]}),o[3]&&(o[3]=o[3].replace(/\$/g,""),n.push({type_:"tex-math",p1:o[3]})),n},"9,9":function(t,e){return u.go(e,"9,9")}},createTransitions:function(t){var e,n,o,a,r={};for(e in t)for(n in t[e])for(o=n.split("|"),t[e][n].stateArray=o,a=0;a<o.length;a++)r[o[a]]=[];for(e in t)for(n in t[e])for(o=t[e][n].stateArray||[],a=0;a<o.length;a++){var i=t[e][n];if(i.action_){i.action_=[].concat(i.action_);for(var c=0;c<i.action_.length;c++)"string"==typeof i.action_[c]&&(i.action_[c]={type_:i.action_[c]})}else i.action_=[];for(var u=e.split("|"),p=0;p<u.length;p++)if("*"===o[a])for(var s in r)r[s].push({pattern:u[p],task:i});else r[o[a]].push({pattern:u[p],task:i})}return r},stateMachines:{}};u.stateMachines={ce:{transitions:u.createTransitions({empty:{"*":{action_:"output"}},else:{"0|1|2":{action_:"beginsWithBond=false",revisit:!0,toContinue:!0}},oxidation$:{0:{action_:"oxidation-output"}},CMT:{r:{action_:"rdt=",nextState:"rt"},rd:{action_:"rqt=",nextState:"rdt"}},arrowUpDown:{"0|1|2|as":{action_:["sb=false","output","operator"],nextState:"1"}},uprightEntities:{"0|1|2":{action_:["o=","output"],nextState:"1"}},orbital:{"0|1|2|3":{action_:"o=",nextState:"o"}},"->":{"0|1|2|3":{action_:"r=",nextState:"r"},"a|as":{action_:["output","r="],nextState:"r"},"*":{action_:["output","r="],nextState:"r"}},"+":{o:{action_:"d= kv",nextState:"d"},"d|D":{action_:"d=",nextState:"d"},q:{action_:"d=",nextState:"qd"},"qd|qD":{action_:"d=",nextState:"qd"},dq:{action_:["output","d="],nextState:"d"},3:{action_:["sb=false","output","operator"],nextState:"0"}},amount:{"0|2":{action_:"a=",nextState:"a"}},"pm-operator":{"0|1|2|a|as":{action_:["sb=false","output",{type_:"operator",option:"\\pm"}],nextState:"0"}},operator:{"0|1|2|a|as":{action_:["sb=false","output","operator"],nextState:"0"}},"-$":{"o|q":{action_:["charge or bond","output"],nextState:"qd"},d:{action_:"d=",nextState:"d"},D:{action_:["output",{type_:"bond",option:"-"}],nextState:"3"},q:{action_:"d=",nextState:"qd"},qd:{action_:"d=",nextState:"qd"},"qD|dq":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},"-9":{"3|o":{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"3"}},"- orbital overlap":{o:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},d:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"}},"-":{"0|1|2":{action_:[{type_:"output",option:1},"beginsWithBond=true",{type_:"bond",option:"-"}],nextState:"3"},3:{action_:{type_:"bond",option:"-"}},a:{action_:["output",{type_:"insert",option:"hyphen"}],nextState:"2"},as:{action_:[{type_:"output",option:2},{type_:"bond",option:"-"}],nextState:"3"},b:{action_:"b="},o:{action_:{type_:"- after o/d",option:!1},nextState:"2"},q:{action_:{type_:"- after o/d",option:!1},nextState:"2"},"d|qd|dq":{action_:{type_:"- after o/d",option:!0},nextState:"2"},"D|qD|p":{action_:["output",{type_:"bond",option:"-"}],nextState:"3"}},amount2:{"1|3":{action_:"a=",nextState:"a"}},letters:{"0|1|2|3|a|as|b|p|bp|o":{action_:"o=",nextState:"o"},"q|dq":{action_:["output","o="],nextState:"o"},"d|D|qd|qD":{action_:"o after d",nextState:"o"}},digits:{o:{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},q:{action_:["output","o="],nextState:"o"},a:{action_:"o=",nextState:"o"}},"space A":{"b|p|bp":{}},space:{a:{nextState:"as"},0:{action_:"sb=false"},"1|2":{action_:"sb=true"},"r|rt|rd|rdt|rdq":{action_:"output",nextState:"0"},"*":{action_:["output","sb=true"],nextState:"1"}},"1st-level escape":{"1|2":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}]},"*":{action_:["output",{type_:"insert+p1",option:"1st-level escape"}],nextState:"0"}},"[(...)]":{"r|rt":{action_:"rd=",nextState:"rd"},"rd|rdt":{action_:"rq=",nextState:"rdq"}},"...":{"o|d|D|dq|qd|qD":{action_:["output",{type_:"bond",option:"..."}],nextState:"3"},"*":{action_:[{type_:"output",option:1},{type_:"insert",option:"ellipsis"}],nextState:"1"}},". |* ":{"*":{action_:["output",{type_:"insert",option:"addition compound"}],nextState:"1"}},"state of aggregation $":{"*":{action_:["output","state of aggregation"],nextState:"1"}},"{[(":{"a|as|o":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"0|1|2|3":{action_:["o=","output","parenthesisLevel++"],nextState:"2"},"*":{action_:["output","o=","output","parenthesisLevel++"],nextState:"2"}},")]}":{"0|1|2|3|b|p|bp|o":{action_:["o=","parenthesisLevel--"],nextState:"o"},"a|as|d|D|q|qd|qD|dq":{action_:["output","o=","parenthesisLevel--"],nextState:"o"}},", ":{"*":{action_:["output","comma"],nextState:"0"}},"^_":{"*":{}},"^{(...)}|^($...$)":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"D"},q:{action_:"d=",nextState:"qD"},"d|D|qd|qD|dq":{action_:["output","d="],nextState:"D"}},"^a|^\\x{}{}|^\\x{}|^\\x|'":{"0|1|2|as":{action_:"b=",nextState:"b"},p:{action_:"b=",nextState:"bp"},"3|o":{action_:"d= kv",nextState:"d"},q:{action_:"d=",nextState:"qd"},"d|qd|D|qD":{action_:"d="},dq:{action_:["output","d="],nextState:"d"}},"_{(state of aggregation)}$":{"d|D|q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x":{"0|1|2|as":{action_:"p=",nextState:"p"},b:{action_:"p=",nextState:"bp"},"3|o":{action_:"q=",nextState:"q"},"d|D":{action_:"q=",nextState:"dq"},"q|qd|qD|dq":{action_:["output","q="],nextState:"q"}},"=<>":{"0|1|2|3|a|as|o|q|d|D|qd|qD|dq":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"#":{"0|1|2|3|a|as|o":{action_:[{type_:"output",option:2},{type_:"bond",option:"#"}],nextState:"3"}},"{}":{"*":{action_:{type_:"output",option:1},nextState:"1"}},"{...}":{"0|1|2|3|a|as|b|p|bp":{action_:"o=",nextState:"o"},"o|d|D|q|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"$...$":{a:{action_:"a="},"0|1|2|3|as|b|p|bp|o":{action_:"o=",nextState:"o"},"as|o":{action_:"o="},"q|d|D|qd|qD|dq":{action_:["output","o="],nextState:"o"}},"\\bond{(...)}":{"*":{action_:[{type_:"output",option:2},"bond"],nextState:"3"}},"\\frac{(...)}":{"*":{action_:[{type_:"output",option:1},"frac-output"],nextState:"3"}},"\\overset{(...)}":{"*":{action_:[{type_:"output",option:2},"overset-output"],nextState:"3"}},"\\underset{(...)}":{"*":{action_:[{type_:"output",option:2},"underset-output"],nextState:"3"}},"\\underbrace{(...)}":{"*":{action_:[{type_:"output",option:2},"underbrace-output"],nextState:"3"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:[{type_:"output",option:2},"color-output"],nextState:"3"}},"\\color{(...)}0":{"*":{action_:[{type_:"output",option:2},"color0-output"]}},"\\ce{(...)}":{"*":{action_:[{type_:"output",option:2},"ce"],nextState:"3"}},"\\,":{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"1"}},"\\x{}{}|\\x{}|\\x":{"0|1|2|3|a|as|b|p|bp|o|c0":{action_:["o=","output"],nextState:"3"},"*":{action_:["output","o=","output"],nextState:"3"}},others:{"*":{action_:[{type_:"output",option:1},"copy"],nextState:"3"}},else2:{a:{action_:"a to o",nextState:"o",revisit:!0},as:{action_:["output","sb=true"],nextState:"1",revisit:!0},"r|rt|rd|rdt|rdq":{action_:["output"],nextState:"0",revisit:!0},"*":{action_:["output","copy"],nextState:"3"}}}),actions:{"o after d":function(t,e){var n;if((t.d||"").match(/^[0-9]+$/)){var o=t.d;t.d=void 0,n=this.output(t),t.b=o}else n=this.output(t);return u.actions["o="](t,e),n},"d= kv":function(t,e){t.d=e,t.dType="kv"},"charge or bond":function(t,e){if(t.beginsWithBond){var n=[];return u.concatArray(n,this.output(t)),u.concatArray(n,u.actions.bond(t,e,"-")),n}t.d=e},"- after o/d":function(t,e,n){var o=u.patterns.match_("orbital",t.o||""),a=u.patterns.match_("one lowercase greek letter $",t.o||""),r=u.patterns.match_("one lowercase latin letter $",t.o||""),i=u.patterns.match_("$one lowercase latin letter$ $",t.o||""),c="-"===e&&(o&&""===o.remainder||a||r||i);!c||t.a||t.b||t.p||t.d||t.q||o||!r||(t.o="$"+t.o+"$");var p=[];return c?(u.concatArray(p,this.output(t)),p.push({type_:"hyphen"})):(o=u.patterns.match_("digits",t.d||""),n&&o&&""===o.remainder?(u.concatArray(p,u.actions["d="](t,e)),u.concatArray(p,this.output(t))):(u.concatArray(p,this.output(t)),u.concatArray(p,u.actions.bond(t,e,"-")))),p},"a to o":function(t){t.o=t.a,t.a=void 0},"sb=true":function(t){t.sb=!0},"sb=false":function(t){t.sb=!1},"beginsWithBond=true":function(t){t.beginsWithBond=!0},"beginsWithBond=false":function(t){t.beginsWithBond=!1},"parenthesisLevel++":function(t){t.parenthesisLevel++},"parenthesisLevel--":function(t){t.parenthesisLevel--},"state of aggregation":function(t,e){return{type_:"state of aggregation",p1:u.go(e,"o")}},comma:function(t,e){var n=e.replace(/\s*$/,"");return n!==e&&0===t.parenthesisLevel?{type_:"comma enumeration L",p1:n}:{type_:"comma enumeration M",p1:n}},output:function(t,e,n){var o,a,r;t.r?(a="M"===t.rdt?u.go(t.rd,"tex-math"):"T"===t.rdt?[{type_:"text",p1:t.rd||""}]:u.go(t.rd),r="M"===t.rqt?u.go(t.rq,"tex-math"):"T"===t.rqt?[{type_:"text",p1:t.rq||""}]:u.go(t.rq),o={type_:"arrow",r:t.r,rd:a,rq:r}):(o=[],(t.a||t.b||t.p||t.o||t.q||t.d||n)&&(t.sb&&o.push({type_:"entitySkip"}),t.o||t.q||t.d||t.b||t.p||2===n?t.o||t.q||t.d||!t.b&&!t.p?t.o&&"kv"===t.dType&&u.patterns.match_("d-oxidation$",t.d||"")?t.dType="oxidation":t.o&&"kv"===t.dType&&!t.q&&(t.dType=void 0):(t.o=t.a,t.d=t.b,t.q=t.p,t.a=t.b=t.p=void 0):(t.o=t.a,t.a=void 0),o.push({type_:"chemfive",a:u.go(t.a,"a"),b:u.go(t.b,"bd"),p:u.go(t.p,"pq"),o:u.go(t.o,"o"),q:u.go(t.q,"pq"),d:u.go(t.d,"oxidation"===t.dType?"oxidation":"bd"),dType:t.dType})));for(var i in t)"parenthesisLevel"!==i&&"beginsWithBond"!==i&&delete t[i];return o},"oxidation-output":function(t,e){var n=["{"];return u.concatArray(n,u.go(e,"oxidation")),n.push("}"),n},"frac-output":function(t,e){return{type_:"frac-ce",p1:u.go(e[0]),p2:u.go(e[1])}},"overset-output":function(t,e){return{type_:"overset",p1:u.go(e[0]),p2:u.go(e[1])}},"underset-output":function(t,e){return{type_:"underset",p1:u.go(e[0]),p2:u.go(e[1])}},"underbrace-output":function(t,e){return{type_:"underbrace",p1:u.go(e[0]),p2:u.go(e[1])}},"color-output":function(t,e){return{type_:"color",color1:e[0],color2:u.go(e[1])}},"r=":function(t,e){t.r=e},"rdt=":function(t,e){t.rdt=e},"rd=":function(t,e){t.rd=e},"rqt=":function(t,e){t.rqt=e},"rq=":function(t,e){t.rq=e},operator:function(t,e,n){return{type_:"operator",kind_:n||e}}}},a:{transitions:u.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},"$(...)$":{"*":{action_:"tex-math tight",nextState:"1"}},",":{"*":{action_:{type_:"insert",option:"commaDecimal"}}},else2:{"*":{action_:"copy"}}}),actions:{}},o:{transitions:u.createTransitions({empty:{"*":{}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"1",revisit:!0}},letters:{"*":{action_:"rm"}},"\\ca":{"*":{action_:{type_:"insert",option:"circa"}}},"\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"{text}"}},else2:{"*":{action_:"copy"}}}),actions:{}},text:{transitions:u.createTransitions({empty:{"*":{action_:"output"}},"{...}":{"*":{action_:"text="}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"\\greek":{"*":{action_:["output","rm"]}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:["output","copy"]}},else:{"*":{action_:"text="}}}),actions:{output:function(t){if(t.text_){var e={type_:"text",p1:t.text_};for(var n in t)delete t[n];return e}}}},pq:{transitions:u.createTransitions({empty:{"*":{}},"state of aggregation $":{"*":{action_:"state of aggregation"}},i$:{0:{nextState:"!f",revisit:!0}},"(KV letters),":{0:{action_:"rm",nextState:"0"}},formula$:{0:{nextState:"f",revisit:!0}},"1/2$":{0:{action_:"1/2"}},else:{0:{nextState:"!f",revisit:!0}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"a-z":{f:{action_:"tex-math"}},letters:{"*":{action_:"rm"}},"-9.,9":{"*":{action_:"9,9"}},",":{"*":{action_:{type_:"insert+p1",option:"comma enumeration S"}}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"state of aggregation":function(t,e){return{type_:"state of aggregation subscript",p1:u.go(e,"o")}},"color-output":function(t,e){return{type_:"color",color1:e[0],color2:u.go(e[1],"pq")}}}},bd:{transitions:u.createTransitions({empty:{"*":{}},x$:{0:{nextState:"!f",revisit:!0}},formula$:{0:{nextState:"f",revisit:!0}},else:{0:{nextState:"!f",revisit:!0}},"-9.,9 no missing 0":{"*":{action_:"9,9"}},".":{"*":{action_:{type_:"insert",option:"electron dot"}}},"a-z":{f:{action_:"tex-math"}},x:{"*":{action_:{type_:"insert",option:"KV x"}}},letters:{"*":{action_:"rm"}},"'":{"*":{action_:{type_:"insert",option:"prime"}}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},"{(...)}":{"*":{action_:"text"}},"\\color{(...)}{(...)}1|\\color(...){(...)}2":{"*":{action_:"color-output"}},"\\color{(...)}0":{"*":{action_:"color0-output"}},"\\ce{(...)}":{"*":{action_:"ce"}},"\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"copy"}},else2:{"*":{action_:"copy"}}}),actions:{"color-output":function(t,e){return{type_:"color",color1:e[0],color2:u.go(e[1],"bd")}}}},oxidation:{transitions:u.createTransitions({empty:{"*":{}},"roman numeral":{"*":{action_:"roman-numeral"}},"${(...)}$|$(...)$":{"*":{action_:"tex-math"}},else:{"*":{action_:"copy"}}}),actions:{"roman-numeral":function(t,e){return{type_:"roman numeral",p1:e||""}}}},"tex-math":{transitions:u.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},else:{"*":{action_:"o="}}}),actions:{output:function(t){if(t.o){var e={type_:"tex-math",p1:t.o};for(var n in t)delete t[n];return e}}}},"tex-math tight":{transitions:u.createTransitions({empty:{"*":{action_:"output"}},"\\ce{(...)}":{"*":{action_:["output","ce"]}},"{...}|\\,|\\x{}{}|\\x{}|\\x":{"*":{action_:"o="}},"-|+":{"*":{action_:"tight operator"}},else:{"*":{action_:"o="}}}),actions:{"tight operator":function(t,e){t.o=(t.o||"")+"{"+e+"}"},output:function(t){if(t.o){var e={type_:"tex-math",p1:t.o};for(var n in t)delete t[n];return e}}}},"9,9":{transitions:u.createTransitions({empty:{"*":{}},",":{"*":{action_:"comma"}},else:{"*":{action_:"copy"}}}),actions:{comma:function(){return{type_:"commaDecimal"}}}},pu:{transitions:u.createTransitions({empty:{"*":{action_:"output"}},space$:{"*":{action_:["output","space"]}},"{[(|)]}":{"0|a":{action_:"copy"}},"(-)(9)^(-9)":{0:{action_:"number^",nextState:"a"}},"(-)(9.,9)(e)(99)":{0:{action_:"enumber",nextState:"a"}},space:{"0|a":{}},"pm-operator":{"0|a":{action_:{type_:"operator",option:"\\pm"},nextState:"0"}},operator:{"0|a":{action_:"copy",nextState:"0"}},"//":{d:{action_:"o=",nextState:"/"}},"/":{d:{action_:"o=",nextState:"/"}},"{...}|else":{"0|d":{action_:"d=",nextState:"d"},a:{action_:["space","d="],nextState:"d"},"/|q":{action_:"q=",nextState:"q"}}}),actions:{enumber:function(t,e){var n=[];return"+-"===e[0]||"+/-"===e[0]?n.push("\\pm "):e[0]&&n.push(e[0]),e[1]&&(u.concatArray(n,u.go(e[1],"pu-9,9")),e[2]&&(e[2].match(/[,.]/)?u.concatArray(n,u.go(e[2],"pu-9,9")):n.push(e[2])),e[3]=e[4]||e[3],e[3]&&(e[3]=e[3].trim(),"e"===e[3]||"*"===e[3].substr(0,1)?n.push({type_:"cdot"}):n.push({type_:"times"}))),e[3]&&n.push("10^{"+e[5]+"}"),n},"number^":function(t,e){var n=[];return"+-"===e[0]||"+/-"===e[0]?n.push("\\pm "):e[0]&&n.push(e[0]),u.concatArray(n,u.go(e[1],"pu-9,9")),n.push("^{"+e[2]+"}"),n},operator:function(t,e,n){return{type_:"operator",kind_:n||e}},space:function(){return{type_:"pu-space-1"}},output:function(t){var e,n=u.patterns.match_("{(...)}",t.d||"");n&&""===n.remainder&&(t.d=n.match_);var o=u.patterns.match_("{(...)}",t.q||"");if(o&&""===o.remainder&&(t.q=o.match_),t.d&&(t.d=t.d.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),t.d=t.d.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F")),t.q){t.q=t.q.replace(/\u00B0C|\^oC|\^{o}C/g,"{}^{\\circ}C"),t.q=t.q.replace(/\u00B0F|\^oF|\^{o}F/g,"{}^{\\circ}F");var a={d:u.go(t.d,"pu"),q:u.go(t.q,"pu")};"//"===t.o?e={type_:"pu-frac",p1:a.d,p2:a.q}:(e=a.d,a.d.length>1||a.q.length>1?e.push({type_:" / "}):e.push({type_:"/"}),u.concatArray(e,a.q))}else e=u.go(t.d,"pu-2");for(var r in t)delete t[r];return e}}},"pu-2":{transitions:u.createTransitions({empty:{"*":{action_:"output"}},"*":{"*":{action_:["output","cdot"],nextState:"0"}},"\\x":{"*":{action_:"rm="}},space:{"*":{action_:["output","space"],nextState:"0"}},"^{(...)}|^(-1)":{1:{action_:"^(-1)"}},"-9.,9":{0:{action_:"rm=",nextState:"0"},1:{action_:"^(-1)",nextState:"0"}},"{...}|else":{"*":{action_:"rm=",nextState:"1"}}}),actions:{cdot:function(){return{type_:"tight cdot"}},"^(-1)":function(t,e){t.rm+="^{"+e+"}"},space:function(){return{type_:"pu-space-2"}},output:function(t){var e=[];if(t.rm){var n=u.patterns.match_("{(...)}",t.rm||"");e=n&&""===n.remainder?u.go(n.match_,"pu"):{type_:"rm",p1:t.rm}}for(var o in t)delete t[o];return e}}},"pu-9,9":{transitions:u.createTransitions({empty:{0:{action_:"output-0"},o:{action_:"output-o"}},",":{0:{action_:["output-0","comma"],nextState:"o"}},".":{0:{action_:["output-0","copy"],nextState:"o"}},else:{"*":{action_:"text="}}}),actions:{comma:function(){return{type_:"commaDecimal"}},"output-0":function(t){var e=[];if(t.text_=t.text_||"",t.text_.length>4){var n=t.text_.length%3;0===n&&(n=3);for(var o=t.text_.length-3;o>0;o-=3)e.push(t.text_.substr(o,3)),e.push({type_:"1000 separator"});e.push(t.text_.substr(0,n)),e.reverse()}else e.push(t.text_);for(var a in t)delete t[a];return e},"output-o":function(t){var e=[];if(t.text_=t.text_||"",t.text_.length>4){for(var n=t.text_.length-3,o=0;o<n;o+=3)e.push(t.text_.substr(o,3)),e.push({type_:"1000 separator"});e.push(t.text_.substr(o))}else e.push(t.text_);for(var a in t)delete t[a];return e}}}};var p={go:function(t,e){if(!t)return"";for(var n="",o=!1,a=0;a<t.length;a++){var r=t[a];"string"==typeof r?n+=r:(n+=p._go2(r),"1st-level escape"===r.type_&&(o=!0))}return e||o||!n||(n="{"+n+"}"),n},_goInner:function(t){return t?p.go(t,!0):t},_go2:function(t){var e;switch(t.type_){case"chemfive":e="";var n={a:p._goInner(t.a),b:p._goInner(t.b),p:p._goInner(t.p),o:p._goInner(t.o),q:p._goInner(t.q),d:p._goInner(t.d)};n.a&&(n.a.match(/^[+\-]/)&&(n.a="{"+n.a+"}"),e+=n.a+"\\,"),(n.b||n.p)&&(e+="{\\vphantom{X}}",e+="^{\\hphantom{"+(n.b||"")+"}}_{\\hphantom{"+(n.p||"")+"}}",e+="{\\vphantom{X}}",e+="^{\\smash[t]{\\vphantom{2}}\\mathllap{"+(n.b||"")+"}}",e+="_{\\vphantom{2}\\mathllap{\\smash[t]{"+(n.p||"")+"}}}"),n.o&&(n.o.match(/^[+\-]/)&&(n.o="{"+n.o+"}"),e+=n.o),"kv"===t.dType?((n.d||n.q)&&(e+="{\\vphantom{X}}"),n.d&&(e+="^{"+n.d+"}"),n.q&&(e+="_{\\smash[t]{"+n.q+"}}")):"oxidation"===t.dType?(n.d&&(e+="{\\vphantom{X}}",e+="^{"+n.d+"}"),n.q&&(e+="{\\vphantom{X}}",e+="_{\\smash[t]{"+n.q+"}}")):(n.q&&(e+="{\\vphantom{X}}",e+="_{\\smash[t]{"+n.q+"}}"),n.d&&(e+="{\\vphantom{X}}",e+="^{"+n.d+"}"));break;case"rm":case"roman numeral":e="\\mathrm{"+t.p1+"}";break;case"text":t.p1.match(/[\^_]/)?(t.p1=t.p1.replace(" ","~").replace("-","\\text{-}"),e="\\mathrm{"+t.p1+"}"):e="\\text{"+t.p1+"}";break;case"state of aggregation":e="\\mskip2mu "+p._goInner(t.p1);break;case"state of aggregation subscript":e="\\mskip1mu "+p._goInner(t.p1);break;case"bond":if(!(e=p._getBond(t.kind_)))throw["MhchemErrorBond","mhchem Error. Unknown bond type ("+t.kind_+")"];break;case"frac":var o="\\frac{"+t.p1+"}{"+t.p2+"}";e="\\mathchoice{\\textstyle"+o+"}{"+o+"}{"+o+"}{"+o+"}";break;case"pu-frac":var a="\\frac{"+p._goInner(t.p1)+"}{"+p._goInner(t.p2)+"}";e="\\mathchoice{\\textstyle"+a+"}{"+a+"}{"+a+"}{"+a+"}";break;case"tex-math":case"1st-level escape":e=t.p1+" ";break;case"frac-ce":e="\\frac{"+p._goInner(t.p1)+"}{"+p._goInner(t.p2)+"}";break;case"overset":e="\\overset{"+p._goInner(t.p1)+"}{"+p._goInner(t.p2)+"}";break;case"underset":e="\\underset{"+p._goInner(t.p1)+"}{"+p._goInner(t.p2)+"}";break;case"underbrace":e="\\underbrace{"+p._goInner(t.p1)+"}_{"+p._goInner(t.p2)+"}";break;case"color":e="{\\color{"+t.color1+"}{"+p._goInner(t.color2)+"}}";break;case"color0":e="\\color{"+t.color+"}";break;case"arrow":var r={rd:p._goInner(t.rd),rq:p._goInner(t.rq)},i="\\x"+p._getArrow(t.r);r.rq&&(i+="[{"+r.rq+"}]"),e=i+=r.rd?"{"+r.rd+"}":"{}";break;case"operator":e=p._getOperator(t.kind_);break;case"space":e=" ";break;case"entitySkip":case"pu-space-1":e="~";break;case"pu-space-2":e="\\mkern3mu ";break;case"1000 separator":e="\\mkern2mu ";break;case"commaDecimal":e="{,}";break;case"comma enumeration L":e="{"+t.p1+"}\\mkern6mu ";break;case"comma enumeration M":e="{"+t.p1+"}\\mkern3mu ";break;case"comma enumeration S":e="{"+t.p1+"}\\mkern1mu ";break;case"hyphen":e="\\text{-}";break;case"addition compound":e="\\,{\\cdot}\\,";break;case"electron dot":e="\\mkern1mu \\bullet\\mkern1mu ";break;case"KV x":e="{\\times}";break;case"prime":e="\\prime ";break;case"cdot":e="\\cdot ";break;case"tight cdot":e="\\mkern1mu{\\cdot}\\mkern1mu ";break;case"times":e="\\times ";break;case"circa":e="{\\sim}";break;case"^":e="uparrow";break;case"v":e="downarrow";break;case"ellipsis":e="\\ldots ";break;case"/":e="/";break;case" / ":e="\\,/\\,";break;default:throw["MhchemBugT","mhchem bug T. Please report."]}return e},_getArrow:function(t){switch(t){case"->":case"\u2192":case"\u27f6":return"rightarrow";case"<-":return"leftarrow";case"<->":return"leftrightarrow";case"<--\x3e":return"rightleftarrows";case"<=>":case"\u21cc":return"rightleftharpoons";case"<=>>":return"rightequilibrium";case"<<=>":return"leftequilibrium";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getBond:function(t){switch(t){case"-":case"1":return"{-}";case"=":case"2":return"{=}";case"#":case"3":return"{\\equiv}";case"~":return"{\\tripledash}";case"~-":return"{\\mathrlap{\\raisebox{-.1em}{$-$}}\\raisebox{.1em}{$\\tripledash$}}";case"~=":case"~--":return"{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$\\tripledash$}}-}";case"-~-":return"{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$-$}}\\tripledash}";case"...":return"{{\\cdot}{\\cdot}{\\cdot}}";case"....":return"{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";case"->":return"{\\rightarrow}";case"<-":return"{\\leftarrow}";case"<":return"{<}";case">":return"{>}";default:throw["MhchemBugT","mhchem bug T. Please report."]}},_getOperator:function(t){switch(t){case"+":return" {}+{} ";case"-":return" {}-{} ";case"=":return" {}={} ";case"<":return" {}<{} ";case">":return" {}>{} ";case"<<":return" {}\\ll{} ";case">>":return" {}\\gg{} ";case"\\pm":return" {}\\pm{} ";case"\\approx":case"$\\approx$":return" {}\\approx{} ";case"v":case"(v)":return" \\downarrow{} ";case"^":case"(^)":return" \\uparrow{} ";default:throw["MhchemBugT","mhchem bug T. Please report."]}}};return a=a.default}()});$x   import katex from '../katex.mjs';

/* eslint-disable */
/* -*- Mode: JavaScript; indent-tabs-mode:nil; js-indent-level: 2 -*- */
/* vim: set ts=2 et sw=2 tw=80: */

/*************************************************************
 *
 *  KaTeX mhchem.js
 *
 *  This file implements a KaTeX version of mhchem version 3.3.0.
 *  It is adapted from MathJax/extensions/TeX/mhchem.js
 *  It differs from the MathJax version as follows:
 *    1. The interface is changed so that it can be called from KaTeX, not MathJax.
 *    2. \rlap and \llap are replaced with \mathrlap and \mathllap.
 *    3. Four lines of code are edited in order to use \raisebox instead of \raise.
 *    4. The reaction arrow code is simplified. All reaction arrows are rendered
 *       using KaTeX extensible arrows instead of building non-extensible arrows.
 *    5. \tripledash vertical alignment is slightly adjusted.
 *
 *    This code, as other KaTeX code, is released under the MIT license.
 * 
 * /*************************************************************
 *
 *  MathJax/extensions/TeX/mhchem.js
 *
 *  Implements the \ce command for handling chemical formulas
 *  from the mhchem LaTeX package.
 *
 *  ---------------------------------------------------------------------
 *
 *  Copyright (c) 2011-2015 The MathJax Consortium
 *  Copyright (c) 2015-2018 Martin Hensel
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

//
// Coding Style
//   - use '' for identifiers that can by minified/uglified
//   - use "" for strings that need to stay untouched

// version: "3.3.0" for MathJax and KaTeX

// Add \ce, \pu, and \tripledash to the KaTeX macros.

katex.__defineMacro("\\ce", function (context) {
  return chemParse(context.consumeArgs(1)[0], "ce");
});
katex.__defineMacro("\\pu", function (context) {
  return chemParse(context.consumeArgs(1)[0], "pu");
});

//  Needed for \bond for the ~ forms
//  Raise by 2.56mu, not 2mu. We're raising a hyphen-minus, U+002D, not 
//  a mathematical minus, U+2212. So we need that extra 0.56.
katex.__defineMacro("\\tripledash", "{\\vphantom{-}\\raisebox{2.56mu}{$\\mkern2mu" + "\\tiny\\text{-}\\mkern1mu\\text{-}\\mkern1mu\\text{-}\\mkern2mu$}}");

//
//  This is the main function for handing the \ce and \pu commands.
//  It takes the argument to \ce or \pu and returns the corresponding TeX string.
//

var chemParse = function chemParse(tokens, stateMachine) {
  // Recreate the argument string from KaTeX's array of tokens.
  var str = "";
  var expectedLoc = tokens.length && tokens[tokens.length - 1].loc.start;
  for (var i = tokens.length - 1; i >= 0; i--) {
    if (tokens[i].loc.start > expectedLoc) {
      // context.consumeArgs has eaten a space.
      str += " ";
      expectedLoc = tokens[i].loc.start;
    }
    str += tokens[i].text;
    expectedLoc += tokens[i].text.length;
  }
  var tex = texify.go(mhchemParser.go(str, stateMachine));
  return tex;
};

//
// Core parser for mhchem syntax  (recursive)
//
/** @type {MhchemParser} */
var mhchemParser = {
  //
  // Parses mchem \ce syntax
  //
  // Call like
  //   go("H2O");
  //
  go: function go(input, stateMachine) {
    if (!input) {
      return [];
    }
    if (stateMachine === undefined) {
      stateMachine = 'ce';
    }
    var state = '0';

    //
    // String buffers for parsing:
    //
    // buffer.a == amount
    // buffer.o == element
    // buffer.b == left-side superscript
    // buffer.p == left-side subscript
    // buffer.q == right-side subscript
    // buffer.d == right-side superscript
    //
    // buffer.r == arrow
    // buffer.rdt == arrow, script above, type
    // buffer.rd == arrow, script above, content
    // buffer.rqt == arrow, script below, type
    // buffer.rq == arrow, script below, content
    //
    // buffer.text_
    // buffer.rm
    // etc.
    //
    // buffer.parenthesisLevel == int, starting at 0
    // buffer.sb == bool, space before
    // buffer.beginsWithBond == bool
    //
    // These letters are also used as state names.
    //
    // Other states:
    // 0 == begin of main part (arrow/operator unlikely)
    // 1 == next entity
    // 2 == next entity (arrow/operator unlikely)
    // 3 == next atom
    // c == macro
    //
    /** @type {Buffer} */
    var buffer = {};
    buffer['parenthesisLevel'] = 0;
    input = input.replace(/\n/g, " ");
    input = input.replace(/[\u2212\u2013\u2014\u2010]/g, "-");
    input = input.replace(/[\u2026]/g, "...");

    //
    // Looks through mhchemParser.transitions, to execute a matching action
    // (recursive)
    //
    var lastInput;
    var watchdog = 10;
    /** @type {ParserOutput[]} */
    var output = [];
    while (true) {
      if (lastInput !== input) {
        watchdog = 10;
        lastInput = input;
      } else {
        watchdog--;
      }
      //
      // Find actions in transition table
      //
      var machine = mhchemParser.stateMachines[stateMachine];
      var t = machine.transitions[state] || machine.transitions['*'];
      iterateTransitions: for (var i = 0; i < t.length; i++) {
        var matches = mhchemParser.patterns.match_(t[i].pattern, input);
        if (matches) {
          //
          // Execute actions
          //
          var task = t[i].task;
          for (var iA = 0; iA < task.action_.length; iA++) {
            var o;
            //
            // Find and execute action
            //
            if (machine.actions[task.action_[iA].type_]) {
              o = machine.actions[task.action_[iA].type_](buffer, matches.match_, task.action_[iA].option);
            } else if (mhchemParser.actions[task.action_[iA].type_]) {
              o = mhchemParser.actions[task.action_[iA].type_](buffer, matches.match_, task.action_[iA].option);
            } else {
              throw ["MhchemBugA", "mhchem bug A. Please report. (" + task.action_[iA].type_ + ")"]; // Trying to use non-existing action
            }
            //
            // Add output
            //
            mhchemParser.concatArray(output, o);
          }
          //
          // Set next state,
          // Shorten input,
          // Continue with next character
          //   (= apply only one transition per position)
          //
          state = task.nextState || state;
          if (input.length > 0) {
            if (!task.revisit) {
              input = matches.remainder;
            }
            if (!task.toContinue) {
              break iterateTransitions;
            }
          } else {
            return output;
          }
        }
      }
      //
      // Prevent infinite loop
      //
      if (watchdog <= 0) {
        throw ["MhchemBugU", "mhchem bug U. Please report."]; // Unexpected character
      }
    }
  },
  concatArray: function concatArray(a, b) {
    if (b) {
      if (Array.isArray(b)) {
        for (var iB = 0; iB < b.length; iB++) {
          a.push(b[iB]);
        }
      } else {
        a.push(b);
      }
    }
  },
  patterns: {
    //
    // Matching patterns
    // either regexps or function that return null or {match_:"a", remainder:"bc"}
    //
    patterns: {
      // property names must not look like integers ("2") for correct property traversal order, later on
      'empty': /^$/,
      'else': /^./,
      'else2': /^./,
      'space': /^\s/,
      'space A': /^\s(?=[A-Z\\$])/,
      'space$': /^\s$/,
      'a-z': /^[a-z]/,
      'x': /^x/,
      'x$': /^x$/,
      'i$': /^i$/,
      'letters': /^(?:[a-zA-Z\u03B1-\u03C9\u0391-\u03A9?@]|(?:\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))))+/,
      '\\greek': /^\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega|Gamma|Delta|Theta|Lambda|Xi|Pi|Sigma|Upsilon|Phi|Psi|Omega)(?:\s+|\{\}|(?![a-zA-Z]))/,
      'one lowercase latin letter $': /^(?:([a-z])(?:$|[^a-zA-Z]))$/,
      '$one lowercase latin letter$ $': /^\$(?:([a-z])(?:$|[^a-zA-Z]))\$$/,
      'one lowercase greek letter $': /^(?:\$?[\u03B1-\u03C9]\$?|\$?\\(?:alpha|beta|gamma|delta|epsilon|zeta|eta|theta|iota|kappa|lambda|mu|nu|xi|omicron|pi|rho|sigma|tau|upsilon|phi|chi|psi|omega)\s*\$?)(?:\s+|\{\}|(?![a-zA-Z]))$/,
      'digits': /^[0-9]+/,
      '-9.,9': /^[+\-]?(?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))/,
      '-9.,9 no missing 0': /^[+\-]?[0-9]+(?:[.,][0-9]+)?/,
      '(-)(9.,9)(e)(99)': function e99(input) {
        var m = input.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))?(\((?:[0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+))\))?(?:([eE]|\s*(\*|x|\\times|\u00D7)\s*10\^)([+\-]?[0-9]+|\{[+\-]?[0-9]+\}))?/);
        if (m && m[0]) {
          return {
            match_: m.splice(1),
            remainder: input.substr(m[0].length)
          };
        }
        return null;
      },
      '(-)(9)^(-9)': function _(input) {
        var m = input.match(/^(\+\-|\+\/\-|\+|\-|\\pm\s?)?([0-9]+(?:[,.][0-9]+)?|[0-9]*(?:\.[0-9]+)?)\^([+\-]?[0-9]+|\{[+\-]?[0-9]+\})/);
        if (m && m[0]) {
          return {
            match_: m.splice(1),
            remainder: input.substr(m[0].length)
          };
        }
        return null;
      },
      'state of aggregation $': function state_of_aggregation_$(input) {
        // ... or crystal system
        var a = mhchemParser.patterns.findObserveGroups(input, "", /^\([a-z]{1,3}(?=[\),])/, ")", ""); // (aq), (aq,$\infty$), (aq, sat)
        if (a && a.remainder.match(/^($|[\s,;\)\]\}])/)) {
          return a;
        } //  AND end of 'phrase'
        var m = input.match(/^(?:\((?:\\ca\s?)?\$[amothc]\$\))/); // OR crystal system ($o$) (\ca$c$)
        if (m) {
          return {
            match_: m[0],
            remainder: input.substr(m[0].length)
          };
        }
        return null;
      },
      '_{(state of aggregation)}$': /^_\{(\([a-z]{1,3}\))\}/,
      '{[(': /^(?:\\\{|\[|\()/,
      ')]}': /^(?:\)|\]|\\\})/,
      ', ': /^[,;]\s*/,
      ',': /^[,;]/,
      '.': /^[.]/,
      '. ': /^([.\u22C5\u00B7\u2022])\s*/,
      '...': /^\.\.\.(?=$|[^.])/,
      '* ': /^([*])\s*/,
      '^{(...)}': function _(input) {
        return mhchemParser.patterns.findObserveGroups(input, "^{", "", "", "}");
      },
      '^($...$)': function $$(input) {
        return mhchemParser.patterns.findObserveGroups(input, "^", "$", "$", "");
      },
      '^a': /^\^([0-9]+|[^\\_])/,
      '^\\x{}{}': function x(input) {
        return mhchemParser.patterns.findObserveGroups(input, "^", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true);
      },
      '^\\x{}': function x(input) {
        return mhchemParser.patterns.findObserveGroups(input, "^", /^\\[a-zA-Z]+\{/, "}", "");
      },
      '^\\x': /^\^(\\[a-zA-Z]+)\s*/,
      '^(-1)': /^\^(-?\d+)/,
      '\'': /^'/,
      '_{(...)}': function _(input) {
        return mhchemParser.patterns.findObserveGroups(input, "_{", "", "", "}");
      },
      '_($...$)': function _$$(input) {
        return mhchemParser.patterns.findObserveGroups(input, "_", "$", "$", "");
      },
      '_9': /^_([+\-]?[0-9]+|[^\\])/,
      '_\\x{}{}': function _X(input) {
        return mhchemParser.patterns.findObserveGroups(input, "_", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true);
      },
      '_\\x{}': function _X(input) {
        return mhchemParser.patterns.findObserveGroups(input, "_", /^\\[a-zA-Z]+\{/, "}", "");
      },
      '_\\x': /^_(\\[a-zA-Z]+)\s*/,
      '^_': /^(?:\^(?=_)|\_(?=\^)|[\^_]$)/,
      '{}': /^\{\}/,
      '{...}': function _(input) {
        return mhchemParser.patterns.findObserveGroups(input, "", "{", "}", "");
      },
      '{(...)}': function _(input) {
        return mhchemParser.patterns.findObserveGroups(input, "{", "", "", "}");
      },
      '$...$': function $$(input) {
        return mhchemParser.patterns.findObserveGroups(input, "", "$", "$", "");
      },
      '${(...)}$': function $$(input) {
        return mhchemParser.patterns.findObserveGroups(input, "${", "", "", "}$");
      },
      '$(...)$': function $$(input) {
        return mhchemParser.patterns.findObserveGroups(input, "$", "", "", "$");
      },
      '=<>': /^[=<>]/,
      '#': /^[#\u2261]/,
      '+': /^\+/,
      '-$': /^-(?=[\s_},;\]/]|$|\([a-z]+\))/,
      // -space -, -; -] -/ -$ -state-of-aggregation
      '-9': /^-(?=[0-9])/,
      '- orbital overlap': /^-(?=(?:[spd]|sp)(?:$|[\s,;\)\]\}]))/,
      '-': /^-/,
      'pm-operator': /^(?:\\pm|\$\\pm\$|\+-|\+\/-)/,
      'operator': /^(?:\+|(?:[\-=<>]|<<|>>|\\approx|\$\\approx\$)(?=\s|$|-?[0-9]))/,
      'arrowUpDown': /^(?:v|\(v\)|\^|\(\^\))(?=$|[\s,;\)\]\}])/,
      '\\bond{(...)}': function bond(input) {
        return mhchemParser.patterns.findObserveGroups(input, "\\bond{", "", "", "}");
      },
      '->': /^(?:<->|<-->|->|<-|<=>>|<<=>|<=>|[\u2192\u27F6\u21CC])/,
      'CMT': /^[CMT](?=\[)/,
      '[(...)]': function _(input) {
        return mhchemParser.patterns.findObserveGroups(input, "[", "", "", "]");
      },
      '1st-level escape': /^(&|\\\\|\\hline)\s*/,
      '\\,': /^(?:\\[,\ ;:])/,
      // \\x - but output no space before
      '\\x{}{}': function x(input) {
        return mhchemParser.patterns.findObserveGroups(input, "", /^\\[a-zA-Z]+\{/, "}", "", "", "{", "}", "", true);
      },
      '\\x{}': function x(input) {
        return mhchemParser.patterns.findObserveGroups(input, "", /^\\[a-zA-Z]+\{/, "}", "");
      },
      '\\ca': /^\\ca(?:\s+|(?![a-zA-Z]))/,
      '\\x': /^(?:\\[a-zA-Z]+\s*|\\[_&{}%])/,
      'orbital': /^(?:[0-9]{1,2}[spdfgh]|[0-9]{0,2}sp)(?=$|[^a-zA-Z])/,
      // only those with numbers in front, because the others will be formatted correctly anyway
      'others': /^[\/~|]/,
      '\\frac{(...)}': function frac(input) {
        return mhchemParser.patterns.findObserveGroups(input, "\\frac{", "", "", "}", "{", "", "", "}");
      },
      '\\overset{(...)}': function overset(input) {
        return mhchemParser.patterns.findObserveGroups(input, "\\overset{", "", "", "}", "{", "", "", "}");
      },
      '\\underset{(...)}': function underset(input) {
        return mhchemParser.patterns.findObserveGroups(input, "\\underset{", "", "", "}", "{", "", "", "}");
      },
      '\\underbrace{(...)}': function underbrace(input) {
        return mhchemParser.patterns.findObserveGroups(input, "\\underbrace{", "", "", "}_", "{", "", "", "}");
      },
      '\\color{(...)}0': function color0(input) {
        return mhchemParser.patterns.findObserveGroups(input, "\\color{", "", "", "}");
      },
      '\\color{(...)}{(...)}1': function color1(input) {
        return mhchemParser.patterns.findObserveGroups(input, "\\color{", "", "", "}", "{", "", "", "}");
      },
      '\\color(...){(...)}2': function color2(input) {
        return mhchemParser.patterns.findObserveGroups(input, "\\color", "\\", "", /^(?=\{)/, "{", "", "", "}");
      },
      '\\ce{(...)}': function ce(input) {
        return mhchemParser.patterns.findObserveGroups(input, "\\ce{", "", "", "}");
      },
      'oxidation$': /^(?:[+-][IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,
      'd-oxidation$': /^(?:[+-]?\s?[IVX]+|\\pm\s*0|\$\\pm\$\s*0)$/,
      // 0 could be oxidation or charge
      'roman numeral': /^[IVX]+/,
      '1/2$': /^[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+(?:\$[a-z]\$|[a-z])?$/,
      'amount': function amount(input) {
        var match;
        // e.g. 2, 0.5, 1/2, -2, n/2, +;  $a$ could be added later in parsing
        match = input.match(/^(?:(?:(?:\([+\-]?[0-9]+\/[0-9]+\)|[+\-]?(?:[0-9]+|\$[a-z]\$|[a-z])\/[0-9]+|[+\-]?[0-9]+[.,][0-9]+|[+\-]?\.[0-9]+|[+\-]?[0-9]+)(?:[a-z](?=\s*[A-Z]))?)|[+\-]?[a-z](?=\s*[A-Z])|\+(?!\s))/);
        if (match) {
          return {
            match_: match[0],
            remainder: input.substr(match[0].length)
          };
        }
        var a = mhchemParser.patterns.findObserveGroups(input, "", "$", "$", "");
        if (a) {
          // e.g. $2n-1$, $-$
          match = a.match_.match(/^\$(?:\(?[+\-]?(?:[0-9]*[a-z]?[+\-])?[0-9]*[a-z](?:[+\-][0-9]*[a-z]?)?\)?|\+|-)\$$/);
          if (match) {
            return {
              match_: match[0],
              remainder: input.substr(match[0].length)
            };
          }
        }
        return null;
      },
      'amount2': function amount2(input) {
        return this['amount'](input);
      },
      '(KV letters),': /^(?:[A-Z][a-z]{0,2}|i)(?=,)/,
      'formula$': function formula$(input) {
        if (input.match(/^\([a-z]+\)$/)) {
          return null;
        } // state of aggregation = no formula
        var match = input.match(/^(?:[a-z]|(?:[0-9\ \+\-\,\.\(\)]+[a-z])+[0-9\ \+\-\,\.\(\)]*|(?:[a-z][0-9\ \+\-\,\.\(\)]+)+[a-z]?)$/);
        if (match) {
          return {
            match_: match[0],
            remainder: input.substr(match[0].length)
          };
        }
        return null;
      },
      'uprightEntities': /^(?:pH|pOH|pC|pK|iPr|iBu)(?=$|[^a-zA-Z])/,
      '/': /^\s*(\/)\s*/,
      '//': /^\s*(\/\/)\s*/,
      '*': /^\s*[*.]\s*/
    },
    findObserveGroups: function findObserveGroups(input, begExcl, begIncl, endIncl, endExcl, beg2Excl, beg2Incl, end2Incl, end2Excl, combine) {
      /** @type {{(input: string, pattern: string | RegExp): string | string[] | null;}} */
      var _match = function _match(input, pattern) {
        if (typeof pattern === "string") {
          if (input.indexOf(pattern) !== 0) {
            return null;
          }
          return pattern;
        } else {
          var match = input.match(pattern);
          if (!match) {
            return null;
          }
          return match[0];
        }
      };
      /** @type {{(input: string, i: number, endChars: string | RegExp): {endMatchBegin: number, endMatchEnd: number} | null;}} */
      var _findObserveGroups = function _findObserveGroups(input, i, endChars) {
        var braces = 0;
        while (i < input.length) {
          var a = input.charAt(i);
          var match = _match(input.substr(i), endChars);
          if (match !== null && braces === 0) {
            return {
              endMatchBegin: i,
              endMatchEnd: i + match.length
            };
          } else if (a === "{") {
            braces++;
          } else if (a === "}") {
            if (braces === 0) {
              throw ["ExtraCloseMissingOpen", "Extra close brace or missing open brace"];
            } else {
              braces--;
            }
          }
          i++;
        }
        if (braces > 0) {
          return null;
        }
        return null;
      };
      var match = _match(input, begExcl);
      if (match === null) {
        return null;
      }
      input = input.substr(match.length);
      match = _match(input, begIncl);
      if (match === null) {
        return null;
      }
      var e = _findObserveGroups(input, match.length, endIncl || endExcl);
      if (e === null) {
        return null;
      }
      var match1 = input.substring(0, endIncl ? e.endMatchEnd : e.endMatchBegin);
      if (!(beg2Excl || beg2Incl)) {
        return {
          match_: match1,
          remainder: input.substr(e.endMatchEnd)
        };
      } else {
        var group2 = this.findObserveGroups(input.substr(e.endMatchEnd), beg2Excl, beg2Incl, end2Incl, end2Excl);
        if (group2 === null) {
          return null;
        }
        /** @type {string[]} */
        var matchRet = [match1, group2.match_];
        return {
          match_: combine ? matchRet.join("") : matchRet,
          remainder: group2.remainder
        };
      }
    },
    //
    // Matching function
    // e.g. match("a", input) will look for the regexp called "a" and see if it matches
    // returns null or {match_:"a", remainder:"bc"}
    //
    match_: function match_(m, input) {
      var pattern = mhchemParser.patterns.patterns[m];
      if (pattern === undefined) {
        throw ["MhchemBugP", "mhchem bug P. Please report. (" + m + ")"]; // Trying to use non-existing pattern
      } else if (typeof pattern === "function") {
        return mhchemParser.patterns.patterns[m](input); // cannot use cached var pattern here, because some pattern functions need this===mhchemParser
      } else {
        // RegExp
        var match = input.match(pattern);
        if (match) {
          var mm;
          if (match[2]) {
            mm = [match[1], match[2]];
          } else if (match[1]) {
            mm = match[1];
          } else {
            mm = match[0];
          }
          return {
            match_: mm,
            remainder: input.substr(match[0].length)
          };
        }
        return null;
      }
    }
  },
  //
  // Generic state machine actions
  //
  actions: {
    'a=': function a(buffer, m) {
      buffer.a = (buffer.a || "") + m;
    },
    'b=': function b(buffer, m) {
      buffer.b = (buffer.b || "") + m;
    },
    'p=': function p(buffer, m) {
      buffer.p = (buffer.p || "") + m;
    },
    'o=': function o(buffer, m) {
      buffer.o = (buffer.o || "") + m;
    },
    'q=': function q(buffer, m) {
      buffer.q = (buffer.q || "") + m;
    },
    'd=': function d(buffer, m) {
      buffer.d = (buffer.d || "") + m;
    },
    'rm=': function rm(buffer, m) {
      buffer.rm = (buffer.rm || "") + m;
    },
    'text=': function text(buffer, m) {
      buffer.text_ = (buffer.text_ || "") + m;
    },
    'insert': function insert(buffer, m, a) {
      return {
        type_: a
      };
    },
    'insert+p1': function insertP1(buffer, m, a) {
      return {
        type_: a,
        p1: m
      };
    },
    'insert+p1+p2': function insertP1P2(buffer, m, a) {
      return {
        type_: a,
        p1: m[0],
        p2: m[1]
      };
    },
    'copy': function copy(buffer, m) {
      return m;
    },
    'rm': function rm(buffer, m) {
      return {
        type_: 'rm',
        p1: m || ""
      };
    },
    'text': function text(buffer, m) {
      return mhchemParser.go(m, 'text');
    },
    '{text}': function text(buffer, m) {
      var ret = ["{"];
      mhchemParser.concatArray(ret, mhchemParser.go(m, 'text'));
      ret.push("}");
      return ret;
    },
    'tex-math': function texMath(buffer, m) {
      return mhchemParser.go(m, 'tex-math');
    },
    'tex-math tight': function texMath_tight(buffer, m) {
      return mhchemParser.go(m, 'tex-math tight');
    },
    'bond': function bond(buffer, m, k) {
      return {
        type_: 'bond',
        kind_: k || m
      };
    },
    'color0-output': function color0Output(buffer, m) {
      return {
        type_: 'color0',
        color: m[0]
      };
    },
    'ce': function ce(buffer, m) {
      return mhchemParser.go(m);
    },
    '1/2': function _2(buffer, m) {
      /** @type {ParserOutput[]} */
      var ret = [];
      if (m.match(/^[+\-]/)) {
        ret.push(m.substr(0, 1));
        m = m.substr(1);
      }
      var n = m.match(/^([0-9]+|\$[a-z]\$|[a-z])\/([0-9]+)(\$[a-z]\$|[a-z])?$/);
      n[1] = n[1].replace(/\$/g, "");
      ret.push({
        type_: 'frac',
        p1: n[1],
        p2: n[2]
      });
      if (n[3]) {
        n[3] = n[3].replace(/\$/g, "");
        ret.push({
          type_: 'tex-math',
          p1: n[3]
        });
      }
      return ret;
    },
    '9,9': function _(buffer, m) {
      return mhchemParser.go(m, '9,9');
    }
  },
  //
  // createTransitions
  // convert  { 'letter': { 'state': { action_: 'output' } } }  to  { 'state' => [ { pattern: 'letter', task: { action_: [{type_: 'output'}] } } ] }
  // with expansion of 'a|b' to 'a' and 'b' (at 2 places)
  //
  createTransitions: function createTransitions(o) {
    var pattern, state;
    /** @type {string[]} */
    var stateArray;
    var i;
    //
    // 1. Collect all states
    //
    /** @type {Transitions} */
    var transitions = {};
    for (pattern in o) {
      for (state in o[pattern]) {
        stateArray = state.split("|");
        o[pattern][state].stateArray = stateArray;
        for (i = 0; i < stateArray.length; i++) {
          transitions[stateArray[i]] = [];
        }
      }
    }
    //
    // 2. Fill states
    //
    for (pattern in o) {
      for (state in o[pattern]) {
        stateArray = o[pattern][state].stateArray || [];
        for (i = 0; i < stateArray.length; i++) {
          //
          // 2a. Normalize actions into array:  'text=' ==> [{type_:'text='}]
          // (Note to myself: Resolving the function here would be problematic. It would need .bind (for *this*) and currying (for *option*).)
          //
          /** @type {any} */
          var p = o[pattern][state];
          if (p.action_) {
            p.action_ = [].concat(p.action_);
            for (var k = 0; k < p.action_.length; k++) {
              if (typeof p.action_[k] === "string") {
                p.action_[k] = {
                  type_: p.action_[k]
                };
              }
            }
          } else {
            p.action_ = [];
          }
          //
          // 2.b Multi-insert
          //
          var patternArray = pattern.split("|");
          for (var j = 0; j < patternArray.length; j++) {
            if (stateArray[i] === '*') {
              // insert into all
              for (var t in transitions) {
                transitions[t].push({
                  pattern: patternArray[j],
                  task: p
                });
              }
            } else {
              transitions[stateArray[i]].push({
                pattern: patternArray[j],
                task: p
              });
            }
          }
        }
      }
    }
    return transitions;
  },
  stateMachines: {}
};

//
// Definition of state machines
//
mhchemParser.stateMachines = {
  //
  // \ce state machines
  //
  //#region ce
  'ce': {
    // main parser
    transitions: mhchemParser.createTransitions({
      'empty': {
        '*': {
          action_: 'output'
        }
      },
      'else': {
        '0|1|2': {
          action_: 'beginsWithBond=false',
          revisit: true,
          toContinue: true
        }
      },
      'oxidation$': {
        '0': {
          action_: 'oxidation-output'
        }
      },
      'CMT': {
        'r': {
          action_: 'rdt=',
          nextState: 'rt'
        },
        'rd': {
          action_: 'rqt=',
          nextState: 'rdt'
        }
      },
      'arrowUpDown': {
        '0|1|2|as': {
          action_: ['sb=false', 'output', 'operator'],
          nextState: '1'
        }
      },
      'uprightEntities': {
        '0|1|2': {
          action_: ['o=', 'output'],
          nextState: '1'
        }
      },
      'orbital': {
        '0|1|2|3': {
          action_: 'o=',
          nextState: 'o'
        }
      },
      '->': {
        '0|1|2|3': {
          action_: 'r=',
          nextState: 'r'
        },
        'a|as': {
          action_: ['output', 'r='],
          nextState: 'r'
        },
        '*': {
          action_: ['output', 'r='],
          nextState: 'r'
        }
      },
      '+': {
        'o': {
          action_: 'd= kv',
          nextState: 'd'
        },
        'd|D': {
          action_: 'd=',
          nextState: 'd'
        },
        'q': {
          action_: 'd=',
          nextState: 'qd'
        },
        'qd|qD': {
          action_: 'd=',
          nextState: 'qd'
        },
        'dq': {
          action_: ['output', 'd='],
          nextState: 'd'
        },
        '3': {
          action_: ['sb=false', 'output', 'operator'],
          nextState: '0'
        }
      },
      'amount': {
        '0|2': {
          action_: 'a=',
          nextState: 'a'
        }
      },
      'pm-operator': {
        '0|1|2|a|as': {
          action_: ['sb=false', 'output', {
            type_: 'operator',
            option: '\\pm'
          }],
          nextState: '0'
        }
      },
      'operator': {
        '0|1|2|a|as': {
          action_: ['sb=false', 'output', 'operator'],
          nextState: '0'
        }
      },
      '-$': {
        'o|q': {
          action_: ['charge or bond', 'output'],
          nextState: 'qd'
        },
        'd': {
          action_: 'd=',
          nextState: 'd'
        },
        'D': {
          action_: ['output', {
            type_: 'bond',
            option: "-"
          }],
          nextState: '3'
        },
        'q': {
          action_: 'd=',
          nextState: 'qd'
        },
        'qd': {
          action_: 'd=',
          nextState: 'qd'
        },
        'qD|dq': {
          action_: ['output', {
            type_: 'bond',
            option: "-"
          }],
          nextState: '3'
        }
      },
      '-9': {
        '3|o': {
          action_: ['output', {
            type_: 'insert',
            option: 'hyphen'
          }],
          nextState: '3'
        }
      },
      '- orbital overlap': {
        'o': {
          action_: ['output', {
            type_: 'insert',
            option: 'hyphen'
          }],
          nextState: '2'
        },
        'd': {
          action_: ['output', {
            type_: 'insert',
            option: 'hyphen'
          }],
          nextState: '2'
        }
      },
      '-': {
        '0|1|2': {
          action_: [{
            type_: 'output',
            option: 1
          }, 'beginsWithBond=true', {
            type_: 'bond',
            option: "-"
          }],
          nextState: '3'
        },
        '3': {
          action_: {
            type_: 'bond',
            option: "-"
          }
        },
        'a': {
          action_: ['output', {
            type_: 'insert',
            option: 'hyphen'
          }],
          nextState: '2'
        },
        'as': {
          action_: [{
            type_: 'output',
            option: 2
          }, {
            type_: 'bond',
            option: "-"
          }],
          nextState: '3'
        },
        'b': {
          action_: 'b='
        },
        'o': {
          action_: {
            type_: '- after o/d',
            option: false
          },
          nextState: '2'
        },
        'q': {
          action_: {
            type_: '- after o/d',
            option: false
          },
          nextState: '2'
        },
        'd|qd|dq': {
          action_: {
            type_: '- after o/d',
            option: true
          },
          nextState: '2'
        },
        'D|qD|p': {
          action_: ['output', {
            type_: 'bond',
            option: "-"
          }],
          nextState: '3'
        }
      },
      'amount2': {
        '1|3': {
          action_: 'a=',
          nextState: 'a'
        }
      },
      'letters': {
        '0|1|2|3|a|as|b|p|bp|o': {
          action_: 'o=',
          nextState: 'o'
        },
        'q|dq': {
          action_: ['output', 'o='],
          nextState: 'o'
        },
        'd|D|qd|qD': {
          action_: 'o after d',
          nextState: 'o'
        }
      },
      'digits': {
        'o': {
          action_: 'q=',
          nextState: 'q'
        },
        'd|D': {
          action_: 'q=',
          nextState: 'dq'
        },
        'q': {
          action_: ['output', 'o='],
          nextState: 'o'
        },
        'a': {
          action_: 'o=',
          nextState: 'o'
        }
      },
      'space A': {
        'b|p|bp': {}
      },
      'space': {
        'a': {
          nextState: 'as'
        },
        '0': {
          action_: 'sb=false'
        },
        '1|2': {
          action_: 'sb=true'
        },
        'r|rt|rd|rdt|rdq': {
          action_: 'output',
          nextState: '0'
        },
        '*': {
          action_: ['output', 'sb=true'],
          nextState: '1'
        }
      },
      '1st-level escape': {
        '1|2': {
          action_: ['output', {
            type_: 'insert+p1',
            option: '1st-level escape'
          }]
        },
        '*': {
          action_: ['output', {
            type_: 'insert+p1',
            option: '1st-level escape'
          }],
          nextState: '0'
        }
      },
      '[(...)]': {
        'r|rt': {
          action_: 'rd=',
          nextState: 'rd'
        },
        'rd|rdt': {
          action_: 'rq=',
          nextState: 'rdq'
        }
      },
      '...': {
        'o|d|D|dq|qd|qD': {
          action_: ['output', {
            type_: 'bond',
            option: "..."
          }],
          nextState: '3'
        },
        '*': {
          action_: [{
            type_: 'output',
            option: 1
          }, {
            type_: 'insert',
            option: 'ellipsis'
          }],
          nextState: '1'
        }
      },
      '. |* ': {
        '*': {
          action_: ['output', {
            type_: 'insert',
            option: 'addition compound'
          }],
          nextState: '1'
        }
      },
      'state of aggregation $': {
        '*': {
          action_: ['output', 'state of aggregation'],
          nextState: '1'
        }
      },
      '{[(': {
        'a|as|o': {
          action_: ['o=', 'output', 'parenthesisLevel++'],
          nextState: '2'
        },
        '0|1|2|3': {
          action_: ['o=', 'output', 'parenthesisLevel++'],
          nextState: '2'
        },
        '*': {
          action_: ['output', 'o=', 'output', 'parenthesisLevel++'],
          nextState: '2'
        }
      },
      ')]}': {
        '0|1|2|3|b|p|bp|o': {
          action_: ['o=', 'parenthesisLevel--'],
          nextState: 'o'
        },
        'a|as|d|D|q|qd|qD|dq': {
          action_: ['output', 'o=', 'parenthesisLevel--'],
          nextState: 'o'
        }
      },
      ', ': {
        '*': {
          action_: ['output', 'comma'],
          nextState: '0'
        }
      },
      '^_': {
        // ^ and _ without a sensible argument
        '*': {}
      },
      '^{(...)}|^($...$)': {
        '0|1|2|as': {
          action_: 'b=',
          nextState: 'b'
        },
        'p': {
          action_: 'b=',
          nextState: 'bp'
        },
        '3|o': {
          action_: 'd= kv',
          nextState: 'D'
        },
        'q': {
          action_: 'd=',
          nextState: 'qD'
        },
        'd|D|qd|qD|dq': {
          action_: ['output', 'd='],
          nextState: 'D'
        }
      },
      '^a|^\\x{}{}|^\\x{}|^\\x|\'': {
        '0|1|2|as': {
          action_: 'b=',
          nextState: 'b'
        },
        'p': {
          action_: 'b=',
          nextState: 'bp'
        },
        '3|o': {
          action_: 'd= kv',
          nextState: 'd'
        },
        'q': {
          action_: 'd=',
          nextState: 'qd'
        },
        'd|qd|D|qD': {
          action_: 'd='
        },
        'dq': {
          action_: ['output', 'd='],
          nextState: 'd'
        }
      },
      '_{(state of aggregation)}$': {
        'd|D|q|qd|qD|dq': {
          action_: ['output', 'q='],
          nextState: 'q'
        }
      },
      '_{(...)}|_($...$)|_9|_\\x{}{}|_\\x{}|_\\x': {
        '0|1|2|as': {
          action_: 'p=',
          nextState: 'p'
        },
        'b': {
          action_: 'p=',
          nextState: 'bp'
        },
        '3|o': {
          action_: 'q=',
          nextState: 'q'
        },
        'd|D': {
          action_: 'q=',
          nextState: 'dq'
        },
        'q|qd|qD|dq': {
          action_: ['output', 'q='],
          nextState: 'q'
        }
      },
      '=<>': {
        '0|1|2|3|a|as|o|q|d|D|qd|qD|dq': {
          action_: [{
            type_: 'output',
            option: 2
          }, 'bond'],
          nextState: '3'
        }
      },
      '#': {
        '0|1|2|3|a|as|o': {
          action_: [{
            type_: 'output',
            option: 2
          }, {
            type_: 'bond',
            option: "#"
          }],
          nextState: '3'
        }
      },
      '{}': {
        '*': {
          action_: {
            type_: 'output',
            option: 1
          },
          nextState: '1'
        }
      },
      '{...}': {
        '0|1|2|3|a|as|b|p|bp': {
          action_: 'o=',
          nextState: 'o'
        },
        'o|d|D|q|qd|qD|dq': {
          action_: ['output', 'o='],
          nextState: 'o'
        }
      },
      '$...$': {
        'a': {
          action_: 'a='
        },
        // 2$n$
        '0|1|2|3|as|b|p|bp|o': {
          action_: 'o=',
          nextState: 'o'
        },
        // not 'amount'
        'as|o': {
          action_: 'o='
        },
        'q|d|D|qd|qD|dq': {
          action_: ['output', 'o='],
          nextState: 'o'
        }
      },
      '\\bond{(...)}': {
        '*': {
          action_: [{
            type_: 'output',
            option: 2
          }, 'bond'],
          nextState: "3"
        }
      },
      '\\frac{(...)}': {
        '*': {
          action_: [{
            type_: 'output',
            option: 1
          }, 'frac-output'],
          nextState: '3'
        }
      },
      '\\overset{(...)}': {
        '*': {
          action_: [{
            type_: 'output',
            option: 2
          }, 'overset-output'],
          nextState: '3'
        }
      },
      '\\underset{(...)}': {
        '*': {
          action_: [{
            type_: 'output',
            option: 2
          }, 'underset-output'],
          nextState: '3'
        }
      },
      '\\underbrace{(...)}': {
        '*': {
          action_: [{
            type_: 'output',
            option: 2
          }, 'underbrace-output'],
          nextState: '3'
        }
      },
      '\\color{(...)}{(...)}1|\\color(...){(...)}2': {
        '*': {
          action_: [{
            type_: 'output',
            option: 2
          }, 'color-output'],
          nextState: '3'
        }
      },
      '\\color{(...)}0': {
        '*': {
          action_: [{
            type_: 'output',
            option: 2
          }, 'color0-output']
        }
      },
      '\\ce{(...)}': {
        '*': {
          action_: [{
            type_: 'output',
            option: 2
          }, 'ce'],
          nextState: '3'
        }
      },
      '\\,': {
        '*': {
          action_: [{
            type_: 'output',
            option: 1
          }, 'copy'],
          nextState: '1'
        }
      },
      '\\x{}{}|\\x{}|\\x': {
        '0|1|2|3|a|as|b|p|bp|o|c0': {
          action_: ['o=', 'output'],
          nextState: '3'
        },
        '*': {
          action_: ['output', 'o=', 'output'],
          nextState: '3'
        }
      },
      'others': {
        '*': {
          action_: [{
            type_: 'output',
            option: 1
          }, 'copy'],
          nextState: '3'
        }
      },
      'else2': {
        'a': {
          action_: 'a to o',
          nextState: 'o',
          revisit: true
        },
        'as': {
          action_: ['output', 'sb=true'],
          nextState: '1',
          revisit: true
        },
        'r|rt|rd|rdt|rdq': {
          action_: ['output'],
          nextState: '0',
          revisit: true
        },
        '*': {
          action_: ['output', 'copy'],
          nextState: '3'
        }
      }
    }),
    actions: {
      'o after d': function o_after_d(buffer, m) {
        var ret;
        if ((buffer.d || "").match(/^[0-9]+$/)) {
          var tmp = buffer.d;
          buffer.d = undefined;
          ret = this['output'](buffer);
          buffer.b = tmp;
        } else {
          ret = this['output'](buffer);
        }
        mhchemParser.actions['o='](buffer, m);
        return ret;
      },
      'd= kv': function d_kv(buffer, m) {
        buffer.d = m;
        buffer.dType = 'kv';
      },
      'charge or bond': function charge_or_bond(buffer, m) {
        if (buffer['beginsWithBond']) {
          /** @type {ParserOutput[]} */
          var ret = [];
          mhchemParser.concatArray(ret, this['output'](buffer));
          mhchemParser.concatArray(ret, mhchemParser.actions['bond'](buffer, m, "-"));
          return ret;
        } else {
          buffer.d = m;
        }
      },
      '- after o/d': function _after_o_d(buffer, m, isAfterD) {
        var c1 = mhchemParser.patterns.match_('orbital', buffer.o || "");
        var c2 = mhchemParser.patterns.match_('one lowercase greek letter $', buffer.o || "");
        var c3 = mhchemParser.patterns.match_('one lowercase latin letter $', buffer.o || "");
        var c4 = mhchemParser.patterns.match_('$one lowercase latin letter$ $', buffer.o || "");
        var hyphenFollows = m === "-" && (c1 && c1.remainder === "" || c2 || c3 || c4);
        if (hyphenFollows && !buffer.a && !buffer.b && !buffer.p && !buffer.d && !buffer.q && !c1 && c3) {
          buffer.o = '$' + buffer.o + '$';
        }
        /** @type {ParserOutput[]} */
        var ret = [];
        if (hyphenFollows) {
          mhchemParser.concatArray(ret, this['output'](buffer));
          ret.push({
            type_: 'hyphen'
          });
        } else {
          c1 = mhchemParser.patterns.match_('digits', buffer.d || "");
          if (isAfterD && c1 && c1.remainder === '') {
            mhchemParser.concatArray(ret, mhchemParser.actions['d='](buffer, m));
            mhchemParser.concatArray(ret, this['output'](buffer));
          } else {
            mhchemParser.concatArray(ret, this['output'](buffer));
            mhchemParser.concatArray(ret, mhchemParser.actions['bond'](buffer, m, "-"));
          }
        }
        return ret;
      },
      'a to o': function a_to_o(buffer) {
        buffer.o = buffer.a;
        buffer.a = undefined;
      },
      'sb=true': function sbTrue(buffer) {
        buffer.sb = true;
      },
      'sb=false': function sbFalse(buffer) {
        buffer.sb = false;
      },
      'beginsWithBond=true': function beginsWithBondTrue(buffer) {
        buffer['beginsWithBond'] = true;
      },
      'beginsWithBond=false': function beginsWithBondFalse(buffer) {
        buffer['beginsWithBond'] = false;
      },
      'parenthesisLevel++': function parenthesisLevel(buffer) {
        buffer['parenthesisLevel']++;
      },
      'parenthesisLevel--': function parenthesisLevel(buffer) {
        buffer['parenthesisLevel']--;
      },
      'state of aggregation': function state_of_aggregation(buffer, m) {
        return {
          type_: 'state of aggregation',
          p1: mhchemParser.go(m, 'o')
        };
      },
      'comma': function comma(buffer, m) {
        var a = m.replace(/\s*$/, '');
        var withSpace = a !== m;
        if (withSpace && buffer['parenthesisLevel'] === 0) {
          return {
            type_: 'comma enumeration L',
            p1: a
          };
        } else {
          return {
            type_: 'comma enumeration M',
            p1: a
          };
        }
      },
      'output': function output(buffer, m, entityFollows) {
        // entityFollows:
        //   undefined = if we have nothing else to output, also ignore the just read space (buffer.sb)
        //   1 = an entity follows, never omit the space if there was one just read before (can only apply to state 1)
        //   2 = 1 + the entity can have an amount, so output a\, instead of converting it to o (can only apply to states a|as)
        /** @type {ParserOutput | ParserOutput[]} */
        var ret;
        if (!buffer.r) {
          ret = [];
          if (!buffer.a && !buffer.b && !buffer.p && !buffer.o && !buffer.q && !buffer.d && !entityFollows) ; else {
            if (buffer.sb) {
              ret.push({
                type_: 'entitySkip'
              });
            }
            if (!buffer.o && !buffer.q && !buffer.d && !buffer.b && !buffer.p && entityFollows !== 2) {
              buffer.o = buffer.a;
              buffer.a = undefined;
            } else if (!buffer.o && !buffer.q && !buffer.d && (buffer.b || buffer.p)) {
              buffer.o = buffer.a;
              buffer.d = buffer.b;
              buffer.q = buffer.p;
              buffer.a = buffer.b = buffer.p = undefined;
            } else {
              if (buffer.o && buffer.dType === 'kv' && mhchemParser.patterns.match_('d-oxidation$', buffer.d || "")) {
                buffer.dType = 'oxidation';
              } else if (buffer.o && buffer.dType === 'kv' && !buffer.q) {
                buffer.dType = undefined;
              }
            }
            ret.push({
              type_: 'chemfive',
              a: mhchemParser.go(buffer.a, 'a'),
              b: mhchemParser.go(buffer.b, 'bd'),
              p: mhchemParser.go(buffer.p, 'pq'),
              o: mhchemParser.go(buffer.o, 'o'),
              q: mhchemParser.go(buffer.q, 'pq'),
              d: mhchemParser.go(buffer.d, buffer.dType === 'oxidation' ? 'oxidation' : 'bd'),
              dType: buffer.dType
            });
          }
        } else {
          // r
          /** @type {ParserOutput[]} */
          var rd;
          if (buffer.rdt === 'M') {
            rd = mhchemParser.go(buffer.rd, 'tex-math');
          } else if (buffer.rdt === 'T') {
            rd = [{
              type_: 'text',
              p1: buffer.rd || ""
            }];
          } else {
            rd = mhchemParser.go(buffer.rd);
          }
          /** @type {ParserOutput[]} */
          var rq;
          if (buffer.rqt === 'M') {
            rq = mhchemParser.go(buffer.rq, 'tex-math');
          } else if (buffer.rqt === 'T') {
            rq = [{
              type_: 'text',
              p1: buffer.rq || ""
            }];
          } else {
            rq = mhchemParser.go(buffer.rq);
          }
          ret = {
            type_: 'arrow',
            r: buffer.r,
            rd: rd,
            rq: rq
          };
        }
        for (var p in buffer) {
          if (p !== 'parenthesisLevel' && p !== 'beginsWithBond') {
            delete buffer[p];
          }
        }
        return ret;
      },
      'oxidation-output': function oxidationOutput(buffer, m) {
        var ret = ["{"];
        mhchemParser.concatArray(ret, mhchemParser.go(m, 'oxidation'));
        ret.push("}");
        return ret;
      },
      'frac-output': function fracOutput(buffer, m) {
        return {
          type_: 'frac-ce',
          p1: mhchemParser.go(m[0]),
          p2: mhchemParser.go(m[1])
        };
      },
      'overset-output': function oversetOutput(buffer, m) {
        return {
          type_: 'overset',
          p1: mhchemParser.go(m[0]),
          p2: mhchemParser.go(m[1])
        };
      },
      'underset-output': function undersetOutput(buffer, m) {
        return {
          type_: 'underset',
          p1: mhchemParser.go(m[0]),
          p2: mhchemParser.go(m[1])
        };
      },
      'underbrace-output': function underbraceOutput(buffer, m) {
        return {
          type_: 'underbrace',
          p1: mhchemParser.go(m[0]),
          p2: mhchemParser.go(m[1])
        };
      },
      'color-output': function colorOutput(buffer, m) {
        return {
          type_: 'color',
          color1: m[0],
          color2: mhchemParser.go(m[1])
        };
      },
      'r=': function r(buffer, m) {
        buffer.r = m;
      },
      'rdt=': function rdt(buffer, m) {
        buffer.rdt = m;
      },
      'rd=': function rd(buffer, m) {
        buffer.rd = m;
      },
      'rqt=': function rqt(buffer, m) {
        buffer.rqt = m;
      },
      'rq=': function rq(buffer, m) {
        buffer.rq = m;
      },
      'operator': function operator(buffer, m, p1) {
        return {
          type_: 'operator',
          kind_: p1 || m
        };
      }
    }
  },
  'a': {
    transitions: mhchemParser.createTransitions({
      'empty': {
        '*': {}
      },
      '1/2$': {
        '0': {
          action_: '1/2'
        }
      },
      'else': {
        '0': {
          nextState: '1',
          revisit: true
        }
      },
      '$(...)$': {
        '*': {
          action_: 'tex-math tight',
          nextState: '1'
        }
      },
      ',': {
        '*': {
          action_: {
            type_: 'insert',
            option: 'commaDecimal'
          }
        }
      },
      'else2': {
        '*': {
          action_: 'copy'
        }
      }
    }),
    actions: {}
  },
  'o': {
    transitions: mhchemParser.createTransitions({
      'empty': {
        '*': {}
      },
      '1/2$': {
        '0': {
          action_: '1/2'
        }
      },
      'else': {
        '0': {
          nextState: '1',
          revisit: true
        }
      },
      'letters': {
        '*': {
          action_: 'rm'
        }
      },
      '\\ca': {
        '*': {
          action_: {
            type_: 'insert',
            option: 'circa'
          }
        }
      },
      '\\x{}{}|\\x{}|\\x': {
        '*': {
          action_: 'copy'
        }
      },
      '${(...)}$|$(...)$': {
        '*': {
          action_: 'tex-math'
        }
      },
      '{(...)}': {
        '*': {
          action_: '{text}'
        }
      },
      'else2': {
        '*': {
          action_: 'copy'
        }
      }
    }),
    actions: {}
  },
  'text': {
    transitions: mhchemParser.createTransitions({
      'empty': {
        '*': {
          action_: 'output'
        }
      },
      '{...}': {
        '*': {
          action_: 'text='
        }
      },
      '${(...)}$|$(...)$': {
        '*': {
          action_: 'tex-math'
        }
      },
      '\\greek': {
        '*': {
          action_: ['output', 'rm']
        }
      },
      '\\,|\\x{}{}|\\x{}|\\x': {
        '*': {
          action_: ['output', 'copy']
        }
      },
      'else': {
        '*': {
          action_: 'text='
        }
      }
    }),
    actions: {
      'output': function output(buffer) {
        if (buffer.text_) {
          /** @type {ParserOutput} */
          var ret = {
            type_: 'text',
            p1: buffer.text_
          };
          for (var p in buffer) {
            delete buffer[p];
          }
          return ret;
        }
      }
    }
  },
  'pq': {
    transitions: mhchemParser.createTransitions({
      'empty': {
        '*': {}
      },
      'state of aggregation $': {
        '*': {
          action_: 'state of aggregation'
        }
      },
      'i$': {
        '0': {
          nextState: '!f',
          revisit: true
        }
      },
      '(KV letters),': {
        '0': {
          action_: 'rm',
          nextState: '0'
        }
      },
      'formula$': {
        '0': {
          nextState: 'f',
          revisit: true
        }
      },
      '1/2$': {
        '0': {
          action_: '1/2'
        }
      },
      'else': {
        '0': {
          nextState: '!f',
          revisit: true
        }
      },
      '${(...)}$|$(...)$': {
        '*': {
          action_: 'tex-math'
        }
      },
      '{(...)}': {
        '*': {
          action_: 'text'
        }
      },
      'a-z': {
        'f': {
          action_: 'tex-math'
        }
      },
      'letters': {
        '*': {
          action_: 'rm'
        }
      },
      '-9.,9': {
        '*': {
          action_: '9,9'
        }
      },
      ',': {
        '*': {
          action_: {
            type_: 'insert+p1',
            option: 'comma enumeration S'
          }
        }
      },
      '\\color{(...)}{(...)}1|\\color(...){(...)}2': {
        '*': {
          action_: 'color-output'
        }
      },
      '\\color{(...)}0': {
        '*': {
          action_: 'color0-output'
        }
      },
      '\\ce{(...)}': {
        '*': {
          action_: 'ce'
        }
      },
      '\\,|\\x{}{}|\\x{}|\\x': {
        '*': {
          action_: 'copy'
        }
      },
      'else2': {
        '*': {
          action_: 'copy'
        }
      }
    }),
    actions: {
      'state of aggregation': function state_of_aggregation(buffer, m) {
        return {
          type_: 'state of aggregation subscript',
          p1: mhchemParser.go(m, 'o')
        };
      },
      'color-output': function colorOutput(buffer, m) {
        return {
          type_: 'color',
          color1: m[0],
          color2: mhchemParser.go(m[1], 'pq')
        };
      }
    }
  },
  'bd': {
    transitions: mhchemParser.createTransitions({
      'empty': {
        '*': {}
      },
      'x$': {
        '0': {
          nextState: '!f',
          revisit: true
        }
      },
      'formula$': {
        '0': {
          nextState: 'f',
          revisit: true
        }
      },
      'else': {
        '0': {
          nextState: '!f',
          revisit: true
        }
      },
      '-9.,9 no missing 0': {
        '*': {
          action_: '9,9'
        }
      },
      '.': {
        '*': {
          action_: {
            type_: 'insert',
            option: 'electron dot'
          }
        }
      },
      'a-z': {
        'f': {
          action_: 'tex-math'
        }
      },
      'x': {
        '*': {
          action_: {
            type_: 'insert',
            option: 'KV x'
          }
        }
      },
      'letters': {
        '*': {
          action_: 'rm'
        }
      },
      '\'': {
        '*': {
          action_: {
            type_: 'insert',
            option: 'prime'
          }
        }
      },
      '${(...)}$|$(...)$': {
        '*': {
          action_: 'tex-math'
        }
      },
      '{(...)}': {
        '*': {
          action_: 'text'
        }
      },
      '\\color{(...)}{(...)}1|\\color(...){(...)}2': {
        '*': {
          action_: 'color-output'
        }
      },
      '\\color{(...)}0': {
        '*': {
          action_: 'color0-output'
        }
      },
      '\\ce{(...)}': {
        '*': {
          action_: 'ce'
        }
      },
      '\\,|\\x{}{}|\\x{}|\\x': {
        '*': {
          action_: 'copy'
        }
      },
      'else2': {
        '*': {
          action_: 'copy'
        }
      }
    }),
    actions: {
      'color-output': function colorOutput(buffer, m) {
        return {
          type_: 'color',
          color1: m[0],
          color2: mhchemParser.go(m[1], 'bd')
        };
      }
    }
  },
  'oxidation': {
    transitions: mhchemParser.createTransitions({
      'empty': {
        '*': {}
      },
      'roman numeral': {
        '*': {
          action_: 'roman-numeral'
        }
      },
      '${(...)}$|$(...)$': {
        '*': {
          action_: 'tex-math'
        }
      },
      'else': {
        '*': {
          action_: 'copy'
        }
      }
    }),
    actions: {
      'roman-numeral': function romanNumeral(buffer, m) {
        return {
          type_: 'roman numeral',
          p1: m || ""
        };
      }
    }
  },
  'tex-math': {
    transitions: mhchemParser.createTransitions({
      'empty': {
        '*': {
          action_: 'output'
        }
      },
      '\\ce{(...)}': {
        '*': {
          action_: ['output', 'ce']
        }
      },
      '{...}|\\,|\\x{}{}|\\x{}|\\x': {
        '*': {
          action_: 'o='
        }
      },
      'else': {
        '*': {
          action_: 'o='
        }
      }
    }),
    actions: {
      'output': function output(buffer) {
        if (buffer.o) {
          /** @type {ParserOutput} */
          var ret = {
            type_: 'tex-math',
            p1: buffer.o
          };
          for (var p in buffer) {
            delete buffer[p];
          }
          return ret;
        }
      }
    }
  },
  'tex-math tight': {
    transitions: mhchemParser.createTransitions({
      'empty': {
        '*': {
          action_: 'output'
        }
      },
      '\\ce{(...)}': {
        '*': {
          action_: ['output', 'ce']
        }
      },
      '{...}|\\,|\\x{}{}|\\x{}|\\x': {
        '*': {
          action_: 'o='
        }
      },
      '-|+': {
        '*': {
          action_: 'tight operator'
        }
      },
      'else': {
        '*': {
          action_: 'o='
        }
      }
    }),
    actions: {
      'tight operator': function tight_operator(buffer, m) {
        buffer.o = (buffer.o || "") + "{" + m + "}";
      },
      'output': function output(buffer) {
        if (buffer.o) {
          /** @type {ParserOutput} */
          var ret = {
            type_: 'tex-math',
            p1: buffer.o
          };
          for (var p in buffer) {
            delete buffer[p];
          }
          return ret;
        }
      }
    }
  },
  '9,9': {
    transitions: mhchemParser.createTransitions({
      'empty': {
        '*': {}
      },
      ',': {
        '*': {
          action_: 'comma'
        }
      },
      'else': {
        '*': {
          action_: 'copy'
        }
      }
    }),
    actions: {
      'comma': function comma() {
        return {
          type_: 'commaDecimal'
        };
      }
    }
  },
  //#endregion
  //
  // \pu state machines
  //
  //#region pu
  'pu': {
    transitions: mhchemParser.createTransitions({
      'empty': {
        '*': {
          action_: 'output'
        }
      },
      'space$': {
        '*': {
          action_: ['output', 'space']
        }
      },
      '{[(|)]}': {
        '0|a': {
          action_: 'copy'
        }
      },
      '(-)(9)^(-9)': {
        '0': {
          action_: 'number^',
          nextState: 'a'
        }
      },
      '(-)(9.,9)(e)(99)': {
        '0': {
          action_: 'enumber',
          nextState: 'a'
        }
      },
      'space': {
        '0|a': {}
      },
      'pm-operator': {
        '0|a': {
          action_: {
            type_: 'operator',
            option: '\\pm'
          },
          nextState: '0'
        }
      },
      'operator': {
        '0|a': {
          action_: 'copy',
          nextState: '0'
        }
      },
      '//': {
        'd': {
          action_: 'o=',
          nextState: '/'
        }
      },
      '/': {
        'd': {
          action_: 'o=',
          nextState: '/'
        }
      },
      '{...}|else': {
        '0|d': {
          action_: 'd=',
          nextState: 'd'
        },
        'a': {
          action_: ['space', 'd='],
          nextState: 'd'
        },
        '/|q': {
          action_: 'q=',
          nextState: 'q'
        }
      }
    }),
    actions: {
      'enumber': function enumber(buffer, m) {
        /** @type {ParserOutput[]} */
        var ret = [];
        if (m[0] === "+-" || m[0] === "+/-") {
          ret.push("\\pm ");
        } else if (m[0]) {
          ret.push(m[0]);
        }
        if (m[1]) {
          mhchemParser.concatArray(ret, mhchemParser.go(m[1], 'pu-9,9'));
          if (m[2]) {
            if (m[2].match(/[,.]/)) {
              mhchemParser.concatArray(ret, mhchemParser.go(m[2], 'pu-9,9'));
            } else {
              ret.push(m[2]);
            }
          }
          m[3] = m[4] || m[3];
          if (m[3]) {
            m[3] = m[3].trim();
            if (m[3] === "e" || m[3].substr(0, 1) === "*") {
              ret.push({
                type_: 'cdot'
              });
            } else {
              ret.push({
                type_: 'times'
              });
            }
          }
        }
        if (m[3]) {
          ret.push("10^{" + m[5] + "}");
        }
        return ret;
      },
      'number^': function number(buffer, m) {
        /** @type {ParserOutput[]} */
        var ret = [];
        if (m[0] === "+-" || m[0] === "+/-") {
          ret.push("\\pm ");
        } else if (m[0]) {
          ret.push(m[0]);
        }
        mhchemParser.concatArray(ret, mhchemParser.go(m[1], 'pu-9,9'));
        ret.push("^{" + m[2] + "}");
        return ret;
      },
      'operator': function operator(buffer, m, p1) {
        return {
          type_: 'operator',
          kind_: p1 || m
        };
      },
      'space': function space() {
        return {
          type_: 'pu-space-1'
        };
      },
      'output': function output(buffer) {
        /** @type {ParserOutput | ParserOutput[]} */
        var ret;
        var md = mhchemParser.patterns.match_('{(...)}', buffer.d || "");
        if (md && md.remainder === '') {
          buffer.d = md.match_;
        }
        var mq = mhchemParser.patterns.match_('{(...)}', buffer.q || "");
        if (mq && mq.remainder === '') {
          buffer.q = mq.match_;
        }
        if (buffer.d) {
          buffer.d = buffer.d.replace(/\u00B0C|\^oC|\^{o}C/g, "{}^{\\circ}C");
          buffer.d = buffer.d.replace(/\u00B0F|\^oF|\^{o}F/g, "{}^{\\circ}F");
        }
        if (buffer.q) {
          // fraction
          buffer.q = buffer.q.replace(/\u00B0C|\^oC|\^{o}C/g, "{}^{\\circ}C");
          buffer.q = buffer.q.replace(/\u00B0F|\^oF|\^{o}F/g, "{}^{\\circ}F");
          var b5 = {
            d: mhchemParser.go(buffer.d, 'pu'),
            q: mhchemParser.go(buffer.q, 'pu')
          };
          if (buffer.o === '//') {
            ret = {
              type_: 'pu-frac',
              p1: b5.d,
              p2: b5.q
            };
          } else {
            ret = b5.d;
            if (b5.d.length > 1 || b5.q.length > 1) {
              ret.push({
                type_: ' / '
              });
            } else {
              ret.push({
                type_: '/'
              });
            }
            mhchemParser.concatArray(ret, b5.q);
          }
        } else {
          // no fraction
          ret = mhchemParser.go(buffer.d, 'pu-2');
        }
        for (var p in buffer) {
          delete buffer[p];
        }
        return ret;
      }
    }
  },
  'pu-2': {
    transitions: mhchemParser.createTransitions({
      'empty': {
        '*': {
          action_: 'output'
        }
      },
      '*': {
        '*': {
          action_: ['output', 'cdot'],
          nextState: '0'
        }
      },
      '\\x': {
        '*': {
          action_: 'rm='
        }
      },
      'space': {
        '*': {
          action_: ['output', 'space'],
          nextState: '0'
        }
      },
      '^{(...)}|^(-1)': {
        '1': {
          action_: '^(-1)'
        }
      },
      '-9.,9': {
        '0': {
          action_: 'rm=',
          nextState: '0'
        },
        '1': {
          action_: '^(-1)',
          nextState: '0'
        }
      },
      '{...}|else': {
        '*': {
          action_: 'rm=',
          nextState: '1'
        }
      }
    }),
    actions: {
      'cdot': function cdot() {
        return {
          type_: 'tight cdot'
        };
      },
      '^(-1)': function _(buffer, m) {
        buffer.rm += "^{" + m + "}";
      },
      'space': function space() {
        return {
          type_: 'pu-space-2'
        };
      },
      'output': function output(buffer) {
        /** @type {ParserOutput | ParserOutput[]} */
        var ret = [];
        if (buffer.rm) {
          var mrm = mhchemParser.patterns.match_('{(...)}', buffer.rm || "");
          if (mrm && mrm.remainder === '') {
            ret = mhchemParser.go(mrm.match_, 'pu');
          } else {
            ret = {
              type_: 'rm',
              p1: buffer.rm
            };
          }
        }
        for (var p in buffer) {
          delete buffer[p];
        }
        return ret;
      }
    }
  },
  'pu-9,9': {
    transitions: mhchemParser.createTransitions({
      'empty': {
        '0': {
          action_: 'output-0'
        },
        'o': {
          action_: 'output-o'
        }
      },
      ',': {
        '0': {
          action_: ['output-0', 'comma'],
          nextState: 'o'
        }
      },
      '.': {
        '0': {
          action_: ['output-0', 'copy'],
          nextState: 'o'
        }
      },
      'else': {
        '*': {
          action_: 'text='
        }
      }
    }),
    actions: {
      'comma': function comma() {
        return {
          type_: 'commaDecimal'
        };
      },
      'output-0': function output0(buffer) {
        /** @type {ParserOutput[]} */
        var ret = [];
        buffer.text_ = buffer.text_ || "";
        if (buffer.text_.length > 4) {
          var a = buffer.text_.length % 3;
          if (a === 0) {
            a = 3;
          }
          for (var i = buffer.text_.length - 3; i > 0; i -= 3) {
            ret.push(buffer.text_.substr(i, 3));
            ret.push({
              type_: '1000 separator'
            });
          }
          ret.push(buffer.text_.substr(0, a));
          ret.reverse();
        } else {
          ret.push(buffer.text_);
        }
        for (var p in buffer) {
          delete buffer[p];
        }
        return ret;
      },
      'output-o': function outputO(buffer) {
        /** @type {ParserOutput[]} */
        var ret = [];
        buffer.text_ = buffer.text_ || "";
        if (buffer.text_.length > 4) {
          var a = buffer.text_.length - 3;
          for (var i = 0; i < a; i += 3) {
            ret.push(buffer.text_.substr(i, 3));
            ret.push({
              type_: '1000 separator'
            });
          }
          ret.push(buffer.text_.substr(i));
        } else {
          ret.push&I(buffer.text_);
        }
        for (var p in buffer) {
          delete buffer[p];
        }
        return ret;
      }
    }
  }
  //#endregion
};

//
// texify: Take MhchemParser output and convert it to TeX
//
/** @type {Texify} */
var texify = {
  go: function go(input, isInner) {
    // (recursive, max 4 levels)
    if (!input) {
      return "";
    }
    var res = "";
    var cee = false;
    for (var i = 0; i < input.length; i++) {
      var inputi = input[i];
      if (typeof inputi === "string") {
        res += inputi;
      } else {
        res += texify._go2(inputi);
        if (inputi.type_ === '1st-level escape') {
          cee = true;
        }
      }
    }
    if (!isInner && !cee && res) {
      res = "{" + res + "}";
    }
    return res;
  },
  _goInner: function _goInner(input) {
    if (!input) {
      return input;
    }
    return texify.go(input, true);
  },
  _go2: function _go2(buf) {
    /** @type {undefined | string} */
    var res;
    switch (buf.type_) {
      case 'chemfive':
        res = "";
        var b5 = {
          a: texify._goInner(buf.a),
          b: texify._goInner(buf.b),
          p: texify._goInner(buf.p),
          o: texify._goInner(buf.o),
          q: texify._goInner(buf.q),
          d: texify._goInner(buf.d)
        };
        //
        // a
        //
        if (b5.a) {
          if (b5.a.match(/^[+\-]/)) {
            b5.a = "{" + b5.a + "}";
          }
          res += b5.a + "\\,";
        }
        //
        // b and p
        //
        if (b5.b || b5.p) {
          res += "{\\vphantom{X}}";
          res += "^{\\hphantom{" + (b5.b || "") + "}}_{\\hphantom{" + (b5.p || "") + "}}";
          res += "{\\vphantom{X}}";
          res += "^{\\smash[t]{\\vphantom{2}}\\mathllap{" + (b5.b || "") + "}}";
          res += "_{\\vphantom{2}\\mathllap{\\smash[t]{" + (b5.p || "") + "}}}";
        }
        //
        // o
        //
        if (b5.o) {
          if (b5.o.match(/^[+\-]/)) {
            b5.o = "{" + b5.o + "}";
          }
          res += b5.o;
        }
        //
        // q and d
        //
        if (buf.dType === 'kv') {
          if (b5.d || b5.q) {
            res += "{\\vphantom{X}}";
          }
          if (b5.d) {
            res += "^{" + b5.d + "}";
          }
          if (b5.q) {
            res += "_{\\smash[t]{" + b5.q + "}}";
          }
        } else if (buf.dType === 'oxidation') {
          if (b5.d) {
            res += "{\\vphantom{X}}";
            res += "^{" + b5.d + "}";
          }
          if (b5.q) {
            res += "{\\vphantom{X}}";
            res += "_{\\smash[t]{" + b5.q + "}}";
          }
        } else {
          if (b5.q) {
            res += "{\\vphantom{X}}";
            res += "_{\\smash[t]{" + b5.q + "}}";
          }
          if (b5.d) {
            res += "{\\vphantom{X}}";
            res += "^{" + b5.d + "}";
          }
        }
        break;
      case 'rm':
        res = "\\mathrm{" + buf.p1 + "}";
        break;
      case 'text':
        if (buf.p1.match(/[\^_]/)) {
          buf.p1 = buf.p1.replace(" ", "~").replace("-", "\\text{-}");
          res = "\\mathrm{" + buf.p1 + "}";
        } else {
          res = "\\text{" + buf.p1 + "}";
        }
        break;
      case 'roman numeral':
        res = "\\mathrm{" + buf.p1 + "}";
        break;
      case 'state of aggregation':
        res = "\\mskip2mu " + texify._goInner(buf.p1);
        break;
      case 'state of aggregation subscript':
        res = "\\mskip1mu " + texify._goInner(buf.p1);
        break;
      case 'bond':
        res = texify._getBond(buf.kind_);
        if (!res) {
          throw ["MhchemErrorBond", "mhchem Error. Unknown bond type (" + buf.kind_ + ")"];
        }
        break;
      case 'frac':
        var c = "\\frac{" + buf.p1 + "}{" + buf.p2 + "}";
        res = "\\mathchoice{\\textstyle" + c + "}{" + c + "}{" + c + "}{" + c + "}";
        break;
      case 'pu-frac':
        var d = "\\frac{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
        res = "\\mathchoice{\\textstyle" + d + "}{" + d + "}{" + d + "}{" + d + "}";
        break;
      case 'tex-math':
        res = buf.p1 + " ";
        break;
      case 'frac-ce':
        res = "\\frac{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
        break;
      case 'overset':
        res = "\\overset{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
        break;
      case 'underset':
        res = "\\underset{" + texify._goInner(buf.p1) + "}{" + texify._goInner(buf.p2) + "}";
        break;
      case 'underbrace':
        res = "\\underbrace{" + texify._goInner(buf.p1) + "}_{" + texify._goInner(buf.p2) + "}";
        break;
      case 'color':
        res = "{\\color{" + buf.color1 + "}{" + texify._goInner(buf.color2) + "}}";
        break;
      case 'color0':
        res = "\\color{" + buf.color + "}";
        break;
      case 'arrow':
        var b6 = {
          rd: texify._goInner(buf.rd),
          rq: texify._goInner(buf.rq)
        };
        var arrow = "\\x" + texify._getArrow(buf.r);
        if (b6.rq) {
          arrow += "[{" + b6.rq + "}]";
        }
        if (b6.rd) {
          arrow += "{" + b6.rd + "}";
        } else {
          arrow += "{}";
        }
        res = arrow;
        break;
      case 'operator':
        res = texify._getOperator(buf.kind_);
        break;
      case '1st-level escape':
        res = buf.p1 + " "; // &, \\\\, \\hlin
        break;
      case 'space':
        res = " ";
        break;
      case 'entitySkip':
        res = "~";
        break;
      case 'pu-space-1':
        res = "~";
        break;
      case 'pu-space-2':
        res = "\\mkern3mu ";
        break;
      case '1000 separator':
        res = "\\mkern2mu ";
        break;
      case 'commaDecimal':
        res = "{,}";
        break;
      case 'comma enumeration L':
        res = "{" + buf.p1 + "}\\mkern6mu ";
        break;
      case 'comma enumeration M':
        res = "{" + buf.p1 + "}\\mkern3mu ";
        break;
      case 'comma enumeration S':
        res = "{" + buf.p1 + "}\\mkern1mu ";
        break;
      case 'hyphen':
        res = "\\text{-}";
        break;
      case 'addition compound':
        res = "\\,{\\cdot}\\,";
        break;
      case 'electron dot':
        res = "\\mkern1mu \\bullet\\mkern1mu ";
        break;
      case 'KV x':
        res = "{\\times}";
        break;
      case 'prime':
        res = "\\prime ";
        break;
      case 'cdot':
        res = "\\cdot ";
        break;
      case 'tight cdot':
        res = "\\mkern1mu{\\cdot}\\mkern1mu ";
        break;
      case 'times':
        res = "\\times ";
        break;
      case 'circa':
        res = "{\\sim}";
        break;
      case '^':
        res = "uparrow";
        break;
      case 'v':
        res = "downarrow";
        break;
      case 'ellipsis':
        res = "\\ldots ";
        break;
      case '/':
        res = "/";
        break;
      case ' / ':
        res = "\\,/\\,";
        break;
      default:
        throw ["MhchemBugT", "mhchem bug T. Please report."];
      // Missing texify rule or unknown MhchemParser output
    }
    return res;
  },
  _getArrow: function _getArrow(a) {
    switch (a) {
      case "->":
        return "rightarrow";
      case "\u2192":
        return "rightarrow";
      case "\u27F6":
        return "rightarrow";
      case "<-":
        return "leftarrow";
      case "<->":
        return "leftrightarrow";
      case "<-->":
        return "rightleftarrows";
      case "<=>":
        return "rightleftharpoons";
      case "\u21CC":
        return "rightleftharpoons";
      case "<=>>":
        return "rightequilibrium";
      case "<<=>":
        return "leftequilibrium";
      default:
        throw ["MhchemBugT", "mhchem bug T. Please report."];
    }
  },
  _getBond: function _getBond(a) {
    switch (a) {
      case "-":
        return "{-}";
      case "1":
        return "{-}";
      case "=":
        return "{=}";
      case "2":
        return "{=}";
      case "#":
        return "{\\equiv}";
      case "3":
        return "{\\equiv}";
      case "~":
        return "{\\tripledash}";
      case "~-":
        return "{\\mathrlap{\\raisebox{-.1em}{$-$}}\\raisebox{.1em}{$\\tripledash$}}";
      case "~=":
        return "{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$\\tripledash$}}-}";
      case "~--":
        return "{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$\\tripledash$}}-}";
      case "-~-":
        return "{\\mathrlap{\\raisebox{-.2em}{$-$}}\\mathrlap{\\raisebox{.2em}{$-$}}\\tripledash}";
      case "...":
        return "{{\\cdot}{\\cdot}{\\cdot}}";
      case "....":
        return "{{\\cdot}{\\cdot}{\\cdot}{\\cdot}}";
      case "->":
        return "{\\rightarrow}";
      case "<-":
        return "{\\leftarrow}";
      case "<":
        return "{<}";
      case ">":
        return "{>}";
      default:
        throw ["MhchemBugT", "mhchem bug T. Please report."];
    }
  },
  _getOperator: function _getOperator(a) {
    switch (a) {
      case "+":
        return " {}+{} ";
      case "-":
        return " {}-{} ";
      case "=":
        return " {}={} ";
      case "<":
        return " {}<{} ";
      case ">":
        return " {}>{} ";
      case "<<":
        return " {}\\ll{} ";
      case ">>":
        return " {}\\gg{} ";
      case "\\pm":
        return " {}\\pm{} ";
      case "\\approx":
        return " {}\\approx{} ";
      case "$\\approx$":
        return " {}\\approx{} ";
      case "v":
        return " \\downarrow{} ";
      case "(v)":
        return " \\downarrow{} ";
      case "^":
        return " \\uparrow{} ";
      case "(^)":
        return " \\uparrow{} ";
      default:
        throw ["MhchemBugT", "mhchem bug T. Please report."];
    }
  }
};
#/x_U(function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory(require("katex"));
	else if(typeof define === 'function' && define.amd)
		define(["katex"], factory);
	else {
		var a = typeof exports === 'object' ? factory(require("katex")) : factory(root["katex"]);
		for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
	}
})((typeof self !== 'undefined' ? self : this), function(__WEBPACK_EXTERNAL_MODULE__757__) {
return /******/ (function() { // webpackBootstrap
/******/ 	"use strict";
/******/ 	var __webpack_modules__ = ({

/***/ 757:
/***/ (function(module) {

module.exports = __WEBPACK_EXTERNAL_MODULE__757__;

/***/ })

/******/ 	});
/************************************************************************/
/******/ 	// The module cache
/******/ 	var __webpack_module_cache__ = {};
/******/ 	
/******/ 	// The require function
/******/ 	function __webpack_require__(moduleId) {
/******/ 		// Check if module is in cache
/******/ 		var cachedModule = __webpack_module_cache__[moduleId];
/******/ 		if (cachedModule !== undefined) {
/******/ 			return cachedModule.exports;
/******/ 		}
/******/ 		// Create a new module (and put it into the cache)
/******/ 		var module = __webpack_module_cache__[moduleId] = {
/******/ 			// no module.id needed
/******/ 			// no module.loaded needed
/******/ 			exports: {}
/******/ 		};
/******/ 	
/******/ 		// Execute the module function
/******/ 		__webpack_modules__[moduleId](module, module.exports, __webpack_require__);
/******/ 	
/******/ 		// Return the exports of the module
/******/ 		return module.exports;
/******/ 	}
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/compat get default export */
/******/ 	!function() {
/******/ 		// getDefaultExport function for compatibility with non-harmony modules
/******/ 		__webpack_require__.n = function(module) {
/******/ 			var getter = module && module.__esModule ?
/******/ 				function() { return module['default']; } :
/******/ 				function() { return module; };
/******/ 			__webpack_require__.d(getter, { a: getter });
/******/ 			return getter;
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": function() { return /* binding */ render_a11y_string; }
});

;// ./src/atoms.ts
/**
 * Small module for atom-group constants and type guard.  Kept separate from
 * `symbols.ts` so that consumers (notably `contrib/render-a11y-string`) can
 * pull in `isAtom` without dragging in the ~870-line symbol tables.
 */

// Some of these have a "-token" suffix since these are also used as `ParseNode`
// types for raw text tokens, and we want to avoid conflicts with higher-level
// `ParseNode` types. These `ParseNode`s are constructed within `Parser` by
// looking up the `symbols` map.
const ATOMS = {
  "bin": 1,
  "close": 1,
  "inner": 1,
  "open": 1,
  "punct": 1,
  "rel": 1
};
const NON_ATOMS = {
  "accent-token": 1,
  "mathord": 1,
  "op-token": 1,
  "spacing": 1,
  "textord": 1
};
function isAtom(value) {
  return value in ATOMS;
}
// EXTERNAL MODULE: external "katex"
var external_katex_ = __webpack_require__(757);
var external_katex_default = /*#__PURE__*/__webpack_require__.n(external_katex_);
;// ./contrib/render-a11y-string/render-a11y-string.ts
/**
 * renderA11yString returns a readable string.
 *
 * In some cases the string will have the proper semantic math
 * meaning,:
 *   renderA11yString("\\frac{1}{2}"")
 *   -> "start fraction, 1, divided by, 2, end fraction"
 *
 * However, other cases do not:
 *   renderA11yString("f(x) = x^2")
 *   -> "f, left parenthesis, x, right parenthesis, equals, x, squared"
 *
 * The commas in the string aim to increase ease of understanding
 * when read by a screenreader.
 */



const stringMap = {
  "(": "left parenthesis",
  ")": "right parenthesis",
  "[": "open bracket",
  "]": "close bracket",
  "\\{": "left brace",
  "\\}": "right brace",
  "\\lvert": "open vertical bar",
  "\\rvert": "close vertical bar",
  "|": "vertical bar",
  "\\uparrow": "up arrow",
  "\\Uparrow": "up arrow",
  "\\downarrow": "down arrow",
  "\\Downarrow": "down arrow",
  "\\updownarrow": "up down arrow",
  "\\leftarrow": "left arrow",
  "\\Leftarrow": "left arrow",
  "\\rightarrow": "right arrow",
  "\\Rightarrow": "right arrow",
  "\\langle": "open angle",
  "\\rangle": "close angle",
  "\\lfloor": "open floor",
  "\\rfloor": "close floor",
  "\\int": "integral",
  "\\intop": "integral",
  "\\lim": "limit",
  "\\ln": "natural log",
  "\\log": "log",
  "\\sin": "sine",
  "\\cos": "cosine",
  "\\tan": "tangent",
  "\\cot": "cotangent",
  "\\sum": "sum",
  "/": "slash",
  ",": "comma",
  ".": "point",
  "-": "negative",
  "+": "plus",
  "~": "tilde",
  ":": "colon",
  "?": "question mark",
  "'": "apostrophe",
  "\\%": "percent",
  " ": "space",
  "\\ ": "space",
  "\\$": "dollar sign",
  "\\angle": "angle",
  "\\degree": "degree",
  "\\circ": "circle",
  "\\vec": "vector",
  "\\triangle": "triangle",
  "\\pi": "pi",
  "\\prime": "prime",
  "\\infty": "infinity",
  "\\alpha": "alpha",
  "\\beta": "beta",
  "\\gamma": "gamma",
  "\\omega": "omega",
  "\\theta": "theta",
  "\\sigma": "sigma",
  "\\lambda": "lambda",
  "\\tau": "tau",
  "\\Delta": "delta",
  "\\delta": "delta",
  "\\mu": "mu",
  "\\rho": "rho",
  "\\nabla": "del",
  "\\ell": "ell",
  "\\ldots": "dots",
  // TODO: add entries for all accents
  "\\hat": "hat",
  "\\acute": "acute"
};
const powerMap = {
  "prime": "prime",
  "degree": "degrees",
  "circle": "degrees",
  "2": "squared",
  "3": "cubed"
};
const openMap = {
  "|": "open vertical bar",
  ".": ""
};
const closeMap = {
  "|": "close vertical bar",
  ".": ""
};
const binMap = {
  "+": "plus",
  "-": "minus",
  "\\pm": "plus minus",
  "\\cdot": "dot",
  "*": "times",
  "/": "divided by",
  "\\times": "times",
  "\\div": "divided by",
  "\\circ": "circle",
  "\\bullet": "bullet"
};
const relMap = {
  "=": "equals",
  "\\approx": "approximately equals",
  "≠": "does not equal",
  "\\geq": "is greater than or equal to",
  "\\ge": "is greater than or equal to",
  "\\leq": "is less than or equal to",
  "\\le": "is less than or equal to",
  ">": "is greater than",
  "<": "is less than",
  "\\leftarrow": "left arrow",
  "\\Leftarrow": "left arrow",
  "\\rightarrow": "right arrow",
  "\\Rightarrow": "right arrow",
  ":": "colon"
};
const accentUnderMap = {
  "\\underleftarrow": "left arrow",
  "\\underrightarrow": "right arrow",
  "\\underleftrightarrow": "left-right arrow",
  "\\undergroup": "group",
  "\\underlinesegment": "line segment",
  "\\utilde": "tilde"
};
const buildString = (str, type, a11yStrings) => {
  if (!str) {
    return;
  }
  let ret;
  if (type === "open") {
    ret = str in openMap ? openMap[str] : stringMap[str] || str;
  } else if (type === "close") {
    ret = str in closeMap ? closeMap[str] : stringMap[str] || str;
  } else if (type === "bin") {
    ret = binMap[str] || str;
  } else if (type === "rel") {
    ret = relMap[str] || str;
  } else {
    ret = stringMap[str] || str;
  }

  // If the text to add is a number and there is already a string
  // in the list and the last string is a number then we should
  // combine them into a single number
  const last = a11yStrings[a11yStrings.length - 1];
  if (/^\d+$/.test(ret) && a11yStrings.length > 0 && typeof last === "string" && /^\d+$/.test(last)) {
    a11yStrings[a11yStrings.length - 1] += ret;
  } else if (ret) {
    a11yStrings.push(ret);
  }
};
const buildRegion = (a11yStrings, callback) => {
  const regionStrings = [];
  a11yStrings.push(regionStrings);
  callback(regionStrings);
};
const handleObject = (tree, a11yStrings, atomType) => {
  // Everything else is assumed to be an object...
  switch (tree.type) {
    case "accent":
      {
        buildRegion(a11yStrings, a11yStrings => {
          buildA11yStrings(tree.base, a11yStrings, atomType);
          a11yStrings.push("with");
          buildString(tree.label, "normal", a11yStrings);
          a11yStrings.push("on top");
        });
        break;
      }
    case "accentUnder":
      {
        buildRegion(a11yStrings, a11yStrings => {
          buildA11yStrings(tree.base, a11yStrings, atomType);
          a11yStrings.push("with");
          buildString(accentUnderMap[tree.label], "normal", a11yStrings);
          a11yStrings.push("underneath");
        });
        break;
      }
    case "accent-token":
      {
        // Used internally by accent symbols.
        break;
      }
    case "atom":
      {
        const {
          text
        } = tree;
        switch (tree.family) {
          case "bin":
            {
              buildString(text, "bin", a11yStrings);
              break;
            }
          case "close":
            {
              buildString(text, "close", a11yStrings);
              break;
            }
          // TODO(kevinb): figure out what should be done for inner
          case "inner":
            {
              buildString(tree.text, "inner", a11yStrings);
              break;
            }
          case "open":
            {
              buildString(text, "open", a11yStrings);
              break;
            }
          case "punct":
            {
              buildString(text, "punct", a11yStrings);
              break;
            }
          case "rel":
            {
              buildString(text, "rel", a11yStrings);
              break;
            }
          default:
            {
              tree.family;
              throw new Error("\"" + tree.family + "\" is not a valid atom type");
            }
        }
        break;
      }
    case "color":
      {
        const color = tree.color.replace(/katex-/, "");
        buildRegion(a11yStrings, regionStrings => {
          regionStrings.push("start color " + color);
          buildA11yStrings(tree.body, regionStrings, atomType);
          regionStrings.push("end color " + color);
        });
        break;
      }
    case "color-token":
      {
        // Used by \color, \colorbox, and \fcolorbox but not directly rendered.
        // It's a leaf node and has no children so just break.
        break;
      }
    case "delimsizing":
      {
        if (tree.delim && tree.delim !== ".") {
          buildString(tree.delim, "normal", a11yStrings);
        }
        break;
      }
    case "genfrac":
      {
        buildRegion(a11yStrings, regionStrings => {
          // genfrac can have unbalanced delimiters
          const {
            leftDelim,
            rightDelim
          } = tree;

          // NOTE: Not sure if this is a safe assumption
          // hasBarLine true -> fraction, false -> binomial
          if (tree.hasBarLine) {
            regionStrings.push("start fraction");
            leftDelim && buildString(leftDelim, "open", regionStrings);
            buildA11yStrings(tree.numer, regionStrings, atomType);
            regionStrings.push("divided by");
            buildA11yStrings(tree.denom, regionStrings, atomType);
            rightDelim && buildString(rightDelim, "close", regionStrings);
            regionStrings.push("end fraction");
          } else {
            regionStrings.push("start binomial");
            leftDelim && buildString(leftDelim, "open", regionStrings);
            buildA11yStrings(tree.numer, regionStrings, atomType);
            regionStrings.push("over");
            buildA11yStrings(tree.denom, regionStrings, atomType);
            rightDelim && buildString(rightDelim, "close", regionStrings);
            regionStrings.push("end binomial");
          }
        });
        break;
      }
    case "hbox":
      {
        buildA11yStrings(tree.body, a11yStrings, atomType);
        break;
      }
    case "kern":
      {
        // No op: we don't attempt to present kerning information
        // to the screen reader.
        break;
      }
    case "leftright":
      {
        buildRegion(a11yStrings, regionStrings => {
          buildString(tree.left, "open", regionStrings);
          buildA11yStrings(tree.body, regionStrings, atomType);
          buildString(tree.right, "close", regionStrings);
        });
        break;
      }
    case "leftright-right":
      {
        // TODO: double check that this is a no-op
        break;
      }
    case "lap":
      {
        buildA11yStrings(tree.body, a11yStrings, atomType);
        break;
      }
    case "mathord":
      {
        buildString(tree.text, "normal", a11yStrings);
        break;
      }
    case "op":
      {
        const {
          body,
          name
        } = tree;
        if (body) {
          buildA11yStrings(body, a11yStrings, atomType);
        } else if (name) {
          buildString(name, "normal", a11yStrings);
        }
        break;
      }
    case "op-token":
      {
        // Used internally by operator symbols.
        buildString(tree.text, atomType, a11yStrings);
        break;
      }
    case "ordgroup":
      {
        buildA11yStrings(tree.body, a11yStrings, atomType);
        break;
      }
    case "overline":
      {
        buildRegion(a11yStrings, function (a11yStrings) {
          a11yStrings.push("start overline");
          buildA11yStrings(tree.body, a11yStrings, atomType);
          a11yStrings.push("end overline");
        });
        break;
      }
    case "pmb":
      {
        a11yStrings.push("bold");
        break;
      }
    case "phantom":
      {
        a11yStrings.push("empty space");
        break;
      }
    case "raisebox":
      {
        buildA11yStrings(tree.body, a11yStrings, atomType);
        break;
      }
    case "rule":
      {
        a11yStrings.push("rectangle");
        break;
      }
    case "sizing":
      {
        buildA11yStrings(tree.body, a11yStrings, atomType);
        break;
      }
    case "spacing":
      {
        a11yStrings.push("space");
        break;
      }
    case "styling":
      {
        // We ignore the styling and just pass through the contents
        buildA11yStrings(tree.body, a11yStrings, atomType);
        break;
      }
    case "sqrt":
      {
        buildRegion(a11yStrings, regionStrings => {
          const {
            body,
            index
          } = tree;
          if (index) {
            const indexString = flatten(buildA11yStrings(index, [], atomType)).join(",");
            if (indexString === "3") {
              regionStrings.push("cube root of");
              buildA11yStrings(body, regionStrings, atomType);
              regionStrings.push("end cube root");
              return;
            }
            regionStrings.push("root");
            regionStrings.push("start index");
            buildA11yStrings(index, regionStrings, atomType);
            regionStrings.push("end index");
            return;
          }
          regionStrings.push("square root of");
          buildA11yStrings(body, regionStrings, atomType);
          regionStrings.push("end square root");
        });
        break;
      }
    case "supsub":
      {
        const {
          base,
          sub,
          sup
        } = tree;
        let isLog = false;
        if (base) {
          buildA11yStrings(base, a11yStrings, atomType);
          isLog = base.type === "op" && base.name === "\\log";
        }
        if (sub) {
          const regionName = isLog ? "base" : "subscript";
          buildRegion(a11yStrings, function (regionStrings) {
            regionStrings.push("start " + regionName);
            buildA11yStrings(sub, regionStrings, atomType);
            regionStrings.push("end " + regionName);
          });
        }
        if (sup) {
          buildRegion(a11yStrings, function (regionStrings) {
            const supString = flatten(buildA11yStrings(sup, [], atomType)).join(",");
            if (supString in powerMap) {
              regionStrings.push(powerMap[supString]);
              return;
            }
            regionStrings.push("start superscript");
            buildA11yStrings(sup, regionStrings, atomType);
            regionStrings.push("end superscript");
          });
        }
        break;
      }
    case "text":
      {
        // TODO: handle other fonts
        if (tree.font === "\\textbf") {
          buildRegion(a11yStrings, function (regionStrings) {
            regionStrings.push("start bold text");
            buildA11yStrings(tree.body, regionStrings, atomType);
            regionStrings.push("end bold text");
          });
          break;
        }
        buildRegion(a11yStrings, function (regionStrings) {
          regionStrings.push("start text");
          buildA11yStrings(tree.body, regionStrings, atomType);
          regionStrings.push("end text");
        });
        break;
      }
    case "textord":
      {
        buildString(tree.text, atomType, a11yStrings);
        break;
      }
    case "smash":
      {
        buildA11yStrings(tree.body, a11yStrings, atomType);
        break;
      }
    case "enclose":
      {
        // TODO: create a map for these.
        // TODO: differentiate between a body with a single atom, e.g.
        // "cancel a" instead of "start cancel, a, end cancel"
        if (/cancel/.test(tree.label)) {
          buildRegion(a11yStrings, function (regionStrings) {
            regionStrings.push("start cancel");
            buildA11yStrings(tree.body, regionStrings, atomType);
            regionStrings.push("end cancel");
          });
          break;
        } else if (/box/.test(tree.label)) {
          buildRegion(a11yStrings, function (regionStrings) {
            regionStrings.push("start box");
            buildA11yStrings(tree.body, regionStrings, atomType);
            regionStrings.push("end box");
          });
          break;
        } else if (/sout/.test(tree.label)) {
          buildRegion(a11yStrings, function (regionStrings) {
            regionStrings.push("start strikeout");
            buildA11yStrings(tree.body, regionStrings, atomType);
            regionStrings.push("end strikeout");
          });
          break;
        } else if (/phase/.test(tree.label)) {
          buildRegion(a11yStrings, function (regionStrings) {
            regionStrings.push("start phase angle");
            buildA11yStrings(tree.body, regionStrings, atomType);
            regionStrings.push("end phase angle");
          });
          break;
        }
        throw new Error("KaTeX-a11y: enclose node with " + tree.label + " not supported yet");
      }
    case "vcenter":
      {
        buildA11yStrings(tree.body, a11yStrings, atomType);
        break;
      }
    case "vphantom":
      {
        throw new Error("KaTeX-a11y: vphantom not implemented yet");
      }
    case "operatorname":
      {
        buildA11yStrings(tree.body, a11yStrings, atomType);
        break;
      }
    case "array":
      {
        throw new Error("KaTeX-a11y: array not implemented yet");
      }
    case "raw":
      {
        throw new Error("KaTeX-a11y: raw not implemented yet");
      }
    case "size":
      {
        // Although there are nodes of type "size" in the parse tree, they have
        // no semantic meaning and should be ignored.
        break;
      }
    case "url":
      {
        throw new Error("KaTeX-a11y: url not implemented yet");
      }
    case "tag":
      {
        throw new Error("KaTeX-a11y: tag not implemented yet");
      }
    case "verb":
      {
        buildString("start verbatim", "normal", a11yStrings);
        buildString(tree.body, "normal", a11yStrings);
        buildString("end verbatim", "normal", a11yStrings);
        break;
      }
    case "environment":
      {
        throw new Error("KaTeX-a11y: environment not implemented yet");
      }
    case "horizBrace":
      {
        buildString("start " + tree.label.slice(1), "normal", a11yStrings);
        buildA11yStrings(tree.base, a11yStrings, atomType);
        buildString("end " + tree.label.slice(1), "normal", a11yStrings);
        break;
      }
    case "infix":
      {
        // All infix nodes are replace with other nodes.
        break;
      }
    case "includegraphics":
      {
        throw new Error("KaTeX-a11y: includegraphics not implemented yet");
      }
    case "font":
      {
        // TODO: callout the start/end of specific fonts
        // TODO: map \BBb{N} to "the naturals" or something like that
        buildA11yStrings(tree.body, a11yStrings, atomType);
        break;
      }
    case "href":
      {
        throw new Error("KaTeX-a11y: href not implemented yet");
      }
    case "cr":
      {
        // This is used by environments.
        throw new Error("KaTeX-a11y: cr not implemented yet");
      }
    case "underline":
      {
        buildRegion(a11yStrings, function (a11yStrings) {
          a11yStrings.push("start underline");
          buildA11yStrings(tree.body, a11yStrings, atomType);
          a11yStrings.push("end underline");
        });
        break;
      }
    case "xArrow":
      {
        throw new Error("KaTeX-a11y: xArrow not implemented yet");
      }
    case "cdlabel":
      {
        throw new Error("KaTeX-a11y: cdlabel not implemented yet");
      }
    case "cdlabelparent":
      {
        throw new Error("KaTeX-a11y: cdlabelparent not implemented yet");
      }
    case "mclass":
      {
        // \neq and \ne are macros so we let "htmlmathml" render the mathmal
        // side of things and extract the text from that.
        // mclass values are prefixed with "m" (e.g. "mrel" -> "rel")
        const atomType = tree.mclass.slice(1);
        if (atomType === "normal" || isAtom(atomType)) {
          buildA11yStrings(tree.body, a11yStrings, atomType);
        } else {
          throw new Error("Unexpected mclass atom type: \"" + atomType + "\"");
        }
        break;
      }
    case "mathchoice":
      {
        // TODO: track which style we're using, e.g. display, text, etc.
        // default to text style if even that may not be the correct style
        buildA11yStrings(tree.text, a11yStrings, atomType);
        break;
      }
    case "htmlmathml":
      {
        buildA11yStrings(tree.mathml, a11yStrings, atomType);
        break;
      }
    case "middle":
      {
        buildString(tree.delim, atomType, a11yStrings);
        break;
      }
    case "internal":
      {
        // internal nodes are never included in the parse tree
        break;
      }
    case "html":
      {
        buildA11yStrings(tree.body, a11yStrings, atomType);
        break;
      }
    default:
      throw new Error("KaTeX a11y un-recognized type: " + tree.type);
  }
};
const buildA11yStrings = function (tree, a11yStrings, atomType) {
  if (a11yStrings === void 0) {
    a11yStrings = [];
  }
  if (tree instanceof Array) {
    for (let i = 0; i < tree.length; i++) {
      buildA11yStrings(tree[i], a11yStrings, atomType);
    }
  } else {
    handleObject(tree, a11yStrings, atomType);
  }
  return a11yStrings;
};
const flatten = function (array) {
  let result = [];
  array.forEach(function (item) {
    if (Array.isArray(item)) {
      result = result.concat(flatten(item));
    } else {
      result.push(item);
    }
  });
  return result;
};
const renderA11yString = function (text, settings) {
  const tree = external_katex_default().__parse(text, settings);
  const a11yStrings = buildA11yStrings(tree, [], "normal");
  return flatten(a11yStrings).join(", ");
};
/* harmony default export */ var render_a11y_string = (renderA11yString);
__webpack_exports__ = __webpack_exports__["default"];
/******/ 	return __webpack_exports__;
/******/ })()
;
});\CEx^!!function(e,r){if("object"==typeof exports&&"object"==typeof module)module.exports=r(require("katex"));else if("function"==typeof define&&define.amd)define(["katex"],r);else{var t="object"==typeof exports?r(require("katex")):r(e.katex);for(var a in t)("object"==typeof exports?exports:e)[a]=t[a]}}("undefined"!=typeof self?self:this,function(e){return function(){"use strict";var r={757:function(r){r.exports=e}},t={};function a(e){var o=t[e];if(void 0!==o)return o.exports;var n=t[e]={exports:{}};return r[e](n,n.exports,a),n.exports}a.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(r,{a:r}),r},a.d=function(e,r){for(var t in r)a.o(r,t)&&!a.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},a.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)};var o={};a.d(o,{default:function(){return k}});const n={bin:1,close:1,inner:1,open:1,punct:1,rel:1};var s=a(757),l=a.n(s);const i={"(":"left parenthesis",")":"right parenthesis","[":"open bracket","]":"close bracket","\\{":"left brace","\\}":"right brace","\\lvert":"open vertical bar","\\rvert":"close vertical bar","|":"vertical bar","\\uparrow":"up arrow","\\Uparrow":"up arrow","\\downarrow":"down arrow","\\Downarrow":"down arrow","\\updownarrow":"up down arrow","\\leftarrow":"left arrow","\\Leftarrow":"left arrow","\\rightarrow":"right arrow","\\Rightarrow":"right arrow","\\langle":"open angle","\\rangle":"close angle","\\lfloor":"open floor","\\rfloor":"close floor","\\int":"integral","\\intop":"integral","\\lim":"limit","\\ln":"natural log","\\log":"log","\\sin":"sine","\\cos":"cosine","\\tan":"tangent","\\cot":"cotangent","\\sum":"sum","/":"slash",",":"comma",".":"point","-":"negative","+":"plus","~":"tilde",":":"colon","?":"question mark","'":"apostrophe","\\%":"percent"," ":"space","\\ ":"space","\\$":"dollar sign","\\angle":"angle","\\degree":"degree","\\circ":"circle","\\vec":"vector","\\triangle":"triangle","\\pi":"pi","\\prime":"prime","\\infty":"infinity","\\alpha":"alpha","\\beta":"beta","\\gamma":"gamma","\\omega":"omega","\\theta":"theta","\\sigma":"sigma","\\lambda":"lambda","\\tau":"tau","\\Delta":"delta","\\delta":"delta","\\mu":"mu","\\rho":"rho","\\nabla":"del","\\ell":"ell","\\ldots":"dots","\\hat":"hat","\\acute":"acute"},c={prime:"prime",degree:"degrees",circle:"degrees",2:"squared",3:"cubed"},u={"|":"open vertical bar",".":""},p={"|":"close vertical bar",".":""},d={"+":"plus","-":"minus","\\pm":"plus minus","\\cdot":"dot","*":"times","/":"divided by","\\times":"times","\\div":"divided by","\\circ":"circle","\\bullet":"bullet"},h={"=":"equals","\\approx":"approximately equals","\u2260":"does not equal","\\geq":"is greater than or equal to","\\ge":"is greater than or equal to","\\leq":"is less than or equal to","\\le":"is less than or equal to",">":"is greater than","<":"is less than","\\leftarrow":"left arrow","\\Leftarrow":"left arrow","\\rightarrow":"right arrow","\\Rightarrow":"right arrow",":":"colon"},b={"\\underleftarrow":"left arrow","\\underrightarrow":"right arrow","\\underleftrightarrow":"left-right arrow","\\undergroup":"group","\\underlinesegment":"line segment","\\utilde":"tilde"},m=(e,r,t)=>{if(!e)return;let a;a="open"===r?e in u?u[e]:i[e]||e:"close"===r?e in p?p[e]:i[e]||e:"bin"===r?d[e]||e:"rel"===r?h[e]||e:i[e]||e;const o=t[t.length-1];/^\d+$/.test(a)&&t.length>0&&"string"==typeof o&&/^\d+$/.test(o)?t[t.length-1]+=a:a&&t.push(a)},f=(e,r)=>{const t=[];e.push(t),r(t)},w=(e,r,t)=>{switch(e.type){case"accent":f(r,r=>{g(e.base,r,t),r.push("with"),m(e.label,"normal",r),r.push("on top")});break;case"accentUnder":f(r,r=>{g(e.base,r,t),r.push("with"),m(b[e.label],"normal",r),r.push("underneath")});break;case"accent-token":case"color-token":case"kern":case"leftright-right":case"size":case"infix":case"internal":break;case"atom":{const{text:t}=e;switch(e.family){case"bin":m(t,"bin",r);break;case"close":m(t,"close",r);break;case"inner":m(e.text,"inner",r);break;case"open":m(t,"open",r);break;case"punct":m(t,"punct",r);break;case"rel":m(t,"rel",r);break;default:throw e.family,new Error('"'+e.family+'" is not a valid atom type')}break}case"color":{const a=e.color.replace(/katex-/,"");f(r,r=>{r.push("start color "+a),g(e.body,r,t),r.push("end color "+a)});break}case"delimsizing":e.delim&&"."!==e.delim&&m(e.delim,"normal",r);break;case"genfrac":f(r,r=>{const{leftDelim:a,rightDelim:o}=e;e.hasBarLine?(r.push("start fraction"),a&&m(a,"open",r),g(e.numer,r,t),r.push("divided by"),g(e.denom,r,t),o&&m(o,"close",r),r.push("end fraction")):(r.push("start binomial"),a&&m(a,"open",r),g(e.numer,r,t),r.push("over"),g(e.denom,r,t),o&&m(o,"close",r),r.push("end binomial"))});break;case"hbox":case"lap":case"ordgroup":case"raisebox":case"sizing":case"styling":case"smash":case"vcenter":case"operatorname":case"font":case"html":g(e.body,r,t);break;case"leftright":f(r,r=>{m(e.left,"open",r),g(e.body,r,t),m(e.right,"close",r)});break;case"mathord":m(e.text,"normal",r);break;case"op":{const{body:a,name:o}=e;a?g(a,r,t):o&&m(o,"normal",r);break}case"op-token":case"textord":m(e.text,t,r);break;case"overline":f(r,function(r){r.push("start overline"),g(e.body,r,t),r.push("end overline")});break;case"pmb":r.push("bold");break;case"phantom":r.push("empty space");break;case"rule":r.push("rectangle");break;case"spacing":r.push("space");break;case"sqrt":f(r,r=>{const{body:a,index:o}=e;if(o){return"3"===y(g(o,[],t)).join(",")?(r.push("cube root of"),g(a,r,t),void r.push("end cube root")):(r.push("root"),r.push("start index"),g(o,r,t),void r.push("end index"))}r.push("square root of"),g(a,r,t),r.push("end square root")});break;case"supsub":{const{base:a,sub:o,sup:n}=e;let s=!1;if(a&&(g(a,r,t),s="op"===a.type&&"\\log"===a.name),o){const e=s?"base":"subscript";f(r,function(r){r.push("start "+e),g(o,r,t),r.push("end "+e)})}n&&f(r,function(e){const r=y(g(n,[],t)).join(",");r in c?e.push(c[r]):(e.push("start superscript"),g(n,e,t),e.push("end superscript"))});break}case"text":if("\\textbf"===e.font){f(r,function(r){r.push("start bold text"),g(e.body,r,t),r.push("end bold text")});break}f(r,function(r){r.push("start text"),g(e.body,r,t),r.push("end text")});break;case"enclose":if(/cancel/.test(e.label)){f(r,function(r){r.push("start cancel"),g(e.body,r,t),r.push("end cancel")});break}if(/box/.test(e.label)){f(r,function(r){r.push("start box"),g(e.body,r,t),r.push("end box")});break}if(/sout/.test(e.label)){f(r,function(r){r.push("start strikeout"),g(e.body,r,t),r.push("end strikeout")});break}if(/phase/.test(e.label)){f(r,function(r){r.push("start phase angle"),g(e.body,r,t),r.push("end phase angle")});break}throw new Error("KaTeX-a11y: enclose node with "+e.label+" not supported yet");case"vphantom":throw new Error("KaTeX-a11y: vphantom not implemented yet");case"array":throw new Error("KaTeX-a11y: array not implemented yet");case"raw":throw new Error("KaTeX-a11y: raw not implemented yet");case"url":throw new Error("KaTeX-a11y: url not implemented yet");case"tag":throw new Error("KaTeX-a11y: tag not implemented yet");case"verb":m("start verbatim","normal",r),m(e.body,"normal",r),m("end verbatim","normal",r);break;case"environment":throw new Error("KaTeX-a11y: environment not implemented yet");case"horizBrace":m("start "+e.label.slice(1),"normal",r),g(e.base,r,t),m("end "+e.label.slice(1),"normal",r);break;case"includegraphics":throw new Error("KaTeX-a11y: includegraphics not implemented yet");case"href":throw new Error("KaTeX-a11y: href not implemented yet");case"cr":throw new Error("KaTeX-a11y: cr not implemented yet");case"underline":f(r,function(r){r.push("start underline"),g(e.body,r,t),r.push("end underline")});break;case"xArrow":throw new Error("KaTeX-a11y: xArrow not implemented yet");case"cdlabel":throw new Error("KaTeX-a11y: cdlabel not implemented yet");case"cdlabelparent":throw new Error("KaTeX-a11y: cdlabelparent not implemented yet");case"mclass":{const t=e.mclass.slice(1);if("normal"!==t&&!(t in n))throw new Error('Unexpected mclass atom type: "'+t+'"');g(e.body,r,t);break}case"mathchoice":g(e.text,r,t);break;case"htmlmathml":g(e.mathml,r,t);break;case"middle":m(e.delim,t,r);break;default:throw new Error("KaTeX a11y un-recognized type: "+e.type)}},g=function(e,r,t){if(void 0===r&&(r=[]),e instanceof Array)for(let a=0;a<e.length;a++)g(e[a],r,t);else w(e,r,t);return r},y=function(e){let r=[];return e.forEach(function(e){Array.isArray(e)?r=r.concat(y(e)):r.push(e)}),r};var k=function(e,r){const t=l().__parse(e,r),a=g(t,[],"normal");return y(a).join(", ")};return o=o.default}()});1$O
xGQimport katex from '../katex.mjs';

/**
 * Small module for atom-group constants and type guard.  Kept separate from
 * `symbols.ts` so that consumers (notably `contrib/render-a11y-string`) can
 * pull in `isAtom` without dragging in the ~870-line symbol tables.
 */
// Some of these have a "-token" suffix since these are also used as `ParseNode`
// types for raw text tokens, and we want to avoid conflicts with higher-level
// `ParseNode` types. These `ParseNode`s are constructed within `Parser` by
// looking up the `symbols` map.
var ATOMS = {
  "bin": 1,
  "close": 1,
  "inner": 1,
  "open": 1,
  "punct": 1,
  "rel": 1
};
function isAtom(value) {
  return value in ATOMS;
}

/**
 * renderA11yString returns a readable string.
 *
 * In some cases the string will have the proper semantic math
 * meaning,:
 *   renderA11yString("\\frac{1}{2}"")
 *   -> "start fraction, 1, divided by, 2, end fraction"
 *
 * However, other cases do not:
 *   renderA11yString("f(x) = x^2")
 *   -> "f, left parenthesis, x, right parenthesis, equals, x, squared"
 *
 * The commas in the string aim to increase ease of understanding
 * when read by a screenreader.
 */
var stringMap = {
  "(": "left parenthesis",
  ")": "right parenthesis",
  "[": "open bracket",
  "]": "close bracket",
  "\\{": "left brace",
  "\\}": "right brace",
  "\\lvert": "open vertical bar",
  "\\rvert": "close vertical bar",
  "|": "vertical bar",
  "\\uparrow": "up arrow",
  "\\Uparrow": "up arrow",
  "\\downarrow": "down arrow",
  "\\Downarrow": "down arrow",
  "\\updownarrow": "up down arrow",
  "\\leftarrow": "left arrow",
  "\\Leftarrow": "left arrow",
  "\\rightarrow": "right arrow",
  "\\Rightarrow": "right arrow",
  "\\langle": "open angle",
  "\\rangle": "close angle",
  "\\lfloor": "open floor",
  "\\rfloor": "close floor",
  "\\int": "integral",
  "\\intop": "integral",
  "\\lim": "limit",
  "\\ln": "natural log",
  "\\log": "log",
  "\\sin": "sine",
  "\\cos": "cosine",
  "\\tan": "tangent",
  "\\cot": "cotangent",
  "\\sum": "sum",
  "/": "slash",
  ",": "comma",
  ".": "point",
  "-": "negative",
  "+": "plus",
  "~": "tilde",
  ":": "colon",
  "?": "question mark",
  "'": "apostrophe",
  "\\%": "percent",
  " ": "space",
  "\\ ": "space",
  "\\$": "dollar sign",
  "\\angle": "angle",
  "\\degree": "degree",
  "\\circ": "circle",
  "\\vec": "vector",
  "\\triangle": "triangle",
  "\\pi": "pi",
  "\\prime": "prime",
  "\\infty": "infinity",
  "\\alpha": "alpha",
  "\\beta": "beta",
  "\\gamma": "gamma",
  "\\omega": "omega",
  "\\theta": "theta",
  "\\sigma": "sigma",
  "\\lambda": "lambda",
  "\\tau": "tau",
  "\\Delta": "delta",
  "\\delta": "delta",
  "\\mu": "mu",
  "\\rho": "rho",
  "\\nabla": "del",
  "\\ell": "ell",
  "\\ldots": "dots",
  // TODO: add entries for all accents
  "\\hat": "hat",
  "\\acute": "acute"
};
var powerMap = {
  "prime": "prime",
  "degree": "degrees",
  "circle": "degrees",
  "2": "squared",
  "3": "cubed"
};
var openMap = {
  "|": "open vertical bar",
  ".": ""
};
var closeMap = {
  "|": "close vertical bar",
  ".": ""
};
var binMap = {
  "+": "plus",
  "-": "minus",
  "\\pm": "plus minus",
  "\\cdot": "dot",
  "*": "times",
  "/": "divided by",
  "\\times": "times",
  "\\div": "divided by",
  "\\circ": "circle",
  "\\bullet": "bullet"
};
var relMap = {
  "=": "equals",
  "\\approx": "approximately equals",
  "≠": "does not equal",
  "\\geq": "is greater than or equal to",
  "\\ge": "is greater than or equal to",
  "\\leq": "is less than or equal to",
  "\\le": "is less than or equal to",
  ">": "is greater than",
  "<": "is less than",
  "\\leftarrow": "left arrow",
  "\\Leftarrow": "left arrow",
  "\\rightarrow": "right arrow",
  "\\Rightarrow": "right arrow",
  ":": "colon"
};
var accentUnderMap = {
  "\\underleftarrow": "left arrow",
  "\\underrightarrow": "right arrow",
  "\\underleftrightarrow": "left-right arrow",
  "\\undergroup": "group",
  "\\underlinesegment": "line segment",
  "\\utilde": "tilde"
};
var buildString = (str, type, a11yStrings) => {
  if (!str) {
    return;
  }
  var ret;
  if (type === "open") {
    ret = str in openMap ? openMap[str] : stringMap[str] || str;
  } else if (type === "close") {
    ret = str in closeMap ? closeMap[str] : stringMap[str] || str;
  } else if (type === "bin") {
    ret = binMap[str] || str;
  } else if (type === "rel") {
    ret = relMap[str] || str;
  } else {
    ret = stringMap[str] || str;
  }
  // If the text to add is a number and there is already a string
  // in the list and the last string is a number then we should
  // combine them into a single number
  var last = a11yStrings[a11yStrings.length - 1];
  if (/^\d+$/.test(ret) && a11yStrings.length > 0 && typeof last === "string" && /^\d+$/.test(last)) {
    a11yStrings[a11yStrings.length - 1] += ret;
  } else if (ret) {
    a11yStrings.push(ret);
  }
};
var buildRegion = (a11yStrings, callback) => {
  var regionStrings = [];
  a11yStrings.push(regionStrings);
  callback(regionStrings);
};
var handleObject = (tree, a11yStrings, atomType) => {
  // Everything else is assumed to be an object...
  switch (tree.type) {
    case "accent":
      {
        buildRegion(a11yStrings, a11yStrings => {
          _buildA11yStrings(tree.base, a11yStrings, atomType);
          a11yStrings.push("with");
          buildString(tree.label, "normal", a11yStrings);
          a11yStrings.push("on top");
        });
        break;
      }
    case "accentUnder":
      {
        buildRegion(a11yStrings, a11yStrings => {
          _buildA11yStrings(tree.base, a11yStrings, atomType);
          a11yStrings.push("with");
          buildString(accentUnderMap[tree.label], "normal", a11yStrings);
          a11yStrings.push("underneath");
        });
        break;
      }
    case "accent-token":
      {
        // Used internally by accent symbols.
        break;
      }
    case "atom":
      {
        var {
          text
        } = tree;
        switch (tree.family) {
          case "bin":
            {
              buildString(text, "bin", a11yStrings);
              break;
            }
          case "close":
            {
              buildString(text, "close", a11yStrings);
              break;
            }
          // TODO(kevinb): figure out what should be done for inner
          case "inner":
            {
              buildString(tree.text, "inner", a11yStrings);
              break;
            }
          case "open":
            {
              buildString(text, "open", a11yStrings);
              break;
            }
          case "punct":
            {
              buildString(text, "punct", a11yStrings);
              break;
            }
          case "rel":
            {
              buildString(text, "rel", a11yStrings);
              break;
            }
          default:
            {
              tree.family;
              throw new Error("\"" + tree.family + "\" is not a valid atom type");
            }
        }
        break;
      }
    case "color":
      {
        var color = tree.color.replace(/katex-/, "");
        buildRegion(a11yStrings, regionStrings => {
          regionStrings.push("start color " + color);
          _buildA11yStrings(tree.body, regionStrings, atomType);
          regionStrings.push("end color " + color);
        });
        break;
      }
    case "color-token":
      {
        // Used by \color, \colorbox, and \fcolorbox but not directly rendered.
        // It's a leaf node and has no children so just break.
        break;
      }
    case "delimsizing":
      {
        if (tree.delim && tree.delim !== ".") {
          buildString(tree.delim, "normal", a11yStrings);
        }
        break;
      }
    case "genfrac":
      {
        buildRegion(a11yStrings, regionStrings => {
          // genfrac can have unbalanced delimiters
          var {
            leftDelim,
            rightDelim
          } = tree;
          // NOTE: Not sure if this is a safe assumption
          // hasBarLine true -> fraction, false -> binomial
          if (tree.hasBarLine) {
            regionStrings.push("start fraction");
            leftDelim && buildString(leftDelim, "open", regionStrings);
            _buildA11yStrings(tree.numer, regionStrings, atomType);
            regionStrings.push("divided by");
            _buildA11yStrings(tree.denom, regionStrings, atomType);
            rightDelim && buildString(rightDelim, "close", regionStrings);
            regionStrings.push("end fraction");
          } else {
            regionStrings.push("start binomial");
            leftDelim && buildString(leftDelim, "open", regionStrings);
            _buildA11yStrings(tree.numer, regionStrings, atomType);
            regionStrings.push("over");
            _buildA11yStrings(tree.denom, regionStrings, atomType);
            rightDelim && buildString(rightDelim, "close", regionStrings);
            regionStrings.push("end binomial");
          }
        });
        break;
      }
    case "hbox":
      {
        _buildA11yStrings(tree.body, a11yStrings, atomType);
        break;
      }
    case "kern":
      {
        // No op: we don't attempt to present kerning information
        // to the screen reader.
        break;
      }
    case "leftright":
      {
        buildRegion(a11yStrings, regionStrings => {
          buildString(tree.left, "open", regionStrings);
          _buildA11yStrings(tree.body, regionStrings, atomType);
          buildString(tree.right, "close", regionStrings);
        });
        break;
      }
    case "leftright-right":
      {
        // TODO: double check that this is a no-op
        break;
      }
    case "lap":
      {
        _buildA11yStrings(tree.body, a11yStrings, atomType);
        break;
      }
    case "mathord":
      {
        buildString(tree.text, "normal", a11yStrings);
        break;
      }
    case "op":
      {
        var {
          body,
          name
        } = tree;
        if (body) {
          _buildA11yStrings(body, a11yStrings, atomType);
        } else if (name) {
          buildString(name, "normal", a11yStrings);
        }
        break;
      }
    case "op-token":
      {
        // Used internally by operator symbols.
        buildString(tree.text, atomType, a11yStrings);
        break;
      }
    case "ordgroup":
      {
        _buildA11yStrings(tree.body, a11yStrings, atomType);
        break;
      }
    case "overline":
      {
        buildRegion(a11yStrings, function (a11yStrings) {
          a11yStrings.push("start overline");
          _buildA11yStrings(tree.body, a11yStrings, atomType);
          a11yStrings.push("end overline");
        });
        break;
      }
    case "pmb":
      {
        a11yStrings.push("bold");
        break;
      }
    case "phantom":
      {
        a11yStrings.push("empty space");
        break;
      }
    case "raisebox":
      {
        _buildA11yStrings(tree.body, a11yStrings, atomType);
        break;
      }
    case "rule":
      {
        a11yStrings.push("rectangle");
        break;
      }
    case "sizing":
      {
        _buildA11yStrings(tree.body, a11yStrings, atomType);
        break;
      }
    case "spacing":
      {
        a11yStrings.push("space");
        break;
      }
    case "styling":
      {
        // We ignore the styling and just pass through the contents
        _buildA11yStrings(tree.body, a11yStrings, atomType);
        break;
      }
    case "sqrt":
      {
        buildRegion(a11yStrings, regionStrings => {
          var {
            body,
            index
          } = tree;
          if (index) {
            var indexString = _flatten(_buildA11yStrings(index, [], atomType)).join(",");
            if (indexString === "3") {
              regionStrings.push("cube root of");
              _buildA11yStrings(body, regionStrings, atomType);
              regionStrings.push("end cube root");
              return;
            }
            regionStrings.push("root");
            regionStrings.push("start index");
            _buildA11yStrings(index, regionStrings, atomType);
            regionStrings.push("end index");
            return;
          }
          regionStrings.push("square root of");
          _buildA11yStrings(body, regionStrings, atomType);
          regionStrings.push("end square root");
        });
        break;
      }
    case "supsub":
      {
        var {
          base,
          sub,
          sup
        } = tree;
        var isLog = false;
        if (base) {
          _buildA11yStrings(base, a11yStrings, atomType);
          isLog = base.type === "op" && base.name === "\\log";
        }
        if (sub) {
          var regionName = isLog ? "base" : "subscript";
          buildRegion(a11yStrings, function (regionStrings) {
            regionStrings.push("start " + regionName);
            _buildA11yStrings(sub, regionStrings, atomType);
            regionStrings.push("end " + regionName);
          });
        }
        if (sup) {
          buildRegion(a11yStrings, function (regionStrings) {
            var supString = _flatten(_buildA11yStrings(sup, [], atomType)).join(",");
            if (supString in powerMap) {
              regionStrings.push(powerMap[supString]);
              return;
            }
            regionStrings.push("start superscript");
            _buildA11yStrings(sup, regionStrings, atomType);
            regionStrings.push("end superscript");
          });
        }
        break;
      }
    case "text":
      {
        // TODO: handle other fonts
        if (tree.font === "\\textbf") {
          buildRegion(a11yStrings, function (regionStrings) {
            regionStrings.push("start bold text");
            _buildA11yStrings(tree.body, regionStrings, atomType);
            regionStrings.push("end bold text");
          });
          break;
        }
        buildRegion(a11yStrings, function (regionStrings) {
          regionStrings.push("start text");
          _buildA11yStrings(tree.body, regionStrings, atomType);
          regionStrings.push("end text");
        });
        break;
      }
    case "textord":
      {
        buildString(tree.text, atomType, a11yStrings);
        break;
      }
    case "smash":
      {
        _buildA11yStrings(tree.body, a11yStrings, atomType);
        break;
      }
    case "enclose":
      {
        // TODO: create a map for these.
        // TODO: differentiate between a body with a single atom, e.g.
        // "cancel a" instead of "start cancel, a, end cancel"
        if (/cancel/.test(tree.label)) {
          buildRegion(a11yStrings, function (regionStrings) {
            regionStrings.push("start cancel");
            _buildA11yStrings(tree.body, regionStrings, atomType);
            regionStrings.push("end cancel");
          });
          break;
        } else if (/box/.test(tree.label)) {
          buildRegion(a11yStrings, function (regionStrings) {
            regionStrings.push("start box");
            _buildA11yStrings(tree.body, regionStrings, atomType);
            regionStrings.push("end box");
          });
          break;
        } else if (/sout/.test(tree.label)) {
          buildRegion(a11yStrings, function (regionStrings) {
            regionStrings.push("start strikeout");
            _buildA11yStrings(tree.body, regionStrings, atomType);
            regionStrings.push("end strikeout");
          });
          break;
        } else if (/phase/.test(tree.label)) {
          buildRegion(a11yStrings, function (regionStrings) {
            regionStrings.push("start phase angle");
            _buildA11yStrings(tree.body, regionStrings, atomType);
            regionStrings.push("end phase angle");
          });
          break;
        }
        throw new Error("KaTeX-a11y: enclose node with " + tree.label + " not supported yet");
      }
    case "vcenter":
      {
        _buildA11yStrings(tree.body, a11yStrings, atomType);
        break;
      }
    case "vphantom":
      {
        throw new Error("KaTeX-a11y: vphantom not implemented yet");
      }
    case "operatorname":
      {
        _buildA11yStrings(tree.body, a11yStrings, atomType);
        break;
      }
    case "array":
      {
        throw new Error("KaTeX-a11y: array not implemented yet");
      }
    case "raw":
      {
        throw new Error("KaTeX-a11y: raw not implemented yet");
      }
    case "size":
      {
        // Although there are nodes of type "size" in the parse tree, they have
        // no semantic meaning and should be ignored.
        break;
      }
    case "url":
      {
        throw new Error("KaTeX-a11y: url not implemented yet");
      }
    case "tag":
      {
        throw new Error("KaTeX-a11y: tag not implemented yet");
      }
    case "verb":
      {
        buildString("start verbatim", "normal", a11yStrings);
        buildString(tree.body, "normal", a11yStrings);
        buildString("end verbatim", "normal", a11yStrings);
        break;
      }
    case "environment":
      {
        throw new Error("KaTeX-a11y: environment not implemented yet");
      }
    case "horizBrace":
      {
        buildString("start " + tree.label.slice(1), "normal", a11yStrings);
        _buildA11yStrings(tree.base, a11yStrings, atomType);
        buildString("end " + tree.label.slice(1), "normal", a11yStrings);
        break;
      }
    case "infix":
      {
        // All infix nodes are replace with other nodes.
        break;
      }
    case "includegraphics":
      {
        throw new Error("KaTeX-a11y: includegraphics not implemented yet");
      }
    case "font":
      {
        // TODO: callout the start/end of specific fonts
        // TODO: map \BBb{N} to "the naturals" or something like that
        _buildA11yStrings(tree.body, a11yStrings, atomType);
        break;
      }
    case "href":
      {
        throw new Error("KaTeX-a11y: href not implemented yet");
      }
    case "cr":
      {
        // This is used by environments.
        throw new Error("KaTeX-a11y: cr not implemented yet");
      }
    case "underline":
      {
        buildRegion(a11yStrings, function (a11yStrings) {
          a11yStrings.push("start underline");
          _buildA11yStrings(tree.body, a11yStrings, atomType);
          a11yStrings.push("end underline");
        });
        break;
      }
    case "xArrow":
      {
        throw new Error("KaTeX-a11y: xArrow not implemented yet");
      }
    case "cdlabel":
      {
        throw new Error("KaTeX-a11y: cdlabel not implemented yet");
      }
    case "cdlabelparent":
      {
        throw new Error("KaTeX-a11y: cdlabelparent not implemented yet");
      }
    case "mclass":
      {
        // \neq and \ne are macros so we let "htmlmathml" render the mathmal
        // side of things and extract the text from that.
        // mclass values are prefixed with "m" (e.g. "mrel" -> "rel")
        var _atomType = tree.mclass.slice(1);
        if (_atomType === "normal" || isAtom(_atomType)) {
          _buildA11yStrings(tree.body, a11yStrings, _atomType);
        } else {
          throw new Error("Unexpected mclass atom type: \"" + _atomType + "\"");
        }
        break;
      }
    case "mathchoice":
      {
        // TODO: track which style we're using, e.g. display, text, etc.
        // default to text style if even that may not be the correct style
        _buildA11yStrings(tree.text, a11yStrings, atomType);
        break;
      }
    case "htmlmathml":
      {
        _buildA11yStrings(tree.mathml, a11yStrings, atomType);
        break;
      }
    case "middle":
      {
        buildString(tree.delim, atomType, a11yStrings);
        break;
      }
    case "internal":
      {
        // internal nodes are never included in the parse tree
        break;
      }
    case "html":
      {
        _buildA11yStrings(tree.body, a11yStrings, atomType);
        break;
      }
    default:
      throw new Error("KaTeX a11y un-recognized type: " + tree.type);
  }
};
var _buildA11yStrings = function buildA11yStrings(tree, a11yStrings, atomType) {
  if (a11yStrings === void 0) {
    a11yStrings = [];
  }
  if (tree instanceof Array) {
    for (var i = 0; i < tree.length; i++) {
      _buildA11yStrings(tree[i], a11yStrings, atomType);
    }
  } else {
    handleObject(tree, a11yStrings, atomType);
  }
  return a11yStrings;
};
var _flatten = function flatten(array) {
  var result = [];
  array.forEach(function (item) {
    if (Array.isArray(item)) {
      result = result.concat(_flatten(item));
    } else {
      result.push(item);
    }
  });
  return result;
};
var renderA11yString = function renderA11yString(text, settings) {
  var tree = katex.__parse(text, settings);
  var a11yStrings = _buildA11yStrings(tree, [], "normal");
  return _flatten(a11yStrings).join(", ");
};

export { renderA11yString as default };
-pWxc100644 KaTeX_AMS-Regular.ttf ?dǴw:7100644 KaTeX_AMS-Regular.woff ׳:?X}-U jg>100644 KaTeX_AMS-Regular.woff2 
ʯ=K`m*z8i100644 KaTeX_Caligraphic-Bold.ttf D!t'5N*N~100644 KaTeX_Caligraphic-Bold.woff Yq>-VsG100644 KaTeX_Caligraphic-Bold.woff2 .߸=-100644 KaTeX_Caligraphic-Regular.ttf ")O-nϪ100644 KaTeX_Caligraphic-Regular.woff SOҾx!?fw100644 KaTeX_Caligraphic-Regular.woff2 u4J~,ceL:/100644 KaTeX_Fraktur-Bold.ttf N%;TmhKEz100644 KaTeX_Fraktur-Bold.woff sf'\&S&L100644 KaTeX_Fraktur-Bold.woff2 9_(#ǰ%=Ӽ100644 KaTeX_Fraktur-Regular.ttf F'_v񪦖100644 KaTeX_Fraktur-Regular.woff cj100644 KaTeX_Fraktur-Regular.woff2 s_iH<#75<100644 KaTeX_Main-Bold.ttf @`'4T&?s"җ100644 KaTeX_Main-Bold.woff 6ܝRFv100644 KaTeX_Main-Bold.woff2 *q@Mh100644 KaTeX_Main-BoldItalic.ttf  ywp#mqWz100644 KaTeX_Main-BoldItalic.woff g{g2qw?S100644 KaTeX_Main-BoldItalic.woff2 Y1yM䢤p	eYvC100644 KaTeX_Main-Italic.ttf 5J` +UCY̍f100644 KaTeX_Main-Italic.woff oCc; 1dd100644 KaTeX_Main-Italic.woff2 	 88]Y100644 KaTeX_Main-Regular.ttf E.,QmHˋ100644 KaTeX_Main-Regular.woff !)h#c k8100644 KaTeX_Main-Regular.woff2 $(+0lc}6100644 KaTeX_Math-BoldItalic.ttf rh,:l&-*100644 KaTeX_Math-BoldItalic.woff 
Lf\T9]Q4D100644 KaTeX_Math-BoldItalic.woff2 )ep#V$btlFP100644 KaTeX_Math-Italic.ttf pY7^TL<Xo100644 KaTeX_Math-Italic.woff QYʃ#i'100644 KaTeX_Math-Italic.woff2 !\?׀Z\+"+׉*+	a  100644 KaTeX_SansSerif-Bold.ttf /eb&|g/'100644 KaTeX_SansSerif-Bold.woff G-K*Vl+/5100644 KaTeX_SansSerif-Bold.woff2 Ϫ;Y$kIBGm f100644 KaTeX_SansSerif-Italic.ttf Յ.q100644 KaTeX_SansSerif-Italic.woff ~ߖ6!mS.`100644 KaTeX_SansSerif-Italic.woff2 4`c[ȳdӼ>0100644 KaTeX_SansSerif-Regular.ttf Sry!2P`GՎ100644 KaTeX_SansSerif-Regular.woff 1H).H-!100644 KaTeX_SansSerif-Regular.woff2 i]@DGش100644 KaTeX_Script-Regular.ttf gtr򡃹{@^100644 KaTeX_Script-Regular.woff }!l,EW:100644 KaTeX_Script-Regular.woff2 hYڣ100644 KaTeX_Size1-Regular.ttf ѝXM,m100644 KaTeX_Size1-Regular.woff )-O%pTwD=W100644 KaTeX_Size1-Regular.woff2 ŨF/Ú|W% 100644 KaTeX_Size2-Regular.ttf z!, ~o-b+100644 KaTeX_Size2-Regular.woff Aپ-1{9ljΠ100644 KaTeX_Size2-Regular.woff2 @:Npiz[ټN100644 KaTeX_Size3-Regular.ttf  I_6֡100644 KaTeX_Size3-Regular.woff X+k1$D]O100644 KaTeX_Size3-Regular.woff2 $(f"zؽrfjI100644 KaTeX_Size4-Regular.ttf t!qBr8100644 KaTeX_Size4-Regular.woff TWfOCm@K100644 KaTeX_Size4-Regular.woff2 hPvŧ敓^ݶ_100644 KaTeX_Typewriter-Regular.ttf 2RqLqbXs9100644 KaTeX_Typewriter-Regular.woff $2A(jS*s-~jfH100644 KaTeX_Typewriter-Regular.woff2 wxovOmxo       `OS/2FJ-  \   `cmapļ  ؼ  Tcvt      0fpgmb.{    gasp        glyfdٻ     head_"C     6hheaG  8   $hmtx#2  <  locaq=    
maxp      name]|    ppostP  d  	!prepeD       2       33'3#2d222     ; Q Z d @
^[SRJ>02+%#"'&76326636754''#"'&&76767677632'3254'.''#"3&54#}
		
GF-z%k#VK 9b
	X(!#N+	$;:h.]%hEV(    	  l @ Z g {   @ukd_RI2+632"'&54722636767<6<&445&&'"#""&#&543&'&767#4&'&#"32674'&#"7636764&'&#'766254'&##
f";)4G
nY(	mm(%'OFy(#	E$'L=/-=SGC
C#/+KK3	<O 6BSLSB7 



.7I
|{@Pk+WQ)5<L-cY6Haw	  & A U \ 
\VMC2+327667632#"'&&'&547676326323265462"&&'&&'&#"76#"3&'&5476%#'=p!	.iNARjWT8?/%	X4(!.A2`'U:)	'W Z#-b\
RS	+Y	kP-PJUنY3!      l    @
{oJ2+6;8233#"&'&547363667<6<&445&&'"#'&5467#"33&'&4&'&##"32766654&'&'yvHW_Gj:&	9999!NQ
'/@.)+3\P	SKWbD
!6BSLSB7!
6		

y55 '$Md 
Z     p     @~r.2+%! '"15&5472263667446<&45&&'""&#&5476 "&54'&&'&#"36765432#"4&'&##327667676324##325&'&765#573
  
(S=4)h&I-4+V	
m5555I9
/
H
 7BSLSC6!UE	
.C	xwG 		,1 
,!$		(0T	&    G c }   @
~qe:2+%"54&##22#"&'&5472263667446<&45&&'""&#&5476 "&54'&&'&#"3667476324##3&'&66767655#5M@	5'
  
M41)BD
55i:6;< 7BSLSC6!UE	(:xw@@		

1+/Q	  & S c j } @
xmjd`WB2+25462#"'&'&#"32765&'&'&&547326:33#"#"'&&'&5476732476#"4'&#'276775776761#I$[=8T _;
	%0*/&		.sNBRjWZ0&."V\Q
HJ(
RSP=(!@TK>4
?AB	8 Z#-ba	eQm%X
88@@
        
;2+632#354'&&'""&#&47632#2#"&'&5472263667655#22#"&'&5472263667<6<&445&&'""&#&54#34&5&746%#34&5&746|$ 

|$ $|{%
 {%
  
mmmm|xx
!6CS&t
	}}>	%
 7BSLSC6!    y S s fV(2+632#""2322#"&'&5472263262>76'."&#""&#&5467#3&'<&<644%

&

oo9!7CTLTC7!!7CTLTC7!   4 M \ 
VPB62+632##"'&5476632327665.'&#"'&4#"2676764654'"374566% 6z '(	'*			76:"--IH&>
#
E0

L	F	!    	 x    @
y?2+%43654'&&'22#"&'&5472263667446<&45&&'""&#&547632#7>7654'&547632#"#"'&#34&5&746%'*#"2767&"{%
  
|$k9(~c$8(h?GHimmp)R:is
 7BSLSC6!
g7,*e<UV
	P8      K c j 
ifYM1	2+%2! '"15&5472263667446<&45&&'""&#&547632#367676764##325&'&76752n


  
y#26KA84566\2)(( 7BSLSC6!

5,9	C2     f x   @
zvn%2+62&46776732#"3#"&'&54>36676#"'&3#"&'&54>36676'&'"'&54&'&'&''#674##33&'&766'&c11t]$3#zy%
 }~	3bL
 (ZbX0{:45?AT-tt
	;/Nx/t݊
   J R RM32+7432676'&'&547632 45'&&#"'&7632#"'&#&32#"&'&%'#lW="]J#bL4ty"a7v
U2   "  ) : J @
F=6. 2+632 '&5476%&#"2767654'&4766#"3&'&%27654'&'&#az0jN|E!``|E&8(M)!8:^	!HHMV&.HuJ<b^JJb]?(KӛOB!1P]AWYVU]VƖV&W     W < [ j } @
smc^YM2+632#'22#"&'&547363667<6<&445&&'"#'&54.4&4&4455767#"32&&#"36766547&'"72767654'&	g|-*t[+ y%9967	,*0'1#
#a[ZC/*"ux
!6BSLSB7!
~
		%#J>3X0[c0!N4!(  "M * ? P ` u @gc\SLD6,2+3276#"'&'&/&&54767632&#"2767654'&4766#"3&'&%27654'&'&#&'#325&'&'&''##"7u	TWeBkyE!az0jN|E!<EH8(M)!8:^	!HHMV&.H!uK6)

k#O%]J<b^.(KӛOB!1P]AWYVU]VƖV&W7F2      [     @l2+63232##"&'&5&''#22#"&'&5472263667<6<&445&&'""&#&54.4&4&4455767#"32&&#"3667654'676654'&&#&####3'&'&Qd
,A(Bk0
G*&ca$ |%
  
9976;7)P@' 73i10(3-N:K)`
x{ 7BSLSC6!~
F*"(,3a3]Y-<4]'*J?    N W y  @
~|jXUO/2+4677232327632'&'&'&'&#"#"'&"#"'563232654'&'&'&%#546654&5&'&'&&'&5477&'3633m_('(<+,	2=VE<X`,(#4				,4DB?d-1"(*V8EI#/"v-:@Yi
A/#
7.!1:S!@L	49B2;S>+-1	 =.R9(%*$	*P#:21>N! !!
      { B G U [ @
WVQIFC!2+6! '&'&'&'#22#"&'&54722636676#'&5476677##3'&&5#, ?->	$'$	;\	
<8]o=
	XVC)
	
!;.XYT&,E	25   Y w  
yl\?2+632#32767674'&&'".5476632#"#"&'&&'<&4455&&'&'"#'&5467#&'44&544644%'167676{#'.1$%` KL$	vj$jm	3
OM	
"	0983s}ZV-1*&
9s>+ 4l3oEi.@3*     A R [ 
YVMD62+"&54763234767654&'"'"'&7632## '#&'&'&''&47#"774'%767#
x#XOOed$FGGr6
	/ʹ>`		$	%7!)1-.,v*<   f y   @
{mg	2+4&#"5476632#"'"#"'&'&#"&54762754&'&'&'&67632>7676%#3277''&54767#"677&''&5476%7677OH[
pma`	in
]$p!M,'{wj^rBAid
	b@$&
	

%6*

*a `	1
6|,1B[
0/>EP	5"[$"	     l    @
xo52+#">7654'"'"'&762##32#"'&543254'&''32#"'&546327677''&#"&5476323'&'&'&55#4#"7>&'Z#1+EGB(/



?^77	
ij
=_?"

=	0](G!z

&1K
	8))		SW4F
	??

;mH$ 
R:;3CD	      Y u { 
ywi^$2+"&5476632#"22#"&'&547363>7675'&'&'"&#&547632#67654&'"&&547#3254&&'&'4'&7#26LM
 eK&Qx	hv982)yrw				b^
%/
cd

mlY$    | / ; G R @
QKF@71 	2+%2 '&76 7##"'767676  36766767#"727627#2%665"3l

y9FAX		VVJmB
+
f33!FfI1SSdF"5"	>!
      ^ s {  @
|yto`.2+%4365&'&&''32"'&763277<&5&#"&54762267654&#"&476632#"'&#"25&'#"67&'&5&&D
	
q	
I^'c2QYUm~('

Z>`Qf
V$>>

3('{n{N2g
Y-fo	
`#O}n|O	g	ze}       5 2+!&#"#5367655#*.5&676335&&'#"&'&676325&&'&'&##5333273#376654&'#533273#2#32*##334#"6}{!;	~}6"MKm#	.W:D	
'#?@./	cVO]JV6}~	/L.-+.JLY..
#)9NL..%
,ZJK.I   Q  A   @
wV0 2+632#"'&'&55476766&##3276767676554'&'&&"#5327667.'&##532327662#"&'&'&&'&'&'#334&'&'""#367676*1	v1
pH2	-TAXvƋ"!s]JAf
-N?) _-55#,38@a<>.se.sX>S *_#J![s#eQx(
() !4/5C-
	+	C^*[Z
(w1'	
\Z  * Y p f[$2+463276726322#"''5##"&'&'&5476763254'&'&##"'5632374'&'""#'&&#"33267654'&Sg`$Z)*	BQ)06H#</5?	H+#,-]

AT	H!	8#7/
/g	!!.LJ!"=PV?EDA@*%1g! M D+6DK(*e5"W   0+ ^ Q2+473654&'#&&763263233#63232676632#"&54767654#"#"&54774#"'&ZQ\\=L7B	.11 '2
/1C3" @ !"$3	
	

	[

PL=643~1
=3	+G	/%yD;R}} A	)O  	2+2$32#"$"#"54yyo$$   	 . 2+6323 %632#"'&'&'&#"#"'&56767$. ^H?`\I?R
+?K<Pm]I?RR-	H42	 

	';3^>	 

 A O  	2+2$32#"$"#"54yyo$$   . 2+6323 %632#"'&'&'&#"#"'&56767$ ^H?`\I?R
+	?K<Pm]I?RR-		H42	 

	';3^>	 

  9] *  "54767:623 #3#k2SR!(5	'&jj		mm'	
ROI#W(
  1 Q  327>76763276767632#"547677#"54767767654'"#"766&-	(%F$
C@32[7&
^]&	AC!I`=
LM.y	,*Ct	
&7<!581x<=	*,12J+9    ) 0  
2+632'&'&5476?
%o"
. 
>	
#   0+ i  "&54767654#"#"&545"#&5476?64&&#"##&&763263226632763232676632'2
/1C3" s@	(	
kivs	;G7B	.11 
/%yD;R$/	s" %#B#	6643~1
=3	+G	   , h  "&'46743633327654'&'&'&5476633#"'&'&'&'&#"#"'&'&5476767654#"&#"@!YY
)jW('r)$	HY!;
5@
^\9
@5
&(+*YrD^u2Drh1'
*Qg6% OgN3B %6gQ*   8     47363#&47!#
N7h	   3  &547676763354'&'#'&&'&55476332!12	47

/3!.

!	55  7  '.#"##&546767633#"'&'&'4763239		"vv(4hj\gln53
6^A.	)""	'4 6+  7x *  #"'&'&5#'&&'&554763x 
	<#LP807 2;!.

   'F 9  673#32766764'&&'&#"#"&54767632#.'&&5'
?*I,PffP-6POTYb)*d&I15;	&		"]
>
\"(
*iPT^"
t

 f   @ @ /  6633232###"'&'&'&476	)_OO_)+TT		<1				1<		d//  : @ /  632#"'&54767677#"&'&476633'&'&'&54+TT+)_OO_d/		/d		<1				4"	   7 ? >  %!#"&577>7!#&&'&'&47676672!76676322]67,/*_`)0M6+

=
QQ	C#0=
d02b	>0Q@\   8 ? B  747!7667632!'&'&543"547677!#"&5767#"'&86+

,20)`
_*/67>	Q@C#0>	b21c
>/QQ	\/  8 S 6  73237673! !!#&''###'&'676+}	L.'	&+	'.L	}+%gf#50;Q#5+		+5#Q;05#c>@   7 S 5  #"547677##47677! ''&477663!'&'&533'&'&543!#kj +}	L.'	K&	'.L	}+g@Bb#50;Q#5+		+5#Q;05#   8 S ,  732!7673#&''!##'&'676+	L.'		'.L	.+%gf#50;Q#5+	(	+5#Q;05#c>@   O S *  #"547677!#476775'&'&53!'&'&543#kj +.	L.'		'.L	+g@Bb#50;Q#5+	(	+5#Q;05#   8? ) 8  76732!547632#"'!##'&%4&#"326768k$+%c\WCH#M3)+%=E@8%_XCd#50#5KQYKP05#cF?:?">1  #? - =  #"547677!#"'5#.5432!'&'&543%"335&'&'&!#kK+)3@RH!TP+@:*2,Y%?fA
@J#50$F7DN-O#05#v@A9:
1g+8  9 S3 X  767337676676767>763'&''3#7677#"'&'''&&"'&&''###''&9g(.8|''
<Q
79(	60
''|8.*Cc,.8DE"#%$M
		
M$%#"ED8,>i
C>('=S
7:)61'(>C
7
?'<k
C>##%%NN%%##>C
_  7 ? Z  632!'&'&543"547677!#"&577>7!#&&'&'&47676672!766^

,20)`
_*/67,/*_`)0M6+C#0>	b21c
>/QQ	C#0=
d02b	>0Q@   8   X  6732;0"'&##'&'&'6A^'&
Z(.:!1:g#8)F,3&E0	  7   &  433#47677#"'&776677'&'&'g**.(x
&h?4#&&3,)8#      <  %#"'&'&&'&#"767632#"'&'&&54676766732t$&j3>	-N/c
G1@1U9I*Wyr3G-_+5jWCR-o!  .   =  7"547667327676#"'&&'&&55432'&'&'&#"C˕"xZn1G
c0N-	>36[B:Lp
O^5+_-G3ZKy!Z.1  8 P   43276763#"'&&'&47667632654'&'&#'&&/&/q 
1'*-'	PmO(.HQ20^~`G5"@RS{&j4('/_,tS&$h:X$*QfvUY{-2p6		./U-  8 P  2654'&&'&'&5476#"'&&'&476677'&'77632#47677&5"{	M2C_~pmP	+)+*.
 j&m*{$$:c MHtt:^-((+7/.		6p-3s   >w   3#"'&''"'&*K!:,	K&
)	  )>    73"'&#"55676	,:!&;LL~	)
'  >w   632767632#	,:!&; 	)
';  )>    632#'&'&'5432*K!:,	KLK&
)	~  7    <  #"547677! '&476!!'&'&543&'676732! !!#!#kj +{{+-b\)*

{z	)fABb#5005#el;9g#4.
.9!  7     C  732! !!##'&'676433#"4667677! '&5476!!'&'+{|+%gfQ"=$-I'	zz
*#5005#c>@T1U27+
.4   7G 8  !!! !#&&''7676'&''76673
zz	0
/	
z{ .F+
[)	(U
+F. 


1A	A1

 1
42T8eZ4T24
1   S> 5  #'#"556727677#"'&'''"'''&'&''

	
); eB,PP-<k;*
	
4>>4
	'!nJ++J
g((		1
1	   7G 8  47!&'&&'3#66767!%&5476!!'&'&74667677! '&7
 .F+
\(	(U
+F. {{
	0
0	zz
	 1
42T:cZ4T24
1 

1A	A1
   S> 4  637676776636767632'&'&"&'5432

4>>4
	
*;k<-PP-<k ;)
	1
1		((g
J++J
g('	  7  ,  732! !!5766!!#"547677! '&54)	LK]]]#(	
!8,	43c
$7,	   7  /  433! '&476!!'&'&5! !!##'&&'	%NKK	)D	(D+ M,	,8!	,7$
0N   8 K \  467##"&'&'&'&&4676676632!76763233##3!"&77664##32:
3#J*.

f.#3
4 :
'!!M 
.G74

6E	F
\		E6
KM@YON&%L% (   " d q   74"#.'&'&'&476767>723376763225&'&'&543"547674###"&5567!37%'#"37677'&,.D!

!>5,.D!!>5Q	#=

5"	wwR	ww	"5

5
8C
	FL	
ABL)'8C
	FL	
ABMM :#$ #)K    8 D U  47!76623'&'&5432#"547677!'&7674##&5473767#'&33767&'&''#"8g! 

3#J(/f.#3
 ;, 
1D74
[OM
GH
6E		F[	E6
KM	3f&%L'(   Lc :  %!##'&''67732!!! !!!""WW""-;M	qq	O9H6&(3y|3(&

O:=L

  8c ?  747!'&''! '&5476!!'&&'&'&433#"4767>57! '&5476!!7677!%&8	O9"#WW#"$$;M	

=L
&(3y|3(&
O:   8 S ;  #"547677#"'''&'&5#"&547677667763'&'&543!#kj +opU	TVT/3		)?27P)	.,+g@Bb#50JMMJ+-#
9
,,M#((05#   @ @ / 7 ?  6633232###"'&'&'&47647!!$47!!	)_OO_)+TTS00		<1				1<		d//P  T @   ?  647!!$47!!%632#"'&54767677#"&'&476633'&'&'&54T00+TT+)_OO_d/		/d		<1				4"	  8N 6  732677547632"&'&76676332#"'&55&&'&#"A)&>

hh
F8'
M'@
kA?DE5@?665+;
_EC?A
!   8[[ < E O  4732576763233"#"54674##&473>54##&473766774##!33#3878
$67v"TT)"ON sKKh		OO  8I 4 E \  66327466767632#"'&''#"&54767&546%&'"3 544''3276676`suT
,
`;B!k9U@P\;9QlI<
|N)	CrG9	(5FRuBnM	'VZXjP*;;EPZY'G<T<+6:GD;d>2vS   m   4  4&#"#"'&767632#&5676327677#'&547356j42 '(&& @Q	++7D4*#&`!XX	 6?
U@AW&-`   T    647!!T0  9 	   462#"& 47!57632!!"'!S(*
	*(65   \   4632 #"'& '&\,b  8  . A  %#"&'&''#"'&5476632676632%2654'&&'&#"1Z`0O>PgD3[Z1
I13dIDNgJ/Jg3'>2-"$
5"-3Ch205G-"$
5"-
	26IMdkK$,=kJI6)  7     %!&5476 7632!8	FA

PJ	  7   )  !#"'5!&5476 7632 3%&'348
N=z
`}SeH$$
  7' ( 4  632##& '&'&4767$4'&"3276cC4##			Won"XXA
QU*B  [    "'63|
Y  ) (  #"'#"&547677576327632
	4CC	
	4:	BC/=</4<<   7M  "  632#"'&&5463632#"'&54=	
11

11   H  63267547632767632#"'&#"'&&55#"&54677463h<=IJ3h<=:J4h)<<GK@4h)<;:I@   	     4632"&"&54632%4632"&###2##$# "" 4$"#2##,#!!$:#"#     	    4632"&%4632"&"&54632###2####2##$# "#2##"#2##,#!!$  7 o 1  7467632327654632#"'&&'&'&#"#"'&7T@
93,/)J)	
J@:4-/)J)Nm ("=
Jh (#=
   8 o +  2"&54'&#"#"'&&543232767676&NZ
	)H! ?@#'$",9G2*)1?$#orR-)?89d? 7.?+9   7   R  632327654632#"'&''#"547>77.'&#"#"'&566763276#&H/)J)	
J@7M	JL&H/)J)I>7M	JL-V=
Jh<YZ-V=
	#Gc<YY  7 $  6  47!!"5467632327667676#"'&'&'&#"8}6+!&'( =9("-?M!$)(!<:(".>| ;[2.	H4	
	f&1.	H4  7c u  "5476632327>763236767632#"'&#"33!3#"&5477#'&54737667!&567!774'&'&'&#"SW@!%H
65.$P$K<
-,:-)'NN[Z<#01J+-(2'. 8J-^$
	\Q9@ULN
f3	N'GC	e
UU*6  7 7 * W  2#"'&'&'&#"#"&5467323267>"&5467323267>32#"'&'&'&#"R&/4V^1,I	OC5V^1,I	OC5V^1,IR&/3W]2,I(`'	14%"CP
14%SCP
14%`'	05%"  1D 1 a k  2#"'&'&'&'&#"#"54766763263232767462#"'&'&'&'&#"#"54766763263232767&'47!>3!%F#-(2'1	9++2},)2'.W@!%F#-(2'1	9++2},)2'.D9Q	.
	4,@M	6
 8J.
	4,@M6

   8   A  47366323##&'&'&#"#&473327676732##"'&'#&8O=7O
bc7775cb
F!M-[8EI4@(#@(#N!A"  8   ,  47366323##&'&'&#"#&47!!&8O=7O
bc77|[8EI4@(#  8a 	  ! +   463#"47!!&47!!&463#"A& A$ }|	& A$ >%=$>%=$  Y    ,  462"47!!&47!!&4632"&#2##2}|J"#2#2##2#!##   Y 	  ! /   4632"47!!&47!!&#"&54676"##2}|O$"2#$##$  8 o # +  47!##32!&5473'&477#&4'#38}
xyyx
-O--O[	N		N	``   8    $ 1  #"'&&54622654'&#"47!!&47!!&>/#@ZAN+4
}|d.?2/>@r(6)'  8 ]   # 0  &54767636'" 47!!&47!!&'>~}H)  SQ  % /  632#%$'&5676 47!!&&'47!	Rߤp ,CC'N5A:	


  SQ    *  4632#&5476%7%&47!!&&'47!S	% CCvR	


   S  U  632#%$'&5676 473667#'&47!7677323#3!#"&54?#'&	Rߤp ,av./#"LL.2#"ML'N5Ax	g	
11'"

12'#   S  P  4632#&5476%7%&473667#'&47!7677323#3!#"&54?#'&S	% av./#"LL.2#"MLv	g	
11'"

12'#   J T e  432767632#"'&''#"&54767676&'&'4&4656766'&'&'&654'&&'h03%'!  uu  !*%'!$ uu $sc
[:."
		
%"
		
әy!r+'   S1 8 A  45&'&476$7667637667632#"$"'&67rj
	'Ia_,0
	OO0@KG	6g".,W_	-LMm[~#>"P  S1 8 C  '&547#&5476?'&'&54732763.'"67vj	
'HvL,B%V	
2W!]Gg"8#W,CWM)	
&:(B"   K" X _  %32###"&774#"'&5476633766#4&&'&76$34676326633#"''477#;5̦/
':562=?%~c$vc=>=	54A\	@Y;=

)V7/BDCy}~LK  S# Y _  2767632332###"&774#"'&5476633765#"&476$3665$'&546'"6fS=I		;'88':̦/
':562=56	Y	H}	C_	
O= JA\	i|Ff  8  K  632#%$'&5676 "55467632327667632#"'&'&'&#"	Rߤp ,T=
6 6'*)8Q<2+ 26'*)7'N5ACOm
/L/# Mo-/K3!  8  F  4632#&5476%7%&"55467632327667632#"'&'&'&#"S	% T=
6 6'*)8Q<2+ 26'*)7v[Om
/L/# Mo-/K3!   ,  8  %#"$'&5476$32%4632#"&547676%&$&'&v
e@^y9Nv
e	ǂ

&#Q-;s07&Vb;s0  S  /  &543#&5476%$63"$$'&5476$Z
:$=
2	zz88nzz  SgD ( >  %#"'&%&#"'&5476327$76763#"&'&'&&'"'&5432gNJR9\h>''4n55u
>HT!.
z'5:\>&1i**
I65<
#|2   SfD + B  463232#"&5476767&'&'&'&&56767263S	(b<.o
f@p''*Duj5	2
?0p7)`7$9)IZDt	
j6I  8 ( W  %#"&'&'&'&'"'&4763676767663"55467632327667632#"'&'&'&#"'UMC'

'CMU'	/K]&x T=
6 6'*)8Q<2+ 26'*)7
=/gg/=O8\'<mTOm
/L/# Mo-/K3!  8 * Y  2##"56767&'&'&'&543226"55467632327667632#"'&'&'&#"'{`/K]"x!
'UKD
T=
6 6'*)8Q<2+ 26'*)7
K:h
O8\'	;n"=/gLOm
/L/# Mo-/K3!  T2 R  "&7466766#&#&'"'&4763677676322767667632#"'4&&5&'&''	5*:Zr'

'wfe
^]#	!2`
4]UP4fe	1i,Qs;"N>%		9;\!
$ j*   S2 M  2##"&45""&5476?'&'&&546327763226'_fe-%C!	(<
=GM

q+Y $
	!:	%SN"</E"z   T$ I Y  473667&&'&476676?6763233#3#&/33##"&774##"72hi.KqXYT'	:56|hg!':+,[P8ʂqxLFT~@\	NL
	A\	gND7Z  S# T e  4732667632#33##"&774##&4737674##&547377>54'&'&##3676764'&'&T0J(&XV7+  ':56}^^hgc2
#,^]"XCWP\	bY9d".#T|LM
	A\	KL	8x=+'9\DX7   T| . V  46722622333#"'&&'&47!7676323!#"&547677#'&Ts'2Qn
L7!$e34"#xx33#nnZw
	mP?a	
]S//	/. 	  S| g   4732##&547;:673367667654'&&'&'&&''&47!7676323!#"&5477#'&Sedk  7K

K7#$#/qr'#	"{|h
]F]	b>>a	,'6! 	+(	' 	   S   67!!!!&'SD+	   @   47!!&547!!@mR

   9F  . F Q  632#"'&&'&476762654'&'&#"632"'&&'&4764&"326-7(fNVFLk$-$^F7yAQfzAM.);		<+&+<	:R:<'+85BKuHcIO	`HcI:yfRAyfRA	<*+<		<+F_+8;(+8<  9F  .   632#"'&&'&476762654'&'&#"4632'&''672637667632#"'&&''"&'>77#"&547>77'&&'&-7(fNVFLk$-$^F7yAQfzAMNv;
+/##?
	<o	+/##?	5BKuHcIO	`HcI:yfRAyfRA~V&&&%	
B+



+&&&%
BS	

	  9F  . ?  632#"'&&'&476762654'&'&#"632#"'&54-7(fNVFLk$-$^F7yAQfzAM/x##x5BKuHcIO	`HcI:yfRAyfRA7  7         3&'67!!!!!!!G
K(KJJ	m	m   7       3&'67!!!G
$KJJ	m	m   7      " +  3&'67!!6&'7 &''!7G}5B+n
JJ	
i
%+ (s   7       3&'67!%!$"&54632G
$@4"$#JJ	m	(a#!!   7  +   7"'63!!!!_

DC

  7   	   7"'63"'63!!_



jh  7  A 	  #  7"'63"'63"'63!!_





ghh    + 0 5  7"'5#"&5476776337676323!77#_
&		65
||mmnM+$	@<ț	
		} ?}?>   - 8 ? E  #3!"'5#"&5476776337>763234##37#76+J;('
&		65
^3		VVQRaa=BfWB
/,|M+$	@<l;	
bc	 Lt    ?  63276332 76323!"''5"'54#"&5476777
	
Of4
((65eC	
	}}b1g''53    I P  #!!"''5"'54#"&54767763276337676323>4##)Tif4
((65
	
mvs2$_cb" "(P"
}}b1g''53eqp	0"[	_   S    #%$'&5476 7632",(||
;;w   S    &'632 $'&5"3667e	4	)|)%
"T$w;   Sv|   $  %#%$'&5476 7632"&'47!,(||CG
;;w

  Sv|   $  7&'632 $'&5"3667&'47!e	4	)|lC8%
"T$w;W

   8 \ ! 3  6632#"&'&'5! '&5476!!567"3267654&'&	S:7JA,=T
NM0A,#*;5)3JS=+:H5
_C3*;,#.>	   9,   #"'#'&47633#>
	LK
	LL
	<  7  +  &  2#"'&'.546267676&547!mutnBo%vL8			L*4		   7  + 	 %  67!!&632#"'&#"&56767,
utvL


*

  7       3&'576773G
EPP	   8  I Y  47263#"'&47!'&&5463276632!!#"&''#"&54677!47263#"'&@7&^MjihM"	]^^]	"MhijM^7&8&^NhihM [__[ MhihN^8&    	v $ '  %#"&''#"'67676632%7'v	"Mhij	
jihM"	hhhhE MhihhihM hiih-    	v & +  %#"&''#"&547677'&'&5463276632v"MhijghhgjihM"('0U MhihghhghihM rX'/V  5 $  &632 #"'& ''#"&547677'&8
:5

9	   7 (  632#"'&''#"&54656 	
!L%5:			$R'MT  8 $ + 5  #"'&&'&#"#"'&&5432327676763247!!&
?-0DL)+;M?-/FJ(+;Mgy!0B

49bE1B
	59a  SA &  432254767632"'&54'&'&'&SA7!w@=V:W.*	20%

4%mG  SB -  44>7632#"'&'&54##"54767676h=?x!7AW:V%%02	Gm3   T . P  746722622333#"'&&'&#"'&&54767633#"33Ts'2Qn
L7!$ebK(598) w
	mP?a	
]QF/I%	;%1	   S - Q  4732##&5473676767667654'&&'&'&&''&47322372##&4732767654&'&##&Sed  7K

K7#$$K(C7'J8* 
]F]	b>>a		, /F;%1  7cV ) G  "'5456765676632#"'45&'&&#""'54676632"'54&'&"X	&yHR!
	
j:G"@+0Dl1'$*2<3))EE/!"'J%..#.9(,--,   7cV ( E  2#"&'&'&57632327676556"2"&'&57632276655O		%}FN"	
	UG"E\E
	lV1'$+1=2&.
CMJ%.)89),--,  8c >  "'5776767266335763233223"'54&'&&'#"'#L+Fn
	=jpJ:f	
7#:ab+!'0->+!
   S  #  "$''&547 32'"&547632	ڏ=	Rߤ*(*DE
'N)#)<)  S  #  4632#&5476%7&'$'2#"&46T	& p*')(DEv5A(>()<)  88  5 P  #"'&$$'&476 773 #"'&$$'&476 773 #"'&$$'&476 773 		$E		$E		$(+++   78  6 Q  "&47$7.'&54732#72#"&547&$&'&54%62 #"5476%%&$&'&54KGqkR0#fF

TCm<l8+z	R5	Z,   R~v  % @  632#"$'&&7676$47!!&463#"'476767&$&'&		>		/'
	>"	t
{:
		
HaeP  S~v  ! =  463#"&547%&$&'&47!!&632#"$'&5476$$S	*	"	/4		 q	
beP	
3b+
gj   S    =  4736767663#"'&#"'&%&#"'&5476327$76763Sj5!4cgNJR9\h>''4	
j6I?5N]Y.
z'5:\>&1i**  S    ?  #"'&'&546323%463232#"&5476767&'&'&'&?FT(5j	(b<.o
f@p''*#|>8	I6j
	k
?0p7)`7$9)   T# d k  47367'&'"'&47636?676326676767632#"'4&&5&'&'&##33##"&774## 265'T}oc'

'lPQK'j"
	 8q
"(g2((Q':560$C
C*[./W 
#6&F%<!
$ N*`_
	A\	  S" a  4737>7"&5476767&'&'&'&54632336763232#33##"&774##T}O,4$QM 	50
	<9M'DK4V**':56-j2*j $
	!9,a""_&6#
% f(

vfe
	A\	   8  c  632#%$'&5676 2#"'&''"56677'&'&"#"554676327>5632276676	Rߤp ,/Q<6@6-	8/$0)7P<6@5	8/$0)8'N5A. Mo8cSi22	'K3!Mm8b2j32	'L/#  8  ^  4632#&5476%7%&2#"'&''"56677'&'&"#"554676327>5632276676S	% pQ<6@6-	8/$0)7P<6@5	8/$0)8vF Mo8cSi22	'K3!Mm8b2j32	'L/#   8 ( o  %#"&'&'&'&'"'&47636767676632#"'&''"56677'&'&"#"554676327>5632276676'UMC'

'CMU'	/K]&x Q<6@6-	8/$0)7P<6@5	8/$0)8
=/gg/=O8\'<m Mo8cSi22	'K3!Mm8b2j32	'L/#   8 * q  2##"56767&'&'&'&5432262#"'&''"56677'&'&"#"554676327>5632276676'{`/K]"x!
'UKD
#Q<6@6-	8/$0)7P<6@5	8/$0)8
K:h
O8\'	;n"=/g7 Mo8cSi22	'K3!Mm8b2j32	'L/#  K2 ( : C  "$"#"&546774&&'&76$346676276'46764F	E""lqe;;a!t:	AOWNYZ\(x"LK35M36

	%,'[**   S2 8 B K  5266762#"&4766##"'&5<>4776&$'76776'"2$kC^4F2t9Š:70;STL[
B,x"	7	^Kk76M"#%(U   K" M X c  %"$#0###"&4766774"'&5476632576676'4&&'&76?6763276''65"4		:E6)2
L!b159E[>?9@O	B%D&		O#;>[Zs
B3. K MHH

  S# ] k u  20###"&4766774"'&547663376677#"'&5<>4776576656.''>?6"6765&Gt-6e4		:E+
Fd:\6;n'($ 1=k#		0IDN	B%D&		;v%$k"
"F/NO-J#4mmX,,3H   7 zz !  7"&5476767632"'&'&'&#"M	):Vh	63N )_y$"Eu%
z	H.G	1:)_	bI  8 z   &54332767>3#"'&&;	"beS?'+M#$RZ-"b;-A
	F_n  Q~  / x  32#"'&&'&5476764&&#"#32676%4672632767632#"&5&#"#"''#"'546763332654&'&'&'&&RAe  #UNTULV# 8J<ol陋O9F-	
n(41:7->YEU0WG'4;7,=!dEIVOU""UOVޅ+Gphˑ0:S'
.&3S5Aa&UD?E4)-O  72   632###"'&&676D	'**   82   632#"'#"'&54D**M   7q   632#"'&'&&6=	h		**  8n   632#"'&547633	_**   >\   632 #"&5476 ?6S   >\   &54632 #"'& 8S   7     3&'67!G
JJ	m	   7      3&'67!%!G
$JJ	m	(a  T}?   &5477632cA@			  T}?    &5477632'&''32cA@	$pppo		)   S   &'632 e	4	)%
  T}@   47!#"'T	!		  T}@    47!#"'4#"76T	Hpo!		   S   #%$'&5476 7632,
  8|c  &  6"'.'&547624#>|||rv		}bln  0 3  4743632'&''&544&&'&76763o_^x)~x&yzzy^y}#\WGu6'YYYYX[  T *  632#"'&'&5476763237667%6v4*GF"+sX@G|z:L	:  0 U  47!327676'&'&&'&##!&54>7675#"#"'6335&'&'.	 4X	1b	%	Q	!2Vx+
1b	%	m	"	P	Rc6#Um	^MRc6$T  8|c   6"'.'&5476>|||		}   7+- 	  2  67!!&67!!&"&5476762#"'.'7,,
	Bo%vL



R	


%
	L*   Sv|  0  632#%$'&5676 63#%$'&	Rߤp , z'N5A"   Sv|  (  4632#&5476%7%&632#&5476 S	% F1ivJ
   7  9 [  6"$$'&5476$2#"'&'&"'&546323267672#"'&'&"'&54632326767	2#_F,3=B<hTbF*3};4*H	_F,3=B<hTbF*3};4*H		zzG] .$<1
E\M$)!G] .$<1
E\M$)!  7  7 Y  &543#&5476%$ 2#"'&'&"'&546323267672#"'&'&"'&54632326767Z
:$X_F,3=B<hTbF*3};4*H	_F,3=B<hTbF*3};4*H		zzG] .$<1
E\M$)!G] .$<1
E\M$)!  S|  F  632#%$'&5676 47!7676323!#"&5477>77#&	Rߤp ,./! /- z'N5A	// !.-!   S|  A  4632#&5476%7%&47!7676323!#"&5477>77#&S	% ./! /- iv*	// !.-!  7    6"$$'&5476$2#"'&''#"&54656&'&#"'&54632674'&"'&54632376676322676742#"''326767	2#bE0VFI
-*4T`F)&7=@hTcD0V#
I
-TH	_G687=@4*H		zzG]	9
		<1
E\%'<1
E\	9*+V		)!G] %')!   7    &543#&5476%$ 2#"'&''#"&54656&'&#"'&54632674'&"'&54632376676322676742#"''326767Z
:$XbE0VFI
-*4T`F)&7=@hTcD0V#
I
-TH	_G687=@4*H		zzG]	9
		<1
E\%'<1
E\	9*+V		)!G] %')!   S1    ( @  2#&$'&5476$ 47!!47!!463#&547%&$&'&			
:EE	;
		a]
w	a]  S1  " / I  463"&5476%$'&47!!&47!!&632"$'&5472$$S	?
			EDH	
	


fj   Rv|  /  632#&&7676 632#%$'&5676 1Rߤp ,z
'N5A  Sv|  1  4632#%$'&63#&547>	7%&S	% 

)3P_Mi&-?%   S - f  632#"'&'&%&#"'&5476327$7676473667#'&47!7677323#3!#"&54?#'&f@p''*	(b<.

-<b(	av./#"LL.2#"ML)`7$9)
?0pp0?|	g	
11'"

12'#   S ( a  #"#"54656%&'&'&'&54632473667#'&47!7677323#3!#"&54?#'&.<b(	)''*	(b,av./#"LL.2#"MLp0?79)?0p	g	
11'"

12'#  7 0 `   632"3#"'&'&'&'"'&5476367676762#"'&'&'&'&#"#"547667632632327672#"'&'&'&'&#"#"54766763263232767*25}"+QCW6

6VCQ+&W@!%F#-(2'1	9++2},)2'.W@!%F#-(2'1	9++2},)2'.(~.2h(
B,OO,B 8J.
4,@M6 8J.
4,@M6   7 , \   7"&54767>324#&'&'&546322#2#"'&'&'&'&#"#"547667632632327672#"'&'&'&'&#"#"54766763263232767h*25|#+:1
6WBQ+>W@!%F#-(2'1	9++2},)2'.W@!%F#-(2'1	9++2},)2'.(~.1i(B,9-O,Bh 8J.
4,@M6 8J.
4,@M6  7 0   632"3#"'&'&'&'"'&5476367676762#"'&'&#"&5477'&#"#"54676327677'&'&#"#"54766327676676323276742#"'32767*25}"+QCW6

6VCQ+&X@(R=!!
/"2'1K<
<8L32'1X@'S,
-$2'.
E4
;:L42'.(~.2h(
B,OO,B 8J5|
	BA4@U#8$
248J5&+X6 1C#
$826   7 ,   7"&54767>324#&'&'&546322# 2#"'&'&#"&5477'&#"#"54676327677'&'&#"#"54766327676676323276742#"'32767h*25|#+:1
6WBQ+>X@(R=!!
/"2'1K<
<8L32'1X@'S,
-$2'.
E4
;:L42'.(~.1i(B,9-O,B 8J5|
	BA4@U#8$
248J5&+X6 1C#
$826   T) . 6 >  467:62333#"'&&'&47!!47!!Ts'2Qn
L7!$eEEw
	mP?a	
]F   S) - 5 =  4732##&5473676767667654'&&'&'&&''&47!!47!!Sed  7K

K7#$EE
]F]	b>>a	   S . h  467:62333#"'&&'&47!7676323#3!#"&547677#'&5473667#'&Ts'2Qn
L7!$em56)*RSƄ/>)*RSXw
	mP?a	
]>?00		6G01	
g	   S - g  4732##&5473676767667654'&&'&'&&''&47!7676323#3!#"&547677#'&5473667#'&Sed  7K

K7#$m56)*RSƄ/>)*RSX
]F]	b>>a	>?00		6G01	
g	    %  632767632#"''5#"&54677[
	&$)5
	'&*5;:''	+6ih('	,7  D  6326675476327632#"'&55#"'&&55#"547677546=	!!!!!!!!
ceM**#	}'MXX<J	nZ   9] *  "54767:623 #3#k2SR!(5	'&jj		mm'	
ROI#W(
  1 Q  327>76763276767632#"547677#"54767767654'"#"766&-	(%F$
C@32[7&
^]&	AC!I`=
LM.y	,*Ct	
&7<!581x<=	*,12J+9   S  I  632#%$'&5676 47!5476!!!!#"'&55!&'47!5!&	Rߤp ,'N5A:	,-
*,

,+
-,
  S  D  4632#&5476%7%&47!5476!!!!#"'&55!&'47!5!&S	% vR	,-
*,

,+
-,
   S\ m r  263232##32###"&7674"'&547667767#"'&5476633765#"&47%66''&'&547'6jtp=2Zy..'
Ơ.
'	J|<E `_Re)*/S	:<{1G770*<9LMr:	Z?zzH&XX;Q   S# V \  2767632367732"&54765#"&476?65#"&476$3665$'&546'"6fS=I		;'88''&[[ܶ,8+(w	RP&'	Y	H}	C_	
O=]]U++hVkf`9%&]Zi|Ff  K" U \  7266'4&&'&76$34676326633#"''"%"#"&744&&'&547%477#j2~c$vc=>=	2XXBC]a54Vy;=

)V7/BDCCy*)T
A,-I}~LK  S\ r {  674"'&547667767#"'&54766337654&&'&547%4667632663632#"'32##32###"&454#J|<E `_Re)*)Ag@B77z}	L'
Ơ.
'	`8}sZ?zzDGZx0 :;tLMr:;  T< k }  47376677&#&'&&'&547667633766763332##33#3#33!#"&54766774"'&47633774##&#"##37T"Fedqm	opE""#	
<

'(!#IJ122[uPnN*

eD".#\#
		
	LM%D
*
KMgNDGh  S j  467:6233337676332#3#3##"&5477#&473667#'&5473767#&'&&'&Ts'2Qn
L7!i`"#5%&eceerrc""5A30UZXw
	mP?a45T	
		
	55Th	
	KN~U  S< i }  47322766763#3#33!#"&54766774"'&47633774##&473774##&547377654'&'&&''&36767654'&'&#SP>
:?YE""#	
<

'(!#IJ""uudd%!$]W
rJ01'87
<UFV~	
	LM%D
*
KMLM		\Q6II5
  S p  4732##33#3!#"&54774"'&476337>77#'&5473?4##&473767632367667654'&&'&'&&''&Se[$?8

%$	EEMM kl?77K

K7#$
]FW}LM
		10	+*'B	
	LL/5
)*b>>a	   T| \  467226223337676323#33!#&547677#'&5473774#"'&&'&Ts'2Qn
L7!=1,-"!TT@@-,"!JJ@@#\Zw
	mP?a56''	LM54*'	
LM~W  S| _  4732##33!#"55774#"'&47633667#&4737>7632:326767654'&&'&'&&''&Se[5+33)$#

"#D"5Oi*0
K7#$h
]FW}LM55)*f4	P,-6I>a	                    "           y0?1	
.
XRjkk*=`]?"wgnI)E s !!9!a!!"N""#W##$<$%x%&O&''l'(())`)r))*,*Y**++A+v+,,D,,-E-.;./T//0:0011X112?23434.4556667+778p89j9:\:;h;< <@<==>>G>>>??\?@@p@AAFAABB?B~BBCZCCDD]DDE/EFF}FG;GuGH6HIIIJAJKdKLM'MN3NO4OPPCPQQ;QaQQQQRR.R\R{RRRS!SpST.T]TUUGUVSVW$WXYYuYZZ[3[\]^^_>_`g`a a?ab$bc/cd9def$fgoghu        5_<                 1	)            2    M       	 &  c 
 &
   
    
 "c 
 " ,          ,       , * 0		      
 9 1  0 ,, 8 7 ' @ : 7 8 8 7W 8W O 8 #m 9 7 8 7  .
 8
 8  )  ) 7 7 7A S 7A S 7 7 8 " 8 L 8 86 @6 T 8, 8
 8 m T
 9
 \
 8 7 7 7  [ 7  
 7
 8
 7
 7
 7
 7
 1
 8
 8
 8
 
 
 8
 8
 8
 S
 S
 S
 S J
 S
 S
 K
 S
 8
 8
 ,
 S
 S
 S
 8
 8
 T
 S
 T
 S
 T
 S
 S
 @
 9
 9
 9
 7
 7
 7
 7c 7 7y 7cc
 S
 S
 S
 SW 8, 9c 7c 7 7
 8
 
 
 5
 7
 8 S S
 T
 S 7 7 8
 S
 S5 85 7
 R
 S
 S
 S
 T
 S
 8
 8
 8
 8
 K
 S
 K
 S
 7
 8  7 8 7 8y  y  
 7
 7 T T
 S T T
 S 8 0A TA 0 8c 7
 S
 S
 7
 7
 S
 S
 7
 7
 S
 S
 R
 S
 S
 S
 7
 7
 7
 7
 T
 S
 S
 S 
 9 1
 S S S S K S T S S S T S     1 Z		)                          1                       PfEd @   8 Z   ^                        @      L   Z k    ' 5!!'!2!8!A!!!!!!!!!!!!!!!!!""""""""&"5"="B"F"H"J"O"S"W"\"i"l"s"w""""""""""""""""##$%%%%%r%%%%%%&'' )*^*~*****	     A k    ' 5!!'!2!6!A!!!!!!!!!!!!!!!!!"""""""" "4"<"A"F"H"J"N"Q"V"\"f"l"n"v"|"""""""""""""""#"$%%%%%q%%%%%%&'' )*^*}*****{s2^I$K9ޢޡޚޘޗޖޏގފވކބރyxvuWUNJIHB@3-*'&%"!	 ݥ۾ۻ۸۵]0 ٻa[S5+'                                                                                                                                                                                                                 ,  UXEY  K QKSZX4(Y`f UX%a  cc#b!! Y C#D  C`B-, `f-,#!#!-, d BCC ``BCB%CCTx #CCadPxC`B!e!CCB C#BC`B# PXeYC`B-,+CX#!#!CC# PXeY d P&Z(CEcEEX!%YR[X!#!X PPX!@Y 8PX!8YY CEcEad(PX!CEcE 0PX!0Y PX f a 
PX`  PX!
` 6PX!6``YYY%Cc RX K
PX!CKPX!Ka cCc bYYdaY+YY# PXeYY dC#BY-, E %ad CPX#B#B!!Y`-,#!#!+ dbB #BEXCEcC`Ec*! C  +0%&QX`PaRYX#Y!Y @SX+!@Y# PXeY-,	C+  C`B-,	#B#  #Babfc`*-	,  E Cc b  PX@`Yfc`D`-
,	 CEB*!  C`B-, C#D  C`B-,  E +# C%` E#a d  PX! 0PX @YY# PXeY%#aDD`-,  E +# C%` E#a d$PX @Y# PXeY%#aDD`-,  #B EPX!#!Y*!-,EdaD-,`  CJ PX #BYCJ RX #BY-, bfc  c#aC` ` #B#-,KTXdDY$e#x-,KQXKSXdDY!Y$e#x-, CUXCaB+Y C%B%B%B# %PX C`%B #a*!#a #a*! C`%B%a*!YCGCG`b  PX@`Yfc Cc b  PX@`Yfc`  #DC >C`B-,  ETX#B E#B#`B `   BBB` #Ba++"Y-, +-,+-,+-,+-,+-,+-,+-,+-,+-,	+-+,# bfc`KTX# .]!!Y-,,# bfc`KTX# .q!!Y--,# bfc&`KTX# .r!!Y- , + ETX#B E#B#`B `a  BB`++"Y-!,  +-", +-#, +-$, +-%, +-&, +-', +-(, +-), +-*,	 +-., <`-/, `` C#`C%a`.*!-0,/+/*-1,  G  Cc b  PX@`Yfc`#a8# UX G  Cc b  PX@`Yfc`#a8!Y-2,  ETXEB1*EX0Y"Y-3, + ETXEB1*EX0Y"Y-4, 5`-5, EBEc b  PX@`Yfc+Cc b  PX@`Yfc+      D>#84*!-6, < G Cc b  PX@`Yfc` Ca8-7,.<-8, < G Cc b  PX@`Yfc` CaCc8-9, % . G #B%IG#G#a Xb!Y#B8*-:, #B%%G#G#a BC+e.#  <8-;, #B%% .G#G#a #B BC+ `PX @QX  &YBB# 
C #G#G#a#F`Cb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca#  &#Fa8#
CF%
CG#G#a` Cb  PX@`Yfc`# +#C`+%a%b  PX@`Yfc&a %`d#%`dPX!#!Y#  &#Fa8Y-<, #B   & .G#G#a#<8-=, #B 
#B   F#G+#a8->, #B%%G#G#a TX. <#!%%G#G#a %%G#G#a%%I%a  cc# Xb!Yc b  PX@`Yfc`#.#  <8#!Y-?, #B 
C .G#G#a ` `fb  PX@`Yfc#  <8-@,# .F%FCXPRYX <Y.0+-A,# .F%FCXRPYX <Y.0+-B,# .F%FCXPRYX <Y# .F%FCXRPYX <Y.0+-C,:+# .F%FCXPRYX <Y.0+-D,;+  <#B8# .F%FCXPRYX <Y.0+C.0+-E, %&   F#Ga#B.G#G#aC+# < .#80+-F,
%B %% .G#G#a #B BC+ `PX @QX  &YBB# GCb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca%Fa8# <#8!  F#G+#a8!Y0+-G, :+.0+-H, ;+!#  <#B#80+C.0+-I,  G #B .6*-J,  G #B .6*-K, 7*-L,9*-M, E# . F#a80+-N,
#BM+-O,  F+-P, F+-Q, F+-R,F+-S,  G+-T, G+-U, G+-V,G+-W,   C+-X,  C+-Y,  C+-Z, C+-[,  C+-\, C+-], C+-^,C+-_,  E+-`, E+-a, E+-b,E+-c,  H+-d, H+-e, H+-f,H+-g,   D+-h,  D+-i,  D+-j, D+-k,  D+-l, D+-m, D+-n,D+-o, <+.0+-p, <+@+-q, <+A+-r,  <+B+-s,<+@+-t,<+A+-u, <+B+-v, =+.0+-w, =+@+-x, =+A+-y, =+B+-z,=+@+-{,=+A+-|,=+B+-}, >+.0+-~, >+@+-, >+A+-, >+B+-,>+@+-,>+A+-,>+B+-, ?+.0+-, ?+@+-, ?+A+-, ?+B+-,?+@+-,?+A+-,?+B+-, EPXEX#!!YYB+e$PxEX0Y- K RXY  cp B  * B
* B
* B@  * 	B @  *   D$QX@X  dD(QX X   DY'QX @cTX   DYYYYY* Dd DD                      " " # #         	 r  	       	     	     	  B   	  "  	  B&  	  "  	 bh  	  4 C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0   D e s i g n   S c i e n c e ,   I n c . 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y K a T e X _ A M S R e g u l a r F o n t F o r g e   2 . 0   :   K a T e X _ A M S - R e g u l a r K a T e X _ A M S - R e g u l a r V e r s i o n   1 . 1 ;   t t f a u t o h i n t   ( v 1 . 8 . 3 ) C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0 ,   D e s i g n   S c i e n c e ,   I n c .   ( < w w w . m a t h j a x . o r g > ) 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y   ( < w w w . k h a n a c a d e m y . o r g > ) , 
 w i t h   R e s e r v e d   F o n t   N a m e   K a T e X _ A M S . 
 
 T h i s   F o n t   S o f t w a r e   i s   l i c e n s e d   u n d e r   t h e   S I L   O p e n   F o n t   L i c e n s e ,   V e r s i o n   1 . 1 . 
 T h i s   l i c e n s e   a v a i l a b l e   w i t h   a   F A Q   a t : 
 h t t p : / / s c r i p t s . s i l . o r g / O F L h t t p : / / s c r i p t s . s i l . o r g / O F L        2                          $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = N     	
 !"#$%&'()*+,-./0123456789 :;<=>?@ABCDEFGHIJ KLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ uni00A0hbaruni0302	tildecombuni03DDuni03F0uni2035uni210Funi2127uni2132uni2136uni2137uni2138uni2141	arrowleft
arrowrightuni219Auni219Buni219Euni21A0uni21A2uni21A3uni21ABuni21ACuni21ADuni21AEuni21B0uni21B1uni21B6uni21B7uni21BAuni21BBuni21BEuni21BFuni21C2uni21C3uni21C4uni21C6uni21C7uni21C8uni21C9uni21CAuni21CBuni21CCuni21CDuni21CEuni21CFuni21DAuni21DBuni21DDuni21E0uni21E2uni2201uni2204emptysetuni220Duni2214uni2216proportionalangleuni2221uni2222uni2223uni2224uni2225uni2226	thereforeuni2235similaruni223Duni2241uni2242uni2246uni224Auni224Euni224Funi2251uni2252uni2253uni2256uni2257uni225Cuni2266uni2267uni2268uni2269uni226Cuni226Euni226Funi2270uni2271uni2272uni2273uni2276uni2277uni227Cuni227Duni227Euni227Funi2280uni2281uni2288uni2289uni228Auni228Buni228Funi2290uni229Auni229Buni229Duni229Euni229Funi22A0uni22A1uni22A8uni22A9uni22AAuni22ACuni22ADuni22AEuni22AFuni22B2uni22B3uni22B4uni22B5uni22B8uni22BAuni22BBuni22BCdotmathuni22C7uni22C9uni22CAuni22CBuni22CCuni22CDuni22CEuni22CFuni22D0uni22D1uni22D2uni22D3uni22D4uni22D6uni22D7uni22D8uni22D9uni22DAuni22DBuni22DEuni22DFuni22E0uni22E1uni22E6uni22E7uni22E8uni22E9uni22EAuni22EBuni22ECuni22EDuni2322uni2323uni24C8SF010000SF030000SF020000SF040000uni2571uni2572	filledboxH22073triagupuni25B3uni25B6triagdnuni25BDuni25C0uni2605uni2713uni2720uni29EBuni2A5Euni2A7Duni2A7Euni2A85uni2A86uni2A87uni2A88uni2A89uni2A8Auni2A8Buni2A8Cuni2A95uni2A96uni2AB5uni2AB6uni2AB7uni2AB8uni2AB9uni2ABAuni2AC5uni2AC6uni2ACBuni2ACCuniE006uniE007uniE008uniE009uniE00CuniE00DuniE00EuniE00FuniE010uniE011uniE016uniE017uniE018uniE019uniE01AuniE01B      ˼x}wOFF                                 OS/2  t@   R   `FJ-cmap  t    Tļcvt   }      0fpgm  v    b.{gasp           glyf  D  n  dٻhead  r<   6   6_"Chhea  t       $Ghmtx  rt    #2loca  p0  
  
q=maxp  p        name  ~    p]|post    4  	!Pprep  }`      eDxڜY`ֺ۲$C8N&iefv厷wocf23333<Α6Žs$iP#дjRho4%5߀h۴QYjطcsgRU;Fn;fV	aKm]N;NFQ5"ϫVQm5+.'10?TOdʨ(s2)qm3a~YZ/L^T	'7:@,p| r,#
HDH2Qu{~[X|а?z^7m=C!/i\3$f_hK%b'{5oнwvEG۾.>o7ҙÀIGwK̄m!blUr\V"lTkU/)OU !k%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Cm=CG:^k ]P9Eap|؂c>)CXL)W3%Ƒ88_qsprqQ1q	I)iY9yb?SǯW)*F&3bcKH,F&f
J֬۰i˶W9}8Bc8<!DPitpy|P$HerRo`hdlbjfnaiemckghN=-``qxDPitpy|P$HerRdl'AR4r Jja;.k:	?+fO9GE;MB!\3oN&?~oi[߮Tl& HT6.0q9brL(oFA|0xr$רSG!LUޓ(p:Ρ5C)NUƅqi L2@*c2r!r0T}_G!66. 2.q )B*]	'M!]
1yWx.tgWoZ.6LL~ޖ!1I4a+ߪX2.D1)U)I)(Ow"!PqKHj`9&!\w͇x@0:ʢBpc34`RWz -~(Z,mY @{"kw(
9CeQj%Ls`xP0       `OS/2Fr+     `cmap ,     Dcvt 
   +   ,fpgmb.{  `  gasp     0H   glyf     headdQC     6hhea     $hmtxXn     |locaXf^     @maxp       namee-  +@  post9ʳ?  /   hprepdB  *l     2       33'3#2d222  ' B P NC 2+"&54676723276767735476672632327673"'&&'#'6;5&'4&'5(?	'+ew
>		,-E"!9		]<&KZR1;-?
	)	GO	#d$x).]$  ( c  2+2>76763#"'&'&5476733254&#"#"54676767654&""54767677"#"5476676<k}(:3%8	6D2iI2,5?8jO*%!"/N4a3'%.()0	G[=52%M9H>T,$pDF&+
!$%plXMhD   W 8 	2+%2#"&547676762#"56767654#"3276)):`bivI$$B	'c>HA/@=11.%=	lwg.J!/$GWzk9(52     u / A ;6! 2+3&54766?6765"#"5476676726323#4%"&#'327676k
8 	Y&SCU4Y{DG3-7p
Y*a	vL&	'
0Q-OQ^InK3X-  %s S 2+%2#"'&5476767&'&54766763632#"54654'&#"3232676#4N"-sv:<-D?)	@('9N*	1M,!V9)5/4MYkT$;@>/A	)#8'#	2&-	-0/   P 2
2+"'##"'&'&766722767677##"&547676763'&54+!
3$k45"
O##)S%1
':NB	
`+X&	Go8/F%
	6-[
".Ok
(   2 W D 2+4.#"327676672#"'&'&547667227677#"&547667673632#"547676"R1H	UI">I!	 P:EM'GB
79>!!$+m.]nybfr
V,;2!0n# Ld%^.jl,3		!Y!u^b59 ,.!   m 22+"547667632337676632336676632"'&5465677"##"'4767654##&5467672567674654#"*5l)1mnEH+I)
C:Py!+S` .'!99;$	,66I	Of$"'H\()hPS*("#3:._g%^@ !)QQH		1AL+)+     G 02+"5476767672262233#37672"'&5476763367677#"8%HL|$,:6FE
,B	gf	,3`9+$A8:+&-	+XT	.1!
"6lP
	)&EN=
(	  5 I <&2+732767667677#"#"547676767633#"'&'&5467632X=2 
(@\
3<9!7BGUi072#('*>zWO8!M
/32;Aa
?
"P8F
!]]?k<*9-   )B " b ?)2+"547667632"547676752#"'&'&'&&'&5476767672632#&56&'32767676b0		
CF G,+\&+JHX<%8$s*%0L#2	C	beR-g_	<R6>=!PP2
8)

F#
3`
"  ) F  2+"547676767676766762#"54654&##"36632#"'&'#?
0L4G*1	U%A(8|O'Y&G	#9Tx/,$[61[?P0)6 ad-:9\  &I b ]2+746327676767663232676767672327672##"'&'&54765"'&'&'&''#&&'&&,$
<@E"	>I#g&:)8-	#
F@)	0 /,$FFC5&Q.	FV"8$@J6*"1;{>	4 	>Im"  QH V L$2+73276767676632745676767632#'4#"'&'&'&''#"'&546763/")
!;	;:[(9G'!-P)($E1"@5F#6*?U!A;G"!"h#W-.{3D%#F	)l,0CPw
=   ?r I ;2+63232766554&#""54767667632#"'&&'&5476676
:?+;	\:TgSN
-3	1MKT*%WvwXyi!;NdC+uVp

-*,Le{TK,<oU 66_4  N 0 G ;2 2+"5476#"#"547667677232##&##7676767654'&y&RCU4Y{((wu5>tD43D@q* $6$C'%'
0Q- 'A\3}&m r-7*  xn a :2+%2#"'&&5476767326232327676673#"'&'&'&'"547667676767654&#"328PD0FY3y(Tg%-][}HfBI#j0;"#
J|Y/,)!	6yO	t^=65L
QD5aK5;{WN_QJYMI41
N7
'	
'wQj_xh<DO    m  2+"5475#"##"54766767262332327632#"'&'&'&'&'&'"5476676767654'&##xT	CU4Y{%7FN^#$*8a( ,'.,:>	%")		6}59vM#D
	'
0Q-
:1C)
<.K&08%CP	'7$/\'   \ P&2+232767654'&'&'&'&5547667632"54654'&'&#"#"'&'&547676
%9S:-" kF%$L8X^4B8
F!1.1/x(\PgA!7('%T"&+%'	)L-	# 
."*0&+<p(5"3I  & @ -2+"547676776 7767632""##"""##"56767567#=f;CYcY	
);E c13#
C"	"o
7	M?##1PF%HD	(
  T 92+"54767632327667667766327672"54767"'&5476767654#"(29MN=	 7	&N:H!.%(=B#BSy4?/)("-7'GH~5"64p	>'H5=?!85bS\.=7m\/
    4 *2+"5467637676765&&'"54676332#"5654''&2<"Q3FS)4"9D	1gNfM0?V>]2pj3%##<P<$V.6+YR,F    ^ C2+4632>767654&5467327676765&&'"546773'&'&'&#"#"54765'&#"&M(1)^v`*J$
]!v6##/21OD
;'/
e$_7>6..D5
g
 $!I	K:MaI+ŀ3%KC
   8  o ;2+"54676323667654&5476632327632#"'&'&&'&&''"##"&547676766'4'&'&'&##	@+&;IY3M%+"D"	"!3K%$'	Nu"!,	% M			&0:=*91!8W*)1&/Q(
0D!#@uAI$  $\ P 02+"547632326767654&#"&5467632#"&'&5463232767>754''&'INZ]6-	%i.8"

3@	-p^75H'!4	A3U
&+Jt]S"&nu	&:
>/	&/aB>.">' e   .  U k R2+&##""547676732327632223#"'&'#3676632#"&#"""54767677#'&5476676337677nJ
7!=`q$Te!	3-U:#(
[R?)6#//&BA>6>	*72M^_#Mp#7N}po
<8       p                        qOHNQM=:	`	
?
2      (_<                 \IH            2    M      ' (e | _ %.  2  5g ) )b & ?*  x   &  1 8 $2 .      H\ ZbI                          1                      PfEd @    8 ZH    ^                         0          Z      A ~          ,  UXEY  K QKSZX4(Y`f UX%a  cc#b!! Y C#D  C`B-, `f-,#!#!-, d BCC ``BCB%CCTx #CCadPxC`B!e!CCB C#BC`B# PXeYC`B-,+CX#!#!CC# PXeY d P&Z(CEcEEX!%YR[X!#!X PPX!@Y 8PX!8YY CEcEad(PX!CEcE 0PX!0Y PX f a 
PX`  PX!
` 6PX!6``YYY%Cc RX K
PX!CKPX!Ka cCc bYYdaY+YY# PXeYY dC#BY-, E %ad CPX#B#B!!Y`-,#!#!+ dbB #BEXCEcC`Ec*! C  +0%&QX`PaRYX#Y!Y @SX+!@Y# PXeY-,	C+  C`B-,	#B#  #Babfc`*-	,  E Cc b  PX@`Yfc`D`-
,	 CEB*!  C`B-, C#D  C`B-,  E +# C%` E#a d  PX! 0PX @YY# PXeY%#aDD`-,  E +# C%` E#a d$PX @Y# PXeY%#aDD`-,  #B EPX!#!Y*!-,EdaD-,`  CJ PX #BYCJ RX #BY-, bfc  c#aC` ` #B#-,KTXdDY$e#x-,KQXKSXdDY!Y$e#x-, CUXCaB+Y C%B%B%B# %PX C`%B #a*!#a #a*! C`%B%a*!YCGCG`b  PX@`Yfc Cc b  PX@`Yfc`  #DC >C`B-,  ETX#B E#B#`B `   BBB` #Ba++"Y-, +-,+-,+-,+-,+-,+-,+-,+-,+-,	+-+,# bfc`KTX# .]!!Y-,,# bfc`KTX# .q!!Y--,# bfc&`KTX# .r!!Y- , + ETX#B E#B#`B `a  BB`++"Y-!,  +-", +-#, +-$, +-%, +-&, +-', +-(, +-), +-*,	 +-., <`-/, `` C#`C%a`.*!-0,/+/*-1,  G  Cc b  PX@`Yfc`#a8# UX G  Cc b  PX@`Yfc`#a8!Y-2,  ETXEB1*EX0Y"Y-3, + ETXEB1*EX0Y"Y-4, 5`-5, EBEc b  PX@`Yfc+Cc b  PX@`Yfc+      D>#84*!-6, < G Cc b  PX@`Yfc` Ca8-7,.<-8, < G Cc b  PX@`Yfc` CaCc8-9, % . G #B%IG#G#a Xb!Y#B8*-:, #B%%G#G#a BC+e.#  <8-;, #B%% .G#G#a #B BC+ `PX @QX  &YBB# 
C #G#G#a#F`Cb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca#  &#Fa8#
CF%
CG#G#a` Cb  PX@`Yfc`# +#C`+%a%b  PX@`Yfc&a %`d#%`dPX!#!Y#  &#Fa8Y-<, #B   & .G#G#a#<8-=, #B 
#B   F#G+#a8->, #B%%G#G#a TX. <#!%%G#G#a %%G#G#a%%I%a  cc# Xb!Yc b  PX@`Yfc`#.#  <8#!Y-?, #B 
C .G#G#a ` `fb  PX@`Yfc#  <8-@,# .F%FCXPRYX <Y.0+-A,# .F%FCXRPYX <Y.0+-B,# .F%FCXPRYX <Y# .F%FCXRPYX <Y.0+-C,:+# .F%FCXPRYX <Y.0+-D,;+  <#B8# .F%FCXPRYX <Y.0+C.0+-E, %&   F#Ga#B.G#G#aC+# < .#80+-F,
%B %% .G#G#a #B BC+ `PX @QX  &YBB# GCb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca%Fa8# <#8!  F#G+#a8!Y0+-G, :+.0+-H, ;+!#  <#B#80+C.0+-I,  G #B .6*-J,  G #B .6*-K, 7*-L,9*-M, E# . F#a80+-N,
#BM+-O,  F+-P, F+-Q, F+-R,F+-S,  G+-T, G+-U, G+-V,G+-W,   C+-X,  C+-Y,  C+-Z, C+-[,  C+-\, C+-], C+-^,C+-_,  E+-`, E+-a, E+-b,E+-c,  H+-d, H+-e, H+-f,H+-g,   D+-h,  D+-i,  D+-j, D+-k,  D+-l, D+-m, D+-n,D+-o, <+.0+-p, <+@+-q, <+A+-r,  <+B+-s,<+@+-t,<+A+-u, <+B+-v, =+.0+-w, =+@+-x, =+A+-y, =+B+-z,=+@+-{,=+A+-|,=+B+-}, >+.0+-~, >+@+-, >+A+-, >+B+-,>+@+-,>+A+-,>+B+-, ?+.0+-, ?+@+-, ?+A+-, ?+B+-,?+@+-,?+A+-,?+B+-, EPXEX#!!YYB+e$PxEX0Y- K RXY  cp B  * B
* B
* B@  * 	B @  *   D$QX@X  dD(QX X   DY'QX @cTX   DYYYYY* Dd DD                        e e       	 r  	       	  "   	     	  L   	  ,  	  BD  	  ,  	 r  	  4 C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0   D e s i g n   S c i e n c e ,   I n c . 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y K a T e X _ C a l i g r a p h i c B o l d F o n t F o r g e   2 . 0   :   K a T e X _ C a l i g r a p h i c - B o l d K a T e X _ C a l i g r a p h i c - B o l d V e r s i o n   1 . 1 ;   t t f a u t o h i n t   ( v 1 . 8 . 3 ) C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0 ,   D e s i g n   S c i e n c e ,   I n c .   ( < w w w . m a t h j a x . o r g > ) 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y   ( < w w w . k h a n a c a d e m y . o r g > ) , 
 w i t h   R e s e r v e d   F o n t   N a m e   K a T e X _ C a l i g r a p h i c . 
 
 T h i s   F o n t   S o f t w a r e   i s   l i c e n s e d   u n d e r   t h e   S I L   O p e n   F o n t   L i c e n s e ,   V e r s i o n   1 . 1 . 
 T h i s   l i c e n s e   a v a i l a b l e   w i t h   a   F A Q   a t : 
 h t t p : / / s c r i p t s . s i l . o r g / O F L h t t p : / / s c r i p t s . s i l . o r g / O F L          2                           $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < =uni00A0   n`x$wOFF     $     0P                       OS/2  @   T   `Fr+cmap     4   D ,cvt         ,
 fpgm      b.{gasp           glyf  D    head  l   6   6dQChhea         $hmtx     |   |Xnloca  ,   @   @Xf^maxp          name  0    e-post     H   h9ʳ?prep        dBxex|HgF3YX2c@ۤ)_̼133333333cȲ-F9s(ST*NI"=ҫ6~sS[oRݵ\
6Fܠj;NuщىZN.#j[ɳ`ARULhlUJEkKi]Uz,͏9FXAI<U]"<㍦Em,w(((&^4_9<@=157/p,__$(?\YrgrfAvs	Hus쥗q%Vߘ?/uS
eHР_1q0upHqU)!]Qլ]LA1I'|	gm0!g4"^oX;^9ۍhK\~Ǹa┳J<i^f#ӭҸ_sr;)71

_h5̘;3[sJ ڣt6ԊBđ)\ABvng<6yHc%<ojcrcDB+.f0VXϘ٫׉qǣH~_2~^-a$xM[\X^)mǆi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{r.6cNv.9~Y9Q{k=i}d`cOY_\`r!%iAod	lޮ~)}Ō8<UNv;1(ahF䤫ۏyUv˩tJNН9i&K%,+QQ#lMhמ/gtܒ.%tGاRk#'9Ze:$ȫs$OW.,څm^ZϥWMG,]z}.2eɖ#[|
̚s8|Pq
^/ _y(Ĺ$[2?ucw^E;2LOCb4o$hs[($H=u埱% |DN8x80       `OS/2E=i     `cmap ,     Dcvt 
W }  *   ,fpgmb.{  8  gasp     00   glyf:     nheadcvCk     6hhea"  p   $hmtxM     |locaYK_  |   @maxp   \    namee  +  post9ʳ?  /   hprepdB  *D     2       33'3#2d222  3 A P LE>2+746323276767732654766327632#"'&'&'&'5#'#"&%&'53773
)	%Ln3")"	#\7#6*BU
+6k" N=8":/4}5I="    u ;2+"5476767676554'&'"#"&747676766574"54766763632767632#"'&766323276554'&'&#"1,(M<330&&.
.0b	
	_}b	.P7DaL29*@N3(-,@"V	*)M#]7?YZd
1h
gN


%6,S9!Hr2$*.*?4   9 2+%2#"'&547676676363#"'&767654&#"327662HB/L']5E	L'/-L6/ROJ3/
CQ%8:B`6D>*H,)'xle[pM     5 I @82+"&746656673632"'&5476?6456#0##&&#"367676554%	
kan4c	 XM_@I-^t#N%x`Eh>y")hg#*
!WS_"/N  4 E =	2+&5476672632#"547654#"23276632#"&54767O %IW0SZ +(?,&P$M=Q6
23MEb,rj(D2,7N)%
-D0
W".:NDTG8%,dD   = S 82+#"547667:623#"56'&'#33#"'##"'&5476723276767>4#( R3+5F!*<
hb{{	
1G*D#O &"	%S/
Ff"() N]&	?-@	!$
"T*  ,W V 92+32767676632#&'&'4767333276765#"'&547667632#"547667654#"HG&":"8*.Eq'K<$;G$!HRG,9w-0*(&7 $`K16M>Pe&P	#%
_Lr
'T,4,7j-3v[
1/"#W  # g =2+4#""&7676632337667667232767676#"'&5567##"5767654#"&'&54676?6,.6: #	,[1	wxC,	8+'%#%qD(
%on$.$&.$$B#'+		?Q"AqTJd	$	*4+
p[`77^

	    S @2+%67652767672"'&54767263676767677#"#"547676722633#Jk
%Q3' K"&@'<
$g;^3O%
/??*E";,8Y<[)
	K("5=us(V-	  /H F 2+633#"#"&'&54767632767676677##"76766Gnu	552 .+x;5OM=%?)T@
DJ\$*	0V~$?54G	.&$ 2
<D*X4?	Y" Ge   % _ YH2+632#"&74767676'"5476676"&754&#"32676632#"'&'&&'4&54766763
+05

3+$b	
,0 `%*;	 P4/(P +K,!8ghN	~bQ	1u		i0$Gd# 	8ML99#'4    L ?$2+4654#"236767632#"'&'&''#"5476676767672632#"7/)7[\/%j<#Y6-
2$%.,!+Wg=/F*oGqD*/	
0V		$WQXA-V	3  q l U2+63267667632327632#"'&'&5465677#"&'&'&&''#"&'&54763276767676"4N{-
%
!	N!Z)*$95(%!7'#EA
1&9M$@-G(	
S$WDM078?7	,ı 
  V * 2+"&546763276767676632767667672632#'4#"&'&&'&''= 8&!Q(1E64%./4V	6$(76'
..(.&!:2/2"-b Y	Oz4	
+			7Jalxz-  :	 D 	 2+2#"'&&547676767632327667654&#""54767676WXZ"qDE9-?F/H	RnV2F86;dIL+	!3PlzdKJm)~Z 	hQT0h	 A%}JDDYm+J
J9\    M 92+"&74665667226223"'&54667667654'&##&547>5&%	
k+&+w=&	5>O(Tu$=X)
-o"@I-Eh;)1CA4>
D;%!0!8s!&#*
  r} [ B"2+4&#"327672#"'&547667632326767632#"'&'&'&#"5476?67676676d[\ME-&?-04, aW7QC5`~YADH`B"'l:&+/f\1"
%W44'3X)a{ME]#O-%	'-{upHc#A 
l<,!	"	1M

% 
	X6T  E h /2+"&74665667633232667672#"'&'&'&'&'"5>7267667654'&#"#"&7475%	
yR2RTWh%->!+3) -E]&!&AY"5`5
x@I-7[9H>"@a#(!I	3PNJ:.#7	$%#*
   T T'2+2"547654'&&#"#"'&547672327654'&'&'&'&547676676?Z&F"Z%7I#92kv?,+35e'jH1
	%{G-1
I*#".?;4IR$=,+	BR@4"%-(#.A  "A 7 2+632"#"54767>7667#"#"547667630;gbq%5$:9	cm-r7"	"A]K&RH($&,B   V 42+"547632327667676766727632#"&5474#"'&&5476767654&#"C:<5#=
#$"H?
.	3=
]/qkE9$'?.	D# 4#F(P:!"+40}*$R'zSE&GE+

?.!*Bi/    8 )2+4632367667654&'"546763#"5476654'&'&#"0;+Y
k- .6Ld]	:)y"(SOg	_@+2	D4XXP
+=W-
  
 W <2+46327>767654'&7663276767654&#"467632'&'&'&#"54767654.#"1a+	mYA-E7s4n9	:(y sPrd|		oK"M_%2-	T
HJ_y^8^T0   4  ' i ;2+"54766322767654'"54632327672#"'&&'&5.#"32#"&547676765&'&'&&#D"(b:
	-;!H
'$!2J~n0)$=-
f')2(~
] )!;T[y8	%%JK
	>(SI$
!&)/V7>  q H +2+"5476322767654'&#"5467632#"'&&546276765654'&'&''S3DT2V(/1 ,kL("1I+Q[)
	J5EuH	-"1&#F llNgA(+D	B&dC,F	  %   i ) 2+3"547677#'&547737677#&'&#""546766726326723"'&54''2367667632#"'&#"30/$y e)CM%#
	">-ED,[d/$

*r#<gT3!
/ ?[
"7fh/
!k
%/G	mgzb
,)!	8(O

       v                        4^Ugau_[	r	
G
       _<                 qq            2    M           S ,M ! /    4 : 1 rP ^ ! "re   4  %      q Zq                          1                       PfEd @    8 Z    ^                         0          Z      A ~          ,  UXEY  K QKSZX4(Y`f UX%a  cc#b!! Y C#D  C`B-, `f-,#!#!-, d BCC ``BCB%CCTx #CCadPxC`B!e!CCB C#BC`B# PXeYC`B-,+CX#!#!CC# PXeY d P&Z(CEcEEX!%YR[X!#!X PPX!@Y 8PX!8YY CEcEad(PX!CEcE 0PX!0Y PX f a 
PX`  PX!
` 6PX!6``YYY%Cc RX K
PX!CKPX!Ka cCc bYYdaY+YY# PXeYY dC#BY-, E %ad CPX#B#B!!Y`-,#!#!+ dbB #BEXCEcC`Ec*! C  +0%&QX`PaRYX#Y!Y @SX+!@Y# PXeY-,	C+  C`B-,	#B#  #Babfc`*-	,  E Cc b  PX@`Yfc`D`-
,	 CEB*!  C`B-, C#D  C`B-,  E +# C%` E#a d  PX! 0PX @YY# PXeY%#aDD`-,  E +# C%` E#a d$PX @Y# PXeY%#aDD`-,  #B EPX!#!Y*!-,EdaD-,`  CJ PX #BYCJ RX #BY-, bfc  c#aC` ` #B#-,KTXdDY$e#x-,KQXKSXdDY!Y$e#x-, CUXCaB+Y C%B%B%B# %PX C`%B #a*!#a #a*! C`%B%a*!YCGCG`b  PX@`Yfc Cc b  PX@`Yfc`  #DC >C`B-,  ETX#B E#B#`B `   BBB` #Ba++"Y-, +-,+-,+-,+-,+-,+-,+-,+-,+-,	+-+,# bfc`KTX# .]!!Y-,,# bfc`KTX# .q!!Y--,# bfc&`KTX# .r!!Y- , + ETX#B E#B#`B `a  BB`++"Y-!,  +-", +-#, +-$, +-%, +-&, +-', +-(, +-), +-*,	 +-., <`-/, `` C#`C%a`.*!-0,/+/*-1,  G  Cc b  PX@`Yfc`#a8# UX G  Cc b  PX@`Yfc`#a8!Y-2,  ETXEB1*EX0Y"Y-3, + ETXEB1*EX0Y"Y-4, 5`-5, EBEc b  PX@`Yfc+Cc b  PX@`Yfc+      D>#84*!-6, < G Cc b  PX@`Yfc` Ca8-7,.<-8, < G Cc b  PX@`Yfc` CaCc8-9, % . G #B%IG#G#a Xb!Y#B8*-:, #B%%G#G#a BC+e.#  <8-;, #B%% .G#G#a #B BC+ `PX @QX  &YBB# 
C #G#G#a#F`Cb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca#  &#Fa8#
CF%
CG#G#a` Cb  PX@`Yfc`# +#C`+%a%b  PX@`Yfc&a %`d#%`dPX!#!Y#  &#Fa8Y-<, #B   & .G#G#a#<8-=, #B 
#B   F#G+#a8->, #B%%G#G#a TX. <#!%%G#G#a %%G#G#a%%I%a  cc# Xb!Yc b  PX@`Yfc`#.#  <8#!Y-?, #B 
C .G#G#a ` `fb  PX@`Yfc#  <8-@,# .F%FCXPRYX <Y.0+-A,# .F%FCXRPYX <Y.0+-B,# .F%FCXPRYX <Y# .F%FCXRPYX <Y.0+-C,:+# .F%FCXPRYX <Y.0+-D,;+  <#B8# .F%FCXPRYX <Y.0+C.0+-E, %&   F#Ga#B.G#G#aC+# < .#80+-F,
%B %% .G#G#a #B BC+ `PX @QX  &YBB# GCb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca%Fa8# <#8!  F#G+#a8!Y0+-G, :+.0+-H, ;+!#  <#B#80+C.0+-I,  G #B .6*-J,  G #B .6*-K, 7*-L,9*-M, E# . F#a80+-N,
#BM+-O,  F+-P, F+-Q, F+-R,F+-S,  G+-T, G+-U, G+-V,G+-W,   C+-X,  C+-Y,  C+-Z, C+-[,  C+-\, C+-], C+-^,C+-_,  E+-`, E+-a, E+-b,E+-c,  H+-d, H+-e, H+-f,H+-g,   D+-h,  D+-i,  D+-j, D+-k,  D+-l, D+-m, D+-n,D+-o, <+.0+-p, <+@+-q, <+A+-r,  <+B+-s,<+@+-t,<+A+-u, <+B+-v, =+.0+-w, =+@+-x, =+A+-y, =+B+-z,=+@+-{,=+A+-|,=+B+-}, >+.0+-~, >+@+-, >+A+-, >+B+-,>+@+-,>+A+-,>+B+-, ?+.0+-, ?+@+-, ?+A+-, ?+B+-,?+@+-,?+A+-,?+B+-, EPXEX#!!YYB+e$PxEX0Y- K RXY  cp B  * B
* B
* B@  * 	B @  *   D$QX@X  dD(QX X   DY'QX @cTX   DYYYYY* Dd DD                      d d E E       	 r  	       	  "   	     	  R   	  2$  	  BV  	  2$  	 r  	  4
 C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0   D e s i g n   S c i e n c e ,   I n c . 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y K a T e X _ C a l i g r a p h i c R e g u l a r F o n t F o r g e   2 . 0   :   K a T e X _ C a l i g r a p h i c - R e g u l a r K a T e X _ C a l i g r a p h i c - R e g u l a r V e r s i o n   1 . 1 ;   t t f a u t o h i n t   ( v 1 . 8 . 3 ) C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0 ,   D e s i g n   S c i e n c e ,   I n c .   ( < w w w . m a t h j a x . o r g > ) 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y   ( < w w w . k h a n a c a d e m y . o r g > ) , 
 w i t h   R e s e r v e d   F o n t   N a m e   K a T e X _ C a l i g r a p h i c . 
 
 T h i s   F o n t   S o f t w a r e   i s   l i c e n s e d   u n d e r   t h e   S I L   O p e n   F o n t   L i c e n s e ,   V e r s i o n   1 . 1 . 
 T h i s   l i c e n s e   a v a i l a b l e   w i t h   a   F A Q   a t : 
 h t t p : / / s c r i p t s . s i l . o r g / O F L h t t p : / / s c r i p t s . s i l . o r g / O F L        2                           $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < =uni00A0   XQxwOFF          08                       OS/2     Q   `E=icmap  X   4   D ,cvt         ,
W }fpgm      b.{gasp           glyf  D    n:head  4   6   6cvCkhhea        $"hmtx  l   v   |Mloca     @   @YK_maxp          name      epost     H   h9ʳ?prep  H      dBx]XXκk<ٸC)PZ(ܺߞǯKg}f+k0||!jBO@;Bl([zgO;lBn7gC-|ho{Y6+vtu赚NץYr=zb?2~!Lap_-z")lv>Fc!ZdFVCU`W0`9e^#I`%5Ԯ}bNKi}swL,z*xğjmܷѷ ơ%W?-D<
p)%#[{`֢Vu]ϜK|'`\N*"+`MjX^q\W9uo,
 0$X	PS!\ roA^r֌l*OR޼UdZu3Cn
HUC]^S{sGUeY;w*H3E	[!V	cLoQSR$MmG"2*ڔIʨM(f=`jՀ!+}۔mV[;	-ȱƊncx(DM<lj3tX ,09TKv:~.+AoB2|uNy""QǛT^:@Tg(%k `lwL"Lξ' @S~䫒GvaV"w: OiO?YVrwyZ.^d/=Q19l  ])CjpG|4V#TuwjHE92(e?i9;5prڎLz☮܁c)RD5ۛUv
MKZ۵xή
-.4,(J4EVPڂG$(	a߫O",\U/Uj PPrPiS$SlQ\+ԥaZ2V@h#m3@.4FJg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p$4$$4E* 4$$4$=&&&  
  
   2+'&54323'&5432()v.*&

4*
	   *H 7 A K 
FB?:%2+7327&#32>7#"'#"&5467&547632654&#"&'32654&#"99xDV[B0#
5SFr_cRY4Bk2HD30SV@,@8(m)zV-]d&'&c19uP))53qU@`2@2Y,81-"71xj7+L-<|=,L{2]04"D   P  
  2+'&4632h$!    F[  
2+&'&547667[,VS);"c`VxMUwY9h   iEF  2+556676554'.iT]0:%:'XiUj+*b b/CI   $   2+#67'67&'74'367&'0	<9*)6"/	0
4E'? 7:2+!(!!@(*:%%$&1  8EV  2+!!!7!7m2]2 2A2(  `'    	2+654''&54632vDF/&09[-S
_#%SC  6 B   2+%!7!22   a     2+62"&4<**<**<**<  );$  2+''70'{	|   )    2+#"&54632>54&9cylWm..-`F)3vzQcyMjZ3Cz.(D~   6  $  2+'%32637!5323265654&'a -k`'t*0
K,5  ,  4   2+!!'7654&#"'>32327-&)X-5W#<IcDqnrU#4)62@]A
  $? % 2+%#"'732654'&#526654&#"'632:Tyxa`JHSg(34XF;/,Hdd?`WUHf8%_GJ!*&=1&3(W?56U  :5   2+'5!5727#%3'h^S

K,dP(
>Y.K  A   2+!"632#"'732654&#"'
9Fu:=HYuZGA`hEI74]14Tn=M5(sQ>W)
?   0$  - +%2+&#"632#".54663232654&#"(04U8(
cOSik8V0q{!7$>>[G9q(?UT+:dFY3QX-kΊe<F4#J4>_  6:O   2+#'654#"'7!n
>	
g   - 	  ' 
$ 2+3264&7#"&547&5476654&']T;?Ba"[SrYx]y#&M6MP)c9eBjTk4S<]v[KxL_QnH>>h:F%/D
"H9  =%  # !	2+%#"&547672#56767'654&'32VYJpB{AZ}ԎB^
KL?,]F3h=|Gb:G8Lli	9Ou ;ON:>k  7     2+2"&42#"&46a<**<*H++++*<**<*<++<*   6'     2+2"&4654''&54632`<**<*DF/&09*<++<[-S
_#%SC   /]    2+!7!!7!%
+22  ' 	 ,  2+72#"&46&546632&5477654&#"++++N$He3B^L%F7(xE>)$4y*<++<*-.,E"C7P;d!	/0)W2e&H#!  ; > $2+%.#"'7654&#"'654&&547663226777'G'A-XȰkI/54&E56.(5Y<AY&h395
u |%%*o@i*$
/,II(%7>(+%AaL\jP	Ai31D5eP  8 @ N \ 
VOJE*2+%#"&#"'7676654'&&#"'67654&&547632>2327%3254&#"767&'.#"&;A?U\G0&T:!1$+$:44F^p9[,@_N!hX=gd6Mt[/1c%  L>doH2M'(!UBL$<d))$0=Y%5@"=Q=/ '%TC
gUF;Th/"ZUb:#4P:c#B  G 9 02+67327#"&&''6654&5473277#"'&547669:b*,*(!G,/&>$-9ef+t/&_s/QWi('	/r="
> #?J+VV	6g
RbX[H    : &2+326654'&#"'47632"'&#"'672>54&54>56:.!*:bdϢTEhav[Nn/fA6/l$/:i%3=BN;	7FX-STG:gXSeMxo]M":A[nE   I ? ."2+&''&#"'6654'&547327#"'&5476767327##"''f2Y)$
#'<<Be^<8ar)Ns+h0;$&8!7	K423+Iy?y:gQacO8<>,n(L  m U D2+7.#"#"&54654&#"'632327654&&'.5467&#"'6632327&'"$D'$+-]JHJ,lH%++<1&$
cB7_q`Q)0kLs$2Ha+wC<!&1K>oAG>Q = %6) E;$" 
,WJWt-=p90  JL ( L 812+6777&&'73272#".5476'654&54732654&#"4#?Q!,Br.=p/*(p\`WH?!TZ20ZQC*+=ScVdfR*&)T+#8(h"V&(P)'LIXOFx%R	;b{AnD96	&<K'Tg]JHe		     H /2+%&#"'>32654.547327#"'672"#"'7732>554##"b:&%'#(A30*1*J3*ET7DY%D^].n:36+;%"51.6'#%-8"NE\'`A3M"8! @hG3ss(F!%%>+$&M13   o  3 0(	2+'&#"#'>323266'673254&54767#"'f	o^nB#5D!%8B()/;d &bObOw?AW.$<52<ACd<N)#U<
89-#h/  rg  : .&2+&'&#"'>3232232654&54767#"'&'."'6gnq&%F/11W0*"FS40<MeS2iI%
0"	la5 %/B:fR>#B/-5_E	JG21\@&#H  - D P LE(
2+327#"'&'&#""'733254&5476632&&#"632327677.#"9)
K%oAR4.4eYF/V*/U6j6O!MKnm)gfL7 c8\A4?Z_wJ"m%6UG='9'.Si$>@MGC4I)(.+&v
   B %2+2327#"'&#"'632654&&54766323"&54654&#"o1COa#,C,uv!%QMC123iM"$3H27DO;-/1GG%5)$3KW$ (PR701G,0:/)-     h2+%'4767&'.#"&#"'>	32>54.#"&#"'>3267654.#"'654&5476632632632327327ǳP,9$@AE2 
	
0	0!"W--)+ 
*0F
)D+$6=:9<,Il-ABjgPH6l
$N&%#Lmo4@'J+=-8z-		)"qQC @J.6(5+#	
;@&HK7#=;=$"'o=G?7OFj	<,+V%F-1	   V C2+327'4767"'.#"#"'733254'&&#"'654&&54632>32327\%#P/6FT,>BX2 `hI /#+#A12`Il+DI&0!#X%F-1	mo4D%D(qH^t^
9^+t\Jo/$2=R'%5<DyR@&2:0	  q L 2+467673#"&#"'7>54&&'4672327654.#"#"&(+#lHQLmXC:*<8Y!';<]98EA,DNE!%P 2NH0J"`"0S]@sD5*A6n
TX! ^'&@_$N;>A]4	   ! K e bO+2+'65&#"'6763254.#"'654.54632632327#"'32654&54667.54&#"6 EJ?49#D-2+88< "=#jAgv(
	!$:\*n;DY1s(# 
	
&"*?RPX\4'QP2*;?,,&)$-=F:|2/&! %|*=_'L??5
+/+    U B2+%327&'#"&#"'7>54&&'4672327654.#"#"&5467673E.$2\GdE@=:*<8Y!';<]98EA,DNE!%P 2NH0J"+#lHQB@0%.A6n
TX! ^'&@_$N;>A]4	"0S]@s    W d b[52+"'654.54>32632327327&'4'&&#"'&#"'63267654'&&"'&#"67.088< "=#*Em:Hud%*yY;#2(EI9$43($k3
=[5
,DFf6k);?,,&)$-ED/M:'-'/6&y**Fe(al01]V).~2G95QPPh/*2+   R C 8.2+'&#"32>54&#"#"&5467327>32#"'&547667327#"R<8R#pg,VN0lJ22C]@&XAK6,KZeݛjj~5ix_'@!ICKb0^X#?)=?'/,3L+9Q@\Us[Yj-29!E<Y    = =2+#"'32667"&#"'672654&&'67&#"&54632327y*23XERtt'5Hm5) 7`_:!@L
3ScHS:o%>C;v$(AM&Y.BGHV.@M eF%<0)
D-3V'2  g = 32+%3267654'67327'#"&#"'7654'&&467k[",$>Qj/)/G!4/#7j_r?#8e=5uTq?1/
jL5;o{iH2mg#Bs%#.=cO   H c ]M 2+2>32327#"'&#"'67>54.#"'654.54>32654''&554767"&#"/Kf ,C= \$.K8ZN09u3?O0v'4	"F/-288< "=#+Flu%,H* 2KT@'2
6Q+4_'J.K,>5>(Q	)?=*&MP20;?,,&)$-EA-WX;;)<AGgl    P g  
|lbU>2+"'654.547663267>32327#"'&'#"&#"'672>54.3267>54.'23254&5477#"&'&&#"0088< "=#(UHk`R+ +1W!&|%,)3''"PfKG61#5E3t:Q&'GRU#K""/%!)+!*&3-6D3:<2i&;?,,&)$-%<MD:C/00%'.B  H$'M{!	'K;0T/PP/%IF+eK)'"X>7*1G4!+_8J@%)(.=78>^   C B <2+&'27&#327#".'#"'7327665"734#"'6767327C@->,0@+\,S8#K.V!(@-iX- XQ;2D.4A)i9$)DiPta~)B@@/Xd:+SP1@
84%b05Q5
"\8!%FRRAt)"    *o Z #2+"'654.5463267#"'732>54.#"327&&#"'6763267654'&-088< "=#m2`0SRMhe?2$nIk:#	0C,;JF%#MSQ),=Md< +2Q+n.;?,,&)$-Bi*7(USn5ad=YmB#.I107'S6*5:d+GCd*-uF%  vy J E2+722#"#"&774&#"'63232>54'&#"'76654#"#"'67730LoS,=+/Ǡ	'
(.#
gV#,C*
-X)B8HbJ$	A0,$%Cq).	3K"0 4HG'J%QX=+6B*  $~  	 2+3"3⌌Jt.g   |  	 2+'527&#578Iy	    H   2+''( -  PK  # "	2+%&'&54767727&''"'2q24Rs0NB4	&)7Z4Pp)@'sx$EB<:?o.%8 )p B4   V  $ !	2+7&'654'767&'654܎/\mR.p7=*2-!'R5%Z%13xbY'9.pmNG+P<k)GJ|/   W  2+#&'7&'&5477N
6<<)jE@BJ`0e(L6*S$.D8J[9k  x '  2+654'.#"'67&'&5476-;L24Kr,)1>t:XdQ,(]H@
-5R0:4S-9*45!*/5729{!h4>6P\:   P    2+%&'&547676'67&'	yLFJW83	)Z09<lN*-E<0VZ[
I$*
>(#0a   % # 	2+3#'6765#573&'6632#&#"yq(	aIVH*6I(&^'oa"9DU&cD]2R>"\  0  ! - 
-' 2+%3266547'&547677#"'547&'~Ɗ'r]tQX(V$*`jl&]IY5%SK(hs]L'cRE&)'H2hPOBJ\
/PV335  X5 * '2+67'67654'&'&'654'7674\=QKuY=16!0D(
k04%BFEjWU=DBmJ!	 A4<* $8-)ۗzn	LAO  G   2+%7'654'''67327&,7kI
&'_)8	[%)P.V!PRS];K?!$]LM+I(K  1    	2+7'67654&54654&#"7&'7$1cu? /%Q8Q~e]L|aQ' /Y+	22I,H   ! $ . +%!2+77#734'767673#267'66732654'mQD<Z5"O;9R`ZD	Ɓz 2))s&KK-)R98D!T&m?Ds`@&-=2   d;  2+%&5654'76727;@IP/	"VnLdH2'	
/LV   @ 7-2+73277&'654'&'&5654'&'&'654'''767JF	
"F_")=.79x;
J=7r)$.$*SC_,x_!NZ8F&	(D0)+oG<"4?"DIVP6g2V"AESJS=<V6bb!".9,'   ` ( 2+7&'654'''76767&'654'&'=p1
+7KL2a/!6c:"J>CZ5Y<]& )9$`s-4!Q?@W*T   k    2+&'&54767'654'&'V<kdKgj=TJ"12'r|9?.1RF$ip6#4k,?: 0. ! + &"2+'7667"'67&'677&'654'&q75U"*
$H;GQ,<22YD
J/'')N&(4E&,*`9*Ivl%B!I#(5HEN    W,   2+'65'&54777&'674qbB;FkR>+!;)
mlg!"fj
+gT!3
)9!   - 2+'7&'654'&''77327#"-.
Z-P,Uk	HN'$W<	
j,:/c;;[>[		.  1 ,2+"'67&#"'7632654'&#"&&557327.`	;`"	yK\>&0~-x
+B!#1dB)8,+;*D5*%Lc]-$/*g&!   /  	2+67&'65#5735733:19RC"kgJ&o1&J&e'  	\ $ 2+73277'&'654'&''774ry2@QR6a4#G##RC,	q
Exi!K)$Jl0T^4h3l/#$  8"  '  2+%&'654'&5477"32654'&2G	*e>*&=MPl3+%m1^.#Y,>Y=124<\$'=++(   7/% 2 D =3(	2+7&'654&5&&#"&'654''&5476767"32765&&;MOiIG(3m7%;)DnAQP4~!JrdKS-0)B*@$*+@]?PF2k.^'K#:%J%>>-&3S   D / 	2+%'&54676554''"'677&&'27[*]K-.l"\p**O8" GRoI3<7"?['+_)b
N:$[8K'&#a    <"/ 2 *
2+'67>554'&'&'654&547>77 ]hN$2.;,_="1[CC?<q(h4&
KeE7A[	7\H9
5V%,)]&  )y  ) & 2+"&'67&''7654&#"'67'654ZHdk)\\#78Eh0D @:=},28gp*:n
A&(=A8"; CIO}$,BC+W6   5   	 2+#"&54669&
"9*&U!1_$C+   9    2+'>54''&4632O	&
"9*%1_$C)  @ w )  #>54'&'&#"'67&'&5476)1-${l
^6~/6SD
7	#{7'1"gD:#Hc!/*+f98BCLF-   % '  &#"3#'6765#57354766327l=%:!yq(	aRQ+!d+Y$'oa"9DU&m,.B
  %   3#'65#5734&567327"'y}8bS%CE4V3?E'myU&pP5%V%  C, $ /  #"'73326654'&'&547677'7&'B$nPB
a:">#43ZS PS()1Ec+/({y@D"uW#E-G{]*
)5W21*   *  3#7&'65#5734'7677."{k-,?r6<<J;MQ[v>'-"?&6#3&4
L3$.vH")@  #k \  267#"'&'72>54'&'327#"&#"'6727654.#"'654.5476,GcF)^RV-iOz]4
D:&=;.E'0<E]#-$1/k^4-#>(0088< "=#[N>6U(2GԌ(n4C9Vyi<[-50xP+
96LCR !7T,&u!BN;'*;?,,&)$-%  lp >  '72654&#"'676322#".#"'632326654'&'&#"'\BN7M3*EN:71RAmK>A\pBK
"i>4943B$l,+h?9.7)"?69.Cn	47_N_-@?-D7D=@GZ4/*('	
       _                         9 c  :pH|]}Ng
@@		n
%

]FaH`x7y:=iD[vUUvKW      R_i1_<                             2    M     ] p  
g *  P  iH $} 8H `} 6H aQ )Q )Q 6Q ,Q $Q Q Q 0Q 6Q -Q   7  6F  'O  8 G  I  JS            R S   Q      $ N  [ PN V WM P %S g XK L !Q d  a k\T W  /M 	\ 8 7 M <     5  9K @ % %Q C      Z                _          1                      PfEd @  	 8 Z    ^                       p       " ; = ? [ ^ z  	     & = ? A ] a  >WU                          ,  UXEY  K QKSZX4(Y`f UX%a  cc#b!! Y C#D  C`B-, `f-,#!#!-, d BCC ``BCB%CCTx #CCadPxC`B!e!CCB C#BC`B# PXeYC`B-,+CX#!#!CC# PXeY d P&Z(CEcEEX!%YR[X!#!X PPX!@Y 8PX!8YY CEcEad(PX!CEcE 0PX!0Y PX f a 
PX`  PX!
` 6PX!6``YYY%Cc RX K
PX!CKPX!Ka cCc bYYdaY+YY# PXeYY dC#BY-, E %ad CPX#B#B!!Y`-,#!#!+ dbB #BEXCEcC`Ec*! C  +0%&QX`PaRYX#Y!Y @SX+!@Y# PXeY-,	C+  C`B-,	#B#  #Babfc`*-	,  E Cc b  PX@`Yfc`D`-
,	 CEB*!  C`B-, C#D  C`B-,  E +# C%` E#a d  PX! 0PX @YY# PXeY%#aDD`-,  E +# C%` E#a d$PX @Y# PXeY%#aDD`-,  #B EPX!#!Y*!-,EdaD-,`  CJ PX #BYCJ RX #BY-, bfc  c#aC` ` #B#-,KTXdDY$e#x-,KQXKSXdDY!Y$e#x-, CUXCaB+Y C%B%B%B# %PX C`%B #a*!#a #a*! C`%B%a*!YCGCG`b  PX@`Yfc Cc b  PX@`Yfc`  #DC >C`B-,  ETX#B E#B#`B `   BBB` #Ba++"Y-, +-,+-,+-,+-,+-,+-,+-,+-,+-,	+-+,# bfc`KTX# .]!!Y-,,# bfc`KTX# .q!!Y--,# bfc&`KTX# .r!!Y- , + ETX#B E#B#`B `a  BB`++"Y-!,  +-", +-#, +-$, +-%, +-&, +-', +-(, +-), +-*,	 +-., <`-/, `` C#`C%a`.*!-0,/+/*-1,  G  Cc b  PX@`Yfc`#a8# UX G  Cc b  PX@`Yfc`#a8!Y-2,  ETXEB1*EX0Y"Y-3, + ETXEB1*EX0Y"Y-4, 5`-5, EBEc b  PX@`Yfc+Cc b  PX@`Yfc+      D>#84*!-6, < G Cc b  PX@`Yfc` Ca8-7,.<-8, < G Cc b  PX@`Yfc` CaCc8-9, % . G #B%IG#G#a Xb!Y#B8*-:, #B%%G#G#a BC+e.#  <8-;, #B%% .G#G#a #B BC+ `PX @QX  &YBB# 
C #G#G#a#F`Cb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca#  &#Fa8#
CF%
CG#G#a` Cb  PX@`Yfc`# +#C`+%a%b  PX@`Yfc&a %`d#%`dPX!#!Y#  &#Fa8Y-<, #B   & .G#G#a#<8-=, #B 
#B   F#G+#a8->, #B%%G#G#a TX. <#!%%G#G#a %%G#G#a%%I%a  cc# Xb!Yc b  PX@`Yfc`#.#  <8#!Y-?, #B 
C .G#G#a ` `fb  PX@`Yfc#  <8-@,# .F%FCXPRYX <Y.0+-A,# .F%FCXRPYX <Y.0+-B,# .F%FCXPRYX <Y# .F%FCXRPYX <Y.0+-C,:+# .F%FCXPRYX <Y.0+-D,;+  <#B8# .F%FCXPRYX <Y.0+C.0+-E, %&   F#Ga#B.G#G#aC+# < .#80+-F,
%B %% .G#G#a #B BC+ `PX @QX  &YBB# GCb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca%Fa8# <#8!  F#G+#a8!Y0+-G, :+.0+-H, ;+!#  <#B#80+C.0+-I,  G #B .6*-J,  G #B .6*-K, 7*-L,9*-M, E# . F#a80+-N,
#BM+-O,  F+-P, F+-Q, F+-R,F+-S,  G+-T, G+-U, G+-V,G+-W,   C+-X,  C+-Y,  C+-Z, C+-[,  C+-\, C+-], C+-^,C+-_,  E+-`, E+-a, E+-b,E+-c,  H+-d, H+-e, H+-f,H+-g,   D+-h,  D+-i,  D+-j, D+-k,  D+-l, D+-m, D+-n,D+-o, <+.0+-p, <+@+-q, <+A+-r,  <+B+-s,<+@+-t,<+A+-u, <+B+-v, =+.0+-w, =+@+-x, =+A+-y, =+B+-z,=+@+-{,=+A+-|,=+B+-}, >+.0+-~, >+@+-, >+A+-, >+B+-,>+@+-,>+A+-,>+B+-, ?+.0+-, ?+@+-, ?+A+-, ?+B+-,?+@+-,?+A+-,?+B+-, EPXEX#!!YYB+e$PxEX0Y- K RXY  cp B * B
* B
* B@  * 	B @  *   D$QX@X  dD(QX X   DY'QX @cTX   DYYYYY* Dd DD                      q q    00  )0     	 r  	       	     	     	  D   	  $  	  B,  	  $  	 jn  	  4 C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0   D e s i g n   S c i e n c e ,   I n c . 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y K a T e X _ F r a k t u r B o l d F o n t F o r g e   2 . 0   :   K a T e X _ F r a k t u r - B o l d K a T e X _ F r a k t u r - B o l d V e r s i o n   1 . 1 ;   t t f a u t o h i n t   ( v 1 . 8 . 3 ) C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0 ,   D e s i g n   S c i e n c e ,   I n c .   ( < w w w . m a t h j a x . o r g > ) 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y   ( < w w w . k h a n a c a d e m y . o r g > ) , 
 w i t h   R e s e r v e d   F o n t   N a m e   K a T e X _ F r a k t u r . 
 
 T h i s   F o n t   S o f t w a r e   i s   l i c e n s e d   u n d e r   t h e   S I L   O p e n   F o n t   L i c e n s e ,   V e r s i o n   1 . 1 . 
 T h i s   l i c e n s e   a v a i l a b l e   w i t h   a   F A Q   a t : 
 h t t p : / / s c r i p t s . s i l . o r g / O F L h t t p : / / s c r i p t s . s i l . o r g / O F L          2                     _        	 
                       " $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > @ A D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ]  	uni00A0uniE301uniE302uniE303uniE304uniE305uniE308uniE309   :fx3wOFF     3     L                       OS/2  )\   V   `FTcmap  )   e   cvt   1h   "   <=fpgm  *    b.{g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A M 
GB?;	2+%327#"''#"'&5467&54632654'&#"7327&#&'326654&#">.T &='E=KNp7>EYZI'?/SG}&$-&8~)j	CY^HMd>*+s>%?<#;<7>VAS6?<Hj4(D+4	8O+$+0&T;cIr';16$':   D    2+'&54632X!   qE-  
2+&&'&54767-GS)5Wgd"m?\~SB   VC  
2+55676554'.V(B+N"
4'W4RoTO/Nf"b1?I       2+#67'67&'74'367&'(.&1'.&(&,,7!(0?$$#"$?!#< (?  .J  2+!!!7!79(/((6(0  C.    
 2+'654''&54632nBF'#50W0S	&$S   .    2+%!7!n(   M  w  2+6462"M'8''88''8'  '@  2+''7{ x   )    2+#"&5463254&NuYQ[~LQDqhNbT[.{I{Oy  .   2+327&#"5327654'&&'&#'2+
GHyVlb0`,*p\3p/-f   ;   2+%!'7654&#"'63236
qd1"R
gK*=IB^Q!10Y=)U   &J ( #2+72#"'732654'&#"#5>54&#"'632MhbGHB1OZ&%h:8"6+2RG2FVK`)#hJD&$"/)7%N91c  
@    2+67#'65!534'#|@"WN!rU[[."	GofN   /H   2+!"632#"'732654&#"'	?BNhX|I3:4-NeC>92P_NMj+eL>T7M  -  & #2+&#632#".54676323254&#"	SM]Y`BTZ2M+DBvwzxX:%.9HWHcCW.KU-`B|W<V   %K  2+3 #'6"'!7)uI VpV
   (  & 0 
-'# 2+3254.7#"&54>7&54676654&'.3M7x*<Jb'dMf60%tZK#E,HX[4:b(#&6F+;YvZM%>2!M]BP}c;H)3BYI  J  # !
2+%'#&&54767#52765654&'32gX=V[3&vFsdI<OR-/F<>fHrP\3&7
0ΧsdI<1V
_6?k  2  	  2+64632#"4632#"2"!!""!!."".".""."   0B  	  
2+4632#"'654''&5476320"!!/"	/"y.""."?23X!E"   6 q    2+!7!!7!jjI((  -f 	 . !2+64632#"7&547>54&#"&54632j!""/.*C+#=%2 CwA9H=5(.""." - @+F')K( $(,:NG9&3<+4     O 
2+2674'7327&'&#"'7>7654&#"'654'.546676632,+0#"/!>T*?p*%+bI*E#E0@	/s5Ig?+0TEa`\Qd	Yp4bh(U 8iJk6)' -(F$,3*&9bHc  1/ = O ] 
YSI>! 2+"&#"'767654&#"'6654&&5476326323672>7&'&&#"232654&#"9$AN|e9-4Y{(*+3Va)Qfd+%YQ_g_{?/(
% W#
%u:#4<mH+$K0IQMKKnt,+pJ<-4D/3VC,jSB?XG-8W?yH2,o*RZPU5H^B  ;e < 42+67327&''67654&5473277#"'&5476 E	I,56I/)!1APV.V0`$.ZO+WY14Q		#U 	%@2G 
!5xDU0PW/(>YN_VC   < ) 2+2>76'&#"'476632#"'&#"'672654'&&54p:Z5Qv&*EZK>U0HjITn7?Y=83&E:f */?yS?+
 @ EZL>kT/2Yw#8PK:2.%%<Z  V A 7+2+7'&#"'67654&547327#"'&5476767327&	f!,C;". 1BPW=a6Z+'TT*[J FK,s&ED>.	&*d6 ~DU0PW<,:TS^WE 14Q
#   em U C2+7&#"#"&54654.##"'63232654&&'.5467&#"'6632327#"'pz)+1Wc;9!P3!=H#	Y<zAZ 	dX(ga :	B  ).9%u*&;+(p:]W<B64!U=#^?I&*/]$JZz55?Y9'+  B ( F 92#2+632#"&'&547677767&&'7327'6654&547327654&#"E-8]0#A'T,WK p
53?,%<D6O'50ASYaV6El@%-^%.Et[h.'TZ]?$K--k*,3@#2`	B,#z@S/SY,9s>UX%,  { C A&2+732>554#"&#"'6632674&54732>7#"'672#"p0("	JQ
W8!%B,-e<D

o2f14IlnG+&+k@%#/M5'aE5&"i4(+?6+)5b<	l41>(mL>5`P`u     6 3*2+.#"'663232'>732>54&54767#"'
JQ:(^5+NA,n"*\7*(.HDA;ep*6E+sh5>+C$:>!0P*;7."p;e0 u
  8 .% 2+'6632327&&#"'63232654&54767#"'&'.#"EY5FE%@w)j#)8lV2'`4778R#"*RF$
Gm55 >P:G/,T893NB
#;-/U ;%%    H U QI.2+2327#"'.#"&'7332>54&54766324&#"6323276767&'&&#"z!* W1=!+/P`6%9
(;'dA6hHGb~R"%
B59+'GA\LFC6Wp''/ z5B>#!5!b~(-6DGOA=> 2
8m    D !2+%#"'&#"'>736654&54766323"&54654&#"3276u181a$#1
0]*T|Cx<.7Q
Gc_P%\^PT
0/$JQsC@33B8$eD%    2+66326632327327''4767&&'&&#"&#"'632>5544.#"&#"'63267676554&#"'6654'.547>326X.F&j1!@/ 
(9 0J3@{.I9!8%
H3"% ?6!@YE/4#C8&!3,S'0S9(3S-F)2)	!/?k &m~5K1*&(RH&+h&fUD9!+H(*x5*j:OOZ)W(3!++?-

*&/3"#O3   > _ 2+67663232727'747>7&'.#"#"&'73327654&'&&#"'6654'.547632U*4+
)/%**@
"RG+//8	$'*#?!d\C8&!3Va5U#$$.#'$&<E+i`	B0Z<Tv"A&'*X!)Gl+?-

*&/3VX   T 2+"&5466733#"'.#"'676654.'.5467232>54.V2&
Fa3[sTL&<$/,$1
N8F`#$R2I"6O*!?LT!

.JT5M 5>,6#
*	4_"3- ";%2Wc:Ol8   %$  i 52+332654&54667&'&&"6632327#"'''65&#"'>3254&#"'6654'.547632#J#"/b 5FB$#(B&$.RKxHv	W8	

)3VHf^C8&!3Va3X}

)#!"0N)&+-<\3<3Gv'Q*eU?B		 *2ZG!h+?-

*&/3VY   [ ZA2+%#"'.#"'676654.'.546723267654.#"&54773327&H4RN&<$/,$1
N8F`ftP*8Z!?L3V2:
AF
Fa3["+"(uf
% 5>,6#
*	4_"3- "GM	*:3BvOl8:.JT5R?  :  h +	 2+677&'.#"'66323272327'4654'&#"&#"'>326654'&&#"'6654'.547632<7*<!3b>EyY:,4@#0@3r5) !#(6I+(?",5YC8&!3Va2U\	K32)<8$E@J_
-G%UeuDd#Ne5*(:2w};)+,g+?-

*&/3VT   8 A 2+32632#"'&&54767327&&#"327654&#"#"&546S0#%:PCoEK38lX0) 
:}$0TqJ_|3/B9"'(8B6+I<KxH%K3IlZ#
Ka/r]\e3/S8N *%+A    A ,2+%&&#"'676326654&'67&#"&5467632327#"'32_^L$'/L
5E
!-ueNR<Z%@30"El2,;/E+F:.%+%+(!a(:k%F;884 ^b29.@(:'VA%6ZD$7.>?%-   8 2+%#"&#"'767654&546723267654'7327r.&
P,%eg9
UUe#$Z
!x~@+Z.&?"*(v!>A$1,p:R#EʐZ
L8//H2k   :  Z 12+%32>54&477"&#"'6632327##"'&#"'6725&&#"'6654'.547632z]26]2(Jj!!

*!p5*6,%-8#u=Xk/E6?AUGd\C8&!3Va7VI":4(D#UE		(78h% Y3')TU5@@G)XG!i+?-

*&/3V^     + z 
M/#2+7"&#"2327654&54327654&'767>32327#"&#"#"'&#"'6732>5&&#"'6654'.547632;j#;<5 12DWIUF:5:9	#4V?,#-I"l1.	:)'J,@?;'@8C5L)UGd..C8&!3Va1U?EWB%bHE*S#"C)(DF9N3*S=9A$[%,.B$K>%%,/u>"'%;A40T]7XE;7+?-

*&/3VR   D '
2+767327&&'3&'327#"&'#"'732765"734'&&#"NL,9 f<65%.] F1+?o#AP*;0?!3";54/Hu;%<(A@,Ww6/:7$L*+V]:+ZkJ*; +6E5/H*G$,LR  % _ '2+4&#"'6654'.54763267#"&'7332676654'&'327#"'&#"'6726aVHe]C8&!3Va4YkZ KA6Q+LC
>(,:!C+4&"8Btj+*		$G<(.P#W4YHj+?-

*&/3V[:k*(2P}Ry##G&7 A֒Q:,d\40	)":%LK  u B &2+76654&#"#"57332632632#"'54&#"'63232>54&#"+=c.rEE
N3= r.Pn4,#N<!1K(XG1*5?i>
*`
((uiE6:~w[&)!@3%3SX.TL   x 	 2+"3wwk4'xb    	 2+'527&#57vwx'4kw       2+'''   A  # !2+%&'&5477767'5'"'32I*-+2C${-5Y6[-8=v[j"ef[.-nIIL4,')B  V  + * 2+7"67&'654'732>54'&'x(Y3A4aT3O!I WW"fF3K %00y_T,KI݌MQ%>8H)  Hg  2+%&'&5477&&#67g2</=4	CA'B\y+FK;Y8g(O#q9*;'  d ( "2+%&'&54767327654'&#"'67`*U/.=	2e.2Xe
mA2-(7rQ2/!;#T-
OBB)6IN`  Fl   2+72677&'&5467&'4#"T.HHEJYPP"NR6=/ne:397'E1J*+<VQ<;'-   D " 2+'7654'#734&5472&#"3"2YIeU'/
 .32r_j<XZ9ԓL#sPG(\E/(_%  /  % 0 
+& 	2+67'&547677#"'%32654'747&'3SHC_+GH\G[g#;`cPD"(p	v:#HYD#ec.8(.U~sETCUP5%;R`-YP8'   L: ' '2+7>554'&#"'654'76367@
1'!=6R7u8"'m*J:j7l[D#$1MK[aLX4\5nM&dG[UR     2+'6727'654''7&'66727##7D69!,
)q)4%Ep*+844L5V^O	<&(0  6    2+'67>54'&&#"'7&'7C^6
j*:(=,RL)nfTw_$0}<19#  k ' 0 -(2+%'655#734'767673#>'2654'^"kF	>	Z(7$z<V_!1,+H/+n[_#K'F
3H7S:,[#!#>) (B6   a   2+67'654'7B
39aYkLrN   @ &2+76767&'654'.#&'654'&''654'''7?9Q0V#~3% V)O=%S1+o2xc&'7(.
9ry 
k@M)
	!)I-=:)*	/FP8?hT]2   	 + 2+73277'654'&'&'654'''632?			7*;A(W#f'ol"VN~	pT/SLW,	6K'?f8bZ   B    2+&'4767'276655&'DNbMGz8]&::&-H4?2s_N"c\D)A}4$G  * ' 2 1+2+'65"'675.54767&'2654'&'P	&>	S.3[-I93/n @,C9

$P	#.
"H$I;?k.	s61)R  ;     2+'65'&547677'6747&'SEiTq44)FQ<Z$-
o8B^++z`>* 	0l|<d@5    ! 2+7327#"'7&'654#&''7m'; 3IY)>	&e "~WG7
1&6*h @;oy
]   4 %	2+77&#"'>323254#"&'477327&'32{ j6O1'2	"!!%#Q4fQ.\h08'&L;/!M,	'6j`
:)X6f.N.<!=   ]   2+3#327'47#735lZ>/aZIF~#7 cSa#   -  2+327'&'.'654&&''77654'((F4&M+'*&o eXg91@'8I$3
X&+]0;CRNR  3  ) (2+74'4&5477&'672326654'&'`)P.:9+<O#7#7Z
.#P4"g'Bier-1M#,HQ)6=  , 5 H B6+2+7&'654'&#"&'6554'&&54767"3254'&>@DBJ	$/K 
(P.R)7IOR->0pg$'b))2d* ^RF13$4:K6@[.=+#P4 9(#!	J '*%I&.  
Dr 3 12+7&&'3677&'&546676554'&#"#'67m1C)!7? 4=I1@q#	#&BGxY #;*!AN:"i$&9.((	(??'1T6H#!	'9?  -% / 2+7&'&&5477'67>554'&'"&'6Y(P.J)	v:&> !"."C-K J*"P4 j,^\i y+ zZL	Be38>0/9K7C  ):   - (!2+"&'6767&'57654&#"'67'32654"6bL*U@.I"2AIIfQJ&Y (6I&ct5.)X1UC -5I341W7OH%;63mA=   -   2+#"&54667w $4%11	b%F%&T"   ,    2+'67674''&54632J)#$3(L#9
b!1 6  I  +  &'&54767.547'327654
`*I$'!O9_Z%'B2%JN`-A2-(7rE(RJ
#+$;#J03:8#T.
N3  #h $  654'&'"'67&'&54767;G+Cn7D@4'ExI6+T7-[8@8M..q*W8+,l8L799``);   S    &#"3#'65#73&5463227SG!$@ugc1\OK-'S#5i#}"9"Z.6j  D %  '>565465#734&56727"'3+]M#>.0C';6t_H&)S-M:8::"8A!K###  3* # .  #"'7732654''4&&547677'747&'}!/fI'
Z5/>Sd=1BFn[O,5G_07-1%u`.%tLE!(A&SLd	2_=>6  ; "  327'65#734'76763&#"3<F\?/gYe$)2p_1#`Vx#eNL
LeS('79x#  \B   %&#65#734'73#327\^YISuc@=TiR'#d0,Th#8"   +  327'&'&&'654&&''77654'*(*MNP*&o cZvw"I:$42I$3
X&+]1.>e2n    `                         ; d  <rHyWw#Un'	d>`	2	
C
@QCx&o9ehh8j,{2:I{2X        =!՗_<                             2    M     ( Z  	 1  D q V  . C . M ' ) . ; & 
 / - % (   2  0 6j - t 1e ;@  Vc  B* (    @ ; < ; < = 8 ?   A Z  x   A V H  FF  	 L   a   B  ; M    3 , 
 -     -  , I #M I  3M N      Z                `          1                       PfEd @   8 Z   ^                       h       " ; = ? [ ^ z       & = ? A ] a   >X                        ,  UXEY  K QKSZX4(Y`f UX%a  cc#b!! Y C#D  C`B-, `f-,#!#!-, d BCC ``BCB%CCTx #CCadPxC`B!e!CCB C#BC`B# PXeYC`B-,+CX#!#!CC# PXeY d P&Z(CEcEEX!%YR[X!#!X PPX!@Y 8PX!8YY CEcEad(PX!CEcE 0PX!0Y PX f a 
PX`  PX!
` 6PX!6``YYY%Cc RX K
PX!CKPX!Ka cCc bYYdaY+YY# PXeYY dC#BY-, E %ad CPX#B#B!!Y`-,#!#!+ dbB #BEXCEcC`Ec*! C  +0%&QX`PaRYX#Y!Y @SX+!@Y# PXeY-,	C+  C`B-,	#B#  #Babfc`*-	,  E Cc b  PX@`Yfc`D`-
,	 CEB*!  C`B-, C#D  C`B-,  E +# C%` E#a d  PX! 0PX @YY# PXeY%#aDD`-,  E +# C%` E#a d$PX @Y# PXeY%#aDD`-,  #B EPX!#!Y*!-,EdaD-,`  CJ PX #BYCJ RX #BY-, bfc  c#aC` ` #B#-,KTXdDY$e#x-,KQXKSXdDY!Y$e#x-, CUXCaB+Y C%B%B%B# %PX C`%B #a*!#a #a*! C`%B%a*!YCGCG`b  PX@`Yfc Cc b  PX@`Yfc`  #DC >C`B-,  ETX#B E#B#`B `   BBB` #Ba++"Y-, +-,+-,+-,+-,+-,+-,+-,+-,+-,	+-+,# bfc`KTX# .]!!Y-,,# bfc`KTX# .q!!Y--,# bfc&`KTX# .r!!Y- , + ETX#B E#B#`B `a  BB`++"Y-!,  +-", +-#, +-$, +-%, +-&, +-', +-(, +-), +-*,	 +-., <`-/, `` C#`C%a`.*!-0,/+/*-1,  G  Cc b  PX@`Yfc`#a8# UX G  Cc b  PX@`Yfc`#a8!Y-2,  ETXEB1*EX0Y"Y-3, + ETXEB1*EX0Y"Y-4, 5`-5, EBEc b  PX@`Yfc+Cc b  PX@`Yfc+      D>#84*!-6, < G Cc b  PX@`Yfc` Ca8-7,.<-8, < G Cc b  PX@`Yfc` CaCc8-9, % . G #B%IG#G#a Xb!Y#B8*-:, #B%%G#G#a BC+e.#  <8-;, #B%% .G#G#a #B BC+ `PX @QX  &YBB# 
C #G#G#a#F`Cb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca#  &#Fa8#
CF%
CG#G#a` Cb  PX@`Yfc`# +#C`+%a%b  PX@`Yfc&a %`d#%`dPX!#!Y#  &#Fa8Y-<, #B   & .G#G#a#<8-=, #B 
#B   F#G+#a8->, #B%%G#G#a TX. <#!%%G#G#a %%G#G#a%%I%a  cc# Xb!Yc b  PX@`Yfc`#.#  <8#!Y-?, #B 
C .G#G#a ` `fb  PX@`Yfc#  <8-@,# .F%FCXPRYX <Y.0+-A,# .F%FCXRPYX <Y.0+-B,# .F%FCXPRYX <Y# .F%FCXRPYX <Y.0+-C,:+# .F%FCXPRYX <Y.0+-D,;+  <#B8# .F%FCXPRYX <Y.0+C.0+-E, %&   F#Ga#B.G#G#aC+# < .#80+-F,
%B %% .G#G#a #B BC+ `PX @QX  &YBB# GCb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca%Fa8# <#8!  F#G+#a8!Y0+-G, :+.0+-H, ;+!#  <#B#80+C.0+-I,  G #B .6*-J,  G #B .6*-K, 7*-L,9*-M, E# . F#a80+-N,
#BM+-O,  F+-P, F+-Q, F+-R,F+-S,  G+-T, G+-U, G+-V,G+-W,   C+-X,  C+-Y,  C+-Z, C+-[,  C+-\, C+-], C+-^,C+-_,  E+-`, E+-a, E+-b,E+-c,  H+-d, H+-e, H+-f,H+-g,   D+-h,  D+-i,  D+-j, D+-k,  D+-l, D+-m, D+-n,D+-o, <+.0+-p, <+@+-q, <+A+-r,  <+B+-s,<+@+-t,<+A+-u, <+B+-v, =+.0+-w, =+@+-x, =+A+-y, =+B+-z,=+@+-{,=+A+-|,=+B+-}, >+.0+-~, >+@+-, >+A+-, >+B+-,>+@+-,>+A+-,>+B+-, ?+.0+-, ?+@+-, ?+A+-, ?+B+-,?+@+-,?+A+-,?+B+-, EPXEX#!!YYB+e$PxEX0Y- K RXY  cp B * B
* B
* B@  * 	B @  *   D$QX@X  dD(QX X   DY'QX @cTX   DYYYYY* Dd DD                      P P    --  )-     	 r  	       	     	     	  J   	  *  	  B>  	  *  	 j  	  4 C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0   D e s i g n   S c i e n c e ,   I n c . 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y K a T e X _ F r a k t u r R e g u l a r F o n t F o r g e   2 . 0   :   K a T e X _ F r a k t u r - R e g u l a r K a T e X _ F r a k t u r - R e g u l a r V e r s i o n   1 . 1 ;   t t f a u t o h i n t   ( v 1 . 8 . 3 ) C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0 ,   D e s i g n   S c i e n c e ,   I n c .   ( < w w w . m a t h j a x . o r g > ) 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y   ( < w w w . k h a n a c a d e m y . o r g > ) , 
 w i t h   R e s e r v e d   F o n t   N a m e   K a T e X _ F r a k t u r . 
 
 T h i s   F o n t   S o f t w a r e   i s   l i c e n s e d   u n d e r   t h e   S I L   O p e n   F o n t   L i c e n s e ,   V e r s i o n   1 . 1 . 
 T h i s   l i c e n s e   a v a i l a b l e   w i t h   a   F A Q   a t : 
 h t t p : / / s c r i p t s . s i l . o r g / O F L h t t p : / / s c r i p t s . s i l . o r g / O F L        2                     `        	 
                       " $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > @ A D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ]  	
uni00A0uniE300uniE301uniE302uniE303uniE304uniE305uniE306uniE307     Iox3gwOFF     3     Lt                       OS/2  )   S   `ELcmap  )`   _   |_cvt   1   %   <fpgm  )    b.{gasp  3         glyf  D  %e  38-head  '   6   6c&Bhhea  (      $Edhmtx  '  #  -loca  &      THBmaxp  &        name  14    b7post  2     *prep  0|      hJʜxڍzXu^B 1\ C*J)rm鑖wYw\]_U3H!s=) 5G0DhWvB_x	^'[ˈ	kDBRGȒEe7#)B\302(MEK"f6ʀ;J\y#GK?*,xX(j6~i6m_@`?REfۄXPE%Ej7ڗ	JDe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ɨ膴!_t&/"bՏ(B|]q-eBz^p<@7lJɏr$E,{	](#M5c5VKuO2%^W%=U!Y`Op'"f $.cۇ^j[FnzmuQwAdRPs(n8]p75T͐d<k#?#6^Fh[]YdINJ8܀I$o`*fdY+=rQ
J릁w/dP\PC-j 3ڇ	/<	#vʟG@Md.ݝs#C`	@rBsmu}4%=w~M P}4DNky1˩ _QE( B}$b@!@GNؤfj `8E!cڧ8t1 J8S^fcOHFeB'g GT/SbȺFTMLHa@:E.'ghfi)uj6sayi,~8 SERdx	*8$2U%AD 6Ah"z>#phpy,L沩e
*RbH^!i]NlIS !HMUHۚC!H
<BL  xz\/L?%Ӊ;  7#nȩٞGKk#U3d=dY5R[XeWx8T:ms8!HXXM^tR{aZkx5d
sE#[`CTaì}k(h~?Jn4͟^ l/|a 3L隅,"@]h殓t߈  0@.cY&!SkL߼zS/nfMJ 7AB1v)X3 A3jcAF4N88ЩPϜ
֩pd`MٚJ`)3_6	(4S
K/ﱋT{
شsh-\WN~
ӪbecWh~Bt446I;hl!0NͬJePW8kPaX:Z(-d2*wO%FF4Z:E(Qߒ2puޕl@R0i=Շ0ƈ
JGv	h d`gp6ޢr(UOVS2#6YI4uhAaet0pt?|	Fg{zmSu*[6.	)9%4l{+PYTsprqW-!)F@<A@@!,EcbXDGc?X}7	O.<k'lj_^:`{^;QNd\z_M}1'uK!N l8xw7       `OS/2FR  D   `cmapyD    <cvt s     Zfpgmb.|    gasp     Ȁ   glyf     LheadeC     6hhea
      $hmtx- >    \loca'/  X  2maxp  8    name^%z    fpost\  d  prepe       2       33'3#2d222  Y    2+4632#"'&463"&Y1!".671&#//J0u ,!r%0/$%0/   &I  7 '2+4632"'&5476766#4#"64632"'&5476766#4#"&.%26	L
@	$.%26	L
@	$<H2O8$_<	-V		1H2O8$_<	-V		   @>} a q kc/ 2+"&544#'&54737>74#'&547!7>7632337676763233#33##"&544##4##337>R]]	+!	N`a%(N]^hg**R`a**f`a`a

JGkxKFKFJG   @ N X b 
]\VOD2+2""3255'&'&5467633533#'&&546776&'&'##5#&#&&546544&'32767'	#\1"H9$>)h& 	 /Pgs&'>Oa%_?8)'%srI2<De43!a!*%$mL743eP!'vI/^^P:	   A} / ? O _ @
YQIA91*2+#"''#"'&547632327632 #"547&#"327654632#"'&547&#"32765422RLZD0660E)'UazI*50FE)$ZD06*a "'+06dc60=V1ef (N@0=6V+06dc1ef (N@  0D M [ i 
g^YP<	2+&5476672637677#533273#32676553#"''#"&'&54767674&#"76327'&'&&'&X>!*"W,j
:K F	jV_ )!1!631	>Z>b`
WcPmB4 	&Z+,D5X=NYX>R		D.% 5HQo	:r/>>/=->#(	
/@06F>*"5)#7/M<Q;H Fi$   JI  2+4632#"'&476766754#"J.%26	I

A	$<H2O8$\;	/T	  g  2+66732##&&'&54lz^/N^zU?43ȧ>؃'43  >W ! 2+326233#"547676'&'&'&I^z}+'hv>؃'34'͆,   I1 A   2+"&5475#"&54763'&546325&5463267632##"'&'!!o{|	o o{|	o1iT#
,,"TiiT#
,,"Ti   @|=y " 2+632!#"'&55#'&5477!54J	(Id	  J>    2+74632#"'&476767>#"#"&J/&* 9		*&/U&0!#B;2B/		';2   >   2+75!1pp  J     2+7467632#"'&J'	4!	 U.)-	   ?  
2+632#"&76 			e.   -  - "
 2+32#"'&54>76&#"327674654'&
&#9..S<t?'	1$6+7Fv:hIp\6j8D}2+ +.mJo"8  P     2+!& #5354###532773238HL>>8>   9   > (2+#"'&54766323276746653!547>767654&#"+#0d@F6<+9AK7@	
>Sbr0
I< %+(%'/%3BC9.;,+ct75;K  0 G 2+4632#"'&5462327654&'&'"'&546726636654&#"#"&PsOTuP%!fqA'.L.((A2'
$% +',3,!"+DT<9
p20+0HNA'7$00%09987J5,'5$)+        $ !  2+!&#"#535!576?22323#3'p筭YYYڔIn>]>>]>\   9 K C*2+72327>54'&&'&#"#"'&5567763276#"'"7667632#"&'&546!*3'94!P*	GTON	Mw/>esCf	+*!6*%(%'7	[T^99q_cqA2 +   0 . B ;0"2+&#"6767632#"'&54672632#"&54&#"32765&&+E#|: !$Q?y<8l% *$	7@L+  =*^/M6E "[UT!(& +!=L5+wI$   @. /  2+"&54767677##564332323  'mNc>"	
1"	.	)#	ZB	H}E51  0 % 4 C 
<5+&2+6632#"&'&547677'&54654'&#"2654'&&#"a^@+R.<	.>~_Wx
	J
H9W!?G>J%.M+-6
.$46%\6JU=7# ?'6T-s+8L'r,.%\,<:>   0 , A <1 2+732767675"#"'&547632#"&546322767654'&&'"!,"
'A+fb7M+'@OG\& (!09'';$y:w=$<PU&D?*' *r/=4c+N 
   J     2+4632#"467632#"'&J1#2!	(.'	4!	 ED3)-	.)-	   J>   . 2+4632#"4632"'&5457466767676##"J1#2!	(./%	$3,

&$ED3)-	H1
E3?t*	&-#  `L  2+##%$'&5476$$3632		EB	$	8			
	  @ m=    2+&5476!!&5476!!Wgg0ggM
		&  `K   2+"&547676%&'$'&5463 *Sy			U^:G		   A  3 ? <62+"&5476632#"'&&56767654&&'&#"463#"&<'jI2B8	>!""!1&#//%&/' 476 -@(!'!&&!.QD.);%0/$%0/   @A P ] ZR#2+%254&#"327732#"&'&54766732#"'&&'##"&'&547632332&#"327>u$$5;;J,,2^u,=}	V-)>2-9*j^07.D
$Xw"eUS:QH$1:-Cb11   (  < . 5 2/ 2+!&#"#5325476763233#&#"#5325&''#3377'&#(we	4444-,
,-Tf42e>l	>>877>~  '    ) 3 
/-%"2+532#534&'&##36764''#3676'	Ut?0>+l)$^\RS	`Wiibc	[p>L@` !8C#j>2o/9t  @ = 62+66323762"'&'&&'&#"32767654762#"&'&54BժOBL.<('8F66F]0*DZ$? !A
6`QAAQH/1WDZ  '  1  $ 2+53#53&##367667654'&'7HJql0KFOZKM-p>31Z:>2_V$"8Z   '   4 #2+66753#5&&'&'#326767653!53#5!#5&'&&'&##P=,>>' Gc_"
>+llm>
=DUF&:)*	&$M7>,>PQ	  '   * 
 2+!&#"#53#5!#4'&&'&##366753#5&&'#3ll]>
3/ a@;*>>*;>,>	,;?'88'>  @M R 2+%#"'&'&5476763232762"'&'&&'&#"3267655#5332626633##&&'8gr4>xJMS@	L.	?,'-F""F(?1)PB.8JRhTd'&	? !A9\H#gg#H52>>eT	   '  \ / 
 2+!&#"#53#533273#!5#533273#3#&#"#53!3lll#lllll>2>>>>>>>       	 2+!& #53#533273#3rrrr>2>>>   * 2+73276655#53326326633##"'&55462D0)
Q+02B2r%@A>><w=&!++!  '  T C 
 2+!&#"#53#533273#677#5332626633#"3#&#"#5325&#3lllE	 jtk
30./
{$#*l>2>>>>d\
&EB>>$>   '    2+!53#533273#327676773ll05W)>>2>>	B-d  '   2 	 2+!&"#53#5!676677!#3#& #53 #"'#"3:	ll
Yp3=Yllll>2>:t:>>>R>  '  \ * 	 2+!&"#53#532 #53273##"'&'&3:	llnl		l
l>2>F>>>  @  / '2+632#"'&&'&5476&&#"32767654R`1Mg'-bTSbw!!w*
$#
}OdQCsUggU$A6 '

' 6A  '    , !
 2+!&#"#53#532#3&'#36767654&'&llֶG$
1oe_l/NKJU.
>2>l 5-H>n<55   @?% 4 S ^ 
\VA62+%2#"'&'&&''0#"'&&'&5476673232546&#"2547663267654'&&&#"32%:(E#".&$r10m%I0K1+0!)34">2
;s )(-3U,EGQC[l

$RIk3
J%4Bc}#?
H1,  'Z ? N EA.
2+!&#"#53#53232676762#"'&'&54'&'&##3&+3676554'&ll!D#C0,5'/
.D:lk"S&<DNS	>2>K+5Y-#@0?4'8@@>1 >XW0  @> T D2+%2654'&&'&&547667363276762#"'&'&&#"#"'&#"'&&5476672Y7<HB[cFb@
dR2<'@V+	"sG6x364J#kI!$;F/KV1.-"_B(/l-1YmLN  )   % 2+75!#5&'&'&'#3#&#"#53##)>
28,,82
>f"!>>'!"f   'M *  2+273##"'&'&55#533273#327675#5:	l	rQ'll	LKl>dsj3=>>
A9	>   K %  2+3273##'&&'#533273#76677#5Poccl3lcX_`2_X>BB5>>t1>   P  2+32626633##"&'&'&"#"'&'4&&'#533273#"77&'#533273#"25#5v"[t<	-pp-
		<s\-->>\--e>GO
y#y
OG0>>`6'>>`>  !  C A  2+!&#"#53?&''#533273#74##533273#3#&#"#537&'33Gt
A@cc.8emI:;y--t	SR>tl%$FNMM-.>BP>>TR>>qqY&>>cpij>     Q ,  2+!&#"#535&'#533273#774##533273#3]lm{kK.XXX%&
sdkl}m>բ>>F>>>  @   3 !2+67!  :332676765433! '&547 34#P


PL"'}CN|j;d;   %   2+3#3hh==   ?  2+&632#"'4 @ȩ	.e	      2+53#53h==n  ~  2+7#"''#"&~"<??<":|z1'&&'1    >   2+5!>=33    . 3 A =6"2+!".'#"&546767354&#"##"&'46322%2676655# #(6\Jh1+O06"%!%c\<$	+>9^1(

4E:#;!95'$9/>#`w	y-m  X  , %2+7633632#"'#'&##5&#"3267654 [[FWey8/:QWD1N;1)A,=)}hBb#;-->7+5.(HP   ' * 2+"33276632#"'&547632"&547#&'B/&2	;aHZ=`>Cv%@&STLSA	
4;)<g;Ed!$%    &a + = 9-2+277333##"55#"'&54766763254'&##5&#"3277_[[1 ]?
@H8cL	U<1?1G+"F.%w1>#FV%__>1B@+116	     & 0 /(2+632##32676632#"&'&54&#"3w?Z*SY
>E%;
4<Il_\/.jZ	NK& 5"i[uB~4   (   ,  2+!&#"#53#53577667263"&547#"3#34{m	ECCnN:(:()4rlV>@>;;
:? "&%2'96>>  7. J O _ r @
jaYQMKA2+7&5477'&547632632#"&'&76"#"'3 '&5476670'"&"327654'"##"327654'&e#'*7lI0.7$	*8sB.WaT\&DD&$
	(E
 / !1K_*,/.#
'9:'5#)=%5
GM, 88,$:66&66 >&  %  o 8 2+26337676323#&#"#5354'&&#"3#&#"#53'&##5((TFHE	pn	E3H
E	no	E1	208>> >/	nm>>>   (  & 
 ! 2+463"&7733#&#"#5354'&&##5H1&#//J0ZZ>gm	Eb%0/$%0/|>>> 8 
 . 2+463"&73#"&546323327655.##5h1&#//J0<u:T')
9b%0/$%0/@K4.)&L	>     K ; 2+763367#5332626633#3#&#"#537''3#&#"#53'&##5 [[h4	jV;:8pH[j	89EkjE1IT+>>0	0G>>GHn>>>   (  -  2+27733#&#"#53'&##5+[[E	ml	E1>>>   %   R 2+633763276323#&#"#5354'&&#"3#&#"#5354'&&#"3#&#"#5354'&##5(?og
7jFJ
E	no	E3H
E	pn	E3H
E	no	E1US9G08>> >/	nm>> >/	nm>>>   %  o 6 2+633676323#&#"#5354'&&#"3#&#"#5354'&##5(&cFHE	pn	E3H
E	no	E1+*?08>> >/	nm>>>     ( ! 2+32#"'&547676&#"276654&	(-\M$2b9d4:lwB)v
*%Uo	&;Y?EU";JC>"">C@9  >X $ 2 -&2+763327632#"''3#&#"#5354'&##5&#"27654 [[CTdv@ClD9	E	no	E1#F-)~$)$~@@">>>J+4D,Cc  &>a  - %2+%#"'&5467326733#&#"#53'275'&&#")<.b@@raG/	8E	pn	E|Q19&>:-)*>;ifu
1	!(>>Q#0bLE]     * !2+ "&54765"3#&#"#5354'&##537362>%
A
W
|m	E1$%'~\W>>>$$G*   & F 12+7254'&'&'&'&5476327732#"'&5&&#"#"'#"'&&467632d.6CG({3.	
4-e3eeL%

<.>&	#>*">	Z"5Z
p-)   ~{ ' 2+533#3276553#"'&55#532766>'>3&{J! &m>	7$ "%%5U3X  %o < *2+7733326776745454'&##566333#"#"55#"&/4'&##5(^_
$$6
11;PLS/+ @m>3)4>  D ,  2+3273#"'&&'&&''#533273#34674##5QGF;3.	3;Fcp	053g>(-s%%s-(>>vs>   % R  2+32626633#"""#"&'.'"&'&&'#533273#677&&'#533273#"3677#5pU@c43(cA`l	0,,$?	Xb^09>>>,E9<
>>>>mm(1Y>>5By>     J @  2+3&#"#537677&'#533273#3277#533273#3#&#"#534&'3]T	`#$BFSah	#"$#%\T	_4=@U))ah	P+>"!**QX>>+*,)>>=HQf>>c2>  8D 7 *2+367677&'#533273#"677#533273##"'&54632#T7$9tFdo	i40QGFhl$<"$L#%Df4-%>>4?t>>CA#       3 2+46553236766765433#"'&5476677###0+8%$AB*5<10VUE   F Q )2+2632#"2#"'&/<&455&'&&'&&467667675446<576cA"""$D6>&E..E1"g="*# %()
"*"*" g    
 2+"'7632
*	
  F P +2+632#"'&546767665476676325'"'&'&'&&'&&56N?)
E..E%?b$"""AD5(/ "*"*"
)(0"g#*"= %   ` Y ! 2+63277#"'&#"'&&''676 )"#
>" &)"#
>W#	F#	F   f c k ie 2+"55667237654"'&546763374676672#"&546776&'&#"32##32676632#"&&'''&#"36QQ9 *8
$ '|R+3#(%7>*,		3-;/).
`?:)
?2'1&G^$>O/2<qS	$MQ*'4M%@	  `   	2+#"&54763462#&&/ ".< m/B./$-D.-#:N".."$,-   @ =s  	2+6!!#"'&55!%&54T('qpp
       
2+632#"'&544&#"&#"276We3%9"$$R77+&		  @= '  2+&5477!#'&5477!57632!#!WII
	JJ#	#	   1  2+5333#5363254'&'/
(T*3:5<3@N3/  )   K R ML 2+!&#"#53767#5!#5&'&&'"'#367676553#54'&'#32767676753!535#33#3)xg43'&@|>9JJB$.>>1-$=Y!5!>,Q00,,#56G>]w]>WL	.U	"'i>vv>i    0 '2+"547677'&'&54767676'&''#rttutttuttttuttr	rstwtssutttuustq   @= , = K 
FA8.,2+74#"'&'&547663233677#"'&'"&##277&&4&' 327662 ; 0.w`G.3xJ gRHH+Bt0w+D2"O1BFViTPW*LP ^O**U%\RV`%Yj#y#H   4 N  2+7"#53#535476632#"'&54632367654&'&#"&54767654&#"#"&&"&e	EEEiL3.
hr\4! /%"
W(.T	
>@>>H08]	-##
F\e !  46NWi/-F     @ I [ 
WLDA 2+4327632##3276632#"''#"'&5476735&'&#"##"&%"354'&327654'&54&@nA?]bi
KNI
5rhH3^."3JL&%! &k)+#5#'	bc1.meOME	L6+_2!3"(;''O}:)! % 	&
?   @<U   $ 
!2+4632#"&&5476!!4632#"&X<+,9?',:gf29-)=;+'?*<?',:>
(>9-(>:    +   . : 
80+#2+277#"''&5477&54764&#"37632654''4"1/##* !	d\M$21%##+ !m4G3W
XU'?@3%;:77@Uo		;;77C}Y?RB	="QO @n[	U=  (  &  2+7733#&#"#5354'&&##5.ZZ>gm	E|>>>  Sp D V OG2+#"#"&'&547673233#5&'&'&'&##36766553#54&'&'#367667653&&"3267654p*7S	'U.N6>#(aB38(#>>#(83NTLF>	1p+>CU8U94~**\N\&	20

02
MN70" aS:#/   ] ) 9 B 
=:3+ 2+"&5476327632##3276632#"'&#"3276747"354'&$u>oGDibi
KNI
5r{EEoU
Kekym8/~;;meOME	LEE5bJCZ$:_4;~}:)!  8 # 	2+73#"&546323327655.##5N<u:T')
9@K4.)&L	>   ~  2+7#"''#"&~"<??<":|z1'&&'1     2+76776"&A@@A\2:WW   P_   2+5!PCC      2+2'&7676676)
IL2.
.%(>9   rR  2+46323'&'&r*98LI
z,DE(%   f  
2+26753#"'&&5538I3`;<W3FB=.	;GfE	&3   J   2+467632#"'&J'	D0%5	b!,A%0/ 31    
2+632#"'&544&#"&#"276:We3%9"$$R77+&		   `( ! 2+63277#"'&#"'&&''676 )"#
>" &)"#
>#	F#	F       2+&'467632&'467632!$'94!$'94
}(*2+
}(*2   '     
 2+!&#"#53#5!#54&&'&'&'&##3ll=>"5B5>,>Y#>   6     
2+633 ! '&76 76&&''37rcbtR	+wjqqm		O&Lع  @=  * 6 
,+"2+6632# '&54%&#"3276765453353#5#p-q2
J g] >7_R	#"	~>>>MZs)0[OFViUsD-  -Du""""  (   (  2+!&#"#5367676323#&#"#537''3q_[	[-.LLJL.->_>>>  0    " : 
%#2+74 ##54'&'& #"53!53#5!&'3 7676765536	6j>B>>>
>*		9Jп!!!! 
	:		:	
   '  \  
 2+!&#"#53#5!#3#&#"#53!3ll5llll>,>>>>,>   @   ? 2+! '"15&546772&'&'&5476!!#"5&'&&'&##36367677433$qQAIHPT%uZsn_',	"d`LVS	}z&,W  @  = 7 "2+663256767632#&54#"3#& #5354'&&'&#"#&@ZALv1`!CX.P9DD9P.,?Nrc}
S:	sN>>Ns	   @   ) 6 A 
<:+* 2+!&#"#535'&'&476775#533273#3$4#"3%4&'"32766aL55LL55L,"!*
6=
*!>j=-r-=j>>j=-r-=j>2432	|>4
	2  @  = P & 2+!&#"#535'&'&'&'&&547623255#533273#727667676762#"3


z-	0
0,	-z

x*(*>j6
F$h0>>rXJ$F
7=55>   3   Z =2+7&&'53254'&&'&5476763236767676753#"'&5476767654 ##X">
1'CDi(,BTVu7]6(,'1
>"ll%%ll3#	]eOpE<eBN2B#3	A](.%%.(]A	    >,   2+55!>33     },   2+55!}33   :I   2+#"'&&54767676320$"S	
A	$H1	C*vS/T	  JI  2+4632#"'&476766754#"J.%26	I

A	$<H2O8$\;	/T	  nI4  7 )2+#"'&&547676632#"'&&547676632)2#"T	,	&/2#"T	,	&/%0	C*vT	H(3#%0	C*vT	H(3   &I  7 '2+4632"'&5476766#4#"64632"'&5476766#4#"&.%26	L
@	$.%26	L
@	$<H2O8$_<	-V		1H2O8$_<	-V		   @- P 92+"&546763236'&&'&5463227632#"'&#+"'&'&5464>76'""*	!-	*""*	
		
	*~"!@!#*!@#6#;B"lrrl@   @6 F  wU42+463254'&54632767632##"'&'&#"'&547654##"&46245&'&4632767632#"'&'&#"'&5476744#"@$!--$"-!--"#6*!-+##*!-*#	,3 "* 3,"#,3>#*3,#::!9>"*9!:"9#*9   J    # 5 
1(2+7467632#"'&%467632#"'&%467632#"'&J'	4!	 '	4!	 '	4!	 U.)-	).)-	).)-	   # !K3  	 2+2#"&'&547676'4
;*32!
"     &54632#"&547677#'&547
'.%$%	   - ]  537#"&&""&#&54676676323#76323676766332#"'&547654&#""&547Ph
AI"	8L%c.E%	%5<6+#>	', G3CBC+Y:v+/"':2$7%"  @ C   2632327676762"#"'&'&'&#"#"&'&547676632#"&'&'&#"#"'&'&'&'&&567633327674&'&'&'&54IN,@"
?.Q$
z@0!2F

dD\!/^6j/
d
	H"2.)32'bW1_5LK3 "%#$.,8.0
*0I26GbI;2I62:
->'	A$3	$+   A M  632327>#"'&'#'&&'&747677547676764#"7676a
=4,U	:R	>@@/#,@7V"E#d= FPBW5$	E%$ L6-CK1EO$*+`qf   H. P _  %232767654#"#"'&'4&5477&5467632767632#"&542654'&'&1%%H%Hvm&$_<)>dF	$6PoUY@Zh/:G##H"A;@_ 0"k$5G
R@O'/e3i7+5/ #[v6.C9Q	2!G  *8    7463232276654'&554'&#"#"&'476267657&'&5463267672632762#"'&&'&&55##"'&'"'&54765545'#"36767665&;	3
	
W$*	.K:V8'I6Xs
  $'1	1B
h>/$J)
>Uah&| '8)Tx'*1-+#3-6LDc?mr% 
"D118~?$	p*<L+3  @~ y  6632347654'&'5476632#"&&''#"'&'&'&$#"#"'&'476327654'&'&547677'&&'&''54J
$.'
		#'			O	
$	 (EMJ5
	1
L!A3[	&/!

"*	=72A(/#/	(6M:62   @< %  !"'&'&&'&5476676763'bbk
wXXw
:$ZqTxxTSF'
  ?1 /  "&54767667>76#"'&''#"'!P}	zQ'b>

@a'tOPr#I^^I#   A= /  747!%&'&'&54762#&&76767!%&A!7$uUUu
:bc$BURzzRSF  >1 ,  74632763767632#"&'&&'&'&'a@

>b'Qz
}PM#I^\I#rP
Ot  @= G  63!7&'&'&672#&&76767!"'&'&&'&5476676<
:$T!=
uUUu
:Yk
wXXwSF'
$IPRzzRSFZqTxxT   1  I  "&54767667632#"'&''767632#"&'&&'&'&54632!P{
	zQ'b>

>b'Qz
	{O'a@

@a'rP
Pr#II#rP
Pr#II#  @>< ;  2##"'&' #'&&'&47654'&5463276	\vnGL*)#	!3
GCcN	
E_t=B$# %VI
?L`I		!9   @>= 9  47"#"&54766 77#"'&&'&54676327632'&'&?/\4{D@<NgEB
3!	#.
O	j$:!K^L?
I   A = ;  4632 3'45&547676'&#"#"'&47673'.'&&''&Aw#	!3
GAdP\vnGL)*&VH
?L`I		!:	
E_t=B$#   @ = 9  767632 2#"'&#"#"547654'&476676ƒ
\{D@<RdEB
3!	#0d~
Oi$		:!K^L?
H   A= :  632!%&'&'&54762#&&76767!%"###"'A	w!7$uUUu
:b$BURzzRSF  @ 4  ##!"'&'&&'&5476676763!6654&'&54,?WP5ebk
wXXw
:$)66)"L>);ZqTxxTSF'
(%&+   A @  !%&'&'&54762#&&76767!%#"&'&547663}7(!7$uUUu
:bg.OR7!")6j#,$BURzzRSF1$ +:+   @ < !   '&54>76767632'J",?
J7I4  @< !  !##"&'&'.5476!'UU
@+"J6H7J   A =    747!%'&'&'&76332!%&A
?,"H	4I7M  @= !  6! ##"'&767677!%&54T	H"+@
UVM7H6   @=   B  47!%'&'&'&76332!%&!##"&'&'.5476!A
?,"H	UU
@+"J4I7M6H7J   ?=# @   632!!!!##"&'&'&'&'&767667
)
IJ)59,jk+!
	L9;k57/"
&	1<
	I	]  ? >  "''&'#"'&#'&47676767632'&'&'"
'!$
&>(
BK
(</{,:4)
  !$	b\$!&   @># @  47!%'&'&7676332##"'&7677!%&547!%767>77'&''!%&@II
)	5ki2$	
!+jk-95)j/7	]	#i2?	
<1	

#  > O  >3236767676".'&'&'&'&476276367677,2*R


R*61
'!$
#$G&&G$( 	,:4)  /N# M [  62!'&'&'&762"'&767677!"&'&&'.54>7676&''!!67l"4"	Z`)	"!"	)`	Zs;,*C%AQ:,!2C!?
"Z/ 

 /Y"?-"&	&'62    I [  632#&&''767672"'&'&'&54763"'&54767676&'67677X_b$<aab$<_U%"#+#
G3		H

H3	 	F$/(!z7	,    $  4632!767632 #"'&#"7%.X)$
ϑ!'HITg_N	pJJJY   < 5 K  266765&&#"32#"&54766732#"'&5476763276767654'"'"n5<	G@?)2 dM)gt(QSo:5XPD[@/@C&(*4
.*>@)!/	EW~m2D[\63G!'iB<E/(=%X&SS  @ > #  4>7!5#'&547633!&5477!#"'&Q
/[
	|	    . : I ]  2#"'"&'##"&5477'&'&&5467663276776&#"36732676764'&'4&45'
6);K1:(


+a@'./+(9
'.T%$5

'./y#
0ncv4-5~6'6_`7s + V,r  7    &7!#&'&'7'279
;
\]
6
\0fCU4Xx   aK 8  74672263333"3"'&&'&a$9nrvLo\@urkzhgG>aa)   `K :  632#'&547736767667654#'&54773254'&&'&'&''&54tlvqUVU]	ojruKo\@trIPUtuTZ		hF	>a
   `    7&5476!!wGG
   @= *  6!!#!##"''5#'&5477!#'&54TggJ	
I	#
   ?   632#"&76 			e.   ?   &632#"'4 @ȩ	.e	   I  G  2667632"##&&''"&'47"#"&5472677&'&54633&56632R-;	?x	-9&-;	?x	-9 ",	#*#"*m	z",	#*#"*m  @     62#"'&54764&"2
dvcWb=@s&VTUzd^p;;i6ژVVV  @    62#"'&5476
dvcWb=@s&zd^p;;i6   NL5 &  2 "'.##"&5476762 7676ji%&
Dd6
5L	f
$$
   A> 4 I  267632&#"3272##"'&'#"&'&4766763&##32767654'&^K]!(#	^E6>I
uX:R.0Lo]D_1@
2C;2	
^E6Çc
9^EU''LN bIBBYy'Q;?X^E%  A< ( > S  632767632#"'&''#"'&'&54764&'&#"32676%&#"327676'&'&'*hWm#H@I[fR.*Wm#J>I.*pN6
*'QA5GF3M		8S
N#.hU5Jye.7_	Um.0e.7`P=8>\	S>M5(B/a.k>P  6   $  %!&547&7&76 7632!8	FA


PJ	     
  "'7632
*	
      #"'&7633>32#"'




+*
   @\   "&5476 763#"'&_		

7d5)-		jfQ   @\   4&5462667632 "'&A	5F

	5	f-	   @[ ,  "'5456765676332"'&54'.#"r(
wDG|
(	Ol@zH80_-USlN/A/%7   @\ )   2"&'4'&'45547632327676547(
	dxJ8\0OYXPlNEG0%7  @-x ;  #"3276676767667632#"&46325&#""&'&54632&	4	4G0!*('(&	4	4 8I-*'*:)H3\65R60 ():)H3\C@ 852 (   @ m< (  7"&54676323265632#"'&'&'&#"V	bF	/5"?=/-BU	iV32"?=..BUm\	53dI]53eI   @ G +  46323#"'&546767654'&&#"&@FL0

 ,[) -		1	bN3Z< )K\',$C<X/5'   @= > Q  7"&54766323326765632#"'&'.#"473:6:3!!V	eG9H+
5P=/%+FR*#
5P).78A g0AX.;*(
?c5:*	*  @=~ ( 5 A  "&54676323265632#"'&'&'&#"&5476!!&5476!!V	bF	/5"?=/-BU	iV32"?=..BUgg0ggd\	53dI]53eI
		&   @  = + Z  2#"'&'&'&#"#"'&5463232765462#"'&'&'&#"#"'&5463232676546&kT7[M%&!3QkO6]=C#F/!
_C4\K(&"3QkO3`=C#-P-Od5+."Od5#'05C5*."Od
7#&  @= % G  2#"'&'&'&54632327676"&4767676362#"'&'&#"	(rv--.-vr(		K	(
,)us(	
#"	UU	ll	g	V	ll  @ m=   *  &5476!!&5476!!467632#"'&Wgg0ggC'	4!	 M
		&.)-	   @=   /  &5476!!&5476!!473:6:3!!Wgg
0gg).78A g0

*   `9 ! 6  %##%$'&5476 7632&54673:6:3!	s	Ci|}g !?Z
%*24;G7	
,	!3;<0		   `9  -  7"&5476%% '&463 &54673:6:3!	J				
%*24;G	{					   @=j  ;  #"''&$'&5476 7632#"''&$'&5476 7632				bg				bJST		RST		R  @=j  ;  "&5476-$'&54632  !"&5476-$'&54632  _
W		W
W		t										  `J *  2#"'&'&%&'&'&54767>7676WM|=$	-c6i		ʲ+J
hE<K
!H6t		M@-:!  `J &  4632#"&54767677&'&'&'`+ʌ'rWM|:U=W !:-@M:!
hE<.Eh   `K -  7467:62333!"'&&'&`#,8FkY	VR" bB&-SwcIE  `K ,  63#'&547736767667654'&&'&''&54tkVSsFkY	Ia).uUN	bB&.Sw
   `9 - A  467:62333!"'&&'&&473:6:3!`#,8FkY	VR" 5$(0198ibB&-SwcIE,   `9 , 8  63#'&547736767667654'&&'&''&54&5476!!tkVSsFkY	88a).uUN	bB&.Sw

  @\ ) H   2"&'4'&'45547632327676547473547633##"''5#'&(
	dxJ87HHHH\0OYXPlNEG0%7GFGF	HH	   `9<  0  7&'673:6:3!!!473:6:3!!'+46=R:'+56>VQ99*   B9  '  747!!%&473:6:3!!&&5476!!B'+46=RYVV7',	   F  \   7#"'7676!!"'!
"!&
	   F \   62!&'7632!{
*	
C   @|<x   ( / 5  746732#"'&'&%#&'#!'&'&!7!3$@3fU`}u h=
}c&%)S: |M/!{!   @|<x  ! )  746732#"'&'&%&&#"!  677!@3fUV4	6&%)S@rEd  @|<x  " , ; E  746732#"'&'&&#"7'67%&#27654'&'3277@3fUGOykN/:ij#BG009iii##iOhxP
&%)S ;00:hҕiFZzYF/:ihi1C]^Ci/;  @|<x  $ 3  746732#"'&'&&#"77& 326764'&'&@3fU5Ohf%#BA1Ohe###&%)S,/VJFZzY<1/WJFH   @|<x  # /  746732#"'&'&%4&#"3262"&5467@3fU4@>b>7)&%)S<31=A.)>   A  }   3"'632!##^

			  @  ~   %"''5!&47!5762~&

&
(  @  =   %#"'#'&54673:6:3!#
).78A g11  A =    2!!&54667!&J0	I	12     "'76326!!!!!
*	
>g>>&   2    6'&&'&7667'67rd-7cCC
c-6dBB  J  P   74632#"&J0"4!	'/!4)-	2   & 6  4656276632"#"''#"&547467'&54632&&./_	
(C.L
	/
]W+*	=*	^   !  ' 1  %4#2#"'&$'#"'63226$7632"2$54&'c=		M.VU2NXbY;.z11ay/;g-  J   # 5  7467632#"'&467632#"'&467632#"'&J'	4!	 '	4!	 '	4!	 7.)-	.)-	.)-	   J P   ,  74632#"&%4632#"&%4632#"&J0"4!	'/0"4!	'/0"4!	'/!4)-	2#!4)-	2#!4)-	2   eg  # 5  467632#"'&467632#"'&467632#"'&'	4!	 '	4!	 '	4!	 .)-	.)-	.)-	     "'673226:33#&
~ml  =   #"'#'&547633=
ll~
	      23#&'&o  =    2#&54773&K	   A l< "  7"&54767632#"'&'&#"_7<<0't'BC'q7lH*|l-	]K  @ ~=   &5462! 7632!"'&'&C10RA\'  E      7&54767632 &&''&!7['_	d	=GtS=##  !    "'632  "2$54&'?		@	bY'		g-  D.  $  363! #"'& '&5466"#!7[bf}GGYt	;)pp  !    #"'& '&5476 76324#2		@			=c		   A-<  ,  6 #"'&'&'&47676&&#"326764׊8ML9݊NN1)ܣ+*ݣ+Ruu/PXQ/uu`~X~`z|EEz{E   @= ;  &'5##"'&547675#"'&'&547676767676632	2()2 U	Z	:-T1/E9g)4G=	KB??B"!w..KF5@'7FBX,Q9HST}	   A< * N  63267632#"'&&'&'&'&'&547"76767654&'&#""'&&'&}5D`3 =H94Q= )P*-	-)P* =<@(I<08	
7N'm+&?X	4	G31D	#' ;!
QL )A!8,+8"@* LQ
!l2ZF*QM5&-,-,?'mf9QB1+>	  @f< ) B  632#"'&'&'.4>76766&&''456767&'& 6hh6  6i}$
z
x n9Ij
jI99Im	
		r
2|   ] H  &5476632367672632#&'5##"'&547675#"'&&5467632BRpQRpQ'Dc'*C"y2()2A;#>VK78*u:`E`_F`:+mR@57KB??B)$hFEg'  @}  )  632"'&766324'&#"327676~<,<M:?	
t<V@6	YPXT
8#kd  9! % 0  66323>76#"'&4#'&764#277?"v}/8ggh
7;j>111   ?~ i u  ".46547677#"'&547677567632766775467676632632#"'&55'&'&554#76677R	"A		"A$@	"A8,
8;			AA J;	
BA	8;	8;C			&% .2		&%    ~   2#"'&''57>76_	a``2		16
	7y=  @?   %.54632#"&54 'L%
Y``Y	_XK	  @ -  %!"'&'&&'&5476676763!236!!'bbk
wXXw
:$9GZqTxxTSF'
  ` 2  7&5476!!%&'&'&54762#&&76767!%wG!7$uUUu
:bc
$BURzzRSF  @ L  %!"'&'&&'&5476676763!%&'&'&54762#&&76767!'bbk
wXXw
:$;!7$uUUu
:bZqTxxTSF'
$BURzzRSF  ?# J   632!6!!!!!6!!!!##"&'&'&'&'&767667
)
IJVg1)59,jkWg1+!
	L9;k57/"
&	1<
	I	]  @# F  7&5476!!%767>77'&''!%!&5476!!%'&'&7676332##"'&7677!%Wgk-95)0gI
)	5ki2$	
!+m		
#
/7	]	#i2?	
<1	  ?# O n   632!%'&'&7676332##"'&7677!%!##"&'&'&'&'&767667!%767>77'&''!%!
)
II
)	5ki2$	
!++!
	L9;k5k-95))59,7//7	]	#i2?	
<1		1<
	I	]
#"
   A A  6323236!!%&'&'&54762#&&76767!%!"###"'A	!7$uUUu
:bc$BURzzRSF  '  \ E  46332632##!#"'&546322632##32! '&=47633#"'&5'	)sj
//)//fNf
////ts////
2
	2  `9 ' 4  2#"'&'.'&'&547>7676&5476!!WM|=+ʋ	(ʲ+GG
hE<Q!!:-@M	M@-:!
  `9 & 3  4632#"'&767677&'&'&'&5476!!`+ʌ'?aM|:U=WGG!:-@MJ]-:!yK<.Eh
   .   "&5476 7632 	Z		                             I >['X%Zi#!=
@	%	

]
MSS_3#^O9Mq\E+|Nu1tE=Pb{++N1f *  !,!!!""";"\"""##N##$$R$$%:%%&b&&&&&&&&&''5'e'(()D)))*w+G+,@--..W../W/00v01'11242k2233r34:4556.6l677788t88899w99::k:;#;9;j;;<<I<<===>h>??^??@U@@A7A{ABBuBC C\CCDDHDEEPEwEEEFFJFdFG GPGGHH(HBH_HHHI,IjIIJ;JKK}KL
LLMMJMNNNOP P^PQQ&        e7_<                             2    M     ^ Y[ & @? @ A~ 0? J g >? I~ @? J ? J? ?? -? P? 9? 0?  ? 9? 0? @? 0? 0? J? J~ `~ @~ ` A~ @e (2 '? @r ' ' ' @ ' R  ' 'D ' '` @ '` @^ ' @  )u 'e  e !e  @? ? ?? ? ~?  /    ' &  _ (?  %? (__ ? ( % %?   _ &  &  %_ ? _ _   ? F? ? F? `   e f? ` @? ~ @  )~ ~ @U ?  ~ @?  ? ( S~  _? ~? ? P? ? r? f? Je3? `?  ' 6~ @& ( 0 '? @~ @? @~ @? 3    M            S  ?  ~  ? :? J[ n[ & @ @ JX #   -? @ H? * @~ @? ~ A? ~ @? ~ @~ @~ A~ @~ A @ A~ @~ @~ A~ @~ @~ ? ~ @ ~ /  t < @? . 7 a `~ `~ @? ?? ?? I? @? @ N~ A~ A 6? ?  @ @ @ @9 @~ @? @~ @~ @~ @~ @~ @~ @~ `~ `~ @~ @~ `~ `~ `~ `~ `~ ` @~ `~ B F F~ @~ @~ @~ @~ @ A @~ @~ A ? ? J?  !? J J+     ~ A~ @ E? ! D? !~ A~ @~ A~ @~   @ 9 ?  @ @) `N @L ?N @N ?) A '~ ` `     ZN                         1                      PfEd @    8 Z   ^                      (      F _ ~           1S7  
    ! & 2 !!!!!!5!!!!!!!" """""""" "#"%"+"<"@"C"E"H"M"P"a"e"k"{""""""""""###%%%%%&c&o'''*?*      a           1R7  	      & 2 !!!!!!5!!!!!!!" """""""" "#"%"'"<"@"C"E"H"M"P"a"d"j"z""""""""""##"%%%%%&`&m'''*?* v>;|ywuqfߋߊ߉߅߂j޸޷޶޵޳ޭެުީާަޥޕޒސޏލމއwuqc][USKI.-LGD?ڤڛ#f                                                                                                                                                                                                         ,  UXEY  K QKSZX4(Y`f UX%a  cc#b!! Y C#D  C`B-, `f-,#!#!-, d BCC ``BCB%CCTx #CCadPxC`B!e!CCB C#BC`B# PXeYC`B-,+CX#!#!CC# PXeY d P&Z(CEcEEX!%YR[X!#!X PPX!@Y 8PX!8YY CEcEad(PX!CEcE 0PX!0Y PX f a 
PX`  PX!
` 6PX!6``YYY%Cc RX K
PX!CKPX!Ka cCc bYYdaY+YY# PXeYY dC#BY-, E %ad CPX#B#B!!Y`-,#!#!+ dbB #BEXCEcC`Ec*! C  +0%&QX`PaRYX#Y!Y @SX+!@Y# PXeY-,	C+  C`B-,	#B#  #Babfc`*-	,  E Cc b  PX@`Yfc`D`-
,	 CEB*!  C`B-, C#D  C`B-,  E +# C%` E#a d  PX! 0PX @YY# PXeY%#aDD`-,  E +# C%` E#a d$PX @Y# PXeY%#aDD`-,  #B EPX!#!Y*!-,EdaD-,`  CJ PX #BYCJ RX #BY-, bfc  c#aC` ` #B#-,KTXdDY$e#x-,KQXKSXdDY!Y$e#x-, CUXCaB+Y C%B%B%B# %PX C`%B #a*!#a #a*! C`%B%a*!YCGCG`b  PX@`Yfc Cc b  PX@`Yfc`  #DC >C`B-,  ETX#B E#B#`B `   BBB` #Ba++"Y-, +-,+-,+-,+-,+-,+-,+-,+-,+-,	+-+,# bfc`KTX# .]!!Y-,,# bfc`KTX# .q!!Y--,# bfc&`KTX# .r!!Y- , + ETX#B E#B#`B `a  BB`++"Y-!,  +-", +-#, +-$, +-%, +-&, +-', +-(, +-), +-*,	 +-., <`-/, `` C#`C%a`.*!-0,/+/*-1,  G  Cc b  PX@`Yfc`#a8# UX G  Cc b  PX@`Yfc`#a8!Y-2,  ETXEB1*EX0Y"Y-3, + ETXEB1*EX0Y"Y-4, 5`-5, EBEc b  PX@`Yfc+Cc b  PX@`Yfc+      D>#84*!-6, < G Cc b  PX@`Yfc` Ca8-7,.<-8, < G Cc b  PX@`Yfc` CaCc8-9, % . G #B%IG#G#a Xb!Y#B8*-:, #B%%G#G#a BC+e.#  <8-;, #B%% .G#G#a #B BC+ `PX @QX  &YBB# 
C #G#G#a#F`Cb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca#  &#Fa8#
CF%
CG#G#a` Cb  PX@`Yfc`# +#C`+%a%b  PX@`Yfc&a %`d#%`dPX!#!Y#  &#Fa8Y-<, #B   & .G#G#a#<8-=, #B 
#B   F#G+#a8->, #B%%G#G#a TX. <#!%%G#G#a %%G#G#a%%I%a  cc# Xb!Yc b  PX@`Yfc`#.#  <8#!Y-?, #B 
C .G#G#a ` `fb  PX@`Yfc#  <8-@,# .F%FCXPRYX <Y.0+-A,# .F%FCXRPYX <Y.0+-B,# .F%FCXPRYX <Y# .F%FCXRPYX <Y.0+-C,:+# .F%FCXPRYX <Y.0+-D,;+  <#B8# .F%FCXPRYX <Y.0+C.0+-E, %&   F#Ga#B.G#G#aC+# < .#80+-F,
%B %% .G#G#a #B BC+ `PX @QX  &YBB# GCb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca%Fa8# <#8!  F#G+#a8!Y0+-G, :+.0+-H, ;+!#  <#B#80+C.0+-I,  G #B .6*-J,  G #B .6*-K, 7*-L,9*-M, E# . F#a80+-N,
#BM+-O,  F+-P, F+-Q, F+-R,F+-S,  G+-T, G+-U, G+-V,G+-W,   C+-X,  C+-Y,  C+-Z, C+-[,  C+-\, C+-], C+-^,C+-_,  E+-`, E+-a, E+-b,E+-c,  H+-d, H+-e, H+-f,H+-g,   D+-h,  D+-i,  D+-j, D+-k,  D+-l, D+-m, D+-n,D+-o, <+.0+-p, <+@+-q, <+A+-r,  <+B+-s,<+@+-t,<+A+-u, <+B+-v, =+.0+-w, =+@+-x, =+A+-y, =+B+-z,=+@+-{,=+A+-|,=+B+-}, >+.0+-~, >+@+-, >+A+-, >+B+-,>+@+-,>+A+-,>+B+-, ?+.0+-, ?+@+-, ?+A+-, ?+B+-,?+@+-,?+A+-,?+B+-, EPXEX#!!YYB+e$PxEX0Y- K RXY  cp B(  * B
* B%
* 	B    * B @ @  *   D$QX@X  dD(QX X   DY'QX @cTX   DYYYYY* Dd DD                                         4 4    >  8       	 r  	       	     	     	  >   	     	  B  	     	 d\  	  4 C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0   D e s i g n   S c i e n c e ,   I n c . 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y K a T e X _ M a i n B o l d F o n t F o r g e   2 . 0   :   K a T e X _ M a i n - B o l d K a T e X _ M a i n - B o l d V e r s i o n   1 . 1 ;   t t f a u t o h i n t   ( v 1 . 8 . 3 ) C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0 ,   D e s i g n   S c i e n c e ,   I n c .   ( < w w w . m a t h j a x . o r g > ) 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y   ( < w w w . k h a n a c a d e m y . o r g > ) , 
 w i t h   R e s e r v e d   F o n t   N a m e   K a T e X _ M a i n . 
 
 T h i s   F o n t   S o f t w a r e   i s   l i c e n s e d   u n d e r   t h e   S I L   O p e n   F o n t   L i c e n s e ,   V e r s i o n   1 . 1 . 
 T h i s   l i c e n s e   a v a i l a b l e   w i t h   a   F A Q   a t : 
 h t t p : / / s c r i p t s . s i l . o r g / O F L h t t p : / / s c r i p t s . s i l . o r g / O F L          2                               	 
                        ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a                       	
          !"#$%&'()*+,-./0123456789 :;<=> ?@ABCD E FGHIJKL MNOP QRS  TUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~uni00A0uni0237uni02C9uni02CAuni02CBGammauni0394ThetaLambdaXiPiSigmaUpsilonPhiPsiuni03A9uni2002uni2003uni2004uni2005uni2006uni2009uni200Aminuteuni20D7uni210FIfrakturuni2113weierstrassRfrakturaleph	arrowleftarrowup
arrowright	arrowdown	arrowboth	arrowupdnuni2196uni2197uni2198uni2199uni21A6uni21A9uni21AAuni21BCuni21BDuni21C0uni21C1uni21CCarrowdblleft
arrowdbluparrowdblrightarrowdbldownarrowdblbothuni21D5	universalexistentialemptysetgradientelementsuchthatuni2213uni2215uni2216asteriskmathuni2218uni2219proportionalangleuni2223uni2225
logicaland	logicalorintersectionunionsimilaruni2240uni2243	congruentuni224Duni2250equivalenceuni226Auni226Buni227Auni227Bpropersubsetpropersupersetreflexsubsetreflexsupersetuni228Euni2291uni2292uni2293uni2294
circleplusuni2296circlemultiplyuni2298uni2299uni22A2uni22A3uni22A4perpendicularuni22A8uni22C4dotmathuni22C6uni22C8uni22EEuni22EFuni22F1uni2308uni2309uni230Auni230Buni2322uni2323uni25B3uni25B9uni25BDuni25C3uni25EFspadeuni2661uni2662clubuni266Duni266Euni266Funi27E8uni27E9uni27F5uni27F6uni27F7uni27F8uni27F9uni27FAuni27FCuni2A3Funi2AAFuni2AB0uniE020      
xt'wOFF     t     Ȉ                       OS/2  e   V   `FRcmap  f    <yDcvt   o`   ;   Zsfpgm  h    b.|gasp  t         glyf  D  _  Lhead  c   6   6eChhea  e       $
hmtx  cT  6  \- >loca  `  ,  2'/maxp  `        name  o    f^%zpost  q8    \prep  n      ex#Ǖ8jIjxA͌pP]/{5̎C>qp|/'ρrIjUi^o?}gG]W^=~b|Yf)%=_3G:E(鳃`_0A&Έ}{jh;e"L:CM܎T B,P.30r]KEobNi v0d3QFF:ft(2R\֪L\=G[YJՊhʔX'^E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-T$Zd&OSj;#qyus|zG;zݣSx墁9T4tL,l `ppy|P$HerRhu9pϯo`hdlbjfnaiemckg!>3'cViwu,=_bQ5VzXNkbs<@(K2BRk:h2[6-]n}~E%UM]CSK2u; Ш=L *`./Lf!+[i:m2j)m]j۰v\(	yF=jewo(9y]7!P[˝$~4ꦰ^[wOmN2l[؛ۧ~?V^0oo	'vnieH.݃ r;jΒYJ?x;LO}ˮͥrkvsX?&-b.Y_ې0nڧjm/\!Ng ycM d޷3pj2t ѳu{F15őآnVɗwn[D!n,A`+_y^xu~ޑsE3;p/ԸeȽf;kݸH&rx^Sh|m	ft_$+8VD9cxfwOpy^!9{.`ɚƈ-Rgu% ̧&wec痿>3Aו^gv燩?q?    #xȀ7       `OS/2Fщ  i   `cmapf%  jL  <cvt Z  zH   Zfpgmb.|  k  gasp        glyf     erheaddB  g   6hhea5  i   $hmtxFV=  g  locaw^  f  maxp2  f`    namea  z  postanO  0  prepe  y     2       33'3#2d222      ) !
 2+2#"'&5476672>362#"&55476k!'	4'&=$)-"
}%''9#1   R  5 ) 2+"&5463#"'&54747673"&5463#"'&5474767$<*#$@&8\$<*#$@&8\"+80'KY5)	

@Z	"+80'KY5)	

@Z	   }> i s pk@
2+%##"&547665##"&547665#"'&547633774#"'&54763376676676323776676323#3'4##337cL>L>ON_`*+om~*:D=ESL>!=PPaa*+o_SS*+SS*u#u#QQOl6	qt#&?rQQQQQ   3 F \ m @
g_OG>52+"&547676323276632 #"&5476  5#"''"'327667654#"#"'&54767672632767654#"Q8?)6aGkwO

3($(&H>
D**#;
"11!/U^(_o2#[F:WGcGS	5/
1=;RV#	q< D%JXkC8JGkk.=u&	/qBiS      &2+2#"'&547677'&554766762#"&546774'&#"632#"'&&32767654''7632#"&'&'47676767>#&'&546#&#"32766'&H ,( N82mR/B	&$	2"(	:,+oF#"$& 2"&9	I3	0v	"3,?M!+vxH2M S=	
 Ur	0&	9(	
#_&
#!+6Y1/m3H<5	 1#9/! 2	7   R  2+"&5463#"'&54767:$<*"$;(:
a"+8/'KU:)	
C[	   8  2+#"'&'&547676732DT
|	>,t1:!lA5#W6A]S\     2+432#&767667654'&
i;6]`}&"7rc^b		W㝇kX   2 P G2+"'47663.'&54676567676632766767632#'.#"&5477!:*&!3;!:*&#3z%&.!*'"<~)%&.!*'"=~Q   ZZ %  2+2!##"&'4#'&5476377676J$$$K	H&%Z$	
  V>   2+74632#"&476765#"&s9(HO9E%
$@(:V=s)	3G"  Z   2+6732"'&5o~~	}~	L  s     	 2+3"&5476676%//>$	*5(7    	 2+2 #"'&76 76H		
Y  l  ) " 2+"547676732'32676767654&'&###/Ob_(IQ.#%C*
8#/-zvV_;jOZ$*2!1y$%	.    |   1  2+22'&#"#"5467676334"'&4766767676HGf		*k&b66l*0	+.N6
A   Sh l -2+"&54767632232766763632#"'&'&'"#&&'&76676767676654#"3667654&547632!,:7L'' 5-1$c#b;'2;!		
8&2DM
I A%'FZ+!:KB7&!4I"
	 
>f		 %+)]%/%5>\G,0."	4&,4  ls f 2+"&547676332#"'&&'&5463232767654&''"'&'4676327>7654#"32654'&76632 "(.9j\*+c
8["(7	,'"9#%&$/@W9

	' 30<%#?n2&M.,?I
2#+8*#K<&	$ )02E
-:   8>" I  2+"&54774'&&#""'&5466766676323766227632#R&!#E
Y
#j-;##.%2'	A@X[	8  vv P , 2+"&566323276767654#"#"'&54766327632#"'"67632#CN.*!%!'!./		U	?JHLq%+/N^~YIA.9.	WZ*%
Uh88QJUr  r 4 J @6, 2+ 46774'&"7632#"'&5476766732#"&#"3327676767")D-32="#
)D7>&D#+jy.B.!#
,	0*		9(%K(!)/ -D-	# ,toVd
cA{&%Bh#	Z]    B 52+"&##"#"'&5466563632763276767632#"'4'47677#O@h	58
84
/7
U-!+36,		hh		B"+$#  nj # 7 I 
E93(2+#"&'&47667'&547663274'"&#26763267654'&&''" )cJ_LA&xW;@<%;a*3'Z8Q
18$1pI+Xq98AT!	&<Je>Q59
E$$+R;-
	$'S   ~l 1 D =4*2+72326767#"'&547667632#"&54764&#"3276676 )"F,6D'2,C%1:%~$'V9E1812(.
-)"$l(!,KXH!<
lYf11Bsh`*
mV,   s  _   	 2+"&547672632"&5476676&)
&<m%//>&,#';$	*5(7   V=_  + 	 2+"&5476726324632&'&476765##"&&)
&<9'B
?.	2	!&,#';(:Q$RH)	+1.#   } mv 
   2+&476!!&476!!JI3JIM	*	*    e K Y QL0
2+"&54766726323267>232#"5476766767654'&#"2#"&55476 	|G?))1x#		WM)51!/&=$)-Bd	 >+$1%H4J-*X(	 !/''9#1   S b ]U(2+4&#"327732#"&'&'476766732#&'#"&54767632327676'&#"327668sc!(H=D!߁#$Sq29i15M0$*<#
59OZ
`<Od"
?	''4#!3:2
&bh,Db??0(dY"78SLTc04]!# SK"$w<'W
Jnd5!@&2<&  H  ) B J HD+ 2+!"5466372&''#32'&#"'&'476632766 7633232'&#"'37

(*6#KI
/t <))
&a#_"*K,X,645 
oi~9E~  @  ? 4 C Q 
LG;6+2+764"'&'476763#"#&'476763&##367676544''#37766FEXK4W	J2I1USIJ	T7,!!XY3B>
p1J?Q/0xx[#;>f   L <%2+4&#"32767>262332#"&'&54767667632767632##"&'&76=;W4_WUI1	_s15c#:H#((@
KVk@T3OQG3<	UbX-60TJOd	   >  t ' @ .*2+764#"'&'4767632#"'&5&76763&'#3276767>54'&FE,-hw-pg1GDFG,U9		>
zk060~%X
&"B  @  $ l b2+7474#"'&546767!##"'&54654&'&##326766332#"'&7654&'""##3676767>232!&'4767633,-&	_<6:-

B!+CHY- )
	i	11B$
	
:	')	
#;
++6%_
	  A   f V2+7474#"'&54767!##"'&4654.+367676632##"547654&#'32'&#"#"547667633,0		*7&
	A#$::
0t*g11B$	
	:	xx	E	
yA		   _ 2+%#"'&'&547676676332767632##"&'&7654&'&#"3267677#"'&5467673277###"&IpO
(i4Z
)O)((@
10~F2 aU'=89/ic#4@*:L>T p8M2@UX>W3NO"22"   @   z K2+764"'&'4767633262##33774"'&'47>3232632##32'&#"#"'476763374##32'&#"#"'476763FEX2ob.11X	h'&c11EG,-
*j&d11AA,-
*j&d1>
uvuv
   4  Q : *2+764"'&5467676332632##32#"&#"#"54676763FE^4th44EG/0	l('f4>
   9 A :#2+7223263667654#"'&546767633276+#"'&546&1z<=8wW	$< ^[0;"02(:~CDL*%.:   @   ~ 2+ 2632#"2'&#"&54766327'&'432#"&"#"'476763364#"'&'4767633262##277#&#"'&766326:@
1
'_x) 


"Z\$
#65$
.,-
gLd11FE,-2ob.21!"J^


  @   9 02+764"'&'47676332632##32767676332!&'476763FEX2vq??EG/>&S/

\	1>
(  @   u  2+3"'476636754#"'&'4767632267>732##32#"&#"#"'47676335#"'&'4'432#"&#"T4EE,-}~ #}#y{21EG,-
d%$^11ǈ	NA@
;SN
 5.3   @   U  2+3"'476636754"'&'476763264#&'"&'&76763232632###"'32'&#"T3EEXw__1SM
BzD
#QN
Cy+   a  - % 2+"&547667324#"32767676y(˔,
gt|XZC/1<&a8v<Kk45m--79e\5&$.$"&	 w3_d  A  7 < N B?-2+764"'&547667632#32'&#"#"54766763&'#3276767654'&FEX

G[aUT,0	*j'c1C@+7D1>
	?8	Sqo;			0qH:   ?a 4 V a 
]XF7
2+%2#"&5475#"&'&5476673232764&#"766327676676&#"3277
,G	1(,"X}(˔,
gt`	PEDQ:##	C(6+#.-)& +	!\::(F>3?<Kk45t)&HNR&-+/L%#02	$F$3`4  AR ^ u ha52+764"'&547667633276767632#"547654'&##32'&#"#"54766763&'#32766767654'&FEX
p!/\
7(
,
"@5>,0	*f%b1A< 2N#)		>
	C3,A$>	50&)p@@-			0~@'$+  Y ] F2+%2654'&&'&&54767633237632+"'54654#"##"'&"#"&&'7>7632g6R,-8%W41Z0=6
w4E	*FGW2c9	F!-V;8#S6%*a0)1!</1+j%2$,p)L     h R $ 2+3"547673277667##"'&546767! #"'&5&7654&##3#"&#"	GG		#E$1		J((
$	2<&E$		21}#$B/!
	8/="#
    Q  2+"&547>4#"'&'4767633262##32767654#'"'"'&76763232632#l31,-2ob.2159l	.a"SL!Bga\
W	k`|   D  2+2#"" "'&'&#'&5476633262#"&#">7&'"'&7662326	2
((('	
.c_.		)6HvL, NB	:8		\rz		   u f2+5#"'&5476676332632#677'&'5#"'&'47>32326326&#"5476673276#""'&'454"'&a7#$
.`^)*		+4^#$	[#"_	%*		I?%LF	=
	%	s
	gfggIX++
gfgg{
			Q	   A    A 2+!"54676332377&'323'&#"'&5476632727677'&'#"'&54766332632*##6765#&'"'&7>323277#"32#"&#"
	4-T%	'VS
	;vu46+,	,ff!:% B+[ T:	*98~,+
	\%$aD2]

)#I-@>

      b  2+!"&#"&54763367&'#"'&547>332632+2654'""&#&54676323276#""2Sh'g"51$3F,*	
/gf	#,
$
QI
:ZG	D$ii
  _   = 2+6732 3676676632#"''&5476&#"#"#"'&546	
7HJJ	
T		,PZC`X:TM	  X   2+&'47673#32fzy*+%$&&


     2+#&547667767#"'&546767{zy*+$%&&

I V  2+""'&&'476676#"'	uTP
rv	  bv  	2+477!#"'&b+	   bx 1 F @5 2+"&54767627676232766332#"'&'&#"327766K[2L4".!%

&A'	8m$ (8+
(WLTSuY$),'c'>ES"%7(   i  ) C <+ 2+"&547677#"&&""&#&54676766326324#"3267676KX60
/*NY!y6]7$
3VJ|zVK;^;

(V+'%PO  e 0 2+7367632#"&'&554766732#"&5474#",.bAGMhhF  .#&"*y*$;C>< ^y	)$2(2HA   b @ U OD" 2+"&5476767632277#"&&""&#&546766763232766332#"'&'&#"327766K[2AZ*#
?H

&A'	8m$ (8+
(WLTS?aaY$),'c'>ES"%7(   f # 0 +&2+7327632#"'&5476632##74&#"32>QcGGM2N#d:NK?l "7&:8{O>C0b:9M^20=+b% 7 V P$2+222767>7675#"'&54767637767632#"&547&#"32###"&546?
	88		;;,_A ."A@		BD! ,7
/?.! $0W
sY "3#f#	
<\,<,'#2   568 1 E ?42+%#"'&54767667632632#"5476323326767'32676654&'&#"e*/p'	"i=7%::V1 )<|=8

$ R2';.2>7>M5+",% tT   Gx R %2+4&#"#"'&556#"&&""&#&5467667632676323276766332#"&5476B1@	$#8W
?H!!3DCN
-U8/A<`=!	
	V&8:8x83	8W2((  F  K . 2+"&54676326323676632#"&546674665656&##"'&5476(%
4*)-<	.1	*D1?.00	2* /"&"	{??	_(P1+	||	^	D 7  I 2#2+4632#"&4&#""#"'&54767632#"'&546323676766/ /! 8
	#9$'<%1U7 6.#*eh01:"

&9 #$LF9	.C#0;	  G= k  2+"&556#"&&""&#&5467676632276767672#"&54675&#"23276766332##"&54654'&#'y8W
01%4%'H))* !(<#o	

#?4H	V&3R1=!)9#?8	 (\7/ "SH   T] : 42+732767>2232#"&'&54767#"&&""&#&5467676632
	!G#;A
D	@
	yjVC  F { D2+54#"##"'&547667636767632676323276766332#"&547654&#"#"&554665654&#"#"&5547746
+"K.<E&$1:BN
-
U8/@<B1<(!"O8
%&&xY-'/	1(
8:8x2
!'	8W3'(7=!![	|B$  F Z ;2+54#"##"'&5476676367676323276766332#"&547654&#"#"&5547746
+"K.<	%
U8/@<O8
%&&xY-'/	1(t!9a2
!'	8W3'(8[	|B$   eY  * "2+6632#"'&55432767654'&##"'X)b{MK)7	7-CSo"[v;yH=,|8$,|    >\ F X SH72+"'32"&#"'&5476;7>5654#"##"'&54767637632'327667654'&#"G+)$
JC	<	
 "A$	8BA14[@ZR3&&9		%N;/Y-4*'&*R}_?i6 >ES"%!   c>E 2 G >4"2+%#"&547667626763232'&"'&'47663366&#"327667477c/*OXg1''
 (W60(%$VNh

aj2''%!xx  F- = 32+54#"##"'&5476676327632#"&547&#"#"&5547746:#

9(/<-D.$0"!%(&&x_	;J#%%%41#   U > 12+732764'&'&&'&&547632#"&547&#"#"'&&54632)\Y"+0mN%* ;
#7>0 #.2.$9<	4&+/G( ,
)

$?z
/"%2)   U G  2+"&54774#"#"'&76763376766322##36767>2324G##)	1-&#R		.-$!,.B7*	IK
?
'F  F X  2+"547654#"##"'&547676726323276654767632276766332#"''47
-F): 0G(J
&=#	*55)
M
$(T,.=!	)	I&#	  F) =  2+2#"5467654#"##"'&547676323276765&'&546 #
J+#7&,.@!;:+#24($@!Jf%F\23	H*0)"XJ"E4   F ^ 2+4632#"'&'#"5467654#"##"'&5476632327567667676323267676765&'&~1#%0'4!C*	/8""
R2(:&A'6(90s63)1*L/!FY54
2J$"d4G8	!$ -Y   FZ ` T$2+73276767656'&#"##"'&547667327632#"&5477&#"3276766332#"'#"&54632	8`:Y,'4-?-%.
!5(W7Q,'3.?.$.;!|f
=6M,'9.&70!%X72K,'90&5/  F6Y Y >2+"&547654#"##"'&547667263232?>56632#"'&546323276746755IQ7"
I)):"0,"#%f^ECb-#</AB654
1D$"\(.=,
!N(l	T7$7#1 G -   5 Z +2+63237676632263667673"'&'&'&#"#"'&767676765"###""&#&5476,)$&		
5j57/.	2
b7!			9)A55A"5
 BX-1
	8L
%19)6-0"   X %  2+%"&5476767263327632#"'&#"&,!$,3!#-*)	/'  v   2+4632#"&74632#"&7$'8&#8$$6&$\#8!$7#"8#"8# ` N  ( #2+632#"'&5474."&#"33276z'C!! I3I(,)	$*(   g>  & "2+%2##&54763276'&'"546767632d;
I7i)o	(/.
0'6  I  0   "2+%2'&#"#"547667676#"'&547676!!#"'&54654&'&##3276767632+"'&7654'&##3267676767632!&5476633>5#4"37G	#LC
=
		
O2 !9	D01@C!		i	+GF
`9M	v >	
@%"	="uu!(G
	
wrtt1\~    3 A Q 
ID?5.2+#"'##"'&7>7'"&&'&54767667632676&#"64'32767676-R2qPD!CF5`%HLA&CYA@$ 	'	fffg&L"r9H{?B[J	"%Aq 	wlRfN		i#63la`$< Jo  {{||&x4cl  6 v n2+27676675#"'&5476737676677:32#"&5463232767654'&'&547676767654&##"#"&4632}#	079	v	dXHd
=?%oH0=$ !
,%=$1#>'6.#T)$>
2MJ+,	XY(
&:W4% +">!90AE.S(;/H2   RA 8 F S 
NHB: 2+"&5676767676632632#32762#"'#"&'4#"3276326?"PfAH6	!CA.E{f2.+O>
EA7%0?<+&;(5-*:?EEI6
"3&!	+/>
D"f2+#("$ :Ry"   Hw4 0 @ O 
FA<22+632#"'&#"&54776'&'4766763266&#"25677327667654L-,
,l)'[
U	(h-#V";v,+.86,Rmp
l
(JhmTDIbRM@%  F =  2+6323676632#"&546674665656&##"'&5476*)-<	.1	*D1?.00	"&"	{??	_(P1+	||	^	D   k  {n4(2+&&##'3676767>232#"&554767667322#"'&7654.+366767662##"54764&#"#326767676$0!AHD)(
	eа.1E~=;l$6/+
1%(:%,1,	A#,/T?H"= 465/,C2&]
	zj\Yi &	^
<	 =%GRE?r-%+!   bA 0 D S 
NG>32+"'#"&547667672632#32762%276767654'&#"%4&#"32766Pe4DaKVrW%DLlb#$2.MQ>
E
2(!)() PH(%=;ZKd39AJ9Q>
Da4!%WO#+"Cb&  6 @ -2+4&#"#"'&56767632#"&54632367676
+
	 0-02J	1g?+:." ,dw>

8 6,		 "6	5G(%3E V  2+""'&&'476676#"'	uTP
rv	 \   2+232632'&&'&766763Jh

(,'
x77$T
#  "{c   2+&5467732
"	!!  va  	 2+2'&'&5476676,	$M{ ,  2+4632'&&'&,1&		st0
A;X   } ! 	2+327676632#"'&5476632T:&B0	a<]#		'*7RH!		
      2+"&5467632=%.$	 ',!%1$"2	      ( #2+632#"'&5474."&#"33276'C!! I3I(,)	$*(  5 %  2+"&5476767263327632#"'&#"&,!$,3!#-5*)	/'    % 2+632'&'&7667632'&'&766a""gC""gC\
	w\
	w  @   C 32+7474#"'&546767!##"'&54765&'&'&'#2#"&#"#"'4767633,-	(=6t
u+*g11B$
	)    Q  `   2+32632! '&76 76&2k
	:LFTZ		i1]p    0 _ 
F1(2+632#"&'&5547664&'&#"3276767623746567632##"'&77##"'&546763DTZ*i
B@><O/!<(2KCJ"	(		(C>5H?BXO#0̘IU%1o*~/	d(2\%
	

   H   E  2+!"&#"&547667676767633332#"&#"#"54766772'4328PE

	h	

#	\$"b)*q88
2
u
dc   X  K ' S  
[T;(2+4655#&#"'&546767! #"&&5474####&5467633233766322! '&54676633233676767>263	,	3
)		)_7	$		
	
*%VI	


$"

   @   [ '2+7474#"'&546767!##32'&#"#"'47676337474##32'&#"#"'4767633,-11,-
*j&d11,-
*j&d11B$$   _  l F 4 2+#"'&54654&'&##3676767676332! '&5476 7'&'&6767^
2:!nUJJqyJ+*W	
CZQ
	!<3~{)'L

%     T B2+4&#"#'&5476676332767632#/56'&#"2#"&#"#"'47676336(/F
V.
c	1>@C4E
/?0,	#t
x.-u?>L;:$-A"_12@6!?:f,L 0=    9 \ l  
vpb]N2+%65&'&&'&5476677>4#"'&'47676332632###2'&#"&'4767637266747&#&7667654'&g
Nc]:97~ q>?4#]
E,Dct
/wv(?e42%1.>h	<,<M	4.
4D(*F"41yz34 	y:937      u 7 2+!"'47676337477'&'&547654'&5476632564"'&'47676332632##376676767676322#"&"	?>o(		.;&
4bt7~ q??1P 0:9		8
t
vXo22J$- &	8%7J
[j-yY
641  t  Z f 12+"#"&'&546747632254'&'&'&547632367276767632#"&'&547676767654ERl+_L
	1&
	Vsq4M1# -	(_LJ)
`bdZ9'$7>( %jVkQMJM.Q4).\--DM3E<l  b v,  	2+477!#"'&b	   ,  	2+477!! '&	  S  2+2"'&547676326,$, 1;*8
a""4	CKU:(
C[	   R  2+"&5463#"'&54767:$<*"$;(:
a"+8/'KU:)	
C[	   S  7 ,#2+2"'&547676326!2"'&547676326Z$, 2@&8\$, 2@&8\""4	DKY6'


@Z	""4	DKY6'


@Z	  R  5 ) 2+"&5463#"'&54747673"&5463#"'&5474767$<*#$@&8\$<*#$@&8\"+80'KY5)	

@Z	"+80'KY5)	

@Z	                                W J,]=^|7fJ!	4	z	
&
(|*-@A@,>Tu>mSWW  a !$!!"#
#$$M$M$w$$%&A&'h'(>(){)*
*@*b***++N++,1,m,-c../
/0A01y11122f2        _<                             2    M      m  } v d   O v d V Zd sO O lO |O SO lO 8O vO O O nO ~d sd Vv }O v b H1 @; l > @ A  @ 4c 9 @ @1 @ @W  AW [ A Y q b  b Ab  _d XdOO bO b i eO b f 5O Gd Fd G) T F FO eO  c F U Um F F  F1 F2 F 5O   O` g Iv ; RO Hd Fu ; bOOO OvO,O d  OO @ Qv ' H  X @; _v ; v ; tO b d d m        Zx                          1                       PfEd @    8 Z    ^                      (   F @   # ; = [ _ z ~         1S7        % = ? ] a ~         1R7   {j2/ifd                                                                        ,  UXEY  K QKSZX4(Y`f UX%a  cc#b!! Y C#D  C`B-, `f-,#!#!-, d BCC ``BCB%CCTx #CCadPxC`B!e!CCB C#BC`B# PXeYC`B-,+CX#!#!CC# PXeY d P&Z(CEcEEX!%YR[X!#!X PPX!@Y 8PX!8YY CEcEad(PX!CEcE 0PX!0Y PX f a 
PX`  PX!
` 6PX!6``YYY%Cc RX K
PX!CKPX!Ka cCc bYYdaY+YY# PXeYY dC#BY-, E %ad CPX#B#B!!Y`-,#!#!+ dbB #BEXCEcC`Ec*! C  +0%&QX`PaRYX#Y!Y @SX+!@Y# PXeY-,	C+  C`B-,	#B#  #Babfc`*-	,  E Cc b  PX@`Yfc`D`-
,	 CEB*!  C`B-, C#D  C`B-,  E +# C%` E#a d  PX! 0PX @YY# PXeY%#aDD`-,  E +# C%` E#a d$PX @Y# PXeY%#aDD`-,  #B EPX!#!Y*!-,EdaD-,`  CJ PX #BYCJ RX #BY-, bfc  c#aC` ` #B#-,KTXdDY$e#x-,KQXKSXdDY!Y$e#x-, CUXCaB+Y C%B%B%B# %PX C`%B #a*!#a #a*! C`%B%a*!YCGCG`b  PX@`Yfc Cc b  PX@`Yfc`  #DC >C`B-,  ETX#B E#B#`B `   BBB` #Ba++"Y-, +-,+-,+-,+-,+-,+-,+-,+-,+-,	+-+,# bfc`KTX# .]!!Y-,,# bfc`KTX# .q!!Y--,# bfc&`KTX# .r!!Y- , + ETX#B E#B#`B `a  BB`++"Y-!,  +-", +-#, +-$, +-%, +-&, +-', +-(, +-), +-*,	 +-., <`-/, `` C#`C%a`.*!-0,/+/*-1,  G  Cc b  PX@`Yfc`#a8# UX G  Cc b  PX@`Yfc`#a8!Y-2,  ETXEB1*EX0Y"Y-3, + ETXEB1*EX0Y"Y-4, 5`-5, EBEc b  PX@`Yfc+Cc b  PX@`Yfc+      D>#84*!-6, < G Cc b  PX@`Yfc` Ca8-7,.<-8, < G Cc b  PX@`Yfc` CaCc8-9, % . G #B%IG#G#a Xb!Y#B8*-:, #B%%G#G#a BC+e.#  <8-;, #B%% .G#G#a #B BC+ `PX @QX  &YBB# 
C #G#G#a#F`Cb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca#  &#Fa8#
CF%
CG#G#a` Cb  PX@`Yfc`# +#C`+%a%b  PX@`Yfc&a %`d#%`dPX!#!Y#  &#Fa8Y-<, #B   & .G#G#a#<8-=, #B 
#B   F#G+#a8->, #B%%G#G#a TX. <#!%%G#G#a %%G#G#a%%I%a  cc# Xb!Yc b  PX@`Yfc`#.#  <8#!Y-?, #B 
C .G#G#a ` `fb  PX@`Yfc#  <8-@,# .F%FCXPRYX <Y.0+-A,# .F%FCXRPYX <Y.0+-B,# .F%FCXPRYX <Y# .F%FCXRPYX <Y.0+-C,:+# .F%FCXPRYX <Y.0+-D,;+  <#B8# .F%FCXPRYX <Y.0+C.0+-E, %&   F#Ga#B.G#G#aC+# < .#80+-F,
%B %% .G#G#a #B BC+ `PX @QX  &YBB# GCb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca%Fa8# <#8!  F#G+#a8!Y0+-G, :+.0+-H, ;+!#  <#B#80+C.0+-I,  G #B .6*-J,  G #B .6*-K, 7*-L,9*-M, E# . F#a80+-N,
#BM+-O,  F+-P, F+-Q, F+-R,F+-S,  G+-T, G+-U, G+-V,G+-W,   C+-X,  C+-Y,  C+-Z, C+-[,  C+-\, C+-], C+-^,C+-_,  E+-`, E+-a, E+-b,E+-c,  H+-d, H+-e, H+-f,H+-g,   D+-h,  D+-i,  D+-j, D+-k,  D+-l, D+-m, D+-n,D+-o, <+.0+-p, <+@+-q, <+A+-r,  <+B+-s,<+@+-t,<+A+-u, <+B+-v, =+.0+-w, =+@+-x, =+A+-y, =+B+-z,=+@+-{,=+A+-|,=+B+-}, >+.0+-~, >+@+-, >+A+-, >+B+-,>+@+-,>+A+-,>+B+-, ?+.0+-, ?+@+-, ?+A+-, ?+B+-,?+@+-,?+A+-,?+B+-, EPXEX#!!YYB+e$PxEX0Y- K RXY  cp B(  * B
* B%
* 	B    * B @ @  *   D$QX@X  dD(QX X   DY'QX @cTX   DYYYYY* Dd DD                                       { { 4 4>  6       	 r  	       	     	     	  J   	  *  	  B@  	  *  	 d  	  4 C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0   D e s i g n   S c i e n c e ,   I n c . 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y K a T e X _ M a i n B o l d   I t a l i c F o n t F o r g e   2 . 0   :   K a T e X _ M a i n - B o l d I t a l i c K a T e X _ M a i n - B o l d I t a l i c V e r s i o n   1 . 1 ;   t t f a u t o h i n t   ( v 1 . 8 . 3 ) C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0 ,   D e s i g n   S c i e n c e ,   I n c .   ( < w w w . m a t h j a x . o r g > ) 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y   ( < w w w . k h a n a c a d e m y . o r g > ) , 
 w i t h   R e s e r v e d   F o n t   N a m e   K a T e X _ M a i n . 
 
 T h i s   F o n t   S o f t w a r e   i s   l i c e n s e d   u n d e r   t h e   S I L   O p e n   F o n t   L i c e n s e ,   V e r s i o n   1 . 1 . 
 T h i s   l i c e n s e   a v a i l a b l e   w i t h   a   F A Q   a t : 
 h t t p : / / s c r i p t s . s i l . o r g / O F L h t t p : / / s c r i p t s . s i l . o r g / O F L        2                               	 
                       " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > @ A B D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] a                  	
      uni00A0uni0237uni02C9uni02CAuni02CBGammauni0394ThetaLambdaXiPiSigmaUpsilonPhiPsiuni03A9      
Ѹ	xK+wOFF     K                            OS/2  @T   R   `Fщcmap  @     <f%cvt   H   6   ZZfpgm  A    b.|gasp  K         glyf  D  <%  erhead  >   6   6dBhhea  @4      $5hmtx  >  g  FV=loca  =    w^maxp  =l        2name  I    apost  J    anOprep  H<      exս\ו'\zX]դnb,[eeQaІ6lp3̴UWeR	{>EPD~9H;ގr[jsoZE")ӑtd$"}Q"5-ױ9Cr^阽nZB.Lׅuށ '`|mS%=2A?]J3(:V9 ߫s4mf1CEH*2#f2R0?xzlz=~CUG˕͵(eCCv);6{NΌ1Pͧ[|%I1"Y>fE̲ρf![:ġw;`O8bsޚzҋ{1_i3gG~vQ}e5lu8KTK.F7v;'?s=J'%+ɋZ(fL{Q@'ǵcJ>?>Ҏl<7+9ci&-Pܽ><uC®aYugk9?Ptŧvpppvy{jٜで6Tjm:ꎦ./($	=j:fqjNq&BaCܖi+rw\a8l&Svd&Q30$Js¡tkw<bpdMXa[S[}},+E37D]`=oCsz><рP^C/,vlou?CkⳄGq?(wXᝉBVs8oh֏ퟕw<D̩-2S|z4QII+5<?cC$5m/kPBj*MV6'#]f`.!	YME) g2^HqPiűKOl
7ɪҜdkr|.addCT35\dXW tԃ흒8#'2$MunJ," XR{"O^fl7YBc>0YʹbMlķ.}5ff} KmV~O
iI#J>oKO4y7ŏ|5w~iRO'}
I:* cXICR[N0Գz3}2N~ZM	'Ȉ'X$C3Bro8 9Χ>Ѐ8"O`)g!-:q\rROz5&դ%-ra"{V˔:["o:
zCo#h)Σvfo=H|ϻ=}۷תXB{;#LXL
ٱ$n%*}d""^Gp14⡝@o5vRƩmF3J1s6=>"1#yIT#1qOKqa,]LeHu(FD{%@dCA9tc	r5*9UΎLFO\asp->\ֽI0y$9B;>TI$u15"oădK~DK[im.H |vr ;(_?n:S֨340l915TFz/ŎY}NTmzvU>JD%5Oc#ןov_vv,S>zv$Dv/FGMc[?b f1ÔĴ8_	tӽO&$_Cg|/~q$8YhħW՚~Bڮv߸w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xϝvv;OF#+
X*xJ5oCDu`X!O8~k,ҨRm)G%"j;I+">P$qmAVѢPE3w`m|x~0kހ+D璦#[UXڏ;GIFl6ѐ;BU2"%dBq佚^рfx59?g"Ym|~N2ǥ2/d9\_ HJ*5-=,UHQŰMq\%H$YTiҹyxeʒ-G+PHABʔPJݴ[fl^Qow%Epu',!<)0N8팓N-/iس[Gn%x5~$'Z`#~QSK#Tq*^o{݋{8:9g#=I{WǏo?t2e]UXx瘇. _Thъk5³&0_	(!}S=&6 }EWe	X@ļx,|       `OS/2E  lX   `cmapae  l  Dcvt Z6  |   Zfpgmb.|  m  gasp     $   glyfh|*     gheadcfB  i   6hhea  l4   $hmtx9  j(  loca֨j  h  maxp3  h    name_|  }  rpost O    prepe  |     2       33'3#2d222  k  |     2+2#"4767>366632#"&JLJI
(.g).   x  ; /#2+"&54632'&54767653"&54632'&5476765,A
E,A
E=,#	ZH
8K,#	ZH

8K   s>< m u rnI2+7473765#"'&547633776323776323#32###"&54747>77##"&547477#'&%#376s&&efqpNQ	B"	NQKJNN&&eQYoO	B"	O	KJNMݥ&&&&

ML	 F.

ML% F.%MLML   O 9 P a t @
pcXQH=2+6323276767632  #"&5476  5#"''#"'&&547664'&726676762#"'&546764#"7676Z6^cB
103;(/E"(O	
	B**A2 !:	4'3W*&&$(FI	|GBON_
D4KSD
' QE$		?|G6J'G!@u'3}X,!9@!.DN  " |  }6#2+#&&5676766774#"&54632#"&'&547677&547667632#"&54676335&&"67632#"'"32767654'&&#"3632%2654#"r$!'$9,7"#N/Jq,	pD
	19 "60" 0!'$\NB6z,0/!,")#-&&7'!"cEGE7/-8*C6#WA2&0#.#E		
&&<	S1 HG-1-,$$#"1"  xy  2+"&54632'&5476765,,9 
	E=,#	OG(	
8K	     	 2+&&547676732#.32IDuGO .ZNXW.j"Nk2      2+"&&5476767654&''477233#uGP .32DIj!Nk2.ZMYU1   @H R :2+4632367667672637667632#"&&###"&5467#"5676677&'&'&*+
?
"!!"33P
0}9F4h)*!)=M$%)NJ;
R	    . * 2+6632###"&5477#"'&54763376?D!!""$	
	   E>  y   2+72"&47676765"#"&5467264?&
)$
yC^G$	0<(   T U    2+%#"'&54767N]q0  k    y   2+3"&54632,-*+  i  2+632 "&76 E,A	  n2  - $	 2+2#"'476767673276767654&'&#")D4I(*84?*+4)43 @lUA7;WZ-+%./,ӥ,*$)~5  n   1 2+"547676767636323#"&#""54676327674!E61"Z"!V"9v,I
		   J' k /2+"&55476767632323276676633#"&'&'&#"##&76676767654&#"367654'&76632 9!&'EW4/l+0%!6G.3,1&!+	eHS0+)$,P6>.P"!S9!_J:7/?!2
2!U0)"H}+0<8M(3	V?+h		&7O  `2 ] >,2+4656636767654#"32654'&7632#"&54767632#"&'&543232767654'&'"#"']IC!	5# CAF5G
A+?X6C=#.&5. )!@I@4	&"7$A500*!+J)R[	7/V# #**!O31  .> H F2+674'&#"'&&546676632323476676323276##"";(9Z$V+>		
("		l+&LOD[Y	
D7  j7 L +2+&547627632#"'&#632"#"&5432##3276767654&#"#U4@
],
7:7B
^9FC#-%1"G60T	
.,V)C6fH>`%#,,'ZE$(E  x5 4 J B7(2+472&&'&#"7632#"'&54767676732#"&4&#"3276767620.?%4>I&91=B:#+
.rGI"!)#=!("*'2o38F,*C[(1&.aI@_:%$("G;"j (L?:$   z C ;2+"&'&#"#"5"546776336767632327>233#"'4766 9h8)4
.B
['3X8u89% $$^"$
   c) & : N 
I=3' 2+2#"&'&547677'&'476676"767654&3267654'&&''"=Lh'&\?!$8M&n0h?3U.	3!(6):[&0J	@8^D!	(CAe2+$]8);<`
)I/'4*',+6L3 )2K   k) 8 J D:0(2+7232767676677#"'&&5476767263#"'&55464#"3276765.%%2!!0;IJ~ -vLEK!P;1&!&> 	=1g*
T1,V<G	Ukc;0	!)J*<F\!9   k  4    2+"&54632"&54632-.j,-6,,*+  E;4  *  2+"&54632"&54632'&7476765&-.j+.<"	06,,,<TH
#08&   t o   
2+ ! '&5476!!47! !!##{##f		     ' F R OI(2+"&547667676232767633#"&547>7667654'&#"6632#"&G,0&5>-	V>

<#*'>	9#.$1(.=hE8?(	A0
()<,0'%4&B#).    ` w mb9)2+%3276767654&'&#"32767732#"&'&5476767672632#"'&4#4#"&5463232&#"327677654&i!UH16dE;']]

	kx'._za#bkvC5)+<399?KY':"!1	=%(
"+	WS7\w,݂Qp
'	3ya	 !
v&TUG_3"C'
/[Dn-"
	8=,JJO9]\'   ;   K V TO 2+!"&#"&54676367674 767620333#&#"#"547>3254''#2.#"33@<?Q".RN@ "*QT]]+
Z	=I9=   8   6 L _ 
WNE:2+673#"'05&7677223667654'5&##&&4'&#""#3776676&#"2676654&i`;4FiC(f_#7;J%<LM
1I
}ZW##UC5I'V1N	H5<_	,dJN3	f?)8  , D 62+4&#"32676632#"'&&'&54767676732376##&5656;?g]1!*
-2JPS"Ni	`#gs"G$LBK[Y3JcgZ12SSbM(&t)V8M  7   + F >-2+6732#"'05&76772236676545'&##&&332676767654&'""&""#Sg><[<F	_Z#7(> 51"e0E>esnh9(	,2`M$ER   6   j  2+3&54763667764'&'"'&767633##&547654&'&#"326767632#"'&7654&&##27676767632!=$##F	& #0c6=V5!	
 ;,ELZP&'
`	 "0)B",6 3$`  5  j   2+%"&#"#"'&7677223667764'&'#&&767!##&54665654&'"&#""#367667>2633##&5654'&##32V[! Q###F	'+6:!  0:?80  !"	
(5'&+
 !!|   , Y  2+"&54767676732376##&565654&#"326767654'&##&5476323273#"#"'&'k`#gs"G$LB;?g]<!
]P-O,`R	+6Kvt)V8MK[Y=]LI#Se,$--K   6  \   2+3&547636676545'&##&&767333273#"33654'5&##&&767333273#2232#"&#"#&54763667654##2232#"&#"=$7DA19
6	=7DA19
$	V]
$C!"
		V]	,a@		  1   = *
2+4##"'&767633276#32#"&#"#&&767736676,*)[H"*)]_&q		,  No < #
2+4#"&'&7676332632##"&546323276676S	-_E	(za?:G&!#&4zs
	6P
92&.)	9&   5  Z  a2+7"#"'&76772236676545'&##&&767333273#27667654'"54676323276""3#&#"#"'&7663254"233#&O#7DA1:	$L|5H3>6`_#>+HL.c;>-	$	,ϊi/	*QP	aH44   6  t >  2+3&547636676545'&##&&767332632#327667673##=$7#`\';@DDD !X	,	YZ		   ;   g >2+7"#"54763676545'&##&&76732776673#"3#&#"#"'&7677223667 #"'"3#&A@7``3RQ
	!	(#XM#7AA;	#
	*V     4  \ c  2+!"&#"#&7663676&'#&&76732>7654#"547673326326633###&'.'"2"HL		@/!XH5A)6
$
$KH4	
j}:	#0B1

 ;#     0 & 2+32#"'&546764&#"3276767676Xi#b//]?H^OIC8e"0:4@8G(hHJg ?H|}=4Oc_FcK`8Gu]N  7   > X LA 2+3&54763667654'5&##&&7673#2232#"&#"&'""#3276767674'&>$7V"c=_V
		V]A!
#AE@%	,B $%*3Nww{FF%G-,   > 0 O Z 
WRMC*2+#"'&5467673232767632#"'476'463276767654&'&#"3274&#"327-,_?H^OUYh	f
+"	
.W
K=,&#
W0
@8SM\&.%"!4?H|}=4k0*'"	W.:(D+*BOQ&Kc	O`46a/#")!  7 ` { sf;2+3&54763667654'5&##&&76733276762#"&547654'&'#2232#"&#"4&'&'""#32676676>$7	?J\<8	,1?L2?> !
	W[((8
<4"	,O2! +E$B%
	(577<?;.$!LN630#   Jy \ C 2+7327667654'&'&'&&47667632>76#""&&547654#"#"'"#"547633G?)G
)>Ij<
T)9m8Z7X:!$e/		:<>
Q3=AL-?Z=b=-)>"Ci?

     & N 02+&'4767!2"'&'4764&'&#"3#&#"#"546766366754#&#"C{% 	5-F(*vi 7EF-b# 
	:<,^   \ W  2+"&5476545'&##&&767333273#"32767654#"5476733273#zQge7DA19
6+61F>:`A:3R
$_+ 54mP02m<!4;43Tz


@6#*   d D #2+667654'"'&76733276#"#"'&'&##"'&7>26233273#"*(D3	@#6(/4o
@g2z	  c v (2+">7654&'"'&76733276#"#"'&5#"&'4'&'"'&767633276#7677'&5&##"'&767332737		2FF3 G4
:[C"'"K>.u6"'8n		}Z^	-,9{>v	X:d "$	  0  8  2+7#""'&766767677'.'&'#&&7673326326633#267654&'"'&7664>2323276#2'&#"#"'&7667267654&'2#&&*L3ic.-	.*:*
#
	
#@I5	:'387	.LNO,+X">3{t				9
	32i
    j c  2+3&5476366746677'&'&'"'&76633273#2676654#"547>323276#33#&##"%45..8q


V @/<'}y	)D?197g


%g6	  Q   :  2+27676766332 '&5476 77##"547674363A`!B"QL 	HMH(&>+'`5
*&N
  I  2+2#"'&547732#39999T'
q  g  2+"54732#"'&76737474#9999T'
1   2+#"'&'''&&'476676&#= 	V*0-/x  Y*  2+6332##&76dvm	  e! 6 O D8/2+2767676332#"'&5##"'&&54766763266&#"32767667654G	076)2
S6(%	;'KV!	3P9+Co
=,!BDP/	$Yd   l $ : 2&2+27727632#"&5474'&'#&&763276767654'&#"GF"#.+;F1%91.4Ej8)'	)'	#[CTR>%UDR2#[I',:	Cl   g 5 '2+&'"3276762#"'&&5476676332#"&547C"3$7)
6X	8AcD"
[!"S:ZI1?VBKyA&%   e7 @ X NB*2+26674'&'#&&7632772767676332#"'&5##"'&&5476676&#"3276676654Q!3FG	076)2
pCF'5
2KV!	3P9+R|P,!BDP4   k , ; 91!2+73276762#"'&5476676726332#7654&#"365	R5
=f	>'2Z@ '7	0/C\@"OBG'2W% @f$F;-N
  4 R I2+47&#"33##"&54632327>767>4##&&76732576676767632#"&_&4365$ '#. %
,,-.7
#0!`	A8b1/& &'J[	|(4& %   .3 < S K>7$2+2327667>5##"'&&56676726365663#"546732767676654'&#"j%,)0/4]@ 0::`:%f5	)%
1+ O	.96!S@U 	(2B#M5	3'kE   E" K 2+4#"#"&'4'&'#&&763277276323276766332#"&547676(C1

GFG1@4="K&,-]8	U jn U+71.;Q.Ar,&*~6	   KV  E ;2+4632#"&4&###&&76767323276766332#"&5476656#%4$+Y"K&,YW$"	<U%.&Ar.#  4l  D "2+4632#"&&54767632#"&546323276767654#"##
!'2M
>1T2#+$c&!	X$! d5*o40G
!#!1
 .'   E h G2+277276767632#"&54676'&32>7676332322#"&54654'&&'#"#"&'4'&'#&&76GFe(1#! 	-p()3>	k,5&"+ 1!O'1A8+	).cTU  W8 - 2+2772767676332#"&547>74'&'#&&76GF	)3<!KV2*y   KU q <2+4#""'47654'&#""'47654#"#"##&56767637626763232766332#"&54>7676(C2
 <F-$
	 <O	4B8	,I
j	51!%.	-]8	V kA!i9!S
'Z5
82;b.=P0nR&.#
3	   KU U '2+4#""'45654#"#"##&5476763276323276766332#"&547676(C2
 <O?7H3="K&,-]8	V k>!?-35771.;Q.Ar,&*~6	   g  ' 	2+632#"&547632767654'&#"#HMDS^GQ9%$8
#>9]J\\Jl*3$Y]2.;,:Z   > I ^ VK)2+&54767637632#"'&''233#"&#"#&&76676765654#"#"#326767654'&#"Q"-76;F15X"
HD"w{56'	)'	"-3!4[CTRY 
ST
!SU3'LI',:	"  e> 5 M C7 	2+"&5476676327>32233#"&#"#"'&766327677&#"32766766549FX;(7 	
"
"EC
/	,t'5
2\BJ0	
VP!t,!BDP4   K : '2+&56767632767632#"&54765&#""'45654#"#"#Q4	E!);" 	0)""<O&Y:
+%'(	P	>!c  L D <2+474'&#"#"'&54632#"3276654'&'&'&547632#"K#2	"%"&6H]!	2!*%	3-R->F 
+
"-&H+<'$	0		@0/>-)#   Wur E , 2+233#76676632#"&547674##&&767663376676-.a$	.)(3%#--'/	rLO0$ :+14(PB   K< N F2+"&5476764#"##&&7676323276547622767654732#&'&'":?)#*.$1-!J<K0'+
>8$-5:=,<E'+)-b-E,'',d
(  K < 2+462#"&546764#"##&&767633232766765&'&#.+'?CM")
	;*5%+&PuD$A;!ET?*<p/%-Q)&LpU&   K \ 2+462#"'&'&##"&54764#"##&&767633232767754676676323276765&'&O#.#50"%;BF1M")%A	:!!! 
%+%Wm5I5?>3?*<p/%-e/R6
M1% +}'&  : _ E2+4#"##&7667263267632#"&5477'&#"32767654732#"''#"&546323276676*'"N2	F
$($2!$
6,
3	+>'4%3!!
	(6d1)-	4S8
"+#'*.	1A -128+#'"C		  K3
 M 22+"&5476764#"##&&767632326776762#"&'&5463232767654:?)#*.$1*&%<j}D(8!*+"'#
>8$-5:=,<E'+)-b-E# XNg'!	()%)A   6 V 02+632767636;32676632#"'&&'&#"##&476765'&#"#"5476	
+n;$&$!9

7	*t/!%	'9l:'
,	>	 Jr		4   ;B %  2+%"&4676763276##"'&'&'&#"
23 		+
1-	
 (  *, 
  2+4632#"&"'467632**)* 
-Y+,*-$& 8    2+2#"'&54764#"3267$.	?<(W*/+	% 4.%&U0    \9X   & 2+6;##*/&57676367654'"546	 ;,!:+/-#)
	"
3   :      2+!"&#"&'&7676636767#'&767!#"&&54765&'&&##"&#"327667>2633##&&7654'&##3327676767632##&&766332?#2 4.#"377?=>!
/,$""%=?@& "!8V%%`
( <<*
+	=<"-,!*	
	&)
 }~5']|yijm  ) / B X 
KC?1'2+7&54676763276676"#"''#"&54766&#"#6677276767654'&&'=^HMN6	@K5
n9@N:$&E,JQF>$ JCX/$`0g5-6Im}>/*O
	\Gk0,--V46	E@hbY
 4$YS.93~j|,! 4B o f2+7676754##&&7673256767632#"&5463232767654&'&'&5467>7654&#"#"&54632Q*A,,.-0wH!k>'5
	
	#- b+$ l" &M-Y%d_BW*#'Ie,$ 
S!-%,G" (%)Aa+	#'   U C T e 
`VNF22+%32767632#"''#"&5465#"'&'47676767632763274&#"32>732767>54F2
!AK<,
"1-`'
 N
6<-?"![TI"):=#>
2* Qu<9D
63*)G	1-pQ$.)-"S$0K|t)~P   9-! - : L 
D>8/(2+7&5467632636#"'&'&767&#"2774#432767676(qT!' 	RU#>)T8(
(6$P"r=6s##5	0J^"op?^M.6		6+A&P&QJ	'N@=   KV 9 /2+4&###&&76767323276766332#"&54766564$+Y"K&,Y	<U%.&Ar.#   l  {o;-2+"'&7654'&##2767676632##"'&&546767636233#"'&76554.#""#36366767'4&#"32767676A&N1"#AZ":"`"*,Pb^KO)2#$6=("'D@j&!>9P#		))W	
b|@2

.{=<'0n"Gy)`74Y@7  d > Q b 
]TIA 2+"&5476676762676632#32767632#"'&'4&#"32767676%4&#"36676:F
V8 J\'(7	E4w &$D36K?$8o'%26 
&>LZ^C-HtR'$F /#-;E
6G-\'/0+kW$L VFN)5*#*  4G : 2+&54766763#"'&546323276767654&#"##Q3%(/1N0	.$d		4%*	0**o41E#/	5    2+#"'&'''&&'476676&#= 	V*0-/x }   2+2"'&'&5463266
/4+*	p}`/1"!@    4M  
2+633##&&76TNL  P&   2+2#"'&76676	L)	
: 			 !  2+4632'&&'&!Bd	  =   2+"&547632326766324>
,%0M
jG7*
&.D,	<d   $p  2+6632#"&(.W).      2+2#"'&54764#"3267P$.	?<(W*/+	% 4.%&U0    .; %  2+"&4676763276##"'&'&'&#"
23 		+.
1-	
 ( @  ) 	 2+#'&5476676363#'&547667636!8:+$	!8:+$		BDJ<	BDJ<   6   @  2+3&54763667764'&'"'&767633##&547654&'&'"32#"&#"=$##F	&  L=!"cb	/(%
   E     
2+632#! '&76 76'&5"  5I23Q    ) _ 
A3# 2+32#"'&546764&#"3276764774###"547>?323376732#"&Xi#b//]?H^OHD_YM 41RL\(ii	ii	hHJg ?H|}=4Qkjb91G]L\<
	B
	B  9   Q  2+3&#""'&76763267676763232"#"&#"#"'&766327'&'5"232>*>
$'FK7vn!
-+	
  J   ( S  
]T.)2+47!2"#"'&7655#&###"'&546#"'&674###"'&'76767337767&5467676632323327676766332#pʺ)r'
 

-#4""MMJ*		*   6  [ e  2+3&54763667764'&'"'&7676!!#2232#"&#"#&54763667674##2232#"&#"=$##F	& 99$##F	V]
$GF	V]			  M   C =2+5467436!!#"'&7654'&'&#"26767676632!!&74 }RoewmoH/')
,1V&5'W32s    @ \ ( 2+!"&#"#&&767327676654'&&#""''&76763276676767632#"&7654&#"32"imA
G'&7B"(F:Ie-1&2(?*I.$QB!&&3
R-ZT
)!z>b	
!(?     i u  
|yukA
2+4&'"'&7676332632#32#"32"#"&#"#&&767327676766#4#"'&&'&54766?64"%4&'"27676)'+f]'; `"#An-.hkB

3Ja
\'3020MV!p	LC(#D	U*;&Kq,+~L89,*
-*
F8    8 ~ L2+%45'&#&'"'&7676332632#7267676766332#"32"#"&#"#&&767327676765&#&'&547654'&76732k;'+f]';jq,%$#H.hkB

j	'0	B	X*_	2F5n-,+*	(x'0($
,04,]   d   ^ 82+73354&&'&54676363233276767633##&&76767654&#"##&546763=#x]y	I/>"+	
FTSK1*C<9,qCS 	Ta,&xSLPa9I%$-LW.[J=I%\!43  Y *  2+6332"##&76dvmE!}	  s   
2+6 !!&76~==		  {k   2+"547676276324J#		?#.{EU^*
1J,.  xy  2+"&54632'&5476765,,9 
	E=,#	OG(	
8K	   {_  5 " 2+"547676276323"54767627632'4J#
?#.4J#
?#.{EU^*	1J,.EU^*	1J,.   x  ; /#2+"&54632'&54767653"&54632'&5476765,A
E,A
E=,#	ZH
8K,#	ZH

8K   0+ i  "&54767654#"#"&545"#&5476?64&&#"##&&763263226632763232676632'2
/1C3" s@	(	
kivs	;G7B	.11 
/%yD;R$/	s" %#B#	6643~1
=3	+G	                              K K&[LmA`9	'	m	

B9=Uvis#t ];Q/O   !I!"&"##$ $$$$%%V&4&'\'(i()**n***++=+k+++,<,,-Z-./ /00122+2M2y233^3      w_<                 c            2    M     3 k 2 s2  3     3 Ef T3 k  n n J ` . j x  c k3 k3 E t   ; 8  7 6 5  6 1 N 5s 6 ; 4  7  72 J     0 e Q3 I3 Y e l g e k3 . E3 K3 E  W2 K2 K g  e K LL W K K K : K 6    8 \s :  U 93 K  dL P!3 ? s 62 E  9 J 6 M    d Y s3 3    0    Zqc                          1                       PfEd @  ! 8 Z    ^                      0   H @   # ; = [ _ z ~         1S7   !     % = ? ] a ~         1R7   !{j2/ifds                                                                          ,  UXEY  K QKSZX4(Y`f UX%a  cc#b!! Y C#D  C`B-, `f-,#!#!-, d BCC ``BCB%CCTx #CCadPxC`B!e!CCB C#BC`B# PXeYC`B-,+CX#!#!CC# PXeY d P&Z(CEcEEX!%YR[X!#!X PPX!@Y 8PX!8YY CEcEad(PX!CEcE 0PX!0Y PX f a 
PX`  PX!
` 6PX!6``YYY%Cc RX K
PX!CKPX!Ka cCc bYYdaY+YY# PXeYY dC#BY-, E %ad CPX#B#B!!Y`-,#!#!+ dbB #BEXCEcC`Ec*! C  +0%&QX`PaRYX#Y!Y @SX+!@Y# PXeY-,	C+  C`B-,	#B#  #Babfc`*-	,  E Cc b  PX@`Yfc`D`-
,	 CEB*!  C`B-, C#D  C`B-,  E +# C%` E#a d  PX! 0PX @YY# PXeY%#aDD`-,  E +# C%` E#a d$PX @Y# PXeY%#aDD`-,  #B EPX!#!Y*!-,EdaD-,`  CJ PX #BYCJ RX #BY-, bfc  c#aC` ` #B#-,KTXdDY$e#x-,KQXKSXdDY!Y$e#x-, CUXCaB+Y C%B%B%B# %PX C`%B #a*!#a #a*! C`%B%a*!YCGCG`b  PX@`Yfc Cc b  PX@`Yfc`  #DC >C`B-,  ETX#B E#B#`B `   BBB` #Ba++"Y-, +-,+-,+-,+-,+-,+-,+-,+-,+-,	+-+,# bfc`KTX# .]!!Y-,,# bfc`KTX# .q!!Y--,# bfc&`KTX# .r!!Y- , + ETX#B E#B#`B `a  BB`++"Y-!,  +-", +-#, +-$, +-%, +-&, +-', +-(, +-), +-*,	 +-., <`-/, `` C#`C%a`.*!-0,/+/*-1,  G  Cc b  PX@`Yfc`#a8# UX G  Cc b  PX@`Yfc`#a8!Y-2,  ETXEB1*EX0Y"Y-3, + ETXEB1*EX0Y"Y-4, 5`-5, EBEc b  PX@`Yfc+Cc b  PX@`Yfc+      D>#84*!-6, < G Cc b  PX@`Yfc` Ca8-7,.<-8, < G Cc b  PX@`Yfc` CaCc8-9, % . G #B%IG#G#a Xb!Y#B8*-:, #B%%G#G#a BC+e.#  <8-;, #B%% .G#G#a #B BC+ `PX @QX  &YBB# 
C #G#G#a#F`Cb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca#  &#Fa8#
CF%
CG#G#a` Cb  PX@`Yfc`# +#C`+%a%b  PX@`Yfc&a %`d#%`dPX!#!Y#  &#Fa8Y-<, #B   & .G#G#a#<8-=, #B 
#B   F#G+#a8->, #B%%G#G#a TX. <#!%%G#G#a %%G#G#a%%I%a  cc# Xb!Yc b  PX@`Yfc`#.#  <8#!Y-?, #B 
C .G#G#a ` `fb  PX@`Yfc#  <8-@,# .F%FCXPRYX <Y.0+-A,# .F%FCXRPYX <Y.0+-B,# .F%FCXPRYX <Y# .F%FCXRPYX <Y.0+-C,:+# .F%FCXPRYX <Y.0+-D,;+  <#B8# .F%FCXPRYX <Y.0+C.0+-E, %&   F#Ga#B.G#G#aC+# < .#80+-F,
%B %% .G#G#a #B BC+ `PX @QX  &YBB# GCb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca%Fa8# <#8!  F#G+#a8!Y0+-G, :+.0+-H, ;+!#  <#B#80+C.0+-I,  G #B .6*-J,  G #B .6*-K, 7*-L,9*-M, E# . F#a80+-N,
#BM+-O,  F+-P, F+-Q, F+-R,F+-S,  G+-T, G+-U, G+-V,G+-W,   C+-X,  C+-Y,  C+-Z, C+-[,  C+-\, C+-], C+-^,C+-_,  E+-`, E+-a, E+-b,E+-c,  H+-d, H+-e, H+-f,H+-g,   D+-h,  D+-i,  D+-j, D+-k,  D+-l, D+-m, D+-n,D+-o, <+.0+-p, <+@+-q, <+A+-r,  <+B+-s,<+@+-t,<+A+-u, <+B+-v, =+.0+-w, =+@+-x, =+A+-y, =+B+-z,=+@+-{,=+A+-|,=+B+-}, >+.0+-~, >+@+-, >+A+-, >+B+-,>+@+-,>+A+-,>+B+-, ?+.0+-, ?+@+-, ?+A+-, ?+B+-,?+@+-,?+A+-,?+B+-, EPXEX#!!YYB+e$PxEX0Y- K RXY  cp B(  * B
* B%
* 	B    * B @ @  *   D$QX@X  dD(QX X   DY'QX @cTX   DYYYYY* Dd DD                                       T T % %>  3       	 r  	       	     	     	  B   	  "  	  B&  	  "  	 dh  	  4 C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0   D e s i g n   S c i e n c e ,   I n c . 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y K a T e X _ M a i n I t a l i c F o n t F o r g e   2 . 0   :   K a T e X _ M a i n - I t a l i c K a T e X _ M a i n - I t a l i c V e r s i o n   1 . 1 ;   t t f a u t o h i n t   ( v 1 . 8 . 3 ) C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0 ,   D e s i g n   S c i e n c e ,   I n c .   ( < w w w . m a t h j a x . o r g > ) 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y   ( < w w w . k h a n a c a d e m y . o r g > ) , 
 w i t h   R e s e r v e d   F o n t   N a m e   K a T e X _ M a i n . 
 
 T h i s   F o n t   S o f t w a r e   i s   l i c e n s e d   u n d e r   t h e   S I L   O p e n   F o n t   L i c e n s e ,   V e r s i o n   1 . 1 . 
 T h i s   l i c e n s e   a v a i l a b l e   w i t h   a   F A Q   a t : 
 h t t p : / / s c r i p t s . s i l . o r g / O F L h t t p : / / s c r i p t s . s i l . o r g / O F L          2                               	 
                       " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > @ A B D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] a                  	
      uni00A0uni0237uni02C9uni02CAuni02CBGammauni0394ThetaLambdaXiPiSigmaUpsilonPhiPsiuni03A9uni210F    ׾	xL#wOFF     L     ,                       OS/2  AT   S   `Ecmap  A     Daecvt   I   9   ZZ6fpgm  B    b.|gasp  L         glyf  D  =/  gh|*head  ?   6   6cfBhhea  A4      $hmtx  ?  _  9loca  >    ֨jmaxp  >t        3name  J    r_|post  K     Oprep  I@      exڌ{I"U*[jv0{ó=ff[|nU*eFKʌ?#"D+H6z	D;N5۩zwZ]|Fy0g'D%|(	lMB<:N[vtmyٕ+O-OߐbP)z;"kAzoq<f	9i/&e9z3h<|59uw^%O"z۲M殢A[^լ_T_?L[8Pw4|'\G',Ku:\E_PP/hW.'Wua1~#anԫ7чz'ڟj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/2EJ9     `cmap&@    Tcvt m7  (   Zfpgmb.|  h  gasp     D   glyfFz     headdWC\     6hhea	     $hmtx&8    tloca[k    >maxp      name_}  ń  xpostU7-    Eprepe  t     2       33'3#2d222  N     
2+4632#"'&#"'&546N#%((? )#"!C$	(    "{t  3 ) 2+"&47674##"&546323"&47674##"&54632IA#!$A#!${BY##& -=6)BY##& -=6)  8>	 S ] ZU22+47376763237676323##32##"&5457##"&5457#&5473774##&4##3378*)Q*)
P
^_tr
*)
P*)
Psr^_^_[			LM	
%	
%LMLML   7 L [ e 
a]ZN?2+7##'"&&'&'&546767353#"&546375&''###5#&'&'476624#"3&#"664&>-	X*>0&.R-X))0J9
.^&*A#.3*;	,=3 '2T*+>\..;+9D`5Gj
/.:.@"Lv;('?zI`E   8 7 I Z n @
g\VNB9%2+#"'&54676322767>32 #"&547666##"'&&''&#"3327654467632#"'&&#"3327654?'%6#PJ7'GV:]9	jq7=CBL/J73'''%6#P
%/2+X987|Op	?J
H5@vB/abOo	7;WY9879@C7/ba   * J \ l 
i_SL<2+&547632767754&##533273#326753#&''#"&54767&#"7674654'&32765&&/'4)5	!*F'g%E'	jRNH.".*&8(O@SMOXLjQ#&S
	8,@>P
[e\S4)	K3#6Ia
1v ..$
|:	!&5$	;K=		@\A,&Pr=.KG	W7	=?M.k/5  N{    2+"&47674##"&54632vA$"${BY##&/?4)   ^M  2+##&'&476766732M.i	8ze`  7&  2+7233#"&5676'&'4<.i

{c`t   @@ > 42+"&54767&'&5476'6632>76'&&'#"&'7dt
q?
Y.q?		7?S.B)	SKK.   8G  2+647!57632!!"'!8+
	**  N>  y  2+64632#"&'&7675"#"N!&#;>#2$@1Y@?[        2+75!
II  N    {   2+3"&54676#$$ "#  8  	2+63 #"&54 
\
E


  '  1 $2+632#"'&546%&"327667654&5&&`8aI7%+6*+s5+T*)IQ2*SR:iR]y?  BQB`&F==F&`BQB   S   !  2+!&#"#532767"#53676762;:.9T82!..#
.   2   7 2+"&5463227676753!5476767654&#"32n mLVq#U$@;L

(SmCE>:$!$Hg]K:3*I=89]y'[LBY4$#  * R 2+"&546732#"&'&46323276554'&/&5463276654'&#"Z;?0BI7=T5)8EBf
%$6F7@.*,.#2&
!"9M!=
;]];4V#8/8#$"-5!D_ W=A	"!     # ' %$ 2+!&#"#536767655!57676333#3'sx	+
\\1m.42.4.3).N  2 E <"2+72##327654'&#"#"'&54&54363327632#"''632#"'&'&546k!">*G&N(ADGAQ|
9<CU]?,' !  *<%[g$!DR8a.vO[#/=   * - B 8/#2+&'"7632#"'&&5467632"&54&#"32766=4&u(F//)F.#&<2+5\ULD6?:G0,%1
0!3Y<A<X3;4-l-&>6-$1mY"*&:79:  7 2 2+67743333#"&54767677#"#7KyD&4
N@.]	(kk
']3Q)G		!* Y?  + & 9 N 
J<5+2+&&5476632#"'&547676674&'&#"66763267654'&'&&''15U7DdL8KwY{:Q8(5$$;:6V9)C#K!	?O F9+-7G8B0&<YQsZ$3L6+<$ +%&+;M"+!1	);  * 0 F <2)2+732767655#"'&&54676762#"&432&#"32>54'&&"0!')JP8&4HQ.+<#c6?M5e
&1&+'`	
28DE$D4:J&4UWa8?;p=JD(&/ 7="N".   N       2+"&54676"&54676#$#$6$ "#$ "#  N>   &  2+"&546764632"&'&767>#"#$U!A6	-
6$ "#4#qQ@	8?   S  2+"$''&547 32	ڏ=	RߤDE
'N  8 o 
  2+47!!&47!!&8}|[   S  2+4632#&5476%7&'$'T	& pDEv5A   7  2 @ 93	2+"&5476726332#"'&56676766554&#"#"'&546.<'-(7^
+08%)> )#H#O?*C\&,<@)* $-$)Y$	(   8 Z n e\SG2+#"'&&''#"'&&5476763232327654'&'&#"326773#"'&&'&5467632%&#"3276775'&	0#E7)!;J%.WX7
&#0Z<=<<M_}V!=1;
Jy~MDLfLDLf
.6#"/4!!]0GD$2mMN4IS	t`J_,&g3.Sy 
	,"&a
!"&`jCS248

8      3 < :7 2+3&#"#5367676333#&#"#53254''#33&''33aYHhg	4	p
F'23ef.'53G
..HG;;.[W@;      $ < N 
HA4+2+&&'#53#536674&'""&""#377677664&''#332766
)!6":RB
FebE!)
|5*'$'ST
'2</ed^1*+3n
.	!33UN<;T
.
/D}}E9PJ   8 ? 2+#"'&&'&547667632327672632#&'&&'&#"32676547lU$%pp 
I6"	N8hFO&sGIlZ|	"!
z5'%RxFOyF;DiG       5 +2+&&'#53#53667""&""#3267654&'&
)!ɫ(bl!)
	!!
WAK$N,8,n
.n.o.
?	Ae}&      I C2+&&'#5!#5&'&&'&#"36766753#5&&'&'#3327667676753!53667
)!<(CR
:d	6A((A6.3Z:A	('!)
k
.tt^E
zy)**)-.%<.
     b B 72+&&'#5!#5.'&##"3>753#5.'#33#&#"#53667
)!-(!_0+4*&!((!&*4%!)
k
.tt".%""%..
   8 Y *2+326326633##"#"'&''#"'&&'&547667632327672632#&'&&'&#"3267655&'&##5
%
 
$@02%pp 
I6"	N8hFOKHo/G
;.gf
 |	"!
z5'%RxFONM*"
24.      E (2+&&'#53273#!5&&'#53273#3#&"#53667!3#&"#53667
)!!)
)!!))!!)
)!!)
n
..
zz
..

..

..
    S )  2+!& #5327676'&'&##53 73#"33H''''....    C 8$2+72327667<645<&4455&'&##5332626633##"#"&#&&'&546Y$6	'=
(!)
pG6H$# 	:)2<L"5.,"
..?R	>,
$      a 82+&&'#53273##"767674'"&##53326326633#3#"&&"&#"#53254'&''3#&"#53667
)!6
rK,
*$	z.NW.;!!)
n
....$	
..x-_^..
    F / )2+&&'#533273#"327667466433!53667
)!%FG;8!)
n
..NI.
    w I 2+&&'#53267667633#3#&"#53667<5'"'3#&#"#53677
)!jiVOij!))!!)
 I	fhDn
.P".

..
MJ`iZFH$..      5  2+!&#"#53677#&##53&'#533273##"'& '3	fhD
>UUCcf	IpI.$.}}$..#L$.  8  0 &2+#"'&&'&5476767632&#"32767654'&ĊjRK`	mZB)&(%5E
g1?D4BUq*j$>	H#RtkK9R)@X9     p & < 4)2+&&'#532#3#&"#53667&&##""#3276654&
)!Mw`?e^;!!)
X7<GMC7n
.ZC9Sxw..
BI/3   8? 5 V d 
\WQG,2+"&5476767676323267632#"'&'&5'463267654'&'&#"3'45&7"327654'&CK`	mZBF*:-&2	5+)
*5%%F56ZA6BkU!ԗ!	pV$>	H#Rt0vT1!2'"Ga
;<Z%2	9UTU-XV@
	
0   P d \S22+&&'#533327674632#&'&&'&&/#3#&#"#53667&&#"#32676654
)!
-#_U:H#	)
BB)!~!)
h
WY&:KHn
.	0S8T(B|$"(
$;j|'
..
<&*(   7 Q I!2+7327654&'&'&&5467632766772632#"&'&'&#"#"'&#"'54763Ys_'/-#:L>.((O1T%&4C"
TG9IZI
jBYe'B+G%eC<^"
~)C5"9iGRq:uw   $   = !2+6655!#5&'&'&'&##"33#& #532767'&&##"#$c(&8$66$/
+ (a	..	k   ; 42+&&'#53273#327667655&'#53273##"'&'&'
)!!)	#-@<NC		I|UA<pn
..
A%+Q@̼$..#/Pq:}	    0 *2+&&'#533273#354&##533273#"#"#"''r%	nx.*	bVJl..
..)    R  2+3273##"'&'#&'&'&'&##533273#"765&'&'#533273#"54'&'#5hM0b`N9&	*Uv.
LK?A
.jy
G9.@x
..I..'.      _  2+!&#"#53676654'&+533273#"32656'&'#533273#3#&#"#532654&''3tbY 6	o|*wh	tbR"FB'	o{*H%%
B .'....#ig	..r99#d.     @  2+!&#"#5367655'&'&+533273#765654'#533273#33~!;gh0	p|0UVLN.		bE$S_\/.hj..	..-hi.  7  0 . 2+465! 23676676753#''&5565"#E9Y	AD(LK		89I	-(FH  v    2+3#3vaa(h(   8  	2+432 #"'& 8\
C	

      2+53#53a((  p  2+7&''''76;657
$}9|0./
$       2+5!>%%   " ? O JA'2+"&54766323276553#"&'5#"&'&5476767354'&&#"4#"32676.N8Ba(	0!'1A4R'"Dj
2%C&0#(9	1 <0#ab!	+$'(%#),$/'"!&:	H".0#  
 ) > 4+2+2633367632#"''#'&&'#54&#"32767654'&7RG_sUM7
!7F*/@%.yXQo;		*-:06#@J%?   " 2 ,2+ "&5476&'&#"327676633#"'&'&476672632s,	3/)E*2[2-c
iM2 /nR/=
9(H3w4Np
D	  " ( 8 3*2+26333"#5#"'&'&5463254'&&'#54&#"32677,!9IF6>|VJ:!K-D1&*/#@.
70/7Ya1fh?$F>o)!&!    $ / .)!2+%!327676632#"'&&'&5467632&'&'"3$X+S<9ZlO
[_R	A4!J&J  
	4CR:$%\
kBm0 9     t 8  2+!&#"#53327655#53577667263"&547#&3#3mb*GGR=#0.	'
ol
+..BC
7D*")KB..  2 I Y r 
i\TL02+632#"'&7475#"'#"'&'&547677&547&5476632326764'&#"&&##"327667654I,9 !/`03	?Tq~NR=>$,L/3,". (B*73C8%! %9,)0)'E#_3;1)5.',7*'&|68!D=!	&	''"     T 2+2633632;#&"#5332565&'&&#";#&"#533275<644544&445&&'#54>R{*5 -"#**!Kq.. "#5#6!..	&13;%SB7         ,  2+#"'&54626333#&#"#53327654'&##54 )#H][*3$	( 
..
  3   2  2+#"'&5462633#"&5462327676'&&'#54 )#OR8-D.	*"$	( /.=/)I      _ '2+2633767654'#5332626633#33#&#"#53654'&&#;#&"#533275446<5<&45&&'#54<<	j
E/J#Kb^**!66	..'?	..
8:..	&13;%SB7      + 2+2633;#&#"#533275446<5<&45&&'#54*\b*!..	&13;%SB7     3 ~ 2+2633376367632;#&"#5332565&'&&#";#&"#5332565&'&&#";#&"#533275446454&55&&'#546ca3D}*5 -"#*5 -"#**!(&MI0q.. "#5#6!.. "#5#6!..	#+G      S 2+26333763;#&"#5332565&'&&#";#&"#533275446454&55&&'#546cs*5 -"#**!(&Mm.. "#5#6!..	#+G     '  2+7467632#"'&&&#"32554'&tQ	W@FY?K^8 Iz[
@Fc?]yQ._(= A=  >
 > L C? 2+26337632#"'';#&"#533275446<5<&45&&'#54"327654&'&=M
F^
M= D4**!G4)G*"6>+,zWA^
,UW..",-5"J:1AH%8cEj  !> ( ; 6-2+%#"&'&4676322773;#&"#5332765&'"&#32767u<M8Z F5*&C)%**D<)8+E!1<<,8l7''..[UYC1FBkJ    l E *2+26336632"&54765&3#&#"#53327546445445'&&'#54.&'*(
+	mb*!E $%&X''..	#+G   !g I ;2+4&#"#"'#"'54676323254'&'&'&'&'&5476276732#&'81\	,.9?UL<,	#>a8B(		<.4A	
EGH$	
O@&3N
>s  Mg $ 2+533#3276553#"&'&55#53676(#,
(5+6@O	%.X.}!'G&##.(2;3%0    < )2+26333276746<5'&&'#526733"#5#"&'&'&&'&##54"$:
!!*'"@F

2	Q 1,1.
.
E3
/4m    .  2+33273##"''.'#533273#6754&##5R+$98
W_'33<.%		i
..O.   N 2+"7654&'#533273#"##"'&''#"'&&'#533273#>77'&'&'#5332730Z)*RD/v0.U
QZ&,,	#		"
J\ wz..+'s..~2f	..      ^  2+3&#"#5367677'&'&'"'#5333273767654'&''#533273#"33#&#"#532654'32TJG!/.:;	$C,5$?VL	1 >A;
V\	Q=
.!><NQ	..X""	..
&UX..oR   4 A <2+23276677''&+533273#"47754&##533273##"&540*$HK-	U^	/e.,	L78T^'6)5B83+.. rr	..#<1'     1 2+4675!2767677433#''&5476 7##*
TC 0>+:C(
\+P	fP	  A B $2+#"&'&'45&'&5&&#"&4632676676767672633#2LmD))D,Y8%
no	
D)36 Y--v ,N#&K$  w  	  2+"'632
	6  A : 2+4633232#"##"&546326767767&'&/&'&&#"&A
	Pj
F,'E6q1G
f!7
G163	$4,u 4* S	!1
 )  S >  2+6323277#"'&#"''476-+#!+,#0'	"   X e n jfG
2+473776767632#"'467754#"33#33276676632#"&&''#"'&547663233677#&"367&#".g!8<@&I*>.,,	]

,,
^=1.A	/	K2@7"/#LROx%L<i#"eD0S(0!9T.
$3jU/	   E4v O ` VP+2+46732#"&5477&#"#"'&&546323276654&'&'&54677&'&76654'&'&#EN8(A#6	"0(3;/'GWA%(#6	"0(C//'I!,?*J#;Z*2
A*.H/%!/H-<@]:%2
A*.H!+?/H.<C2Q+B1X+  _*   2+4632#'&74672632#"&_!!! ###d###"!""   8 Ycd  2+47!#"''5!8
	C
kk  `  " 
2+6632#"&'&542654'&#"&#"4$LG'6g%'77&@)
   8    2+47!547632!!!!&47!!8+	
**+@

%v  7?F & 2+4672262233##"'#"'54#4#"'&&'&7[#-""F0Pn\AZF  |-v  2+533#536367654'&#T.$0#W
-G1,&%	$
     j W b `[ 2+!&#"#532767#5!#.#"326753#5&&##32>76753!53327655#33&#'33 bYII1(-C=I	(J0((0J(	K?I1
(&)%	/	10CD.&.BC0
 @@ y{
0E@.zyj7.l   	v / 2+%#"&''#"&547677'&'&5463276632v	"MhijghhgjihM"	hhhh MhihghhghihM hiih  8 1 > M 
IB;32+47673#"'#'477'&'&476767632&#"774''" 32670 OjYS8 	eCZl@<3Cb@BU2 .53]3

.Rs(*q3X--	\	B	pV$H*$MQUl-O8L1%   Y %2+7"#53327655#53567476632"'&54632327667654'&'"&54676654'&#"##&&"&[*NN\:9WA.	9IbGB%;!(	077%-..IN/;3)4M yOLi5,)~:!D8S+#   % P ^ p 
meZR)2+"&54766326632!32676762#"''#"'&5476763254'&&'&#""%&#"33544&'4'5326.I4K+M,O[] 49$[@`;U-;=k(;&" gg	?b,"4H1 5(lU).'
':G$+2$:)*	# /F"#<%
/(0=   8   # 
	2+4632#"'&47!!4632#"'&>&4& 1|&4& 1(1 &0(1 &0    . ; K 
C<:32+743#"''.''465&'&&547663234&'&#"77327654'&\@	>]7)D		B',' `6.)'N#"Zv	in	5F\_tr]3I:16&G(Ud*d 7[+        
2+26333#&#"#53327654'&##54 ][*3
..
   F [ r h]
2+##"'&'&47676767323#54&&'&'&&##"36366753#5&&'"'#326767>553&#"#32767654'&'	"5gV{CK`*/"	(!>?J
<C'(((C<
FQK%(6UsaJ1@]	B	pV$>	
b
{y)11)
#	w{tJ!"I    3 E S 
QJ?502+%!3276762#"'&'#"'&'&54766732367632%&#"327654&'&'"33|IP;P,Ad>5SgON9@[RY\%/(<!+0$-%>@hgT
3AC	T#7j
Mi-Op(#2%!DBJ$0mn4mO  3  $ 
2+2633#"&5462327676'&&'#546R8-D.	*"/.=/)I   p  2+7&''''76;657
$}9|0./
$   r  2+723>3&'ro'9CE&c!?!	11   E N   2+5!Ei ..      2+2'&346676]KG36>:CG  j'  2+4632'&'&j&*%GK071:>  \  	2+32676553#"'&&'53@.":%<..<%.>$!9XX9
  O%    2+#"'&546 )#$	(     " 
2+6632#"&'&542654'&#"&#"4$LG'6g%'77&@)
  S5  2+6323277#"'&#"''476-+#!+,#'	"   z    2+2#&5467632#&54676["/["/	
	
    F , !2+&&'#5!#54&&'&&#"33#&#"#53667
)!(OpQ
%!)
k
.ttg>	..
   .      2+3&54 7632 '43SS8D{H[q   8  4 @ 
65*2+#"'&&'&5476767632&#"#3267654'&&53353#5#ĊjRK`	mZBGe
N9  3\1Z(((Uq*j$>	H#Rt,vS/EA'Mk92SaL;Uw""""       9 2+632322233#&#"#5325&#"33#&#"#53676@cdjxHF'bQC..rr..(g  *  p  # = 
'$
2+6654 "54&'& "53!53#5!&&532 766765433/,(N(\(4((́

993333--     . 2+&&'#5!#3#&"#53667!3#&"#53667
)!!))!!)
)!!)
k
..

..
=
..
   6   9 2+%! ''&776677&''476!!#5&&'&##276676746753@{~{ (?U'ih6=>&(H!`Q	!L(\  7   H 3	2+#"&4766326767632#"'4&54&#"33#& #532766754'&'&#"e
	J9r&7/A!05#42%%f#5$=Nr7/N.&"4.. &   8   I T _ 
]UOM( 2+!& #53276675#&'&'&'&54767676735.'&##53 73#"333#"6654&'&'#%H>VV>H%&%M{{M%DE
85EC<=.Y"0JJ0"Y..Y
F1 "1F
Y.VFJ
3FHGCG  7   a O2+"&476632255.'&##53 73#"327676767633#33#& #53276675&'&'&E	#+#
6	%&%[
#,,-%%	*:6	..-:*	3;(--..Z3   ,   ` ?2+7'&'5335.'&'&547667633236767676573#"&'&5476767654'&#"#M(6,	@
_	Z9
@',6(\J	 
g**f6
 	VU-2-g6% KmM2B %6g=%-UV
2(_a7*4U1N"$7a_(1        2+55!%%        2+55!%%   @{   2+#"'&547676763632"&-
A"$'-L9
BY"  N{    2+"&47674##"&54632vA$"${BY##&/?4)   {  5 )2+ #"'&547676763632#"'&547676763632#&-
A#&-
A2$'/L9
BY#2$'/L9
BY  "{t  3 ) 2+"&47674##"&546323"&47674##"&54632IA#!$A#!${BY##& -=6)BY##& -=6)  7( A ! 2+267632#"'&##"&'&547675#"#"&54632'&'&556
*(""(*

	$H@$	#>7**λ7>#		@H$  73 E  cF$ 2+232667632#"'.#"&547654#"##&546323654'&52327632#"'&##"&547675#"#"&54632335&'&5R
-	
%
&
%-
R"(("&"(("/7=?77<?7g/;(	$	(;;(		(;   N  E {   ) 
# 2+3"&54676!"&54676!"&54676#$#$#$$ "#$ "#$ "#   )0  	 2+2'&5476&o0$
P	
   ) $  &5462""#"&547#'&547c
+ /{&%	)
	(	
  0+ ^  473654&'#&&763263233#63232676632#"&54767654#"#"&54774#"'&ZQ\\=L7B	.11 '2
/1C3" @ !"$3	
	

	[

PL=643~1
=3	+G	/%yD;R}}  7 8   463232654632332#"'&'&'&#"32#"&'&"&5&&#"#"'.'&'"&547326323667654'&'&'&5547632#7yTNK6;1	`,(*84*:92@	
Lyd/  &!%]	=<
3!9	80

&8!+*'9&,G"'3J
Rt4%K
0E<
C,H/*YE!@	!G-*)
	/ "#E!4+    7 I  $2#"''"#"'&467754654767672632327674#"667676YU=X=

)!&M0//&.	",kh
O;
' :YsJ
-	,%!'"	BFF	  C(q O b  %32767654&#"#"5477&5467632#367632#"&'4323276654'&&'j*'&"!!Ay.
+I1K%^<	`43YV-3(/&
!C	m)'Y? %.eN(7
:lbNh%8Z)e'&7#pjZ+	-'; < W<;
   (    727654'&'&#"#"&546232>74'&'&'&54762>76726327632#"'&&54654''5##"&'&'&5475463263376654&''!N,$ L%"	3L%!I|  #V6 m	1"(+?QQX=?#*k/Q'ǰ *H3!!-/ 	
*!#*'G#(:	I($!#M7dc:U&]4"7)
	=J+&s78  7  + w  26675'.5476"&'&'&##"5&'.''#"&'&547636654'&'&547676'&'&'&5476T
$
	(	
9$p,!7*"00 
1,
$?<
	
	>/	1,{:n$#(##,#>T8'%  7 (   !#"&'&'&&'&'47667>32!g eGGeiO{

IrrIwS   ? 2  "54466462676676762#"'&''"'
MplK
	tA.N2yQNs a
"
F&  8 &  647!&'&'4&5432#"54767!8G'fD		Dfl5K0/	CiiC
}P  9 5  %2"'&'&&'&&"&4&&454327637676
KlpM
	tA.O0VsNQy a
oo"
F&   7 B  6632!&'&5432#"54767!#"&'&'&&'&'476676ik fD		Dflbg eGGe
wSP}	CiiC
}PO{

IrrI    a  "5446646267667676322#"'&''767632"#"'&'&&'&&"&4&&45432
Ko	mJ
	tA.O0
Kl	nK
	tA.N2tN
Nt a

F&sN
Mt a

F&  = 8  "&47654'&54632767632#"'" #"'&&&''4	0@I D8ES$uM.-8LO^E9
 #	+uM--gY  7= 8  462327632#"'&5547 #"&547666##"'&'&F8E!=>
0	7.-Mu%SE	$
	9E^OWi--Mu+   7$ ;  "&547676322&' '&546325&'&547632#"'&#"`ES%u2OT%7	0
>=!E8+u2OT$
iWO^E9	
$   $ >  64632>7 76323632#"'&'&#"#&547654'8%TO2t$SE8D A9
0Yg$TO2t+	#
9E^O   7 4  632!&'&'4&5432#"54767!"&&549
G'fD		Dfl


=K5K0/	CiiC
}PK=

&   7. 5   #!#"&'&'&&'&'47667>32!67654&'&5432.T9g eGGei<;*9dCO{

IrrIwS "(   7. 3  4632!&'&'4&5432#"54767!"7U9<;*G'fD		Dfl9)dC "(5K0/	CiiC
}P   7    7&'467674767732!>
<	0hQP  7   67!!#"&'&'&&7cL$?
 NaP  8    432!&47!&&'&<v3RL&r>  8   647!#"'&7667!8c<R3U?q&  7  .  432!&47!&&'&67!!#"&'&'&&<v3RcL$?
L&r>oNaP   8 7  %!#"&'&'&'&&467667663!!!
3#J*.

f.#3
c
1D74

6E	F
\	E6
'(   >C ?  #"'#"'5467667664>32#"'&''#"''&'6?XX@4		&%	212+cc+ 11B90  8 2  47!'&'&5432#"547677!&547!767&'&''!&8c
3#P f.#3

1D74
s[
6E
E[	E6
'(  >C 7  2767632"'&&'&&55632676676776	4@YY?6	%&	1 ,ff,2121A91   " H Y  6632325&'&'&543"547674#"#.'&'&'&47676'!!7677'&+5.D!!>5.D!

!-	#=

5"	7	"5

5AB8C
	FL	
AB8C
	FL,#$      C F X  >32'&'676"'&'&'&'&'5476'&5567676&'67677"R>A?@=7229<E33E<9]w% !% !R!6Ԗ4."====/-X-/VA':6#	Z	':6#	   ,     4632!7>563 "'& 4 
,,0+
{uts; 	VA  *6 7 L  "&5476676332#"&'&'&54767676327654'&#"4'&#"32767676I3!Sc4ZQb5FKDBBO&@)%Q0IdM/
6Ig;RRK%) #	 gD>DS6s#$!%i0&"WH!_M!=9   8     47!#&47!!&47!!8
xzh	  ' 3 F Y  >7632#"'&#"&477'&'&547676324'&#"66732766746554'&'K(&6E$"&*2@+ *2%S,+("T
"''WV+1&
"',VSG!),0"p>3@#[c>05   .    47! "'& 4 3..HN    TG .  746726233!!3#"'&&'&Ts 4choKjDkIoham\w
	aEDd	~W  SF 0  4732##&547367676767655!&47!54'&&'&''&Sam\dfaho  EDjJoh~WF]	6REc	  T    647!!TE  8Z   47!!!!#"'&55!&47!!8}*+v%   8   63 #"&54 
\
E


  8   432 #"'& 8\
C	

   @ # I  &5472636677632#"'&'#"&5465#"&47>7'&'&54632<
.Z	t<
%EB.		+
=,	T+
"	  7 7    %#"'&54632'&#"327654tNT96qQT96k'5-&BB(0/(BQq<8PQp<810OP00PO  7 7   %#"'&54632tNT96qQT96Qq<8PQp<8  H8U    2#"'"&54667632276B
	AAE /43
  8 2 F  7463276632#&#"3273#"'&/#"'&&732767654'&'&#"8dReT+l;#
S>;.,GB#,V~"!1?%D;V<;<=.;Yd&IH'c(	X@34CrGIma(	XU
a  7 ' 6 I  6632767632#"'&''#"'&&542654&#""32767'&'&'&PX=VO&$ER+'!:LP?VM&$ER+'!:L@NPB71;7 N5AL:-44:7 F<E4A=/
c!vLNu	=/
c!vL9eAJj &Y()
`IdB<c!&Y()
T
  7     %!&5476 7632!8	FA

PJ	  w  	  "'632
	6  o  #  632#"''&&76326#"'&
	6|o
|   7cV    632#"&&'&&'#"'4>	Xs?c(ODZ=)#   7cV   632>7>32"'&7	Xs?c(DDZ=#)   7cV )  "'5456765676632#"'45&'&&#"X	&yHR!
	
j:G"1'$*2<3))EE/!"'J%.  7cV (  2#"&'&'&57632327676556O		%}FN"	
	UG"V1'$+1=2&.
CMJ%.  7( 8  46276767676767632"&546774&'&"&7(	
I	,(		1"$',q

"q_-

		+"Z'<   7 o 3  2##"'&'&'&#"#"547667632327665465%.L6*'-C	N;
6 6*',"#	o!2OC/4& !Jb	/E$   7 G %  432#"&5476767654'&'&7BI
+)	*!?G
+)	*8cI/MM)Q*gF.NK*Q*  7 $ + 5  2##"'&'&'&##"#"546732332674647!!&B5
"&E@"6OTD
")4@"6Nzz @]51I6!Hc	(1H6h  7 M 3 > K  2##"'&'&'&#"#"5476676323276654647!!&47!!&5%.L6*'-C	N;
6 6*',"#	y}|M!2OC/4& !Jb	/E$   7 7 1 a  2#"'&'&'&'&#"#"54766763263232767462#"'&'&'&'&#"#"54766763263232767>3!%F#-(2'1	9++2},)2'.W@!%F#-(2'1	9++2},)2'.9Q	.
	4,@M	6
 8J.
	4,@M6   0   ?  63276762#"'&'&'&632"'&'&#""&54>76BzzZ^H>?H^Z	E:HF^ZzwZcc
HH	H	
cb
H   8  
  %  47!!&47!!&"&546768}|N#$[$ "#  8 $ 	    47!!&47!!47!!&8}}z  Sv|  &  632#%$'&5676 47!!&	Rߤp ,Cz'N5A	   Sv|  !  4632#&5476%7%&47!!&S	% Civ*	  88  5  #"'&$$'&476 773 #"'&$$'&476 773 		$7		$(++  77 T   432 #"547266773737737373773737377373737737373773737377373737377373? '&%432 #"547266773737737373773737377373737737373773737377373737377373? '&7
B>1
B>#II%G"nIJ%G"n  T %  #"'&'&'"'&4763676767663{'

'CMU'	/K]&x <1g/=O8\'<m   S )  2##"56767&'&'&'&543226'`/K]"x!
'UKD

4O8\'	;n"=/g  T .  746722622333#"'&&'&Ts'2Qn
L7!$ew
	mP?a	
]   S -  4732##&5473676767667654'&&'&'&&''&Sed  7K

K7#$
]F]	b>>a	  Tv| . 6  46722622333#"'&&'&47!!Ts'2Qn
L7!$e1Zw
	mP?a	
]F   Sv| g o  4732##&547;:673367667654'&&'&'&&''&47!!Sedk  7K

K7#$1h
]F]	b>>a	  7cV ( H  2#"&'&'&57632327676556&54735476323##"'&55O		%}FN"	
	UG"UV1'$+1=2&.
CMJ%.		QRAQ		QQQQ  Tv|    67!!!!&'47!!&^M4	
Vl2   @v|    47!!&547!!47!!&@N3W[

6	   =  ]V   7"'67!"'!e


0	  =  ]V   3&'632!62M
		   8G   ( 1 :  632#"'&&'&476#%&&'&##!!35!32766ge`~^02QHHa)),LcIcc;cbbgh$%Y:tQjj  8G  # 0  632#"'&&'&476&&'&#"!5!32766ge`~^02QHHaac\Iffbbgh$%Y:t|je0k  8G  " , 6 ?  632#"'&&'&476%&#"67&&'677!4'66277&'ge`~^02QHHaKlU1`a
`"&H,5_CH,4```"&nP@@Gbbgh$%Y:tS91a`	`"i5oQ+5`oQ+5```"iDAAG   8G  ' 3  632#"'&&'&476%&#"3677&&2654'ge`~^02QHHaKlb1^r
{H^q$Ebbgh$%Y:tS9oYJ]r	{oQ]r+  8G  0 @  632#"'&&'&476%&#"2767654'&'&467263#"'&ge`~^02QHHachC@pF>hC@	6D&!)+"2bbgh$%Y:tSOh?8@ZSOh$$J9I,*!",-   7  +   7"'63!!_

C   7  +   &547!63"'G

G		7h7  7     &547!!"'G}
t		d   7     $!&47!63!*
+ 		d   w+ !  "'632!!"4#243!!
	}|  
 
    6'&&'&766'6		˽]``齽`]]   N  9   7"&54676#$$ "#     .  4674366332'&''&567&'&'&5433	?	Y\
!%FF%!
[(1Z	 -!'FF'!-   i  , 6  $"#"'.'#"'&#&'6727632>7632.'"36$AW)ўŦ31hW2(_tnxx\r`f=	p   N    )  "&54676"&54676"&54676#$#$#$$ "#$ "#$ "#   N E9   )  7"&54676!"&54676!"&54676#$#$#$$ "#$ "#$ "#    d|7   )  "&54676"&54676"&54676#$#$#$$ "#$ "#$ "#     6732##"'ll``
O     "'#"'&547633
``nm
     &'6332#
``lO     "&&5476336mX
``
6	
  7 y   7"&54767673#"'&! L
+H0{ti@
	y	B7c@=`	   7 {   4632 676#"'&'&&'&7
	
=
=9f3@A2f9fPZZP=V

V=  8e *  #"&5476767674645&54766773&.M	ZT@X~iotHBL&>r'=
tMt$	<t   7e ;  7#&'&'&5465&5<&6&45&'&545454323233]X-]	N-&N(+	?	-Y02e'r|*	@
&KGDt  ;  <    %!&5476 766'4" <i5	d    "  6727632#"'&#&'%.'"36$
1hWxwtxf=	p   <)<    47!"'&'&! 2 <jJJ		BUd      %#"'"&&'&476$7632"		(W
vtH   8)  8  632#"'&&'&'&547664&'&#"32767676lB=T<|&p/8+W3B#Й	)/)u[GNkM*яKJscKa}&NGjg|#)91b&`  7~ ;  %#"&'&55#"'&547655###"'&'&'47667676632AD4F2B2%B
!&VKR2
2RX&-gz)"KL	
LK":l#DnBL
LM9BD   7 , T  267667632#"'&&'&'&'4&5467667676767654#"#"&'&&'&##"9UO/8%K
nH$&&$Hn
1-g*%q**P*F6+(			A.	>1(88q{F$9..9$F{qNl*LE@n'"$'M6][)(91L
  7^  /  4632"'&'&'&4767676&'67677rszv		"atntn	
		$bΔΔ  ~ U  %#"'&'&5467632677&'&5476676327667632#"&'5#"'&547655#?G/6.3<.1"
!"O=*R7
"4)1M30C2B2?'.&)TFf"!3A	>W	(f0J/"`@4,,8,)KL	
LK  7L  $  27632#"'764#"676L	(83E60	K)B2	z{T_*K[<  A!D     "'76767632#"'5"767254#Jhg	^1$`+	*)%SmG'  7!M ] d  %2'&&55'&&54#''46767754#''467677546766757633326323266DT*		T*?"?T_TDD3@ 4?("("fgNb hgObTN    nM   7#"'&47677232Z[	[

  7   7'&5632#"'47Z[	
[
"
"
  e %  #&'&'&5465&54766773eX-T@X]-Y02e's
tMt$	<t(Q?  7  5  454323233#"&&54767675&5<&6&45&'&548	N-&!.M	Y]
&KGDt%8p?7L&=s|*	@   7 (  !!#"&'&'&&'&'47667>32Ag eGGeiO{

IrrIwS  T &  647!&'&'4&5432#"54767!TBG'fD		Dfl5K0/	CiiC
}P  7 G  !&'&'4&5432#"54767!#"&'&'&&'&'47667>32G'fD		Dflg eGGei5K0/	CiiC
}PO{

IrrIwS  8 ;  %!!#"&'&'&'&&467667663!!"'!<
3#J*.

f.#3

1D74
6E	F
\	E6
'(  8. 7  747!767&'&''!'"#!&547!'&'&5432#"547677!&8
1D74
s
3#P f.#3
'(
6E
E[	E6
   8
  W  %!767&'&''!'"#!7!'&'&5432#"547677!#"&'&'&'&&467667663
1D74
s
1D746
3#P f.#3
;
3#J*.

f.#3'('(
6E
E[	E6

6E	F
\	E6   7 4  632!&'&'4&5432#"54767!"&&549
EG'fD		Dfl


=K5K0/	CiiC
}PK=

&      X  ##"332! '&547633276'&##"'&546332632##"!'&##"&=46322632+		++		+%_X+	#	+UBU 		  Tv| ( 0  %#"&'&'&'&'"'&476367676766347!!'UMC'

'CMU'	/K]&x EP
=/gg/=O8\'<m   Sv| * 2  2##"56767&'&'&'&543226 47!!'{`/K]"x!
'UKD
Eo
K:h
O8\'	;n"=/g  )~   66 #"5476 Z	0
{^                               G RIz0?[}Vn5v		b

_
:\@fmBm.
ThHLAHUY&^nLp @  !!P!!!"s"#9#$Z$%%=%&a&&&&''@'m'''()(o() )T))*U*+L+,e,e,e,e,e,e,e,e,t,,,-1--.../*/0a01W21233f334W454556;667%7O7y7788h899n9:z:;!;I;;<<<<<<==o===>M>>>?9?p??@@u@@AKABFBBCCTCCDEEREEF2FG	G:GiGGHHZHIItIIIIJJOJiJKKGKKKLL&LFLrLLM5MaMMMNNNO!OoOP$PXPQQ.QgQQR+RRSCSTTTU*UK        P_<                 )            2    M      N "A 8 7A 8
 * N ^ 7 @
 8 NM  N 8 ' S 2 *  2 * 7 + * N N
 S
 8
 S 7
 8    8    8 i  
 q   
 8 
 8 , 7 $     c 7 v 8  p   ",  ", " 2  ,  2  A ,  ,  !  ! ,       A w A S    X E _ 8 
 8c 7 |  
 
 8  %
 8   F
 2 p r E  j \ O S zq A .
 8   *  6
 7 8
 7 ,    M            S       @ N  " 7 7 N   ) 0 7 | C (c 7 7  8  7   7 7  7f 7f 7 7 7 8 8 7 8c  8c  "c ,   *, 8 'A . T S
 T
 8 8 8 @ 7 7A H
 8 7 7 w  7 7 7 7 7
 7 7
 7
 7
 7
 0
 8
 8
 S
 S 8 7
 T
 S
 T
 S
 T
 S 7
 T
 @ = =
 8
 8
 8
 8
 8c 7c 7
 7
 7c w 
 N   N N      7 7 8 7y ; y <  8
 7
 7
 7
  7 A 7 n 7  7I 7f TC 7I 8f 8B 8f 7 
 T S     ZC)                         1                       PfEd @    8 Z   ^                      @      L _ ~            1S7  
    ! & 2 !!!!!!5!!!!!!!" """""""" "#"%"+"<"@"C"E"H"M"P"a"e"k"{""""""""""####%%%%%&c&o''''*?*      a            1R7  	      & 2 !!!!!!5!!!!!!!" """""""" "#"%"'"<"@"C"E"H"M"P"a"d"j"z""""""""""##"#%%%%%&`&m''''*?* x@ =~{ywshߍߌߋ߇߄l޺޹޸޷޵ޯޮެޫީިާޗޔޒޑޏދމywse_]WUMK0/
	QPKHCڨڟ'#l                                                                                                                                                                                                               ,  UXEY  K QKSZX4(Y`f UX%a  cc#b!! Y C#D  C`B-, `f-,#!#!-, d BCC ``BCB%CCTx #CCadPxC`B!e!CCB C#BC`B# PXeYC`B-,+CX#!#!CC# PXeY d P&Z(CEcEEX!%YR[X!#!X PPX!@Y 8PX!8YY CEcEad(PX!CEcE 0PX!0Y PX f a 
PX`  PX!
` 6PX!6``YYY%Cc RX K
PX!CKPX!Ka cCc bYYdaY+YY# PXeYY dC#BY-, E %ad CPX#B#B!!Y`-,#!#!+ dbB #BEXCEcC`Ec*! C  +0%&QX`PaRYX#Y!Y @SX+!@Y# PXeY-,	C+  C`B-,	#B#  #Babfc`*-	,  E Cc b  PX@`Yfc`D`-
,	 CEB*!  C`B-, C#D  C`B-,  E +# C%` E#a d  PX! 0PX @YY# PXeY%#aDD`-,  E +# C%` E#a d$PX @Y# PXeY%#aDD`-,  #B EPX!#!Y*!-,EdaD-,`  CJ PX #BYCJ RX #BY-, bfc  c#aC` ` #B#-,KTXdDY$e#x-,KQXKSXdDY!Y$e#x-, CUXCaB+Y C%B%B%B# %PX C`%B #a*!#a #a*! C`%B%a*!YCGCG`b  PX@`Yfc Cc b  PX@`Yfc`  #DC >C`B-,  ETX#B E#B#`B `   BBB` #Ba++"Y-, +-,+-,+-,+-,+-,+-,+-,+-,+-,	+-+,# bfc`KTX# .]!!Y-,,# bfc`KTX# .q!!Y--,# bfc&`KTX# .r!!Y- , + ETX#B E#B#`B `a  BB`++"Y-!,  +-", +-#, +-$, +-%, +-&, +-', +-(, +-), +-*,	 +-., <`-/, `` C#`C%a`.*!-0,/+/*-1,  G  Cc b  PX@`Yfc`#a8# UX G  Cc b  PX@`Yfc`#a8!Y-2,  ETXEB1*EX0Y"Y-3, + ETXEB1*EX0Y"Y-4, 5`-5, EBEc b  PX@`Yfc+Cc b  PX@`Yfc+      D>#84*!-6, < G Cc b  PX@`Yfc` Ca8-7,.<-8, < G Cc b  PX@`Yfc` CaCc8-9, % . G #B%IG#G#a Xb!Y#B8*-:, #B%%G#G#a BC+e.#  <8-;, #B%% .G#G#a #B BC+ `PX @QX  &YBB# 
C #G#G#a#F`Cb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca#  &#Fa8#
CF%
CG#G#a` Cb  PX@`Yfc`# +#C`+%a%b  PX@`Yfc&a %`d#%`dPX!#!Y#  &#Fa8Y-<, #B   & .G#G#a#<8-=, #B 
#B   F#G+#a8->, #B%%G#G#a TX. <#!%%G#G#a %%G#G#a%%I%a  cc# Xb!Yc b  PX@`Yfc`#.#  <8#!Y-?, #B 
C .G#G#a ` `fb  PX@`Yfc#  <8-@,# .F%FCXPRYX <Y.0+-A,# .F%FCXRPYX <Y.0+-B,# .F%FCXPRYX <Y# .F%FCXRPYX <Y.0+-C,:+# .F%FCXPRYX <Y.0+-D,;+  <#B8# .F%FCXPRYX <Y.0+C.0+-E, %&   F#Ga#B.G#G#aC+# < .#80+-F,
%B %% .G#G#a #B BC+ `PX @QX  &YBB# GCb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca%Fa8# <#8!  F#G+#a8!Y0+-G, :+.0+-H, ;+!#  <#B#80+C.0+-I,  G #B .6*-J,  G #B .6*-K, 7*-L,9*-M, E# . F#a80+-N,
#BM+-O,  F+-P, F+-Q, F+-R,F+-S,  G+-T, G+-U, G+-V,G+-W,   C+-X,  C+-Y,  C+-Z, C+-[,  C+-\, C+-], C+-^,C+-_,  E+-`, E+-a, E+-b,E+-c,  H+-d, H+-e, H+-f,H+-g,   D+-h,  D+-i,  D+-j, D+-k,  D+-l, D+-m, D+-n,D+-o, <+.0+-p, <+@+-q, <+A+-r,  <+B+-s,<+@+-t,<+A+-u, <+B+-v, =+.0+-w, =+@+-x, =+A+-y, =+B+-z,=+@+-{,=+A+-|,=+B+-}, >+.0+-~, >+@+-, >+A+-, >+B+-,>+@+-,>+A+-,>+B+-, ?+.0+-, ?+@+-, ?+A+-, ?+B+-,?+@+-,?+A+-,?+B+-, EPXEX#!!YYB+e$PxEX0Y- K RXY  cp B(  * B
* B%
* 	B    * B @ @  *   D$QX@X  dD(QX X   DY'QX @cTX   DYYYYY* Dd DD                                       b b & &    >  3       	 r  	       	     	     	  D   	  $  	  B,  	  $  	 dn  	  4 C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0   D e s i g n   S c i e n c e ,   I n c . 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y K a T e X _ M a i n R e g u l a r F o n t F o r g e   2 . 0   :   K a T e X _ M a i n - R e g u l a r K a T e X _ M a i n - R e g u l a r V e r s i o n   1 . 1 ;   t t f a u t o h i n t   ( v 1 . 8 . 3 ) C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0 ,   D e s i g n   S c i e n c e ,   I n c .   ( < w w w . m a t h j a x . o r g > ) 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y   ( < w w w . k h a n a c a d e m y . o r g > ) , 
 w i t h   R e s e r v e d   F o n t   N a m e   K a T e X _ M a i n . 
 
 T h i s   F o n t   S o f t w a r e   i s   l i c e n s e d   u n d e r   t h e   S I L   O p e n   F o n t   L i c e n s e ,   V e r s i o n   1 . 1 . 
 T h i s   l i c e n s e   a v a i l a b l e   w i t h   a   F A Q   a t : 
 h t t p : / / s c r i p t s . s i l . o r g / O F L h t t p : / / s c r i p t s . s i l . o r g / O F L        2                               	 
                        ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a                         	
          !"#$%&'()*+,-./0123456789 :;<=> ?@ABCD E FGHIJKL MNOP QRS  TUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~uni00A0uni0237uni02C9uni02CAuni02CBGammauni0394ThetaLambdaXiPiSigmaUpsilonPhiPsiuni03A9uni2002uni2003uni2004uni2005uni2006uni2009uni200Aminuteuni20D7uni210FIfrakturuni2113weierstrassRfrakturaleph	arrowleftarrowup
arrowright	arrowdown	arrowboth	arrowupdnuni2196uni2197uni2198uni2199uni21A6uni21A9uni21AAuni21BCuni21BDuni21C0uni21C1uni21CCarrowdblleft
arrowdbluparrowdblrightarrowdbldownarrowdblbothuni21D5	universalexistentialemptysetgradientelementsuchthatuni2213uni2215uni2216asteriskmathuni2218uni2219proportionalangleuni2223uni2225
logicaland	logicalorintersectionunionsimilaruni2240uni2243	congruentuni224Duni2250equivalenceuni226Auni226Buni227Auni227Bpropersubsetpropersupersetreflexsubsetreflexsupersetuni228Euni2291uni2292uni2293uni2294
circleplusuni2296circlemultiplyuni2298uni2299uni22A2uni22A3uni22A4perpendicularuni22A8uni22C4dotmathuni22C6uni22C8uni22EEuni22EFuni22F1uni2308uni2309uni230Auni230Buni2322uni2323uni23B0uni23B1uni25B3uni25B9uni25BDuni25C3uni25EFspadeuni2661uni2662clubuni266Duni266Euni266Funi27E8uni27E9uni27EEuni27EFuni27F5uni27F6uni27F7uni27F8uni27F9uni27FAuni27FCuni2A3Funi2AAFuni2AB0uniE020      "@x4xˇwOFF     x4     L                       OS/2  h   S   `EJ9cmap  i8    T&@cvt   r   :   Zm7fpgm  kT    b.|gasp  x,         glyf  D  b  Fzhead  fT   6   6dWC\hhea  h       $	hmtx  f  6  t&8loca  d  ;  >[kmaxp  c        name  r    x_}post  t    EU7-prep  r      exڬ`֖?stElɂَɘ8Cۥr}˅cce*,3t<+)ێGҕtsU1aL3<TVjcgW*<Z~޳ V@B54O2B-zkL+Ht%XPNY|{z%"YMh3&}	1U:S1gZѬeugZ۝'շgI`(
g@Ԉ_zkpA|S|r&}blcXfP.
*@&vlH52T4OTzBod\{lP*OGcHD9>cyDCUW}Rg&Ngs$rKˀ!
t+~K/fC9GqiPuM˲my(&zմ-/cf=_(W)4w3CԦenpv>6F&X'3K؀Gee/Dfcgb80p'0pR|LZaChw$.TX cOg-2(= 4#ÿcY]hJe}<sA;Kpwanw-0,/bd晃̥2!wx`Ne+=9^\V(Xc bl42}IJׂg;/`7nqk$2g,4}\!1G0Sd?
hNOQxփ>6}T=ssDvF3[V杗(1 X Uz?8'aǻ%uð&2`mDy(aNLw5(oӯf.vK#GGlkL^U3Cx9hRg^H\F1sQ
ylX.x|?x~P+bEfy,8QpU!0~JR}3.ރLf`މ1!qF/i.8tݵ"Lc^9q{@vmRЂe\t(E /QQ8<ٛπ+a87Um-/9?k:
|ͩ~)^!i!7exxIGOXE߫}/gd՜7hWܷlu7?+_Xкg?&ԣ 3@<}ođyjNse$#5!d|x~ZW@_Mgy=+}@p$	 aP3=D\/ܿG)4<nc9𖇒fBq,Y^*jjǱZҽʲ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|  d  gasp     y   glyfynF&     ^headcB  `   6hhea=  b   $hmtxG  a  locaU  _   maxp  _    namea/  sH  postٴӻ  w  prep{  r(     2       33'3#2d222  .  *  2+"&54676332&#"2767654&5&&tOU1	d[;0		p|hsqq|"!,/H"00"H/,!  P   5 2+4464626732763232#"&"#"&554763354#"##&&PI<<
qVp<;
%%
&
	  3   D *2+"&547632673676632#"'&&54767667654'&#"4!'<h0'6#2
	qd/!P *,	("9.$7#
E= !$<	  0- Q 2+"&5476632#"&'&54632327654'&'&#"'&56676767654&#"1'D'hJMk ;U(, nAU*&$,'5E/&	 ")!*-y0#(("5C1-1*)<"/D3$)KB$.-"*<7K8(/(   > 9 > ;: 2+&&55476335#"'&'&546 7633263232##32#"&#"7
	01Q&'

'&&'Z$aEJn	0U  9- K E2+2#"'#27632#"'&5463327654'&#"#"'&55476363276Jm%2B>c%q[=.'#B	&0H/U'	GTONJw0(7Ees;0<!(>!	/U`%9\U   0 * = 6-2+&#&#"76632#"'&5476732"&54&'"32765&&,D3*`;:D5.FH8qAH;D$<$%,0#BQ
* ,h?:fMd$KގXf P$%'	,fB$&1sJ(  @-. : 62+2322#"&'&567676###"'&'46766323"QQ8
$$X="k		$
]^K(=2,F%9  0 $ 4 G 
A51'2+&&5476767632632#"'&&5476%4&#67626554'&'&&''""1+8^nP4<l)-GM:C8\<G&s=I)
H)

,LIP-80TGR0^5am
YA("414- (#b-/&'	,=<=   0. , F ;."2+3276675"#"'&&547676322#"&5462&#"336767654'&&:&'^< 1!/20 9DJY$<$*&	 
$JO#< G7\7&-R?A%%%
JK
&
 D
,?  -  G H Z YU 2+3"547663276727663323#"&#"#"54763233254&'5!2'&#"%.455"2A	"		-.++^%$b		 %#/		!JB	TUgh59		j97
%B.'  +  U 3 A R 
KF;7)2+764"'&'476763"#"2##&'4767634''#3676764'&'#3776676FEX0-{P% Z	1N<bbTT[$4;lj!!de4C
>
j$W0*%#BO8xxY!EK8  7W J @	2+32767632#&&'&7654&'&#"3327667662#"&'&54766,\+.-@	=8	\*7\	,+8[*a,5d%#,84"!	DW_*B&q*D"%\7	Q~E?9TW[t   +   & ; 0,2+764"'&'4767632#&'4767634&'&'#32767667676FEX	j~ɔ/1KETPFG4fJ7.4
>
ia	 DD
#TF.74   +  9 h ^2+7474#"'&546767!#"'&7654&'&'#3676676632#"&547654'&'#3276767>32!&'4767633,-P,6^Y6%3


B2)+IXR1(+

9	11B$	8/	'&


++	1(b??  +  ) a R2+7474#"'&546767!#"'&76554'&'#367676632#"'&7654'&#'32'&#"#"'4767633,-@H^R#.,
	A2&::	1t*h11B$	"JxxHyA
   8V [ (2+2###"&'&#"&'&4766732767632#&&'&54654'&#"327677#"'&54767326#	##4	D	C.	P3--@	S)l((paU'>>		2 o([#	8xq<	2!!y&^RPo%VR/82
   +   z K2+764"'&'4767633262##33774"'&'47>3232632##32'&#"#"'476763374##32'&#"#"'476763FEX3qb.11X	j'&d11EG,-
*k'd11AA,-
*k'd1>
uvuv
     = 2 &2+764"'&54676332632##2'&"&546763FE^

3tj	44EG^		,%
3>
 

  * 9 2+2632###"'&'&546763232767654##&546763^-<?Z<-6* O*##0)#z<=
62F	;(3$0
'	
   +    '2+2632"#""#332#"&#"&547>26327&'32'&#"#"'476763364"'&'4767633262##>7&#"'&7667x=
1WW	-X$_%&b5,-
*k'd11FEX3qb.11#$VH8'
@%__
=h3)
  +   ; 22+764"'&'47676332632##327676632!&'476763FEX3wr??EG$F>	_	1>
  +   o  2+2"'476636754#"'&'4767633766776732##32#"&"#"'476763365 #"&'&'&32#"&"N4EE,-~
aS/xz21EG,-
eJ_11a#EDADP:
""yDn   +   [  2+2"'476636754"'&'47676332 254#'"'"&'&7676323276##+"'&''32'&#"N3EEX|X ^
 QN
B
PQD
!O
;   5/  ) !	 2+"&5476766324&#"32767676XT>wv6kQH0_"<!!NHF>T,oTde[%CGVCKT*$?syAMY+:ML*  ,  O ; M A>,2+764"'&54766763#32'&#"#"54766763&'#3676767654'&FEX
EU,B!f`,0	*k'd1QM+MV2>
	
LBA;Wo;			0qC7  5>/ , J X 
QK9/2+%2#"'&'5#"&54767663232764&#"7667632767676"36766'&

;PN
*/T>wvCRPJdMJ)36$.J()0" 	
"![U-"oTde[%CGR
	#OWKJM5X*
 -73ecq
-  +s b w of82+764"'&'476763#32766767632#&547654'&&'#32'&#"#"'4767634&&+36767676FEX#\2%Q"->.&#&:B>,-
*h&c1>+3-#>FK3!">
0%0J1"?$
	2"k;<1 ~@E*  ? b Y'2+"&54654&#"#"'&'#"&&'77623267654'&&'&'&'&5476767327263632##j	LF6O7
1?{X V; 0eP=N
?GL
1Fh*
F'@6	BD804!W:Urpr
A:C5(	JG3E
$4      S % 2+3"547673277667##"'&5467767! "'&5&7654&'&##3#"&#"H	GG		#E/9-
'CD
 "	G*E$		21~#$BUt77	
	3"!	="#
   ?m \  2+"&547>4#"'&'47676332632##3277>54##&&#"'"'&7676323276#Hv32,-3qd21478	"QN!Bhe	a_

`6GJH:'gYq  >v I  2+23276#"" #"'&'4&&'#"'&5467633277#"7665&'"'&7676JF	2b6((-fT&!*&'KL.
MB7onoo  = w 2+2632# #"'&'4#"'&'&5#"'&54766332632##"677''5#"'&5476732632#"&#"677&#"547667E;4	:	''$%		*c`	'40:i$$	$^#`		)4BC
9#55
eL\,.
	ckk   &    12+"23'&#"&5476327677'&''#"'&547>332632"#3677&'"'&547673276##"32#"&#"#"54766776&e22/	'VR[	@<--

0gg:&%P(('		&US		8&LL,-
`&%c _g44

SSQ))

  (  n Z 2+ 2632#32#"&"#"'476763367&'#"'&54766332632##"376677&#"54766326@B-,
fLc21$OD--	-jj
 n8 xii
G		=#  C  & H .2+2! '5&7677>76677##"'&5467676! 27667>2U	 +*FM-&Q%
C?RV[	+#..(o	
a[   &_ 3 F ?5	 2+"&5476676327763232676766332#"&'&#"3276647Uc
cE.0A$$
	$E$ABp:2!/#
UQ!$Io!	{.$l0g21"LT<!z  - + @ 8- 2+"&547677#"&&""&#&546766763276324#"32767676Q^61
AI	--TbAU+C/-@,!VM{|XO`EUY?(@lE!) 7M   ( -  2+"&5476732#"&5476#&#"3276dwTR&(5+")&B&^@IWXhZP
%!,)#;eO>H   &d = P I? 2+"&5476632277#"&&""&#&54676676323266766332#"&'&#"3276647Uc
j8
AI
	$E$ABp:2!/#
UQ!$`cc"l0g21"LT<!z   * $ 3 /'2+73276#"&'&5476762##%4&#"3676]~CI]r
6P<O/=&
 *1)((Y&?~S>HNL\Ii307'4C   @7p W N2+36767>5#"'&54676763374766732#"&54765"'"3###"&54632"!<<?>P<(./!
KG9#*	/@/"T%$h_AQ, "2 *$"$}/7#,("2   6 : O F= 	2+3"&5476676232767632#"'&5463232767>5"'3277667'&#"Uci8&""2Gux!.#	<3$-_#;+)
3$!WOe	d/.1*$"0$0-m/))*I@ 3   - U #2+4&#""&54#"&&""&#&546766763276323676766332#"'&54766+#>	', GH
AID	8L%c.E%	%5<^%"+Y:v+/"':2$   o  I * 2+"&5467632232676766332#"&'&547667654#"##"'&4766%
4d2Gb	R4*?
a	O2* /n0,

03G%	
03G  6  C 62+4632#"&"&546323276767654&###"'&56767632A/ /! +9." +a1)*Bv12lCh01(%383
'@K6G   -B g R:2+474'&#"3332767662##"&54654'&###"&54#"&&""&#&546766763276767632#"&M
D%)0		#*";7N:&!GH
AIa3B")'#$Q4B<"3	M	T6/ *RW /<1'd  ( 1  2+23276766332#"&'&55#"&&""&#&54676676	%!)2D

AI &	I& *"    s  2+"&54677654#""'&55665676326767632767632326766332#"'&54767654#"#"&54667654&#" %$	*+$)C,/#n!	*1!"&	2	U3;$$	+/)&<2  "6+#>II_Q%!&=
	)U7c45*2K"!%^=$2.
0	
%"0   U  2+"&54677654#""'&556656763276763326766332#"'&54767654#" %$	*+$)C46!z&	2	U3;$$	+/) II_Q%!-P7c45*2K"!%^=$2+
}|0  '@  ( "
 2+"&54767637232'32767654&'&#"ctXAd	`y	[!xZk*2K+ZWmU@XU!TtRq=M>%QC  >Q F Z RI92+"'32#"&#"#"5476;7>77654#"##"'&547676326324&#"32767676.5(%
K>	;	
	$C	#ABFUc3!-%
:2	%M:/"k0VQj[!z{22 MS  &>& 3 E =52+"&547676326763232#"&#"'&'476633774&#"32676654TbETr60(,
MJ(	-/F!?==XOgCP"


IJt%H"MM"?	   <  2+"&54667654#"##"'&547676327632#"&547674'&#" "&$=$E	2=/<,&%&
 J&Z):,'7#&/  9 C 72+7327654&&'.#&&547632#"&54774'&#"#"'&5463296-"*2-o(L)M
2C67{&.$8*	7&+.H*+.	

	#:/+U:$2)   E  2+"&55774#"'&5476337676322##3676766332:K"#./
63.	\		33""&%#.92/
II
+	G$		
	##
.9   X F2+23276766332#"&''#"'&55476767654###"'&5476676323276476 $	$E	!?%,
	)0
H)1H252+GHG:l	U %l6)0A0*&~<D10   A 2+732667654'&'&'&54632#"5476767654###"'&5476632D&B#	!4!#(	P9#.2.T23D$	
rGGS2"47)(_!+9%0H5%&Z%*    ` 2+%327676764'&'&'&54632#"'#"'&54767676'&##"'&54767632327&547667632D 
 3#7	1i%e3.$l0!3.+N?$M*52 rG,U 5G(6319
*	F$W$&?"8&J4!

0
qi   +W b D2+4#"#"'&547676327632#"&546774&#"3276767632#"''#"'&54632326766763,DW+"p"
*1O	.$ !43'")d@S0+;X-% 
#4l$9)Q*3
*>'3,*$.2C+	3M'6,
%   6K W >2+"&5476767654###"'&5467676323276747632#"'&5463232766765LY1..K	2F26"J2 de@0,e	-#*B ?B)9%(T3((9	B'0o
:V4"1!
K0   " X =2+6323276766332366766767632#"'&'&'&#"#"'&5476767677##"'&766(,
	!.dS&6,K0	$&./dR%4_8I
"#-O@#/L	

$0.N?#*:   +  	 ? /2+7474#"'&546767!#"'&7654&'&##2#"&#"#"'4767633,- .<C<t
v+*h11B$	.	6.  8     2+22632!&76 764&&5u
ab	M??L\n	^s  6L  , Q 
:3%
 2+"&54766767324&#"327667647##"'&576323776632#"fT@v3/]E\w7YS@;<,5!\RTH;E	+ hh	) 	W9i-0f9MT^;EE5S[0)xcL

  ,   J  2+!"&#"'&'4766367676 766322#"&#"&54763325432JC#~	
GH
\$b%+/<**
n	*aD   >  c , V  
wX?-2+4655#&#"""#"'&546767! #"'&23376762"'&&74###"'&'4676663227636767632! '&54766	
	522
"
	&&*	(		71 	
TS/C
	XN  +   [ '2+7474#"'&546767!##32'&#"#"'47676337474##32'&#"#"'4767633,-11,-
*k'd11,-
*k'd11B$$   E   D :&2+4654'&&'&##2767676632! '&54726677.46767!#"&1BJlbSQq/I.-	[-_'hd-"
w{,+C!F
!
     " Z 32+632767632#/56'&#"32'&"&547667633>765&'&#"#'&54766Z"/WiP!
?N6
##9>	1*?>$%	J..
cj'+B3_@"

n3)	
	-/J6O     ^ o  
vqk`P!2+7654"'&&'&54767632376654#"'&'47676332632##32'&#"#"'476763&#"37263'#367667654&Tm'N:97!q>?	5XF6V::
/w,r?H!=@D(>`		:+/-Xe
F"9&,#9245..
|+:C?"!     v Z"2+4#"&547632774#"'&5476676332632#76767676763232'&"&547667633>5#&#&'&546;
;<)%'12:9
8 p	~11E$	%<;	p9>	/)?>
#
#	:6-3
		
N7 0

B^s41	
	5)#G  ]  v d 22+7374'&'&'&55476632327667632#"&'&54767>7654&#"#"&'&54665766324&
&)5SCD:9(*dPG()PB	dP		w5N#F@NU>3W51  %D<T	^--K|F8n.;::5,Q		'   ' 5 G @7 2+"&547663267676623676332#"'&''&#"3276''&_u#*ePm		*8:*?6b_$?.Z_d
XV@AHUF=	3#!VJK# 7#".38CSGG   >} ' T c 
^V>1 2+2#"'&'##"'&'47667632276654&#"327667674'"#"&&546763277"'"&#"#"Q_<
t>3 
jA$5'1
#DfBB7K,	*< (##EGL4,=q0}D{IuRjF
	5>*32: 8  -i B ,
2+#"&&547667:3276676332#"&54767754'&'&#"#$wD

J/Q	U=
)fY& >]O2B
4	Hi@9YES<4 
  ' 2 E >5 2+"&546767&'&54767632"'&&'&#"'3276654'&#"^tB05B,/!),"7'*'=%(4./( [U?x#(X97$!	&7&%K;FG2R*-a/IQ 7c   $ E P IF2+%2#"'&5477'&54767632#"'&&#"227632#"'326676'"32767'&<0		
!NE5""/=)-	-#51%
D=,/4,)|
WpB0

	&#I$"
2
	(t   06	 I V SK=2+265&'&&'&'&5476767567632367632"&'#"&'&54672&""##327F:H2<	

\D 
1UMD@/ W
	1	2%9
".&x=31\ ,F.B
   -X G 32+"&54667654#"##"'&547676326767632#"&547654&#" "&
	$C	)D,/#%c941u6+#>
	.$k!&Y+	
%"0  (*  & 6 
2)$ 2+"&547676726324&#"36327667654##R[+'CO\=.BK7I_":  ,`as]h|kIR&7{f>T:'2;&(==~*7_Yv  & ' 
 2+"&54767676323267676323H# 	'')	6XK.'0-0_$#
i;*'9   - Z 	 2+"&5467766326676767632#"&54#"32332767662##"&54654'&''b -% ,C','/$*	*#9	8L1F	)	WW84
"50!		h2	
E	S70##
0   ) 3  2+46632 ##'&'.'#"&5476$36'&'&'"&#&{5353e-* #>8	"
6{:4h/+'  "- F 
2+%#"''"#"&5476632327676763232676766332#"&'?H,%1% F,*G/ K
	$E$B.6	HW+	uvG%/.$l   &` 0 ,2+74667&#"'&767>2676327676767632#"'&&*.$	 H,.[I[!*T	%GXs#	gT-  7 n v  
~wsod%2+254'&&'&'&47677'&547675465>76323632#"&'3632#"'&&###"'&4632"254"#"32654I	FP%.x
(\!! $6%w5.
03$	I:	(l/f
 	E	"<(Y?	'6(([)
(. 		S('
@)
N9
&9	   '@  ( "
 2+"&54767637232'32767654&'&#"ctXAd	`y	[!xZk*2K+ZWmU@XU!TtRq=M>%QC    F 1 2+"&&547674###"&547676765""'&54767632#"01
(!II3
SSڭ5HF140=&8<F8*X)	A$p	$	!jK+   "-[  3 ,!2+632#"'&"#"&54764&#"3276765DM(	ERV@BP:$0a&+%E)'.J#+
TGS$%V\+h;8	C#SF"  ! : .2+654'&'&'&&54676732#"'&'&#"#"&'&46323
aA#/@.J_O<m	*M40	5	/ G*6d3	8*W31T  #   / *# 2+"&5476672262232#"4&#"32766Vif )4)&>5PR(*158QT'
QN`	*vPR#)0M2IPn  b , 2+632###"&547674##""'&5476&Qc)\310
S+		p   \ L 2+4632#"&'4&5476767654###"'&547667632332767654'&'&'&2#$
7X'/\i2E%	$ 4*_,.C	o8:/H*r-5A'/"':2(l)O.C`

  5( ; L G>6#2+7&'&&'&54767676327676763##"&544&#"326766C_7*	mWsDEc'	*5+&K%^N:	t@	*JA/ R2WKRFJ!&+..;076    7 S H2+"54765'&&'&'&'&#"#&5476323667676332767632#"'&'':"#
&My+6u
%/	0
($QV	_9682$P<4q
{~?K&+:7lOV
  6 b T(2+74654#"##"'&54766323767633236767654'&'&'&547632###"'&546674#"'&wG	2	U3?"-B	)'M0!	)&Z<H?0%5*2K$&tAy&N.%
*;@E:g!']_VY#    H $2+%3267654'&'&5462#"''#"&'&554767676323277567662%",J*3F&S0P)586E9
	!=6,+)

'*L
7%!57)'tAY8#=1%.[N P9*/6   f y uk#2+632"#"'&0#"&'&5474667654#"##"'&547676322766765&'&'&547664&'&3276WS
P.)J1KY
% *1E
!%'E+69	* 	H*
qa.;
I("(1_a	.$	I& *"^d#PH\#,H!6o-*+9$?@  36 9 H W 
UJ<:2+6323##"'&5477#&'&554766?>366767654'&'#4#"33	_=DT_		~
Z.P(:Na*.9;q+0W`FO]%
ZY	dxt+(0X*CGX*   4 W A7,	2+#"'&'4#"'&5477#""'&547676! #32767654'5!3276676632fi@D&FY- ,D-/
SSjh!*!,-,1 3)!#$/JM
Q
51['K_bp	"&s4?!%-7FB "V3  K>[ ; P G>.2+73#"'&546&&""#"#"&'&547676732#"'&7327667654#"&Df(CS@(	FQWUZ2S(#:&'AE)56
 $":mm,UHvWU2?#&34E;81)  , 8 2+73263676#"&'&5547667263232"v
!6+&3]z2&zI(303
O	\^	a(FDRB1<	H  o ;  232676766332#"&'&547667654#"##"'&47662Gb	R4*?
a	O0,

03G%	
03G  7 4  4&###"'&5676732#"'&5463232767676)'%#6Qv21zMO."
+bu##
.CK	8L.3C	    n                         W 
IpYKBSL	i	
g
10mh7)<rF%Ak%	iB / !""##~#$^$%H%%&^&''c((_())q))*o*+a+,W--.
../*/x        	gQ%_<                 (            2    M     ? .? P? 3? 0?  ? 9? 0? @? 0? 0e -b +1 7 +* + +w 8 + w * + +v + +E 5 ,e 5h + ?}   ? >E = & ( Cy &	 - (b &* *8 @!   - \ -\   I 'Y &  9  7 ?  +N + "    + 8c 6& ,I > +u E    o ] ' N 
 ' $ 0X 2 ( & - ) "A & I ' d " ! #	 w  5      3 d K ,    ( Zv0                n          1                       PfEd @  7 8 Z    ^                          *    
   9 Z z 17     0 A a 17yv;6                                            ,  UXEY  K QKSZX4(Y`f UX%a  cc#b!! Y C#D  C`B-, `f-,#!#!-, d BCC ``BCB%CCTx #CCadPxC`B!e!CCB C#BC`B# PXeYC`B-,+CX#!#!CC# PXeY d P&Z(CEcEEX!%YR[X!#!X PPX!@Y 8PX!8YY CEcEad(PX!CEcE 0PX!0Y PX f a 
PX`  PX!
` 6PX!6``YYY%Cc RX K
PX!CKPX!Ka cCc bYYdaY+YY# PXeYY dC#BY-, E %ad CPX#B#B!!Y`-,#!#!+ dbB #BEXCEcC`Ec*! C  +0%&QX`PaRYX#Y!Y @SX+!@Y# PXeY-,	C+  C`B-,	#B#  #Babfc`*-	,  E Cc b  PX@`Yfc`D`-
,	 CEB*!  C`B-, C#D  C`B-,  E +# C%` E#a d  PX! 0PX @YY# PXeY%#aDD`-,  E +# C%` E#a d$PX @Y# PXeY%#aDD`-,  #B EPX!#!Y*!-,EdaD-,`  CJ PX #BYCJ RX #BY-, bfc  c#aC` ` #B#-,KTXdDY$e#x-,KQXKSXdDY!Y$e#x-, CUXCaB+Y C%B%B%B# %PX C`%B #a*!#a #a*! C`%B%a*!YCGCG`b  PX@`Yfc Cc b  PX@`Yfc`  #DC >C`B-,  ETX#B E#B#`B `   BBB` #Ba++"Y-, +-,+-,+-,+-,+-,+-,+-,+-,+-,	+-+,# bfc`KTX# .]!!Y-,,# bfc`KTX# .q!!Y--,# bfc&`KTX# .r!!Y- , + ETX#B E#B#`B `a  BB`++"Y-!,  +-", +-#, +-$, +-%, +-&, +-', +-(, +-), +-*,	 +-., <`-/, `` C#`C%a`.*!-0,/+/*-1,  G  Cc b  PX@`Yfc`#a8# UX G  Cc b  PX@`Yfc`#a8!Y-2,  ETXEB1*EX0Y"Y-3, + ETXEB1*EX0Y"Y-4, 5`-5, EBEc b  PX@`Yfc+Cc b  PX@`Yfc+      D>#84*!-6, < G Cc b  PX@`Yfc` Ca8-7,.<-8, < G Cc b  PX@`Yfc` CaCc8-9, % . G #B%IG#G#a Xb!Y#B8*-:, #B%%G#G#a BC+e.#  <8-;, #B%% .G#G#a #B BC+ `PX @QX  &YBB# 
C #G#G#a#F`Cb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca#  &#Fa8#
CF%
CG#G#a` Cb  PX@`Yfc`# +#C`+%a%b  PX@`Yfc&a %`d#%`dPX!#!Y#  &#Fa8Y-<, #B   & .G#G#a#<8-=, #B 
#B   F#G+#a8->, #B%%G#G#a TX. <#!%%G#G#a %%G#G#a%%I%a  cc# Xb!Yc b  PX@`Yfc`#.#  <8#!Y-?, #B 
C .G#G#a ` `fb  PX@`Yfc#  <8-@,# .F%FCXPRYX <Y.0+-A,# .F%FCXRPYX <Y.0+-B,# .F%FCXPRYX <Y# .F%FCXRPYX <Y.0+-C,:+# .F%FCXPRYX <Y.0+-D,;+  <#B8# .F%FCXPRYX <Y.0+C.0+-E, %&   F#Ga#B.G#G#aC+# < .#80+-F,
%B %% .G#G#a #B BC+ `PX @QX  &YBB# GCb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca%Fa8# <#8!  F#G+#a8!Y0+-G, :+.0+-H, ;+!#  <#B#80+C.0+-I,  G #B .6*-J,  G #B .6*-K, 7*-L,9*-M, E# . F#a80+-N,
#BM+-O,  F+-P, F+-Q, F+-R,F+-S,  G+-T, G+-U, G+-V,G+-W,   C+-X,  C+-Y,  C+-Z, C+-[,  C+-\, C+-], C+-^,C+-_,  E+-`, E+-a, E+-b,E+-c,  H+-d, H+-e, H+-f,H+-g,   D+-h,  D+-i,  D+-j, D+-k,  D+-l, D+-m, D+-n,D+-o, <+.0+-p, <+@+-q, <+A+-r,  <+B+-s,<+@+-t,<+A+-u, <+B+-v, =+.0+-w, =+@+-x, =+A+-y, =+B+-z,=+@+-{,=+A+-|,=+B+-}, >+.0+-~, >+@+-, >+A+-, >+B+-,>+@+-,>+A+-,>+B+-, ?+.0+-, ?+@+-, ?+A+-, ?+B+-,?+@+-,?+A+-,?+B+-, EPXEX#!!YYB+e$PxEX0Y- K RXY  cp B0 * B#
* B-
* 	B	    * B @ @  *   D$QX@X  dD(QX X   DY'QX @cTX   DYYYYY%* Dd DD                               4 46  -     4 4>  6       	 r  	       	     	     	  J   	  *  	  B@  	  *  	 d  	  4 C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0   D e s i g n   S c i e n c e ,   I n c . 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y K a T e X _ M a t h B o l d   I t a l i c F o n t F o r g e   2 . 0   :   K a T e X _ M a t h - B o l d I t a l i c K a T e X _ M a t h - B o l d I t a l i c V e r s i o n   1 . 1 ;   t t f a u t o h i n t   ( v 1 . 8 . 3 ) C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0 ,   D e s i g n   S c i e n c e ,   I n c .   ( < w w w . m a t h j a x . o r g > ) 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y   ( < w w w . k h a n a c a d e m y . o r g > ) , 
 w i t h   R e s e r v e d   F o n t   N a m e   K a T e X _ M a t h . 
 
 T h i s   F o n t   S o f t w a r e   i s   l i c e n s e d   u n d e r   t h e   S I L   O p e n   F o n t   L i c e n s e ,   V e r s i o n   1 . 1 . 
 T h i s   l i c e n s e   a v a i l a b l e   w i t h   a   F A Q   a t : 
 h t t p : / / s c r i p t s . s i l . o r g / O F L h t t p : / / s c r i p t s . s i l . o r g / O F L        2                     n                $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ]	
  !"#$%&'()*+,uni00A0Gammauni0394ThetaLambdaXiPiSigmaUpsilonPhiPsiuni03A9alphabetagammadeltaepsilonzetaetathetaiotakappalambdauni03BCnuxiomicronrhosigma1sigmatauupsilonphichipsiomegatheta1phi1omega1uni03F1uni03F5uniE131uniE237      g	xHwOFF     H     y                       OS/2  =h   R   `FLOcmap  =      #5cvt   E   ?   j}fpgm  >P    b.|gasp  H         glyf  D  9y  ^ynF&head  ;   6   6cBhhea  =H      $=hmtx  ;  N  Gloca  :      Umaxp  :        name  E    a/post  G  W  ٴӻprep  E      {xڄy|WG`````$HHMԒnu][wfEaΛ_[	II>b$UQvi'*x83p(BR$L~6RV+V<3qpƸb╺0<<_7ܓh3_/'
 BTNPk8s}~I$tKɌ^.1Hi	Iga9JVTFU9bOٙ|1<\sٌg|~px%&hb\{sOᄜS18Ä@@,ʌ Bz0 *I
_}Lq<9s3xL!]
ȘWONΔĈIŲ^k2j 
t!ȧ?9܉PzHL=	zmMPB 6#*gSª'd~;NM
4%,
4]òC$<w}rX.9uęeūGXp$
sY~e<9IbP

Q
ҝ	rFvOOo*u&	MdޭL2}1ۄUehQ3QgGhꄯJ)񱤣m+R&RL@m'7 uq*Qhy{È*%x/U%"`Ѷ'-_!"G8dex0%e*D$<M"F>'m1o1)(;CN+jVp|#>#X:E0TNY+$_^J=Y	YY ]ܽsMM.L;=׏'=0q`Ǟ#&j5 ,ND	)LHW'fzP88V!f>O58dU,,Yz15ʱ\",2^gux&:;Nm?g~qO+\(RSٮP="*ET;ҘHӪ/J3gRvh
fyxQUPx=(J ѬRSr㨬PBMdV1JS#=[zgdE6;:z9dSSDe"c%T)+դEI}P!fYr69>ۖ%NȰB!/uGu"lYMUF
ƶЮb察W]
*O%JiuqwkGV3=7j:bZwOٍcAoEY891i 	AJEiLBSH}8 {2vۛ9&UX>abB46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KλlAz[<lE8"@;38տ}DBilOs!GP/RGƟX!g:0D`RNH:c)2$GVGdy*	!J vls(2	3;H]x0?cOӏ5<et5
:pHwހ^|M,m~ Ŝ/;d.oCFT9:D$]kh}x&`A3-).RDX9gP[?T@^Ls=u2RZ;c'65_t d|yf&|H!jIj_jV*0j~_͙0AK$$-9pwY*˭XYdn&EMF1ReoSVt06fAeI>rX`(k0T<bS""*$BRjPD@>E.E97Tfא Efѡٝ	ZaPJ!84*UY>\3˨R`C" 9F}V1EiQ \Y\JJl-uPuDIBqlPV_- cc\,^ -?f~7CA˞{垿*a[atiYser	ݥ;tmpKe[v4OGUSc
z4iKF#<+}G^e.G/{\酕t,1ؚ(VVԁطlkWyW16YTGI|
N֨lz^CvVL_kzW]q_t!f=g>={mUM!cӭ})Md;_'A±˞[+xK۫~(`.Du=vOtprtXtrU>NUUNRjc-O/`e4U~Y븾Zo:Ryw2:l XW{;fTh~_yR i9 [`fEjy.YA)\;\k>WA൝]ncJ$큯 d5j9>S6K;;HC9$_XDB i1ʴ9W	i*r/ٕ8Zi><W# *:^'ׅ̎SǼwHEJFNAI,El6v9rﯓK|n
)U"'Id
Fg0YlEbT&$JjaZz"$1	*<HM#Y&,VluT)u1zYE2Kp՜WϚnu5b}?/<ҡIK,WLkvٰZfܢ\ kߞJR[|Wy+c84p4z`H].Tyz94eF+pʡ!0&`NG !6M'|zң[yjdЬ]!wNF`z[B!   iaxLz       `OS/2EK  cx   `cmap#5  c   cvt X  sd   jfpgmb.|  d  gasp     zD   glyfr     _vheadcB  ad   6hhea  cT   $hmtxG+  a  loca4#Q  `   maxp  `d    name_|  s  rpostٴӻ  xD  prep{  r     2       33'3#2d222  ' 	 ' 2+74632#"4.#"&#"32>55'dgqiE)
1	)!,pyv%,2/
I0BC:-+   V   , 2+6736763232#"&"#"&54632767655#'Vf8
@aJ`@J"
   ,   C &2+4632373676632#"&'05&5476767654&#""&7kJTq'jhs	/@5OA5(N:===	>q+-/07  *( T M52+2327654'&'&##&547267276654#""&547667632#"'&546h!
*/5.)&A
%Y:2 0 	E3S4>G
v_Eu<!#!"d9"0J2c, ):#(@%">'a>UN!%   > 9 > ;:22+732262>775#"&'&55776676333#33#&#"#'7
~fGGWW%:Fbf2<nbbd"AC	 0DT   2( F <%2+#3267654&'&#"#"'&54&54363276#"'"67632#"'&'4632)P2=#P'DIL=M/$&Y70 d<9/E,	D;..;?C	P6[UVG;T<5,; 0W!  * 4 F ?62+6632#"'&&5467632#"&5476774'&#"&##32766549+3($52+5\ULD68	
<T
-3	5!)d&(R2;4-l-%l!

?6kAUeGV$+>ID   7( 4 	2+7"&'4677363333#"'&56767656"#K"%'zGI3

'*
T=/(R!^bS$H$''0R=?   + ' 9 M 
E:0(2+4632#"&'&547677'&'&7"767654'&&2654'&'&&''"EhJEb<(#nONm(!3	4.LE8
4
A,<SI#9VEeF9+&$%	""''@TR@@.'
43+ 	-$!-&1G0'"/	)<9O   *( 4 I A6."2+2#"327655#"'&'&547667632623#"&546&#"327654'&w
	*C,'+L?.26&%
LXI@99<O#)4'/1A;	D:<W<-7
^(3h+$;5AG';*/fc"  #   B K JE 2+3"&#"#&&76773676 7663332#"&#"#&&7677367'#2'2JGF _	<S^6
"$./Zgg/W		:<
	)+P      9 N a 
]SG?'2+4.""&"#"&'&76763 #"'&74767633276764&'&'"##32766764&'&#"2766 

E'(a5
BQBMj
!i#U,?QQ)I6/$Mv#EYAet
&&3#!(A	J7H?J		$E"03$&,:FFf  2 G 9 2+4&#"3276676632#"&'&54766763232?32##&&76ID5>l=7ZT&-;`Z##gK-P;1$<)	)BS_.maYc	nAY	u\$xqEj
()  !  # / I A6 2+4.""&"#"'&76763#"'5&7663276764&'""&""#32767>
"ŧ(O^YeoY!NF##AQ
_A$.(ta20q\h	$JVA$`      m cH2+4654&'&#3326767>32"'&7654'&##267667662!"&'5&76632767654#&'#&&767!##&%!xU=	A9	!!P4?D^=1A&
iH!-*
<,.	$ 	
P[	(      h f2+7"#"'&76632767654#&'#&&767!##&54665654'&&#3676767664>233##&&7654'&##33#&Y!-.8VP! 7<!?B7  G)	(
H	6 |  2 d  2+"&54766763232?32##&&7654&#"32676654&'#&&767332632##"'&&'4BvK-P;1$<)	)BID5>dw/|6Z.%(dH	'4	!l}xqEj
()S_*É9*[.$_	#
&    y  `2+4.""&"#"&'&7676332632#"#3374654."&"#"5476322632#"#"#33#&#"#"546747676332767654##3#&#"#"5465476763327676

)_U5;;	$V@S-.%aU
!B!"0%aU
!t
	
		$     D B#2+7"#"5476767732727667675&5&##&&7676333273#"3#&[=+F
=HJ7@	
	!H""
- %
*-	挋   9y 3 2+4##&&767332632##"#"&5463232676])iN	,y|O=M)"-!1&Iwq=X=1#3,(C0     x  W2+4.""&"#"'&7676332632#2 7654'"54676323276#3#&#"#&&767632543#"&#"#"'&766327676
")_U6QoK6K=		&K%(7w

2uDD0W! S!t	 	.Z(
55]\		$      S B2+4.""&"#"&'&76763326326633#26766767633 '&7476763327676

6I4+&E<$		2K?&(1).
!t1A$$
M@	r
	$  #   z   2+!"&#"'&54676367654#"#&'"&'&76632>77667732#3#"&#"#"'&7663276765"'&'33EHH
*
cOH)5::5)``!60T Q!HFXj	GB
$
%AS]]TA			22!    w V E2+7"#"5465>23676&'"&'&7676327654'"'&7664>23232632##"'33#&E	D5_M65@ICG rB

$		%Z;6!   2  0 * 2+32#"'&547676764&'&#"327676&
bvW9QijkGLb o+E=>7 .@93=;w7nyR3DDJ|#
s \Lb-%;ZHd&N_   !   B [ SH.2+4.""&"#"&'&7663#3#"&#"#"'&7663276764&'&'""#36767676

;O4Emb_0W! S!f,)I$#"QTC$
t

?393Dwt		$;&#
&F)   2> 4 P \ 
VQLA12+4655#"'&547676767323267632#"&27667654'&#"354627'&&##".&jGLb oy&
bvq	&>		)F.$4$/M_D'402Zx6G.,(P3DJ|#
s \n4'/ 	y#;"40	5x
!u2,тh5-@
#!'"   ! o  }r72+4.""&"#"&'&76763#327676632#"'&'4>7654'&&'#3#&#"#"5465476763327676&&#""#367676654

[/%|,C&(h	+=E !0$_V
!GD?BENA#t1(1
Y7&H40#4',?
92
	$0K  4 R G2+4&#"3#"''#"547633327667654'&&'&&546767633276#"54746)EA7e<>c7
:WK
/K
4,59(3Hh*;9DJZ>,#+U96{7A@N3@#K42k,@@	!     b / 2+!"&#"#&&76732767636676754##"##"&5476767!#".'47654.'"2"}##<
#FC+ ԅ#	' .="#D+	\ZE)6  < Y *2+7326754'"'&7664>23232632##"&'&547>54'"&'&7676332632#"#=8R}b@JDG-0aQn319
)_U5677=jK
	%Y\J	   3 L  2+23273"# "'&5&'&+&&76733273##7667654'"54766.KE6 	I-*?v
:II-
x
uu

	  3  2+23272#"#"'&5#"'4'&&'#&&7673326326633#7'&'&'"'&767632632#7>76654&#"547>GKB	?"!jK$,*:
,%
!O$"=O4
 	#'/,%7?
y	*%*;$.>$

    T ~ 2+%"&#""'&76676766''&'#&&767332632#767654'"'"&76733273#2#"&#"#"'&76676765'"232PN	V1
m	6"WT
&- 5/	bWM1	VW?B
3#LR^
1
nT;3!(	_`	


    _ '2+%32#"&"#"546763667677&'&&'"'&767633273#"7>767654'"54766323276#'D	T@R#')R	# 0=z
8d&k	 F3H-	9	
ggu	-}
	
-	hk   9   ? +2+2#"'&7>4 7'"##"'7>567633 36766767663_R
?ZLV 	Y_IU		U
RJ
l8	DI
   ! 3 J B6,2+36767676332#"'&&#"'&5476676326323276676654'&#"K	 !?0/B+E0:@2(!)3)(=*LT 1-
7,D@u$-1$,,+D,OU  ( * D =,2+263276762#"'&5474776&#"#"'&76764#"#3276676YF"*4>\N23=	4.#!"	
T@p#qP=
0 CGH  " 8 4)2+#"&5467632'&#"32767632#"'&547667632&"7- ?^<		>_k*J#8c' -HC/HE
	8X%-.0Ki  ! B U OD2+263236767676332#"'&&#"'&5476763256674'&'#&&76&#"327766n	 !?0/B+D>L755(=5:	$

*LT 1-
7,D][L*OD,OU$,H$  ' * ; 4,	 2+"&5476676332"327632&#"3276676LZ\*;	X1U%**pI		R9>#%1!;:dO&%Nn
% G1/7U
	Hl4>   73& I ?2+3276675#"'&767663254676763#"5477&#"32##"&54632v=//'0*(+$1$,#		7-.8%	"9%H0$,#*!C`
_%!(!(*%&eBz(6 (!)*%   
3 2 F A6+2+2332766765#"&5476763267632#"'&546.#"#32776J1&($,AK.V.)2%rwJs$R 	*>95$G-e[E?:`+0:6G,	(
*%bD OF
   0+ H %2+"&54767654#"#"&44'&'#&&7632632763232676632'2
/1C3" J;G7B	.11 
/%yD;RL	6643~1
=3	+G	   0  C 9 2+4632#"&4##"""##&76763232767662#"&5476656&( 2(4--,G0&1[X&(!=V".'yy
T9T/& 4  E /"2+4632#"&4#""##&76767263#"&546323267>54)&$
30"#K13M/'0( 	"946T''	:*H&C+C"!&$:$  0 f <2+263266767632#"&54677&#"32767632#"&54654'&'&###"&54776&#*#"'&7676d#<($#""".'.00	*.7$!I%%	o"<(!$-#"'-!<(O[ 7.	&.-d
,   &
 6  2+"&5476&4.""#"'&7676632676767633-6	
,
3-V7A
  Y s  2+"&45654#"""##&547676323763276763232676632#"'&54767654#"#"''47>5654#"lM

?=Pa%1 7B	.1D&,1F1!!"1F1!!1$\%:-	@R
,643~0
=3	]&	%u=;T
	 E+;T
  D O  2+"&47654#"##&54767632376323267632#"'&54767654#"lL
>	;>M7B
-"1D&,1F1!!,'%*v-	@649v0H/	]&	%u=;T
   "  &  
 2+32"&'&547663276767654#" ?H%V
K/&I$R?0!ZG;;HYPAZ+3V6Qa:(LI > R j bY02+&5476763276762#"''22233#"&#"#&&767736767654#"""#7326767654#"#K
-04>b:5*

IF"u' 6=	4.':@	*S@/7Bc)	)\,kk)-$"NH"P=  !> 8 K E:6'2+"#"54656632767674#"'&54766763267632233#&&#"327766E/#(B+E0:@9#"
"5(=5:	$
WQ
7,D@u$-4OD,OU$,H$   =  2+"&454#"""##&54767632767632#"&547&#"lP'%0%.#8!

">'\':)
*$ +1
0"t	   5 M F#2+72#327654'&'.'&547632#"&547632'&#"#"'&546v/L!	)	)).Ra-'6
)./1k% 1 58-4D#!,#		
1"%f>*   Jr D -2+732767676632#"&'&557674##&&76766337676333#2)
1%*$3	##33+5"23k$%D*	G
 A%PQI)

  ' R %2+"'#"&'&4767654&##"""##&767632327676766763236767632B245C	'	 *#%*2) *"$L8
8.0-0+h; @E( /%/n5&($x)*#:v   @  2+2#"&547677654#"""##&76763232767654'&546?_@K	&	32#'2.2>)'$, #PM9A?0c0aO',$	%}5+),#&   b $2+232767654'&546323#"&'#"&54767654&##"""##&76767632327756746676;G*$%*&2R-D-$CQ'	 
	%:)0,&$+! 2z<2
2$?,0|@?	(i; @K/$/v1(-=	v}  #
 e 72+&5676763267632#"&5474'&#"32676632#"'#"'&54632#32767>7654&#"#:/G#;%0)3#2
&4*D5/4F$-	:
$+#$-B*G$*/"*.2G+

>.%?-)**%-p8E-	  3 c K	2+2#"'&547632#3327667654#"&'&4767654&##"""##&7676323266746676bG/6/L
,#	&D%-3B
'	 *"%*2) )%(v1S0"*%P8!0-0+h; @F' .)%o4&(   # U .2+6323276763633232676632#"&'&'&#"##&476767676#"'&#""54766		-aP#3(?	O5
,#$*eM),(<- !5WG 	'	
4Q<+0\F	'8    H " 2+%"&#"#"'&747676332767654#&'#&&767!##&&7654&'&#32S`$#W
!-+YGF	(+0(  0     2+%! &54 7677232'&"  =<HM    2  4 a 
H?+ 2+32#"'&547676764&'"&"#3276676764774###"&'476763233767632##"&
bvW9QijkGLb o.IEH+0E?	>q(=nyR3DDJ|#
s \Uj
iUau
 Rd
XCi
AD

@D   $   D  2+3"&#"&54763276 563233#&#"#"54676327'&&''" 2D=	
@ Y#ST9 /	0c;z 7
	   5  	 & P { 
WQ0'2+47!2##&5665&#&#""##&546".'7676333376633#"'&77!&54676332;2675676633!y	(	(""gd(-	7/sVR!"#     z h < 2+7"#"546547676332767654#&'#&&767! #"33#&#"#"546747676332767674##3#&U
!-RS!.%aU
!HE	0%	(	
	!   :  & F ;,2+4654'&'&'#"327676766332##!&47 54'&7676!!#"&,'@:H3#Z\$4&
V!:
+N

+8Z7)[K     [ 72+"&&547632776767632"54654&#"33#&#"#"&54766327677>7654'&#"#-;]3<	@T!#
!*,8-G&KG)sh	D>&?
	-`/x%-p!	9R	-D
	[_P))59(
     [ j t 
mk_\82+4##&&767333273#"33#&#"#"&547663276767'&'&'&547>77645#"767654&dYNW=G
&E	PzT	G)qe	D
, k	_|@kLO#&$-0
\,1=p#
	U@5UP	9)O	
4X2YN169B34z6;O0.     w J2+77654'&##&&767333273#27676767676332#"#"33#&#"#"&547663276765&547654'&7673265'#PT>H
&E+5/'92* yY#
G)qe	D(*)
8/&;gM	
9\~V	V'1/
=&0(U  P   k ' 2+3&'5476676223354'&'&'&'47667676323263667676762##&&7676767654&#"#W
1	:&@J;8gF)/8MA#%$YY/(3PCKF_HL:+%QL*	 -X4+R0HU$XJ(	6
PO(3&MC2`NBM3F(.ER$&(
   "[ 8 T N;.2+263267663236676632##"''#"&'&54766327676677'4&5.#"BW1I*D5JKGW
K.) 85!E4IA&J\oaQ	H#*PAZ+3(		#&*=!"I%@I   >= " H :- 2+&5476767672632#"''#2767654'&#"326754'#"54760-8?O803a
Y&@7&$5>4XB;2Zf#*+OzT<"&K<1] 3PgEq'a	3oS	8Ah:#  ( = +2+#"5476?654'&&#"##"54766732367676763Q5	,E30Qb:0>%3&EHh	
>
T?0<5*	AZVX<_f'  $ 6 G C912+#"'&'&'&#"##"'&&'476767&&'&'&5467633276654&&'!c# +':*"&/[(=	%/%f0,&
\#,y,H7bTKL2eKN5)7
/8i5";'$ }D    A =+2+#"'&#"7632"'32763#"'&547677'&54766732	$2U1!		2
^"
@r!`@R-$ 
`8E.	!	
	+9I<,3-"2+,	"#0  ,4 U 62+4>326376676732"&'#"'&5463236654'&'&'&5476677&(		8	8eJ	}007%;A_J		&L94]"*1 1#	.|27],  ( @ -2+"&454#"""##&5476763237632#"&'4654#"lP?>M7Bv y1F1!!>'\':-	@64+;T
   #  ) 6 
2+$2+263##"'&5476764#"376767#3276?6'8"[,,5
%r=~5!#2#10a0(,/,;ftGj8{05Cf+?u?II|=DAE  0L ,  2+2332767>232##"'&547676766	*%
;1
 7'%;

"+
#c3%2-X#
   1* R  2+"&4763676767632#"&54732327676632#"&54654'&'&S^"!!
1+-$-$
57%$.4ew		($('-+	D
HO%6.	'#_f  /0 & 2+473#&'&5#"54766774'&#"&Z
D	^<<<=$EDd
/0	EEEF BB-	   (D D 2+"'#"&'47633276?6763236767676332#"'&44)">C."$$L	 !?
6,5R
HQ6	*LT 1

6   - 0 2+263237667667632#"&#&54776&#"##&&7676J.0d&(
+,'m0$   3 i ?2+4323632"&'7632#"''#"&54327654'&&'&'&54767677'"&&'&54677&E	8&9
7#.E	))!!,V#'	B	*+	&ZFxH^0

'K"M0+#!
	H>69'&5=g   "  &  
 2+32"&'&547663276767654#" ?H%V
K/&I$R?0!ZG;;HYPAZ+3V6Qa:(LI  = A 12+%#"&'&5476765##"'&557677#"#"'&767632##bB	K" (EBڠ ?@%,C$Ebsi
H/YH  (  0 +" 2+"'4767672632##"&' 4&#"32767:!e'FY5@zX#&\"!#F, &$&
74VVAYpaJ.;.cD#)$#H    9 /2+2654'&&'&'&547667632#&'&#"#"&54632;~Q0! !Hs
+3#/GN"EKhW7
4U!(@	  <  - ' 2+"&54766767633##4#"327676ETV4;<U8IW;)'+'6-)ZD598T


&/pU8!P+)`%*1/+Y/    +  2+"55766774#"#"&766767632"!2.17&	3# !
$X6A    G 
 2+2##"'&54767654&##"""##&767632327667654'&'&546>Y$	 4!)0//++L$, %K;+r-`; @T$.(%.,0lI+	%   2&j 8 I C; 2+2#"#&&5476'&'&&54767323767676764&#"3276768<LJY  7CXA0	C$/6.0(1V	{T/N>eNH`HA
8]7V7k,&+0PG"K-T/9  4X L ,2+"54763232676323267662##"'&''#"&547677'&'&'&#"D@L"zy	!'""R)	
zy&$_
;*6^ |OC
&/.!G1
"   3z ^ 82+2327632327667654'&'&54632####&5465&#&54767654&##"""##&7676(1-FQS@o&AY_
.%	 40#/z&KIK
ywC*	#- (AOAW]^~$e; @T$  \ P 	 2+2#"'&#"54767676323276775676763232767654'&'&546*2
8ZP.5n4

F*(0$

	
1'#2!$OLPM7,/cN	
aN3<,'*,$
,,&,O/	%  5 Q e _T-2+732767677'&'&546763233"''#"54767654#"""##&54767632&&"567654C=;P90,

o8(*,732g	bH-5TY0ECjnM:9]%tUe'\':5-)%D!F*
^>   +3C 2 ? O 
ID962+633###"5474#"&'&&'&547667632746377"%4&'&##767676<=Mj-=Se>5=>5/.g6z9/.0*p&NY_`G4114R6@RV]2>2   7 4 V >7 2+"547677#"#"'&7676! #"#"&54&4'!32766766333276\2(#EBi"X!*67Db	8=?&%.INB8:
x.5HD	#i
 H
G;o2 MMRlA;'lIO  C> 8 J E;.2+"&546767672632#"'&#32##&56&##"4&#"32767FD,'FY5@`Q'	.9x

H"!#F
' %&&*8-274VVA^J	

(
	J.;.;A$(2$#H  (~ 2 2+732767632#"'&&547667633#"3#
/! '
'*+&$3>/!i>(&#&`!!)H
Y?X<,;`	
  0 7  4##"""##&76763232767662#"&5476656 2(4--,G0&1[|!=V".'yy
T9T/&  3p 5  46322766767654#"##&5476767263#"&'&')c2+,4cl;#2%"2"(K+44,x9O       n                         P  o1eFDRvQ			
L
{TL^`43<lAYdd  F !1!"#$#$$m$%=%&&p&','m'((()X))*G**+e+,\,-f-.`.//k/        O_<                 &            2    M      ' V , *  2 * 7 + * #   2< !   2?  + 9Q   ##  2 ! 2 !e 4H  <G 3 3< E  9 ! ( " ! ' 7 
@ 0Y 	 0* &n X  " !  5i <   < #  #   g A 0 2 $ 5?  :G  d  P "6   $  ,  #b 0@ 1G /[  -  ":  k ;    2r  n O T +<  C (B    & ZG                n          1                       PfEd @  7 8 Z    ^                          *    
   9 Z z 17     0 A a 17yv;6                                            ,  UXEY  K QKSZX4(Y`f UX%a  cc#b!! Y C#D  C`B-, `f-,#!#!-, d BCC ``BCB%CCTx #CCadPxC`B!e!CCB C#BC`B# PXeYC`B-,+CX#!#!CC# PXeY d P&Z(CEcEEX!%YR[X!#!X PPX!@Y 8PX!8YY CEcEad(PX!CEcE 0PX!0Y PX f a 
PX`  PX!
` 6PX!6``YYY%Cc RX K
PX!CKPX!Ka cCc bYYdaY+YY# PXeYY dC#BY-, E %ad CPX#B#B!!Y`-,#!#!+ dbB #BEXCEcC`Ec*! C  +0%&QX`PaRYX#Y!Y @SX+!@Y# PXeY-,	C+  C`B-,	#B#  #Babfc`*-	,  E Cc b  PX@`Yfc`D`-
,	 CEB*!  C`B-, C#D  C`B-,  E +# C%` E#a d  PX! 0PX @YY# PXeY%#aDD`-,  E +# C%` E#a d$PX @Y# PXeY%#aDD`-,  #B EPX!#!Y*!-,EdaD-,`  CJ PX #BYCJ RX #BY-, bfc  c#aC` ` #B#-,KTXdDY$e#x-,KQXKSXdDY!Y$e#x-, CUXCaB+Y C%B%B%B# %PX C`%B #a*!#a #a*! C`%B%a*!YCGCG`b  PX@`Yfc Cc b  PX@`Yfc`  #DC >C`B-,  ETX#B E#B#`B `   BBB` #Ba++"Y-, +-,+-,+-,+-,+-,+-,+-,+-,+-,	+-+,# bfc`KTX# .]!!Y-,,# bfc`KTX# .q!!Y--,# bfc&`KTX# .r!!Y- , + ETX#B E#B#`B `a  BB`++"Y-!,  +-", +-#, +-$, +-%, +-&, +-', +-(, +-), +-*,	 +-., <`-/, `` C#`C%a`.*!-0,/+/*-1,  G  Cc b  PX@`Yfc`#a8# UX G  Cc b  PX@`Yfc`#a8!Y-2,  ETXEB1*EX0Y"Y-3, + ETXEB1*EX0Y"Y-4, 5`-5, EBEc b  PX@`Yfc+Cc b  PX@`Yfc+      D>#84*!-6, < G Cc b  PX@`Yfc` Ca8-7,.<-8, < G Cc b  PX@`Yfc` CaCc8-9, % . G #B%IG#G#a Xb!Y#B8*-:, #B%%G#G#a BC+e.#  <8-;, #B%% .G#G#a #B BC+ `PX @QX  &YBB# 
C #G#G#a#F`Cb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca#  &#Fa8#
CF%
CG#G#a` Cb  PX@`Yfc`# +#C`+%a%b  PX@`Yfc&a %`d#%`dPX!#!Y#  &#Fa8Y-<, #B   & .G#G#a#<8-=, #B 
#B   F#G+#a8->, #B%%G#G#a TX. <#!%%G#G#a %%G#G#a%%I%a  cc# Xb!Yc b  PX@`Yfc`#.#  <8#!Y-?, #B 
C .G#G#a ` `fb  PX@`Yfc#  <8-@,# .F%FCXPRYX <Y.0+-A,# .F%FCXRPYX <Y.0+-B,# .F%FCXPRYX <Y# .F%FCXRPYX <Y.0+-C,:+# .F%FCXPRYX <Y.0+-D,;+  <#B8# .F%FCXPRYX <Y.0+C.0+-E, %&   F#Ga#B.G#G#aC+# < .#80+-F,
%B %% .G#G#a #B BC+ `PX @QX  &YBB# GCb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca%Fa8# <#8!  F#G+#a8!Y0+-G, :+.0+-H, ;+!#  <#B#80+C.0+-I,  G #B .6*-J,  G #B .6*-K, 7*-L,9*-M, E# . F#a80+-N,
#BM+-O,  F+-P, F+-Q, F+-R,F+-S,  G+-T, G+-U, G+-V,G+-W,   C+-X,  C+-Y,  C+-Z, C+-[,  C+-\, C+-], C+-^,C+-_,  E+-`, E+-a, E+-b,E+-c,  H+-d, H+-e, H+-f,H+-g,   D+-h,  D+-i,  D+-j, D+-k,  D+-l, D+-m, D+-n,D+-o, <+.0+-p, <+@+-q, <+A+-r,  <+B+-s,<+@+-t,<+A+-u, <+B+-v, =+.0+-w, =+@+-x, =+A+-y, =+B+-z,=+@+-{,=+A+-|,=+B+-}, >+.0+-~, >+@+-, >+A+-, >+B+-,>+@+-,>+A+-,>+B+-, ?+.0+-, ?+@+-, ?+A+-, ?+B+-,?+@+-,?+A+-,?+B+-, EPXEX#!!YYB+e$PxEX0Y- K RXY  cp B0 * B#
* B-
* 	B	    * B @ @  *   D$QX@X  dD(QX X   DY'QX @cTX   DYYYYY%* Dd DD                             X X $ $(  (   X X $ $>  3       	 r  	       	     	     	  B   	  "  	  B&  	  "  	 dh  	  4 C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0   D e s i g n   S c i e n c e ,   I n c . 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y K a T e X _ M a t h I t a l i c F o n t F o r g e   2 . 0   :   K a T e X _ M a t h - I t a l i c K a T e X _ M a t h - I t a l i c V e r s i o n   1 . 1 ;   t t f a u t o h i n t   ( v 1 . 8 . 3 ) C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0 ,   D e s i g n   S c i e n c e ,   I n c .   ( < w w w . m a t h j a x . o r g > ) 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y   ( < w w w . k h a n a c a d e m y . o r g > ) , 
 w i t h   R e s e r v e d   F o n t   N a m e   K a T e X _ M a t h . 
 
 T h i s   F o n t   S o f t w a r e   i s   l i c e n s e d   u n d e r   t h e   S I L   O p e n   F o n t   L i c e n s e ,   V e r s i o n   1 . 1 . 
 T h i s   l i c e n s e   a v a i l a b l e   w i t h   a   F A Q   a t : 
 h t t p : / / s c r i p t s . s i l . o r g / O F L h t t p : / / s c r i p t s . s i l . o r g / O F L          2                     n                $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ]	
  !"#$%&'()*+,uni00A0Gammauni0394ThetaLambdaXiPiSigmaUpsilonPhiPsiuni03A9alphabetagammadeltaepsilonzetaetathetaiotakappalambdauni03BCnuxiomicronrhosigma1sigmatauupsilonphichipsiomegatheta1phi1omega1uni03F1uni03F5uniE131uniE237      	x<IöwOFF     I<     zL                       OS/2  =   S   `EKcmap  >      #5cvt   E   @   jXfpgm  >    b.|gasp  I4         glyf  D  9  _vrhead  <   6   6cBhhea  =      $hmtx  <L  P  G+loca  ;4      4#Qmaxp  ;        name  F<    r_|post  G  W  ٴӻprep  E`      {xڌxxɲfF4-d03'˻23}./3}Lq^h8潑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E$@A!"(cNhI64e]Qy9h(gq*ʵYsH[Q jxʘB{l
yBt.UIjڭ!YnB:t"HhQPIIWxE.X+]p{7U:XE:9|,XVT퀟KPPx[0!0@hq+aA*LwbPY%y2ؕ)xu%({)C*`w:ozKV!_ h5ǯ~, ^\Cǜ8u_<pp
5?9;`>9D/0w\OLc?fF2a:O9<f<8~Pwjwle̯ryIÞL!c^}Ҏ r%mV`ۆgL}mt̘gy]qFЭB3tϴǙu3/3?2hA~<bQ^E~ԠPsL-(8K^Ƀc媏{xvR i<[JCT.Su;+ڌmcn.	3>'9kJ;MK+tM`\bq0/F<}1b@lc֋%oVhZi̬q#듛<\).WnX WxLsk>='!nEX&녺^nV}3('Ĳ{,3"Vꉫڸ!MA']r_aq3+knN"+s9A4\ e
z
Y+WTLb_BfrjR#,Ko׳/16B.ؑrnǕ&=.X(#ۯvsJHI)hvZc9}SmN)-GXN,螰/i(ڸD嘕)^trs-Pō<֭;IcT4,lr㐯Sa*RD2*TR-$,"*N\4KHJIjѪMY  <> H!C6(*huUt.Ƙb%ؒ{rG'ǈw|yAxˋxbyoVpxjٵzdH"GfyhhӼTstŇΥ16փ-dM	)5ϕwg$8&HGF#7fs+V|fu߲[
NQ v]7t_+pyf2Ӏ`DgB>!Xl;[h[B?ơy
]i,wx6}I1+NҼo)ߡ	  x_G       `OS/2Fߑ  I(   `cmap{!  I  cvt   YT   Zfpgmb.|  J  gasp     _   glyf8     Dheadc'B  F   6hheaO  I   $hmtx\  G  loca(~:  E   maxp.  E    namecK~  Y  post  ^@  oprepe  X     2       33'3#2d222  n     %  2+"&'&'&5476362#'&''476NA0V,+3T++   %  1 %2+63633#"'&54774#''763633#"'&54774#''&AA'&AA'&78.-78.-   =>W h s pj" 2+"&54766774#'&54773?5#'&547737676323376763233#3##"&54766774##5#"377"OO![\pp!%%
"II *"OP \\ }}!*"IH!*2HI'IHv>
FH
uAruA
FH
rv>rF  1 F R W 
WSPH02+&&547676335632#"'&'"&#'#"&'5#&'&'467632334#"32654'K_3)#/D<	.0 E[C
6DW&& sNc5

&'	%02
%	
Cd	
,g	/> 7/   = 
  0 A O @JC?5&2+#"5472632327654'&#""&5476 7632 %472632#"&"27654	""	/
\B,F ,@BB$ʸ "_^" 	3ɸ-X/0!@A!010  / F X e 
a[OG) 2+267763233276#"'&''"&'&54767>7'&54676"767654&'&&'3277[Ijy#$-	f-0'0d:,;4HGW]Ol5$	cI(/@%	#3cJ @O-.-X
!g	k
'*G=G2
PMUr	W4'67!! .C<;/  P   2+63633#"'&54774#''QAA'&78.-  On  2+#'&'&476763633nI	""	$#_}11	u=`Ś  =\  2+633"&'&5476'&54C$#	""	#{{11:8  C% L (2+4632676672"#&&''#"'&7465"&547267'&5463'&&'&"'%%rt%%,&'%%rt%%,t"&$%&")t	t"&$%&"):   =i " 2+747!547632!##"'&55#'&=!$$ 
!
  P    2+763633#"'&54774#''QAA'&78.-    1  2+747632#"'&t]]t"   P       2+7"&'&576363A4AAA   =  	 2+"&5476 7632 fW
q   +  5 ) 2+2#"'&'4&546766&#"3276674654'&>X5
#77#!Xt#)%=dfH1yDjjDy1k2$,r.G fDVAAVDe"U   L  # 2+%!&&5567354##"&'476767676323	[>c2	,T+!1  ,   : /2+4&#"#"'&'&'&763232632#'&''567676S6+
A
 ?0.AN0A*oBD8DV	'|uKD=8$d H/2   . 9 2+4&#""'&567632#"'&'4676322654&/56366366>$;"Mpfmbt~tlTFX6'&/*:%( *&%
MZZc=({qu8U
45><;I@     0 7 31"
2+%###"'&'&55#"'&'&547767326223232'5'$'(uu

C$<LK#6776%&	0  % 8 2+&'676 ##367632#"'&54763232654'&#"m:dc_5:bC' 	B.:"!5	dED5:uA%6"%.=NT9   . & 9 1(
 2+".5476762"'&#"7632&#"367654'&D_2 =	#9D"JM.$
!O': 7hxOF)\Ji	8-&YOK,")#O1B$@h@0-   . +  2+#"&54766767#"#"'&'&476763232#(fYD 0
b*	%!d>
'  .  . @ 
6/)"2+4632#"54766'&&%4&'"327652674'&&#"=gc-C,$j.5'.5
F1%9
`eX'
.J(HK)%.:* 3U.?H)H 
  . - @ 8/	2+632#"'&'&767632327677"#"'&&'&546656&#"27654'&&s<eoD]D0#$,=)G-#"4

9#476<W3B -F(:I,$K	W/Rmx6-   P      	2+#''467633"&'&576363AAA4A?A5AA   P   & 	2+#''46763363633#"'&54774#''AAAA'&?A578.-   = ^    2+&476!!&54676!!^!MM
 d!ML D<	
   =   & : 2(2+4&#"#"'&&547632#"&'56767662#'&''4762!Q/ ISgn4Q'(ImV,+/$5X'GSL(>I%"
(2SRT++   = / C <12+%#"&5%32#"547632&'&#"3277&#"37654'&Gb+F2i+&3 
"mzI=j
	' 22
k	BPB#29n:`8O4
N
Fwr   *   $ 2 0*2+62#"'&'&''!"&'&5476&'&5'32#
45"
-&	I(bb	01c
r9M(^|   \   % 4 
2& 2+7&'6763#&'#3276654&32>74&'&'#w"P`L<*-` pHD3D-53w**968NKXL=K L06N4+&$	$69
  = .  2+"&5%32#"'&'&#"3267>776NBK3	0.)m_bn<C-	8LS	=@*z{!f
  \   "  2+7&'673262232#&'#36767654&w%KFGRxKN(.sr   \  S = 2+%263223#'&'676 ""#"&&"#'#32##	;MJz |  \  4 , 2+'#32###'&'676 "" uuuu43<|  = 1 /2+6632#"'&&#"327255#/476633#"=q`%G9mbcm0%%Wlkvd."@$ ||43./1   \   . 2+67632!5476762"'&'&55!#'&'\42ff43||||   U     2+67632#'&'U4243   . ! 2+632#"'&'476763267676&12	dQbM

 C*FM(6;7   \   7 2+%#"'&'"#'&'676327>76763398/0,*+*"L(<:6MK	&/.\["I'	6KJ   \    	2+%2#'&'6763276	42w
   \  v D !2+6763225476767632"'&'&"'&'&'&''"#'&'\GL	dIG_MFNNWF
('!HL3  \   3 2+67632276762#"&'&'.''"#'&'\@X	NK>	wp(' 	   >  *  2+%26332!"&'&%&#"3267674654>,	2섡CT
,)5)F'Va5G.rm8K?+\b4G"9m%4  \    % 2+6763##'&'&+3276654&\"^T43]9+<;V$ oo%
5100   > # K 0%2+%263 #"'&'4&&''"#"&'&%&#"33&5&54772233227654>,RLKDC'%~a,A=9		&		Va[f	
$rm8qW<G%HPY08uk  \   0 < 862+673262232#'&'&''##'&' 4&'&'#3676\"'h*B.8
PN]31$/LHGL.k%'s/Ku/ 
`,   1% D 12+%254'&'&'&&'&'&547632##'&&#"#"'&'&'466?620h*
=2,U9<:R3"E5h>tGZ|u(#WM
<K#fV):_f4;"@$K3zHos,"@	9	  (   , 2+6! #"&#"'##'&'##"#"'&'&576C('"+L43L+	   \ * %2+67632327674767632#"'&5\42;>r,3!':0YM{
Լl    # 2+63266767632#&'&54,56NU
aO.--v      J 	 2+#"'&'&''&#"'&'&5476327667676326676763KW=C2GB0;:3"0MK(;?	3GY
&
3Hu"
? 0sQ?   %   E -2+74&&'&547326223223676767633#'&&'.''#&54'ln
"E)
@?gcFFN		(J Qd<	u"=s     2 $2+63656766767672"&'&'&55'&'&54'?>o%j56{	3-<+"	~}	{|   =  h 4 '
2+##"&5767632$3223#"'&&'&547>VWH" {z#  O>  2+632##32#"'&'&76iY^	&&	^X     2+4762#"'&547633#"'&Y]	&!#V:  i  2+"##'&7667632"'&V$#
h65e
#$RcI
	
D    %  2+47632#"'&87B"   0 ? =5&2+4&#"#'&5464>7632#".55#"&54676736=32A'T?
	Ob,U+=P<,Cio$55.'>S
&	 ,[A+;!	;
0  6  ( % 2+"'#'&'676327632%327654'&#"A?6/--+	=S'=< ,
+wz(u)RQ '  % . ,2+7472632'&&#"3327676#"%I3+3+#
KAKZ*&)(>B/
X"  % " 1 '#2+%#"'&5476325476762#"'&5'275&#"d=FY/4R+=E9
X-.R,&(/#(37;|8$xu(&DA>   ! + *$2+74732##327676#"&%&&#"3++RGPZ}C&.
&$A5
S%y2-<     } 8 02+66735476726232#&'&#"32###'&''5#"*#
*-#

!-,	(,:n		12>=   2 ; F X 
UJA<,2+432763"'&'#"'3#"'&5467'&547'&2654&#"327654'&'&'"#X64;	
>@4_F5&[fKLlS1tCJ#)V/&+,7(X8WR, $!
	&@Y+#)/0AC"J';#!,+69'-36!	   5   1 *2+632#"'&'&5&'&&#"#'&'67632?bFG.-)4/--+O7?	4&~  .     - ) 2+#&'&5767326367632#'&'
mK-+-,	

#"t 3   7 . 2+62"'&'&4763276654767632#"'&54676`ffv*',1I>>>:E!	 A  ?   7 !2+676327767632""##"'&''#'&'?%$;B97
OX	!@>$":>kxWT<;   6     2+67632#'&'6-+-,   5  / G 2+632632#'&''&'&#"#'&''&'&#"#'&'6732;nm;hHF/-	+0/-	+0/-*,RKT7@"~"~   5   4 2+673267632#"'&'&5&'&&#"#'&'5*,1B/6.-)4/-*9	4&~       2+"546732'4.#"32766jo-	Ɨ
%?
,+wz$',1K;77   6>   - &!2+"'#'&'673276762"327654&CE2/-,-	;LI'*=%)$1&,bbU&8:(%MEM   %> & 4 ,'2+7472632547632#"'&'&55#"'&3275.#%C1
1+-.6D.)fT/.&/	dg,0?G')+   6  d $  2+673276672632#'&'6)+@&
	
6L-,
-f9)mk    8 *2+7254'&&'&&547632'&&#"#"'&'467632A&T1C&)W;A+7+!L7Jr*\O!AR,K4C&)*&
T7)g#$  uM 8 12+"&56633576763232##3676#"&'&55B*(1881&
			LY30s4422h%%85q  4 2 2+!"&'5#&&'&57676323276?4767632#6c?F
.-*4-.,	<*/	:
t      , "2+467632>7676332#"'&''.%'* 
)=>?$%GGHH#h
	ab()svW      ;  2+#"'&'&'&'5#"'&'&54763266763246676763j
=B)*
j , F>21K&'
%
waj9
.y^"	     @  2+##"'&&''"'&547>'4&&'&547633276763((R	
&/	%,	
&
12QNJK0)I
712f9D>hdZ^6 d   3 4 
 2+#"'&546327677'&547632767676763MTN0H
&'		]]**+%6
&
3G]	#	qa'5'      & 	2+#"'&5476 632#"'&547676LJx


$%	a   Z X "  2+#"'&'&#""&'&7663232767?2%#;-X6N*
-C	*	   [S  + '2+633"&'&'&476467632#'&&s211)	0/)0	0,     2+63232#"'&544&#"32X2(Q"4( !#|:,>-#0    	2+633#"&'&66726:DC"Qx   @>  2+467632#''&]"#
43I#  6     2+67632#'&'6-+-,t  3  % 2+632#"'&5476672327665476n,1I>	#
E!	 !;  i  2+"##'&7667632"'&V$#
h65e
#$RcI
	
D   g  2+263633#"'&&'&73226:233V$#	e56h	


	GI  L0   2+#&'&576363mWV**   P(   2+2#"'&543232767476+Q'KM%Q'	LK	%GE'				   HT    2+#&'&5476763l5		      2+63232#"'&544&#"32X2(Q"4( !#|:,>-#0  Z$ "  2+#"'&'&#""&'&7663232767?2%#;-6N*
.B	*	   n  ' $2+46567633"'&746567633"'&nDC')#$DC')#$$|BE|BE   \    2+676 #"&#"'##'&'\~.S*&43  <  X ! . '"2+632 #""*&"##&56 56325&'&'}H:)6DHSNSHD6)[M[:Uo?   >   / 
%2+! ! %2654&'&#"62#"'&'&5476>kpns_PkW4\uvTx[.,:l_*++*   )  v , 2+7:3#"'&'&''#"&'&5476""
	+5
-Q
4F0$	
W	:m  .    6 T 
J7,  2+"&"##"'&'&57676! ""632#"&'&'&57623263223!%&''47676s@	ժ2# 	)		&&$%#$	-%$%%&   \     2+676 "'&'&!#'&'\&f43  =   8 #2+%$3223!%&547>5.'&57676 ""#%BEwt~\bF| !	f	$	S  >   @ -2+&&547673267676632#&'&&#"#'&''&54&&5&'&#"X'1YE#(-$e<'a#43	8
35'4I"3K*?'5#uùpa	x'   >   : H R 
ML<;!2+632323"###'&''5#&&#&'&547672673576#"7&''66764Z1/:=y10
9=y
)#/L,.&&_A@&&'(b>@((,B=?#%T/.	F  =   P >2+32##'&''5'&'&'&'&'&5667323257676327676767676#
&101:#
,1/</r!	J?"*''()#9I
#8 TKM^KT D   1   Q &2+"#'&''476763233&'&'&5476!232632#'&'&5476767654&YT	
+&zx(P4%9 ,R4:87P(zx4SuMT$#*]T.0+! &D0WP0jC==*II!4? Fn6
!UK     %G  2+47632#"'&87"     KG  
2+476 ! '&""#  Q    2+'576763233W&'77.-   P   2+63633#"'&54774#''QAA'&78.-    -  2+'5767632333'576763233&'i&'77.-77.-  %  1 %2+63633#"'&54774#''763633#"'&54774#''&AA'&AA'&78.-78.-     { t                         U FC8h9[|17*)j	`	


T

2})ti/wq){-dr[-f^S.Sy8g AvWm N !C!e!!!" "n      !_<                 K            2    M     o n. % =& 1 =? /2 P O =& CX =2 Po 2 P& =& +& L& ,& .& & %& .& .& .& .2 P2 PX = = = * \ = \ \c \ = \K U . \E \ \ \ > \ > \c 1 ( \   %  =W OW & i&   1 6 %1 % P & 1 5  . ?  6c 51 5&  1 61 %t 6  1 4     & Z   & [i &    6& i& g& L& P2 H & Z& nE \ <X > ) . \ =X > >X = 1&  L  2 Q2 P.  %      ZLK                z          1                      PfEd @    8 Z    ^                          :     ; = [ _ z ~     17        = ? ] a ~     17   /*b_]                                                            ,  UXEY  K QKSZX4(Y`f UX%a  cc#b!! Y C#D  C`B-, `f-,#!#!-, d BCC ``BCB%CCTx #CCadPxC`B!e!CCB C#BC`B# PXeYC`B-,+CX#!#!CC# PXeY d P&Z(CEcEEX!%YR[X!#!X PPX!@Y 8PX!8YY CEcEad(PX!CEcE 0PX!0Y PX f a 
PX`  PX!
` 6PX!6``YYY%Cc RX K
PX!CKPX!Ka cCc bYYdaY+YY# PXeYY dC#BY-, E %ad CPX#B#B!!Y`-,#!#!+ dbB #BEXCEcC`Ec*! C  +0%&QX`PaRYX#Y!Y @SX+!@Y# PXeY-,	C+  C`B-,	#B#  #Babfc`*-	,  E Cc b  PX@`Yfc`D`-
,	 CEB*!  C`B-, C#D  C`B-,  E +# C%` E#a d  PX! 0PX @YY# PXeY%#aDD`-,  E +# C%` E#a d$PX @Y# PXeY%#aDD`-,  #B EPX!#!Y*!-,EdaD-,`  CJ PX #BYCJ RX #BY-, bfc  c#aC` ` #B#-,KTXdDY$e#x-,KQXKSXdDY!Y$e#x-, CUXCaB+Y C%B%B%B# %PX C`%B #a*!#a #a*! C`%B%a*!YCGCG`b  PX@`Yfc Cc b  PX@`Yfc`  #DC >C`B-,  ETX#B E#B#`B `   BBB` #Ba++"Y-, +-,+-,+-,+-,+-,+-,+-,+-,+-,	+-+,# bfc`KTX# .]!!Y-,,# bfc`KTX# .q!!Y--,# bfc&`KTX# .r!!Y- , + ETX#B E#B#`B `a  BB`++"Y-!,  +-", +-#, +-$, +-%, +-&, +-', +-(, +-), +-*,	 +-., <`-/, `` C#`C%a`.*!-0,/+/*-1,  G  Cc b  PX@`Yfc`#a8# UX G  Cc b  PX@`Yfc`#a8!Y-2,  ETXEB1*EX0Y"Y-3, + ETXEB1*EX0Y"Y-4, 5`-5, EBEc b  PX@`Yfc+Cc b  PX@`Yfc+      D>#84*!-6, < G Cc b  PX@`Yfc` Ca8-7,.<-8, < G Cc b  PX@`Yfc` CaCc8-9, % . G #B%IG#G#a Xb!Y#B8*-:, #B%%G#G#a BC+e.#  <8-;, #B%% .G#G#a #B BC+ `PX @QX  &YBB# 
C #G#G#a#F`Cb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca#  &#Fa8#
CF%
CG#G#a` Cb  PX@`Yfc`# +#C`+%a%b  PX@`Yfc&a %`d#%`dPX!#!Y#  &#Fa8Y-<, #B   & .G#G#a#<8-=, #B 
#B   F#G+#a8->, #B%%G#G#a TX. <#!%%G#G#a %%G#G#a%%I%a  cc# Xb!Yc b  PX@`Yfc`#.#  <8#!Y-?, #B 
C .G#G#a ` `fb  PX@`Yfc#  <8-@,# .F%FCXPRYX <Y.0+-A,# .F%FCXRPYX <Y.0+-B,# .F%FCXPRYX <Y# .F%FCXRPYX <Y.0+-C,:+# .F%FCXPRYX <Y.0+-D,;+  <#B8# .F%FCXPRYX <Y.0+C.0+-E, %&   F#Ga#B.G#G#aC+# < .#80+-F,
%B %% .G#G#a #B BC+ `PX @QX  &YBB# GCb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca%Fa8# <#8!  F#G+#a8!Y0+-G, :+.0+-H, ;+!#  <#B#80+C.0+-I,  G #B .6*-J,  G #B .6*-K, 7*-L,9*-M, E# . F#a80+-N,
#BM+-O,  F+-P, F+-Q, F+-R,F+-S,  G+-T, G+-U, G+-V,G+-W,   C+-X,  C+-Y,  C+-Z, C+-[,  C+-\, C+-], C+-^,C+-_,  E+-`, E+-a, E+-b,E+-c,  H+-d, H+-e, H+-f,H+-g,   D+-h,  D+-i,  D+-j, D+-k,  D+-l, D+-m, D+-n,D+-o, <+.0+-p, <+@+-q, <+A+-r,  <+B+-s,<+@+-t,<+A+-u, <+B+-v, =+.0+-w, =+@+-x, =+A+-y, =+B+-z,=+@+-{,=+A+-|,=+B+-}, >+.0+-~, >+@+-, >+A+-, >+B+-,>+@+-,>+A+-,>+B+-, ?+.0+-, ?+@+-, ?+A+-, ?+B+-,?+@+-,?+A+-,?+B+-, EPXEX#!!YYB+e$PxEX0Y- K RXY  cp B(  * B
* B%
* 	B    * B @ @  *   D$QX@X  dD(QX X   DY'QX @cTX   DYYYYY* Dd DD                                         Z Z    >  3       	 r  	       	     	     	  H   	  (  	  B8  	  (  	 nz  	  4 C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0   D e s i g n   S c i e n c e ,   I n c . 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y K a T e X _ S a n s S e r i f B o l d F o n t F o r g e   2 . 0   :   K a T e X _ S a n s S e r i f - B o l d K a T e X _ S a n s S e r i f - B o l d V e r s i o n   1 . 1 ;   t t f a u t o h i n t   ( v 1 . 8 . 3 ) C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0 ,   D e s i g n   S c i e n c e ,   I n c .   ( < w w w . m a t h j a x . o r g > ) 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y   ( < w w w . k h a n a c a d e m y . o r g > ) , 
 w i t h   R e s e r v e d   F o n t   N a m e   K a T e X _ S a n s S e r i f . 
 
 T h i s   F o n t   S o f t w a r e   i s   l i c e n s e d   u n d e r   t h e   S I L   O p e n   F o n t   L i c e n s e ,   V e r s i o n   1 . 1 . 
 T h i s   l i c e n s e   a v a i l a b l e   w i t h   a   F A Q   a t : 
 h t t p : / / s c r i p t s . s i l . o r g / O F L h t t p : / / s c r i p t s . s i l . o r g / O F L          2                     {           	 
                       " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > @ A B D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] a            	
      uni00A0uni0237uni02C9Gammauni0394ThetaLambdaXiPiSigmaUpsilonPhiPsiuni03A9    v̸xH8wOFF     8H     _                       OS/2  ,   V   `Fߑcmap  -L     {!cvt   5X   :   Zfpgm  .    b.|gasp  8@         glyf  D  )  D8head  +h   6   6c'Bhhea  ,      $Ohmtx  +  4  \loca  *p      (~:maxp  *P        .name  5    cK~post  74  	  oprep  4      exͼ׵?>xFZJZi%-^5ۉNA;0n^b}yPJSX;let5{s (SVE*H*
PP}JD))꽝1j,@B"^zYj"[qV1'LsF9(B,Jm8k8'OG-!e;Y Pc,)JCR2&R4kZ-I$zRi/ʘ&erEcG
@a44:zH6yd
\&dD(QppiykӨ_Bjp1έ	y͋bkV\Xg g̪Z?v(%[tɧX?JXOE#t|YF7n)XP\\}wn=@e:ө"9
!0:{hB|yc&Bcޙ	Wޗc0;8z)1zQYlWv)vl]7bbedO!0mg	;[)[ J(U*"u	mj٨W~4z-ۛaZQT3sh1\qo 1O^(`Y@$$\|g5r]/WTJ#UU/i oY8fX˪A9ia
DX/VkSQУ](#ʌE	27n;!hbA`Q+JcvUeAJW{be_¿};Q<m
\m2`$uryj)(Y=6Hys56)~L,_$Ol!d7PQiqWN0G"f"]#G~='v~r3O2׫wyfxY0og	yPPK^5gv\5p"߂ן]-vjRa"5 ؀a2c^7GûNra5B<;k}X2bUVbDϝ!_%@oNsL0E#><7KUCq3غK5^iYWW.Rq;f">(PC?dw/Sp@h`Z<5Sť3/KD	\EÉ8wTȍƋC/9˛8h~fT@h8S慍.]㋝Fk<C!Fc@	(߃1k:
U`\+X[V`I%rUPD,dz!QIY)upyG)cDJD:w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QӈG3021H(M2'TieȔ%[\^4|a
)VTr1*UVVz;r+(x{À0	bC >$ :9C=hqқ37reݝcXq#=XςW $rIg=A;g-ݟ̽ KfWf'0.2
88'/oO G#fƻ&D$8vs)Ks_ZWBu0? /Ii~
x\W       `OS/2E  @   `cmap>,^  A  cvt z  P   Zfpgmb.|  B  gasp     WT   glyfp])@     <`headbB  >h   6hhea   @   $hmtxG.x  >  loca܀  =l   maxp/  =L    named  Q4  post_pL  U  prepe  P$     2       33'3#2d222  n  c   2+732#"566742#011!:''Hbbrr]^    / -"
2+6674##547732#"76674##547732#"	11
3	11
4>#.//T>#.//T   W>S [ i `\:	2+%##"&5674###"&5677#'&5473766774#"'&54763776746377676322#'33766774#KK
]]KK
GHVW%pq
y|LK]]GK	EHVT
S`'&&&]]%\			
N+

		PPNNN+

   85 I U ` 
ZYSK92+7>5&'&&54676322667732&'&#'2#"56654#&'6677564&'2667662@]I%$;/#("BlH
%$	_72F|
#0^/
!&F{mO:E

(	$$#mn-\Ly)77
0=)(/D  /  # 9 P _ @\RG;.%2+632#"'&54764#"32766%63 #"'4&54767 632#"'&&547633276654'&& !135B!*!
"	N2141/
9#( %?!!	 -'PaMP'L#p<F?/]b@B0,(8*U8#J0_7\19	}  G B X m 
e\SD'2+6326765332763#"'#"'&'4767677'&554766764#"76766&''36767'4&	4:#+|P
$$A[8"2<G4LJa\h$.9,S65)
)9n>% 50)'G7)$I]7]Y
+vV1)8	/Y9.%(Ow>/ )8	
*%<PR(#@   O  
2+6674##547732#"	11
2>#.//T   h  2+732#'&547676%%hRL
Z4v/
ZNIkthӏ9    2+4''3#766,NL	
M%2d""LDϫj

lw$!	Rj   28 I $ 2+27632##"&'&&''#"&547#"&547677'&54632326566mM)^ 		  &4
G-]	#
&#<=B%:"!<	l 
!9 x  lG # 2+7&547!5>7632!!#"&5454#|. =%:=		
	  ?  b  	2+76742#677#"Zb'%1]^?>#>   3 L 	 2+5!#"46B
%"A  Z    b  2+76742#Zbb]^  X  	2+632 #"&5476 7:	
)	?   X%  0 (2+6332#"'&547676&#"26767654*0.,G"(P07C+/7,B+#:;*%*$-Jw_|@#
+/g<`UC*C;m:()&!EF*D   X   ! 2+44>77326327673233#'66737L;K
"O;==}30	$/I0  2  ' 5 )2+4&#""'&54763232632!6?676767660 3(NxHX
3"] P%q	Bq$g380$ !'kKBC7'C	uL'6]WS   8  E %2+4&#"'&''767632#"''2653267654'&'"5652676676("*U	Me>)I 
Wdm@Z14O
=//B+F	!,%	 	O	(R>)ZUQ	H#,Q?NHG,  >  	  " 2+767323###677!7667%6N8766X[.-^	HFFbIOP$,O	%#QQ  2+ < 2+433#67632#"'&&546677327667654'&##"#Q
+4CQ"!oAV8 a2@)"Q|$[.bIB<<O8	!TQ='4	6   ^$ - @ :/	 2+"&547667632'&#"63234#"327676NJtI86!&.-*D*S["7R(P1J-?.	n[`b\%##,cD#"+,mA$;@^
e>KD$N*  T  2+732#"5476767"5766S@21B07f*	&{	26/  M* ( 5 E 
A82* 2+"&54767676'&'&5476763224#"3264&#"#3276K^?$K.X$%>S$Y	FG0B\4B0*:K>0*
7H-+F) \I,'=(&H/,L@3&F$.M<g"+%N;2')M)/]F,.?3   M! ' 9 5) 2+32#"'673267676657#"'&&5476764#"23276w#iZ^N/$ 1#H#MX)BLJ% +E1&BVgW/,-,F>N.(+\CJl :K9&3N>   Z     2+732#"566742#
11
11Obb00]^  ?   2+732#"566742#677#"
11
11Ob'%100]^?>#>   X r   2+6! ! '&54!&47>=`p		     $ - ,(2+4&#"#'&4667632#"54766766742#&*KI
<7(	}M+%&''S90bb>/&%
i_7 %G73Fw*$]^  x 6 D A92+%273#"'&&547667632#"'&5467632&'&#"4&#"276U=Q#m8	@1GVJ/M(,VSJ_(vM!1fPGi&#%1%F#DA#4]{nIee[Y]Z|a!)b1XQd ^wL+=f8+>#B    ~  !  2+363#'&&5!535&&5&h4l$!-}rr$ZUK*+? ;M6.
   Z    2 F 
E7(!2+"576673'&'#32767654'&367667654'&'&'"=[I02A	
	&Jm 	/l%MJBY$A*3VZ8W	"?OOk	N6/P
-,SZM&&En<	*  15$'   | - #2+632&'&#"32676#"'&&54676gZ_TK$<VRd#/9K6
4F9$eyfL3_/c$0 *pi<   X    ) 2+3#"5766&##3676767654'&J_mK.Xr
	&VRN:UUzJ/)\ZlmIi-,eA##oFfB-O   V   ( '2+767432#'32"3263!V1W6,$jh$M   V    2+7674 #'33!##V !44$ql3   } 3 2+%674#"54773#"&'&54>72632'&&#"32:;5WA<d
FpFTG&"E4
f`QT6T %
lV'-UrI b
n^s   V    " 	2+%656"###"576673!74773#C:j#"44
	&Jg=Ggh=-,SZS  W  R  2+3#"5766Jg44	
&\ZS-,  .  
2+3#"'&576676327466y:duZAE:% Bo>R-2YJ   X   & 2+#/&#"576673267732[0/77NO,22
	&J12J]q97Pkj-,SZOa=  W    	2+633#"576673RFT	
&JgE	-,SZ  \   1 2+#"576673673#5676#''&'5;%B/.
	&JC]??8,+Aa}-,SZTiKD5S*.,F_BG   X   % 2+#"576673746673#'&''7/.
	&Jw#@\!ra-,SZgL6LD,Sy,  v  . (2+2632#"'&&547664&'&##327676#SdqT\^RA-4f6D;2_%MD:?=i'k!e8=3%vFIYMf?3mPn/P4  X    + % 2+3##"5766%4&'&##367676JE[8\0d]44
	&?6LIOOh(\ZYDIE$7-,16R"   v   B >42+#"'&&5476672632#'4&'4336767654&'&#"3276(/RB-4f6K#SduN

%yW<55.LF<eE@3%vFIY	k!e2)J,-,^'OkݎOk   X    / )"2+#'&'##"57667374'&'#327676x44J%!!32
	&J	C\I-3[hSRKXd#Af-,SZB4*I8!LuBJ  6a 8  2+4632"'&#"#"''66532767654'&'&'&&o[I
$7UA]*;4KiH(+uZ	%	Hs6)2:4@+1[+a6O1*2\Ft?`	J"<@K       2+654!!###565500@@44~`>($W   ' 2+733267676773#"&'4&54763geO+W21\`$XgVo#a.!(8@A.#FaM       2+32676732#"5'&&;763"N/.]q66\Z$,bV?\%,,    4 4 	2+%25476737673#54'&'&5476"#54''3%-9a ;Wf#>4a2fH(oNsT:
YvN 28Lh      # 2+&'4336673#''#7667`<=)1&%q2a3yGH;GrMo4Ra)))6*^BQT    )  2+43367673 "5677'=<	5323_%k   7    2+7 5&#"#"47732363!56C](	eT61&%D3  )  2+732#33#"54iVV**ZZ**VV$Z]@
  a  2+#475367#'66732aejUx*+VV)
@52     2+73#'&&'#76653J21LP'L"
>2SS1)J&"	=   25  2+732#"5766;K%G   = 0 @ ;32+62#57#"'&&5476676737654'&#"#&6767632676654#6=K(Z36;$	;#Ij'WA
0m* 'B
,bG<l$4&/1.N((   K # 1 .&2+3267632#"'&#"5766%4&#"326J,-<

LS%,RDKG0/.	
&72/<)1Lb\Z'
V9WF+-,
08)H	,{  K / +2+746732'&&'&'&#"33276"&'&Ke8:%&#4J5
NI@HO_	o'']DI	'((SH  IL  4 -!2+73#565#"'&'&547663243276?654'&#"Y]	"><L
}UQ91/.$%
<P)Sgc*/7	(iiRF   G " + *%2+%#"&547676332!327'&&#"3;?Ob=Cl
-$	MR,'/#mEfR[SZ#(!.>	/'/<  ^   3 22+7474##577377667667632'&'"32#"#^N"!"!g;	!I5534NZm%"
U<VK2=?"  28 Q _ t 
ka\T>2+7&5476676325&''467633'&#"&&'#"'&'&##"'&&'&547676'4'&54%4&#"326&#"3267654'&~
@)#"C 0/# *	fA,$GRv)N)%/B9!"$$/;PA1	
F)0Y)(E	$$ Bc4[5%L3 =(
6"A("K"!	  I   ) 
2+4#"#"5766732632#56P

/ /.	
&J,-	RJn?]:A:>-,SZ,9sA<a    J  ;   
2+26353"##42#56hhZ]ZBddM  4P  & 2+732#"5642#"'&54773267634
44ZmG-1*#.pu330F

$%  L      2+!'"#"576673766773tc()**
	&JV\:l65cb#@1$#EF-,SZP2]UU=K   J  7  2+3#"5766JY--
	&\ZS-,  I   G '2+76433676632767632#5654#"#5654#"#"I_,+O%9.9 n?]:P

/ ]:P

/ /.
! +	a 
:> 
:>   I   + 2+76433676632#5654#"#"I_,+O%<=?]:P

/ /.
!,4 
:>  E  ! 	 2+"&5476676324&#"3276Nd!"xB?IP4/R
6/H0/eO>?CZaKn"19
 b"!3;AA   ">   / )"2+67632#"'##576742&#"32654&S[
%,%/P#%L20/.H)Zo/64Bj&&.Q=\G_&222XG,li/wN*=   H> ! / *# 2+#"5675"##"'&&547667632677&#"32776.//X&"*$L+ +;">.,R5+6.	R8OK2K
N!?b5@.D  J   " 2+6672633"#"56433X+@l--_+*y+!P8to$	  # :  2+6632#&'&#"#"&''667327654'&'&'&'&54hfN<35E""+&.35^)U	:M?	)&3K>DN"8)@35I*+(  a; 1 	2+727#"5476674##5773776773232#",-82;0'&((**CCCC*DBV
%"!"?>"	2   Z % 	 2+"&547>432326765432#574)#&$/.I#0G
@/.]Z!k
!(."*M$  l    2+75376732#E]'--44"C8&   l   ; +2+7&5'32767677317>7732#5&'&'477#&[	4@U+G,,3?r331V^*R  	
#o>~#O^7'dy1~/8<Ap      ! 2+7.'36773"#''&#4#76677>/e,-"(Jc	Ҍ32/.(Rc@vdIKK")K	WX*X>r   3 1 2+4337676773 #"'"&''465336765'&&m//"$*SZB@
 !3.	X!IR/i	N
%Oml       2+73272#"57767"56lxw$Dk    0G  2+%"#566376732#"'&'&;	LD2#	
&&	* :4N
,#>   F 	  2+753#"746753#b

bb
11H^//Z
-      2+"&547632'"3263654p%:&?'@&1(%!*#}%!  a@   2+>773a5L/*R(O   J   	 2+42#56Z]ZM 4  
2+42#"'&546773267ZmG-) *
%)	0F
%     2+73#'&&'#76653J21LP'L"
>2SS1)J&"	=   0   2+3673#''&LP'L(O2&%211)J&'O1RS  (4w  2+>532"	)%'&  63  2+73#76C\WSLqERN    
 2+'3##'&]-+&&-.RRGH  =   2+"&54773326773f>PL+'H	K0FR>9	;%>4D   @O  
2+76353"##
hhB22d  c    2+"&547632'"3263654%:&?'@&1(%!*#}%!  0  2+"#566376732#"'&'&;	LD2#	
&&	* Y:4N
,#>  3 
  2+732#767732#76)..6L)..6LkK%.S	PK%.S	  W    2+7674 #'#Wh$  *     
2+3!%&5'!'&&'kIW_L?> 4#   w$  . : 
60%	 2+"&547667632&#"327667654732#"56y+%LD?%< YO#+$"A6KX756MiY

y]\O!y?P9:a,&5m8-59(g00     F   2+36 73##5&'&'&5477"ogM67?8,Uz #
(}s0   *   
  * 
)	2+474!!!674  6653:6:3!!	D"-1;#		YU+*6	HR**  V     2+7674! #5657!#VhBAhT[  7  - # 2+32633!%7677'&#76677! #A/	p2		όVV21g**	''     K 1 "2+654&#"#56654'&##"#6766327676632A%4&hK+,]	d;|%15(;I+
	#'/eX S44B!].G7  |   4 E R 
OLA6 2+%##7477#"&&'&'&54766767256773223433764&'"''"67611	G3B[C;G
11Jgb
Hc8	#"?2E|2j533+9S:f!43dR;% MsYC#.~4@a%    V M L%2+%6656&'&547654&''6753216773327667676767633##T44K6a)1;B94"MDebf*7(?
4$MK&lrMr\\(I?MGf  ,   G '2+4&#"#57435'4&5&'&'&546763232632#667676_HBeQR̓^	N3#	&Q	CKS:)13mh:S*UF%*~REUqB-+.L$9I   2 58  2+732#"5766;%G  2 )8  2+7! ! 5766;%G  O  2+"57667767325b
27^
/)T!<  O  
2+6674##547732#"	11
2>#.//T  e  )  2+"5766776732"5766776732b
2b
27^
/)T!<^
/)T!<    / -"
2+6674##547732#"76674##547732#"	11
3	11
4>#.//T>#.//T     | u                         9 E?n1H]
]_`@	/		
2
r

*G~4u	o?Fx86	0p-pAxTz[5L{4M~ .0m7.Lt0        uw_<                 4            2    M     ? n A W 8A  G  h  
 l ?M 3 Z  X X 2 8 > 2 ^  M M Z ?
 X  x  Z | XU V9 V } V W . X Wk \ X v X v X, 6      c 7! )!  2 = K K I G2 ^  I  J L  J I I E " HV J #i a Z l l          a  J   6      WA *
 wc  * V 7
  |
  , 2 2         ZD4                {          1                       PfEd @    8 Z    ^                          8     ; = [ _ z ~    17        = ? ] a ~    17   .)c`^                                                          ,  UXEY  K QKSZX4(Y`f UX%a  cc#b!! Y C#D  C`B-, `f-,#!#!-, d BCC ``BCB%CCTx #CCadPxC`B!e!CCB C#BC`B# PXeYC`B-,+CX#!#!CC# PXeY d P&Z(CEcEEX!%YR[X!#!X PPX!@Y 8PX!8YY CEcEad(PX!CEcE 0PX!0Y PX f a 
PX`  PX!
` 6PX!6``YYY%Cc RX K
PX!CKPX!Ka cCc bYYdaY+YY# PXeYY dC#BY-, E %ad CPX#B#B!!Y`-,#!#!+ dbB #BEXCEcC`Ec*! C  +0%&QX`PaRYX#Y!Y @SX+!@Y# PXeY-,	C+  C`B-,	#B#  #Babfc`*-	,  E Cc b  PX@`Yfc`D`-
,	 CEB*!  C`B-, C#D  C`B-,  E +# C%` E#a d  PX! 0PX @YY# PXeY%#aDD`-,  E +# C%` E#a d$PX @Y# PXeY%#aDD`-,  #B EPX!#!Y*!-,EdaD-,`  CJ PX #BYCJ RX #BY-, bfc  c#aC` ` #B#-,KTXdDY$e#x-,KQXKSXdDY!Y$e#x-, CUXCaB+Y C%B%B%B# %PX C`%B #a*!#a #a*! C`%B%a*!YCGCG`b  PX@`Yfc Cc b  PX@`Yfc`  #DC >C`B-,  ETX#B E#B#`B `   BBB` #Ba++"Y-, +-,+-,+-,+-,+-,+-,+-,+-,+-,	+-+,# bfc`KTX# .]!!Y-,,# bfc`KTX# .q!!Y--,# bfc&`KTX# .r!!Y- , + ETX#B E#B#`B `a  BB`++"Y-!,  +-", +-#, +-$, +-%, +-&, +-', +-(, +-), +-*,	 +-., <`-/, `` C#`C%a`.*!-0,/+/*-1,  G  Cc b  PX@`Yfc`#a8# UX G  Cc b  PX@`Yfc`#a8!Y-2,  ETXEB1*EX0Y"Y-3, + ETXEB1*EX0Y"Y-4, 5`-5, EBEc b  PX@`Yfc+Cc b  PX@`Yfc+      D>#84*!-6, < G Cc b  PX@`Yfc` Ca8-7,.<-8, < G Cc b  PX@`Yfc` CaCc8-9, % . G #B%IG#G#a Xb!Y#B8*-:, #B%%G#G#a BC+e.#  <8-;, #B%% .G#G#a #B BC+ `PX @QX  &YBB# 
C #G#G#a#F`Cb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca#  &#Fa8#
CF%
CG#G#a` Cb  PX@`Yfc`# +#C`+%a%b  PX@`Yfc&a %`d#%`dPX!#!Y#  &#Fa8Y-<, #B   & .G#G#a#<8-=, #B 
#B   F#G+#a8->, #B%%G#G#a TX. <#!%%G#G#a %%G#G#a%%I%a  cc# Xb!Yc b  PX@`Yfc`#.#  <8#!Y-?, #B 
C .G#G#a ` `fb  PX@`Yfc#  <8-@,# .F%FCXPRYX <Y.0+-A,# .F%FCXRPYX <Y.0+-B,# .F%FCXPRYX <Y# .F%FCXRPYX <Y.0+-C,:+# .F%FCXPRYX <Y.0+-D,;+  <#B8# .F%FCXPRYX <Y.0+C.0+-E, %&   F#Ga#B.G#G#aC+# < .#80+-F,
%B %% .G#G#a #B BC+ `PX @QX  &YBB# GCb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca%Fa8# <#8!  F#G+#a8!Y0+-G, :+.0+-H, ;+!#  <#B#80+C.0+-I,  G #B .6*-J,  G #B .6*-K, 7*-L,9*-M, E# . F#a80+-N,
#BM+-O,  F+-P, F+-Q, F+-R,F+-S,  G+-T, G+-U, G+-V,G+-W,   C+-X,  C+-Y,  C+-Z, C+-[,  C+-\, C+-], C+-^,C+-_,  E+-`, E+-a, E+-b,E+-c,  H+-d, H+-e, H+-f,H+-g,   D+-h,  D+-i,  D+-j, D+-k,  D+-l, D+-m, D+-n,D+-o, <+.0+-p, <+@+-q, <+A+-r,  <+B+-s,<+@+-t,<+A+-u, <+B+-v, =+.0+-w, =+@+-x, =+A+-y, =+B+-z,=+@+-{,=+A+-|,=+B+-}, >+.0+-~, >+@+-, >+A+-, >+B+-,>+@+-,>+A+-,>+B+-, ?+.0+-, ?+@+-, ?+A+-, ?+B+-,?+@+-,?+A+-,?+B+-, EPXEX#!!YYB+e$PxEX0Y- K RXY  cp B(  * B
* B%
* 	B    * B @ @  *   D$QX@X  dD(QX X   DY'QX @cTX   DYYYYY* Dd DD                                       ] ] M M    8  8       	 r  	       	     	     	  L   	  ,  	  BD  	  ,  	 n  	  4 C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0   D e s i g n   S c i e n c e ,   I n c . 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y K a T e X _ S a n s S e r i f I t a l i c F o n t F o r g e   2 . 0   :   K a T e X _ S a n s S e r i f - I t a l i c K a T e X _ S a n s S e r i f - I t a l i c V e r s i o n   1 . 1 ;   t t f a u t o h i n t   ( v 1 . 8 . 3 ) C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0 ,   D e s i g n   S c i e n c e ,   I n c .   ( < w w w . m a t h j a x . o r g > ) 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y   ( < w w w . k h a n a c a d e m y . o r g > ) , 
 w i t h   R e s e r v e d   F o n t   N a m e   K a T e X _ S a n s S e r i f . 
 
 T h i s   F o n t   S o f t w a r e   i s   l i c e n s e d   u n d e r   t h e   S I L   O p e n   F o n t   L i c e n s e ,   V e r s i o n   1 . 1 . 
 T h i s   l i c e n s e   a v a i l a b l e   w i t h   a   F A Q   a t : 
 h t t p : / / s c r i p t s . s i l . o r g / O F L h t t p : / / s c r i p t s . s i l . o r g / O F L          2                     |           	 
                       " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > @ A B D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] a           	
      uni00A0uni0237uni02C9uni02CAuni02CBGammauni0394ThetaLambdaXiPiSigmaUpsilonPhiPsiuni03A9      wmڰx 7wOFF     7      W\                       OS/2  +   S   `Ecmap  ,$     >,^cvt   4,   8   Zzfpgm  ,    b.|gasp  7         glyf  D  '  <`p])@head  *(   6   6bBhhea  +      $ hmtx  *`  N  G.xloca  ),      ܀maxp  )        /name  4d    dpost  6    _pLprep  3      exͻו7Zjfi&I3͈,lɌ3Κ!:3/X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5rd.KWVXF/`5e?~~(` G`408RҚ	-5Cna FKoh7_@GBbX	$Q9HF@2f@<RЌtAupM6=( V AcށA)Mx@cA5":x0E7ۂAf@|	Ca,D Lzc%9>i0L\.{3*U?F r} #D'l[P^F.^Z&Q76EJT#g)\OS0?r`b0FE ly,%ŔUvI=40a$<04ҚKdf Sj&+ne<zP3	02Rev2z 2ulH);	F23&b~̠T1fÒcffZ%L:e4ۀG&eȴ=Kc>J`L̤d5o	}Ҡ>]&ac%;LTƬQ|43ǙH 2g^>8Y3)d,ZPF}jdGlPX|D&c^":"OUC2ºS|m! >D!9F|¾
d1eϟ΅&HHH(((TDCKG3+vʔPJ	QUӲkVzϛa>omSr˴ˮLNb-m."3feH"eɠA$5k=1Yn-!ܒ d.̳" ;8_KbGLdȔ&T8kbQS:ZrEk
xKR	tK/$Ɣk8_]]3R<c _5	xK       `OS/2E  5@   `cmap>,^  5  cvt   Ed   Zfpgmb.|  6  gasp     K   glyfg     0headbB  2   6hheaA  5   $hmtx  3,  loca*v  1   maxp/  1    namecՂ\  E  post_pL  J`  prepe  D     2       33'3#2d222  n      
2+74542"53x
b
N
b&&&R&bb   E   2+53#7674#353#7674#!b 2b 2Tba*T==ba*T==  8>	 ^ i c_82+473257632325763233##2#"#"&546774#"#"&546774##&54737677#'&7667#8zzSP^_S
(XY
]_ts
zzS
(^_S
(XYtt	^^6	
6		HI87		HI		II57P87  , , 3 > 
85.-2+4675332'&'##5&'&575'&&'&5'"76654&7YEI* 

3=DZZDIYE
<K	7M
<'r	" Dp1/M(	sLNq1/
2P0Q7?? 5oo9%#9   8  ! 3 D W @MF;4+# 2+2#"'&5476&#"32767654'&%632 #"&5476 2#"&'&5476&#"32767654'&8Q8%,H+4%=	C9P:.(E4%=uUf=&W2Aa<,NBD:
9&%9O		zvSHk?4&1`=,NBD:
9&%9  * C T d 
aWNF2+#"'&''#"'&&'&547677'&5476322676767612332724&#"767676&'"3273?=5*DF+D5#(5'6?Oz<8#F"L0o-0H,*	)Q0#	?C
$	8(#I3AHm=,dCMb2MD#UxnR/'1/$=9
#OUZ1"7	  Y   2+53#7674#Zb 2Tba*T==   JM  	2+773#'JL

L@tz  7:  	2+''3#7ݜ
LL
I  ?2 @ +	2+4632'66327632#"''#"&'7#"&547677&'&'&?
\\	545
\\	545hA~~AA;~A   8G  2+647!57632!!"'!8+
	**  Y  b  2+353#7674#Zb 2ba*T==       2+75!
II  Z    b   2+353Zbbb  8  	2+63 #"&54 
\
E


  '  & 	2+632#"'&54767&#"3276654'&u9I;-mM8Nf84@*3m9GQ8YW@"*>:>:v:1  S    2+67733!5354#5^}:{},:d6III  *   & 2+4&#"''7673273!5767676_G:/=-wN4^I	*&I3qE,5;1<S<@!"|!@~BE	$ E0VOD-25";   * > 9&2+732654&''#54367676654&#"'&5&676726332#"''77 b93<2+//(!+0*2%!5E?c%0)HXoP	'1H:5D
&&=)(+- $
*A4:3"1LVxP
%       2+733##5!5763l[[^yx	T[LL_tV   ! 0 $2+72674'&#"##!#37632#"'&566778@C"))U
$15.AR<%,eF
	O6NA	)O[Z .W#IqH"$1   * + C 9.  2+2##&#"727767632#"'&&546763"&#"32767654'&-65/3>W6I+#27!E1?2.2gX!
)5&+%$cU2	6KhdE*%*'d"T8Z1$
2$JG#2  *  	2+5!#56767667*
!c(:VO:-I/  + # . ; 
70)$2+46323#"&5476676''&&2654&#"&#"32547pS?hU2A	|SR|	A22:d:843:237S	nIiG9J$I.
ZttZ
.IM>6149941I:i@  * , B 9.2+632#"'&52773276676675#"'&&'&54676&#"3676654'&07=+@hASF6	1,+=
?T0G19$!(#]hC(!!%R>	=tA9F'*C3	`	&8
O4 #D   Z       2+5353ZbbbZbbbb  Y    	 2+5353#7674#Zbbb 2Zbbba*T==   8 r 
  2+47!!&47!!&8}|^   7   # ' %$2+4&'47632#56767667654&#"53S'<<(FQ8WN
I
13J:Rb@J	OEH0K`!'8)a@	!,#.bb   8d : M E< 2+"&54766732#"'&&4676325&&#"36773&#"327654'&!cP59W;E^^E&7Kg~]A4PJ)
9.9ӓ?8d	%P8Fc$~Y
q0(d0$'(d0@    ~     2+3633##'!%.''244~}66B<@*		U
!yFZ#5   Z  b  ) ; 
0, 2+332&'#36767654'&&&+367667654'&Zp2$o'lY9"kNJISLB'"20+GV[0D"J'&G#'U#"+>m32 	
4"
)"  ;K ) $2+&&#"32677#"'&547672632/+H4V;<!'F)28E.,?TbEnPqOO;	NNqT?O!	)azlP
   X    "  2+33&##327667654&'&XoUF^zQNNR6Y&G?&vVDm;0CZ\   V  *   2+3!#'!!37VǯCPLV  V   
  2+3!#'!!V'PL  ;W ( 	2+%275#53#"'&&54767632&'&#"0Bv_d-/g?1NBEZC1JbXv]IDL,}t_I)!^>
pc
  V  m   2+33!3#!VhGhh'JC  W      2+33WhJ  +  2+%3#"''76774327e^KIN)KU5EN!	3D   X     2+333#/XdPq Bnjt
P)_!E(T*  W     2+33737Whj0Q  \   %  2+336>773##'''"\]%"LW.f9	M.J1-2jYH7I<   X  k   2+333#'4'''X6?]>#m͌bJ#x=
  7  0 +!2+632#"'&'&'&547664&'&#"32766BDAp':n`G#2R^Q	
Vg_TQb'
O@_y!vG#,Yo68Gtf
jq   X  G    2+33##&'#36767654'&XVonK
ZWROORl"vKB]	mZ/ -   7 % G A72+%#&'#"'&'&547667632'4&5337667654&'&#"32726319	y#,!&p\#2R9BDAp':A
Yj  >iV1U5dQ
#FO
1D
X#,Yo68Gt"'
O@_y!oQ,-Po7(Puo   X  i  (  2+33"'4''#&'#3676764'&X	7(6=SA3^44XWSRR\T	U0;_U#lC&J   , = 72+7733276654'&&'&'&&5476632&'&&#"#"'&'&,;_&163?3C
uOWM%F54C1=@7CdXP2`;=(?#
	[< AN'
a .'0f=Y1  $   	 2+5!#'#$`~~h~`PPa   WX # 2+53326766753#"&'&'&Wh
$*B;S]T9-1O|	@$-I8.$:>bR?+	      2+4333476732#'&66$//l=,K-soK`

      0 #2+433654767376667742#''''#23`daw		yXdc33	xacd	Kd5	.x]Nh`OR0JLR_eZY       	 2+37677'.'3733#''4AABAz> zNW
qr4?yfg6.b\[\\'S*nyJXOD       2+73747676773#'&&'<=1'm-	i!,eJI<A'1B!.o   7  0  2+5!326633!55&#"#E涷,
8Y]*iM3Q5  ^
   2+3#3^UULL      2+53#53ULLP  O  2+73"##&'#&56BKB@&@--&%dRRPJ&55       2+5!rLL   & + : 5.2+632#5#"'&&5476767354'&&#"'&&53267655#[AG"6L	Z>U)25Hv+K@/2"$6?4$"M8	'*H3)"!,)(! 	   K  ) %2+632#"'&&''#3327664&'&#"O[,9@)E9]Z( 58303%	2
xM8#2J+&POR
%   " / $2+632&'&&#"3277#"'&&'&5476e>R97*"4.	.3*&IB	FLJbAMR<5N	&!lOR   !  ( "2+3#5#"'&'&467632.##"327677_Z]
>N	E%<1NC!	$:c'J,/O:v)M%$7$	    # . &$2+%#"'&&'&547667632!3277&&#"#JRJedIS0- LTAE0-	8 *mMNp	=:hQ-F-3;    [   2+2'&##"3###535476676),!+	jgZCCQ:R
4?IsI04;V	  2 @ J ] 
SKHC7	2+7&477'&54632&147633"'&#"#'#"'&#"&'&547664&#"322654'&'&#"RbG9*AC#+eC,'HTS}NP|+)&**&)2W0H7O&N#	
).I`"''-5I_	$	-!$3?>4$$\25V5#!  I    2+632#5&'&#"#3<To]K#]Z<e:;  C       2+533ChaZ@hhD 3     2+533#"'&4674327XhZZ?-(0"$2@hhj2(4B"   L     2+33673#'.''LWcNmRQc?"	-KgTTX	\20   J      2+33JZJ  I   *  2+27632#5&'&#"#5&'&#"#3601:;Xo]K#]K#]W?#%@e:;:;:?  I    2+6726332#5&'&#"#37Do]K#]W7e:;      2+ #"'&&'&5467324&#"3276~_CcsYRC>1%(<(X9]BY
GT#(Pd*    K>  # 2+632#"'&##33276654&#"Hc	4@UCH9]Z 9/@F63&	3OV*~4T<>\$   !>  $  
2+74673253#5"'&&%&&#"3277!]E:*
Z]
>N4E>)'%,I49%]	$9w+%(M/AZ2  J  G  2+633##3BS
8T
ZUBRD5	xwI   h 3  2+2&#"#"'&57327654'&'&'&'&546763RILC2
107WNLI
EG?041D=('%
	4DH"P)&	
	
,9E   M;  2+%##"'&'&55#53533#36: :;'MPT+bGDxIIvw,	   I  2+5332766553#5#"'&'&I]"O]ZDn &9({D'-	?        2+3'4326742./`	\Z4?!
LF     (  2+3767737476773#'''#''[TLUH:X%C33V%*//C
V	
E-?9
$H:dz
I
&'       2+7'36773#'&&''#6e<< :11 V.
eA$	#?dKK")K'f6"X1
(1X   4 + 2+7'&'43356732#"'&&''4&53276766\]/0lg--23i$&
#! P
	WCNQ      
2+5!73!567*fnf{{ttrJ1M3  S G  2+7663232753#"'&'&#"#S8,$"L7+%"L4G-4G-   gF    2+53353gbabFbbbb  Q-   2+6632#"&'&544#"2S
;%'<
=%(:
<0lw$##$))(  @  
2+732"5766$&& **jR+Q,  J      2+33JZD 3   2+326763#"'&57#&%Z?-(0"_2(4&  O  2+73"##&'#&56BKB@&@--&%dRRPJ&55   N  2+&7233673#'&O&--@&%@BKB@55&JPRRP   E(w   2+5!Ei(OO     2+73#'766>]&E&%!dR-Q,   S,  2+'3#'.U]>!%&E&R,Q-  I  
2+26753#"&'&553T7L5')+7RLO7'	4T:-(&	'   W@    2+53Wh@hh     2+6632#"&'&544#"2
;%'<
=%(:
<0lw$##$))(  S  2+663232753#"'&'&#"#S8,$"L7+%"L*4G-4G-  e 
   2+>7323>732e/.DZ/.D
.C,
.C,  W     2+3!#'WP  *   	  2+3 56&&'34'˟lr\ZF
8Z>V  8  0 4 
21'2+467632#"'&&'&&#"3276654'&5!8I?QgBEXul/+?JqY+&GT1:gX!(c0rT#8|
G#^qcjN[bb    F  2+3#''&'''#"4qgpq76	*j-,\Z
GQb   *  p    
	 2+5!5!5!/<FXXXWWXX   V  m   2+3!#!VhMg  7     2+3674''5!#'737tuc	4fZR
?OP?{uU  7   * 
2+&&#"#54'&'"#56632676732#u(<
hW ]\CD$"~A_]3-#,%
@WJ*KW@
  7    ) 7 
.-)
2+%&&5467725533##5454#"&#'6767654'&7gab#y/9bX\t	,J((k`\65k	(a+Z*{k65"V,V$B%M@+(  7   9 2+%36767674763233#"##5'&&'&&'&'"&##532Tb('4bVj45	9.!?)O!L>:&ll|`u1L(&dB8O   ,   B 2+663232633#5676767654&#"#532374'&'&'&54Eh\D",,
-Q$/pYTm/$Q-
,CMf_FY-YNO#VAY$g,*+PcYF+*,g$YAV#OxA&     8   2+55!LL     8   2+55!LL   Z   2+667333#Z	!1b8T==b  Y   2+53#7674#Zb 2Tba*T==      2+667333#7667333#	 	1b"1b8T==baT==b    E   2+53#7674#353#7674#!b 2b 2Tba*T==ba*T==    | j                         1 [ Ss%MfuI n!d		-	<	e			

W

Aq/UdP
7F)f2U5ccx"HXw%Na5JuiLv        D_<                             2    M     ? n  A 8 ,A 8 * Y J 7 ?
 8 YM  Z 8 ' S * *  ! * * + * Z Y
 8 7 8  Z ; XU V9 V ; V W + X Wk \ X 7 X 7 X, , $ W    c 7! ^!  O   & K " ! 2   I  C L  J I I  K !V J i  I       S    g Q   J O N E  S I W  S e WA *
 8c  * V 7
 7 7
 7 ,     Z Y         Z                {          1                       PfEd @    8 Z    ^                          8     ; = [ _ z ~    17        = ? ] a ~    17   .)c`^                                                          ,  UXEY  K QKSZX4(Y`f UX%a  cc#b!! Y C#D  C`B-, `f-,#!#!-, d BCC ``BCB%CCTx #CCadPxC`B!e!CCB C#BC`B# PXeYC`B-,+CX#!#!CC# PXeY d P&Z(CEcEEX!%YR[X!#!X PPX!@Y 8PX!8YY CEcEad(PX!CEcE 0PX!0Y PX f a 
PX`  PX!
` 6PX!6``YYY%Cc RX K
PX!CKPX!Ka cCc bYYdaY+YY# PXeYY dC#BY-, E %ad CPX#B#B!!Y`-,#!#!+ dbB #BEXCEcC`Ec*! C  +0%&QX`PaRYX#Y!Y @SX+!@Y# PXeY-,	C+  C`B-,	#B#  #Babfc`*-	,  E Cc b  PX@`Yfc`D`-
,	 CEB*!  C`B-, C#D  C`B-,  E +# C%` E#a d  PX! 0PX @YY# PXeY%#aDD`-,  E +# C%` E#a d$PX @Y# PXeY%#aDD`-,  #B EPX!#!Y*!-,EdaD-,`  CJ PX #BYCJ RX #BY-, bfc  c#aC` ` #B#-,KTXdDY$e#x-,KQXKSXdDY!Y$e#x-, CUXCaB+Y C%B%B%B# %PX C`%B #a*!#a #a*! C`%B%a*!YCGCG`b  PX@`Yfc Cc b  PX@`Yfc`  #DC >C`B-,  ETX#B E#B#`B `   BBB` #Ba++"Y-, +-,+-,+-,+-,+-,+-,+-,+-,+-,	+-+,# bfc`KTX# .]!!Y-,,# bfc`KTX# .q!!Y--,# bfc&`KTX# .r!!Y- , + ETX#B E#B#`B `a  BB`++"Y-!,  +-", +-#, +-$, +-%, +-&, +-', +-(, +-), +-*,	 +-., <`-/, `` C#`C%a`.*!-0,/+/*-1,  G  Cc b  PX@`Yfc`#a8# UX G  Cc b  PX@`Yfc`#a8!Y-2,  ETXEB1*EX0Y"Y-3, + ETXEB1*EX0Y"Y-4, 5`-5, EBEc b  PX@`Yfc+Cc b  PX@`Yfc+      D>#84*!-6, < G Cc b  PX@`Yfc` Ca8-7,.<-8, < G Cc b  PX@`Yfc` CaCc8-9, % . G #B%IG#G#a Xb!Y#B8*-:, #B%%G#G#a BC+e.#  <8-;, #B%% .G#G#a #B BC+ `PX @QX  &YBB# 
C #G#G#a#F`Cb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca#  &#Fa8#
CF%
CG#G#a` Cb  PX@`Yfc`# +#C`+%a%b  PX@`Yfc&a %`d#%`dPX!#!Y#  &#Fa8Y-<, #B   & .G#G#a#<8-=, #B 
#B   F#G+#a8->, #B%%G#G#a TX. <#!%%G#G#a %%G#G#a%%I%a  cc# Xb!Yc b  PX@`Yfc`#.#  <8#!Y-?, #B 
C .G#G#a ` `fb  PX@`Yfc#  <8-@,# .F%FCXPRYX <Y.0+-A,# .F%FCXRPYX <Y.0+-B,# .F%FCXPRYX <Y# .F%FCXRPYX <Y.0+-C,:+# .F%FCXPRYX <Y.0+-D,;+  <#B8# .F%FCXPRYX <Y.0+C.0+-E, %&   F#Ga#B.G#G#aC+# < .#80+-F,
%B %% .G#G#a #B BC+ `PX @QX  &YBB# GCb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca%Fa8# <#8!  F#G+#a8!Y0+-G, :+.0+-H, ;+!#  <#B#80+C.0+-I,  G #B .6*-J,  G #B .6*-K, 7*-L,9*-M, E# . F#a80+-N,
#BM+-O,  F+-P, F+-Q, F+-R,F+-S,  G+-T, G+-U, G+-V,G+-W,   C+-X,  C+-Y,  C+-Z, C+-[,  C+-\, C+-], C+-^,C+-_,  E+-`, E+-a, E+-b,E+-c,  H+-d, H+-e, H+-f,H+-g,   D+-h,  D+-i,  D+-j, D+-k,  D+-l, D+-m, D+-n,D+-o, <+.0+-p, <+@+-q, <+A+-r,  <+B+-s,<+@+-t,<+A+-u, <+B+-v, =+.0+-w, =+@+-x, =+A+-y, =+B+-z,=+@+-{,=+A+-|,=+B+-}, >+.0+-~, >+@+-, >+A+-, >+B+-,>+@+-,>+A+-,>+B+-, ?+.0+-, ?+@+-, ?+A+-, ?+B+-,?+@+-,?+A+-,?+B+-, EPXEX#!!YYB+e$PxEX0Y- K RXY  cp B(  * B
* B%
* 	B    * B @ @  *   D$QX@X  dD(QX X   DY'QX @cTX   DYYYYY* Dd DD                                         ^ ^ M M    >  3       	 r  	       	     	     	  N   	  .  	  BJ  	  .  	 n  	  4 C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0   D e s i g n   S c i e n c e ,   I n c . 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y K a T e X _ S a n s S e r i f R e g u l a r F o n t F o r g e   2 . 0   :   K a T e X _ S a n s S e r i f - R e g u l a r K a T e X _ S a n s S e r i f - R e g u l a r V e r s i o n   1 . 1 ;   t t f a u t o h i n t   ( v 1 . 8 . 3 ) C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0 ,   D e s i g n   S c i e n c e ,   I n c .   ( < w w w . m a t h j a x . o r g > ) 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y   ( < w w w . k h a n a c a d e m y . o r g > ) , 
 w i t h   R e s e r v e d   F o n t   N a m e   K a T e X _ S a n s S e r i f . 
 
 T h i s   F o n t   S o f t w a r e   i s   l i c e n s e d   u n d e r   t h e   S I L   O p e n   F o n t   L i c e n s e ,   V e r s i o n   1 . 1 . 
 T h i s   l i c e n s e   a v a i l a b l e   w i t h   a   F A Q   a t : 
 h t t p : / / s c r i p t s . s i l . o r g / O F L h t t p : / / s c r i p t s . s i l . o r g / O F L        2                     |           	 
                       " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > @ A B D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] a           	
      uni00A0uni0237uni02C9uni02CAuni02CBGammauni0394ThetaLambdaXiPiSigmaUpsilonPhiPsiuni03A9      Ւ6x0wOFF     0     K                       OS/2  $   S   `Ecmap  %     >,^cvt   -    9   Zfpgm  %    b.|gasp  0         glyf  D     0ghead  #4   6   6bBhhea  $      $Ahmtx  #l  8  loca  "8      *vmaxp  "        /name  -\    cՂ\post  /    _pLprep  ,      exڵ{GwjԢf4 Ѐa&{Illwd]/-n!p|U-;U?Wm
Q)>|MҚ֢wnRȷs%Ut)'%Cj2(IٴiK3	(,]߄Q{gklQ+ge=->tZ:ҴٱGx̓%xͣ:fJn+Nu/|^ǷiQ)G#>?Lβ2F񅕶u4X+;ԛnZW`Z9s4xkN<N5$'U~t('kQD|8<@%)|yԾ<МP';l:k{ncOM~΢?P	*MQ:-MY4{MÌ6\h0Yz|^nF|>E6cXyZoT)ˎllGe3)ִ<$WDag*%٦:|<AUS3'6)ţ9]Alm}~	FG;),-`	T*eV)2=֝i.b(DDw&YN7t
3kqb	<GAʞY1OkdWՐd"*
,	
x9F5+?\|q<ғA.$uzsVTD8![wgGc6}}m#3c5&(	fYo	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=@iS`hx1M˫je2*a0-ηt"dwVXgcosv?IrN33¯k2L~B!@An{gm_9;
_f^y]opvг F%ai FȰ`mcYx4CA52]a7-tA2h]g岌5VqZ_z͈)4լe!/4k5;Р%aaТi`rC25GQ]	@23TB!e%Q3`qlgZBb_`$ &??_ַ٪CCaz}TQ3
R= %Ad#˹L/Iv#36
Th/zBs&)D[/n)yڑT$g'zJQVmg5ICqN:? ҷ> P0 f9t^C.U5k.C'uYhOG0,&cF@aT7!"}z	b)~.pVaWZ2jHqu+a+f^uNo:~_A5#8y\@ Ȑ`D*Zm^^u((ZRr%k?:p([ƼQgY2l@Uepl	m8H:Ǖ h!#?O|Q Lga?2d4h-xm18&?JUt"1<U:Y֩85kԤ_ !+pӨEfg.*Tj󲐅AU@PBk7 4Z6&a~k`r=ђZ/GRzs, 3@IE\ΘDV8֩)w %sݰD	HobMZ̓8}IJ	֚V|]T.DfT>j||~ߩϞ#1dv)m4~QCAFp2p¬V$t~Ca# ,ږjsHhꗖPY(Bv#ey'#?yYbBH330#I)A|"!%O(bĊ×(I )K61	2+PHQJRPR(SB%-=#3Wj>`fBW]sɍ!"AdQ!D F8j1h(^*TBTGe@a`knlrt4uvద`*W8{>AAat,|0Zdx`W))"0
uC?d{>NHŏ`ITА&}0Vc0kIׄ4 vxA       `OS/2Fi  ,   `cmap ,  ,   Dcvt 
e K  ;   0fpgmb.{  -,  gasp     A    glyf&     *dheadcB  +   6hhea  ,d   $hmtxXA  +   |locaZI  +p   @maxp   +P    namea  <  post9ʳ?  @   hprepD  ;8     2       33'3#2d222  # W d |  @
tgbYD2+732766'&'&54763276?676323267672##&676#"'&''#"'&54767632#"'7"76&'"767676774'37676L47J
;8-`e?		
9-	>I/.	
$B1fO/	'	<@m!'h*FM6!E)		:O<40GBUC4
	-	=	
L"%,ce
2W'		:5!	`HW-H:(
#      
S2+"547667676372327632#"&5467672327654''#"'##"'&547632#'3276767676774'&#"3276765476632%27667654''636&#""#36765& _	K+

sH"'S/Z[M#-%@N	X)6B?P82I%A>%@$ +@*	;I-@\G_\!3T)"M3.C91/3&&U[//3HA!Y0o#u!
&2EC <_HH" F6L%Pf;&!e%@P	5,$"J/YToD
L7Q7-FM#<8!?x@ 3\T&   3 s  }u_2+"#32623276767263"3276767654&#"#"'&547667632#"&5676774#"'&5466324#"36767683*4?Sr#
P315%)%0%5
	$!+	O&	?$!v=BF8:[|6'<Y=K	Q"I	YTK ($b;	K9I2$'3F+'4"'=/-93LIC JV:*5a5!W:f1z3  AX c w  
|yqg#
2+"&54767676323632#"#"''#"'&'&7632676767677&#"32766767676767632%65532767633&#"#"4?/!3Vi-19
'	;:Wd]&6%0Gk.
5NXE<7*bU;A"K7	E/[D0JN#+P4
#51<J5*Cs		"
fnmJS	(=nzD<|JJF;:"CFN2`6T0	8m   .   }2+&5476676332#"&5467672327667654'&#"632#"'&#"327667654'&#"#"5476767632#"&'&54767"&&#216	O+	I,#+		!!K'1 ;&	6/2##!Lk:/8
<-$"6GRGc.	Mzg,PB
	"
,	,+T(	e/
?GC*
&* "	'#Hg2->  ' ?   
f7,2+2#"'&'&'&#"3267654&76676#"5476766763232767677##"&547667656766767636?67632#"5476##"&547672#"676#"	)<K)
$=4m@ ?=Q/Wv[	$:V+C<  (%6)*4B'/'"E69'6.((',*/
7($'0d"@Z%+(		 &`/!,58((?*HM+0Lo	 K/D

- U5:
	087b	;-`)-0%%	     72+27476766767632327667632#"&'&5467632#"'"327676676774#"&'4##"'&54767632#"4#"67676j.kC
IXB>-0@z!"D;T +
H0,+
)%	/;!^0!$HWB
:@*:3u	r>	%1|&]<vT)	&:"!%<C#1A0"<K&-'0!0',E8B_?03V3%O      V	2+32767676322737667632"##367>77633#&547676765"##"'&5476632#"'"32636767"#"54767676676677#"547654#"##"547676332%4#"76676761.O=2 9	gPJ.^A392E	91	p	 49<H8:#d- +3
Qw;J"j8S'''U
6.&&
H~4		?3
T<	A=5;u$\!U0/_
)7g'8HTd>[=	!/"(Sa
D	
p/+K	}%AQ@  ; R h `T32+%&547>767632767654'&76632#"&'&54632#"'&3327676767"67676676YXp)qL&(H0p:%yDXO1J5$+5OT9Q{;6(	%@9&&W:~I$Ud3\4A!*
2P6c* 	(;"V!*<a /:fN'&   \m e x  
zsgH2+6323676767654'&76632667732#"547667676?65&'&&5476766767"77>326367676#"T
Q 
0).	xB7-8K6j}S<O->s3j~%-?(l_}3Pg9#A%L>T9+FoM[1	m'E&,- 1bE<('!^9E"F- :*"Q:%2#2"-b*'9xTT.9`f-34     ]2+"&#"#"&'476632#"'"327676767>7#"&'&547654#"##&'4766763232767667>7632072763277676672632'"&#"32767732#"&547676#7654#"36g?MobN5G- +7,+2-ENI
%#*A'96"6*6&	[h p1

#[0z;
!*
55B
P0
38.'	)XoJA()!/"2.`mW	
9%6"#6*H:,H0#(<h"0>/8XP?634@,#    r   
{v, 2+2"332767732#"'&''#"'&547676323267>77#"'&5476632#"#33>7676764&'"767676"&#"32764)1(@:G	P.HJWK- a1'"8V
?E&W@67&*	8S
#Q!$@	%#&I6?/%?	-	M8-A&4*&->a9q;0

:	+I	"	,"+*>%	P	) G
)3	\6?R%N<>

     ]2+7327676767676762276766767663232767>233#"547677#&54767677#"'&54632#P'<E"AG'FnC 
p5"6B[P
<=+2=@<	#B)B6C549%.H.	%9>'X/OC(&==2!)/G#QX(EzS:
!L2/);L]I
IMDbv^X/
<&1>	SJDOe@1U,ZVUF2^O("
4    Y 32+6767676""'&76554'&47##"'&5476632#"'"3276767 7633jFLS[m
"	'3oc- +:*
IZ)M-1)mF#
8KQ&HZ><%	=	!/"]+mQ   `%  t -! 2+32#&&547676764#"327676767654'&'&'&5476332'4'&#"#"&54767676763276676_o.;*c7i[	LWUwAӘ&KN[R81'+:=U	
 -	=	!W*78"?Tl# 	.=
*.$%F 7E0ZRLhW jL2i{</7 +WxL	

1L5FnL
g]{I	+'8   Z   jI2+##367677&#"32767676767476632#"&5476767326632###"'&547632#'3267677&'&766327'"3667674z487XYlH+"%(/*8		/>-3 v7o=/(1!x@%5Y\h=)4%:H7-(G$ah
;Q!	
;;7%,SJ!8G9
2/Fn-+lXl(
,<AH.C60Rb>	PJC4@@uM=4'  6u n  uoP%2+32767654'&7676#"'&5476767632232766773232##"''#"&54763276767654&#""327>54'&'&#&JH[A('/-R	9QQKhЊ0J'O/D=IY4F@7SE12)'+8
q`M@!wT8
 %#:@8S5-v26**sH+41&'gM4$	35$%!-"
LV55qJ3

	
 w     @
G2+7#"'&3276767677&'&#"3276767667476632#"&547676763272#"'&&'&7676674'&#"###"'&54676324''2327676732#"7076672"(
9*#Px`7E4ZDGS+B,	#&#	FDG
-4RV|_TuF-"!%F0&%5@8U),P"!8K0
S4!M	U"
Nz'b:5	-` M8=)*(	)b+B
-+RRV0%%
		%,-+,%	D7
M[$	^+"-#2\MN1}'EMb    ] o i`K62+732767676774#&'&'&54767673""#"3376767632#"'&5476632#"'"4&"276766C;(jo% 'yD6
#-wZR@-4@>h%y+A(\j80]
- +*'8nA+;r(-5	-#),&3'	%!-/   (4/-]"J%K#&(p/!/";
,"%FI0QR   \ x 52+4632#"54766763232#&''#"&'&5467632#"'"3276767676765&'&'&'&#"32767654&&+4"RdZ}1G:$K*&CP9S +	 `Rf"HC1>$E2
)I!D+N *N7L[ 	X4#;[1W{0"	##-mc)>2`@"F.'  7  l02+4&#"32767676707632#"'&54766763232766767676732632367676633#"'5#"547676676$0(S7
)'")9
CBQ@n;,AK1/$Y"uB/#x=:='OI0F0C cR0`$$qS% ?T74q:;3R%@;DHH)<)T!,ŦU4<
"?@	+V32iC#>  8R h T(2+4""##"547667632767676677323676676767632#&54766767677#&54760)#`*	Q
L 55	J>7R926	>;*E/+*%Ia	 6B/'7(/&D	,	-l
@`#*%
DKS}:1!$@/eF5)%BW 9pC,*   .  J	2+32?677367676763276767676767632#"547676676677"##&'476767#"547654#"##"54767632+2@H")"11]Q9YG11-+.U\g+"6*4F3F,*.vp2"Q3}`>f'.%X
>4!*_I	(PEzsk_@bLJsgQE|		IT5)_H&F("WL3!/*.]V11:
$SdE`0)V  gk  R	2+"&547667632766763#"&547#32632##276767723232#&&547#"'&5467632#"'32767677##"5467633767654&#"3276676746576632_&)gA=-!C603MO(%,,
CXEP	&,I/6=	OO:.I"&-
8DT,7""9703i)128		qD_)"!@iaD L	(
0Ie5cI
Ro
./<<7,N/ "1%
 d4N#	"d?.0>6A0. OA$Fo  9  ;
2+"&5476766732327667667667632#"&47672#"'#327677###"'&5476767654#"327676767436632-5r?>d)
o		.+B-&2I>)8M2.BT!+$I-^wJ6E
\Q5+&!129N-+]e5C)"	!)),:w5K|'P!%
JM`3 <lO@)EG=
CI@  S    
ĺY2+"&547676767633276767632"3##3267>373#"'&''#"'&54763276774#'&7>2;7677&'&547654#"327667674746324'"32767676&#"3276774'&4).	$)5he-9=*88.
8793m
=<iF2+Y $l3.;SGW'b-8>Y%	 +=(#_N +;	+
6E$#8-$3L:?C2-	_'&+05&M	%"J!/ &'8\
,.F!&
+
4q2=")Q F,<05##-	&                             m=6	}	z
K
;;OB22       _<                             2    M     # #   A2 . 'b  ) ; \ j 8   ` Zs 6Rd  \  7n 8% . g 95 S       Z8                          1                       PfEd @    8 Z:   ^                         0          Z      A ~          ,  UXEY  K QKSZX4(Y`f UX%a  cc#b!! Y C#D  C`B-, `f-,#!#!-, d BCC ``BCB%CCTx #CCadPxC`B!e!CCB C#BC`B# PXeYC`B-,+CX#!#!CC# PXeY d P&Z(CEcEEX!%YR[X!#!X PPX!@Y 8PX!8YY CEcEad(PX!CEcE 0PX!0Y PX f a 
PX`  PX!
` 6PX!6``YYY%Cc RX K
PX!CKPX!Ka cCc bYYdaY+YY# PXeYY dC#BY-, E %ad CPX#B#B!!Y`-,#!#!+ dbB #BEXCEcC`Ec*! C  +0%&QX`PaRYX#Y!Y @SX+!@Y# PXeY-,	C+  C`B-,	#B#  #Babfc`*-	,  E Cc b  PX@`Yfc`D`-
,	 CEB*!  C`B-, C#D  C`B-,  E +# C%` E#a d  PX! 0PX @YY# PXeY%#aDD`-,  E +# C%` E#a d$PX @Y# PXeY%#aDD`-,  #B EPX!#!Y*!-,EdaD-,`  CJ PX #BYCJ RX #BY-, bfc  c#aC` ` #B#-,KTXdDY$e#x-,KQXKSXdDY!Y$e#x-, CUXCaB+Y C%B%B%B# %PX C`%B #a*!#a #a*! C`%B%a*!YCGCG`b  PX@`Yfc Cc b  PX@`Yfc`  #DC >C`B-,  ETX#B E#B#`B `   BBB` #Ba++"Y-, +-,+-,+-,+-,+-,+-,+-,+-,+-,	+-+,# bfc`KTX# .]!!Y-,,# bfc`KTX# .q!!Y--,# bfc&`KTX# .r!!Y- , + ETX#B E#B#`B `a  BB`++"Y-!,  +-", +-#, +-$, +-%, +-&, +-', +-(, +-), +-*,	 +-., <`-/, `` C#`C%a`.*!-0,/+/*-1,  G  Cc b  PX@`Yfc`#a8# UX G  Cc b  PX@`Yfc`#a8!Y-2,  ETXEB1*EX0Y"Y-3, + ETXEB1*EX0Y"Y-4, 5`-5, EBEc b  PX@`Yfc+Cc b  PX@`Yfc+      D>#84*!-6, < G Cc b  PX@`Yfc` Ca8-7,.<-8, < G Cc b  PX@`Yfc` CaCc8-9, % . G #B%IG#G#a Xb!Y#B8*-:, #B%%G#G#a BC+e.#  <8-;, #B%% .G#G#a #B BC+ `PX @QX  &YBB# 
C #G#G#a#F`Cb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca#  &#Fa8#
CF%
CG#G#a` Cb  PX@`Yfc`# +#C`+%a%b  PX@`Yfc&a %`d#%`dPX!#!Y#  &#Fa8Y-<, #B   & .G#G#a#<8-=, #B 
#B   F#G+#a8->, #B%%G#G#a TX. <#!%%G#G#a %%G#G#a%%I%a  cc# Xb!Yc b  PX@`Yfc`#.#  <8#!Y-?, #B 
C .G#G#a ` `fb  PX@`Yfc#  <8-@,# .F%FCXPRYX <Y.0+-A,# .F%FCXRPYX <Y.0+-B,# .F%FCXPRYX <Y# .F%FCXRPYX <Y.0+-C,:+# .F%FCXPRYX <Y.0+-D,;+  <#B8# .F%FCXPRYX <Y.0+C.0+-E, %&   F#Ga#B.G#G#aC+# < .#80+-F,
%B %% .G#G#a #B BC+ `PX @QX  &YBB# GCb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca%Fa8# <#8!  F#G+#a8!Y0+-G, :+.0+-H, ;+!#  <#B#80+C.0+-I,  G #B .6*-J,  G #B .6*-K, 7*-L,9*-M, E# . F#a80+-N,
#BM+-O,  F+-P, F+-Q, F+-R,F+-S,  G+-T, G+-U, G+-V,G+-W,   C+-X,  C+-Y,  C+-Z, C+-[,  C+-\, C+-], C+-^,C+-_,  E+-`, E+-a, E+-b,E+-c,  H+-d, H+-e, H+-f,H+-g,   D+-h,  D+-i,  D+-j, D+-k,  D+-l, D+-m, D+-n,D+-o, <+.0+-p, <+@+-q, <+A+-r,  <+B+-s,<+@+-t,<+A+-u, <+B+-v, =+.0+-w, =+@+-x, =+A+-y, =+B+-z,=+@+-{,=+A+-|,=+B+-}, >+.0+-~, >+@+-, >+A+-, >+B+-,>+@+-,>+A+-,>+B+-, ?+.0+-, ?+@+-, ?+A+-, ?+B+-,?+@+-,?+A+-,?+B+-, EPXEX#!!YYB+e$PxEX0Y- K RXY  cp B  * B
* B
* B  * 	B @  *   D$QX@X  dD(QX X   DY'QX @cTX   DYYYYY* Dd DD                      . . ;  $ $       	 r  	       	     	     	  H   	  (  	  B8  	  (  	 hz  	  4 C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0   D e s i g n   S c i e n c e ,   I n c . 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y K a T e X _ S c r i p t R e g u l a r F o n t F o r g e   2 . 0   :   K a T e X _ S c r i p t - R e g u l a r K a T e X _ S c r i p t - R e g u l a r V e r s i o n   1 . 1 ;   t t f a u t o h i n t   ( v 1 . 8 . 3 ) C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0 ,   D e s i g n   S c i e n c e ,   I n c .   ( < w w w . m a t h j a x . o r g > ) 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y   ( < w w w . k h a n a c a d e m y . o r g > ) , 
 w i t h   R e s e r v e d   F o n t   N a m e   K a T e X _ S c r i p t . 
 
 T h i s   F o n t   S o f t w a r e   i s   l i c e n s e d   u n d e r   t h e   S I L   O p e n   F o n t   L i c e n s e ,   V e r s i o n   1 . 1 . 
 T h i s   l i c e n s e   a v a i l a b l e   w i t h   a   F A Q   a t : 
 h t t p : / / s c r i p t s . s i l . o r g / O F L h t t p : / / s c r i p t s . s i l . o r g / O F L        2                           $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < =uni00A0   lx\)wOFF     )\     A                       OS/2  t   Q   `Ficmap     4   D ,cvt   'H   !   0
e Kfpgm      b.{gasp  )T         glyf  D    *d&head     6   6cBhhea  T      $hmtx     |   |XAloca  `   @   @ZImaxp  @         name  'l    apost  )   H   h9ʳ?prep  &      DxuzxIVuU3-F-Kَ10p0[\fff33334jx}_yKUjsS@~B`@hŖkfB/c}>@K߁_		x8b@};%jn5{nP,tڽn8,tj!1Ԁ2O4+3>ezY.vq!˝{]oyn9MKX̍W sqPϬ@1 PD-JM{.faASϽ6{ų!M7+
a jK+[z7Y.'0\8DT-yW0|.\H$~Z0OT
A"n:cY(<FGeA':r(t#fϬj9RN,;P.[.K?xkoį~S|7(ïkz\5p\XzsR'Py+}mvzp!]7wb˺n˲Q}*'UErT">9~b+Wsuԣe07J$Z~3Liөx"kN3KNŁCx
v:aP]Z'pMDq!w	(CyGӉK,/驐tzu5]X͸{dA|dnH:Ca;s㠮׏=u$oj
놭Ne3ٚSIN
^܂x*{N%;x<bon˶}j'=T#_^濻I }NhV%զSTH>*q%lkdOD:2UM YG{fC{usa1kL
>=<p@^Tc@?ߗ0 @ǐvp-tTkc|9TJAvBY֜d8-jxktl&εH3LBxK>p_IW?p9`0;vۀBѐ'ba;^ +tg՚v:U3٭Vl=:|6q%]a$ONT+FB%quHBL:.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OM.T\4RPDՏi%<'Q)5P1DHaL25:êjT?bQskEZ*&
K1vP9@g&teP)O$,(2%O1WR,3PaW8SPR0K;%W*ƹh]!.V.oa$tp{D.&V^Zl1ժkD^~9f_*
G+b1VufCbr0q/P_B0[_-Ypy3O.BdSʡOZG/W#|
12ߥ|@_Ч l8̀?GW7slGfA@;B@g9XsQ3cYS3	,C?M4/:%Φ@m;(`g}]W[yx/;       `OS/2Ca%     `cmap'I     cvt       )   fpgmb.z    gasp     /   glyfu     headbB     6hhea  |   $hmtxpP	k     locawJq      bmaxp        name_~  )  postӫ  .<  ~prep~;  )     2       33'3#2d222  R   673#&{q

q61a`  #1R   %#"&5676'&'46331{q

)axy#"  7
Q   632 #"&56 [	F	
   R   3#3((  6
Q   #"'& '&632 
	[

	
	    R   53#53*(Q(_  iR J  #"'&'&''45&''&'&'&&546767676677676763326233%b$>

>'n,L&L["L,.!'j
/!!/1.(& ..  iR I  7232"&547676767654767677'&'&'&54'&'.#&54n%b$J,,J$b$="[\$^Q.!'j
88!.. 02 '4   "#'&776677'&$		I!	v

(Nr  U* (  >3233277#"'&'&'&#"'&&' +H"$1;%	;C
!B<(;$
;C
r"!4	34	 '    "#'&776677'&$		I!	v

(Nr U (  >3233277#"'&'&'&#"'&&' +H"$1;%	;C
!B<(;$
;C
r"!4	34	    	Z    !333++ZZ   p  +X   7'&''#576HLbM+MbO	v0,%JJ%,,  p  +X   %37677'&''58+MbPLbM`J%,,|	v0,%J   9  W )  7&&'&''#'&'#57676}P))
FA
+'&'+
CE
))G	[+"5*9*+kl6!+[   9 X )  %3676773767667&'&'&''5+'&'+
AF
))PP))
EClk*9*+5"+[	[+!6  7x $  3!53677!3!53677'&'#5!#LFmLFFA()3((+aOP3((+++((   7x %  3!53677'&'#5!#!'&'#5!#LFF>()F>()3((+++((OOb+((  8 9  6!!#'&&'&'&!" 322636767673 '&54766774/4=)

a?7fDil0nJj?p9
(8XX\\n>:WC	Q Z!+*mm  oQ   %2 7632#''&#'7fg:Cmm	L!

y
;    s %  632#"'5<&<6445d
	!+7:C>C:7+!	

	!+7:C>C:7+!	   s % K  632#"'5<&<64457632#"'5<&<6445d
	!+7:C>C:7+!	

	!+7:C>C:7+!	

	!+7:C>C:7+!	

	!+7:C>C:7+!	   7b% C  2327676767676767263"&54766774'&#"#"'&54S*H/>*,

UH
	&0Ͼ/</4e4*>  7% C   2327676767676767263"&54766774'&#"#"'&54$2327676767676767263"&54766774'&#"#"'&54S*H/>*,

UHw*H/>*,

UH
	&0Ͼ/</4e4*>
	&0Ͼ/</4e4*>   7% C    2327676767676767263"&54766774'&#"#"'&54$2327676767676767263"&54766774'&#"#"'&54$2327676767676767263"&54766774'&#"#"'&54S*H/>*,

UHw*H/>*,

UHw*H/>*,

UH
	&0Ͼ/</4e4*>
	&0Ͼ/</4e4*>
	&0Ͼ/</4e4*>  7b% f t   232767677'&&'&'&54767>77>76767263"&54766774'&#"#"'&544567674&''2766S*CS
H/>*,
CS
1H,=0%- &5
	&-)"I"!S!
K>/</4,f	"I!"S!
W#?+>>5M4.Dcy}+GHJ   7	   "&5476 7632#"' a@PP3
*  7	 )  2#"'&'&.'&546326>76PP%S)9RP>=k8*
3
iu
2z,   7	 .  #"'&76676362#"'45'&'&#"	--bFV
	8UwC>9M<@HYy klR:UeA   7	 +  232767745632"'&&'&76`^wU8 	
VKc(d'm

YzU:Slk zYK

s@<   R   3#(y  R   53#(*(Q  R   33(y(  R   3#5(Q( 8  cZ   !38+Z   aQ   632#"'&4dF##  MvR   63#"'4M@     8   : H  63232#"'&&'&547664&'&#"3276676%4676"&tYN-"u5&"&aX`bUa&""&כ	+(Z] )7,v&!+D+#jO^'dTa&##&aTdbVaUƑ
D
ci| )('"**  8   + 4 = D  63232#"'&&'&547664#"!&#'!'&&!7!766tYN-"u5&"&aX`bUa&""&hZtmtI4S#jO^'dTa&##&aTdbVaǺ
Ampty[@P
n   8   . ; K Y  63232#"'&&'&54766&#"67'&67&''476764'&'27677tYN-"u5&"&aX`bUa&""&E	+(eOZ	EE	#?"	E<HZs0sZ#jO^'dTa&##&aTdbVa<

CiYu
D
uY#?"Yu
D
t;H
DD
   7	 + S  232767745632"'&&'&76633###"&'&55#"'&5477354`^wU8 	
VKc(d'm
;
y
@77@
x
YzU:Slk zYK

s@<
>99::99>  7	   !&'&76632!7632	o*HH/     0                           3 Z x   )&gzOS9H			"	J	s	
Q
Z        Jʛ_<                 R            2    M       #B 7 B 6 G iG i   ,,     
 p p
 9
 9 7 7  8 oM ,  73 7 7 7A 7A 7A 7A 7    8 a MW 8W 8W 8A 7 7     R Zv                /          1                       PfEd @  * 8 ZR^   ^                              8       ) / ] { }  !!!!"""#"%"."##'***     ( / [ { }  !!!!"""#"%"+"##'* **lG2ށހCB`XA+*)                                                          ,  UXEY  K QKSZX4(Y`f UX%a  cc#b!! Y C#D  C`B-, `f-,#!#!-, d BCC ``BCB%CCTx #CCadPxC`B!e!CCB C#BC`B# PXeYC`B-,+CX#!#!CC# PXeY d P&Z(CEcEEX!%YR[X!#!X PPX!@Y 8PX!8YY CEcEad(PX!CEcE 0PX!0Y PX f a 
PX`  PX!
` 6PX!6``YYY%Cc RX K
PX!CKPX!Ka cCc bYYdaY+YY# PXeYY dC#BY-, E %ad CPX#B#B!!Y`-,#!#!+ dbB #BEXCEcC `Ec*! C  +0%&QX`PaRYX#Y!Y @SX+!@Y# PXeY-,	C+  C`B-,	#B#  #Babfc`*-	,  E Cc b  PX@`Yfc`D`-
,	 CEB*!  C`B-, C#D  C`B-,  E +# C%` E#a d  PX! 0PX @YY# PXeY%#aDD`-,  E +# C%` E#a d$PX @Y# PXeY%#aDD`-,  #B EPX!#!Y*!-,EdaD-,`  CJ PX #BYCJ RX #BY-, bfc  c#aC` ` #B#-,KTXdDY$e#x-,KQXKSXdDY!Y$e#x-, CUXCaB+Y C%B%B%B# %PX C`%B #a*!#a #a*! C`%B%a*!YCGCG`b  PX@`Yfc Cc b  PX@`Yfc`  #DC >C`B-,  ETX#B E#B# `B `   BBB` #Ba++"Y-, +-,+-,+-,+-,+-,+-,+-,+-,+-,	+-+,# bfc`KTX# .]!!Y-,,# bfc`KTX# .q!!Y--,# bfc&`KTX# .r!!Y- , + ETX#B E#B# `B `a  BB`++"Y-!,  +-", +-#, +-$, +-%, +-&, +-', +-(, +-), +-*,	 +-., <`-/, `` C#`C%a`.*!-0,/+/*-1,  G  Cc b  PX@`Yfc`#a8# UX G  Cc b  PX@`Yfc`#a8!Y-2,  ETXEB1*EX0Y"Y-3, + ETXEB1*EX0Y"Y-4, 5`-5, EBEc b  PX@`Yfc+Cc b  PX@`Yfc+      D>#84*!-6, < G Cc b  PX@`Yfc` Ca8-7,.<-8, < G Cc b  PX@`Yfc` CaCc8-9, % . G #B%IG#G#a Xb!Y#B8*-:, #B%%G#G#a BC+e.#  <8-;, #B%% .G#G#a #B BC+ `PX @QX  &YBB# 
C #G#G#a#F`Cb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca#  &#Fa8#
CF%
CG#G#a` Cb  PX@`Yfc`# +#C`+%a%b  PX@`Yfc&a %`d#%`dPX!#!Y#  &#Fa8Y-<, #B   & .G#G#a#<8-=, #B 
#B   F#G+#a8->, #B%%G#G#a TX. <#!%%G#G#a %%G#G#a%%I%a  cc# Xb!Yc b  PX@`Yfc`#.#  <8#!Y-?, #B 
C .G#G#a ` `fb  PX@`Yfc#  <8-@,# .F%FCXPRYX <Y.0+-A,# .F%FCXRPYX <Y.0+-B,# .F%FCXPRYX <Y# .F%FCXRPYX <Y.0+-C,:+# .F%FCXPRYX <Y.0+-D,;+  <#B8# .F%FCXPRYX <Y.0+C.0+-E, %&   F#Ga#B.G#G#aC+# < .#80+-F,
%B %% .G#G#a #B BC+ `PX @QX  &YBB# GCb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca%Fa8# <#8!  F#G+#a8!Y0+-G, :+.0+-H, ;+!#  <#B#80+C.0+-I,  G #B .6*-J,  G #B .6*-K, 7*-L,9*-M, E# . F#a80+-N,
#BM+-O,  F+-P, F+-Q, F+-R,F+-S,  G+-T, G+-U, G+-V,G+-W,   C+-X,  C+-Y,  C+-Z, C+-[,  C+-\, C+-], C+-^,C+-_,  E+-`, E+-a, E+-b,E+-c,  H+-d, H+-e, H+-f,H+-g,   D+-h,  D+-i,  D+-j, D+-k,  D+-l, D+-m, D+-n,D+-o, <+.0+-p, <+@+-q, <+A+-r,  <+B+-s,<+@+-t,<+A+-u, <+B+-v, =+.0+-w, =+@+-x, =+A+-y, =+B+-z,=+@+-{,=+A+-|,=+B+-}, >+.0+-~, >+@+-, >+A+-, >+B+-,>+@+-,>+A+-,>+B+-, ?+.0+-, ?+@+-, ?+A+-, ?+B+-,?+@+-,?+A+-,?+B+-, EPXEX#!!YYB+e$PxEX0Y- K RXY  cp B  * B 
* B 
* B   * B   *   D$QX@X  dD(QX X   DY'QX @cTX   DYYYYY * Dd DD                   	 r  	       	     	     	  F   	  &  	  B2  	  &  	 ft  	  4 C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0   D e s i g n   S c i e n c e ,   I n c . 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y K a T e X _ S i z e 1 R e g u l a r F o n t F o r g e   2 . 0   :   K a T e X _ S i z e 1 - R e g u l a r K a T e X _ S i z e 1 - R e g u l a r V e r s i o n   1 . 1 ;   t t f a u t o h i n t   ( v 1 . 8 . 3 ) C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0 ,   D e s i g n   S c i e n c e ,   I n c .   ( < w w w . m a t h j a x . o r g > ) 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y   ( < w w w . k h a n a c a d e m y . o r g > ) , 
 w i t h   R e s e r v e d   F o n t   N a m e   K a T e X _ S i z e 1 . 
 
 T h i s   F o n t   S o f t w a r e   i s   l i c e n s e d   u n d e r   t h e   S I L   O p e n   F o n t   L i c e n s e ,   V e r s i o n   1 . 1 . 
 T h i s   l i c e n s e   a v a i l a b l e   w i t h   a   F A Q   a t : 
 h t t p : / / s c r i p t s . s i l . o r g / O F L h t t p : / / s c r i p t s . s i l . o r g / O F L        2                     0         > ? @ ^ `  	 
   uni00A0uni0302	tildecombuni2016arrowup	arrowdown
arrowdbluparrowdbldownuni2210uni2223uni2225uni222Cuni222Duni222Euni22C0uni22C1uni22C2uni22C3uni2308uni2309uni230Auni230Buni23D0uni27E8uni27E9uni2A00uni2A01uni2A02uni2A04uni2A06     dx`wOFF     `     /                       OS/2     N   `Ca%cmap       'Icvt      
       fpgm      b.zgasp  X         glyf  D    uhead     6   6bBhhea        $hmtx        pP	kloca  \   b   bwJqmaxp  <        name      _~post       ~ӫprep  d   z   ~;xX|J]d-YpNl'NPp+]̌1smQoW[73*BEլUYT]N^ 
F[5udf|q/vM/|24Q0=|XwjpGBbjZRTojm?_Ŋae7o?ʒVny&)?GkGJ6!!h֪.C2 |I]wSf$'+5nލxwsK-lV-x3/(phѓqKET*r5aw({jnZ7/<>o<D˿T5.6|XëBR/E!FييZY|w&3q"=q17T (rN dJ0LYIruzrwޖ@֍(3ow.UX`RtN}3eLyd\{̨ح[U7.
#Cc~&$|O;R$cfDQF1}]sdw'= *3&༬4ec2I>:d~Fs1j0V_o"!B؊BQ)g i{uXK0
Rx?FU-O!2UZZ!B^yf*O<013(%f:a {ug$_ۗ=	g5I,r>w(>[1,|/Ga ~I]hXH */]!^kUwK$+:UDjJ=L7*}47$\
R_3HGȉX\^Wǆ6C}V5ű>!ap02	PƄ;J7>w(g!uy*TRQ2%.[#7\|8K*`IS)W2\iI[ܒh(f%,x\rH&zV8N5lx}+}./hJ#|x#1r3>@H4jJ-(4=Bl}\"LR+MrYY2(do!y{q:3hSE0'<gk@-4ɵ~k9n~At.A{RɍR㊥~1HF}>K	7אq.̆?zhK.rTL;x=~+{Low2.	nvTPaX&+1-m*<B~g,ϒ*OӤ^$'@/1-~kY@N1z^uK]U1yDLґN0ØbDi,m'Q+)" @2&JkzܲV%H'@lxF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HU\ySJ<Y0@fEGjV!hWד?RpCf	3i鞝;=mjEᮝ+T*ݗ.!J2^n\%/EbFnZG'/.<I|ö'
{l0%% ,<Möҧ_]2iwVYsut8>w@lqyn
Qi
1gHd6/Y~%oįUe-$1s0HX_6QR\h?RlK	M^ɒ&<>rs$	$  KGG6 cloR[
u9kuw&t@apE)
b
D+	9)D$C>3w
9(ޠvfm'mK6(\/*<+-~(<EJ.nN&cbDNeQSQX7JB'd(8y~/yѻԫϨ.-B0bLC1m"sᇅ]H!`'Eҋ.v
Lnjc.ͬؠ`hR#ds/#J	l~`LQ S&`Aٓ<Q,/x+Z7o"FxbU<7Ox7;#a#G0hlpMW[>9iDaxP"'A XZ63d-c{q]}	稡]lVBX'-VBc ٷ?Gr}`2}0C@Ϊl$BG2ppbE	JQrTc111	1S=]&ݴpgQQv7cX˼DEupb6W-z]iͺEk*ҋutuvI7=oGPO7#nū_Ɓб 86H Cnlj6) s:cx&/X	Hg[4q`u#qJ?4V   )x,       `OS/2Ea  l   `cmapH     cvt       '8   fpgmb.z    gasp     ,   glyf"     headbB  p   6hhea	|~  H   $hmtxv     locaYET     Rmaxp       name_~  'H  postpl  +  $prep~;  &     2       33'3#2d222  w1~   #&&'&547731f)44T W߽3!(  #w~   4633#"&567 &'&#f)44T rW޽͵'B")   8w~   &54 763 Nsw

(
  w~   3#3紴w3_3  6w~   #"'& '&632 s

)  w ~   53#53K33  ww#~ O  #"'&'&&/&'&'&&467676?4567656767633#"i

i"\+;&Gk3
G&}?t*U33U$9M92G
*?XB>v?*G2  ww#~ J  4632#"&54>766767667677'&'&'&&'&'&&'.w>.Q5+5		 WQ.>4P
.+)/	r-	
P4j7ID7+AZI7		Q32A1G *3Q	  5   "#"&526$7#"&&!#GW#6D   c /  32327676677#"'&'&'&#"&''76760(E',\0&NP=0$WM/15^/&NP=0$P<A!	+-!	( 5    "#"&526$7#"&&!#GW#6D c /  32327676677#"'&'&'&#"&''7676H(E',\0&NP=0$WM/15^/&NP=0$P<A!	+-!	(  8> %  33!53277!33!53277&&'&##5!#""

}

}&7

U66L	U66L	c66T   8> '  33!53277&&'&##5!#"!&&'&##5!#""
s
}&7

&7

U66L	c66T66T   7>l 9  6!!#'&'&'&%! 3 76767673 '&5477667 '4&&''4<ZZ: ()Yp1"JS(<:#"A
B9L"R4D$b-'(I/YNm  ov~   632 ##&'&&'76775 	($4*Tt
L7,'1*<&  7P >  376767>7632#"&547'&&'&#"#"&'4632535+Z.3!3> 5
 !!(` %,-@-? +3TRQB1" +
	[Z˒Cp:?D0!   7P > }  376767>7632#"&547'&&'&#"#"&'4632376767>7632#"&547'&&'&#"#"&'4632535+Z.3!3> 5
 !!(` %,-@-? 535+Z.3!3> 5
 !!(` %,-@-? +3TRQB1" +
	[Z˒Cp:?D0! +3TRQB1" +
	[Z˒Cp:?D0!   7P > }   376767>7632#"&547'&&'&#"#"&'4632376767>7632#"&547'&&'&#"#"&'4632376767>7632#"&547'&&'&#"#"&'4632535+Z.3!3> 5
 !!(` %,-@-? 535+Z.3!3> 5
 !!(` %,-@-? 535+Z.3!3> 5
 !!(` %,-@-? +3TRQB1" +
	[Z˒Cp:?D0! +3TRQB1" +
	[Z˒Cp:?D0! +3TRQB1" +
	[Z˒Cp:?D0!   7P X m   376767667&'&5476673776767632#"&547'&&'&#"##"&'4632>7#"2766%4'3276676535+M%.. mC
	V*-3'33> 5
 !!("
L&..nC
	R--3-@-? $,.AN.C]+3W&;CSQF1@,B4	B1" +
	[Zs:&:FQSC1A,D?D0! [P2@W3+H=M[fH   7>   #"'&' #"&5476 7632 koFJo	   7>   4632  7632 #"'& '&7;=
   7> .  32"&'&'&&#""&'&76764pJa"
IFn"U7YS9
(p
ADwi   7? 0  663232766767662#"'&&'&'&&8
JFm"'Kkw,V:`DA
(p
98ZLI3S?jS   w~   !#w3,   w/~   5!#3K3   w~   333w,3  w/~   3!533   pw~   757632#"'&p	(_tE
Ob66MPEt   Uw~   "&754'&632p
w

GKJG   8?  < J  632"'&$'&547676&#"32767667654'&463#"&'&.;jmJ&@$p#LJ&@W3/|;OHnaf*,~w5($33'!/2gڔtp{ϖtp{Frk\`|
-/josLG(32'(2'   8?  ) 9 G U  632"'&$'&547676#!&#'! 55&&5&&'&! 4!!767667676.;jmJ&@$p#LJ&@,&|c|dk]f*2gڔtp{ϖtp{'	($}K_g'}Kd%
,/j?G   8?  / ? P b  632"'&$'&547676&##"774'&&"36&#2767654'&&'" 276766.;jmJ&@$p#LJ&@W3)Wk)( ,O
	Xj( ,Om}4y8{32gڔtp{ϖtp{F`Xk\<43os$#}Xk<43os+ߜ|&
MM
&  7? 0 c  663232766767662#"'&&'&'&&66232#"&###"'&&55#"#"'&5467633548
JFm"'Kkw,V:`"il3ii3liDA
(p
98ZLI3S?jSlijV		Vjil   7> 5  662!7662!%&'5<&<64458"$"56uvG^w}}w^GG^w}}w^G       (                           > l    >? _z/~		
?
        TH_<                 P            2    M     U U #+ 8 + 6  w w          8 8 7 o, 7< 78 7, 7W 7W 7W 7W 7    c pc U 8 8 8W 7 7     P Z8|                ' s         1                       PfEd @  * 8 ZP^   ^                              (       ) / ] { } """."#'***     ( / [ { } """+"#'* **lG2Y9#"!                                          ,  UXEY  K QKSZX4(Y`f UX%a  cc#b!! Y C#D  C`B-, `f-,#!#!-, d BCC ``BCB%CCTx #CCadPxC`B!e!CCB C#BC`B# PXeYC`B-,+CX#!#!CC# PXeY d P&Z(CEcEEX!%YR[X!#!X PPX!@Y 8PX!8YY CEcEad(PX!CEcE 0PX!0Y PX f a 
PX`  PX!
` 6PX!6``YYY%Cc RX K
PX!CKPX!Ka cCc bYYdaY+YY# PXeYY dC#BY-, E %ad CPX#B#B!!Y`-,#!#!+ dbB #BEXCEcC `Ec*! C  +0%&QX`PaRYX#Y!Y @SX+!@Y# PXeY-,	C+  C`B-,	#B#  #Babfc`*-	,  E Cc b  PX@`Yfc`D`-
,	 CEB*!  C`B-, C#D  C`B-,  E +# C%` E#a d  PX! 0PX @YY# PXeY%#aDD`-,  E +# C%` E#a d$PX @Y# PXeY%#aDD`-,  #B EPX!#!Y*!-,EdaD-,`  CJ PX #BYCJ RX #BY-, bfc  c#aC` ` #B#-,KTXdDY$e#x-,KQXKSXdDY!Y$e#x-, CUXCaB+Y C%B%B%B# %PX C`%B #a*!#a #a*! C`%B%a*!YCGCG`b  PX@`Yfc Cc b  PX@`Yfc`  #DC >C`B-,  ETX#B E#B# `B `   BBB` #Ba++"Y-, +-,+-,+-,+-,+-,+-,+-,+-,+-,	+-+,# bfc`KTX# .]!!Y-,,# bfc`KTX# .q!!Y--,# bfc&`KTX# .r!!Y- , + ETX#B E#B# `B `a  BB`++"Y-!,  +-", +-#, +-$, +-%, +-&, +-', +-(, +-), +-*,	 +-., <`-/, `` C#`C%a`.*!-0,/+/*-1,  G  Cc b  PX@`Yfc`#a8# UX G  Cc b  PX@`Yfc`#a8!Y-2,  ETXEB1*EX0Y"Y-3, + ETXEB1*EX0Y"Y-4, 5`-5, EBEc b  PX@`Yfc+Cc b  PX@`Yfc+      D>#84*!-6, < G Cc b  PX@`Yfc` Ca8-7,.<-8, < G Cc b  PX@`Yfc` CaCc8-9, % . G #B%IG#G#a Xb!Y#B8*-:, #B%%G#G#a BC+e.#  <8-;, #B%% .G#G#a #B BC+ `PX @QX  &YBB# 
C #G#G#a#F`Cb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca#  &#Fa8#
CF%
CG#G#a` Cb  PX@`Yfc`# +#C`+%a%b  PX@`Yfc&a %`d#%`dPX!#!Y#  &#Fa8Y-<, #B   & .G#G#a#<8-=, #B 
#B   F#G+#a8->, #B%%G#G#a TX. <#!%%G#G#a %%G#G#a%%I%a  cc# Xb!Yc b  PX@`Yfc`#.#  <8#!Y-?, #B 
C .G#G#a ` `fb  PX@`Yfc#  <8-@,# .F%FCXPRYX <Y.0+-A,# .F%FCXRPYX <Y.0+-B,# .F%FCXPRYX <Y# .F%FCXRPYX <Y.0+-C,:+# .F%FCXPRYX <Y.0+-D,;+  <#B8# .F%FCXPRYX <Y.0+C.0+-E, %&   F#Ga#B.G#G#aC+# < .#80+-F,
%B %% .G#G#a #B BC+ `PX @QX  &YBB# GCb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca%Fa8# <#8!  F#G+#a8!Y0+-G, :+.0+-H, ;+!#  <#B#80+C.0+-I,  G #B .6*-J,  G #B .6*-K, 7*-L,9*-M, E# . F#a80+-N,
#BM+-O,  F+-P, F+-Q, F+-R,F+-S,  G+-T, G+-U, G+-V,G+-W,   C+-X,  C+-Y,  C+-Z, C+-[,  C+-\, C+-], C+-^,C+-_,  E+-`, E+-a, E+-b,E+-c,  H+-d, H+-e, H+-f,H+-g,   D+-h,  D+-i,  D+-j, D+-k,  D+-l, D+-m, D+-n,D+-o, <+.0+-p, <+@+-q, <+A+-r,  <+B+-s,<+@+-t,<+A+-u, <+B+-v, =+.0+-w, =+@+-x, =+A+-y, =+B+-z,=+@+-{,=+A+-|,=+B+-}, >+.0+-~, >+@+-, >+A+-, >+B+-,>+@+-,>+A+-,>+B+-, ?+.0+-, ?+@+-, ?+A+-, ?+B+-,?+@+-,?+A+-,?+B+-, EPXEX#!!YYB+e$PxEX0Y- K RXY  cp B  * B 
* B 
* B   * B   *   D$QX@X  dD(QX X   DY'QX @cTX   DYYYYY * Dd DD                   	 r  	       	     	     	  F   	  &  	  B2  	  &  	 ft  	  4 C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0   D e s i g n   S c i e n c e ,   I n c . 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y K a T e X _ S i z e 2 R e g u l a r F o n t F o r g e   2 . 0   :   K a T e X _ S i z e 2 - R e g u l a r K a T e X _ S i z e 2 - R e g u l a r V e r s i o n   1 . 1 ;   t t f a u t o h i n t   ( v 1 . 8 . 3 ) C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0 ,   D e s i g n   S c i e n c e ,   I n c .   ( < w w w . m a t h j a x . o r g > ) 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y   ( < w w w . k h a n a c a d e m y . o r g > ) , 
 w i t h   R e s e r v e d   F o n t   N a m e   K a T e X _ S i z e 2 . 
 
 T h i s   F o n t   S o f t w a r e   i s   l i c e n s e d   u n d e r   t h e   S I L   O p e n   F o n t   L i c e n s e ,   V e r s i o n   1 . 1 . 
 T h i s   l i c e n s e   a v a i l a b l e   w i t h   a   F A Q   a t : 
 h t t p : / / s c r i p t s . s i l . o r g / O F L h t t p : / / s c r i p t s . s i l . o r g / O F L        2                     (         > ? @ ^ `      	
uni00A0uni0302	tildecombuni2210uni222Cuni222Duni222Euni22C0uni22C1uni22C2uni22C3uni2308uni2309uni230Auni230Buni27E8uni27E9uni2A00uni2A01uni2A02uni2A04uni2A06   Ux,wOFF     ,     ,                       OS/2     N   `Eacmap        ĞHcvt      
       fpgm      b.zgasp  $         glyf  D  8  "head     6   6bBhhea        $	|~hmtx  (   r   vloca     R   RYETmaxp  |        name      _~post       $plprep  X   z   ~;xW|ȳ
lْ-[Ď1n,.󕙙{eztcfL{VVK¥o,<EQ!GQdHYCX#z3Q@mDj*BQ s]f*"s, Q5cO>`/gci1~T$r3֞p"[IQB0TUs$".bxM rdO?s}6"d  ]tdw#? "JE-űU?ƒj1G1Tɺ[:%C^J89Ql,:ldYE#@|~#<><Z{RI7		Vz{'!3#=MH/I>fa"HVy8NS5yɥ*(
%A b"EiA 4(3zz|"=zbHtaЖ,?&N~$tVtݤ{?EE<ؘ_è*bE-?"} [oH^`F`py"cv#6	BT*Cwuq_xO& }ǅ:Ӌ7Y9Lx\cAYӅ< 744)-1^`5Q:7Ttaʰ׋i3xܟiyH,)gۿD&~T4Ҵ?_.њآG`G0 RCpM<dL W;Ta27Fq>1_4%\2i&=u&@W)S~fW>zlﮘE3)[F55M)U)o0T p]9Y5LNl5llvQ>2	Z*cN7v_UmUT%ޟߠڷO*GzKS/P,N:h̒wR:+=qIQ~*}Y%NQb*őq	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G$o;|6O=%^\1]*Cc>gE
ϟVU|$ۦa-||YdmW.7Q^Pᴛ;;bo ㏞H"P/[a̅ToڱsX⍨)<Z	l`9p/ъ׼=Ǳ[Ԛz鲟ޤpx9"Q_z\"HWUR[`$ Y/%I4wMk)ԴiWl_Ӄ:})x{AsDou.QolgQ+^F- 3uAkԣ"VZN"u!3xoq FV/gZIY*# 	Z #GD=b?`fPfRQ?/<%=r0h b"8NxN@wšs	H2p:WFCoCvH#*+GXT߄.h*28q6\QJG_2_U6 lASpOSWlİIIwM'c}Bú+*(q&T6UTS!1pc7ثʲdg9>	i$D75Ů\	3$fU5;\&Z=TBV.4	s@1[=0"qj{@L	C2.2ƨ,{&6z｟cڛpUM5OէNQ[pҨWuBxRT(d(ViX@lʜ_3w>Hթ;i8؈HHHHH(55i-]vr&Ã}AXgSh-\S]t|jFʜi8{sC<YChKK,QX	=] [J (֣uuQf%	N6YN B,n9Bӝhf1S{cBa μ-x|(       `OS/2FN~  |   `cmap.oT     cvt       "8   fpgmb.z    gasp     (t   glyfA     head_"B  T   6hhea2  X   $hmtxX     locaae     hmaxp a      name_~  "H  postA$  &  prep~;  !     2       33'3#2d222      #"'&' 67633'Massa+.  !*   4332 ##"#"5476'&!'M']]	..
JI   8   62 #"&54656 
	R} A   !#34II  8   4632 #"'& '4&8R	}  9   5!!534III%   M  #'&'&'&'&'&&'.45467667677767676773!|F1[A
A[*k!/!	0SZKO;(Z
J.>	%	=hJ\M**M1)nOZ4?H	|}	kP'$"k	|}	x[;"   R  46;"#"&5467676767676767&'&'&'&'&&'&&	,&!bHHbY7K3'[	W'5/13'W	jO
`sJW--WJrkU6&
,c		{i"++"i{		c/ AnO    "#"&576$3#"V 
	   d`9 ;  26323276%>372#"'&'&'&#"#"'&56767$Ih>Y#HX798TN64.EKY#HX79TY8.b	S
&.b	i  A O    "#"&576$3#"RV 
	 d9 ;  26323276%>372#"'&'&'&#"#"'&56767$2Ih>Y#HX798TN64.EKY#HX79TY8.b	S
&.b	i   o   7632 #"54''77j8=LMhh=?1
l	:y  y   !!lI   q   5!#lIIIn  y   3!I#I  q   3!5(IhnII #qK   633#"'&&5676 
+CP! 3	  #b   ""#""#'&5&5577632232		D	x. #|K   632#"'&' &46(D+Ĭ
^  h	83   qG   4332 #"'&&54''&'&l^ C+ w	F13 tH4+ Gb   ""#""#'&5&5577632232C		D	x.  |G   632#"'&767665487Pz 3'	+4It* ?{   !!?[{TM  ?  Z   !3?TZ  ?|   3!?T|MT   {[   5!#[T.T   [Z   !3TZ    |[   3!5TT  #  #"'&'&54767677Me*42D5e
9%	/&  l ;  632##*#'&'&54''&5'<57476676547@)`@gE6		Yh	T@Pdp	;		C  } 
   #'&'&'&577632#L+4*1}TV]
A0V 6   632#""#""#'&'&547@)		5
v(
      633###"&'&5&'&'&'&'&54O=4*1}Iph	<A0V  l ;  632##*#'&'&5476767&'&'&'&57@)Yh		`@gE6		C;	T@Pdp
  } 
 $  %632#"&547676674767454546@)=NNe		ohI5d:%  o   ##'& '&''77632GUMMcx
	T7k      75767263 #"'&QR	7'*	  g    "&556 7& '54632QERQR 		!"!! q 	  "'632
	22  4]   67!!"'WM + x   '5767672632#"#Lf}	u9#I>			SH + x   '543632#"&'&'&'&#"''44
wL8U|>:<HI#8+E	   M   73232#"'&'&''8U|>:W_0LG9*E		$I   M   #"''<57632767676363L0_W
u8M#I$		^*9     x   #5!
xx       3 S                          E z    b_%5EU:k|R7o*Z      zj_<                 n            2    M       ! 8G 8G & &    aa       o  k#k#k#k kk ???    yy yyy yy   o& & g      Zan                3 (         1                       PfEd @  T 8 Z   ^                              $       ) / ] { } "###'T     ( / [ { } "###' PlG2
{rB ,                                      ,  UXEY  K QKSZX4(Y`f UX%a  cc#b!! Y C#D  C`B-, `f-,#!#!-, d BCC ``BCB%CCTx #CCadPxC`B!e!CCB C#BC`B# PXeYC`B-,+CX#!#!CC# PXeY d P&Z(CEcEEX!%YR[X!#!X PPX!@Y 8PX!8YY CEcEad(PX!CEcE 0PX!0Y PX f a 
PX`  PX!
` 6PX!6``YYY%Cc RX K
PX!CKPX!Ka cCc bYYdaY+YY# PXeYY dC#BY-, E %ad CPX#B#B!!Y`-,#!#!+ dbB #BEXCEcC `Ec*! C  +0%&QX`PaRYX#Y!Y @SX+!@Y# PXeY-,	C+  C`B-,	#B#  #Babfc`*-	,  E Cc b  PX@`Yfc`D`-
,	 CEB*!  C`B-, C#D  C`B-,  E +# C%` E#a d  PX! 0PX @YY# PXeY%#aDD`-,  E +# C%` E#a d$PX @Y# PXeY%#aDD`-,  #B EPX!#!Y*!-,EdaD-,`  CJ PX #BYCJ RX #BY-, bfc  c#aC` ` #B#-,KTXdDY$e#x-,KQXKSXdDY!Y$e#x-, CUXCaB+Y C%B%B%B# %PX C`%B #a*!#a #a*! C`%B%a*!YCGCG`b  PX@`Yfc Cc b  PX@`Yfc`  #DC >C`B-,  ETX#B E#B# `B `   BBB` #Ba++"Y-, +-,+-,+-,+-,+-,+-,+-,+-,+-,	+-+,# bfc`KTX# .]!!Y-,,# bfc`KTX# .q!!Y--,# bfc&`KTX# .r!!Y- , + ETX#B E#B# `B `a  BB`++"Y-!,  +-", +-#, +-$, +-%, +-&, +-', +-(, +-), +-*,	 +-., <`-/, `` C#`C%a`.*!-0,/+/*-1,  G  Cc b  PX@`Yfc`#a8# UX G  Cc b  PX@`Yfc`#a8!Y-2,  ETXEB1*EX0Y"Y-3, + ETXEB1*EX0Y"Y-4, 5`-5, EBEc b  PX@`Yfc+Cc b  PX@`Yfc+      D>#84*!-6, < G Cc b  PX@`Yfc` Ca8-7,.<-8, < G Cc b  PX@`Yfc` CaCc8-9, % . G #B%IG#G#a Xb!Y#B8*-:, #B%%G#G#a BC+e.#  <8-;, #B%% .G#G#a #B BC+ `PX @QX  &YBB# 
C #G#G#a#F`Cb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca#  &#Fa8#
CF%
CG#G#a` Cb  PX@`Yfc`# +#C`+%a%b  PX@`Yfc&a %`d#%`dPX!#!Y#  &#Fa8Y-<, #B   & .G#G#a#<8-=, #B 
#B   F#G+#a8->, #B%%G#G#a TX. <#!%%G#G#a %%G#G#a%%I%a  cc# Xb!Yc b  PX@`Yfc`#.#  <8#!Y-?, #B 
C .G#G#a ` `fb  PX@`Yfc#  <8-@,# .F%FCXPRYX <Y.0+-A,# .F%FCXRPYX <Y.0+-B,# .F%FCXPRYX <Y# .F%FCXRPYX <Y.0+-C,:+# .F%FCXPRYX <Y.0+-D,;+  <#B8# .F%FCXPRYX <Y.0+C.0+-E, %&   F#Ga#B.G#G#aC+# < .#80+-F,
%B %% .G#G#a #B BC+ `PX @QX  &YBB# GCb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca%Fa8# <#8!  F#G+#a8!Y0+-G, :+.0+-H, ;+!#  <#B#80+C.0+-I,  G #B .6*-J,  G #B .6*-K, 7*-L,9*-M, E# . F#a80+-N,
#BM+-O,  F+-P, F+-Q, F+-R,F+-S,  G+-T, G+-U, G+-V,G+-W,   C+-X,  C+-Y,  C+-Z, C+-[,  C+-\, C+-], C+-^,C+-_,  E+-`, E+-a, E+-b,E+-c,  H+-d, H+-e, H+-f,H+-g,   D+-h,  D+-i,  D+-j, D+-k,  D+-l, D+-m, D+-n,D+-o, <+.0+-p, <+@+-q, <+A+-r,  <+B+-s,<+@+-t,<+A+-u, <+B+-v, =+.0+-w, =+@+-x, =+A+-y, =+B+-z,=+@+-{,=+A+-|,=+B+-}, >+.0+-~, >+@+-, >+A+-, >+B+-,>+@+-,>+A+-,>+B+-, ?+.0+-, ?+@+-, ?+A+-, ?+B+-,?+@+-,?+A+-,?+B+-, EPXEX#!!YYB+e$PxEX0Y- K RXY  cp B  * B 
* B 
* B   * B   *   D$QX@X  dD(QX X   DY'QX @cTX   DYYYYY * Dd DD                   	 r  	       	     	     	  F   	  &  	  B2  	  &  	 ft  	  4 C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0   D e s i g n   S c i e n c e ,   I n c . 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y K a T e X _ S i z e 4 R e g u l a r F o n t F o r g e   2 . 0   :   K a T e X _ S i z e 4 - R e g u l a r K a T e X _ S i z e 4 - R e g u l a r V e r s i o n   1 . 1 ;   t t f a u t o h i n t   ( v 1 . 8 . 3 ) C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0 ,   D e s i g n   S c i e n c e ,   I n c .   ( < w w w . m a t h j a x . o r g > ) 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y   ( < w w w . k h a n a c a d e m y . o r g > ) , 
 w i t h   R e s e r v e d   F o n t   N a m e   K a T e X _ S i z e 4 . 
 
 T h i s   F o n t   S o f t w a r e   i s   l i c e n s e d   u n d e r   t h e   S I L   O p e n   F o n t   L i c e n s e ,   V e r s i o n   1 . 1 . 
 T h i s   l i c e n s e   a v a i l a b l e   w i t h   a   F A Q   a t : 
 h t t p : / / s c r i p t s . s i l . o r g / O F L h t t p : / / s c r i p t s . s i l . o r g / O F L        2                     3         > ? @ ^ `   	
 !"#$%uni00A0uni0302	tildecombuni2308uni2309uni230Auni230Buni239Buni239Cuni239Duni239Euni239Funi23A0uni23A1uni23A2uni23A3uni23A4uni23A5uni23A6uni23A7uni23A8uni23A9uni23AAuni23ABuni23ACuni23ADuni23B7uni27E8uni27E9uniE000uniE001uniE150uniE151uniE152uniE153uniE154     bZ	@
x'	P;       `OS/2E     `cmap*TOZ  	4   cvt       p   fpgmb.z  	  gasp        glyfqtX     head_"B     6hhea     $hmtx7>  P   ^locam     2maxp ^      name_~    post{/3E      prep~;       2       3K   #'&' &54767739//69ý@\T=U<PvtR;U=u    "K   %4633 #"&567 v96//9/; =RtuQ=/M   7K   "&5476 7632  Qn[K		%R   K   !#3K	_>>   8K   #"'&& '5463 
[#[?fTR	Rq  K   5!!53l>>  Kj O  #'&&'&&'&&'&'&'46676676676773j`zbE	Eb%
$_eO	Un_$
Q(}K;B
N%
$P
B<UI^8<Ex*	*}H<0K^I   Kj G  46;#"&=4727767676767677'&'&'&'&'^yh%:*Cy^4%)0({J=vV
/I]=J{(
RsOA 	
atR 4   $7"$"#'&Alk=
<[TU   b (  63232763"'&'&'&#"#4&4676p39;MZ:-7	tZMZ9.7	c%P#5&P+  X4    $7"$"#'&XAlk<;[TU ^b (  63232763"'&'&'&#"#4&467639;MZ:-7	tZMZ9.7	c%P#5&P+   oJ   %4 7632 #"5&'4&''7 Lh0h

	 4z  K;   !!EK	_>  KP   5!#E>l>	!   K;   3!>K	_>   KP   3!5>	!>  ~J   757632"'&~JJ	J   ^Ko   %4 547632F#"55//
	CB        P#5J }    wDc@k        `XJ  " 7  8         X  ^ oG G G G  ~ ^     J ZX                    7' 8 Z)      '  'lG2
. q3r#C3#%3#3t%u&0P'?7E8uni27E9   #x\wOFF     \     (|                       OS/2     N   `FN~cmap  (      .oTcvt      
       fpgm      b.zgasp  T         glyf  D  
+  ޫAhead     6   6_"Bhhea        $2hmtx  ,      ̓Xloca     h   haemaxp  p        aname      _~post       A$prep  l   z   ~;xڽV9Ud]/Nֹݻqa8\O9tL133333333Ș+$~UKI	%Ur+?o|՟p'kG:6&\KX&+B!e:vR1m9w,]e{qtq7Jop|>T{w2J[eFBbO&.<fJJٱ-b%2q.1ݗ/HM!DoBNQ8Nq"#w4ge|)s"dR\*vZ( t܆i l"ɰ` V/c'}KeK$!t<k?w4\n*ʋ$c*-f&؆am 1eE
t4A?SJ[R
@}g~#G=	3$s嚱Z԰zӢLRJ1{*$%!2U$ްLK̴p~aAg()] E@aNI9h}wm iFAGO1j7N3[1 2l[oL8kkunYM/Er=cً0fux@Ln"o+FZ<ǩJOۗ$EK^TKΠnƶnY}F Dt>  R^;2:9ܮ:65+Wŧj bxqS{K-J=`x 9wj(Vp#=VX]2X-ʴ%k24X˴}/8+q8WN&2{,<.FS 92%ׇ8>- Bp?OyROBR9*Ҵq%kfDP%%]<#g_@;ӃQȠ$ƕw54Ljm$Er`JbZ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ϹyF;ZӶ?v((پ-9qgŷzŷ4m~ӜYҦxlU   ѻؾ'E.dG UހԨg/?ȭ i˶;pȱΜpʵ{ɳ޼.[k 5DYw<mEbXٷb.6-X:qo#hXa	3lߦiX"ScSX     jxW."wOFF     D                            OS/2  (   N   `Ecmap  x   n   *TOZcvt       
       fpgm      b.zgasp  <         glyf  D    qtXhead  |   6   6_"Bhhea        $hmtx     Q   ^7>loca  H   2   2mmaxp  ,        ^name  ,    _~post     n   {/3Eprep     z   ~;xڭT$IΈʬvWuUb=5gmٶmlڋ)Y1ڌ3X(.\c w2`o:vk`,ʥ	j-%ш'T{UV7Fzё9u0|`v:!>=y.3k!(f,RXL%S,!H-r`=#<xKNht]wl߁pn&@Nc}?$D/NU+BRI.IJŀQq4zO.>5B,!;ϹeN|sA44Q7@ם67i#MצLscy,T,eއ'/#R@z!h9	Zgz8[GCN/rA[W?7ӛi3GcmZT~K4uSt_%GTQT*LRKX6Mkˆ趇P	o?1 (qۇ-lAb03hKb;Macq kA :3Qv'0:8,@T\d`tٗV2G5V[e;_H5V}I)O}cf҉b$R5H<Q}WRP:LjZ55uh 5[8_cbH'<h\*z@RӦ(j'7Gу			*NZVvzA%#L0Tnwu4쓂VK\(c<S4KL `	{AK^5ON$| n]?hCqЯbbª~M(.J
طr̂V^o7^r܂`_gj¡\a Fy~;]|vy~y;N~̚RIYZ(+*υAap{ؤIuwՂANC^
J#zNBKyje?}?M?nx-DapPg}iftӃg}j9amV"a[KP<b|CŬw3tsD>0[bk#rk#lZ!hCݒ%K@O4|fD1g@!cp4j	 xc`d`````b ("x@$        J }    wDc@k        XJ          xc` @6@"`$H[ inwM@Rú%L@@!ɝsCh:8    xc`d``]ǋ!uɯoXEP8  xc`b8iCf|`Ā0y080(dVoźyC3\# .6  xc```bf `H0 Ex4bj!0c̬$̭P6I	(ˡ~7 #>|xc`b F؀3U13p30113801$021`°4/ Lqd椤&&D,%vN`J[      &x(wOF2     (                              ` 	
h66$^2   #vs"DQ&JMP&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  d@     2       33'3#2d222    @n   
2+463"&''#"&546!.6 !2 2     zMo  % 2+462#"'&&'&7462#"'&&'&z**?b[[ab[[a   $  c m { voT2+74>7356654#'&54763367676233676763232#33###"&'474###"&'474"'&%4##33566$F,,//
	,	43

#"+,/.

34

83434
%Fm%FmAFhAFh  : L X b 
^\NMB2+#"&547'&''#"''5'&'&&4325'&'&&547667675476334#34&'32761
Z+6,A	7>3306U 		z!/6
0';!]\I&,G3)"
Vr7N-S6
!\m"-!2``  #    4 F U @QJB9*!2+467263#"'&7&#&7654"&5476 7632 7467632#"'&74'&#"3276#'$%%%^
	'$($ (g0/M	'G/H
(t"-
"_>1J	&J.H&J(	(	   n J Z h 
e]VN82+4632676774'"'&546732##3265432#''#"&'&547677'&74''"#"7676&'"767`<7""#1
862$"$6i3<'<
	$	.&
 E[
J251 #$I6P8+1	)N450,!0'#GP:-	.4	0$91)=
#  ]c  2+4632#&&5476675"#"  =1

 *2 >+?f	B+     2+#"'&'&&5476767632&S]Z&0&+d5>ly1$
^SHr@
   Wf  2+&&5432#"&46767654'&m	'S\L1H	+*{
>lqH1[ +cYU   D Z n 7 2+2326676323#"'.#"#"&'474464554#"#"&547667'.#&54632325544&45&56 ,1
a1	1#,1
`1	1#5	
5	   & Q  2+%#"''5#"'&476335763232##)PPPPPPPPkRR4RR2  ua   2+!"&54632#"&'&7676767	!'%)4F5	!%!';-@Z
   9U  2+47!!9`4	
2
    L   2+74632#"&& *' %F(& &%   :  	 2+"&5476 7632 ^J
SN   *m  & 2+632"'&'&5463276654&'&#)-9,\oR*7.\F7C$*:	9A?3Q/^y/^a	PdIRYM  c o ' 2+"&'5467636767632!&4763354#>&
6556)
O	8   4 n ; $2+"&54676332335462!&&54766767654&#"iE3$'Ls
$58{ef0		<ZC76KL?!=64.`	 $6+#9E.  ,n Q 	2+"&56676363#"&'&54632327654&'&#"'&54766767654'&#"}U?v09*1yTXt	 	$UZ$	D/)#	!5:>7 48K  C,(8D[C8
$G/<	
<!	   p 1 7 32 2+7&&547676335#'&'&57676323332##32'		&(
(,**,(&	!!b	\a6\		643  4c L ;2+72654&'&#"#"'&'&547673:62233#27632#"'&46328V1%L($~}
+:'"5F
|\/#AC9/A	1

eBKf^0  -n 3 G <4+2+632#"'&54654&#"7632#"'&&546"3267654&'&&AH;L$	.L	@M7(3-7c_J3O1	"&#%C+:6&N6$)
(3B.>-^9.*.6%5'  ,s +  2+"5476767##"'&'&547632!*t(	#M 
2,-2	,-
     -m + 5 D 
=63.2+4632"&'&547667'&&'&'&&%4&"262654'&&#":vN$H`?,/?	vv
C3).DFbHLXLx9MF/9N	#@aZ;,CA(DZZD*B?!$42&(22B.%0D.G  .n , B 9.2+#"&'&'&5467632#"'&5463232767&#"3267674'&:b+82AdR8MO/8!P'%2"I2!(&K		)*C12C1=H:N~L-	)+
5n!&O)	'	@    L   2+4632#"&4632#"&& *' %& *' %i(& &&(& &%   uQ  # 2+4632#"&&54632#"'&4676765&& *' %77%''9'
!i(& &&:'</N7'
!   9 7-  2+%#"'&$'&476$7632S*Z   &    	2+47!!&&547633&s~	
2				
  9 7-   2+7"&476%%&54632[(U7  >  i * 5 3-2+4632#"&'547676764'&#""&463"&>nQr6)'
O	z	fE.! 4<@-!10!+<	#]?%f      ,i 5 G D:02+467632#"&'&54632&'&#"327632#"'&&$4&'&#"276,g<(13J
V?SjZH6%4Ign#
#2{#v<(N5!(Oz
]T"
4SVF
D)+F
    o = L G@42+%2##&547667754''#323#"'&54632566767624'"25&'&ONOO79897pL  {

{    c - : K 
B?2/ 2+7&&54767633#"'&'&5467630&##3676654&&&'&##323676766'		
	"82*3I
C-DB>>",&;0!IEG	6#	
	-!")F
V7+;		3!.(:
0   (n 4  2+"&5467632676632#"'&54'&#"32654632l}\>3

	75-I=0?-;ty{&	
Z[	&=-G|qF9B.Lk   c  ( $! 2+7&547633#"'&547634&'&##3766&~	C/FG0A
mL93045<I?\V<,Y
5z    c Q C2+473:62233#"'&&55#354632#"'&55#35476762!&5467633#"'&&(0u	u$I=x"	*+
    c I ;2+473:62233#"'&&55#354632#"'&55#3#&5467633#"'&&(1y	yF
	=x"	
   &n J 2+%#"&'&547667632276632#"'&'&'&#"327654#'&&4673##"&l'AFue@9/
1<M;1+		's]3:93Up	%
Z[!9UO
3.!&   c \  2+7&&54767633#"'&547633##35#"'&'&54673##32#&&547676335#32'		TS
			
											5			   H c (  2+7&&547633#"'&547633##32_
=??=	=??=	
5   9c 2 2+473:62233###"&'&546323276655#'s	^>FY!(>22<Ϩ6.:/*	)	0   c P  2+7&547633#"'&547633##?&&547633###&&5467/32)LKYWFG	EF#*N	"<6rM$qpYY?M	<n1F"t    c 2 2+632##35476762#"&&'&&467633#"'&&476,ig#%$o:+	  	a65*+      c U *2+&&54763225476767632#3#"'&5467354'"'&'&'3#"'&5467326=&)8>5BC!%<%!BCH
5*o		o*    c L 72+7&&54767633#"'&54762#"'&'&54673###"'&'&'''32+		x
{	
	
	z				K/		@a1<	  8m  * !2+6332"&'&54&&'"3267654'&f%eGG..GG.3*)L,42	L!----Rcz-(-zs!,   c . ; 64 2+7&5467633#"'&547322623223##324&'&'#36766) )B+L3'WBEB7)=<<=)7
B4@@V		*<

<  8vm " I <#2+#&'&''#&'&'.5476332'4&54763227>54'&&'&"3@2A<.%eGG.'' 
t-v	::*]GD-!-:+;;N(K><L>3L@>N?3   
c P _ US92+7&&54767633#"'&547632326676762#"'&5''&'&##32&'#367667654&'		kx/F

$1']/-*		4,++,,	3	>+.#=:	.Ah57(
	!$2   4o V >2+732764'&'&&'&&54763267632"'&54'&#"#"'&#"'&55467632*)(9LL6/S02	\'7
	OG7D\Bc:			fdV=T4!"		
P&
[AG^	&
R(&		   c 9 72+64673##"'&'&57673:62233#"'&&55#3#&	En&)1nF
	&"=>x"5 c F  2+###"&'&55#"'&547633##276676675#"'&54667	G6 Ir[Y	. .
c?bnS
*r"11"!
  c B -2+##56567>7#"&54673##"'&'&#"&'&54763399??>?>ML
=7J+
*K9		   c W 2+"&54762##"'&'&'&54###&'&&'#&547632##7676762567675}~#	&&	#@=F#5	*%&*	5#EkK?]KK]?KkE   c Y  2+7&54676337676''#"'&547633"677#&546732##2##&5477&&''32:556MM	 	ML21?@NN	&#	{phh		#56#hhz|6#O''''O    c J  2+7&&547676335&&'#"'&547633"254774#&&546673##32		YNM	 	HF	

Y			01"
10	  0 c ?  2+7&&5476 77##"'&'&57673:62233 35476762G	*"#+$"=>B,,EF     2+&'767633##32ooPQQPRkl6
   :  2+4632 #"'& '&:J
N  )6   2+&47633#"'&547633@PQQPooR	8q	)  `c   2+63'&''#'&'&54766H'
		
88o
		
a$

>
G   9  2+47!!9`V4	
2
  e^  2+#"'&&54767632632@# D *#?+]D
B+!  0 9 G B;!2+"&5476323#"&'&&'#"&54>763354&'&#"#5#32676~U9;W)	$,(
=OCZ+IM,*-#	"#96&-B	2
F4om
$W<#5($%(#   c * 8 5- 2+"'#"'&'#'&547632763274&#"326%C4>;	7H3/8
SFE9":/*4O,  __#",M&@*'.;W%{,5S   B / 
 2+"&5476763632#"&55'"&#"3276632#Z58W8@
	3@b@3
.~`PABN:?R4	\  c & 8 3)!2+746325#'&5476323#"'&55#"'&&73276675&'&#"pW>2	>;
?>?	6A'!6BTE3D$=0AY 		*lH:WHx2P   0 ( 2 -)2+723#3276762#"&'&54676&&'&#"

Ua
Z<;$[8KzB8#	%%1'hW
/=8
*1QC")>m+.	'"  # i ; -	2+6673547663#"&'5#32##32!&&547633#"'&+	n^>-
5CAAC;:		:;76'+8*8   B M a 
XOKE32+46327632#"'&###"''36223#"'&5477'&547'&%4&#"26&#"3267654'&<dI-&	.+#/bK)%	H@OhG!E%93(%01N1p"6K6`	D^ #.B`
D<>LC&/A3%*&*(02&'00!%    c D %2+7473#'&54763232676323#&&5476763354'&&#"3#&>>;B	d?		7%?&a_&YRz		pt-
^^	   H d  ( &2+4632#"&4673#'&4763332!&"#"!	BAa_=<	/<  0xd 
 8 0$2+4632#"&2327676655#'&5473:62233#&&'&'46"#""!/JIg`M2:/* 46BJ     c S I2+"&547633#3#&54677'&&''32#"'&47633#"'&5476763267gi!!F<
@;0#"! fg !! 96;>c		CPU		?"! ?66<:  3 c ! 2+473:622333!&546673#'&3g	
JI=		    Y 2+7#&54673#&'&5473263276323#&&547354&'&#"3#&&547354&'&#")(3!8)=%w		!'w		!'L.)2#se)9(]Y#se)9(]Y    > 
2+473236323#&&5476763354'&&#"3#&5473#'&><<?l?	
7%?>*YRz	
pt-
^^	  4  $ 2+632#"'&'&4764&#"32676tCN1(e1j;4PBH75HF86y?3v:.a"4f$Le9RT7=^!,   # , : 7/"
2+4732762#"'&&#"3#&5473#'&4&#"326><	7^
<c.	?>E9":/*4O#ZA&@*U
[\	;W%{,5S   "#! * ; 7-2+746726325463232"'&4763354"#"&'&732767655'&##"mOE5!  !:DOmSP5<	V	6J[y	)
66_^+mN>S=0aN     3 &2+632#"&''32!&5473#'&547Da?+'2@?b11	D+H-A>  H Q ;2+%254'&'&'&5476726327632#"&'&'&#"#"'&#"'&5467632|!HF]'W	;	
15/`R_HG/,	F; I+(
21		?
.3=5	C  * : 2+%2#"'&'&55#"'&566735766323#327676cC:%#1/	aXX:;	AY%#>ql23	11jmAO   7 	2+%#"'&'#"'&&55#'&5476323276655#'&547323>?	1Bl>;>K><?&	H'j1Yk   5  2+#""#'&'&''#'&547633##677#"'&5466746	



	64SS	---
	>M
   a G2+"&547632#"67676767323546567654#"'&4762##"'&'&&54#'&''&&5&6TQ !! 	c6  PT$,(6bf	UV     a )	2+74#&547633##"2#&546725&''3#&&546673765&''#"'&'&5467633"30QS !017" 	,	
B652" 
	SRbDD#AA("H		B
00II$B
		#    U A2+74&&'#'&547633#7674#"'&5473#"#"&54632#367663CTS
		EC(H#04+	
"9
Ve3&<	L   "  D ! 2+7&&544>7667##"'&'&57673:6223335476328	!$,	!			00

!!
	45   2 ? '2+2#&'&/5'&'&&'&'&5476766767757677232#" (kK6

6K 		n((E
ef	

	ef[		(		ec.-bd   ) 	 2+632"'	,+  1 G $2+632#"&'&54763277547677&'&'&55'&#"'&5476E!':>	P
Nk(		l((l			-(""%	
	$""
E		db-.ce		  W t # 2+6323276332"'&#"##"'&5676
#0
A+*0=)+A)+;  hd   	2+4632##"746726363##"&h%785"..  hd   	2+4632##"746726363##"&h%785"..  Wk   	2+4632#"'&2654&#"2 '2 (Q.!!   , 2 +  2+.54766767654&'.54767632#
	$>%%
8o9!#
+E   H   2+74673#'&4763332!&H	BAa_=<	&<   0x - %2+2327676655#'&5473:62233#&&'&'46d!/JIg`M2:[46BJ    `c   2+63'&''#'&'&54766H'
		
88o
		
a$

>
G   bA  2+6327632"&'&546r
	><<<	7

-.	   IA   2+&&'47633`
	!
  c  	 2+"&54767263			JH$)  tJc  2+467263#"'&'&t
HJ9+$
   Oc   2+2+"&'&54632767676&#%[??
c"%
  9  2+47!!9`V4	
2
  Wk   	2+4632#"'&2654&#"2 '2 (Q.!!   Wc # 2+6323276332"'&#"##"'&5676
#0
A+*0=a)+A)+;  1 G $2+632#"&'&54763277547677&'&'&55'&#"'&5476E!':>	P
Nk(		l((l			-(""%	
	$""
E		db-.ce		    c 0 2+633#"'&&55#32#"&'&&467633#"'&&476,%#fV	  	ax"56     #  o  ' #2+32633 '&5476&&5&13&'&
^	52E(@n

3s	  8m  + O 
@.2+6332"&'&54&"32>7654'&&6632547632#"'&54"#"&'f%eGG..GG.t.4'-					L!---	L@>N?3$,,NL>3	d   o C  2+7&5467632567673263332#&54767254&&'&54'"3489:8	55			
4R'%R4

   ! c * J e 
\K5- 2+"'&55!#"'&'&547673:6223#&'&4767335473#&55#!5462!&'&547662		%&/G&&&&t"0	cc
		! \\	""$    c C  2+7&&54767633#"'&547633##32#&&54767633#32'		
									5		5	   ( c = 22+673:62233#"'&&55#35467632!&5476654&&(#'.  C~	q?x"44l"	z	  & n = '2+46732667632#"&'&&#"3#&5466735&5&'&""&&<-	5/
I3F	 	6	
5$21FD=dL4	 [#	x1   ) c O ^ l 
d`\Q02+473226233#323"##3#&546735##&&#&&'&547667263735#'5#"327&#"326654'&!d8_^9<	;9__9;9		8
d
:<		^=(	)=^		^<*	)<^:



r:;

   % c ] E2+23255#'&547633#327667465663##3#&5466735#"'&'&'&''&&566M$!`^	!$	 O	6	
5	O "
-2
	
1.
"	>&D`	`D&>     n [  2+4632335432##&'&5466767654&'&#"##&''476323254'&'&'&([Ie+

$	II
	@15H
	
II	#

1YsQ4b>!$	 $G.,E'$7K	?0$'E-+D!%&$!>q=   e^  2+#"'&&54767632632@# D *#?+]D
B+!  ]c  2+4632#&&5476675"#"  =1

 *2 >+?f	B+  N9o  2+4632"&'&&'& <`[[T   ,u  .  !&''5<66464676322!5<64647762w		@		vW		 $		,!      |                         C (@?s8e{;	_3wIs		4		
e
'jB.k#q]jt-X(ZdbP^hWn%ay  O O   !!!e!!!""1"b"w""#H##$J$%>%%&W&'q'(%(R({(        _<                 !            2    M      z $ : #    W D &  9  : * c 4 ,  4 - , - .   9 & 9 > ,   (    &  H 9     8  8  4      0  : ) ` 9  0  B  0 #   H 0  3  4  "  H       " 2  1 W h   h   H 0 ` b I  t O 9  W 1  # 8  !  ( & ) %      ,    Z!                          1                       PfEd @  $# 8 Z    ^  c                        .         17  2$#        17  2$#61fN^                                                ,  UXEY  K QKSZX4(Y`f UX%a  cc#b!! Y C#D  C`B-, `f-,#!#!-, d BCC ``BCB%CCTx #CCadPxC`B!e!CCB C#BC`B# PXeYC`B-,+CX#!#!CC# PXeY d P&Z(CEcEEX!%YR[X!#!X PPX!@Y 8PX!8YY CEcEad(PX!CEcE 0PX!0Y PX f a 
PX`  PX!
` 6PX!6``YYY%Cc RX K
PX!CKPX!Ka cCc bYYdaY+YY# PXeYY dC#BY-, E %ad CPX#B#B!!Y`-,#!#!+ dbB #BEXCEcC`Ec*! C  +0%&QX`PaRYX#Y!Y @SX+!@Y# PXeY-,	C+  C`B-,	#B#  #Babfc`*-	,  E Cc b  PX@`Yfc`D`-
,	 CEB*!  C`B-, C#D  C`B-,  E +# C%` E#a d  PX! 0PX @YY# PXeY%#aDD`-,  E +# C%` E#a d$PX @Y# PXeY%#aDD`-,  #B EPX!#!Y*!-,EdaD-,`  CJ PX #BYCJ RX #BY-, bfc  c#aC` ` #B#-,KTXdDY$e#x-,KQXKSXdDY!Y$e#x-, CUXCaB+Y C%B%B%B# %PX C`%B #a*!#a #a*! C`%B%a*!YCGCG`b  PX@`Yfc Cc b  PX@`Yfc`  #DC >C`B-,  ETX#B E#B#`B `   BBB` #Ba++"Y-, +-,+-,+-,+-,+-,+-,+-,+-,+-,	+-+,# bfc`KTX# .]!!Y-,,# bfc`KTX# .q!!Y--,# bfc&`KTX# .r!!Y- , + ETX#B E#B#`B `a  BB`++"Y-!,  +-", +-#, +-$, +-%, +-&, +-', +-(, +-), +-*,	 +-., <`-/, `` C#`C%a`.*!-0,/+/*-1,  G  Cc b  PX@`Yfc`#a8# UX G  Cc b  PX@`Yfc`#a8!Y-2,  ETXEB1*EX0Y"Y-3, + ETXEB1*EX0Y"Y-4, 5`-5, EBEc b  PX@`Yfc+Cc b  PX@`Yfc+      D>#84*!-6, < G Cc b  PX@`Yfc` Ca8-7,.<-8, < G Cc b  PX@`Yfc` CaCc8-9, % . G #B%IG#G#a Xb!Y#B8*-:, #B%%G#G#a BC+e.#  <8-;, #B%% .G#G#a #B BC+ `PX @QX  &YBB# 
C #G#G#a#F`Cb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca#  &#Fa8#
CF%
CG#G#a` Cb  PX@`Yfc`# +#C`+%a%b  PX@`Yfc&a %`d#%`dPX!#!Y#  &#Fa8Y-<, #B   & .G#G#a#<8-=, #B 
#B   F#G+#a8->, #B%%G#G#a TX. <#!%%G#G#a %%G#G#a%%I%a  cc# Xb!Yc b  PX@`Yfc`#.#  <8#!Y-?, #B 
C .G#G#a ` `fb  PX@`Yfc#  <8-@,# .F%FCXPRYX <Y.0+-A,# .F%FCXRPYX <Y.0+-B,# .F%FCXPRYX <Y# .F%FCXRPYX <Y.0+-C,:+# .F%FCXPRYX <Y.0+-D,;+  <#B8# .F%FCXPRYX <Y.0+C.0+-E, %&   F#Ga#B.G#G#aC+# < .#80+-F,
%B %% .G#G#a #B BC+ `PX @QX  &YBB# GCb  PX@`Yfc` + a C`d#CadPXCaC`Y%b  PX@`Yfca%Fa8# <#8!  F#G+#a8!Y0+-G, :+.0+-H, ;+!#  <#B#80+C.0+-I,  G #B .6*-J,  G #B .6*-K, 7*-L,9*-M, E# . F#a80+-N,
#BM+-O,  F+-P, F+-Q, F+-R,F+-S,  G+-T, G+-U, G+-V,G+-W,   C+-X,  C+-Y,  C+-Z, C+-[,  C+-\, C+-], C+-^,C+-_,  E+-`, E+-a, E+-b,E+-c,  H+-d, H+-e, H+-f,H+-g,   D+-h,  D+-i,  D+-j, D+-k,  D+-l, D+-m, D+-n,D+-o, <+.0+-p, <+@+-q, <+A+-r,  <+B+-s,<+@+-t,<+A+-u, <+B+-v, =+.0+-w, =+@+-x, =+A+-y, =+B+-z,=+@+-{,=+A+-|,=+B+-}, >+.0+-~, >+@+-, >+A+-, >+B+-,>+@+-,>+A+-,>+B+-, ?+.0+-, ?+@+-, ?+A+-, ?+B+-,?+@+-,?+A+-,?+B+-, EPXEX#!!YYB+e$PxEX0Y- K RXY  cp B(  * B
* B%
* 	B    * B @ @  *   D$QX@X  dD(QX X   DY'QX @cTX   DYYYYY* Dd DD                                c   n   T T L Lc c #  dd       	 r  	       	      	     	  P   	  0   	  BP  	  0   	 p  	  4 C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0   D e s i g n   S c i e n c e ,   I n c . 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y K a T e X _ T y p e w r i t e r R e g u l a r F o n t F o r g e   2 . 0   :   K a T e X _ T y p e w r i t e r - R e g u l a r K a T e X _ T y p e w r i t e r - R e g u l a r V e r s i o n   1 . 1 ;   t t f a u t o h i n t   ( v 1 . 8 . 3 ) C o p y r i g h t   ( c )   2 0 0 9 - 2 0 1 0 ,   D e s i g n   S c i e n c e ,   I n c .   ( < w w w . m a t h j a x . o r g > ) 
 C o p y r i g h t   ( c )   2 0 1 4 - 2 0 1 8   K h a n   A c a d e m y   ( < w w w . k h a n a c a d e m y . o r g > ) , 
 w i t h   R e s e r v e d   F o n t   N a m e   K a T e X _ T y p e w r i t e r . 
 
 T h i s   F o n t   S o f t w a r e   i s   l i c e n s e d   u n d e r   t h e   S I L   O p e n   F o n t   L i c e n s e ,   V e r s i o n   1 . 1 . 
 T h i s   l i c e n s e   a v a i l a b l e   w i t h   a   F A Q   a t : 
 h t t p : / / s c r i p t s . s i l . o r g / O F L h t t p : / / s c r i p t s . s i l . o r g / O F L        2                                	 
                        ! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a           	
  uni007Funi00A0uni0237uni02C9uni02CAuni02CBGammauni0394ThetaLambdaXiPiSigmaUpsilonPhiPsiuni03A9minuteuni2423   "YQx>cwOFF     >     k                       OS/2  3L   S   `EKcmap  3      ܂Fcvt   ;   :   Zd~fpgm  4<    b.|gasp  >         glyf  D  /  Q|Z4head  20   6   6a8Bhhea  3,      $(hmtx  2h     ^ loca  1(    7#maxp  1        5name  ;    e߃@post  =p  $  !Jprep  :      ex|ǕvꮪfaܝYhac
s9A阙ꡕc>[uWt꽯zz$AU@ԝj)~B^>؂L!%-ڸhЧRZ0ITi6Z(<&ę	i%T2_DZԔƟ\2U'=!ߋ\a=!h	^Uc7eJZi_Pn,O(˾'"ot`;LϚל1fSƊخ7[f\ez[zEO{VZEsZ.&0FqS`7uXgb"iIR2HVΐD\g|(" Ab7s$<kpߏ2(aӭ;C$'}MBLl]#KV|H?xWh3=ºᜠԉe8t]eDQ[ЎJj]Tx(cs3	'i~֣Fʭng20cJ,xؚ**r^{欨.jL&@d<Y*iBf@Ep:|5tL쪏.r ${7ߛMс#-`l Ŵw"ukؓ)#Śq挖P| 45&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n?ӄhʝLӥRzR  x}|/* stylelint-disable font-family-no-missing-generic-family-keyword */
@font-face {
  font-family: "KaTeX_AMS";
  src: url(fonts/KaTeX_AMS-Regular.woff2) format("woff2"), url(fonts/KaTeX_AMS-Regular.woff) format("woff"), url(fonts/KaTeX_AMS-Regular.ttf) format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "KaTeX_Caligraphic";
  src: url(fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"), url(fonts/KaTeX_Caligraphic-Bold.woff) format("woff"), url(fonts/KaTeX_Caligraphic-Bold.ttf) format("truetype");
  font-weight: bold;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "KaTeX_Caligraphic";
  src: url(fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"), url(fonts/KaTeX_Caligraphic-Regular.woff) format("woff"), url(fonts/KaTeX_Caligraphic-Regular.ttf) format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "KaTeX_Fraktur";
  src: url(fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"), url(fonts/KaTeX_Fraktur-Bold.woff) format("woff"), url(fonts/KaTeX_Fraktur-Bold.ttf) format("truetype");
  font-weight: bold;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "KaTeX_Fraktur";
  src: url(fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"), url(fonts/KaTeX_Fraktur-Regular.woff) format("woff"), url(fonts/KaTeX_Fraktur-Regular.ttf) format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "KaTeX_Main";
  src: url(fonts/KaTeX_Main-Bold.woff2) format("woff2"), url(fonts/KaTeX_Main-Bold.woff) format("woff"), url(fonts/KaTeX_Main-Bold.ttf) format("truetype");
  font-weight: bold;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "KaTeX_Main";
  src: url(fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"), url(fonts/KaTeX_Main-BoldItalic.woff) format("woff"), url(fonts/KaTeX_Main-BoldItalic.ttf) format("truetype");
  font-weight: bold;
  font-style: italic;
  font-display: block;
}
@font-face {
  font-family: "KaTeX_Main";
  src: url(fonts/KaTeX_Main-Italic.woff2) format("woff2"), url(fonts/KaTeX_Main-Italic.woff) format("woff"), url(fonts/KaTeX_Main-Italic.ttf) format("truetype");
  font-weight: normal;
  font-style: italic;
  font-display: block;
}
@font-face {
  font-family: "KaTeX_Main";
  src: url(fonts/KaTeX_Main-Regular.woff2) format("woff2"), url(fonts/KaTeX_Main-Regular.woff) format("woff"), url(fonts/KaTeX_Main-Regular.ttf) format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "KaTeX_Math";
  src: url(fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"), url(fonts/KaTeX_Math-BoldItalic.woff) format("woff"), url(fonts/KaTeX_Math-BoldItalic.ttf) format("truetype");
  font-weight: bold;
  font-style: italic;
  font-display: block;
}
@font-face {
  font-family: "KaTeX_Math";
  src: url(fonts/KaTeX_Math-Italic.woff2) format("woff2"), url(fonts/KaTeX_Math-Italic.woff) format("woff"), url(fonts/KaTeX_Math-Italic.ttf) format("truetype");
  font-weight: normal;
  font-style: italic;
  font-display: block;
}
@font-face {
  font-family: "KaTeX_SansSerif";
  src: url(fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"), url(fonts/KaTeX_SansSerif-Bold.woff) format("woff"), url(fonts/KaTeX_SansSerif-Bold.ttf) format("truetype");
  font-weight: bold;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "KaTeX_SansSerif";
  src: url(fonts/KaTeX_SansSerif-Italic.woff2) format("woff2"), url(fonts/KaTeX_SansSerif-Italic.woff) format("woff"), url(fonts/KaTeX_SansSerif-Italic.ttf) format("truetype");
  font-weight: normal;
  font-style: italic;
  font-display: block;
}
@font-face {
  font-family: "KaTeX_SansSerif";
  src: url(fonts/KaTeX_SansSerif-Regular.woff2) format("woff2"), url(fonts/KaTeX_SansSerif-Regular.woff) format("woff"), url(fonts/KaTeX_SansSerif-Regular.ttf) format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "KaTeX_Script";
  src: url(fonts/KaTeX_Script-Regular.woff2) format("woff2"), url(fonts/KaTeX_Script-Regular.woff) format("woff"), url(fonts/KaTeX_Script-Regular.ttf) format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "KaTeX_Size1";
  src: url(fonts/KaTeX_Size1-Regular.woff2) format("woff2"), url(fonts/KaTeX_Size1-Regular.woff) format("woff"), url(fonts/KaTeX_Size1-Regular.ttf) format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "KaTeX_Size2";
  src: url(fonts/KaTeX_Size2-Regular.woff2) format("woff2"), url(fonts/KaTeX_Size2-Regular.woff) format("woff"), url(fonts/KaTeX_Size2-Regular.ttf) format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "KaTeX_Size3";
  src: url(fonts/KaTeX_Size3-Regular.woff2) format("woff2"), url(fonts/KaTeX_Size3-Regular.woff) format("woff"), url(fonts/KaTeX_Size3-Regular.ttf) format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "KaTeX_Size4";
  src: url(fonts/KaTeX_Size4-Regular.woff2) format("woff2"), url(fonts/KaTeX_Size4-Regular.woff) format("woff"), url(fonts/KaTeX_Size4-Regular.ttf) format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}
@font-face {
  font-family: "KaTeX_Typewriter";
  src: url(fonts/KaTeX_Typewriter-Regular.woff2) format("woff2"), url(fonts/KaTeX_Typewriter-Regular.woff) format("woff"), url(fonts/KaTeX_Typewriter-Regular.ttf) format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: block;
}
/* stylelint-disable font-family-no-missing-generic-family-keyword */
.katex {
  font: normal 1.21em KaTeX_Main, Times New Roman, serif;
  line-height: 1.2;
  position: relative;
  text-indent: 0;
  text-rendering: auto;
}
.katex * {
  -ms-high-contrast-adjust: none !important;
}
.katex * {
  border-color: currentColor;
}
.katex .katex-version::after {
  content: "0.16.47";
}
.katex .katex-mathml {
  /* Accessibility hack to only show to screen readers
   Found at: http://a11yproject.com/posts/how-to-hide-content/ */
  position: absolute;
  -webkit-clip-path: inset(50%);
          clip-path: inset(50%);
  padding: 0;
  border: 0;
  height: 1px;
  width: 1px;
  overflow: hidden;
}
.katex .katex-html {
  /* \newline is an empty block at top level, between .base elements */
}
.katex .katex-html > .newline {
  display: block;
}
.katex .base {
  position: relative;
  display: inline-block;
  white-space: nowrap;
  width: -webkit-min-content;
  width: -moz-min-content;
  width: min-content;
}
.katex .strut {
  display: inline-block;
}
.katex .textbf {
  font-weight: bold;
}
.katex .textit {
  font-style: italic;
}
.katex .textrm {
  font-family: KaTeX_Main;
}
.katex .textsf {
  font-family: KaTeX_SansSerif;
}
.katex .texttt {
  font-family: KaTeX_Typewriter;
}
.katex .mathnormal {
  font-family: KaTeX_Math;
  font-style: italic;
}
.katex .mathit {
  font-family: KaTeX_Main;
  font-style: italic;
}
.katex .mathrm {
  font-style: normal;
}
.katex .mathbf {
  font-family: KaTeX_Main;
  font-weight: bold;
}
.katex .boldsymbol {
  font-family: KaTeX_Math;
  font-weight: bold;
  font-style: italic;
}
.katex .amsrm {
  font-family: KaTeX_AMS;
}
.katex .mathbb,
.katex .textbb {
  font-family: KaTeX_AMS;
}
.katex .mathcal {
  font-family: KaTeX_Caligraphic;
}
.katex .mathfrak,
.katex .textfrak {
  font-family: KaTeX_Fraktur;
}
.katex .mathboldfrak,
.katex .textboldfrak {
  font-family: KaTeX_Fraktur;
  font-weight: bold;
}
.katex .mathtt {
  font-family: KaTeX_Typewriter;
}
.katex .mathscr,
.katex .textscr {
  font-family: KaTeX_Script;
}
.katex .mathsf,
.katex .textsf {
  font-family: KaTeX_SansSerif;
}
.katex .mathboldsf,
.katex .textboldsf {
  font-family: KaTeX_SansSerif;
  font-weight: bold;
}
.katex .mathsfit,
.katex .mathitsf,
.katex .textitsf {
  font-family: KaTeX_SansSerif;
  font-style: italic;
}
.katex .mainrm {
  font-family: KaTeX_Main;
  font-style: normal;
}
.katex .vlist-t {
  display: inline-table;
  table-layout: fixed;
  border-collapse: collapse;
}
.katex .vlist-r {
  display: table-row;
}
.katex .vlist {
  display: table-cell;
  vertical-align: bottom;
  position: relative;
}
.katex .vlist > span {
  display: block;
  height: 0;
  position: relative;
}
.katex .vlist > span > span {
  display: inline-block;
}
.katex .vlist > span > .pstrut {
  overflow: hidden;
  width: 0;
}
.katex .vlist-t2 {
  margin-right: -2px;
}
.katex .vlist-s {
  display: table-cell;
  vertical-align: bottom;
  font-size: 1px;
  width: 2px;
  min-width: 2px;
}
.katex .vbox {
  display: inline-flex;
  flex-direction: column;
  align-items: baseline;
}
.katex .hbox {
  display: inline-flex;
  flex-direction: row;
  width: 100%;
}
.katex .thinbox {
  display: inline-flex;
  flex-direction: row;
  width: 0;
  max-width: 0;
}
.katex .msupsub {
  text-align: left;
}
.katex .mfrac > span > span {
  text-align: center;
}
.katex .mfrac .frac-line {
  display: inline-block;
  width: 100%;
  border-bottom-style: solid;
}
.katex .mfrac .frac-line,
.katex .overline .overline-line,
.katex .underline .underline-line,
.katex .hline,
.katex .hdashline,
.katex .rule {
  min-height: 1px;
}
.katex .mspace {
  display: inline-block;
}
.katex .smash {
  display: inline;
  line-height: 0;
}
.katex .llap,
.katex .rlap,
.katex .clap {
  width: 0;
  position: relative;
}
.katex .llap > .inner,
.katex .rlap > .inner,
.katex .clap > .inner {
  position: absolute;
}
.katex .llap > .fix,
.katex .rlap > .fix,
.katex .clap > .fix {
  display: inline-block;
}
.katex .llap > .inner {
  right: 0;
}
.katex .rlap > .inner,
.katex .clap > .inner {
  left: 0;
}
.katex .clap > .inner > span {
  margin-left: -50%;
  margin-right: 50%;
}
.katex .rule {
  display: inline-block;
  border: solid 0;
  position: relative;
}
.katex .overline .overline-line,
.katex .underline .underline-line,
.katex .hline {
  display: inline-block;
  width: 100%;
  border-bottom-style: solid;
}
.katex .hdashline {
  display: inline-block;
  width: 100%;
  border-bottom-style: dashed;
}
.katex .sqrt > .root {
  /* These values are taken from the definition of `\r@@t`,
   `\mkern 5mu` and `\mkern -10mu`. */
  /* stylelint-disable-next-line declaration-property-value-no-unknown */
  margin-left: 0.2777777778em;
  /* stylelint-disable-next-line declaration-property-value-no-unknown */
  margin-right: -0.5555555556em;
}
.katex .sizing.reset-size1.size1,
.katex .fontsize-ensurer.reset-size1.size1 {
  /* stylelint-disable-next-line */
  font-size: 1em;
}
.katex .sizing.reset-size1.size2,
.katex .fontsize-ensurer.reset-size1.size2 {
  /* stylelint-disable-next-line */
  font-size: 1.2em;
}
.katex .sizing.reset-size1.size3,
.katex .fontsize-ensurer.reset-size1.size3 {
  /* stylelint-disable-next-line */
  font-size: 1.4em;
}
.katex .sizing.reset-size1.size4,
.katex .fontsize-ensurer.reset-size1.size4 {
  /* stylelint-disable-next-line */
  font-size: 1.6em;
}
.katex .sizing.reset-size1.size5,
.katex .fontsize-ensurer.reset-size1.size5 {
  /* stylelint-disable-next-line */
  font-size: 1.8em;
}
.katex .sizing.reset-size1.size6,
.katex .fontsize-ensurer.reset-size1.size6 {
  /* stylelint-disable-next-line */
  font-size: 2em;
}
.katex .sizing.reset-size1.size7,
.katex .fontsize-ensurer.reset-size1.size7 {
  /* stylelint-disable-next-line */
  font-size: 2.4em;
}
.katex .sizing.reset-size1.size8,
.katex .fontsize-ensurer.reset-size1.size8 {
  /* stylelint-disable-next-line */
  font-size: 2.88em;
}
.katex .sizing.reset-size1.size9,
.katex .fontsize-ensurer.reset-size1.size9 {
  /* stylelint-disable-next-line */
  font-size: 3.456em;
}
.katex .sizing.reset-size1.size10,
.katex .fontsize-ensurer.reset-size1.size10 {
  /* stylelint-disable-next-line */
  font-size: 4.148em;
}
.katex .sizing.reset-size1.size11,
.katex .fontsize-ensurer.reset-size1.size11 {
  /* stylelint-disable-next-line */
  font-size: 4.976em;
}
.katex .sizing.reset-size2.size1,
.katex .fontsize-ensurer.reset-size2.size1 {
  /* stylelint-disable-next-line */
  font-size: 0.8333333333em;
}
.katex .sizing.reset-size2.size2,
.katex .fontsize-ensurer.reset-size2.size2 {
  /* stylelint-disable-next-line */
  font-size: 1em;
}
.katex .sizing.reset-size2.size3,
.katex .fontsize-ensurer.reset-size2.size3 {
  /* stylelint-disable-next-line */
  font-size: 1.1666666667em;
}
.katex .sizing.reset-size2.size4,
.katex .fontsize-ensurer.reset-size2.size4 {
  /* stylelint-disable-next-line */
  font-size: 1.3333333333em;
}
.katex .sizing.reset-size2.size5,
.katex .fontsize-ensurer.reset-size2.size5 {
  /* stylelint-disable-next-line */
  font-size: 1.5em;
}
.katex .sizing.reset-size2.size6,
.katex .fontsize-ensurer.reset-size2.size6 {
  /* stylelint-disable-next-line */
  font-size: 1.6666666667em;
}
.katex .sizing.reset-size2.size7,
.katex .fontsize-ensurer.reset-size2.size7 {
  /* stylelint-disable-next-line */
  font-size: 2em;
}
.katex .sizing.reset-size2.size8,
.katex .fontsize-ensurer.reset-size2.size8 {
  /* stylelint-disable-next-line */
  font-size: 2.4em;
}
.katex .sizing.reset-size2.size9,
.katex .fontsize-ensurer.reset-size2.size9 {
  /* stylelint-disable-next-line */
  font-size: 2.88em;
}
.katex .sizing.reset-size2.size10,
.katex .fontsize-ensurer.reset-size2.size10 {
  /* stylelint-disable-next-line */
  font-size: 3.4566666667em;
}
.katex .sizing.reset-size2.size11,
.katex .fontsize-ensurer.reset-size2.size11 {
  /* stylelint-disable-next-line */
  font-size: 4.1466666667em;
}
.katex .sizing.reset-size3.size1,
.katex .fontsize-ensurer.reset-size3.size1 {
  /* stylelint-disable-next-line */
  font-size: 0.7142857143em;
}
.katex .sizing.reset-size3.size2,
.katex .fontsize-ensurer.reset-size3.size2 {
  /* stylelint-disable-next-line */
  font-size: 0.8571428571em;
}
.katex .sizing.reset-size3.size3,
.katex .fontsize-ensurer.reset-size3.size3 {
  /* stylelint-disable-next-line */
  font-size: 1em;
}
.katex .sizing.reset-size3.size4,
.katex .fontsize-ensurer.reset-size3.size4 {
  /* stylelint-disable-next-line */
  font-size: 1.1428571429em;
}
.katex .sizing.reset-size3.size5,
.katex .fontsize-ensurer.reset-size3.size5 {
  /* stylelint-disable-next-line */
  font-size: 1.2857142857em;
}
.katex .sizing.reset-size3.size6,
.katex .fontsize-ensurer.reset-size3.size6 {
  /* stylelint-disable-next-line */
  font-size: 1.4285714286em;
}
.katex .sizing.reset-size3.size7,
.katex .fontsize-ensurer.reset-size3.size7 {
  /* stylelint-disable-next-line */
  font-size: 1.7142857143em;
}
.katex .sizing.reset-size3.size8,
.katex .fontsize-ensurer.reset-size3.size8 {
  /* stylelint-disable-next-line */
  font-size: 2.0571428571em;
}
.katex .sizing.reset-size3.size9,
.katex .fontsize-ensurer.reset-size3.size9 {
  /* stylelint-disable-next-line */
  font-size: 2.4685714286em;
}
.katex .sizing.reset-size3.size10,
.katex .fontsize-ensurer.reset-size3.size10 {
  /* stylelint-disable-next-line */
  font-size: 2.9628571429em;
}
.katex .sizing.reset-size3.size11,
.katex .fontsize-ensurer.reset-size3.size11 {
  /* stylelint-disable-next-line */
  font-size: 3.5542857143em;
}
.katex .sizing.reset-size4.size1,
.katex .fontsize-ensurer.reset-size4.size1 {
  /* stylelint-disable-next-line */
  font-size: 0.625em;
}
.katex .sizing.reset-size4.size2,
.katex .fontsize-ensurer.reset-size4.size2 {
  /* stylelint-disable-next-line */
  font-size: 0.75em;
}
.katex .sizing.reset-size4.size3,
.katex .fontsize-ensurer.reset-size4.size3 {
  /* stylelint-disable-next-line */
  font-size: 0.875em;
}
.katex .sizing.reset-size4.size4,
.katex .fontsize-ensurer.reset-size4.size4 {
  /* stylelint-disable-next-line */
  font-size: 1em;
}
.katex .sizing.reset-size4.size5,
.katex .fontsize-ensurer.reset-size4.size5 {
  /* stylelint-disable-next-line */
  font-size: 1.125em;
}
.katex .sizing.reset-size4.size6,
.katex .fontsize-ensurer.reset-size4.size6 {
  /* stylelint-disable-next-line */
  font-size: 1.25em;
}
.katex .sizing.reset-size4.size7,
.katex .fontsize-ensurer.reset-size4.size7 {
  /* stylelint-disable-next-line */
  font-size: 1.5em;
}
.katex .sizing.reset-size4.size8,
.katex .fontsize-ensurer.reset-size4.size8 {
  /* stylelint-disable-next-line */
  font-size: 1.8em;
}
.katex .sizing.reset-size4.size9,
.katex .fontsize-ensurer.reset-size4.size9 {
  /* stylelint-disable-next-line */
  font-size: 2.16em;
}
.katex .sizing.reset-size4.size10,
.katex .fontsize-ensurer.reset-size4.size10 {
  /* stylelint-disable-next-line */
  font-size: 2.5925em;
}
.katex .sizing.reset-size4.size11,
.katex .fontsize-ensurer.reset-size4.size11 {
  /* stylelint-disable-next-line */
  font-size: 3.11em;
}
.katex .sizing.reset-size5.size1,
.katex .fontsize-ensurer.reset-size5.size1 {
  /* stylelint-disable-next-line */
  font-size: 0.5555555556em;
}
.katex .sizing.reset-size5.size2,
.katex .fontsize-ensurer.reset-size5.size2 {
  /* stylelint-disable-next-line */
  font-size: 0.6666666667em;
}
.katex .sizing.reset-size5.size3,
.katex .fontsize-ensurer.reset-size5.size3 {
  /* stylelint-disable-next-line */
  font-size: 0.7777777778em;
}
.katex .sizing.reset-size5.size4,
.katex .fontsize-ensurer.reset-size5.size4 {
  /* stylelint-disable-next-line */
  font-size: 0.8888888889em;
}
.katex .sizing.reset-size5.size5,
.katex .fontsize-ensurer.reset-size5.size5 {
  /* stylelint-disable-next-line */
  font-size: 1em;
}
.katex .sizing.reset-size5.size6,
.katex .fontsize-ensurer.reset-size5.size6 {
  /* stylelint-disable-next-line */
  font-size: 1.1111111111em;
}
.katex .sizing.reset-size5.size7,
.katex .fontsize-ensurer.reset-size5.size7 {
  /* stylelint-disable-next-line */
  font-size: 1.3333333333em;
}
.katex .sizing.reset-size5.size8,
.katex .fontsize-ensurer.reset-size5.size8 {
  /* stylelint-disable-next-line */
  font-size: 1.6em;
}
.katex .sizing.reset-size5.size9,
.katex .fontsize-ensurer.reset-size5.size9 {
  /* stylelint-disable-next-line */
  font-size: 1.92em;
}
.katex .sizing.reset-size5.size10,
.katex .fontsize-ensurer.reset-size5.size10 {
  /* stylelint-disable-next-line */
  font-size: 2.3044444444em;
}
.katex .sizing.reset-size5.size11,
.katex .fontsize-ensurer.reset-size5.size11 {
  /* stylelint-disable-next-line */
  font-size: 2.7644444444em;
}
.katex .sizing.reset-size6.size1,
.katex .fontsize-ensurer.reset-size6.size1 {
  /* stylelint-disable-next-line */
  font-size: 0.5em;
}
.katex .sizing.reset-size6.size2,
.katex .fontsize-ensurer.reset-size6.size2 {
  /* stylelint-disable-next-line */
  font-size: 0.6em;
}
.katex .sizing.reset-size6.size3,
.katex .fontsize-ensurer.reset-size6.size3 {
  /* stylelint-disable-next-line */
  font-size: 0.7em;
}
.katex .sizing.reset-size6.size4,
.katex .fontsize-ensurer.reset-size6.size4 {
  /* stylelint-disable-next-line */
  font-size: 0.8em;
}
.katex .sizing.reset-size6.size5,
.katex .fontsize-ensurer.reset-size6.size5 {
  /* stylelint-disable-next-line */
  font-size: 0.9em;
}
.katex .sizing.reset-size6.size6,
.katex .fontsize-ensurer.reset-size6.size6 {
  /* stylelint-disable-next-line */
  font-size: 1em;
}
.katex .sizing.reset-size6.size7,
.katex .fontsize-ensurer.reset-size6.size7 {
  /* stylelint-disable-next-line */
  font-size: 1.2em;
}
.katex .sizing.reset-size6.size8,
.katex .fontsize-ensurer.reset-size6.size8 {
  /* stylelint-disable-next-line */
  font-size: 1.44em;
}
.katex .sizing.reset-size6.size9,
.katex .fontsize-ensurer.reset-size6.size9 {
  /* stylelint-disable-next-line */
  font-size: 1.728em;
}
.katex .sizing.reset-size6.size10,
.katex .fontsize-ensurer.reset-size6.size10 {
  /* stylelint-disable-next-line */
  font-size: 2.074em;
}
.katex .sizing.reset-size6.size11,
.katex .fontsize-ensurer.reset-size6.size11 {
  /* stylelint-disable-next-line */
  font-size: 2.488em;
}
.katex .sizing.reset-size7.size1,
.katex .fontsize-ensurer.reset-size7.size1 {
  /* stylelint-disable-next-line */
  font-size: 0.4166666667em;
}
.katex .sizing.reset-size7.size2,
.katex .fontsize-ensurer.reset-size7.size2 {
  /* stylelint-disable-next-line */
  font-size: 0.5em;
}
.katex .sizing.reset-size7.size3,
.katex .fontsize-ensurer.reset-size7.size3 {
  /* stylelint-disable-next-line */
  font-size: 0.5833333333em;
}
.katex .sizing.reset-size7.size4,
.katex .fontsize-ensurer.reset-size7.size4 {
  /* stylelint-disable-next-line */
  font-size: 0.6666666667em;
}
.katex .sizing.reset-size7.size5,
.katex .fontsize-ensurer.reset-size7.size5 {
  /* stylelint-disable-next-line */
  font-size: 0.75em;
}
.katex .sizing.reset-size7.size6,
.katex .fontsize-ensurer.reset-size7.size6 {
  /* stylelint-disable-next-line */
  font-size: 0.8333333333em;
}
.katex .sizing.reset-size7.size7,
.katex .fontsize-ensurer.reset-size7.size7 {
  /* stylelint-disable-next-line */
  font-size: 1em;
}
.katex .sizing.reset-size7.size8,
.katex .fontsize-ensurer.reset-size7.size8 {
  /* stylelint-disable-next-line */
  font-size: 1.2em;
}
.katex .sizing.reset-size7.size9,
.katex .fontsize-ensurer.reset-size7.size9 {
  /* stylelint-disable-next-line */
  font-size: 1.44em;
}
.katex .sizing.reset-size7.size10,
.katex .fontsize-ensurer.reset-size7.size10 {
  /* stylelint-disable-next-line */
  font-size: 1.7283333333em;
}
.katex .sizing.reset-size7.size11,
.katex .fontsize-ensurer.reset-size7.size11 {
  /* stylelint-disable-next-line */
  font-size: 2.0733333333em;
}
.katex .sizing.reset-size8.size1,
.katex .fontsize-ensurer.reset-size8.size1 {
  /* stylelint-disable-next-line */
  font-size: 0.3472222222em;
}
.katex .sizing.reset-size8.size2,
.katex .fontsize-ensurer.reset-size8.size2 {
  /* stylelint-disable-next-line */
  font-size: 0.4166666667em;
}
.katex .sizing.reset-size8.size3,
.katex .fontsize-ensurer.reset-size8.size3 {
  /* stylelint-disable-next-line */
  font-size: 0.4861111111em;
}
.katex .sizing.reset-size8.size4,
.katex .fontsize-ensurer.reset-size8.size4 {
  /* stylelint-disable-next-line */
  font-size: 0.5555555556em;
}
.katex .sizing.reset-size8.size5,
.katex .fontsize-ensurer.reset-size8.size5 {
  /* stylelint-disable-next-line */
  font-size: 0.625em;
}
.katex .sizing.reset-size8.size6,
.katex .fontsize-ensurer.reset-size8.size6 {
  /* stylelint-disable-next-line */
  font-size: 0.6944444444em;
}
.katex .sizing.reset-size8.size7,
.katex .fontsize-ensurer.reset-size8.size7 {
  /* stylelint-disable-next-line */
  font-size: 0.8333333333em;
}
.katex .sizing.reset-size8.size8,
.katex .fontsize-ensurer.reset-size8.size8 {
  /* stylelint-disable-next-line */
  font-size: 1em;
}
.katex .sizing.reset-size8.size9,
.katex .fontsize-ensurer.reset-size8.size9 {
  /* stylelint-disable-next-line */
  font-size: 1.2em;
}
.katex .sizing.reset-size8.size10,
.katex .fontsize-ensurer.reset-size8.size10 {
  /* stylelint-disable-next-line */
  font-size: 1.4402777778em;
}
.katex .sizing.reset-size8.size11,
.katex .fontsize-ensurer.reset-size8.size11 {
  /* stylelint-disable-next-line */
  font-size: 1.7277777778em;
}
.katex .sizing.reset-size9.size1,
.katex .fontsize-ensurer.reset-size9.size1 {
  /* stylelint-disable-next-line */
  font-size: 0.2893518519em;
}
.katex .sizing.reset-size9.size2,
.katex .fontsize-ensurer.reset-size9.size2 {
  /* stylelint-disable-next-line */
  font-size: 0.3472222222em;
}
.katex .sizing.reset-size9.size3,
.katex .fontsize-ensurer.reset-size9.size3 {
  /* stylelint-disable-next-line */
  font-size: 0.4050925926em;
}
.katex .sizing.reset-size9.size4,
.katex .fontsize-ensurer.reset-size9.size4 {
  /* stylelint-disable-next-line */
  font-size: 0.462962963em;
}
.katex .sizing.reset-size9.size5,
.katex .fontsize-ensurer.reset-size9.size5 {
  /* stylelint-disable-next-line */
  font-size: 0.5208333333em;
}
.katex .sizing.reset-size9.size6,
.katex .fontsize-ensurer.reset-size9.size6 {
  /* stylelint-disable-next-line */
  font-size: 0.5787037037em;
}
.katex .sizing.reset-size9.size7,
.katex .fontsize-ensurer.reset-size9.size7 {
  /* stylelint-disable-next-line */
  font-size: 0.6944444444em;
}
.katex .sizing.reset-size9.size8,
.katex .fontsize-ensurer.reset-size9.size8 {
  /* stylelint-disable-next-line */
  font-size: 0.8333333333em;
}
.katex .sizing.reset-size9.size9,
.katex .fontsize-ensurer.reset-size9.size9 {
  /* stylelint-disable-next-line */
  font-size: 1em;
}
.katex .sizing.reset-size9.size10,
.katex .fontsize-ensurer.reset-size9.size10 {
  /* stylelint-disable-next-line */
  font-size: 1.2002314815em;
}
.katex .sizing.reset-size9.size11,
.katex .fontsize-ensurer.reset-size9.size11 {
  /* stylelint-disable-next-line */
  font-size: 1.4398148148em;
}
.katex .sizing.reset-size10.size1,
.katex .fontsize-ensurer.reset-size10.size1 {
  /* stylelint-disable-next-line */
  font-size: 0.2410800386em;
}
.katex .sizing.reset-size10.size2,
.katex .fontsize-ensurer.reset-size10.size2 {
  /* stylelint-disable-next-line */
  font-size: 0.2892960463em;
}
.katex .sizing.reset-size10.size3,
.katex .fontsize-ensurer.reset-size10.size3 {
  /* stylelint-disable-next-line */
  font-size: 0.337512054em;
}
.katex .sizing.reset-size10.size4,
.katex .fontsize-ensurer.reset-size10.size4 {
  /* stylelint-disable-next-line */
  font-size: 0.3857280617em;
}
.katex .sizing.reset-size10.size5,
.katex .fontsize-ensurer.reset-size10.size5 {
  /* stylelint-disable-next-line */
  font-size: 0.4339440694em;
}
.katex .sizing.reset-size10.size6,
.katex .fontsize-ensurer.reset-size10.size6 {
  /* stylelint-disable-next-line */
  font-size: 0.4821600771em;
}
.katex .sizing.reset-size10.size7,
.katex .fontsize-ensurer.reset-size10.size7 {
  /* stylelint-disable-next-line */
  font-size: 0.5785920926em;
}
.katex .sizing.reset-size10.size8,
.katex .fontsize-ensurer.reset-size10.size8 {
  /* stylelint-disable-next-line */
  font-size: 0.6943105111em;
}
.katex .sizing.reset-size10.size9,
.katex .fontsize-ensurer.reset-size10.size9 {
  /* stylelint-disable-next-line */
  font-size: 0.8331726133em;
}
.katex .sizing.reset-size10.size10,
.katex .fontsize-ensurer.reset-size10.size10 {
  /* stylelint-disable-next-line */
  font-size: 1em;
}
.katex .sizing.reset-size10.size11,
.katex .fontsize-ensurer.reset-size10.size11 {
  /* stylelint-disable-next-line */
  font-size: 1.1996142719em;
}
.katex .sizing.reset-size11.size1,
.katex .fontsize-ensurer.reset-size11.size1 {
  /* stylelint-disable-next-line */
  font-size: 0.2009646302em;
}
.katex .sizing.reset-size11.size2,
.katex .fontsize-ensurer.reset-size11.size2 {
  /* stylelint-disable-next-line */
  font-size: 0.2411575563em;
}
.katex .sizing.reset-size11.size3,
.katex .fontsize-ensurer.reset-size11.size3 {
  /* stylelint-disable-next-line */
  font-size: 0.2813504823em;
}
.katex .sizing.reset-size11.size4,
.katex .fontsize-ensurer.reset-size11.size4 {
  /* stylelint-disable-next-line */
  font-size: 0.3215434084em;
}
.katex .sizing.reset-size11.size5,
.katex .fontsize-ensurer.reset-size11.size5 {
  /* stylelint-disable-next-line */
  font-size: 0.3617363344em;
}
.katex .sizing.reset-size11.size6,
.katex .fontsize-ensurer.reset-size11.size6 {
  /* stylelint-disable-next-line */
  font-size: 0.4019292605em;
}
.katex .sizing.reset-size11.size7,
.katex .fontsize-ensurer.reset-size11.size7 {
  /* stylelint-disable-next-line */
  font-size: 0.4823151125em;
}
.katex .sizing.reset-size11.size8,
.katex .fontsize-ensurer.reset-size11.size8 {
  /* stylelint-disable-next-line */
  font-size: 0.578778135em;
}
.katex .sizing.reset-size11.size9,
.katex .fontsize-ensurer.reset-size11.size9 {
  /* stylelint-disable-next-line */
  font-size: 0.6945337621em;
}
.katex .sizing.reset-size11.size10,
.katex .fontsize-ensurer.reset-size11.size10 {
  /* stylelint-disable-next-line */
  font-size: 0.8336012862em;
}
.katex .sizing.reset-size11.size11,
.katex .fontsize-ensurer.reset-size11.size11 {
  /* stylelint-disable-next-line */
  font-size: 1em;
}
.katex .delimsizing.size1 {
  font-family: KaTeX_Size1;
}
.katex .delimsizing.size2 {
  font-family: KaTeX_Size2;
}
.katex .delimsizing.size3 {
  font-family: KaTeX_Size3;
}
.katex .delimsizing.size4 {
  font-family: KaTeX_Size4;
}
.katex .delimsizing.mult .delim-size1 > span {
  font-family: KaTeX_Size1;
}
.katex .delimsizing.mult .delim-size4 > span {
  font-family: KaTeX_Size4;
}
.katex .nulldelimiter {
  display: inline-block;
  width: 0.12em;
}
.katex .delimcenter {
  position: relative;
}
.katex .op-symbol {
  position: relative;
}
.katex .op-symbol.small-op {
  font-family: KaTeX_Size1;
}
.katex .op-symbol.large-op {
  font-family: KaTeX_Size2;
}
.katex .op-limits > .vlist-t {
  text-align: center;
}
.katex .accent > .vlist-t {
  text-align: center;
}
.katex .accent .accent-body {
  position: relative;
}
.katex .accent .accent-body:not(.accent-full) {
  width: 0;
}
.katex .overlay {
  display: block;
}
.katex .mtable .vertical-separator {
  display: inline-block;
  min-width: 1px;
}
.katex .mtable .arraycolsep {
  display: inline-block;
}
.katex .mtable .col-align-c > .vlist-t {
  text-align: center;
}
.katex .mtable .col-align-l > .vlist-t {
  text-align: left;
}
.katex .mtable .col-align-r > .vlist-t {
  text-align: right;
}
.katex .svg-align {
  text-align: left;
}
.katex svg {
  display: block;
  position: absolute;
  width: 100%;
  height: inherit;
  fill: currentColor;
  stroke: currentColor;
}
.katex svg path {
  stroke: none;
}
.katex svg {
  fill-rule: nonzero;
  fill-opacity: 1;
  stroke-width: 1;
  stroke-linecap: butt;
  stroke-linejoin: miter;
  stroke-miterlimit: 4;
  stroke-dasharray: none;
  stroke-dashoffset: 0;
  stroke-opacity: 1;
}
.katex img {
  border-style: none;
  min-width: 0;
  min-height: 0;
  max-width: none;
  max-height: none;
}
.katex .stretchy {
  width: 100%;
  display: block;
  position: relative;
  overflow: hidden;
}
.katex .stretchy::before, .katex .stretchy::after {
  content: "";
}
.katex .hide-tail {
  width: 100%;
  position: relative;
  overflow: hidden;
}
.katex .halfarrow-left {
  position: absolute;
  left: 0;
  width: 50.2%;
  overflow: hidden;
}
.katex .halfarrow-right {
  position: absolute;
  right: 0;
  width: 50.2%;
  overflow: hidden;
}
.katex .brace-left {
  position: absolute;
  left: 0;
  width: 25.1%;
  overflow: hidden;
}
.katex .brace-center {
  position: absolute;
  left: 25%;
  width: 50%;
  overflow: hidden;
}
.katex .brace-right {
  position: absolute;
  right: 0;
  width: 25.1%;
  overflow: hidden;
}
.katex .x-arrow-pad {
  padding: 0 0.5em;
}
.katex .cd-arrow-pad {
  padding: 0 0.55556em 0 0.27778em;
}
.katex .x-arrow,
.katex .mover,
.katex .munder {
  text-align: center;
}
.katex .boxpad {
  padding: 0 0.3em;
}
.katex .fbox,
.katex .fcolorbox {
  box-sizing: border-box;
  border: 0.04em solid;
}
.katex .cancel-pad {
  padding: 0 0.2em;
}
.katex .cancel-lap {
  margin-left: -0.2em;
  margin-right: -0.2em;
}
.katex .sout {
  border-bottom-style: solid;
  border-bottom-width: 0.08em;
}
.katex .angl {
  box-sizing: border-box;
  border-top: 0.049em solid;
  border-right: 0.049em solid;
  margin-right: 0.03889em;
}
.katex .anglpad {
  padding: 0 0.03889em;
}
.katex .eqn-num::before {
  counter-increment: katexEqnNo;
  content: "(" counter(katexEqnNo) ")";
}
.katex .mml-eqn-num::before {
  counter-increment: mmlEqnNo;
  content: "(" counter(mmlEqnNo) ")";
}
.katex .mtr-glue {
  width: 50%;
}
.katex .cd-vert-arrow {
  display: inline-block;
  position: relative;
}
.katex .cd-label-left {
  display: inline-block;
  position: absolute;
  right: calc(50% + 0.3em);
  text-align: left;
}
.katex .cd-label-right {
  display: inline-block;
  position: absolute;
  left: calc(50% + 0.3em);
  text-align: right;
}

.katex-display {
  display: block;
  margin: 1em 0;
  text-align: center;
}
.katex-display > .katex {
  display: block;
  text-align: center;
  white-space: nowrap;
}
.katex-display > .katex > .katex-html {
  display: block;
  position: relative;
}
.katex-display > .katex > .katex-html > .tag {
  position: absolute;
  right: 0;
}

.katex-display.leqno > .katex > .katex-html > .tag {
  left: 0;
  right: auto;
}

.katex-display.fleqn > .katex {
  text-align: left;
  padding-left: 2em;
}

body {
  counter-reset: katexEqnNo mmlEqnNo;
}
kx2Nswap'1swap'swap')/	$@/swap'swapswapN9swapJQswapJ	o	swap)W
swap)W
!swap1(,swap1(,swap1(swap1(swap1+swap1+*swap1+Cswap1swap'qswap;
}
)frx]@font-face{font-display:block;font-family:KaTeX_AMS;font-style:normal;font-weight:400;src:url(fonts/KaTeX_AMS-Regular.woff2) format("woff2"),url(fonts/KaTeX_AMS-Regular.woff) format("woff"),url(fonts/KaTeX_AMS-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Caligraphic-Bold.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Bold.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Bold.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Caligraphic;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Caligraphic-Regular.woff2) format("woff2"),url(fonts/KaTeX_Caligraphic-Regular.woff) format("woff"),url(fonts/KaTeX_Caligraphic-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Fraktur-Bold.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Bold.woff) format("woff"),url(fonts/KaTeX_Fraktur-Bold.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Fraktur;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Fraktur-Regular.woff2) format("woff2"),url(fonts/KaTeX_Fraktur-Regular.woff) format("woff"),url(fonts/KaTeX_Fraktur-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:700;src:url(fonts/KaTeX_Main-Bold.woff2) format("woff2"),url(fonts/KaTeX_Main-Bold.woff) format("woff"),url(fonts/KaTeX_Main-Bold.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Main-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Main-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Main-BoldItalic.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Main-Italic.woff2) format("woff2"),url(fonts/KaTeX_Main-Italic.woff) format("woff"),url(fonts/KaTeX_Main-Italic.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Main;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Main-Regular.woff2) format("woff2"),url(fonts/KaTeX_Main-Regular.woff) format("woff"),url(fonts/KaTeX_Main-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:700;src:url(fonts/KaTeX_Math-BoldItalic.woff2) format("woff2"),url(fonts/KaTeX_Math-BoldItalic.woff) format("woff"),url(fonts/KaTeX_Math-BoldItalic.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Math;font-style:italic;font-weight:400;src:url(fonts/KaTeX_Math-Italic.woff2) format("woff2"),url(fonts/KaTeX_Math-Italic.woff) format("woff"),url(fonts/KaTeX_Math-Italic.ttf) format("truetype")}@font-face{font-display:block;font-family:"KaTeX_SansSerif";font-style:normal;font-weight:700;src:url(fonts/KaTeX_SansSerif-Bold.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Bold.woff) format("woff"),url(fonts/KaTeX_SansSerif-Bold.ttf) format("truetype")}@font-face{font-display:block;font-family:"KaTeX_SansSerif";font-style:italic;font-weight:400;src:url(fonts/KaTeX_SansSerif-Italic.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Italic.woff) format("woff"),url(fonts/KaTeX_SansSerif-Italic.ttf) format("truetype")}@font-face{font-display:block;font-family:"KaTeX_SansSerif";font-style:normal;font-weight:400;src:url(fonts/KaTeX_SansSerif-Regular.woff2) format("woff2"),url(fonts/KaTeX_SansSerif-Regular.woff) format("woff"),url(fonts/KaTeX_SansSerif-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Script;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Script-Regular.woff2) format("woff2"),url(fonts/KaTeX_Script-Regular.woff) format("woff"),url(fonts/KaTeX_Script-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size1;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size1-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size1-Regular.woff) format("woff"),url(fonts/KaTeX_Size1-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size2;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size2-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size2-Regular.woff) format("woff"),url(fonts/KaTeX_Size2-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size3;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size3-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size3-Regular.woff) format("woff"),url(fonts/KaTeX_Size3-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Size4;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Size4-Regular.woff2) format("woff2"),url(fonts/KaTeX_Size4-Regular.woff) format("woff"),url(fonts/KaTeX_Size4-Regular.ttf) format("truetype")}@font-face{font-display:block;font-family:KaTeX_Typewriter;font-style:normal;font-weight:400;src:url(fonts/KaTeX_Typewriter-Regular.woff2) format("woff2"),url(fonts/KaTeX_Typewriter-Regular.woff) format("woff"),url(fonts/KaTeX_Typewriter-Regular.ttf) format("truetype")}.katex{font:normal 1.21em KaTeX_Main,Times New Roman,serif;line-height:1.2;position:relative;text-indent:0;text-rendering:auto}.katex *{-ms-high-contrast-adjust:none!important;border-color:currentColor}.katex .katex-version:after{content:"0.16.47"}.katex .katex-mathml{border:0;-webkit-clip-path:inset(50%);clip-path:inset(50%);height:1px;overflow:hidden;padding:0;position:absolute;width:1px}.katex .katex-html>.newline{display:block}.katex .base{position:relative;white-space:nowrap;width:-webkit-min-content;width:-moz-min-content;width:min-content}.katex .base,.katex .strut{display:inline-block}.katex .textbf{font-weight:700}.katex .textit{font-style:italic}.katex .textrm{font-family:KaTeX_Main}.katex .textsf{font-family:KaTeX_SansSerif}.katex .texttt{font-family:KaTeX_Typewriter}.katex .mathnormal{font-family:KaTeX_Math;font-style:italic}.katex .mathit{font-family:KaTeX_Main;font-style:italic}.katex .mathrm{font-style:normal}.katex .mathbf{font-family:KaTeX_Main;font-weight:700}.katex .boldsymbol{font-family:KaTeX_Math;font-style:italic;font-weight:700}.katex .amsrm,.katex .mathbb,.katex .textbb{font-family:KaTeX_AMS}.katex .mathcal{font-family:KaTeX_Caligraphic}.katex .mathfrak,.katex .textfrak{font-family:KaTeX_Fraktur}.katex .mathboldfrak,.katex .textboldfrak{font-family:KaTeX_Fraktur;font-weight:700}.katex .mathtt{font-family:KaTeX_Typewriter}.katex .mathscr,.katex .textscr{font-family:KaTeX_Script}.katex .mathsf,.katex .textsf{font-family:KaTeX_SansSerif}.katex .mathboldsf,.katex .textboldsf{font-family:KaTeX_SansSerif;font-weight:700}.katex .mathitsf,.katex .mathsfit,.katex .textitsf{font-family:KaTeX_SansSerif;font-style:italic}.katex .mainrm{font-family:KaTeX_Main;font-style:normal}.katex .vlist-t{border-collapse:collapse;display:inline-table;table-layout:fixed}.katex .vlist-r{display:table-row}.katex .vlist{display:table-cell;position:relative;vertical-align:bottom}.katex .vlist>span{display:block;height:0;position:relative}.katex .vlist>span>span{display:inline-block}.katex .vlist>span>.pstrut{overflow:hidden;width:0}.katex .vlist-t2{margin-right:-2px}.katex .vlist-s{display:table-cell;font-size:1px;min-width:2px;vertical-align:bottom;width:2px}.katex .vbox{align-items:baseline;display:inline-flex;flex-direction:column}.katex .hbox{width:100%}.katex .hbox,.katex .thinbox{display:inline-flex;flex-direction:row}.katex .thinbox{max-width:0;width:0}.katex .msupsub{text-align:left}.katex .mfrac>span>span{text-align:center}.katex .mfrac .frac-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline,.katex .hline,.katex .mfrac .frac-line,.katex .overline .overline-line,.katex .rule,.katex .underline .underline-line{min-height:1px}.katex .mspace{display:inline-block}.katex .smash{display:inline;line-height:0}.katex .clap,.katex .llap,.katex .rlap{position:relative;width:0}.katex .clap>.inner,.katex .llap>.inner,.katex .rlap>.inner{position:absolute}.katex .clap>.fix,.katex .llap>.fix,.katex .rlap>.fix{display:inline-block}.katex .llap>.inner{right:0}.katex .clap>.inner,.katex .rlap>.inner{left:0}.katex .clap>.inner>span{margin-left:-50%;margin-right:50%}.katex .rule{border:0 solid;display:inline-block;position:relative}.katex .hline,.katex .overline .overline-line,.katex .underline .underline-line{border-bottom-style:solid;display:inline-block;width:100%}.katex .hdashline{border-bottom-style:dashed;display:inline-block;width:100%}.katex .sqrt>.root{margin-left:.2777777778em;margin-right:-.5555555556em}.katex .fontsize-ensurer.reset-size1.size1,.katex .sizing.reset-size1.size1{font-size:1em}.katex .fontsize-ensurer.reset-size1.size2,.katex .sizing.reset-size1.size2{font-size:1.2em}.katex .fontsize-ensurer.reset-size1.size3,.katex .sizing.reset-size1.size3{font-size:1.4em}.katex .fontsize-ensurer.reset-size1.size4,.katex .sizing.reset-size1.size4{font-size:1.6em}.katex .fontsize-ensurer.reset-size1.size5,.katex .sizing.reset-size1.size5{font-size:1.8em}.katex .fontsize-ensurer.reset-size1.size6,.katex .sizing.reset-size1.size6{font-size:2em}.katex .fontsize-ensurer.reset-size1.size7,.katex .sizing.reset-size1.size7{font-size:2.4em}.katex .fontsize-ensurer.reset-size1.size8,.katex .sizing.reset-size1.size8{font-size:2.88em}.katex .fontsize-ensurer.reset-size1.size9,.katex .sizing.reset-size1.size9{font-size:3.456em}.katex .fontsize-ensurer.reset-size1.size10,.katex .sizing.reset-size1.size10{font-size:4.148em}.katex .fontsize-ensurer.reset-size1.size11,.katex .sizing.reset-size1.size11{font-size:4.976em}.katex .fontsize-ensurer.reset-size2.size1,.katex .sizing.reset-size2.size1{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size2.size2,.katex .sizing.reset-size2.size2{font-size:1em}.katex .fontsize-ensurer.reset-size2.size3,.katex .sizing.reset-size2.size3{font-size:1.1666666667em}.katex .fontsize-ensurer.reset-size2.size4,.katex .sizing.reset-size2.size4{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size2.size5,.katex .sizing.reset-size2.size5{font-size:1.5em}.katex .fontsize-ensurer.reset-size2.size6,.katex .sizing.reset-size2.size6{font-size:1.6666666667em}.katex .fontsize-ensurer.reset-size2.size7,.katex .sizing.reset-size2.size7{font-size:2em}.katex .fontsize-ensurer.reset-size2.size8,.katex .sizing.reset-size2.size8{font-size:2.4em}.katex .fontsize-ensurer.reset-size2.size9,.katex .sizing.reset-size2.size9{font-size:2.88em}.katex .fontsize-ensurer.reset-size2.size10,.katex .sizing.reset-size2.size10{font-size:3.4566666667em}.katex .fontsize-ensurer.reset-size2.size11,.katex .sizing.reset-size2.size11{font-size:4.1466666667em}.katex .fontsize-ensurer.reset-size3.size1,.katex .sizing.reset-size3.size1{font-size:.7142857143em}.katex .fontsize-ensurer.reset-size3.size2,.katex .sizing.reset-size3.size2{font-size:.8571428571em}.katex .fontsize-ensurer.reset-size3.size3,.katex .sizing.reset-size3.size3{font-size:1em}.katex .fontsize-ensurer.reset-size3.size4,.katex .sizing.reset-size3.size4{font-size:1.1428571429em}.katex .fontsize-ensurer.reset-size3.size5,.katex .sizing.reset-size3.size5{font-size:1.2857142857em}.katex .fontsize-ensurer.reset-size3.size6,.katex .sizing.reset-size3.size6{font-size:1.4285714286em}.katex .fontsize-ensurer.reset-size3.size7,.katex .sizing.reset-size3.size7{font-size:1.7142857143em}.katex .fontsize-ensurer.reset-size3.size8,.katex .sizing.reset-size3.size8{font-size:2.0571428571em}.katex .fontsize-ensurer.reset-size3.size9,.katex .sizing.reset-size3.size9{font-size:2.4685714286em}.katex .fontsize-ensurer.reset-size3.size10,.katex .sizing.reset-size3.size10{font-size:2.9628571429em}.katex .fontsize-ensurer.reset-size3.size11,.katex .sizing.reset-size3.size11{font-size:3.5542857143em}.katex .fontsize-ensurer.reset-size4.size1,.katex .sizing.reset-size4.size1{font-size:.625em}.katex .fontsize-ensurer.reset-size4.size2,.katex .sizing.reset-size4.size2{font-size:.75em}.katex .fontsize-ensurer.reset-size4.size3,.katex .sizing.reset-size4.size3{font-size:.875em}.katex .fontsize-ensurer.reset-size4.size4,.katex .sizing.reset-size4.size4{font-size:1em}.katex .fontsize-ensurer.reset-size4.size5,.katex .sizing.reset-size4.size5{font-size:1.125em}.katex .fontsize-ensurer.reset-size4.size6,.katex .sizing.reset-size4.size6{font-size:1.25em}.katex .fontsize-ensurer.reset-size4.size7,.katex .sizing.reset-size4.size7{font-size:1.5em}.katex .fontsize-ensurer.reset-size4.size8,.katex .sizing.reset-size4.size8{font-size:1.8em}.katex .fontsize-ensurer.reset-size4.size9,.katex .sizing.reset-size4.size9{font-size:2.16em}.katex .fontsize-ensurer.reset-size4.size10,.katex .sizing.reset-size4.size10{font-size:2.5925em}.katex .fontsize-ensurer.reset-size4.size11,.katex .sizing.reset-size4.size11{font-size:3.11em}.katex .fontsize-ensurer.reset-size5.size1,.katex .sizing.reset-size5.size1{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size5.size2,.katex .sizing.reset-size5.size2{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size5.size3,.katex .sizing.reset-size5.size3{font-size:.7777777778em}.katex .fontsize-ensurer.reset-size5.size4,.katex .sizing.reset-size5.size4{font-size:.8888888889em}.katex .fontsize-ensurer.reset-size5.size5,.katex .sizing.reset-size5.size5{font-size:1em}.katex .fontsize-ensurer.reset-size5.size6,.katex .sizing.reset-size5.size6{font-size:1.1111111111em}.katex .fontsize-ensurer.reset-size5.size7,.katex .sizing.reset-size5.size7{font-size:1.3333333333em}.katex .fontsize-ensurer.reset-size5.size8,.katex .sizing.reset-size5.size8{font-size:1.6em}.katex .fontsize-ensurer.reset-size5.size9,.katex .sizing.reset-size5.size9{font-size:1.92em}.katex .fontsize-ensurer.reset-size5.size10,.katex .sizing.reset-size5.size10{font-size:2.3044444444em}.katex .fontsize-ensurer.reset-size5.size11,.katex .sizing.reset-size5.size11{font-size:2.7644444444em}.katex .fontsize-ensurer.reset-size6.size1,.katex .sizing.reset-size6.size1{font-size:.5em}.katex .fontsize-ensurer.reset-size6.size2,.katex .sizing.reset-size6.size2{font-size:.6em}.katex .fontsize-ensurer.reset-size6.size3,.katex .sizing.reset-size6.size3{font-size:.7em}.katex .fontsize-ensurer.reset-size6.size4,.katex .sizing.reset-size6.size4{font-size:.8em}.katex .fontsize-ensurer.reset-size6.size5,.katex .sizing.reset-size6.size5{font-size:.9em}.katex .fontsize-ensurer.reset-size6.size6,.katex .sizing.reset-size6.size6{font-size:1em}.katex .fontsize-ensurer.reset-size6.size7,.katex .sizing.reset-size6.size7{font-size:1.2em}.katex .fontsize-ensurer.reset-size6.size8,.katex .sizing.reset-size6.size8{font-size:1.44em}.katex .fontsize-ensurer.reset-size6.size9,.katex .sizing.reset-size6.size9{font-size:1.728em}.katex .fontsize-ensurer.reset-size6.size10,.katex .sizing.reset-size6.size10{font-size:2.074em}.katex .fontsize-ensurer.reset-size6.size11,.katex .sizing.reset-size6.size11{font-size:2.488em}.katex .fontsize-ensurer.reset-size7.size1,.katex .sizing.reset-size7.size1{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size7.size2,.katex .sizing.reset-size7.size2{font-size:.5em}.katex .fontsize-ensurer.reset-size7.size3,.katex .sizing.reset-size7.size3{font-size:.5833333333em}.katex .fontsize-ensurer.reset-size7.size4,.katex .sizing.reset-size7.size4{font-size:.6666666667em}.katex .fontsize-ensurer.reset-size7.size5,.katex .sizing.reset-size7.size5{font-size:.75em}.katex .fontsize-ensurer.reset-size7.size6,.katex .sizing.reset-size7.size6{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size7.size7,.katex .sizing.reset-size7.size7{font-size:1em}.katex .fontsize-ensurer.reset-size7.size8,.katex .sizing.reset-size7.size8{font-size:1.2em}.katex .fontsize-ensurer.reset-size7.size9,.katex .sizing.reset-size7.size9{font-size:1.44em}.katex .fontsize-ensurer.reset-size7.size10,.katex .sizing.reset-size7.size10{font-size:1.7283333333em}.katex .fontsize-ensurer.reset-size7.size11,.katex .sizing.reset-size7.size11{font-size:2.0733333333em}.katex .fontsize-ensurer.reset-size8.size1,.katex .sizing.reset-size8.size1{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size8.size2,.katex .sizing.reset-size8.size2{font-size:.4166666667em}.katex .fontsize-ensurer.reset-size8.size3,.katex .sizing.reset-size8.size3{font-size:.4861111111em}.katex .fontsize-ensurer.reset-size8.size4,.katex .sizing.reset-size8.size4{font-size:.5555555556em}.katex .fontsize-ensurer.reset-size8.size5,.katex .sizing.reset-size8.size5{font-size:.625em}.katex .fontsize-ensurer.reset-size8.size6,.katex .sizing.reset-size8.size6{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size8.size7,.katex .sizing.reset-size8.size7{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size8.size8,.katex .sizing.reset-size8.size8{font-size:1em}.katex .fontsize-ensurer.reset-size8.size9,.katex .sizing.reset-size8.size9{font-size:1.2em}.katex .fontsize-ensurer.reset-size8.size10,.katex .sizing.reset-size8.size10{font-size:1.4402777778em}.katex .fontsize-ensurer.reset-size8.size11,.katex .sizing.reset-size8.size11{font-size:1.7277777778em}.katex .fontsize-ensurer.reset-size9.size1,.katex .sizing.reset-size9.size1{font-size:.2893518519em}.katex .fontsize-ensurer.reset-size9.size2,.katex .sizing.reset-size9.size2{font-size:.3472222222em}.katex .fontsize-ensurer.reset-size9.size3,.katex .sizing.reset-size9.size3{font-size:.4050925926em}.katex .fontsize-ensurer.reset-size9.size4,.katex .sizing.reset-size9.size4{font-size:.462962963em}.katex .fontsize-ensurer.reset-size9.size5,.katex .sizing.reset-size9.size5{font-size:.5208333333em}.katex .fontsize-ensurer.reset-size9.size6,.katex .sizing.reset-size9.size6{font-size:.5787037037em}.katex .fontsize-ensurer.reset-size9.size7,.katex .sizing.reset-size9.size7{font-size:.6944444444em}.katex .fontsize-ensurer.reset-size9.size8,.katex .sizing.reset-size9.size8{font-size:.8333333333em}.katex .fontsize-ensurer.reset-size9.size9,.katex .sizing.reset-size9.size9{font-size:1em}.katex .fontsize-ensurer.reset-size9.size10,.katex .sizing.reset-size9.size10{font-size:1.2002314815em}.katex .fontsize-ensurer.reset-size9.size11,.katex .sizing.reset-size9.size11{font-size:1.4398148148em}.katex .fontsize-ensurer.reset-size10.size1,.katex .sizing.reset-size10.size1{font-size:.2410800386em}.katex .fontsize-ensurer.reset-size10.size2,.katex .sizing.reset-size10.size2{font-size:.2892960463em}.katex .fontsize-ensurer.reset-size10.size3,.katex .sizing.reset-size10.size3{font-size:.337512054em}.katex .fontsize-ensurer.reset-size10.size4,.katex .sizing.reset-size10.size4{font-size:.3857280617em}.katex .fontsize-ensurer.reset-size10.size5,.katex .sizing.reset-size10.size5{font-size:.4339440694em}.katex .fontsize-ensurer.reset-size10.size6,.katex .sizing.reset-size10.size6{font-size:.4821600771em}.katex .fontsize-ensurer.reset-size10.size7,.katex .sizing.reset-size10.size7{font-size:.5785920926em}.katex .fontsize-ensurer.reset-size10.size8,.katex .sizing.reset-size10.size8{font-size:.6943105111em}.katex .fontsize-ensurer.reset-size10.size9,.katex .sizing.reset-size10.size9{font-size:.8331726133em}.katex .fontsize-ensurer.reset-size10.size10,.katex .sizing.reset-size10.size10{font-size:1em}.katex .fontsize-ensurer.reset-size10.size11,.katex .sizing.reset-size10.size11{font-size:1.1996142719em}.katex .fontsize-ensurer.reset-size11.size1,.katex .sizing.reset-size11.size1{font-size:.2009646302em}.katex .fontsize-ensurer.reset-size11.size2,.katex .sizing.reset-size11.size2{font-size:.2411575563em}.katex .fontsize-ensurer.reset-size11.size3,.katex .sizing.reset-size11.size3{font-size:.2813504823em}.katex .fontsize-ensurer.reset-size11.size4,.katex .sizing.reset-size11.size4{font-size:.3215434084em}.katex .fontsize-ensurer.reset-size11.size5,.katex .sizing.reset-size11.size5{font-size:.3617363344em}.katex .fontsize-ensurer.reset-size11.size6,.katex .sizing.reset-size11.size6{font-size:.4019292605em}.katex .fontsize-ensurer.reset-size11.size7,.katex .sizing.reset-size11.size7{font-size:.4823151125em}.katex .fontsize-ensurer.reset-size11.size8,.katex .sizing.reset-size11.size8{font-size:.578778135em}.katex .fontsize-ensurer.reset-size11.size9,.katex .sizing.reset-size11.size9{font-size:.6945337621em}.katex .fontsize-ensurer.reset-size11.size10,.katex .sizing.reset-size11.size10{font-size:.8336012862em}.katex .fontsize-ensurer.reset-size11.size11,.katex .sizing.reset-size11.size11{font-size:1em}.katex .delimsizing.size1{font-family:KaTeX_Size1}.katex .delimsizing.size2{font-family:KaTeX_Size2}.katex .delimsizing.size3{font-family:KaTeX_Size3}.katex .delimsizing.size4{font-family:KaTeX_Size4}.katex .delimsizing.mult .delim-size1>span{font-family:KaTeX_Size1}.katex .delimsizing.mult .delim-size4>span{font-family:KaTeX_Size4}.katex .nulldelimiter{display:inline-block;width:.12em}.katex .delimcenter,.katex .op-symbol{position:relative}.katex .op-symbol.small-op{font-family:KaTeX_Size1}.katex .op-symbol.large-op{font-family:KaTeX_Size2}.katex .accent>.vlist-t,.katex .op-limits>.vlist-t{text-align:center}.katex .accent .accent-body{position:relative}.katex .accent .accent-body:not(.accent-full){width:0}.katex .overlay{display:block}.katex .mtable .vertical-separator{display:inline-block;min-width:1px}.katex .mtable .arraycolsep{display:inline-block}.katex .mtable .col-align-c>.vlist-t{text-align:center}.katex .mtable .col-align-l>.vlist-t{text-align:left}.katex .mtable .col-align-r>.vlist-t{text-align:right}.katex .svg-align{text-align:left}.katex svg{fill:currentColor;stroke:currentColor;display:block;height:inherit;position:absolute;width:100%}.katex svg path{stroke:none}.katex svg{fill-rule:nonzero;fill-opacity:1;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1}.katex img{border-style:none;max-height:none;max-width:none;min-height:0;min-width:0}.katex .stretchy{display:block;overflow:hidden;position:relative;width:100%}.katex .stretchy:after,.katex .stretchy:before{content:""}.katex .hide-tail{overflow:hidden;position:relative;width:100%}.katex .halfarrow-left{left:0;overflow:hidden;position:absolute;width:50.2%}.katex .halfarrow-right{overflow:hidden;position:absolute;right:0;width:50.2%}.katex .brace-left{left:0;overflow:hidden;position:absolute;width:25.1%}.katex .brace-center{left:25%;overflow:hidden;position:absolute;width:50%}.katex .brace-right{overflow:hidden;position:absolute;right:0;width:25.1%}.katex .x-arrow-pad{padding:0 .5em}.katex .cd-arrow-pad{padding:0 .55556em 0 .27778em}.katex .mover,.katex .munder,.katex .x-arrow{text-align:center}.katex .boxpad{padding:0 .3em}.katex .fbox,.katex .fcolorbox{border:.04em solid;box-sizing:border-box}.katex .cancel-pad{padding:0 .2em}.katex .cancel-lap{margin-left:-.2em;margin-right:-.2em}.katex .sout{border-bottom-style:solid;border-bottom-width:.08em}.katex .angl{border-right:.049em solid;border-top:.049em solid;box-sizing:border-box;margin-right:.03889em}.katex .anglpad{padding:0 .03889em}.katex .eqn-num:before{content:"(" counter(katexEqnNo) ")";counter-increment:katexEqnNo}.katex .mml-eqn-num:before{content:"(" counter(mmlEqnNo) ")";counter-increment:mmlEqnNo}.katex .mtr-glue{width:50%}.katex .cd-vert-arrow{display:inline-block;position:relative}.katex .cd-label-left{display:inline-block;position:absolute;right:calc(50% + .3em);text-align:left}.katex .cd-label-right{display:inline-block;left:calc(50% + .3em);position:absolute;text-align:right}.katex-display{display:block;margin:1em 0;text-align:center}.katex-display>.katex{display:block;text-align:center;white-space:nowrap}.katex-display>.katex>.katex-html{display:block;position:relative}.katex-display>.katex>.katex-html>.tag{position:absolute;right:0}.katex-display.leqno>.katex>.katex-html>.tag{left:0;right:auto}.katex-display.fleqn>.katex{padding-left:2em;text-align:left}body{counter-reset:katexEqnNo mmlEqnNo}

!xiswap0swap+*Lswap+swapJswapJ-Y'eswap#L`	|swap60	pswapswap#+`_swap	swap	!/
swap*LM
Kswapswap*,NswapswapOswapOswapOswapOswapJ5uEx   (function webpackUniversalModuleDefinition(root, factory) {
	if(typeof exports === 'object' && typeof module === 'object')
		module.exports = factory();
	else if(typeof define === 'function' && define.amd)
		define([], factory);
	else if(typeof exports === 'object')
		exports["katex"] = factory();
	else
		root["katex"] = factory();
})((typeof self !== 'undefined' ? self : this), function() {
return /******/ (function() { // webpackBootstrap
/******/ 	"use strict";
/******/ 	// The require scope
/******/ 	var __webpack_require__ = {};
/******/ 	
/************************************************************************/
/******/ 	/* webpack/runtime/define property getters */
/******/ 	!function() {
/******/ 		// define getter functions for harmony exports
/******/ 		__webpack_require__.d = function(exports, definition) {
/******/ 			for(var key in definition) {
/******/ 				if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
/******/ 					Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
/******/ 				}
/******/ 			}
/******/ 		};
/******/ 	}();
/******/ 	
/******/ 	/* webpack/runtime/hasOwnProperty shorthand */
/******/ 	!function() {
/******/ 		__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
/******/ 	}();
/******/ 	
/************************************************************************/
var __webpack_exports__ = {};

// EXPORTS
__webpack_require__.d(__webpack_exports__, {
  "default": function() { return /* binding */ katex_webpack; }
});

;// ./src/ParseError.ts
/**
 * This is the ParseError class, which is the main error thrown by KaTeX
 * functions when something has gone wrong. This is used to distinguish internal
 * errors from errors in the expression that the user provided.
 *
 * If possible, a caller should provide a Token or ParseNode with information
 * about where in the source string the problem occurred.
 */
class ParseError extends Error {
  // The underlying error message without any context added.

  constructor(message,
  // The error message
  token) {
    let error = "KaTeX parse error: " + message;
    let start;
    let end;
    const loc = token && token.loc;
    if (loc && loc.start <= loc.end) {
      // If we have the input and a position, make the error a bit fancier

      // Get the input
      const input = loc.lexer.input;

      // Prepend some information
      start = loc.start;
      end = loc.end;
      if (start === input.length) {
        error += " at end of input: ";
      } else {
        error += " at position " + (start + 1) + ": ";
      }

      // Underline token in question using combining underscores
      const underlined = input.slice(start, end).replace(/[^]/g, "$&\u0332");

      // Extract some context from the input and add it to the error
      let left;
      if (start > 15) {
        left = "…" + input.slice(start - 15, start);
      } else {
        left = input.slice(0, start);
      }
      let right;
      if (end + 15 < input.length) {
        right = input.slice(end, end + 15) + "…";
      } else {
        right = input.slice(end);
      }
      error += left + underlined + right;
    }
    super(error);
    this.name = "ParseError";
    this.position = void 0;
    // Error start position based on passed-in Token or ParseNode.
    this.length = void 0;
    // Length of affected text based on passed-in Token or ParseNode.
    this.rawMessage = void 0;
    Object.setPrototypeOf(this, ParseError.prototype);
    this.position = start;
    if (start != null && end != null) {
      this.length = end - start;
    }
    this.rawMessage = message;
  }
}
/* harmony default export */ var src_ParseError = (ParseError);
;// ./src/utils.ts
/**
 * This file contains a list of utility functions which are useful in other
 * files.
 */

// hyphenate and escape adapted from Facebook's React under Apache 2 license
const uppercase = /([A-Z])/g;
const hyphenate = str => str.replace(uppercase, "-$1").toLowerCase();
const ESCAPE_LOOKUP = {
  "&": "&amp;",
  ">": "&gt;",
  "<": "&lt;",
  "\"": "&quot;",
  "'": "&#x27;"
};
const ESCAPE_REGEX = /[&><"']/g;

/**
 * Escapes text to prevent scripting attacks.
 */
const utils_escape = text => String(text).replace(ESCAPE_REGEX, match => ESCAPE_LOOKUP[match]);

/**
 * Sometimes we want to pull out the innermost element of a group. In most
 * cases, this will just be the group itself, but when ordgroups and colors have
 * a single element, we want to pull that out.
 */
const getBaseElem = group => {
  if (group.type === "ordgroup") {
    if (group.body.length === 1) {
      return getBaseElem(group.body[0]);
    } else {
      return group;
    }
  } else if (group.type === "color") {
    if (group.body.length === 1) {
      return getBaseElem(group.body[0]);
    } else {
      return group;
    }
  } else if (group.type === "font") {
    return getBaseElem(group.body);
  } else {
    return group;
  }
};
const characterNodesTypes = new Set(["mathord", "textord", "atom"]);

/**
 * TeXbook algorithms often reference "character boxes", which are simply groups
 * with a single character in them. To decide if something is a character box,
 * we find its innermost group, and see if it is a single character.
 */
const isCharacterBox = group => characterNodesTypes.has(getBaseElem(group).type);

/**
 * Return the protocol of a URL, or "_relative" if the URL does not specify a
 * protocol (and thus is relative), or `null` if URL has invalid protocol
 * (so should be outright rejected).
 */
const protocolFromUrl = url => {
  // Check for possible leading protocol.
  // https://url.spec.whatwg.org/#url-parsing strips leading whitespace
  // (U+20) or C0 control (U+00-U+1F) characters.
  const protocol = /^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(url);
  if (!protocol) {
    return "_relative";
  }
  // Reject weird colons
  if (protocol[2] !== ":") {
    return null;
  }
  // Reject invalid characters in scheme according to
  // https://datatracker.ietf.org/doc/html/rfc3986#section-3.1
  if (!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(protocol[1])) {
    return null;
  }
  // Lowercase the protocol
  return protocol[1].toLowerCase();
};
;// ./src/Settings.ts
/* eslint no-console:0 */
/**
 * This is a module for storing settings passed into KaTeX. It correctly handles
 * default settings.
 */




/**
 * Union of all values that appear as schema defaults, cliDefaults, or
 * cliProcessor return values.  StrictFunction / TrustFunction are
 * option-value types, not default/schema values, so they are excluded.
 */

// TODO: automatically generate documentation
// TODO: check all properties on Settings exist
// TODO: check the type of a property on Settings matches
const SETTINGS_SCHEMA = {
  displayMode: {
    type: "boolean",
    description: "Render math in display mode, which puts the math in " + "display style (so \\int and \\sum are large, for example), and " + "centers the math on the page on its own line.",
    cli: "-d, --display-mode"
  },
  output: {
    type: {
      enum: ["htmlAndMathml", "html", "mathml"]
    },
    description: "Determines the markup language of the output.",
    cli: "-F, --format <type>"
  },
  leqno: {
    type: "boolean",
    description: "Render display math in leqno style (left-justified tags)."
  },
  fleqn: {
    type: "boolean",
    description: "Render display math flush left."
  },
  throwOnError: {
    type: "boolean",
    default: true,
    cli: "-t, --no-throw-on-error",
    cliDescription: "Render errors (in the color given by --error-color) ins" + "tead of throwing a ParseError exception when encountering an error."
  },
  errorColor: {
    type: "string",
    default: "#cc0000",
    cli: "-c, --error-color <color>",
    cliDescription: "A color string given in the format 'rgb' or 'rrggbb' " + "(no #). This option determines the color of errors rendered by the " + "-t option.",
    cliProcessor: color => "#" + color
  },
  macros: {
    type: "object",
    cli: "-m, --macro <def>",
    cliDescription: "Define custom macro of the form '\\foo:expansion' (use " + "multiple -m arguments for multiple macros).",
    cliDefault: [],
    cliProcessor: (def, defs) => {
      defs.push(def);
      return defs;
    }
  },
  minRuleThickness: {
    type: "number",
    description: "Specifies a minimum thickness, in ems, for fraction lines," + " `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, " + "`\\hdashline`, `\\underline`, `\\overline`, and the borders of " + "`\\fbox`, `\\boxed`, and `\\fcolorbox`.",
    processor: t => Math.max(0, t),
    cli: "--min-rule-thickness <size>",
    cliProcessor: parseFloat
  },
  colorIsTextColor: {
    type: "boolean",
    description: "Makes \\color behave like LaTeX's 2-argument \\textcolor, " + "instead of LaTeX's one-argument \\color mode change.",
    cli: "-b, --color-is-text-color"
  },
  strict: {
    type: [{
      enum: ["warn", "ignore", "error"]
    }, "boolean", "function"],
    description: "Turn on strict / LaTeX faithfulness mode, which throws an " + "error if the input uses features that are not supported by LaTeX.",
    cli: "-S, --strict",
    cliDefault: false
  },
  trust: {
    type: ["boolean", "function"],
    description: "Trust the input, enabling all HTML features such as \\url.",
    cli: "-T, --trust"
  },
  maxSize: {
    type: "number",
    default: Infinity,
    description: "If non-zero, all user-specified sizes, e.g. in " + "\\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, " + "elements and spaces can be arbitrarily large",
    processor: s => Math.max(0, s),
    cli: "-s, --max-size <n>",
    cliProcessor: parseInt
  },
  maxExpand: {
    type: "number",
    default: 1000,
    description: "Limit the number of macro expansions to the specified " + "number, to prevent e.g. infinite macro loops. If set to Infinity, " + "the macro expander will try to fully expand as in LaTeX.",
    processor: n => Math.max(0, n),
    cli: "-e, --max-expand <n>",
    cliProcessor: n => n === "Infinity" ? Infinity : parseInt(n)
  },
  globalGroup: {
    type: "boolean",
    cli: false
  }
};
function getImplicitDefault(type) {
  if (typeof type !== 'string') {
    return type.enum[0];
  }
  switch (type) {
    case 'boolean':
      return false;
    case 'string':
      return '';
    case 'number':
      return 0;
    case 'object':
      return {};
    default:
      throw new Error("Unexpected schema type; settings must declare an explicit default.");
  }
}
function getDefaultValue(schema) {
  if (schema.default !== undefined) {
    return schema.default;
  }
  const type = Array.isArray(schema.type) ? schema.type[0] : schema.type;
  return getImplicitDefault(type);
}
function applySetting(target, prop, options, schema) {
  const optionValue = options[prop];
  target[prop] = optionValue !== undefined ? schema.processor ? schema.processor(optionValue) : optionValue : getDefaultValue(schema);
}

/**
 * The main Settings object
 *
 * The current options stored are:
 *  - displayMode: Whether the expression should be typeset as inline math
 *                 (false, the default), meaning that the math starts in
 *                 \textstyle and is placed in an inline-block); or as display
 *                 math (true), meaning that the math starts in \displaystyle
 *                 and is placed in a block with vertical margin.
 */
class Settings {
  constructor(options) {
    if (options === void 0) {
      options = {};
    }
    this.displayMode = void 0;
    this.output = void 0;
    this.leqno = void 0;
    this.fleqn = void 0;
    this.throwOnError = void 0;
    this.errorColor = void 0;
    this.macros = void 0;
    this.minRuleThickness = void 0;
    this.colorIsTextColor = void 0;
    this.strict = void 0;
    this.trust = void 0;
    this.maxSize = void 0;
    this.maxExpand = void 0;
    this.globalGroup = void 0;
    // allow null options
    options = options || {};
    for (const prop of Object.keys(SETTINGS_SCHEMA)) {
      const schema = SETTINGS_SCHEMA[prop];
      if (schema) {
        // TODO: validate options
        applySetting(this, prop, options, schema);
      }
    }
  }

  /**
   * Report nonstrict (non-LaTeX-compatible) input.
   * Can safely not be called if `this.strict` is false in JavaScript.
   */
  reportNonstrict(errorCode, errorMsg, token) {
    let strict = this.strict;
    if (typeof strict === "function") {
      // Allow return value of strict function to be boolean or string
      // (or null/undefined, meaning no further processing).
      strict = strict(errorCode, errorMsg, token);
    }
    if (!strict || strict === "ignore") {
      return;
    } else if (strict === true || strict === "error") {
      throw new src_ParseError("LaTeX-incompatible input and strict mode is set to 'error': " + (errorMsg + " [" + errorCode + "]"), token);
    } else if (strict === "warn") {
      typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (errorMsg + " [" + errorCode + "]"));
    } else {
      // won't happen in type-safe code
      typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + strict + "': " + errorMsg + " [" + errorCode + "]"));
    }
  }

  /**
   * Check whether to apply strict (LaTeX-adhering) behavior for unusual
   * input (like `\\`).  Unlike `nonstrict`, will not throw an error;
   * instead, "error" translates to a return value of `true`, while "ignore"
   * translates to a return value of `false`.  May still print a warning:
   * "warn" prints a warning and returns `false`.
   * This is for the second category of `errorCode`s listed in the README.
   */
  useStrictBehavior(errorCode, errorMsg, token) {
    let strict = this.strict;
    if (typeof strict === "function") {
      // Allow return value of strict function to be boolean or string
      // (or null/undefined, meaning no further processing).
      // But catch any exceptions thrown by function, treating them
      // like "error".
      try {
        strict = strict(errorCode, errorMsg, token);
      } catch (error) {
        strict = "error";
      }
    }
    if (!strict || strict === "ignore") {
      return false;
    } else if (strict === true || strict === "error") {
      return true;
    } else if (strict === "warn") {
      typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (errorMsg + " [" + errorCode + "]"));
      return false;
    } else {
      // won't happen in type-safe code
      typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + strict + "': " + errorMsg + " [" + errorCode + "]"));
      return false;
    }
  }

  /**
   * Check whether to test potentially dangerous input, and return
   * `true` (trusted) or `false` (untrusted).  The sole argument `context`
   * should be an object with `command` field specifying the relevant LaTeX
   * command (as a string starting with `\`), and any other arguments, etc.
   * If `context` has a `url` field, a `protocol` field will automatically
   * get added by this function (changing the specified object).
   */
  isTrusted(context) {
    if ("url" in context && context.url && !context.protocol) {
      const protocol = protocolFromUrl(context.url);
      if (protocol == null) {
        return false;
      }
      context.protocol = protocol;
    }
    const trust = typeof this.trust === "function" ? this.trust(context) : this.trust;
    return Boolean(trust);
  }
}
;// ./src/Style.ts
/**
 * This file contains information and classes for the various kinds of styles
 * used in TeX. It provides a generic `Style` class, which holds information
 * about a specific style. It then provides instances of all the different kinds
 * of styles possible, and provides functions to move between them and get
 * information about them.
 */

/**
 * The main style class. Contains a unique id for the style, a size (which is
 * the same for cramped and uncramped version of a style), and a cramped flag.
 */
class Style {
  constructor(id, size, cramped) {
    this.id = void 0;
    this.size = void 0;
    this.cramped = void 0;
    this.id = id;
    this.size = size;
    this.cramped = cramped;
  }

  /**
   * Get the style of a superscript given a base in the current style.
   */
  sup() {
    return styles[sup[this.id]];
  }

  /**
   * Get the style of a subscript given a base in the current style.
   */
  sub() {
    return styles[sub[this.id]];
  }

  /**
   * Get the style of a fraction numerator given the fraction in the current
   * style.
   */
  fracNum() {
    return styles[fracNum[this.id]];
  }

  /**
   * Get the style of a fraction denominator given the fraction in the current
   * style.
   */
  fracDen() {
    return styles[fracDen[this.id]];
  }

  /**
   * Get the cramped version of a style (in particular, cramping a cramped style
   * doesn't change the style).
   */
  cramp() {
    return styles[cramp[this.id]];
  }

  /**
   * Get a text or display version of this style.
   */
  text() {
    return styles[Style_text[this.id]];
  }

  /**
   * Return true if this style is tightly spaced (scriptstyle/scriptscriptstyle)
   */
  isTight() {
    return this.size >= 2;
  }
}

// Export an interface for type checking, but don't expose the implementation.
// This way, no more styles can be generated.

// IDs of the different styles
const D = 0;
const Dc = 1;
const T = 2;
const Tc = 3;
const S = 4;
const Sc = 5;
const SS = 6;
const SSc = 7;

// Instances of the different styles
const styles = [new Style(D, 0, false), new Style(Dc, 0, true), new Style(T, 1, false), new Style(Tc, 1, true), new Style(S, 2, false), new Style(Sc, 2, true), new Style(SS, 3, false), new Style(SSc, 3, true)];

// Lookup tables for switching from one style to another
const sup = [S, Sc, S, Sc, SS, SSc, SS, SSc];
const sub = [Sc, Sc, Sc, Sc, SSc, SSc, SSc, SSc];
const fracNum = [T, Tc, S, Sc, SS, SSc, SS, SSc];
const fracDen = [Tc, Tc, Sc, Sc, SSc, SSc, SSc, SSc];
const cramp = [Dc, Dc, Tc, Tc, Sc, Sc, SSc, SSc];
const Style_text = [D, Dc, T, Tc, T, Tc, T, Tc];

// We only export some of the styles.
/* harmony default export */ var src_Style = ({
  DISPLAY: styles[D],
  TEXT: styles[T],
  SCRIPT: styles[S],
  SCRIPTSCRIPT: styles[SS]
});
;// ./src/unicodeScripts.ts
/*
 * This file defines the Unicode scripts and script families that we
 * support. To add new scripts or families, just add a new entry to the
 * scriptData array below. Adding scripts to the scriptData array allows
 * characters from that script to appear in \text{} environments.
 */

/**
 * Each script or script family has a name and an array of blocks.
 * Each block is an array of two numbers which specify the start and
 * end points (inclusive) of a block of Unicode codepoints.
 */

/**
 * Unicode block data for the families of scripts we support in \text{}.
 * Scripts only need to appear here if they do not have font metrics.
 */
const scriptData = [{
  // Latin characters beyond the Latin-1 characters we have metrics for.
  // Needed for Czech, Hungarian and Turkish text, for example.
  name: 'latin',
  blocks: [[0x0100, 0x024f],
  // Latin Extended-A and Latin Extended-B
  [0x0300, 0x036f] // Combining Diacritical marks
  ]
}, {
  // The Cyrillic script used by Russian and related languages.
  // A Cyrillic subset used to be supported as explicitly defined
  // symbols in symbols.js
  name: 'cyrillic',
  blocks: [[0x0400, 0x04ff]]
}, {
  // Armenian
  name: 'armenian',
  blocks: [[0x0530, 0x058F]]
}, {
  // The Brahmic scripts of South and Southeast Asia
  // Devanagari (0900–097F)
  // Bengali (0980–09FF)
  // Gurmukhi (0A00–0A7F)
  // Gujarati (0A80–0AFF)
  // Oriya (0B00–0B7F)
  // Tamil (0B80–0BFF)
  // Telugu (0C00–0C7F)
  // Kannada (0C80–0CFF)
  // Malayalam (0D00–0D7F)
  // Sinhala (0D80–0DFF)
  // Thai (0E00–0E7F)
  // Lao (0E80–0EFF)
  // Tibetan (0F00–0FFF)
  // Myanmar (1000–109F)
  name: 'brahmic',
  blocks: [[0x0900, 0x109F]]
}, {
  name: 'georgian',
  blocks: [[0x10A0, 0x10ff]]
}, {
  // Chinese and Japanese.
  // The "k" in cjk is for Korean, but we've separated Korean out
  name: "cjk",
  blocks: [[0x3000, 0x30FF],
  // CJK symbols and punctuation, Hiragana, Katakana
  [0x4E00, 0x9FAF],
  // CJK ideograms
  [0xFF00, 0xFF60] // Fullwidth punctuation
  // TODO: add halfwidth Katakana and Romanji glyphs
  ]
}, {
  // Korean
  name: 'hangul',
  blocks: [[0xAC00, 0xD7AF]]
}];

/**
 * Given a codepoint, return the name of the script or script family
 * it is from, or null if it is not part of a known block
 */
function scriptFromCodepoint(codepoint) {
  for (let i = 0; i < scriptData.length; i++) {
    const script = scriptData[i];
    for (let i = 0; i < script.blocks.length; i++) {
      const block = script.blocks[i];
      if (codepoint >= block[0] && codepoint <= block[1]) {
        return script.name;
      }
    }
  }
  return null;
}

/**
 * A flattened version of all the supported blocks in a single array.
 * This is an optimization to make supportedCodepoint() fast.
 */
const allBlocks = [];
scriptData.forEach(s => s.blocks.forEach(b => allBlocks.push(...b)));

/**
 * Given a codepoint, return true if it falls within one of the
 * scripts or script families defined above and false otherwise.
 *
 * Micro benchmarks shows that this is faster than
 * /[\u3000-\u30FF\u4E00-\u9FAF\uFF00-\uFF60\uAC00-\uD7AF\u0900-\u109F]/.test()
 * in Firefox, Chrome and Node.
 */
function supportedCodepoint(codepoint) {
  for (let i = 0; i < allBlocks.length; i += 2) {
    if (codepoint >= allBlocks[i] && codepoint <= allBlocks[i + 1]) {
      return true;
    }
  }
  return false;
}
;// ./src/svgGeometry.ts
/**
 * This file provides support to domTree.js and delimiter.js.
 * It's a storehouse of path geometry for SVG images.
 */

// In all paths below, the viewBox-to-em scale is 1000:1.

// Second Brush Stroke
//    Low resolution monitors struggle to display images in fine detail.
//    So browsers apply anti-aliasing. A long straight arrow shaft therefore
//    will sometimes appear as if it has a blurred edge.

//    To mitigate this, these SVG files contain a second "brush-stroke" on the
//    arrow shafts. That is, a second long thin rectangular SVG path has been
//    written directly on top of each arrow shaft. This reinforcement causes
//    some of the screen pixels to display as black instead of the anti-aliased
//    gray pixel that a  single path would generate. So we get arrow shafts
//    whose edges appear to be sharper.
const doubleBrushStroke = svgPath => svgPath + " " + svgPath;
const hLinePad = 80; // padding above a sqrt vinculum. Prevents image cropping.

// The vinculum of a \sqrt can be made thicker by a KaTeX rendering option.
// Think of variable extraVinculum as two detours in the SVG path.
// The detour begins at the lower left of the area labeled extraVinculum below.
// The detour proceeds one extraVinculum distance up and slightly to the right,
// displacing the radiused corner between surd and vinculum. The radius is
// traversed as usual, then the detour resumes. It goes right, to the end of
// the very long vinculum, then down one extraVinculum distance,
// after which it resumes regular path geometry for the radical.
/*                                                  vinculum
                                                   /
         /▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒←extraVinculum
        / █████████████████████←0.04em (40 unit) std vinculum thickness
       / /
      / /
     / /\
    / / surd
*/

const sqrtMain = function (extraVinculum, hLinePad) {
  // sqrtMain path geometry is from glyph U221A in the font KaTeX Main
  return "M95," + (622 + extraVinculum + hLinePad) + "\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl" + extraVinculum / 2.075 + " -" + extraVinculum + "\nc5.3,-9.3,12,-14,20,-14\nH400000v" + (40 + extraVinculum) + "H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM" + (834 + extraVinculum) + " " + hLinePad + "h400000v" + (40 + extraVinculum) + "h-400000z";
};
const sqrtSize1 = function (extraVinculum, hLinePad) {
  // size1 is from glyph U221A in the font KaTeX_Size1-Regular
  return "M263," + (601 + extraVinculum + hLinePad) + "c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl" + extraVinculum / 2.084 + " -" + extraVinculum + "\nc4.7,-7.3,11,-11,19,-11\nH40000v" + (40 + extraVinculum) + "H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM" + (1001 + extraVinculum) + " " + hLinePad + "h400000v" + (40 + extraVinculum) + "h-400000z";
};
const sqrtSize2 = function (extraVinculum, hLinePad) {
  // size2 is from glyph U221A in the font KaTeX_Size2-Regular
  return "M983 " + (10 + extraVinculum + hLinePad) + "\nl" + extraVinculum / 3.13 + " -" + extraVinculum + "\nc4,-6.7,10,-10,18,-10 H400000v" + (40 + extraVinculum) + "\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM" + (1001 + extraVinculum) + " " + hLinePad + "h400000v" + (40 + extraVinculum) + "h-400000z";
};
const sqrtSize3 = function (extraVinculum, hLinePad) {
  // size3 is from glyph U221A in the font KaTeX_Size3-Regular
  return "M424," + (2398 + extraVinculum + hLinePad) + "\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl" + extraVinculum / 4.223 + " -" + extraVinculum + "c4,-6.7,10,-10,18,-10 H400000\nv" + (40 + extraVinculum) + "H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M" + (1001 + extraVinculum) + " " + hLinePad + "\nh400000v" + (40 + extraVinculum) + "h-400000z";
};
const sqrtSize4 = function (extraVinculum, hLinePad) {
  // size4 is from glyph U221A in the font KaTeX_Size4-Regular
  return "M473," + (2713 + extraVinculum + hLinePad) + "\nc339.3,-1799.3,509.3,-2700,510,-2702 l" + extraVinculum / 5.298 + " -" + extraVinculum + "\nc3.3,-7.3,9.3,-11,18,-11 H400000v" + (40 + extraVinculum) + "H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM" + (1001 + extraVinculum) + " " + hLinePad + "h400000v" + (40 + extraVinculum) + "H1017.7z";
};
const phasePath = function (y) {
  const x = y / 2; // x coordinate at top of angle
  return "M400000 " + y + " H0 L" + x + " 0 l65 45 L145 " + (y - 80) + " H400000z";
};
const sqrtTall = function (extraVinculum, hLinePad, viewBoxHeight) {
  // sqrtTall is from glyph U23B7 in the font KaTeX_Size4-Regular
  // One path edge has a variable length. It runs vertically from the vinculum
  // to a point near (14 units) the bottom of the surd. The vinculum
  // is normally 40 units thick. So the length of the line in question is:
  const vertSegment = viewBoxHeight - 54 - hLinePad - extraVinculum;
  return "M702 " + (extraVinculum + hLinePad) + "H400000" + (40 + extraVinculum) + "\nH742v" + vertSegment + "l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 " + hLinePad + "H400000v" + (40 + extraVinculum) + "H742z";
};
const sqrtPath = function (size, extraVinculum, viewBoxHeight) {
  extraVinculum = 1000 * extraVinculum; // Convert from document ems to viewBox.
  let path = "";
  switch (size) {
    case "sqrtMain":
      path = sqrtMain(extraVinculum, hLinePad);
      break;
    case "sqrtSize1":
      path = sqrtSize1(extraVinculum, hLinePad);
      break;
    case "sqrtSize2":
      path = sqrtSize2(extraVinculum, hLinePad);
      break;
    case "sqrtSize3":
      path = sqrtSize3(extraVinculum, hLinePad);
      break;
    case "sqrtSize4":
      path = sqrtSize4(extraVinculum, hLinePad);
      break;
    case "sqrtTall":
      path = sqrtTall(extraVinculum, hLinePad, viewBoxHeight);
  }
  return path;
};
const innerPath = function (name, height) {
  // The inner part of stretchy tall delimiters
  switch (name) {
    case "\u239c":
      return doubleBrushStroke("M291 0 H417 V" + height + " H291z");
    case "\u2223":
      return doubleBrushStroke("M145 0 H188 V" + height + " H145z");
    case "\u2225":
      return doubleBrushStroke("M145 0 H188 V" + height + " H145z") + doubleBrushStroke("M367 0 H410 V" + height + " H367z");
    case "\u239f":
      return doubleBrushStroke("M457 0 H583 V" + height + " H457z");
    case "\u23a2":
      return doubleBrushStroke("M319 0 H403 V" + height + " H319z");
    case "\u23a5":
      return doubleBrushStroke("M263 0 H347 V" + height + " H263z");
    case "\u23aa":
      return doubleBrushStroke("M384 0 H504 V" + height + " H384z");
    case "\u23d0":
      return doubleBrushStroke("M312 0 H355 V" + height + " H312z");
    case "\u2016":
      return doubleBrushStroke("M257 0 H300 V" + height + " H257z") + doubleBrushStroke("M478 0 H521 V" + height + " H478z");
    default:
      return "";
  }
};
const path = {
  // The doubleleftarrow geometry is from glyph U+21D0 in the font KaTeX Main
  doubleleftarrow: "M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",
  // doublerightarrow is from glyph U+21D2 in font KaTeX Main
  doublerightarrow: "M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",
  // leftarrow is from glyph U+2190 in font KaTeX Main
  leftarrow: "M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",
  // overbrace is from glyphs U+23A9/23A8/23A7 in font KaTeX_Size4-Regular
  leftbrace: "M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",
  leftbraceunder: "M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",
  // overgroup is from the MnSymbol package (public domain)
  leftgroup: "M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",
  leftgroupunder: "M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",
  // Harpoons are from glyph U+21BD in font KaTeX Main
  leftharpoon: "M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",
  leftharpoonplus: "M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",
  leftharpoondown: "M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",
  leftharpoondownplus: "M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",
  // hook is from glyph U+21A9 in font KaTeX Main
  lefthook: "M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",
  leftlinesegment: doubleBrushStroke("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),
  leftbracketunder: doubleBrushStroke("M0 0 h120 V290 H399995 v120 H0z"),
  leftbracketover: doubleBrushStroke("M0 440 h120 V150 H399995 v-120 H0z"),
  leftmapsto: doubleBrushStroke("M40 281 V448H0V74H40V241H400000v40z"),
  // tofrom is from glyph U+21C4 in font KaTeX AMS Regular
  leftToFrom: "M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",
  longequal: doubleBrushStroke("M0 50 h400000 v40H0z m0 194h40000v40H0z"),
  midbrace: "M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",
  midbraceunder: "M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",
  oiintSize1: "M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",
  oiintSize2: "M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",
  oiiintSize1: "M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",
  oiiintSize2: "M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",
  rightarrow: "M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",
  rightbrace: "M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",
  rightbraceunder: "M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",
  rightgroup: "M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",
  rightgroupunder: "M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",
  rightharpoon: "M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",
  rightharpoonplus: "M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",
  rightharpoondown: "M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",
  rightharpoondownplus: "M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",
  righthook: "M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",
  rightlinesegment: doubleBrushStroke("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),
  rightbracketunder: doubleBrushStroke("M399995 0 h-120 V290 H0 v120 H400000z"),
  rightbracketover: doubleBrushStroke("M399995 440 h-120 V150 H0 v-120 H399995z"),
  rightToFrom: "M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",
  // twoheadleftarrow is from glyph U+219E in font KaTeX AMS Regular
  twoheadleftarrow: "M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",
  twoheadrightarrow: "M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",
  // tilde1 is a modified version of a glyph from the MnSymbol package
  tilde1: "M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",
  // ditto tilde2, tilde3, & tilde4
  tilde2: "M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",
  tilde3: "M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",
  tilde4: "M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",
  // vec is from glyph U+20D7 in font KaTeX Main
  vec: "M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",
  // widehat1 is a modified version of a glyph from the MnSymbol package
  widehat1: "M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",
  // ditto widehat2, widehat3, & widehat4
  widehat2: "M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",
  widehat3: "M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",
  widehat4: "M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",
  // widecheck paths are all inverted versions of widehat
  widecheck1: "M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",
  widecheck2: "M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",
  widecheck3: "M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",
  widecheck4: "M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",
  // The next ten paths support reaction arrows from the mhchem package.

  // Arrows for \ce{<-->} are offset from xAxis by 0.22ex, per mhchem in LaTeX
  // baraboveleftarrow is mostly from glyph U+2190 in font KaTeX Main
  baraboveleftarrow: "M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",
  // rightarrowabovebar is mostly from glyph U+2192, KaTeX Main
  rightarrowabovebar: "M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",
  // The short left harpoon has 0.5em (i.e. 500 units) kern on the left end.
  // Ref from mhchem.sty: \rlap{\raisebox{-.22ex}{$\kern0.5em
  baraboveshortleftharpoon: "M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",
  rightharpoonaboveshortbar: "M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",
  shortbaraboveleftharpoon: "M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",
  shortrightharpoonabovebar: "M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"
};
const tallDelim = function (label, midHeight) {
  switch (label) {
    case "lbrack":
      return "M403 1759 V84 H666 V0 H319 V1759 v" + midHeight + " v1759 v84 h347 v-84\nH403z M403 1759 V0 H319 V1759 v" + midHeight + " v1759 v84 h84z";
    case "rbrack":
      return "M347 1759 V0 H0 V84 H263 V1759 v" + midHeight + " v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v" + midHeight + " v1759 h84z";
    case "vert":
      return "M145 15 v585 v" + midHeight + " v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v" + -midHeight + " v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v" + midHeight + " v585 h43z";
    case "doublevert":
      return "M145 15 v585 v" + midHeight + " v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v" + -midHeight + " v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v" + midHeight + " v585 h43z\nM367 15 v585 v" + midHeight + " v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v" + -midHeight + " v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v" + midHeight + " v585 h43z";
    case "lfloor":
      return "M319 602 V0 H403 V602 v" + midHeight + " v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v" + midHeight + " v1715 H319z";
    case "rfloor":
      return "M319 602 V0 H403 V602 v" + midHeight + " v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v" + midHeight + " v1715 H319z";
    case "lceil":
      return "M403 1759 V84 H666 V0 H319 V1759 v" + midHeight + " v602 h84z\nM403 1759 V0 H319 V1759 v" + midHeight + " v602 h84z";
    case "rceil":
      return "M347 1759 V0 H0 V84 H263 V1759 v" + midHeight + " v602 h84z\nM347 1759 V0 h-84 V1759 v" + midHeight + " v602 h84z";
    case "lparen":
      return "M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0," + (midHeight + 84) + "c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-" + (midHeight + 92) + "c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";
    case "rparen":
      return "M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0," + (midHeight + 9) + "\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-" + (midHeight + 144) + "c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";
    default:
      // We should not ever get here.
      throw new Error("Unknown stretchy delimiter.");
  }
};
;// ./src/tree.ts
// To ensure that all nodes have compatible signatures for these methods.

function isMathDomNode(node) {
  return 'toText' in node;
}

/**
 * This node represents a document fragment, which contains elements, but when
 * placed into the DOM doesn't have any representation itself. It only contains
 * children and doesn't have any DOM node properties.
 */
class DocumentFragment {
  // Never used; needed for satisfying interface.

  constructor(children) {
    this.children = void 0;
    this.classes = void 0;
    this.height = void 0;
    this.depth = void 0;
    this.maxFontSize = void 0;
    this.style = void 0;
    this.children = children;
    this.classes = [];
    this.height = 0;
    this.depth = 0;
    this.maxFontSize = 0;
    this.style = {};
  }
  hasClass(className) {
    return this.classes.includes(className);
  }

  /** Convert the fragment into a node. */
  toNode() {
    const frag = document.createDocumentFragment();
    for (let i = 0; i < this.children.length; i++) {
      frag.appendChild(this.children[i].toNode());
    }
    return frag;
  }

  /** Convert the fragment into HTML markup. */
  toMarkup() {
    let markup = "";

    // Simply concatenate the markup for the children together.
    for (let i = 0; i < this.children.length; i++) {
      markup += this.children[i].toMarkup();
    }
    return markup;
  }

  /**
   * Converts the math node into a string, similar to innerText. Applies to
   * MathDomNode's only.
   */
  toText() {
    return this.children.map(child => {
      if (isMathDomNode(child)) {
        return child.toText();
      }
      throw new Error("Expected MathDomNode with toText, got " + child.constructor.name);
    }).join("");
  }
}
;// ./src/units.ts
/**
 * This file does conversion between units.  In particular, it provides
 * calculateSize to convert other units into ems.
 */


// This table gives the number of TeX pts in one of each *absolute* TeX unit.
// Thus, multiplying a length by this number converts the length from units
// into pts.  Dividing the result by ptPerEm gives the number of ems
// *assuming* a font size of ptPerEm (normal size, normal style).
const ptPerUnit = {
  // https://en.wikibooks.org/wiki/LaTeX/Lengths and
  // https://tex.stackexchange.com/a/8263
  "pt": 1,
  // TeX point
  "mm": 7227 / 2540,
  // millimeter
  "cm": 7227 / 254,
  // centimeter
  "in": 72.27,
  // inch
  "bp": 803 / 800,
  // big (PostScript) points
  "pc": 12,
  // pica
  "dd": 1238 / 1157,
  // didot
  "cc": 14856 / 1157,
  // cicero (12 didot)
  "nd": 685 / 642,
  // new didot
  "nc": 1370 / 107,
  // new cicero (12 new didot)
  "sp": 1 / 65536,
  // scaled point (TeX's internal smallest unit)
  // https://tex.stackexchange.com/a/41371
  "px": 803 / 800 // \pdfpxdimen defaults to 1 bp in pdfTeX and LuaTeX
};

// Dictionary of relative units, for fast validity testing.
const relativeUnit = {
  "ex": true,
  "em": true,
  "mu": true
};
/**
 * Determine whether the specified unit (either a string defining the unit
 * or a "size" parse node containing a unit field) is valid.
 */
const validUnit = function (unit) {
  if (typeof unit !== "string") {
    unit = unit.unit;
  }
  return unit in ptPerUnit || unit in relativeUnit || unit === "ex";
};

/*
 * Convert a "size" parse node (with numeric "number" and string "unit" fields,
 * as parsed by functions.js argType "size") into a CSS em value for the
 * current style/scale.  `options` gives the current options.
 */
const calculateSize = function (sizeValue, options) {
  let scale;
  if (sizeValue.unit in ptPerUnit) {
    // Absolute units
    scale = ptPerUnit[sizeValue.unit] // Convert unit to pt
    / options.fontMetrics().ptPerEm // Convert pt to CSS em
    / options.sizeMultiplier; // Unscale to make absolute units
  } else if (sizeValue.unit === "mu") {
    // `mu` units scale with scriptstyle/scriptscriptstyle.
    scale = options.fontMetrics().cssEmPerMu;
  } else {
    // Other relative units always refer to the *textstyle* font
    // in the current size.
    let unitOptions;
    if (options.style.isTight()) {
      // isTight() means current style is script/scriptscript.
      unitOptions = options.havingStyle(options.style.text());
    } else {
      unitOptions = options;
    }
    // TODO: In TeX these units are relative to the quad of the current
    // *text* font, e.g. cmr10. KaTeX instead uses values from the
    // comparably-sized *Computer Modern symbol* font. At 10pt, these
    // match. At 7pt and 5pt, they differ: cmr7=1.138894, cmsy7=1.170641;
    // cmr5=1.361133, cmsy5=1.472241. Consider $\scriptsize a\kern1emb$.
    // TeX \showlists shows a kern of 1.13889 * fontsize;
    // KaTeX shows a kern of 1.171 * fontsize.
    if (sizeValue.unit === "ex") {
      scale = unitOptions.fontMetrics().xHeight;
    } else if (sizeValue.unit === "em") {
      scale = unitOptions.fontMetrics().quad;
    } else {
      throw new src_ParseError("Invalid unit: '" + sizeValue.unit + "'");
    }
    if (unitOptions !== options) {
      scale *= unitOptions.sizeMultiplier / options.sizeMultiplier;
    }
  }
  return Math.min(sizeValue.number * scale, options.maxSize);
};

/**
 * Round `n` to 4 decimal places, or to the nearest 1/10,000th em. See
 * https://github.com/KaTeX/KaTeX/pull/2460.
 */
const makeEm = function (n) {
  return +n.toFixed(4) + "em";
};
;// ./src/domTree.ts
/**
 * These objects store the data about the DOM nodes we create, as well as some
 * extra data. They can then be transformed into real DOM nodes with the
 * `toNode` function or HTML markup using `toMarkup`. They are useful for both
 * storing extra properties on the nodes, as well as providing a way to easily
 * work with the DOM.
 *
 * Similar functions for working with MathML nodes exist in mathMLTree.js.
 *
 * TODO: refactor `span` and `anchor` into common superclass when
 * target environments support class inheritance
 */






/**
 * Create an HTML className based on a list of classes. In addition to joining
 * with spaces, we also remove empty classes.
 */
const createClass = function (classes) {
  return classes.filter(cls => cls).join(" ");
};

/**
 * Serialize a CssStyle object into a semicolon-delimited inline-style string
 * (hyphenating camelCase property names). Returns "" when no property is set.
 */
const cssStyleToString = function (style) {
  let styles = "";
  for (const key of Object.keys(style)) {
    const value = style[key];
    if (value !== undefined) {
      styles += hyphenate(key) + ":" + value + ";";
    }
  }
  return styles;
};
const initNode = function (classes, options, style) {
  this.classes = classes || [];
  this.attributes = {};
  this.height = 0;
  this.depth = 0;
  this.maxFontSize = 0;
  this.style = style || {};
  if (options) {
    if (options.style.isTight()) {
      this.classes.push("mtight");
    }
    const color = options.getColor();
    if (color) {
      this.style.color = color;
    }
  }
};

/**
 * Convert into an HTML node
 */
const toNode = function (tagName) {
  const node = document.createElement(tagName);

  // Apply the class
  node.className = createClass(this.classes);

  // Apply inline styles
  Object.assign(node.style, this.style);

  // Apply attributes
  for (const attr of Object.keys(this.attributes)) {
    node.setAttribute(attr, this.attributes[attr]);
  }

  // Append the children, also as HTML nodes
  for (let i = 0; i < this.children.length; i++) {
    node.appendChild(this.children[i].toNode());
  }
  return node;
};

/**
 * https://w3c.github.io/html-reference/syntax.html#syntax-attributes
 *
 * > Attribute Names must consist of one or more characters
 * other than the space characters, U+0000 NULL,
 * '"', "'", ">", "/", "=", the control characters,
 * and any characters that are not defined by Unicode.
 */
const invalidAttributeNameRegex = /[\s"'>/=\x00-\x1f]/;

/**
 * Convert into an HTML markup string
 */
const toMarkup = function (tagName) {
  let markup = "<" + tagName;

  // Add the class
  if (this.classes.length) {
    markup += " class=\"" + utils_escape(createClass(this.classes)) + "\"";
  }
  const styles = cssStyleToString(this.style);
  if (styles) {
    markup += " style=\"" + utils_escape(styles) + "\"";
  }

  // Add the attributes
  for (const attr of Object.keys(this.attributes)) {
    if (invalidAttributeNameRegex.test(attr)) {
      throw new src_ParseError("Invalid attribute name '" + attr + "'");
    }
    markup += " " + attr + "=\"" + utils_escape(this.attributes[attr]) + "\"";
  }
  markup += ">";

  // Add the markup of the children, also as markup
  for (let i = 0; i < this.children.length; i++) {
    markup += this.children[i].toMarkup();
  }
  markup += "</" + tagName + ">";
  return markup;
};

// Making the type below exact with all optional fields doesn't work due to
// - https://github.com/facebook/flow/issues/4582
// - https://github.com/facebook/flow/issues/5688
// However, since *all* fields are optional, $Shape<> works as suggested in 5688
// above.
// This type does not include all CSS properties. Additional properties should
// be added as needed.

// Span wrapping other DOM nodes.

// Span wrapping an SVG node.

/**
 * This node represents a span node, with a className, a list of children, and
 * an inline style. It also contains information about its height, depth, and
 * maxFontSize.
 *
 * Represents two types with different uses: SvgSpan to wrap an SVG and DomSpan
 * otherwise. This typesafety is important when HTML builders access a span's
 * children.
 */
class Span {
  constructor(classes, children, options, style) {
    this.children = void 0;
    this.attributes = void 0;
    this.classes = void 0;
    this.height = void 0;
    this.depth = void 0;
    this.width = void 0;
    this.maxFontSize = void 0;
    this.style = void 0;
    /**
     * Italic correction carried over from a SymbolNode when the symbol is
     * wrapped in a vlist (e.g. \oiint / \oiiint).  Read by supsub to adjust
     * subscript positioning.  Only set when nonzero; use `?? 0` at read sites.
     */
    this.italic = void 0;
    initNode.call(this, classes, options, style);
    this.children = children || [];
  }

  /**
   * Sets an arbitrary attribute on the span. Warning: use this wisely. Not
   * all browsers support attributes the same, and having too many custom
   * attributes is probably bad.
   */
  setAttribute(attribute, value) {
    this.attributes[attribute] = value;
  }
  hasClass(className) {
    return this.classes.includes(className);
  }
  toNode() {
    return toNode.call(this, "span");
  }
  toMarkup() {
    return toMarkup.call(this, "span");
  }
}

/**
 * This node represents an anchor (<a>) element with a hyperlink.  See `span`
 * for further details.
 */
class Anchor {
  constructor(href, classes, children, options) {
    this.children = void 0;
    this.attributes = void 0;
    this.classes = void 0;
    this.height = void 0;
    this.depth = void 0;
    this.maxFontSize = void 0;
    this.style = void 0;
    initNode.call(this, classes, options);
    this.children = children || [];
    this.setAttribute('href', href);
  }
  setAttribute(attribute, value) {
    this.attributes[attribute] = value;
  }
  hasClass(className) {
    return this.classes.includes(className);
  }
  toNode() {
    return toNode.call(this, "a");
  }
  toMarkup() {
    return toMarkup.call(this, "a");
  }
}

/**
 * This node represents an image embed (<img>) element.
 */
class Img {
  constructor(src, alt, style) {
    this.src = void 0;
    this.alt = void 0;
    this.classes = void 0;
    this.height = void 0;
    this.depth = void 0;
    this.maxFontSize = void 0;
    this.style = void 0;
    this.alt = alt;
    this.src = src;
    this.classes = ["mord"];
    this.height = 0;
    this.depth = 0;
    this.maxFontSize = 0;
    this.style = style;
  }
  hasClass(className) {
    return this.classes.includes(className);
  }
  toNode() {
    const node = document.createElement("img");
    node.src = this.src;
    node.alt = this.alt;
    node.className = "mord";

    // Apply inline styles
    Object.assign(node.style, this.style);
    return node;
  }
  toMarkup() {
    let markup = "<img src=\"" + utils_escape(this.src) + "\"" + (" alt=\"" + utils_escape(this.alt) + "\"");
    const styles = cssStyleToString(this.style);
    if (styles) {
      markup += " style=\"" + utils_escape(styles) + "\"";
    }
    markup += "'/>";
    return markup;
  }
}
const iCombinations = {
  'î': '\u0131\u0302',
  'ï': '\u0131\u0308',
  'í': '\u0131\u0301',
  // 'ī': '\u0131\u0304', // enable when we add Extended Latin
  'ì': '\u0131\u0300'
};

/**
 * A symbol node contains information about a single symbol. It either renders
 * to a single text node, or a span with a single text node in it, depending on
 * whether it has CSS classes, styles, or needs italic correction.
 */
class SymbolNode {
  constructor(text, height, depth, italic, skew, width, classes, style) {
    this.text = void 0;
    this.height = void 0;
    this.depth = void 0;
    this.italic = void 0;
    this.skew = void 0;
    this.width = void 0;
    this.maxFontSize = void 0;
    this.classes = void 0;
    this.style = void 0;
    this.text = text;
    this.height = height || 0;
    this.depth = depth || 0;
    this.italic = italic || 0;
    this.skew = skew || 0;
    this.width = width || 0;
    this.classes = classes || [];
    this.style = style || {};
    this.maxFontSize = 0;

    // Mark text from non-Latin scripts with specific classes so that we
    // can specify which fonts to use.  This allows us to render these
    // characters with a serif font in situations where the browser would
    // either default to a sans serif or render a placeholder character.
    // We use CSS class names like cjk_fallback, hangul_fallback and
    // brahmic_fallback. See ./unicodeScripts.js for the set of possible
    // script names
    const script = scriptFromCodepoint(this.text.charCodeAt(0));
    if (script) {
      this.classes.push(script + "_fallback");
    }
    if (/[îïíì]/.test(this.text)) {
      // add ī when we add Extended Latin
      this.text = iCombinations[this.text];
    }
  }
  hasClass(className) {
    return this.classes.includes(className);
  }

  /**
   * Creates a text node or span from a symbol node. Note that a span is only
   * created    if it is needed.
   */
  toNode() {
    const node = document.createTextNode(this.text);
    let span = null;
    if (this.italic > 0) {
      span = document.createElement("span");
      span.style.marginRight = makeEm(this.italic);
    }
    if (this.classes.length > 0) {
      span = span || document.createElement("span");
      span.className = createClass(this.classes);
    }
    if (Object.keys(this.style).length > 0) {
      span = span || document.createElement("span");
      Object.assign(span.style, this.style);
    }
    if (span) {
      span.appendChild(node);
      return span;
    } else {
      return node;
    }
  }

  /**
   * Creates markup for a symbol node.
   */
  toMarkup() {
    // TODO(alpert): More duplication than I'd like from
    // span.prototype.toMarkup and symbolNode.prototype.toNode...
    let needsSpan = false;
    let markup = "<span";
    if (this.classes.length) {
      needsSpan = true;
      markup += " class=\"";
      markup += utils_escape(createClass(this.classes));
      markup += "\"";
    }
    let styles = "";
    if (this.italic > 0) {
      styles += "margin-right:" + makeEm(this.italic) + ";";
    }
    styles += cssStyleToString(this.style);
    if (styles) {
      needsSpan = true;
      markup += " style=\"" + utils_escape(styles) + "\"";
    }
    const escaped = utils_escape(this.text);
    if (needsSpan) {
      markup += ">";
      markup += escaped;
      markup += "</span>";
      return markup;
    } else {
      return escaped;
    }
  }
}

/**
 * SVG nodes are used to render stretchy wide elements.
 */
class SvgNode {
  constructor(children, attributes) {
    this.children = void 0;
    this.attributes = void 0;
    this.children = children || [];
    this.attributes = attributes || {};
  }
  toNode() {
    const svgNS = "http://www.w3.org/2000/svg";
    const node = document.createElementNS(svgNS, "svg");

    // Apply attributes
    for (const attr of Object.keys(this.attributes)) {
      node.setAttribute(attr, this.attributes[attr]);
    }
    for (let i = 0; i < this.children.length; i++) {
      node.appendChild(this.children[i].toNode());
    }
    return node;
  }
  toMarkup() {
    let markup = "<svg xmlns=\"http://www.w3.org/2000/svg\"";

    // Apply attributes
    for (const attr of Object.keys(this.attributes)) {
      markup += " " + attr + "=\"" + utils_escape(this.attributes[attr]) + "\"";
    }
    markup += ">";
    for (let i = 0; i < this.children.length; i++) {
      markup += this.children[i].toMarkup();
    }
    markup += "</svg>";
    return markup;
  }
}
class PathNode {
  constructor(pathName, alternate) {
    this.pathName = void 0;
    this.alternate = void 0;
    this.pathName = pathName;
    this.alternate = alternate; // Used only for \sqrt, \phase, & tall delims
  }
  toNode() {
    const svgNS = "http://www.w3.org/2000/svg";
    const node = document.createElementNS(svgNS, "path");
    if (this.alternate) {
      node.setAttribute("d", this.alternate);
    } else {
      node.setAttribute("d", path[this.pathName]);
    }
    return node;
  }
  toMarkup() {
    if (this.alternate) {
      return "<path d=\"" + utils_escape(this.alternate) + "\"/>";
    } else {
      return "<path d=\"" + utils_escape(path[this.pathName]) + "\"/>";
    }
  }
}
class LineNode {
  constructor(attributes) {
    this.attributes = void 0;
    this.attributes = attributes || {};
  }
  toNode() {
    const svgNS = "http://www.w3.org/2000/svg";
    const node = document.createElementNS(svgNS, "line");

    // Apply attributes
    for (const attr of Object.keys(this.attributes)) {
      node.setAttribute(attr, this.attributes[attr]);
    }
    return node;
  }
  toMarkup() {
    let markup = "<line";
    for (const attr of Object.keys(this.attributes)) {
      markup += " " + attr + "=\"" + utils_escape(this.attributes[attr]) + "\"";
    }
    markup += "/>";
    return markup;
  }
}
function assertSymbolDomNode(group) {
  if (group instanceof SymbolNode) {
    return group;
  } else {
    throw new Error("Expected symbolNode but got " + String(group) + ".");
  }
}
function assertSpan(group) {
  if (group instanceof Span) {
    return group;
  } else {
    throw new Error("Expected span<HtmlDomNode> but got " + String(group) + ".");
  }
}

/**
 * Whether an HtmlDomNode has HtmlDomNode children.
 * HtmlDomNode is a base type representing a union of
 * SymbolNode, SvgSpan, DomSpan, Anchor, and documentFragment.
 * In the last three cases, the children are HtmlDomNode[].
 */
const hasHtmlDomChildren = node => node instanceof Span || node instanceof Anchor || node instanceof DocumentFragment;
;// ./src/fontMetricsData.js
// This file is GENERATED by buildMetrics.sh. DO NOT MODIFY.
/* harmony default export */ var fontMetricsData = ({
  "AMS-Regular": {
    "32": [0, 0, 0, 0, 0.25],
    "65": [0, 0.68889, 0, 0, 0.72222],
    "66": [0, 0.68889, 0, 0, 0.66667],
    "67": [0, 0.68889, 0, 0, 0.72222],
    "68": [0, 0.68889, 0, 0, 0.72222],
    "69": [0, 0.68889, 0, 0, 0.66667],
    "70": [0, 0.68889, 0, 0, 0.61111],
    "71": [0, 0.68889, 0, 0, 0.77778],
    "72": [0, 0.68889, 0, 0, 0.77778],
    "73": [0, 0.68889, 0, 0, 0.38889],
    "74": [0.16667, 0.68889, 0, 0, 0.5],
    "75": [0, 0.68889, 0, 0, 0.77778],
    "76": [0, 0.68889, 0, 0, 0.66667],
    "77": [0, 0.68889, 0, 0, 0.94445],
    "78": [0, 0.68889, 0, 0, 0.72222],
    "79": [0.16667, 0.68889, 0, 0, 0.77778],
    "80": [0, 0.68889, 0, 0, 0.61111],
    "81": [0.16667, 0.68889, 0, 0, 0.77778],
    "82": [0, 0.68889, 0, 0, 0.72222],
    "83": [0, 0.68889, 0, 0, 0.55556],
    "84": [0, 0.68889, 0, 0, 0.66667],
    "85": [0, 0.68889, 0, 0, 0.72222],
    "86": [0, 0.68889, 0, 0, 0.72222],
    "87": [0, 0.68889, 0, 0, 1.0],
    "88": [0, 0.68889, 0, 0, 0.72222],
    "89": [0, 0.68889, 0, 0, 0.72222],
    "90": [0, 0.68889, 0, 0, 0.66667],
    "107": [0, 0.68889, 0, 0, 0.55556],
    "160": [0, 0, 0, 0, 0.25],
    "165": [0, 0.675, 0.025, 0, 0.75],
    "174": [0.15559, 0.69224, 0, 0, 0.94666],
    "240": [0, 0.68889, 0, 0, 0.55556],
    "295": [0, 0.68889, 0, 0, 0.54028],
    "710": [0, 0.825, 0, 0, 2.33334],
    "732": [0, 0.9, 0, 0, 2.33334],
    "770": [0, 0.825, 0, 0, 2.33334],
    "771": [0, 0.9, 0, 0, 2.33334],
    "989": [0.08167, 0.58167, 0, 0, 0.77778],
    "1008": [0, 0.43056, 0.04028, 0, 0.66667],
    "8245": [0, 0.54986, 0, 0, 0.275],
    "8463": [0, 0.68889, 0, 0, 0.54028],
    "8487": [0, 0.68889, 0, 0, 0.72222],
    "8498": [0, 0.68889, 0, 0, 0.55556],
    "8502": [0, 0.68889, 0, 0, 0.66667],
    "8503": [0, 0.68889, 0, 0, 0.44445],
    "8504": [0, 0.68889, 0, 0, 0.66667],
    "8513": [0, 0.68889, 0, 0, 0.63889],
    "8592": [-0.03598, 0.46402, 0, 0, 0.5],
    "8594": [-0.03598, 0.46402, 0, 0, 0.5],
    "8602": [-0.13313, 0.36687, 0, 0, 1.0],
    "8603": [-0.13313, 0.36687, 0, 0, 1.0],
    "8606": [0.01354, 0.52239, 0, 0, 1.0],
    "8608": [0.01354, 0.52239, 0, 0, 1.0],
    "8610": [0.01354, 0.52239, 0, 0, 1.11111],
    "8611": [0.01354, 0.52239, 0, 0, 1.11111],
    "8619": [0, 0.54986, 0, 0, 1.0],
    "8620": [0, 0.54986, 0, 0, 1.0],
    "8621": [-0.13313, 0.37788, 0, 0, 1.38889],
    "8622": [-0.13313, 0.36687, 0, 0, 1.0],
    "8624": [0, 0.69224, 0, 0, 0.5],
    "8625": [0, 0.69224, 0, 0, 0.5],
    "8630": [0, 0.43056, 0, 0, 1.0],
    "8631": [0, 0.43056, 0, 0, 1.0],
    "8634": [0.08198, 0.58198, 0, 0, 0.77778],
    "8635": [0.08198, 0.58198, 0, 0, 0.77778],
    "8638": [0.19444, 0.69224, 0, 0, 0.41667],
    "8639": [0.19444, 0.69224, 0, 0, 0.41667],
    "8642": [0.19444, 0.69224, 0, 0, 0.41667],
    "8643": [0.19444, 0.69224, 0, 0, 0.41667],
    "8644": [0.1808, 0.675, 0, 0, 1.0],
    "8646": [0.1808, 0.675, 0, 0, 1.0],
    "8647": [0.1808, 0.675, 0, 0, 1.0],
    "8648": [0.19444, 0.69224, 0, 0, 0.83334],
    "8649": [0.1808, 0.675, 0, 0, 1.0],
    "8650": [0.19444, 0.69224, 0, 0, 0.83334],
    "8651": [0.01354, 0.52239, 0, 0, 1.0],
    "8652": [0.01354, 0.52239, 0, 0, 1.0],
    "8653": [-0.13313, 0.36687, 0, 0, 1.0],
    "8654": [-0.13313, 0.36687, 0, 0, 1.0],
    "8655": [-0.13313, 0.36687, 0, 0, 1.0],
    "8666": [0.13667, 0.63667, 0, 0, 1.0],
    "8667": [0.13667, 0.63667, 0, 0, 1.0],
    "8669": [-0.13313, 0.37788, 0, 0, 1.0],
    "8672": [-0.064, 0.437, 0, 0, 1.334],
    "8674": [-0.064, 0.437, 0, 0, 1.334],
    "8705": [0, 0.825, 0, 0, 0.5],
    "8708": [0, 0.68889, 0, 0, 0.55556],
    "8709": [0.08167, 0.58167, 0, 0, 0.77778],
    "8717": [0, 0.43056, 0, 0, 0.42917],
    "8722": [-0.03598, 0.46402, 0, 0, 0.5],
    "8724": [0.08198, 0.69224, 0, 0, 0.77778],
    "8726": [0.08167, 0.58167, 0, 0, 0.77778],
    "8733": [0, 0.69224, 0, 0, 0.77778],
    "8736": [0, 0.69224, 0, 0, 0.72222],
    "8737": [0, 0.69224, 0, 0, 0.72222],
    "8738": [0.03517, 0.52239, 0, 0, 0.72222],
    "8739": [0.08167, 0.58167, 0, 0, 0.22222],
    "8740": [0.25142, 0.74111, 0, 0, 0.27778],
    "8741": [0.08167, 0.58167, 0, 0, 0.38889],
    "8742": [0.25142, 0.74111, 0, 0, 0.5],
    "8756": [0, 0.69224, 0, 0, 0.66667],
    "8757": [0, 0.69224, 0, 0, 0.66667],
    "8764": [-0.13313, 0.36687, 0, 0, 0.77778],
    "8765": [-0.13313, 0.37788, 0, 0, 0.77778],
    "8769": [-0.13313, 0.36687, 0, 0, 0.77778],
    "8770": [-0.03625, 0.46375, 0, 0, 0.77778],
    "8774": [0.30274, 0.79383, 0, 0, 0.77778],
    "8776": [-0.01688, 0.48312, 0, 0, 0.77778],
    "8778": [0.08167, 0.58167, 0, 0, 0.77778],
    "8782": [0.06062, 0.54986, 0, 0, 0.77778],
    "8783": [0.06062, 0.54986, 0, 0, 0.77778],
    "8785": [0.08198, 0.58198, 0, 0, 0.77778],
    "8786": [0.08198, 0.58198, 0, 0, 0.77778],
    "8787": [0.08198, 0.58198, 0, 0, 0.77778],
    "8790": [0, 0.69224, 0, 0, 0.77778],
    "8791": [0.22958, 0.72958, 0, 0, 0.77778],
    "8796": [0.08198, 0.91667, 0, 0, 0.77778],
    "8806": [0.25583, 0.75583, 0, 0, 0.77778],
    "8807": [0.25583, 0.75583, 0, 0, 0.77778],
    "8808": [0.25142, 0.75726, 0, 0, 0.77778],
    "8809": [0.25142, 0.75726, 0, 0, 0.77778],
    "8812": [0.25583, 0.75583, 0, 0, 0.5],
    "8814": [0.20576, 0.70576, 0, 0, 0.77778],
    "8815": [0.20576, 0.70576, 0, 0, 0.77778],
    "8816": [0.30274, 0.79383, 0, 0, 0.77778],
    "8817": [0.30274, 0.79383, 0, 0, 0.77778],
    "8818": [0.22958, 0.72958, 0, 0, 0.77778],
    "8819": [0.22958, 0.72958, 0, 0, 0.77778],
    "8822": [0.1808, 0.675, 0, 0, 0.77778],
    "8823": [0.1808, 0.675, 0, 0, 0.77778],
    "8828": [0.13667, 0.63667, 0, 0, 0.77778],
    "8829": [0.13667, 0.63667, 0, 0, 0.77778],
    "8830": [0.22958, 0.72958, 0, 0, 0.77778],
    "8831": [0.22958, 0.72958, 0, 0, 0.77778],
    "8832": [0.20576, 0.70576, 0, 0, 0.77778],
    "8833": [0.20576, 0.70576, 0, 0, 0.77778],
    "8840": [0.30274, 0.79383, 0, 0, 0.77778],
    "8841": [0.30274, 0.79383, 0, 0, 0.77778],
    "8842": [0.13597, 0.63597, 0, 0, 0.77778],
    "8843": [0.13597, 0.63597, 0, 0, 0.77778],
    "8847": [0.03517, 0.54986, 0, 0, 0.77778],
    "8848": [0.03517, 0.54986, 0, 0, 0.77778],
    "8858": [0.08198, 0.58198, 0, 0, 0.77778],
    "8859": [0.08198, 0.58198, 0, 0, 0.77778],
    "8861": [0.08198, 0.58198, 0, 0, 0.77778],
    "8862": [0, 0.675, 0, 0, 0.77778],
    "8863": [0, 0.675, 0, 0, 0.77778],
    "8864": [0, 0.675, 0, 0, 0.77778],
    "8865": [0, 0.675, 0, 0, 0.77778],
    "8872": [0, 0.69224, 0, 0, 0.61111],
    "8873": [0, 0.69224, 0, 0, 0.72222],
    "8874": [0, 0.69224, 0, 0, 0.88889],
    "8876": [0, 0.68889, 0, 0, 0.61111],
    "8877": [0, 0.68889, 0, 0, 0.61111],
    "8878": [0, 0.68889, 0, 0, 0.72222],
    "8879": [0, 0.68889, 0, 0, 0.72222],
    "8882": [0.03517, 0.54986, 0, 0, 0.77778],
    "8883": [0.03517, 0.54986, 0, 0, 0.77778],
    "8884": [0.13667, 0.63667, 0, 0, 0.77778],
    "8885": [0.13667, 0.63667, 0, 0, 0.77778],
    "8888": [0, 0.54986, 0, 0, 1.11111],
    "8890": [0.19444, 0.43056, 0, 0, 0.55556],
    "8891": [0.19444, 0.69224, 0, 0, 0.61111],
    "8892": [0.19444, 0.69224, 0, 0, 0.61111],
    "8901": [0, 0.54986, 0, 0, 0.27778],
    "8903": [0.08167, 0.58167, 0, 0, 0.77778],
    "8905": [0.08167, 0.58167, 0, 0, 0.77778],
    "8906": [0.08167, 0.58167, 0, 0, 0.77778],
    "8907": [0, 0.69224, 0, 0, 0.77778],
    "8908": [0, 0.69224, 0, 0, 0.77778],
    "8909": [-0.03598, 0.46402, 0, 0, 0.77778],
    "8910": [0, 0.54986, 0, 0, 0.76042],
    "8911": [0, 0.54986, 0, 0, 0.76042],
    "8912": [0.03517, 0.54986, 0, 0, 0.77778],
    "8913": [0.03517, 0.54986, 0, 0, 0.77778],
    "8914": [0, 0.54986, 0, 0, 0.66667],
    "8915": [0, 0.54986, 0, 0, 0.66667],
    "8916": [0, 0.69224, 0, 0, 0.66667],
    "8918": [0.0391, 0.5391, 0, 0, 0.77778],
    "8919": [0.0391, 0.5391, 0, 0, 0.77778],
    "8920": [0.03517, 0.54986, 0, 0, 1.33334],
    "8921": [0.03517, 0.54986, 0, 0, 1.33334],
    "8922": [0.38569, 0.88569, 0, 0, 0.77778],
    "8923": [0.38569, 0.88569, 0, 0, 0.77778],
    "8926": [0.13667, 0.63667, 0, 0, 0.77778],
    "8927": [0.13667, 0.63667, 0, 0, 0.77778],
    "8928": [0.30274, 0.79383, 0, 0, 0.77778],
    "8929": [0.30274, 0.79383, 0, 0, 0.77778],
    "8934": [0.23222, 0.74111, 0, 0, 0.77778],
    "8935": [0.23222, 0.74111, 0, 0, 0.77778],
    "8936": [0.23222, 0.74111, 0, 0, 0.77778],
    "8937": [0.23222, 0.74111, 0, 0, 0.77778],
    "8938": [0.20576, 0.70576, 0, 0, 0.77778],
    "8939": [0.20576, 0.70576, 0, 0, 0.77778],
    "8940": [0.30274, 0.79383, 0, 0, 0.77778],
    "8941": [0.30274, 0.79383, 0, 0, 0.77778],
    "8994": [0.19444, 0.69224, 0, 0, 0.77778],
    "8995": [0.19444, 0.69224, 0, 0, 0.77778],
    "9416": [0.15559, 0.69224, 0, 0, 0.90222],
    "9484": [0, 0.69224, 0, 0, 0.5],
    "9488": [0, 0.69224, 0, 0, 0.5],
    "9492": [0, 0.37788, 0, 0, 0.5],
    "9496": [0, 0.37788, 0, 0, 0.5],
    "9585": [0.19444, 0.68889, 0, 0, 0.88889],
    "9586": [0.19444, 0.74111, 0, 0, 0.88889],
    "9632": [0, 0.675, 0, 0, 0.77778],
    "9633": [0, 0.675, 0, 0, 0.77778],
    "9650": [0, 0.54986, 0, 0, 0.72222],
    "9651": [0, 0.54986, 0, 0, 0.72222],
    "9654": [0.03517, 0.54986, 0, 0, 0.77778],
    "9660": [0, 0.54986, 0, 0, 0.72222],
    "9661": [0, 0.54986, 0, 0, 0.72222],
    "9664": [0.03517, 0.54986, 0, 0, 0.77778],
    "9674": [0.11111, 0.69224, 0, 0, 0.66667],
    "9733": [0.19444, 0.69224, 0, 0, 0.94445],
    "10003": [0, 0.69224, 0, 0, 0.83334],
    "10016": [0, 0.69224, 0, 0, 0.83334],
    "10731": [0.11111, 0.69224, 0, 0, 0.66667],
    "10846": [0.19444, 0.75583, 0, 0, 0.61111],
    "10877": [0.13667, 0.63667, 0, 0, 0.77778],
    "10878": [0.13667, 0.63667, 0, 0, 0.77778],
    "10885": [0.25583, 0.75583, 0, 0, 0.77778],
    "10886": [0.25583, 0.75583, 0, 0, 0.77778],
    "10887": [0.13597, 0.63597, 0, 0, 0.77778],
    "10888": [0.13597, 0.63597, 0, 0, 0.77778],
    "10889": [0.26167, 0.75726, 0, 0, 0.77778],
    "10890": [0.26167, 0.75726, 0, 0, 0.77778],
    "10891": [0.48256, 0.98256, 0, 0, 0.77778],
    "10892": [0.48256, 0.98256, 0, 0, 0.77778],
    "10901": [0.13667, 0.63667, 0, 0, 0.77778],
    "10902": [0.13667, 0.63667, 0, 0, 0.77778],
    "10933": [0.25142, 0.75726, 0, 0, 0.77778],
    "10934": [0.25142, 0.75726, 0, 0, 0.77778],
    "10935": [0.26167, 0.75726, 0, 0, 0.77778],
    "10936": [0.26167, 0.75726, 0, 0, 0.77778],
    "10937": [0.26167, 0.75726, 0, 0, 0.77778],
    "10938": [0.26167, 0.75726, 0, 0, 0.77778],
    "10949": [0.25583, 0.75583, 0, 0, 0.77778],
    "10950": [0.25583, 0.75583, 0, 0, 0.77778],
    "10955": [0.28481, 0.79383, 0, 0, 0.77778],
    "10956": [0.28481, 0.79383, 0, 0, 0.77778],
    "57350": [0.08167, 0.58167, 0, 0, 0.22222],
    "57351": [0.08167, 0.58167, 0, 0, 0.38889],
    "57352": [0.08167, 0.58167, 0, 0, 0.77778],
    "57353": [0, 0.43056, 0.04028, 0, 0.66667],
    "57356": [0.25142, 0.75726, 0, 0, 0.77778],
    "57357": [0.25142, 0.75726, 0, 0, 0.77778],
    "57358": [0.41951, 0.91951, 0, 0, 0.77778],
    "57359": [0.30274, 0.79383, 0, 0, 0.77778],
    "57360": [0.30274, 0.79383, 0, 0, 0.77778],
    "57361": [0.41951, 0.91951, 0, 0, 0.77778],
    "57366": [0.25142, 0.75726, 0, 0, 0.77778],
    "57367": [0.25142, 0.75726, 0, 0, 0.77778],
    "57368": [0.25142, 0.75726, 0, 0, 0.77778],
    "57369": [0.25142, 0.75726, 0, 0, 0.77778],
    "57370": [0.13597, 0.63597, 0, 0, 0.77778],
    "57371": [0.13597, 0.63597, 0, 0, 0.77778]
  },
  "Caligraphic-Regular": {
    "32": [0, 0, 0, 0, 0.25],
    "65": [0, 0.68333, 0, 0.19445, 0.79847],
    "66": [0, 0.68333, 0.03041, 0.13889, 0.65681],
    "67": [0, 0.68333, 0.05834, 0.13889, 0.52653],
    "68": [0, 0.68333, 0.02778, 0.08334, 0.77139],
    "69": [0, 0.68333, 0.08944, 0.11111, 0.52778],
    "70": [0, 0.68333, 0.09931, 0.11111, 0.71875],
    "71": [0.09722, 0.68333, 0.0593, 0.11111, 0.59487],
    "72": [0, 0.68333, 0.00965, 0.11111, 0.84452],
    "73": [0, 0.68333, 0.07382, 0, 0.54452],
    "74": [0.09722, 0.68333, 0.18472, 0.16667, 0.67778],
    "75": [0, 0.68333, 0.01445, 0.05556, 0.76195],
    "76": [0, 0.68333, 0, 0.13889, 0.68972],
    "77": [0, 0.68333, 0, 0.13889, 1.2009],
    "78": [0, 0.68333, 0.14736, 0.08334, 0.82049],
    "79": [0, 0.68333, 0.02778, 0.11111, 0.79611],
    "80": [0, 0.68333, 0.08222, 0.08334, 0.69556],
    "81": [0.09722, 0.68333, 0, 0.11111, 0.81667],
    "82": [0, 0.68333, 0, 0.08334, 0.8475],
    "83": [0, 0.68333, 0.075, 0.13889, 0.60556],
    "84": [0, 0.68333, 0.25417, 0, 0.54464],
    "85": [0, 0.68333, 0.09931, 0.08334, 0.62583],
    "86": [0, 0.68333, 0.08222, 0, 0.61278],
    "87": [0, 0.68333, 0.08222, 0.08334, 0.98778],
    "88": [0, 0.68333, 0.14643, 0.13889, 0.7133],
    "89": [0.09722, 0.68333, 0.08222, 0.08334, 0.66834],
    "90": [0, 0.68333, 0.07944, 0.13889, 0.72473],
    "160": [0, 0, 0, 0, 0.25]
  },
  "Fraktur-Regular": {
    "32": [0, 0, 0, 0, 0.25],
    "33": [0, 0.69141, 0, 0, 0.29574],
    "34": [0, 0.69141, 0, 0, 0.21471],
    "38": [0, 0.69141, 0, 0, 0.73786],
    "39": [0, 0.69141, 0, 0, 0.21201],
    "40": [0.24982, 0.74947, 0, 0, 0.38865],
    "41": [0.24982, 0.74947, 0, 0, 0.38865],
    "42": [0, 0.62119, 0, 0, 0.27764],
    "43": [0.08319, 0.58283, 0, 0, 0.75623],
    "44": [0, 0.10803, 0, 0, 0.27764],
    "45": [0.08319, 0.58283, 0, 0, 0.75623],
    "46": [0, 0.10803, 0, 0, 0.27764],
    "47": [0.24982, 0.74947, 0, 0, 0.50181],
    "48": [0, 0.47534, 0, 0, 0.50181],
    "49": [0, 0.47534, 0, 0, 0.50181],
    "50": [0, 0.47534, 0, 0, 0.50181],
    "51": [0.18906, 0.47534, 0, 0, 0.50181],
    "52": [0.18906, 0.47534, 0, 0, 0.50181],
    "53": [0.18906, 0.47534, 0, 0, 0.50181],
    "54": [0, 0.69141, 0, 0, 0.50181],
    "55": [0.18906, 0.47534, 0, 0, 0.50181],
    "56": [0, 0.69141, 0, 0, 0.50181],
    "57": [0.18906, 0.47534, 0, 0, 0.50181],
    "58": [0, 0.47534, 0, 0, 0.21606],
    "59": [0.12604, 0.47534, 0, 0, 0.21606],
    "61": [-0.13099, 0.36866, 0, 0, 0.75623],
    "63": [0, 0.69141, 0, 0, 0.36245],
    "65": [0, 0.69141, 0, 0, 0.7176],
    "66": [0, 0.69141, 0, 0, 0.88397],
    "67": [0, 0.69141, 0, 0, 0.61254],
    "68": [0, 0.69141, 0, 0, 0.83158],
    "69": [0, 0.69141, 0, 0, 0.66278],
    "70": [0.12604, 0.69141, 0, 0, 0.61119],
    "71": [0, 0.69141, 0, 0, 0.78539],
    "72": [0.06302, 0.69141, 0, 0, 0.7203],
    "73": [0, 0.69141, 0, 0, 0.55448],
    "74": [0.12604, 0.69141, 0, 0, 0.55231],
    "75": [0, 0.69141, 0, 0, 0.66845],
    "76": [0, 0.69141, 0, 0, 0.66602],
    "77": [0, 0.69141, 0, 0, 1.04953],
    "78": [0, 0.69141, 0, 0, 0.83212],
    "79": [0, 0.69141, 0, 0, 0.82699],
    "80": [0.18906, 0.69141, 0, 0, 0.82753],
    "81": [0.03781, 0.69141, 0, 0, 0.82699],
    "82": [0, 0.69141, 0, 0, 0.82807],
    "83": [0, 0.69141, 0, 0, 0.82861],
    "84": [0, 0.69141, 0, 0, 0.66899],
    "85": [0, 0.69141, 0, 0, 0.64576],
    "86": [0, 0.69141, 0, 0, 0.83131],
    "87": [0, 0.69141, 0, 0, 1.04602],
    "88": [0, 0.69141, 0, 0, 0.71922],
    "89": [0.18906, 0.69141, 0, 0, 0.83293],
    "90": [0.12604, 0.69141, 0, 0, 0.60201],
    "91": [0.24982, 0.74947, 0, 0, 0.27764],
    "93": [0.24982, 0.74947, 0, 0, 0.27764],
    "94": [0, 0.69141, 0, 0, 0.49965],
    "97": [0, 0.47534, 0, 0, 0.50046],
    "98": [0, 0.69141, 0, 0, 0.51315],
    "99": [0, 0.47534, 0, 0, 0.38946],
    "100": [0, 0.62119, 0, 0, 0.49857],
    "101": [0, 0.47534, 0, 0, 0.40053],
    "102": [0.18906, 0.69141, 0, 0, 0.32626],
    "103": [0.18906, 0.47534, 0, 0, 0.5037],
    "104": [0.18906, 0.69141, 0, 0, 0.52126],
    "105": [0, 0.69141, 0, 0, 0.27899],
    "106": [0, 0.69141, 0, 0, 0.28088],
    "107": [0, 0.69141, 0, 0, 0.38946],
    "108": [0, 0.69141, 0, 0, 0.27953],
    "109": [0, 0.47534, 0, 0, 0.76676],
    "110": [0, 0.47534, 0, 0, 0.52666],
    "111": [0, 0.47534, 0, 0, 0.48885],
    "112": [0.18906, 0.52396, 0, 0, 0.50046],
    "113": [0.18906, 0.47534, 0, 0, 0.48912],
    "114": [0, 0.47534, 0, 0, 0.38919],
    "115": [0, 0.47534, 0, 0, 0.44266],
    "116": [0, 0.62119, 0, 0, 0.33301],
    "117": [0, 0.47534, 0, 0, 0.5172],
    "118": [0, 0.52396, 0, 0, 0.5118],
    "119": [0, 0.52396, 0, 0, 0.77351],
    "120": [0.18906, 0.47534, 0, 0, 0.38865],
    "121": [0.18906, 0.47534, 0, 0, 0.49884],
    "122": [0.18906, 0.47534, 0, 0, 0.39054],
    "160": [0, 0, 0, 0, 0.25],
    "8216": [0, 0.69141, 0, 0, 0.21471],
    "8217": [0, 0.69141, 0, 0, 0.21471],
    "58112": [0, 0.62119, 0, 0, 0.49749],
    "58113": [0, 0.62119, 0, 0, 0.4983],
    "58114": [0.18906, 0.69141, 0, 0, 0.33328],
    "58115": [0.18906, 0.69141, 0, 0, 0.32923],
    "58116": [0.18906, 0.47534, 0, 0, 0.50343],
    "58117": [0, 0.69141, 0, 0, 0.33301],
    "58118": [0, 0.62119, 0, 0, 0.33409],
    "58119": [0, 0.47534, 0, 0, 0.50073]
  },
  "Main-Bold": {
    "32": [0, 0, 0, 0, 0.25],
    "33": [0, 0.69444, 0, 0, 0.35],
    "34": [0, 0.69444, 0, 0, 0.60278],
    "35": [0.19444, 0.69444, 0, 0, 0.95833],
    "36": [0.05556, 0.75, 0, 0, 0.575],
    "37": [0.05556, 0.75, 0, 0, 0.95833],
    "38": [0, 0.69444, 0, 0, 0.89444],
    "39": [0, 0.69444, 0, 0, 0.31944],
    "40": [0.25, 0.75, 0, 0, 0.44722],
    "41": [0.25, 0.75, 0, 0, 0.44722],
    "42": [0, 0.75, 0, 0, 0.575],
    "43": [0.13333, 0.63333, 0, 0, 0.89444],
    "44": [0.19444, 0.15556, 0, 0, 0.31944],
    "45": [0, 0.44444, 0, 0, 0.38333],
    "46": [0, 0.15556, 0, 0, 0.31944],
    "47": [0.25, 0.75, 0, 0, 0.575],
    "48": [0, 0.64444, 0, 0, 0.575],
    "49": [0, 0.64444, 0, 0, 0.575],
    "50": [0, 0.64444, 0, 0, 0.575],
    "51": [0, 0.64444, 0, 0, 0.575],
    "52": [0, 0.64444, 0, 0, 0.575],
    "53": [0, 0.64444, 0, 0, 0.575],
    "54": [0, 0.64444, 0, 0, 0.575],
    "55": [0, 0.64444, 0, 0, 0.575],
    "56": [0, 0.64444, 0, 0, 0.575],
    "57": [0, 0.64444, 0, 0, 0.575],
    "58": [0, 0.44444, 0, 0, 0.31944],
    "59": [0.19444, 0.44444, 0, 0, 0.31944],
    "60": [0.08556, 0.58556, 0, 0, 0.89444],
    "61": [-0.10889, 0.39111, 0, 0, 0.89444],
    "62": [0.08556, 0.58556, 0, 0, 0.89444],
    "63": [0, 0.69444, 0, 0, 0.54305],
    "64": [0, 0.69444, 0, 0, 0.89444],
    "65": [0, 0.68611, 0, 0, 0.86944],
    "66": [0, 0.68611, 0, 0, 0.81805],
    "67": [0, 0.68611, 0, 0, 0.83055],
    "68": [0, 0.68611, 0, 0, 0.88194],
    "69": [0, 0.68611, 0, 0, 0.75555],
    "70": [0, 0.68611, 0, 0, 0.72361],
    "71": [0, 0.68611, 0, 0, 0.90416],
    "72": [0, 0.68611, 0, 0, 0.9],
    "73": [0, 0.68611, 0, 0, 0.43611],
    "74": [0, 0.68611, 0, 0, 0.59444],
    "75": [0, 0.68611, 0, 0, 0.90138],
    "76": [0, 0.68611, 0, 0, 0.69166],
    "77": [0, 0.68611, 0, 0, 1.09166],
    "78": [0, 0.68611, 0, 0, 0.9],
    "79": [0, 0.68611, 0, 0, 0.86388],
    "80": [0, 0.68611, 0, 0, 0.78611],
    "81": [0.19444, 0.68611, 0, 0, 0.86388],
    "82": [0, 0.68611, 0, 0, 0.8625],
    "83": [0, 0.68611, 0, 0, 0.63889],
    "84": [0, 0.68611, 0, 0, 0.8],
    "85": [0, 0.68611, 0, 0, 0.88472],
    "86": [0, 0.68611, 0.01597, 0, 0.86944],
    "87": [0, 0.68611, 0.01597, 0, 1.18888],
    "88": [0, 0.68611, 0, 0, 0.86944],
    "89": [0, 0.68611, 0.02875, 0, 0.86944],
    "90": [0, 0.68611, 0, 0, 0.70277],
    "91": [0.25, 0.75, 0, 0, 0.31944],
    "92": [0.25, 0.75, 0, 0, 0.575],
    "93": [0.25, 0.75, 0, 0, 0.31944],
    "94": [0, 0.69444, 0, 0, 0.575],
    "95": [0.31, 0.13444, 0.03194, 0, 0.575],
    "97": [0, 0.44444, 0, 0, 0.55902],
    "98": [0, 0.69444, 0, 0, 0.63889],
    "99": [0, 0.44444, 0, 0, 0.51111],
    "100": [0, 0.69444, 0, 0, 0.63889],
    "101": [0, 0.44444, 0, 0, 0.52708],
    "102": [0, 0.69444, 0.10903, 0, 0.35139],
    "103": [0.19444, 0.44444, 0.01597, 0, 0.575],
    "104": [0, 0.69444, 0, 0, 0.63889],
    "105": [0, 0.69444, 0, 0, 0.31944],
    "106": [0.19444, 0.69444, 0, 0, 0.35139],
    "107": [0, 0.69444, 0, 0, 0.60694],
    "108": [0, 0.69444, 0, 0, 0.31944],
    "109": [0, 0.44444, 0, 0, 0.95833],
    "110": [0, 0.44444, 0, 0, 0.63889],
    "111": [0, 0.44444, 0, 0, 0.575],
    "112": [0.19444, 0.44444, 0, 0, 0.63889],
    "113": [0.19444, 0.44444, 0, 0, 0.60694],
    "114": [0, 0.44444, 0, 0, 0.47361],
    "115": [0, 0.44444, 0, 0, 0.45361],
    "116": [0, 0.63492, 0, 0, 0.44722],
    "117": [0, 0.44444, 0, 0, 0.63889],
    "118": [0, 0.44444, 0.01597, 0, 0.60694],
    "119": [0, 0.44444, 0.01597, 0, 0.83055],
    "120": [0, 0.44444, 0, 0, 0.60694],
    "121": [0.19444, 0.44444, 0.01597, 0, 0.60694],
    "122": [0, 0.44444, 0, 0, 0.51111],
    "123": [0.25, 0.75, 0, 0, 0.575],
    "124": [0.25, 0.75, 0, 0, 0.31944],
    "125": [0.25, 0.75, 0, 0, 0.575],
    "126": [0.35, 0.34444, 0, 0, 0.575],
    "160": [0, 0, 0, 0, 0.25],
    "163": [0, 0.69444, 0, 0, 0.86853],
    "168": [0, 0.69444, 0, 0, 0.575],
    "172": [0, 0.44444, 0, 0, 0.76666],
    "176": [0, 0.69444, 0, 0, 0.86944],
    "177": [0.13333, 0.63333, 0, 0, 0.89444],
    "184": [0.17014, 0, 0, 0, 0.51111],
    "198": [0, 0.68611, 0, 0, 1.04166],
    "215": [0.13333, 0.63333, 0, 0, 0.89444],
    "216": [0.04861, 0.73472, 0, 0, 0.89444],
    "223": [0, 0.69444, 0, 0, 0.59722],
    "230": [0, 0.44444, 0, 0, 0.83055],
    "247": [0.13333, 0.63333, 0, 0, 0.89444],
    "248": [0.09722, 0.54167, 0, 0, 0.575],
    "305": [0, 0.44444, 0, 0, 0.31944],
    "338": [0, 0.68611, 0, 0, 1.16944],
    "339": [0, 0.44444, 0, 0, 0.89444],
    "567": [0.19444, 0.44444, 0, 0, 0.35139],
    "710": [0, 0.69444, 0, 0, 0.575],
    "711": [0, 0.63194, 0, 0, 0.575],
    "713": [0, 0.59611, 0, 0, 0.575],
    "714": [0, 0.69444, 0, 0, 0.575],
    "715": [0, 0.69444, 0, 0, 0.575],
    "728": [0, 0.69444, 0, 0, 0.575],
    "729": [0, 0.69444, 0, 0, 0.31944],
    "730": [0, 0.69444, 0, 0, 0.86944],
    "732": [0, 0.69444, 0, 0, 0.575],
    "733": [0, 0.69444, 0, 0, 0.575],
    "915": [0, 0.68611, 0, 0, 0.69166],
    "916": [0, 0.68611, 0, 0, 0.95833],
    "920": [0, 0.68611, 0, 0, 0.89444],
    "923": [0, 0.68611, 0, 0, 0.80555],
    "926": [0, 0.68611, 0, 0, 0.76666],
    "928": [0, 0.68611, 0, 0, 0.9],
    "931": [0, 0.68611, 0, 0, 0.83055],
    "933": [0, 0.68611, 0, 0, 0.89444],
    "934": [0, 0.68611, 0, 0, 0.83055],
    "936": [0, 0.68611, 0, 0, 0.89444],
    "937": [0, 0.68611, 0, 0, 0.83055],
    "8211": [0, 0.44444, 0.03194, 0, 0.575],
    "8212": [0, 0.44444, 0.03194, 0, 1.14999],
    "8216": [0, 0.69444, 0, 0, 0.31944],
    "8217": [0, 0.69444, 0, 0, 0.31944],
    "8220": [0, 0.69444, 0, 0, 0.60278],
    "8221": [0, 0.69444, 0, 0, 0.60278],
    "8224": [0.19444, 0.69444, 0, 0, 0.51111],
    "8225": [0.19444, 0.69444, 0, 0, 0.51111],
    "8242": [0, 0.55556, 0, 0, 0.34444],
    "8407": [0, 0.72444, 0.15486, 0, 0.575],
    "8463": [0, 0.69444, 0, 0, 0.66759],
    "8465": [0, 0.69444, 0, 0, 0.83055],
    "8467": [0, 0.69444, 0, 0, 0.47361],
    "8472": [0.19444, 0.44444, 0, 0, 0.74027],
    "8476": [0, 0.69444, 0, 0, 0.83055],
    "8501": [0, 0.69444, 0, 0, 0.70277],
    "8592": [-0.10889, 0.39111, 0, 0, 1.14999],
    "8593": [0.19444, 0.69444, 0, 0, 0.575],
    "8594": [-0.10889, 0.39111, 0, 0, 1.14999],
    "8595": [0.19444, 0.69444, 0, 0, 0.575],
    "8596": [-0.10889, 0.39111, 0, 0, 1.14999],
    "8597": [0.25, 0.75, 0, 0, 0.575],
    "8598": [0.19444, 0.69444, 0, 0, 1.14999],
    "8599": [0.19444, 0.69444, 0, 0, 1.14999],
    "8600": [0.19444, 0.69444, 0, 0, 1.14999],
    "8601": [0.19444, 0.69444, 0, 0, 1.14999],
    "8636": [-0.10889, 0.39111, 0, 0, 1.14999],
    "8637": [-0.10889, 0.39111, 0, 0, 1.14999],
    "8640": [-0.10889, 0.39111, 0, 0, 1.14999],
    "8641": [-0.10889, 0.39111, 0, 0, 1.14999],
    "8656": [-0.10889, 0.39111, 0, 0, 1.14999],
    "8657": [0.19444, 0.69444, 0, 0, 0.70277],
    "8658": [-0.10889, 0.39111, 0, 0, 1.14999],
    "8659": [0.19444, 0.69444, 0, 0, 0.70277],
    "8660": [-0.10889, 0.39111, 0, 0, 1.14999],
    "8661": [0.25, 0.75, 0, 0, 0.70277],
    "8704": [0, 0.69444, 0, 0, 0.63889],
    "8706": [0, 0.69444, 0.06389, 0, 0.62847],
    "8707": [0, 0.69444, 0, 0, 0.63889],
    "8709": [0.05556, 0.75, 0, 0, 0.575],
    "8711": [0, 0.68611, 0, 0, 0.95833],
    "8712": [0.08556, 0.58556, 0, 0, 0.76666],
    "8715": [0.08556, 0.58556, 0, 0, 0.76666],
    "8722": [0.13333, 0.63333, 0, 0, 0.89444],
    "8723": [0.13333, 0.63333, 0, 0, 0.89444],
    "8725": [0.25, 0.75, 0, 0, 0.575],
    "8726": [0.25, 0.75, 0, 0, 0.575],
    "8727": [-0.02778, 0.47222, 0, 0, 0.575],
    "8728": [-0.02639, 0.47361, 0, 0, 0.575],
    "8729": [-0.02639, 0.47361, 0, 0, 0.575],
    "8730": [0.18, 0.82, 0, 0, 0.95833],
    "8733": [0, 0.44444, 0, 0, 0.89444],
    "8734": [0, 0.44444, 0, 0, 1.14999],
    "8736": [0, 0.69224, 0, 0, 0.72222],
    "8739": [0.25, 0.75, 0, 0, 0.31944],
    "8741": [0.25, 0.75, 0, 0, 0.575],
    "8743": [0, 0.55556, 0, 0, 0.76666],
    "8744": [0, 0.55556, 0, 0, 0.76666],
    "8745": [0, 0.55556, 0, 0, 0.76666],
    "8746": [0, 0.55556, 0, 0, 0.76666],
    "8747": [0.19444, 0.69444, 0.12778, 0, 0.56875],
    "8764": [-0.10889, 0.39111, 0, 0, 0.89444],
    "8768": [0.19444, 0.69444, 0, 0, 0.31944],
    "8771": [0.00222, 0.50222, 0, 0, 0.89444],
    "8773": [0.027, 0.638, 0, 0, 0.894],
    "8776": [0.02444, 0.52444, 0, 0, 0.89444],
    "8781": [0.00222, 0.50222, 0, 0, 0.89444],
    "8801": [0.00222, 0.50222, 0, 0, 0.89444],
    "8804": [0.19667, 0.69667, 0, 0, 0.89444],
    "8805": [0.19667, 0.69667, 0, 0, 0.89444],
    "8810": [0.08556, 0.58556, 0, 0, 1.14999],
    "8811": [0.08556, 0.58556, 0, 0, 1.14999],
    "8826": [0.08556, 0.58556, 0, 0, 0.89444],
    "8827": [0.08556, 0.58556, 0, 0, 0.89444],
    "8834": [0.08556, 0.58556, 0, 0, 0.89444],
    "8835": [0.08556, 0.58556, 0, 0, 0.89444],
    "8838": [0.19667, 0.69667, 0, 0, 0.89444],
    "8839": [0.19667, 0.69667, 0, 0, 0.89444],
    "8846": [0, 0.55556, 0, 0, 0.76666],
    "8849": [0.19667, 0.69667, 0, 0, 0.89444],
    "8850": [0.19667, 0.69667, 0, 0, 0.89444],
    "8851": [0, 0.55556, 0, 0, 0.76666],
    "8852": [0, 0.55556, 0, 0, 0.76666],
    "8853": [0.13333, 0.63333, 0, 0, 0.89444],
    "8854": [0.13333, 0.63333, 0, 0, 0.89444],
    "8855": [0.13333, 0.63333, 0, 0, 0.89444],
    "8856": [0.13333, 0.63333, 0, 0, 0.89444],
    "8857": [0.13333, 0.63333, 0, 0, 0.89444],
    "8866": [0, 0.69444, 0, 0, 0.70277],
    "8867": [0, 0.69444, 0, 0, 0.70277],
    "8868": [0, 0.69444, 0, 0, 0.89444],
    "8869": [0, 0.69444, 0, 0, 0.89444],
    "8900": [-0.02639, 0.47361, 0, 0, 0.575],
    "8901": [-0.02639, 0.47361, 0, 0, 0.31944],
    "8902": [-0.02778, 0.47222, 0, 0, 0.575],
    "8968": [0.25, 0.75, 0, 0, 0.51111],
    "8969": [0.25, 0.75, 0, 0, 0.51111],
    "8970": [0.25, 0.75, 0, 0, 0.51111],
    "8971": [0.25, 0.75, 0, 0, 0.51111],
    "8994": [-0.13889, 0.36111, 0, 0, 1.14999],
    "8995": [-0.13889, 0.36111, 0, 0, 1.14999],
    "9651": [0.19444, 0.69444, 0, 0, 1.02222],
    "9657": [-0.02778, 0.47222, 0, 0, 0.575],
    "9661": [0.19444, 0.69444, 0, 0, 1.02222],
    "9667": [-0.02778, 0.47222, 0, 0, 0.575],
    "9711": [0.19444, 0.69444, 0, 0, 1.14999],
    "9824": [0.12963, 0.69444, 0, 0, 0.89444],
    "9825": [0.12963, 0.69444, 0, 0, 0.89444],
    "9826": [0.12963, 0.69444, 0, 0, 0.89444],
    "9827": [0.12963, 0.69444, 0, 0, 0.89444],
    "9837": [0, 0.75, 0, 0, 0.44722],
    "9838": [0.19444, 0.69444, 0, 0, 0.44722],
    "9839": [0.19444, 0.69444, 0, 0, 0.44722],
    "10216": [0.25, 0.75, 0, 0, 0.44722],
    "10217": [0.25, 0.75, 0, 0, 0.44722],
    "10815": [0, 0.68611, 0, 0, 0.9],
    "10927": [0.19667, 0.69667, 0, 0, 0.89444],
    "10928": [0.19667, 0.69667, 0, 0, 0.89444],
    "57376": [0.19444, 0.69444, 0, 0, 0]
  },
  "Main-BoldItalic": {
    "32": [0, 0, 0, 0, 0.25],
    "33": [0, 0.69444, 0.11417, 0, 0.38611],
    "34": [0, 0.69444, 0.07939, 0, 0.62055],
    "35": [0.19444, 0.69444, 0.06833, 0, 0.94444],
    "37": [0.05556, 0.75, 0.12861, 0, 0.94444],
    "38": [0, 0.69444, 0.08528, 0, 0.88555],
    "39": [0, 0.69444, 0.12945, 0, 0.35555],
    "40": [0.25, 0.75, 0.15806, 0, 0.47333],
    "41": [0.25, 0.75, 0.03306, 0, 0.47333],
    "42": [0, 0.75, 0.14333, 0, 0.59111],
    "43": [0.10333, 0.60333, 0.03306, 0, 0.88555],
    "44": [0.19444, 0.14722, 0, 0, 0.35555],
    "45": [0, 0.44444, 0.02611, 0, 0.41444],
    "46": [0, 0.14722, 0, 0, 0.35555],
    "47": [0.25, 0.75, 0.15806, 0, 0.59111],
    "48": [0, 0.64444, 0.13167, 0, 0.59111],
    "49": [0, 0.64444, 0.13167, 0, 0.59111],
    "50": [0, 0.64444, 0.13167, 0, 0.59111],
    "51": [0, 0.64444, 0.13167, 0, 0.59111],
    "52": [0.19444, 0.64444, 0.13167, 0, 0.59111],
    "53": [0, 0.64444, 0.13167, 0, 0.59111],
    "54": [0, 0.64444, 0.13167, 0, 0.59111],
    "55": [0.19444, 0.64444, 0.13167, 0, 0.59111],
    "56": [0, 0.64444, 0.13167, 0, 0.59111],
    "57": [0, 0.64444, 0.13167, 0, 0.59111],
    "58": [0, 0.44444, 0.06695, 0, 0.35555],
    "59": [0.19444, 0.44444, 0.06695, 0, 0.35555],
    "61": [-0.10889, 0.39111, 0.06833, 0, 0.88555],
    "63": [0, 0.69444, 0.11472, 0, 0.59111],
    "64": [0, 0.69444, 0.09208, 0, 0.88555],
    "65": [0, 0.68611, 0, 0, 0.86555],
    "66": [0, 0.68611, 0.0992, 0, 0.81666],
    "67": [0, 0.68611, 0.14208, 0, 0.82666],
    "68": [0, 0.68611, 0.09062, 0, 0.87555],
    "69": [0, 0.68611, 0.11431, 0, 0.75666],
    "70": [0, 0.68611, 0.12903, 0, 0.72722],
    "71": [0, 0.68611, 0.07347, 0, 0.89527],
    "72": [0, 0.68611, 0.17208, 0, 0.8961],
    "73": [0, 0.68611, 0.15681, 0, 0.47166],
    "74": [0, 0.68611, 0.145, 0, 0.61055],
    "75": [0, 0.68611, 0.14208, 0, 0.89499],
    "76": [0, 0.68611, 0, 0, 0.69777],
    "77": [0, 0.68611, 0.17208, 0, 1.07277],
    "78": [0, 0.68611, 0.17208, 0, 0.8961],
    "79": [0, 0.68611, 0.09062, 0, 0.85499],
    "80": [0, 0.68611, 0.0992, 0, 0.78721],
    "81": [0.19444, 0.68611, 0.09062, 0, 0.85499],
    "82": [0, 0.68611, 0.02559, 0, 0.85944],
    "83": [0, 0.68611, 0.11264, 0, 0.64999],
    "84": [0, 0.68611, 0.12903, 0, 0.7961],
    "85": [0, 0.68611, 0.17208, 0, 0.88083],
    "86": [0, 0.68611, 0.18625, 0, 0.86555],
    "87": [0, 0.68611, 0.18625, 0, 1.15999],
    "88": [0, 0.68611, 0.15681, 0, 0.86555],
    "89": [0, 0.68611, 0.19803, 0, 0.86555],
    "90": [0, 0.68611, 0.14208, 0, 0.70888],
    "91": [0.25, 0.75, 0.1875, 0, 0.35611],
    "93": [0.25, 0.75, 0.09972, 0, 0.35611],
    "94": [0, 0.69444, 0.06709, 0, 0.59111],
    "95": [0.31, 0.13444, 0.09811, 0, 0.59111],
    "97": [0, 0.44444, 0.09426, 0, 0.59111],
    "98": [0, 0.69444, 0.07861, 0, 0.53222],
    "99": [0, 0.44444, 0.05222, 0, 0.53222],
    "100": [0, 0.69444, 0.10861, 0, 0.59111],
    "101": [0, 0.44444, 0.085, 0, 0.53222],
    "102": [0.19444, 0.69444, 0.21778, 0, 0.4],
    "103": [0.19444, 0.44444, 0.105, 0, 0.53222],
    "104": [0, 0.69444, 0.09426, 0, 0.59111],
    "105": [0, 0.69326, 0.11387, 0, 0.35555],
    "106": [0.19444, 0.69326, 0.1672, 0, 0.35555],
    "107": [0, 0.69444, 0.11111, 0, 0.53222],
    "108": [0, 0.69444, 0.10861, 0, 0.29666],
    "109": [0, 0.44444, 0.09426, 0, 0.94444],
    "110": [0, 0.44444, 0.09426, 0, 0.64999],
    "111": [0, 0.44444, 0.07861, 0, 0.59111],
    "112": [0.19444, 0.44444, 0.07861, 0, 0.59111],
    "113": [0.19444, 0.44444, 0.105, 0, 0.53222],
    "114": [0, 0.44444, 0.11111, 0, 0.50167],
    "115": [0, 0.44444, 0.08167, 0, 0.48694],
    "116": [0, 0.63492, 0.09639, 0, 0.385],
    "117": [0, 0.44444, 0.09426, 0, 0.62055],
    "118": [0, 0.44444, 0.11111, 0, 0.53222],
    "119": [0, 0.44444, 0.11111, 0, 0.76777],
    "120": [0, 0.44444, 0.12583, 0, 0.56055],
    "121": [0.19444, 0.44444, 0.105, 0, 0.56166],
    "122": [0, 0.44444, 0.13889, 0, 0.49055],
    "126": [0.35, 0.34444, 0.11472, 0, 0.59111],
    "160": [0, 0, 0, 0, 0.25],
    "168": [0, 0.69444, 0.11473, 0, 0.59111],
    "176": [0, 0.69444, 0, 0, 0.94888],
    "184": [0.17014, 0, 0, 0, 0.53222],
    "198": [0, 0.68611, 0.11431, 0, 1.02277],
    "216": [0.04861, 0.73472, 0.09062, 0, 0.88555],
    "223": [0.19444, 0.69444, 0.09736, 0, 0.665],
    "230": [0, 0.44444, 0.085, 0, 0.82666],
    "248": [0.09722, 0.54167, 0.09458, 0, 0.59111],
    "305": [0, 0.44444, 0.09426, 0, 0.35555],
    "338": [0, 0.68611, 0.11431, 0, 1.14054],
    "339": [0, 0.44444, 0.085, 0, 0.82666],
    "567": [0.19444, 0.44444, 0.04611, 0, 0.385],
    "710": [0, 0.69444, 0.06709, 0, 0.59111],
    "711": [0, 0.63194, 0.08271, 0, 0.59111],
    "713": [0, 0.59444, 0.10444, 0, 0.59111],
    "714": [0, 0.69444, 0.08528, 0, 0.59111],
    "715": [0, 0.69444, 0, 0, 0.59111],
    "728": [0, 0.69444, 0.10333, 0, 0.59111],
    "729": [0, 0.69444, 0.12945, 0, 0.35555],
    "730": [0, 0.69444, 0, 0, 0.94888],
    "732": [0, 0.69444, 0.11472, 0, 0.59111],
    "733": [0, 0.69444, 0.11472, 0, 0.59111],
    "915": [0, 0.68611, 0.12903, 0, 0.69777],
    "916": [0, 0.68611, 0, 0, 0.94444],
    "920": [0, 0.68611, 0.09062, 0, 0.88555],
    "923": [0, 0.68611, 0, 0, 0.80666],
    "926": [0, 0.68611, 0.15092, 0, 0.76777],
    "928": [0, 0.68611, 0.17208, 0, 0.8961],
    "931": [0, 0.68611, 0.11431, 0, 0.82666],
    "933": [0, 0.68611, 0.10778, 0, 0.88555],
    "934": [0, 0.68611, 0.05632, 0, 0.82666],
    "936": [0, 0.68611, 0.10778, 0, 0.88555],
    "937": [0, 0.68611, 0.0992, 0, 0.82666],
    "8211": [0, 0.44444, 0.09811, 0, 0.59111],
    "8212": [0, 0.44444, 0.09811, 0, 1.18221],
    "8216": [0, 0.69444, 0.12945, 0, 0.35555],
    "8217": [0, 0.69444, 0.12945, 0, 0.35555],
    "8220": [0, 0.69444, 0.16772, 0, 0.62055],
    "8221": [0, 0.69444, 0.07939, 0, 0.62055]
  },
  "Main-Italic": {
    "32": [0, 0, 0, 0, 0.25],
    "33": [0, 0.69444, 0.12417, 0, 0.30667],
    "34": [0, 0.69444, 0.06961, 0, 0.51444],
    "35": [0.19444, 0.69444, 0.06616, 0, 0.81777],
    "37": [0.05556, 0.75, 0.13639, 0, 0.81777],
    "38": [0, 0.69444, 0.09694, 0, 0.76666],
    "39": [0, 0.69444, 0.12417, 0, 0.30667],
    "40": [0.25, 0.75, 0.16194, 0, 0.40889],
    "41": [0.25, 0.75, 0.03694, 0, 0.40889],
    "42": [0, 0.75, 0.14917, 0, 0.51111],
    "43": [0.05667, 0.56167, 0.03694, 0, 0.76666],
    "44": [0.19444, 0.10556, 0, 0, 0.30667],
    "45": [0, 0.43056, 0.02826, 0, 0.35778],
    "46": [0, 0.10556, 0, 0, 0.30667],
    "47": [0.25, 0.75, 0.16194, 0, 0.51111],
    "48": [0, 0.64444, 0.13556, 0, 0.51111],
    "49": [0, 0.64444, 0.13556, 0, 0.51111],
    "50": [0, 0.64444, 0.13556, 0, 0.51111],
    "51": [0, 0.64444, 0.13556, 0, 0.51111],
    "52": [0.19444, 0.64444, 0.13556, 0, 0.51111],
    "53": [0, 0.64444, 0.13556, 0, 0.51111],
    "54": [0, 0.64444, 0.13556, 0, 0.51111],
    "55": [0.19444, 0.64444, 0.13556, 0, 0.51111],
    "56": [0, 0.64444, 0.13556, 0, 0.51111],
    "57": [0, 0.64444, 0.13556, 0, 0.51111],
    "58": [0, 0.43056, 0.0582, 0, 0.30667],
    "59": [0.19444, 0.43056, 0.0582, 0, 0.30667],
    "61": [-0.13313, 0.36687, 0.06616, 0, 0.76666],
    "63": [0, 0.69444, 0.1225, 0, 0.51111],
    "64": [0, 0.69444, 0.09597, 0, 0.76666],
    "65": [0, 0.68333, 0, 0, 0.74333],
    "66": [0, 0.68333, 0.10257, 0, 0.70389],
    "67": [0, 0.68333, 0.14528, 0, 0.71555],
    "68": [0, 0.68333, 0.09403, 0, 0.755],
    "69": [0, 0.68333, 0.12028, 0, 0.67833],
    "70": [0, 0.68333, 0.13305, 0, 0.65277],
    "71": [0, 0.68333, 0.08722, 0, 0.77361],
    "72": [0, 0.68333, 0.16389, 0, 0.74333],
    "73": [0, 0.68333, 0.15806, 0, 0.38555],
    "74": [0, 0.68333, 0.14028, 0, 0.525],
    "75": [0, 0.68333, 0.14528, 0, 0.76888],
    "76": [0, 0.68333, 0, 0, 0.62722],
    "77": [0, 0.68333, 0.16389, 0, 0.89666],
    "78": [0, 0.68333, 0.16389, 0, 0.74333],
    "79": [0, 0.68333, 0.09403, 0, 0.76666],
    "80": [0, 0.68333, 0.10257, 0, 0.67833],
    "81": [0.19444, 0.68333, 0.09403, 0, 0.76666],
    "82": [0, 0.68333, 0.03868, 0, 0.72944],
    "83": [0, 0.68333, 0.11972, 0, 0.56222],
    "84": [0, 0.68333, 0.13305, 0, 0.71555],
    "85": [0, 0.68333, 0.16389, 0, 0.74333],
    "86": [0, 0.68333, 0.18361, 0, 0.74333],
    "87": [0, 0.68333, 0.18361, 0, 0.99888],
    "88": [0, 0.68333, 0.15806, 0, 0.74333],
    "89": [0, 0.68333, 0.19383, 0, 0.74333],
    "90": [0, 0.68333, 0.14528, 0, 0.61333],
    "91": [0.25, 0.75, 0.1875, 0, 0.30667],
    "93": [0.25, 0.75, 0.10528, 0, 0.30667],
    "94": [0, 0.69444, 0.06646, 0, 0.51111],
    "95": [0.31, 0.12056, 0.09208, 0, 0.51111],
    "97": [0, 0.43056, 0.07671, 0, 0.51111],
    "98": [0, 0.69444, 0.06312, 0, 0.46],
    "99": [0, 0.43056, 0.05653, 0, 0.46],
    "100": [0, 0.69444, 0.10333, 0, 0.51111],
    "101": [0, 0.43056, 0.07514, 0, 0.46],
    "102": [0.19444, 0.69444, 0.21194, 0, 0.30667],
    "103": [0.19444, 0.43056, 0.08847, 0, 0.46],
    "104": [0, 0.69444, 0.07671, 0, 0.51111],
    "105": [0, 0.65536, 0.1019, 0, 0.30667],
    "106": [0.19444, 0.65536, 0.14467, 0, 0.30667],
    "107": [0, 0.69444, 0.10764, 0, 0.46],
    "108": [0, 0.69444, 0.10333, 0, 0.25555],
    "109": [0, 0.43056, 0.07671, 0, 0.81777],
    "110": [0, 0.43056, 0.07671, 0, 0.56222],
    "111": [0, 0.43056, 0.06312, 0, 0.51111],
    "112": [0.19444, 0.43056, 0.06312, 0, 0.51111],
    "113": [0.19444, 0.43056, 0.08847, 0, 0.46],
    "114": [0, 0.43056, 0.10764, 0, 0.42166],
    "115": [0, 0.43056, 0.08208, 0, 0.40889],
    "116": [0, 0.61508, 0.09486, 0, 0.33222],
    "117": [0, 0.43056, 0.07671, 0, 0.53666],
    "118": [0, 0.43056, 0.10764, 0, 0.46],
    "119": [0, 0.43056, 0.10764, 0, 0.66444],
    "120": [0, 0.43056, 0.12042, 0, 0.46389],
    "121": [0.19444, 0.43056, 0.08847, 0, 0.48555],
    "122": [0, 0.43056, 0.12292, 0, 0.40889],
    "126": [0.35, 0.31786, 0.11585, 0, 0.51111],
    "160": [0, 0, 0, 0, 0.25],
    "168": [0, 0.66786, 0.10474, 0, 0.51111],
    "176": [0, 0.69444, 0, 0, 0.83129],
    "184": [0.17014, 0, 0, 0, 0.46],
    "198": [0, 0.68333, 0.12028, 0, 0.88277],
    "216": [0.04861, 0.73194, 0.09403, 0, 0.76666],
    "223": [0.19444, 0.69444, 0.10514, 0, 0.53666],
    "230": [0, 0.43056, 0.07514, 0, 0.71555],
    "248": [0.09722, 0.52778, 0.09194, 0, 0.51111],
    "338": [0, 0.68333, 0.12028, 0, 0.98499],
    "339": [0, 0.43056, 0.07514, 0, 0.71555],
    "710": [0, 0.69444, 0.06646, 0, 0.51111],
    "711": [0, 0.62847, 0.08295, 0, 0.51111],
    "713": [0, 0.56167, 0.10333, 0, 0.51111],
    "714": [0, 0.69444, 0.09694, 0, 0.51111],
    "715": [0, 0.69444, 0, 0, 0.51111],
    "728": [0, 0.69444, 0.10806, 0, 0.51111],
    "729": [0, 0.66786, 0.11752, 0, 0.30667],
    "730": [0, 0.69444, 0, 0, 0.83129],
    "732": [0, 0.66786, 0.11585, 0, 0.51111],
    "733": [0, 0.69444, 0.1225, 0, 0.51111],
    "915": [0, 0.68333, 0.13305, 0, 0.62722],
    "916": [0, 0.68333, 0, 0, 0.81777],
    "920": [0, 0.68333, 0.09403, 0, 0.76666],
    "923": [0, 0.68333, 0, 0, 0.69222],
    "926": [0, 0.68333, 0.15294, 0, 0.66444],
    "928": [0, 0.68333, 0.16389, 0, 0.74333],
    "931": [0, 0.68333, 0.12028, 0, 0.71555],
    "933": [0, 0.68333, 0.11111, 0, 0.76666],
    "934": [0, 0.68333, 0.05986, 0, 0.71555],
    "936": [0, 0.68333, 0.11111, 0, 0.76666],
    "937": [0, 0.68333, 0.10257, 0, 0.71555],
    "8211": [0, 0.43056, 0.09208, 0, 0.51111],
    "8212": [0, 0.43056, 0.09208, 0, 1.02222],
    "8216": [0, 0.69444, 0.12417, 0, 0.30667],
    "8217": [0, 0.69444, 0.12417, 0, 0.30667],
    "8220": [0, 0.69444, 0.1685, 0, 0.51444],
    "8221": [0, 0.69444, 0.06961, 0, 0.51444],
    "8463": [0, 0.68889, 0, 0, 0.54028]
  },
  "Main-Regular": {
    "32": [0, 0, 0, 0, 0.25],
    "33": [0, 0.69444, 0, 0, 0.27778],
    "34": [0, 0.69444, 0, 0, 0.5],
    "35": [0.19444, 0.69444, 0, 0, 0.83334],
    "36": [0.05556, 0.75, 0, 0, 0.5],
    "37": [0.05556, 0.75, 0, 0, 0.83334],
    "38": [0, 0.69444, 0, 0, 0.77778],
    "39": [0, 0.69444, 0, 0, 0.27778],
    "40": [0.25, 0.75, 0, 0, 0.38889],
    "41": [0.25, 0.75, 0, 0, 0.38889],
    "42": [0, 0.75, 0, 0, 0.5],
    "43": [0.08333, 0.58333, 0, 0, 0.77778],
    "44": [0.19444, 0.10556, 0, 0, 0.27778],
    "45": [0, 0.43056, 0, 0, 0.33333],
    "46": [0, 0.10556, 0, 0, 0.27778],
    "47": [0.25, 0.75, 0, 0, 0.5],
    "48": [0, 0.64444, 0, 0, 0.5],
    "49": [0, 0.64444, 0, 0, 0.5],
    "50": [0, 0.64444, 0, 0, 0.5],
    "51": [0, 0.64444, 0, 0, 0.5],
    "52": [0, 0.64444, 0, 0, 0.5],
    "53": [0, 0.64444, 0, 0, 0.5],
    "54": [0, 0.64444, 0, 0, 0.5],
    "55": [0, 0.64444, 0, 0, 0.5],
    "56": [0, 0.64444, 0, 0, 0.5],
    "57": [0, 0.64444, 0, 0, 0.5],
    "58": [0, 0.43056, 0, 0, 0.27778],
    "59": [0.19444, 0.43056, 0, 0, 0.27778],
    "60": [0.0391, 0.5391, 0, 0, 0.77778],
    "61": [-0.13313, 0.36687, 0, 0, 0.77778],
    "62": [0.0391, 0.5391, 0, 0, 0.77778],
    "63": [0, 0.69444, 0, 0, 0.47222],
    "64": [0, 0.69444, 0, 0, 0.77778],
    "65": [0, 0.68333, 0, 0, 0.75],
    "66": [0, 0.68333, 0, 0, 0.70834],
    "67": [0, 0.68333, 0, 0, 0.72222],
    "68": [0, 0.68333, 0, 0, 0.76389],
    "69": [0, 0.68333, 0, 0, 0.68056],
    "70": [0, 0.68333, 0, 0, 0.65278],
    "71": [0, 0.68333, 0, 0, 0.78472],
    "72": [0, 0.68333, 0, 0, 0.75],
    "73": [0, 0.68333, 0, 0, 0.36111],
    "74": [0, 0.68333, 0, 0, 0.51389],
    "75": [0, 0.68333, 0, 0, 0.77778],
    "76": [0, 0.68333, 0, 0, 0.625],
    "77": [0, 0.68333, 0, 0, 0.91667],
    "78": [0, 0.68333, 0, 0, 0.75],
    "79": [0, 0.68333, 0, 0, 0.77778],
    "80": [0, 0.68333, 0, 0, 0.68056],
    "81": [0.19444, 0.68333, 0, 0, 0.77778],
    "82": [0, 0.68333, 0, 0, 0.73611],
    "83": [0, 0.68333, 0, 0, 0.55556],
    "84": [0, 0.68333, 0, 0, 0.72222],
    "85": [0, 0.68333, 0, 0, 0.75],
    "86": [0, 0.68333, 0.01389, 0, 0.75],
    "87": [0, 0.68333, 0.01389, 0, 1.02778],
    "88": [0, 0.68333, 0, 0, 0.75],
    "89": [0, 0.68333, 0.025, 0, 0.75],
    "90": [0, 0.68333, 0, 0, 0.61111],
    "91": [0.25, 0.75, 0, 0, 0.27778],
    "92": [0.25, 0.75, 0, 0, 0.5],
    "93": [0.25, 0.75, 0, 0, 0.27778],
    "94": [0, 0.69444, 0, 0, 0.5],
    "95": [0.31, 0.12056, 0.02778, 0, 0.5],
    "97": [0, 0.43056, 0, 0, 0.5],
    "98": [0, 0.69444, 0, 0, 0.55556],
    "99": [0, 0.43056, 0, 0, 0.44445],
    "100": [0, 0.69444, 0, 0, 0.55556],
    "101": [0, 0.43056, 0, 0, 0.44445],
    "102": [0, 0.69444, 0.07778, 0, 0.30556],
    "103": [0.19444, 0.43056, 0.01389, 0, 0.5],
    "104": [0, 0.69444, 0, 0, 0.55556],
    "105": [0, 0.66786, 0, 0, 0.27778],
    "106": [0.19444, 0.66786, 0, 0, 0.30556],
    "107": [0, 0.69444, 0, 0, 0.52778],
    "108": [0, 0.69444, 0, 0, 0.27778],
    "109": [0, 0.43056, 0, 0, 0.83334],
    "110": [0, 0.43056, 0, 0, 0.55556],
    "111": [0, 0.43056, 0, 0, 0.5],
    "112": [0.19444, 0.43056, 0, 0, 0.55556],
    "113": [0.19444, 0.43056, 0, 0, 0.52778],
    "114": [0, 0.43056, 0, 0, 0.39167],
    "115": [0, 0.43056, 0, 0, 0.39445],
    "116": [0, 0.61508, 0, 0, 0.38889],
    "117": [0, 0.43056, 0, 0, 0.55556],
    "118": [0, 0.43056, 0.01389, 0, 0.52778],
    "119": [0, 0.43056, 0.01389, 0, 0.72222],
    "120": [0, 0.43056, 0, 0, 0.52778],
    "121": [0.19444, 0.43056, 0.01389, 0, 0.52778],
    "122": [0, 0.43056, 0, 0, 0.44445],
    "123": [0.25, 0.75, 0, 0, 0.5],
    "124": [0.25, 0.75, 0, 0, 0.27778],
    "125": [0.25, 0.75, 0, 0, 0.5],
    "126": [0.35, 0.31786, 0, 0, 0.5],
    "160": [0, 0, 0, 0, 0.25],
    "163": [0, 0.69444, 0, 0, 0.76909],
    "167": [0.19444, 0.69444, 0, 0, 0.44445],
    "168": [0, 0.66786, 0, 0, 0.5],
    "172": [0, 0.43056, 0, 0, 0.66667],
    "176": [0, 0.69444, 0, 0, 0.75],
    "177": [0.08333, 0.58333, 0, 0, 0.77778],
    "182": [0.19444, 0.69444, 0, 0, 0.61111],
    "184": [0.17014, 0, 0, 0, 0.44445],
    "198": [0, 0.68333, 0, 0, 0.90278],
    "215": [0.08333, 0.58333, 0, 0, 0.77778],
    "216": [0.04861, 0.73194, 0, 0, 0.77778],
    "223": [0, 0.69444, 0, 0, 0.5],
    "230": [0, 0.43056, 0, 0, 0.72222],
    "247": [0.08333, 0.58333, 0, 0, 0.77778],
    "248": [0.09722, 0.52778, 0, 0, 0.5],
    "305": [0, 0.43056, 0, 0, 0.27778],
    "338": [0, 0.68333, 0, 0, 1.01389],
    "339": [0, 0.43056, 0, 0, 0.77778],
    "567": [0.19444, 0.43056, 0, 0, 0.30556],
    "710": [0, 0.69444, 0, 0, 0.5],
    "711": [0, 0.62847, 0, 0, 0.5],
    "713": [0, 0.56778, 0, 0, 0.5],
    "714": [0, 0.69444, 0, 0, 0.5],
    "715": [0, 0.69444, 0, 0, 0.5],
    "728": [0, 0.69444, 0, 0, 0.5],
    "729": [0, 0.66786, 0, 0, 0.27778],
    "730": [0, 0.69444, 0, 0, 0.75],
    "732": [0, 0.66786, 0, 0, 0.5],
    "733": [0, 0.69444, 0, 0, 0.5],
    "915": [0, 0.68333, 0, 0, 0.625],
    "916": [0, 0.68333, 0, 0, 0.83334],
    "920": [0, 0.68333, 0, 0, 0.77778],
    "923": [0, 0.68333, 0, 0, 0.69445],
    "926": [0, 0.68333, 0, 0, 0.66667],
    "928": [0, 0.68333, 0, 0, 0.75],
    "931": [0, 0.68333, 0, 0, 0.72222],
    "933": [0, 0.68333, 0, 0, 0.77778],
    "934": [0, 0.68333, 0, 0, 0.72222],
    "936": [0, 0.68333, 0, 0, 0.77778],
    "937": [0, 0.68333, 0, 0, 0.72222],
    "8211": [0, 0.43056, 0.02778, 0, 0.5],
    "8212": [0, 0.43056, 0.02778, 0, 1.0],
    "8216": [0, 0.69444, 0, 0, 0.27778],
    "8217": [0, 0.69444, 0, 0, 0.27778],
    "8220": [0, 0.69444, 0, 0, 0.5],
    "8221": [0, 0.69444, 0, 0, 0.5],
    "8224": [0.19444, 0.69444, 0, 0, 0.44445],
    "8225": [0.19444, 0.69444, 0, 0, 0.44445],
    "8230": [0, 0.123, 0, 0, 1.172],
    "8242": [0, 0.55556, 0, 0, 0.275],
    "8407": [0, 0.71444, 0.15382, 0, 0.5],
    "8463": [0, 0.68889, 0, 0, 0.54028],
    "8465": [0, 0.69444, 0, 0, 0.72222],
    "8467": [0, 0.69444, 0, 0.11111, 0.41667],
    "8472": [0.19444, 0.43056, 0, 0.11111, 0.63646],
    "8476": [0, 0.69444, 0, 0, 0.72222],
    "8501": [0, 0.69444, 0, 0, 0.61111],
    "8592": [-0.13313, 0.36687, 0, 0, 1.0],
    "8593": [0.19444, 0.69444, 0, 0, 0.5],
    "8594": [-0.13313, 0.36687, 0, 0, 1.0],
    "8595": [0.19444, 0.69444, 0, 0, 0.5],
    "8596": [-0.13313, 0.36687, 0, 0, 1.0],
    "8597": [0.25, 0.75, 0, 0, 0.5],
    "8598": [0.19444, 0.69444, 0, 0, 1.0],
    "8599": [0.19444, 0.69444, 0, 0, 1.0],
    "8600": [0.19444, 0.69444, 0, 0, 1.0],
    "8601": [0.19444, 0.69444, 0, 0, 1.0],
    "8614": [0.011, 0.511, 0, 0, 1.0],
    "8617": [0.011, 0.511, 0, 0, 1.126],
    "8618": [0.011, 0.511, 0, 0, 1.126],
    "8636": [-0.13313, 0.36687, 0, 0, 1.0],
    "8637": [-0.13313, 0.36687, 0, 0, 1.0],
    "8640": [-0.13313, 0.36687, 0, 0, 1.0],
    "8641": [-0.13313, 0.36687, 0, 0, 1.0],
    "8652": [0.011, 0.671, 0, 0, 1.0],
    "8656": [-0.13313, 0.36687, 0, 0, 1.0],
    "8657": [0.19444, 0.69444, 0, 0, 0.61111],
    "8658": [-0.13313, 0.36687, 0, 0, 1.0],
    "8659": [0.19444, 0.69444, 0, 0, 0.61111],
    "8660": [-0.13313, 0.36687, 0, 0, 1.0],
    "8661": [0.25, 0.75, 0, 0, 0.61111],
    "8704": [0, 0.69444, 0, 0, 0.55556],
    "8706": [0, 0.69444, 0.05556, 0.08334, 0.5309],
    "8707": [0, 0.69444, 0, 0, 0.55556],
    "8709": [0.05556, 0.75, 0, 0, 0.5],
    "8711": [0, 0.68333, 0, 0, 0.83334],
    "8712": [0.0391, 0.5391, 0, 0, 0.66667],
    "8715": [0.0391, 0.5391, 0, 0, 0.66667],
    "8722": [0.08333, 0.58333, 0, 0, 0.77778],
    "8723": [0.08333, 0.58333, 0, 0, 0.77778],
    "8725": [0.25, 0.75, 0, 0, 0.5],
    "8726": [0.25, 0.75, 0, 0, 0.5],
    "8727": [-0.03472, 0.46528, 0, 0, 0.5],
    "8728": [-0.05555, 0.44445, 0, 0, 0.5],
    "8729": [-0.05555, 0.44445, 0, 0, 0.5],
    "8730": [0.2, 0.8, 0, 0, 0.83334],
    "8733": [0, 0.43056, 0, 0, 0.77778],
    "8734": [0, 0.43056, 0, 0, 1.0],
    "8736": [0, 0.69224, 0, 0, 0.72222],
    "8739": [0.25, 0.75, 0, 0, 0.27778],
    "8741": [0.25, 0.75, 0, 0, 0.5],
    "8743": [0, 0.55556, 0, 0, 0.66667],
    "8744": [0, 0.55556, 0, 0, 0.66667],
    "8745": [0, 0.55556, 0, 0, 0.66667],
    "8746": [0, 0.55556, 0, 0, 0.66667],
    "8747": [0.19444, 0.69444, 0.11111, 0, 0.41667],
    "8764": [-0.13313, 0.36687, 0, 0, 0.77778],
    "8768": [0.19444, 0.69444, 0, 0, 0.27778],
    "8771": [-0.03625, 0.46375, 0, 0, 0.77778],
    "8773": [-0.022, 0.589, 0, 0, 0.778],
    "8776": [-0.01688, 0.48312, 0, 0, 0.77778],
    "8781": [-0.03625, 0.46375, 0, 0, 0.77778],
    "8784": [-0.133, 0.673, 0, 0, 0.778],
    "8801": [-0.03625, 0.46375, 0, 0, 0.77778],
    "8804": [0.13597, 0.63597, 0, 0, 0.77778],
    "8805": [0.13597, 0.63597, 0, 0, 0.77778],
    "8810": [0.0391, 0.5391, 0, 0, 1.0],
    "8811": [0.0391, 0.5391, 0, 0, 1.0],
    "8826": [0.0391, 0.5391, 0, 0, 0.77778],
    "8827": [0.0391, 0.5391, 0, 0, 0.77778],
    "8834": [0.0391, 0.5391, 0, 0, 0.77778],
    "8835": [0.0391, 0.5391, 0, 0, 0.77778],
    "8838": [0.13597, 0.63597, 0, 0, 0.77778],
    "8839": [0.13597, 0.63597, 0, 0, 0.77778],
    "8846": [0, 0.55556, 0, 0, 0.66667],
    "8849": [0.13597, 0.63597, 0, 0, 0.77778],
    "8850": [0.13597, 0.63597, 0, 0, 0.77778],
    "8851": [0, 0.55556, 0, 0, 0.66667],
    "8852": [0, 0.55556, 0, 0, 0.66667],
    "8853": [0.08333, 0.58333, 0, 0, 0.77778],
    "8854": [0.08333, 0.58333, 0, 0, 0.77778],
    "8855": [0.08333, 0.58333, 0, 0, 0.77778],
    "8856": [0.08333, 0.58333, 0, 0, 0.77778],
    "8857": [0.08333, 0.58333, 0, 0, 0.77778],
    "8866": [0, 0.69444, 0, 0, 0.61111],
    "8867": [0, 0.69444, 0, 0, 0.61111],
    "8868": [0, 0.69444, 0, 0, 0.77778],
    "8869": [0, 0.69444, 0, 0, 0.77778],
    "8872": [0.249, 0.75, 0, 0, 0.867],
    "8900": [-0.05555, 0.44445, 0, 0, 0.5],
    "8901": [-0.05555, 0.44445, 0, 0, 0.27778],
    "8902": [-0.03472, 0.46528, 0, 0, 0.5],
    "8904": [0.005, 0.505, 0, 0, 0.9],
    "8942": [0.03, 0.903, 0, 0, 0.278],
    "8943": [-0.19, 0.313, 0, 0, 1.172],
    "8945": [-0.1, 0.823, 0, 0, 1.282],
    "8968": [0.25, 0.75, 0, 0, 0.44445],
    "8969": [0.25, 0.75, 0, 0, 0.44445],
    "8970": [0.25, 0.75, 0, 0, 0.44445],
    "8971": [0.25, 0.75, 0, 0, 0.44445],
    "8994": [-0.14236, 0.35764, 0, 0, 1.0],
    "8995": [-0.14236, 0.35764, 0, 0, 1.0],
    "9136": [0.244, 0.744, 0, 0, 0.412],
    "9137": [0.244, 0.745, 0, 0, 0.412],
    "9651": [0.19444, 0.69444, 0, 0, 0.88889],
    "9657": [-0.03472, 0.46528, 0, 0, 0.5],
    "9661": [0.19444, 0.69444, 0, 0, 0.88889],
    "9667": [-0.03472, 0.46528, 0, 0, 0.5],
    "9711": [0.19444, 0.69444, 0, 0, 1.0],
    "9824": [0.12963, 0.69444, 0, 0, 0.77778],
    "9825": [0.12963, 0.69444, 0, 0, 0.77778],
    "9826": [0.12963, 0.69444, 0, 0, 0.77778],
    "9827": [0.12963, 0.69444, 0, 0, 0.77778],
    "9837": [0, 0.75, 0, 0, 0.38889],
    "9838": [0.19444, 0.69444, 0, 0, 0.38889],
    "9839": [0.19444, 0.69444, 0, 0, 0.38889],
    "10216": [0.25, 0.75, 0, 0, 0.38889],
    "10217": [0.25, 0.75, 0, 0, 0.38889],
    "10222": [0.244, 0.744, 0, 0, 0.412],
    "10223": [0.244, 0.745, 0, 0, 0.412],
    "10229": [0.011, 0.511, 0, 0, 1.609],
    "10230": [0.011, 0.511, 0, 0, 1.638],
    "10231": [0.011, 0.511, 0, 0, 1.859],
    "10232": [0.024, 0.525, 0, 0, 1.609],
    "10233": [0.024, 0.525, 0, 0, 1.638],
    "10234": [0.024, 0.525, 0, 0, 1.858],
    "10236": [0.011, 0.511, 0, 0, 1.638],
    "10815": [0, 0.68333, 0, 0, 0.75],
    "10927": [0.13597, 0.63597, 0, 0, 0.77778],
    "10928": [0.13597, 0.63597, 0, 0, 0.77778],
    "57376": [0.19444, 0.69444, 0, 0, 0]
  },
  "Math-BoldItalic": {
    "32": [0, 0, 0, 0, 0.25],
    "48": [0, 0.44444, 0, 0, 0.575],
    "49": [0, 0.44444, 0, 0, 0.575],
    "50": [0, 0.44444, 0, 0, 0.575],
    "51": [0.19444, 0.44444, 0, 0, 0.575],
    "52": [0.19444, 0.44444, 0, 0, 0.575],
    "53": [0.19444, 0.44444, 0, 0, 0.575],
    "54": [0, 0.64444, 0, 0, 0.575],
    "55": [0.19444, 0.44444, 0, 0, 0.575],
    "56": [0, 0.64444, 0, 0, 0.575],
    "57": [0.19444, 0.44444, 0, 0, 0.575],
    "65": [0, 0.68611, 0, 0, 0.86944],
    "66": [0, 0.68611, 0.04835, 0, 0.8664],
    "67": [0, 0.68611, 0.06979, 0, 0.81694],
    "68": [0, 0.68611, 0.03194, 0, 0.93812],
    "69": [0, 0.68611, 0.05451, 0, 0.81007],
    "70": [0, 0.68611, 0.15972, 0, 0.68889],
    "71": [0, 0.68611, 0, 0, 0.88673],
    "72": [0, 0.68611, 0.08229, 0, 0.98229],
    "73": [0, 0.68611, 0.07778, 0, 0.51111],
    "74": [0, 0.68611, 0.10069, 0, 0.63125],
    "75": [0, 0.68611, 0.06979, 0, 0.97118],
    "76": [0, 0.68611, 0, 0, 0.75555],
    "77": [0, 0.68611, 0.11424, 0, 1.14201],
    "78": [0, 0.68611, 0.11424, 0, 0.95034],
    "79": [0, 0.68611, 0.03194, 0, 0.83666],
    "80": [0, 0.68611, 0.15972, 0, 0.72309],
    "81": [0.19444, 0.68611, 0, 0, 0.86861],
    "82": [0, 0.68611, 0.00421, 0, 0.87235],
    "83": [0, 0.68611, 0.05382, 0, 0.69271],
    "84": [0, 0.68611, 0.15972, 0, 0.63663],
    "85": [0, 0.68611, 0.11424, 0, 0.80027],
    "86": [0, 0.68611, 0.25555, 0, 0.67778],
    "87": [0, 0.68611, 0.15972, 0, 1.09305],
    "88": [0, 0.68611, 0.07778, 0, 0.94722],
    "89": [0, 0.68611, 0.25555, 0, 0.67458],
    "90": [0, 0.68611, 0.06979, 0, 0.77257],
    "97": [0, 0.44444, 0, 0, 0.63287],
    "98": [0, 0.69444, 0, 0, 0.52083],
    "99": [0, 0.44444, 0, 0, 0.51342],
    "100": [0, 0.69444, 0, 0, 0.60972],
    "101": [0, 0.44444, 0, 0, 0.55361],
    "102": [0.19444, 0.69444, 0.11042, 0, 0.56806],
    "103": [0.19444, 0.44444, 0.03704, 0, 0.5449],
    "104": [0, 0.69444, 0, 0, 0.66759],
    "105": [0, 0.69326, 0, 0, 0.4048],
    "106": [0.19444, 0.69326, 0.0622, 0, 0.47083],
    "107": [0, 0.69444, 0.01852, 0, 0.6037],
    "108": [0, 0.69444, 0.0088, 0, 0.34815],
    "109": [0, 0.44444, 0, 0, 1.0324],
    "110": [0, 0.44444, 0, 0, 0.71296],
    "111": [0, 0.44444, 0, 0, 0.58472],
    "112": [0.19444, 0.44444, 0, 0, 0.60092],
    "113": [0.19444, 0.44444, 0.03704, 0, 0.54213],
    "114": [0, 0.44444, 0.03194, 0, 0.5287],
    "115": [0, 0.44444, 0, 0, 0.53125],
    "116": [0, 0.63492, 0, 0, 0.41528],
    "117": [0, 0.44444, 0, 0, 0.68102],
    "118": [0, 0.44444, 0.03704, 0, 0.56666],
    "119": [0, 0.44444, 0.02778, 0, 0.83148],
    "120": [0, 0.44444, 0, 0, 0.65903],
    "121": [0.19444, 0.44444, 0.03704, 0, 0.59028],
    "122": [0, 0.44444, 0.04213, 0, 0.55509],
    "160": [0, 0, 0, 0, 0.25],
    "915": [0, 0.68611, 0.15972, 0, 0.65694],
    "916": [0, 0.68611, 0, 0, 0.95833],
    "920": [0, 0.68611, 0.03194, 0, 0.86722],
    "923": [0, 0.68611, 0, 0, 0.80555],
    "926": [0, 0.68611, 0.07458, 0, 0.84125],
    "928": [0, 0.68611, 0.08229, 0, 0.98229],
    "931": [0, 0.68611, 0.05451, 0, 0.88507],
    "933": [0, 0.68611, 0.15972, 0, 0.67083],
    "934": [0, 0.68611, 0, 0, 0.76666],
    "936": [0, 0.68611, 0.11653, 0, 0.71402],
    "937": [0, 0.68611, 0.04835, 0, 0.8789],
    "945": [0, 0.44444, 0, 0, 0.76064],
    "946": [0.19444, 0.69444, 0.03403, 0, 0.65972],
    "947": [0.19444, 0.44444, 0.06389, 0, 0.59003],
    "948": [0, 0.69444, 0.03819, 0, 0.52222],
    "949": [0, 0.44444, 0, 0, 0.52882],
    "950": [0.19444, 0.69444, 0.06215, 0, 0.50833],
    "951": [0.19444, 0.44444, 0.03704, 0, 0.6],
    "952": [0, 0.69444, 0.03194, 0, 0.5618],
    "953": [0, 0.44444, 0, 0, 0.41204],
    "954": [0, 0.44444, 0, 0, 0.66759],
    "955": [0, 0.69444, 0, 0, 0.67083],
    "956": [0.19444, 0.44444, 0, 0, 0.70787],
    "957": [0, 0.44444, 0.06898, 0, 0.57685],
    "958": [0.19444, 0.69444, 0.03021, 0, 0.50833],
    "959": [0, 0.44444, 0, 0, 0.58472],
    "960": [0, 0.44444, 0.03704, 0, 0.68241],
    "961": [0.19444, 0.44444, 0, 0, 0.6118],
    "962": [0.09722, 0.44444, 0.07917, 0, 0.42361],
    "963": [0, 0.44444, 0.03704, 0, 0.68588],
    "964": [0, 0.44444, 0.13472, 0, 0.52083],
    "965": [0, 0.44444, 0.03704, 0, 0.63055],
    "966": [0.19444, 0.44444, 0, 0, 0.74722],
    "967": [0.19444, 0.44444, 0, 0, 0.71805],
    "968": [0.19444, 0.69444, 0.03704, 0, 0.75833],
    "969": [0, 0.44444, 0.03704, 0, 0.71782],
    "977": [0, 0.69444, 0, 0, 0.69155],
    "981": [0.19444, 0.69444, 0, 0, 0.7125],
    "982": [0, 0.44444, 0.03194, 0, 0.975],
    "1009": [0.19444, 0.44444, 0, 0, 0.6118],
    "1013": [0, 0.44444, 0, 0, 0.48333],
    "57649": [0, 0.44444, 0, 0, 0.39352],
    "57911": [0.19444, 0.44444, 0, 0, 0.43889]
  },
  "Math-Italic": {
    "32": [0, 0, 0, 0, 0.25],
    "48": [0, 0.43056, 0, 0, 0.5],
    "49": [0, 0.43056, 0, 0, 0.5],
    "50": [0, 0.43056, 0, 0, 0.5],
    "51": [0.19444, 0.43056, 0, 0, 0.5],
    "52": [0.19444, 0.43056, 0, 0, 0.5],
    "53": [0.19444, 0.43056, 0, 0, 0.5],
    "54": [0, 0.64444, 0, 0, 0.5],
    "55": [0.19444, 0.43056, 0, 0, 0.5],
    "56": [0, 0.64444, 0, 0, 0.5],
    "57": [0.19444, 0.43056, 0, 0, 0.5],
    "65": [0, 0.68333, 0, 0.13889, 0.75],
    "66": [0, 0.68333, 0.05017, 0.08334, 0.75851],
    "67": [0, 0.68333, 0.07153, 0.08334, 0.71472],
    "68": [0, 0.68333, 0.02778, 0.05556, 0.82792],
    "69": [0, 0.68333, 0.05764, 0.08334, 0.7382],
    "70": [0, 0.68333, 0.13889, 0.08334, 0.64306],
    "71": [0, 0.68333, 0, 0.08334, 0.78625],
    "72": [0, 0.68333, 0.08125, 0.05556, 0.83125],
    "73": [0, 0.68333, 0.07847, 0.11111, 0.43958],
    "74": [0, 0.68333, 0.09618, 0.16667, 0.55451],
    "75": [0, 0.68333, 0.07153, 0.05556, 0.84931],
    "76": [0, 0.68333, 0, 0.02778, 0.68056],
    "77": [0, 0.68333, 0.10903, 0.08334, 0.97014],
    "78": [0, 0.68333, 0.10903, 0.08334, 0.80347],
    "79": [0, 0.68333, 0.02778, 0.08334, 0.76278],
    "80": [0, 0.68333, 0.13889, 0.08334, 0.64201],
    "81": [0.19444, 0.68333, 0, 0.08334, 0.79056],
    "82": [0, 0.68333, 0.00773, 0.08334, 0.75929],
    "83": [0, 0.68333, 0.05764, 0.08334, 0.6132],
    "84": [0, 0.68333, 0.13889, 0.08334, 0.58438],
    "85": [0, 0.68333, 0.10903, 0.02778, 0.68278],
    "86": [0, 0.68333, 0.22222, 0, 0.58333],
    "87": [0, 0.68333, 0.13889, 0, 0.94445],
    "88": [0, 0.68333, 0.07847, 0.08334, 0.82847],
    "89": [0, 0.68333, 0.22222, 0, 0.58056],
    "90": [0, 0.68333, 0.07153, 0.08334, 0.68264],
    "97": [0, 0.43056, 0, 0, 0.52859],
    "98": [0, 0.69444, 0, 0, 0.42917],
    "99": [0, 0.43056, 0, 0.05556, 0.43276],
    "100": [0, 0.69444, 0, 0.16667, 0.52049],
    "101": [0, 0.43056, 0, 0.05556, 0.46563],
    "102": [0.19444, 0.69444, 0.10764, 0.16667, 0.48959],
    "103": [0.19444, 0.43056, 0.03588, 0.02778, 0.47697],
    "104": [0, 0.69444, 0, 0, 0.57616],
    "105": [0, 0.65952, 0, 0, 0.34451],
    "106": [0.19444, 0.65952, 0.05724, 0, 0.41181],
    "107": [0, 0.69444, 0.03148, 0, 0.5206],
    "108": [0, 0.69444, 0.01968, 0.08334, 0.29838],
    "109": [0, 0.43056, 0, 0, 0.87801],
    "110": [0, 0.43056, 0, 0, 0.60023],
    "111": [0, 0.43056, 0, 0.05556, 0.48472],
    "112": [0.19444, 0.43056, 0, 0.08334, 0.50313],
    "113": [0.19444, 0.43056, 0.03588, 0.08334, 0.44641],
    "114": [0, 0.43056, 0.02778, 0.05556, 0.45116],
    "115": [0, 0.43056, 0, 0.05556, 0.46875],
    "116": [0, 0.61508, 0, 0.08334, 0.36111],
    "117": [0, 0.43056, 0, 0.02778, 0.57246],
    "118": [0, 0.43056, 0.03588, 0.02778, 0.48472],
    "119": [0, 0.43056, 0.02691, 0.08334, 0.71592],
    "120": [0, 0.43056, 0, 0.02778, 0.57153],
    "121": [0.19444, 0.43056, 0.03588, 0.05556, 0.49028],
    "122": [0, 0.43056, 0.04398, 0.05556, 0.46505],
    "160": [0, 0, 0, 0, 0.25],
    "915": [0, 0.68333, 0.13889, 0.08334, 0.61528],
    "916": [0, 0.68333, 0, 0.16667, 0.83334],
    "920": [0, 0.68333, 0.02778, 0.08334, 0.76278],
    "923": [0, 0.68333, 0, 0.16667, 0.69445],
    "926": [0, 0.68333, 0.07569, 0.08334, 0.74236],
    "928": [0, 0.68333, 0.08125, 0.05556, 0.83125],
    "931": [0, 0.68333, 0.05764, 0.08334, 0.77986],
    "933": [0, 0.68333, 0.13889, 0.05556, 0.58333],
    "934": [0, 0.68333, 0, 0.08334, 0.66667],
    "936": [0, 0.68333, 0.11, 0.05556, 0.61222],
    "937": [0, 0.68333, 0.05017, 0.08334, 0.7724],
    "945": [0, 0.43056, 0.0037, 0.02778, 0.6397],
    "946": [0.19444, 0.69444, 0.05278, 0.08334, 0.56563],
    "947": [0.19444, 0.43056, 0.05556, 0, 0.51773],
    "948": [0, 0.69444, 0.03785, 0.05556, 0.44444],
    "949": [0, 0.43056, 0, 0.08334, 0.46632],
    "950": [0.19444, 0.69444, 0.07378, 0.08334, 0.4375],
    "951": [0.19444, 0.43056, 0.03588, 0.05556, 0.49653],
    "952": [0, 0.69444, 0.02778, 0.08334, 0.46944],
    "953": [0, 0.43056, 0, 0.05556, 0.35394],
    "954": [0, 0.43056, 0, 0, 0.57616],
    "955": [0, 0.69444, 0, 0, 0.58334],
    "956": [0.19444, 0.43056, 0, 0.02778, 0.60255],
    "957": [0, 0.43056, 0.06366, 0.02778, 0.49398],
    "958": [0.19444, 0.69444, 0.04601, 0.11111, 0.4375],
    "959": [0, 0.43056, 0, 0.05556, 0.48472],
    "960": [0, 0.43056, 0.03588, 0, 0.57003],
    "961": [0.19444, 0.43056, 0, 0.08334, 0.51702],
    "962": [0.09722, 0.43056, 0.07986, 0.08334, 0.36285],
    "963": [0, 0.43056, 0.03588, 0, 0.57141],
    "964": [0, 0.43056, 0.1132, 0.02778, 0.43715],
    "965": [0, 0.43056, 0.03588, 0.02778, 0.54028],
    "966": [0.19444, 0.43056, 0, 0.08334, 0.65417],
    "967": [0.19444, 0.43056, 0, 0.05556, 0.62569],
    "968": [0.19444, 0.69444, 0.03588, 0.11111, 0.65139],
    "969": [0, 0.43056, 0.03588, 0, 0.62245],
    "977": [0, 0.69444, 0, 0.08334, 0.59144],
    "981": [0.19444, 0.69444, 0, 0.08334, 0.59583],
    "982": [0, 0.43056, 0.02778, 0, 0.82813],
    "1009": [0.19444, 0.43056, 0, 0.08334, 0.51702],
    "1013": [0, 0.43056, 0, 0.05556, 0.4059],
    "57649": [0, 0.43056, 0, 0.02778, 0.32246],
    "57911": [0.19444, 0.43056, 0, 0.08334, 0.38403]
  },
  "SansSerif-Bold": {
    "32": [0, 0, 0, 0, 0.25],
    "33": [0, 0.69444, 0, 0, 0.36667],
    "34": [0, 0.69444, 0, 0, 0.55834],
    "35": [0.19444, 0.69444, 0, 0, 0.91667],
    "36": [0.05556, 0.75, 0, 0, 0.55],
    "37": [0.05556, 0.75, 0, 0, 1.02912],
    "38": [0, 0.69444, 0, 0, 0.83056],
    "39": [0, 0.69444, 0, 0, 0.30556],
    "40": [0.25, 0.75, 0, 0, 0.42778],
    "41": [0.25, 0.75, 0, 0, 0.42778],
    "42": [0, 0.75, 0, 0, 0.55],
    "43": [0.11667, 0.61667, 0, 0, 0.85556],
    "44": [0.10556, 0.13056, 0, 0, 0.30556],
    "45": [0, 0.45833, 0, 0, 0.36667],
    "46": [0, 0.1   3056, 0, 0, 0.30556],
    "47": [0.25, 0.75, 0, 0, 0.55],
    "48": [0, 0.69444, 0, 0, 0.55],
    "49": [0, 0.69444, 0, 0, 0.55],
    "50": [0, 0.69444, 0, 0, 0.55],
    "51": [0, 0.69444, 0, 0, 0.55],
    "52": [0, 0.69444, 0, 0, 0.55],
    "53": [0, 0.69444, 0, 0, 0.55],
    "54": [0, 0.69444, 0, 0, 0.55],
    "55": [0, 0.69444, 0, 0, 0.55],
    "56": [0, 0.69444, 0, 0, 0.55],
    "57": [0, 0.69444, 0, 0, 0.55],
    "58": [0, 0.45833, 0, 0, 0.30556],
    "59": [0.10556, 0.45833, 0, 0, 0.30556],
    "61": [-0.09375, 0.40625, 0, 0, 0.85556],
    "63": [0, 0.69444, 0, 0, 0.51945],
    "64": [0, 0.69444, 0, 0, 0.73334],
    "65": [0, 0.69444, 0, 0, 0.73334],
    "66": [0, 0.69444, 0, 0, 0.73334],
    "67": [0, 0.69444, 0, 0, 0.70278],
    "68": [0, 0.69444, 0, 0, 0.79445],
    "69": [0, 0.69444, 0, 0, 0.64167],
    "70": [0, 0.69444, 0, 0, 0.61111],
    "71": [0, 0.69444, 0, 0, 0.73334],
    "72": [0, 0.69444, 0, 0, 0.79445],
    "73": [0, 0.69444, 0, 0, 0.33056],
    "74": [0, 0.69444, 0, 0, 0.51945],
    "75": [0, 0.69444, 0, 0, 0.76389],
    "76": [0, 0.69444, 0, 0, 0.58056],
    "77": [0, 0.69444, 0, 0, 0.97778],
    "78": [0, 0.69444, 0, 0, 0.79445],
    "79": [0, 0.69444, 0, 0, 0.79445],
    "80": [0, 0.69444, 0, 0, 0.70278],
    "81": [0.10556, 0.69444, 0, 0, 0.79445],
    "82": [0, 0.69444, 0, 0, 0.70278],
    "83": [0, 0.69444, 0, 0, 0.61111],
    "84": [0, 0.69444, 0, 0, 0.73334],
    "85": [0, 0.69444, 0, 0, 0.76389],
    "86": [0, 0.69444, 0.01528, 0, 0.73334],
    "87": [0, 0.69444, 0.01528, 0, 1.03889],
    "88": [0, 0.69444, 0, 0, 0.73334],
    "89": [0, 0.69444, 0.0275, 0, 0.73334],
    "90": [0, 0.69444, 0, 0, 0.67223],
    "91": [0.25, 0.75, 0, 0, 0.34306],
    "93": [0.25, 0.75, 0, 0, 0.34306],
    "94": [0, 0.69444, 0, 0, 0.55],
    "95": [0.35, 0.10833, 0.03056, 0, 0.55],
    "97": [0, 0.45833, 0, 0, 0.525],
    "98": [0, 0.69444, 0, 0, 0.56111],
    "99": [0, 0.45833, 0, 0, 0.48889],
    "100": [0, 0.69444, 0, 0, 0.56111],
    "101": [0, 0.45833, 0, 0, 0.51111],
    "102": [0, 0.69444, 0.07639, 0, 0.33611],
    "103": [0.19444, 0.45833, 0.01528, 0, 0.55],
    "104": [0, 0.69444, 0, 0, 0.56111],
    "105": [0, 0.69444, 0, 0, 0.25556],
    "106": [0.19444, 0.69444, 0, 0, 0.28611],
    "107": [0, 0.69444, 0, 0, 0.53056],
    "108": [0, 0.69444, 0, 0, 0.25556],
    "109": [0, 0.45833, 0, 0, 0.86667],
    "110": [0, 0.45833, 0, 0, 0.56111],
    "111": [0, 0.45833, 0, 0, 0.55],
    "112": [0.19444, 0.45833, 0, 0, 0.56111],
    "113": [0.19444, 0.45833, 0, 0, 0.56111],
    "114": [0, 0.45833, 0.01528, 0, 0.37222],
    "115": [0, 0.45833, 0, 0, 0.42167],
    "116": [0, 0.58929, 0, 0, 0.40417],
    "117": [0, 0.45833, 0, 0, 0.56111],
    "118": [0, 0.45833, 0.01528, 0, 0.5],
    "119": [0, 0.45833, 0.01528, 0, 0.74445],
    "120": [0, 0.45833, 0, 0, 0.5],
    "121": [0.19444, 0.45833, 0.01528, 0, 0.5],
    "122": [0, 0.45833, 0, 0, 0.47639],
    "126": [0.35, 0.34444, 0, 0, 0.55],
    "160": [0, 0, 0, 0, 0.25],
    "168": [0, 0.69444, 0, 0, 0.55],
    "176": [0, 0.69444, 0, 0, 0.73334],
    "180": [0, 0.69444, 0, 0, 0.55],
    "184": [0.17014, 0, 0, 0, 0.48889],
    "305": [0, 0.45833, 0, 0, 0.25556],
    "567": [0.19444, 0.45833, 0, 0, 0.28611],
    "710": [0, 0.69444, 0, 0, 0.55],
    "711": [0, 0.63542, 0, 0, 0.55],
    "713": [0, 0.63778, 0, 0, 0.55],
    "728": [0, 0.69444, 0, 0, 0.55],
    "729": [0, 0.69444, 0, 0, 0.30556],
    "730": [0, 0.69444, 0, 0, 0.73334],
    "732": [0, 0.69444, 0, 0, 0.55],
    "733": [0, 0.69444, 0, 0, 0.55],
    "915": [0, 0.69444, 0, 0, 0.58056],
    "916": [0, 0.69444, 0, 0, 0.91667],
    "920": [0, 0.69444, 0, 0, 0.85556],
    "923": [0, 0.69444, 0, 0, 0.67223],
    "926": [0, 0.69444, 0, 0, 0.73334],
    "928": [0, 0.69444, 0, 0, 0.79445],
    "931": [0, 0.69444, 0, 0, 0.79445],
    "933": [0, 0.69444, 0, 0, 0.85556],
    "934": [0, 0.69444, 0, 0, 0.79445],
    "936": [0, 0.69444, 0, 0, 0.85556],
    "937": [0, 0.69444, 0, 0, 0.79445],
    "8211": [0, 0.45833, 0.03056, 0, 0.55],
    "8212": [0, 0.45833, 0.03056, 0, 1.10001],
    "8216": [0, 0.69444, 0, 0, 0.30556],
    "8217": [0, 0.69444, 0, 0, 0.30556],
    "8220": [0, 0.69444, 0, 0, 0.55834],
    "8221": [0, 0.69444, 0, 0, 0.55834]
  },
  "SansSerif-Italic": {
    "32": [0, 0, 0, 0, 0.25],
    "33": [0, 0.69444, 0.05733, 0, 0.31945],
    "34": [0, 0.69444, 0.00316, 0, 0.5],
    "35": [0.19444, 0.69444, 0.05087, 0, 0.83334],
    "36": [0.05556, 0.75, 0.11156, 0, 0.5],
    "37": [0.05556, 0.75, 0.03126, 0, 0.83334],
    "38": [0, 0.69444, 0.03058, 0, 0.75834],
    "39": [0, 0.69444, 0.07816, 0, 0.27778],
    "40": [0.25, 0.75, 0.13164, 0, 0.38889],
    "41": [0.25, 0.75, 0.02536, 0, 0.38889],
    "42": [0, 0.75, 0.11775, 0, 0.5],
    "43": [0.08333, 0.58333, 0.02536, 0, 0.77778],
    "44": [0.125, 0.08333, 0, 0, 0.27778],
    "45": [0, 0.44444, 0.01946, 0, 0.33333],
    "46": [0, 0.08333, 0, 0, 0.27778],
    "47": [0.25, 0.75, 0.13164, 0, 0.5],
    "48": [0, 0.65556, 0.11156, 0, 0.5],
    "49": [0, 0.65556, 0.11156, 0, 0.5],
    "50": [0, 0.65556, 0.11156, 0, 0.5],
    "51": [0, 0.65556, 0.11156, 0, 0.5],
    "52": [0, 0.65556, 0.11156, 0, 0.5],
    "53": [0, 0.65556, 0.11156, 0, 0.5],
    "54": [0, 0.65556, 0.11156, 0, 0.5],
    "55": [0, 0.65556, 0.11156, 0, 0.5],
    "56": [0, 0.65556, 0.11156, 0, 0.5],
    "57": [0, 0.65556, 0.11156, 0, 0.5],
    "58": [0, 0.44444, 0.02502, 0, 0.27778],
    "59": [0.125, 0.44444, 0.02502, 0, 0.27778],
    "61": [-0.13, 0.37, 0.05087, 0, 0.77778],
    "63": [0, 0.69444, 0.11809, 0, 0.47222],
    "64": [0, 0.69444, 0.07555, 0, 0.66667],
    "65": [0, 0.69444, 0, 0, 0.66667],
    "66": [0, 0.69444, 0.08293, 0, 0.66667],
    "67": [0, 0.69444, 0.11983, 0, 0.63889],
    "68": [0, 0.69444, 0.07555, 0, 0.72223],
    "69": [0, 0.69444, 0.11983, 0, 0.59722],
    "70": [0, 0.69444, 0.13372, 0, 0.56945],
    "71": [0, 0.69444, 0.11983, 0, 0.66667],
    "72": [0, 0.69444, 0.08094, 0, 0.70834],
    "73": [0, 0.69444, 0.13372, 0, 0.27778],
    "74": [0, 0.69444, 0.08094, 0, 0.47222],
    "75": [0, 0.69444, 0.11983, 0, 0.69445],
    "76": [0, 0.69444, 0, 0, 0.54167],
    "77": [0, 0.69444, 0.08094, 0, 0.875],
    "78": [0, 0.69444, 0.08094, 0, 0.70834],
    "79": [0, 0.69444, 0.07555, 0, 0.73611],
    "80": [0, 0.69444, 0.08293, 0, 0.63889],
    "81": [0.125, 0.69444, 0.07555, 0, 0.73611],
    "82": [0, 0.69444, 0.08293, 0, 0.64584],
    "83": [0, 0.69444, 0.09205, 0, 0.55556],
    "84": [0, 0.69444, 0.13372, 0, 0.68056],
    "85": [0, 0.69444, 0.08094, 0, 0.6875],
    "86": [0, 0.69444, 0.1615, 0, 0.66667],
    "87": [0, 0.69444, 0.1615, 0, 0.94445],
    "88": [0, 0.69444, 0.13372, 0, 0.66667],
    "89": [0, 0.69444, 0.17261, 0, 0.66667],
    "90": [0, 0.69444, 0.11983, 0, 0.61111],
    "91": [0.25, 0.75, 0.15942, 0, 0.28889],
    "93": [0.25, 0.75, 0.08719, 0, 0.28889],
    "94": [0, 0.69444, 0.0799, 0, 0.5],
    "95": [0.35, 0.09444, 0.08616, 0, 0.5],
    "97": [0, 0.44444, 0.00981, 0, 0.48056],
    "98": [0, 0.69444, 0.03057, 0, 0.51667],
    "99": [0, 0.44444, 0.08336, 0, 0.44445],
    "100": [0, 0.69444, 0.09483, 0, 0.51667],
    "101": [0, 0.44444, 0.06778, 0, 0.44445],
    "102": [0, 0.69444, 0.21705, 0, 0.30556],
    "103": [0.19444, 0.44444, 0.10836, 0, 0.5],
    "104": [0, 0.69444, 0.01778, 0, 0.51667],
    "105": [0, 0.67937, 0.09718, 0, 0.23889],
    "106": [0.19444, 0.67937, 0.09162, 0, 0.26667],
    "107": [0, 0.69444, 0.08336, 0, 0.48889],
    "108": [0, 0.69444, 0.09483, 0, 0.23889],
    "109": [0, 0.44444, 0.01778, 0, 0.79445],
    "110": [0, 0.44444, 0.01778, 0, 0.51667],
    "111": [0, 0.44444, 0.06613, 0, 0.5],
    "112": [0.19444, 0.44444, 0.0389, 0, 0.51667],
    "113": [0.19444, 0.44444, 0.04169, 0, 0.51667],
    "114": [0, 0.44444, 0.10836, 0, 0.34167],
    "115": [0, 0.44444, 0.0778, 0, 0.38333],
    "116": [0, 0.57143, 0.07225, 0, 0.36111],
    "117": [0, 0.44444, 0.04169, 0, 0.51667],
    "118": [0, 0.44444, 0.10836, 0, 0.46111],
    "119": [0, 0.44444, 0.10836, 0, 0.68334],
    "120": [0, 0.44444, 0.09169, 0, 0.46111],
    "121": [0.19444, 0.44444, 0.10836, 0, 0.46111],
    "122": [0, 0.44444, 0.08752, 0, 0.43472],
    "126": [0.35, 0.32659, 0.08826, 0, 0.5],
    "160": [0, 0, 0, 0, 0.25],
    "168": [0, 0.67937, 0.06385, 0, 0.5],
    "176": [0, 0.69444, 0, 0, 0.73752],
    "184": [0.17014, 0, 0, 0, 0.44445],
    "305": [0, 0.44444, 0.04169, 0, 0.23889],
    "567": [0.19444, 0.44444, 0.04169, 0, 0.26667],
    "710": [0, 0.69444, 0.0799, 0, 0.5],
    "711": [0, 0.63194, 0.08432, 0, 0.5],
    "713": [0, 0.60889, 0.08776, 0, 0.5],
    "714": [0, 0.69444, 0.09205, 0, 0.5],
    "715": [0, 0.69444, 0, 0, 0.5],
    "728": [0, 0.69444, 0.09483, 0, 0.5],
    "729": [0, 0.67937, 0.07774, 0, 0.27778],
    "730": [0, 0.69444, 0, 0, 0.73752],
    "732": [0, 0.67659, 0.08826, 0, 0.5],
    "733": [0, 0.69444, 0.09205, 0, 0.5],
    "915": [0, 0.69444, 0.13372, 0, 0.54167],
    "916": [0, 0.69444, 0, 0, 0.83334],
    "920": [0, 0.69444, 0.07555, 0, 0.77778],
    "923": [0, 0.69444, 0, 0, 0.61111],
    "926": [0, 0.69444, 0.12816, 0, 0.66667],
    "928": [0, 0.69444, 0.08094, 0, 0.70834],
    "931": [0, 0.69444, 0.11983, 0, 0.72222],
    "933": [0, 0.69444, 0.09031, 0, 0.77778],
    "934": [0, 0.69444, 0.04603, 0, 0.72222],
    "936": [0, 0.69444, 0.09031, 0, 0.77778],
    "937": [0, 0.69444, 0.08293, 0, 0.72222],
    "8211": [0, 0.44444, 0.08616, 0, 0.5],
    "8212": [0, 0.44444, 0.08616, 0, 1.0],
    "8216": [0, 0.69444, 0.07816, 0, 0.27778],
    "8217": [0, 0.69444, 0.07816, 0, 0.27778],
    "8220": [0, 0.69444, 0.14205, 0, 0.5],
    "8221": [0, 0.69444, 0.00316, 0, 0.5]
  },
  "SansSerif-Regular": {
    "32": [0, 0, 0, 0, 0.25],
    "33": [0, 0.69444, 0, 0, 0.31945],
    "34": [0, 0.69444, 0, 0, 0.5],
    "35": [0.19444, 0.69444, 0, 0, 0.83334],
    "36": [0.05556, 0.75, 0, 0, 0.5],
    "37": [0.05556, 0.75, 0, 0, 0.83334],
    "38": [0, 0.69444, 0, 0, 0.75834],
    "39": [0, 0.69444, 0, 0, 0.27778],
    "40": [0.25, 0.75, 0, 0, 0.38889],
    "41": [0.25, 0.75, 0, 0, 0.38889],
    "42": [0, 0.75, 0, 0, 0.5],
    "43": [0.08333, 0.58333, 0, 0, 0.77778],
    "44": [0.125, 0.08333, 0, 0, 0.27778],
    "45": [0, 0.44444, 0, 0, 0.33333],
    "46": [0, 0.08333, 0, 0, 0.27778],
    "47": [0.25, 0.75, 0, 0, 0.5],
    "48": [0, 0.65556, 0, 0, 0.5],
    "49": [0, 0.65556, 0, 0, 0.5],
    "50": [0, 0.65556, 0, 0, 0.5],
    "51": [0, 0.65556, 0, 0, 0.5],
    "52": [0, 0.65556, 0, 0, 0.5],
    "53": [0, 0.65556, 0, 0, 0.5],
    "54": [0, 0.65556, 0, 0, 0.5],
    "55": [0, 0.65556, 0, 0, 0.5],
    "56": [0, 0.65556, 0, 0, 0.5],
    "57": [0, 0.65556, 0, 0, 0.5],
    "58": [0, 0.44444, 0, 0, 0.27778],
    "59": [0.125, 0.44444, 0, 0, 0.27778],
    "61": [-0.13, 0.37, 0, 0, 0.77778],
    "63": [0, 0.69444, 0, 0, 0.47222],
    "64": [0, 0.69444, 0, 0, 0.66667],
    "65": [0, 0.69444, 0, 0, 0.66667],
    "66": [0, 0.69444, 0, 0, 0.66667],
    "67": [0, 0.69444, 0, 0, 0.63889],
    "68": [0, 0.69444, 0, 0, 0.72223],
    "69": [0, 0.69444, 0, 0, 0.59722],
    "70": [0, 0.69444, 0, 0, 0.56945],
    "71": [0, 0.69444, 0, 0, 0.66667],
    "72": [0, 0.69444, 0, 0, 0.70834],
    "73": [0, 0.69444, 0, 0, 0.27778],
    "74": [0, 0.69444, 0, 0, 0.47222],
    "75": [0, 0.69444, 0, 0, 0.69445],
    "76": [0, 0.69444, 0, 0, 0.54167],
    "77": [0, 0.69444, 0, 0, 0.875],
    "78": [0, 0.69444, 0, 0, 0.70834],
    "79": [0, 0.69444, 0, 0, 0.73611],
    "80": [0, 0.69444, 0, 0, 0.63889],
    "81": [0.125, 0.69444, 0, 0, 0.73611],
    "82": [0, 0.69444, 0, 0, 0.64584],
    "83": [0, 0.69444, 0, 0, 0.55556],
    "84": [0, 0.69444, 0, 0, 0.68056],
    "85": [0, 0.69444, 0, 0, 0.6875],
    "86": [0, 0.69444, 0.01389, 0, 0.66667],
    "87": [0, 0.69444, 0.01389, 0, 0.94445],
    "88": [0, 0.69444, 0, 0, 0.66667],
    "89": [0, 0.69444, 0.025, 0, 0.66667],
    "90": [0, 0.69444, 0, 0, 0.61111],
    "91": [0.25, 0.75, 0, 0, 0.28889],
    "93": [0.25, 0.75, 0, 0, 0.28889],
    "94": [0, 0.69444, 0, 0, 0.5],
    "95": [0.35, 0.09444, 0.02778, 0, 0.5],
    "97": [0, 0.44444, 0, 0, 0.48056],
    "98": [0, 0.69444, 0, 0, 0.51667],
    "99": [0, 0.44444, 0, 0, 0.44445],
    "100": [0, 0.69444, 0, 0, 0.51667],
    "101": [0, 0.44444, 0, 0, 0.44445],
    "102": [0, 0.69444, 0.06944, 0, 0.30556],
    "103": [0.19444, 0.44444, 0.01389, 0, 0.5],
    "104": [0, 0.69444, 0, 0, 0.51667],
    "105": [0, 0.67937, 0, 0, 0.23889],
    "106": [0.19444, 0.67937, 0, 0, 0.26667],
    "107": [0, 0.69444, 0, 0, 0.48889],
    "108": [0, 0.69444, 0, 0, 0.23889],
    "109": [0, 0.44444, 0, 0, 0.79445],
    "110": [0, 0.44444, 0, 0, 0.51667],
    "111": [0, 0.44444, 0, 0, 0.5],
    "112": [0.19444, 0.44444, 0, 0, 0.51667],
    "113": [0.19444, 0.44444, 0, 0, 0.51667],
    "114": [0, 0.44444, 0.01389, 0, 0.34167],
    "115": [0, 0.44444, 0, 0, 0.38333],
    "116": [0, 0.57143, 0, 0, 0.36111],
    "117": [0, 0.44444, 0, 0, 0.51667],
    "118": [0, 0.44444, 0.01389, 0, 0.46111],
    "119": [0, 0.44444, 0.01389, 0, 0.68334],
    "120": [0, 0.44444, 0, 0, 0.46111],
    "121": [0.19444, 0.44444, 0.01389, 0, 0.46111],
    "122": [0, 0.44444, 0, 0, 0.43472],
    "126": [0.35, 0.32659, 0, 0, 0.5],
    "160": [0, 0, 0, 0, 0.25],
    "168": [0, 0.67937, 0, 0, 0.5],
    "176": [0, 0.69444, 0, 0, 0.66667],
    "184": [0.17014, 0, 0, 0, 0.44445],
    "305": [0, 0.44444, 0, 0, 0.23889],
    "567": [0.19444, 0.44444, 0, 0, 0.26667],
    "710": [0, 0.69444, 0, 0, 0.5],
    "711": [0, 0.63194, 0, 0, 0.5],
    "713": [0, 0.60889, 0, 0, 0.5],
    "714": [0, 0.69444, 0, 0, 0.5],
    "715": [0, 0.69444, 0, 0, 0.5],
    "728": [0, 0.69444, 0, 0, 0.5],
    "729": [0, 0.67937, 0, 0, 0.27778],
    "730": [0, 0.69444, 0, 0, 0.66667],
    "732": [0, 0.67659, 0, 0, 0.5],
    "733": [0, 0.69444, 0, 0, 0.5],
    "915": [0, 0.69444, 0, 0, 0.54167],
    "916": [0, 0.69444, 0, 0, 0.83334],
    "920": [0, 0.69444, 0, 0, 0.77778],
    "923": [0, 0.69444, 0, 0, 0.61111],
    "926": [0, 0.69444, 0, 0, 0.66667],
    "928": [0, 0.69444, 0, 0, 0.70834],
    "931": [0, 0.69444, 0, 0, 0.72222],
    "933": [0, 0.69444, 0, 0, 0.77778],
    "934": [0, 0.69444, 0, 0, 0.72222],
    "936": [0, 0.69444, 0, 0, 0.77778],
    "937": [0, 0.69444, 0, 0, 0.72222],
    "8211": [0, 0.44444, 0.02778, 0, 0.5],
    "8212": [0, 0.44444, 0.02778, 0, 1.0],
    "8216": [0, 0.69444, 0, 0, 0.27778],
    "8217": [0, 0.69444, 0, 0, 0.27778],
    "8220": [0, 0.69444, 0, 0, 0.5],
    "8221": [0, 0.69444, 0, 0, 0.5]
  },
  "Script-Regular": {
    "32": [0, 0, 0, 0, 0.25],
    "65": [0, 0.7, 0.22925, 0, 0.80253],
    "66": [0, 0.7, 0.04087, 0, 0.90757],
    "67": [0, 0.7, 0.1689, 0, 0.66619],
    "68": [0, 0.7, 0.09371, 0, 0.77443],
    "69": [0, 0.7, 0.18583, 0, 0.56162],
    "70": [0, 0.7, 0.13634, 0, 0.89544],
    "71": [0, 0.7, 0.17322, 0, 0.60961],
    "72": [0, 0.7, 0.29694, 0, 0.96919],
    "73": [0, 0.7, 0.19189, 0, 0.80907],
    "74": [0.27778, 0.7, 0.19189, 0, 1.05159],
    "75": [0, 0.7, 0.31259, 0, 0.91364],
    "76": [0, 0.7, 0.19189, 0, 0.87373],
    "77": [0, 0.7, 0.15981, 0, 1.08031],
    "78": [0, 0.7, 0.3525, 0, 0.9015],
    "79": [0, 0.7, 0.08078, 0, 0.73787],
    "80": [0, 0.7, 0.08078, 0, 1.01262],
    "81": [0, 0.7, 0.03305, 0, 0.88282],
    "82": [0, 0.7, 0.06259, 0, 0.85],
    "83": [0, 0.7, 0.19189, 0, 0.86767],
    "84": [0, 0.7, 0.29087, 0, 0.74697],
    "85": [0, 0.7, 0.25815, 0, 0.79996],
    "86": [0, 0.7, 0.27523, 0, 0.62204],
    "87": [0, 0.7, 0.27523, 0, 0.80532],
    "88": [0, 0.7, 0.26006, 0, 0.94445],
    "89": [0, 0.7, 0.2939, 0, 0.70961],
    "90": [0, 0.7, 0.24037, 0, 0.8212],
    "160": [0, 0, 0, 0, 0.25]
  },
  "Size1-Regular": {
    "32": [0, 0, 0, 0, 0.25],
    "40": [0.35001, 0.85, 0, 0, 0.45834],
    "41": [0.35001, 0.85, 0, 0, 0.45834],
    "47": [0.35001, 0.85, 0, 0, 0.57778],
    "91": [0.35001, 0.85, 0, 0, 0.41667],
    "92": [0.35001, 0.85, 0, 0, 0.57778],
    "93": [0.35001, 0.85, 0, 0, 0.41667],
    "123": [0.35001, 0.85, 0, 0, 0.58334],
    "125": [0.35001, 0.85, 0, 0, 0.58334],
    "160": [0, 0, 0, 0, 0.25],
    "710": [0, 0.72222, 0, 0, 0.55556],
    "732": [0, 0.72222, 0, 0, 0.55556],
    "770": [0, 0.72222, 0, 0, 0.55556],
    "771": [0, 0.72222, 0, 0, 0.55556],
    "8214": [-0.00099, 0.601, 0, 0, 0.77778],
    "8593": [1e-05, 0.6, 0, 0, 0.66667],
    "8595": [1e-05, 0.6, 0, 0, 0.66667],
    "8657": [1e-05, 0.6, 0, 0, 0.77778],
    "8659": [1e-05, 0.6, 0, 0, 0.77778],
    "8719": [0.25001, 0.75, 0, 0, 0.94445],
    "8720": [0.25001, 0.75, 0, 0, 0.94445],
    "8721": [0.25001, 0.75, 0, 0, 1.05556],
    "8730": [0.35001, 0.85, 0, 0, 1.0],
    "8739": [-0.00599, 0.606, 0, 0, 0.33333],
    "8741": [-0.00599, 0.606, 0, 0, 0.55556],
    "8747": [0.30612, 0.805, 0.19445, 0, 0.47222],
    "8748": [0.306, 0.805, 0.19445, 0, 0.47222],
    "8749": [0.306, 0.805, 0.19445, 0, 0.47222],
    "8750": [0.30612, 0.805, 0.19445, 0, 0.47222],
    "8896": [0.25001, 0.75, 0, 0, 0.83334],
    "8897": [0.25001, 0.75, 0, 0, 0.83334],
    "8898": [0.25001, 0.75, 0, 0, 0.83334],
    "8899": [0.25001, 0.75, 0, 0, 0.83334],
    "8968": [0.35001, 0.85, 0, 0, 0.47222],
    "8969": [0.35001, 0.85, 0, 0, 0.47222],
    "8970": [0.35001, 0.85, 0, 0, 0.47222],
    "8971": [0.35001, 0.85, 0, 0, 0.47222],
    "9168": [-0.00099, 0.601, 0, 0, 0.66667],
    "10216": [0.35001, 0.85, 0, 0, 0.47222],
    "10217": [0.35001, 0.85, 0, 0, 0.47222],
    "10752": [0.25001, 0.75, 0, 0, 1.11111],
    "10753": [0.25001, 0.75, 0, 0, 1.11111],
    "10754": [0.25001, 0.75, 0, 0, 1.11111],
    "10756": [0.25001, 0.75, 0, 0, 0.83334],
    "10758": [0.25001, 0.75, 0, 0, 0.83334]
  },
  "Size2-Regular": {
    "32": [0, 0, 0, 0, 0.25],
    "40": [0.65002, 1.15, 0, 0, 0.59722],
    "41": [0.65002, 1.15, 0, 0, 0.59722],
    "47": [0.65002, 1.15, 0, 0, 0.81111],
    "91": [0.65002, 1.15, 0, 0, 0.47222],
    "92": [0.65002, 1.15, 0, 0, 0.81111],
    "93": [0.65002, 1.15, 0, 0, 0.47222],
    "123": [0.65002, 1.15, 0, 0, 0.66667],
    "125": [0.65002, 1.15, 0, 0, 0.66667],
    "160": [0, 0, 0, 0, 0.25],
    "710": [0, 0.75, 0, 0, 1.0],
    "732": [0, 0.75, 0, 0, 1.0],
    "770": [0, 0.75, 0, 0, 1.0],
    "771": [0, 0.75, 0, 0, 1.0],
    "8719": [0.55001, 1.05, 0, 0, 1.27778],
    "8720": [0.55001, 1.05, 0, 0, 1.27778],
    "8721": [0.55001, 1.05, 0, 0, 1.44445],
    "8730": [0.65002, 1.15, 0, 0, 1.0],
    "8747": [0.86225, 1.36, 0.44445, 0, 0.55556],
    "8748": [0.862, 1.36, 0.44445, 0, 0.55556],
    "8749": [0.862, 1.36, 0.44445, 0, 0.55556],
    "8750": [0.86225, 1.36, 0.44445, 0, 0.55556],
    "8896": [0.55001, 1.05, 0, 0, 1.11111],
    "8897": [0.55001, 1.05, 0, 0, 1.11111],
    "8898": [0.55001, 1.05, 0, 0, 1.11111],
    "8899": [0.55001, 1.05, 0, 0, 1.11111],
    "8968": [0.65002, 1.15, 0, 0, 0.52778],
    "8969": [0.65002, 1.15, 0, 0, 0.52778],
    "8970": [0.65002, 1.15, 0, 0, 0.52778],
    "8971": [0.65002, 1.15, 0, 0, 0.52778],
    "10216": [0.65002, 1.15, 0, 0, 0.61111],
    "10217": [0.65002, 1.15, 0, 0, 0.61111],
    "10752": [0.55001, 1.05, 0, 0, 1.51112],
    "10753": [0.55001, 1.05, 0, 0, 1.51112],
    "10754": [0.55001, 1.05, 0, 0, 1.51112],
    "10756": [0.55001, 1.05, 0, 0, 1.11111],
    "10758": [0.55001, 1.05, 0, 0, 1.11111]
  },
  "Size3-Regular": {
    "32": [0, 0, 0, 0, 0.25],
    "40": [0.95003, 1.45, 0, 0, 0.73611],
    "41": [0.95003, 1.45, 0, 0, 0.73611],
    "47": [0.95003, 1.45, 0, 0, 1.04445],
    "91": [0.95003, 1.45, 0, 0, 0.52778],
    "92": [0.95003, 1.45, 0, 0, 1.04445],
    "93": [0.95003, 1.45, 0, 0, 0.52778],
    "123": [0.95003, 1.45, 0, 0, 0.75],
    "125": [0.95003, 1.45, 0, 0, 0.75],
    "160": [0, 0, 0, 0, 0.25],
    "710": [0, 0.75, 0, 0, 1.44445],
    "732": [0, 0.75, 0, 0, 1.44445],
    "770": [0, 0.75, 0, 0, 1.44445],
    "771": [0, 0.75, 0, 0, 1.44445],
    "8730": [0.95003, 1.45, 0, 0, 1.0],
    "8968": [0.95003, 1.45, 0, 0, 0.58334],
    "8969": [0.95003, 1.45, 0, 0, 0.58334],
    "8970": [0.95003, 1.45, 0, 0, 0.58334],
    "8971": [0.95003, 1.45, 0, 0, 0.58334],
    "10216": [0.95003, 1.45, 0, 0, 0.75],
    "10217": [0.95003, 1.45, 0, 0, 0.75]
  },
  "Size4-Regular": {
    "32": [0, 0, 0, 0, 0.25],
    "40": [1.25003, 1.75, 0, 0, 0.79167],
    "41": [1.25003, 1.75, 0, 0, 0.79167],
    "47": [1.25003, 1.75, 0, 0, 1.27778],
    "91": [1.25003, 1.75, 0, 0, 0.58334],
    "92": [1.25003, 1.75, 0, 0, 1.27778],
    "93": [1.25003, 1.75, 0, 0, 0.58334],
    "123": [1.25003, 1.75, 0, 0, 0.80556],
    "125": [1.25003, 1.75, 0, 0, 0.80556],
    "160": [0, 0, 0, 0, 0.25],
    "710": [0, 0.825, 0, 0, 1.8889],
    "732": [0, 0.825, 0, 0, 1.8889],
    "770": [0, 0.825, 0, 0, 1.8889],
    "771": [0, 0.825, 0, 0, 1.8889],
    "8730": [1.25003, 1.75, 0, 0, 1.0],
    "8968": [1.25003, 1.75, 0, 0, 0.63889],
    "8969": [1.25003, 1.75, 0, 0, 0.63889],
    "8970": [1.25003, 1.75, 0, 0, 0.63889],
    "8971": [1.25003, 1.75, 0, 0, 0.63889],
    "9115": [0.64502, 1.155, 0, 0, 0.875],
    "9116": [1e-05, 0.6, 0, 0, 0.875],
    "9117": [0.64502, 1.155, 0, 0, 0.875],
    "9118": [0.64502, 1.155, 0, 0, 0.875],
    "9119": [1e-05, 0.6, 0, 0, 0.875],
    "9120": [0.64502, 1.155, 0, 0, 0.875],
    "9121": [0.64502, 1.155, 0, 0, 0.66667],
    "9122": [-0.00099, 0.601, 0, 0, 0.66667],
    "9123": [0.64502, 1.155, 0, 0, 0.66667],
    "9124": [0.64502, 1.155, 0, 0, 0.66667],
    "9125": [-0.00099, 0.601, 0, 0, 0.66667],
    "9126": [0.64502, 1.155, 0, 0, 0.66667],
    "9127": [1e-05, 0.9, 0, 0, 0.88889],
    "9128": [0.65002, 1.15, 0, 0, 0.88889],
    "9129": [0.90001, 0, 0, 0, 0.88889],
    "9130": [0, 0.3, 0, 0, 0.88889],
    "9131": [1e-05, 0.9, 0, 0, 0.88889],
    "9132": [0.65002, 1.15, 0, 0, 0.88889],
    "9133": [0.90001, 0, 0, 0, 0.88889],
    "9143": [0.88502, 0.915, 0, 0, 1.05556],
    "10216": [1.25003, 1.75, 0, 0, 0.80556],
    "10217": [1.25003, 1.75, 0, 0, 0.80556],
    "57344": [-0.00499, 0.605, 0, 0, 1.05556],
    "57345": [-0.00499, 0.605, 0, 0, 1.05556],
    "57680": [0, 0.12, 0, 0, 0.45],
    "57681": [0, 0.12, 0, 0, 0.45],
    "57682": [0, 0.12, 0, 0, 0.45],
    "57683": [0, 0.12, 0, 0, 0.45]
  },
  "Typewriter-Regular": {
    "32": [0, 0, 0, 0, 0.525],
    "33": [0, 0.61111, 0, 0, 0.525],
    "34": [0, 0.61111, 0, 0, 0.525],
    "35": [0, 0.61111, 0, 0, 0.525],
    "36": [0.08333, 0.69444, 0, 0, 0.525],
    "37": [0.08333, 0.69444, 0, 0, 0.525],
    "38": [0, 0.61111, 0, 0, 0.525],
    "39": [0, 0.61111, 0, 0, 0.525],
    "40": [0.08333, 0.69444, 0, 0, 0.525],
    "41": [0.08333, 0.69444, 0, 0, 0.525],
    "42": [0, 0.52083, 0, 0, 0.525],
    "43": [-0.08056, 0.53055, 0, 0, 0.525],
    "44": [0.13889, 0.125, 0, 0, 0.525],
    "45": [-0.08056, 0.53055, 0, 0, 0.525],
    "46": [0, 0.125, 0, 0, 0.525],
    "47": [0.08333, 0.69444, 0, 0, 0.525],
    "48": [0, 0.61111, 0, 0, 0.525],
    "49": [0, 0.61111, 0, 0, 0.525],
    "50": [0, 0.61111, 0, 0, 0.525],
    "51": [0, 0.61111, 0, 0, 0.525],
    "52": [0, 0.61111, 0, 0, 0.525],
    "53": [0, 0.61111, 0, 0, 0.525],
    "54": [0, 0.61111, 0, 0, 0.525],
    "55": [0, 0.61111, 0, 0, 0.525],
    "56": [0, 0.61111, 0, 0, 0.525],
    "57": [0, 0.61111, 0, 0, 0.525],
    "58": [0, 0.43056, 0, 0, 0.525],
    "59": [0.13889, 0.43056, 0, 0, 0.525],
    "60": [-0.05556, 0.55556, 0, 0, 0.525],
    "61": [-0.19549, 0.41562, 0, 0, 0.525],
    "62": [-0.05556, 0.55556, 0, 0, 0.525],
    "63": [0, 0.61111, 0, 0, 0.525],
    "64": [0, 0.61111, 0, 0, 0.525],
    "65": [0, 0.61111, 0, 0, 0.525],
    "66": [0, 0.61111, 0, 0, 0.525],
    "67": [0, 0.61111, 0, 0, 0.525],
    "68": [0, 0.61111, 0, 0, 0.525],
    "69": [0, 0.61111, 0, 0, 0.525],
    "70": [0, 0.61111, 0, 0, 0.525],
    "71": [0, 0.61111, 0, 0, 0.525],
    "72": [0, 0.61111, 0, 0, 0.525],
    "73": [0, 0.61111, 0, 0, 0.525],
    "74": [0, 0.61111, 0, 0, 0.525],
    "75": [0, 0.61111, 0, 0, 0.525],
    "76": [0, 0.61111, 0, 0, 0.525],
    "77": [0, 0.61111, 0, 0, 0.525],
    "78": [0, 0.61111, 0, 0, 0.525],
    "79": [0, 0.61111, 0, 0, 0.525],
    "80": [0, 0.61111, 0, 0, 0.525],
    "81": [0.13889, 0.61111, 0, 0, 0.525],
    "82": [0, 0.61111, 0, 0, 0.525],
    "83": [0, 0.61111, 0, 0, 0.525],
    "84": [0, 0.61111, 0, 0, 0.525],
    "85": [0, 0.61111, 0, 0, 0.525],
    "86": [0, 0.61111, 0, 0, 0.525],
    "87": [0, 0.61111, 0, 0, 0.525],
    "88": [0, 0.61111, 0, 0, 0.525],
    "89": [0, 0.61111, 0, 0, 0.525],
    "90": [0, 0.61111, 0, 0, 0.525],
    "91": [0.08333, 0.69444, 0, 0, 0.525],
    "92": [0.08333, 0.69444, 0, 0, 0.525],
    "93": [0.08333, 0.69444, 0, 0, 0.525],
    "94": [0, 0.61111, 0, 0, 0.525],
    "95": [0.09514, 0, 0, 0, 0.525],
    "96": [0, 0.61111, 0, 0, 0.525],
    "97": [0, 0.43056, 0, 0, 0.525],
    "98": [0, 0.61111, 0, 0, 0.525],
    "99": [0, 0.43056, 0, 0, 0.525],
    "100": [0, 0.61111, 0, 0, 0.525],
    "101": [0, 0.43056, 0, 0, 0.525],
    "102": [0, 0.61111, 0, 0, 0.525],
    "103": [0.22222, 0.43056, 0, 0, 0.525],
    "104": [0, 0.61111, 0, 0, 0.525],
    "105": [0, 0.61111, 0, 0, 0.525],
    "106": [0.22222, 0.61111, 0, 0, 0.525],
    "107": [0, 0.61111, 0, 0, 0.525],
    "108": [0, 0.61111, 0, 0, 0.525],
    "109": [0, 0.43056, 0, 0, 0.525],
    "110": [0, 0.43056, 0, 0, 0.525],
    "111": [0, 0.43056, 0, 0, 0.525],
    "112": [0.22222, 0.43056, 0, 0, 0.525],
    "113": [0.22222, 0.43056, 0, 0, 0.525],
    "114": [0, 0.43056, 0, 0, 0.525],
    "115": [0, 0.43056, 0, 0, 0.525],
    "116": [0, 0.55358, 0, 0, 0.525],
    "117": [0, 0.43056, 0, 0, 0.525],
    "118": [0, 0.43056, 0, 0, 0.525],
    "119": [0, 0.43056, 0, 0, 0.525],
    "120": [0, 0.43056, 0, 0, 0.525],
    "121": [0.22222, 0.43056, 0, 0, 0.525],
    "122": [0, 0.43056, 0, 0, 0.525],
    "123": [0.08333, 0.69444, 0, 0, 0.525],
    "124": [0.08333, 0.69444, 0, 0, 0.525],
    "125": [0.08333, 0.69444, 0, 0, 0.525],
    "126": [0, 0.61111, 0, 0, 0.525],
    "127": [0, 0.61111, 0, 0, 0.525],
    "160": [0, 0, 0, 0, 0.525],
    "176": [0, 0.61111, 0, 0, 0.525],
    "184": [0.19445, 0, 0, 0, 0.525],
    "305": [0, 0.43056, 0, 0, 0.525],
    "567": [0.22222, 0.43056, 0, 0, 0.525],
    "711": [0, 0.56597, 0, 0, 0.525],
    "713": [0, 0.56555, 0, 0, 0.525],
    "714": [0, 0.61111, 0, 0, 0.525],
    "715": [0, 0.61111, 0, 0, 0.525],
    "728": [0, 0.61111, 0, 0, 0.525],
    "730": [0, 0.61111, 0, 0, 0.525],
    "770": [0, 0.61111, 0, 0, 0.525],
    "771": [0, 0.61111, 0, 0, 0.525],
    "776": [0, 0.61111, 0, 0, 0.525],
    "915": [0, 0.61111, 0, 0, 0.525],
    "916": [0, 0.61111, 0, 0, 0.525],
    "920": [0, 0.61111, 0, 0, 0.525],
    "923": [0, 0.61111, 0, 0, 0.525],
    "926": [0, 0.61111, 0, 0, 0.525],
    "928": [0, 0.61111, 0, 0, 0.525],
    "931": [0, 0.61111, 0, 0, 0.525],
    "933": [0, 0.61111, 0, 0, 0.525],
    "934": [0, 0.61111, 0, 0, 0.525],
    "936": [0, 0.61111, 0, 0, 0.525],
    "937": [0, 0.61111, 0, 0, 0.525],
    "8216": [0, 0.61111, 0, 0, 0.525],
    "8217": [0, 0.61111, 0, 0, 0.525],
    "8242": [0, 0.61111, 0, 0, 0.525],
    "9251": [0.11111, 0.21944, 0, 0, 0.525]
  }
});
;// ./src/fontMetrics.ts

// This map contains a mapping from font name and character code to character
// metrics, including height, depth, italic correction, and skew (kern from the
// character to the corresponding \skewchar)
// This map is generated via `make metrics`. It should not be changed manually.


/**
 * This file contains metrics regarding fonts and individual symbols. The sigma
 * and xi variables, as well as the metricMap map contain data extracted from
 * TeX, TeX font metrics, and the TTF files. These data are then exposed via the
 * `metrics` variable and the getCharacterMetrics function.
 */

// In TeX, there are actually three sets of dimensions, one for each of
// textstyle (size index 5 and higher: >=9pt), scriptstyle (size index 3 and 4:
// 7-8pt), and scriptscriptstyle (size index 1 and 2: 5-6pt).  These are
// provided in the arrays below, in that order.
//
// The font metrics are stored in fonts cmsy10, cmsy7, and cmsy5 respectively.
// This was determined by running the following script:
//
//     latex -interaction=nonstopmode \
//     '\documentclass{article}\usepackage{amsmath}\begin{document}' \
//     '$a$ \expandafter\show\the\textfont2' \
//     '\expandafter\show\the\scriptfont2' \
//     '\expandafter\show\the\scriptscriptfont2' \
//     '\stop'
//
// The metrics themselves were retrieved using the following commands:
//
//     tftopl cmsy10
//     tftopl cmsy7
//     tftopl cmsy5
//
// The output of each of these commands is quite lengthy.  The only part we
// care about is the FONTDIMEN section. Each value is measured in EMs.
const sigmasAndXis = {
  slant: [0.250, 0.250, 0.250],
  // sigma1
  space: [0.000, 0.000, 0.000],
  // sigma2
  stretch: [0.000, 0.000, 0.000],
  // sigma3
  shrink: [0.000, 0.000, 0.000],
  // sigma4
  xHeight: [0.431, 0.431, 0.431],
  // sigma5
  quad: [1.000, 1.171, 1.472],
  // sigma6
  extraSpace: [0.000, 0.000, 0.000],
  // sigma7
  num1: [0.677, 0.732, 0.925],
  // sigma8
  num2: [0.394, 0.384, 0.387],
  // sigma9
  num3: [0.444, 0.471, 0.504],
  // sigma10
  denom1: [0.686, 0.752, 1.025],
  // sigma11
  denom2: [0.345, 0.344, 0.532],
  // sigma12
  sup1: [0.413, 0.503, 0.504],
  // sigma13
  sup2: [0.363, 0.431, 0.404],
  // sigma14
  sup3: [0.289, 0.286, 0.294],
  // sigma15
  sub1: [0.150, 0.143, 0.200],
  // sigma16
  sub2: [0.247, 0.286, 0.400],
  // sigma17
  supDrop: [0.386, 0.353, 0.494],
  // sigma18
  subDrop: [0.050, 0.071, 0.100],
  // sigma19
  delim1: [2.390, 1.700, 1.980],
  // sigma20
  delim2: [1.010, 1.157, 1.420],
  // sigma21
  axisHeight: [0.250, 0.250, 0.250],
  // sigma22

  // These font metrics are extracted from TeX by using tftopl on cmex10.tfm;
  // they correspond to the font parameters of the extension fonts (family 3).
  // See the TeXbook, page 441. In AMSTeX, the extension fonts scale; to
  // match cmex7, we'd use cmex7.tfm values for script and scriptscript
  // values.
  defaultRuleThickness: [0.04, 0.049, 0.049],
  // xi8; cmex7: 0.049
  bigOpSpacing1: [0.111, 0.111, 0.111],
  // xi9
  bigOpSpacing2: [0.166, 0.166, 0.166],
  // xi10
  bigOpSpacing3: [0.2, 0.2, 0.2],
  // xi11
  bigOpSpacing4: [0.6, 0.611, 0.611],
  // xi12; cmex7: 0.611
  bigOpSpacing5: [0.1, 0.143, 0.143],
  // xi13; cmex7: 0.143

  // The \sqrt rule width is taken from the height of the surd character.
  // Since we use the same font at all sizes, this thickness doesn't scale.
  sqrtRuleThickness: [0.04, 0.04, 0.04],
  // This value determines how large a pt is, for metrics which are defined
  // in terms of pts.
  // This value is also used in katex.scss; if you change it make sure the
  // values match.
  ptPerEm: [10.0, 10.0, 10.0],
  // The space between adjacent `|` columns in an array definition. From
  // `\showthe\doublerulesep` in LaTeX. Equals 2.0 / ptPerEm.
  doubleRuleSep: [0.2, 0.2, 0.2],
  // The width of separator lines in {array} environments. From
  // `\showthe\arrayrulewidth` in LaTeX. Equals 0.4 / ptPerEm.
  arrayRuleWidth: [0.04, 0.04, 0.04],
  // Two values from LaTeX source2e:
  fboxsep: [0.3, 0.3, 0.3],
  //        3 pt / ptPerEm
  fboxrule: [0.04, 0.04, 0.04] // 0.4 pt / ptPerEm
};

// These are very rough approximations.  We default to Times New Roman which
// should have Latin-1 and Cyrillic characters, but may not depending on the
// operating system.  The metrics do not account for extra height from the
// accents.  In the case of Cyrillic characters which have both ascenders and
// descenders we prefer approximations with ascenders, primarily to prevent
// the fraction bar or root line from intersecting the glyph.
// TODO(kevinb) allow union of multiple glyph metrics for better accuracy.
const extraCharacterMap = {
  // Latin-1
  'Å': 'A',
  'Ð': 'D',
  'Þ': 'o',
  'å': 'a',
  'ð': 'd',
  'þ': 'o',
  // Cyrillic
  'А': 'A',
  'Б': 'B',
  'В': 'B',
  'Г': 'F',
  'Д': 'A',
  'Е': 'E',
  'Ж': 'K',
  'З': '3',
  'И': 'N',
  'Й': 'N',
  'К': 'K',
  'Л': 'N',
  'М': 'M',
  'Н': 'H',
  'О': 'O',
  'П': 'N',
  'Р': 'P',
  'С': 'C',
  'Т': 'T',
  'У': 'y',
  'Ф': 'O',
  'Х': 'X',
  'Ц': 'U',
  'Ч': 'h',
  'Ш': 'W',
  'Щ': 'W',
  'Ъ': 'B',
  'Ы': 'X',
  'Ь': 'B',
  'Э': '3',
  'Ю': 'X',
  'Я': 'R',
  'а': 'a',
  'б': 'b',
  'в': 'a',
  'г': 'r',
  'д': 'y',
  'е': 'e',
  'ж': 'm',
  'з': 'e',
  'и': 'n',
  'й': 'n',
  'к': 'n',
  'л': 'n',
  'м': 'm',
  'н': 'n',
  'о': 'o',
  'п': 'n',
  'р': 'p',
  'с': 'c',
  'т': 'o',
  'у': 'y',
  'ф': 'b',
  'х': 'x',
  'ц': 'n',
  'ч': 'n',
  'ш': 'w',
  'щ': 'w',
  'ъ': 'a',
  'ы': 'm',
  'ь': 'a',
  'э': 'e',
  'ю': 'm',
  'я': 'r'
};

/**
 * This function adds new font metrics to default metricMap
 * It can also override existing metrics
 */
function setFontMetrics(fontName, metrics) {
  fontMetricsData[fontName] = metrics;
}

/**
 * This function is a convenience function for looking up information in the
 * metricMap table. It takes a character as a string, and a font.
 *
 * Note: the `width` property may be undefined if fontMetricsData.js wasn't
 * built using `Make extended_metrics`.
 */
function getCharacterMetrics(character, font, mode) {
  if (!fontMetricsData[font]) {
    throw new Error("Font metrics not found for font: " + font + ".");
  }
  let ch = character.charCodeAt(0);
  let metrics = fontMetricsData[font][ch];
  if (!metrics && character[0] in extraCharacterMap) {
    ch = extraCharacterMap[character[0]].charCodeAt(0);
    metrics = fontMetricsData[font][ch];
  }
  if (!metrics && mode === 'text') {
    // We don't typically have font metrics for Asian scripts.
    // But since we support them in text mode, we need to return
    // some sort of metrics.
    // So if the character is in a script we support but we
    // don't have metrics for it, just use the metrics for
    // the Latin capital letter M. This is close enough because
    // we (currently) only care about the height of the glyph
    // not its width.
    if (supportedCodepoint(ch)) {
      metrics = fontMetricsData[font][77]; // 77 is the charcode for 'M'
    }
  }
  if (metrics) {
    return {
      depth: metrics[0],
      height: metrics[1],
      italic: metrics[2],
      skew: metrics[3],
      width: metrics[4]
    };
  }
}
const fontMetricsBySizeIndex = {};

/**
 * Get the font metrics for a given size.
 */
function getGlobalMetrics(size) {
  let sizeIndex;
  if (size >= 5) {
    sizeIndex = 0;
  } else if (size >= 3) {
    sizeIndex = 1;
  } else {
    sizeIndex = 2;
  }
  if (!fontMetricsBySizeIndex[sizeIndex]) {
    const metrics = fontMetricsBySizeIndex[sizeIndex] = {
      cssEmPerMu: sigmasAndXis.quad[sizeIndex] / 18
    };
    for (const key in sigmasAndXis) {
      if (sigmasAndXis.hasOwnProperty(key)) {
        metrics[key] = sigmasAndXis[key][sizeIndex];
      }
    }
  }
  return fontMetricsBySizeIndex[sizeIndex];
}
;// ./src/symbols.ts
/**
 * This file holds a list of all no-argument functions and single-character
 * symbols (like 'a' or ';').
 *
 * For each of the symbols, there are three properties they can have:
 * - font (required): the font to be used for this symbol. Either "main" (the
     normal font), or "ams" (the ams fonts).
 * - group (required): the ParseNode group type the symbol should have (i.e.
     "textord", "mathord", etc).
     See https://github.com/KaTeX/KaTeX/wiki/Examining-TeX#group-types
 * - replace: the character that this symbol or function should be
 *   replaced with (i.e. "\phi" has a replace value of "\u03d5", the phi
 *   character in the main font).
 *
 * The outermost map in the table indicates what mode the symbols should be
 * accepted in (e.g. "math" or "text").
 */

// Some of these have a "-token" suffix since these are also used as `ParseNode`
// types for raw text tokens, and we want to avoid conflicts with higher-level
// `ParseNode` types. These `ParseNode`s are constructed within `Parser` by
// looking up the `symbols` map.

const symbols = {
  "math": {},
  "text": {}
};
/* harmony default export */ var src_symbols = (symbols);

/** `acceptUnicodeChar = true` is only applicable if `replace` is set. */
function defineSymbol(mode, font, group, replace, name, acceptUnicodeChar) {
  symbols[mode][name] = {
    font,
    group,
    replace
  };
  if (acceptUnicodeChar && replace) {
    symbols[mode][replace] = symbols[mode][name];
  }
}

// Some abbreviations for commonly used strings.
// This helps minify the code, and also spotting typos using jshint.

// modes:
const math = "math";
const symbols_text = "text";

// fonts:
const main = "main";
const ams = "ams";

// groups:
const accent = "accent-token";
const bin = "bin";
const symbols_close = "close";
const inner = "inner";
const mathord = "mathord";
const op = "op-token";
const symbols_open = "open";
const punct = "punct";
const rel = "rel";
const spacing = "spacing";
const textord = "textord";

// Now comes the symbol table

// Relation Symbols
defineSymbol(math, main, rel, "\u2261", "\\equiv", true);
defineSymbol(math, main, rel, "\u227a", "\\prec", true);
defineSymbol(math, main, rel, "\u227b", "\\succ", true);
defineSymbol(math, main, rel, "\u223c", "\\sim", true);
defineSymbol(math, main, rel, "\u22a5", "\\perp");
defineSymbol(math, main, rel, "\u2aaf", "\\preceq", true);
defineSymbol(math, main, rel, "\u2ab0", "\\succeq", true);
defineSymbol(math, main, rel, "\u2243", "\\simeq", true);
defineSymbol(math, main, rel, "\u2223", "\\mid", true);
defineSymbol(math, main, rel, "\u226a", "\\ll", true);
defineSymbol(math, main, rel, "\u226b", "\\gg", true);
defineSymbol(math, main, rel, "\u224d", "\\asymp", true);
defineSymbol(math, main, rel, "\u2225", "\\parallel");
defineSymbol(math, main, rel, "\u22c8", "\\bowtie", true);
defineSymbol(math, main, rel, "\u2323", "\\smile", true);
defineSymbol(math, main, rel, "\u2291", "\\sqsubseteq", true);
defineSymbol(math, main, rel, "\u2292", "\\sqsupseteq", true);
defineSymbol(math, main, rel, "\u2250", "\\doteq", true);
defineSymbol(math, main, rel, "\u2322", "\\frown", true);
defineSymbol(math, main, rel, "\u220b", "\\ni", true);
defineSymbol(math, main, rel, "\u221d", "\\propto", true);
defineSymbol(math, main, rel, "\u22a2", "\\vdash", true);
defineSymbol(math, main, rel, "\u22a3", "\\dashv", true);
defineSymbol(math, main, rel, "\u220b", "\\owns");

// Punctuation
defineSymbol(math, main, punct, "\u002e", "\\ldotp");
defineSymbol(math, main, punct, "\u22c5", "\\cdotp");
// The KaTeX fonts do not contain U+00B7. Use the centered dot glyph at U+22C5
// in both modes, but keep math-mode punctuation spacing only in math mode.
defineSymbol(math, main, punct, "\u22c5", "\u00b7");
defineSymbol(symbols_text, main, textord, "\u22c5", "\u00b7");

// Misc Symbols
defineSymbol(math, main, textord, "\u0023", "\\#");
defineSymbol(symbols_text, main, textord, "\u0023", "\\#");
defineSymbol(math, main, textord, "\u0026", "\\&");
defineSymbol(symbols_text, main, textord, "\u0026", "\\&");
defineSymbol(math, main, textord, "\u2135", "\\aleph", true);
defineSymbol(math, main, textord, "\u2200", "\\forall", true);
defineSymbol(math, main, textord, "\u210f", "\\hbar", true);
defineSymbol(math, main, textord, "\u2203", "\\exists", true);
defineSymbol(math, main, textord, "\u2207", "\\nabla", true);
defineSymbol(math, main, textord, "\u266d", "\\flat", true);
defineSymbol(math, main, textord, "\u2113", "\\ell", true);
defineSymbol(math, main, textord, "\u266e", "\\natural", true);
defineSymbol(math, main, textord, "\u2663", "\\clubsuit", true);
defineSymbol(math, main, textord, "\u2118", "\\wp", true);
defineSymbol(math, main, textord, "\u266f", "\\sharp", true);
defineSymbol(math, main, textord, "\u2662", "\\diamondsuit", true);
defineSymbol(math, main, textord, "\u211c", "\\Re", true);
defineSymbol(math, main, textord, "\u2661", "\\heartsuit", true);
defineSymbol(math, main, textord, "\u2111", "\\Im", true);
defineSymbol(math, main, textord, "\u2660", "\\spadesuit", true);
defineSymbol(math, main, textord, "\u00a7", "\\S", true);
defineSymbol(symbols_text, main, textord, "\u00a7", "\\S");
defineSymbol(math, main, textord, "\u00b6", "\\P", true);
defineSymbol(symbols_text, main, textord, "\u00b6", "\\P");

// Math and Text
defineSymbol(math, main, textord, "\u2020", "\\dag");
defineSymbol(symbols_text, main, textord, "\u2020", "\\dag");
defineSymbol(symbols_text, main, textord, "\u2020", "\\textdagger");
defineSymbol(math, main, textord, "\u2021", "\\ddag");
defineSymbol(symbols_text, main, textord, "\u2021", "\\ddag");
defineSymbol(symbols_text, main, textord, "\u2021", "\\textdaggerdbl");

// Large Delimiters
defineSymbol(math, main, symbols_close, "\u23b1", "\\rmoustache", true);
defineSymbol(math, main, symbols_open, "\u23b0", "\\lmoustache", true);
defineSymbol(math, main, symbols_close, "\u27ef", "\\rgroup", true);
defineSymbol(math, main, symbols_open, "\u27ee", "\\lgroup", true);

// Binary Operators
defineSymbol(math, main, bin, "\u2213", "\\mp", true);
defineSymbol(math, main, bin, "\u2296", "\\ominus", true);
defineSymbol(math, main, bin, "\u228e", "\\uplus", true);
defineSymbol(math, main, bin, "\u2293", "\\sqcap", true);
defineSymbol(math, main, bin, "\u2217", "\\ast");
defineSymbol(math, main, bin, "\u2294", "\\sqcup", true);
defineSymbol(math, main, bin, "\u25ef", "\\bigcirc", true);
defineSymbol(math, main, bin, "\u2219", "\\bullet", true);
defineSymbol(math, main, bin, "\u2021", "\\ddagger");
defineSymbol(math, main, bin, "\u2240", "\\wr", true);
defineSymbol(math, main, bin, "\u2a3f", "\\amalg");
defineSymbol(math, main, bin, "\u0026", "\\And"); // from amsmath

// Arrow Symbols
defineSymbol(math, main, rel, "\u27f5", "\\longleftarrow", true);
defineSymbol(math, main, rel, "\u21d0", "\\Leftarrow", true);
defineSymbol(math, main, rel, "\u27f8", "\\Longleftarrow", true);
defineSymbol(math, main, rel, "\u27f6", "\\longrightarrow", true);
defineSymbol(math, main, rel, "\u21d2", "\\Rightarrow", true);
defineSymbol(math, main, rel, "\u27f9", "\\Longrightarrow", true);
defineSymbol(math, main, rel, "\u2194", "\\leftrightarrow", true);
defineSymbol(math, main, rel, "\u27f7", "\\longleftrightarrow", true);
defineSymbol(math, main, rel, "\u21d4", "\\Leftrightarrow", true);
defineSymbol(math, main, rel, "\u27fa", "\\Longleftrightarrow", true);
defineSymbol(math, main, rel, "\u21a6", "\\mapsto", true);
defineSymbol(math, main, rel, "\u27fc", "\\longmapsto", true);
defineSymbol(math, main, rel, "\u2197", "\\nearrow", true);
defineSymbol(math, main, rel, "\u21a9", "\\hookleftarrow", true);
defineSymbol(math, main, rel, "\u21aa", "\\hookrightarrow", true);
defineSymbol(math, main, rel, "\u2198", "\\searrow", true);
defineSymbol(math, main, rel, "\u21bc", "\\leftharpoonup", true);
defineSymbol(math, main, rel, "\u21c0", "\\rightharpoonup", true);
defineSymbol(math, main, rel, "\u2199", "\\swarrow", true);
defineSymbol(math, main, rel, "\u21bd", "\\leftharpoondown", true);
defineSymbol(math, main, rel, "\u21c1", "\\rightharpoondown", true);
defineSymbol(math, main, rel, "\u2196", "\\nwarrow", true);
defineSymbol(math, main, rel, "\u21cc", "\\rightleftharpoons", true);

// AMS Negated Binary Relations
defineSymbol(math, ams, rel, "\u226e", "\\nless", true);
// Symbol names preceded by "@" each have a corresponding macro.
defineSymbol(math, ams, rel, "\ue010", "\\@nleqslant");
defineSymbol(math, ams, rel, "\ue011", "\\@nleqq");
defineSymbol(math, ams, rel, "\u2a87", "\\lneq", true);
defineSymbol(math, ams, rel, "\u2268", "\\lneqq", true);
defineSymbol(math, ams, rel, "\ue00c", "\\@lvertneqq");
defineSymbol(math, ams, rel, "\u22e6", "\\lnsim", true);
defineSymbol(math, ams, rel, "\u2a89", "\\lnapprox", true);
defineSymbol(math, ams, rel, "\u2280", "\\nprec", true);
// unicode-math maps \u22e0 to \npreccurlyeq. We'll use the AMS synonym.
defineSymbol(math, ams, rel, "\u22e0", "\\npreceq", true);
defineSymbol(math, ams, rel, "\u22e8", "\\precnsim", true);
defineSymbol(math, ams, rel, "\u2ab9", "\\precnapprox", true);
defineSymbol(math, ams, rel, "\u2241", "\\nsim", true);
defineSymbol(math, ams, rel, "\ue006", "\\@nshortmid");
defineSymbol(math, ams, rel, "\u2224", "\\nmid", true);
defineSymbol(math, ams, rel, "\u22ac", "\\nvdash", true);
defineSymbol(math, ams, rel, "\u22ad", "\\nvDash", true);
defineSymbol(math, ams, rel, "\u22ea", "\\ntriangleleft");
defineSymbol(math, ams, rel, "\u22ec", "\\ntrianglelefteq", true);
defineSymbol(math, ams, rel, "\u228a", "\\subsetneq", true);
defineSymbol(math, ams, rel, "\ue01a", "\\@varsubsetneq");
defineSymbol(math, ams, rel, "\u2acb", "\\subsetneqq", true);
defineSymbol(math, ams, rel, "\ue017", "\\@varsubsetneqq");
defineSymbol(math, ams, rel, "\u226f", "\\ngtr", true);
defineSymbol(math, ams, rel, "\ue00f", "\\@ngeqslant");
defineSymbol(math, ams, rel, "\ue00e", "\\@ngeqq");
defineSymbol(math, ams, rel, "\u2a88", "\\gneq", true);
defineSymbol(math, ams, rel, "\u2269", "\\gneqq", true);
defineSymbol(math, ams, rel, "\ue00d", "\\@gvertneqq");
defineSymbol(math, ams, rel, "\u22e7", "\\gnsim", true);
defineSymbol(math, ams, rel, "\u2a8a", "\\gnapprox", true);
defineSymbol(math, ams, rel, "\u2281", "\\nsucc", true);
// unicode-math maps \u22e1 to \nsucccurlyeq. We'll use the AMS synonym.
defineSymbol(math, ams, rel, "\u22e1", "\\nsucceq", true);
defineSymbol(math, ams, rel, "\u22e9", "\\succnsim", true);
defineSymbol(math, ams, rel, "\u2aba", "\\succnapprox", true);
// unicode-math maps \u2246 to \simneqq. We'll use the AMS synonym.
defineSymbol(math, ams, rel, "\u2246", "\\ncong", true);
defineSymbol(math, ams, rel, "\ue007", "\\@nshortparallel");
defineSymbol(math, ams, rel, "\u2226", "\\nparallel", true);
defineSymbol(math, ams, rel, "\u22af", "\\nVDash", true);
defineSymbol(math, ams, rel, "\u22eb", "\\ntriangleright");
defineSymbol(math, ams, rel, "\u22ed", "\\ntrianglerighteq", true);
defineSymbol(math, ams, rel, "\ue018", "\\@nsupseteqq");
defineSymbol(math, ams, rel, "\u228b", "\\supsetneq", true);
defineSymbol(math, ams, rel, "\ue01b", "\\@varsupsetneq");
defineSymbol(math, ams, rel, "\u2acc", "\\supsetneqq", true);
defineSymbol(math, ams, rel, "\ue019", "\\@varsupsetneqq");
defineSymbol(math, ams, rel, "\u22ae", "\\nVdash", true);
defineSymbol(math, ams, rel, "\u2ab5", "\\precneqq", true);
defineSymbol(math, ams, rel, "\u2ab6", "\\succneqq", true);
defineSymbol(math, ams, rel, "\ue016", "\\@nsubseteqq");
defineSymbol(math, ams, bin, "\u22b4", "\\unlhd");
defineSymbol(math, ams, bin, "\u22b5", "\\unrhd");

// AMS Negated Arrows
defineSymbol(math, ams, rel, "\u219a", "\\nleftarrow", true);
defineSymbol(math, ams, rel, "\u219b", "\\nrightarrow", true);
defineSymbol(math, ams, rel, "\u21cd", "\\nLeftarrow", true);
defineSymbol(math, ams, rel, "\u21cf", "\\nRightarrow", true);
defineSymbol(math, ams, rel, "\u21ae", "\\nleftrightarrow", true);
defineSymbol(math, ams, rel, "\u21ce", "\\nLeftrightarrow", true);

// AMS Misc
defineSymbol(math, ams, rel, "\u25b3", "\\vartriangle");
defineSymbol(math, ams, textord, "\u210f", "\\hslash");
defineSymbol(math, ams, textord, "\u25bd", "\\triangledown");
defineSymbol(math, ams, textord, "\u25ca", "\\lozenge");
defineSymbol(math, ams, textord, "\u24c8", "\\circledS");
defineSymbol(math, ams, textord, "\u00ae", "\\circledR");
defineSymbol(symbols_text, ams, textord, "\u00ae", "\\circledR");
defineSymbol(math, ams, textord, "\u2221", "\\measuredangle", true);
defineSymbol(math, ams, textord, "\u2204", "\\nexists");
defineSymbol(math, ams, textord, "\u2127", "\\mho");
defineSymbol(math, ams, textord, "\u2132", "\\Finv", true);
defineSymbol(math, ams, textord, "\u2141", "\\Game", true);
defineSymbol(math, ams, textord, "\u2035", "\\backprime");
defineSymbol(math, ams, textord, "\u25b2", "\\blacktriangle");
defineSymbol(math, ams, textord, "\u25bc", "\\blacktriangledown");
defineSymbol(math, ams, textord, "\u25a0", "\\blacksquare");
defineSymbol(math, ams, textord, "\u29eb", "\\blacklozenge");
defineSymbol(math, ams, textord, "\u2605", "\\bigstar");
defineSymbol(math, ams, textord, "\u2222", "\\sphericalangle", true);
defineSymbol(math, ams, textord, "\u2201", "\\complement", true);
// unicode-math maps U+F0 to \matheth. We map to AMS function \eth
defineSymbol(math, ams, textord, "\u00f0", "\\eth", true);
defineSymbol(symbols_text, main, textord, "\u00f0", "\u00f0");
defineSymbol(math, ams, textord, "\u2571", "\\diagup");
defineSymbol(math, ams, textord, "\u2572", "\\diagdown");
defineSymbol(math, ams, textord, "\u25a1", "\\square");
defineSymbol(math, ams, textord, "\u25a1", "\\Box");
defineSymbol(math, ams, textord, "\u25ca", "\\Diamond");
// unicode-math maps U+A5 to \mathyen. We map to AMS function \yen
defineSymbol(math, ams, textord, "\u00a5", "\\yen", true);
defineSymbol(symbols_text, ams, textord, "\u00a5", "\\yen", true);
defineSymbol(math, ams, textord, "\u2713", "\\checkmark", true);
defineSymbol(symbols_text, ams, textord, "\u2713", "\\checkmark");

// AMS Hebrew
defineSymbol(math, ams, textord, "\u2136", "\\beth", true);
defineSymbol(math, ams, textord, "\u2138", "\\daleth", true);
defineSymbol(math, ams, textord, "\u2137", "\\gimel", true);

// AMS Greek
defineSymbol(math, ams, textord, "\u03dd", "\\digamma", true);
defineSymbol(math, ams, textord, "\u03f0", "\\varkappa");

// AMS Delimiters
defineSymbol(math, ams, symbols_open, "\u250c", "\\@ulcorner", true);
defineSymbol(math, ams, symbols_close, "\u2510", "\\@urcorner", true);
defineSymbol(math, ams, symbols_open, "\u2514", "\\@llcorner", true);
defineSymbol(math, ams, symbols_close, "\u2518", "\\@lrcorner", true);

// AMS Binary Relations
defineSymbol(math, ams, rel, "\u2266", "\\leqq", true);
defineSymbol(math, ams, rel, "\u2a7d", "\\leqslant", true);
defineSymbol(math, ams, rel, "\u2a95", "\\eqslantless", true);
defineSymbol(math, ams, rel, "\u2272", "\\lesssim", true);
defineSymbol(math, ams, rel, "\u2a85", "\\lessapprox", true);
defineSymbol(math, ams, rel, "\u224a", "\\approxeq", true);
defineSymbol(math, ams, bin, "\u22d6", "\\lessdot");
defineSymbol(math, ams, rel, "\u22d8", "\\lll", true);
defineSymbol(math, ams, rel, "\u2276", "\\lessgtr", true);
defineSymbol(math, ams, rel, "\u22da", "\\lesseqgtr", true);
defineSymbol(math, ams, rel, "\u2a8b", "\\lesseqqgtr", true);
defineSymbol(math, ams, rel, "\u2251", "\\doteqdot");
defineSymbol(math, ams, rel, "\u2253", "\\risingdotseq", true);
defineSymbol(math, ams, rel, "\u2252", "\\fallingdotseq", true);
defineSymbol(math, ams, rel, "\u223d", "\\backsim", true);
defineSymbol(math, ams, rel, "\u22cd", "\\backsimeq", true);
defineSymbol(math, ams, rel, "\u2ac5", "\\subseteqq", true);
defineSymbol(math, ams, rel, "\u22d0", "\\Subset", true);
defineSymbol(math, ams, rel, "\u228f", "\\sqsubset", true);
defineSymbol(math, ams, rel, "\u227c", "\\preccurlyeq", true);
defineSymbol(math, ams, rel, "\u22de", "\\curlyeqprec", true);
defineSymbol(math, ams, rel, "\u227e", "\\precsim", true);
defineSymbol(math, ams, rel, "\u2ab7", "\\precapprox", true);
defineSymbol(math, ams, rel, "\u22b2", "\\vartriangleleft");
defineSymbol(math, ams, rel, "\u22b4", "\\trianglelefteq");
defineSymbol(math, ams, rel, "\u22a8", "\\vDash", true);
defineSymbol(math, ams, rel, "\u22aa", "\\Vvdash", true);
defineSymbol(math, ams, rel, "\u2323", "\\smallsmile");
defineSymbol(math, ams, rel, "\u2322", "\\smallfrown");
defineSymbol(math, ams, rel, "\u224f", "\\bumpeq", true);
defineSymbol(math, ams, rel, "\u224e", "\\Bumpeq", true);
defineSymbol(math, ams, rel, "\u2267", "\\geqq", true);
defineSymbol(math, ams, rel, "\u2a7e", "\\geqslant", true);
defineSymbol(math, ams, rel, "\u2a96", "\\eqslantgtr", true);
defineSymbol(math, ams, rel, "\u2273", "\\gtrsim", true);
defineSymbol(math, ams, rel, "\u2a86", "\\gtrapprox", true);
defineSymbol(math, ams, bin, "\u22d7", "\\gtrdot");
defineSymbol(math, ams, rel, "\u22d9", "\\ggg", true);
defineSymbol(math, ams, rel, "\u2277", "\\gtrless", true);
defineSymbol(math, ams, rel, "\u22db", "\\gtreqless", true);
defineSymbol(math, ams, rel, "\u2a8c", "\\gtreqqless", true);
defineSymbol(math, ams, rel, "\u2256", "\\eqcirc", true);
defineSymbol(math, ams, rel, "\u2257", "\\circeq", true);
defineSymbol(math, ams, rel, "\u225c", "\\triangleq", true);
defineSymbol(math, ams, rel, "\u223c", "\\thicksim");
defineSymbol(math, ams, rel, "\u2248", "\\thickapprox");
defineSymbol(math, ams, rel, "\u2ac6", "\\supseteqq", true);
defineSymbol(math, ams, rel, "\u22d1", "\\Supset", true);
defineSymbol(math, ams, rel, "\u2290", "\\sqsupset", true);
defineSymbol(math, ams, rel, "\u227d", "\\succcurlyeq", true);
defineSymbol(math, ams, rel, "\u22df", "\\curlyeqsucc", true);
defineSymbol(math, ams, rel, "\u227f", "\\succsim", true);
defineSymbol(math, ams, rel, "\u2ab8", "\\succapprox", true);
defineSymbol(math, ams, rel, "\u22b3", "\\vartriangleright");
defineSymbol(math, ams, rel, "\u22b5", "\\trianglerighteq");
defineSymbol(math, ams, rel, "\u22a9", "\\Vdash", true);
defineSymbol(math, ams, rel, "\u2223", "\\shortmid");
defineSymbol(math, ams, rel, "\u2225", "\\shortparallel");
defineSymbol(math, ams, rel, "\u226c", "\\between", true);
defineSymbol(math, ams, rel, "\u22d4", "\\pitchfork", true);
defineSymbol(math, ams, rel, "\u221d", "\\varpropto");
defineSymbol(math, ams, rel, "\u25c0", "\\blacktriangleleft");
// unicode-math says that \therefore is a mathord atom.
// We kept the amssymb atom type, which is rel.
defineSymbol(math, ams, rel, "\u2234", "\\therefore", true);
defineSymbol(math, ams, rel, "\u220d", "\\backepsilon");
defineSymbol(math, ams, rel, "\u25b6", "\\blacktriangleright");
// unicode-math says that \because is a mathord atom.
// We kept the amssymb atom type, which is rel.
defineSymbol(math, ams, rel, "\u2235", "\\because", true);
defineSymbol(math, ams, rel, "\u22d8", "\\llless");
defineSymbol(math, ams, rel, "\u22d9", "\\gggtr");
defineSymbol(math, ams, bin, "\u22b2", "\\lhd");
defineSymbol(math, ams, bin, "\u22b3", "\\rhd");
defineSymbol(math, ams, rel, "\u2242", "\\eqsim", true);
defineSymbol(math, main, rel, "\u22c8", "\\Join");
defineSymbol(math, ams, rel, "\u2251", "\\Doteq", true);

// AMS Binary Operators
defineSymbol(math, ams, bin, "\u2214", "\\dotplus", true);
defineSymbol(math, ams, bin, "\u2216", "\\smallsetminus");
defineSymbol(math, ams, bin, "\u22d2", "\\Cap", true);
defineSymbol(math, ams, bin, "\u22d3", "\\Cup", true);
defineSymbol(math, ams, bin, "\u2a5e", "\\doublebarwedge", true);
defineSymbol(math, ams, bin, "\u229f", "\\boxminus", true);
defineSymbol(math, ams, bin, "\u229e", "\\boxplus", true);
defineSymbol(math, ams, bin, "\u22c7", "\\divideontimes", true);
defineSymbol(math, ams, bin, "\u22c9", "\\ltimes", true);
defineSymbol(math, ams, bin, "\u22ca", "\\rtimes", true);
defineSymbol(math, ams, bin, "\u22cb", "\\leftthreetimes", true);
defineSymbol(math, ams, bin, "\u22cc", "\\rightthreetimes", true);
defineSymbol(math, ams, bin, "\u22cf", "\\curlywedge", true);
defineSymbol(math, ams, bin, "\u22ce", "\\curlyvee", true);
defineSymbol(math, ams, bin, "\u229d", "\\circleddash", true);
defineSymbol(math, ams, bin, "\u229b", "\\circledast", true);
defineSymbol(math, ams, bin, "\u22c5", "\\centerdot");
defineSymbol(math, ams, bin, "\u22ba", "\\intercal", true);
defineSymbol(math, ams, bin, "\u22d2", "\\doublecap");
defineSymbol(math, ams, bin, "\u22d3", "\\doublecup");
defineSymbol(math, ams, bin, "\u22a0", "\\boxtimes", true);

// AMS Arrows
// Note: unicode-math maps \u21e2 to their own function \rightdasharrow.
// We'll map it to AMS function \dashrightarrow. It produces the same atom.
defineSymbol(math, ams, rel, "\u21e2", "\\dashrightarrow", true);
// unicode-math maps \u21e0 to \leftdasharrow. We'll use the AMS synonym.
defineSymbol(math, ams, rel, "\u21e0", "\\dashleftarrow", true);
defineSymbol(math, ams, rel, "\u21c7", "\\leftleftarrows", true);
defineSymbol(math, ams, rel, "\u21c6", "\\leftrightarrows", true);
defineSymbol(math, ams, rel, "\u21da", "\\Lleftarrow", true);
defineSymbol(math, ams, rel, "\u219e", "\\twoheadleftarrow", true);
defineSymbol(math, ams, rel, "\u21a2", "\\leftarrowtail", true);
defineSymbol(math, ams, rel, "\u21ab", "\\looparrowleft", true);
defineSymbol(math, ams, rel, "\u21cb", "\\leftrightharpoons", true);
defineSymbol(math, ams, rel, "\u21b6", "\\curvearrowleft", true);
// unicode-math maps \u21ba to \acwopencirclearrow. We'll use the AMS synonym.
defineSymbol(math, ams, rel, "\u21ba", "\\circlearrowleft", true);
defineSymbol(math, ams, rel, "\u21b0", "\\Lsh", true);
defineSymbol(math, ams, rel, "\u21c8", "\\upuparrows", true);
defineSymbol(math, ams, rel, "\u21bf", "\\upharpoonleft", true);
defineSymbol(math, ams, rel, "\u21c3", "\\downharpoonleft", true);
defineSymbol(math, main, rel, "\u22b6", "\\origof", true); // not in font
defineSymbol(math, main, rel, "\u22b7", "\\imageof", true); // not in font
defineSymbol(math, ams, rel, "\u22b8", "\\multimap", true);
defineSymbol(math, ams, rel, "\u21ad", "\\leftrightsquigarrow", true);
defineSymbol(math, ams, rel, "\u21c9", "\\rightrightarrows", true);
defineSymbol(math, ams, rel, "\u21c4", "\\rightleftarrows", true);
defineSymbol(math, ams, rel, "\u21a0", "\\twoheadrightarrow", true);
defineSymbol(math, ams, rel, "\u21a3", "\\rightarrowtail", true);
defineSymbol(math, ams, rel, "\u21ac", "\\looparrowright", true);
defineSymbol(math, ams, rel, "\u21b7", "\\curvearrowright", true);
// unicode-math maps \u21bb to \cwopencirclearrow. We'll use the AMS synonym.
defineSymbol(math, ams, rel, "\u21bb", "\\circlearrowright", true);
defineSymbol(math, ams, rel, "\u21b1", "\\Rsh", true);
defineSymbol(math, ams, rel, "\u21ca", "\\downdownarrows", true);
defineSymbol(math, ams, rel, "\u21be", "\\upharpoonright", true);
defineSymbol(math, ams, rel, "\u21c2", "\\downharpoonright", true);
defineSymbol(math, ams, rel, "\u21dd", "\\rightsquigarrow", true);
defineSymbol(math, ams, rel, "\u21dd", "\\leadsto");
defineSymbol(math, ams, rel, "\u21db", "\\Rrightarrow", true);
defineSymbol(math, ams, rel, "\u21be", "\\restriction");
defineSymbol(math, main, textord, "\u2018", "`");
defineSymbol(math, main, textord, "$", "\\$");
defineSymbol(symbols_text, main, textord, "$", "\\$");
defineSymbol(symbols_text, main, textord, "$", "\\textdollar");
defineSymbol(math, main, textord, "%", "\\%");
defineSymbol(symbols_text, main, textord, "%", "\\%");
defineSymbol(math, main, textord, "_", "\\_");
defineSymbol(symbols_text, main, textord, "_", "\\_");
defineSymbol(symbols_text, main, textord, "_", "\\textunderscore");
defineSymbol(math, main, textord, "\u2220", "\\angle", true);
defineSymbol(math, main, textord, "\u221e", "\\infty", true);
defineSymbol(math, main, textord, "\u2032", "\\prime");
defineSymbol(math, main, textord, "\u25b3", "\\triangle");
defineSymbol(math, main, textord, "\u0393", "\\Gamma", true);
defineSymbol(math, main, textord, "\u0394", "\\Delta", true);
defineSymbol(math, main, textord, "\u0398", "\\Theta", true);
defineSymbol(math, main, textord, "\u039b", "\\Lambda", true);
defineSymbol(math, main, textord, "\u039e", "\\Xi", true);
defineSymbol(math, main, textord, "\u03a0", "\\Pi", true);
defineSymbol(math, main, textord, "\u03a3", "\\Sigma", true);
defineSymbol(math, main, textord, "\u03a5", "\\Upsilon", true);
defineSymbol(math, main, textord, "\u03a6", "\\Phi", true);
defineSymbol(math, main, textord, "\u03a8", "\\Psi", true);
defineSymbol(math, main, textord, "\u03a9", "\\Omega", true);
defineSymbol(math, main, textord, "A", "\u0391");
defineSymbol(math, main, textord, "B", "\u0392");
defineSymbol(math, main, textord, "E", "\u0395");
defineSymbol(math, main, textord, "Z", "\u0396");
defineSymbol(math, main, textord, "H", "\u0397");
defineSymbol(math, main, textord, "I", "\u0399");
defineSymbol(math, main, textord, "K", "\u039A");
defineSymbol(math, main, textord, "M", "\u039C");
defineSymbol(math, main, textord, "N", "\u039D");
defineSymbol(math, main, textord, "O", "\u039F");
defineSymbol(math, main, textord, "P", "\u03A1");
defineSymbol(math, main, textord, "T", "\u03A4");
defineSymbol(math, main, textord, "X", "\u03A7");
defineSymbol(math, main, textord, "\u00ac", "\\neg", true);
defineSymbol(math, main, textord, "\u00ac", "\\lnot");
defineSymbol(math, main, textord, "\u22a4", "\\top");
defineSymbol(math, main, textord, "\u22a5", "\\bot");
defineSymbol(math, main, textord, "\u2205", "\\emptyset");
defineSymbol(math, ams, textord, "\u2205", "\\varnothing");
defineSymbol(math, main, mathord, "\u03b1", "\\alpha", true);
defineSymbol(math, main, mathord, "\u03b2", "\\beta", true);
defineSymbol(math, main, mathord, "\u03b3", "\\gamma", true);
defineSymbol(math, main, mathord, "\u03b4", "\\delta", true);
defineSymbol(math, main, mathord, "\u03f5", "\\epsilon", true);
defineSymbol(math, main, mathord, "\u03b6", "\\zeta", true);
defineSymbol(math, main, mathord, "\u03b7", "\\eta", true);
defineSymbol(math, main, mathord, "\u03b8", "\\theta", true);
defineSymbol(math, main, mathord, "\u03b9", "\\iota", true);
defineSymbol(math, main, mathord, "\u03ba", "\\kappa", true);
defineSymbol(math, main, mathord, "\u03bb", "\\lambda", true);
defineSymbol(math, main, mathord, "\u03bc", "\\mu", true);
defineSymbol(math, main, mathord, "\u03bd", "\\nu", true);
defineSymbol(math, main, mathord, "\u03be", "\\xi", true);
defineSymbol(math, main, mathord, "\u03bf", "\\omicron", true);
defineSymbol(math, main, mathord, "\u03c0", "\\pi", true);
defineSymbol(math, main, mathord, "\u03c1", "\\rho", true);
defineSymbol(math, main, mathord, "\u03c3", "\\sigma", true);
defineSymbol(math, main, mathord, "\u03c4", "\\tau", true);
defineSymbol(math, main, mathord, "\u03c5", "\\upsilon", true);
defineSymbol(math, main, mathord, "\u03d5", "\\phi", true);
defineSymbol(math, main, mathord, "\u03c7", "\\chi", true);
defineSymbol(math, main, mathord, "\u03c8", "\\psi", true);
defineSymbol(math, main, mathord, "\u03c9", "\\omega", true);
defineSymbol(math, main, mathord, "\u03b5", "\\varepsilon", true);
defineSymbol(math, main, mathord, "\u03d1", "\\vartheta", true);
defineSymbol(math, main, mathord, "\u03d6", "\\varpi", true);
defineSymbol(math, main, mathord, "\u03f1", "\\varrho", true);
defineSymbol(math, main, mathord, "\u03c2", "\\varsigma", true);
defineSymbol(math, main, mathord, "\u03c6", "\\varphi", true);
defineSymbol(math, main, bin, "\u2217", "*", true);
defineSymbol(math, main, bin, "+", "+");
defineSymbol(math, main, bin, "\u2212", "-", true);
defineSymbol(math, main, bin, "\u22c5", "\\cdot", true);
defineSymbol(math, main, bin, "\u2218", "\\circ", true);
defineSymbol(math, main, bin, "\u00f7", "\\div", true);
defineSymbol(math, main, bin, "\u00b1", "\\pm", true);
defineSymbol(math, main, bin, "\u00d7", "\\times", true);
defineSymbol(math, main, bin, "\u2229", "\\cap", true);
defineSymbol(math, main, bin, "\u222a", "\\cup", true);
defineSymbol(math, main, bin, "\u2216", "\\setminus", true);
defineSymbol(math, main, bin, "\u2227", "\\land");
defineSymbol(math, main, bin, "\u2228", "\\lor");
defineSymbol(math, main, bin, "\u2227", "\\wedge", true);
defineSymbol(math, main, bin, "\u2228", "\\vee", true);
defineSymbol(math, main, textord, "\u221a", "\\surd");
defineSymbol(math, main, symbols_open, "\u27e8", "\\langle", true);
defineSymbol(math, main, symbols_open, "\u2223", "\\lvert");
defineSymbol(math, main, symbols_open, "\u2225", "\\lVert");
defineSymbol(math, main, symbols_close, "?", "?");
defineSymbol(math, main, symbols_close, "!", "!");
defineSymbol(math, main, symbols_close, "\u27e9", "\\rangle", true);
defineSymbol(math, main, symbols_close, "\u2223", "\\rvert");
defineSymbol(math, main, symbols_close, "\u2225", "\\rVert");
defineSymbol(math, main, rel, "=", "=");
defineSymbol(math, main, rel, ":", ":");
defineSymbol(math, main, rel, "\u2248", "\\approx", true);
defineSymbol(math, main, rel, "\u2245", "\\cong", true);
defineSymbol(math, main, rel, "\u2265", "\\ge");
defineSymbol(math, main, rel, "\u2265", "\\geq", true);
defineSymbol(math, main, rel, "\u2190", "\\gets");
defineSymbol(math, main, rel, ">", "\\gt", true);
defineSymbol(math, main, rel, "\u2208", "\\in", true);
defineSymbol(math, main, rel, "\ue020", "\\@not");
defineSymbol(math, main, rel, "\u2282", "\\subset", true);
defineSymbol(math, main, rel, "\u2283", "\\supset", true);
defineSymbol(math, main, rel, "\u2286", "\\subseteq", true);
defineSymbol(math, main, rel, "\u2287", "\\supseteq", true);
defineSymbol(math, ams, rel, "\u2288", "\\nsubseteq", true);
defineSymbol(math, ams, rel, "\u2289", "\\nsupseteq", true);
defineSymbol(math, main, rel, "\u22a8", "\\models");
defineSymbol(math, main, rel, "\u2190", "\\leftarrow", true);
defineSymbol(math, main, rel, "\u2264", "\\le");
defineSymbol(math, main, rel, "\u2264", "\\leq", true);
defineSymbol(math, main, rel, "<", "\\lt", true);
defineSymbol(math, main, rel, "\u2192", "\\rightarrow", true);
defineSymbol(math, main, rel, "\u2192", "\\to");
defineSymbol(math, ams, rel, "\u2271", "\\ngeq", true);
defineSymbol(math, ams, rel, "\u2270", "\\nleq", true);
defineSymbol(math, main, spacing, "\u00a0", "\\ ");
defineSymbol(math, main, spacing, "\u00a0", "\\space");
// Ref: LaTeX Source 2e: \DeclareRobustCommand{\nobreakspace}{%
defineSymbol(math, main, spacing, "\u00a0", "\\nobreakspace");
defineSymbol(symbols_text, main, spacing, "\u00a0", "\\ ");
defineSymbol(symbols_text, main, spacing, "\u00a0", " ");
defineSymbol(symbols_text, main, spacing, "\u00a0", "\\space");
defineSymbol(symbols_text, main, spacing, "\u00a0", "\\nobreakspace");
defineSymbol(math, main, spacing, "", "\\nobreak");
defineSymbol(math, main, spacing, "", "\\allowbreak");
defineSymbol(math, main, punct, ",", ",");
defineSymbol(math, main, punct, ";", ";");
defineSymbol(math, ams, bin, "\u22bc", "\\barwedge", true);
defineSymbol(math, ams, bin, "\u22bb", "\\veebar", true);
defineSymbol(math, main, bin, "   \u2299", "\\odot", true);
defineSymbol(math, main, bin, "\u2295", "\\oplus", true);
defineSymbol(math, main, bin, "\u2297", "\\otimes", true);
defineSymbol(math, main, textord, "\u2202", "\\partial", true);
defineSymbol(math, main, bin, "\u2298", "\\oslash", true);
defineSymbol(math, ams, bin, "\u229a", "\\circledcirc", true);
defineSymbol(math, ams, bin, "\u22a1", "\\boxdot", true);
defineSymbol(math, main, bin, "\u25b3", "\\bigtriangleup");
defineSymbol(math, main, bin, "\u25bd", "\\bigtriangledown");
defineSymbol(math, main, bin, "\u2020", "\\dagger");
defineSymbol(math, main, bin, "\u22c4", "\\diamond");
defineSymbol(math, main, bin, "\u22c6", "\\star");
defineSymbol(math, main, bin, "\u25c3", "\\triangleleft");
defineSymbol(math, main, bin, "\u25b9", "\\triangleright");
defineSymbol(math, main, symbols_open, "{", "\\{");
defineSymbol(symbols_text, main, textord, "{", "\\{");
defineSymbol(symbols_text, main, textord, "{", "\\textbraceleft");
defineSymbol(math, main, symbols_close, "}", "\\}");
defineSymbol(symbols_text, main, textord, "}", "\\}");
defineSymbol(symbols_text, main, textord, "}", "\\textbraceright");
defineSymbol(math, main, symbols_open, "{", "\\lbrace");
defineSymbol(math, main, symbols_close, "}", "\\rbrace");
defineSymbol(math, main, symbols_open, "[", "\\lbrack", true);
defineSymbol(symbols_text, main, textord, "[", "\\lbrack", true);
defineSymbol(math, main, symbols_close, "]", "\\rbrack", true);
defineSymbol(symbols_text, main, textord, "]", "\\rbrack", true);
defineSymbol(math, main, symbols_open, "(", "\\lparen", true);
defineSymbol(math, main, symbols_close, ")", "\\rparen", true);
defineSymbol(symbols_text, main, textord, "<", "\\textless", true); // in T1 fontenc
defineSymbol(symbols_text, main, textord, ">", "\\textgreater", true); // in T1 fontenc
defineSymbol(math, main, symbols_open, "\u230a", "\\lfloor", true);
defineSymbol(math, main, symbols_close, "\u230b", "\\rfloor", true);
defineSymbol(math, main, symbols_open, "\u2308", "\\lceil", true);
defineSymbol(math, main, symbols_close, "\u2309", "\\rceil", true);
defineSymbol(math, main, textord, "\\", "\\backslash");
defineSymbol(math, main, textord, "\u2223", "|");
defineSymbol(math, main, textord, "\u2223", "\\vert");
defineSymbol(symbols_text, main, textord, "|", "\\textbar", true); // in T1 fontenc
defineSymbol(math, main, textord, "\u2225", "\\|");
defineSymbol(math, main, textord, "\u2225", "\\Vert");
defineSymbol(symbols_text, main, textord, "\u2225", "\\textbardbl");
defineSymbol(symbols_text, main, textord, "~", "\\textasciitilde");
defineSymbol(symbols_text, main, textord, "\\", "\\textbackslash");
defineSymbol(symbols_text, main, textord, "^", "\\textasciicircum");
defineSymbol(math, main, rel, "\u2191", "\\uparrow", true);
defineSymbol(math, main, rel, "\u21d1", "\\Uparrow", true);
defineSymbol(math, main, rel, "\u2193", "\\downarrow", true);
defineSymbol(math, main, rel, "\u21d3", "\\Downarrow", true);
defineSymbol(math, main, rel, "\u2195", "\\updownarrow", true);
defineSymbol(math, main, rel, "\u21d5", "\\Updownarrow", true);
defineSymbol(math, main, op, "\u2210", "\\coprod");
defineSymbol(math, main, op, "\u22c1", "\\bigvee");
defineSymbol(math, main, op, "\u22c0", "\\bigwedge");
defineSymbol(math, main, op, "\u2a04", "\\biguplus");
defineSymbol(math, main, op, "\u22c2", "\\bigcap");
defineSymbol(math, main, op, "\u22c3", "\\bigcup");
defineSymbol(math, main, op, "\u222b", "\\int");
defineSymbol(math, main, op, "\u222b", "\\intop");
defineSymbol(math, main, op, "\u222c", "\\iint");
defineSymbol(math, main, op, "\u222d", "\\iiint");
defineSymbol(math, main, op, "\u220f", "\\prod");
defineSymbol(math, main, op, "\u2211", "\\sum");
defineSymbol(math, main, op, "\u2a02", "\\bigotimes");
defineSymbol(math, main, op, "\u2a01", "\\bigoplus");
defineSymbol(math, main, op, "\u2a00", "\\bigodot");
defineSymbol(math, main, op, "\u222e", "\\oint");
defineSymbol(math, main, op, "\u222f", "\\oiint");
defineSymbol(math, main, op, "\u2230", "\\oiiint");
defineSymbol(math, main, op, "\u2a06", "\\bigsqcup");
defineSymbol(math, main, op, "\u222b", "\\smallint");
defineSymbol(symbols_text, main, inner, "\u2026", "\\textellipsis");
defineSymbol(math, main, inner, "\u2026", "\\mathellipsis");
defineSymbol(symbols_text, main, inner, "\u2026", "\\ldots", true);
defineSymbol(math, main, inner, "\u2026", "\\ldots", true);
defineSymbol(math, main, inner, "\u22ef", "\\@cdots", true);
defineSymbol(math, main, inner, "\u22f1", "\\ddots", true);
// \vdots is a macro that uses one of these two symbols (with made-up names):
defineSymbol(math, main, textord, "\u22ee", "\\varvdots");
defineSymbol(symbols_text, main, textord, "\u22ee", "\\varvdots");
defineSymbol(math, main, accent, "\u02ca", "\\acute");
defineSymbol(math, main, accent, "\u02cb", "\\grave");
defineSymbol(math, main, accent, "\u00a8", "\\ddot");
defineSymbol(math, main, accent, "\u007e", "\\tilde");
defineSymbol(math, main, accent, "\u02c9", "\\bar");
defineSymbol(math, main, accent, "\u02d8", "\\breve");
defineSymbol(math, main, accent, "\u02c7", "\\check");
defineSymbol(math, main, accent, "\u005e", "\\hat");
defineSymbol(math, main, accent, "\u20d7", "\\vec");
defineSymbol(math, main, accent, "\u02d9", "\\dot");
defineSymbol(math, main, accent, "\u02da", "\\mathring");
// \imath and \jmath should be invariant to \mathrm, \mathbf, etc., so use PUA
defineSymbol(math, main, mathord, "\ue131", "\\@imath");
defineSymbol(math, main, mathord, "\ue237", "\\@jmath");
defineSymbol(math, main, textord, "\u0131", "\u0131");
defineSymbol(math, main, textord, "\u0237", "\u0237");
defineSymbol(symbols_text, main, textord, "\u0131", "\\i", true);
defineSymbol(symbols_text, main, textord, "\u0237", "\\j", true);
defineSymbol(symbols_text, main, textord, "\u00df", "\\ss", true);
defineSymbol(symbols_text, main, textord, "\u00e6", "\\ae", true);
defineSymbol(symbols_text, main, textord, "\u0153", "\\oe", true);
defineSymbol(symbols_text, main, textord, "\u00f8", "\\o", true);
defineSymbol(symbols_text, main, textord, "\u00c6", "\\AE", true);
defineSymbol(symbols_text, main, textord, "\u0152", "\\OE", true);
defineSymbol(symbols_text, main, textord, "\u00d8", "\\O", true);
defineSymbol(symbols_text, main, accent, "\u02ca", "\\'"); // acute
defineSymbol(symbols_text, main, accent, "\u02cb", "\\`"); // grave
defineSymbol(symbols_text, main, accent, "\u02c6", "\\^"); // circumflex
defineSymbol(symbols_text, main, accent, "\u02dc", "\\~"); // tilde
defineSymbol(symbols_text, main, accent, "\u02c9", "\\="); // macron
defineSymbol(symbols_text, main, accent, "\u02d8", "\\u"); // breve
defineSymbol(symbols_text, main, accent, "\u02d9", "\\."); // dot above
defineSymbol(symbols_text, main, accent, "\u00b8", "\\c"); // cedilla
defineSymbol(symbols_text, main, accent, "\u02da", "\\r"); // ring above
defineSymbol(symbols_text, main, accent, "\u02c7", "\\v"); // caron
defineSymbol(symbols_text, main, accent, "\u00a8", '\\"'); // diaeresis
defineSymbol(symbols_text, main, accent, "\u02dd", "\\H"); // double acute
defineSymbol(symbols_text, main, accent, "\u25ef", "\\textcircled"); // \bigcirc glyph

// These ligatures are detected and created in Parser.js's `formLigatures`.
const ligatures = {
  "--": true,
  "---": true,
  "``": true,
  "''": true
};
defineSymbol(symbols_text, main, textord, "\u2013", "--", true);
defineSymbol(symbols_text, main, textord, "\u2013", "\\textendash");
defineSymbol(symbols_text, main, textord, "\u2014", "---", true);
defineSymbol(symbols_text, main, textord, "\u2014", "\\textemdash");
defineSymbol(symbols_text, main, textord, "\u2018", "`", true);
defineSymbol(symbols_text, main, textord, "\u2018", "\\textquoteleft");
defineSymbol(symbols_text, main, textord, "\u2019", "'", true);
defineSymbol(symbols_text, main, textord, "\u2019", "\\textquoteright");
defineSymbol(symbols_text, main, textord, "\u201c", "``", true);
defineSymbol(symbols_text, main, textord, "\u201c", "\\textquotedblleft");
defineSymbol(symbols_text, main, textord, "\u201d", "''", true);
defineSymbol(symbols_text, main, textord, "\u201d", "\\textquotedblright");
//  \degree from gensymb package
defineSymbol(math, main, textord, "\u00b0", "\\degree", true);
defineSymbol(symbols_text, main, textord, "\u00b0", "\\degree");
// \textdegree from inputenc package
defineSymbol(symbols_text, main, textord, "\u00b0", "\\textdegree", true);
// TODO: In LaTeX, \pounds can generate a different character in text and math
// mode, but among our fonts, only Main-Regular defines this character "163".
defineSymbol(math, main, textord, "\u00a3", "\\pounds");
defineSymbol(math, main, textord, "\u00a3", "\\mathsterling", true);
defineSymbol(symbols_text, main, textord, "\u00a3", "\\pounds");
defineSymbol(symbols_text, main, textord, "\u00a3", "\\textsterling", true);
defineSymbol(math, ams, textord, "\u2720", "\\maltese");
defineSymbol(symbols_text, ams, textord, "\u2720", "\\maltese");

// There are lots of symbols which are the same, so we add them in afterwards.
// All of these are textords in math mode
const mathTextSymbols = "0123456789/@.\"";
for (let i = 0; i < mathTextSymbols.length; i++) {
  const ch = mathTextSymbols.charAt(i);
  defineSymbol(math, main, textord, ch, ch);
}

// All of these are textords in text mode
const textSymbols = "0123456789!@*()-=+\";:?/.,";
for (let i = 0; i < textSymbols.length; i++) {
  const ch = textSymbols.charAt(i);
  defineSymbol(symbols_text, main, textord, ch, ch);
}

// All of these are textords in text mode, and mathords in math mode
const letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
for (let i = 0; i < letters.length; i++) {
  const ch = letters.charAt(i);
  defineSymbol(math, main, mathord, ch, ch);
  defineSymbol(symbols_text, main, textord, ch, ch);
}

// Blackboard bold and script letters in Unicode range
defineSymbol(math, ams, textord, "C", "\u2102"); // blackboard bold
defineSymbol(symbols_text, ams, textord, "C", "\u2102");
defineSymbol(math, ams, textord, "H", "\u210D");
defineSymbol(symbols_text, ams, textord, "H", "\u210D");
defineSymbol(math, ams, textord, "N", "\u2115");
defineSymbol(symbols_text, ams, textord, "N", "\u2115");
defineSymbol(math, ams, textord, "P", "\u2119");
defineSymbol(symbols_text, ams, textord, "P", "\u2119");
defineSymbol(math, ams, textord, "Q", "\u211A");
defineSymbol(symbols_text, ams, textord, "Q", "\u211A");
defineSymbol(math, ams, textord, "R", "\u211D");
defineSymbol(symbols_text, ams, textord, "R", "\u211D");
defineSymbol(math, ams, textord, "Z", "\u2124");
defineSymbol(symbols_text, ams, textord, "Z", "\u2124");
defineSymbol(math, main, mathord, "h", "\u210E"); // italic h, Planck constant
defineSymbol(symbols_text, main, mathord, "h", "\u210E");

// The next loop loads wide (surrogate pair) characters.
// We support some letters in the Unicode range U+1D400 to U+1D7FF,
// Mathematical Alphanumeric Symbols.
// Some editors do not deal well with wide characters. So don't write the
// string into this file. Instead, create the string from the surrogate pair.
let wideChar;
for (let i = 0; i < letters.length; i++) {
  const ch = letters.charAt(i);

  // The hex numbers in the next line are a surrogate pair.
  // 0xD835 is the high surrogate for all letters in the range we support.
  // 0xDC00 is the low surrogate for bold A.
  wideChar = String.fromCharCode(0xD835, 0xDC00 + i); // A-Z a-z bold
  defineSymbol(math, main, mathord, ch, wideChar);
  defineSymbol(symbols_text, main, textord, ch, wideChar);
  wideChar = String.fromCharCode(0xD835, 0xDC34 + i); // A-Z a-z italic
  defineSymbol(math, main, mathord, ch, wideChar);
  defineSymbol(symbols_text, main, textord, ch, wideChar);
  wideChar = String.fromCharCode(0xD835, 0xDC68 + i); // A-Z a-z bold italic
  defineSymbol(math, main, mathord, ch, wideChar);
  defineSymbol(symbols_text, main, textord, ch, wideChar);
  wideChar = String.fromCharCode(0xD835, 0xDD04 + i); // A-Z a-z Fraktur
  defineSymbol(math, main, mathord, ch, wideChar);
  defineSymbol(symbols_text, main, textord, ch, wideChar);
  wideChar = String.fromCharCode(0xD835, 0xDD6C + i); // A-Z a-z bold Fraktur
  defineSymbol(math, main, mathord, ch, wideChar);
  defineSymbol(symbols_text, main, textord, ch, wideChar);
  wideChar = String.fromCharCode(0xD835, 0xDDA0 + i); // A-Z a-z sans-serif
  defineSymbol(math, main, mathord, ch, wideChar);
  defineSymbol(symbols_text, main, textord, ch, wideChar);
  wideChar = String.fromCharCode(0xD835, 0xDDD4 + i); // A-Z a-z sans bold
  defineSymbol(math, main, mathord, ch, wideChar);
  defineSymbol(symbols_text, main, textord, ch, wideChar);
  wideChar = String.fromCharCode(0xD835, 0xDE08 + i); // A-Z a-z sans italic
  defineSymbol(math, main, mathord, ch, wideChar);
  defineSymbol(symbols_text, main, textord, ch, wideChar);
  wideChar = String.fromCharCode(0xD835, 0xDE70 + i); // A-Z a-z monospace
  defineSymbol(math, main, mathord, ch, wideChar);
  defineSymbol(symbols_text, main, textord, ch, wideChar);
  if (i < 26) {
    // KaTeX fonts have only capital letters for blackboard bold and script.
    // See exception for k below.
    wideChar = String.fromCharCode(0xD835, 0xDD38 + i); // A-Z double struck
    defineSymbol(math, main, mathord, ch, wideChar);
    defineSymbol(symbols_text, main, textord, ch, wideChar);
    wideChar = String.fromCharCode(0xD835, 0xDC9C + i); // A-Z script
    defineSymbol(math, main, mathord, ch, wideChar);
    defineSymbol(symbols_text, main, textord, ch, wideChar);
  }

  // TODO: Add bold script when it is supported by a KaTeX font.
}
// "k" is the only double struck lower case letter in the KaTeX fonts.
wideChar = String.fromCharCode(0xD835, 0xDD5C); // k double struck
defineSymbol(math, main, mathord, "k", wideChar);
defineSymbol(symbols_text, main, textord, "k", wideChar);

// Next, some wide character numerals
for (let i = 0; i < 10; i++) {
  const ch = i.toString();
  wideChar = String.fromCharCode(0xD835, 0xDFCE + i); // 0-9 bold
  defineSymbol(math, main, mathord, ch, wideChar);
  defineSymbol(symbols_text, main, textord, ch, wideChar);
  wideChar = String.fromCharCode(0xD835, 0xDFE2 + i); // 0-9 sans serif
  defineSymbol(math, main, mathord, ch, wideChar);
  defineSymbol(symbols_text, main, textord, ch, wideChar);
  wideChar = String.fromCharCode(0xD835, 0xDFEC + i); // 0-9 bold sans
  defineSymbol(math, main, mathord, ch, wideChar);
  defineSymbol(symbols_text, main, textord, ch, wideChar);
  wideChar = String.fromCharCode(0xD835, 0xDFF6 + i); // 0-9 monospace
  defineSymbol(math, main, mathord, ch, wideChar);
  defineSymbol(symbols_text, main, textord, ch, wideChar);
}

// We add these Latin-1 letters as symbols for backwards-compatibility,
// but they are not actually in the font, nor are they supported by the
// Unicode accent mechanism, so they fall back to Times font and look ugly.
// TODO(edemaine): Fix this.
const extraLatin = "\u00d0\u00de\u00fe";
for (let i = 0; i < extraLatin.length; i++) {
  const ch = extraLatin.charAt(i);
  defineSymbol(math, main, mathord, ch, ch);
  defineSymbol(symbols_text, main, textord, ch, ch);
}
;// ./src/wide-character.ts
/**
 * This file provides support for Unicode range U+1D400 to U+1D7FF,
 * Mathematical Alphanumeric Symbols.
 *
 * Function wideCharacterFont takes a wide character as input and returns
 * the font information necessary to render it properly.
 */


const boldUpright = {
  mathClass: "mathbf",
  textClass: "textbf",
  font: "Main-Bold"
};
const italic = {
  mathClass: "mathnormal",
  textClass: "textit",
  font: "Math-Italic"
};
const boldItalic = {
  mathClass: "boldsymbol",
  textClass: "boldsymbol",
  font: "Main-BoldItalic"
};
const script = {
  mathClass: "mathscr",
  textClass: "textscr",
  font: "Script-Regular"
};
const noFont = {
  mathClass: "",
  textClass: "",
  font: ""
};
const fraktur = {
  mathClass: "mathfrak",
  textClass: "textfrak",
  font: "Fraktur-Regular"
};
const doubleStruck = {
  mathClass: "mathbb",
  textClass: "textbb",
  font: "AMS-Regular"
};
const boldFraktur = {
  mathClass: "mathboldfrak",
  textClass: "textboldfrak",
  font: "Fraktur-Regular"
};
const sansSerif = {
  mathClass: "mathsf",
  textClass: "textsf",
  font: "SansSerif-Regular"
};
const boldSansSerif = {
  mathClass: "mathboldsf",
  textClass: "textboldsf",
  font: "SansSerif-Bold"
};
const italicSansSerif = {
  mathClass: "mathitsf",
  textClass: "textitsf",
  font: "SansSerif-Italic"
};
const monospace = {
  mathClass: "mathtt",
  textClass: "texttt",
  font: "Typewriter-Regular"
};

/**
 * Data below is from https://www.unicode.org/charts/PDF/U1D400.pdf
 * That document sorts characters into groups by font type, say bold or italic.
 *
 * In the arrays below, each object consists of three properties:
 *      * The CSS class of that group when in math mode.
 *      * The CSS class of that group when in text mode.
 *      * The font name, so that KaTeX can get font metrics.
 */

const wideLatinLetterData = [boldUpright, boldUpright,
// A-Z, a-z
italic, italic,
// A-Z, a-z
boldItalic, boldItalic,
// A-Z, a-z
// Map fancy A-Z letters to script, not calligraphic.
// This aligns with unicode-math and math fonts (except Cambria Math).
script, noFont,
// A-Z script, a-z — no font
noFont, noFont,
// A-Z bold script, a-z bold script — no font
fraktur, fraktur,
// A-Z, a-z
doubleStruck, doubleStruck,
// A-Z double-struck, k double-struck
// Note that we are using a bold font, but font metrics for regular Fraktur.
boldFraktur, boldFraktur,
// A-Z, a-z
sansSerif, sansSerif,
// A-Z, a-z
boldSansSerif, boldSansSerif,
// A-Z, a-z
italicSansSerif, italicSansSerif,
// A-Z, a-z
noFont, noFont,
// A-Z bold italic sans, a-z bold italic sans - no font
monospace, monospace // A-Z, a-z
];
const wideNumeralData = [boldUpright,
// 0-9
noFont,
// 0-9 double-struck. No KaTeX font.
sansSerif,
// 0-9
boldSansSerif,
// 0-9
monospace // 0-9
];
const wideCharacterFont = wideChar => {
  // IE doesn't support codePointAt(). So work with the surrogate pair.
  const H = wideChar.charCodeAt(0); // high surrogate
  const L = wideChar.charCodeAt(1); // low surrogate
  const codePoint = (H - 0xD800) * 0x400 + (L - 0xDC00) + 0x10000;
  if (0x1D400 <= codePoint && codePoint < 0x1D6A4) {
    // wideLatinLetterData contains exactly 26 chars on each row.
    // So we can calculate the relevant row. No traverse necessary.
    const i = Math.floor((codePoint - 0x1D400) / 26);
    return wideLatinLetterData[i];
  } else if (0x1D7CE <= codePoint && codePoint <= 0x1D7FF) {
    // Numerals, ten per row.
    const i = Math.floor((codePoint - 0x1D7CE) / 10);
    return wideNumeralData[i];
  } else if (codePoint === 0x1D6A5 || codePoint === 0x1D6A6) {
    // dotless i or j
    return wideLatinLetterData[0];
  } else if (0x1D6A6 < codePoint && codePoint < 0x1D7CE) {
    // Greek letters. Not supported, yet.
    return noFont;
  } else {
    // We don't support any wide characters outside 1D400–1D7FF.
    throw new src_ParseError("Unsupported character: " + wideChar);
  }
};
;// ./src/buildCommon.ts
/* eslint no-console:0 */
/**
 * This module contains general functions that can be used for building
 * different kinds of domTree nodes in a consistent manner.
 */







/**
 * Looks up the given symbol in fontMetrics, after applying any symbol
 * replacements defined in symbol.js
 */
const lookupSymbol = function (value, fontName, mode) {
  // Replace the value with its replaced value from symbol.js
  if (src_symbols[mode][value]) {
    const replacement = src_symbols[mode][value].replace;
    if (replacement) {
      value = replacement;
    }
  }
  return {
    value,
    metrics: getCharacterMetrics(value, fontName, mode)
  };
};

/**
 * Makes a symbolNode after translation via the list of symbols in symbols.js.
 * Correctly pulls out metrics for the character, and optionally takes a list of
 * classes to be attached to the node.
 *
 * TODO: make argument order closer to makeSpan
 * TODO: add a separate argument for math class (e.g. `mop`, `mbin`), which
 * should if present come first in `classes`.
 * TODO(#953): Make `options` mandatory and always pass it in.
 */
const makeSymbol = function (value, fontName, mode, options, classes) {
  const lookup = lookupSymbol(value, fontName, mode);
  const metrics = lookup.metrics;
  value = lookup.value;
  let symbolNode;
  if (metrics) {
    let italic = metrics.italic;
    if (mode === "text" || options && options.font === "mathit") {
      italic = 0;
    }
    symbolNode = new SymbolNode(value, metrics.height, metrics.depth, italic, metrics.skew, metrics.width, classes);
  } else {
    // TODO(emily): Figure out a good way to only print this in development
    typeof console !== "undefined" && console.warn("No character metrics " + ("for '" + value + "' in style '" + fontName + "' and mode '" + mode + "'"));
    symbolNode = new SymbolNode(value, 0, 0, 0, 0, 0, classes);
  }
  if (options) {
    symbolNode.maxFontSize = options.sizeMultiplier;
    if (options.style.isTight()) {
      symbolNode.classes.push("mtight");
    }
    const color = options.getColor();
    if (color) {
      symbolNode.style.color = color;
    }
  }
  return symbolNode;
};

/**
 * Makes a symbol in Main-Regular or AMS-Regular.
 * Used for rel, bin, open, close, inner, and punct.
 */
const mathsym = function (value, mode, options, classes) {
  if (classes === void 0) {
    classes = [];
  }
  // Decide what font to render the symbol in by its entry in the symbols
  // table.
  // Have a special case for when the value = \ because the \ is used as a
  // textord in unsupported command errors but cannot be parsed as a regular
  // text ordinal and is therefore not present as a symbol in the symbols
  // table for text, as well as a special case for boldsymbol because it
  // can be used for bold + and -
  if (options.font === "boldsymbol" && lookupSymbol(value, "Main-Bold", mode).metrics) {
    return makeSymbol(value, "Main-Bold", mode, options, classes.concat(["mathbf"]));
  } else if (value === "\\" || src_symbols[mode][value].font === "main") {
    return makeSymbol(value, "Main-Regular", mode, options, classes);
  } else {
    return makeSymbol(value, "AMS-Regular", mode, options, classes.concat(["amsrm"]));
  }
};

/**
 * Determines which of the two font names (Main-Bold and Math-BoldItalic) and
 * corresponding style tags (mathbf or boldsymbol) to use for font "boldsymbol",
 * depending on the symbol.  Use this function instead of fontMap for font
 * "boldsymbol".
 */
const boldSymbol = function (value, mode, type) {
  if (type !== "textord" && lookupSymbol(value, "Math-BoldItalic", mode).metrics) {
    return {
      fontName: "Math-BoldItalic",
      fontClass: "boldsymbol"
    };
  } else {
    // Some glyphs do not exist in Math-BoldItalic so we need to use
    // Main-Bold instead.
    return {
      fontName: "Main-Bold",
      fontClass: "mathbf"
    };
  }
};

/**
 * Makes either a mathord or textord in the correct font and color.
 */
const makeOrd = function (group, options, type) {
  const mode = group.mode;
  const text = group.text;
  const classes = ["mord"];
  const {
    font,
    fontFamily,
    fontWeight,
    fontShape
  } = options;

  // Math mode or Old font (i.e. \rm)
  const useFont = mode === "math" || mode === "text" && !!font;
  const fontOrFamily = useFont ? font : fontFamily;
  let wideFontName = "";
  let wideFontClass = "";
  if (text.charCodeAt(0) === 0xD835) {
    const wideCharData = wideCharacterFont(text);
    wideFontName = wideCharData.font;
    wideFontClass = wideCharData[mode + "Class"];
  }
  if (wideFontName) {
    // surrogate pairs get special treatment
    return makeSymbol(text, wideFontName, mode, options, classes.concat(wideFontClass));
  } else if (fontOrFamily) {
    let fontName;
    let fontClasses;
    if (fontOrFamily === "boldsymbol") {
      const fontData = boldSymbol(text, mode, type);
      fontName = fontData.fontName;
      fontClasses = [fontData.fontClass];
    } else if (useFont) {
      fontName = fontMap[font].fontName;
      fontClasses = [font];
    } else {
      fontName = retrieveTextFontName(fontFamily, fontWeight, fontShape);
      fontClasses = [fontFamily, fontWeight, fontShape];
    }
    if (lookupSymbol(text, fontName, mode).metrics) {
      return makeSymbol(text, fontName, mode, options, classes.concat(fontClasses));
    } else if (ligatures.hasOwnProperty(text) && fontName.slice(0, 10) === "Typewriter") {
      // Deconstruct ligatures in monospace fonts (\texttt, \tt).
      const parts = [];
      for (let i = 0; i < text.length; i++) {
        parts.push(makeSymbol(text[i], fontName, mode, options, classes.concat(fontClasses)));
      }
      return makeFragment(parts);
    }
  }

  // Makes a symbol in the default font for mathords and textords.
  if (type === "mathord") {
    return makeSymbol(text, "Math-Italic", mode, options, classes.concat(["mathnormal"]));
  } else if (type === "textord") {
    const font = src_symbols[mode][text] && src_symbols[mode][text].font;
    if (font === "ams") {
      const fontName = retrieveTextFontName("amsrm", fontWeight, fontShape);
      return makeSymbol(text, fontName, mode, options, classes.concat("amsrm", fontWeight, fontShape));
    } else if (font === "main" || !font) {
      const fontName = retrieveTextFontName("textrm", fontWeight, fontShape);
      return makeSymbol(text, fontName, mode, options, classes.concat(fontWeight, fontShape));
    } else {
      // fonts added by plugins
      const fontName = retrieveTextFontName(font, fontWeight, fontShape);
      // We add font name as a css class
      return makeSymbol(text, fontName, mode, options, classes.concat(fontName, fontWeight, fontShape));
    }
  } else {
    throw new Error("unexpected type: " + type + " in makeOrd");
  }
};

/**
 * Returns true if subsequent symbolNodes have the same classes, skew, maxFont,
 * and styles. For mathnormal text, the left node must also have zero italic
 * correction so we don't lose spacing between combined glyphs.
 */
const canCombine = (prev, next) => {
  if (createClass(prev.classes) !== createClass(next.classes) || prev.skew !== next.skew || prev.maxFontSize !== next.maxFontSize || prev.italic !== 0 && prev.hasClass("mathnormal")) {
    return false;
  }

  // If prev and next both are just "mbin"s or "mord"s we don't combine them
  // so that the proper spacing can be preserved.
  if (prev.classes.length === 1) {
    const cls = prev.classes[0];
    if (cls === "mbin" || cls === "mord") {
      return false;
    }
  }
  for (const key of Object.keys(prev.style)) {
    if (prev.style[key] !== next.style[key]) {
      return false;
    }
  }
  for (const key of Object.keys(next.style)) {
    if (prev.style[key] !== next.style[key]) {
      return false;
    }
  }
  return true;
};

/**
 * Combine consecutive domTree.symbolNodes into a single symbolNode.
 * Note: this function mutates the argument.
 */
const tryCombineChars = chars => {
  for (let i = 0; i < chars.length - 1; i++) {
    const prev = chars[i];
    const next = chars[i + 1];
    if (prev instanceof SymbolNode && next instanceof SymbolNode && canCombine(prev, next)) {
      prev.text += next.text;
      prev.height = Math.max(prev.height, next.height);
      prev.depth = Math.max(prev.depth, next.depth);
      // Use the last character's italic correction since we use
      // it to add padding to the right of the span created from
      // the combined characters.
      prev.italic = next.italic;
      chars.splice(i + 1, 1);
      i--;
    }
  }
  return chars;
};

/**
 * Calculate the height, depth, and maxFontSize of an element based on its
 * children.
 */
const sizeElementFromChildren = function (elem) {
  let height = 0;
  let depth = 0;
  let maxFontSize = 0;
  for (let i = 0; i < elem.children.length; i++) {
    const child = elem.children[i];
    if (child.height > height) {
      height = child.height;
    }
    if (child.depth > depth) {
      depth = child.depth;
    }
    if (child.maxFontSize > maxFontSize) {
      maxFontSize = child.maxFontSize;
    }
  }
  elem.height = height;
  elem.depth = depth;
  elem.maxFontSize = maxFontSize;
};

/**
 * Makes a span with the given list of classes, list of children, and options.
 *
 * TODO(#953): Ensure that `options` is always provided (currently some call
 * sites don't pass it) and make the type below mandatory.
 * TODO: add a separate argument for math class (e.g. `mop`, `mbin`), which
 * should if present come first in `classes`.
 */
const makeSpan = function (classes, children, options, style) {
  const span = new Span(classes, children, options, style);
  sizeElementFromChildren(span);
  return span;
};

// SVG one is simpler -- doesn't require height, depth, max-font setting.
// This is also a separate method for typesafety.
const makeSvgSpan = (classes, children, options, style) => new Span(classes, children, options, style);
const makeLineSpan = function (className, options, thickness) {
  const line = makeSpan([className], [], options);
  line.height = Math.max(thickness || options.fontMetrics().defaultRuleThickness, options.minRuleThickness);
  line.style.borderBottomWidth = makeEm(line.height);
  line.maxFontSize = 1.0;
  return line;
};

/**
 * Makes an anchor with the given href, list of classes, list of children,
 * and options.
 */
const makeAnchor = function (href, classes, children, options) {
  const anchor = new Anchor(href, classes, children, options);
  sizeElementFromChildren(anchor);
  return anchor;
};

/**
 * Makes a document fragment with the given list of children.
 */
const makeFragment = function (children) {
  const fragment = new DocumentFragment(children);
  sizeElementFromChildren(fragment);
  return fragment;
};

/**
 * Wraps group in a span if it's a document fragment, allowing to apply classes
 * and styles
 */
const wrapFragment = function (group, options) {
  if (group instanceof DocumentFragment) {
    return makeSpan([], [group], options);
  }
  return group;
};

// A list of child or kern nodes to be stacked on top of each other (i.e. the
// first element will be at the bottom, and the last at the top).

// Computes the updated `children` list and the overall depth.
//
// This helper function for makeVList makes it easier to enforce type safety by
// allowing early exits (returns) in the logic.
const getVListChildrenAndDepth = function (params) {
  if (params.positionType === "individualShift") {
    const oldChildren = params.children;
    const children = [oldChildren[0]];

    // Add in kerns to the list of params.children to get each element to be
    // shifted to the correct specified shift
    const depth = -oldChildren[0].shift - oldChildren[0].elem.depth;
    let currPos = depth;
    for (let i = 1; i < oldChildren.length; i++) {
      const diff = -oldChildren[i].shift - currPos - oldChildren[i].elem.depth;
      const size = diff - (oldChildren[i - 1].elem.height + oldChildren[i - 1].elem.depth);
      currPos = currPos + diff;
      children.push({
        type: "kern",
        size
      });
      children.push(oldChildren[i]);
    }
    return {
      children,
      depth
    };
  }
  let depth;
  if (params.positionType === "top") {
    // We always start at the bottom, so calculate the bottom by adding up
    // all the sizes
    let bottom = params.positionData;
    for (let i = 0; i < params.children.length; i++) {
      const child = params.children[i];
      bottom -= child.type === "kern" ? child.size : child.elem.height + child.elem.depth;
    }
    depth = bottom;
  } else if (params.positionType === "bottom") {
    depth = -params.positionData;
  } else {
    const firstChild = params.children[0];
    if (firstChild.type !== "elem") {
      throw new Error('First child must have type "elem".');
    }
    if (params.positionType === "shift") {
      depth = -firstChild.elem.depth - params.positionData;
    } else if (params.positionType === "firstBaseline") {
      depth = -firstChild.elem.depth;
    } else {
      throw new Error("Invalid positionType " + params.positionType + ".");
    }
  }
  return {
    children: params.children,
    depth
  };
};

/**
 * Makes a vertical list by stacking elements and kerns on top of each other.
 * Allows for many different ways of specifying the positioning method.
 *
 * See VListParam documentation above.
 */
const makeVList = function (params, options) {
  const {
    children,
    depth
  } = getVListChildrenAndDepth(params);

  // Create a strut that is taller than any list item. The strut is added to
  // each item, where it will determine the item's baseline. Since it has
  // `overflow:hidden`, the strut's top edge will sit on the item's line box's
  // top edge and the strut's bottom edge will sit on the item's baseline,
  // with no additional line-height spacing. This allows the item baseline to
  // be positioned precisely without worrying about font ascent and
  // line-height.
  let pstrutSize = 0;
  for (let i = 0; i < children.length; i++) {
    const child = children[i];
    if (child.type === "elem") {
      const elem = child.elem;
      pstrutSize = Math.max(pstrutSize, elem.maxFontSize, elem.height);
    }
  }
  pstrutSize += 2;
  const pstrut = makeSpan(["pstrut"], []);
  pstrut.style.height = makeEm(pstrutSize);

  // Create a new list of actual children at the correct offsets
  const realChildren = [];
  let minPos = depth;
  let maxPos = depth;
  let currPos = depth;
  for (let i = 0; i < children.length; i++) {
    const child = children[i];
    if (child.type === "kern") {
      currPos += child.size;
    } else {
      const elem = child.elem;
      const classes = child.wrapperClasses || [];
      const style = child.wrapperStyle || {};
      const childWrap = makeSpan(classes, [pstrut, elem], undefined, style);
      childWrap.style.top = makeEm(-pstrutSize - currPos - elem.depth);
      if (child.marginLeft) {
        childWrap.style.marginLeft = child.marginLeft;
      }
      if (child.marginRight) {
        childWrap.style.marginRight = child.marginRight;
      }
      realChildren.push(childWrap);
      currPos += elem.height + elem.depth;
    }
    minPos = Math.min(minPos, currPos);
    maxPos = Math.max(maxPos, currPos);
  }

  // The vlist contents go in a table-cell with `vertical-align:bottom`.
  // This cell's bottom edge will determine the containing table's baseline
  // without overly expanding the containing line-box.
  const vlist = makeSpan(["vlist"], realChildren);
  vlist.style.height = makeEm(maxPos);

  // A second row is used if necessary to represent the vlist's depth.
  let rows;
  if (minPos < 0) {
    // We will define depth in an empty span with display: table-cell.
    // It should render with the height that we define. But Chrome, in
    // contenteditable mode only, treats that span as if it contains some
    // text content. And that min-height over-rides our desired height.
    // So we put another empty span inside the depth strut span.
    const emptySpan = makeSpan([], []);
    const depthStrut = makeSpan(["vlist"], [emptySpan]);
    depthStrut.style.height = makeEm(-minPos);

    // Safari wants the first row to have inline content; otherwise it
    // puts the bottom of the *second* row on the baseline.
    const topStrut = makeSpan(["vlist-s"], [new SymbolNode("\u200b")]);
    rows = [makeSpan(["vlist-r"], [vlist, topStrut]), makeSpan(["vlist-r"], [depthStrut])];
  } else {
    rows = [makeSpan(["vlist-r"], [vlist])];
  }
  const vtable = makeSpan(["vlist-t"], rows);
  if (rows.length === 2) {
    vtable.classes.push("vlist-t2");
  }
  vtable.height = maxPos;
  vtable.depth = -minPos;
  return vtable;
};

// Glue is a concept from TeX which is a flexible space between elements in
// either a vertical or horizontal list. In KaTeX, at least for now, it's
// static space between elements in a horizontal layout.
const makeGlue = (measurement, options) => {
  // Make an empty span for the space
  const rule = makeSpan(["mspace"], [], options);
  const size = calculateSize(measurement, options);
  rule.style.marginRight = makeEm(size);
  return rule;
};

// Takes font options, and returns the appropriate fontLookup name
const retrieveTextFontName = (fontFamily, fontWeight, fontShape) => {
  let baseFontName;
  let fontStylesName;
  switch (fontFamily) {
    case "amsrm":
      baseFontName = "AMS";
      break;
    case "textrm":
      baseFontName = "Main";
      break;
    case "textsf":
      baseFontName = "SansSerif";
      break;
    case "texttt":
      baseFontName = "Typewriter";
      break;
    default:
      baseFontName = fontFamily;
    // use fonts added by a plugin
  }
  if (fontWeight === "textbf" && fontShape === "textit") {
    fontStylesName = "BoldItalic";
  } else if (fontWeight === "textbf") {
    fontStylesName = "Bold";
  } else if (fontShape === "textit") {
    fontStylesName = "Italic";
  } else {
    fontStylesName = "Regular";
  }
  return baseFontName + "-" + fontStylesName;
};

/**
 * Maps TeX font commands to objects containing:
 * - variant: string used for "mathvariant" attribute in buildMathML.js
 * - fontName: the "style" parameter to fontMetrics.getCharacterMetrics
 */
// A map between tex font commands an MathML mathvariant attribute values
const fontMap = {
  // styles
  "mathbf": {
    variant: "bold",
    fontName: "Main-Bold"
  },
  "mathrm": {
    variant: "normal",
    fontName: "Main-Regular"
  },
  "textit": {
    variant: "italic",
    fontName: "Main-Italic"
  },
  "mathit": {
    variant: "italic",
    fontName: "Main-Italic"
  },
  "mathnormal": {
    variant: "italic",
    fontName: "Math-Italic"
  },
  "mathsfit": {
    variant: "sans-serif-italic",
    fontName: "SansSerif-Italic"
  },
  // "boldsymbol" is missing because they require the use of multiple fonts:
  // Math-BoldItalic and Main-Bold.  This is handled by a special case in
  // makeOrd which ends up calling boldsymbol.

  // families
  "mathbb": {
    variant: "double-struck",
    fontName: "AMS-Regular"
  },
  "mathcal": {
    variant: "script",
    fontName: "Caligraphic-Regular"
  },
  "mathfrak": {
    variant: "fraktur",
    fontName: "Fraktur-Regular"
  },
  "mathscr": {
    variant: "script",
    fontName: "Script-Regular"
  },
  "mathsf": {
    variant: "sans-serif",
    fontName: "SansSerif-Regular"
  },
  "mathtt": {
    variant: "monospace",
    fontName: "Typewriter-Regular"
  }
};
const svgData = {
  //   path, width, height
  vec: ["vec", 0.471, 0.714],
  // values from the font glyph
  oiintSize1: ["oiintSize1", 0.957, 0.499],
  // oval to overlay the integrand
  oiintSize2: ["oiintSize2", 1.472, 0.659],
  oiiintSize1: ["oiiintSize1", 1.304, 0.499],
  oiiintSize2: ["oiiintSize2", 1.98, 0.659]
};
const staticSvg = function (value, options) {
  // Create a span with inline SVG for the element.
  const [pathName, width, height] = svgData[value];
  const path = new PathNode(pathName);
  const svgNode = new SvgNode([path], {
    "width": makeEm(width),
    "height": makeEm(height),
    // Override CSS rule `.katex svg { width: 100% }`
    "style": "width:" + makeEm(width),
    "viewBox": "0 0 " + 1000 * width + " " + 1000 * height,
    "preserveAspectRatio": "xMinYMin"
  });
  const span = makeSvgSpan(["overlay"], [svgNode], options);
  span.height = height;
  span.style.height = makeEm(height);
  span.style.width = makeEm(width);
  return span;
};
;// ./src/spacingData.ts
/**
 * Describes spaces between different classes of atoms.
 */

const thinspace = {
  number: 3,
  unit: "mu"
};
const mediumspace = {
  number: 4,
  unit: "mu"
};
const thickspace = {
  number: 5,
  unit: "mu"
};

// Making the type below exact with all optional fields doesn't work due to
// - https://github.com/facebook/flow/issues/4582
// - https://github.com/facebook/flow/issues/5688
// However, since *all* fields are optional, $Shape<> works as suggested in 5688
// above.

// Spacing relationships for display and text styles
const spacings = {
  mord: {
    mop: thinspace,
    mbin: mediumspace,
    mrel: thickspace,
    minner: thinspace
  },
  mop: {
    mord: thinspace,
    mop: thinspace,
    mrel: thickspace,
    minner: thinspace
  },
  mbin: {
    mord: mediumspace,
    mop: mediumspace,
    mopen: mediumspace,
    minner: mediumspace
  },
  mrel: {
    mord: thickspace,
    mop: thickspace,
    mopen: thickspace,
    minner: thickspace
  },
  mopen: {},
  mclose: {
    mop: thinspace,
    mbin: mediumspace,
    mrel: thickspace,
    minner: thinspace
  },
  mpunct: {
    mord: thinspace,
    mop: thinspace,
    mrel: thickspace,
    mopen: thinspace,
    mclose: thinspace,
    mpunct: thinspace,
    minner: thinspace
  },
  minner: {
    mord: thinspace,
    mop: thinspace,
    mbin: mediumspace,
    mrel: thickspace,
    mopen: thinspace,
    mpunct: thinspace,
    minner: thinspace
  }
};

// Spacing relationships for script and scriptscript styles
const tightSpacings = {
  mord: {
    mop: thinspace
  },
  mop: {
    mord: thinspace,
    mop: thinspace
  },
  mbin: {},
  mrel: {},
  mopen: {},
  mclose: {
    mop: thinspace
  },
  mpunct: {},
  minner: {
    mop: thinspace
  }
};
;// ./src/defineFunction.ts
/** Context provided to function handlers for error messages. */

// Note: reverse the order of the return type union will cause a flow error.
// See https://github.com/facebook/flow/issues/3663.

// More general version of `HtmlBuilder` for nodes (e.g. \sum, accent types)
// whose presence impacts super/subscripting. In this case, ParseNode<"supsub">
// delegates its HTML building to the HtmlBuilder corresponding to these nodes.

/**
 * Final function spec for use at parse time.
 * This is almost identical to `FunctionPropSpec`, except it
 * 1. includes the function handler, and
 * 2. requires all arguments except argTypes.
 * It is generated by `defineFunction()` below.
 */

/**
 * All registered functions.
 * `functions.js` just exports this same dictionary again and makes it public.
 * `Parser.js` requires this dictionary.
 */
const _functions = {};

/**
 * All HTML builders. Should be only used in the `define*` and the `build*ML`
 * functions.
 *
 * Builders for different node types are stored side by side, but
 * `HtmlBuilder<T>` is contravariant in `T`, so there is no single type
 * argument that makes storing/retrieving them typecheck.  `any` is used
 * as an existential-quantifier escape hatch.
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const _htmlGroupBuilders = {};

/**
 * All MathML builders. Should be only used in the `define*` and the `build*ML`
 * functions.  See `_htmlGroupBuilders` above for the rationale behind `any`.
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const _mathmlGroupBuilders = {};
function defineFunction(_ref) {
  let {
    type,
    names,
    props,
    handler,
    htmlBuilder,
    mathmlBuilder
  } = _ref;
  // Set default values of functions
  const data = {
    type,
    numArgs: props.numArgs,
    argTypes: props.argTypes,
    allowedInArgument: !!props.allowedInArgument,
    allowedInText: !!props.allowedInText,
    allowedInMath: props.allowedInMath === undefined ? true : props.allowedInMath,
    numOptionalArgs: props.numOptionalArgs || 0,
    infix: !!props.infix,
    primitive: !!props.primitive,
    handler
  };
  for (let i = 0; i < names.length; ++i) {
    _functions[names[i]] = data;
  }
  if (type) {
    if (htmlBuilder) {
      _htmlGroupBuilders[type] = htmlBuilder;
    }
    if (mathmlBuilder) {
      _mathmlGroupBuilders[type] = mathmlBuilder;
    }
  }
}

/**
 * Use this to register only the HTML and MathML builders for a function (e.g.
 * if the function's ParseNode is generated in Parser.js rather than via a
 * stand-alone handler provided to `defineFunction`).
 */
function defineFunctionBuilders(_ref2) {
  let {
    type,
    htmlBuilder,
    mathmlBuilder
  } = _ref2;
  defineFunction({
    type,
    names: [],
    props: {
      numArgs: 0
    },
    handler() {
      throw new Error('Should never be called.');
    },
    htmlBuilder,
    mathmlBuilder
  });
}
const normalizeArgument = function (arg) {
  return arg.type === "ordgroup" && arg.body.length === 1 ? arg.body[0] : arg;
};

// Since the corresponding buildHTML/buildMathML function expects a
// list of elements, we normalize for different kinds of arguments
const ordargument = function (arg) {
  return arg.type === "ordgroup" ? arg.body : [arg];
};
;// ./src/buildHTML.ts
/**
 * This file does the main work of building a domTree structure from a parse
 * tree. The entry point is the `buildHTML` function, which takes a parse tree.
 * Then, the buildExpression, buildGroup, and various groupBuilders functions
 * are called, to produce a final HTML tree.
 */









// Binary atoms (first class `mbin`) change into ordinary atoms (`mord`)
// depending on their surroundings. See TeXbook pg. 442-446, Rules 5 and 6,
// and the text before Rule 19.
const binLeftCanceller = new Set(["leftmost", "mbin", "mopen", "mrel", "mop", "mpunct"]);
const binRightCanceller = new Set(["rightmost", "mrel", "mclose", "mpunct"]);
const styleMap = {
  "display": src_Style.DISPLAY,
  "text": src_Style.TEXT,
  "script": src_Style.SCRIPT,
  "scriptscript": src_Style.SCRIPTSCRIPT
};
const DomEnum = {
  mord: "mord",
  mop: "mop",
  mbin: "mbin",
  mrel: "mrel",
  mopen: "mopen",
  mclose: "mclose",
  mpunct: "mpunct",
  minner: "minner"
};
/**
 * Take a list of nodes, build them in order, and return a list of the built
 * nodes. documentFragments are flattened into their contents, so the
 * returned list contains no fragments. `isRealGroup` is true if `expression`
 * is a real group (no atoms will be added on either side), as opposed to
 * a partial group (e.g. one created by \color). `surrounding` is an array
 * consisting type of nodes that will be added to the left and right.
 */
const buildExpression = function (expression, options, isRealGroup, surrounding) {
  if (surrounding === void 0) {
    surrounding = [null, null];
  }
  // Parse expressions into `groups`.
  const groups = [];
  for (let i = 0; i < expression.length; i++) {
    const output = buildGroup(expression[i], options);
    if (output instanceof DocumentFragment) {
      const children = output.children;
      groups.push(...children);
    } else {
      groups.push(output);
    }
  }

  // Combine consecutive domTree.symbolNodes into a single symbolNode.
  tryCombineChars(groups);

  // If `expression` is a partial group, let the parent handle spacings
  // to avoid processing groups multiple times.
  if (!isRealGroup) {
    return groups;
  }
  let glueOptions = options;
  if (expression.length === 1) {
    const node = expression[0];
    if (node.type === "sizing") {
      glueOptions = options.havingSize(node.size);
    } else if (node.type === "styling") {
      glueOptions = options.havingStyle(styleMap[node.style]);
    }
  }

  // Dummy spans for determining spacings between surrounding atoms.
  // If `expression` has no atoms on the left or right, class "leftmost"
  // or "rightmost", respectively, is used to indicate it.
  const dummyPrev = makeSpan([surrounding[0] || "leftmost"], [], options);
  const dummyNext = makeSpan([surrounding[1] || "rightmost"], [], options);

  // TODO: These code assumes that a node's math class is the first element
  // of its `classes` array. A later cleanup should ensure this, for
  // instance by changing the signature of `makeSpan`.

  // Before determining what spaces to insert, perform bin cancellation.
  // Binary operators change to ordinary symbols in some contexts.
  const isRoot = isRealGroup === "root";
  traverseNonSpaceNodes(groups, (node, prev) => {
    const prevType = prev.classes[0];
    const type = node.classes[0];
    if (prevType === "mbin" && binRightCanceller.has(type)) {
      prev.classes[0] = "mord";
    } else if (type === "mbin" && binLeftCanceller.has(prevType)) {
      node.classes[0] = "mord";
    }
  }, {
    node: dummyPrev
  }, dummyNext, isRoot);
  traverseNonSpaceNodes(groups, (node, prev) => {
    var _tightSpacings$prevTy, _spacings$prevType;
    const prevType = getTypeOfDomTree(prev);
    const type = getTypeOfDomTree(node);

    // 'mtight' indicates that the node is script or scriptscript style.
    const space = prevType && type ? node.hasClass("mtight") ? (_tightSpacings$prevTy = tightSpacings[prevType]) == null ? void 0 : _tightSpacings$prevTy[type] : (_spacings$prevType = spacings[prevType]) == null ? void 0 : _spacings$prevType[type] : null;
    if (space) {
      // Insert glue (spacing) after the `prev`.
      return makeGlue(space, glueOptions);
    }
  }, {
    node: dummyPrev
  }, dummyNext, isRoot);
  return groups;
};

// Depth-first traverse non-space `nodes`, calling `callback` with the current and
// previous node as arguments, optionally returning a node to insert after the
// previous node. `prev` is an object with the previous node and `insertAfter`
// function to insert after it. `next` is a node that will be added to the right.
// Used for bin cancellation and inserting spacings.
const traverseNonSpaceNodes = function (nodes, callback, prev, next, isRoot) {
  if (next) {
    // temporarily append the right node, if exists
    nodes.push(next);
  }
  let i = 0;
  for (; i < nodes.length; i++) {
    const node = nodes[i];
    const partialGroup = checkPartialGroup(node);
    if (partialGroup) {
      // Recursive DFS
      // TODO(ts): partialGroup.children is ReadonlyArray but this
      // function mutates the array (insertAfter splices into it).
      traverseNonSpaceNodes(partialGroup.children, callback, prev, null, isRoot);
      continue;
    }

    // Ignore explicit spaces (e.g., \;, \,) when determining what implicit
    // spacing should go between atoms of different classes
    const nonspace = !node.hasClass("mspace");
    if (nonspace) {
      const result = callback(node, prev.node);
      if (result) {
        if (prev.insertAfter) {
          prev.insertAfter(result);
        } else {
          // insert at front
          nodes.unshift(result);
          i++;
        }
      }
    }
    if (nonspace) {
      prev.node = node;
    } else if (isRoot && node.hasClass("newline")) {
      prev.node = makeSpan(["leftmost"]); // treat like beginning of line
    }
    prev.insertAfter = (index => n => {
      nodes.splice(index + 1, 0, n);
      i++;
    })(i);
  }
  if (next) {
    nodes.pop();
  }
};

// Check if given node is a partial group, i.e., does not affect spacing around.
const checkPartialGroup = function (node) {
  if (node instanceof DocumentFragment || node instanceof Anchor || node instanceof Span && node.hasClass("enclosing")) {
    return node;
  }
  return null;
};

// Return the outermost node of a domTree.
const getOutermostNode = function (node, side) {
  const partialGroup = checkPartialGroup(node);
  if (partialGroup) {
    const children = partialGroup.children;
    if (children.length) {
      if (side === "right") {
        return getOutermostNode(children[children.length - 1], "right");
      } else if (side === "left") {
        return getOutermostNode(children[0], "left");
      }
    }
  }
  return node;
};

// Return math atom class (mclass) of a domTree.
// If `side` is given, it will get the type of the outermost node at given side.
const getTypeOfDomTree = function (node, side) {
  if (!node) {
    return null;
  }
  if (side) {
    node = getOutermostNode(node, side);
  }
  // This makes a lot of assumptions as to where the type of atom
  // appears.  We should do a better job of enforcing this.
  const className = node.classes[0];
  return DomEnum[className] || null;
};
const makeNullDelimiter = function (options, classes) {
  const moreClasses = ["nulldelimiter"].concat(options.baseSizingClasses());
  return makeSpan(classes.concat(moreClasses));
};

/**
 * buildGroup is the function that takes a group and calls the correct groupType
 * function for it. It also handles the interaction of size and style changes
 * between parents and children.
 */
const buildGroup = function (group, options, baseOptions) {
  if (!group) {
    return makeSpan();
  }
  if (_htmlGroupBuilders[group.type]) {
    // TODO(ts): groupBuilders is Record<string, HtmlBuilder<any>>;
    // a type-safe registry would need a mapped type keyed by NodeType.
    let groupNode = _htmlGroupBuilders[group.type](group, options);

    // If the size changed between the parent and the current group, account
    // for that size difference.
    if (baseOptions && options.size !== baseOptions.size) {
      groupNode = makeSpan(options.sizingClasses(baseOptions), [groupNode], options);
      const multiplier = options.sizeMultiplier / baseOptions.sizeMultiplier;
      groupNode.height *= multiplier;
      groupNode.depth *= multiplier;
    }
    return groupNode;
  } else {
    throw new src_ParseError("Got group of unknown type: '" + group.type + "'");
  }
};

/**
 * Combine an array of HTML DOM nodes (e.g., the output of `buildExpression`)
 * into an unbreakable HTML node of class .base, with proper struts to
 * guarantee correct vertical extent.  `buildHTML` calls this repeatedly to
 * make up the entire expression as a sequence of unbreakable units.
 */
function buildHTMLUnbreakable(children, options) {
  // Compute height and depth of this chunk.
  const body = makeSpan(["base"], children, options);

  // Add strut, which ensures that the top of the HTML element falls at
  // the height of the expression, and the bottom of the HTML element
  // falls at the depth of the expression.
  const strut = makeSpan(["strut"]);
  strut.style.height = makeEm(body.height + body.depth);
  if (body.depth) {
    strut.style.verticalAlign = makeEm(-body.depth);
  }
  body.children.unshift(strut);
  return body;
}

/**
 * Take an entire parse tree, and build it into an appropriate set of HTML
 * nodes.
 */
function buildHTML(tree, options) {
  // Strip off outer tag wrapper for processing below.
  let tag = null;
  if (tree.length === 1 && tree[0].type === "tag") {
    tag = tree[0].tag;
    tree = tree[0].body;
  }

  // Build the expression contained in the tree
  const expression = buildExpression(tree, options, "root");
  let eqnNum;
  if (expression.length === 2 && expression[1].hasClass("tag")) {
    // An environment with automatic equation numbers, e.g. {gather}.
    eqnNum = expression.pop();
  }
  const children = [];

  // Create one base node for each chunk between potential line breaks.
  // The TeXBook [p.173] says "A formula will be broken only after a
  // relation symbol like $=$ or $<$ or $\rightarrow$, or after a binary
  // operation symbol like $+$ or $-$ or $\times$, where the relation or
  // binary operation is on the ``outer level'' of the formula (i.e., not
  // enclosed in {...} and not part of an \over construction)."

  let parts = [];
  for (let i = 0; i < expression.length; i++) {
    parts.push(expression[i]);
    if (expression[i].hasClass("mbin") || expression[i].hasClass("mrel") || expression[i].hasClass("allowbreak")) {
      // Put any post-operator glue on same line as operator.
      // Watch for \nobreak along the way, and stop at \newline.
      let nobreak = false;
      while (i < expression.length - 1 && expression[i + 1].hasClass("mspace") && !expression[i + 1].hasClass("newline")) {
        i++;
        parts.push(expression[i]);
        if (expression[i].hasClass("nobreak")) {
          nobreak = true;
        }
      }
      // Don't allow break if \nobreak among the post-operator glue.
      if (!nobreak) {
        children.push(buildHTMLUnbreakable(parts, options));
        parts = [];
      }
    } else if (expression[i].hasClass("newline")) {
      // Write the line except the newline
      parts.pop();
      if (parts.length > 0) {
        children.push(buildHTMLUnbreakable(parts, options));
        parts = [];
      }
      // Put the newline at the top level
      children.push(expression[i]);
    }
  }
  if (parts.length > 0) {
    children.push(buildHTMLUnbreakable(parts, options));
  }

  // Now, if there was a tag, build it too and append it as a final child.
  let tagChild;
  if (tag) {
    tagChild = buildHTMLUnbreakable(buildExpression(tag, options, true), options);
    tagChild.classes = ["tag"];
    children.push(tagChild);
  } else if (eqnNum) {
    children.push(eqnNum);
  }
  const htmlNode = makeSpan(["katex-html"], children);
  htmlNode.setAttribute("aria-hidden", "true");

  // Adjust the strut of the tag to be the maximum height of all children
  // (the height of the enclosing htmlNode) for proper vertical alignment.
  if (tagChild) {
    const strut = tagChild.children[0];
    strut.style.height = makeEm(htmlNode.height + htmlNode.depth);
    if (htmlNode.depth) {
      strut.style.verticalAlign = makeEm(-htmlNode.depth);
    }
  }
  return htmlNode;
}
;// ./src/mathMLTree.ts
/**
 * These objects store data about MathML nodes. This is the MathML equivalent
 * of the types in domTree.js. Since MathML handles its own rendering, and
 * since we're mainly using MathML to improve accessibility, we don't manage
 * any of the styling state that the plain DOM nodes do.
 *
 * The `toNode` and `toMarkup` functions work similarly to how they do in
 * domTree.js, creating namespaced DOM nodes and HTML text markup respectively.
 */






/**
 * MathML node types used in KaTeX. For a complete list of MathML nodes, see
 * https://developer.mozilla.org/en-US/docs/Web/MathML/Element.
 */

function newDocumentFragment(children) {
  return new DocumentFragment(children);
}

/**
 * This node represents a general purpose MathML node of any type. The
 * constructor requires the type of node to create (for example, `"mo"` or
 * `"mspace"`, corresponding to `<mo>` and `<mspace>` tags).
 */
class MathNode {
  constructor(type, children, classes) {
    this.type = void 0;
    this.attributes = void 0;
    this.children = void 0;
    this.classes = void 0;
    this.type = type;
    this.attributes = {};
    this.children = children || [];
    this.classes = classes || [];
  }

  /**
   * Sets an attribute on a MathML node. MathML depends on attributes to convey a
   * semantic content, so this is used heavily.
   */
  setAttribute(name, value) {
    this.attributes[name] = value;
  }

  /**
   * Gets an attribute on a MathML node.
   */
  getAttribute(name) {
    return this.attributes[name];
  }

  /**
   * Converts the math node into a MathML-namespaced DOM element.
   */
  toNode() {
    const node = document.createElementNS("http://www.w3.org/1998/Math/MathML", this.type);
    for (const attr in this.attributes) {
      if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
        node.setAttribute(attr, this.attributes[attr]);
      }
    }
    if (this.classes.length > 0) {
      node.className = createClass(this.classes);
    }
    for (let i = 0; i < this.children.length; i++) {
      // Combine multiple TextNodes into one TextNode, to prevent
      // screen readers from reading each as a separate word [#3995]
      if (this.children[i] instanceof TextNode && this.children[i + 1] instanceof TextNode) {
        let text = this.children[i].toText() + this.children[++i].toText();
        while (this.children[i + 1] instanceof TextNode) {
          text += this.children[++i].toText();
        }
        node.appendChild(new TextNode(text).toNode());
      } else {
        node.appendChild(this.children[i].toNode());
      }
    }
    return node;
  }

  /**
   * Converts the math node into an HTML markup string.
   */
  toMarkup() {
    let markup = "<" + this.type;

    // Add the attributes
    for (const attr in this.attributes) {
      if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
        markup += " " + attr + "=\"";
        markup += utils_escape(this.attributes[attr]);
        markup += "\"";
      }
    }
    if (this.classes.length > 0) {
      markup += " class =\"" + utils_escape(createClass(this.classes)) + "\"";
    }
    markup += ">";
    for (let i = 0; i < this.children.length; i++) {
      markup += this.children[i].toMarkup();
    }
    markup += "</" + this.type + ">";
    return markup;
  }

  /**
   * Converts the math node into a string, similar to innerText, but escaped.
   */
  toText() {
    return this.children.map(child => child.toText()).join("");
  }
}

/**
 * This node represents a piece of text.
 */
class TextNode {
  constructor(text) {
    this.text = void 0;
    this.text = text;
  }

  /**
   * Converts the text node into a DOM text node.
   */
  toNode() {
    return document.createTextNode(this.text);
  }

  /**
   * Converts the text node into escaped HTML markup
   * (representing the text itself).
   */
  toMarkup() {
    return utils_escape(this.toText());
  }

  /**
   * Converts the text node into a string
   * (representing the text itself).
   */
  toText() {
    return this.text;
  }
}

/**
 * This node represents a space, but may render as <mspace.../> or as text,
 * depending on the width.
 */
class SpaceNode {
  /**
   * Create a Space node with width given in CSS ems.
   */
  constructor(width) {
    this.width = void 0;
    this.character = void 0;
    this.width = width;
    // See https://www.w3.org/TR/2000/WD-MathML2-20000328/chapter6.html
    // for a table of space-like characters.  We use Unicode
    // representations instead of &LongNames; as it's not clear how to
    // make the latter via document.createTextNode.
    if (width >= 0.05555 && width <= 0.05556) {
      this.character = "\u200a"; // &VeryThinSpace;
    } else if (width >= 0.1666 && width <= 0.1667) {
      this.character = "\u2009"; // &ThinSpace;
    } else if (width >= 0.2222 && width <= 0.2223) {
      this.character = "\u2005"; // &MediumSpace;
    } else if (width >= 0.2777 && width <= 0.2778) {
      this.character = "\u2005\u200a"; // &ThickSpace;
    } else if (width >= -0.05556 && width <= -0.05555) {
      this.character = "\u200a\u2063"; // &NegativeVeryThinSpace;
    } else if (width >= -0.1667 && width <= -0.1666) {
      this.character = "\u2009\u2063"; // &NegativeThinSpace;
    } else if (width >= -0.2223 && width <= -0.2222) {
      this.character = "\u205f\u2063"; // &NegativeMediumSpace;
    } else if (width >= -0.2778 && width <= -0.2777) {
      this.character = "\u2005\u2063"; // &NegativeThickSpace;
    } else {
      this.character = null;
    }
  }

  /**
   * Converts the math node into a MathML-namespaced DOM element.
   */
  toNode() {
    if (this.character) {
      return document.createTextNode(this.character);
    } else {
      const node = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mspace");
      node.setAttribute("width", makeEm(this.width));
      return node;
    }
  }

  /**
   * Converts the math node into an HTML markup string.
   */
  toMarkup() {
    if (this.character) {
      return "<mtext>" + this.character + "</mtext>";
    } else {
      return "<mspace width=\"" + makeEm(this.width) + "\"/>";
    }
  }

  /**
   * Converts the math node into a string, similar to innerText.
   */
  toText() {
    if (this.character) {
      return this.character;
    } else {
      return " ";
    }
  }
}
;// ./src/buildMathML.ts
/**
 * This file converts a parse tree into a corresponding MathML tree. The main
 * entry point is the `buildMathML` function, which takes a parse tree from the
 * parser.
 */







const noVariantSymbols = new Set(["\\imath", "\\jmath"]);
const rowLikeTypes = new Set(["mrow", "mtable"]);

/**
 * Takes a symbol and converts it into a MathML text node after performing
 * optional replacement from symbols.js.
 */
const makeText = function (text, mode, options) {
  if (src_symbols[mode][text] && src_symbols[mode][text].replace && text.charCodeAt(0) !== 0xD835 && !(ligatures.hasOwnProperty(text) && options && (options.fontFamily && options.fontFamily.slice(4, 6) === "tt" || options.font && options.font.slice(4, 6) === "tt"))) {
    text = src_symbols[mode][text].replace;
  }
  return new TextNode(text);
};

/**
 * Wrap the given array of nodes in an <mrow> node if needed, i.e.,
 * unless the array has length 1.  Always returns a single node.
 */
const makeRow = function (body) {
  if (body.length === 1) {
    return body[0];
  } else {
    return new MathNode("mrow", body);
  }
};
const mathFontVariants = {
  mathit: "italic",
  boldsymbol: group => group.type === "textord" ? "bold" : "bold-italic",
  mathbf: "bold",
  mathbb: "double-struck",
  mathsfit: "sans-serif-italic",
  mathfrak: "fraktur",
  mathscr: "script",
  mathcal: "script",
  mathsf: "sans-serif",
  mathtt: "monospace"
};

/**
 * Returns the math variant as a string or null if none is required.
 */
const getVariant = (group, options) => {
  // Handle \text... font specifiers as best we can.
  // MathML has a limited list of allowable mathvariant specifiers; see
  // https://www.w3.org/TR/MathML3/chapter3.html#presm.commatt
  if (group.mode === "text") {
    if (options.fontFamily === "texttt") {
      return "monospace";
    } else if (options.fontFamily === "textsf") {
      if (options.fontShape === "textit" && options.fontWeight === "textbf") {
        return "sans-serif-bold-italic";
      } else if (options.fontShape === "textit") {
        return "sans-serif-italic";
      } else if (options.fontWeight === "textbf") {
        return "bold-sans-serif";
      } else {
        return "sans-se   rif";
      }
    } else if (options.fontShape === "textit" && options.fontWeight === "textbf") {
      return "bold-italic";
    } else if (options.fontShape === "textit") {
      return "italic";
    } else if (options.fontWeight === "textbf") {
      return "bold";
    }
  }
  const font = options.font;
  if (!font || font === "mathnormal") {
    return null;
  }
  const mode = group.mode;
  const mathVariant = mathFontVariants[font];
  if (mathVariant) {
    return typeof mathVariant === "function" ? mathVariant(group) : mathVariant;
  }
  let text = group.text;
  if (noVariantSymbols.has(text)) {
    return null;
  }
  if (src_symbols[mode][text]) {
    const replacement = src_symbols[mode][text].replace;
    if (replacement) {
      text = replacement;
    }
  }
  const fontName = fontMap[font].fontName;
  if (getCharacterMetrics(text, fontName, mode)) {
    return fontMap[font].variant;
  }
  return null;
};

/**
 * Check for <mi>.</mi> which is how a dot renders in MathML,
 * or <mo separator="true" lspace="0em" rspace="0em">,</mo>
 * which is how a braced comma {,} renders in MathML
 */
function isNumberPunctuation(group) {
  if (!group) {
    return false;
  }
  if (group.type === 'mi' && group.children.length === 1) {
    const child = group.children[0];
    return child instanceof TextNode && child.text === '.';
  } else if (group.type === 'mo' && group.children.length === 1 && group.getAttribute('separator') === 'true' && group.getAttribute('lspace') === '0em' && group.getAttribute('rspace') === '0em') {
    const child = group.children[0];
    return child instanceof TextNode && child.text === ',';
  } else {
    return false;
  }
}

/**
 * Takes a list of nodes, builds them, and returns a list of the generated
 * MathML nodes.  Also combine consecutive <mtext> outputs into a single
 * <mtext> tag.
 */
const buildMathML_buildExpression = function (expression, options, isOrdgroup) {
  if (expression.length === 1) {
    const group = buildMathML_buildGroup(expression[0], options);
    if (isOrdgroup && group instanceof MathNode && group.type === "mo") {
      // When TeX writers want to suppress spacing on an operator,
      // they often put the operator by itself inside braces.
      group.setAttribute("lspace", "0em");
      group.setAttribute("rspace", "0em");
    }
    return [group];
  }
  const groups = [];
  let lastGroup;
  for (let i = 0; i < expression.length; i++) {
    const group = buildMathML_buildGroup(expression[i], options);
    if (group instanceof MathNode && lastGroup instanceof MathNode) {
      // Concatenate adjacent <mtext>s
      if (group.type === 'mtext' && lastGroup.type === 'mtext' && group.getAttribute('mathvariant') === lastGroup.getAttribute('mathvariant')) {
        lastGroup.children.push(...group.children);
        continue;
        // Concatenate adjacent <mn>s
      } else if (group.type === 'mn' && lastGroup.type === 'mn') {
        lastGroup.children.push(...group.children);
        continue;
        // Concatenate <mn>...</mn> followed by <mi>.</mi>
      } else if (isNumberPunctuation(group) && lastGroup.type === 'mn') {
        lastGroup.children.push(...group.children);
        continue;
        // Concatenate <mi>.</mi> followed by <mn>...</mn>
      } else if (group.type === 'mn' && isNumberPunctuation(lastGroup)) {
        group.children = [...lastGroup.children, ...group.children];
        groups.pop();
        // Put preceding <mn>...</mn> or <mi>.</mi> inside base of
        // <msup><mn>...base...</mn>...exponent...</msup> (or <msub>)
      } else if ((group.type === 'msup' || group.type === 'msub') && group.children.length >= 1 && (lastGroup.type === 'mn' || isNumberPunctuation(lastGroup))) {
        const base = group.children[0];
        if (base instanceof MathNode && base.type === 'mn') {
          base.children = [...lastGroup.children, ...base.children];
          groups.pop();
        }
        // \not
      } else if (lastGroup.type === 'mi' && lastGroup.children.length === 1) {
        const lastChild = lastGroup.children[0];
        if (lastChild instanceof TextNode && lastChild.text === '\u0338' && (group.type === 'mo' || group.type === 'mi' || group.type === 'mn')) {
          const child = group.children[0];
          if (child instanceof TextNode && child.text.length > 0) {
            // Overlay with combining character long solidus
            child.text = child.text.slice(0, 1) + "\u0338" + child.text.slice(1);
            groups.pop();
          }
        }
      }
    }
    groups.push(group);
    lastGroup = group;
  }
  return groups;
};

/**
 * Equivalent to buildExpression, but wraps the elements in an <mrow>
 * if there's more than one.  Returns a single node instead of an array.
 */
const buildExpressionRow = function (expression, options, isOrdgroup) {
  return makeRow(buildMathML_buildExpression(expression, options, isOrdgroup));
};

/**
 * Takes a group from the parser and calls the appropriate groupBuilders function
 * on it to produce a MathML node.
 */
const buildMathML_buildGroup = function (group, options) {
  if (!group) {
    return new MathNode("mrow");
  }
  if (_mathmlGroupBuilders[group.type]) {
    // TODO(ts): MathMLBuilder returns MathDomNode but all concrete
    // builders return MathNode. Widening the return type here would
    // require updating all callers that assume MathNode.
    return _mathmlGroupBuilders[group.type](group, options);
  } else {
    throw new src_ParseError("Got group of unknown type: '" + group.type + "'");
  }
};

/**
 * Takes a full parse tree and settings and builds a MathML representation of
 * it. In particular, we put the elements from building the parse tree into a
 * <semantics> tag so we can also include that TeX source as an annotation.
 *
 * Note that we actually return a domTree element with a `<math>` inside it so
 * we can do appropriate styling.
 */
function buildMathML(tree, texExpression, options, isDisplayMode, forMathmlOnly) {
  const expression = buildMathML_buildExpression(tree, options);

  // TODO: Make a pass thru the MathML similar to buildHTML.traverseNonSpaceNodes
  // and add spacing nodes. This is necessary only adjacent to math operators
  // like \sin or \lim or to subsup elements that contain math operators.
  // MathML takes care of the other spacing issues.

  // Wrap up the expression in an mrow so it is presented in the semantics
  // tag correctly, unless it's a single <mrow> or <mtable>.
  let wrapper;
  if (expression.length === 1 && expression[0] instanceof MathNode && rowLikeTypes.has(expression[0].type)) {
    wrapper = expression[0];
  } else {
    wrapper = new MathNode("mrow", expression);
  }

  // Build a TeX annotation of the source
  const annotation = new MathNode("annotation", [new TextNode(texExpression)]);
  annotation.setAttribute("encoding", "application/x-tex");
  const semantics = new MathNode("semantics", [wrapper, annotation]);
  const math = new MathNode("math", [semantics]);
  math.setAttribute("xmlns", "http://www.w3.org/1998/Math/MathML");
  if (isDisplayMode) {
    math.setAttribute("display", "block");
  }

  // You can't style <math> nodes, so we wrap the node in a span.
  // NOTE: The span class is not typed to have <math> nodes as children, and
  // we don't want to make the children type more generic since the children
  // of span are expected to have more fields in `buildHtml` contexts.
  // The MathNode implements VirtualNode (toNode/toMarkup) which is all that
  // Span needs from its children for rendering.
  // TODO(ts): Span's child type is HtmlDomNode, but MathNode only implements
  // VirtualNode. The double-cast acknowledges this architectural limitation.
  const wrapperClass = forMathmlOnly ? "katex" : "katex-mathml";
  return makeSpan([wrapperClass], [math]);
}
;// ./src/Options.ts
/**
 * This file contains information about the options that the Parser carries
 * around with it while parsing. Data is held in an `Options` object, and when
 * recursing, a new `Options` object can be created with the `.with*` and
 * `.reset` functions.
 */


const sizeStyleMap = [
// Each element contains [textsize, scriptsize, scriptscriptsize].
// The size mappings are taken from TeX with \normalsize=10pt.
[1, 1, 1],
// size1: [5, 5, 5]              \tiny
[2, 1, 1],
// size2: [6, 5, 5]
[3, 1, 1],
// size3: [7, 5, 5]              \scriptsize
[4, 2, 1],
// size4: [8, 6, 5]              \footnotesize
[5, 2, 1],
// size5: [9, 6, 5]              \small
[6, 3, 1],
// size6: [10, 7, 5]             \normalsize
[7, 4, 2],
// size7: [12, 8, 6]             \large
[8, 6, 3],
// size8: [14.4, 10, 7]          \Large
[9, 7, 6],
// size9: [17.28, 12, 10]        \LARGE
[10, 8, 7],
// size10: [20.74, 14.4, 12]     \huge
[11, 10, 9] // size11: [24.88, 20.74, 17.28] \HUGE
];
const sizeMultipliers = [
// fontMetrics.js:getGlobalMetrics also uses size indexes, so if
// you change size indexes, change that function.
0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.44, 1.728, 2.074, 2.488];
const sizeAtStyle = function (size, style) {
  return style.size < 2 ? size : sizeStyleMap[size - 1][style.size - 1];
};
/**
 * This is the main options class. It contains the current style, size, color,
 * and font.
 *
 * Options objects should not be modified. To create a new Options with
 * different properties, call a `.having*` method.
 */
class Options {
  constructor(data) {
    this.style = void 0;
    this.color = void 0;
    this.size = void 0;
    this.textSize = void 0;
    this.phantom = void 0;
    // A font family applies to a group of fonts (i.e. SansSerif), while a font
    // represents a specific font (i.e. SansSerif Bold).
    // See: https://tex.stackexchange.com/questions/22350/difference-between-textrm-and-mathrm
    this.font = void 0;
    this.fontFamily = void 0;
    this.fontWeight = void 0;
    this.fontShape = void 0;
    this.sizeMultiplier = void 0;
    this.maxSize = void 0;
    this.minRuleThickness = void 0;
    this._fontMetrics = void 0;
    this.style = data.style;
    this.color = data.color;
    this.size = data.size || Options.BASESIZE;
    this.textSize = data.textSize || this.size;
    this.phantom = !!data.phantom;
    this.font = data.font || "";
    this.fontFamily = data.fontFamily || "";
    this.fontWeight = data.fontWeight || "";
    this.fontShape = data.fontShape || "";
    this.sizeMultiplier = sizeMultipliers[this.size - 1];
    this.maxSize = data.maxSize;
    this.minRuleThickness = data.minRuleThickness;
    this._fontMetrics = undefined;
  }

  /**
   * Returns a new options object with the same properties as "this".  Properties
   * from "extension" will be copied to the new options object.
   */
  extend(extension) {
    const data = {
      style: this.style,
      size: this.size,
      textSize: this.textSize,
      color: this.color,
      phantom: this.phantom,
      font: this.font,
      fontFamily: this.fontFamily,
      fontWeight: this.fontWeight,
      fontShape: this.fontShape,
      maxSize: this.maxSize,
      minRuleThickness: this.minRuleThickness
    };
    Object.assign(data, extension);
    return new Options(data);
  }

  /**
   * Return an options object with the given style. If `this.style === style`,
   * returns `this`.
   */
  havingStyle(style) {
    if (this.style === style) {
      return this;
    } else {
      return this.extend({
        style: style,
        size: sizeAtStyle(this.textSize, style)
      });
    }
  }

  /**
   * Return an options object with a cramped version of the current style. If
   * the current style is cramped, returns `this`.
   */
  havingCrampedStyle() {
    return this.havingStyle(this.style.cramp());
  }

  /**
   * Return an options object with the given size and in at least `\textstyle`.
   * Returns `this` if appropriate.
   */
  havingSize(size) {
    if (this.size === size && this.textSize === size) {
      return this;
    } else {
      return this.extend({
        style: this.style.text(),
        size: size,
        textSize: size,
        sizeMultiplier: sizeMultipliers[size - 1]
      });
    }
  }

  /**
   * Like `this.havingSize(BASESIZE).havingStyle(style)`. If `style` is omitted,
   * changes to at least `\textstyle`.
   */
  havingBaseStyle(style) {
    style = style || this.style.text();
    const wantSize = sizeAtStyle(Options.BASESIZE, style);
    if (this.size === wantSize && this.textSize === Options.BASESIZE && this.style === style) {
      return this;
    } else {
      return this.extend({
        style: style,
        size: wantSize
      });
    }
  }

  /**
   * Remove the effect of sizing changes such as \Huge.
   * Keep the effect of the current style, such as \scriptstyle.
   */
  havingBaseSizing() {
    let size;
    switch (this.style.id) {
      case 4:
      case 5:
        size = 3; // normalsize in scriptstyle
        break;
      case 6:
      case 7:
        size = 1; // normalsize in scriptscriptstyle
        break;
      default:
        size = 6;
      // normalsize in textstyle or displaystyle
    }
    return this.extend({
      style: this.style.text(),
      size: size
    });
  }

  /**
   * Create a new options object with the given color.
   */
  withColor(color) {
    return this.extend({
      color: color
    });
  }

  /**
   * Create a new options object with "phantom" set to true.
   */
  withPhantom() {
    return this.extend({
      phantom: true
    });
  }

  /**
   * Creates a new options object with the given math font or old text font.
   * @type {[type]}
   */
  withFont(font) {
    return this.extend({
      font
    });
  }

  /**
   * Create a new options objects with the given fontFamily.
   */
  withTextFontFamily(fontFamily) {
    return this.extend({
      fontFamily,
      font: ""
    });
  }

  /**
   * Creates a new options object with the given font weight
   */
  withTextFontWeight(fontWeight) {
    return this.extend({
      fontWeight,
      font: ""
    });
  }

  /**
   * Creates a new options object with the given font weight
   */
  withTextFontShape(fontShape) {
    return this.extend({
      fontShape,
      font: ""
    });
  }

  /**
   * Return the CSS sizing classes required to switch from enclosing options
   * `oldOptions` to `this`. Returns an array of classes.
   */
  sizingClasses(oldOptions) {
    if (oldOptions.size !== this.size) {
      return ["sizing", "reset-size" + oldOptions.size, "size" + this.size];
    } else {
      return [];
    }
  }

  /**
   * Return the CSS sizing classes required to switch to the base size. Like
   * `this.havingSize(BASESIZE).sizingClasses(this)`.
   */
  baseSizingClasses() {
    if (this.size !== Options.BASESIZE) {
      return ["sizing", "reset-size" + this.size, "size" + Options.BASESIZE];
    } else {
      return [];
    }
  }

  /**
   * Return the font metrics for this size.
   */
  fontMetrics() {
    if (!this._fontMetrics) {
      this._fontMetrics = getGlobalMetrics(this.size);
    }
    return this._fontMetrics;
  }

  /**
   * Gets the CSS color of the current options object
   */
  getColor() {
    if (this.phantom) {
      return "transparent";
    } else {
      return this.color;
    }
  }
}
/**
 * The base size index.
 */
Options.BASESIZE = 6;
/* harmony default export */ var src_Options = (Options);
;// ./src/buildTree.ts





const optionsFromSettings = function (settings) {
  return new src_Options({
    style: settings.displayMode ? src_Style.DISPLAY : src_Style.TEXT,
    maxSize: settings.maxSize,
    minRuleThickness: settings.minRuleThickness
  });
};
const displayWrap = function (node, settings) {
  if (settings.displayMode) {
    const classes = ["katex-display"];
    if (settings.leqno) {
      classes.push("leqno");
    }
    if (settings.fleqn) {
      classes.push("fleqn");
    }
    node = makeSpan(classes, [node]);
  }
  return node;
};
const buildTree = function (tree, expression, settings) {
  const options = optionsFromSettings(settings);
  let katexNode;
  if (settings.output === "mathml") {
    return buildMathML(tree, expression, options, settings.displayMode, true);
  } else if (settings.output === "html") {
    const htmlNode = buildHTML(tree, options);
    katexNode = makeSpan(["katex"], [htmlNode]);
  } else {
    const mathMLNode = buildMathML(tree, expression, options, settings.displayMode, false);
    const htmlNode = buildHTML(tree, options);
    katexNode = makeSpan(["katex"], [mathMLNode, htmlNode]);
  }
  return displayWrap(katexNode, settings);
};
const buildHTMLTree = function (tree, expression, settings) {
  const options = optionsFromSettings(settings);
  const htmlNode = buildHTML(tree, options);
  const katexNode = makeSpan(["katex"], [htmlNode]);
  return displayWrap(katexNode, settings);
};
/* harmony default export */ var src_buildTree = ((/* unused pure expression or super */ null && (buildTree)));
;// ./src/stretchy.ts
/**
 * This file provides support to buildMathML.js and buildHTML.js
 * for stretchy wide elements rendered from SVG files
 * and other CSS trickery.
 */





const stretchyCodePoint = {
  widehat: "^",
  widecheck: "ˇ",
  widetilde: "~",
  utilde: "~",
  overleftarrow: "\u2190",
  underleftarrow: "\u2190",
  xleftarrow: "\u2190",
  overrightarrow: "\u2192",
  underrightarrow: "\u2192",
  xrightarrow: "\u2192",
  underbrace: "\u23df",
  overbrace: "\u23de",
  underbracket: "\u23b5",
  overbracket: "\u23b4",
  overgroup: "\u23e0",
  undergroup: "\u23e1",
  overleftrightarrow: "\u2194",
  underleftrightarrow: "\u2194",
  xleftrightarrow: "\u2194",
  Overrightarrow: "\u21d2",
  xRightarrow: "\u21d2",
  overleftharpoon: "\u21bc",
  xleftharpoonup: "\u21bc",
  overrightharpoon: "\u21c0",
  xrightharpoonup: "\u21c0",
  xLeftarrow: "\u21d0",
  xLeftrightarrow: "\u21d4",
  xhookleftarrow: "\u21a9",
  xhookrightarrow: "\u21aa",
  xmapsto: "\u21a6",
  xrightharpoondown: "\u21c1",
  xleftharpoondown: "\u21bd",
  xrightleftharpoons: "\u21cc",
  xleftrightharpoons: "\u21cb",
  xtwoheadleftarrow: "\u219e",
  xtwoheadrightarrow: "\u21a0",
  xlongequal: "=",
  xtofrom: "\u21c4",
  xrightleftarrows: "\u21c4",
  xrightequilibrium: "\u21cc",
  // Not a perfect match.
  xleftequilibrium: "\u21cb",
  // None better available.
  "\\cdrightarrow": "\u2192",
  "\\cdleftarrow": "\u2190",
  "\\cdlongequal": "="
};
const stretchyMathML = function (label) {
  const node = new MathNode("mo", [new TextNode(stretchyCodePoint[label.replace(/^\\/, '')])]);
  node.setAttribute("stretchy", "true");
  return node;
};

// Many of the KaTeX SVG images have been adapted from glyphs in KaTeX fonts.
// Copyright (c) 2009-2010, Design Science, Inc. (<www.mathjax.org>)
// Copyright (c) 2014-2017 Khan Academy (<www.khanacademy.org>)
// Licensed under the SIL Open Font License, Version 1.1.
// See \nhttp://scripts.sil.org/OFL

// Very Long SVGs
//    Many of the KaTeX stretchy wide elements use a long SVG image and an
//    overflow: hidden tactic to achieve a stretchy image while avoiding
//    distortion of arrowheads or brace corners.

//    The SVG typically contains a very long (400 em) arrow.

//    The SVG is in a container span that has overflow: hidden, so the span
//    acts like a window that exposes only part of the  SVG.

//    The SVG always has a longer, thinner aspect ratio than the container span.
//    After the SVG fills 100% of the height of the container span,
//    there is a long arrow shaft left over. That left-over shaft is not shown.
//    Instead, it is sliced off because the span's CSS has overflow: hidden.

//    Thus, the reader sees an arrow that matches the subject matter width
//    without distortion.

//    Some functions, such as \cancel, need to vary their aspect ratio. These
//    functions do not get the overflow SVG treatment.

// In the katexImagesData object just below, the dimensions all
// correspond to path geometry inside the relevant SVG.
// For example, \overrightarrow uses the same arrowhead as glyph U+2192
// from the KaTeX Main font. The scaling factor is 1000.
// That is, inside the font, that arrowhead is 522 units tall, which
// corresponds to 0.522 em inside the document.

const katexImagesData = {
  //   path(s), minWidth, height, align
  overrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"],
  overleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"],
  underrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"],
  underleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"],
  xrightarrow: [["rightarrow"], 1.469, 522, "xMaxYMin"],
  "\\cdrightarrow": [["rightarrow"], 3.0, 522, "xMaxYMin"],
  // CD minwwidth2.5pc
  xleftarrow: [["leftarrow"], 1.469, 522, "xMinYMin"],
  "\\cdleftarrow": [["leftarrow"], 3.0, 522, "xMinYMin"],
  Overrightarrow: [["doublerightarrow"], 0.888, 560, "xMaxYMin"],
  xRightarrow: [["doublerightarrow"], 1.526, 560, "xMaxYMin"],
  xLeftarrow: [["doubleleftarrow"], 1.526, 560, "xMinYMin"],
  overleftharpoon: [["leftharpoon"], 0.888, 522, "xMinYMin"],
  xleftharpoonup: [["leftharpoon"], 0.888, 522, "xMinYMin"],
  xleftharpoondown: [["leftharpoondown"], 0.888, 522, "xMinYMin"],
  overrightharpoon: [["rightharpoon"], 0.888, 522, "xMaxYMin"],
  xrightharpoonup: [["rightharpoon"], 0.888, 522, "xMaxYMin"],
  xrightharpoondown: [["rightharpoondown"], 0.888, 522, "xMaxYMin"],
  xlongequal: [["longequal"], 0.888, 334, "xMinYMin"],
  "\\cdlongequal": [["longequal"], 3.0, 334, "xMinYMin"],
  xtwoheadleftarrow: [["twoheadleftarrow"], 0.888, 334, "xMinYMin"],
  xtwoheadrightarrow: [["twoheadrightarrow"], 0.888, 334, "xMaxYMin"],
  overleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522],
  overbrace: [["leftbrace", "midbrace", "rightbrace"], 1.6, 548],
  underbrace: [["leftbraceunder", "midbraceunder", "rightbraceunder"], 1.6, 548],
  underleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522],
  xleftrightarrow: [["leftarrow", "rightarrow"], 1.75, 522],
  xLeftrightarrow: [["doubleleftarrow", "doublerightarrow"], 1.75, 560],
  xrightleftharpoons: [["leftharpoondownplus", "rightharpoonplus"], 1.75, 716],
  xleftrightharpoons: [["leftharpoonplus", "rightharpoondownplus"], 1.75, 716],
  xhookleftarrow: [["leftarrow", "righthook"], 1.08, 522],
  xhookrightarrow: [["lefthook", "rightarrow"], 1.08, 522],
  overlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522],
  underlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522],
  overbracket: [["leftbracketover", "rightbracketover"], 1.6, 440],
  underbracket: [["leftbracketunder", "rightbracketunder"], 1.6, 410],
  overgroup: [["leftgroup", "rightgroup"], 0.888, 342],
  undergroup: [["leftgroupunder", "rightgroupunder"], 0.888, 342],
  xmapsto: [["leftmapsto", "rightarrow"], 1.5, 522],
  xtofrom: [["leftToFrom", "rightToFrom"], 1.75, 528],
  // The next three arrows are from the mhchem package.
  // In mhchem.sty, min-length is 2.0em. But these arrows might appear in the
  // document as \xrightarrow or \xrightleftharpoons. Those have
  // min-length = 1.75em, so we set min-length on these next three to match.
  xrightleftarrows: [["baraboveleftarrow", "rightarrowabovebar"], 1.75, 901],
  xrightequilibrium: [["baraboveshortleftharpoon", "rightharpoonaboveshortbar"], 1.75, 716],
  xleftequilibrium: [["shortbaraboveleftharpoon", "shortrightharpoonabovebar"], 1.75, 716]
};
const wideAccentLabels = new Set(["widehat", "widecheck", "widetilde", "utilde"]);
const stretchySvg = function (group, options) {
  // Create a span with inline SVG for the element.
  function buildSvgSpan_() {
    let viewBoxWidth = 400000; // default
    const label = group.label.slice(1);
    if (wideAccentLabels.has(label) && 'base' in group) {
      // There are four SVG images available for each function.
      // Choose a taller image when there are more characters.
      const numChars = group.base.type === "ordgroup" ? group.base.body.length : 1;
      let viewBoxHeight;
      let pathName;
      let height;
      if (numChars > 5) {
        if (label === "widehat" || label === "widecheck") {
          viewBoxHeight = 420;
          viewBoxWidth = 2364;
          height = 0.42;
          pathName = label + "4";
        } else {
          viewBoxHeight = 312;
          viewBoxWidth = 2340;
          height = 0.34;
          pathName = "tilde4";
        }
      } else {
        const imgIndex = [1, 1, 2, 2, 3, 3][numChars];
        if (label === "widehat" || label === "widecheck") {
          viewBoxWidth = [0, 1062, 2364, 2364, 2364][imgIndex];
          viewBoxHeight = [0, 239, 300, 360, 420][imgIndex];
          height = [0, 0.24, 0.3, 0.3, 0.36, 0.42][imgIndex];
          pathName = label + imgIndex;
        } else {
          viewBoxWidth = [0, 600, 1033, 2339, 2340][imgIndex];
          viewBoxHeight = [0, 260, 286, 306, 312][imgIndex];
          height = [0, 0.26, 0.286, 0.3, 0.306, 0.34][imgIndex];
          pathName = "tilde" + imgIndex;
        }
      }
      const path = new PathNode(pathName);
      const svgNode = new SvgNode([path], {
        "width": "100%",
        "height": makeEm(height),
        "viewBox": "0 0 " + viewBoxWidth + " " + viewBoxHeight,
        "preserveAspectRatio": "none"
      });
      return {
        span: makeSvgSpan([], [svgNode], options),
        minWidth: 0,
        height
      };
    } else {
      const spans = [];
      const data = katexImagesData[label];
      if (!data) {
        throw new Error("No SVG data for \"" + label + "\".");
      }
      const [paths, minWidth, viewBoxHeight] = data;
      const height = viewBoxHeight / 1000;
      const numSvgChildren = paths.length;
      let widthClasses;
      let aligns;
      if (numSvgChildren === 1) {
        if (data.length !== 4) {
          throw new Error("Expected 4-tuple for single-path SVG data \"" + label + "\".");
        }
        widthClasses = ["hide-tail"];
        aligns = [data[3]];
      } else if (numSvgChildren === 2) {
        widthClasses = ["halfarrow-left", "halfarrow-right"];
        aligns = ["xMinYMin", "xMaxYMin"];
      } else if (numSvgChildren === 3) {
        widthClasses = ["brace-left", "brace-center", "brace-right"];
        aligns = ["xMinYMin", "xMidYMin", "xMaxYMin"];
      } else {
        throw new Error("Correct katexImagesData or update code here to support\n                    " + numSvgChildren + " children.");
      }
      for (let i = 0; i < numSvgChildren; i++) {
        const path = new PathNode(paths[i]);
        const svgNode = new SvgNode([path], {
          "width": "400em",
          "height": makeEm(height),
          "viewBox": "0 0 " + viewBoxWidth + " " + viewBoxHeight,
          "preserveAspectRatio": aligns[i] + " slice"
        });
        const span = makeSvgSpan([widthClasses[i]], [svgNode], options);
        if (numSvgChildren === 1) {
          return {
            span,
            minWidth,
            height
          };
        } else {
          span.style.height = makeEm(height);
          spans.push(span);
        }
      }
      return {
        span: makeSpan(["stretchy"], spans, options),
        minWidth,
        height
      };
    }
  } // buildSvgSpan_()
  const {
    span,
    minWidth,
    height
  } = buildSvgSpan_();

  // Note that we are returning span.depth = 0.
  // Any adjustments relative to the baseline must be done in buildHTML.
  span.height = height;
  span.style.height = makeEm(height);
  if (minWidth > 0) {
    span.style.minWidth = makeEm(minWidth);
  }
  return span;
};
const stretchyEnclose = function (inner, label, topPad, bottomPad, options) {
  // Return an image span for \cancel, \bcancel, \xcancel, \fbox, or \angl
  let img;
  const totalHeight = inner.height + inner.depth + topPad + bottomPad;
  if (/fbox|color|angl/.test(label)) {
    img = makeSpan(["stretchy", label], [], options);
    if (label === "fbox") {
      const color = options.color && options.getColor();
      if (color) {
        img.style.borderColor = color;
      }
    }
  } else {
    // \cancel, \bcancel, or \xcancel
    // Since \cancel's SVG is inline and it omits the viewBox attribute,
    // its stroke-width will not vary with span area.

    const lines = [];
    if (/^[bx]cancel$/.test(label)) {
      lines.push(new LineNode({
        "x1": "0",
        "y1": "0",
        "x2": "100%",
        "y2": "100%",
        "stroke-width": "0.046em"
      }));
    }
    if (/^x?cancel$/.test(label)) {
      lines.push(new LineNode({
        "x1": "0",
        "y1": "100%",
        "x2": "100%",
        "y2": "0",
        "stroke-width": "0.046em"
      }));
    }
    const svgNode = new SvgNode(lines, {
      "width": "100%",
      "height": makeEm(totalHeight)
    });
    img = makeSvgSpan([], [svgNode], options);
  }
  img.height = totalHeight;
  img.style.height = makeEm(totalHeight);
  return img;
};
;// ./src/atoms.ts
/**
 * Small module for atom-group constants and type guard.  Kept separate from
 * `symbols.ts` so that consumers (notably `contrib/render-a11y-string`) can
 * pull in `isAtom` without dragging in the ~870-line symbol tables.
 */

// Some of these have a "-token" suffix since these are also used as `ParseNode`
// types for raw text tokens, and we want to avoid conflicts with higher-level
// `ParseNode` types. These `ParseNode`s are constructed within `Parser` by
// looking up the `symbols` map.
const ATOMS = {
  "bin": 1,
  "close": 1,
  "inner": 1,
  "open": 1,
  "punct": 1,
  "rel": 1
};
const NON_ATOMS = {
  "accent-token": 1,
  "mathord": 1,
  "op-token": 1,
  "spacing": 1,
  "textord": 1
};
function isAtom(value) {
  return value in ATOMS;
}
;// ./src/parseNode.ts


// ParseNode's corresponding to Symbol `Group`s in symbols.js.

// ParseNode from `Parser.formatUnsupportedCmd`

// Union of all possible `ParseNode<>` types.

// Map from `NodeType` to the corresponding `ParseNode`.

/**
 * Asserts that the node is of the given type and returns it with stricter
 * typing. Throws if the node's type does not match.
 */
function assertNodeType(node, type) {
  if (!node || node.type !== type) {
    throw new Error("Expected node of type " + type + ", but got " + (node ? "node of type " + node.type : String(node)));
  }
  return node;
}

/**
 * Returns the node more strictly typed iff it is of the given type. Otherwise,
 * returns null.
 */
function assertSymbolNodeType(node) {
  const typedNode = checkSymbolNodeType(node);
  if (!typedNode) {
    throw new Error("Expected node of symbol group type, but got " + (node ? "node of type " + node.type : String(node)));
  }
  return typedNode;
}

/**
 * Returns the node more strictly typed iff it is of the given type. Otherwise,
 * returns null.
 */
function checkSymbolNodeType(node) {
  if (node && (node.type === "atom" || NON_ATOMS.hasOwnProperty(node.type))) {
    return node;
  }
  return null;
}
;// ./src/functions/accent.ts










const getBaseSymbol = group => {
  if (group instanceof SymbolNode) {
    return group;
  }
  if (hasHtmlDomChildren(group) && group.children.length === 1) {
    return getBaseSymbol(group.children[0]);
  }
};

// NOTE: Unlike most `htmlBuilder`s, this one handles not only "accent", but
// also "supsub" since an accent can affect super/subscripting.
const htmlBuilder = (grp, options) => {
  // Accents are handled in the TeXbook pg. 443, rule 12.
  let base;
  let group;
  let supSubGroup;
  if (grp && grp.type === "supsub") {
    // If our base is a character box, and we have superscripts and
    // subscripts, the supsub will defer to us. In particular, we want
    // to attach the superscripts and subscripts to the inner body (so
    // that the position of the superscripts and subscripts won't be
    // affected by the height of the accent). We accomplish this by
    // sticking the base of the accent into the base of the supsub, and
    // rendering that, while keeping track of where the accent is.

    // The real accent group is the base of the supsub group
    group = assertNodeType(grp.base, "accent");
    // The character box is the base of the accent group
    base = group.base;
    // Stick the character box into the base of the supsub group
    grp.base = base;

    // Rerender the supsub group with its new base, and store that
    // result.
    supSubGroup = assertSpan(buildGroup(grp, options));

    // reset original base
    grp.base = group;
  } else {
    group = assertNodeType(grp, "accent");
    base = group.base;
  }

  // Build the base group
  const body = buildGroup(base, options.havingCrampedStyle());

  // Does the accent need to shift for the skew of a character?
  const mustShift = group.isShifty && isCharacterBox(base);

  // Calculate the skew of the accent. This is based on the line "If the
  // nucleus is not a single character, let s = 0; otherwise set s to the
  // kern amount for the nucleus followed by the \skewchar of its font."
  // Note that our skew metrics are just the kern between each character
  // and the skewchar.
  let skew = 0;
  if (mustShift) {
    var _getBaseSymbol$skew, _getBaseSymbol;
    // Read the skew from the rendered base symbol.
    // This preserves font metrics from font wrappers like \mathbb.
    skew = (_getBaseSymbol$skew = (_getBaseSymbol = getBaseSymbol(body)) == null ? void 0 : _getBaseSymbol.skew) != null ? _getBaseSymbol$skew : 0;
  }
  const accentBelow = group.label === "\\c";

  // calculate the amount of space between the body and the accent
  let clearance = accentBelow ? body.height + body.depth : Math.min(body.height, options.fontMetrics().xHeight);

  // Build the accent
  let accentBody;
  if (!group.isStretchy) {
    let accent;
    let width;
    if (group.label === "\\vec") {
      // Before version 0.9, \vec used the combining font glyph U+20D7.
      // But browsers, especially Safari, are not consistent in how they
      // render combining characters when not preceded by a character.
      // So now we use an SVG.
      // If Safari reforms, we should consider reverting to the glyph.
      accent = staticSvg("vec", options);
      width = svgData.vec[1];
    } else {
      accent = makeOrd({
        type: "textord",
        mode: group.mode,
        text: group.label
      }, options, "textord");
      accent = assertSymbolDomNode(accent);
      // Remove the italic correction of the accent, because it only serves to
      // shift the accent over to a place we don't want.
      accent.italic = 0;
      width = accent.width;
      if (accentBelow) {
        clearance += accent.depth;
      }
    }
    accentBody = makeSpan(["accent-body"], [accent]);

    // "Full" accents expand the width of the resulting symbol to be
    // at least the width of the accent, and overlap directly onto the
    // character without any vertical offset.
    const accentFull = group.label === "\\textcircled";
    if (accentFull) {
      accentBody.classes.push('accent-full');
      clearance = body.height;
    }

    // Shift the accent over by the skew.
    let left = skew;

    // CSS defines `.katex .accent .accent-body:not(.accent-full) { width: 0 }`
    // so that the accent doesn't contribute to the bounding box.
    // We need to shift the character by its width (effectively half
    // its width) to compensate.
    if (!accentFull) {
      left -= width / 2;
    }
    accentBody.style.left = makeEm(left);

    // \textcircled uses the \bigcirc glyph, so it needs some
    // vertical adjustment to match LaTeX.
    if (group.label === "\\textcircled") {
      accentBody.style.top = ".2em";
    }
    accentBody = makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: body
      }, {
        type: "kern",
        size: -clearance
      }, {
        type: "elem",
        elem: accentBody
      }]
    }, options);
  } else {
    accentBody = stretchySvg(group, options);
    accentBody = makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: body
      }, {
        type: "elem",
        elem: accentBody,
        wrapperClasses: ["svg-align"],
        wrapperStyle: skew > 0 ? {
          width: "calc(100% - " + makeEm(2 * skew) + ")",
          marginLeft: makeEm(2 * skew)
        } : undefined
      }]
    }, options);
  }
  const accentWrap = makeSpan(["mord", "accent"], [accentBody], options);
  if (supSubGroup) {
    // Here, we replace the "base" child of the supsub with our newly
    // generated accent.
    supSubGroup.children[0] = accentWrap;

    // Since we don't rerun the height calculation after replacing the
    // accent, we manually recalculate height.
    supSubGroup.height = Math.max(accentWrap.height, supSubGroup.height);

    // Accents should always be ords, even when their innards are not.
    supSubGroup.classes[0] = "mord";
    return supSubGroup;
  } else {
    return accentWrap;
  }
};
const mathmlBuilder = (group, options) => {
  const accentNode = group.isStretchy ? stretchyMathML(group.label) : new MathNode("mo", [makeText(group.label, group.mode)]);
  const node = new MathNode("mover", [buildMathML_buildGroup(group.base, options), accentNode]);
  node.setAttribute("accent", "true");
  return node;
};
const NON_STRETCHY_ACCENT_REGEX = new RegExp(["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring"].map(accent => "\\" + accent).join("|"));

// Accents
defineFunction({
  type: "accent",
  names: ["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring", "\\widecheck", "\\widehat", "\\widetilde", "\\overrightarrow", "\\overleftarrow", "\\Overrightarrow", "\\overleftrightarrow", "\\overgroup", "\\overlinesegment", "\\overleftharpoon", "\\overrightharpoon"],
  props: {
    numArgs: 1
  },
  handler: (context, args) => {
    const base = normalizeArgument(args[0]);
    const isStretchy = !NON_STRETCHY_ACCENT_REGEX.test(context.funcName);
    const isShifty = !isStretchy || context.funcName === "\\widehat" || context.funcName === "\\widetilde" || context.funcName === "\\widecheck";
    return {
      type: "accent",
      mode: context.parser.mode,
      label: context.funcName,
      isStretchy: isStretchy,
      isShifty: isShifty,
      base: base
    };
  },
  htmlBuilder,
  mathmlBuilder
});

// Text-mode accents
defineFunction({
  type: "accent",
  names: ["\\'", "\\`", "\\^", "\\~", "\\=", "\\u", "\\.", '\\"', "\\c", "\\r", "\\H", "\\v", "\\textcircled"],
  props: {
    numArgs: 1,
    allowedInText: true,
    allowedInMath: true,
    // unless in strict mode
    argTypes: ["primitive"]
  },
  handler: (context, args) => {
    const base = args[0];
    let mode = context.parser.mode;
    if (mode === "math") {
      context.parser.settings.reportNonstrict("mathVsTextAccents", "LaTeX's accent " + context.funcName + " works only in text mode");
      mode = "text";
    }
    return {
      type: "accent",
      mode: mode,
      label: context.funcName,
      isStretchy: false,
      isShifty: true,
      base: base
    };
  },
  htmlBuilder,
  mathmlBuilder
});
;// ./src/functions/accentunder.ts
// Horizontal overlap functions






defineFunction({
  type: "accentUnder",
  names: ["\\underleftarrow", "\\underrightarrow", "\\underleftrightarrow", "\\undergroup", "\\underlinesegment", "\\utilde"],
  props: {
    numArgs: 1
  },
  handler: (_ref, args) => {
    let {
      parser,
      funcName
    } = _ref;
    const base = args[0];
    return {
      type: "accentUnder",
      mode: parser.mode,
      label: funcName,
      base: base
    };
  },
  htmlBuilder: (group, options) => {
    // Treat under accents much like underlines.
    const innerGroup = buildGroup(group.base, options);
    const accentBody = stretchySvg(group, options);
    const kern = group.label === "\\utilde" ? 0.12 : 0;

    // Generate the vlist, with the appropriate kerns
    const vlist = makeVList({
      positionType: "top",
      positionData: innerGroup.height,
      children: [{
        type: "elem",
        elem: accentBody,
        wrapperClasses: ["svg-align"]
      }, {
        type: "kern",
        size: kern
      }, {
        type: "elem",
        elem: innerGroup
      }]
    }, options);
    return makeSpan(["mord", "accentunder"], [vlist], options);
  },
  mathmlBuilder: (group, options) => {
    const accentNode = stretchyMathML(group.label);
    const node = new MathNode("munder", [buildMathML_buildGroup(group.base, options), accentNode]);
    node.setAttribute("accentunder", "true");
    return node;
  }
});
;// ./src/functions/arrow.ts






// Helper function
const paddedNode = group => {
  const node = new MathNode("mpadded", group ? [group] : []);
  node.setAttribute("width", "+0.6em");
  node.setAttribute("lspace", "0.3em");
  return node;
};

// Stretchy arrows with an optional argument
defineFunction({
  type: "xArrow",
  names: ["\\xleftarrow", "\\xrightarrow", "\\xLeftarrow", "\\xRightarrow", "\\xleftrightarrow", "\\xLeftrightarrow", "\\xhookleftarrow", "\\xhookrightarrow", "\\xmapsto", "\\xrightharpoondown", "\\xrightharpoonup", "\\xleftharpoondown", "\\xleftharpoonup", "\\xrightleftharpoons", "\\xleftrightharpoons", "\\xlongequal", "\\xtwoheadrightarrow", "\\xtwoheadleftarrow", "\\xtofrom",
  // The next 3 functions are here to support the mhchem extension.
  // Direct use of these functions is discouraged and may break someday.
  "\\xrightleftarrows", "\\xrightequilibrium", "\\xleftequilibrium",
  // The next 3 functions are here only to support the {CD} environment.
  "\\\\cdrightarrow", "\\\\cdleftarrow", "\\\\cdlongequal"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1
  },
  handler(_ref, args, optArgs) {
    let {
      parser,
      funcName
    } = _ref;
    return {
      type: "xArrow",
      mode: parser.mode,
      label: funcName,
      body: args[0],
      below: optArgs[0]
    };
  },
  htmlBuilder(group, options) {
    const style = options.style;

    // Build the argument groups in the appropriate style.
    // Ref: amsmath.dtx:   \hbox{$\scriptstyle\mkern#3mu{#6}\mkern#4mu$}%

    // Some groups can return document fragments.  Handle those by wrapping
    // them in a span.
    let newOptions = options.havingStyle(style.sup());
    const upperGroup = wrapFragment(buildGroup(group.body, newOptions, options), options);
    const arrowPrefix = group.label.slice(0, 2) === "\\x" ? "x" : "cd";
    upperGroup.classes.push(arrowPrefix + "-arrow-pad");
    let lowerGroup;
    if (group.below) {
      // Build the lower group
      newOptions = options.havingStyle(style.sub());
      lowerGroup = wrapFragment(buildGroup(group.below, newOptions, options), options);
      lowerGroup.classes.push(arrowPrefix + "-arrow-pad");
    }
    const arrowBody = stretchySvg(group, options);

    // Re shift: Note that stretchySvg returned arrowBody.depth = 0.
    // The point we want on the math axis is at 0.5 * arrowBody.height.
    const arrowShift = -options.fontMetrics().axisHeight + 0.5 * arrowBody.height;
    // 2 mu kern. Ref: amsmath.dtx: #7\if0#2\else\mkern#2mu\fi
    let upperShift = -options.fontMetrics().axisHeight - 0.5 * arrowBody.height - 0.111; // 0.111 em = 2 mu
    if (upperGroup.depth > 0.25 || group.label === "\\xleftequilibrium") {
      upperShift -= upperGroup.depth; // shift up if depth encroaches
    }

    // Generate the vlist
    let vlist;
    if (lowerGroup) {
      const lowerShift = -options.fontMetrics().axisHeight + lowerGroup.height + 0.5 * arrowBody.height + 0.111;
      vlist = makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: upperGroup,
          shift: upperShift
        }, {
          type: "elem",
          elem: arrowBody,
          shift: arrowShift,
          wrapperClasses: ["svg-align"]
        }, {
          type: "elem",
          elem: lowerGroup,
          shift: lowerShift
        }]
      }, options);
    } else {
      vlist = makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: upperGroup,
          shift: upperShift
        }, {
          type: "elem",
          elem: arrowBody,
          shift: arrowShift,
          wrapperClasses: ["svg-align"]
        }]
      }, options);
    }
    return makeSpan(["mrel", "x-arrow"], [vlist], options);
  },
  mathmlBuilder(group, options) {
    const arrowNode = stretchyMathML(group.label);
    arrowNode.setAttribute("minsize", group.label.charAt(0) === "x" ? "1.75em" : "3.0em");
    let node;
    if (group.body) {
      const upperNode = paddedNode(buildMathML_buildGroup(group.body, options));
      if (group.below) {
        const lowerNode = paddedNode(buildMathML_buildGroup(group.below, options));
        node = new MathNode("munderover", [arrowNode, lowerNode, upperNode]);
      } else {
        node = new MathNode("mover", [arrowNode, upperNode]);
      }
    } else if (group.below) {
      const lowerNode = paddedNode(buildMathML_buildGroup(group.below, options));
      node = new MathNode("munder", [arrowNode, lowerNode]);
    } else {
      // This should never happen.
      // Parser.js throws an error if there is no argument.
      node = paddedNode();
      node = new MathNode("mover", [arrowNode, node]);
    }
    return node;
  }
});
;// ./src/functions/mclass.ts






function mclass_htmlBuilder(group, options) {
  const elements = buildExpression(group.body, options, true);
  return makeSpan([group.mclass], elements, options);
}
function mclass_mathmlBuilder(group, options) {
  let node;
  const inner = buildMathML_buildExpression(group.body, options);
  if (group.mclass === "minner") {
    node = new MathNode("mpadded", inner);
  } else if (group.mclass === "mord") {
    if (group.isCharacterBox) {
      node = inner[0];
      node.type = "mi";
    } else {
      node = new MathNode("mi", inner);
    }
  } else {
    if (group.isCharacterBox) {
      node = inner[0];
      node.type = "mo";
    } else {
      node = new MathNode("mo", inner);
    }

    // Set spacing based on what is the most likely adjacent atom type.
    // See TeXbook p170.
    if (group.mclass === "mbin") {
      node.attributes.lspace = "0.22em"; // medium space
      node.attributes.rspace = "0.22em";
    } else if (group.mclass === "mpunct") {
      node.attributes.lspace = "0em";
      node.attributes.rspace = "0.17em"; // thinspace
    } else if (group.mclass === "mopen" || group.mclass === "mclose") {
      node.attributes.lspace = "0em";
      node.attributes.rspace = "0em";
    } else if (group.mclass === "minner") {
      node.attributes.lspace = "0.0556em"; // 1 mu is the most likely option
      node.attributes.width = "+0.1111em";
    }
    // MathML <mo> default space is 5/18 em, so <mrel> needs no action.
    // Ref: https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mo
  }
  return node;
}

// Math class commands except \mathop
defineFunction({
  type: "mclass",
  names: ["\\mathord", "\\mathbin", "\\mathrel", "\\mathopen", "\\mathclose", "\\mathpunct", "\\mathinner"],
  props: {
    numArgs: 1,
    primitive: true
  },
  handler(_ref, args) {
    let {
      parser,
      funcName
    } = _ref;
    const body = args[0];
    return {
      type: "mclass",
      mode: parser.mode,
      mclass: "m" + funcName.slice(5),
      // TODO(kevinb): don't prefix with 'm'
      body: ordargument(body),
      isCharacterBox: isCharacterBox(body)
    };
  },
  htmlBuilder: mclass_htmlBuilder,
  mathmlBuilder: mclass_mathmlBuilder
});
const binrelClass = arg => {
  // \binrel@ spacing varies with (bin|rel|ord) of the atom in the argument.
  // (by rendering separately and with {}s before and after, and measuring
  // the change in spacing).  We'll do roughly the same by detecting the
  // atom type directly.
  const atom = arg.type === "ordgroup" && arg.body.length ? arg.body[0] : arg;
  if (atom.type === "atom" && (atom.family === "bin" || atom.family === "rel")) {
    return "m" + atom.family;
  } else {
    return "mord";
  }
};

// \@binrel{x}{y} renders like y but as mbin/mrel/mord if x is mbin/mrel/mord.
// This is equivalent to \binrel@{x}\binrel@@{y} in AMSTeX.
defineFunction({
  type: "mclass",
  names: ["\\@binrel"],
  props: {
    numArgs: 2
  },
  handler(_ref2, args) {
    let {
      parser
    } = _ref2;
    return {
      type: "mclass",
      mode: parser.mode,
      mclass: binrelClass(args[0]),
      body: ordargument(args[1]),
      isCharacterBox: isCharacterBox(args[1])
    };
  }
});

// Build a relation or stacked op by placing one symbol on top of another
defineFunction({
  type: "mclass",
  names: ["\\stackrel", "\\overset", "\\underset"],
  props: {
    numArgs: 2
  },
  handler(_ref3, args) {
    let {
      parser,
      funcName
    } = _ref3;
    const baseArg = args[1];
    const shiftedArg = args[0];
    let mclass;
    if (funcName !== "\\stackrel") {
      // LaTeX applies \binrel spacing to \overset and \underset.
      mclass = binrelClass(baseArg);
    } else {
      mclass = "mrel"; // for \stackrel
    }
    const baseOp = {
      type: "op",
      mode: baseArg.mode,
      limits: true,
      alwaysHandleSupSub: true,
      parentIsSupSub: false,
      symbol: false,
      suppressBaseShift: funcName !== "\\stackrel",
      body: ordargument(baseArg)
    };
    const supsub = {
      type: "supsub",
      mode: shiftedArg.mode,
      base: baseOp,
      sup: funcName === "\\underset" ? null : shiftedArg,
      sub: funcName === "\\underset" ? shiftedArg : null
    };
    return {
      type: "mclass",
      mode: parser.mode,
      mclass,
      body: [supsub],
      isCharacterBox: isCharacterBox(supsub)
    };
  },
  htmlBuilder: mclass_htmlBuilder,
  mathmlBuilder: mclass_mathmlBuilder
});
;// ./src/functions/pmb.ts






// \pmb is a simulation of bold font.
// The version of \pmb in ambsy.sty works by typesetting three copies
// with small offsets. We use CSS text-shadow.
// It's a hack. Not as good as a real bold font. Better than nothing.

defineFunction({
  type: "pmb",
  names: ["\\pmb"],
  props: {
    numArgs: 1,
    allowedInText: true
  },
  handler(_ref, args) {
    let {
      parser
    } = _ref;
    return {
      type: "pmb",
      mode: parser.mode,
      mclass: binrelClass(args[0]),
      body: ordargument(args[0])
    };
  },
  htmlBuilder(group, options) {
    const elements = buildExpression(group.body, options, true);
    const node = makeSpan([group.mclass], elements, options);
    node.style.textShadow = "0.02em 0.01em 0.04px";
    return node;
  },
  mathmlBuilder(group, style) {
    const inner = buildMathML_buildExpression(group.body, style);
    // Wrap with an <mstyle> element.
    const node = new MathNode("mstyle", inner);
    node.setAttribute("style", "text-shadow: 0.02em 0.01em 0.04px");
    return node;
  }
});
;// ./src/environments/cd.ts








const cdArrowFunctionName = {
  ">": "\\\\cdrightarrow",
  "<": "\\\\cdleftarrow",
  "=": "\\\\cdlongequal",
  "A": "\\uparrow",
  "V": "\\downarrow",
  "|": "\\Vert",
  ".": "no arrow"
};
const newCell = () => {
  // Create an empty cell, to be filled below with parse nodes.
  // The parseTree from this module must be constructed like the
  // one created by parseArray(), so an empty CD cell must
  // be a ParseNode<"styling">. And CD is always displaystyle.
  return {
    type: "styling",
    body: [],
    mode: "math",
    style: "display",
    resetFont: true
  };
};
const isStartOfArrow = node => {
  return node.type === "textord" && node.text === "@";
};
const isLabelEnd = (node, endChar) => {
  return (node.type === "mathord" || node.type === "atom") && node.text === endChar;
};
function cdArrow(arrowChar, labels, parser) {
  // Return a parse tree of an arrow and its labels.
  // This acts in a way similar to a macro expansion.
  const funcName = cdArrowFunctionName[arrowChar];
  switch (funcName) {
    case "\\\\cdrightarrow":
    case "\\\\cdleftarrow":
      return parser.callFunction(funcName, [labels[0]], [labels[1]]);
    case "\\uparrow":
    case "\\downarrow":
      {
        const leftLabel = parser.callFunction("\\\\cdleft", [labels[0]], []);
        const bareArrow = {
          type: "atom",
          text: funcName,
          mode: "math",
          family: "rel"
        };
        const sizedArrow = parser.callFunction("\\Big", [bareArrow], []);
        const rightLabel = parser.callFunction("\\\\cdright", [labels[1]], []);
        const arrowGroup = {
          type: "ordgroup",
          mode: "math",
          body: [leftLabel, sizedArrow, rightLabel]
        };
        return parser.callFunction("\\\\cdparent", [arrowGroup], []);
      }
    case "\\\\cdlongequal":
      return parser.callFunction("\\\\cdlongequal", [], []);
    case "\\Vert":
      {
        const arrow = {
          type: "textord",
          text: "\\Vert",
          mode: "math"
        };
        return parser.callFunction("\\Big", [arrow], []);
      }
    default:
      return {
        type: "textord",
        text: " ",
        mode: "math"
      };
  }
}
function parseCD(parser) {
  // Get the array's parse nodes with \\ temporarily mapped to \cr.
  const parsedRows = [];
  parser.gullet.beginGroup();
  parser.gullet.macros.set("\\cr", "\\\\\\relax");
  parser.gullet.beginGroup();
  while (true) {
    // Get the parse nodes for the next row.
    parsedRows.push(parser.parseExpression(false, "\\\\"));
    parser.gullet.endGroup();
    parser.gullet.beginGroup();
    const next = parser.fetch().text;
    if (next === "&" || next === "\\\\") {
      parser.consume();
    } else if (next === "\\end") {
      if (parsedRows[parsedRows.length - 1].length === 0) {
        parsedRows.pop(); // final row ended in \\
      }
      break;
    } else {
      throw new src_ParseError("Expected \\\\ or \\cr or \\end", parser.nextToken);
    }
  }
  let row = [];
  const body = [row];

  // Loop thru the parse nodes. Collect them into cells and arrows.
  for (let i = 0; i < parsedRows.length; i++) {
    // Start a new row.
    const rowNodes = parsedRows[i];
    // Create the first cell.
    let cell = newCell();
    for (let j = 0; j < rowNodes.length; j++) {
      if (!isStartOfArrow(rowNodes[j])) {
        // If a parseNode is not an arrow, it goes into a cell.
        cell.body.push(rowNodes[j]);
      } else {
        // Parse node j is an "@", the start of an arrow.
        // Before starting on the arrow, push the cell into `row`.
        row.push(cell);

        // Now collect parseNodes into an arrow.
        // The character after "@" defines the arrow type.
        j += 1;
        const arrowChar = assertSymbolNodeType(rowNodes[j]).text;

        // Create two empty label nodes. We may or may not use them.
        const labels = new Array(2);
        labels[0] = {
          type: "ordgroup",
          mode: "math",
          body: []
        };
        labels[1] = {
          type: "ordgroup",
          mode: "math",
          body: []
        };

        // Process the arrow.
        if ("=|.".includes(arrowChar)) {
          // Three "arrows", ``@=`, `@|`, and `@.`, do not take labels.
          // Do nothing here.
        } else if ("<>AV".includes(arrowChar)) {
          // Four arrows, `@>>>`, `@<<<`, `@AAA`, and `@VVV`, each take
          // two optional labels. E.g. the right-point arrow syntax is
          // really:  @>{optional label}>{optional label}>
          // Collect parseNodes into labels.
          for (let labelNum = 0; labelNum < 2; labelNum++) {
            let inLabel = true;
            for (let k = j + 1; k < rowNodes.length; k++) {
              if (isLabelEnd(rowNodes[k], arrowChar)) {
                inLabel = false;
                j = k;
                break;
              }
              if (isStartOfArrow(rowNodes[k])) {
                throw new src_ParseError("Missing a " + arrowChar + " character to complete a CD arrow.", rowNodes[k]);
              }
              labels[labelNum].body.push(rowNodes[k]);
            }
            if (inLabel) {
              // isLabelEnd never returned a true.
              throw new src_ParseError("Missing a " + arrowChar + " character to complete a CD arrow.", rowNodes[j]);
            }
          }
        } else {
          throw new src_ParseError("Expected one of \"<>AV=|.\" after @", rowNodes[j]);
        }

        // Now join the arrow to its labels.
        const arrow = cdArrow(arrowChar, labels, parser);

        // Wrap the arrow in  ParseNode<"styling">.
        // This is done to match parseArray() behavior.
        const wrappedArrow = {
          type: "styling",
          body: [arrow],
          mode: "math",
          style: "display",
          // CD is always displaystyle.
          resetFont: true
        };
        row.push(wrappedArrow);
        // In CD's syntax, cells are implicit. That is, everything that
        // is not an arrow gets collected into a cell. So create an empty
        // cell now. It will collect upcoming parseNodes.
        cell = newCell();
      }
    }
    if (i % 2 === 0) {
      // Even-numbered rows consist of: cell, arrow, cell, arrow, ... cell
      // The last cell is not yet pushed into `row`, so:
      row.push(cell);
    } else {
      // Odd-numbered rows consist of: vert arrow, empty cell, ... vert arrow
      // Remove the empty cell that was placed at the beginning of `row`.
      row.shift();
    }
    row = [];
    body.push(row);
  }

  // End row group
  parser.gullet.endGroup();
  // End array group defining \\
  parser.gullet.endGroup();

  // define column separation.
  const cols = new Array(body[0].length).fill({
    type: "align",
    align: "c",
    pregap: 0.25,
    // CD package sets \enskip between columns.
    postgap: 0.25 // So pre and post each get half an \enskip, i.e. 0.25em.
  });
  return {
    type: "array",
    mode: "math",
    body,
    arraystretch: 1,
    addJot: true,
    rowGaps: [null],
    cols,
    colSeparationType: "CD",
    hLinesBeforeRow: new Array(body.length + 1).fill([])
  };
}

// The functions below are not available for general use.
// They are here only for internal use by the {CD} environment in placing labels
// next to vertical arrows.

// We don't need any such functions for horizontal arrows because we can reuse
// the functionality that already exists for extensible arrows.

defineFunction({
  type: "cdlabel",
  names: ["\\\\cdleft", "\\\\cdright"],
  props: {
    numArgs: 1
  },
  handler(_ref, args) {
    let {
      parser,
      funcName
    } = _ref;
    return {
      type: "cdlabel",
      mode: parser.mode,
      side: funcName.slice(4),
      label: args[0]
    };
  },
  htmlBuilder(group, options) {
    const newOptions = options.havingStyle(options.style.sup());
    const label = wrapFragment(buildGroup(group.label, newOptions, options), options);
    label.classes.push("cd-label-" + group.side);
    label.style.bottom = makeEm(0.8 - label.depth);
    // Zero out label height & depth, so vertical align of arrow is set
    // by the arrow height, not by the label.
    label.height = 0;
    label.depth = 0;
    return label;
  },
  mathmlBuilder(group, options) {
    let label = new MathNode("mrow", [buildMathML_buildGroup(group.label, options)]);
    label = new MathNode("mpadded", [label]);
    label.setAttribute("width", "0");
    if (group.side === "left") {
      label.setAttribute("lspace", "-1width");
    }
    // We have to guess at vertical alignment. We know the arrow is 1.8em tall,
    // But we don't know the height or depth of the label.
    label.setAttribute("voffset", "0.7em");
    label = new MathNode("mstyle", [label]);
    label.setAttribute("displaystyle", "false");
    label.setAttribute("scriptlevel", "1");
    return label;
  }
});
defineFunction({
  type: "cdlabelparent",
  names: ["\\\\cdparent"],
  props: {
    numArgs: 1
  },
  handler(_ref2, args) {
    let {
      parser
    } = _ref2;
    return {
      type: "cdlabelparent",
      mode: parser.mode,
      fragment: args[0]
    };
  },
  htmlBuilder(group, options) {
    // Wrap the vertical arrow and its labels.
    // The parent gets position: relative. The child gets position: absolute.
    // So CSS can locate the label correctly.
    const parent = wrapFragment(buildGroup(group.fragment, options), options);
    parent.classes.push("cd-vert-arrow");
    return parent;
  },
  mathmlBuilder(group, options) {
    return new MathNode("mrow", [buildMathML_buildGroup(group.fragment, options)]);
  }
});
;// ./src/functions/char.ts




// \@char is an internal function that takes a grouped decimal argument like
// {123} and converts into symbol with code 123.  It is used by the *macro*
// \char defined in macros.js.
defineFunction({
  type: "textord",
  names: ["\\@char"],
  props: {
    numArgs: 1,
    allowedInText: true
  },
  handler(_ref, args) {
    let {
      parser
    } = _ref;
    const arg = assertNodeType(args[0], "ordgroup");
    const group = arg.body;
    let number = "";
    for (let i = 0; i < group.length; i++) {
      const node = assertNodeType(group[i], "textord");
      number += node.text;
    }
    let code = parseInt(number);
    let text;
    if (isNaN(code)) {
      throw new src_ParseError("\\@char has non-numeric argument " + number);
      // If we drop IE support, the following code could be replaced with
      // text = String.fromCodePoint(code)
    } else if (code < 0 || code >= 0x10ffff) {
      throw new src_ParseError("\\@char with invalid code point " + number);
    } else if (code <= 0xffff) {
      text = String.fromCharCode(code);
    } else {
      // Astral code point; split into surrogate halves
      code -= 0x10000;
      text = String.fromCharCode((code >> 10) + 0xd800, (code & 0x3ff) + 0xdc00);
    }
    return {
      type: "textord",
      mode: parser.mode,
      text: text
    };
  }
});
;// ./src/functions/color.ts






const color_htmlBuilder = (group, options) => {
  const elements = buildExpression(group.body, options.withColor(group.color), false);

  // \color isn't supposed to affect the type of the elements it contains.
  // To accomplish this, we wrap the results in a fragment, so the inner
  // elements will be able to directly interact with their neighbors. For
  // example, `\color{red}{2 +} 3` has the same spacing as `2 + 3`
  return makeFragment(elements);
};
const color_mathmlBuilder = (group, options) => {
  const inner = buildMathML_buildExpression(group.body, options.withColor(group.color));
  const node = new MathNode("mstyle", inner);
  node.setAttribute("mathcolor", group.color);
  return node;
};
defineFunction({
  type: "color",
  names: ["\\textcolor"],
  props: {
    numArgs: 2,
    allowedInText: true,
    argTypes: ["color", "original"]
  },
  handler(_ref, args) {
    let {
      parser
    } = _ref;
    const color = assertNodeType(args[0], "color-token").color;
    const body = args[1];
    return {
      type: "color",
      mode: parser.mode,
      color,
      body: ordargument(body)
    };
  },
  htmlBuilder: color_htmlBuilder,
  mathmlBuilder: color_mathmlBuilder
});
defineFunction({
  type: "color",
  names: ["\\color"],
  props: {
    numArgs: 1,
    allowedInText: true,
    argTypes: ["color"]
  },
  handler(_ref2, args) {
    let {
      parser,
      breakOnTokenText
    } = _ref2;
    const color = assertNodeType(args[0], "color-token").color;

    // Set macro \current@color in current namespace to store the current
    // color, mimicking the behavior of color.sty.
    // This is currently used just to correctly color a \right
    // that follows a \color command.
    parser.gullet.macros.set("\\current@color", color);

    // Parse out the implicit body that should be colored.
    const body = parser.parseExpression(true, breakOnTokenText);
    return {
      type: "color",
      mode: parser.mode,
      color,
      body
    };
  },
  htmlBuilder: color_htmlBuilder,
  mathmlBuilder: color_mathmlBuilder
});
;// ./src/functions/cr.ts
// Row breaks within tabular environments, and line breaks at top level







// \DeclareRobustCommand\\{...\@xnewline}
defineFunction({
  type: "cr",
  names: ["\\\\"],
  props: {
    numArgs: 0,
    numOptionalArgs: 0,
    allowedInText: true
  },
  handler(_ref, args, optArgs) {
    let {
      parser
    } = _ref;
    const size = parser.gullet.future().text === "[" ? parser.parseSizeGroup(true) : null;
    const newLine = !parser.settings.displayMode || !parser.settings.useStrictBehavior("newLineInDisplayMode", "In LaTeX, \\\\ or \\newline " + "does nothing in display mode");
    return {
      type: "cr",
      mode: parser.mode,
      newLine,
      size: size && assertNodeType(size, "size").value
    };
  },
  // The following builders are called only at the top level,
  // not within tabular/array environments.

  htmlBuilder(group, options) {
    const span = makeSpan(["mspace"], [], options);
    if (group.newLine) {
      span.classes.push("newline");
      if (group.size) {
        span.style.marginTop = makeEm(calculateSize(group.size, options));
      }
    }
    return span;
  },
  mathmlBuilder(group, options) {
    const node = new MathNode("mspace");
    if (group.newLine) {
      node.setAttribute("linebreak", "newline");
      if (group.size) {
        node.setAttribute("height", makeEm(calculateSize(group.size, options)));
      }
    }
    return node;
  }
});
;// ./src/functions/def.ts



const globalMap = {
  "\\global": "\\global",
  "\\long": "\\\\globallong",
  "\\\\globallong": "\\\\globallong",   
  "\\def": "\\gdef",
  "\\gdef": "\\gdef",
  "\\edef": "\\xdef",
  "\\xdef": "\\xdef",
  "\\let": "\\\\globallet",
  "\\futurelet": "\\\\globalfuture"
};
const checkControlSequence = tok => {
  const name = tok.text;
  if (/^(?:[\\{}$&#^_]|EOF)$/.test(name)) {
    throw new src_ParseError("Expected a control sequence", tok);
  }
  return name;
};
const getRHS = parser => {
  let tok = parser.gullet.popToken();
  if (tok.text === "=") {
    // consume optional equals
    tok = parser.gullet.popToken();
    if (tok.text === " ") {
      // consume one optional space
      tok = parser.gullet.popToken();
    }
  }
  return tok;
};
const letCommand = (parser, name, tok, global) => {
  let macro = parser.gullet.macros.get(tok.text);
  if (macro == null) {
    // don't expand it later even if a macro with the same name is defined
    // e.g., \let\foo=\frac \def\frac{\relax} \frac12
    tok.noexpand = true;
    macro = {
      tokens: [tok],
      numArgs: 0,
      // reproduce the same behavior in expansion
      unexpandable: !parser.gullet.isExpandable(tok.text)
    };
  }
  parser.gullet.macros.set(name, macro, global);
};

// <assignment> -> <non-macro assignment>|<macro assignment>
// <non-macro assignment> -> <simple assignment>|\global<non-macro assignment>
// <macro assignment> -> <definition>|<prefix><macro assignment>
// <prefix> -> \global|\long|\outer
defineFunction({
  type: "internal",
  names: ["\\global", "\\long", "\\\\globallong" // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: true
  },
  handler(_ref) {
    let {
      parser,
      funcName
    } = _ref;
    parser.consumeSpaces();
    const token = parser.fetch();
    if (globalMap[token.text]) {
      // KaTeX doesn't have \par, so ignore \long
      if (funcName === "\\global" || funcName === "\\\\globallong") {
        token.text = globalMap[token.text];
      }
      return assertNodeType(parser.parseFunction(), "internal");
    }
    throw new src_ParseError("Invalid token after macro prefix", token);
  }
});

// Basic support for macro definitions: \def, \gdef, \edef, \xdef
// <definition> -> <def><control sequence><definition text>
// <def> -> \def|\gdef|\edef|\xdef
// <definition text> -> <parameter text><left brace><balanced text><right brace>
defineFunction({
  type: "internal",
  names: ["\\def", "\\gdef", "\\edef", "\\xdef"],
  props: {
    numArgs: 0,
    allowedInText: true,
    primitive: true
  },
  handler(_ref2) {
    let {
      parser,
      funcName
    } = _ref2;
    let tok = parser.gullet.popToken();
    const name = tok.text;
    if (/^(?:[\\{}$&#^_]|EOF)$/.test(name)) {
      throw new src_ParseError("Expected a control sequence", tok);
    }
    let numArgs = 0;
    let insert;
    const delimiters = [[]];
    // <parameter text> contains no braces
    while (parser.gullet.future().text !== "{") {
      tok = parser.gullet.popToken();
      if (tok.text === "#") {
        // If the very last character of the <parameter text> is #, so that
        // this # is immediately followed by {, TeX will behave as if the {
        // had been inserted at the right end of both the parameter text
        // and the replacement text.
        if (parser.gullet.future().text === "{") {
          insert = parser.gullet.future();
          delimiters[numArgs].push("{");
          break;
        }

        // A parameter, the first appearance of # must be followed by 1,
        // the next by 2, and so on; up to nine #’s are allowed
        tok = parser.gullet.popToken();
        if (!/^[1-9]$/.test(tok.text)) {
          throw new src_ParseError("Invalid argument number \"" + tok.text + "\"");
        }
        if (parseInt(tok.text) !== numArgs + 1) {
          throw new src_ParseError("Argument number \"" + tok.text + "\" out of order");
        }
        numArgs++;
        delimiters.push([]);
      } else if (tok.text === "EOF") {
        throw new src_ParseError("Expected a macro definition");
      } else {
        delimiters[numArgs].push(tok.text);
      }
    }
    // replacement text, enclosed in '{' and '}' and properly nested
    let {
      tokens
    } = parser.gullet.consumeArg();
    if (insert) {
      tokens.unshift(insert);
    }
    if (funcName === "\\edef" || funcName === "\\xdef") {
      tokens = parser.gullet.expandTokens(tokens);
      tokens.reverse(); // to fit in with stack order
    }
    // Final arg is the expansion of the macro
    parser.gullet.macros.set(name, {
      tokens,
      numArgs,
      delimiters
    }, funcName === globalMap[funcName]);
    return {
      type: "internal",
      mode: parser.mode
    };
  }
});

// <simple assignment> -> <let assignment>
// <let assignment> -> \futurelet<control sequence><token><token>
//     | \let<control sequence><equals><one optional space><token>
// <equals> -> <optional spaces>|<optional spaces>=
defineFunction({
  type: "internal",
  names: ["\\let", "\\\\globallet" // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: true,
    primitive: true
  },
  handler(_ref3) {
    let {
      parser,
      funcName
    } = _ref3;
    const name = checkControlSequence(parser.gullet.popToken());
    parser.gullet.consumeSpaces();
    const tok = getRHS(parser);
    letCommand(parser, name, tok, funcName === "\\\\globallet");
    return {
      type: "internal",
      mode: parser.mode
    };
  }
});

// ref: https://www.tug.org/TUGboat/tb09-3/tb22bechtolsheim.pdf
defineFunction({
  type: "internal",
  names: ["\\futurelet", "\\\\globalfuture" // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: true,
    primitive: true
  },
  handler(_ref4) {
    let {
      parser,
      funcName
    } = _ref4;
    const name = checkControlSequence(parser.gullet.popToken());
    const middle = parser.gullet.popToken();
    const tok = parser.gullet.popToken();
    letCommand(parser, name, tok, funcName === "\\\\globalfuture");
    parser.gullet.pushToken(tok);
    parser.gullet.pushToken(middle);
    return {
      type: "internal",
      mode: parser.mode
    };
  }
});
;// ./src/delimiter.ts
/**
 * This file deals with creating delimiters of various sizes. The TeXbook
 * discusses these routines on page 441-442, in the "Another subroutine sets box
 * x to a specified variable delimiter" paragraph.
 *
 * There are three main routines here. `makeSmallDelim` makes a delimiter in the
 * normal font, but in either text, script, or scriptscript style.
 * `makeLargeDelim` makes a delimiter in textstyle, but in one of the Size1,
 * Size2, Size3, or Size4 fonts. `makeStackedDelim` makes a delimiter out of
 * smaller pieces that are stacked on top of one another.
 *
 * The functions take a parameter `center`, which determines if the delimiter
 * should be centered around the axis.
 *
 * Then, there are three exposed functions. `sizedDelim` makes a delimiter in
 * one of the given sizes. This is used for things like `\bigl`.
 * `customSizedDelim` makes a delimiter with a given total height+depth. It is
 * called in places like `\sqrt`. `leftRightDelim` makes an appropriate
 * delimiter which surrounds an expression of a given height an depth. It is
 * used in `\left` and `\right`.
 */










/**
 * Get the metrics for a given symbol and font, after transformation (i.e.
 * after following replacement from symbols.js)
 */
const getMetrics = function (symbol, font, mode) {
  const replace = src_symbols.math[symbol] && src_symbols.math[symbol].replace;
  const metrics = getCharacterMetrics(replace || symbol, font, mode);
  if (!metrics) {
    throw new Error("Unsupported symbol " + symbol + " and font size " + font + ".");
  }
  return metrics;
};

/**
 * Puts a delimiter span in a given style, and adds appropriate height, depth,
 * and maxFontSizes.
 */
const styleWrap = function (delim, toStyle, options, classes) {
  const newOptions = options.havingBaseStyle(toStyle);
  const span = makeSpan(classes.concat(newOptions.sizingClasses(options)), [delim], options);
  const delimSizeMultiplier = newOptions.sizeMultiplier / options.sizeMultiplier;
  span.height *= delimSizeMultiplier;
  span.depth *= delimSizeMultiplier;
  span.maxFontSize = newOptions.sizeMultiplier;
  return span;
};
const centerSpan = function (span, options, style) {
  const newOptions = options.havingBaseStyle(style);
  const shift = (1 - options.sizeMultiplier / newOptions.sizeMultiplier) * options.fontMetrics().axisHeight;
  span.classes.push("delimcenter");
  span.style.top = makeEm(shift);
  span.height -= shift;
  span.depth += shift;
};

/**
 * Makes a small delimiter. This is a delimiter that comes in the Main-Regular
 * font, but is restyled to either be in textstyle, scriptstyle, or
 * scriptscriptstyle.
 */
const makeSmallDelim = function (delim, style, center, options, mode, classes) {
  const text = makeSymbol(delim, "Main-Regular", mode, options);
  const span = styleWrap(text, style, options, classes);
  if (center) {
    centerSpan(span, options, style);
  }
  return span;
};

/**
 * Builds a symbol in the given font size (note size is an integer)
 */
const mathrmSize = function (value, size, mode, options) {
  return makeSymbol(value, "Size" + size + "-Regular", mode, options);
};

/**
 * Makes a large delimiter. This is a delimiter that comes in the Size1, Size2,
 * Size3, or Size4 fonts. It is always rendered in textstyle.
 */
const makeLargeDelim = function (delim, size, center, options, mode, classes) {
  const inner = mathrmSize(delim, size, mode, options);
  const span = styleWrap(makeSpan(["delimsizing", "size" + size], [inner], options), src_Style.TEXT, options, classes);
  if (center) {
    centerSpan(span, options, src_Style.TEXT);
  }
  return span;
};

/**
 * Make a span from a font glyph with the given offset and in the given font.
 * This is used in makeStackedDelim to make the stacking pieces for the delimiter.
 */
const makeGlyphSpan = function (symbol, font, mode) {
  let sizeClass;
  // Apply the correct CSS class to choose the right font.
  if (font === "Size1-Regular") {
    sizeClass = "delim-size1";
  } else /* if (font === "Size4-Regular") */{
      sizeClass = "delim-size4";
    }
  const corner = makeSpan(["delimsizinginner", sizeClass], [makeSpan([], [makeSymbol(symbol, font, mode)])]);

  // Since this will be passed into `makeVList` in the end, wrap the element
  // in the appropriate tag that VList uses.
  return {
    type: "elem",
    elem: corner
  };
};
const makeInner = function (ch, height, options) {
  // Create a span with inline SVG for the inner part of a tall stacked delimiter.
  const width = fontMetricsData['Size4-Regular'][ch.charCodeAt(0)] ? fontMetricsData['Size4-Regular'][ch.charCodeAt(0)][4] : fontMetricsData['Size1-Regular'][ch.charCodeAt(0)][4];
  const path = new PathNode("inner", innerPath(ch, Math.round(1000 * height)));
  const svgNode = new SvgNode([path], {
    "width": makeEm(width),
    "height": makeEm(height),
    // Override CSS rule `.katex svg { width: 100% }`
    "style": "width:" + makeEm(width),
    "viewBox": "0 0 " + 1000 * width + " " + Math.round(1000 * height),
    "preserveAspectRatio": "xMinYMin"
  });
  const span = makeSvgSpan([], [svgNode], options);
  span.height = height;
  span.style.height = makeEm(height);
  span.style.width = makeEm(width);
  return {
    type: "elem",
    elem: span
  };
};

// Helpers for makeStackedDelim
const lapInEms = 0.008;
const lap = {
  type: "kern",
  size: -1 * lapInEms
};
const verts = new Set(["|", "\\lvert", "\\rvert", "\\vert"]);
const doubleVerts = new Set(["\\|", "\\lVert", "\\rVert", "\\Vert"]);

/**
 * Make a stacked delimiter out of a given delimiter, with the total height at
 * least `heightTotal`. This routine is mentioned on page 442 of the TeXbook.
 */
const makeStackedDelim = function (delim, heightTotal, center, options, mode, classes) {
  // There are four parts, the top, an optional middle, a repeated part, and a
  // bottom.
  let top;
  let middle;
  let repeat;
  let bottom;
  let svgLabel = "";
  let viewBoxWidth = 0;
  top = repeat = bottom = delim;
  middle = null;
  // Also keep track of what font the delimiters are in
  let font = "Size1-Regular";

  // We set the parts and font based on the symbol. Note that we use
  // '\u23d0' instead of '|' and '\u2016' instead of '\\|' for the
  // repeats of the arrows
  if (delim === "\\uparrow") {
    repeat = bottom = "\u23d0";
  } else if (delim === "\\Uparrow") {
    repeat = bottom = "\u2016";
  } else if (delim === "\\downarrow") {
    top = repeat = "\u23d0";
  } else if (delim === "\\Downarrow") {
    top = repeat = "\u2016";
  } else if (delim === "\\updownarrow") {
    top = "\\uparrow";
    repeat = "\u23d0";
    bottom = "\\downarrow";
  } else if (delim === "\\Updownarrow") {
    top = "\\Uparrow";
    repeat = "\u2016";
    bottom = "\\Downarrow";
  } else if (verts.has(delim)) {
    repeat = "\u2223";
    svgLabel = "vert";
    viewBoxWidth = 333;
  } else if (doubleVerts.has(delim)) {
    repeat = "\u2225";
    svgLabel = "doublevert";
    viewBoxWidth = 556;
  } else if (delim === "[" || delim === "\\lbrack") {
    top = "\u23a1";
    repeat = "\u23a2";
    bottom = "\u23a3";
    font = "Size4-Regular";
    svgLabel = "lbrack";
    viewBoxWidth = 667;
  } else if (delim === "]" || delim === "\\rbrack") {
    top = "\u23a4";
    repeat = "\u23a5";
    bottom = "\u23a6";
    font = "Size4-Regular";
    svgLabel = "rbrack";
    viewBoxWidth = 667;
  } else if (delim === "\\lfloor" || delim === "\u230a") {
    repeat = top = "\u23a2";
    bottom = "\u23a3";
    font = "Size4-Regular";
    svgLabel = "lfloor";
    viewBoxWidth = 667;
  } else if (delim === "\\lceil" || delim === "\u2308") {
    top = "\u23a1";
    repeat = bottom = "\u23a2";
    font = "Size4-Regular";
    svgLabel = "lceil";
    viewBoxWidth = 667;
  } else if (delim === "\\rfloor" || delim === "\u230b") {
    repeat = top = "\u23a5";
    bottom = "\u23a6";
    font = "Size4-Regular";
    svgLabel = "rfloor";
    viewBoxWidth = 667;
  } else if (delim === "\\rceil" || delim === "\u2309") {
    top = "\u23a4";
    repeat = bottom = "\u23a5";
    font = "Size4-Regular";
    svgLabel = "rceil";
    viewBoxWidth = 667;
  } else if (delim === "(" || delim === "\\lparen") {
    top = "\u239b";
    repeat = "\u239c";
    bottom = "\u239d";
    font = "Size4-Regular";
    svgLabel = "lparen";
    viewBoxWidth = 875;
  } else if (delim === ")" || delim === "\\rparen") {
    top = "\u239e";
    repeat = "\u239f";
    bottom = "\u23a0";
    font = "Size4-Regular";
    svgLabel = "rparen";
    viewBoxWidth = 875;
  } else if (delim === "\\{" || delim === "\\lbrace") {
    top = "\u23a7";
    middle = "\u23a8";
    bottom = "\u23a9";
    repeat = "\u23aa";
    font = "Size4-Regular";
  } else if (delim === "\\}" || delim === "\\rbrace") {
    top = "\u23ab";
    middle = "\u23ac";
    bottom = "\u23ad";
    repeat = "\u23aa";
    font = "Size4-Regular";
  } else if (delim === "\\lgroup" || delim === "\u27ee") {
    top = "\u23a7";
    bottom = "\u23a9";
    repeat = "\u23aa";
    font = "Size4-Regular";
  } else if (delim === "\\rgroup" || delim === "\u27ef") {
    top = "\u23ab";
    bottom = "\u23ad";
    repeat = "\u23aa";
    font = "Size4-Regular";
  } else if (delim === "\\lmoustache" || delim === "\u23b0") {
    top = "\u23a7";
    bottom = "\u23ad";
    repeat = "\u23aa";
    font = "Size4-Regular";
  } else if (delim === "\\rmoustache" || delim === "\u23b1") {
    top = "\u23ab";
    bottom = "\u23a9";
    repeat = "\u23aa";
    font = "Size4-Regular";
  }

  // Get the metrics of the four sections
  const topMetrics = getMetrics(top, font, mode);
  const topHeightTotal = topMetrics.height + topMetrics.depth;
  const repeatMetrics = getMetrics(repeat, font, mode);
  const repeatHeightTotal = repeatMetrics.height + repeatMetrics.depth;
  const bottomMetrics = getMetrics(bottom, font, mode);
  const bottomHeightTotal = bottomMetrics.height + bottomMetrics.depth;
  let middleHeightTotal = 0;
  let middleFactor = 1;
  if (middle !== null) {
    const middleMetrics = getMetrics(middle, font, mode);
    middleHeightTotal = middleMetrics.height + middleMetrics.depth;
    middleFactor = 2; // repeat symmetrically above and below middle
  }

  // Calculate the minimal height that the delimiter can have.
  // It is at least the size of the top, bottom, and optional middle combined.
  const minHeight = topHeightTotal + bottomHeightTotal + middleHeightTotal;

  // Compute the number of copies of the repeat symbol we will need
  const repeatCount = Math.max(0, Math.ceil((heightTotal - minHeight) / (middleFactor * repeatHeightTotal)));

  // Compute the total height of the delimiter including all the symbols
  const realHeightTotal = minHeight + repeatCount * middleFactor * repeatHeightTotal;

  // The center of the delimiter is placed at the center of the axis. Note
  // that in this context, "center" means that the delimiter should be
  // centered around the axis in the current style, while normally it is
  // centered around the axis in textstyle.
  let axisHeight = options.fontMetrics().axisHeight;
  if (center) {
    axisHeight *= options.sizeMultiplier;
  }
  // Calculate the depth
  const depth = realHeightTotal / 2 - axisHeight;

  // Now, we start building the pieces that will go into the vlist
  // Keep a list of the pieces of the stacked delimiter
  const stack = [];
  if (svgLabel.length > 0) {
    // Instead of stacking glyphs, create a single SVG.
    // This evades browser problems with imprecise positioning of spans.
    const midHeight = realHeightTotal - topHeightTotal - bottomHeightTotal;
    const viewBoxHeight = Math.round(realHeightTotal * 1000);
    const pathStr = tallDelim(svgLabel, Math.round(midHeight * 1000));
    const path = new PathNode(svgLabel, pathStr);
    const width = makeEm(viewBoxWidth / 1000);
    const height = makeEm(viewBoxHeight / 1000);
    const svg = new SvgNode([path], {
      "width": width,
      "height": height,
      "viewBox": "0 0 " + viewBoxWidth + " " + viewBoxHeight
    });
    const wrapper = makeSvgSpan([], [svg], options);
    wrapper.height = viewBoxHeight / 1000;
    wrapper.style.width = width;
    wrapper.style.height = height;
    stack.push({
      type: "elem",
      elem: wrapper
    });
  } else {
    // Stack glyphs
    // Start by adding the bottom symbol
    stack.push(makeGlyphSpan(bottom, font, mode));
    stack.push(lap); // overlap

    if (middle === null) {
      // The middle section will be an SVG. Make it an extra 0.016em tall.
      // We'll overlap by 0.008em at top and bottom.
      const innerHeight = realHeightTotal - topHeightTotal - bottomHeightTotal + 2 * lapInEms;
      stack.push(makeInner(repeat, innerHeight, options));
    } else {
      // When there is a middle bit, we need the middle part and two repeated
      // sections
      const innerHeight = (realHeightTotal - topHeightTotal - bottomHeightTotal - middleHeightTotal) / 2 + 2 * lapInEms;
      stack.push(makeInner(repeat, innerHeight, options));
      // Now insert the middle of the brace.
      stack.push(lap);
      stack.push(makeGlyphSpan(middle, font, mode));
      stack.push(lap);
      stack.push(makeInner(repeat, innerHeight, options));
    }

    // Add the top symbol
    stack.push(lap);
    stack.push(makeGlyphSpan(top, font, mode));
  }

  // Finally, build the vlist
  const newOptions = options.havingBaseStyle(src_Style.TEXT);
  const inner = makeVList({
    positionType: "bottom",
    positionData: depth,
    children: stack
  }, newOptions);
  return styleWrap(makeSpan(["delimsizing", "mult"], [inner], newOptions), src_Style.TEXT, options, classes);
};

// All surds have 0.08em padding above the vinculum inside the SVG.
// That keeps browser span height rounding error from pinching the line.
const vbPad = 80; // padding above the surd, measured inside the viewBox.
const emPad = 0.08; // padding, in ems, measured in the document.

const sqrtSvg = function (sqrtName, height, viewBoxHeight, extraVinculum, options) {
  const path = sqrtPath(sqrtName, extraVinculum, viewBoxHeight);
  const pathNode = new PathNode(sqrtName, path);
  const svg = new SvgNode([pathNode], {
    // Note: 1000:1 ratio of viewBox to document em width.
    "width": "400em",
    "height": makeEm(height),
    "viewBox": "0 0 400000 " + viewBoxHeight,
    "preserveAspectRatio": "xMinYMin slice"
  });
  return makeSvgSpan(["hide-tail"], [svg], options);
};

/**
 * Make a sqrt image of the given height,
 */
const makeSqrtImage = function (height, options) {
  // Define a newOptions that removes the effect of size changes such as \Huge.
  // We don't pick different a height surd for \Huge. For it, we scale up.
  const newOptions = options.havingBaseSizing();

  // Pick the desired surd glyph from a sequence of surds.
  const delim = traverseSequence("\\surd", height * newOptions.sizeMultiplier, stackLargeDelimiterSequence, newOptions);
  let sizeMultiplier = newOptions.sizeMultiplier; // default

  // The standard sqrt SVGs each have a 0.04em thick vinculum.
  // If Settings.minRuleThickness is larger than that, we add extraVinculum.
  const extraVinculum = Math.max(0, options.minRuleThickness - options.fontMetrics().sqrtRuleThickness);

  // Create a span containing an SVG image of a sqrt symbol.
  let span;
  let spanHeight;
  let texHeight;
  let viewBoxHeight;
  let advanceWidth;

  // We create viewBoxes with 80 units of "padding" above each surd.
  // Then browser rounding error on the parent span height will not
  // encroach on the ink of the vinculum. But that padding is not
  // included in the TeX-like `height` used for calculation of
  // vertical alignment. So texHeight = span.height < span.style.height.

  if (delim.type === "small") {
    // Get an SVG that is derived from glyph U+221A in font KaTeX-Main.
    // 1000 unit normal glyph height.
    viewBoxHeight = 1000 + 1000 * extraVinculum + vbPad;
    if (height < 1.0) {
      sizeMultiplier = 1.0; // mimic a \textfont radical
    } else if (height < 1.4) {
      sizeMultiplier = 0.7; // mimic a \scriptfont radical
    }
    spanHeight = (1.0 + extraVinculum + emPad) / sizeMultiplier;
    texHeight = (1.00 + extraVinculum) / sizeMultiplier;
    span = sqrtSvg("sqrtMain", spanHeight, viewBoxHeight, extraVinculum, options);
    span.style.minWidth = "0.853em";
    advanceWidth = 0.833 / sizeMultiplier; // from the font.
  } else if (delim.type === "large") {
    // These SVGs come from fonts: KaTeX_Size1, _Size2, etc.
    viewBoxHeight = (1000 + vbPad) * sizeToMaxHeight[delim.size];
    texHeight = (sizeToMaxHeight[delim.size] + extraVinculum) / sizeMultiplier;
    spanHeight = (sizeToMaxHeight[delim.size] + extraVinculum + emPad) / sizeMultiplier;
    span = sqrtSvg("sqrtSize" + delim.size, spanHeight, viewBoxHeight, extraVinculum, options);
    span.style.minWidth = "1.02em";
    advanceWidth = 1.0 / sizeMultiplier; // 1.0 from the font.
  } else {
    // Tall sqrt. In TeX, this would be stacked using multiple glyphs.
    // We'll use a single SVG to accomplish the same thing.
    spanHeight = height + extraVinculum + emPad;
    texHeight = height + extraVinculum;
    viewBoxHeight = Math.floor(1000 * height + extraVinculum) + vbPad;
    span = sqrtSvg("sqrtTall", spanHeight, viewBoxHeight, extraVinculum, options);
    span.style.minWidth = "0.742em";
    advanceWidth = 1.056;
  }
  span.height = texHeight;
  span.style.height = makeEm(spanHeight);
  return {
    span,
    advanceWidth,
    // Calculate the actual line width.
    // This actually should depend on the chosen font -- e.g. \boldmath
    // should use the thicker surd symbols from e.g. KaTeX_Main-Bold, and
    // have thicker rules.
    ruleWidth: (options.fontMetrics().sqrtRuleThickness + extraVinculum) * sizeMultiplier
  };
};

// There are three kinds of delimiters, delimiters that stack when they become
// too large
const stackLargeDelimiters = new Set(["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "\u230a", "\u230b", "\\lceil", "\\rceil", "\u2308", "\u2309", "\\surd"]);

// delimiters that always stack
const stackAlwaysDelimiters = new Set(["\\uparrow", "\\downarrow", "\\updownarrow", "\\Uparrow", "\\Downarrow", "\\Updownarrow", "|", "\\|", "\\vert", "\\Vert", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "\u27ee", "\u27ef", "\\lmoustache", "\\rmoustache", "\u23b0", "\u23b1"]);

// and delimiters that never stack
const stackNeverDelimiters = new Set(["<", ">", "\\langle", "\\rangle", "/", "\\backslash", "\\lt", "\\gt"]);

// Metrics of the different sizes. Found by looking at TeX's output of
// $\bigl| // \Bigl| \biggl| \Biggl| \showlists$
// Used to create stacked delimiters of appropriate sizes in makeSizedDelim.
const sizeToMaxHeight = [0, 1.2, 1.8, 2.4, 3.0];

/**
 * Used to create a delimiter of a specific size, where `size` is 1, 2, 3, or 4.
 */
const makeSizedDelim = function (delim, size, options, mode, classes) {
  // < and > turn into \langle and \rangle in delimiters
  if (delim === "<" || delim === "\\lt" || delim === "\u27e8") {
    delim = "\\langle";
  } else if (delim === ">" || delim === "\\gt" || delim === "\u27e9") {
    delim = "\\rangle";
  }

  // Sized delimiters are never centered.
  if (stackLargeDelimiters.has(delim) || stackNeverDelimiters.has(delim)) {
    return makeLargeDelim(delim, size, false, options, mode, classes);
  } else if (stackAlwaysDelimiters.has(delim)) {
    return makeStackedDelim(delim, sizeToMaxHeight[size], false, options, mode, classes);
  } else {
    throw new src_ParseError("Illegal delimiter: '" + delim + "'");
  }
};

/**
 * There are three different sequences of delimiter sizes that the delimiters
 * follow depending on the kind of delimiter. This is used when creating custom
 * sized delimiters to decide whether to create a small, large, or stacked
 * delimiter.
 *
 * In real TeX, these sequences aren't explicitly defined, but are instead
 * defined inside the font metrics. Since there are only three sequences that
 * are possible for the delimiters that TeX defines, it is easier to just encode
 * them explicitly here.
 */

// Delimiters that never stack try small delimiters and large delimiters only
const stackNeverDelimiterSequence = [{
  type: "small",
  style: src_Style.SCRIPTSCRIPT
}, {
  type: "small",
  style: src_Style.SCRIPT
}, {
  type: "small",
  style: src_Style.TEXT
}, {
  type: "large",
  size: 1
}, {
  type: "large",
  size: 2
}, {
  type: "large",
  size: 3
}, {
  type: "large",
  size: 4
}];

// Delimiters that always stack try the small delimiters first, then stack
const stackAlwaysDelimiterSequence = [{
  type: "small",
  style: src_Style.SCRIPTSCRIPT
}, {
  type: "small",
  style: src_Style.SCRIPT
}, {
  type: "small",
  style: src_Style.TEXT
}, {
  type: "stack"
}];

// Delimiters that stack when large try the small and then large delimiters, and
// stack afterwards
const stackLargeDelimiterSequence = [{
  type: "small",
  style: src_Style.SCRIPTSCRIPT
}, {
  type: "small",
  style: src_Style.SCRIPT
}, {
  type: "small",
  style: src_Style.TEXT
}, {
  type: "large",
  size: 1
}, {
  type: "large",
  size: 2
}, {
  type: "large",
  size: 3
}, {
  type: "large",
  size: 4
}, {
  type: "stack"
}];

/**
 * Get the font used in a delimiter based on what kind of delimiter it is.
 * TODO(#963) Use more specific font family return type once that is introduced.
 */
const delimTypeToFont = function (type) {
  if (type.type === "small") {
    return "Main-Regular";
  } else if (type.type === "large") {
    return "Size" + type.size + "-Regular";
  } else if (type.type === "stack") {
    return "Size4-Regular";
  } else {
    const delimKind = type.type;
    throw new Error("Add support for delim type '" + delimKind + "' here.");
  }
};

/**
 * Traverse a sequence of types of delimiters to decide what kind of delimiter
 * should be used to create a delimiter of the given height+depth.
 */
const traverseSequence = function (delim, height, sequence, options) {
  // Here, we choose the index we should start at in the sequences. In smaller
  // sizes (which correspond to larger numbers in style.size) we start earlier
  // in the sequence. Thus, scriptscript starts at index 3-3=0, script starts
  // at index 3-2=1, text starts at 3-1=2, and display starts at min(2,3-0)=2
  const start = Math.min(2, 3 - options.style.size);
  for (let i = start; i < sequence.length; i++) {
    const delimType = sequence[i];
    if (delimType.type === "stack") {
      // This is always the last delimiter, so we just break the loop now.
      break;
    }
    const metrics = getMetrics(delim, delimTypeToFont(delimType), "math");
    let heightDepth = metrics.height + metrics.depth;

    // Small delimiters are scaled down versions of the same font, so we
    // account for the style change size.
    if (delimType.type === "small") {
      const newOptions = options.havingBaseStyle(delimType.style);
      heightDepth *= newOptions.sizeMultiplier;
    }

    // Check if the delimiter at this size works for the given height.
    if (heightDepth > height) {
      return delimType;
    }
  }

  // If we reached the end of the sequence, return the last sequence element.
  return sequence[sequence.length - 1];
};

/**
 * Make a delimiter of a given height+depth, with optional centering. Here, we
 * traverse the sequences, and create a delimiter that the sequence tells us to.
 */
const makeCustomSizedDelim = function (delim, height, center, options, mode, classes) {
  if (delim === "<" || delim === "\\lt" || delim === "\u27e8") {
    delim = "\\langle";
  } else if (delim === ">" || delim === "\\gt" || delim === "\u27e9") {
    delim = "\\rangle";
  }

  // Decide what sequence to use
  let sequence;
  if (stackNeverDelimiters.has(delim)) {
    sequence = stackNeverDelimiterSequence;
  } else if (stackLargeDelimiters.has(delim)) {
    sequence = stackLargeDelimiterSequence;
  } else {
    sequence = stackAlwaysDelimiterSequence;
  }

  // Look through the sequence
  const delimType = traverseSequence(delim, height, sequence, options);

  // Get the delimiter from font glyphs.
  // Depending on the sequence element we decided on, call the
  // appropriate function.
  if (delimType.type === "small") {
    return makeSmallDelim(delim, delimType.style, center, options, mode, classes);
  } else if (delimType.type === "large") {
    return makeLargeDelim(delim, delimType.size, center, options, mode, classes);
  } else /* if (delimType.type === "stack") */{
      return makeStackedDelim(delim, height, center, options, mode, classes);
    }
};

/**
 * Make a delimiter for use with `\left` and `\right`, given a height and depth
 * of an expression that the delimiters surround.
 */
const makeLeftRightDelim = function (delim, height, depth, options, mode, classes) {
  // We always center \left/\right delimiters, so the axis is always shifted
  const axisHeight = options.fontMetrics().axisHeight * options.sizeMultiplier;

  // Taken from TeX source, tex.web, function make_left_right
  const delimiterFactor = 901;
  const delimiterExtend = 5.0 / options.fontMetrics().ptPerEm;
  const maxDistFromAxis = Math.max(height - axisHeight, depth + axisHeight);
  const totalHeight = Math.max(
  // In real TeX, calculations are done using integral values which are
  // 65536 per pt, or 655360 per em. So, the division here truncates in
  // TeX but doesn't here, producing different results. If we wanted to
  // exactly match TeX's calculation, we could do
  //   Math.floor(655360 * maxDistFromAxis / 500) *
  //    delimiterFactor / 655360
  // (To see the difference, compare
  //    x^{x^{\left(\rule{0.1em}{0.68em}\right)}}
  // in TeX and KaTeX)
  maxDistFromAxis / 500 * delimiterFactor, 2 * maxDistFromAxis - delimiterExtend);

  // Finally, we defer to `makeCustomSizedDelim` with our calculated total
  // height
  return makeCustomSizedDelim(delim, totalHeight, true, options, mode, classes);
};
;// ./src/functions/delimsizing.ts









// Extra data needed for the delimiter handler down below
const delimiterSizes = {
  "\\bigl": {
    mclass: "mopen",
    size: 1
  },
  "\\Bigl": {
    mclass: "mopen",
    size: 2
  },
  "\\biggl": {
    mclass: "mopen",
    size: 3
  },
  "\\Biggl": {
    mclass: "mopen",
    size: 4
  },
  "\\bigr": {
    mclass: "mclose",
    size: 1
  },
  "\\Bigr": {
    mclass: "mclose",
    size: 2
  },
  "\\biggr": {
    mclass: "mclose",
    size: 3
  },
  "\\Biggr": {
    mclass: "mclose",
    size: 4
  },
  "\\bigm": {
    mclass: "mrel",
    size: 1
  },
  "\\Bigm": {
    mclass: "mrel",
    size: 2
  },
  "\\biggm": {
    mclass: "mrel",
    size: 3
  },
  "\\Biggm": {
    mclass: "mrel",
    size: 4
  },
  "\\big": {
    mclass: "mord",
    size: 1
  },
  "\\Big": {
    mclass: "mord",
    size: 2
  },
  "\\bigg": {
    mclass: "mord",
    size: 3
  },
  "\\Bigg": {
    mclass: "mord",
    size: 4
  }
};
const delimiters = new Set(["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "\u230a", "\u230b", "\\lceil", "\\rceil", "\u2308", "\u2309", "<", ">", "\\langle", "\u27e8", "\\rangle", "\u27e9", "\\lt", "\\gt", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "\u27ee", "\u27ef", "\\lmoustache", "\\rmoustache", "\u23b0", "\u23b1", "/", "\\backslash", "|", "\\vert", "\\|", "\\Vert", "\\uparrow", "\\Uparrow", "\\downarrow", "\\Downarrow", "\\updownarrow", "\\Updownarrow", "."]);

/**
 * An HtmlDomNode that carries an `isMiddle` property, used by the
 * \middle command to communicate delimiter info to the \left/\right builder.
 */

function isMiddleDelimNode(node) {
  return 'isMiddle' in node;
}

// Delimiter functions
function checkDelimiter(delim, context) {
  const symDelim = checkSymbolNodeType(delim);
  if (symDelim && delimiters.has(symDelim.text)) {
    return symDelim;
  } else if (symDelim) {
    throw new src_ParseError("Invalid delimiter '" + symDelim.text + "' after '" + context.funcName + "'", delim);
  } else {
    throw new src_ParseError("Invalid delimiter type '" + delim.type + "'", delim);
  }
}
defineFunction({
  type: "delimsizing",
  names: ["\\bigl", "\\Bigl", "\\biggl", "\\Biggl", "\\bigr", "\\Bigr", "\\biggr", "\\Biggr", "\\bigm", "\\Bigm", "\\biggm", "\\Biggm", "\\big", "\\Big", "\\bigg", "\\Bigg"],
  props: {
    numArgs: 1,
    argTypes: ["primitive"]
  },
  handler: (context, args) => {
    const delim = checkDelimiter(args[0], context);
    return {
      type: "delimsizing",
      mode: context.parser.mode,
      size: delimiterSizes[context.funcName].size,
      mclass: delimiterSizes[context.funcName].mclass,
      delim: delim.text
    };
  },
  htmlBuilder: (group, options) => {
    if (group.delim === ".") {
      // Empty delimiters still count as elements, even though they don't
      // show anything.
      return makeSpan([group.mclass]);
    }
    return makeSizedDelim(group.delim, group.size, options, group.mode, [group.mclass]);
  },
  mathmlBuilder: group => {
    const children = [];
    if (group.delim !== ".") {
      children.push(makeText(group.delim, group.mode));
    }
    const node = new MathNode("mo", children);
    if (group.mclass === "mopen" || group.mclass === "mclose") {
      // Only some of the delimsizing functions act as fences, and they
      // return "mopen" or "mclose" mclass.
      node.setAttribute("fence", "true");
    } else {
      // Explicitly disable fencing if it's not a fence, to override the
      // defaults.
      node.setAttribute("fence", "false");
    }
    node.setAttribute("stretchy", "true");
    const size = makeEm(sizeToMaxHeight[group.size]);
    node.setAttribute("minsize", size);
    node.setAttribute("maxsize", size);
    return node;
  }
});
function assertParsed(group) {
  if (!group.body) {
    throw new Error("Bug: The leftright ParseNode wasn't fully parsed.");
  }
}
defineFunction({
  type: "leftright-right",
  names: ["\\right"],
  props: {
    numArgs: 1,
    primitive: true
  },
  handler: (context, args) => {
    // \left case below triggers parsing of \right in
    //   `const right = parser.parseFunction();`
    // uses this return value.
    const color = context.parser.gullet.macros.get("\\current@color");
    if (color && typeof color !== "string") {
      throw new src_ParseError("\\current@color set to non-string in \\right");
    }
    return {
      type: "leftright-right",
      mode: context.parser.mode,
      delim: checkDelimiter(args[0], context).text,
      color: color // undefined if not set via \color
    };
  }
});
defineFunction({
  type: "leftright",
  names: ["\\left"],
  props: {
    numArgs: 1,
    primitive: true
  },
  handler: (context, args) => {
    const delim = checkDelimiter(args[0], context);
    const parser = context.parser;
    // Parse out the implicit body
    ++parser.leftrightDepth;
    // parseExpression stops before '\\right'
    const body = parser.parseExpression(false);
    --parser.leftrightDepth;
    // Check the next token
    parser.expect("\\right", false);
    const right = assertNodeType(parser.parseFunction(), "leftright-right");
    return {
      type: "leftright",
      mode: parser.mode,
      body,
      left: delim.text,
      right: right.delim,
      rightColor: right.color
    };
  },
  htmlBuilder: (group, options) => {
    assertParsed(group);
    // Build the inner expression
    const inner = buildExpression(group.body, options, true, ["mopen", "mclose"]);
    let innerHeight = 0;
    let innerDepth = 0;
    let hadMiddle = false;

    // Calculate its height and depth
    for (let i = 0; i < inner.length; i++) {
      const node = inner[i];
      if (isMiddleDelimNode(node)) {
        hadMiddle = true;
      } else {
        innerHeight = Math.max(inner[i].height, innerHeight);
        innerDepth = Math.max(inner[i].depth, innerDepth);
      }
    }

    // The size of delimiters is the same, regardless of what style we are
    // in. Thus, to correctly calculate the size of delimiter we need around
    // a group, we scale down the inner size based on the size.
    innerHeight *= options.sizeMultiplier;
    innerDepth *= options.sizeMultiplier;
    let leftDelim;
    if (group.left === ".") {
      // Empty delimiters in \left and \right make null delimiter spaces.
      leftDelim = makeNullDelimiter(options, ["mopen"]);
    } else {
      // Otherwise, use leftRightDelim to generate the correct sized
      // delimiter.
      leftDelim = makeLeftRightDelim(group.left, innerHeight, innerDepth, options, group.mode, ["mopen"]);
    }
    // Add it to the beginning of the expression
    inner.unshift(leftDelim);

    // Handle middle delimiters
    if (hadMiddle) {
      for (let i = 1; i < inner.length; i++) {
        const middleDelim = inner[i];
        if (isMiddleDelimNode(middleDelim)) {
          const isMiddle = middleDelim.isMiddle;
          // Apply the options that were active when \middle was called
          inner[i] = makeLeftRightDelim(isMiddle.delim, innerHeight, innerDepth, isMiddle.options, group.mode, []);
        }
      }
    }
    let rightDelim;
    // Same for the right delimiter, but using color specified by \color
    if (group.right === ".") {
      rightDelim = makeNullDelimiter(options, ["mclose"]);
    } else {
      const colorOptions = group.rightColor ? options.withColor(group.rightColor) : options;
      rightDelim = makeLeftRightDelim(group.right, innerHeight, innerDepth, colorOptions, group.mode, ["mclose"]);
    }
    // Add it to the end of the expression.
    inner.push(rightDelim);
    return makeSpan(["minner"], inner, options);
  },
  mathmlBuilder: (group, options) => {
    assertParsed(group);
    const inner = buildMathML_buildExpression(group.body, options);
    if (group.left !== ".") {
      const leftNode = new MathNode("mo", [makeText(group.left, group.mode)]);
      leftNode.setAttribute("fence", "true");
      inner.unshift(leftNode);
    }
    if (group.right !== ".") {
      const rightNode = new MathNode("mo", [makeText(group.right, group.mode)]);
      rightNode.setAttribute("fence", "true");
      if (group.rightColor) {
        rightNode.setAttribute("mathcolor", group.rightColor);
      }
      inner.push(rightNode);
    }
    return makeRow(inner);
  }
});
defineFunction({
  type: "middle",
  names: ["\\middle"],
  props: {
    numArgs: 1,
    primitive: true
  },
  handler: (context, args) => {
    const delim = checkDelimiter(args[0], context);
    if (!context.parser.leftrightDepth) {
      throw new src_ParseError("\\middle without preceding \\left", delim);
    }
    return {
      type: "middle",
      mode: context.parser.mode,
      delim: delim.text
    };
  },
  htmlBuilder: (group, options) => {
    let middleDelim;
    if (group.delim === ".") {
      middleDelim = makeNullDelimiter(options, []);
    } else {
      middleDelim = makeSizedDelim(group.delim, 1, options, group.mode, []);

      // Patch an ad-hoc property onto the node so the \left/\right
      // builder can reconstruct appropriately sized middle delimiters.
      // isMiddle is not part of HtmlDomNode; the read side uses
      // isMiddleDelimNode() to check before accessing.
      middleDelim.isMiddle = {
        delim: group.delim,
        options
      };
    }
    return middleDelim;
  },
  mathmlBuilder: (group, options) => {
    // A Firefox \middle will stretch a character vertically only if it
    // is in the fence part of the operator dictionary at:
    // https://www.w3.org/TR/MathML3/appendixc.html.
    // So we need to avoid U+2223 and use plain "|" instead.
    const textNode = group.delim === "\\vert" || group.delim === "|" ? makeText("|", "text") : makeText(group.delim, group.mode);
    const middleNode = new MathNode("mo", [textNode]);
    middleNode.setAttribute("fence", "true");
    // MathML gives 5/18em spacing to each <mo> element.
    // \middle should get delimiter spacing instead.
    middleNode.setAttribute("lspace", "0.05em");
    middleNode.setAttribute("rspace", "0.05em");
    return middleNode;
  }
});
;// ./src/functions/enclose.ts











const enclose_htmlBuilder = (group, options) => {
  // \cancel, \bcancel, \xcancel, \sout, \fbox, \colorbox, \fcolorbox, \phase
  // Some groups can return document fragments.  Handle those by wrapping
  // them in a span.
  const inner = wrapFragment(buildGroup(group.body, options), options);
  const label = group.label.slice(1);
  let scale = options.sizeMultiplier;
  let img;
  let imgShift;

  // In the LaTeX cancel package, line geometry is slightly different
  // depending on whether the subject is wider than it is tall, or vice versa.
  // We don't know the width of a group, so as a proxy, we test if
  // the subject is a single character. This captures most of the
  // subjects that should get the "tall" treatment.
  const isSingleChar = isCharacterBox(group.body);
  if (label === "sout") {
    img = makeSpan(["stretchy", "sout"]);
    img.height = options.fontMetrics().defaultRuleThickness / scale;
    imgShift = -0.5 * options.fontMetrics().xHeight;
  } else if (label === "phase") {
    // Set a couple of dimensions from the steinmetz package.
    const lineWeight = calculateSize({
      number: 0.6,
      unit: "pt"
    }, options);
    const clearance = calculateSize({
      number: 0.35,
      unit: "ex"
    }, options);

    // Prevent size changes like \Huge from affecting line thickness
    const newOptions = options.havingBaseSizing();
    scale = scale / newOptions.sizeMultiplier;
    const angleHeight = inner.height + inner.depth + lineWeight + clearance;
    // Reserve a left pad for the angle.
    inner.style.paddingLeft = makeEm(angleHeight / 2 + lineWeight);

    // Create an SVG
    const viewBoxHeight = Math.floor(1000 * angleHeight * scale);
    const path = phasePath(viewBoxHeight);
    const svgNode = new SvgNode([new PathNode("phase", path)], {
      "width": "400em",
      "height": makeEm(viewBoxHeight / 1000),
      "viewBox": "0 0 400000 " + viewBoxHeight,
      "preserveAspectRatio": "xMinYMin slice"
    });
    // Wrap it in a span with overflow: hidden.
    img = makeSvgSpan(["hide-tail"], [svgNode], options);
    img.style.height = makeEm(angleHeight);
    imgShift = inner.depth + lineWeight + clearance;
  } else {
    // Add horizontal padding
    if (/cancel/.test(label)) {
      if (!isSingleChar) {
        inner.classes.push("cancel-pad");
      }
    } else if (label === "angl") {
      inner.classes.push("anglpad");
    } else {
      inner.classes.push("boxpad");
    }

    // Add vertical padding
    let topPad;
    let bottomPad;
    let ruleThickness = 0;
    // ref: cancel package: \advance\totalheight2\p@ % "+2"
    if (/box/.test(label)) {
      ruleThickness = Math.max(options.fontMetrics().fboxrule,
      // default
      options.minRuleThickness // User override.
      );
      topPad = options.fontMetrics().fboxsep + (label === "colorbox" ? 0 : ruleThickness);
      bottomPad = topPad;
    } else if (label === "angl") {
      ruleThickness = Math.max(options.fontMetrics().defaultRuleThickness, options.minRuleThickness);
      topPad = 4 * ruleThickness; // gap = 3 × line, plus the line itself.
      bottomPad = Math.max(0, 0.25 - inner.depth);
    } else {
      topPad = isSingleChar ? 0.2 : 0;
      bottomPad = topPad;
    }
    img = stretchyEnclose(inner, label, topPad, bottomPad, options);
    if (/fbox|boxed|fcolorbox/.test(label)) {
      img.style.borderStyle = "solid";
      img.style.borderWidth = makeEm(ruleThickness);
    } else if (label === "angl" && ruleThickness !== 0.049) {
      img.style.borderTopWidth = makeEm(ruleThickness);
      img.style.borderRightWidth = makeEm(ruleThickness);
    }
    imgShift = inner.depth + bottomPad;
    if (group.backgroundColor) {
      img.style.backgroundColor = group.backgroundColor;
      if (group.borderColor) {
        img.style.borderColor = group.borderColor;
      }
    }
  }
  let vlist;
  if (group.backgroundColor) {
    vlist = makeVList({
      positionType: "individualShift",
      children: [
      // Put the color background behind inner;
      {
        type: "elem",
        elem: img,
        shift: imgShift
      }, {
        type: "elem",
        elem: inner,
        shift: 0
      }]
    }, options);
  } else {
    const classes = /cancel|phase/.test(label) ? ["svg-align"] : [];
    vlist = makeVList({
      positionType: "individualShift",
      children: [
      // Write the \cancel stroke on top of inner.
      {
        type: "elem",
        elem: inner,
        shift: 0
      }, {
        type: "elem",
        elem: img,
        shift: imgShift,
        wrapperClasses: classes
      }]
    }, options);
  }
  if (/cancel/.test(label)) {
    // The cancel package documentation says that cancel lines add their height
    // to the expression, but tests show that isn't how it actually works.
    vlist.height = inner.height;
    vlist.depth = inner.depth;
  }
  if (/cancel/.test(label) && !isSingleChar) {
    // cancel does not create horiz space for its line extension.
    return makeSpan(["mord", "cancel-lap"], [vlist], options);
  } else {
    return makeSpan(["mord"], [vlist], options);
  }
};
const enclose_mathmlBuilder = (group, options) => {
  let fboxsep;
  const node = new MathNode(group.label.includes("colorbox") ? "mpadded" : "menclose", [buildMathML_buildGroup(group.body, options)]);
  switch (group.label) {
    case "\\cancel":
      node.setAttribute("notation", "updiagonalstrike");
      break;
    case "\\bcancel":
      node.setAttribute("notation", "downdiagonalstrike");
      break;
    case "\\phase":
      node.setAttribute("notation", "phasorangle");
      break;
    case "\\sout":
      node.setAttribute("notation", "horizontalstrike");
      break;
    case "\\fbox":
      node.setAttribute("notation", "box");
      break;
    case "\\angl":
      node.setAttribute("notation", "actuarial");
      break;
    case "\\fcolorbox":
    case "\\colorbox":
      // <menclose> doesn't have a good notation option. So use <mpadded>
      // instead. Set some attributes that come included with <menclose>.
      fboxsep = options.fontMetrics().fboxsep * options.fontMetrics().ptPerEm;
      node.setAttribute("width", "+" + 2 * fboxsep + "pt");
      node.setAttribute("height", "+" + 2 * fboxsep + "pt");
      node.setAttribute("lspace", fboxsep + "pt"); //
      node.setAttribute("voffset", fboxsep + "pt");
      if (group.label === "\\fcolorbox") {
        const thk = Math.max(options.fontMetrics().fboxrule,
        // default
        options.minRuleThickness // user override
        );
        node.setAttribute("style", "border: " + makeEm(thk) + " solid " + group.borderColor);
      }
      break;
    case "\\xcancel":
      node.setAttribute("notation", "updiagonalstrike downdiagonalstrike");
      break;
  }
  if (group.backgroundColor) {
    node.setAttribute("mathbackground", group.backgroundColor);
  }
  return node;
};
defineFunction({
  type: "enclose",
  names: ["\\colorbox"],
  props: {
    numArgs: 2,
    allowedInText: true,
    argTypes: ["color", "hbox"]
  },
  handler(_ref, args, optArgs) {
    let {
      parser,
      funcName
    } = _ref;
    const color = assertNodeType(args[0], "color-token").color;
    const body = args[1];
    return {
      type: "enclose",
      mode: parser.mode,
      label: funcName,
      backgroundColor: color,
      body
    };
  },
  htmlBuilder: enclose_htmlBuilder,
  mathmlBuilder: enclose_mathmlBuilder
});
defineFunction({
  type: "enclose",
  names: ["\\fcolorbox"],
  props: {
    numArgs: 3,
    allowedInText: true,
    argTypes: ["color", "color", "hbox"]
  },
  handler(_ref2, args, optArgs) {
    let {
      parser,
      funcName
    } = _ref2;
    const borderColor = assertNodeType(args[0], "color-token").color;
    const backgroundColor = assertNodeType(args[1], "color-token").color;
    const body = args[2];
    return {
      type: "enclose",
      mode: parser.mode,
      label: funcName,
      backgroundColor,
      borderColor,
      body
    };
  },
  htmlBuilder: enclose_htmlBuilder,
  mathmlBuilder: enclose_mathmlBuilder
});
defineFunction({
  type: "enclose",
  names: ["\\fbox"],
  props: {
    numArgs: 1,
    argTypes: ["hbox"],
    allowedInText: true
  },
  handler(_ref3, args) {
    let {
      parser
    } = _ref3;
    return {
      type: "enclose",
      mode: parser.mode,
      label: "\\fbox",
      body: args[0]
    };
  }
});
defineFunction({
  type: "enclose",
  names: ["\\cancel", "\\bcancel", "\\xcancel", "\\phase"],
  props: {
    numArgs: 1
  },
  handler(_ref4, args) {
    let {
      parser,
      funcName
    } = _ref4;
    const body = args[0];
    return {
      type: "enclose",
      mode: parser.mode,
      label: funcName,
      body
    };
  },
  htmlBuilder: enclose_htmlBuilder,
  mathmlBuilder: enclose_mathmlBuilder
});
defineFunction({
  type: "enclose",
  names: ["\\sout"],
  props: {
    numArgs: 1,
    allowedInText: true
  },
  handler(_ref5, args) {
    let {
      parser,
      funcName
    } = _ref5;
    if (parser.mode === "math") {
      parser.settings.reportNonstrict("mathVsSout", "LaTeX's \\sout works only in text mode");
    }
    const body = args[0];
    return {
      type: "enclose",
      mode: parser.mode,
      label: funcName,
      body
    };
  },
  htmlBuilder: enclose_htmlBuilder,
  mathmlBuilder: enclose_mathmlBuilder
});
defineFunction({
  type: "enclose",
  names: ["\\angl"],
  props: {
    numArgs: 1,
    argTypes: ["hbox"],
    allowedInText: false
  },
  handler(_ref6, args) {
    let {
      parser
    } = _ref6;
    return {
      type: "enclose",
      mode: parser.mode,
      label: "\\angl",
      body: args[0]
    };
  }
});
;// ./src/defineEnvironment.ts


/**
 * The context contains the following properties:
 *  - mode: current parsing mode.
 *  - envName: the name of the environment, one of the listed names.
 *  - parser: the parser object.
 */

/**
 *  - context: information and references provided by the parser
 *  - args: an array of arguments passed to \begin{name}
 *  - optArgs: an array of optional arguments passed to \begin{name}
 */

/**
 *  - numArgs: (default 0) The number of arguments after the \begin{name} function.
 *  - argTypes: (optional) Just like for a function
 *  - allowedInText: (default false) Whether or not the environment is allowed
 *                   inside text mode (not enforced yet).
 *  - numOptionalArgs: (default 0) Just like for a function
 */

/**
 * Final environment spec for use at parse time.
 * This is almost identical to `EnvDefSpec`, except it
 * 1. includes the function handler
 * 2. requires all arguments except argType
 * It is generated by `defineEnvironment()` below.
 */

/**
 * All registered environments.
 * `environments.js` exports this same dictionary again and makes it public.
 * `Parser.js` requires this dictionary via `environments.js`.
 */
const _environments = {};
function defineEnvironment(_ref) {
  let {
    type,
    names,
    props,
    handler,
    htmlBuilder,
    mathmlBuilder
  } = _ref;
  // Set default values of environments.
  const data = {
    type,
    numArgs: props.numArgs || 0,
    allowedInText: false,
    numOptionalArgs: 0,
    handler
  };
  for (let i = 0; i < names.length; ++i) {
    // TODO: The value type of _environments should be a type union of all
    // possible `EnvSpec<>` possibilities instead of `EnvSpec<*>`, which is
    // an existential type.
    _environments[names[i]] = data;
  }
  if (htmlBuilder) {
    _htmlGroupBuilders[type] = htmlBuilder;
  }
  if (mathmlBuilder) {
    _mathmlGroupBuilders[type] = mathmlBuilder;
  }
}
;// ./src/defineMacro.ts
/**
 * Provides context to macros defined by functions. Implemented by
 * MacroExpander.
 */

/** Macro tokens (in reverse order). */

/**
 * All registered global/built-in macros.
 * `macros.js` exports this same dictionary again and makes it public.
 * `Parser.js` requires this dictionary via `macros.js`.
 */
const _macros = {};

// This function might one day accept an additional argument and do more things.
function defineMacro(name, body) {
  _macros[name] = body;
}
;// ./src/SourceLocation.ts
/**
 * Lexing or parsing positional information for error reporting.
 * This object is immutable.
 */
class SourceLocation {
  // End offset, zero-based exclusive.

  constructor(lexer, start, end) {
    // The + prefix indicates that these fields aren't writeable
    this.lexer = void 0;
    // Lexer holding the input string.
    this.start = void 0;
    // Start offset, zero-based inclusive.
    this.end = void 0;
    this.lexer = lexer;
    this.start = start;
    this.end = end;
  }

  /**
   * Merges two `SourceLocation`s from location providers, given they are
   * provided in order of appearance.
   * - Returns the first one's location if only the first is provided.
   * - Returns a merged range of the first and the last if both are provided
   *   and their lexers match.
   * - Otherwise, returns null.
   */
  static range(first, second) {
    if (!second) {
      return first && first.loc;
    } else if (!first || !first.loc || !second.loc || first.loc.lexer !== second.loc.lexer) {
      return null;
    } else {
      return new SourceLocation(first.loc.lexer, first.loc.start, second.loc.end);
    }
  }
}
;// ./src/Token.ts


/**
 * Interface required to break circular dependency between Token, Lexer, and
 * ParseError.
 */

/**
 * The resulting token returned from `lex`.
 *
 * It consists of the token text plus some position information.
 * The position information is essentially a range in an input string,
 * but instead of referencing the bare input string, we refer to the lexer.
 * That way it is possible to attach extra metadata to the input string,
 * like for example a file name or similar.
 *
 * The position information is optional, so it is OK to construct synthetic
 * tokens if appropriate. Not providing available position information may
 * lead to degraded error reporting, though.
 */
class Token {
  // used in \noexpand

  constructor(text,
  // the text of this token
  loc) {
    this.text = void 0;
    this.loc = void 0;
    this.noexpand = void 0;
    // don't expand the token
    this.treatAsRelax = void 0;
    this.text = text;
    this.loc = loc;
  }

  /**
   * Given a pair of tokens (this and endToken), compute a `Token` encompassing
   * the whole input range enclosed by these two.
   */
  range(endToken,
  // last token of the range, inclusive
  text // the text of the newly constructed token
  ) {
    return new Token(text, SourceLocation.range(this, endToken));
  }
}
;// ./src/environments/array.ts















// Data stored in the ParseNode associated with the environment.

// Type to indicate column separation in MathML

// Helper functions
function getHLines(parser) {
  // Return an array. The array length = number of hlines.
  // Each element in the array tells if the line is dashed.
  const hlineInfo = [];
  parser.consumeSpaces();
  let nxt = parser.fetch().text;
  if (nxt === "\\relax") {
    // \relax is an artifact of the \cr macro below
    parser.consume();
    parser.consumeSpaces();
    nxt = parser.fetch().text;
  }
  while (nxt === "\\hline" || nxt === "\\hdashline") {
    parser.consume();
    hlineInfo.push(nxt === "\\hdashline");
    parser.consumeSpaces();
    nxt = parser.fetch().text;
  }
  return hlineInfo;
}
const validateAmsEnvironmentContext = context => {
  const settings = context.parser.settings;
  if (!settings.displayMode) {
    throw new src_ParseError("{" + context.envName + "} can be used only in" + " display mode.");
  }
};
const gatherEnvironments = new Set(["gather", "gather*"]);

// autoTag (an argument to parseArray) can be one of three values:
// * undefined: Regular (not-top-level) array; no tags on each row
// * true: Automatic equation numbering, overridable by \tag
// * false: Tags allowed on each row, but no automatic numbering
// This function *doesn't* work with the "split" environment name.
function getAutoTag(name) {
  if (!name.includes("ed")) {
    return !name.includes("*");
  }
  // return undefined;
}

/**
 * Parse the body of the environment, with rows delimited by \\ and
 * columns delimited by &, and create a nested list in row-major order
 * with one group per cell.  If given an optional argument style
 * ("text", "display", etc.), then each cell is cast into that style.
 */
function parseArray(parser, _ref, style) {
  let {
    hskipBeforeAndAfter,
    addJot,
    cols,
    arraystretch,
    colSeparationType,
    autoTag,
    singleRow,
    emptySingleRow,
    maxNumCols,
    leqno
  } = _ref;
  parser.gullet.beginGroup();
  if (!singleRow) {
    // \cr is equivalent to \\ without the optional size argument (see below)
    // TODO: provide helpful error when \cr is used outside array environment
    parser.gullet.macros.set("\\cr", "\\\\\\relax");
  }

  // Get current arraystretch if it's not set by the environment
  if (!arraystretch) {
    const stretch = parser.gullet.expandMacroAsText("\\arraystretch");
    if (stretch == null) {
      // Default \arraystretch from lttab.dtx
      arraystretch = 1;
    } else {
      arraystretch = parseFloat(stretch);
      if (!arraystretch || arraystretch < 0) {
        throw new src_ParseError("Invalid \\arraystretch: " + stretch);
      }
    }
  }

  // Start group for first cell
  parser.gullet.beginGroup();
  let row = [];
  const body = [row];
  const rowGaps = [];
  const hLinesBeforeRow = [];
  const tags = autoTag != null ? [] : undefined;

  // amsmath uses \global\@eqnswtrue and \global\@eqnswfalse to represent
  // whether this row should have an equation number.  Simulate this with
  // a \@eqnsw macro set to 1 or 0.
  function beginRow() {
    if (autoTag) {
      parser.gullet.macros.set("\\@eqnsw", "1", true);
    }
  }
  function endRow() {
    if (tags) {
      if (parser.gullet.macros.get("\\df@tag")) {
        tags.push(parser.subparse([new Token("\\df@tag")]));
        parser.gullet.macros.set("\\df@tag", undefined, true);
      } else {
        tags.push(Boolean(autoTag) && parser.gullet.macros.get("\\@eqnsw") === "1");
      }
    }
  }
  beginRow();

  // Test for \hline at the top of the array.
  hLinesBeforeRow.push(getHLines(parser));
  while (true) {
    // Parse each cell in its own group (namespace)
    const cellBody = parser.parseExpression(false, singleRow ? "\\end" : "\\\\");
    parser.gullet.endGroup();
    parser.gullet.beginGroup();
    let cell = {
      type: "ordgroup",
      mode: parser.mode,
      body: cellBody
    };
    if (style) {
      cell = {
        type: "styling",
        mode: parser.mode,
        style,
        resetFont: true,
        body: [cell]
      };
    }
    row.push(cell);
    const next = parser.fetch().text;
    if (next === "&") {
      if (maxNumCols && row.length === maxNumCols) {
        if (singleRow || colSeparationType) {
          // {equation} or {split}
          throw new src_ParseError("Too many tab characters: &", parser.nextToken);
        } else {
          // {array} environment
          parser.settings.reportNonstrict("textEnv", "Too few columns " + "specified in the {array} column argument.");
        }
      }
      parser.consume();
    } else if (next === "\\end") {
      endRow();
      // Arrays terminate newlines with `\crcr` which consumes a `\cr` if
      // the last line is empty.  However, AMS environments keep the
      // empty row if it's the only one.
      // NOTE: Currently, `cell` is the last item added into `row`.
      if (row.length === 1 && cell.type === "styling" && cell.body.length === 1 && cell.body[0].type === "ordgroup" && cell.body[0].body.length === 0 && (body.length > 1 || !emptySingleRow)) {
        body.pop();
      }
      if (hLinesBeforeRow.length < body.length + 1) {
        hLinesBeforeRow.push([]);
      }
      break;
    } else if (next === "\\\\") {
      parser.consume();
      let size;
      // \def\Let@{\let\\\math@cr}
      // \def\math@cr{...\math@cr@}
      // \def\math@cr@{\new@ifnextchar[\math@cr@@{\math@cr@@[\z@]}}
      // \def\math@cr@@[#1]{...\math@cr@@@...}
      // \def\math@cr@@@{\cr}
      if (parser.gullet.future().text !== " ") {
        size = parser.parseSizeGroup(true);
      }
      rowGaps.push(size ? size.value : null);
      endRow();

      // check for \hline(s) following the row separator
      hLinesBeforeRow.push(getHLines(parser));
      row = [];
      body.push(row);
      beginRow();
    } else {
      throw new src_ParseError("Expected & or \\\\ or \\cr or \\end", parser.nextToken);
    }
  }

  // End cell group
  parser.gullet.endGroup();
  // End array group defining \cr
  parser.gullet.endGroup();
  return {
    type: "array",
    mode: parser.mode,
    addJot,
    arraystretch,
    body,
    cols,
    rowGaps,
    hskipBeforeAndAfter,
    hLinesBeforeRow,
    colSeparationType,
    tags,
    leqno
  };
}

// Decides on a style for cells in an array according to whether the given
// environment name starts with the letter 'd'.
function dCellStyle(envName) {
  if (envName.slice(0, 1) === "d") {
    return "display";
  } else {
    return "text";
  }
}
const array_htmlBuilder = function (group, options) {
  let r;
  let c;
  const nr = group.body.length;
  const hLinesBeforeRow = group.hLinesBeforeRow;
  let nc = 0;
  const body = new Array(nr);
  const hlines = [];
  const ruleThickness = Math.max(
  // From LaTeX \showthe\arrayrulewidth. Equals 0.04 em.
  options.fontMetrics().arrayRuleWidth, options.minRuleThickness // User override.
  );

  // Horizontal spacing
  const pt = 1 / options.fontMetrics().ptPerEm;
  let arraycolsep = 5 * pt; // default value, i.e. \arraycolsep in article.cls
  if (group.colSeparationType && group.colSeparationType === "small") {
    // We're in a {smallmatrix}. Default column space is \thickspace,
    // i.e. 5/18em = 0.2778em, per amsmath.dtx for {smallmatrix}.
    // But that needs adjustment because LaTeX applies \scriptstyle to the
    // entire array, including the colspace, but this function applies
    // \scriptstyle only inside each element.
    const localMultiplier = options.havingStyle(src_Style.SCRIPT).sizeMultiplier;
    arraycolsep = 0.2778 * (localMultiplier / options.sizeMultiplier);
  }

  // Vertical spacing
  const baselineskip = group.colSeparationType === "CD" ? calculateSize({
    number: 3,
    unit: "ex"
  }, options) : 12 * pt; // see size10.clo
  // Default \jot from ltmath.dtx
  // TODO(edemaine): allow overriding \jot via \setlength (#687)
  const jot = 3 * pt;
  const arrayskip = group.arraystretch * baselineskip;
  const arstrutHeight = 0.7 * arrayskip; // \strutbox in ltfsstrc.dtx and
  const arstrutDepth = 0.3 * arrayskip; // \@arstrutbox in lttab.dtx

  let totalHeight = 0;

  // Set a position for \hline(s) at the top of the array, if any.
  function setHLinePos(hlinesInGap) {
    for (let i = 0; i < hlinesInGap.length; ++i) {
      if (i > 0) {
        totalHeight += 0.25;
      }
      hlines.push({
        pos: totalHeight,
        isDashed: hlinesInGap[i]
      });
    }
  }
  setHLinePos(hLinesBeforeRow[0]);
  for (r = 0; r < group.body.length; ++r) {
    const inrow = group.body[r   ];
    let height = arstrutHeight; // \@array adds an \@arstrut
    let depth = arstrutDepth; // to each tow (via the template)

    if (nc < inrow.length) {
      nc = inrow.length;
    }
    const outrow = {
      cells: new Array(inrow.length),
      height: 0,
      depth: 0,
      pos: 0
    };
    for (c = 0; c < inrow.length; ++c) {
      const elt = buildGroup(inrow[c], options);
      if (depth < elt.depth) {
        depth = elt.depth;
      }
      if (height < elt.height) {
        height = elt.height;
      }
      outrow.cells[c] = elt;
    }
    const rowGap = group.rowGaps[r];
    let gap = 0;
    if (rowGap) {
      gap = calculateSize(rowGap, options);
      if (gap > 0) {
        // \@argarraycr
        gap += arstrutDepth;
        if (depth < gap) {
          depth = gap; // \@xargarraycr
        }
        gap = 0;
      }
    }
    // In AMS multiline environments such as aligned and gathered, rows
    // correspond to lines that have additional \jot added between lines
    // via \openup.
    // We simulate this by adding \jot depth to each row except the last.
    if (group.addJot && r < group.body.length - 1) {
      depth += jot;
    }
    outrow.height = height;
    outrow.depth = depth;
    totalHeight += height;
    outrow.pos = totalHeight;
    totalHeight += depth + gap; // \@yargarraycr
    body[r] = outrow;

    // Set a position for \hline(s), if any.
    setHLinePos(hLinesBeforeRow[r + 1]);
  }
  const offset = totalHeight / 2 + options.fontMetrics().axisHeight;
  const colDescriptions = group.cols || [];
  const cols = [];
  let colSep;
  let colDescrNum;
  const tagSpans = [];
  if (group.tags && group.tags.some(tag => tag)) {
    // An environment with manual tags and/or automatic equation numbers.
    // Create node(s), the latter of which trigger CSS counter increment.
    for (r = 0; r < nr; ++r) {
      const rw = body[r];
      const shift = rw.pos - offset;
      const tag = group.tags[r];
      let tagSpan;
      if (tag === true) {
        // automatic numbering
        tagSpan = makeSpan(["eqn-num"], [], options);
      } else if (tag === false) {
        // \nonumber/\notag or starred environment
        tagSpan = makeSpan([], [], options);
      } else {
        // manual \tag
        tagSpan = makeSpan([], buildExpression(tag, options, true), options);
      }
      tagSpan.depth = rw.depth;
      tagSpan.height = rw.height;
      tagSpans.push({
        type: "elem",
        elem: tagSpan,
        shift
      });
    }
  }
  for (c = 0, colDescrNum = 0;
  // Continue while either there are more columns or more column
  // descriptions, so trailing separators don't get lost.
  c < nc || colDescrNum < colDescriptions.length; ++c, ++colDescrNum) {
    var _colDescr3;
    let colDescr = colDescriptions[colDescrNum];
    let firstSeparator = true;
    while (((_colDescr = colDescr) == null ? void 0 : _colDescr.type) === "separator") {
      var _colDescr;
      // If there is more than one separator in a row, add a space
      // between them.
      if (!firstSeparator) {
        colSep = makeSpan(["arraycolsep"], []);
        colSep.style.width = makeEm(options.fontMetrics().doubleRuleSep);
        cols.push(colSep);
      }
      if (colDescr.separator === "|" || colDescr.separator === ":") {
        const lineType = colDescr.separator === "|" ? "solid" : "dashed";
        const separator = makeSpan(["vertical-separator"], [], options);
        separator.style.height = makeEm(totalHeight);
        separator.style.borderRightWidth = makeEm(ruleThickness);
        separator.style.borderRightStyle = lineType;
        separator.style.margin = "0 " + makeEm(-ruleThickness / 2);
        const shift = totalHeight - offset;
        if (shift) {
          separator.style.verticalAlign = makeEm(-shift);
        }
        cols.push(separator);
      } else {
        throw new src_ParseError("Invalid separator type: " + colDescr.separator);
      }
      colDescrNum++;
      colDescr = colDescriptions[colDescrNum];
      firstSeparator = false;
    }
    if (c >= nc) {
      continue;
    }
    let sepwidth;
    if (c > 0 || group.hskipBeforeAndAfter) {
      var _colDescr$pregap, _colDescr2;
      sepwidth = (_colDescr$pregap = (_colDescr2 = colDescr) == null ? void 0 : _colDescr2.pregap) != null ? _colDescr$pregap : arraycolsep;
      if (sepwidth !== 0) {
        colSep = makeSpan(["arraycolsep"], []);
        colSep.style.width = makeEm(sepwidth);
        cols.push(colSep);
      }
    }
    const colElems = [];
    for (r = 0; r < nr; ++r) {
      const row = body[r];
      const elem = row.cells[c];
      if (!elem) {
        continue;
      }
      const shift = row.pos - offset;
      elem.depth = row.depth;
      elem.height = row.height;
      colElems.push({
        type: "elem",
        elem: elem,
        shift: shift
      });
    }
    const colVList = makeVList({
      positionType: "individualShift",
      children: colElems
    }, options);
    const colSpan = makeSpan(["col-align-" + (((_colDescr3 = colDescr) == null ? void 0 : _colDescr3.align) || "c")], [colVList]);
    cols.push(colSpan);
    if (c < nc - 1 || group.hskipBeforeAndAfter) {
      var _colDescr$postgap, _colDescr4;
      sepwidth = (_colDescr$postgap = (_colDescr4 = colDescr) == null ? void 0 : _colDescr4.postgap) != null ? _colDescr$postgap : arraycolsep;
      if (sepwidth !== 0) {
        colSep = makeSpan(["arraycolsep"], []);
        colSep.style.width = makeEm(sepwidth);
        cols.push(colSep);
      }
    }
  }
  let tableBody = makeSpan(["mtable"], cols);

  // Add \hline(s), if any.
  if (hlines.length > 0) {
    const line = makeLineSpan("hline", options, ruleThickness);
    const dashes = makeLineSpan("hdashline", options, ruleThickness);
    const vListElems = [{
      type: "elem",
      elem: tableBody,
      shift: 0
    }];
    while (hlines.length > 0) {
      const hline = hlines.pop();
      const lineShift = hline.pos - offset;
      if (hline.isDashed) {
        vListElems.push({
          type: "elem",
          elem: dashes,
          shift: lineShift
        });
      } else {
        vListElems.push({
          type: "elem",
          elem: line,
          shift: lineShift
        });
      }
    }
    tableBody = makeVList({
      positionType: "individualShift",
      children: vListElems
    }, options);
  }
  if (tagSpans.length === 0) {
    return makeSpan(["mord"], [tableBody], options);
  } else {
    const eqnNumCol = makeVList({
      positionType: "individualShift",
      children: tagSpans
    }, options);
    const tagCol = makeSpan(["tag"], [eqnNumCol], options);
    return makeFragment([tableBody, tagCol]);
  }
};
const alignMap = {
  c: "center ",
  l: "left ",
  r: "right "
};
const array_mathmlBuilder = function (group, options) {
  const tbl = [];
  const glue = new MathNode("mtd", [], ["mtr-glue"]);
  const tag = new MathNode("mtd", [], ["mml-eqn-num"]);
  for (let i = 0; i < group.body.length; i++) {
    const rw = group.body[i];
    const row = [];
    for (let j = 0; j < rw.length; j++) {
      row.push(new MathNode("mtd", [buildMathML_buildGroup(rw[j], options)]));
    }
    if (group.tags && group.tags[i]) {
      row.unshift(glue);
      row.push(glue);
      if (group.leqno) {
        row.unshift(tag);
      } else {
        row.push(tag);
      }
    }
    tbl.push(new MathNode("mtr", row));
  }
  let table = new MathNode("mtable", tbl);

  // Set column alignment, row spacing, column spacing, and
  // array lines by setting attributes on the table element.

  // Set the row spacing. In MathML, we specify a gap distance.
  // We do not use rowGap[] because MathML automatically increases
  // cell height with the height/depth of the element content.

  // LaTeX \arraystretch multiplies the row baseline-to-baseline distance.
  // We simulate this by adding (arraystretch - 1)em to the gap. This
  // does a reasonable job of adjusting arrays containing 1 em tall content.

  // The 0.16 and 0.09 values are found empirically. They produce an array
  // similar to LaTeX and in which content does not interfere with \hlines.
  const gap = group.arraystretch === 0.5 ? 0.1 // {smallmatrix}, {subarray}
  : 0.16 + group.arraystretch - 1 + (group.addJot ? 0.09 : 0);
  table.setAttribute("rowspacing", makeEm(gap));

  // MathML table lines go only between cells.
  // To place a line on an edge we'll use <menclose>, if necessary.
  let menclose = "";
  let align = "";
  if (group.cols && group.cols.length > 0) {
    // Find column alignment, column spacing, and  vertical lines.
    const cols = group.cols;
    let columnLines = "";
    let prevTypeWasAlign = false;
    let iStart = 0;
    let iEnd = cols.length;
    if (cols[0].type === "separator") {
      menclose += "top ";
      iStart = 1;
    }
    if (cols[cols.length - 1].type === "separator") {
      menclose += "bottom ";
      iEnd -= 1;
    }
    for (let i = iStart; i < iEnd; i++) {
      const col = cols[i];
      if (col.type === "align") {
        align += alignMap[col.align];
        if (prevTypeWasAlign) {
          columnLines += "none ";
        }
        prevTypeWasAlign = true;
      } else if (col.type === "separator") {
        // MathML accepts only single lines between cells.
        // So we read only the first of consecutive separators.
        if (prevTypeWasAlign) {
          columnLines += col.separator === "|" ? "solid " : "dashed ";
          prevTypeWasAlign = false;
        }
      }
    }
    table.setAttribute("columnalign", align.trim());
    if (/[sd]/.test(columnLines)) {
      table.setAttribute("columnlines", columnLines.trim());
    }
  }

  // Set column spacing.
  if (group.colSeparationType === "align") {
    const cols = group.cols || [];
    let spacing = "";
    for (let i = 1; i < cols.length; i++) {
      spacing += i % 2 ? "0em " : "1em ";
    }
    table.setAttribute("columnspacing", spacing.trim());
  } else if (group.colSeparationType === "alignat" || group.colSeparationType === "gather") {
    table.setAttribute("columnspacing", "0em");
  } else if (group.colSeparationType === "small") {
    table.setAttribute("columnspacing", "0.2778em");
  } else if (group.colSeparationType === "CD") {
    table.setAttribute("columnspacing", "0.5em");
  } else {
    table.setAttribute("columnspacing", "1em");
  }

  // Address \hline and \hdashline
  let rowLines = "";
  const hlines = group.hLinesBeforeRow;
  menclose += hlines[0].length > 0 ? "left " : "";
  menclose += hlines[hlines.length - 1].length > 0 ? "right " : "";
  for (let i = 1; i < hlines.length - 1; i++) {
    rowLines += hlines[i].length === 0 ? "none "
    // MathML accepts only a single line between rows. Read one element.
    : hlines[i][0] ? "dashed " : "solid ";
  }
  if (/[sd]/.test(rowLines)) {
    table.setAttribute("rowlines", rowLines.trim());
  }
  if (menclose !== "") {
    table = new MathNode("menclose", [table]);
    table.setAttribute("notation", menclose.trim());
  }
  if (group.arraystretch && group.arraystretch < 1) {
    // A small array. Wrap in scriptstyle so row gap is not too large.
    table = new MathNode("mstyle", [table]);
    table.setAttribute("scriptlevel", "1");
  }
  return table;
};

// Convenience function for align, align*, aligned, alignat, alignat*, alignedat.
const alignedHandler = function (context, args) {
  if (!context.envName.includes("ed")) {
    validateAmsEnvironmentContext(context);
  }
  const cols = [];
  const separationType = context.envName.includes("at") ? "alignat" : "align";
  const isSplit = context.envName === "split";
  const res = parseArray(context.parser, {
    cols,
    addJot: true,
    autoTag: isSplit ? undefined : getAutoTag(context.envName),
    emptySingleRow: true,
    colSeparationType: separationType,
    maxNumCols: isSplit ? 2 : undefined,
    leqno: context.parser.settings.leqno
  }, "display");

  // Determining number of columns.
  // 1. If the first argument is given, we use it as a number of columns,
  //    and makes sure that each row doesn't exceed that number.
  // 2. Otherwise, just count number of columns = maximum number
  //    of cells in each row ("aligned" mode -- isAligned will be true).
  //
  // At the same time, prepend empty group {} at beginning of every second
  // cell in each row (starting with second cell) so that operators become
  // binary.  This behavior is implemented in amsmath's \start@aligned.
  let numMaths = 0;
  let numCols = 0;
  const emptyGroup = {
    type: "ordgroup",
    mode: context.mode,
    body: []
  };
  if (args[0] && args[0].type === "ordgroup") {
    let arg0 = "";
    for (let i = 0; i < args[0].body.length; i++) {
      const textord = assertNodeType(args[0].body[i], "textord");
      arg0 += textord.text;
    }
    numMaths = Number(arg0);
    numCols = numMaths * 2;
  }
  const isAligned = !numCols;
  res.body.forEach(function (row) {
    for (let i = 1; i < row.length; i += 2) {
      // Modify ordgroup node within styling node
      const styling = assertNodeType(row[i], "styling");
      const ordgroup = assertNodeType(styling.body[0], "ordgroup");
      ordgroup.body.unshift(emptyGroup);
    }
    if (!isAligned) {
      // Case 1
      const curMaths = row.length / 2;
      if (numMaths < curMaths) {
        throw new src_ParseError("Too many math in a row: " + ("expected " + numMaths + ", but got " + curMaths), row[0]);
      }
    } else if (numCols < row.length) {
      // Case 2
      numCols = row.length;
    }
  });

  // Adjusting alignment.
  // In aligned mode, we add one \qquad between columns;
  // otherwise we add nothing.
  for (let i = 0; i < numCols; ++i) {
    let align = "r";
    let pregap = 0;
    if (i % 2 === 1) {
      align = "l";
    } else if (i > 0 && isAligned) {
      // "aligned" mode.
      pregap = 1; // add one \quad
    }
    cols[i] = {
      type: "align",
      align: align,
      pregap: pregap,
      postgap: 0
    };
  }
  res.colSeparationType = isAligned ? "align" : "alignat";
  return res;
};

// Arrays are part of LaTeX, defined in lttab.dtx so its documentation
// is part of the source2e.pdf file of LaTeX2e source documentation.
// {darray} is an {array} environment where cells are set in \displaystyle,
// as defined in nccmath.sty.
defineEnvironment({
  type: "array",
  names: ["array", "darray"],
  props: {
    numArgs: 1
  },
  handler(context, args) {
    // Since no types are specified above, the two possibilities are
    // - The argument is wrapped in {} or [], in which case Parser's
    //   parseGroup() returns an "ordgroup" wrapping some symbol node.
    // - The argument is a bare symbol node.
    const symNode = checkSymbolNodeType(args[0]);
    const colalign = symNode ? [args[0]] : assertNodeType(args[0], "ordgroup").body;
    const cols = colalign.map(function (nde) {
      const node = assertSymbolNodeType(nde);
      const ca = node.text;
      if ("lcr".includes(ca)) {
        return {
          type: "align",
          align: ca
        };
      } else if (ca === "|") {
        return {
          type: "separator",
          separator: "|"
        };
      } else if (ca === ":") {
        return {
          type: "separator",
          separator: ":"
        };
      }
      throw new src_ParseError("Unknown column alignment: " + ca, nde);
    });
    const res = {
      cols,
      hskipBeforeAndAfter: true,
      // \@preamble in lttab.dtx
      maxNumCols: cols.length
    };
    return parseArray(context.parser, res, dCellStyle(context.envName));
  },
  htmlBuilder: array_htmlBuilder,
  mathmlBuilder: array_mathmlBuilder
});

// The matrix environments of amsmath builds on the array environment
// of LaTeX, which is discussed above.
// The mathtools package adds starred versions of the same environments.
// These have an optional argument to choose left|center|right justification.
defineEnvironment({
  type: "array",
  names: ["matrix", "pmatrix", "bmatrix", "Bmatrix", "vmatrix", "Vmatrix", "matrix*", "pmatrix*", "bmatrix*", "Bmatrix*", "vmatrix*", "Vmatrix*"],
  props: {
    numArgs: 0
  },
  handler(context) {
    const delimiters = {
      "matrix": null,
      "pmatrix": ["(", ")"],
      "bmatrix": ["[", "]"],
      "Bmatrix": ["\\{", "\\}"],
      "vmatrix": ["|", "|"],
      "Vmatrix": ["\\Vert", "\\Vert"]
    }[context.envName.replace("*", "")];
    // \hskip -\arraycolsep in amsmath
    let colAlign = "c";
    const payload = {
      hskipBeforeAndAfter: false,
      cols: [{
        type: "align",
        align: colAlign
      }]
    };
    if (context.envName.charAt(context.envName.length - 1) === "*") {
      // It's one of the mathtools starred functions.
      // Parse the optional alignment argument.
      const parser = context.parser;
      parser.consumeSpaces();
      if (parser.fetch().text === "[") {
        parser.consume();
        parser.consumeSpaces();
        colAlign = parser.fetch().text;
        if (!"lcr".includes(colAlign)) {
          throw new src_ParseError("Expected l or c or r", parser.nextToken);
        }
        parser.consume();
        parser.consumeSpaces();
        parser.expect("]");
        parser.consume();
        payload.cols = [{
          type: "align",
          align: colAlign
        }];
      }
    }
    const res = parseArray(context.parser, payload, dCellStyle(context.envName));
    // Populate cols with the correct number of column alignment specs.
    const numCols = Math.max(0, ...res.body.map(row => row.length));
    res.cols = new Array(numCols).fill({
      type: "align",
      align: colAlign
    });
    return delimiters ? {
      type: "leftright",
      mode: context.mode,
      body: [res],
      left: delimiters[0],
      right: delimiters[1],
      rightColor: undefined // \right uninfluenced by \color in array
    } : res;
  },
  htmlBuilder: array_htmlBuilder,
  mathmlBuilder: array_mathmlBuilder
});
defineEnvironment({
  type: "array",
  names: ["smallmatrix"],
  props: {
    numArgs: 0
  },
  handler(context) {
    const payload = {
      arraystretch: 0.5
    };
    const res = parseArray(context.parser, payload, "script");
    res.colSeparationType = "small";
    return res;
  },
  htmlBuilder: array_htmlBuilder,
  mathmlBuilder: array_mathmlBuilder
});
defineEnvironment({
  type: "array",
  names: ["subarray"],
  props: {
    numArgs: 1
  },
  handler(context, args) {
    // Parsing of {subarray} is similar to {array}
    const symNode = checkSymbolNodeType(args[0]);
    const colalign = symNode ? [args[0]] : assertNodeType(args[0], "ordgroup").body;
    const cols = colalign.map(function (nde) {
      const node = assertSymbolNodeType(nde);
      const ca = node.text;
      // {subarray} only recognizes "l" & "c"
      if ("lc".includes(ca)) {
        return {
          type: "align",
          align: ca
        };
      }
      throw new src_ParseError("Unknown column alignment: " + ca, nde);
    });
    if (cols.length > 1) {
      throw new src_ParseError("{subarray} can contain only one column");
    }
    const payload = {
      cols,
      hskipBeforeAndAfter: false,
      arraystretch: 0.5
    };
    const res = parseArray(context.parser, payload, "script");
    if (res.body.length > 0 && res.body[0].length > 1) {
      throw new src_ParseError("{subarray} can contain only one column");
    }
    return res;
  },
  htmlBuilder: array_htmlBuilder,
  mathmlBuilder: array_mathmlBuilder
});

// A cases environment (in amsmath.sty) is almost equivalent to
// \def\arraystretch{1.2}%
// \left\{\begin{array}{@{}l@{\quad}l@{}} … \end{array}\right.
// {dcases} is a {cases} environment where cells are set in \displaystyle,
// as defined in mathtools.sty.
// {rcases} is another mathtools environment. It's brace is on the right side.
defineEnvironment({
  type: "array",
  names: ["cases", "dcases", "rcases", "drcases"],
  props: {
    numArgs: 0
  },
  handler(context) {
    const payload = {
      arraystretch: 1.2,
      cols: [{
        type: "align",
        align: "l",
        pregap: 0,
        // TODO(kevinb) get the current style.
        // For now we use the metrics for TEXT style which is what we were
        // doing before.  Before attempting to get the current style we
        // should look at TeX's behavior especially for \over and matrices.
        postgap: 1.0 /* 1em quad */
      }, {
        type: "align",
        align: "l",
        pregap: 0,
        postgap: 0
      }]
    };
    const res = parseArray(context.parser, payload, dCellStyle(context.envName));
    return {
      type: "leftright",
      mode: context.mode,
      body: [res],
      left: context.envName.includes("r") ? "." : "\\{",
      right: context.envName.includes("r") ? "\\}" : ".",
      rightColor: undefined
    };
  },
  htmlBuilder: array_htmlBuilder,
  mathmlBuilder: array_mathmlBuilder
});

// In the align environment, one uses ampersands, &, to specify number of
// columns in each row, and to locate spacing between each column.
// align gets automatic numbering. align* and aligned do not.
// The alignedat environment can be used in math mode.
// Note that we assume \nomallineskiplimit to be zero,
// so that \strut@ is the same as \strut.
defineEnvironment({
  type: "array",
  names: ["align", "align*", "aligned", "split"],
  props: {
    numArgs: 0
  },
  handler: alignedHandler,
  htmlBuilder: array_htmlBuilder,
  mathmlBuilder: array_mathmlBuilder
});

// A gathered environment is like an array environment with one centered
// column, but where rows are considered lines so get \jot line spacing
// and contents are set in \displaystyle.
defineEnvironment({
  type: "array",
  names: ["gathered", "gather", "gather*"],
  props: {
    numArgs: 0
  },
  handler(context) {
    if (gatherEnvironments.has(context.envName)) {
      validateAmsEnvironmentContext(context);
    }
    const res = {
      cols: [{
        type: "align",
        align: "c"
      }],
      addJot: true,
      colSeparationType: "gather",
      autoTag: getAutoTag(context.envName),
      emptySingleRow: true,
      leqno: context.parser.settings.leqno
    };
    return parseArray(context.parser, res, "display");
  },
  htmlBuilder: array_htmlBuilder,
  mathmlBuilder: array_mathmlBuilder
});

// alignat environment is like an align environment, but one must explicitly
// specify maximum number of columns in each row, and can adjust spacing between
// each columns.
defineEnvironment({
  type: "array",
  names: ["alignat", "alignat*", "alignedat"],
  props: {
    numArgs: 1
  },
  handler: alignedHandler,
  htmlBuilder: array_htmlBuilder,
  mathmlBuilder: array_mathmlBuilder
});
defineEnvironment({
  type: "array",
  names: ["equation", "equation*"],
  props: {
    numArgs: 0
  },
  handler(context) {
    validateAmsEnvironmentContext(context);
    const res = {
      autoTag: getAutoTag(context.envName),
      emptySingleRow: true,
      singleRow: true,
      maxNumCols: 1,
      leqno: context.parser.settings.leqno
    };
    return parseArray(context.parser, res, "display");
  },
  htmlBuilder: array_htmlBuilder,
  mathmlBuilder: array_mathmlBuilder
});
defineEnvironment({
  type: "array",
  names: ["CD"],
  props: {
    numArgs: 0
  },
  handler(context) {
    validateAmsEnvironmentContext(context);
    return parseCD(context.parser);
  },
  htmlBuilder: array_htmlBuilder,
  mathmlBuilder: array_mathmlBuilder
});
defineMacro("\\nonumber", "\\gdef\\@eqnsw{0}");
defineMacro("\\notag", "\\nonumber");

// Catch \hline outside array environment
defineFunction({
  type: "text",
  // Doesn't matter what this is.
  names: ["\\hline", "\\hdashline"],
  props: {
    numArgs: 0,
    allowedInText: true,
    allowedInMath: true
  },
  handler(context, args) {
    throw new src_ParseError(context.funcName + " valid only within array environment");
  }
});
;// ./src/environments.ts

const environments = _environments;
/* harmony default export */ var src_environments = (environments);

// All environment definitions should be imported below

;// ./src/functions/environment.ts




// Environment delimiters. HTML/MathML rendering is defined in the corresponding
// defineEnvironment definitions.
defineFunction({
  type: "environment",
  names: ["\\begin", "\\end"],
  props: {
    numArgs: 1,
    argTypes: ["text"]
  },
  handler(_ref, args) {
    let {
      parser,
      funcName
    } = _ref;
    const nameGroup = args[0];
    if (nameGroup.type !== "ordgroup") {
      throw new src_ParseError("Invalid environment name", nameGroup);
    }
    let envName = "";
    for (let i = 0; i < nameGroup.body.length; ++i) {
      envName += assertNodeType(nameGroup.body[i], "textord").text;
    }
    if (funcName === "\\begin") {
      // begin...end is similar to left...right
      if (!src_environments.hasOwnProperty(envName)) {
        throw new src_ParseError("No such environment: " + envName, nameGroup);
      }
      // Build the environment object. Arguments and other information will
      // be made available to the begin and end methods using properties.
      const env = src_environments[envName];
      const {
        args,
        optArgs
      } = parser.parseArguments("\\begin{" + envName + "}", env);
      const context = {
        mode: parser.mode,
        envName,
        parser
      };
      const result = env.handler(context, args, optArgs);
      parser.expect("\\end", false);
      const endNameToken = parser.nextToken;
      const end = assertNodeType(parser.parseFunction(), "environment");
      if (end.name !== envName) {
        throw new src_ParseError("Mismatch: \\begin{" + envName + "} matched by \\end{" + end.name + "}", endNameToken);
      }
      // env.handler returns the specific node type (e.g. "array"),
      // not "environment". This cast is unavoidable: defineFunction
      // requires the handler to return ParseNode<"environment"> but
      // \begin delegates to environment handlers with different types.
      return result;
    }
    return {
      type: "environment",
      mode: parser.mode,
      name: envName,
      nameGroup
    };
  }
});
;// ./src/functions/font.ts
// TODO(kevinb): implement \\sl and \\sc






const font_htmlBuilder = (group, options) => {
  const font = group.font;
  const newOptions = options.withFont(font);
  return buildGroup(group.body, newOptions);
};
const font_mathmlBuilder = (group, options) => {
  const font = group.font;
  const newOptions = options.withFont(font);
  return buildMathML_buildGroup(group.body, newOptions);
};
const fontAliases = {
  "\\Bbb": "\\mathbb",
  "\\bold": "\\mathbf",
  "\\frak": "\\mathfrak"
};
defineFunction({
  type: "font",
  names: [
  // styles, except \boldsymbol defined below
  "\\mathrm", "\\mathit", "\\mathbf", "\\mathnormal", "\\mathsfit",
  // families
  "\\mathbb", "\\mathcal", "\\mathfrak", "\\mathscr", "\\mathsf", "\\mathtt",
  // aliases, except \bm defined below
  "\\Bbb", "\\bold", "\\frak"],
  props: {
    numArgs: 1,
    allowedInArgument: true
  },
  handler: (_ref, args) => {
    let {
      parser,
      funcName
    } = _ref;
    const body = normalizeArgument(args[0]);
    let func = funcName;
    if (func in fontAliases) {
      func = fontAliases[func];
    }
    return {
      type: "font",
      mode: parser.mode,
      font: func.slice(1),
      body
    };
  },
  htmlBuilder: font_htmlBuilder,
  mathmlBuilder: font_mathmlBuilder
});
defineFunction({
  type: "mclass",
  names: ["\\boldsymbol", "\\bm"],
  props: {
    numArgs: 1
  },
  handler: (_ref2, args) => {
    let {
      parser
    } = _ref2;
    const body = args[0];
    // amsbsy.sty's \boldsymbol uses \binrel spacing to inherit the
    // argument's bin|rel|ord status
    return {
      type: "mclass",
      mode: parser.mode,
      mclass: binrelClass(body),
      body: [{
        type: "font",
        mode: parser.mode,
        font: "boldsymbol",
        body
      }],
      isCharacterBox: isCharacterBox(body)
    };
  }
});

// Old font changing functions
defineFunction({
  type: "font",
  names: ["\\rm", "\\sf", "\\tt", "\\bf", "\\it", "\\cal"],
  props: {
    numArgs: 0,
    allowedInText: true
  },
  handler: (_ref3, args) => {
    let {
      parser,
      funcName,
      breakOnTokenText
    } = _ref3;
    const {
      mode
    } = parser;
    const body = parser.parseExpression(true, breakOnTokenText);
    return {
      type: "font",
      mode: mode,
      font: "math" + funcName.slice(1),
      body: {
        type: "ordgroup",
        mode: parser.mode,
        body
      }
    };
  },
  htmlBuilder: font_htmlBuilder,
  mathmlBuilder: font_mathmlBuilder
});
;// ./src/functions/genfrac.ts









const genfrac_htmlBuilder = (group, options) => {
  // Fractions are handled in the TeXbook on pages 444-445, rules 15(a-e).
  const style = options.style;
  const nstyle = style.fracNum();
  const dstyle = style.fracDen();
  let newOptions;
  newOptions = options.havingStyle(nstyle);
  const numerm = buildGroup(group.numer, newOptions, options);
  if (group.continued) {
    // \cfrac inserts a \strut into the numerator.
    // Get \strut dimensions from TeXbook page 353.
    const hStrut = 8.5 / options.fontMetrics().ptPerEm;
    const dStrut = 3.5 / options.fontMetrics().ptPerEm;
    numerm.height = numerm.height < hStrut ? hStrut : numerm.height;
    numerm.depth = numerm.depth < dStrut ? dStrut : numerm.depth;
  }
  newOptions = options.havingStyle(dstyle);
  const denomm = buildGroup(group.denom, newOptions, options);
  let rule;
  let ruleWidth;
  let ruleSpacing;
  if (group.hasBarLine) {
    if (group.barSize) {
      ruleWidth = calculateSize(group.barSize, options);
      rule = makeLineSpan("frac-line", options, ruleWidth);
    } else {
      rule = makeLineSpan("frac-line", options);
    }
    ruleWidth = rule.height;
    ruleSpacing = rule.height;
  } else {
    rule = null;
    ruleWidth = 0;
    ruleSpacing = options.fontMetrics().defaultRuleThickness;
  }

  // Rule 15b
  let numShift;
  let clearance;
  let denomShift;
  if (style.size === src_Style.DISPLAY.size) {
    numShift = options.fontMetrics().num1;
    if (ruleWidth > 0) {
      clearance = 3 * ruleSpacing;
    } else {
      clearance = 7 * ruleSpacing;
    }
    denomShift = options.fontMetrics().denom1;
  } else {
    if (ruleWidth > 0) {
      numShift = options.fontMetrics().num2;
      clearance = ruleSpacing;
    } else {
      numShift = options.fontMetrics().num3;
      clearance = 3 * ruleSpacing;
    }
    denomShift = options.fontMetrics().denom2;
  }
  let frac;
  if (!rule) {
    // Rule 15c
    const candidateClearance = numShift - numerm.depth - (denomm.height - denomShift);
    if (candidateClearance < clearance) {
      numShift += 0.5 * (clearance - candidateClearance);
      denomShift += 0.5 * (clearance - candidateClearance);
    }
    frac = makeVList({
      positionType: "individualShift",
      children: [{
        type: "elem",
        elem: denomm,
        shift: denomShift
      }, {
        type: "elem",
        elem: numerm,
        shift: -numShift
      }]
    }, options);
  } else {
    // Rule 15d
    const axisHeight = options.fontMetrics().axisHeight;
    if (numShift - numerm.depth - (axisHeight + 0.5 * ruleWidth) < clearance) {
      numShift += clearance - (numShift - numerm.depth - (axisHeight + 0.5 * ruleWidth));
    }
    if (axisHeight - 0.5 * ruleWidth - (denomm.height - denomShift) < clearance) {
      denomShift += clearance - (axisHeight - 0.5 * ruleWidth - (denomm.height - denomShift));
    }
    const midShift = -(axisHeight - 0.5 * ruleWidth);
    frac = makeVList({
      positionType: "individualShift",
      children: [{
        type: "elem",
        elem: denomm,
        shift: denomShift
      }, {
        type: "elem",
        elem: rule,
        shift: midShift
      }, {
        type: "elem",
        elem: numerm,
        shift: -numShift
      }]
    }, options);
  }

  // Since we manually change the style sometimes (with \dfrac or \tfrac),
  // account for the possible size change here.
  newOptions = options.havingStyle(style);
  frac.height *= newOptions.sizeMultiplier / options.sizeMultiplier;
  frac.depth *= newOptions.sizeMultiplier / options.sizeMultiplier;

  // Rule 15e
  let delimSize;
  if (style.size === src_Style.DISPLAY.size) {
    delimSize = options.fontMetrics().delim1;
  } else if (style.size === src_Style.SCRIPTSCRIPT.size) {
    delimSize = options.havingStyle(src_Style.SCRIPT).fontMetrics().delim2;
  } else {
    delimSize = options.fontMetrics().delim2;
  }
  let leftDelim;
  let rightDelim;
  if (group.leftDelim == null) {
    leftDelim = makeNullDelimiter(options, ["mopen"]);
  } else {
    leftDelim = makeCustomSizedDelim(group.leftDelim, delimSize, true, options.havingStyle(style), group.mode, ["mopen"]);
  }
  if (group.continued) {
    rightDelim = makeSpan([]); // zero width for \cfrac
  } else if (group.rightDelim == null) {
    rightDelim = makeNullDelimiter(options, ["mclose"]);
  } else {
    rightDelim = makeCustomSizedDelim(group.rightDelim, delimSize, true, options.havingStyle(style), group.mode, ["mclose"]);
  }
  return makeSpan(["mord"].concat(newOptions.sizingClasses(options)), [leftDelim, makeSpan(["mfrac"], [frac]), rightDelim], options);
};
const genfrac_mathmlBuilder = (group, options) => {
  const node = new MathNode("mfrac", [buildMathML_buildGroup(group.numer, options), buildMathML_buildGroup(group.denom, options)]);
  if (!group.hasBarLine) {
    node.setAttribute("linethickness", "0px");
  } else if (group.barSize) {
    const ruleWidth = calculateSize(group.barSize, options);
    node.setAttribute("linethickness", makeEm(ruleWidth));
  }
  if (group.leftDelim != null || group.rightDelim != null) {
    const withDelims = [];
    if (group.leftDelim != null) {
      const leftOp = new MathNode("mo", [new TextNode(group.leftDelim.replace("\\", ""))]);
      leftOp.setAttribute("fence", "true");
      withDelims.push(leftOp);
    }
    withDelims.push(node);
    if (group.rightDelim != null) {
      const rightOp = new MathNode("mo", [new TextNode(group.rightDelim.replace("\\", ""))]);
      rightOp.setAttribute("fence", "true");
      withDelims.push(rightOp);
    }
    return makeRow(withDelims);
  }
  return node;
};
const wrapWithStyle = (frac, style) => {
  if (!style) {
    return frac;
  }
  const wrapper = {
    type: "styling",
    mode: frac.mode,
    style,
    body: [frac]
  };

  // @ts-ignore defineFunction handler needs to return ParseNode<"genfrac">
  return wrapper;
};
defineFunction({
  type: "genfrac",
  names: ["\\cfrac", "\\dfrac", "\\frac", "\\tfrac", "\\dbinom", "\\binom", "\\tbinom", "\\\\atopfrac",
  // can’t be entered directly
  "\\\\bracefrac", "\\\\brackfrac" // ditto
  ],
  props: {
    numArgs: 2,
    allowedInArgument: true
  },
  handler: (_ref, args) => {
    let {
      parser,
      funcName
    } = _ref;
    const numer = args[0];
    const denom = args[1];
    let hasBarLine;
    let leftDelim = null;
    let rightDelim = null;
    switch (funcName) {
      case "\\cfrac":
      case "\\dfrac":
      case "\\frac":
      case "\\tfrac":
        hasBarLine = true;
        break;
      case "\\\\atopfrac":
        hasBarLine = false;
        break;
      case "\\dbinom":
      case "\\binom":
      case "\\tbinom":
        hasBarLine = false;
        leftDelim = "(";
        rightDelim = ")";
        break;
      case "\\\\bracefrac":
        hasBarLine = false;
        leftDelim = "\\{";
        rightDelim = "\\}";
        break;
      case "\\\\brackfrac":
        hasBarLine = false;
        leftDelim = "[";
        rightDelim = "]";
        break;
      default:
        throw new Error("Unrecognized genfrac command");
    }
    const continued = funcName === "\\cfrac";
    let style = null;
    if (continued || funcName.startsWith("\\d")) {
      style = "display";
    } else if (funcName.startsWith("\\t")) {
      style = "text";
    }
    return wrapWithStyle({
      type: "genfrac",
      mode: parser.mode,
      numer,
      denom,
      continued,
      hasBarLine,
      leftDelim,
      rightDelim,
      barSize: null
    }, style);
  },
  htmlBuilder: genfrac_htmlBuilder,
  mathmlBuilder: genfrac_mathmlBuilder
});

// Infix generalized fractions -- these are not rendered directly, but replaced
// immediately by one of the variants above.
defineFunction({
  type: "infix",
  names: ["\\over", "\\choose", "\\atop", "\\brace", "\\brack"],
  props: {
    numArgs: 0,
    infix: true
  },
  handler(_ref2) {
    let {
      parser,
      funcName,
      token
    } = _ref2;
    let replaceWith;
    switch (funcName) {
      case "\\over":
        replaceWith = "\\frac";
        break;
      case "\\choose":
        replaceWith = "\\binom";
        break;
      case "\\atop":
        replaceWith = "\\\\atopfrac";
        break;
      case "\\brace":
        replaceWith = "\\\\bracefrac";
        break;
      case "\\brack":
        replaceWith = "\\\\brackfrac";
        break;
      default:
        throw new Error("Unrecognized infix genfrac command");
    }
    return {
      type: "infix",
      mode: parser.mode,
      replaceWith,
      token
    };
  }
});
const stylArray = ["display", "text", "script", "scriptscript"];
const delimFromValue = function (delimString) {
  let delim = null;
  if (delimString.length > 0) {
    delim = delimString;
    delim = delim === "." ? null : delim;
  }
  return delim;
};
defineFunction({
  type: "genfrac",
  names: ["\\genfrac"],
  props: {
    numArgs: 6,
    allowedInArgument: true,
    argTypes: ["math", "math", "size", "text", "math", "math"]
  },
  handler(_ref3, args) {
    let {
      parser
    } = _ref3;
    const numer = args[4];
    const denom = args[5];

    // Look into the parse nodes to get the desired delimiters.
    const leftNode = normalizeArgument(args[0]);
    const leftDelim = leftNode.type === "atom" && leftNode.family === "open" ? delimFromValue(leftNode.text) : null;
    const rightNode = normalizeArgument(args[1]);
    const rightDelim = rightNode.type === "atom" && rightNode.family === "close" ? delimFromValue(rightNode.text) : null;
    const barNode = assertNodeType(args[2], "size");
    let hasBarLine;
    let barSize = null;
    if (barNode.isBlank) {
      // \genfrac acts differently than \above.
      // \genfrac treats an empty size group as a signal to use a
      // standard bar size. \above would see size = 0 and omit the bar.
      hasBarLine = true;
    } else {
      barSize = barNode.value;
      hasBarLine = barSize.number > 0;
    }

    // Find out if we want displaystyle, textstyle, etc.
    let size = null;
    let styl = args[3];
    if (styl.type === "ordgroup") {
      if (styl.body.length > 0) {
        const textOrd = assertNodeType(styl.body[0], "textord");
        size = stylArray[Number(textOrd.text)];
      }
    } else {
      styl = assertNodeType(styl, "textord");
      size = stylArray[Number(styl.text)];
    }
    return wrapWithStyle({
      type: "genfrac",
      mode: parser.mode,
      numer,
      denom,
      continued: false,
      hasBarLine,
      barSize,
      leftDelim,
      rightDelim
    }, size);
  }
});

// \above is an infix fraction that also defines a fraction bar size.
defineFunction({
  type: "infix",
  names: ["\\above"],
  props: {
    numArgs: 1,
    argTypes: ["size"],
    infix: true
  },
  handler(_ref4, args) {
    let {
      parser,
      funcName,
      token
    } = _ref4;
    return {
      type: "infix",
      mode: parser.mode,
      replaceWith: "\\\\abovefrac",
      size: assertNodeType(args[0], "size").value,
      token
    };
  }
});
defineFunction({
  type: "genfrac",
  names: ["\\\\abovefrac"],
  props: {
    numArgs: 3,
    argTypes: ["math", "size", "math"]
  },
  handler: (_ref5, args) => {
    let {
      parser,
      funcName
    } = _ref5;
    const numer = args[0];
    const barSize = assertNodeType(args[1], "infix").size;
    if (!barSize) {
      throw new Error("\\\\abovefrac expected size, but got " + String(barSize));
    }
    const denom = args[2];
    const hasBarLine = barSize.number > 0;
    return {
      type: "genfrac",
      mode: parser.mode,
      numer,
      denom,
      continued: false,
      hasBarLine,
      barSize,
      leftDelim: null,
      rightDelim: null
    };
  }
});
;// ./src/functions/horizBrace.ts








// NOTE: Unlike most `htmlBuilder`s, this one handles not only "horizBrace", but
// also "supsub" since an over/underbrace can affect super/subscripting.
const horizBrace_htmlBuilder = (grp, options) => {
  const style = options.style;

  // Pull out the `ParseNode<"horizBrace">` if `grp` is a "supsub" node.
  let supSubGroup;
  let group;
  if (grp.type === "supsub") {
    // Ref: LaTeX source2e: }}}}\limits}
    // i.e. LaTeX treats the brace similar to an op and passes it
    // with \limits, so we need to assign supsub style.
    supSubGroup = grp.sup ? buildGroup(grp.sup, options.havingStyle(style.sup()), options) : buildGroup(grp.sub, options.havingStyle(style.sub()), options);
    group = assertNodeType(grp.base, "horizBrace");
  } else {
    group = assertNodeType(grp, "horizBrace");
  }

  // Build the base group
  const body = buildGroup(group.base, options.havingBaseStyle(src_Style.DISPLAY));

  // Create the stretchy element
  const braceBody = stretchySvg(group, options);

  // Generate the vlist, with the appropriate kerns        ┏━━━━━━━━┓
  // This first vlist contains the content and the brace:   equation
  let vlist;
  if (group.isOver) {
    vlist = makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: body
      }, {
        type: "kern",
        size: 0.1
      }, {
        type: "elem",
        elem: braceBody,
        wrapperClasses: ["svg-align"]
      }]
    }, options);
  } else {
    vlist = makeVList({
      positionType: "bottom",
      positionData: body.depth + 0.1 + braceBody.height,
      children: [{
        type: "elem",
        elem: braceBody,
        wrapperClasses: ["svg-align"]
      }, {
        type: "kern",
        size: 0.1
      }, {
        type: "elem",
        elem: body
      }]
    }, options);
  }
  if (supSubGroup) {
    // To write the supsub, wrap the first vlist in another vlist:
    // They can't all go in the same vlist, because the note might be
    // wider than the equation. We want the equation to control the
    // brace width.

    //      note          long note           long note
    //   ┏━━━━━━━━┓   or    ┏━━━┓     not    ┏━━━━━━━━━┓
    //    equation           eqn                 eqn

    const vSpan = makeSpan(["minner", group.isOver ? "mover" : "munder"], [vlist], options);
    if (group.isOver) {
      vlist = makeVList({
        positionType: "firstBaseline",
        children: [{
          type: "elem",
          elem: vSpan
        }, {
          type: "kern",
          size: 0.2
        }, {
          type: "elem",
          elem: supSubGroup
        }]
      }, options);
    } else {
      vlist = makeVList({
        positionType: "bottom",
        positionData: vSpan.depth + 0.2 + supSubGroup.height + supSubGroup.depth,
        children: [{
          type: "elem",
          elem: supSubGroup
        }, {
          type: "kern",
          size: 0.2
        }, {
          type: "elem",
          elem: vSpan
        }]
      }, options);
    }
  }
  return makeSpan(["minner", group.isOver ? "mover" : "munder"], [vlist], options);
};
const horizBrace_mathmlBuilder = (group, options) => {
  const accentNode = stretchyMathML(group.label);
  return new MathNode(group.isOver ? "mover" : "munder", [buildMathML_buildGroup(group.base, options), accentNode]);
};

// Horizontal stretchy braces
defineFunction({
  type: "horizBrace",
  names: ["\\overbrace", "\\underbrace", "\\overbracket", "\\underbracket"],
  props: {
    numArgs: 1
  },
  handler(_ref, args) {
    let {
      parser,
      funcName
    } = _ref;
    return {
      type: "horizBrace",
      mode: parser.mode,
      label: funcName,
      isOver: funcName.includes("\\over"),
      base: args[0]
    };
  },
  htmlBuilder: horizBrace_htmlBuilder,
  mathmlBuilder: horizBrace_mathmlBuilder
});
;// ./src/functions/href.ts






defineFunction({
  type: "href",
  names: ["\\href"],
  props: {
    numArgs: 2,
    argTypes: ["url", "original"],
    allowedInText: true
  },
  handler: (_ref, args) => {
    let {
      parser
    } = _ref;
    const body = args[1];
    const href = assertNodeType(args[0], "url").url;
    if (!parser.settings.isTrusted({
      command: "\\href",
      url: href
    })) {
      return parser.formatUnsupportedCmd("\\href");
    }
    return {
      type: "href",
      mode: parser.mode,
      href,
      body: ordargument(body)
    };
  },
  htmlBuilder: (group, options) => {
    const elements = buildExpression(group.body, options, false);
    return makeAnchor(group.href, [], elements, options);
  },
  mathmlBuilder: (group, options) => {
    let math = buildExpressionRow(group.body, options);
    if (!(math instanceof MathNode)) {
      math = new MathNode("mrow", [math]);
    }
    math.setAttribute("href", group.href);
    return math;
  }
});
defineFunction({
  type: "href",
  names: ["\\url"],
  props: {
    numArgs: 1,
    argTypes: ["url"],
    allowedInText: true
  },
  handler: (_ref2, args) => {
    let {
      parser
    } = _ref2;
    const href = assertNodeType(args[0], "url").url;
    if (!parser.settings.isTrusted({
      command: "\\url",
      url: href
    })) {
      return parser.formatUnsupportedCmd("\\url");
    }
    const chars = [];
    for (let i = 0; i < href.length; i++) {
      let c = href[i];
      if (c === "~") {
        c = "\\textasciitilde";
      }
      chars.push({
        type: "textord",
        mode: "text",
        text: c
      });
    }
    const body = {
      type: "text",
      mode: parser.mode,
      font: "\\texttt",
      body: chars
    };
    return {
      type: "href",
      mode: parser.mode,
      href,
      body: ordargument(body)
    };
  }
});
;// ./src/functions/hbox.ts






// \hbox is provided for compatibility with LaTeX \vcenter.
// In LaTeX, \vcenter can act only on a box, as in
// \vcenter{\hbox{$\frac{a+b}{\dfrac{c}{d}}$}}
// This function by itself doesn't do anything but prevent a soft line break.

defineFunction({
  type: "hbox",
  names: ["\\hbox"],
  props: {
    numArgs: 1,
    argTypes: ["text"],
    allowedInText: true,
    primitive: true
  },
  handler(_ref, args) {
    let {
      parser
    } = _ref;
    return {
      type: "hbox",
      mode: parser.mode,
      body: ordargument(args[0])
    };
  },
  htmlBuilder(group, options) {
    const elements = buildExpression(group.body, options.withFont(''), false);
    return makeFragment(elements);
  },
  mathmlBuilder(group, options) {
    return new MathNode("mrow", buildMathML_buildExpression(group.body, options.withFont('')));
  }
});
;// ./src/functions/html.ts






defineFunction({
  type: "html",
  names: ["\\htmlClass", "\\htmlId", "\\htmlStyle", "\\htmlData"],
  props: {
    numArgs: 2,
    argTypes: ["raw", "original"],
    allowedInText: true
  },
  handler: (_ref, args) => {
    let {
      parser,
      funcName,
      token
    } = _ref;
    const value = assertNodeType(args[0], "raw").string;
    const body = args[1];
    if (parser.settings.strict) {
      parser.settings.reportNonstrict("htmlExtension", "HTML extension is disabled on strict mode");
    }
    let trustContext;
    const attributes = {};
    switch (funcName) {
      case "\\htmlClass":
        attributes.class = value;
        trustContext = {
          command: "\\htmlClass",
          class: value
        };
        break;
      case "\\htmlId":
        attributes.id = value;
        trustContext = {
          command: "\\htmlId",
          id: value
        };
        break;
      case "\\htmlStyle":
        attributes.style = value;
        trustContext = {
          command: "\\htmlStyle",
          style: value
        };
        break;
      case "\\htmlData":
        {
          const data = value.split(",");
          for (let i = 0; i < data.length; i++) {
            const item = data[i];
            const firstEquals = item.indexOf("=");
            if (firstEquals < 0) {
              throw new src_ParseError("\\htmlData key/value '" + item + "'" + " missing equals sign");
            }
            const key = item.slice(0, firstEquals);
            const value = item.slice(firstEquals + 1);
            attributes["data-" + key.trim()] = value;
          }
          trustContext = {
            command: "\\htmlData",
            attributes
          };
          break;
        }
      default:
        throw new Error("Unrecognized html command");
    }
    if (!parser.settings.isTrusted(trustContext)) {
      return parser.formatUnsupportedCmd(funcName);
    }
    return {
      type: "html",
      mode: parser.mode,
      attributes,
      body: ordargument(body)
    };
  },
  htmlBuilder: (group, options) => {
    const elements = buildExpression(group.body, options, false);
    const classes = ["enclosing"];
    if (group.attributes.class) {
      classes.push(...group.attributes.class.trim().split(/\s+/));
    }
    const span = makeSpan(classes, elements, options);
    for (const attr in group.attributes) {
      if (attr !== "class" && group.attributes.hasOwnProperty(attr)) {
        span.setAttribute(attr, group.attributes[attr]);
      }
    }
    return span;
  },
  mathmlBuilder: (group, options) => {
    return buildExpressionRow(group.body, options);
  }
});
;// ./src/functions/htmlmathml.ts




defineFunction({
  type: "htmlmathml",
  names: ["\\html@mathml"],
  props: {
    numArgs: 2,
    allowedInArgument: true,
    allowedInText: true
  },
  handler: (_ref, args) => {
    let {
      parser
    } = _ref;
    return {
      type: "htmlmathml",
      mode: parser.mode,
      html: ordargument(args[0]),
      mathml: ordargument(args[1])
    };
  },
  htmlBuilder: (group, options) => {
    const elements = buildExpression(group.html, options, false);
    return makeFragment(elements);
  },
  mathmlBuilder: (group, options) => {
    return buildExpressionRow(group.mathml, options);
  }
});
;// ./src/functions/includegraphics.ts






const sizeData = function (str) {
  if (/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(str)) {
    // str is a number with no unit specified.
    // default unit is bp, per graphix package.
    return {
      number: +str,
      unit: "bp"
    };
  } else {
    const match = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(str);
    if (!match) {
      throw new src_ParseError("Invalid size: '" + str + "' in \\includegraphics");
    }
    const data = {
      number: +(match[1] + match[2]),
      // sign + magnitude, cast to number
      unit: match[3]
    };
    if (!validUnit(data)) {
      throw new src_ParseError("Invalid unit: '" + data.unit + "' in \\includegraphics.");
    }
    return data;
  }
};
defineFunction({
  type: "includegraphics",
  names: ["\\includegraphics"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1,
    argTypes: ["raw", "url"],
    allowedInText: false
  },
  handler: (_ref, args, optArgs) => {
    let {
      parser
    } = _ref;
    let width = {
      number: 0,
      unit: "em"
    };
    let height = {
      number: 0.9,
      unit: "em"
    }; // sorta character sized.
    let totalheight = {
      number: 0,
      unit: "em"
    };
    let alt = "";
    if (optArgs[0]) {
      const attributeStr = assertNodeType(optArgs[0], "raw").string;

      // Parser.js does not parse key/value pairs. We get a string.
      const attributes = attributeStr.split(",");
      for (let i = 0; i < attributes.length; i++) {
        const keyVal = attributes[i].split("=");
        if (keyVal.length === 2) {
          const str = keyVal[1].trim();
          switch (keyVal[0].trim()) {
            case "alt":
              alt = str;
              break;
            case "width":
              width = sizeData(str);
              break;
            case "height":
              height = sizeData(str);
              break;
            case "totalheight":
              totalheight = sizeData(str);
              break;
            default:
              throw new src_ParseError("Invalid key: '" + keyVal[0] + "' in \\includegraphics.");
          }
        }
      }
    }
    const src = assertNodeType(args[0], "url").url;
    if (alt === "") {
      // No alt given. Use the file name. Strip away the path.
      alt = src;
      alt = alt.replace(/^.*[\\/]/, '');
      alt = alt.substring(0, alt.lastIndexOf('.'));
    }
    if (!parser.settings.isTrusted({
      command: "\\includegraphics",
      url: src
    })) {
      return parser.formatUnsupportedCmd("\\includegraphics");
    }
    return {
      type: "includegraphics",
      mode: parser.mode,
      alt: alt,
      width: width,
      height: height,
      totalheight: totalheight,
      src: src
    };
  },
  htmlBuilder: (group, options) => {
    const height = calculateSize(group.height, options);
    let depth = 0;
    if (group.totalheight.number > 0) {
      depth = calculateSize(group.totalheight, options) - height;
    }
    let width = 0;
    if (group.width.number > 0) {
      width = calculateSize(group.width, options);
    }
    const style = {
      height: makeEm(height + depth)
    };
    if (width > 0) {
      style.width = makeEm(width);
    }
    if (depth > 0) {
      style.verticalAlign = makeEm(-depth);
    }
    const node = new Img(group.src, group.alt, style);
    node.height = height;
    node.depth = depth;
    return node;
  },
  mathmlBuilder: (group, options) => {
    const node = new MathNode("mglyph", []);
    node.setAttribute("alt", group.alt);
    const height = calculateSize(group.height, options);
    let depth = 0;
    if (group.totalheight.number > 0) {
      depth = calculateSize(group.totalheight, options) - height;
      node.setAttribute("valign", makeEm(-depth));
    }
    node.setAttribute("height", makeEm(height + depth));
    if (group.width.number > 0) {
      const width = calculateSize(group.width, options);
      node.setAttribute("width", makeEm(width));
    }
    node.setAttribute("src", group.src);
    return node;
  }
});
;// ./src/functions/kern.ts
// Horizontal spacing commands







// TODO: \hskip and \mskip should support plus and minus in lengths

defineFunction({
  type: "kern",
  names: ["\\kern", "\\mkern", "\\hskip", "\\mskip"],
  props: {
    numArgs: 1,
    argTypes: ["size"],
    primitive: true,
    allowedInText: true
  },
  handler(_ref, args) {
    let {
      parser,
      funcName
    } = _ref;
    const size = assertNodeType(args[0], "size");
    if (parser.settings.strict) {
      const mathFunction = funcName[1] === 'm'; // \mkern, \mskip
      const muUnit = size.value.unit === 'mu';
      if (mathFunction) {
        if (!muUnit) {
          parser.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " supports only mu units, " + ("not " + size.value.unit + " units"));
        }
        if (parser.mode !== "math") {
          parser.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " works only in math mode");
        }
      } else {
        // !mathFunction
        if (muUnit) {
          parser.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " doesn't support mu units");
        }
      }
    }
    return {
      type: "kern",
      mode: parser.mode,
      dimension: size.value
    };
  },
  htmlBuilder(group, options) {
    return makeGlue(group.dimension, options);
  },
  mathmlBuilder(group, options) {
    const dimension = calculateSize(group.dimension, options);
    return new SpaceNode(dimension);
  }
});
;// ./src/functions/lap.ts
// Horizontal overlap functions






defineFunction({
  type: "lap",
  names: ["\\mathllap", "\\mathrlap", "\\mathclap"],
  props: {
    numArgs: 1,
    allowedInText: true
  },
  handler: (_ref, args) => {
    let {
      parser,
      funcName
    } = _ref;
    const body = args[0];
    return {
      type: "lap",
      mode: parser.mode,
      alignment: funcName.slice(5),
      body
    };
  },
  htmlBuilder: (group, options) => {
    // mathllap, mathrlap, mathclap
    let inner;
    if (group.alignment === "clap") {
      // ref: https://www.math.lsu.edu/~aperlis/publications/mathclap/
      inner = makeSpan([], [buildGroup(group.body, options)]);
      // wrap, since CSS will center a .clap > .inner > span
      inner = makeSpan(["inner"], [inner], options);
    } else {
      inner = makeSpan(["inner"], [buildGroup(group.body, options)]);
    }
    const fix = makeSpan(["fix"], []);
    let node = makeSpan([group.alignment], [inner, fix], options);

    // At this point, we have correctly set horizontal alignment of the
    // two items involved in the lap.
    // Next, use a strut to set the height of the HTML bounding box.
    // Otherwise, a tall argument may be misplaced.
    // This code resolved issue #1153
    const strut = makeSpan(["strut"]);
    strut.style.height = makeEm(node.height + node.depth);
    if (node.depth) {
      strut.style.verticalAlign = makeEm(-node.depth);
    }
    node.children.unshift(strut);

    // Next, prevent vertical misplacement when next to something tall.
    // This code resolves issue #1234
    node = makeSpan(["thinbox"], [node], options);
    return makeSpan(["mord", "vbox"], [node], options);
  },
  mathmlBuilder: (group, options) => {
    // mathllap, mathrlap, mathclap
    const node = new MathNode("mpadded", [buildMathML_buildGroup(group.body, options)]);
    if (group.alignment !== "rlap") {
      const offset = group.alignment === "llap" ? "-1" : "-0.5";
      node.setAttribute("lspace", offset + "width");
    }
    node.setAttribute("width", "0px");
    return node;
  }
});
;// ./src/functions/math.ts



// Switching from text mode back to math mode
defineFunction({
  type: "styling",
  names: ["\\(", "$"],
  props: {
    numArgs: 0,
    allowedInText: true,
    allowedInMath: false
  },
  handler(_ref, args) {
    let {
      funcName,
      parser
    } = _ref;
    const outerMode = parser.mode;
    parser.switchMode("math");
    const close = funcName === "\\(" ? "\\)" : "$";
    const body = parser.parseExpression(false, close);
    parser.expect(close);
    parser.switchMode(outerMode);
    return {
      type: "styling",
      mode: parser.mode,
      style: "text",
      resetFont: true,
      body
    };
  }
});

// Check for extra closing math delimiters
defineFunction({
  type: "text",
  // Doesn't matter what this is.
  names: ["\\)", "\\]"],
  props: {
    numArgs: 0,
    allowedInText: true,
    allowedInMath: false
  },
  handler(context, args) {
    throw new src_ParseError("Mismatched " + context.funcName);
  }
});
;// ./src/functions/mathchoice.ts





const chooseMathStyle = (group, options) => {
  switch (options.style.size) {
    case src_Style.DISPLAY.size:
      return group.display;
    case src_Style.TEXT.size:
      return group.text;
    case src_Style.SCRIPT.size:
      return group.script;
    case src_Style.SCRIPTSCRIPT.size:
      return group.scriptscript;
    default:
      return group.text;
  }
};
defineFunction({
  type: "mathchoice",
  names: ["\\mathchoice"],
  props: {
    numArgs: 4,
    primitive: true
  },
  handler: (_ref, args) => {
    let {
      parser
    } = _ref;
    return {
      type: "mathchoice",
      mode: parser.mode,
      display: ordargument(args[0]),
      text: ordargument(args[1]),
      script: ordargument(args[2]),
      scriptscript: ordargument(args[3])
    };
  },
  htmlBuilder: (group, options) => {
    const body = chooseMathStyle(group, options);
    const elements = buildExpression(body, options, false);
    return makeFragment(elements);
  },
  mathmlBuilder: (group, options) => {
    const body = chooseMathStyle(group, options);
    return buildExpressionRow(body, options);
  }
});
;// ./src/functions/utils/assembleSupSub.ts





// For an operator with limits, assemble the base, sup, and sub into a span.

const assembleSupSub = (base, supGroup, subGroup, options, style, slant, baseShift) => {
  base = makeSpan([], [base]);
  const subIsSingleCharacter = subGroup && isCharacterBox(subGroup);
  let sub;
  let sup;
  // We manually have to handle the superscripts and subscripts. This,
  // aside from the kern calculations, is copied from supsub.
  if (supGroup) {
    const elem = buildGroup(supGroup, options.havingStyle(style.sup()), options);
    sup = {
      elem,
      kern: Math.max(options.fontMetrics().bigOpSpacing1, options.fontMetrics().bigOpSpacing3 - elem.depth)
    };
  }
  if (subGroup) {
    const elem = buildGroup(subGroup, options.havingStyle(style.sub()), options);
    sub = {
      elem,
      kern: Math.max(options.fontMetrics().bigOpSpacing2, options.fontMetrics().bigOpSpacing4 - elem.height)
    };
  }

  // Build the final group as a vlist of the possible subscript, base,
  // and possible superscript.
  let finalGroup;
  if (sup && sub) {
    const bottom = options.fontMetrics().bigOpSpacing5 + sub.elem.height + sub.elem.depth + sub.kern + base.depth + baseShift;
    finalGroup = makeVList({
      positionType: "bottom",
      positionData: bottom,
      children: [{
        type: "kern",
        size: options.fontMetrics().bigOpSpacing5
      }, {
        type: "elem",
        elem: sub.elem,
        marginLeft: makeEm(-slant)
      }, {
        type: "kern",
        size: sub.kern
      }, {
        type: "elem",
        elem: base
      }, {
        type: "kern",
        size: sup.kern
      }, {
        type: "elem",
        elem: sup.elem,
        marginLeft: makeEm(slant)
      }, {
        type: "kern",
        size: options.fontMetrics().bigOpSpacing5
      }]
    }, options);
  } else if (sub) {
    const top = base.height - baseShift;

    // Shift the limits by the slant of the symbol. Note
    // that we are supposed to shift the limits by 1/2 of the slant,
    // but since we are centering the limits adding a full slant of
    // margin will shift by 1/2 that.
    finalGroup = makeVList({
      positionType: "top",
      positionData: top,
      children: [{
        type: "kern",
        size: options.fontMetrics().bigOpSpacing5
      }, {
        type: "elem",
        elem: sub.elem,
        marginLeft: makeEm(-slant)
      }, {
        type: "kern",
        size: sub.kern
      }, {
        type: "elem",
        elem: base
      }]
    }, options);
  } else if (sup) {
    const bottom = base.depth + baseShift;
    finalGroup = makeVList({
      positionType: "bottom",
      positionData: bottom,
      children: [{
        type: "elem",
        elem: base
      }, {
        type: "kern",
        size: sup.kern
      }, {
        type: "elem",
        elem: sup.elem,
        marginLeft: makeEm(slant)
      }, {
        type: "kern",
        size: options.fontMetrics().bigOpSpacing5
      }]
    }, options);
  } else {
    // This case probably shouldn't occur (this would mean the
    // supsub was sending us a group with no superscript or
    // subscript) but be safe.
    return base;
  }
  const parts = [finalGroup];
  if (sub && slant !== 0 && !subIsSingleCharacter) {
    // A negative margin-left was applied to the lower limit.
    // Avoid an overlap by placing a spacer on the left on the group.
    const spacer = makeSpan(["mspace"], [], options);
    spacer.style.marginRight = makeEm(slant);
    parts.unshift(spacer);
  }
  return makeSpan(["mop", "op-limits"], parts, options);
};
;// ./src/functions/op.ts
// Limits, symbols










// Most operators have a large successor symbol, but these don't.
const noSuccessor = new Set(["\\smallint"]);

// NOTE: Unlike most `htmlBuilder`s, this one handles not only "op", but also
// "supsub" since some of them (like \int) can affect super/subscripting.
const op_htmlBuilder = (grp, options) => {
  // Operators are handled in the TeXbook pg. 443-444, rule 13(a).
  let supGroup;
  let subGroup;
  let hasLimits = false;
  let group;
  if (grp.type === "supsub") {
    // If we have limits, supsub will pass us its group to handle. Pull
    // out the superscript and subscript and set the group to the op in
    // its base.
    supGroup = grp.sup;
    subGroup = grp.sub;
    group = assertNodeType(grp.base, "op");
    hasLimits = true;
  } else {
    group = assertNodeType(grp, "op");
  }
  const style = options.style;
  let large = false;
  if (style.size === src_Style.DISPLAY.size && group.symbol && !noSuccessor.has(group.name)) {
    // Most symbol operators get larger in displaystyle (rule 13)
    large = true;
  }
  let base;
  // Italic correction from the symbol glyph, captured before the symbol
  // may be wrapped in a vlist (for \oiint/\oiiint).  Stays 0 for non-symbol ops.
  let symbolItalic;
  if (group.symbol) {
    // If this is a symbol, create the symbol.
    const fontName = large ? "Size2-Regular" : "Size1-Regular";
    let stash = "";
    if (group.name === "\\oiint" || group.name === "\\oiiint") {
      // No font glyphs yet, so use a glyph w/o the oval.
      // TODO: When font glyphs are available, delete this code.
      stash = group.name.slice(1);
      group.name = stash === "oiint" ? "\\iint" : "\\iiint";
    }
    base = makeSy   mbol(group.name, fontName, "math", options, ["mop", "op-symbol", large ? "large-op" : "small-op"]);
    symbolItalic = base.italic;
    if (stash.length > 0) {
      // We're in \oiint or \oiiint. Overlay the oval.
      // TODO: When font glyphs are available, delete this code.
      const oval = staticSvg(stash + "Size" + (large ? "2" : "1"), options);
      base = makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: base,
          shift: 0
        }, {
          type: "elem",
          elem: oval,
          shift: large ? 0.08 : 0
        }]
      }, options);
      group.name = "\\" + stash;
      base.classes.unshift("mop");
      // Carry the italic correction from the original symbol to the
      // vlist wrapper so supsub can use it for subscript positioning.
      base.italic = symbolItalic;
    }
  } else if (group.body) {
    // If this is a list, compose that list.
    const inner = buildExpression(group.body, options, true);
    if (inner.length === 1 && inner[0] instanceof SymbolNode) {
      base = inner[0];
      base.classes[0] = "mop"; // replace old mclass
    } else {
      base = makeSpan(["mop"], inner, options);
    }
  } else {
    // Otherwise, this is a text operator. Build the text from the
    // operator's name.
    const output = [];
    for (let i = 1; i < group.name.length; i++) {
      output.push(mathsym(group.name[i], group.mode, options));
    }
    base = makeSpan(["mop"], output, options);
  }

  // If content of op is a single symbol, shift it vertically.
  let baseShift = 0;
  let slant = 0;
  if ((base instanceof SymbolNode || group.name === "\\oiint" || group.name === "\\oiiint") && !group.suppressBaseShift) {
    var _base$italic;
    // We suppress the shift of the base of \overset and \underset. Otherwise,
    // shift the symbol so its center lies on the axis (rule 13). It
    // appears that our fonts have the centers of the symbols already
    // almost on the axis, so these numbers are very small. Note we
    // don't actually apply this here, but instead it is used either in
    // the vlist creation or separately when there are no limits.
    baseShift = (base.height - base.depth) / 2 - options.fontMetrics().axisHeight;

    // The slant of the symbol is just its italic correction.
    // SymbolNode carries .italic natively; Span (for \oiint/\oiiint)
    // only has it set when nonzero, so default to 0.
    slant = (_base$italic = base.italic) != null ? _base$italic : 0;
  }
  if (hasLimits) {
    return assembleSupSub(base, supGroup, subGroup, options, style, slant, baseShift);
  } else {
    if (baseShift) {
      base.style.position = "relative";
      base.style.top = makeEm(baseShift);
    }
    return base;
  }
};
const op_mathmlBuilder = (group, options) => {
  let node;
  if (group.symbol) {
    // This is a symbol. Just add the symbol.
    node = new MathNode("mo", [makeText(group.name, group.mode)]);
    if (noSuccessor.has(group.name)) {
      node.setAttribute("largeop", "false");
    }
  } else if (group.body) {
    // This is an operator with children. Add them.
    node = new MathNode("mo", buildMathML_buildExpression(group.body, options));
  } else {
    // This is a text operator. Add all the characters from the
    // operator's name.
    node = new MathNode("mi", [new TextNode(group.name.slice(1))]);
    // Append an <mo>&ApplyFunction;</mo>.
    // ref: https://www.w3.org/TR/REC-MathML/chap3_2.html#sec3.2.4
    const operator = new MathNode("mo", [makeText("\u2061", "text")]);
    if (group.parentIsSupSub) {
      node = new MathNode("mrow", [node, operator]);
    } else {
      node = newDocumentFragment([node, operator]);
    }
  }
  return node;
};
const singleCharBigOps = {
  "\u220F": "\\prod",
  "\u2210": "\\coprod",
  "\u2211": "\\sum",
  "\u22c0": "\\bigwedge",
  "\u22c1": "\\bigvee",
  "\u22c2": "\\bigcap",
  "\u22c3": "\\bigcup",
  "\u2a00": "\\bigodot",
  "\u2a01": "\\bigoplus",
  "\u2a02": "\\bigotimes",
  "\u2a04": "\\biguplus",
  "\u2a06": "\\bigsqcup"
};
defineFunction({
  type: "op",
  names: ["\\coprod", "\\bigvee", "\\bigwedge", "\\biguplus", "\\bigcap", "\\bigcup", "\\intop", "\\prod", "\\sum", "\\bigotimes", "\\bigoplus", "\\bigodot", "\\bigsqcup", "\\smallint", "\u220F", "\u2210", "\u2211", "\u22c0", "\u22c1", "\u22c2", "\u22c3", "\u2a00", "\u2a01", "\u2a02", "\u2a04", "\u2a06"],
  props: {
    numArgs: 0
  },
  handler: (_ref, args) => {
    let {
      parser,
      funcName
    } = _ref;
    let fName = funcName;
    if (fName.length === 1) {
      fName = singleCharBigOps[fName];
    }
    return {
      type: "op",
      mode: parser.mode,
      limits: true,
      parentIsSupSub: false,
      symbol: true,
      name: fName
    };
  },
  htmlBuilder: op_htmlBuilder,
  mathmlBuilder: op_mathmlBuilder
});

// Note: calling defineFunction with a type that's already been defined only
// works because the same htmlBuilder and mathmlBuilder are being used.
defineFunction({
  type: "op",
  names: ["\\mathop"],
  props: {
    numArgs: 1,
    primitive: true
  },
  handler: (_ref2, args) => {
    let {
      parser
    } = _ref2;
    const body = args[0];
    return {
      type: "op",
      mode: parser.mode,
      limits: false,
      parentIsSupSub: false,
      symbol: false,
      body: ordargument(body)
    };
  },
  htmlBuilder: op_htmlBuilder,
  mathmlBuilder: op_mathmlBuilder
});

// There are 2 flags for operators; whether they produce limits in
// displaystyle, and whether they are symbols and should grow in
// displaystyle. These four groups cover the four possible choices.
const singleCharIntegrals = {
  "\u222b": "\\int",
  "\u222c": "\\iint",
  "\u222d": "\\iiint",
  "\u222e": "\\oint",
  "\u222f": "\\oiint",
  "\u2230": "\\oiiint"
};

// No limits, not symbols
defineFunction({
  type: "op",
  names: ["\\arcsin", "\\arccos", "\\arctan", "\\arctg", "\\arcctg", "\\arg", "\\ch", "\\cos", "\\cosec", "\\cosh", "\\cot", "\\cotg", "\\coth", "\\csc", "\\ctg", "\\cth", "\\deg", "\\dim", "\\exp", "\\hom", "\\ker", "\\lg", "\\ln", "\\log", "\\sec", "\\sin", "\\sinh", "\\sh", "\\tan", "\\tanh", "\\tg", "\\th"],
  props: {
    numArgs: 0
  },
  handler(_ref3) {
    let {
      parser,
      funcName
    } = _ref3;
    return {
      type: "op",
      mode: parser.mode,
      limits: false,
      parentIsSupSub: false,
      symbol: false,
      name: funcName
    };
  },
  htmlBuilder: op_htmlBuilder,
  mathmlBuilder: op_mathmlBuilder
});

// Limits, not symbols
defineFunction({
  type: "op",
  names: ["\\det", "\\gcd", "\\inf", "\\lim", "\\max", "\\min", "\\Pr", "\\sup"],
  props: {
    numArgs: 0
  },
  handler(_ref4) {
    let {
      parser,
      funcName
    } = _ref4;
    return {
      type: "op",
      mode: parser.mode,
      limits: true,
      parentIsSupSub: false,
      symbol: false,
      name: funcName
    };
  },
  htmlBuilder: op_htmlBuilder,
  mathmlBuilder: op_mathmlBuilder
});

// No limits, symbols
defineFunction({
  type: "op",
  names: ["\\int", "\\iint", "\\iiint", "\\oint", "\\oiint", "\\oiiint", "\u222b", "\u222c", "\u222d", "\u222e", "\u222f", "\u2230"],
  props: {
    numArgs: 0,
    allowedInArgument: true
  },
  handler(_ref5) {
    let {
      parser,
      funcName
    } = _ref5;
    let fName = funcName;
    if (fName.length === 1) {
      fName = singleCharIntegrals[fName];
    }
    return {
      type: "op",
      mode: parser.mode,
      limits: false,
      parentIsSupSub: false,
      symbol: true,
      name: fName
    };
  },
  htmlBuilder: op_htmlBuilder,
  mathmlBuilder: op_mathmlBuilder
});
;// ./src/functions/operatorname.ts









// NOTE: Unlike most `htmlBuilder`s, this one handles not only
// "operatorname", but also  "supsub" since \operatorname* can
// affect super/subscripting.
const operatorname_htmlBuilder = (grp, options) => {
  // Operators are handled in the TeXbook pg. 443-444, rule 13(a).
  let supGroup;
  let subGroup;
  let hasLimits = false;
  let group;
  if (grp.type === "supsub") {
    // If we have limits, supsub will pass us its group to handle. Pull
    // out the superscript and subscript and set the group to the op in
    // its base.
    supGroup = grp.sup;
    subGroup = grp.sub;
    group = assertNodeType(grp.base, "operatorname");
    hasLimits = true;
  } else {
    group = assertNodeType(grp, "operatorname");
  }
  let base;
  if (group.body.length > 0) {
    const body = group.body.map(child => {
      const childText = "text" in child ? child.text : undefined;
      if (typeof childText === "string") {
        return {
          type: "textord",
          mode: child.mode,
          text: childText
        };
      } else {
        return child;
      }
    });

    // Consolidate function names into symbol characters.
    const expression = buildExpression(body, options.withFont("mathrm"), true);
    for (let i = 0; i < expression.length; i++) {
      const child = expression[i];
      if (child instanceof SymbolNode) {
        // Per amsopn package,
        // change minus to hyphen and \ast to asterisk
        child.text = child.text.replace(/\u2212/, "-").replace(/\u2217/, "*");
      }
    }
    base = makeSpan(["mop"], expression, options);
  } else {
    base = makeSpan(["mop"], [], options);
  }
  if (hasLimits) {
    return assembleSupSub(base, supGroup, subGroup, options, options.style, 0, 0);
  } else {
    return base;
  }
};
const operatorname_mathmlBuilder = (group, options) => {
  // The steps taken here are similar to the html version.
  let expression = buildMathML_buildExpression(group.body, options.withFont("mathrm"));

  // Is expression a string or has it something like a fraction?
  let isAllString = true; // default
  for (let i = 0; i < expression.length; i++) {
    const node = expression[i];
    if (node instanceof SpaceNode) {
      // Do nothing
    } else if (node instanceof MathNode) {
      switch (node.type) {
        case "mi":
        case "mn":
        case "mspace":
        case "mtext":
          break;
        // Do nothing yet.
        case "mo":
          {
            const child = node.children[0];
            if (node.children.length === 1 && child instanceof TextNode) {
              child.text = child.text.replace(/\u2212/, "-").replace(/\u2217/, "*");
            } else {
              isAllString = false;
            }
            break;
          }
        default:
          isAllString = false;
      }
    } else {
      isAllString = false;
    }
  }
  if (isAllString) {
    // Write a single TextNode instead of multiple nested tags.
    const word = expression.map(node => node.toText()).join("");
    expression = [new TextNode(word)];
  }
  const identifier = new MathNode("mi", expression);
  identifier.setAttribute("mathvariant", "normal");

  // \u2061 is the same as &ApplyFunction;
  // ref: https://www.w3schools.com/charsets/ref_html_entities_a.asp
  const operator = new MathNode("mo", [makeText("\u2061", "text")]);
  if (group.parentIsSupSub) {
    return new MathNode("mrow", [identifier, operator]);
  } else {
    return newDocumentFragment([identifier, operator]);
  }
};

// \operatorname
// amsopn.dtx: \mathop{#1\kern\z@\operator@font#3}\newmcodes@
defineFunction({
  type: "operatorname",
  names: ["\\operatorname@", "\\operatornamewithlimits"],
  props: {
    numArgs: 1
  },
  handler: (_ref, args) => {
    let {
      parser,
      funcName
    } = _ref;
    const body = args[0];
    return {
      type: "operatorname",
      mode: parser.mode,
      body: ordargument(body),
      alwaysHandleSupSub: funcName === "\\operatornamewithlimits",
      limits: false,
      parentIsSupSub: false
    };
  },
  htmlBuilder: operatorname_htmlBuilder,
  mathmlBuilder: operatorname_mathmlBuilder
});
defineMacro("\\operatorname", "\\@ifstar\\operatornamewithlimits\\operatorname@");
;// ./src/functions/ordgroup.ts




defineFunctionBuilders({
  type: "ordgroup",
  htmlBuilder(group, options) {
    if (group.semisimple) {
      return makeFragment(buildExpression(group.body, options, false));
    }
    return makeSpan(["mord"], buildExpression(group.body, options, true), options);
  },
  mathmlBuilder(group, options) {
    return buildExpressionRow(group.body, options, true);
  }
});
;// ./src/functions/overline.ts





defineFunction({
  type: "overline",
  names: ["\\overline"],
  props: {
    numArgs: 1
  },
  handler(_ref, args) {
    let {
      parser
    } = _ref;
    const body = args[0];
    return {
      type: "overline",
      mode: parser.mode,
      body
    };
  },
  htmlBuilder(group, options) {
    // Overlines are handled in the TeXbook pg 443, Rule 9.

    // Build the inner group in the cramped style.
    const innerGroup = buildGroup(group.body, options.havingCrampedStyle());

    // Create the line above the body
    const line = makeLineSpan("overline-line", options);

    // Generate the vlist, with the appropriate kerns
    const defaultRuleThickness = options.fontMetrics().defaultRuleThickness;
    const vlist = makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: innerGroup
      }, {
        type: "kern",
        size: 3 * defaultRuleThickness
      }, {
        type: "elem",
        elem: line
      }, {
        type: "kern",
        size: defaultRuleThickness
      }]
    }, options);
    return makeSpan(["mord", "overline"], [vlist], options);
  },
  mathmlBuilder(group, options) {
    const operator = new MathNode("mo", [new TextNode("\u203e")]);
    operator.setAttribute("stretchy", "true");
    const node = new MathNode("mover", [buildMathML_buildGroup(group.body, options), operator]);
    node.setAttribute("accent", "true");
    return node;
  }
});
;// ./src/functions/phantom.ts






defineFunction({
  type: "phantom",
  names: ["\\phantom"],
  props: {
    numArgs: 1,
    allowedInText: true
  },
  handler: (_ref, args) => {
    let {
      parser
    } = _ref;
    const body = args[0];
    return {
      type: "phantom",
      mode: parser.mode,
      body: ordargument(body)
    };
  },
  htmlBuilder: (group, options) => {
    const elements = buildExpression(group.body, options.withPhantom(), false);

    // \phantom isn't supposed to affect the elements it contains.
    // See "color" for more details.
    return makeFragment(elements);
  },
  mathmlBuilder: (group, options) => {
    const inner = buildMathML_buildExpression(group.body, options);
    return new MathNode("mphantom", inner);
  }
});
defineMacro("\\hphantom", "\\smash{\\phantom{#1}}");
defineFunction({
  type: "vphantom",
  names: ["\\vphantom"],
  props: {
    numArgs: 1,
    allowedInText: true
  },
  handler: (_ref2, args) => {
    let {
      parser
    } = _ref2;
    const body = args[0];
    return {
      type: "vphantom",
      mode: parser.mode,
      body
    };
  },
  htmlBuilder: (group, options) => {
    const inner = makeSpan(["inner"], [buildGroup(group.body, options.withPhantom())]);
    const fix = makeSpan(["fix"], []);
    return makeSpan(["mord", "rlap"], [inner, fix], options);
  },
  mathmlBuilder: (group, options) => {
    const inner = buildMathML_buildExpression(ordargument(group.body), options);
    const phantom = new MathNode("mphantom", inner);
    const node = new MathNode("mpadded", [phantom]);
    node.setAttribute("width", "0px");
    return node;
  }
});
;// ./src/functions/raisebox.ts








// Box manipulation
defineFunction({
  type: "raisebox",
  names: ["\\raisebox"],
  props: {
    numArgs: 2,
    argTypes: ["size", "hbox"],
    allowedInText: true
  },
  handler(_ref, args) {
    let {
      parser
    } = _ref;
    const amount = assertNodeType(args[0], "size").value;
    const body = args[1];
    return {
      type: "raisebox",
      mode: parser.mode,
      dy: amount,
      body
    };
  },
  htmlBuilder(group, options) {
    const body = buildGroup(group.body, options);
    const dy = calculateSize(group.dy, options);
    return makeVList({
      positionType: "shift",
      positionData: -dy,
      children: [{
        type: "elem",
        elem: body
      }]
    }, options);
  },
  mathmlBuilder(group, options) {
    const node = new MathNode("mpadded", [buildMathML_buildGroup(group.body, options)]);
    const dy = group.dy.number + group.dy.unit;
    node.setAttribute("voffset", dy);
    return node;
  }
});
;// ./src/functions/relax.ts

defineFunction({
  type: "internal",
  names: ["\\relax"],
  props: {
    numArgs: 0,
    allowedInText: true,
    allowedInArgument: true
  },
  handler(_ref) {
    let {
      parser
    } = _ref;
    return {
      type: "internal",
      mode: parser.mode
    };
  }
});
;// ./src/functions/rule.ts





defineFunction({
  type: "rule",
  names: ["\\rule"],
  props: {
    numArgs: 2,
    numOptionalArgs: 1,
    allowedInText: true,
    allowedInMath: true,
    argTypes: ["size", "size", "size"]
  },
  handler(_ref, args, optArgs) {
    let {
      parser
    } = _ref;
    const shift = optArgs[0];
    const width = assertNodeType(args[0], "size");
    const height = assertNodeType(args[1], "size");
    return {
      type: "rule",
      mode: parser.mode,
      shift: shift && assertNodeType(shift, "size").value,
      width: width.value,
      height: height.value
    };
  },
  htmlBuilder(group, options) {
    // Make an empty span for the rule
    const rule = makeSpan(["mord", "rule"], [], options);

    // Calculate the shift, width, and height of the rule, and account for units
    const width = calculateSize(group.width, options);
    const height = calculateSize(group.height, options);
    const shift = group.shift ? calculateSize(group.shift, options) : 0;

    // Style the rule to the right size
    rule.style.borderRightWidth = makeEm(width);
    rule.style.borderTopWidth = makeEm(height);
    rule.style.bottom = makeEm(shift);

    // Record the height and width
    rule.width = width;
    rule.height = height + shift;
    rule.depth = -shift;
    // Font size is the number large enough that the browser will
    // reserve at least `absHeight` space above the baseline.
    // The 1.125 factor was empirically determined
    rule.maxFontSize = height * 1.125 * options.sizeMultiplier;
    return rule;
  },
  mathmlBuilder(group, options) {
    const width = calculateSize(group.width, options);
    const height = calculateSize(group.height, options);
    const shift = group.shift ? calculateSize(group.shift, options) : 0;
    const color = options.color && options.getColor() || "black";
    const rule = new MathNode("mspace");
    rule.setAttribute("mathbackground", color);
    rule.setAttribute("width", makeEm(width));
    rule.setAttribute("height", makeEm(height));
    const wrapper = new MathNode("mpadded", [rule]);
    if (shift >= 0) {
      wrapper.setAttribute("height", makeEm(shift));
    } else {
      wrapper.setAttribute("height", makeEm(shift));
      wrapper.setAttribute("depth", makeEm(-shift));
    }
    wrapper.setAttribute("voffset", makeEm(shift));
    return wrapper;
  }
});
;// ./src/functions/sizing.ts






function sizingGroup(value, options, baseOptions) {
  const inner = buildExpression(value, options, false);
  const multiplier = options.sizeMultiplier / baseOptions.sizeMultiplier;

  // Add size-resetting classes to the inner list and set maxFontSize
  // manually. Handle nested size changes.
  for (let i = 0; i < inner.length; i++) {
    const pos = inner[i].classes.indexOf("sizing");
    if (pos < 0) {
      Array.prototype.push.apply(inner[i].classes, options.sizingClasses(baseOptions));
    } else if (inner[i].classes[pos + 1] === "reset-size" + options.size) {
      // This is a nested size change: e.g., inner[i] is the "b" in
      // `\Huge a \small b`. Override the old size (the `reset-` class)
      // but not the new size.
      inner[i].classes[pos + 1] = "reset-size" + baseOptions.size;
    }
    inner[i].height *= multiplier;
    inner[i].depth *= multiplier;
  }
  return makeFragment(inner);
}
const sizeFuncs = ["\\tiny", "\\sixptsize", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize", "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"];
const sizing_htmlBuilder = (group, options) => {
  // Handle sizing operators like \Huge. Real TeX doesn't actually allow
  // these functions inside of math expressions, so we do some special
  // handling.
  const newOptions = options.havingSize(group.size);
  return sizingGroup(group.body, newOptions, options);
};
defineFunction({
  type: "sizing",
  names: sizeFuncs,
  props: {
    numArgs: 0,
    allowedInText: true
  },
  handler: (_ref, args) => {
    let {
      breakOnTokenText,
      funcName,
      parser
    } = _ref;
    const body = parser.parseExpression(false, breakOnTokenText);
    return {
      type: "sizing",
      mode: parser.mode,
      // Figure out what size to use based on the list of functions above
      size: sizeFuncs.indexOf(funcName) + 1,
      body
    };
  },
  htmlBuilder: sizing_htmlBuilder,
  mathmlBuilder: (group, options) => {
    const newOptions = options.havingSize(group.size);
    const inner = buildMathML_buildExpression(group.body, newOptions);
    const node = new MathNode("mstyle", inner);

    // TODO(emily): This doesn't produce the correct size for nested size
    // changes, because we don't keep state of what style we're currently
    // in, so we can't reset the size to normal before changing it.  Now
    // that we're passing an options parameter we should be able to fix
    // this.
    node.setAttribute("mathsize", makeEm(newOptions.sizeMultiplier));
    return node;
  }
});
;// ./src/functions/smash.ts
// smash, with optional [tb], as in AMS






defineFunction({
  type: "smash",
  names: ["\\smash"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1,
    allowedInText: true
  },
  handler: (_ref, args, optArgs) => {
    let {
      parser
    } = _ref;
    let smashHeight = false;
    let smashDepth = false;
    const tbArg = optArgs[0] && assertNodeType(optArgs[0], "ordgroup");
    if (tbArg) {
      // Optional [tb] argument is engaged.
      // ref: amsmath: \renewcommand{\smash}[1][tb]{%
      //               def\mb@t{\ht}\def\mb@b{\dp}\def\mb@tb{\ht\z@\z@\dp}%
      let letter;
      for (let i = 0; i < tbArg.body.length; ++i) {
        const node = tbArg.body[i];
        letter = assertSymbolNodeType(node).text;
        if (letter === "t") {
          smashHeight = true;
        } else if (letter === "b") {
          smashDepth = true;
        } else {
          smashHeight = false;
          smashDepth = false;
          break;
        }
      }
    } else {
      smashHeight = true;
      smashDepth = true;
    }
    const body = args[0];
    return {
      type: "smash",
      mode: parser.mode,
      body,
      smashHeight,
      smashDepth
    };
  },
  htmlBuilder: (group, options) => {
    const node = makeSpan([], [buildGroup(group.body, options)]);
    if (!group.smashHeight && !group.smashDepth) {
      return node;
    }
    if (group.smashHeight) {
      node.height = 0;
    }
    if (group.smashDepth) {
      node.depth = 0;
    }
    if (group.smashHeight && group.smashDepth) {
      // Symmetric \smash can stay in inline layout.
      return makeSpan(["mord", "smash"], [node], options);
    }

    // In order to influence makeVList for asymmetric smashing, we have to
    // reset the children.
    if (node.children) {
      for (let i = 0; i < node.children.length; i++) {
        if (group.smashHeight) {
          node.children[i].height = 0;
        }
        if (group.smashDepth) {
          node.children[i].depth = 0;
        }
      }
    }

    // At this point, we've reset the TeX-like height and depth values.
    // But the span still has an HTML line height.
    // makeVList applies "display: table-cell", which prevents the browser
    // from acting on that line height. So we'll call makeVList now.

    const smashedNode = makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: node
      }]
    }, options);

    // For spacing, TeX treats \smash as a math group (same spacing as ord).
    return makeSpan(["mord"], [smashedNode], options);
  },
  mathmlBuilder: (group, options) => {
    const node = new MathNode("mpadded", [buildMathML_buildGroup(group.body, options)]);
    if (group.smashHeight) {
      node.setAttribute("height", "0px");
    }
    if (group.smashDepth) {
      node.setAttribute("depth", "0px");
    }
    return node;
  }
});
;// ./src/functions/sqrt.ts








defineFunction({
  type: "sqrt",
  names: ["\\sqrt"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1
  },
  handler(_ref, args, optArgs) {
    let {
      parser
    } = _ref;
    const index = optArgs[0];
    const body = args[0];
    return {
      type: "sqrt",
      mode: parser.mode,
      body,
      index
    };
  },
  htmlBuilder(group, options) {
    // Square roots are handled in the TeXbook pg. 443, Rule 11.

    // First, we do the same steps as in overline to build the inner group
    // and line
    let inner = buildGroup(group.body, options.havingCrampedStyle());
    if (inner.height === 0) {
      // Render a small surd.
      inner.height = options.fontMetrics().xHeight;
    }

    // Some groups can return document fragments.  Handle those by wrapping
    // them in a span.
    inner = wrapFragment(inner, options);

    // Calculate the minimum size for the \surd delimiter
    const metrics = options.fontMetrics();
    const theta = metrics.defaultRuleThickness;
    let phi = theta;
    if (options.style.id < src_Style.TEXT.id) {
      phi = options.fontMetrics().xHeight;
    }

    // Calculate the clearance between the body and line
    let lineClearance = theta + phi / 4;
    const minDelimiterHeight = inner.height + inner.depth + lineClearance + theta;

    // Create a sqrt SVG of the required minimum size
    const {
      span: img,
      ruleWidth,
      advanceWidth
    } = makeSqrtImage(minDelimiterHeight, options);
    const delimDepth = img.height - ruleWidth;

    // Adjust the clearance based on the delimiter size
    if (delimDepth > inner.height + inner.depth + lineClearance) {
      lineClearance = (lineClearance + delimDepth - inner.height - inner.depth) / 2;
    }

    // Shift the sqrt image
    const imgShift = img.height - inner.height - lineClearance - ruleWidth;
    inner.style.paddingLeft = makeEm(advanceWidth);

    // Overlay the image and the argument.
    const body = makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: inner,
        wrapperClasses: ["svg-align"]
      }, {
        type: "kern",
        size: -(inner.height + imgShift)
      }, {
        type: "elem",
        elem: img
      }, {
        type: "kern",
        size: ruleWidth
      }]
    }, options);
    if (!group.index) {
      return makeSpan(["mord", "sqrt"], [body], options);
    } else {
      // Handle the optional root index

      // The index is always in scriptscript style
      const newOptions = options.havingStyle(src_Style.SCRIPTSCRIPT);
      const rootm = buildGroup(group.index, newOptions, options);

      // The amount the index is shifted by. This is taken from the TeX
      // source, in the definition of `\r@@t`.
      const toShift = 0.6 * (body.height - body.depth);

      // Build a VList with the superscript shifted up correctly
      const rootVList = makeVList({
        positionType: "shift",
        positionData: -toShift,
        children: [{
          type: "elem",
          elem: rootm
        }]
      }, options);
      // Add a class surrounding it so we can add on the appropriate
      // kerning
      const rootVListWrap = makeSpan(["root"], [rootVList]);
      return makeSpan(["mord", "sqrt"], [rootVListWrap, body], options);
    }
  },
  mathmlBuilder(group, options) {
    const {
      body,
      index
    } = group;
    return index ? new MathNode("mroot", [buildMathML_buildGroup(body, options), buildMathML_buildGroup(index, options)]) : new MathNode("msqrt", [buildMathML_buildGroup(body, options)]);
  }
});
;// ./src/functions/styling.ts





const styling_styleMap = {
  "display": src_Style.DISPLAY,
  "text": src_Style.TEXT,
  "script": src_Style.SCRIPT,
  "scriptscript": src_Style.SCRIPTSCRIPT
};
function isStyleStr(s) {
  return s in styling_styleMap;
}
defineFunction({
  type: "styling",
  names: ["\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle"],
  props: {
    numArgs: 0,
    allowedInText: true,
    primitive: true
  },
  handler(_ref, args) {
    let {
      breakOnTokenText,
      funcName,
      parser
    } = _ref;
    // parse out the implicit body
    const body = parser.parseExpression(true, breakOnTokenText);

    // TODO: Refactor to avoid duplicating styleMap in multiple places (e.g.
    // here and in buildHTML and de-dupe the enumeration of all the styles).
    const style = funcName.slice(1, funcName.length - 5);
    if (!isStyleStr(style)) {
      throw new Error("Unknown style: " + style);
    }
    return {
      type: "styling",
      mode: parser.mode,
      // Figure out what style to use by pulling out the style from
      // the function name
      style,
      body
    };
  },
  htmlBuilder(group, options) {
    // Style changes are handled in the TeXbook on pg. 442, Rule 3.
    const newStyle = styling_styleMap[group.style];
    let newOptions = options.havingStyle(newStyle);
    if (group.resetFont) {
      newOptions = newOptions.withFont('');
    }
    return sizingGroup(group.body, newOptions, options);
  },
  mathmlBuilder(group, options) {
    // Figure out what style we're changing to.
    const newStyle = styling_styleMap[group.style];
    let newOptions = options.havingStyle(newStyle);
    if (group.resetFont) {
      newOptions = newOptions.withFont('');
    }
    const inner = buildMathML_buildExpression(group.body, newOptions);
    const node = new MathNode("mstyle", inner);
    const styleAttributes = {
      "display": ["0", "true"],
      "text": ["0", "false"],
      "script": ["1", "false"],
      "scriptscript": ["2", "false"]
    };
    const attr = styleAttributes[group.style];
    node.setAttribute("scriptlevel", attr[0]);
    node.setAttribute("displaystyle", attr[1]);
    return node;
  }
});
;// ./src/functions/supsub.ts













/**
 * Sometimes, groups perform special rules when they have superscripts or
 * subscripts attached to them. This function lets the `supsub` group know that
 * Sometimes, groups perform special rules when they have superscripts or
 * its inner element should handle the superscripts and subscripts instead of
 * handling them itself.
 */
const htmlBuilderDelegate = function (group, options
// eslint-disable-next-line @typescript-eslint/no-explicit-any
) {
  const base = group.base;
  if (!base) {
    return null;
  } else if (base.type === "op") {
    // Operators handle supsubs differently when they have limits
    // (e.g. `\displaystyle\sum_2^3`)
    const delegate = base.limits && (options.style.size === src_Style.DISPLAY.size || base.alwaysHandleSupSub);
    return delegate ? op_htmlBuilder : null;
  } else if (base.type === "operatorname") {
    const delegate = base.alwaysHandleSupSub && (options.style.size === src_Style.DISPLAY.size || base.limits);
    return delegate ? operatorname_htmlBuilder : null;
  } else if (base.type === "accent") {
    return isCharacterBox(base.base) ? htmlBuilder : null;
  } else if (base.type === "horizBrace") {
    const isSup = !group.sub;
    return isSup === base.isOver ? horizBrace_htmlBuilder : null;
  } else {
    return null;
  }
};

// Super scripts and subscripts, whose precise placement can depend on other
// functions that precede them.
defineFunctionBuilders({
  type: "supsub",
  htmlBuilder(group, options) {
    // Superscript and subscripts are handled in the TeXbook on page
    // 445-446, rules 18(a-f).

    // Here is where we defer to the inner group if it should handle
    // superscripts and subscripts itself.
    const builderDelegate = htmlBuilderDelegate(group, options);
    if (builderDelegate) {
      return builderDelegate(group, options);
    }
    const {
      base: valueBase,
      sup: valueSup,
      sub: valueSub
    } = group;
    const base = buildGroup(valueBase, options);
    let supm;
    let subm;
    const metrics = options.fontMetrics();

    // Rule 18a
    let supShift = 0;
    let subShift = 0;
    const isCharBox = valueBase && isCharacterBox(valueBase);
    if (valueSup) {
      const newOptions = options.havingStyle(options.style.sup());
      supm = buildGroup(valueSup, newOptions, options);
      if (!isCharBox) {
        supShift = base.height - newOptions.fontMetrics().supDrop * newOptions.sizeMultiplier / options.sizeMultiplier;
      }
    }
    if (valueSub) {
      const newOptions = options.havingStyle(options.style.sub());
      subm = buildGroup(valueSub, newOptions, options);
      if (!isCharBox) {
        subShift = base.depth + newOptions.fontMetrics().subDrop * newOptions.sizeMultiplier / options.sizeMultiplier;
      }
    }

    // Rule 18c
    let minSupShift;
    if (options.style === src_Style.DISPLAY) {
      minSupShift = metrics.sup1;
    } else if (options.style.cramped) {
      minSupShift = metrics.sup3;
    } else {
      minSupShift = metrics.sup2;
    }

    // scriptspace is a font-size-independent size, so scale it
    // appropriately for use as the marginRight.
    const multiplier = options.sizeMultiplier;
    const marginRight = makeEm(0.5 / metrics.ptPerEm / multiplier);
    let marginLeft = null;
    if (subm) {
      // Subscripts shouldn't be shifted by the base's italic correction.
      // Account for that by shifting the subscript back the appropriate
      // amount. Note we only do this when the base is a single symbol.
      const isOiint = group.base && group.base.type === "op" && group.base.name && (group.base.name === "\\oiint" || group.base.name === "\\oiiint");
      if (base instanceof SymbolNode || isOiint) {
        var _italic;
        // SymbolNode has .italic natively; for \oiint/\oiiint the
        // op builder stores .italic on the wrapping Span.
        marginLeft = makeEm(-((_italic = base.italic) != null ? _italic : 0));
      }
    }
    let supsub;
    if (supm && subm) {
      supShift = Math.max(supShift, minSupShift, supm.depth + 0.25 * metrics.xHeight);
      subShift = Math.max(subShift, metrics.sub2);
      const ruleWidth = metrics.defaultRuleThickness;

      // Rule 18e
      const maxWidth = 4 * ruleWidth;
      if (supShift - supm.depth - (subm.height - subShift) < maxWidth) {
        subShift = maxWidth - (supShift - supm.depth) + subm.height;
        const psi = 0.8 * metrics.xHeight - (supShift - supm.depth);
        if (psi > 0) {
          supShift += psi;
          subShift -= psi;
        }
      }
      const vlistElem = [{
        type: "elem",
        elem: subm,
        shift: subShift,
        marginRight,
        marginLeft
      }, {
        type: "elem",
        elem: supm,
        shift: -supShift,
        marginRight
      }];
      supsub = makeVList({
        positionType: "individualShift",
        children: vlistElem
      }, options);
    } else if (subm) {
      // Rule 18b
      subShift = Math.max(subShift, metrics.sub1, subm.height - 0.8 * metrics.xHeight);
      const vlistElem = [{
        type: "elem",
        elem: subm,
        marginLeft,
        marginRight
      }];
      supsub = makeVList({
        positionType: "shift",
        positionData: subShift,
        children: vlistElem
      }, options);
    } else if (supm) {
      // Rule 18c, d
      supShift = Math.max(supShift, minSupShift, supm.depth + 0.25 * metrics.xHeight);
      supsub = makeVList({
        positionType: "shift",
        positionData: -supShift,
        children: [{
          type: "elem",
          elem: supm,
          marginRight
        }]
      }, options);
    } else {
      throw new Error("supsub must have either sup or sub.");
    }

    // Wrap the supsub vlist in a span.msupsub to reset text-align.
    const mclass = getTypeOfDomTree(base, "right") || "mord";
    return makeSpan([mclass], [base, makeSpan(["msupsub"], [supsub])], options);
  },
  mathmlBuilder(group, options) {
    // Is the inner group a relevant horizontal brace?
    let isBrace = false;
    let isOver;
    let isSup;
    if (group.base && group.base.type === "horizBrace") {
      isSup = !!group.sup;
      if (isSup === group.base.isOver) {
        isBrace = true;
        isOver = group.base.isOver;
      }
    }
    if (group.base && (group.base.type === "op" || group.base.type === "operatorname")) {
      group.base.parentIsSupSub = true;
    }
    const children = [buildMathML_buildGroup(group.base, options)];
    if (group.sub) {
      children.push(buildMathML_buildGroup(group.sub, options));
    }
    if (group.sup) {
      children.push(buildMathML_buildGroup(group.sup, options));
    }
    let nodeType;
    if (isBrace) {
      nodeType = isOver ? "mover" : "munder";
    } else if (!group.sub) {
      const base = group.base;
      if (base && base.type === "op" && base.limits && (options.style === src_Style.DISPLAY || base.alwaysHandleSupSub)) {
        nodeType = "mover";
      } else if (base && base.type === "operatorname" && base.alwaysHandleSupSub && (base.limits || options.style === src_Style.DISPLAY)) {
        nodeType = "mover";
      } else {
        nodeType = "msup";
      }
    } else if (!group.sup) {
      const base = group.base;
      if (base && base.type === "op" && base.limits && (options.style === src_Style.DISPLAY || base.alwaysHandleSupSub)) {
        nodeType = "munder";
      } else if (base && base.type === "operatorname" && base.alwaysHandleSupSub && (base.limits || options.style === src_Style.DISPLAY)) {
        nodeType = "munder";
      } else {
        nodeType = "msub";
      }
    } else {
      const base = group.base;
      if (base && base.type === "op" && base.limits && options.style === src_Style.DISPLAY) {
        nodeType = "munderover";
      } else if (base && base.type === "operatorname" && base.alwaysHandleSupSub && (options.style === src_Style.DISPLAY || base.limits)) {
        nodeType = "munderover";
      } else {
        nodeType = "msubsup";
      }
    }
    return new MathNode(nodeType, children);
  }
});
;// ./src/functions/symbolsOp.ts





// Operator ParseNodes created in Parser.js from symbol Groups in src/symbols.js.

defineFunctionBuilders({
  type: "atom",
  htmlBuilder(group, options) {
    return mathsym(group.text, group.mode, options, ["m" + group.family]);
  },
  mathmlBuilder(group, options) {
    const node = new MathNode("mo", [makeText(group.text, group.mode)]);
    if (group.family === "bin") {
      const variant = getVariant(group, options);
      if (variant === "bold-italic") {
        node.setAttribute("mathvariant", variant);
      }
    } else if (group.family === "punct") {
      node.setAttribute("separator", "true");
    } else if (group.family === "open" || group.family === "close") {
      // Delims built here should not stretch vertically.
      // See delimsizing.js for stretchy delims.
      node.setAttribute("stretchy", "false");
    }
    return node;
  }
});
;// ./src/functions/symbolsOrd.ts




// "mathord" and "textord" ParseNodes created in Parser.js from symbol Groups in
// src/symbols.js.

const defaultVariant = {
  "mi": "italic",
  "mn": "normal",
  "mtext": "normal"
};
defineFunctionBuilders({
  type: "mathord",
  htmlBuilder(group, options) {
    return makeOrd(group, options, "mathord");
  },
  mathmlBuilder(group, options) {
    const node = new MathNode("mi", [makeText(group.text, group.mode, options)]);
    const variant = getVariant(group, options) || "italic";
    if (variant !== defaultVariant[node.type]) {
      node.setAttribute("mathvariant", variant);
    }
    return node;
  }
});
defineFunctionBuilders({
  type: "textord",
  htmlBuilder(group, options) {
    return makeOrd(group, options, "textord");
  },
  mathmlBuilder(group, options) {
    const text = makeText(group.text, group.mode, options);
    const variant = getVariant(group, options) || "normal";
    let node;
    if (group.mode === 'text') {
      node = new MathNode("mtext", [text]);
    } else if (/[0-9]/.test(group.text)) {
      node = new MathNode("mn", [text]);
    } else if (group.text === "\\prime") {
      node = new MathNode("mo", [text]);
    } else {
      node = new MathNode("mi", [text]);
    }
    if (variant !== defaultVariant[node.type]) {
      node.setAttribute("mathvariant", variant);
    }
    return node;
  }
});
;// ./src/functions/symbolsSpacing.ts





// A map of CSS-based spacing functions to their CSS class.
const cssSpace = {
  "\\nobreak": "nobreak",
  "\\allowbreak": "allowbreak"
};

// A lookup table to determine whether a spacing function/symbol should be
// treated like a regular space character.  If a symbol or command is a key
// in this table, then it should be a regular space character.  Furthermore,
// the associated value may have a `className` specifying an extra CSS class
// to add to the created `span`.
const regularSpace = {
  " ": {},
  "\\ ": {},
  "~": {
    className: "nobreak"
  },
  "\\space": {},
  "\\nobreakspace": {
    className: "nobreak"
  }
};

// ParseNode<"spacing"> created in Parser.js from the "spacing" symbol Groups in
// src/symbols.js.
defineFunctionBuilders({
  type: "spacing",
  htmlBuilder(group, options) {
    if (regularSpace.hasOwnProperty(group.text)) {
      const className = regularSpace[group.text].className || "";
      // Spaces are generated by adding an actual space. Each of these
      // things has an entry in the symbols table, so these will be turned
      // into appropriate outputs.
      if (group.mode === "text") {
        const ord = makeOrd(group, options, "textord");
        ord.classes.push(className);
        return ord;
      } else {
        return makeSpan(["mspace", className], [mathsym(group.text, group.mode, options)], options);
      }
    } else if (cssSpace.hasOwnProperty(group.text)) {
      // Spaces based on just a CSS class.
      return makeSpan(["mspace", cssSpace[group.text]], [], options);
    } else {
      throw new src_ParseError("Unknown type of space \"" + group.text + "\"");
    }
  },
  mathmlBuilder(group, options) {
    let node;
    if (regularSpace.hasOwnProperty(group.text)) {
      node = new MathNode("mtext", [new TextNode("\u00a0")]);
    } else if (cssSpace.hasOwnProperty(group.text)) {
      // CSS-based MathML spaces (\nobreak, \allowbreak) are ignored
      return new MathNode("mspace");
    } else {
      throw new src_ParseError("Unknown type of space \"" + group.text + "\"");
    }
    return node;
  }
});
;// ./src/functions/tag.ts



const pad = () => {
  const padNode = new MathNode("mtd", []);
  padNode.setAttribute("width", "50%");
  return padNode;
};
defineFunctionBuilders({
  type: "tag",
  mathmlBuilder(group, options) {
    const table = new MathNode("mtable", [new MathNode("mtr", [pad(), new MathNode("mtd", [buildExpressionRow(group.body, options)]), pad(), new MathNode("mtd", [buildExpressionRow(group.tag, options)])])]);
    table.setAttribute("width", "100%");
    return table;

    // TODO: Left-aligned tags.
    // Currently, the group and options passed here do not contain
    // enough info to set tag alignment. `leqno` is in Settings but it is
    // not passed to Options. On the HTML side, leqno is
    // set by a CSS class applied in buildTree.js. That would have worked
    // in MathML if browsers supported <mlabeledtr>. Since they don't, we
    // need to rewrite the way this function is called.
  }
});
;// ./src/functions/text.ts




// Non-mathy text, possibly in a font
const textFontFamilies = {
  "\\text": undefined,
  "\\textrm": "textrm",
  "\\textsf": "textsf",
  "\\texttt": "texttt",
  "\\textnormal": "textrm"
};
const textFontWeights = {
  "\\textbf": "textbf",
  "\\textmd": "textmd"
};
const textFontShapes = {
  "\\textit": "textit",
  "\\textup": "textup"
};
const optionsWithFont = (group, options) => {
  const font = group.font;
  // Checks if the argument is a font family or a font style.
  if (!font) {
    return options;
  } else if (textFontFamilies[font]) {
    return options.withTextFontFamily(textFontFamilies[font]);
  } else if (textFontWeights[font]) {
    return options.withTextFontWeight(textFontWeights[font]);
  } else if (font === "\\emph") {
    return options.fontShape === "textit" ? options.withTextFontShape("textup") : options.withTextFontShape("textit");
  }
  return options.withTextFontShape(textFontShapes[font]);
};
defineFunction({
  type: "text",
  names: [
  // Font families
  "\\text", "\\textrm", "\\textsf", "\\texttt", "\\textnormal",
  // Font weights
  "\\textbf", "\\textmd",
  // Font Shapes
  "\\textit", "\\textup", "\\emph"],
  props: {
    numArgs: 1,
    argTypes: ["text"],
    allowedInArgument: true,
    allowedInText: true
  },
  handler(_ref, args) {
    let {
      parser,
      funcName
    } = _ref;
    const body = args[0];
    return {
      type: "text",
      mode: parser.mode,
      body: ordargument(body),
      font: funcName
    };
  },
  htmlBuilder(group, options) {
    const newOptions = optionsWithFont(group, options);
    const inner = buildExpression(group.body, newOptions, true);
    return makeSpan(["mord", "text"], inner, newOptions);
  },
  mathmlBuilder(group, options) {
    const newOptions = optionsWithFont(group, options);
    return buildExpressionRow(group.body, newOptions);
  }
});
;// ./src/functions/underline.ts





defineFunction({
  type: "underline",
  names: ["\\underline"],
  props: {
    numArgs: 1,
    allowedInText: true
  },
  handler(_ref, args) {
    let {
      parser
    } = _ref;
    return {
      type: "underline",
      mode: parser.mode,
      body: args[0]
    };
  },
  htmlBuilder(group, options) {
    // Underlines are handled in the TeXbook pg 443, Rule 10.
    // Build the inner group.
    const innerGroup = buildGroup(group.body, options);

    // Create the line to go below the body
    const line = makeLineSpan("underline-line", options);

    // Generate the vlist, with the appropriate kerns
    const defaultRuleThickness = options.fontMetrics().defaultRuleThickness;
    const vlist = makeVList({
      positionType: "top",
      positionData: innerGroup.height,
      children: [{
        type: "kern",
        size: defaultRuleThickness
      }, {
        type: "elem",
        elem: line
      }, {
        type: "kern",
        size: 3 * defaultRuleThickness
      }, {
        type: "elem",
        elem: innerGroup
      }]
    }, options);
    return makeSpan(["mord", "underline"], [vlist], options);
  },
  mathmlBuilder(group, options) {
    const operator = new MathNode("mo", [new TextNode("\u203e")]);
    operator.setAttribute("stretchy", "true");
    const node = new MathNode("munder", [buildMathML_buildGroup(group.body, options), operator]);
    node.setAttribute("accentunder", "true");
    return node;
  }
});
;// ./src/functions/vcenter.ts






// \vcenter:  Vertically center the argument group on the math axis.

defineFunction({
  type: "vcenter",
  names: ["\\vcenter"],
  props: {
    numArgs: 1,
    argTypes: ["original"],
    // In LaTeX, \vcenter can act only on a box.
    allowedInText: false
  },
  handler(_ref, args) {
    let {
      parser
    } = _ref;
    return {
      type: "vcenter",
      mode: parser.mode,
      body: args[0]
    };
  },
  htmlBuilder(group, options) {
    const body = buildGroup(group.body, options);
    const axisHeight = options.fontMetrics().axisHeight;
    const dy = 0.5 * (body.height - axisHeight - (body.depth + axisHeight));
    return makeVList({
      positionType: "shift",
      positionData: dy,
      children: [{
        type: "elem",
        elem: body
      }]
    }, options);
  },
  mathmlBuilder(group, options) {
    // There is no way to do this in MathML.
    // Write a class as a breadcrumb in case some post-processor wants
    // to perform a vcenter adjustment.
    // Wrap in mrow to ensure valid MathML when placed inside mo (e.g., \mathrel)
    const mpadded = new MathNode("mpadded", [buildMathML_buildGroup(group.body, options)], ["vcenter"]);
    return new MathNode("mrow", [mpadded]);
  }
});
;// ./src/functions/verb.ts




defineFunction({
  type: "verb",
  names: ["\\verb"],
  props: {
    numArgs: 0,
    allowedInText: true
  },
  handler(context, args, optArgs) {
    // \verb and \verb* are dealt with directly in Parser.js.
    // If we end up here, it's because of a failure to match the two delimiters
    // in the regex in Lexer.js.  LaTeX raises the following error when \verb is
    // terminated by end of line (or file).
    throw new src_ParseError("\\verb ended by end of line instead of matching delimiter");
  },
  htmlBuilder(group, options) {
    const text = makeVerb(group);
    const body = [];
    // \verb enters text mode and therefore is sized like \textstyle
    const newOptions = options.havingStyle(options.style.text());
    for (let i = 0; i < text.length; i++) {
      let c = text[i];
      if (c === '~') {
        c = '\\textasciitilde';
      }
      body.push(makeSymbol(c, "Typewriter-Regular", group.mode, newOptions, ["mord", "texttt"]));
    }
    return makeSpan(["mord", "text"].concat(newOptions.sizingClasses(options)), tryCombineChars(body), newOptions);
  },
  mathmlBuilder(group, options) {
    const text = new TextNode(makeVerb(group));
    const node = new MathNode("mtext", [text]);
    node.setAttribute("mathvariant", "monospace");
    return node;
  }
});

/**
 * Converts verb group into body string.
 *
 * \verb* replaces each space with an open box \u2423
 * \verb replaces each space with a no-break space \xA0
 */
const makeVerb = group => group.body.replace(/ /g, group.star ? '\u2423' : '\xA0');
;// ./src/functions.ts
/** Include this to ensure that all functions are defined. */

const functions = _functions;
/* harmony default export */ var src_functions = (functions);

// TODO(kevinb): have functions return an object and call defineFunction with
// that object in this file instead of relying on side-effects.














































;// ./src/Lexer.ts
/**
 * The Lexer class handles tokenizing the input in various ways. Since our
 * parser expects us to be able to backtrack, the lexer allows lexing from any
 * given starting point.
 *
 * Its main exposed function is the `lex` function, which takes a position to
 * lex from and a type of token to lex. It defers to the appropriate `_innerLex`
 * function.
 *
 * The various `_innerLex` functions perform the actual lexing of different
 * kinds.
 */




/* The following tokenRegex
 * - matches typical whitespace (but not NBSP etc.) using its first group
 * - does not match any control character \x00-\x1f except whitespace
 * - does not match a bare backslash
 * - matches any ASCII character except those just mentioned
 * - does not match the BMP private use area \uE000-\uF8FF
 * - does not match bare surrogate code units
 * - matches any BMP character except for those just described
 * - matches any valid Unicode surrogate pair
 * - matches a backslash followed by one or more whitespace characters
 * - matches a backslash followed by one or more letters then whitespace
 * - matches a backslash followed by any BMP character
 * Capturing groups:
 *   [1] regular whitespace
 *   [2] backslash followed by whitespace
 *   [3] anything else, which may include:
 *     [4] left character of \verb*
 *     [5] left character of \verb
 *     [6] backslash followed by word, excluding any trailing whitespace
 * Just because the Lexer matches something doesn't mean it's valid input:
 * If there is no matching function or symbol definition, the Parser will
 * still reject the input.
 */
const spaceRegexString = "[ \r\n\t]";
const controlWordRegexString = "\\\\[a-zA-Z@]+";
const controlSymbolRegexString = "\\\\[^\uD800-\uDFFF]";
const controlWordWhitespaceRegexString = "(" + controlWordRegexString + ")" + spaceRegexString + "*";
const controlSpaceRegexString = "\\\\(\n|[ \r\t]+\n?)[ \r\t]*";
const combiningDiacriticalMarkString = "[\u0300-\u036f]";
const combiningDiacriticalMarksEndRegex = new RegExp(combiningDiacriticalMarkString + "+$");
const tokenRegexString = "(" + spaceRegexString + "+)|" + (// whitespace
controlSpaceRegexString + "|") +
// \whitespace
"([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]" + (// single codepoint
combiningDiacriticalMarkString + "*") +
// ...plus accents
"|[\uD800-\uDBFF][\uDC00-\uDFFF]" + (// surrogate pair
combiningDiacriticalMarkString + "*") +
// ...plus accents
"|\\\\verb\\*([^]).*?\\4" +
// \verb*
"|\\\\verb([^*a-zA-Z]).*?\\5" + (// \verb unstarred
"|" + controlWordWhitespaceRegexString) + (// \macroName + spaces
"|" + controlSymbolRegexString + ")"); // \\, \', etc.

/** Main Lexer class */
class Lexer {
  constructor(input, settings) {
    this.input = void 0;
    this.settings = void 0;
    this.tokenRegex = void 0;
    // Category codes. The lexer only supports comment characters (14) for now.
    // MacroExpander additionally distinguishes active (13).
    this.catcodes = void 0;
    // Separate accents from characters
    this.input = input;
    this.settings = settings;
    this.tokenRegex = new RegExp(tokenRegexString, 'g');
    this.catcodes = {
      "%": 14,
      // comment character
      "~": 13 // active character
    };
  }
  setCatcode(char, code) {
    this.catcodes[char] = code;
  }

  /**
   * This function lexes a single token.
   */
  lex() {
    const input = this.input;
    const pos = this.tokenRegex.lastIndex;
    if (pos === input.length) {
      return new Token("EOF", new SourceLocation(this, pos, pos));
    }
    const match = this.tokenRegex.exec(input);
    if (match === null || match.index !== pos) {
      throw new src_ParseError("Unexpected character: '" + input[pos] + "'", new Token(input[pos], new SourceLocation(this, pos, pos + 1)));
    }
    const text = match[6] || match[3] || (match[2] ? "\\ " : " ");
    if (this.catcodes[text] === 14) {
      // comment character
      const nlIndex = input.indexOf('\n', this.tokenRegex.lastIndex);
      if (nlIndex === -1) {
        this.tokenRegex.lastIndex = input.length; // EOF
        this.settings.reportNonstrict("commentAtEnd", "% comment has no terminating newline; LaTeX would " + "fail because of commenting the end of math mode (e.g. $)");
      } else {
        this.tokenRegex.lastIndex = nlIndex + 1;
      }
      return this.lex();
    }
    return new Token(text, new SourceLocation(this, pos, this.tokenRegex.lastIndex));
  }
}
;// ./src/Namespace.ts
/**
 * A `Namespace` refers to a space of nameable things like macros or lengths,
 * which can be `set` either globally or local to a nested group, using an
 * undo stack similar to how TeX implements this functionality.
 * Performance-wise, `get` and local `set` take constant time, while global
 * `set` takes time proportional to the depth of group nesting.
 */


class Namespace {
  /**
   * Both arguments are optional.  The first argument is an object of
   * built-in mappings which never change.  The second argument is an object
   * of initial (global-level) mappings, which will constantly change
   * according to any global/top-level `set`s done.
   */
  constructor(builtins, globalMacros) {
    if (builtins === void 0) {
      builtins = {};
    }
    if (globalMacros === void 0) {
      globalMacros = {};
    }
    this.current = void 0;
    this.builtins = void 0;
    this.undefStack = void 0;
    this.current = globalMacros;
    this.builtins = builtins;
    this.undefStack = [];
  }

  /**
   * Start a new nested group, affecting future local `set`s.
   */
  beginGroup() {
    this.undefStack.push({});
  }

  /**
   * End current nested group, restoring values before the group began.
   */
  endGroup() {
    if (this.undefStack.length === 0) {
      throw new src_ParseError("Unbalanced namespace destruction: attempt " + "to pop global namespace; please report this as a bug");
    }
    const undefs = this.undefStack.pop();
    for (const undef in undefs) {
      if (undefs.hasOwnProperty(undef)) {
        if (undefs[undef] == null) {
          delete this.current[undef];
        } else {
          this.current[undef] = undefs[undef];
        }
      }
    }
  }

  /**
   * Ends all currently nested groups (if any), restoring values before the
   * groups began.  Useful in case of an error in the middle of parsing.
   */
  endGroups() {
    while (this.undefStack.length > 0) {
      this.endGroup();
    }
  }

  /**
   * Detect whether `name` has a definition.  Equivalent to
   * `get(name) != null`.
   */
  has(name) {
    return this.current.hasOwnProperty(name) || this.builtins.hasOwnProperty(name);
  }

  /**
   * Get the current value of a name, or `undefined` if there is no value.
   *
   * Note: Do not use `if (namespace.get(...))` to detect whether a macro
   * is defined, as the definition may be the empty string which evaluates
   * to `false` in JavaScript.  Use `if (namespace.get(...) != null)` or
   * `if (namespace.has(...))`.
   */
  get(name) {
    if (this.current.hasOwnProperty(name)) {
      return this.current[name];
    } else {
      return this.builtins[name];
    }
  }

  /**
   * Set the current value of a name, and optionally set it globally too.
   * Local set() sets the current value and (when appropriate) adds an undo
   * operation to the undo stack.  Global set() may change the undo
   * operation at every level, so takes time linear in their number.
   * A value of undefined means to delete existing definitions.
   */
  set(name, value, global) {
    if (global === void 0) {
      global = false;
    }
    if (global) {
      // Global set is equivalent to setting in all groups.  Simulate this
      // by destroying any undos currently scheduled for this name,
      // and adding an undo with the *new* value (in case it later gets
      // locally reset within this environment).
      for (let i = 0; i < this.undefStack.length; i++) {
        delete this.undefStack[i][name];
      }
      if (this.undefStack.length > 0) {
        this.undefStack[this.undefStack.length - 1][name] = value;
      }
    } else {
      // Undo this set at end of this group (possibly to `undefined`),
      // unless an undo is already in place, in which case that older
      // value is the correct one.
      const top = this.undefStack[this.undefStack.length - 1];
      if (top && !top.hasOwnProperty(name)) {
        top[name] = this.current[name];
      }
    }
    if (value == null) {
      delete this.current[name];
    } else {
      this.current[name] = value;
    }
  }
}
;// ./src/macros.ts
/**
 * Predefined macros for KaTeX.
 * This can be used to define some commands in terms of others.
 */

// Export global macros object from defineMacro

const macros = _macros;
/* harmony default export */ var src_macros = (macros);





//////////////////////////////////////////////////////////////////////
// macro tools

defineMacro("\\noexpand", function (context) {
  // The expansion is the token itself; but that token is interpreted
  // as if its meaning were ‘\relax’ if it is a control sequence that
  // would ordinarily be expanded by TeX’s expansion rules.
  const t = context.popToken();
  if (context.isExpandable(t.text)) {
    t.noexpand = true;
    t.treatAsRelax = true;
  }
  return {
    tokens: [t],
    numArgs: 0
  };
});
defineMacro("\\expandafter", function (context) {
  // TeX first reads the token that comes immediately after \expandafter,
  // without expanding it; let’s call this token t. Then TeX reads the
  // token that comes after t (and possibly more tokens, if that token
  // has an argument), replacing it by its expansion. Finally TeX puts
  // t back in front of that expansion.
  const t = context.popToken();
  context.expandOnce(true); // expand only an expandable token
  return {
    tokens: [t],
    numArgs: 0
  };
});

// LaTeX's \@firstoftwo{#1}{#2} expands to #1, skipping #2
// TeX source: \long\def\@firstoftwo#1#2{#1}
defineMacro("\\@firstoftwo", function (context) {
  const args = context.consumeArgs(2);
  return {
    tokens: args[0],
    numArgs: 0
  };
});

// LaTeX's \@secondoftwo{#1}{#2} expands to #2, skipping #1
// TeX source: \long\def\@secondoftwo#1#2{#2}
defineMacro("\\@secondoftwo", function (context) {
  const args = context.consumeArgs(2);
  return {
    tokens: args[1],
    numArgs: 0
  };
});

// LaTeX's \@ifnextchar{#1}{#2}{#3} looks ahead to the next (unexpanded)
// symbol that isn't a space, consuming any spaces but not consuming the
// first nonspace character.  If that nonspace character matches #1, then
// the macro expands to #2; otherwise, it expands to #3.
defineMacro("\\@ifnextchar", function (context) {
  const args = context.consumeArgs(3); // symbol, if, else
  context.consumeSpaces();
  const nextToken = context.future();
  if (args[0].length === 1 && args[0][0].text === nextToken.text) {
    return {
      tokens: args[1],
      numArgs: 0
    };
  } else {
    return {
      tokens: args[2],
      numArgs: 0
    };
  }
});

// LaTeX's \@ifstar{#1}{#2} looks ahead to the next (unexpanded) symbol.
// If it is `*`, then it consumes the symbol, and the macro expands to #1;
// otherwise, the macro expands to #2 (without consuming the symbol).
// TeX source: \def\@ifstar#1{\@ifnextchar *{\@firstoftwo{#1}}}
defineMacro("\\@ifstar", "\\@ifnextchar *{\\@firstoftwo{#1}}");

// LaTeX's \TextOrMath{#1}{#2} expands to #1 in text mode, #2 in math mode
defineMacro("\\TextOrMath", function (context) {
  const args = context.consumeArgs(2);
  if (context.mode === 'text') {
    return {
      tokens: args[0],
      numArgs: 0
    };
  } else {
    return {
      tokens: args[1],
      numArgs: 0
    };
  }
});

// Lookup table for parsing numbers in base 8 through 16
const digitToNumber = {
  "0": 0,
  "1": 1,
  "2": 2,
  "3": 3,
  "4": 4,
  "5": 5,
  "6": 6,
  "7": 7,
  "8": 8,
  "9": 9,
  "a": 10,
  "A": 10,
  "b": 11,
  "B": 11,
  "c": 12,
  "C": 12,
  "d": 13,
  "D": 13,
  "e": 14,
  "E": 14,
  "f": 15,
  "F": 15
};

// TeX \char makes a literal character (catcode 12) using the following forms:
// (see The TeXBook, p. 43)
//   \char123  -- decimal
//   \char'123 -- octal
//   \char"123 -- hex
//   \char`x   -- character that can be written (i.e. isn't active)
//   \char`\x  -- character that cannot be written (e.g. %)
// These all refer to characters from the font, so we turn them into special
// calls to a function \@char dealt with in the Parser.
defineMacro("\\char", function (context) {
  let token = context.popToken();
  let base;
  let number = 0;
  if (token.text === "'") {
    base = 8;
    token = context.popToken();
  } else if (token.text === '"') {
    base = 16;
    token = context.popToken();
  } else if (token.text === "`") {
    token = context.popToken();
    if (token.text[0] === "\\") {
      number = token.text.charCodeAt(1);
    } else if (token.text === "EOF") {
      throw new src_ParseError("\\char` missing argument");
    } else {
      number = token.text.charCodeAt(0);
    }
  } else {
    base = 10;
  }
  if (base) {
    // Parse a number in the given base, starting with first `token`.
    number = digitToNumber[token.text];
    if (number == null || number >= base) {
      throw new src_ParseError("Invalid base-" + base + " digit " + token.text);
    }
    let digit;
    while ((digit = digitToNumber[context.future().text]) != null && digit < base) {
      number *= base;
      number += digit;
      context.popToken();
    }
  }
  return "\\@char{" + number + "}";
});

// \newcommand{\macro}[args]{definition}
// \renewcommand{\macro}[args]{definition}
// TODO: Optional arguments: \newcommand{\macro}[args][default]{definition}
const newcommand = (context, existsOK, nonexistsOK, skipIfExists) => {
  let arg = context.consumeArg().tokens;
  if (arg.length !== 1) {
    throw new src_ParseError("\\newcommand's first argument must be a macro name");
  }
  const name = arg[0].text;
  const exists = context.isDefined(name);
  if (exists && !existsOK) {
    throw new src_ParseError("\\newcommand{" + name + "} attempting to redefine " + (name + "; use \\renewcommand"));
  }
  if (!exists && !nonexistsOK) {
    throw new src_ParseError("\\renewcommand{" + name + "} when command " + name + " " + "does not yet exist; use \\newcommand");
  }
  let numArgs = 0;
  arg = context.consumeArg().tokens;
  if (arg.length === 1 && arg[0].text === "[") {
    let argText = '';
    let token = context.expandNextToken();
    while (token.text !== "]" && token.text !== "EOF") {
      // TODO: Should properly expand arg, e.g., ignore {}s
      argText += token.text;
      token = context.expandNextToken();
    }
    if (!argText.match(/^\s*[0-9]+\s*$/)) {
      throw new src_ParseError("Invalid number of arguments: " + argText);
    }
    numArgs = parseInt(argText);
    arg = context.consumeArg().tokens;
  }
  if (!(exists && skipIfExists)) {
    // Final arg is the expansion of the macro
    context.macros.set(name, {
      tokens: arg,
      numArgs
    });
  }
  return '';
};
defineMacro("\\newcommand", context => newcommand(context, false, true   , false));
defineMacro("\\renewcommand", context => newcommand(context, true, false, false));
defineMacro("\\providecommand", context => newcommand(context, true, true, true));

// terminal (console) tools
defineMacro("\\message", context => {
  const arg = context.consumeArgs(1)[0];
  // eslint-disable-next-line no-console
  console.log(arg.reverse().map(token => token.text).join(""));
  return '';
});
defineMacro("\\errmessage", context => {
  const arg = context.consumeArgs(1)[0];
  // eslint-disable-next-line no-console
  console.error(arg.reverse().map(token => token.text).join(""));
  return '';
});
defineMacro("\\show", context => {
  const tok = context.popToken();
  const name = tok.text;
  // eslint-disable-next-line no-console
  console.log(tok, context.macros.get(name), src_functions[name], src_symbols.math[name], src_symbols.text[name]);
  return '';
});

//////////////////////////////////////////////////////////////////////
// Grouping
// \let\bgroup={ \let\egroup=}
defineMacro("\\bgroup", "{");
defineMacro("\\egroup", "}");

// Symbols from latex.ltx:
// \def~{\nobreakspace{}}
// \def\lq{`}
// \def\rq{'}
// \def \aa {\r a}
// \def \AA {\r A}
defineMacro("~", "\\nobreakspace");
defineMacro("\\lq", "`");
defineMacro("\\rq", "'");
defineMacro("\\aa", "\\r a");
defineMacro("\\AA", "\\r A");

// Copyright (C) and registered (R) symbols. Use raw symbol in MathML.
// \DeclareTextCommandDefault{\textcopyright}{\textcircled{c}}
// \DeclareTextCommandDefault{\textregistered}{\textcircled{%
//      \check@mathfonts\fontsize\sf@size\z@\math@fontsfalse\selectfont R}}
// \DeclareRobustCommand{\copyright}{%
//    \ifmmode{\nfss@text{\textcopyright}}\else\textcopyright\fi}
defineMacro("\\textcopyright", "\\html@mathml{\\textcircled{c}}{\\char`©}");
defineMacro("\\copyright", "\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");
defineMacro("\\textregistered", "\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");

// Characters omitted from Unicode range 1D400–1D7FF
defineMacro("\u212C", "\\mathscr{B}"); // script
defineMacro("\u2130", "\\mathscr{E}");
defineMacro("\u2131", "\\mathscr{F}");
defineMacro("\u210B", "\\mathscr{H}");
defineMacro("\u2110", "\\mathscr{I}");
defineMacro("\u2112", "\\mathscr{L}");
defineMacro("\u2133", "\\mathscr{M}");
defineMacro("\u211B", "\\mathscr{R}");
defineMacro("\u212D", "\\mathfrak{C}"); // Fraktur
defineMacro("\u210C", "\\mathfrak{H}");
defineMacro("\u2128", "\\mathfrak{Z}");

// Define \Bbbk with a macro that works in both HTML and MathML.
defineMacro("\\Bbbk", "\\Bbb{k}");

// \llap and \rlap render their contents in text mode
defineMacro("\\llap", "\\mathllap{\\textrm{#1}}");
defineMacro("\\rlap", "\\mathrlap{\\textrm{#1}}");
defineMacro("\\clap", "\\mathclap{\\textrm{#1}}");

// \mathstrut from the TeXbook, p 360
defineMacro("\\mathstrut", "\\vphantom{(}");

// \underbar from TeXbook p 353
defineMacro("\\underbar", "\\underline{\\text{#1}}");

// \not is defined by base/fontmath.ltx via
// \DeclareMathSymbol{\not}{\mathrel}{symbols}{"36}
// It's thus treated like a \mathrel, but defined by a symbol that has zero
// width but extends to the right.  We use \rlap to get that spacing.
// For MathML we write U+0338 here. buildMathML.js will then do the overlay.
defineMacro("\\not", "\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}" + "{\\char\"338}");

// Negated symbols from base/fontmath.ltx:
// \def\neq{\not=} \let\ne=\neq
// \DeclareRobustCommand
//   \notin{\mathrel{\m@th\mathpalette\c@ncel\in}}
// \def\c@ncel#1#2{\m@th\ooalign{$\hfil#1\mkern1mu/\hfil$\crcr$#1#2$}}
defineMacro("\\neq", "\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");
defineMacro("\\ne", "\\neq");
defineMacro("\u2260", "\\neq");
defineMacro("\\notin", "\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}" + "{\\mathrel{\\char`∉}}");
defineMacro("\u2209", "\\notin");

// Unicode stacked relations
defineMacro("\u2258", "\\html@mathml{" + "\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}" + "}{\\mathrel{\\char`\u2258}}");
defineMacro("\u2259", "\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}");
defineMacro("\u225A", "\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}");
defineMacro("\u225B", "\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}" + "{\\mathrel{\\char`\u225B}}");
defineMacro("\u225D", "\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}" + "{\\mathrel{\\char`\u225D}}");
defineMacro("\u225E", "\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}" + "{\\mathrel{\\char`\u225E}}");
defineMacro("\u225F", "\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}");

// Misc Unicode
defineMacro("\u27C2", "\\perp");
defineMacro("\u203C", "\\mathclose{!\\mkern-0.8mu!}");
defineMacro("\u220C", "\\notni");
defineMacro("\u231C", "\\ulcorner");
defineMacro("\u231D", "\\urcorner");
defineMacro("\u231E", "\\llcorner");
defineMacro("\u231F", "\\lrcorner");
defineMacro("\u00A9", "\\copyright");
defineMacro("\u00AE", "\\textregistered");

// The KaTeX fonts have corners at codepoints that don't match Unicode.
// For MathML purposes, use the Unicode code point.
defineMacro("\\ulcorner", "\\html@mathml{\\@ulcorner}{\\mathop{\\char\"231c}}");
defineMacro("\\urcorner", "\\html@mathml{\\@urcorner}{\\mathop{\\char\"231d}}");
defineMacro("\\llcorner", "\\html@mathml{\\@llcorner}{\\mathop{\\char\"231e}}");
defineMacro("\\lrcorner", "\\html@mathml{\\@lrcorner}{\\mathop{\\char\"231f}}");

//////////////////////////////////////////////////////////////////////
// LaTeX_2ε

// \vdots{\vbox{\baselineskip4\p@  \lineskiplimit\z@
// \kern6\p@\hbox{.}\hbox{.}\hbox{.}}}
// We'll call \varvdots, which gets a glyph from symbols.js.
// The zero-width rule gets us an equivalent to the vertical 6pt kern.
defineMacro("\\vdots", "{\\varvdots\\rule{0pt}{15pt}}");
defineMacro("\u22ee", "\\vdots");

//////////////////////////////////////////////////////////////////////
// amsmath.sty
// http://mirrors.concertpass.com/tex-archive/macros/latex/required/amsmath/amsmath.pdf

// Italic Greek capital letters.  AMS defines these with \DeclareMathSymbol,
// but they are equivalent to \mathit{\Letter}.
defineMacro("\\varGamma", "\\mathit{\\Gamma}");
defineMacro("\\varDelta", "\\mathit{\\Delta}");
defineMacro("\\varTheta", "\\mathit{\\Theta}");
defineMacro("\\varLambda", "\\mathit{\\Lambda}");
defineMacro("\\varXi", "\\mathit{\\Xi}");
defineMacro("\\varPi", "\\mathit{\\Pi}");
defineMacro("\\varSigma", "\\mathit{\\Sigma}");
defineMacro("\\varUpsilon", "\\mathit{\\Upsilon}");
defineMacro("\\varPhi", "\\mathit{\\Phi}");
defineMacro("\\varPsi", "\\mathit{\\Psi}");
defineMacro("\\varOmega", "\\mathit{\\Omega}");

//\newcommand{\substack}[1]{\subarray{c}#1\endsubarray}
defineMacro("\\substack", "\\begin{subarray}{c}#1\\end{subarray}");

// \renewcommand{\colon}{\nobreak\mskip2mu\mathpunct{}\nonscript
// \mkern-\thinmuskip{:}\mskip6muplus1mu\relax}
defineMacro("\\colon", "\\nobreak\\mskip2mu\\mathpunct{}" + "\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");

// \newcommand{\boxed}[1]{\fbox{\m@th$\displaystyle#1$}}
defineMacro("\\boxed", "\\fbox{$\\displaystyle{#1}$}");

// \def\iff{\DOTSB\;\Longleftrightarrow\;}
// \def\implies{\DOTSB\;\Longrightarrow\;}
// \def\impliedby{\DOTSB\;\Longleftarrow\;}
defineMacro("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;");
defineMacro("\\implies", "\\DOTSB\\;\\Longrightarrow\\;");
defineMacro("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;");

// \def\dddot#1{{\mathop{#1}\limits^{\vbox to-1.4\ex@{\kern-\tw@\ex@
//  \hbox{\normalfont ...}\vss}}}}
// We use \overset which avoids the vertical shift of \mathop.
defineMacro("\\dddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");
defineMacro("\\ddddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");

// AMSMath's automatic \dots, based on \mdots@@ macro.
const dotsByToken = {
  ',': '\\dotsc',
  '\\not': '\\dotsb',
  // \keybin@ checks for the following:
  '+': '\\dotsb',
  '=': '\\dotsb',
  '<': '\\dotsb',
  '>': '\\dotsb',
  '-': '\\dotsb',
  '*': '\\dotsb',
  ':': '\\dotsb',
  // Symbols whose definition starts with \DOTSB:
  '\\DOTSB': '\\dotsb',
  '\\coprod': '\\dotsb',
  '\\bigvee': '\\dotsb',
  '\\bigwedge': '\\dotsb',
  '\\biguplus': '\\dotsb',
  '\\bigcap': '\\dotsb',
  '\\bigcup': '\\dotsb',
  '\\prod': '\\dotsb',
  '\\sum': '\\dotsb',
  '\\bigotimes': '\\dotsb',
  '\\bigoplus': '\\dotsb',
  '\\bigodot': '\\dotsb',
  '\\bigsqcup': '\\dotsb',
  '\\And': '\\dotsb',
  '\\longrightarrow': '\\dotsb',
  '\\Longrightarrow': '\\dotsb',
  '\\longleftarrow': '\\dotsb',
  '\\Longleftarrow': '\\dotsb',
  '\\longleftrightarrow': '\\dotsb',
  '\\Longleftrightarrow': '\\dotsb',
  '\\mapsto': '\\dotsb',
  '\\longmapsto': '\\dotsb',
  '\\hookrightarrow': '\\dotsb',
  '\\doteq': '\\dotsb',
  // Symbols whose definition starts with \mathbin:
  '\\mathbin': '\\dotsb',
  // Symbols whose definition starts with \mathrel:
  '\\mathrel': '\\dotsb',
  '\\relbar': '\\dotsb',
  '\\Relbar': '\\dotsb',
  '\\xrightarrow': '\\dotsb',
  '\\xleftarrow': '\\dotsb',
  // Symbols whose definition starts with \DOTSI:
  '\\DOTSI': '\\dotsi',
  '\\int': '\\dotsi',
  '\\oint': '\\dotsi',
  '\\iint': '\\dotsi',
  '\\iiint': '\\dotsi',
  '\\iiiint': '\\dotsi',
  '\\idotsint': '\\dotsi',
  // Symbols whose definition starts with \DOTSX:
  '\\DOTSX': '\\dotsx'
};
const dotsbGroups = new Set(['bin', 'rel']);
defineMacro("\\dots", function (context) {
  // TODO: If used in text mode, should expand to \textellipsis.
  // However, in KaTeX, \textellipsis and \ldots behave the same
  // (in text mode), and it's unlikely we'd see any of the math commands
  // that affect the behavior of \dots when in text mode.  So fine for now
  // (until we support \ifmmode ... \else ... \fi).
  let thedots = '\\dotso';
  const next = context.expandAfterFuture().text;
  if (next in dotsByToken) {
    thedots = dotsByToken[next];
  } else if (next.slice(0, 4) === '\\not') {
    thedots = '\\dotsb';
  } else if (next in src_symbols.math) {
    if (dotsbGroups.has(src_symbols.math[next].group)) {
      thedots = '\\dotsb';
    }
  }
  return thedots;
});
const spaceAfterDots = {
  // \rightdelim@ checks for the following:
  ')': true,
  ']': true,
  '\\rbrack': true,
  '\\}': true,
  '\\rbrace': true,
  '\\rangle': true,
  '\\rceil': true,
  '\\rfloor': true,
  '\\rgroup': true,
  '\\rmoustache': true,
  '\\right': true,
  '\\bigr': true,
  '\\biggr': true,
  '\\Bigr': true,
  '\\Biggr': true,
  // \extra@ also tests for the following:
  '$': true,
  // \extrap@ checks for the following:
  ';': true,
  '.': true,
  ',': true
};
defineMacro("\\dotso", function (context) {
  const next = context.future().text;
  if (next in spaceAfterDots) {
    return "\\ldots\\,";
  } else {
    return "\\ldots";
  }
});
defineMacro("\\dotsc", function (context) {
  const next = context.future().text;
  // \dotsc uses \extra@ but not \extrap@, instead specially checking for
  // ';' and '.', but doesn't check for ','.
  if (next in spaceAfterDots && next !== ',') {
    return "\\ldots\\,";
  } else {
    return "\\ldots";
  }
});
defineMacro("\\cdots", function (context) {
  const next = context.future().text;
  if (next in spaceAfterDots) {
    return "\\@cdots\\,";
  } else {
    return "\\@cdots";
  }
});
defineMacro("\\dotsb", "\\cdots");
defineMacro("\\dotsm", "\\cdots");
defineMacro("\\dotsi", "\\!\\cdots");
// amsmath doesn't actually define \dotsx, but \dots followed by a macro
// starting with \DOTSX implies \dotso, and then \extra@ detects this case
// and forces the added `\,`.
defineMacro("\\dotsx", "\\ldots\\,");

// \let\DOTSI\relax
// \let\DOTSB\relax
// \let\DOTSX\relax
defineMacro("\\DOTSI", "\\relax");
defineMacro("\\DOTSB", "\\relax");
defineMacro("\\DOTSX", "\\relax");

// Spacing, based on amsmath.sty's override of LaTeX defaults
// \DeclareRobustCommand{\tmspace}[3]{%
//   \ifmmode\mskip#1#2\else\kern#1#3\fi\relax}
defineMacro("\\tmspace", "\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");
// \renewcommand{\,}{\tmspace+\thinmuskip{.1667em}}
// TODO: math mode should use \thinmuskip
defineMacro("\\,", "\\tmspace+{3mu}{.1667em}");
// \let\thinspace\,
defineMacro("\\thinspace", "\\,");
// \def\>{\mskip\medmuskip}
// \renewcommand{\:}{\tmspace+\medmuskip{.2222em}}
// TODO: \> and math mode of \: should use \medmuskip = 4mu plus 2mu minus 4mu
defineMacro("\\>", "\\mskip{4mu}");
defineMacro("\\:", "\\tmspace+{4mu}{.2222em}");
// \let\medspace\:
defineMacro("\\medspace", "\\:");
// \renewcommand{\;}{\tmspace+\thickmuskip{.2777em}}
// TODO: math mode should use \thickmuskip = 5mu plus 5mu
defineMacro("\\;", "\\tmspace+{5mu}{.2777em}");
// \let\thickspace\;
defineMacro("\\thickspace", "\\;");
// \renewcommand{\!}{\tmspace-\thinmuskip{.1667em}}
// TODO: math mode should use \thinmuskip
defineMacro("\\!", "\\tmspace-{3mu}{.1667em}");
// \let\negthinspace\!
defineMacro("\\negthinspace", "\\!");
// \newcommand{\negmedspace}{\tmspace-\medmuskip{.2222em}}
// TODO: math mode should use \medmuskip
defineMacro("\\negmedspace", "\\tmspace-{4mu}{.2222em}");
// \newcommand{\negthickspace}{\tmspace-\thickmuskip{.2777em}}
// TODO: math mode should use \thickmuskip
defineMacro("\\negthickspace", "\\tmspace-{5mu}{.277em}");
// \def\enspace{\kern.5em }
defineMacro("\\enspace", "\\kern.5em ");
// \def\enskip{\hskip.5em\relax}
defineMacro("\\enskip", "\\hskip.5em\\relax");
// \def\quad{\hskip1em\relax}
defineMacro("\\quad", "\\hskip1em\\relax");
// \def\qquad{\hskip2em\relax}
defineMacro("\\qquad", "\\hskip2em\\relax");

// \tag@in@display form of \tag
defineMacro("\\tag", "\\@ifstar\\tag@literal\\tag@paren");
defineMacro("\\tag@paren", "\\tag@literal{({#1})}");
defineMacro("\\tag@literal", context => {
  if (context.macros.get("\\df@tag")) {
    throw new src_ParseError("Multiple \\tag");
  }
  return "\\gdef\\df@tag{\\text{#1}}";
});

// \renewcommand{\bmod}{\nonscript\mskip-\medmuskip\mkern5mu\mathbin
//   {\operator@font mod}\penalty900
//   \mkern5mu\nonscript\mskip-\medmuskip}
// \newcommand{\pod}[1]{\allowbreak
//   \if@display\mkern18mu\else\mkern8mu\fi(#1)}
// \renewcommand{\pmod}[1]{\pod{{\operator@font mod}\mkern6mu#1}}
// \newcommand{\mod}[1]{\allowbreak\if@display\mkern18mu
//   \else\mkern12mu\fi{\operator@font mod}\,\,#1}
// TODO: math mode should use \medmuskip = 4mu plus 2mu minus 4mu
defineMacro("\\bmod", "\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}" + "\\mathbin{\\rm mod}" + "\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");
defineMacro("\\pod", "\\allowbreak" + "\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");
defineMacro("\\pmod", "\\pod{{\\rm mod}\\mkern6mu#1}");
defineMacro("\\mod", "\\allowbreak" + "\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}" + "{\\rm mod}\\,\\,#1");

//////////////////////////////////////////////////////////////////////
// LaTeX source2e

// \expandafter\let\expandafter\@normalcr
//     \csname\expandafter\@gobble\string\\ \endcsname
// \DeclareRobustCommand\newline{\@normalcr\relax}
defineMacro("\\newline", "\\\\\\relax");

// \def\TeX{T\kern-.1667em\lower.5ex\hbox{E}\kern-.125emX\@}
// TODO: Doesn't normally work in math mode because \@ fails.  KaTeX doesn't
// support \@ yet, so that's omitted, and we add \text so that the result
// doesn't look funny in math mode.
defineMacro("\\TeX", "\\textrm{\\html@mathml{" + "T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX" + "}{TeX}}");

// \DeclareRobustCommand{\LaTeX}{L\kern-.36em%
//         {\sbox\z@ T%
//          \vbox to\ht\z@{\hbox{\check@mathfonts
//                               \fontsize\sf@size\z@
//                               \math@fontsfalse\selectfont
//                               A}%
//                         \vss}%
//         }%
//         \kern-.15em%
//         \TeX}
// This code aligns the top of the A with the T (from the perspective of TeX's
// boxes, though visually the A appears to extend above slightly).
// We compute the corresponding \raisebox when A is rendered in \normalsize
// \scriptstyle, which has a scale factor of 0.7 (see Options.js).
const latexRaiseA = makeEm(fontMetricsData['Main-Regular']["T".charCodeAt(0)][1] - 0.7 * fontMetricsData['Main-Regular']["A".charCodeAt(0)][1]);
defineMacro("\\LaTeX", "\\textrm{\\html@mathml{" + ("L\\kern-.36em\\raisebox{" + latexRaiseA + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{LaTeX}}");

// New KaTeX logo based on tweaking LaTeX logo
defineMacro("\\KaTeX", "\\textrm{\\html@mathml{" + ("K\\kern-.17em\\raisebox{" + latexRaiseA + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{KaTeX}}");

// \DeclareRobustCommand\hspace{\@ifstar\@hspacer\@hspace}
// \def\@hspace#1{\hskip  #1\relax}
// \def\@hspacer#1{\vrule \@width\z@\nobreak
//                 \hskip #1\hskip \z@skip}
defineMacro("\\hspace", "\\@ifstar\\@hspacer\\@hspace");
defineMacro("\\@hspace", "\\hskip #1\\relax");
defineMacro("\\@hspacer", "\\rule{0pt}{0pt}\\hskip #1\\relax");

//////////////////////////////////////////////////////////////////////
// mathtools.sty

//\providecommand\ordinarycolon{:}
defineMacro("\\ordinarycolon", ":");
//\def\vcentcolon{\mathrel{\mathop\ordinarycolon}}
//TODO(edemaine): Not yet centered. Fix via \raisebox or #726
defineMacro("\\vcentcolon", "\\mathrel{\\mathop\\ordinarycolon}");
// \providecommand*\dblcolon{\vcentcolon\mathrel{\mkern-.9mu}\vcentcolon}
defineMacro("\\dblcolon", "\\html@mathml{" + "\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}" + "{\\mathop{\\char\"2237}}");
// \providecommand*\coloneqq{\vcentcolon\mathrel{\mkern-1.2mu}=}
defineMacro("\\coloneqq", "\\html@mathml{" + "\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}" + "{\\mathop{\\char\"2254}}"); // ≔
// \providecommand*\Coloneqq{\dblcolon\mathrel{\mkern-1.2mu}=}
defineMacro("\\Coloneqq", "\\html@mathml{" + "\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}" + "{\\mathop{\\char\"2237\\char\"3d}}");
// \providecommand*\coloneq{\vcentcolon\mathrel{\mkern-1.2mu}\mathrel{-}}
defineMacro("\\coloneq", "\\html@mathml{" + "\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}" + "{\\mathop{\\char\"3a\\char\"2212}}");
// \providecommand*\Coloneq{\dblcolon\mathrel{\mkern-1.2mu}\mathrel{-}}
defineMacro("\\Coloneq", "\\html@mathml{" + "\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}" + "{\\mathop{\\char\"2237\\char\"2212}}");
// \providecommand*\eqqcolon{=\mathrel{\mkern-1.2mu}\vcentcolon}
defineMacro("\\eqqcolon", "\\html@mathml{" + "\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}" + "{\\mathop{\\char\"2255}}"); // ≕
// \providecommand*\Eqqcolon{=\mathrel{\mkern-1.2mu}\dblcolon}
defineMacro("\\Eqqcolon", "\\html@mathml{" + "\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}" + "{\\mathop{\\char\"3d\\char\"2237}}");
// \providecommand*\eqcolon{\mathrel{-}\mathrel{\mkern-1.2mu}\vcentcolon}
defineMacro("\\eqcolon", "\\html@mathml{" + "\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}" + "{\\mathop{\\char\"2239}}");
// \providecommand*\Eqcolon{\mathrel{-}\mathrel{\mkern-1.2mu}\dblcolon}
defineMacro("\\Eqcolon", "\\html@mathml{" + "\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}" + "{\\mathop{\\char\"2212\\char\"2237}}");
// \providecommand*\colonapprox{\vcentcolon\mathrel{\mkern-1.2mu}\approx}
defineMacro("\\colonapprox", "\\html@mathml{" + "\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}" + "{\\mathop{\\char\"3a\\char\"2248}}");
// \providecommand*\Colonapprox{\dblcolon\mathrel{\mkern-1.2mu}\approx}
defineMacro("\\Colonapprox", "\\html@mathml{" + "\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}" + "{\\mathop{\\char\"2237\\char\"2248}}");
// \providecommand*\colonsim{\vcentcolon\mathrel{\mkern-1.2mu}\sim}
defineMacro("\\colonsim", "\\html@mathml{" + "\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}" + "{\\mathop{\\char\"3a\\char\"223c}}");
// \providecommand*\Colonsim{\dblcolon\mathrel{\mkern-1.2mu}\sim}
defineMacro("\\Colonsim", "\\html@mathml{" + "\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}" + "{\\mathop{\\char\"2237\\char\"223c}}");

// Some Unicode characters are implemented with macros to mathtools functions.
defineMacro("\u2237", "\\dblcolon"); // ::
defineMacro("\u2239", "\\eqcolon"); // -:
defineMacro("\u2254", "\\coloneqq"); // :=
defineMacro("\u2255", "\\eqqcolon"); // =:
defineMacro("\u2A74", "\\Coloneqq"); // ::=

//////////////////////////////////////////////////////////////////////
// colonequals.sty

// Alternate names for mathtools's macros:
defineMacro("\\ratio", "\\vcentcolon");
defineMacro("\\coloncolon", "\\dblcolon");
defineMacro("\\colonequals", "\\coloneqq");
defineMacro("\\coloncolonequals", "\\Coloneqq");
defineMacro("\\equalscolon", "\\eqqcolon");
defineMacro("\\equalscoloncolon", "\\Eqqcolon");
defineMacro("\\colonminus", "\\coloneq");
defineMacro("\\coloncolonminus", "\\Coloneq");
defineMacro("\\minuscolon", "\\eqcolon");
defineMacro("\\minuscoloncolon", "\\Eqcolon");
// \colonapprox name is same in mathtools and colonequals.
defineMacro("\\coloncolonapprox", "\\Colonapprox");
// \colonsim name is same in mathtools and colonequals.
defineMacro("\\coloncolonsim", "\\Colonsim");

// Additional macros, implemented by analogy with mathtools definitions:
defineMacro("\\simcolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
defineMacro("\\simcoloncolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");
defineMacro("\\approxcolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
defineMacro("\\approxcoloncolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");

// Present in newtxmath, pxfonts and txfonts
defineMacro("\\notni", "\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}");
defineMacro("\\limsup", "\\DOTSB\\operatorname*{lim\\,sup}");
defineMacro("\\liminf", "\\DOTSB\\operatorname*{lim\\,inf}");

//////////////////////////////////////////////////////////////////////
// From amsopn.sty
defineMacro("\\injlim", "\\DOTSB\\operatorname*{inj\\,lim}");
defineMacro("\\projlim", "\\DOTSB\\operatorname*{proj\\,lim}");
defineMacro("\\varlimsup", "\\DOTSB\\operatorname*{\\overline{lim}}");
defineMacro("\\varliminf", "\\DOTSB\\operatorname*{\\underline{lim}}");
defineMacro("\\varinjlim", "\\DOTSB\\operatorname*{\\underrightarrow{lim}}");
defineMacro("\\varprojlim", "\\DOTSB\\operatorname*{\\underleftarrow{lim}}");

//////////////////////////////////////////////////////////////////////
// MathML alternates for KaTeX glyphs in the Unicode private area
defineMacro("\\gvertneqq", "\\html@mathml{\\@gvertneqq}{\u2269}");
defineMacro("\\lvertneqq", "\\html@mathml{\\@lvertneqq}{\u2268}");
defineMacro("\\ngeqq", "\\html@mathml{\\@ngeqq}{\u2271}");
defineMacro("\\ngeqslant", "\\html@mathml{\\@ngeqslant}{\u2271}");
defineMacro("\\nleqq", "\\html@mathml{\\@nleqq}{\u2270}");
defineMacro("\\nleqslant", "\\html@mathml{\\@nleqslant}{\u2270}");
defineMacro("\\nshortmid", "\\html@mathml{\\@nshortmid}{∤}");
defineMacro("\\nshortparallel", "\\html@mathml{\\@nshortparallel}{∦}");
defineMacro("\\nsubseteqq", "\\html@mathml{\\@nsubseteqq}{\u2288}");
defineMacro("\\nsupseteqq", "\\html@mathml{\\@nsupseteqq}{\u2289}");
defineMacro("\\varsubsetneq", "\\html@mathml{\\@varsubsetneq}{⊊}");
defineMacro("\\varsubsetneqq", "\\html@mathml{\\@varsubsetneqq}{⫋}");
defineMacro("\\varsupsetneq", "\\html@mathml{\\@varsupsetneq}{⊋}");
defineMacro("\\varsupsetneqq", "\\html@mathml{\\@varsupsetneqq}{⫌}");
defineMacro("\\imath", "\\html@mathml{\\@imath}{\u0131}");
defineMacro("\\jmath", "\\html@mathml{\\@jmath}{\u0237}");

//////////////////////////////////////////////////////////////////////
// stmaryrd and semantic

// The stmaryrd and semantic packages render the next four items by calling a
// glyph. Those glyphs do not exist in the KaTeX fonts. Hence the macros.

defineMacro("\\llbracket", "\\html@mathml{" + "\\mathopen{[\\mkern-3.2mu[}}" + "{\\mathopen{\\char`\u27e6}}");
defineMacro("\\rrbracket", "\\html@mathml{" + "\\mathclose{]\\mkern-3.2mu]}}" + "{\\mathclose{\\char`\u27e7}}");
defineMacro("\u27e6", "\\llbracket"); // blackboard bold [
defineMacro("\u27e7", "\\rrbracket"); // blackboard bold ]

defineMacro("\\lBrace", "\\html@mathml{" + "\\mathopen{\\{\\mkern-3.2mu[}}" + "{\\mathopen{\\char`\u2983}}");
defineMacro("\\rBrace", "\\html@mathml{" + "\\mathclose{]\\mkern-3.2mu\\}}}" + "{\\mathclose{\\char`\u2984}}");
defineMacro("\u2983", "\\lBrace"); // blackboard bold {
defineMacro("\u2984", "\\rBrace"); // blackboard bold }

// TODO: Create variable sized versions of the last two items. I believe that
// will require new font glyphs.

// The stmaryrd function `\minuso` provides a "Plimsoll" symbol that
// superimposes the characters \circ and \mathminus. Used in chemistry.
defineMacro("\\minuso", "\\mathbin{\\html@mathml{" + "{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}" + "{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}" + "{\\char`⦵}}");
defineMacro("⦵", "\\minuso");

//////////////////////////////////////////////////////////////////////
// texvc.sty

// The texvc package contains macros available in mediawiki pages.
// We omit the functions deprecated at
// https://en.wikipedia.org/wiki/Help:Displaying_a_formula#Deprecated_syntax

// We also omit texvc's \O, which conflicts with \text{\O}

defineMacro("\\darr", "\\downarrow");
defineMacro("\\dArr", "\\Downarrow");
defineMacro("\\Darr", "\\Downarrow");
defineMacro("\\lang", "\\langle");
defineMacro("\\rang", "\\rangle");
defineMacro("\\uarr", "\\uparrow");
defineMacro("\\uArr", "\\Uparrow");
defineMacro("\\Uarr", "\\Uparrow");
defineMacro("\\N", "\\mathbb{N}");
defineMacro("\\R", "\\mathbb{R}");
defineMacro("\\Z", "\\mathbb{Z}");
defineMacro("\\alef", "\\aleph");
defineMacro("\\alefsym", "\\aleph");
defineMacro("\\Alpha", "\\mathrm{A}");
defineMacro("\\Beta", "\\mathrm{B}");
defineMacro("\\bull", "\\bullet");
defineMacro("\\Chi", "\\mathrm{X}");
defineMacro("\\clubs", "\\clubsuit");
defineMacro("\\cnums", "\\mathbb{C}");
defineMacro("\\Complex", "\\mathbb{C}");
defineMacro("\\Dagger", "\\ddagger");
defineMacro("\\diamonds", "\\diamondsuit");
defineMacro("\\empty", "\\emptyset");
defineMacro("\\Epsilon", "\\mathrm{E}");
defineMacro("\\Eta", "\\mathrm{H}");
defineMacro("\\exist", "\\exists");
defineMacro("\\harr", "\\leftrightarrow");
defineMacro("\\hArr", "\\Leftrightarrow");
defineMacro("\\Harr", "\\Leftrightarrow");
defineMacro("\\hearts", "\\heartsuit");
defineMacro("\\image", "\\Im");
defineMacro("\\infin", "\\infty");
defineMacro("\\Iota", "\\mathrm{I}");
defineMacro("\\isin", "\\in");
defineMacro("\\Kappa", "\\mathrm{K}");
defineMacro("\\larr", "\\leftarrow");
defineMacro("\\lArr", "\\Leftarrow");
defineMacro("\\Larr", "\\Leftarrow");
defineMacro("\\lrarr", "\\leftrightarrow");
defineMacro("\\lrArr", "\\Leftrightarrow");
defineMacro("\\Lrarr", "\\Leftrightarrow");
defineMacro("\\Mu", "\\mathrm{M}");
defineMacro("\\natnums", "\\mathbb{N}");
defineMacro("\\Nu", "\\mathrm{N}");
defineMacro("\\Omicron", "\\mathrm{O}");
defineMacro("\\plusmn", "\\pm");
defineMacro("\\rarr", "\\rightarrow");
defineMacro("\\rArr", "\\Rightarrow");
defineMacro("\\Rarr", "\\Rightarrow");
defineMacro("\\real", "\\Re");
defineMacro("\\reals", "\\mathbb{R}");
defineMacro("\\Reals", "\\mathbb{R}");
defineMacro("\\Rho", "\\mathrm{P}");
defineMacro("\\sdot", "\\cdot");
defineMacro("\\sect", "\\S");
defineMacro("\\spades", "\\spadesuit");
defineMacro("\\sub", "\\subset");
defineMacro("\\sube", "\\subseteq");
defineMacro("\\supe", "\\supseteq");
defineMacro("\\Tau", "\\mathrm{T}");
defineMacro("\\thetasym", "\\vartheta");
// TODO: defineMacro("\\varcoppa", "\\\mbox{\\coppa}");
defineMacro("\\weierp", "\\wp");
defineMacro("\\Zeta", "\\mathrm{Z}");

//////////////////////////////////////////////////////////////////////
// statmath.sty
// https://ctan.math.illinois.edu/macros/latex/contrib/statmath/statmath.pdf

defineMacro("\\argmin", "\\DOTSB\\operatorname*{arg\\,min}");
defineMacro("\\argmax", "\\DOTSB\\operatorname*{arg\\,max}");
defineMacro("\\plim", "\\DOTSB\\mathop{\\operatorname{plim}}\\limits");

//////////////////////////////////////////////////////////////////////
// braket.sty
// http://ctan.math.washington.edu/tex-archive/macros/latex/contrib/braket/braket.pdf

defineMacro("\\bra", "\\mathinner{\\langle{#1}|}");
defineMacro("\\ket", "\\mathinner{|{#1}\\rangle}");
defineMacro("\\braket", "\\mathinner{\\langle{#1}\\rangle}");
defineMacro("\\Bra", "\\left\\langle#1\\right|");
defineMacro("\\Ket", "\\left|#1\\right\\rangle");
const braketHelper = one => context => {
  const left = context.consumeArg().tokens;
  const middle = context.consumeArg().tokens;
  const middleDouble = context.consumeArg().tokens;
  const right = context.consumeArg().tokens;
  const oldMiddle = context.macros.get("|");
  const oldMiddleDouble = context.macros.get("\\|");
  context.macros.beginGroup();
  const midMacro = double => context => {
    if (one) {
      // Only modify the first instance of | or \|
      context.macros.set("|", oldMiddle);
      if (middleDouble.length) {
        context.macros.set("\\|", oldMiddleDouble);
      }
    }
    let doubled = double;
    if (!double && middleDouble.length) {
      // Mimic \@ifnextchar
      const nextToken = context.future();
      if (nextToken.text === "|") {
        context.popToken();
        doubled = true;
      }
    }
    return {
      tokens: doubled ? middleDouble : middle,
      numArgs: 0
    };
  };
  context.macros.set("|", midMacro(false));
  if (middleDouble.length) {
    context.macros.set("\\|", midMacro(true));
  }
  const arg = context.consumeArg().tokens;
  const expanded = context.expandTokens([...right, ...arg, ...left // reversed
  ]);
  context.macros.endGroup();
  return {
    tokens: expanded.reverse(),
    numArgs: 0
  };
};
defineMacro("\\bra@ket", braketHelper(false));
defineMacro("\\bra@set", braketHelper(true));
defineMacro("\\Braket", "\\bra@ket{\\left\\langle}" + "{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");
defineMacro("\\Set", "\\bra@set{\\left\\{\\:}" + "{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");
defineMacro("\\set", "\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");
// has no support for special || or \|

//////////////////////////////////////////////////////////////////////
// actuarialangle.dtx
defineMacro("\\angln", "{\\angl n}");

// Custom Khan Academy colors, should be moved to an optional package
defineMacro("\\blue", "\\textcolor{##6495ed}{#1}");
defineMacro("\\orange", "\\textcolor{##ffa500}{#1}");
defineMacro("\\pink", "\\textcolor{##ff00af}{#1}");
defineMacro("\\red", "\\textcolor{##df0030}{#1}");
defineMacro("\\green", "\\textcolor{##28ae7b}{#1}");
defineMacro("\\gray", "\\textcolor{gray}{#1}");
defineMacro("\\purple", "\\textcolor{##9d38bd}{#1}");
defineMacro("\\blueA", "\\textcolor{##ccfaff}{#1}");
defineMacro("\\blueB", "\\textcolor{##80f6ff}{#1}");
defineMacro("\\blueC", "\\textcolor{##63d9ea}{#1}");
defineMacro("\\blueD", "\\textcolor{##11accd}{#1}");
defineMacro("\\blueE", "\\textcolor{##0c7f99}{#1}");
defineMacro("\\tealA", "\\textcolor{##94fff5}{#1}");
defineMacro("\\tealB", "\\textcolor{##26edd5}{#1}");
defineMacro("\\tealC", "\\textcolor{##01d1c1}{#1}");
defineMacro("\\tealD", "\\textcolor{##01a995}{#1}");
defineMacro("\\tealE", "\\textcolor{##208170}{#1}");
defineMacro("\\greenA", "\\textcolor{##b6ffb0}{#1}");
defineMacro("\\greenB", "\\textcolor{##8af281}{#1}");
defineMacro("\\greenC", "\\textcolor{##74cf70}{#1}");
defineMacro("\\greenD", "\\textcolor{##1fab54}{#1}");
defineMacro("\\greenE", "\\textcolor{##0d923f}{#1}");
defineMacro("\\goldA", "\\textcolor{##ffd0a9}{#1}");
defineMacro("\\goldB", "\\textcolor{##ffbb71}{#1}");
defineMacro("\\goldC", "\\textcolor{##ff9c39}{#1}");
defineMacro("\\goldD", "\\textcolor{##e07d10}{#1}");
defineMacro("\\goldE", "\\textcolor{##a75a05}{#1}");
defineMacro("\\redA", "\\textcolor{##fca9a9}{#1}");
defineMacro("\\redB", "\\textcolor{##ff8482}{#1}");
defineMacro("\\redC", "\\textcolor{##f9685d}{#1}");
defineMacro("\\redD", "\\textcolor{##e84d39}{#1}");
defineMacro("\\redE", "\\textcolor{##bc2612}{#1}");
defineMacro("\\maroonA", "\\textcolor{##ffbde0}{#1}");
defineMacro("\\maroonB", "\\textcolor{##ff92c6}{#1}");
defineMacro("\\maroonC", "\\textcolor{##ed5fa6}{#1}");
defineMacro("\\maroonD", "\\textcolor{##ca337c}{#1}");
defineMacro("\\maroonE", "\\textcolor{##9e034e}{#1}");
defineMacro("\\purpleA", "\\textcolor{##ddd7ff}{#1}");
defineMacro("\\purpleB", "\\textcolor{##c6b9fc}{#1}");
defineMacro("\\purpleC", "\\textcolor{##aa87ff}{#1}");
defineMacro("\\purpleD", "\\textcolor{##7854ab}{#1}");
defineMacro("\\purpleE", "\\textcolor{##543b78}{#1}");
defineMacro("\\mintA", "\\textcolor{##f5f9e8}{#1}");
defineMacro("\\mintB", "\\textcolor{##edf2df}{#1}");
defineMacro("\\mintC", "\\textcolor{##e0e5cc}{#1}");
defineMacro("\\grayA", "\\textcolor{##f6f7f7}{#1}");
defineMacro("\\grayB", "\\textcolor{##f0f1f2}{#1}");
defineMacro("\\grayC", "\\textcolor{##e3e5e6}{#1}");
defineMacro("\\grayD", "\\textcolor{##d6d8da}{#1}");
defineMacro("\\grayE", "\\textcolor{##babec2}{#1}");
defineMacro("\\grayF", "\\textcolor{##888d93}{#1}");
defineMacro("\\grayG", "\\textcolor{##626569}{#1}");
defineMacro("\\grayH", "\\textcolor{##3b3e40}{#1}");
defineMacro("\\grayI", "\\textcolor{##21242c}{#1}");
defineMacro("\\kaBlue", "\\textcolor{##314453}{#1}");
defineMacro("\\kaGreen", "\\textcolor{##71B307}{#1}");
;// ./src/MacroExpander.ts
/**
 * This file contains the “gullet” where macros are expanded
 * until only non-macro tokens remain.
 */









// List of commands that act like macros but aren't defined as a macro,
// function, or symbol.  Used in `isDefined`.
const implicitCommands = {
  "^": true,
  // Parser.js
  "_": true,
  // Parser.js
  "\\limits": true,
  // Parser.js
  "\\nolimits": true // Parser.js
};
class MacroExpander {
  constructor(input, settings, mode) {
    this.settings = void 0;
    this.expansionCount = void 0;
    this.lexer = void 0;
    this.macros = void 0;
    this.stack = void 0;
    this.mode = void 0;
    this.settings = settings;
    this.expansionCount = 0;
    this.feed(input);
    // Make new global namespace
    this.macros = new Namespace(src_macros, settings.macros);
    this.mode = mode;
    this.stack = []; // contains tokens in REVERSE order
  }

  /**
   * Feed a new input string to the same MacroExpander
   * (with existing macros etc.).
   */
  feed(input) {
    this.lexer = new Lexer(input, this.settings);
  }

  /**
   * Switches between "text" and "math" modes.
   */
  switchMode(newMode) {
    this.mode = newMode;
  }

  /**
   * Start a new group nesting within all namespaces.
   */
  beginGroup() {
    this.macros.beginGroup();
  }

  /**
   * End current group nesting within all namespaces.
   */
  endGroup() {
    this.macros.endGroup();
  }

  /**
   * Ends all currently nested groups (if any), restoring values before the
   * groups began.  Useful in case of an error in the middle of parsing.
   */
  endGroups() {
    this.macros.endGroups();
  }

  /**
   * Returns the topmost token on the stack, without expanding it.
   * Similar in behavior to TeX's `\futurelet`.
   */
  future() {
    if (this.stack.length === 0) {
      this.pushToken(this.lexer.lex());
    }
    return this.stack[this.stack.length - 1];
  }

  /**
   * Remove and return the next unexpanded token.
   */
  popToken() {
    this.future(); // ensure non-empty stack
    return this.stack.pop();
  }

  /**
   * Add a given token to the token stack.  In particular, this get be used
   * to put back a token returned from one of the other methods.
   */
  pushToken(token) {
    this.stack.push(token);
  }

  /**
   * Append an array of tokens to the token stack.
   */
  pushTokens(tokens) {
    this.stack.push(...tokens);
  }

  /**
   * Find an macro argument without expanding tokens and append the array of
   * tokens to the token stack. Uses Token as a container for the result.
   */
  scanArgument(isOptional) {
    let start;
    let end;
    let tokens;
    if (isOptional) {
      this.consumeSpaces(); // \@ifnextchar gobbles any space following it
      if (this.future().text !== "[") {
        return null;
      }
      start = this.popToken(); // don't include [ in tokens
      ({
        tokens,
        end
      } = this.consumeArg(["]"]));
    } else {
      ({
        tokens,
        start,
        end
      } = this.consumeArg());
    }

    // indicate the end of an argument
    this.pushToken(new Token("EOF", end.loc));
    this.pushTokens(tokens);
    return new Token("", SourceLocation.range(start, end));
  }

  /**
   * Consume all following space tokens, without expansion.
   */
  consumeSpaces() {
    for (;;) {
      const token = this.future();
      if (token.text === " ") {
        this.stack.pop();
      } else {
        break;
      }
    }
  }

  /**
   * Consume an argument from the token stream, and return the resulting array
   * of tokens and start/end token.
   */
  consumeArg(delims) {
    // The argument for a delimited parameter is the shortest (possibly
    // empty) sequence of tokens with properly nested {...} groups that is
    // followed ... by this particular list of non-parameter tokens.
    // The argument for an undelimited parameter is the next nonblank
    // token, unless that token is ‘{’, when the argument will be the
    // entire {...} group that follows.
    const tokens = [];
    const isDelimited = delims && delims.length > 0;
    if (!isDelimited) {
      // Ignore spaces between arguments.  As the TeXbook says:
      // "After you have said ‘\def\row#1#2{...}’, you are allowed to
      //  put spaces between the arguments (e.g., ‘\row x n’), because
      //  TeX doesn’t use single spaces as undelimited arguments."
      this.consumeSpaces();
    }
    const start = this.future();
    let tok;
    let depth = 0;
    let match = 0;
    do {
      tok = this.popToken();
      tokens.push(tok);
      if (tok.text === "{") {
        ++depth;
      } else if (tok.text === "}") {
        --depth;
        if (depth === -1) {
          throw new src_ParseError("Extra }", tok);
        }
      } else if (tok.text === "EOF") {
        throw new src_ParseError("Unexpected end of input in a macro argument" + ", expected '" + (delims && isDelimited ? delims[match] : "}") + "'", tok);
      }
      if (delims && isDelimited) {
        if ((depth === 0 || depth === 1 && delims[match] === "{") && tok.text === delims[match]) {
          ++match;
          if (match === delims.length) {
            // don't include delims in tokens
            tokens.splice(-match, match);
            break;
          }
        } else {
          match = 0;
        }
      }
    } while (depth !== 0 || isDelimited);
    // If the argument found ... has the form ‘{<nested tokens>}’,
    // ... the outermost braces enclosing the argument are removed
    if (start.text === "{" && tokens[tokens.length - 1].text === "}") {
      tokens.pop();
      tokens.shift();
    }
    tokens.reverse(); // to fit in with stack order
    return {
      tokens,
      start,
      end: tok
    };
  }

  /**
   * Consume the specified number of (delimited) arguments from the token
   * stream and return the resulting array of arguments.
   */
  consumeArgs(numArgs, delimiters) {
    if (delimiters) {
      if (delimiters.length !== numArgs + 1) {
        throw new src_ParseError("The length of delimiters doesn't match the number of args!");
      }
      const delims = delimiters[0];
      for (let i = 0; i < delims.length; i++) {
        const tok = this.popToken();
        if (delims[i] !== tok.text) {
          throw new src_ParseError("Use of the macro doesn't match its definition", tok);
        }
      }
    }
    const args = [];
    for (let i = 0; i < numArgs; i++) {
      args.push(this.consumeArg(delimiters && delimiters[i + 1]).tokens);
    }
    return args;
  }

  /**
   * Increment `expansionCount` by the specified amount.
   * Throw an error if it exceeds `maxExpand`.
   */
  countExpansion(amount) {
    this.expansionCount += amount;
    if (this.expansionCount > this.settings.maxExpand) {
      throw new src_ParseError("Too many expansions: infinite loop or " + "need to increase maxExpand setting");
    }
  }

  /**
   * Expand the next token only once if possible.
   *
   * If the token is expanded, the resulting tokens will be pushed onto
   * the stack in reverse order, and the number of such tokens will be
   * returned.  This number might be zero or positive.
   *
   * If not, the return value is `false`, and the next token remains at the
   * top of the stack.
   *
   * In either case, the next token will be on the top of the stack,
   * or the stack will be empty (in case of empty expansion
   * and no other tokens).
   *
   * Used to implement `expandAfterFuture` and `expandNextToken`.
   *
   * If expandableOnly, only expandable tokens are expanded and
   * an undefined control sequence results in an error.
   */
  expandOnce(expandableOnly) {
    const topToken = this.popToken();
    const name = topToken.text;
    const expansion = !topToken.noexpand ? this._getExpansion(name) : null;
    if (expansion == null || expandableOnly && expansion.unexpandable) {
      if (expandableOnly && expansion == null && name[0] === "\\" && !this.isDefined(name)) {
        throw new src_ParseError("Undefined control sequence: " + name);
      }
      this.pushToken(topToken);
      return false;
    }
    this.countExpansion(1);
    let tokens = expansion.tokens;
    const args = this.consumeArgs(expansion.numArgs, expansion.delimiters);
    if (expansion.numArgs) {
      // paste arguments in place of the placeholders
      tokens = tokens.slice(); // make a shallow copy
      for (let i = tokens.length - 1; i >= 0; --i) {
        let tok = tokens[i];
        if (tok.text === "#") {
          if (i === 0) {
            throw new src_ParseError("Incomplete placeholder at end of macro body", tok);
          }
          tok = tokens[--i]; // next token on stack
          if (tok.text === "#") {
            // ## → #
            tokens.splice(i + 1, 1); // drop first #
          } else if (/^[1-9]$/.test(tok.text)) {
            // replace the placeholder with the indicated argument
            tokens.splice(i, 2, ...args[+tok.text - 1]);
          } else {
            throw new src_ParseError("Not a valid argument number", tok);
          }
        }
      }
    }
    // Concatenate expansion onto top of stack.
    this.pushTokens(tokens);
    return tokens.length;
  }

  /**
   * Expand the next token only once (if possible), and return the resulting
   * top token on the stack (without removing anything from the stack).
   * Similar in behavior to TeX's `\expandafter\futurelet`.
   * Equivalent to expandOnce() followed by future().
   */
  expandAfterFuture() {
    this.expandOnce();
    return this.future();
  }

  /**
   * Recursively expand first token, then return first non-expandable token.
   */
  expandNextToken() {
    for (;;) {
      if (this.expandOnce() === false) {
        // fully expanded
        const token = this.stack.pop();
        // the token after \noexpand is interpreted as if its meaning
        // were ‘\relax’
        if (token.treatAsRelax) {
          token.text = "\\relax";
        }
        return token;
      }
    }
  }

  /**
   * Fully expand the given macro name and return the resulting list of
   * tokens, or return `undefined` if no such macro is defined.
   */
  expandMacro(name) {
    return this.macros.has(name) ? this.expandTokens([new Token(name)]) : undefined;
  }

  /**
   * Fully expand the given token stream and return the resulting list of
   * tokens.  Note that the input tokens are in reverse order, but the
   * output tokens are in forward order.
   */
  expandTokens(tokens) {
    const output = [];
    const oldStackLength = this.stack.length;
    this.pushTokens(tokens);
    while (this.stack.length > oldStackLength) {
      // Expand only expandable tokens
      if (this.expandOnce(true) === false) {
        // fully expanded
        const token = this.stack.pop();
        if (token.treatAsRelax) {
          // the expansion of \noexpand is the token itself
          token.noexpand = false;
          token.treatAsRelax = false;
        }
        output.push(token);
      }
    }
    // Count all of these tokens as additional expansions, to prevent
    // exponential blowup from linearly many \edef's.
    this.countExpansion(output.length);
    return output;
  }

  /**
   * Fully expand the given macro name and return the result as a string,
   * or return `undefined` if no such macro is defined.
   */
  expandMacroAsText(name) {
    const tokens = this.expandMacro(name);
    if (tokens) {
      return tokens.map(token => token.text).join("");
    } else {
      return tokens;
    }
  }

  /**
   * Returns the expanded macro as a reversed array of tokens and a macro
   * argument count.  Or returns `null` if no such macro.
   */
  _getExpansion(name) {
    const definition = this.macros.get(name);
    if (definition == null) {
      // mainly checking for undefined here
      return definition;
    }
    // If a single character has an associated catcode other than 13
    // (active character), then don't expand it.
    if (name.length === 1) {
      const catcode = this.lexer.catcodes[name];
      if (catcode != null && catcode !== 13) {
        return;
      }
    }
    const expansion = typeof definition === "function" ? definition(this) : definition;
    if (typeof expansion === "string") {
      let numArgs = 0;
      if (expansion.includes("#")) {
        const stripped = expansion.replace(/##/g, "");
        while (stripped.includes("#" + (numArgs + 1))) {
          ++numArgs;
        }
      }
      const bodyLexer = new Lexer(expansion, this.settings);
      const tokens = [];
      let tok = bodyLexer.lex();
      while (tok.text !== "EOF") {
        tokens.push(tok);
        tok = bodyLexer.lex();
      }
      tokens.reverse(); // to fit in with stack using push and pop
      const expanded = {
        tokens,
        numArgs
      };
      return expanded;
    }
    return expansion;
  }

  /**
   * Determine whether a command is currently "defined" (has some
   * functionality), meaning that it's a macro (in the current group),
   * a function, a symbol, or one of the special commands listed in
   * `implicitCommands`.
   */
  isDefined(name) {
    return this.macros.has(name) || src_functions.hasOwnProperty(name) || src_symbols.math.hasOwnProperty(name) || src_symbols.text.hasOwnProperty(name) || implicitCommands.hasOwnProperty(name);
  }

  /**
   * Determine whether a command is expandable.
   */
  isExpandable(name) {
    const macro = this.macros.get(name);
    return macro != null ? typeof macro === "string" || typeof macro === "function" || !macro.unexpandable : src_functions.hasOwnProperty(name) && !src_functions[name].primitive;
  }
}
;// ./src/unicodeSupOrSub.ts
// Helpers for Parser.js handling of Unicode (sub|super)script characters.

const unicodeSubRegEx = /^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/;
const uSubsAndSups = Object.freeze({
  '₊': '+',
  '₋': '-',
  '₌': '=',
  '₍': '(',
  '₎': ')',
  '₀': '0',
  '₁': '1',
  '₂': '2',
  '₃': '3',
  '₄': '4',
  '₅': '5',
  '₆': '6',
  '₇': '7',
  '₈': '8',
  '₉': '9',
  '\u2090': 'a',
  '\u2091': 'e',
  '\u2095': 'h',
  '\u1D62': 'i',
  '\u2C7C': 'j',
  '\u2096': 'k',
  '\u2097': 'l',
  '\u2098': 'm',
  '\u2099': 'n',
  '\u2092': 'o',
  '\u209A': 'p',
  '\u1D63': 'r',
  '\u209B': 's',
  '\u209C': 't',
  '\u1D64': 'u',
  '\u1D65': 'v',
  '\u2093': 'x',
  '\u1D66': 'β',
  '\u1D67': 'γ',
  '\u1D68': 'ρ',
  '\u1D69': '\u03d5',
  '\u1D6A': 'χ',
  '⁺': '+',
  '⁻': '-',
  '⁼': '=',
  '⁽': '(',
  '⁾': ')',
  '⁰': '0',
  '¹': '1',
  '²': '2',
  '³': '3',
  '⁴': '4',
  '⁵': '5',
  '⁶': '6',
  '⁷': '7',
  '⁸': '8',
  '⁹': '9',
  '\u1D2C': 'A',
  '\u1D2E': 'B',
  '\u1D30': 'D',
  '\u1D31': 'E',
  '\u1D33': 'G',
  '\u1D34': 'H',
  '\u1D35': 'I',
  '\u1D36': 'J',
  '\u1D37': 'K',
  '\u1D38': 'L',
  '\u1D39': 'M',
  '\u1D3A': 'N',
  '\u1D3C': 'O',
  '\u1D3E': 'P',
  '\u1D3F': 'R',
  '\u1D40': 'T',
  '\u1D41': 'U',
  '\u2C7D': 'V',
  '\u1D42': 'W',
  '\u1D43': 'a',
  '\u1D47': 'b',
  '\u1D9C': 'c',
  '\u1D48': 'd',
  '\u1D49': 'e',
  '\u1DA0': 'f',
  '\u1D4D': 'g',
  '\u02B0': 'h',
  '\u2071': 'i',
  '\u02B2': 'j',
  '\u1D4F': 'k',
  '\u02E1': 'l',
  '\u1D50': 'm',
  '\u207F': 'n',
  '\u1D52': 'o',
  '\u1D56': 'p',
  '\u02B3': 'r',
  '\u02E2': 's',
  '\u1D57': 't',
  '\u1D58': 'u',
  '\u1D5B': 'v',
  '\u02B7': 'w',
  '\u02E3': 'x',
  '\u02B8': 'y',
  '\u1DBB': 'z',
  '\u1D5D': 'β',
  '\u1D5E': 'γ',
  '\u1D5F': 'δ',
  '\u1D60': '\u03d5',
  '\u1D61': 'χ',
  '\u1DBF': 'θ'
});
;// ./src/Parser.ts
/* eslint no-constant-condition:0 */












// Pre-evaluate both modules as unicodeSymbols require String.normalize()
const unicodeAccents = {
  "́": {
    "text": "\\'",
    "math": "\\acute"
  },
  "̀": {
    "text": "\\`",
    "math": "\\grave"
  },
  "̈": {
    "text": "\\\"",
    "math": "\\ddot"
  },
  "̃": {
    "text": "\\~",
    "math": "\\tilde"
  },
  "̄": {
    "text": "\\=",
    "math": "\\bar"
  },
  "̆": {
    "text": "\\u",
    "math": "\\breve"
  },
  "̌": {
    "text": "\\v",
    "math": "\\check"
  },
  "̂": {
    "text": "\\^",
    "math": "\\hat"
  },
  "̇": {
    "text": "\\.",
    "math": "\\dot"
  },
  "̊": {
    "text": "\\r",
    "math": "\\mathring"
  },
  "̋": {
    "text": "\\H"
  },
  "̧": {
    "text": "\\c"
  }
};
const unicodeSymbols = {
  "á": "á",
  "à": "à",
  "ä": "ä",
  "ǟ": "ǟ",
  "ã": "ã",
  "ā": "ā",
  "ă": "ă",
  "ắ": "ắ",
  "ằ": "ằ",
  "ẵ": "ẵ",
  "ǎ": "ǎ",
  "â": "â",
  "ấ": "ấ",
  "ầ": "ầ",
  "ẫ": "ẫ",
  "ȧ": "ȧ",
  "ǡ": "ǡ",
  "å": "å",
  "ǻ": "ǻ",
  "ḃ": "ḃ",
  "ć": "ć",
  "ḉ": "ḉ",
  "č": "č",
  "ĉ": "ĉ",
  "ċ": "ċ",
  "ç": "ç",
  "ď": "ď",
  "ḋ": "ḋ",
  "ḑ": "ḑ",
  "é": "é",
  "è": "è",
  "ë": "ë",
  "ẽ": "ẽ",
  "ē": "ē",
  "ḗ": "ḗ",
  "ḕ": "ḕ",
  "ĕ": "ĕ",
  "ḝ": "ḝ",
  "ě": "ě",
  "ê": "ê",
  "ế": "ế",
  "ề": "ề",
  "ễ": "ễ",
  "ė": "ė",
  "ȩ": "ȩ",
  "ḟ": "ḟ",
  "ǵ": "ǵ",
  "ḡ": "ḡ",
  "ğ": "ğ",
  "ǧ": "ǧ",
  "ĝ": "ĝ",
  "ġ": "ġ",
  "ģ": "ģ",
  "ḧ": "ḧ",
  "ȟ": "ȟ",
  "ĥ": "ĥ",
  "ḣ": "ḣ",
  "ḩ": "ḩ",
  "í": "í",
  "ì": "ì",
  "ï": "ï",
  "ḯ": "ḯ",
  "ĩ": "ĩ",
  "ī": "ī",
  "ĭ": "ĭ",
  "ǐ": "ǐ",
  "î": "î",
  "ǰ": "ǰ",
  "ĵ": "ĵ",
  "ḱ": "ḱ",
  "ǩ": "ǩ",
  "ķ": "ķ",
  "ĺ": "ĺ",
  "ľ": "ľ",
  "ļ": "ļ",
  "ḿ": "ḿ",
  "ṁ": "ṁ",
  "ń": "ń",
  "ǹ": "ǹ",
  "ñ": "ñ",
  "ň": "ň",
  "ṅ": "ṅ",
  "ņ": "ņ",
  "ó": "ó",
  "ò": "ò",
  "ö": "ö",
  "ȫ": "ȫ",
  "õ": "õ",
  "ṍ": "ṍ",
  "ṏ": "ṏ",
  "ȭ": "ȭ",
  "ō": "ō",
  "ṓ": "ṓ",
  "ṑ": "ṑ",
  "ŏ": "ŏ",
  "ǒ": "ǒ",
  "ô": "ô",
  "ố": "ố",
  "ồ": "ồ",
  "ỗ": "ỗ",
  "ȯ": "ȯ",
  "ȱ": "ȱ",
  "ő": "ő",
  "ṕ": "ṕ",
  "ṗ": "ṗ",
  "ŕ": "ŕ",
  "ř": "ř",
  "ṙ": "ṙ",
  "ŗ": "ŗ",
  "ś": "ś",
  "ṥ": "ṥ",
  "š": "š",
  "ṧ": "ṧ",
  "ŝ": "ŝ",
  "ṡ": "ṡ",
  "ş": "ş",
  "ẗ": "ẗ",
  "ť": "ť",
  "ṫ": "ṫ",
  "ţ": "ţ",
  "ú": "ú",
  "ù": "ù",
  "ü": "ü",
  "ǘ": "ǘ",
  "ǜ": "ǜ",
  "ǖ": "ǖ",
  "ǚ": "ǚ",
  "ũ": "ũ",
  "ṹ": "ṹ",
  "ū": "ū",
  "ṻ": "ṻ",
  "ŭ": "ŭ",
  "ǔ": "ǔ",
  "û": "û",
  "ů": "ů",
  "ű": "ű",
  "ṽ": "ṽ",
  "ẃ": "ẃ",
  "ẁ": "ẁ",
  "ẅ": "ẅ",
  "ŵ": "ŵ",
  "ẇ": "ẇ",
  "ẘ": "ẘ",
  "ẍ": "ẍ",
  "ẋ": "ẋ",
  "ý": "ý",
  "ỳ": "ỳ",
  "ÿ": "ÿ",
  "ỹ": "ỹ",
  "ȳ": "ȳ",
  "ŷ": "ŷ",
  "ẏ": "ẏ",
  "ẙ": "ẙ",
  "ź": "ź",
  "ž": "ž",
  "ẑ": "ẑ",
  "ż": "ż",
  "Á": "Á",
  "À": "À",
  "Ä": "Ä",
  "Ǟ": "Ǟ",
  "Ã": "Ã",
  "Ā": "Ā",
  "Ă": "Ă",
  "Ắ": "Ắ",
  "Ằ": "Ằ",
  "Ẵ": "Ẵ",
  "Ǎ": "Ǎ",
  "Â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ά",
  "ὰ": "ὰ",
  "ᾱ": "ᾱ",
  "ᾰ": "ᾰ",
  "έ": "έ",
  "ὲ": "ὲ",
  "ή": "ή",
  "ὴ": "ὴ",
  "ί": "ί",
  "ὶ": "ὶ",
  "ϊ": "ϊ",
  "ΐ": "ΐ",
  "ῒ": "ῒ",
  "ῑ": "ῑ",
  "ῐ": "ῐ",
  "ό": "ό",
  "ὸ": "ὸ",
  "ύ": "ύ",
  "ὺ": "ὺ",
  "ϋ": "ϋ",
  "ΰ": "ΰ",
  "ῢ": "ῢ",
  "ῡ": "ῡ",
  "ῠ": "ῠ",
  "ώ": "ώ",
  "ὼ": "ὼ",
  "Ύ": "Ύ",
  "Ὺ": "Ὺ",
  "Ϋ": "Ϋ",
  "Ῡ": "Ῡ",
  "Ῠ": "Ῠ",
  "Ώ": "Ώ",
  "Ὼ": "Ὼ"
};
/**
 * This file contains the parser used to parse out a TeX expression from the
 * input. Since TeX isn't context-free, standard parsers don't work particularly
 * well.
 *
 * The strategy of this parser is as such:
 *
 * The main functions (the `.parse...` ones) take a position in the current
 * parse string to parse tokens from. The lexer (found in Lexer.js, stored at
 * this.gullet.lexer) also supports pulling out tokens at arbitrary places. When
 * individual tokens are needed at a position, the lexer is called to pull out a
 * token, which is then used.
 *
 * The parser has a property called "mode" indicating the mode that
 * the parser is currently in. Currently it has to be one of "math" or
 * "text", which denotes whether the current environment is a math-y
 * one or a text-y one (e.g. inside \text). Currently, this serves to
 * limit the functions which can be used in text mode.
 *
 * The main functions then return an object which contains the useful data that
 * was parsed at its given point, and a new position at the end of the parsed
 * data. The main functions can call each other and continue the parsing by
 * using the returned position as a new starting point.
 *
 * There are also extra `.handle...` functions, which pull out some reused
 * functionality into self-contained functions.
 *
 * The functions return ParseNodes.
 */

class Parser {
  constructor(input, settings) {
    this.mode = void 0;
    this.gullet = void 0;
    this.settings = void 0;
    this.leftrightDepth = void 0;
    this.nextToken = void 0;
    // Start in math mode
    this.mode = "math";
    // Create a new macro expander (gullet) and (indirectly via that) also a
    // new lexer (mouth) for this parser (stomach, in the language of TeX)
    this.gullet = new MacroExpander(input, settings, this.mode);
    // Store the settings for use in parsing
    this.settings = settings;
    // Count leftright depth (for \middle errors)
    this.leftrightDepth = 0;
    this.nextToken = null;
  }

  /**
   * Checks a result to make sure it has the right type, and throws an
   * appropriate error otherwise.
   */
  expect(text, consume) {
    if (consume === void 0) {
      consume = true;
    }
    if (this.fetch().text !== text) {
      throw new src_ParseError("Expected '" + text + "', got '" + this.fetch().text + "'", this.fetch());
    }
    if (consume) {
      this.consume();
    }
  }

  /**
   * Discards the current lookahead token, considering it consumed.
   */
  consume() {
    this.nextToken = null;
  }

  /**
   * Return the current lookahead token, or if there isn't one (at the
   * beginning, or if the previous lookahead token was consume()d),
   * fetch the next token as the new lookahead token and return it.
   */
  fetch() {
    if (this.nextToken == null) {
      this.nextToken = this.gullet.expandNextToken();
    }
    return this.nextToken;
  }

  /**
   * Switches between "text" and "math" modes.
   */
  switchMode(newMode) {
    this.mode = newMode;
    this.gullet.switchMode(newMode);
  }

  /**
   * Main parsing function, which parses an entire input.
   */
  parse() {
    if (!this.settings.globalGroup) {
      // Create a group namespace for the math expression.
      // (LaTeX creates a new group for every $...$, $$...$$, \[...\].)
      this.gullet.beginGroup();
    }

    // Use old \color behavior (same as LaTeX's \textcolor) if requested.
    // We do this within the group for the math expression, so it doesn't
    // pollute settings.macros.
    if (this.settings.colorIsTextColor) {
      this.gullet.macros.set("\\color", "\\textcolor");
    }
    try {
      // Try to parse the input
      const parse = this.parseExpression(false);

      // If we succeeded, make sure there's an EOF at the end
      this.expect("EOF");

      // End the group namespace for the expression
      if (!this.settings.globalGroup) {
        this.gullet.endGroup();
      }
      return parse;

      // Close any leftover groups in case of a parse error.
    } finally {
      this.gullet.endGroups();
    }
  }

  /**
   * Fully parse a separate sequence of tokens as a separate job.
   * Tokens should be specified in reverse order, as in a MacroDefinition.
   */
  subparse(tokens) {
    // Save the next token from the current job.
    const oldToken = this.nextToken;
    this.consume();

    // Run the new job, terminating it with an excess '}'
    this.gullet.pushToken(new Token("}"));
    this.gullet.pushTokens(tokens);
    const parse = this.parseExpression(false);
    this.expect("}");

    // Restore the next token from the current job.
    this.nextToken = oldToken;
    return parse;
  }
  /**
   * Parses an "expression", which is a list of atoms.
   *
   * `breakOnInfix`: Should the parsing stop when we hit infix nodes? This
   *                 happens when functions have higher precedence than infix
   *                 nodes in implicit parses.
   *
   * `breakOnTokenText`: The text of the token that the expression should end
   *                     with, or `null` if something else should end the
   *                     expression.
   */
  parseExpression(breakOnInfix, breakOnTokenText) {
    const body = [];
    // Keep adding atoms to the body until we can't parse any more atoms (either
    // we reached the end, a }, or a \right)
    while (true) {
      // Ignore spaces in math mode
      if (this.mode === "math") {
        this.consumeSpaces();
      }
      const lex = this.fetch();
      if (Parser.endOfExpression.has(lex.text)) {
        break;
      }
      if (breakOnTokenText && lex.text === breakOnTokenText) {
        break;
      }
      if (breakOnInfix && src_functions[lex.text] && src_functions[lex.text].infix) {
        break;
      }
      const atom = this.parseAtom(breakOnTokenText);
      if (!atom) {
        break;
      } else if (atom.type === "internal") {
        // Internal nodes do not appear in parse tree
        continue;
      }
      body.push(atom);
    }
    if (this.mode === "text") {
      this.formLigatures(body);
    }
    return this.handleInfixNodes(body);
  }

  /**
   * Rewrites infix operators such as \over with corresponding commands such
   * as \frac.
   *
   * There can only be one infix operator per group.  If there's more than one
   * then the expression is ambiguous.  This can be resolved by adding {}.
   */
  handleInfixNodes(body) {
    let overIndex = -1;
    let funcName;
    for (let i = 0; i < body.length; i++) {
      const node = body[i];
      if (node.type === "infix") {
        if (overIndex !== -1) {
          throw new src_ParseError("only one infix operator per group", node.token);
        }
        overIndex = i;
        funcName = node.replaceWith;
      }
    }
    if (overIndex !== -1 && funcName) {
      let numerNode;
      let denomNode;
      const numerBody = body.slice(0, overIndex);
      const denomBody = body.slice(overIndex + 1);
      if (numerBody.length === 1 && numerBody[0].type === "ordgroup") {
        numerNode = numerBody[0];
      } else {
        numerNode = {
          type: "ordgroup",
          mode: this.mode,
          body: numerBody
        };
      }
      if (denomBody.length === 1 && denomBody[0].type === "ordgroup") {
        denomNode = denomBody[0];
      } else {
        denomNode = {
          type: "ordgroup",
          mode: this.mode,
          body: denomBody
        };
      }
      let node;
      if (funcName === "\\\\abovefrac") {
        node = this.callFunction(funcName, [numerNode, body[overIndex], denomNode], []);
      } else {
        node = this.callFunction(funcName, [numerNode, denomNode], []);
      }
      return [node];
    } else {
      return body;
    }
  }

  /**
   * Handle a subscript or superscript with nice errors.
   */
  handleSupSubscript(name // For error reporting.
  ) {
    const symbolToken = this.fetch();
    const symbol = symbolToken.text;
    this.consume();
    this.consumeSpaces(); // ignore spaces before sup/subscript argument

    // Skip over allowed internal nodes such as \relax
    let group;
    do {
      var _group;
      group = this.parseGroup(name);
    } while (((_group = group) == null ? void 0 : _group.type) === "internal");
    if (!group) {
      throw new src_ParseError("Expected group after '" + symbol + "'", symbolToken);
    }
    return group;
  }

  /**
   * Converts the textual input of an unsupported command into a text node
   * contained within a color node whose color is determined by errorColor
   */
  formatUnsupportedCmd(text) {
    const textordArray = [];
    for (let i = 0; i < text.length; i++) {
      textordArray.push({
        type: "textord",
        mode: "text",
        text: text[i]
      });
    }
    const textNode = {
      type: "text",
      mode: this.mode,
      body: textordArray
    };
    const colorNode = {
      type: "color",
      mode: this.mode,
      color: this.settings.errorColor,
      body: [textNode]
    };
    return colorNode;
  }

  /**
   * Parses a group with optional super/subscripts.
   */
  parseAtom(breakOnTokenText) {
    // The body of an atom is an implicit group, so that things like
    // \left(x\right)^2 work correctly.
    const base = this.parseGroup("atom", breakOnTokenText);

    // Internal nodes (e.g. \relax) cannot support super/subscripts.
    // Instead we will pick up super/subscripts with blank base next round.
    if ((base == null ? void 0 : base.type) === "internal") {
      return base;
    }

    // In text mode, we don't have superscripts or subscripts
    if (this.mode === "text") {
      return base;
    }

    // Note that base may be empty (i.e. null) at this point.

    let superscript;
    let subscript;
    while (true) {
      // Guaranteed in math mode, so eat any spaces first.
      this.consumeSpaces();

      // Lex the first token
      const lex = this.fetch();
      if (lex.text === "\\limits" || lex.text === "\\nolimits") {
        // We got a limit control
        if (base && base.type === "op") {
          const limits = lex.text === "\\limits";
          base.limits = limits;
          base.alwaysHandleSupSub = true;
        } else if (base && base.type === "operatorname") {
          if (base.alwaysHandleSupSub) {
            base.limits = lex.teLpxt === "\\limits";
          }
        } else {
          throw new src_ParseError("Limit controls must follow a math operator", lex);
        }
        this.consume();
      } else if (lex.text === "^") {
        // We got a superscript start
        if (superscript) {
          throw new src_ParseError("Double superscript", lex);
        }
        superscript = this.handleSupSubscript("superscript");
      } else if (lex.text === "_") {
        // We got a subscript start
        if (subscript) {
          throw new src_ParseError("Double subscript", lex);
        }
        subscript = this.handleSupSubscript("subscript");
      } else if (lex.text === "'") {
        // We got a prime
        if (superscript) {
          throw new src_ParseError("Double superscript", lex);
        }
        const prime = {
          type: "textord",
          mode: this.mode,
          text: "\\prime"
        };

        // Many primes can be grouped together, so we handle this here
        const primes = [prime];
        this.consume();
        // Keep lexing tokens until we get something that's not a prime
        while (this.fetch().text === "'") {
          // For each one, add another prime to the list
          primes.push(prime);
          this.consume();
        }
        // If there's a superscript following the primes, combine that
        // superscript in with the primes.
        if (this.fetch().text === "^") {
          primes.push(this.handleSupSubscript("superscript"));
        }
        // Put everything into an ordgroup as the superscript
        superscript = {
          type: "ordgroup",
          mode: this.mode,
          body: primes
        };
      } else if (uSubsAndSups[lex.text]) {
        // A Unicode subscript or superscript character.
        // We treat these similarly to the unicode-math package.
        // So we render a string of Unicode (sub|super)scripts the
        // same as a (sub|super)script of regular characters.
        const isSub = unicodeSubRegEx.test(lex.text);
        const subsupTokens = [];
        subsupTokens.push(new Token(uSubsAndSups[lex.text]));
        this.consume();
        // Continue fetching tokens to fill out the string.
        while (true) {
          const token = this.fetch().text;
          if (!uSubsAndSups[token]) {
            break;
          }
          if (unicodeSubRegEx.test(token) !== isSub) {
            break;
          }
          subsupTokens.unshift(new Token(uSubsAndSups[token]));
          this.consume();
        }
        // Now create a (sub|super)script.
        const body = this.subparse(subsupTokens);
        if (isSub) {
          subscript = {
            type: "ordgroup",
            mode: "math",
            body
          };
        } else {
          superscript = {
            type: "ordgroup",
            mode: "math",
            body
          };
        }
      } else {
        // If it wasn't ^, _, or ', stop parsing super/subscripts
        break;
      }
    }

    // Base must be set if superscript or subscript are set per logic above,
    // but need to check here for type check to pass.
    if (superscript || subscript) {
      // If we got either a superscript or subscript, create a supsub
      return {
        type: "supsub",
        mode: this.mode,
        base: base,
        sup: superscript,
        sub: subscript
      };
    } else {
      // Otherwise return the original body
      return base;
    }
  }

  /**
   * Parses an entire function, including its base and all of its arguments.
   */
  parseFunction(breakOnTokenText, name // For determining its context
  ) {
    const token = this.fetch();
    const func = token.text;
    const funcData = src_functions[func];
    if (!funcData) {
      return null;
    }
    this.consume(); // consume command token

    if (name && name !== "atom" && !funcData.allowedInArgument) {
      throw new src_ParseError("Got function '" + func + "' with no arguments" + (name ? " as " + name : ""), token);
    } else if (this.mode === "text" && !funcData.allowedInText) {
      throw new src_ParseError("Can't use function '" + func + "' in text mode", token);
    } else if (this.mode === "math" && funcData.allowedInMath === false) {
      throw new src_ParseError("Can't use function '" + func + "' in math mode", token);
    }
    const {
      args,
      optArgs
    } = this.parseArguments(func, funcData);
    return this.callFunction(func, args, optArgs, token, breakOnTokenText);
  }

  /**
   * Call a function handler with a suitable context and arguments.
   */
  callFunction(name, args, optArgs, token, breakOnTokenText) {
    const context = {
      funcName: name,
      parser: this,
      token,
      breakOnTokenText
    };
    const func = src_functions[name];
    if (func && func.handler) {
      return func.handler(context, args, optArgs);
    } else {
      throw new src_ParseError("No function handler for " + name);
    }
  }

  /**
   * Parses the arguments of a function or environment
   */
  parseArguments(func,
  // Should look like "\name" or "\begin{name}".
  funcData) {
    const totalArgs = funcData.numArgs + funcData.numOptionalArgs;
    if (totalArgs === 0) {
      return {
        args: [],
        optArgs: []
      };
    }
    const args = [];
    const optArgs = [];
    for (let i = 0; i < totalArgs; i++) {
      let argType = funcData.argTypes && funcData.argTypes[i];
      const isOptional = i < funcData.numOptionalArgs;
      if ("primitive" in funcData && funcData.primitive && argType == null ||
      // \sqrt expands into primitive if optional argument doesn't exist
      funcData.type === "sqrt" && i === 1 && optArgs[0] == null) {
        argType = "primitive";
      }
      const arg = this.parseGroupOfType("argument to '" + func + "'", argType, isOptional);
      if (isOptional) {
        optArgs.push(arg);
      } else if (arg != null) {
        args.push(arg);
      } else {
        // should be unreachable
        throw new src_ParseError("Null argument, please report this as a bug");
      }
    }
    return {
      args,
      optArgs
    };
  }

  /**
   * Parses a group when the mode is changing.
   */
  parseGroupOfType(name, type, optional) {
    switch (type) {
      case "color":
        return this.parseColorGroup(optional);
      case "size":
        return this.parseSizeGroup(optional);
      case "url":
        return this.parseUrlGroup(optional);
      case "math":
      case "text":
        return this.parseArgumentGroup(optional, type);
      case "hbox":
        {
          // hbox argument type wraps the argument in the equivalent of
          // \hbox, which is like \text but switching to \textstyle size
          // and resetting math font.
          const group = this.parseArgumentGroup(optional, "text");
          return group != null ? {
            type: "styling",
            mode: group.mode,
            body: [group],
            style: "text",
            // simulate \textstyle
            resetFont: true
          } : null;
        }
      case "raw":
        {
          const token = this.parseStringGroup("raw", optional);
          return token != null ? {
            type: "raw",
            mode: "text",
            string: token.text
          } : null;
        }
      case "primitive":
        {
          if (optional) {
            throw new src_ParseError("A primitive argument cannot be optional");
          }
          const group = this.parseGroup(name);
          if (group == null) {
            throw new src_ParseError("Expected group as " + name, this.fetch());
          }
          return group;
        }
      case "original":
      case null:
      case undefined:
        return this.parseArgumentGroup(optional);
      default:
        throw new src_ParseError("Unknown group type as " + name, this.fetch());
    }
  }

  /**
   * Discard any space tokens, fetching the next non-space token.
   */
  consumeSpaces() {
    while (this.fetch().text === " ") {
      this.consume();
    }
  }

  /**
   * Parses a group, essentially returning the string formed by the
   * brace-enclosed tokens plus some position information.
   */
  parseStringGroup(modeName,
  // Used to describe the mode in error messages.
  optional) {
    const argToken = this.gullet.scanArgument(optional);
    if (argToken == null) {
      return null;
    }
    let str = "";
    let nextToken;
    while ((nextToken = this.fetch()).text !== "EOF") {
      str += nextToken.text;
      this.consume();
    }
    this.consume(); // consume the end of the argument
    argToken.text = str;
    return argToken;
  }

  /**
   * Parses a regex-delimited group: the largest sequence of tokens
   * whose concatenated strings match `regex`. Returns the string
   * formed by the tokens plus some position information.
   */
  parseRegexGroup(regex, modeName // Used to describe the mode in error messages.
  ) {
    const firstToken = this.fetch();
    let lastToken = firstToken;
    let str = "";
    let nextToken;
    while ((nextToken = this.fetch()).text !== "EOF" && regex.test(str + nextToken.text)) {
      lastToken = nextToken;
      str += lastToken.text;
      this.consume();
    }
    if (str === "") {
      throw new src_ParseError("Invalid " + modeName + ": '" + firstToken.text + "'", firstToken);
    }
    return firstToken.range(lastToken, str);
  }

  /**
   * Parses a color description.
   */
  parseColorGroup(optional) {
    const res = this.parseStringGroup("color", optional);
    if (res == null) {
      return null;
    }
    const match = /^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(res.text);
    if (!match) {
      throw new src_ParseError("Invalid color: '" + res.text + "'", res);
    }
    let color = match[0];
    if (/^[0-9a-f]{6}$/i.test(color)) {
      // We allow a 6-digit HTML color spec without a leading "#".
      // This follows the xcolor package's HTML color model.
      // Predefined color names are all missed by this RegEx pattern.
      color = "#" + color;
    }
    return {
      type: "color-token",
      mode: this.mode,
      color
    };
  }

  /**
   * Parses a size specification, consisting of magnitude and unit.
   */
  parseSizeGroup(optional) {
    let res;
    let isBlank = false;
    // don't expand before parseStringGroup
    this.gullet.consumeSpaces();
    if (!optional && this.gullet.future().text !== "{") {
      res = this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/, "size");
    } else {
      res = this.parseStringGroup("size", optional);
    }
    if (!res) {
      return null;
    }
    if (!optional && res.text.length === 0) {
      // Because we've tested for what is !optional, this block won't
      // affect \kern, \hspace, etc. It will capture the mandatory arguments
      // to \genfrac and \above.
      res.text = "0pt"; // Enable \above{}
      isBlank = true; // This is here specifically for \genfrac
    }
    const match = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(res.text);
    if (!match) {
      throw new src_ParseError("Invalid size: '" + res.text + "'", res);
    }
    const data = {
      number: +(match[1] + match[2]),
      // sign + magnitude, cast to number
      unit: match[3]
    };
    if (!validUnit(data)) {
      throw new src_ParseError("Invalid unit: '" + data.unit + "'", res);
    }
    return {
      type: "size",
      mode: this.mode,
      value: data,
      isBlank
    };
  }

  /**
   * Parses an URL, checking escaped letters and allowed protocols,
   * and setting the catcode of % as an active character (as in \hyperref).
   */
  parseUrlGroup(optional) {
    this.gullet.lexer.setCatcode("%", 13); // active character
    this.gullet.lexer.setCatcode("~", 12); // other character
    const res = this.parseStringGroup("url", optional);
    this.gullet.lexer.setCatcode("%", 14); // comment character
    this.gullet.lexer.setCatcode("~", 13); // active character
    if (res == null) {
      return null;
    }
    // hyperref package allows backslashes alone in href, but doesn't
    // generate valid links in such cases; we interpret this as
    // "undefined" behaviour, and keep them as-is. Some browser will
    // replace backslashes with forward slashes.
    const url = res.text.replace(/\\([#$%&~_^{}])/g, '$1');
    return {
      type: "url",
      mode: this.mode,
      url
    };
  }

  /**
   * Parses an argument with the mode specified.
   */
  parseArgumentGroup(optional, mode) {
    const argToken = this.gullet.scanArgument(optional);
    if (argToken == null) {
      return null;
    }
    const outerMode = this.mode;
    if (mode) {
      // Switch to specified mode
      this.switchMode(mode);
    }
    this.gullet.beginGroup();
    const expression = this.parseExpression(false, "EOF");
    // TODO: find an alternative way to denote the end
    this.expect("EOF"); // expect the end of the argument
    this.gullet.endGroup();
    const result = {
      type: "ordgroup",
      mode: this.mode,
      loc: argToken.loc,
      body: expression
    };
    if (mode) {
      // Switch mode back
      this.switchMode(outerMode);
    }
    return result;
  }

  /**
   * Parses an ordinary group, which is either a single nucleus (like "x")
   * or an expression in braces (like "{x+y}") or an implicit group, a group
   * that starts at the current position, and ends right before a higher explicit
   * group ends, or at EOF.
   */
  parseGroup(name,
  // For error reporting.
  breakOnTokenText) {
    const firstToken = this.fetch();
    const text = firstToken.text;
    let result;
    // Try to parse an open brace or \begingroup
    if (text === "{" || text === "\\begingroup") {
      this.consume();
      const groupEnd = text === "{" ? "}" : "\\endgroup";
      this.gullet.beginGroup();
      // If we get a brace, parse an expression
      const expression = this.parseExpression(false, groupEnd);
      const lastToken = this.fetch();
      this.expect(groupEnd); // Check that we got a matching closing brace
      this.gullet.endGroup();
      result = {
        type: "ordgroup",
        mode: this.mode,
        loc: SourceLocation.range(firstToken, lastToken),
        body: expression,
        // A group formed by \begingroup...\endgroup is a semi-simple group
        // which doesn't affect spacing in math mode, i.e., is transparent.
        // https://tex.stackexchange.com/questions/1930/when-should-one-
        // use-begingroup-instead-of-bgroup
        semisimple: text === "\\begingroup" || undefined
      };
    } else {
      // If there exists a function with this name, parse the function.
      // Otherwise, just return a nucleus
      result = this.parseFunction(breakOnTokenText, name) || this.parseSymbol();
      if (result == null && text[0] === "\\" && !implicitCommands.hasOwnProperty(text)) {
        if (this.settings.throwOnError) {
          throw new src_ParseError("Undefined control sequence: " + text, firstToken);
        }
        result = this.formatUnsupportedCmd(text);
        this.consume();
      }
    }
    return result;
  }

  /**
   * Form ligature-like combinations of characters for text mode.
   * This includes inputs like "--", "---", "``" and "''".
   * The result will simply replace multiple textord nodes with a single
   * character in each value by a single textord node having multiple
   * characters in its value.  The representation is still ASCII source.
   * The group will be modified in place.
   */
  formLigatures(group) {
    let n = group.length - 1;
    for (let i = 0; i < n; ++i) {
      const a = group[i];
      if (a.type !== "textord") {
        continue;
      }
      const v = a.text;
      const next = group[i + 1];
      if (!next || next.type !== "textord") {
        continue;
      }
      if (v === "-" && next.text === "-") {
        const afterNext = group[i + 2];
        if (i + 1 < n && afterNext && afterNext.type === "textord" && afterNext.text === "-") {
          group.splice(i, 3, {
            type: "textord",
            mode: "text",
            loc: SourceLocation.range(a, afterNext),
            text: "---"
          });
          n -= 2;
        } else {
          group.splice(i, 2, {
            type: "textord",
            mode: "text",
            loc: SourceLocation.range(a, next),
            text: "--"
          });
          n -= 1;
        }
      }
      if ((v === "'" || v === "`") && next.text === v) {
        group.splice(i, 2, {
          type: "textord",
          mode: "text",
          loc: SourceLocation.range(a, next),
          text: v + v
        });
        n -= 1;
      }
    }
  }

  /**
   * Parse a single symbol out of the string. Here, we handle single character
   * symbols and special functions like \verb.
   */
  parseSymbol() {
    const nucleus = this.fetch();
    let text = nucleus.text;
    if (/^\\verb[^a-zA-Z]/.test(text)) {
      this.consume();
      let arg = text.slice(5);
      const star = arg.charAt(0) === "*";
      if (star) {
        arg = arg.slice(1);
      }
      // Lexer's tokenRegex is constructed to always have matching
      // first/last characters.
      if (arg.length < 2 || arg.charAt(0) !== arg.slice(-1)) {
        throw new src_ParseError("\\verb assertion failed --\n                    please report what input caused this bug");
      }
      arg = arg.slice(1, -1); // remove first and last char

      return {
        type: "verb",
        mode: "text",
        body: arg,
        star
      };
    }
    // At this point, we should have a symbol, possibly with accents.
    // First expand any accented base symbol according to unicodeSymbols.
    if (unicodeSymbols.hasOwnProperty(text[0]) && !src_symbols[this.mode][text[0]]) {
      // This behavior is not strict (XeTeX-compatible) in math mode.
      if (this.settings.strict && this.mode === "math") {
        this.settings.reportNonstrict("unicodeTextInMathMode", "Accented Unicode text character \"" + text[0] + "\" used in " + "math mode", nucleus);
      }
      text = unicodeSymbols[text[0]] + text.slice(1);
    }
    // Strip off any combining characters
    const match = combiningDiacriticalMarksEndRegex.exec(text);
    if (match) {
      text = text.substring(0, match.index);
      if (text === 'i') {
        text = '\u0131'; // dotless i, in math and text mode
      } else if (text === 'j') {
        text = '\u0237'; // dotless j, in math and text mode
      }
    }
    // Recognize base symbol
    let symbol;
    if (src_symbols[this.mode][text]) {
      if (this.settings.strict && this.mode === 'math' && extraLatin.includes(text)) {
        this.settings.reportNonstrict("unicodeTextInMathMode", "Latin-1/Unicode text character \"" + text[0] + "\" used in " + "math mode", nucleus);
      }
      const group = src_symbols[this.mode][text].group;
      const loc = SourceLocation.range(nucleus);
      let s;
      if (isAtom(group)) {
        s = {
          type: "atom",
          mode: this.mode,
          family: group,
          loc,
          text
        };
      } else {
        s = {
          type: group,
          mode: this.mode,
          loc,
          text
        };
      }
      symbol = s;
    } else if (text.charCodeAt(0) >= 0x80) {
      // no symbol for e.g. ^
      if (this.settings.strict) {
        if (!supportedCodepoint(text.charCodeAt(0))) {
          this.settings.reportNonstrict("unknownSymbol", "Unrecognized Unicode character \"" + text[0] + "\"" + (" (" + text.charCodeAt(0) + ")"), nucleus);
        } else if (this.mode === "math") {
          this.settings.reportNonstrict("unicodeTextInMathMode", "Unicode text character \"" + text[0] + "\" used in math mode", nucleus);
        }
      }
      // All nonmathematical Unicode characters are rendered as if they
      // are in text mode (wrapped in \text) because that's what it
      // takes to render them in LaTeX.  Setting `mode: this.mode` is
      // another natural choice (the user requested math mode), but
      // this makes it more difficult for getCharacterMetrics() to
      // distinguish Unicode characters without metrics and those for
      // which we want to simulate the letter M.
      symbol = {
        type: "textord",
        mode: "text",
        loc: SourceLocation.range(nucleus),
        text
      };
    } else {
      return null; // EOF, ^, _, {, }, etc.
    }
    this.consume();
    // Transform combining characters into accents
    if (match) {
      for (let i = 0; i < match[0].length; i++) {
        const accent = match[0][i];
        if (!unicodeAccents[accent]) {
          throw new src_ParseError("Unknown accent ' " + accent + "'", nucleus);
        }
        const command = unicodeAccents[accent][this.mode] || unicodeAccents[accent].text;
        if (!command) {
          throw new src_ParseError("Accent " + accent + " unsupported in " + this.mode + " mode", nucleus);
        }
        symbol = {
          type: "accent",
          mode: this.mode,
          loc: SourceLocation.range(nucleus),
          label: command,
          isStretchy: false,
          isShifty: true,
          base: symbol
        };
      }
    }
    return symbol;
  }
}
Parser.endOfExpression = new Set(["}", "\\endgroup", "\\end", "\\right", "&"]);
;// ./src/parseTree.ts
/**
 * Provides a single function for parsing an expression using a Parser
 * TODO(emily): Remove this
 */




/**
 * Parses an expression using a Parser, then returns the parsed result.
 */
const parseTree = function (toParse, settings) {
  if (!(typeof toParse === 'string' || toParse instanceof String)) {
    throw new TypeError('KaTeX can only parse string typed expression');
  }
  const parser = new Parser(toParse, settings);

  // Blank out any \df@tag to avoid spurious "Duplicate \tag" errors
  delete parser.gullet.macros.current["\\df@tag"];
  let tree = parser.parse();

  // Prevent a color definition from persisting between calls to katex.render().
  delete parser.gullet.macros.current["\\current@color"];
  delete parser.gullet.macros.current["\\color"];

  // If the input used \tag, it will set the \df@tag macro to the tag.
  // In this case, we separately parse the tag and wrap the tree.
  if (parser.gullet.macros.get("\\df@tag")) {
    if (!settings.displayMode) {
      throw new src_ParseError("\\tag works only in display equations");
    }
    tree = [{
      type: "tag",
      mode: "text",
      body: tree,
      tag: parser.subparse([new Token("\\df@tag")])
    }];
  }
  return tree;
};
/* harmony default export */ var src_parseTree = (parseTree);
;// ./katex.ts
/* eslint no-console:0 */
/**
 * This is the main entry point for KaTeX. Here, we expose functions for
 * rendering expressions either to DOM nodes or to markup strings.
 *
 * We also expose the ParseError class to check if errors thrown from KaTeX are
 * errors in the expression, or errors in javascript handling.
 */











/**
 * Parse and build an expression, and place that expression in the DOM node
 * given.
 */
let render = function (expression, baseNode, options) {
  baseNode.textContent = "";
  const node = renderToDomTree(expression, options).toNode();
  baseNode.appendChild(node);
};

// KaTeX's styles don't work properly in quirks mode. Print out an error, and
// disable rendering.
if (typeof document !== "undefined") {
  if (document.compatMode !== "CSS1Compat") {
    typeof console !== "undefined" && console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your " + "website has a suitable doctype.");
    render = function () {
      throw new src_ParseError("KaTeX doesn't work in quirks mode.");
    };
  }
}

/**
 * Parse and build an expression, and return the markup for that.
 */
const renderToString = function (expression, options) {
  const markup = renderToDomTree(expression, options).toMarkup();
  return markup;
};

/**
 * Parse an expression and return the parse tree.
 */
const generateParseTree = function (expression, options) {
  const settings = new Settings(options);
  return src_parseTree(expression, settings);
};

/**
 * If the given error is a KaTeX ParseError and options.throwOnError is false,
 * renders the invalid LaTeX as a span with hover title giving the KaTeX
 * error message.  Otherwise, simply throws the error.
 */
const renderError = function (error, expression, options) {
  if (options.throwOnError || !(error instanceof src_ParseError)) {
    throw error;
  }
  const node = makeSpan(["katex-error"], [new SymbolNode(expression)]);
  node.setAttribute("title", error.toString());
  node.setAttribute("style", "color:" + options.errorColor);
  return node;
};

/**
 * Generates and returns the katex build tree. This is used for advanced
 * use cases (like rendering to custom output).
 */
const renderToDomTree = function (expression, options) {
  const settings = new Settings(options);
  try {
    const tree = src_parseTree(expression, settings);
    return buildTree(tree, expression, settings);
  } catch (error) {
    return renderError(error, expression, settings);
  }
};

/**
 * Generates and returns the katex build tree, with just HTML (no MathML).
 * This is used for advanced use cases (like rendering to custom output).
 */
const renderToHTMLTree = function (expression, options) {
  const settings = new Settings(options);
  try {
    const tree = src_parseTree(expression, settings);
    return buildHTMLTree(tree, expression, settings);
  } catch (error) {
    return renderError(error, expression, settings);
  }
};
const version = "0.16.47";
const __domTree = {
  Span: Span,
  Anchor: Anchor,
  SymbolNode: SymbolNode,
  SvgNode: SvgNode,
  PathNode: PathNode,
  LineNode: LineNode
};

// ESM exports


// CJS exports and ESM default export
/* harmony default export */ var katex = ({
  /**
   * Current KaTeX version
   */
  version,
  /**
   * Renders the given LaTeX into an HTML+MathML combination, and adds
   * it as a child to the specified DOM node.
   */
  render,
  /**
   * Renders the given LaTeX into an HTML+MathML combination string,
   * for sending to the client.
   */
  renderToString,
  /**
   * KaTeX error, usually during parsing.
   */
  ParseError: src_ParseError,
  /**
   * The schema of Settings
   */
  SETTINGS_SCHEMA: SETTINGS_SCHEMA,
  /**
   * Parses the given LaTeX into KaTeX's internal parse tree structure,
   * without rendering to HTML or MathML.
   *
   * NOTE: This method is not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __parse: generateParseTree,
  /**
   * Renders the given LaTeX into an HTML+MathML internal DOM tree
   * representation, without flattening that representation to a string.
   *
   * NOTE: This method is not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __renderToDomTree: renderToDomTree,
  /**
   * Renders the given LaTeX into an HTML internal DOM tree representation,
   * without MathML and without flattening that representation to a string.
   *
   * NOTE: This method is not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __renderToHTMLTree: renderToHTMLTree,
  /**
   * extends internal font metrics object with a new object
   * each key in the new object represents a font name
  */
  __setFontMetrics: setFontMetrics,
  /**
   * adds a new symbol to builtin symbols table
   */
  __defineSymbol: defineSymbol,
  /**
   * adds a new function to builtin function list,
   * which directly produce parse tree elements
   * and have their own html/mathml builders
   */
  __defineFunction: defineFunction,
  /**
   * adds a new macro to builtin macro list
   */
  __defineMacro: defineMacro,
  /**
   * Expose the dom tree node types, which can be useful for type checking nodes.
   *
   * NOTE: These methods are not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __domTree
});
;// ./katex.webpack.js
/**
 * This is the webpack entry point for KaTeX. As ECMAScript, flow[1] and jest[2]
 * doesn't support CSS modules natively, a separate entry point is used and
 * it is not flowtyped.
 *
 * [1] https://gist.github.com/lambdahands/d19e0da96285b749f0ef
 * [2] https://facebook.github.io/jest/docs/en/webpack.html
 */


/* harmony default export */ var katex_webpack = (katex);
__webpack_exports__ = __webpack_exports__["default"];
/******/ 	return __webpack_exports__;
/******/ })()
;
});Qx   !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.katex=t():e.katex=t()}("undefined"!=typeof self?self:this,function(){return function(){"use strict";var e={d:function(t,r){for(var n in r)e.o(r,n)&&!e.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:r[n]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t={};e.d(t,{default:function(){return ko}});class r extends Error{constructor(e,t){let n,o,s="KaTeX parse error: "+e;const i=t&&t.loc;if(i&&i.start<=i.end){const e=i.lexer.input;n=i.start,o=i.end,n===e.length?s+=" at end of input: ":s+=" at position "+(n+1)+": ";const t=e.slice(n,o).replace(/[^]/g,"$&\u0332");let r,l;r=n>15?"\u2026"+e.slice(n-15,n):e.slice(0,n),l=o+15<e.length?e.slice(o,o+15)+"\u2026":e.slice(o),s+=r+t+l}super(s),this.name="ParseError",this.position=void 0,this.length=void 0,this.rawMessage=void 0,Object.setPrototypeOf(this,r.prototype),this.position=n,null!=n&&null!=o&&(this.length=o-n),this.rawMessage=e}}var n=r;const o=/([A-Z])/g,s=e=>e.replace(o,"-$1").toLowerCase(),i={"&":"&amp;",">":"&gt;","<":"&lt;",'"':"&quot;","'":"&#x27;"},l=/[&><"']/g,a=e=>String(e).replace(l,e=>i[e]),c=e=>"ordgroup"===e.type||"color"===e.type?1===e.body.length?c(e.body[0]):e:"font"===e.type?c(e.body):e,h=new Set(["mathord","textord","atom"]),m=e=>h.has(c(e).type),u={displayMode:{type:"boolean",description:"Render math in display mode, which puts the math in display style (so \\int and \\sum are large, for example), and centers the math on the page on its own line.",cli:"-d, --display-mode"},output:{type:{enum:["htmlAndMathml","html","mathml"]},description:"Determines the markup language of the output.",cli:"-F, --format <type>"},leqno:{type:"boolean",description:"Render display math in leqno style (left-justified tags)."},fleqn:{type:"boolean",description:"Render display math flush left."},throwOnError:{type:"boolean",default:!0,cli:"-t, --no-throw-on-error",cliDescription:"Render errors (in the color given by --error-color) instead of throwing a ParseError exception when encountering an error."},errorColor:{type:"string",default:"#cc0000",cli:"-c, --error-color <color>",cliDescription:"A color string given in the format 'rgb' or 'rrggbb' (no #). This option determines the color of errors rendered by the -t option.",cliProcessor:e=>"#"+e},macros:{type:"object",cli:"-m, --macro <def>",cliDescription:"Define custom macro of the form '\\foo:expansion' (use multiple -m arguments for multiple macros).",cliDefault:[],cliProcessor:(e,t)=>(t.push(e),t)},minRuleThickness:{type:"number",description:"Specifies a minimum thickness, in ems, for fraction lines, `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, `\\hdashline`, `\\underline`, `\\overline`, and the borders of `\\fbox`, `\\boxed`, and `\\fcolorbox`.",processor:e=>Math.max(0,e),cli:"--min-rule-thickness <size>",cliProcessor:parseFloat},colorIsTextColor:{type:"boolean",description:"Makes \\color behave like LaTeX's 2-argument \\textcolor, instead of LaTeX's one-argument \\color mode change.",cli:"-b, --color-is-text-color"},strict:{type:[{enum:["warn","ignore","error"]},"boolean","function"],description:"Turn on strict / LaTeX faithfulness mode, which throws an error if the input uses features that are not supported by LaTeX.",cli:"-S, --strict",cliDefault:!1},trust:{type:["boolean","function"],description:"Trust the input, enabling all HTML features such as \\url.",cli:"-T, --trust"},maxSize:{type:"number",default:1/0,description:"If non-zero, all user-specified sizes, e.g. in \\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, elements and spaces can be arbitrarily large",processor:e=>Math.max(0,e),cli:"-s, --max-size <n>",cliProcessor:parseInt},maxExpand:{type:"number",default:1e3,description:"Limit the number of macro expansions to the specified number, to prevent e.g. infinite macro loops. If set to Infinity, the macro expander will try to fully expand as in LaTeX.",processor:e=>Math.max(0,e),cli:"-e, --max-expand <n>",cliProcessor:e=>"Infinity"===e?1/0:parseInt(e)},globalGroup:{type:"boolean",cli:!1}};function p(e){if(void 0!==e.default)return e.default;return function(e){if("string"!=typeof e)return e.enum[0];switch(e){case"boolean":return!1;case"string":return"";case"number":return 0;case"object":return{};default:throw new Error("Unexpected schema type; settings must declare an explicit default.")}}(Array.isArray(e.type)?e.type[0]:e.type)}function d(e,t,r,n){const o=r[t];e[t]=void 0!==o?n.processor?n.processor(o):o:p(n)}class g{constructor(e){void 0===e&&(e={}),this.displayMode=void 0,this.output=void 0,this.leqno=void 0,this.fleqn=void 0,this.throwOnError=void 0,this.errorColor=void 0,this.macros=void 0,this.minRuleThickness=void 0,this.colorIsTextColor=void 0,this.strict=void 0,this.trust=void 0,this.maxSize=void 0,this.maxExpand=void 0,this.globalGroup=void 0,e=e||{};for(const t of Object.keys(u)){const r=u[t];r&&d(this,t,e,r)}}reportNonstrict(e,t,r){let o=this.strict;if("function"==typeof o&&(o=o(e,t,r)),o&&"ignore"!==o){if(!0===o||"error"===o)throw new n("LaTeX-incompatible input and strict mode is set to 'error': "+t+" ["+e+"]",r);"warn"===o?"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"):"undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+o+"': "+t+" ["+e+"]")}}useStrictBehavior(e,t,r){let n=this.strict;if("function"==typeof n)try{n=n(e,t,r)}catch(e){n="error"}return!(!n||"ignore"===n)&&(!0===n||"error"===n||("warn"===n?("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to 'warn': "+t+" ["+e+"]"),!1):("undefined"!=typeof console&&console.warn("LaTeX-incompatible input and strict mode is set to unrecognized '"+n+"': "+t+" ["+e+"]"),!1)))}isTrusted(e){if("url"in e&&e.url&&!e.protocol){const t=(e=>{const t=/^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(e);return t?":"!==t[2]?null:/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(t[1])?t[1].toLowerCase():null:"_relative"})(e.url);if(null==t)return!1;e.protocol=t}const t="function"==typeof this.trust?this.trust(e):this.trust;return Boolean(t)}}class f{constructor(e,t,r){this.id=void 0,this.size=void 0,this.cramped=void 0,this.id=e,this.size=t,this.cramped=r}sup(){return b[y[this.id]]}sub(){return b[x[this.id]]}fracNum(){return b[w[this.id]]}fracDen(){return b[v[this.id]]}cramp(){return b[k[this.id]]}text(){return b[z[this.id]]}isTight(){return this.size>=2}}const b=[new f(0,0,!1),new f(1,0,!0),new f(2,1,!1),new f(3,1,!0),new f(4,2,!1),new f(5,2,!0),new f(6,3,!1),new f(7,3,!0)],y=[4,5,4,5,6,7,6,7],x=[5,5,5,5,7,7,7,7],w=[2,3,4,5,6,7,6,7],v=[3,3,5,5,7,7,7,7],k=[1,1,3,3,5,5,7,7],z=[0,1,2,3,2,3,2,3];var S={DISPLAY:b[0],TEXT:b[2],SCRIPT:b[4],SCRIPTSCRIPT:b[6]};const M=[{name:"latin",blocks:[[256,591],[768,879]]},{name:"cyrillic",blocks:[[1024,1279]]},{name:"armenian",blocks:[[1328,1423]]},{name:"brahmic",blocks:[[2304,4255]]},{name:"georgian",blocks:[[4256,4351]]},{name:"cjk",blocks:[[12288,12543],[19968,40879],[65280,65376]]},{name:"hangul",blocks:[[44032,55215]]}];const A=[];function T(e){for(let t=0;t<A.length;t+=2)if(e>=A[t]&&e<=A[t+1])return!0;return!1}M.forEach(e=>e.blocks.forEach(e=>A.push(...e)));const B=e=>e+" "+e,C=80,q={doubleleftarrow:"M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",doublerightarrow:"M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",leftarrow:"M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",leftbrace:"M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",leftbraceunder:"M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",leftgroup:"M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",leftgroupunder:"M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",leftharpoon:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",leftharpoonplus:"M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",leftharpoondown:"M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",leftharpoondownplus:"M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",lefthook:"M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",leftlinesegment:B("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),leftbracketunder:B("M0 0 h120 V290 H399995 v120 H0z"),leftbracketover:B("M0 440 h120 V150 H399995 v-120 H0z"),leftmapsto:B("M40 281 V448H0V74H40V241H400000v40z"),leftToFrom:"M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",longequal:B("M0 50 h400000 v40H0z m0 194h40000v40H0z"),midbrace:"M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",midbraceunder:"M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",oiintSize1:"M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",oiintSize2:"M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",oiiintSize1:"M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",oiiintSize2:"M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",rightarrow:"M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",rightbrace:"M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",rightbraceunder:"M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",rightgroup:"M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",rightgroupunder:"M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",rightharpoon:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",rightharpoonplus:"M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",rightharpoondown:"M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",rightharpoondownplus:"M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",righthook:"M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",rightlinesegment:B("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),rightbracketunder:B("M399995 0 h-120 V290 H0 v120 H400000z"),rightbracketover:B("M399995 440 h-120 V150 H0 v-120 H399995z"),rightToFrom:"M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",twoheadleftarrow:"M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",twoheadrightarrow:"M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",tilde1:"M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",tilde2:"M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",tilde3:"M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",tilde4:"M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",vec:"M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",widehat1:"M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",widehat2:"M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat3:"M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widehat4:"M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",widecheck1:"M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",widecheck2:"M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck3:"M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",widecheck4:"M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",baraboveleftarrow:"M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",rightarrowabovebar:"M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",baraboveshortleftharpoon:"M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",rightharpoonaboveshortbar:"M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",shortbaraboveleftharpoon:"M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",shortrightharpoonabovebar:"M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"};class I{constructor(e){this.children=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.children=e,this.classes=[],this.height=0,this.depth=0,this.maxFontSize=0,this.style={}}hasClass(e){return this.classes.includes(e)}toNode(){const e=document.createDocumentFragment();for(let t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){let e="";for(let t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e}toText(){return this.children.map(e=>{if("toText"in e)return e.toText();throw new Error("Expected MathDomNode with toText, got "+e.constructor.name)}).join("")}}const R={pt:1,mm:7227/2540,cm:7227/254,in:72.27,bp:1.00375,pc:12,dd:1238/1157,cc:14856/1157,nd:685/642,nc:1370/107,sp:1/65536,px:1.00375},E={ex:!0,em:!0,mu:!0},H=function(e){return"string"!=typeof e&&(e=e.unit),e in R||e in E||"ex"===e},N=function(e,t){let r;if(e.unit in R)r=R[e.unit]/t.fontMetrics().ptPerEm/t.sizeMultiplier;else if("mu"===e.unit)r=t.fontMetrics().cssEmPerMu;else{let o;if(o=t.style.isTight()?t.havingStyle(t.style.text()):t,"ex"===e.unit)r=o.fontMetrics().xHeight;else{if("em"!==e.unit)throw new n("Invalid unit: '"+e.unit+"'");r=o.fontMetrics().quad}o!==t&&(r*=o.sizeMultiplier/t.sizeMultiplier)}return Math.min(e.number*r,t.maxSize)},O=function(e){return+e.toFixed(4)+"em"},D=function(e){return e.filter(e=>e).join(" ")},L=function(e){let t="";for(const r of Object.keys(e)){const n=e[r];void 0!==n&&(t+=s(r)+":"+n+";")}return t},P=function(e,t,r){if(this.classes=e||[],this.attributes={},this.height=0,this.depth=0,this.maxFontSize=0,this.style=r||{},t){t.style.isTight()&&this.classes.push("mtight");const e=t.getColor();e&&(this.style.color=e)}},F=function(e){const t=document.createElement(e);t.className=D(this.classes),Object.assign(t.style,this.style);for(const e of Object.keys(this.attributes))t.setAttribute(e,this.attributes[e]);for(let e=0;e<this.children.length;e++)t.appendChild(this.children[e].toNode());return t},V=/[\s"'>/=\x00-\x1f]/,G=function(e){let t="<"+e;this.classes.length&&(t+=' class="'+a(D(this.classes))+'"');const r=L(this.style);r&&(t+=' style="'+a(r)+'"');for(const e of Object.keys(this.attributes)){if(V.test(e))throw new n("Invalid attribute name '"+e+"'");t+=" "+e+'="'+a(this.attributes[e])+'"'}t+=">";for(let e=0;e<this.children.length;e++)t+=this.children[e].toMarkup();return t+="</"+e+">",t};class U{constructor(e,t,r,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.width=void 0,this.maxFontSize=void 0,this.style=void 0,this.italic=void 0,P.call(this,e,r,n),this.children=t||[]}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return F.call(this,"span")}toMarkup(){return G.call(this,"span")}}class X{constructor(e,t,r,n){this.children=void 0,this.attributes=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,P.call(this,t,n),this.children=r||[],this.setAttribute("href",e)}setAttribute(e,t){this.attributes[e]=t}hasClass(e){return this.classes.includes(e)}toNode(){return F.call(this,"a")}toMarkup(){return G.call(this,"a")}}class Y{constructor(e,t,r){this.src=void 0,this.alt=void 0,this.classes=void 0,this.height=void 0,this.depth=void 0,this.maxFontSize=void 0,this.style=void 0,this.alt=t,this.src=e,this.classes=["mord"],this.height=0,this.depth=0,this.maxFontSize=0,this.style=r}hasClass(e){return this.classes.includes(e)}toNode(){const e=document.createElement("img");return e.src=this.src,e.alt=this.alt,e.className="mord",Object.assign(e.style,this.style),e}toMarkup(){let e='<img src="'+a(this.src)+'" alt="'+a(this.alt)+'"';const t=L(this.style);return t&&(e+=' style="'+a(t)+'"'),e+="'/>",e}}const j={"\xee":"\u0131\u0302","\xef":"\u0131\u0308","\xed":"\u0131\u0301","\xec":"\u0131\u0300"};class W{constructor(e,t,r,n,o,s,i,l){this.text=void 0,this.height=void 0,this.depth=void 0,this.italic=void 0,this.skew=void 0,this.width=void 0,this.maxFontSize=void 0,this.classes=void 0,this.style=void 0,this.text=e,this.height=t||0,this.depth=r||0,this.italic=n||0,this.skew=o||0,this.width=s||0,this.classes=i||[],this.style=l||{},this.maxFontSize=0;const a=function(e){for(let t=0;t<M.length;t++){const r=M[t];for(let t=0;t<r.blocks.length;t++){const n=r.blocks[t];if(e>=n[0]&&e<=n[1])return r.name}}return null}(this.text.charCodeAt(0));a&&this.classes.push(a+"_fallback"),/[\xee\xef\xed\xec]/.test(this.text)&&(this.text=j[this.text])}hasClass(e){return this.classes.includes(e)}toNode(){const e=document.createTextNode(this.text);let t=null;return this.italic>0&&(t=document.createElement("span"),t.style.marginRight=O(this.italic)),this.classes.length>0&&(t=t||document.createElement("span"),t.className=D(this.classes)),Object.keys(this.style).length>0&&(t=t||document.createElement("span"),Object.assign(t.style,this.style)),t?(t.appendChild(e),t):e}toMarkup(){let e=!1,t="<span";this.classes.length&&(e=!0,t+=' class="',t+=a(D(this.classes)),t+='"');let r="";this.italic>0&&(r+="margin-right:"+O(this.italic)+";"),r+=L(this.style),r&&(e=!0,t+=' style="'+a(r)+'"');const n=a(this.text);return e?(t+=">",t+=n,t+="</span>",t):n}}class _{constructor(e,t){this.children=void 0,this.attributes=void 0,this.children=e||[],this.attributes=t||{}}toNode(){const e=document.createElementNS("http://www.w3.org/2000/svg","svg");for(const t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);for(let t=0;t<this.children.length;t++)e.appendChild(this.children[t].toNode());return e}toMarkup(){let e='<svg xmlns="http://www.w3.org/2000/svg"';for(const t of Object.keys(this.attributes))e+=" "+t+'="'+a(this.attributes[t])+'"';e+=">";for(let t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e+="</svg>",e}}class ${constructor(e,t){this.pathName=void 0,this.alternate=void 0,this.pathName=e,this.alternate=t}toNode(){const e=document.createElementNS("http://www.w3.org/2000/svg","path");return this.alternate?e.setAttribute("d",this.alternate):e.setAttribute("d",q[this.pathName]),e}toMarkup(){return this.alternate?'<path d="'+a(this.alternate)+'"/>':'<path d="'+a(q[this.pathName])+'"/>'}}class Z{constructor(e){this.attributes=void 0,this.attributes=e||{}}toNode(){const e=document.createElementNS("http://www.w3.org/2000/svg","line");for(const t of Object.keys(this.attributes))e.setAttribute(t,this.attributes[t]);return e}toMarkup(){let e="<line";for(const t of Object.keys(this.attributes))e+=" "+t+'="'+a(this.attributes[t])+'"';return e+="/>",e}}var K={"AMS-Regular":{32:[0,0,0,0,.25],65:[0,.68889,0,0,.72222],66:[0,.68889,0,0,.66667],67:[0,.68889,0,0,.72222],68:[0,.68889,0,0,.72222],69:[0,.68889,0,0,.66667],70:[0,.68889,0,0,.61111],71:[0,.68889,0,0,.77778],72:[0,.68889,0,0,.77778],73:[0,.68889,0,0,.38889],74:[.16667,.68889,0,0,.5],75:[0,.68889,0,0,.77778],76:[0,.68889,0,0,.66667],77:[0,.68889,0,0,.94445],78:[0,.68889,0,0,.72222],79:[.16667,.68889,0,0,.77778],80:[0,.68889,0,0,.61111],81:[.16667,.68889,0,0,.77778],82:[0,.68889,0,0,.72222],83:[0,.68889,0,0,.55556],84:[0,.68889,0,0,.66667],85:[0,.68889,0,0,.72222],86:[0,.68889,0,0,.72222],87:[0,.68889,0,0,1],88:[0,.68889,0,0,.72222],89:[0,.68889,0,0,.72222],90:[0,.68889,0,0,.66667],107:[0,.68889,0,0,.55556],160:[0,0,0,0,.25],165:[0,.675,.025,0,.75],174:[.15559,.69224,0,0,.94666],240:[0,.68889,0,0,.55556],295:[0,.68889,0,0,.54028],710:[0,.825,0,0,2.33334],732:[0,.9,0,0,2.33334],770:[0,.825,0,0,2.33334],771:[0,.9,0,0,2.33334],989:[.08167,.58167,0,0,.77778],1008:[0,.43056,.04028,0,.66667],8245:[0,.54986,0,0,.275],8463:[0,.68889,0,0,.54028],8487:[0,.68889,0,0,.72222],8498:[0,.68889,0,0,.55556],8502:[0,.68889,0,0,.66667],8503:[0,.68889,0,0,.44445],8504:[0,.68889,0,0,.66667],8513:[0,.68889,0,0,.63889],8592:[-.03598,.46402,0,0,.5],8594:[-.03598,.46402,0,0,.5],8602:[-.13313,.36687,0,0,1],8603:[-.13313,.36687,0,0,1],8606:[.01354,.52239,0,0,1],8608:[.01354,.52239,0,0,1],8610:[.01354,.52239,0,0,1.11111],8611:[.01354,.52239,0,0,1.11111],8619:[0,.54986,0,0,1],8620:[0,.54986,0,0,1],8621:[-.13313,.37788,0,0,1.38889],8622:[-.13313,.36687,0,0,1],8624:[0,.69224,0,0,.5],8625:[0,.69224,0,0,.5],8630:[0,.43056,0,0,1],8631:[0,.43056,0,0,1],8634:[.08198,.58198,0,0,.77778],8635:[.08198,.58198,0,0,.77778],8638:[.19444,.69224,0,0,.41667],8639:[.19444,.69224,0,0,.41667],8642:[.19444,.69224,0,0,.41667],8643:[.19444,.69224,0,0,.41667],8644:[.1808,.675,0,0,1],8646:[.1808,.675,0,0,1],8647:[.1808,.675,0,0,1],8648:[.19444,.69224,0,0,.83334],8649:[.1808,.675,0,0,1],8650:[.19444,.69224,0,0,.83334],8651:[.01354,.52239,0,0,1],8652:[.01354,.52239,0,0,1],8653:[-.13313,.36687,0,0,1],8654:[-.13313,.36687,0,0,1],8655:[-.13313,.36687,0,0,1],8666:[.13667,.63667,0,0,1],8667:[.13667,.63667,0,0,1],8669:[-.13313,.37788,0,0,1],8672:[-.064,.437,0,0,1.334],8674:[-.064,.437,0,0,1.334],8705:[0,.825,0,0,.5],8708:[0,.68889,0,0,.55556],8709:[.08167,.58167,0,0,.77778],8717:[0,.43056,0,0,.42917],8722:[-.03598,.46402,0,0,.5],8724:[.08198,.69224,0,0,.77778],8726:[.08167,.58167,0,0,.77778],8733:[0,.69224,0,0,.77778],8736:[0,.69224,0,0,.72222],8737:[0,.69224,0,0,.72222],8738:[.03517,.52239,0,0,.72222],8739:[.08167,.58167,0,0,.22222],8740:[.25142,.74111,0,0,.27778],8741:[.08167,.58167,0,0,.38889],8742:[.25142,.74111,0,0,.5],8756:[0,.69224,0,0,.66667],8757:[0,.69224,0,0,.66667],8764:[-.13313,.36687,0,0,.77778],8765:[-.13313,.37788,0,0,.77778],8769:[-.13313,.36687,0,0,.77778],8770:[-.03625,.46375,0,0,.77778],8774:[.30274,.79383,0,0,.77778],8776:[-.01688,.48312,0,0,.77778],8778:[.08167,.58167,0,0,.77778],8782:[.06062,.54986,0,0,.77778],8783:[.06062,.54986,0,0,.77778],8785:[.08198,.58198,0,0,.77778],8786:[.08198,.58198,0,0,.77778],8787:[.08198,.58198,0,0,.77778],8790:[0,.69224,0,0,.77778],8791:[.22958,.72958,0,0,.77778],8796:[.08198,.91667,0,0,.77778],8806:[.25583,.75583,0,0,.77778],8807:[.25583,.75583,0,0,.77778],8808:[.25142,.75726,0,0,.77778],8809:[.25142,.75726,0,0,.77778],8812:[.25583,.75583,0,0,.5],8814:[.20576,.70576,0,0,.77778],8815:[.20576,.70576,0,0,.77778],8816:[.30274,.79383,0,0,.77778],8817:[.30274,.79383,0,0,.77778],8818:[.22958,.72958,0,0,.77778],8819:[.22958,.72958,0,0,.77778],8822:[.1808,.675,0,0,.77778],8823:[.1808,.675,0,0,.77778],8828:[.13667,.63667,0,0,.77778],8829:[.13667,.63667,0,0,.77778],8830:[.22958,.72958,0,0,.77778],8831:[.22958,.72958,0,0,.77778],8832:[.20576,.70576,0,0,.77778],8833:[.20576,.70576,0,0,.77778],8840:[.30274,.79383,0,0,.77778],8841:[.30274,.79383,0,0,.77778],8842:[.13597,.63597,0,0,.77778],8843:[.13597,.63597,0,0,.77778],8847:[.03517,.54986,0,0,.77778],8848:[.03517,.54986,0,0,.77778],8858:[.08198,.58198,0,0,.77778],8859:[.08198,.58198,0,0,.77778],8861:[.08198,.58198,0,0,.77778],8862:[0,.675,0,0,.77778],8863:[0,.675,0,0,.77778],8864:[0,.675,0,0,.77778],8865:[0,.675,0,0,.77778],8872:[0,.69224,0,0,.61111],8873:[0,.69224,0,0,.72222],8874:[0,.69224,0,0,.88889],8876:[0,.68889,0,0,.61111],8877:[0,.68889,0,0,.61111],8878:[0,.68889,0,0,.72222],8879:[0,.68889,0,0,.72222],8882:[.03517,.54986,0,0,.77778],8883:[.03517,.54986,0,0,.77778],8884:[.13667,.63667,0,0,.77778],8885:[.13667,.63667,0,0,.77778],8888:[0,.54986,0,0,1.11111],8890:[.19444,.43056,0,0,.55556],8891:[.19444,.69224,0,0,.61111],8892:[.19444,.69224,0,0,.61111],8901:[0,.54986,0,0,.27778],8903:[.08167,.58167,0,0,.77778],8905:[.08167,.58167,0,0,.77778],8906:[.08167,.58167,0,0,.77778],8907:[0,.69224,0,0,.77778],8908:[0,.69224,0,0,.77778],8909:[-.03598,.46402,0,0,.77778],8910:[0,.54986,0,0,.76042],8911:[0,.54986,0,0,.76042],8912:[.03517,.54986,0,0,.77778],8913:[.03517,.54986,0,0,.77778],8914:[0,.54986,0,0,.66667],8915:[0,.54986,0,0,.66667],8916:[0,.69224,0,0,.66667],8918:[.0391,.5391,0,0,.77778],8919:[.0391,.5391,0,0,.77778],8920:[.03517,.54986,0,0,1.33334],8921:[.03517,.54986,0,0,1.33334],8922:[.38569,.88569,0,0,.77778],8923:[.38569,.88569,0,0,.77778],8926:[.13667,.63667,0,0,.77778],8927:[.13667,.63667,0,0,.77778],8928:[.30274,.79383,0,0,.77778],8929:[.30274,.79383,0,0,.77778],8934:[.23222,.74111,0,0,.77778],8935:[.23222,.74111,0,0,.77778],8936:[.23222,.74111,0,0,.77778],8937:[.23222,.74111,0,0,.77778],8938:[.20576,.70576,0,0,.77778],8939:[.20576,.70576,0,0,.77778],8940:[.30274,.79383,0,0,.77778],8941:[.30274,.79383,0,0,.77778],8994:[.19444,.69224,0,0,.77778],8995:[.19444,.69224,0,0,.77778],9416:[.15559,.69224,0,0,.90222],9484:[0,.69224,0,0,.5],9488:[0,.69224,0,0,.5],9492:[0,.37788,0,0,.5],9496:[0,.37788,0,0,.5],9585:[.19444,.68889,0,0,.88889],9586:[.19444,.74111,0,0,.88889],9632:[0,.675,0,0,.77778],9633:[0,.675,0,0,.77778],9650:[0,.54986,0,0,.72222],9651:[0,.54986,0,0,.72222],9654:[.03517,.54986,0,0,.77778],9660:[0,.54986,0,0,.72222],9661:[0,.54986,0,0,.72222],9664:[.03517,.54986,0,0,.77778],9674:[.11111,.69224,0,0,.66667],9733:[.19444,.69224,0,0,.94445],10003:[0,.69224,0,0,.83334],10016:[0,.69224,0,0,.83334],10731:[.11111,.69224,0,0,.66667],10846:[.19444,.75583,0,0,.61111],10877:[.13667,.63667,0,0,.77778],10878:[.13667,.63667,0,0,.77778],10885:[.25583,.75583,0,0,.77778],10886:[.25583,.75583,0,0,.77778],10887:[.13597,.63597,0,0,.77778],10888:[.13597,.63597,0,0,.77778],10889:[.26167,.75726,0,0,.77778],10890:[.26167,.75726,0,0,.77778],10891:[.48256,.98256,0,0,.77778],10892:[.48256,.98256,0,0,.77778],10901:[.13667,.63667,0,0,.77778],10902:[.13667,.63667,0,0,.77778],10933:[.25142,.75726,0,0,.77778],10934:[.25142,.75726,0,0,.77778],10935:[.26167,.75726,0,0,.77778],10936:[.26167,.75726,0,0,.77778],10937:[.26167,.75726,0,0,.77778],10938:[.26167,.75726,0,0,.77778],10949:[.25583,.75583,0,0,.77778],10950:[.25583,.75583,0,0,.77778],10955:[.28481,.79383,0,0,.77778],10956:[.28481,.79383,0,0,.77778],57350:[.08167,.58167,0,0,.22222],57351:[.08167,.58167,0,0,.38889],57352:[.08167,.58167,0,0,.77778],57353:[0,.43056,.04028,0,.66667],57356:[.25142,.75726,0,0,.77778],57357:[.25142,.75726,0,0,.77778],57358:[.41951,.91951,0,0,.77778],57359:[.30274,.79383,0,0,.77778],57360:[.30274,.79383,0,0,.77778],57361:[.41951,.91951,0,0,.77778],57366:[.25142,.75726,0,0,.77778],57367:[.25142,.75726,0,0,.77778],57368:[.25142,.75726,0,0,.77778],57369:[.25142,.75726,0,0,.77778],57370:[.13597,.63597,0,0,.77778],57371:[.13597,.63597,0,0,.77778]},"Caligraphic-Regular":{32:[0,0,0,0,.25],65:[0,.68333,0,.19445,.79847],66:[0,.68333,.03041,.13889,.65681],67:[0,.68333,.05834,.13889,.52653],68:[0,.68333,.02778,.08334,.77139],69:[0,.68333,.08944,.11111,.52778],70:[0,.68333,.09931,.11111,.71875],71:[.09722,.68333,.0593,.11111,.59487],72:[0,.68333,.00965,.11111,.84452],73:[0,.68333,.07382,0,.54452],74:[.09722,.68333,.18472,.16667,.67778],75:[0,.68333,.01445,.05556,.76195],76:[0,.68333,0,.13889,.68972],77:[0,.68333,0,.13889,1.2009],78:[0,.68333,.14736,.08334,.82049],79:[0,.68333,.02778,.11111,.79611],80:[0,.68333,.08222,.08334,.69556],81:[.09722,.68333,0,.11111,.81667],82:[0,.68333,0,.08334,.8475],83:[0,.68333,.075,.13889,.60556],84:[0,.68333,.25417,0,.54464],85:[0,.68333,.09931,.08334,.62583],86:[0,.68333,.08222,0,.61278],87:[0,.68333,.08222,.08334,.98778],88:[0,.68333,.14643,.13889,.7133],89:[.09722,.68333,.08222,.08334,.66834],90:[0,.68333,.07944,.13889,.72473],160:[0,0,0,0,.25]},"Fraktur-Regular":{32:[0,0,0,0,.25],33:[0,.69141,0,0,.29574],34:[0,.69141,0,0,.21471],38:[0,.69141,0,0,.73786],39:[0,.69141,0,0,.21201],40:[.24982,.74947,0,0,.38865],41:[.24982,.74947,0,0,.38865],42:[0,.62119,0,0,.27764],43:[.08319,.58283,0,0,.75623],44:[0,.10803,0,0,.27764],45:[.08319,.58283,0,0,.75623],46:[0,.10803,0,0,.27764],47:[.24982,.74947,0,0,.50181],48:[0,.47534,0,0,.50181],49:[0,.47534,0,0,.50181],50:[0,.47534,0,0,.50181],51:[.18906,.47534,0,0,.50181],52:[.18906,.47534,0,0,.50181],53:[.18906,.47534,0,0,.50181],54:[0,.69141,0,0,.50181],55:[.18906,.47534,0,0,.50181],56:[0,.69141,0,0,.50181],57:[.18906,.47534,0,0,.50181],58:[0,.47534,0,0,.21606],59:[.12604,.47534,0,0,.21606],61:[-.13099,.36866,0,0,.75623],63:[0,.69141,0,0,.36245],65:[0,.69141,0,0,.7176],66:[0,.69141,0,0,.88397],67:[0,.69141,0,0,.61254],68:[0,.69141,0,0,.83158],69:[0,.69141,0,0,.66278],70:[.12604,.69141,0,0,.61119],71:[0,.69141,0,0,.78539],72:[.06302,.69141,0,0,.7203],73:[0,.69141,0,0,.55448],74:[.12604,.69141,0,0,.55231],75:[0,.69141,0,0,.66845],76:[0,.69141,0,0,.66602],77:[0,.69141,0,0,1.04953],78:[0,.69141,0,0,.83212],79:[0,.69141,0,0,.82699],80:[.18906,.69141,0,0,.82753],81:[.03781,.69141,0,0,.82699],82:[0,.69141,0,0,.82807],83:[0,.69141,0,0,.82861],84:[0,.69141,0,0,.66899],85:[0,.69141,0,0,.64576],86:[0,.69141,0,0,.83131],87:[0,.69141,0,0,1.04602],88:[0,.69141,0,0,.71922],89:[.18906,.69141,0,0,.83293],90:[.12604,.69141,0,0,.60201],91:[.24982,.74947,0,0,.27764],93:[.24982,.74947,0,0,.27764],94:[0,.69141,0,0,.49965],97:[0,.47534,0,0,.50046],98:[0,.69141,0,0,.51315],99:[0,.47534,0,0,.38946],100:[0,.62119,0,0,.49857],101:[0,.47534,0,0,.40053],102:[.18906,.69141,0,0,.32626],103:[.18906,.47534,0,0,.5037],104:[.18906,.69141,0,0,.52126],105:[0,.69141,0,0,.27899],106:[0,.69141,0,0,.28088],107:[0,.69141,0,0,.38946],108:[0,.69141,0,0,.27953],109:[0,.47534,0,0,.76676],110:[0,.47534,0,0,.52666],111:[0,.47534,0,0,.48885],112:[.18906,.52396,0,0,.50046],113:[.18906,.47534,0,0,.48912],114:[0,.47534,0,0,.38919],115:[0,.47534,0,0,.44266],116:[0,.62119,0,0,.33301],117:[0,.47534,0,0,.5172],118:[0,.52396,0,0,.5118],119:[0,.52396,0,0,.77351],120:[.18906,.47534,0,0,.38865],121:[.18906,.47534,0,0,.49884],122:[.18906,.47534,0,0,.39054],160:[0,0,0,0,.25],8216:[0,.69141,0,0,.21471],8217:[0,.69141,0,0,.21471],58112:[0,.62119,0,0,.49749],58113:[0,.62119,0,0,.4983],58114:[.18906,.69141,0,0,.33328],58115:[.18906,.69141,0,0,.32923],58116:[.18906,.47534,0,0,.50343],58117:[0,.69141,0,0,.33301],58118:[0,.62119,0,0,.33409],58119:[0,.47534,0,0,.50073]},"Main-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.35],34:[0,.69444,0,0,.60278],35:[.19444,.69444,0,0,.95833],36:[.05556,.75,0,0,.575],37:[.05556,.75,0,0,.95833],38:[0,.69444,0,0,.89444],39:[0,.69444,0,0,.31944],40:[.25,.75,0,0,.44722],41:[.25,.75,0,0,.44722],42:[0,.75,0,0,.575],43:[.13333,.63333,0,0,.89444],44:[.19444,.15556,0,0,.31944],45:[0,.44444,0,0,.38333],46:[0,.15556,0,0,.31944],47:[.25,.75,0,0,.575],48:[0,.64444,0,0,.575],49:[0,.64444,0,0,.575],50:[0,.64444,0,0,.575],51:[0,.64444,0,0,.575],52:[0,.64444,0,0,.575],53:[0,.64444,0,0,.575],54:[0,.64444,0,0,.575],55:[0,.64444,0,0,.575],56:[0,.64444,0,0,.575],57:[0,.64444,0,0,.575],58:[0,.44444,0,0,.31944],59:[.19444,.44444,0,0,.31944],60:[.08556,.58556,0,0,.89444],61:[-.10889,.39111,0,0,.89444],62:[.08556,.58556,0,0,.89444],63:[0,.69444,0,0,.54305],64:[0,.69444,0,0,.89444],65:[0,.68611,0,0,.86944],66:[0,.68611,0,0,.81805],67:[0,.68611,0,0,.83055],68:[0,.68611,0,0,.88194],69:[0,.68611,0,0,.75555],70:[0,.68611,0,0,.72361],71:[0,.68611,0,0,.90416],72:[0,.68611,0,0,.9],73:[0,.68611,0,0,.43611],74:[0,.68611,0,0,.59444],75:[0,.68611,0,0,.90138],76:[0,.68611,0,0,.69166],77:[0,.68611,0,0,1.09166],78:[0,.68611,0,0,.9],79:[0,.68611,0,0,.86388],80:[0,.68611,0,0,.78611],81:[.19444,.68611,0,0,.86388],82:[0,.68611,0,0,.8625],83:[0,.68611,0,0,.63889],84:[0,.68611,0,0,.8],85:[0,.68611,0,0,.88472],86:[0,.68611,.01597,0,.86944],87:[0,.68611,.01597,0,1.18888],88:[0,.68611,0,0,.86944],89:[0,.68611,.02875,0,.86944],90:[0,.68611,0,0,.70277],91:[.25,.75,0,0,.31944],92:[.25,.75,0,0,.575],93:[.25,.75,0,0,.31944],94:[0,.69444,0,0,.575],95:[.31,.13444,.03194,0,.575],97:[0,.44444,0,0,.55902],98:[0,.69444,0,0,.63889],99:[0,.44444,0,0,.51111],100:[0,.69444,0,0,.63889],101:[0,.44444,0,0,.52708],102:[0,.69444,.10903,0,.35139],103:[.19444,.44444,.01597,0,.575],104:[0,.69444,0,0,.63889],105:[0,.69444,0,0,.31944],106:[.19444,.69444,0,0,.35139],107:[0,.69444,0,0,.60694],108:[0,.69444,0,0,.31944],109:[0,.44444,0,0,.95833],110:[0,.44444,0,0,.63889],111:[0,.44444,0,0,.575],112:[.19444,.44444,0,0,.63889],113:[.19444,.44444,0,0,.60694],114:[0,.44444,0,0,.47361],115:[0,.44444,0,0,.45361],116:[0,.63492,0,0,.44722],117:[0,.44444,0,0,.63889],118:[0,.44444,.01597,0,.60694],119:[0,.44444,.01597,0,.83055],120:[0,.44444,0,0,.60694],121:[.19444,.44444,.01597,0,.60694],122:[0,.44444,0,0,.51111],123:[.25,.75,0,0,.575],124:[.25,.75,0,0,.31944],125:[.25,.75,0,0,.575],126:[.35,.34444,0,0,.575],160:[0,0,0,0,.25],163:[0,.69444,0,0,.86853],168:[0,.69444,0,0,.575],172:[0,.44444,0,0,.76666],176:[0,.69444,0,0,.86944],177:[.13333,.63333,0,0,.89444],184:[.17014,0,0,0,.51111],198:[0,.68611,0,0,1.04166],215:[.13333,.63333,0,0,.89444],216:[.04861,.73472,0,0,.89444],223:[0,.69444,0,0,.59722],230:[0,.44444,0,0,.83055],247:[.13333,.63333,0,0,.89444],248:[.09722,.54167,0,0,.575],305:[0,.44444,0,0,.31944],338:[0,.68611,0,0,1.16944],339:[0,.44444,0,0,.89444],567:[.19444,.44444,0,0,.35139],710:[0,.69444,0,0,.575],711:[0,.63194,0,0,.575],713:[0,.59611,0,0,.575],714:[0,.69444,0,0,.575],715:[0,.69444,0,0,.575],728:[0,.69444,0,0,.575],729:[0,.69444,0,0,.31944],730:[0,.69444,0,0,.86944],732:[0,.69444,0,0,.575],733:[0,.69444,0,0,.575],915:[0,.68611,0,0,.69166],916:[0,.68611,0,0,.95833],920:[0,.68611,0,0,.89444],923:[0,.68611,0,0,.80555],926:[0,.68611,0,0,.76666],928:[0,.68611,0,0,.9],931:[0,.68611,0,0,.83055],933:[0,.68611,0,0,.89444],934:[0,.68611,0,0,.83055],936:[0,.68611,0,0,.89444],937:[0,.68611,0,0,.83055],8211:[0,.44444,.03194,0,.575],8212:[0,.44444,.03194,0,1.14999],8216:[0,.69444,0,0,.31944],8217:[0,.69444,0,0,.31944],8220:[0,.69444,0,0,.60278],8221:[0,.69444,0,0,.60278],8224:[.19444,.69444,0,0,.51111],8225:[.19444,.69444,0,0,.51111],8242:[0,.55556,0,0,.34444],8407:[0,.72444,.15486,0,.575],8463:[0,.69444,0,0,.66759],8465:[0,.69444,0,0,.83055],8467:[0,.69444,0,0,.47361],8472:[.19444,.44444,0,0,.74027],8476:[0,.69444,0,0,.83055],8501:[0,.69444,0,0,.70277],8592:[-.10889,.39111,0,0,1.14999],8593:[.19444,.69444,0,0,.575],8594:[-.10889,.39111,0,0,1.14999],8595:[.19444,.69444,0,0,.575],8596:[-.10889,.39111,0,0,1.14999],8597:[.25,.75,0,0,.575],8598:[.19444,.69444,0,0,1.14999],8599:[.19444,.69444,0,0,1.14999],8600:[.19444,.69444,0,0,1.14999],8601:[.19444,.69444,0,0,1.14999],8636:[-.10889,.39111,0,0,1.14999],8637:[-.10889,.39111,0,0,1.14999],8640:[-.10889,.39111,0,0,1.14999],8641:[-.10889,.39111,0,0,1.14999],8656:[-.10889,.39111,0,0,1.14999],8657:[.19444,.69444,0,0,.70277],8658:[-.10889,.39111,0,0,1.14999],8659:[.19444,.69444,0,0,.70277],8660:[-.10889,.39111,0,0,1.14999],8661:[.25,.75,0,0,.70277],8704:[0,.69444,0,0,.63889],8706:[0,.69444,.06389,0,.62847],8707:[0,.69444,0,0,.63889],8709:[.05556,.75,0,0,.575],8711:[0,.68611,0,0,.95833],8712:[.08556,.58556,0,0,.76666],8715:[.08556,.58556,0,0,.76666],8722:[.13333,.63333,0,0,.89444],8723:[.13333,.63333,0,0,.89444],8725:[.25,.75,0,0,.575],8726:[.25,.75,0,0,.575],8727:[-.02778,.47222,0,0,.575],8728:[-.02639,.47361,0,0,.575],8729:[-.02639,.47361,0,0,.575],8730:[.18,.82,0,0,.95833],8733:[0,.44444,0,0,.89444],8734:[0,.44444,0,0,1.14999],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.31944],8741:[.25,.75,0,0,.575],8743:[0,.55556,0,0,.76666],8744:[0,.55556,0,0,.76666],8745:[0,.55556,0,0,.76666],8746:[0,.55556,0,0,.76666],8747:[.19444,.69444,.12778,0,.56875],8764:[-.10889,.39111,0,0,.89444],8768:[.19444,.69444,0,0,.31944],8771:[.00222,.50222,0,0,.89444],8773:[.027,.638,0,0,.894],8776:[.02444,.52444,0,0,.89444],8781:[.00222,.50222,0,0,.89444],8801:[.00222,.50222,0,0,.89444],8804:[.19667,.69667,0,0,.89444],8805:[.19667,.69667,0,0,.89444],8810:[.08556,.58556,0,0,1.14999],8811:[.08556,.58556,0,0,1.14999],8826:[.08556,.58556,0,0,.89444],8827:[.08556,.58556,0,0,.89444],8834:[.08556,.58556,0,0,.89444],8835:[.08556,.58556,0,0,.89444],8838:[.19667,.69667,0,0,.89444],8839:[.19667,.69667,0,0,.89444],8846:[0,.55556,0,0,.76666],8849:[.19667,.69667,0,0,.89444],8850:[.19667,.69667,0,0,.89444],8851:[0,.55556,0,0,.76666],8852:[0,.55556,0,0,.76666],8853:[.13333,.63333,0,0,.89444],8854:[.13333,.63333,0,0,.89444],8855:[.13333,.63333,0,0,.89444],8856:[.13333,.63333,0,0,.89444],8857:[.13333,.63333,0,0,.89444],8866:[0,.69444,0,0,.70277],8867:[0,.69444,0,0,.70277],8868:[0,.69444,0,0,.89444],8869:[0,.69444,0,0,.89444],8900:[-.02639,.47361,0,0,.575],8901:[-.02639,.47361,0,0,.31944],8902:[-.02778,.47222,0,0,.575],8968:[.25,.75,0,0,.51111],8969:[.25,.75,0,0,.51111],8970:[.25,.75,0,0,.51111],8971:[.25,.75,0,0,.51111],8994:[-.13889,.36111,0,0,1.14999],8995:[-.13889,.36111,0,0,1.14999],9651:[.19444,.69444,0,0,1.02222],9657:[-.02778,.47222,0,0,.575],9661:[.19444,.69444,0,0,1.02222],9667:[-.02778,.47222,0,0,.575],9711:[.19444,.69444,0,0,1.14999],9824:[.12963,.69444,0,0,.89444],9825:[.12963,.69444,0,0,.89444],9826:[.12963,.69444,0,0,.89444],9827:[.12963,.69444,0,0,.89444],9837:[0,.75,0,0,.44722],9838:[.19444,.69444,0,0,.44722],9839:[.19444,.69444,0,0,.44722],10216:[.25,.75,0,0,.44722],10217:[.25,.75,0,0,.44722],10815:[0,.68611,0,0,.9],10927:[.19667,.69667,0,0,.89444],10928:[.19667,.69667,0,0,.89444],57376:[.19444,.69444,0,0,0]},"Main-BoldItalic":{32:[0,0,0,0,.25],33:[0,.69444,.11417,0,.38611],34:[0,.69444,.07939,0,.62055],35:[.19444,.69444,.06833,0,.94444],37:[.05556,.75,.12861,0,.94444],38:[0,.69444,.08528,0,.88555],39:[0,.69444,.12945,0,.35555],40:[.25,.75,.15806,0,.47333],41:[.25,.75,.03306,0,.47333],42:[0,.75,.14333,0,.59111],43:[.10333,.60333,.03306,0,.88555],44:[.19444,.14722,0,0,.35555],45:[0,.44444,.02611,0,.41444],46:[0,.14722,0,0,.35555],47:[.25,.75,.15806,0,.59111],48:[0,.64444,.13167,0,.59111],49:[0,.64444,.13167,0,.59111],50:[0,.64444,.13167,0,.59111],51:[0,.64444,.13167,0,.59111],52:[.19444,.64444,.13167,0,.59111],53:[0,.64444,.13167,0,.59111],54:[0,.64444,.13167,0,.59111],55:[.19444,.64444,.13167,0,.59111],56:[0,.64444,.13167,0,.59111],57:[0,.64444,.13167,0,.59111],58:[0,.44444,.06695,0,.35555],59:[.19444,.44444,.06695,0,.35555],61:[-.10889,.39111,.06833,0,.88555],63:[0,.69444,.11472,0,.59111],64:[0,.69444,.09208,0,.88555],65:[0,.68611,0,0,.86555],66:[0,.68611,.0992,0,.81666],67:[0,.68611,.14208,0,.82666],68:[0,.68611,.09062,0,.87555],69:[0,.68611,.11431,0,.75666],70:[0,.68611,.12903,0,.72722],71:[0,.68611,.07347,0,.89527],72:[0,.68611,.17208,0,.8961],73:[0,.68611,.15681,0,.47166],74:[0,.68611,.145,0,.61055],75:[0,.68611,.14208,0,.89499],76:[0,.68611,0,0,.69777],77:[0,.68611,.17208,0,1.07277],78:[0,.68611,.17208,0,.8961],79:[0,.68611,.09062,0,.85499],80:[0,.68611,.0992,0,.78721],81:[.19444,.68611,.09062,0,.85499],82:[0,.68611,.02559,0,.85944],83:[0,.68611,.11264,0,.64999],84:[0,.68611,.12903,0,.7961],85:[0,.68611,.17208,0,.88083],86:[0,.68611,.18625,0,.86555],87:[0,.68611,.18625,0,1.15999],88:[0,.68611,.15681,0,.86555],89:[0,.68611,.19803,0,.86555],90:[0,.68611,.14208,0,.70888],91:[.25,.75,.1875,0,.35611],93:[.25,.75,.09972,0,.35611],94:[0,.69444,.06709,0,.59111],95:[.31,.13444,.09811,0,.59111],97:[0,.44444,.09426,0,.59111],98:[0,.69444,.07861,0,.53222],99:[0,.44444,.05222,0,.53222],100:[0,.69444,.10861,0,.59111],101:[0,.44444,.085,0,.53222],102:[.19444,.69444,.21778,0,.4],103:[.19444,.44444,.105,0,.53222],104:[0,.69444,.09426,0,.59111],105:[0,.69326,.11387,0,.35555],106:[.19444,.69326,.1672,0,.35555],107:[0,.69444,.11111,0,.53222],108:[0,.69444,.10861,0,.29666],109:[0,.44444,.09426,0,.94444],110:[0,.44444,.09426,0,.64999],111:[0,.44444,.07861,0,.59111],112:[.19444,.44444,.07861,0,.59111],113:[.19444,.44444,.105,0,.53222],114:[0,.44444,.11111,0,.50167],115:[0,.44444,.08167,0,.48694],116:[0,.63492,.09639,0,.385],117:[0,.44444,.09426,0,.62055],118:[0,.44444,.11111,0,.53222],119:[0,.44444,.11111,0,.76777],120:[0,.44444,.12583,0,.56055],121:[.19444,.44444,.105,0,.56166],122:[0,.44444,.13889,0,.49055],126:[.35,.34444,.11472,0,.59111],160:[0,0,0,0,.25],168:[0,.69444,.11473,0,.59111],176:[0,.69444,0,0,.94888],184:[.17014,0,0,0,.53222],198:[0,.68611,.11431,0,1.02277],216:[.04861,.73472,.09062,0,.88555],223:[.19444,.69444,.09736,0,.665],230:[0,.44444,.085,0,.82666],248:[.09722,.54167,.09458,0,.59111],305:[0,.44444,.09426,0,.35555],338:[0,.68611,.11431,0,1.14054],339:[0,.44444,.085,0,.82666],567:[.19444,.44444,.04611,0,.385],710:[0,.69444,.06709,0,.59111],711:[0,.63194,.08271,0,.59111],713:[0,.59444,.10444,0,.59111],714:[0,.69444,.08528,0,.59111],715:[0,.69444,0,0,.59111],728:[0,.69444,.10333,0,.59111],729:[0,.69444,.12945,0,.35555],730:[0,.69444,0,0,.94888],732:[0,.69444,.11472,0,.59111],733:[0,.69444,.11472,0,.59111],915:[0,.68611,.12903,0,.69777],916:[0,.68611,0,0,.94444],920:[0,.68611,.09062,0,.88555],923:[0,.68611,0,0,.80666],926:[0,.68611,.15092,0,.76777],928:[0,.68611,.17208,0,.8961],931:[0,.68611,.11431,0,.82666],933:[0,.68611,.10778,0,.88555],934:[0,.68611,.05632,0,.82666],936:[0,.68611,.10778,0,.88555],937:[0,.68611,.0992,0,.82666],8211:[0,.44444,.09811,0,.59111],8212:[0,.44444,.09811,0,1.18221],8216:[0,.69444,.12945,0,.35555],8217:[0,.69444,.12945,0,.35555],8220:[0,.69444,.16772,0,.62055],8221:[0,.69444,.07939,0,.62055]},"Main-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.12417,0,.30667],34:[0,.69444,.06961,0,.51444],35:[.19444,.69444,.06616,0,.81777],37:[.05556,.75,.13639,0,.81777],38:[0,.69444,.09694,0,.76666],39:[0,.69444,.12417,0,.30667],40:[.25,.75,.16194,0,.40889],41:[.25,.75,.03694,0,.40889],42:[0,.75,.14917,0,.51111],43:[.05667,.56167,.03694,0,.76666],44:[.19444,.10556,0,0,.30667],45:[0,.43056,.02826,0,.35778],46:[0,.10556,0,0,.30667],47:[.25,.75,.16194,0,.51111],48:[0,.64444,.13556,0,.51111],49:[0,.64444,.13556,0,.51111],50:[0,.64444,.13556,0,.51111],51:[0,.64444,.13556,0,.51111],52:[.19444,.64444,.13556,0,.51111],53:[0,.64444,.13556,0,.51111],54:[0,.64444,.13556,0,.51111],55:[.19444,.64444,.13556,0,.51111],56:[0,.64444,.13556,0,.51111],57:[0,.64444,.13556,0,.51111],58:[0,.43056,.0582,0,.30667],59:[.19444,.43056,.0582,0,.30667],61:[-.13313,.36687,.06616,0,.76666],63:[0,.69444,.1225,0,.51111],64:[0,.69444,.09597,0,.76666],65:[0,.68333,0,0,.74333],66:[0,.68333,.10257,0,.70389],67:[0,.68333,.14528,0,.71555],68:[0,.68333,.09403,0,.755],69:[0,.68333,.12028,0,.67833],70:[0,.68333,.13305,0,.65277],71:[0,.68333,.08722,0,.77361],72:[0,.68333,.16389,0,.74333],73:[0,.68333,.15806,0,.38555],74:[0,.68333,.14028,0,.525],75:[0,.68333,.14528,0,.76888],76:[0,.68333,0,0,.62722],77:[0,.68333,.16389,0,.89666],78:[0,.68333,.16389,0,.74333],79:[0,.68333,.09403,0,.76666],80:[0,.68333,.10257,0,.67833],81:[.19444,.68333,.09403,0,.76666],82:[0,.68333,.03868,0,.72944],83:[0,.68333,.11972,0,.56222],84:[0,.68333,.13305,0,.71555],85:[0,.68333,.16389,0,.74333],86:[0,.68333,.18361,0,.74333],87:[0,.68333,.18361,0,.99888],88:[0,.68333,.15806,0,.74333],89:[0,.68333,.19383,0,.74333],90:[0,.68333,.14528,0,.61333],91:[.25,.75,.1875,0,.30667],93:[.25,.75,.10528,0,.30667],94:[0,.69444,.06646,0,.51111],95:[.31,.12056,.09208,0,.51111],97:[0,.43056,.07671,0,.51111],98:[0,.69444,.06312,0,.46],99:[0,.43056,.05653,0,.46],100:[0,.69444,.10333,0,.51111],101:[0,.43056,.07514,0,.46],102:[.19444,.69444,.21194,0,.30667],103:[.19444,.43056,.08847,0,.46],104:[0,.69444,.07671,0,.51111],105:[0,.65536,.1019,0,.30667],106:[.19444,.65536,.14467,0,.30667],107:[0,.69444,.10764,0,.46],108:[0,.69444,.10333,0,.25555],109:[0,.43056,.07671,0,.81777],110:[0,.43056,.07671,0,.56222],111:[0,.43056,.06312,0,.51111],112:[.19444,.43056,.06312,0,.51111],113:[.19444,.43056,.08847,0,.46],114:[0,.43056,.10764,0,.42166],115:[0,.43056,.08208,0,.40889],116:[0,.61508,.09486,0,.33222],117:[0,.43056,.07671,0,.53666],118:[0,.43056,.10764,0,.46],119:[0,.43056,.10764,0,.66444],120:[0,.43056,.12042,0,.46389],121:[.19444,.43056,.08847,0,.48555],122:[0,.43056,.12292,0,.40889],126:[.35,.31786,.11585,0,.51111],160:[0,0,0,0,.25],168:[0,.66786,.10474,0,.51111],176:[0,.69444,0,0,.83129],184:[.17014,0,0,0,.46],198:[0,.68333,.12028,0,.88277],216:[.04861,.73194,.09403,0,.76666],223:[.19444,.69444,.10514,0,.53666],230:[0,.43056,.07514,0,.71555],248:[.09722,.52778,.09194,0,.51111],338:[0,.68333,.12028,0,.98499],339:[0,.43056,.07514,0,.71555],710:[0,.69444,.06646,0,.51111],711:[0,.62847,.08295,0,.51111],713:[0,.56167,.10333,0,.51111],714:[0,.69444,.09694,0,.51111],715:[0,.69444,0,0,.51111],728:[0,.69444,.10806,0,.51111],729:[0,.66786,.11752,0,.30667],730:[0,.69444,0,0,.83129],732:[0,.66786,.11585,0,.51111],733:[0,.69444,.1225,0,.51111],915:[0,.68333,.13305,0,.62722],916:[0,.68333,0,0,.81777],920:[0,.68333,.09403,0,.76666],923:[0,.68333,0,0,.69222],926:[0,.68333,.15294,0,.66444],928:[0,.68333,.16389,0,.74333],931:[0,.68333,.12028,0,.71555],933:[0,.68333,.11111,0,.76666],934:[0,.68333,.05986,0,.71555],936:[0,.68333,.11111,0,.76666],937:[0,.68333,.10257,0,.71555],8211:[0,.43056,.09208,0,.51111],8212:[0,.43056,.09208,0,1.02222],8216:[0,.69444,.12417,0,.30667],8217:[0,.69444,.12417,0,.30667],8220:[0,.69444,.1685,0,.51444],8221:[0,.69444,.06961,0,.51444],8463:[0,.68889,0,0,.54028]},"Main-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.27778],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.77778],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.19444,.10556,0,0,.27778],45:[0,.43056,0,0,.33333],46:[0,.10556,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.64444,0,0,.5],49:[0,.64444,0,0,.5],50:[0,.64444,0,0,.5],51:[0,.64444,0,0,.5],52:[0,.64444,0,0,.5],53:[0,.64444,0,0,.5],54:[0,.64444,0,0,.5],55:[0,.64444,0,0,.5],56:[0,.64444,0,0,.5],57:[0,.64444,0,0,.5],58:[0,.43056,0,0,.27778],59:[.19444,.43056,0,0,.27778],60:[.0391,.5391,0,0,.77778],61:[-.13313,.36687,0,0,.77778],62:[.0391,.5391,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.77778],65:[0,.68333,0,0,.75],66:[0,.68333,0,0,.70834],67:[0,.68333,0,0,.72222],68:[0,.68333,0,0,.76389],69:[0,.68333,0,0,.68056],70:[0,.68333,0,0,.65278],71:[0,.68333,0,0,.78472],72:[0,.68333,0,0,.75],73:[0,.68333,0,0,.36111],74:[0,.68333,0,0,.51389],75:[0,.68333,0,0,.77778],76:[0,.68333,0,0,.625],77:[0,.68333,0,0,.91667],78:[0,.68333,0,0,.75],79:[0,.68333,0,0,.77778],80:[0,.68333,0,0,.68056],81:[.19444,.68333,0,0,.77778],82:[0,.68333,0,0,.73611],83:[0,.68333,0,0,.55556],84:[0,.68333,0,0,.72222],85:[0,.68333,0,0,.75],86:[0,.68333,.01389,0,.75],87:[0,.68333,.01389,0,1.02778],88:[0,.68333,0,0,.75],89:[0,.68333,.025,0,.75],90:[0,.68333,0,0,.61111],91:[.25,.75,0,0,.27778],92:[.25,.75,0,0,.5],93:[.25,.75,0,0,.27778],94:[0,.69444,0,0,.5],95:[.31,.12056,.02778,0,.5],97:[0,.43056,0,0,.5],98:[0,.69444,0,0,.55556],99:[0,.43056,0,0,.44445],100:[0,.69444,0,0,.55556],101:[0,.43056,0,0,.44445],102:[0,.69444,.07778,0,.30556],103:[.19444,.43056,.01389,0,.5],104:[0,.69444,0,0,.55556],105:[0,.66786,0,0,.27778],106:[.19444,.66786,0,0,.30556],107:[0,.69444,0,0,.52778],108:[0,.69444,0,0,.27778],109:[0,.43056,0,0,.83334],110:[0,.43056,0,0,.55556],111:[0,.43056,0,0,.5],112:[.19444,.43056,0,0,.55556],113:[.19444,.43056,0,0,.52778],114:[0,.43056,0,0,.39167],115:[0,.43056,0,0,.39445],116:[0,.61508,0,0,.38889],117:[0,.43056,0,0,.55556],118:[0,.43056,.01389,0,.52778],119:[0,.43056,.01389,0,.72222],120:[0,.43056,0,0,.52778],121:[.19444,.43056,.01389,0,.52778],122:[0,.43056,0,0,.44445],123:[.25,.75,0,0,.5],124:[.25,.75,0,0,.27778],125:[.25,.75,0,0,.5],126:[.35,.31786,0,0,.5],160:[0,0,0,0,.25],163:[0,.69444,0,0,.76909],167:[.19444,.69444,0,0,.44445],168:[0,.66786,0,0,.5],172:[0,.43056,0,0,.66667],176:[0,.69444,0,0,.75],177:[.08333,.58333,0,0,.77778],182:[.19444,.69444,0,0,.61111],184:[.17014,0,0,0,.44445],198:[0,.68333,0,0,.90278],215:[.08333,.58333,0,0,.77778],216:[.04861,.73194,0,0,.77778],223:[0,.69444,0,0,.5],230:[0,.43056,0,0,.72222],247:[.08333,.58333,0,0,.77778],248:[.09722,.52778,0,0,.5],305:[0,.43056,0,0,.27778],338:[0,.68333,0,0,1.01389],339:[0,.43056,0,0,.77778],567:[.19444,.43056,0,0,.30556],710:[0,.69444,0,0,.5],711:[0,.62847,0,0,.5],713:[0,.56778,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.66786,0,0,.27778],730:[0,.69444,0,0,.75],732:[0,.66786,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.68333,0,0,.625],916:[0,.68333,0,0,.83334],920:[0,.68333,0,0,.77778],923:[0,.68333,0,0,.69445],926:[0,.68333,0,0,.66667],928:[0,.68333,0,0,.75],931:[0,.68333,0,0,.72222],933:[0,.68333,0,0,.77778],934:[0,.68333,0,0,.72222],936:[0,.68333,0,0,.77778],937:[0,.68333,0,0,.72222],8211:[0,.43056,.02778,0,.5],8212:[0,.43056,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5],8224:[.19444,.69444,0,0,.44445],8225:[.19444,.69444,0,0,.44445],8230:[0,.123,0,0,1.172],8242:[0,.55556,0,0,.275],8407:[0,.71444,.15382,0,.5],8463:[0,.68889,0,0,.54028],8465:[0,.69444,0,0,.72222],8467:[0,.69444,0,.11111,.41667],8472:[.19444,.43056,0,.11111,.63646],8476:[0,.69444,0,0,.72222],8501:[0,.69444,0,0,.61111],8592:[-.13313,.36687,0,0,1],8593:[.19444,.69444,0,0,.5],8594:[-.13313,.36687,0,0,1],8595:[.19444,.69444,0,0,.5],8596:[-.13313,.36687,0,0,1],8597:[.25,.75,0,0,.5],8598:[.19444,.69444,0,0,1],8599:[.19444,.69444,0,0,1],8600:[.19444,.69444,0,0,1],8601:[.19444,.69444,0,0,1],8614:[.011,.511,0,0,1],8617:[.011,.511,0,0,1.126],8618:[.011,.511,0,0,1.126],8636:[-.13313,.36687,0,0,1],8637:[-.13313,.36687,0,0,1],8640:[-.13313,.36687,0,0,1],8641:[-.13313,.36687,0,0,1],8652:[.011,.671,0,0,1],8656:[-.13313,.36687,0,0,1],8657:[.19444,.69444,0,0,.61111],8658:[-.13313,.36687,0,0,1],8659:[.19444,.69444,0,0,.61111],8660:[-.13313,.36687,0,0,1],8661:[.25,.75,0,0,.61111],8704:[0,.69444,0,0,.55556],8706:[0,.69444,.05556,.08334,.5309],8707:[0,.69444,0,0,.55556],8709:[.05556,.75,0,0,.5],8711:[0,.68333,0,0,.83334],8712:[.0391,.5391,0,0,.66667],8715:[.0391,.5391,0,0,.66667],8722:[.08333,.58333,0,0,.77778],8723:[.08333,.58333,0,0,.77778],8725:[.25,.75,0,0,.5],8726:[.25,.75,0,0,.5],8727:[-.03472,.46528,0,0,.5],8728:[-.05555,.44445,0,0,.5],8729:[-.05555,.44445,0,0,.5],8730:[.2,.8,0,0,.83334],8733:[0,.43056,0,0,.77778],8734:[0,.43056,0,0,1],8736:[0,.69224,0,0,.72222],8739:[.25,.75,0,0,.27778],8741:[.25,.75,0,0,.5],8743:[0,.55556,0,0,.66667],8744:[0,.55556,0,0,.66667],8745:[0,.55556,0,0,.66667],8746:[0,.55556,0,0,.66667],8747:[.19444,.69444,.11111,0,.41667],8764:[-.13313,.36687,0,0,.77778],8768:[.19444,.69444,0,0,.27778],8771:[-.03625,.46375,0,0,.77778],8773:[-.022,.589,0,0,.778],8776:[-.01688,.48312,0,0,.77778],8781:[-.03625,.46375,0,0,.77778],8784:[-.133,.673,0,0,.778],8801:[-.03625,.46375,0,0,.77778],8804:[.13597,.63597,0,0,.77778],8805:[.13597,.63597,0,0,.77778],8810:[.0391,.5391,0,0,1],8811:[.0391,.5391,0,0,1],8826:[.0391,.5391,0,0,.77778],8827:[.0391,.5391,0,0,.77778],8834:[.0391,.5391,0,0,.77778],8835:[.0391,.5391,0,0,.77778],8838:[.13597,.63597,0,0,.77778],8839:[.13597,.63597,0,0,.77778],8846:[0,.55556,0,0,.66667],8849:[.13597,.63597,0,0,.77778],8850:[.13597,.63597,0,0,.77778],8851:[0,.55556,0,0,.66667],8852:[0,.55556,0,0,.66667],8853:[.08333,.58333,0,0,.77778],8854:[.08333,.58333,0,0,.77778],8855:[.08333,.58333,0,0,.77778],8856:[.08333,.58333,0,0,.77778],8857:[.08333,.58333,0,0,.77778],8866:[0,.69444,0,0,.61111],8867:[0,.69444,0,0,.61111],8868:[0,.69444,0,0,.77778],8869:[0,.69444,0,0,.77778],8872:[.249,.75,0,0,.867],8900:[-.05555,.44445,0,0,.5],8901:[-.05555,.44445,0,0,.27778],8902:[-.03472,.46528,0,0,.5],8904:[.005,.505,0,0,.9],8942:[.03,.903,0,0,.278],8943:[-.19,.313,0,0,1.172],8945:[-.1,.823,0,0,1.282],8968:[.25,.75,0,0,.44445],8969:[.25,.75,0,0,.44445],8970:[.25,.75,0,0,.44445],8971:[.25,.75,0,0,.44445],8994:[-.14236,.35764,0,0,1],8995:[-.14236,.35764,0,0,1],9136:[.244,.744,0,0,.412],9137:[.244,.745,0,0,.412],9651:[.19444,.69444,0,0,.88889],9657:[-.03472,.46528,0,0,.5],9661:[.19444,.69444,0,0,.88889],9667:[-.03472,.46528,0,0,.5],9711:[.19444,.69444,0,0,1],9824:[.12963,.69444,0,0,.77778],9825:[.12963,.69444,0,0,.77778],9826:[.12963,.69444,0,0,.77778],9827:[.12963,.69444,0,0,.77778],9837:[0,.75,0,0,.38889],9838:[.19444,.69444,0,0,.38889],9839:[.19444,.69444,0,0,.38889],10216:[.25,.75,0,0,.38889],10217:[.25,.75,0,0,.38889],10222:[.244,.744,0,0,.412],10223:[.244,.745,0,0,.412],10229:[.011,.511,0,0,1.609],10230:[.011,.511,0,0,1.638],10231:[.011,.511,0,0,1.859],10232:[.024,.525,0,0,1.609],10233:[.024,.525,0,0,1.638],10234:[.024,.525,0,0,1.858],10236:[.011,.511,0,0,1.638],10815:[0,.68333,0,0,.75],10927:[.13597,.63597,0,0,.77778],10928:[.13597,.63597,0,0,.77778],57376:[.19444,.69444,0,0,0]},"Math-BoldItalic":{32:[0,0,0,0,.25],48:[0,.44444,0,0,.575],49:[0,.44444,0,0,.575],50:[0,.44444,0,0,.575],51:[.19444,.44444,0,0,.575],52:[.19444,.44444,0,0,.575],53:[.19444,.44444,0,0,.575],54:[0,.64444,0,0,.575],55:[.19444,.44444,0,0,.575],56:[0,.64444,0,0,.575],57:[.19444,.44444,0,0,.575],65:[0,.68611,0,0,.86944],66:[0,.68611,.04835,0,.8664],67:[0,.68611,.06979,0,.81694],68:[0,.68611,.03194,0,.93812],69:[0,.68611,.05451,0,.81007],70:[0,.68611,.15972,0,.68889],71:[0,.68611,0,0,.88673],72:[0,.68611,.08229,0,.98229],73:[0,.68611,.07778,0,.51111],74:[0,.68611,.10069,0,.63125],75:[0,.68611,.06979,0,.97118],76:[0,.68611,0,0,.75555],77:[0,.68611,.11424,0,1.14201],78:[0,.68611,.11424,0,.95034],79:[0,.68611,.03194,0,.83666],80:[0,.68611,.15972,0,.72309],81:[.19444,.68611,0,0,.86861],82:[0,.68611,.00421,0,.87235],83:[0,.68611,.05382,0,.69271],84:[0,.68611,.15972,0,.63663],85:[0,.68611,.11424,0,.80027],86:[0,.68611,.25555,0,.67778],87:[0,.68611,.15972,0,1.09305],88:[0,.68611,.07778,0,.94722],89:[0,.68611,.25555,0,.67458],90:[0,.68611,.06979,0,.77257],97:[0,.44444,0,0,.63287],98:[0,.69444,0,0,.52083],99:[0,.44444,0,0,.51342],100:[0,.69444,0,0,.60972],101:[0,.44444,0,0,.55361],102:[.19444,.69444,.11042,0,.56806],103:[.19444,.44444,.03704,0,.5449],104:[0,.69444,0,0,.66759],105:[0,.69326,0,0,.4048],106:[.19444,.69326,.0622,0,.47083],107:[0,.69444,.01852,0,.6037],108:[0,.69444,.0088,0,.34815],109:[0,.44444,0,0,1.0324],110:[0,.44444,0,0,.71296],111:[0,.44444,0,0,.58472],112:[.19444,.44444,0,0,.60092],113:[.19444,.44444,.03704,0,.54213],114:[0,.44444,.03194,0,.5287],115:[0,.44444,0,0,.53125],116:[0,.63492,0,0,.41528],117:[0,.44444,0,0,.68102],118:[0,.44444,.03704,0,.56666],119:[0,.44444,.02778,0,.83148],120:[0,.44444,0,0,.65903],121:[.19444,.44444,.03704,0,.59028],122:[0,.44444,.04213,0,.55509],160:[0,0,0,0,.25],915:[0,.68611,.15972,0,.65694],916:[0,.68611,0,0,.95833],920:[0,.68611,.03194,0,.86722],923:[0,.68611,0,0,.80555],926:[0,.68611,.07458,0,.84125],928:[0,.68611,.08229,0,.98229],931:[0,.68611,.05451,0,.88507],933:[0,.68611,.15972,0,.67083],934:[0,.68611,0,0,.76666],936:[0,.68611,.11653,0,.71402],937:[0,.68611,.04835,0,.8789],945:[0,.44444,0,0,.76064],946:[.19444,.69444,.03403,0,.65972],947:[.19444,.44444,.06389,0,.59003],948:[0,.69444,.03819,0,.52222],949:[0,.44444,0,0,.52882],950:[.19444,.69444,.06215,0,.50833],951:[.19444,.44444,.03704,0,.6],952:[0,.69444,.03194,0,.5618],953:[0,.44444,0,0,.41204],954:[0,.44444,0,0,.66759],955:[0,.69444,0,0,.67083],956:[.19444,.44444,0,0,.70787],957:[0,.44444,.06898,0,.57685],958:[.19444,.69444,.03021,0,.50833],959:[0,.44444,0,0,.58472],960:[0,.44444,.03704,0,.68241],961:[.19444,.44444,0,0,.6118],962:[.09722,.44444,.07917   ,0,.42361],963:[0,.44444,.03704,0,.68588],964:[0,.44444,.13472,0,.52083],965:[0,.44444,.03704,0,.63055],966:[.19444,.44444,0,0,.74722],967:[.19444,.44444,0,0,.71805],968:[.19444,.69444,.03704,0,.75833],969:[0,.44444,.03704,0,.71782],977:[0,.69444,0,0,.69155],981:[.19444,.69444,0,0,.7125],982:[0,.44444,.03194,0,.975],1009:[.19444,.44444,0,0,.6118],1013:[0,.44444,0,0,.48333],57649:[0,.44444,0,0,.39352],57911:[.19444,.44444,0,0,.43889]},"Math-Italic":{32:[0,0,0,0,.25],48:[0,.43056,0,0,.5],49:[0,.43056,0,0,.5],50:[0,.43056,0,0,.5],51:[.19444,.43056,0,0,.5],52:[.19444,.43056,0,0,.5],53:[.19444,.43056,0,0,.5],54:[0,.64444,0,0,.5],55:[.19444,.43056,0,0,.5],56:[0,.64444,0,0,.5],57:[.19444,.43056,0,0,.5],65:[0,.68333,0,.13889,.75],66:[0,.68333,.05017,.08334,.75851],67:[0,.68333,.07153,.08334,.71472],68:[0,.68333,.02778,.05556,.82792],69:[0,.68333,.05764,.08334,.7382],70:[0,.68333,.13889,.08334,.64306],71:[0,.68333,0,.08334,.78625],72:[0,.68333,.08125,.05556,.83125],73:[0,.68333,.07847,.11111,.43958],74:[0,.68333,.09618,.16667,.55451],75:[0,.68333,.07153,.05556,.84931],76:[0,.68333,0,.02778,.68056],77:[0,.68333,.10903,.08334,.97014],78:[0,.68333,.10903,.08334,.80347],79:[0,.68333,.02778,.08334,.76278],80:[0,.68333,.13889,.08334,.64201],81:[.19444,.68333,0,.08334,.79056],82:[0,.68333,.00773,.08334,.75929],83:[0,.68333,.05764,.08334,.6132],84:[0,.68333,.13889,.08334,.58438],85:[0,.68333,.10903,.02778,.68278],86:[0,.68333,.22222,0,.58333],87:[0,.68333,.13889,0,.94445],88:[0,.68333,.07847,.08334,.82847],89:[0,.68333,.22222,0,.58056],90:[0,.68333,.07153,.08334,.68264],97:[0,.43056,0,0,.52859],98:[0,.69444,0,0,.42917],99:[0,.43056,0,.05556,.43276],100:[0,.69444,0,.16667,.52049],101:[0,.43056,0,.05556,.46563],102:[.19444,.69444,.10764,.16667,.48959],103:[.19444,.43056,.03588,.02778,.47697],104:[0,.69444,0,0,.57616],105:[0,.65952,0,0,.34451],106:[.19444,.65952,.05724,0,.41181],107:[0,.69444,.03148,0,.5206],108:[0,.69444,.01968,.08334,.29838],109:[0,.43056,0,0,.87801],110:[0,.43056,0,0,.60023],111:[0,.43056,0,.05556,.48472],112:[.19444,.43056,0,.08334,.50313],113:[.19444,.43056,.03588,.08334,.44641],114:[0,.43056,.02778,.05556,.45116],115:[0,.43056,0,.05556,.46875],116:[0,.61508,0,.08334,.36111],117:[0,.43056,0,.02778,.57246],118:[0,.43056,.03588,.02778,.48472],119:[0,.43056,.02691,.08334,.71592],120:[0,.43056,0,.02778,.57153],121:[.19444,.43056,.03588,.05556,.49028],122:[0,.43056,.04398,.05556,.46505],160:[0,0,0,0,.25],915:[0,.68333,.13889,.08334,.61528],916:[0,.68333,0,.16667,.83334],920:[0,.68333,.02778,.08334,.76278],923:[0,.68333,0,.16667,.69445],926:[0,.68333,.07569,.08334,.74236],928:[0,.68333,.08125,.05556,.83125],931:[0,.68333,.05764,.08334,.77986],933:[0,.68333,.13889,.05556,.58333],934:[0,.68333,0,.08334,.66667],936:[0,.68333,.11,.05556,.61222],937:[0,.68333,.05017,.08334,.7724],945:[0,.43056,.0037,.02778,.6397],946:[.19444,.69444,.05278,.08334,.56563],947:[.19444,.43056,.05556,0,.51773],948:[0,.69444,.03785,.05556,.44444],949:[0,.43056,0,.08334,.46632],950:[.19444,.69444,.07378,.08334,.4375],951:[.19444,.43056,.03588,.05556,.49653],952:[0,.69444,.02778,.08334,.46944],953:[0,.43056,0,.05556,.35394],954:[0,.43056,0,0,.57616],955:[0,.69444,0,0,.58334],956:[.19444,.43056,0,.02778,.60255],957:[0,.43056,.06366,.02778,.49398],958:[.19444,.69444,.04601,.11111,.4375],959:[0,.43056,0,.05556,.48472],960:[0,.43056,.03588,0,.57003],961:[.19444,.43056,0,.08334,.51702],962:[.09722,.43056,.07986,.08334,.36285],963:[0,.43056,.03588,0,.57141],964:[0,.43056,.1132,.02778,.43715],965:[0,.43056,.03588,.02778,.54028],966:[.19444,.43056,0,.08334,.65417],967:[.19444,.43056,0,.05556,.62569],968:[.19444,.69444,.03588,.11111,.65139],969:[0,.43056,.03588,0,.62245],977:[0,.69444,0,.08334,.59144],981:[.19444,.69444,0,.08334,.59583],982:[0,.43056,.02778,0,.82813],1009:[.19444,.43056,0,.08334,.51702],1013:[0,.43056,0,.05556,.4059],57649:[0,.43056,0,.02778,.32246],57911:[.19444,.43056,0,.08334,.38403]},"SansSerif-Bold":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.36667],34:[0,.69444,0,0,.55834],35:[.19444,.69444,0,0,.91667],36:[.05556,.75,0,0,.55],37:[.05556,.75,0,0,1.02912],38:[0,.69444,0,0,.83056],39:[0,.69444,0,0,.30556],40:[.25,.75,0,0,.42778],41:[.25,.75,0,0,.42778],42:[0,.75,0,0,.55],43:[.11667,.61667,0,0,.85556],44:[.10556,.13056,0,0,.30556],45:[0,.45833,0,0,.36667],46:[0,.13056,0,0,.30556],47:[.25,.75,0,0,.55],48:[0,.69444,0,0,.55],49:[0,.69444,0,0,.55],50:[0,.69444,0,0,.55],51:[0,.69444,0,0,.55],52:[0,.69444,0,0,.55],53:[0,.69444,0,0,.55],54:[0,.69444,0,0,.55],55:[0,.69444,0,0,.55],56:[0,.69444,0,0,.55],57:[0,.69444,0,0,.55],58:[0,.45833,0,0,.30556],59:[.10556,.45833,0,0,.30556],61:[-.09375,.40625,0,0,.85556],63:[0,.69444,0,0,.51945],64:[0,.69444,0,0,.73334],65:[0,.69444,0,0,.73334],66:[0,.69444,0,0,.73334],67:[0,.69444,0,0,.70278],68:[0,.69444,0,0,.79445],69:[0,.69444,0,0,.64167],70:[0,.69444,0,0,.61111],71:[0,.69444,0,0,.73334],72:[0,.69444,0,0,.79445],73:[0,.69444,0,0,.33056],74:[0,.69444,0,0,.51945],75:[0,.69444,0,0,.76389],76:[0,.69444,0,0,.58056],77:[0,.69444,0,0,.97778],78:[0,.69444,0,0,.79445],79:[0,.69444,0,0,.79445],80:[0,.69444,0,0,.70278],81:[.10556,.69444,0,0,.79445],82:[0,.69444,0,0,.70278],83:[0,.69444,0,0,.61111],84:[0,.69444,0,0,.73334],85:[0,.69444,0,0,.76389],86:[0,.69444,.01528,0,.73334],87:[0,.69444,.01528,0,1.03889],88:[0,.69444,0,0,.73334],89:[0,.69444,.0275,0,.73334],90:[0,.69444,0,0,.67223],91:[.25,.75,0,0,.34306],93:[.25,.75,0,0,.34306],94:[0,.69444,0,0,.55],95:[.35,.10833,.03056,0,.55],97:[0,.45833,0,0,.525],98:[0,.69444,0,0,.56111],99:[0,.45833,0,0,.48889],100:[0,.69444,0,0,.56111],101:[0,.45833,0,0,.51111],102:[0,.69444,.07639,0,.33611],103:[.19444,.45833,.01528,0,.55],104:[0,.69444,0,0,.56111],105:[0,.69444,0,0,.25556],106:[.19444,.69444,0,0,.28611],107:[0,.69444,0,0,.53056],108:[0,.69444,0,0,.25556],109:[0,.45833,0,0,.86667],110:[0,.45833,0,0,.56111],111:[0,.45833,0,0,.55],112:[.19444,.45833,0,0,.56111],113:[.19444,.45833,0,0,.56111],114:[0,.45833,.01528,0,.37222],115:[0,.45833,0,0,.42167],116:[0,.58929,0,0,.40417],117:[0,.45833,0,0,.56111],118:[0,.45833,.01528,0,.5],119:[0,.45833,.01528,0,.74445],120:[0,.45833,0,0,.5],121:[.19444,.45833,.01528,0,.5],122:[0,.45833,0,0,.47639],126:[.35,.34444,0,0,.55],160:[0,0,0,0,.25],168:[0,.69444,0,0,.55],176:[0,.69444,0,0,.73334],180:[0,.69444,0,0,.55],184:[.17014,0,0,0,.48889],305:[0,.45833,0,0,.25556],567:[.19444,.45833,0,0,.28611],710:[0,.69444,0,0,.55],711:[0,.63542,0,0,.55],713:[0,.63778,0,0,.55],728:[0,.69444,0,0,.55],729:[0,.69444,0,0,.30556],730:[0,.69444,0,0,.73334],732:[0,.69444,0,0,.55],733:[0,.69444,0,0,.55],915:[0,.69444,0,0,.58056],916:[0,.69444,0,0,.91667],920:[0,.69444,0,0,.85556],923:[0,.69444,0,0,.67223],926:[0,.69444,0,0,.73334],928:[0,.69444,0,0,.79445],931:[0,.69444,0,0,.79445],933:[0,.69444,0,0,.85556],934:[0,.69444,0,0,.79445],936:[0,.69444,0,0,.85556],937:[0,.69444,0,0,.79445],8211:[0,.45833,.03056,0,.55],8212:[0,.45833,.03056,0,1.10001],8216:[0,.69444,0,0,.30556],8217:[0,.69444,0,0,.30556],8220:[0,.69444,0,0,.55834],8221:[0,.69444,0,0,.55834]},"SansSerif-Italic":{32:[0,0,0,0,.25],33:[0,.69444,.05733,0,.31945],34:[0,.69444,.00316,0,.5],35:[.19444,.69444,.05087,0,.83334],36:[.05556,.75,.11156,0,.5],37:[.05556,.75,.03126,0,.83334],38:[0,.69444,.03058,0,.75834],39:[0,.69444,.07816,0,.27778],40:[.25,.75,.13164,0,.38889],41:[.25,.75,.02536,0,.38889],42:[0,.75,.11775,0,.5],43:[.08333,.58333,.02536,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,.01946,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,.13164,0,.5],48:[0,.65556,.11156,0,.5],49:[0,.65556,.11156,0,.5],50:[0,.65556,.11156,0,.5],51:[0,.65556,.11156,0,.5],52:[0,.65556,.11156,0,.5],53:[0,.65556,.11156,0,.5],54:[0,.65556,.11156,0,.5],55:[0,.65556,.11156,0,.5],56:[0,.65556,.11156,0,.5],57:[0,.65556,.11156,0,.5],58:[0,.44444,.02502,0,.27778],59:[.125,.44444,.02502,0,.27778],61:[-.13,.37,.05087,0,.77778],63:[0,.69444,.11809,0,.47222],64:[0,.69444,.07555,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,.08293,0,.66667],67:[0,.69444,.11983,0,.63889],68:[0,.69444,.07555,0,.72223],69:[0,.69444,.11983,0,.59722],70:[0,.69444,.13372,0,.56945],71:[0,.69444,.11983,0,.66667],72:[0,.69444,.08094,0,.70834],73:[0,.69444,.13372,0,.27778],74:[0,.69444,.08094,0,.47222],75:[0,.69444,.11983,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,.08094,0,.875],78:[0,.69444,.08094,0,.70834],79:[0,.69444,.07555,0,.73611],80:[0,.69444,.08293,0,.63889],81:[.125,.69444,.07555,0,.73611],82:[0,.69444,.08293,0,.64584],83:[0,.69444,.09205,0,.55556],84:[0,.69444,.13372,0,.68056],85:[0,.69444,.08094,0,.6875],86:[0,.69444,.1615,0,.66667],87:[0,.69444,.1615,0,.94445],88:[0,.69444,.13372,0,.66667],89:[0,.69444,.17261,0,.66667],90:[0,.69444,.11983,0,.61111],91:[.25,.75,.15942,0,.28889],93:[.25,.75,.08719,0,.28889],94:[0,.69444,.0799,0,.5],95:[.35,.09444,.08616,0,.5],97:[0,.44444,.00981,0,.48056],98:[0,.69444,.03057,0,.51667],99:[0,.44444,.08336,0,.44445],100:[0,.69444,.09483,0,.51667],101:[0,.44444,.06778,0,.44445],102:[0,.69444,.21705,0,.30556],103:[.19444,.44444,.10836,0,.5],104:[0,.69444,.01778,0,.51667],105:[0,.67937,.09718,0,.23889],106:[.19444,.67937,.09162,0,.26667],107:[0,.69444,.08336,0,.48889],108:[0,.69444,.09483,0,.23889],109:[0,.44444,.01778,0,.79445],110:[0,.44444,.01778,0,.51667],111:[0,.44444,.06613,0,.5],112:[.19444,.44444,.0389,0,.51667],113:[.19444,.44444,.04169,0,.51667],114:[0,.44444,.10836,0,.34167],115:[0,.44444,.0778,0,.38333],116:[0,.57143,.07225,0,.36111],117:[0,.44444,.04169,0,.51667],118:[0,.44444,.10836,0,.46111],119:[0,.44444,.10836,0,.68334],120:[0,.44444,.09169,0,.46111],121:[.19444,.44444,.10836,0,.46111],122:[0,.44444,.08752,0,.43472],126:[.35,.32659,.08826,0,.5],160:[0,0,0,0,.25],168:[0,.67937,.06385,0,.5],176:[0,.69444,0,0,.73752],184:[.17014,0,0,0,.44445],305:[0,.44444,.04169,0,.23889],567:[.19444,.44444,.04169,0,.26667],710:[0,.69444,.0799,0,.5],711:[0,.63194,.08432,0,.5],713:[0,.60889,.08776,0,.5],714:[0,.69444,.09205,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,.09483,0,.5],729:[0,.67937,.07774,0,.27778],730:[0,.69444,0,0,.73752],732:[0,.67659,.08826,0,.5],733:[0,.69444,.09205,0,.5],915:[0,.69444,.13372,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,.07555,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,.12816,0,.66667],928:[0,.69444,.08094,0,.70834],931:[0,.69444,.11983,0,.72222],933:[0,.69444,.09031,0,.77778],934:[0,.69444,.04603,0,.72222],936:[0,.69444,.09031,0,.77778],937:[0,.69444,.08293,0,.72222],8211:[0,.44444,.08616,0,.5],8212:[0,.44444,.08616,0,1],8216:[0,.69444,.07816,0,.27778],8217:[0,.69444,.07816,0,.27778],8220:[0,.69444,.14205,0,.5],8221:[0,.69444,.00316,0,.5]},"SansSerif-Regular":{32:[0,0,0,0,.25],33:[0,.69444,0,0,.31945],34:[0,.69444,0,0,.5],35:[.19444,.69444,0,0,.83334],36:[.05556,.75,0,0,.5],37:[.05556,.75,0,0,.83334],38:[0,.69444,0,0,.75834],39:[0,.69444,0,0,.27778],40:[.25,.75,0,0,.38889],41:[.25,.75,0,0,.38889],42:[0,.75,0,0,.5],43:[.08333,.58333,0,0,.77778],44:[.125,.08333,0,0,.27778],45:[0,.44444,0,0,.33333],46:[0,.08333,0,0,.27778],47:[.25,.75,0,0,.5],48:[0,.65556,0,0,.5],49:[0,.65556,0,0,.5],50:[0,.65556,0,0,.5],51:[0,.65556,0,0,.5],52:[0,.65556,0,0,.5],53:[0,.65556,0,0,.5],54:[0,.65556,0,0,.5],55:[0,.65556,0,0,.5],56:[0,.65556,0,0,.5],57:[0,.65556,0,0,.5],58:[0,.44444,0,0,.27778],59:[.125,.44444,0,0,.27778],61:[-.13,.37,0,0,.77778],63:[0,.69444,0,0,.47222],64:[0,.69444,0,0,.66667],65:[0,.69444,0,0,.66667],66:[0,.69444,0,0,.66667],67:[0,.69444,0,0,.63889],68:[0,.69444,0,0,.72223],69:[0,.69444,0,0,.59722],70:[0,.69444,0,0,.56945],71:[0,.69444,0,0,.66667],72:[0,.69444,0,0,.70834],73:[0,.69444,0,0,.27778],74:[0,.69444,0,0,.47222],75:[0,.69444,0,0,.69445],76:[0,.69444,0,0,.54167],77:[0,.69444,0,0,.875],78:[0,.69444,0,0,.70834],79:[0,.69444,0,0,.73611],80:[0,.69444,0,0,.63889],81:[.125,.69444,0,0,.73611],82:[0,.69444,0,0,.64584],83:[0,.69444,0,0,.55556],84:[0,.69444,0,0,.68056],85:[0,.69444,0,0,.6875],86:[0,.69444,.01389,0,.66667],87:[0,.69444,.01389,0,.94445],88:[0,.69444,0,0,.66667],89:[0,.69444,.025,0,.66667],90:[0,.69444,0,0,.61111],91:[.25,.75,0,0,.28889],93:[.25,.75,0,0,.28889],94:[0,.69444,0,0,.5],95:[.35,.09444,.02778,0,.5],97:[0,.44444,0,0,.48056],98:[0,.69444,0,0,.51667],99:[0,.44444,0,0,.44445],100:[0,.69444,0,0,.51667],101:[0,.44444,0,0,.44445],102:[0,.69444,.06944,0,.30556],103:[.19444,.44444,.01389,0,.5],104:[0,.69444,0,0,.51667],105:[0,.67937,0,0,.23889],106:[.19444,.67937,0,0,.26667],107:[0,.69444,0,0,.48889],108:[0,.69444,0,0,.23889],109:[0,.44444,0,0,.79445],110:[0,.44444,0,0,.51667],111:[0,.44444,0,0,.5],112:[.19444,.44444,0,0,.51667],113:[.19444,.44444,0,0,.51667],114:[0,.44444,.01389,0,.34167],115:[0,.44444,0,0,.38333],116:[0,.57143,0,0,.36111],117:[0,.44444,0,0,.51667],118:[0,.44444,.01389,0,.46111],119:[0,.44444,.01389,0,.68334],120:[0,.44444,0,0,.46111],121:[.19444,.44444,.01389,0,.46111],122:[0,.44444,0,0,.43472],126:[.35,.32659,0,0,.5],160:[0,0,0,0,.25],168:[0,.67937,0,0,.5],176:[0,.69444,0,0,.66667],184:[.17014,0,0,0,.44445],305:[0,.44444,0,0,.23889],567:[.19444,.44444,0,0,.26667],710:[0,.69444,0,0,.5],711:[0,.63194,0,0,.5],713:[0,.60889,0,0,.5],714:[0,.69444,0,0,.5],715:[0,.69444,0,0,.5],728:[0,.69444,0,0,.5],729:[0,.67937,0,0,.27778],730:[0,.69444,0,0,.66667],732:[0,.67659,0,0,.5],733:[0,.69444,0,0,.5],915:[0,.69444,0,0,.54167],916:[0,.69444,0,0,.83334],920:[0,.69444,0,0,.77778],923:[0,.69444,0,0,.61111],926:[0,.69444,0,0,.66667],928:[0,.69444,0,0,.70834],931:[0,.69444,0,0,.72222],933:[0,.69444,0,0,.77778],934:[0,.69444,0,0,.72222],936:[0,.69444,0,0,.77778],937:[0,.69444,0,0,.72222],8211:[0,.44444,.02778,0,.5],8212:[0,.44444,.02778,0,1],8216:[0,.69444,0,0,.27778],8217:[0,.69444,0,0,.27778],8220:[0,.69444,0,0,.5],8221:[0,.69444,0,0,.5]},"Script-Regular":{32:[0,0,0,0,.25],65:[0,.7,.22925,0,.80253],66:[0,.7,.04087,0,.90757],67:[0,.7,.1689,0,.66619],68:[0,.7,.09371,0,.77443],69:[0,.7,.18583,0,.56162],70:[0,.7,.13634,0,.89544],71:[0,.7,.17322,0,.60961],72:[0,.7,.29694,0,.96919],73:[0,.7,.19189,0,.80907],74:[.27778,.7,.19189,0,1.05159],75:[0,.7,.31259,0,.91364],76:[0,.7,.19189,0,.87373],77:[0,.7,.15981,0,1.08031],78:[0,.7,.3525,0,.9015],79:[0,.7,.08078,0,.73787],80:[0,.7,.08078,0,1.01262],81:[0,.7,.03305,0,.88282],82:[0,.7,.06259,0,.85],83:[0,.7,.19189,0,.86767],84:[0,.7,.29087,0,.74697],85:[0,.7,.25815,0,.79996],86:[0,.7,.27523,0,.62204],87:[0,.7,.27523,0,.80532],88:[0,.7,.26006,0,.94445],89:[0,.7,.2939,0,.70961],90:[0,.7,.24037,0,.8212],160:[0,0,0,0,.25]},"Size1-Regular":{32:[0,0,0,0,.25],40:[.35001,.85,0,0,.45834],41:[.35001,.85,0,0,.45834],47:[.35001,.85,0,0,.57778],91:[.35001,.85,0,0,.41667],92:[.35001,.85,0,0,.57778],93:[.35001,.85,0,0,.41667],123:[.35001,.85,0,0,.58334],125:[.35001,.85,0,0,.58334],160:[0,0,0,0,.25],710:[0,.72222,0,0,.55556],732:[0,.72222,0,0,.55556],770:[0,.72222,0,0,.55556],771:[0,.72222,0,0,.55556],8214:[-99e-5,.601,0,0,.77778],8593:[1e-5,.6,0,0,.66667],8595:[1e-5,.6,0,0,.66667],8657:[1e-5,.6,0,0,.77778],8659:[1e-5,.6,0,0,.77778],8719:[.25001,.75,0,0,.94445],8720:[.25001,.75,0,0,.94445],8721:[.25001,.75,0,0,1.05556],8730:[.35001,.85,0,0,1],8739:[-.00599,.606,0,0,.33333],8741:[-.00599,.606,0,0,.55556],8747:[.30612,.805,.19445,0,.47222],8748:[.306,.805,.19445,0,.47222],8749:[.306,.805,.19445,0,.47222],8750:[.30612,.805,.19445,0,.47222],8896:[.25001,.75,0,0,.83334],8897:[.25001,.75,0,0,.83334],8898:[.25001,.75,0,0,.83334],8899:[.25001,.75,0,0,.83334],8968:[.35001,.85,0,0,.47222],8969:[.35001,.85,0,0,.47222],8970:[.35001,.85,0,0,.47222],8971:[.35001,.85,0,0,.47222],9168:[-99e-5,.601,0,0,.66667],10216:[.35001,.85,0,0,.47222],10217:[.35001,.85,0,0,.47222],10752:[.25001,.75,0,0,1.11111],10753:[.25001,.75,0,0,1.11111],10754:[.25001,.75,0,0,1.11111],10756:[.25001,.75,0,0,.83334],10758:[.25001,.75,0,0,.83334]},"Size2-Regular":{32:[0,0,0,0,.25],40:[.65002,1.15,0,0,.59722],41:[.65002,1.15,0,0,.59722],47:[.65002,1.15,0,0,.81111],91:[.65002,1.15,0,0,.47222],92:[.65002,1.15,0,0,.81111],93:[.65002,1.15,0,0,.47222],123:[.65002,1.15,0,0,.66667],125:[.65002,1.15,0,0,.66667],160:[0,0,0,0,.25],710:[0,.75,0,0,1],732:[0,.75,0,0,1],770:[0,.75,0,0,1],771:[0,.75,0,0,1],8719:[.55001,1.05,0,0,1.27778],8720:[.55001,1.05,0,0,1.27778],8721:[.55001,1.05,0,0,1.44445],8730:[.65002,1.15,0,0,1],8747:[.86225,1.36,.44445,0,.55556],8748:[.862,1.36,.44445,0,.55556],8749:[.862,1.36,.44445,0,.55556],8750:[.86225,1.36,.44445,0,.55556],8896:[.55001,1.05,0,0,1.11111],8897:[.55001,1.05,0,0,1.11111],8898:[.55001,1.05,0,0,1.11111],8899:[.55001,1.05,0,0,1.11111],8968:[.65002,1.15,0,0,.52778],8969:[.65002,1.15,0,0,.52778],8970:[.65002,1.15,0,0,.52778],8971:[.65002,1.15,0,0,.52778],10216:[.65002,1.15,0,0,.61111],10217:[.65002,1.15,0,0,.61111],10752:[.55001,1.05,0,0,1.51112],10753:[.55001,1.05,0,0,1.51112],10754:[.55001,1.05,0,0,1.51112],10756:[.55001,1.05,0,0,1.11111],10758:[.55001,1.05,0,0,1.11111]},"Size3-Regular":{32:[0,0,0,0,.25],40:[.95003,1.45,0,0,.73611],41:[.95003,1.45,0,0,.73611],47:[.95003,1.45,0,0,1.04445],91:[.95003,1.45,0,0,.52778],92:[.95003,1.45,0,0,1.04445],93:[.95003,1.45,0,0,.52778],123:[.95003,1.45,0,0,.75],125:[.95003,1.45,0,0,.75],160:[0,0,0,0,.25],710:[0,.75,0,0,1.44445],732:[0,.75,0,0,1.44445],770:[0,.75,0,0,1.44445],771:[0,.75,0,0,1.44445],8730:[.95003,1.45,0,0,1],8968:[.95003,1.45,0,0,.58334],8969:[.95003,1.45,0,0,.58334],8970:[.95003,1.45,0,0,.58334],8971:[.95003,1.45,0,0,.58334],10216:[.95003,1.45,0,0,.75],10217:[.95003,1.45,0,0,.75]},"Size4-Regular":{32:[0,0,0,0,.25],40:[1.25003,1.75,0,0,.79167],41:[1.25003,1.75,0,0,.79167],47:[1.25003,1.75,0,0,1.27778],91:[1.25003,1.75,0,0,.58334],92:[1.25003,1.75,0,0,1.27778],93:[1.25003,1.75,0,0,.58334],123:[1.25003,1.75,0,0,.80556],125:[1.25003,1.75,0,0,.80556],160:[0,0,0,0,.25],710:[0,.825,0,0,1.8889],732:[0,.825,0,0,1.8889],770:[0,.825,0,0,1.8889],771:[0,.825,0,0,1.8889],8730:[1.25003,1.75,0,0,1],8968:[1.25003,1.75,0,0,.63889],8969:[1.25003,1.75,0,0,.63889],8970:[1.25003,1.75,0,0,.63889],8971:[1.25003,1.75,0,0,.63889],9115:[.64502,1.155,0,0,.875],9116:[1e-5,.6,0,0,.875],9117:[.64502,1.155,0,0,.875],9118:[.64502,1.155,0,0,.875],9119:[1e-5,.6,0,0,.875],9120:[.64502,1.155,0,0,.875],9121:[.64502,1.155,0,0,.66667],9122:[-99e-5,.601,0,0,.66667],9123:[.64502,1.155,0,0,.66667],9124:[.64502,1.155,0,0,.66667],9125:[-99e-5,.601,0,0,.66667],9126:[.64502,1.155,0,0,.66667],9127:[1e-5,.9,0,0,.88889],9128:[.65002,1.15,0,0,.88889],9129:[.90001,0,0,0,.88889],9130:[0,.3,0,0,.88889],9131:[1e-5,.9,0,0,.88889],9132:[.65002,1.15,0,0,.88889],9133:[.90001,0,0,0,.88889],9143:[.88502,.915,0,0,1.05556],10216:[1.25003,1.75,0,0,.80556],10217:[1.25003,1.75,0,0,.80556],57344:[-.00499,.605,0,0,1.05556],57345:[-.00499,.605,0,0,1.05556],57680:[0,.12,0,0,.45],57681:[0,.12,0,0,.45],57682:[0,.12,0,0,.45],57683:[0,.12,0,0,.45]},"Typewriter-Regular":{32:[0,0,0,0,.525],33:[0,.61111,0,0,.525],34:[0,.61111,0,0,.525],35:[0,.61111,0,0,.525],36:[.08333,.69444,0,0,.525],37:[.08333,.69444,0,0,.525],38:[0,.61111,0,0,.525],39:[0,.61111,0,0,.525],40:[.08333,.69444,0,0,.525],41:[.08333,.69444,0,0,.525],42:[0,.52083,0,0,.525],43:[-.08056,.53055,0,0,.525],44:[.13889,.125,0,0,.525],45:[-.08056,.53055,0,0,.525],46:[0,.125,0,0,.525],47:[.08333,.69444,0,0,.525],48:[0,.61111,0,0,.525],49:[0,.61111,0,0,.525],50:[0,.61111,0,0,.525],51:[0,.61111,0,0,.525],52:[0,.61111,0,0,.525],53:[0,.61111,0,0,.525],54:[0,.61111,0,0,.525],55:[0,.61111,0,0,.525],56:[0,.61111,0,0,.525],57:[0,.61111,0,0,.525],58:[0,.43056,0,0,.525],59:[.13889,.43056,0,0,.525],60:[-.05556,.55556,0,0,.525],61:[-.19549,.41562,0,0,.525],62:[-.05556,.55556,0,0,.525],63:[0,.61111,0,0,.525],64:[0,.61111,0,0,.525],65:[0,.61111,0,0,.525],66:[0,.61111,0,0,.525],67:[0,.61111,0,0,.525],68:[0,.61111,0,0,.525],69:[0,.61111,0,0,.525],70:[0,.61111,0,0,.525],71:[0,.61111,0,0,.525],72:[0,.61111,0,0,.525],73:[0,.61111,0,0,.525],74:[0,.61111,0,0,.525],75:[0,.61111,0,0,.525],76:[0,.61111,0,0,.525],77:[0,.61111,0,0,.525],78:[0,.61111,0,0,.525],79:[0,.61111,0,0,.525],80:[0,.61111,0,0,.525],81:[.13889,.61111,0,0,.525],82:[0,.61111,0,0,.525],83:[0,.61111,0,0,.525],84:[0,.61111,0,0,.525],85:[0,.61111,0,0,.525],86:[0,.61111,0,0,.525],87:[0,.61111,0,0,.525],88:[0,.61111,0,0,.525],89:[0,.61111,0,0,.525],90:[0,.61111,0,0,.525],91:[.08333,.69444,0,0,.525],92:[.08333,.69444,0,0,.525],93:[.08333,.69444,0,0,.525],94:[0,.61111,0,0,.525],95:[.09514,0,0,0,.525],96:[0,.61111,0,0,.525],97:[0,.43056,0,0,.525],98:[0,.61111,0,0,.525],99:[0,.43056,0,0,.525],100:[0,.61111,0,0,.525],101:[0,.43056,0,0,.525],102:[0,.61111,0,0,.525],103:[.22222,.43056,0,0,.525],104:[0,.61111,0,0,.525],105:[0,.61111,0,0,.525],106:[.22222,.61111,0,0,.525],107:[0,.61111,0,0,.525],108:[0,.61111,0,0,.525],109:[0,.43056,0,0,.525],110:[0,.43056,0,0,.525],111:[0,.43056,0,0,.525],112:[.22222,.43056,0,0,.525],113:[.22222,.43056,0,0,.525],114:[0,.43056,0,0,.525],115:[0,.43056,0,0,.525],116:[0,.55358,0,0,.525],117:[0,.43056,0,0,.525],118:[0,.43056,0,0,.525],119:[0,.43056,0,0,.525],120:[0,.43056,0,0,.525],121:[.22222,.43056,0,0,.525],122:[0,.43056,0,0,.525],123:[.08333,.69444,0,0,.525],124:[.08333,.69444,0,0,.525],125:[.08333,.69444,0,0,.525],126:[0,.61111,0,0,.525],127:[0,.61111,0,0,.525],160:[0,0,0,0,.525],176:[0,.61111,0,0,.525],184:[.19445,0,0,0,.525],305:[0,.43056,0,0,.525],567:[.22222,.43056,0,0,.525],711:[0,.56597,0,0,.525],713:[0,.56555,0,0,.525],714:[0,.61111,0,0,.525],715:[0,.61111,0,0,.525],728:[0,.61111,0,0,.525],730:[0,.61111,0,0,.525],770:[0,.61111,0,0,.525],771:[0,.61111,0,0,.525],776:[0,.61111,0,0,.525],915:[0,.61111,0,0,.525],916:[0,.61111,0,0,.525],920:[0,.61111,0,0,.525],923:[0,.61111,0,0,.525],926:[0,.61111,0,0,.525],928:[0,.61111,0,0,.525],931:[0,.61111,0,0,.525],933:[0,.61111,0,0,.525],934:[0,.61111,0,0,.525],936:[0,.61111,0,0,.525],937:[0,.61111,0,0,.525],8216:[0,.61111,0,0,.525],8217:[0,.61111,0,0,.525],8242:[0,.61111,0,0,.525],9251:[.11111,.21944,0,0,.525]}};const J={slant:[.25,.25,.25],space:[0,0,0],stretch:[0,0,0],shrink:[0,0,0],xHeight:[.431,.431,.431],quad:[1,1.171,1.472],extraSpace:[0,0,0],num1:[.677,.732,.925],num2:[.394,.384,.387],num3:[.444,.471,.504],denom1:[.686,.752,1.025],denom2:[.345,.344,.532],sup1:[.413,.503,.504],sup2:[.363,.431,.404],sup3:[.289,.286,.294],sub1:[.15,.143,.2],sub2:[.247,.286,.4],supDrop:[.386,.353,.494],subDrop:[.05,.071,.1],delim1:[2.39,1.7,1.98],delim2:[1.01,1.157,1.42],axisHeight:[.25,.25,.25],defaultRuleThickness:[.04,.049,.049],bigOpSpacing1:[.111,.111,.111],bigOpSpacing2:[.166,.166,.166],bigOpSpacing3:[.2,.2,.2],bigOpSpacing4:[.6,.611,.611],bigOpSpacing5:[.1,.143,.143],sqrtRuleThickness:[.04,.04,.04],ptPerEm:[10,10,10],doubleRuleSep:[.2,.2,.2],arrayRuleWidth:[.04,.04,.04],fboxsep:[.3,.3,.3],fboxrule:[.04,.04,.04]},Q={"\xc5":"A","\xd0":"D","\xde":"o","\xe5":"a","\xf0":"d","\xfe":"o","\u0410":"A","\u0411":"B","\u0412":"B","\u0413":"F","\u0414":"A","\u0415":"E","\u0416":"K","\u0417":"3","\u0418":"N","\u0419":"N","\u041a":"K","\u041b":"N","\u041c":"M","\u041d":"H","\u041e":"O","\u041f":"N","\u0420":"P","\u0421":"C","\u0422":"T","\u0423":"y","\u0424":"O","\u0425":"X","\u0426":"U","\u0427":"h","\u0428":"W","\u0429":"W","\u042a":"B","\u042b":"X","\u042c":"B","\u042d":"3","\u042e":"X","\u042f":"R","\u0430":"a","\u0431":"b","\u0432":"a","\u0433":"r","\u0434":"y","\u0435":"e","\u0436":"m","\u0437":"e","\u0438":"n","\u0439":"n","\u043a":"n","\u043b":"n","\u043c":"m","\u043d":"n","\u043e":"o","\u043f":"n","\u0440":"p","\u0441":"c","\u0442":"o","\u0443":"y","\u0444":"b","\u0445":"x","\u0446":"n","\u0447":"n","\u0448":"w","\u0449":"w","\u044a":"a","\u044b":"m","\u044c":"a","\u044d":"e","\u044e":"m","\u044f":"r"};function ee(e,t,r){if(!K[t])throw new Error("Font metrics not found for font: "+t+".");let n=e.charCodeAt(0),o=K[t][n];if(!o&&e[0]in Q&&(n=Q[e[0]].charCodeAt(0),o=K[t][n]),o||"text"!==r||T(n)&&(o=K[t][77]),o)return{depth:o[0],height:o[1],italic:o[2],skew:o[3],width:o[4]}}const te={};const re={math:{},text:{}};var ne=re;function oe(e,t,r,n,o,s){re[e][o]={font:t,group:r,replace:n},s&&n&&(re[e][n]=re[e][o])}const se="math",ie="text",le="main",ae="ams",ce="accent-token",he="bin",me="close",ue="inner",pe="mathord",de="op-token",ge="open",fe="punct",be="rel",ye="spacing",xe="textord";oe(se,le,be,"\u2261","\\equiv",!0),oe(se,le,be,"\u227a","\\prec",!0),oe(se,le,be,"\u227b","\\succ",!0),oe(se,le,be,"\u223c","\\sim",!0),oe(se,le,be,"\u22a5","\\perp"),oe(se,le,be,"\u2aaf","\\preceq",!0),oe(se,le,be,"\u2ab0","\\succeq",!0),oe(se,le,be,"\u2243","\\simeq",!0),oe(se,le,be,"\u2223","\\mid",!0),oe(se,le,be,"\u226a","\\ll",!0),oe(se,le,be,"\u226b","\\gg",!0),oe(se,le,be,"\u224d","\\asymp",!0),oe(se,le,be,"\u2225","\\parallel"),oe(se,le,be,"\u22c8","\\bowtie",!0),oe(se,le,be,"\u2323","\\smile",!0),oe(se,le,be,"\u2291","\\sqsubseteq",!0),oe(se,le,be,"\u2292","\\sqsupseteq",!0),oe(se,le,be,"\u2250","\\doteq",!0),oe(se,le,be,"\u2322","\\frown",!0),oe(se,le,be,"\u220b","\\ni",!0),oe(se,le,be,"\u221d","\\propto",!0),oe(se,le,be,"\u22a2","\\vdash",!0),oe(se,le,be,"\u22a3","\\dashv",!0),oe(se,le,be,"\u220b","\\owns"),oe(se,le,fe,".","\\ldotp"),oe(se,le,fe,"\u22c5","\\cdotp"),oe(se,le,fe,"\u22c5","\xb7"),oe(ie,le,xe,"\u22c5","\xb7"),oe(se,le,xe,"#","\\#"),oe(ie,le,xe,"#","\\#"),oe(se,le,xe,"&","\\&"),oe(ie,le,xe,"&","\\&"),oe(se,le,xe,"\u2135","\\aleph",!0),oe(se,le,xe,"\u2200","\\forall",!0),oe(se,le,xe,"\u210f","\\hbar",!0),oe(se,le,xe,"\u2203","\\exists",!0),oe(se,le,xe,"\u2207","\\nabla",!0),oe(se,le,xe,"\u266d","\\flat",!0),oe(se,le,xe,"\u2113","\\ell",!0),oe(se,le,xe,"\u266e","\\natural",!0),oe(se,le,xe,"\u2663","\\clubsuit",!0),oe(se,le,xe,"\u2118","\\wp",!0),oe(se,le,xe,"\u266f","\\sharp",!0),oe(se,le,xe,"\u2662","\\diamondsuit",!0),oe(se,le,xe,"\u211c","\\Re",!0),oe(se,le,xe,"\u2661","\\heartsuit",!0),oe(se,le,xe,"\u2111","\\Im",!0),oe(se,le,xe,"\u2660","\\spadesuit",!0),oe(se,le,xe,"\xa7","\\S",!0),oe(ie,le,xe,"\xa7","\\S"),oe(se,le,xe,"\xb6","\\P",!0),oe(ie,le,xe,"\xb6","\\P"),oe(se,le,xe,"\u2020","\\dag"),oe(ie,le,xe,"\u2020","\\dag"),oe(ie,le,xe,"\u2020","\\textdagger"),oe(se,le,xe,"\u2021","\\ddag"),oe(ie,le,xe,"\u2021","\\ddag"),oe(ie,le,xe,"\u2021","\\textdaggerdbl"),oe(se,le,me,"\u23b1","\\rmoustache",!0),oe(se,le,ge,"\u23b0","\\lmoustache",!0),oe(se,le,me,"\u27ef","\\rgroup",!0),oe(se,le,ge,"\u27ee","\\lgroup",!0),oe(se,le,he,"\u2213","\\mp",!0),oe(se,le,he,"\u2296","\\ominus",!0),oe(se,le,he,"\u228e","\\uplus",!0),oe(se,le,he,"\u2293","\\sqcap",!0),oe(se,le,he,"\u2217","\\ast"),oe(se,le,he,"\u2294","\\sqcup",!0),oe(se,le,he,"\u25ef","\\bigcirc",!0),oe(se,le,he,"\u2219","\\bullet",!0),oe(se,le,he,"\u2021","\\ddagger"),oe(se,le,he,"\u2240","\\wr",!0),oe(se,le,he,"\u2a3f","\\amalg"),oe(se,le,he,"&","\\And"),oe(se,le,be,"\u27f5","\\longleftarrow",!0),oe(se,le,be,"\u21d0","\\Leftarrow",!0),oe(se,le,be,"\u27f8","\\Longleftarrow",!0),oe(se,le,be,"\u27f6","\\longrightarrow",!0),oe(se,le,be,"\u21d2","\\Rightarrow",!0),oe(se,le,be,"\u27f9","\\Longrightarrow",!0),oe(se,le,be,"\u2194","\\leftrightarrow",!0),oe(se,le,be,"\u27f7","\\longleftrightarrow",!0),oe(se,le,be,"\u21d4","\\Leftrightarrow",!0),oe(se,le,be,"\u27fa","\\Longleftrightarrow",!0),oe(se,le,be,"\u21a6","\\mapsto",!0),oe(se,le,be,"\u27fc","\\longmapsto",!0),oe(se,le,be,"\u2197","\\nearrow",!0),oe(se,le,be,"\u21a9","\\hookleftarrow",!0),oe(se,le,be,"\u21aa","\\hookrightarrow",!0),oe(se,le,be,"\u2198","\\searrow",!0),oe(se,le,be,"\u21bc","\\leftharpoonup",!0),oe(se,le,be,"\u21c0","\\rightharpoonup",!0),oe(se,le,be,"\u2199","\\swarrow",!0),oe(se,le,be,"\u21bd","\\leftharpoondown",!0),oe(se,le,be,"\u21c1","\\rightharpoondown",!0),oe(se,le,be,"\u2196","\\nwarrow",!0),oe(se,le,be,"\u21cc","\\rightleftharpoons",!0),oe(se,ae,be,"\u226e","\\nless",!0),oe(se,ae,be,"\ue010","\\@nleqslant"),oe(se,ae,be,"\ue011","\\@nleqq"),oe(se,ae,be,"\u2a87","\\lneq",!0),oe(se,ae,be,"\u2268","\\lneqq",!0),oe(se,ae,be,"\ue00c","\\@lvertneqq"),oe(se,ae,be,"\u22e6","\\lnsim",!0),oe(se,ae,be,"\u2a89","\\lnapprox",!0),oe(se,ae,be,"\u2280","\\nprec",!0),oe(se,ae,be,"\u22e0","\\npreceq",!0),oe(se,ae,be,"\u22e8","\\precnsim",!0),oe(se,ae,be,"\u2ab9","\\precnapprox",!0),oe(se,ae,be,"\u2241","\\nsim",!0),oe(se,ae,be,"\ue006","\\@nshortmid"),oe(se,ae,be,"\u2224","\\nmid",!0),oe(se,ae,be,"\u22ac","\\nvdash",!0),oe(se,ae,be,"\u22ad","\\nvDash",!0),oe(se,ae,be,"\u22ea","\\ntriangleleft"),oe(se,ae,be,"\u22ec","\\ntrianglelefteq",!0),oe(se,ae,be,"\u228a","\\subsetneq",!0),oe(se,ae,be,"\ue01a","\\@varsubsetneq"),oe(se,ae,be,"\u2acb","\\subsetneqq",!0),oe(se,ae,be,"\ue017","\\@varsubsetneqq"),oe(se,ae,be,"\u226f","\\ngtr",!0),oe(se,ae,be,"\ue00f","\\@ngeqslant"),oe(se,ae,be,"\ue00e","\\@ngeqq"),oe(se,ae,be,"\u2a88","\\gneq",!0),oe(se,ae,be,"\u2269","\\gneqq",!0),oe(se,ae,be,"\ue00d","\\@gvertneqq"),oe(se,ae,be,"\u22e7","\\gnsim",!0),oe(se,ae,be,"\u2a8a","\\gnapprox",!0),oe(se,ae,be,"\u2281","\\nsucc",!0),oe(se,ae,be,"\u22e1","\\nsucceq",!0),oe(se,ae,be,"\u22e9","\\succnsim",!0),oe(se,ae,be,"\u2aba","\\succnapprox",!0),oe(se,ae,be,"\u2246","\\ncong",!0),oe(se,ae,be,"\ue007","\\@nshortparallel"),oe(se,ae,be,"\u2226","\\nparallel",!0),oe(se,ae,be,"\u22af","\\nVDash",!0),oe(se,ae,be,"\u22eb","\\ntriangleright"),oe(se,ae,be,"\u22ed","\\ntrianglerighteq",!0),oe(se,ae,be,"\ue018","\\@nsupseteqq"),oe(se,ae,be,"\u228b","\\supsetneq",!0),oe(se,ae,be,"\ue01b","\\@varsupsetneq"),oe(se,ae,be,"\u2acc","\\supsetneqq",!0),oe(se,ae,be,"\ue019","\\@varsupsetneqq"),oe(se,ae,be,"\u22ae","\\nVdash",!0),oe(se,ae,be,"\u2ab5","\\precneqq",!0),oe(se,ae,be,"\u2ab6","\\succneqq",!0),oe(se,ae,be,"\ue016","\\@nsubseteqq"),oe(se,ae,he,"\u22b4","\\unlhd"),oe(se,ae,he,"\u22b5","\\unrhd"),oe(se,ae,be,"\u219a","\\nleftarrow",!0),oe(se,ae,be,"\u219b","\\nrightarrow",!0),oe(se,ae,be,"\u21cd","\\nLeftarrow",!0),oe(se,ae,be,"\u21cf","\\nRightarrow",!0),oe(se,ae,be,"\u21ae","\\nleftrightarrow",!0),oe(se,ae,be,"\u21ce","\\nLeftrightarrow",!0),oe(se,ae,be,"\u25b3","\\vartriangle"),oe(se,ae,xe,"\u210f","\\hslash"),oe(se,ae,xe,"\u25bd","\\triangledown"),oe(se,ae,xe,"\u25ca","\\lozenge"),oe(se,ae,xe,"\u24c8","\\circledS"),oe(se,ae,xe,"\xae","\\circledR"),oe(ie,ae,xe,"\xae","\\circledR"),oe(se,ae,xe,"\u2221","\\measuredangle",!0),oe(se,ae,xe,"\u2204","\\nexists"),oe(se,ae,xe,"\u2127","\\mho"),oe(se,ae,xe,"\u2132","\\Finv",!0),oe(se,ae,xe,"\u2141","\\Game",!0),oe(se,ae,xe,"\u2035","\\backprime"),oe(se,ae,xe,"\u25b2","\\blacktriangle"),oe(se,ae,xe,"\u25bc","\\blacktriangledown"),oe(se,ae,xe,"\u25a0","\\blacksquare"),oe(se,ae,xe,"\u29eb","\\blacklozenge"),oe(se,ae,xe,"\u2605","\\bigstar"),oe(se,ae,xe,"\u2222","\\sphericalangle",!0),oe(se,ae,xe,"\u2201","\\complement",!0),oe(se,ae,xe,"\xf0","\\eth",!0),oe(ie,le,xe,"\xf0","\xf0"),oe(se,ae,xe,"\u2571","\\diagup"),oe(se,ae,xe,"\u2572","\\diagdown"),oe(se,ae,xe,"\u25a1","\\square"),oe(se,ae,xe,"\u25a1","\\Box"),oe(se,ae,xe,"\u25ca","\\Diamond"),oe(se,ae,xe,"\xa5","\\yen",!0),oe(ie,ae,xe,"\xa5","\\yen",!0),oe(se,ae,xe,"\u2713","\\checkmark",!0),oe(ie,ae,xe,"\u2713","\\checkmark"),oe(se,ae,xe,"\u2136","\\beth",!0),oe(se,ae,xe,"\u2138","\\daleth",!0),oe(se,ae,xe,"\u2137","\\gimel",!0),oe(se,ae,xe,"\u03dd","\\digamma",!0),oe(se,ae,xe,"\u03f0","\\varkappa"),oe(se,ae,ge,"\u250c","\\@ulcorner",!0),oe(se,ae,me,"\u2510","\\@urcorner",!0),oe(se,ae,ge,"\u2514","\\@llcorner",!0),oe(se,ae,me,"\u2518","\\@lrcorner",!0),oe(se,ae,be,"\u2266","\\leqq",!0),oe(se,ae,be,"\u2a7d","\\leqslant",!0),oe(se,ae,be,"\u2a95","\\eqslantless",!0),oe(se,ae,be,"\u2272","\\lesssim",!0),oe(se,ae,be,"\u2a85","\\lessapprox",!0),oe(se,ae,be,"\u224a","\\approxeq",!0),oe(se,ae,he,"\u22d6","\\lessdot"),oe(se,ae,be,"\u22d8","\\lll",!0),oe(se,ae,be,"\u2276","\\lessgtr",!0),oe(se,ae,be,"\u22da","\\lesseqgtr",!0),oe(se,ae,be,"\u2a8b","\\lesseqqgtr",!0),oe(se,ae,be,"\u2251","\\doteqdot"),oe(se,ae,be,"\u2253","\\risingdotseq",!0),oe(se,ae,be,"\u2252","\\fallingdotseq",!0),oe(se,ae,be,"\u223d","\\backsim",!0),oe(se,ae,be,"\u22cd","\\backsimeq",!0),oe(se,ae,be,"\u2ac5","\\subseteqq",!0),oe(se,ae,be,"\u22d0","\\Subset",!0),oe(se,ae,be,"\u228f","\\sqsubset",!0),oe(se,ae,be,"\u227c","\\preccurlyeq",!0),oe(se,ae,be,"\u22de","\\curlyeqprec",!0),oe(se,ae,be,"\u227e","\\precsim",!0),oe(se,ae,be,"\u2ab7","\\precapprox",!0),oe(se,ae,be,"\u22b2","\\vartriangleleft"),oe(se,ae,be,"\u22b4","\\trianglelefteq"),oe(se,ae,be,"\u22a8","\\vDash",!0),oe(se,ae,be,"\u22aa","\\Vvdash",!0),oe(se,ae,be,"\u2323","\\smallsmile"),oe(se,ae,be,"\u2322","\\smallfrown"),oe(se,ae,be,"\u224f","\\bumpeq",!0),oe(se,ae,be,"\u224e","\\Bumpeq",!0),oe(se,ae,be,"\u2267","\\geqq",!0),oe(se,ae,be,"\u2a7e","\\geqslant",!0),oe(se,ae,be,"\u2a96","\\eqslantgtr",!0),oe(se,ae,be,"\u2273","\\gtrsim",!0),oe(se,ae,be,"\u2a86","\\gtrapprox",!0),oe(se,ae,he,"\u22d7","\\gtrdot"),oe(se,ae,be,"\u22d9","\\ggg",!0),oe(se,ae,be,"\u2277","\\gtrless",!0),oe(se,ae,be,"\u22db","\\gtreqless",!0),oe(se,ae,be,"\u2a8c","\\gtreqqless",!0),oe(se,ae,be,"\u2256","\\eqcirc",!0),oe(se,ae,be,"\u2257","\\circeq",!0),oe(se,ae,be,"\u225c","\\triangleq",!0),oe(se,ae,be,"\u223c","\\thicksim"),oe(se,ae,be,"\u2248","\\thickapprox"),oe(se,ae,be,"\u2ac6","\\supseteqq",!0),oe(se,ae,be,"\u22d1","\\Supset",!0),oe(se,ae,be,"\u2290","\\sqsupset",!0),oe(se,ae,be,"\u227d","\\succcurlyeq",!0),oe(se,ae,be,"\u22df","\\curlyeqsucc",!0),oe(se,ae,be,"\u227f","\\succsim",!0),oe(se,ae,be,"\u2ab8","\\succapprox",!0),oe(se,ae,be,"\u22b3","\\vartriangleright"),oe(se,ae,be,"\u22b5","\\trianglerighteq"),oe(se,ae,be,"\u22a9","\\Vdash",!0),oe(se,ae,be,"\u2223","\\shortmid"),oe(se,ae,be,"\u2225","\\shortparallel"),oe(se,ae,be,"\u226c","\\between",!0),oe(se,ae,be,"\u22d4","\\pitchfork",!0),oe(se,ae,be,"\u221d","\\varpropto"),oe(se,ae,be,"\u25c0","\\blacktriangleleft"),oe(se,ae,be,"\u2234","\\therefore",!0),oe(se,ae,be,"\u220d","\\backepsilon"),oe(se,ae,be,"\u25b6","\\blacktriangleright"),oe(se,ae,be,"\u2235","\\because",!0),oe(se,ae,be,"\u22d8","\\llless"),oe(se,ae,be,"\u22d9","\\gggtr"),oe(se,ae,he,"\u22b2","\\lhd"),oe(se,ae,he,"\u22b3","\\rhd"),oe(se,ae,be,"\u2242","\\eqsim",!0),oe(se,le,be,"\u22c8","\\Join"),oe(se,ae,be,"\u2251","\\Doteq",!0),oe(se,ae,he,"\u2214","\\dotplus",!0),oe(se,ae,he,"\u2216","\\smallsetminus"),oe(se,ae,he,"\u22d2","\\Cap",!0),oe(se,ae,he,"\u22d3","\\Cup",!0),oe(se,ae,he,"\u2a5e","\\doublebarwedge",!0),oe(se,ae,he,"\u229f","\\boxminus",!0),oe(se,ae,he,"\u229e","\\boxplus",!0),oe(se,ae,he,"\u22c7","\\divideontimes",!0),oe(se,ae,he,"\u22c9","\\ltimes",!0),oe(se,ae,he,"\u22ca","\\rtimes",!0),oe(se,ae,he,"\u22cb","\\leftthreetimes",!0),oe(se,ae,he,"\u22cc","\\rightthreetimes",!0),oe(se,ae,he,"\u22cf","\\curlywedge",!0),oe(se,ae,he,"\u22ce","\\curlyvee",!0),oe(se,ae,he,"\u229d","\\circleddash",!0),oe(se,ae,he,"\u229b","\\circledast",!0),oe(se,ae,he,"\u22c5","\\centerdot"),oe(se,ae,he,"\u22ba","\\intercal",!0),oe(se,ae,he,"\u22d2","\\doublecap"),oe(se,ae,he,"\u22d3","\\doublecup"),oe(se,ae,he,"\u22a0","\\boxtimes",!0),oe(se,ae,be,"\u21e2","\\dashrightarrow",!0),oe(se,ae,be,"\u21e0","\\dashleftarrow",!0),oe(se,ae,be,"\u21c7","\\leftleftarrows",!0),oe(se,ae,be,"\u21c6","\\leftrightarrows",!0),oe(se,ae,be,"\u21da","\\Lleftarrow",!0),oe(se,ae,be,"\u219e","\\twoheadleftarrow",!0),oe(se,ae,be,"\u21a2","\\leftarrowtail",!0),oe(se,ae,be,"\u21ab","\\looparrowleft",!0),oe(se,ae,be,"\u21cb","\\leftrightharpoons",!0),oe(se,ae,be,"\u21b6","\\curvearrowleft",!0),oe(se,ae,be,"\u21ba","\\circlearrowleft",!0),oe(se,ae,be,"\u21b0","\\Lsh",!0),oe(se,ae,be,"\u21c8","\\upuparrows",!0),oe(se,ae,be,"\u21bf","\\upharpoonleft",!0),oe(se,ae,be,"\u21c3","\\downharpoonleft",!0),oe(se,le,be,"\u22b6","\\origof",!0),oe(se,le,be,"\u22b7","\\imageof",!0),oe(se,ae,be,"\u22b8","\\multimap",!0),oe(se,ae,be,"\u21ad","\\leftrightsquigarrow",!0),oe(se,ae,be,"\u21c9","\\rightrightarrows",!0),oe(se,ae,be,"\u21c4","\\rightleftarrows",!0),oe(se,ae,be,"\u21a0","\\twoheadrightarrow",!0),oe(se,ae,be,"\u21a3","\\rightarrowtail",!0),oe(se,ae,be,"\u21ac","\\looparrowright",!0),oe(se,ae,be,"\u21b7","\\curvearrowright",!0),oe(se,ae,be,"\u21bb","\\circlearrowright",!0),oe(se,ae,be,"\u21b1","\\Rsh",!0),oe(se,ae,be,"\u21ca","\\downdownarrows",!0),oe(se,ae,be,"\u21be","\\upharpoonright",!0),oe(se,ae,be,"\u21c2","\\downharpoonright",!0),oe(se,ae,be,"\u21dd","\\rightsquigarrow",!0),oe(se,ae,be,"\u21dd","\\leadsto"),oe(se,ae,be,"\u21db","\\Rrightarrow",!0),oe(se,ae,be,"\u21be","\\restriction"),oe(se,le,xe,"\u2018","`"),oe(se,le,xe,"$","\\$"),oe(ie,le,xe,"$","\\$"),oe(ie,le,xe,"$","\\textdollar"),oe(se,le,xe,"%","\\%"),oe(ie,le,xe,"%","\\%"),oe(se,le,xe,"_","\\_"),oe(ie,le,xe,"_","\\_"),oe(ie,le,xe,"_","\\textunderscore"),oe(se,le,xe,"\u2220","\\angle",!0),oe(se,le,xe,"\u221e","\\infty",!0),oe(se,le,xe,"\u2032","\\prime"),oe(se,le,xe,"\u25b3","\\triangle"),oe(se,le,xe,"\u0393","\\Gamma",!0),oe(se,le,xe,"\u0394","\\Delta",!0),oe(se,le,xe,"\u0398","\\Theta",!0),oe(se,le,xe,"\u039b","\\Lambda",!0),oe(se,le,xe,"\u039e","\\Xi",!0),oe(se,le,xe,"\u03a0","\\Pi",!0),oe(se,le,xe,"\u03a3","\\Sigma",!0),oe(se,le,xe,"\u03a5","\\Upsilon",!0),oe(se,le,xe,"\u03a6","\\Phi",!0),oe(se,le,xe,"\u03a8","\\Psi",!0),oe(se,le,xe,"\u03a9","\\Omega",!0),oe(se,le,xe,"A","\u0391"),oe(se,le,xe,"B","\u0392"),oe(se,le,xe,"E","\u0395"),oe(se,le,xe,"Z","\u0396"),oe(se,le,xe,"H","\u0397"),oe(se,le,xe,"I","\u0399"),oe(se,le,xe,"K","\u039a"),oe(se,le,xe,"M","\u039c"),oe(se,le,xe,"N","\u039d"),oe(se,le,xe,"O","\u039f"),oe(se,le,xe,"P","\u03a1"),oe(se,le,xe,"T","\u03a4"),oe(se,le,xe,"X","\u03a7"),oe(se,le,xe,"\xac","\\neg",!0),oe(se,le,xe,"\xac","\\lnot"),oe(se,le,xe,"\u22a4","\\top"),oe(se,le,xe,"\u22a5","\\bot"),oe(se,le,xe,"\u2205","\\emptyset"),oe(se,ae,xe,"\u2205","\\varnothing"),oe(se,le,pe,"\u03b1","\\alpha",!0),oe(se,le,pe,"\u03b2","\\beta",!0),oe(se,le,pe,"\u03b3","\\gamma",!0),oe(se,le,pe,"\u03b4","\\delta",!0),oe(se,le,pe,"\u03f5","\\epsilon",!0),oe(se,le,pe,"\u03b6","\\zeta",!0),oe(se,le,pe,"\u03b7","\\eta",!0),oe(se,le,pe,"\u03b8","\\theta",!0),oe(se,le,pe,"\u03b9","\\iota",!0),oe(se,le,pe,"\u03ba","\\kappa",!0),oe(se,le,pe,"\u03bb","\\lambda",!0),oe(se,le,pe,"\u03bc","\\mu",!0),oe(se,le,pe,"\u03bd","\\nu",!0),oe(se,le,pe,"\u03be","\\xi",!0),oe(se,le,pe,"\u03bf","\\omicron",!0),oe(se,le,pe,"\u03c0","\\pi",!0),oe(se,le,pe,"\u03c1","\\rho",!0),oe(se,le,pe,"\u03c3","\\sigma",!0),oe(se,le,pe,"\u03c4","\\tau",!0),oe(se,le,pe,"\u03c5","\\upsilon",!0),oe(se,le,pe,"\u03d5","\\phi",!0),oe(se,le,pe,"\u03c7","\\chi",!0),oe(se,le,pe,"\u03c8","\\psi",!0),oe(se,le,pe,"\u03c9","\\omega",!0),oe(se,le,pe,"\u03b5","\\varepsilon",!0),oe(se,le,pe,"\u03d1","\\vartheta",!0),oe(se,le,pe,"\u03d6","\\varpi",!0),oe(se,le,pe,"\u03f1","\\varrho",!0),oe(se,le,pe,"\u03c2","\\varsigma",!0),oe(se,le,pe,"\u03c6","\\varphi",!0),oe(se,le,he,"\u2217","*",!0),oe(se,le,he,"+","+"),oe(se,le,he,"\u2212","-",!0),oe(se,le,he,"\u22c5","\\cdot",!0),oe(se,le,he,"\u2218","\\circ",!0),oe(se,le,he,"\xf7","\\div",!0),oe(se,le,he,"\xb1","\\pm",!0),oe(se,le,he,"\xd7","\\times",!0),oe(se,le,he,"\u2229","\\cap",!0),oe(se,le,he,"\u222a","\\cup",!0),oe(se,le,he,"\u2216","\\setminus",!0),oe(se,le,he,"\u2227","\\land"),oe(se,le,he,"\u2228","\\lor"),oe(se,le,he,"\u2227","\\wedge",!0),oe(se,le,he,"\u2228","\\vee",!0),oe(se,le,xe,"\u221a","\\surd"),oe(se,le,ge,"\u27e8","\\langle",!0),oe(se,le,ge,"\u2223","\\lvert"),oe(se,le,ge,"\u2225","\\lVert"),oe(se,le,me,"?","?"),oe(se,le,me,"!","!"),oe(se,le,me,"\u27e9","\\rangle",!0),oe(se,le,me,"\u2223","\\rvert"),oe(se,le,me,"\u2225","\\rVert"),oe(se,le,be,"=","="),oe(se,le,be,":",":"),oe(se,le,be,"\u2248","\\approx",!0),oe(se,le,be,"\u2245","\\cong",!0),oe(se,le,be,"\u2265","\\ge"),oe(se,le,be,"\u2265","\\geq",!0),oe(se,le,be,"\u2190","\\gets"),oe(se,le,be,">","\\gt",!0),oe(se,le,be,"\u2208","\\in",!0),oe(se,le,be,"\ue020","\\@not"),oe(se,le,be,"\u2282","\\subset",!0),oe(se,le,be,"\u2283","\\supset",!0),oe(se,le,be,"\u2286","\\subseteq",!0),oe(se,le,be,"\u2287","\\supseteq",!0),oe(se,ae,be,"\u2288","\\nsubseteq",!0),oe(se,ae,be,"\u2289","\\nsupseteq",!0),oe(se,le,be,"\u22a8","\\models"),oe(se,le,be,"\u2190","\\leftarrow",!0),oe(se,le,be,"\u2264","\\le"),oe(se,le,be,"\u2264","\\leq",!0),oe(se,le,be,"<","\\lt",!0),oe(se,le,be,"\u2192","\\rightarrow",!0),oe(se,le,be,"\u2192","\\to"),oe(se,ae,be,"\u2271","\\ngeq",!0),oe(se,ae,be,"\u2270","\\nleq",!0),oe(se,le,ye,"\xa0","\\ "),oe(se,le,ye,"\xa0","\\space"),oe(se,le,ye,"\xa0","\\nobreakspace"),oe(ie,le,ye,"\xa0","\\ "),oe(ie,le,ye,"\xa0"," "),oe(ie,le,ye,"\xa0","\\space"),oe(ie,le,ye,"\xa0","\\nobreakspace"),oe(se,le,ye,"","\\nobreak"),oe(se,le,ye,"","\\allowbreak"),oe(se,le,fe,",",","),oe(se,le,fe,";",";"),oe(se,ae,he,"\u22bc","\\barwedge",!0),oe(se,ae,he,"\u22bb","\\veebar",!0),oe(se,le,he,"\u2299","\\odot",!0),oe(se,le,he,"\u2295","\\oplus",!0),oe(se,le,he,"\u2297","\\otimes",!0),oe(se,le,xe,"\u2202","\\partial",!0),oe(se,le,he,"\u2298","\\oslash",!0),oe(se,ae,he,"\u229a","\\circledcirc",!0),oe(se,ae,he,"\u22a1","\\boxdot",!0),oe(se,le,he,"\u25b3","\\bigtriangleup"),oe(se,le,he,"\u25bd","\\bigtriangledown"),oe(se,le,he,"\u2020","\\dagger"),oe(se,le,he,"\u22c4","\\diamond"),oe(se,le,he,"\u22c6","\\star"),oe(se,le,he,"\u25c3","\\triangleleft"),oe(se,le,he,"\u25b9","\\triangleright"),oe(se,le,ge,"{","\\{"),oe(ie,le,xe,"{","\\{"),oe(ie,le,xe,"{","\\textbraceleft"),oe(se,le,me,"}","\\}"),oe(ie,le,xe,"}","\\}"),oe(ie,le,xe,"}","\\textbraceright"),oe(se,le,ge,"{","\\lbrace"),oe(se,le,me,"}","\\rbrace"),oe(se,le,ge,"[","\\lbrack",!0),oe(ie,le,xe,"[","\\lbrack",!0),oe(se,le,me,"]","\\rbrack",!0),oe(ie,le,xe,"]","\\rbrack",!0),oe(se,le,ge,"(","\\lparen",!0),oe(se,le,me,")","\\rparen",!0),oe(ie,le,xe,"<","\\textless",!0),oe(ie,le,xe,">","\\textgreater",!0),oe(se,le,ge,"\u230a","\\lfloor",!0),oe(se,le,me,"\u230b","\\rfloor",!0),oe(se,le,ge,"\u2308","\\lceil",!0),oe(se,le,me,"\u2309","\\rceil",!0),oe(se,le,xe,"\\","\\backslash"),oe(se,le,xe,"\u2223","|"),oe(se,le,xe,"\u2223","\\vert"),oe(ie,le,xe,"|","\\textbar",!0),oe(se,le,xe,"\u2225","\\|"),oe(se,le,xe,"\u2225","\\Vert"),oe(ie,le,xe,"\u2225","\\textbardbl"),oe(ie,le,xe,"~","\\textasciitilde"),oe(ie,le,xe,"\\","\\textbackslash"),oe(ie,le,xe,"^","\\textasciicircum"),oe(se,le,be,"\u2191","\\uparrow",!0),oe(se,le,be,"\u21d1","\\Uparrow",!0),oe(se,le,be,"\u2193","\\downarrow",!0),oe(se,le,be,"\u21d3","\\Downarrow",!0),oe(se,le,be,"\u2195","\\updownarrow",!0),oe(se,le,be,"\u21d5","\\Updownarrow",!0),oe(se,le,de,"\u2210","\\coprod"),oe(se,le,de,"\u22c1","\\bigvee"),oe(se,le,de,"\u22c0","\\bigwedge"),oe(se,le,de,"\u2a04","\\biguplus"),oe(se,le,de,"\u22c2","\\bigcap"),oe(se,le,de,"\u22c3","\\bigcup"),oe(se,le,de,"\u222b","\\int"),oe(se,le,de,"\u222b","\\intop"),oe(se,le,de,"\u222c","\\iint"),oe(se,le,de,"\u222d","\\iiint"),oe(se,le,de,"\u220f","\\prod"),oe(se,le,de,"\u2211","\\sum"),oe(se,le,de,"\u2a02","\\bigotimes"),oe(se,le,de,"\u2a01","\\bigoplus"),oe(se,le,de,"\u2a00","\\bigodot"),oe(se,le,de,"\u222e","\\oint"),oe(se,le,de,"\u222f","\\oiint"),oe(se,le,de,"\u2230","\\oiiint"),oe(se,le,de,"\u2a06","\\bigsqcup"),oe(se,le,de,"\u222b","\\smallint"),oe(ie,le,ue,"\u2026","\\textellipsis"),oe(se,le,ue,"\u2026","\\mathellipsis"),oe(ie,le,ue,"\u2026","\\ldots",!0),oe(se,le,ue,"\u2026","\\ldots",!0),oe(se,le,ue,"\u22ef","\\@cdots",!0),oe(se,le,ue,"\u22f1","\\ddots",!0),oe(se,le,xe,"\u22ee","\\varvdots"),oe(ie,le,xe,"\u22ee","\\varvdots"),oe(se,le,ce,"\u02ca","\\acute"),oe(se,le,ce,"\u02cb","\\grave"),oe(se,le,ce,"\xa8","\\ddot"),oe(se,le,ce,"~","\\tilde"),oe(se,le,ce,"\u02c9","\\bar"),oe(se,le,ce,"\u02d8","\\breve"),oe(se,le,ce,"\u02c7","\\check"),oe(se,le,ce,"^","\\hat"),oe(se,le,ce,"\u20d7","\\vec"),oe(se,le,ce,"\u02d9","\\dot"),oe(se,le,ce,"\u02da","\\mathring"),oe(se,le,pe,"\ue131","\\@imath"),oe(se,le,pe,"\ue237","\\@jmath"),oe(se,le,xe,"\u0131","\u0131"),oe(se,le,xe,"\u0237","\u0237"),oe(ie,le,xe,"\u0131","\\i",!0),oe(ie,le,xe,"\u0237","\\j",!0),oe(ie,le,xe,"\xdf","\\ss",!0),oe(ie,le,xe,"\xe6","\\ae",!0),oe(ie,le,xe,"\u0153","\\oe",!0),oe(ie,le,xe,"\xf8","\\o",!0),oe(ie,le,xe,"\xc6","\\AE",!0),oe(ie,le,xe,"\u0152","\\OE",!0),oe(ie,le,xe,"\xd8","\\O",!0),oe(ie,le,ce,"\u02ca","\\'"),oe(ie,le,ce,"\u02cb","\\`"),oe(ie,le,ce,"\u02c6","\\^"),oe(ie,le,ce,"\u02dc","\\~"),oe(ie,le,ce,"\u02c9","\\="),oe(ie,le,ce,"\u02d8","\\u"),oe(ie,le,ce,"\u02d9","\\."),oe(ie,le,ce,"\xb8","\\c"),oe(ie,le,ce,"\u02da","\\r"),oe(ie,le,ce,"\u02c7","\\v"),oe(ie,le,ce,"\xa8",'\\"'),oe(ie,le,ce,"\u02dd","\\H"),oe(ie,le,ce,"\u25ef","\\textcircled");const we={"--":!0,"---":!0,"``":!0,"''":!0};oe(ie,le,xe,"\u2013","--",!0),oe(ie,le,xe,"\u2013","\\textendash"),oe(ie,le,xe,"\u2014","---",!0),oe(ie,le,xe,"\u2014","\\textemdash"),oe(ie,le,xe,"\u2018","`",!0),oe(ie,le,xe,"\u2018","\\textquoteleft"),oe(ie,le,xe,"\u2019","'",!0),oe(ie,le,xe,"\u2019","\\textquoteright"),oe(ie,le,xe,"\u201c","``",!0),oe(ie,le,xe,"\u201c","\\textquotedblleft"),oe(ie,le,xe,"\u201d","''",!0),oe(ie,le,xe,"\u201d","\\textquotedblright"),oe(se,le,xe,"\xb0","\\degree",!0),oe(ie,le,xe,"\xb0","\\degree"),oe(ie,le,xe,"\xb0","\\textdegree",!0),oe(se,le,xe,"\xa3","\\pounds"),oe(se,le,xe,"\xa3","\\mathsterling",!0),oe(ie,le,xe,"\xa3","\\pounds"),oe(ie,le,xe,"\xa3","\\textsterling",!0),oe(se,ae,xe,"\u2720","\\maltese"),oe(ie,ae,xe,"\u2720","\\maltese");const ve='0123456789/@."';for(let e=0;e<14;e++){const t=ve.charAt(e);oe(se,le,xe,t,t)}const ke='0123456789!@*()-=+";:?/.,';for(let e=0;e<25;e++){const t=ke.charAt(e);oe(ie,le,xe,t,t)}const ze="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";for(let e=0;e<52;e++){const t=ze.charAt(e);oe(se,le,pe,t,t),oe(ie,le,xe,t,t)}let Se;oe(se,ae,xe,"C","\u2102"),oe(ie,ae,xe,"C","\u2102"),oe(se,ae,xe,"H","\u210d"),oe(ie,ae,xe,"H","\u210d"),oe(se,ae,xe,"N","\u2115"),oe(ie,ae,xe,"N","\u2115"),oe(se,ae,xe,"P","\u2119"),oe(ie,ae,xe,"P","\u2119"),oe(se,ae,xe,"Q","\u211a"),oe(ie,ae,xe,"Q","\u211a"),oe(se,ae,xe,"R","\u211d"),oe(ie,ae,xe,"R","\u211d"),oe(se,ae,xe,"Z","\u2124"),oe(ie,ae,xe,"Z","\u2124"),oe(se,le,pe,"h","\u210e"),oe(ie,le,pe,"h","\u210e");for(let e=0;e<52;e++){const t=ze.charAt(e);Se=String.fromCharCode(55349,56320+e),oe(se,le,pe,t,Se),oe(ie,le,xe,t,Se),Se=String.fromCharCode(55349,56372+e),oe(se,le,pe,t,Se),oe(ie,le,xe,t,Se),Se=String.fromCharCode(55349,56424+e),oe(se,le,pe,t,Se),oe(ie,le,xe,t,Se),Se=String.fromCharCode(55349,56580+e),oe(se,le,pe,t,Se),oe(ie,le,xe,t,Se),Se=String.fromCharCode(55349,56684+e),oe(se,le,pe,t,Se),oe(ie,le,xe,t,Se),Se=String.fromCharCode(55349,56736+e),oe(se,le,pe,t,Se),oe(ie,le,xe,t,Se),Se=String.fromCharCode(55349,56788+e),oe(se,le,pe,t,Se),oe(ie,le,xe,t,Se),Se=String.fromCharCode(55349,56840+e),oe(se,le,pe,t,Se),oe(ie,le,xe,t,Se),Se=String.fromCharCode(55349,56944+e),oe(se,le,pe,t,Se),oe(ie,le,xe,t,Se),e<26&&(Se=String.fromCharCode(55349,56632+e),oe(se,le,pe,t,Se),oe(ie,le,xe,t,Se),Se=String.fromCharCode(55349,56476+e),oe(se,le,pe,t,Se),oe(ie,le,xe,t,Se))}Se=String.fromCharCode(55349,56668),oe(se,le,pe,"k",Se),oe(ie,le,xe,"k",Se);for(let e=0;e<10;e++){const t=e.toString();Se=String.fromCharCode(55349,57294+e),oe(se,le,pe,t,Se),oe(ie,le,xe,t,Se),Se=String.fromCharCode(55349,57314+e),oe(se,le,pe,t,Se),oe(ie,le,xe,t,Se),Se=String.fromCharCode(55349,57324+e),oe(se,le,pe,t,Se),oe(ie,le,xe,t,Se),Se=String.fromCharCode(55349,57334+e),oe(se,le,pe,t,Se),oe(ie,le,xe,t,Se)}const Me="\xd0\xde\xfe";for(let e=0;e<3;e++){const t=Me.charAt(e);oe(se,le,pe,t,t),oe(ie,le,xe,t,t)}const Ae={mathClass:"mathbf",textClass:"textbf",font:"Main-Bold"},Te={mathClass:"mathnormal",textClass:"textit",font:"Math-Italic"},Be={mathClass:"boldsymbol",textClass:"boldsymbol",font:"Main-BoldItalic"},Ce={mathClass:"",textClass:"",font:""},qe={mathClass:"mathfrak",textClass:"textfrak",font:"Fraktur-Regular"},Ie={mathClass:"mathbb",textClass:"textbb",font:"AMS-Regular"},Re={mathClass:"mathboldfrak",textClass:"textboldfrak",font:"Fraktur-Regular"},Ee={mathClass:"mathsf",textClass:"textsf",font:"SansSerif-Regular"},He={mathClass:"mathboldsf",textClass:"textboldsf",font:"SansSerif-Bold"},Ne={mathClass:"mathitsf",textClass:"textitsf",font:"SansSerif-Italic"},Oe={mathClass:"mathtt",textClass:"texttt",font:"Typewriter-Regular"},De=[Ae,Ae,Te,Te,Be,Be,{mathClass:"mathscr",textClass:"textscr",font:"Script-Regular"},Ce,Ce,Ce,qe,qe,Ie,Ie,Re,Re,Ee,Ee,He,He,Ne,Ne,Ce,Ce,Oe,Oe],Le=[Ae,Ce,Ee,He,Oe],Pe=function(e,t,r){if(ne[r][e]){const t=ne[r][e].replace;t&&(e=t)}return{value:e,metrics:ee(e,t,r)}},Fe=function(e,t,r,n,o){const s=Pe(e,t,r),i=s.metrics;let l;if(e=s.value,i){let t=i.italic;("text"===r||n&&"mathit"===n.font)&&(t=0),l=new W(e,i.height,i.depth,t,i.skew,i.width,o)}else"undefined"!=typeof console&&console.warn("No character metrics for '"+e+"' in style '"+t+"' and mode '"+r+"'"),l=new W(e,0,0,0,0,0,o);if(n){l.maxFontSize=n.sizeMultiplier,n.style.isTight()&&l.classes.push("mtight");const e=n.getColor();e&&(l.style.color=e)}return l},Ve=function(e,t,r,n){return void 0===n&&(n=[]),"boldsymbol"===r.font&&Pe(e,"Main-Bold",t).metrics?Fe(e,"Main-Bold",t,r,n.concat(["mathbf"])):"\\"===e||"main"===ne[t][e].font?Fe(e,"Main-Regular",t,r,n):Fe(e,"AMS-Regular",t,r,n.concat(["amsrm"]))},Ge=function(e,t,r){const o=e.mode,s=e.text,i=["mord"],{font:l,fontFamily:a,fontWeight:c,fontShape:h}=t,m="math"===o||"text"===o&&!!l,u=m?l:a;let p="",d="";if(55349===s.charCodeAt(0)){const e=(e=>{const t=1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320)+65536;if(119808<=t&&t<120484){const e=Math.floor((t-119808)/26);return De[e]}if(120782<=t&&t<=120831){const e=Math.floor((t-120782)/10);return Le[e]}if(120485===t||120486===t)return De[0];if(120486<t&&t<120782)return Ce;throw new n("Unsupported character: "+e)})(s);p=e.font,d=e[o+"Class"]}if(p)return Fe(s,p,o,t,i.concat(d));if(u){let e,n;if("boldsymbol"===u){const t=function(e,t,r){return"textord"!==r&&Pe(e,"Math-BoldItalic",t).metrics?{fontName:"Math-BoldItalic",fontClass:"boldsymbol"}:{fontName:"Main-Bold",fontClass:"mathbf"}}(s,o,r);e=t.fontName,n=[t.fontClass]}else m?(e=et[l].fontName,n=[l]):(e=Qe(a,c,h),n=[a,c,h]);if(Pe(s,e,o).metrics)return Fe(s,e,o,t,i.concat(n));if(we.hasOwnProperty(s)&&"Typewriter"===e.slice(0,10)){const r=[];for(let l=0;l<s.length;l++)r.push(Fe(s[l],e,o,t,i.concat(n)));return $e(r)}}if("mathord"===r)return Fe(s,"Math-Italic",o,t,i.concat(["mathnormal"]));if("textord"===r){const e=ne[o][s]&&ne[o][s].font;if("ams"===e){const e=Qe("amsrm",c,h);return Fe(s,e,o,t,i.concat("amsrm",c,h))}if("main"!==e&&e){const r=Qe(e,c,h);return Fe(s,r,o,t,i.concat(r,c,h))}{const e=Qe("textrm",c,h);return Fe(s,e,o,t,i.concat(c,h))}}throw new Error("unexpected type: "+r+" in makeOrd")},Ue=(e,t)=>{if(D(e.classes)!==D(t.classes)||e.skew!==t.skew||e.maxFontSize!==t.maxFontSize||0!==e.italic&&e.hasClass("mathnormal"))return!1;if(1===e.classes.length){const t=e.classes[0];if("mbin"===t||"mord"===t)return!1}for(const r of Object.keys(e.style))if(e.style[r]!==t.style[r])return!1;for(const r of Object.keys(t.style))if(e.style[r]!==t.style[r])return!1;return!0},Xe=e=>{for(let t=0;t<e.length-1;t++){const r=e[t],n=e[t+1];r instanceof W&&n instanceof W&&Ue(r,n)&&(r.text+=n.text,r.height=Math.max(r.height,n.height),r.depth=Math.max(r.depth,n.depth),r.italic=n.italic,e.splice(t+1,1),t--)}return e},Ye=function(e){let t=0,r=0,n=0;for(let o=0;o<e.children.length;o++){const s=e.children[o];s.height>t&&(t=s.height),s.depth>r&&(r=s.depth),s.maxFontSize>n&&(n=s.maxFontSize)}e.height=t,e.depth=r,e.maxFontSize=n},je=function(e,t,r,n){const o=new U(e,t,r,n);return Ye(o),o},We=(e,t,r,n)=>new U(e,t,r,n),_e=function(e,t,r){const n=je([e],[],t);return n.height=Math.max(r||t.fontMetrics().defaultRuleThickness,t.minRuleThickness),n.style.borderBottomWidth=O(n.height),n.maxFontSize=1,n},$e=function(e){const t=new I(e);return Ye(t),t},Ze=function(e,t){return e instanceof I?je([],[e],t):e},Ke=function(e,t){const{children:r,depth:n}=function(e){if("individualShift"===e.positionType){const t=e.children,r=[t[0]],n=-t[0].shift-t[0].elem.depth;let o=n;for(let e=1;e<t.length;e++){const n=-t[e].shift-o-t[e].elem.depth,s=n-(t[e-1].elem.height+t[e-1].elem.depth);o+=n,r.push({type:"kern",size:s}),r.push(t[e])}return{children:r,depth:n}}let t;if("top"===e.positionType){let r=e.positionData;for(let t=0;t<e.children.length;t++){const n=e.children[t];r-="kern"===n.type?n.size:n.elem.height+n.elem.depth}t=r}else if("bottom"===e.positionType)t=-e.positionData;else{const r=e.children[0];if("elem"!==r.type)throw new Error('First child must have type "elem".');if("shift"===e.positionType)t=-r.elem.depth-e.positionData;else{if("firstBaseline"!==e.positionType)throw new Error("Invalid positionType "+e.positionType+".");t=-r.elem.depth}}return{children:e.children,depth:t}}(e);let o=0;for(let e=0;e<r.length;e++){const t=r[e];if("elem"===t.type){const e=t.elem;o=Math.max(o,e.maxFontSize,e.height)}}o+=2;const s=je(["pstrut"],[]);s.style.height=O(o);const i=[];let l=n,a=n,c=n;for(let e=0;e<r.length;e++){const t=r[e];if("kern"===t.type)c+=t.size;else{const e=t.elem,r=t.wrapperClasses||[],n=t.wrapperStyle||{},l=je(r,[s,e],void 0,n);l.style.top=O(-o-c-e.depth),t.marginLeft&&(l.style.marginLeft=t.marginLeft),t.marginRight&&(l.style.marginRight=t.marginRight),i.push(l),c+=e.height+e.depth}l=Math.min(l,c),a=Math.max(a,c)}const h=je(["vlist"],i);let m;if(h.style.height=O(a),l<0){const e=je([],[]),t=je(["vlist"],[e]);t.style.height=O(-l);const r=je(["vlist-s"],[new W("\u200b")]);m=[je(["vlist-r"],[h,r]),je(["vlist-r"],[t])]}else m=[je(["vlist-r"],[h])];const u=je(["vlist-t"],m);return 2===m.length&&u.classes.push("vlist-t2"),u.height=a,u.depth=-l,u},Je=(e,t)=>{const r=je(["mspace"],[],t),n=N(e,t);return r.style.marginRight=O(n),r},Qe=(e,t,r)=>{let n,o;switch(e){case"amsrm":n="AMS";break;case"textrm":n="Main";break;case"textsf":n="SansSerif";break;case"texttt":n="Typewriter";break;default:n=e}return o="textbf"===t&&"textit"===r?"BoldItalic":"textbf"===t?"Bold":"textit"===r?"Italic":"Regular",n+"-"+o},et={mathbf:{variant:"bold",fontName:"Main-Bold"},mathrm:{variant:"normal",fontName:"Main-Regular"},textit:{variant:"italic",fontName:"Main-Italic"},mathit:{variant:"italic",fontName:"Main-Italic"},mathnormal:{variant:"italic",fontName:"Math-Italic"},mathsfit:{variant:"sans-serif-italic",fontName:"SansSerif-Italic"},mathbb:{variant:"double-struck",fontName:"AMS-Regular"},mathcal:{variant:"script",fontName:"Caligraphic-Regular"},mathfrak:{variant:"fraktur",fontName:"Fraktur-Regular"},mathscr:{variant:"script",fontName:"Script-Regular"},mathsf:{variant:"sans-serif",fontName:"SansSerif-Regular"},mathtt:{variant:"monospace",fontName:"Typewriter-Regular"}},tt={vec:["vec",.471,.714],oiintSize1:["oiintSize1",.957,.499],oiintSize2:["oiintSize2",1.472,.659],oiiintSize1:["oiiintSize1",1.304,.499],oiiintSize2:["oiiintSize2",1.98,.659]},rt=function(e,t){const[r,n,o]=tt[e],s=new $(r),i=new _([s],{width:O(n),height:O(o),style:"width:"+O(n),viewBox:"0 0 "+1e3*n+" "+1e3*o,preserveAspectRatio:"xMinYMin"}),l=We(["overlay"],[i],t);return l.height=o,l.style.height=O(o),l.style.width=O(n),l},nt={number:3,unit:"mu"},ot={number:4,unit:"mu"},st={number:5,unit:"mu"},it={mord:{mop:nt,mbin:ot,mrel:st,minner:nt},mop:{mord:nt,mop:nt,mrel:st,minner:nt},mbin:{mord:ot,mop:ot,mopen:ot,minner:ot},mrel:{mord:st,mop:st,mopen:st,minner:st},mopen:{},mclose:{mop:nt,mbin:ot,mrel:st,minner:nt},mpunct:{mord:nt,mop:nt,mrel:st,mopen:nt,mclose:nt,mpunct:nt,minner:nt},minner:{mord:nt,mop:nt,mbin:ot,mrel:st,mopen:nt,mpunct:nt,minner:nt}},lt={mord:{mop:nt},mop:{mord:nt,mop:nt},mbin:{},mrel:{},mopen:{},mclose:{mop:nt},mpunct:{},minner:{mop:nt}},at={},ct={},ht={};function mt(e){let{type:t,names:r,props:n,handler:o,htmlBuilder:s,mathmlBuilder:i}=e;const l={type:t,numArgs:n.numArgs,argTypes:n.argTypes,allowedInArgument:!!n.allowedInArgument,allowedInText:!!n.allowedInText,allowedInMath:void 0===n.allowedInMath||n.allowedInMath,numOptionalArgs:n.numOptionalArgs||0,infix:!!n.infix,primitive:!!n.primitive,handler:o};for(let e=0;e<r.length;++e)at[r[e]]=l;t&&(s&&(ct[t]=s),i&&(ht[t]=i))}function ut(e){let{type:t,htmlBuilder:r,mathmlBuilder:n}=e;mt({type:t,names:[],props:{numArgs:0},handler(){throw new Error("Should never be called.")},htmlBuilder:r,mathmlBuilder:n})}const pt=function(e){return"ordgroup"===e.type&&1===e.body.length?e.body[0]:e},dt=function(e){return"ordgroup"===e.type?e.body:[e]},gt=new Set(["leftmost","mbin","mopen","mrel","mop","mpunct"]),ft=new Set(["rightmost","mrel","mclose","mpunct"]),bt={display:S.DISPLAY,text:S.TEXT,script:S.SCRIPT,scriptscript:S.SCRIPTSCRIPT},yt={mord:"mord",mop:"mop",mbin:"mbin",mrel:"mrel",mopen:"mopen",mclose:"mclose",mpunct:"mpunct",minner:"minner"},xt=function(e,t,r,n){void 0===n&&(n=[null,null]);const o=[];for(let r=0;r<e.length;r++){const n=Mt(e[r],t);if(n instanceof I){const e=n.children;o.push(...e)}else o.push(n)}if(Xe(o),!r)return o;let s=t;if(1===e.length){const r=e[0];"sizing"===r.type?s=t.havingSize(r.size):"styling"===r.type&&(s=t.havingStyle(bt[r.style]))}const i=je([n[0]||"leftmost"],[],t),l=je([n[1]||"rightmost"],[],t),a="root"===r;return wt(o,(e,t)=>{const r=t.classes[0],n=e.classes[0];"mbin"===r&&ft.has(n)?t.classes[0]="mord":"mbin"===n&&gt.has(r)&&(e.classes[0]="mord")},{node:i},l,a),wt(o,(e,t)=>{var r,n;const o=zt(t),i=zt(e),l=o&&i?e.hasClass("mtight")?null==(r=lt[o])?void 0:r[i]:null==(n=it[o])?void 0:n[i]:null;if(l)return Je(l,s)},{node:i},l,a),o},wt=function(e,t,r,n,o){n&&e.push(n);let s=0;for(;s<e.length;s++){const n=e[s],i=vt(n);if(i){wt(i.children,t,r,null,o);continue}const l=!n.hasClass("mspace");if(l){const o=t(n,r.node);o&&(r.insertAfter?r.insertAfter(o):(e.unshift(o),s++))}l?r.node=n:o&&n.hasClass("newline")&&(r.node=je(["leftmost"])),r.insertAfter=(t=>r=>{e.splice(t+1,0,r),s++})(s)}n&&e.pop()},vt=function(e){return e instanceof I||e instanceof X||e instanceof U&&e.hasClass("enclosing")?e:null},kt=function(e,t){const r=vt(e);if(r){const e=r.children;if(e.length){if("right"===t)return kt(e[e.length-1],"right");if("left"===t)return kt(e[0],"left")}}return e},zt=function(e,t){if(!e)return null;t&&(e=kt(e,t));const r=e.classes[0];return yt[r]||null},St=function(e,t){const r=["nulldelimiter"].concat(e.baseSizingClasses());return je(t.concat(r))},Mt=function(e,t,r){if(!e)return je();if(ct[e.type]){let n=ct[e.type](e,t);if(r&&t.size!==r.size){n=je(t.sizingClasses(r),[n],t);const e=t.sizeMultiplier/r.sizeMultiplier;n.height*=e,n.depth*=e}return n}throw new n("Got group of unknown type: '"+e.type+"'")};function At(e,t){const r=je(["base"],e,t),n=je(["strut"]);return n.style.height=O(r.height+r.depth),r.depth&&(n.style.verticalAlign=O(-r.depth)),r.children.unshift(n),r}function Tt(e,t){let r=null;1===e.length&&"tag"===e[0].type&&(r=e[0].tag,e=e[0].body);const n=xt(e,t,"root");let o;2===n.length&&n[1].hasClass("tag")&&(o=n.pop());const s=[];let i,l=[];for(let e=0;e<n.length;e++)if(l.push(n[e]),n[e].hasClass("mbin")||n[e].hasClass("mrel")||n[e].hasClass("allowbreak")){let r=!1;for(;e<n.length-1&&n[e+1].hasClass("mspace")&&!n[e+1].hasClass("newline");)e++,l.push(n[e]),n[e].hasClass("nobreak")&&(r=!0);r||(s.push(At(l,t)),l=[])}else n[e].hasClass("newline")&&(l.pop(),l.length>0&&(s.push(At(l,t)),l=[]),s.push(n[e]));l.length>0&&s.push(At(l,t)),r?(i=At(xt(r,t,!0),t),i.classes=["tag"],s.push(i)):o&&s.push(o);const a=je(["katex-html"],s);if(a.setAttribute("aria-hidden","true"),i){const e=i.children[0];e.style.height=O(a.height+a.depth),a.depth&&(e.style.verticalAlign=O(-a.depth))}return a}function Bt(e){return new I(e)}class Ct{constructor(e,t,r){this.type=void 0,this.attributes=void 0,this.children=void 0,this.classes=void 0,this.type=e,this.attributes={},this.children=t||[],this.classes=r||[]}setAttribute(e,t){this.attributes[e]=t}getAttribute(e){return this.attributes[e]}toNode(){const e=document.createElementNS("http://www.w3.org/1998/Math/MathML",this.type);for(const t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&e.setAttribute(t,this.attributes[t]);this.classes.length>0&&(e.className=D(this.classes));for(let t=0;t<this.children.length;t++)if(this.children[t]instanceof qt&&this.children[t+1]instanceof qt){let r=this.children[t].toText()+this.children[++t].toText();for(;this.children[t+1]instanceof qt;)r+=this.children[++t].toText();e.appendChild(new qt(r).toNode())}else e.appendChild(this.children[t].toNode());return e}toMarkup(){let e="<"+this.type;for(const t in this.attributes)Object.prototype.hasOwnProperty.call(this.attributes,t)&&(e+=" "+t+'="',e+=a(this.attributes[t]),e+='"');this.classes.length>0&&(e+=' class ="'+a(D(this.classes))+'"'),e+=">";for(let t=0;t<this.children.length;t++)e+=this.children[t].toMarkup();return e+="</"+this.type+">",e}toText(){return this.children.map(e=>e.toText()).join("")}}class qt{constructor(e){this.text=void 0,this.text=e}toNode(){return document.createTextNode(this.text)}toMarkup(){return a(this.toText())}toText(){return this.text}}class It{constructor(e){this.width=void 0,this.character=void 0,this.width=e,this.character=e>=.05555&&e<=.05556?"\u200a":e>=.1666&&e<=.1667?"\u2009":e>=.2222&&e<=.2223?"\u2005":e>=.2777&&e<=.2778?"\u2005\u200a":e>=-.05556&&e<=-.05555?"\u200a\u2063":e>=-.1667&&e<=-.1666?"\u2009\u2063":e>=-.2223&&e<=-.2222?"\u205f\u2063":e>=-.2778&&e<=-.2777?"\u2005\u2063":null}toNode(){if(this.character)return document.createTextNode(this.character);{const e=document.createElementNS("http://www.w3.org/1998/Math/MathML","mspace");return e.setAttribute("width",O(this.width)),e}}toMarkup(){return this.character?"<mtext>"+this.character+"</mtext>":'<mspace width="'+O(this.width)+'"/>'}toText(){return this.character?this.character:" "}}const Rt=new Set(["\\imath","\\jmath"]),Et=new Set(["mrow","mtable"]),Ht=function(e,t,r){return!ne[t][e]||!ne[t][e].replace||55349===e.charCodeAt(0)||we.hasOwnProperty(e)&&r&&(r.fontFamily&&"tt"===r.fontFamily.slice(4,6)||r.font&&"tt"===r.font.slice(4,6))||(e=ne[t][e].replace),new qt(e)},Nt=function(e){return 1===e.length?e[0]:new Ct("mrow",e)},Ot={mathit:"italic",boldsymbol:e=>"textord"===e.type?"bold":"bold-italic",mathbf:"bold",mathbb:"double-struck",mathsfit:"sans-serif-italic",mathfrak:"fraktur",mathscr:"script",mathcal:"script",mathsf:"sans-serif",mathtt:"monospace"},Dt=(e,t)=>{if("text"===e.mode){if("texttt"===t.fontFamily)return"monospace";if("textsf"===t.fontFamily)return"textit"===t.fontShape&&"textbf"===t.fontWeight?"sans-serif-bold-italic":"textit"===t.fontShape?"sans-serif-italic":"textbf"===t.fontWeight?"bold-sans-serif":"sans-serif";if("textit"===t.fontShape&&"textbf"===t.fontWeight)return"bold-italic";if("textit"===t.fontShape)return"italic";if("textbf"===t.fontWeight)return"bold"}const r=t.font;if(!r||"mathnormal"===r)return null;const n=e.mode,o=Ot[r];if(o)return"function"==typeof o?o(e):o;let s=e.text;if(Rt.has(s))return null;if(ne[n][s]){const e=ne[n][s].replace;e&&(s=e)}return ee(s,et[r].fontName,n)?et[r].variant:null};function Lt(e){if(!e)return!1;if("mi"===e.type&&1===e.children.length){const t=e.children[0];return t instanceof qt&&"."===t.text}if("mo"===e.type&&1===e.children.length&&"true"===e.getAttribute("separator")&&"0em"===e.getAttribute("lspace")&&"0em"===e.getAttribute("rspace")){const t=e.children[0];return t instanceof qt&&","===t.text}return!1}const Pt=function(e,t,r){if(1===e.length){const n=Vt(e[0],t);return r&&n instanceof Ct&&"mo"===n.type&&(n.setAttribute("lspace","0em"),n.setAttribute("rspace","0em")),[n]}const n=[];let o;for(let r=0;r<e.length;r++){const s=Vt(e[r],t);if(s instanceof Ct&&o instanceof Ct){if("mtext"===s.type&&"mtext"===o.type&&s.getAttribute("mathvariant")===o.getAttribute("mathvariant")){o.children.push(...s.children);continue}if("mn"===s.type&&"mn"===o.type){o.children.push(...s.children);continue}if(Lt(s)&&"mn"===o.type){o.children.push(...s.children);continue}if("mn"===s.type&&Lt(o))s.children=[...o.children,...s.children],n.pop();else if(("msup"===s.type||"msub"===s.type)&&s.children.length>=1&&("mn"===o.type||Lt(o))){const e=s.children[0];e instanceof Ct&&"mn"===e.type&&(e.children=[...o.children,...e.children],n.pop())}else if("mi"===o.type&&1===o.children.length){const e=o.children[0];if(e instanceof qt&&"\u0338"===e.text&&("mo"===s.type||"mi"===s.type||"mn"===s.type)){const e=s.children[0];e instanceof qt&&e.text.length>0&&(e.text=e.text.slice(0,1)+"\u0338"+e.text.slice(1),n.pop())}}}n.push(s),o=s}return n},Ft=function(e,t,r){return Nt(Pt(e,t,r))},Vt=function(e,t){if(!e)return new Ct("mrow");if(ht[e.type])return ht[e.type](e,t);throw new n("Got group of unknown type: '"+e.type+"'")};function Gt(e,t,r,n,o){const s=Pt(e,r);let i;i=1===s.length&&s[0]instanceof Ct&&Et.has(s[0].type)?s[0]:new Ct("mrow",s);const l=new Ct("annotation",[new qt(t)]);l.setAttribute("encoding","application/x-tex");const a=new Ct("semantics",[i,l]),c=new Ct("math",[a]);c.setAttribute("xmlns","http://www.w3.org/1998/Math/MathML"),n&&c.setAttribute("display","block");return je([o?"katex":"katex-mathml"],[c])}const Ut=[[1,1,1],[2,1,1],[3,1,1],[4,2,1],[5,2,1],[6,3,1],[7,4,2],[8,6,3],[9,7,6],[10,8,7],[11,10,9]],Xt=[.5,.6,.7,.8,.9,1,1.2,1.44,1.728,2.074,2.488],Yt=function(e,t){return t.size<2?e:Ut[e-1][t.size-1]};class jt{constructor(e){this.style=void 0,this.color=void 0,this.size=void 0,this.textSize=void 0,this.phantom=void 0,this.font=void 0,this.fontFamily=void 0,this.fontWeight=void 0,this.fontShape=void 0,this.sizeMultiplier=void 0,this.maxSize=void 0,this.minRuleThickness=void 0,this._fontMetrics=void 0,this.style=e.style,this.color=e.color,this.size=e.size||jt.BASESIZE,this.textSize=e.textSize||this.size,this.phantom=!!e.phantom,this.font=e.font||"",this.fontFamily=e.fontFamily||"",this.fontWeight=e.fontWeight||"",this.fontShape=e.fontShape||"",this.sizeMultiplier=Xt[this.size-1],this.maxSize=e.maxSize,this.minRuleThickness=e.minRuleThickness,this._fontMetrics=void 0}extend(e){const t={style:this.style,size:this.size,textSize:this.textSize,color:this.color,phantom:this.phantom,font:this.font,fontFamily:this.fontFamily,fontWeight:this.fontWeight,fontShape:this.fontShape,maxSize:this.maxSize,   minRuleThickness:this.minRuleThickness};return Object.assign(t,e),new jt(t)}havingStyle(e){return this.style===e?this:this.extend({style:e,size:Yt(this.textSize,e)})}havingCrampedStyle(){return this.havingStyle(this.style.cramp())}havingSize(e){return this.size===e&&this.textSize===e?this:this.extend({style:this.style.text(),size:e,textSize:e,sizeMultiplier:Xt[e-1]})}havingBaseStyle(e){e=e||this.style.text();const t=Yt(jt.BASESIZE,e);return this.size===t&&this.textSize===jt.BASESIZE&&this.style===e?this:this.extend({style:e,size:t})}havingBaseSizing(){let e;switch(this.style.id){case 4:case 5:e=3;break;case 6:case 7:e=1;break;default:e=6}return this.extend({style:this.style.text(),size:e})}withColor(e){return this.extend({color:e})}withPhantom(){return this.extend({phantom:!0})}withFont(e){return this.extend({font:e})}withTextFontFamily(e){return this.extend({fontFamily:e,font:""})}withTextFontWeight(e){return this.extend({fontWeight:e,font:""})}withTextFontShape(e){return this.extend({fontShape:e,font:""})}sizingClasses(e){return e.size!==this.size?["sizing","reset-size"+e.size,"size"+this.size]:[]}baseSizingClasses(){return this.size!==jt.BASESIZE?["sizing","reset-size"+this.size,"size"+jt.BASESIZE]:[]}fontMetrics(){return this._fontMetrics||(this._fontMetrics=function(e){let t;if(t=e>=5?0:e>=3?1:2,!te[t]){const e=te[t]={cssEmPerMu:J.quad[t]/18};for(const r in J)J.hasOwnProperty(r)&&(e[r]=J[r][t])}return te[t]}(this.size)),this._fontMetrics}getColor(){return this.phantom?"transparent":this.color}}jt.BASESIZE=6;var Wt=jt;const _t=function(e){return new Wt({style:e.displayMode?S.DISPLAY:S.TEXT,maxSize:e.maxSize,minRuleThickness:e.minRuleThickness})},$t=function(e,t){if(t.displayMode){const r=["katex-display"];t.leqno&&r.push("leqno"),t.fleqn&&r.push("fleqn"),e=je(r,[e])}return e},Zt=function(e,t,r){const n=_t(r);let o;if("mathml"===r.output)return Gt(e,t,n,r.displayMode,!0);if("html"===r.output){const t=Tt(e,n);o=je(["katex"],[t])}else{const s=Gt(e,t,n,r.displayMode,!1),i=Tt(e,n);o=je(["katex"],[s,i])}return $t(o,r)};const Kt={widehat:"^",widecheck:"\u02c7",widetilde:"~",utilde:"~",overleftarrow:"\u2190",underleftarrow:"\u2190",xleftarrow:"\u2190",overrightarrow:"\u2192",underrightarrow:"\u2192",xrightarrow:"\u2192",underbrace:"\u23df",overbrace:"\u23de",underbracket:"\u23b5",overbracket:"\u23b4",overgroup:"\u23e0",undergroup:"\u23e1",overleftrightarrow:"\u2194",underleftrightarrow:"\u2194",xleftrightarrow:"\u2194",Overrightarrow:"\u21d2",xRightarrow:"\u21d2",overleftharpoon:"\u21bc",xleftharpoonup:"\u21bc",overrightharpoon:"\u21c0",xrightharpoonup:"\u21c0",xLeftarrow:"\u21d0",xLeftrightarrow:"\u21d4",xhookleftarrow:"\u21a9",xhookrightarrow:"\u21aa",xmapsto:"\u21a6",xrightharpoondown:"\u21c1",xleftharpoondown:"\u21bd",xrightleftharpoons:"\u21cc",xleftrightharpoons:"\u21cb",xtwoheadleftarrow:"\u219e",xtwoheadrightarrow:"\u21a0",xlongequal:"=",xtofrom:"\u21c4",xrightleftarrows:"\u21c4",xrightequilibrium:"\u21cc",xleftequilibrium:"\u21cb","\\cdrightarrow":"\u2192","\\cdleftarrow":"\u2190","\\cdlongequal":"="},Jt=function(e){const t=new Ct("mo",[new qt(Kt[e.replace(/^\\/,"")])]);return t.setAttribute("stretchy","true"),t},Qt={overrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],overleftarrow:[["leftarrow"],.888,522,"xMinYMin"],underrightarrow:[["rightarrow"],.888,522,"xMaxYMin"],underleftarrow:[["leftarrow"],.888,522,"xMinYMin"],xrightarrow:[["rightarrow"],1.469,522,"xMaxYMin"],"\\cdrightarrow":[["rightarrow"],3,522,"xMaxYMin"],xleftarrow:[["leftarrow"],1.469,522,"xMinYMin"],"\\cdleftarrow":[["leftarrow"],3,522,"xMinYMin"],Overrightarrow:[["doublerightarrow"],.888,560,"xMaxYMin"],xRightarrow:[["doublerightarrow"],1.526,560,"xMaxYMin"],xLeftarrow:[["doubleleftarrow"],1.526,560,"xMinYMin"],overleftharpoon:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoonup:[["leftharpoon"],.888,522,"xMinYMin"],xleftharpoondown:[["leftharpoondown"],.888,522,"xMinYMin"],overrightharpoon:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoonup:[["rightharpoon"],.888,522,"xMaxYMin"],xrightharpoondown:[["rightharpoondown"],.888,522,"xMaxYMin"],xlongequal:[["longequal"],.888,334,"xMinYMin"],"\\cdlongequal":[["longequal"],3,334,"xMinYMin"],xtwoheadleftarrow:[["twoheadleftarrow"],.888,334,"xMinYMin"],xtwoheadrightarrow:[["twoheadrightarrow"],.888,334,"xMaxYMin"],overleftrightarrow:[["leftarrow","rightarrow"],.888,522],overbrace:[["leftbrace","midbrace","rightbrace"],1.6,548],underbrace:[["leftbraceunder","midbraceunder","rightbraceunder"],1.6,548],underleftrightarrow:[["leftarrow","rightarrow"],.888,522],xleftrightarrow:[["leftarrow","rightarrow"],1.75,522],xLeftrightarrow:[["doubleleftarrow","doublerightarrow"],1.75,560],xrightleftharpoons:[["leftharpoondownplus","rightharpoonplus"],1.75,716],xleftrightharpoons:[["leftharpoonplus","rightharpoondownplus"],1.75,716],xhookleftarrow:[["leftarrow","righthook"],1.08,522],xhookrightarrow:[["lefthook","rightarrow"],1.08,522],overlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],underlinesegment:[["leftlinesegment","rightlinesegment"],.888,522],overbracket:[["leftbracketover","rightbracketover"],1.6,440],underbracket:[["leftbracketunder","rightbracketunder"],1.6,410],overgroup:[["leftgroup","rightgroup"],.888,342],undergroup:[["leftgroupunder","rightgroupunder"],.888,342],xmapsto:[["leftmapsto","rightarrow"],1.5,522],xtofrom:[["leftToFrom","rightToFrom"],1.75,528],xrightleftarrows:[["baraboveleftarrow","rightarrowabovebar"],1.75,901],xrightequilibrium:[["baraboveshortleftharpoon","rightharpoonaboveshortbar"],1.75,716],xleftequilibrium:[["shortbaraboveleftharpoon","shortrightharpoonabovebar"],1.75,716]},er=new Set(["widehat","widecheck","widetilde","utilde"]),tr=function(e,t){const{span:r,minWidth:n,height:o}=function(){let r=4e5;const n=e.label.slice(1);if(er.has(n)&&"base"in e){const o="ordgroup"===e.base.type?e.base.body.length:1;let s,i,l;if(o>5)"widehat"===n||"widecheck"===n?(s=420,r=2364,l=.42,i=n+"4"):(s=312,r=2340,l=.34,i="tilde4");else{const e=[1,1,2,2,3,3][o];"widehat"===n||"widecheck"===n?(r=[0,1062,2364,2364,2364][e],s=[0,239,300,360,420][e],l=[0,.24,.3,.3,.36,.42][e],i=n+e):(r=[0,600,1033,2339,2340][e],s=[0,260,286,306,312][e],l=[0,.26,.286,.3,.306,.34][e],i="tilde"+e)}const a=new $(i),c=new _([a],{width:"100%",height:O(l),viewBox:"0 0 "+r+" "+s,preserveAspectRatio:"none"});return{span:We([],[c],t),minWidth:0,height:l}}{const e=[],o=Qt[n];if(!o)throw new Error('No SVG data for "'+n+'".');const[s,i,l]=o,a=l/1e3,c=s.length;let h,m;if(1===c){if(4!==o.length)throw new Error('Expected 4-tuple for single-path SVG data "'+n+'".');h=["hide-tail"],m=[o[3]]}else if(2===c)h=["halfarrow-left","halfarrow-right"],m=["xMinYMin","xMaxYMin"];else{if(3!==c)throw new Error("Correct katexImagesData or update code here to support\n                    "+c+" children.");h=["brace-left","brace-center","brace-right"],m=["xMinYMin","xMidYMin","xMaxYMin"]}for(let n=0;n<c;n++){const o=new $(s[n]),u=new _([o],{width:"400em",height:O(a),viewBox:"0 0 "+r+" "+l,preserveAspectRatio:m[n]+" slice"}),p=We([h[n]],[u],t);if(1===c)return{span:p,minWidth:i,height:a};p.style.height=O(a),e.push(p)}return{span:je(["stretchy"],e,t),minWidth:i,height:a}}}();return r.height=o,r.style.height=O(o),n>0&&(r.style.minWidth=O(n)),r},rr={bin:1,close:1,inner:1,open:1,punct:1,rel:1},nr={"accent-token":1,mathord:1,"op-token":1,spacing:1,textord:1};function or(e,t){if(!e||e.type!==t)throw new Error("Expected node of type "+t+", but got "+(e?"node of type "+e.type:String(e)));return e}function sr(e){const t=ir(e);if(!t)throw new Error("Expected node of symbol group type, but got "+(e?"node of type "+e.type:String(e)));return t}function ir(e){return e&&("atom"===e.type||nr.hasOwnProperty(e.type))?e:null}const lr=e=>{return e instanceof W?e:((t=e)instanceof U||t instanceof X||t instanceof I)&&1===e.children.length?lr(e.children[0]):void 0;var t},ar=(e,t)=>{let r,n,o;e&&"supsub"===e.type?(n=or(e.base,"accent"),r=n.base,e.base=r,o=function(e){if(e instanceof U)return e;throw new Error("Expected span<HtmlDomNode> but got "+String(e)+".")}(Mt(e,t)),e.base=n):(n=or(e,"accent"),r=n.base);const s=Mt(r,t.havingCrampedStyle());let i=0;var l,a;n.isShifty&&m(r)&&(i=null!=(l=null==(a=lr(s))?void 0:a.skew)?l:0);const c="\\c"===n.label;let h,u=c?s.height+s.depth:Math.min(s.height,t.fontMetrics().xHeight);if(n.isStretchy)h=tr(n,t),h=Ke({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"elem",elem:h,wrapperClasses:["svg-align"],wrapperStyle:i>0?{width:"calc(100% - "+O(2*i)+")",marginLeft:O(2*i)}:void 0}]});else{let e,r;"\\vec"===n.label?(e=rt("vec",t),r=tt.vec[1]):(e=Ge({type:"textord",mode:n.mode,text:n.label},t,"textord"),e=function(e){if(e instanceof W)return e;throw new Error("Expected symbolNode but got "+String(e)+".")}(e),e.italic=0,r=e.width,c&&(u+=e.depth)),h=je(["accent-body"],[e]);const o="\\textcircled"===n.label;o&&(h.classes.push("accent-full"),u=s.height);let l=i;o||(l-=r/2),h.style.left=O(l),"\\textcircled"===n.label&&(h.style.top=".2em"),h=Ke({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:-u},{type:"elem",elem:h}]})}const p=je(["mord","accent"],[h],t);return o?(o.children[0]=p,o.height=Math.max(p.height,o.height),o.classes[0]="mord",o):p},cr=(e,t)=>{const r=e.isStretchy?Jt(e.label):new Ct("mo",[Ht(e.label,e.mode)]),n=new Ct("mover",[Vt(e.base,t),r]);return n.setAttribute("accent","true"),n},hr=new RegExp(["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring"].map(e=>"\\"+e).join("|"));mt({type:"accent",names:["\\acute","\\grave","\\ddot","\\tilde","\\bar","\\breve","\\check","\\hat","\\vec","\\dot","\\mathring","\\widecheck","\\widehat","\\widetilde","\\overrightarrow","\\overleftarrow","\\Overrightarrow","\\overleftrightarrow","\\overgroup","\\overlinesegment","\\overleftharpoon","\\overrightharpoon"],props:{numArgs:1},handler:(e,t)=>{const r=pt(t[0]),n=!hr.test(e.funcName),o=!n||"\\widehat"===e.funcName||"\\widetilde"===e.funcName||"\\widecheck"===e.funcName;return{type:"accent",mode:e.parser.mode,label:e.funcName,isStretchy:n,isShifty:o,base:r}},htmlBuilder:ar,mathmlBuilder:cr}),mt({type:"accent",names:["\\'","\\`","\\^","\\~","\\=","\\u","\\.",'\\"',"\\c","\\r","\\H","\\v","\\textcircled"],props:{numArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["primitive"]},handler:(e,t)=>{const r=t[0];let n=e.parser.mode;return"math"===n&&(e.parser.settings.reportNonstrict("mathVsTextAccents","LaTeX's accent "+e.funcName+" works only in text mode"),n="text"),{type:"accent",mode:n,label:e.funcName,isStretchy:!1,isShifty:!0,base:r}},htmlBuilder:ar,mathmlBuilder:cr}),mt({type:"accentUnder",names:["\\underleftarrow","\\underrightarrow","\\underleftrightarrow","\\undergroup","\\underlinesegment","\\utilde"],props:{numArgs:1},handler:(e,t)=>{let{parser:r,funcName:n}=e;const o=t[0];return{type:"accentUnder",mode:r.mode,label:n,base:o}},htmlBuilder:(e,t)=>{const r=Mt(e.base,t),n=tr(e,t),o="\\utilde"===e.label?.12:0,s=Ke({positionType:"top",positionData:r.height,children:[{type:"elem",elem:n,wrapperClasses:["svg-align"]},{type:"kern",size:o},{type:"elem",elem:r}]});return je(["mord","accentunder"],[s],t)},mathmlBuilder:(e,t)=>{const r=Jt(e.label),n=new Ct("munder",[Vt(e.base,t),r]);return n.setAttribute("accentunder","true"),n}});const mr=e=>{const t=new Ct("mpadded",e?[e]:[]);return t.setAttribute("width","+0.6em"),t.setAttribute("lspace","0.3em"),t};function ur(e,t){const r=xt(e.body,t,!0);return je([e.mclass],r,t)}function pr(e,t){let r;const n=Pt(e.body,t);return"minner"===e.mclass?r=new Ct("mpadded",n):"mord"===e.mclass?e.isCharacterBox?(r=n[0],r.type="mi"):r=new Ct("mi",n):(e.isCharacterBox?(r=n[0],r.type="mo"):r=new Ct("mo",n),"mbin"===e.mclass?(r.attributes.lspace="0.22em",r.attributes.rspace="0.22em"):"mpunct"===e.mclass?(r.attributes.lspace="0em",r.attributes.rspace="0.17em"):"mopen"===e.mclass||"mclose"===e.mclass?(r.attributes.lspace="0em",r.attributes.rspace="0em"):"minner"===e.mclass&&(r.attributes.lspace="0.0556em",r.attributes.width="+0.1111em")),r}mt({type:"xArrow",names:["\\xleftarrow","\\xrightarrow","\\xLeftarrow","\\xRightarrow","\\xleftrightarrow","\\xLeftrightarrow","\\xhookleftarrow","\\xhookrightarrow","\\xmapsto","\\xrightharpoondown","\\xrightharpoonup","\\xleftharpoondown","\\xleftharpoonup","\\xrightleftharpoons","\\xleftrightharpoons","\\xlongequal","\\xtwoheadrightarrow","\\xtwoheadleftarrow","\\xtofrom","\\xrightleftarrows","\\xrightequilibrium","\\xleftequilibrium","\\\\cdrightarrow","\\\\cdleftarrow","\\\\cdlongequal"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,r){let{parser:n,funcName:o}=e;return{type:"xArrow",mode:n.mode,label:o,body:t[0],below:r[0]}},htmlBuilder(e,t){const r=t.style;let n=t.havingStyle(r.sup());const o=Ze(Mt(e.body,n,t),t),s="\\x"===e.label.slice(0,2)?"x":"cd";let i;o.classes.push(s+"-arrow-pad"),e.below&&(n=t.havingStyle(r.sub()),i=Ze(Mt(e.below,n,t),t),i.classes.push(s+"-arrow-pad"));const l=tr(e,t),a=-t.fontMetrics().axisHeight+.5*l.height;let c,h=-t.fontMetrics().axisHeight-.5*l.height-.111;if((o.depth>.25||"\\xleftequilibrium"===e.label)&&(h-=o.depth),i){const e=-t.fontMetrics().axisHeight+i.height+.5*l.height+.111;c=Ke({positionType:"individualShift",children:[{type:"elem",elem:o,shift:h},{type:"elem",elem:l,shift:a,wrapperClasses:["svg-align"]},{type:"elem",elem:i,shift:e}]})}else c=Ke({positionType:"individualShift",children:[{type:"elem",elem:o,shift:h},{type:"elem",elem:l,shift:a,wrapperClasses:["svg-align"]}]});return je(["mrel","x-arrow"],[c],t)},mathmlBuilder(e,t){const r=Jt(e.label);let n;if(r.setAttribute("minsize","x"===e.label.charAt(0)?"1.75em":"3.0em"),e.body){const o=mr(Vt(e.body,t));if(e.below){const s=mr(Vt(e.below,t));n=new Ct("munderover",[r,s,o])}else n=new Ct("mover",[r,o])}else if(e.below){const o=mr(Vt(e.below,t));n=new Ct("munder",[r,o])}else n=mr(),n=new Ct("mover",[r,n]);return n}}),mt({type:"mclass",names:["\\mathord","\\mathbin","\\mathrel","\\mathopen","\\mathclose","\\mathpunct","\\mathinner"],props:{numArgs:1,primitive:!0},handler(e,t){let{parser:r,funcName:n}=e;const o=t[0];return{type:"mclass",mode:r.mode,mclass:"m"+n.slice(5),body:dt(o),isCharacterBox:m(o)}},htmlBuilder:ur,mathmlBuilder:pr});const dr=e=>{const t="ordgroup"===e.type&&e.body.length?e.body[0]:e;return"atom"!==t.type||"bin"!==t.family&&"rel"!==t.family?"mord":"m"+t.family};mt({type:"mclass",names:["\\@binrel"],props:{numArgs:2},handler(e,t){let{parser:r}=e;return{type:"mclass",mode:r.mode,mclass:dr(t[0]),body:dt(t[1]),isCharacterBox:m(t[1])}}}),mt({type:"mclass",names:["\\stackrel","\\overset","\\underset"],props:{numArgs:2},handler(e,t){let{parser:r,funcName:n}=e;const o=t[1],s=t[0];let i;i="\\stackrel"!==n?dr(o):"mrel";const l={type:"op",mode:o.mode,limits:!0,alwaysHandleSupSub:!0,parentIsSupSub:!1,symbol:!1,suppressBaseShift:"\\stackrel"!==n,body:dt(o)},a={type:"supsub",mode:s.mode,base:l,sup:"\\underset"===n?null:s,sub:"\\underset"===n?s:null};return{type:"mclass",mode:r.mode,mclass:i,body:[a],isCharacterBox:m(a)}},htmlBuilder:ur,mathmlBuilder:pr}),mt({type:"pmb",names:["\\pmb"],props:{numArgs:1,allowedInText:!0},handler(e,t){let{parser:r}=e;return{type:"pmb",mode:r.mode,mclass:dr(t[0]),body:dt(t[0])}},htmlBuilder(e,t){const r=xt(e.body,t,!0),n=je([e.mclass],r,t);return n.style.textShadow="0.02em 0.01em 0.04px",n},mathmlBuilder(e,t){const r=Pt(e.body,t),n=new Ct("mstyle",r);return n.setAttribute("style","text-shadow: 0.02em 0.01em 0.04px"),n}});const gr={">":"\\\\cdrightarrow","<":"\\\\cdleftarrow","=":"\\\\cdlongequal",A:"\\uparrow",V:"\\downarrow","|":"\\Vert",".":"no arrow"},fr=()=>({type:"styling",body:[],mode:"math",style:"display",resetFont:!0}),br=e=>"textord"===e.type&&"@"===e.text,yr=(e,t)=>("mathord"===e.type||"atom"===e.type)&&e.text===t;function xr(e,t,r){const n=gr[e];switch(n){case"\\\\cdrightarrow":case"\\\\cdleftarrow":return r.callFunction(n,[t[0]],[t[1]]);case"\\uparrow":case"\\downarrow":{const e={type:"atom",text:n,mode:"math",family:"rel"},o={type:"ordgroup",mode:"math",body:[r.callFunction("\\\\cdleft",[t[0]],[]),r.callFunction("\\Big",[e],[]),r.callFunction("\\\\cdright",[t[1]],[])]};return r.callFunction("\\\\cdparent",[o],[])}case"\\\\cdlongequal":return r.callFunction("\\\\cdlongequal",[],[]);case"\\Vert":{const e={type:"textord",text:"\\Vert",mode:"math"};return r.callFunction("\\Big",[e],[])}default:return{type:"textord",text:" ",mode:"math"}}}mt({type:"cdlabel",names:["\\\\cdleft","\\\\cdright"],props:{numArgs:1},handler(e,t){let{parser:r,funcName:n}=e;return{type:"cdlabel",mode:r.mode,side:n.slice(4),label:t[0]}},htmlBuilder(e,t){const r=t.havingStyle(t.style.sup()),n=Ze(Mt(e.label,r,t),t);return n.classes.push("cd-label-"+e.side),n.style.bottom=O(.8-n.depth),n.height=0,n.depth=0,n},mathmlBuilder(e,t){let r=new Ct("mrow",[Vt(e.label,t)]);return r=new Ct("mpadded",[r]),r.setAttribute("width","0"),"left"===e.side&&r.setAttribute("lspace","-1width"),r.setAttribute("voffset","0.7em"),r=new Ct("mstyle",[r]),r.setAttribute("displaystyle","false"),r.setAttribute("scriptlevel","1"),r}}),mt({type:"cdlabelparent",names:["\\\\cdparent"],props:{numArgs:1},handler(e,t){let{parser:r}=e;return{type:"cdlabelparent",mode:r.mode,fragment:t[0]}},htmlBuilder(e,t){const r=Ze(Mt(e.fragment,t),t);return r.classes.push("cd-vert-arrow"),r},mathmlBuilder(e,t){return new Ct("mrow",[Vt(e.fragment,t)])}}),mt({type:"textord",names:["\\@char"],props:{numArgs:1,allowedInText:!0},handler(e,t){let{parser:r}=e;const o=or(t[0],"ordgroup").body;let s="";for(let e=0;e<o.length;e++){s+=or(o[e],"textord").text}let i,l=parseInt(s);if(isNaN(l))throw new n("\\@char has non-numeric argument "+s);if(l<0||l>=1114111)throw new n("\\@char with invalid code point "+s);return l<=65535?i=String.fromCharCode(l):(l-=65536,i=String.fromCharCode(55296+(l>>10),56320+(1023&l))),{type:"textord",mode:r.mode,text:i}}});const wr=(e,t)=>{const r=xt(e.body,t.withColor(e.color),!1);return $e(r)},vr=(e,t)=>{const r=Pt(e.body,t.withColor(e.color)),n=new Ct("mstyle",r);return n.setAttribute("mathcolor",e.color),n};mt({type:"color",names:["\\textcolor"],props:{numArgs:2,allowedInText:!0,argTypes:["color","original"]},handler(e,t){let{parser:r}=e;const n=or(t[0],"color-token").color,o=t[1];return{type:"color",mode:r.mode,color:n,body:dt(o)}},htmlBuilder:wr,mathmlBuilder:vr}),mt({type:"color",names:["\\color"],props:{numArgs:1,allowedInText:!0,argTypes:["color"]},handler(e,t){let{parser:r,breakOnTokenText:n}=e;const o=or(t[0],"color-token").color;r.gullet.macros.set("\\current@color",o);const s=r.parseExpression(!0,n);return{type:"color",mode:r.mode,color:o,body:s}},htmlBuilder:wr,mathmlBuilder:vr}),mt({type:"cr",names:["\\\\"],props:{numArgs:0,numOptionalArgs:0,allowedInText:!0},handler(e,t,r){let{parser:n}=e;const o="["===n.gullet.future().text?n.parseSizeGroup(!0):null,s=!n.settings.displayMode||!n.settings.useStrictBehavior("newLineInDisplayMode","In LaTeX, \\\\ or \\newline does nothing in display mode");return{type:"cr",mode:n.mode,newLine:s,size:o&&or(o,"size").value}},htmlBuilder(e,t){const r=je(["mspace"],[],t);return e.newLine&&(r.classes.push("newline"),e.size&&(r.style.marginTop=O(N(e.size,t)))),r},mathmlBuilder(e,t){const r=new Ct("mspace");return e.newLine&&(r.setAttribute("linebreak","newline"),e.size&&r.setAttribute("height",O(N(e.size,t)))),r}});const kr={"\\global":"\\global","\\long":"\\\\globallong","\\\\globallong":"\\\\globallong","\\def":"\\gdef","\\gdef":"\\gdef","\\edef":"\\xdef","\\xdef":"\\xdef","\\let":"\\\\globallet","\\futurelet":"\\\\globalfuture"},zr=e=>{const t=e.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(t))throw new n("Expected a control sequence",e);return t},Sr=(e,t,r,n)=>{let o=e.gullet.macros.get(r.text);null==o&&(r.noexpand=!0,o={tokens:[r],numArgs:0,unexpandable:!e.gullet.isExpandable(r.text)}),e.gullet.macros.set(t,o,n)};mt({type:"internal",names:["\\global","\\long","\\\\globallong"],props:{numArgs:0,allowedInText:!0},handler(e){let{parser:t,funcName:r}=e;t.consumeSpaces();const o=t.fetch();if(kr[o.text])return"\\global"!==r&&"\\\\globallong"!==r||(o.text=kr[o.text]),or(t.parseFunction(),"internal");throw new n("Invalid token after macro prefix",o)}}),mt({type:"internal",names:["\\def","\\gdef","\\edef","\\xdef"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){let{parser:t,funcName:r}=e,o=t.gullet.popToken();const s=o.text;if(/^(?:[\\{}$&#^_]|EOF)$/.test(s))throw new n("Expected a control sequence",o);let i,l=0;const a=[[]];for(;"{"!==t.gullet.future().text;)if(o=t.gullet.popToken(),"#"===o.text){if("{"===t.gullet.future().text){i=t.gullet.future(),a[l].push("{");break}if(o=t.gullet.popToken(),!/^[1-9]$/.test(o.text))throw new n('Invalid argument number "'+o.text+'"');if(parseInt(o.text)!==l+1)throw new n('Argument number "'+o.text+'" out of order');l++,a.push([])}else{if("EOF"===o.text)throw new n("Expected a macro definition");a[l].push(o.text)}let{tokens:c}=t.gullet.consumeArg();return i&&c.unshift(i),"\\edef"!==r&&"\\xdef"!==r||(c=t.gullet.expandTokens(c),c.reverse()),t.gullet.macros.set(s,{tokens:c,numArgs:l,delimiters:a},r===kr[r]),{type:"internal",mode:t.mode}}}),mt({type:"internal",names:["\\let","\\\\globallet"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){let{parser:t,funcName:r}=e;const n=zr(t.gullet.popToken());t.gullet.consumeSpaces();const o=(e=>{let t=e.gullet.popToken();return"="===t.text&&(t=e.gullet.popToken()," "===t.text&&(t=e.gullet.popToken())),t})(t);return Sr(t,n,o,"\\\\globallet"===r),{type:"internal",mode:t.mode}}}),mt({type:"internal",names:["\\futurelet","\\\\globalfuture"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e){let{parser:t,funcName:r}=e;const n=zr(t.gullet.popToken()),o=t.gullet.popToken(),s=t.gullet.popToken();return Sr(t,n,s,"\\\\globalfuture"===r),t.gullet.pushToken(s),t.gullet.pushToken(o),{type:"internal",mode:t.mode}}});const Mr=function(e,t,r){const n=ee(ne.math[e]&&ne.math[e].replace||e,t,r);if(!n)throw new Error("Unsupported symbol "+e+" and font size "+t+".");return n},Ar=function(e,t,r,n){const o=r.havingBaseStyle(t),s=je(n.concat(o.sizingClasses(r)),[e],r),i=o.sizeMultiplier/r.sizeMultiplier;return s.height*=i,s.depth*=i,s.maxFontSize=o.sizeMultiplier,s},Tr=function(e,t,r){const n=t.havingBaseStyle(r),o=(1-t.sizeMultiplier/n.sizeMultiplier)*t.fontMetrics().axisHeight;e.classes.push("delimcenter"),e.style.top=O(o),e.height-=o,e.depth+=o},Br=function(e,t,r,n,o,s){const i=function(e,t,r,n){return Fe(e,"Size"+t+"-Regular",r,n)}(e,t,o,n),l=Ar(je(["delimsizing","size"+t],[i],n),S.TEXT,n,s);return r&&Tr(l,n,S.TEXT),l},Cr=function(e,t,r){let n;n="Size1-Regular"===t?"delim-size1":"delim-size4";return{type:"elem",elem:je(["delimsizinginner",n],[je([],[Fe(e,t,r)])])}},qr=function(e,t,r){const n=K["Size4-Regular"][e.charCodeAt(0)]?K["Size4-Regular"][e.charCodeAt(0)][4]:K["Size1-Regular"][e.charCodeAt(0)][4],o=new $("inner",function(e,t){switch(e){case"\u239c":return B("M291 0 H417 V"+t+" H291z");case"\u2223":return B("M145 0 H188 V"+t+" H145z");case"\u2225":return B("M145 0 H188 V"+t+" H145z")+B("M367 0 H410 V"+t+" H367z");case"\u239f":return B("M457 0 H583 V"+t+" H457z");case"\u23a2":return B("M319 0 H403 V"+t+" H319z");case"\u23a5":return B("M263 0 H347 V"+t+" H263z");case"\u23aa":return B("M384 0 H504 V"+t+" H384z");case"\u23d0":return B("M312 0 H355 V"+t+" H312z");case"\u2016":return B("M257 0 H300 V"+t+" H257z")+B("M478 0 H521 V"+t+" H478z");default:return""}}(e,Math.round(1e3*t))),s=new _([o],{width:O(n),height:O(t),style:"width:"+O(n),viewBox:"0 0 "+1e3*n+" "+Math.round(1e3*t),preserveAspectRatio:"xMinYMin"}),i=We([],[s],r);return i.height=t,i.style.height=O(t),i.style.width=O(n),{type:"elem",elem:i}},Ir={type:"kern",size:-.008},Rr=new Set(["|","\\lvert","\\rvert","\\vert"]),Er=new Set(["\\|","\\lVert","\\rVert","\\Vert"]),Hr=function(e,t,r,n,o,s){let i,l,a,c,h="",m=0;i=a=c=e,l=null;let u="Size1-Regular";"\\uparrow"===e?a=c="\u23d0":"\\Uparrow"===e?a=c="\u2016":"\\downarrow"===e?i=a="\u23d0":"\\Downarrow"===e?i=a="\u2016":"\\updownarrow"===e?(i="\\uparrow",a="\u23d0",c="\\downarrow"):"\\Updownarrow"===e?(i="\\Uparrow",a="\u2016",c="\\Downarrow"):Rr.has(e)?(a="\u2223",h="vert",m=333):Er.has(e)?(a="\u2225",h="doublevert",m=556):"["===e||"\\lbrack"===e?(i="\u23a1",a="\u23a2",c="\u23a3",u="Size4-Regular",h="lbrack",m=667):"]"===e||"\\rbrack"===e?(i="\u23a4",a="\u23a5",c="\u23a6",u="Size4-Regular",h="rbrack",m=667):"\\lfloor"===e||"\u230a"===e?(a=i="\u23a2",c="\u23a3",u="Size4-Regular",h="lfloor",m=667):"\\lceil"===e||"\u2308"===e?(i="\u23a1",a=c="\u23a2",u="Size4-Regular",h="lceil",m=667):"\\rfloor"===e||"\u230b"===e?(a=i="\u23a5",c="\u23a6",u="Size4-Regular",h="rfloor",m=667):"\\rceil"===e||"\u2309"===e?(i="\u23a4",a=c="\u23a5",u="Size4-Regular",h="rceil",m=667):"("===e||"\\lparen"===e?(i="\u239b",a="\u239c",c="\u239d",u="Size4-Regular",h="lparen",m=875):")"===e||"\\rparen"===e?(i="\u239e",a="\u239f",c="\u23a0",u="Size4-Regular",h="rparen",m=875):"\\{"===e||"\\lbrace"===e?(i="\u23a7",l="\u23a8",c="\u23a9",a="\u23aa",u="Size4-Regular"):"\\}"===e||"\\rbrace"===e?(i="\u23ab",l="\u23ac",c="\u23ad",a="\u23aa",u="Size4-Regular"):"\\lgroup"===e||"\u27ee"===e?(i="\u23a7",c="\u23a9",a="\u23aa",u="Size4-Regular"):"\\rgroup"===e||"\u27ef"===e?(i="\u23ab",c="\u23ad",a="\u23aa",u="Size4-Regular"):"\\lmoustache"===e||"\u23b0"===e?(i="\u23a7",c="\u23ad",a="\u23aa",u="Size4-Regular"):"\\rmoustache"!==e&&"\u23b1"!==e||(i="\u23ab",c="\u23a9",a="\u23aa",u="Size4-Regular");const p=Mr(i,u,o),d=p.height+p.depth,g=Mr(a,u,o),f=g.height+g.depth,b=Mr(c,u,o),y=b.height+b.depth;let x=0,w=1;if(null!==l){const e=Mr(l,u,o);x=e.height+e.depth,w=2}const v=d+y+x,k=v+Math.max(0,Math.ceil((t-v)/(w*f)))*w*f;let z=n.fontMetrics().axisHeight;r&&(z*=n.sizeMultiplier);const M=k/2-z,A=[];if(h.length>0){const e=k-d-y,t=Math.round(1e3*k),r=function(e,t){switch(e){case"lbrack":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v1759 v84 h347 v-84\nH403z M403 1759 V0 H319 V1759 v"+t+" v1759 v84 h84z";case"rbrack":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v"+t+" v1759 h84z";case"vert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z";case"doublevert":return"M145 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v"+t+" v585 h43z\nM367 15 v585 v"+t+" v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v"+-t+" v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v"+t+" v585 h43z";case"lfloor":return"M319 602 V0 H403 V602 v"+t+" v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"rfloor":return"M319 602 V0 H403 V602 v"+t+" v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v"+t+" v1715 H319z";case"lceil":return"M403 1759 V84 H666 V0 H319 V1759 v"+t+" v602 h84z\nM403 1759 V0 H319 V1759 v"+t+" v602 h84z";case"rceil":return"M347 1759 V0 H0 V84 H263 V1759 v"+t+" v602 h84z\nM347 1759 V0 h-84 V1759 v"+t+" v602 h84z";case"lparen":return"M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0,"+(t+84)+"c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-"+(t+92)+"c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";case"rparen":return"M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,"+(t+9)+"\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-"+(t+144)+"c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";default:throw new Error("Unknown stretchy delimiter.")}}(h,Math.round(1e3*e)),o=new $(h,r),s=O(m/1e3),i=O(t/1e3),l=new _([o],{width:s,height:i,viewBox:"0 0 "+m+" "+t}),a=We([],[l],n);a.height=t/1e3,a.style.width=s,a.style.height=i,A.push({type:"elem",elem:a})}else{if(A.push(Cr(c,u,o)),A.push(Ir),null===l){const e=k-d-y+.016;A.push(qr(a,e,n))}else{const e=(k-d-y-x)/2+.016;A.push(qr(a,e,n)),A.push(Ir),A.push(Cr(l,u,o)),A.push(Ir),A.push(qr(a,e,n))}A.push(Ir),A.push(Cr(i,u,o))}const T=n.havingBaseStyle(S.TEXT),B=Ke({positionType:"bottom",positionData:M,children:A});return Ar(je(["delimsizing","mult"],[B],T),S.TEXT,n,s)},Nr=.08,Or=function(e,t,r,n,o){const s=function(e,t,r){t*=1e3;let n="";switch(e){case"sqrtMain":n=function(e,t){return"M95,"+(622+e+t)+"\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl"+e/2.075+" -"+e+"\nc5.3,-9.3,12,-14,20,-14\nH400000v"+(40+e)+"H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM"+(834+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,C);break;case"sqrtSize1":n=function(e,t){return"M263,"+(601+e+t)+"c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl"+e/2.084+" -"+e+"\nc4.7,-7.3,11,-11,19,-11\nH40000v"+(40+e)+"H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,C);break;case"sqrtSize2":n=function(e,t){return"M983 "+(10+e+t)+"\nl"+e/3.13+" -"+e+"\nc4,-6.7,10,-10,18,-10 H400000v"+(40+e)+"\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM"+(1001+e)+" "+t+"h400000v"+(40+e)+"h-400000z"}(t,C);break;case"sqrtSize3":n=function(e,t){return"M424,"+(2398+e+t)+"\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl"+e/4.223+" -"+e+"c4,-6.7,10,-10,18,-10 H400000\nv"+(40+e)+"H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M"+(1001+e)+" "+t+"\nh400000v"+(40+e)+"h-400000z"}(t,C);break;case"sqrtSize4":n=function(e,t){return"M473,"+(2713+e+t)+"\nc339.3,-1799.3,509.3,-2700,510,-2702 l"+e/5.298+" -"+e+"\nc3.3,-7.3,9.3,-11,18,-11 H400000v"+(40+e)+"H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM"+(1001+e)+" "+t+"h400000v"+(40+e)+"H1017.7z"}(t,C);break;case"sqrtTall":n=function(e,t,r){return"M702 "+(e+t)+"H400000"+(40+e)+"\nH742v"+(r-54-t-e)+"l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 "+t+"H400000v"+(40+e)+"H742z"}(t,C,r)}return n}(e,n,r),i=new $(e,s),l=new _([i],{width:"400em",height:O(t),viewBox:"0 0 400000 "+r,preserveAspectRatio:"xMinYMin slice"});return We(["hide-tail"],[l],o)},Dr=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230a","\u230b","\\lceil","\\rceil","\u2308","\u2309","\\surd"]),Lr=new Set(["\\uparrow","\\downarrow","\\updownarrow","\\Uparrow","\\Downarrow","\\Updownarrow","|","\\|","\\vert","\\Vert","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27ee","\u27ef","\\lmoustache","\\rmoustache","\u23b0","\u23b1"]),Pr=new Set(["<",">","\\langle","\\rangle","/","\\backslash","\\lt","\\gt"]),Fr=[0,1.2,1.8,2.4,3],Vr=function(e,t,r,o,s){if("<"===e||"\\lt"===e||"\u27e8"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"\u27e9"!==e||(e="\\rangle"),Dr.has(e)||Pr.has(e))return Br(e,t,!1,r,o,s);if(Lr.has(e))return Hr(e,Fr[t],!1,r,o,s);throw new n("Illegal delimiter: '"+e+"'")},Gr=[{type:"small",style:S.SCRIPTSCRIPT},{type:"small",style:S.SCRIPT},{type:"small",style:S.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4}],Ur=[{type:"small",style:S.SCRIPTSCRIPT},{type:"small",style:S.SCRIPT},{type:"small",style:S.TEXT},{type:"stack"}],Xr=[{type:"small",style:S.SCRIPTSCRIPT},{type:"small",style:S.SCRIPT},{type:"small",style:S.TEXT},{type:"large",size:1},{type:"large",size:2},{type:"large",size:3},{type:"large",size:4},{type:"stack"}],Yr=function(e){if("small"===e.type)return"Main-Regular";if("large"===e.type)return"Size"+e.size+"-Regular";if("stack"===e.type)return"Size4-Regular";{const t=e.type;throw new Error("Add support for delim type '"+t+"' here.")}},jr=function(e,t,r,n){for(let o=Math.min(2,3-n.style.size);o<r.length;o++){const s=r[o];if("stack"===s.type)break;const i=Mr(e,Yr(s),"math");let l=i.height+i.depth;if("small"===s.type){l*=n.havingBaseStyle(s.style).sizeMultiplier}if(l>t)return s}return r[r.length-1]},Wr=function(e,t,r,n,o,s){let i;"<"===e||"\\lt"===e||"\u27e8"===e?e="\\langle":">"!==e&&"\\gt"!==e&&"\u27e9"!==e||(e="\\rangle"),i=Pr.has(e)?Gr:Dr.has(e)?Xr:Ur;const l=jr(e,t,i,n);return"small"===l.type?function(e,t,r,n,o,s){const i=Fe(e,"Main-Regular",o,n),l=Ar(i,t,n,s);return r&&Tr(l,n,t),l}(e,l.style,r,n,o,s):"large"===l.type?Br(e,l.size,r,n,o,s):Hr(e,t,r,n,o,s)},_r=function(e,t,r,n,o,s){const i=n.fontMetrics().axisHeight*n.sizeMultiplier,l=5/n.fontMetrics().ptPerEm,a=Math.max(t-i,r+i),c=Math.max(a/500*901,2*a-l);return Wr(e,c,!0,n,o,s)},$r={"\\bigl":{mclass:"mopen",size:1},"\\Bigl":{mclass:"mopen",size:2},"\\biggl":{mclass:"mopen",size:3},"\\Biggl":{mclass:"mopen",size:4},"\\bigr":{mclass:"mclose",size:1},"\\Bigr":{mclass:"mclose",size:2},"\\biggr":{mclass:"mclose",size:3},"\\Biggr":{mclass:"mclose",size:4},"\\bigm":{mclass:"mrel",size:1},"\\Bigm":{mclass:"mrel",size:2},"\\biggm":{mclass:"mrel",size:3},"\\Biggm":{mclass:"mrel",size:4},"\\big":{mclass:"mord",size:1},"\\Big":{mclass:"mord",size:2},"\\bigg":{mclass:"mord",size:3},"\\Bigg":{mclass:"mord",size:4}},Zr=new Set(["(","\\lparen",")","\\rparen","[","\\lbrack","]","\\rbrack","\\{","\\lbrace","\\}","\\rbrace","\\lfloor","\\rfloor","\u230a","\u230b","\\lceil","\\rceil","\u2308","\u2309","<",">","\\langle","\u27e8","\\rangle","\u27e9","\\lt","\\gt","\\lvert","\\rvert","\\lVert","\\rVert","\\lgroup","\\rgroup","\u27ee","\u27ef","\\lmoustache","\\rmoustache","\u23b0","\u23b1","/","\\backslash","|","\\vert","\\|","\\Vert","\\uparrow","\\Uparrow","\\downarrow","\\Downarrow","\\updownarrow","\\Updownarrow","."]);function Kr(e){return"isMiddle"in e}function Jr(e,t){const r=ir(e);if(r&&Zr.has(r.text))return r;throw new n(r?"Invalid delimiter '"+r.text+"' after '"+t.funcName+"'":"Invalid delimiter type '"+e.type+"'",e)}function Qr(e){if(!e.body)throw new Error("Bug: The leftright ParseNode wasn't fully parsed.")}mt({type:"delimsizing",names:["\\bigl","\\Bigl","\\biggl","\\Biggl","\\bigr","\\Bigr","\\biggr","\\Biggr","\\bigm","\\Bigm","\\biggm","\\Biggm","\\big","\\Big","\\bigg","\\Bigg"],props:{numArgs:1,argTypes:["primitive"]},handler:(e,t)=>{const r=Jr(t[0],e);return{type:"delimsizing",mode:e.parser.mode,size:$r[e.funcName].size,mclass:$r[e.funcName].mclass,delim:r.text}},htmlBuilder:(e,t)=>"."===e.delim?je([e.mclass]):Vr(e.delim,e.size,t,e.mode,[e.mclass]),mathmlBuilder:e=>{const t=[];"."!==e.delim&&t.push(Ht(e.delim,e.mode));const r=new Ct("mo",t);"mopen"===e.mclass||"mclose"===e.mclass?r.setAttribute("fence","true"):r.setAttribute("fence","false"),r.setAttribute("stretchy","true");const n=O(Fr[e.size]);return r.setAttribute("minsize",n),r.setAttribute("maxsize",n),r}}),mt({type:"leftright-right",names:["\\right"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{const r=e.parser.gullet.macros.get("\\current@color");if(r&&"string"!=typeof r)throw new n("\\current@color set to non-string in \\right");return{type:"leftright-right",mode:e.parser.mode,delim:Jr(t[0],e).text,color:r}}}),mt({type:"leftright",names:["\\left"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{const r=Jr(t[0],e),n=e.parser;++n.leftrightDepth;const o=n.parseExpression(!1);--n.leftrightDepth,n.expect("\\right",!1);const s=or(n.parseFunction(),"leftright-right");return{type:"leftright",mode:n.mode,body:o,left:r.text,right:s.delim,rightColor:s.color}},htmlBuilder:(e,t)=>{Qr(e);const r=xt(e.body,t,!0,["mopen","mclose"]);let n,o,s=0,i=0,l=!1;for(let e=0;e<r.length;e++){Kr(r[e])?l=!0:(s=Math.max(r[e].height,s),i=Math.max(r[e].depth,i))}if(s*=t.sizeMultiplier,i*=t.sizeMultiplier,n="."===e.left?St(t,["mopen"]):_r(e.left,s,i,t,e.mode,["mopen"]),r.unshift(n),l)for(let t=1;t<r.length;t++){const n=r[t];if(Kr(n)){const o=n.isMiddle;r[t]=_r(o.delim,s,i,o.options,e.mode,[])}}if("."===e.right)o=St(t,["mclose"]);else{const r=e.rightColor?t.withColor(e.rightColor):t;o=_r(e.right,s,i,r,e.mode,["mclose"])}return r.push(o),je(["minner"],r,t)},mathmlBuilder:(e,t)=>{Qr(e);const r=Pt(e.body,t);if("."!==e.left){const t=new Ct("mo",[Ht(e.left,e.mode)]);t.setAttribute("fence","true"),r.unshift(t)}if("."!==e.right){const t=new Ct("mo",[Ht(e.right,e.mode)]);t.setAttribute("fence","true"),e.rightColor&&t.setAttribute("mathcolor",e.rightColor),r.push(t)}return Nt(r)}}),mt({type:"middle",names:["\\middle"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{const r=Jr(t[0],e);if(!e.parser.leftrightDepth)throw new n("\\middle without preceding \\left",r);return{type:"middle",mode:e.parser.mode,delim:r.text}},htmlBuilder:(e,t)=>{let r;return"."===e.delim?r=St(t,[]):(r=Vr(e.delim,1,t,e.mode,[]),r.isMiddle={delim:e.delim,options:t}),r},mathmlBuilder:(e,t)=>{const r="\\vert"===e.delim||"|"===e.delim?Ht("|","text"):Ht(e.delim,e.mode),n=new Ct("mo",[r]);return n.setAttribute("fence","true"),n.setAttribute("lspace","0.05em"),n.setAttribute("rspace","0.05em"),n}});const en=(e,t)=>{const r=Ze(Mt(e.body,t),t),n=e.label.slice(1);let o,s,i=t.sizeMultiplier;const l=m(e.body);if("sout"===n)o=je(["stretchy","sout"]),o.height=t.fontMetrics().defaultRuleThickness/i,s=-.5*t.fontMetrics().xHeight;else if("phase"===n){const e=N({number:.6,unit:"pt"},t),n=N({number:.35,unit:"ex"},t);i/=t.havingBaseSizing().sizeMultiplier;const l=r.height+r.depth+e+n;r.style.paddingLeft=O(l/2+e);const c=Math.floor(1e3*l*i),h="M400000 "+(a=c)+" H0 L"+a/2+" 0 l65 45 L145 "+(a-80)+" H400000z",m=new _([new $("phase",h)],{width:"400em",height:O(c/1e3),viewBox:"0 0 400000 "+c,preserveAspectRatio:"xMinYMin slice"});o=We(["hide-tail"],[m],t),o.style.height=O(l),s=r.depth+e+n}else{let i,a;/cancel/.test(n)?l||r.classes.push("cancel-pad"):"angl"===n?r.classes.push("anglpad"):r.classes.push("boxpad");let c=0;/box/.test(n)?(c=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness),i=t.fontMetrics().fboxsep+("colorbox"===n?0:c),a=i):"angl"===n?(c=Math.max(t.fontMetrics().defaultRuleThickness,t.minRuleThickness),i=4*c,a=Math.max(0,.25-r.depth)):(i=l?.2:0,a=i),o=function(e,t,r,n,o){let s;const i=e.height+e.depth+r+n;if(/fbox|color|angl/.test(t)){if(s=je(["stretchy",t],[],o),"fbox"===t){const e=o.color&&o.getColor();e&&(s.style.borderColor=e)}}else{const e=[];/^[bx]cancel$/.test(t)&&e.push(new Z({x1:"0",y1:"0",x2:"100%",y2:"100%","stroke-width":"0.046em"})),/^x?cancel$/.test(t)&&e.push(new Z({x1:"0",y1:"100%",x2:"100%",y2:"0","stroke-width":"0.046em"}));const r=new _(e,{width:"100%",height:O(i)});s=We([],[r],o)}return s.height=i,s.style.height=O(i),s}(r,n,i,a,t),/fbox|boxed|fcolorbox/.test(n)?(o.style.borderStyle="solid",o.style.borderWidth=O(c)):"angl"===n&&.049!==c&&(o.style.borderTopWidth=O(c),o.style.borderRightWidth=O(c)),s=r.depth+a,e.backgroundColor&&(o.style.backgroundColor=e.backgroundColor,e.borderColor&&(o.style.borderColor=e.borderColor))}var a;let c;if(e.backgroundColor)c=Ke({positionType:"individualShift",children:[{type:"elem",elem:o,shift:s},{type:"elem",elem:r,shift:0}]});else{const e=/cancel|phase/.test(n)?["svg-align"]:[];c=Ke({positionType:"individualShift",children:[{type:"elem",elem:r,shift:0},{type:"elem",elem:o,shift:s,wrapperClasses:e}]})}return/cancel/.test(n)&&(c.height=r.height,c.depth=r.depth),/cancel/.test(n)&&!l?je(["mord","cancel-lap"],[c],t):je(["mord"],[c],t)},tn=(e,t)=>{let r;const n=new Ct(e.label.includes("colorbox")?"mpadded":"menclose",[Vt(e.body,t)]);switch(e.label){case"\\cancel":n.setAttribute("notation","updiagonalstrike");break;case"\\bcancel":n.setAttribute("notation","downdiagonalstrike");break;case"\\phase":n.setAttribute("notation","phasorangle");break;case"\\sout":n.setAttribute("notation","horizontalstrike");break;case"\\fbox":n.setAttribute("notation","box");break;case"\\angl":n.setAttribute("notation","actuarial");break;case"\\fcolorbox":case"\\colorbox":if(r=t.fontMetrics().fboxsep*t.fontMetrics().ptPerEm,n.setAttribute("width","+"+2*r+"pt"),n.setAttribute("height","+"+2*r+"pt"),n.setAttribute("lspace",r+"pt"),n.setAttribute("voffset",r+"pt"),"\\fcolorbox"===e.label){const r=Math.max(t.fontMetrics().fboxrule,t.minRuleThickness);n.setAttribute("style","border: "+O(r)+" solid "+e.borderColor)}break;case"\\xcancel":n.setAttribute("notation","updiagonalstrike downdiagonalstrike")}return e.backgroundColor&&n.setAttribute("mathbackground",e.backgroundColor),n};mt({type:"enclose",names:["\\colorbox"],props:{numArgs:2,allowedInText:!0,argTypes:["color","hbox"]},handler(e,t,r){let{parser:n,funcName:o}=e;const s=or(t[0],"color-token").color,i=t[1];return{type:"enclose",mode:n.mode,label:o,backgroundColor:s,body:i}},htmlBuilder:en,mathmlBuilder:tn}),mt({type:"enclose",names:["\\fcolorbox"],props:{numArgs:3,allowedInText:!0,argTypes:["color","color","hbox"]},handler(e,t,r){let{parser:n,funcName:o}=e;const s=or(t[0],"color-token").color,i=or(t[1],"color-token").color,l=t[2];return{type:"enclose",mode:n.mode,label:o,backgroundColor:i,borderColor:s,body:l}},htmlBuilder:en,mathmlBuilder:tn}),mt({type:"enclose",names:["\\fbox"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!0},handler(e,t){let{parser:r}=e;return{type:"enclose",mode:r.mode,label:"\\fbox",body:t[0]}}}),mt({type:"enclose",names:["\\cancel","\\bcancel","\\xcancel","\\phase"],props:{numArgs:1},handler(e,t){let{parser:r,funcName:n}=e;const o=t[0];return{type:"enclose",mode:r.mode,label:n,body:o}},htmlBuilder:en,mathmlBuilder:tn}),mt({type:"enclose",names:["\\sout"],props:{numArgs:1,allowedInText:!0},handler(e,t){let{parser:r,funcName:n}=e;"math"===r.mode&&r.settings.reportNonstrict("mathVsSout","LaTeX's \\sout works only in text mode");const o=t[0];return{type:"enclose",mode:r.mode,label:n,body:o}},htmlBuilder:en,mathmlBuilder:tn}),mt({type:"enclose",names:["\\angl"],props:{numArgs:1,argTypes:["hbox"],allowedInText:!1},handler(e,t){let{parser:r}=e;return{type:"enclose",mode:r.mode,label:"\\angl",body:t[0]}}});const rn={};function nn(e){let{type:t,names:r,props:n,handler:o,htmlBuilder:s,mathmlBuilder:i}=e;const l={type:t,numArgs:n.numArgs||0,allowedInText:!1,numOptionalArgs:0,handler:o};for(let e=0;e<r.length;++e)rn[r[e]]=l;s&&(ct[t]=s),i&&(ht[t]=i)}const on={};function sn(e,t){on[e]=t}class ln{constructor(e,t,r){this.lexer=void 0,this.start=void 0,this.end=void 0,this.lexer=e,this.start=t,this.end=r}static range(e,t){return t?e&&e.loc&&t.loc&&e.loc.lexer===t.loc.lexer?new ln(e.loc.lexer,e.loc.start,t.loc.end):null:e&&e.loc}}class an{constructor(e,t){this.text=void 0,this.loc=void 0,this.noexpand=void 0,this.treatAsRelax=void 0,this.text=e,this.loc=t}range(e,t){return new an(t,ln.range(this,e))}}function cn(e){const t=[];e.consumeSpaces();let r=e.fetch().text;for("\\relax"===r&&(e.consume(),e.consumeSpaces(),r=e.fetch().text);"\\hline"===r||"\\hdashline"===r;)e.consume(),t.push("\\hdashline"===r),e.consumeSpaces(),r=e.fetch().text;return t}const hn=e=>{if(!e.parser.settings.displayMode)throw new n("{"+e.envName+"} can be used only in display mode.")},mn=new Set(["gather","gather*"]);function un(e){if(!e.includes("ed"))return!e.includes("*")}function pn(e,t,r){let{hskipBeforeAndAfter:o,addJot:s,cols:i,arraystretch:l,colSeparationType:a,autoTag:c,singleRow:h,emptySingleRow:m,maxNumCols:u,leqno:p}=t;if(e.gullet.beginGroup(),h||e.gullet.macros.set("\\cr","\\\\\\relax"),!l){const t=e.gullet.expandMacroAsText("\\arraystretch");if(null==t)l=1;else if(l=parseFloat(t),!l||l<0)throw new n("Invalid \\arraystretch: "+t)}e.gullet.beginGroup();let d=[];const g=[d],f=[],b=[],y=null!=c?[]:void 0;function x(){c&&e.gullet.macros.set("\\@eqnsw","1",!0)}function w(){y&&(e.gullet.macros.get("\\df@tag")?(y.push(e.subparse([new an("\\df@tag")])),e.gullet.macros.set("\\df@tag",void 0,!0)):y.push(Boolean(c)&&"1"===e.gullet.macros.get("\\@eqnsw")))}for(x(),b.push(cn(e));;){const t=e.parseExpression(!1,h?"\\end":"\\\\");e.gullet.endGroup(),e.gullet.beginGroup();let o={type:"ordgroup",mode:e.mode,body:t};r&&(o={type:"styling",mode:e.mode,style:r,resetFont:!0,body:[o]}),d.push(o);const s=e.fetch().text;if("&"===s){if(u&&d.length===u){if(h||a)throw new n("Too many tab characters: &",e.nextToken);e.settings.reportNonstrict("textEnv","Too few columns specified in the {array} column argument.")}e.consume()}else{if("\\end"===s){w(),1===d.length&&"styling"===o.type&&1===o.body.length&&"ordgroup"===o.body[0].type&&0===o.body[0].body.length&&(g.length>1||!m)&&g.pop(),b.length<g.length+1&&b.push([]);break}if("\\\\"!==s)throw new n("Expected & or \\\\ or \\cr or \\end",e.nextToken);{let t;e.consume()," "!==e.gullet.future().text&&(t=e.parseSizeGroup(!0)),f.push(t?t.value:null),w(),b.push(cn(e)),d=[],g.push(d),x()}}}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:e.mode,addJot:s,arraystretch:l,body:g,cols:i,rowGaps:f,hskipBeforeAndAfter:o,hLinesBeforeRow:b,colSeparationType:a,tags:y,leqno:p}}function dn(e){return"d"===e.slice(0,1)?"display":"text"}const gn=function(e,t){let r,o;const s=e.body.length,i=e.hLinesBeforeRow;let l=0;const a=new Array(s),c=[],h=Math.max(t.fontMetrics().arrayRuleWidth,t.minRuleThickness),m=1/t.fontMetrics().ptPerEm;let u=5*m;if(e.colSeparationType&&"small"===e.colSeparationType){u=t.havingStyle(S.SCRIPT).sizeMultiplier/t.sizeMultiplier*.2778}const p="CD"===e.colSeparationType?N({number:3,unit:"ex"},t):12*m,d=3*m,g=e.arraystretch*p,f=.7*g,b=.3*g;let y=0;function x(e){for(let t=0;t<e.length;++t)t>0&&(y+=.25),c.push({pos:y,isDashed:e[t]})}for(x(i[0]),r=0;r<e.body.length;++r){const n=e.body[r];let s=f,c=b;l<n.length&&(l=n.length);const h={cells:new Array(n.length),height:0,depth:0,pos:0};for(o=0;o<n.length;++o){const e=Mt(n[o],t);c<e.depth&&(c=e.depth),s<e.height&&(s=e.height),h.cells[o]=e}const m=e.rowGaps[r];let u=0;m&&(u=N(m,t),u>0&&(u+=b,c<u&&(c=u),u=0)),e.addJot&&r<e.body.length-1&&(c+=d),h.height=s,h.depth=c,y+=s,h.pos=y,y+=c+u,a[r]=h,x(i[r+1])}const w=y/2+t.fontMetrics().axisHeight,v=e.cols||[],k=[];let z,M;const A=[];if(e.tags&&e.tags.some(e=>e))for(r=0;r<s;++r){const n=a[r],o=n.pos-w,s=e.tags[r];let i;i=!0===s?je(["eqn-num"],[],t):je([],!1===s?[]:xt(s,t,!0),t),i.depth=n.depth,i.height=n.height,A.push({type:"elem",elem:i,shift:o})}for(o=0,M=0;o<l||M<v.length;++o,++M){var T;let i,c=v[M],m=!0;for(;"separator"===(null==(B=c)?void 0:B.type);){var B;if(m||(z=je(["arraycolsep"],[]),z.style.width=O(t.fontMetrics().doubleRuleSep),k.push(z)),"|"!==c.separator&&":"!==c.separator)throw new n("Invalid separator type: "+c.separator);{const e="|"===c.separator?"solid":"dashed",r=je(["vertical-separator"],[],t);r.style.height=O(y),r.style.borderRightWidth=O(h),r.style.borderRightStyle=e,r.style.margin="0 "+O(-h/2);const n=y-w;n&&(r.style.verticalAlign=O(-n)),k.push(r)}M++,c=v[M],m=!1}if(o>=l)continue;var C,q;if(o>0||e.hskipBeforeAndAfter)i=null!=(C=null==(q=c)?void 0:q.pregap)?C:u,0!==i&&(z=je(["arraycolsep"],[]),z.style.width=O(i),k.push(z));const p=[];for(r=0;r<s;++r){const e=a[r],t=e.cells[o];if(!t)continue;const n=e.pos-w;t.depth=e.depth,t.height=e.height,p.push({type:"elem",elem:t,shift:n})}const d=Ke({positionType:"individualShift",children:p}),g=je(["col-align-"+((null==(T=c)?void 0:T.align)||"c")],[d]);var I,R;if(k.push(g),o<l-1||e.hskipBeforeAndAfter)i=null!=(I=null==(R=c)?void 0:R.postgap)?I:u,0!==i&&(z=je(["arraycolsep"],[]),z.style.width=O(i),k.push(z))}let E=je(["mtable"],k);if(c.length>0){const e=_e("hline",t,h),r=_e("hdashline",t,h),n=[{type:"elem",elem:E,shift:0}];for(;c.length>0;){const t=c.pop(),o=t.pos-w;t.isDashed?n.push({type:"elem",elem:r,shift:o}):n.push({type:"elem",elem:e,shift:o})}E=Ke({positionType:"individualShift",children:n})}if(0===A.length)return je(["mord"],[E],t);{const e=Ke({positionType:"individualShift",children:A}),r=je(["tag"],[e],t);return $e([E,r])}},fn={c:"center ",l:"left ",r:"right "},bn=function(e,t){const r=[],n=new Ct("mtd",[],["mtr-glue"]),o=new Ct("mtd",[],["mml-eqn-num"]);for(let s=0;s<e.body.length;s++){const i=e.body[s],l=[];for(let e=0;e<i.length;e++)l.push(new Ct("mtd",[Vt(i[e],t)]));e.tags&&e.tags[s]&&(l.unshift(n),l.push(n),e.leqno?l.unshift(o):l.push(o)),r.push(new Ct("mtr",l))}let s=new Ct("mtable",r);const i=.5===e.arraystretch?.1:.16+e.arraystretch-1+(e.addJot?.09:0);s.setAttribute("rowspacing",O(i));let l="",a="";if(e.cols&&e.cols.length>0){const t=e.cols;let r="",n=!1,o=0,i=t.length;"separator"===t[0].type&&(l+="top ",o=1),"separator"===t[t.length-1].type&&(l+="bottom ",i-=1);for(let e=o;e<i;e++){const o=t[e];"align"===o.type?(a+=fn[o.align],n&&(r+="none "),n=!0):"separator"===o.type&&n&&(r+="|"===o.separator?"solid ":"dashed ",n=!1)}s.setAttribute("columnalign",a.trim()),/[sd]/.test(r)&&s.setAttribute("columnlines",r.trim())}if("align"===e.colSeparationType){const t=e.cols||[];let r="";for(let e=1;e<t.length;e++)r+=e%2?"0em ":"1em ";s.setAttribute("columnspacing",r.trim())}else"alignat"===e.colSeparationType||"gather"===e.colSeparationType?s.setAttribute("columnspacing","0em"):"small"===e.colSeparationType?s.setAttribute("columnspacing","0.2778em"):"CD"===e.colSeparationType?s.setAttribute("columnspacing","0.5em"):s.setAttribute("columnspacing","1em");let c="";const h=e.hLinesBeforeRow;l+=h[0].length>0?"left ":"",l+=h[h.length-1].length>0?"right ":"";for(let e=1;e<h.length-1;e++)c+=0===h[e].length?"none ":h[e][0]?"dashed ":"solid ";return/[sd]/.test(c)&&s.setAttribute("rowlines",c.trim()),""!==l&&(s=new Ct("menclose",[s]),s.setAttribute("notation",l.trim())),e.arraystretch&&e.arraystretch<1&&(s=new Ct("mstyle",[s]),s.setAttribute("scriptlevel","1")),s},yn=function(e,t){e.envName.includes("ed")||hn(e);const r=[],o=e.envName.includes("at")?"alignat":"align",s="split"===e.envName,i=pn(e.parser,{cols:r,addJot:!0,autoTag:s?void 0:un(e.envName),emptySingleRow:!0,colSeparationType:o,maxNumCols:s?2:void 0,leqno:e.parser.settings.leqno},"display");let l=0,a=0;const c={type:"ordgroup",mode:e.mode,body:[]};if(t[0]&&"ordgroup"===t[0].type){let e="";for(let r=0;r<t[0].body.length;r++){e+=or(t[0].body[r],"textord").text}l=Number(e),a=2*l}const h=!a;i.body.forEach(function(e){for(let t=1;t<e.length;t+=2){const r=or(e[t],"styling");or(r.body[0],"ordgroup").body.unshift(c)}if(h)a<e.length&&(a=e.length);else{const t=e.length/2;if(l<t)throw new n("Too many math in a row: expected "+l+", but got "+t,e[0])}});for(let e=0;e<a;++e){let t="r",n=0;e%2==1?t="l":e>0&&h&&(n=1),r[e]={type:"align",align:t,pregap:n,postgap:0}}return i.colSeparationType=h?"align":"alignat",i};nn({type:"array",names:["array","darray"],props:{numArgs:1},handler(e,t){const r=(ir(t[0])?[t[0]]:or(t[0],"ordgroup").body).map(function(e){const t=sr(e).text;if("lcr".includes(t))return{type:"align",align:t};if("|"===t)return{type:"separator",separator:"|"};if(":"===t)return{type:"separator",separator:":"};throw new n("Unknown column alignment: "+t,e)}),o={cols:r,hskipBeforeAndAfter:!0,maxNumCols:r.length};return pn(e.parser,o,dn(e.envName))},htmlBuilder:gn,mathmlBuilder:bn}),nn({type:"array",names:["matrix","pmatrix","bmatrix","Bmatrix","vmatrix","Vmatrix","matrix*","pmatrix*","bmatrix*","Bmatrix*","vmatrix*","Vmatrix*"],props:{numArgs:0},handler(e){const t={matrix:null,pmatrix:["(",")"],bmatrix:["[","]"],Bmatrix:["\\{","\\}"],vmatrix:["|","|"],Vmatrix:["\\Vert","\\Vert"]}[e.envName.replace("*","")];let r="c";const o={hskipBeforeAndAfter:!1,cols:[{type:"align",align:r}]};if("*"===e.envName.charAt(e.envName.length-1)){const t=e.parser;if(t.consumeSpaces(),"["===t.fetch().text){if(t.consume(),t.consumeSpaces(),r=t.fetch().text,!"lcr".includes(r))throw new n("Expected l or c or r",t.nextToken);t.consume(),t.consumeSpaces(),t.expect("]"),t.consume(),o.cols=[{type:"align",align:r}]}}const s=pn(e.parser,o,dn(e.envName)),i=Math.max(0,...s.body.map(e=>e.length));return s.cols=new Array(i).fill({type:"align",align:r}),t?{type:"leftright",mode:e.mode,body:[s],left:t[0],right:t[1],rightColor:void 0}:s},htmlBuilder:gn,mathmlBuilder:bn}),nn({type:"array",names:["smallmatrix"],props:{numArgs:0},handler(e){const t=pn(e.parser,{arraystretch:.5},"script");return t.colSeparationType="small",t},htmlBuilder:gn,mathmlBuilder:bn}),nn({type:"array",names:["subarray"],props:{numArgs:1},handler(e,t){const r=(ir(t[0])?[t[0]]:or(t[0],"ordgroup").body).map(function(e){const t=sr(e).text;if("lc".includes(t))return{type:"align",align:t};throw new n("Unknown column alignment: "+t,e)});if(r.length>1)throw new n("{subarray} can contain only one column");const o={cols:r,hskipBeforeAndAfter:!1,arraystretch:.5},s=pn(e.parser,o,"script");if(s.body.length>0&&s.body[0].length>1)throw new n("{subarray} can contain only one column");return s},htmlBuilder:gn,mathmlBuilder:bn}),nn({type:"array",names:["cases","dcases","rcases","drcases"],props:{numArgs:0},handler(e){const t=pn(e.parser,{arraystretch:1.2,cols:[{type:"align",align:"l",pregap:0,postgap:1},{type:"align",align:"l",pregap:0,postgap:0}]},dn(e.envName));return{type:"leftright",mode:e.mode,body:[t],left:e.envName.includes("r")?".":"\\{",right:e.envName.includes("r")?"\\}":".",rightColor:void 0}},htmlBuilder:gn,mathmlBuilder:bn}),nn({type:"array",names:["align","align*","aligned","split"],props:{numArgs:0},handler:yn,htmlBuilder:gn,mathmlBuilder:bn}),nn({type:"array",names:["gathered","gather","gather*"],props:{numArgs:0},handler(e){mn.has(e.envName)&&hn(e);const t={cols:[{type:"align",align:"c"}],addJot:!0,colSeparationType:"gather",autoTag:un(e.envName),emptySingleRow:!0,leqno:e.parser.settings.leqno};return pn(e.parser,t,"display")},htmlBuilder:gn,mathmlBuilder:bn}),nn({type:"array",names:["alignat","alignat*","alignedat"],props:{numArgs:1},handler:yn,htmlBuilder:gn,mathmlBuilder:bn}),nn({type:"array",names:["equation","equation*"],props:{numArgs:0},handler(e){hn(e);const t={autoTag:un(e.envName),emptySingleRow:!0,singleRow:!0,maxNumCols:1,leqno:e.parser.settings.leqno};return pn(e.parser,t,"display")},htmlBuilder:gn,mathmlBuilder:bn}),nn({type:"array",names:["CD"],props:{numArgs:0},handler(e){return hn(e),function(e){const t=[];for(e.gullet.beginGroup(),e.gullet.macros.set("\\cr","\\\\\\relax"),e.gullet.beginGroup();;){t.push(e.parseExpression(!1,"\\\\")),e.gullet.endGroup(),e.gullet.beginGroup();const r=e.fetch().text;if("&"!==r&&"\\\\"!==r){if("\\end"===r){0===t[t.length-1].length&&t.pop();break}throw new n("Expected \\\\ or \\cr or \\end",e.nextToken)}e.consume()}let r=[];const o=[r];for(let s=0;s<t.length;s++){const i=t[s];let l=fr();for(let t=0;t<i.length;t++)if(br(i[t])){r.push(l),t+=1;const o=sr(i[t]).text,s=new Array(2);if(s[0]={type:"ordgroup",mode:"math",body:[]},s[1]={type:"ordgroup",mode:"math",body:[]},"=|.".includes(o));else{if(!"<>AV".includes(o))throw new n('Expected one of "<>AV=|." after @',i[t]);for(let e=0;e<2;e++){let r=!0;for(let l=t+1;l<i.length;l++){if(yr(i[l],o)){r=!1,t=l;break}if(br(i[l]))throw new n("Missing a "+o+" character to complete a CD arrow.",i[l]);s[e].body.push(i[l])}if(r)throw new n("Missing a "+o+" character to complete a CD arrow.",i[t])}}const a={type:"styling",body:[xr(o,s,e)],mode:"math",style:"display",resetFont:!0};r.push(a),l=fr()}else l.body.push(i[t]);s%2==0?r.push(l):r.shift(),r=[],o.push(r)}return e.gullet.endGroup(),e.gullet.endGroup(),{type:"array",mode:"math",body:o,arraystretch:1,addJot:!0,rowGaps:[null],cols:new Array(o[0].length).fill({type:"align",align:"c",pregap:.25,postgap:.25}),colSeparationType:"CD",hLinesBeforeRow:new Array(o.length+1).fill([])}}(e.parser)},htmlBuilder:gn,mathmlBuilder:bn}),sn("\\nonumber","\\gdef\\@eqnsw{0}"),sn("\\notag","\\nonumber"),mt({type:"text",names:["\\hline","\\hdashline"],props:{numArgs:0,allowedInText:!0,allowedInMath:!0},handler(e,t){throw new n(e.funcName+" valid only within array environment")}});var xn=rn;mt({type:"environment",names:["\\begin","\\end"],props:{numArgs:1,argTypes:["text"]},handler(e,t){let{parser:r,funcName:o}=e;const s=t[0];if("ordgroup"!==s.type)throw new n("Invalid environment name",s);let i="";for(let e=0;e<s.body.length;++e)i+=or(s.body[e],"textord").text;if("\\begin"===o){if(!xn.hasOwnProperty(i))throw new n("No such environment: "+i,s);const e=xn[i],{args:t,optArgs:o}=r.parseArguments("\\begin{"+i+"}",e),l={mode:r.mode,envName:i,parser:r},a=e.handler(l,t,o);r.expect("\\end",!1);const c=r.nextToken,h=or(r.parseFunction(),"environment");if(h.name!==i)throw new n("Mismatch: \\begin{"+i+"} matched by \\end{"+h.name+"}",c);return a}return{type:"environment",mode:r.mode,name:i,nameGroup:s}}});const wn=(e,t)=>{const r=e.font,n=t.withFont(r);return Mt(e.body,n)},vn=(e,t)=>{const r=e.font,n=t.withFont(r);return Vt(e.body,n)},kn={"\\Bbb":"\\mathbb","\\bold":"\\mathbf","\\frak":"\\mathfrak"};mt({type:"font",names:["\\mathrm","\\mathit","\\mathbf","\\mathnormal","\\mathsfit","\\mathbb","\\mathcal","\\mathfrak","\\mathscr","\\mathsf","\\mathtt","\\Bbb","\\bold","\\frak"],props:{numArgs:1,allowedInArgument:!0},handler:(e,t)=>{let{parser:r,funcName:n}=e;const o=pt(t[0]);let s=n;return s in kn&&(s=kn[s]),{type:"font",mode:r.mode,font:s.slice(1),body:o}},htmlBuilder:wn,mathmlBuilder:vn}),mt({type:"mclass",names:["\\boldsymbol","\\bm"],props:{numArgs:1},handler:(e,t)=>{let{parser:r}=e;const n=t[0];return{type:"mclass",mode:r.mode,mclass:dr(n),body:[{type:"font",mode:r.mode,font:"boldsymbol",body:n}],isCharacterBox:m(n)}}}),mt({type:"font",names:["\\rm","\\sf","\\tt","\\bf","\\it","\\cal"],props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{let{parser:r,funcName:n,breakOnTokenText:o}=e;const{mode:s}=r,i=r.parseExpression(!0,o);return{type:"font",mode:s,font:"math"+n.slice(1),body:{type:"ordgroup",mode:r.mode,body:i}}},htmlBuilder:wn,mathmlBuilder:vn});const zn=(e,t)=>{if(!t)return e;return{type:"styling",mode:e.mode,style:t,body:[e]}};mt({type:"genfrac",names:["\\cfrac","\\dfrac","\\frac","\\tfrac","\\dbinom","\\binom","\\tbinom","\\\\atopfrac","\\\\bracefrac","\\\\brackfrac"],props:{numArgs:2,allowedInArgument:!0},handler:(e,t)=>{let{parser:r,funcName:n}=e;const o=t[0],s=t[1];let i,l=null,a=null;switch(n){case"\\cfrac":case"\\dfrac":case"\\frac":case"\\tfrac":i=!0;break;case"\\\\atopfrac":i=!1;break;case"\\dbinom":case"\\binom":case"\\tbinom":i=!1,l="(",a=")";break;case"\\\\bracefrac":i=!1,l="\\{",a="\\}";break;case"\\\\brackfrac":i=!1,l="[",a="]";break;default:throw new Error("Unrecognized genfrac command")}const c="\\cfrac"===n;let h=null;return c||n.startsWith("\\d")?h="display":n.startsWith("\\t")&&(h="text"),zn({type:"genfrac",mode:r.mode,numer:o,denom:s,continued:c,hasBarLine:i,leftDelim:l,rightDelim:a,barSize:null},h)},htmlBuilder:(e,t)=>{const r=t.style,n=r.fracNum(),o=r.fracDen();let s;s=t.havingStyle(n);const i=Mt(e.numer,s,t);if(e.continued){const e=8.5/t.fontMetrics().ptPerEm,r=3.5/t.fontMetrics().ptPerEm;i.height=i.height<e?e:i.height,i.depth=i.depth<r?r:i.depth}s=t.havingStyle(o);const l=Mt(e.denom,s,t);let a,c,h,m,u,p,d,g,f,b;if(e.hasBarLine?(e.barSize?(c=N(e.barSize,t),a=_e("frac-line",t,c)):a=_e("frac-line",t),c=a.height,h=a.height):(a=null,c=0,h=t.fontMetrics().defaultRuleThickness),r.size===S.DISPLAY.size?(m=t.fontMetrics().num1,u=c>0?3*h:7*h,p=t.fontMetrics().denom1):(c>0?(m=t.fontMetrics().num2,u=h):(m=t.fontMetrics().num3,u=3*h),p=t.fontMetrics().denom2),a){const e=t.fontMetrics().axisHeight;m-i.depth-(e+.5*c)<u&&(m+=u-(m-i.depth-(e+.5*c))),e-.5*c-(l.height-p)<u&&(p+=u-(e-.5*c-(l.height-p)));d=Ke({positionType:"individualShift",children:[{type:"elem",elem:l,shift:p},{type:"elem",elem:a,shift:-(e-.5*c)},{type:"elem",elem:i,shift:-m}]})}else{const e=m-i.depth-(l.height-p);e<u&&(m+=.5*(u-e),p+=.5*(u-e)),d=Ke({positionType:"individualShift",children:[{type:"elem",elem:l,shift:p},{type:"elem",elem:i,shift:-m}]})}return s=t.havingStyle(r),d.height*=s.sizeMultiplier/t.sizeMultiplier,d.depth*=s.sizeMultiplier/t.sizeMultiplier,g=r.size===S.DISPLAY.size?t.fontMetrics().delim1:r.size===S.SCRIPTSCRIPT.size?t.havingStyle(S.SCRIPT).fontMetrics().delim2:t.fontMetrics().delim2,f=null==e.leftDelim?St(t,["mopen"]):Wr(e.leftDelim,g,!0,t.havingStyle(r),e.mode,["mopen"]),b=e.continued?je([]):null==e.rightDelim?St(t,["mclose"]):Wr(e.rightDelim,g,!0,t.havingStyle(r),e.mode,["mclose"]),je(["mord"].concat(s.sizingClasses(t)),[f,je(["mfrac"],[d]),b],t)},mathmlBuilder:(e,t)=>{const r=new Ct("mfrac",[Vt(e.numer,t),Vt(e.denom,t)]);if(e.hasBarLine){if(e.barSize){const n=N(e.barSize,t);r.setAttribute("linethickness",O(n))}}else r.setAttribute("linethickness","0px");if(null!=e.leftDelim||null!=e.rightDelim){const t=[];if(null!=e.leftDelim){const r=new Ct("mo",[new qt(e.leftDelim.replace("\\",""))]);r.setAttribute("fence","true"),t.push(r)}if(t.push(r),null!=e.rightDelim){const r=new Ct("mo",[new qt(e.rightDelim.replace("\\",""))]);r.setAttribute("fence","true"),t.push(r)}return Nt(t)}return r}}),mt({type:"infix",names:["\\over","\\choose","\\atop","\\brace","\\brack"],props:{numArgs:0,infix:!0},handler(e){let t,{parser:r,funcName:n,token:o}=e;switch(n){case"\\over":t="\\frac";break;case"\\choose":t="\\binom";break;case"\\atop":t="\\\\atopfrac";break;case"\\brace":t="\\\\bracefrac";break;case"\\brack":t="\\\\brackfrac";break;default:throw new Error("Unrecognized infix genfrac command")}return{type:"infix",mode:r.mode,replaceWith:t,token:o}}});const Sn=["display","text","script","scriptscript"],Mn=function(e){let t=null;return e.length>0&&(t=e,t="."===t?null:t),t};mt({type:"genfrac",names:["\\genfrac"],props:{numArgs:6,allowedInArgument:!0,argTypes:["math","math","size","text","math","math"]},handler(e,t){let{parser:r}=e;const n=t[4],o=t[5],s=pt(t[0]),i="atom"===s.type&&"open"===s.family?Mn(s.text):null,l=pt(t[1]),a="atom"===l.type&&"close"===l.family?Mn(l.text):null,c=or(t[2],"size");let h,m=null;c.isBlank?h=!0:(m=c.value,h=m.number>0);let u=null,p=t[3];if("ordgroup"===p.type){if(p.body.length>0){const e=or(p.body[0],"textord");u=Sn[Number(e.text)]}}else p=or(p,"textord"),u=Sn[Number(p.text)];return zn({type:"genfrac",mode:r.mode,numer:n,denom:o,continued:!1,hasBarLine:h,barSize:m,leftDelim:i,rightDelim:a},u)}}),mt({type:"infix",names:["\\above"],props:{numArgs:1,argTypes:["size"],infix:!0},handler(e,t){let{parser:r,funcName:n,token:o}=e;return{type:"infix",mode:r.mode,replaceWith:"\\\\abovefrac",size:or(t[0],"size").value,token:o}}}),mt({type:"genfrac",names:["\\\\abovefrac"],props:{numArgs:3,argTypes:["math","size","math"]},handler:(e,t)=>{let{parser:r,funcName:n}=e;const o=t[0],s=or(t[1],"infix").size;if(!s)throw new Error("\\\\abovefrac expected size, but got "+String(s));const i=t[2],l=s.number>0;return{type:"genfrac",mode:r.mode,numer:o,denom:i,continued:!1,hasBarLine:l,barSize:s,leftDelim:null,rightDelim:null}}});const An=(e,t)=>{const r=t.style;let n,o;"supsub"===e.type?(n=e.sup?Mt(e.sup,t.havingStyle(r.sup()),t):Mt(e.sub,t.havingStyle(r.sub()),t),o=or(e.base,"horizBrace")):o=or(e,"horizBrace");const s=Mt(o.base,t.havingBaseStyle(S.DISPLAY)),i=tr(o,t);let l;if(l=o.isOver?Ke({positionType:"firstBaseline",children:[{type:"elem",elem:s},{type:"kern",size:.1},{type:"elem",elem:i,wrapperClasses:["svg-align"]}]}):Ke({positionType:"bottom",positionData:s.depth+.1+i.height,children:[{type:"elem",elem:i,wrapperClasses:["svg-align"]},{type:"kern",size:.1},{type:"elem",elem:s}]}),n){const e=je(["minner",o.isOver?"mover":"munder"],[l],t);l=o.isOver?Ke({positionType:"firstBaseline",children:[{type:"elem",elem:e},{type:"kern",size:.2},{type:"elem",elem:n}]}):Ke({positionType:"bottom",positionData:e.depth+.2+n.height+n.depth,children:[{type:"elem",elem:n},{type:"kern",size:.2},{type:"elem",elem:e}]})}return je(["minner",   o.isOver?"mover":"munder"],[l],t)};mt({type:"horizBrace",names:["\\overbrace","\\underbrace","\\overbracket","\\underbracket"],props:{numArgs:1},handler(e,t){let{parser:r,funcName:n}=e;return{type:"horizBrace",mode:r.mode,label:n,isOver:n.includes("\\over"),base:t[0]}},htmlBuilder:An,mathmlBuilder:(e,t)=>{const r=Jt(e.label);return new Ct(e.isOver?"mover":"munder",[Vt(e.base,t),r])}}),mt({type:"href",names:["\\href"],props:{numArgs:2,argTypes:["url","original"],allowedInText:!0},handler:(e,t)=>{let{parser:r}=e;const n=t[1],o=or(t[0],"url").url;return r.settings.isTrusted({command:"\\href",url:o})?{type:"href",mode:r.mode,href:o,body:dt(n)}:r.formatUnsupportedCmd("\\href")},htmlBuilder:(e,t)=>{const r=xt(e.body,t,!1);return function(e,t,r,n){const o=new X(e,t,r,n);return Ye(o),o}(e.href,[],r,t)},mathmlBuilder:(e,t)=>{let r=Ft(e.body,t);return r instanceof Ct||(r=new Ct("mrow",[r])),r.setAttribute("href",e.href),r}}),mt({type:"href",names:["\\url"],props:{numArgs:1,argTypes:["url"],allowedInText:!0},handler:(e,t)=>{let{parser:r}=e;const n=or(t[0],"url").url;if(!r.settings.isTrusted({command:"\\url",url:n}))return r.formatUnsupportedCmd("\\url");const o=[];for(let e=0;e<n.length;e++){let t=n[e];"~"===t&&(t="\\textasciitilde"),o.push({type:"textord",mode:"text",text:t})}const s={type:"text",mode:r.mode,font:"\\texttt",body:o};return{type:"href",mode:r.mode,href:n,body:dt(s)}}}),mt({type:"hbox",names:["\\hbox"],props:{numArgs:1,argTypes:["text"],allowedInText:!0,primitive:!0},handler(e,t){let{parser:r}=e;return{type:"hbox",mode:r.mode,body:dt(t[0])}},htmlBuilder(e,t){const r=xt(e.body,t.withFont(""),!1);return $e(r)},mathmlBuilder(e,t){return new Ct("mrow",Pt(e.body,t.withFont("")))}}),mt({type:"html",names:["\\htmlClass","\\htmlId","\\htmlStyle","\\htmlData"],props:{numArgs:2,argTypes:["raw","original"],allowedInText:!0},handler:(e,t)=>{let{parser:r,funcName:o,token:s}=e;const i=or(t[0],"raw").string,l=t[1];let a;r.settings.strict&&r.settings.reportNonstrict("htmlExtension","HTML extension is disabled on strict mode");const c={};switch(o){case"\\htmlClass":c.class=i,a={command:"\\htmlClass",class:i};break;case"\\htmlId":c.id=i,a={command:"\\htmlId",id:i};break;case"\\htmlStyle":c.style=i,a={command:"\\htmlStyle",style:i};break;case"\\htmlData":{const e=i.split(",");for(let t=0;t<e.length;t++){const r=e[t],o=r.indexOf("=");if(o<0)throw new n("\\htmlData key/value '"+r+"' missing equals sign");const s=r.slice(0,o),i=r.slice(o+1);c["data-"+s.trim()]=i}a={command:"\\htmlData",attributes:c};break}default:throw new Error("Unrecognized html command")}return r.settings.isTrusted(a)?{type:"html",mode:r.mode,attributes:c,body:dt(l)}:r.formatUnsupportedCmd(o)},htmlBuilder:(e,t)=>{const r=xt(e.body,t,!1),n=["enclosing"];e.attributes.class&&n.push(...e.attributes.class.trim().split(/\s+/));const o=je(n,r,t);for(const t in e.attributes)"class"!==t&&e.attributes.hasOwnProperty(t)&&o.setAttribute(t,e.attributes[t]);return o},mathmlBuilder:(e,t)=>Ft(e.body,t)}),mt({type:"htmlmathml",names:["\\html@mathml"],props:{numArgs:2,allowedInArgument:!0,allowedInText:!0},handler:(e,t)=>{let{parser:r}=e;return{type:"htmlmathml",mode:r.mode,html:dt(t[0]),mathml:dt(t[1])}},htmlBuilder:(e,t)=>{const r=xt(e.html,t,!1);return $e(r)},mathmlBuilder:(e,t)=>Ft(e.mathml,t)});const Tn=function(e){if(/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(e))return{number:+e,unit:"bp"};{const t=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(e);if(!t)throw new n("Invalid size: '"+e+"' in \\includegraphics");const r={number:+(t[1]+t[2]),unit:t[3]};if(!H(r))throw new n("Invalid unit: '"+r.unit+"' in \\includegraphics.");return r}};mt({type:"includegraphics",names:["\\includegraphics"],props:{numArgs:1,numOptionalArgs:1,argTypes:["raw","url"],allowedInText:!1},handler:(e,t,r)=>{let{parser:o}=e,s={number:0,unit:"em"},i={number:.9,unit:"em"},l={number:0,unit:"em"},a="";if(r[0]){const e=or(r[0],"raw").string.split(",");for(let t=0;t<e.length;t++){const r=e[t].split("=");if(2===r.length){const e=r[1].trim();switch(r[0].trim()){case"alt":a=e;break;case"width":s=Tn(e);break;case"height":i=Tn(e);break;case"totalheight":l=Tn(e);break;default:throw new n("Invalid key: '"+r[0]+"' in \\includegraphics.")}}}}const c=or(t[0],"url").url;return""===a&&(a=c,a=a.replace(/^.*[\\/]/,""),a=a.substring(0,a.lastIndexOf("."))),o.settings.isTrusted({command:"\\includegraphics",url:c})?{type:"includegraphics",mode:o.mode,alt:a,width:s,height:i,totalheight:l,src:c}:o.formatUnsupportedCmd("\\includegraphics")},htmlBuilder:(e,t)=>{const r=N(e.height,t);let n=0;e.totalheight.number>0&&(n=N(e.totalheight,t)-r);let o=0;e.width.number>0&&(o=N(e.width,t));const s={height:O(r+n)};o>0&&(s.width=O(o)),n>0&&(s.verticalAlign=O(-n));const i=new Y(e.src,e.alt,s);return i.height=r,i.depth=n,i},mathmlBuilder:(e,t)=>{const r=new Ct("mglyph",[]);r.setAttribute("alt",e.alt);const n=N(e.height,t);let o=0;if(e.totalheight.number>0&&(o=N(e.totalheight,t)-n,r.setAttribute("valign",O(-o))),r.setAttribute("height",O(n+o)),e.width.number>0){const n=N(e.width,t);r.setAttribute("width",O(n))}return r.setAttribute("src",e.src),r}}),mt({type:"kern",names:["\\kern","\\mkern","\\hskip","\\mskip"],props:{numArgs:1,argTypes:["size"],primitive:!0,allowedInText:!0},handler(e,t){let{parser:r,funcName:n}=e;const o=or(t[0],"size");if(r.settings.strict){const e="m"===n[1],t="mu"===o.value.unit;e?(t||r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" supports only mu units, not "+o.value.unit+" units"),"math"!==r.mode&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" works only in math mode")):t&&r.settings.reportNonstrict("mathVsTextUnits","LaTeX's "+n+" doesn't support mu units")}return{type:"kern",mode:r.mode,dimension:o.value}},htmlBuilder(e,t){return Je(e.dimension,t)},mathmlBuilder(e,t){const r=N(e.dimension,t);return new It(r)}}),mt({type:"lap",names:["\\mathllap","\\mathrlap","\\mathclap"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{let{parser:r,funcName:n}=e;const o=t[0];return{type:"lap",mode:r.mode,alignment:n.slice(5),body:o}},htmlBuilder:(e,t)=>{let r;"clap"===e.alignment?(r=je([],[Mt(e.body,t)]),r=je(["inner"],[r],t)):r=je(["inner"],[Mt(e.body,t)]);const n=je(["fix"],[]);let o=je([e.alignment],[r,n],t);const s=je(["strut"]);return s.style.height=O(o.height+o.depth),o.depth&&(s.style.verticalAlign=O(-o.depth)),o.children.unshift(s),o=je(["thinbox"],[o],t),je(["mord","vbox"],[o],t)},mathmlBuilder:(e,t)=>{const r=new Ct("mpadded",[Vt(e.body,t)]);if("rlap"!==e.alignment){const t="llap"===e.alignment?"-1":"-0.5";r.setAttribute("lspace",t+"width")}return r.setAttribute("width","0px"),r}}),mt({type:"styling",names:["\\(","$"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){let{funcName:r,parser:n}=e;const o=n.mode;n.switchMode("math");const s="\\("===r?"\\)":"$",i=n.parseExpression(!1,s);return n.expect(s),n.switchMode(o),{type:"styling",mode:n.mode,style:"text",resetFont:!0,body:i}}}),mt({type:"text",names:["\\)","\\]"],props:{numArgs:0,allowedInText:!0,allowedInMath:!1},handler(e,t){throw new n("Mismatched "+e.funcName)}});const Bn=(e,t)=>{switch(t.style.size){case S.DISPLAY.size:return e.display;case S.TEXT.size:return e.text;case S.SCRIPT.size:return e.script;case S.SCRIPTSCRIPT.size:return e.scriptscript;default:return e.text}};mt({type:"mathchoice",names:["\\mathchoice"],props:{numArgs:4,primitive:!0},handler:(e,t)=>{let{parser:r}=e;return{type:"mathchoice",mode:r.mode,display:dt(t[0]),text:dt(t[1]),script:dt(t[2]),scriptscript:dt(t[3])}},htmlBuilder:(e,t)=>{const r=Bn(e,t),n=xt(r,t,!1);return $e(n)},mathmlBuilder:(e,t)=>{const r=Bn(e,t);return Ft(r,t)}});const Cn=(e,t,r,n,o,s,i)=>{e=je([],[e]);const l=r&&m(r);let a,c,h;if(t){const e=Mt(t,n.havingStyle(o.sup()),n);c={elem:e,kern:Math.max(n.fontMetrics().bigOpSpacing1,n.fontMetrics().bigOpSpacing3-e.depth)}}if(r){const e=Mt(r,n.havingStyle(o.sub()),n);a={elem:e,kern:Math.max(n.fontMetrics().bigOpSpacing2,n.fontMetrics().bigOpSpacing4-e.height)}}if(c&&a){const t=n.fontMetrics().bigOpSpacing5+a.elem.height+a.elem.depth+a.kern+e.depth+i;h=Ke({positionType:"bottom",positionData:t,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:O(-s)},{type:"kern",size:a.kern},{type:"elem",elem:e},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:O(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}else if(a){const t=e.height-i;h=Ke({positionType:"top",positionData:t,children:[{type:"kern",size:n.fontMetrics().bigOpSpacing5},{type:"elem",elem:a.elem,marginLeft:O(-s)},{type:"kern",size:a.kern},{type:"elem",elem:e}]})}else{if(!c)return e;{const t=e.depth+i;h=Ke({positionType:"bottom",positionData:t,children:[{type:"elem",elem:e},{type:"kern",size:c.kern},{type:"elem",elem:c.elem,marginLeft:O(s)},{type:"kern",size:n.fontMetrics().bigOpSpacing5}]})}}const u=[h];if(a&&0!==s&&!l){const e=je(["mspace"],[],n);e.style.marginRight=O(s),u.unshift(e)}return je(["mop","op-limits"],u,n)},qn=new Set(["\\smallint"]),In=(e,t)=>{let r,n,o,s=!1;"supsub"===e.type?(r=e.sup,n=e.sub,o=or(e.base,"op"),s=!0):o=or(e,"op");const i=t.style;let l,a,c=!1;if(i.size===S.DISPLAY.size&&o.symbol&&!qn.has(o.name)&&(c=!0),o.symbol){const e=c?"Size2-Regular":"Size1-Regular";let r="";if("\\oiint"!==o.name&&"\\oiiint"!==o.name||(r=o.name.slice(1),o.name="oiint"===r?"\\iint":"\\iiint"),l=Fe(o.name,e,"math",t,["mop","op-symbol",c?"large-op":"small-op"]),a=l.italic,r.length>0){const e=rt(r+"Size"+(c?"2":"1"),t);l=Ke({positionType:"individualShift",children:[{type:"elem",elem:l,shift:0},{type:"elem",elem:e,shift:c?.08:0}]}),o.name="\\"+r,l.classes.unshift("mop"),l.italic=a}}else if(o.body){const e=xt(o.body,t,!0);1===e.length&&e[0]instanceof W?(l=e[0],l.classes[0]="mop"):l=je(["mop"],e,t)}else{const e=[];for(let r=1;r<o.name.length;r++)e.push(Ve(o.name[r],o.mode,t));l=je(["mop"],e,t)}let h=0,m=0;var u;(l instanceof W||"\\oiint"===o.name||"\\oiiint"===o.name)&&!o.suppressBaseShift&&(h=(l.height-l.depth)/2-t.fontMetrics().axisHeight,m=null!=(u=l.italic)?u:0);return s?Cn(l,r,n,t,i,m,h):(h&&(l.style.position="relative",l.style.top=O(h)),l)},Rn=(e,t)=>{let r;if(e.symbol)r=new Ct("mo",[Ht(e.name,e.mode)]),qn.has(e.name)&&r.setAttribute("largeop","false");else if(e.body)r=new Ct("mo",Pt(e.body,t));else{r=new Ct("mi",[new qt(e.name.slice(1))]);const t=new Ct("mo",[Ht("\u2061","text")]);r=e.parentIsSupSub?new Ct("mrow",[r,t]):Bt([r,t])}return r},En={"\u220f":"\\prod","\u2210":"\\coprod","\u2211":"\\sum","\u22c0":"\\bigwedge","\u22c1":"\\bigvee","\u22c2":"\\bigcap","\u22c3":"\\bigcup","\u2a00":"\\bigodot","\u2a01":"\\bigoplus","\u2a02":"\\bigotimes","\u2a04":"\\biguplus","\u2a06":"\\bigsqcup"};mt({type:"op",names:["\\coprod","\\bigvee","\\bigwedge","\\biguplus","\\bigcap","\\bigcup","\\intop","\\prod","\\sum","\\bigotimes","\\bigoplus","\\bigodot","\\bigsqcup","\\smallint","\u220f","\u2210","\u2211","\u22c0","\u22c1","\u22c2","\u22c3","\u2a00","\u2a01","\u2a02","\u2a04","\u2a06"],props:{numArgs:0},handler:(e,t)=>{let{parser:r,funcName:n}=e,o=n;return 1===o.length&&(o=En[o]),{type:"op",mode:r.mode,limits:!0,parentIsSupSub:!1,symbol:!0,name:o}},htmlBuilder:In,mathmlBuilder:Rn}),mt({type:"op",names:["\\mathop"],props:{numArgs:1,primitive:!0},handler:(e,t)=>{let{parser:r}=e;const n=t[0];return{type:"op",mode:r.mode,limits:!1,parentIsSupSub:!1,symbol:!1,body:dt(n)}},htmlBuilder:In,mathmlBuilder:Rn});const Hn={"\u222b":"\\int","\u222c":"\\iint","\u222d":"\\iiint","\u222e":"\\oint","\u222f":"\\oiint","\u2230":"\\oiiint"};mt({type:"op",names:["\\arcsin","\\arccos","\\arctan","\\arctg","\\arcctg","\\arg","\\ch","\\cos","\\cosec","\\cosh","\\cot","\\cotg","\\coth","\\csc","\\ctg","\\cth","\\deg","\\dim","\\exp","\\hom","\\ker","\\lg","\\ln","\\log","\\sec","\\sin","\\sinh","\\sh","\\tan","\\tanh","\\tg","\\th"],props:{numArgs:0},handler(e){let{parser:t,funcName:r}=e;return{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:In,mathmlBuilder:Rn}),mt({type:"op",names:["\\det","\\gcd","\\inf","\\lim","\\max","\\min","\\Pr","\\sup"],props:{numArgs:0},handler(e){let{parser:t,funcName:r}=e;return{type:"op",mode:t.mode,limits:!0,parentIsSupSub:!1,symbol:!1,name:r}},htmlBuilder:In,mathmlBuilder:Rn}),mt({type:"op",names:["\\int","\\iint","\\iiint","\\oint","\\oiint","\\oiiint","\u222b","\u222c","\u222d","\u222e","\u222f","\u2230"],props:{numArgs:0,allowedInArgument:!0},handler(e){let{parser:t,funcName:r}=e,n=r;return 1===n.length&&(n=Hn[n]),{type:"op",mode:t.mode,limits:!1,parentIsSupSub:!1,symbol:!0,name:n}},htmlBuilder:In,mathmlBuilder:Rn});const Nn=(e,t)=>{let r,n,o,s,i=!1;if("supsub"===e.type?(r=e.sup,n=e.sub,o=or(e.base,"operatorname"),i=!0):o=or(e,"operatorname"),o.body.length>0){const e=o.body.map(e=>{const t="text"in e?e.text:void 0;return"string"==typeof t?{type:"textord",mode:e.mode,text:t}:e}),r=xt(e,t.withFont("mathrm"),!0);for(let e=0;e<r.length;e++){const t=r[e];t instanceof W&&(t.text=t.text.replace(/\u2212/,"-").replace(/\u2217/,"*"))}s=je(["mop"],r,t)}else s=je(["mop"],[],t);return i?Cn(s,r,n,t,t.style,0,0):s};function On(e,t,r){const n=xt(e,t,!1),o=t.sizeMultiplier/r.sizeMultiplier;for(let e=0;e<n.length;e++){const s=n[e].classes.indexOf("sizing");s<0?Array.prototype.push.apply(n[e].classes,t.sizingClasses(r)):n[e].classes[s+1]==="reset-size"+t.size&&(n[e].classes[s+1]="reset-size"+r.size),n[e].height*=o,n[e].depth*=o}return $e(n)}mt({type:"operatorname",names:["\\operatorname@","\\operatornamewithlimits"],props:{numArgs:1},handler:(e,t)=>{let{parser:r,funcName:n}=e;const o=t[0];return{type:"operatorname",mode:r.mode,body:dt(o),alwaysHandleSupSub:"\\operatornamewithlimits"===n,limits:!1,parentIsSupSub:!1}},htmlBuilder:Nn,mathmlBuilder:(e,t)=>{let r=Pt(e.body,t.withFont("mathrm")),n=!0;for(let e=0;e<r.length;e++){const t=r[e];if(t instanceof It);else if(t instanceof Ct)switch(t.type){case"mi":case"mn":case"mspace":case"mtext":break;case"mo":{const e=t.children[0];1===t.children.length&&e instanceof qt?e.text=e.text.replace(/\u2212/,"-").replace(/\u2217/,"*"):n=!1;break}default:n=!1}else n=!1}if(n){const e=r.map(e=>e.toText()).join("");r=[new qt(e)]}const o=new Ct("mi",r);o.setAttribute("mathvariant","normal");const s=new Ct("mo",[Ht("\u2061","text")]);return e.parentIsSupSub?new Ct("mrow",[o,s]):Bt([o,s])}}),sn("\\operatorname","\\@ifstar\\operatornamewithlimits\\operatorname@"),ut({type:"ordgroup",htmlBuilder(e,t){return e.semisimple?$e(xt(e.body,t,!1)):je(["mord"],xt(e.body,t,!0),t)},mathmlBuilder(e,t){return Ft(e.body,t,!0)}}),mt({type:"overline",names:["\\overline"],props:{numArgs:1},handler(e,t){let{parser:r}=e;const n=t[0];return{type:"overline",mode:r.mode,body:n}},htmlBuilder(e,t){const r=Mt(e.body,t.havingCrampedStyle()),n=_e("overline-line",t),o=t.fontMetrics().defaultRuleThickness,s=Ke({positionType:"firstBaseline",children:[{type:"elem",elem:r},{type:"kern",size:3*o},{type:"elem",elem:n},{type:"kern",size:o}]});return je(["mord","overline"],[s],t)},mathmlBuilder(e,t){const r=new Ct("mo",[new qt("\u203e")]);r.setAttribute("stretchy","true");const n=new Ct("mover",[Vt(e.body,t),r]);return n.setAttribute("accent","true"),n}}),mt({type:"phantom",names:["\\phantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{let{parser:r}=e;const n=t[0];return{type:"phantom",mode:r.mode,body:dt(n)}},htmlBuilder:(e,t)=>{const r=xt(e.body,t.withPhantom(),!1);return $e(r)},mathmlBuilder:(e,t)=>{const r=Pt(e.body,t);return new Ct("mphantom",r)}}),sn("\\hphantom","\\smash{\\phantom{#1}}"),mt({type:"vphantom",names:["\\vphantom"],props:{numArgs:1,allowedInText:!0},handler:(e,t)=>{let{parser:r}=e;const n=t[0];return{type:"vphantom",mode:r.mode,body:n}},htmlBuilder:(e,t)=>{const r=je(["inner"],[Mt(e.body,t.withPhantom())]),n=je(["fix"],[]);return je(["mord","rlap"],[r,n],t)},mathmlBuilder:(e,t)=>{const r=Pt(dt(e.body),t),n=new Ct("mphantom",r),o=new Ct("mpadded",[n]);return o.setAttribute("width","0px"),o}}),mt({type:"raisebox",names:["\\raisebox"],props:{numArgs:2,argTypes:["size","hbox"],allowedInText:!0},handler(e,t){let{parser:r}=e;const n=or(t[0],"size").value,o=t[1];return{type:"raisebox",mode:r.mode,dy:n,body:o}},htmlBuilder(e,t){const r=Mt(e.body,t),n=N(e.dy,t);return Ke({positionType:"shift",positionData:-n,children:[{type:"elem",elem:r}]})},mathmlBuilder(e,t){const r=new Ct("mpadded",[Vt(e.body,t)]),n=e.dy.number+e.dy.unit;return r.setAttribute("voffset",n),r}}),mt({type:"internal",names:["\\relax"],props:{numArgs:0,allowedInText:!0,allowedInArgument:!0},handler(e){let{parser:t}=e;return{type:"internal",mode:t.mode}}}),mt({type:"rule",names:["\\rule"],props:{numArgs:2,numOptionalArgs:1,allowedInText:!0,allowedInMath:!0,argTypes:["size","size","size"]},handler(e,t,r){let{parser:n}=e;const o=r[0],s=or(t[0],"size"),i=or(t[1],"size");return{type:"rule",mode:n.mode,shift:o&&or(o,"size").value,width:s.value,height:i.value}},htmlBuilder(e,t){const r=je(["mord","rule"],[],t),n=N(e.width,t),o=N(e.height,t),s=e.shift?N(e.shift,t):0;return r.style.borderRightWidth=O(n),r.style.borderTopWidth=O(o),r.style.bottom=O(s),r.width=n,r.height=o+s,r.depth=-s,r.maxFontSize=1.125*o*t.sizeMultiplier,r},mathmlBuilder(e,t){const r=N(e.width,t),n=N(e.height,t),o=e.shift?N(e.shift,t):0,s=t.color&&t.getColor()||"black",i=new Ct("mspace");i.setAttribute("mathbackground",s),i.setAttribute("width",O(r)),i.setAttribute("height",O(n));const l=new Ct("mpadded",[i]);return o>=0?l.setAttribute("height",O(o)):(l.setAttribute("height",O(o)),l.setAttribute("depth",O(-o))),l.setAttribute("voffset",O(o)),l}});const Dn=["\\tiny","\\sixptsize","\\scriptsize","\\footnotesize","\\small","\\normalsize","\\large","\\Large","\\LARGE","\\huge","\\Huge"];mt({type:"sizing",names:Dn,props:{numArgs:0,allowedInText:!0},handler:(e,t)=>{let{breakOnTokenText:r,funcName:n,parser:o}=e;const s=o.parseExpression(!1,r);return{type:"sizing",mode:o.mode,size:Dn.indexOf(n)+1,body:s}},htmlBuilder:(e,t)=>{const r=t.havingSize(e.size);return On(e.body,r,t)},mathmlBuilder:(e,t)=>{const r=t.havingSize(e.size),n=Pt(e.body,r),o=new Ct("mstyle",n);return o.setAttribute("mathsize",O(r.sizeMultiplier)),o}}),mt({type:"smash",names:["\\smash"],props:{numArgs:1,numOptionalArgs:1,allowedInText:!0},handler:(e,t,r)=>{let{parser:n}=e,o=!1,s=!1;const i=r[0]&&or(r[0],"ordgroup");if(i){let e;for(let t=0;t<i.body.length;++t){if(e=sr(i.body[t]).text,"t"===e)o=!0;else{if("b"!==e){o=!1,s=!1;break}s=!0}}}else o=!0,s=!0;const l=t[0];return{type:"smash",mode:n.mode,body:l,smashHeight:o,smashDepth:s}},htmlBuilder:(e,t)=>{const r=je([],[Mt(e.body,t)]);if(!e.smashHeight&&!e.smashDepth)return r;if(e.smashHeight&&(r.height=0),e.smashDepth&&(r.depth=0),e.smashHeight&&e.smashDepth)return je(["mord","smash"],[r],t);if(r.children)for(let t=0;t<r.children.length;t++)e.smashHeight&&(r.children[t].height=0),e.smashDepth&&(r.children[t].depth=0);const n=Ke({positionType:"firstBaseline",children:[{type:"elem",elem:r}]});return je(["mord"],[n],t)},mathmlBuilder:(e,t)=>{const r=new Ct("mpadded",[Vt(e.body,t)]);return e.smashHeight&&r.setAttribute("height","0px"),e.smashDepth&&r.setAttribute("depth","0px"),r}}),mt({type:"sqrt",names:["\\sqrt"],props:{numArgs:1,numOptionalArgs:1},handler(e,t,r){let{parser:n}=e;const o=r[0],s=t[0];return{type:"sqrt",mode:n.mode,body:s,index:o}},htmlBuilder(e,t){let r=Mt(e.body,t.havingCrampedStyle());0===r.height&&(r.height=t.fontMetrics().xHeight),r=Ze(r,t);const n=t.fontMetrics().defaultRuleThickness;let o=n;t.style.id<S.TEXT.id&&(o=t.fontMetrics().xHeight);let s=n+o/4;const i=r.height+r.depth+s+n,{span:l,ruleWidth:a,advanceWidth:c}=function(e,t){const r=t.havingBaseSizing(),n=jr("\\surd",e*r.sizeMultiplier,Xr,r);let o=r.sizeMultiplier;const s=Math.max(0,t.minRuleThickness-t.fontMetrics().sqrtRuleThickness);let i,l,a,c,h;return"small"===n.type?(c=1e3+1e3*s+80,e<1?o=1:e<1.4&&(o=.7),l=(1+s+Nr)/o,a=(1+s)/o,i=Or("sqrtMain",l,c,s,t),i.style.minWidth="0.853em",h=.833/o):"large"===n.type?(c=1080*Fr[n.size],a=(Fr[n.size]+s)/o,l=(Fr[n.size]+s+Nr)/o,i=Or("sqrtSize"+n.size,l,c,s,t),i.style.minWidth="1.02em",h=1/o):(l=e+s+Nr,a=e+s,c=Math.floor(1e3*e+s)+80,i=Or("sqrtTall",l,c,s,t),i.style.minWidth="0.742em",h=1.056),i.height=a,i.style.height=O(l),{span:i,advanceWidth:h,ruleWidth:(t.fontMetrics().sqrtRuleThickness+s)*o}}(i,t),h=l.height-a;h>r.height+r.depth+s&&(s=(s+h-r.height-r.depth)/2);const m=l.height-r.height-s-a;r.style.paddingLeft=O(c);const u=Ke({positionType:"firstBaseline",children:[{type:"elem",elem:r,wrapperClasses:["svg-align"]},{type:"kern",size:-(r.height+m)},{type:"elem",elem:l},{type:"kern",size:a}]});if(e.index){const r=t.havingStyle(S.SCRIPTSCRIPT),n=Mt(e.index,r,t),o=.6*(u.height-u.depth),s=Ke({positionType:"shift",positionData:-o,children:[{type:"elem",elem:n}]}),i=je(["root"],[s]);return je(["mord","sqrt"],[i,u],t)}return je(["mord","sqrt"],[u],t)},mathmlBuilder(e,t){const{body:r,index:n}=e;return n?new Ct("mroot",[Vt(r,t),Vt(n,t)]):new Ct("msqrt",[Vt(r,t)])}});const Ln={display:S.DISPLAY,text:S.TEXT,script:S.SCRIPT,scriptscript:S.SCRIPTSCRIPT};mt({type:"styling",names:["\\displaystyle","\\textstyle","\\scriptstyle","\\scriptscriptstyle"],props:{numArgs:0,allowedInText:!0,primitive:!0},handler(e,t){let{breakOnTokenText:r,funcName:n,parser:o}=e;const s=o.parseExpression(!0,r),i=n.slice(1,n.length-5);if(!(i in Ln))throw new Error("Unknown style: "+i);return{type:"styling",mode:o.mode,style:i,body:s}},htmlBuilder(e,t){const r=Ln[e.style];let n=t.havingStyle(r);return e.resetFont&&(n=n.withFont("")),On(e.body,n,t)},mathmlBuilder(e,t){const r=Ln[e.style];let n=t.havingStyle(r);e.resetFont&&(n=n.withFont(""));const o=Pt(e.body,n),s=new Ct("mstyle",o),i={display:["0","true"],text:["0","false"],script:["1","false"],scriptscript:["2","false"]}[e.style];return s.setAttribute("scriptlevel",i[0]),s.setAttribute("displaystyle",i[1]),s}});ut({type:"supsub",htmlBuilder(e,t){const r=function(e,t){const r=e.base;if(r)return"op"===r.type?r.limits&&(t.style.size===S.DISPLAY.size||r.alwaysHandleSupSub)?In:null:"operatorname"===r.type?r.alwaysHandleSupSub&&(t.style.size===S.DISPLAY.size||r.limits)?Nn:null:"accent"===r.type?m(r.base)?ar:null:"horizBrace"===r.type&&!e.sub===r.isOver?An:null;return null}(e,t);if(r)return r(e,t);const{base:n,sup:o,sub:s}=e,i=Mt(n,t);let l,a;const c=t.fontMetrics();let h=0,u=0;const p=n&&m(n);if(o){const e=t.havingStyle(t.style.sup());l=Mt(o,e,t),p||(h=i.height-e.fontMetrics().supDrop*e.sizeMultiplier/t.sizeMultiplier)}if(s){const e=t.havingStyle(t.style.sub());a=Mt(s,e,t),p||(u=i.depth+e.fontMetrics().subDrop*e.sizeMultiplier/t.sizeMultiplier)}let d;d=t.style===S.DISPLAY?c.sup1:t.style.cramped?c.sup3:c.sup2;const g=t.sizeMultiplier,f=O(.5/c.ptPerEm/g);let b,y=null;if(a){const t=e.base&&"op"===e.base.type&&e.base.name&&("\\oiint"===e.base.name||"\\oiiint"===e.base.name);var x;if(i instanceof W||t)y=O(-(null!=(x=i.italic)?x:0))}if(l&&a){h=Math.max(h,d,l.depth+.25*c.xHeight),u=Math.max(u,c.sub2);const e=4*c.defaultRuleThickness;if(h-l.depth-(a.height-u)<e){u=e-(h-l.depth)+a.height;const t=.8*c.xHeight-(h-l.depth);t>0&&(h+=t,u-=t)}b=Ke({positionType:"individualShift",children:[{type:"elem",elem:a,shift:u,marginRight:f,marginLeft:y},{type:"elem",elem:l,shift:-h,marginRight:f}]})}else if(a){u=Math.max(u,c.sub1,a.height-.8*c.xHeight);b=Ke({positionType:"shift",positionData:u,children:[{type:"elem",elem:a,marginLeft:y,marginRight:f}]})}else{if(!l)throw new Error("supsub must have either sup or sub.");h=Math.max(h,d,l.depth+.25*c.xHeight),b=Ke({positionType:"shift",positionData:-h,children:[{type:"elem",elem:l,marginRight:f}]})}const w=zt(i,"right")||"mord";return je([w],[i,je(["msupsub"],[b])],t)},mathmlBuilder(e,t){let r,n,o=!1;e.base&&"horizBrace"===e.base.type&&(n=!!e.sup,n===e.base.isOver&&(o=!0,r=e.base.isOver)),!e.base||"op"!==e.base.type&&"operatorname"!==e.base.type||(e.base.parentIsSupSub=!0);const s=[Vt(e.base,t)];let i;if(e.sub&&s.push(Vt(e.sub,t)),e.sup&&s.push(Vt(e.sup,t)),o)i=r?"mover":"munder";else if(e.sub)if(e.sup){const r=e.base;i=r&&"op"===r.type&&r.limits&&t.style===S.DISPLAY||r&&"operatorname"===r.type&&r.alwaysHandleSupSub&&(t.style===S.DISPLAY||r.limits)?"munderover":"msubsup"}else{const r=e.base;i=r&&"op"===r.type&&r.limits&&(t.style===S.DISPLAY||r.alwaysHandleSupSub)||r&&"operatorname"===r.type&&r.alwaysHandleSupSub&&(r.limits||t.style===S.DISPLAY)?"munder":"msub"}else{const r=e.base;i=r&&"op"===r.type&&r.limits&&(t.style===S.DISPLAY||r.alwaysHandleSupSub)||r&&"operatorname"===r.type&&r.alwaysHandleSupSub&&(r.limits||t.style===S.DISPLAY)?"mover":"msup"}return new Ct(i,s)}}),ut({type:"atom",htmlBuilder(e,t){return Ve(e.text,e.mode,t,["m"+e.family])},mathmlBuilder(e,t){const r=new Ct("mo",[Ht(e.text,e.mode)]);if("bin"===e.family){const n=Dt(e,t);"bold-italic"===n&&r.setAttribute("mathvariant",n)}else"punct"===e.family?r.setAttribute("separator","true"):"open"!==e.family&&"close"!==e.family||r.setAttribute("stretchy","false");return r}});const Pn={mi:"italic",mn:"normal",mtext:"normal"};ut({type:"mathord",htmlBuilder(e,t){return Ge(e,t,"mathord")},mathmlBuilder(e,t){const r=new Ct("mi",[Ht(e.text,e.mode,t)]),n=Dt(e,t)||"italic";return n!==Pn[r.type]&&r.setAttribute("mathvariant",n),r}}),ut({type:"textord",htmlBuilder(e,t){return Ge(e,t,"textord")},mathmlBuilder(e,t){const r=Ht(e.text,e.mode,t),n=Dt(e,t)||"normal";let o;return o="text"===e.mode?new Ct("mtext",[r]):/[0-9]/.test(e.text)?new Ct("mn",[r]):"\\prime"===e.text?new Ct("mo",[r]):new Ct("mi",[r]),n!==Pn[o.type]&&o.setAttribute("mathvariant",n),o}});const Fn={"\\nobreak":"nobreak","\\allowbreak":"allowbreak"},Vn={" ":{},"\\ ":{},"~":{className:"nobreak"},"\\space":{},"\\nobreakspace":{className:"nobreak"}};ut({type:"spacing",htmlBuilder(e,t){if(Vn.hasOwnProperty(e.text)){const r=Vn[e.text].className||"";if("text"===e.mode){const n=Ge(e,t,"textord");return n.classes.push(r),n}return je(["mspace",r],[Ve(e.text,e.mode,t)],t)}if(Fn.hasOwnProperty(e.text))return je(["mspace",Fn[e.text]],[],t);throw new n('Unknown type of space "'+e.text+'"')},mathmlBuilder(e,t){let r;if(!Vn.hasOwnProperty(e.text)){if(Fn.hasOwnProperty(e.text))return new Ct("mspace");throw new n('Unknown type of space "'+e.text+'"')}return r=new Ct("mtext",[new qt("\xa0")]),r}});const Gn=()=>{const e=new Ct("mtd",[]);return e.setAttribute("width","50%"),e};ut({type:"tag",mathmlBuilder(e,t){const r=new Ct("mtable",[new Ct("mtr",[Gn(),new Ct("mtd",[Ft(e.body,t)]),Gn(),new Ct("mtd",[Ft(e.tag,t)])])]);return r.setAttribute("width","100%"),r}});const Un={"\\text":void 0,"\\textrm":"textrm","\\textsf":"textsf","\\texttt":"texttt","\\textnormal":"textrm"},Xn={"\\textbf":"textbf","\\textmd":"textmd"},Yn={"\\textit":"textit","\\textup":"textup"},jn=(e,t)=>{const r=e.font;return r?Un[r]?t.withTextFontFamily(Un[r]):Xn[r]?t.withTextFontWeight(Xn[r]):"\\emph"===r?"textit"===t.fontShape?t.withTextFontShape("textup"):t.withTextFontShape("textit"):t.withTextFontShape(Yn[r]):t};mt({type:"text",names:["\\text","\\textrm","\\textsf","\\texttt","\\textnormal","\\textbf","\\textmd","\\textit","\\textup","\\emph"],props:{numArgs:1,argTypes:["text"],allowedInArgument:!0,allowedInText:!0},handler(e,t){let{parser:r,funcName:n}=e;const o=t[0];return{type:"text",mode:r.mode,body:dt(o),font:n}},htmlBuilder(e,t){const r=jn(e,t),n=xt(e.body,r,!0);return je(["mord","text"],n,r)},mathmlBuilder(e,t){const r=jn(e,t);return Ft(e.body,r)}}),mt({type:"underline",names:["\\underline"],props:{numArgs:1,allowedInText:!0},handler(e,t){let{parser:r}=e;return{type:"underline",mode:r.mode,body:t[0]}},htmlBuilder(e,t){const r=Mt(e.body,t),n=_e("underline-line",t),o=t.fontMetrics().defaultRuleThickness,s=Ke({positionType:"top",positionData:r.height,children:[{type:"kern",size:o},{type:"elem",elem:n},{type:"kern",size:3*o},{type:"elem",elem:r}]});return je(["mord","underline"],[s],t)},mathmlBuilder(e,t){const r=new Ct("mo",[new qt("\u203e")]);r.setAttribute("stretchy","true");const n=new Ct("munder",[Vt(e.body,t),r]);return n.setAttribute("accentunder","true"),n}}),mt({type:"vcenter",names:["\\vcenter"],props:{numArgs:1,argTypes:["original"],allowedInText:!1},handler(e,t){let{parser:r}=e;return{type:"vcenter",mode:r.mode,body:t[0]}},htmlBuilder(e,t){const r=Mt(e.body,t),n=t.fontMetrics().axisHeight,o=.5*(r.height-n-(r.depth+n));return Ke({positionType:"shift",positionData:o,children:[{type:"elem",elem:r}]})},mathmlBuilder(e,t){const r=new Ct("mpadded",[Vt(e.body,t)],["vcenter"]);return new Ct("mrow",[r])}}),mt({type:"verb",names:["\\verb"],props:{numArgs:0,allowedInText:!0},handler(e,t,r){throw new n("\\verb ended by end of line instead of matching delimiter")},htmlBuilder(e,t){const r=Wn(e),n=[],o=t.havingStyle(t.style.text());for(let t=0;t<r.length;t++){let s=r[t];"~"===s&&(s="\\textasciitilde"),n.push(Fe(s,"Typewriter-Regular",e.mode,o,["mord","texttt"]))}return je(["mord","text"].concat(o.sizingClasses(t)),Xe(n),o)},mathmlBuilder(e,t){const r=new qt(Wn(e)),n=new Ct("mtext",[r]);return n.setAttribute("mathvariant","monospace"),n}});const Wn=e=>e.body.replace(/ /g,e.star?"\u2423":"\xa0");var _n=at;const $n="[ \r\n\t]",Zn="(\\\\[a-zA-Z@]+)"+$n+"*",Kn="[\u0300-\u036f]",Jn=new RegExp(Kn+"+$"),Qn="("+$n+"+)|\\\\(\n|[ \r\t]+\n?)[ \r\t]*|([!-\\[\\]-\u2027\u202a-\ud7ff\uf900-\uffff]"+Kn+"*|[\ud800-\udbff][\udc00-\udfff]"+Kn+"*|\\\\verb\\*([^]).*?\\4|\\\\verb([^*a-zA-Z]).*?\\5|"+Zn+"|\\\\[^\ud800-\udfff])";class eo{constructor(e,t){this.input=void 0,this.settings=void 0,this.tokenRegex=void 0,this.catcodes=void 0,this.input=e,this.settings=t,this.tokenRegex=new RegExp(Qn,"g"),this.catcodes={"%":14,"~":13}}setCatcode(e,t){this.catcodes[e]=t}lex(){const e=this.input,t=this.tokenRegex.lastIndex;if(t===e.length)return new an("EOF",new ln(this,t,t));const r=this.tokenRegex.exec(e);if(null===r||r.index!==t)throw new n("Unexpected character: '"+e[t]+"'",new an(e[t],new ln(this,t,t+1)));const o=r[6]||r[3]||(r[2]?"\\ ":" ");if(14===this.catcodes[o]){const t=e.indexOf("\n",this.tokenRegex.lastIndex);return-1===t?(this.tokenRegex.lastIndex=e.length,this.settings.reportNonstrict("commentAtEnd","% comment has no terminating newline; LaTeX would fail because of commenting the end of math mode (e.g. $)")):this.tokenRegex.lastIndex=t+1,this.lex()}return new an(o,new ln(this,t,this.tokenRegex.lastIndex))}}class to{constructor(e,t){void 0===e&&(e={}),void 0===t&&(t={}),this.current=void 0,this.builtins=void 0,this.undefStack=void 0,this.current=t,this.builtins=e,this.undefStack=[]}beginGroup(){this.undefStack.push({})}endGroup(){if(0===this.undefStack.length)throw new n("Unbalanced namespace destruction: attempt to pop global namespace; please report this as a bug");const e=this.undefStack.pop();for(const t in e)e.hasOwnProperty(t)&&(null==e[t]?delete this.current[t]:this.current[t]=e[t])}endGroups(){for(;this.undefStack.length>0;)this.endGroup()}has(e){return this.current.hasOwnProperty(e)||this.builtins.hasOwnProperty(e)}get(e){return this.current.hasOwnProperty(e)?this.current[e]:this.builtins[e]}set(e,t,r){if(void 0===r&&(r=!1),r){for(let t=0;t<this.undefStack.length;t++)delete this.undefStack[t][e];this.undefStack.length>0&&(this.undefStack[this.undefStack.length-1][e]=t)}else{const t=this.undefStack[this.undefStack.length-1];t&&!t.hasOwnProperty(e)&&(t[e]=this.current[e])}null==t?delete this.current[e]:this.current[e]=t}}var ro=on;sn("\\noexpand",function(e){const t=e.popToken();return e.isExpandable(t.text)&&(t.noexpand=!0,t.treatAsRelax=!0),{tokens:[t],numArgs:0}}),sn("\\expandafter",function(e){const t=e.popToken();return e.expandOnce(!0),{tokens:[t],numArgs:0}}),sn("\\@firstoftwo",function(e){return{tokens:e.consumeArgs(2)[0],numArgs:0}}),sn("\\@secondoftwo",function(e){return{tokens:e.consumeArgs(2)[1],numArgs:0}}),sn("\\@ifnextchar",function(e){const t=e.consumeArgs(3);e.consumeSpaces();const r=e.future();return 1===t[0].length&&t[0][0].text===r.text?{tokens:t[1],numArgs:0}:{tokens:t[2],numArgs:0}}),sn("\\@ifstar","\\@ifnextchar *{\\@firstoftwo{#1}}"),sn("\\TextOrMath",function(e){const t=e.consumeArgs(2);return"text"===e.mode?{tokens:t[0],numArgs:0}:{tokens:t[1],numArgs:0}});const no={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,a:10,A:10,b:11,B:11,c:12,C:12,d:13,D:13,e:14,E:14,f:15,F:15};sn("\\char",function(e){let t,r=e.popToken(),o=0;if("'"===r.text)t=8,r=e.popToken();else if('"'===r.text)t=16,r=e.popToken();else if("`"===r.text)if(r=e.popToken(),"\\"===r.text[0])o=r.text.charCodeAt(1);else{if("EOF"===r.text)throw new n("\\char` missing argument");o=r.text.charCodeAt(0)}else t=10;if(t){if(o=no[r.text],null==o||o>=t)throw new n("Invalid base-"+t+" digit "+r.text);let s;for(;null!=(s=no[e.future().text])&&s<t;)o*=t,o+=s,e.popToken()}return"\\@char{"+o+"}"});const oo=(e,t,r,o)=>{let s=e.consumeArg().tokens;if(1!==s.length)throw new n("\\newcommand's first argument must be a macro name");const i=s[0].text,l=e.isDefined(i);if(l&&!t)throw new n("\\newcommand{"+i+"} attempting to redefine "+i+"; use \\renewcommand");if(!l&&!r)throw new n("\\renewcommand{"+i+"} when command "+i+" does not yet exist; use \\newcommand");let a=0;if(s=e.consumeArg().tokens,1===s.length&&"["===s[0].text){let t="",r=e.expandNextToken();for(;"]"!==r.text&&"EOF"!==r.text;)t+=r.text,r=e.expandNextToken();if(!t.match(/^\s*[0-9]+\s*$/))throw new n("Invalid number of arguments: "+t);a=parseInt(t),s=e.consumeArg().tokens}return l&&o||e.macros.set(i,{tokens:s,numArgs:a}),""};sn("\\newcommand",e=>oo(e,!1,!0,!1)),sn("\\renewcommand",e=>oo(e,!0,!1,!1)),sn("\\providecommand",e=>oo(e,!0,!0,!0)),sn("\\message",e=>{const t=e.consumeArgs(1)[0];return console.log(t.reverse().map(e=>e.text).join("")),""}),sn("\\errmessage",e=>{const t=e.consumeArgs(1)[0];return console.error(t.reverse().map(e=>e.text).join("")),""}),sn("\\show",e=>{const t=e.popToken(),r=t.text;return console.log(t,e.macros.get(r),_n[r],ne.math[r],ne.text[r]),""}),sn("\\bgroup","{"),sn("\\egroup","}"),sn("~","\\nobreakspace"),sn("\\lq","`"),sn("\\rq","'"),sn("\\aa","\\r a"),sn("\\AA","\\r A"),sn("\\textcopyright","\\html@mathml{\\textcircled{c}}{\\char`\xa9}"),sn("\\copyright","\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}"),sn("\\textregistered","\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`\xae}"),sn("\u212c","\\mathscr{B}"),sn("\u2130","\\mathscr{E}"),sn("\u2131","\\mathscr{F}"),sn("\u210b","\\mathscr{H}"),sn("\u2110","\\mathscr{I}"),sn("\u2112","\\mathscr{L}"),sn("\u2133","\\mathscr{M}"),sn("\u211b","\\mathscr{R}"),sn("\u212d","\\mathfrak{C}"),sn("\u210c","\\mathfrak{H}"),sn("\u2128","\\mathfrak{Z}"),sn("\\Bbbk","\\Bbb{k}"),sn("\\llap","\\mathllap{\\textrm{#1}}"),sn("\\rlap","\\mathrlap{\\textrm{#1}}"),sn("\\clap","\\mathclap{\\textrm{#1}}"),sn("\\mathstrut","\\vphantom{(}"),sn("\\underbar","\\underline{\\text{#1}}"),sn("\\not",'\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}{\\char"338}'),sn("\\neq","\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`\u2260}}"),sn("\\ne","\\neq"),sn("\u2260","\\neq"),sn("\\notin","\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`\u2209}}"),sn("\u2209","\\notin"),sn("\u2258","\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`\u2258}}"),sn("\u2259","\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}"),sn("\u225a","\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225a}}"),sn("\u225b","\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`\u225b}}"),sn("\u225d","\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`\u225d}}"),sn("\u225e","\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`\u225e}}"),sn("\u225f","\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225f}}"),sn("\u27c2","\\perp"),sn("\u203c","\\mathclose{!\\mkern-0.8mu!}"),sn("\u220c","\\notni"),sn("\u231c","\\ulcorner"),sn("\u231d","\\urcorner"),sn("\u231e","\\llcorner"),sn("\u231f","\\lrcorner"),sn("\xa9","\\copyright"),sn("\xae","\\textregistered"),sn("\\ulcorner",'\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}'),sn("\\urcorner",'\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}'),sn("\\llcorner",'\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}'),sn("\\lrcorner",'\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}'),sn("\\vdots","{\\varvdots\\rule{0pt}{15pt}}"),sn("\u22ee","\\vdots"),sn("\\varGamma","\\mathit{\\Gamma}"),sn("\\varDelta","\\mathit{\\Delta}"),sn("\\varTheta","\\mathit{\\Theta}"),sn("\\varLambda","\\mathit{\\Lambda}"),sn("\\varXi","\\mathit{\\Xi}"),sn("\\varPi","\\mathit{\\Pi}"),sn("\\varSigma","\\mathit{\\Sigma}"),sn("\\varUpsilon","\\mathit{\\Upsilon}"),sn("\\varPhi","\\mathit{\\Phi}"),sn("\\varPsi","\\mathit{\\Psi}"),sn("\\varOmega","\\mathit{\\Omega}"),sn("\\substack","\\begin{subarray}{c}#1\\end{subarray}"),sn("\\colon","\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax"),sn("\\boxed","\\fbox{$\\displaystyle{#1}$}"),sn("\\iff","\\DOTSB\\;\\Longleftrightarrow\\;"),sn("\\implies","\\DOTSB\\;\\Longrightarrow\\;"),sn("\\impliedby","\\DOTSB\\;\\Longleftarrow\\;"),sn("\\dddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}"),sn("\\ddddot","{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");const so={",":"\\dotsc","\\not":"\\dotsb","+":"\\dotsb","=":"\\dotsb","<":"\\dotsb",">":"\\dotsb","-":"\\dotsb","*":"\\dotsb",":":"\\dotsb","\\DOTSB":"\\dotsb","\\coprod":"\\dotsb","\\bigvee":"\\dotsb","\\bigwedge":"\\dotsb","\\biguplus":"\\dotsb","\\bigcap":"\\dotsb","\\bigcup":"\\dotsb","\\prod":"\\dotsb","\\sum":"\\dotsb","\\bigotimes":"\\dotsb","\\bigoplus":"\\dotsb","\\bigodot":"\\dotsb","\\bigsqcup":"\\dotsb","\\And":"\\dotsb","\\longrightarrow":"\\dotsb","\\Longrightarrow":"\\dotsb","\\longleftarrow":"\\dotsb","\\Longleftarrow":"\\dotsb","\\longleftrightarrow":"\\dotsb","\\Longleftrightarrow":"\\dotsb","\\mapsto":"\\dotsb","\\longmapsto":"\\dotsb","\\hookrightarrow":"\\dotsb","\\doteq":"\\dotsb","\\mathbin":"\\dotsb","\\mathrel":"\\dotsb","\\relbar":"\\dotsb","\\Relbar":"\\dotsb","\\xrightarrow":"\\dotsb","\\xleftarrow":"\\dotsb","\\DOTSI":"\\dotsi","\\int":"\\dotsi","\\oint":"\\dotsi","\\iint":"\\dotsi","\\iiint":"\\dotsi","\\iiiint":"\\dotsi","\\idotsint":"\\dotsi","\\DOTSX":"\\dotsx"},io=new Set(["bin","rel"]);sn("\\dots",function(e){let t="\\dotso";const r=e.expandAfterFuture().text;return r in so?t=so[r]:("\\not"===r.slice(0,4)||r in ne.math&&io.has(ne.math[r].group))&&(t="\\dotsb"),t});const lo={")":!0,"]":!0,"\\rbrack":!0,"\\}":!0,"\\rbrace":!0,"\\rangle":!0,"\\rceil":!0,"\\rfloor":!0,"\\rgroup":!0,"\\rmoustache":!0,"\\right":!0,"\\bigr":!0,"\\biggr":!0,"\\Bigr":!0,"\\Biggr":!0,$:!0,";":!0,".":!0,",":!0};sn("\\dotso",function(e){return e.future().text in lo?"\\ldots\\,":"\\ldots"}),sn("\\dotsc",function(e){const t=e.future().text;return t in lo&&","!==t?"\\ldots\\,":"\\ldots"}),sn("\\cdots",function(e){return e.future().text in lo?"\\@cdots\\,":"\\@cdots"}),sn("\\dotsb","\\cdots"),sn("\\dotsm","\\cdots"),sn("\\dotsi","\\!\\cdots"),sn("\\dotsx","\\ldots\\,"),sn("\\DOTSI","\\relax"),sn("\\DOTSB","\\relax"),sn("\\DOTSX","\\relax"),sn("\\tmspace","\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax"),sn("\\,","\\tmspace+{3mu}{.1667em}"),sn("\\thinspace","\\,"),sn("\\>","\\mskip{4mu}"),sn("\\:","\\tmspace+{4mu}{.2222em}"),sn("\\medspace","\\:"),sn("\\;","\\tmspace+{5mu}{.2777em}"),sn("\\thickspace","\\;"),sn("\\!","\\tmspace-{3mu}{.1667em}"),sn("\\negthinspace","\\!"),sn("\\negmedspace","\\tmspace-{4mu}{.2222em}"),sn("\\negthickspace","\\tmspace-{5mu}{.277em}"),sn("\\enspace","\\kern.5em "),sn("\\enskip","\\hskip.5em\\relax"),sn("\\quad","\\hskip1em\\relax"),sn("\\qquad","\\hskip2em\\relax"),sn("\\tag","\\@ifstar\\tag@literal\\tag@paren"),sn("\\tag@paren","\\tag@literal{({#1})}"),sn("\\tag@literal",e=>{if(e.macros.get("\\df@tag"))throw new n("Multiple \\tag");return"\\gdef\\df@tag{\\text{#1}}"}),sn("\\bmod","\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}"),sn("\\pod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)"),sn("\\pmod","\\pod{{\\rm mod}\\mkern6mu#1}"),sn("\\mod","\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1"),sn("\\newline","\\\\\\relax"),sn("\\TeX","\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");const ao=O(K["Main-Regular"]["T".charCodeAt(0)][1]-.7*K["Main-Regular"]["A".charCodeAt(0)][1]);sn("\\LaTeX","\\textrm{\\html@mathml{L\\kern-.36em\\raisebox{"+ao+"}{\\scriptstyle A}\\kern-.15em\\TeX}{LaTeX}}"),sn("\\KaTeX","\\textrm{\\html@mathml{K\\kern-.17em\\raisebox{"+ao+"}{\\scriptstyle A}\\kern-.15em\\TeX}{KaTeX}}"),sn("\\hspace","\\@ifstar\\@hspacer\\@hspace"),sn("\\@hspace","\\hskip #1\\relax"),sn("\\@hspacer","\\rule{0pt}{0pt}\\hskip #1\\relax"),sn("\\ordinarycolon",":"),sn("\\vcentcolon","\\mathrel{\\mathop\\ordinarycolon}"),sn("\\dblcolon",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}'),sn("\\coloneqq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}'),sn("\\Coloneqq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}'),sn("\\coloneq",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}'),sn("\\Coloneq",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}'),sn("\\eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}'),sn("\\Eqqcolon",'\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}'),sn("\\eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}'),sn("\\Eqcolon",'\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}'),sn("\\colonapprox",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}'),sn("\\Colonapprox",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}'),sn("\\colonsim",'\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}'),sn("\\Colonsim",'\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}'),sn("\u2237","\\dblcolon"),sn("\u2239","\\eqcolon"),sn("\u2254","\\coloneqq"),sn("\u2255","\\eqqcolon"),sn("\u2a74","\\Coloneqq"),sn("\\ratio","\\vcentcolon"),sn("\\coloncolon","\\dblcolon"),sn("\\colonequals","\\coloneqq"),sn("\\coloncolonequals","\\Coloneqq"),sn("\\equalscolon","\\eqqcolon"),sn("\\equalscoloncolon","\\Eqqcolon"),sn("\\colonminus","\\coloneq"),sn("\\coloncolonminus","\\Coloneq"),sn("\\minuscolon","\\eqcolon"),sn("\\minuscoloncolon","\\Eqcolon"),sn("\\coloncolonapprox","\\Colonapprox"),sn("\\coloncolonsim","\\Colonsim"),sn("\\simcolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),sn("\\simcoloncolon","\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}"),sn("\\approxcolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}"),sn("\\approxcoloncolon","\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}"),sn("\\notni","\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220c}}"),sn("\\limsup","\\DOTSB\\operatorname*{lim\\,sup}"),sn("\\liminf","\\DOTSB\\operatorname*{lim\\,inf}"),sn("\\injlim","\\DOTSB\\operatorname*{inj\\,lim}"),sn("\\projlim","\\DOTSB\\operatorname*{proj\\,lim}"),sn("\\varlimsup","\\DOTSB\\operatorname*{\\overline{lim}}"),sn("\\varliminf","\\DOTSB\\operatorname*{\\underline{lim}}"),sn("\\varinjlim","\\DOTSB\\operatorname*{\\underrightarrow{lim}}"),sn("\\varprojlim","\\DOTSB\\operatorname*{\\underleftarrow{lim}}"),sn("\\gvertneqq","\\html@mathml{\\@gvertneqq}{\u2269}"),sn("\\lvertneqq","\\html@mathml{\\@lvertneqq}{\u2268}"),sn("\\ngeqq","\\html@mathml{\\@ngeqq}{\u2271}"),sn("\\ngeqslant","\\html@mathml{\\@ngeqslant}{\u2271}"),sn("\\nleqq","\\html@mathml{\\@nleqq}{\u2270}"),sn("\\nleqslant","\\html@mathml{\\@nleqslant}{\u2270}"),sn("\\nshortmid","\\html@mathml{\\@nshortmid}{\u2224}"),sn("\\nshortparallel","\\html@mathml{\\@nshortparallel}{\u2226}"),sn("\\nsubseteqq","\\html@mathml{\\@nsubseteqq}{\u2288}"),sn("\\nsupseteqq","\\html@mathml{\\@nsupseteqq}{\u2289}"),sn("\\varsubsetneq","\\html@mathml{\\@varsubsetneq}{\u228a}"),sn("\\varsubsetneqq","\\html@mathml{\\@varsubsetneqq}{\u2acb}"),sn("\\varsupsetneq","\\html@mathml{\\@varsupsetneq}{\u228b}"),sn("\\varsupsetneqq","\\html@mathml{\\@varsupsetneqq}{\u2acc}"),sn("\\imath","\\html@mathml{\\@imath}{\u0131}"),sn("\\jmath","\\html@mathml{\\@jmath}{\u0237}"),sn("\\llbracket","\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`\u27e6}}"),sn("\\rrbracket","\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`\u27e7}}"),sn("\u27e6","\\llbracket"),sn("\u27e7","\\rrbracket"),sn("\\lBrace","\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`\u2983}}"),sn("\\rBrace","\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`\u2984}}"),sn("\u2983","\\lBrace"),sn("\u2984","\\rBrace"),sn("\\minuso","\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`\u29b5}}"),sn("\u29b5","\\minuso"),sn("\\darr","\\downarrow"),sn("\\dArr","\\Downarrow"),sn("\\Darr","\\Downarrow"),sn("\\lang","\\langle"),sn("\\rang","\\rangle"),sn("\\uarr","\\uparrow"),sn("\\uArr","\\Uparrow"),sn("\\Uarr","\\Uparrow"),sn("\\N","\\mathbb{N}"),sn("\\R","\\mathbb{R}"),sn("\\Z","\\mathbb{Z}"),sn("\\alef","\\aleph"),sn("\\alefsym","\\aleph"),sn("\\Alpha","\\mathrm{A}"),sn("\\Beta","\\mathrm{B}"),sn("\\bull","\\bullet"),sn("\\Chi","\\mathrm{X}"),sn("\\clubs","\\clubsuit"),sn("\\cnums","\\mathbb{C}"),sn("\\Complex","\\mathbb{C}"),sn("\\Dagger","\\ddagger"),sn("\\diamonds","\\diamondsuit"),sn("\\empty","\\emptyset"),sn("\\Epsilon","\\mathrm{E}"),sn("\\Eta","\\mathrm{H}"),sn("\\exist","\\exists"),sn("\\harr","\\leftrightarrow"),sn("\\hArr","\\Leftrightarrow"),sn("\\Harr","\\Leftrightarrow"),sn("\\hearts","\\heartsuit"),sn("\\image","\\Im"),sn("\\infin","\\infty"),sn("\\Iota","\\mathrm{I}"),sn("\\isin","\\in"),sn("\\Kappa","\\mathrm{K}"),sn("\\larr","\\leftarrow"),sn("\\lArr","\\Leftarrow"),sn("\\Larr","\\Leftarrow"),sn("\\lrarr","\\leftrightarrow"),sn("\\lrArr","\\Leftrightarrow"),sn("\\Lrarr","\\Leftrightarrow"),sn("\\Mu","\\mathrm{M}"),sn("\\natnums","\\mathbb{N}"),sn("\\Nu","\\mathrm{N}"),sn("\\Omicron","\\mathrm{O}"),sn("\\plusmn","\\pm"),sn("\\rarr","\\rightarrow"),sn("\\rArr","\\Rightarrow"),sn("\\Rarr","\\Rightarrow"),sn("\\real","\\Re"),sn("\\reals","\\mathbb{R}"),sn("\\Reals","\\mathbb{R}"),sn("\\Rho","\\mathrm{P}"),sn("\\sdot","\\cdot"),sn("\\sect","\\S"),sn("\\spades","\\spadesuit"),sn("\\sub","\\subset"),sn("\\sube","\\subseteq"),sn("\\supe","\\supseteq"),sn("\\Tau","\\mathrm{T}"),sn("\\thetasym","\\vartheta"),sn("\\weierp","\\wp"),sn("\\Zeta","\\mathrm{Z}"),sn("\\argmin","\\DOTSB\\operatorname*{arg\\,min}"),sn("\\argmax","\\DOTSB\\operatorname*{arg\\,max}"),sn("\\plim","\\DOTSB\\mathop{\\operatorname{plim}}\\limits"),sn("\\bra","\\mathinner{\\langle{#1}|}"),sn("\\ket","\\mathinner{|{#1}\\rangle}"),sn("\\braket","\\mathinner{\\langle{#1}\\rangle}"),sn("\\Bra","\\left\\langle#1\\right|"),sn("\\Ket","\\left|#1\\right\\rangle");const co=e=>t=>{const r=t.consumeArg().tokens,n=t.consumeArg().tokens,o=t.consumeArg().tokens,s=t.consumeArg().tokens,i=t.macros.get("|"),l=t.macros.get("\\|");t.macros.beginGroup();const a=t=>r=>{e&&(r.macros.set("|",i),o.length&&r.macros.set("\\|",l));let s=t;if(!t&&o.length){"|"===r.future().text&&(r.popToken(),s=!0)}return{tokens:s?o:n,numArgs:0}};t.macros.set("|",a(!1)),o.length&&t.macros.set("\\|",a(!0));const c=t.consumeArg().tokens,h=t.expandTokens([...s,...c,...r]);return t.macros.endGroup(),{tokens:h.reverse(),numArgs:0}};sn("\\bra@ket",co(!1)),sn("\\bra@set",co(!0)),sn("\\Braket","\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}"),sn("\\Set","\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}"),sn("\\set","\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}"),sn("\\angln","{\\angl n}"),sn("\\blue","\\textcolor{##6495ed}{#1}"),sn("\\orange","\\textcolor{##ffa500}{#1}"),sn("\\pink","\\textcolor{##ff00af}{#1}"),sn("\\red","\\textcolor{##df0030}{#1}"),sn("\\green","\\textcolor{##28ae7b}{#1}"),sn("\\gray","\\textcolor{gray}{#1}"),sn("\\purple","\\textcolor{##9d38bd}{#1}"),sn("\\blueA","\\textcolor{##ccfaff}{#1}"),sn("\\blueB","\\textcolor{##80f6ff}{#1}"),sn("\\blueC","\\textcolor{##63d9ea}{#1}"),sn("\\blueD","\\textcolor{##11accd}{#1}"),sn("\\blueE","\\textcolor{##0c7f99}{#1}"),sn("\\tealA","\\textcolor{##94fff5}{#1}"),sn("\\tealB","\\textcolor{##26edd5}{#1}"),sn("\\tealC","\\textcolor{##01d1c1}{#1}"),sn("\\tealD","\\textcolor{##01a995}{#1}"),sn("\\tealE","\\textcolor{##208170}{#1}"),sn("\\greenA","\\textcolor{##b6ffb0}{#1}"),sn("\\greenB","\\textcolor{##8af281}{#1}"),sn("\\greenC","\\textcolor{##74cf70}{#1}"),sn("\\greenD","\\textcolor{##1fab54}{#1}"),sn("\\greenE","\\textcolor{##0d923f}{#1}"),sn("\\goldA","\\textcolor{##ffd0a9}{#1}"),sn("\\goldB","\\textcolor{##ffbb71}{#1}"),sn("\\goldC","\\textcolor{##ff9c39}{#1}"),sn("\\goldD","\\textcolor{##e07d10}{#1}"),sn("\\goldE","\\textcolor{##a75a05}{#1}"),sn("\\redA","\\textcolor{##fca9a9}{#1}"),sn("\\redB","\\textcolor{##ff8482}{#1}"),sn("\\redC","\\textcolor{##f9685d}{#1}"),sn("\\redD","\\textcolor{##e84d39}{#1}"),sn("\\redE","\\textcolor{##bc2612}{#1}"),sn("\\maroonA","\\textcolor{##ffbde0}{#1}"),sn("\\maroonB","\\textcolor{##ff92c6}{#1}"),sn("\\maroonC","\\textcolor{##ed5fa6}{#1}"),sn("\\maroonD","\\textcolor{##ca337c}{#1}"),sn("\\maroonE","\\textcolor{##9e034e}{#1}"),sn("\\purpleA","\\textcolor{##ddd7ff}{#1}"),sn("\\purpleB","\\textcolor{##c6b9fc}{#1}"),sn("\\purpleC","\\textcolor{##aa87ff}{#1}"),sn("\\purpleD","\\textcolor{##7854ab}{#1}"),sn("\\purpleE","\\textcolor{##543b78}{#1}"),sn("\\mintA","\\textcolor{##f5f9e8}{#1}"),sn("\\mintB","\\textcolor{##edf2df}{#1}"),sn("\\mintC","\\textcolor{##e0e5cc}{#1}"),sn("\\grayA","\\textcolor{##f6f7f7}{#1}"),sn("\\grayB","\\textcolor{##f0f1f2}{#1}"),sn("\\grayC","\\textcolor{##e3e5e6}{#1}"),sn("\\grayD","\\textcolor{##d6d8da}{#1}"),sn("\\grayE","\\textcolor{##babec2}{#1}"),sn("\\grayF","\\textcolor{##888d93}{#1}"),sn("\\grayG","\\textcolor{##626569}{#1}"),sn("\\grayH","\\textcolor{##3b3e40}{#1}"),sn("\\grayI","\\textcolor{##21242c}{#1}"),sn("\\kaBlue","\\textcolor{##314453}{#1}"),sn("\\kaGreen","\\textcolor{##71B307}{#1}");const ho={"^":!0,_:!0,"\\limits":!0,"\\nolimits":!0};class mo{constructor(e,t,r){this.settings=void 0,this.expansionCount=void 0,this.lexer=void 0,this.macros=void 0,this.stack=void 0,this.mode=void 0,this.settings=t,this.expansionCount=0,this.feed(e),this.macros=new to(ro,t.macros),this.mode=r,this.stack=[]}feed(e){this.lexer=new eo(e,this.settings)}switchMode(e){this.mode=e}beginGroup(){this.macros.beginGroup()}endGroup(){this.macros.endGroup()}endGroups(){this.macros.endGroups()}future(){return 0===this.stack.length&&this.pushToken(this.lexer.lex()),this.stack[this.stack.length-1]}popToken(){return this.future(),this.stack.pop()}pushToken(e){this.stack.push(e)}pushTokens(e){this.stack.push(...e)}scanArgument(e){let t,r,n;if(e){if(this.consumeSpaces(),"["!==this.future().text)return null;t=this.popToken(),({tokens:n,end:r}=this.consumeArg(["]"]))}else({tokens:n,start:t,end:r}=this.consumeArg());return this.pushToken(new an("EOF",r.loc)),this.pushTokens(n),new an("",ln.range(t,r))}consumeSpaces(){for(;;){if(" "!==this.future().text)break;this.stack.pop()}}consumeArg(e){const t=[],r=e&&e.length>0;r||this.consumeSpaces();const o=this.future();let s,i=0,l=0;do{if(s=this.popToken(),t.push(s),"{"===s.text)++i;else if("}"===s.text){if(--i,-1===i)throw new n("Extra }",s)}else if("EOF"===s.text)throw new n("Unexpected end of input in a macro argument, expected '"+(e&&r?e[l]:"}")+"'",s);if(e&&r)if((0===i||1===i&&"{"===e[l])&&s.text===e[l]){if(++l,l===e.length){t.splice(-l,l);break}}else l=0}while(0!==i||r);return"{"===o.text&&"}"===t[t.length-1].text&&(t.pop(),t.shift()),t.reverse(),{tokens:t,start:o,end:s}}consumeArgs(e,t){if(t){if(t.length!==e+1)throw new n("The length of delimiters doesn't match the number of args!");const r=t[0];for(let e=0;e<r.length;e++){const t=this.popToken();if(r[e]!==t.text)throw new n("Use of the macro doesn't match its definition",t)}}const r=[];for(let n=0;n<e;n++)r.push(this.consumeArg(t&&t[n+1]).tokens);return r}countExpansion(e){if(this.expansionCount+=e,this.expansionCount>this.settings.maxExpand)throw new n("Too many expansions: infinite loop or need to increase maxExpand setting")}expandOnce(e){const t=this.popToken(),r=t.text,o=t.noexpand?null:this._getExpansion(r);if(null==o||e&&o.unexpandable){if(e&&null==o&&"\\"===r[0]&&!this.isDefined(r))throw new n("Undefined control sequence: "+r);return this.pushToken(t),!1}this.countExpansion(1);let s=o.tokens;const i=this.consumeArgs(o.numArgs,o.delimiters);if(o.numArgs){s=s.slice();for(let e=s.length-1;e>=0;--e){let t=s[e];if("#"===t.text){if(0===e)throw new n("Incomplete placeholder at end of macro body",t);if(t=s[--e],"#"===t.text)s.splice(e+1,1);else{if(!/^[1-9]$/.test(t.text))throw new n("Not a valid argument number",t);s.splice(e,2,...i[+t.text-1])}}}}return this.pushTokens(s),s.length}expandAfterFuture(){return this.expandOnce(),this.future()}expandNextToken(){for(;;)if(!1===this.expandOnce()){const e=this.stack.pop();return e.treatAsRelax&&(e.text="\\relax"),e}}expandMacro(e){return this.macros.has(e)?this.expandTokens([new an(e)]):void 0}expandTokens(e){const t=[],r=this.stack.length;for(this.pushTokens(e);this.stack.length>r;)if(!1===this.expandOnce(!0)){const e=this.stack.pop();e.treatAsRelax&&(e.noexpand=!1,e.treatAsRelax=!1),t.push(e)}return this.countExpansion(t.length),t}expandMacroAsText(e){const t=this.expandMacro(e);return t?t.map(e=>e.text).join(""):t}_getExpansion(e){const t=this.macros.get(e);if(null==t)return t;if(1===e.length){const t=this.lexer.catcodes[e];if(null!=t&&13!==t)return}const r="function"==typeof t?t(this):t;if("string"==typeof r){let e=0;if(r.includes("#")){const t=r.replace(/##/g,"");for(;t.includes("#"+(e+1));)++e}const t=new eo(r,this.settings),n=[];let o=t.lex();for(;"EOF"!==o.text;)n.push(o),o=t.lex();n.reverse();return{tokens:n,numArgs:e}}return r}isDefined(e){return this.macros.has(e)||_n.hasOwnProperty(e)||ne.math.hasOwnProperty(e)||ne.text.hasOwnProperty(e)||ho.hasOwnProperty(e)}isExpandable(e){const t=this.macros.get(e);return null!=t?"string"==typeof t||"function"==typeof t||!t.unexpandable:_n.hasOwnProperty(e)&&!_n[e].primitive}}const uo=/^[\u208a\u208b\u208c\u208d\u208e\u2080\u2081\u2082\u2083\u2084\u2085\u2086\u2087\u2088\u2089\u2090\u2091\u2095\u1d62\u2c7c\u2096\u2097\u2098\u2099\u2092\u209a\u1d63\u209b\u209c\u1d64\u1d65\u2093\u1d66\u1d67\u1d68\u1d69\u1d6a]/,po=Object.freeze({"\u208a":"+","\u208b":"-","\u208c":"=","\u208d":"(","\u208e":")","\u2080":"0","\u2081":"1","\u2082":"2","\u2083":"3","\u2084":"4","\u2085":"5","\u2086":"6","\u2087":"7","\u2088":"8","\u2089":"9","\u2090":"a","\u2091":"e","\u2095":"h","\u1d62":"i","\u2c7c":"j","\u2096":"k","\u2097":"l","\u2098":"m","\u2099":"n","\u2092":"o","\u209a":"p","\u1d63":"r","\u209b":"s","\u209c":"t","\u1d64":"u","\u1d65":"v","\u2093":"x","\u1d66":"\u03b2","\u1d67":"\u03b3","\u1d68":"\u03c1","\u1d69":"\u03d5","\u1d6a":"\u03c7","\u207a":"+","\u207b":"-","\u207c":"=","\u207d":"(","\u207e":")","\u2070":"0","\xb9":"1","\xb2":"2","\xb3":"3","\u2074":"4","\u2075":"5","\u2076":"6","\u2077":"7","\u2078":"8","\u2079":"9","\u1d2c":"A","\u1d2e":"B","\u1d30":"D","\u1d31":"E","\u1d33":"G","\u1d34":"H","\u1d35":"I","\u1d36":"J","\u1d37":"K","\u1d38":"L","\u1d39":"M","\u1d3a":"N","\u1d3c":"O","\u1d3e":"P","\u1d3f":"R","\u1d40":"T","\u1d41":"U","\u2c7d":"V","\u1d42":"W","\u1d43":"a","\u1d47":"b","\u1d9c":"c","\u1d48":"d","\u1d49":"e","\u1da0":"f","\u1d4d":"g","\u02b0":"h","\u2071":"i","\u02b2":"j","\u1d4f":"k","\u02e1":"l","\u1d50":"m","\u207f":"n","\u1d52":"o","\u1d56":"p","\u02b3":"r","\u02e2":"s","\u1d57":"t","\u1d58":"u","\u1d5b":"v","\u02b7":"w","\u02e3":"x","\u02b8":"y","\u1dbb":"z","\u1d5d":"\u03b2","\u1d5e":"\u03b3","\u1d5f":"\u03b4","\u1d60":"\u03d5","\u1d61":"\u03c7","\u1dbf":"\u03b8"}),go={"\u0301":{text:"\\'",math:"\\acute"},"\u0300":{text:"\\`",math:"\\grave"},"\u0308":{text:'\\"',math:"\\ddot"},"\u0303":{text:"\\~",math:"\\tilde"},"\u0304":{text:"\\=",math:"\\bar"},"\u0306":{text:"\\u",math:"\\breve"},"\u030c":{text:"\\v",math:"\\check"},"\u0302":{text:"\\^",math:"\\hat"},"\u0307":{text:"\\.",math:"\\dot"},"\u030a":{text:"\\r",math:"\\mathring"},"\u030b":{text:"\\H"},"\u0327":{text:"\\c"}},fo={"\xe1":"a\u0301","\xe0":"a\u0300","\xe4":"a\u0308","\u01df":"a\u0308\u0304","\xe3":"a\u0303","\u0101":"a\u0304","\u0103":"a\u0306","\u1eaf":"a\u0306\u0301","\u1eb1":"a\u0306\u0300","\u1eb5":"a\u0306\u0303","\u01ce":"a\u030c","\xe2":"a\u0302","\u1ea5":"a\u0302\u0301","\u1ea7":"a\u0302\u0300","\u1eab":"a\u0302\u0303","\u0227":"a\u0307","\u01e1":"a\u0307\u0304","\xe5":"a\u030a","\u01fb":"a\u030a\u0301","\u1e03":"b\u0307","\u0107":"c\u0301","\u1e09":"c\u0327\u0301","\u010d":"c\u030c","\u0109":"c\u0302","\u010b":"c\u0307","\xe7":"c\u0327","\u010f":"d\u030c","\u1e0b":"d\u0307","\u1e11":"d\u0327","\xe9":"e\u0301","\xe8":"e\u0300","\xeb":"e\u0308","\u1ebd":"e\u0303","\u0113":"e\u0304","\u1e17":"e\u0304\u0301","\u1e15":"e\u0304\u0300","\u0115":"e\u0306","\u1e1d":"e\u0327\u0306","\u011b":"e\u030c","\xea":"e\u0302","\u1ebf":"e\u0302\u0301","\u1ec1":"e\u0302\u0300","\u1ec5":"e\u0302\u0303","\u0117":"e\u0307","\u0229":"e\u0327","\u1e1f":"f\u0307","\u01f5":"g\u0301","\u1e21":"g\u0304","\u011f":"g\u0306","\u01e7":"g\u030c","\u011d":"g\u0302","\u0121":"g\u0307","\u0123":"g\u0327","\u1e27":"h\u0308","\u021f":"h\u030c","\u0125":"h\u0302","\u1e23":"h\u0307","\u1e29":"h\u0327","\xed":"i\u0301","\xec":"i\u0300","\xef":"i\u0308","\u1e2f":"i\u0308\u0301","\u0129":"i\u0303","\u012b":"i\u0304","\u012d":"i\u0306","\u01d0":"i\u030c","\xee":"i\u0302","\u01f0":"j\u030c","\u0135":"j\u0302","\u1e31":"k\u0301","\u01e9":"k\u030c","\u0137":"k\u0327","\u013a":"l\u0301","\u013e":"l\u030c","\u013c":"l\u0327","\u1e3f":"m\u0301","\u1e41":"m\u0307","\u0144":"n\u0301","\u01f9":"n\u0300","\xf1":"n\u0303","\u0148":"n\u030c","\u1e45":"n\u0307","\u0146":"n\u0327","\xf3":"o\u0301","\xf2":"o\u0300","\xf6":"o\u0308","\u022b":"o\u0308\u0304","\xf5":"o\u0303","\u1e4d":"o\u0303\u0301","\u1e4f":"o\u0303\u0308","\u022d":"o\u0303\u0304","\u014d":"o\u0304","\u1e53":"o\u0304\u0301","\u1e51":"o\u0304\u0300","\u014f":"o\u0306","\u01d2":"o\u030c","\xf4":"o\u0302","\u1ed1":"o\u0302\u0301","\u1ed3":"o\u0302\u0300","\u1ed7":"o\u0302\u0303","\u022f":"o\u0307","\u0231":"o\u0307\u0304","\u0151":"o\u030b","\u1e55":"p\u0301","\u1e57":"p\u0307","\u0155":"r\u0301","\u0159":"r\u030c","\u1e59":"r\u0307","\u0157":"r\u0327","\u015b":"s\u0301","\u1e65":"s\u0301\u0307","\u0161":"s\u030c","\u1e67":"s\u030c\u0307","\u015d":"s\u0302","\u1e61":"s\u0307","\u015f":"s\u0327","\u1e97":"t\u0308","\u0165":"t\u030c","\u1e6b":"t\u0307","\u0163":"t\u0327","\xfa":"u\u0301","\xf9":"u\u0300","\xfc":"u\u0308","\u01d8":"u\u0308\u0301","\u01dc":"u\u0308\u0300","\u01d6":"u\u0308\u0304","\u01da":"u\u0308\u030c","\u0169":"u\u0303","\u1e79":"u\u0303\u0301","\u016b":"u\u0304","\u1e7b":"u\u0304\u0308","\u016d":"u\u0306","\u01d4":"u\u030c","\xfb":"u\u0302","\u016f":"u\u030a","\u0171":"u\u030b","\u1e7d":"v\u0303","\u1e83":"w\u0301","\u1e81":"w\u0300","\u1e85":"w\u0308","\u0175":"w\u0302","\u1e87":"w\u0307","\u1e98":"w\u030a","\u1e8d":"x\u0308","\u1e8b":"x\u0307","\xfd":"y\u0301","\u1ef3":"y\u0300","\xff":"y\u0308","\u1ef9":"y\u0303","\u0233":"y\u0304","\u0177":"y\u0302","\u1e8f":"y\u0307","\u1e99":"y\u030a","\u017a":"z\u0301","\u017e":"z\u030c","\u1e91":"z\u0302","\u017c":"z\u0307","\xc1":"A\u0301","\xc0":"A\u0300","\xc4":"A\u0308","\u01de":"A\u0308\u0304","\xc3":"A\u0303","\u0100":"A\u0304","\u0102":"A\u0306","\u1eae":"A\u0306\u0301","\u1eb0":"A\u0306\u0300","\u1eb4":"A\u0306\u0303","\u01cd":"A\u030c","\xc2":"A\u0302","\u1ea4":"A\u0302\u0301","\u1ea6":"A\u0302\u0300","\u1eaa":"A\u0302\u0303","\u0226":"A\u0307","\u01e0":"A\u0307\u0304","\xc5":"A\u030a","\u01fa":"A\u030a\u0301","\u1e02":"B\u0307","\u0106":"C\u0301","\u1e08":"C\u0327\u0301","\u010c":"C\u030c","\u0108":"C\u0302","\u010a":"C\u0307","\xc7":"C\u0327","\u010e":"D\u030c","\u1e0a":"D\u0307","\u1e10":"D\u0327","\xc9":"E\u0301","\xc8":"E\u0300","\xcb":"E\u0308","\u1ebc":"E\u0303","\u0112":"E\u0304","\u1e16":"E\u0304\u0301","\u1e14":"E\u0304\u0300","\u0114":"E\u0306","\u1e1c":"E\u0327\u0306","\u011a":"E\u030c","\xca":"E\u0302","\u1ebe":"E\u0302\u0301","\u1ec0":"E\u0302\u0300","\u1ec4":"E\u0302\u0303","\u0116":"E\u0307","\u0228":"E\u0327","\u1e1e":"F\u0307","\u01f4":"G\u0301","\u1e20":"G\u0304","\u011e":"G\u0306","\u01e6":"G\u030c","\u011c":"G\u0302","\u0120":"G\u0307","\u0122":"G\u0327","\u1e26":"H\u0308","\u021e":"H\u030c","\u0124":"H\u0302","\u1e22":"H\u0307","\u1e28":"H\u0327","\xcd":"I\u0301","\xcc":"I\u0300","\xcf":"I\u0308","\u1e2e":"I\u0308\u0301","\u0128":"I\u0303","\u012a":"I\u0304","\u012c":"I\u0306","\u01cf":"I\u030c","\xce":"I\u0302","\u0130":"I\u0307","\u0134":"J\u0302","\u1e30":"K\u0301","\u01e8":"K\u030c","\u0136":"K\u0327","\u0139":"L\u0301","\u013d":"L\u030c","\u013b":"L\u0327","\u1e3e":"M\u0301","\u1e40":"M\u0307","\u0143":"N\u0301","\u01f8":"N\u0300","\xd1":"N\u0303","\u0147":"N\u030c","\u1e44":"N\u0307","\u0145":"N\u0327","\xd3":"O\u0301","\xd2":"O\u0300","\xd6":"O\u0308","\u022a":"O\u0308\u0304","\xd5":"O\u0303","\u1e4c":"O\u0303\u0301","\u1e4e":"O\u0303\u0308","\u022c":"O\u0303\u0304","\u014c":"O\u0304","\u1e52":"O\u0304\u0301","\u1e50":"O\u0304\u0300","\u014e":"O\u0306","\u01d1":"O\u030c","\xd4":"O\u0302","\u1ed0":"O\u0302\u0301","\u1ed2":"O\u0302\u0300","\u1ed6":"O\u0302\u0303","\u022e":"O\u0307","\u0230":"O\u0307\u0304","\u0150":"O\u030b","\u1e54":"P\u0301","\u1e56":"P\u0307","\u0154":"R\u0301","\u0158":"R\u030c","\u1e58":"R\u0307","\u0156":"R\u0327","\u015a":"S\u0301","\u1e64":"S\u0301\u0307","\u0160":"S\u030c","\u1e66":"S\u030c\u0307","\u015c":"S\u0302","\u1e60":"S\u0307","\u015e":"S\u0327","\u0164":"T\u030c","\u1e6a":"T\u0307","\u0162":"T\u0327","\xda":"U\u0301","\xd9":"U\u0300","\xdc":"U\u0308","\u01d7":"U\u0308\u0301","\u01db":"U\u0308\u0300","\u01d5":"U\u0308\u0304","\u01d9":"U\u0308\u030c","\u0168":"U\u0303","\u1e78":"U\u0303\u0301","\u016a":"U\u0304","\u1e7a":"U\u0304\u0308","\u016c":"U\u0306","\u01d3":"U\u030c","\xdb":"U\u0302","\u016e":"U\u030a","\u0170":"U\u030b","\u1e7c":"V\u0303","\u1e82":"W\u0301","\u1e80":"W\u0300","\u1e84":"W\u0308","\u0174":"W\u0302","\u1e86":"W\u0307","\u1e8c":"X\u0308","\u1e8a":"X\u0307","\xdd":"Y\u0301","\u1ef2":"Y\u0300","\u0178":"Y\u0308","\u1ef8":"Y\u0303","\u0232":"Y\u0304","\u0176":"Y\u0302","\u1e8e":"Y\u0307","\u0179":"Z\u0301","\u017d":"Z\u030c","\u1e90":"Z\u0302","\u017b":"Z\u0307","\u03ac":"\u03b1\u0301","\u1f70":"\u03b1\u0300","\u1fb1":"\u03b1\u0304","\u1fb0":"\u03b1\u0306","\u03ad":"\u03b5\u0301","\u1f72":"\u03b5\u0300","\u03ae":"\u03b7\u0301","\u1f74":"\u03b7\u0300","\u03af":"\u03b9\u0301","\u1f76":"\u03b9\u0300","\u03ca":"\u03b9\u0308","\u0390":"\u03b9\u0308\u0301","\u1fd2":"\u03b9\u0308\u0300","\u1fd1":"\u03b9\u0304","\u1fd0":"\u03b9\u0306","\u03cc":"\u03bf\u0301","\u1f78":"\u03bf\u0300","\u03cd":"\u03c5\u0301","\u1f7a":"\u03c5\u0300","\u03cb":"\u03c5\u0308","\u03b0":"\u03c5\u0308\u0301","\u1fe2":"\u03c5\u0308\u0300","\u1fe1":"\u03c5\u0304","\u1fe0":"\u03c5\u0306","\u03ce":"\u03c9\u0301","\u1f7c":"\u03c9\u0300","\u038e":"\u03a5\u0301","\u1fea":"\u03a5\u0300","\u03ab":"\u03a5\u0308","\u1fe9":"\u03a5\u0304","\u1fe8":"\u03a5\u0306","\u038f":"\u03a9\u0301","\u1ffa":"\u03a9\u0300"};class bo{constructor(e,t){this.mode=void 0,this.gullet=void 0,this.settings=void 0,this.leftrightDepth=void 0,this.nextToken=void 0,this.mode="math",this.gullet=new mo(e,t,this.mode),this.settings=t,this.leftrightDepth=0,this.nextToken=null}expect(e,t){if(void 0===t&&(t=!0),this.fetch().text!==e)throw new n("Expected '"+e+"', got '"+this.fetch().text+"'",this.fetch());t&&this.consume()}consume(){this.nextToken=null}fetch(){return null==this.nextToken&&(this.nextToken=this.gullet.expandNextToken()),this.nextToken}switchMode(e){this.mode=e,this.gullet.switchMode(e)}parse(){this.settings.globalGroup||this.gullet.beginGroup(),this.settings.colorIsTextColor&&this.gullet.macros.set("\\color","\\textcolor");try{const e=this.parseExpression(!1);return this.expect("EOF"),this.settings.globalGroup||this.gullet.endGroup(),e}finally{this.gullet.endGroups()}}subparse(e){const t=this.nextToken;this.consume(),this.gullet.pushToken(new an("}")),this.gullet.pushTokens(e);const r=this.parseExpression(!1);return this.expect("}"),this.nextToken=t,r}parseExpression(e,t){const r=[];for(;;){"math"===this.mode&&this.consumeSpaces();const n=this.fetch();if(bo.endOfExpression.has(n.text))break;if(t&&n.text===t)break;if(e&&_n[n.text]&&_n[n.text].infix)break;const o=this.parseAtom(t);if(!o)break;"internal"!==o.type&&r.push(o)}return"text"===this.mode&&this.formLigatures(r),this.handleInfixNodes(r)}handleInfixNodes(e){let t,r=-1;for(let o=0;o<e.length;o++){const s=e[o];if("infix"===s.type){if(-1!==r)throw new n("only one infix operator per group",s.token);r=o,t=s.replaceWith}}if(-1!==r&&t){let n,o;const s=e.slice(0,r),i=e.slice(r+1);let l;return n=1===s.length&&"ordgroup"===s[0].type?s[0]:{type:"ordgroup",mode:this.mode,body:s},o=1===i.length&&"ordgroup"===i[0].type?i[0]:{type:"ordgroup",mode(b:this.mode,body:i},l="\\\\abovefrac"===t?this.callFunction(t,[n,e[r],o],[]):this.callFunction(t,[n,o],[]),[l]}return e}handleSupSubscript(e){const t=this.fetch(),r=t.text;let o;this.consume(),this.consumeSpaces();do{var s;o=this.parseGroup(e)}while("internal"===(null==(s=o)?void 0:s.type));if(!o)throw new n("Expected group after '"+r+"'",t);return o}formatUnsupportedCmd(e){const t=[];for(let r=0;r<e.length;r++)t.push({type:"textord",mode:"text",text:e[r]});const r={type:"text",mode:this.mode,body:t};return{type:"color",mode:this.mode,color:this.settings.errorColor,body:[r]}}parseAtom(e){const t=this.parseGroup("atom",e);if("internal"===(null==t?void 0:t.type))return t;if("text"===this.mode)return t;let r,o;for(;;){this.consumeSpaces();const e=this.fetch();if("\\limits"===e.text||"\\nolimits"===e.text){if(t&&"op"===t.type){const r="\\limits"===e.text;t.limits=r,t.alwaysHandleSupSub=!0}else{if(!t||"operatorname"!==t.type)throw new n("Limit controls must follow a math operator",e);t.alwaysHandleSupSub&&(t.limits="\\limits"===e.text)}this.consume()}else if("^"===e.text){if(r)throw new n("Double superscript",e);r=this.handleSupSubscript("superscript")}else if("_"===e.text){if(o)throw new n("Double subscript",e);o=this.handleSupSubscript("subscript")}else if("'"===e.text){if(r)throw new n("Double superscript",e);const t={type:"textord",mode:this.mode,text:"\\prime"},o=[t];for(this.consume();"'"===this.fetch().text;)o.push(t),this.consume();"^"===this.fetch().text&&o.push(this.handleSupSubscript("superscript")),r={type:"ordgroup",mode:this.mode,body:o}}else{if(!po[e.text])break;{const t=uo.test(e.text),n=[];for(n.push(new an(po[e.text])),this.consume();;){const e=this.fetch().text;if(!po[e])break;if(uo.test(e)!==t)break;n.unshift(new an(po[e])),this.consume()}const s=this.subparse(n);t?o={type:"ordgroup",mode:"math",body:s}:r={type:"ordgroup",mode:"math",body:s}}}}return r||o?{type:"supsub",mode:this.mode,base:t,sup:r,sub:o}:t}parseFunction(e,t){const r=this.fetch(),o=r.text,s=_n[o];if(!s)return null;if(this.consume(),t&&"atom"!==t&&!s.allowedInArgument)throw new n("Got function '"+o+"' with no arguments"+(t?" as "+t:""),r);if("text"===this.mode&&!s.allowedInText)throw new n("Can't use function '"+o+"' in text mode",r);if("math"===this.mode&&!1===s.allowedInMath)throw new n("Can't use function '"+o+"' in math mode",r);const{args:i,optArgs:l}=this.parseArguments(o,s);return this.callFunction(o,i,l,r,e)}callFunction(e,t,r,o,s){const i={funcName:e,parser:this,token:o,breakOnTokenText:s},l=_n[e];if(l&&l.handler)return l.handler(i,t,r);throw new n("No function handler for "+e)}parseArguments(e,t){const r=t.numArgs+t.numOptionalArgs;if(0===r)return{args:[],optArgs:[]};const o=[],s=[];for(let i=0;i<r;i++){let r=t.argTypes&&t.argTypes[i];const l=i<t.numOptionalArgs;("primitive"in t&&t.primitive&&null==r||"sqrt"===t.type&&1===i&&null==s[0])&&(r="primitive");const a=this.parseGroupOfType("argument to '"+e+"'",r,l);if(l)s.push(a);else{if(null==a)throw new n("Null argument, please report this as a bug");o.push(a)}}return{args:o,optArgs:s}}parseGroupOfType(e,t,r){switch(t){case"color":return this.parseColorGroup(r);case"size":return this.parseSizeGroup(r);case"url":return this.parseUrlGroup(r);case"math":case"text":return this.parseArgumentGroup(r,t);case"hbox":{const e=this.parseArgumentGroup(r,"text");return null!=e?{type:"styling",mode:e.mode,body:[e],style:"text",resetFont:!0}:null}case"raw":{const e=this.parseStringGroup("raw",r);return null!=e?{type:"raw",mode:"text",string:e.text}:null}case"primitive":{if(r)throw new n("A primitive argument cannot be optional");const t=this.parseGroup(e);if(null==t)throw new n("Expected group as "+e,this.fetch());return t}case"original":case null:case void 0:return this.parseArgumentGroup(r);default:throw new n("Unknown group type as "+e,this.fetch())}}consumeSpaces(){for(;" "===this.fetch().text;)this.consume()}parseStringGroup(e,t){const r=this.gullet.scanArgument(t);if(null==r)return null;let n,o="";for(;"EOF"!==(n=this.fetch()).text;)o+=n.text,this.consume();return this.consume(),r.text=o,r}parseRegexGroup(e,t){const r=this.fetch();let o,s=r,i="";for(;"EOF"!==(o=this.fetch()).text&&e.test(i+o.text);)s=o,i+=s.text,this.consume();if(""===i)throw new n("Invalid "+t+": '"+r.text+"'",r);return r.range(s,i)}parseColorGroup(e){const t=this.parseStringGroup("color",e);if(null==t)return null;const r=/^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(t.text);if(!r)throw new n("Invalid color: '"+t.text+"'",t);let o=r[0];return/^[0-9a-f]{6}$/i.test(o)&&(o="#"+o),{type:"color-token",mode:this.mode,color:o}}parseSizeGroup(e){let t,r=!1;if(this.gullet.consumeSpaces(),t=e||"{"===this.gullet.future().text?this.parseStringGroup("size",e):this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/,"size"),!t)return null;e||0!==t.text.length||(t.text="0pt",r=!0);const o=/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t.text);if(!o)throw new n("Invalid size: '"+t.text+"'",t);const s={number:+(o[1]+o[2]),unit:o[3]};if(!H(s))throw new n("Invalid unit: '"+s.unit+"'",t);return{type:"size",mode:this.mode,value:s,isBlank:r}}parseUrlGroup(e){this.gullet.lexer.setCatcode("%",13),this.gullet.lexer.setCatcode("~",12);const t=this.parseStringGroup("url",e);if(this.gullet.lexer.setCatcode("%",14),this.gullet.lexer.setCatcode("~",13),null==t)return null;const r=t.text.replace(/\\([#$%&~_^{}])/g,"$1");return{type:"url",mode:this.mode,url:r}}parseArgumentGroup(e,t){const r=this.gullet.scanArgument(e);if(null==r)return null;const n=this.mode;t&&this.switchMode(t),this.gullet.beginGroup();const o=this.parseExpression(!1,"EOF");this.expect("EOF"),this.gullet.endGroup();const s={type:"ordgroup",mode:this.mode,loc:r.loc,body:o};return t&&this.switchMode(n),s}parseGroup(e,t){const r=this.fetch(),o=r.text;let s;if("{"===o||"\\begingroup"===o){this.consume();const e="{"===o?"}":"\\endgroup";this.gullet.beginGroup();const t=this.parseExpression(!1,e),n=this.fetch();this.expect(e),this.gullet.endGroup(),s={type:"ordgroup",mode:this.mode,loc:ln.range(r,n),body:t,semisimple:"\\begingroup"===o||void 0}}else if(s=this.parseFunction(t,e)||this.parseSymbol(),null==s&&"\\"===o[0]&&!ho.hasOwnProperty(o)){if(this.settings.throwOnError)throw new n("Undefined control sequence: "+o,r);s=this.formatUnsupportedCmd(o),this.consume()}return s}formLigatures(e){let t=e.length-1;for(let r=0;r<t;++r){const n=e[r];if("textord"!==n.type)continue;const o=n.text,s=e[r+1];if(s&&"textord"===s.type){if("-"===o&&"-"===s.text){const o=e[r+2];r+1<t&&o&&"textord"===o.type&&"-"===o.text?(e.splice(r,3,{type:"textord",mode:"text",loc:ln.range(n,o),text:"---"}),t-=2):(e.splice(r,2,{type:"textord",mode:"text",loc:ln.range(n,s),text:"--"}),t-=1)}"'"!==o&&"`"!==o||s.text!==o||(e.splice(r,2,{type:"textord",mode:"text",loc:ln.range(n,s),text:o+o}),t-=1)}}}parseSymbol(){const e=this.fetch();let t=e.text;if(/^\\verb[^a-zA-Z]/.test(t)){this.consume();let e=t.slice(5);const r="*"===e.charAt(0);if(r&&(e=e.slice(1)),e.length<2||e.charAt(0)!==e.slice(-1))throw new n("\\verb assertion failed --\n                    please report what input caused this bug");return e=e.slice(1,-1),{type:"verb",mode:"text",body:e,star:r}}fo.hasOwnProperty(t[0])&&!ne[this.mode][t[0]]&&(this.settings.strict&&"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Accented Unicode text character "'+t[0]+'" used in math mode',e),t=fo[t[0]]+t.slice(1));const r=Jn.exec(t);let o;if(r&&(t=t.substring(0,r.index),"i"===t?t="\u0131":"j"===t&&(t="\u0237")),ne[this.mode][t]){this.settings.strict&&"math"===this.mode&&Me.includes(t)&&this.settings.reportNonstrict("unicodeTextInMathMode",'Latin-1/Unicode text character "'+t[0]+'" used in math mode',e);const r=ne[this.mode][t].group,n=ln.range(e);let s;s=r in rr?{type:"atom",mode:this.mode,family:r,loc:n,text:t}:{type:r,mode:this.mode,loc:n,text:t},o=s}else{if(!(t.charCodeAt(0)>=128))return null;this.settings.strict&&(T(t.charCodeAt(0))?"math"===this.mode&&this.settings.reportNonstrict("unicodeTextInMathMode",'Unicode text character "'+t[0]+'" used in math mode',e):this.settings.reportNonstrict("unknownSymbol",'Unrecognized Unicode character "'+t[0]+'" ('+t.charCodeAt(0)+")",e)),o={type:"textord",mode:"text",loc:ln.range(e),text:t}}if(this.consume(),r)for(let t=0;t<r[0].length;t++){const s=r[0][t];if(!go[s])throw new n("Unknown accent ' "+s+"'",e);const i=go[s][this.mode]||go[s].text;if(!i)throw new n("Accent "+s+" unsupported in "+this.mode+" mode",e);o={type:"accent",mode:this.mode,loc:ln.range(e),label:i,isStretchy:!1,isShifty:!0,base:o}}return o}}bo.endOfExpression=new Set(["}","\\endgroup","\\end","\\right","&"]);var yo=function(e,t){if(!("string"==typeof e||e instanceof String))throw new TypeError("KaTeX can only parse string typed expression");const r=new bo(e,t);delete r.gullet.macros.current["\\df@tag"];let o=r.parse();if(delete r.gullet.macros.current["\\current@color"],delete r.gullet.macros.current["\\color"],r.gullet.macros.get("\\df@tag")){if(!t.displayMode)throw new n("\\tag works only in display equations");o=[{type:"tag",mode:"text",body:o,tag:r.subparse([new an("\\df@tag")])}]}return o};let xo=function(e,t,r){t.textContent="";const n=vo(e,r).toNode();t.appendChild(n)};"undefined"!=typeof document&&"CSS1Compat"!==document.compatMode&&("undefined"!=typeof console&&console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype."),xo=function(){throw new n("KaTeX doesn't work in quirks mode.")});const wo=function(e,t,r){if(r.throwOnError||!(e instanceof n))throw e;const o=je(["katex-error"],[new W(t)]);return o.setAttribute("title",e.toString()),o.setAttribute("style","color:"+r.errorColor),o},vo=function(e,t){const r=new g(t);try{const t=yo(e,r);return Zt(t,e,r)}catch(t){return wo(t,e,r)}};var ko={version:"0.16.47",render:xo,renderToString:function(e,t){return vo(e,t).toMarkup()},ParseError:n,SETTINGS_SCHEMA:u,__parse:function(e,t){const r=new g(t);return yo(e,r)},__renderToDomTree:vo,__renderToHTMLTree:function(e,t){const r=new g(t);try{return function(e,t,r){const n=Tt(e,_t(r)),o=je(["katex"],[n]);return $t(o,r)}(yo(e,r),0,r)}catch(t){return wo(t,e,r)}},__setFontMetrics:function(e,t){K[e]=t},__defineSymbol:oe,__defineFunction:mt,__defineMacro:sn,__domTree:{Span:U,Anchor:X,SymbolNode:W,SvgNode:_,PathNode:$,LineNode:Z}};return t=t.default}()});x=4`ĥx   /**
 * This is the ParseError class, which is the main error thrown by KaTeX
 * functions when something has gone wrong. This is used to distinguish internal
 * errors from errors in the expression that the user provided.
 *
 * If possible, a caller should provide a Token or ParseNode with information
 * about where in the source string the problem occurred.
 */
class ParseError extends Error {
  // The underlying error message without any context added.
  constructor(message,
  // The error message
  token) {
    var error = "KaTeX parse error: " + message;
    var start;
    var end;
    var loc = token && token.loc;
    if (loc && loc.start <= loc.end) {
      // If we have the input and a position, make the error a bit fancier
      // Get the input
      var input = loc.lexer.input;
      // Prepend some information
      start = loc.start;
      end = loc.end;
      if (start === input.length) {
        error += " at end of input: ";
      } else {
        error += " at position " + (start + 1) + ": ";
      }
      // Underline token in question using combining underscores
      var underlined = input.slice(start, end).replace(/[^]/g, "$&\u0332");
      // Extract some context from the input and add it to the error
      var left;
      if (start > 15) {
        left = "…" + input.slice(start - 15, start);
      } else {
        left = input.slice(0, start);
      }
      var right;
      if (end + 15 < input.length) {
        right = input.slice(end, end + 15) + "…";
      } else {
        right = input.slice(end);
      }
      error += left + underlined + right;
    }
    super(error);
    this.name = "ParseError";
    this.position = void 0;
    // Error start position based on passed-in Token or ParseNode.
    this.length = void 0;
    // Length of affected text based on passed-in Token or ParseNode.
    this.rawMessage = void 0;
    Object.setPrototypeOf(this, ParseError.prototype);
    this.position = start;
    if (start != null && end != null) {
      this.length = end - start;
    }
    this.rawMessage = message;
  }
}

/**
 * This file contains a list of utility functions which are useful in other
 * files.
 */
// hyphenate and escape adapted from Facebook's React under Apache 2 license
var uppercase = /([A-Z])/g;
var hyphenate = str => str.replace(uppercase, "-$1").toLowerCase();
var ESCAPE_LOOKUP = {
  "&": "&amp;",
  ">": "&gt;",
  "<": "&lt;",
  "\"": "&quot;",
  "'": "&#x27;"
};
var ESCAPE_REGEX = /[&><"']/g;
/**
 * Escapes text to prevent scripting attacks.
 */
var escape = text => String(text).replace(ESCAPE_REGEX, match => ESCAPE_LOOKUP[match]);
/**
 * Sometimes we want to pull out the innermost element of a group. In most
 * cases, this will just be the group itself, but when ordgroups and colors have
 * a single element, we want to pull that out.
 */
var getBaseElem = group => {
  if (group.type === "ordgroup") {
    if (group.body.length === 1) {
      return getBaseElem(group.body[0]);
    } else {
      return group;
    }
  } else if (group.type === "color") {
    if (group.body.length === 1) {
      return getBaseElem(group.body[0]);
    } else {
      return group;
    }
  } else if (group.type === "font") {
    return getBaseElem(group.body);
  } else {
    return group;
  }
};
var characterNodesTypes = new Set(["mathord", "textord", "atom"]);
/**
 * TeXbook algorithms often reference "character boxes", which are simply groups
 * with a single character in them. To decide if something is a character box,
 * we find its innermost group, and see if it is a single character.
 */
var isCharacterBox = group => characterNodesTypes.has(getBaseElem(group).type);
/**
 * Return the protocol of a URL, or "_relative" if the URL does not specify a
 * protocol (and thus is relative), or `null` if URL has invalid protocol
 * (so should be outright rejected).
 */
var protocolFromUrl = url => {
  // Check for possible leading protocol.
  // https://url.spec.whatwg.org/#url-parsing strips leading whitespace
  // (U+20) or C0 control (U+00-U+1F) characters.
  var protocol = /^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(url);
  if (!protocol) {
    return "_relative";
  }
  // Reject weird colons
  if (protocol[2] !== ":") {
    return null;
  }
  // Reject invalid characters in scheme according to
  // https://datatracker.ietf.org/doc/html/rfc3986#section-3.1
  if (!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(protocol[1])) {
    return null;
  }
  // Lowercase the protocol
  return protocol[1].toLowerCase();
};

/* eslint no-console:0 */
// TODO: automatically generate documentation
// TODO: check all properties on Settings exist
// TODO: check the type of a property on Settings matches
var SETTINGS_SCHEMA = {
  displayMode: {
    type: "boolean",
    description: "Render math in display mode, which puts the math in " + "display style (so \\int and \\sum are large, for example), and " + "centers the math on the page on its own line.",
    cli: "-d, --display-mode"
  },
  output: {
    type: {
      enum: ["htmlAndMathml", "html", "mathml"]
    },
    description: "Determines the markup language of the output.",
    cli: "-F, --format <type>"
  },
  leqno: {
    type: "boolean",
    description: "Render display math in leqno style (left-justified tags)."
  },
  fleqn: {
    type: "boolean",
    description: "Render display math flush left."
  },
  throwOnError: {
    type: "boolean",
    default: true,
    cli: "-t, --no-throw-on-error",
    cliDescription: "Render errors (in the color given by --error-color) ins" + "tead of throwing a ParseError exception when encountering an error."
  },
  errorColor: {
    type: "string",
    default: "#cc0000",
    cli: "-c, --error-color <color>",
    cliDescription: "A color string given in the format 'rgb' or 'rrggbb' " + "(no #). This option determines the color of errors rendered by the " + "-t option.",
    cliProcessor: color => "#" + color
  },
  macros: {
    type: "object",
    cli: "-m, --macro <def>",
    cliDescription: "Define custom macro of the form '\\foo:expansion' (use " + "multiple -m arguments for multiple macros).",
    cliDefault: [],
    cliProcessor: (def, defs) => {
      defs.push(def);
      return defs;
    }
  },
  minRuleThickness: {
    type: "number",
    description: "Specifies a minimum thickness, in ems, for fraction lines," + " `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, " + "`\\hdashline`, `\\underline`, `\\overline`, and the borders of " + "`\\fbox`, `\\boxed`, and `\\fcolorbox`.",
    processor: t => Math.max(0, t),
    cli: "--min-rule-thickness <size>",
    cliProcessor: parseFloat
  },
  colorIsTextColor: {
    type: "boolean",
    description: "Makes \\color behave like LaTeX's 2-argument \\textcolor, " + "instead of LaTeX's one-argument \\color mode change.",
    cli: "-b, --color-is-text-color"
  },
  strict: {
    type: [{
      enum: ["warn", "ignore", "error"]
    }, "boolean", "function"],
    description: "Turn on strict / LaTeX faithfulness mode, which throws an " + "error if the input uses features that are not supported by LaTeX.",
    cli: "-S, --strict",
    cliDefault: false
  },
  trust: {
    type: ["boolean", "function"],
    description: "Trust the input, enabling all HTML features such as \\url.",
    cli: "-T, --trust"
  },
  maxSize: {
    type: "number",
    default: Infinity,
    description: "If non-zero, all user-specified sizes, e.g. in " + "\\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, " + "elements and spaces can be arbitrarily large",
    processor: s => Math.max(0, s),
    cli: "-s, --max-size <n>",
    cliProcessor: parseInt
  },
  maxExpand: {
    type: "number",
    default: 1000,
    description: "Limit the number of macro expansions to the specified " + "number, to prevent e.g. infinite macro loops. If set to Infinity, " + "the macro expander will try to fully expand as in LaTeX.",
    processor: n => Math.max(0, n),
    cli: "-e, --max-expand <n>",
    cliProcessor: n => n === "Infinity" ? Infinity : parseInt(n)
  },
  globalGroup: {
    type: "boolean",
    cli: false
  }
};
function getImplicitDefault(type) {
  if (typeof type !== 'string') {
    return type.enum[0];
  }
  switch (type) {
    case 'boolean':
      return false;
    case 'string':
      return '';
    case 'number':
      return 0;
    case 'object':
      return {};
    default:
      throw new Error("Unexpected schema type; settings must declare an explicit default.");
  }
}
function getDefaultValue(schema) {
  if (schema.default !== undefined) {
    return schema.default;
  }
  var type = Array.isArray(schema.type) ? schema.type[0] : schema.type;
  return getImplicitDefault(type);
}
function applySetting(target, prop, options, schema) {
  var optionValue = options[prop];
  target[prop] = optionValue !== undefined ? schema.processor ? schema.processor(optionValue) : optionValue : getDefaultValue(schema);
}
/**
 * The main Settings object
 *
 * The current options stored are:
 *  - displayMode: Whether the expression should be typeset as inline math
 *                 (false, the default), meaning that the math starts in
 *                 \textstyle and is placed in an inline-block); or as display
 *                 math (true), meaning that the math starts in \displaystyle
 *                 and is placed in a block with vertical margin.
 */
class Settings {
  constructor(options) {
    if (options === void 0) {
      options = {};
    }
    this.displayMode = void 0;
    this.output = void 0;
    this.leqno = void 0;
    this.fleqn = void 0;
    this.throwOnError = void 0;
    this.errorColor = void 0;
    this.macros = void 0;
    this.minRuleThickness = void 0;
    this.colorIsTextColor = void 0;
    this.strict = void 0;
    this.trust = void 0;
    this.maxSize = void 0;
    this.maxExpand = void 0;
    this.globalGroup = void 0;
    // allow null options
    options = options || {};
    for (var prop of Object.keys(SETTINGS_SCHEMA)) {
      var schema = SETTINGS_SCHEMA[prop];
      if (schema) {
        // TODO: validate options
        applySetting(this, prop, options, schema);
      }
    }
  }
  /**
   * Report nonstrict (non-LaTeX-compatible) input.
   * Can safely not be called if `this.strict` is false in JavaScript.
   */
  reportNonstrict(errorCode, errorMsg, token) {
    var strict = this.strict;
    if (typeof strict === "function") {
      // Allow return value of strict function to be boolean or string
      // (or null/undefined, meaning no further processing).
      strict = strict(errorCode, errorMsg, token);
    }
    if (!strict || strict === "ignore") {
      return;
    } else if (strict === true || strict === "error") {
      throw new ParseError("LaTeX-incompatible input and strict mode is set to 'error': " + (errorMsg + " [" + errorCode + "]"), token);
    } else if (strict === "warn") {
      typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (errorMsg + " [" + errorCode + "]"));
    } else {
      // won't happen in type-safe code
      typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + strict + "': " + errorMsg + " [" + errorCode + "]"));
    }
  }
  /**
   * Check whether to apply strict (LaTeX-adhering) behavior for unusual
   * input (like `\\`).  Unlike `nonstrict`, will not throw an error;
   * instead, "error" translates to a return value of `true`, while "ignore"
   * translates to a return value of `false`.  May still print a warning:
   * "warn" prints a warning and returns `false`.
   * This is for the second category of `errorCode`s listed in the README.
   */
  useStrictBehavior(errorCode, errorMsg, token) {
    var strict = this.strict;
    if (typeof strict === "function") {
      // Allow return value of strict function to be boolean or string
      // (or null/undefined, meaning no further processing).
      // But catch any exceptions thrown by function, treating them
      // like "error".
      try {
        strict = strict(errorCode, errorMsg, token);
      } catch (error) {
        strict = "error";
      }
    }
    if (!strict || strict === "ignore") {
      return false;
    } else if (strict === true || strict === "error") {
      return true;
    } else if (strict === "warn") {
      typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to 'warn': " + (errorMsg + " [" + errorCode + "]"));
      return false;
    } else {
      // won't happen in type-safe code
      typeof console !== "undefined" && console.warn("LaTeX-incompatible input and strict mode is set to " + ("unrecognized '" + strict + "': " + errorMsg + " [" + errorCode + "]"));
      return false;
    }
  }
  /**
   * Check whether to test potentially dangerous input, and return
   * `true` (trusted) or `false` (untrusted).  The sole argument `context`
   * should be an object with `command` field specifying the relevant LaTeX
   * command (as a string starting with `\`), and any other arguments, etc.
   * If `context` has a `url` field, a `protocol` field will automatically
   * get added by this function (changing the specified object).
   */
  isTrusted(context) {
    if ("url" in context && context.url && !context.protocol) {
      var protocol = protocolFromUrl(context.url);
      if (protocol == null) {
        return false;
      }
      context.protocol = protocol;
    }
    var trust = typeof this.trust === "function" ? this.trust(context) : this.trust;
    return Boolean(trust);
  }
}

/**
 * This file contains information and classes for the various kinds of styles
 * used in TeX. It provides a generic `Style` class, which holds information
 * about a specific style. It then provides instances of all the different kinds
 * of styles possible, and provides functions to move between them and get
 * information about them.
 */
/**
 * The main style class. Contains a unique id for the style, a size (which is
 * the same for cramped and uncramped version of a style), and a cramped flag.
 */
class Style {
  constructor(id, size, cramped) {
    this.id = void 0;
    this.size = void 0;
    this.cramped = void 0;
    this.id = id;
    this.size = size;
    this.cramped = cramped;
  }
  /**
   * Get the style of a superscript given a base in the current style.
   */
  sup() {
    return styles[sup[this.id]];
  }
  /**
   * Get the style of a subscript given a base in the current style.
   */
  sub() {
    return styles[sub[this.id]];
  }
  /**
   * Get the style of a fraction numerator given the fraction in the current
   * style.
   */
  fracNum() {
    return styles[fracNum[this.id]];
  }
  /**
   * Get the style of a fraction denominator given the fraction in the current
   * style.
   */
  fracDen() {
    return styles[fracDen[this.id]];
  }
  /**
   * Get the cramped version of a style (in particular, cramping a cramped style
   * doesn't change the style).
   */
  cramp() {
    return styles[cramp[this.id]];
  }
  /**
   * Get a text or display version of this style.
   */
  text() {
    return styles[text$1[this.id]];
  }
  /**
   * Return true if this style is tightly spaced (scriptstyle/scriptscriptstyle)
   */
  isTight() {
    return this.size >= 2;
  }
}
// IDs of the different styles
var D = 0;
var Dc = 1;
var T = 2;
var Tc = 3;
var S = 4;
var Sc = 5;
var SS = 6;
var SSc = 7;
// Instances of the different styles
var styles = [new Style(D, 0, false), new Style(Dc, 0, true), new Style(T, 1, false), new Style(Tc, 1, true), new Style(S, 2, false), new Style(Sc, 2, true), new Style(SS, 3, false), new Style(SSc, 3, true)];
// Lookup tables for switching from one style to another
var sup = [S, Sc, S, Sc, SS, SSc, SS, SSc];
var sub = [Sc, Sc, Sc, Sc, SSc, SSc, SSc, SSc];
var fracNum = [T, Tc, S, Sc, SS, SSc, SS, SSc];
var fracDen = [Tc, Tc, Sc, Sc, SSc, SSc, SSc, SSc];
var cramp = [Dc, Dc, Tc, Tc, Sc, Sc, SSc, SSc];
var text$1 = [D, Dc, T, Tc, T, Tc, T, Tc];
// We only export some of the styles.
var Style$1 = {
  DISPLAY: styles[D],
  TEXT: styles[T],
  SCRIPT: styles[S],
  SCRIPTSCRIPT: styles[SS]
};

/*
 * This file defines the Unicode scripts and script families that we
 * support. To add new scripts or families, just add a new entry to the
 * scriptData array below. Adding scripts to the scriptData array allows
 * characters from that script to appear in \text{} environments.
 */
/**
 * Unicode block data for the families of scripts we support in \text{}.
 * Scripts only need to appear here if they do not have font metrics.
 */
var scriptData = [{
  // Latin characters beyond the Latin-1 characters we have metrics for.
  // Needed for Czech, Hungarian and Turkish text, for example.
  name: 'latin',
  blocks: [[0x0100, 0x024f],
  // Latin Extended-A and Latin Extended-B
  [0x0300, 0x036f] // Combining Diacritical marks
  ]
}, {
  // The Cyrillic script used by Russian and related languages.
  // A Cyrillic subset used to be supported as explicitly defined
  // symbols in symbols.js
  name: 'cyrillic',
  blocks: [[0x0400, 0x04ff]]
}, {
  // Armenian
  name: 'armenian',
  blocks: [[0x0530, 0x058F]]
}, {
  // The Brahmic scripts of South and Southeast Asia
  // Devanagari (0900–097F)
  // Bengali (0980–09FF)
  // Gurmukhi (0A00–0A7F)
  // Gujarati (0A80–0AFF)
  // Oriya (0B00–0B7F)
  // Tamil (0B80–0BFF)
  // Telugu (0C00–0C7F)
  // Kannada (0C80–0CFF)
  // Malayalam (0D00–0D7F)
  // Sinhala (0D80–0DFF)
  // Thai (0E00–0E7F)
  // Lao (0E80–0EFF)
  // Tibetan (0F00–0FFF)
  // Myanmar (1000–109F)
  name: 'brahmic',
  blocks: [[0x0900, 0x109F]]
}, {
  name: 'georgian',
  blocks: [[0x10A0, 0x10ff]]
}, {
  // Chinese and Japanese.
  // The "k" in cjk is for Korean, but we've separated Korean out
  name: "cjk",
  blocks: [[0x3000, 0x30FF],
  // CJK symbols and punctuation, Hiragana, Katakana
  [0x4E00, 0x9FAF],
  // CJK ideograms
  [0xFF00, 0xFF60] // Fullwidth punctuation
  // TODO: add halfwidth Katakana and Romanji glyphs
  ]
}, {
  // Korean
  name: 'hangul',
  blocks: [[0xAC00, 0xD7AF]]
}];
/**
 * Given a codepoint, return the name of the script or script family
 * it is from, or null if it is not part of a known block
 */
function scriptFromCodepoint(codepoint) {
  for (var i = 0; i < scriptData.length; i++) {
    var script = scriptData[i];
    for (var _i = 0; _i < script.blocks.length; _i++) {
      var block = script.blocks[_i];
      if (codepoint >= block[0] && codepoint <= block[1]) {
        return script.name;
      }
    }
  }
  return null;
}
/**
 * A flattened version of all the supported blocks in a single array.
 * This is an optimization to make supportedCodepoint() fast.
 */
var allBlocks = [];
scriptData.forEach(s => s.blocks.forEach(b => allBlocks.push(...b)));
/**
 * Given a codepoint, return true if it falls within one of the
 * scripts or script families defined above and false otherwise.
 *
 * Micro benchmarks shows that this is faster than
 * /[\u3000-\u30FF\u4E00-\u9FAF\uFF00-\uFF60\uAC00-\uD7AF\u0900-\u109F]/.test()
 * in Firefox, Chrome and Node.
 */
function supportedCodepoint(codepoint) {
  for (var i = 0; i < allBlocks.length; i += 2) {
    if (codepoint >= allBlocks[i] && codepoint <= allBlocks[i + 1]) {
      return true;
    }
  }
  return false;
}

/**
 * This file provides support to domTree.js and delimiter.js.
 * It's a storehouse of path geometry for SVG images.
 */
// In all paths below, the viewBox-to-em scale is 1000:1.
// Second Brush Stroke
//    Low resolution monitors struggle to display images in fine detail.
//    So browsers apply anti-aliasing. A long straight arrow shaft therefore
//    will sometimes appear as if it has a blurred edge.
//    To mitigate this, these SVG files contain a second "brush-stroke" on the
//    arrow shafts. That is, a second long thin rectangular SVG path has been
//    written directly on top of each arrow shaft. This reinforcement causes
//    some of the screen pixels to display as black instead of the anti-aliased
//    gray pixel that a  single path would generate. So we get arrow shafts
//    whose edges appear to be sharper.
var doubleBrushStroke = svgPath => svgPath + " " + svgPath;
var hLinePad = 80; // padding above a sqrt vinculum. Prevents image cropping.
// The vinculum of a \sqrt can be made thicker by a KaTeX rendering option.
// Think of variable extraVinculum as two detours in the SVG path.
// The detour begins at the lower left of the area labeled extraVinculum below.
// The detour proceeds one extraVinculum distance up and slightly to the right,
// displacing the radiused corner between surd and vinculum. The radius is
// traversed as usual, then the detour resumes. It goes right, to the end of
// the very long vinculum, then down one extraVinculum distance,
// after which it resumes regular path geometry for the radical.
/*                                                  vinculum
                                                   /
         /▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒←extraVinculum
        / █████████████████████←0.04em (40 unit) std vinculum thickness
       / /
      / /
     / /\
    / / surd
*/
var sqrtMain = function sqrtMain(extraVinculum, hLinePad) {
  // sqrtMain path geometry is from glyph U221A in the font KaTeX Main
  return "M95," + (622 + extraVinculum + hLinePad) + "\nc-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14\nc0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54\nc44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10\ns173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429\nc69,-144,104.5,-217.7,106.5,-221\nl" + extraVinculum / 2.075 + " -" + extraVinculum + "\nc5.3,-9.3,12,-14,20,-14\nH400000v" + (40 + extraVinculum) + "H845.2724\ns-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7\nc-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z\nM" + (834 + extraVinculum) + " " + hLinePad + "h400000v" + (40 + extraVinculum) + "h-400000z";
};
var sqrtSize1 = function sqrtSize1(extraVinculum, hLinePad) {
  // size1 is from glyph U221A in the font KaTeX_Size1-Regular
  return "M263," + (601 + extraVinculum + hLinePad) + "c0.7,0,18,39.7,52,119\nc34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120\nc340,-704.7,510.7,-1060.3,512,-1067\nl" + extraVinculum / 2.084 + " -" + extraVinculum + "\nc4.7,-7.3,11,-11,19,-11\nH40000v" + (40 + extraVinculum) + "H1012.3\ns-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232\nc-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1\ns-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26\nc-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z\nM" + (1001 + extraVinculum) + " " + hLinePad + "h400000v" + (40 + extraVinculum) + "h-400000z";
};
var sqrtSize2 = function sqrtSize2(extraVinculum, hLinePad) {
  // size2 is from glyph U221A in the font KaTeX_Size2-Regular
  return "M983 " + (10 + extraVinculum + hLinePad) + "\nl" + extraVinculum / 3.13 + " -" + extraVinculum + "\nc4,-6.7,10,-10,18,-10 H400000v" + (40 + extraVinculum) + "\nH1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7\ns-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744\nc-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30\nc26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722\nc56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5\nc53.7,-170.3,84.5,-266.8,92.5,-289.5z\nM" + (1001 + extraVinculum) + " " + hLinePad + "h400000v" + (40 + extraVinculum) + "h-400000z";
};
var sqrtSize3 = function sqrtSize3(extraVinculum, hLinePad) {
  // size3 is from glyph U221A in the font KaTeX_Size3-Regular
  return "M424," + (2398 + extraVinculum + hLinePad) + "\nc-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514\nc0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20\ns-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121\ns209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081\nl" + extraVinculum / 4.223 + " -" + extraVinculum + "c4,-6.7,10,-10,18,-10 H400000\nv" + (40 + extraVinculum) + "H1014.6\ns-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185\nc-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2z M" + (1001 + extraVinculum) + " " + hLinePad + "\nh400000v" + (40 + extraVinculum) + "h-400000z";
};
var sqrtSize4 = function sqrtSize4(extraVinculum, hLinePad) {
  // size4 is from glyph U221A in the font KaTeX_Size4-Regular
  return "M473," + (2713 + extraVinculum + hLinePad) + "\nc339.3,-1799.3,509.3,-2700,510,-2702 l" + extraVinculum / 5.298 + " -" + extraVinculum + "\nc3.3,-7.3,9.3,-11,18,-11 H400000v" + (40 + extraVinculum) + "H1017.7\ns-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9\nc-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200\nc0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26\ns76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,\n606zM" + (1001 + extraVinculum) + " " + hLinePad + "h400000v" + (40 + extraVinculum) + "H1017.7z";
};
var phasePath = function phasePath(y) {
  var x = y / 2; // x coordinate at top of angle
  return "M400000 " + y + " H0 L" + x + " 0 l65 45 L145 " + (y - 80) + " H400000z";
};
var sqrtTall = function sqrtTall(extraVinculum, hLinePad, viewBoxHeight) {
  // sqrtTall is from glyph U23B7 in the font KaTeX_Size4-Regular
  // One path edge has a variable length. It runs vertically from the vinculum
  // to a point near (14 units) the bottom of the surd. The vinculum
  // is normally 40 units thick. So the length of the line in question is:
  var vertSegment = viewBoxHeight - 54 - hLinePad - extraVinculum;
  return "M702 " + (extraVinculum + hLinePad) + "H400000" + (40 + extraVinculum) + "\nH742v" + vertSegment + "l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1\nh-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170\nc-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667\n219 661 l218 661zM702 " + hLinePad + "H400000v" + (40 + extraVinculum) + "H742z";
};
var sqrtPath = function sqrtPath(size, extraVinculum, viewBoxHeight) {
  extraVinculum = 1000 * extraVinculum; // Convert from document ems to viewBox.
  var path = "";
  switch (size) {
    case "sqrtMain":
      path = sqrtMain(extraVinculum, hLinePad);
      break;
    case "sqrtSize1":
      path = sqrtSize1(extraVinculum, hLinePad);
      break;
    case "sqrtSize2":
      path = sqrtSize2(extraVinculum, hLinePad);
      break;
    case "sqrtSize3":
      path = sqrtSize3(extraVinculum, hLinePad);
      break;
    case "sqrtSize4":
      path = sqrtSize4(extraVinculum, hLinePad);
      break;
    case "sqrtTall":
      path = sqrtTall(extraVinculum, hLinePad, viewBoxHeight);
  }
  return path;
};
var innerPath = function innerPath(name, height) {
  // The inner part of stretchy tall delimiters
  switch (name) {
    case "\u239c":
      return doubleBrushStroke("M291 0 H417 V" + height + " H291z");
    case "\u2223":
      return doubleBrushStroke("M145 0 H188 V" + height + " H145z");
    case "\u2225":
      return doubleBrushStroke("M145 0 H188 V" + height + " H145z") + doubleBrushStroke("M367 0 H410 V" + height + " H367z");
    case "\u239f":
      return doubleBrushStroke("M457 0 H583 V" + height + " H457z");
    case "\u23a2":
      return doubleBrushStroke("M319 0 H403 V" + height + " H319z");
    case "\u23a5":
      return doubleBrushStroke("M263 0 H347 V" + height + " H263z");
    case "\u23aa":
      return doubleBrushStroke("M384 0 H504 V" + height + " H384z");
    case "\u23d0":
      return doubleBrushStroke("M312 0 H355 V" + height + " H312z");
    case "\u2016":
      return doubleBrushStroke("M257 0 H300 V" + height + " H257z") + doubleBrushStroke("M478 0 H521 V" + height + " H478z");
    default:
      return "";
  }
};
var path = {
  // The doubleleftarrow geometry is from glyph U+21D0 in the font KaTeX Main
  doubleleftarrow: "M262 157\nl10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3\n 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28\n 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5\nc2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5\n 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87\n-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7\n-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z\nm8 0v40h399730v-40zm0 194v40h399730v-40z",
  // doublerightarrow is from glyph U+21D2 in font KaTeX Main
  doublerightarrow: "M399738 392l\n-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5\n 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88\n-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68\n-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18\n-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782\nc-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3\n-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z",
  // leftarrow is from glyph U+2190 in font KaTeX Main
  leftarrow: "M400000 241H110l3-3c68.7-52.7 113.7-120\n 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8\n-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247\nc-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208\n 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3\n 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202\n l-3-3h399890zM100 241v40h399900v-40z",
  // overbrace is from glyphs U+23A9/23A8/23A7 in font KaTeX_Size4-Regular
  leftbrace: "M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117\n-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7\n 5-6 9-10 13-.7 1-7.3 1-20 1H6z",
  leftbraceunder: "M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13\n 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688\n 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7\n-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z",
  // overgroup is from the MnSymbol package (public domain)
  leftgroup: "M400000 80\nH435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0\n 435 0h399565z",
  leftgroupunder: "M400000 262\nH435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219\n 435 219h399565z",
  // Harpoons are from glyph U+21BD in font KaTeX Main
  leftharpoon: "M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3\n-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5\n-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7\n-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z",
  leftharpoonplus: "M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5\n 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3\n-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7\n-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z\nm0 0v40h400000v-40z",
  leftharpoondown: "M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333\n 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5\n 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667\n-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z",
  leftharpoondownplus: "M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12\n 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7\n-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0\nv40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z",
  // hook is from glyph U+21A9 in font KaTeX Main
  lefthook: "M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5\n-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3\n-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21\n 71.5 23h399859zM103 281v-40h399897v40z",
  leftlinesegment: doubleBrushStroke("M40 281 V428 H0 V94 H40 V241 H400000 v40z"),
  leftbracketunder: doubleBrushStroke("M0 0 h120 V290 H399995 v120 H0z"),
  leftbracketover: doubleBrushStroke("M0 440 h120 V150 H399995 v-120 H0z"),
  leftmapsto: doubleBrushStroke("M40 281 V448H0V74H40V241H400000v40z"),
  // tofrom is from glyph U+21C4 in font KaTeX AMS Regular
  leftToFrom: "M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23\n-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8\nc28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3\n 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z",
  longequal: doubleBrushStroke("M0 50 h400000 v40H0z m0 194h40000v40H0z"),
  midbrace: "M200428 334\nc-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14\n-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7\n 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11\n 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z",
  midbraceunder: "M199572 214\nc100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14\n 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3\n 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0\n-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z",
  oiintSize1: "M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6\n-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z\nm368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8\n60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z",
  oiintSize2: "M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8\n-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z\nm502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2\nc0 110 84 276 504 276s502.4-166 502.4-276z",
  oiiintSize1: "M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6\n-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z\nm525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0\n85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z",
  oiiintSize2: "M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8\n-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z\nm770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1\nc0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z",
  rightarrow: "M0 241v40h399891c-47.3 35.3-84 78-110 128\n-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20\n 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7\n 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85\n-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n 151.7 139 205zm0 0v40h399900v-40z",
  rightbrace: "M400000 542l\n-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5\ns-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1\nc124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z",
  rightbraceunder: "M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3\n 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237\n-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z",
  rightgroup: "M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0\n 3-1 3-3v-38c-76-158-257-219-435-219H0z",
  rightgroupunder: "M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18\n 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z",
  rightharpoon: "M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3\n-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2\n-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58\n 69.2 92 94.5zm0 0v40h399900v-40z",
  rightharpoonplus: "M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11\n-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7\n 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z\nm0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z",
  rightharpoondown: "M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8\n 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5\n-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95\n-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z",
  rightharpoondownplus: "M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8\n 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3\n 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3\n-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z\nm0-194v40h400000v-40zm0 0v40h400000v-40z",
  righthook: "M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3\n 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0\n-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21\n 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z",
  rightlinesegment: doubleBrushStroke("M399960 241 V94 h40 V428 h-40 V281 H0 v-40z"),
  rightbracketunder: doubleBrushStroke("M399995 0 h-120 V290 H0 v120 H400000z"),
  rightbracketover: doubleBrushStroke("M399995 440 h-120 V150 H0 v-120 H399995z"),
  rightToFrom: "M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23\n 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32\n-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142\n-167z M100 147v40h399900v-40zM0 341v40h399900v-40z",
  // twoheadleftarrow is from glyph U+219E in font KaTeX AMS Regular
  twoheadleftarrow: "M0 167c68 40\n 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69\n-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3\n-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19\n-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101\n 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z",
  twoheadrightarrow: "M400000 167\nc-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3\n 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42\n 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333\n-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70\n 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z",
  // tilde1 is a modified version of a glyph from the MnSymbol package
  tilde1: "M200 55.538c-77 0-168 73.953-177 73.953-3 0-7\n-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0\n 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0\n 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128\n-68.267.847-113-73.952-191-73.952z",
  // ditto tilde2, tilde3, & tilde4
  tilde2: "M344 55.266c-142 0-300.638 81.316-311.5 86.418\n-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9\n 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114\nc1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751\n 181.476 676 181.476c-149 0-189-126.21-332-126.21z",
  tilde3: "M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457\n-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0\n 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697\n 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696\n -338 0-409-156.573-744-156.573z",
  tilde4: "M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345\n-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409\n 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9\n 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409\n -175.236-744-175.236z",
  // vec is from glyph U+20D7 in font KaTeX Main
  vec: "M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5\n3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11\n10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63\n-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1\n-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59\nH213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359\nc-16-25.333-24-45-24-59z",
  // widehat1 is a modified version of a glyph from the MnSymbol package
  widehat1: "M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22\nc-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z",
  // ditto widehat2, widehat3, & widehat4
  widehat2: "M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",
  widehat3: "M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",
  widehat4: "M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10\n-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z",
  // widecheck paths are all inverted versions of widehat
  widecheck1: "M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,\n-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z",
  widecheck2: "M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",
  widecheck3: "M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",
  widecheck4: "M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,\n-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z",
  // The next ten paths support reaction arrows from the mhchem package.
  // Arrows for \ce{<-->} are offset from xAxis by 0.22ex, per mhchem in LaTeX
  // baraboveleftarrow is mostly from glyph U+2190 in font KaTeX Main
  baraboveleftarrow: "M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202\nc4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5\nc-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130\ns-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47\n121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6\ns2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11\nc0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z\nM100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z",
  // rightarrowabovebar is mostly from glyph U+2192, KaTeX Main
  rightarrowabovebar: "M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32\n-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0\n13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39\n-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5\n-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5\n-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67\n151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z",
  // The short left harpoon has 0.5em (i.e. 500 units) kern on the left end.
  // Ref from mhchem.sty: \rlap{\raisebox{-.22ex}{$\kern0.5em
  baraboveshortleftharpoon: "M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17\nc2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21\nc-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40\nc-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z\nM0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z",
  rightharpoonaboveshortbar: "M0,241 l0,40c399126,0,399993,0,399993,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z",
  shortbaraboveleftharpoon: "M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11\nc1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,\n1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,\n-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z\nM93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z",
  shortrightharpoonabovebar: "M53,241l0,40c398570,0,399437,0,399437,0\nc4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,\n-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6\nc-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z\nM500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z"
};
var tallDelim = function tallDelim(label, midHeight) {
  switch (label) {
    case "lbrack":
      return "M403 1759 V84 H666 V0 H319 V1759 v" + midHeight + " v1759 v84 h347 v-84\nH403z M403 1759 V0 H319 V1759 v" + midHeight + " v1759 v84 h84z";
    case "rbrack":
      return "M347 1759 V0 H0 V84 H263 V1759 v" + midHeight + " v1759 H0 v84 H347z\nM347 1759 V0 H263 V1759 v" + midHeight + " v1759 h84z";
    case "vert":
      return "M145 15 v585 v" + midHeight + " v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v" + -midHeight + " v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v" + midHeight + " v585 h43z";
    case "doublevert":
      return "M145 15 v585 v" + midHeight + " v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v" + -midHeight + " v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M188 15 H145 v585 v" + midHeight + " v585 h43z\nM367 15 v585 v" + midHeight + " v585 c2.667,10,9.667,15,21,15\nc10,0,16.667,-5,20,-15 v-585 v" + -midHeight + " v-585 c-2.667,-10,-9.667,-15,-21,-15\nc-10,0,-16.667,5,-20,15z M410 15 H367 v585 v" + midHeight + " v585 h43z";
    case "lfloor":
      return "M319 602 V0 H403 V602 v" + midHeight + " v1715 h263 v84 H319z\nMM319 602 V0 H403 V602 v" + midHeight + " v1715 H319z";
    case "rfloor":
      return "M319 602 V0 H403 V602 v" + midHeight + " v1799 H0 v-84 H319z\nMM319 602 V0 H403 V602 v" + midHeight + " v1715 H319z";
    case "lceil":
      return "M403 1759 V84 H666 V0 H319 V1759 v" + midHeight + " v602 h84z\nM403 1759 V0 H319 V1759 v" + midHeight + " v602 h84z";
    case "rceil":
      return "M347 1759 V0 H0 V84 H263 V1759 v" + midHeight + " v602 h84z\nM347 1759 V0 h-84 V1759 v" + midHeight + " v602 h84z";
    case "lparen":
      return "M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1\nc-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,\n-36,557 l0," + (midHeight + 84) + "c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,\n949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9\nc0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,\n-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189\nl0,-" + (midHeight + 92) + "c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,\n-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z";
    case "rparen":
      return "M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,\n63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5\nc11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0," + (midHeight + 9) + "\nc-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664\nc-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11\nc0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17\nc242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558\nl0,-" + (midHeight + 144) + "c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,\n-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z";
    default:
      // We should not ever get here.
      throw new Error("Unknown stretchy delimiter.");
  }
};

function isMathDomNode(node) {
  return 'toText' in node;
}
/**
 * This node represents a document fragment, which contains elements, but when
 * placed into the DOM doesn't have any representation itself. It only contains
 * children and doesn't have any DOM node properties.
 */
class DocumentFragment {
  // Never used; needed for satisfying interface.
  constructor(children) {
    this.children = void 0;
    this.classes = void 0;
    this.height = void 0;
    this.depth = void 0;
    this.maxFontSize = void 0;
    this.style = void 0;
    this.children = children;
    this.classes = [];
    this.height = 0;
    this.depth = 0;
    this.maxFontSize = 0;
    this.style = {};
  }
  hasClass(className) {
    return this.classes.includes(className);
  }
  /** Convert the fragment into a node. */
  toNode() {
    var frag = document.createDocumentFragment();
    for (var i = 0; i < this.children.length; i++) {
      frag.appendChild(this.children[i].toNode());
    }
    return frag;
  }
  /** Convert the fragment into HTML markup. */
  toMarkup() {
    var markup = "";
    // Simply concatenate the markup for the children together.
    for (var i = 0; i < this.children.length; i++) {
      markup += this.children[i].toMarkup();
    }
    return markup;
  }
  /**
   * Converts the math node into a string, similar to innerText. Applies to
   * MathDomNode's only.
   */
  toText() {
    return this.children.map(child => {
      if (isMathDomNode(child)) {
        return child.toText();
      }
      throw new Error("Expected MathDomNode with toText, got " + child.constructor.name);
    }).join("");
  }
}

/**
 * This file does conversion between units.  In particular, it provides
 * calculateSize to convert other units into ems.
 */
// This table gives the number of TeX pts in one of each *absolute* TeX unit.
// Thus, multiplying a length by this number converts the length from units
// into pts.  Dividing the result by ptPerEm gives the number of ems
// *assuming* a font size of ptPerEm (normal size, normal style).
var ptPerUnit = {
  // https://en.wikibooks.org/wiki/LaTeX/Lengths and
  // https://tex.stackexchange.com/a/8263
  "pt": 1,
  // TeX point
  "mm": 7227 / 2540,
  // millimeter
  "cm": 7227 / 254,
  // centimeter
  "in": 72.27,
  // inch
  "bp": 803 / 800,
  // big (PostScript) points
  "pc": 12,
  // pica
  "dd": 1238 / 1157,
  // didot
  "cc": 14856 / 1157,
  // cicero (12 didot)
  "nd": 685 / 642,
  // new didot
  "nc": 1370 / 107,
  // new cicero (12 new didot)
  "sp": 1 / 65536,
  // scaled point (TeX's internal smallest unit)
  // https://tex.stackexchange.com/a/41371
  "px": 803 / 800 // \pdfpxdimen defaults to 1 bp in pdfTeX and LuaTeX
};
// Dictionary of relative units, for fast validity testing.
var relativeUnit = {
  "ex": true,
  "em": true,
  "mu": true
};
/**
 * Determine whether the specified unit (either a string defining the unit
 * or a "size" parse node containing a unit field) is valid.
 */
var validUnit = function validUnit(unit) {
  if (typeof unit !== "string") {
    unit = unit.unit;
  }
  return unit in ptPerUnit || unit in relativeUnit || unit === "ex";
};
/*
 * Convert a "size" parse node (with numeric "number" and string "unit" fields,
 * as parsed by functions.js argType "size") into a CSS em value for the
 * current style/scale.  `options` gives the current options.
 */
var calculateSize = function calculateSize(sizeValue, options) {
  var scale;
  if (sizeValue.unit in ptPerUnit) {
    // Absolute units
    scale = ptPerUnit[sizeValue.unit] // Convert unit to pt
    / options.fontMetrics().ptPerEm // Convert pt to CSS em
    / options.sizeMultiplier; // Unscale to make absolute units
  } else if (sizeValue.unit === "mu") {
    // `mu` units scale with scriptstyle/scriptscriptstyle.
    scale = options.fontMetrics().cssEmPerMu;
  } else {
    // Other relative units always refer to the *textstyle* font
    // in the current size.
    var unitOptions;
    if (options.style.isTight()) {
      // isTight() means current style is script/scriptscript.
      unitOptions = options.havingStyle(options.style.text());
    } else {
      unitOptions = options;
    }
    // TODO: In TeX these units are relative to the quad of the current
    // *text* font, e.g. cmr10. KaTeX instead uses values from the
    // comparably-sized *Computer Modern symbol* font. At 10pt, these
    // match. At 7pt and 5pt, they differ: cmr7=1.138894, cmsy7=1.170641;
    // cmr5=1.361133, cmsy5=1.472241. Consider $\scriptsize a\kern1emb$.
    // TeX \showlists shows a kern of 1.13889 * fontsize;
    // KaTeX shows a kern of 1.171 * fontsize.
    if (sizeValue.unit === "ex") {
      scale = unitOptions.fontMetrics().xHeight;
    } else if (sizeValue.unit === "em") {
      scale = unitOptions.fontMetrics().quad;
    } else {
      throw new ParseError("Invalid unit: '" + sizeValue.unit + "'");
    }
    if (unitOptions !== options) {
      scale *= unitOptions.sizeMultiplier / options.sizeMultiplier;
    }
  }
  return Math.min(sizeValue.number * scale, options.maxSize);
};
/**
 * Round `n` to 4 decimal places, or to the nearest 1/10,000th em. See
 * https://github.com/KaTeX/KaTeX/pull/2460.
 */
var makeEm = function makeEm(n) {
  return +n.toFixed(4) + "em";
};

/**
 * These objects store the data about the DOM nodes we create, as well as some
 * extra data. They can then be transformed into real DOM nodes with the
 * `toNode` function or HTML markup using `toMarkup`. They are useful for both
 * storing extra properties on the nodes, as well as providing a way to easily
 * work with the DOM.
 *
 * Similar functions for working with MathML nodes exist in mathMLTree.js.
 *
 * TODO: refactor `span` and `anchor` into common superclass when
 * target environments support class inheritance
 */
/**
 * Create an HTML className based on a list of classes. In addition to joining
 * with spaces, we also remove empty classes.
 */
var createClass = function createClass(classes) {
  return classes.filter(cls => cls).join(" ");
};
/**
 * Serialize a CssStyle object into a semicolon-delimited inline-style string
 * (hyphenating camelCase property names). Returns "" when no property is set.
 */
var cssStyleToString = function cssStyleToString(style) {
  var styles = "";
  for (var key of Object.keys(style)) {
    var value = style[key];
    if (value !== undefined) {
      styles += hyphenate(key) + ":" + value + ";";
    }
  }
  return styles;
};
var initNode = function initNode(classes, options, style) {
  this.classes = classes || [];
  this.attributes = {};
  this.height = 0;
  this.depth = 0;
  this.maxFontSize = 0;
  this.style = style || {};
  if (options) {
    if (options.style.isTight()) {
      this.classes.push("mtight");
    }
    var color = options.getColor();
    if (color) {
      this.style.color = color;
    }
  }
};
/**
 * Convert into an HTML node
 */
var toNode = function toNode(tagName) {
  var node = document.createElement(tagName);
  // Apply the class
  node.className = createClass(this.classes);
  // Apply inline styles
  Object.assign(node.style, this.style);
  // Apply attributes
  for (var attr of Object.keys(this.attributes)) {
    node.setAttribute(attr, this.attributes[attr]);
  }
  // Append the children, also as HTML nodes
  for (var i = 0; i < this.children.length; i++) {
    node.appendChild(this.children[i].toNode());
  }
  return node;
};
/**
 * https://w3c.github.io/html-reference/syntax.html#syntax-attributes
 *
 * > Attribute Names must consist of one or more characters
 * other than the space characters, U+0000 NULL,
 * '"', "'", ">", "/", "=", the control characters,
 * and any characters that are not defined by Unicode.
 */
var invalidAttributeNameRegex = /[\s"'>/=\x00-\x1f]/;
/**
 * Convert into an HTML markup string
 */
var toMarkup = function toMarkup(tagName) {
  var markup = "<" + tagName;
  // Add the class
  if (this.classes.length) {
    markup += " class=\"" + escape(createClass(this.classes)) + "\"";
  }
  var styles = cssStyleToString(this.style);
  if (styles) {
    markup += " style=\"" + escape(styles) + "\"";
  }
  // Add the attributes
  for (var attr of Object.keys(this.attributes)) {
    if (invalidAttributeNameRegex.test(attr)) {
      throw new ParseError("Invalid attribute name '" + attr + "'");
    }
    markup += " " + attr + "=\"" + escape(this.attributes[attr]) + "\"";
  }
  markup += ">";
  // Add the markup of the children, also as markup
  for (var i = 0; i < this.children.length; i++) {
    markup += this.children[i].toMarkup();
  }
  markup += "</" + tagName + ">";
  return markup;
};
/**
 * This node represents a span node, with a className, a list of children, and
 * an inline style. It also contains information about its height, depth, and
 * maxFontSize.
 *
 * Represents two types with different uses: SvgSpan to wrap an SVG and DomSpan
 * otherwise. This typesafety is important when HTML builders access a span's
 * children.
 */
class Span {
  constructor(classes, children, options, style) {
    this.children = void 0;
    this.attributes = void 0;
    this.classes = void 0;
    this.height = void 0;
    this.depth = void 0;
    this.width = void 0;
    this.maxFontSize = void 0;
    this.style = void 0;
    /**
     * Italic correction carried over from a SymbolNode when the symbol is
     * wrapped in a vlist (e.g. \oiint / \oiiint).  Read by supsub to adjust
     * subscript positioning.  Only set when nonzero; use `?? 0` at read sites.
     */
    this.italic = void 0;
    initNode.call(this, classes, options, style);
    this.children = children || [];
  }
  /**
   * Sets an arbitrary attribute on the span. Warning: use this wisely. Not
   * all browsers support attributes the same, and having too many custom
   * attributes is probably bad.
   */
  setAttribute(attribute, value) {
    this.attributes[attribute] = value;
  }
  hasClass(className) {
    return this.classes.includes(className);
  }
  toNode() {
    return toNode.call(this, "span");
  }
  toMarkup() {
    return toMarkup.call(this, "span");
  }
}
/**
 * This node represents an anchor (<a>) element with a hyperlink.  See `span`
 * for further details.
 */
class Anchor {
  constructor(href, classes, children, options) {
    this.children = void 0;
    this.attributes = void 0;
    this.classes = void 0;
    this.height = void 0;
    this.depth = void 0;
    this.maxFontSize = void 0;
    this.style = void 0;
    initNode.call(this, classes, options);
    this.children = children || [];
    this.setAttribute('href', href);
  }
  setAttribute(attribute, value) {
    this.attributes[attribute] = value;
  }
  hasClass(className) {
    return this.classes.includes(className);
  }
  toNode() {
    return toNode.call(this, "a");
  }
  toMarkup() {
    return toMarkup.call(this, "a");
  }
}
/**
 * This node represents an image embed (<img>) element.
 */
class Img {
  constructor(src, alt, style) {
    this.src = void 0;
    this.alt = void 0;
    this.classes = void 0;
    this.height = void 0;
    this.depth = void 0;
    this.maxFontSize = void 0;
    this.style = void 0;
    this.alt = alt;
    this.src = src;
    this.classes = ["mord"];
    this.height = 0;
    this.depth = 0;
    this.maxFontSize = 0;
    this.style = style;
  }
  hasClass(className) {
    return this.classes.includes(className);
  }
  toNode() {
    var node = document.createElement("img");
    node.src = this.src;
    node.alt = this.alt;
    node.className = "mord";
    // Apply inline styles
    Object.assign(node.style, this.style);
    return node;
  }
  toMarkup() {
    var markup = "<img src=\"" + escape(this.src) + "\"" + (" alt=\"" + escape(this.alt) + "\"");
    var styles = cssStyleToString(this.style);
    if (styles) {
      markup += " style=\"" + escape(styles) + "\"";
    }
    markup += "'/>";
    return markup;
  }
}
var iCombinations = {
  'î': '\u0131\u0302',
  'ï': '\u0131\u0308',
  'í': '\u0131\u0301',
  // 'ī': '\u0131\u0304', // enable when we add Extended Latin
  'ì': '\u0131\u0300'
};
/**
 * A symbol node contains information about a single symbol. It either renders
 * to a single text node, or a span with a single text node in it, depending on
 * whether it has CSS classes, styles, or needs italic correction.
 */
class SymbolNode {
  constructor(text, height, depth, italic, skew, width, classes, style) {
    this.text = void 0;
    this.height = void 0;
    this.depth = void 0;
    this.italic = void 0;
    this.skew = void 0;
    this.width = void 0;
    this.maxFontSize = void 0;
    this.classes = void 0;
    this.style = void 0;
    this.text = text;
    this.height = height || 0;
    this.depth = depth || 0;
    this.italic = italic || 0;
    this.skew = skew || 0;
    this.width = width || 0;
    this.classes = classes || [];
    this.style = style || {};
    this.maxFontSize = 0;
    // Mark text from non-Latin scripts with specific classes so that we
    // can specify which fonts to use.  This allows us to render these
    // characters with a serif font in situations where the browser would
    // either default to a sans serif or render a placeholder character.
    // We use CSS class names like cjk_fallback, hangul_fallback and
    // brahmic_fallback. See ./unicodeScripts.js for the set of possible
    // script names
    var script = scriptFromCodepoint(this.text.charCodeAt(0));
    if (script) {
      this.classes.push(script + "_fallback");
    }
    if (/[îïíì]/.test(this.text)) {
      // add ī when we add Extended Latin
      this.text = iCombinations[this.text];
    }
  }
  hasClass(className) {
    return this.classes.includes(className);
  }
  /**
   * Creates a text node or span from a symbol node. Note that a span is only
   * created if it is needed.
   */
  toNode() {
    var node = document.createTextNode(this.text);
    var span = null;
    if (this.italic > 0) {
      span = document.createElement("span");
      span.style.marginRight = makeEm(this.italic);
    }
    if (this.classes.length > 0) {
      span = span || document.createElement("span");
      span.className = createClass(this.classes);
    }
    if (Object.keys(this.style).length > 0) {
      span = span || document.createElement("span");
      Object.assign(span.style, this.style);
    }
    if (span) {
      span.appendChild(node);
      return span;
    } else {
      return node;
    }
  }
  /**
   * Creates markup for a symbol node.
   */
  toMarkup() {
    // TODO(alpert): More duplication than I'd like from
    // span.prototype.toMarkup and symbolNode.prototype.toNode...
    var needsSpan = false;
    var markup = "<span";
    if (this.classes.length) {
      needsSpan = true;
      markup += " class=\"";
      markup += escape(createClass(this.classes));
      markup += "\"";
    }
    var styles = "";
    if (this.italic > 0) {
      styles += "margin-right:" + makeEm(this.italic) + ";";
    }
    styles += cssStyleToString(this.style);
    if (styles) {
      needsSpan = true;
      markup += " style=\"" + escape(styles) + "\"";
    }
    var escaped = escape(this.text);
    if (needsSpan) {
      markup += ">";
      markup += escaped;
      markup += "</span>";
      return markup;
    } else {
      return escaped;
    }
  }
}
/**
 * SVG nodes are used to render stretchy wide elements.
 */
class SvgNode {
  constructor(children, attributes) {
    this.children = void 0;
    this.attributes = void 0;
    this.children = children || [];
    this.attributes = attributes || {};
  }
  toNode() {
    var svgNS = "http://www.w3.org/2000/svg";
    var node = document.createElementNS(svgNS, "svg");
    // Apply attributes
    for (var attr of Object.keys(this.attributes)) {
      node.setAttribute(attr, this.attributes[attr]);
    }
    for (var i = 0; i < this.children.length; i++) {
      node.appendChild(this.children[i].toNode());
    }
    return node;
  }
  toMarkup() {
    var markup = "<svg xmlns=\"http://www.w3.org/2000/svg\"";
    // Apply attributes
    for (var attr of Object.keys(this.attributes)) {
      markup += " " + attr + "=\"" + escape(this.attributes[attr]) + "\"";
    }
    markup += ">";
    for (var i = 0; i < this.children.length; i++) {
      markup += this.children[i].toMarkup();
    }
    markup += "</svg>";
    return markup;
  }
}
class PathNode {
  constructor(pathName, alternate) {
    this.pathName = void 0;
    this.alternate = void 0;
    this.pathName = pathName;
    this.alternate = alternate; // Used only for \sqrt, \phase, & tall delims
  }
  toNode() {
    var svgNS = "http://www.w3.org/2000/svg";
    var node = document.createElementNS(svgNS, "path");
    if (this.alternate) {
      node.setAttribute("d", this.alternate);
    } else {
      node.setAttribute("d", path[this.pathName]);
    }
    return node;
  }
  toMarkup() {
    if (this.alternate) {
      return "<path d=\"" + escape(this.alternate) + "\"/>";
    } else {
         return "<path d=\"" + escape(path[this.pathName]) + "\"/>";
    }
  }
}
class LineNode {
  constructor(attributes) {
    this.attributes = void 0;
    this.attributes = attributes || {};
  }
  toNode() {
    var svgNS = "http://www.w3.org/2000/svg";
    var node = document.createElementNS(svgNS, "line");
    // Apply attributes
    for (var attr of Object.keys(this.attributes)) {
      node.setAttribute(attr, this.attributes[attr]);
    }
    return node;
  }
  toMarkup() {
    var markup = "<line";
    for (var attr of Object.keys(this.attributes)) {
      markup += " " + attr + "=\"" + escape(this.attributes[attr]) + "\"";
    }
    markup += "/>";
    return markup;
  }
}
function assertSymbolDomNode(group) {
  if (group instanceof SymbolNode) {
    return group;
  } else {
    throw new Error("Expected symbolNode but got " + String(group) + ".");
  }
}
function assertSpan(group) {
  if (group instanceof Span) {
    return group;
  } else {
    throw new Error("Expected span<HtmlDomNode> but got " + String(group) + ".");
  }
}
/**
 * Whether an HtmlDomNode has HtmlDomNode children.
 * HtmlDomNode is a base type representing a union of
 * SymbolNode, SvgSpan, DomSpan, Anchor, and documentFragment.
 * In the last three cases, the children are HtmlDomNode[].
 */
var hasHtmlDomChildren = node => node instanceof Span || node instanceof Anchor || node instanceof DocumentFragment;

// This file is GENERATED by buildMetrics.sh. DO NOT MODIFY.
var fontMetricsData = {
  "AMS-Regular": {
    "32": [0, 0, 0, 0, 0.25],
    "65": [0, 0.68889, 0, 0, 0.72222],
    "66": [0, 0.68889, 0, 0, 0.66667],
    "67": [0, 0.68889, 0, 0, 0.72222],
    "68": [0, 0.68889, 0, 0, 0.72222],
    "69": [0, 0.68889, 0, 0, 0.66667],
    "70": [0, 0.68889, 0, 0, 0.61111],
    "71": [0, 0.68889, 0, 0, 0.77778],
    "72": [0, 0.68889, 0, 0, 0.77778],
    "73": [0, 0.68889, 0, 0, 0.38889],
    "74": [0.16667, 0.68889, 0, 0, 0.5],
    "75": [0, 0.68889, 0, 0, 0.77778],
    "76": [0, 0.68889, 0, 0, 0.66667],
    "77": [0, 0.68889, 0, 0, 0.94445],
    "78": [0, 0.68889, 0, 0, 0.72222],
    "79": [0.16667, 0.68889, 0, 0, 0.77778],
    "80": [0, 0.68889, 0, 0, 0.61111],
    "81": [0.16667, 0.68889, 0, 0, 0.77778],
    "82": [0, 0.68889, 0, 0, 0.72222],
    "83": [0, 0.68889, 0, 0, 0.55556],
    "84": [0, 0.68889, 0, 0, 0.66667],
    "85": [0, 0.68889, 0, 0, 0.72222],
    "86": [0, 0.68889, 0, 0, 0.72222],
    "87": [0, 0.68889, 0, 0, 1.0],
    "88": [0, 0.68889, 0, 0, 0.72222],
    "89": [0, 0.68889, 0, 0, 0.72222],
    "90": [0, 0.68889, 0, 0, 0.66667],
    "107": [0, 0.68889, 0, 0, 0.55556],
    "160": [0, 0, 0, 0, 0.25],
    "165": [0, 0.675, 0.025, 0, 0.75],
    "174": [0.15559, 0.69224, 0, 0, 0.94666],
    "240": [0, 0.68889, 0, 0, 0.55556],
    "295": [0, 0.68889, 0, 0, 0.54028],
    "710": [0, 0.825, 0, 0, 2.33334],
    "732": [0, 0.9, 0, 0, 2.33334],
    "770": [0, 0.825, 0, 0, 2.33334],
    "771": [0, 0.9, 0, 0, 2.33334],
    "989": [0.08167, 0.58167, 0, 0, 0.77778],
    "1008": [0, 0.43056, 0.04028, 0, 0.66667],
    "8245": [0, 0.54986, 0, 0, 0.275],
    "8463": [0, 0.68889, 0, 0, 0.54028],
    "8487": [0, 0.68889, 0, 0, 0.72222],
    "8498": [0, 0.68889, 0, 0, 0.55556],
    "8502": [0, 0.68889, 0, 0, 0.66667],
    "8503": [0, 0.68889, 0, 0, 0.44445],
    "8504": [0, 0.68889, 0, 0, 0.66667],
    "8513": [0, 0.68889, 0, 0, 0.63889],
    "8592": [-0.03598, 0.46402, 0, 0, 0.5],
    "8594": [-0.03598, 0.46402, 0, 0, 0.5],
    "8602": [-0.13313, 0.36687, 0, 0, 1.0],
    "8603": [-0.13313, 0.36687, 0, 0, 1.0],
    "8606": [0.01354, 0.52239, 0, 0, 1.0],
    "8608": [0.01354, 0.52239, 0, 0, 1.0],
    "8610": [0.01354, 0.52239, 0, 0, 1.11111],
    "8611": [0.01354, 0.52239, 0, 0, 1.11111],
    "8619": [0, 0.54986, 0, 0, 1.0],
    "8620": [0, 0.54986, 0, 0, 1.0],
    "8621": [-0.13313, 0.37788, 0, 0, 1.38889],
    "8622": [-0.13313, 0.36687, 0, 0, 1.0],
    "8624": [0, 0.69224, 0, 0, 0.5],
    "8625": [0, 0.69224, 0, 0, 0.5],
    "8630": [0, 0.43056, 0, 0, 1.0],
    "8631": [0, 0.43056, 0, 0, 1.0],
    "8634": [0.08198, 0.58198, 0, 0, 0.77778],
    "8635": [0.08198, 0.58198, 0, 0, 0.77778],
    "8638": [0.19444, 0.69224, 0, 0, 0.41667],
    "8639": [0.19444, 0.69224, 0, 0, 0.41667],
    "8642": [0.19444, 0.69224, 0, 0, 0.41667],
    "8643": [0.19444, 0.69224, 0, 0, 0.41667],
    "8644": [0.1808, 0.675, 0, 0, 1.0],
    "8646": [0.1808, 0.675, 0, 0, 1.0],
    "8647": [0.1808, 0.675, 0, 0, 1.0],
    "8648": [0.19444, 0.69224, 0, 0, 0.83334],
    "8649": [0.1808, 0.675, 0, 0, 1.0],
    "8650": [0.19444, 0.69224, 0, 0, 0.83334],
    "8651": [0.01354, 0.52239, 0, 0, 1.0],
    "8652": [0.01354, 0.52239, 0, 0, 1.0],
    "8653": [-0.13313, 0.36687, 0, 0, 1.0],
    "8654": [-0.13313, 0.36687, 0, 0, 1.0],
    "8655": [-0.13313, 0.36687, 0, 0, 1.0],
    "8666": [0.13667, 0.63667, 0, 0, 1.0],
    "8667": [0.13667, 0.63667, 0, 0, 1.0],
    "8669": [-0.13313, 0.37788, 0, 0, 1.0],
    "8672": [-0.064, 0.437, 0, 0, 1.334],
    "8674": [-0.064, 0.437, 0, 0, 1.334],
    "8705": [0, 0.825, 0, 0, 0.5],
    "8708": [0, 0.68889, 0, 0, 0.55556],
    "8709": [0.08167, 0.58167, 0, 0, 0.77778],
    "8717": [0, 0.43056, 0, 0, 0.42917],
    "8722": [-0.03598, 0.46402, 0, 0, 0.5],
    "8724": [0.08198, 0.69224, 0, 0, 0.77778],
    "8726": [0.08167, 0.58167, 0, 0, 0.77778],
    "8733": [0, 0.69224, 0, 0, 0.77778],
    "8736": [0, 0.69224, 0, 0, 0.72222],
    "8737": [0, 0.69224, 0, 0, 0.72222],
    "8738": [0.03517, 0.52239, 0, 0, 0.72222],
    "8739": [0.08167, 0.58167, 0, 0, 0.22222],
    "8740": [0.25142, 0.74111, 0, 0, 0.27778],
    "8741": [0.08167, 0.58167, 0, 0, 0.38889],
    "8742": [0.25142, 0.74111, 0, 0, 0.5],
    "8756": [0, 0.69224, 0, 0, 0.66667],
    "8757": [0, 0.69224, 0, 0, 0.66667],
    "8764": [-0.13313, 0.36687, 0, 0, 0.77778],
    "8765": [-0.13313, 0.37788, 0, 0, 0.77778],
    "8769": [-0.13313, 0.36687, 0, 0, 0.77778],
    "8770": [-0.03625, 0.46375, 0, 0, 0.77778],
    "8774": [0.30274, 0.79383, 0, 0, 0.77778],
    "8776": [-0.01688, 0.48312, 0, 0, 0.77778],
    "8778": [0.08167, 0.58167, 0, 0, 0.77778],
    "8782": [0.06062, 0.54986, 0, 0, 0.77778],
    "8783": [0.06062, 0.54986, 0, 0, 0.77778],
    "8785": [0.08198, 0.58198, 0, 0, 0.77778],
    "8786": [0.08198, 0.58198, 0, 0, 0.77778],
    "8787": [0.08198, 0.58198, 0, 0, 0.77778],
    "8790": [0, 0.69224, 0, 0, 0.77778],
    "8791": [0.22958, 0.72958, 0, 0, 0.77778],
    "8796": [0.08198, 0.91667, 0, 0, 0.77778],
    "8806": [0.25583, 0.75583, 0, 0, 0.77778],
    "8807": [0.25583, 0.75583, 0, 0, 0.77778],
    "8808": [0.25142, 0.75726, 0, 0, 0.77778],
    "8809": [0.25142, 0.75726, 0, 0, 0.77778],
    "8812": [0.25583, 0.75583, 0, 0, 0.5],
    "8814": [0.20576, 0.70576, 0, 0, 0.77778],
    "8815": [0.20576, 0.70576, 0, 0, 0.77778],
    "8816": [0.30274, 0.79383, 0, 0, 0.77778],
    "8817": [0.30274, 0.79383, 0, 0, 0.77778],
    "8818": [0.22958, 0.72958, 0, 0, 0.77778],
    "8819": [0.22958, 0.72958, 0, 0, 0.77778],
    "8822": [0.1808, 0.675, 0, 0, 0.77778],
    "8823": [0.1808, 0.675, 0, 0, 0.77778],
    "8828": [0.13667, 0.63667, 0, 0, 0.77778],
    "8829": [0.13667, 0.63667, 0, 0, 0.77778],
    "8830": [0.22958, 0.72958, 0, 0, 0.77778],
    "8831": [0.22958, 0.72958, 0, 0, 0.77778],
    "8832": [0.20576, 0.70576, 0, 0, 0.77778],
    "8833": [0.20576, 0.70576, 0, 0, 0.77778],
    "8840": [0.30274, 0.79383, 0, 0, 0.77778],
    "8841": [0.30274, 0.79383, 0, 0, 0.77778],
    "8842": [0.13597, 0.63597, 0, 0, 0.77778],
    "8843": [0.13597, 0.63597, 0, 0, 0.77778],
    "8847": [0.03517, 0.54986, 0, 0, 0.77778],
    "8848": [0.03517, 0.54986, 0, 0, 0.77778],
    "8858": [0.08198, 0.58198, 0, 0, 0.77778],
    "8859": [0.08198, 0.58198, 0, 0, 0.77778],
    "8861": [0.08198, 0.58198, 0, 0, 0.77778],
    "8862": [0, 0.675, 0, 0, 0.77778],
    "8863": [0, 0.675, 0, 0, 0.77778],
    "8864": [0, 0.675, 0, 0, 0.77778],
    "8865": [0, 0.675, 0, 0, 0.77778],
    "8872": [0, 0.69224, 0, 0, 0.61111],
    "8873": [0, 0.69224, 0, 0, 0.72222],
    "8874": [0, 0.69224, 0, 0, 0.88889],
    "8876": [0, 0.68889, 0, 0, 0.61111],
    "8877": [0, 0.68889, 0, 0, 0.61111],
    "8878": [0, 0.68889, 0, 0, 0.72222],
    "8879": [0, 0.68889, 0, 0, 0.72222],
    "8882": [0.03517, 0.54986, 0, 0, 0.77778],
    "8883": [0.03517, 0.54986, 0, 0, 0.77778],
    "8884": [0.13667, 0.63667, 0, 0, 0.77778],
    "8885": [0.13667, 0.63667, 0, 0, 0.77778],
    "8888": [0, 0.54986, 0, 0, 1.11111],
    "8890": [0.19444, 0.43056, 0, 0, 0.55556],
    "8891": [0.19444, 0.69224, 0, 0, 0.61111],
    "8892": [0.19444, 0.69224, 0, 0, 0.61111],
    "8901": [0, 0.54986, 0, 0, 0.27778],
    "8903": [0.08167, 0.58167, 0, 0, 0.77778],
    "8905": [0.08167, 0.58167, 0, 0, 0.77778],
    "8906": [0.08167, 0.58167, 0, 0, 0.77778],
    "8907": [0, 0.69224, 0, 0, 0.77778],
    "8908": [0, 0.69224, 0, 0, 0.77778],
    "8909": [-0.03598, 0.46402, 0, 0, 0.77778],
    "8910": [0, 0.54986, 0, 0, 0.76042],
    "8911": [0, 0.54986, 0, 0, 0.76042],
    "8912": [0.03517, 0.54986, 0, 0, 0.77778],
    "8913": [0.03517, 0.54986, 0, 0, 0.77778],
    "8914": [0, 0.54986, 0, 0, 0.66667],
    "8915": [0, 0.54986, 0, 0, 0.66667],
    "8916": [0, 0.69224, 0, 0, 0.66667],
    "8918": [0.0391, 0.5391, 0, 0, 0.77778],
    "8919": [0.0391, 0.5391, 0, 0, 0.77778],
    "8920": [0.03517, 0.54986, 0, 0, 1.33334],
    "8921": [0.03517, 0.54986, 0, 0, 1.33334],
    "8922": [0.38569, 0.88569, 0, 0, 0.77778],
    "8923": [0.38569, 0.88569, 0, 0, 0.77778],
    "8926": [0.13667, 0.63667, 0, 0, 0.77778],
    "8927": [0.13667, 0.63667, 0, 0, 0.77778],
    "8928": [0.30274, 0.79383, 0, 0, 0.77778],
    "8929": [0.30274, 0.79383, 0, 0, 0.77778],
    "8934": [0.23222, 0.74111, 0, 0, 0.77778],
    "8935": [0.23222, 0.74111, 0, 0, 0.77778],
    "8936": [0.23222, 0.74111, 0, 0, 0.77778],
    "8937": [0.23222, 0.74111, 0, 0, 0.77778],
    "8938": [0.20576, 0.70576, 0, 0, 0.77778],
    "8939": [0.20576, 0.70576, 0, 0, 0.77778],
    "8940": [0.30274, 0.79383, 0, 0, 0.77778],
    "8941": [0.30274, 0.79383, 0, 0, 0.77778],
    "8994": [0.19444, 0.69224, 0, 0, 0.77778],
    "8995": [0.19444, 0.69224, 0, 0, 0.77778],
    "9416": [0.15559, 0.69224, 0, 0, 0.90222],
    "9484": [0, 0.69224, 0, 0, 0.5],
    "9488": [0, 0.69224, 0, 0, 0.5],
    "9492": [0, 0.37788, 0, 0, 0.5],
    "9496": [0, 0.37788, 0, 0, 0.5],
    "9585": [0.19444, 0.68889, 0, 0, 0.88889],
    "9586": [0.19444, 0.74111, 0, 0, 0.88889],
    "9632": [0, 0.675, 0, 0, 0.77778],
    "9633": [0, 0.675, 0, 0, 0.77778],
    "9650": [0, 0.54986, 0, 0, 0.72222],
    "9651": [0, 0.54986, 0, 0, 0.72222],
    "9654": [0.03517, 0.54986, 0, 0, 0.77778],
    "9660": [0, 0.54986, 0, 0, 0.72222],
    "9661": [0, 0.54986, 0, 0, 0.72222],
    "9664": [0.03517, 0.54986, 0, 0, 0.77778],
    "9674": [0.11111, 0.69224, 0, 0, 0.66667],
    "9733": [0.19444, 0.69224, 0, 0, 0.94445],
    "10003": [0, 0.69224, 0, 0, 0.83334],
    "10016": [0, 0.69224, 0, 0, 0.83334],
    "10731": [0.11111, 0.69224, 0, 0, 0.66667],
    "10846": [0.19444, 0.75583, 0, 0, 0.61111],
    "10877": [0.13667, 0.63667, 0, 0, 0.77778],
    "10878": [0.13667, 0.63667, 0, 0, 0.77778],
    "10885": [0.25583, 0.75583, 0, 0, 0.77778],
    "10886": [0.25583, 0.75583, 0, 0, 0.77778],
    "10887": [0.13597, 0.63597, 0, 0, 0.77778],
    "10888": [0.13597, 0.63597, 0, 0, 0.77778],
    "10889": [0.26167, 0.75726, 0, 0, 0.77778],
    "10890": [0.26167, 0.75726, 0, 0, 0.77778],
    "10891": [0.48256, 0.98256, 0, 0, 0.77778],
    "10892": [0.48256, 0.98256, 0, 0, 0.77778],
    "10901": [0.13667, 0.63667, 0, 0, 0.77778],
    "10902": [0.13667, 0.63667, 0, 0, 0.77778],
    "10933": [0.25142, 0.75726, 0, 0, 0.77778],
    "10934": [0.25142, 0.75726, 0, 0, 0.77778],
    "10935": [0.26167, 0.75726, 0, 0, 0.77778],
    "10936": [0.26167, 0.75726, 0, 0, 0.77778],
    "10937": [0.26167, 0.75726, 0, 0, 0.77778],
    "10938": [0.26167, 0.75726, 0, 0, 0.77778],
    "10949": [0.25583, 0.75583, 0, 0, 0.77778],
    "10950": [0.25583, 0.75583, 0, 0, 0.77778],
    "10955": [0.28481, 0.79383, 0, 0, 0.77778],
    "10956": [0.28481, 0.79383, 0, 0, 0.77778],
    "57350": [0.08167, 0.58167, 0, 0, 0.22222],
    "57351": [0.08167, 0.58167, 0, 0, 0.38889],
    "57352": [0.08167, 0.58167, 0, 0, 0.77778],
    "57353": [0, 0.43056, 0.04028, 0, 0.66667],
    "57356": [0.25142, 0.75726, 0, 0, 0.77778],
    "57357": [0.25142, 0.75726, 0, 0, 0.77778],
    "57358": [0.41951, 0.91951, 0, 0, 0.77778],
    "57359": [0.30274, 0.79383, 0, 0, 0.77778],
    "57360": [0.30274, 0.79383, 0, 0, 0.77778],
    "57361": [0.41951, 0.91951, 0, 0, 0.77778],
    "57366": [0.25142, 0.75726, 0, 0, 0.77778],
    "57367": [0.25142, 0.75726, 0, 0, 0.77778],
    "57368": [0.25142, 0.75726, 0, 0, 0.77778],
    "57369": [0.25142, 0.75726, 0, 0, 0.77778],
    "57370": [0.13597, 0.63597, 0, 0, 0.77778],
    "57371": [0.13597, 0.63597, 0, 0, 0.77778]
  },
  "Caligraphic-Regular": {
    "32": [0, 0, 0, 0, 0.25],
    "65": [0, 0.68333, 0, 0.19445, 0.79847],
    "66": [0, 0.68333, 0.03041, 0.13889, 0.65681],
    "67": [0, 0.68333, 0.05834, 0.13889, 0.52653],
    "68": [0, 0.68333, 0.02778, 0.08334, 0.77139],
    "69": [0, 0.68333, 0.08944, 0.11111, 0.52778],
    "70": [0, 0.68333, 0.09931, 0.11111, 0.71875],
    "71": [0.09722, 0.68333, 0.0593, 0.11111, 0.59487],
    "72": [0, 0.68333, 0.00965, 0.11111, 0.84452],
    "73": [0, 0.68333, 0.07382, 0, 0.54452],
    "74": [0.09722, 0.68333, 0.18472, 0.16667, 0.67778],
    "75": [0, 0.68333, 0.01445, 0.05556, 0.76195],
    "76": [0, 0.68333, 0, 0.13889, 0.68972],
    "77": [0, 0.68333, 0, 0.13889, 1.2009],
    "78": [0, 0.68333, 0.14736, 0.08334, 0.82049],
    "79": [0, 0.68333, 0.02778, 0.11111, 0.79611],
    "80": [0, 0.68333, 0.08222, 0.08334, 0.69556],
    "81": [0.09722, 0.68333, 0, 0.11111, 0.81667],
    "82": [0, 0.68333, 0, 0.08334, 0.8475],
    "83": [0, 0.68333, 0.075, 0.13889, 0.60556],
    "84": [0, 0.68333, 0.25417, 0, 0.54464],
    "85": [0, 0.68333, 0.09931, 0.08334, 0.62583],
    "86": [0, 0.68333, 0.08222, 0, 0.61278],
    "87": [0, 0.68333, 0.08222, 0.08334, 0.98778],
    "88": [0, 0.68333, 0.14643, 0.13889, 0.7133],
    "89": [0.09722, 0.68333, 0.08222, 0.08334, 0.66834],
    "90": [0, 0.68333, 0.07944, 0.13889, 0.72473],
    "160": [0, 0, 0, 0, 0.25]
  },
  "Fraktur-Regular": {
    "32": [0, 0, 0, 0, 0.25],
    "33": [0, 0.69141, 0, 0, 0.29574],
    "34": [0, 0.69141, 0, 0, 0.21471],
    "38": [0, 0.69141, 0, 0, 0.73786],
    "39": [0, 0.69141, 0, 0, 0.21201],
    "40": [0.24982, 0.74947, 0, 0, 0.38865],
    "41": [0.24982, 0.74947, 0, 0, 0.38865],
    "42": [0, 0.62119, 0, 0, 0.27764],
    "43": [0.08319, 0.58283, 0, 0, 0.75623],
    "44": [0, 0.10803, 0, 0, 0.27764],
    "45": [0.08319, 0.58283, 0, 0, 0.75623],
    "46": [0, 0.10803, 0, 0, 0.27764],
    "47": [0.24982, 0.74947, 0, 0, 0.50181],
    "48": [0, 0.47534, 0, 0, 0.50181],
    "49": [0, 0.47534, 0, 0, 0.50181],
    "50": [0, 0.47534, 0, 0, 0.50181],
    "51": [0.18906, 0.47534, 0, 0, 0.50181],
    "52": [0.18906, 0.47534, 0, 0, 0.50181],
    "53": [0.18906, 0.47534, 0, 0, 0.50181],
    "54": [0, 0.69141, 0, 0, 0.50181],
    "55": [0.18906, 0.47534, 0, 0, 0.50181],
    "56": [0, 0.69141, 0, 0, 0.50181],
    "57": [0.18906, 0.47534, 0, 0, 0.50181],
    "58": [0, 0.47534, 0, 0, 0.21606],
    "59": [0.12604, 0.47534, 0, 0, 0.21606],
    "61": [-0.13099, 0.36866, 0, 0, 0.75623],
    "63": [0, 0.69141, 0, 0, 0.36245],
    "65": [0, 0.69141, 0, 0, 0.7176],
    "66": [0, 0.69141, 0, 0, 0.88397],
    "67": [0, 0.69141, 0, 0, 0.61254],
    "68": [0, 0.69141, 0, 0, 0.83158],
    "69": [0, 0.69141, 0, 0, 0.66278],
    "70": [0.12604, 0.69141, 0, 0, 0.61119],
    "71": [0, 0.69141, 0, 0, 0.78539],
    "72": [0.06302, 0.69141, 0, 0, 0.7203],
    "73": [0, 0.69141, 0, 0, 0.55448],
    "74": [0.12604, 0.69141, 0, 0, 0.55231],
    "75": [0, 0.69141, 0, 0, 0.66845],
    "76": [0, 0.69141, 0, 0, 0.66602],
    "77": [0, 0.69141, 0, 0, 1.04953],
    "78": [0, 0.69141, 0, 0, 0.83212],
    "79": [0, 0.69141, 0, 0, 0.82699],
    "80": [0.18906, 0.69141, 0, 0, 0.82753],
    "81": [0.03781, 0.69141, 0, 0, 0.82699],
    "82": [0, 0.69141, 0, 0, 0.82807],
    "83": [0, 0.69141, 0, 0, 0.82861],
    "84": [0, 0.69141, 0, 0, 0.66899],
    "85": [0, 0.69141, 0, 0, 0.64576],
    "86": [0, 0.69141, 0, 0, 0.83131],
    "87": [0, 0.69141, 0, 0, 1.04602],
    "88": [0, 0.69141, 0, 0, 0.71922],
    "89": [0.18906, 0.69141, 0, 0, 0.83293],
    "90": [0.12604, 0.69141, 0, 0, 0.60201],
    "91": [0.24982, 0.74947, 0, 0, 0.27764],
    "93": [0.24982, 0.74947, 0, 0, 0.27764],
    "94": [0, 0.69141, 0, 0, 0.49965],
    "97": [0, 0.47534, 0, 0, 0.50046],
    "98": [0, 0.69141, 0, 0, 0.51315],
    "99": [0, 0.47534, 0, 0, 0.38946],
    "100": [0, 0.62119, 0, 0, 0.49857],
    "101": [0, 0.47534, 0, 0, 0.40053],
    "102": [0.18906, 0.69141, 0, 0, 0.32626],
    "103": [0.18906, 0.47534, 0, 0, 0.5037],
    "104": [0.18906, 0.69141, 0, 0, 0.52126],
    "105": [0, 0.69141, 0, 0, 0.27899],
    "106": [0, 0.69141, 0, 0, 0.28088],
    "107": [0, 0.69141, 0, 0, 0.38946],
    "108": [0, 0.69141, 0, 0, 0.27953],
    "109": [0, 0.47534, 0, 0, 0.76676],
    "110": [0, 0.47534, 0, 0, 0.52666],
    "111": [0, 0.47534, 0, 0, 0.48885],
    "112": [0.18906, 0.52396, 0, 0, 0.50046],
    "113": [0.18906, 0.47534, 0, 0, 0.48912],
    "114": [0, 0.47534, 0, 0, 0.38919],
    "115": [0, 0.47534, 0, 0, 0.44266],
    "116": [0, 0.62119, 0, 0, 0.33301],
    "117": [0, 0.47534, 0, 0, 0.5172],
    "118": [0, 0.52396, 0, 0, 0.5118],
    "119": [0, 0.52396, 0, 0, 0.77351],
    "120": [0.18906, 0.47534, 0, 0, 0.38865],
    "121": [0.18906, 0.47534, 0, 0, 0.49884],
    "122": [0.18906, 0.47534, 0, 0, 0.39054],
    "160": [0, 0, 0, 0, 0.25],
    "8216": [0, 0.69141, 0, 0, 0.21471],
    "8217": [0, 0.69141, 0, 0, 0.21471],
    "58112": [0, 0.62119, 0, 0, 0.49749],
    "58113": [0, 0.62119, 0, 0, 0.4983],
    "58114": [0.18906, 0.69141, 0, 0, 0.33328],
    "58115": [0.18906, 0.69141, 0, 0, 0.32923],
    "58116": [0.18906, 0.47534, 0, 0, 0.50343],
    "58117": [0, 0.69141, 0, 0, 0.33301],
    "58118": [0, 0.62119, 0, 0, 0.33409],
    "58119": [0, 0.47534, 0, 0, 0.50073]
  },
  "Main-Bold": {
    "32": [0, 0, 0, 0, 0.25],
    "33": [0, 0.69444, 0, 0, 0.35],
    "34": [0, 0.69444, 0, 0, 0.60278],
    "35": [0.19444, 0.69444, 0, 0, 0.95833],
    "36": [0.05556, 0.75, 0, 0, 0.575],
    "37": [0.05556, 0.75, 0, 0, 0.95833],
    "38": [0, 0.69444, 0, 0, 0.89444],
    "39": [0, 0.69444, 0, 0, 0.31944],
    "40": [0.25, 0.75, 0, 0, 0.44722],
    "41": [0.25, 0.75, 0, 0, 0.44722],
    "42": [0, 0.75, 0, 0, 0.575],
    "43": [0.13333, 0.63333, 0, 0, 0.89444],
    "44": [0.19444, 0.15556, 0, 0, 0.31944],
    "45": [0, 0.44444, 0, 0, 0.38333],
    "46": [0, 0.15556, 0, 0, 0.31944],
    "47": [0.25, 0.75, 0, 0, 0.575],
    "48": [0, 0.64444, 0, 0, 0.575],
    "49": [0, 0.64444, 0, 0, 0.575],
    "50": [0, 0.64444, 0, 0, 0.575],
    "51": [0, 0.64444, 0, 0, 0.575],
    "52": [0, 0.64444, 0, 0, 0.575],
    "53": [0, 0.64444, 0, 0, 0.575],
    "54": [0, 0.64444, 0, 0, 0.575],
    "55": [0, 0.64444, 0, 0, 0.575],
    "56": [0, 0.64444, 0, 0, 0.575],
    "57": [0, 0.64444, 0, 0, 0.575],
    "58": [0, 0.44444, 0, 0, 0.31944],
    "59": [0.19444, 0.44444, 0, 0, 0.31944],
    "60": [0.08556, 0.58556, 0, 0, 0.89444],
    "61": [-0.10889, 0.39111, 0, 0, 0.89444],
    "62": [0.08556, 0.58556, 0, 0, 0.89444],
    "63": [0, 0.69444, 0, 0, 0.54305],
    "64": [0, 0.69444, 0, 0, 0.89444],
    "65": [0, 0.68611, 0, 0, 0.86944],
    "66": [0, 0.68611, 0, 0, 0.81805],
    "67": [0, 0.68611, 0, 0, 0.83055],
    "68": [0, 0.68611, 0, 0, 0.88194],
    "69": [0, 0.68611, 0, 0, 0.75555],
    "70": [0, 0.68611, 0, 0, 0.72361],
    "71": [0, 0.68611, 0, 0, 0.90416],
    "72": [0, 0.68611, 0, 0, 0.9],
    "73": [0, 0.68611, 0, 0, 0.43611],
    "74": [0, 0.68611, 0, 0, 0.59444],
    "75": [0, 0.68611, 0, 0, 0.90138],
    "76": [0, 0.68611, 0, 0, 0.69166],
    "77": [0, 0.68611, 0, 0, 1.09166],
    "78": [0, 0.68611, 0, 0, 0.9],
    "79": [0, 0.68611, 0, 0, 0.86388],
    "80": [0, 0.68611, 0, 0, 0.78611],
    "81": [0.19444, 0.68611, 0, 0, 0.86388],
    "82": [0, 0.68611, 0, 0, 0.8625],
    "83": [0, 0.68611, 0, 0, 0.63889],
    "84": [0, 0.68611, 0, 0, 0.8],
    "85": [0, 0.68611, 0, 0, 0.88472],
    "86": [0, 0.68611, 0.01597, 0, 0.86944],
    "87": [0, 0.68611, 0.01597, 0, 1.18888],
    "88": [0, 0.68611, 0, 0, 0.86944],
    "89": [0, 0.68611, 0.02875, 0, 0.86944],
    "90": [0, 0.68611, 0, 0, 0.70277],
    "91": [0.25, 0.75, 0, 0, 0.31944],
    "92": [0.25, 0.75, 0, 0, 0.575],
    "93": [0.25, 0.75, 0, 0, 0.31944],
    "94": [0, 0.69444, 0, 0, 0.575],
    "95": [0.31, 0.13444, 0.03194, 0, 0.575],
    "97": [0, 0.44444, 0, 0, 0.55902],
    "98": [0, 0.69444, 0, 0, 0.63889],
    "99": [0, 0.44444, 0, 0, 0.51111],
    "100": [0, 0.69444, 0, 0, 0.63889],
    "101": [0, 0.44444, 0, 0, 0.52708],
    "102": [0, 0.69444, 0.10903, 0, 0.35139],
    "103": [0.19444, 0.44444, 0.01597, 0, 0.575],
    "104": [0, 0.69444, 0, 0, 0.63889],
    "105": [0, 0.69444, 0, 0, 0.31944],
    "106": [0.19444, 0.69444, 0, 0, 0.35139],
    "107": [0, 0.69444, 0, 0, 0.60694],
    "108": [0, 0.69444, 0, 0, 0.31944],
    "109": [0, 0.44444, 0, 0, 0.95833],
    "110": [0, 0.44444, 0, 0, 0.63889],
    "111": [0, 0.44444, 0, 0, 0.575],
    "112": [0.19444, 0.44444, 0, 0, 0.63889],
    "113": [0.19444, 0.44444, 0, 0, 0.60694],
    "114": [0, 0.44444, 0, 0, 0.47361],
    "115": [0, 0.44444, 0, 0, 0.45361],
    "116": [0, 0.63492, 0, 0, 0.44722],
    "117": [0, 0.44444, 0, 0, 0.63889],
    "118": [0, 0.44444, 0.01597, 0, 0.60694],
    "119": [0, 0.44444, 0.01597, 0, 0.83055],
    "120": [0, 0.44444, 0, 0, 0.60694],
    "121": [0.19444, 0.44444, 0.01597, 0, 0.60694],
    "122": [0, 0.44444, 0, 0, 0.51111],
    "123": [0.25, 0.75, 0, 0, 0.575],
    "124": [0.25, 0.75, 0, 0, 0.31944],
    "125": [0.25, 0.75, 0, 0, 0.575],
    "126": [0.35, 0.34444, 0, 0, 0.575],
    "160": [0, 0, 0, 0, 0.25],
    "163": [0, 0.69444, 0, 0, 0.86853],
    "168": [0, 0.69444, 0, 0, 0.575],
    "172": [0, 0.44444, 0, 0, 0.76666],
    "176": [0, 0.69444, 0, 0, 0.86944],
    "177": [0.13333, 0.63333, 0, 0, 0.89444],
    "184": [0.17014, 0, 0, 0, 0.51111],
    "198": [0, 0.68611, 0, 0, 1.04166],
    "215": [0.13333, 0.63333, 0, 0, 0.89444],
    "216": [0.04861, 0.73472, 0, 0, 0.89444],
    "223": [0, 0.69444, 0, 0, 0.59722],
    "230": [0, 0.44444, 0, 0, 0.83055],
    "247": [0.13333, 0.63333, 0, 0, 0.89444],
    "248": [0.09722, 0.54167, 0, 0, 0.575],
    "305": [0, 0.44444, 0, 0, 0.31944],
    "338": [0, 0.68611, 0, 0, 1.16944],
    "339": [0, 0.44444, 0, 0, 0.89444],
    "567": [0.19444, 0.44444, 0, 0, 0.35139],
    "710": [0, 0.69444, 0, 0, 0.575],
    "711": [0, 0.63194, 0, 0, 0.575],
    "713": [0, 0.59611, 0, 0, 0.575],
    "714": [0, 0.69444, 0, 0, 0.575],
    "715": [0, 0.69444, 0, 0, 0.575],
    "728": [0, 0.69444, 0, 0, 0.575],
    "729": [0, 0.69444, 0, 0, 0.31944],
    "730": [0, 0.69444, 0, 0, 0.86944],
    "732": [0, 0.69444, 0, 0, 0.575],
    "733": [0, 0.69444, 0, 0, 0.575],
    "915": [0, 0.68611, 0, 0, 0.69166],
    "916": [0, 0.68611, 0, 0, 0.95833],
    "920": [0, 0.68611, 0, 0, 0.89444],
    "923": [0, 0.68611, 0, 0, 0.80555],
    "926": [0, 0.68611, 0, 0, 0.76666],
    "928": [0, 0.68611, 0, 0, 0.9],
    "931": [0, 0.68611, 0, 0, 0.83055],
    "933": [0, 0.68611, 0, 0, 0.89444],
    "934": [0, 0.68611, 0, 0, 0.83055],
    "936": [0, 0.68611, 0, 0, 0.89444],
    "937": [0, 0.68611, 0, 0, 0.83055],
    "8211": [0, 0.44444, 0.03194, 0, 0.575],
    "8212": [0, 0.44444, 0.03194, 0, 1.14999],
    "8216": [0, 0.69444, 0, 0, 0.31944],
    "8217": [0, 0.69444, 0, 0, 0.31944],
    "8220": [0, 0.69444, 0, 0, 0.60278],
    "8221": [0, 0.69444, 0, 0, 0.60278],
    "8224": [0.19444, 0.69444, 0, 0, 0.51111],
    "8225": [0.19444, 0.69444, 0, 0, 0.51111],
    "8242": [0, 0.55556, 0, 0, 0.34444],
    "8407": [0, 0.72444, 0.15486, 0, 0.575],
    "8463": [0, 0.69444, 0, 0, 0.66759],
    "8465": [0, 0.69444, 0, 0, 0.83055],
    "8467": [0, 0.69444, 0, 0, 0.47361],
    "8472": [0.19444, 0.44444, 0, 0, 0.74027],
    "8476": [0, 0.69444, 0, 0, 0.83055],
    "8501": [0, 0.69444, 0, 0, 0.70277],
    "8592": [-0.10889, 0.39111, 0, 0, 1.14999],
    "8593": [0.19444, 0.69444, 0, 0, 0.575],
    "8594": [-0.10889, 0.39111, 0, 0, 1.14999],
    "8595": [0.19444, 0.69444, 0, 0, 0.575],
    "8596": [-0.10889, 0.39111, 0, 0, 1.14999],
    "8597": [0.25, 0.75, 0, 0, 0.575],
    "8598": [0.19444, 0.69444, 0, 0, 1.14999],
    "8599": [0.19444, 0.69444, 0, 0, 1.14999],
    "8600": [0.19444, 0.69444, 0, 0, 1.14999],
    "8601": [0.19444, 0.69444, 0, 0, 1.14999],
    "8636": [-0.10889, 0.39111, 0, 0, 1.14999],
    "8637": [-0.10889, 0.39111, 0, 0, 1.14999],
    "8640": [-0.10889, 0.39111, 0, 0, 1.14999],
    "8641": [-0.10889, 0.39111, 0, 0, 1.14999],
    "8656": [-0.10889, 0.39111, 0, 0, 1.14999],
    "8657": [0.19444, 0.69444, 0, 0, 0.70277],
    "8658": [-0.10889, 0.39111, 0, 0, 1.14999],
    "8659": [0.19444, 0.69444, 0, 0, 0.70277],
    "8660": [-0.10889, 0.39111, 0, 0, 1.14999],
    "8661": [0.25, 0.75, 0, 0, 0.70277],
    "8704": [0, 0.69444, 0, 0, 0.63889],
    "8706": [0, 0.69444, 0.06389, 0, 0.62847],
    "8707": [0, 0.69444, 0, 0, 0.63889],
    "8709": [0.05556, 0.75, 0, 0, 0.575],
    "8711": [0, 0.68611, 0, 0, 0.95833],
    "8712": [0.08556, 0.58556, 0, 0, 0.76666],
    "8715": [0.08556, 0.58556, 0, 0, 0.76666],
    "8722": [0.13333, 0.63333, 0, 0, 0.89444],
    "8723": [0.13333, 0.63333, 0, 0, 0.89444],
    "8725": [0.25, 0.75, 0, 0, 0.575],
    "8726": [0.25, 0.75, 0, 0, 0.575],
    "8727": [-0.02778, 0.47222, 0, 0, 0.575],
    "8728": [-0.02639, 0.47361, 0, 0, 0.575],
    "8729": [-0.02639, 0.47361, 0, 0, 0.575],
    "8730": [0.18, 0.82, 0, 0, 0.95833],
    "8733": [0, 0.44444, 0, 0, 0.89444],
    "8734": [0, 0.44444, 0, 0, 1.14999],
    "8736": [0, 0.69224, 0, 0, 0.72222],
    "8739": [0.25, 0.75, 0, 0, 0.31944],
    "8741": [0.25, 0.75, 0, 0, 0.575],
    "8743": [0, 0.55556, 0, 0, 0.76666],
    "8744": [0, 0.55556, 0, 0, 0.76666],
    "8745": [0, 0.55556, 0, 0, 0.76666],
    "8746": [0, 0.55556, 0, 0, 0.76666],
    "8747": [0.19444, 0.69444, 0.12778, 0, 0.56875],
    "8764": [-0.10889, 0.39111, 0, 0, 0.89444],
    "8768": [0.19444, 0.69444, 0, 0, 0.31944],
    "8771": [0.00222, 0.50222, 0, 0, 0.89444],
    "8773": [0.027, 0.638, 0, 0, 0.894],
    "8776": [0.02444, 0.52444, 0, 0, 0.89444],
    "8781": [0.00222, 0.50222, 0, 0, 0.89444],
    "8801": [0.00222, 0.50222, 0, 0, 0.89444],
    "8804": [0.19667, 0.69667, 0, 0, 0.89444],
    "8805": [0.19667, 0.69667, 0, 0, 0.89444],
    "8810": [0.08556, 0.58556, 0, 0, 1.14999],
    "8811": [0.08556, 0.58556, 0, 0, 1.14999],
    "8826": [0.08556, 0.58556, 0, 0, 0.89444],
    "8827": [0.08556, 0.58556, 0, 0, 0.89444],
    "8834": [0.08556, 0.58556, 0, 0, 0.89444],
    "8835": [0.08556, 0.58556, 0, 0, 0.89444],
    "8838": [0.19667, 0.69667, 0, 0, 0.89444],
    "8839": [0.19667, 0.69667, 0, 0, 0.89444],
    "8846": [0, 0.55556, 0, 0, 0.76666],
    "8849": [0.19667, 0.69667, 0, 0, 0.89444],
    "8850": [0.19667, 0.69667, 0, 0, 0.89444],
    "8851": [0, 0.55556, 0, 0, 0.76666],
    "8852": [0, 0.55556, 0, 0, 0.76666],
    "8853": [0.13333, 0.63333, 0, 0, 0.89444],
    "8854": [0.13333, 0.63333, 0, 0, 0.89444],
    "8855": [0.13333, 0.63333, 0, 0, 0.89444],
    "8856": [0.13333, 0.63333, 0, 0, 0.89444],
    "8857": [0.13333, 0.63333, 0, 0, 0.89444],
    "8866": [0, 0.69444, 0, 0, 0.70277],
    "8867": [0, 0.69444, 0, 0, 0.70277],
    "8868": [0, 0.69444, 0, 0, 0.89444],
    "8869": [0, 0.69444, 0, 0, 0.89444],
    "8900": [-0.02639, 0.47361, 0, 0, 0.575],
    "8901": [-0.02639, 0.47361, 0, 0, 0.31944],
    "8902": [-0.02778, 0.47222, 0, 0, 0.575],
    "8968": [0.25, 0.75, 0, 0, 0.51111],
    "8969": [0.25, 0.75, 0, 0, 0.51111],
    "8970": [0.25, 0.75, 0, 0, 0.51111],
    "8971": [0.25, 0.75, 0, 0, 0.51111],
    "8994": [-0.13889, 0.36111, 0, 0, 1.14999],
    "8995": [-0.13889, 0.36111, 0, 0, 1.14999],
    "9651": [0.19444, 0.69444, 0, 0, 1.02222],
    "9657": [-0.02778, 0.47222, 0, 0, 0.575],
    "9661": [0.19444, 0.69444, 0, 0, 1.02222],
    "9667": [-0.02778, 0.47222, 0, 0, 0.575],
    "9711": [0.19444, 0.69444, 0, 0, 1.14999],
    "9824": [0.12963, 0.69444, 0, 0, 0.89444],
    "9825": [0.12963, 0.69444, 0, 0, 0.89444],
    "9826": [0.12963, 0.69444, 0, 0, 0.89444],
    "9827": [0.12963, 0.69444, 0, 0, 0.89444],
    "9837": [0, 0.75, 0, 0, 0.44722],
    "9838": [0.19444, 0.69444, 0, 0, 0.44722],
    "9839": [0.19444, 0.69444, 0, 0, 0.44722],
    "10216": [0.25, 0.75, 0, 0, 0.44722],
    "10217": [0.25, 0.75, 0, 0, 0.44722],
    "10815": [0, 0.68611, 0, 0, 0.9],
    "10927": [0.19667, 0.69667, 0, 0, 0.89444],
    "10928": [0.19667, 0.69667, 0, 0, 0.89444],
    "57376": [0.19444, 0.69444, 0, 0, 0]
  },
  "Main-BoldItalic": {
    "32": [0, 0, 0, 0, 0.25],
    "33": [0, 0.69444, 0.11417, 0, 0.38611],
    "34": [0, 0.69444, 0.07939, 0, 0.62055],
    "35": [0.19444, 0.69444, 0.06833, 0, 0.94444],
    "37": [0.05556, 0.75, 0.12861, 0, 0.94444],
    "38": [0, 0.69444, 0.08528, 0, 0.88555],
    "39": [0, 0.69444, 0.12945, 0, 0.35555],
    "40": [0.25, 0.75, 0.15806, 0, 0.47333],
    "41": [0.25, 0.75, 0.03306, 0, 0.47333],
    "42": [0, 0.75, 0.14333, 0, 0.59111],
    "43": [0.10333, 0.60333, 0.03306, 0, 0.88555],
    "44": [0.19444, 0.14722, 0, 0, 0.35555],
    "45": [0, 0.44444, 0.02611, 0, 0.41444],
    "46": [0, 0.14722, 0, 0, 0.35555],
    "47": [0.25, 0.75, 0.15806, 0, 0.59111],
    "48": [0, 0.64444, 0.13167, 0, 0.59111],
    "49": [0, 0.64444, 0.13167, 0, 0.59111],
    "50": [0, 0.64444, 0.13167, 0, 0.59111],
    "51": [0, 0.64444, 0.13167, 0, 0.59111],
    "52": [0.19444, 0.64444, 0.13167, 0, 0.59111],
    "53": [0, 0.64444, 0.13167, 0, 0.59111],
    "54": [0, 0.64444, 0.13167, 0, 0.59111],
    "55": [0.19444, 0.64444, 0.13167, 0, 0.59111],
    "56": [0, 0.64444, 0.13167, 0, 0.59111],
    "57": [0, 0.64444, 0.13167, 0, 0.59111],
    "58": [0, 0.44444, 0.06695, 0, 0.35555],
    "59": [0.19444, 0.44444, 0.06695, 0, 0.35555],
    "61": [-0.10889, 0.39111, 0.06833, 0, 0.88555],
    "63": [0, 0.69444, 0.11472, 0, 0.59111],
    "64": [0, 0.69444, 0.09208, 0, 0.88555],
    "65": [0, 0.68611, 0, 0, 0.86555],
    "66": [0, 0.68611, 0.0992, 0, 0.81666],
    "67": [0, 0.68611, 0.14208, 0, 0.82666],
    "68": [0, 0.68611, 0.09062, 0, 0.87555],
    "69": [0, 0.68611, 0.11431, 0, 0.75666],
    "70": [0, 0.68611, 0.12903, 0, 0.72722],
    "71": [0, 0.68611, 0.07347, 0, 0.89527],
    "72": [0, 0.68611, 0.17208, 0, 0.8961],
    "73": [0, 0.68611, 0.15681, 0, 0.47166],
    "74": [0, 0.68611, 0.145, 0, 0.61055],
    "75": [0, 0.68611, 0.14208, 0, 0.89499],
    "76": [0, 0.68611, 0, 0, 0.69777],
    "77": [0, 0.68611, 0.17208, 0, 1.07277],
    "78": [0, 0.68611, 0.17208, 0, 0.8961],
    "79": [0, 0.68611, 0.09062, 0, 0.85499],
    "80": [0, 0.68611, 0.0992, 0, 0.78721],
    "81": [0.19444, 0.68611, 0.09062, 0, 0.85499],
    "82": [0, 0.68611, 0.02559, 0, 0.85944],
    "83": [0, 0.68611, 0.11264, 0, 0.64999],
    "84": [0, 0.68611, 0.12903, 0, 0.7961],
    "85": [0, 0.68611, 0.17208, 0, 0.88083],
    "86": [0, 0.68611, 0.18625, 0, 0.86555],
    "87": [0, 0.68611, 0.18625, 0, 1.15999],
    "88": [0, 0.68611, 0.15681, 0, 0.86555],
    "89": [0, 0.68611, 0.19803, 0, 0.86555],
    "90": [0, 0.68611, 0.14208, 0, 0.70888],
    "91": [0.25, 0.75, 0.1875, 0, 0.35611],
    "93": [0.25, 0.75, 0.09972, 0, 0.35611],
    "94": [0, 0.69444, 0.06709, 0, 0.59111],
    "95": [0.31, 0.13444, 0.09811, 0, 0.59111],
    "97": [0, 0.44444, 0.09426, 0, 0.59111],
    "98": [0, 0.69444, 0.07861, 0, 0.53222],
    "99": [0, 0.44444, 0.05222, 0, 0.53222],
    "100": [0, 0.69444, 0.10861, 0, 0.59111],
    "101": [0, 0.44444, 0.085, 0, 0.53222],
    "102": [0.19444, 0.69444, 0.21778, 0, 0.4],
    "103": [0.19444, 0.44444, 0.105, 0, 0.53222],
    "104": [0, 0.69444, 0.09426, 0, 0.59111],
    "105": [0, 0.69326, 0.11387, 0, 0.35555],
    "106": [0.19444, 0.69326, 0.1672, 0, 0.35555],
    "107": [0, 0.69444, 0.11111, 0, 0.53222],
    "108": [0, 0.69444, 0.10861, 0, 0.29666],
    "109": [0, 0.44444, 0.09426, 0, 0.94444],
    "110": [0, 0.44444, 0.09426, 0, 0.64999],
    "111": [0, 0.44444, 0.07861, 0, 0.59111],
    "112": [0.19444, 0.44444, 0.07861, 0, 0.59111],
    "113": [0.19444, 0.44444, 0.105, 0, 0.53222],
    "114": [0, 0.44444, 0.11111, 0, 0.50167],
    "115": [0, 0.44444, 0.08167, 0, 0.48694],
    "116": [0, 0.63492, 0.09639, 0, 0.385],
    "117": [0, 0.44444, 0.09426, 0, 0.62055],
    "118": [0, 0.44444, 0.11111, 0, 0.53222],
    "119": [0, 0.44444, 0.11111, 0, 0.76777],
    "120": [0, 0.44444, 0.12583, 0, 0.56055],
    "121": [0.19444, 0.44444, 0.105, 0, 0.56166],
    "122": [0, 0.44444, 0.13889, 0, 0.49055],
    "126": [0.35, 0.34444, 0.11472, 0, 0.59111],
    "160": [0, 0, 0, 0, 0.25],
    "168": [0, 0.69444, 0.11473, 0, 0.59111],
    "176": [0, 0.69444, 0, 0, 0.94888],
    "184": [0.17014, 0, 0, 0, 0.53222],
    "198": [0, 0.68611, 0.11431, 0, 1.02277],
    "216": [0.04861, 0.73472, 0.09062, 0, 0.88555],
    "223": [0.19444, 0.69444, 0.09736, 0, 0.665],
    "230": [0, 0.44444, 0.085, 0, 0.82666],
    "248": [0.09722, 0.54167, 0.09458, 0, 0.59111],
    "305": [0, 0.44444, 0.09426, 0, 0.35555],
    "338": [0, 0.68611, 0.11431, 0, 1.14054],
    "339": [0, 0.44444, 0.085, 0, 0.82666],
    "567": [0.19444, 0.44444, 0.04611, 0, 0.385],
    "710": [0, 0.69444, 0.06709, 0, 0.59111],
    "711": [0, 0.63194, 0.08271, 0, 0.59111],
    "713": [0, 0.59444, 0.10444, 0, 0.59111],
    "714": [0, 0.69444, 0.08528, 0, 0.59111],
    "715": [0, 0.69444, 0, 0, 0.59111],
    "728": [0, 0.69444, 0.10333, 0, 0.59111],
    "729": [0, 0.69444, 0.12945, 0, 0.35555],
    "730": [0, 0.69444, 0, 0, 0.94888],
    "732": [0, 0.69444, 0.11472, 0, 0.59111],
    "733": [0, 0.69444, 0.11472, 0, 0.59111],
    "915": [0, 0.68611, 0.12903, 0, 0.69777],
    "916": [0, 0.68611, 0, 0, 0.94444],
    "920": [0, 0.68611, 0.09062, 0, 0.88555],
    "923": [0, 0.68611, 0, 0, 0.80666],
    "926": [0, 0.68611, 0.15092, 0, 0.76777],
    "928": [0, 0.68611, 0.17208, 0, 0.8961],
    "931": [0, 0.68611, 0.11431, 0, 0.82666],
    "933": [0, 0.68611, 0.10778, 0, 0.88555],
    "934": [0, 0.68611, 0.05632, 0, 0.82666],
    "936": [0, 0.68611, 0.10778, 0, 0.88555],
    "937": [0, 0.68611, 0.0992, 0, 0.82666],
    "8211": [0, 0.44444, 0.09811, 0, 0.59111],
    "8212": [0, 0.44444, 0.09811, 0, 1.18221],
    "8216": [0, 0.69444, 0.12945, 0, 0.35555],
    "8217": [0, 0.69444, 0.12945, 0, 0.35555],
    "8220": [0, 0.69444, 0.16772, 0, 0.62055],
    "8221": [0, 0.69444, 0.07939, 0, 0.62055]
  },
  "Main-Italic": {
    "32": [0, 0, 0, 0, 0.25],
    "33": [0, 0.69444, 0.12417, 0, 0.30667],
    "34": [0, 0.69444, 0.06961, 0, 0.51444],
    "35": [0.19444, 0.69444, 0.06616, 0, 0.81777],
    "37": [0.05556, 0.75, 0.13639, 0, 0.81777],
    "38": [0, 0.69444, 0.09694, 0, 0.76666],
    "39": [0, 0.69444, 0.12417, 0, 0.30667],
    "40": [0.25, 0.75, 0.16194, 0, 0.40889],
    "41": [0.25, 0.75, 0.03694, 0, 0.40889],
    "42": [0, 0.75, 0.14917, 0, 0.51111],
    "43": [0.05667, 0.56167, 0.03694, 0, 0.76666],
    "44": [0.19444, 0.10556, 0, 0, 0.30667],
    "45": [0, 0.43056, 0.02826, 0, 0.35778],
    "46": [0, 0.10556, 0, 0, 0.30667],
    "47": [0.25, 0.75, 0.16194, 0, 0.51111],
    "48": [0, 0.64444, 0.13556, 0, 0.51111],
    "49": [0, 0.64444, 0.13556, 0, 0.51111],
    "50": [0, 0.64444, 0.13556, 0, 0.51111],
    "51": [0, 0.64444, 0.13556, 0, 0.51111],
    "52": [0.19444, 0.64444, 0.13556, 0, 0.51111],
    "53": [0, 0.64444, 0.13556, 0, 0.51111],
    "54": [0, 0.64444, 0.13556, 0, 0.51111],
    "55": [0.19444, 0.64444, 0.13556, 0, 0.51111],
    "56": [0, 0.64444, 0.13556, 0, 0.51111],
    "57": [0, 0.64444, 0.13556, 0, 0.51111],
    "58": [0, 0.43056, 0.0582, 0, 0.30667],
    "59": [0.19444, 0.43056, 0.0582, 0, 0.30667],
    "61": [-0.13313, 0.36687, 0.06616, 0, 0.76666],
    "63": [0, 0.69444, 0.1225, 0, 0.51111],
    "64": [0, 0.69444, 0.09597, 0, 0.76666],
    "65": [0, 0.68333, 0, 0, 0.74333],
    "66": [0, 0.68333, 0.10257, 0, 0.70389],
    "67": [0, 0.68333, 0.14528, 0, 0.71555],
    "68": [0, 0.68333, 0.09403, 0, 0.755],
    "69": [0, 0.68333, 0.12028, 0, 0.67833],
    "70": [0, 0.68333, 0.13305, 0, 0.65277],
    "71": [0, 0.68333, 0.08722, 0, 0.77361],
    "72": [0, 0.68333, 0.16389, 0, 0.74333],
    "73": [0, 0.68333, 0.15806, 0, 0.38555],
    "74": [0, 0.68333, 0.14028, 0, 0.525],
    "75": [0, 0.68333, 0.14528, 0, 0.76888],
    "76": [0, 0.68333, 0, 0, 0.62722],
    "77": [0, 0.68333, 0.16389, 0, 0.89666],
    "78": [0, 0.68333, 0.16389, 0, 0.74333],
    "79": [0, 0.68333, 0.09403, 0, 0.76666],
    "80": [0, 0.68333, 0.10257, 0, 0.67833],
    "81": [0.19444, 0.68333, 0.09403, 0, 0.76666],
    "82": [0, 0.68333, 0.03868, 0, 0.72944],
    "83": [0, 0.68333, 0.11972, 0, 0.56222],
    "84": [0, 0.68333, 0.13305, 0, 0.71555],
    "85": [0, 0.68333, 0.16389, 0, 0.74333],
    "86": [0, 0.68333, 0.18361, 0, 0.74333],
    "87": [0, 0.68333, 0.18361, 0, 0.99888],
    "88": [0, 0.68333, 0.15806, 0, 0.74333],
    "89": [0, 0.68333, 0.19383, 0, 0.74333],
    "90": [0, 0.68333, 0.14528, 0, 0.61333],
    "91": [0.25, 0.75, 0.1875, 0, 0.30667],
    "93": [0.25, 0.75, 0.10528, 0, 0.30667],
    "94": [0, 0.69444, 0.06646, 0, 0.51111],
    "95": [0.31, 0.12056, 0.09208, 0, 0.51111],
    "97": [0, 0.43056, 0.07671, 0, 0.51111],
    "98": [0, 0.69444, 0.06312, 0, 0.46],
    "99": [0, 0.43056, 0.05653, 0, 0.46],
    "100": [0, 0.69444, 0.10333, 0, 0.51111],
    "101": [0, 0.43056, 0.07514, 0, 0.46],
    "102": [0.19444, 0.69444, 0.21194, 0, 0.30667],
    "103": [0.19444, 0.43056, 0.08847, 0, 0.46],
    "104": [0, 0.69444, 0.07671, 0, 0.51111],
    "105": [0, 0.65536, 0.1019, 0, 0.30667],
    "106": [0.19444, 0.65536, 0.14467, 0, 0.30667],
    "107": [0, 0.69444, 0.10764, 0, 0.46],
    "108": [0, 0.69444, 0.10333, 0, 0.25555],
    "109": [0, 0.43056, 0.07671, 0, 0.81777],
    "110": [0, 0.43056, 0.07671, 0, 0.56222],
    "111": [0, 0.43056, 0.06312, 0, 0.51111],
    "112": [0.19444, 0.43056, 0.06312, 0, 0.51111],
    "113": [0.19444, 0.43056, 0.08847, 0, 0.46],
    "114": [0, 0.43056, 0.10764, 0, 0.42166],
    "115": [0, 0.43056, 0.08208, 0, 0.40889],
    "116": [0, 0.61508, 0.09486, 0, 0.33222],
    "117": [0, 0.43056, 0.07671, 0, 0.53666],
    "118": [0, 0.43056, 0.10764, 0, 0.46],
    "119": [0, 0.43056, 0.10764, 0, 0.66444],
    "120": [0, 0.43056, 0.12042, 0, 0.46389],
    "121": [0.19444, 0.43056, 0.08847, 0, 0.48555],
    "122": [0, 0.43056, 0.12292, 0, 0.40889],
    "126": [0.35, 0.31786, 0.11585, 0, 0.51111],
    "160": [0, 0, 0, 0, 0.25],
    "168": [0, 0.66786, 0.10474, 0, 0.51111],
    "176": [0, 0.69444, 0, 0, 0.83129],
    "184": [0.17014, 0, 0, 0, 0.46],
    "198": [0, 0.68333, 0.12028, 0, 0.88277],
    "216": [0.04861, 0.73194, 0.09403, 0, 0.76666],
    "223": [0.19444, 0.69444, 0.10514, 0, 0.53666],
    "230": [0, 0.43056, 0.07514, 0, 0.71555],
    "248": [0.09722, 0.52778, 0.09194, 0, 0.51111],
    "338": [0, 0.68333, 0.12028, 0, 0.98499],
    "339": [0, 0.43056, 0.07514, 0, 0.71555],
    "710": [0, 0.69444, 0.06646, 0, 0.51111],
    "711": [0, 0.62847, 0.08295, 0, 0.51111],
    "713": [0, 0.56167, 0.10333, 0, 0.51111],
    "714": [0, 0.69444, 0.09694, 0, 0.51111],
    "715": [0, 0.69444, 0, 0, 0.51111],
    "728": [0, 0.69444, 0.10806, 0, 0.51111],
    "729": [0, 0.66786, 0.11752, 0, 0.30667],
    "730": [0, 0.69444, 0, 0, 0.83129],
    "732": [0, 0.66786, 0.11585, 0, 0.51111],
    "733": [0, 0.69444, 0.1225, 0, 0.51111],
    "915": [0, 0.68333, 0.13305, 0, 0.62722],
    "916": [0, 0.68333, 0, 0, 0.81777],
    "920": [0, 0.68333, 0.09403, 0, 0.76666],
    "923": [0, 0.68333, 0, 0, 0.69222],
    "926": [0, 0.68333, 0.15294, 0, 0.66444],
    "928": [0, 0.68333, 0.16389, 0, 0.74333],
    "931": [0, 0.68333, 0.12028, 0, 0.71555],
    "933": [0, 0.68333, 0.11111, 0, 0.76666],
    "934": [0, 0.68333, 0.05986, 0, 0.71555],
    "936": [0, 0.68333, 0.11111, 0, 0.76666],
    "937": [0, 0.68333, 0.10257, 0, 0.71555],
    "8211": [0, 0.43056, 0.09208, 0, 0.51111],
    "8212": [0, 0.43056, 0.09208, 0, 1.02222],
    "8216": [0, 0.69444, 0.12417, 0, 0.30667],
    "8217": [0, 0.69444, 0.12417, 0, 0.30667],
    "8220": [0, 0.69444, 0.1685, 0, 0.51444],
    "8221": [0, 0.69444, 0.06961, 0, 0.51444],
    "8463": [0, 0.68889, 0, 0, 0.54028]
  },
  "Main-Regular": {
    "32": [0, 0, 0, 0, 0.25],
    "33": [0, 0.69444, 0, 0, 0.27778],
    "34": [0, 0.69444, 0, 0, 0.5],
    "35": [0.19444, 0.69444, 0, 0, 0.83334],
    "36": [0.05556, 0.75, 0, 0, 0.5],
    "37": [0.05556, 0.75, 0, 0, 0.83334],
    "38": [0, 0.69444, 0, 0, 0.77778],
    "39": [0, 0.69444, 0, 0, 0.27778],
    "40": [0.25, 0.75, 0, 0, 0.38889],
    "41": [0.25, 0.75, 0, 0, 0.38889],
    "42": [0, 0.75, 0, 0, 0.5],
    "43": [0.08333, 0.58333, 0, 0, 0.77778],
    "44": [0.19444, 0.10556, 0, 0, 0.27778],
    "45": [0, 0.43056, 0, 0, 0.33333],
    "46": [0, 0.10556, 0, 0, 0.27778],
    "47": [0.25, 0.75, 0, 0, 0.5],
    "48": [0, 0.64444, 0, 0, 0.5],
    "49": [0, 0.64444, 0, 0, 0.5],
    "50": [0, 0.64444, 0, 0, 0.5],
    "51": [0, 0.64444, 0, 0, 0.5],
    "52": [0, 0.64444, 0, 0, 0.5],
    "53": [0, 0.64444, 0, 0, 0.5],
    "54": [0, 0.64444, 0, 0, 0.5],
    "55": [0, 0.64444, 0, 0, 0.5],
    "56": [0, 0.64444, 0, 0, 0.5],
    "57": [0, 0.64444, 0, 0, 0.5],
    "58": [0, 0.43056, 0, 0, 0.27778],
    "59": [0.19444, 0.43056, 0, 0, 0.27778],
    "60": [0.0391, 0.5391, 0, 0, 0.77778],
    "61": [-0.13313, 0.36687, 0, 0, 0.77778],
    "62": [0.0391, 0.5391, 0, 0, 0.77778],
    "63": [0, 0.69444, 0, 0, 0.47222],
    "64": [0, 0.69444, 0, 0, 0.77778],
    "65": [0, 0.68333, 0, 0, 0.75],
    "66": [0, 0.68333, 0, 0, 0.70834],
    "67": [0, 0.68333, 0, 0, 0.72222],
    "68": [0, 0.68333, 0, 0, 0.76389],
    "69": [0, 0.68333, 0, 0, 0.68056],
    "70": [0, 0.68333, 0, 0, 0.65278],
    "71": [0, 0.68333, 0, 0, 0.78472],
    "72": [0, 0.68333, 0, 0, 0.75],
    "73": [0, 0.68333, 0, 0, 0.36111],
    "74": [0, 0.68333, 0, 0, 0.51389],
    "75": [0, 0.68333, 0, 0, 0.77778],
    "76": [0, 0.68333, 0, 0, 0.625],
    "77": [0, 0.68333, 0, 0, 0.91667],
    "78": [0, 0.68333, 0, 0, 0.75],
    "79": [0, 0.68333, 0, 0, 0.77778],
    "80": [0, 0.68333, 0, 0, 0.68056],
    "81": [0.19444, 0.68333, 0, 0, 0.77778],
    "82": [0, 0.68333, 0, 0, 0.73611],
    "83": [0, 0.68333, 0, 0, 0.55556],
    "84": [0, 0.68333, 0, 0, 0.72222],
    "85": [0, 0.68333, 0, 0, 0.75],
    "86": [0, 0.68333, 0.01389, 0, 0.75],
    "87": [0, 0.68333, 0.01389, 0, 1.02778],
    "88": [0, 0.68333, 0, 0, 0.75],
    "89": [0, 0.68333, 0.025, 0, 0.75],
    "90": [0, 0.68333, 0, 0, 0.61111],
    "91": [0.25, 0.75, 0, 0, 0.27778],
    "92": [0.25, 0.75, 0, 0, 0.5],
    "93": [0.25, 0.75, 0, 0, 0.27778],
    "94": [0, 0.69444, 0, 0, 0.5],
    "95": [0.31, 0.12056, 0.02778, 0, 0.5],
    "97": [0, 0.43056, 0, 0, 0.5],
    "98": [0, 0.69444, 0, 0, 0.55556],
    "99": [0, 0.43056, 0, 0, 0.44445],
    "100": [0, 0.69444, 0, 0, 0.55556],
    "101": [0, 0.43056, 0, 0, 0.44445],
    "102": [0, 0.69444, 0.07778, 0, 0.30556],
    "103": [0.19444, 0.43056, 0.01389, 0, 0.5],
    "104": [0, 0.69444, 0, 0, 0.55556],
    "105": [0, 0.66786, 0, 0, 0.27778],
    "106": [0.19444, 0.66786, 0, 0, 0.30556],
    "107": [0, 0.69444, 0, 0, 0.52778],
    "108": [0, 0.69444, 0, 0, 0.27778],
    "109": [0, 0.43056, 0, 0, 0.83334],
    "110": [0, 0.43056, 0, 0, 0.55556],
    "111": [0, 0.43056, 0, 0, 0.5],
    "112": [0.19444, 0.43056, 0, 0, 0.55556],
    "113": [0.19444, 0.43056, 0, 0, 0.52778],
    "114": [0, 0.43056, 0, 0, 0.39167],
    "115": [0, 0.43056, 0, 0, 0.39445],
    "116": [0, 0.61508, 0, 0, 0.38889],
    "117": [0, 0.43056, 0, 0, 0.55556],
    "118": [0, 0.43056, 0.01389, 0, 0.52778],
    "119": [0, 0.43056, 0.01389, 0, 0.72222],
    "120": [0, 0.43056, 0, 0, 0.52778],
    "121": [0.19444, 0.43056, 0.01389, 0, 0.52778],
    "122": [0, 0.43056, 0, 0, 0.44445],
    "123": [0.25, 0.75, 0, 0, 0.5],
    "124": [0.25, 0.75, 0, 0, 0.27778],
    "125": [0.25, 0.75, 0, 0, 0.5],
    "126": [0.35, 0.31786, 0, 0, 0.5],
    "160": [0, 0, 0, 0, 0.25],
    "163": [0, 0.69444, 0, 0, 0.76909],
    "167": [0.19444, 0.69444, 0, 0, 0.44445],
    "168": [0, 0.66786, 0, 0, 0.5],
    "172": [0, 0.43056, 0, 0, 0.66667],
    "176": [0, 0.69444, 0, 0, 0.75],
    "177": [0.08333, 0.58333, 0, 0, 0.77778],
    "182": [0.19444, 0.69444, 0, 0, 0.61111],
    "184": [0.17014, 0, 0, 0, 0.44445],
    "198": [0, 0.68333, 0, 0, 0.90278],
    "215": [0.08333, 0.58333, 0, 0, 0.77778],
    "216": [0.04861, 0.73194, 0, 0, 0.77778],
    "223": [0, 0.69444, 0, 0, 0.5],
    "230": [0, 0.43056, 0, 0, 0.72222],
    "247": [0.08333, 0.58333, 0, 0, 0.77778],
    "248": [0.09722, 0.52778, 0, 0, 0.5],
    "305": [0, 0.43056, 0, 0, 0.27778],
    "338": [0, 0.68333, 0, 0, 1.01389],
    "339": [0, 0.43056, 0, 0, 0.77778],
    "567": [0.19444, 0.43056, 0, 0, 0.30556],
    "710": [0, 0.69444, 0, 0, 0.5],
    "711": [0, 0.62847, 0, 0, 0.5],
    "713": [0, 0.56778, 0, 0, 0.5],
    "714": [0, 0.69444, 0, 0, 0.5],
    "715": [0, 0.69444, 0, 0, 0.5],
    "728": [0, 0.69444, 0, 0, 0.5],
    "729": [0, 0.66786, 0, 0, 0.27778],
    "730": [0, 0.69444, 0, 0, 0.75],
    "732": [0, 0.66786, 0, 0, 0.5],
    "733": [0, 0.69444, 0, 0, 0.5],
    "915": [0, 0.68333, 0, 0, 0.625],
    "916": [0, 0.68333, 0, 0, 0.83334],
    "920": [0, 0.68333, 0, 0, 0.77778],
    "923": [0, 0.68333, 0, 0, 0.69445],
    "926": [0, 0.68333, 0, 0, 0.66667],
    "928": [0, 0.68333, 0, 0, 0.75],
    "931": [0, 0.68333, 0, 0, 0.72222],
    "933": [0, 0.68333, 0, 0, 0.77778],
    "934": [0, 0.68333, 0, 0, 0.72222],
    "936": [0, 0.68333, 0, 0, 0.77778],
    "937": [0, 0.68333, 0, 0, 0.72222],
    "8211": [0, 0.43056, 0.02778, 0, 0.5],
    "8212": [0, 0.43056, 0.02778, 0, 1.0],
    "8216": [0, 0.69444, 0, 0, 0.27778],
    "8217": [0, 0.69444, 0, 0, 0.27778],
    "8220": [0, 0.69444, 0, 0, 0.5],
    "8221": [0, 0.69444, 0, 0, 0.5],
    "8224": [0.19444, 0.69444, 0, 0, 0.44445],
    "8225": [0.19444, 0.69444, 0, 0, 0.44445],
    "8230": [0, 0.123, 0, 0, 1.172],
    "8242": [0, 0.55556, 0, 0, 0.275],
    "8407": [0, 0.71444, 0.15382, 0, 0.5],
    "8463": [0, 0.68889, 0, 0, 0.54028],
    "8465": [0, 0.69444, 0, 0, 0.72222],
    "8467": [0, 0.69444, 0, 0.11111, 0.41667],
    "8472": [0.19444, 0.43056, 0, 0.11111, 0.63646],
    "8476": [0, 0.69444, 0, 0, 0.72222],
    "8501": [0, 0.69444, 0, 0, 0.61111],
    "8592": [-0.13313, 0.36687, 0, 0, 1.0],
    "8593": [0.19444, 0.69444, 0, 0, 0.5],
    "8594": [-0.13313, 0.36687, 0, 0, 1.0],
    "8595": [0.19444, 0.69444, 0, 0, 0.5],
    "8596": [-0.13313, 0.36687, 0, 0, 1.0],
    "8597": [0.25, 0.75, 0, 0, 0.5],
    "8598": [0.19444, 0.69444, 0, 0, 1.0],
    "8599": [0.19444, 0.69444, 0, 0, 1.0],
    "8600": [0.19444, 0.69444, 0, 0, 1.0],
    "8601": [0.19444, 0.69444, 0, 0, 1.0],
    "8614": [0.011, 0.511, 0, 0, 1.0],
    "8617": [0.011, 0.511, 0, 0, 1.126],
    "8618": [0.011, 0.511, 0, 0, 1.126],
    "8636": [-0.13313, 0.36687, 0, 0, 1.0],
    "8637": [-0.13313, 0.36687, 0, 0, 1.0],
    "8640": [-0.13313, 0.36687, 0, 0, 1.0],
    "8641": [-0.13313, 0.36687, 0, 0, 1.0],
    "8652": [0.011, 0.671, 0, 0, 1.0],
    "8656": [-0.13313, 0.36687, 0, 0, 1.0],
    "8657": [0.19444, 0.69444, 0, 0, 0.61111],
    "8658": [-0.13313, 0.36687, 0, 0, 1.0],
    "8659": [0.19444, 0.69444, 0, 0, 0.61111],
    "8660": [-0.13313, 0.36687, 0, 0, 1.0],
    "8661": [0.25, 0.75, 0, 0, 0.61111],
    "8704": [0, 0.69444, 0, 0, 0.55556],
    "8706": [0, 0.69444, 0.05556, 0.08334, 0.5309],
    "8707": [0, 0.69444, 0, 0, 0.55556],
    "8709": [0.05556, 0.75, 0, 0, 0.5],
    "8711": [0, 0.68333, 0, 0, 0.83334],
    "8712": [0.0391, 0.5391, 0, 0, 0.66667],
    "8715": [0.0391, 0.5391, 0, 0, 0.66667],
    "8722": [0.08333, 0.58333, 0, 0, 0.77778],
    "8723": [0.08333, 0.58333, 0, 0, 0.77778],
    "8725": [0.25, 0.75, 0, 0, 0.5],
    "8726": [0.25, 0.75, 0, 0, 0.5],
    "8727": [-0.03472, 0.46528, 0, 0, 0.5],
    "8728": [-0.05555, 0.44445, 0, 0, 0.5],
    "8729": [-0.05555, 0.44445, 0, 0, 0.5],
    "8730": [0.2, 0.8, 0, 0, 0.83334],
    "8733": [0, 0.43056, 0, 0, 0.77778],
    "8734": [0, 0.43056, 0, 0, 1.0],
    "8736": [0, 0.69224, 0, 0, 0.72222],
    "8739": [0.25, 0.75, 0, 0, 0.27778],
    "8741": [0.25, 0.75, 0, 0, 0.5],
    "8743": [0, 0.55556, 0, 0, 0.66667],
    "8744": [0, 0.55556, 0, 0, 0.66667],
    "8745": [0, 0.55556, 0, 0, 0.66667],
    "8746": [0, 0.55556, 0, 0, 0.66667],
    "8747": [0.19444, 0.69444, 0.11111, 0, 0.41667],
    "8764": [-0.13313, 0.36687, 0, 0, 0.77778],
    "8768": [0.19444, 0.69444, 0, 0, 0.27778],
    "8771": [-0.03625, 0.46375, 0, 0, 0.77778],
    "8773": [-0.022, 0.589, 0, 0, 0.778],
    "8776": [-0.01688, 0.48312, 0, 0, 0.77778],
    "8781": [-0.03625, 0.46375, 0, 0, 0.77778],
    "8784": [-0.133, 0.673, 0, 0, 0.778],
    "8801": [-0.03625, 0.46375, 0, 0, 0.77778],
    "8804": [0.13597, 0.63597, 0, 0, 0.77778],
    "8805": [0.13597, 0.63597, 0, 0, 0.77778],
    "8810": [0.0391, 0.5391, 0, 0, 1.0],
    "8811": [0.0391, 0.5391, 0, 0, 1.0],
    "8826": [0.0391, 0.5391, 0, 0, 0.77778],
    "8827": [0.0391, 0.5391, 0, 0, 0.77778],
    "8834": [0.0391, 0.5391, 0, 0, 0.77778],
    "8835": [0.0391, 0.5391, 0, 0, 0.77778],
    "8838": [0.13597, 0.63597, 0, 0, 0.77778],
    "8839": [0.13597, 0.63597, 0, 0, 0.77778],
    "8846": [0, 0.55556, 0, 0, 0.66667],
    "8849": [0.13597, 0.63597, 0, 0, 0.77778],
    "8850": [0.13597, 0.63597, 0, 0, 0.77778],
    "8851": [0, 0.55556, 0, 0, 0.66667],
    "8852": [0, 0.55556, 0, 0, 0.66667],
    "8853": [0.08333, 0.58333, 0, 0, 0.77778],
    "8854": [0.08333, 0.58333, 0, 0, 0.77778],
    "8855": [0.08333, 0.58333, 0, 0, 0.77778],
    "8856": [0.08333, 0.58333, 0, 0, 0.77778],
    "8857": [0.08333, 0.58333, 0, 0, 0.77778],
    "8866": [0, 0.69444, 0, 0, 0.61111],
    "8867": [0, 0.69444, 0, 0, 0.61111],
    "8868": [0, 0.69444, 0, 0, 0.77778],
    "8869": [0, 0.69444, 0, 0, 0.77778],
    "8872": [0.249, 0.75, 0, 0, 0.867],
    "8900": [-0.05555, 0.44445, 0, 0, 0.5],
    "8901": [-0.05555, 0.44445, 0, 0, 0.27778],
    "8902": [-0.03472, 0.46528, 0, 0, 0.5],
    "8904": [0.005, 0.505, 0, 0, 0.9],
    "8942": [0.03, 0.903, 0, 0, 0.278],
    "8943": [-0.19, 0.313, 0, 0, 1.172],
    "8945": [-0.1, 0.823, 0, 0, 1.282],
    "8968": [0.25, 0.75, 0, 0, 0.44445],
    "8969": [0.25, 0.75, 0, 0, 0.44445],
    "8970": [0.25, 0.75, 0, 0, 0.44445],
    "8971": [0.25, 0.75, 0, 0, 0.44445],
    "8994": [-0.14236, 0.35764, 0, 0, 1.0],
    "8995": [-0.14236, 0.35764, 0, 0, 1.0],
    "9136": [0.244, 0.744, 0, 0, 0.412],
    "9137": [0.244, 0.745, 0, 0, 0.412],
    "9651": [0.19444, 0.69444, 0, 0, 0.88889],
    "9657": [-0.03472, 0.46528, 0, 0, 0.5],
    "9661": [0.19444, 0.69444, 0, 0, 0.88889],
    "9667": [-0.03472, 0.46528, 0, 0, 0.5],
    "9711": [0.19444, 0.69444, 0, 0, 1.0],
    "9824": [0.12963, 0.69444, 0, 0, 0.77778],
    "9825": [0.12963, 0.69444, 0, 0, 0.77778],
    "9826": [0.12963, 0.69444, 0, 0, 0.77778],
    "9827": [0.12963, 0.69444, 0, 0, 0.77778],
    "9837": [0, 0.75, 0, 0, 0.38889],
    "9838": [0.19444, 0.69444, 0, 0, 0.38889],
    "9839": [0.19444, 0.69444, 0, 0, 0.38889],
    "10216": [0.25, 0.75, 0, 0, 0.38889],
    "10217": [0.25, 0.75, 0, 0, 0.38889],
    "10222": [0.244, 0.744, 0, 0, 0.412],
    "10223": [0.244, 0.745, 0, 0, 0.412],
    "10229": [0.011, 0.511, 0, 0, 1.609],
    "10230": [0.011, 0.511, 0, 0, 1.638],
    "10231": [0.011, 0.511, 0, 0, 1.859],
    "10232": [0.024, 0.525, 0, 0, 1.609],
    "10233": [0.024, 0.525, 0, 0, 1.638],
    "10234": [0.024, 0.525, 0, 0, 1.858],
    "10236": [0.011, 0.511, 0, 0, 1.638],
    "10815": [0, 0.68333, 0, 0, 0.75],
    "10927": [0.13597, 0.63597, 0, 0, 0.77778],
    "10928": [0.13597, 0.63597, 0, 0, 0.77778],
    "57376": [0.19444, 0.69444, 0, 0, 0]
  },
  "Math-BoldItalic": {
    "32": [0, 0, 0, 0, 0.25],
    "48": [0, 0.44444, 0, 0, 0.575],
    "49": [0, 0.44444, 0, 0, 0.575],
    "50": [0, 0.44444, 0, 0, 0.575],
    "51": [0.19444, 0.44444, 0, 0, 0.575],
    "52": [0.19444, 0.44444, 0, 0, 0.575],
    "53": [0.19444, 0.44444, 0, 0, 0.575],
    "54": [0, 0.64444, 0, 0, 0.575],
    "55": [0.19444, 0.44444, 0, 0, 0.575],
    "56": [0, 0.64444, 0, 0, 0.575],
    "57": [0.19444, 0.44444, 0, 0, 0.575],
    "65": [0, 0.68611, 0, 0, 0.86944],
    "66": [0, 0.68611, 0.04835, 0, 0.8664],
    "67": [0, 0.68611, 0.06979, 0, 0.81694],
    "68": [0, 0.68611, 0.03194, 0, 0.93812],
    "69": [0, 0.68611, 0.05451, 0, 0.81007],
    "70": [0, 0.68611, 0.15972, 0, 0.68889],
    "71": [0, 0.68611, 0, 0, 0.88673],
    "72": [0, 0.68611, 0.08229, 0, 0.98229],
    "73": [0, 0.68611, 0.07778, 0, 0.51111],
    "74": [0, 0.68611, 0.10069, 0, 0.63125],
    "75": [0, 0.68611, 0.06979, 0, 0.97118],
    "76": [0, 0.68611, 0, 0, 0.75555],
    "77": [0, 0.68611, 0.11424, 0, 1.14201],
    "78": [0, 0.68611, 0.11424, 0, 0.95034],
    "79": [0, 0.68611, 0.03194, 0, 0.83666],
    "80": [0, 0.68611, 0.15972, 0, 0.72309],
    "81": [0.19444, 0.68611, 0, 0, 0.86861],
    "82": [0, 0.68611, 0.00421, 0, 0.87235],
    "83": [0, 0.68611, 0.05382, 0, 0.69271],
    "84": [0, 0.68611, 0.15972, 0, 0.63663],
    "85": [0, 0.68611, 0.11424, 0, 0.80027],
    "86": [0, 0.68611, 0.25555, 0, 0.67778],
    "87": [0, 0.68611, 0.15972, 0, 1.09305],
    "88": [0, 0.68611, 0.07778, 0, 0.94722],
    "89": [0, 0.68611, 0.25555, 0, 0.67458],
    "90": [0, 0.68611, 0.06979, 0, 0.77257],
    "97": [0, 0.44444, 0, 0, 0.63287],
    "98": [0, 0.69444, 0, 0, 0.52083],
    "99": [0, 0.44444, 0, 0, 0.51342],
    "100": [0, 0.69444, 0, 0, 0.60972],
    "101": [0, 0.44444, 0, 0, 0.55361],
    "102": [0.19444, 0.69444, 0.11042, 0, 0.56806],
    "103": [0.19444, 0.44444, 0.03704, 0, 0.5449],
    "104": [0, 0.69444, 0, 0, 0.66759],
    "105": [0, 0.69326, 0, 0, 0.4048],
    "106": [0.19444, 0.69326, 0.0622, 0, 0.47083],
    "107": [0, 0.69444, 0.01852, 0, 0.6037],
    "108": [0, 0.69444, 0.0088, 0, 0.34815],
    "109": [0, 0.44444, 0, 0, 1.0324],
    "110": [0, 0.44444, 0, 0, 0.71296],
    "111": [0, 0.44444, 0, 0, 0.58472],
    "112": [0.19444, 0.44444, 0, 0, 0.60092],
    "113": [0.19444, 0.44444, 0.03704, 0, 0.54213],
    "114": [0, 0.44444, 0.03194, 0, 0.5287],
    "115": [0, 0.44444, 0, 0, 0.53125],
    "116": [0, 0.63492, 0, 0, 0.41528],
    "117": [0, 0.44444, 0, 0, 0.68102],
    "118": [0, 0.44444, 0.03704, 0, 0.56666],
    "119": [0, 0.44444, 0.02778, 0, 0.83148],
    "120": [0, 0.44444, 0, 0, 0.65903],
    "121": [0.19444, 0.44444, 0.03704, 0, 0.59028],
    "122": [0, 0.44444, 0.04213, 0, 0.55509],
    "160": [0, 0, 0, 0, 0.25],
    "915": [0, 0.68611, 0.15972, 0, 0.65694],
    "916": [0, 0.68611, 0, 0, 0.95833],
    "920": [0, 0.68611, 0.03194, 0, 0.86722],
    "923": [0, 0.68611, 0, 0, 0.80555],
    "926": [0, 0.68611, 0.07458, 0, 0.84125],
    "928": [0, 0.68611, 0.08229, 0, 0.98229],
    "931": [0, 0.68611, 0.05451, 0, 0.88507],
    "933": [0, 0.68611, 0.15972, 0, 0.67083],
    "934": [0, 0.68611, 0, 0, 0.76666],
    "936": [0, 0.68611, 0.11653, 0, 0.71402],
    "937": [0, 0.68611, 0.04835, 0, 0.8789],
    "945": [0, 0.44444, 0, 0, 0.76064],
    "946": [0.19444, 0.69444, 0.03403, 0, 0.65972],
    "947": [0.19444, 0.44444, 0.06389, 0, 0.59003],
    "948": [0, 0.69444, 0.03819, 0, 0.52222],
    "949": [0, 0.44444, 0, 0, 0.52882],
    "950": [0.19444, 0.69444, 0.06215, 0, 0.50833],
    "951": [0.19444, 0.44444, 0.03704, 0, 0.6],
    "952": [0, 0.69444, 0.03194, 0, 0.5618],
    "953": [0, 0.44444, 0, 0, 0.41204],
    "954": [0, 0.44444, 0, 0, 0.66759],
    "955": [0, 0.69444, 0, 0, 0.67083],
    "956": [0.19444, 0.44444, 0, 0, 0.70787],
    "957": [0, 0.44444, 0.06898, 0, 0.57685],
    "958": [0.19444, 0.69444, 0.03021, 0, 0.50833],
    "959": [0, 0.44444, 0, 0, 0.58472],
    "960": [0, 0.44444, 0.03704, 0, 0.68241],
    "961": [0.19444, 0.44444, 0, 0, 0.6118],
    "962": [0.09722, 0.44444, 0.07917, 0, 0.42361],
    "963": [0, 0.44444, 0.03704, 0, 0.68588],
    "964": [0, 0.44444, 0.13472, 0, 0.52083],
    "965": [0, 0.44444, 0.03704, 0, 0.63055],
    "966": [0.19444, 0.44444, 0, 0, 0.74722],
    "967": [0.19444, 0.44444, 0, 0, 0.71805],
    "968": [0.19444, 0.69444, 0.03704, 0, 0.75833],
    "969": [0, 0.44444, 0.03704, 0, 0.71782],
    "977": [0, 0.69444, 0, 0, 0.69155],
    "981": [0.19444, 0.69444, 0, 0, 0.7125],
    "982": [0, 0.44444, 0.03194, 0, 0.975],
    "1009": [0.19444, 0.44444, 0, 0, 0.6118],
    "1013": [0, 0.44444, 0, 0, 0.48333],
    "57649": [0, 0.44444, 0, 0, 0.39352],
    "57911": [0.19444, 0.44444, 0, 0, 0.43889]
  },
  "Math-Italic": {
    "32": [0, 0, 0, 0, 0.25],
    "48": [0, 0.43056, 0, 0, 0.5],
    "49": [0, 0.43056, 0, 0, 0.5],
    "50": [0, 0.43056, 0, 0, 0.5],
    "51": [0.19444, 0.43056, 0, 0, 0.5],
    "52": [0.19444, 0.43056, 0, 0, 0.5],
    "53": [0.19444, 0.43056, 0, 0, 0.5],
    "54": [0, 0.64444, 0, 0, 0.5],
    "55": [0.19444, 0.43056, 0, 0, 0.5],
    "56": [0, 0.64444, 0, 0, 0.5],
    "57": [0.19444, 0.43056, 0, 0, 0.5],
    "65": [0, 0.68333, 0, 0.13889, 0.75],
    "66": [0, 0.68333, 0.05017, 0.08334, 0.75851],
    "67": [0, 0.68333, 0.07153, 0.08334, 0.71472],
    "68": [0, 0.68333, 0.02778, 0.05556, 0.82792],
    "69": [0, 0.68333, 0.05764, 0.08334, 0.7382],
    "70": [0, 0.68333, 0.13889, 0.08334, 0.64306],
    "71": [0, 0.68333, 0, 0.08334, 0.78625],
    "72": [0, 0.68333, 0.08125, 0.05556, 0.83125],
    "73": [0, 0.68333, 0.07847, 0.11111, 0.43958],
    "74": [0, 0.68333, 0.09618, 0.16667, 0.55451],
    "75": [0, 0.68333, 0.07153, 0.05556, 0.84931],
    "76": [0, 0.68333, 0, 0.02778, 0.68056],
    "77": [0, 0.68333, 0.10903, 0.08334, 0.97014],
    "78": [0, 0.68333, 0.10903, 0.08334, 0.80347],
    "79": [0, 0.68333, 0.02778, 0.08334, 0.76278],
    "80": [0, 0.68333, 0.13889, 0.08334, 0.64201],
    "81": [0.19444, 0.68333, 0, 0.08334, 0.79056],
    "82": [0, 0.68333, 0.00773, 0.08334, 0.75929],
    "83": [0, 0.68333, 0.05764, 0.08334, 0.6132],
    "84": [0, 0.68333, 0.13889, 0.08334, 0.58438],
    "85": [0, 0.68333, 0.10903, 0.02778, 0.68278],
    "86": [0, 0.68333, 0.22222, 0, 0.58333],
    "87": [0, 0.68333, 0.13889, 0, 0.94445],
    "88": [0, 0.68333, 0.07847, 0.08334, 0.82847],
    "89": [0, 0.68333, 0.22222, 0, 0.58056],
    "90": [0, 0.68333, 0.07153, 0.08334, 0.68264],
    "97": [0, 0.43056, 0, 0, 0.52859],
    "98": [0, 0.69444, 0, 0, 0.42917],
    "99": [0, 0.43056, 0, 0.05556, 0.43276],
    "100": [0, 0.69444, 0, 0.16667, 0.52049],
    "101": [0, 0.43056, 0, 0.05556, 0.46563],
    "102": [0.19444, 0.69444, 0.10764, 0.16667, 0.48959],
    "103": [0.19444, 0.43056, 0.03588, 0.02778, 0.47697],
    "104": [0, 0.69444, 0, 0, 0.57616],
    "105": [0, 0.65952, 0, 0, 0.34451],
    "106": [0.19444, 0.65952, 0.05724, 0, 0.41181],
    "107": [0, 0.69444, 0.03148, 0, 0.5206],
    "108": [0, 0.69444, 0.01968, 0.08334, 0.29838],
    "109": [0, 0.43056, 0, 0, 0.87801],
    "110": [0, 0.43056, 0, 0, 0.60023],
    "111": [0, 0.43056, 0, 0.05556, 0.48472],
    "112": [0.19444, 0.43056, 0, 0.08334, 0.50313],
    "113": [0.19444, 0.43056, 0.03588, 0.08334, 0.44641],
    "114": [0, 0.43056, 0.02778, 0.05556, 0.45116],
    "115": [0, 0.43056, 0, 0.05556, 0.46875],
    "116": [0, 0.61508, 0, 0.08334, 0.36111],
    "117": [0, 0.43056, 0, 0.02778, 0.57246],
    "118": [0, 0.43056, 0.03588, 0.02778, 0.48472],
    "119": [0, 0.43056, 0.02691, 0.08334, 0.71592],
    "120": [0, 0.43056, 0, 0.02778, 0.57153],
    "121": [0.19444, 0.43056, 0.03588, 0.05556, 0.49028],
    "122": [0, 0.43056, 0.04398, 0.05556, 0.46505],
    "160": [0, 0, 0, 0, 0.25],
    "915": [0, 0.68333, 0.13889, 0.08334, 0.61528],
    "916": [0, 0.68333, 0, 0.16667, 0.83334],
    "920": [0, 0.68333, 0.02778, 0.08334, 0.76278],
    "923": [0, 0.68333, 0, 0.16667, 0.69445],
    "926": [0, 0.68333, 0.07569, 0.08334, 0.74236],
    "928": [0, 0.68333, 0.08125, 0.05556, 0.83125],
    "931": [0, 0.68333, 0.05764, 0.08334, 0.77986],
    "933": [0, 0.68333, 0.13889, 0.05556, 0.58333],
    "934": [0, 0.68333, 0, 0.08334, 0.66667],
    "936": [0, 0.68333, 0.11, 0.05556, 0.61222],
    "937": [0, 0.68333, 0.05017, 0.08334, 0.7724],
    "945": [0, 0.43056, 0.0037, 0.02778, 0.6397],
    "946": [0.19444, 0.69444, 0.05278, 0.08334, 0.56563],
    "947": [0.19444, 0.43056, 0.05556, 0, 0.51773],
    "948": [0, 0.69444, 0.03785, 0.05556, 0.44444],
    "949": [0, 0.43056, 0, 0.08334, 0.46632],
    "950": [0.19444, 0.69444, 0.07378, 0.08334, 0.4375],
    "951": [0.19444, 0.43056, 0.03588, 0.05556, 0.49653],
    "952": [0, 0.69444, 0.02778, 0.08334, 0.46944],
    "953": [0, 0.43056, 0, 0.05556, 0.35394],
    "954": [0, 0.43056, 0, 0, 0.57616],
    "955": [0, 0.69444, 0, 0, 0.58334],
    "956": [0.19444, 0.43056, 0, 0.02778, 0.60255],
    "957": [0, 0.43056, 0.06366, 0.02778, 0.49398],
    "958": [0.19444, 0.69444, 0.04601, 0.11111, 0.4375],
    "959": [0, 0.43056, 0, 0.05556, 0.48472],
    "960": [0, 0.43056, 0.03588, 0, 0.57003],
    "961": [0.19444, 0.43056, 0, 0.08334, 0.51702],
    "962": [0.09722, 0.43056, 0.07986, 0.08334, 0.36285],
    "963": [0, 0.43056, 0.03588, 0, 0.57141],
    "964": [0, 0.43056, 0.1132, 0.02778, 0.43715],
    "965": [0, 0.43056, 0.03588, 0.02778, 0.54028],
    "966": [0.19444, 0.43056, 0, 0.08334, 0.65417],
    "967": [0.19444, 0.43056, 0, 0.05556, 0.62569],
    "968": [0.19444, 0.69444, 0.03588, 0.11111, 0.65139],
    "969": [0, 0.43056, 0.03588, 0, 0.62245],
    "977": [0, 0.69444, 0, 0.08334, 0.59144],
    "981": [0.19444, 0.69444, 0, 0.08334, 0.59583],
    "982": [0, 0.43056, 0.02778, 0, 0.82813],
    "1009": [0.19444, 0.43056, 0, 0.08334, 0.51702],
    "1013": [0, 0.43056, 0, 0.05556, 0.4059],
    "57649": [0, 0.43056, 0, 0.02778, 0.32246],
    "57911": [0.19444, 0.43056, 0, 0.08334, 0.38403]
  },
  "SansSerif-Bold": {
    "32": [0, 0, 0, 0, 0.25],
    "33": [0, 0.69444, 0, 0, 0.36667],
    "34": [0, 0.69444, 0, 0, 0.55834],
    "35": [0.19444, 0.69444, 0, 0, 0.91667],
    "36": [0.05556, 0.75, 0, 0, 0.55],
    "37": [0.05556, 0.75, 0, 0, 1.02912],
    "38": [0, 0.69444, 0, 0, 0.83056],
    "39": [0, 0.69444, 0, 0, 0.30556],
    "40": [0.25, 0.75, 0, 0, 0.42778],
    "41": [0.25, 0.75, 0, 0, 0.42778],
    "42": [0, 0.75, 0, 0, 0.55],
    "43": [0.11667, 0.61667, 0, 0, 0.85556],
    "44": [0.10556, 0.13056, 0, 0, 0.30556],
    "45": [0, 0.45833, 0, 0, 0.36667],
    "46": [0, 0.13056, 0, 0, 0.30556],
    "47": [0.25, 0.75, 0, 0, 0.55],
    "48": [0, 0.69444, 0, 0, 0.55],
    "49": [0, 0.69444, 0, 0, 0.55],
    "50": [0, 0.69444, 0, 0, 0.55],
    "51": [0, 0.69444, 0, 0, 0.55],
    "52": [0, 0.69444, 0, 0, 0.55],
    "53": [0, 0.69444, 0, 0, 0.55],
    "54": [0, 0.69444, 0, 0, 0.55],
    "55": [0, 0.69444, 0, 0, 0.55],
    "56": [0, 0.69444, 0, 0, 0.55],
    "57": [0, 0.69444, 0, 0, 0.55],
    "58": [0, 0.45833, 0, 0, 0.30556],
    "59": [0.10556, 0.45833, 0, 0, 0.30556],
    "61": [-0.09375, 0.40625, 0, 0, 0.85556],
    "63": [0, 0.69444, 0, 0, 0.51945],
    "64": [0, 0.69444, 0, 0, 0.73334],
    "65": [0, 0.69444, 0, 0, 0.73334],
    "66": [0, 0.69444, 0, 0, 0.73334],
    "67": [0, 0.69444, 0, 0, 0.70278],
    "68": [0, 0.69444, 0, 0, 0.79445],
    "69": [0, 0.69444, 0, 0, 0.64167],
    "70": [0, 0.69444, 0, 0, 0.61111],
    "71": [0, 0.69444, 0, 0, 0.73334],
    "72": [0, 0.69444, 0, 0, 0.79445],
    "73": [0, 0.69444, 0, 0, 0.33056],
    "74": [0, 0.69444, 0, 0, 0.51945],
    "75": [0, 0.69444, 0, 0, 0.76389],
    "76": [0, 0.69444, 0, 0, 0.58056],
    "77": [0, 0.69444, 0, 0, 0.97778],
    "78": [0, 0.69444, 0, 0, 0.79445],
    "79": [0, 0.69444, 0, 0, 0.79445],
    "80": [0, 0.69444, 0, 0, 0.70278],
    "81": [0.10556, 0.69444, 0, 0, 0.79445],
    "82": [0, 0.69444, 0, 0, 0.70278],
    "83": [0, 0.69444, 0, 0, 0.61111],
    "84": [0, 0.69444, 0, 0, 0.73334],
    "85": [0, 0.69444, 0, 0, 0.76389],
    "86": [0, 0.69444, 0.01528, 0, 0.73334],
    "87": [0, 0.69444, 0.01528, 0, 1.03889],
    "88": [0, 0.69444, 0, 0, 0.73334],
    "89": [0, 0.69444, 0.0275, 0, 0.73334],
    "90": [0, 0.69444, 0, 0, 0.67223],
    "91": [0.25, 0.75, 0, 0, 0.34306],
    "93": [0.25, 0.75, 0, 0, 0.34306],
    "94": [0, 0.69444, 0, 0, 0.55],
    "95": [0.35, 0.10833, 0.03056, 0, 0.55],
    "97": [0, 0.45833, 0, 0, 0.525],
    "98": [0, 0.69444, 0, 0, 0.56111],
    "99": [0, 0.45833, 0, 0, 0.48889],
    "100": [0, 0.69444, 0, 0, 0.56111],
    "101": [0, 0.45833, 0, 0, 0.51111],
    "102": [0, 0.69444, 0.07639, 0, 0.33611],
    "103": [0.19444, 0.45833, 0.01528, 0, 0.55],
    "104": [0, 0.69444, 0, 0, 0.56111],
    "105": [0, 0.69444, 0, 0, 0.25556],
    "106": [0.19444, 0.69444, 0, 0, 0.28611],
    "107": [0, 0.69444, 0, 0, 0.53056],
    "108": [0, 0.69444, 0, 0, 0.25556],
    "109": [0, 0.45833, 0, 0, 0.86667],
    "110": [0, 0.45833, 0, 0, 0.56111],
    "111": [0, 0.45833, 0, 0, 0.55],
    "112": [0.19444, 0.45833, 0, 0, 0.56111],
    "113": [0.19444, 0.45833, 0, 0, 0.56111],
    "114": [0, 0.45833, 0.01528, 0, 0.37222],
    "115": [0, 0.45833, 0, 0, 0.42167],
    "116": [0, 0.58929, 0, 0, 0.40417],
    "117": [0, 0.45833, 0, 0, 0.56111],
    "118": [0, 0.45833, 0.01528, 0, 0.5],
    "119": [0, 0.45833, 0.01528, 0, 0.74445],
    "120": [0, 0.45833, 0, 0, 0.5],
    "121": [0.19444, 0.45833, 0.01528, 0, 0.5],
    "122": [0, 0.45833, 0, 0, 0.47639],
    "126": [0.35, 0.34444, 0, 0, 0.55],
    "160": [0, 0, 0, 0, 0.25],
    "168": [0, 0.69444, 0, 0, 0.55],
    "176": [0, 0.69444, 0, 0, 0.73334],
    "180": [0, 0.69444, 0, 0, 0.55],
    "184": [0.17014, 0, 0, 0, 0.48889],
    "305": [0, 0.45833, 0, 0, 0.25556],
    "567": [0.19444, 0.45833, 0, 0, 0.28611],
    "710": [0, 0.69444, 0, 0, 0.55],
    "711": [0, 0.63542, 0, 0, 0.55],
    "713   ": [0, 0.63778, 0, 0, 0.55],
    "728": [0, 0.69444, 0, 0, 0.55],
    "729": [0, 0.69444, 0, 0, 0.30556],
    "730": [0, 0.69444, 0, 0, 0.73334],
    "732": [0, 0.69444, 0, 0, 0.55],
    "733": [0, 0.69444, 0, 0, 0.55],
    "915": [0, 0.69444, 0, 0, 0.58056],
    "916": [0, 0.69444, 0, 0, 0.91667],
    "920": [0, 0.69444, 0, 0, 0.85556],
    "923": [0, 0.69444, 0, 0, 0.67223],
    "926": [0, 0.69444, 0, 0, 0.73334],
    "928": [0, 0.69444, 0, 0, 0.79445],
    "931": [0, 0.69444, 0, 0, 0.79445],
    "933": [0, 0.69444, 0, 0, 0.85556],
    "934": [0, 0.69444, 0, 0, 0.79445],
    "936": [0, 0.69444, 0, 0, 0.85556],
    "937": [0, 0.69444, 0, 0, 0.79445],
    "8211": [0, 0.45833, 0.03056, 0, 0.55],
    "8212": [0, 0.45833, 0.03056, 0, 1.10001],
    "8216": [0, 0.69444, 0, 0, 0.30556],
    "8217": [0, 0.69444, 0, 0, 0.30556],
    "8220": [0, 0.69444, 0, 0, 0.55834],
    "8221": [0, 0.69444, 0, 0, 0.55834]
  },
  "SansSerif-Italic": {
    "32": [0, 0, 0, 0, 0.25],
    "33": [0, 0.69444, 0.05733, 0, 0.31945],
    "34": [0, 0.69444, 0.00316, 0, 0.5],
    "35": [0.19444, 0.69444, 0.05087, 0, 0.83334],
    "36": [0.05556, 0.75, 0.11156, 0, 0.5],
    "37": [0.05556, 0.75, 0.03126, 0, 0.83334],
    "38": [0, 0.69444, 0.03058, 0, 0.75834],
    "39": [0, 0.69444, 0.07816, 0, 0.27778],
    "40": [0.25, 0.75, 0.13164, 0, 0.38889],
    "41": [0.25, 0.75, 0.02536, 0, 0.38889],
    "42": [0, 0.75, 0.11775, 0, 0.5],
    "43": [0.08333, 0.58333, 0.02536, 0, 0.77778],
    "44": [0.125, 0.08333, 0, 0, 0.27778],
    "45": [0, 0.44444, 0.01946, 0, 0.33333],
    "46": [0, 0.08333, 0, 0, 0.27778],
    "47": [0.25, 0.75, 0.13164, 0, 0.5],
    "48": [0, 0.65556, 0.11156, 0, 0.5],
    "49": [0, 0.65556, 0.11156, 0, 0.5],
    "50": [0, 0.65556, 0.11156, 0, 0.5],
    "51": [0, 0.65556, 0.11156, 0, 0.5],
    "52": [0, 0.65556, 0.11156, 0, 0.5],
    "53": [0, 0.65556, 0.11156, 0, 0.5],
    "54": [0, 0.65556, 0.11156, 0, 0.5],
    "55": [0, 0.65556, 0.11156, 0, 0.5],
    "56": [0, 0.65556, 0.11156, 0, 0.5],
    "57": [0, 0.65556, 0.11156, 0, 0.5],
    "58": [0, 0.44444, 0.02502, 0, 0.27778],
    "59": [0.125, 0.44444, 0.02502, 0, 0.27778],
    "61": [-0.13, 0.37, 0.05087, 0, 0.77778],
    "63": [0, 0.69444, 0.11809, 0, 0.47222],
    "64": [0, 0.69444, 0.07555, 0, 0.66667],
    "65": [0, 0.69444, 0, 0, 0.66667],
    "66": [0, 0.69444, 0.08293, 0, 0.66667],
    "67": [0, 0.69444, 0.11983, 0, 0.63889],
    "68": [0, 0.69444, 0.07555, 0, 0.72223],
    "69": [0, 0.69444, 0.11983, 0, 0.59722],
    "70": [0, 0.69444, 0.13372, 0, 0.56945],
    "71": [0, 0.69444, 0.11983, 0, 0.66667],
    "72": [0, 0.69444, 0.08094, 0, 0.70834],
    "73": [0, 0.69444, 0.13372, 0, 0.27778],
    "74": [0, 0.69444, 0.08094, 0, 0.47222],
    "75": [0, 0.69444, 0.11983, 0, 0.69445],
    "76": [0, 0.69444, 0, 0, 0.54167],
    "77": [0, 0.69444, 0.08094, 0, 0.875],
    "78": [0, 0.69444, 0.08094, 0, 0.70834],
    "79": [0, 0.69444, 0.07555, 0, 0.73611],
    "80": [0, 0.69444, 0.08293, 0, 0.63889],
    "81": [0.125, 0.69444, 0.07555, 0, 0.73611],
    "82": [0, 0.69444, 0.08293, 0, 0.64584],
    "83": [0, 0.69444, 0.09205, 0, 0.55556],
    "84": [0, 0.69444, 0.13372, 0, 0.68056],
    "85": [0, 0.69444, 0.08094, 0, 0.6875],
    "86": [0, 0.69444, 0.1615, 0, 0.66667],
    "87": [0, 0.69444, 0.1615, 0, 0.94445],
    "88": [0, 0.69444, 0.13372, 0, 0.66667],
    "89": [0, 0.69444, 0.17261, 0, 0.66667],
    "90": [0, 0.69444, 0.11983, 0, 0.61111],
    "91": [0.25, 0.75, 0.15942, 0, 0.28889],
    "93": [0.25, 0.75, 0.08719, 0, 0.28889],
    "94": [0, 0.69444, 0.0799, 0, 0.5],
    "95": [0.35, 0.09444, 0.08616, 0, 0.5],
    "97": [0, 0.44444, 0.00981, 0, 0.48056],
    "98": [0, 0.69444, 0.03057, 0, 0.51667],
    "99": [0, 0.44444, 0.08336, 0, 0.44445],
    "100": [0, 0.69444, 0.09483, 0, 0.51667],
    "101": [0, 0.44444, 0.06778, 0, 0.44445],
    "102": [0, 0.69444, 0.21705, 0, 0.30556],
    "103": [0.19444, 0.44444, 0.10836, 0, 0.5],
    "104": [0, 0.69444, 0.01778, 0, 0.51667],
    "105": [0, 0.67937, 0.09718, 0, 0.23889],
    "106": [0.19444, 0.67937, 0.09162, 0, 0.26667],
    "107": [0, 0.69444, 0.08336, 0, 0.48889],
    "108": [0, 0.69444, 0.09483, 0, 0.23889],
    "109": [0, 0.44444, 0.01778, 0, 0.79445],
    "110": [0, 0.44444, 0.01778, 0, 0.51667],
    "111": [0, 0.44444, 0.06613, 0, 0.5],
    "112": [0.19444, 0.44444, 0.0389, 0, 0.51667],
    "113": [0.19444, 0.44444, 0.04169, 0, 0.51667],
    "114": [0, 0.44444, 0.10836, 0, 0.34167],
    "115": [0, 0.44444, 0.0778, 0, 0.38333],
    "116": [0, 0.57143, 0.07225, 0, 0.36111],
    "117": [0, 0.44444, 0.04169, 0, 0.51667],
    "118": [0, 0.44444, 0.10836, 0, 0.46111],
    "119": [0, 0.44444, 0.10836, 0, 0.68334],
    "120": [0, 0.44444, 0.09169, 0, 0.46111],
    "121": [0.19444, 0.44444, 0.10836, 0, 0.46111],
    "122": [0, 0.44444, 0.08752, 0, 0.43472],
    "126": [0.35, 0.32659, 0.08826, 0, 0.5],
    "160": [0, 0, 0, 0, 0.25],
    "168": [0, 0.67937, 0.06385, 0, 0.5],
    "176": [0, 0.69444, 0, 0, 0.73752],
    "184": [0.17014, 0, 0, 0, 0.44445],
    "305": [0, 0.44444, 0.04169, 0, 0.23889],
    "567": [0.19444, 0.44444, 0.04169, 0, 0.26667],
    "710": [0, 0.69444, 0.0799, 0, 0.5],
    "711": [0, 0.63194, 0.08432, 0, 0.5],
    "713": [0, 0.60889, 0.08776, 0, 0.5],
    "714": [0, 0.69444, 0.09205, 0, 0.5],
    "715": [0, 0.69444, 0, 0, 0.5],
    "728": [0, 0.69444, 0.09483, 0, 0.5],
    "729": [0, 0.67937, 0.07774, 0, 0.27778],
    "730": [0, 0.69444, 0, 0, 0.73752],
    "732": [0, 0.67659, 0.08826, 0, 0.5],
    "733": [0, 0.69444, 0.09205, 0, 0.5],
    "915": [0, 0.69444, 0.13372, 0, 0.54167],
    "916": [0, 0.69444, 0, 0, 0.83334],
    "920": [0, 0.69444, 0.07555, 0, 0.77778],
    "923": [0, 0.69444, 0, 0, 0.61111],
    "926": [0, 0.69444, 0.12816, 0, 0.66667],
    "928": [0, 0.69444, 0.08094, 0, 0.70834],
    "931": [0, 0.69444, 0.11983, 0, 0.72222],
    "933": [0, 0.69444, 0.09031, 0, 0.77778],
    "934": [0, 0.69444, 0.04603, 0, 0.72222],
    "936": [0, 0.69444, 0.09031, 0, 0.77778],
    "937": [0, 0.69444, 0.08293, 0, 0.72222],
    "8211": [0, 0.44444, 0.08616, 0, 0.5],
    "8212": [0, 0.44444, 0.08616, 0, 1.0],
    "8216": [0, 0.69444, 0.07816, 0, 0.27778],
    "8217": [0, 0.69444, 0.07816, 0, 0.27778],
    "8220": [0, 0.69444, 0.14205, 0, 0.5],
    "8221": [0, 0.69444, 0.00316, 0, 0.5]
  },
  "SansSerif-Regular": {
    "32": [0, 0, 0, 0, 0.25],
    "33": [0, 0.69444, 0, 0, 0.31945],
    "34": [0, 0.69444, 0, 0, 0.5],
    "35": [0.19444, 0.69444, 0, 0, 0.83334],
    "36": [0.05556, 0.75, 0, 0, 0.5],
    "37": [0.05556, 0.75, 0, 0, 0.83334],
    "38": [0, 0.69444, 0, 0, 0.75834],
    "39": [0, 0.69444, 0, 0, 0.27778],
    "40": [0.25, 0.75, 0, 0, 0.38889],
    "41": [0.25, 0.75, 0, 0, 0.38889],
    "42": [0, 0.75, 0, 0, 0.5],
    "43": [0.08333, 0.58333, 0, 0, 0.77778],
    "44": [0.125, 0.08333, 0, 0, 0.27778],
    "45": [0, 0.44444, 0, 0, 0.33333],
    "46": [0, 0.08333, 0, 0, 0.27778],
    "47": [0.25, 0.75, 0, 0, 0.5],
    "48": [0, 0.65556, 0, 0, 0.5],
    "49": [0, 0.65556, 0, 0, 0.5],
    "50": [0, 0.65556, 0, 0, 0.5],
    "51": [0, 0.65556, 0, 0, 0.5],
    "52": [0, 0.65556, 0, 0, 0.5],
    "53": [0, 0.65556, 0, 0, 0.5],
    "54": [0, 0.65556, 0, 0, 0.5],
    "55": [0, 0.65556, 0, 0, 0.5],
    "56": [0, 0.65556, 0, 0, 0.5],
    "57": [0, 0.65556, 0, 0, 0.5],
    "58": [0, 0.44444, 0, 0, 0.27778],
    "59": [0.125, 0.44444, 0, 0, 0.27778],
    "61": [-0.13, 0.37, 0, 0, 0.77778],
    "63": [0, 0.69444, 0, 0, 0.47222],
    "64": [0, 0.69444, 0, 0, 0.66667],
    "65": [0, 0.69444, 0, 0, 0.66667],
    "66": [0, 0.69444, 0, 0, 0.66667],
    "67": [0, 0.69444, 0, 0, 0.63889],
    "68": [0, 0.69444, 0, 0, 0.72223],
    "69": [0, 0.69444, 0, 0, 0.59722],
    "70": [0, 0.69444, 0, 0, 0.56945],
    "71": [0, 0.69444, 0, 0, 0.66667],
    "72": [0, 0.69444, 0, 0, 0.70834],
    "73": [0, 0.69444, 0, 0, 0.27778],
    "74": [0, 0.69444, 0, 0, 0.47222],
    "75": [0, 0.69444, 0, 0, 0.69445],
    "76": [0, 0.69444, 0, 0, 0.54167],
    "77": [0, 0.69444, 0, 0, 0.875],
    "78": [0, 0.69444, 0, 0, 0.70834],
    "79": [0, 0.69444, 0, 0, 0.73611],
    "80": [0, 0.69444, 0, 0, 0.63889],
    "81": [0.125, 0.69444, 0, 0, 0.73611],
    "82": [0, 0.69444, 0, 0, 0.64584],
    "83": [0, 0.69444, 0, 0, 0.55556],
    "84": [0, 0.69444, 0, 0, 0.68056],
    "85": [0, 0.69444, 0, 0, 0.6875],
    "86": [0, 0.69444, 0.01389, 0, 0.66667],
    "87": [0, 0.69444, 0.01389, 0, 0.94445],
    "88": [0, 0.69444, 0, 0, 0.66667],
    "89": [0, 0.69444, 0.025, 0, 0.66667],
    "90": [0, 0.69444, 0, 0, 0.61111],
    "91": [0.25, 0.75, 0, 0, 0.28889],
    "93": [0.25, 0.75, 0, 0, 0.28889],
    "94": [0, 0.69444, 0, 0, 0.5],
    "95": [0.35, 0.09444, 0.02778, 0, 0.5],
    "97": [0, 0.44444, 0, 0, 0.48056],
    "98": [0, 0.69444, 0, 0, 0.51667],
    "99": [0, 0.44444, 0, 0, 0.44445],
    "100": [0, 0.69444, 0, 0, 0.51667],
    "101": [0, 0.44444, 0, 0, 0.44445],
    "102": [0, 0.69444, 0.06944, 0, 0.30556],
    "103": [0.19444, 0.44444, 0.01389, 0, 0.5],
    "104": [0, 0.69444, 0, 0, 0.51667],
    "105": [0, 0.67937, 0, 0, 0.23889],
    "106": [0.19444, 0.67937, 0, 0, 0.26667],
    "107": [0, 0.69444, 0, 0, 0.48889],
    "108": [0, 0.69444, 0, 0, 0.23889],
    "109": [0, 0.44444, 0, 0, 0.79445],
    "110": [0, 0.44444, 0, 0, 0.51667],
    "111": [0, 0.44444, 0, 0, 0.5],
    "112": [0.19444, 0.44444, 0, 0, 0.51667],
    "113": [0.19444, 0.44444, 0, 0, 0.51667],
    "114": [0, 0.44444, 0.01389, 0, 0.34167],
    "115": [0, 0.44444, 0, 0, 0.38333],
    "116": [0, 0.57143, 0, 0, 0.36111],
    "117": [0, 0.44444, 0, 0, 0.51667],
    "118": [0, 0.44444, 0.01389, 0, 0.46111],
    "119": [0, 0.44444, 0.01389, 0, 0.68334],
    "120": [0, 0.44444, 0, 0, 0.46111],
    "121": [0.19444, 0.44444, 0.01389, 0, 0.46111],
    "122": [0, 0.44444, 0, 0, 0.43472],
    "126": [0.35, 0.32659, 0, 0, 0.5],
    "160": [0, 0, 0, 0, 0.25],
    "168": [0, 0.67937, 0, 0, 0.5],
    "176": [0, 0.69444, 0, 0, 0.66667],
    "184": [0.17014, 0, 0, 0, 0.44445],
    "305": [0, 0.44444, 0, 0, 0.23889],
    "567": [0.19444, 0.44444, 0, 0, 0.26667],
    "710": [0, 0.69444, 0, 0, 0.5],
    "711": [0, 0.63194, 0, 0, 0.5],
    "713": [0, 0.60889, 0, 0, 0.5],
    "714": [0, 0.69444, 0, 0, 0.5],
    "715": [0, 0.69444, 0, 0, 0.5],
    "728": [0, 0.69444, 0, 0, 0.5],
    "729": [0, 0.67937, 0, 0, 0.27778],
    "730": [0, 0.69444, 0, 0, 0.66667],
    "732": [0, 0.67659, 0, 0, 0.5],
    "733": [0, 0.69444, 0, 0, 0.5],
    "915": [0, 0.69444, 0, 0, 0.54167],
    "916": [0, 0.69444, 0, 0, 0.83334],
    "920": [0, 0.69444, 0, 0, 0.77778],
    "923": [0, 0.69444, 0, 0, 0.61111],
    "926": [0, 0.69444, 0, 0, 0.66667],
    "928": [0, 0.69444, 0, 0, 0.70834],
    "931": [0, 0.69444, 0, 0, 0.72222],
    "933": [0, 0.69444, 0, 0, 0.77778],
    "934": [0, 0.69444, 0, 0, 0.72222],
    "936": [0, 0.69444, 0, 0, 0.77778],
    "937": [0, 0.69444, 0, 0, 0.72222],
    "8211": [0, 0.44444, 0.02778, 0, 0.5],
    "8212": [0, 0.44444, 0.02778, 0, 1.0],
    "8216": [0, 0.69444, 0, 0, 0.27778],
    "8217": [0, 0.69444, 0, 0, 0.27778],
    "8220": [0, 0.69444, 0, 0, 0.5],
    "8221": [0, 0.69444, 0, 0, 0.5]
  },
  "Script-Regular": {
    "32": [0, 0, 0, 0, 0.25],
    "65": [0, 0.7, 0.22925, 0, 0.80253],
    "66": [0, 0.7, 0.04087, 0, 0.90757],
    "67": [0, 0.7, 0.1689, 0, 0.66619],
    "68": [0, 0.7, 0.09371, 0, 0.77443],
    "69": [0, 0.7, 0.18583, 0, 0.56162],
    "70": [0, 0.7, 0.13634, 0, 0.89544],
    "71": [0, 0.7, 0.17322, 0, 0.60961],
    "72": [0, 0.7, 0.29694, 0, 0.96919],
    "73": [0, 0.7, 0.19189, 0, 0.80907],
    "74": [0.27778, 0.7, 0.19189, 0, 1.05159],
    "75": [0, 0.7, 0.31259, 0, 0.91364],
    "76": [0, 0.7, 0.19189, 0, 0.87373],
    "77": [0, 0.7, 0.15981, 0, 1.08031],
    "78": [0, 0.7, 0.3525, 0, 0.9015],
    "79": [0, 0.7, 0.08078, 0, 0.73787],
    "80": [0, 0.7, 0.08078, 0, 1.01262],
    "81": [0, 0.7, 0.03305, 0, 0.88282],
    "82": [0, 0.7, 0.06259, 0, 0.85],
    "83": [0, 0.7, 0.19189, 0, 0.86767],
    "84": [0, 0.7, 0.29087, 0, 0.74697],
    "85": [0, 0.7, 0.25815, 0, 0.79996],
    "86": [0, 0.7, 0.27523, 0, 0.62204],
    "87": [0, 0.7, 0.27523, 0, 0.80532],
    "88": [0, 0.7, 0.26006, 0, 0.94445],
    "89": [0, 0.7, 0.2939, 0, 0.70961],
    "90": [0, 0.7, 0.24037, 0, 0.8212],
    "160": [0, 0, 0, 0, 0.25]
  },
  "Size1-Regular": {
    "32": [0, 0, 0, 0, 0.25],
    "40": [0.35001, 0.85, 0, 0, 0.45834],
    "41": [0.35001, 0.85, 0, 0, 0.45834],
    "47": [0.35001, 0.85, 0, 0, 0.57778],
    "91": [0.35001, 0.85, 0, 0, 0.41667],
    "92": [0.35001, 0.85, 0, 0, 0.57778],
    "93": [0.35001, 0.85, 0, 0, 0.41667],
    "123": [0.35001, 0.85, 0, 0, 0.58334],
    "125": [0.35001, 0.85, 0, 0, 0.58334],
    "160": [0, 0, 0, 0, 0.25],
    "710": [0, 0.72222, 0, 0, 0.55556],
    "732": [0, 0.72222, 0, 0, 0.55556],
    "770": [0, 0.72222, 0, 0, 0.55556],
    "771": [0, 0.72222, 0, 0, 0.55556],
    "8214": [-0.00099, 0.601, 0, 0, 0.77778],
    "8593": [1e-05, 0.6, 0, 0, 0.66667],
    "8595": [1e-05, 0.6, 0, 0, 0.66667],
    "8657": [1e-05, 0.6, 0, 0, 0.77778],
    "8659": [1e-05, 0.6, 0, 0, 0.77778],
    "8719": [0.25001, 0.75, 0, 0, 0.94445],
    "8720": [0.25001, 0.75, 0, 0, 0.94445],
    "8721": [0.25001, 0.75, 0, 0, 1.05556],
    "8730": [0.35001, 0.85, 0, 0, 1.0],
    "8739": [-0.00599, 0.606, 0, 0, 0.33333],
    "8741": [-0.00599, 0.606, 0, 0, 0.55556],
    "8747": [0.30612, 0.805, 0.19445, 0, 0.47222],
    "8748": [0.306, 0.805, 0.19445, 0, 0.47222],
    "8749": [0.306, 0.805, 0.19445, 0, 0.47222],
    "8750": [0.30612, 0.805, 0.19445, 0, 0.47222],
    "8896": [0.25001, 0.75, 0, 0, 0.83334],
    "8897": [0.25001, 0.75, 0, 0, 0.83334],
    "8898": [0.25001, 0.75, 0, 0, 0.83334],
    "8899": [0.25001, 0.75, 0, 0, 0.83334],
    "8968": [0.35001, 0.85, 0, 0, 0.47222],
    "8969": [0.35001, 0.85, 0, 0, 0.47222],
    "8970": [0.35001, 0.85, 0, 0, 0.47222],
    "8971": [0.35001, 0.85, 0, 0, 0.47222],
    "9168": [-0.00099, 0.601, 0, 0, 0.66667],
    "10216": [0.35001, 0.85, 0, 0, 0.47222],
    "10217": [0.35001, 0.85, 0, 0, 0.47222],
    "10752": [0.25001, 0.75, 0, 0, 1.11111],
    "10753": [0.25001, 0.75, 0, 0, 1.11111],
    "10754": [0.25001, 0.75, 0, 0, 1.11111],
    "10756": [0.25001, 0.75, 0, 0, 0.83334],
    "10758": [0.25001, 0.75, 0, 0, 0.83334]
  },
  "Size2-Regular": {
    "32": [0, 0, 0, 0, 0.25],
    "40": [0.65002, 1.15, 0, 0, 0.59722],
    "41": [0.65002, 1.15, 0, 0, 0.59722],
    "47": [0.65002, 1.15, 0, 0, 0.81111],
    "91": [0.65002, 1.15, 0, 0, 0.47222],
    "92": [0.65002, 1.15, 0, 0, 0.81111],
    "93": [0.65002, 1.15, 0, 0, 0.47222],
    "123": [0.65002, 1.15, 0, 0, 0.66667],
    "125": [0.65002, 1.15, 0, 0, 0.66667],
    "160": [0, 0, 0, 0, 0.25],
    "710": [0, 0.75, 0, 0, 1.0],
    "732": [0, 0.75, 0, 0, 1.0],
    "770": [0, 0.75, 0, 0, 1.0],
    "771": [0, 0.75, 0, 0, 1.0],
    "8719": [0.55001, 1.05, 0, 0, 1.27778],
    "8720": [0.55001, 1.05, 0, 0, 1.27778],
    "8721": [0.55001, 1.05, 0, 0, 1.44445],
    "8730": [0.65002, 1.15, 0, 0, 1.0],
    "8747": [0.86225, 1.36, 0.44445, 0, 0.55556],
    "8748": [0.862, 1.36, 0.44445, 0, 0.55556],
    "8749": [0.862, 1.36, 0.44445, 0, 0.55556],
    "8750": [0.86225, 1.36, 0.44445, 0, 0.55556],
    "8896": [0.55001, 1.05, 0, 0, 1.11111],
    "8897": [0.55001, 1.05, 0, 0, 1.11111],
    "8898": [0.55001, 1.05, 0, 0, 1.11111],
    "8899": [0.55001, 1.05, 0, 0, 1.11111],
    "8968": [0.65002, 1.15, 0, 0, 0.52778],
    "8969": [0.65002, 1.15, 0, 0, 0.52778],
    "8970": [0.65002, 1.15, 0, 0, 0.52778],
    "8971": [0.65002, 1.15, 0, 0, 0.52778],
    "10216": [0.65002, 1.15, 0, 0, 0.61111],
    "10217": [0.65002, 1.15, 0, 0, 0.61111],
    "10752": [0.55001, 1.05, 0, 0, 1.51112],
    "10753": [0.55001, 1.05, 0, 0, 1.51112],
    "10754": [0.55001, 1.05, 0, 0, 1.51112],
    "10756": [0.55001, 1.05, 0, 0, 1.11111],
    "10758": [0.55001, 1.05, 0, 0, 1.11111]
  },
  "Size3-Regular": {
    "32": [0, 0, 0, 0, 0.25],
    "40": [0.95003, 1.45, 0, 0, 0.73611],
    "41": [0.95003, 1.45, 0, 0, 0.73611],
    "47": [0.95003, 1.45, 0, 0, 1.04445],
    "91": [0.95003, 1.45, 0, 0, 0.52778],
    "92": [0.95003, 1.45, 0, 0, 1.04445],
    "93": [0.95003, 1.45, 0, 0, 0.52778],
    "123": [0.95003, 1.45, 0, 0, 0.75],
    "125": [0.95003, 1.45, 0, 0, 0.75],
    "160": [0, 0, 0, 0, 0.25],
    "710": [0, 0.75, 0, 0, 1.44445],
    "732": [0, 0.75, 0, 0, 1.44445],
    "770": [0, 0.75, 0, 0, 1.44445],
    "771": [0, 0.75, 0, 0, 1.44445],
    "8730": [0.95003, 1.45, 0, 0, 1.0],
    "8968": [0.95003, 1.45, 0, 0, 0.58334],
    "8969": [0.95003, 1.45, 0, 0, 0.58334],
    "8970": [0.95003, 1.45, 0, 0, 0.58334],
    "8971": [0.95003, 1.45, 0, 0, 0.58334],
    "10216": [0.95003, 1.45, 0, 0, 0.75],
    "10217": [0.95003, 1.45, 0, 0, 0.75]
  },
  "Size4-Regular": {
    "32": [0, 0, 0, 0, 0.25],
    "40": [1.25003, 1.75, 0, 0, 0.79167],
    "41": [1.25003, 1.75, 0, 0, 0.79167],
    "47": [1.25003, 1.75, 0, 0, 1.27778],
    "91": [1.25003, 1.75, 0, 0, 0.58334],
    "92": [1.25003, 1.75, 0, 0, 1.27778],
    "93": [1.25003, 1.75, 0, 0, 0.58334],
    "123": [1.25003, 1.75, 0, 0, 0.80556],
    "125": [1.25003, 1.75, 0, 0, 0.80556],
    "160": [0, 0, 0, 0, 0.25],
    "710": [0, 0.825, 0, 0, 1.8889],
    "732": [0, 0.825, 0, 0, 1.8889],
    "770": [0, 0.825, 0, 0, 1.8889],
    "771": [0, 0.825, 0, 0, 1.8889],
    "8730": [1.25003, 1.75, 0, 0, 1.0],
    "8968": [1.25003, 1.75, 0, 0, 0.63889],
    "8969": [1.25003, 1.75, 0, 0, 0.63889],
    "8970": [1.25003, 1.75, 0, 0, 0.63889],
    "8971": [1.25003, 1.75, 0, 0, 0.63889],
    "9115": [0.64502, 1.155, 0, 0, 0.875],
    "9116": [1e-05, 0.6, 0, 0, 0.875],
    "9117": [0.64502, 1.155, 0, 0, 0.875],
    "9118": [0.64502, 1.155, 0, 0, 0.875],
    "9119": [1e-05, 0.6, 0, 0, 0.875],
    "9120": [0.64502, 1.155, 0, 0, 0.875],
    "9121": [0.64502, 1.155, 0, 0, 0.66667],
    "9122": [-0.00099, 0.601, 0, 0, 0.66667],
    "9123": [0.64502, 1.155, 0, 0, 0.66667],
    "9124": [0.64502, 1.155, 0, 0, 0.66667],
    "9125": [-0.00099, 0.601, 0, 0, 0.66667],
    "9126": [0.64502, 1.155, 0, 0, 0.66667],
    "9127": [1e-05, 0.9, 0, 0, 0.88889],
    "9128": [0.65002, 1.15, 0, 0, 0.88889],
    "9129": [0.90001, 0, 0, 0, 0.88889],
    "9130": [0, 0.3, 0, 0, 0.88889],
    "9131": [1e-05, 0.9, 0, 0, 0.88889],
    "9132": [0.65002, 1.15, 0, 0, 0.88889],
    "9133": [0.90001, 0, 0, 0, 0.88889],
    "9143": [0.88502, 0.915, 0, 0, 1.05556],
    "10216": [1.25003, 1.75, 0, 0, 0.80556],
    "10217": [1.25003, 1.75, 0, 0, 0.80556],
    "57344": [-0.00499, 0.605, 0, 0, 1.05556],
    "57345": [-0.00499, 0.605, 0, 0, 1.05556],
    "57680": [0, 0.12, 0, 0, 0.45],
    "57681": [0, 0.12, 0, 0, 0.45],
    "57682": [0, 0.12, 0, 0, 0.45],
    "57683": [0, 0.12, 0, 0, 0.45]
  },
  "Typewriter-Regular": {
    "32": [0, 0, 0, 0, 0.525],
    "33": [0, 0.61111, 0, 0, 0.525],
    "34": [0, 0.61111, 0, 0, 0.525],
    "35": [0, 0.61111, 0, 0, 0.525],
    "36": [0.08333, 0.69444, 0, 0, 0.525],
    "37": [0.08333, 0.69444, 0, 0, 0.525],
    "38": [0, 0.61111, 0, 0, 0.525],
    "39": [0, 0.61111, 0, 0, 0.525],
    "40": [0.08333, 0.69444, 0, 0, 0.525],
    "41": [0.08333, 0.69444, 0, 0, 0.525],
    "42": [0, 0.52083, 0, 0, 0.525],
    "43": [-0.08056, 0.53055, 0, 0, 0.525],
    "44": [0.13889, 0.125, 0, 0, 0.525],
    "45": [-0.08056, 0.53055, 0, 0, 0.525],
    "46": [0, 0.125, 0, 0, 0.525],
    "47": [0.08333, 0.69444, 0, 0, 0.525],
    "48": [0, 0.61111, 0, 0, 0.525],
    "49": [0, 0.61111, 0, 0, 0.525],
    "50": [0, 0.61111, 0, 0, 0.525],
    "51": [0, 0.61111, 0, 0, 0.525],
    "52": [0, 0.61111, 0, 0, 0.525],
    "53": [0, 0.61111, 0, 0, 0.525],
    "54": [0, 0.61111, 0, 0, 0.525],
    "55": [0, 0.61111, 0, 0, 0.525],
    "56": [0, 0.61111, 0, 0, 0.525],
    "57": [0, 0.61111, 0, 0, 0.525],
    "58": [0, 0.43056, 0, 0, 0.525],
    "59": [0.13889, 0.43056, 0, 0, 0.525],
    "60": [-0.05556, 0.55556, 0, 0, 0.525],
    "61": [-0.19549, 0.41562, 0, 0, 0.525],
    "62": [-0.05556, 0.55556, 0, 0, 0.525],
    "63": [0, 0.61111, 0, 0, 0.525],
    "64": [0, 0.61111, 0, 0, 0.525],
    "65": [0, 0.61111, 0, 0, 0.525],
    "66": [0, 0.61111, 0, 0, 0.525],
    "67": [0, 0.61111, 0, 0, 0.525],
    "68": [0, 0.61111, 0, 0, 0.525],
    "69": [0, 0.61111, 0, 0, 0.525],
    "70": [0, 0.61111, 0, 0, 0.525],
    "71": [0, 0.61111, 0, 0, 0.525],
    "72": [0, 0.61111, 0, 0, 0.525],
    "73": [0, 0.61111, 0, 0, 0.525],
    "74": [0, 0.61111, 0, 0, 0.525],
    "75": [0, 0.61111, 0, 0, 0.525],
    "76": [0, 0.61111, 0, 0, 0.525],
    "77": [0, 0.61111, 0, 0, 0.525],
    "78": [0, 0.61111, 0, 0, 0.525],
    "79": [0, 0.61111, 0, 0, 0.525],
    "80": [0, 0.61111, 0, 0, 0.525],
    "81": [0.13889, 0.61111, 0, 0, 0.525],
    "82": [0, 0.61111, 0, 0, 0.525],
    "83": [0, 0.61111, 0, 0, 0.525],
    "84": [0, 0.61111, 0, 0, 0.525],
    "85": [0, 0.61111, 0, 0, 0.525],
    "86": [0, 0.61111, 0, 0, 0.525],
    "87": [0, 0.61111, 0, 0, 0.525],
    "88": [0, 0.61111, 0, 0, 0.525],
    "89": [0, 0.61111, 0, 0, 0.525],
    "90": [0, 0.61111, 0, 0, 0.525],
    "91": [0.08333, 0.69444, 0, 0, 0.525],
    "92": [0.08333, 0.69444, 0, 0, 0.525],
    "93": [0.08333, 0.69444, 0, 0, 0.525],
    "94": [0, 0.61111, 0, 0, 0.525],
    "95": [0.09514, 0, 0, 0, 0.525],
    "96": [0, 0.61111, 0, 0, 0.525],
    "97": [0, 0.43056, 0, 0, 0.525],
    "98": [0, 0.61111, 0, 0, 0.525],
    "99": [0, 0.43056, 0, 0, 0.525],
    "100": [0, 0.61111, 0, 0, 0.525],
    "101": [0, 0.43056, 0, 0, 0.525],
    "102": [0, 0.61111, 0, 0, 0.525],
    "103": [0.22222, 0.43056, 0, 0, 0.525],
    "104": [0, 0.61111, 0, 0, 0.525],
    "105": [0, 0.61111, 0, 0, 0.525],
    "106": [0.22222, 0.61111, 0, 0, 0.525],
    "107": [0, 0.61111, 0, 0, 0.525],
    "108": [0, 0.61111, 0, 0, 0.525],
    "109": [0, 0.43056, 0, 0, 0.525],
    "110": [0, 0.43056, 0, 0, 0.525],
    "111": [0, 0.43056, 0, 0, 0.525],
    "112": [0.22222, 0.43056, 0, 0, 0.525],
    "113": [0.22222, 0.43056, 0, 0, 0.525],
    "114": [0, 0.43056, 0, 0, 0.525],
    "115": [0, 0.43056, 0, 0, 0.525],
    "116": [0, 0.55358, 0, 0, 0.525],
    "117": [0, 0.43056, 0, 0, 0.525],
    "118": [0, 0.43056, 0, 0, 0.525],
    "119": [0, 0.43056, 0, 0, 0.525],
    "120": [0, 0.43056, 0, 0, 0.525],
    "121": [0.22222, 0.43056, 0, 0, 0.525],
    "122": [0, 0.43056, 0, 0, 0.525],
    "123": [0.08333, 0.69444, 0, 0, 0.525],
    "124": [0.08333, 0.69444, 0, 0, 0.525],
    "125": [0.08333, 0.69444, 0, 0, 0.525],
    "126": [0, 0.61111, 0, 0, 0.525],
    "127": [0, 0.61111, 0, 0, 0.525],
    "160": [0, 0, 0, 0, 0.525],
    "176": [0, 0.61111, 0, 0, 0.525],
    "184": [0.19445, 0, 0, 0, 0.525],
    "305": [0, 0.43056, 0, 0, 0.525],
    "567": [0.22222, 0.43056, 0, 0, 0.525],
    "711": [0, 0.56597, 0, 0, 0.525],
    "713": [0, 0.56555, 0, 0, 0.525],
    "714": [0, 0.61111, 0, 0, 0.525],
    "715": [0, 0.61111, 0, 0, 0.525],
    "728": [0, 0.61111, 0, 0, 0.525],
    "730": [0, 0.61111, 0, 0, 0.525],
    "770": [0, 0.61111, 0, 0, 0.525],
    "771": [0, 0.61111, 0, 0, 0.525],
    "776": [0, 0.61111, 0, 0, 0.525],
    "915": [0, 0.61111, 0, 0, 0.525],
    "916": [0, 0.61111, 0, 0, 0.525],
    "920": [0, 0.61111, 0, 0, 0.525],
    "923": [0, 0.61111, 0, 0, 0.525],
    "926": [0, 0.61111, 0, 0, 0.525],
    "928": [0, 0.61111, 0, 0, 0.525],
    "931": [0, 0.61111, 0, 0, 0.525],
    "933": [0, 0.61111, 0, 0, 0.525],
    "934": [0, 0.61111, 0, 0, 0.525],
    "936": [0, 0.61111, 0, 0, 0.525],
    "937": [0, 0.61111, 0, 0, 0.525],
    "8216": [0, 0.61111, 0, 0, 0.525],
    "8217": [0, 0.61111, 0, 0, 0.525],
    "8242": [0, 0.61111, 0, 0, 0.525],
    "9251": [0.11111, 0.21944, 0, 0, 0.525]
  }
};

/**
 * This file contains metrics regarding fonts and individual symbols. The sigma
 * and xi variables, as well as the metricMap map contain data extracted from
 * TeX, TeX font metrics, and the TTF files. These data are then exposed via the
 * `metrics` variable and the getCharacterMetrics function.
 */
// In TeX, there are actually three sets of dimensions, one for each of
// textstyle (size index 5 and higher: >=9pt), scriptstyle (size index 3 and 4:
// 7-8pt), and scriptscriptstyle (size index 1 and 2: 5-6pt).  These are
// provided in the arrays below, in that order.
//
// The font metrics are stored in fonts cmsy10, cmsy7, and cmsy5 respectively.
// This was determined by running the following script:
//
//     latex -interaction=nonstopmode \
//     '\documentclass{article}\usepackage{amsmath}\begin{document}' \
//     '$a$ \expandafter\show\the\textfont2' \
//     '\expandafter\show\the\scriptfont2' \
//     '\expandafter\show\the\scriptscriptfont2' \
//     '\stop'
//
// The metrics themselves were retrieved using the following commands:
//
//     tftopl cmsy10
//     tftopl cmsy7
//     tftopl cmsy5
//
// The output of each of these commands is quite lengthy.  The only part we
// care about is the FONTDIMEN section. Each value is measured in EMs.
var sigmasAndXis = {
  slant: [0.250, 0.250, 0.250],
  // sigma1
  space: [0.000, 0.000, 0.000],
  // sigma2
  stretch: [0.000, 0.000, 0.000],
  // sigma3
  shrink: [0.000, 0.000, 0.000],
  // sigma4
  xHeight: [0.431, 0.431, 0.431],
  // sigma5
  quad: [1.000, 1.171, 1.472],
  // sigma6
  extraSpace: [0.000, 0.000, 0.000],
  // sigma7
  num1: [0.677, 0.732, 0.925],
  // sigma8
  num2: [0.394, 0.384, 0.387],
  // sigma9
  num3: [0.444, 0.471, 0.504],
  // sigma10
  denom1: [0.686, 0.752, 1.025],
  // sigma11
  denom2: [0.345, 0.344, 0.532],
  // sigma12
  sup1: [0.413, 0.503, 0.504],
  // sigma13
  sup2: [0.363, 0.431, 0.404],
  // sigma14
  sup3: [0.289, 0.286, 0.294],
  // sigma15
  sub1: [0.150, 0.143, 0.200],
  // sigma16
  sub2: [0.247, 0.286, 0.400],
  // sigma17
  supDrop: [0.386, 0.353, 0.494],
  // sigma18
  subDrop: [0.050, 0.071, 0.100],
  // sigma19
  delim1: [2.390, 1.700, 1.980],
  // sigma20
  delim2: [1.010, 1.157, 1.420],
  // sigma21
  axisHeight: [0.250, 0.250, 0.250],
  // sigma22
  // These font metrics are extracted from TeX by using tftopl on cmex10.tfm;
  // they correspond to the font parameters of the extension fonts (family 3).
  // See the TeXbook, page 441. In AMSTeX, the extension fonts scale; to
  // match cmex7, we'd use cmex7.tfm values for script and scriptscript
  // values.
  defaultRuleThickness: [0.04, 0.049, 0.049],
  // xi8; cmex7: 0.049
  bigOpSpacing1: [0.111, 0.111, 0.111],
  // xi9
  bigOpSpacing2: [0.166, 0.166, 0.166],
  // xi10
  bigOpSpacing3: [0.2, 0.2, 0.2],
  // xi11
  bigOpSpacing4: [0.6, 0.611, 0.611],
  // xi12; cmex7: 0.611
  bigOpSpacing5: [0.1, 0.143, 0.143],
  // xi13; cmex7: 0.143
  // The \sqrt rule width is taken from the height of the surd character.
  // Since we use the same font at all sizes, this thickness doesn't scale.
  sqrtRuleThickness: [0.04, 0.04, 0.04],
  // This value determines how large a pt is, for metrics which are defined
  // in terms of pts.
  // This value is also used in katex.scss; if you change it make sure the
  // values match.
  ptPerEm: [10.0, 10.0, 10.0],
  // The space between adjacent `|` columns in an array definition. From
  // `\showthe\doublerulesep` in LaTeX. Equals 2.0 / ptPerEm.
  doubleRuleSep: [0.2, 0.2, 0.2],
  // The width of separator lines in {array} environments. From
  // `\showthe\arrayrulewidth` in LaTeX. Equals 0.4 / ptPerEm.
  arrayRuleWidth: [0.04, 0.04, 0.04],
  // Two values from LaTeX source2e:
  fboxsep: [0.3, 0.3, 0.3],
  //        3 pt / ptPerEm
  fboxrule: [0.04, 0.04, 0.04] // 0.4 pt / ptPerEm
};
// These are very rough approximations.  We default to Times New Roman which
// should have Latin-1 and Cyrillic characters, but may not depending on the
// operating system.  The metrics do not account for extra height from the
// accents.  In the case of Cyrillic characters which have both ascenders and
// descenders we prefer approximations with ascenders, primarily to prevent
// the fraction bar or root line from intersecting the glyph.
// TODO(kevinb) allow union of multiple glyph metrics for better accuracy.
var extraCharacterMap = {
  // Latin-1
  'Å': 'A',
  'Ð': 'D',
  'Þ': 'o',
  'å': 'a',
  'ð': 'd',
  'þ': 'o',
  // Cyrillic
  'А': 'A',
  'Б': 'B',
  'В': 'B',
  'Г': 'F',
  'Д': 'A',
  'Е': 'E',
  'Ж': 'K',
  'З': '3',
  'И': 'N',
  'Й': 'N',
  'К': 'K',
  'Л': 'N',
  'М': 'M',
  'Н': 'H',
  'О': 'O',
  'П': 'N',
  'Р': 'P',
  'С': 'C',
  'Т': 'T',
  'У': 'y',
  'Ф': 'O',
  'Х': 'X',
  'Ц': 'U',
  'Ч': 'h',
  'Ш': 'W',
  'Щ': 'W',
  'Ъ': 'B',
  'Ы': 'X',
  'Ь': 'B',
  'Э': '3',
  'Ю': 'X',
  'Я': 'R',
  'а': 'a',
  'б': 'b',
  'в': 'a',
  'г': 'r',
  'д': 'y',
  'е': 'e',
  'ж': 'm',
  'з': 'e',
  'и': 'n',
  'й': 'n',
  'к': 'n',
  'л': 'n',
  'м': 'm',
  'н': 'n',
  'о': 'o',
  'п': 'n',
  'р': 'p',
  'с': 'c',
  'т': 'o',
  'у': 'y',
  'ф': 'b',
  'х': 'x',
  'ц': 'n',
  'ч': 'n',
  'ш': 'w',
  'щ': 'w',
  'ъ': 'a',
  'ы': 'm',
  'ь': 'a',
  'э': 'e',
  'ю': 'm',
  'я': 'r'
};
/**
 * This function adds new font metrics to default metricMap
 * It can also override existing metrics
 */
function setFontMetrics(fontName, metrics) {
  fontMetricsData[fontName] = metrics;
}
/**
 * This function is a convenience function for looking up information in the
 * metricMap table. It takes a character as a string, and a font.
 *
 * Note: the `width` property may be undefined if fontMetricsData.js wasn't
 * built using `Make extended_metrics`.
 */
function getCharacterMetrics(character, font, mode) {
  if (!fontMetricsData[font]) {
    throw new Error("Font metrics not found for font: " + font + ".");
  }
  var ch = character.charCodeAt(0);
  var metrics = fontMetricsData[font][ch];
  if (!metrics && character[0] in extraCharacterMap) {
    ch = extraCharacterMap[character[0]].charCodeAt(0);
    metrics = fontMetricsData[font][ch];
  }
  if (!metrics && mode === 'text') {
    // We don't typically have font metrics for Asian scripts.
    // But since we support them in text mode, we need to return
    // some sort of metrics.
    // So if the character is in a script we support but we
    // don't have metrics for it, just use the metrics for
    // the Latin capital letter M. This is close enough because
    // we (currently) only care about the height of the glyph
    // not its width.
    if (supportedCodepoint(ch)) {
      metrics = fontMetricsData[font][77]; // 77 is the charcode for 'M'
    }
  }
  if (metrics) {
    return {
      depth: metrics[0],
      height: metrics[1],
      italic: metrics[2],
      skew: metrics[3],
      width: metrics[4]
    };
  }
}
var fontMetricsBySizeIndex = {};
/**
 * Get the font metrics for a given size.
 */
function getGlobalMetrics(size) {
  var sizeIndex;
  if (size >= 5) {
    sizeIndex = 0;
  } else if (size >= 3) {
    sizeIndex = 1;
  } else {
    sizeIndex = 2;
  }
  if (!fontMetricsBySizeIndex[sizeIndex]) {
    var metrics = fontMetricsBySizeIndex[sizeIndex] = {
      cssEmPerMu: sigmasAndXis.quad[sizeIndex] / 18
    };
    for (var key in sigmasAndXis) {
      if (sigmasAndXis.hasOwnProperty(key)) {
        metrics[key] = sigmasAndXis[key][sizeIndex];
      }
    }
  }
  return fontMetricsBySizeIndex[sizeIndex];
}

/**
 * This file holds a list of all no-argument functions and single-character
 * symbols (like 'a' or ';').
 *
 * For each of the symbols, there are three properties they can have:
 * - font (required): the font to be used for this symbol. Either "main" (the
     normal font), or "ams" (the ams fonts).
 * - group (required): the ParseNode group type the symbol should have (i.e.
     "textord", "mathord", etc).
     See https://github.com/KaTeX/KaTeX/wiki/Examining-TeX#group-types
 * - replace: the character that this symbol or function should be
 *   replaced with (i.e. "\phi" has a replace value of "\u03d5", the phi
 *   character in the main font).
 *
 * The outermost map in the table indicates what mode the symbols should be
 * accepted in (e.g. "math" or "text").
 */
var symbols = {
  "math": {},
  "text": {}
};
/** `acceptUnicodeChar = true` is only applicable if `replace` is set. */
function defineSymbol(mode, font, group, replace, name, acceptUnicodeChar) {
  symbols[mode][name] = {
    font,
    group,
    replace
  };
  if (acceptUnicodeChar && replace) {
    symbols[mode][replace] = symbols[mode][name];
  }
}
// Some abbreviations for commonly used strings.
// This helps minify the code, and also spotting typos using jshint.
// modes:
var math = "math";
var text = "text";
// fonts:
var main = "main";
var ams = "ams";
// groups:
var accent = "accent-token";
var bin = "bin";
var close = "close";
var inner = "inner";
var mathord = "mathord";
var op = "op-token";
var open = "open";
var punct = "punct";
var rel = "rel";
var spacing = "spacing";
var textord = "textord";
// Now comes the symbol table
// Relation Symbols
defineSymbol(math, main, rel, "\u2261", "\\equiv", true);
defineSymbol(math, main, rel, "\u227a", "\\prec", true);
defineSymbol(math, main, rel, "\u227b", "\\succ", true);
defineSymbol(math, main, rel, "\u223c", "\\sim", true);
defineSymbol(math, main, rel, "\u22a5", "\\perp");
defineSymbol(math, main, rel, "\u2aaf", "\\preceq", true);
defineSymbol(math, main, rel, "\u2ab0", "\\succeq", true);
defineSymbol(math, main, rel, "\u2243", "\\simeq", true);
defineSymbol(math, main, rel, "\u2223", "\\mid", true);
defineSymbol(math, main, rel, "\u226a", "\\ll", true);
defineSymbol(math, main, rel, "\u226b", "\\gg", true);
defineSymbol(math, main, rel, "\u224d", "\\asymp", true);
defineSymbol(math, main, rel, "\u2225", "\\parallel");
defineSymbol(math, main, rel, "\u22c8", "\\bowtie", true);
defineSymbol(math, main, rel, "\u2323", "\\smile", true);
defineSymbol(math, main, rel, "\u2291", "\\sqsubseteq", true);
defineSymbol(math, main, rel, "\u2292", "\\sqsupseteq", true);
defineSymbol(math, main, rel, "\u2250", "\\doteq", true);
defineSymbol(math, main, rel, "\u2322", "\\frown", true);
defineSymbol(math, main, rel, "\u220b", "\\ni", true);
defineSymbol(math, main, rel, "\u221d", "\\propto", true);
defineSymbol(math, main, rel, "\u22a2", "\\vdash", true);
defineSymbol(math, main, rel, "\u22a3", "\\dashv", true);
defineSymbol(math, main, rel, "\u220b", "\\owns");
// Punctuation
defineSymbol(math, main, punct, "\u002e", "\\ldotp");
defineSymbol(math, main, punct, "\u22c5", "\\cdotp");
// The KaTeX fonts do not contain U+00B7. Use the centered dot glyph at U+22C5
// in both modes, but keep math-mode punctuation spacing only in math mode.
defineSymbol(math, main, punct, "\u22c5", "\u00b7");
defineSymbol(text, main, textord, "\u22c5", "\u00b7");
// Misc Symbols
defineSymbol(math, main, textord, "\u0023", "\\#");
defineSymbol(text, main, textord, "\u0023", "\\#");
defineSymbol(math, main, textord, "\u0026", "\\&");
defineSymbol(text, main, textord, "\u0026", "\\&");
defineSymbol(math, main, textord, "\u2135", "\\aleph", true);
defineSymbol(math, main, textord, "\u2200", "\\forall", true);
defineSymbol(math, main, textord, "\u210f", "\\hbar", true);
defineSymbol(math, main, textord, "\u2203", "\\exists", true);
defineSymbol(math, main, textord, "\u2207", "\\nabla", true);
defineSymbol(math, main, textord, "\u266d", "\\flat", true);
defineSymbol(math, main, textord, "\u2113", "\\ell", true);
defineSymbol(math, main, textord, "\u266e", "\\natural", true);
defineSymbol(math, main, textord, "\u2663", "\\clubsuit", true);
defineSymbol(math, main, textord, "\u2118", "\\wp", true);
defineSymbol(math, main, textord, "\u266f", "\\sharp", true);
defineSymbol(math, main, textord, "\u2662", "\\diamondsuit", true);
defineSymbol(math, main, textord, "\u211c", "\\Re", true);
defineSymbol(math, main, textord, "\u2661", "\\heartsuit", true);
defineSymbol(math, main, textord, "\u2111", "\\Im", true);
defineSymbol(math, main, textord, "\u2660", "\\spadesuit", true);
defineSymbol(math, main, textord, "\u00a7", "\\S", true);
defineSymbol(text, main, textord, "\u00a7", "\\S");
defineSymbol(math, main, textord, "\u00b6", "\\P", true);
defineSymbol(text, main, textord, "\u00b6", "\\P");
// Math and Text
defineSymbol(math, main, textord, "\u2020", "\\dag");
defineSymbol(text, main, textord, "\u2020", "\\dag");
defineSymbol(text, main, textord, "\u2020", "\\textdagger");
defineSymbol(math, main, textord, "\u2021", "\\ddag");
defineSymbol(text, main, textord, "\u2021", "\\ddag");
defineSymbol(text, main, textord, "\u2021", "\\textdaggerdbl");
// Large Delimiters
defineSymbol(math, main, close, "\u23b1", "\\rmoustache", true);
defineSymbol(math, main, open, "\u23b0", "\\lmoustache", true);
defineSymbol(math, main, close, "\u27ef", "\\rgroup", true);
defineSymbol(math, main, open, "\u27ee", "\\lgroup", true);
// Binary Operators
defineSymbol(math, main, bin, "\u2213", "\\mp", true);
defineSymbol(math, main, bin, "\u2296", "\\ominus", true);
defineSymbol(math, main, bin, "\u228e", "\\uplus", true);
defineSymbol(math, main, bin, "\u2293", "\\sqcap", true);
defineSymbol(math, main, bin, "\u2217", "\\ast");
defineSymbol(math, main, bin, "\u2294", "\\sqcup", true);
defineSymbol(math, main, bin, "\u25ef", "\\bigcirc", true);
defineSymbol(math, main, bin, "\u2219", "\\bullet", true);
defineSymbol(math, main, bin, "\u2021", "\\ddagger");
defineSymbol(math, main, bin, "\u2240", "\\wr", true);
defineSymbol(math, main, bin, "\u2a3f", "\\amalg");
defineSymbol(math, main, bin, "\u0026", "\\And"); // from amsmath
// Arrow Symbols
defineSymbol(math, main, rel, "\u27f5", "\\longleftarrow", true);
defineSymbol(math, main, rel, "\u21d0", "\\Leftarrow", true);
defineSymbol(math, main, rel, "\u27f8", "\\Longleftarrow", true);
defineSymbol(math, main, rel, "\u27f6", "\\longrightarrow", true);
defineSymbol(math, main, rel, "\u21d2", "\\Rightarrow", true);
defineSymbol(math, main, rel, "\u27f9", "\\Longrightarrow", true);
defineSymbol(math, main, rel, "\u2194", "\\leftrightarrow", true);
defineSymbol(math, main, rel, "\u27f7", "\\longleftrightarrow", true);
defineSymbol(math, main, rel, "\u21d4", "\\Leftrightarrow", true);
defineSymbol(math, main, rel, "\u27fa", "\\Longleftrightarrow", true);
defineSymbol(math, main, rel, "\u21a6", "\\mapsto", true);
defineSymbol(math, main, rel, "\u27fc", "\\longmapsto", true);
defineSymbol(math, main, rel, "\u2197", "\\nearrow", true);
defineSymbol(math, main, rel, "\u21a9", "\\hookleftarrow", true);
defineSymbol(math, main, rel, "\u21aa", "\\hookrightarrow", true);
defineSymbol(math, main, rel, "\u2198", "\\searrow", true);
defineSymbol(math, main, rel, "\u21bc", "\\leftharpoonup", true);
defineSymbol(math, main, rel, "\u21c0", "\\rightharpoonup", true);
defineSymbol(math, main, rel, "\u2199", "\\swarrow", true);
defineSymbol(math, main, rel, "\u21bd", "\\leftharpoondown", true);
defineSymbol(math, main, rel, "\u21c1", "\\rightharpoondown", true);
defineSymbol(math, main, rel, "\u2196", "\\nwarrow", true);
defineSymbol(math, main, rel, "\u21cc", "\\rightleftharpoons", true);
// AMS Negated Binary Relations
defineSymbol(math, ams, rel, "\u226e", "\\nless", true);
// Symbol names preceded by "@" each have a corresponding macro.
defineSymbol(math, ams, rel, "\ue010", "\\@nleqslant");
defineSymbol(math, ams, rel, "\ue011", "\\@nleqq");
defineSymbol(math, ams, rel, "\u2a87", "\\lneq", true);
defineSymbol(math, ams, rel, "\u2268", "\\lneqq", true);
defineSymbol(math, ams, rel, "\ue00c", "\\@lvertneqq");
defineSymbol(math, ams, rel, "\u22e6", "\\lnsim", true);
defineSymbol(math, ams, rel, "\u2a89", "\\lnapprox", true);
defineSymbol(math, ams, rel, "\u2280", "\\nprec", true);
// unicode-math maps \u22e0 to \npreccurlyeq. We'll use the AMS synonym.
defineSymbol(math, ams, rel, "\u22e0", "\\npreceq", true);
defineSymbol(math, ams, rel, "\u22e8", "\\precnsim", true);
defineSymbol(math, ams, rel, "\u2ab9", "\\precnapprox", true);
defineSymbol(math, ams, rel, "\u2241", "\\nsim", true);
defineSymbol(math, ams, rel, "\ue006", "\\@nshortmid");
defineSymbol(math, ams, rel, "\u2224", "\\nmid", true);
defineSymbol(math, ams, rel, "\u22ac", "\\nvdash", true);
defineSymbol(math, ams, rel, "\u22ad", "\\nvDash", true);
defineSymbol(math, ams, rel, "\u22ea", "\\ntriangleleft");
defineSymbol(math, ams, rel, "\u22ec", "\\ntrianglelefteq", true);
defineSymbol(math, ams, rel, "\u228a", "\\subsetneq", true);
defineSymbol(math, ams, rel, "\ue01a", "\\@varsubsetneq");
defineSymbol(math, ams, rel, "\u2acb", "\\subsetneqq", true);
defineSymbol(math, ams, rel, "\ue017", "\\@varsubsetneqq");
defineSymbol(math, ams, rel, "\u226f", "\\ngtr", true);
defineSymbol(math, ams, rel, "\ue00f", "\\@ngeqslant");
defineSymbol(math, ams, rel, "\ue00e", "\\@ngeqq");
defineSymbol(math, ams, rel, "\u2a88", "\\gneq", true);
defineSymbol(math, ams, rel, "\u2269", "\\gneqq", true);
defineSymbol(math, ams, rel, "\ue00d", "\\@gvertneqq");
defineSymbol(math, ams, rel, "\u22e7", "\\gnsim", true);
defineSymbol(math, ams, rel, "\u2a8a", "\\gnapprox", true);
defineSymbol(math, ams, rel, "\u2281", "\\nsucc", true);
// unicode-math maps \u22e1 to \nsucccurlyeq. We'll use the AMS synonym.
defineSymbol(math, ams, rel, "\u22e1", "\\nsucceq", true);
defineSymbol(math, ams, rel, "\u22e9", "\\succnsim", true);
defineSymbol(math, ams, rel, "\u2aba", "\\succnapprox", true);
// unicode-math maps \u2246 to \simneqq. We'll use the AMS synonym.
defineSymbol(math, ams, rel, "\u2246", "\\ncong", true);
defineSymbol(math, ams, rel, "\ue007", "\\@nshortparallel");
defineSymbol(math, ams, rel, "\u2226", "\\nparallel", true);
defineSymbol(math, ams, rel, "\u22af", "\\nVDash", true);
defineSymbol(math, ams, rel, "\u22eb", "\\ntriangleright");
defineSymbol(math, ams, rel, "\u22ed", "\\ntrianglerighteq", true);
defineSymbol(math, ams, rel, "\ue018", "\\@nsupseteqq");
defineSymbol(math, ams, rel, "\u228b", "\\supsetneq", true);
defineSymbol(math, ams, rel, "\ue01b", "\\@varsupsetneq");
defineSymbol(math, ams, rel, "\u2acc", "\\supsetneqq", true);
defineSymbol(math, ams, rel, "\ue019", "\\@varsupsetneqq");
defineSymbol(math, ams, rel, "\u22ae", "\\nVdash", true);
defineSymbol(math, ams, rel, "\u2ab5", "\\precneqq", true);
defineSymbol(math, ams, rel, "\u2ab6", "\\succneqq", true);
defineSymbol(math, ams, rel, "\ue016", "\\@nsubseteqq");
defineSymbol(math, ams, bin, "\u22b4", "\\unlhd");
defineSymbol(math, ams, bin, "\u22b5", "\\unrhd");
// AMS Negated Arrows
defineSymbol(math, ams, rel, "\u219a", "\\nleftarrow", true);
defineSymbol(math, ams, rel, "\u219b", "\\nrightarrow", true);
defineSymbol(math, ams, rel, "\u21cd", "\\nLeftarrow", true);
defineSymbol(math, ams, rel, "\u21cf", "\\nRightarrow", true);
defineSymbol(math, ams, rel, "\u21ae", "\\nleftrightarrow", true);
defineSymbol(math, ams, rel, "\u21ce", "\\nLeftrightarrow", true);
// AMS Misc
defineSymbol(math, ams, rel, "\u25b3", "\\vartriangle");
defineSymbol(math, ams, textord, "\u210f", "\\hslash");
defineSymbol(math, ams, textord, "\u25bd", "\\triangledown");
defineSymbol(math, ams, textord, "\u25ca", "\\lozenge");
defineSymbol(math, ams, textord, "\u24c8", "\\circledS");
defineSymbol(math, ams, textord, "\u00ae", "\\circledR");
defineSymbol(text, ams, textord, "\u00ae", "\\circledR");
defineSymbol(math, ams, textord, "\u2221", "\\measuredangle", true);
defineSymbol(math, ams, textord, "\u2204", "\\nexists");
defineSymbol(math, ams, textord, "\u2127", "\\mho");
defineSymbol(math, ams, textord, "\u2132", "\\Finv", true);
defineSymbol(math, ams, textord, "\u2141", "\\Game", true);
defineSymbol(math, ams, textord, "\u2035", "\\backprime");
defineSymbol(math, ams, textord, "\u25b2", "\\blacktriangle");
defineSymbol(math, ams, textord, "\u25bc", "\\blacktriangledown");
defineSymbol(math, ams, textord, "\u25a0", "\\blacksquare");
defineSymbol(math, ams, textord, "\u29eb", "\\blacklozenge");
defineSymbol(math, ams, textord, "\u2605", "\\bigstar");
defineSymbol(math, ams, textord, "\u2222", "\\sphericalangle", true);
defineSymbol(math, ams, textord, "\u2201", "\\complement", true);
// unicode-math maps U+F0 to \matheth. We map to AMS function \eth
defineSymbol(math, ams, textord, "\u00f0", "\\eth", true);
defineSymbol(text, main, textord, "\u00f0", "\u00f0");
defineSymbol(math, ams, textord, "\u2571", "\\diagup");
defineSymbol(math, ams, textord, "\u2572", "\\diagdown");
defineSymbol(math, ams, textord, "\u25a1", "\\square");
defineSymbol(math, ams, textord, "\u25a1", "\\Box");
defineSymbol(math, ams, textord, "\u25ca", "\\Diamond");
// unicode-math maps U+A5 to \mathyen. We map to AMS function \yen
defineSymbol(math, ams, textord, "\u00a5", "\\yen", true);
defineSymbol(text, ams, textord, "\u00a5", "\\yen", true);
defineSymbol(math, ams, textord, "\u2713", "\\checkmark", true);
defineSymbol(text, ams, textord, "\u2713", "\\checkmark");
// AMS Hebrew
defineSymbol(math, ams, textord, "\u2136", "\\beth", true);
defineSymbol(math, ams, textord, "\u2138", "\\daleth", true);
defineSymbol(math, ams, textord, "\u2137", "\\gimel", true);
// AMS Greek
defineSymbol(math, ams, textord, "\u03dd", "\\digamma", true);
defineSymbol(math, ams, textord, "\u03f0", "\\varkappa");
// AMS Delimiters
defineSymbol(math, ams, open, "\u250c", "\\@ulcorner", true);
defineSymbol(math, ams, close, "\u2510", "\\@urcorner", true);
defineSymbol(math, ams, open, "\u2514", "\\@llcorner", true);
defineSymbol(math, ams, close, "\u2518", "\\@lrcorner", true);
// AMS Binary Relations
defineSymbol(math, ams, rel, "\u2266", "\\leqq", true);
defineSymbol(math, ams, rel, "\u2a7d", "\\leqslant", true);
defineSymbol(math, ams, rel, "\u2a95", "\\eqslantless", true);
defineSymbol(math, ams, rel, "\u2272", "\\lesssim", true);
defineSymbol(math, ams, rel, "\u2a85", "\\lessapprox", true);
defineSymbol(math, ams, rel, "\u224a", "\\approxeq", true);
defineSymbol(math, ams, bin, "\u22d6", "\\lessdot");
defineSymbol(math, ams, rel, "\u22d8", "\\lll", true);
defineSymbol(math, ams, rel, "\u2276", "\\lessgtr", true);
defineSymbol(math, ams, rel, "\u22da", "\\lesseqgtr", true);
defineSymbol(math, ams, rel, "\u2a8b", "\\lesseqqgtr", true);
defineSymbol(math, ams, rel, "\u2251", "\\doteqdot");
defineSymbol(math, ams, rel, "\u2253", "\\risingdotseq", true);
defineSymbol(math, ams, rel, "\u2252", "\\fallingdotseq", true);
defineSymbol(math, ams, rel, "\u223d", "\\backsim", true);
defineSymbol(math, ams, rel, "\u22cd", "\\backsimeq", true);
defineSymbol(math, ams, rel, "\u2ac5", "\\subseteqq", true);
defineSymbol(math, ams, rel, "\u22d0", "\\Subset", true);
defineSymbol(math, ams, rel, "\u228f", "\\sqsubset", true);
defineSymbol(math, ams, rel, "\u227c", "\\preccurlyeq", true);
defineSymbol(math, ams, rel, "\u22de", "\\curlyeqprec", true);
defineSymbol(math, ams, rel, "\u227e", "\\precsim", true);
defineSymbol(math, ams, rel, "\u2ab7", "\\precapprox", true);
defineSymbol(math, ams, rel, "\u22b2", "\\vartriangleleft");
defineSymbol(math, ams, rel, "\u22b4", "\\trianglelefteq");
defineSymbol(math, ams, rel, "\u22a8", "\\vDash", true);
defineSymbol(math, ams, rel, "\u22aa", "\\Vvdash", true);
defineSymbol(math, ams, rel, "\u2323", "\\smallsmile");
defineSymbol(math, ams, rel, "\u2322", "\\smallfrown");
defineSymbol(math, ams, rel, "\u224f", "\\bumpeq", true);
defineSymbol(math, ams, rel, "\u224e", "\\Bumpeq", true);
defineSymbol(math, ams, rel, "\u2267", "\\geqq", true);
defineSymbol(math, ams, rel, "\u2a7e", "\\geqslant", true);
defineSymbol(math, ams, rel, "\u2a96", "\\eqslantgtr", true);
defineSymbol(math, ams, rel, "\u2273", "\\gtrsim", true);
defineSymbol(math, ams, rel, "\u2a86", "\\gtrapprox", true);
defineSymbol(math, ams, bin, "\u22d7", "\\gtrdot");
defineSymbol(math, ams, rel, "\u22d9", "\\ggg", true);
defineSymbol(math, ams, rel, "\u2277", "\\gtrless", true);
defineSymbol(math, ams, rel, "\u22db", "\\gtreqless", true);
defineSymbol(math, ams, rel, "\u2a8c", "\\gtreqqless", true);
defineSymbol(math, ams, rel, "\u2256", "\\eqcirc", true);
defineSymbol(math, ams, rel, "\u2257", "\\circeq", true);
defineSymbol(math, ams, rel, "\u225c", "\\triangleq", true);
defineSymbol(math, ams, rel, "\u223c", "\\thicksim");
defineSymbol(math, ams, rel, "\u2248", "\\thickapprox");
defineSymbol(math, ams, rel, "\u2ac6", "\\supseteqq", true);
defineSymbol(math, ams, rel, "\u22d1", "\\Supset", true);
defineSymbol(math, ams, rel, "\u2290", "\\sqsupset", true);
defineSymbol(math, ams, rel, "\u227d", "\\succcurlyeq", true);
defineSymbol(math, ams, rel, "\u22df", "\\curlyeqsucc", true);
defineSymbol(math, ams, rel, "\u227f", "\\succsim", true);
defineSymbol(math, ams, rel, "\u2ab8", "\\succapprox", true);
defineSymbol(math, ams, rel, "\u22b3", "\\vartriangleright");
defineSymbol(math, ams, rel, "\u22b5", "\\trianglerighteq");
defineSymbol(math, ams, rel, "\u22a9", "\\Vdash", true);
defineSymbol(math, ams, rel, "\u2223", "\\shortmid");
defineSymbol(math, ams, rel, "\u2225", "\\shortparallel");
defineSymbol(math, ams, rel, "\u226c", "\\between", true);
defineSymbol(math, ams, rel, "\u22d4", "\\pitchfork", true);
defineSymbol(math, ams, rel, "\u221d", "\\varpropto");
defineSymbol(math, ams, rel, "\u25c0", "\\blacktriangleleft");
// unicode-math says that \therefore is a mathord atom.
// We kept the amssymb atom type, which is rel.
defineSymbol(math, ams, rel, "\u2234", "\\therefore", true);
defineSymbol(math, ams, rel, "\u220d", "\\backepsilon");
defineSymbol(math, ams, rel, "\u25b6", "\\blacktriangleright");
// unicode-math says that \because is a mathord atom.
// We kept the amssymb atom type, which is rel.
defineSymbol(math, ams, rel, "\u2235", "\\because", true);
defineSymbol(math, ams, rel, "\u22d8", "\\llless");
defineSymbol(math, ams, rel, "\u22d9", "\\gggtr");
defineSymbol(math, ams, bin, "\u22b2", "\\lhd");
defineSymbol(math, ams, bin, "\u22b3", "\\rhd");
defineSymbol(math, ams, rel, "\u2242", "\\eqsim", true);
defineSymbol(math, main, rel, "\u22c8", "\\Join");
defineSymbol(math, ams, rel, "\u2251", "\\Doteq", true);
// AMS Binary Operators
defineSymbol(math, ams, bin, "\u2214", "\\dotplus", true);
defineSymbol(math, ams, bin, "\u2216", "\\smallsetminus");
defineSymbol(math, ams, bin, "\u22d2", "\\Cap", true);
defineSymbol(math, ams, bin, "\u22d3", "\\Cup", true);
defineSymbol(math, ams, bin, "\u2a5e", "\\doublebarwedge", true);
defineSymbol(math, ams, bin, "\u229f", "\\boxminus", true);
defineSymbol(math, ams, bin, "\u229e", "\\boxplus", true);
defineSymbol(math, ams, bin, "\u22c7", "\\divideontimes", true);
defineSymbol(math, ams, bin, "\u22c9", "\\ltimes", true);
defineSymbol(math, ams, bin, "\u22ca", "\\rtimes", true);
defineSymbol(math, ams, bin, "\u22cb", "\\leftthreetimes", true);
defineSymbol(math, ams, bin, "\u22cc", "\\rightthreetimes", true);
defineSymbol(math, ams, bin, "\u22cf", "\\curlywedge", true);
defineSymbol(math, ams, bin, "\u22ce", "\\curlyvee", true);
defineSymbol(math, ams, bin, "\u229d", "\\circleddash", true);
defineSymbol(math, ams, bin, "\u229b", "\\circledast", true);
defineSymbol(math, ams, bin, "\u22c5", "\\centerdot");
defineSymbol(math, ams, bin, "\u22ba", "\\intercal", true);
defineSymbol(math, ams, bin, "\u22d2", "\\doublecap");
defineSymbol(math, ams, bin, "\u22d3", "\\doublecup");
defineSymbol(math, ams, bin, "\u22a0", "\\boxtimes", true);
// AMS Arrows
// Note: unicode-math maps \u21e2 to their own function \rightdasharrow.
// We'll map it to AMS function \dashrightarrow. It produces the same atom.
defineSymbol(math, ams, rel, "\u21e2", "\\dashrightarrow", true);
// unicode-math maps \u21e0 to \leftdasharrow. We'll use the AMS synonym.
defineSymbol(math, ams, rel, "\u21e0", "\\dashleftarrow", true);
defineSymbol(math, ams, rel, "\u21c7", "\\leftleftarrows", true);
defineSymbol(math, ams, rel, "\u21c6", "\\leftrightarrows", true);
defineSymbol(math, ams, rel, "\u21da", "\\Lleftarrow", true);
defineSymbol(math, ams, rel, "\u219e", "\\twoheadleftarrow", true);
defineSymbol(math, ams, rel, "\u21a2", "\\leftarrowtail", true);
defineSymbol(math, ams, rel, "\u21ab", "\\looparrowleft", true);
defineSymbol(math, ams, rel, "\u21cb", "\\leftrightharpoons", true);
defineSymbol(math, ams, rel, "\u21b6", "\\curvearrowleft", true);
// unicode-math maps \u21ba to \acwopencirclearrow. We'll use the AMS synonym.
defineSymbol(math, ams, rel, "\u21ba", "\\circlearrowleft", true);
defineSymbol(math, ams, rel, "\u21b0", "\\Lsh", true);
defineSymbol(math, ams, rel, "\u21c8", "\\upuparrows", true);
defineSymbol(math, ams, rel, "\u21bf", "\\upharpoonleft", true);
defineSymbol(math, ams, rel, "\u21c3", "\\downharpoonleft", true);
defineSymbol(math, main, rel, "\u22b6", "\\origof", true); // not in font
defineSymbol(math, main, rel, "\u22b7", "\\imageof", true); // not in font
defineSymbol(math, ams, rel, "\u22b8", "\\multimap", true);
defineSymbol(math, ams, rel, "\u21ad", "\\leftrightsquigarrow", true);
defineSymbol(math, ams, rel, "\u21c9", "\\rightrightarrows", true);
defineSymbol(math, ams, rel, "\u21c4", "\\rightleftarrows", true);
defineSymbol(math, ams, rel, "\u21a0", "\\twoheadrightarrow", true);
defineSymbol(math, ams, rel, "\u21a3", "\\rightarrowtail", true);
defineSymbol(math, ams, rel, "\u21ac", "\\looparrowright", true);
defineSymbol(math, ams, rel, "\u21b7", "\\curvearrowright", true);
// unicode-math maps \u21bb to \cwopencirclearrow. We'll use the AMS synonym.
defineSymbol(math, ams, rel, "\u21bb", "\\circlearrowright", true);
defineSymbol(math, ams, rel, "\u21b1", "\\Rsh", true);
defineSymbol(math, ams, rel, "\u21ca", "\\downdownarrows", true);
defineSymbol(math, ams, rel, "\u21be", "\\upharpoonright", true);
defineSymbol(math, ams, rel, "\u21c2", "\\downharpoonright", true);
defineSymbol(math, ams, rel, "\u21dd", "\\rightsquigarrow", true);
defineSymbol(math, ams, rel, "\u21dd", "\\leadsto");
defineSymbol(math, ams, rel, "\u21db", "\\Rrightarrow", true);
defineSymbol(math, ams, rel, "\u21be", "\\restriction");
defineSymbol(math, main, textord, "\u2018", "`");
defineSymbol(math, main, textord, "$", "\\$");
defineSymbol(text, main, textord, "$", "\\$");
defineSymbol(text, main, textord, "$", "\\textdollar");
defineSymbol(math, main, textord, "%", "\\%");
defineSymbol(text, main, textord, "%", "\\%");
defineSymbol(math, main, textord, "_", "\\_");
defineSymbol(text, main, textord, "_", "\\_");
defineSymbol(text, main, textord, "_", "\\textunderscore");
defineSymbol(math, main, textord, "\u2220", "\\angle", true);
defineSymbol(math, main, textord, "\u221e", "\\infty", true);
defineSymbol(math, main, textord, "\u2032", "\\prime");
defineSymbol(math, main, textord, "\u25b3", "\\triangle");
defineSymbol(math, main, textord, "\u0393", "\\Gamma", true);
defineSymbol(math, main, textord, "\u0394", "\\Delta", true);
defineSymbol(math, main, textord, "\u0398", "\\Theta", true);
defineSymbol(math, main, textord, "\u039b", "\\Lambda", true);
defineSymbol(math, main, textord, "\u039e", "\\Xi", true);
defineSymbol(math, main, textord, "\u03a0", "\\Pi", true);
defineSymbol(math, main, textord, "\u03a3", "\\Sigma", true);
defineSymbol(math, main, textord, "\u03a5", "\\Upsilon", true);
defineSymbol(math, main, textord, "\u03a6", "\\Phi", true);
defineSymbol(math, main, textord, "\u03a8", "\\Psi", true);
defineSymbol(math, main, textord, "\u03a9", "\\Omega", true);
defineSymbol(math, main, textord, "A", "\u0391");
defineSymbol(math, main, textord, "B", "\u0392");
defineSymbol(math, main, textord, "E", "\u0395");
defineSymbol(math, main, textord, "Z", "\u0396");
defineSymbol(math, main, textord, "H", "\u0397");
defineSymbol(math, main, textord, "I", "\u0399");
defineSymbol(math, main, textord, "K", "\u039A");
defineSymbol(math, main, textord, "M", "\u039C");
defineSymbol(math, main, textord, "N", "\u039D");
defineSymbol(math, main, textord, "O", "\u039F");
defineSymbol(math, main, textord, "P", "\u03A1");
defineSymbol(math, main, textord, "T", "\u03A4");
defineSymbol(math, main, textord, "X", "\u03A7");
defineSymbol(math, main, textord, "\u00ac", "\\neg", true);
defineSymbol(math, main, textord, "\u00ac", "\\lnot");
defineSymbol(math, main, textord, "\u22a4", "\\top");
defineSymbol(math, main, textord, "\u22a5", "\\bot");
defineSymbol(math, main, textord, "\u2205", "\\emptyset");
defineSymbol(math, ams, textord, "\u2205", "\\varnothing");
defineSymbol(math, main, mathord, "\u03b1", "\\alpha", true);
defineSymbol(math, main, mathord, "\u03b2", "\\beta", true);
defineSymbol(math, main, mathord, "\u03b3", "\\gamma", true);
defineSymbol(math, main, mathord, "\u03b4", "\\delta", true);
defineSymbol(math, main, mathord, "\u03f5", "\\epsilon", true);
defineSymbol(math, main, mathord, "\u03b6", "\\zeta", true);
defineSymbol(math, main, mathord, "\u03b7", "\\eta", true);
defineSymbol(math, main, mathord, "\u03b8", "\\theta", true);
defineSymbol(math, main, mathord, "\u03b9", "\\iota", true);
defineSymbol(math, main, mathord, "\u03ba", "\\kappa", true);
defineSymbol(math, main, mathord, "\u03bb", "\\lambda", true);
defineSymbol(math, main, mathord, "\u03bc", "\\mu", true);
defineSymbol(math, main, mathord, "\u03bd", "\\nu", true);
defineSymbol(math, main, mathord, "\u03be", "\\xi", true);
defineSymbol(math, main, mathord, "\u03bf", "\\omicron", true);
defineSymbol(math, main, mathord, "\u03c0", "\\pi", true);
defineSymbol(math, main, mathord, "\u03c1", "\\rho", true);
defineSymbol(math, main, mathord, "\u03c3", "\\sigma", true);
defineSymbol(math, main, mathord, "\u03c4", "\\tau", true);
defineSymbol(math, main, mathord, "\u03c5", "\\upsilon", true);
defineSymbol(math, main, mathord, "\u03d5", "\\phi", true);
defineSymbol(math, main, mathord, "\u03c7", "\\chi", true);
defineSymbol(math, main, mathord, "\u03c8", "\\psi", true);
defineSymbol(math, main, mathord, "\u03c9", "\\omega", true);
defineSymbol(math, main, mathord, "\u03b5", "\\varepsilon", true);
defineSymbol(math, main, mathord, "\u03d1", "\\vartheta", true);
defineSymbol(math, main, mathord, "\u03d6", "\\varpi", true);
defineSymbol(math, main, mathord, "\u03f1", "\\varrho", true);
defineSymbol(math, main, mathord, "\u03c2", "\\varsigma", true);
defineSymbol(math, main, mathord, "\u03c6", "\\varphi", true);
defineSymbol(math, main, bin, "\u2217", "*", true);
defineSymbol(math, main, bin, "+", "+");
defineSymbol(math, main, bin, "\u2212", "-", true);
defineSymbol(math, main, bin, "\u22c5", "\\cdot", true);
defineSymbol(math, main, bin, "\u2218", "\\circ", true);
defineSymbol(math, main, bin, "\u00f7", "\\div", true);
defineSymbol(math, main, bin, "\u00b1", "\\pm", true);
defineSymbol(math, main, bin, "\u00d7", "\\times", true);
defineSymbol(math, main, bin, "\u2229", "\\cap", true);
defineSymbol(math, main, bin, "\u222a", "\\cup", true);
defineSymbol(math, main, bin, "\u2216", "\\setminus", true);
defineSymbol(math, main, bin, "\u2227", "\\land");
defineSymbol(math, main, bin, "\u2228", "\\lor");
defineSymbol(math, main, bin, "\u2227", "\\wedge", true);
defineSymbol(math, main, bin, "\u2228", "\\vee", true);
defineSymbol(math, main, textord, "\u221a", "\\surd");
defineSymbol(math, main, open, "\u27e8", "\\langle", true);
defineSymbol(math, main, open, "\u2223", "\\lvert");
defineSymbol(math, main, open, "\u2225", "\\lVert");
defineSymbol(math, main, close, "?", "?");
defineSymbol(math, main, close, "!", "!");
defineSymbol(math, main, close, "\u27e9", "\\rangle", true);
defineSymbol(math, main, close, "\u2223", "\\rvert");
defineSymbol(math, main, close, "\u2225", "\\rVert");
defineSymbol(math, main, rel, "=", "=");
defineSymbol(math, main, rel, ":", ":");
defineSymbol(math, main, rel, "\u2248", "\\approx", true);
defineSymbol(math, main, rel, "\u2245", "\\cong", true);
defineSymbol(math, main, rel, "\u2265", "\\ge");
defineSymbol(math, main, rel, "\u2265", "\\geq", true);
defineSymbol(math, main, rel, "\u2190", "\\gets");
defineSymbol(math, main, rel, ">", "\\gt", true);
defineSymbol(math, main, rel, "\u2208", "\\in", true);
defineSymbol(math, main, rel, "\ue020", "\\@not");
defineSymbol(math, main, rel, "\u2282", "\\subset", true);
defineSymbol(math, main, rel, "\u2283", "\\supset", true);
defineSymbol(math, main, rel, "\u2286", "\\subseteq", true);
defineSymbol(math, main, rel, "\u2287", "\\supseteq", true);
defineSymbol(math, ams, rel, "\u2288", "\\nsubseteq", true);
defineSymbol(math, ams, rel, "\u2289", "\\nsupseteq", true);
defineSymbol(math, main, rel, "\u22a8", "\\models");
defineSymbol(math, main, rel, "\u2190", "\\leftarrow", true);
defineSymbol(math, main, rel, "\u2264", "\\le");
defineSymbol(math, main, rel, "\u2264", "\\leq", true);
defineSymbol(math, main, rel, "<", "\\lt", true);
defineSymbol(math, main, rel, "\u2192", "\\rightarrow", true);
defineSymbol(math, main, rel, "\u2192", "\\to");
defineSymbol(math, ams, rel, "\u2271", "\\ngeq", true);
defineSymbol(math, ams, rel, "\u2270", "\\nleq", true);
defineSymbol(math, main, spacing, "\u00a0", "\\ ");
defineSymbol(math, main, spacing, "\u00a0", "\\space");
// Ref: LaTeX Source 2e: \DeclareRobustCommand{\nobreakspace}{%
defineSymbol(math, main, spacing, "\u00a0", "\\nobreakspace");
defineSymbol(text, main, spacing, "\u00a0", "\\ ");
defineSymbol(text, main, spacing, "\u00a0", " ");
defineSymbol(text, main, spacing, "\u00a0", "\\space");
defineSymbol(text, main, spacing, "\u00a0", "\\nobreakspace");
defineSymbol(math, main, spacing, "", "\\nobreak");
defineSymbol(math, main, spacing, "", "\\allowbreak");
defineSymbol(math, main, punct, ",", ",");
defineSymbol(math, main, punct, ";", ";");
defineSymbol(math, ams, bin, "\u22bc", "\\barwedge", true);
defineSymbol(math, ams, bin, "\u22bb", "\\veebar", true);
defineSymbol(math, main, bin, "\u2299", "\\odot", true);
defineSymbol(math, main, bin, "\u2295", "\\oplus", true);
defineSymbol(math, main, bin, "\u2297", "\\otimes", true);
defineSymbol(math, main, textord, "\u2202", "\\partial", true);
defineSymbol(math, main, bin, "\u2298", "\\oslash", true);
defineSymbol(math, ams, bin, "\u229a", "\\circledcirc", true);
defineSymbol(math, ams, bin, "\u22a1", "\\boxdot", true);
defineSymbol(math, main, bin, "\u25b3", "\\bigtriangleup");
defineSymbol(math, main, bin, "\u25bd", "\\bigtriangledown");
defineSymbol(math, main, bin, "\u2020", "\\dagger");
defineSymbol(math, main, bin, "\u22c4", "\\diamond");
defineSymbol(math, main, bin, "\u22c6", "\\star");
defineSymbol(math, main, bin, "\u25c3", "\\triangleleft");
defineSymbol(math, main, bin, "\u25b9", "\\triangleright");
defineSymbol(math, main, open, "{", "\\{");
defineSymbol(text, main, textord, "{", "\\{");
defineSymbol(text, main, textord, "{", "\\textbraceleft");
defineSymbol(math, main, close, "}", "\\}");
defineSymbol(text, main, textord, "}", "\\}");
defineSymbol(text, main, textord, "}", "\\textbraceright");
defineSymbol(math, main, open, "{", "\\lbrace");
defineSymbol(math, main, close, "}", "\\rbrace");
defineSymbol(math, main, open, "[", "\\lbrack", true);
defineSymbol(text, main, textord, "[", "\\lbrack", true);
defineSymbol(math, main, close, "]", "\\rbrack", true);
defineSymbol(text, main, textord, "]", "\\rbrack", true);
defineSymbol(math, main, open, "(", "\\lparen", true);
defineSymbol(math, main, close, ")", "\\rparen", true);
defineSymbol(text, main, textord, "<", "\\textless", true); // in T1 fontenc
defineSymbol(text, main, textord, ">", "\\textgreater", true); // in T1 fontenc
defineSymbol(math, main, open, "\u230a", "\\lfloor", true);
defineSymbol(math, main, close, "\u230b", "\\rfloor", true);
defineSymbol(math, main, open, "\u2308", "\\lceil", true);
defineSymbol(math, main, close, "\u2309", "\\rceil", true);
defineSymbol(math, main, textord, "\\", "\\backslash");
defineSymbol(math, main, textord, "\u2223", "|");
defineSymbol(math, main, textord, "\u2223", "\\vert");
defineSymbol(text, main, textord, "|", "\\textbar", true); // in T1 fontenc
defineSymbol(math, main, textord, "\u2225", "\\|");
defineSymbol(math, main, textord, "\u2225", "\\Vert");
defineSymbol(text, main, textord, "\u2225", "\\textbardbl");
defineSymbol(text, main, textord, "~", "\\textasciitilde");
defineSymbol(text, main, textord, "\\", "\\textbackslash");
defineSymbol(text, main, textord, "^", "\\textasciicircum");
defineSymbol(math, main, rel, "\u2191", "\\uparrow", true);
defineSymbol(math, main, rel, "\u21d1", "\\Uparrow", true);
defineSymbol(math, main, rel, "\u2193", "\\downarrow", true);
defineSymbol(math, main, rel, "\u21d3", "\\Downarrow", true);
defineSymbol(math, main, rel, "\u2195", "\\updownarrow", true);
defineSymbol(math, main, rel, "\u21d5", "\\Updownarrow", true);
defineSymbol(math, main, op, "\u2210", "\\coprod");
defineSymbol(math, main, op, "\u22c1", "\\bigvee");
defineSymbol(math, main, op, "\u22c0", "\\bigwedge");
defineSymbol(math, main, op, "\u2a04", "\\biguplus");
defineSymbol(math, main, op, "\u22c2", "\\bigcap");
defineSymbol(math, main, op, "\u22c3", "\\bigcup");
defineSymbol(math, main, op, "\u222b", "\\int");
defineSymbol(math, main, op, "\u222b", "\\intop");
defineSymbol(math, main, op, "\u222c", "\\iint");
defineSymbol(math, main, op, "\u222d", "\\iiint");
defineSymbol(math, main, op, "\u220f", "\\prod");
defineSymbol(math, main, op, "\u2211", "\\sum");
defineSymbol(math, main, op, "\u2a02", "\\bigotimes");
defineSymbol(math, main, op, "\u2a01", "\\bigoplus");
defineSymbol(math, main, op, "\u2a00", "\\bigodot");
defineSymbol(math, main, op, "\u222e", "\\oint");
defineSymbol(math, main, op, "\u222f", "\\oiint");
defineSymbol(math, main, op, "\u2230", "\\oiiint");
defineSymbol(math, main, op, "\u2a06", "\\bigsqcup");
defineSymbol(math, main, op, "\u222b", "\\smallint");
defineSymbol(text, main, inner, "\u2026", "\\textellipsis");
defineSymbol(math, main, inner, "\u2026", "\\mathellipsis");
defineSymbol(text, main, inner, "\u2026", "\\ldots", true);
defineSymbol(math, main, inner, "\u2026", "\\ldots", true);
defineSymbol(math, main, inner, "\u22ef", "\\@cdots", true);
defineSymbol(math, main, inner, "\u22f1", "\\ddots", true);
// \vdots is a macro that uses one of these two symbols (with made-up names   ):
defineSymbol(math, main, textord, "\u22ee", "\\varvdots");
defineSymbol(text, main, textord, "\u22ee", "\\varvdots");
defineSymbol(math, main, accent, "\u02ca", "\\acute");
defineSymbol(math, main, accent, "\u02cb", "\\grave");
defineSymbol(math, main, accent, "\u00a8", "\\ddot");
defineSymbol(math, main, accent, "\u007e", "\\tilde");
defineSymbol(math, main, accent, "\u02c9", "\\bar");
defineSymbol(math, main, accent, "\u02d8", "\\breve");
defineSymbol(math, main, accent, "\u02c7", "\\check");
defineSymbol(math, main, accent, "\u005e", "\\hat");
defineSymbol(math, main, accent, "\u20d7", "\\vec");
defineSymbol(math, main, accent, "\u02d9", "\\dot");
defineSymbol(math, main, accent, "\u02da", "\\mathring");
// \imath and \jmath should be invariant to \mathrm, \mathbf, etc., so use PUA
defineSymbol(math, main, mathord, "\ue131", "\\@imath");
defineSymbol(math, main, mathord, "\ue237", "\\@jmath");
defineSymbol(math, main, textord, "\u0131", "\u0131");
defineSymbol(math, main, textord, "\u0237", "\u0237");
defineSymbol(text, main, textord, "\u0131", "\\i", true);
defineSymbol(text, main, textord, "\u0237", "\\j", true);
defineSymbol(text, main, textord, "\u00df", "\\ss", true);
defineSymbol(text, main, textord, "\u00e6", "\\ae", true);
defineSymbol(text, main, textord, "\u0153", "\\oe", true);
defineSymbol(text, main, textord, "\u00f8", "\\o", true);
defineSymbol(text, main, textord, "\u00c6", "\\AE", true);
defineSymbol(text, main, textord, "\u0152", "\\OE", true);
defineSymbol(text, main, textord, "\u00d8", "\\O", true);
defineSymbol(text, main, accent, "\u02ca", "\\'"); // acute
defineSymbol(text, main, accent, "\u02cb", "\\`"); // grave
defineSymbol(text, main, accent, "\u02c6", "\\^"); // circumflex
defineSymbol(text, main, accent, "\u02dc", "\\~"); // tilde
defineSymbol(text, main, accent, "\u02c9", "\\="); // macron
defineSymbol(text, main, accent, "\u02d8", "\\u"); // breve
defineSymbol(text, main, accent, "\u02d9", "\\."); // dot above
defineSymbol(text, main, accent, "\u00b8", "\\c"); // cedilla
defineSymbol(text, main, accent, "\u02da", "\\r"); // ring above
defineSymbol(text, main, accent, "\u02c7", "\\v"); // caron
defineSymbol(text, main, accent, "\u00a8", '\\"'); // diaeresis
defineSymbol(text, main, accent, "\u02dd", "\\H"); // double acute
defineSymbol(text, main, accent, "\u25ef", "\\textcircled"); // \bigcirc glyph
// These ligatures are detected and created in Parser.js's `formLigatures`.
var ligatures = {
  "--": true,
  "---": true,
  "``": true,
  "''": true
};
defineSymbol(text, main, textord, "\u2013", "--", true);
defineSymbol(text, main, textord, "\u2013", "\\textendash");
defineSymbol(text, main, textord, "\u2014", "---", true);
defineSymbol(text, main, textord, "\u2014", "\\textemdash");
defineSymbol(text, main, textord, "\u2018", "`", true);
defineSymbol(text, main, textord, "\u2018", "\\textquoteleft");
defineSymbol(text, main, textord, "\u2019", "'", true);
defineSymbol(text, main, textord, "\u2019", "\\textquoteright");
defineSymbol(text, main, textord, "\u201c", "``", true);
defineSymbol(text, main, textord, "\u201c", "\\textquotedblleft");
defineSymbol(text, main, textord, "\u201d", "''", true);
defineSymbol(text, main, textord, "\u201d", "\\textquotedblright");
//  \degree from gensymb package
defineSymbol(math, main, textord, "\u00b0", "\\degree", true);
defineSymbol(text, main, textord, "\u00b0", "\\degree");
// \textdegree from inputenc package
defineSymbol(text, main, textord, "\u00b0", "\\textdegree", true);
// TODO: In LaTeX, \pounds can generate a different character in text and math
// mode, but among our fonts, only Main-Regular defines this character "163".
defineSymbol(math, main, textord, "\u00a3", "\\pounds");
defineSymbol(math, main, textord, "\u00a3", "\\mathsterling", true);
defineSymbol(text, main, textord, "\u00a3", "\\pounds");
defineSymbol(text, main, textord, "\u00a3", "\\textsterling", true);
defineSymbol(math, ams, textord, "\u2720", "\\maltese");
defineSymbol(text, ams, textord, "\u2720", "\\maltese");
// There are lots of symbols which are the same, so we add them in afterwards.
// All of these are textords in math mode
var mathTextSymbols = "0123456789/@.\"";
for (var i = 0; i < mathTextSymbols.length; i++) {
  var ch = mathTextSymbols.charAt(i);
  defineSymbol(math, main, textord, ch, ch);
}
// All of these are textords in text mode
var textSymbols = "0123456789!@*()-=+\";:?/.,";
for (var _i = 0; _i < textSymbols.length; _i++) {
  var _ch = textSymbols.charAt(_i);
  defineSymbol(text, main, textord, _ch, _ch);
}
// All of these are textords in text mode, and mathords in math mode
var letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
for (var _i2 = 0; _i2 < letters.length; _i2++) {
  var _ch2 = letters.charAt(_i2);
  defineSymbol(math, main, mathord, _ch2, _ch2);
  defineSymbol(text, main, textord, _ch2, _ch2);
}
// Blackboard bold and script letters in Unicode range
defineSymbol(math, ams, textord, "C", "\u2102"); // blackboard bold
defineSymbol(text, ams, textord, "C", "\u2102");
defineSymbol(math, ams, textord, "H", "\u210D");
defineSymbol(text, ams, textord, "H", "\u210D");
defineSymbol(math, ams, textord, "N", "\u2115");
defineSymbol(text, ams, textord, "N", "\u2115");
defineSymbol(math, ams, textord, "P", "\u2119");
defineSymbol(text, ams, textord, "P", "\u2119");
defineSymbol(math, ams, textord, "Q", "\u211A");
defineSymbol(text, ams, textord, "Q", "\u211A");
defineSymbol(math, ams, textord, "R", "\u211D");
defineSymbol(text, ams, textord, "R", "\u211D");
defineSymbol(math, ams, textord, "Z", "\u2124");
defineSymbol(text, ams, textord, "Z", "\u2124");
defineSymbol(math, main, mathord, "h", "\u210E"); // italic h, Planck constant
defineSymbol(text, main, mathord, "h", "\u210E");
// The next loop loads wide (surrogate pair) characters.
// We support some letters in the Unicode range U+1D400 to U+1D7FF,
// Mathematical Alphanumeric Symbols.
// Some editors do not deal well with wide characters. So don't write the
// string into this file. Instead, create the string from the surrogate pair.
var wideChar;
for (var _i3 = 0; _i3 < letters.length; _i3++) {
  var _ch3 = letters.charAt(_i3);
  // The hex numbers in the next line are a surrogate pair.
  // 0xD835 is the high surrogate for all letters in the range we support.
  // 0xDC00 is the low surrogate for bold A.
  wideChar = String.fromCharCode(0xD835, 0xDC00 + _i3); // A-Z a-z bold
  defineSymbol(math, main, mathord, _ch3, wideChar);
  defineSymbol(text, main, textord, _ch3, wideChar);
  wideChar = String.fromCharCode(0xD835, 0xDC34 + _i3); // A-Z a-z italic
  defineSymbol(math, main, mathord, _ch3, wideChar);
  defineSymbol(text, main, textord, _ch3, wideChar);
  wideChar = String.fromCharCode(0xD835, 0xDC68 + _i3); // A-Z a-z bold italic
  defineSymbol(math, main, mathord, _ch3, wideChar);
  defineSymbol(text, main, textord, _ch3, wideChar);
  wideChar = String.fromCharCode(0xD835, 0xDD04 + _i3); // A-Z a-z Fraktur
  defineSymbol(math, main, mathord, _ch3, wideChar);
  defineSymbol(text, main, textord, _ch3, wideChar);
  wideChar = String.fromCharCode(0xD835, 0xDD6C + _i3); // A-Z a-z bold Fraktur
  defineSymbol(math, main, mathord, _ch3, wideChar);
  defineSymbol(text, main, textord, _ch3, wideChar);
  wideChar = String.fromCharCode(0xD835, 0xDDA0 + _i3); // A-Z a-z sans-serif
  defineSymbol(math, main, mathord, _ch3, wideChar);
  defineSymbol(text, main, textord, _ch3, wideChar);
  wideChar = String.fromCharCode(0xD835, 0xDDD4 + _i3); // A-Z a-z sans bold
  defineSymbol(math, main, mathord, _ch3, wideChar);
  defineSymbol(text, main, textord, _ch3, wideChar);
  wideChar = String.fromCharCode(0xD835, 0xDE08 + _i3); // A-Z a-z sans italic
  defineSymbol(math, main, mathord, _ch3, wideChar);
  defineSymbol(text, main, textord, _ch3, wideChar);
  wideChar = String.fromCharCode(0xD835, 0xDE70 + _i3); // A-Z a-z monospace
  defineSymbol(math, main, mathord, _ch3, wideChar);
  defineSymbol(text, main, textord, _ch3, wideChar);
  if (_i3 < 26) {
    // KaTeX fonts have only capital letters for blackboard bold and script.
    // See exception for k below.
    wideChar = String.fromCharCode(0xD835, 0xDD38 + _i3); // A-Z double struck
    defineSymbol(math, main, mathord, _ch3, wideChar);
    defineSymbol(text, main, textord, _ch3, wideChar);
    wideChar = String.fromCharCode(0xD835, 0xDC9C + _i3); // A-Z script
    defineSymbol(math, main, mathord, _ch3, wideChar);
    defineSymbol(text, main, textord, _ch3, wideChar);
  }
  // TODO: Add bold script when it is supported by a KaTeX font.
}
// "k" is the only double struck lower case letter in the KaTeX fonts.
wideChar = String.fromCharCode(0xD835, 0xDD5C); // k double struck
defineSymbol(math, main, mathord, "k", wideChar);
defineSymbol(text, main, textord, "k", wideChar);
// Next, some wide character numerals
for (var _i4 = 0; _i4 < 10; _i4++) {
  var _ch4 = _i4.toString();
  wideChar = String.fromCharCode(0xD835, 0xDFCE + _i4); // 0-9 bold
  defineSymbol(math, main, mathord, _ch4, wideChar);
  defineSymbol(text, main, textord, _ch4, wideChar);
  wideChar = String.fromCharCode(0xD835, 0xDFE2 + _i4); // 0-9 sans serif
  defineSymbol(math, main, mathord, _ch4, wideChar);
  defineSymbol(text, main, textord, _ch4, wideChar);
  wideChar = String.fromCharCode(0xD835, 0xDFEC + _i4); // 0-9 bold sans
  defineSymbol(math, main, mathord, _ch4, wideChar);
  defineSymbol(text, main, textord, _ch4, wideChar);
  wideChar = String.fromCharCode(0xD835, 0xDFF6 + _i4); // 0-9 monospace
  defineSymbol(math, main, mathord, _ch4, wideChar);
  defineSymbol(text, main, textord, _ch4, wideChar);
}
// We add these Latin-1 letters as symbols for backwards-compatibility,
// but they are not actually in the font, nor are they supported by the
// Unicode accent mechanism, so they fall back to Times font and look ugly.
// TODO(edemaine): Fix this.
var extraLatin = "\u00d0\u00de\u00fe";
for (var _i5 = 0; _i5 < extraLatin.length; _i5++) {
  var _ch5 = extraLatin.charAt(_i5);
  defineSymbol(math, main, mathord, _ch5, _ch5);
  defineSymbol(text, main, textord, _ch5, _ch5);
}

/**
 * This file provides support for Unicode range U+1D400 to U+1D7FF,
 * Mathematical Alphanumeric Symbols.
 *
 * Function wideCharacterFont takes a wide character as input and returns
 * the font information necessary to render it properly.
 */
var boldUpright = {
  mathClass: "mathbf",
  textClass: "textbf",
  font: "Main-Bold"
};
var italic = {
  mathClass: "mathnormal",
  textClass: "textit",
  font: "Math-Italic"
};
var boldItalic = {
  mathClass: "boldsymbol",
  textClass: "boldsymbol",
  font: "Main-BoldItalic"
};
var script = {
  mathClass: "mathscr",
  textClass: "textscr",
  font: "Script-Regular"
};
var noFont = {
  mathClass: "",
  textClass: "",
  font: ""
};
var fraktur = {
  mathClass: "mathfrak",
  textClass: "textfrak",
  font: "Fraktur-Regular"
};
var doubleStruck = {
  mathClass: "mathbb",
  textClass: "textbb",
  font: "AMS-Regular"
};
var boldFraktur = {
  mathClass: "mathboldfrak",
  textClass: "textboldfrak",
  font: "Fraktur-Regular"
};
var sansSerif = {
  mathClass: "mathsf",
  textClass: "textsf",
  font: "SansSerif-Regular"
};
var boldSansSerif = {
  mathClass: "mathboldsf",
  textClass: "textboldsf",
  font: "SansSerif-Bold"
};
var italicSansSerif = {
  mathClass: "mathitsf",
  textClass: "textitsf",
  font: "SansSerif-Italic"
};
var monospace = {
  mathClass: "mathtt",
  textClass: "texttt",
  font: "Typewriter-Regular"
};
/**
 * Data below is from https://www.unicode.org/charts/PDF/U1D400.pdf
 * That document sorts characters into groups by font type, say bold or italic.
 *
 * In the arrays below, each object consists of three properties:
 *      * The CSS class of that group when in math mode.
 *      * The CSS class of that group when in text mode.
 *      * The font name, so that KaTeX can get font metrics.
 */
var wideLatinLetterData = [boldUpright, boldUpright,
// A-Z, a-z
italic, italic,
// A-Z, a-z
boldItalic, boldItalic,
// A-Z, a-z
// Map fancy A-Z letters to script, not calligraphic.
// This aligns with unicode-math and math fonts (except Cambria Math).
script, noFont,
// A-Z script, a-z — no font
noFont, noFont,
// A-Z bold script, a-z bold script — no font
fraktur, fraktur,
// A-Z, a-z
doubleStruck, doubleStruck,
// A-Z double-struck, k double-struck
// Note that we are using a bold font, but font metrics for regular Fraktur.
boldFraktur, boldFraktur,
// A-Z, a-z
sansSerif, sansSerif,
// A-Z, a-z
boldSansSerif, boldSansSerif,
// A-Z, a-z
italicSansSerif, italicSansSerif,
// A-Z, a-z
noFont, noFont,
// A-Z bold italic sans, a-z bold italic sans - no font
monospace, monospace // A-Z, a-z
];
var wideNumeralData = [boldUpright,
// 0-9
noFont,
// 0-9 double-struck. No KaTeX font.
sansSerif,
// 0-9
boldSansSerif,
// 0-9
monospace // 0-9
];
var wideCharacterFont = wideChar => {
  // IE doesn't support codePointAt(). So work with the surrogate pair.
  var H = wideChar.charCodeAt(0); // high surrogate
  var L = wideChar.charCodeAt(1); // low surrogate
  var codePoint = (H - 0xD800) * 0x400 + (L - 0xDC00) + 0x10000;
  if (0x1D400 <= codePoint && codePoint < 0x1D6A4) {
    // wideLatinLetterData contains exactly 26 chars on each row.
    // So we can calculate the relevant row. No traverse necessary.
    var i = Math.floor((codePoint - 0x1D400) / 26);
    return wideLatinLetterData[i];
  } else if (0x1D7CE <= codePoint && codePoint <= 0x1D7FF) {
    // Numerals, ten per row.
    var _i = Math.floor((codePoint - 0x1D7CE) / 10);
    return wideNumeralData[_i];
  } else if (codePoint === 0x1D6A5 || codePoint === 0x1D6A6) {
    // dotless i or j
    return wideLatinLetterData[0];
  } else if (0x1D6A6 < codePoint && codePoint < 0x1D7CE) {
    // Greek letters. Not supported, yet.
    return noFont;
  } else {
    // We don't support any wide characters outside 1D400–1D7FF.
    throw new ParseError("Unsupported character: " + wideChar);
  }
};

/* eslint no-console:0 */
/**
 * Looks up the given symbol in fontMetrics, after applying any symbol
 * replacements defined in symbol.js
 */
var lookupSymbol = function lookupSymbol(value, fontName, mode) {
  // Replace the value with its replaced value from symbol.js
  if (symbols[mode][value]) {
    var replacement = symbols[mode][value].replace;
    if (replacement) {
      value = replacement;
    }
  }
  return {
    value,
    metrics: getCharacterMetrics(value, fontName, mode)
  };
};
/**
 * Makes a symbolNode after translation via the list of symbols in symbols.js.
 * Correctly pulls out metrics for the character, and optionally takes a list of
 * classes to be attached to the node.
 *
 * TODO: make argument order closer to makeSpan
 * TODO: add a separate argument for math class (e.g. `mop`, `mbin`), which
 * should if present come first in `classes`.
 * TODO(#953): Make `options` mandatory and always pass it in.
 */
var makeSymbol = function makeSymbol(value, fontName, mode, options, classes) {
  var lookup = lookupSymbol(value, fontName, mode);
  var metrics = lookup.metrics;
  value = lookup.value;
  var symbolNode;
  if (metrics) {
    var italic = metrics.italic;
    if (mode === "text" || options && options.font === "mathit") {
      italic = 0;
    }
    symbolNode = new SymbolNode(value, metrics.height, metrics.depth, italic, metrics.skew, metrics.width, classes);
  } else {
    // TODO(emily): Figure out a good way to only print this in development
    typeof console !== "undefined" && console.warn("No character metrics " + ("for '" + value + "' in style '" + fontName + "' and mode '" + mode + "'"));
    symbolNode = new SymbolNode(value, 0, 0, 0, 0, 0, classes);
  }
  if (options) {
    symbolNode.maxFontSize = options.sizeMultiplier;
    if (options.style.isTight()) {
      symbolNode.classes.push("mtight");
    }
    var color = options.getColor();
    if (color) {
      symbolNode.style.color = color;
    }
  }
  return symbolNode;
};
/**
 * Makes a symbol in Main-Regular or AMS-Regular.
 * Used for rel, bin, open, close, inner, and punct.
 */
var mathsym = function mathsym(value, mode, options, classes) {
  if (classes === void 0) {
    classes = [];
  }
  // Decide what font to render the symbol in by its entry in the symbols
  // table.
  // Have a special case for when the value = \ because the \ is used as a
  // textord in unsupported command errors but cannot be parsed as a regular
  // text ordinal and is therefore not present as a symbol in the symbols
  // table for text, as well as a special case for boldsymbol because it
  // can be used for bold + and -
  if (options.font === "boldsymbol" && lookupSymbol(value, "Main-Bold", mode).metrics) {
    return makeSymbol(value, "Main-Bold", mode, options, classes.concat(["mathbf"]));
  } else if (value === "\\" || symbols[mode][value].font === "main") {
    return makeSymbol(value, "Main-Regular", mode, options, classes);
  } else {
    return makeSymbol(value, "AMS-Regular", mode, options, classes.concat(["amsrm"]));
  }
};
/**
 * Determines which of the two font names (Main-Bold and Math-BoldItalic) and
 * corresponding style tags (mathbf or boldsymbol) to use for font "boldsymbol",
 * depending on the symbol.  Use this function instead of fontMap for font
 * "boldsymbol".
 */
var boldSymbol = function boldSymbol(value, mode, type) {
  if (type !== "textord" && lookupSymbol(value, "Math-BoldItalic", mode).metrics) {
    return {
      fontName: "Math-BoldItalic",
      fontClass: "boldsymbol"
    };
  } else {
    // Some glyphs do not exist in Math-BoldItalic so we need to use
    // Main-Bold instead.
    return {
      fontName: "Main-Bold",
      fontClass: "mathbf"
    };
  }
};
/**
 * Makes either a mathord or textord in the correct font and color.
 */
var makeOrd = function makeOrd(group, options, type) {
  var mode = group.mode;
  var text = group.text;
  var classes = ["mord"];
  var {
    font,
    fontFamily,
    fontWeight,
    fontShape
  } = options;
  // Math mode or Old font (i.e. \rm)
  var useFont = mode === "math" || mode === "text" && !!font;
  var fontOrFamily = useFont ? font : fontFamily;
  var wideFontName = "";
  var wideFontClass = "";
  if (text.charCodeAt(0) === 0xD835) {
    var wideCharData = wideCharacterFont(text);
    wideFontName = wideCharData.font;
    wideFontClass = wideCharData[mode + "Class"];
  }
  if (wideFontName) {
    // surrogate pairs get special treatment
    return makeSymbol(text, wideFontName, mode, options, classes.concat(wideFontClass));
  } else if (fontOrFamily) {
    var fontName;
    var fontClasses;
    if (fontOrFamily === "boldsymbol") {
      var fontData = boldSymbol(text, mode, type);
      fontName = fontData.fontName;
      fontClasses = [fontData.fontClass];
    } else if (useFont) {
      fontName = fontMap[font].fontName;
      fontClasses = [font];
    } else {
      fontName = retrieveTextFontName(fontFamily, fontWeight, fontShape);
      fontClasses = [fontFamily, fontWeight, fontShape];
    }
    if (lookupSymbol(text, fontName, mode).metrics) {
      return makeSymbol(text, fontName, mode, options, classes.concat(fontClasses));
    } else if (ligatures.hasOwnProperty(text) && fontName.slice(0, 10) === "Typewriter") {
      // Deconstruct ligatures in monospace fonts (\texttt, \tt).
      var parts = [];
      for (var i = 0; i < text.length; i++) {
        parts.push(makeSymbol(text[i], fontName, mode, options, classes.concat(fontClasses)));
      }
      return makeFragment(parts);
    }
  }
  // Makes a symbol in the default font for mathords and textords.
  if (type === "mathord") {
    return makeSymbol(text, "Math-Italic", mode, options, classes.concat(["mathnormal"]));
  } else if (type === "textord") {
    var _font = symbols[mode][text] && symbols[mode][text].font;
    if (_font === "ams") {
      var _fontName = retrieveTextFontName("amsrm", fontWeight, fontShape);
      return makeSymbol(text, _fontName, mode, options, classes.concat("amsrm", fontWeight, fontShape));
    } else if (_font === "main" || !_font) {
      var _fontName2 = retrieveTextFontName("textrm", fontWeight, fontShape);
      return makeSymbol(text, _fontName2, mode, options, classes.concat(fontWeight, fontShape));
    } else {
      // fonts added by plugins
      var _fontName3 = retrieveTextFontName(_font, fontWeight, fontShape);
      // We add font name as a css class
      return makeSymbol(text, _fontName3, mode, options, classes.concat(_fontName3, fontWeight, fontShape));
    }
  } else {
    throw new Error("unexpected type: " + type + " in makeOrd");
  }
};
/**
 * Returns true if subsequent symbolNodes have the same classes, skew, maxFont,
 * and styles. For mathnormal text, the left node must also have zero italic
 * correction so we don't lose spacing between combined glyphs.
 */
var canCombine = (prev, next) => {
  if (createClass(prev.classes) !== createClass(next.classes) || prev.skew !== next.skew || prev.maxFontSize !== next.maxFontSize || prev.italic !== 0 && prev.hasClass("mathnormal")) {
    return false;
  }
  // If prev and next both are just "mbin"s or "mord"s we don't combine them
  // so that the proper spacing can be preserved.
  if (prev.classes.length === 1) {
    var cls = prev.classes[0];
    if (cls === "mbin" || cls === "mord") {
      return false;
    }
  }
  for (var key of Object.keys(prev.style)) {
    if (prev.style[key] !== next.style[key]) {
      return false;
    }
  }
  for (var _key of Object.keys(next.style)) {
    if (prev.style[_key] !== next.style[_key]) {
      return false;
    }
  }
  return true;
};
/**
 * Combine consecutive domTree.symbolNodes into a single symbolNode.
 * Note: this function mutates the argument.
 */
var tryCombineChars = chars => {
  for (var i = 0; i < chars.length - 1; i++) {
    var prev = chars[i];
    var next = chars[i + 1];
    if (prev instanceof SymbolNode && next instanceof SymbolNode && canCombine(prev, next)) {
      prev.text += next.text;
      prev.height = Math.max(prev.height, next.height);
      prev.depth = Math.max(prev.depth, next.depth);
      // Use the last character's italic correction since we use
      // it to add padding to the right of the span created from
      // the combined characters.
      prev.italic = next.italic;
      chars.splice(i + 1, 1);
      i--;
    }
  }
  return chars;
};
/**
 * Calculate the height, depth, and maxFontSize of an element based on its
 * children.
 */
var sizeElementFromChildren = function sizeElementFromChildren(elem) {
  var height = 0;
  var depth = 0;
  var maxFontSize = 0;
  for (var i = 0; i < elem.children.length; i++) {
    var child = elem.children[i];
    if (child.height > height) {
      height = child.height;
    }
    if (child.depth > depth) {
      depth = child.depth;
    }
    if (child.maxFontSize > maxFontSize) {
      maxFontSize = child.maxFontSize;
    }
  }
  elem.height = height;
  elem.depth = depth;
  elem.maxFontSize = maxFontSize;
};
/**
 * Makes a span with the given list of classes, list of children, and options.
 *
 * TODO(#953): Ensure that `options` is always provided (currently some call
 * sites don't pass it) and make the type below mandatory.
 * TODO: add a separate argument for math class (e.g. `mop`, `mbin`), which
 * should if present come first in `classes`.
 */
var makeSpan = function makeSpan(classes, children, options, style) {
  var span = new Span(classes, children, options, style);
  sizeElementFromChildren(span);
  return span;
};
// SVG one is simpler -- doesn't require height, depth, max-font setting.
// This is also a separate method for typesafety.
var makeSvgSpan = (classes, children, options, style) => new Span(classes, children, options, style);
var makeLineSpan = function makeLineSpan(className, options, thickness) {
  var line = makeSpan([className], [], options);
  line.height = Math.max(thickness || options.fontMetrics().defaultRuleThickness, options.minRuleThickness);
  line.style.borderBottomWidth = makeEm(line.height);
  line.maxFontSize = 1.0;
  return line;
};
/**
 * Makes an anchor with the given href, list of classes, list of children,
 * and options.
 */
var makeAnchor = function makeAnchor(href, classes, children, options) {
  var anchor = new Anchor(href, classes, children, options);
  sizeElementFromChildren(anchor);
  return anchor;
};
/**
 * Makes a document fragment with the given list of children.
 */
var makeFragment = function makeFragment(children) {
  var fragment = new DocumentFragment(children);
  sizeElementFromChildren(fragment);
  return fragment;
};
/**
 * Wraps group in a span if it's a document fragment, allowing to apply classes
 * and styles
 */
var wrapFragment = function wrapFragment(group, options) {
  if (group instanceof DocumentFragment) {
    return makeSpan([], [group], options);
  }
  return group;
};
// Computes the updated `children` list and the overall depth.
//
// This helper function for makeVList makes it easier to enforce type safety by
// allowing early exits (returns) in the logic.
var getVListChildrenAndDepth = function getVListChildrenAndDepth(params) {
  if (params.positionType === "individualShift") {
    var oldChildren = params.children;
    var children = [oldChildren[0]];
    // Add in kerns to the list of params.children to get each element to be
    // shifted to the correct specified shift
    var _depth = -oldChildren[0].shift - oldChildren[0].elem.depth;
    var currPos = _depth;
    for (var i = 1; i < oldChildren.length; i++) {
      var diff = -oldChildren[i].shift - currPos - oldChildren[i].elem.depth;
      var size = diff - (oldChildren[i - 1].elem.height + oldChildren[i - 1].elem.depth);
      currPos = currPos + diff;
      children.push({
        type: "kern",
        size
      });
      children.push(oldChildren[i]);
    }
    return {
      children,
      depth: _depth
    };
  }
  var depth;
  if (params.positionType === "top") {
    // We always start at the bottom, so calculate the bottom by adding up
    // all the sizes
    var bottom = params.positionData;
    for (var _i = 0; _i < params.children.length; _i++) {
      var child = params.children[_i];
      bottom -= child.type === "kern" ? child.size : child.elem.height + child.elem.depth;
    }
    depth = bottom;
  } else if (params.positionType === "bottom") {
    depth = -params.positionData;
  } else {
    var firstChild = params.children[0];
    if (firstChild.type !== "elem") {
      throw new Error('First child must have type "elem".');
    }
    if (params.positionType === "shift") {
      depth = -firstChild.elem.depth - params.positionData;
    } else if (params.positionType === "firstBaseline") {
      depth = -firstChild.elem.depth;
    } else {
      throw new Error("Invalid positionType " + params.positionType + ".");
    }
  }
  return {
    children: params.children,
    depth
  };
};
/**
 * Makes a vertical list by stacking elements and kerns on top of each other.
 * Allows for many different ways of specifying the positioning method.
 *
 * See VListParam documentation above.
 */
var makeVList = function makeVList(params, options) {
  var {
    children,
    depth
  } = getVListChildrenAndDepth(params);
  // Create a strut that is taller than any list item. The strut is added to
  // each item, where it will determine the item's baseline. Since it has
  // `overflow:hidden`, the strut's top edge will sit on the item's line box's
  // top edge and the strut's bottom edge will sit on the item's baseline,
  // with no additional line-height spacing. This allows the item baseline to
  // be positioned precisely without worrying about font ascent and
  // line-height.
  var pstrutSize = 0;
  for (var i = 0; i < children.length; i++) {
    var child = children[i];
    if (child.type === "elem") {
      var elem = child.elem;
      pstrutSize = Math.max(pstrutSize, elem.maxFontSize, elem.height);
    }
  }
  pstrutSize += 2;
  var pstrut = makeSpan(["pstrut"], []);
  pstrut.style.height = makeEm(pstrutSize);
  // Create a new list of actual children at the correct offsets
  var realChildren = [];
  var minPos = depth;
  var maxPos = depth;
  var currPos = depth;
  for (var _i2 = 0; _i2 < children.length; _i2++) {
    var _child = children[_i2];
    if (_child.type === "kern") {
      currPos += _child.size;
    } else {
      var _elem = _child.elem;
      var classes = _child.wrapperClasses || [];
      var style = _child.wrapperStyle || {};
      var childWrap = makeSpan(classes, [pstrut, _elem], undefined, style);
      childWrap.style.top = makeEm(-pstrutSize - currPos - _elem.depth);
      if (_child.marginLeft) {
        childWrap.style.marginLeft = _child.marginLeft;
      }
      if (_child.marginRight) {
        childWrap.style.marginRight = _child.marginRight;
      }
      realChildren.push(childWrap);
      currPos += _elem.height + _elem.depth;
    }
    minPos = Math.min(minPos, currPos);
    maxPos = Math.max(maxPos, currPos);
  }
  // The vlist contents go in a table-cell with `vertical-align:bottom`.
  // This cell's bottom edge will determine the containing table's baseline
  // without overly expanding the containing line-box.
  var vlist = makeSpan(["vlist"], realChildren);
  vlist.style.height = makeEm(maxPos);
  // A second row is used if necessary to represent the vlist's depth.
  var rows;
  if (minPos < 0) {
    // We will define depth in an empty span with display: table-cell.
    // It should render with the height that we define. But Chrome, in
    // contenteditable mode only, treats that span as if it contains some
    // text content. And that min-height over-rides our desired height.
    // So we put another empty span inside the depth strut span.
    var emptySpan = makeSpan([], []);
    var depthStrut = makeSpan(["vlist"], [emptySpan]);
    depthStrut.style.height = makeEm(-minPos);
    // Safari wants the first row to have inline content; otherwise it
    // puts the bottom of the *second* row on the baseline.
    var topStrut = makeSpan(["vlist-s"], [new SymbolNode("\u200b")]);
    rows = [makeSpan(["vlist-r"], [vlist, topStrut]), makeSpan(["vlist-r"], [depthStrut])];
  } else {
    rows = [makeSpan(["vlist-r"], [vlist])];
  }
  var vtable = makeSpan(["vlist-t"], rows);
  if (rows.length === 2) {
    vtable.classes.push("vlist-t2");
  }
  vtable.height = maxPos;
  vtable.depth = -minPos;
  return vtable;
};
// Glue is a concept from TeX which is a flexible space between elements in
// either a vertical or horizontal list. In KaTeX, at least for now, it's
// static space between elements in a horizontal layout.
var makeGlue = (measurement, options) => {
  // Make an empty span for the space
  var rule = makeSpan(["mspace"], [], options);
  var size = calculateSize(measurement, options);
  rule.style.marginRight = makeEm(size);
  return rule;
};
// Takes font options, and returns the appropriate fontLookup name
var retrieveTextFontName = (fontFamily, fontWeight, fontShape) => {
  var baseFontName;
  var fontStylesName;
  switch (fontFamily) {
    case "amsrm":
      baseFontName = "AMS";
      break;
    case "textrm":
      baseFontName = "Main";
      break;
    case "textsf":
      baseFontName = "SansSerif";
      break;
    case "texttt":
      baseFontName = "Typewriter";
      break;
    default:
      baseFontName = fontFamily;
    // use fonts added by a plugin
  }
  if (fontWeight === "textbf" && fontShape === "textit") {
    fontStylesName = "BoldItalic";
  } else if (fontWeight === "textbf") {
    fontStylesName = "Bold";
  } else if (fontShape === "textit") {
    fontStylesName = "Italic";
  } else {
    fontStylesName = "Regular";
  }
  return baseFontName + "-" + fontStylesName;
};
/**
 * Maps TeX font commands to objects containing:
 * - variant: string used for "mathvariant" attribute in buildMathML.js
 * - fontName: the "style" parameter to fontMetrics.getCharacterMetrics
 */
// A map between tex font commands an MathML mathvariant attribute values
var fontMap = {
  // styles
  "mathbf": {
    variant: "bold",
    fontName: "Main-Bold"
  },
  "mathrm": {
    variant: "normal",
    fontName: "Main-Regular"
  },
  "textit": {
    variant: "italic",
    fontName: "Main-Italic"
  },
  "mathit": {
    variant: "italic",
    fontName: "Main-Italic"
  },
  "mathnormal": {
    variant: "italic",
    fontName: "Math-Italic"
  },
  "mathsfit": {
    variant: "sans-serif-italic",
    fontName: "SansSerif-Italic"
  },
  // "boldsymbol" is missing because they require the use of multiple fonts:
  // Math-BoldItalic and Main-Bold.  This is handled by a special case in
  // makeOrd which ends up calling boldsymbol.
  // families
  "mathbb": {
    variant: "double-struck",
    fontName: "AMS-Regular"
  },
  "mathcal": {
    variant: "script",
    fontName: "Caligraphic-Regular"
  },
  "mathfrak": {
    variant: "fraktur",
    fontName: "Fraktur-Regular"
  },
  "mathscr": {
    variant: "script",
    fontName: "Script-Regular"
  },
  "mathsf": {
    variant: "sans-serif",
    fontName: "SansSerif-Regular"
  },
  "mathtt": {
    variant: "monospace",
    fontName: "Typewriter-Regular"
  }
};
var svgData = {
  //   path, width, height
  vec: ["vec", 0.471, 0.714],
  // values from the font glyph
  oiintSize1: ["oiintSize1", 0.957, 0.499],
  // oval to overlay the integrand
  oiintSize2: ["oiintSize2", 1.472, 0.659],
  oiiintSize1: ["oiiintSize1", 1.304, 0.499],
  oiiintSize2: ["oiiintSize2", 1.98, 0.659]
};
var staticSvg = function staticSvg(value, options) {
  // Create a span with inline SVG for the element.
  var [pathName, width, height] = svgData[value];
  var path = new PathNode(pathName);
  var svgNode = new SvgNode([path], {
    "width": makeEm(width),
    "height": makeEm(height),
    // Override CSS rule `.katex svg { width: 100% }`
    "style": "width:" + makeEm(width),
    "viewBox": "0 0 " + 1000 * width + " " + 1000 * height,
    "preserveAspectRatio": "xMinYMin"
  });
  var span = makeSvgSpan(["overlay"], [svgNode], options);
  span.height = height;
  span.style.height = makeEm(height);
  span.style.width = makeEm(width);
  return span;
};

var thinspace = {
  number: 3,
  unit: "mu"
};
var mediumspace = {
  number: 4,
  unit: "mu"
};
var thickspace = {
  number: 5,
  unit: "mu"
};
// Spacing relationships for display and text styles
var spacings = {
  mord: {
    mop: thinspace,
    mbin: mediumspace,
    mrel: thickspace,
    minner: thinspace
  },
  mop: {
    mord: thinspace,
    mop: thinspace,
    mrel: thickspace,
    minner: thinspace
  },
  mbin: {
    mord: mediumspace,
    mop: mediumspace,
    mopen: mediumspace,
    minner: mediumspace
  },
  mrel: {
    mord: thickspace,
    mop: thickspace,
    mopen: thickspace,
    minner: thickspace
  },
  mopen: {},
  mclose: {
    mop: thinspace,
    mbin: mediumspace,
    mrel: thickspace,
    minner: thinspace
  },
  mpunct: {
    mord: thinspace,
    mop: thinspace,
    mrel: thickspace,
    mopen: thinspace,
    mclose: thinspace,
    mpunct: thinspace,
    minner: thinspace
  },
  minner: {
    mord: thinspace,
    mop: thinspace,
    mbin: mediumspace,
    mrel: thickspace,
    mopen: thinspace,
    mpunct: thinspace,
    minner: thinspace
  }
};
// Spacing relationships for script and scriptscript styles
var tightSpacings = {
  mord: {
    mop: thinspace
  },
  mop: {
    mord: thinspace,
    mop: thinspace
  },
  mbin: {},
  mrel: {},
  mopen: {},
  mclose: {
    mop: thinspace
  },
  mpunct: {},
  minner: {
    mop: thinspace
  }
};

/**
 * All registered functions.
 * `functions.js` just exports this same dictionary again and makes it public.
 * `Parser.js` requires this dictionary.
 */
var _functions = {};
/**
 * All HTML builders. Should be only used in the `define*` and the `build*ML`
 * functions.
 *
 * Builders for different node types are stored side by side, but
 * `HtmlBuilder<T>` is contravariant in `T`, so there is no single type
 * argument that makes storing/retrieving them typecheck.  `any` is used
 * as an existential-quantifier escape hatch.
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
var _htmlGroupBuilders = {};
/**
 * All MathML builders. Should be only used in the `define*` and the `build*ML`
 * functions.  See `_htmlGroupBuilders` above for the rationale behind `any`.
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
var _mathmlGroupBuilders = {};
function defineFunction(_ref) {
  var {
    type,
    names,
    props,
    handler,
    htmlBuilder,
    mathmlBuilder
  } = _ref;
  // Set default values of functions
  var data = {
    type,
    numArgs: props.numArgs,
    argTypes: props.argTypes,
    allowedInArgument: !!props.allowedInArgument,
    allowedInText: !!props.allowedInText,
    allowedInMath: props.allowedInMath === undefined ? true : props.allowedInMath,
    numOptionalArgs: props.numOptionalArgs || 0,
    infix: !!props.infix,
    primitive: !!props.primitive,
    handler
  };
  for (var i = 0; i < names.length; ++i) {
    _functions[names[i]] = data;
  }
  if (type) {
    if (htmlBuilder) {
      _htmlGroupBuilders[type] = htmlBuilder;
    }
    if (mathmlBuilder) {
      _mathmlGroupBuilders[type] = mathmlBuilder;
    }
  }
}
/**
 * Use this to register only the HTML and MathML builders for a function (e.g.
 * if the function's ParseNode is generated in Parser.js rather than via a
 * stand-alone handler provided to `defineFunction`).
 */
function defineFunctionBuilders(_ref2) {
  var {
    type,
    htmlBuilder,
    mathmlBuilder
  } = _ref2;
  defineFunction({
    type,
    names: [],
    props: {
      numArgs: 0
    },
    handler() {
      throw new Error('Should never be called.');
    },
    htmlBuilder,
    mathmlBuilder
  });
}
var normalizeArgument = function normalizeArgument(arg) {
  return arg.type === "ordgroup" && arg.body.length === 1 ? arg.body[0] : arg;
};
// Since the corresponding buildHTML/buildMathML function expects a
// list of elements, we normalize for different kinds of arguments
var ordargument = function ordargument(arg) {
  return arg.type === "ordgroup" ? arg.body : [arg];
};

/**
 * This file does the main work of building a domTree structure from a parse
 * tree. The entry point is the `buildHTML` function, which takes a parse tree.
 * Then, the buildExpression, buildGroup, and various groupBuilders functions
 * are called, to produce a final HTML tree.
 */
// Binary atoms (first class `mbin`) change into ordinary atoms (`mord`)
// depending on their surroundings. See TeXbook pg. 442-446, Rules 5 and 6,
// and the text before Rule 19.
var binLeftCanceller = new Set(["leftmost", "mbin", "mopen", "mrel", "mop", "mpunct"]);
var binRightCanceller = new Set(["rightmost", "mrel", "mclose", "mpunct"]);
var styleMap$1 = {
  "display": Style$1.DISPLAY,
  "text": Style$1.TEXT,
  "script": Style$1.SCRIPT,
  "scriptscript": Style$1.SCRIPTSCRIPT
};
var DomEnum = {
  mord: "mord",
  mop: "mop",
  mbin: "mbin",
  mrel: "mrel",
  mopen: "mopen",
  mclose: "mclose",
  mpunct: "mpunct",
  minner: "minner"
};
/**
 * Take a list of nodes, build them in order, and return a list of the built
 * nodes. documentFragments are flattened into their contents, so the
 * returned list contains no fragments. `isRealGroup` is true if `expression`
 * is a real group (no atoms will be added on either side), as opposed to
 * a partial group (e.g. one created by \color). `surrounding` is an array
 * consisting type of nodes that will be added to the left and right.
 */
var buildExpression$1 = function buildExpression(expression, options, isRealGroup, surrounding) {
  if (surrounding === void 0) {
    surrounding = [null, null];
  }
  // Parse expressions into `groups`.
  var groups = [];
  for (var i = 0; i < expression.length; i++) {
    var output = buildGroup$1(expression[i], options);
    if (output instanceof DocumentFragment) {
      var children = output.children;
      groups.push(...children);
    } else {
      groups.push(output);
    }
  }
  // Combine consecutive domTree.symbolNodes into a single symbolNode.
  tryCombineChars(groups);
  // If `expression` is a partial group, let the parent handle spacings
  // to avoid processing groups multiple times.
  if (!isRealGroup) {
    return groups;
  }
  var glueOptions = options;
  if (expression.length === 1) {
    var node = expression[0];
    if (node.type === "sizing") {
      glueOptions = options.havingSize(node.size);
    } else if (node.type === "styling") {
      glueOptions = options.havingStyle(styleMap$1[node.style]);
    }
  }
  // Dummy spans for determining spacings between surrounding atoms.
  // If `expression` has no atoms on the left or right, class "leftmost"
  // or "rightmost", respectively, is used to indicate it.
  var dummyPrev = makeSpan([surrounding[0] || "leftmost"], [], options);
  var dummyNext = makeSpan([surrounding[1] || "rightmost"], [], options);
  // TODO: These code assumes that a node's math class is the first element
  // of its `classes` array. A later cleanup should ensure this, for
  // instance by changing the signature of `makeSpan`.
  // Before determining what spaces to insert, perform bin cancellation.
  // Binary operators change to ordinary symbols in some contexts.
  var isRoot = isRealGroup === "root";
  _traverseNonSpaceNodes(groups, (node, prev) => {
    var prevType = prev.classes[0];
    var type = node.classes[0];
    if (prevType === "mbin" && binRightCanceller.has(type)) {
      prev.classes[0] = "mord";
    } else if (type === "mbin" && binLeftCanceller.has(prevType)) {
      node.classes[0] = "mord";
    }
  }, {
    node: dummyPrev
  }, dummyNext, isRoot);
  _traverseNonSpaceNodes(groups, (node, prev) => {
    var _tightSpacings$prevTy, _spacings$prevType;
    var prevType = getTypeOfDomTree(prev);
    var type = getTypeOfDomTree(node);
    // 'mtight' indicates that the node is script or scriptscript style.
    var space = prevType && type ? node.hasClass("mtight") ? (_tightSpacings$prevTy = tightSpacings[prevType]) == null ? void 0 : _tightSpacings$prevTy[type] : (_spacings$prevType = spacings[prevType]) == null ? void 0 : _spacings$prevType[type] : null;
    if (space) {
      // Insert glue (spacing) after the `prev`.
      return makeGlue(space, glueOptions);
    }
  }, {
    node: dummyPrev
  }, dummyNext, isRoot);
  return groups;
};
// Depth-first traverse non-space `nodes`, calling `callback` with the current and
// previous node as arguments, optionally returning a node to insert after the
// previous node. `prev` is an object with the previous node and `insertAfter`
// function to insert after it. `next` is a node that will be added to the right.
// Used for bin cancellation and inserting spacings.
var _traverseNonSpaceNodes = function traverseNonSpaceNodes(nodes, callback, prev, next, isRoot) {
  if (next) {
    // temporarily append the right node, if exists
    nodes.push(next);
  }
  var i = 0;
  for (; i < nodes.length; i++) {
    var node = nodes[i];
    var partialGroup = checkPartialGroup(node);
    if (partialGroup) {
      // Recursive DFS
      // TODO(ts): partialGroup.children is ReadonlyArray but this
      // function mutates the array (insertAfter splices into it).
      _traverseNonSpaceNodes(partialGroup.children, callback, prev, null, isRoot);
      continue;
    }
    // Ignore explicit spaces (e.g., \;, \,) when determining what implicit
    // spacing should go between atoms of different classes
    var nonspace = !node.hasClass("mspace");
    if (nonspace) {
      var result = callback(node, prev.node);
      if (result) {
        if (prev.insertAfter) {
          prev.insertAfter(result);
        } else {
          // insert at front
          nodes.unshift(result);
          i++;
        }
      }
    }
    if (nonspace) {
      prev.node = node;
    } else if (isRoot && node.hasClass("newline")) {
      prev.node = makeSpan(["leftmost"]); // treat like beginning of line
    }
    prev.insertAfter = (index => n => {
      nodes.splice(index + 1, 0, n);
      i++;
    })(i);
  }
  if (next) {
    nodes.pop();
  }
};
// Check if given node is a partial group, i.e., does not affect spacing around.
var checkPartialGroup = function checkPartialGroup(node) {
  if (node instanceof DocumentFragment || node instanceof Anchor || node instanceof Span && node.hasClass("enclosing")) {
    return node;
  }
  return null;
};
// Return the outermost node of a domTree.
var _getOutermostNode = function getOutermostNode(node, side) {
  var partialGroup = checkPartialGroup(node);
  if (partialGroup) {
    var children = partialGroup.children;
    if (children.length) {
      if (side === "right") {
        return _getOutermostNode(children[children.length - 1], "right");
      } else if (side === "left") {
        return _getOutermostNode(children[0], "left");
      }
    }
  }
  return node;
};
// Return math atom class (mclass) of a domTree.
// If `side` is given, it will get the type of the outermost node at given side.
var getTypeOfDomTree = function getTypeOfDomTree(node, side) {
  if (!node) {
    return null;
  }
  if (side) {
    node = _getOutermostNode(node, side);
  }
  // This makes a lot of assumptions as to where the type of atom
  // appears.  We should do a better job of enforcing this.
  var className = node.classes[0];
  return DomEnum[className] || null;
};
var makeNullDelimiter = function makeNullDelimiter(options, classes) {
  var moreClasses = ["nulldelimiter"].concat(options.baseSizingClasses());
  return makeSpan(classes.concat(moreClasses));
};
/**
 * buildGroup is the function that takes a group and calls the correct groupType
 * function for it. It also handles the interaction of size and style changes
 * between parents and children.
 */
var buildGroup$1 = function buildGroup(group, options, baseOptions) {
  if (!group) {
    return makeSpan();
  }
  if (_htmlGroupBuilders[group.type]) {
    // TODO(ts): groupBuilders is Record<string, HtmlBuilder<any>>;
    // a type-safe registry would need a mapped type keyed by NodeType.
    var groupNode = _htmlGroupBuilders[group.type](group, options);
    // If the size changed between the parent and the current group, account
    // for that size difference.
    if (baseOptions && options.size !== baseOptions.size) {
      groupNode = makeSpan(options.sizingClasses(baseOptions), [groupNode], options);
      var multiplier = options.sizeMultiplier / baseOptions.sizeMultiplier;
      groupNode.height *= multiplier;
      groupNode.depth *= multiplier;
    }
    return groupNode;
  } else {
    throw new ParseError("Got group of unknown type: '" + group.type + "'");
  }
};
/**
 * Combine an array of HTML DOM nodes (e.g., the output of `buildExpression`)
 * into an unbreakable HTML node of class .base, with proper struts to
 * guarantee correct vertical extent.  `buildHTML` calls this repeatedly to
 * make up the entire expression as a sequence of unbreakable units.
 */
function buildHTMLUnbreakable(children, options) {
  // Compute height and depth of this chunk.
  var body = makeSpan(["base"], children, options);
  // Add strut, which ensures that the top of the HTML element falls at
  // the height of the expression, and the bottom of the HTML element
  // falls at the depth of the expression.
  var strut = makeSpan(["strut"]);
  strut.style.height = makeEm(body.height + body.depth);
  if (body.depth) {
    strut.style.verticalAlign = makeEm(-body.depth);
  }
  body.children.unshift(strut);
  return body;
}
/**
 * Take an entire parse tree, and build it into an appropriate set of HTML
 * nodes.
 */
function buildHTML(tree, options) {
  // Strip off outer tag wrapper for processing below.
  var tag = null;
  if (tree.length === 1 && tree[0].type === "tag") {
    tag = tree[0].tag;
    tree = tree[0].body;
  }
  // Build the expression contained in the tree
  var expression = buildExpression$1(tree, options, "root");
  var eqnNum;
  if (expression.length === 2 && expression[1].hasClass("tag")) {
    // An environment with automatic equation numbers, e.g. {gather}.
    eqnNum = expression.pop();
  }
  var children = [];
  // Create one base node for each chunk between potential line breaks.
  // The TeXBook [p.173] says "A formula will be broken only after a
  // relation symbol like $=$ or $<$ or $\rightarrow$, or after a binary
  // operation symbol like $+$ or $-$ or $\times$, where the relation or
  // binary operation is on the ``outer level'' of the formula (i.e., not
  // enclosed in {...} and not part of an \over construction)."
  var parts = [];
  for (var i = 0; i < expression.length; i++) {
    parts.push(expression[i]);
    if (expression[i].hasClass("mbin") || expression[i].hasClass("mrel") || expression[i].hasClass("allowbreak")) {
      // Put any post-operator glue on same line as operator.
      // Watch for \nobreak along the way, and stop at \newline.
      var nobreak = false;
      while (i < expression.length - 1 && expression[i + 1].hasClass("mspace") && !expression[i + 1].hasClass("newline")) {
        i++;
        parts.push(expression[i]);
        if (expression[i].hasClass("nobreak")) {
          nobreak = true;
        }
      }
      // Don't allow break if \nobreak among the post-operator glue.
      if (!nobreak) {
        children.push(buildHTMLUnbreakable(parts, options));
        parts = [];
      }
    } else if (expression[i].hasClass("newline")) {
      // Write the line except the newline
      parts.pop();
      if (parts.length > 0) {
        children.push(buildHTMLUnbreakable(parts, options));
        parts = [];
      }
      // Put the newline at the top level
      children.push(expression[i]);
    }
  }
  if (parts.length > 0) {
    children.push(buildHTMLUnbreakable(parts, options));
  }
  // Now, if there was a tag, build it too and append it as a final child.
  var tagChild;
  if (tag) {
    tagChild = buildHTMLUnbreakable(buildExpression$1(tag, options, true), options);
    tagChild.classes = ["tag"];
    children.push(tagChild);
  } else if (eqnNum) {
    children.push(eqnNum);
  }
  var htmlNode = makeSpan(["katex-html"], children);
  htmlNode.setAttribute("aria-hidden", "true");
  // Adjust the strut of the tag to be the maximum height of all children
  // (the height of the enclosing htmlNode) for proper vertical alignment.
  if (tagChild) {
    var strut = tagChild.children[0];
    strut.style.height = makeEm(htmlNode.height + htmlNode.depth);
    if (htmlNode.depth) {
      strut.style.verticalAlign = makeEm(-htmlNode.depth);
    }
  }
  return htmlNode;
}

/**
 * These objects store data about MathML nodes. This is the MathML equivalent
 * of the types in domTree.js. Since MathML handles its own rendering, and
 * since we're mainly using MathML to improve accessibility, we don't manage
 * any of the styling state that the plain DOM nodes do.
 *
 * The `toNode` and `toMarkup` functions work similarly to how they do in
 * domTree.js, creating namespaced DOM nodes and HTML text markup respectively.
 */
function newDocumentFragment(children) {
  return new DocumentFragment(children);
}
/**
 * This node represents a general purpose MathML node of any type. The
 * constructor requires the type of node to create (for example, `"mo"` or
 * `"mspace"`, corresponding to `<mo>` and `<mspace>` tags).
 */
class MathNode {
  constructor(type, children, classes) {
    this.type = void 0;
    this.attributes = void 0;
    this.children = void 0;
    this.classes = void 0;
    this.type = type;
    this.attributes = {};
    this.children = children || [];
    this.classes = classes || [];
  }
  /**
   * Sets an attribute on a MathML node. MathML depends on attributes to convey a
   * semantic content, so this is used heavily.
   */
  setAttribute(name, value) {
    this.attributes[name] = value;
  }
  /**
   * Gets an attribute on a MathML node.
   */
  getAttribute(name) {
    return this.attributes[name];
  }
  /**
   * Converts the math node into a MathML-namespaced DOM element.
   */
  toNode() {
    var node = document.createElementNS("http://www.w3.org/1998/Math/MathML", this.type);
    for (var attr in this.attributes) {
      if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
        node.setAttribute(attr, this.attributes[attr]);
      }
    }
    if (this.classes.length > 0) {
      node.className = createClass(this.classes);
    }
    for (var i = 0; i < this.children.length; i++) {
      // Combine multiple TextNodes into one TextNode, to prevent
      // screen readers from reading each as a separate word [#3995]
      if (this.children[i] instanceof TextNode && this.children[i + 1] instanceof TextNode) {
        var text = this.children[i].toText() + this.children[++i].toText();
        while (this.children[i + 1] instanceof TextNode) {
          text += this.children[++i].toText();
        }
        node.appendChild(new TextNode(text).toNode());
      } else {
        node.appendChild(this.children[i].toNode());
      }
    }
    return node;
  }
  /**
   * Converts the math node into an HTML markup string.
   */
  toMarkup() {
    var markup = "<" + this.type;
    // Add the attributes
    for (var attr in this.attributes) {
      if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
        markup += " " + attr + "=\"";
        markup += escape(this.attributes[attr]);
        markup += "\"";
      }
    }
    if (this.classes.length > 0) {
      markup += " class =\"" + escape(createClass(this.classes)) + "\"";
    }
    markup += ">";
    for (var i = 0; i < this.children.length; i++) {
      markup += this.children[i].toMarkup();
    }
    markup += "</" + this.type + ">";
    return markup;
  }
  /**
   * Converts the math node into a string, similar to innerText, but escaped.
   */
  toText() {
    return this.children.map(child => child.toText()).join("");
  }
}
/**
 * This node represents a piece of text.
 */
class TextNode {
  constructor(text) {
    this.text = void 0;
    this.text = text;
  }
  /**
   * Converts the text node into a DOM text node.
   */
  toNode() {
    return document.createTextNode(this.text);
  }
  /**
   * Converts the text node into escaped HTML markup
   * (representing the text itself).
   */
  toMarkup() {
    return escape(this.toText());
  }
  /**
   * Converts the text node into a string
   * (representing the text itself).
   */
  toText() {
    return this.text;
  }
}
/**
 * This node represents a space, but may render as <mspace.../> or as text,
 * depending on the width.
 */
class SpaceNode {
  /**
   * Create a Space node with width given in CSS ems.
   */
  constructor(width) {
    this.width = void 0;
    this.character = void 0;
    this.width = width;
    // See https://www.w3.org/TR/2000/WD-MathML2-20000328/chapter6.html
    // for a table of space-like characters.  We use Unicode
    // representations instead of &LongNames; as it's not clear how to
    // make the latter via document.createTextNode.
    if (width >= 0.05555 && width <= 0.05556) {
      this.character = "\u200a"; // &VeryThinSpace;
    } else if (width >= 0.1666 && width <= 0.1667) {
      this.character = "\u2009"; // &ThinSpace;
    } else if (width >= 0.2222 && width <= 0.2223) {
      this.character = "\u2005"; // &MediumSpace;
    } else if (width >= 0.2777 && width <= 0.2778) {
      this.character = "\u2005\u200a"; // &ThickSpace;
    } else if (width >= -0.05556 && width <= -0.05555) {
      this.character = "\u200a\u2063"; // &NegativeVeryThinSpace;
    } else if (width >= -0.1667 && width <= -0.1666) {
      this.character = "\u2009\u2063"; // &NegativeThinSpace;
    } else if (width >= -0.2223 && width <= -0.2222) {
      this.character = "\u205f\u2063"; // &NegativeMediumSpace;
    } else if (width >= -0.2778 && width <= -0.2777) {
      this.character = "\u2005\u2063"; // &NegativeThickSpace;
    } else {
      this.character = null;
    }
  }
  /**
   * Converts the math node into a MathML-namespaced DOM element.
   */
  toNode() {
    if (this.character) {
      return document.createTextNode(this.character);
    } else {
      var node = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mspace");
      node.setAttribute("width", makeEm(this.width));
      return node;
    }
  }
  /**
   * Converts the math node into an HTML markup string.
   */
  toMarkup() {
    if (this.character) {
      return "<mtext>" + this.character + "</mtext>";
    } else {
      return "<mspace width=\"" + makeEm(this.width) + "\"/>";
    }
  }
  /**
   * Converts the math node into a string, similar to innerText.
   */
  toText() {
    if (this.character) {
      return this.character;
    } else {
      return " ";
    }
  }
}

/**
 * This file converts a parse tree into a corresponding MathML tree. The main
 * entry point is the `buildMathML` function, which takes a parse tree from the
 * parser.
 */
var noVariantSymbols = new Set(["\\imath", "\\jmath"]);
var rowLikeTypes = new Set(["mrow", "mtable"]);
/**
 * Takes a symbol and converts it into a MathML text node after performing
 * optional replacement from symbols.js.
 */
var makeText = function makeText(text, mode, options) {
  if (symbols[mode][text] && symbols[mode][text].replace && text.charCodeAt(0) !== 0xD835 && !(ligatures.hasOwnProperty(text) && options && (options.fontFamily && options.fontFamily.slice(4, 6) === "tt" || options.font && options.font.slice(4, 6) === "tt"))) {
    text = symbols[mode][text].replace;
  }
  return new TextNode(text);
};
/**
 * Wrap the given array of nodes in an <mrow> node if needed, i.e.,
 * unless the array has length 1.  Always returns a single node.
 */
var makeRow = function makeRow(body) {
  if (body.length === 1) {
    return body[0];
  } else {
    return new MathNode("mrow", body);
  }
};
var mathFontVariants = {
  mathit: "italic",
  boldsymbol: group => group.type === "textord" ? "bold" : "bold-italic",
  mathbf: "bold",
  mathbb: "double-struck",
  mathsfit: "sans-serif-italic",
  mathfrak: "fraktur",
  mathscr: "script",
  mathcal: "script",
  mathsf: "sans-serif",
  mathtt: "monospace"
};
/**
 * Returns the math variant as a string or null if none is required.
 */
var getVariant = (group, options) => {
  // Handle \text... font specifiers as best we can.
  // MathML has a limited list of allowable mathvariant specifiers; see
  // https://www.w3.org/TR/MathML3/chapter3.html#presm.commatt
  if (group.mode === "text") {
    if (options.fontFamily === "texttt") {
      return "monospace";
    } else if (options.fontFamily === "textsf") {
      if (options.fontShape === "textit" && options.fontWeight === "textbf") {
        return "sans-serif-bold-italic";
      } else if (options.fontShape === "textit") {
        return "sans-serif-italic";
      } else if (options.fontWeight === "textbf") {
        return "bold-sans-serif";
      } else {
        return "sans-serif";
      }
    } else if (options.fontShape === "textit" && options.fontWeight === "textbf") {
      return "bold-italic";
    } else if (options.fontShape === "textit") {
      return "italic";
    } else if (options.fontWeight === "textbf") {
      return "bold";
    }
  }
  var font = options.font;
  if (!font || font === "mathnormal") {
    return null;
  }
  var mode = group.mode;
  var mathVariant = mathFontVariants[font];
  if (mathVariant) {
    return typeof mathVariant === "function" ? mathVariant(group) : mathVariant;
  }
  var text = group.text;
  if (noVariantSymbols.has(text)) {
    return null;
  }
  if (symbols[mode][text]) {
    var replacement = symbols[mode][text].replace;
    if (replacement) {
      text = replacement;
    }
  }
  var fontName = fontMap[font].fontName;
  if (getCharacterMetrics(text, fontName, mode)) {
    return fontMap[font].variant;
  }
  return null;
};
/**
 * Check for <mi>.</mi> which is how a dot renders in MathML,
 * or <mo separator="true" lspace="0em" rspace="0em">,</mo>
 * which is how a braced comma {,} renders in MathML
 */
function isNumberPunctuation(group) {
  if (!group) {
    return false;
  }
  if (group.type === 'mi' && group.children.length === 1) {
    var child = group.children[0];
    return child instanceof TextNode && child.text === '.';
  } else if (group.type === 'mo' && group.children.length === 1 && group.getAttribute('separator') === 'true' && group.getAttribute('lspace') === '0em' && group.getAttribute('rspace') === '0em') {
    var _child = group.children[0];
    return _child instanceof TextNode && _child.text === ',';
  } else {
    return false;
  }
}
/**
 * Takes a list of nodes, builds them, and returns a list of the generated
 * MathML nodes.  Also combine consecutive <mtext> outputs into a single
 * <mtext> tag.
 */
var buildExpression = function buildExpression(expression, options, isOrdgroup) {
  if (expression.length === 1) {
    var group = buildGroup(expression[0], options);
    if (isOrdgroup && group instanceof MathNode && group.type === "mo") {
      // When TeX writers want to suppress spacing on an operator,
      // they often put the operator by itself inside braces.
      group.setAttribute("lspace", "0em");
      group.setAttribute("rspace", "0em");
    }
    return [group];
  }
  var groups = [];
  var lastGroup;
  for (var i = 0; i < expression.length; i++) {
    var _group = buildGroup(expression[i], options);
    if (_group instanceof MathNode && lastGroup instanceof MathNode) {
      // Concatenate adjacent <mtext>s
      if (_group.type === 'mtext' && lastGroup.type === 'mtext' && _group.getAttribute('mathvariant') === lastGroup.getAttribute('mathvariant')) {
        lastGroup.children.push(..._group.children);
        continue;
        // Concatenate adjacent <mn>s
      } else if (_group.type === 'mn' && lastGroup.type === 'mn') {
        lastGroup.children.push(..._group.children);
        continue;
        // Concatenate <mn>...</mn> followed by <mi>.</mi>
      } else if (isNumberPunctuation(_group) && lastGroup.type === 'mn') {
        lastGroup.children.push(..._group.children);
        continue;
        // Concatenate <mi>.</mi> followed by <mn>...</mn>
      } else if (_group.type === 'mn' && isNumberPunctuation(lastGroup)) {
        _group.children = [...lastGroup.children, ..._group.children];
        groups.pop();
        // Put preceding <mn>...</mn> or <mi>.</mi> inside base of
        // <msup><mn>...base...</mn>...exponent...</msup> (or <msub>)
      } else if ((_group.type === 'msup' || _group.type === 'msub') && _group.children.length >= 1 && (lastGroup.type === 'mn' || isNumberPunctuation(lastGroup))) {
        var base = _group.children[0];
        if (base instanceof MathNode && base.type === 'mn') {
          base.children = [...lastGroup.children, ...base.children];
          groups.pop();
        }
        // \not
      } else if (lastGroup.type === 'mi' && lastGroup.children.length === 1) {
        var lastChild = lastGroup.children[0];
        if (lastChild instanceof TextNode && lastChild.text === '\u0338' && (_group.type === 'mo' || _group.type === 'mi' || _group.type === 'mn')) {
          var child = _group.children[0];
          if (child instanceof TextNode && child.text.length > 0) {
            // Overlay with combining character long solidus
            child.text = child.text.slice(0, 1) + "\u0338" + child.text.slice(1);
            groups.pop();
          }
        }
      }
    }
    groups.push(_group);
    lastGroup = _group;
  }
  return groups;
};
/**
 * Equivalent to buildExpression, but wraps the elements in an <mrow>
 * if there's more than one.  Returns a single node instead of an array.
 */
var buildExpressionRow = function buildExpressionRow(expression, options, isOrdgroup) {
  return makeRow(buildExpression(expression, options, isOrdgroup));
};
/**
 * Takes a group from the parser and calls the appropriate groupBuilders function
 * on it to produce a MathML node.
 */
var buildGroup = function buildGroup(group, options) {
  if (!group) {
    return new MathNode("mrow");
  }
  if (_mathmlGroupBuilders[group.type]) {
    // TODO(ts): MathMLBuilder returns MathDomNode but all concrete
    // builders return MathNode. Widening the return type here would
    // require updating all callers that assume MathNode.
    return _mathmlGroupBuilders[group.type](group, options);
  } else {
    throw new ParseError("Got group of unknown type: '" + group.type + "'");
  }
};
/**
 * Takes a full parse tree and settings and builds a MathML representation of
 * it. In particular, we put the elements from building the parse tree into a
 * <semantics> tag so we can also include that TeX source as an annotation.
 *
 * Note that we actually return a domTree element with a `<math>` inside it so
 * we can do appropriate styling.
 */
function buildMathML(tree, texExpression, options, isDisplayMode, forMathmlOnly) {
  var expression = buildExpression(tree, options);
  // TODO: Make a pass thru the MathML similar to buildHTML.traverseNonSpaceNodes
  // and add spacing nodes. This is necessary only adjacent to math operators
  // like \sin or \lim or to subsup elements that contain math operators.
  // MathML takes care of the other spacing issues.
  // Wrap up the expression in an mrow so it is presented in the semantics
  // tag correctly, unless it's a single <mrow> or <mtable>.
  var wrapper;
  if (expression.length === 1 && expression[0] instanceof MathNode && rowLikeTypes.has(expression[0].type)) {
    wrapper = expression[0];
  } else {
    wrapper = new MathNode("mrow", expression);
  }
  // Build a TeX annotation of the source
  var annot   ation = new MathNode("annotation", [new TextNode(texExpression)]);
  annotation.setAttribute("encoding", "application/x-tex");
  var semantics = new MathNode("semantics", [wrapper, annotation]);
  var math = new MathNode("math", [semantics]);
  math.setAttribute("xmlns", "http://www.w3.org/1998/Math/MathML");
  if (isDisplayMode) {
    math.setAttribute("display", "block");
  }
  // You can't style <math> nodes, so we wrap the node in a span.
  // NOTE: The span class is not typed to have <math> nodes as children, and
  // we don't want to make the children type more generic since the children
  // of span are expected to have more fields in `buildHtml` contexts.
  // The MathNode implements VirtualNode (toNode/toMarkup) which is all that
  // Span needs from its children for rendering.
  // TODO(ts): Span's child type is HtmlDomNode, but MathNode only implements
  // VirtualNode. The double-cast acknowledges this architectural limitation.
  var wrapperClass = forMathmlOnly ? "katex" : "katex-mathml";
  return makeSpan([wrapperClass], [math]);
}

/**
 * This file contains information about the options that the Parser carries
 * around with it while parsing. Data is held in an `Options` object, and when
 * recursing, a new `Options` object can be created with the `.with*` and
 * `.reset` functions.
 */
var sizeStyleMap = [
// Each element contains [textsize, scriptsize, scriptscriptsize].
// The size mappings are taken from TeX with \normalsize=10pt.
[1, 1, 1],
// size1: [5, 5, 5]              \tiny
[2, 1, 1],
// size2: [6, 5, 5]
[3, 1, 1],
// size3: [7, 5, 5]              \scriptsize
[4, 2, 1],
// size4: [8, 6, 5]              \footnotesize
[5, 2, 1],
// size5: [9, 6, 5]              \small
[6, 3, 1],
// size6: [10, 7, 5]             \normalsize
[7, 4, 2],
// size7: [12, 8, 6]             \large
[8, 6, 3],
// size8: [14.4, 10, 7]          \Large
[9, 7, 6],
// size9: [17.28, 12, 10]        \LARGE
[10, 8, 7],
// size10: [20.74, 14.4, 12]     \huge
[11, 10, 9] // size11: [24.88, 20.74, 17.28] \HUGE
];
var sizeMultipliers = [
// fontMetrics.js:getGlobalMetrics also uses size indexes, so if
// you change size indexes, change that function.
0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.44, 1.728, 2.074, 2.488];
var sizeAtStyle = function sizeAtStyle(size, style) {
  return style.size < 2 ? size : sizeStyleMap[size - 1][style.size - 1];
};
/**
 * This is the main options class. It contains the current style, size, color,
 * and font.
 *
 * Options objects should not be modified. To create a new Options with
 * different properties, call a `.having*` method.
 */
class Options {
  constructor(data) {
    this.style = void 0;
    this.color = void 0;
    this.size = void 0;
    this.textSize = void 0;
    this.phantom = void 0;
    // A font family applies to a group of fonts (i.e. SansSerif), while a font
    // represents a specific font (i.e. SansSerif Bold).
    // See: https://tex.stackexchange.com/questions/22350/difference-between-textrm-and-mathrm
    this.font = void 0;
    this.fontFamily = void 0;
    this.fontWeight = void 0;
    this.fontShape = void 0;
    this.sizeMultiplier = void 0;
    this.maxSize = void 0;
    this.minRuleThickness = void 0;
    this._fontMetrics = void 0;
    this.style = data.style;
    this.color = data.color;
    this.size = data.size || Options.BASESIZE;
    this.textSize = data.textSize || this.size;
    this.phantom = !!data.phantom;
    this.font = data.font || "";
    this.fontFamily = data.fontFamily || "";
    this.fontWeight = data.fontWeight || "";
    this.fontShape = data.fontShape || "";
    this.sizeMultiplier = sizeMultipliers[this.size - 1];
    this.maxSize = data.maxSize;
    this.minRuleThickness = data.minRuleThickness;
    this._fontMetrics = undefined;
  }
  /**
   * Returns a new options object with the same properties as "this".  Properties
   * from "extension" will be copied to the new options object.
   */
  extend(extension) {
    var data = {
      style: this.style,
      size: this.size,
      textSize: this.textSize,
      color: this.color,
      phantom: this.phantom,
      font: this.font,
      fontFamily: this.fontFamily,
      fontWeight: this.fontWeight,
      fontShape: this.fontShape,
      maxSize: this.maxSize,
      minRuleThickness: this.minRuleThickness
    };
    Object.assign(data, extension);
    return new Options(data);
  }
  /**
   * Return an options object with the given style. If `this.style === style`,
   * returns `this`.
   */
  havingStyle(style) {
    if (this.style === style) {
      return this;
    } else {
      return this.extend({
        style: style,
        size: sizeAtStyle(this.textSize, style)
      });
    }
  }
  /**
   * Return an options object with a cramped version of the current style. If
   * the current style is cramped, returns `this`.
   */
  havingCrampedStyle() {
    return this.havingStyle(this.style.cramp());
  }
  /**
   * Return an options object with the given size and in at least `\textstyle`.
   * Returns `this` if appropriate.
   */
  havingSize(size) {
    if (this.size === size && this.textSize === size) {
      return this;
    } else {
      return this.extend({
        style: this.style.text(),
        size: size,
        textSize: size,
        sizeMultiplier: sizeMultipliers[size - 1]
      });
    }
  }
  /**
   * Like `this.havingSize(BASESIZE).havingStyle(style)`. If `style` is omitted,
   * changes to at least `\textstyle`.
   */
  havingBaseStyle(style) {
    style = style || this.style.text();
    var wantSize = sizeAtStyle(Options.BASESIZE, style);
    if (this.size === wantSize && this.textSize === Options.BASESIZE && this.style === style) {
      return this;
    } else {
      return this.extend({
        style: style,
        size: wantSize
      });
    }
  }
  /**
   * Remove the effect of sizing changes such as \Huge.
   * Keep the effect of the current style, such as \scriptstyle.
   */
  havingBaseSizing() {
    var size;
    switch (this.style.id) {
      case 4:
      case 5:
        size = 3; // normalsize in scriptstyle
        break;
      case 6:
      case 7:
        size = 1; // normalsize in scriptscriptstyle
        break;
      default:
        size = 6;
      // normalsize in textstyle or displaystyle
    }
    return this.extend({
      style: this.style.text(),
      size: size
    });
  }
  /**
   * Create a new options object with the given color.
   */
  withColor(color) {
    return this.extend({
      color: color
    });
  }
  /**
   * Create a new options object with "phantom" set to true.
   */
  withPhantom() {
    return this.extend({
      phantom: true
    });
  }
  /**
   * Creates a new options object with the given math font or old text font.
   * @type {[type]}
   */
  withFont(font) {
    return this.extend({
      font
    });
  }
  /**
   * Create a new options objects with the given fontFamily.
   */
  withTextFontFamily(fontFamily) {
    return this.extend({
      fontFamily,
      font: ""
    });
  }
  /**
   * Creates a new options object with the given font weight
   */
  withTextFontWeight(fontWeight) {
    return this.extend({
      fontWeight,
      font: ""
    });
  }
  /**
   * Creates a new options object with the given font weight
   */
  withTextFontShape(fontShape) {
    return this.extend({
      fontShape,
      font: ""
    });
  }
  /**
   * Return the CSS sizing classes required to switch from enclosing options
   * `oldOptions` to `this`. Returns an array of classes.
   */
  sizingClasses(oldOptions) {
    if (oldOptions.size !== this.size) {
      return ["sizing", "reset-size" + oldOptions.size, "size" + this.size];
    } else {
      return [];
    }
  }
  /**
   * Return the CSS sizing classes required to switch to the base size. Like
   * `this.havingSize(BASESIZE).sizingClasses(this)`.
   */
  baseSizingClasses() {
    if (this.size !== Options.BASESIZE) {
      return ["sizing", "reset-size" + this.size, "size" + Options.BASESIZE];
    } else {
      return [];
    }
  }
  /**
   * Return the font metrics for this size.
   */
  fontMetrics() {
    if (!this._fontMetrics) {
      this._fontMetrics = getGlobalMetrics(this.size);
    }
    return this._fontMetrics;
  }
  /**
   * Gets the CSS color of the current options object
   */
  getColor() {
    if (this.phantom) {
      return "transparent";
    } else {
      return this.color;
    }
  }
}
/**
 * The base size index.
 */
Options.BASESIZE = 6;

var optionsFromSettings = function optionsFromSettings(settings) {
  return new Options({
    style: settings.displayMode ? Style$1.DISPLAY : Style$1.TEXT,
    maxSize: settings.maxSize,
    minRuleThickness: settings.minRuleThickness
  });
};
var displayWrap = function displayWrap(node, settings) {
  if (settings.displayMode) {
    var classes = ["katex-display"];
    if (settings.leqno) {
      classes.push("leqno");
    }
    if (settings.fleqn) {
      classes.push("fleqn");
    }
    node = makeSpan(classes, [node]);
  }
  return node;
};
var buildTree = function buildTree(tree, expression, settings) {
  var options = optionsFromSettings(settings);
  var katexNode;
  if (settings.output === "mathml") {
    return buildMathML(tree, expression, options, settings.displayMode, true);
  } else if (settings.output === "html") {
    var htmlNode = buildHTML(tree, options);
    katexNode = makeSpan(["katex"], [htmlNode]);
  } else {
    var mathMLNode = buildMathML(tree, expression, options, settings.displayMode, false);
    var _htmlNode = buildHTML(tree, options);
    katexNode = makeSpan(["katex"], [mathMLNode, _htmlNode]);
  }
  return displayWrap(katexNode, settings);
};
var buildHTMLTree = function buildHTMLTree(tree, expression, settings) {
  var options = optionsFromSettings(settings);
  var htmlNode = buildHTML(tree, options);
  var katexNode = makeSpan(["katex"], [htmlNode]);
  return displayWrap(katexNode, settings);
};

/**
 * This file provides support to buildMathML.js and buildHTML.js
 * for stretchy wide elements rendered from SVG files
 * and other CSS trickery.
 */
var stretchyCodePoint = {
  widehat: "^",
  widecheck: "ˇ",
  widetilde: "~",
  utilde: "~",
  overleftarrow: "\u2190",
  underleftarrow: "\u2190",
  xleftarrow: "\u2190",
  overrightarrow: "\u2192",
  underrightarrow: "\u2192",
  xrightarrow: "\u2192",
  underbrace: "\u23df",
  overbrace: "\u23de",
  underbracket: "\u23b5",
  overbracket: "\u23b4",
  overgroup: "\u23e0",
  undergroup: "\u23e1",
  overleftrightarrow: "\u2194",
  underleftrightarrow: "\u2194",
  xleftrightarrow: "\u2194",
  Overrightarrow: "\u21d2",
  xRightarrow: "\u21d2",
  overleftharpoon: "\u21bc",
  xleftharpoonup: "\u21bc",
  overrightharpoon: "\u21c0",
  xrightharpoonup: "\u21c0",
  xLeftarrow: "\u21d0",
  xLeftrightarrow: "\u21d4",
  xhookleftarrow: "\u21a9",
  xhookrightarrow: "\u21aa",
  xmapsto: "\u21a6",
  xrightharpoondown: "\u21c1",
  xleftharpoondown: "\u21bd",
  xrightleftharpoons: "\u21cc",
  xleftrightharpoons: "\u21cb",
  xtwoheadleftarrow: "\u219e",
  xtwoheadrightarrow: "\u21a0",
  xlongequal: "=",
  xtofrom: "\u21c4",
  xrightleftarrows: "\u21c4",
  xrightequilibrium: "\u21cc",
  // Not a perfect match.
  xleftequilibrium: "\u21cb",
  // None better available.
  "\\cdrightarrow": "\u2192",
  "\\cdleftarrow": "\u2190",
  "\\cdlongequal": "="
};
var stretchyMathML = function stretchyMathML(label) {
  var node = new MathNode("mo", [new TextNode(stretchyCodePoint[label.replace(/^\\/, '')])]);
  node.setAttribute("stretchy", "true");
  return node;
};
var katexImagesData = {
  //   path(s), minWidth, height, align
  overrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"],
  overleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"],
  underrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"],
  underleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"],
  xrightarrow: [["rightarrow"], 1.469, 522, "xMaxYMin"],
  "\\cdrightarrow": [["rightarrow"], 3.0, 522, "xMaxYMin"],
  // CD minwwidth2.5pc
  xleftarrow: [["leftarrow"], 1.469, 522, "xMinYMin"],
  "\\cdleftarrow": [["leftarrow"], 3.0, 522, "xMinYMin"],
  Overrightarrow: [["doublerightarrow"], 0.888, 560, "xMaxYMin"],
  xRightarrow: [["doublerightarrow"], 1.526, 560, "xMaxYMin"],
  xLeftarrow: [["doubleleftarrow"], 1.526, 560, "xMinYMin"],
  overleftharpoon: [["leftharpoon"], 0.888, 522, "xMinYMin"],
  xleftharpoonup: [["leftharpoon"], 0.888, 522, "xMinYMin"],
  xleftharpoondown: [["leftharpoondown"], 0.888, 522, "xMinYMin"],
  overrightharpoon: [["rightharpoon"], 0.888, 522, "xMaxYMin"],
  xrightharpoonup: [["rightharpoon"], 0.888, 522, "xMaxYMin"],
  xrightharpoondown: [["rightharpoondown"], 0.888, 522, "xMaxYMin"],
  xlongequal: [["longequal"], 0.888, 334, "xMinYMin"],
  "\\cdlongequal": [["longequal"], 3.0, 334, "xMinYMin"],
  xtwoheadleftarrow: [["twoheadleftarrow"], 0.888, 334, "xMinYMin"],
  xtwoheadrightarrow: [["twoheadrightarrow"], 0.888, 334, "xMaxYMin"],
  overleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522],
  overbrace: [["leftbrace", "midbrace", "rightbrace"], 1.6, 548],
  underbrace: [["leftbraceunder", "midbraceunder", "rightbraceunder"], 1.6, 548],
  underleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522],
  xleftrightarrow: [["leftarrow", "rightarrow"], 1.75, 522],
  xLeftrightarrow: [["doubleleftarrow", "doublerightarrow"], 1.75, 560],
  xrightleftharpoons: [["leftharpoondownplus", "rightharpoonplus"], 1.75, 716],
  xleftrightharpoons: [["leftharpoonplus", "rightharpoondownplus"], 1.75, 716],
  xhookleftarrow: [["leftarrow", "righthook"], 1.08, 522],
  xhookrightarrow: [["lefthook", "rightarrow"], 1.08, 522],
  overlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522],
  underlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522],
  overbracket: [["leftbracketover", "rightbracketover"], 1.6, 440],
  underbracket: [["leftbracketunder", "rightbracketunder"], 1.6, 410],
  overgroup: [["leftgroup", "rightgroup"], 0.888, 342],
  undergroup: [["leftgroupunder", "rightgroupunder"], 0.888, 342],
  xmapsto: [["leftmapsto", "rightarrow"], 1.5, 522],
  xtofrom: [["leftToFrom", "rightToFrom"], 1.75, 528],
  // The next three arrows are from the mhchem package.
  // In mhchem.sty, min-length is 2.0em. But these arrows might appear in the
  // document as \xrightarrow or \xrightleftharpoons. Those have
  // min-length = 1.75em, so we set min-length on these next three to match.
  xrightleftarrows: [["baraboveleftarrow", "rightarrowabovebar"], 1.75, 901],
  xrightequilibrium: [["baraboveshortleftharpoon", "rightharpoonaboveshortbar"], 1.75, 716],
  xleftequilibrium: [["shortbaraboveleftharpoon", "shortrightharpoonabovebar"], 1.75, 716]
};
var wideAccentLabels = new Set(["widehat", "widecheck", "widetilde", "utilde"]);
var stretchySvg = function stretchySvg(group, options) {
  // Create a span with inline SVG for the element.
  function buildSvgSpan_() {
    var viewBoxWidth = 400000; // default
    var label = group.label.slice(1);
    if (wideAccentLabels.has(label) && 'base' in group) {
      // There are four SVG images available for each function.
      // Choose a taller image when there are more characters.
      var numChars = group.base.type === "ordgroup" ? group.base.body.length : 1;
      var viewBoxHeight;
      var pathName;
      var _height;
      if (numChars > 5) {
        if (label === "widehat" || label === "widecheck") {
          viewBoxHeight = 420;
          viewBoxWidth = 2364;
          _height = 0.42;
          pathName = label + "4";
        } else {
          viewBoxHeight = 312;
          viewBoxWidth = 2340;
          _height = 0.34;
          pathName = "tilde4";
        }
      } else {
        var imgIndex = [1, 1, 2, 2, 3, 3][numChars];
        if (label === "widehat" || label === "widecheck") {
          viewBoxWidth = [0, 1062, 2364, 2364, 2364][imgIndex];
          viewBoxHeight = [0, 239, 300, 360, 420][imgIndex];
          _height = [0, 0.24, 0.3, 0.3, 0.36, 0.42][imgIndex];
          pathName = label + imgIndex;
        } else {
          viewBoxWidth = [0, 600, 1033, 2339, 2340][imgIndex];
          viewBoxHeight = [0, 260, 286, 306, 312][imgIndex];
          _height = [0, 0.26, 0.286, 0.3, 0.306, 0.34][imgIndex];
          pathName = "tilde" + imgIndex;
        }
      }
      var path = new PathNode(pathName);
      var svgNode = new SvgNode([path], {
        "width": "100%",
        "height": makeEm(_height),
        "viewBox": "0 0 " + viewBoxWidth + " " + viewBoxHeight,
        "preserveAspectRatio": "none"
      });
      return {
        span: makeSvgSpan([], [svgNode], options),
        minWidth: 0,
        height: _height
      };
    } else {
      var spans = [];
      var data = katexImagesData[label];
      if (!data) {
        throw new Error("No SVG data for \"" + label + "\".");
      }
      var [paths, _minWidth, _viewBoxHeight] = data;
      var _height2 = _viewBoxHeight / 1000;
      var numSvgChildren = paths.length;
      var widthClasses;
      var aligns;
      if (numSvgChildren === 1) {
        if (data.length !== 4) {
          throw new Error("Expected 4-tuple for single-path SVG data \"" + label + "\".");
        }
        widthClasses = ["hide-tail"];
        aligns = [data[3]];
      } else if (numSvgChildren === 2) {
        widthClasses = ["halfarrow-left", "halfarrow-right"];
        aligns = ["xMinYMin", "xMaxYMin"];
      } else if (numSvgChildren === 3) {
        widthClasses = ["brace-left", "brace-center", "brace-right"];
        aligns = ["xMinYMin", "xMidYMin", "xMaxYMin"];
      } else {
        throw new Error("Correct katexImagesData or update code here to support\n                    " + numSvgChildren + " children.");
      }
      for (var i = 0; i < numSvgChildren; i++) {
        var _path = new PathNode(paths[i]);
        var _svgNode = new SvgNode([_path], {
          "width": "400em",
          "height": makeEm(_height2),
          "viewBox": "0 0 " + viewBoxWidth + " " + _viewBoxHeight,
          "preserveAspectRatio": aligns[i] + " slice"
        });
        var _span = makeSvgSpan([widthClasses[i]], [_svgNode], options);
        if (numSvgChildren === 1) {
          return {
            span: _span,
            minWidth: _minWidth,
            height: _height2
          };
        } else {
          _span.style.height = makeEm(_height2);
          spans.push(_span);
        }
      }
      return {
        span: makeSpan(["stretchy"], spans, options),
        minWidth: _minWidth,
        height: _height2
      };
    }
  } // buildSvgSpan_()
  var {
    span,
    minWidth,
    height
  } = buildSvgSpan_();
  // Note that we are returning span.depth = 0.
  // Any adjustments relative to the baseline must be done in buildHTML.
  span.height = height;
  span.style.height = makeEm(height);
  if (minWidth > 0) {
    span.style.minWidth = makeEm(minWidth);
  }
  return span;
};
var stretchyEnclose = function stretchyEnclose(inner, label, topPad, bottomPad, options) {
  // Return an image span for \cancel, \bcancel, \xcancel, \fbox, or \angl
  var img;
  var totalHeight = inner.height + inner.depth + topPad + bottomPad;
  if (/fbox|color|angl/.test(label)) {
    img = makeSpan(["stretchy", label], [], options);
    if (label === "fbox") {
      var color = options.color && options.getColor();
      if (color) {
        img.style.borderColor = color;
      }
    }
  } else {
    // \cancel, \bcancel, or \xcancel
    // Since \cancel's SVG is inline and it omits the viewBox attribute,
    // its stroke-width will not vary with span area.
    var lines = [];
    if (/^[bx]cancel$/.test(label)) {
      lines.push(new LineNode({
        "x1": "0",
        "y1": "0",
        "x2": "100%",
        "y2": "100%",
        "stroke-width": "0.046em"
      }));
    }
    if (/^x?cancel$/.test(label)) {
      lines.push(new LineNode({
        "x1": "0",
        "y1": "100%",
        "x2": "100%",
        "y2": "0",
        "stroke-width": "0.046em"
      }));
    }
    var svgNode = new SvgNode(lines, {
      "width": "100%",
      "height": makeEm(totalHeight)
    });
    img = makeSvgSpan([], [svgNode], options);
  }
  img.height = totalHeight;
  img.style.height = makeEm(totalHeight);
  return img;
};

/**
 * Small module for atom-group constants and type guard.  Kept separate from
 * `symbols.ts` so that consumers (notably `contrib/render-a11y-string`) can
 * pull in `isAtom` without dragging in the ~870-line symbol tables.
 */
// Some of these have a "-token" suffix since these are also used as `ParseNode`
// types for raw text tokens, and we want to avoid conflicts with higher-level
// `ParseNode` types. These `ParseNode`s are constructed within `Parser` by
// looking up the `symbols` map.
var ATOMS = {
  "bin": 1,
  "close": 1,
  "inner": 1,
  "open": 1,
  "punct": 1,
  "rel": 1
};
var NON_ATOMS = {
  "accent-token": 1,
  "mathord": 1,
  "op-token": 1,
  "spacing": 1,
  "textord": 1
};
function isAtom(value) {
  return value in ATOMS;
}

/**
 * Asserts that the node is of the given type and returns it with stricter
 * typing. Throws if the node's type does not match.
 */
function assertNodeType(node, type) {
  if (!node || node.type !== type) {
    throw new Error("Expected node of type " + type + ", but got " + (node ? "node of type " + node.type : String(node)));
  }
  return node;
}
/**
 * Returns the node more strictly typed iff it is of the given type. Otherwise,
 * returns null.
 */
function assertSymbolNodeType(node) {
  var typedNode = checkSymbolNodeType(node);
  if (!typedNode) {
    throw new Error("Expected node of symbol group type, but got " + (node ? "node of type " + node.type : String(node)));
  }
  return typedNode;
}
/**
 * Returns the node more strictly typed iff it is of the given type. Otherwise,
 * returns null.
 */
function checkSymbolNodeType(node) {
  if (node && (node.type === "atom" || NON_ATOMS.hasOwnProperty(node.type))) {
    return node;
  }
  return null;
}

var getBaseSymbol = group => {
  if (group instanceof SymbolNode) {
    return group;
  }
  if (hasHtmlDomChildren(group) && group.children.length === 1) {
    return getBaseSymbol(group.children[0]);
  }
};
// NOTE: Unlike most `htmlBuilder`s, this one handles not only "accent", but
// also "supsub" since an accent can affect super/subscripting.
var htmlBuilder$a = (grp, options) => {
  // Accents are handled in the TeXbook pg. 443, rule 12.
  var base;
  var group;
  var supSubGroup;
  if (grp && grp.type === "supsub") {
    // If our base is a character box, and we have superscripts and
    // subscripts, the supsub will defer to us. In particular, we want
    // to attach the superscripts and subscripts to the inner body (so
    // that the position of the superscripts and subscripts won't be
    // affected by the height of the accent). We accomplish this by
    // sticking the base of the accent into the base of the supsub, and
    // rendering that, while keeping track of where the accent is.
    // The real accent group is the base of the supsub group
    group = assertNodeType(grp.base, "accent");
    // The character box is the base of the accent group
    base = group.base;
    // Stick the character box into the base of the supsub group
    grp.base = base;
    // Rerender the supsub group with its new base, and store that
    // result.
    supSubGroup = assertSpan(buildGroup$1(grp, options));
    // reset original base
    grp.base = group;
  } else {
    group = assertNodeType(grp, "accent");
    base = group.base;
  }
  // Build the base group
  var body = buildGroup$1(base, options.havingCrampedStyle());
  // Does the accent need to shift for the skew of a character?
  var mustShift = group.isShifty && isCharacterBox(base);
  // Calculate the skew of the accent. This is based on the line "If the
  // nucleus is not a single character, let s = 0; otherwise set s to the
  // kern amount for the nucleus followed by the \skewchar of its font."
  // Note that our skew metrics are just the kern between each character
  // and the skewchar.
  var skew = 0;
  if (mustShift) {
    var _getBaseSymbol$skew, _getBaseSymbol;
    // Read the skew from the rendered base symbol.
    // This preserves font metrics from font wrappers like \mathbb.
    skew = (_getBaseSymbol$skew = (_getBaseSymbol = getBaseSymbol(body)) == null ? void 0 : _getBaseSymbol.skew) != null ? _getBaseSymbol$skew : 0;
  }
  var accentBelow = group.label === "\\c";
  // calculate the amount of space between the body and the accent
  var clearance = accentBelow ? body.height + body.depth : Math.min(body.height, options.fontMetrics().xHeight);
  // Build the accent
  var accentBody;
  if (!group.isStretchy) {
    var accent;
    var width;
    if (group.label === "\\vec") {
      // Before version 0.9, \vec used the combining font glyph U+20D7.
      // But browsers, especially Safari, are not consistent in how they
      // render combining characters when not preceded by a character.
      // So now we use an SVG.
      // If Safari reforms, we should consider reverting to the glyph.
      accent = staticSvg("vec", options);
      width = svgData.vec[1];
    } else {
      accent = makeOrd({
        type: "textord",
        mode: group.mode,
        text: group.label
      }, options, "textord");
      accent = assertSymbolDomNode(accent);
      // Remove the italic correction of the accent, because it only serves to
      // shift the accent over to a place we don't want.
      accent.italic = 0;
      width = accent.width;
      if (accentBelow) {
        clearance += accent.depth;
      }
    }
    accentBody = makeSpan(["accent-body"], [accent]);
    // "Full" accents expand the width of the resulting symbol to be
    // at least the width of the accent, and overlap directly onto the
    // character without any vertical offset.
    var accentFull = group.label === "\\textcircled";
    if (accentFull) {
      accentBody.classes.push('accent-full');
      clearance = body.height;
    }
    // Shift the accent over by the skew.
    var left = skew;
    // CSS defines `.katex .accent .accent-body:not(.accent-full) { width: 0 }`
    // so that the accent doesn't contribute to the bounding box.
    // We need to shift the character by its width (effectively half
    // its width) to compensate.
    if (!accentFull) {
      left -= width / 2;
    }
    accentBody.style.left = makeEm(left);
    // \textcircled uses the \bigcirc glyph, so it needs some
    // vertical adjustment to match LaTeX.
    if (group.label === "\\textcircled") {
      accentBody.style.top = ".2em";
    }
    accentBody = makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: body
      }, {
        type: "kern",
        size: -clearance
      }, {
        type: "elem",
        elem: accentBody
      }]
    });
  } else {
    accentBody = stretchySvg(group, options);
    accentBody = makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: body
      }, {
        type: "elem",
        elem: accentBody,
        wrapperClasses: ["svg-align"],
        wrapperStyle: skew > 0 ? {
          width: "calc(100% - " + makeEm(2 * skew) + ")",
          marginLeft: makeEm(2 * skew)
        } : undefined
      }]
    });
  }
  var accentWrap = makeSpan(["mord", "accent"], [accentBody], options);
  if (supSubGroup) {
    // Here, we replace the "base" child of the supsub with our newly
    // generated accent.
    supSubGroup.children[0] = accentWrap;
    // Since we don't rerun the height calculation after replacing the
    // accent, we manually recalculate height.
    supSubGroup.height = Math.max(accentWrap.height, supSubGroup.height);
    // Accents should always be ords, even when their innards are not.
    supSubGroup.classes[0] = "mord";
    return supSubGroup;
  } else {
    return accentWrap;
  }
};
var mathmlBuilder$9 = (group, options) => {
  var accentNode = group.isStretchy ? stretchyMathML(group.label) : new MathNode("mo", [makeText(group.label, group.mode)]);
  var node = new MathNode("mover", [buildGroup(group.base, options), accentNode]);
  node.setAttribute("accent", "true");
  return node;
};
var NON_STRETCHY_ACCENT_REGEX = new RegExp(["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring"].map(accent => "\\" + accent).join("|"));
// Accents
defineFunction({
  type: "accent",
  names: ["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring", "\\widecheck", "\\widehat", "\\widetilde", "\\overrightarrow", "\\overleftarrow", "\\Overrightarrow", "\\overleftrightarrow", "\\overgroup", "\\overlinesegment", "\\overleftharpoon", "\\overrightharpoon"],
  props: {
    numArgs: 1
  },
  handler: (context, args) => {
    var base = normalizeArgument(args[0]);
    var isStretchy = !NON_STRETCHY_ACCENT_REGEX.test(context.funcName);
    var isShifty = !isStretchy || context.funcName === "\\widehat" || context.funcName === "\\widetilde" || context.funcName === "\\widecheck";
    return {
      type: "accent",
      mode: context.parser.mode,
      label: context.funcName,
      isStretchy: isStretchy,
      isShifty: isShifty,
      base: base
    };
  },
  htmlBuilder: htmlBuilder$a,
  mathmlBuilder: mathmlBuilder$9
});
// Text-mode accents
defineFunction({
  type: "accent",
  names: ["\\'", "\\`", "\\^", "\\~", "\\=", "\\u", "\\.", '\\"', "\\c", "\\r", "\\H", "\\v", "\\textcircled"],
  props: {
    numArgs: 1,
    allowedInText: true,
    allowedInMath: true,
    // unless in strict mode
    argTypes: ["primitive"]
  },
  handler: (context, args) => {
    var base = args[0];
    var mode = context.parser.mode;
    if (mode === "math") {
      context.parser.settings.reportNonstrict("mathVsTextAccents", "LaTeX's accent " + context.funcName + " works only in text mode");
      mode = "text";
    }
    return {
      type: "accent",
      mode: mode,
      label: context.funcName,
      isStretchy: false,
      isShifty: true,
      base: base
    };
  },
  htmlBuilder: htmlBuilder$a,
  mathmlBuilder: mathmlBuilder$9
});

// Horizontal overlap functions
defineFunction({
  type: "accentUnder",
  names: ["\\underleftarrow", "\\underrightarrow", "\\underleftrightarrow", "\\undergroup", "\\underlinesegment", "\\utilde"],
  props: {
    numArgs: 1
  },
  handler: (_ref, args) => {
    var {
      parser,
      funcName
    } = _ref;
    var base = args[0];
    return {
      type: "accentUnder",
      mode: parser.mode,
      label: funcName,
      base: base
    };
  },
  htmlBuilder: (group, options) => {
    // Treat under accents much like underlines.
    var innerGroup = buildGroup$1(group.base, options);
    var accentBody = stretchySvg(group, options);
    var kern = group.label === "\\utilde" ? 0.12 : 0;
    // Generate the vlist, with the appropriate kerns
    var vlist = makeVList({
      positionType: "top",
      positionData: innerGroup.height,
      children: [{
        type: "elem",
        elem: accentBody,
        wrapperClasses: ["svg-align"]
      }, {
        type: "kern",
        size: kern
      }, {
        type: "elem",
        elem: innerGroup
      }]
    });
    return makeSpan(["mord", "accentunder"], [vlist], options);
  },
  mathmlBuilder: (group, options) => {
    var accentNode = stretchyMathML(group.label);
    var node = new MathNode("munder", [buildGroup(group.base, options), accentNode]);
    node.setAttribute("accentunder", "true");
    return node;
  }
});

// Helper function
var paddedNode = group => {
  var node = new MathNode("mpadded", group ? [group] : []);
  node.setAttribute("width", "+0.6em");
  node.setAttribute("lspace", "0.3em");
  return node;
};
// Stretchy arrows with an optional argument
defineFunction({
  type: "xArrow",
  names: ["\\xleftarrow", "\\xrightarrow", "\\xLeftarrow", "\\xRightarrow", "\\xleftrightarrow", "\\xLeftrightarrow", "\\xhookleftarrow", "\\xhookrightarrow", "\\xmapsto", "\\xrightharpoondown", "\\xrightharpoonup", "\\xleftharpoondown", "\\xleftharpoonup", "\\xrightleftharpoons", "\\xleftrightharpoons", "\\xlongequal", "\\xtwoheadrightarrow", "\\xtwoheadleftarrow", "\\xtofrom",
  // The next 3 functions are here to support the mhchem extension.
  // Direct use of these functions is discouraged and may break someday.
  "\\xrightleftarrows", "\\xrightequilibrium", "\\xleftequilibrium",
  // The next 3 functions are here only to support the {CD} environment.
  "\\\\cdrightarrow", "\\\\cdleftarrow", "\\\\cdlongequal"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1
  },
  handler(_ref, args, optArgs) {
    var {
      parser,
      funcName
    } = _ref;
    return {
      type: "xArrow",
      mode: parser.mode,
      label: funcName,
      body: args[0],
      below: optArgs[0]
    };
  },
  htmlBuilder(group, options) {
    var style = options.style;
    // Build the argument groups in the appropriate style.
    // Ref: amsmath.dtx:   \hbox{$\scriptstyle\mkern#3mu{#6}\mkern#4mu$}%
    // Some groups can return document fragments.  Handle those by wrapping
    // them in a span.
    var newOptions = options.havingStyle(style.sup());
    var upperGroup = wrapFragment(buildGroup$1(group.body, newOptions, options), options);
    var arrowPrefix = group.label.slice(0, 2) === "\\x" ? "x" : "cd";
    upperGroup.classes.push(arrowPrefix + "-arrow-pad");
    var lowerGroup;
    if (group.below) {
      // Build the lower group
      newOptions = options.havingStyle(style.sub());
      lowerGroup = wrapFragment(buildGroup$1(group.below, newOptions, options), options);
      lowerGroup.classes.push(arrowPrefix + "-arrow-pad");
    }
    var arrowBody = stretchySvg(group, options);
    // Re shift: Note that stretchySvg returned arrowBody.depth = 0.
    // The point we want on the math axis is at 0.5 * arrowBody.height.
    var arrowShift = -options.fontMetrics().axisHeight + 0.5 * arrowBody.height;
    // 2 mu kern. Ref: amsmath.dtx: #7\if0#2\else\mkern#2mu\fi
    var upperShift = -options.fontMetrics().axisHeight - 0.5 * arrowBody.height - 0.111; // 0.111 em = 2 mu
    if (upperGroup.depth > 0.25 || group.label === "\\xleftequilibrium") {
      upperShift -= upperGroup.depth; // shift up if depth encroaches
    }
    // Generate the vlist
    var vlist;
    if (lowerGroup) {
      var lowerShift = -options.fontMetrics().axisHeight + lowerGroup.height + 0.5 * arrowBody.height + 0.111;
      vlist = makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: upperGroup,
          shift: upperShift
        }, {
          type: "elem",
          elem: arrowBody,
          shift: arrowShift,
          wrapperClasses: ["svg-align"]
        }, {
          type: "elem",
          elem: lowerGroup,
          shift: lowerShift
        }]
      });
    } else {
      vlist = makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: upperGroup,
          shift: upperShift
        }, {
          type: "elem",
          elem: arrowBody,
          shift: arrowShift,
          wrapperClasses: ["svg-align"]
        }]
      });
    }
    return makeSpan(["mrel", "x-arrow"], [vlist], options);
  },
  mathmlBuilder(group, options) {
    var arrowNode = stretchyMathML(group.label);
    arrowNode.setAttribute("minsize", group.label.charAt(0) === "x" ? "1.75em" : "3.0em");
    var node;
    if (group.body) {
      var upperNode = paddedNode(buildGroup(group.body, options));
      if (group.below) {
        var lowerNode = paddedNode(buildGroup(group.below, options));
        node = new MathNode("munderover", [arrowNode, lowerNode, upperNode]);
      } else {
        node = new MathNode("mover", [arrowNode, upperNode]);
      }
    } else if (group.below) {
      var _lowerNode = paddedNode(buildGroup(group.below, options));
      node = new MathNode("munder", [arrowNode, _lowerNode]);
    } else {
      // This should never happen.
      // Parser.js throws an error if there is no argument.
      node = paddedNode();
      node = new MathNode("mover", [arrowNode, node]);
    }
    return node;
  }
});

function htmlBuilder$9(group, options) {
  var elements = buildExpression$1(group.body, options, true);
  return makeSpan([group.mclass], elements, options);
}
function mathmlBuilder$8(group, options) {
  var node;
  var inner = buildExpression(group.body, options);
  if (group.mclass === "minner") {
    node = new MathNode("mpadded", inner);
  } else if (group.mclass === "mord") {
    if (group.isCharacterBox) {
      node = inner[0];
      node.type = "mi";
    } else {
      node = new MathNode("mi", inner);
    }
  } else {
    if (group.isCharacterBox) {
      node = inner[0];
      node.type = "mo";
    } else {
      node = new MathNode("mo", inner);
    }
    // Set spacing based on what is the most likely adjacent atom type.
    // See TeXbook p170.
    if (group.mclass === "mbin") {
      node.attributes.lspace = "0.22em"; // medium space
      node.attributes.rspace = "0.22em";
    } else if (group.mclass === "mpunct") {
      node.attributes.lspace = "0em";
      node.attributes.rspace = "0.17em"; // thinspace
    } else if (group.mclass === "mopen" || group.mclass === "mclose") {
      node.attributes.lspace = "0em";
      node.attributes.rspace = "0em";
    } else if (group.mclass === "minner") {
      node.attributes.lspace = "0.0556em"; // 1 mu is the most likely option
      node.attributes.width = "+0.1111em";
    }
    // MathML <mo> default space is 5/18 em, so <mrel> needs no action.
    // Ref: https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mo
  }
  return node;
}
// Math class commands except \mathop
defineFunction({
  type: "mclass",
  names: ["\\mathord", "\\mathbin", "\\mathrel", "\\mathopen", "\\mathclose", "\\mathpunct", "\\mathinner"],
  props: {
    numArgs: 1,
    primitive: true
  },
  handler(_ref, args) {
    var {
      parser,
      funcName
    } = _ref;
    var body = args[0];
    return {
      type: "mclass",
      mode: parser.mode,
      mclass: "m" + funcName.slice(5),
      // TODO(kevinb): don't prefix with 'm'
      body: ordargument(body),
      isCharacterBox: isCharacterBox(body)
    };
  },
  htmlBuilder: htmlBuilder$9,
  mathmlBuilder: mathmlBuilder$8
});
var binrelClass = arg => {
  // \binrel@ spacing varies with (bin|rel|ord) of the atom in the argument.
  // (by rendering separately and with {}s before and after, and measuring
  // the change in spacing).  We'll do roughly the same by detecting the
  // atom type directly.
  var atom = arg.type === "ordgroup" && arg.body.length ? arg.body[0] : arg;
  if (atom.type === "atom" && (atom.family === "bin" || atom.family === "rel")) {
    return "m" + atom.family;
  } else {
    return "mord";
  }
};
// \@binrel{x}{y} renders like y but as mbin/mrel/mord if x is mbin/mrel/mord.
// This is equivalent to \binrel@{x}\binrel@@{y} in AMSTeX.
defineFunction({
  type: "mclass",
  names: ["\\@binrel"],
  props: {
    numArgs: 2
  },
  handler(_ref2, args) {
    var {
      parser
    } = _ref2;
    return {
      type: "mclass",
      mode: parser.mode,
      mclass: binrelClass(args[0]),
      body: ordargument(args[1]),
      isCharacterBox: isCharacterBox(args[1])
    };
  }
});
// Build a relation or stacked op by placing one symbol on top of another
defineFunction({
  type: "mclass",
  names: ["\\stackrel", "\\overset", "\\underset"],
  props: {
    numArgs: 2
  },
  handler(_ref3, args) {
    var {
      parser,
      funcName
    } = _ref3;
    var baseArg = args[1];
    var shiftedArg = args[0];
    var mclass;
    if (funcName !== "\\stackrel") {
      // LaTeX applies \binrel spacing to \overset and \underset.
      mclass = binrelClass(baseArg);
    } else {
      mclass = "mrel"; // for \stackrel
    }
    var baseOp = {
      type: "op",
      mode: baseArg.mode,
      limits: true,
      alwaysHandleSupSub: true,
      parentIsSupSub: false,
      symbol: false,
      suppressBaseShift: funcName !== "\\stackrel",
      body: ordargument(baseArg)
    };
    var supsub = {
      type: "supsub",
      mode: shiftedArg.mode,
      base: baseOp,
      sup: funcName === "\\underset" ? null : shiftedArg,
      sub: funcName === "\\underset" ? shiftedArg : null
    };
    return {
      type: "mclass",
      mode: parser.mode,
      mclass,
      body: [supsub],
      isCharacterBox: isCharacterBox(supsub)
    };
  },
  htmlBuilder: htmlBuilder$9,
  mathmlBuilder: mathmlBuilder$8
});

// \pmb is a simulation of bold font.
// The version of \pmb in ambsy.sty works by typesetting three copies
// with small offsets. We use CSS text-shadow.
// It's a hack. Not as good as a real bold font. Better than nothing.
defineFunction({
  type: "pmb",
  names: ["\\pmb"],
  props: {
    numArgs: 1,
    allowedInText: true
  },
  handler(_ref, args) {
    var {
      parser
    } = _ref;
    return {
      type: "pmb",
      mode: parser.mode,
      mclass: binrelClass(args[0]),
      body: ordargument(args[0])
    };
  },
  htmlBuilder(group, options) {
    var elements = buildExpression$1(group.body, options, true);
    var node = makeSpan([group.mclass], elements, options);
    node.style.textShadow = "0.02em 0.01em 0.04px";
    return node;
  },
  mathmlBuilder(group, style) {
    var inner = buildExpression(group.body, style);
    // Wrap with an <mstyle> element.
    var node = new MathNode("mstyle", inner);
    node.setAttribute("style", "text-shadow: 0.02em 0.01em 0.04px");
    return node;
  }
});

var cdArrowFunctionName = {
  ">": "\\\\cdrightarrow",
  "<": "\\\\cdleftarrow",
  "=": "\\\\cdlongequal",
  "A": "\\uparrow",
  "V": "\\downarrow",
  "|": "\\Vert",
  ".": "no arrow"
};
var newCell = () => {
  // Create an empty cell, to be filled below with parse nodes.
  // The parseTree from this module must be constructed like the
  // one created by parseArray(), so an empty CD cell must
  // be a ParseNode<"styling">. And CD is always displaystyle.
  return {
    type: "styling",
    body: [],
    mode: "math",
    style: "display",
    resetFont: true
  };
};
var isStartOfArrow = node => {
  return node.type === "textord" && node.text === "@";
};
var isLabelEnd = (node, endChar) => {
  return (node.type === "mathord" || node.type === "atom") && node.text === endChar;
};
function cdArrow(arrowChar, labels, parser) {
  // Return a parse tree of an arrow and its labels.
  // This acts in a way similar to a macro expansion.
  var funcName = cdArrowFunctionName[arrowChar];
  switch (funcName) {
    case "\\\\cdrightarrow":
    case "\\\\cdleftarrow":
      return parser.callFunction(funcName, [labels[0]], [labels[1]]);
    case "\\uparrow":
    case "\\downarrow":
      {
        var leftLabel = parser.callFunction("\\\\cdleft", [labels[0]], []);
        var bareArrow = {
          type: "atom",
          text: funcName,
          mode: "math",
          family: "rel"
        };
        var sizedArrow = parser.callFunction("\\Big", [bareArrow], []);
        var rightLabel = parser.callFunction("\\\\cdright", [labels[1]], []);
        var arrowGroup = {
          type: "ordgroup",
          mode: "math",
          body: [leftLabel, sizedArrow, rightLabel]
        };
        return parser.callFunction("\\\\cdparent", [arrowGroup], []);
      }
    case "\\\\cdlongequal":
      return parser.callFunction("\\\\cdlongequal", [], []);
    case "\\Vert":
      {
        var arrow = {
          type: "textord",
          text: "\\Vert",
          mode: "math"
        };
        return parser.callFunction("\\Big", [arrow], []);
      }
    default:
      return {
        type: "textord",
        text: " ",
        mode: "math"
      };
  }
}
function parseCD(parser) {
  // Get the array's parse nodes with \\ temporarily mapped to \cr.
  var parsedRows = [];
  parser.gullet.beginGroup();
  parser.gullet.macros.set("\\cr", "\\\\\\relax");
  parser.gullet.beginGroup();
  while (true) {
    // Get the parse nodes for the next row.
    parsedRows.push(parser.parseExpression(false, "\\\\"));
    parser.gullet.endGroup();
    parser.gullet.beginGroup();
    var next = parser.fetch().text;
    if (next === "&" || next === "\\\\") {
      parser.consume();
    } else if (next === "\\end") {
      if (parsedRows[parsedRows.length - 1].length === 0) {
        parsedRows.pop(); // final row ended in \\
      }
      break;
    } else {
      throw new ParseError("Expected \\\\ or \\cr or \\end", parser.nextToken);
    }
  }
  var row = [];
  var body = [row];
  // Loop thru the parse nodes. Collect them into cells and arrows.
  for (var i = 0; i < parsedRows.length; i++) {
    // Start a new row.
    var rowNodes = parsedRows[i];
    // Create the first cell.
    var cell = newCell();
    for (var j = 0; j < rowNodes.length; j++) {
      if (!isStartOfArrow(rowNodes[j])) {
        // If a parseNode is not an arrow, it goes into a cell.
        cell.body.push(rowNodes[j]);
      } else {
        // Parse node j is an "@", the start of an arrow.
        // Before starting on the arrow, push the cell into `row`.
        row.push(cell);
        // Now collect parseNodes into an arrow.
        // The character after "@" defines the arrow type.
        j += 1;
        var arrowChar = assertSymbolNodeType(rowNodes[j]).text;
        // Create two empty label nodes. We may or may not use them.
        var labels = new Array(2);
        labels[0] = {
          type: "ordgroup",
          mode: "math",
          body: []
        };
        labels[1] = {
          type: "ordgroup",
          mode: "math",
          body: []
        };
        // Process the arrow.
        if ("=|.".includes(arrowChar)) ; else if ("<>AV".includes(arrowChar)) {
          // Four arrows, `@>>>`, `@<<<`, `@AAA`, and `@VVV`, each take
          // two optional labels. E.g. the right-point arrow syntax is
          // really:  @>{optional label}>{optional label}>
          // Collect parseNodes into labels.
          for (var labelNum = 0; labelNum < 2; labelNum++) {
            var inLabel = true;
            for (var k = j + 1; k < rowNodes.length; k++) {
              if (isLabelEnd(rowNodes[k], arrowChar)) {
                inLabel = false;
                j = k;
                break;
              }
              if (isStartOfArrow(rowNodes[k])) {
                throw new ParseError("Missing a " + arrowChar + " character to complete a CD arrow.", rowNodes[k]);
              }
              labels[labelNum].body.push(rowNodes[k]);
            }
            if (inLabel) {
              // isLabelEnd never returned a true.
              throw new ParseError("Missing a " + arrowChar + " character to complete a CD arrow.", rowNodes[j]);
            }
          }
        } else {
          throw new ParseError("Expected one of \"<>AV=|.\" after @", rowNodes[j]);
        }
        // Now join the arrow to its labels.
        var arrow = cdArrow(arrowChar, labels, parser);
        // Wrap the arrow in  ParseNode<"styling">.
        // This is done to match parseArray() behavior.
        var wrappedArrow = {
          type: "styling",
          body: [arrow],
          mode: "math",
          style: "display",
          // CD is always displaystyle.
          resetFont: true
        };
        row.push(wrappedArrow);
        // In CD's syntax, cells are implicit. That is, everything that
        // is not an arrow gets collected into a cell. So create an empty
        // cell now. It will collect upcoming parseNodes.
        cell = newCell();
      }
    }
    if (i % 2 === 0) {
      // Even-numbered rows consist of: cell, arrow, cell, arrow, ... cell
      // The last cell is not yet pushed into `row`, so:
      row.push(cell);
    } else {
      // Odd-numbered rows consist of: vert arrow, empty cell, ... vert arrow
      // Remove the empty cell that was placed at the beginning of `row`.
      row.shift();
    }
    row = [];
    body.push(row);
  }
  // End row group
  parser.gullet.endGroup();
  // End array group defining \\
  parser.gullet.endGroup();
  // define column separation.
  var cols = new Array(body[0].length).fill({
    type: "align",
    align: "c",
    pregap: 0.25,
    // CD package sets \enskip between columns.
    postgap: 0.25 // So pre and post each get half an \enskip, i.e. 0.25em.
  });
  return {
    type: "array",
    mode: "math",
    body,
    arraystretch: 1,
    addJot: true,
    rowGaps: [null],
    cols,
    colSeparationType: "CD",
    hLinesBeforeRow: new Array(body.length + 1).fill([])
  };
}
// The functions below are not available for general use.
// They are here only for internal use by the {CD} environment in placing labels
// next to vertical arrows.
// We don't need any such functions for horizontal arrows because we can reuse
// the functionality that already exists for extensible arrows.
defineFunction({
  type: "cdlabel",
  names: ["\\\\cdleft", "\\\\cdright"],
  props: {
    numArgs: 1
  },
  handler(_ref, args) {
    var {
      parser,
      funcName
    } = _ref;
    return {
      type: "cdlabel",
      mode: parser.mode,
      side: funcName.slice(4),
      label: args[0]
    };
  },
  htmlBuilder(group, options) {
    var newOptions = options.havingStyle(options.style.sup());
    var label = wrapFragment(buildGroup$1(group.label, newOptions, options), options);
    label.classes.push("cd-label-" + group.side);
    label.style.bottom = makeEm(0.8 - label.depth);
    // Zero out label height & depth, so vertical align of arrow is set
    // by the arrow height, not by the label.
    label.height = 0;
    label.depth = 0;
    return label;
  },
  mathmlBuilder(group, options) {
    var label = new MathNode("mrow", [buildGroup(group.label, options)]);
    label = new MathNode("mpadded", [label]);
    label.setAttribute("width", "0");
    if (group.side === "left") {
      label.setAttribute("lspace", "-1width");
    }
    // We have to guess at vertical alignment. We know the arrow is 1.8em tall,
    // But we don't know the height or depth of the label.
    label.setAttribute("voffset", "0.7em");
    label = new MathNode("mstyle", [label]);
    label.setAttribute("displaystyle", "false");
    label.setAttribute("scriptlevel", "1");
    return label;
  }
});
defineFunction({
  type: "cdlabelparent",
  names: ["\\\\cdparent"],
  props: {
    numArgs: 1
  },
  handler(_ref2, args) {
    var {
      parser
    } = _ref2;
    return {
      type: "cdlabelparent",
      mode: parser.mode,
      fragment: args[0]
    };
  },
  htmlBuilder(group, options) {
    // Wrap the vertical arrow and its labels.
    // The parent gets position: relative. The child gets position: absolute.
    // So CSS can locate the label correctly.
    var parent = wrapFragment(buildGroup$1(group.fragment, options), options);
    parent.classes.push("cd-vert-arrow");
    return parent;
  },
  mathmlBuilder(group, options) {
    return new MathNode("mrow", [buildGroup(group.fragment, options)]);
  }
});

// \@char is an internal function that takes a grouped decimal argument like
// {123} and converts into symbol with code 123.  It is used by the *macro*
// \char defined in macros.js.
defineFunction({
  type: "textord",
  names: ["\\@char"],
  props: {
    numArgs: 1,
    allowedInText: true
  },
  handler(_ref, args) {
    var {
      parser
    } = _ref;
    var arg = assertNodeType(args[0], "ordgroup");
    var group = arg.body;
    var number = "";
    for (var i = 0; i < group.length; i++) {
      var node = assertNodeType(group[i], "textord");
      number += node.text;
    }
    var code = parseInt(number);
    var text;
    if (isNaN(code)) {
      throw new ParseError("\\@char has non-numeric argument " + number);
      // If we drop IE support, the following code could be replaced with
      // text = String.fromCodePoint(code)
    } else if (code < 0 || code >= 0x10ffff) {
      throw new ParseError("\\@char with invalid code point " + number);
    } else if (code <= 0xffff) {
      text = String.fromCharCode(code);
    } else {
      // Astral code point; split into surrogate halves
      code -= 0x10000;
      text = String.fromCharCode((code >> 10) + 0xd800, (code & 0x3ff) + 0xdc00);
    }
    return {
      type: "textord",
      mode: parser.mode,
      text: text
    };
  }
});

var htmlBuilder$8 = (group, options) => {
  var elements = buildExpression$1(group.body, options.withColor(group.color), false);
  // \color isn't supposed to affect the type of the elements it contains.
  // To accomplish this, we wrap the results in a fragment, so the inner
  // elements will be able to directly interact with their neighbors. For
  // example, `\color{red}{2 +} 3` has the same spacing as `2 + 3`
  return makeFragment(elements);
};
var mathmlBuilder$7 = (group, options) => {
  var inner = buildExpression(group.body, options.withColor(group.color));
  var node = new MathNode("mstyle", inner);
  node.setAttribute("mathcolor", group.color);
  return node;
};
defineFunction({
  type: "color",
  names: ["\\textcolor"],
  props: {
    numArgs: 2,
    allowedInText: true,
    argTypes: ["color", "original"]
  },
  handler(_ref, args) {
    var {
      parser
    } = _ref;
    var color = assertNodeType(args[0], "color-token").color;
    var body = args[1];
    return {
      type: "color",
      mode: parser.mode,
      color,
      body: ordargument(body)
    };
  },
  htmlBuilder: htmlBuilder$8,
  mathmlBuilder: mathmlBuilder$7
});
defineFunction({
  type: "color",
  names: ["\\color"],
  props: {
    numArgs: 1,
    allowedInText: true,
    argTypes: ["color"]
  },
  handler(_ref2, args) {
    var {
      parser,
      breakOnTokenText
    } = _ref2;
    var color = assertNodeType(args[0], "color-token").color;
    // Set macro \current@color in current namespace to store the current
    // color, mimicking the behavior of color.sty.
    // This is currently used just to correctly color a \right
    // that follows a \color command.
    parser.gullet.macros.set("\\current@color", color);
    // Parse out the implicit body that should be colored.
    var body = parser.parseExpression(true, breakOnTokenText);
    return {
      type: "color",
      mode: parser.mode,
      color,
      body
    };
  },
  htmlBuilder: htmlBuilder$8,
  mathmlBuilder: mathmlBuilder$7
});

// Row breaks within tabular environments, and line breaks at top level
// \DeclareRobustCommand\\{...\@xnewline}
defineFunction({
  type: "cr",
  names: ["\\\\"],
  props: {
    numArgs: 0,
    numOptionalArgs: 0,
    allowedInText: true
  },
  handler(_ref, args, optArgs) {
    var {
      parser
    } = _ref;
    var size = parser.gullet.future().text === "[" ? parser.parseSizeGroup(true) : null;
    var newLine = !parser.settings.displayMode || !parser.settings.useStrictBehavior("newLineInDisplayMode", "In LaTeX, \\\\ or \\newline " + "does nothing in display mode");
    return {
      type: "cr",
      mode: parser.mode,
      newLine,
      size: size && assertNodeType(size, "size").value
    };
  },
  // The following builders are called only at the top level,
  // not within tabular/array environments.
  htmlBuilder(group, options) {
    var span = makeSpan(["mspace"], [], options);
    if (group.newLine) {
      span.classes.push("newline");
      if (group.size) {
        span.style.marginTop = makeEm(calculateSize(group.size, options));
      }
    }
    return span;
  },
  mathmlBuilder(group, options) {
    var node = new MathNode("mspace");
    if (group.newLine) {
      node.setAttribute("linebreak", "newline");
      if (group.size) {
        node.setAttribute("height", makeEm(calculateSize(group.size, options)));
      }
    }
    return node;
  }
});

var globalMap = {
  "\\global": "\\global",
  "\\long": "\\\\globallong",
  "\\\\globallong": "\\\\globallong",
  "\\def": "\\gdef",
  "\\gdef": "\\gdef",
  "\\edef": "\\xdef",
  "\\xdef": "\\xdef",
  "\\let": "\\\\globallet",
  "\\futurelet": "\\\\globalfuture"
};
var checkControlSequence = tok => {
  var name = tok.text;
  if (/^(?:[\\{}$&#^_]|EOF)$/.test(name)) {
    throw new ParseError("Expected a control sequence", tok);
  }
  return name;
};
var getRHS = parser => {
  var tok = parser.gullet.popToken();
  if (tok.text === "=") {
    // consume optional equals
    tok = parser.gullet.popToken();
    if (tok.text === " ") {
      // consume one optional space
      tok = parser.gullet.popToken();
    }
  }
  return tok;
};
var letCommand = (parser, name, tok, global) => {
  var macro = parser.gullet.macros.get(tok.text);
  if (macro == null) {
    // don't expand it later even if a macro with the same name is defined
    // e.g., \let\foo=\frac \def\frac{\relax} \frac12
    tok.noexpand = true;
    macro = {
      tokens: [tok],
      numArgs: 0,
      // reproduce the same behavior in expansion
      unexpandable: !parser.gullet.isExpandable(tok.text)
    };
  }
  parser.gullet.macros.set(name, macro, global);
};
// <assignment> -> <non-macro assignment>|<macro assignment>
// <non-macro assignment> -> <simple assignment>|\global<non-macro assignment>
// <macro assignment> -> <definition>|<prefix><macro assignment>
// <prefix> -> \global|\long|\outer
defineFunction({
  type: "internal",
  names: ["\\global", "\\long", "\\\\globallong" // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: true
  },
  handler(_ref) {
    var {
      parser,
      funcName
    } = _ref;
    parser.consumeSpaces();
    var token = parser.fetch();
    if (globalMap[token.text]) {
      // KaTeX doesn't have \par, so ignore \long
      if (funcName === "\\global" || funcName === "\\\\globallong") {
        token.text = globalMap[token.text];
      }
      return assertNodeType(parser.parseFunction(), "internal");
    }
    throw new ParseError("Invalid token after macro prefix", token);
  }
});
// Basic support for macro definitions: \def, \gdef, \edef, \xdef
// <definition> -> <def><control sequence><definition text>
// <def> -> \def|\gdef|\edef|\xdef
// <definition text> -> <parameter text><left brace><balanced text><right brace>
defineFunction({
  type: "internal",
  names: ["\\def", "\\gdef", "\\edef", "\\xdef"],
  props: {
    numArgs: 0,
    allowedInText: true,
    primitive: true
  },
  handler(_ref2) {
    var {
      parser,
      funcName
    } = _ref2;
    var tok = parser.gullet.popToken();
    var name = tok.text;
    if (/^(?:[\\{}$&#^_]|EOF)$/.test(name)) {
      throw new ParseError("Expected a control sequence", tok);
    }
    var numArgs = 0;
    var insert;
    var delimiters = [[]];
    // <parameter text> contains no braces
    while (parser.gullet.future().text !== "{") {
      tok = parser.gullet.popToken();
      if (tok.text === "#") {
        // If the very last character of the <parameter text> is #, so that
        // this # is immediately followed by {, TeX will behave as if the {
        // had been inserted at the right end of both the parameter text
        // and the replacement text.
        if (parser.gullet.future().text === "{") {
          insert = parser.gullet.future();
          delimiters[numArgs].push("{");
          break;
        }
        // A parameter, the first appearance of # must be followed by 1,
        // the next by 2, and so on; up to nine #’s are allowed
        tok = parser.gullet.popToken();
        if (!/^[1-9]$/.test(tok.text)) {
          throw new ParseError("Invalid argument number \"" + tok.text + "\"");
        }
        if (parseInt(tok.text) !== numArgs + 1) {
          throw new ParseError("Argument number \"" + tok.text + "\" out of order");
        }
        numArgs++;
        delimiters.push([]);
      } else if (tok.text === "EOF") {
        throw new ParseError("Expected a macro definition");
      } else {
        delimiters[numArgs].push(tok.text);
      }
    }
    // replacement text, enclosed in '{' and '}' and properly nested
    var {
      tokens
    } = parser.gullet.consumeArg();
    if (insert) {
      tokens.unshift(insert);
    }
    if (funcName === "\\edef" || funcName === "\\xdef") {
      tokens = parser.gullet.expandTokens(tokens);
      tokens.reverse(); // to fit in with stack order
    }
    // Final arg is the expansion of the macro
    parser.gullet.macros.set(name, {
      tokens,
      numArgs,
      delimiters
    }, funcName === globalMap[funcName]);
    return {
      type: "internal",
      mode: parser.mode
    };
  }
});
// <simple assignment> -> <let assignment>
// <let assignment> -> \futurelet<control sequence><token><token>
//     | \let<control sequence><equals><one optional space><token>
// <equals> -> <optional spaces>|<optional spaces>=
defineFunction({
  type: "internal",
  names: ["\\let", "\\\\globallet" // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: true,
    primitive: true
  },
  handler(_ref3) {
    var {
      parser,
      funcName
    } = _ref3;
    var name = checkControlSequence(parser.gullet.popToken());
    parser.gullet.consumeSpaces();
    var tok = getRHS(parser);
    letCommand(parser, name, tok, funcName === "\\\\globallet");
    return {
      type: "internal",
      mode: parser.mode
    };
  }
});
// ref: https://www.tug.org/TUGboat/tb09-3/tb22bechtolsheim.pdf
defineFunction({
  type: "internal",
  names: ["\\futurelet", "\\\\globalfuture" // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: true,
    primitive: true
  },
  handler(_ref4) {
    var {
      parser,
      funcName
    } = _ref4;
    var name = checkControlSequence(parser.gullet.popToken());
    var middle = parser.gullet.popToken();
    var tok = parser.gullet.popToken();
    letCommand(parser, name, tok, funcName === "\\\\globalfuture");
    parser.gullet.pushToken(tok);
    parser.gullet.pushToken(middle);
    return {
      type: "internal",
      mode: parser.mode
    };
  }
});

/**
 * This file deals with creating delimiters of various sizes. The TeXbook
 * discusses these routines on page 441-442, in the "Another subroutine sets box
 * x to a specified variable delimiter" paragraph.
 *
 * There are three main routines here. `makeSmallDelim` makes a delimiter in the
 * normal font, but in either text, script, or scriptscript style.
 * `makeLargeDelim` makes a delimiter in textstyle, but in one of the Size1,
 * Size2, Size3, or Size4 fonts. `makeStackedDelim` makes a delimiter out of
 * smaller pieces that are stacked on top of one another.
 *
 * The functions take a parameter `center`, which determines if the delimiter
 * should be centered around the axis.
 *
 * Then, there are three exposed functions. `sizedDelim` makes a delimiter in
 * one of the given sizes. This is used for things like `\bigl`.
 * `customSizedDelim` makes a delimiter with a given total height+depth. It is
 * called in places like `\sqrt`. `leftRightDelim` makes an appropriate
 * delimiter which surrounds an expression of a given height an depth. It is
 * used in `\left` and `\right`.
 */
/**
 * Get the metrics for a given symbol and font, after transformation (i.e.
 * after following replacement from symbols.js)
 */
var getMetrics = function getMetrics(symbol, font, mode) {
  var replace = symbols.math[symbol] && symbols.math[symbol].replace;
  var metrics = getCharacterMetrics(replace || symbol, font, mode);
  if (!metrics) {
    throw new Error("Unsupported symbol " + symbol + " and font size " + font + ".");
  }
  return metrics;
};
/**
 * Puts a delimiter span in a given style, and adds appropriate height, depth,
 * and maxFontSizes.
 */
var styleWrap = function styleWrap(delim, toStyle, options, classes) {
  var newOptions = options.havingBaseStyle(toStyle);
  var span = makeSpan(classes.concat(newOptions.sizingClasses(options)), [delim], options);
  var delimSizeMultiplier = newOptions.sizeMultiplier / options.sizeMultiplier;
  span.height *= delimSizeMultiplier;
  span.depth *= delimSizeMultiplier;
  span.maxFontSize = newOptions.sizeMultiplier;
  return span;
};
var centerSpan = function centerSpan(span, options, style) {
  var newOptions = options.havingBaseStyle(style);
  var shift = (1 - options.sizeMultiplier / newOptions.sizeMultiplier) * options.fontMetrics().axisHeight;
  span.classes.push("delimcenter");
  span.style.top = makeEm(shift);
  span.height -= shift;
  span.depth += shift;
};
/**
 * Makes a small delimiter. This is a delimiter that comes in the Main-Regular
 * font, but is restyled to either be in textstyle, scriptstyle, or
 * scriptscriptstyle.
 */
var makeSmallDelim = function makeSmallDelim(delim, style, center, options, mode, classes) {
  var text = makeSymbol(delim, "Main-Regular", mode, options);
  var span = styleWrap(text, style, options, classes);
  if (center) {
    centerSpan(span, options, style);
  }
  return span;
};
/**
 * Builds a symbol in the given font size (note size is an integer)
 */
var mathrmSize = function mathrmSize(value, size, mode, options) {
  return makeSymbol(value, "Size" + size + "-Regular", mode, options);
};
/**
 * Makes a large delimiter. This is a delimiter that comes in the Size1, Size2,
 * Size3, or Size4 fonts. It is always rendered in textstyle.
 */
var makeLargeDelim = function makeLargeDelim(delim, size, center, options, mode, classes) {
  var inner = mathrmSize(delim, size, mode, options);
  var span = styleWrap(makeSpan(["delimsizing", "size" + size], [inner], options), Style$1.TEXT, options, classes);
  if (center) {
    centerSpan(span, options, Style$   1.TEXT);
  }
  return span;
};
/**
 * Make a span from a font glyph with the given offset and in the given font.
 * This is used in makeStackedDelim to make the stacking pieces for the delimiter.
 */
var makeGlyphSpan = function makeGlyphSpan(symbol, font, mode) {
  var sizeClass;
  // Apply the correct CSS class to choose the right font.
  if (font === "Size1-Regular") {
    sizeClass = "delim-size1";
  } else /* if (font === "Size4-Regular") */{
      sizeClass = "delim-size4";
    }
  var corner = makeSpan(["delimsizinginner", sizeClass], [makeSpan([], [makeSymbol(symbol, font, mode)])]);
  // Since this will be passed into `makeVList` in the end, wrap the element
  // in the appropriate tag that VList uses.
  return {
    type: "elem",
    elem: corner
  };
};
var makeInner = function makeInner(ch, height, options) {
  // Create a span with inline SVG for the inner part of a tall stacked delimiter.
  var width = fontMetricsData['Size4-Regular'][ch.charCodeAt(0)] ? fontMetricsData['Size4-Regular'][ch.charCodeAt(0)][4] : fontMetricsData['Size1-Regular'][ch.charCodeAt(0)][4];
  var path = new PathNode("inner", innerPath(ch, Math.round(1000 * height)));
  var svgNode = new SvgNode([path], {
    "width": makeEm(width),
    "height": makeEm(height),
    // Override CSS rule `.katex svg { width: 100% }`
    "style": "width:" + makeEm(width),
    "viewBox": "0 0 " + 1000 * width + " " + Math.round(1000 * height),
    "preserveAspectRatio": "xMinYMin"
  });
  var span = makeSvgSpan([], [svgNode], options);
  span.height = height;
  span.style.height = makeEm(height);
  span.style.width = makeEm(width);
  return {
    type: "elem",
    elem: span
  };
};
// Helpers for makeStackedDelim
var lapInEms = 0.008;
var lap = {
  type: "kern",
  size: -1 * lapInEms
};
var verts = new Set(["|", "\\lvert", "\\rvert", "\\vert"]);
var doubleVerts = new Set(["\\|", "\\lVert", "\\rVert", "\\Vert"]);
/**
 * Make a stacked delimiter out of a given delimiter, with the total height at
 * least `heightTotal`. This routine is mentioned on page 442 of the TeXbook.
 */
var makeStackedDelim = function makeStackedDelim(delim, heightTotal, center, options, mode, classes) {
  // There are four parts, the top, an optional middle, a repeated part, and a
  // bottom.
  var top;
  var middle;
  var repeat;
  var bottom;
  var svgLabel = "";
  var viewBoxWidth = 0;
  top = repeat = bottom = delim;
  middle = null;
  // Also keep track of what font the delimiters are in
  var font = "Size1-Regular";
  // We set the parts and font based on the symbol. Note that we use
  // '\u23d0' instead of '|' and '\u2016' instead of '\\|' for the
  // repeats of the arrows
  if (delim === "\\uparrow") {
    repeat = bottom = "\u23d0";
  } else if (delim === "\\Uparrow") {
    repeat = bottom = "\u2016";
  } else if (delim === "\\downarrow") {
    top = repeat = "\u23d0";
  } else if (delim === "\\Downarrow") {
    top = repeat = "\u2016";
  } else if (delim === "\\updownarrow") {
    top = "\\uparrow";
    repeat = "\u23d0";
    bottom = "\\downarrow";
  } else if (delim === "\\Updownarrow") {
    top = "\\Uparrow";
    repeat = "\u2016";
    bottom = "\\Downarrow";
  } else if (verts.has(delim)) {
    repeat = "\u2223";
    svgLabel = "vert";
    viewBoxWidth = 333;
  } else if (doubleVerts.has(delim)) {
    repeat = "\u2225";
    svgLabel = "doublevert";
    viewBoxWidth = 556;
  } else if (delim === "[" || delim === "\\lbrack") {
    top = "\u23a1";
    repeat = "\u23a2";
    bottom = "\u23a3";
    font = "Size4-Regular";
    svgLabel = "lbrack";
    viewBoxWidth = 667;
  } else if (delim === "]" || delim === "\\rbrack") {
    top = "\u23a4";
    repeat = "\u23a5";
    bottom = "\u23a6";
    font = "Size4-Regular";
    svgLabel = "rbrack";
    viewBoxWidth = 667;
  } else if (delim === "\\lfloor" || delim === "\u230a") {
    repeat = top = "\u23a2";
    bottom = "\u23a3";
    font = "Size4-Regular";
    svgLabel = "lfloor";
    viewBoxWidth = 667;
  } else if (delim === "\\lceil" || delim === "\u2308") {
    top = "\u23a1";
    repeat = bottom = "\u23a2";
    font = "Size4-Regular";
    svgLabel = "lceil";
    viewBoxWidth = 667;
  } else if (delim === "\\rfloor" || delim === "\u230b") {
    repeat = top = "\u23a5";
    bottom = "\u23a6";
    font = "Size4-Regular";
    svgLabel = "rfloor";
    viewBoxWidth = 667;
  } else if (delim === "\\rceil" || delim === "\u2309") {
    top = "\u23a4";
    repeat = bottom = "\u23a5";
    font = "Size4-Regular";
    svgLabel = "rceil";
    viewBoxWidth = 667;
  } else if (delim === "(" || delim === "\\lparen") {
    top = "\u239b";
    repeat = "\u239c";
    bottom = "\u239d";
    font = "Size4-Regular";
    svgLabel = "lparen";
    viewBoxWidth = 875;
  } else if (delim === ")" || delim === "\\rparen") {
    top = "\u239e";
    repeat = "\u239f";
    bottom = "\u23a0";
    font = "Size4-Regular";
    svgLabel = "rparen";
    viewBoxWidth = 875;
  } else if (delim === "\\{" || delim === "\\lbrace") {
    top = "\u23a7";
    middle = "\u23a8";
    bottom = "\u23a9";
    repeat = "\u23aa";
    font = "Size4-Regular";
  } else if (delim === "\\}" || delim === "\\rbrace") {
    top = "\u23ab";
    middle = "\u23ac";
    bottom = "\u23ad";
    repeat = "\u23aa";
    font = "Size4-Regular";
  } else if (delim === "\\lgroup" || delim === "\u27ee") {
    top = "\u23a7";
    bottom = "\u23a9";
    repeat = "\u23aa";
    font = "Size4-Regular";
  } else if (delim === "\\rgroup" || delim === "\u27ef") {
    top = "\u23ab";
    bottom = "\u23ad";
    repeat = "\u23aa";
    font = "Size4-Regular";
  } else if (delim === "\\lmoustache" || delim === "\u23b0") {
    top = "\u23a7";
    bottom = "\u23ad";
    repeat = "\u23aa";
    font = "Size4-Regular";
  } else if (delim === "\\rmoustache" || delim === "\u23b1") {
    top = "\u23ab";
    bottom = "\u23a9";
    repeat = "\u23aa";
    font = "Size4-Regular";
  }
  // Get the metrics of the four sections
  var topMetrics = getMetrics(top, font, mode);
  var topHeightTotal = topMetrics.height + topMetrics.depth;
  var repeatMetrics = getMetrics(repeat, font, mode);
  var repeatHeightTotal = repeatMetrics.height + repeatMetrics.depth;
  var bottomMetrics = getMetrics(bottom, font, mode);
  var bottomHeightTotal = bottomMetrics.height + bottomMetrics.depth;
  var middleHeightTotal = 0;
  var middleFactor = 1;
  if (middle !== null) {
    var middleMetrics = getMetrics(middle, font, mode);
    middleHeightTotal = middleMetrics.height + middleMetrics.depth;
    middleFactor = 2; // repeat symmetrically above and below middle
  }
  // Calculate the minimal height that the delimiter can have.
  // It is at least the size of the top, bottom, and optional middle combined.
  var minHeight = topHeightTotal + bottomHeightTotal + middleHeightTotal;
  // Compute the number of copies of the repeat symbol we will need
  var repeatCount = Math.max(0, Math.ceil((heightTotal - minHeight) / (middleFactor * repeatHeightTotal)));
  // Compute the total height of the delimiter including all the symbols
  var realHeightTotal = minHeight + repeatCount * middleFactor * repeatHeightTotal;
  // The center of the delimiter is placed at the center of the axis. Note
  // that in this context, "center" means that the delimiter should be
  // centered around the axis in the current style, while normally it is
  // centered around the axis in textstyle.
  var axisHeight = options.fontMetrics().axisHeight;
  if (center) {
    axisHeight *= options.sizeMultiplier;
  }
  // Calculate the depth
  var depth = realHeightTotal / 2 - axisHeight;
  // Now, we start building the pieces that will go into the vlist
  // Keep a list of the pieces of the stacked delimiter
  var stack = [];
  if (svgLabel.length > 0) {
    // Instead of stacking glyphs, create a single SVG.
    // This evades browser problems with imprecise positioning of spans.
    var midHeight = realHeightTotal - topHeightTotal - bottomHeightTotal;
    var viewBoxHeight = Math.round(realHeightTotal * 1000);
    var pathStr = tallDelim(svgLabel, Math.round(midHeight * 1000));
    var path = new PathNode(svgLabel, pathStr);
    var width = makeEm(viewBoxWidth / 1000);
    var height = makeEm(viewBoxHeight / 1000);
    var svg = new SvgNode([path], {
      "width": width,
      "height": height,
      "viewBox": "0 0 " + viewBoxWidth + " " + viewBoxHeight
    });
    var wrapper = makeSvgSpan([], [svg], options);
    wrapper.height = viewBoxHeight / 1000;
    wrapper.style.width = width;
    wrapper.style.height = height;
    stack.push({
      type: "elem",
      elem: wrapper
    });
  } else {
    // Stack glyphs
    // Start by adding the bottom symbol
    stack.push(makeGlyphSpan(bottom, font, mode));
    stack.push(lap); // overlap
    if (middle === null) {
      // The middle section will be an SVG. Make it an extra 0.016em tall.
      // We'll overlap by 0.008em at top and bottom.
      var innerHeight = realHeightTotal - topHeightTotal - bottomHeightTotal + 2 * lapInEms;
      stack.push(makeInner(repeat, innerHeight, options));
    } else {
      // When there is a middle bit, we need the middle part and two repeated
      // sections
      var _innerHeight = (realHeightTotal - topHeightTotal - bottomHeightTotal - middleHeightTotal) / 2 + 2 * lapInEms;
      stack.push(makeInner(repeat, _innerHeight, options));
      // Now insert the middle of the brace.
      stack.push(lap);
      stack.push(makeGlyphSpan(middle, font, mode));
      stack.push(lap);
      stack.push(makeInner(repeat, _innerHeight, options));
    }
    // Add the top symbol
    stack.push(lap);
    stack.push(makeGlyphSpan(top, font, mode));
  }
  // Finally, build the vlist
  var newOptions = options.havingBaseStyle(Style$1.TEXT);
  var inner = makeVList({
    positionType: "bottom",
    positionData: depth,
    children: stack
  });
  return styleWrap(makeSpan(["delimsizing", "mult"], [inner], newOptions), Style$1.TEXT, options, classes);
};
// All surds have 0.08em padding above the vinculum inside the SVG.
// That keeps browser span height rounding error from pinching the line.
var vbPad = 80; // padding above the surd, measured inside the viewBox.
var emPad = 0.08; // padding, in ems, measured in the document.
var sqrtSvg = function sqrtSvg(sqrtName, height, viewBoxHeight, extraVinculum, options) {
  var path = sqrtPath(sqrtName, extraVinculum, viewBoxHeight);
  var pathNode = new PathNode(sqrtName, path);
  var svg = new SvgNode([pathNode], {
    // Note: 1000:1 ratio of viewBox to document em width.
    "width": "400em",
    "height": makeEm(height),
    "viewBox": "0 0 400000 " + viewBoxHeight,
    "preserveAspectRatio": "xMinYMin slice"
  });
  return makeSvgSpan(["hide-tail"], [svg], options);
};
/**
 * Make a sqrt image of the given height,
 */
var makeSqrtImage = function makeSqrtImage(height, options) {
  // Define a newOptions that removes the effect of size changes such as \Huge.
  // We don't pick different a height surd for \Huge. For it, we scale up.
  var newOptions = options.havingBaseSizing();
  // Pick the desired surd glyph from a sequence of surds.
  var delim = traverseSequence("\\surd", height * newOptions.sizeMultiplier, stackLargeDelimiterSequence, newOptions);
  var sizeMultiplier = newOptions.sizeMultiplier; // default
  // The standard sqrt SVGs each have a 0.04em thick vinculum.
  // If Settings.minRuleThickness is larger than that, we add extraVinculum.
  var extraVinculum = Math.max(0, options.minRuleThickness - options.fontMetrics().sqrtRuleThickness);
  // Create a span containing an SVG image of a sqrt symbol.
  var span;
  var spanHeight;
  var texHeight;
  var viewBoxHeight;
  var advanceWidth;
  // We create viewBoxes with 80 units of "padding" above each surd.
  // Then browser rounding error on the parent span height will not
  // encroach on the ink of the vinculum. But that padding is not
  // included in the TeX-like `height` used for calculation of
  // vertical alignment. So texHeight = span.height < span.style.height.
  if (delim.type === "small") {
    // Get an SVG that is derived from glyph U+221A in font KaTeX-Main.
    // 1000 unit normal glyph height.
    viewBoxHeight = 1000 + 1000 * extraVinculum + vbPad;
    if (height < 1.0) {
      sizeMultiplier = 1.0; // mimic a \textfont radical
    } else if (height < 1.4) {
      sizeMultiplier = 0.7; // mimic a \scriptfont radical
    }
    spanHeight = (1.0 + extraVinculum + emPad) / sizeMultiplier;
    texHeight = (1.00 + extraVinculum) / sizeMultiplier;
    span = sqrtSvg("sqrtMain", spanHeight, viewBoxHeight, extraVinculum, options);
    span.style.minWidth = "0.853em";
    advanceWidth = 0.833 / sizeMultiplier; // from the font.
  } else if (delim.type === "large") {
    // These SVGs come from fonts: KaTeX_Size1, _Size2, etc.
    viewBoxHeight = (1000 + vbPad) * sizeToMaxHeight[delim.size];
    texHeight = (sizeToMaxHeight[delim.size] + extraVinculum) / sizeMultiplier;
    spanHeight = (sizeToMaxHeight[delim.size] + extraVinculum + emPad) / sizeMultiplier;
    span = sqrtSvg("sqrtSize" + delim.size, spanHeight, viewBoxHeight, extraVinculum, options);
    span.style.minWidth = "1.02em";
    advanceWidth = 1.0 / sizeMultiplier; // 1.0 from the font.
  } else {
    // Tall sqrt. In TeX, this would be stacked using multiple glyphs.
    // We'll use a single SVG to accomplish the same thing.
    spanHeight = height + extraVinculum + emPad;
    texHeight = height + extraVinculum;
    viewBoxHeight = Math.floor(1000 * height + extraVinculum) + vbPad;
    span = sqrtSvg("sqrtTall", spanHeight, viewBoxHeight, extraVinculum, options);
    span.style.minWidth = "0.742em";
    advanceWidth = 1.056;
  }
  span.height = texHeight;
  span.style.height = makeEm(spanHeight);
  return {
    span,
    advanceWidth,
    // Calculate the actual line width.
    // This actually should depend on the chosen font -- e.g. \boldmath
    // should use the thicker surd symbols from e.g. KaTeX_Main-Bold, and
    // have thicker rules.
    ruleWidth: (options.fontMetrics().sqrtRuleThickness + extraVinculum) * sizeMultiplier
  };
};
// There are three kinds of delimiters, delimiters that stack when they become
// too large
var stackLargeDelimiters = new Set(["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "\u230a", "\u230b", "\\lceil", "\\rceil", "\u2308", "\u2309", "\\surd"]);
// delimiters that always stack
var stackAlwaysDelimiters = new Set(["\\uparrow", "\\downarrow", "\\updownarrow", "\\Uparrow", "\\Downarrow", "\\Updownarrow", "|", "\\|", "\\vert", "\\Vert", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "\u27ee", "\u27ef", "\\lmoustache", "\\rmoustache", "\u23b0", "\u23b1"]);
// and delimiters that never stack
var stackNeverDelimiters = new Set(["<", ">", "\\langle", "\\rangle", "/", "\\backslash", "\\lt", "\\gt"]);
// Metrics of the different sizes. Found by looking at TeX's output of
// $\bigl| // \Bigl| \biggl| \Biggl| \showlists$
// Used to create stacked delimiters of appropriate sizes in makeSizedDelim.
var sizeToMaxHeight = [0, 1.2, 1.8, 2.4, 3.0];
/**
 * Used to create a delimiter of a specific size, where `size` is 1, 2, 3, or 4.
 */
var makeSizedDelim = function makeSizedDelim(delim, size, options, mode, classes) {
  // < and > turn into \langle and \rangle in delimiters
  if (delim === "<" || delim === "\\lt" || delim === "\u27e8") {
    delim = "\\langle";
  } else if (delim === ">" || delim === "\\gt" || delim === "\u27e9") {
    delim = "\\rangle";
  }
  // Sized delimiters are never centered.
  if (stackLargeDelimiters.has(delim) || stackNeverDelimiters.has(delim)) {
    return makeLargeDelim(delim, size, false, options, mode, classes);
  } else if (stackAlwaysDelimiters.has(delim)) {
    return makeStackedDelim(delim, sizeToMaxHeight[size], false, options, mode, classes);
  } else {
    throw new ParseError("Illegal delimiter: '" + delim + "'");
  }
};
// Delimiters that never stack try small delimiters and large delimiters only
var stackNeverDelimiterSequence = [{
  type: "small",
  style: Style$1.SCRIPTSCRIPT
}, {
  type: "small",
  style: Style$1.SCRIPT
}, {
  type: "small",
  style: Style$1.TEXT
}, {
  type: "large",
  size: 1
}, {
  type: "large",
  size: 2
}, {
  type: "large",
  size: 3
}, {
  type: "large",
  size: 4
}];
// Delimiters that always stack try the small delimiters first, then stack
var stackAlwaysDelimiterSequence = [{
  type: "small",
  style: Style$1.SCRIPTSCRIPT
}, {
  type: "small",
  style: Style$1.SCRIPT
}, {
  type: "small",
  style: Style$1.TEXT
}, {
  type: "stack"
}];
// Delimiters that stack when large try the small and then large delimiters, and
// stack afterwards
var stackLargeDelimiterSequence = [{
  type: "small",
  style: Style$1.SCRIPTSCRIPT
}, {
  type: "small",
  style: Style$1.SCRIPT
}, {
  type: "small",
  style: Style$1.TEXT
}, {
  type: "large",
  size: 1
}, {
  type: "large",
  size: 2
}, {
  type: "large",
  size: 3
}, {
  type: "large",
  size: 4
}, {
  type: "stack"
}];
/**
 * Get the font used in a delimiter based on what kind of delimiter it is.
 * TODO(#963) Use more specific font family return type once that is introduced.
 */
var delimTypeToFont = function delimTypeToFont(type) {
  if (type.type === "small") {
    return "Main-Regular";
  } else if (type.type === "large") {
    return "Size" + type.size + "-Regular";
  } else if (type.type === "stack") {
    return "Size4-Regular";
  } else {
    var delimKind = type.type;
    throw new Error("Add support for delim type '" + delimKind + "' here.");
  }
};
/**
 * Traverse a sequence of types of delimiters to decide what kind of delimiter
 * should be used to create a delimiter of the given height+depth.
 */
var traverseSequence = function traverseSequence(delim, height, sequence, options) {
  // Here, we choose the index we should start at in the sequences. In smaller
  // sizes (which correspond to larger numbers in style.size) we start earlier
  // in the sequence. Thus, scriptscript starts at index 3-3=0, script starts
  // at index 3-2=1, text starts at 3-1=2, and display starts at min(2,3-0)=2
  var start = Math.min(2, 3 - options.style.size);
  for (var i = start; i < sequence.length; i++) {
    var delimType = sequence[i];
    if (delimType.type === "stack") {
      // This is always the last delimiter, so we just break the loop now.
      break;
    }
    var metrics = getMetrics(delim, delimTypeToFont(delimType), "math");
    var heightDepth = metrics.height + metrics.depth;
    // Small delimiters are scaled down versions of the same font, so we
    // account for the style change size.
    if (delimType.type === "small") {
      var newOptions = options.havingBaseStyle(delimType.style);
      heightDepth *= newOptions.sizeMultiplier;
    }
    // Check if the delimiter at this size works for the given height.
    if (heightDepth > height) {
      return delimType;
    }
  }
  // If we reached the end of the sequence, return the last sequence element.
  return sequence[sequence.length - 1];
};
/**
 * Make a delimiter of a given height+depth, with optional centering. Here, we
 * traverse the sequences, and create a delimiter that the sequence tells us to.
 */
var makeCustomSizedDelim = function makeCustomSizedDelim(delim, height, center, options, mode, classes) {
  if (delim === "<" || delim === "\\lt" || delim === "\u27e8") {
    delim = "\\langle";
  } else if (delim === ">" || delim === "\\gt" || delim === "\u27e9") {
    delim = "\\rangle";
  }
  // Decide what sequence to use
  var sequence;
  if (stackNeverDelimiters.has(delim)) {
    sequence = stackNeverDelimiterSequence;
  } else if (stackLargeDelimiters.has(delim)) {
    sequence = stackLargeDelimiterSequence;
  } else {
    sequence = stackAlwaysDelimiterSequence;
  }
  // Look through the sequence
  var delimType = traverseSequence(delim, height, sequence, options);
  // Get the delimiter from font glyphs.
  // Depending on the sequence element we decided on, call the
  // appropriate function.
  if (delimType.type === "small") {
    return makeSmallDelim(delim, delimType.style, center, options, mode, classes);
  } else if (delimType.type === "large") {
    return makeLargeDelim(delim, delimType.size, center, options, mode, classes);
  } else /* if (delimType.type === "stack") */{
      return makeStackedDelim(delim, height, center, options, mode, classes);
    }
};
/**
 * Make a delimiter for use with `\left` and `\right`, given a height and depth
 * of an expression that the delimiters surround.
 */
var makeLeftRightDelim = function makeLeftRightDelim(delim, height, depth, options, mode, classes) {
  // We always center \left/\right delimiters, so the axis is always shifted
  var axisHeight = options.fontMetrics().axisHeight * options.sizeMultiplier;
  // Taken from TeX source, tex.web, function make_left_right
  var delimiterFactor = 901;
  var delimiterExtend = 5.0 / options.fontMetrics().ptPerEm;
  var maxDistFromAxis = Math.max(height - axisHeight, depth + axisHeight);
  var totalHeight = Math.max(
  // In real TeX, calculations are done using integral values which are
  // 65536 per pt, or 655360 per em. So, the division here truncates in
  // TeX but doesn't here, producing different results. If we wanted to
  // exactly match TeX's calculation, we could do
  //   Math.floor(655360 * maxDistFromAxis / 500) *
  //    delimiterFactor / 655360
  // (To see the difference, compare
  //    x^{x^{\left(\rule{0.1em}{0.68em}\right)}}
  // in TeX and KaTeX)
  maxDistFromAxis / 500 * delimiterFactor, 2 * maxDistFromAxis - delimiterExtend);
  // Finally, we defer to `makeCustomSizedDelim` with our calculated total
  // height
  return makeCustomSizedDelim(delim, totalHeight, true, options, mode, classes);
};

// Extra data needed for the delimiter handler down below
var delimiterSizes = {
  "\\bigl": {
    mclass: "mopen",
    size: 1
  },
  "\\Bigl": {
    mclass: "mopen",
    size: 2
  },
  "\\biggl": {
    mclass: "mopen",
    size: 3
  },
  "\\Biggl": {
    mclass: "mopen",
    size: 4
  },
  "\\bigr": {
    mclass: "mclose",
    size: 1
  },
  "\\Bigr": {
    mclass: "mclose",
    size: 2
  },
  "\\biggr": {
    mclass: "mclose",
    size: 3
  },
  "\\Biggr": {
    mclass: "mclose",
    size: 4
  },
  "\\bigm": {
    mclass: "mrel",
    size: 1
  },
  "\\Bigm": {
    mclass: "mrel",
    size: 2
  },
  "\\biggm": {
    mclass: "mrel",
    size: 3
  },
  "\\Biggm": {
    mclass: "mrel",
    size: 4
  },
  "\\big": {
    mclass: "mord",
    size: 1
  },
  "\\Big": {
    mclass: "mord",
    size: 2
  },
  "\\bigg": {
    mclass: "mord",
    size: 3
  },
  "\\Bigg": {
    mclass: "mord",
    size: 4
  }
};
var delimiters = new Set(["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "\u230a", "\u230b", "\\lceil", "\\rceil", "\u2308", "\u2309", "<", ">", "\\langle", "\u27e8", "\\rangle", "\u27e9", "\\lt", "\\gt", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "\u27ee", "\u27ef", "\\lmoustache", "\\rmoustache", "\u23b0", "\u23b1", "/", "\\backslash", "|", "\\vert", "\\|", "\\Vert", "\\uparrow", "\\Uparrow", "\\downarrow", "\\Downarrow", "\\updownarrow", "\\Updownarrow", "."]);
function isMiddleDelimNode(node) {
  return 'isMiddle' in node;
}
// Delimiter functions
function checkDelimiter(delim, context) {
  var symDelim = checkSymbolNodeType(delim);
  if (symDelim && delimiters.has(symDelim.text)) {
    return symDelim;
  } else if (symDelim) {
    throw new ParseError("Invalid delimiter '" + symDelim.text + "' after '" + context.funcName + "'", delim);
  } else {
    throw new ParseError("Invalid delimiter type '" + delim.type + "'", delim);
  }
}
defineFunction({
  type: "delimsizing",
  names: ["\\bigl", "\\Bigl", "\\biggl", "\\Biggl", "\\bigr", "\\Bigr", "\\biggr", "\\Biggr", "\\bigm", "\\Bigm", "\\biggm", "\\Biggm", "\\big", "\\Big", "\\bigg", "\\Bigg"],
  props: {
    numArgs: 1,
    argTypes: ["primitive"]
  },
  handler: (context, args) => {
    var delim = checkDelimiter(args[0], context);
    return {
      type: "delimsizing",
      mode: context.parser.mode,
      size: delimiterSizes[context.funcName].size,
      mclass: delimiterSizes[context.funcName].mclass,
      delim: delim.text
    };
  },
  htmlBuilder: (group, options) => {
    if (group.delim === ".") {
      // Empty delimiters still count as elements, even though they don't
      // show anything.
      return makeSpan([group.mclass]);
    }
    return makeSizedDelim(group.delim, group.size, options, group.mode, [group.mclass]);
  },
  mathmlBuilder: group => {
    var children = [];
    if (group.delim !== ".") {
      children.push(makeText(group.delim, group.mode));
    }
    var node = new MathNode("mo", children);
    if (group.mclass === "mopen" || group.mclass === "mclose") {
      // Only some of the delimsizing functions act as fences, and they
      // return "mopen" or "mclose" mclass.
      node.setAttribute("fence", "true");
    } else {
      // Explicitly disable fencing if it's not a fence, to override the
      // defaults.
      node.setAttribute("fence", "false");
    }
    node.setAttribute("stretchy", "true");
    var size = makeEm(sizeToMaxHeight[group.size]);
    node.setAttribute("minsize", size);
    node.setAttribute("maxsize", size);
    return node;
  }
});
function assertParsed(group) {
  if (!group.body) {
    throw new Error("Bug: The leftright ParseNode wasn't fully parsed.");
  }
}
defineFunction({
  type: "leftright-right",
  names: ["\\right"],
  props: {
    numArgs: 1,
    primitive: true
  },
  handler: (context, args) => {
    // \left case below triggers parsing of \right in
    //   `const right = parser.parseFunction();`
    // uses this return value.
    var color = context.parser.gullet.macros.get("\\current@color");
    if (color && typeof color !== "string") {
      throw new ParseError("\\current@color set to non-string in \\right");
    }
    return {
      type: "leftright-right",
      mode: context.parser.mode,
      delim: checkDelimiter(args[0], context).text,
      color: color // undefined if not set via \color
    };
  }
});
defineFunction({
  type: "leftright",
  names: ["\\left"],
  props: {
    numArgs: 1,
    primitive: true
  },
  handler: (context, args) => {
    var delim = checkDelimiter(args[0], context);
    var parser = context.parser;
    // Parse out the implicit body
    ++parser.leftrightDepth;
    // parseExpression stops before '\\right'
    var body = parser.parseExpression(false);
    --parser.leftrightDepth;
    // Check the next token
    parser.expect("\\right", false);
    var right = assertNodeType(parser.parseFunction(), "leftright-right");
    return {
      type: "leftright",
      mode: parser.mode,
      body,
      left: delim.text,
      right: right.delim,
      rightColor: right.color
    };
  },
  htmlBuilder: (group, options) => {
    assertParsed(group);
    // Build the inner expression
    var inner = buildExpression$1(group.body, options, true, ["mopen", "mclose"]);
    var innerHeight = 0;
    var innerDepth = 0;
    var hadMiddle = false;
    // Calculate its height and depth
    for (var i = 0; i < inner.length; i++) {
      var node = inner[i];
      if (isMiddleDelimNode(node)) {
        hadMiddle = true;
      } else {
        innerHeight = Math.max(inner[i].height, innerHeight);
        innerDepth = Math.max(inner[i].depth, innerDepth);
      }
    }
    // The size of delimiters is the same, regardless of what style we are
    // in. Thus, to correctly calculate the size of delimiter we need around
    // a group, we scale down the inner size based on the size.
    innerHeight *= options.sizeMultiplier;
    innerDepth *= options.sizeMultiplier;
    var leftDelim;
    if (group.left === ".") {
      // Empty delimiters in \left and \right make null delimiter spaces.
      leftDelim = makeNullDelimiter(options, ["mopen"]);
    } else {
      // Otherwise, use leftRightDelim to generate the correct sized
      // delimiter.
      leftDelim = makeLeftRightDelim(group.left, innerHeight, innerDepth, options, group.mode, ["mopen"]);
    }
    // Add it to the beginning of the expression
    inner.unshift(leftDelim);
    // Handle middle delimiters
    if (hadMiddle) {
      for (var _i = 1; _i < inner.length; _i++) {
        var middleDelim = inner[_i];
        if (isMiddleDelimNode(middleDelim)) {
          var isMiddle = middleDelim.isMiddle;
          // Apply the options that were active when \middle was called
          inner[_i] = makeLeftRightDelim(isMiddle.delim, innerHeight, innerDepth, isMiddle.options, group.mode, []);
        }
      }
    }
    var rightDelim;
    // Same for the right delimiter, but using color specified by \color
    if (group.right === ".") {
      rightDelim = makeNullDelimiter(options, ["mclose"]);
    } else {
      var colorOptions = group.rightColor ? options.withColor(group.rightColor) : options;
      rightDelim = makeLeftRightDelim(group.right, innerHeight, innerDepth, colorOptions, group.mode, ["mclose"]);
    }
    // Add it to the end of the expression.
    inner.push(rightDelim);
    return makeSpan(["minner"], inner, options);
  },
  mathmlBuilder: (group, options) => {
    assertParsed(group);
    var inner = buildExpression(group.body, options);
    if (group.left !== ".") {
      var leftNode = new MathNode("mo", [makeText(group.left, group.mode)]);
      leftNode.setAttribute("fence", "true");
      inner.unshift(leftNode);
    }
    if (group.right !== ".") {
      var rightNode = new MathNode("mo", [makeText(group.right, group.mode)]);
      rightNode.setAttribute("fence", "true");
      if (group.rightColor) {
        rightNode.setAttribute("mathcolor", group.rightColor);
      }
      inner.push(rightNode);
    }
    return makeRow(inner);
  }
});
defineFunction({
  type: "middle",
  names: ["\\middle"],
  props: {
    numArgs: 1,
    primitive: true
  },
  handler: (context, args) => {
    var delim = checkDelimiter(args[0], context);
    if (!context.parser.leftrightDepth) {
      throw new ParseError("\\middle without preceding \\left", delim);
    }
    return {
      type: "middle",
      mode: context.parser.mode,
      delim: delim.text
    };
  },
  htmlBuilder: (group, options) => {
    var middleDelim;
    if (group.delim === ".") {
      middleDelim = makeNullDelimiter(options, []);
    } else {
      middleDelim = makeSizedDelim(group.delim, 1, options, group.mode, []);
      // Patch an ad-hoc property onto the node so the \left/\right
      // builder can reconstruct appropriately sized middle delimiters.
      // isMiddle is not part of HtmlDomNode; the read side uses
      // isMiddleDelimNode() to check before accessing.
      middleDelim.isMiddle = {
        delim: group.delim,
        options
      };
    }
    return middleDelim;
  },
  mathmlBuilder: (group, options) => {
    // A Firefox \middle will stretch a character vertically only if it
    // is in the fence part of the operator dictionary at:
    // https://www.w3.org/TR/MathML3/appendixc.html.
    // So we need to avoid U+2223 and use plain "|" instead.
    var textNode = group.delim === "\\vert" || group.delim === "|" ? makeText("|", "text") : makeText(group.delim, group.mode);
    var middleNode = new MathNode("mo", [textNode]);
    middleNode.setAttribute("fence", "true");
    // MathML gives 5/18em spacing to each <mo> element.
    // \middle should get delimiter spacing instead.
    middleNode.setAttribute("lspace", "0.05em");
    middleNode.setAttribute("rspace", "0.05em");
    return middleNode;
  }
});

var htmlBuilder$7 = (group, options) => {
  // \cancel, \bcancel, \xcancel, \sout, \fbox, \colorbox, \fcolorbox, \phase
  // Some groups can return document fragments.  Handle those by wrapping
  // them in a span.
  var inner = wrapFragment(buildGroup$1(group.body, options), options);
  var label = group.label.slice(1);
  var scale = options.sizeMultiplier;
  var img;
  var imgShift;
  // In the LaTeX cancel package, line geometry is slightly different
  // depending on whether the subject is wider than it is tall, or vice versa.
  // We don't know the width of a group, so as a proxy, we test if
  // the subject is a single character. This captures most of the
  // subjects that should get the "tall" treatment.
  var isSingleChar = isCharacterBox(group.body);
  if (label === "sout") {
    img = makeSpan(["stretchy", "sout"]);
    img.height = options.fontMetrics().defaultRuleThickness / scale;
    imgShift = -0.5 * options.fontMetrics().xHeight;
  } else if (label === "phase") {
    // Set a couple of dimensions from the steinmetz package.
    var lineWeight = calculateSize({
      number: 0.6,
      unit: "pt"
    }, options);
    var clearance = calculateSize({
      number: 0.35,
      unit: "ex"
    }, options);
    // Prevent size changes like \Huge from affecting line thickness
    var newOptions = options.havingBaseSizing();
    scale = scale / newOptions.sizeMultiplier;
    var angleHeight = inner.height + inner.depth + lineWeight + clearance;
    // Reserve a left pad for the angle.
    inner.style.paddingLeft = makeEm(angleHeight / 2 + lineWeight);
    // Create an SVG
    var viewBoxHeight = Math.floor(1000 * angleHeight * scale);
    var path = phasePath(viewBoxHeight);
    var svgNode = new SvgNode([new PathNode("phase", path)], {
      "width": "400em",
      "height": makeEm(viewBoxHeight / 1000),
      "viewBox": "0 0 400000 " + viewBoxHeight,
      "preserveAspectRatio": "xMinYMin slice"
    });
    // Wrap it in a span with overflow: hidden.
    img = makeSvgSpan(["hide-tail"], [svgNode], options);
    img.style.height = makeEm(angleHeight);
    imgShift = inner.depth + lineWeight + clearance;
  } else {
    // Add horizontal padding
    if (/cancel/.test(label)) {
      if (!isSingleChar) {
        inner.classes.push("cancel-pad");
      }
    } else if (label === "angl") {
      inner.classes.push("anglpad");
    } else {
      inner.classes.push("boxpad");
    }
    // Add vertical padding
    var topPad;
    var bottomPad;
    var ruleThickness = 0;
    // ref: cancel package: \advance\totalheight2\p@ % "+2"
    if (/box/.test(label)) {
      ruleThickness = Math.max(options.fontMetrics().fboxrule,
      // default
      options.minRuleThickness);
      topPad = options.fontMetrics().fboxsep + (label === "colorbox" ? 0 : ruleThickness);
      bottomPad = topPad;
    } else if (label === "angl") {
      ruleThickness = Math.max(options.fontMetrics().defaultRuleThickness, options.minRuleThickness);
      topPad = 4 * ruleThickness; // gap = 3 × line, plus the line itself.
      bottomPad = Math.max(0, 0.25 - inner.depth);
    } else {
      topPad = isSingleChar ? 0.2 : 0;
      bottomPad = topPad;
    }
    img = stretchyEnclose(inner, label, topPad, bottomPad, options);
    if (/fbox|boxed|fcolorbox/.test(label)) {
      img.style.borderStyle = "solid";
      img.style.borderWidth = makeEm(ruleThickness);
    } else if (label === "angl" && ruleThickness !== 0.049) {
      img.style.borderTopWidth = makeEm(ruleThickness);
      img.style.borderRightWidth = makeEm(ruleThickness);
    }
    imgShift = inner.depth + bottomPad;
    if (group.backgroundColor) {
      img.style.backgroundColor = group.backgroundColor;
      if (group.borderColor) {
        img.style.borderColor = group.borderColor;
      }
    }
  }
  var vlist;
  if (group.backgroundColor) {
    vlist = makeVList({
      positionType: "individualShift",
      children: [
      // Put the color background behind inner;
      {
        type: "elem",
        elem: img,
        shift: imgShift
      }, {
        type: "elem",
        elem: inner,
        shift: 0
      }]
    });
  } else {
    var classes = /cancel|phase/.test(label) ? ["svg-align"] : [];
    vlist = makeVList({
      positionType: "individualShift",
      children: [
      // Write the \cancel stroke on top of inner.
      {
        type: "elem",
        elem: inner,
        shift: 0
      }, {
        type: "elem",
        elem: img,
        shift: imgShift,
        wrapperClasses: classes
      }]
    });
  }
  if (/cancel/.test(label)) {
    // The cancel package documentation says that cancel lines add their height
    // to the expression, but tests show that isn't how it actually works.
    vlist.height = inner.height;
    vlist.depth = inner.depth;
  }
  if (/cancel/.test(label) && !isSingleChar) {
    // cancel does not create horiz space for its line extension.
    return makeSpan(["mord", "cancel-lap"], [vlist], options);
  } else {
    return makeSpan(["mord"], [vlist], options);
  }
};
var mathmlBuilder$6 = (group, options) => {
  var fboxsep;
  var node = new MathNode(group.label.includes("colorbox") ? "mpadded" : "menclose", [buildGroup(group.body, options)]);
  switch (group.label) {
    case "\\cancel":
      node.setAttribute("notation", "updiagonalstrike");
      break;
    case "\\bcancel":
      node.setAttribute("notation", "downdiagonalstrike");
      break;
    case "\\phase":
      node.setAttribute("notation", "phasorangle");
      break;
    case "\\sout":
      node.setAttribute("notation", "horizontalstrike");
      break;
    case "\\fbox":
      node.setAttribute("notation", "box");
      break;
    case "\\angl":
      node.setAttribute("notation", "actuarial");
      break;
    case "\\fcolorbox":
    case "\\colorbox":
      // <menclose> doesn't have a good notation option. So use <mpadded>
      // instead. Set some attributes that come included with <menclose>.
      fboxsep = options.fontMetrics().fboxsep * options.fontMetrics().ptPerEm;
      node.setAttribute("width", "+" + 2 * fboxsep + "pt");
      node.setAttribute("height", "+" + 2 * fboxsep + "pt");
      node.setAttribute("lspace", fboxsep + "pt"); //
      node.setAttribute("voffset", fboxsep + "pt");
      if (group.label === "\\fcolorbox") {
        var thk = Math.max(options.fontMetrics().fboxrule,
        // default
        options.minRuleThickness);
        node.setAttribute("style", "border: " + makeEm(thk) + " solid " + group.borderColor);
      }
      break;
    case "\\xcancel":
      node.setAttribute("notation", "updiagonalstrike downdiagonalstrike");
      break;
  }
  if (group.backgroundColor) {
    node.setAttribute("mathbackground", group.backgroundColor);
  }
  return node;
};
defineFunction({
  type: "enclose",
  names: ["\\colorbox"],
  props: {
    numArgs: 2,
    allowedInText: true,
    argTypes: ["color", "hbox"]
  },
  handler(_ref, args, optArgs) {
    var {
      parser,
      funcName
    } = _ref;
    var color = assertNodeType(args[0], "color-token").color;
    var body = args[1];
    return {
      type: "enclose",
      mode: parser.mode,
      label: funcName,
      backgroundColor: color,
      body
    };
  },
  htmlBuilder: htmlBuilder$7,
  mathmlBuilder: mathmlBuilder$6
});
defineFunction({
  type: "enclose",
  names: ["\\fcolorbox"],
  props: {
    numArgs: 3,
    allowedInText: true,
    argTypes: ["color", "color", "hbox"]
  },
  handler(_ref2, args, optArgs) {
    var {
      parser,
      funcName
    } = _ref2;
    var borderColor = assertNodeType(args[0], "color-token").color;
    var backgroundColor = assertNodeType(args[1], "color-token").color;
    var body = args[2];
    return {
      type: "enclose",
      mode: parser.mode,
      label: funcName,
      backgroundColor,
      borderColor,
      body
    };
  },
  htmlBuilder: htmlBuilder$7,
  mathmlBuilder: mathmlBuilder$6
});
defineFunction({
  type: "enclose",
  names: ["\\fbox"],
  props: {
    numArgs: 1,
    argTypes: ["hbox"],
    allowedInText: true
  },
  handler(_ref3, args) {
    var {
      parser
    } = _ref3;
    return {
      type: "enclose",
      mode: parser.mode,
      label: "\\fbox",
      body: args[0]
    };
  }
});
defineFunction({
  type: "enclose",
  names: ["\\cancel", "\\bcancel", "\\xcancel", "\\phase"],
  props: {
    numArgs: 1
  },
  handler(_ref4, args) {
    var {
      parser,
      funcName
    } = _ref4;
    var body = args[0];
    return {
      type: "enclose",
      mode: parser.mode,
      label: funcName,
      body
    };
  },
  htmlBuilder: htmlBuilder$7,
  mathmlBuilder: mathmlBuilder$6
});
defineFunction({
  type: "enclose",
  names: ["\\sout"],
  props: {
    numArgs: 1,
    allowedInText: true
  },
  handler(_ref5, args) {
    var {
      parser,
      funcName
    } = _ref5;
    if (parser.mode === "math") {
      parser.settings.reportNonstrict("mathVsSout", "LaTeX's \\sout works only in text mode");
    }
    var body = args[0];
    return {
      type: "enclose",
      mode: parser.mode,
      label: funcName,
      body
    };
  },
  htmlBuilder: htmlBuilder$7,
  mathmlBuilder: mathmlBuilder$6
});
defineFunction({
  type: "enclose",
  names: ["\\angl"],
  props: {
    numArgs: 1,
    argTypes: ["hbox"],
    allowedInText: false
  },
  handler(_ref6, args) {
    var {
      parser
    } = _ref6;
    return {
      type: "enclose",
      mode: parser.mode,
      label: "\\angl",
      body: args[0]
    };
  }
});

/**
 * All registered environments.
 * `environments.js` exports this same dictionary again and makes it public.
 * `Parser.js` requires this dictionary via `environments.js`.
 */
var _environments = {};
function defineEnvironment(_ref) {
  var {
    type,
    names,
    props,
    handler,
    htmlBuilder,
    mathmlBuilder
  } = _ref;
  // Set default values of environments.
  var data = {
    type,
    numArgs: props.numArgs || 0,
    allowedInText: false,
    numOptionalArgs: 0,
    handler
  };
  for (var i = 0; i < names.length; ++i) {
    // TODO: The value type of _environments should be a type union of all
    // possible `EnvSpec<>` possibilities instead of `EnvSpec<*>`, which is
    // an existential type.
    _environments[names[i]] = data;
  }
  if (htmlBuilder) {
    _htmlGroupBuilders[type] = htmlBuilder;
  }
  if (mathmlBuilder) {
    _mathmlGroupBuilders[type] = mathmlBuilder;
  }
}

/**
 * All registered global/built-in macros.
 * `macros.js` exports this same dictionary again and makes it public.
 * `Parser.js` requires this dictionary via `macros.js`.
 */
var _macros = {};
// This function might one day accept an additional argument and do more things.
function defineMacro(name, body) {
  _macros[name] = body;
}

/**
 * Lexing or parsing positional information for error reporting.
 * This object is immutable.
 */
class SourceLocation {
  // End offset, zero-based exclusive.
  constructor(lexer, start, end) {
    // The + prefix indicates that these fields aren't writeable
    this.lexer = void 0;
    // Lexer holding the input string.
    this.start = void 0;
    // Start offset, zero-based inclusive.
    this.end = void 0;
    this.lexer = lexer;
    this.start = start;
    this.end = end;
  }
  /**
   * Merges two `SourceLocation`s from location providers, given they are
   * provided in order of appearance.
   * - Returns the first one's location if only the first is provided.
   * - Returns a merged range of the first and the last if both are provided
   *   and their lexers match.
   * - Otherwise, returns null.
   */
  static range(first, second) {
    if (!second) {
      return first && first.loc;
    } else if (!first || !first.loc || !second.loc || first.loc.lexer !== second.loc.lexer) {
      return null;
    } else {
      return new SourceLocation(first.loc.lexer, first.loc.start, second.loc.end);
    }
  }
}

/**
 * The resulting token returned from `lex`.
 *
 * It consists of the token text plus some position information.
 * The position information is essentially a range in an input string,
 * but instead of referencing the bare input string, we refer to the lexer.
 * That way it is possible to attach extra metadata to the input string,
 * like for example a file name or similar.
 *
 * The position information is optional, so it is OK to construct synthetic
 * tokens if appropriate. Not providing available position information may
 * lead to degraded error reporting, though.
 */
class Token {
  // used in \noexpand
  constructor(text,
  // the text of this token
  loc) {
    this.text = void 0;
    this.loc = void 0;
    this.noexpand = void 0;
    // don't expand the token
    this.treatAsRelax = void 0;
    this.text = text;
    this.loc = loc;
  }
  /**
   * Given a pair of tokens (this and endToken), compute a `Token` encompassing
   * the whole input range enclosed by these two.
   */
  range(endToken,
  // last token of the range, inclusive
  text) {
    return new Token(text, SourceLocation.range(this, endToken));
  }
}

// Helper functions
function getHLines(parser) {
  // Return an array. The array length = number of hlines.
  // Each element in the array tells if the line is dashed.
  var hlineInfo = [];
  parser.consumeSpaces();
  var nxt = parser.fetch().text;
  if (nxt === "\\relax") {
    // \relax is an artifact of the \cr macro below
    parser.consume();
    parser.consumeSpaces();
    nxt = parser.fetch().text;
  }
  while (nxt === "\\hline" || nxt === "\\hdashline") {
    parser.consume();
    hlineInfo.push(nxt === "\\hdashline");
    parser.consumeSpaces();
    nxt = parser.fetch().text;
  }
  return hlineInfo;
}
var validateAmsEnvironmentContext = context => {
  var settings = context.parser.settings;
  if (!settings.displayMode) {
    throw new ParseError("{" + context.envName + "} can be used only in" + " display mode.");
  }
};
var gatherEnvironments = new Set(["gather", "gather*"]);
// autoTag (an argument to parseArray) can be one of three values:
// * undefined: Regular (not-top-level) array; no tags on each row
// * true: Automatic equation numbering, overridable by \tag
// * false: Tags allowed on each row, but no automatic numbering
// This function *doesn't* work with the "split" environment name.
function getAutoTag(name) {
  if (!name.includes("ed")) {
    return !name.includes("*");
  }
  // return undefined;
}
/**
 * Parse the body of the environment, with rows delimited by \\ and
 * columns delimited by &, and create a nested list in row-major order
 * with one group per cell.  If given an optional argument style
 * ("text", "display", etc.), then each cell is cast into that style.
 */
function parseArray(parser, _ref, style) {
  var {
    hskipBeforeAndAfter,
    addJot,
    cols,
    arraystretch,
    colSeparationType,
    autoTag,
    singleRow,
    emptySingleRow,
    maxNumCols,
    leqno
  } = _ref;
  parser.gullet.beginGroup();
  if (!singleRow) {
    // \cr is equivalent to \\ without the optional size argument (see below)
    // TODO: provide helpful error when \cr is used outside array environment
    parser.gullet.macros.set("\\cr", "\\\\\\relax");
  }
  // Get current arraystretch if it's not set by the environment
  if (!arraystretch) {
    var stretch = parser.gullet.expandMacroAsText("\\arraystretch");
    if (stretch == null) {
      // Default \arraystretch from lttab.dtx
      arraystretch = 1;
    } else {
      arraystretch = parseFloat(stretch);
      if (!arraystretch || arraystretch < 0) {
        throw new ParseError("Invalid \\arraystretch: " + stretch);
      }
    }
  }
  // Start group for first cell
  parser.gullet.beginGroup();
  var row = [];
  var body = [row];
  var rowGaps = [];
  var hLinesBeforeRow = [];
  var tags = autoTag != null ? [] : undefined;
  // amsmath uses \global\@eqnswtrue and \global\@eqnswfalse to represent
  // whether this row should have an equation number.  Simulate this with
  // a \@eqnsw macro set to 1 or 0.
  function beginRow() {
    if (autoTag) {
      parser.gullet.macros.set("\\@eqnsw", "1", true);
    }
  }
  function endRow() {
    if (tags) {
      if (parser.gullet.macros.get("\\df@tag")) {
        tags.push(parser.subparse([new Token("\\df@tag")]));
        parser.gullet.macros.set("\\df@tag", undefined, true);
      } else {
        tags.push(Boolean(autoTag) && parser.gullet.macros.get("\\@eqnsw") === "1");
      }
    }
  }
  beginRow();
  // Test for \hline at the top of the array.
  hLinesBeforeRow.push(getHLines(parser));
  while (true) {
    // Parse each cell in its own group (namespace)
    var cellBody = parser.parseExpression(false, singleRow ? "\\end" : "\\\\");
    parser.gullet.endGroup();
    parser.gullet.beginGroup();
    var cell = {
      type: "ordgroup",
      mode: parser.mode,
      body: cellBody
    };
    if (style) {
      cell = {
        type: "styling",
        mode: parser.mode,
        style,
        resetFont: true,
        body: [cell]
      };
    }
    row.push(cell);
    var next = parser.fetch().text;
    if (next === "&") {
      if (maxNumCols && row.length === maxNumCols) {
        if (singleRow || colSeparationType) {
          // {equation} or {split}
          throw new ParseError("Too many tab characters: &", parser.nextToken);
        } else {
          // {array} environment
          parser.settings.reportNonstrict("textEnv", "Too few columns " + "specified in the {array} column argument.");
        }
      }
      parser.consume();
    } else if (next === "\\end") {
      endRow();
      // Arrays terminate newlines with `\crcr` which consumes a `\cr` if
      // the last line is empty.  However, AMS environments keep the
      // empty row if it's the only one.
      // NOTE: Currently, `cell` is the last item added into `row`.
      if (row.length === 1 && cell.type === "styling" && cell.body.length === 1 && cell.body[0].type === "ordgroup" && cell.body[0].body.length === 0 && (body.length > 1 || !emptySingleRow)) {
        body.pop();
      }
      if (hLinesBeforeRow.length < body.length + 1) {
        hLinesBeforeRow.push([]);
      }
      break;
    } else if (next === "\\\\") {
      parser.consume();
      var size = void 0;
      // \def\Let@{\let\\\math@cr}
      // \def\math@cr{...\math@cr@}
      // \def\math@cr@{\new@ifnextchar[\math@cr@@{\math@cr@@[\z@]}}
      // \def\math@cr@@[#1]{...\math@cr@@@...}
      // \def\math@cr@@@{\cr}
      if (parser.gullet.future().text !== " ") {
        size = parser.parseSizeGroup(true);
      }
      rowGaps.push(size ? size.value : null);
      endRow();
      // check for \hline(s) following the row separator
      hLinesBeforeRow.push(getHLines(parser));
      row = [];
      body.push(row);
      beginRow();
    } else {
      throw new ParseError("Expected & or \\\\ or \\cr or \\end", parser.nextToken);
    }
  }
  // End cell group
  parser.gullet.endGroup();
  // End array group defining \cr
  parser.gullet.endGroup();
  return {
    type: "array",
    mode: parser.mode,
    addJot,
    arraystretch,
    body,
    cols,
    rowGaps,
    hskipBeforeAndAfter,
    hLinesBeforeRow,
    colSeparationType,
    tags,
    leqno
  };
}
// Decides on a style for cells in an array according to whether the given
// environment name starts with the letter 'd'.
function dCellStyle(envName) {
  if (envName.slice(0, 1) === "d") {
    return "display";
  } else {
    return "text";
  }
}
var htmlBuilder$6 = function htmlBuilder(group, options) {
  var r;
  var c;
  var nr = group.body.length;
  var hLinesBeforeRow = group.hLinesBeforeRow;
  var nc = 0;
  var body = new Array(nr);
  var hlines = [];
  var ruleThickness = Math.max(
  // From LaTeX \showthe\arrayrulewidth. Equals 0.04 em.
  options.fontMetrics().arrayRuleWidth, options.minRuleThickness);
  // Horizontal spacing
  var pt = 1 / options.fontMetrics().ptPerEm;
  var arraycolsep = 5 * pt; // default value, i.e. \arraycolsep in article.cls
  if (group.colSeparationType && group.colSeparationType === "small") {
    // We're in a {smallmatrix}. Default column space is \thickspace,
    // i.e. 5/18em = 0.2778em, per amsmath.dtx for {smallmatrix}.
    // But that needs adjustment because LaTeX applies \scriptstyle to the
    // entire array, including the colspace, but this function applies
    // \scriptstyle only inside each element.
    var localMultiplier = options.havingStyle(Style$1.SCRIPT).sizeMultiplier;
    arraycolsep = 0.2778 * (localMultiplier / options.sizeMultiplier);
  }
  // Vertical spacing
  var baselineskip = group.colSeparationType === "CD" ? calculateSize({
    number: 3,
    unit: "ex"
  }, options) : 12 * pt; // see size10.clo
  // Default \jot from ltmath.dtx
  // TODO(edemaine): allow overriding \jot via \setlength (#687)
  var jot = 3 * pt;
  var arrayskip = group.arraystretch * baselineskip;
  var arstrutHeight = 0.7 * arrayskip; // \strutbox in ltfsstrc.dtx and
  var arstrutDepth = 0.3 * arrayskip; // \@arstrutbox in lttab.dtx
  var totalHeight = 0;
  // Set a position for \hline(s) at the top of the array, if any.
  function setHLinePos(hlinesInGap) {
    for (var i = 0; i < hlinesInGap.length; ++i) {
      if (i > 0) {
        totalHeight += 0.25;
      }
      hlines.push({
        pos: totalHeight,
        isDashed: hlinesInGap[i]
      });
    }
  }
  setHLinePos(hLinesBeforeRow[0]);
  for (r = 0; r < group.body.length; ++r) {
    var inrow = group.body[r];
    var height = arstrutHeight; // \@array adds an \@arstrut
    var depth = arstrutDepth; // to each tow (via the template)
    if (nc < inrow.length) {
      nc = inrow.length;
    }
    var outrow = {
      cells: new Array(inrow.length),
      height: 0,
      depth: 0,
      pos: 0
    };
    for (c = 0; c < inrow.length; ++c) {
      var elt = buildGroup$1(inrow[c], options);
      if (depth < elt.depth) {
        depth = elt.depth;
      }
      if (height < elt.height) {
        height = elt.height;
      }
      outrow.cells[c] = elt;
    }
    var rowGap = group.rowGaps[r];
    var gap = 0;
    if (rowGap) {
      gap = calculateSize(rowGap, options);
      if (gap > 0) {
        // \@argarraycr
        gap += arstrutDepth;
        if (depth < gap) {
          depth = gap; // \@xargarraycr
        }
        gap = 0;
      }
    }
    // In AMS multiline environments such as aligned and gathered, rows
    // correspond to lines that have additional \jot added between lines
    // via \openup.
    // We simulate this by adding \jot depth to each row except the last.
    if (group.addJot && r < group.body.length - 1) {
      depth += jot;
    }
    outrow.height = height;
    outrow.depth = depth;
    totalHeight += height;
    outrow.pos = totalHeight;
    totalHeight += depth + gap; // \@yargarraycr
    body[r] = outrow;
    // Set a position for \hline(s), if any.
    setHLinePos(hLinesBeforeRow[r + 1]);
  }
  var offset = totalHeight / 2 + options.fontMetrics().axisHeight;
  var colDescriptions = group.cols || [];
  var cols = [];
  var colSep;
  var colDescrNum;
  var tagSpans = [];
  if (group.tags && group.tags.some(tag => tag)) {
    // An environment with manual tags and/or automatic equation numbers.
    // Create node(s), the latter of which trigger CSS counter increment.
    for (r = 0; r < nr; ++r) {
      var rw = body[r];
      var shift = rw.pos - offset;
      var tag = group.tags[r];
      var tagSpan = void 0;
      if (tag === true) {
        // automatic numbering
        tagSpan = makeSpan(["eqn-num"], [], options);
      } else if (tag === false) {
        // \nonumber/\notag or starred environment
        tagSpan = makeSpan([], [], options);
      } else {
        // manual \tag
        tagSpan = makeSpan([], buildExpression$1(tag, options, true), options);
      }
      tagSpan.depth = rw.depth;
      tagSpan.height = rw.height;
      tagSpans.push({
        type: "elem",
        elem: tagSpan,
        shift
      });
    }
  }
  for (c = 0, colDescrNum = 0;
  // Continue while either there are more columns or more column
  // descriptions, so trailing separators don't get lost.
  c < nc || colDescrNum < colDescriptions.length; ++c, ++colDescrNum) {
    var _colDescr3;
    var colDescr = colDescriptions[colDescrNum];
    var firstSeparator = true;
    while (((_colDescr = colDescr) == null ? void 0 : _colDescr.type) === "separator") {
      var _colDescr;
      // If there is more than one separator in a row, add a space
      // between them.
      if (!firstSeparator) {
        colSep = makeSpan(["arraycolsep"], []);
        colSep.style.width = makeEm(options.fontMetrics().doubleRuleSep);
        cols.push(colSep);
      }
      if (colDescr.separator === "|" || colDescr.separator === ":") {
        var lineType = colDescr.separator === "|" ? "solid" : "dashed";
        var separator = makeSpan(["vertical-separator"], [], options);
        separator.style.height = makeEm(totalHeight);
        separator.style.borderRightWidth = makeEm(ruleThickness);
        separator.style.borderRightStyle = lineType;
        separator.style.margin = "0 " + makeEm(-ruleThickness / 2);
        var _shift = totalHeight - offset;
        if (_shift) {
          separator.style.verticalAlign = makeEm(-_shift);
        }
        cols.push(separator);
      } else {
        throw new ParseError("Invalid separator type: " + colDescr.separator);
      }
      colDescrNum++;
      colDescr = colDescriptions[colDescrNum];
      firstSeparator = false;
    }
    if (c >= nc) {
      continue;
    }
    var sepwidth = void 0;
    if (c > 0 || group.hskipBeforeAndAfter) {
      var _colDescr$pregap, _colDescr2;
      sepwidth = (_colDescr$pregap = (_colDescr2 = colDescr) == null ? void 0 : _colDescr2.pregap) != null ? _colDescr$pregap : arraycolsep;
      if (sepwidth !== 0) {
        colSep = makeSpan(["arraycolsep"], []);
        colSep.style.width = makeEm(sepwidth);
        cols.push(colSep);
      }
    }
    var colElems = [];
    for (r = 0; r < nr; ++r) {
      var row = body[r];
      var elem = row.cells[c];
      if (!elem) {
        continue;
      }
      var _shift2 = row.pos - offset;
      elem.depth = row.depth;
      elem.height = row.height;
      colElems.push({
        type: "elem",
        elem: elem,
        shift: _shift2
      });
    }
    var colVList = makeVList({
      positionType: "individualShift",
      children: colElems
    });
    var colSpan = makeSpan(["col-align-" + (((_colDescr3 = colDescr) == null ? void 0 : _colDescr3.align) || "c")], [colVList]);
    cols.push(colSpan);
    if (c < nc - 1 || group.hskipBeforeAndAfter) {
      var _colDescr$postgap, _colDescr4;
      sepwidth = (_colDescr$postgap = (_colDescr4 = colDescr) == null ? void 0 : _colDescr4.postgap) != null ? _colDescr$postgap : arraycolsep;
      if (sepwidth !== 0) {
        colSep = makeSpan(["arraycolsep"], []);
        colSep.style.width = makeEm(sepwidth);
        cols.push(colSep);
      }
    }
  }
  var tableBody = makeSpan(["mtable"], cols);
  // Add \hline(s), if any.
  if (hlines.length > 0) {
    var line = makeLineSpan("hline", options, ruleThickness);
    var dashes = makeLineSpan("hdashline", options, ruleThickness);
    var vListElems = [{
      type: "elem",
      elem: tableBody,
      shift: 0
    }];
    while (hlines.length > 0) {
      var hline = hlines.pop();
      var lineShift = hline.pos - offset;
      if (hline.isDashed) {
        vListElems.push({
          type: "elem",
          elem: dashes,
          shift: lineShift
        });
      } else {
        vListElems.push({
          type: "elem",
          elem: line,
          shift: lineShift
        });
      }
    }
    tableBody = makeVList({
      positionType: "individualShift",
      children: vListElems
    });
  }
  if (tagSpans.length === 0) {
    return makeSpan(["mord"], [tableBody], options);
  } else {
    var eqnNumCol = makeVList({
      positionType: "individualShift",
      children: tagSpans
    });
    var tagCol = makeSpan(["tag"], [eqnNumCol], options);
    return makeFragment([tableBody, tagCol]);
  }
};
var alignMap = {
  c: "center ",
  l: "left ",
  r: "right "
};
var mathmlBuilder$5 = function mathmlBuilder(group, options) {
  var tbl = [];
  var glue = new MathNode("mtd", [], ["mtr-glue"]);
  var tag = new MathNode("mtd", [], ["mml-eqn-num"]);
  for (var i = 0; i < group.body.length; i++) {
    var rw = group.body[i];
    var row = [];
    for (var j = 0; j < rw.length; j++) {
      row.push(new MathNode("mtd", [buildGroup(rw[j], options)]));
    }
    if (group.tags && group.tags[i]) {
      row.unshift(glue);
      row.push(glue);
      if (group.leqno) {
        row.unshift(tag);
      } else {
        row.push(tag);
      }
    }
    tbl.push(new MathNode("mtr", row));
  }
  var table = new MathNode("mtable", tbl);
  // Set column alignment, row spacing, column spacing, and
  // array lines by setting attributes on the table element.
  // Set the row spacing. In MathML, we specify a gap distance.
  // We do not use rowGap[] because MathML automatically increases
  // cell height with the height/depth of the element content.
  // LaTeX \arraystretch multiplies the row baseline-to-baseline distance.
  // We simulate this by adding (arraystretch - 1)em to the gap. This
  // does a reasonable job of adjusting arrays containing 1 em tall content.
  // The 0.16 and 0.09 values are found empirically. They produce an array
  // similar to LaTeX and in which content does not interfere with \hlines.
  var gap = group.arraystretch === 0.5 ? 0.1 // {smallmatrix}, {subarray}
  : 0.16 + group.arraystretch - 1 + (group.addJot ? 0.09 : 0);
  table.setAttribute("rowspacing", makeEm(gap));
  // MathML table lines go only between cells.
  // To place a line on an edge we'll use <menclose>, if necessary.
  var menclose = "";
  var align = "";
  if (group.cols && group.cols.length > 0) {
    // Find column alignment, column spacing, and  vertical lines.
    var cols = group.cols;
    var columnLines = "";
    var prevTypeWasAlign = false;
    var iStart = 0;
    var iEnd = cols.length;
    if (cols[0].type === "separator") {
      menclose += "top ";
      iStart = 1;
    }
    if (cols[cols.length - 1].type === "separator") {
      menclose += "bottom ";
      iEnd -= 1;
    }
    for (var _i = iStart; _i < iEnd; _i++) {
      var col = cols[_i];
      if (col.type === "align") {
        align += alignMap[col.align];
        if (prevTypeWasAlign) {
          columnLines += "none ";
        }
        prevTypeWasAlign = true;
      } else if (col.type === "separator") {
        // MathML accepts only single lines between cells.
        // So we read only the first of consecutive separators.
        if (prevTypeWasAlign) {
          columnLines += col.separator === "|" ? "solid " : "dashed ";
          prevTypeWasAlign = false;
        }
      }
    }
    table.setAttribute("columnalign", align.trim());
    if (/[sd]/.test(columnLines)) {
      table.setAttribute("columnlines", columnLines.trim());
    }
  }
  // Set column spacing.
  if (group.colSeparationType === "align") {
    var _cols = group.cols || [];
    var spacing = "";
    for (var _i2 = 1; _i2 < _cols.length; _i2++) {
      spacing += _i2 % 2 ? "0em " : "1em ";
    }
    table.setAttribute("columnspacing", spacing.trim());
  } else if (group.colSeparationType === "alignat" || group.colSeparationType === "gather") {
    table.setAttribute("columnspacing", "0em");
  } else if (group.colSeparationType === "small") {
    table.setAttribute("columnspacing", "0.2778em");
  } else if (group.colSeparationType === "CD") {
    table.setAttribute("columnspacing", "0.5em");
  } else {
    table.setAttribute("columnspacing", "1em");
  }
  // Address \hline and \hdashline
  var rowLines = "";
  var hlines = group.hLinesBeforeRow;
  menclose += hlines[0].length > 0 ? "left " : "";
  menclose += hlines[hlines.length - 1].length > 0 ? "right " : "";
  for (var _i3 = 1; _i3 < hlines.length - 1; _i3++) {
    rowLines += hlines[_i3].length === 0 ? "none "
    // MathML accepts only a single line between rows. Read one element.
    : hlines[_i3][0] ? "dashed " : "solid ";
  }
  if (/[sd]/.test(rowLines)) {
    table.setAttribute("rowlines", rowLines.trim());
  }
  if (menclose !== "") {
    table = new MathNode("menclose", [table]);
    table.setAttribute("notation", menclose.trim());
  }
  if (group.arraystretch && group.arraystretch < 1) {
    // A small array. Wrap in scriptstyle so row gap is not too large.
    table = new MathNode("mstyle", [table]);
    table.setAttribute("scriptlevel", "1");
  }
  return table;
};
// Convenience function for align, align*, aligned, alignat, alignat*, alignedat.
var alignedHandler = function alignedHandler(context, args) {
  if (!context.envName.includes("ed")) {
    validateAmsEnvironmentContext(context);
  }
  var cols = [];
  var separationType = context.envName.includes("at") ? "alignat" : "align";
  var isSplit = context.envName === "split";
  var res = parseArray(context.parser, {
    cols,
    addJot: true,
    autoTag: isSplit ? undefined : getAutoTag(context.envName),
    emptySingleRow: true,
    colSeparationType: separationType,
    maxNumCols: isSplit ? 2 : undefined,
    leqno: context.parser.settings.leqno
  }, "display");
  // Determining number of columns.
  // 1. If the first argument is given, we use it as a number of columns,
  //    and makes sure that each row doesn't exceed that number.
  // 2. Otherwise, just count number of columns = maximum number
  //    of cells in each row ("aligned" mode -- isAligned will be true).
  //
  // At the same time, prepend empty group {} at beginning of every second
  // cell in each row (starting with second cell) so that operators become
  // binary.  This behavior is implemented in amsmath's \start@aligned.
  var numMaths = 0;
  var numCols = 0;
  var emp   tyGroup = {
    type: "ordgroup",
    mode: context.mode,
    body: []
  };
  if (args[0] && args[0].type === "ordgroup") {
    var arg0 = "";
    for (var i = 0; i < args[0].body.length; i++) {
      var textord = assertNodeType(args[0].body[i], "textord");
      arg0 += textord.text;
    }
    numMaths = Number(arg0);
    numCols = numMaths * 2;
  }
  var isAligned = !numCols;
  res.body.forEach(function (row) {
    for (var _i4 = 1; _i4 < row.length; _i4 += 2) {
      // Modify ordgroup node within styling node
      var styling = assertNodeType(row[_i4], "styling");
      var ordgroup = assertNodeType(styling.body[0], "ordgroup");
      ordgroup.body.unshift(emptyGroup);
    }
    if (!isAligned) {
      // Case 1
      var curMaths = row.length / 2;
      if (numMaths < curMaths) {
        throw new ParseError("Too many math in a row: " + ("expected " + numMaths + ", but got " + curMaths), row[0]);
      }
    } else if (numCols < row.length) {
      // Case 2
      numCols = row.length;
    }
  });
  // Adjusting alignment.
  // In aligned mode, we add one \qquad between columns;
  // otherwise we add nothing.
  for (var _i5 = 0; _i5 < numCols; ++_i5) {
    var align = "r";
    var pregap = 0;
    if (_i5 % 2 === 1) {
      align = "l";
    } else if (_i5 > 0 && isAligned) {
      // "aligned" mode.
      pregap = 1; // add one \quad
    }
    cols[_i5] = {
      type: "align",
      align: align,
      pregap: pregap,
      postgap: 0
    };
  }
  res.colSeparationType = isAligned ? "align" : "alignat";
  return res;
};
// Arrays are part of LaTeX, defined in lttab.dtx so its documentation
// is part of the source2e.pdf file of LaTeX2e source documentation.
// {darray} is an {array} environment where cells are set in \displaystyle,
// as defined in nccmath.sty.
defineEnvironment({
  type: "array",
  names: ["array", "darray"],
  props: {
    numArgs: 1
  },
  handler(context, args) {
    // Since no types are specified above, the two possibilities are
    // - The argument is wrapped in {} or [], in which case Parser's
    //   parseGroup() returns an "ordgroup" wrapping some symbol node.
    // - The argument is a bare symbol node.
    var symNode = checkSymbolNodeType(args[0]);
    var colalign = symNode ? [args[0]] : assertNodeType(args[0], "ordgroup").body;
    var cols = colalign.map(function (nde) {
      var node = assertSymbolNodeType(nde);
      var ca = node.text;
      if ("lcr".includes(ca)) {
        return {
          type: "align",
          align: ca
        };
      } else if (ca === "|") {
        return {
          type: "separator",
          separator: "|"
        };
      } else if (ca === ":") {
        return {
          type: "separator",
          separator: ":"
        };
      }
      throw new ParseError("Unknown column alignment: " + ca, nde);
    });
    var res = {
      cols,
      hskipBeforeAndAfter: true,
      // \@preamble in lttab.dtx
      maxNumCols: cols.length
    };
    return parseArray(context.parser, res, dCellStyle(context.envName));
  },
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
// The matrix environments of amsmath builds on the array environment
// of LaTeX, which is discussed above.
// The mathtools package adds starred versions of the same environments.
// These have an optional argument to choose left|center|right justification.
defineEnvironment({
  type: "array",
  names: ["matrix", "pmatrix", "bmatrix", "Bmatrix", "vmatrix", "Vmatrix", "matrix*", "pmatrix*", "bmatrix*", "Bmatrix*", "vmatrix*", "Vmatrix*"],
  props: {
    numArgs: 0
  },
  handler(context) {
    var delimiters = {
      "matrix": null,
      "pmatrix": ["(", ")"],
      "bmatrix": ["[", "]"],
      "Bmatrix": ["\\{", "\\}"],
      "vmatrix": ["|", "|"],
      "Vmatrix": ["\\Vert", "\\Vert"]
    }[context.envName.replace("*", "")];
    // \hskip -\arraycolsep in amsmath
    var colAlign = "c";
    var payload = {
      hskipBeforeAndAfter: false,
      cols: [{
        type: "align",
        align: colAlign
      }]
    };
    if (context.envName.charAt(context.envName.length - 1) === "*") {
      // It's one of the mathtools starred functions.
      // Parse the optional alignment argument.
      var parser = context.parser;
      parser.consumeSpaces();
      if (parser.fetch().text === "[") {
        parser.consume();
        parser.consumeSpaces();
        colAlign = parser.fetch().text;
        if (!"lcr".includes(colAlign)) {
          throw new ParseError("Expected l or c or r", parser.nextToken);
        }
        parser.consume();
        parser.consumeSpaces();
        parser.expect("]");
        parser.consume();
        payload.cols = [{
          type: "align",
          align: colAlign
        }];
      }
    }
    var res = parseArray(context.parser, payload, dCellStyle(context.envName));
    // Populate cols with the correct number of column alignment specs.
    var numCols = Math.max(0, ...res.body.map(row => row.length));
    res.cols = new Array(numCols).fill({
      type: "align",
      align: colAlign
    });
    return delimiters ? {
      type: "leftright",
      mode: context.mode,
      body: [res],
      left: delimiters[0],
      right: delimiters[1],
      rightColor: undefined // \right uninfluenced by \color in array
    } : res;
  },
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
  type: "array",
  names: ["smallmatrix"],
  props: {
    numArgs: 0
  },
  handler(context) {
    var payload = {
      arraystretch: 0.5
    };
    var res = parseArray(context.parser, payload, "script");
    res.colSeparationType = "small";
    return res;
  },
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
  type: "array",
  names: ["subarray"],
  props: {
    numArgs: 1
  },
  handler(context, args) {
    // Parsing of {subarray} is similar to {array}
    var symNode = checkSymbolNodeType(args[0]);
    var colalign = symNode ? [args[0]] : assertNodeType(args[0], "ordgroup").body;
    var cols = colalign.map(function (nde) {
      var node = assertSymbolNodeType(nde);
      var ca = node.text;
      // {subarray} only recognizes "l" & "c"
      if ("lc".includes(ca)) {
        return {
          type: "align",
          align: ca
        };
      }
      throw new ParseError("Unknown column alignment: " + ca, nde);
    });
    if (cols.length > 1) {
      throw new ParseError("{subarray} can contain only one column");
    }
    var payload = {
      cols,
      hskipBeforeAndAfter: false,
      arraystretch: 0.5
    };
    var res = parseArray(context.parser, payload, "script");
    if (res.body.length > 0 && res.body[0].length > 1) {
      throw new ParseError("{subarray} can contain only one column");
    }
    return res;
  },
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
// A cases environment (in amsmath.sty) is almost equivalent to
// \def\arraystretch{1.2}%
// \left\{\begin{array}{@{}l@{\quad}l@{}} … \end{array}\right.
// {dcases} is a {cases} environment where cells are set in \displaystyle,
// as defined in mathtools.sty.
// {rcases} is another mathtools environment. It's brace is on the right side.
defineEnvironment({
  type: "array",
  names: ["cases", "dcases", "rcases", "drcases"],
  props: {
    numArgs: 0
  },
  handler(context) {
    var payload = {
      arraystretch: 1.2,
      cols: [{
        type: "align",
        align: "l",
        pregap: 0,
        // TODO(kevinb) get the current style.
        // For now we use the metrics for TEXT style which is what we were
        // doing before.  Before attempting to get the current style we
        // should look at TeX's behavior especially for \over and matrices.
        postgap: 1.0 /* 1em quad */
      }, {
        type: "align",
        align: "l",
        pregap: 0,
        postgap: 0
      }]
    };
    var res = parseArray(context.parser, payload, dCellStyle(context.envName));
    return {
      type: "leftright",
      mode: context.mode,
      body: [res],
      left: context.envName.includes("r") ? "." : "\\{",
      right: context.envName.includes("r") ? "\\}" : ".",
      rightColor: undefined
    };
  },
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
// In the align environment, one uses ampersands, &, to specify number of
// columns in each row, and to locate spacing between each column.
// align gets automatic numbering. align* and aligned do not.
// The alignedat environment can be used in math mode.
// Note that we assume \nomallineskiplimit to be zero,
// so that \strut@ is the same as \strut.
defineEnvironment({
  type: "array",
  names: ["align", "align*", "aligned", "split"],
  props: {
    numArgs: 0
  },
  handler: alignedHandler,
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
// A gathered environment is like an array environment with one centered
// column, but where rows are considered lines so get \jot line spacing
// and contents are set in \displaystyle.
defineEnvironment({
  type: "array",
  names: ["gathered", "gather", "gather*"],
  props: {
    numArgs: 0
  },
  handler(context) {
    if (gatherEnvironments.has(context.envName)) {
      validateAmsEnvironmentContext(context);
    }
    var res = {
      cols: [{
        type: "align",
        align: "c"
      }],
      addJot: true,
      colSeparationType: "gather",
      autoTag: getAutoTag(context.envName),
      emptySingleRow: true,
      leqno: context.parser.settings.leqno
    };
    return parseArray(context.parser, res, "display");
  },
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
// alignat environment is like an align environment, but one must explicitly
// specify maximum number of columns in each row, and can adjust spacing between
// each columns.
defineEnvironment({
  type: "array",
  names: ["alignat", "alignat*", "alignedat"],
  props: {
    numArgs: 1
  },
  handler: alignedHandler,
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
  type: "array",
  names: ["equation", "equation*"],
  props: {
    numArgs: 0
  },
  handler(context) {
    validateAmsEnvironmentContext(context);
    var res = {
      autoTag: getAutoTag(context.envName),
      emptySingleRow: true,
      singleRow: true,
      maxNumCols: 1,
      leqno: context.parser.settings.leqno
    };
    return parseArray(context.parser, res, "display");
  },
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineEnvironment({
  type: "array",
  names: ["CD"],
  props: {
    numArgs: 0
  },
  handler(context) {
    validateAmsEnvironmentContext(context);
    return parseCD(context.parser);
  },
  htmlBuilder: htmlBuilder$6,
  mathmlBuilder: mathmlBuilder$5
});
defineMacro("\\nonumber", "\\gdef\\@eqnsw{0}");
defineMacro("\\notag", "\\nonumber");
// Catch \hline outside array environment
defineFunction({
  type: "text",
  // Doesn't matter what this is.
  names: ["\\hline", "\\hdashline"],
  props: {
    numArgs: 0,
    allowedInText: true,
    allowedInMath: true
  },
  handler(context, args) {
    throw new ParseError(context.funcName + " valid only within array environment");
  }
});

var environments = _environments;

// Environment delimiters. HTML/MathML rendering is defined in the corresponding
// defineEnvironment definitions.
defineFunction({
  type: "environment",
  names: ["\\begin", "\\end"],
  props: {
    numArgs: 1,
    argTypes: ["text"]
  },
  handler(_ref, args) {
    var {
      parser,
      funcName
    } = _ref;
    var nameGroup = args[0];
    if (nameGroup.type !== "ordgroup") {
      throw new ParseError("Invalid environment name", nameGroup);
    }
    var envName = "";
    for (var i = 0; i < nameGroup.body.length; ++i) {
      envName += assertNodeType(nameGroup.body[i], "textord").text;
    }
    if (funcName === "\\begin") {
      // begin...end is similar to left...right
      if (!environments.hasOwnProperty(envName)) {
        throw new ParseError("No such environment: " + envName, nameGroup);
      }
      // Build the environment object. Arguments and other information will
      // be made available to the begin and end methods using properties.
      var env = environments[envName];
      var {
        args: _args,
        optArgs
      } = parser.parseArguments("\\begin{" + envName + "}", env);
      var context = {
        mode: parser.mode,
        envName,
        parser
      };
      var result = env.handler(context, _args, optArgs);
      parser.expect("\\end", false);
      var endNameToken = parser.nextToken;
      var end = assertNodeType(parser.parseFunction(), "environment");
      if (end.name !== envName) {
        throw new ParseError("Mismatch: \\begin{" + envName + "} matched by \\end{" + end.name + "}", endNameToken);
      }
      // env.handler returns the specific node type (e.g. "array"),
      // not "environment". This cast is unavoidable: defineFunction
      // requires the handler to return ParseNode<"environment"> but
      // \begin delegates to environment handlers with different types.
      return result;
    }
    return {
      type: "environment",
      mode: parser.mode,
      name: envName,
      nameGroup
    };
  }
});

// TODO(kevinb): implement \\sl and \\sc
var htmlBuilder$5 = (group, options) => {
  var font = group.font;
  var newOptions = options.withFont(font);
  return buildGroup$1(group.body, newOptions);
};
var mathmlBuilder$4 = (group, options) => {
  var font = group.font;
  var newOptions = options.withFont(font);
  return buildGroup(group.body, newOptions);
};
var fontAliases = {
  "\\Bbb": "\\mathbb",
  "\\bold": "\\mathbf",
  "\\frak": "\\mathfrak"
};
defineFunction({
  type: "font",
  names: [
  // styles, except \boldsymbol defined below
  "\\mathrm", "\\mathit", "\\mathbf", "\\mathnormal", "\\mathsfit",
  // families
  "\\mathbb", "\\mathcal", "\\mathfrak", "\\mathscr", "\\mathsf", "\\mathtt",
  // aliases, except \bm defined below
  "\\Bbb", "\\bold", "\\frak"],
  props: {
    numArgs: 1,
    allowedInArgument: true
  },
  handler: (_ref, args) => {
    var {
      parser,
      funcName
    } = _ref;
    var body = normalizeArgument(args[0]);
    var func = funcName;
    if (func in fontAliases) {
      func = fontAliases[func];
    }
    return {
      type: "font",
      mode: parser.mode,
      font: func.slice(1),
      body
    };
  },
  htmlBuilder: htmlBuilder$5,
  mathmlBuilder: mathmlBuilder$4
});
defineFunction({
  type: "mclass",
  names: ["\\boldsymbol", "\\bm"],
  props: {
    numArgs: 1
  },
  handler: (_ref2, args) => {
    var {
      parser
    } = _ref2;
    var body = args[0];
    // amsbsy.sty's \boldsymbol uses \binrel spacing to inherit the
    // argument's bin|rel|ord status
    return {
      type: "mclass",
      mode: parser.mode,
      mclass: binrelClass(body),
      body: [{
        type: "font",
        mode: parser.mode,
        font: "boldsymbol",
        body
      }],
      isCharacterBox: isCharacterBox(body)
    };
  }
});
// Old font changing functions
defineFunction({
  type: "font",
  names: ["\\rm", "\\sf", "\\tt", "\\bf", "\\it", "\\cal"],
  props: {
    numArgs: 0,
    allowedInText: true
  },
  handler: (_ref3, args) => {
    var {
      parser,
      funcName,
      breakOnTokenText
    } = _ref3;
    var {
      mode
    } = parser;
    var body = parser.parseExpression(true, breakOnTokenText);
    return {
      type: "font",
      mode: mode,
      font: "math" + funcName.slice(1),
      body: {
        type: "ordgroup",
        mode: parser.mode,
        body
      }
    };
  },
  htmlBuilder: htmlBuilder$5,
  mathmlBuilder: mathmlBuilder$4
});

var htmlBuilder$4 = (group, options) => {
  // Fractions are handled in the TeXbook on pages 444-445, rules 15(a-e).
  var style = options.style;
  var nstyle = style.fracNum();
  var dstyle = style.fracDen();
  var newOptions;
  newOptions = options.havingStyle(nstyle);
  var numerm = buildGroup$1(group.numer, newOptions, options);
  if (group.continued) {
    // \cfrac inserts a \strut into the numerator.
    // Get \strut dimensions from TeXbook page 353.
    var hStrut = 8.5 / options.fontMetrics().ptPerEm;
    var dStrut = 3.5 / options.fontMetrics().ptPerEm;
    numerm.height = numerm.height < hStrut ? hStrut : numerm.height;
    numerm.depth = numerm.depth < dStrut ? dStrut : numerm.depth;
  }
  newOptions = options.havingStyle(dstyle);
  var denomm = buildGroup$1(group.denom, newOptions, options);
  var rule;
  var ruleWidth;
  var ruleSpacing;
  if (group.hasBarLine) {
    if (group.barSize) {
      ruleWidth = calculateSize(group.barSize, options);
      rule = makeLineSpan("frac-line", options, ruleWidth);
    } else {
      rule = makeLineSpan("frac-line", options);
    }
    ruleWidth = rule.height;
    ruleSpacing = rule.height;
  } else {
    rule = null;
    ruleWidth = 0;
    ruleSpacing = options.fontMetrics().defaultRuleThickness;
  }
  // Rule 15b
  var numShift;
  var clearance;
  var denomShift;
  if (style.size === Style$1.DISPLAY.size) {
    numShift = options.fontMetrics().num1;
    if (ruleWidth > 0) {
      clearance = 3 * ruleSpacing;
    } else {
      clearance = 7 * ruleSpacing;
    }
    denomShift = options.fontMetrics().denom1;
  } else {
    if (ruleWidth > 0) {
      numShift = options.fontMetrics().num2;
      clearance = ruleSpacing;
    } else {
      numShift = options.fontMetrics().num3;
      clearance = 3 * ruleSpacing;
    }
    denomShift = options.fontMetrics().denom2;
  }
  var frac;
  if (!rule) {
    // Rule 15c
    var candidateClearance = numShift - numerm.depth - (denomm.height - denomShift);
    if (candidateClearance < clearance) {
      numShift += 0.5 * (clearance - candidateClearance);
      denomShift += 0.5 * (clearance - candidateClearance);
    }
    frac = makeVList({
      positionType: "individualShift",
      children: [{
        type: "elem",
        elem: denomm,
        shift: denomShift
      }, {
        type: "elem",
        elem: numerm,
        shift: -numShift
      }]
    });
  } else {
    // Rule 15d
    var axisHeight = options.fontMetrics().axisHeight;
    if (numShift - numerm.depth - (axisHeight + 0.5 * ruleWidth) < clearance) {
      numShift += clearance - (numShift - numerm.depth - (axisHeight + 0.5 * ruleWidth));
    }
    if (axisHeight - 0.5 * ruleWidth - (denomm.height - denomShift) < clearance) {
      denomShift += clearance - (axisHeight - 0.5 * ruleWidth - (denomm.height - denomShift));
    }
    var midShift = -(axisHeight - 0.5 * ruleWidth);
    frac = makeVList({
      positionType: "individualShift",
      children: [{
        type: "elem",
        elem: denomm,
        shift: denomShift
      }, {
        type: "elem",
        elem: rule,
        shift: midShift
      }, {
        type: "elem",
        elem: numerm,
        shift: -numShift
      }]
    });
  }
  // Since we manually change the style sometimes (with \dfrac or \tfrac),
  // account for the possible size change here.
  newOptions = options.havingStyle(style);
  frac.height *= newOptions.sizeMultiplier / options.sizeMultiplier;
  frac.depth *= newOptions.sizeMultiplier / options.sizeMultiplier;
  // Rule 15e
  var delimSize;
  if (style.size === Style$1.DISPLAY.size) {
    delimSize = options.fontMetrics().delim1;
  } else if (style.size === Style$1.SCRIPTSCRIPT.size) {
    delimSize = options.havingStyle(Style$1.SCRIPT).fontMetrics().delim2;
  } else {
    delimSize = options.fontMetrics().delim2;
  }
  var leftDelim;
  var rightDelim;
  if (group.leftDelim == null) {
    leftDelim = makeNullDelimiter(options, ["mopen"]);
  } else {
    leftDelim = makeCustomSizedDelim(group.leftDelim, delimSize, true, options.havingStyle(style), group.mode, ["mopen"]);
  }
  if (group.continued) {
    rightDelim = makeSpan([]); // zero width for \cfrac
  } else if (group.rightDelim == null) {
    rightDelim = makeNullDelimiter(options, ["mclose"]);
  } else {
    rightDelim = makeCustomSizedDelim(group.rightDelim, delimSize, true, options.havingStyle(style), group.mode, ["mclose"]);
  }
  return makeSpan(["mord"].concat(newOptions.sizingClasses(options)), [leftDelim, makeSpan(["mfrac"], [frac]), rightDelim], options);
};
var mathmlBuilder$3 = (group, options) => {
  var node = new MathNode("mfrac", [buildGroup(group.numer, options), buildGroup(group.denom, options)]);
  if (!group.hasBarLine) {
    node.setAttribute("linethickness", "0px");
  } else if (group.barSize) {
    var ruleWidth = calculateSize(group.barSize, options);
    node.setAttribute("linethickness", makeEm(ruleWidth));
  }
  if (group.leftDelim != null || group.rightDelim != null) {
    var withDelims = [];
    if (group.leftDelim != null) {
      var leftOp = new MathNode("mo", [new TextNode(group.leftDelim.replace("\\", ""))]);
      leftOp.setAttribute("fence", "true");
      withDelims.push(leftOp);
    }
    withDelims.push(node);
    if (group.rightDelim != null) {
      var rightOp = new MathNode("mo", [new TextNode(group.rightDelim.replace("\\", ""))]);
      rightOp.setAttribute("fence", "true");
      withDelims.push(rightOp);
    }
    return makeRow(withDelims);
  }
  return node;
};
var wrapWithStyle = (frac, style) => {
  if (!style) {
    return frac;
  }
  var wrapper = {
    type: "styling",
    mode: frac.mode,
    style,
    body: [frac]
  };
  // @ts-ignore defineFunction handler needs to return ParseNode<"genfrac">
  return wrapper;
};
defineFunction({
  type: "genfrac",
  names: ["\\cfrac", "\\dfrac", "\\frac", "\\tfrac", "\\dbinom", "\\binom", "\\tbinom", "\\\\atopfrac",
  // can’t be entered directly
  "\\\\bracefrac", "\\\\brackfrac" // ditto
  ],
  props: {
    numArgs: 2,
    allowedInArgument: true
  },
  handler: (_ref, args) => {
    var {
      parser,
      funcName
    } = _ref;
    var numer = args[0];
    var denom = args[1];
    var hasBarLine;
    var leftDelim = null;
    var rightDelim = null;
    switch (funcName) {
      case "\\cfrac":
      case "\\dfrac":
      case "\\frac":
      case "\\tfrac":
        hasBarLine = true;
        break;
      case "\\\\atopfrac":
        hasBarLine = false;
        break;
      case "\\dbinom":
      case "\\binom":
      case "\\tbinom":
        hasBarLine = false;
        leftDelim = "(";
        rightDelim = ")";
        break;
      case "\\\\bracefrac":
        hasBarLine = false;
        leftDelim = "\\{";
        rightDelim = "\\}";
        break;
      case "\\\\brackfrac":
        hasBarLine = false;
        leftDelim = "[";
        rightDelim = "]";
        break;
      default:
        throw new Error("Unrecognized genfrac command");
    }
    var continued = funcName === "\\cfrac";
    var style = null;
    if (continued || funcName.startsWith("\\d")) {
      style = "display";
    } else if (funcName.startsWith("\\t")) {
      style = "text";
    }
    return wrapWithStyle({
      type: "genfrac",
      mode: parser.mode,
      numer,
      denom,
      continued,
      hasBarLine,
      leftDelim,
      rightDelim,
      barSize: null
    }, style);
  },
  htmlBuilder: htmlBuilder$4,
  mathmlBuilder: mathmlBuilder$3
});
// Infix generalized fractions -- these are not rendered directly, but replaced
// immediately by one of the variants above.
defineFunction({
  type: "infix",
  names: ["\\over", "\\choose", "\\atop", "\\brace", "\\brack"],
  props: {
    numArgs: 0,
    infix: true
  },
  handler(_ref2) {
    var {
      parser,
      funcName,
      token
    } = _ref2;
    var replaceWith;
    switch (funcName) {
      case "\\over":
        replaceWith = "\\frac";
        break;
      case "\\choose":
        replaceWith = "\\binom";
        break;
      case "\\atop":
        replaceWith = "\\\\atopfrac";
        break;
      case "\\brace":
        replaceWith = "\\\\bracefrac";
        break;
      case "\\brack":
        replaceWith = "\\\\brackfrac";
        break;
      default:
        throw new Error("Unrecognized infix genfrac command");
    }
    return {
      type: "infix",
      mode: parser.mode,
      replaceWith,
      token
    };
  }
});
var stylArray = ["display", "text", "script", "scriptscript"];
var delimFromValue = function delimFromValue(delimString) {
  var delim = null;
  if (delimString.length > 0) {
    delim = delimString;
    delim = delim === "." ? null : delim;
  }
  return delim;
};
defineFunction({
  type: "genfrac",
  names: ["\\genfrac"],
  props: {
    numArgs: 6,
    allowedInArgument: true,
    argTypes: ["math", "math", "size", "text", "math", "math"]
  },
  handler(_ref3, args) {
    var {
      parser
    } = _ref3;
    var numer = args[4];
    var denom = args[5];
    // Look into the parse nodes to get the desired delimiters.
    var leftNode = normalizeArgument(args[0]);
    var leftDelim = leftNode.type === "atom" && leftNode.family === "open" ? delimFromValue(leftNode.text) : null;
    var rightNode = normalizeArgument(args[1]);
    var rightDelim = rightNode.type === "atom" && rightNode.family === "close" ? delimFromValue(rightNode.text) : null;
    var barNode = assertNodeType(args[2], "size");
    var hasBarLine;
    var barSize = null;
    if (barNode.isBlank) {
      // \genfrac acts differently than \above.
      // \genfrac treats an empty size group as a signal to use a
      // standard bar size. \above would see size = 0 and omit the bar.
      hasBarLine = true;
    } else {
      barSize = barNode.value;
      hasBarLine = barSize.number > 0;
    }
    // Find out if we want displaystyle, textstyle, etc.
    var size = null;
    var styl = args[3];
    if (styl.type === "ordgroup") {
      if (styl.body.length > 0) {
        var textOrd = assertNodeType(styl.body[0], "textord");
        size = stylArray[Number(textOrd.text)];
      }
    } else {
      styl = assertNodeType(styl, "textord");
      size = stylArray[Number(styl.text)];
    }
    return wrapWithStyle({
      type: "genfrac",
      mode: parser.mode,
      numer,
      denom,
      continued: false,
      hasBarLine,
      barSize,
      leftDelim,
      rightDelim
    }, size);
  }
});
// \above is an infix fraction that also defines a fraction bar size.
defineFunction({
  type: "infix",
  names: ["\\above"],
  props: {
    numArgs: 1,
    argTypes: ["size"],
    infix: true
  },
  handler(_ref4, args) {
    var {
      parser,
      funcName,
      token
    } = _ref4;
    return {
      type: "infix",
      mode: parser.mode,
      replaceWith: "\\\\abovefrac",
      size: assertNodeType(args[0], "size").value,
      token
    };
  }
});
defineFunction({
  type: "genfrac",
  names: ["\\\\abovefrac"],
  props: {
    numArgs: 3,
    argTypes: ["math", "size", "math"]
  },
  handler: (_ref5, args) => {
    var {
      parser,
      funcName
    } = _ref5;
    var numer = args[0];
    var barSize = assertNodeType(args[1], "infix").size;
    if (!barSize) {
      throw new Error("\\\\abovefrac expected size, but got " + String(barSize));
    }
    var denom = args[2];
    var hasBarLine = barSize.number > 0;
    return {
      type: "genfrac",
      mode: parser.mode,
      numer,
      denom,
      continued: false,
      hasBarLine,
      barSize,
      leftDelim: null,
      rightDelim: null
    };
  }
});

// NOTE: Unlike most `htmlBuilder`s, this one handles not only "horizBrace", but
// also "supsub" since an over/underbrace can affect super/subscripting.
var htmlBuilder$3 = (grp, options) => {
  var style = options.style;
  // Pull out the `ParseNode<"horizBrace">` if `grp` is a "supsub" node.
  var supSubGroup;
  var group;
  if (grp.type === "supsub") {
    // Ref: LaTeX source2e: }}}}\limits}
    // i.e. LaTeX treats the brace similar to an op and passes it
    // with \limits, so we need to assign supsub style.
    supSubGroup = grp.sup ? buildGroup$1(grp.sup, options.havingStyle(style.sup()), options) : buildGroup$1(grp.sub, options.havingStyle(style.sub()), options);
    group = assertNodeType(grp.base, "horizBrace");
  } else {
    group = assertNodeType(grp, "horizBrace");
  }
  // Build the base group
  var body = buildGroup$1(group.base, options.havingBaseStyle(Style$1.DISPLAY));
  // Create the stretchy element
  var braceBody = stretchySvg(group, options);
  // Generate the vlist, with the appropriate kerns        ┏━━━━━━━━┓
  // This first vlist contains the content and the brace:   equation
  var vlist;
  if (group.isOver) {
    vlist = makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: body
      }, {
        type: "kern",
        size: 0.1
      }, {
        type: "elem",
        elem: braceBody,
        wrapperClasses: ["svg-align"]
      }]
    });
  } else {
    vlist = makeVList({
      positionType: "bottom",
      positionData: body.depth + 0.1 + braceBody.height,
      children: [{
        type: "elem",
        elem: braceBody,
        wrapperClasses: ["svg-align"]
      }, {
        type: "kern",
        size: 0.1
      }, {
        type: "elem",
        elem: body
      }]
    });
  }
  if (supSubGroup) {
    // To write the supsub, wrap the first vlist in another vlist:
    // They can't all go in the same vlist, because the note might be
    // wider than the equation. We want the equation to control the
    // brace width.
    //      note          long note           long note
    //   ┏━━━━━━━━┓   or    ┏━━━┓     not    ┏━━━━━━━━━┓
    //    equation           eqn                 eqn
    var vSpan = makeSpan(["minner", group.isOver ? "mover" : "munder"], [vlist], options);
    if (group.isOver) {
      vlist = makeVList({
        positionType: "firstBaseline",
        children: [{
          type: "elem",
          elem: vSpan
        }, {
          type: "kern",
          size: 0.2
        }, {
          type: "elem",
          elem: supSubGroup
        }]
      });
    } else {
      vlist = makeVList({
        positionType: "bottom",
        positionData: vSpan.depth + 0.2 + supSubGroup.height + supSubGroup.depth,
        children: [{
          type: "elem",
          elem: supSubGroup
        }, {
          type: "kern",
          size: 0.2
        }, {
          type: "elem",
          elem: vSpan
        }]
      });
    }
  }
  return makeSpan(["minner", group.isOver ? "mover" : "munder"], [vlist], options);
};
var mathmlBuilder$2 = (group, options) => {
  var accentNode = stretchyMathML(group.label);
  return new MathNode(group.isOver ? "mover" : "munder", [buildGroup(group.base, options), accentNode]);
};
// Horizontal stretchy braces
defineFunction({
  type: "horizBrace",
  names: ["\\overbrace", "\\underbrace", "\\overbracket", "\\underbracket"],
  props: {
    numArgs: 1
  },
  handler(_ref, args) {
    var {
      parser,
      funcName
    } = _ref;
    return {
      type: "horizBrace",
      mode: parser.mode,
      label: funcName,
      isOver: funcName.includes("\\over"),
      base: args[0]
    };
  },
  htmlBuilder: htmlBuilder$3,
  mathmlBuilder: mathmlBuilder$2
});

defineFunction({
  type: "href",
  names: ["\\href"],
  props: {
    numArgs: 2,
    argTypes: ["url", "original"],
    allowedInText: true
  },
  handler: (_ref, args) => {
    var {
      parser
    } = _ref;
    var body = args[1];
    var href = assertNodeType(args[0], "url").url;
    if (!parser.settings.isTrusted({
      command: "\\href",
      url: href
    })) {
      return parser.formatUnsupportedCmd("\\href");
    }
    return {
      type: "href",
      mode: parser.mode,
      href,
      body: ordargument(body)
    };
  },
  htmlBuilder: (group, options) => {
    var elements = buildExpression$1(group.body, options, false);
    return makeAnchor(group.href, [], elements, options);
  },
  mathmlBuilder: (group, options) => {
    var math = buildExpressionRow(group.body, options);
    if (!(math instanceof MathNode)) {
      math = new MathNode("mrow", [math]);
    }
    math.setAttribute("href", group.href);
    return math;
  }
});
defineFunction({
  type: "href",
  names: ["\\url"],
  props: {
    numArgs: 1,
    argTypes: ["url"],
    allowedInText: true
  },
  handler: (_ref2, args) => {
    var {
      parser
    } = _ref2;
    var href = assertNodeType(args[0], "url").url;
    if (!parser.settings.isTrusted({
      command: "\\url",
      url: href
    })) {
      return parser.formatUnsupportedCmd("\\url");
    }
    var chars = [];
    for (var i = 0; i < href.length; i++) {
      var c = href[i];
      if (c === "~") {
        c = "\\textasciitilde";
      }
      chars.push({
        type: "textord",
        mode: "text",
        text: c
      });
    }
    var body = {
      type: "text",
      mode: parser.mode,
      font: "\\texttt",
      body: chars
    };
    return {
      type: "href",
      mode: parser.mode,
      href,
      body: ordargument(body)
    };
  }
});

// \hbox is provided for compatibility with LaTeX \vcenter.
// In LaTeX, \vcenter can act only on a box, as in
// \vcenter{\hbox{$\frac{a+b}{\dfrac{c}{d}}$}}
// This function by itself doesn't do anything but prevent a soft line break.
defineFunction({
  type: "hbox",
  names: ["\\hbox"],
  props: {
    numArgs: 1,
    argTypes: ["text"],
    allowedInText: true,
    primitive: true
  },
  handler(_ref, args) {
    var {
      parser
    } = _ref;
    return {
      type: "hbox",
      mode: parser.mode,
      body: ordargument(args[0])
    };
  },
  htmlBuilder(group, options) {
    var elements = buildExpression$1(group.body, options.withFont(''), false);
    return makeFragment(elements);
  },
  mathmlBuilder(group, options) {
    return new MathNode("mrow", buildExpression(group.body, options.withFont('')));
  }
});

defineFunction({
  type: "html",
  names: ["\\htmlClass", "\\htmlId", "\\htmlStyle", "\\htmlData"],
  props: {
    numArgs: 2,
    argTypes: ["raw", "original"],
    allowedInText: true
  },
  handler: (_ref, args) => {
    var {
      parser,
      funcName,
      token
    } = _ref;
    var value = assertNodeType(args[0], "raw").string;
    var body = args[1];
    if (parser.settings.strict) {
      parser.settings.reportNonstrict("htmlExtension", "HTML extension is disabled on strict mode");
    }
    var trustContext;
    var attributes = {};
    switch (funcName) {
      case "\\htmlClass":
        attributes.class = value;
        trustContext = {
          command: "\\htmlClass",
          class: value
        };
        break;
      case "\\htmlId":
        attributes.id = value;
        trustContext = {
          command: "\\htmlId",
          id: value
        };
        break;
      case "\\htmlStyle":
        attributes.style = value;
        trustContext = {
          command: "\\htmlStyle",
          style: value
        };
        break;
      case "\\htmlData":
        {
          var data = value.split(",");
          for (var i = 0; i < data.length; i++) {
            var item = data[i];
            var firstEquals = item.indexOf("=");
            if (firstEquals < 0) {
              throw new ParseError("\\htmlData key/value '" + item + "'" + " missing equals sign");
            }
            var key = item.slice(0, firstEquals);
            var _value = item.slice(firstEquals + 1);
            attributes["data-" + key.trim()] = _value;
          }
          trustContext = {
            command: "\\htmlData",
            attributes
          };
          break;
        }
      default:
        throw new Error("Unrecognized html command");
    }
    if (!parser.settings.isTrusted(trustContext)) {
      return parser.formatUnsupportedCmd(funcName);
    }
    return {
      type: "html",
      mode: parser.mode,
      attributes,
      body: ordargument(body)
    };
  },
  htmlBuilder: (group, options) => {
    var elements = buildExpression$1(group.body, options, false);
    var classes = ["enclosing"];
    if (group.attributes.class) {
      classes.push(...group.attributes.class.trim().split(/\s+/));
    }
    var span = makeSpan(classes, elements, options);
    for (var attr in group.attributes) {
      if (attr !== "class" && group.attributes.hasOwnProperty(attr)) {
        span.setAttribute(attr, group.attributes[attr]);
      }
    }
    return span;
  },
  mathmlBuilder: (group, options) => {
    return buildExpressionRow(group.body, options);
  }
});

defineFunction({
  type: "htmlmathml",
  names: ["\\html@mathml"],
  props: {
    numArgs: 2,
    allowedInArgument: true,
    allowedInText: true
  },
  handler: (_ref, args) => {
    var {
      parser
    } = _ref;
    return {
      type: "htmlmathml",
      mode: parser.mode,
      html: ordargument(args[0]),
      mathml: ordargument(args[1])
    };
  },
  htmlBuilder: (group, options) => {
    var elements = buildExpression$1(group.html, options, false);
    return makeFragment(elements);
  },
  mathmlBuilder: (group, options) => {
    return buildExpressionRow(group.mathml, options);
  }
});

var sizeData = function sizeData(str) {
  if (/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(str)) {
    // str is a number with no unit specified.
    // default unit is bp, per graphix package.
    return {
      number: +str,
      unit: "bp"
    };
  } else {
    var match = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(str);
    if (!match) {
      throw new ParseError("Invalid size: '" + str + "' in \\includegraphics");
    }
    var data = {
      number: +(match[1] + match[2]),
      // sign + magnitude, cast to number
      unit: match[3]
    };
    if (!validUnit(data)) {
      throw new ParseError("Invalid unit: '" + data.unit + "' in \\includegraphics.");
    }
    return data;
  }
};
defineFunction({
  type: "includegraphics",
  names: ["\\includegraphics"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1,
    argTypes: ["raw", "url"],
    allowedInText: false
  },
  handler: (_ref, args, optArgs) => {
    var {
      parser
    } = _ref;
    var width = {
      number: 0,
      unit: "em"
    };
    var height = {
      number: 0.9,
      unit: "em"
    }; // sorta character sized.
    var totalheight = {
      number: 0,
      unit: "em"
    };
    var alt = "";
    if (optArgs[0]) {
      var attributeStr = assertNodeType(optArgs[0], "raw").string;
      // Parser.js does not parse key/value pairs. We get a string.
      var attributes = attributeStr.split(",");
      for (var i = 0; i < attributes.length; i++) {
        var keyVal = attributes[i].split("=");
        if (keyVal.length === 2) {
          var str = keyVal[1].trim();
          switch (keyVal[0].trim()) {
            case "alt":
              alt = str;
              break;
            case "width":
              width = sizeData(str);
              break;
            case "height":
              height = sizeData(str);
              break;
            case "totalheight":
              totalheight = sizeData(str);
              break;
            default:
              throw new ParseError("Invalid key: '" + keyVal[0] + "' in \\includegraphics.");
          }
        }
      }
    }
    var src = assertNodeType(args[0], "url").url;
    if (alt === "") {
      // No alt given. Use the file name. Strip away the path.
      alt = src;
      alt = alt.replace(/^.*[\\/]/, '');
      alt = alt.substring(0, alt.lastIndexOf('.'));
    }
    if (!parser.settings.isTrusted({
      command: "\\includegraphics",
      url: src
    })) {
      return parser.formatUnsupportedCmd("\\includegraphics");
    }
    return {
      type: "includegraphics",
      mode: parser.mode,
      alt: alt,
      width: width,
      height: height,
      totalheight: totalheight,
      src: src
    };
  },
  htmlBuilder: (group, options) => {
    var height = calculateSize(group.height, options);
    var depth = 0;
    if (group.totalheight.number > 0) {
      depth = calculateSize(group.totalheight, options) - height;
    }
    var width = 0;
    if (group.width.number > 0) {
      width = calculateSize(group.width, options);
    }
    var style = {
      height: makeEm(height + depth)
    };
    if (width > 0) {
      style.width = makeEm(width);
    }
    if (depth > 0) {
      style.verticalAlign = makeEm(-depth);
    }
    var node = new Img(group.src, group.alt, style);
    node.height = height;
    node.depth = depth;
    return node;
  },
  mathmlBuilder: (group, options) => {
    var node = new MathNode("mglyph", []);
    node.setAttribute("alt", group.alt);
    var height = calculateSize(group.height, options);
    var depth = 0;
    if (group.totalheight.number > 0) {
      depth = calculateSize(group.totalheight, options) - height;
      node.setAttribute("valign", makeEm(-depth));
    }
    node.setAttribute("height", makeEm(height + depth));
    if (group.width.number > 0) {
      var width = calculateSize(group.width, options);
      node.setAttribute("width", makeEm(width));
    }
    node.setAttribute("src", group.src);
    return node;
  }
});

// Horizontal spacing commands
// TODO: \hskip and \mskip should support plus and minus in lengths
defineFunction({
  type: "kern",
  names: ["\\kern", "\\mkern", "\\hskip", "\\mskip"],
  props: {
    numArgs: 1,
    argTypes: ["size"],
    primitive: true,
    allowedInText: true
  },
  handler(_ref, args) {
    var {
      parser,
      funcName
    } = _ref;
    var size = assertNodeType(args[0], "size");
    if (parser.settings.strict) {
      var mathFunction = funcName[1] === 'm'; // \mkern, \mskip
      var muUnit = size.value.unit === 'mu';
      if (mathFunction) {
        if (!muUnit) {
          parser.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " supports only mu units, " + ("not " + size.value.unit + " units"));
        }
        if (parser.mode !== "math") {
          parser.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " works only in math mode");
        }
      } else {
        // !mathFunction
        if (muUnit) {
          parser.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + funcName + " doesn't support mu units");
        }
      }
    }
    return {
      type: "kern",
      mode: parser.mode,
      dimension: size.value
    };
  },
  htmlBuilder(group, options) {
    return makeGlue(group.dimension, options);
  },
  mathmlBuilder(group, options) {
    var dimension = calculateSize(group.dimension, options);
    return new SpaceNode(dimension);
  }
});

// Horizontal overlap functions
defineFunction({
  type: "lap",
  names: ["\\mathllap", "\\mathrlap", "\\mathclap"],
  props: {
    numArgs: 1,
    allowedInText: true
  },
  handler: (_ref, args) => {
    var {
      parser,
      funcName
    } = _ref;
    var body = args[0];
    return {
      type: "lap",
      mode: parser.mode,
      alignment: funcName.slice(5),
      body
    };
  },
  htmlBuilder: (group, options) => {
    // mathllap, mathrlap, mathclap
    var inner;
    if (group.alignment === "clap") {
      // ref: https://www.math.lsu.edu/~aperlis/publications/mathclap/
      inner = makeSpan([], [buildGroup$1(group.body, options)]);
      // wrap, since CSS will center a .clap > .inner > span
      inner = makeSpan(["inner"], [inner], options);
    } else {
      inner = makeSpan(["inner"], [buildGroup$1(group.body, options)]);
    }
    var fix = makeSpan(["fix"], []);
    var node = makeSpan([group.alignment], [inner, fix], options);
    // At this point, we have correctly set horizontal alignment of the
    // two items involved in the lap.
    // Next, use a strut to set the height of the HTML bounding box.
    // Otherwise, a tall argument may be misplaced.
    // This code resolved issue #1153
    var strut = makeSpan(["strut"]);
    strut.style.height = makeEm(node.height + node.depth);
    if (node.depth) {
      strut.style.verticalAlign = makeEm(-node.depth);
    }
    node.children.unshift(strut);
    // Next, prevent vertical misplacement when next to something tall.
    // This code resolves issue #1234
    node = makeSpan(["thinbox"], [node], options);
    return makeSpan(["mord", "vbox"], [node], options);
  },
  mathmlBuilder: (group, options) => {
    // mathllap, mathrlap, mathclap
    var node = new MathNode("mpadded", [buildGroup(group.body, options)]);
    if (group.alignment !== "rlap") {
      var offset = group.alignment === "llap" ? "-1" : "-0.5";
      node.setAttribute("lspace", offset + "width");
    }
    node.setAttribute("width", "0px");
    return node;
  }
});

// Switching from text mode back to math mode
defineFunction({
  type: "styling",
  names: ["\\(", "$"],
  props: {
    numArgs: 0,
    allowedInText: true,
    allowedInMath: false
  },
  handler(_ref, args) {
    var {
      funcName,
      parser
    } = _ref;
    var outerMode = parser.mode;
    parser.switchMode("math");
    var close = funcName === "\\(" ? "\\)" : "$";
    var body = parser.parseExpression(false, close);
    parser.expect(close);
    parser.switchMode(outerMode);
    return {
      type: "styling",
      mode: parser.mode,
      style: "text",
      resetFont: true,
      body
    };
  }
});
// Check for extra closing math delimiters
defineFunction({
  type: "text",
  // Doesn't matter what this is.
  names: ["\\)", "\\]"],
  props: {
    numArgs: 0,
    allowedInText: true,
    allowedInMath: false
  },
  handler(context, args) {
    throw new ParseError("Mismatched " + context.funcName);
  }
});

var chooseMathStyle = (group, options) => {
  switch (options.style.size) {
    case Style$1.DISPLAY.size:
      return group.display;
    case Style$1.TEXT.size:
      return group.text;
    case Style$1.SCRIPT.size:
      return group.script;
    case Style$1.SCRIPTSCRIPT.size:
      return group.scriptscript;
    default:
      return group.text;
  }
};
defineFunction({
  type: "mathchoice",
  names: ["\\mathchoice"],
  props: {
    numArgs: 4,
    primitive: true
  },
  handler: (_ref, args) => {
    var {
      parser
    } = _ref;
    return {
      type: "mathchoice",
      mode: parser.mode,
      display: ordargument(args[0]),
      text: ordargument(args[1]),
      script: ordargument(args[2]),
      scriptscript: ordargument(args[3])
    };
  },
  htmlBuilder: (group, options) => {
    var body = chooseMathStyle(group, options);
    var elements = buildExpression$1(body, options, false);
    return makeFragment(elements);
  },
  mathmlBuilder: (group, options) => {
    var body = chooseMathStyle(group, options);
    return buildExpressionRow(body, options);
  }
});

// For an operator with limits, assemble the base, sup, and sub into a span.
var assembleSupSub = (base, supGroup, subGroup, options, style, slant, baseShift) => {
  base = makeSpan([], [base]);
  var subIsSingleCharacter = subGroup && isCharacterBox(subGroup);
  var sub;
  var sup;
  // We manually have to handle the superscripts and subscripts. This,
  // aside from the kern calculations, is copied from supsub.
  if (supGroup) {
    var elem = buildGroup$1(supGroup, options.havingStyle(style.sup()), options);
    sup = {
      elem,
      kern: Math.max(options.fontMetrics().bigOpSpacing1, options.fontMetrics().bigOpSpacing3 - elem.depth)
    };
  }
  if (subGroup) {
    var _elem = buildGroup$1(subGroup, options.havingStyle(style.sub()), options);
    sub = {
      elem: _elem,
      kern: Math.max(options.fontMetrics().bigOpSpacing2, options.fontMetrics().bigOpSpacing4 - _elem.height)
    };
  }
  // Build the final group as a vlist of the possible subscript, base,
  // and possible superscript.
  var finalGroup;
  if (sup && sub) {
    var bottom = options.fontMetrics().bigOpSpacing5 + sub.elem.height + sub.elem.depth + sub.kern + base.depth + baseShift;
    finalGroup = makeVList({
      positionType: "bottom",
      positionData: bottom,
      children: [{
        type: "kern",
        size: options.fontMetrics().bigOpSpacing5
      }, {
        type: "elem",
        elem: sub.elem,
        marginLeft: makeEm(-slant)
      }, {
        type: "kern",
        size: sub.kern
      }, {
        type: "elem",
        elem: base
      }, {
        type: "kern",
        size: sup.kern
      }, {
        type: "elem",
        elem: sup.elem,
        marginLeft: makeEm(slant)
      }, {
        type: "kern",
        size: options.fontMetrics().bigOpSpacing5
      }]
    });
  } else if (sub) {
    var top = base.height - baseShift;
    // Shift the limits by the slant of the symbol. Note
    // that we are supposed to shift the limits by 1/2 of the slant,
    // but since we are centering the limits adding a full slant of
    // margin will shift by 1/2 that.
    finalGroup = makeVList({
      positionType: "top",
      positionData: top,
      children: [{
        type: "kern",
        size: options.fontMetrics().bigOpSpacing5
      }, {
        type: "elem",
        elem: sub.elem,
        marginLeft: makeEm(-slant)
      }, {
        type: "kern",
        size: sub.kern
      }, {
        type: "elem",
        elem: base
      }]
    });
  } else if (sup) {
    var _bottom = base.depth + baseShift;
    finalGroup = makeVList({
      positionType: "bottom",
      positionData: _bottom,
      children: [{
        type: "elem",
        elem: base
      }, {
        type: "kern",
        size: sup.kern
      }, {
        type: "elem",
        elem: sup.elem,
        marginLeft: makeEm(slant)
      }, {
        type: "kern",
        size: options.fontMetrics().bigOpSpacing5
      }]
    });
  } else {
    // This case probably shouldn't occur (this would mean the
    // supsub was sending us a group with no superscript or
    // subscript) but be safe.
    return base;
  }
  var parts = [finalGroup];
  if (sub && slant !== 0 && !subIsSingleCharacter) {
    // A negative margin-left was applied to the lower limit.
    // Avoid an overlap by placing a spacer on the left on the group.
    var spacer = makeSpan(["mspace"], [], options);
    spacer.style.marginRight = makeEm(slant);
    parts.unshift(spacer);
  }
  return makeSpan(["mop", "op-limits"], parts, options);
};

// Limits, symbols
// Most operators have a large successor symbol, but these don't.
var noSuccessor = new Set(["\\smallint"]);
// NOTE: Unlike most `htmlBuilder`s, this one handles not only "op", but also
// "supsub" since some of them (like \int) can affect super/subscripting.
var htmlBuilder$2 = (grp, options) => {
  // Operators are handled in the TeXbook pg. 443-444, rule 13(a).
  var supGroup;
  var subGroup;
  var hasLimits = false;
  var group;
  if (grp.type === "supsub") {
    // If we have limits, supsub will pass us its group to handle. Pull
    // out the superscript and subscript and set the group to the op in
    // its base.
    supGroup = grp.sup;
    subGroup = grp.sub;
    group = assertNodeType(grp.base, "op");
    hasLimits = true;
  } else {
    group = assertNodeType(grp, "op");
  }
  var style = options.style;
  var large = false;
  if (style.size === Style$1.DISPLAY.size && group.symbol && !noSuccessor.has(group.name)) {
    // Most symbol operators get larger in displaystyle (rule 13)
    large = true;
  }
  var base;
  // Italic correction from the symbol glyph, captured before the symbol
  // may be wrapped in a vlist (for \oiint/\oiiint).  Stays 0 for non-symbol ops.
  var symbolItalic;
  if (group.symbol) {
    // If this is a symbol, create the symbol.
    var fontName = large ? "Size2-Regular" : "Size1-Regular";
    var stash = "";
    if (group.name === "\\oiint" || group.name === "\\oiiint") {
      // No font glyphs yet, so use a glyph w/o the oval.
      // TODO: When font glyphs are available, delete this code.
      stash = group.name.slice(1);
      group.name = stash === "oiint" ? "\\iint" : "\\iiint";
    }
    base = makeSymbol(group.name, fontName, "math", options, ["mop", "op-symbol", large ? "large-op" : "small-op"]);
    symbolItalic = base.italic;
    if (stash.length > 0) {
      // We're in \oiint or \oiiint. Overlay the oval.
      // TODO: When font glyphs are available, delete this code.
      var oval = staticSvg(stash + "Size" + (large ? "2" : "1"), options);
      base = makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: base,
          shift: 0
        }, {
          type: "elem",
          elem: oval,
          shift: large ? 0.08 : 0
        }]
      });
      group.name = "\\" + stash;
      base.classes.unshift("mop");
      // Carry the italic correction from the original symbol to the
      // vlist wrapper so supsub can use it for subscript positioning.
      base.italic = symbolItalic;
    }
  } else if (group.body) {
    // If this is a list, compose that list.
    var inner = buildExpression$1(group.body, options, true);
    if (inner.length === 1 && inner[0] instanceof SymbolNode) {
      base = inner[0];
      base.classes[0] = "mop"; // replace old mclass
    } else {
      base = makeSpan(["mop"], inner, options);
    }
  } else {
    // Otherwise, this is a text operator. Build the text from the
    // operator's name.
    var output = [];
    for (var i = 1; i < group.name.length; i++) {
      output.push(mathsym(group.name[i], group.mode, options));
    }
    base = makeSpan(["mop"], output, options);
  }
  // If content of op is a single symbol, shift it vertically.
  var baseShift = 0;
  var slant = 0;
  if ((base instanceof SymbolNode || group.name === "\\oiint" || group.name === "\\oiiint") && !group.suppressBaseShift) {
    var _base$italic;
    // We suppress the shift of the base of \overset and \underset. Otherwise,
    // shift the symbol so its center lies on the axis (rule 13). It
    // appears that our fonts have the centers of the symbols already
    // almost on the axis, so these numbers are very small. Note we
    // don't actually apply this here, but instead it is used either in
    // the vlist creation or separately when there are no limits.
    baseShift = (base.height - base.depth) / 2 - options.fontMetrics().axisHeight;
    // The slant of the symbol is just its italic correction.
    // SymbolNode carries .italic natively; Span (for \oiint/\oiiint)
    // only has it set when nonzero, so default to 0.
    slant = (_base$italic = base.italic) != null ? _base$italic : 0;
  }
  if (hasLimits) {
    return assembleSupSub(base, supGroup, subGroup, options, style, slant, baseShift);
  } else {
    if (baseShift) {
      base.style.position = "relative";
      base.style.top = makeEm(baseShift);
    }
    return base;
  }
};
var mathmlBuilder$1 = (group, options) => {
  var node;
  if (group.symbol) {
    // This is a symbol. Just add the symbol.
    node = new MathNode("mo", [makeText(group.name, group.mode)]);
    if (noSuccessor.has(group.name)) {
      node.setAttribute("largeop", "false");
    }
  } else if (group.body) {
    // This is an operator with children. Add them.
    node = new MathNode("mo", buildExpression(group.body, options));
  } else {
    // This is a text operator. Add all the characters from the
    // operator's name.
    node = new MathNode("mi", [new TextNode(group.name.slice(1))]);
    // Append an <mo>&ApplyFunction;</mo>.
    // ref: https://www.w3.org/TR/REC-MathML/chap3_2.html#sec3.2.4
    var operator = new MathNode("mo", [makeText("\u2061", "text")]);
    if (group.parentIsSupSub) {
      node = new MathNode("mrow", [node, operator]);
    } else {
      node = newDocumentFragment([node, operator]);
    }
  }
  return node;
};
var singleCharBigOps = {
  "\u220F": "\\prod",
  "\u2210": "\\coprod",
  "\u2211": "\\sum",
  "\u22c0": "\\bigwedge",
  "\u22c1": "\\bigvee",
  "\u22c2": "\\bigcap",
  "\u22c3": "\\bigcup",
  "\u2a00": "\\bigodot",
  "\u2a01": "\\bigoplus",
  "\u2a02": "\\bigotimes",
  "\u2a04": "\\biguplus",
  "\u2a06": "\\bigsqcup"
};
defineFunction({
  type: "op",
  names: ["\\coprod", "\\bigvee", "\\bigwedge", "\\biguplus", "\\bigcap", "\\bigcup", "\\intop", "\\prod", "\\sum", "\\bigotimes", "\\bigoplus", "\\bigodot", "\\bigsqcup", "\\smallint", "\u220F", "\u2210", "\u2211", "\u22c0", "\u22c1", "\u22c2", "\u22c3", "\u2a00", "\u2a01", "\u2a02", "\u2a04", "\u2a06"],
  props: {
    numArgs: 0
  },
  handler: (_ref, args) => {
    var {
      parser,
      funcName
    } = _ref;
    var fName = funcName;
    if (fName.length === 1) {
      fName = singleCharBigOps[fName];
    }
    return {
      type: "op",
      mode: parser.mode,
      limits: true,
      parentIsSupSub: false,
      symbol: true,
      name: fName
    };
  },
  htmlBuilder: htmlBuilder$2,
  mathmlBuilder: mathmlBuilder$1
});
// Note: calling defineFunction with a type that's already been defined only
// works because the same htmlBuilder and mathmlBuilder are being used.
defineFunction({
  type: "op",
  names: ["\\mathop"],
  props: {
    numArgs: 1,
    primitive: true
  },
  handler: (_ref2, args) => {
    var {
      parser
    } = _ref2;
    var body = args[0];
    return {
      type: "op",
      mode: parser.mode,
      limits: false,
      parentIsSupSub: false,
      symbol: false,
      body: ordargument(body)
    };
  },
  htmlBuilder: htmlBuilder$2,
  mathmlBuilder: mathmlBuilder$1
});
// There are 2 flags for operators; whether they produce limits in
// displaystyle, and whether they are symbols and should grow in
// displaystyle. These four groups cover the four possible choices.
var singleCharIntegrals = {
  "\u222b": "\\int",
  "\u222c": "\\iint",
  "\u222d": "\\iiint",
  "\u222e": "\\oint",
  "\u222f": "\\oiint",
  "\u2230": "\\oiiint"
};
// No limits, not symbols
defineFunction({
  type: "op",
  names: ["\\arcsin", "\\arccos", "\\arctan", "\\arctg", "\\arcctg", "\\arg", "\\ch", "\\cos", "\\cosec", "\\cosh", "\\cot", "\\cotg", "\\coth", "\\csc", "\\ctg", "\\cth", "\\deg", "\\dim", "\\exp", "\\hom", "\\ker", "\\lg", "\\ln", "\\log", "\\sec", "\\sin", "\\sinh", "\\sh", "\\tan", "\\tanh", "\\tg", "\\th"],
  props: {
    numArgs: 0
  },
  handler(_ref3) {
    var {
      parser,
      funcName
    } = _ref3;
    return {
      type: "op",
      mode: parser.mode,
      limits: false,
      parentIsSupSub: false,
      symbol: false,
      name: funcName
    };
  },
  htmlBuilder: htmlBuilder$2,
  mathmlBuilder: mathmlBuilder$1
});
// Limits, not symbols
defineFunction({
  type: "op",
  names: ["\\det", "\\gcd", "\\inf", "\\lim", "\\max", "\\min", "\\Pr", "\\sup"],
  props: {
    numArgs: 0
  },
  handler(_ref4) {
    var {
      parser,
      funcName
    } = _ref4;
    return {
      type: "op",
      mode: parser.mode,
      limits: true,
      parentIsSupSub: false,
      symbol: false,
      name: funcName
    };
  },
  htmlBuilder: htmlBuilder$2,
  mathmlBuilder: mathmlBuilder$1
});
// No limits, symbols
defineFunction({
  type: "op",
  names: ["\\int", "\\iint", "\\iiint", "\\oint", "\\oiint", "\\oiiint", "\u222b", "\u222c", "\u222d", "\u222e", "\u222f", "\u2230"],
  props: {
    numArgs: 0,
    allowedInArgument: true
  },
  handler(_ref5) {
    var {
      parser,
      funcName
    } = _ref5;
    var fName = funcName;
    if (fName.length === 1) {
      fName = singleCharIntegrals[fName];
    }
    return {
      type: "op",
      mode: parser.mode,
      limits: false,
      parentIsSupSub: false,
      symbol: true,
      name: fName
    };
  },
  htmlBuilder: htmlBuilder$2,
  mathmlBuilder: mathmlBuilder$1
});

// NOTE: Unlike most `htmlBuilder`s, this one handles not only
// "operatorname", but also  "supsub" since \operatorname* can
// affect super/subscripting.
var htmlBuilder$1 = (grp, options) => {
  // Operators are handled in the TeXbook pg. 443-444, rule 13(a).
  var supGroup;
  var subGroup;
  var hasLimits = false;
  var group;
  if (grp.type === "supsub") {
    // If we have limits, supsub will pass us its group to handle. Pull
    // out the superscript and subscript and set the group to the op in
    // its base.
    supGroup = grp.sup;
    subGroup = grp.sub;
    group = assertNodeType(grp.base, "operatorname");
    hasLimits = true;
  } else {
    group = assertNodeType(grp, "operatorname");
  }
  var base;
  if (group.body.length > 0) {
    var body = group.body.map(child => {
      var childText = "text" in child ? child.text : undefined;
      if (typeof childText === "string") {
        return {
          type: "textord",
          mode: child.mode,
          text: childText
        };
      } else {
        return child;
      }
    });
    // Consolidate function names into symbol characters.
    var expression = buildExpression$1(body, options.withFont("mathrm"), true);
    for (var i = 0; i < expression.length; i++) {
      var child = expression[i];
      if (child instanceof SymbolNode) {
        // Per amsopn package,
        // change minus to hyphen and \ast to asterisk
        child.text = child.text.replace(/\u2212/, "-").replace(/\u2217/, "*");
      }
    }
    base = makeSpan(["mop"], expression, options);
  } else {
    base = makeSpan(["mop"], [], options);
  }
  if (hasLimits) {
    return assembleSupSub(base, supGroup, subGroup, options, options.style, 0, 0);
  } else {
    return base;
  }
};
var mathmlBuilder = (group, options) => {
  // The steps taken here are similar to the html version.
  var expression = buildExpression(group.body, options.withFont("mathrm"));
  // Is expression a string or has it something like a fraction?
  var isAllString = true; // default
  for (var i = 0; i < expression.length; i++) {
    var node = expression[i];
    if (node instanceof SpaceNode) ; else if (node instanceof MathNode) {
      switch (node.type) {
        case "mi":
        case "mn":
        case "mspace":
        case "mtext":
          break;
        // Do nothing yet.
        case "mo":
          {
            var child = node.children[0];
            if (node.children.length === 1 && child instanceof TextNode) {
              child.text = child.text.replace(/\u2212/, "-").replace(/\u2217/, "*");
            } else {
              isAllString = false;
            }
            break;
          }
        default:
          isAllString = false;
      }
    } else {
      isAllString = false;
    }
  }
  if (isAllString) {
    // Write a single TextNode instead of multiple nested tags.
    var word = expression.map(node => node.toText()).join("");
    expression = [new TextNode(word)];
  }
  var identifier = new MathNode("mi", expression);
  identifier.setAttribute("mathvariant", "normal");
  // \u2061 is the same as &ApplyFunction;
  // ref: https://www.w3schools.com/charsets/ref_html_entities_a.asp
  var operator = new MathNode("mo", [makeText("\u2061", "text")]);
  if (group.parentIsSupSub) {
    return new MathNode("mrow", [identifier, operator]);
  } else {
    return newDocumentFragment([identifier, operator]);
  }
};
// \operatorname
// amsopn.dtx: \mathop{#1\kern\z@\operator@font#3}\newmcodes@
defineFunction({
  type: "operatorname",
  names: ["\\operatorname@", "\\operatornamewithlimits"],
  props: {
    numArgs: 1
  },
  handler: (_ref, args) => {
    var {
      parser,
      funcName
    } = _ref;
    var body = args[0];
    return {
      type: "operatorname",
      mode: parser.mode,
      body: ordargument(body),
      alwaysHandleSupSub: funcName === "\\operatornamewithlimits",
      limits: false,
      parentIsSupSub: false
    };
  },
  htmlBuilder: htmlBuilder$1,
  mathmlBuilder
});
defineMacro("\\operatorname", "\\@ifstar\\operatornamewithlimits\\operatorname@");

defineFunctionBuilders({
  type: "ordgroup",
  htmlBuilder(group, options) {
    if (group.semisimple) {
      return makeFragment(buildExpression$1(group.body, options, false));
    }
    return makeSpan(["mord"], buildExpression$1(group.body, options, true), options);
  },
  mathmlBuilder(group, options) {
    return buildExpressionRow(group.body, options, true);
  }
});

defineFunction({
  type: "overline",
  names: ["\\overline"],
  props: {
    numArgs: 1
  },
  handler(_ref, args) {
    var {
      parser
    } = _ref;
    var body = args[0];
    return {
      type: "overline",
      mode: parser.mode,
      body
    };
  },
  htmlBuilder(group, options) {
    // Overlines are handled in the TeXbook pg 443, Rule 9.
    // Build the inner group in the cramped style.
    var innerGroup = buildGroup$1(group.body, options.havingCrampedStyle());
    // Create the line above the body
    var line = makeLineSpan("overline-line", options);
    // Generate the vlist, with the appropriate kerns
    var defaultRuleThickness = options.fontMetrics().defaultRuleThickness;
    var vlist = makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: innerGroup
      }, {
        type: "kern",
        size: 3 * defaultRuleThickness
      }, {
        type: "elem",
        elem: line
      }, {
        type: "kern",
        size: defaultRuleThickness
      }]
    });
    return makeSpan(["mord", "overline"], [vlist], options);
  },
  mathmlBuilder(group, options) {
    var operator = new MathNode("mo", [new TextNode("\u203e")]);
    operator.setAttribute("stretchy", "true");
    var node = new MathNode("mover", [buildGroup(group.body, options), operator]);
    node.setAttribute("accent", "true");
    return node;
  }
});

defineFunction({
  type: "phantom",
  names: ["\\phantom"],
  props: {
    numArgs: 1,
    allowedInText: true
  },
  handler: (_ref, args) => {
    var {
      parser
    } = _ref;
    var body = args[0];
    return {
      type: "phantom",
      mode: parser.mode,
      body: ordargument(body)
    };
  },
  htmlBuilder: (group, options) => {
    var elements = buildExpression$1(group.body, options.   withPhantom(), false);
    // \phantom isn't supposed to affect the elements it contains.
    // See "color" for more details.
    return makeFragment(elements);
  },
  mathmlBuilder: (group, options) => {
    var inner = buildExpression(group.body, options);
    return new MathNode("mphantom", inner);
  }
});
defineMacro("\\hphantom", "\\smash{\\phantom{#1}}");
defineFunction({
  type: "vphantom",
  names: ["\\vphantom"],
  props: {
    numArgs: 1,
    allowedInText: true
  },
  handler: (_ref2, args) => {
    var {
      parser
    } = _ref2;
    var body = args[0];
    return {
      type: "vphantom",
      mode: parser.mode,
      body
    };
  },
  htmlBuilder: (group, options) => {
    var inner = makeSpan(["inner"], [buildGroup$1(group.body, options.withPhantom())]);
    var fix = makeSpan(["fix"], []);
    return makeSpan(["mord", "rlap"], [inner, fix], options);
  },
  mathmlBuilder: (group, options) => {
    var inner = buildExpression(ordargument(group.body), options);
    var phantom = new MathNode("mphantom", inner);
    var node = new MathNode("mpadded", [phantom]);
    node.setAttribute("width", "0px");
    return node;
  }
});

// Box manipulation
defineFunction({
  type: "raisebox",
  names: ["\\raisebox"],
  props: {
    numArgs: 2,
    argTypes: ["size", "hbox"],
    allowedInText: true
  },
  handler(_ref, args) {
    var {
      parser
    } = _ref;
    var amount = assertNodeType(args[0], "size").value;
    var body = args[1];
    return {
      type: "raisebox",
      mode: parser.mode,
      dy: amount,
      body
    };
  },
  htmlBuilder(group, options) {
    var body = buildGroup$1(group.body, options);
    var dy = calculateSize(group.dy, options);
    return makeVList({
      positionType: "shift",
      positionData: -dy,
      children: [{
        type: "elem",
        elem: body
      }]
    });
  },
  mathmlBuilder(group, options) {
    var node = new MathNode("mpadded", [buildGroup(group.body, options)]);
    var dy = group.dy.number + group.dy.unit;
    node.setAttribute("voffset", dy);
    return node;
  }
});

defineFunction({
  type: "internal",
  names: ["\\relax"],
  props: {
    numArgs: 0,
    allowedInText: true,
    allowedInArgument: true
  },
  handler(_ref) {
    var {
      parser
    } = _ref;
    return {
      type: "internal",
      mode: parser.mode
    };
  }
});

defineFunction({
  type: "rule",
  names: ["\\rule"],
  props: {
    numArgs: 2,
    numOptionalArgs: 1,
    allowedInText: true,
    allowedInMath: true,
    argTypes: ["size", "size", "size"]
  },
  handler(_ref, args, optArgs) {
    var {
      parser
    } = _ref;
    var shift = optArgs[0];
    var width = assertNodeType(args[0], "size");
    var height = assertNodeType(args[1], "size");
    return {
      type: "rule",
      mode: parser.mode,
      shift: shift && assertNodeType(shift, "size").value,
      width: width.value,
      height: height.value
    };
  },
  htmlBuilder(group, options) {
    // Make an empty span for the rule
    var rule = makeSpan(["mord", "rule"], [], options);
    // Calculate the shift, width, and height of the rule, and account for units
    var width = calculateSize(group.width, options);
    var height = calculateSize(group.height, options);
    var shift = group.shift ? calculateSize(group.shift, options) : 0;
    // Style the rule to the right size
    rule.style.borderRightWidth = makeEm(width);
    rule.style.borderTopWidth = makeEm(height);
    rule.style.bottom = makeEm(shift);
    // Record the height and width
    rule.width = width;
    rule.height = height + shift;
    rule.depth = -shift;
    // Font size is the number large enough that the browser will
    // reserve at least `absHeight` space above the baseline.
    // The 1.125 factor was empirically determined
    rule.maxFontSize = height * 1.125 * options.sizeMultiplier;
    return rule;
  },
  mathmlBuilder(group, options) {
    var width = calculateSize(group.width, options);
    var height = calculateSize(group.height, options);
    var shift = group.shift ? calculateSize(group.shift, options) : 0;
    var color = options.color && options.getColor() || "black";
    var rule = new MathNode("mspace");
    rule.setAttribute("mathbackground", color);
    rule.setAttribute("width", makeEm(width));
    rule.setAttribute("height", makeEm(height));
    var wrapper = new MathNode("mpadded", [rule]);
    if (shift >= 0) {
      wrapper.setAttribute("height", makeEm(shift));
    } else {
      wrapper.setAttribute("height", makeEm(shift));
      wrapper.setAttribute("depth", makeEm(-shift));
    }
    wrapper.setAttribute("voffset", makeEm(shift));
    return wrapper;
  }
});

function sizingGroup(value, options, baseOptions) {
  var inner = buildExpression$1(value, options, false);
  var multiplier = options.sizeMultiplier / baseOptions.sizeMultiplier;
  // Add size-resetting classes to the inner list and set maxFontSize
  // manually. Handle nested size changes.
  for (var i = 0; i < inner.length; i++) {
    var pos = inner[i].classes.indexOf("sizing");
    if (pos < 0) {
      Array.prototype.push.apply(inner[i].classes, options.sizingClasses(baseOptions));
    } else if (inner[i].classes[pos + 1] === "reset-size" + options.size) {
      // This is a nested size change: e.g., inner[i] is the "b" in
      // `\Huge a \small b`. Override the old size (the `reset-` class)
      // but not the new size.
      inner[i].classes[pos + 1] = "reset-size" + baseOptions.size;
    }
    inner[i].height *= multiplier;
    inner[i].depth *= multiplier;
  }
  return makeFragment(inner);
}
var sizeFuncs = ["\\tiny", "\\sixptsize", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize", "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"];
var htmlBuilder = (group, options) => {
  // Handle sizing operators like \Huge. Real TeX doesn't actually allow
  // these functions inside of math expressions, so we do some special
  // handling.
  var newOptions = options.havingSize(group.size);
  return sizingGroup(group.body, newOptions, options);
};
defineFunction({
  type: "sizing",
  names: sizeFuncs,
  props: {
    numArgs: 0,
    allowedInText: true
  },
  handler: (_ref, args) => {
    var {
      breakOnTokenText,
      funcName,
      parser
    } = _ref;
    var body = parser.parseExpression(false, breakOnTokenText);
    return {
      type: "sizing",
      mode: parser.mode,
      // Figure out what size to use based on the list of functions above
      size: sizeFuncs.indexOf(funcName) + 1,
      body
    };
  },
  htmlBuilder,
  mathmlBuilder: (group, options) => {
    var newOptions = options.havingSize(group.size);
    var inner = buildExpression(group.body, newOptions);
    var node = new MathNode("mstyle", inner);
    // TODO(emily): This doesn't produce the correct size for nested size
    // changes, because we don't keep state of what style we're currently
    // in, so we can't reset the size to normal before changing it.  Now
    // that we're passing an options parameter we should be able to fix
    // this.
    node.setAttribute("mathsize", makeEm(newOptions.sizeMultiplier));
    return node;
  }
});

// smash, with optional [tb], as in AMS
defineFunction({
  type: "smash",
  names: ["\\smash"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1,
    allowedInText: true
  },
  handler: (_ref, args, optArgs) => {
    var {
      parser
    } = _ref;
    var smashHeight = false;
    var smashDepth = false;
    var tbArg = optArgs[0] && assertNodeType(optArgs[0], "ordgroup");
    if (tbArg) {
      // Optional [tb] argument is engaged.
      // ref: amsmath: \renewcommand{\smash}[1][tb]{%
      //               def\mb@t{\ht}\def\mb@b{\dp}\def\mb@tb{\ht\z@\z@\dp}%
      var letter;
      for (var i = 0; i < tbArg.body.length; ++i) {
        var node = tbArg.body[i];
        letter = assertSymbolNodeType(node).text;
        if (letter === "t") {
          smashHeight = true;
        } else if (letter === "b") {
          smashDepth = true;
        } else {
          smashHeight = false;
          smashDepth = false;
          break;
        }
      }
    } else {
      smashHeight = true;
      smashDepth = true;
    }
    var body = args[0];
    return {
      type: "smash",
      mode: parser.mode,
      body,
      smashHeight,
      smashDepth
    };
  },
  htmlBuilder: (group, options) => {
    var node = makeSpan([], [buildGroup$1(group.body, options)]);
    if (!group.smashHeight && !group.smashDepth) {
      return node;
    }
    if (group.smashHeight) {
      node.height = 0;
    }
    if (group.smashDepth) {
      node.depth = 0;
    }
    if (group.smashHeight && group.smashDepth) {
      // Symmetric \smash can stay in inline layout.
      return makeSpan(["mord", "smash"], [node], options);
    }
    // In order to influence makeVList for asymmetric smashing, we have to
    // reset the children.
    if (node.children) {
      for (var i = 0; i < node.children.length; i++) {
        if (group.smashHeight) {
          node.children[i].height = 0;
        }
        if (group.smashDepth) {
          node.children[i].depth = 0;
        }
      }
    }
    // At this point, we've reset the TeX-like height and depth values.
    // But the span still has an HTML line height.
    // makeVList applies "display: table-cell", which prevents the browser
    // from acting on that line height. So we'll call makeVList now.
    var smashedNode = makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: node
      }]
    });
    // For spacing, TeX treats \smash as a math group (same spacing as ord).
    return makeSpan(["mord"], [smashedNode], options);
  },
  mathmlBuilder: (group, options) => {
    var node = new MathNode("mpadded", [buildGroup(group.body, options)]);
    if (group.smashHeight) {
      node.setAttribute("height", "0px");
    }
    if (group.smashDepth) {
      node.setAttribute("depth", "0px");
    }
    return node;
  }
});

defineFunction({
  type: "sqrt",
  names: ["\\sqrt"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1
  },
  handler(_ref, args, optArgs) {
    var {
      parser
    } = _ref;
    var index = optArgs[0];
    var body = args[0];
    return {
      type: "sqrt",
      mode: parser.mode,
      body,
      index
    };
  },
  htmlBuilder(group, options) {
    // Square roots are handled in the TeXbook pg. 443, Rule 11.
    // First, we do the same steps as in overline to build the inner group
    // and line
    var inner = buildGroup$1(group.body, options.havingCrampedStyle());
    if (inner.height === 0) {
      // Render a small surd.
      inner.height = options.fontMetrics().xHeight;
    }
    // Some groups can return document fragments.  Handle those by wrapping
    // them in a span.
    inner = wrapFragment(inner, options);
    // Calculate the minimum size for the \surd delimiter
    var metrics = options.fontMetrics();
    var theta = metrics.defaultRuleThickness;
    var phi = theta;
    if (options.style.id < Style$1.TEXT.id) {
      phi = options.fontMetrics().xHeight;
    }
    // Calculate the clearance between the body and line
    var lineClearance = theta + phi / 4;
    var minDelimiterHeight = inner.height + inner.depth + lineClearance + theta;
    // Create a sqrt SVG of the required minimum size
    var {
      span: img,
      ruleWidth,
      advanceWidth
    } = makeSqrtImage(minDelimiterHeight, options);
    var delimDepth = img.height - ruleWidth;
    // Adjust the clearance based on the delimiter size
    if (delimDepth > inner.height + inner.depth + lineClearance) {
      lineClearance = (lineClearance + delimDepth - inner.height - inner.depth) / 2;
    }
    // Shift the sqrt image
    var imgShift = img.height - inner.height - lineClearance - ruleWidth;
    inner.style.paddingLeft = makeEm(advanceWidth);
    // Overlay the image and the argument.
    var body = makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: inner,
        wrapperClasses: ["svg-align"]
      }, {
        type: "kern",
        size: -(inner.height + imgShift)
      }, {
        type: "elem",
        elem: img
      }, {
        type: "kern",
        size: ruleWidth
      }]
    });
    if (!group.index) {
      return makeSpan(["mord", "sqrt"], [body], options);
    } else {
      // Handle the optional root index
      // The index is always in scriptscript style
      var newOptions = options.havingStyle(Style$1.SCRIPTSCRIPT);
      var rootm = buildGroup$1(group.index, newOptions, options);
      // The amount the index is shifted by. This is taken from the TeX
      // source, in the definition of `\r@@t`.
      var toShift = 0.6 * (body.height - body.depth);
      // Build a VList with the superscript shifted up correctly
      var rootVList = makeVList({
        positionType: "shift",
        positionData: -toShift,
        children: [{
          type: "elem",
          elem: rootm
        }]
      });
      // Add a class surrounding it so we can add on the appropriate
      // kerning
      var rootVListWrap = makeSpan(["root"], [rootVList]);
      return makeSpan(["mord", "sqrt"], [rootVListWrap, body], options);
    }
  },
  mathmlBuilder(group, options) {
    var {
      body,
      index
    } = group;
    return index ? new MathNode("mroot", [buildGroup(body, options), buildGroup(index, options)]) : new MathNode("msqrt", [buildGroup(body, options)]);
  }
});

var styleMap = {
  "display": Style$1.DISPLAY,
  "text": Style$1.TEXT,
  "script": Style$1.SCRIPT,
  "scriptscript": Style$1.SCRIPTSCRIPT
};
function isStyleStr(s) {
  return s in styleMap;
}
defineFunction({
  type: "styling",
  names: ["\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle"],
  props: {
    numArgs: 0,
    allowedInText: true,
    primitive: true
  },
  handler(_ref, args) {
    var {
      breakOnTokenText,
      funcName,
      parser
    } = _ref;
    // parse out the implicit body
    var body = parser.parseExpression(true, breakOnTokenText);
    // TODO: Refactor to avoid duplicating styleMap in multiple places (e.g.
    // here and in buildHTML and de-dupe the enumeration of all the styles).
    var style = funcName.slice(1, funcName.length - 5);
    if (!isStyleStr(style)) {
      throw new Error("Unknown style: " + style);
    }
    return {
      type: "styling",
      mode: parser.mode,
      // Figure out what style to use by pulling out the style from
      // the function name
      style,
      body
    };
  },
  htmlBuilder(group, options) {
    // Style changes are handled in the TeXbook on pg. 442, Rule 3.
    var newStyle = styleMap[group.style];
    var newOptions = options.havingStyle(newStyle);
    if (group.resetFont) {
      newOptions = newOptions.withFont('');
    }
    return sizingGroup(group.body, newOptions, options);
  },
  mathmlBuilder(group, options) {
    // Figure out what style we're changing to.
    var newStyle = styleMap[group.style];
    var newOptions = options.havingStyle(newStyle);
    if (group.resetFont) {
      newOptions = newOptions.withFont('');
    }
    var inner = buildExpression(group.body, newOptions);
    var node = new MathNode("mstyle", inner);
    var styleAttributes = {
      "display": ["0", "true"],
      "text": ["0", "false"],
      "script": ["1", "false"],
      "scriptscript": ["2", "false"]
    };
    var attr = styleAttributes[group.style];
    node.setAttribute("scriptlevel", attr[0]);
    node.setAttribute("displaystyle", attr[1]);
    return node;
  }
});

/**
 * Sometimes, groups perform special rules when they have superscripts or
 * subscripts attached to them. This function lets the `supsub` group know that
 * Sometimes, groups perform special rules when they have superscripts or
 * its inner element should handle the superscripts and subscripts instead of
 * handling them itself.
 */
var htmlBuilderDelegate = function htmlBuilderDelegate(group, options) {
  var base = group.base;
  if (!base) {
    return null;
  } else if (base.type === "op") {
    // Operators handle supsubs differently when they have limits
    // (e.g. `\displaystyle\sum_2^3`)
    var delegate = base.limits && (options.style.size === Style$1.DISPLAY.size || base.alwaysHandleSupSub);
    return delegate ? htmlBuilder$2 : null;
  } else if (base.type === "operatorname") {
    var _delegate = base.alwaysHandleSupSub && (options.style.size === Style$1.DISPLAY.size || base.limits);
    return _delegate ? htmlBuilder$1 : null;
  } else if (base.type === "accent") {
    return isCharacterBox(base.base) ? htmlBuilder$a : null;
  } else if (base.type === "horizBrace") {
    var isSup = !group.sub;
    return isSup === base.isOver ? htmlBuilder$3 : null;
  } else {
    return null;
  }
};
// Super scripts and subscripts, whose precise placement can depend on other
// functions that precede them.
defineFunctionBuilders({
  type: "supsub",
  htmlBuilder(group, options) {
    // Superscript and subscripts are handled in the TeXbook on page
    // 445-446, rules 18(a-f).
    // Here is where we defer to the inner group if it should handle
    // superscripts and subscripts itself.
    var builderDelegate = htmlBuilderDelegate(group, options);
    if (builderDelegate) {
      return builderDelegate(group, options);
    }
    var {
      base: valueBase,
      sup: valueSup,
      sub: valueSub
    } = group;
    var base = buildGroup$1(valueBase, options);
    var supm;
    var subm;
    var metrics = options.fontMetrics();
    // Rule 18a
    var supShift = 0;
    var subShift = 0;
    var isCharBox = valueBase && isCharacterBox(valueBase);
    if (valueSup) {
      var newOptions = options.havingStyle(options.style.sup());
      supm = buildGroup$1(valueSup, newOptions, options);
      if (!isCharBox) {
        supShift = base.height - newOptions.fontMetrics().supDrop * newOptions.sizeMultiplier / options.sizeMultiplier;
      }
    }
    if (valueSub) {
      var _newOptions = options.havingStyle(options.style.sub());
      subm = buildGroup$1(valueSub, _newOptions, options);
      if (!isCharBox) {
        subShift = base.depth + _newOptions.fontMetrics().subDrop * _newOptions.sizeMultiplier / options.sizeMultiplier;
      }
    }
    // Rule 18c
    var minSupShift;
    if (options.style === Style$1.DISPLAY) {
      minSupShift = metrics.sup1;
    } else if (options.style.cramped) {
      minSupShift = metrics.sup3;
    } else {
      minSupShift = metrics.sup2;
    }
    // scriptspace is a font-size-independent size, so scale it
    // appropriately for use as the marginRight.
    var multiplier = options.sizeMultiplier;
    var marginRight = makeEm(0.5 / metrics.ptPerEm / multiplier);
    var marginLeft = null;
    if (subm) {
      // Subscripts shouldn't be shifted by the base's italic correction.
      // Account for that by shifting the subscript back the appropriate
      // amount. Note we only do this when the base is a single symbol.
      var isOiint = group.base && group.base.type === "op" && group.base.name && (group.base.name === "\\oiint" || group.base.name === "\\oiiint");
      if (base instanceof SymbolNode || isOiint) {
        var _base$italic;
        // SymbolNode has .italic natively; for \oiint/\oiiint the
        // op builder stores .italic on the wrapping Span.
        marginLeft = makeEm(-((_base$italic = base.italic) != null ? _base$italic : 0));
      }
    }
    var supsub;
    if (supm && subm) {
      supShift = Math.max(supShift, minSupShift, supm.depth + 0.25 * metrics.xHeight);
      subShift = Math.max(subShift, metrics.sub2);
      var ruleWidth = metrics.defaultRuleThickness;
      // Rule 18e
      var maxWidth = 4 * ruleWidth;
      if (supShift - supm.depth - (subm.height - subShift) < maxWidth) {
        subShift = maxWidth - (supShift - supm.depth) + subm.height;
        var psi = 0.8 * metrics.xHeight - (supShift - supm.depth);
        if (psi > 0) {
          supShift += psi;
          subShift -= psi;
        }
      }
      var vlistElem = [{
        type: "elem",
        elem: subm,
        shift: subShift,
        marginRight,
        marginLeft
      }, {
        type: "elem",
        elem: supm,
        shift: -supShift,
        marginRight
      }];
      supsub = makeVList({
        positionType: "individualShift",
        children: vlistElem
      });
    } else if (subm) {
      // Rule 18b
      subShift = Math.max(subShift, metrics.sub1, subm.height - 0.8 * metrics.xHeight);
      var _vlistElem = [{
        type: "elem",
        elem: subm,
        marginLeft,
        marginRight
      }];
      supsub = makeVList({
        positionType: "shift",
        positionData: subShift,
        children: _vlistElem
      });
    } else if (supm) {
      // Rule 18c, d
      supShift = Math.max(supShift, minSupShift, supm.depth + 0.25 * metrics.xHeight);
      supsub = makeVList({
        positionType: "shift",
        positionData: -supShift,
        children: [{
          type: "elem",
          elem: supm,
          marginRight
        }]
      });
    } else {
      throw new Error("supsub must have either sup or sub.");
    }
    // Wrap the supsub vlist in a span.msupsub to reset text-align.
    var mclass = getTypeOfDomTree(base, "right") || "mord";
    return makeSpan([mclass], [base, makeSpan(["msupsub"], [supsub])], options);
  },
  mathmlBuilder(group, options) {
    // Is the inner group a relevant horizontal brace?
    var isBrace = false;
    var isOver;
    var isSup;
    if (group.base && group.base.type === "horizBrace") {
      isSup = !!group.sup;
      if (isSup === group.base.isOver) {
        isBrace = true;
        isOver = group.base.isOver;
      }
    }
    if (group.base && (group.base.type === "op" || group.base.type === "operatorname")) {
      group.base.parentIsSupSub = true;
    }
    var children = [buildGroup(group.base, options)];
    if (group.sub) {
      children.push(buildGroup(group.sub, options));
    }
    if (group.sup) {
      children.push(buildGroup(group.sup, options));
    }
    var nodeType;
    if (isBrace) {
      nodeType = isOver ? "mover" : "munder";
    } else if (!group.sub) {
      var base = group.base;
      if (base && base.type === "op" && base.limits && (options.style === Style$1.DISPLAY || base.alwaysHandleSupSub)) {
        nodeType = "mover";
      } else if (base && base.type === "operatorname" && base.alwaysHandleSupSub && (base.limits || options.style === Style$1.DISPLAY)) {
        nodeType = "mover";
      } else {
        nodeType = "msup";
      }
    } else if (!group.sup) {
      var _base = group.base;
      if (_base && _base.type === "op" && _base.limits && (options.style === Style$1.DISPLAY || _base.alwaysHandleSupSub)) {
        nodeType = "munder";
      } else if (_base && _base.type === "operatorname" && _base.alwaysHandleSupSub && (_base.limits || options.style === Style$1.DISPLAY)) {
        nodeType = "munder";
      } else {
        nodeType = "msub";
      }
    } else {
      var _base2 = group.base;
      if (_base2 && _base2.type === "op" && _base2.limits && options.style === Style$1.DISPLAY) {
        nodeType = "munderover";
      } else if (_base2 && _base2.type === "operatorname" && _base2.alwaysHandleSupSub && (options.style === Style$1.DISPLAY || _base2.limits)) {
        nodeType = "munderover";
      } else {
        nodeType = "msubsup";
      }
    }
    return new MathNode(nodeType, children);
  }
});

// Operator ParseNodes created in Parser.js from symbol Groups in src/symbols.js.
defineFunctionBuilders({
  type: "atom",
  htmlBuilder(group, options) {
    return mathsym(group.text, group.mode, options, ["m" + group.family]);
  },
  mathmlBuilder(group, options) {
    var node = new MathNode("mo", [makeText(group.text, group.mode)]);
    if (group.family === "bin") {
      var variant = getVariant(group, options);
      if (variant === "bold-italic") {
        node.setAttribute("mathvariant", variant);
      }
    } else if (group.family === "punct") {
      node.setAttribute("separator", "true");
    } else if (group.family === "open" || group.family === "close") {
      // Delims built here should not stretch vertically.
      // See delimsizing.js for stretchy delims.
      node.setAttribute("stretchy", "false");
    }
    return node;
  }
});

// "mathord" and "textord" ParseNodes created in Parser.js from symbol Groups in
// src/symbols.js.
var defaultVariant = {
  "mi": "italic",
  "mn": "normal",
  "mtext": "normal"
};
defineFunctionBuilders({
  type: "mathord",
  htmlBuilder(group, options) {
    return makeOrd(group, options, "mathord");
  },
  mathmlBuilder(group, options) {
    var node = new MathNode("mi", [makeText(group.text, group.mode, options)]);
    var variant = getVariant(group, options) || "italic";
    if (variant !== defaultVariant[node.type]) {
      node.setAttribute("mathvariant", variant);
    }
    return node;
  }
});
defineFunctionBuilders({
  type: "textord",
  htmlBuilder(group, options) {
    return makeOrd(group, options, "textord");
  },
  mathmlBuilder(group, options) {
    var text = makeText(group.text, group.mode, options);
    var variant = getVariant(group, options) || "normal";
    var node;
    if (group.mode === 'text') {
      node = new MathNode("mtext", [text]);
    } else if (/[0-9]/.test(group.text)) {
      node = new MathNode("mn", [text]);
    } else if (group.text === "\\prime") {
      node = new MathNode("mo", [text]);
    } else {
      node = new MathNode("mi", [text]);
    }
    if (variant !== defaultVariant[node.type]) {
      node.setAttribute("mathvariant", variant);
    }
    return node;
  }
});

// A map of CSS-based spacing functions to their CSS class.
var cssSpace = {
  "\\nobreak": "nobreak",
  "\\allowbreak": "allowbreak"
};
// A lookup table to determine whether a spacing function/symbol should be
// treated like a regular space character.  If a symbol or command is a key
// in this table, then it should be a regular space character.  Furthermore,
// the associated value may have a `className` specifying an extra CSS class
// to add to the created `span`.
var regularSpace = {
  " ": {},
  "\\ ": {},
  "~": {
    className: "nobreak"
  },
  "\\space": {},
  "\\nobreakspace": {
    className: "nobreak"
  }
};
// ParseNode<"spacing"> created in Parser.js from the "spacing" symbol Groups in
// src/symbols.js.
defineFunctionBuilders({
  type: "spacing",
  htmlBuilder(group, options) {
    if (regularSpace.hasOwnProperty(group.text)) {
      var className = regularSpace[group.text].className || "";
      // Spaces are generated by adding an actual space. Each of these
      // things has an entry in the symbols table, so these will be turned
      // into appropriate outputs.
      if (group.mode === "text") {
        var ord = makeOrd(group, options, "textord");
        ord.classes.push(className);
        return ord;
      } else {
        return makeSpan(["mspace", className], [mathsym(group.text, group.mode, options)], options);
      }
    } else if (cssSpace.hasOwnProperty(group.text)) {
      // Spaces based on just a CSS class.
      return makeSpan(["mspace", cssSpace[group.text]], [], options);
    } else {
      throw new ParseError("Unknown type of space \"" + group.text + "\"");
    }
  },
  mathmlBuilder(group, options) {
    var node;
    if (regularSpace.hasOwnProperty(group.text)) {
      node = new MathNode("mtext", [new TextNode("\u00a0")]);
    } else if (cssSpace.hasOwnProperty(group.text)) {
      // CSS-based MathML spaces (\nobreak, \allowbreak) are ignored
      return new MathNode("mspace");
    } else {
      throw new ParseError("Unknown type of space \"" + group.text + "\"");
    }
    return node;
  }
});

var pad = () => {
  var padNode = new MathNode("mtd", []);
  padNode.setAttribute("width", "50%");
  return padNode;
};
defineFunctionBuilders({
  type: "tag",
  mathmlBuilder(group, options) {
    var table = new MathNode("mtable", [new MathNode("mtr", [pad(), new MathNode("mtd", [buildExpressionRow(group.body, options)]), pad(), new MathNode("mtd", [buildExpressionRow(group.tag, options)])])]);
    table.setAttribute("width", "100%");
    return table;
    // TODO: Left-aligned tags.
    // Currently, the group and options passed here do not contain
    // enough info to set tag alignment. `leqno` is in Settings but it is
    // not passed to Options. On the HTML side, leqno is
    // set by a CSS class applied in buildTree.js. That would have worked
    // in MathML if browsers supported <mlabeledtr>. Since they don't, we
    // need to rewrite the way this function is called.
  }
});

// Non-mathy text, possibly in a font
var textFontFamilies = {
  "\\text": undefined,
  "\\textrm": "textrm",
  "\\textsf": "textsf",
  "\\texttt": "texttt",
  "\\textnormal": "textrm"
};
var textFontWeights = {
  "\\textbf": "textbf",
  "\\textmd": "textmd"
};
var textFontShapes = {
  "\\textit": "textit",
  "\\textup": "textup"
};
var optionsWithFont = (group, options) => {
  var font = group.font;
  // Checks if the argument is a font family or a font style.
  if (!font) {
    return options;
  } else if (textFontFamilies[font]) {
    return options.withTextFontFamily(textFontFamilies[font]);
  } else if (textFontWeights[font]) {
    return options.withTextFontWeight(textFontWeights[font]);
  } else if (font === "\\emph") {
    return options.fontShape === "textit" ? options.withTextFontShape("textup") : options.withTextFontShape("textit");
  }
  return options.withTextFontShape(textFontShapes[font]);
};
defineFunction({
  type: "text",
  names: [
  // Font families
  "\\text", "\\textrm", "\\textsf", "\\texttt", "\\textnormal",
  // Font weights
  "\\textbf", "\\textmd",
  // Font Shapes
  "\\textit", "\\textup", "\\emph"],
  props: {
    numArgs: 1,
    argTypes: ["text"],
    allowedInArgument: true,
    allowedInText: true
  },
  handler(_ref, args) {
    var {
      parser,
      funcName
    } = _ref;
    var body = args[0];
    return {
      type: "text",
      mode: parser.mode,
      body: ordargument(body),
      font: funcName
    };
  },
  htmlBuilder(group, options) {
    var newOptions = optionsWithFont(group, options);
    var inner = buildExpression$1(group.body, newOptions, true);
    return makeSpan(["mord", "text"], inner, newOptions);
  },
  mathmlBuilder(group, options) {
    var newOptions = optionsWithFont(group, options);
    return buildExpressionRow(group.body, newOptions);
  }
});

defineFunction({
  type: "underline",
  names: ["\\underline"],
  props: {
    numArgs: 1,
    allowedInText: true
  },
  handler(_ref, args) {
    var {
      parser
    } = _ref;
    return {
      type: "underline",
      mode: parser.mode,
      body: args[0]
    };
  },
  htmlBuilder(group, options) {
    // Underlines are handled in the TeXbook pg 443, Rule 10.
    // Build the inner group.
    var innerGroup = buildGroup$1(group.body, options);
    // Create the line to go below the body
    var line = makeLineSpan("underline-line", options);
    // Generate the vlist, with the appropriate kerns
    var defaultRuleThickness = options.fontMetrics().defaultRuleThickness;
    var vlist = makeVList({
      positionType: "top",
      positionData: innerGroup.height,
      children: [{
        type: "kern",
        size: defaultRuleThickness
      }, {
        type: "elem",
        elem: line
      }, {
        type: "kern",
        size: 3 * defaultRuleThickness
      }, {
        type: "elem",
        elem: innerGroup
      }]
    });
    return makeSpan(["mord", "underline"], [vlist], options);
  },
  mathmlBuilder(group, options) {
    var operator = new MathNode("mo", [new TextNode("\u203e")]);
    operator.setAttribute("stretchy", "true");
    var node = new MathNode("munder", [buildGroup(group.body, options), operator]);
    node.setAttribute("accentunder", "true");
    return node;
  }
});

// \vcenter:  Vertically center the argument group on the math axis.
defineFunction({
  type: "vcenter",
  names: ["\\vcenter"],
  props: {
    numArgs: 1,
    argTypes: ["original"],
    // In LaTeX, \vcenter can act only on a box.
    allowedInText: false
  },
  handler(_ref, args) {
    var {
      parser
    } = _ref;
    return {
      type: "vcenter",
      mode: parser.mode,
      body: args[0]
    };
  },
  htmlBuilder(group, options) {
    var body = buildGroup$1(group.body, options);
    var axisHeight = options.fontMetrics().axisHeight;
    var dy = 0.5 * (body.height - axisHeight - (body.depth + axisHeight));
    return makeVList({
      positionType: "shift",
      positionData: dy,
      children: [{
        type: "elem",
        elem: body
      }]
    });
  },
  mathmlBuilder(group, options) {
    // There is no way to do this in MathML.
    // Write a class as a breadcrumb in case some post-processor wants
    // to perform a vcenter adjustment.
    // Wrap in mrow to ensure valid MathML when placed inside mo (e.g., \mathrel)
    var mpadded = new MathNode("mpadded", [buildGroup(group.body, options)], ["vcenter"]);
    return new MathNode("mrow", [mpadded]);
  }
});

defineFunction({
  type: "verb",
  names: ["\\verb"],
  props: {
    numArgs: 0,
    allowedInText: true
  },
  handler(context, args, optArgs) {
    // \verb and \verb* are dealt with directly in Parser.js.
    // If we end up here, it's because of a failure to match the two delimiters
    // in the regex in Lexer.js.  LaTeX raises the following error when \verb is
    // terminated by end of line (or file).
    throw new ParseError("\\verb ended by end of line instead of matching delimiter");
  },
  htmlBuilder(group, options) {
    var text = makeVerb(group);
    var body = [];
    // \verb enters text mode and therefore is sized like \textstyle
    var newOptions = options.havingStyle(options.style.text());
    for (var i = 0; i < text.length; i++) {
      var c = text[i];
      if (c === '~') {
        c = '\\textasciitilde';
      }
      body.push(makeSymbol(c, "Typewriter-Regular", group.mode, newOptions, ["mord", "texttt"]));
    }
    return makeSpan(["mord", "text"].concat(newOptions.sizingClasses(options)), tryCombineChars(body), newOptions);
  },
  mathmlBuilder(group, options) {
    var text = new TextNode(makeVerb(group));
    var node = new MathNode("mtext", [text]);
    node.setAttribute("mathvariant", "monospace");
    return node;
  }
});
/**
 * Converts verb group into body string.
 *
 * \verb* replaces each space with an open box \u2423
 * \verb replaces each space with a no-break space \xA0
 */
var makeVerb = group => group.body.replace(/ /g, group.star ? '\u2423' : '\xA0');

/** Include this to ensure that all functions are defined. */
var functions = _functions;

/**
 * The Lexer class handles tokenizing the input in various ways. Since our
 * parser expects us to be able to backtrack, the lexer allows lexing from any
 * given starting point.
 *
 * Its main exposed function is the `lex` function, which takes a position to
 * lex from and a type of token to lex. It defers to the appropriate `_innerLex`
 * function.
 *
 * The various `_innerLex` functions perform the actual lexing of different
 * kinds.
 */
/* The following tokenRegex
 * - matches typical whitespace (but not NBSP etc.) using its first group
 * - does not match any control character \x00-\x1f except whitespace
 * - does not match a bare backslash
 * - matches any ASCII character except those just mentioned
 * - does not match the BMP private use area \uE000-\uF8FF
 * - does not match bare surrogate code units
 * - matches any BMP character except for those just described
 * - matches any valid Unicode surrogate pair
 * - matches a backslash followed by one or more whitespace characters
 * - matches a backslash followed by one or more letters then whitespace
 * - matches a backslash followed by any BMP character
 * Capturing groups:
 *   [1] regular whitespace
 *   [2] backslash followed by whitespace
 *   [3] anything else, which may include:
 *     [4] left character of \verb*
 *     [5] left character of \verb
 *     [6] backslash followed by word, excluding any trailing whitespace
 * Just because the Lexer matches something doesn't mean it's valid input:
 * If there is no matching function or symbol definition, the Parser will
 * still reject the input.
 */
var spaceRegexString = "[ \r\n\t]";
var controlWordRegexString = "\\\\[a-zA-Z@]+";
var controlSymbolRegexString = "\\\\[^\uD800-\uDFFF]";
var controlWordWhitespaceRegexString = "(" + controlWordRegexString + ")" + spaceRegexString + "*";
var controlSpaceRegexString = "\\\\(\n|[ \r\t]+\n?)[ \r\t]*";
var combiningDiacriticalMarkString = "[\u0300-\u036f]";
var combiningDiacriticalMarksEndRegex = new RegExp(combiningDiacriticalMarkString + "+$");
var tokenRegexString = "(" + spaceRegexString + "+)|" + (// whitespace
controlSpaceRegexString + "|") +
// \whitespace
"([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]" + (// single codepoint
combiningDiacriticalMarkString + "*") +
// ...plus accents
"|[\uD800-\uDBFF][\uDC00-\uDFFF]" + (// surrogate pair
combiningDiacriticalMarkString + "*") +
// ...plus accents
"|\\\\verb\\*([^]).*?\\4" +
// \verb*
"|\\\\verb([^*a-zA-Z]).*?\\5" + (// \verb unstarred
"|" + controlWordWhitespaceRegexString) + (// \macroName + spaces
"|" + controlSymbolRegexString + ")"); // \\, \', etc.
/** Main Lexer class */
class Lexer {
  constructor(input, settings) {
    this.input = void 0;
    this.settings = void 0;
    this.tokenRegex = void 0;
    // Category codes. The lexer only supports comment characters (14) for now.
    // MacroExpander additionally distinguishes active (13).
    this.catcodes = void 0;
    // Separate accents from characters
    this.input = input;
    this.settings = settings;
    this.tokenRegex = new RegExp(tokenRegexString, 'g');
    this.catcodes = {
      "%": 14,
      // comment character
      "~": 13 // active character
    };
  }
  setCatcode(char, code) {
    this.catcodes[char] = code;
  }
  /**
   * This function lexes a single token.
   */
  lex() {
    var input = this.input;
    var pos = this.tokenRegex.lastIndex;
    if (pos === input.length) {
      return new Token("EOF", new SourceLocation(this, pos, pos));
    }
    var match = this.tokenRegex.exec(input);
    if (match === null || match.index !== pos) {
      throw new ParseError("Unexpected character: '" + input[pos] + "'", new Token(input[pos], new SourceLocation(this, pos, pos + 1)));
    }
    var text = match[6] || match[3] || (match[2] ? "\\ " : " ");
    if (this.catcodes[text] === 14) {
      // comment character
      var nlIndex = input.indexOf('\n', this.tokenRegex.lastIndex);
      if (nlIndex === -1) {
        this.tokenRegex.lastIndex = input.length; // EOF
        this.settings.reportNonstrict("commentAtEnd", "% comment has no terminating newline; LaTeX would " + "fail because of commenting the end of math mode (e.g. $)");
      } else {
        this.tokenRegex.lastIndex = nlIndex + 1;
      }
      return this.lex();
    }
    return new Token(text, new SourceLocation(this, pos, this.tokenRegex.lastIndex));
  }
}

/**
 * A `Namespace` refers to a space of nameable things like macros or lengths,
 * which can be `set` either globally or local to a nested group, using an
 * undo stack similar to how TeX implements this functionality.
 * Performance-wise, `get` and local `set` take constant time, while global
 * `set` takes time proportional to the depth of group nesting.
 */
class Namespace {
  /**
   * Both arguments are optional.  The first argument is an object of
   * built-in mappings which never change.  The second argument is an object
   * of initial (global-level) mappings, which will constantly change
   * according to any global/top-level `set`s done.
   */
  constructor(builtins, globalMacros) {
    if (builtins === void 0) {
      builtins = {};
    }
    if (globalMacros === void 0) {
      globalMacros = {};
    }
    this.current = void 0;
    this.builtins = void 0;
    this.undefStack = void 0;
    this.current = globalMacros;
    this.builtins = builtins;
    this.undefStack = [];
  }
  /**
   * Start a new nested group, affecting future local `set`s.
   */
  beginGroup() {
    this.undefStack.push({});
  }
  /**
   * End current nested group, restoring values before the group began.
   */
  endGroup() {
    if (this.undefStack.length === 0) {
      throw new ParseError("Unbalanced namespace destruction: attempt " + "to pop global namespace; please report this as a bug");
    }
    var undefs = this.undefStack.pop();
    for (var undef in undefs) {
      if (undefs.hasOwnProperty(undef)) {
        if (undefs[undef] == null) {
          delete this.current[undef];
        } else {
          this.current[undef] = undefs[undef];
        }
      }
    }
  }
  /**
   * Ends all currently nested groups (if any), restoring values before the
   * groups began.  Useful in case of an error in the middle of parsing.
   */
  endGroups() {
    while (this.undefStack.length > 0) {
      this.endGroup();
    }
  }
  /**
   * Detect whether `name` has a definition.  Equivalent to
   * `get(name) != null`.
   */
  has(name) {
    return this.current.hasOwnProperty(name) || this.builtins.hasOwnProperty(name);
  }
  /**
   * Get the current value of a name, or `undefined` if there is no value.
   *
   * Note: Do not use `if (namespace.get(...))` to detect whether a macro
   * is defined, as the definition may be the empty string which evaluates
   * to `false` in JavaScript.  Use `if (namespace.get(...) != null)` or
   * `if (namespace.has(...))`.
   */
  get(name) {
    if (this.current.hasOwnProperty(name)) {
      return this.current[name];
    } else {
      return this.builtins[name];
    }
  }
  /**
   * Set the current value of a name, and optionally set it globally too.
   * Local set() sets the current value and (when appropriate) adds an undo
   * operation to the undo stack.  Global set() may change the undo
   * operation at every level, so takes time linear in their number.
   * A value of undefined means to delete existing definitions.
   */
  set(name, value, global) {
    if (global === void 0) {
      global = false;
    }
    if (global) {
      // Global set is equivalent to setting in all groups.  Simulate this
      // by destroying any undos currently scheduled for this name,
      // and adding an undo with the *new* value (in case it later gets
      // locally reset within this environment).
      for (var i = 0; i < this.undefStack.length; i++) {
        delete this.undefStack[i][name];
      }
      if (this.undefStack.length > 0) {
        this.undefStack[this.undefStack.length - 1][name] = value;
      }
    } else {
      // Undo this set at end of this group (possibly to `undefined`),
      // unless an undo is already in place, in which case that older
      // value is the correct one.
      var top = this.undefStack[this.undefStack.length - 1];
      if (top && !top.hasOwnProperty(name)) {
        top[name] = this.current[name];
      }
    }
    if (value == null) {
      delete this.current[name];
    } else {
      this.current[name] = value;
    }
  }
}

/**
 * Predefined macros for KaTeX.
 * This can be used to define some commands in terms of others.
 */
var macros = _macros;
//////////////////////////////////////////////////////////////////////
// macro tools
defineMacro("\\noexpand", function (context) {
  // The expansion is the token itself; but that token is interpreted
  // as if its meaning were ‘\relax’ if it is a control sequence that
  // would ordinarily be expanded by TeX’s expansion rules.
  var t = context.popToken();
  if (context.isExpandable(t.text)) {
    t.noexpand = true;
    t.treatAsRelax = true;
  }
  return {
    tokens: [t],
    numArgs: 0
  };
});
defineMacro("\\expandafter", function (context) {
  // TeX first reads the token that comes immediately after \expandafter,
  // without expanding it; let’s call this token t. Then TeX reads the
  // token that comes after t (and possibly more tokens, if that token
  // has an argument), replacing it by its expansion. Finally TeX puts
  // t back in front of that expansion.
  var t = context.popToken();
  context.expandOnce(true); // expand only an expandable token
  return {
    tokens: [t],
    numArgs: 0
  };
});
// LaTeX's \@firstoftwo{#1}{#2} expands to #1, skipping #2
// TeX source: \long\def\@firstoftwo#1#2{#1}
defineMacro("\\@firstoftwo", function (context) {
  var args = context.consumeArgs(2);
  return {
    tokens: args[0],
    numArgs: 0
  };
});
// LaTeX's \@secondoftwo{#1}{#2} expands to #2, skipping #1
// TeX source: \long\def\@secondoftwo#1#2{#2}
defineMacro("\\@secondoftwo", function (context) {
  var args = context.consumeArgs(2);
  return {
    tokens: args[1],
    numArgs: 0
  };
});
// LaTeX's \@ifnextchar{#1}{#2}{#3} looks ahead to the next (unexpanded)
// symbol that isn't a space, consuming any spaces but not consuming the
// first nonspace character.  If that nonspace character matches #1, then
// the macro expands to #2; otherwise, it expands to #3.
defineMacro("\\@ifnextchar", function (context) {
  var args = context.consumeArgs(3); // symbol, if, else
  context.consumeSpaces();
  var nextToken = context.future();
  if (args[0].length === 1 && args[0][0].text === nextToken.text) {
    return {
      tokens: args[1],
      numArgs: 0
    };
  } else {
    return {
      tokens: args[2],
      numArgs: 0
    };
  }
});
// LaTeX's \@ifstar{#1}{#2} looks ahead to the next (unexpanded) symbol.
// If it is `*`, then it consumes the symbol, and the macro expands to #1;
// otherwise, the macro expands to #2 (without consuming the symbol).
// TeX source: \def\@ifstar#1{\@ifnextchar *{\@firstoftwo{#1}}}
defineMacro("\\@ifstar", "\\@ifnextchar *{\\@firstoftwo{#1}}");
// LaTeX's \TextOrMath{#1}{#2} expands to #1 in text mode, #2 in math mode
defineMacro("\\TextOrMath", function (context) {
  var args = context.consumeArgs(2);
  if (context.mode === 'text') {
    return {
      tokens: args[0],
      numArgs: 0
    };
  } else {
    return {
      tokens: args[1],
      numArgs: 0
    };
  }
});
// Lookup table for parsing numbers in base 8 through 16
var digitToNumber = {
  "0": 0,
  "1": 1,
  "2": 2,
  "3": 3,
  "4": 4,
  "5": 5,
  "6": 6,
  "7": 7,
  "8": 8,
  "9": 9,
  "a": 10,
  "A": 10,
  "b": 11,
  "B": 11,
  "c": 12,
  "C": 12,
  "d": 13,
  "D": 13,
  "e": 14,
  "E": 14,
  "f": 15,
  "F": 15
};
// TeX \char makes a literal character (catcode 12) using the following forms:
// (see The TeXBook, p. 43)
//   \char123  -- decimal
//   \char'123 -- octal
//   \char"123 -- hex
//   \char`x   -- character that can be written (i.e. isn't active)
//   \char`\x  -- character that cannot be written (e.g. %)
// These all refer to characters from the font, so we turn them into special
// calls to a function \@char dealt with in the Parser.
defineMacro("\\char", function (context) {
  var token = context.popToken();
  var base;
  var number = 0;
  if (token.text === "'") {
    base = 8;
    token = context.popToken();
  } else if (token.text === '"') {
    base = 16;
    token = context.popToken();
  } else if (token.text === "`") {
    token = context.popToken();
    if (token.text[0] === "\\") {
      number = token.text.charCodeAt(1);
    } else if (token.text === "EOF") {
      throw new ParseError("\\char` missing argument");
    } else {
      number = token.text.charCodeAt(0);
    }
  } else {
    base = 10;
  }
  if (base) {
    // Parse a number in the given base, starting with first `token`.
    number = digitToNumber[token.text];
    if (number == null || number >= base) {
      throw new ParseError("Invalid base-" + base + " digit " + token.text);
    }
    var digit;
    while ((digit = digitToNumber[context.future().text]) != null && digit < base) {
      number *= base;
      number += digit;
      context.popToken();
    }
  }
  return "\\@char{" + number + "}";
});
// \newcommand{\macro}[args]{definition}
// \renewcommand{\macro}[args]{definition}
// TODO: Optional arguments: \newcommand{\macro}[args][default]{definition}
var newcommand = (context, existsOK, nonexistsOK, skipIfExists) => {
  var arg = context.consumeArg().tokens;
  if (arg.length !== 1) {
    throw new ParseError("\\newcommand's first argument must be a macro name");
  }
  var name = arg[0].text;
  var exists = context.isDefined(name);
  if (exists && !existsOK) {
    throw new ParseError("\\newcommand{" + name + "} attempting to redefine " + (name + "; use \\renewcommand"));
  }
  if (!exists && !nonexistsOK) {
    throw new ParseError("\\renewcommand{" + name + "} when command " + name + " " + "does not yet exist; use \\newcommand");
  }
  var numArgs = 0;
  arg = context.consumeArg().tokens;
  if (arg.length === 1 && arg[0].text === "[") {
    var argText = '';
    var token = context.expandNextToken();
    while (token.text !== "]" && token.text !== "EOF") {
      // TODO: Should properly expand arg, e.g., ignore {}s
      argText += token.text;
      token = context.expandNextToken();
    }
    if (!argText.match(/^\s*[0-9]+\s*$/)) {
      throw new ParseError("Invalid number of arguments: " + argText);
    }
    numArgs = parseInt(argText);
    arg = context.consumeArg().tokens;
  }
  if (!(exists && skipIfExists)) {
    // Final arg is the expansion of the macro
    context.macros.set(name, {
      tokens: arg,
      numArgs
    });
  }
  return '';
};
defineMacro("\\newcommand", context => newcommand(context, false, true, false));
defineMacro("\\renewcommand", context => newcommand(context, true, false, false));
defineMacro("\\providecommand", context => newcommand(context, true, true, true));
// terminal (console) tools
defineMacro("\\message", context => {
  var arg = context.consumeArgs(1)[0];
  // eslint-disable-next-line no-console
  console.log(arg.reverse().map(token => token.text).join(""));
  return '';
});
defineMacro("\\errmessage", context => {
  var arg = context.consumeArgs(1)[0];
  // eslint-disable-next-line no-console
  console.error(arg.reverse().map(token => token.text).join(""));
  return '';
});
defineMacro("\\show", context => {
  var tok = context.popToken();
  var name = tok.text;
  // eslint-disable-next-line no-console
  console.log(tok, context.macros.get(name), functions[name], symbols.math[name], symbols.text[name]);
  return '';
});
//////////////////////////////////////////////////////////////////////
// Grouping
// \let\bgroup={ \let\egroup=}
defineMacro("\\bgroup", "{");
defineMacro("\\egroup", "}");
// Symbols from latex.ltx:
// \def~{\nobreakspace{}}
// \def\lq{`}
// \def\rq{'}
// \def \aa {\r a}
// \def \AA {\r A}
defineMacro("~", "\\nobreakspace");
defineMacro("\\lq", "`");
defineMacro("\\rq", "'");
defineMacro("\\aa", "\\r a");
defineMacro("\\AA", "\\r A");
// Copyright (C) and registered (R) symbols. Use raw symbol in MathML.
// \DeclareTextCommandDefault{\textcopyright}{\textcircled{c}}
// \DeclareTextCommandDefault{\textregistered}{\textcircled{%
//      \check@mathfonts\fontsize\sf@size\z@\math@fontsfalse\selectfont R}}
// \DeclareRobustCommand{\copyright}{%
//    \ifmmode{\nfss@text{\textcopyright}}\else\textcopyright\fi}
defineMacro("\\textcopyright", "\\html@mathml{\\textcircled{c}}{\\char`©}");
defineMacro("\\copyright", "\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");
defineMacro("\\textregistered", "\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");
// Characters omitted from Unicode range 1D400–1D7FF
defineMacro("\u212C", "\\mathscr{B}"); // script
defineMacro("\u2130", "\\mathscr{E}");
defineMacro("\u2131", "\\mathscr{F}");
defineMacro("\u210B", "\\mathscr{H}");
defineMacro("\u2110", "\\mathscr{I}");
defineMacro("\u2112", "\\mathscr{L}");
defineMacro("\u2133", "\\mathscr{M}");
defineMacro("\u211B", "\\mathscr{R}");
defineMacro("\u212D", "\\mathfrak{C}"); // Fraktur
defineMacro("\u210C", "\\mathfrak{H}");
defineMacro("\u2128", "\\mathfrak{Z}");
// Define \Bbbk with a macro that works in both HTML and MathML.
defineMacro("\\Bbbk", "\\Bbb{k}");
// \llap and \rlap render their contents in text mode
defineMacro("\\llap", "\\mathllap{\\textrm{#1}}");
defineMacro("\\rlap", "\\mathrlap{\\textrm{#1}}");
defineMacro("\\clap", "\\mathclap{\\textrm{#1}}");
// \mathstrut from the TeXbook, p 360
defineMacro("\\mathstrut", "\\vphantom{(}");
// \underbar from TeXbook p 353
defineMacro("\\underbar", "\\underline{\\text{#1}}");
// \not is defined by base/fontmath.ltx via
// \DeclareMathSymbol{\not}{\mathrel}{symbols}{"36}
// It's thus treated like a \mathrel, but defined by a symbol that has zero
// width but extends to the right.  We use \rlap to get that spacing.
// For MathML we write U+0338 here. buildMathML.js will then do the overlay.
defineMacro("\\not", "\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}" + "{\\char\"338}");
// Negated symbols from base/fontmath.ltx:
// \def\neq{\not=} \let\ne=\neq
// \DeclareRobustCommand
//   \notin{\mathrel{\m@th\mathpalette\c@ncel\in}}
// \def\c@ncel#1#2{\m@th\ooalign{$\hfil#1\mkern1mu/\hfil$\crcr$#1#2$}}
defineMacro("\\neq", "\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");
defineMacro("\\ne", "\\neq");
defineMacro("\u2260", "\\neq");
defineMacro("\\notin", "\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}" + "{\\mathrel{\\char`∉}}");
defineMacro("\u2209", "\\notin");
// Unicode stacked relations
defineMacro("\u2258", "\\html@mathml{" + "\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}" + "}{\\mathrel{\\char`\u2258}}");
defineMacro("\u2259", "\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}");
defineMacro("\u225A", "\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}");
defineMacro("\u225B", "\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}" + "{\\mathrel{\\char`\u225B}}");
defineMacro("\u225D", "\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}" + "{\\mathrel{\\char`\u225D}}");
defineMacro("\u225E", "\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}" + "{\\mathrel{\\char`\u225E}}");
defineMacro("\u225F", "\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}");
// Misc Unicode
defineMacro("\u27C2", "\\perp");
defineMacro("\u203C", "\\mathclose{!\\mkern-0.8mu!}");
defineMacro("\u220C", "\\notni");
defineMacro("\u231C", "\\ulcorner");
defineMacro("\u231D", "\\urcorner");
defineMacro("\u231E", "\\llcorner");
defineMacro("\u231F", "\\lrcorner");
defineMacro("\u00A9", "\\copyright");
defineMacro("\u00AE", "\\textregistered");
// The KaTeX fonts have corners at codepoints that don't match Unicode.
// For MathML purposes, use the Unicode code point.
defineMacro("\\ulcorner", "\\html@mathml{\\@ulcorner}{\\mathop{\\char\"231c}}");
defineMacro("\\urcorner", "\\html@mathml{\\@urcorner}{\\mathop{\\char\"231d}}");
defineMacro("\\llcorner", "\\html@mathml{\\@llcorner}{\\mathop{\\char\"231e}}");
defineMacro("\\lrcorner", "\\html@mathml{\\@lrcorner}{\\mathop{\\char\"231f}}");
//////////////////////////////////////////////////////////////////////
// LaTeX_2ε
// \vdots{\vbox{\baselineskip4\p@  \lineskiplimit\z@
// \kern6\p@\hbox{.}\hbox{.}\hbox{.}}}
// We'll call \varvdots, which gets a glyph from symbols.js.
// The zero-width rule gets us an equivalent to the vertical 6pt kern.
defineMacro("\\vdots", "{\\varvdots\\rule{0pt}{15pt}}");
defineMacro("\u22ee", "\\vdots");
//////////////////////////////////////////////////////////////////////
// amsmath.sty
// http://mirrors.concertpass.com/tex-archive/macros/latex/required/amsmath/amsmath.pdf
// Italic Greek capital letters.  AMS defines these with \DeclareMathSymbol,
// but they are equivalent to \mathit{\Letter}.
defineMacro("\\varGamma", "\\mathit{\\Gamma}");
defineMacro("\\varDelta", "\\mathit{\\Delta}");
defineMacro("\\varTheta", "\\mathit{\\Theta}");
defineMacro("\\varLambda", "\\mathit{\\Lambda}");
defineMacro("\\varXi", "\\mathit{\\Xi}");
defineMacro("\\varPi", "\\mathit{\\Pi}");
defineMacro("\\varSigma", "\\mathit{\\Sigma}");
defineMacro("\\varUpsilon", "\\mathit{\\Upsilon}");
defineMacro("\\varPhi", "\\mathit{\\Phi}");
defineMacro("\\varPsi", "\\mathit{\\Psi}");
defineMacro("\\varOmega", "\\mathit{\\Omega}");
//\newcommand{\substack}[1]{\subarray{c}#1\endsubarray}
defineMacro("\\substack", "\\begin{subarray}{c}#1\\end{subarray}");
// \renewcommand{\colon}{\nobreak\mskip2mu\mathpunct{}\nonscript
// \mkern-\thinmuskip{:}\mskip6muplus1mu\relax}
defineMacro("\\colon", "\\nobreak\\mskip2mu\\mathpunct{}" + "\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");
// \newcommand{\boxed}[1]{\fbox{\m@th$\displaystyle#1$}}
defineMacro("\\boxed", "\\fbox{$\\displaystyle{#1}$}");
// \def\iff{\DOTSB\;\Longleftrightarrow\;}
// \def\implies{\DOTSB\;\Longrightarrow\;}
// \def\impliedby{\DOTSB\;\Longleftarrow\;}
defineMacro("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;");
defineMacro("\\implies", "\\DOTSB\\;\\Longrightarrow\\;");
defineMacro("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;");
// \def\dddot#1{{\mathop{#1}\limits^{\vbox to-1.4\ex@{\kern-\tw@\ex@
//  \hbox{\normalfont ...}\vss}}}}
// We use \overset which avoids the vertical shift of \mathop.
defineMacro("\\dddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");
defineMacro("\\ddddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");
// AMSMath's automatic \dots, based on \mdots@@ macro.
var dotsByToken = {
  ',': '\\dotsc',
  '\\not': '\\dotsb',
  // \keybin@ checks for the following:
  '+': '\\dotsb',
  '=': '\\dotsb',
  '<': '\\dotsb',
  '>': '\\dotsb',
  '-': '\\dotsb',
  '*': '\\dotsb',
  ':': '\\dotsb',
  // Symbols whose definition starts with \DOTSB:
  '\\DOTSB': '\\dotsb',
  '\\coprod': '\\dotsb',
  '\\bigvee': '\\dotsb',
  '\\bigwedge': '\\dotsb',
  '\\biguplus': '\\dotsb',
  '\\bigcap': '\\dotsb',
  '\\bigcup': '\\dotsb',
  '\\prod': '\\dotsb',
  '\\sum': '\\dotsb',
  '\\bigotimes': '\\dotsb',
  '\\bigoplus': '\\dotsb',
  '\\bigodot': '\\dotsb',
  '\\bigsqcup': '\\dotsb',
  '\\And': '\\dotsb',
  '\\longrightarrow': '\\dotsb',
  '\\Longrightarrow': '\\dotsb',
  '\\longleftarrow': '\\dotsb',
  '\\Longleftarrow': '\\dotsb',
  '\\longleftrightarrow': '\\dotsb',
  '\\Longleftrightarrow': '\\dotsb',
  '\\mapsto': '\\dotsb',
  '\\longmapsto': '\\dotsb',
  '\\hookrightarrow': '\\dotsb',
  '\\doteq': '\\dotsb',
  // Symbols whose definition starts with \mathbin:
  '\\mathbin': '\\dotsb',
  // Symbols whose definition starts with \mathrel:
  '\\mathrel': '\\dotsb',
  '\\relbar': '\\dotsb',
  '\\Relbar': '\\dotsb',
  '\\xrightarrow': '\\dotsb',
  '\\xleftarrow': '\\dotsb',
  // Symbols whose definition starts with \DOTSI:
  '\\DOTSI': '\\dotsi',
  '\\int': '\\dotsi',
  '\\oint': '\\dotsi',
  '\\iint': '\\dotsi',
  '\\iiint': '\\dotsi',
  '\\iiiint': '\\dotsi',
  '\\idotsint': '\\dotsi',
  // Symbols whose definition starts with \DOTSX:
  '\\DOTSX': '\\dotsx'
};
var dotsbGroups = new Set(['bin', 'rel']);
defineMacro("\\dots", function (context) {
  // TODO: If used in text mode, should expand to \textellipsis.
  // However, in KaTeX, \textellipsis and \ldots behave the same
  // (in text mode), and it's unlikely we'd see any of the math commands
  // that affect the behavior of \dots when in text mode.  So fine for now
  // (until we support \ifmmode ... \else ... \fi).
  var thedots = '\\dotso';
  var next = context.expandAfterFuture().text;
  if (next in dotsByToken) {
    thedots = dotsByToken[next];
  } else if (next.slice(0, 4) === '\\not') {
    thedots = '\\dotsb';
  } else if (next in symbols.math) {
    if (dotsbGroups.has(symbols.math[next].group)) {
      thedots = '\\dotsb';
    }
  }
  return thedots;
});
var spaceAfterDots = {
  // \rightdelim@ checks for the following:
  ')': true,
  ']': true,
  '\\rbrack': true,
  '\\}': true,
  '\\rbrace': true,
  '\\rangle': true,
  '\\rceil': true,
  '\\rfloor': true,
  '\\rgroup': true,
  '\\rmoustache': true,
  '\\right': true,
  '\\bigr': true,
  '\\biggr': true,
  '\\Bigr': true,
  '\\Biggr': true,
  // \extra@ also tests for the following:
  '$': true,
  // \extrap@ checks for the following:
  ';': true,
  '.': true,
  ',': true
};
defineMacro("\\dotso", function (context) {
  var next = context.future().text;
  if (next in spaceAfterDots) {
    return "\\ldots\\,";
  } else {
    return "\\ldots";
  }
});
defineMacro("\\dotsc", function (context) {
  var next = context.future().text;
  // \dotsc uses \extra@ but not \extrap@, instead specially checking for
  // ';' and '.', but doesn't check for ','.
  if (next in spaceAfterDots && next !== ',') {
    return "\\ldots\\,";
  } else {
    return "\\ldots";
  }
});
defineMacro("\\cdots", function (context) {
  var next = context.future().text;
  if (next in spaceAfterDots) {
    return "\\@cdots\\,";
  } else {
    return "\\@cdots";
  }
});
defineMacro("\\dotsb", "\\cdots");
defineMacro("\\dotsm", "\\cdots");
defineMacro("\\dotsi", "\\!\\cdots");
// amsmath doesn't actually define \dotsx, but \dots followed by a macro
// starting with \DOTSX implies \dotso, and then \extra@ detects this case
// and forces the added `\,`.
defineMacro("\\dotsx", "\\ldots\\,");
// \let\DOTSI\relax
// \let\DOTSB\relax
// \let\DOTSX\relax
defineMacro("\\DOTSI", "\\relax");
defineMacro("\\DOTSB", "\\relax");
defineMacro("\\DOTSX", "\\relax");
// Spacing, based on amsmath.sty's override of LaTeX defaults
// \DeclareRobustCommand{\tmspace}[3]{%
//   \ifmmode\mskip#1#2\else\kern#1#3\fi\relax}
defineMacro("\\tmspace", "\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");
// \renewcommand{\,}{\tmspace+\thinmuskip{.1667em}}
// TODO: math mode should use \thinmuskip
defineMacro("\\,", "\\tmspace+{3mu}{.1667em}");
// \let\thinspace\,
defineMacro("\\thinspace", "\\,");
// \def\>{\mskip\medmuskip}
// \renewcommand{\:}{\tmspace+\medmuskip{.2222em}}
// TODO: \> and math mode of \: should use \medmuskip = 4mu plus 2mu minus 4mu
defineMacro("\\>", "\\mskip{4mu}");
defineMacro("\\:", "\\tmspace+{4mu}{.2222em}");
// \let\medspace\:
defineMacro("\\medspace", "\\:");
// \renewcommand{\;}{\tmspace+\thickmuskip{.2777em}}
// TODO: math mode should use \thickmuskip = 5mu plus 5mu
defineMacro("\\;", "\\tmspace+{5mu}{.2777em}");
// \let\thickspace\;
defineMacro("\\thickspace", "\\;");
// \renewcommand{\!}{\tmspace-\thinmuskip{.1667em}}
// TODO: math mode should use \thinmuskip
defineMacro("\\!", "\\tmspace-{3mu}{.1667em}");
// \let\negthinspace\!
defineMacro("\\negthinspace", "\\!");
// \newcommand{\negmedspace}{\tmspace-\medmuskip{.2222em}}
// TODO: math mode should use \medmuskip
defineMacro("\\negmedspace", "\\tmspace-{4mu}{.2222em}");
// \newcommand{\negthickspace}{\tmspace-\thickmuskip{.2777em}}
// TODO: math mode should use \thickmuskip
defineMacro("\\negthickspace", "\\tmspace-{5mu}{.277em}");
// \def\enspace{\kern.5em }
defineMacro("\\enspace", "\\kern.5em ");
// \def\enskip{\hskip.5em\relax}
defineMacro("\\enskip", "\\hskip.5em\\relax");
// \def\quad{\hskip1em\relax}
defineMacro("\\quad", "\\hskip1em\\relax");
// \def\qquad{\hskip2em\relax}
defineMacro("\\qquad", "\\hskip2em\\relax");
// \tag@in@display form of \tag
defineMacro("\\tag", "\\@ifstar\\tag@literal\\tag@paren");
defineMacro("\\tag@paren", "\\tag@literal{({#1})}");
defineMacro("\\tag@literal", context => {
  if (context.macros.get("\\df@tag")) {
    throw new ParseError("Multiple \\tag");
  }
  return "\\gdef\\df@tag{\\text{#1}}";
});
// \renewcommand{\bmod}{\nonscript\mskip-\medmuskip\mkern5mu\mathbin
//   {\operator@font mod}\penalty900
//   \mkern5mu\nonscript\mskip-\medmuskip}
// \newcommand{\pod}[1]{\allowbreak
//   \if@display\mkern18mu\else\mkern8mu\fi(#1)}
// \renewcommand{\pmod}[1]{\pod{{\operator@font mod}\mkern6mu#1}}
// \newcommand{\mod}[1]{\allowbreak\if@display\mkern18mu
//   \else\mkern12mu\fi{\operator@font mod}\,\,#1}
// TODO: math mode should use \medmuskip = 4mu plus 2mu minus 4mu
defineMacro("\\bmod", "\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}" + "\\mathbin{\\rm mod}" + "\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");
defineMacro("\\pod", "\\allowbreak" + "\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");
defineMacro("\\pmod", "\\pod{{\\rm mod}\\mkern6mu#1}");
defineMacro("\\mod", "\\allowbreak" + "\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}" + "{\\rm mod}\\,\\,#1");
//////////////////////////////////////////////////////////////////////
// LaTeX source2e
// \expandafter\let\expandafter\@normalcr
//     \csname\expandafter\@gobble\string\\ \endcsname
// \DeclareRobustCommand\newline{\@normalcr\relax}
defineMacro("\\newline", "\\\\\\relax");
// \def\TeX{T\kern-.1667em\lower.5ex\hbox{E}\kern-.125emX\@}
// TODO: Doesn't normally work in math mode because \@ fails.  KaTeX doesn't
// support \@ yet, so that's omitted, and we add \text so that the result
// doesn't look funny in math mode.
defineMacro("\\TeX", "\\textrm{\\html@mathml{" + "T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX" + "}{TeX}}");
// \DeclareRobustCommand{\LaTeX}{L\kern-.36em%
//         {\sbox\z@ T%
//          \vbox to\ht\z@{\hbox{\check@mathfonts
//                               \fontsize\sf@size\z@
//                               \math@fontsfalse\selectfont
//                               A}%
//                         \vss}%
//         }%
//         \kern-.15em%
//         \TeX}
// This code aligns the top of the A with the T (from the perspective of TeX's
// boxes, though visually the A appears to extend above slightly).
// We compute the corresponding \raisebox when A is rendered in \normalsize
// \scrip   tstyle, which has a scale factor of 0.7 (see Options.js).
var latexRaiseA = makeEm(fontMetricsData['Main-Regular']["T".charCodeAt(0)][1] - 0.7 * fontMetricsData['Main-Regular']["A".charCodeAt(0)][1]);
defineMacro("\\LaTeX", "\\textrm{\\html@mathml{" + ("L\\kern-.36em\\raisebox{" + latexRaiseA + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{LaTeX}}");
// New KaTeX logo based on tweaking LaTeX logo
defineMacro("\\KaTeX", "\\textrm{\\html@mathml{" + ("K\\kern-.17em\\raisebox{" + latexRaiseA + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{KaTeX}}");
// \DeclareRobustCommand\hspace{\@ifstar\@hspacer\@hspace}
// \def\@hspace#1{\hskip  #1\relax}
// \def\@hspacer#1{\vrule \@width\z@\nobreak
//                 \hskip #1\hskip \z@skip}
defineMacro("\\hspace", "\\@ifstar\\@hspacer\\@hspace");
defineMacro("\\@hspace", "\\hskip #1\\relax");
defineMacro("\\@hspacer", "\\rule{0pt}{0pt}\\hskip #1\\relax");
//////////////////////////////////////////////////////////////////////
// mathtools.sty
//\providecommand\ordinarycolon{:}
defineMacro("\\ordinarycolon", ":");
//\def\vcentcolon{\mathrel{\mathop\ordinarycolon}}
//TODO(edemaine): Not yet centered. Fix via \raisebox or #726
defineMacro("\\vcentcolon", "\\mathrel{\\mathop\\ordinarycolon}");
// \providecommand*\dblcolon{\vcentcolon\mathrel{\mkern-.9mu}\vcentcolon}
defineMacro("\\dblcolon", "\\html@mathml{" + "\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}" + "{\\mathop{\\char\"2237}}");
// \providecommand*\coloneqq{\vcentcolon\mathrel{\mkern-1.2mu}=}
defineMacro("\\coloneqq", "\\html@mathml{" + "\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}" + "{\\mathop{\\char\"2254}}"); // ≔
// \providecommand*\Coloneqq{\dblcolon\mathrel{\mkern-1.2mu}=}
defineMacro("\\Coloneqq", "\\html@mathml{" + "\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}" + "{\\mathop{\\char\"2237\\char\"3d}}");
// \providecommand*\coloneq{\vcentcolon\mathrel{\mkern-1.2mu}\mathrel{-}}
defineMacro("\\coloneq", "\\html@mathml{" + "\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}" + "{\\mathop{\\char\"3a\\char\"2212}}");
// \providecommand*\Coloneq{\dblcolon\mathrel{\mkern-1.2mu}\mathrel{-}}
defineMacro("\\Coloneq", "\\html@mathml{" + "\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}" + "{\\mathop{\\char\"2237\\char\"2212}}");
// \providecommand*\eqqcolon{=\mathrel{\mkern-1.2mu}\vcentcolon}
defineMacro("\\eqqcolon", "\\html@mathml{" + "\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}" + "{\\mathop{\\char\"2255}}"); // ≕
// \providecommand*\Eqqcolon{=\mathrel{\mkern-1.2mu}\dblcolon}
defineMacro("\\Eqqcolon", "\\html@mathml{" + "\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}" + "{\\mathop{\\char\"3d\\char\"2237}}");
// \providecommand*\eqcolon{\mathrel{-}\mathrel{\mkern-1.2mu}\vcentcolon}
defineMacro("\\eqcolon", "\\html@mathml{" + "\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}" + "{\\mathop{\\char\"2239}}");
// \providecommand*\Eqcolon{\mathrel{-}\mathrel{\mkern-1.2mu}\dblcolon}
defineMacro("\\Eqcolon", "\\html@mathml{" + "\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}" + "{\\mathop{\\char\"2212\\char\"2237}}");
// \providecommand*\colonapprox{\vcentcolon\mathrel{\mkern-1.2mu}\approx}
defineMacro("\\colonapprox", "\\html@mathml{" + "\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}" + "{\\mathop{\\char\"3a\\char\"2248}}");
// \providecommand*\Colonapprox{\dblcolon\mathrel{\mkern-1.2mu}\approx}
defineMacro("\\Colonapprox", "\\html@mathml{" + "\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}" + "{\\mathop{\\char\"2237\\char\"2248}}");
// \providecommand*\colonsim{\vcentcolon\mathrel{\mkern-1.2mu}\sim}
defineMacro("\\colonsim", "\\html@mathml{" + "\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}" + "{\\mathop{\\char\"3a\\char\"223c}}");
// \providecommand*\Colonsim{\dblcolon\mathrel{\mkern-1.2mu}\sim}
defineMacro("\\Colonsim", "\\html@mathml{" + "\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}" + "{\\mathop{\\char\"2237\\char\"223c}}");
// Some Unicode characters are implemented with macros to mathtools functions.
defineMacro("\u2237", "\\dblcolon"); // ::
defineMacro("\u2239", "\\eqcolon"); // -:
defineMacro("\u2254", "\\coloneqq"); // :=
defineMacro("\u2255", "\\eqqcolon"); // =:
defineMacro("\u2A74", "\\Coloneqq"); // ::=
//////////////////////////////////////////////////////////////////////
// colonequals.sty
// Alternate names for mathtools's macros:
defineMacro("\\ratio", "\\vcentcolon");
defineMacro("\\coloncolon", "\\dblcolon");
defineMacro("\\colonequals", "\\coloneqq");
defineMacro("\\coloncolonequals", "\\Coloneqq");
defineMacro("\\equalscolon", "\\eqqcolon");
defineMacro("\\equalscoloncolon", "\\Eqqcolon");
defineMacro("\\colonminus", "\\coloneq");
defineMacro("\\coloncolonminus", "\\Coloneq");
defineMacro("\\minuscolon", "\\eqcolon");
defineMacro("\\minuscoloncolon", "\\Eqcolon");
// \colonapprox name is same in mathtools and colonequals.
defineMacro("\\coloncolonapprox", "\\Colonapprox");
// \colonsim name is same in mathtools and colonequals.
defineMacro("\\coloncolonsim", "\\Colonsim");
// Additional macros, implemented by analogy with mathtools definitions:
defineMacro("\\simcolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
defineMacro("\\simcoloncolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");
defineMacro("\\approxcolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
defineMacro("\\approxcoloncolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");
// Present in newtxmath, pxfonts and txfonts
defineMacro("\\notni", "\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}");
defineMacro("\\limsup", "\\DOTSB\\operatorname*{lim\\,sup}");
defineMacro("\\liminf", "\\DOTSB\\operatorname*{lim\\,inf}");
//////////////////////////////////////////////////////////////////////
// From amsopn.sty
defineMacro("\\injlim", "\\DOTSB\\operatorname*{inj\\,lim}");
defineMacro("\\projlim", "\\DOTSB\\operatorname*{proj\\,lim}");
defineMacro("\\varlimsup", "\\DOTSB\\operatorname*{\\overline{lim}}");
defineMacro("\\varliminf", "\\DOTSB\\operatorname*{\\underline{lim}}");
defineMacro("\\varinjlim", "\\DOTSB\\operatorname*{\\underrightarrow{lim}}");
defineMacro("\\varprojlim", "\\DOTSB\\operatorname*{\\underleftarrow{lim}}");
//////////////////////////////////////////////////////////////////////
// MathML alternates for KaTeX glyphs in the Unicode private area
defineMacro("\\gvertneqq", "\\html@mathml{\\@gvertneqq}{\u2269}");
defineMacro("\\lvertneqq", "\\html@mathml{\\@lvertneqq}{\u2268}");
defineMacro("\\ngeqq", "\\html@mathml{\\@ngeqq}{\u2271}");
defineMacro("\\ngeqslant", "\\html@mathml{\\@ngeqslant}{\u2271}");
defineMacro("\\nleqq", "\\html@mathml{\\@nleqq}{\u2270}");
defineMacro("\\nleqslant", "\\html@mathml{\\@nleqslant}{\u2270}");
defineMacro("\\nshortmid", "\\html@mathml{\\@nshortmid}{∤}");
defineMacro("\\nshortparallel", "\\html@mathml{\\@nshortparallel}{∦}");
defineMacro("\\nsubseteqq", "\\html@mathml{\\@nsubseteqq}{\u2288}");
defineMacro("\\nsupseteqq", "\\html@mathml{\\@nsupseteqq}{\u2289}");
defineMacro("\\varsubsetneq", "\\html@mathml{\\@varsubsetneq}{⊊}");
defineMacro("\\varsubsetneqq", "\\html@mathml{\\@varsubsetneqq}{⫋}");
defineMacro("\\varsupsetneq", "\\html@mathml{\\@varsupsetneq}{⊋}");
defineMacro("\\varsupsetneqq", "\\html@mathml{\\@varsupsetneqq}{⫌}");
defineMacro("\\imath", "\\html@mathml{\\@imath}{\u0131}");
defineMacro("\\jmath", "\\html@mathml{\\@jmath}{\u0237}");
//////////////////////////////////////////////////////////////////////
// stmaryrd and semantic
// The stmaryrd and semantic packages render the next four items by calling a
// glyph. Those glyphs do not exist in the KaTeX fonts. Hence the macros.
defineMacro("\\llbracket", "\\html@mathml{" + "\\mathopen{[\\mkern-3.2mu[}}" + "{\\mathopen{\\char`\u27e6}}");
defineMacro("\\rrbracket", "\\html@mathml{" + "\\mathclose{]\\mkern-3.2mu]}}" + "{\\mathclose{\\char`\u27e7}}");
defineMacro("\u27e6", "\\llbracket"); // blackboard bold [
defineMacro("\u27e7", "\\rrbracket"); // blackboard bold ]
defineMacro("\\lBrace", "\\html@mathml{" + "\\mathopen{\\{\\mkern-3.2mu[}}" + "{\\mathopen{\\char`\u2983}}");
defineMacro("\\rBrace", "\\html@mathml{" + "\\mathclose{]\\mkern-3.2mu\\}}}" + "{\\mathclose{\\char`\u2984}}");
defineMacro("\u2983", "\\lBrace"); // blackboard bold {
defineMacro("\u2984", "\\rBrace"); // blackboard bold }
// TODO: Create variable sized versions of the last two items. I believe that
// will require new font glyphs.
// The stmaryrd function `\minuso` provides a "Plimsoll" symbol that
// superimposes the characters \circ and \mathminus. Used in chemistry.
defineMacro("\\minuso", "\\mathbin{\\html@mathml{" + "{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}" + "{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}" + "{\\char`⦵}}");
defineMacro("⦵", "\\minuso");
//////////////////////////////////////////////////////////////////////
// texvc.sty
// The texvc package contains macros available in mediawiki pages.
// We omit the functions deprecated at
// https://en.wikipedia.org/wiki/Help:Displaying_a_formula#Deprecated_syntax
// We also omit texvc's \O, which conflicts with \text{\O}
defineMacro("\\darr", "\\downarrow");
defineMacro("\\dArr", "\\Downarrow");
defineMacro("\\Darr", "\\Downarrow");
defineMacro("\\lang", "\\langle");
defineMacro("\\rang", "\\rangle");
defineMacro("\\uarr", "\\uparrow");
defineMacro("\\uArr", "\\Uparrow");
defineMacro("\\Uarr", "\\Uparrow");
defineMacro("\\N", "\\mathbb{N}");
defineMacro("\\R", "\\mathbb{R}");
defineMacro("\\Z", "\\mathbb{Z}");
defineMacro("\\alef", "\\aleph");
defineMacro("\\alefsym", "\\aleph");
defineMacro("\\Alpha", "\\mathrm{A}");
defineMacro("\\Beta", "\\mathrm{B}");
defineMacro("\\bull", "\\bullet");
defineMacro("\\Chi", "\\mathrm{X}");
defineMacro("\\clubs", "\\clubsuit");
defineMacro("\\cnums", "\\mathbb{C}");
defineMacro("\\Complex", "\\mathbb{C}");
defineMacro("\\Dagger", "\\ddagger");
defineMacro("\\diamonds", "\\diamondsuit");
defineMacro("\\empty", "\\emptyset");
defineMacro("\\Epsilon", "\\mathrm{E}");
defineMacro("\\Eta", "\\mathrm{H}");
defineMacro("\\exist", "\\exists");
defineMacro("\\harr", "\\leftrightarrow");
defineMacro("\\hArr", "\\Leftrightarrow");
defineMacro("\\Harr", "\\Leftrightarrow");
defineMacro("\\hearts", "\\heartsuit");
defineMacro("\\image", "\\Im");
defineMacro("\\infin", "\\infty");
defineMacro("\\Iota", "\\mathrm{I}");
defineMacro("\\isin", "\\in");
defineMacro("\\Kappa", "\\mathrm{K}");
defineMacro("\\larr", "\\leftarrow");
defineMacro("\\lArr", "\\Leftarrow");
defineMacro("\\Larr", "\\Leftarrow");
defineMacro("\\lrarr", "\\leftrightarrow");
defineMacro("\\lrArr", "\\Leftrightarrow");
defineMacro("\\Lrarr", "\\Leftrightarrow");
defineMacro("\\Mu", "\\mathrm{M}");
defineMacro("\\natnums", "\\mathbb{N}");
defineMacro("\\Nu", "\\mathrm{N}");
defineMacro("\\Omicron", "\\mathrm{O}");
defineMacro("\\plusmn", "\\pm");
defineMacro("\\rarr", "\\rightarrow");
defineMacro("\\rArr", "\\Rightarrow");
defineMacro("\\Rarr", "\\Rightarrow");
defineMacro("\\real", "\\Re");
defineMacro("\\reals", "\\mathbb{R}");
defineMacro("\\Reals", "\\mathbb{R}");
defineMacro("\\Rho", "\\mathrm{P}");
defineMacro("\\sdot", "\\cdot");
defineMacro("\\sect", "\\S");
defineMacro("\\spades", "\\spadesuit");
defineMacro("\\sub", "\\subset");
defineMacro("\\sube", "\\subseteq");
defineMacro("\\supe", "\\supseteq");
defineMacro("\\Tau", "\\mathrm{T}");
defineMacro("\\thetasym", "\\vartheta");
// TODO: defineMacro("\\varcoppa", "\\\mbox{\\coppa}");
defineMacro("\\weierp", "\\wp");
defineMacro("\\Zeta", "\\mathrm{Z}");
//////////////////////////////////////////////////////////////////////
// statmath.sty
// https://ctan.math.illinois.edu/macros/latex/contrib/statmath/statmath.pdf
defineMacro("\\argmin", "\\DOTSB\\operatorname*{arg\\,min}");
defineMacro("\\argmax", "\\DOTSB\\operatorname*{arg\\,max}");
defineMacro("\\plim", "\\DOTSB\\mathop{\\operatorname{plim}}\\limits");
//////////////////////////////////////////////////////////////////////
// braket.sty
// http://ctan.math.washington.edu/tex-archive/macros/latex/contrib/braket/braket.pdf
defineMacro("\\bra", "\\mathinner{\\langle{#1}|}");
defineMacro("\\ket", "\\mathinner{|{#1}\\rangle}");
defineMacro("\\braket", "\\mathinner{\\langle{#1}\\rangle}");
defineMacro("\\Bra", "\\left\\langle#1\\right|");
defineMacro("\\Ket", "\\left|#1\\right\\rangle");
var braketHelper = one => context => {
  var left = context.consumeArg().tokens;
  var middle = context.consumeArg().tokens;
  var middleDouble = context.consumeArg().tokens;
  var right = context.consumeArg().tokens;
  var oldMiddle = context.macros.get("|");
  var oldMiddleDouble = context.macros.get("\\|");
  context.macros.beginGroup();
  var midMacro = double => context => {
    if (one) {
      // Only modify the first instance of | or \|
      context.macros.set("|", oldMiddle);
      if (middleDouble.length) {
        context.macros.set("\\|", oldMiddleDouble);
      }
    }
    var doubled = double;
    if (!double && middleDouble.length) {
      // Mimic \@ifnextchar
      var nextToken = context.future();
      if (nextToken.text === "|") {
        context.popToken();
        doubled = true;
      }
    }
    return {
      tokens: doubled ? middleDouble : middle,
      numArgs: 0
    };
  };
  context.macros.set("|", midMacro(false));
  if (middleDouble.length) {
    context.macros.set("\\|", midMacro(true));
  }
  var arg = context.consumeArg().tokens;
  var expanded = context.expandTokens([...right, ...arg, ...left // reversed
  ]);
  context.macros.endGroup();
  return {
    tokens: expanded.reverse(),
    numArgs: 0
  };
};
defineMacro("\\bra@ket", braketHelper(false));
defineMacro("\\bra@set", braketHelper(true));
defineMacro("\\Braket", "\\bra@ket{\\left\\langle}" + "{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");
defineMacro("\\Set", "\\bra@set{\\left\\{\\:}" + "{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");
defineMacro("\\set", "\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");
// has no support for special || or \|
//////////////////////////////////////////////////////////////////////
// actuarialangle.dtx
defineMacro("\\angln", "{\\angl n}");
// Custom Khan Academy colors, should be moved to an optional package
defineMacro("\\blue", "\\textcolor{##6495ed}{#1}");
defineMacro("\\orange", "\\textcolor{##ffa500}{#1}");
defineMacro("\\pink", "\\textcolor{##ff00af}{#1}");
defineMacro("\\red", "\\textcolor{##df0030}{#1}");
defineMacro("\\green", "\\textcolor{##28ae7b}{#1}");
defineMacro("\\gray", "\\textcolor{gray}{#1}");
defineMacro("\\purple", "\\textcolor{##9d38bd}{#1}");
defineMacro("\\blueA", "\\textcolor{##ccfaff}{#1}");
defineMacro("\\blueB", "\\textcolor{##80f6ff}{#1}");
defineMacro("\\blueC", "\\textcolor{##63d9ea}{#1}");
defineMacro("\\blueD", "\\textcolor{##11accd}{#1}");
defineMacro("\\blueE", "\\textcolor{##0c7f99}{#1}");
defineMacro("\\tealA", "\\textcolor{##94fff5}{#1}");
defineMacro("\\tealB", "\\textcolor{##26edd5}{#1}");
defineMacro("\\tealC", "\\textcolor{##01d1c1}{#1}");
defineMacro("\\tealD", "\\textcolor{##01a995}{#1}");
defineMacro("\\tealE", "\\textcolor{##208170}{#1}");
defineMacro("\\greenA", "\\textcolor{##b6ffb0}{#1}");
defineMacro("\\greenB", "\\textcolor{##8af281}{#1}");
defineMacro("\\greenC", "\\textcolor{##74cf70}{#1}");
defineMacro("\\greenD", "\\textcolor{##1fab54}{#1}");
defineMacro("\\greenE", "\\textcolor{##0d923f}{#1}");
defineMacro("\\goldA", "\\textcolor{##ffd0a9}{#1}");
defineMacro("\\goldB", "\\textcolor{##ffbb71}{#1}");
defineMacro("\\goldC", "\\textcolor{##ff9c39}{#1}");
defineMacro("\\goldD", "\\textcolor{##e07d10}{#1}");
defineMacro("\\goldE", "\\textcolor{##a75a05}{#1}");
defineMacro("\\redA", "\\textcolor{##fca9a9}{#1}");
defineMacro("\\redB", "\\textcolor{##ff8482}{#1}");
defineMacro("\\redC", "\\textcolor{##f9685d}{#1}");
defineMacro("\\redD", "\\textcolor{##e84d39}{#1}");
defineMacro("\\redE", "\\textcolor{##bc2612}{#1}");
defineMacro("\\maroonA", "\\textcolor{##ffbde0}{#1}");
defineMacro("\\maroonB", "\\textcolor{##ff92c6}{#1}");
defineMacro("\\maroonC", "\\textcolor{##ed5fa6}{#1}");
defineMacro("\\maroonD", "\\textcolor{##ca337c}{#1}");
defineMacro("\\maroonE", "\\textcolor{##9e034e}{#1}");
defineMacro("\\purpleA", "\\textcolor{##ddd7ff}{#1}");
defineMacro("\\purpleB", "\\textcolor{##c6b9fc}{#1}");
defineMacro("\\purpleC", "\\textcolor{##aa87ff}{#1}");
defineMacro("\\purpleD", "\\textcolor{##7854ab}{#1}");
defineMacro("\\purpleE", "\\textcolor{##543b78}{#1}");
defineMacro("\\mintA", "\\textcolor{##f5f9e8}{#1}");
defineMacro("\\mintB", "\\textcolor{##edf2df}{#1}");
defineMacro("\\mintC", "\\textcolor{##e0e5cc}{#1}");
defineMacro("\\grayA", "\\textcolor{##f6f7f7}{#1}");
defineMacro("\\grayB", "\\textcolor{##f0f1f2}{#1}");
defineMacro("\\grayC", "\\textcolor{##e3e5e6}{#1}");
defineMacro("\\grayD", "\\textcolor{##d6d8da}{#1}");
defineMacro("\\grayE", "\\textcolor{##babec2}{#1}");
defineMacro("\\grayF", "\\textcolor{##888d93}{#1}");
defineMacro("\\grayG", "\\textcolor{##626569}{#1}");
defineMacro("\\grayH", "\\textcolor{##3b3e40}{#1}");
defineMacro("\\grayI", "\\textcolor{##21242c}{#1}");
defineMacro("\\kaBlue", "\\textcolor{##314453}{#1}");
defineMacro("\\kaGreen", "\\textcolor{##71B307}{#1}");

/**
 * This file contains the “gullet” where macros are expanded
 * until only non-macro tokens remain.
 */
// List of commands that act like macros but aren't defined as a macro,
// function, or symbol.  Used in `isDefined`.
var implicitCommands = {
  "^": true,
  // Parser.js
  "_": true,
  // Parser.js
  "\\limits": true,
  // Parser.js
  "\\nolimits": true // Parser.js
};
class MacroExpander {
  constructor(input, settings, mode) {
    this.settings = void 0;
    this.expansionCount = void 0;
    this.lexer = void 0;
    this.macros = void 0;
    this.stack = void 0;
    this.mode = void 0;
    this.settings = settings;
    this.expansionCount = 0;
    this.feed(input);
    // Make new global namespace
    this.macros = new Namespace(macros, settings.macros);
    this.mode = mode;
    this.stack = []; // contains tokens in REVERSE order
  }
  /**
   * Feed a new input string to the same MacroExpander
   * (with existing macros etc.).
   */
  feed(input) {
    this.lexer = new Lexer(input, this.settings);
  }
  /**
   * Switches between "text" and "math" modes.
   */
  switchMode(newMode) {
    this.mode = newMode;
  }
  /**
   * Start a new group nesting within all namespaces.
   */
  beginGroup() {
    this.macros.beginGroup();
  }
  /**
   * End current group nesting within all namespaces.
   */
  endGroup() {
    this.macros.endGroup();
  }
  /**
   * Ends all currently nested groups (if any), restoring values before the
   * groups began.  Useful in case of an error in the middle of parsing.
   */
  endGroups() {
    this.macros.endGroups();
  }
  /**
   * Returns the topmost token on the stack, without expanding it.
   * Similar in behavior to TeX's `\futurelet`.
   */
  future() {
    if (this.stack.length === 0) {
      this.pushToken(this.lexer.lex());
    }
    return this.stack[this.stack.length - 1];
  }
  /**
   * Remove and return the next unexpanded token.
   */
  popToken() {
    this.future(); // ensure non-empty stack
    return this.stack.pop();
  }
  /**
   * Add a given token to the token stack.  In particular, this get be used
   * to put back a token returned from one of the other methods.
   */
  pushToken(token) {
    this.stack.push(token);
  }
  /**
   * Append an array of tokens to the token stack.
   */
  pushTokens(tokens) {
    this.stack.push(...tokens);
  }
  /**
   * Find an macro argument without expanding tokens and append the array of
   * tokens to the token stack. Uses Token as a container for the result.
   */
  scanArgument(isOptional) {
    var start;
    var end;
    var tokens;
    if (isOptional) {
      this.consumeSpaces(); // \@ifnextchar gobbles any space following it
      if (this.future().text !== "[") {
        return null;
      }
      start = this.popToken(); // don't include [ in tokens
      ({
        tokens,
        end
      } = this.consumeArg(["]"]));
    } else {
      ({
        tokens,
        start,
        end
      } = this.consumeArg());
    }
    // indicate the end of an argument
    this.pushToken(new Token("EOF", end.loc));
    this.pushTokens(tokens);
    return new Token("", SourceLocation.range(start, end));
  }
  /**
   * Consume all following space tokens, without expansion.
   */
  consumeSpaces() {
    for (;;) {
      var token = this.future();
      if (token.text === " ") {
        this.stack.pop();
      } else {
        break;
      }
    }
  }
  /**
   * Consume an argument from the token stream, and return the resulting array
   * of tokens and start/end token.
   */
  consumeArg(delims) {
    // The argument for a delimited parameter is the shortest (possibly
    // empty) sequence of tokens with properly nested {...} groups that is
    // followed ... by this particular list of non-parameter tokens.
    // The argument for an undelimited parameter is the next nonblank
    // token, unless that token is ‘{’, when the argument will be the
    // entire {...} group that follows.
    var tokens = [];
    var isDelimited = delims && delims.length > 0;
    if (!isDelimited) {
      // Ignore spaces between arguments.  As the TeXbook says:
      // "After you have said ‘\def\row#1#2{...}’, you are allowed to
      //  put spaces between the arguments (e.g., ‘\row x n’), because
      //  TeX doesn’t use single spaces as undelimited arguments."
      this.consumeSpaces();
    }
    var start = this.future();
    var tok;
    var depth = 0;
    var match = 0;
    do {
      tok = this.popToken();
      tokens.push(tok);
      if (tok.text === "{") {
        ++depth;
      } else if (tok.text === "}") {
        --depth;
        if (depth === -1) {
          throw new ParseError("Extra }", tok);
        }
      } else if (tok.text === "EOF") {
        throw new ParseError("Unexpected end of input in a macro argument" + ", expected '" + (delims && isDelimited ? delims[match] : "}") + "'", tok);
      }
      if (delims && isDelimited) {
        if ((depth === 0 || depth === 1 && delims[match] === "{") && tok.text === delims[match]) {
          ++match;
          if (match === delims.length) {
            // don't include delims in tokens
            tokens.splice(-match, match);
            break;
          }
        } else {
          match = 0;
        }
      }
    } while (depth !== 0 || isDelimited);
    // If the argument found ... has the form ‘{<nested tokens>}’,
    // ... the outermost braces enclosing the argument are removed
    if (start.text === "{" && tokens[tokens.length - 1].text === "}") {
      tokens.pop();
      tokens.shift();
    }
    tokens.reverse(); // to fit in with stack order
    return {
      tokens,
      start,
      end: tok
    };
  }
  /**
   * Consume the specified number of (delimited) arguments from the token
   * stream and return the resulting array of arguments.
   */
  consumeArgs(numArgs, delimiters) {
    if (delimiters) {
      if (delimiters.length !== numArgs + 1) {
        throw new ParseError("The length of delimiters doesn't match the number of args!");
      }
      var delims = delimiters[0];
      for (var i = 0; i < delims.length; i++) {
        var tok = this.popToken();
        if (delims[i] !== tok.text) {
          throw new ParseError("Use of the macro doesn't match its definition", tok);
        }
      }
    }
    var args = [];
    for (var _i = 0; _i < numArgs; _i++) {
      args.push(this.consumeArg(delimiters && delimiters[_i + 1]).tokens);
    }
    return args;
  }
  /**
   * Increment `expansionCount` by the specified amount.
   * Throw an error if it exceeds `maxExpand`.
   */
  countExpansion(amount) {
    this.expansionCount += amount;
    if (this.expansionCount > this.settings.maxExpand) {
      throw new ParseError("Too many expansions: infinite loop or " + "need to increase maxExpand setting");
    }
  }
  /**
   * Expand the next token only once if possible.
   *
   * If the token is expanded, the resulting tokens will be pushed onto
   * the stack in reverse order, and the number of such tokens will be
   * returned.  This number might be zero or positive.
   *
   * If not, the return value is `false`, and the next token remains at the
   * top of the stack.
   *
   * In either case, the next token will be on the top of the stack,
   * or the stack will be empty (in case of empty expansion
   * and no other tokens).
   *
   * Used to implement `expandAfterFuture` and `expandNextToken`.
   *
   * If expandableOnly, only expandable tokens are expanded and
   * an undefined control sequence results in an error.
   */
  expandOnce(expandableOnly) {
    var topToken = this.popToken();
    var name = topToken.text;
    var expansion = !topToken.noexpand ? this._getExpansion(name) : null;
    if (expansion == null || expandableOnly && expansion.unexpandable) {
      if (expandableOnly && expansion == null && name[0] === "\\" && !this.isDefined(name)) {
        throw new ParseError("Undefined control sequence: " + name);
      }
      this.pushToken(topToken);
      return false;
    }
    this.countExpansion(1);
    var tokens = expansion.tokens;
    var args = this.consumeArgs(expansion.numArgs, expansion.delimiters);
    if (expansion.numArgs) {
      // paste arguments in place of the placeholders
      tokens = tokens.slice(); // make a shallow copy
      for (var i = tokens.length - 1; i >= 0; --i) {
        var tok = tokens[i];
        if (tok.text === "#") {
          if (i === 0) {
            throw new ParseError("Incomplete placeholder at end of macro body", tok);
          }
          tok = tokens[--i]; // next token on stack
          if (tok.text === "#") {
            // ## → #
            tokens.splice(i + 1, 1); // drop first #
          } else if (/^[1-9]$/.test(tok.text)) {
            // replace the placeholder with the indicated argument
            tokens.splice(i, 2, ...args[+tok.text - 1]);
          } else {
            throw new ParseError("Not a valid argument number", tok);
          }
        }
      }
    }
    // Concatenate expansion onto top of stack.
    this.pushTokens(tokens);
    return tokens.length;
  }
  /**
   * Expand the next token only once (if possible), and return the resulting
   * top token on the stack (without removing anything from the stack).
   * Similar in behavior to TeX's `\expandafter\futurelet`.
   * Equivalent to expandOnce() followed by future().
   */
  expandAfterFuture() {
    this.expandOnce();
    return this.future();
  }
  /**
   * Recursively expand first token, then return first non-expandable token.
   */
  expandNextToken() {
    for (;;) {
      if (this.expandOnce() === false) {
        // fully expanded
        var token = this.stack.pop();
        // the token after \noexpand is interpreted as if its meaning
        // were ‘\relax’
        if (token.treatAsRelax) {
          token.text = "\\relax";
        }
        return token;
      }
    }
  }
  /**
   * Fully expand the given macro name and return the resulting list of
   * tokens, or return `undefined` if no such macro is defined.
   */
  expandMacro(name) {
    return this.macros.has(name) ? this.expandTokens([new Token(name)]) : undefined;
  }
  /**
   * Fully expand the given token stream and return the resulting list of
   * tokens.  Note that the input tokens are in reverse order, but the
   * output tokens are in forward order.
   */
  expandTokens(tokens) {
    var output = [];
    var oldStackLength = this.stack.length;
    this.pushTokens(tokens);
    while (this.stack.length > oldStackLength) {
      // Expand only expandable tokens
      if (this.expandOnce(true) === false) {
        // fully expanded
        var token = this.stack.pop();
        if (token.treatAsRelax) {
          // the expansion of \noexpand is the token itself
          token.noexpand = false;
          token.treatAsRelax = false;
        }
        output.push(token);
      }
    }
    // Count all of these tokens as additional expansions, to prevent
    // exponential blowup from linearly many \edef's.
    this.countExpansion(output.length);
    return output;
  }
  /**
   * Fully expand the given macro name and return the result as a string,
   * or return `undefined` if no such macro is defined.
   */
  expandMacroAsText(name) {
    var tokens = this.expandMacro(name);
    if (tokens) {
      return tokens.map(token => token.text).join("");
    } else {
      return tokens;
    }
  }
  /**
   * Returns the expanded macro as a reversed array of tokens and a macro
   * argument count.  Or returns `null` if no such macro.
   */
  _getExpansion(name) {
    var definition = this.macros.get(name);
    if (definition == null) {
      // mainly checking for undefined here
      return definition;
    }
    // If a single character has an associated catcode other than 13
    // (active character), then don't expand it.
    if (name.length === 1) {
      var catcode = this.lexer.catcodes[name];
      if (catcode != null && catcode !== 13) {
        return;
      }
    }
    var expansion = typeof definition === "function" ? definition(this) : definition;
    if (typeof expansion === "string") {
      var numArgs = 0;
      if (expansion.includes("#")) {
        var stripped = expansion.replace(/##/g, "");
        while (stripped.includes("#" + (numArgs + 1))) {
          ++numArgs;
        }
      }
      var bodyLexer = new Lexer(expansion, this.settings);
      var tokens = [];
      var tok = bodyLexer.lex();
      while (tok.text !== "EOF") {
        tokens.push(tok);
        tok = bodyLexer.lex();
      }
      tokens.reverse(); // to fit in with stack using push and pop
      var expanded = {
        tokens,
        numArgs
      };
      return expanded;
    }
    return expansion;
  }
  /**
   * Determine whether a command is currently "defined" (has some
   * functionality), meaning that it's a macro (in the current group),
   * a function, a symbol, or one of the special commands listed in
   * `implicitCommands`.
   */
  isDefined(name) {
    return this.macros.has(name) || functions.hasOwnProperty(name) || symbols.math.hasOwnProperty(name) || symbols.text.hasOwnProperty(name) || implicitCommands.hasOwnProperty(name);
  }
  /**
   * Determine whether a command is expandable.
   */
  isExpandable(name) {
    var macro = this.macros.get(name);
    return macro != null ? typeof macro === "string" || typeof macro === "function" || !macro.unexpandable : functions.hasOwnProperty(name) && !functions[name].primitive;
  }
}

// Helpers for Parser.js handling of Unicode (sub|super)script characters.
var unicodeSubRegEx = /^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/;
var uSubsAndSups = Object.freeze({
  '₊': '+',
  '₋': '-',
  '₌': '=',
  '₍': '(',
  '₎': ')',
  '₀': '0',
  '₁': '1',
  '₂': '2',
  '₃': '3',
  '₄': '4',
  '₅': '5',
  '₆': '6',
  '₇': '7',
  '₈': '8',
  '₉': '9',
  '\u2090': 'a',
  '\u2091': 'e',
  '\u2095': 'h',
  '\u1D62': 'i',
  '\u2C7C': 'j',
  '\u2096': 'k',
  '\u2097': 'l',
  '\u2098': 'm',
  '\u2099': 'n',
  '\u2092': 'o',
  '\u209A': 'p',
  '\u1D63': 'r',
  '\u209B': 's',
  '\u209C': 't',
  '\u1D64': 'u',
  '\u1D65': 'v',
  '\u2093': 'x',
  '\u1D66': 'β',
  '\u1D67': 'γ',
  '\u1D68': 'ρ',
  '\u1D69': '\u03d5',
  '\u1D6A': 'χ',
  '⁺': '+',
  '⁻': '-',
  '⁼': '=',
  '⁽': '(',
  '⁾': ')',
  '⁰': '0',
  '¹': '1',
  '²': '2',
  '³': '3',
  '⁴': '4',
  '⁵': '5',
  '⁶': '6',
  '⁷': '7',
  '⁸': '8',
  '⁹': '9',
  '\u1D2C': 'A',
  '\u1D2E': 'B',
  '\u1D30': 'D',
  '\u1D31': 'E',
  '\u1D33': 'G',
  '\u1D34': 'H',
  '\u1D35': 'I',
  '\u1D36': 'J',
  '\u1D37': 'K',
  '\u1D38': 'L',
  '\u1D39': 'M',
  '\u1D3A': 'N',
  '\u1D3C': 'O',
  '\u1D3E': 'P',
  '\u1D3F': 'R',
  '\u1D40': 'T',
  '\u1D41': 'U',
  '\u2C7D': 'V',
  '\u1D42': 'W',
  '\u1D43': 'a',
  '\u1D47': 'b',
  '\u1D9C': 'c',
  '\u1D48': 'd',
  '\u1D49': 'e',
  '\u1DA0': 'f',
  '\u1D4D': 'g',
  '\u02B0': 'h',
  '\u2071': 'i',
  '\u02B2': 'j',
  '\u1D4F': 'k',
  '\u02E1': 'l',
  '\u1D50': 'm',
  '\u207F': 'n',
  '\u1D52': 'o',
  '\u1D56': 'p',
  '\u02B3': 'r',
  '\u02E2': 's',
  '\u1D57': 't',
  '\u1D58': 'u',
  '\u1D5B': 'v',
  '\u02B7': 'w',
  '\u02E3': 'x',
  '\u02B8': 'y',
  '\u1DBB': 'z',
  '\u1D5D': 'β',
  '\u1D5E': 'γ',
  '\u1D5F': 'δ',
  '\u1D60': '\u03d5',
  '\u1D61': 'χ',
  '\u1DBF': 'θ'
});

/* eslint no-constant-condition:0 */
// Pre-evaluate both modules as unicodeSymbols require String.normalize()
var unicodeAccents = {
  "́": {
    "text": "\\'",
    "math": "\\acute"
  },
  "̀": {
    "text": "\\`",
    "math": "\\grave"
  },
  "̈": {
    "text": "\\\"",
    "math": "\\ddot"
  },
  "̃": {
    "text": "\\~",
    "math": "\\tilde"
  },
  "̄": {
    "text": "\\=",
    "math": "\\bar"
  },
  "̆": {
    "text": "\\u",
    "math": "\\breve"
  },
  "̌": {
    "text": "\\v",
    "math": "\\check"
  },
  "̂": {
    "text": "\\^",
    "math": "\\hat"
  },
  "̇": {
    "text": "\\.",
    "math": "\\dot"
  },
  "̊": {
    "text": "\\r",
    "math": "\\mathring"
  },
  "̋": {
    "text": "\\H"
  },
  "̧": {
    "text": "\\c"
  }
};
var unicodeSymbols = {
  "á": "á",
  "à": "à",
  "ä": "ä",
  "ǟ": "ǟ",
  "ã": "ã",
  "ā": "ā",
  "ă": "ă",
  "ắ": "ắ",
  "ằ": "ằ",
  "ẵ": "ẵ",
  "ǎ": "ǎ",
  "â": "â",
  "ấ": "ấ",
  "ầ": "ầ",
  "ẫ": "ẫ",
  "ȧ": "ȧ",
  "ǡ": "ǡ",
  "å": "å",
  "ǻ": "ǻ",
  "ḃ": "ḃ",
  "ć": "ć",
  "ḉ": "ḉ",
  "č": "č",
  "ĉ": "ĉ",
  "ċ": "ċ",
  "ç": "ç",
  "ď": "ď",
  "ḋ": "ḋ",
  "ḑ": "ḑ",
  "é": "é",
  "è": "è",
  "ë": "ë",
  "ẽ": "ẽ",
  "ē": "ē",
  "ḗ": "ḗ",
  "ḕ": "ḕ",
  "ĕ": "ĕ",
  "ḝ": "ḝ",
  "ě": "ě",
  "ê": "ê",
  "ế": "ế",
  "ề": "ề",
  "ễ": "ễ",
  "ė": "ė",
  "ȩ": "ȩ",
  "ḟ": "ḟ",
  "ǵ": "ǵ",
  "ḡ": "ḡ",
  "ğ": "ğ",
  "ǧ": "ǧ",
  "ĝ": "ĝ",
  "ġ": "ġ",
  "ģ": "ģ",
  "ḧ": "ḧ",
  "ȟ": "ȟ",
  "ĥ": "ĥ",
  "ḣ": "ḣ",
  "ḩ": "ḩ",
  "í": "í",
  "ì": "ì",
  "ï": "ï",
  "ḯ": "ḯ",
  "ĩ": "ĩ",
  "ī": "ī",
  "ĭ": "ĭ",
  "ǐ": "ǐ",
  "î": "î",
  "ǰ": "ǰ",
  "ĵ": "ĵ",
  "ḱ": "ḱ",
  "ǩ": "ǩ",
  "ķ": "ķ",
  "ĺ": "ĺ",
  "ľ": "ľ",
  "ļ": "ļ",
  "ḿ": "ḿ",
  "ṁ": "ṁ",
  "ń": "ń",
  "ǹ": "ǹ",
  "ñ": "ñ",
  "ň": "ň",
  "ṅ": "ṅ",
  "ņ": "ņ",
  "ó": "ó",
  "ò": "ò",
  "ö": "ö",
  "ȫ": "ȫ",
  "õ": "õ",
  "ṍ": "ṍ",
  "ṏ": "ṏ",
  "ȭ": "ȭ",
  "ō": "ō",
  "ṓ": "ṓ",
  "ṑ": "ṑ",
  "ŏ": "ŏ",
  "ǒ": "ǒ",
  "ô": "ô",
  "ố": "ố",
  "ồ": "ồ",
  "ỗ": "ỗ",
  "ȯ": "ȯ",
  "ȱ": "ȱ",
  "ő": "ő",
  "ṕ": "ṕ",
  "ṗ": "ṗ",
  "ŕ": "ŕ",
  "ř": "ř",
  "ṙ": "ṙ",
  "ŗ": "ŗ",
  "ś": "ś",
  "ṥ": "ṥ",
  "š": "š",
  "ṧ": "ṧ",
  "ŝ": "ŝ",
  "ṡ": "ṡ",
  "ş": "ş",
  "ẗ": "ẗ",
  "ť": "ť",
  "ṫ": "ṫ",
  "ţ": "ţ",
  "ú": "ú",
  "ù": "ù",
  "ü": "ü",
  "ǘ": "ǘ",
  "ǜ": "ǜ",
  "ǖ": "ǖ",
  "ǚ": "ǚ",
  "ũ": "ũ",
  "ṹ": "ṹ",
  "ū": "ū",
  "ṻ": "ṻ",
  "ŭ": "ŭ",
  "ǔ": "ǔ",
  "û": "û",
  "ů": "ů",
  "ű": "ű",
  "ṽ": "ṽ",
  "ẃ": "ẃ",
  "ẁ": "ẁ",
  "ẅ": "ẅ",
  "ŵ": "ŵ",
  "ẇ": "ẇ",
  "ẘ": "ẘ",
  "ẍ": "ẍ",
  "ẋ": "ẋ",
  "ý": "ý",
  "ỳ": "ỳ",
  "ÿ": "ÿ",
  "ỹ": "ỹ",
  "ȳ": "ȳ",
  "ŷ": "ŷ",
  "ẏ": "ẏ",
  "ẙ": "ẙ",
  "ź": "ź",
  "ž": "ž",
  "ẑ": "ẑ",
  "ż": "ż",
  "Á": "Á",
  "À": "À",
  "Ä": "Ä",
  "Ǟ": "Ǟ",
  "Ã": "Ã",
  "Ā": "Ā",
  "Ă": "Ă",
  "Ắ": "Ắ",
  "Ằ": "Ằ",
  "Ẵ": "Ẵ",
  "Ǎ": "Ǎ",
  "Â": "Â",
  "Ấ": "Ấ",
  "Ầ": "Ầ",
  "Ẫ": "Ẫ",
  "Ȧ": "Ȧ",
  "Ǡ": "Ǡ",
  "Å": "Å",
  "Ǻ": "Ǻ",
  "Ḃ": "Ḃ",
  "Ć": "Ć",
  "Ḉ": "Ḉ",
  "Č": "Č",
  "Ĉ": "Ĉ",
  "Ċ": "Ċ",
  "Ç": "Ç",
  "Ď": "Ď",
  "Ḋ": "Ḋ",
  "Ḑ": "Ḑ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": "ϋ",
  "ΰ": "ΰ",
  "ῢ": "ῢ",
  "ῡ": "ῡ",
  "ῠ": "ῠ",
  "ώ": "ώ",
  "ὼ": "ὼ",
  "Ύ": "Ύ",
  "Ὺ": "Ὺ",
  "Ϋ": "Ϋ",
  "Ῡ": "Ῡ",
  "Ῠ": "Ῠ",
  "Ώ": "Ώ",
  "Ὼ": "Ὼ"
};
/**
 * This file contains the parser used to parse out a TeX expression from the
 * input. Since TeX isn't context-free, standard parsers don't work particularly
 * well.
 *
 * The strategy of this parser is as such:
 *
 * The main functions (the `.parse...` ones) take a position in the current
 * parse string to parse tokens from. The lexer (found in Lexer.js, stored at
 * this.gullet.lexer) also supports pulling out tokens at arbitrary places. When
 * individual tokens are needed at a position, the lexer is called to pull out a
 * token, which is then used.
 *
 * The parser has a property called "mode" indicating the mode that
 * the parser is currently in. Currently it has to be one of "math" or
 * "text", which denotes whether the current environment is a math-y
 * one or a text-y one (e.g. inside \text). Currently, this serves to
 * limit the functions which can be used in text mode.
 *
 * The main functions then return an object which contains the useful data that
 * was parsed at its given point, and a new position at the end of the parsed
 * data. The main functions can call each other and continue the parsing by
 * using the returned position as a new starting point.
 *
 * There are also extra `.handle...` functions, which pull out some reused
 * functionality into self-contained functions.
 *
 * The functions return ParseNodes.
 */
class Parser {
  constructor(input, settings) {
    this.mode = void 0;
    this.gullet = void 0;
    this.settings = void 0;
    this.leftrightDepth = void 0;
    this.nextToken = void 0;
    // Start in math mode
    this.mode = "math";
    // Create a new macro expander (gullet) and (indirectly via that) also a
    // new lexer (mouth) for this parser (stomach, in the language of TeX)
    this.gullet = new MacroExpander(input, settings, this.mode);
    // Store the settings for use in parsing
    this.settings = settings;
    // Count leftright depth (for \middle errors)
    this.leftrightDepth = 0;
    this.nextToken = null;
  }
  /**
   * Checks a result to make sure it has the right type, and throws an
   * appropriate error otherwise.
   */
  expect(text, consume) {
    if (consume === void 0) {
      consume = true;
    }
    if (this.fetch().text !== text) {
      throw new ParseError("Expected '" + text + "', got '" + this.fetch().text + "'", this.fetch());
    }
    if (consume) {
      this.consume();
    }
  }
  /**
   * Discards the current lookahead token, considering it consumed.
   */
  consume() {
    this.nextToken = null;
  }
  /**
   * Return the current lookahead token, or if there isn't one (at the
   * beginning, or if the previous lookahead token was consume()d),
   * fetch the next token as the new lookahead token and return it.
   */
  fetch() {
    if (this.nextToken == null) {
      this.nextToken = this.gullet.expandNextToken();
    }
    return this.nextToken;
  }
  /**
   * Switches between "text" and "math" modes.
   */
  switchMode(newMode) {
    this.mode = newMode;
    this.gullet.switchMode(newMode);
  }
  /**
   * Main parsing function, which parses an entire input.
   */
  parse() {
    if (!this.settings.globalGroup) {
      // Create a group namespace for the math expression.
      // (LaTeX creates a new group for every $...$, $$...$$, \[...\].)
      this.gullet.beginGroup();
    }
    // Use old \color behavior (same as LaTeX's \textcolor) if requested.
    // We do this within the group for the math expression, so it doesn't
    // pollute settings.macros.
    if (this.settings.colorIsTextColor) {
      this.gullet.macros.set("\\color", "\\textcolor");
    }
    try {
      // Try to parse the input
      var parse = this.parseExpression(false);
      // If we succeeded, make sure there's an EOF at the end
      this.expect("EOF");
      // End the group namespace for the expression
      if (!this.settings.globalGroup) {
        this.gullet.endGroup();
      }
      return parse;
      // Close any leftover groups in case of a parse error.
    } finally {
      this.gullet.endGroups();
    }
  }
  /**
   * Fully parse a separate sequence of tokens as a separate job.
   * Tokens should be specified in reverse order, as in a MacroDefinition.
   */
  subparse(tokens) {
    // Save the next token from the current job.
    var oldToken = this.nextToken;
    this.consume();
    // Run the new job, terminating it with an excess '}'
    this.gullet.pushToken(new Token("}"));
    this.gullet.pushTokens(tokens);
    var parse = this.parseExpression(false);
    this.expect("}");
    // Restore the next token from the current job.
    this.nextToken = oldToken;
    return parse;
  }
  /**
   * Parses an "expression", which is a list of atoms.
   *
   * `breakOnInfix`: Should the parsing stop when we hit infix nodes? This
   *                 happens when functions have higher precedence than infix
   *                 nodes in implicit parses.
   *
   * `breakOnTokenText`: The text of the token that the expression should end
   *                     with, or `null` if something else should end the
   *                     expression.
   */
  parseExpression(breakOnInfix, breakOnTokenText) {
    var body = [];
    // Keep adding atoms to the body until we can't parse any more atoms (either
    // we reached the end, a }, or a \right)
    while (true) {
      // Ignore spaces in math mode
      if (this.mode === "math") {
        this.consumeSpaces();
      }
      var lex = this.fetch();
      if (Parser.endOfExpression.has(lex.text)) {
        break;
      }
      if (breakOnTokenText && lex.text === breakOnTokenText) {
        break;
      }
      if (breakOnInfix && functions[lex.text] && functions[lex.text].infix) {
        break;
      }
      var atom = this.parseAtom(breakOnTokenText);
      if (!atom) {
        break;
      } else if (atom.type === "internal") {
        // Internal nodes do not appear in parse tree
        continue;
      }
      body.push(atom);
    }
    if (this.mode === "text") {
      this.formLigatures(body);
    }
    return this.handleInfixNodes(body);
  }
  /**
   * Rewrites infix operators such as \over with corresponding commands such
   * as \frac.
   *
   * There can only be one infix operator per group.  If there's more than one
   * then the expression is ambiguous.  This can be resolved by adding {}.
   */
  handleInfixNodes(body) {
    var overIndex = -1;
    var funcName;
    for (var i = 0; i < body.length; i++) {
      var node = body[i];
      if (node.type === "infix") {
        if (overIndex !== -1) {
          throw new ParseError("only one infix operator per group", node.token);
        }
        overIndex = i;
        funcName = node.replaceWith;
      }
    }
    if (overIndex !== -1 && funcName) {
      var numerNode;
      var denomNode;
      var numerBody = body.slice(0, overIndex);
      var denomBody = body.slice(overIndex + 1);
      if (numerBody.length === 1 && numerBody[0].type === "ordgroup") {
        numerNode = numerBody[0];
      } else {
        numerNode = {
          type: "ordgroup",
          mode: this.mode,
          body: numerBody
        };
      }
      if (denomBody.length === 1 && denomBody[0].type === "ordgroup") {
        denomNode = denomBody[0];
      } else {
        denomNode = {
          type: "ordgroup",
          mode: this.mode,
          body: denomBody
        };
      }
      var _node;
      if (funcName === "\\\\abovefrac") {
        _node = this.callFunction(funcName, [numerNode, body[overIndex], denomNode], []);
      } else {
        _node = this.callFunction(funcName, [numerNode, denomNode], []);
      }
      return [_node];
    } else {
      return body;
    }
  }
  /**
   * Handle a subscript or superscript with nice errors.
   */
  handleSupSubscript(name) {
    var symbolToken = this.fetch();
    var symbol = symbolToken.text;
    this.consume();
    this.consumeSpaces(); // ignore spaces before sup/subscript argument
    // Skip over allowed internal nodes such as \relax
    var group;
    do {
      var _group;
      group = this.parseGroup(name);
    } while (((_group = group) == null ? void 0 : _group.type) === "internal");
    if (!group) {
      throw new ParseError("Expected group after '" + symbol + "'", symbolToken);
    }
    return group;
  }
  /**
   * Converts the textual input of an unsupported command into a text node
   * contained within a color node whose color is determined by errorColor
   */
  formatUnsupportedCmd(text) {
    var textordArray = [];
    for (var i = 0; i < text.length; i++) {
      textordArray.push({
        type: "textord",
        mode: "text",
        text: text[i]
      });
    }
    var textNode = {
      type: "text",
      mode: this.mode,
      body: textordArray
    };
    var colorNode = {
      type: "color",
      mode: this.mode,
      color: this.settings.errorColor,
      body: [textNode]
    };
    return colorNode;
  }
  /**
   * Parses a group with optional super/subscripts.
   */
  parseAtom(breakOnTokenText) {
    // The body of an atom is an implicit group, so that things like
    // \left(x\right)^2 work correctly.
    var base = this.parseGroup("atom", breakOnTokenText);
    // Internal nodes (e.g. \relax) cannot support super/subscripts.
    // Instead we will pick up super/subscripts with blank base next round.
    if ((base == null ? void 0 : base.type) === "internal") {
      return base;
    }
    // In text mode, we don't have superscripts or subscripts
    if (this.mode === "text") {
      return base;
    }
    // Note that base may be empty (i.e. null) at this point.
    var superscript;
    var subscript;
    while (true) {
      // Guaranteed in math mode, so eat any spaces first.
      this.consumeSpaces();
      // Lex the first token
      var lex = this.fetch();
      if (lex.text === "\\limits" || lex.text === "\\nolimits") {
        // We got a limit control
        if (base && base.type === "op") {
          var limits = lex.text === "\\limits";
          base.limits = limits;
          base.alwaysHandleSupSub = true;
        } else if (base && base.type === "operatorname") {
          if (base.alwaysHandleSupSub) {
            base.limits = lex.text === "\\limits";
          }
        } else {
          throw new ParseError("Limit controls must follow a math operator", lex);
        }
        this.consume();
      } else if (lex.text === "^") {
        // We got a superscript start
        if (superscript) {
          throw new ParseError("Double superscript", lex);
        }
        superscript = this.handleSupSubscript("superscript");
      } else if (lex.text === "_") {
        // We got a subscript start
        if (subscript) {
          throw new ParseError("Double subscript", lex);
        }
        subscript = this.handleSupSubscript("subscript");
      } else if (lex.text === "'") {
        // We got a prime
        if (superscript) {
          throw new ParseError("Double superscript", lex);
        }
        var prime = {
          type: "textord",
          mode: this.mode,
          text: "\\prime"
        };
        // Many primes can be grouped together, so we handle this here
        var primes = [prime];
        this.consume();
        // Keep lexing tokens until we get something that's not a prime
        while (this.fetch().text === "'") {
          // For each one, add another prime to the list
          primes.push(prime);
          this.consume();
        }
        // If there's a superscript following the primes, combine that
        // superscript in with the primes.
        if (this.fetch().text === "^") {
          primes.push(this.handleSupSubscript("superscript"));
        }
        // Put everything into an ordgroup as the superscript
        superscript = {
          type: "ordgroup",
          mode: this.mode,
          body: primes
        };
      } else if (uSubsAndSups[lex.text]) {
        // A Unicode subscript or superscript character.
        // We treat these similarly to the unicode-math package.
        // So we render a string of Unicode (sub|super)scripts the
        // same as a (sub|super)script of regular characters.
        var isSub = unicodeSubRegEx.test(lex.text);
        var subsupTokens = [];
        subsupTokens.push(new Token(uSubsAndSups[lex.text]));
        this.consume();
        // Continue fetching tokens to fill out the string.
        while (true) {
          var token = this.fetch().text;
          if (!uSubsAndSups[token]) {
            break;
          }
          if (unicodeSubRegEx.test(token) !== isSub) {
            break;
          }
          subsupTokens.unshift(new Token(uSubsAndSups[token]));
          this.consume();
        }
        // Now create a (sub|super)script.
        var body = this.subparse(subsupTokens);
        if (isSub) {
          subscript = {
            type: "ordgroup",
            mode: "math",
            body
          };
        } else {
          superscript = {
            type: "ordgroup",
            mode: "math",
            body
          };
        }
      } else {
        // If it wasn't ^, _, or ', stop parsing super/subscripts
        break;
      }
    }
    // Base must be set if superscript or subscript are set per logic above,
    // but need to check here for type check to pass.
    if (superscript || subscript) {
      // If we got either a superscript or subscript, create a supsub
      return {
        type: "supsub",
        mode: this.mode,
        base: base,
        sup: superscript,
        sub: subscript
      };
    } else {
      // Otherwise return the original body
      return base;
    }
  }
  /**
   * Parses an entire function, including its base and all of its arguments.
   */
  parseFunction(breakOnTokenText, name) {
    var token = this.fetch();
    var func = token.text;
    var funcData = functions[func];
    if (!funcData) {
      return null;
    }
    this.consume(); // consume command token
    if (name && name !== "atom" && !funcData.allowedInArgument) {
      throw new ParseError("Got function '" + func + "' with no arguments" + (name ? " as " + name : ""), token);
    } else if (this.mode === "text" && !funcData.allowedInText) {
      throw new ParseError("Can't use function '" + func + "' in text mode", token);
    } else if (this.mode === "math" && funcData.allowedInMath === false) {
      throw new ParseError("Can't use function '" + func + "' in math mode", token);
    }
    var {
      args,
      optArgs
    } = this.parseArguments(func, funcData);
    return this.callFunction(func, args, optArgs, token, breakOnTokenText);
  }
  /**
   * Call a function handler with a suitable context and arguments.
   */
  callFunction(name, args, optArgs, token, breakOnTokenText) {
    var context = {
      funcName: name,
      parser: this,
      token,
      breakOnTokenText
    };
    var func = functions[name];
    if (func && func.handler) {
      return func.handler(context, args, optArgs);
    } else {
      throw new ParseError("No function handler for " + name);
    }
  }
  /**
   * Parses the arguments of a function or environment
   */
  parseArguments(func,
  // Should look like "\name" or "\begin{name}".
  funcData) {
    var totalArgs = funcData.numArgs + funcData.numOptionalArgs;
    if (totalArgs === 0) {
      return {
        args: [],
        optArgs: []
      };
    }
    var args = [];
    var optArgs = [];
    for (var i = 0; i < totalArgs; i++) {
      var argType = funcData.argTypes && funcData.argTypes[i];
      var isOptional = i < funcData.numOptionalArgs;
      if ("primitive" in funcData && funcData.primitive && argType == null ||
      // \sqrt expands into primitive if optional argument doesn't exist
      funcData.type === "sqrt" && i === 1 && optArgs[0] == null) {
        argType = "primitive";
      }
      var arg = this.parseGroupOfType("argument to '" + func + "'", argType, isOptional);
      if (isOptional) {
        optArgs.push(arg);
      } else if (arg != null) {
        args.push(arg);
      } else {
        // should be unreachable
        throw new ParseError("Null argument, please report this as a bug");
      }
    }
    return {
      args,
      optArgs
    };
  }
  /**
   * Parses a group when the mode is changing.
   */
  parseGroupOfType(name, type, optional) {
    switch (type) {
      case "color":
        return this.parseColorGroup(optional);
      case "size":
        return this.parseSizeGroup(optional);
      case "url":
        return this.parseUrlGroup(optional);
      case "math":
      case "text":
        return this.parseArgumentGroup(optional, type);
      case "hbox":
        {
          // hbox argument type wraps the argument in the equivalent of
          // \hbox, which is like \text but switching to \textstyle size
          // and resetting math font.
          var group = this.parseArgumentGroup(optional, "text");
          return group != null ? {
            type: "styling",
            mode: group.mode,
            body: [group],
            style: "text",
            // simulate \textstyle
            resetFont: true
          } : null;
        }
      case "raw":
        {
          var token = this.parseStringGroup("raw", optional);
          return token != null ? {
            type: "raw",
            mode: "text",
            string: token.text
          } : null;
        }
      case "primitive":
        {
          if (optional) {
            throw new ParseError("A primitive argument cannot be optional");
          }
          var _group2 = this.parseGroup(name);
          if (_group2 == null) {
            throw new ParseError("Expected group as " + name, this.fetch());
          }
          return _group2;
        }
      case "original":
      case null:
      case undefined:
        return this.parseArgumentGroup(optional);
      default:
        throw new ParseError("Unknown group type as " + name, this.fetch());
    }
  }
  /**
   * Discard any space tokens, fetching the next non-space token.
   */
  consumeSpaces() {
    while (this.fetch().text === " ") {
      this.consume();
    }
  }
  /**
   * Parses a group, essentially returning the string formed by the
   * brace-enclosed tokens plus some position information.
   */
  parseStringGroup(modeName,
  // Used to describe the mode in error messages.
  optional) {
    var argToken = this.gullet.scanArgument(optional);
    if (argToken == null) {
      return null;
    }
    var str = "";
    var nextToken;
    while ((nextToken = this.fetch()).text !== "EOF") {
      str += nextToken.text;
      this.consume();
    }
    this.consume(); // consume the end of the argument
    argToken.text = str;
    return argToken;
  }
  /**
   * Parses a regex-delimited group: the largest sequence of tokens
   * whose concatenated strings match `regex`. Returns the string
   * formed by the tokens plus some position information.
   */
  parseRegexGroup(regex, modeName) {
    var firstToken = this.fetch();
    var lastToken = firstToken;
    var str = "";
    var nextToken;
    while ((nextToken = this.fetch()).text !== "EOF" && regex.test(str + nextToken.text)) {
      lastToken = nextToken;
      str += lastToken.text;
      this.consume();
    }
    if (str === "") {
      throw new ParseError("Invalid " + modeName + ": '" + firstToken.text + "'", firstToken);
    }
    return firstToken.range(lastToken, str);
  }
  /**
   * Parses a color description.
   */
  parseColorGroup(optional) {
    var res = this.parseStringGroup("color", optional);
    if (res == null) {
      return null;
    }
    var match = /^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i.exec(res.text);
    if (!match) {
      throw new ParseError("Invalid color: '" + res.text + "'", res);
    }
    var color = match[0];
    if (/^[0-9a-f]{6}$/i.test(color)) {
      // We allow a 6-digit HTML color spec without a leading "#".
      // This follows the xcolor package's HTML color model.
      // Predefined color names are all missed by this RegEx pattern.
      color = "#" + color;
    }
    return {
      type: "color-token",
      mode: this.mode,
      color
    };
  }
  /**
   * Parses a size specification, consisting of magnitude and unit.
   */
  parseSizeGroup(optional) {
    var res;
    var isBlank = false;
    // don't expand before parseStringGroup
    this.gullet.consumeSpaces();
    if (!optional && this.gullet.future().text !== "{") {
      res = this.parseRegexGroup(/^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/, "size");
    } else {
      res = this.parseStringGroup("size", optional);
    }
    if (!res) {
      return null;
    }
    if (!optional && res.text.length === 0) {
      // Because we've tested for what is !optional, this block won't
      // affect \kern, \hspace, etc. It will capture the mandatory arguments
      // to \genfrac and \above.
      res.text = "0pt"; // Enable \above{}
      isBlank = true; // This is here specifically for \genfrac
    }
    var match = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(res.text);
    if (!match) {
      throw new ParseError("Invalid size: '" + res.text + "'", res);
    }
    var data = {
      number: +(match[1] + match[2]),
      // sign + magnitude, cast to number
      unit: match[3]
    };
    if (!validUnit(data)) {
      throw new ParseError("Invalid unit: '" + data.unit + "'", res);
    }
    return {
      type: "size",
      mode: this.mode,
      value: data,
      isBlank
    };
  }
  /**
   * Parses an URL, checking escaped letters and allowed protocols,
   * and setting the catcode of % as an active character (as in \hyperref).
   */
  parseUrlGroup(optional) {
    this.gullet.lexer.setCatcode("%", 13); // active character
    this.gullet.lexer.setCatcode("~", 12); // other character
    var res = this.parseStringGroup("url", optional);
    this.gullet.lexer.setCatcode("%", 14); // comment character
    this.gullet.lexer.setCatcode("~", 13); // active character
    if (res == null) {
      return null;
    }
    // hyperref package allows backslashes alone in href, but doesn't
    // generate valid links in such cases; we interpret this as
    // "undefined" behaviour, and keep them as-is. Some browser will
    // replace backslashes with forward slashes.
    var url = res.text.replace(/\\([#$%&~_^{}])/g, '$1');
    return {
      type: "url",
      mode: this.mode,
      url
    };
  }
  /**
   * Parses an argument with the mode specified.
   */
  parseArgumentGroup(optional, mode) {
    var argToken = this.gullet.scanArgument(optional);
    if (argToken == null) {
      return null;
    }
    var outerMode = this.mode;
    if (mode) {
      // Switch to specified mode
      this.switchMode(mode);
    }
    this.gullet.beginGroup();
    var expression = this.parseExpression(false, "EOF");
    // TODO: find an alternative way to denote the end
    this.expect("EOF"); // expect the end of the argument
    this.gullet.endGroup();
    var result = {
      type: "ordgroup",
      mode: this.mode,
      loc: argToken.loc,
      body: expression
    };
    if (mode) {
      // Switch mode back
      this.switchMode(outerMode);
    }
    return result;
  }
  /**
   * Parses an ordinary group, which is either a single nucleus (like "x")
   * or an expression in braces (like "{x+y}") or an implicit group, a group
   * that starts at the current position, and ends right before a higher explicit
   * group ends, or at EOF.
   */
  parseGroup(name,
  // For error reporting.
  breakOnTokenText) {
    var firstToken = this.fetch();
    var text = firstToken.text;
    var result;
    // Try to parse an open brace or \begingroup
    if (text === "{" || text === "\\begingroup") {
      this.consume();
      var groupEnd = text === "{" ? "}" : "\\endgroup";
      this.gullet.beginGroup();
      // If we get a brace, parse an expression
      var expression = this.parseExpression(false, groupEnd);
      var lastToken = this.fetch();
      this.expect(groupEnd); // Check that we got a matching closing brace
      this.gullet.endGroup();
      result = {
        type: "ordgroup",
        mode: this.mode,
        loc: SourceLocation.range(firstToken, lastToken),
        body: expression,
        // A group formed by \begingroup...\endgroup is a semi-simple group
        // which doesn't affect spacing in math mode, i.e., is transparent.
        // https://tex.stackexchange.com/questions/1930/when-should-one-
        // use-begingroup-instead-of-bgroup
        semisimple: text === "\\begingroup" || undefined
      };
    } else {
      // If there exists a function with this name, parse the function.
      // Otherwise, just return a nucleus
      result = this.parseFunction(breakOnTokenText, name) || this.parseSymbol();
      if (result == null && text[0] === "\\" && !implicitCommands.hasOwnProperty(text)) {
        if (this.settings.throwOnError) {
          throw new ParseError("Undefined control sequence: " + text, firstToken);
        }
        result = this.formatUnsupportedCmd(text);
        this.consume();
      }
    }
    return result;
  }
  /**
   * Form ligature-like combinations of characters for text mode.
   * This includes inputs like "--", "---", "``" and "''".
   * The result will simply replace multiple textord nodes with a single
   * character in each value by a single textord node having multiple
   * characters in its value.  The representation is still ASCII source.
   * The group will be modified in place.
   */
  formLigatures(group) {
    var n = group.length - 1;
    for (var i = 0; i < n; ++i) {
      var a = group[i];
      if (a.type !== "textord") {
        continue;
      }
      var v = a.text;
      var next = group[i + 1];
      if (!next || next.type !== "textord") {
        continue;
      }
      if (v === "-" && next.text === "-") {
        var afterNext = group[i + 2];
        if (i + 1 < n && afterNext && afterNext.type === "textord" && afterNext.text === "-") {
          group.splice(i, 3, {
            type: "textord",
            mode: "text",
            loc: SourceLocation.range(a, afterNext),
            text: "---"
          });
          n -= 2;
        } else {
          group.splice(i, 2, {
            type: "textord",
            mode: "text",
            loc: SourceLocation.range(a, next),
            text: "--"
          });
          n -= 1;
        }
      }
      if ((v === "'" || v === "`") && next.text === v) {
        group.splice(i, 2, {
          type: "textord",
          mode: "text",
          loc: SourceLocation.range(a, next),
          text: v + v
        });
        n -= 1;
   L,   }
    }
  }
  /**
   * Parse a single symbol out of the string. Here, we handle single character
   * symbols and special functions like \verb.
   */
  parseSymbol() {
    var nucleus = this.fetch();
    var text = nucleus.text;
    if (/^\\verb[^a-zA-Z]/.test(text)) {
      this.consume();
      var arg = text.slice(5);
      var star = arg.charAt(0) === "*";
      if (star) {
        arg = arg.slice(1);
      }
      // Lexer's tokenRegex is constructed to always have matching
      // first/last characters.
      if (arg.length < 2 || arg.charAt(0) !== arg.slice(-1)) {
        throw new ParseError("\\verb assertion failed --\n                    please report what input caused this bug");
      }
      arg = arg.slice(1, -1); // remove first and last char
      return {
        type: "verb",
        mode: "text",
        body: arg,
        star
      };
    }
    // At this point, we should have a symbol, possibly with accents.
    // First expand any accented base symbol according to unicodeSymbols.
    if (unicodeSymbols.hasOwnProperty(text[0]) && !symbols[this.mode][text[0]]) {
      // This behavior is not strict (XeTeX-compatible) in math mode.
      if (this.settings.strict && this.mode === "math") {
        this.settings.reportNonstrict("unicodeTextInMathMode", "Accented Unicode text character \"" + text[0] + "\" used in " + "math mode", nucleus);
      }
      text = unicodeSymbols[text[0]] + text.slice(1);
    }
    // Strip off any combining characters
    var match = combiningDiacriticalMarksEndRegex.exec(text);
    if (match) {
      text = text.substring(0, match.index);
      if (text === 'i') {
        text = '\u0131'; // dotless i, in math and text mode
      } else if (text === 'j') {
        text = '\u0237'; // dotless j, in math and text mode
      }
    }
    // Recognize base symbol
    var symbol;
    if (symbols[this.mode][text]) {
      if (this.settings.strict && this.mode === 'math' && extraLatin.includes(text)) {
        this.settings.reportNonstrict("unicodeTextInMathMode", "Latin-1/Unicode text character \"" + text[0] + "\" used in " + "math mode", nucleus);
      }
      var group = symbols[this.mode][text].group;
      var loc = SourceLocation.range(nucleus);
      var s;
      if (isAtom(group)) {
        s = {
          type: "atom",
          mode: this.mode,
          family: group,
          loc,
          text
        };
      } else {
        s = {
          type: group,
          mode: this.mode,
          loc,
          text
        };
      }
      symbol = s;
    } else if (text.charCodeAt(0) >= 0x80) {
      // no symbol for e.g. ^
      if (this.settings.strict) {
        if (!supportedCodepoint(text.charCodeAt(0))) {
          this.settings.reportNonstrict("unknownSymbol", "Unrecognized Unicode character \"" + text[0] + "\"" + (" (" + text.charCodeAt(0) + ")"), nucleus);
        } else if (this.mode === "math") {
          this.settings.reportNonstrict("unicodeTextInMathMode", "Unicode text character \"" + text[0] + "\" used in math mode", nucleus);
        }
      }
      // All nonmathematical Unicode characters are rendered as if they
      // are in text mode (wrapped in \text) because that's what it
      // takes to render them in LaTeX.  Setting `mode: this.mode` is
      // another natural choice (the user requested math mode), but
      // this makes it more difficult for getCharacterMetrics() to
      // distinguish Unicode characters without metrics and those for
      // which we want to simulate the letter M.
      symbol = {
        type: "textord",
        mode: "text",
        loc: SourceLocation.range(nucleus),
        text
      };
    } else {
      return null; // EOF, ^, _, {, }, etc.
    }
    this.consume();
    // Transform combining characters into accents
    if (match) {
      for (var i = 0; i < match[0].length; i++) {
        var accent = match[0][i];
        if (!unicodeAccents[accent]) {
          throw new ParseError("Unknown accent ' " + accent + "'", nucleus);
        }
        var command = unicodeAccents[accent][this.mode] || unicodeAccents[accent].text;
        if (!command) {
          throw new ParseError("Accent " + accent + " unsupported in " + this.mode + " mode", nucleus);
        }
        symbol = {
          type: "accent",
          mode: this.mode,
          loc: SourceLocation.range(nucleus),
          label: command,
          isStretchy: false,
          isShifty: true,
          base: symbol
        };
      }
    }
    return symbol;
  }
}
Parser.endOfExpression = new Set(["}", "\\endgroup", "\\end", "\\right", "&"]);

/**
 * Provides a single function for parsing an expression using a Parser
 * TODO(emily): Remove this
 */
/**
 * Parses an expression using a Parser, then returns the parsed result.
 */
var parseTree = function parseTree(toParse, settings) {
  if (!(typeof toParse === 'string' || toParse instanceof String)) {
    throw new TypeError('KaTeX can only parse string typed expression');
  }
  var parser = new Parser(toParse, settings);
  // Blank out any \df@tag to avoid spurious "Duplicate \tag" errors
  delete parser.gullet.macros.current["\\df@tag"];
  var tree = parser.parse();
  // Prevent a color definition from persisting between calls to katex.render().
  delete parser.gullet.macros.current["\\current@color"];
  delete parser.gullet.macros.current["\\color"];
  // If the input used \tag, it will set the \df@tag macro to the tag.
  // In this case, we separately parse the tag and wrap the tree.
  if (parser.gullet.macros.get("\\df@tag")) {
    if (!settings.displayMode) {
      throw new ParseError("\\tag works only in display equations");
    }
    tree = [{
      type: "tag",
      mode: "text",
      body: tree,
      tag: parser.subparse([new Token("\\df@tag")])
    }];
  }
  return tree;
};

/* eslint no-console:0 */
/**
 * Parse and build an expression, and place that expression in the DOM node
 * given.
 */
var render = function render(expression, baseNode, options) {
  baseNode.textContent = "";
  var node = renderToDomTree(expression, options).toNode();
  baseNode.appendChild(node);
};
// KaTeX's styles don't work properly in quirks mode. Print out an error, and
// disable rendering.
if (typeof document !== "undefined") {
  if (document.compatMode !== "CSS1Compat") {
    typeof console !== "undefined" && console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your " + "website has a suitable doctype.");
    render = function render() {
      throw new ParseError("KaTeX doesn't work in quirks mode.");
    };
  }
}
/**
 * Parse and build an expression, and return the markup for that.
 */
var renderToString = function renderToString(expression, options) {
  var markup = renderToDomTree(expression, options).toMarkup();
  return markup;
};
/**
 * Parse an expression and return the parse tree.
 */
var generateParseTree = function generateParseTree(expression, options) {
  var settings = new Settings(options);
  return parseTree(expression, settings);
};
/**
 * If the given error is a KaTeX ParseError and options.throwOnError is false,
 * renders the invalid LaTeX as a span with hover title giving the KaTeX
 * error message.  Otherwise, simply throws the error.
 */
var renderError = function renderError(error, expression, options) {
  if (options.throwOnError || !(error instanceof ParseError)) {
    throw error;
  }
  var node = makeSpan(["katex-error"], [new SymbolNode(expression)]);
  node.setAttribute("title", error.toString());
  node.setAttribute("style", "color:" + options.errorColor);
  return node;
};
/**
 * Generates and returns the katex build tree. This is used for advanced
 * use cases (like rendering to custom output).
 */
var renderToDomTree = function renderToDomTree(expression, options) {
  var settings = new Settings(options);
  try {
    var tree = parseTree(expression, settings);
    return buildTree(tree, expression, settings);
  } catch (error) {
    return renderError(error, expression, settings);
  }
};
/**
 * Generates and returns the katex build tree, with just HTML (no MathML).
 * This is used for advanced use cases (like rendering to custom output).
 */
var renderToHTMLTree = function renderToHTMLTree(expression, options) {
  var settings = new Settings(options);
  try {
    var tree = parseTree(expression, settings);
    return buildHTMLTree(tree, expression, settings);
  } catch (error) {
    return renderError(error, expression, settings);
  }
};
var version = "0.16.47";
var __domTree = {
  Span,
  Anchor,
  SymbolNode,
  SvgNode,
  PathNode,
  LineNode
};
// CJS exports and ESM default export
var katex = {
  /**
   * Current KaTeX version
   */
  version,
  /**
   * Renders the given LaTeX into an HTML+MathML combination, and adds
   * it as a child to the specified DOM node.
   */
  render,
  /**
   * Renders the given LaTeX into an HTML+MathML combination string,
   * for sending to the client.
   */
  renderToString,
  /**
   * KaTeX error, usually during parsing.
   */
  ParseError,
  /**
   * The schema of Settings
   */
  SETTINGS_SCHEMA,
  /**
   * Parses the given LaTeX into KaTeX's internal parse tree structure,
   * without rendering to HTML or MathML.
   *
   * NOTE: This method is not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __parse: generateParseTree,
  /**
   * Renders the given LaTeX into an HTML+MathML internal DOM tree
   * representation, without flattening that representation to a string.
   *
   * NOTE: This method is not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __renderToDomTree: renderToDomTree,
  /**
   * Renders the given LaTeX into an HTML internal DOM tree representation,
   * without MathML and without flattening that representation to a string.
   *
   * NOTE: This method is not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __renderToHTMLTree: renderToHTMLTree,
  /**
   * extends internal font metrics object with a new object
   * each key in the new object represents a font name
  */
  __setFontMetrics: setFontMetrics,
  /**
   * adds a new symbol to builtin symbols table
   */
  __defineSymbol: defineSymbol,
  /**
   * adds a new function to builtin function list,
   * which directly produce parse tree elements
   * and have their own html/mathml builders
   */
  __defineFunction: defineFunction,
  /**
   * adds a new macro to builtin macro list
   */
  __defineMacro: defineMacro,
  /**
   * Expose the dom tree node types, which can be useful for type checking nodes.
   *
   * NOTE: These methods are not currently recommended for public use.
   * The internal tree representation is unstable and is very likely
   * to change. Use at your own risk.
   */
  __domTree
};

export { ParseError, SETTINGS_SCHEMA, defineFunction as __defineFunction, defineMacro as __defineMacro, defineSymbol as __defineSymbol, __domTree, generateParseTree as __parse, renderToDomTree as __renderToDomTree, renderToHTMLTree as __renderToHTMLTree, setFontMetrics as __setFontMetrics, katex as default, render, renderToString, version };
Zyx"/* eslint no-console:0 */
/**
 * This is the main entry point for KaTeX. Here, we expose functions for
 * rendering expressions either to DOM nodes or to markup strings.
 *
 * We also expose the ParseError class to check if errors thrown from KaTeX are
 * errors in the expression, or errors in javascript handling.
 */

import ParseError from "./src/ParseError";
import Settings, {SETTINGS_SCHEMA} from "./src/Settings";

import {buildTree, buildHTMLTree} from "./src/buildTree";
import parseTree from "./src/parseTree";
import {makeSpan} from "./src/buildCommon";
import {
    Span,
    Anchor,
    SymbolNode,
    SvgNode,
    PathNode,
    LineNode,
} from "./src/domTree";

import type {SettingsOptions} from "./src/Settings";
import type {AnyParseNode} from "./src/parseNode";
import type {DomSpan} from "./src/domTree";

import {defineSymbol} from './src/symbols';
import defineFunction from './src/defineFunction';
import defineMacro from './src/defineMacro';
import {setFontMetrics} from './src/fontMetrics';

declare let __VERSION__: string;

/**
 * Parse and build an expression, and place that expression in the DOM node
 * given.
 */
let render: (
    expression: string,
    baseNode: Node,
    options: SettingsOptions,
) => void = function(
    expression: string,
    baseNode: Node,
    options: SettingsOptions,
) {
    baseNode.textContent = "";
    const node = renderToDomTree(expression, options).toNode();
    baseNode.appendChild(node);
};

// KaTeX's styles don't work properly in quirks mode. Print out an error, and
// disable rendering.
if (typeof document !== "undefined") {
    if (document.compatMode !== "CSS1Compat") {
        typeof console !== "undefined" && console.warn(
            "Warning: KaTeX doesn't work in quirks mode. Make sure your " +
                "website has a suitable doctype.");

        render = function() {
            throw new ParseError("KaTeX doesn't work in quirks mode.");
        };
    }
}

/**
 * Parse and build an expression, and return the markup for that.
 */
const renderToString = function(
    expression: string,
    options: SettingsOptions,
): string {
    const markup = renderToDomTree(expression, options).toMarkup();
    return markup;
};

/**
 * Parse an expression and return the parse tree.
 */
const generateParseTree = function(
    expression: string,
    options?: SettingsOptions,
): AnyParseNode[] {
    const settings = new Settings(options);
    return parseTree(expression, settings);
};

/**
 * If the given error is a KaTeX ParseError and options.throwOnError is false,
 * renders the invalid LaTeX as a span with hover title giving the KaTeX
 * error message.  Otherwise, simply throws the error.
 */
const renderError = function(
    error: unknown,
    expression: string,
    options: Settings,
) {
    if (options.throwOnError || !(error instanceof ParseError)) {
        throw error;
    }
    const node = makeSpan(["katex-error"],
        [new SymbolNode(expression)]);
    node.setAttribute("title", error.toString());
    node.setAttribute("style", `color:${options.errorColor}`);
    return node;
};

/**
 * Generates and returns the katex build tree. This is used for advanced
 * use cases (like rendering to custom output).
 */
const renderToDomTree = function(
    expression: string,
    options: SettingsOptions,
): DomSpan {
    const settings = new Settings(options);
    try {
        const tree = parseTree(expression, settings);
        return buildTree(tree, expression, settings);
    } catch (error) {
        return renderError(error, expression, settings);
    }
};

/**
 * Generates and returns the katex build tree, with just HTML (no MathML).
 * This is used for advanced use cases (like rendering to custom output).
 */
const renderToHTMLTree = function(
    expression: string,
    options: SettingsOptions,
): DomSpan {
    const settings = new Settings(options);
    try {
        const tree = parseTree(expression, settings);
        return buildHTMLTree(tree, expression, settings);
    } catch (error) {
        return renderError(error, expression, settings);
    }
};

const version = __VERSION__;

const __domTree = {
    Span,
    Anchor,
    SymbolNode,
    SvgNode,
    PathNode,
    LineNode,
};

// ESM exports
export {
    version,
    render,
    renderToString,
    ParseError,
    SETTINGS_SCHEMA,
    generateParseTree as __parse,
    renderToDomTree as __renderToDomTree,
    renderToHTMLTree as __renderToHTMLTree,
    setFontMetrics as __setFontMetrics,
    defineSymbol as __defineSymbol,
    defineFunction as __defineFunction,
    defineMacro as __defineMacro,
    __domTree,
};

// CJS exports and ESM default export
export default {
    /**
     * Current KaTeX version
     */
    version,
    /**
     * Renders the given LaTeX into an HTML+MathML combination, and adds
     * it as a child to the specified DOM node.
     */
    render,
    /**
     * Renders the given LaTeX into an HTML+MathML combination string,
     * for sending to the client.
     */
    renderToString,
    /**
     * KaTeX error, usually during parsing.
     */
    ParseError,
    /**
     * The schema of Settings
     */
    SETTINGS_SCHEMA,
    /**
     * Parses the given LaTeX into KaTeX's internal parse tree structure,
     * without rendering to HTML or MathML.
     *
     * NOTE: This method is not currently recommended for public use.
     * The internal tree representation is unstable and is very likely
     * to change. Use at your own risk.
     */
    __parse: generateParseTree,
    /**
     * Renders the given LaTeX into an HTML+MathML internal DOM tree
     * representation, without flattening that representation to a string.
     *
     * NOTE: This method is not currently recommended for public use.
     * The internal tree representation is unstable and is very likely
     * to change. Use at your own risk.
     */
    __renderToDomTree: renderToDomTree,
    /**
     * Renders the given LaTeX into an HTML internal DOM tree representation,
     * without MathML and without flattening that representation to a string.
     *
     * NOTE: This method is not currently recommended for public use.
     * The internal tree representation is unstable and is very likely
     * to change. Use at your own risk.
     */
    __renderToHTMLTree: renderToHTMLTree,
    /**
     * extends internal font metrics object with a new object
     * each key in the new object represents a font name
    */
    __setFontMetrics: setFontMetrics,
    /**
     * adds a new symbol to builtin symbols table
     */
    __defineSymbol: defineSymbol,
    /**
     * adds a new function to builtin function list,
     * which directly produce parse tree elements
     * and have their own html/mathml builders
     */
    __defineFunction: defineFunction,
    /**
     * adds a new macro to builtin macro list
     */
    __defineMacro: defineMacro,
    /**
     * Expose the dom tree node types, which can be useful for type checking nodes.
     *
     * NOTE: These methods are not currently recommended for public use.
     * The internal tree representation is unstable and is very likely
     * to change. Use at your own risk.
     */
    __domTree,
};
x{
  "name": "katex",
  "version": "0.16.47",
  "description": "Fast math typesetting for the web.",
  "main": "dist/katex.js",
  "types": "types/katex.d.ts",
  "exports": {
    ".": {
      "require": {
        "types": "./types/katex.d.ts",
        "default": "./dist/katex.js"
      },
      "import": {
        "types": "./types/katex.d.ts",
        "default": "./dist/katex.mjs"
      }
    },
    "./contrib/auto-render": {
      "require": "./dist/contrib/auto-render.js",
      "import": "./dist/contrib/auto-render.mjs"
    },
    "./contrib/mhchem": {
      "require": "./dist/contrib/mhchem.js",
      "import": "./dist/contrib/mhchem.mjs"
    },
    "./contrib/copy-tex": {
      "require": "./dist/contrib/copy-tex.js",
      "import": "./dist/contrib/copy-tex.mjs"
    },
    "./contrib/mathtex-script-type": {
      "require": "./dist/contrib/mathtex-script-type.js",
      "import": "./dist/contrib/mathtex-script-type.mjs"
    },
    "./contrib/render-a11y-string": {
      "require": "./dist/contrib/render-a11y-string.js",
      "import": "./dist/contrib/render-a11y-string.mjs"
    },
    "./*": "./*"
  },
  "homepage": "https://katex.org",
  "repository": {
    "type": "git",
    "url": "https://github.com/KaTeX/KaTeX.git"
  },
  "funding": [
    "https://opencollective.com/katex",
    "https://github.com/sponsors/katex"
  ],
  "files": [
    "katex.ts",
    "cli.js",
    "src/",
    "contrib/",
    "dist/",
    "types/"
  ],
  "license": "MIT",
  "packageManager": "yarn@4.1.1",
  "devDependencies": {
    "@babel/core": "^7.29.0",
    "@babel/plugin-proposal-class-properties": "^7.18.6",
    "@babel/plugin-transform-react-jsx": "^7.28.6",
    "@babel/plugin-transform-runtime": "^7.29.0",
    "@babel/preset-env": "^7.29.0",
    "@babel/preset-react": "^7.28.5",
    "@babel/preset-typescript": "^7.28.5",
    "@babel/register": "^7.28.6",
    "@babel/runtime": "^7.28.6",
    "@eslint/eslintrc": "^3.3.5",
    "@eslint/js": "^10.0.1",
    "@rollup/plugin-babel": "^5.3.1",
    "@rollup/plugin-commonjs": "^28.0.9",
    "@rollup/plugin-typescript": "^12.3.0",
    "@semantic-release/changelog": "^6.0.1",
    "@semantic-release/git": "^10.0.1",
    "@stylistic/stylelint-plugin": "^5.1.0",
    "@typescript-eslint/eslint-plugin": "^8.59.1",
    "@typescript-eslint/parser": "^8.59.1",
    "babel-jest": "^30.2.0",
    "babel-loader": "^8.2.5",
    "babel-plugin-istanbul": "^6.1.1",
    "babel-plugin-preval": "^5.1.0",
    "babel-plugin-version-inline": "^1.0.0",
    "benchmark": "^2.1.4",
    "browserslist": "^4.21.3",
    "caniuse-lite": "^1.0.30001384",
    "css-loader": "^6.7.1",
    "cssnano": "^5.1.13",
    "eslint": "^10.0.3",
    "eslint-plugin-actions": "^2.0.0",
    "eslint-plugin-react": "^7.37.5",
    "fs-extra": "^10.1.0",
    "globals": "^17.6.0",
    "got": "^11.8.5",
    "husky": "^4.3.8",
    "istanbul-lib-coverage": "^3.2.0",
    "istanbul-lib-report": "^3.0.0",
    "istanbul-reports": "^3.1.5",
    "jest": "^30.2.0",
    "jest-diff": "^30.2.0",
    "jest-environment-jsdom": "^30.2.0",
    "jest-matcher-utils": "^30.2.0",
    "jest-message-util": "^30.2.0",
    "jest-serializer-html": "^7.1.0",
    "js-yaml": "^4.1.0",
    "json-stable-stringify": "^1.0.1",
    "jspngopt": "^0.2.0",
    "mini-css-extract-plugin": "^2.6.1",
    "mkdirp": "^1.0.4",
    "p-retry": "^4.6.2",
    "pako": "^2.0.4",
    "postcss": "^8.4.16",
    "postcss-loader": "^7.0.1",
    "postcss-preset-env": "^7.8.0",
    "postcss-scss": "^4.0.9",
    "rimraf": "^3.0.2",
    "rollup": "^2.79.2",
    "sass": "^1.94.2",
    "sass-loader": "^16.0.6",
    "selenium-webdriver": "^4.4.0",
    "semantic-release": "^19.0.5",
    "sri-toolbox": "^0.2.0",
    "style-loader": "^3.3.1",
    "stylelint": "^17.9.1",
    "stylelint-config-standard": "^40.0.0",
    "stylelint-scss": "^7.0.0",
    "terser-webpack-plugin": "^5.3.6",
    "tslib": "^2.8.1",
    "typescript": "^5.9.3",
    "webpack": "^5.74.0",
    "webpack-bundle-analyzer": "^5.0.0",
    "webpack-cli": "^5.0.0",
    "webpack-dev-server": "^5.0.0",
    "webpack-remove-empty-scripts": "^1.0.4"
  },
  "bin": "cli.js",
  "scripts": {
    "test": "yarn test:lint && yarn test:ts && yarn test:jest",
    "test:lint": "yarn test:lint:js && yarn test:lint:css",
    "test:lint:js": "eslint .",
    "test:lint:css": "stylelint src/styles/katex.scss static/main.css website/static/**/*.css",
    "test:jest": "jest",
    "test:jest:watch": "jest --watch",
    "test:jest:update": "jest --updateSnapshot",
    "test:jest:coverage": "jest --coverage",
    "test:screenshots": "yarn test:screenshots:update --verify",
    "test:screenshots:update": "dockers/screenshotter/screenshotter.sh",
    "test:perf": "NODE_ENV=test node -e \"require('@babel/register')({extensions:['.js','.ts']}); require('./test/perf-test.ts')\"",
    "test:ts": "tsc --noEmit",
    "test:build": "node test/verify-build.js",
    "clean": "rm -rf dist/ node_modules/",
    "clean-install": "yarn clean && yarn",
    "start": "webpack serve --config webpack.dev.js",
    "analyze": "webpack --config webpack.analyze.js",
    "build": "rimraf dist/ && mkdirp dist && cp README.md dist && rollup -c --failAfterWarnings && webpack && node update-sri.js package dist/README.md",
    "build:fonts": "dockers/fonts/buildFonts.sh",
    "build:metrics": "dockers/fonts/buildMetrics.sh",
    "watch": "yarn build --watch",
    "postversion": "yarn dist && node update-sri.js package README.md contrib/*/README.md docs/*.md website/pages/index.html",
    "semantic-release": "semantic-release",
    "dist": "yarn build && yarn dist:zip",
    "dist:zip": "rimraf katex/ katex.tar.gz katex.zip && cp -R dist katex && tar czf katex.tar.gz katex && zip -rq katex.zip katex && rimraf katex/"
  },
  "dependencies": {
    "commander": "^8.3.0"
  },
  "husky": {
    "hooks": {
      "pre-commit": "yarn test:lint"
    }
  },
  "jest": {
    "collectCoverageFrom": [
      "src/**/*.{js,ts}",
      "contrib/**/*.{js,ts}",
      "!src/unicodeSymbols.{js,ts}",
      "!contrib/mhchem/**"
    ],
    "setupFilesAfterEnv": [
      "<rootDir>/test/setup.ts"
    ],
    "snapshotSerializers": [
      "jest-serializer-html"
    ],
    "testMatch": [
      "**/test/*-spec.ts"
    ],
    "testEnvironmentOptions": {
      "url": "http://localhost/"
    },
    "transform": {
      "^.+\\.(js|ts)$": "babel-jest"
    },
    "moduleNameMapper": {
      "^katex$": "<rootDir>/katex.ts"
    }
  }
}

EuxZ100644 Lexer.ts :ÊD&Vǵ퀰ڗ}100644 MacroExpander.ts T$^!ܒʖ_I100644 Namespace.ts R?)3֋rөDyݫh100644 Options.ts ZTLA2p? 6d.100644 ParseError.ts .$sgE:wM 100644 Parser.ts Vg5IH100644 Settings.ts ]AIbAmY$rz100644 SourceLocation.ts pHEx$ߏ%|Oя@_`100644 Style.ts I&%Ͻ
t100644 Token.ts xetPGI{Ѩ100644 atoms.ts *ZOg.{100644 buildCommon.ts 
75}
*@*Z100644 buildHTML.ts 4X;P$A/PE,"}100644 buildMathML.ts L׫$]˜Ϛyz100644 buildTree.ts 'omʞ@7100644 defineEnvironment.ts oƿ˝|6PRG100644 defineFunction.ts EE"beVۤC100644 defineMacro.ts #G{e'2100644 delimiter.ts y{}J>j8z>O100644 domTree.ts PםzUta|w@100644 environments.ts &[E×M^hR40000 environments 1M)@ňY;100644 fontMetrics.ts \ }O\100644 fontMetricsData.d.ts }l84,Գg100644 fontMetricsData.js %W$PZgNZ#%G40000 fonts 񮰹ң26|100644 functions.ts 
]jxt^140000 functions L)EJ100644 macros.ts 7剗Di@v2\100644 mathMLTree.ts K%^݊oC40000 metrics '9KskR:>100644 parseNode.ts e#5+``"̄100644 parseTree.ts 38EyP<X100644 spacingData.ts yqtApъm&100644 stretchy.ts ovF.@&fP40000 styles rH <a2-"100644 svgGeometry.ts eJcR_N	100644 symbols.ts ֠,&wiZJ100644 tree.ts ]ܦn[
|QIBQB40000 types 5Έ!y{yv)nM100644 unicodeAccents.js :m?HYie{100644 unicodeScripts.ts 1oM ]_/ M5ol100644 unicodeSupOrSub.ts k4MPy2^E{100644 unicodeSymbols.js #7lO[ckXɲx100644 units.ts ٚ
)Z.J<QF100644 utils.ts GU5xr(jI7['m100644 wide-character.ts U@7Gcp4?Ox&/**
 * The Lexer class handles tokenizing the input in various ways. Since our
 * parser expects us to be able to backtrack, the lexer allows lexing from any
 * given starting point.
 *
 * Its main exposed function is the `lex` function, which takes a position to
 * lex from and a type of token to lex. It defers to the appropriate `_innerLex`
 * function.
 *
 * The various `_innerLex` functions perform the actual lexing of different
 * kinds.
 */

import ParseError from "./ParseError";
import SourceLocation from "./SourceLocation";
import {Token} from "./Token";

import type {LexerInterface} from "./Token";
import type Settings from "./Settings";

/* The following tokenRegex
 * - matches typical whitespace (but not NBSP etc.) using its first group
 * - does not match any control character \x00-\x1f except whitespace
 * - does not match a bare backslash
 * - matches any ASCII character except those just mentioned
 * - does not match the BMP private use area \uE000-\uF8FF
 * - does not match bare surrogate code units
 * - matches any BMP character except for those just described
 * - matches any valid Unicode surrogate pair
 * - matches a backslash followed by one or more whitespace characters
 * - matches a backslash followed by one or more letters then whitespace
 * - matches a backslash followed by any BMP character
 * Capturing groups:
 *   [1] regular whitespace
 *   [2] backslash followed by whitespace
 *   [3] anything else, which may include:
 *     [4] left character of \verb*
 *     [5] left character of \verb
 *     [6] backslash followed by word, excluding any trailing whitespace
 * Just because the Lexer matches something doesn't mean it's valid input:
 * If there is no matching function or symbol definition, the Parser will
 * still reject the input.
 */
const spaceRegexString = "[ \r\n\t]";
const controlWordRegexString = "\\\\[a-zA-Z@]+";
const controlSymbolRegexString = "\\\\[^\uD800-\uDFFF]";
const controlWordWhitespaceRegexString =
    `(${controlWordRegexString})${spaceRegexString}*`;
const controlSpaceRegexString = "\\\\(\n|[ \r\t]+\n?)[ \r\t]*";
const combiningDiacriticalMarkString = "[\u0300-\u036f]";
export const combiningDiacriticalMarksEndRegex: RegExp =
    new RegExp(`${combiningDiacriticalMarkString}+$`);
const tokenRegexString = `(${spaceRegexString}+)|` +  // whitespace
    `${controlSpaceRegexString}|` +                   // \whitespace
    "([!-\\[\\]-\u2027\u202A-\uD7FF\uF900-\uFFFF]" +  // single codepoint
    `${combiningDiacriticalMarkString}*` +            // ...plus accents
    "|[\uD800-\uDBFF][\uDC00-\uDFFF]" +               // surrogate pair
    `${combiningDiacriticalMarkString}*` +            // ...plus accents
    "|\\\\verb\\*([^]).*?\\4" +                       // \verb*
    "|\\\\verb([^*a-zA-Z]).*?\\5" +                   // \verb unstarred
    `|${controlWordWhitespaceRegexString}` +          // \macroName + spaces
    `|${controlSymbolRegexString})`;                  // \\, \', etc.

/** Main Lexer class */
export default class Lexer implements LexerInterface {
    input: string;
    settings: Settings;
    tokenRegex: RegExp;
    // Category codes. The lexer only supports comment characters (14) for now.
    // MacroExpander additionally distinguishes active (13).
    catcodes: Record<string, number>;

    constructor(input: string, settings: Settings) {
        // Separate accents from characters
        this.input = input;
        this.settings = settings;
        this.tokenRegex = new RegExp(tokenRegexString, 'g');
        this.catcodes = {
            "%": 14, // comment character
            "~": 13, // active character
        };
    }

    setCatcode(char: string, code: number) {
        this.catcodes[char] = code;
    }

    /**
     * This function lexes a single token.
     */
    lex(): Token {
        const input = this.input;
        const pos = this.tokenRegex.lastIndex;
        if (pos === input.length) {
            return new Token("EOF", new SourceLocation(this, pos, pos));
        }
        const match = this.tokenRegex.exec(input);
        if (match === null || match.index !== pos) {
            throw new ParseError(
                `Unexpected character: '${input[pos]}'`,
                new Token(input[pos], new SourceLocation(this, pos, pos + 1)));
        }
        const text = match[6] || match[3] || (match[2] ? "\\ " : " ");

        if (this.catcodes[text] === 14) { // comment character
            const nlIndex = input.indexOf('\n', this.tokenRegex.lastIndex);
            if (nlIndex === -1) {
                this.tokenRegex.lastIndex = input.length; // EOF
                this.settings.reportNonstrict("commentAtEnd",
                    "% comment has no terminating newline; LaTeX would " +
                    "fail because of commenting the end of math mode (e.g. $)");
            } else {
                this.tokenRegex.lastIndex = nlIndex + 1;
            }
            return this.lex();
        }

        return new Token(text, new SourceLocation(this, pos,
            this.tokenRegex.lastIndex));
    }
}
ʻC±x@/**
 * This file contains the “gullet” where macros are expanded
 * until only non-macro tokens remain.
 */

import functions from "./functions";
import symbols from "./symbols";
import Lexer from "./Lexer";
import {Token} from "./Token";
import type {Mode} from "./types";
import ParseError from "./ParseError";
import SourceLocation from "./SourceLocation";
import Namespace from "./Namespace";
import macros from "./macros";

import type {MacroContextInterface, MacroDefinition, MacroExpansion, MacroArg}
    from "./defineMacro";
import type Settings from "./Settings";

// List of commands that act like macros but aren't defined as a macro,
// function, or symbol.  Used in `isDefined`.
export const implicitCommands = {
    "^": true,           // Parser.js
    "_": true,           // Parser.js
    "\\limits": true,    // Parser.js
    "\\nolimits": true,  // Parser.js
};

export default class MacroExpander implements MacroContextInterface {
    settings: Settings;
    expansionCount: number;
    lexer!: Lexer;
    macros: Namespace<MacroDefinition>;
    stack: Token[];
    mode: Mode;

    constructor(input: string, settings: Settings, mode: Mode) {
        this.settings = settings;
        this.expansionCount = 0;
        this.feed(input);
        // Make new global namespace
        this.macros = new Namespace(macros, settings.macros);
        this.mode = mode;
        this.stack = []; // contains tokens in REVERSE order
    }

    /**
     * Feed a new input string to the same MacroExpander
     * (with existing macros etc.).
     */
    feed(input: string) {
        this.lexer = new Lexer(input, this.settings);
    }

    /**
     * Switches between "text" and "math" modes.
     */
    switchMode(newMode: Mode) {
        this.mode = newMode;
    }

    /**
     * Start a new group nesting within all namespaces.
     */
    beginGroup() {
        this.macros.beginGroup();
    }

    /**
     * End current group nesting within all namespaces.
     */
    endGroup() {
        this.macros.endGroup();
    }

    /**
     * Ends all currently nested groups (if any), restoring values before the
     * groups began.  Useful in case of an error in the middle of parsing.
     */
    endGroups() {
        this.macros.endGroups();
    }

    /**
     * Returns the topmost token on the stack, without expanding it.
     * Similar in behavior to TeX's `\futurelet`.
     */
    future(): Token {
        if (this.stack.length === 0) {
            this.pushToken(this.lexer.lex());
        }
        return this.stack[this.stack.length - 1];
    }

    /**
     * Remove and return the next unexpanded token.
     */
    popToken(): Token {
        this.future();  // ensure non-empty stack
        return this.stack.pop()!;
    }

    /**
     * Add a given token to the token stack.  In particular, this get be used
     * to put back a token returned from one of the other methods.
     */
    pushToken(token: Token) {
        this.stack.push(token);
    }

    /**
     * Append an array of tokens to the token stack.
     */
    pushTokens(tokens: Token[]) {
        this.stack.push(...tokens);
    }

    /**
     * Find an macro argument without expanding tokens and append the array of
     * tokens to the token stack. Uses Token as a container for the result.
     */
    scanArgument(isOptional: boolean): Token | null | undefined {
        let start;
        let end;
        let tokens;
        if (isOptional) {
            this.consumeSpaces(); // \@ifnextchar gobbles any space following it
            if (this.future().text !== "[") {
                return null;
            }
            start = this.popToken(); // don't include [ in tokens
            ({tokens, end} = this.consumeArg(["]"]));
        } else {
            ({tokens, start, end} = this.consumeArg());
        }

        // indicate the end of an argument
        this.pushToken(new Token("EOF", end.loc));

        this.pushTokens(tokens);
        return new Token("", SourceLocation.range(start, end));
    }

    /**
     * Consume all following space tokens, without expansion.
     */
    consumeSpaces() {
        for (;;) {
            const token = this.future();
            if (token.text === " ") {
                this.stack.pop();
            } else {
                break;
            }
        }
    }

    /**
     * Consume an argument from the token stream, and return the resulting array
     * of tokens and start/end token.
     */
    consumeArg(delims?: string[] | null | undefined): MacroArg {
        // The argument for a delimited parameter is the shortest (possibly
        // empty) sequence of tokens with properly nested {...} groups that is
        // followed ... by this particular list of non-parameter tokens.
        // The argument for an undelimited parameter is the next nonblank
        // token, unless that token is ‘{’, when the argument will be the
        // entire {...} group that follows.
        const tokens: Token[] = [];
        const isDelimited = delims && delims.length > 0;
        if (!isDelimited) {
            // Ignore spaces between arguments.  As the TeXbook says:
            // "After you have said ‘\def\row#1#2{...}’, you are allowed to
            //  put spaces between the arguments (e.g., ‘\row x n’), because
            //  TeX doesn’t use single spaces as undelimited arguments."
            this.consumeSpaces();
        }
        const start = this.future();
        let tok;
        let depth = 0;
        let match = 0;
        do {
            tok = this.popToken();
            tokens.push(tok);
            if (tok.text === "{") {
                ++depth;
            } else if (tok.text === "}") {
                --depth;
                if (depth === -1) {
                    throw new ParseError("Extra }", tok);
                }
            } else if (tok.text === "EOF") {
                throw new ParseError("Unexpected end of input in a macro argument" +
                    ", expected '" + (delims && isDelimited ? delims[match] : "}") +
                    "'", tok);
            }
            if (delims && isDelimited) {
                if ((depth === 0 || (depth === 1 && delims[match] === "{")) &&
                    tok.text === delims[match]) {
                    ++match;
                    if (match === delims.length) {
                        // don't include delims in tokens
                        tokens.splice(-match, match);
                        break;
                    }
                } else {
                    match = 0;
                }
            }
        } while (depth !== 0 || isDelimited);
        // If the argument found ... has the form ‘{<nested tokens>}’,
        // ... the outermost braces enclosing the argument are removed
        if (start.text === "{" && tokens[tokens.length - 1].text === "}") {
            tokens.pop();
            tokens.shift();
        }
        tokens.reverse(); // to fit in with stack order
        return {tokens, start, end: tok};
    }

    /**
     * Consume the specified number of (delimited) arguments from the token
     * stream and return the resulting array of arguments.
     */
    consumeArgs(numArgs: number, delimiters?: string[][]): Token[][] {
        if (delimiters) {
            if (delimiters.length !== numArgs + 1) {
                throw new ParseError(
                    "The length of delimiters doesn't match the number of args!");
            }
            const delims = delimiters[0];
            for (let i = 0; i < delims.length; i++) {
                const tok = this.popToken();
                if (delims[i] !== tok.text) {
                    throw new ParseError(
                        "Use of the macro doesn't match its definition", tok);
                }
            }
        }

        const args: Token[][] = [];
        for (let i = 0; i < numArgs; i++) {
            args.push(this.consumeArg(delimiters && delimiters[i + 1]).tokens);
        }
        return args;
    }

    /**
     * Increment `expansionCount` by the specified amount.
     * Throw an error if it exceeds `maxExpand`.
     */
    countExpansion(amount: number): void {
        this.expansionCount += amount;
        if (this.expansionCount > this.settings.maxExpand) {
            throw new ParseError("Too many expansions: infinite loop or " +
                "need to increase maxExpand setting");
        }
    }

    /**
     * Expand the next token only once if possible.
     *
     * If the token is expanded, the resulting tokens will be pushed onto
     * the stack in reverse order, and the number of such tokens will be
     * returned.  This number might be zero or positive.
     *
     * If not, the return value is `false`, and the next token remains at the
     * top of the stack.
     *
     * In either case, the next token will be on the top of the stack,
     * or the stack will be empty (in case of empty expansion
     * and no other tokens).
     *
     * Used to implement `expandAfterFuture` and `expandNextToken`.
     *
     * If expandableOnly, only expandable tokens are expanded and
     * an undefined control sequence results in an error.
     */
    expandOnce(expandableOnly?: boolean): number | boolean {
        const topToken = this.popToken();
        const name = topToken.text;
        const expansion = !topToken.noexpand ? this._getExpansion(name) : null;
        if (expansion == null || (expandableOnly && expansion.unexpandable)) {
            if (expandableOnly && expansion == null &&
                    name[0] === "\\" && !this.isDefined(name)) {
                throw new ParseError("Undefined control sequence: " + name);
            }
            this.pushToken(topToken);
            return false;
        }
        this.countExpansion(1);
        let tokens = expansion.tokens;
        const args = this.consumeArgs(expansion.numArgs, expansion.delimiters);
        if (expansion.numArgs) {
            // paste arguments in place of the placeholders
            tokens = tokens.slice(); // make a shallow copy
            for (let i = tokens.length - 1; i >= 0; --i) {
                let tok = tokens[i];
                if (tok.text === "#") {
                    if (i === 0) {
                        throw new ParseError(
                            "Incomplete placeholder at end of macro body",
                            tok);
                    }
                    tok = tokens[--i]; // next token on stack
                    if (tok.text === "#") { // ## → #
                        tokens.splice(i + 1, 1); // drop first #
                    } else if (/^[1-9]$/.test(tok.text)) {
                        // replace the placeholder with the indicated argument
                        tokens.splice(i, 2, ...args[+tok.text - 1]);
                    } else {
                        throw new ParseError(
                            "Not a valid argument number",
                            tok);
                    }
                }
            }
        }
        // Concatenate expansion onto top of stack.
        this.pushTokens(tokens);
        return tokens.length;
    }

    /**
     * Expand the next token only once (if possible), and return the resulting
     * top token on the stack (without removing anything from the stack).
     * Similar in behavior to TeX's `\expandafter\futurelet`.
     * Equivalent to expandOnce() followed by future().
     */
    expandAfterFuture(): Token {
        this.expandOnce();
        return this.future();
    }

    /**
     * Recursively expand first token, then return first non-expandable token.
     */
    expandNextToken(): Token {
        for (;;) {
            if (this.expandOnce() === false) {  // fully expanded
                const token = this.stack.pop()!;
                // the token after \noexpand is interpreted as if its meaning
                // were ‘\relax’
                if (token.treatAsRelax) {
                    token.text = "\\relax";
                }
                return token;
            }
        }
    }

    /**
     * Fully expand the given macro name and return the resulting list of
     * tokens, or return `undefined` if no such macro is defined.
     */
    expandMacro(name: string): Token[] | undefined {
        return this.macros.has(name)
            ? this.expandTokens([new Token(name)]) : undefined;
    }

    /**
     * Fully expand the given token stream and return the resulting list of
     * tokens.  Note that the input tokens are in reverse order, but the
     * output tokens are in forward order.
     */
    expandTokens(tokens: Token[]): Token[] {
        const output: Token[] = [];
        const oldStackLength = this.stack.length;
        this.pushTokens(tokens);
        while (this.stack.length > oldStackLength) {
            // Expand only expandable tokens
            if (this.expandOnce(true) === false) {  // fully expanded
                const token = this.stack.pop()!;
                if (token.treatAsRelax) {
                    // the expansion of \noexpand is the token itself
                    token.noexpand = false;
                    token.treatAsRelax = false;
                }
                output.push(token);
            }
        }
        // Count all of these tokens as additional expansions, to prevent
        // exponential blowup from linearly many \edef's.
        this.countExpansion(output.length);
        return output;
    }

    /**
     * Fully expand the given macro name and return the result as a string,
     * or return `undefined` if no such macro is defined.
     */
    expandMacroAsText(name: string): string | undefined {
        const tokens = this.expandMacro(name);
        if (tokens) {
            return tokens.map((token) => token.text).join("");
        } else {
            return tokens;
        }
    }

    /**
     * Returns the expanded macro as a reversed array of tokens and a macro
     * argument count.  Or returns `null` if no such macro.
     */
    _getExpansion(name: string): MacroExpansion | null | undefined {
        const definition = this.macros.get(name);

        if (definition == null) { // mainly checking for undefined here
            return definition;
        }
        // If a single character has an associated catcode other than 13
        // (active character), then don't expand it.
        if (name.length === 1) {
            const catcode = this.lexer.catcodes[name];
            if (catcode != null && catcode !== 13) {
                return;
            }
        }
        const expansion =
            typeof definition === "function" ? definition(this) : definition;
        if (typeof expansion === "string") {
            let numArgs = 0;
            if (expansion.includes("#")) {
                const stripped = expansion.replace(/##/g, "");
                while (stripped.includes("#" + (numArgs + 1))) {
                    ++numArgs;
                }
            }
            const bodyLexer = new Lexer(expansion, this.settings);
            const tokens = [];
            let tok = bodyLexer.lex();
            while (tok.text !== "EOF") {
                tokens.push(tok);
                tok = bodyLexer.lex();
            }
            tokens.reverse(); // to fit in with stack using push and pop
            const expanded = {tokens, numArgs};
            return expanded;
        }

        return expansion;
    }

    /**
     * Determine whether a command is currently "defined" (has some
     * functionality), meaning that it's a macro (in the current group),
     * a function, a symbol, or one of the special commands listed in
     * `implicitCommands`.
     */
    isDefined(name: string): boolean {
        return this.macros.has(name) ||
            functions.hasOwnProperty(name) ||
            symbols.math.hasOwnProperty(name) ||
            symbols.text.hasOwnProperty(name) ||
            implicitCommands.hasOwnProperty(name);
    }

    /**
     * Determine whether a command is expandable.
     */
    isExpandable(name: string): boolean {
        const macro = this.macros.get(name);
        return macro != null ? typeof macro === "string"
                || typeof macro === "function" || !macro.unexpandable
            : functions.hasOwnProperty(name) && !functions[name].primitive;
    }
}
x
/**
 * A `Namespace` refers to a space of nameable things like macros or lengths,
 * which can be `set` either globally or local to a nested group, using an
 * undo stack similar to how TeX implements this functionality.
 * Performance-wise, `get` and local `set` take constant time, while global
 * `set` takes time proportional to the depth of group nesting.
 */

import ParseError from "./ParseError";
export type Mapping<Value> = Record<string, Value>;

export default class Namespace<Value> {
    current: Mapping<Value>;
    builtins: Mapping<Value>;
    undefStack: Mapping<Value | null | undefined>[];

    /**
     * Both arguments are optional.  The first argument is an object of
     * built-in mappings which never change.  The second argument is an object
     * of initial (global-level) mappings, which will constantly change
     * according to any global/top-level `set`s done.
     */
    constructor(builtins: Mapping<Value> = {},
                globalMacros: Mapping<Value> = {}) {
        this.current = globalMacros;
        this.builtins = builtins;
        this.undefStack = [];
    }

    /**
     * Start a new nested group, affecting future local `set`s.
     */
    beginGroup() {
        this.undefStack.push({});
    }

    /**
     * End current nested group, restoring values before the group began.
     */
    endGroup() {
        if (this.undefStack.length === 0) {
            throw new ParseError("Unbalanced namespace destruction: attempt " +
                "to pop global namespace; please report this as a bug");
        }
        const undefs = this.undefStack.pop();
        for (const undef in undefs) {
            if (undefs.hasOwnProperty(undef)) {
                if (undefs[undef] == null) {
                    delete this.current[undef];
                } else {
                    this.current[undef] = undefs[undef];
                }
            }
        }
    }

    /**
     * Ends all currently nested groups (if any), restoring values before the
     * groups began.  Useful in case of an error in the middle of parsing.
     */
    endGroups() {
        while (this.undefStack.length > 0) {
            this.endGroup();
        }
    }

    /**
     * Detect whether `name` has a definition.  Equivalent to
     * `get(name) != null`.
     */
    has(name: string): boolean {
        return this.current.hasOwnProperty(name) ||
               this.builtins.hasOwnProperty(name);
    }

    /**
     * Get the current value of a name, or `undefined` if there is no value.
     *
     * Note: Do not use `if (namespace.get(...))` to detect whether a macro
     * is defined, as the definition may be the empty string which evaluates
     * to `false` in JavaScript.  Use `if (namespace.get(...) != null)` or
     * `if (namespace.has(...))`.
     */
    get(name: string): Value | null | undefined {
        if (this.current.hasOwnProperty(name)) {
            return this.current[name];
        } else {
            return this.builtins[name];
        }
    }

    /**
     * Set the current value of a name, and optionally set it globally too.
     * Local set() sets the current value and (when appropriate) adds an undo
     * operation to the undo stack.  Global set() may change the undo
     * operation at every level, so takes time linear in their number.
     * A value of undefined means to delete existing definitions.
     */
    set(name: string, value: Value | null | undefined, global: boolean = false) {
        if (global) {
            // Global set is equivalent to setting in all groups.  Simulate this
            // by destroying any undos currently scheduled for this name,
            // and adding an undo with the *new* value (in case it later gets
            // locally reset within this environment).
            for (let i = 0; i < this.undefStack.length; i++) {
                delete this.undefStack[i][name];
            }
            if (this.undefStack.length > 0) {
                this.undefStack[this.undefStack.length - 1][name] = value;
            }
        } else {
            // Undo this set at end of this group (possibly to `undefined`),
            // unless an undo is already in place, in which case that older
            // value is the correct one.
            const top = this.undefStack[this.undefStack.length - 1];
            if (top && !top.hasOwnProperty(name)) {
                top[name] = this.current[name];
            }
        }
        if (value == null) {
            delete this.current[name];
        } else {
            this.current[name] = value;
        }
    }
}
v[xW$/**
 * This file contains information about the options that the Parser carries
 * around with it while parsing. Data is held in an `Options` object, and when
 * recursing, a new `Options` object can be created with the `.with*` and
 * `.reset` functions.
 */

import {getGlobalMetrics} from "./fontMetrics";
import type {StyleInterface} from "./Style";
import type {FontMetrics, MathFont, TextFont, FontWeight, FontShape} from "./types/fonts";

const sizeStyleMap = [
    // Each element contains [textsize, scriptsize, scriptscriptsize].
    // The size mappings are taken from TeX with \normalsize=10pt.
    [1, 1, 1],    // size1: [5, 5, 5]              \tiny
    [2, 1, 1],    // size2: [6, 5, 5]
    [3, 1, 1],    // size3: [7, 5, 5]              \scriptsize
    [4, 2, 1],    // size4: [8, 6, 5]              \footnotesize
    [5, 2, 1],    // size5: [9, 6, 5]              \small
    [6, 3, 1],    // size6: [10, 7, 5]             \normalsize
    [7, 4, 2],    // size7: [12, 8, 6]             \large
    [8, 6, 3],    // size8: [14.4, 10, 7]          \Large
    [9, 7, 6],    // size9: [17.28, 12, 10]        \LARGE
    [10, 8, 7],   // size10: [20.74, 14.4, 12]     \huge
    [11, 10, 9],  // size11: [24.88, 20.74, 17.28] \HUGE
];

const sizeMultipliers = [
    // fontMetrics.js:getGlobalMetrics also uses size indexes, so if
    // you change size indexes, change that function.
    0.5, 0.6, 0.7, 0.8, 0.9, 1.0, 1.2, 1.44, 1.728, 2.074, 2.488,
];

const sizeAtStyle = function(size: number, style: StyleInterface): number {
    return style.size < 2 ? size : sizeStyleMap[size - 1][style.size - 1];
};

export type OptionsData = {
    style: StyleInterface;
    color?: string | undefined;
    size?: number;
    textSize?: number;
    phantom?: boolean;
    font?: MathFont;
    fontFamily?: TextFont;
    fontWeight?: FontWeight;
    fontShape?: FontShape;
    sizeMultiplier?: number;
    maxSize: number;
    minRuleThickness: number;
};

/**
 * This is the main options class. It contains the current style, size, color,
 * and font.
 *
 * Options objects should not be modified. To create a new Options with
 * different properties, call a `.having*` method.
 */
class Options {
    style: StyleInterface;
    color: string | undefined;
    size: number;
    textSize: number;
    phantom: boolean;
    // A font family applies to a group of fonts (i.e. SansSerif), while a font
    // represents a specific font (i.e. SansSerif Bold).
    // See: https://tex.stackexchange.com/questions/22350/difference-between-textrm-and-mathrm
    font: MathFont;
    fontFamily: TextFont;
    fontWeight: FontWeight;
    fontShape: FontShape;
    sizeMultiplier: number;
    maxSize: number;
    minRuleThickness: number;
    _fontMetrics: FontMetrics | undefined;

    /**
     * The base size index.
     */
    static BASESIZE: number = 6;

    constructor(data: OptionsData) {
        this.style = data.style;
        this.color = data.color;
        this.size = data.size || Options.BASESIZE;
        this.textSize = data.textSize || this.size;
        this.phantom = !!data.phantom;
        this.font = data.font || "";
        this.fontFamily = data.fontFamily || "";
        this.fontWeight = data.fontWeight || "";
        this.fontShape = data.fontShape || "";
        this.sizeMultiplier = sizeMultipliers[this.size - 1];
        this.maxSize = data.maxSize;
        this.minRuleThickness = data.minRuleThickness;
        this._fontMetrics = undefined;
    }

    /**
     * Returns a new options object with the same properties as "this".  Properties
     * from "extension" will be copied to the new options object.
     */
    extend(extension: Partial<OptionsData>): Options {
        const data: OptionsData = {
            style: this.style,
            size: this.size,
            textSize: this.textSize,
            color: this.color,
            phantom: this.phantom,
            font: this.font,
            fontFamily: this.fontFamily,
            fontWeight: this.fontWeight,
            fontShape: this.fontShape,
            maxSize: this.maxSize,
            minRuleThickness: this.minRuleThickness,
        };

        Object.assign(data, extension);

        return new Options(data);
    }

    /**
     * Return an options object with the given style. If `this.style === style`,
     * returns `this`.
     */
    havingStyle(style: StyleInterface): Options {
        if (this.style === style) {
            return this;
        } else {
            return this.extend({
                style: style,
                size: sizeAtStyle(this.textSize, style),
            });
        }
    }

    /**
     * Return an options object with a cramped version of the current style. If
     * the current style is cramped, returns `this`.
     */
    havingCrampedStyle(): Options {
        return this.havingStyle(this.style.cramp());
    }

    /**
     * Return an options object with the given size and in at least `\textstyle`.
     * Returns `this` if appropriate.
     */
    havingSize(size: number): Options {
        if (this.size === size && this.textSize === size) {
            return this;
        } else {
            return this.extend({
                style: this.style.text(),
                size: size,
                textSize: size,
                sizeMultiplier: sizeMultipliers[size - 1],
            });
        }
    }

    /**
     * Like `this.havingSize(BASESIZE).havingStyle(style)`. If `style` is omitted,
     * changes to at least `\textstyle`.
     */
    havingBaseStyle(style: StyleInterface): Options {
        style = style || this.style.text();
        const wantSize = sizeAtStyle(Options.BASESIZE, style);
        if (
            this.size === wantSize &&
            this.textSize === Options.BASESIZE &&
            this.style === style
        ) {
            return this;
        } else {
            return this.extend({
                style: style,
                size: wantSize,
            });
        }
    }

    /**
     * Remove the effect of sizing changes such as \Huge.
     * Keep the effect of the current style, such as \scriptstyle.
     */
    havingBaseSizing(): Options {
        let size;
        switch (this.style.id) {
            case 4:
            case 5:
                size = 3; // normalsize in scriptstyle
                break;
            case 6:
            case 7:
                size = 1; // normalsize in scriptscriptstyle
                break;
            default:
                size = 6; // normalsize in textstyle or displaystyle
        }
        return this.extend({
            style: this.style.text(),
            size: size,
        });
    }

    /**
     * Create a new options object with the given color.
     */
    withColor(color: string): Options {
        return this.extend({
            color: color,
        });
    }

    /**
     * Create a new options object with "phantom" set to true.
     */
    withPhantom(): Options {
        return this.extend({
            phantom: true,
        });
    }

    /**
     * Creates a new options object with the given math font or old text font.
     * @type {[type]}
     */
    withFont(font: MathFont): Options {
        return this.extend({font});
    }

    /**
     * Create a new options objects with the given fontFamily.
     */
    withTextFontFamily(fontFamily: TextFont): Options {
        return this.extend({fontFamily, font: ""});
    }

    /**
     * Creates a new options object with the given font weight
     */
    withTextFontWeight(fontWeight: FontWeight): Options {
        return this.extend({
            fontWeight,
            font: "",
        });
    }

    /**
     * Creates a new options object with the given font weight
     */
    withTextFontShape(fontShape: FontShape): Options {
        return this.extend({
            fontShape,
            font: "",
        });
    }

    /**
     * Return the CSS sizing classes required to switch from enclosing options
     * `oldOptions` to `this`. Returns an array of classes.
     */
    sizingClasses(oldOptions: Options): Array<string> {
        if (oldOptions.size !== this.size) {
            return [
                "sizing",
                "reset-size" + oldOptions.size,
                "size" + this.size,
            ];
        } else {
            return [];
        }
    }

    /**
     * Return the CSS sizing classes required to switch to the base size. Like
     * `this.havingSize(BASESIZE).sizingClasses(this)`.
     */
    baseSizingClasses(): Array<string> {
        if (this.size !== Options.BASESIZE) {
            return [
                "sizing",
                "reset-size" + this.size,
                "size" + Options.BASESIZE,
            ];
        } else {
            return [];
        }
    }

    /**
     * Return the font metrics for this size.
     */
    fontMetrics(): FontMetrics {
        if (!this._fontMetrics) {
            this._fontMetrics = getGlobalMetrics(this.size);
        }
        return this._fontMetrics;
    }

    /**
     * Gets the CSS color of the current options object
     */
    getColor(): string | undefined {
        if (this.phantom) {
            return "transparent";
        } else {
            return this.color;
        }
    }
}

export default Options;
p7x	'import {Token} from "./Token";

import type {AnyParseNode} from "./parseNode";

/**
 * This is the ParseError class, which is the main error thrown by KaTeX
 * functions when something has gone wrong. This is used to distinguish internal
 * errors from errors in the expression that the user provided.
 *
 * If possible, a caller should provide a Token or ParseNode with information
 * about where in the source string the problem occurred.
 */
class ParseError extends Error {
    override name = "ParseError" as const;
    position: number | undefined;
    // Error start position based on passed-in Token or ParseNode.
    length: number | undefined;
    // Length of affected text based on passed-in Token or ParseNode.
    rawMessage: string;
    // The underlying error message without any context added.

    constructor(
        message: string, // The error message
        token?: Token | null | undefined | AnyParseNode,
    ) {
        let error = "KaTeX parse error: " + message;
        let start;
        let end;

        const loc = token && token.loc;
        if (loc && loc.start <= loc.end) {
            // If we have the input and a position, make the error a bit fancier

            // Get the input
            const input = loc.lexer.input;

            // Prepend some information
            start = loc.start;
            end = loc.end;
            if (start === input.length) {
                error += " at end of input: ";
            } else {
                error += " at position " + (start + 1) + ": ";
            }

            // Underline token in question using combining underscores
            const underlined = input.slice(start, end).replace(/[^]/g, "$&\u0332");

            // Extract some context from the input and add it to the error
            let left;
            if (start > 15) {
                left = "…" + input.slice(start - 15, start);
            } else {
                left = input.slice(0, start);
            }
            let right;
            if (end + 15 < input.length) {
                right = input.slice(end, end + 15) + "…";
            } else {
                right = input.slice(end);
            }
            error += left + underlined + right;

        }

        super(error);
        Object.setPrototypeOf(this, ParseError.prototype);
        this.position = start;
        if (start != null && end != null) {
            this.length = end - start;
        }
        this.rawMessage = message;
    }
}

export default ParseError;
XAx8g/* eslint no-constant-condition:0 */
import functions from "./functions";
import MacroExpander, {implicitCommands} from "./MacroExpander";
import symbols, {extraLatin} from "./symbols";
import {isAtom} from "./atoms";
import {validUnit} from "./units";
import {supportedCodepoint} from "./unicodeScripts";
import ParseError from "./ParseError";
import {combiningDiacriticalMarksEndRegex} from "./Lexer";
import Settings from "./Settings";
import SourceLocation from "./SourceLocation";
import {uSubsAndSups, unicodeSubRegEx} from "./unicodeSupOrSub";
import {Token} from "./Token";

// Pre-evaluate both modules as unicodeSymbols require String.normalize()
import unicodeAccents from /*preval*/ "./unicodeAccents";
import unicodeSymbols from /*preval*/ "./unicodeSymbols";

import type {NodeType, ParseNode, AnyParseNode, SymbolParseNode,
    UnsupportedCmdParseNode} from "./parseNode";
import type {Group} from "./atoms";
import type {Mode, ArgType, BreakToken} from "./types";
import type {FunctionContext, FunctionSpec} from "./defineFunction";
import type {EnvSpec} from "./defineEnvironment";

/**
 * This file contains the parser used to parse out a TeX expression from the
 * input. Since TeX isn't context-free, standard parsers don't work particularly
 * well.
 *
 * The strategy of this parser is as such:
 *
 * The main functions (the `.parse...` ones) take a position in the current
 * parse string to parse tokens from. The lexer (found in Lexer.js, stored at
 * this.gullet.lexer) also supports pulling out tokens at arbitrary places. When
 * individual tokens are needed at a position, the lexer is called to pull out a
 * token, which is then used.
 *
 * The parser has a property called "mode" indicating the mode that
 * the parser is currently in. Currently it has to be one of "math" or
 * "text", which denotes whether the current environment is a math-y
 * one or a text-y one (e.g. inside \text). Currently, this serves to
 * limit the functions which can be used in text mode.
 *
 * The main functions then return an object which contains the useful data that
 * was parsed at its given point, and a new position at the end of the parsed
 * data. The main functions can call each other and continue the parsing by
 * using the returned position as a new starting point.
 *
 * There are also extra `.handle...` functions, which pull out some reused
 * functionality into self-contained functions.
 *
 * The functions return ParseNodes.
 */

export default class Parser {
    mode: Mode;
    gullet: MacroExpander;
    settings: Settings;
    leftrightDepth: number;
    nextToken: Token | null;

    constructor(input: string, settings: Settings) {
        // Start in math mode
        this.mode = "math";
        // Create a new macro expander (gullet) and (indirectly via that) also a
        // new lexer (mouth) for this parser (stomach, in the language of TeX)
        this.gullet = new MacroExpander(input, settings, this.mode);
        // Store the settings for use in parsing
        this.settings = settings;
        // Count leftright depth (for \middle errors)
        this.leftrightDepth = 0;
        this.nextToken = null;
    }

    /**
     * Checks a result to make sure it has the right type, and throws an
     * appropriate error otherwise.
     */
    expect(text: string, consume = true) {
        if (this.fetch().text !== text) {
            throw new ParseError(
                `Expected '${text}', got '${this.fetch().text}'`, this.fetch()
            );
        }
        if (consume) {
            this.consume();
        }
    }

    /**
     * Discards the current lookahead token, considering it consumed.
     */
    consume() {
        this.nextToken = null;
    }

    /**
     * Return the current lookahead token, or if there isn't one (at the
     * beginning, or if the previous lookahead token was consume()d),
     * fetch the next token as the new lookahead token and return it.
     */
    fetch(): Token {
        if (this.nextToken == null) {
            this.nextToken = this.gullet.expandNextToken();
        }
        return this.nextToken;
    }

    /**
     * Switches between "text" and "math" modes.
     */
    switchMode(newMode: Mode) {
        this.mode = newMode;
        this.gullet.switchMode(newMode);
    }

    /**
     * Main parsing function, which parses an entire input.
     */
    parse(): AnyParseNode[] {
        if (!this.settings.globalGroup) {
            // Create a group namespace for the math expression.
            // (LaTeX creates a new group for every $...$, $$...$$, \[...\].)
            this.gullet.beginGroup();
        }

        // Use old \color behavior (same as LaTeX's \textcolor) if requested.
        // We do this within the group for the math expression, so it doesn't
        // pollute settings.macros.
        if (this.settings.colorIsTextColor) {
            this.gullet.macros.set("\\color", "\\textcolor");
        }

        try {
            // Try to parse the input
            const parse = this.parseExpression(false);

            // If we succeeded, make sure there's an EOF at the end
            this.expect("EOF");

            // End the group namespace for the expression
            if (!this.settings.globalGroup) {
                this.gullet.endGroup();
            }

            return parse;

        // Close any leftover groups in case of a parse error.
        } finally {
            this.gullet.endGroups();
        }
    }

    /**
     * Fully parse a separate sequence of tokens as a separate job.
     * Tokens should be specified in reverse order, as in a MacroDefinition.
     */
    subparse(tokens: Token[]): AnyParseNode[] {
        // Save the next token from the current job.
        const oldToken = this.nextToken;
        this.consume();

        // Run the new job, terminating it with an excess '}'
        this.gullet.pushToken(new Token("}"));
        this.gullet.pushTokens(tokens);
        const parse = this.parseExpression(false);
        this.expect("}");

        // Restore the next token from the current job.
        this.nextToken = oldToken;

        return parse;
    }

    static endOfExpression: Set<string> =
        new Set(["}", "\\endgroup", "\\end", "\\right", "&"]);

    /**
     * Parses an "expression", which is a list of atoms.
     *
     * `breakOnInfix`: Should the parsing stop when we hit infix nodes? This
     *                 happens when functions have higher precedence than infix
     *                 nodes in implicit parses.
     *
     * `breakOnTokenText`: The text of the token that the expression should end
     *                     with, or `null` if something else should end the
     *                     expression.
     */
    parseExpression(
        breakOnInfix: boolean,
        breakOnTokenText?: BreakToken,
    ): AnyParseNode[] {
        const body = [];
        // Keep adding atoms to the body until we can't parse any more atoms (either
        // we reached the end, a }, or a \right)
        while (true) {
            // Ignore spaces in math mode
            if (this.mode === "math") {
                this.consumeSpaces();
            }
            const lex = this.fetch();
            if (Parser.endOfExpression.has(lex.text)) {
                break;
            }
            if (breakOnTokenText && lex.text === breakOnTokenText) {
                break;
            }
            if (breakOnInfix && functions[lex.text] && functions[lex.text].infix) {
                break;
            }
            const atom = this.parseAtom(breakOnTokenText);
            if (!atom) {
                break;
            } else if (atom.type === "internal") {
                // Internal nodes do not appear in parse tree
                continue;
            }
            body.push(atom);
        }
        if (this.mode === "text") {
            this.formLigatures(body);
        }
        return this.handleInfixNodes(body);
    }

    /**
     * Rewrites infix operators such as \over with corresponding commands such
     * as \frac.
     *
     * There can only be one infix operator per group.  If there's more than one
     * then the expression is ambiguous.  This can be resolved by adding {}.
     */
    handleInfixNodes(body: AnyParseNode[]): AnyParseNode[] {
        let overIndex = -1;
        let funcName;

        for (let i = 0; i < body.length; i++) {
            const node = body[i];
            if (node.type === "infix") {
                if (overIndex !== -1) {
                    throw new ParseError(
                        "only one infix operator per group",
                        node.token);
                }
                overIndex = i;
                funcName = node.replaceWith;
            }
        }

        if (overIndex !== -1 && funcName) {
            let numerNode: AnyParseNode;
            let denomNode: AnyParseNode;

            const numerBody = body.slice(0, overIndex);
            const denomBody = body.slice(overIndex + 1);

            if (numerBody.length === 1 && numerBody[0].type === "ordgroup") {
                numerNode = numerBody[0];
            } else {
                numerNode = {type: "ordgroup", mode: this.mode, body: numerBody};
            }

            if (denomBody.length === 1 && denomBody[0].type === "ordgroup") {
                denomNode = denomBody[0];
            } else {
                denomNode = {type: "ordgroup", mode: this.mode, body: denomBody};
            }

            let node;
            if (funcName === "\\\\abovefrac") {
                node = this.callFunction(funcName,
                    [numerNode, body[overIndex], denomNode], []);
            } else {
                node = this.callFunction(funcName, [numerNode, denomNode], []);
            }
            return [node];
        } else {
            return body;
        }
    }

    /**
     * Handle a subscript or superscript with nice errors.
     */
    handleSupSubscript(
        name: string,   // For error reporting.
    ): AnyParseNode {
        const symbolToken = this.fetch();
        const symbol = symbolToken.text;
        this.consume();
        this.consumeSpaces(); // ignore spaces before sup/subscript argument

        // Skip over allowed internal nodes such as \relax
        let group: AnyParseNode | null | undefined;
        do {
            group = this.parseGroup(name);
        } while (group?.type === "internal");

        if (!group) {
            throw new ParseError(
                "Expected group after '" + symbol + "'",
                symbolToken
            );
        }

        return group;
    }

    /**
     * Converts the textual input of an unsupported command into a text node
     * contained within a color node whose color is determined by errorColor
     */
    formatUnsupportedCmd(text: string): UnsupportedCmdParseNode {
        const textordArray: ParseNode<"textord">[] = [];

        for (let i = 0; i < text.length; i++) {
            textordArray.push({type: "textord", mode: "text", text: text[i]});
        }

        const textNode: ParseNode<"text"> = {
            type: "text",
            mode: this.mode,
            body: textordArray,
        };
        const colorNode: ParseNode<"color"> = {
            type: "color",
            mode: this.mode,
            color: this.settings.errorColor,
            body: [textNode],
        };

        return colorNode;
    }

    /**
     * Parses a group with optional super/subscripts.
     */
    parseAtom(breakOnTokenText?: BreakToken): AnyParseNode | null | undefined {
        // The body of an atom is an implicit group, so that things like
        // \left(x\right)^2 work correctly.
        const base = this.parseGroup("atom", breakOnTokenText);

        // Internal nodes (e.g. \relax) cannot support super/subscripts.
        // Instead we will pick up super/subscripts with blank base next round.
        if (base?.type === "internal") {
            return base;
        }

        // In text mode, we don't have superscripts or subscripts
        if (this.mode === "text") {
            return base;
        }

        // Note that base may be empty (i.e. null) at this point.

        let superscript: AnyParseNode | null | undefined;
        let subscript: AnyParseNode | null | undefined;
        while (true) {
            // Guaranteed in math mode, so eat any spaces first.
            this.consumeSpaces();

            // Lex the first token
            const lex = this.fetch();

            if (lex.text === "\\limits" || lex.text === "\\nolimits") {
                // We got a limit control
                if (base && base.type === "op") {
                    const limits = lex.text === "\\limits";
                    base.limits = limits;
                    base.alwaysHandleSupSub = true;
                } else if (base && base.type === "operatorname") {
                    if (base.alwaysHandleSupSub) {
                        base.limits = lex.text === "\\limits";
                    }
                } else {
                    throw new ParseError(
                        "Limit controls must follow a math operator",
                        lex);
                }
                this.consume();
            } else if (lex.text === "^") {
                // We got a superscript start
                if (superscript) {
                    throw new ParseError("Double superscript", lex);
                }
                superscript = this.handleSupSubscript("superscript");
            } else if (lex.text === "_") {
                // We got a subscript start
                if (subscript) {
                    throw new ParseError("Double subscript", lex);
                }
                subscript = this.handleSupSubscript("subscript");
            } else if (lex.text === "'") {
                // We got a prime
                if (superscript) {
                    throw new ParseError("Double superscript", lex);
                }

                const prime: ParseNode<"textord"> = {type: "textord", mode: this.mode, text: "\\prime"};

                // Many primes can be grouped together, so we handle this here
                const primes: AnyParseNode[] = [prime];
                this.consume();
                // Keep lexing tokens until we get something that's not a prime
                while (this.fetch().text === "'") {
                    // For each one, add another prime to the list
                    primes.push(prime);
                    this.consume();
                }
                // If there's a superscript following the primes, combine that
                // superscript in with the primes.
                if (this.fetch().text === "^") {
                    primes.push(this.handleSupSubscript("superscript"));
                }
                // Put everything into an ordgroup as the superscript
                superscript = {type: "ordgroup", mode: this.mode, body: primes};
            } else if (uSubsAndSups[lex.text]) {
                // A Unicode subscript or superscript character.
                // We treat these similarly to the unicode-math package.
                // So we render a string of Unicode (sub|super)scripts the
                // same as a (sub|super)script of regular characters.
                const isSub = unicodeSubRegEx.test(lex.text);
                const subsupTokens = [];
                subsupTokens.push(new Token(uSubsAndSups[lex.text]));
                this.consume();
                // Continue fetching tokens to fill out the string.
                while (true) {
                    const token = this.fetch().text;
                    if (!(uSubsAndSups[token])) { break; }
                    if (unicodeSubRegEx.test(token) !== isSub) { break; }
                    subsupTokens.unshift(new Token(uSubsAndSups[token]));
                    this.consume();
                }
                // Now create a (sub|super)script.
                const body = this.subparse(subsupTokens);
                if (isSub) {
                    subscript = {type: "ordgroup", mode: "math", body};
                } else {
                    superscript = {type: "ordgroup", mode: "math", body};
                }
            } else {
                // If it wasn't ^, _, or ', stop parsing super/subscripts
                break;
            }
        }

        // Base must be set if superscript or subscript are set per logic above,
        // but need to check here for type check to pass.
        if (superscript || subscript) {
            // If we got either a superscript or subscript, create a supsub
            return {
                type: "supsub",
                mode: this.mode,
                base: base,
                sup: superscript,
                sub: subscript,
            };
        } else {
            // Otherwise return the original body
            return base;
        }
    }

    /**
     * Parses an entire function, including its base and all of its arguments.
     */
    parseFunction(
        breakOnTokenText?: BreakToken,
        name?: string, // For determining its context
    ): AnyParseNode | null | undefined {
        const token = this.fetch();
        const func = token.text;
        const funcData = functions[func];
        if (!funcData) {
            return null;
        }
        this.consume(); // consume command token

        if (name && name !== "atom" && !funcData.allowedInArgument) {
            throw new ParseError(
                "Got function '" + func + "' with no arguments" +
                (name ? " as " + name : ""), token);
        } else if (this.mode === "text" && !funcData.allowedInText) {
            throw new ParseError(
                "Can't use function '" + func + "' in text mode", token);
        } else if (this.mode === "math" && funcData.allowedInMath === false) {
            throw new ParseError(
                "Can't use function '" + func + "' in math mode", token);
        }

        const {args, optArgs} = this.parseArguments(func, funcData);
        return this.callFunction(func, args, optArgs, token, breakOnTokenText);
    }

    /**
     * Call a function handler with a suitable context and arguments.
     */
    callFunction(
        name: string,
        args: AnyParseNode[],
        optArgs: (AnyParseNode | null | undefined)[],
        token?: Token,
        breakOnTokenText?: BreakToken,
    ): AnyParseNode {
        const context: FunctionContext = {
            funcName: name,
            parser: this,
            token,
            breakOnTokenText,
        };
        const func = functions[name];
        if (func && func.handler) {
            return func.handler(context, args, optArgs);
        } else {
            throw new ParseError(`No function handler for ${name}`);
        }
    }

    /**
     * Parses the arguments of a function or environment
     */
    parseArguments(
        func: string,   // Should look like "\name" or "\begin{name}".
        funcData: FunctionSpec<NodeType> | EnvSpec<NodeType>,
    ): {
        args: AnyParseNode[];
        optArgs: (AnyParseNode | null | undefined)[];
    } {
        const totalArgs = funcData.numArgs + funcData.numOptionalArgs;
        if (totalArgs === 0) {
            return {args: [], optArgs: []};
        }

        const args: AnyParseNode[] = [];
        const optArgs: (AnyParseNode | null | undefined)[] = [];

        for (let i = 0; i < totalArgs; i++) {
            let argType = funcData.argTypes && funcData.argTypes[i];
            const isOptional = i < funcData.numOptionalArgs;

            if (("primitive" in funcData && funcData.primitive && argType == null) ||
                // \sqrt expands into primitive if optional argument doesn't exist
                (funcData.type === "sqrt" && i === 1 && optArgs[0] == null)
            ) {
                argType = "primitive";
            }

            const arg = this.parseGroupOfType(`argument to '${func}'`,
                argType as ArgType | null | undefined, isOptional);
            if (isOptional) {
                optArgs.push(arg);
            } else if (arg != null) {
                args.push(arg);
            } else { // should be unreachable
                throw new ParseError("Null argument, please report this as a bug");
            }
        }

        return {args, optArgs};
    }

    /**
     * Parses a group when the mode is changing.
     */
    parseGroupOfType(
        name: string,
        type: ArgType | null | undefined,
        optional: boolean,
    ): AnyParseNode | null | undefined {
        switch (type) {
            case "color":
                return this.parseColorGroup(optional);
            case "size":
                return this.parseSizeGroup(optional);
            case "url":
                return this.parseUrlGroup(optional);
            case "math":
            case "text":
                return this.parseArgumentGroup(optional, type);
            case "hbox": {
                // hbox argument type wraps the argument in the equivalent of
                // \hbox, which is like \text but switching to \textstyle size
                // and resetting math font.
                const group = this.parseArgumentGroup(optional, "text");
                return group != null ? {
                    type: "styling",
                    mode: group.mode,
                    body: [group],
                    style: "text", // simulate \textstyle
                    resetFont: true,
                } : null;
            }
            case "raw": {
                const token = this.parseStringGroup("raw", optional);
                return token != null ? {
                    type: "raw",
                    mode: "text",
                    string: token.text,
                } : null;
            }
            case "primitive": {
                if (optional) {
                    throw new ParseError("A primitive argument cannot be optional");
                }
                const group = this.parseGroup(name);
                if (group == null) {
                    throw new ParseError("Expected group as " + name, this.fetch());
                }
                return group;
            }
            case "original":
            case null:
            case undefined:
                return this.parseArgumentGroup(optional);
            default:
                throw new ParseError(
                    "Unknown group type as " + name, this.fetch());
        }
    }

    /**
     * Discard any space tokens, fetching the next non-space token.
     */
    consumeSpaces() {
        while (this.fetch().text === " ") {
            this.consume();
        }
    }

    /**
     * Parses a group, essentially returning the string formed by the
     * brace-enclosed tokens plus some position information.
     */
    parseStringGroup(
        modeName: ArgType,  // Used to describe the mode in error messages.
        optional: boolean,
    ): Token | null | undefined {
        const argToken = this.gullet.scanArgument(optional);
        if (argToken == null) {
            return null;
        }
        let str = "";
        let nextToken: Token;
        while ((nextToken = this.fetch()).text !== "EOF") {
            str += nextToken.text;
            this.consume();
        }
        this.consume(); // consume the end of the argument
        argToken.text = str;
        return argToken;
    }

    /**
     * Parses a regex-delimited group: the largest sequence of tokens
     * whose concatenated strings match `regex`. Returns the string
     * formed by the tokens plus some position information.
     */
    parseRegexGroup(
        regex: RegExp,
        modeName: string,   // Used to describe the mode in error messages.
    ): Token {
        const firstToken = this.fetch();
        let lastToken = firstToken;
        let str = "";
        let nextToken: Token;
        while ((nextToken = this.fetch()).text !== "EOF" &&
               regex.test(str + nextToken.text)) {
            lastToken = nextToken;
            str += lastToken.text;
            this.consume();
        }
        if (str === "") {
            throw new ParseError(
                "Invalid " + modeName + ": '" + firstToken.text + "'",
                firstToken);
        }
        return firstToken.range(lastToken, str);
    }

    /**
     * Parses a color description.
     */
    parseColorGroup(optional: boolean): ParseNode<"color-token"> | null | undefined {
        const res = this.parseStringGroup("color", optional);
        if (res == null) {
            return null;
        }
        const match = (
            /^(#[a-f0-9]{3,4}|#[a-f0-9]{6}|#[a-f0-9]{8}|[a-f0-9]{6}|[a-z]+)$/i
        ).exec(res.text);
        if (!match) {
            throw new ParseError("Invalid color: '" + res.text + "'", res);
        }
        let color = match[0];
        if (/^[0-9a-f]{6}$/i.test(color)) {
            // We allow a 6-digit HTML color spec without a leading "#".
            // This follows the xcolor package's HTML color model.
            // Predefined color names are all missed by this RegEx pattern.
            color = "#" + color;
        }

        return {
            type: "color-token",
            mode: this.mode,
            color,
        };
    }

    /**
     * Parses a size specification, consisting of magnitude and unit.
     */
    parseSizeGroup(optional: boolean): ParseNode<"size"> | null | undefined {
        let res: Token | null | undefined;
        let isBlank = false;
        // don't expand before parseStringGroup
        this.gullet.consumeSpaces();
        if (!optional && this.gullet.future().text !== "{") {
            res = this.parseRegexGroup(
                /^[-+]? *(?:$|\d+|\d+\.\d*|\.\d*) *[a-z]{0,2} *$/, "size");
        } else {
            res = this.parseStringGroup("size", optional);
        }
        if (!res) {
            return null;
        }
        if (!optional && res.text.length === 0) {
            // Because we've tested for what is !optional, this block won't
            // affect \kern, \hspace, etc. It will capture the mandatory arguments
            // to \genfrac and \above.
            res.text = "0pt";    // Enable \above{}
            isBlank = true;      // This is here specifically for \genfrac
        }
        const match = (/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/).exec(res.text);
        if (!match) {
            throw new ParseError("Invalid size: '" + res.text + "'", res);
        }
        const data = {
            number: +(match[1] + match[2]), // sign + magnitude, cast to number
            unit: match[3],
        };
        if (!validUnit(data)) {
            throw new ParseError("Invalid unit: '" + data.unit + "'", res);
        }

        return {
            type: "size",
            mode: this.mode,
            value: data,
            isBlank,
        };
    }

    /**
     * Parses an URL, checking escaped letters and allowed protocols,
     * and setting the catcode of % as an active character (as in \hyperref).
     */
    parseUrlGroup(optional: boolean): ParseNode<"url"> | null | undefined {
        this.gullet.lexer.setCatcode("%", 13); // active character
        this.gullet.lexer.setCatcode("~", 12); // other character
        const res = this.parseStringGroup("url", optional);
        this.gullet.lexer.setCatcode("%", 14); // comment character
        this.gullet.lexer.setCatcode("~", 13); // active character
        if (res == null) {
            return null;
        }
        // hyperref package allows backslashes alone in href, but doesn't
        // generate valid links in such cases; we interpret this as
        // "undefined" behaviour, and keep them as-is. Some browser will
        // replace backslashes with forward slashes.
        const url = res.text.replace(/\\([#$%&~_^{}])/g, '$1');
        return {
            type: "url",
            mode: this.mode,
            url,
        };
    }

    /**
     * Parses an argument with the mode specified.
     */
    parseArgumentGroup(optional: boolean, mode?: Mode): ParseNode<"ordgroup"> | null | undefined {
        const argToken = this.gullet.scanArgument(optional);
        if (argToken == null) {
            return null;
        }
        const outerMode = this.mode;
        if (mode) { // Switch to specified mode
            this.switchMode(mode);
        }

        this.gullet.beginGroup();
        const expression = this.parseExpression(false, "EOF");
        // TODO: find an alternative way to denote the end
        this.expect("EOF"); // expect the end of the argument
        this.gullet.endGroup();
        const result: ParseNode<"ordgroup"> = {
            type: "ordgroup",
            mode: this.mode,
            loc: argToken.loc,
            body: expression,
        };

        if (mode) { // Switch mode back
            this.switchMode(outerMode);
        }
        return result;
    }

    /**
     * Parses an ordinary group, which is either a single nucleus (like "x")
     * or an expression in braces (like "{x+y}") or an implicit group, a group
     * that starts at the current position, and ends right before a higher explicit
     * group ends, or at EOF.
     */
    parseGroup(
        name: string, // For error reporting.
        breakOnTokenText?: BreakToken,
    ): AnyParseNode | null | undefined {
        const firstToken = this.fetch();
        const text = firstToken.text;

        let result: AnyParseNode | null | undefined;
        // Try to parse an open brace or \begingroup
        if (text === "{" || text === "\\begingroup") {
            this.consume();
            const groupEnd = text === "{" ? "}" : "\\endgroup";

            this.gullet.beginGroup();
            // If we get a brace, parse an expression
            const expression = this.parseExpression(false, groupEnd);
            const lastToken = this.fetch();
            this.expect(groupEnd); // Check that we got a matching closing brace
            this.gullet.endGroup();
            result = {
                type: "ordgroup",
                mode: this.mode,
                loc: SourceLocation.range(firstToken, lastToken),
                body: expression,
                // A group formed by \begingroup...\endgroup is a semi-simple group
                // which doesn't affect spacing in math mode, i.e., is transparent.
                // https://tex.stackexchange.com/questions/1930/when-should-one-
                // use-begingroup-instead-of-bgroup
                semisimple: text === "\\begingroup" || undefined,
            };
        } else {
            // If there exists a function with this name, parse the function.
            // Otherwise, just return a nucleus
            result = this.parseFunction(breakOnTokenText, name) ||
                this.parseSymbol();
            if (result == null && text[0] === "\\" &&
                    !implicitCommands.hasOwnProperty(text)) {
                if (this.settings.throwOnError) {
                    throw new ParseError(
                        "Undefined control sequence: " + text, firstToken);
                }
                result = this.formatUnsupportedCmd(text);
                this.consume();
            }
        }
        return result;
    }

    /**
     * Form ligature-like combinations of characters for text mode.
     * This includes inputs like "--", "---", "``" and "''".
     * The result will simply replace multiple textord nodes with a single
     * character in each value by a single textord node having multiple
     * characters in its value.  The representation is still ASCII source.
     * The group will be modified in place.
     */
    formLigatures(group: AnyParseNode[]) {
        let n = group.length - 1;
        for (let i = 0; i < n; ++i) {
            const a = group[i];
            if (a.type !== "textord") {
                continue;
            }
            const v = a.text;
            const next = group[i + 1];
            if (!next || next.type !== "textord") {
                continue;
            }
            if (v === "-" && next.text === "-") {
                const afterNext = group[i + 2];
                if (i + 1 < n && afterNext && afterNext.type === "textord" && afterNext.text === "-") {
                    group.splice(i, 3, {
                        type: "textord",
                        mode: "text",
                        loc: SourceLocation.range(a, afterNext),
                        text: "---",
                    });
                    n -= 2;
                } else {
                    group.splice(i, 2, {
                        type: "textord",
                        mode: "text",
                        loc: SourceLocation.range(a, next),
                        text: "--",
                    });
                    n -= 1;
                }
            }
            if ((v === "'" || v === "`") && next.text === v) {
                group.splice(i, 2, {
                    type: "textord",
                    mode: "text",
                    loc: SourceLocation.range(a, next),
                    text: v + v,
                });
                n -= 1;
            }
        }
    }

    /**
     * Parse a single symbol out of the string. Here, we handle single character
     * symbols and special functions like \verb.
     */
    parseSymbol(): AnyParseNode | null | undefined {
        const nucleus = this.fetch();
        let text = nucleus.text;

        if (/^\\verb[^a-zA-Z]/.test(text)) {
            this.consume();
            let arg = text.slice(5);
            const star = (arg.charAt(0) === "*");
            if (star) {
                arg = arg.slice(1);
            }
            // Lexer's tokenRegex is constructed to always have matching
            // first/last characters.
            if (arg.length < 2 || arg.charAt(0) !== arg.slice(-1)) {
                throw new ParseError(`\\verb assertion failed --
                    please report what input caused this bug`);
            }
            arg = arg.slice(1, -1);  // remove first and last char

            return {
                type: "verb",
                mode: "text",
                body: arg,
                star,
            };
        }
        // At this point, we should have a symbol, possibly with accents.
        // First expand any accented base symbol according to unicodeSymbols.
        if (unicodeSymbols.hasOwnProperty(text[0]) &&
            !symbols[this.mode][text[0]]) {
            // This behavior is not strict (XeTeX-compatible) in math mode.
            if (this.settings.strict && this.mode === "math") {
                this.settings.reportNonstrict("unicodeTextInMathMode",
                    `Accented Unicode text character "${text[0]}" used in ` +
                    `math mode`, nucleus);
            }
            text = unicodeSymbols[text[0]] + text.slice(1);
        }
        // Strip off any combining characters
        const match = combiningDiacriticalMarksEndRegex.exec(text);
        if (match) {
            text = text.substring(0, match.index);
            if (text === 'i') {
                text = '\u0131';  // dotless i, in math and text mode
            } else if (text === 'j') {
                text = '\u0237';  // dotless j, in math and text mode
            }
        }
        // Recognize base symbol
        let symbol: AnyParseNode;
        if (symbols[this.mode][text]) {
            if (this.settings.strict && this.mode === 'math' &&
                extraLatin.includes(text)) {
                this.settings.reportNonstrict("unicodeTextInMathMode",
                    `Latin-1/Unicode text character "${text[0]}" used in ` +
                    `math mode`, nucleus);
            }
            const group: Group = symbols[this.mode][text].group;
            const loc = SourceLocation.range(nucleus);
            let s: SymbolParseNode;
            if (isAtom(group)) {
                s = {
                    type: "atom",
                    mode: this.mode,
                    family: group,
                    loc,
                    text,
                };
            } else {
                s = {
                    type: group,
                    mode: this.mode,
                    loc,
                    text,
                };
            }
            symbol = s;
        } else if (text.charCodeAt(0) >= 0x80) { // no symbol for e.g. ^
            if (this.settings.strict) {
                if (!supportedCodepoint(text.charCodeAt(0))) {
                    this.settings.reportNonstrict("unknownSymbol",
                        `Unrecognized Unicode character "${text[0]}"` +
                        ` (${text.charCodeAt(0)})`, nucleus);
                } else if (this.mode === "math") {
                    this.settings.reportNonstrict("unicodeTextInMathMode",
                        `Unicode text character "${text[0]}" used in math mode`,
                        nucleus);
                }
            }
            // All nonmathematical Unicode characters are rendered as if they
            // are in text mode (wrapped in \text) because that's what it
            // takes to render them in LaTeX.  Setting `mode: this.mode` is
            // another natural choice (the user requested math mode), but
            // this makes it more difficult for getCharacterMetrics() to
            // distinguish Unicode characters without metrics and those for
            // which we want to simulate the letter M.
            symbol = {
                type: "textord",
                mode: "text",
                loc: SourceLocation.range(nucleus),
                text,
            };
        } else {
            return null;  // EOF, ^, _, {, }, etc.
        }
        this.consume();
        // Transform combining characters into accents
        if (match) {
            for (let i = 0; i < match[0].length; i++) {
                const accent: string = match[0][i];
                if (!unicodeAccents[accent]) {
                    throw new ParseError(`Unknown accent ' ${accent}'`, nucleus);
                }
                const command = unicodeAccents[accent][this.mode] ||
                    unicodeAccents[accent].text;
                if (!command) {
                    throw new ParseError(
                        `Accent ${accent} unsupported in ${this.mode} mode`,
                        nucleus);
                }
                symbol = {
                    type: "accent",
                    mode: this.mode,
                    loc: SourceLocation.range(nucleus),
                    label: command,
                    isStretchy: false,
                    isShifty: true,
                    base: symbol,
                };
            }
        }
        return symbol;
    }
}
)QxT@/* eslint no-console:0 */
/**
 * This is a module for storing settings passed into KaTeX. It correctly handles
 * default settings.
 */

import {protocolFromUrl} from "./utils";
import ParseError from "./ParseError";
import {Token} from "./Token";

import type {AnyParseNode} from "./parseNode";
import type {MacroMap} from "./defineMacro";

export type StrictFunction =
    (errorCode: string, errorMsg: string, token?: Token | AnyParseNode) =>
    (boolean | string) | null | undefined;

export type TrustContextTypes = {
    "\\href": {
        command: "\\href";
        url: string;
        protocol?: string;
    };
    "\\includegraphics": {
        command: "\\includegraphics";
        url: string;
        protocol?: string;
    };
    "\\url": {
        command: "\\url";
        url: string;
        protocol?: string;
    };
    "\\htmlClass": {
        command: "\\htmlClass";
        class: string;
    };
    "\\htmlId": {
        command: "\\htmlId";
        id: string;
    };
    "\\htmlStyle": {
        command: "\\htmlStyle";
        style: string;
    };
    "\\htmlData": {
        command: "\\htmlData";
        attributes: Record<string, string>;
    };
};
export type AnyTrustContext = TrustContextTypes[keyof TrustContextTypes];
export type TrustFunction = (context: AnyTrustContext) => boolean | null | undefined;
export type SettingsOptions = Partial<Settings>;

type EnumType<T extends string = string> = {
    enum: T[];
};

type Type = "boolean" | "string" | "number" | "object" | "function" | EnumType;
/**
 * Union of all values that appear as schema defaults, cliDefaults, or
 * cliProcessor return values.  StrictFunction / TrustFunction are
 * option-value types, not default/schema values, so they are excluded.
 */
type SettingsValue = boolean | string | number | MacroMap | string[];
type DefaultValue = Exclude<SettingsValue, string[]>;

type SchemaMetadata<K extends keyof SettingsOptions> = {
    /**
     * The description.
     */
    description?: string;
    /**
     * The function to process the option.
     */
    processor?: (value: Settings[K]) => Settings[K];
    /**
     * The command line argument. See Commander.js docs for more information.
     * If not specified, the name prefixed with -- will be used. Set false not
     * to add to the CLI.
     */
    cli?: string | false;
    /**
     * The default value for the CLI.
     */
    cliDefault?: SettingsValue;
    /**
     * The description for the CLI. If not specified, the description for the
     * option will be used.
     */
    cliDescription?: string;
    /**
     * The custom argument processor for the CLI. See Commander.js docs for
     * more information. Signature varies per setting (e.g. parseFloat,
     * or (def, defs) => defs.push(def) for macros).
     */
    cliProcessor?: (...args: any[]) => SettingsValue;
};

type BooleanSchema<K extends keyof SettingsOptions> = SchemaMetadata<K> & {
    /**
     * Allowed type(s) of the value.
     */
    type: "boolean";
    /**
     * The default value. If not specified, false will be used.
     */
    default?: Extract<Settings[K], boolean>;
};

type StringSchema<K extends keyof SettingsOptions> = SchemaMetadata<K> & {
    /**
     * Allowed type(s) of the value.
     */
    type: "string";
    /**
     * The default value. If not specified, an empty string will be used.
     */
    default?: Extract<Settings[K], string>;
};

type NumberSchema<K extends keyof SettingsOptions> = SchemaMetadata<K> & {
    /**
     * Allowed type(s) of the value.
     */
    type: "number";
    /**
     * The default value. If not specified, 0 will be used.
     */
    default?: Extract<Settings[K], number>;
};

type ObjectSchema<K extends keyof SettingsOptions> = SchemaMetadata<K> & {
    /**
     * Allowed type(s) of the value.
     */
    type: "object";
    /**
     * The default value. If not specified, an empty object will be used.
     */
    default?: Extract<Settings[K], MacroMap>;
};

type FunctionSchema<K extends keyof SettingsOptions> = SchemaMetadata<K> & {
    /**
     * Allowed type(s) of the value.
     */
    type: "function";
    /**
     * Settings do not currently use function-valued defaults.
     */
    default?: never;
};

type EnumSchema<K extends keyof SettingsOptions> = SchemaMetadata<K> & {
    /**
     * Allowed type(s) of the value.
     */
    type: EnumType<Extract<Settings[K], string>>;
    /**
     * The default value. If not specified, the first enum value will be used.
     */
    default?: Extract<Settings[K], string>;
};

type SingleTypeSchema<K extends keyof SettingsOptions> =
    | BooleanSchema<K>
    | StringSchema<K>
    | NumberSchema<K>
    | ObjectSchema<K>
    | FunctionSchema<K>
    | EnumSchema<K>;

type MultiTypeSchema<K extends keyof SettingsOptions> = SchemaMetadata<K> & {
    /**
     * Allowed type(s) of the value.
     */
    type: [SingleTypeSchema<K>["type"], ...Array<SingleTypeSchema<K>["type"]>];
    /**
     * The default value. If not specified, the first allowed type determines
     * the default value.
     */
    default?: Extract<Settings[K], DefaultValue>;
};

type SchemaEntry<K extends keyof SettingsOptions> =
    | SingleTypeSchema<K>
    | MultiTypeSchema<K>;

type Schema = {
    [key in keyof SettingsOptions]?: SchemaEntry<key>;
};

// TODO: automatically generate documentation
// TODO: check all properties on Settings exist
// TODO: check the type of a property on Settings matches
export const SETTINGS_SCHEMA: Schema = {
    displayMode: {
        type: "boolean",
        description: "Render math in display mode, which puts the math in " +
            "display style (so \\int and \\sum are large, for example), and " +
            "centers the math on the page on its own line.",
        cli: "-d, --display-mode",
    },
    output: {
        type: {enum: ["htmlAndMathml", "html", "mathml"]},
        description: "Determines the markup language of the output.",
        cli: "-F, --format <type>",
    },
    leqno: {
        type: "boolean",
        description: "Render display math in leqno style (left-justified tags).",
    },
    fleqn: {
        type: "boolean",
        description: "Render display math flush left.",
    },
    throwOnError: {
        type: "boolean",
        default: true,
        cli: "-t, --no-throw-on-error",
        cliDescription: "Render errors (in the color given by --error-color) ins" +
            "tead of throwing a ParseError exception when encountering an error.",
    },
    errorColor: {
        type: "string",
        default: "#cc0000",
        cli: "-c, --error-color <color>",
        cliDescription: "A color string given in the format 'rgb' or 'rrggbb' " +
            "(no #). This option determines the color of errors rendered by the " +
            "-t option.",
        cliProcessor: (color) => "#" + color,
    },
    macros: {
        type: "object",
        cli: "-m, --macro <def>",
        cliDescription: "Define custom macro of the form '\\foo:expansion' (use " +
            "multiple -m arguments for multiple macros).",
        cliDefault: [],
        cliProcessor: (def, defs) => {
            defs.push(def);
            return defs;
        },
    },
    minRuleThickness: {
        type: "number",
        description: "Specifies a minimum thickness, in ems, for fraction lines," +
            " `\\sqrt` top lines, `{array}` vertical lines, `\\hline`, " +
            "`\\hdashline`, `\\underline`, `\\overline`, and the borders of " +
            "`\\fbox`, `\\boxed`, and `\\fcolorbox`.",
        processor: (t) => Math.max(0, t),
        cli: "--min-rule-thickness <size>",
        cliProcessor: parseFloat,
    },
    colorIsTextColor: {
        type: "boolean",
        description: "Makes \\color behave like LaTeX's 2-argument \\textcolor, " +
            "instead of LaTeX's one-argument \\color mode change.",
        cli: "-b, --color-is-text-color",
    },
    strict: {
        type: [{enum: ["warn", "ignore", "error"]}, "boolean", "function"],
        description: "Turn on strict / LaTeX faithfulness mode, which throws an " +
            "error if the input uses features that are not supported by LaTeX.",
        cli: "-S, --strict",
        cliDefault: false,
    },
    trust: {
        type: ["boolean", "function"],
        description: "Trust the input, enabling all HTML features such as \\url.",
        cli: "-T, --trust",
    },
    maxSize: {
        type: "number",
        default: Infinity,
        description: "If non-zero, all user-specified sizes, e.g. in " +
            "\\rule{500em}{500em}, will be capped to maxSize ems. Otherwise, " +
            "elements and spaces can be arbitrarily large",
        processor: (s) => Math.max(0, s),
        cli: "-s, --max-size <n>",
        cliProcessor: parseInt,
    },
    maxExpand: {
        type: "number",
        default: 1000,
        description: "Limit the number of macro expansions to the specified " +
            "number, to prevent e.g. infinite macro loops. If set to Infinity, " +
            "the macro expander will try to fully expand as in LaTeX.",
        processor: (n) => Math.max(0, n),
        cli: "-e, --max-expand <n>",
        cliProcessor: (n) => (n === "Infinity" ? Infinity : parseInt(n)),
    },
    globalGroup: {
        type: "boolean",
        cli: false,
    },
};

function getImplicitDefault(type: "boolean"): boolean;
function getImplicitDefault(type: "string"): string;
function getImplicitDefault(type: "number"): number;
function getImplicitDefault(type: "object"): MacroMap;
function getImplicitDefault(type: "function"): never;
function getImplicitDefault<T extends string>(type: EnumType<T>): T;
function getImplicitDefault(type: Type): DefaultValue;
function getImplicitDefault(type: Type): DefaultValue {
    if (typeof type !== 'string') {
        return type.enum[0];
    }
    switch (type) {
        case 'boolean':
            return false;
        case 'string':
            return '';
        case 'number':
            return 0;
        case 'object':
            return {};
        default:
            throw new Error(
                "Unexpected schema type; settings must declare an explicit default.");
    }
}

function getDefaultValue<K extends keyof SettingsOptions>(
    schema: SchemaEntry<K>,
): Settings[K];
function getDefaultValue(schema: SchemaEntry<keyof SettingsOptions>): DefaultValue {
    if (schema.default !== undefined) {
        return schema.default;
    }
    const type = Array.isArray(schema.type) ? schema.type[0] : schema.type;
    return getImplicitDefault(type);
}

function applySetting<K extends keyof SettingsOptions>(
    target: Settings,
    prop: K,
    options: SettingsOptions,
    schema: SchemaEntry<K>,
) {
    const optionValue = options[prop];
    target[prop] = optionValue !== undefined
        ? (schema.processor
            ? schema.processor(optionValue)
            : optionValue)
        : getDefaultValue(schema);
}

/**
 * The main Settings object
 *
 * The current options stored are:
 *  - displayMode: Whether the expression should be typeset as inline math
 *                 (false, the default), meaning that the math starts in
 *                 \textstyle and is placed in an inline-block); or as display
 *                 math (true), meaning that the math starts in \displaystyle
 *                 and is placed in a block with vertical margin.
 */
export default class Settings {
    displayMode!: boolean;
    output!: "html" | "mathml" | "htmlAndMathml";
    leqno!: boolean;
    fleqn!: boolean;
    throwOnError!: boolean;
    errorColor!: string;
    macros!: MacroMap;
    minRuleThickness!: number;
    colorIsTextColor!: boolean;
    strict!: boolean | "ignore" | "warn" | "error" | StrictFunction;
    trust!: boolean | TrustFunction;
    maxSize!: number;
    maxExpand!: number;
    globalGroup!: boolean;

    constructor(options: SettingsOptions = {}) {
        // allow null options
        options = options || {};
        for (const prop of Object.keys(SETTINGS_SCHEMA) as Array<keyof SettingsOptions>) {
            const schema = SETTINGS_SCHEMA[prop] as SchemaEntry<typeof prop> | undefined;
            if (schema) {
                // TODO: validate options
                applySetting(this, prop, options, schema);
            }
        }
    }

    /**
     * Report nonstrict (non-LaTeX-compatible) input.
     * Can safely not be called if `this.strict` is false in JavaScript.
     */
    reportNonstrict(errorCode: string, errorMsg: string,
                    token?: Token | AnyParseNode) {
        let strict: Settings["strict"] | ReturnType<StrictFunction> = this.strict;
        if (typeof strict === "function") {
            // Allow return value of strict function to be boolean or string
            // (or null/undefined, meaning no further processing).
            strict = strict(errorCode, errorMsg, token);
        }
        if (!strict || strict === "ignore") {
            return;
        } else if (strict === true || strict === "error") {
            throw new ParseError(
                "LaTeX-incompatible input and strict mode is set to 'error': " +
                `${errorMsg} [${errorCode}]`, token);
        } else if (strict === "warn") {
            typeof console !== "undefined" && console.warn(
                "LaTeX-incompatible input and strict mode is set to 'warn': " +
                `${errorMsg} [${errorCode}]`);
        } else {  // won't happen in type-safe code
            typeof console !== "undefined" && console.warn(
                "LaTeX-incompatible input and strict mode is set to " +
                `unrecognized '${strict}': ${errorMsg} [${errorCode}]`);
        }
    }

    /**
     * Check whether to apply strict (LaTeX-adhering) behavior for unusual
     * input (like `\\`).  Unlike `nonstrict`, will not throw an error;
     * instead, "error" translates to a return value of `true`, while "ignore"
     * translates to a return value of `false`.  May still print a warning:
     * "warn" prints a warning and returns `false`.
     * This is for the second category of `errorCode`s listed in the README.
     */
    useStrictBehavior(errorCode: string, errorMsg: string,
                      token?: Token | AnyParseNode): boolean {
        let strict: Settings["strict"] | ReturnType<StrictFunction> = this.strict;
        if (typeof strict === "function") {
            // Allow return value of strict function to be boolean or string
            // (or null/undefined, meaning no further processing).
            // But catch any exceptions thrown by function, treating them
            // like "error".
            try {
                strict = strict(errorCode, errorMsg, token);
            } catch (error) {
                strict = "error";
            }
        }
        if (!strict || strict === "ignore") {
            return false;
        } else if (strict === true || strict === "error") {
            return true;
        } else if (strict === "warn") {
            typeof console !== "undefined" && console.warn(
                "LaTeX-incompatible input and strict mode is set to 'warn': " +
                `${errorMsg} [${errorCode}]`);
            return false;
        } else {  // won't happen in type-safe code
            typeof console !== "undefined" && console.warn(
                "LaTeX-incompatible input and strict mode is set to " +
                `unrecognized '${strict}': ${errorMsg} [${errorCode}]`);
            return false;
        }
    }

    /**
     * Check whether to test potentially dangerous input, and return
     * `true` (trusted) or `false` (untrusted).  The sole argument `context`
     * should be an object with `command` field specifying the relevant LaTeX
     * command (as a string starting with `\`), and any other arguments, etc.
     * If `context` has a `url` field, a `protocol` field will automatically
     * get added by this function (changing the specified object).
     */
    isTrusted(context: AnyTrustContext): boolean {
        if ("url" in context && context.url && !context.protocol) {
            const protocol = protocolFromUrl(context.url);
            if (protocol == null) {
                return false;
            }
            context.protocol = protocol;
        }
        const trust = typeof this.trust === "function"
            ? this.trust(context)
            : this.trust;
        return Boolean(trust);
    }
}
ʸ^ximport type {LexerInterface} from "./Token";

/**
 * Lexing or parsing positional information for error reporting.
 * This object is immutable.
 */
export default class SourceLocation {
    // The + prefix indicates that these fields aren't writeable
    readonly lexer: LexerInterface; // Lexer holding the input string.
    readonly start: number;         // Start offset, zero-based inclusive.
    readonly end: number;           // End offset, zero-based exclusive.

    constructor(lexer: LexerInterface, start: number, end: number) {
        this.lexer = lexer;
        this.start = start;
        this.end = end;
    }

    /**
     * Merges two `SourceLocation`s from location providers, given they are
     * provided in order of appearance.
     * - Returns the first one's location if only the first is provided.
     * - Returns a merged range of the first and the last if both are provided
     *   and their lexers match.
     * - Otherwise, returns null.
     */
    static range(
        first?: {loc?: SourceLocation | null | undefined},
        second?: {loc?: SourceLocation | null | undefined},
    ): SourceLocation | null | undefined {
        if (!second) {
            return first && first.loc;
        } else if (!first || !first.loc || !second.loc ||
                   first.loc.lexer !== second.loc.lexer) {
            return null;
        } else {
            return new SourceLocation(
                    first.loc.lexer, first.loc.start, second.loc.end);
        }
    }
}
cȰx/**
 * This file contains information and classes for the various kinds of styles
 * used in TeX. It provides a generic `Style` class, which holds information
 * about a specific style. It then provides instances of all the different kinds
 * of styles possible, and provides functions to move between them and get
 * information about them.
 */

/**
 * The main style class. Contains a unique id for the style, a size (which is
 * the same for cramped and uncramped version of a style), and a cramped flag.
 */
class Style implements StyleInterface {
    id: number;
    size: number;
    cramped: boolean;

    constructor(id: number, size: number, cramped: boolean) {
        this.id = id;
        this.size = size;
        this.cramped = cramped;
    }

    /**
     * Get the style of a superscript given a base in the current style.
     */
    sup(): Style {
        return styles[sup[this.id]];
    }

    /**
     * Get the style of a subscript given a base in the current style.
     */
    sub(): Style {
        return styles[sub[this.id]];
    }

    /**
     * Get the style of a fraction numerator given the fraction in the current
     * style.
     */
    fracNum(): Style {
        return styles[fracNum[this.id]];
    }

    /**
     * Get the style of a fraction denominator given the fraction in the current
     * style.
     */
    fracDen(): Style {
        return styles[fracDen[this.id]];
    }

    /**
     * Get the cramped version of a style (in particular, cramping a cramped style
     * doesn't change the style).
     */
    cramp(): Style {
        return styles[cramp[this.id]];
    }

    /**
     * Get a text or display version of this style.
     */
    text(): Style {
        return styles[text[this.id]];
    }

    /**
     * Return true if this style is tightly spaced (scriptstyle/scriptscriptstyle)
     */
    isTight(): boolean {
        return this.size >= 2;
    }
}

// Export an interface for type checking, but don't expose the implementation.
// This way, no more styles can be generated.
export interface StyleInterface {
    id: number;
    size: number;
    cramped: boolean;

    sup(): StyleInterface;
    sub(): StyleInterface;
    fracNum(): StyleInterface;
    fracDen(): StyleInterface;
    cramp(): StyleInterface;
    text(): StyleInterface;
    isTight(): boolean;
}

// IDs of the different styles
const D = 0;
const Dc = 1;
const T = 2;
const Tc = 3;
const S = 4;
const Sc = 5;
const SS = 6;
const SSc = 7;

// Instances of the different styles
const styles = [
    new Style(D, 0, false),
    new Style(Dc, 0, true),
    new Style(T, 1, false),
    new Style(Tc, 1, true),
    new Style(S, 2, false),
    new Style(Sc, 2, true),
    new Style(SS, 3, false),
    new Style(SSc, 3, true),
];

// Lookup tables for switching from one style to another
const sup = [S, Sc, S, Sc, SS, SSc, SS, SSc];
const sub = [Sc, Sc, Sc, Sc, SSc, SSc, SSc, SSc];
const fracNum = [T, Tc, S, Sc, SS, SSc, SS, SSc];
const fracDen = [Tc, Tc, Sc, Sc, SSc, SSc, SSc, SSc];
const cramp = [Dc, Dc, Tc, Tc, Sc, Sc, SSc, SSc];
const text = [D, Dc, T, Tc, T, Tc, T, Tc];

// We only export some of the styles.
export default {
    DISPLAY: (styles[D] as Style),
    TEXT: (styles[T] as Style),
    SCRIPT: (styles[S] as Style),
    SCRIPTSCRIPT: (styles[SS] as Style),
};
W9dxFimport SourceLocation from "./SourceLocation";

/**
 * Interface required to break circular dependency between Token, Lexer, and
 * ParseError.
 */
export interface LexerInterface {
    input: string;
    tokenRegex: RegExp;
}

/**
 * The resulting token returned from `lex`.
 *
 * It consists of the token text plus some position information.
 * The position information is essentially a range in an input string,
 * but instead of referencing the bare input string, we refer to the lexer.
 * That way it is possible to attach extra metadata to the input string,
 * like for example a file name or similar.
 *
 * The position information is optional, so it is OK to construct synthetic
 * tokens if appropriate. Not providing available position information may
 * lead to degraded error reporting, though.
 */
export class Token {
    text: string;
    loc: SourceLocation | null | undefined;
    noexpand: boolean | null | undefined; // don't expand the token
    treatAsRelax: boolean | null | undefined; // used in \noexpand

    constructor(
        text: string,           // the text of this token
        loc?: SourceLocation | null | undefined,
    ) {
        this.text = text;
        this.loc = loc;
    }

    /**
     * Given a pair of tokens (this and endToken), compute a `Token` encompassing
     * the whole input range enclosed by these two.
     */
    range(
        endToken: Token,  // last token of the range, inclusive
        text: string,     // the text of the newly constructed token
    ): Token {
        return new Token(text, SourceLocation.range(this, endToken));
    }
}
ַ;xH/**
 * Small module for atom-group constants and type guard.  Kept separate from
 * `symbols.ts` so that consumers (notably `contrib/render-a11y-string`) can
 * pull in `isAtom` without dragging in the ~870-line symbol tables.
 */

// Some of these have a "-token" suffix since these are also used as `ParseNode`
// types for raw text tokens, and we want to avoid conflicts with higher-level
// `ParseNode` types. These `ParseNode`s are constructed within `Parser` by
// looking up the `symbols` map.
export const ATOMS = {
    "bin": 1,
    "close": 1,
    "inner": 1,
    "open": 1,
    "punct": 1,
    "rel": 1,
};
export const NON_ATOMS = {
    "accent-token": 1,
    "mathord": 1,
    "op-token": 1,
    "spacing": 1,
    "textord": 1,
};

export type Atom = keyof typeof ATOMS;
export type NonAtom = keyof typeof NON_ATOMS;
export type Group = Atom | NonAtom;

export function isAtom(value: string): value is Atom {
    return value in ATOMS;
}
*3(xfD/* eslint no-console:0 */
/**
 * This module contains general functions that can be used for building
 * different kinds of domTree nodes in a consistent manner.
 */

import {SymbolNode, Anchor, Span, PathNode, SvgNode, createClass} from "./domTree";
import {getCharacterMetrics} from "./fontMetrics";
import symbols, {ligatures} from "./symbols";
import {wideCharacterFont} from "./wide-character";
import {calculateSize, makeEm} from "./units";
import {DocumentFragment} from "./tree";

import type Options from "./Options";
import type {ParseNode} from "./parseNode";
import type {Mode} from "./types";
import type {documentFragment as HtmlDocumentFragment} from "./domTree";
import type {HtmlDomNode, DomSpan, SvgSpan, CssStyle} from "./domTree";
import type {Measurement} from "./units";
import type {
    CharacterMetrics,
    FontName,
    FontShape,
    FontVariant,
    FontWeight,
    TextFont,
} from "./types/fonts";

/**
 * Looks up the given symbol in fontMetrics, after applying any symbol
 * replacements defined in symbol.js
 */
const lookupSymbol = function(
    value: string,
    fontName: FontName,
    mode: Mode,
): {
    value: string;
    metrics: CharacterMetrics | null | undefined;
} {
    // Replace the value with its replaced value from symbol.js
    if (symbols[mode][value]) {
        const replacement = symbols[mode][value].replace;
        if (replacement) {
            value = replacement;
        }
    }

    return {
        value,
        metrics: getCharacterMetrics(value, fontName, mode),
    };
};

/**
 * Makes a symbolNode after translation via the list of symbols in symbols.js.
 * Correctly pulls out metrics for the character, and optionally takes a list of
 * classes to be attached to the node.
 *
 * TODO: make argument order closer to makeSpan
 * TODO: add a separate argument for math class (e.g. `mop`, `mbin`), which
 * should if present come first in `classes`.
 * TODO(#953): Make `options` mandatory and always pass it in.
 */
export const makeSymbol = function(
    value: string,
    fontName: FontName,
    mode: Mode,
    options?: Options,
    classes?: string[],
): SymbolNode {
    const lookup = lookupSymbol(value, fontName, mode);
    const metrics = lookup.metrics;
    value = lookup.value;

    let symbolNode;
    if (metrics) {
        let italic = metrics.italic;
        if (mode === "text" || (options && options.font === "mathit")) {
            italic = 0;
        }
        symbolNode = new SymbolNode(
            value, metrics.height, metrics.depth, italic, metrics.skew,
            metrics.width, classes);
    } else {
        // TODO(emily): Figure out a good way to only print this in development
        typeof console !== "undefined" && console.warn("No character metrics " +
            `for '${value}' in style '${fontName}' and mode '${mode}'`);
        symbolNode = new SymbolNode(value, 0, 0, 0, 0, 0, classes);
    }

    if (options) {
        symbolNode.maxFontSize = options.sizeMultiplier;
        if (options.style.isTight()) {
            symbolNode.classes.push("mtight");
        }
        const color = options.getColor();
        if (color) {
            symbolNode.style.color = color;
        }
    }

    return symbolNode;
};

/**
 * Makes a symbol in Main-Regular or AMS-Regular.
 * Used for rel, bin, open, close, inner, and punct.
 */
export const mathsym = function(
    value: string,
    mode: Mode,
    options: Options,
    classes: string[] = [],
): SymbolNode {
    // Decide what font to render the symbol in by its entry in the symbols
    // table.
    // Have a special case for when the value = \ because the \ is used as a
    // textord in unsupported command errors but cannot be parsed as a regular
    // text ordinal and is therefore not present as a symbol in the symbols
    // table for text, as well as a special case for boldsymbol because it
    // can be used for bold + and -
    if (options.font === "boldsymbol" &&
            lookupSymbol(value, "Main-Bold", mode).metrics) {
        return makeSymbol(value, "Main-Bold", mode, options,
            classes.concat(["mathbf"]));
    } else if (value === "\\" || symbols[mode][value].font === "main") {
        return makeSymbol(value, "Main-Regular", mode, options, classes);
    } else {
        return makeSymbol(
            value, "AMS-Regular", mode, options, classes.concat(["amsrm"]));
    }
};

/**
 * Determines which of the two font names (Main-Bold and Math-BoldItalic) and
 * corresponding style tags (mathbf or boldsymbol) to use for font "boldsymbol",
 * depending on the symbol.  Use this function instead of fontMap for font
 * "boldsymbol".
 */
const boldSymbol = function(
    value: string,
    mode: Mode,
    type: "mathord" | "textord",
): {
    fontName: "Math-BoldItalic" | "Main-Bold";
    fontClass: "boldsymbol" | "mathbf";
} {
    if (
        type !== "textord" &&
        lookupSymbol(value, "Math-BoldItalic", mode).metrics
    ) {
        return {
            fontName: "Math-BoldItalic",
            fontClass: "boldsymbol",
        };
    } else {
        // Some glyphs do not exist in Math-BoldItalic so we need to use
        // Main-Bold instead.
        return {
            fontName: "Main-Bold",
            fontClass: "mathbf",
        };
    }
};

/**
 * Makes either a mathord or textord in the correct font and color.
 */
export const makeOrd = function<NODETYPE extends "spacing" | "mathord" | "textord">(
    group: ParseNode<NODETYPE>,
    options: Options,
    type: "mathord" | "textord",
): HtmlDocumentFragment | SymbolNode {
    const mode = group.mode;
    const text = group.text;
    const classes = ["mord"];
    const {font, fontFamily, fontWeight, fontShape} = options;

    // Math mode or Old font (i.e. \rm)
    const useFont = mode === "math" || (mode === "text" && !!font);
    const fontOrFamily = useFont ? font : fontFamily;
    let wideFontName: FontName | "" = "";
    let wideFontClass = "";
    if (text.charCodeAt(0) === 0xD835) {
        const wideCharData = wideCharacterFont(text);
        wideFontName = wideCharData.font;
        wideFontClass = wideCharData[`${mode}Class`];
    }
    if (wideFontName) {
        // surrogate pairs get special treatment
        return makeSymbol(text, wideFontName, mode, options, classes.concat(wideFontClass));
    } else if (fontOrFamily) {
        let fontName;
        let fontClasses;
        if (fontOrFamily === "boldsymbol") {
            const fontData = boldSymbol(text, mode, type);
            fontName = fontData.fontName;
            fontClasses = [fontData.fontClass];
        } else if (useFont) {
            fontName = fontMap[font].fontName;
            fontClasses = [font];
        } else {
            fontName = retrieveTextFontName(
                fontFamily,
                fontWeight,
                fontShape,
            );
            fontClasses = [fontFamily, fontWeight, fontShape];
        }

        if (lookupSymbol(text, fontName, mode).metrics) {
            return makeSymbol(text, fontName, mode, options,
                classes.concat(fontClasses));
        } else if (ligatures.hasOwnProperty(text) &&
                   fontName.slice(0, 10) === "Typewriter") {
            // Deconstruct ligatures in monospace fonts (\texttt, \tt).
            const parts = [];
            for (let i = 0; i < text.length; i++) {
                parts.push(makeSymbol(text[i], fontName, mode, options,
                                      classes.concat(fontClasses)));
            }
            return makeFragment(parts);
        }
    }

    // Makes a symbol in the default font for mathords and textords.
    if (type === "mathord") {
        return makeSymbol(text, "Math-Italic", mode, options,
            classes.concat(["mathnormal"]));
    } else if (type === "textord") {
        const font = symbols[mode][text] && symbols[mode][text].font;
        if (font === "ams") {
            const fontName = retrieveTextFontName("amsrm", fontWeight, fontShape);
            return makeSymbol(
                text, fontName, mode, options,
                classes.concat("amsrm", fontWeight, fontShape));
        } else if (font === "main" || !font) {
            const fontName = retrieveTextFontName("textrm", fontWeight, fontShape);
            return makeSymbol(
                text, fontName, mode, options,
                classes.concat(fontWeight, fontShape));
        } else { // fonts added by plugins
            const fontName = retrieveTextFontName(font, fontWeight, fontShape);
            // We add font name as a css class
            return makeSymbol(
                text, fontName, mode, options,
                classes.concat(fontName, fontWeight, fontShape));
        }
    } else {
        throw new Error("unexpected type: " + type + " in makeOrd");
    }
};

/**
 * Returns true if subsequent symbolNodes have the same classes, skew, maxFont,
 * and styles. For mathnormal text, the left node must also have zero italic
 * correction so we don't lose spacing between combined glyphs.
 */
const canCombine = (prev: SymbolNode, next: SymbolNode) => {
    if (createClass(prev.classes) !== createClass(next.classes)
        || prev.skew !== next.skew
        || prev.maxFontSize !== next.maxFontSize
        || (prev.italic !== 0 && prev.hasClass("mathnormal"))) {
        return false;
    }

    // If prev and next both are just "mbin"s or "mord"s we don't combine them
    // so that the proper spacing can be preserved.
    if (prev.classes.length === 1) {
        const cls = prev.classes[0];
        if (cls === "mbin" || cls === "mord") {
            return false;
        }
    }

    for (const key of Object.keys(prev.style) as Array<keyof CssStyle>) {
        if (prev.style[key] !== next.style[key]) {
            return false;
        }
    }

    for (const key of Object.keys(next.style) as Array<keyof CssStyle>) {
        if (prev.style[key] !== next.style[key]) {
            return false;
        }
    }

    return true;
};

/**
 * Combine consecutive domTree.symbolNodes into a single symbolNode.
 * Note: this function mutates the argument.
 */
export const tryCombineChars = (chars: HtmlDomNode[]): HtmlDomNode[] => {
    for (let i = 0; i < chars.length - 1; i++) {
        const prev = chars[i];
        const next = chars[i + 1];
        if (prev instanceof SymbolNode
            && next instanceof SymbolNode
            && canCombine(prev, next)) {

            prev.text += next.text;
            prev.height = Math.max(prev.height, next.height);
            prev.depth = Math.max(prev.depth, next.depth);
            // Use the last character's italic correction since we use
            // it to add padding to the right of the span created from
            // the combined characters.
            prev.italic = next.italic;
            chars.splice(i + 1, 1);
            i--;
        }
    }
    return chars;
};

/**
 * Calculate the height, depth, and maxFontSize of an element based on its
 * children.
 */
const sizeElementFromChildren = function(
    elem: DomSpan | Anchor | HtmlDocumentFragment,
) {
    let height = 0;
    let depth = 0;
    let maxFontSize = 0;

    for (let i = 0; i < elem.children.length; i++) {
        const child = elem.children[i];
        if (child.height > height) {
            height = child.height;
        }
        if (child.depth > depth) {
            depth = child.depth;
        }
        if (child.maxFontSize > maxFontSize) {
            maxFontSize = child.maxFontSize;
        }
    }

    elem.height = height;
    elem.depth = depth;
    elem.maxFontSize = maxFontSize;
};

/**
 * Makes a span with the given list of classes, list of children, and options.
 *
 * TODO(#953): Ensure that `options` is always provided (currently some call
 * sites don't pass it) and make the type below mandatory.
 * TODO: add a separate argument for math class (e.g. `mop`, `mbin`), which
 * should if present come first in `classes`.
 */
export const makeSpan = function(
    classes?: string[],
    children?: HtmlDomNode[],
    options?: Options,
    style?: CssStyle,
): DomSpan {
    const span = new Span(classes, children, options, style);

    sizeElementFromChildren(span);

    return span;
};

// SVG one is simpler -- doesn't require height, depth, max-font setting.
// This is also a separate method for typesafety.
export const makeSvgSpan = (
    classes?: string[],
    children?: SvgNode[],
    options?: Options,
    style?: CssStyle,
): SvgSpan => new Span(classes, children, options, style);

export const makeLineSpan = function(
    className: string,
    options: Options,
    thickness?: number,
): DomSpan {
    const line = makeSpan([className], [], options);
    line.height = Math.max(
        thickness || options.fontMetrics().defaultRuleThickness,
        options.minRuleThickness,
    );
    line.style.borderBottomWidth = makeEm(line.height);
    line.maxFontSize = 1.0;
    return line;
};

/**
 * Makes an anchor with the given href, list of classes, list of children,
 * and options.
 */
export const makeAnchor = function(
    href: string,
    classes: string[],
    children: HtmlDomNode[],
    options: Options,
): Anchor {
    const anchor = new Anchor(href, classes, children, options);

    sizeElementFromChildren(anchor);

    return anchor;
};

/**
 * Makes a document fragment with the given list of children.
 */
export const makeFragment = function(
    children: HtmlDomNode[],
): HtmlDocumentFragment {
    const fragment = new DocumentFragment(children);

    sizeElementFromChildren(fragment);

    return fragment;
};

/**
 * Wraps group in a span if it's a document fragment, allowing to apply classes
 * and styles
 */
export const wrapFragment = function(
    group: HtmlDomNode,
    options: Options,
): HtmlDomNode {
    if (group instanceof DocumentFragment) {
        return makeSpan([], [group], options);
    }
    return group;
};

export type VListElem = {
    type: "elem";
    elem: HtmlDomNode;
    marginLeft?: string | null | undefined;
    marginRight?: string;
    wrapperClasses?: string[];
    wrapperStyle?: CssStyle;
};
type VListElemAndShift = {
    type: "elem";
    elem: HtmlDomNode;
    shift: number;
    marginLeft?: string | null | undefined;
    marginRight?: string;
    wrapperClasses?: string[];
    wrapperStyle?: CssStyle;
};
type VListKern = {
    type: "kern";
    size: number;
};

// A list of child or kern nodes to be stacked on top of each other (i.e. the
// first element will be at the bottom, and the last at the top).
type VListChild = VListElem | VListKern;
type VListParam = {
    // Each child contains how much it should be shifted downward.
    positionType: "individualShift";
    children: VListElemAndShift[];
} | {
    // "top": The positionData specifies the topmost point of the vlist (note this
    //        is expected to be a height, so positive values move up).
    // "bottom": The positionData specifies the bottommost point of the vlist (note
    //           this is expected to be a depth, so positive values move down).
    // "shift": The vlist will be positioned such that its baseline is positionData
    //          away from the baseline of the first child which MUST be an
    //          "elem". Positive values move downwards.
    positionType: "top" | "bottom" | "shift";
    positionData: number;
    children: VListChild[];
} | {
    // The vlist is positioned so that its baseline is aligned with the baseline
    // of the first child which MUST be an "elem". This is equivalent to "shift"
    // with positionData=0.
    positionType: "firstBaseline";
    children: VListChild[];
};

// Computes the updated `children` list and the overall depth.
//
// This helper function for makeVList makes it easier to enforce type safety by
// allowing early exits (returns) in the logic.
const getVListChildrenAndDepth = function(params: VListParam): {
    children: (VListChild | VListElemAndShift)[] | VListChild[];
    depth: number;
} {
    if (params.positionType === "individualShift") {
        const oldChildren = params.children;
        const children: (VListChild | VListElemAndShift)[] = [oldChildren[0]];

        // Add in kerns to the list of params.children to get each element to be
        // shifted to the correct specified shift
        const depth = -oldChildren[0].shift - oldChildren[0].elem.depth;
        let currPos = depth;
        for (let i = 1; i < oldChildren.length; i++) {
            const diff = -oldChildren[i].shift - currPos -
                oldChildren[i].elem.depth;
            const size = diff -
                (oldChildren[i - 1].elem.height +
                 oldChildren[i - 1].elem.depth);

            currPos = currPos + diff;
            children.push({type: "kern", size});
            children.push(oldChildren[i]);
        }

        return {children, depth};
    }

    let depth;
    if (params.positionType === "top") {
        // We always start at the bottom, so calculate the bottom by adding up
        // all the sizes
        let bottom = params.positionData;
        for (let i = 0; i < params.children.length; i++) {
            const child = params.children[i];
            bottom -= child.type === "kern"
                ? child.size
                : child.elem.height + child.elem.depth;
        }
        depth = bottom;
    } else if (params.positionType === "bottom") {
        depth = -params.positionData;
    } else {
        const firstChild = params.children[0];
        if (firstChild.type !== "elem") {
            throw new Error('First child must have type "elem".');
        }
        if (params.positionType === "shift") {
            depth = -firstChild.elem.depth - params.positionData;
        } else if (params.positionType === "firstBaseline") {
            depth = -firstChild.elem.depth;
        } else {
            throw new Error(`Invalid positionType ${params.positionType}.`);
        }
    }

    return {children: params.children, depth};
};

/**
 * Makes a vertical list by stacking elements and kerns on top of each other.
 * Allows for many different ways of specifying the positioning method.
 *
 * See VListParam documentation above.
 */
export const makeVList = function(params: VListParam, options: Options): DomSpan {
    const {children, depth} = getVListChildrenAndDepth(params);

    // Create a strut that is taller than any list item. The strut is added to
    // each item, where it will determine the item's baseline. Since it has
    // `overflow:hidden`, the strut's top edge will sit on the item's line box's
    // top edge and the strut's bottom edge will sit on the item's baseline,
    // with no additional line-height spacing. This allows the item baseline to
    // be positioned precisely without worrying about font ascent and
    // line-height.
    let pstrutSize = 0;
    for (let i = 0; i < children.length; i++) {
        const child = children[i];
        if (child.type === "elem") {
            const elem = child.elem;
            pstrutSize = Math.max(pstrutSize, elem.maxFontSize, elem.height);
        }
    }
    pstrutSize += 2;
    const pstrut = makeSpan(["pstrut"], []);
    pstrut.style.height = makeEm(pstrutSize);

    // Create a new list of actual children at the correct offsets
    const realChildren = [];
    let minPos = depth;
    let maxPos = depth;
    let currPos = depth;
    for (let i = 0; i < children.length; i++) {
        const child = children[i];
        if (child.type === "kern") {
            currPos += child.size;
        } else {
            const elem = child.elem;
            const classes = child.wrapperClasses || [];
            const style = child.wrapperStyle || {};

            const childWrap = makeSpan(classes, [pstrut, elem], undefined, style);
            childWrap.style.top = makeEm(-pstrutSize - currPos - elem.depth);
            if (child.marginLeft) {
                childWrap.style.marginLeft = child.marginLeft;
            }
            if (child.marginRight) {
                childWrap.style.marginRight = child.marginRight;
            }

            realChildren.push(childWrap);
            currPos += elem.height + elem.depth;
        }
        minPos = Math.min(minPos, currPos);
        maxPos = Math.max(maxPos, currPos);
    }

    // The vlist contents go in a table-cell with `vertical-align:bottom`.
    // This cell's bottom edge will determine the containing table's baseline
    // without overly expanding the containing line-box.
    const vlist = makeSpan(["vlist"], realChildren);
    vlist.style.height = makeEm(maxPos);

    // A second row is used if necessary to represent the vlist's depth.
    let rows;
    if (minPos < 0) {
        // We will define depth in an empty span with display: table-cell.
        // It should render with the height that we define. But Chrome, in
        // contenteditable mode only, treats that span as if it contains some
        // text content. And that min-height over-rides our desired height.
        // So we put another empty span inside the depth strut span.
        const emptySpan = makeSpan([], []);
        const depthStrut = makeSpan(["vlist"], [emptySpan]);
        depthStrut.style.height = makeEm(-minPos);

        // Safari wants the first row to have inline content; otherwise it
        // puts the bottom of the *second* row on the baseline.
        const topStrut = makeSpan(["vlist-s"], [new SymbolNode("\u200b")]);

        rows = [makeSpan(["vlist-r"], [vlist, topStrut]),
            makeSpan(["vlist-r"], [depthStrut])];
    } else {
        rows = [makeSpan(["vlist-r"], [vlist])];
    }

    const vtable = makeSpan(["vlist-t"], rows);
    if (rows.length === 2) {
        vtable.classes.push("vlist-t2");
    }
    vtable.height = maxPos;
    vtable.depth = -minPos;
    return vtable;
};

// Glue is a concept from TeX which is a flexible space between elements in
// either a vertical or horizontal list. In KaTeX, at least for now, it's
// static space between elements in a horizontal layout.
export const makeGlue = (measurement: Measurement, options: Options): DomSpan => {
    // Make an empty span for the space
    const rule = makeSpan(["mspace"], [], options);
    const size = calculateSize(measurement, options);
    rule.style.marginRight = makeEm(size);
    return rule;
};

// Takes font options, and returns the appropriate fontLookup name
const retrieveTextFontName = (
    fontFamily: TextFont,
    fontWeight: FontWeight,
    fontShape: FontShape,
): FontName => {
    let baseFontName: "AMS" | "Main" | "SansSerif" | "Typewriter" | TextFont;
    let fontStylesName: "BoldItalic" | "Bold" | "Italic" | "Regular";

    switch (fontFamily) {
        case "amsrm":
            baseFontName = "AMS";
            break;
        case "textrm":
            baseFontName = "Main";
            break;
        case "textsf":
            baseFontName = "SansSerif";
            break;
        case "texttt":
            baseFontName = "Typewriter";
            break;
        default:
            baseFontName = fontFamily; // use fonts added by a plugin
    }

    if (fontWeight === "textbf" && fontShape === "textit") {
        fontStylesName = "BoldItalic";
    } else if (fontWeight === "textbf") {
        fontStylesName = "Bold";
    } else if (fontShape === "textit") {
        fontStylesName = "Italic";
    } else {
        fontStylesName = "Regular";
    }

    return `${baseFontName}-${fontStylesName}` as FontName;
};

/**
 * Maps TeX font commands to objects containing:
 * - variant: string used for "mathvariant" attribute in buildMathML.js
 * - fontName: the "style" parameter to fontMetrics.getCharacterMetrics
 */
// A map between tex font commands an MathML mathvariant attribute values
export const fontMap: Record<string, {
    variant: FontVariant;
    fontName: FontName;
}> = {
    // styles
    "mathbf": {
        variant: "bold",
        fontName: "Main-Bold",
    },
    "mathrm": {
        variant: "normal",
        fontName: "Main-Regular",
    },
    "textit": {
        variant: "italic",
        fontName: "Main-Italic",
    },
    "mathit": {
        variant: "italic",
        fontName: "Main-Italic",
    },
    "mathnormal": {
        variant: "italic",
        fontName: "Math-Italic",
    },
    "mathsfit": {
        variant: "sans-serif-italic",
        fontName: "SansSerif-Italic",
    },
    // "boldsymbol" is missing because they require the use of multiple fonts:
    // Math-BoldItalic and Main-Bold.  This is handled by a special case in
    // makeOrd which ends up calling boldsymbol.

    // families
    "mathbb": {
        variant: "double-struck",
        fontName: "AMS-Regular",
    },
    "mathcal": {
        variant: "script",
        fontName: "Caligraphic-Regular",
    },
    "mathfrak": {
        variant: "fraktur",
        fontName: "Fraktur-Regular",
    },
    "mathscr": {
        variant: "script",
        fontName: "Script-Regular",
    },
    "mathsf": {
        variant: "sans-serif",
        fontName: "SansSerif-Regular",
    },
    "mathtt": {
        variant: "monospace",
        fontName: "Typewriter-Regular",
    },
};

export const svgData: Record<string, [string, number, number]> = {
    //   path, width, height
    vec: ["vec", 0.471, 0.714],                // values from the font glyph
    oiintSize1: ["oiintSize1", 0.957, 0.499],  // oval to overlay the integrand
    oiintSize2: ["oiintSize2", 1.472, 0.659],
    oiiintSize1: ["oiiintSize1", 1.304, 0.499],
    oiiintSize2: ["oiiintSize2", 1.98, 0.659],
};

export const staticSvg = function(value: string, options: Options): SvgSpan {
    // Create a span with inline SVG for the element.
    const [pathName, width, height] = svgData[value];
    const path = new PathNode(pathName);
    const svgNode = new SvgNode([path], {
        "width": makeEm(width),
        "height": makeEm(height),
        // Override CSS rule `.katex svg { width: 100% }`
        "style": "width:" + makeEm(width),
        "viewBox": "0 0 " + 1000 * width + " " + 1000 * height,
        "preserveAspectRatio": "xMinYMin",
    });
    const span = makeSvgSpan(["overlay"], [svgNode], options);
    span.height = height;
    span.style.height = makeEm(height);
    span.style.width = makeEm(width);
    return span;
};
αx9./**
 * This file does the main work of building a domTree structure from a parse
 * tree. The entry point is the `buildHTML` function, which takes a parse tree.
 * Then, the buildExpression, buildGroup, and various groupBuilders functions
 * are called, to produce a final HTML tree.
 */

import ParseError from "./ParseError";
import Style from "./Style";
import {makeGlue, makeSpan, tryCombineChars} from "./buildCommon";
import {Span, Anchor} from "./domTree";
import {makeEm} from "./units";
import {spacings, tightSpacings} from "./spacingData";
import {_htmlGroupBuilders as groupBuilders} from "./defineFunction";
import {DocumentFragment} from "./tree";

import type Options from "./Options";
import type {AnyParseNode} from "./parseNode";
import type {HtmlDomNode, DomSpan} from "./domTree";

// Binary atoms (first class `mbin`) change into ordinary atoms (`mord`)
// depending on their surroundings. See TeXbook pg. 442-446, Rules 5 and 6,
// and the text before Rule 19.
const binLeftCanceller = new Set([
    "leftmost", "mbin", "mopen", "mrel", "mop", "mpunct",
]);
const binRightCanceller = new Set([
    "rightmost", "mrel", "mclose", "mpunct",
]);

const styleMap = {
    "display": Style.DISPLAY,
    "text": Style.TEXT,
    "script": Style.SCRIPT,
    "scriptscript": Style.SCRIPTSCRIPT,
};

type Side = "left" | "right";

const DomEnum = {
    mord: "mord",
    mop: "mop",
    mbin: "mbin",
    mrel: "mrel",
    mopen: "mopen",
    mclose: "mclose",
    mpunct: "mpunct",
    minner: "minner",
};
type DomType = keyof typeof DomEnum;

/**
 * Take a list of nodes, build them in order, and return a list of the built
 * nodes. documentFragments are flattened into their contents, so the
 * returned list contains no fragments. `isRealGroup` is true if `expression`
 * is a real group (no atoms will be added on either side), as opposed to
 * a partial group (e.g. one created by \color). `surrounding` is an array
 * consisting type of nodes that will be added to the left and right.
 */
export const buildExpression = function(
    expression: AnyParseNode[],
    options: Options,
    isRealGroup: boolean | "root",
    surrounding: [DomType | null | undefined, DomType | null | undefined] = [null, null],
): HtmlDomNode[] {
    // Parse expressions into `groups`.
    const groups: HtmlDomNode[] = [];
    for (let i = 0; i < expression.length; i++) {
        const output = buildGroup(expression[i], options);
        if (output instanceof DocumentFragment) {
            const children: ReadonlyArray<HtmlDomNode> = output.children;
            groups.push(...children);
        } else {
            groups.push(output);
        }
    }

    // Combine consecutive domTree.symbolNodes into a single symbolNode.
    tryCombineChars(groups);

    // If `expression` is a partial group, let the parent handle spacings
    // to avoid processing groups multiple times.
    if (!isRealGroup) {
        return groups;
    }

    let glueOptions = options;
    if (expression.length === 1) {
        const node = expression[0];
        if (node.type === "sizing") {
            glueOptions = options.havingSize(node.size);
        } else if (node.type === "styling") {
            glueOptions = options.havingStyle(styleMap[node.style]);
        }
    }

    // Dummy spans for determining spacings between surrounding atoms.
    // If `expression` has no atoms on the left or right, class "leftmost"
    // or "rightmost", respectively, is used to indicate it.
    const dummyPrev = makeSpan([surrounding[0] || "leftmost"], [], options);
    const dummyNext = makeSpan([surrounding[1] || "rightmost"], [], options);

    // TODO: These code assumes that a node's math class is the first element
    // of its `classes` array. A later cleanup should ensure this, for
    // instance by changing the signature of `makeSpan`.

    // Before determining what spaces to insert, perform bin cancellation.
    // Binary operators change to ordinary symbols in some contexts.
    const isRoot = (isRealGroup === "root");
    traverseNonSpaceNodes(groups, (node, prev): void => {
        const prevType = prev.classes[0];
        const type = node.classes[0];
        if (prevType === "mbin" && binRightCanceller.has(type)) {
            prev.classes[0] = "mord";
        } else if (type === "mbin" && binLeftCanceller.has(prevType)) {
            node.classes[0] = "mord";
        }
    }, {node: dummyPrev}, dummyNext, isRoot);

    traverseNonSpaceNodes(groups, (node, prev): HtmlDomNode | undefined => {
        const prevType = getTypeOfDomTree(prev);
        const type = getTypeOfDomTree(node);

        // 'mtight' indicates that the node is script or scriptscript style.
        const space = prevType && type ? (node.hasClass("mtight")
            ? tightSpacings[prevType]?.[type]
            : spacings[prevType]?.[type]) : null;

        if (space) { // Insert glue (spacing) after the `prev`.
            return makeGlue(space, glueOptions);
        }
    }, {node: dummyPrev}, dummyNext, isRoot);

    return groups;
};

// Depth-first traverse non-space `nodes`, calling `callback` with the current and
// previous node as arguments, optionally returning a node to insert after the
// previous node. `prev` is an object with the previous node and `insertAfter`
// function to insert after it. `next` is a node that will be added to the right.
// Used for bin cancellation and inserting spacings.
const traverseNonSpaceNodes = function(
    nodes: HtmlDomNode[],
    callback: (arg0: HtmlDomNode, arg1: HtmlDomNode) =>
        HtmlDomNode | null | void,
    prev: {
        node: HtmlDomNode,
        insertAfter?: (arg0: HtmlDomNode) => void,
    },
    next: HtmlDomNode | null | undefined,
    isRoot: boolean,
) {
    if (next) { // temporarily append the right node, if exists
        nodes.push(next);
    }
    let i = 0;
    for (; i < nodes.length; i++) {
        const node = nodes[i];
        const partialGroup = checkPartialGroup(node);

        if (partialGroup) { // Recursive DFS
            // TODO(ts): partialGroup.children is ReadonlyArray but this
            // function mutates the array (insertAfter splices into it).
            traverseNonSpaceNodes(partialGroup.children as HtmlDomNode[],
                callback, prev, null, isRoot);
            continue;
        }

        // Ignore explicit spaces (e.g., \;, \,) when determining what implicit
        // spacing should go between atoms of different classes
        const nonspace = !node.hasClass("mspace");
        if (nonspace) {
            const result = callback(node, prev.node);
            if (result) {
                if (prev.insertAfter) {
                    prev.insertAfter(result);
                } else { // insert at front
                    nodes.unshift(result);
                    i++;
                }
            }
        }

        if (nonspace) {
            prev.node = node;
        } else if (isRoot && node.hasClass("newline")) {
            prev.node = makeSpan(["leftmost"]); // treat like beginning of line
        }
        prev.insertAfter = (index => n => {
            nodes.splice(index + 1, 0, n);
            i++;
        })(i);
    }

    if (next) {
        nodes.pop();
    }
};

// Check if given node is a partial group, i.e., does not affect spacing around.
const checkPartialGroup = function(
    node: HtmlDomNode,
): DocumentFragment<HtmlDomNode> | Anchor | DomSpan | null | undefined {
    if (node instanceof DocumentFragment || node instanceof Anchor
        || (node instanceof Span && node.hasClass("enclosing"))) {
        return node;
    }
    return null;
};

// Return the outermost node of a domTree.
const getOutermostNode = function(
    node: HtmlDomNode,
    side: Side,
): HtmlDomNode {
    const partialGroup = checkPartialGroup(node);
    if (partialGroup) {
        const children = partialGroup.children;
        if (children.length) {
            if (side === "right") {
                return getOutermostNode(children[children.length - 1], "right");
            } else if (side === "left") {
                return getOutermostNode(children[0], "left");
            }
        }
    }
    return node;
};

// Return math atom class (mclass) of a domTree.
// If `side` is given, it will get the type of the outermost node at given side.
export const getTypeOfDomTree = function(
    node: HtmlDomNode | null | undefined,
    side?: Side | null | undefined,
): DomType | null | undefined {
    if (!node) {
        return null;
    }
    if (side) {
        node = getOutermostNode(node, side);
    }
    // This makes a lot of assumptions as to where the type of atom
    // appears.  We should do a better job of enforcing this.
    const className = node.classes[0] as keyof typeof DomEnum;
    return (DomEnum[className] as DomType | undefined) || null;
};
export const makeNullDelimiter = function(
    options: Options,
    classes: string[],
): DomSpan {
    const moreClasses = ["nulldelimiter"].concat(options.baseSizingClasses());
    return makeSpan(classes.concat(moreClasses));
};

/**
 * buildGroup is the function that takes a group and calls the correct groupType
 * function for it. It also handles the interaction of size and style changes
 * between parents and children.
 */
export const buildGroup = function(
    group: AnyParseNode | null | undefined,
    options: Options,
    baseOptions?: Options,
): HtmlDomNode {
    if (!group) {
        return makeSpan();
    }

    if (groupBuilders[group.type]) {
        // TODO(ts): groupBuilders is Record<string, HtmlBuilder<any>>;
        // a type-safe registry would need a mapped type keyed by NodeType.
        let groupNode: HtmlDomNode = groupBuilders[group.type](group, options);

        // If the size changed between the parent and the current group, account
        // for that size difference.
        if (baseOptions && options.size !== baseOptions.size) {
            groupNode = makeSpan(options.sizingClasses(baseOptions),
                [groupNode], options);

            const multiplier =
                options.sizeMultiplier / baseOptions.sizeMultiplier;

            groupNode.height *= multiplier;
            groupNode.depth *= multiplier;
        }

        return groupNode;
    } else {
        throw new ParseError(
            "Got group of unknown type: '" + group.type + "'");
    }
};

/**
 * Combine an array of HTML DOM nodes (e.g., the output of `buildExpression`)
 * into an unbreakable HTML node of class .base, with proper struts to
 * guarantee correct vertical extent.  `buildHTML` calls this repeatedly to
 * make up the entire expression as a sequence of unbreakable units.
 */
function buildHTMLUnbreakable(children: HtmlDomNode[], options: Options) {
    // Compute height and depth of this chunk.
    const body = makeSpan(["base"], children, options);

    // Add strut, which ensures that the top of the HTML element falls at
    // the height of the expression, and the bottom of the HTML element
    // falls at the depth of the expression.
    const strut = makeSpan(["strut"]);
    strut.style.height = makeEm(body.height + body.depth);
    if (body.depth) {
        strut.style.verticalAlign = makeEm(-body.depth);
    }
    body.children.unshift(strut);

    return body;
}

/**
 * Take an entire parse tree, and build it into an appropriate set of HTML
 * nodes.
 */
export default function buildHTML(tree: AnyParseNode[], options: Options): DomSpan {
    // Strip off outer tag wrapper for processing below.
    let tag = null;
    if (tree.length === 1 && tree[0].type === "tag") {
        tag = tree[0].tag;
        tree = tree[0].body;
    }

    // Build the expression contained in the tree
    const expression = buildExpression(tree, options, "root");

    let eqnNum;
    if (expression.length === 2 && expression[1].hasClass("tag")) {
        // An environment with automatic equation numbers, e.g. {gather}.
        eqnNum = expression.pop();
    }

    const children = [];

    // Create one base node for each chunk between potential line breaks.
    // The TeXBook [p.173] says "A formula will be broken only after a
    // relation symbol like $=$ or $<$ or $\rightarrow$, or after a binary
    // operation symbol like $+$ or $-$ or $\times$, where the relation or
    // binary operation is on the ``outer level'' of the formula (i.e., not
    // enclosed in {...} and not part of an \over construction)."

    let parts = [];
    for (let i = 0; i < expression.length; i++) {
        parts.push(expression[i]);
        if (expression[i].hasClass("mbin") ||
            expression[i].hasClass("mrel") ||
            expression[i].hasClass("allowbreak")) {
            // Put any post-operator glue on same line as operator.
            // Watch for \nobreak along the way, and stop at \newline.
            let nobreak = false;
            while (i < expression.length - 1 &&
                   expression[i + 1].hasClass("mspace") &&
                   !expression[i + 1].hasClass("newline")) {
                i++;
                parts.push(expression[i]);
                if (expression[i].hasClass("nobreak")) {
                    nobreak = true;
                }
            }
            // Don't allow break if \nobreak among the post-operator glue.
            if (!nobreak) {
                children.push(buildHTMLUnbreakable(parts, options));
                parts = [];
            }
        } else if (expression[i].hasClass("newline")) {
            // Write the line except the newline
            parts.pop();
            if (parts.length > 0) {
                children.push(buildHTMLUnbreakable(parts, options));
                parts = [];
            }
            // Put the newline at the top level
            children.push(expression[i]);
        }
    }
    if (parts.length > 0) {
        children.push(buildHTMLUnbreakable(parts, options));
    }

    // Now, if there was a tag, build it too and append it as a final child.
    let tagChild;
    if (tag) {
        tagChild = buildHTMLUnbreakable(
            buildExpression(tag, options, true),
            options,
        );
        tagChild.classes = ["tag"];
        children.push(tagChild);
    } else if (eqnNum) {
        children.push(eqnNum);
    }

    const htmlNode = makeSpan(["katex-html"], children);
    htmlNode.setAttribute("aria-hidden", "true");

    // Adjust the strut of the tag to be the maximum height of all children
    // (the height of the enclosing htmlNode) for proper vertical alignment.
    if (tagChild) {
        const strut = tagChild.children[0];
        strut.style.height = makeEm(htmlNode.height + htmlNode.depth);
        if (htmlNode.depth) {
            strut.style.verticalAlign = makeEm(-htmlNode.depth);
        }
    }

    return htmlNode;
}
Dx/\/**
 * This file converts a parse tree into a corresponding MathML tree. The main
 * entry point is the `buildMathML` function, which takes a parse tree from the
 * parser.
 */

import {fontMap, makeSpan} from "./buildCommon";
import {getCharacterMetrics} from "./fontMetrics";
import ParseError from "./ParseError";
import symbols, {ligatures} from "./symbols";
import {_mathmlGroupBuilders as groupBuilders} from "./defineFunction";
import {MathNode, TextNode} from "./mathMLTree";

import type Options from "./Options";
import type {AnyParseNode, SymbolParseNode} from "./parseNode";
import type {DomSpan, HtmlDomNode} from "./domTree";
import type {MathDomNode} from "./mathMLTree";
import type {Mode} from "./types";
import type {FontVariant, MathFont} from "./types/fonts";

const noVariantSymbols = new Set(["\\imath", "\\jmath"]);
const rowLikeTypes = new Set(["mrow", "mtable"]);

/**
 * Takes a symbol and converts it into a MathML text node after performing
 * optional replacement from symbols.js.
 */
export const makeText = function(
    text: string,
    mode: Mode,
    options?: Options,
): TextNode {
    if (symbols[mode][text] && symbols[mode][text].replace &&
        text.charCodeAt(0) !== 0xD835 &&
        !(ligatures.hasOwnProperty(text) && options &&
          ((options.fontFamily && options.fontFamily.slice(4, 6) === "tt") ||
           (options.font && options.font.slice(4, 6) === "tt")))) {
        text = symbols[mode][text].replace!;
    }

    return new TextNode(text);
};

/**
 * Wrap the given array of nodes in an <mrow> node if needed, i.e.,
 * unless the array has length 1.  Always returns a single node.
 */
export const makeRow = function(body: MathDomNode[]): MathDomNode {
    if (body.length === 1) {
        return body[0];
    } else {
        return new MathNode("mrow", body);
    }
};

const mathFontVariants: Partial<
    Record<MathFont, FontVariant | ((group: SymbolParseNode) => FontVariant)>
> = {
    mathit: "italic",
    boldsymbol: (group) => (group.type === "textord" ? "bold" : "bold-italic"),
    mathbf: "bold",
    mathbb: "double-struck",
    mathsfit: "sans-serif-italic",
    mathfrak: "fraktur",
    mathscr: "script",
    mathcal: "script",
    mathsf: "sans-serif",
    mathtt: "monospace",
};

/**
 * Returns the math variant as a string or null if none is required.
 */
export const getVariant = (
    group: SymbolParseNode,
    options: Options,
): FontVariant | null | undefined => {
    // Handle \text... font specifiers as best we can.
    // MathML has a limited list of allowable mathvariant specifiers; see
    // https://www.w3.org/TR/MathML3/chapter3.html#presm.commatt
    if (group.mode === "text") {
        if (options.fontFamily === "texttt") {
            return "monospace";
        } else if (options.fontFamily === "textsf") {
            if (options.fontShape === "textit" &&
                options.fontWeight === "textbf") {
                return "sans-serif-bold-italic";
            } else if (options.fontShape === "textit") {
                return "sans-serif-italic";
            } else if (options.fontWeight === "textbf") {
                return "bold-sans-serif";
            } else {
                return "sans-serif";
            }
        } else if (options.fontShape === "textit" &&
                   options.fontWeight === "textbf") {
            return "bold-italic";
        } else if (options.fontShape === "textit") {
            return "italic";
        } else if (options.fontWeight === "textbf") {
            return "bold";
        }
    }

    const font = options.font;
    if (!font || font === "mathnormal") {
        return null;
    }

    const mode = group.mode;
    const mathVariant = mathFontVariants[font];

    if (mathVariant) {
        return typeof mathVariant === "function"
            ? mathVariant(group)
            : mathVariant;
    }

    let text = group.text;
    if (noVariantSymbols.has(text)) {
        return null;
    }

    if (symbols[mode][text]) {
        const replacement = symbols[mode][text].replace;
        if (replacement) {
            text = replacement;
        }
    }

    const fontName = fontMap[font].fontName;
    if (getCharacterMetrics(text, fontName, mode)) {
        return fontMap[font].variant;
    }

    return null;
};

/**
 * Check for <mi>.</mi> which is how a dot renders in MathML,
 * or <mo separator="true" lspace="0em" rspace="0em">,</mo>
 * which is how a braced comma {,} renders in MathML
 */
function isNumberPunctuation(group: MathNode | null | undefined): boolean {
    if (!group) {
        return false;
    }
    if (group.type === 'mi' && group.children.length === 1) {
        const child = group.children[0];
        return child instanceof TextNode && child.text === '.';
    } else if (group.type === 'mo' && group.children.length === 1 &&
        group.getAttribute('separator') === 'true' &&
        group.getAttribute('lspace') === '0em' &&
        group.getAttribute('rspace') === '0em'
    ) {
        const child = group.children[0];
        return child instanceof TextNode && child.text === ',';
    } else {
        return false;
    }
}

/**
 * Takes a list of nodes, builds them, and returns a list of the generated
 * MathML nodes.  Also combine consecutive <mtext> outputs into a single
 * <mtext> tag.
 */
export const buildExpression = function(
    expression: AnyParseNode[],
    options: Options,
    isOrdgroup?: boolean,
): MathNode[] {
    if (expression.length === 1) {
        const group = buildGroup(expression[0], options);
        if (isOrdgroup && group instanceof MathNode && group.type === "mo") {
            // When TeX writers want to suppress spacing on an operator,
            // they often put the operator by itself inside braces.
            group.setAttribute("lspace", "0em");
            group.setAttribute("rspace", "0em");
        }
        return [group];
    }

    const groups = [];
    let lastGroup;
    for (let i = 0; i < expression.length; i++) {
        const group = buildGroup(expression[i], options);
        if (group instanceof MathNode && lastGroup instanceof MathNode) {
            // Concatenate adjacent <mtext>s
            if (group.type === 'mtext' && lastGroup.type === 'mtext'
                && group.getAttribute('mathvariant') ===
                   lastGroup.getAttribute('mathvariant')) {
                lastGroup.children.push(...group.children);
                continue;
            // Concatenate adjacent <mn>s
            } else if (group.type === 'mn' && lastGroup.type === 'mn') {
                lastGroup.children.push(...group.children);
                continue;
            // Concatenate <mn>...</mn> followed by <mi>.</mi>
            } else if (isNumberPunctuation(group) && lastGroup.type === 'mn') {
                lastGroup.children.push(...group.children);
                continue;
            // Concatenate <mi>.</mi> followed by <mn>...</mn>
            } else if (group.type === 'mn' && isNumberPunctuation(lastGroup)) {
                group.children = [...lastGroup.children, ...group.children];
                groups.pop();
            // Put preceding <mn>...</mn> or <mi>.</mi> inside base of
            // <msup><mn>...base...</mn>...exponent...</msup> (or <msub>)
            } else if ((group.type === 'msup' || group.type === 'msub') &&
                group.children.length >= 1 &&
                (lastGroup.type === 'mn' || isNumberPunctuation(lastGroup))
            ) {
                const base = group.children[0];
                if (base instanceof MathNode && base.type === 'mn') {
                    base.children = [...lastGroup.children, ...base.children];
                    groups.pop();
                }
            // \not
            } else if (lastGroup.type === 'mi' && lastGroup.children.length === 1) {
                const lastChild = lastGroup.children[0];
                if (lastChild instanceof TextNode && lastChild.text === '\u0338' &&
                    (group.type === 'mo' || group.type === 'mi' ||
                        group.type === 'mn')) {
                    const child = group.children[0];
                    if (child instanceof TextNode && child.text.length > 0) {
                        // Overlay with combining character long solidus
                        child.text = child.text.slice(0, 1) + "\u0338" +
                            child.text.slice(1);
                        groups.pop();
                    }
                }
            }
        }
        groups.push(group);
        lastGroup = group;
    }
    return groups;
};

/**
 * Equivalent to buildExpression, but wraps the elements in an <mrow>
 * if there's more than one.  Returns a single node instead of an array.
 */
export const buildExpressionRow = function(
    expression: AnyParseNode[],
    options: Options,
    isOrdgroup?: boolean,
): MathDomNode {
    return makeRow(buildExpression(expression, options, isOrdgroup));
};

/**
 * Takes a group from the parser and calls the appropriate groupBuilders function
 * on it to produce a MathML node.
 */
export const buildGroup = function(
    group: AnyParseNode | null | undefined,
    options: Options,
): MathNode {
    if (!group) {
        return new MathNode("mrow");
    }

    if (groupBuilders[group.type]) {
        // TODO(ts): MathMLBuilder returns MathDomNode but all concrete
        // builders return MathNode. Widening the return type here would
        // require updating all callers that assume MathNode.
        return groupBuilders[group.type](group, options) as MathNode;
    } else {
        throw new ParseError(
            "Got group of unknown type: '" + group.type + "'");
    }
};

/**
 * Takes a full parse tree and settings and builds a MathML representation of
 * it. In particular, we put the elements from building the parse tree into a
 * <semantics> tag so we can also include that TeX source as an annotation.
 *
 * Note that we actually return a domTree element with a `<math>` inside it so
 * we can do appropriate styling.
 */
export default function buildMathML(
    tree: AnyParseNode[],
    texExpression: string,
    options: Options,
    isDisplayMode: boolean,
    forMathmlOnly: boolean,
): DomSpan {
    const expression = buildExpression(tree, options);

    // TODO: Make a pass thru the MathML similar to buildHTML.traverseNonSpaceNodes
    // and add spacing nodes. This is necessary only adjacent to math operators
    // like \sin or \lim or to subsup elements that contain math operators.
    // MathML takes care of the other spacing issues.

    // Wrap up the expression in an mrow so it is presented in the semantics
    // tag correctly, unless it's a single <mrow> or <mtable>.
    let wrapper;
    if (expression.length === 1 && expression[0] instanceof MathNode &&
        rowLikeTypes.has(expression[0].type)) {
        wrapper = expression[0];
    } else {
        wrapper = new MathNode("mrow", expression);
    }

    // Build a TeX annotation of the source
    const annotation = new MathNode(
        "annotation", [new TextNode(texExpression)]);

    annotation.setAttribute("encoding", "application/x-tex");

    const semantics = new MathNode(
        "semantics", [wrapper, annotation]);

    const math = new MathNode("math", [semantics]);
    math.setAttribute("xmlns", "http://www.w3.org/1998/Math/MathML");
    if (isDisplayMode) {
        math.setAttribute("display", "block");
    }

    // You can't style <math> nodes, so we wrap the node in a span.
    // NOTE: The span class is not typed to have <math> nodes as children, and
    // we don't want to make the children type more generic since the children
    // of span are expected to have more fields in `buildHtml` contexts.
    // The MathNode implements VirtualNode (toNode/toMarkup) which is all that
    // Span needs from its children for rendering.
    // TODO(ts): Span's child type is HtmlDomNode, but MathNode only implements
    // VirtualNode. The double-cast acknowledges this architectural limitation.
    const wrapperClass = forMathmlOnly ? "katex" : "katex-mathml";
    return makeSpan([wrapperClass], [math as unknown as HtmlDomNode]);
}
+ximport buildHTML from "./buildHTML";
import buildMathML from "./buildMathML";
import {makeSpan} from "./buildCommon";
import Options from "./Options";
import Settings from "./Settings";
import Style from "./Style";

import type {AnyParseNode} from "./parseNode";
import type {DomSpan} from "./domTree";

const optionsFromSettings = function(settings: Settings) {
    return new Options({
        style: (settings.displayMode ? Style.DISPLAY : Style.TEXT),
        maxSize: settings.maxSize,
        minRuleThickness: settings.minRuleThickness,
    });
};

const displayWrap = function(node: DomSpan, settings: Settings): DomSpan {
    if (settings.displayMode) {
        const classes = ["katex-display"];
        if (settings.leqno) {
            classes.push("leqno");
        }
        if (settings.fleqn) {
            classes.push("fleqn");
        }
        node = makeSpan(classes, [node]);
    }
    return node;
};

export const buildTree = function(
    tree: AnyParseNode[],
    expression: string,
    settings: Settings,
): DomSpan {
    const options = optionsFromSettings(settings);
    let katexNode;
    if (settings.output === "mathml") {
        return buildMathML(tree, expression, options, settings.displayMode, true);
    } else if (settings.output === "html") {
        const htmlNode = buildHTML(tree, options);
        katexNode = makeSpan(["katex"], [htmlNode]);
    } else {
        const mathMLNode = buildMathML(tree, expression, options,
            settings.displayMode, false);
        const htmlNode = buildHTML(tree, options);
        katexNode = makeSpan(["katex"], [mathMLNode, htmlNode]);
    }

    return displayWrap(katexNode, settings);
};

export const buildHTMLTree = function(
    tree: AnyParseNode[],
    expression: string,
    settings: Settings,
): DomSpan {
    const options = optionsFromSettings(settings);
    const htmlNode = buildHTML(tree, options);
    const katexNode = makeSpan(["katex"], [htmlNode]);
    return displayWrap(katexNode, settings);
};

export default buildTree;
r,ximport {_htmlGroupBuilders, _mathmlGroupBuilders} from "./defineFunction";

import type Parser from "./Parser";
import type {AnyParseNode} from "./parseNode";
import type {ArgType, Mode} from "./types";
import type {NodeType} from "./parseNode";
import type {HtmlBuilder, MathMLBuilder} from "./defineFunction";

/**
 * The context contains the following properties:
 *  - mode: current parsing mode.
 *  - envName: the name of the environment, one of the listed names.
 *  - parser: the parser object.
 */
type EnvContext = {
    mode: Mode;
    envName: string;
    parser: Parser;
};

/**
 *  - context: information and references provided by the parser
 *  - args: an array of arguments passed to \begin{name}
 *  - optArgs: an array of optional arguments passed to \begin{name}
 */
type EnvHandler = (
    context: EnvContext,
    args: AnyParseNode[],
    optArgs: (AnyParseNode | null | undefined)[],
) => AnyParseNode;

/**
 *  - numArgs: (default 0) The number of arguments after the \begin{name} function.
 *  - argTypes: (optional) Just like for a function
 *  - allowedInText: (default false) Whether or not the environment is allowed
 *                   inside text mode (not enforced yet).
 *  - numOptionalArgs: (default 0) Just like for a function
 */
type EnvProps = {
    numArgs: number;
};

/**
 * Final environment spec for use at parse time.
 * This is almost identical to `EnvDefSpec`, except it
 * 1. includes the function handler
 * 2. requires all arguments except argType
 * It is generated by `defineEnvironment()` below.
 */
export type EnvSpec<NODETYPE extends NodeType> = {
    type: NODETYPE;
    // Need to use the type to avoid error. See NOTES below.
    numArgs: number;
    argTypes?: ArgType[];
    allowedInText: boolean;
    numOptionalArgs: number;
    handler: EnvHandler;
};

/**
 * All registered environments.
 * `environments.js` exports this same dictionary again and makes it public.
 * `Parser.js` requires this dictionary via `environments.js`.
 */
export const _environments: Record<string, EnvSpec<NodeType>> = {};

type EnvDefSpec<NODETYPE extends NodeType> = {
    // Unique string to differentiate parse nodes.
    type: NODETYPE;

    // List of functions which use the give handler, htmlBuilder,
    // and mathmlBuilder.
    names: Array<string>;

    // Properties that control how the environments are parsed.
    props: EnvProps;
    handler: EnvHandler;

    // This function returns an object representing the DOM structure to be
    // created when rendering the defined LaTeX function.
    htmlBuilder: HtmlBuilder<NODETYPE>;

    // This function returns an object representing the MathML structure to be
    // created when rendering the defined LaTeX function.
    mathmlBuilder: MathMLBuilder<NODETYPE>;
};

export default function defineEnvironment<NODETYPE extends NodeType>({
    type,
    names,
    props,
    handler,
    htmlBuilder,
    mathmlBuilder,
}: EnvDefSpec<NODETYPE>) {
    // Set default values of environments.
    const data = {
        type,
        numArgs: props.numArgs || 0,
        allowedInText: false,
        numOptionalArgs: 0,
        handler,
    };
    for (let i = 0; i < names.length; ++i) {
        // TODO: The value type of _environments should be a type union of all
        // possible `EnvSpec<>` possibilities instead of `EnvSpec<*>`, which is
        // an existential type.
        _environments[names[i]] = data;
    }
    if (htmlBuilder) {
        _htmlGroupBuilders[type] = htmlBuilder;
    }
    if (mathmlBuilder) {
        _mathmlGroupBuilders[type] = mathmlBuilder;
    }
}
񎙡x +import type Parser from "./Parser";
import type {ParseNode, AnyParseNode, NodeType, UnsupportedCmdParseNode}
    from "./parseNode";
import type Options from "./Options";
import type {ArgType, BreakToken} from "./types";
import type {HtmlDomNode} from "./domTree";
import type {Token} from "./Token";
import type {MathDomNode} from "./mathMLTree";

/** Context provided to function handlers for error messages. */
export type FunctionContext = {
    funcName: string;
    parser: Parser;
    token?: Token;
    breakOnTokenText?: BreakToken;
};

export type FunctionHandler<NODETYPE extends NodeType> = (
    context: FunctionContext,
    args: AnyParseNode[],
    optArgs: (AnyParseNode | null | undefined)[],
) => UnsupportedCmdParseNode | ParseNode<NODETYPE>;
// Note: reverse the order of the return type union will cause a flow error.
// See https://github.com/facebook/flow/issues/3663.

export type HtmlBuilder<NODETYPE extends NodeType> =
    (group: ParseNode<NODETYPE>, options: Options) => HtmlDomNode;
export type MathMLBuilder<NODETYPE extends NodeType> =
    (group: ParseNode<NODETYPE>, options: Options) => MathDomNode;

// More general version of `HtmlBuilder` for nodes (e.g. \sum, accent types)
// whose presence impacts super/subscripting. In this case, ParseNode<"supsub">
// delegates its HTML building to the HtmlBuilder corresponding to these nodes.
export type HtmlBuilderSupSub<NODETYPE extends NodeType> =
    (group: ParseNode<"supsub"> | ParseNode<NODETYPE>, options: Options) => HtmlDomNode;

export type FunctionPropSpec = {
    // The number of arguments the function takes.
    numArgs: number;

    // An array corresponding to each argument of the function, giving the
    // type of argument that should be parsed. Its length should be equal
    // to `numOptionalArgs + numArgs`, and types for optional arguments
    // should appear before types for mandatory arguments.
    argTypes?: ArgType[];

    // Whether it expands to a single token or a braced group of tokens.
    // If it's grouped, it can be used as an argument to primitive commands,
    // such as \sqrt (without the optional argument) and super/subscript.
    allowedInArgument?: boolean;

    // Whether or not the function is allowed inside text mode
    // (default false)
    allowedInText?: boolean;

    // Whether or not the function is allowed inside text mode
    // (default true)
    allowedInMath?: boolean;

    // (optional) The number of optional arguments the function
    // should parse. If the optional arguments aren't found,
    // `null` will be passed to the handler in their place.
    // (default 0)
    numOptionalArgs?: number;

    // Must be true if the function is an infix operator.
    infix?: boolean;

    // Whether or not the function is a TeX primitive.
    primitive?: boolean;
};

type FunctionDefSpec<NODETYPE extends NodeType> = {
    // Unique string to differentiate parse nodes.
    // Also determines the type of the value returned by `handler`.
    type: NODETYPE;

    // The first argument to defineFunction is a single name or a list of names.
    // All functions named in such a list will share a single implementation.
    names: Array<string>;

    // Properties that control how the functions are parsed.
    props: FunctionPropSpec;

    // The handler is called to handle these functions and their arguments and
    // returns a `ParseNode`.
    handler: FunctionHandler<NODETYPE> | null | undefined;

    // This function returns an object representing the DOM structure to be
    // created when rendering the defined LaTeX function.
    // This should not modify the `ParseNode`.
    htmlBuilder?: HtmlBuilder<NODETYPE>;

    // This function returns an object representing the MathML structure to be
    // created when rendering the defined LaTeX function.
    // This should not modify the `ParseNode`.
    mathmlBuilder?: MathMLBuilder<NODETYPE>;
};

/**
 * Final function spec for use at parse time.
 * This is almost identical to `FunctionPropSpec`, except it
 * 1. includes the function handler, and
 * 2. requires all arguments except argTypes.
 * It is generated by `defineFunction()` below.
 */
export type FunctionSpec<NODETYPE extends NodeType> = {
    type: NODETYPE; // Need to use the type to avoid error. See NOTES below.
    numArgs: number;
    argTypes?: ArgType[];
    allowedInArgument: boolean;
    allowedInText: boolean;
    allowedInMath: boolean;
    numOptionalArgs: number;
    infix: boolean;
    primitive: boolean;

    // FLOW TYPE NOTES: Doing either one of the following two
    //
    // - removing the NODETYPE type parameter in FunctionSpec above;
    // - using ?FunctionHandler<NODETYPE> below;
    //
    // results in a confusing flow typing error:
    //   "string literal `styling`. This type is incompatible with..."
    // pointing to the definition of `defineFunction` and finishing with
    //   "some incompatible instantiation of `NODETYPE`"
    //
    // Having FunctionSpec<NODETYPE> above and FunctionHandler<*> below seems to
    // circumvent this error. This is not harmful for catching errors since
    // _functions is typed FunctionSpec<*> (it stores all TeX function specs).

    // Must be specified unless it's handled directly in the parser.
    handler: FunctionHandler<NodeType> | null | undefined;
};

/**
 * All registered functions.
 * `functions.js` just exports this same dictionary again and makes it public.
 * `Parser.js` requires this dictionary.
 */
export const _functions: Record<string, FunctionSpec<NodeType>> = {};

/**
 * All HTML builders. Should be only used in the `define*` and the `build*ML`
 * functions.
 *
 * Builders for different node types are stored side by side, but
 * `HtmlBuilder<T>` is contravariant in `T`, so there is no single type
 * argument that makes storing/retrieving them typecheck.  `any` is used
 * as an existential-quantifier escape hatch.
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const _htmlGroupBuilders: Record<string, HtmlBuilder<any>> = {};

/**
 * All MathML builders. Should be only used in the `define*` and the `build*ML`
 * functions.  See `_htmlGroupBuilders` above for the rationale behind `any`.
 */
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export const _mathmlGroupBuilders: Record<string, MathMLBuilder<any>> = {};

export default function defineFunction<NODETYPE extends NodeType>({
    type,
    names,
    props,
    handler,
    htmlBuilder,
    mathmlBuilder,
}: FunctionDefSpec<NODETYPE>) {
    // Set default values of functions
    const data = {
        type,
        numArgs: props.numArgs,
        argTypes: props.argTypes,
        allowedInArgument: !!props.allowedInArgument,
        allowedInText: !!props.allowedInText,
        allowedInMath: (props.allowedInMath === undefined)
            ? true
            : props.allowedInMath,
        numOptionalArgs: props.numOptionalArgs || 0,
        infix: !!props.infix,
        primitive: !!props.primitive,
        handler,
    };
    for (let i = 0; i < names.length; ++i) {
        _functions[names[i]] = data;
    }
    if (type) {
        if (htmlBuilder) {
            _htmlGroupBuilders[type] = htmlBuilder;
        }
        if (mathmlBuilder) {
            _mathmlGroupBuilders[type] = mathmlBuilder;
        }
    }
}

/**
 * Use this to register only the HTML and MathML builders for a function (e.g.
 * if the function's ParseNode is generated in Parser.js rather than via a
 * stand-alone handler provided to `defineFunction`).
 */
export function defineFunctionBuilders<NODETYPE extends NodeType>({
    type, htmlBuilder, mathmlBuilder,
}: {
    type: NODETYPE;
    htmlBuilder?: HtmlBuilder<NODETYPE>;
    mathmlBuilder: MathMLBuilder<NODETYPE>;
}) {
    defineFunction({
        type,
        names: [],
        props: {numArgs: 0},
        handler() { throw new Error('Should never be called.'); },
        htmlBuilder,
        mathmlBuilder,
    });
}

export const normalizeArgument = function(arg: AnyParseNode): AnyParseNode {
    return arg.type === "ordgroup" && arg.body.length === 1 ? arg.body[0] : arg;
};

// Since the corresponding buildHTML/buildMathML function expects a
// list of elements, we normalize for different kinds of arguments
export const ordargument = function(arg: AnyParseNode): AnyParseNode[] {
    return arg.type === "ordgroup" ? arg.body : [arg];
};
ߴNdx,s%
/**
 * Provides context to macros defined by functions. Implemented by
 * MacroExpander.
 */
export interface MacroContextInterface {?=/**
     * Object mapping macros to their expansions.
     */);
[;I: void;+14!,$0;+, ;:-};4H/;4;4(0;;'arguments from the token stream,
     *U): Token[][];|<$;|<0>;;
}

export type MacroArg = {
    tokens: Token[];
    start: Token;
    end: Token;
};

/** Macro tokens (in reverse order). */
export type MacroExpansion = {
    tokens: Token[];
    numArgs: number;
    delimiters?: string[][];
    unexpandable?: boolean; // used in \let
};

export type MacroDefinition = string | MacroExpansion |
    ((arg0: MacroContextInterface) => string | MacroExpansion);
export type MacroMap = Record<string, MacroDefinition>;

/**
 * All registered global/built-in macros.
 * `macros.js` exports this same dictionary again and makes it public.
 * `Parser.js` requires this dictionary via `macros.js`.
 */
export const _macros: MacroMap = {};

// This function might one day accept an additional argument and do more things.
export de^fault function defineMacro(name: string, body: MacroDefinition) {
    _macros[name] = body;
}
x9uƊ/**
 * This file deals with creating delimiters of various sizes. The TeXbook
 * discusses these routines on page 441-442, in the "Another subroutine sets box
 * x to a specified variable delimiter" paragraph.
 *
 * There are three main routines here. `makeSmallDelim` makes a delimiter in the
 * normal font, but in either text, script, or scriptscript style.
 * `makeLargeDelim` makes a delimiter in textstyle, but in one of the Size1,
 * Size2, Size3, or Size4 fonts. `makeStackedDelim` makes a delimiter out of
 * smaller pieces that are stacked on top of one another.
 *
 * The functions take a parameter `center`, which determines if the delimiter
 * should be centered around the axis.
 *
 * Then, there are three exposed functions. `sizedDelim` makes a delimiter in
 * one of the given sizes. This is used for things like `\bigl`.
 * `customSizedDelim` makes a delimiter with a given total height+depth. It is
 * called in places like `\sqrt`. `leftRightDelim` makes an appropriate
 * delimiter which surrounds an expression of a given height an depth. It is
 * used in `\left` and `\right`.
 */

import ParseError from "./ParseError";
import Style from "./Style";

import {PathNode, SvgNode, SymbolNode} from "./domTree";
import {sqrtPath, innerPath, tallDelim} from "./svgGeometry";
import {makeSpan, makeSymbol, makeSvgSpan, makeVList} from "./buildCommon";
import {getCharacterMetrics} from "./fontMetrics";
import symbols from "./symbols";
import {makeEm} from "./units";
import fontMetricsData from "./fontMetricsData";

import type Options from "./Options";
import type {HtmlDomNode, DomSpan, SvgSpan} from "./domTree";
import type {DelimiterSize, Mode} from "./types";
import type {StyleInterface} from "./Style";
import type {VListElem} from "./buildCommon";
import type {CharacterMetrics, FontName} from "./types/fonts";

type StackedDelimiterFont = "Size1-Regular" | "Size4-Regular";

/**
 * Get the metrics for a given symbol and font, after transformation (i.e.
 * after following replacement from symbols.js)
 */
const getMetrics = function(
    symbol: string,
    font: string,
    mode: Mode,
): CharacterMetrics {
    const replace = symbols.math[symbol] && symbols.math[symbol].replace;
    const metrics =
        getCharacterMetrics(replace || symbol, font, mode);
    if (!metrics) {
        throw new Error(`Unsupported symbol ${symbol} and font size ${font}.`);
    }
    return metrics;
};

/**
 * Puts a delimiter span in a given style, and adds appropriate height, depth,
 * and maxFontSizes.
 */
const styleWrap = function(
    delim: HtmlDomNode,
    toStyle: StyleInterface,
    options: Options,
    classes: string[],
): DomSpan {
    const newOptions = options.havingBaseStyle(toStyle);

    const span = makeSpan(
        classes.concat(newOptions.sizingClasses(options)),
        [delim], options);

    const delimSizeMultiplier =
        newOptions.sizeMultiplier / options.sizeMultiplier;
    span.height *= delimSizeMultiplier;
    span.depth *= delimSizeMultiplier;
    span.maxFontSize = newOptions.sizeMultiplier;

    return span;
};

const centerSpan = function(
    span: DomSpan,
    options: Options,
    style: StyleInterface,
) {
    const newOptions = options.havingBaseStyle(style);
    const shift =
        (1 - options.sizeMultiplier / newOptions.sizeMultiplier) *
        options.fontMetrics().axisHeight;

    span.classes.push("delimcenter");
    span.style.top = makeEm(shift);
    span.height -= shift;
    span.depth += shift;
};

/**
 * Makes a small delimiter. This is a delimiter that comes in the Main-Regular
 * font, but is restyled to either be in textstyle, scriptstyle, or
 * scriptscriptstyle.
 */
const makeSmallDelim = function(
    delim: string,
    style: StyleInterface,
    center: boolean,
    options: Options,
    mode: Mode,
    classes: string[],
): DomSpan {
    const text = makeSymbol(delim, "Main-Regular", mode, options);
    const span = styleWrap(text, style, options, classes);
    if (center) {
        centerSpan(span, options, style);
    }
    return span;
};

/**
 * Builds a symbol in the given font size (note size is an integer)
 */
const mathrmSize = function(
    value: string,
    size: DelimiterSize,
    mode: Mode,
    options: Options,
): SymbolNode {
    return makeSymbol(value, `Size${size}-Regular`, mode, options);
};

/**
 * Makes a large delimiter. This is a delimiter that comes in the Size1, Size2,
 * Size3, or Size4 fonts. It is always rendered in textstyle.
 */
const makeLargeDelim = function(delim: string,
    size: DelimiterSize,
    center: boolean,
    options: Options,
    mode: Mode,
    classes: string[],
): DomSpan {
    const inner = mathrmSize(delim, size, mode, options);
    const span = styleWrap(
        makeSpan(["delimsizing", "size" + size], [inner], options),
        Style.TEXT, options, classes);
    if (center) {
        centerSpan(span, options, Style.TEXT);
    }
    return span;
};

/**
 * Make a span from a font glyph with the given offset and in the given font.
 * This is used in makeStackedDelim to make the stacking pieces for the delimiter.
 */
const makeGlyphSpan = function(
    symbol: string,
    font: StackedDelimiterFont,
    mode: Mode,
): VListElem {
    let sizeClass;
    // Apply the correct CSS class to choose the right font.
    if (font === "Size1-Regular") {
        sizeClass = "delim-size1";
    } else /* if (font === "Size4-Regular") */ {
        sizeClass = "delim-size4";
    }

    const corner = makeSpan(
        ["delimsizinginner", sizeClass],
        [makeSpan([], [makeSymbol(symbol, font, mode)])]);

    // Since this will be passed into `makeVList` in the end, wrap the element
    // in the appropriate tag that VList uses.
    return {type: "elem", elem: corner};
};

const makeInner = function(
    ch: string,
    height: number,
    options: Options
): VListElem {
    // Create a span with inline SVG for the inner part of a tall stacked delimiter.
    const width = fontMetricsData['Size4-Regular'][ch.charCodeAt(0)]
        ? fontMetricsData['Size4-Regular'][ch.charCodeAt(0)][4]
        : fontMetricsData['Size1-Regular'][ch.charCodeAt(0)][4];
    const path = new PathNode("inner", innerPath(ch,  Math.round(1000 * height)));
    const svgNode = new SvgNode([path], {
        "width": makeEm(width),
        "height": makeEm(height),
        // Override CSS rule `.katex svg { width: 100% }`
        "style": "width:" + makeEm(width),
        "viewBox": "0 0 " + 1000 * width + " " + Math.round(1000 * height),
        "preserveAspectRatio": "xMinYMin",
    });
    const span = makeSvgSpan([], [svgNode], options);
    span.height = height;
    span.style.height = makeEm(height);
    span.style.width = makeEm(width);
    return {type: "elem", elem: span};
};

// Helpers for makeStackedDelim
const lapInEms = 0.008;
const lap: {type: "kern"; size: number} = {type: "kern", size: -1 * lapInEms};
const verts = new Set(["|", "\\lvert", "\\rvert", "\\vert"]);
const doubleVerts = new Set(["\\|", "\\lVert", "\\rVert", "\\Vert"]);

/**
 * Make a stacked delimiter out of a given delimiter, with the total height at
 * least `heightTotal`. This routine is mentioned on page 442 of the TeXbook.
 */
const makeStackedDelim = function(
    delim: string,
    heightTotal: number,
    center: boolean,
    options: Options,
    mode: Mode,
    classes: string[],
): DomSpan {
    // There are four parts, the top, an optional middle, a repeated part, and a
    // bottom.
    let top;
    let middle;
    let repeat;
    let bottom;
    let svgLabel = "";
    let viewBoxWidth = 0;
    top = repeat = bottom = delim;
    middle = null;
    // Also keep track of what font the delimiters are in
    let font: StackedDelimiterFont = "Size1-Regular";

    // We set the parts and font based on the symbol. Note that we use
    // '\u23d0' instead of '|' and '\u2016' instead of '\\|' for the
    // repeats of the arrows
    if (delim === "\\uparrow") {
        repeat = bottom = "\u23d0";
    } else if (delim === "\\Uparrow") {
        repeat = bottom = "\u2016";
    } else if (delim === "\\downarrow") {
        top = repeat = "\u23d0";
    } else if (delim === "\\Downarrow") {
        top = repeat = "\u2016";
    } else if (delim === "\\updownarrow") {
        top = "\\uparrow";
        repeat = "\u23d0";
        bottom = "\\downarrow";
    } else if (delim === "\\Updownarrow") {
        top = "\\Uparrow";
        repeat = "\u2016";
        bottom = "\\Downarrow";
    } else if (verts.has(delim)) {
        repeat = "\u2223";
        svgLabel = "vert";
        viewBoxWidth = 333;
    } else if (doubleVerts.has(delim)) {
        repeat = "\u2225";
        svgLabel = "doublevert";
        viewBoxWidth = 556;
    } else if (delim === "[" || delim === "\\lbrack") {
        top = "\u23a1";
        repeat = "\u23a2";
        bottom = "\u23a3";
        font = "Size4-Regular";
        svgLabel = "lbrack";
        viewBoxWidth = 667;
    } else if (delim === "]" || delim === "\\rbrack") {
        top = "\u23a4";
        repeat = "\u23a5";
        bottom = "\u23a6";
        font = "Size4-Regular";
        svgLabel = "rbrack";
        viewBoxWidth = 667;
    } else if (delim === "\\lfloor" || delim === "\u230a") {
        repeat = top = "\u23a2";
        bottom = "\u23a3";
        font = "Size4-Regular";
        svgLabel = "lfloor";
        viewBoxWidth = 667;
    } else if (delim === "\\lceil" || delim === "\u2308") {
        top = "\u23a1";
        repeat = bottom = "\u23a2";
        font = "Size4-Regular";
        svgLabel = "lceil";
        viewBoxWidth = 667;
    } else if (delim === "\\rfloor" || delim === "\u230b") {
        repeat = top = "\u23a5";
        bottom = "\u23a6";
        font = "Size4-Regular";
        svgLabel = "rfloor";
        viewBoxWidth = 667;
    } else if (delim === "\\rceil" || delim === "\u2309") {
        top = "\u23a4";
        repeat = bottom = "\u23a5";
        font = "Size4-Regular";
        svgLabel = "rceil";
        viewBoxWidth = 667;
    } else if (delim === "(" || delim === "\\lparen") {
        top = "\u239b";
        repeat = "\u239c";
        bottom = "\u239d";
        font = "Size4-Regular";
        svgLabel = "lparen";
        viewBoxWidth = 875;
    } else if (delim === ")" || delim === "\\rparen") {
        top = "\u239e";
        repeat = "\u239f";
        bottom = "\u23a0";
        font = "Size4-Regular";
        svgLabel = "rparen";
        viewBoxWidth = 875;
    } else if (delim === "\\{" || delim === "\\lbrace") {
        top = "\u23a7";
        middle = "\u23a8";
        bottom = "\u23a9";
        repeat = "\u23aa";
        font = "Size4-Regular";
    } else if (delim === "\\}" || delim === "\\rbrace") {
        top = "\u23ab";
        middle = "\u23ac";
        bottom = "\u23ad";
        repeat = "\u23aa";
        font = "Size4-Regular";
    } else if (delim === "\\lgroup" || delim === "\u27ee") {
        top = "\u23a7";
        bottom = "\u23a9";
        repeat = "\u23aa";
        font = "Size4-Regular";
    } else if (delim === "\\rgroup" || delim === "\u27ef") {
        top = "\u23ab";
        bottom = "\u23ad";
        repeat = "\u23aa";
        font = "Size4-Regular";
    } else if (delim === "\\lmoustache" || delim === "\u23b0") {
        top = "\u23a7";
        bottom = "\u23ad";
        repeat = "\u23aa";
        font = "Size4-Regular";
    } else if (delim === "\\rmoustache" || delim === "\u23b1") {
        top = "\u23ab";
        bottom = "\u23a9";
        repeat = "\u23aa";
        font = "Size4-Regular";
    }

    // Get the metrics of the four sections
    const topMetrics = getMetrics(top, font, mode);
    const topHeightTotal = topMetrics.height + topMetrics.depth;
    const repeatMetrics = getMetrics(repeat, font, mode);
    const repeatHeightTotal = repeatMetrics.height + repeatMetrics.depth;
    const bottomMetrics = getMetrics(bottom, font, mode);
    const bottomHeightTotal = bottomMetrics.height + bottomMetrics.depth;
    let middleHeightTotal = 0;
    let middleFactor = 1;
    if (middle !== null) {
        const middleMetrics = getMetrics(middle, font, mode);
        middleHeightTotal = middleMetrics.height + middleMetrics.depth;
        middleFactor = 2; // repeat symmetrically above and below middle
    }

    // Calculate the minimal height that the delimiter can have.
    // It is at least the size of the top, bottom, and optional middle combined.
    const minHeight = topHeightTotal + bottomHeightTotal + middleHeightTotal;

    // Compute the number of copies of the repeat symbol we will need
    const repeatCount = Math.max(0, Math.ceil(
        (heightTotal - minHeight) / (middleFactor * repeatHeightTotal)));

    // Compute the total height of the delimiter including all the symbols
    const realHeightTotal =
        minHeight + repeatCount * middleFactor * repeatHeightTotal;

    // The center of the delimiter is placed at the center of the axis. Note
    // that in this context, "center" means that the delimiter should be
    // centered around the axis in the current style, while normally it is
    // centered around the axis in textstyle.
    let axisHeight = options.fontMetrics().axisHeight;
    if (center) {
        axisHeight *= options.sizeMultiplier;
    }
    // Calculate the depth
    const depth = realHeightTotal / 2 - axisHeight;

    // Now, we start building the pieces that will go into the vlist
    // Keep a list of the pieces of the stacked delimiter
    const stack: Array<VListElem | {type: "kern"; size: number}> = [];

    if (svgLabel.length > 0) {
        // Instead of stacking glyphs, create a single SVG.
        // This evades browser problems with imprecise positioning of spans.
        const midHeight = realHeightTotal - topHeightTotal - bottomHeightTotal;
        const viewBoxHeight = Math.round(realHeightTotal  * 1000);
        const pathStr = tallDelim(svgLabel, Math.round(midHeight * 1000));
        const path = new PathNode(svgLabel, pathStr);
        const width = makeEm(viewBoxWidth / 1000);
        const height = makeEm(viewBoxHeight / 1000);
        const svg = new SvgNode([path], {
            "width": width,
            "height": height,
            "viewBox": `0 0 ${viewBoxWidth} ${viewBoxHeight}`,
        });
        const wrapper = makeSvgSpan([], [svg], options);
        wrapper.height = viewBoxHeight / 1000;
        wrapper.style.width = width;
        wrapper.style.height = height;
        stack.push({type: "elem", elem: wrapper});
    } else {
        // Stack glyphs
        // Start by adding the bottom symbol
        stack.push(makeGlyphSpan(bottom, font, mode));
        stack.push(lap); // overlap

        if (middle === null) {
            // The middle section will be an SVG. Make it an extra 0.016em tall.
            // We'll overlap by 0.008em at top and bottom.
            const innerHeight = realHeightTotal - topHeightTotal - bottomHeightTotal
                + 2 * lapInEms;
            stack.push(makeInner(repeat, innerHeight, options));
        } else {
            // When there is a middle bit, we need the middle part and two repeated
            // sections
            const innerHeight = (realHeightTotal - topHeightTotal -
                bottomHeightTotal - middleHeightTotal) / 2 + 2 * lapInEms;
            stack.push(makeInner(repeat, innerHeight, options));
            // Now insert the middle of the brace.
            stack.push(lap);
            stack.push(makeGlyphSpan(middle, font, mode));
            stack.push(lap);
            stack.push(makeInner(repeat, innerHeight, options));
        }

        // Add the top symbol
        stack.push(lap);
        stack.push(makeGlyphSpan(top, font, mode));
    }

    // Finally, build the vlist
    const newOptions = options.havingBaseStyle(Style.TEXT);
    const inner = makeVList({
        positionType: "bottom",
        positionData: depth,
        children: stack,
    }, newOptions);

    return styleWrap(
        makeSpan(["delimsizing", "mult"], [inner], newOptions),
        Style.TEXT, options, classes);
};

// All surds have 0.08em padding above the vinculum inside the SVG.
// That keeps browser span height rounding error from pinching the line.
const vbPad = 80;   // padding above the surd, measured inside the viewBox.
const emPad = 0.08; // padding, in ems, measured in the document.

const sqrtSvg = function(
    sqrtName: string,
    height: number,
    viewBoxHeight: number,
    extraVinculum: number,
    options: Options,
): SvgSpan {
    const path = sqrtPath(sqrtName, extraVinculum, viewBoxHeight);
    const pathNode = new PathNode(sqrtName, path);

    const svg =  new SvgNode([pathNode], {
        // Note: 1000:1 ratio of viewBox to document em width.
        "width": "400em",
        "height": makeEm(height),
        "viewBox": "0 0 400000 " + viewBoxHeight,
        "preserveAspectRatio": "xMinYMin slice",
    });

    return makeSvgSpan(["hide-tail"], [svg], options);
};

/**
 * Make a sqrt image of the given height,
 */
export const makeSqrtImage = function(
    height: number,
    options: Options,
): {
    span: SvgSpan,
    ruleWidth: number,
    advanceWidth: number,
} {
    // Define a newOptions that removes the effect of size changes such as \Huge.
    // We don't pick different a height surd for \Huge. For it, we scale up.
    const newOptions = options.havingBaseSizing();

    // Pick the desired surd glyph from a sequence of surds.
    const delim = traverseSequence("\\surd", height * newOptions.sizeMultiplier,
        stackLargeDelimiterSequence, newOptions);

    let sizeMultiplier = newOptions.sizeMultiplier;  // default

    // The standard sqrt SVGs each have a 0.04em thick vinculum.
    // If Settings.minRuleThickness is larger than that, we add extraVinculum.
    const extraVinculum = Math.max(0,
        options.minRuleThickness - options.fontMetrics().sqrtRuleThickness);

    // Create a span containing an SVG image of a sqrt symbol.
    let span;
    let spanHeight;
    let texHeight;
    let viewBoxHeight;
    let advanceWidth;

    // We create viewBoxes with 80 units of "padding" above each surd.
    // Then browser rounding error on the parent span height will not
    // encroach on the ink of the vinculum. But that padding is not
    // included in the TeX-like `height` used for calculation of
    // vertical alignment. So texHeight = span.height < span.style.height.

    if (delim.type === "small") {
        // Get an SVG that is derived from glyph U+221A in font KaTeX-Main.
        // 1000 unit normal glyph height.
        viewBoxHeight = 1000 + 1000 * extraVinculum + vbPad;
        if (height < 1.0) {
            sizeMultiplier = 1.0;   // mimic a \textfont radical
        } else if (height < 1.4) {
            sizeMultiplier = 0.7;   // mimic a \scriptfont radical
        }
        spanHeight = (1.0 + extraVinculum + emPad) / sizeMultiplier;
        texHeight = (1.00 + extraVinculum) / sizeMultiplier;
        span = sqrtSvg("sqrtMain", spanHeight, viewBoxHeight, extraVinculum,
            options);
        span.style.minWidth = "0.853em";
        advanceWidth = 0.833 / sizeMultiplier;  // from the font.

    } else if (delim.type === "large") {
        // These SVGs come from fonts: KaTeX_Size1, _Size2, etc.
        viewBoxHeight = (1000 + vbPad) * sizeToMaxHeight[delim.size];
        texHeight = (sizeToMaxHeight[delim.size] + extraVinculum) / sizeMultiplier;
        spanHeight = (sizeToMaxHeight[delim.size] + extraVinculum + emPad)
            / sizeMultiplier;
        span = sqrtSvg("sqrtSize" + delim.size, spanHeight, viewBoxHeight,
            extraVinculum, options);
        span.style.minWidth = "1.02em";
        advanceWidth = 1.0 / sizeMultiplier; // 1.0 from the font.

    } else {
        // Tall sqrt. In TeX, this would be stacked using multiple glyphs.
        // We'll use a single SVG to accomplish the same thing.
        spanHeight = height + extraVinculum + emPad;
        texHeight = height + extraVinculum;
        viewBoxHeight = Math.floor(1000 * height + extraVinculum) + vbPad;
        span = sqrtSvg("sqrtTall", spanHeight, viewBoxHeight, extraVinculum,
            options);
        span.style.minWidth = "0.742em";
        advanceWidth = 1.056;
    }

    span.height = texHeight;
    span.style.height = makeEm(spanHeight);

    return {
        span,
        advanceWidth,
        // Calculate the actual line width.
        // This actually should depend on the chosen font -- e.g. \boldmath
        // should use the thicker surd symbols from e.g. KaTeX_Main-Bold, and
        // have thicker rules.
        ruleWidth: (options.fontMetrics().sqrtRuleThickness + extraVinculum)
            * sizeMultiplier,
    };
};

// There are three kinds of delimiters, delimiters that stack when they become
// too large
const stackLargeDelimiters = new Set([
    "(", "\\lparen", ")", "\\rparen",
    "[", "\\lbrack", "]", "\\rbrack",
    "\\{", "\\lbrace", "\\}", "\\rbrace",
    "\\lfloor", "\\rfloor", "\u230a", "\u230b",
    "\\lceil", "\\rceil", "\u2308", "\u2309",
    "\\surd",
]);

// delimiters that always stack
const stackAlwaysDelimiters = new Set([
    "\\uparrow", "\\downarrow", "\\updownarrow",
    "\\Uparrow", "\\Downarrow", "\\Updownarrow",
    "|", "\\|", "\\vert", "\\Vert",
    "\\lvert", "\\rvert", "\\lVert", "\\rVert",
    "\\lgroup", "\\rgroup", "\u27ee", "\u27ef",
    "\\lmoustache", "\\rmoustache", "\u23b0", "\u23b1",
]);

// and delimiters that never stack
const stackNeverDelimiters = new Set([
    "<", ">", "\\langle", "\\rangle", "/", "\\backslash", "\\lt", "\\gt",
]);

// Metrics of the different sizes. Found by looking at TeX's output of
// $\bigl| // \Bigl| \biggl| \Biggl| \showlists$
// Used to create stacked delimiters of appropriate sizes in makeSizedDelim.
export const sizeToMaxHeight = [0, 1.2, 1.8, 2.4, 3.0];

/**
 * Used to create a delimiter of a specific size, where `size` is 1, 2, 3, or 4.
 */
export const makeSizedDelim = function(
    delim: string,
    size: DelimiterSize,
    options: Options,
    mode: Mode,
    classes: string[],
): DomSpan {
    // < and > turn into \langle and \rangle in delimiters
    if (delim === "<" || delim === "\\lt" || delim === "\u27e8") {
        delim = "\\langle";
    } else if (delim === ">" || delim === "\\gt" || delim === "\u27e9") {
        delim = "\\rangle";
    }

    // Sized delimiters are never centered.
    if (stackLargeDelimiters.has(delim) || stackNeverDelimiters.has(delim)) {
        return makeLargeDelim(delim, size, false, options, mode, classes);
    } else if (stackAlwaysDelimiters.has(delim)) {
        return makeStackedDelim(
            delim,
            sizeToMaxHeight[size],
            false,
            options,
            mode,
            classes,
        );
    } else {
        throw new ParseError("Illegal delimiter: '" + delim + "'");
    }
};

/**
 * There are three different sequences of delimiter sizes that the delimiters
 * follow depending on the kind of delimiter. This is used when creating custom
 * sized delimiters to decide whether to create a small, large, or stacked
 * delimiter.
 *
 * In real TeX, these sequences aren't explicitly defined, but are instead
 * defined inside the font metrics. Since there are only three sequences that
 * are possible for the delimiters that TeX defines, it is easier to just encode
 * them explicitly here.
 */

type Delimiter =
    {type: "small", style: StyleInterface} |
    {type: "large", size: 1 | 2 | 3 | 4} |
    {type: "stack"};

// Delimiters that never stack try small delimiters and large delimiters only
const stackNeverDelimiterSequence: Delimiter[] = [
    {type: "small", style: Style.SCRIPTSCRIPT},
    {type: "small", style: Style.SCRIPT},
    {type: "small", style: Style.TEXT},
    {type: "large", size: 1},
    {type: "large", size: 2},
    {type: "large", size: 3},
    {type: "large", size: 4},
];

// Delimiters that always stack try the small delimiters first, then stack
const stackAlwaysDelimiterSequence: Delimiter[] = [
    {type: "small", style: Style.SCRIPTSCRIPT},
    {type: "small", style: Style.SCRIPT},
    {type: "small", style: Style.TEXT},
    {type: "stack"},
];

// Delimiters that stack when large try the small and then large delimiters, and
// stack afterwards
const stackLargeDelimiterSequence: Delimiter[] = [
    {type: "small", style: Style.SCRIPTSCRIPT},
    {type: "small", style: Style.SCRIPT},
    {type: "small", style: Style.TEXT},
    {type: "large", size: 1},
    {type: "large", size: 2},
    {type: "large", size: 3},
    {type: "large", size: 4},
    {type: "stack"},
];

/**
 * Get the font used in a delimiter based on what kind of delimiter it is.
 * TODO(#963) Use more specific font family return type once that is introduced.
 */
const delimTypeToFont = function(type: Delimiter): string {
    if (type.type === "small") {
        return "Main-Regular";
    } else if (type.type === "large") {
        return "Size" + type.size + "-Regular";
    } else if (type.type === "stack") {
        return "Size4-Regular";
    } else {
        const delimKind = (type as Delimiter).type;
        throw new Error(`Add support for delim type '${delimKind}' here.`);
    }
};

/**
 * Traverse a sequence of types of delimiters to decide what kind of delimiter
 * should be used to create a delimiter of the given height+depth.
 */
const traverseSequence = function(
    delim: string,
    height: number,
    sequence: Delimiter[],
    options: Options,
): Delimiter {
    // Here, we choose the index we should start at in the sequences. In smaller
    // sizes (which correspond to larger numbers in style.size) we start earlier
    // in the sequence. Thus, scriptscript starts at index 3-3=0, script starts
    // at index 3-2=1, text starts at 3-1=2, and display starts at min(2,3-0)=2
    const start = Math.min(2, 3 - options.style.size);
    for (let i = start; i < sequence.length; i++) {
        const delimType = sequence[i];
        if (delimType.type === "stack") {
            // This is always the last delimiter, so we just break the loop now.
            break;
        }

        const metrics = getMetrics(delim, delimTypeToFont(delimType), "math");
        let heightDepth = metrics.height + metrics.depth;

        // Small delimiters are scaled down versions of the same font, so we
        // account for the style change size.
        if (delimType.type === "small") {
            const newOptions = options.havingBaseStyle(delimType.style);
            heightDepth *= newOptions.sizeMultiplier;
        }

        // Check if the delimiter at this size works for the given height.
        if (heightDepth > height) {
            return delimType;
        }
    }

    // If we reached the end of the sequence, return the last sequence element.
    return sequence[sequence.length - 1];
};

/**
 * Make a delimiter of a given height+depth, with optional centering. Here, we
 * traverse the sequences, and create a delimiter that the sequence tells us to.
 */
export const makeCustomSizedDelim = function(
    delim: string,
    height: number,
    center: boolean,
    options: Options,
    mode: Mode,
    classes: string[],
): DomSpan {
    if (delim === "<" || delim === "\\lt" || delim === "\u27e8") {
        delim = "\\langle";
    } else if (delim === ">" || delim === "\\gt" || delim === "\u27e9") {
        delim = "\\rangle";
    }

    // Decide what sequence to use
    let sequence: Delimiter[];
    if (stackNeverDelimiters.has(delim)) {
        sequence = stackNeverDelimiterSequence;
    } else if (stackLargeDelimiters.has(delim)) {
        sequence = stackLargeDelimiterSequence;
    } else {
        sequence = stackAlwaysDelimiterSequence;
    }

    // Look through the sequence
    const delimType = traverseSequence(delim, height, sequence, options);

    // Get the delimiter from font glyphs.
    // Depending on the sequence element we decided on, call the
    // appropriate function.
    if (delimType.type === "small") {
        return makeSmallDelim(delim, delimType.style, center, options,
                              mode, classes);
    } else if (delimType.type === "large") {
        return makeLargeDelim(delim, delimType.size, center, options, mode,
                              classes);
    } else /* if (delimType.type === "stack") */ {
        return makeStackedDelim(delim, height, center, options, mode,
                                classes);
    }
};

/**
 * Make a delimiter for use with `\left` and `\right`, given a height and depth
 * of an expression that the delimiters surround.
 */
export const makeLeftRightDelim = function(
    delim: string,
    height: number,
    depth: number,
    options: Options,
    mode: Mode,
    classes: string[],
): DomSpan {
    // We always center \left/\right delimiters, so the axis is always shifted
    const axisHeight =
        options.fontMetrics().axisHeight * options.sizeMultiplier;

    // Taken from TeX source, tex.web, function make_left_right
    const delimiterFactor = 901;
    const delimiterExtend = 5.0 / options.fontMetrics().ptPerEm;

    const maxDistFromAxis = Math.max(
        height - axisHeight, depth + axisHeight);

    const totalHeight = Math.max(
        // In real TeX, calculations are done using integral values which are
        // 65536 per pt, or 655360 per em. So, the division here truncates in
        // TeX but doesn't here, producing different results. If we wanted to
        // exactly match TeX's calculation, we could do
        //   Math.floor(655360 * maxDistFromAxis / 500) *
        //    delimiterFactor / 655360
        // (To see the difference, compare
        //    x^{x^{\left(\rule{0.1em}{0.68em}\right)}}
        // in TeX and KaTeX)
        maxDistFromAxis / 500 * delimiterFactor,
        2 * maxDistFromAxis - delimiterExtend);

    // Finally, we defer to `makeCustomSizedDelim` with our calculated total
    // height
    return makeCustomSizedDelim(delim, totalHeight, true, options, mode, classes);
};
Zr창xC//**
 * These objects store the data about the DOM nodes we create, as well as some
 * extra data. They can then be transformed into real DOM nodes with the
 * `toNode` function or HTML markup using `toMarkup`. They are useful for both
 * storing extra properties on the nodes, as well as providing a way to easily
 * work with the DOM.
 *
 * Similar functions for working with MathML nodes exist in mathMLTree.js.
 *
 * TODO: refactor `span` and `anchor` into common superclass when
 * target environments support class inheritance
 */
import {scriptFromCodepoint} from "./unicodeScripts";
import {escape, hyphenate} from "./utils";
import {path} from "./svgGeometry";
import type Options from "./Options";
import {DocumentFragment} from "./tree";
import {makeEm} from "./units";
import ParseError from "./ParseError";

import type {VirtualNode} from "./tree";

/**
 * Create an HTML className based on a list of classes. In addition to joining
 * with spaces, we also remove empty classes.
 */
export const createClass = function(classes: string[]): string {
    return classes.filter(cls => cls).join(" ");
};

/**
 * Serialize a CssStyle object into a semicolon-delimited inline-style string
 * (hyphenating camelCase property names). Returns "" when no property is set.
 */
const cssStyleToString = function(style: CssStyle): string {
    let styles = "";
    for (const key of Object.keys(style) as Array<keyof CssStyle>) {
        const value = style[key];
        if (value !== undefined) {
            styles += `${hyphenate(key)}:${value};`;
        }
    }
    return styles;
};

type InitNodeData = {
    classes: string[];
    attributes: Record<string, string>;
    height: number;
    depth: number;
    maxFontSize: number;
    style: CssStyle;
};

type HtmlNodeData = InitNodeData & {
    children: VirtualNode[];
};

const initNode = function(
    this: InitNodeData,
    classes?: string[],
    options?: Options,
    style?: CssStyle,
) {
    this.classes = classes || [];
    this.attributes = {};
    this.height = 0;
    this.depth = 0;
    this.maxFontSize = 0;
    this.style = style || {};
    if (options) {
        if (options.style.isTight()) {
            this.classes.push("mtight");
        }
        const color = options.getColor();
        if (color) {
            this.style.color = color;
        }
    }
};

/**
 * Convert into an HTML node
 */
const toNode = function(this: HtmlNodeData, tagName: string): HTMLElement {
    const node = document.createElement(tagName);

    // Apply the class
    node.className = createClass(this.classes);

    // Apply inline styles
    Object.assign(node.style, this.style);

    // Apply attributes
    for (const attr of Object.keys(this.attributes)) {
        node.setAttribute(attr, this.attributes[attr]);
    }

    // Append the children, also as HTML nodes
    for (let i = 0; i < this.children.length; i++) {
        node.appendChild(this.children[i].toNode());
    }

    return node;
};

/**
 * https://w3c.github.io/html-reference/syntax.html#syntax-attributes
 *
 * > Attribute Names must consist of one or more characters
 * other than the space characters, U+0000 NULL,
 * '"', "'", ">", "/", "=", the control characters,
 * and any characters that are not defined by Unicode.
 */
const invalidAttributeNameRegex = /[\s"'>/=\x00-\x1f]/;

/**
 * Convert into an HTML markup string
 */
const toMarkup = function(this: HtmlNodeData, tagName: string): string {
    let markup = `<${tagName}`;

    // Add the class
    if (this.classes.length) {
        markup += ` class="${escape(createClass(this.classes))}"`;
    }

    const styles = cssStyleToString(this.style);
    if (styles) {
        markup += ` style="${escape(styles)}"`;
    }

    // Add the attributes
    for (const attr of Object.keys(this.attributes)) {
        if (invalidAttributeNameRegex.test(attr)) {
            throw new ParseError(`Invalid attribute name '${attr}'`);
        }
        markup += ` ${attr}="${escape(this.attributes[attr])}"`;
    }

    markup += ">";

    // Add the markup of the children, also as markup
    for (let i = 0; i < this.children.length; i++) {
        markup += this.children[i].toMarkup();
    }

    markup += `</${tagName}>`;

    return markup;
};

// Making the type below exact with all optional fields doesn't work due to
// - https://github.com/facebook/flow/issues/4582
// - https://github.com/facebook/flow/issues/5688
// However, since *all* fields are optional, $Shape<> works as suggested in 5688
// above.
// This type does not include all CSS properties. Additional properties should
// be added as needed.
export type CssStyle = Partial<{
    backgroundColor: string;
    borderBottomWidth: string;
    borderColor: string;
    borderRightStyle: string;
    borderRightWidth: string;
    borderTopWidth: string;
    borderStyle: string;
    borderWidth: string;
    bottom: string;
    color: string;
    height: string;
    left: string;
    margin: string;
    marginLeft: string;
    marginRight: string;
    marginTop: string;
    minWidth: string;
    paddingLeft: string;
    position: string;
    textShadow: string;
    top: string;
    width: string;
    verticalAlign: string;
}> & {};

export interface HtmlDomNode extends VirtualNode {
    classes: string[];
    height: number;
    depth: number;
    maxFontSize: number;
    style: CssStyle;
    hasClass(className: string): boolean;
}

// Span wrapping other DOM nodes.
export type DomSpan = Span<HtmlDomNode>;
// Span wrapping an SVG node.
export type SvgSpan = Span<SvgNode>;

export type SvgChildNode = PathNode | LineNode;
export type documentFragment = DocumentFragment<HtmlDomNode>;

/**
 * This node represents a span node, with a className, a list of children, and
 * an inline style. It also contains information about its height, depth, and
 * maxFontSize.
 *
 * Represents two types with different uses: SvgSpan to wrap an SVG and DomSpan
 * otherwise. This typesafety is important when HTML builders access a span's
 * children.
 */
export class Span<ChildType extends VirtualNode> implements HtmlDomNode {
    children: ChildType[];
    attributes!: Record<string, string>;
    classes!: string[];
    height!: number;
    depth!: number;
    width: number | null | undefined;
    maxFontSize!: number;
    style!: CssStyle;
    /**
     * Italic correction carried over from a SymbolNode when the symbol is
     * wrapped in a vlist (e.g. \oiint / \oiiint).  Read by supsub to adjust
     * subscript positioning.  Only set when nonzero; use `?? 0` at read sites.
     */
    italic?: number;

    constructor(
        classes?: string[],
        children?: ChildType[],
        options?: Options,
        style?: CssStyle,
    ) {
        initNode.call(this, classes, options, style);
        this.children = children || [];
    }

    /**
     * Sets an arbitrary attribute on the span. Warning: use this wisely. Not
     * all browsers support attributes the same, and having too many custom
     * attributes is probably bad.
     */
    setAttribute(attribute: string, value: string) {
        this.attributes[attribute] = value;
    }

    hasClass(className: string): boolean {
        return this.classes.includes(className);
    }

    toNode(): HTMLElement {
        return toNode.call(this, "span");
    }

    toMarkup(): string {
        return toMarkup.call(this, "span");
    }
}

/**
 * This node represents an anchor (<a>) element with a hyperlink.  See `span`
 * for further details.
 */
export class Anchor implements HtmlDomNode {
    children: HtmlDomNode[];
    attributes!: Record<string, string>;
    classes!: string[];
    height!: number;
    depth!: number;
    maxFontSize!: number;
    style!: CssStyle;

    constructor(
        href: string,
        classes: string[],
        children: HtmlDomNode[],
        options: Options,
    ) {
        initNode.call(this, classes, options);
        this.children = children || [];
        this.setAttribute('href', href);
    }

    setAttribute(attribute: string, value: string) {
        this.attributes[attribute] = value;
    }

    hasClass(className: string): boolean {
        return this.classes.includes(className);
    }

    toNode(): HTMLElement {
        return toNode.call(this, "a");
    }

    toMarkup(): string {
        return toMarkup.call(this, "a");
    }
}

/**
 * This node represents an image embed (<img>) element.
 */
export class Img implements VirtualNode {
    src: string;
    alt: string;
    classes: string[];
    height: number;
    depth: number;
    maxFontSize: number;
    style: CssStyle;

    constructor(
        src: string,
        alt: string,
        style: CssStyle,
    ) {
        this.alt = alt;
        this.src = src;
        this.classes = ["mord"];
        this.height = 0;
        this.depth = 0;
        this.maxFontSize = 0;
        this.style = style;
    }

    hasClass(className: string): boolean {
        return this.classes.includes(className);
    }

    toNode(): Node {
        const node = document.createElement("img");
        node.src = this.src;
        node.alt = this.alt;
        node.className = "mord";

        // Apply inline styles
        Object.assign(node.style, this.style);

        return node;
    }

    toMarkup(): string {
        let markup = `<img src="${escape(this.src)}"` +
          ` alt="${escape(this.alt)}"`;

        const styles = cssStyleToString(this.style);
        if (styles) {
            markup += ` style="${escape(styles)}"`;
        }

        markup += "'/>";
        return markup;
    }
}

const iCombinations: Record<string, string> = {
    'î': '\u0131\u0302',
    'ï': '\u0131\u0308',
    'í': '\u0131\u0301',
    // 'ī': '\u0131\u0304', // enable when we add Extended Latin
    'ì': '\u0131\u0300',
};

/**
 * A symbol node contains information about a single symbol. It either renders
 * to a single text node, or a span with a single text node in it, depending on
 * whether it has CSS classes, styles, or needs italic correction.
 */
export class SymbolNode implements HtmlDomNode {
    text: string;
    height: number;
    depth: number;
    italic: number;
    skew: number;
    width: number;
    maxFontSize: number;
    classes: string[];
    style: CssStyle;

    constructor(
        text: string,
        height?: number,
        depth?: number,
        italic?: number,
        skew?: number,
        width?: number,
        classes?: string[],
        style?: CssStyle,
    ) {
        this.text = text;
        this.height = height || 0;
        this.depth = depth || 0;
        this.italic = italic || 0;
        this.skew = skew || 0;
        this.width = width || 0;
        this.classes = classes || [];
        this.style = style || {};
        this.maxFontSize = 0;

        // Mark text from non-Latin scripts with specific classes so that we
        // can specify which fonts to use.  This allows us to render these
        // characters with a serif font in situations where the browser would
        // either default to a sans serif or render a placeholder character.
        // We use CSS class names like cjk_fallback, hangul_fallback and
        // brahmic_fallback. See ./unicodeScripts.js for the set of possible
        // script names
        const script = scriptFromCodepoint(this.text.charCodeAt(0));
        if (script) {
            this.classes.push(script + "_fallback");
        }

        if (/[îïíì]/.test(this.text)) {    // add ī when we add Extended Latin
            this.text = iCombinations[this.text];
        }
    }

    hasClass(className: string): boolean {
        return this.classes.includes(className);
    }

    /**
     * Creates a text node or span from a symbol node. Note that a span is only
     * created if it is needed.
     */
    toNode(): Node {
        const node = document.createTextNode(this.text);
        let span = null;

        if (this.italic > 0) {
            span = document.createElement("span");
            span.style.marginRight = makeEm(this.italic);
        }

        if (this.classes.length > 0) {
            span = span || document.createElement("span");
            span.className = createClass(this.classes);
        }

        if (Object.keys(this.style).length > 0) {
            span = span || document.createElement("span");
            Object.assign(span.style, this.style);
        }

        if (span) {
            span.appendChild(node);
            return span;
        } else {
            return node;
        }
    }

    /**
     * Creates markup for a symbol node.
     */
    toMarkup(): string {
        // TODO(alpert): More duplication than I'd like from
        // span.prototype.toMarkup and symbolNode.prototype.toNode...
        let needsSpan = false;

        let markup = "<span";

        if (this.classes.length) {
            needsSpan = true;
            markup += " class=\"";
            markup += escape(createClass(this.classes));
            markup += "\"";
        }

        let styles = "";

        if (this.italic > 0) {
            styles += `margin-right:${makeEm(this.italic)};`;
        }
        styles += cssStyleToString(this.style);

        if (styles) {
            needsSpan = true;
            markup += " style=\"" + escape(styles) + "\"";
        }

        const escaped = escape(this.text);
        if (needsSpan) {
            markup += ">";
            markup += escaped;
            markup += "</span>";
            return markup;
        } else {
            return escaped;
        }
    }
}

/**
 * SVG nodes are used to render stretchy wide elements.
 */
export class SvgNode implements VirtualNode {
    children: SvgChildNode[];
    attributes: Record<string, string>;

    constructor(
        children?: SvgChildNode[],
        attributes?: Record<string, string>,
    ) {
        this.children = children || [];
        this.attributes = attributes || {};
    }

    toNode(): Node {
        const svgNS = "http://www.w3.org/2000/svg";
        const node = document.createElementNS(svgNS, "svg");

        // Apply attributes
        for (const attr of Object.keys(this.attributes)) {
            node.setAttribute(attr, this.attributes[attr]);
        }

        for (let i = 0; i < this.children.length; i++) {
            node.appendChild(this.children[i].toNode());
        }
        return node;
    }

    toMarkup(): string {
        let markup = `<svg xmlns="http://www.w3.org/2000/svg"`;

        // Apply attributes
        for (const attr of Object.keys(this.attributes)) {
            markup += ` ${attr}="${escape(this.attributes[attr])}"`;
        }

        markup += ">";

        for (let i = 0; i < this.children.length; i++) {
            markup += this.children[i].toMarkup();
        }

        markup += "</svg>";

        return markup;

    }
}

export class PathNode implements VirtualNode {
    pathName: string;
    alternate: string | null | undefined;

    constructor(pathName: string, alternate?: string) {
        this.pathName = pathName;
        this.alternate = alternate;  // Used only for \sqrt, \phase, & tall delims
    }

    toNode(): Node {
        const svgNS = "http://www.w3.org/2000/svg";
        const node = document.createElementNS(svgNS, "path");

        if (this.alternate) {
            node.setAttribute("d", this.alternate);
        } else {
            node.setAttribute("d", path[this.pathName]);
        }

        return node;
    }

    toMarkup(): string {
        if (this.alternate) {
            return `<path d="${escape(this.alternate)}"/>`;
        } else {
            return `<path d="${escape(path[this.pathName])}"/>`;
        }
    }
}

export class LineNode implements VirtualNode {
    attributes: Record<string, string>;

    constructor(
        attributes?: Record<string, string>,
    ) {
        this.attributes = attributes || {};
    }

    toNode(): Node {
        const svgNS = "http://www.w3.org/2000/svg";
        const node = document.createElementNS(svgNS, "line");

        // Apply attributes
        for (const attr of Object.keys(this.attributes)) {
            node.setAttribute(attr, this.attributes[attr]);
        }

        return node;
    }

    toMarkup(): string {
        let markup = "<line";

        for (const attr of Object.keys(this.attributes)) {
            markup += ` ${attr}="${escape(this.attributes[attr])}"`;
        }

        markup += "/>";

        return markup;
    }
}

export function assertSymbolDomNode(
    group: HtmlDomNode,
): SymbolNode {
    if (group instanceof SymbolNode) {
        return group;
    } else {
        throw new Error(`Expected symbolNode but got ${String(group)}.`);
    }
}

export function assertSpan(
    group: HtmlDomNode,
): Span<HtmlDomNode> {
    if (group instanceof Span) {
        return group;
    } else {
        throw new Error(`Expected span<HtmlDomNode> but got ${String(group)}.`);
    }
}

/**
 * Whether an HtmlDomNode has HtmlDomNode children.
 * HtmlDomNode is a base type representing a union of
 * SymbolNode, SvgSpan, DomSpan, Anchor, and documentFragment.
 * In the last three cases, the children are HtmlDomNode[].
 */
export const hasHtmlDomChildren = (
    node: HtmlDomNode,
): node is DomSpan | Anchor | documentFragment =>
    node instanceof Span ||
    node instanceof Anchor ||
    node instanceof DocumentFragment;
[x 1import {_environments} from "./defineEnvironment";

const environments = _environments;

export default environments;

// All environment definitions should be imported below
import "./environments/array";
KxE 100644 array.ts #Ds-7Eyʁ100644 cd.ts =O"+#`\qYe19xyiimport {makeFragment, makeLineSpan, makeSpan, makeVList} from "../buildCommon";
import Style from "../Style";
import defineEnvironment from "../defineEnvironment";
import {parseCD} from "./cd";
import defineFunction from "../defineFunction";
import defineMacro from "../defineMacro";
import {MathNode} from "../mathMLTree";
import ParseError from "../ParseError";
import {assertNodeType, assertSymbolNodeType} from "../parseNode";
import {checkSymbolNodeType} from "../parseNode";
import {Token} from "../Token";
import {calculateSize, makeEm} from "../units";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";

import type Parser from "../Parser";
import type {ParseNode, AnyParseNode} from "../parseNode";
import type {StyleStr, Mode} from "../types";
import type {HtmlBuilder, MathMLBuilder} from "../defineFunction";
import type {HtmlDomNode} from "../domTree";

type EnvContextLike = {
    parser: Parser;
    envName: string;
    mode: Mode;
};

// Data stored in the ParseNode associated with the environment.
export type AlignSpec = {type: "separator", separator: string} | {
    type: "align";
    align: string;
    pregap?: number;
    postgap?: number;
};

// Type to indicate column separation in MathML
export type ColSeparationType = "align" | "alignat" | "gather" | "small" | "CD";

// Helper functions
function getHLines(parser: Parser): boolean[] {
    // Return an array. The array length = number of hlines.
    // Each element in the array tells if the line is dashed.
    const hlineInfo = [];
    parser.consumeSpaces();
    let nxt = parser.fetch().text;
    if (nxt === "\\relax") { // \relax is an artifact of the \cr macro below
        parser.consume();
        parser.consumeSpaces();
        nxt = parser.fetch().text;
    }
    while (nxt === "\\hline" || nxt === "\\hdashline") {
        parser.consume();
        hlineInfo.push(nxt === "\\hdashline");
        parser.consumeSpaces();
        nxt = parser.fetch().text;
    }
    return hlineInfo;
}

const validateAmsEnvironmentContext = (context: EnvContextLike) => {
    const settings = context.parser.settings;
    if (!settings.displayMode) {
        throw new ParseError(`{${context.envName}} can be used only in` +
            ` display mode.`);
    }
};

const gatherEnvironments = new Set(["gather", "gather*"]);

// autoTag (an argument to parseArray) can be one of three values:
// * undefined: Regular (not-top-level) array; no tags on each row
// * true: Automatic equation numbering, overridable by \tag
// * false: Tags allowed on each row, but no automatic numbering
// This function *doesn't* work with the "split" environment name.
function getAutoTag(name: string): boolean | null | undefined {
    if (!name.includes("ed")) {
        return !name.includes("*");
    }
    // return undefined;
}

/**
 * Parse the body of the environment, with rows delimited by \\ and
 * columns delimited by &, and create a nested list in row-major order
 * with one group per cell.  If given an optional argument style
 * ("text", "display", etc.), then each cell is cast into that style.
 */
function parseArray(
    parser: Parser,
    {
        hskipBeforeAndAfter,
        addJot,
        cols,
        arraystretch,
        colSeparationType,
        autoTag,
        singleRow,
        emptySingleRow,
        maxNumCols,
        leqno,
    }: {
        hskipBeforeAndAfter?: boolean;
        addJot?: boolean;
        cols?: AlignSpec[];
        arraystretch?: number;
        colSeparationType?: ColSeparationType;
        autoTag?: boolean | null | undefined;
        singleRow?: boolean;
        emptySingleRow?: boolean;
        maxNumCols?: number;
        leqno?: boolean;
    },
    style: StyleStr,
): ParseNode<"array"> {
    parser.gullet.beginGroup();
    if (!singleRow) {
        // \cr is equivalent to \\ without the optional size argument (see below)
        // TODO: provide helpful error when \cr is used outside array environment
        parser.gullet.macros.set("\\cr", "\\\\\\relax");
    }

    // Get current arraystretch if it's not set by the environment
    if (!arraystretch) {
        const stretch = parser.gullet.expandMacroAsText("\\arraystretch");
        if (stretch == null) {
            // Default \arraystretch from lttab.dtx
            arraystretch = 1;
        } else {
            arraystretch = parseFloat(stretch);
            if (!arraystretch || arraystretch < 0) {
                throw new ParseError(`Invalid \\arraystretch: ${stretch}`);
            }
        }
    }

    // Start group for first cell
    parser.gullet.beginGroup();

    let row: AnyParseNode[] = [];
    const body: AnyParseNode[][] = [row];
    const rowGaps = [];
    const hLinesBeforeRow = [];
    const tags: Array<AnyParseNode[] | boolean> | undefined =
        (autoTag != null ? [] : undefined);

    // amsmath uses \global\@eqnswtrue and \global\@eqnswfalse to represent
    // whether this row should have an equation number.  Simulate this with
    // a \@eqnsw macro set to 1 or 0.
    function beginRow() {
        if (autoTag) {
            parser.gullet.macros.set("\\@eqnsw", "1", true);
        }
    }
    function endRow() {
        if (tags) {
            if (parser.gullet.macros.get("\\df@tag")) {
                tags.push(parser.subparse([new Token("\\df@tag")]));
                parser.gullet.macros.set("\\df@tag", undefined, true);
            } else {
                tags.push(Boolean(autoTag) &&
                    parser.gullet.macros.get("\\@eqnsw") === "1");
            }
        }
    }
    beginRow();

    // Test for \hline at the top of the array.
    hLinesBeforeRow.push(getHLines(parser));

    while (true) {
        // Parse each cell in its own group (namespace)
        const cellBody = parser.parseExpression(false, singleRow ? "\\end" : "\\\\");
        parser.gullet.endGroup();
        parser.gullet.beginGroup();
        let cell: AnyParseNode = {
            type: "ordgroup",
            mode: parser.mode,
            body: cellBody,
        };
        if (style) {
            cell = {
                type: "styling",
                mode: parser.mode,
                style,
                resetFont: true,
                body: [cell],
            };
        }
        row.push(cell);
        const next = parser.fetch().text;
        if (next === "&") {
            if (maxNumCols && row.length === maxNumCols) {
                if (singleRow || colSeparationType) {
                    // {equation} or {split}
                    throw new ParseError("Too many tab characters: &",
                                        parser.nextToken);
                } else {
                    // {array} environment
                    parser.settings.reportNonstrict("textEnv", "Too few columns " +
                    "specified in the {array} column argument.");
                }
            }
            parser.consume();
        } else if (next === "\\end") {
            endRow();
            // Arrays terminate newlines with `\crcr` which consumes a `\cr` if
            // the last line is empty.  However, AMS environments keep the
            // empty row if it's the only one.
            // NOTE: Currently, `cell` is the last item added into `row`.
            if (row.length === 1 && cell.type === "styling" &&
                cell.body.length === 1 && cell.body[0].type === "ordgroup" &&
                cell.body[0].body.length === 0 &&
                (body.length > 1 || !emptySingleRow)) {
                body.pop();
            }
            if (hLinesBeforeRow.length < body.length + 1) {
                hLinesBeforeRow.push([]);
            }
            break;
        } else if (next === "\\\\") {
            parser.consume();
            let size;
            // \def\Let@{\let\\\math@cr}
            // \def\math@cr{...\math@cr@}
            // \def\math@cr@{\new@ifnextchar[\math@cr@@{\math@cr@@[\z@]}}
            // \def\math@cr@@[#1]{...\math@cr@@@...}
            // \def\math@cr@@@{\cr}
            if (parser.gullet.future().text !== " ") {
                size = parser.parseSizeGroup(true);
            }
            rowGaps.push(size ? size.value : null);
            endRow();

            // check for \hline(s) following the row separator
            hLinesBeforeRow.push(getHLines(parser));

            row = [];
            body.push(row);
            beginRow();
        } else {
            throw new ParseError("Expected & or \\\\ or \\cr or \\end",
                                 parser.nextToken);
        }
    }

    // End cell group
    parser.gullet.endGroup();
    // End array group defining \cr
    parser.gullet.endGroup();

    return {
        type: "array",
        mode: parser.mode,
        addJot,
        arraystretch,
        body,
        cols,
        rowGaps,
        hskipBeforeAndAfter,
        hLinesBeforeRow,
        colSeparationType,
        tags,
        leqno,
    };
}

// Decides on a style for cells in an array according to whether the given
// environment name starts with the letter 'd'.
function dCellStyle(envName: string): StyleStr {
    if (envName.slice(0, 1) === "d") {
        return "display";
    } else {
        return "text";
    }
}

type Outrow = {
    cells: HtmlDomNode[];
    height: number;
    depth: number;
    pos: number;
};

const htmlBuilder: HtmlBuilder<"array"> = function(group, options) {
    let r;
    let c;
    const nr = group.body.length;
    const hLinesBeforeRow = group.hLinesBeforeRow;
    let nc = 0;
    const body: Outrow[] = new Array(nr);
    const hlines: Array<{pos: number; isDashed: boolean}> = [];
    const ruleThickness = Math.max(
        // From LaTeX \showthe\arrayrulewidth. Equals 0.04 em.
        options.fontMetrics().arrayRuleWidth,
        options.minRuleThickness, // User override.
    );

    // Horizontal spacing
    const pt = 1 / options.fontMetrics().ptPerEm;
    let arraycolsep = 5 * pt; // default value, i.e. \arraycolsep in article.cls
    if (group.colSeparationType && group.colSeparationType === "small") {
        // We're in a {smallmatrix}. Default column space is \thickspace,
        // i.e. 5/18em = 0.2778em, per amsmath.dtx for {smallmatrix}.
        // But that needs adjustment because LaTeX applies \scriptstyle to the
        // entire array, including the colspace, but this function applies
        // \scriptstyle only inside each element.
        const localMultiplier = options.havingStyle(Style.SCRIPT).sizeMultiplier;
        arraycolsep = 0.2778 * (localMultiplier / options.sizeMultiplier);
    }

    // Vertical spacing
    const baselineskip = group.colSeparationType === "CD"
        ? calculateSize({number: 3, unit: "ex"}, options)
        : 12 * pt; // see size10.clo
    // Default \jot from ltmath.dtx
    // TODO(edemaine): allow overriding \jot via \setlength (#687)
    const jot = 3 * pt;
    const arrayskip = group.arraystretch * baselineskip;
    const arstrutHeight = 0.7 * arrayskip; // \strutbox in ltfsstrc.dtx and
    const arstrutDepth = 0.3 * arrayskip;  // \@arstrutbox in lttab.dtx

    let totalHeight = 0;

    // Set a position for \hline(s) at the top of the array, if any.
    function setHLinePos(hlinesInGap: boolean[]) {
        for (let i = 0; i < hlinesInGap.length; ++i) {
            if (i > 0) {
                totalHeight += 0.25;
            }
            hlines.push({pos: totalHeight, isDashed: hlinesInGap[i]});
        }
    }
    setHLinePos(hLinesBeforeRow[0]);

    for (r = 0; r < group.body.length; ++r) {
        const inrow = group.body[r];
        let height = arstrutHeight; // \@array adds an \@arstrut
        let depth = arstrutDepth;   // to each tow (via the template)

        if (nc < inrow.length) {
            nc = inrow.length;
        }

        const outrow: Outrow = {
            cells: new Array<HtmlDomNode>(inrow.length),
            height: 0,
            depth: 0,
            pos: 0,
        };
        for (c = 0; c < inrow.length; ++c) {
            const elt = html.buildGroup(inrow[c], options);
            if (depth < elt.depth) {
                depth = elt.depth;
            }
            if (height < elt.height) {
                height = elt.height;
            }
            outrow.cells[c] = elt;
        }

        const rowGap = group.rowGaps[r];
        let gap = 0;
        if (rowGap) {
            gap = calculateSize(rowGap, options);
            if (gap > 0) { // \@argarraycr
                gap += arstrutDepth;
                if (depth < gap) {
                    depth = gap; // \@xargarraycr
                }
                gap = 0;
            }
        }
        // In AMS multiline environments such as aligned and gathered, rows
        // correspond to lines that have additional \jot added between lines
        // via \openup.
        // We simulate this by adding \jot depth to each row except the last.
        if (group.addJot && r < group.body.length - 1) {
            depth += jot;
        }

        outrow.height = height;
        outrow.depth = depth;
        totalHeight += height;
        outrow.pos = totalHeight;
        totalHeight += depth + gap; // \@yargarraycr
        body[r] = outrow;

        // Set a position for \hline(s), if any.
        setHLinePos(hLinesBeforeRow[r + 1]);
    }

    const offset = totalHeight / 2 + options.fontMetrics().axisHeight;
    const colDescriptions = group.cols || [];
    const cols: HtmlDomNode[] = [];
    let colSep;
    let colDescrNum;
    const tagSpans: Array<{
        type: "elem";
        elem: HtmlDomNode;
        shift: number;
    }> = [];

    if (group.tags && group.tags.some(tag => tag)) {
        // An environment with manual tags and/or automatic equation numbers.
        // Create node(s), the latter of which trigger CSS counter increment.
        for (r = 0; r < nr; ++r) {
            const rw = body[r];
            const shift = rw.pos - offset;
            const tag = group.tags[r];
            let tagSpan;
            if (tag === true) {  // automatic numbering
                tagSpan = makeSpan(["eqn-num"], [], options);
            } else if (tag === false) {
                // \nonumber/\notag or starred environment
                tagSpan = makeSpan([], [], options);
            } else {  // manual \tag
                tagSpan = makeSpan([],
                    html.buildExpression(tag, options, true), options);
            }
            tagSpan.depth = rw.depth;
            tagSpan.height = rw.height;
            tagSpans.push({type: "elem", elem: tagSpan, shift});
        }
    }

    for (c = 0, colDescrNum = 0;
         // Continue while either there are more columns or more column
         // descriptions, so trailing separators don't get lost.
         c < nc || colDescrNum < colDescriptions.length;
         ++c, ++colDescrNum) {
        let colDescr: AlignSpec | undefined = colDescriptions[colDescrNum];

        let firstSeparator = true;
        while (colDescr?.type === "separator") {
            // If there is more than one separator in a row, add a space
            // between them.
            if (!firstSeparator) {
                colSep = makeSpan(["arraycolsep"], []);
                colSep.style.width =
                    makeEm(options.fontMetrics().doubleRuleSep);
                cols.push(colSep);
            }

            if (colDescr.separator === "|" || colDescr.separator === ":") {
                const lineType = colDescr.separator === "|" ? "solid" : "dashed";
                const separator = makeSpan(["vertical-separator"], [], options);
                separator.style.height = makeEm(totalHeight);
                separator.style.borderRightWidth = makeEm(ruleThickness);
                separator.style.borderRightStyle = lineType;
                separator.style.margin = `0 ${makeEm(-ruleThickness / 2)}`;
                const shift = totalHeight - offset;
                if (shift) {
                    separator.style.verticalAlign = makeEm(-shift);
                }

                cols.push(separator);
            } else {
                throw new ParseError(
                    "Invalid separator type: " + colDescr.separator);
            }

            colDescrNum++;
            colDescr = colDescriptions[colDescrNum];
            firstSeparator = false;
        }

        if (c >= nc) {
            continue;
        }

        let sepwidth;
        if (c > 0 || group.hskipBeforeAndAfter) {
            sepwidth = colDescr?.pregap ?? arraycolsep;
            if (sepwidth !== 0) {
                colSep = makeSpan(["arraycolsep"], []);
                colSep.style.width = makeEm(sepwidth);
                cols.push(colSep);
            }
        }

        const colElems: Array<{
            type: "elem";
            elem: HtmlDomNode;
            shift: number;
        }> = [];
        for (r = 0; r < nr; ++r) {
            const row = body[r];
            const elem = row.cells[c];
            if (!elem) {
                continue;
            }
            const shift = row.pos - offset;
            elem.depth = row.depth;
            elem.height = row.height;
            colElems.push({type: "elem", elem: elem, shift: shift});
        }

        const colVList = makeVList({
            positionType: "individualShift",
            children: colElems,
        }, options);
        const colSpan = makeSpan(
            ["col-align-" + (colDescr?.align || "c")],
            [colVList],
        );
        cols.push(colSpan);

        if (c < nc - 1 || group.hskipBeforeAndAfter) {
            sepwidth = colDescr?.postgap ?? arraycolsep;
            if (sepwidth !== 0) {
                colSep = makeSpan(["arraycolsep"], []);
                colSep.style.width = makeEm(sepwidth);
                cols.push(colSep);
            }
        }
    }

    let tableBody: HtmlDomNode = makeSpan(["mtable"], cols);

    // Add \hline(s), if any.
    if (hlines.length > 0) {
        const line = makeLineSpan("hline", options, ruleThickness);
        const dashes = makeLineSpan("hdashline", options, ruleThickness);
        const vListElems = [{type: "elem" as const, elem: tableBody, shift: 0}];
        while (hlines.length > 0) {
            const hline = hlines.pop()!;
            const lineShift = hline.pos - offset;
            if (hline.isDashed) {
                vListElems.push({type: "elem" as const, elem: dashes, shift: lineShift});
            } else {
                vListElems.push({type: "elem" as const, elem: line, shift: lineShift});
            }
        }

        tableBody = makeVList({
            positionType: "individualShift",
            children: vListElems,
        }, options);
    }

    if (tagSpans.length === 0) {
        return makeSpan(["mord"], [tableBody], options);
    } else {
        const eqnNumCol = makeVList({
            positionType: "individualShift",
            children: tagSpans,
        }, options);
        const tagCol = makeSpan(["tag"], [eqnNumCol], options);
        return makeFragment([tableBody, tagCol]);
    }
};

const alignMap: Record<string, string> = {
    c: "center ",
    l: "left ",
    r: "right ",
};

const mathmlBuilder: MathMLBuilder<"array"> = function(group, options) {
    const tbl = [];
    const glue = new MathNode("mtd", [], ["mtr-glue"]);
    const tag = new MathNode("mtd", [], ["mml-eqn-num"]);
    for (let i = 0; i < group.body.length; i++) {
        const rw = group.body[i];
        const row = [];
        for (let j = 0; j < rw.length; j++) {
            row.push(new MathNode("mtd",
                [mml.buildGroup(rw[j], options)]));
        }
        if (group.tags && group.tags[i]) {
            row.unshift(glue);
            row.push(glue);
            if (group.leqno) {
                row.unshift(tag);
            } else {
                row.push(tag);
            }
        }
        tbl.push(new MathNode("mtr", row));
    }
    let table = new MathNode("mtable", tbl);

    // Set column alignment, row spacing, column spacing, and
    // array lines by setting attributes on the table element.

    // Set the row spacing. In MathML, we specify a gap distance.
    // We do not use rowGap[] because MathML automatically increases
    // cell height with the height/depth of the element content.

    // LaTeX \arraystretch multiplies the row baseline-to-baseline distance.
    // We simulate this by adding (arraystretch - 1)em to the gap. This
    // does a reasonable job of adjusting arrays containing 1 em tall content.

    // The 0.16 and 0.09 values are found empirically. They produce an array
    // similar to LaTeX and in which content does not interfere with \hlines.
    const gap = (group.arraystretch === 0.5)
        ? 0.1  // {smallmatrix}, {subarray}
        : 0.16 + group.arraystretch - 1 + (group.addJot ? 0.09 : 0);
    table.setAttribute("rowspacing", makeEm(gap));

    // MathML table lines go only between cells.
    // To place a line on an edge we'll use <menclose>, if necessary.
    let menclose = "";
    let align = "";

    if (group.cols && group.cols.length > 0) {
        // Find column alignment, column spacing, and  vertical lines.
        const cols = group.cols;
        let columnLines = "";
        let prevTypeWasAlign = false;
        let iStart = 0;
        let iEnd = cols.length;

        if (cols[0].type === "separator") {
            menclose += "top ";
            iStart = 1;
        }
        if (cols[cols.length - 1].type === "separator") {
            menclose += "bottom ";
            iEnd -= 1;
        }

        for (let i = iStart; i < iEnd; i++) {
            const col = cols[i];
            if (col.type === "align") {
                align += alignMap[col.align];

                if (prevTypeWasAlign) {
                    columnLines += "none ";
                }
                prevTypeWasAlign = true;
            } else if (col.type === "separator") {
                // MathML accepts only single lines between cells.
                // So we read only the first of consecutive separators.
                if (prevTypeWasAlign) {
                    columnLines += col.separator === "|" ? "solid " : "dashed ";
                    prevTypeWasAlign = false;
                }
            }
        }

        table.setAttribute("columnalign", align.trim());

        if (/[sd]/.test(columnLines)) {
            table.setAttribute("columnlines", columnLines.trim());
        }
    }

    // Set column spacing.
    if (group.colSeparationType === "align") {
        const cols = group.cols || [];
        let spacing = "";
        for (let i = 1; i < cols.length; i++) {
            spacing += i % 2 ? "0em " : "1em ";
        }
        table.setAttribute("columnspacing", spacing.trim());
    } else if (group.colSeparationType === "alignat" ||
        group.colSeparationType === "gather") {
        table.setAttribute("columnspacing", "0em");
    } else if (group.colSeparationType === "small") {
        table.setAttribute("columnspacing", "0.2778em");
    } else if (group.colSeparationType === "CD") {
        table.setAttribute("columnspacing", "0.5em");
    } else {
        table.setAttribute("columnspacing", "1em");
    }

    // Address \hline and \hdashline
    let rowLines = "";
    const hlines = group.hLinesBeforeRow;

    menclose += hlines[0].length > 0 ? "left " : "";
    menclose += hlines[hlines.length - 1].length > 0 ? "right " : "";

    for (let i = 1; i < hlines.length - 1; i++) {
        rowLines += (hlines[i].length === 0)
          ? "none "
             // MathML accepts only a single line between rows. Read one element.
          : hlines[i][0] ? "dashed " : "solid ";
    }
    if (/[sd]/.test(rowLines)) {
        table.setAttribute("rowlines", rowLines.trim());
    }

    if (menclose !== "") {
        table = new MathNode("menclose", [table]);
        table.setAttribute("notation", menclose.trim());
    }

    if (group.arraystretch && group.arraystretch < 1) {
        // A small array. Wrap in scriptstyle so row gap is not too large.
        table = new MathNode("mstyle", [table]);
        table.setAttribute("scriptlevel", "1");
    }

    return table;
};

// Convenience function for align, align*, aligned, alignat, alignat*, alignedat.
const alignedHandler = function(context: EnvContextLike, args: AnyParseNode[]) {
    if (!context.envName.includes("ed")) {
        validateAmsEnvironmentContext(context);
    }
    const cols: AlignSpec[] = [];
    const separationType: ColSeparationType = context.envName.includes("at") ? "alignat" : "align";
    const isSplit = context.envName === "split";
    const res = parseArray(context.parser,
        {
            cols,
            addJot: true,
            autoTag: isSplit ? undefined : getAutoTag(context.envName),
            emptySingleRow: true,
            colSeparationType: separationType,
            maxNumCols: isSplit ? 2 : undefined,
            leqno: context.parser.settings.leqno,
        },
        "display"
    );

    // Determining number of columns.
    // 1. If the first argument is given, we use it as a number of columns,
    //    and makes sure that each row doesn't exceed that number.
    // 2. Otherwise, just count number of columns = maximum number
    //    of cells in each row ("aligned" mode -- isAligned will be true).
    //
    // At the same time, prepend empty group {} at beginning of every second
    // cell in each row (starting with second cell) so that operators become
    // binary.  This behavior is implemented in amsmath's \start@aligned.
    let numMaths = 0;
    let numCols = 0;
    const emptyGroup: ParseNode<"ordgroup"> = {
        type: "ordgroup",
        mode: context.mode,
        body: [],
    };
    if (args[0] && args[0].type === "ordgroup") {
        let arg0 = "";
        for (let i = 0; i < args[0].body.length; i++) {
            const textord = assertNodeType(args[0].body[i], "textord");
            arg0 += textord.text;
        }
        numMaths = Number(arg0);
        numCols = numMaths * 2;
    }
    const isAligned = !numCols;
    res.body.forEach(function(row) {
        for (let i = 1; i < row.length; i += 2) {
            // Modify ordgroup node within styling node
            const styling = assertNodeType(row[i], "styling");
            const ordgroup = assertNodeType(styling.body[0], "ordgroup");
            ordgroup.body.unshift(emptyGroup);
        }
        if (!isAligned) { // Case 1
            const curMaths = row.length / 2;
            if (numMaths < curMaths) {
                throw new ParseError(
                    "Too many math in a row: " +
                    `expected ${numMaths}, but got ${curMaths}`,
                    row[0]);
            }
        } else if (numCols < row.length) { // Case 2
            numCols = row.length;
        }
    });

    // Adjusting alignment.
    // In aligned mode, we add one \qquad between columns;
    // otherwise we add nothing.
    for (let i = 0; i < numCols; ++i) {
        let align = "r";
        let pregap = 0;
        if (i % 2 === 1) {
            align = "l";
        } else if (i > 0 && isAligned) { // "aligned" mode.
            pregap = 1; // add one \quad
        }
        cols[i] = {
            type: "align",
            align: align,
            pregap: pregap,
            postgap: 0,
        };
    }
    res.colSeparationType = isAligned ? "align" : "alignat";
    return res;
};

// Arrays are part of LaTeX, defined in lttab.dtx so its documentation
// is part of the source2e.pdf file of LaTeX2e source documentation.
// {darray} is an {array} environment where cells are set in \displaystyle,
// as defined in nccmath.sty.
defineEnvironment({
    type: "array",
    names: ["array", "darray"],
    props: {
        numArgs: 1,
    },
    handler(context, args) {
        // Since no types are specified above, the two possibilities are
        // - The argument is wrapped in {} or [], in which case Parser's
        //   parseGroup() returns an "ordgroup" wrapping some symbol node.
        // - The argument is a bare symbol node.
        const symNode = checkSymbolNodeType(args[0]);
        const colalign: AnyParseNode[] =
            symNode ? [args[0]] : assertNodeType(args[0], "ordgroup").body;
        const cols: AlignSpec[] = colalign.map(function(nde) {
            const node = assertSymbolNodeType(nde);
            const ca = node.text;
            if ("lcr".includes(ca)) {
                return {
                    type: "align",
                    align: ca,
                };
            } else if (ca === "|") {
                return {
                    type: "separator",
                    separator: "|",
                };
            } else if (ca === ":") {
                return {
                    type: "separator",
                    separator: ":",
                };
            }
            throw new ParseError("Unknown column alignment: " + ca, nde);
        });
        const res: Parameters<typeof parseArray>[1] = {
            cols,
            hskipBeforeAndAfter: true, // \@preamble in lttab.dtx
            maxNumCols: cols.length,
        };
        return parseArray(context.parser, res, dCellStyle(context.envName));
    },
    htmlBuilder,
    mathmlBuilder,
});

// The matrix environments of amsmath builds on the array environment
// of LaTeX, which is discussed above.
// The mathtools package adds starred versions of the same environments.
// These have an optional argument to choose left|center|right justification.
defineEnvironment({
    type: "array",
    names: [
        "matrix",
        "pmatrix",
        "bmatrix",
        "Bmatrix",
        "vmatrix",
        "Vmatrix",
        "matrix*",
        "pmatrix*",
        "bmatrix*",
        "Bmatrix*",
        "vmatrix*",
        "Vmatrix*",
    ],
    props: {
        numArgs: 0,
    },
    handler(context) {
        const delimiters = {
            "matrix": null,
            "pmatrix": ["(", ")"],
            "bmatrix": ["[", "]"],
            "Bmatrix": ["\\{", "\\}"],
            "vmatrix": ["|", "|"],
            "Vmatrix": ["\\Vert", "\\Vert"],
        }[context.envName.replace("*", "")];
        // \hskip -\arraycolsep in amsmath
        let colAlign = "c";
        const payload: Parameters<typeof parseArray>[1] = {
            hskipBeforeAndAfter: false,
            cols: [{type: "align", align: colAlign}],
        };
        if (context.envName.charAt(context.envName.length - 1) === "*") {
            // It's one of the mathtools starred functions.
            // Parse the optional alignment argument.
            const parser = context.parser;
            parser.consumeSpaces();
            if (parser.fetch().text === "[") {
                parser.consume();
                parser.consumeSpaces();
                colAlign = parser.fetch().text;
                if (!"lcr".includes(colAlign)) {
                    throw new ParseError("Expected l or c or r", parser.nextToken);
                }
                parser.consume();
                parser.consumeSpaces();
                parser.expect("]");
                parser.consume();
                payload.cols = [{type: "align", align: colAlign}];
            }
        }
        const res: ParseNode<"array"> =
            parseArray(context.parser, payload, dCellStyle(context.envName));
        // Populate cols with the correct number of column alignment specs.
        const numCols = Math.max(0, ...res.body.map(row => row.length));
        res.cols = new Array(numCols).fill(
            {type: "align", align: colAlign}
        );
        return delimiters ? {
            type: "leftright",
            mode: context.mode,
            body: [res],
            left: delimiters[0],
            right: delimiters[1],
            rightColor: undefined, // \right uninfluenced by \color in array
        } : res;
    },
    htmlBuilder,
    mathmlBuilder,
});

defineEnvironment({
    type: "array",
    names: ["smallmatrix"],
    props: {
        numArgs: 0,
    },
    handler(context) {
        const payload: Parameters<typeof parseArray>[1] = {arraystretch: 0.5};
        const res = parseArray(context.parser, payload, "script");
        res.colSeparationType = "small";
        return res;
    },
    htmlBuilder,
    mathmlBuilder,
});

defineEnvironment({
    type: "array",
    names: ["subarray"],
    props: {
        numArgs: 1,
    },
    handler(context, args) {
        // Parsing of {subarray} is similar to {array}
        const symNode = checkSymbolNodeType(args[0]);
        const colalign: AnyParseNode[] =
            symNode ? [args[0]] : assertNodeType(args[0], "ordgroup").body;
        const cols: AlignSpec[] = colalign.map(function(nde) {
            const node = assertSymbolNodeType(nde);
            const ca = node.text;
            // {subarray} only recognizes "l" & "c"
            if ("lc".includes(ca)) {
                return {
                    type: "align",
                    align: ca,
                };
            }
            throw new ParseError("Unknown column alignment: " + ca, nde);
        });
        if (cols.length > 1) {
            throw new ParseError("{subarray} can contain only one column");
        }
        const payload: Parameters<typeof parseArray>[1] = {
            cols,
            hskipBeforeAndAfter: false,
            arraystretch: 0.5,
        };
        const res = parseArray(context.parser, payload, "script");
        if (res.body.length > 0 &&  res.body[0].length > 1) {
            throw new ParseError("{subarray} can contain only one column");
        }
        return res;
    },
    htmlBuilder,
    mathmlBuilder,
});

// A cases environment (in amsmath.sty) is almost equivalent to
// \def\arraystretch{1.2}%
// \left\{\begin{array}{@{}l@{\quad}l@{}} … \end{array}\right.
// {dcases} is a {cases} environment where cells are set in \displaystyle,
// as defined in mathtools.sty.
// {rcases} is another mathtools environment. It's brace is on the right side.
defineEnvironment({
    type: "array",
    names: [
        "cases",
        "dcases",
        "rcases",
        "drcases",
    ],
    props: {
        numArgs: 0,
    },
    handler(context) {
        const payload: Parameters<typeof parseArray>[1] = {
            arraystretch: 1.2,
            cols: [{
                type: "align",
                align: "l",
                pregap: 0,
                // TODO(kevinb) get the current style.
                // For now we use the metrics for TEXT style which is what we were
                // doing before.  Before attempting to get the current style we
                // should look at TeX's behavior especially for \over and matrices.
                postgap: 1.0, /* 1em quad */
            }, {
                type: "align",
                align: "l",
                pregap: 0,
                postgap: 0,
            }],
        };
        const res: ParseNode<"array"> =
            parseArray(context.parser, payload, dCellStyle(context.envName));
        return {
            type: "leftright",
            mode: context.mode,
            body: [res],
            left: context.envName.includes("r") ? "." : "\\{",
            right: context.envName.includes("r") ? "\\}" : ".",
            rightColor: undefined,
        };
    },
    htmlBuilder,
    mathmlBuilder,
});

// In the align environment, one uses ampersands, &, to specify number of
// columns in each row, and to locate spacing between each column.
// align gets automatic numbering. align* and aligned do not.
// The alignedat environment can be used in math mode.
// Note that we assume \nomallineskiplimit to be zero,
// so that \strut@ is the same as \strut.
defineEnvironment({
    type: "array",
    names: ["align", "align*", "aligned", "split"],
    props: {
        numArgs: 0,
    },
    handler: alignedHandler,
    htmlBuilder,
    mathmlBuilder,
});

// A gathered environment is like an array environment with one centered
// column, but where rows are considered lines so get \jot line spacing
// and contents are set in \displaystyle.
defineEnvironment({
    type: "array",
    names: ["gathered", "gather", "gather*"],
    props: {
        numArgs: 0,
    },
    handler(context) {
        if (gatherEnvironments.has(context.envName)) {
            validateAmsEnvironmentContext(context);
        }
        const res: Parameters<typeof parseArray>[1] = {
            cols: [{
                type: "align",
                align: "c",
            }],
            addJot: true,
            colSeparationType: "gather",
            autoTag: getAutoTag(context.envName),
            emptySingleRow: true,
            leqno: context.parser.settings.leqno,
        };
        return parseArray(context.parser, res, "display");
    },
    htmlBuilder,
    mathmlBuilder,
});

// alignat environment is like an align environment, but one must explicitly
// specify maximum number of columns in each row, and can adjust spacing between
// each columns.
defineEnvironment({
    type: "array",
    names: ["alignat", "alignat*", "alignedat"],
    props: {
        numArgs: 1,
    },
    handler: alignedHandler,
    htmlBuilder,
    mathmlBuilder,
});

defineEnvironment({
    type: "array",
    names: ["equation", "equation*"],
    props: {
        numArgs: 0,
    },
    handler(context) {
        validateAmsEnvironmentContext(context);
        const res: Parameters<typeof parseArray>[1] = {
            autoTag: getAutoTag(context.envName),
            emptySingleRow: true,
            singleRow: true,
            maxNumCols: 1,
            leqno: context.parser.settings.leqno,
        };
        return parseArray(context.parser, res, "display");
    },
    htmlBuilder,
    mathmlBuilder,
});

defineEnvironment({
    type: "array",
    names: ["CD"],
    props: {
        numArgs: 0,
    },
    handler(context) {
        validateAmsEnvironmentContext(context);
        return parseCD(context.parser);
    },
    htmlBuilder,
    mathmlBuilder,
});

defineMacro("\\nonumber", "\\gdef\\@eqnsw{0}");
defineMacro("\\notag", "\\nonumber");

// Catch \hline outside array environment
defineFunction({
    type: "text", // Doesn't matter what this is.
    names: ["\\hline", "\\hdashline"],
    props: {
        numArgs: 0,
        allowedInText: true,
        allowedInMath: true,
    },
    handler(context, args) {
        throw new ParseError(
            `${context.funcName} valid only within array environment`);
    },
});
x.import {wrapFragment} from "../buildCommon";
import defineFunction from "../defineFunction";
import {MathNode} from "../mathMLTree";
import * as html from "../buildHTML";
import * as mml from "../buildMathML";
import {assertSymbolNodeType} from "../parseNode";
import ParseError from "../ParseError";
import {makeEm} from "../units";

import type Parser from "../Parser";
import type {ParseNode, AnyParseNode} from "../parseNode";

const cdArrowFunctionName: Record<string, string> = {
    ">": "\\\\cdrightarrow",
    "<": "\\\\cdleftarrow",
    "=": "\\\\cdlongequal",
    "A": "\\uparrow",
    "V": "\\downarrow",
    "|": "\\Vert",
    ".": "no arrow",
};

const newCell = (): ParseNode<"styling"> => {
    // Create an empty cell, to be filled below with parse nodes.
    // The parseTree from this module must be constructed like the
    // one created by parseArray(), so an empty CD cell must
    // be a ParseNode<"styling">. And CD is always displaystyle.
    return {
        type: "styling",
        body: [],
        mode: "math",
        style: "display",
        resetFont: true,
    };
};

const isStartOfArrow = (node: AnyParseNode) => {
    return (node.type === "textord" && node.text === "@");
};

const isLabelEnd = (node: AnyParseNode, endChar: string): boolean => {
    return ((node.type === "mathord" || node.type === "atom") &&
        node.text === endChar);
};

function cdArrow(
    arrowChar: string,
    labels: ParseNode<"ordgroup">[],
    parser: Parser
): AnyParseNode {
    // Return a parse tree of an arrow and its labels.
    // This acts in a way similar to a macro expansion.
    const funcName = cdArrowFunctionName[arrowChar];
    switch (funcName) {
        case "\\\\cdrightarrow":
        case "\\\\cdleftarrow":
            return parser.callFunction(
                funcName, [labels[0]], [labels[1]]
            );
        case "\\uparrow":
        case "\\downarrow": {
            const leftLabel = parser.callFunction(
                "\\\\cdleft", [labels[0]], []
            );
            const bareArrow: ParseNode<"atom"> = {
                type: "atom",
                text: funcName,
                mode: "math",
                family: "rel",
            };
            const sizedArrow = parser.callFunction("\\Big", [bareArrow], []);
            const rightLabel = parser.callFunction(
                "\\\\cdright", [labels[1]], []
            );
            const arrowGroup: ParseNode<"ordgroup"> = {
                type: "ordgroup",
                mode: "math",
                body: [leftLabel, sizedArrow, rightLabel],
            };
            return parser.callFunction("\\\\cdparent", [arrowGroup], []);
        }
        case "\\\\cdlongequal":
            return parser.callFunction("\\\\cdlongequal", [], []);
        case "\\Vert": {
            const arrow: ParseNode<"textord"> = {type: "textord", text: "\\Vert", mode: "math"};
            return parser.callFunction("\\Big", [arrow], []);
        }
        default:
            return {type: "textord", text: " ", mode: "math"};
    }
}

export function parseCD(parser: Parser): ParseNode<"array"> {
    // Get the array's parse nodes with \\ temporarily mapped to \cr.
    const parsedRows: AnyParseNode[][] = [];
    parser.gullet.beginGroup();
    parser.gullet.macros.set("\\cr", "\\\\\\relax");
    parser.gullet.beginGroup();
    while (true) {
        // Get the parse nodes for the next row.
        parsedRows.push(parser.parseExpression(false, "\\\\"));
        parser.gullet.endGroup();
        parser.gullet.beginGroup();
        const next = parser.fetch().text;
        if (next === "&" || next === "\\\\") {
            parser.consume();
        } else if (next === "\\end") {
            if (parsedRows[parsedRows.length - 1].length === 0) {
                parsedRows.pop(); // final row ended in \\
            }
            break;
        } else {
            throw new ParseError("Expected \\\\ or \\cr or \\end",
                                 parser.nextToken);
        }
    }

    let row: ParseNode<"styling">[] = [];
    const body: ParseNode<"styling">[][] = [row];

    // Loop thru the parse nodes. Collect them into cells and arrows.
    for (let i = 0; i < parsedRows.length; i++) {
        // Start a new row.
        const rowNodes = parsedRows[i];
        // Create the first cell.
        let cell = newCell();

        for (let j = 0; j < rowNodes.length; j++) {
            if (!isStartOfArrow(rowNodes[j])) {
                // If a parseNode is not an arrow, it goes into a cell.
                cell.body.push(rowNodes[j]);
            } else {
                // Parse node j is an "@", the start of an arrow.
                // Before starting on the arrow, push the cell into `row`.
                row.push(cell);

                // Now collect parseNodes into an arrow.
                // The character after "@" defines the arrow type.
                j += 1;
                const arrowChar = assertSymbolNodeType(rowNodes[j]).text;

                // Create two empty label nodes. We may or may not use them.
                const labels: ParseNode<"ordgroup">[] = new Array(2);
                labels[0] = {type: "ordgroup", mode: "math", body: []};
                labels[1] = {type: "ordgroup", mode: "math", body: []};

                // Process the arrow.
                if ("=|.".includes(arrowChar)) {
                    // Three "arrows", ``@=`, `@|`, and `@.`, do not take labels.
                    // Do nothing here.
                } else if ("<>AV".includes(arrowChar)) {
                    // Four arrows, `@>>>`, `@<<<`, `@AAA`, and `@VVV`, each take
                    // two optional labels. E.g. the right-point arrow syntax is
                    // really:  @>{optional label}>{optional label}>
                    // Collect parseNodes into labels.
                    for (let labelNum = 0; labelNum < 2; labelNum++) {
                        let inLabel = true;
                        for (let k = j + 1; k < rowNodes.length; k++) {
                            if (isLabelEnd(rowNodes[k], arrowChar)) {
                                inLabel = false;
                                j = k;
                                break;
                            }
                            if (isStartOfArrow(rowNodes[k])) {
                                throw new ParseError("Missing a " + arrowChar +
                                " character to complete a CD arrow.", rowNodes[k]);
                            }

                            labels[labelNum].body.push(rowNodes[k]);
                        }
                        if (inLabel) {
                            // isLabelEnd never returned a true.
                            throw new ParseError("Missing a " + arrowChar +
                                " character to complete a CD arrow.", rowNodes[j]);
                        }
                    }
                } else {
                    throw new ParseError(`Expected one of "<>AV=|." after @`,
                        rowNodes[j]);
                }

                // Now join the arrow to its labels.
                const arrow: AnyParseNode = cdArrow(arrowChar, labels, parser);

                // Wrap the arrow in  ParseNode<"styling">.
                // This is done to match parseArray() behavior.
                const wrappedArrow: ParseNode<"styling"> = {
                    type: "styling",
                    body: [arrow],
                    mode: "math",
                    style: "display", // CD is always displaystyle.
                    resetFont: true,
                };
                row.push(wrappedArrow);
                // In CD's syntax, cells are implicit. That is, everything that
                // is not an arrow gets collected into a cell. So create an empty
                // cell now. It will collect upcoming parseNodes.
                cell = newCell();
            }
        }
        if (i % 2 === 0) {
            // Even-numbered rows consist of: cell, arrow, cell, arrow, ... cell
            // The last cell is not yet pushed into `row`, so:
            row.push(cell);
        } else {
            // Odd-numbered rows consist of: vert arrow, empty cell, ... vert arrow
            // Remove the empty cell that was placed at the beginning of `row`.
            row.shift();
        }
        row = [];
        body.push(row);
    }

    // End row group
    parser.gullet.endGroup();
    // End array group defining \\
    parser.gullet.endGroup();

    // define column separation.
    const cols = new Array(body[0].length).fill({
        type: "align",
        align: "c",
        pregap: 0.25,  // CD package sets \enskip between columns.
        postgap: 0.25, // So pre and post each get half an \enskip, i.e. 0.25em.
    });

    return {
        type: "array",
        mode: "math",
        body,
        arraystretch: 1,
        addJot: true,
        rowGaps: [null],
        cols,
        colSeparationType: "CD",
        hLinesBeforeRow: new Array(body.length + 1).fill([]),
    };
}

// The functions below are not available for general use.
// They are here only for internal use by the {CD} environment in placing labels
// next to vertical arrows.

// We don't need any such functions for horizontal arrows because we can reuse
// the functionality that already exists for extensible arrows.

defineFunction({
    type: "cdlabel",
    names: ["\\\\cdleft", "\\\\cdright"],
    props: {
        numArgs: 1,
    },
    handler({parser, funcName}, args) {
        return {
            type: "cdlabel",
            mode: parser.mode,
            side: funcName.slice(4),
            label: args[0],
        };
    },
    htmlBuilder(group, options) {
        const newOptions = options.havingStyle(options.style.sup());
        const label = wrapFragment(
            html.buildGroup(group.label, newOptions, options), options);
        label.classes.push("cd-label-" + group.side);
        label.style.bottom = makeEm(0.8 - label.depth);
        // Zero out label height & depth, so vertical align of arrow is set
        // by the arrow height, not by the label.
        label.height = 0;
        label.depth = 0;
        return label;
    },
    mathmlBuilder(group, options) {
        let label = new MathNode("mrow",
            [mml.buildGroup(group.label, options)]);
        label = new MathNode("mpadded", [label]);
        label.setAttribute("width", "0");
        if (group.side === "left") {
            label.setAttribute("lspace", "-1width");
        }
        // We have to guess at vertical alignment. We know the arrow is 1.8em tall,
        // But we don't know the height or depth of the label.
        label.setAttribute("voffset", "0.7em");
        label = new MathNode("mstyle", [label]);
        label.setAttribute("displaystyle", "false");
        label.setAttribute("scriptlevel", "1");
        return label;
    },
});

defineFunction({
    type: "cdlabelparent",
    names: ["\\\\cdparent"],
    props: {
        numArgs: 1,
    },
    handler({parser}, args) {
        return {
            type: "cdlabelparent",
            mode: parser.mode,
            fragment: args[0],
        };
    },
    htmlBuilder(group, options) {
        // Wrap the vertical arrow and its labels.
        // The parent gets position: relative. The child gets position: absolute.
        // So CSS can locate the label correctly.
        const parent = wrapFragment(
            html.buildGroup(group.fragment, options), options
        );
        parent.classes.push("cd-vert-arrow");
        return parent;
    },
    mathmlBuilder(group, options) {
        return new MathNode("mrow",
            [mml.buildGroup(group.fragment, options)]);
    },
});
Ux"*import {supportedCodepoint} from "./unicodeScripts";

import type {Mode} from "./types";
import type {CharacterMetrics, CharacterMetricsTuple, FontMetrics} from "./types/fonts";
// This map contains a mapping from font name and character code to character
// metrics, including height, depth, italic correction, and skew (kern from the
// character to the corresponding \skewchar)
// This map is generated via `make metrics`. It should not be changed manually.
import metricMap from "./fontMetricsData";

/**
 * This file contains metrics regarding fonts and individual symbols. The sigma
 * and xi variables, as well as the metricMap map contain data extracted from
 * TeX, TeX font metrics, and the TTF files. These data are then exposed via the
 * `metrics` variable and the getCharacterMetrics function.
 */

// In TeX, there are actually three sets of dimensions, one for each of
// textstyle (size index 5 and higher: >=9pt), scriptstyle (size index 3 and 4:
// 7-8pt), and scriptscriptstyle (size index 1 and 2: 5-6pt).  These are
// provided in the arrays below, in that order.
//
// The font metrics are stored in fonts cmsy10, cmsy7, and cmsy5 respectively.
// This was determined by running the following script:
//
//     latex -interaction=nonstopmode \
//     '\documentclass{article}\usepackage{amsmath}\begin{document}' \
//     '$a$ \expandafter\show\the\textfont2' \
//     '\expandafter\show\the\scriptfont2' \
//     '\expandafter\show\the\scriptscriptfont2' \
//     '\stop'
//
// The metrics themselves were retrieved using the following commands:
//
//     tftopl cmsy10
//     tftopl cmsy7
//     tftopl cmsy5
//
// The output of each of these commands is quite lengthy.  The only part we
// care about is the FONTDIMEN section. Each value is measured in EMs.
const sigmasAndXis: Record<string, [number, number, number]> = {
    slant: [0.250, 0.250, 0.250],       // sigma1
    space: [0.000, 0.000, 0.000],       // sigma2
    stretch: [0.000, 0.000, 0.000],     // sigma3
    shrink: [0.000, 0.000, 0.000],      // sigma4
    xHeight: [0.431, 0.431, 0.431],     // sigma5
    quad: [1.000, 1.171, 1.472],        // sigma6
    extraSpace: [0.000, 0.000, 0.000],  // sigma7
    num1: [0.677, 0.732, 0.925],        // sigma8
    num2: [0.394, 0.384, 0.387],        // sigma9
    num3: [0.444, 0.471, 0.504],        // sigma10
    denom1: [0.686, 0.752, 1.025],      // sigma11
    denom2: [0.345, 0.344, 0.532],      // sigma12
    sup1: [0.413, 0.503, 0.504],        // sigma13
    sup2: [0.363, 0.431, 0.404],        // sigma14
    sup3: [0.289, 0.286, 0.294],        // sigma15
    sub1: [0.150, 0.143, 0.200],        // sigma16
    sub2: [0.247, 0.286, 0.400],        // sigma17
    supDrop: [0.386, 0.353, 0.494],     // sigma18
    subDrop: [0.050, 0.071, 0.100],     // sigma19
    delim1: [2.390, 1.700, 1.980],      // sigma20
    delim2: [1.010, 1.157, 1.420],      // sigma21
    axisHeight: [0.250, 0.250, 0.250],  // sigma22

    // These font metrics are extracted from TeX by using tftopl on cmex10.tfm;
    // they correspond to the font parameters of the extension fonts (family 3).
    // See the TeXbook, page 441. In AMSTeX, the extension fonts scale; to
    // match cmex7, we'd use cmex7.tfm values for script and scriptscript
    // values.
    defaultRuleThickness: [0.04, 0.049, 0.049], // xi8; cmex7: 0.049
    bigOpSpacing1: [0.111, 0.111, 0.111],       // xi9
    bigOpSpacing2: [0.166, 0.166, 0.166],       // xi10
    bigOpSpacing3: [0.2, 0.2, 0.2],             // xi11
    bigOpSpacing4: [0.6, 0.611, 0.611],         // xi12; cmex7: 0.611
    bigOpSpacing5: [0.1, 0.143, 0.143],         // xi13; cmex7: 0.143

    // The \sqrt rule width is taken from the height of the surd character.
    // Since we use the same font at all sizes, this thickness doesn't scale.
    sqrtRuleThickness: [0.04, 0.04, 0.04],

    // This value determines how large a pt is, for metrics which are defined
    // in terms of pts.
    // This value is also used in katex.scss; if you change it make sure the
    // values match.
    ptPerEm: [10.0, 10.0, 10.0],

    // The space between adjacent `|` columns in an array definition. From
    // `\showthe\doublerulesep` in LaTeX. Equals 2.0 / ptPerEm.
    doubleRuleSep: [0.2, 0.2, 0.2],

    // The width of separator lines in {array} environments. From
    // `\showthe\arrayrulewidth` in LaTeX. Equals 0.4 / ptPerEm.
    arrayRuleWidth: [0.04, 0.04, 0.04],

    // Two values from LaTeX source2e:
    fboxsep: [0.3, 0.3, 0.3], //        3 pt / ptPerEm
    fboxrule: [0.04, 0.04, 0.04], // 0.4 pt / ptPerEm
};

// These are very rough approximations.  We default to Times New Roman which
// should have Latin-1 and Cyrillic characters, but may not depending on the
// operating system.  The metrics do not account for extra height from the
// accents.  In the case of Cyrillic characters which have both ascenders and
// descenders we prefer approximations with ascenders, primarily to prevent
// the fraction bar or root line from intersecting the glyph.
// TODO(kevinb) allow union of multiple glyph metrics for better accuracy.
const extraCharacterMap: Record<string, string> = {
    // Latin-1
    'Å': 'A',
    'Ð': 'D',
    'Þ': 'o',
    'å': 'a',
    'ð': 'd',
    'þ': 'o',

    // Cyrillic
    'А': 'A',
    'Б': 'B',
    'В': 'B',
    'Г': 'F',
    'Д': 'A',
    'Е': 'E',
    'Ж': 'K',
    'З': '3',
    'И': 'N',
    'Й': 'N',
    'К': 'K',
    'Л': 'N',
    'М': 'M',
    'Н': 'H',
    'О': 'O',
    'П': 'N',
    'Р': 'P',
    'С': 'C',
    'Т': 'T',
    'У': 'y',
    'Ф': 'O',
    'Х': 'X',
    'Ц': 'U',
    'Ч': 'h',
    'Ш': 'W',
    'Щ': 'W',
    'Ъ': 'B',
    'Ы': 'X',
    'Ь': 'B',
    'Э': '3',
    'Ю': 'X',
    'Я': 'R',
    'а': 'a',
    'б': 'b',
    'в': 'a',
    'г': 'r',
    'д': 'y',
    'е': 'e',
    'ж': 'm',
    'з': 'e',
    'и': 'n',
    'й': 'n',
    'к': 'n',
    'л': 'n',
    'м': 'm',
    'н': 'n',
    'о': 'o',
    'п': 'n',
    'р': 'p',
    'с': 'c',
    'т': 'o',
    'у': 'y',
    'ф': 'b',
    'х': 'x',
    'ц': 'n',
    'ч': 'n',
    'ш': 'w',
    'щ': 'w',
    'ъ': 'a',
    'ы': 'm',
    'ь': 'a',
    'э': 'e',
    'ю': 'm',
    'я': 'r',
};

/**
 * This function adds new font metrics to default metricMap
 * It can also override existing metrics
 */
export function setFontMetrics(
    fontName: string,
    metrics: {[key: string]: CharacterMetricsTuple}
) {
    metricMap[fontName] = metrics;
}

/**
 * This function is a convenience function for looking up information in the
 * metricMap table. It takes a character as a string, and a font.
 *
 * Note: the `width` property may be undefined if fontMetricsData.js wasn't
 * built using `Make extended_metrics`.
 */
export function getCharacterMetrics(
    character: string,
    font: string,
    mode: Mode,
): CharacterMetrics | null | undefined {
    if (!metricMap[font]) {
        throw new Error(`Font metrics not found for font: ${font}.`);
    }
    let ch = character.charCodeAt(0);
    let metrics = metricMap[font][ch];
    if (!metrics && character[0] in extraCharacterMap) {
        ch = extraCharacterMap[character[0]].charCodeAt(0);
        metrics = metricMap[font][ch];
    }

    if (!metrics && mode === 'text') {
        // We don't typically have font metrics for Asian scripts.
        // But since we support them in text mode, we need to return
        // some sort of metrics.
        // So if the character is in a script we support but we
        // don't have metrics for it, just use the metrics for
        // the Latin capital letter M. This is close enough because
        // we (currently) only care about the height of the glyph
        // not its width.
        if (supportedCodepoint(ch)) {
            metrics = metricMap[font][77]; // 77 is the charcode for 'M'
        }
    }

    if (metrics) {
        return {
            depth: metrics[0],
            height: metrics[1],
            italic: metrics[2],
            skew: metrics[3],
            width: metrics[4],
        };
    }
}

type FontSizeIndex = 0 | 1 | 2;
const fontMetricsBySizeIndex: Partial<Record<FontSizeIndex, FontMetrics>> = {};

/**
 * Get the font metrics for a given size.
 */
export function getGlobalMetrics(size: number): FontMetrics {
    let sizeIndex: FontSizeIndex;
    if (size >= 5) {
        sizeIndex = 0;
    } else if (size >= 3) {
        sizeIndex = 1;
    } else {
        sizeIndex = 2;
    }
    if (!fontMetricsBySizeIndex[sizeIndex]) {
        const metrics: FontMetrics = fontMetricsBySizeIndex[sizeIndex] = {
            cssEmPerMu: sigmasAndXis.quad[sizeIndex] / 18,
        };
        for (const key in sigmasAndXis) {
            if (sigmasAndXis.hasOwnProperty(key)) {
                metrics[key] = sigmasAndXis[key][sizeIndex];
            }
        }
    }
    return fontMetricsBySizeIndex[sizeIndex]!;
}
Vximport type {CharacterMetricsTuple, FontName} from "./types/fonts";

type FontMetrics = Record<number, CharacterMetricsTuple>;

declare const fontMetricsData: Record<FontName, FontMetrics> &
    Record<string, FontMetrics>;

export default fontMetricsData;
4[.x   // This file is GENERATED by buildMetrics.sh. DO NOT MODIFY.
export default {
    "AMS-Regular": {
        "32": [0, 0, 0, 0, 0.25],
        "65": [0, 0.68889, 0, 0, 0.72222],
        "66": [0, 0.68889, 0, 0, 0.66667],
        "67": [0, 0.68889, 0, 0, 0.72222],
        "68": [0, 0.68889, 0, 0, 0.72222],
        "69": [0, 0.68889, 0, 0, 0.66667],
        "70": [0, 0.68889, 0, 0, 0.61111],
        "71": [0, 0.68889, 0, 0, 0.77778],
        "72": [0, 0.68889, 0, 0, 0.77778],
        "73": [0, 0.68889, 0, 0, 0.38889],
        "74": [0.16667, 0.68889, 0, 0, 0.5],
        "75": [0, 0.68889, 0, 0, 0.77778],
        "76": [0, 0.68889, 0, 0, 0.66667],
        "77": [0, 0.68889, 0, 0, 0.94445],
        "78": [0, 0.68889, 0, 0, 0.72222],
        "79": [0.16667, 0.68889, 0, 0, 0.77778],
        "80": [0, 0.68889, 0, 0, 0.61111],
        "81": [0.16667, 0.68889, 0, 0, 0.77778],
        "82": [0, 0.68889, 0, 0, 0.72222],
        "83": [0, 0.68889, 0, 0, 0.55556],
        "84": [0, 0.68889, 0, 0, 0.66667],
        "85": [0, 0.68889, 0, 0, 0.72222],
        "86": [0, 0.68889, 0, 0, 0.72222],
        "87": [0, 0.68889, 0, 0, 1.0],
        "88": [0, 0.68889, 0, 0, 0.72222],
        "89": [0, 0.68889, 0, 0, 0.72222],
        "90": [0, 0.68889, 0, 0, 0.66667],
        "107": [0, 0.68889, 0, 0, 0.55556],
        "160": [0, 0, 0, 0, 0.25],
        "165": [0, 0.675, 0.025, 0, 0.75],
        "174": [0.15559, 0.69224, 0, 0, 0.94666],
        "240": [0, 0.68889, 0, 0, 0.55556],
        "295": [0, 0.68889, 0, 0, 0.54028],
        "710": [0, 0.825, 0, 0, 2.33334],
        "732": [0, 0.9, 0, 0, 2.33334],
        "770": [0, 0.825, 0, 0, 2.33334],
        "771": [0, 0.9, 0, 0, 2.33334],
        "989": [0.08167, 0.58167, 0, 0, 0.77778],
        "1008": [0, 0.43056, 0.04028, 0, 0.66667],
        "8245": [0, 0.54986, 0, 0, 0.275],
        "8463": [0, 0.68889, 0, 0, 0.54028],
        "8487": [0, 0.68889, 0, 0, 0.72222],
        "8498": [0, 0.68889, 0, 0, 0.55556],
        "8502": [0, 0.68889, 0, 0, 0.66667],
        "8503": [0, 0.68889, 0, 0, 0.44445],
        "8504": [0, 0.68889, 0, 0, 0.66667],
        "8513": [0, 0.68889, 0, 0, 0.63889],
        "8592": [-0.03598, 0.46402, 0, 0, 0.5],
        "8594": [-0.03598, 0.46402, 0, 0, 0.5],
        "8602": [-0.13313, 0.36687, 0, 0, 1.0],
        "8603": [-0.13313, 0.36687, 0, 0, 1.0],
        "8606": [0.01354, 0.52239, 0, 0, 1.0],
        "8608": [0.01354, 0.52239, 0, 0, 1.0],
        "8610": [0.01354, 0.52239, 0, 0, 1.11111],
        "8611": [0.01354, 0.52239, 0, 0, 1.11111],
        "8619": [0, 0.54986, 0, 0, 1.0],
        "8620": [0, 0.54986, 0, 0, 1.0],
        "8621": [-0.13313, 0.37788, 0, 0, 1.38889],
        "8622": [-0.13313, 0.36687, 0, 0, 1.0],
        "8624": [0, 0.69224, 0, 0, 0.5],
        "8625": [0, 0.69224, 0, 0, 0.5],
        "8630": [0, 0.43056, 0, 0, 1.0],
        "8631": [0, 0.43056, 0, 0, 1.0],
        "8634": [0.08198, 0.58198, 0, 0, 0.77778],
        "8635": [0.08198, 0.58198, 0, 0, 0.77778],
        "8638": [0.19444, 0.69224, 0, 0, 0.41667],
        "8639": [0.19444, 0.69224, 0, 0, 0.41667],
        "8642": [0.19444, 0.69224, 0, 0, 0.41667],
        "8643": [0.19444, 0.69224, 0, 0, 0.41667],
        "8644": [0.1808, 0.675, 0, 0, 1.0],
        "8646": [0.1808, 0.675, 0, 0, 1.0],
        "8647": [0.1808, 0.675, 0, 0, 1.0],
        "8648": [0.19444, 0.69224, 0, 0, 0.83334],
        "8649": [0.1808, 0.675, 0, 0, 1.0],
        "8650": [0.19444, 0.69224, 0, 0, 0.83334],
        "8651": [0.01354, 0.52239, 0, 0, 1.0],
        "8652": [0.01354, 0.52239, 0, 0, 1.0],
        "8653": [-0.13313, 0.36687, 0, 0, 1.0],
        "8654": [-0.13313, 0.36687, 0, 0, 1.0],
        "8655": [-0.13313, 0.36687, 0, 0, 1.0],
        "8666": [0.13667, 0.63667, 0, 0, 1.0],
        "8667": [0.13667, 0.63667, 0, 0, 1.0],
        "8669": [-0.13313, 0.37788, 0, 0, 1.0],
        "8672": [-0.064, 0.437, 0, 0, 1.334],
        "8674": [-0.064, 0.437, 0, 0, 1.334],
        "8705": [0, 0.825, 0, 0, 0.5],
        "8708": [0, 0.68889, 0, 0, 0.55556],
        "8709": [0.08167, 0.58167, 0, 0, 0.77778],
        "8717": [0, 0.43056, 0, 0, 0.42917],
        "8722": [-0.03598, 0.46402, 0, 0, 0.5],
        "8724": [0.08198, 0.69224, 0, 0, 0.77778],
        "8726": [0.08167, 0.58167, 0, 0, 0.77778],
        "8733": [0, 0.69224, 0, 0, 0.77778],
        "8736": [0, 0.69224, 0, 0, 0.72222],
        "8737": [0, 0.69224, 0, 0, 0.72222],
        "8738": [0.03517, 0.52239, 0, 0, 0.72222],
        "8739": [0.08167, 0.58167, 0, 0, 0.22222],
        "8740": [0.25142, 0.74111, 0, 0, 0.27778],
        "8741": [0.08167, 0.58167, 0, 0, 0.38889],
        "8742": [0.25142, 0.74111, 0, 0, 0.5],
        "8756": [0, 0.69224, 0, 0, 0.66667],
        "8757": [0, 0.69224, 0, 0, 0.66667],
        "8764": [-0.13313, 0.36687, 0, 0, 0.77778],
        "8765": [-0.13313, 0.37788, 0, 0, 0.77778],
        "8769": [-0.13313, 0.36687, 0, 0, 0.77778],
        "8770": [-0.03625, 0.46375, 0, 0, 0.77778],
        "8774": [0.30274, 0.79383, 0, 0, 0.77778],
        "8776": [-0.01688, 0.48312, 0, 0, 0.77778],
        "8778": [0.08167, 0.58167, 0, 0, 0.77778],
        "8782": [0.06062, 0.54986, 0, 0, 0.77778],
        "8783": [0.06062, 0.54986, 0, 0, 0.77778],
        "8785": [0.08198, 0.58198, 0, 0, 0.77778],
        "8786": [0.08198, 0.58198, 0, 0, 0.77778],
        "8787": [0.08198, 0.58198, 0, 0, 0.77778],
        "8790": [0, 0.69224, 0, 0, 0.77778],
        "8791": [0.22958, 0.72958, 0, 0, 0.77778],
        "8796": [0.08198, 0.91667, 0, 0, 0.77778],
        "8806": [0.25583, 0.75583, 0, 0, 0.77778],
        "8807": [0.25583, 0.75583, 0, 0, 0.77778],
        "8808": [0.25142, 0.75726, 0, 0, 0.77778],
        "8809": [0.25142, 0.75726, 0, 0, 0.77778],
        "8812": [0.25583, 0.75583, 0, 0, 0.5],
        "8814": [0.20576, 0.70576, 0, 0, 0.77778],
        "8815": [0.20576, 0.70576, 0, 0, 0.77778],
        "8816": [0.30274, 0.79383, 0, 0, 0.77778],
        "8817": [0.30274, 0.79383, 0, 0, 0.77778],
        "8818": [0.22958, 0.72958, 0, 0, 0.77778],
        "8819": [0.22958, 0.72958, 0, 0, 0.77778],
        "8822": [0.1808, 0.675, 0, 0, 0.77778],
        "8823": [0.1808, 0.675, 0, 0, 0.77778],
        "8828": [0.13667, 0.63667, 0, 0, 0.77778],
        "8829": [0.13667, 0.63667, 0, 0, 0.77778],
        "8830": [0.22958, 0.72958, 0, 0, 0.77778],
        "8831": [0.22958, 0.72958, 0, 0, 0.77778],
        "8832": [0.20576, 0.70576, 0, 0, 0.77778],
        "8833": [0.20576, 0.70576, 0, 0, 0.77778],
        "8840": [0.30274, 0.79383, 0, 0, 0.77778],
        "8841": [0.30274, 0.79383, 0, 0, 0.77778],
        "8842": [0.13597, 0.63597, 0, 0, 0.77778],
        "8843": [0.13597, 0.63597, 0, 0, 0.77778],
        "8847": [0.03517, 0.54986, 0, 0, 0.77778],
        "8848": [0.03517, 0.54986, 0, 0, 0.77778],
        "8858": [0.08198, 0.58198, 0, 0, 0.77778],
        "8859": [0.08198, 0.58198, 0, 0, 0.77778],
        "8861": [0.08198, 0.58198, 0, 0, 0.77778],
        "8862": [0, 0.675, 0, 0, 0.77778],
        "8863": [0, 0.675, 0, 0, 0.77778],
        "8864": [0, 0.675, 0, 0, 0.77778],
        "8865": [0, 0.675, 0, 0, 0.77778],
        "8872": [0, 0.69224, 0, 0, 0.61111],
        "8873": [0, 0.69224, 0, 0, 0.72222],
        "8874": [0, 0.69224, 0, 0, 0.88889],
        "8876": [0, 0.68889, 0, 0, 0.61111],
        "8877": [0, 0.68889, 0, 0, 0.61111],
        "8878": [0, 0.68889, 0, 0, 0.72222],
        "8879": [0, 0.68889, 0, 0, 0.72222],
        "8882": [0.03517, 0.54986, 0, 0, 0.77778],
        "8883": [0.03517, 0.54986, 0, 0, 0.77778],
        "8884": [0.13667, 0.63667, 0, 0, 0.77778],
        "8885": [0.13667, 0.63667, 0, 0, 0.77778],
        "8888": [0, 0.54986, 0, 0, 1.11111],
        "8890": [0.19444, 0.43056, 0, 0, 0.55556],
        "8891": [0.19444, 0.69224, 0, 0, 0.61111],
        "8892": [0.19444, 0.69224, 0, 0, 0.61111],
        "8901": [0, 0.54986, 0, 0, 0.27778],
        "8903": [0.08167, 0.58167, 0, 0, 0.77778],
        "8905": [0.08167, 0.58167, 0, 0, 0.77778],
        "8906": [0.08167, 0.58167, 0, 0, 0.77778],
        "8907": [0, 0.69224, 0, 0, 0.77778],
        "8908": [0, 0.69224, 0, 0, 0.77778],
        "8909": [-0.03598, 0.46402, 0, 0, 0.77778],
        "8910": [0, 0.54986, 0, 0, 0.76042],
        "8911": [0, 0.54986, 0, 0, 0.76042],
        "8912": [0.03517, 0.54986, 0, 0, 0.77778],
        "8913": [0.03517, 0.54986, 0, 0, 0.77778],
        "8914": [0, 0.54986, 0, 0, 0.66667],
        "8915": [0, 0.54986, 0, 0, 0.66667],
        "8916": [0, 0.69224, 0, 0, 0.66667],
        "8918": [0.0391, 0.5391, 0, 0, 0.77778],
        "8919": [0.0391, 0.5391, 0, 0, 0.77778],
        "8920": [0.03517, 0.54986, 0, 0, 1.33334],
        "8921": [0.03517, 0.54986, 0, 0, 1.33334],
        "8922": [0.38569, 0.88569, 0, 0, 0.77778],
        "8923": [0.38569, 0.88569, 0, 0, 0.77778],
        "8926": [0.13667, 0.63667, 0, 0, 0.77778],
        "8927": [0.13667, 0.63667, 0, 0, 0.77778],
        "8928": [0.30274, 0.79383, 0, 0, 0.77778],
        "8929": [0.30274, 0.79383, 0, 0, 0.77778],
        "8934": [0.23222, 0.74111, 0, 0, 0.77778],
        "8935": [0.23222, 0.74111, 0, 0, 0.77778],
        "8936": [0.23222, 0.74111, 0, 0, 0.77778],
        "8937": [0.23222, 0.74111, 0, 0, 0.77778],
        "8938": [0.20576, 0.70576, 0, 0, 0.77778],
        "8939": [0.20576, 0.70576, 0, 0, 0.77778],
        "8940": [0.30274, 0.79383, 0, 0, 0.77778],
        "8941": [0.30274, 0.79383, 0, 0, 0.77778],
        "8994": [0.19444, 0.69224, 0, 0, 0.77778],
        "8995": [0.19444, 0.69224, 0, 0, 0.77778],
        "9416": [0.15559, 0.69224, 0, 0, 0.90222],
        "9484": [0, 0.69224, 0, 0, 0.5],
        "9488": [0, 0.69224, 0, 0, 0.5],
        "9492": [0, 0.37788, 0, 0, 0.5],
        "9496": [0, 0.37788, 0, 0, 0.5],
        "9585": [0.19444, 0.68889, 0, 0, 0.88889],
        "9586": [0.19444, 0.74111, 0, 0, 0.88889],
        "9632": [0, 0.675, 0, 0, 0.77778],
        "9633": [0, 0.675, 0, 0, 0.77778],
        "9650": [0, 0.54986, 0, 0, 0.72222],
        "9651": [0, 0.54986, 0, 0, 0.72222],
        "9654": [0.03517, 0.54986, 0, 0, 0.77778],
        "9660": [0, 0.54986, 0, 0, 0.72222],
        "9661": [0, 0.54986, 0, 0, 0.72222],
        "9664": [0.03517, 0.54986, 0, 0, 0.77778],
        "9674": [0.11111, 0.69224, 0, 0, 0.66667],
        "9733": [0.19444, 0.69224, 0, 0, 0.94445],
        "10003": [0, 0.69224, 0, 0, 0.83334],
        "10016": [0, 0.69224, 0, 0, 0.83334],
        "10731": [0.11111, 0.69224, 0, 0, 0.66667],
        "10846": [0.19444, 0.75583, 0, 0, 0.61111],
        "10877": [0.13667, 0.63667, 0, 0, 0.77778],
        "10878": [0.13667, 0.63667, 0, 0, 0.77778],
        "10885": [0.25583, 0.75583, 0, 0, 0.77778],
        "10886": [0.25583, 0.75583, 0, 0, 0.77778],
        "10887": [0.13597, 0.63597, 0, 0, 0.77778],
        "10888": [0.13597, 0.63597, 0, 0, 0.77778],
        "10889": [0.26167, 0.75726, 0, 0, 0.77778],
        "10890": [0.26167, 0.75726, 0, 0, 0.77778],
        "10891": [0.48256, 0.98256, 0, 0, 0.77778],
        "10892": [0.48256, 0.98256, 0, 0, 0.77778],
        "10901": [0.13667, 0.63667, 0, 0, 0.77778],
        "10902": [0.13667, 0.63667, 0, 0, 0.77778],
        "10933": [0.25142, 0.75726, 0, 0, 0.77778],
        "10934": [0.25142, 0.75726, 0, 0, 0.77778],
        "10935": [0.26167, 0.75726, 0, 0, 0.77778],
        "10936": [0.26167, 0.75726, 0, 0, 0.77778],
        "10937": [0.26167, 0.75726, 0, 0, 0.77778],
        "10938": [0.26167, 0.75726, 0, 0, 0.77778],
        "10949": [0.25583, 0.75583, 0, 0, 0.77778],
        "10950": [0.25583, 0.75583, 0, 0, 0.77778],
        "10955": [0.28481, 0.79383, 0, 0, 0.77778],
        "10956": [0.28481, 0.79383, 0, 0, 0.77778],
        "57350": [0.08167, 0.58167, 0, 0, 0.22222],
        "57351": [0.08167, 0.58167, 0, 0, 0.38889],
        "57352": [0.08167, 0.58167, 0, 0, 0.77778],
        "57353": [0, 0.43056, 0.04028, 0, 0.66667],
        "57356": [0.25142, 0.75726, 0, 0, 0.77778],
        "57357": [0.25142, 0.75726, 0, 0, 0.77778],
        "57358": [0.41951, 0.91951, 0, 0, 0.77778],
        "57359": [0.30274, 0.79383, 0, 0, 0.77778],
        "57360": [0.30274, 0.79383, 0, 0, 0.77778],
        "57361": [0.41951, 0.91951, 0, 0, 0.77778],
        "57366": [0.25142, 0.75726, 0, 0, 0.77778],
        "57367": [0.25142, 0.75726, 0, 0, 0.77778],
        "57368": [0.25142, 0.75726, 0, 0, 0.77778],
        "57369": [0.25142, 0.75726, 0, 0, 0.77778],
        "57370": [0.13597, 0.63597, 0, 0, 0.77778],
        "57371": [0.13597, 0.63597, 0, 0, 0.77778],
    },
    "Caligraphic-Regular": {
        "32": [0, 0, 0, 0, 0.25],
        "65": [0, 0.68333, 0, 0.19445, 0.79847],
        "66": [0, 0.68333, 0.03041, 0.13889, 0.65681],
        "67": [0, 0.68333, 0.05834, 0.13889, 0.52653],
        "68": [0, 0.68333, 0.02778, 0.08334, 0.77139],
        "69": [0, 0.68333, 0.08944, 0.11111, 0.52778],
        "70": [0, 0.68333, 0.09931, 0.11111, 0.71875],
        "71": [0.09722, 0.68333, 0.0593, 0.11111, 0.59487],
        "72": [0, 0.68333, 0.00965, 0.11111, 0.84452],
        "73": [0, 0.68333, 0.07382, 0, 0.54452],
        "74": [0.09722, 0.68333, 0.18472, 0.16667, 0.67778],
        "75": [0, 0.68333, 0.01445, 0.05556, 0.76195],
        "76": [0, 0.68333, 0, 0.13889, 0.68972],
        "77": [0, 0.68333, 0, 0.13889, 1.2009],
        "78": [0, 0.68333, 0.14736, 0.08334, 0.82049],
        "79": [0, 0.68333, 0.02778, 0.11111, 0.79611],
        "80": [0, 0.68333, 0.08222, 0.08334, 0.69556],
        "81": [0.09722, 0.68333, 0, 0.11111, 0.81667],
        "82": [0, 0.68333, 0, 0.08334, 0.8475],
        "83": [0, 0.68333, 0.075, 0.13889, 0.60556],
        "84": [0, 0.68333, 0.25417, 0, 0.54464],
        "85": [0, 0.68333, 0.09931, 0.08334, 0.62583],
        "86": [0, 0.68333, 0.08222, 0, 0.61278],
        "87": [0, 0.68333, 0.08222, 0.08334, 0.98778],
        "88": [0, 0.68333, 0.14643, 0.13889, 0.7133],
        "89": [0.09722, 0.68333, 0.08222, 0.08334, 0.66834],
        "90": [0, 0.68333, 0.07944, 0.13889, 0.72473],
        "160": [0, 0, 0, 0, 0.25],
    },
    "Fraktur-Regular": {
        "32": [0, 0, 0, 0, 0.25],
        "33": [0, 0.69141, 0, 0, 0.29574],
        "34": [0, 0.69141, 0, 0, 0.21471],
        "38": [0, 0.69141, 0, 0, 0.73786],
        "39": [0, 0.69141, 0, 0, 0.21201],
        "40": [0.24982, 0.74947, 0, 0, 0.38865],
        "41": [0.24982, 0.74947, 0, 0, 0.38865],
        "42": [0, 0.62119, 0, 0, 0.27764],
        "43": [0.08319, 0.58283, 0, 0, 0.75623],
        "44": [0, 0.10803, 0, 0, 0.27764],
        "45": [0.08319, 0.58283, 0, 0, 0.75623],
        "46": [0, 0.10803, 0, 0, 0.27764],
        "47": [0.24982, 0.74947, 0, 0, 0.50181],
        "48": [0, 0.47534, 0, 0, 0.50181],
        "49": [0, 0.47534, 0, 0, 0.50181],
        "50": [0, 0.47534, 0, 0, 0.50181],
        "51": [0.18906, 0.47534, 0, 0, 0.50181],
        "52": [0.18906, 0.47534, 0, 0, 0.50181],
        "53": [0.18906, 0.47534, 0, 0, 0.50181],
        "54": [0, 0.69141, 0, 0, 0.50181],
        "55": [0.18906, 0.47534, 0, 0, 0.50181],
        "56": [0, 0.69141, 0, 0, 0.50181],
        "57": [0.18906, 0.47534, 0, 0, 0.50181],
        "58": [0, 0.47534, 0, 0, 0.21606],
        "59": [0.12604, 0.47534, 0, 0, 0.21606],
        "61": [-0.13099, 0.36866, 0, 0, 0.75623],
        "63": [0, 0.69141, 0, 0, 0.36245],
        "65": [0, 0.69141, 0, 0, 0.7176],
        "66": [0, 0.69141, 0, 0, 0.88397],
        "67": [0, 0.69141, 0, 0, 0.61254],
        "68": [0, 0.69141, 0, 0, 0.83158],
        "69": [0, 0.69141, 0, 0, 0.66278],
        "70": [0.12604, 0.69141, 0, 0, 0.61119],
        "71": [0, 0.69141, 0, 0, 0.78539],
        "72": [0.06302, 0.69141, 0, 0, 0.7203],
        "73": [0, 0.69141, 0, 0, 0.55448],
        "74": [0.12604, 0.69141, 0, 0, 0.55231],
        "75": [0, 0.69141, 0, 0, 0.66845],
        "76": [0, 0.69141, 0, 0, 0.66602],
        "77": [0, 0.69141, 0, 0, 1.04953],
        "78": [0, 0.69141, 0, 0, 0.83212],
        "79": [0, 0.69141, 0, 0, 0.82699],
        "80": [0.18906, 0.69141, 0, 0, 0.82753],
        "81": [0.03781, 0.69141, 0, 0, 0.82699],
        "82": [0, 0.69141, 0, 0, 0.82807],
        "83": [0, 0.69141, 0, 0, 0.82861],
        "84": [0, 0.69141, 0, 0, 0.66899],
        "85": [0, 0.69141, 0, 0, 0.64576],
        "86": [0, 0.69141, 0, 0, 0.83131],
        "87": [0, 0.69141, 0, 0, 1.04602],
        "88": [0, 0.69141, 0, 0, 0.71922],
        "89": [0.18906, 0.69141, 0, 0, 0.83293],
        "90": [0.12604, 0.69141, 0, 0, 0.60201],
        "91": [0.24982, 0.74947, 0, 0, 0.27764],
        "93": [0.24982, 0.74947, 0, 0, 0.27764],
        "94": [0, 0.69141, 0, 0, 0.49965],
        "97": [0, 0.47534, 0, 0, 0.50046],
        "98": [0, 0.69141, 0, 0, 0.51315],
        "99": [0, 0.47534, 0, 0, 0.38946],
        "100": [0, 0.62119, 0, 0, 0.49857],
        "101": [0, 0.47534, 0, 0, 0.40053],
        "102": [0.18906, 0.69141, 0, 0, 0.32626],
        "103": [0.18906, 0.47534, 0, 0, 0.5037],
        "104": [0.18906, 0.69141, 0, 0, 0.52126],
        "105": [0, 0.69141, 0, 0, 0.27899],
        "106": [0, 0.69141, 0, 0, 0.28088],
        "107": [0, 0.69141, 0, 0, 0.38946],
        "108": [0, 0.69141, 0, 0, 0.27953],
        "109": [0, 0.47534, 0, 0, 0.76676],
        "110": [0, 0.47534, 0, 0, 0.52666],
        "111": [0, 0.47534, 0, 0, 0.48885],
        "112": [0.18906, 0.52396, 0, 0, 0.50046],
        "113": [0.18906, 0.47534, 0, 0, 0.48912],
        "114": [0, 0.47534, 0, 0, 0.38919],
        "115": [0, 0.47534, 0, 0, 0.44266],
        "116": [0, 0.62119, 0, 0, 0.33301],
        "117": [0, 0.47534, 0, 0, 0.5172],
        "118": [0, 0.52396, 0, 0, 0.5118],
        "119": [0, 0.52396, 0, 0, 0.77351],
        "120": [0.18906, 0.47534, 0, 0, 0.38865],
        "121": [0.18906, 0.47534, 0, 0, 0.49884],
        "122": [0.18906, 0.47534, 0, 0, 0.39054],
        "160": [0, 0, 0, 0, 0.25],
        "8216": [0, 0.69141, 0, 0, 0.21471],
        "8217": [0, 0.69141, 0, 0, 0.21471],
        "58112": [0, 0.62119, 0, 0, 0.49749],
        "58113": [0, 0.62119, 0, 0, 0.4983],
        "58114": [0.18906, 0.69141, 0, 0, 0.33328],
        "58115": [0.18906, 0.69141, 0, 0, 0.32923],
        "58116": [0.18906, 0.47534, 0, 0, 0.50343],
        "58117": [0, 0.69141, 0, 0, 0.33301],
        "58118": [0, 0.62119, 0, 0, 0.33409],
        "58119": [0, 0.47534, 0, 0, 0.50073],
    },
    "Main-Bold": {
        "32": [0, 0, 0, 0, 0.25],
        "33": [0, 0.69444, 0, 0, 0.35],
        "34": [0, 0.69444, 0, 0, 0.60278],
        "35": [0.19444, 0.69444, 0, 0, 0.95833],
        "36": [0.05556, 0.75, 0, 0, 0.575],
        "37": [0.05556, 0.75, 0, 0, 0.95833],
        "38": [0, 0.69444, 0, 0, 0.89444],
        "39": [0, 0.69444, 0, 0, 0.31944],
        "40": [0.25, 0.75, 0, 0, 0.44722],
        "41": [0.25, 0.75, 0, 0, 0.44722],
        "42": [0, 0.75, 0, 0, 0.575],
        "43": [0.13333, 0.63333, 0, 0, 0.89444],
        "44": [0.19444, 0.15556, 0, 0, 0.31944],
        "45": [0, 0.44444, 0, 0, 0.38333],
        "46": [0, 0.15556, 0, 0, 0.31944],
        "47": [0.25, 0.75, 0, 0, 0.575],
        "48": [0, 0.64444, 0, 0, 0.575],
        "49": [0, 0.64444, 0, 0, 0.575],
        "50": [0, 0.64444, 0, 0, 0.575],
        "51": [0, 0.64444, 0, 0, 0.575],
        "52": [0, 0.64444, 0, 0, 0.575],
        "53": [0, 0.64444, 0, 0, 0.575],
        "54": [0, 0.64444, 0, 0, 0.575],
        "55": [0, 0.64444, 0, 0, 0.575],
        "56": [0, 0.64444, 0, 0, 0.575],
        "57": [0, 0.64444, 0, 0, 0.575],
        "58": [0, 0.44444, 0, 0, 0.31944],
        "59": [0.19444, 0.44444, 0, 0, 0.31944],
        "60": [0.08556, 0.58556, 0, 0, 0.89444],
        "61": [-0.10889, 0.39111, 0, 0, 0.89444],
        "62": [0.08556, 0.58556, 0, 0, 0.89444],
        "63": [0, 0.69444, 0, 0, 0.54305],
        "64": [0, 0.69444, 0, 0, 0.89444],
        "65": [0, 0.68611, 0, 0, 0.86944],
        "66": [0, 0.68611, 0, 0, 0.81805],
        "67": [0, 0.68611, 0, 0, 0.83055],
        "68": [0, 0.68611, 0, 0, 0.88194],
        "69": [0, 0.68611, 0, 0, 0.75555],
        "70": [0, 0.68611, 0, 0, 0.72361],
        "71": [0, 0.68611, 0, 0, 0.90416],
        "72": [0, 0.68611, 0, 0, 0.9],
        "73": [0, 0.68611, 0, 0, 0.43611],
        "74": [0, 0.68611, 0, 0, 0.59444],
        "75": [0, 0.68611, 0, 0, 0.90138],
        "76": [0, 0.68611, 0, 0, 0.69166],
        "77": [0, 0.68611, 0, 0, 1.09166],
        "78": [0, 0.68611, 0, 0, 0.9],
        "79": [0, 0.68611, 0, 0, 0.86388],
        "80": [0, 0.68611, 0, 0, 0.78611],
        "81": [0.19444, 0.68611, 0, 0, 0.86388],
        "82": [0, 0.68611, 0, 0, 0.8625],
        "83": [0, 0.68611, 0, 0, 0.63889],
        "84": [0, 0.68611, 0, 0, 0.8],
        "85": [0, 0.68611, 0, 0, 0.88472],
        "86": [0, 0.68611, 0.01597, 0, 0.86944],
        "87": [0, 0.68611, 0.01597, 0, 1.18888],
        "88": [0, 0.68611, 0, 0, 0.86944],
        "89": [0, 0.68611, 0.02875, 0, 0.86944],
        "90": [0, 0.68611, 0, 0, 0.70277],
        "91": [0.25, 0.75, 0, 0, 0.31944],
        "92": [0.25, 0.75, 0, 0, 0.575],
        "93": [0.25, 0.75, 0, 0, 0.31944],
        "94": [0, 0.69444, 0, 0, 0.575],
        "95": [0.31, 0.13444, 0.03194, 0, 0.575],
        "97": [0, 0.44444, 0, 0, 0.55902],
        "98": [0, 0.69444, 0, 0, 0.63889],
        "99": [0, 0.44444, 0, 0, 0.51111],
        "100": [0, 0.69444, 0, 0, 0.63889],
        "101": [0, 0.44444, 0, 0, 0.52708],
        "102": [0, 0.69444, 0.10903, 0, 0.35139],
        "103": [0.19444, 0.44444, 0.01597, 0, 0.575],
        "104": [0, 0.69444, 0, 0, 0.63889],
        "105": [0, 0.69444, 0, 0, 0.31944],
        "106": [0.19444, 0.69444, 0, 0, 0.35139],
        "107": [0, 0.69444, 0, 0, 0.60694],
        "108": [0, 0.69444, 0, 0, 0.31944],
        "109": [0, 0.44444, 0, 0, 0.95833],
        "110": [0, 0.44444, 0, 0, 0.63889],
        "111": [0, 0.44444, 0, 0, 0.575],
        "112": [0.19444, 0.44444, 0, 0, 0.63889],
        "113": [0.19444, 0.44444, 0, 0, 0.60694],
        "114": [0, 0.44444, 0, 0, 0.47361],
        "115": [0, 0.44444, 0, 0, 0.45361],
        "116": [0, 0.63492, 0, 0, 0.44722],
        "117": [0, 0.44444, 0, 0, 0.63889],
        "118": [0, 0.44444, 0.01597, 0, 0.60694],
        "119": [0, 0.44444, 0.01597, 0, 0.83055],
        "120": [0, 0.44444, 0, 0, 0.60694],
        "121": [0.19444, 0.44444, 0.01597, 0, 0.60694],
        "122": [0, 0.44444, 0, 0, 0.51111],
        "123": [0.25, 0.75, 0, 0, 0.575],
        "124": [0.25, 0.75, 0, 0, 0.31944],
        "125": [0.25, 0.75, 0, 0, 0.575],
        "126": [0.35, 0.34444, 0, 0, 0.575],
        "160": [0, 0, 0, 0, 0.25],
        "163": [0, 0.69444, 0, 0, 0.86853],
        "168": [0, 0.69444, 0, 0, 0.575],
        "172": [0, 0.44444, 0, 0, 0.76666],
        "176": [0, 0.69444, 0, 0, 0.86944],
        "177": [0.13333, 0.63333, 0, 0, 0.89444],
        "184": [0.17014, 0, 0, 0, 0.51111],
        "198": [0, 0.68611, 0, 0, 1.04166],
        "215": [0.13333, 0.63333, 0, 0, 0.89444],
        "216": [0.04861, 0.73472, 0, 0, 0.89444],
        "223": [0, 0.69444, 0, 0, 0.59722],
        "230": [0, 0.44444, 0, 0, 0.83055],
        "247": [0.13333, 0.63333, 0, 0, 0.89444],
        "248": [0.09722, 0.54167, 0, 0, 0.575],
        "305": [0, 0.44444, 0, 0, 0.31944],
        "338": [0, 0.68611, 0, 0, 1.16944],
        "339": [0, 0.44444, 0, 0, 0.89444],
        "567": [0.19444, 0.44444, 0, 0, 0.35139],
        "710": [0, 0.69444, 0, 0, 0.575],
        "711": [0, 0.63194, 0, 0, 0.575],
        "713": [0, 0.59611, 0, 0, 0.575],
        "714": [0, 0.69444, 0, 0, 0.575],
        "715": [0, 0.69444, 0, 0, 0.575],
        "728": [0, 0.69444, 0, 0, 0.575],
        "729": [0, 0.69444, 0, 0, 0.31944],
        "730": [0, 0.69444, 0, 0, 0.86944],
        "732": [0, 0.69444, 0, 0, 0.575],
        "733": [0, 0.69444, 0, 0, 0.575],
        "915": [0, 0.68611, 0, 0, 0.69166],
        "916": [0, 0.68611, 0, 0, 0.95833],
        "920": [0, 0.68611, 0, 0, 0.89444],
        "923": [0, 0.68611, 0, 0, 0.80555],
        "926": [0, 0.68611, 0, 0, 0.76666],
        "928": [0, 0.68611, 0, 0, 0.9],
        "931": [0, 0.68611, 0, 0, 0.83055],
        "933": [0, 0.68611, 0, 0, 0.89444],
        "934": [0, 0.68611, 0, 0, 0.83055],
        "936": [0, 0.68611, 0, 0, 0.89444],
        "937": [0, 0.68611, 0, 0, 0.83055],
        "8211": [0, 0.44444, 0.03194, 0, 0.575],
        "8212": [0, 0.44444, 0.03194, 0, 1.14999],
        "8216": [0, 0.69444, 0, 0, 0.31944],
        "8217": [0, 0.69444, 0, 0, 0.31944],
        "8220": [0, 0.69444, 0, 0, 0.60278],
        "8221": [0, 0.69444, 0, 0, 0.60278],
        "8224": [0.19444, 0.69444, 0, 0, 0.51111],
        "8225": [0.19444, 0.69444, 0, 0, 0.51111],
        "8242": [0, 0.55556, 0, 0, 0.34444],
        "8407": [0, 0.72444, 0.15486, 0, 0.575],
        "8463": [0, 0.69444, 0, 0, 0.66759],
        "8465": [0, 0.69444, 0, 0, 0.83055],
        "8467": [0, 0.69444, 0, 0, 0.47361],
        "8472": [0.19444, 0.44444, 0, 0, 0.74027],
        "8476": [0, 0.69444, 0, 0, 0.83055],
        "8501": [0, 0.69444, 0, 0, 0.70277],
        "8592": [-0.10889, 0.39111, 0, 0, 1.14999],
        "8593": [0.19444, 0.69444, 0, 0, 0.575],
        "8594": [-0.10889, 0.39111, 0, 0, 1.14999],
        "8595": [0.19444, 0.69444, 0, 0, 0.575],
        "8596": [-0.10889, 0.39111, 0, 0, 1.14999],
        "8597": [0.25, 0.75, 0, 0, 0.575],
        "8598": [0.19444, 0.69444, 0, 0, 1.14999],
        "8599": [0.19444, 0.69444, 0, 0, 1.14999],
        "8600": [0.19444, 0.69444, 0, 0, 1.14999],
        "8601": [0.19444, 0.69444, 0, 0, 1.14999],
        "8636": [-0.10889, 0.39111, 0, 0, 1.14999],
        "8637": [-0.10889, 0.39111, 0, 0, 1.14999],
        "8640": [-0.10889, 0.39111, 0, 0, 1.14999],
        "8641": [-0.10889, 0.39111, 0, 0, 1.14999],
        "8656": [-0.10889, 0.39111, 0, 0, 1.14999],
        "8657": [0.19444, 0.69444, 0, 0, 0.70277],
        "8658": [-0.10889, 0.39111, 0, 0, 1.14999],
        "8659": [0.19444, 0.69444, 0, 0, 0.70277],
        "8660": [-0.10889, 0.39111, 0, 0, 1.14999],
        "8661": [0.25, 0.75, 0, 0, 0.70277],
        "8704": [0, 0.69444, 0, 0, 0.63889],
        "8706": [0, 0.69444, 0.06389, 0, 0.62847],
        "8707": [0, 0.69444, 0, 0, 0.63889],
        "8709": [0.05556, 0.75, 0, 0, 0.575],
        "8711": [0, 0.68611, 0, 0, 0.95833],
        "8712": [0.08556, 0.58556, 0, 0, 0.76666],
        "8715": [0.08556, 0.58556, 0, 0, 0.76666],
        "8722": [0.13333, 0.63333, 0, 0, 0.89444],
        "8723": [0.13333, 0.63333, 0, 0, 0.89444],
        "8725": [0.25, 0.75, 0, 0, 0.575],
        "8726": [0.25, 0.75, 0, 0, 0.575],
        "8727": [-0.02778, 0.47222, 0, 0, 0.575],
        "8728": [-0.02639, 0.47361, 0, 0, 0.575],
        "8729": [-0.02639, 0.47361, 0, 0, 0.575],
        "8730": [0.18, 0.82, 0, 0, 0.95833],
        "8733": [0, 0.44444, 0, 0, 0.89444],
        "8734": [0, 0.44444, 0, 0, 1.14999],
        "8736": [0, 0.69224, 0, 0, 0.72222],
        "8739": [0.25, 0.75, 0, 0, 0.31944],
        "8741": [0.25, 0.75, 0, 0, 0.575],
        "8743": [0, 0.55556, 0, 0, 0.76666],
        "8744": [0, 0.55556, 0, 0, 0.76666],
        "8745": [0, 0.55556, 0, 0, 0.76666],
        "8746": [0, 0.55556, 0, 0, 0.76666],
        "8747": [0.19444, 0.69444, 0.12778, 0, 0.56875],
        "8764": [-0.10889, 0.39111, 0, 0, 0.89444],
        "8768": [0.19444, 0.69444, 0, 0, 0.31944],
        "8771": [0.00222, 0.50222, 0, 0, 0.89444],
        "8773": [0.027, 0.638, 0, 0, 0.894],
        "8776": [0.02444, 0.52444, 0, 0, 0.89444],
        "8781": [0.00222, 0.50222, 0, 0, 0.89444],
        "8801": [0.00222, 0.50222, 0, 0, 0.89444],
        "8804": [0.19667, 0.69667, 0, 0, 0.89444],
        "8805": [0.19667, 0.69667, 0, 0, 0.89444],
        "8810": [0.08556, 0.58556, 0, 0, 1.14999],
        "8811": [0.08556, 0.58556, 0, 0, 1.14999],
        "8826": [0.08556, 0.58556, 0, 0, 0.89444],
        "8827": [0.08556, 0.58556, 0, 0, 0.89444],
        "8834": [0.08556, 0.58556, 0, 0, 0.89444],
        "8835": [0.08556, 0.58556, 0, 0, 0.89444],
        "8838": [0.19667, 0.69667, 0, 0, 0.89444],
        "8839": [0.19667, 0.69667, 0, 0, 0.89444],
        "8846": [0, 0.55556, 0, 0, 0.76666],
        "8849": [0.19667, 0.69667, 0, 0, 0.89444],
        "8850": [0.19667, 0.69667, 0, 0, 0.89444],
        "8851": [0, 0.55556, 0, 0, 0.76666],
        "8852": [0, 0.55556, 0, 0, 0.76666],
        "8853": [0.13333, 0.63333, 0, 0, 0.89444],
        "8854": [0.13333, 0.63333, 0, 0, 0.89444],
        "8855": [0.13333, 0.63333, 0, 0, 0.89444],
        "8856": [0.13333, 0.63333, 0, 0, 0.89444],
        "8857": [0.13333, 0.63333, 0, 0, 0.89444],
        "8866": [0, 0.69444, 0, 0, 0.70277],
        "8867": [0, 0.69444, 0, 0, 0.70277],
        "8868": [0, 0.69444, 0, 0, 0.89444],
        "8869": [0, 0.69444, 0, 0, 0.89444],
        "8900": [-0.02639, 0.47361, 0, 0, 0.575],
        "8901": [-0.02639, 0.47361, 0, 0, 0.31944],
        "8902": [-0.02778, 0.47222, 0, 0, 0.575],
        "8968": [0.25, 0.75, 0, 0, 0.51111],
        "8969": [0.25, 0.75, 0, 0, 0.51111],
        "8970": [0.25, 0.75, 0, 0, 0.51111],
        "8971": [0.25, 0.75, 0, 0, 0.51111],
        "8994": [-0.13889, 0.36111, 0, 0, 1.14999],
        "8995": [-0.13889, 0.36111, 0, 0, 1.14999],
        "9651": [0.19444, 0.69444, 0, 0, 1.02222],
        "9657": [-0.02778, 0.47222, 0, 0, 0.575],
        "9661": [0.19444, 0.69444, 0, 0, 1.02222],
        "9667": [-0.02778, 0.47222, 0, 0, 0.575],
        "9711": [0.19444, 0.69444, 0, 0, 1.14999],
        "9824": [0.12963, 0.69444, 0, 0, 0.89444],
        "9825": [0.12963, 0.69444, 0, 0, 0.89444],
        "9826": [0.12963, 0.69444, 0, 0, 0.89444],
        "9827": [0.12963, 0.69444, 0, 0, 0.89444],
        "9837": [0, 0.75, 0, 0, 0.44722],
        "9838": [0.19444, 0.69444, 0, 0, 0.44722],
        "9839": [0.19444, 0.69444, 0, 0, 0.44722],
        "10216": [0.25, 0.75, 0, 0, 0.44722],
        "10217": [0.25, 0.75, 0, 0, 0.44722],
        "10815": [0, 0.68611, 0, 0, 0.9],
        "10927": [0.19667, 0.69667, 0, 0, 0.89444],
        "10928": [0.19667, 0.69667, 0, 0, 0.89444],
        "57376": [0.19444, 0.69444, 0, 0, 0],
    },
    "Main-BoldItalic": {
        "32": [0, 0, 0, 0, 0.25],
        "33": [0, 0.69444, 0.11417, 0, 0.38611],
        "34": [0, 0.69444, 0.07939, 0, 0.62055],
        "35": [0.19444, 0.69444, 0.06833, 0, 0.94444],
        "37": [0.05556, 0.75, 0.12861, 0, 0.94444],
        "38": [0, 0.69444, 0.08528, 0, 0.88555],
        "39": [0, 0.69444, 0.12945, 0, 0.35555],
        "40": [0.25, 0.75, 0.15806, 0, 0.47333],
        "41": [0.25, 0.75, 0.03306, 0, 0.47333],
        "42": [0, 0.75, 0.14333, 0, 0.59111],
        "43": [0.10333, 0.60333, 0.03306, 0, 0.88555],
        "44": [0.19444, 0.14722, 0, 0, 0.35555],
        "45": [0, 0.44444, 0.02611, 0, 0.41444],
        "46": [0, 0.14722, 0, 0, 0.35555],
        "47": [0.25, 0.75, 0.15806, 0, 0.59111],
        "48": [0, 0.64444, 0.13167, 0, 0.59111],
        "49": [0, 0.64444, 0.13167, 0, 0.59111],
        "50": [0, 0.64444, 0.13167, 0, 0.59111],
        "51": [0, 0.64444, 0.13167, 0, 0.59111],
        "52": [0.19444, 0.64444, 0.13167, 0, 0.59111],
        "53": [0, 0.64444, 0.13167, 0, 0.59111],
        "54": [0, 0.64444, 0.13167, 0, 0.59111],
        "55": [0.19444, 0.64444, 0.13167, 0, 0.59111],
        "56": [0, 0.64444, 0.13167, 0, 0.59111],
        "57": [0, 0.64444, 0.13167, 0, 0.59111],
        "58": [0, 0.44444, 0.06695, 0, 0.35555],
        "59": [0.19444, 0.44444, 0.06695, 0, 0.35555],
        "61": [-0.10889, 0.39111, 0.06833, 0, 0.88555],
        "63": [0, 0.69444, 0.11472, 0, 0.59111],
        "64": [0, 0.69444, 0.09208, 0, 0.88555],
        "65": [0, 0.68611, 0, 0, 0.86555],
        "66": [0, 0.68611, 0.0992, 0, 0.81666],
        "67": [0, 0.68611, 0.14208, 0, 0.82666],
        "68": [0, 0.68611, 0.09062, 0, 0.87555],
        "69": [0, 0.68611, 0.11431, 0, 0.75666],
        "70": [0, 0.68611, 0.12903, 0, 0.72722],
        "71": [0, 0.68611, 0.07347, 0, 0.89527],
        "72": [0, 0.68611, 0.17208, 0, 0.8961],
        "73": [0, 0.68611, 0.15681, 0, 0.47166],
        "74": [0, 0.68611, 0.145, 0, 0.61055],
        "75": [0, 0.68611, 0.14208, 0, 0.89499],
        "76": [0, 0.68611, 0, 0, 0.69777],
        "77": [0, 0.68611, 0.17208, 0, 1.07277],
        "78": [0, 0.68611, 0.17208, 0, 0.8961],
        "79": [0, 0.68611, 0.09062, 0, 0.85499],
        "80": [0, 0.68611, 0.0992, 0, 0.78721],
        "81": [0.19444, 0.68611, 0.09062, 0, 0.85499],
        "82": [0, 0.68611, 0.02559, 0, 0.85944],
        "83": [0, 0.68611, 0.11264, 0, 0.64999],
        "84": [0, 0.68611, 0.12903, 0, 0.7961],
        "85": [0, 0.68611, 0.17208, 0, 0.88083],
        "86": [0, 0.68611, 0.18625, 0, 0.86555],
        "87": [0, 0.68611, 0.18625, 0, 1.15999],
        "88": [0, 0.68611, 0.15681, 0, 0.86555],
        "89": [0, 0.68611, 0.19803, 0, 0.86555],
        "90": [0, 0.68611, 0.14208, 0, 0.70888],
        "91": [0.25, 0.75, 0.1875, 0, 0.35611],
        "93": [0.25, 0.75, 0.09972, 0, 0.35611],
        "94": [0, 0.69444, 0.06709, 0, 0.59111],
        "95": [0.31, 0.13444, 0.09811, 0, 0.59111],
        "97": [0, 0.44444, 0.09426, 0, 0.59111],
        "98": [0, 0.69444, 0.07861, 0, 0.53222],
        "99": [0, 0.44444, 0.05222, 0, 0.53222],
        "100": [0, 0.69444, 0.10861, 0, 0.59111],
        "101": [0, 0.44444, 0.085, 0, 0.53222],
        "102": [0.19444, 0.69444, 0.21778, 0, 0.4],
        "103": [0.19444, 0.44444, 0.105, 0, 0.53222],
        "104": [0, 0.69444, 0.09426, 0, 0.59111],
        "105": [0, 0.69326, 0.11387, 0, 0.35555],
        "106": [0.19444, 0.69326, 0.1672, 0, 0.35555],
        "107": [0, 0.69444, 0.11111, 0, 0.53222],
        "108": [0, 0.69444, 0.10861, 0, 0.29666],
        "109": [0, 0.44444, 0.09426, 0, 0.94444],
        "110": [0, 0.44444, 0.09426, 0, 0.64999],
        "111": [0, 0.44444, 0.07861, 0, 0.59111],
        "112": [0.19444, 0.44444, 0.07861, 0, 0.59111],
        "113": [0.19444, 0.44444, 0.105, 0, 0.53222],
        "114": [0, 0.44444, 0.11111, 0, 0.50167],
        "115": [0, 0.44444, 0.08167, 0, 0.48694],
        "116": [0, 0.63492, 0.09639, 0, 0.385],
        "117": [0, 0.44444, 0.09426, 0, 0.62055],
        "118": [0, 0.44444, 0.11111, 0, 0.53222],
        "119": [0, 0.44444, 0.11111, 0, 0.76777],
        "120": [0, 0.44444, 0.12583, 0, 0.56055],
        "121": [0.19444, 0.44444, 0.105, 0, 0.56166],
        "122": [0, 0.44444, 0.13889, 0, 0.49055],
        "126": [0.35, 0.34444, 0.11472, 0, 0.59111],
        "160": [0, 0, 0, 0, 0.25],
        "168": [0, 0.69444, 0.11473, 0, 0.59111],
        "176": [0, 0.69444, 0, 0, 0.94888],
        "184": [0.17014, 0, 0, 0, 0.53222],
        "198": [0, 0.68611, 0.11431, 0, 1.02277],
        "216": [0.04861, 0.73472, 0.09062, 0, 0.88555],
        "223": [0.19444, 0.69444, 0.09736, 0, 0.665],
        "230": [0, 0.44444, 0.085, 0, 0.82666],
        "248": [0.09722, 0.54167, 0.09458, 0, 0.59111],
        "305": [0, 0.44444, 0.09426, 0, 0.35555],
        "338": [0, 0.68611, 0.11431, 0, 1.14054],
        "339": [0, 0.44444, 0.085, 0, 0.82666],
        "567": [0.19444, 0.44444, 0.04611, 0, 0.385],
        "710": [0, 0.69444, 0.06709, 0, 0.59111],
        "711": [0, 0.63194, 0.08271, 0, 0.59111],
        "713": [0, 0.59444, 0.10444, 0, 0.59111],
        "714": [0, 0.69444, 0.08528, 0, 0.59111],
        "715": [0, 0.69444, 0, 0, 0.59111],
        "728": [0, 0.69444, 0.10333, 0, 0.59111],
        "729": [0, 0.69444, 0.12945, 0, 0.35555],
        "730": [0, 0.69444, 0, 0, 0.94888],
        "732": [0, 0.69444, 0.11472, 0, 0.59111],
        "733": [0, 0.69444, 0.11472, 0, 0.59111],
        "915": [0, 0.68611, 0.12903, 0, 0.69777],
        "916": [0, 0.68611, 0, 0, 0.94444],
        "920": [0, 0.68611, 0.09062, 0, 0.88555],
        "923": [0, 0.68611, 0, 0, 0.80666],
        "926": [0, 0.68611, 0.15092, 0, 0.76777],
        "928": [0, 0.68611, 0.17208, 0, 0.8961],
        "931": [0, 0.68611, 0.11431, 0, 0.82666],
        "933": [0, 0.68611, 0.10778, 0, 0.88555],
        "934": [0, 0.68611, 0.05632, 0, 0.82666],
        "936": [0, 0.68611, 0.10778, 0, 0.88555],
        "937": [0, 0.68611, 0.0992, 0, 0.82666],
        "8211": [0, 0.44444, 0.09811, 0, 0.59111],
        "8212": [0, 0.44444, 0.09811, 0, 1.18221],
        "8216": [0, 0.69444, 0.12945, 0, 0.35555],
        "8217": [0, 0.69444, 0.12945, 0, 0.35555],
        "8220": [0, 0.69444, 0.16772, 0, 0.62055],
        "8221": [0, 0.69444, 0.07939, 0, 0.62055],
    },
    "Main-Italic": {
        "32": [0, 0, 0, 0, 0.25],
        "33": [0, 0.69444, 0.12417, 0, 0.30667],
        "34": [0, 0.69444, 0.06961, 0, 0.51444],
        "35": [0.19444, 0.69444, 0.06616, 0, 0.81777],
        "37": [0.05556, 0.75, 0.13639, 0, 0.81777],
        "38": [0, 0.69444, 0.09694, 0, 0.76666],
        "39": [0, 0.69444, 0.12417, 0, 0.30667],
        "40": [0.25, 0.75, 0.16194, 0, 0.40889],
        "41": [0.25, 0.75, 0.03694, 0, 0.40889],
        "42": [0, 0.75, 0.14917, 0, 0.51111],
        "43": [0.05667, 0.56167, 0.03694, 0, 0.76666],
        "44": [0.19444, 0.10556, 0, 0, 0.30667],
        "45": [0, 0.43056, 0.02826, 0, 0.35778],
        "46": [0, 0.10556, 0, 0, 0.30667],
        "47": [0.25, 0.75, 0.16194, 0, 0.51111],
        "48": [0, 0.64444, 0.13556, 0, 0.51111],
        "49": [0, 0.64444, 0.13556, 0, 0.51111],
        "50": [0, 0.64444, 0.13556, 0, 0.51111],
        "51": [0, 0.64444, 0.13556, 0, 0.51111],
        "52": [0.19444, 0.64444, 0.13556, 0, 0.51111],
        "53": [0, 0.64444, 0.13556, 0, 0.51111],
        "54": [0, 0.64444, 0.13556, 0, 0.51111],
        "55": [0.19444, 0.64444, 0.13556, 0, 0.51111],
        "56": [0, 0.64444, 0.13556, 0, 0.51111],
        "57": [0, 0.64444, 0.13556, 0, 0.51111],
        "58": [0, 0.43056, 0.0582, 0, 0.30667],
        "59": [0.19444, 0.43056, 0.0582, 0, 0.30667],
        "61": [-0.13313, 0.36687, 0.06616, 0, 0.76666],
        "63": [0, 0.69444, 0.1225, 0, 0.51111],
        "64": [0, 0.69444, 0.09597, 0, 0.76666],
        "65": [0, 0.68333, 0, 0, 0.74333],
        "66": [0, 0.68333, 0.10257, 0, 0.70389],
        "67": [0, 0.68333, 0.14528, 0, 0.71555],
        "68": [0, 0.68333, 0.09403, 0, 0.755],
        "69": [0, 0.68333, 0.12028, 0, 0.67833],
        "70": [0, 0.68333, 0.13305, 0, 0.65277],
        "71": [0, 0.68333, 0.08722, 0, 0.77361],
        "72": [0, 0.68333, 0.16389, 0, 0.74333],
        "73": [0, 0.68333, 0.15806, 0, 0.38555],
        "74": [0, 0.68333, 0.14028, 0, 0.525],
        "75": [0, 0.68333, 0.14528, 0, 0.76888],
        "76": [0, 0.68333, 0, 0, 0.62722],
        "77": [0, 0.68333, 0.16389, 0, 0.89666],
        "78": [0, 0.68333, 0.16389, 0, 0.74333],
        "79": [0, 0.68333, 0.09403, 0, 0.76666],
        "80": [0, 0.68333, 0.10257, 0, 0.67833],
        "81": [0.19444, 0.68333, 0.09403, 0, 0.76666],
        "82": [0, 0.68333, 0.03868, 0, 0.72944],
        "83": [0, 0.68333, 0.11972, 0, 0.56222],
        "84": [0, 0.68333, 0.13305, 0, 0.71555],
        "85": [0, 0.68333, 0.16389, 0, 0.74333],
        "86": [0, 0.68333, 0.18361, 0, 0.74333],
        "87": [0, 0.68333, 0.18361, 0, 0.99888],
        "88": [0, 0.68333, 0.15806, 0, 0.74333],
        "89": [0, 0.68333, 0.19383, 0, 0.74333],
        "90": [0, 0.68333, 0.14528, 0, 0.61333],
        "91": [0.25, 0.75, 0.1875, 0, 0.30667],
        "93": [0.25, 0.75, 0.10528, 0, 0.30667],
        "94": [0, 0.69444, 0.06646, 0, 0.51111],
        "95": [0.31, 0.12056, 0.09208, 0, 0.51111],
        "97": [0, 0.43056, 0.07671, 0, 0.51111],
        "98": [0, 0.69444, 0.06312, 0, 0.46],
        "99": [0, 0.43056, 0.05653, 0, 0.46],
        "100": [0, 0.69444, 0.10333, 0, 0.51111],
        "101": [0, 0.43056, 0.07514, 0, 0.46],
        "102": [0.19444, 0.69444, 0.21194, 0, 0.30667],
        "103": [0.19444, 0.43056, 0.08847, 0, 0.46],
        "104": [0, 0.69444, 0.07671, 0, 0.51111],
        "105": [0, 0.65536, 0.1019, 0, 0.30667],
        "106": [0.19444, 0.65536, 0.14467, 0, 0.30667],
        "107": [0, 0.69444, 0.10764, 0, 0.46],
        "108": [0, 0.69444, 0.10333, 0, 0.25555],
        "109": [0, 0.43056, 0.07671, 0, 0.81777],
        "110": [0, 0.43056, 0.07671, 0, 0.56222],
        "111": [0, 0.43056, 0.06312, 0, 0.51111],
        "112": [0.19444, 0.43056, 0.06312, 0, 0.51111],
        "113": [0.19444, 0.43056, 0.08847, 0, 0.46],
        "114": [0, 0.43056, 0.10764, 0, 0.42166],
        "115": [0, 0.43056, 0.08208, 0, 0.40889],
        "116": [0, 0.61508, 0.09486, 0, 0.33222],
        "117": [0, 0.43056, 0.07671, 0, 0.53666],
        "118": [0, 0.43056, 0.10764, 0, 0.46],
        "119": [0, 0.43056, 0.10764, 0, 0.66444],
        "120": [0, 0.43056, 0.12042, 0, 0.46389],
        "121": [0.19444, 0.43056, 0.08847, 0, 0.48555],
        "122": [0, 0.43056, 0.12292, 0, 0.40889],
        "126": [0.35, 0.31786, 0.11585, 0, 0.51111],
        "160": [0, 0, 0, 0, 0.25],
        "168": [0, 0.66786, 0.10474, 0, 0.51111],
        "176": [0, 0.69444, 0, 0, 0.83129],
        "184": [0.17014, 0, 0, 0, 0.46],
        "198": [0, 0.68333, 0.12028, 0, 0.88277],
        "216": [0.04861, 0.73194, 0.09403, 0, 0.76666],
        "223": [0.19444, 0.69444, 0.10514, 0, 0.53666],
        "230": [0, 0.43056, 0.07514, 0, 0.71555],
        "248": [0.09722, 0.52778, 0.09194, 0, 0.51111],
        "338": [0, 0.68333, 0.12028, 0, 0.98499],
        "339": [0, 0.43056, 0.07514, 0, 0.71555],
        "710": [0, 0.69444, 0.06646, 0, 0.51111],
        "711": [0, 0.62847, 0.08295, 0, 0.51111],
        "713": [0, 0.56167, 0.10333, 0, 0.51111],
        "714": [0, 0.69444, 0.09694, 0, 0.51111],
        "715": [0, 0.69444, 0, 0, 0.51111],
        "728": [0, 0.69444, 0.10806, 0, 0.51111],
        "729": [0, 0.66786, 0.11752, 0, 0.30667],
        "730": [0, 0.69444, 0, 0, 0.83129],
        "732": [0, 0.66786, 0.11585, 0, 0.51111],
        "733": [0, 0.69444, 0.1225, 0, 0.51111],
        "915": [0, 0.68333, 0.13305, 0, 0.62722],
        "916": [0, 0.68333, 0, 0, 0.81777],
        "920": [0, 0.68333, 0.09403, 0, 0.76666],
        "923": [0, 0.68333, 0, 0, 0.69222],
        "926": [0, 0.68333, 0.15294, 0, 0.66444],
        "928": [0, 0.68333, 0.16389, 0, 0.74333],
        "931": [0, 0.68333, 0.12028, 0, 0.71555],
        "933": [0, 0.68333, 0.11111, 0, 0.76666],
        "934": [0, 0.68333, 0.05986, 0, 0.71555],
        "936": [0, 0.68333, 0.11111, 0, 0.76666],
        "937": [0, 0.68333, 0.10257, 0, 0.71555],
        "8211": [0, 0.43056, 0.09208, 0, 0.51111],
        "8212": [0, 0.43056, 0.09208, 0, 1.02222],
        "8216": [0, 0.69444, 0.12417, 0, 0.30667],
        "8217": [0, 0.69444, 0.12417, 0, 0.30667],
        "8220": [0, 0.69444, 0.1685, 0, 0.51444],
        "8221": [0, 0.69444, 0.06961, 0, 0.51444],
        "8463": [0, 0.68889, 0, 0, 0.54028],
    },
    "Main-Regular": {
        "32": [0, 0, 0, 0, 0.25],
        "33": [0, 0.69444, 0, 0, 0.27778],
        "34": [0, 0.69444, 0, 0, 0.5],
        "35": [0.19444, 0.69444, 0, 0, 0.83334],
        "36": [0.05556, 0.75, 0, 0, 0.5],
        "37": [0.05556, 0.75, 0, 0, 0.83334],
        "38": [0, 0.69444, 0, 0, 0.77778],
        "39": [0, 0.69444, 0, 0, 0.27778],
        "40": [0.25, 0.75, 0, 0, 0.38889],
        "41": [0.25, 0.75, 0, 0, 0.38889],
        "42": [0, 0.75, 0, 0, 0.5],
        "43": [0.08333, 0.58333, 0, 0, 0.77778],
        "44": [0.19444, 0.10556, 0, 0, 0.27778],
        "45": [0, 0.43056, 0, 0, 0.33333],
        "46": [0, 0.10556, 0, 0, 0.27778],
        "47": [0.25, 0.75, 0, 0, 0.5],
        "48": [0, 0.64444, 0, 0, 0.5],
        "49": [0, 0.64444, 0, 0, 0.5],
        "50": [0, 0.64444, 0, 0, 0.5],
        "51": [0, 0.64444, 0, 0, 0.5],
        "52": [0, 0.64444, 0, 0, 0.5],
        "53": [0, 0.64444, 0, 0, 0.5],
        "54": [0, 0.64444, 0, 0, 0.5],
        "55": [0, 0.64444, 0, 0, 0.5],
        "56": [0, 0.64444, 0, 0, 0.5],
        "57": [0, 0.64444, 0, 0, 0.5],
        "58": [0, 0.43056, 0, 0, 0.27778],
        "59": [0.19444, 0.43056, 0, 0, 0.27778],
        "60": [0.0391, 0.5391, 0, 0, 0.77778],
        "61": [-0.13313, 0.36687, 0, 0, 0.77778],
        "62": [0.0391, 0.5391, 0, 0, 0.77778],
        "63": [0, 0.69444, 0, 0, 0.47222],
        "64": [0, 0.69444, 0, 0, 0.77778],
        "65": [0, 0.68333, 0, 0, 0.75],
        "66": [0, 0.68333, 0, 0, 0.70834],
        "67": [0, 0.68333, 0, 0, 0.72222],
        "68": [0, 0.68333, 0, 0, 0.76389],
        "69": [0, 0.68333, 0, 0, 0.68056],
        "70": [0, 0.68333, 0, 0, 0.65278],
        "71": [0, 0.68333, 0, 0, 0.78472],
        "72": [0, 0.68333, 0, 0, 0.75],
        "73": [0, 0.68333, 0, 0, 0.36111],
        "74": [0, 0.68333, 0, 0, 0.51389],
        "75": [0, 0.68333, 0, 0, 0.77778],
        "76": [0, 0.68333, 0, 0, 0.625],
        "77": [0, 0.68333, 0, 0, 0.91667],
        "78": [0, 0.68333, 0, 0, 0.75],
        "79": [0, 0.68333, 0, 0, 0.77778],
        "80": [0, 0.68333, 0, 0, 0.68056],
        "81": [0.19444, 0.68333, 0, 0, 0.77778],
        "82": [0, 0.68333, 0, 0, 0.73611],
        "83": [0, 0.68333, 0, 0, 0.55556],
        "84": [0, 0.68333, 0, 0, 0.72222],
        "85": [0, 0.68333, 0, 0, 0.75],
        "86": [0, 0.68333, 0.01389, 0, 0.75],
        "87": [0, 0.68333, 0.01389, 0, 1.02778],
        "88": [0, 0.68333, 0, 0, 0.75],
        "89": [0, 0.68333, 0.025, 0, 0.75],
        "90": [0, 0.68333, 0, 0, 0.61111],
        "91": [0.25, 0.75, 0, 0, 0.27778],
        "92": [0.25, 0.75, 0, 0, 0.5],
        "93": [0.25, 0.75, 0, 0, 0.27778],
        "94": [0, 0.69444, 0, 0, 0.5],
        "95": [0.31, 0.12056, 0.02778, 0, 0.5],
        "97": [0, 0.43056, 0, 0, 0.5],
        "98": [0, 0.69444, 0, 0, 0.55556],
        "99": [0, 0.43056, 0, 0, 0.44445],
        "100": [0, 0.69444, 0, 0, 0.55556],
        "101": [0, 0.43056, 0, 0, 0.44445],
        "102": [0, 0.69444, 0.07778, 0, 0.30556],
        "103": [0.19444, 0.43056, 0.01389, 0, 0.5],
        "104": [0, 0.69444, 0, 0, 0.55556],
        "105": [0, 0.66786, 0, 0, 0.27778],
        "106": [0.19444, 0.66786, 0, 0, 0.30556],
        "107": [0, 0.69444, 0, 0, 0.52778],
        "108": [0, 0.69444, 0, 0, 0.27778],
        "109": [0, 0.43056, 0, 0, 0.83334],
        "110": [0, 0.43056, 0, 0, 0.55556],
        "111": [0, 0.43056, 0, 0, 0.5],
        "112": [0.19444, 0.43056, 0, 0, 0.55556],
        "113": [0.19444, 0.43056, 0, 0, 0.52778],
        "114": [0, 0.43056, 0, 0, 0.39167],
        "115": [0, 0.43056, 0, 0, 0.39445],
        "116": [0, 0.61508, 0, 0, 0.38889],
        "117": [0, 0.43056, 0, 0, 0.55556],
        "118": [0, 0.43056, 0.01389, 0, 0.52778],
        "119": [0, 0.43056, 0.01389, 0, 0.72222],
        "120": [0, 0.43056, 0, 0, 0.52778],
        "121": [0.19444, 0.43056, 0.01389, 0, 0.52778],
        "122": [0, 0.43056, 0, 0, 0.44445],
        "123": [0.25, 0.75, 0, 0, 0.5],
        "124": [0.25, 0.75, 0, 0, 0.27778],
        "125": [0.25, 0.75, 0, 0, 0.5],
        "126": [0.35, 0.31786, 0, 0, 0.5],
        "160": [0, 0, 0, 0, 0.25],
        "163": [0, 0.69444, 0, 0, 0.76909],
        "167": [0.19444, 0.69444, 0, 0, 0.44445],
        "168": [0, 0.66786, 0, 0, 0.5],
        "172": [0, 0.43056, 0, 0, 0.66667],
        "176": [0, 0.69444, 0, 0, 0.75],
        "177": [0.08333, 0.58333, 0, 0, 0.77778],
        "182": [0.19444, 0.69444, 0, 0, 0.61111],
        "184": [0.17014, 0, 0, 0, 0.44445],
        "198": [0, 0.68333, 0, 0, 0.90278],
        "215": [0.08333, 0.58333, 0, 0, 0.77778],
        "216": [0.04861, 0.73194, 0, 0, 0.77778],
        "223": [0, 0.69444, 0, 0, 0.5],
        "230": [0, 0.43056, 0, 0, 0.72222],
        "247": [0.08333, 0.58333, 0, 0, 0.77778],
        "248": [0.09722, 0.52778, 0, 0, 0.5],
        "305": [0, 0.43056, 0, 0, 0.27778],
        "338": [0, 0.68333, 0, 0, 1.01389],
        "339": [0, 0.43056, 0, 0, 0.77778],
        "567": [0.19444, 0.43056, 0, 0, 0.30556],
        "710": [0, 0.69444, 0, 0, 0.5],
        "711": [0, 0.62847, 0, 0, 0.5],
        "713": [0, 0.56778, 0, 0, 0.5],
        "714": [0, 0.69444, 0, 0, 0.5],
        "715": [0, 0.69444, 0, 0, 0.5],
        "728": [0, 0.69444, 0, 0, 0.5],
        "729": [0, 0.66786, 0, 0, 0.27778],
        "730": [0, 0.69444, 0, 0, 0.75],
        "732": [0, 0.66786, 0, 0, 0.5],
        "733": [0, 0.69444, 0, 0, 0.5],
        "915": [0, 0.68333, 0, 0, 0.625],
        "916": [0, 0.68333, 0, 0, 0.83334],
        "920": [0, 0.68333, 0, 0, 0.77778],
        "923": [0, 0.68333, 0, 0, 0.69445],
        "926": [0, 0.68333, 0, 0, 0.66667],
        "928": [0, 0.68333, 0, 0, 0.75],
        "931": [0, 0.68333, 0, 0, 0.72222],
        "933": [0, 0.68333, 0, 0, 0.77778],
        "934": [0, 0.68333, 0, 0, 0.72222],
        "936": [0, 0.68333, 0, 0, 0.77778],
        "937": [0, 0.68333, 0, 0, 0.72222],
        "8211": [0, 0.43056, 0.02778, 0, 0.5],
        "8212": [0, 0.43056, 0.02778, 0, 1.0],
        "8216": [0, 0.69444, 0, 0, 0.27778],
        "8217": [0, 0.69444, 0, 0, 0.27778],
        "8220": [0, 0.69444, 0, 0, 0.5],
        "8221": [0, 0.69444, 0, 0, 0.5],
        "8224": [0.19444, 0.69444, 0, 0, 0.44445],
        "8225": [0.19444, 0.69444, 0, 0, 0.44445],
        "8230": [0, 0.123, 0, 0, 1.172],
        "8242": [0, 0.55556, 0, 0, 0.275],
        "8407": [0, 0.71444, 0.15382, 0, 0.5],
        "8463": [0, 0.68889, 0, 0, 0.54028],
        "8465": [0, 0.69444, 0, 0, 0.72222],
        "8467": [0, 0.69444, 0, 0.11111, 0.41667],
        "8472": [0.19444, 0.43056, 0, 0.11111, 0.63646],
        "8476": [0, 0.69444, 0, 0, 0.72222],
        "8501": [0, 0.69444, 0, 0, 0.61111],
        "8592": [-0.13313, 0.36687, 0, 0, 1.0],
        "8593": [0.19444, 0.69444, 0, 0, 0.5],
        "8594": [-0.13313, 0.36687, 0, 0, 1.0],
        "8595": [0.19444, 0.69444, 0, 0, 0.5],
        "8596": [-0.13313, 0.36687, 0, 0, 1.0],
        "8597": [0.25, 0.75, 0, 0, 0.5],
        "8598": [0.19444, 0.69444, 0, 0, 1.0],
        "8599": [0.19444, 0.69444, 0, 0, 1.0],
        "8600": [0.19444, 0.69444, 0, 0, 1.0],
        "8601": [0.19444, 0.69444, 0, 0, 1.0],
        "8614": [0.011, 0.511, 0, 0, 1.0],
        "8617": [0.011, 0.511, 0, 0, 1.126],
        "8618": [0.011, 0.511, 0, 0, 1.126],
        "8636": [-0.13313, 0.36687, 0, 0, 1.0],
        "8637": [-0.13313, 0.36687, 0, 0, 1.0],
        "8640": [-0.13313, 0.36687, 0, 0, 1.0],
        "8641": [-0.13313, 0.36687, 0, 0, 1.0],
        "8652": [0.011, 0.671, 0, 0, 1.0],
        "8656": [-0.13313, 0.36687, 0, 0, 1.0],
        "8657": [0.19444, 0.69444, 0, 0, 0.61111],
        "8658": [-0.13313, 0.36687, 0, 0, 1.0],
        "8659": [0.19444, 0.69444, 0, 0, 0.61111],
        "8660": [-0.13313, 0.36687, 0, 0, 1.0],
        "8661": [0.25, 0.75, 0, 0, 0.61111],
        "8704": [0, 0.69444, 0, 0, 0.55556],
        "8706": [0, 0.69444, 0.05556, 0.08334, 0.5309],
        "8707": [0, 0.69444, 0, 0, 0.55556],
        "8709": [0.05556, 0.75, 0, 0, 0.5],
        "8711": [0, 0.68333, 0, 0, 0.83334],
        "8712": [0.0391, 0.5391, 0, 0, 0.66667],
        "8715": [0.0391, 0.5391, 0, 0, 0.66667],
        "8722": [0.08333, 0.58333, 0, 0, 0.77778],
        "8723": [0.08333, 0.58333, 0, 0, 0.77778],
        "8725": [0.25, 0.75, 0, 0, 0.5],
        "8726": [0.25, 0.75, 0, 0, 0.5],
        "8727": [-0.03472, 0.46528, 0, 0, 0.5],
        "8728": [-0.05555, 0.44445, 0, 0, 0.5],
        "8729": [-0.05555, 0.44445, 0, 0, 0.5],
        "8730": [0.2, 0.8, 0, 0, 0.83334],
        "8733": [0, 0.43056, 0, 0, 0.77778],
        "8734": [0, 0.43056, 0, 0, 1.0],
        "8736": [0, 0.69224, 0, 0, 0.72222],
        "8739": [0.25, 0.75, 0, 0, 0.27778],
        "8741": [0.25, 0.75, 0, 0, 0.5],
        "8743": [0, 0.55556, 0, 0, 0.66667],
        "8744": [0, 0.55556, 0, 0, 0.66667],
        "8745": [0, 0.55556, 0, 0, 0.66667],
        "8746": [0, 0.55556, 0, 0, 0.66667],
        "8747": [0.19444, 0.69444, 0.11111, 0, 0.41667],
        "8764": [-0.13313, 0.36687, 0, 0, 0.77778],
        "8768": [0.19444, 0.69444, 0, 0, 0.27778],
        "8771": [-0.03625, 0.46375, 0, 0, 0.77778],
        "8773": [-0.022, 0.589, 0, 0, 0.778],
        "8776": [-0.01688, 0.48312, 0, 0, 0.77778],
        "8781": [-0.03625, 0.46375, 0, 0, 0.77778],
        "8784": [-0.133, 0.673, 0, 0, 0.778],
        "8801": [-0.03625, 0.46375, 0, 0, 0.77778],
        "8804": [0.13597, 0.63597, 0, 0, 0.77778],
        "8805": [0.13597, 0.63597, 0, 0, 0.77778],
        "8810": [0.0391, 0.5391, 0, 0, 1.0],
        "8811": [0.0391, 0.5391, 0, 0, 1.0],
        "8826": [0.0391, 0.5391, 0, 0, 0.77778],
        "8827": [0.0391, 0.5391, 0, 0, 0.77778],
        "8834": [0.0391, 0.5391, 0, 0, 0.77778],
        "8835": [0.0391, 0.5391, 0, 0, 0.77778],
        "8838": [0.13597, 0.63597, 0, 0, 0.77778],
        "8839": [0.13597, 0.63597, 0, 0, 0.77778],
        "8846": [0, 0.55556, 0, 0, 0.66667],
        "8849": [0.13597, 0.63597, 0, 0, 0.77778],
        "8850": [0.13597, 0.63597, 0, 0, 0.77778],
        "8851": [0, 0.55556, 0, 0, 0.66667],
        "8852": [0, 0.55556, 0, 0, 0.66667],
        "8853": [0.08333, 0.58333, 0, 0, 0.77778],
        "8854": [0.08333, 0.58333, 0, 0, 0.77778],
        "8855": [0.08333, 0.58333, 0, 0, 0.77778],
        "8856": [0.08333, 0.58333, 0, 0, 0.77778],
        "8857": [0.08333, 0.58333, 0, 0, 0.77778],
        "8866": [0, 0.69444, 0, 0, 0.61111],
        "8867": [0, 0.69444, 0, 0, 0.61111],
        "8868": [0, 0.69444, 0, 0, 0.77778],
        "8869": [0, 0.69444, 0, 0, 0.77778],
        "8872": [0.249, 0.75, 0, 0, 0.867],
        "8900": [-0.05555, 0.44445, 0, 0, 0.5],
        "8901": [-0.05555, 0.44445, 0, 0, 0.27778],
        "8902": [-0.03472, 0.46528, 0, 0, 0.5],
        "8904": [0.005, 0.505, 0, 0, 0.9],
        "8942": [0.03, 0.903, 0, 0, 0.278],
        "8943": [-0.19, 0.313, 0, 0, 1.172],
        "8945": [-0.1, 0.823, 0, 0, 1.282],
        "8968": [0.25, 0.75, 0, 0, 0.44445],
        "8969": [0.25, 0.75, 0, 0, 0.44445],
        "8970": [0.25, 0.75, 0, 0, 0.44445],
        "8971": [0.25, 0.75, 0, 0, 0.44445],
        "8994": [-0.14236, 0.35764, 0, 0, 1.0],
        "8995": [-0.14236, 0.35764, 0, 0, 1.0],
        "9136": [0.244, 0.744, 0, 0, 0.412],
        "9137": [0.244, 0.745, 0, 0, 0.412],
        "9651": [0.19444, 0.69444, 0, 0, 0.88889],
        "9657": [-0.03472, 0.46528, 0, 0, 0.5],
        "9661": [0.19444, 0.69444, 0, 0, 0.88889],
        "9667": [-0.03472, 0.46528, 0, 0, 0.5],
        "9711": [0.19444, 0.69444, 0, 0, 1.0],
        "9824": [0.12963, 0.69444, 0, 0, 0.77778],
        "9825": [0.12963, 0.69444, 0, 0, 0.77778],
        "9826": [0.12963, 0.69444, 0, 0, 0.77778],
        "9827": [0.12963, 0.69444, 0, 0, 0.77778],
        "9837": [0, 0.75, 0, 0, 0.38889],
        "9838": [0.19444, 0.69444, 0, 0, 0.38889],
        "9839": [0.19444, 0.69444, 0, 0, 0.38889],
        "10216": [0.25, 0.75, 0, 0, 0.38889],
        "10217": [0.25, 0.75, 0, 0, 0.38889],
        "10222": [0.244, 0.744, 0, 0, 0.412],
        "10223": [0.244, 0.745, 0, 0, 0.412],
        "10229": [0.011, 0.511, 0, 0, 1.609],
        "10230": [0.011, 0.511, 0, 0, 1.638],
        "10231": [0.011, 0.511, 0, 0, 1.859],
        "10232": [0.024, 0.525, 0, 0, 1.609],
        "10233": [0.024, 0.525, 0, 0, 1.638],
        "10234": [0.024, 0.525, 0, 0, 1.858],
        "10236": [0.011, 0.511, 0, 0, 1.638],
        "10815": [0, 0.68333, 0, 0, 0.75],
        "10927": [0.13597, 0.63597, 0, 0, 0.77778],
        "10928": [0.13597, 0.63597, 0, 0, 0.77778],
        "57376": [0.19444, 0.69444, 0, 0, 0],
    },
    "Math-BoldItalic": {
        "32": [0, 0, 0, 0, 0.25],
        "48": [0, 0.44444, 0, 0, 0.575],
        "49": [0, 0.44444, 0, 0, 0.575],
        "50": [0, 0.44444, 0, 0, 0.575],
        "51": [0.19444, 0.44444, 0, 0, 0.575],
        "52": [0.19444, 0.44444, 0, 0, 0.575],
        "53": [0.19444, 0.44444, 0, 0, 0.575],
        "54": [0, 0.64444, 0, 0, 0.575],
        "55": [0.19444, 0.44444, 0, 0, 0.575],
        "56": [0, 0.64444, 0, 0, 0.575],
        "57": [0.19444, 0.44444, 0, 0, 0.575],
        "65": [0, 0.68611, 0, 0, 0.86944],
        "66": [0, 0.68611, 0.04835, 0, 0.8664],
        "67": [0, 0.68611, 0.06979, 0, 0.81694],
        "68": [0, 0.68611, 0.03194, 0, 0.93812],
        "69": [0, 0.68611, 0.05451, 0, 0.81007],
        "70": [0, 0.68611, 0.15972, 0, 0.68889],
        "71": [0, 0.68611, 0, 0, 0.88673],
        "72": [0, 0.68611, 0.08229, 0, 0.98229],
        "73": [0, 0.68611, 0.07778, 0, 0.51111],
        "74": [0, 0.68611, 0.10069, 0, 0.63125],
        "75": [0, 0.68611, 0.06979, 0, 0.97118],
        "76": [0, 0.68611, 0, 0, 0.75555],
        "77": [0, 0.68611, 0.11424, 0, 1.14201],
        "78": [0, 0.68611, 0.11424, 0, 0.95034],
        "79": [0, 0.68611, 0.03194, 0, 0.83666],
        "80": [0, 0.68611, 0.15972, 0, 0.72309],
        "81": [0.19444, 0.68611, 0, 0, 0.86861],
        "82": [0, 0.68611, 0.00421, 0, 0.87235],
        "83": [0, 0.68611, 0.05382, 0, 0.69271],
        "84": [0, 0.68611, 0.15972, 0, 0.63663],
        "85": [0, 0.68611, 0.11424, 0, 0.80027],
        "86": [0, 0.68611, 0.25555, 0, 0.67778],
        "87": [0, 0.68611, 0.15972, 0, 1.09305],
        "88": [0, 0.68611, 0.07778, 0, 0.94722],
        "89": [0, 0.68611, 0.25555, 0, 0.67458],
        "90": [0, 0.68611, 0.06979, 0, 0.77257],
        "97": [0, 0.44444, 0, 0, 0.63287],
        "98": [0, 0.69444, 0, 0, 0.52083],
        "99": [0, 0.44444, 0, 0, 0.51342],
        "100": [0, 0.69444, 0, 0, 0.60972],
        "101": [0, 0.44444, 0, 0, 0.55361],
        "102": [0.19444, 0.69444, 0.11042, 0, 0.56806],
        "103": [0.19444, 0.44444, 0.03704, 0, 0.5449],
        "104": [0, 0.69444, 0, 0, 0.66759],
        "105": [0, 0.69326, 0, 0, 0.4048],
        "106": [0.19444, 0.69326, 0.0622, 0, 0.47083],
        "107": [0, 0.69444, 0.01852, 0, 0.6037],
        "108": [0, 0.69444, 0.0088, 0, 0.34815],
        "109": [0, 0.44444, 0, 0, 1.0324],
        "110": [0, 0.44444, 0, 0, 0.71296],
        "111": [0, 0.44444, 0, 0, 0.58472],
        "112": [0.19444, 0.44444, 0, 0, 0.60092],
        "113": [0.19444, 0.44444, 0.03704, 0, 0.54213],
        "114": [0, 0.44444, 0.03194, 0, 0.5287],
        "115": [0, 0.44444, 0, 0, 0.53125],
        "116": [0, 0.63492, 0, 0, 0.41528],
        "117": [0, 0.44444, 0, 0, 0.68102],
        "118": [0, 0.44444, 0.03704, 0, 0.56666],
        "119": [0, 0.44444, 0.02778, 0, 0.83148],
        "120": [0, 0.44444, 0, 0, 0.65903],
        "121": [0.19444, 0.44444, 0.03704, 0, 0.59028],
        "122": [0, 0.44444, 0.04213, 0, 0.55509],
        "160": [0, 0, 0, 0, 0.25],
        "915": [0, 0.68611, 0.15972, 0, 0.65694],
        "916": [0, 0.68611, 0, 0, 0.95833],
        "920": [0, 0.68611, 0.03194, 0, 0.86722],
        "923": [0, 0.68611, 0, 0, 0.80555],
        "926": [0, 0.68611, 0.07458, 0, 0.84125],
        "928": [0, 0.68611, 0.08229, 0, 0.98229],
        "931": [0, 0.68611, 0.05451, 0, 0.88507],
        "933": [0, 0.68611, 0.15972, 0, 0.67083],
        "934": [0, 0.68611, 0, 0, 0.76666],
        "936": [0, 0.68611, 0.11653, 0, 0.71402],
        "937": [0, 0.68611, 0.04835, 0, 0.8789],
        "945": [0, 0.44444, 0, 0, 0.76064],
        "946": [0.19444, 0.69444, 0.03403, 0, 0.65972],
        "947": [0.19444, 0.44444, 0.06389, 0, 0.59003],
        "948": [0, 0.69444, 0.03819, 0, 0.52222],
        "949": [0, 0.44444, 0, 0, 0.52882],
        "950": [0.19444, 0.69444, 0.06215, 0, 0.50833],
        "951": [0.19444, 0.44444, 0.03704, 0, 0.6],
        "952": [0, 0.69444, 0.03194, 0, 0.5618],
        "953": [0, 0.44444, 0, 0, 0.41204],
        "954": [0, 0.44444, 0, 0, 0.66759],
        "955": [0, 0.69444, 0, 0, 0.67083],
        "956": [0.19444, 0.44444, 0, 0, 0.70787],
        "957": [0, 0.44444, 0.06898, 0, 0.57685],
        "958": [0.19444, 0.69444, 0.03021, 0, 0.50833],
        "959": [0, 0.44444, 0, 0, 0.58472],
        "960": [0, 0.44444, 0.03704, 0, 0.68241],
        "961": [0.19444, 0.44444, 0, 0, 0.6118],
        "962": [0.09722, 0.44444, 0.07917, 0, 0.42361],
        "963": [0, 0.44444, 0.03704, 0, 0.68588],
        "964": [0, 0.44444, 0.13472, 0, 0.52083],
        "965": [0, 0.44444, 0.03704, 0, 0.63055],
        "966": [0.19444, 0.44444, 0, 0, 0.74722],
        "967": [0.19444, 0.44444, 0, 0, 0.71805],
        "968": [0.19444, 0.69444, 0.03704, 0, 0.75833],
        "969": [0, 0.44444, 0.03704, 0, 0.71782],
        "977": [0, 0.69444, 0, 0, 0.69155],
        "981": [0.19444, 0.69444, 0, 0, 0.7125],
        "982": [0, 0.44444, 0.03194, 0, 0.975],
        "1009": [0.19444, 0.44444, 0, 0, 0.6118],
        "1013": [0, 0.44444, 0, 0, 0.48333],
        "57649": [0, 0.44444, 0, 0, 0.39352],
        "57911": [0.19444, 0.44444, 0, 0, 0.43889],
    },
    "Math-Italic": {
        "32": [0, 0, 0, 0, 0.25],
        "48": [0, 0.43056, 0, 0, 0.5],
        "49": [0, 0.43056, 0, 0, 0.5],
        "50": [0, 0.43056, 0, 0, 0.5],
        "51": [0.19444, 0.43056, 0, 0, 0.5],
        "52": [0.19444, 0.43056, 0, 0, 0.5],
        "53": [0.19444, 0.43056, 0, 0, 0.5],
        "54": [0, 0.64444, 0, 0, 0.5],
        "55": [0.19444, 0.43056, 0, 0, 0.5],
        "56": [0, 0.64444, 0, 0, 0.5],
        "57": [0.19444, 0.43056, 0, 0, 0.5],
        "65": [0, 0.68333, 0, 0.13889, 0.75],
        "66": [0, 0.68333, 0.05017, 0.08334, 0.75851],
        "67": [0, 0.68333, 0.07153, 0.08334, 0.71472],
        "68": [0, 0.68333, 0.02778, 0.05556, 0.82792],
        "69": [0, 0.68333, 0.05764, 0.08334, 0.7382],
        "70": [0, 0.68333, 0.13889, 0.08334, 0.64306],
        "71": [0, 0.68333, 0, 0.08334, 0.78625],
        "72": [0, 0.68333, 0.08125, 0.05556, 0.83125],
        "73": [0, 0.68333, 0.07847, 0.11111, 0.43958],
        "74": [0, 0.68333, 0.09618, 0.16667, 0.55451],
        "75": [0, 0.68333, 0.07153, 0.05556, 0.84931],
        "76": [0, 0.68333, 0, 0.02778, 0.68056],
        "77": [0, 0.68333, 0.10903, 0.08334, 0.97014],
        "78": [0, 0.68333, 0.10903, 0.08334, 0.80347],
        "79": [0, 0.68333, 0.02778, 0.08334, 0.76278],
        "80": [0, 0.68333, 0.13889, 0.08334, 0.64201],
        "81": [0.19444, 0.68333, 0, 0.08334, 0.79056],
        "82": [0, 0.68333, 0.00773, 0.08334, 0.75929],
        "83": [0, 0.68333, 0.05764, 0.08334, 0.6132],
        "84": [0, 0.68333, 0.13889, 0.08334, 0.58438],
        "85": [0, 0.68333, 0.10903, 0.02778, 0.68278],
        "86": [0, 0.68333, 0.22222, 0, 0.58333],
        "87": [0, 0.68333, 0.13889, 0, 0.94445],
        "88": [0, 0.68333, 0.07847, 0.08334, 0.82847],
        "89": [0, 0.68333, 0.22222, 0, 0.58056],
        "90": [0, 0.68333, 0.07153, 0.08334, 0.68264],
        "97": [0, 0.43056, 0, 0, 0.52859],
        "98": [0, 0.69444, 0, 0, 0.42917],
        "99": [0, 0.43056, 0, 0.05556, 0.43276],
        "100": [0, 0.69444, 0, 0.16667, 0.52049],
        "101": [0, 0.43056, 0, 0.05556, 0.46563],
        "102": [0.19444, 0.69444, 0.10764, 0.16667, 0.48959],
        "103": [0.19444, 0.43056, 0.03588, 0.02778, 0.47697],
        "104": [0, 0.69444, 0, 0, 0.57616],
        "105": [0, 0.65952, 0, 0, 0.34451],
        "106": [0.19444, 0.65952, 0.05724, 0, 0.41181],
        "107": [0, 0.69444, 0.03148, 0, 0.5206],
        "108": [0, 0.69444, 0.01968, 0.08334, 0.29838],
        "109": [0, 0.43056, 0, 0, 0.87801],
        "110": [0, 0.43056, 0, 0, 0.60023],
        "111": [0, 0.43056, 0, 0.05556, 0.48472],
        "112": [0.19444, 0.43056, 0, 0.08334, 0.50313],
        "113": [0.19444, 0.43056, 0.03588, 0.08334, 0.44641],
        "114": [0, 0.43056, 0.02778, 0.05556, 0.45116],
        "115": [0, 0.43056, 0, 0.05556, 0.46875],
        "116": [0, 0.61508, 0, 0.08334, 0.36111],
        "117": [0, 0.43056, 0, 0.02778, 0.57246],
        "118": [0, 0.43056, 0.03588, 0.02778, 0.48472],
        "119": [0, 0.43056, 0.02691, 0.08334, 0.71592],
        "120": [0, 0.43056, 0, 0.02778, 0.57153],
        "121": [0.19444, 0.43056, 0.03588, 0.05556, 0.49028],
        "122": [0, 0.43056, 0.04398, 0.05556, 0.46505],
        "160": [0, 0, 0, 0, 0.25],
        "915": [0, 0.68333, 0.13889, 0.08334, 0.61528],
        "916": [0, 0.68333, 0, 0.16667, 0.83334],
        "920": [0, 0.68333, 0.02778, 0.08334, 0.76278],
        "923": [0, 0.68333, 0, 0.16667, 0.69445],
        "926": [0, 0.68333, 0.07569, 0.08334, 0.74236],
        "928": [0, 0.68333, 0.08125, 0.05556, 0.83125],
        "931": [0, 0.68333, 0.05764, 0.08334, 0.77986],
        "933": [0, 0.68333, 0.13889, 0.05556, 0.58333],
        "934": [0, 0.68333, 0, 0.08334, 0.66667],
        "936": [0, 0.68333, 0.11, 0.05556, 0.61222],
        "937": [0, 0.68333, 0.05017, 0.08334, 0.7724],
        "945": [0, 0.43056, 0.0037, 0.02778, 0.6397],
        "946": [0.19444, 0.69444, 0.05278, 0.08334, 0.56563],
        "947": [0.19444, 0.43056, 0.05556, 0, 0.51773],
        "948": [0, 0.69444, 0.03785, 0.05556, 0.44444],
        "949": [0, 0.43056, 0, 0.08334, 0.46632],
        "950": [0.19444, 0.69444, 0.07378, 0.08334, 0.4375],
        "951": [0.19444, 0.43056, 0.03588, 0.05556, 0.49653],
        "952": [0, 0.69444, 0.02778, 0.08334, 0.46944],
        "953": [0, 0.43056, 0, 0.05556, 0.35394],
        "954": [0, 0.43056, 0, 0, 0.57616],
        "955": [0, 0.69444, 0, 0, 0.58334],
        "956": [0.19444, 0.43056, 0, 0.02778, 0.60255],
        "957": [0, 0.43056, 0.06366, 0.02778, 0.49398],
        "958": [0.19444, 0.69444, 0.04601, 0.11111, 0.4375],
        "959": [0, 0.43056, 0, 0.05556, 0.48472],
        "960": [0, 0.43056, 0.03588, 0, 0.57003],
        "961": [0.19444, 0.43056, 0, 0.08334, 0.51702],
        "962": [0.09722, 0.43056, 0.07986, 0.08334, 0.36285],
        "963": [0, 0.43056, 0.03588, 0, 0.57141],
        "964": [0, 0.43056, 0.1132, 0.02778, 0.43715],
        "965": [0, 0.43056, 0.03588, 0.02778, 0.54028],
        "966": [0.19444, 0.43056, 0, 0.08334, 0.65417],
        "967": [0.19444, 0.43056, 0, 0.05556, 0.62569],
        "968": [0.19444, 0.69444, 0.03588, 0.11111, 0.65139],
        "969": [0, 0.43056, 0.03588, 0, 0.62245],
        "977": [0, 0.69444, 0, 0.08334, 0.59144],
        "981": [0.19444, 0.69444, 0, 0.08334, 0.59583],
        "982": [0, 0.43056, 0.02778, 0,vw 0.82813],
        "1009": [0.19444, 0.43056, 0, 0.08334, 0.51702],
        "1013": [0, 0.43056, 0, 0.05556, 0.4059],
        "57649": [0, 0.43056, 0, 0.02778, 0.32246],
        "57911": [0.19444, 0.43056, 0, 0.08334, 0.38403],
    },
    "SansSerif-Bold": {
        "32": [0, 0, 0, 0, 0.25],
        "33": [0, 0.69444, 0, 0, 0.36667],
        "34": [0, 0.69444, 0, 0, 0.55834],
        "35": [0.19444, 0.69444, 0, 0, 0.91667],
        "36": [0.05556, 0.75, 0, 0, 0.55],
        "37": [0.05556, 0.75, 0, 0, 1.02912],
        "38": [0, 0.69444, 0, 0, 0.83056],
        "39": [0, 0.69444, 0, 0, 0.30556],
        "40": [0.25, 0.75, 0, 0, 0.42778],
        "41": [0.25, 0.75, 0, 0, 0.42778],
        "42": [0, 0.75, 0, 0, 0.55],
        "43": [0.11667, 0.61667, 0, 0, 0.85556],
        "44": [0.10556, 0.13056, 0, 0, 0.30556],
        "45": [0, 0.45833, 0, 0, 0.36667],
        "46": [0, 0.13056, 0, 0, 0.30556],
        "47": [0.25, 0.75, 0, 0, 0.55],
        "48": [0, 0.69444, 0, 0, 0.55],
        "49": [0, 0.69444, 0, 0, 0.55],
        "50": [0, 0.69444, 0, 0, 0.55],
        "51": [0, 0.69444, 0, 0, 0.55],
        "52": [0, 0.69444, 0, 0, 0.55],
        "53": [0, 0.69444, 0, 0, 0.55],
        "54": [0, 0.69444, 0, 0, 0.55],
        "55": [0, 0.69444, 0, 0, 0.55],
        "56": [0, 0.69444, 0, 0, 0.55],
        "57": [0, 0.69444, 0, 0, 0.55],
        "58": [0, 0.45833, 0, 0, 0.30556],
        "59": [0.10556, 0.45833, 0, 0, 0.30556],
        "61": [-0.09375, 0.40625, 0, 0, 0.85556],
        "63": [0, 0.69444, 0, 0, 0.51945],
        "64": [0, 0.69444, 0, 0, 0.73334],
        "65": [0, 0.69444, 0, 0, 0.73334],
        "66": [0, 0.69444, 0, 0, 0.73334],
        "67": [0, 0.69444, 0, 0, 0.70278],
        "68": [0, 0.69444, 0, 0, 0.79445],
        "69": [0, 0.69444, 0, 0, 0.64167],
        "70": [0, 0.69444, 0, 0, 0.61111],
        "71": [0, 0.69444, 0, 0, 0.73334],
        "72": [0, 0.69444, 0, 0, 0.79445],
        "73": [0, 0.69444, 0, 0, 0.33056],
        "74": [0, 0.69444, 0, 0, 0.51945],
        "75": [0, 0.69444, 0, 0, 0.76389],
        "76": [0, 0.69444, 0, 0, 0.58056],
        "77": [0, 0.69444, 0, 0, 0.97778],
        "78": [0, 0.69444, 0, 0, 0.79445],
        "79": [0, 0.69444, 0, 0, 0.79445],
        "80": [0, 0.69444, 0, 0, 0.70278],
        "81": [0.10556, 0.69444, 0, 0, 0.79445],
        "82": [0, 0.69444, 0, 0, 0.70278],
        "83": [0, 0.69444, 0, 0, 0.61111],
        "84": [0, 0.69444, 0, 0, 0.73334],
        "85": [0, 0.69444, 0, 0, 0.76389],
        "86": [0, 0.69444, 0.01528, 0, 0.73334],
        "87": [0, 0.69444, 0.01528, 0, 1.03889],
        "88": [0, 0.69444, 0, 0, 0.73334],
        "89": [0, 0.69444, 0.0275, 0, 0.73334],
        "90": [0, 0.69444, 0, 0, 0.67223],
        "91": [0.25, 0.75, 0, 0, 0.34306],
        "93": [0.25, 0.75, 0, 0, 0.34306],
        "94": [0, 0.69444, 0, 0, 0.55],
        "95": [0.35, 0.10833, 0.03056, 0, 0.55],
        "97": [0, 0.45833, 0, 0, 0.525],
        "98": [0, 0.69444, 0, 0, 0.56111],
        "99": [0, 0.45833, 0, 0, 0.48889],
        "100": [0, 0.69444, 0, 0, 0.56111],
        "101": [0, 0.45833, 0, 0, 0.51111],
        "102": [0, 0.69444, 0.07639, 0, 0.33611],
        "103": [0.19444, 0.45833, 0.01528, 0, 0.55],
        "104": [0, 0.69444, 0, 0, 0.56111],
        "105": [0, 0.69444, 0, 0, 0.25556],
        "106": [0.19444, 0.69444, 0, 0, 0.28611],
        "107": [0, 0.69444, 0, 0, 0.53056],
        "108": [0, 0.69444, 0, 0, 0.25556],
        "109": [0, 0.45833, 0, 0, 0.86667],
        "110": [0, 0.45833, 0, 0, 0.56111],
        "111": [0, 0.45833, 0, 0, 0.55],
        "112": [0.19444, 0.45833, 0, 0, 0.56111],
        "113": [0.19444, 0.45833, 0, 0, 0.56111],
        "114": [0, 0.45833, 0.01528, 0, 0.37222],
        "115": [0, 0.45833, 0, 0, 0.42167],
        "116": [0, 0.58929, 0, 0, 0.40417],
        "117": [0, 0.45833, 0, 0, 0.56111],
        "118": [0, 0.45833, 0.01528, 0, 0.5],
        "119": [0, 0.45833, 0.01528, 0, 0.74445],
        "120": [0, 0.45833, 0, 0, 0.5],
        "121": [0.19444, 0.45833, 0.01528, 0, 0.5],
        "122": [0, 0.45833, 0, 0, 0.47639],
        "126": [0.35, 0.34444, 0, 0, 0.55],
        "160": [0, 0, 0, 0, 0.25],
        "168": [0, 0.69444, 0, 0, 0.55],
        "176": [0, 0.69444, 0, 0, 0.73334],
        "180": [0, 0.69444, 0, 0, 0.55],
        "184": [0.17014, 0, 0, 0, 0.48889],
        "305": [0, 0.45833, 0, 0, 0.25556],
        "567": [0.19444, 0.45833, 0, 0, 0.28611],
        "710": [0, 0.69444, 0, 0, 0.55],
        "711": [0, 0.63542, 0, 0, 0.55],
        "713": [0, 0.63778, 0, 0, 0.55],
        "728": [0, 0.69444, 0, 0, 0.55],
        "729": [0, 0.69444, 0, 0, 0.30556],
        "730": [0, 0.69444, 0, 0, 0.73334],
        "732": [0, 0.69444, 0, 0, 0.55],
        "733": [0, 0.69444, 0, 0, 0.55],
        "915": [0, 0.69444, 0, 0, 0.58056],
        "916": [0, 0.69444, 0, 0, 0.91667],
        "920": [0, 0.69444, 0, 0, 0.85556],
        "923": [0, 0.69444, 0, 0, 0.67223],
        "926": [0, 0.69444, 0, 0, 0.73334],
        "928": [0, 0.69444, 0, 0, 0.79445],
        "931": [0, 0.69444, 0, 0, 0.79445],
        "933": [0, 0.69444, 0, 0, 0.85556],
        "934": [0, 0.69444, 0, 0, 0.79445],
        "936": [0, 0.69444, 0, 0, 0.85556],
        "937": [0, 0.69444, 0, 0, 0.79445],
        "8211": [0, 0.45833, 0.03056, 0, 0.55],
        "8212": [0, 0.45833, 0.03056, 0, 1.10001],
        "8216": [0, 0.69444, 0, 0, 0.30556],
        "8217": [0, 0.69444, 0, 0, 0.30556],
        "8220": [0, 0.69444, 0, 0, 0.55834],
        "8221": [0, 0.69444, 0, 0, 0.55834],
    },
    "SansSerif-Italic": {
        "32": [0, 0, 0, 0, 0.25],
        "33": [0, 0.69444, 0.05733, 0, 0.31945],
        "34": [0, 0.69444, 0.00316, 0, 0.5],
        "35": [0.19444, 0.69444, 0.05087, 0, 0.83334],
        "36": [0.05556, 0.75, 0.11156, 0, 0.5],
        "37": [0.05556, 0.75, 0.03126, 0, 0.83334],
        "38": [0, 0.69444, 0.03058, 0, 0.75834],
        "39": [0, 0.69444, 0.07816, 0, 0.27778],
        "40": [0.25, 0.75, 0.13164, 0, 0.38889],
        "41": [0.25, 0.75, 0.02536, 0, 0.38889],
        "42": [0, 0.75, 0.11775, 0, 0.5],
        "43": [0.08333, 0.58333, 0.02536, 0, 0.77778],
        "44": [0.125, 0.08333, 0, 0, 0.27778],
        "45": [0, 0.44444, 0.01946, 0, 0.33333],
        "46": [0, 0.08333, 0, 0, 0.27778],
        "47": [0.25, 0.75, 0.13164, 0, 0.5],
        "48": [0, 0.65556, 0.11156, 0, 0.5],
        "49": [0, 0.65556, 0.11156, 0, 0.5],
        "50": [0, 0.65556, 0.11156, 0, 0.5],
        "51": [0, 0.65556, 0.11156, 0, 0.5],
        "52": [0, 0.65556, 0.11156, 0, 0.5],
        "53": [0, 0.65556, 0.11156, 0, 0.5],
        "54": [0, 0.65556, 0.11156, 0, 0.5],
        "55": [0, 0.65556, 0.11156, 0, 0.5],
        "56": [0, 0.65556, 0.11156, 0, 0.5],
        "57": [0, 0.65556, 0.11156, 0, 0.5],
        "58": [0, 0.44444, 0.02502, 0, 0.27778],
        "59": [0.125, 0.44444, 0.02502, 0, 0.27778],
        "61": [-0.13, 0.37, 0.05087, 0, 0.77778],
        "63": [0, 0.69444, 0.11809, 0, 0.47222],
        "64": [0, 0.69444, 0.07555, 0, 0.66667],
        "65": [0, 0.69444, 0, 0, 0.66667],
        "66": [0, 0.69444, 0.08293, 0, 0.66667],
        "67": [0, 0.69444, 0.11983, 0, 0.63889],
        "68": [0, 0.69444, 0.07555, 0, 0.72223],
        "69": [0, 0.69444, 0.11983, 0, 0.59722],
        "70": [0, 0.69444, 0.13372, 0, 0.56945],
        "71": [0, 0.69444, 0.11983, 0, 0.66667],
        "72": [0, 0.69444, 0.08094, 0, 0.70834],
        "73": [0, 0.69444, 0.13372, 0, 0.27778],
        "74": [0, 0.69444, 0.08094, 0, 0.47222],
        "75": [0, 0.69444, 0.11983, 0, 0.69445],
        "76": [0, 0.69444, 0, 0, 0.54167],
        "77": [0, 0.69444, 0.08094, 0, 0.875],
        "78": [0, 0.69444, 0.08094, 0, 0.70834],
        "79": [0, 0.69444, 0.07555, 0, 0.73611],
        "80": [0, 0.69444, 0.08293, 0, 0.63889],
        "81": [0.125, 0.69444, 0.07555, 0, 0.73611],
        "82": [0, 0.69444, 0.08293, 0, 0.64584],
        "83": [0, 0.69444, 0.09205, 0, 0.55556],
        "84": [0, 0.69444, 0.13372, 0, 0.68056],
        "85": [0, 0.69444, 0.08094, 0, 0.6875],
        "86": [0, 0.69444, 0.1615, 0, 0.66667],
        "87": [0, 0.69444, 0.1615, 0, 0.94445],
        "88": [0, 0.69444, 0.13372, 0, 0.66667],
        "89": [0, 0.69444, 0.17261, 0, 0.66667],
        "90": [0, 0.69444, 0.11983, 0, 0.61111],
        "91": [0.25, 0.75, 0.15942, 0, 0.28889],
        "93": [0.25, 0.75, 0.08719, 0, 0.28889],
        "94": [0, 0.69444, 0.0799, 0, 0.5],
        "95": [0.35, 0.09444, 0.08616, 0, 0.5],
        "97": [0, 0.44444, 0.00981, 0, 0.48056],
        "98": [0, 0.69444, 0.03057, 0, 0.51667],
        "99": [0, 0.44444, 0.08336, 0, 0.44445],
        "100": [0, 0.69444, 0.09483, 0, 0.51667],
        "101": [0, 0.44444, 0.06778, 0, 0.44445],
        "102": [0, 0.69444, 0.21705, 0, 0.30556],
        "103": [0.19444, 0.44444, 0.10836, 0, 0.5],
        "104": [0, 0.69444, 0.01778, 0, 0.51667],
        "105": [0, 0.67937, 0.09718, 0, 0.23889],
        "106": [0.19444, 0.67937, 0.09162, 0, 0.26667],
        "107": [0, 0.69444, 0.08336, 0, 0.48889],
        "108": [0, 0.69444, 0.09483, 0, 0.23889],
        "109": [0, 0.44444, 0.01778, 0, 0.79445],
        "110": [0, 0.44444, 0.01778, 0, 0.51667],
        "111": [0, 0.44444, 0.06613, 0, 0.5],
        "112": [0.19444, 0.44444, 0.0389, 0, 0.51667],
        "113": [0.19444, 0.44444, 0.04169, 0, 0.51667],
        "114": [0, 0.44444, 0.10836, 0, 0.34167],
        "115": [0, 0.44444, 0.0778, 0, 0.38333],
        "116": [0, 0.57143, 0.07225, 0, 0.36111],
        "117": [0, 0.44444, 0.04169, 0, 0.51667],
        "118": [0, 0.44444, 0.10836, 0, 0.46111],
        "119": [0, 0.44444, 0.10836, 0, 0.68334],
        "120": [0, 0.44444, 0.09169, 0, 0.46111],
        "121": [0.19444, 0.44444, 0.10836, 0, 0.46111],
        "122": [0, 0.44444, 0.08752, 0, 0.43472],
        "126": [0.35, 0.32659, 0.08826, 0, 0.5],
        "160": [0, 0, 0, 0, 0.25],
        "168": [0, 0.67937, 0.06385, 0, 0.5],
        "176": [0, 0.69444, 0, 0, 0.73752],
        "184": [0.17014, 0, 0, 0, 0.44445],
        "305": [0, 0.44444, 0.04169, 0, 0.23889],
        "567": [0.19444, 0.44444, 0.04169, 0, 0.26667],
        "710": [0, 0.69444, 0.0799, 0, 0.5],
        "711": [0, 0.63194, 0.08432, 0, 0.5],
        "713": [0, 0.60889, 0.08776, 0, 0.5],
        "714": [0, 0.69444, 0.09205, 0, 0.5],
        "715": [0, 0.69444, 0, 0, 0.5],
        "728": [0, 0.69444, 0.09483, 0, 0.5],
        "729": [0, 0.67937, 0.07774, 0, 0.27778],
        "730": [0, 0.69444, 0, 0, 0.73752],
        "732": [0, 0.67659, 0.08826, 0, 0.5],
        "733": [0, 0.69444, 0.09205, 0, 0.5],
        "915": [0, 0.69444, 0.13372, 0, 0.54167],
        "916": [0, 0.69444, 0, 0, 0.83334],
        "920": [0, 0.69444, 0.07555, 0, 0.77778],
        "923": [0, 0.69444, 0, 0, 0.61111],
        "926": [0, 0.69444, 0.12816, 0, 0.66667],
        "928": [0, 0.69444, 0.08094, 0, 0.70834],
        "931": [0, 0.69444, 0.11983, 0, 0.72222],
        "933": [0, 0.69444, 0.09031, 0, 0.77778],
        "934": [0, 0.69444, 0.04603, 0, 0.72222],
        "936": [0, 0.69444, 0.09031, 0, 0.77778],
        "937": [0, 0.69444, 0.08293, 0, 0.72222],
        "8211": [0, 0.44444, 0.08616, 0, 0.5],
        "8212": [0, 0.44444, 0.08616, 0, 1.0],
        "8216": [0, 0.69444, 0.07816, 0, 0.27778],
        "8217": [0, 0.69444, 0.07816, 0, 0.27778],
        "8220": [0, 0.69444, 0.14205, 0, 0.5],
        "8221": [0, 0.69444, 0.00316, 0, 0.5],
    },
    "SansSerif-Regular": {
        "32": [0, 0, 0, 0, 0.25],
        "33": [0, 0.69444, 0, 0, 0.31945],
        "34": [0, 0.69444, 0, 0, 0.5],
        "35": [0.19444, 0.69444, 0, 0, 0.83334],
        "36": [0.05556, 0.75, 0, 0, 0.5],
        "37": [0.05556, 0.75, 0, 0, 0.83334],
        "38": [0, 0.69444, 0, 0, 0.75834],
        "39": [0, 0.69444, 0, 0, 0.27778],
        "40": [0.25, 0.75, 0, 0, 0.38889],
        "41": [0.25, 0.75, 0, 0, 0.38889],
        "42": [0, 0.75, 0, 0, 0.5],
        "43": [0.08333, 0.58333, 0, 0, 0.77778],
        "44": [0.125, 0.08333, 0, 0, 0.27778],
        "45": [0, 0.44444, 0, 0, 0.33333],
        "46": [0, 0.08333, 0, 0, 0.27778],
        "47": [0.25, 0.75, 0, 0, 0.5],
        "48": [0, 0.65556, 0, 0, 0.5],
        "49": [0, 0.65556, 0, 0, 0.5],
        "50": [0, 0.65556, 0, 0, 0.5],
        "51": [0, 0.65556, 0, 0, 0.5],
        "52": [0, 0.65556, 0, 0, 0.5],
        "53": [0, 0.65556, 0, 0, 0.5],
        "54": [0, 0.65556, 0, 0, 0.5],
        "55": [0, 0.65556, 0, 0, 0.5],
        "56": [0, 0.65556, 0, 0, 0.5],
        "57": [0, 0.65556, 0, 0, 0.5],
        "58": [0, 0.44444, 0, 0, 0.27778],
        "59": [0.125, 0.44444, 0, 0, 0.27778],
        "61": [-0.13, 0.37, 0, 0, 0.77778],
        "63": [0, 0.69444, 0, 0, 0.47222],
        "64": [0, 0.69444, 0, 0, 0.66667],
        "65": [0, 0.69444, 0, 0, 0.66667],
        "66": [0, 0.69444, 0, 0, 0.66667],
        "67": [0, 0.69444, 0, 0, 0.63889],
        "68": [0, 0.69444, 0, 0, 0.72223],
        "69": [0, 0.69444, 0, 0, 0.59722],
        "70": [0, 0.69444, 0, 0, 0.56945],
        "71": [0, 0.69444, 0, 0, 0.66667],
        "72": [0, 0.69444, 0, 0, 0.70834],
        "73": [0, 0.69444, 0, 0, 0.27778],
        "74": [0, 0.69444, 0, 0, 0.47222],
        "75": [0, 0.69444, 0, 0, 0.69445],
        "76": [0, 0.69444, 0, 0, 0.54167],
        "77": [0, 0.69444, 0, 0, 0.875],
        "78": [0, 0.69444, 0, 0, 0.70834],
        "79": [0, 0.69444, 0, 0, 0.73611],
        "80": [0, 0.69444, 0, 0, 0.63889],
        "81": [0.125, 0.69444, 0, 0, 0.73611],
        "82": [0, 0.69444, 0, 0, 0.64584],
        "83": [0, 0.69444, 0, 0, 0.55556],
        "84": [0, 0.69444, 0, 0, 0.68056],
        "85": [0, 0.69444, 0, 0, 0.6875],
        "86": [0, 0.69444, 0.01389, 0, 0.66667],
        "87": [0, 0.69444, 0.01389, 0, 0.94445],
        "88": [0, 0.69444, 0, 0, 0.66667],
        "89": [0, 0.69444, 0.025, 0, 0.66667],
        "90": [0, 0.69444, 0, 0, 0.61111],
        "91": [0.25, 0.75, 0, 0, 0.28889],
        "93": [0.25, 0.75, 0, 0, 0.28889],
        "94": [0, 0.69444, 0, 0, 0.5],
        "95": [0.35, 0.09444, 0.02778, 0, 0.5],
        "97": [0, 0.44444, 0, 0, 0.48056],
        "98": [0, 0.69444, 0, 0, 0.51667],
        "99": [0, 0.44444, 0, 0, 0.44445],
        "100": [0, 0.69444, 0, 0, 0.51667],
        "101": [0, 0.44444, 0, 0, 0.44445],
        "102": [0, 0.69444, 0.06944, 0, 0.30556],
        "103": [0.19444, 0.44444, 0.01389, 0, 0.5],
        "104": [0, 0.69444, 0, 0, 0.51667],
        "105": [0, 0.67937, 0, 0, 0.23889],
        "106": [0.19444, 0.67937, 0, 0, 0.26667],
        "107": [0, 0.69444, 0, 0, 0.48889],
        "108": [0, 0.69444, 0, 0, 0.23889],
        "109": [0, 0.44444, 0, 0, 0.79445],
        "110": [0, 0.44444, 0, 0, 0.51667],
        "111": [0, 0.44444, 0, 0, 0.5],
        "112": [0.19444, 0.44444, 0, 0, 0.51667],
        "113": [0.19444, 0.44444, 0, 0, 0.51667],
        "114": [0, 0.44444, 0.01389, 0, 0.34167],
        "115": [0, 0.44444, 0, 0, 0.38333],
        "116": [0, 0.57143, 0, 0, 0.36111],
        "117": [0, 0.44444, 0, 0, 0.51667],
        "118": [0, 0.44444, 0.01389, 0, 0.46111],
        "119": [0, 0.44444, 0.01389, 0, 0.68334],
        "120": [0, 0.44444, 0, 0, 0.46111],
        "121": [0.19444, 0.44444, 0.01389, 0, 0.46111],
        "122": [0, 0.44444, 0, 0, 0.43472],
        "126": [0.35, 0.32659, 0, 0, 0.5],
        "160": [0, 0, 0, 0, 0.25],
        "168": [0, 0.67937, 0, 0, 0.5],
        "176": [0, 0.69444, 0, 0, 0.66667],
        "184": [0.17014, 0, 0, 0, 0.44445],
        "305": [0, 0.44444, 0, 0, 0.23889],
        "567": [0.19444, 0.44444, 0, 0, 0.26667],
        "710": [0, 0.69444, 0, 0, 0.5],
        "711": [0, 0.63194, 0, 0, 0.5],
        "713": [0, 0.60889, 0, 0, 0.5],
        "714": [0, 0.69444, 0, 0, 0.5],
        "715": [0, 0.69444, 0, 0, 0.5],
        "728": [0, 0.69444, 0, 0, 0.5],
        "729": [0, 0.67937, 0, 0, 0.27778],
        "730": [0, 0.69444, 0, 0, 0.66667],
        "732": [0, 0.67659, 0, 0, 0.5],
        "733": [0, 0.69444, 0, 0, 0.5],
        "915": [0, 0.69444, 0, 0, 0.54167],
        "916": [0, 0.69444, 0, 0, 0.83334],
        "920": [0, 0.69444, 0, 0, 0.77778],
        "923": [0, 0.69444, 0, 0, 0.61111],
        "926": [0, 0.69444, 0, 0, 0.66667],
        "928": [0, 0.69444, 0, 0, 0.70834],
        "931": [0, 0.69444, 0, 0, 0.72222],
        "933": [0, 0.69444, 0, 0, 0.77778],
        "934": [0, 0.69444, 0, 0, 0.72222],
        "936": [0, 0.69444, 0, 0, 0.77778],
        "937": [0, 0.69444, 0, 0, 0.72222],
        "8211": [0, 0.44444, 0.02778, 0, 0.5],
        "8212": [0, 0.44444, 0.02778, 0, 1.0],
        "8216": [0, 0.69444, 0, 0, 0.27778],
        "8217": [0, 0.69444, 0, 0, 0.27778],
        "8220": [0, 0.69444, 0, 0, 0.5],
        "8221": [0, 0.69444, 0, 0, 0.5],
    },
    "Script-Regular": {
        "32": [0, 0, 0, 0, 0.25],
        "65": [0, 0.7, 0.22925, 0, 0.80253],
        "66": [0, 0.7, 0.04087, 0, 0.90757],
        "67": [0, 0.7, 0.1689, 0, 0.66619],
        "68": [0, 0.7, 0.09371, 0, 0.77443],
        "69": [0, 0.7, 0.18583, 0, 0.56162],
        "70": [0, 0.7, 0.13634, 0, 0.89544],
        "71": [0, 0.7, 0.17322, 0, 0.60961],
        "72": [0, 0.7, 0.29694, 0, 0.96919],
        "73": [0, 0.7, 0.19189, 0, 0.80907],
        "74": [0.27778, 0.7, 0.19189, 0, 1.05159],
        "75": [0, 0.7, 0.31259, 0, 0.91364],
        "76": [0, 0.7, 0.19189, 0, 0.87373],
        "77": [0, 0.7, 0.15981, 0, 1.08031],
        "78": [0, 0.7, 0.3525, 0, 0.9015],
        "79": [0, 0.7, 0.08078, 0, 0.73787],
        "80": [0, 0.7, 0.08078, 0, 1.01262],
        "81": [0, 0.7, 0.03305, 0, 0.88282],
        "82": [0, 0.7, 0.06259, 0, 0.85],
        "83": [0, 0.7, 0.19189, 0, 0.86767],
        "84": [0, 0.7, 0.29087, 0, 0.74697],
        "85": [0, 0.7, 0.25815, 0, 0.79996],
        "86": [0, 0.7, 0.27523, 0, 0.62204],
        "87": [0, 0.7, 0.27523, 0, 0.80532],
        "88": [0, 0.7, 0.26006, 0, 0.94445],
        "89": [0, 0.7, 0.2939, 0, 0.70961],
        "90": [0, 0.7, 0.24037, 0, 0.8212],
        "160": [0, 0, 0, 0, 0.25],
    },
    "Size1-Regular": {
        "32": [0, 0, 0, 0, 0.25],
        "40": [0.35001, 0.85, 0, 0, 0.45834],
        "41": [0.35001, 0.85, 0, 0, 0.45834],
        "47": [0.35001, 0.85, 0, 0, 0.57778],
        "91": [0.35001, 0.85, 0, 0, 0.41667],
        "92": [0.35001, 0.85, 0, 0, 0.57778],
        "93": [0.35001, 0.85, 0, 0, 0.41667],
        "123": [0.35001, 0.85, 0, 0, 0.58334],
        "125": [0.35001, 0.85, 0, 0, 0.58334],
        "160": [0, 0, 0, 0, 0.25],
        "710": [0, 0.72222, 0, 0, 0.55556],
        "732": [0, 0.72222, 0, 0, 0.55556],
        "770": [0, 0.72222, 0, 0, 0.55556],
        "771": [0, 0.72222, 0, 0, 0.55556],
        "8214": [-0.00099, 0.601, 0, 0, 0.77778],
        "8593": [1e-05, 0.6, 0, 0, 0.66667],
        "8595": [1e-05, 0.6, 0, 0, 0.66667],
        "8657": [1e-05, 0.6, 0, 0, 0.77778],
        "8659": [1e-05, 0.6, 0, 0, 0.77778],
        "8719": [0.25001, 0.75, 0, 0, 0.94445],
        "8720": [0.25001, 0.75, 0, 0, 0.94445],
        "8721": [0.25001, 0.75, 0, 0, 1.05556],
        "8730": [0.35001, 0.85, 0, 0, 1.0],
        "8739": [-0.00599, 0.606, 0, 0, 0.33333],
        "8741": [-0.00599, 0.606, 0, 0, 0.55556],
        "8747": [0.30612, 0.805, 0.19445, 0, 0.47222],
        "8748": [0.306, 0.805, 0.19445, 0, 0.47222],
        "8749": [0.306, 0.805, 0.19445, 0, 0.47222],
        "8750": [0.30612, 0.805, 0.19445, 0, 0.47222],
        "8896": [0.25001, 0.75, 0, 0, 0.83334],
        "8897": [0.25001, 0.75, 0, 0, 0.83334],
        "8898": [0.25001, 0.75, 0, 0, 0.83334],
        "8899": [0.25001, 0.75, 0, 0, 0.83334],
        "8968": [0.35001, 0.85, 0, 0, 0.47222],
        "8969": [0.35001, 0.85, 0, 0, 0.47222],
        "8970": [0.35001, 0.85, 0, 0, 0.47222],
        "8971": [0.35001, 0.85, 0, 0, 0.47222],
        "9168": [-0.00099, 0.601, 0, 0, 0.66667],
        "10216": [0.35001, 0.85, 0, 0, 0.47222],
        "10217": [0.35001, 0.85, 0, 0, 0.47222],
        "10752": [0.25001, 0.75, 0, 0, 1.11111],
        "10753": [0.25001, 0.75, 0, 0, 1.11111],
        "10754": [0.25001, 0.75, 0, 0, 1.11111],
        "10756": [0.25001, 0.75, 0, 0, 0.83334],
        "10758": [0.25001, 0.75, 0, 0, 0.83334],
    },
    "Size2-Regular": {
        "32": [0, 0, 0, 0, 0.25],
        "40": [0.65002, 1.15, 0, 0, 0.59722],
        "41": [0.65002, 1.15, 0, 0, 0.59722],
        "47": [0.65002, 1.15, 0, 0, 0.81111],
        "91": [0.65002, 1.15, 0, 0, 0.47222],
        "92": [0.65002, 1.15, 0, 0, 0.81111],
        "93": [0.65002, 1.15, 0, 0, 0.47222],
        "123": [0.65002, 1.15, 0, 0, 0.66667],
        "125": [0.65002, 1.15, 0, 0, 0.66667],
        "160": [0, 0, 0, 0, 0.25],
        "710": [0, 0.75, 0, 0, 1.0],
        "732": [0, 0.75, 0, 0, 1.0],
        "770": [0, 0.75, 0, 0, 1.0],
        "771": [0, 0.75, 0, 0, 1.0],
        "8719": [0.55001, 1.05, 0, 0, 1.27778],
        "8720": [0.55001, 1.05, 0, 0, 1.27778],
        "8721": [0.55001, 1.05, 0, 0, 1.44445],
        "8730": [0.65002, 1.15, 0, 0, 1.0],
        "8747": [0.86225, 1.36, 0.44445, 0, 0.55556],
        "8748": [0.862, 1.36, 0.44445, 0, 0.55556],
        "8749": [0.862, 1.36, 0.44445, 0, 0.55556],
        "8750": [0.86225, 1.36, 0.44445, 0, 0.55556],
        "8896": [0.55001, 1.05, 0, 0, 1.11111],
        "8897": [0.55001, 1.05, 0, 0, 1.11111],
        "8898": [0.55001, 1.05, 0, 0, 1.11111],
        "8899": [0.55001, 1.05, 0, 0, 1.11111],
        "8968": [0.65002, 1.15, 0, 0, 0.52778],
        "8969": [0.65002, 1.15, 0, 0, 0.52778],
        "8970": [0.65002, 1.15, 0, 0, 0.52778],
        "8971": [0.65002, 1.15, 0, 0, 0.52778],
        "10216": [0.65002, 1.15, 0, 0, 0.61111],
        "10217": [0.65002, 1.15, 0, 0, 0.61111],
        "10752": [0.55001, 1.05, 0, 0, 1.51112],
        "10753": [0.55001, 1.05, 0, 0, 1.51112],
        "10754": [0.55001, 1.05, 0, 0, 1.51112],
        "10756": [0.55001, 1.05, 0, 0, 1.11111],
        "10758": [0.55001, 1.05, 0, 0, 1.11111],
    },
    "Size3-Regular": {
        "32": [0, 0, 0, 0, 0.25],
        "40": [0.95003, 1.45, 0, 0, 0.73611],
        "41": [0.95003, 1.45, 0, 0, 0.73611],
        "47": [0.95003, 1.45, 0, 0, 1.04445],
        "91": [0.95003, 1.45, 0, 0, 0.52778],
        "92": [0.95003, 1.45, 0, 0, 1.04445],
        "93": [0.95003, 1.45, 0, 0, 0.52778],
        "123": [0.95003, 1.45, 0, 0, 0.75],
        "125": [0.95003, 1.45, 0, 0, 0.75],
        "160": [0, 0, 0, 0, 0.25],
        "710": [0, 0.75, 0, 0, 1.44445],
        "732": [0, 0.75, 0, 0, 1.44445],
        "770": [0, 0.75, 0, 0, 1.44445],
        "771": [0, 0.75, 0, 0, 1.44445],
        "8730": [0.95003, 1.45, 0, 0, 1.0],
        "8968": [0.95003, 1.45, 0, 0, 0.58334],
        "8969": [0.95003, 1.45, 0, 0, 0.58334],
        "8970": [0.95003, 1.45, 0, 0, 0.58334],
        "8971": [0.95003, 1.45, 0, 0, 0.58334],
        "10216": [0.95003, 1.45, 0, 0, 0.75],
        "10217": [0.95003, 1.45, 0, 0, 0.75],
    },
    "Size4-Regular": {
        "32": [0, 0, 0, 0, 0.25],
        "40": [1.25003, 1.75, 0, 0, 0.79167],
        "41": [1.25003, 1.75, 0, 0, 0.79167],
        "47": [1.25003, 1.75, 0, 0, 1.27778],
        "91": [1.25003, 1.75, 0, 0, 0.58334],
        "92": [1.25003, 1.75, 0, 0, 1.27778],
        "93": [1.25003, 1.75, 0, 0, 0.58334],
        "123": [1.25003, 1.75, 0, 0, 0.80556],
        "125": [1.25003, 1.75, 0, 0, 0.80556],
        "160": [0, 0, 0, 0, 0.25],
        "710": [0, 0.825, 0, 0, 1.8889],
        "732": [0, 0.825, 0, 0, 1.8889],
        "770": [0, 0.825, 0, 0, 1.8889],
        "771": [0, 0.825, 0, 0, 1.8889],
        "8730": [1.25003, 1.75, 0, 0, 1.0],
        "8968": [1.25003, 1.75, 0, 0, 0.63889],
        "8969": [1.25003, 1.75, 0, 0, 0.63889],
        "8970": [1.25003, 1.75, 0, 0, 0.63889],
        "8971": [1.25003, 1.75, 0, 0, 0.63889],
        "9115": [0.64502, 1.155, 0, 0, 0.875],
        "9116": [1e-05, 0.6, 0, 0, 0.875],
        "9117": [0.64502, 1.155, 0, 0, 0.875],
        "9118": [0.64502, 1.155, 0, 0, 0.875],
        "9119": [1e-05, 0.6, 0, 0, 0.875],
        "9120": [0.64502, 1.155, 0, 0, 0.875],
        "9121": [0.64502, 1.155, 0, 0, 0.66667],
        "9122": [-0.00099, 0.601, 0, 0, 0.66667],
        "9123": [0.64502, 1.155, 0, 0, 0.66667],
        "9124": [0.64502, 1.155, 0, 0, 0.66667],
        "9125": [-0.00099, 0.601, 0, 0, 0.66667],
        "9126": [0.64502, 1.155, 0, 0, 0.66667],
        "9127": [1e-05, 0.9, 0, 0, 0.88889],
        "9128": [0.65002, 1.15, 0, 0, 0.88889],
        "9129": [0.90001, 0, 0, 0, 0.88889],
        "9130": [0, 0.3, 0, 0, 0.88889],
        "9131": [1e-05, 0.9, 0, 0, 0.88889],
        "9132": [0.65002, 1.15, 0, 0, 0.88889],
        "9133": [0.90001, 0, 0, 0, 0.88889],
        "9143": [0.88502, 0.915, 0, 0, 1.05556],
        "10216": [1.25003, 1.75, 0, 0, 0.80556],
        "10217": [1.25003, 1.75, 0, 0, 0.80556],
        "57344": [-0.00499, 0.605, 0, 0, 1.05556],
        "57345": [-0.00499, 0.605, 0, 0, 1.05556],
        "57680": [0, 0.12, 0, 0, 0.45],
        "57681": [0, 0.12, 0, 0, 0.45],
        "57682": [0, 0.12, 0, 0, 0.45],
        "57683": [0, 0.12, 0, 0, 0.45],
    },
    "Typewriter-Regular": {
        "32": [0, 0, 0, 0, 0.525],
        "33": [0, 0.61111, 0, 0, 0.525],
        "34": [0, 0.61111, 0, 0, 0.525],
        "35": [0, 0.61111, 0, 0, 0.525],
        "36": [0.08333, 0.69444, 0, 0, 0.525],
        "37": [0.08333, 0.69444, 0, 0, 0.525],
        "38": [0, 0.61111, 0, 0, 0.525],
        "39": [0, 0.61111, 0, 0, 0.525],
        "40": [0.08333, 0.69444, 0, 0, 0.525],
        "41": [0.08333, 0.69444, 0, 0, 0.525],
        "42": [0, 0.52083, 0, 0, 0.525],
        "43": [-0.08056, 0.53055, 0, 0, 0.525],
        "44": [0.13889, 0.125, 0, 0, 0.525],
        "45": [-0.08056, 0.53055, 0, 0, 0.525],
        "46": [0, 0.125, 0, 0, 0.525],
        "47": [0.08333, 0.69444, 0, 0, 0.525],
        "48": [0, 0.61111, 0, 0, 0.525],
        "49": [0, 0.61111, 0, 0, 0.525],
        "50": [0, 0.61111, 0, 0, 0.525],
        "51": [0, 0.61111, 0, 0, 0.525],
        "52": [0, 0.61111, 0, 0, 0.525],
        "53": [0, 0.61111, 0, 0, 0.525],
        "54": [0, 0.61111, 0, 0, 0.525],
        "55": [0, 0.61111, 0, 0, 0.525],
        "56": [0, 0.61111, 0, 0, 0.525],
        "57": [0, 0.61111, 0, 0, 0.525],
        "58": [0, 0.43056, 0, 0, 0.525],
        "59": [0.13889, 0.43056, 0, 0, 0.525],
        "60": [-0.05556, 0.55556, 0, 0, 0.525],
        "61": [-0.19549, 0.41562, 0, 0, 0.525],
        "62": [-0.05556, 0.55556, 0, 0, 0.525],
        "63": [0, 0.61111, 0, 0, 0.525],
        "64": [0, 0.61111, 0, 0, 0.525],
        "65": [0, 0.61111, 0, 0, 0.525],
        "66": [0, 0.61111, 0, 0, 0.525],
        "67": [0, 0.61111, 0, 0, 0.525],
        "68": [0, 0.61111, 0, 0, 0.525],
        "69": [0, 0.61111, 0, 0, 0.525],
        "70": [0, 0.61111, 0, 0, 0.525],
        "71": [0, 0.61111, 0, 0, 0.525],
        "72": [0, 0.61111, 0, 0, 0.525],
        "73": [0, 0.61111, 0, 0, 0.525],
        "74": [0, 0.61111, 0, 0, 0.525],
        "75": [0, 0.61111, 0, 0, 0.525],
        "76": [0, 0.61111, 0, 0, 0.525],
        "77": [0, 0.61111, 0, 0, 0.525],
        "78": [0, 0.61111, 0, 0, 0.525],
        "79": [0, 0.61111, 0, 0, 0.525],
        "80": [0, 0.61111, 0, 0, 0.525],
        "81": [0.13889, 0.61111, 0, 0, 0.525],
        "82": [0, 0.61111, 0, 0, 0.525],
        "83": [0, 0.61111, 0, 0, 0.525],
        "84": [0, 0.61111, 0, 0, 0.525],
        "85": [0, 0.61111, 0, 0, 0.525],
        "86": [0, 0.61111, 0, 0, 0.525],
        "87": [0, 0.61111, 0, 0, 0.525],
        "88": [0, 0.61111, 0, 0, 0.525],
        "89": [0, 0.61111, 0, 0, 0.525],
        "90": [0, 0.61111, 0, 0, 0.525],
        "91": [0.08333, 0.69444, 0, 0, 0.525],
        "92": [0.08333, 0.69444, 0, 0, 0.525],
        "93": [0.08333, 0.69444, 0, 0, 0.525],
        "94": [0, 0.61111, 0, 0, 0.525],
        "95": [0.09514, 0, 0, 0, 0.525],
        "96": [0, 0.61111, 0, 0, 0.525],
        "97": [0, 0.43056, 0, 0, 0.525],
        "98": [0, 0.61111, 0, 0, 0.525],
        "99": [0, 0.43056, 0, 0, 0.525],
        "100": [0, 0.61111, 0, 0, 0.525],
        "101": [0, 0.43056, 0, 0, 0.525],
        "102": [0, 0.61111, 0, 0, 0.525],
        "103": [0.22222, 0.43056, 0, 0, 0.525],
        "104": [0, 0.61111, 0, 0, 0.525],
        "105": [0, 0.61111, 0, 0, 0.525],
        "106": [0.22222, 0.61111, 0, 0, 0.525],
        "107": [0, 0.61111, 0, 0, 0.525],
        "108": [0, 0.61111, 0, 0, 0.525],
        "109": [0, 0.43056, 0, 0, 0.525],
        "110": [0, 0.43056, 0, 0, 0.525],
        "111": [0, 0.43056, 0, 0, 0.525],
        "112": [0.22222, 0.43056, 0, 0, 0.525],
        "113": [0.22222, 0.43056, 0, 0, 0.525],
        "114": [0, 0.43056, 0, 0, 0.525],
        "115": [0, 0.43056, 0, 0, 0.525],
        "116": [0, 0.55358, 0, 0, 0.525],
        "117": [0, 0.43056, 0, 0, 0.525],
        "118": [0, 0.43056, 0, 0, 0.525],
        "119": [0, 0.43056, 0, 0, 0.525],
        "120": [0, 0.43056, 0, 0, 0.525],
        "121": [0.22222, 0.43056, 0, 0, 0.525],
        "122": [0, 0.43056, 0, 0, 0.525],
        "123": [0.08333, 0.69444, 0, 0, 0.525],
        "124": [0.08333, 0.69444, 0, 0, 0.525],
        "125": [0.08333, 0.69444, 0, 0, 0.525],
        "126": [0, 0.61111, 0, 0, 0.525],
        "127": [0, 0.61111, 0, 0, 0.525],
        "160": [0, 0, 0, 0, 0.525],
        "176": [0, 0.61111, 0, 0, 0.525],
        "184": [0.19445, 0, 0, 0, 0.525],
        "305": [0, 0.43056, 0, 0, 0.525],
        "567": [0.22222, 0.43056, 0, 0, 0.525],
        "711": [0, 0.56597, 0, 0, 0.525],
        "713": [0, 0.56555, 0, 0, 0.525],
        "714": [0, 0.61111, 0, 0, 0.525],
        "715": [0, 0.61111, 0, 0, 0.525],
        "728": [0, 0.61111, 0, 0, 0.525],
        "730": [0, 0.61111, 0, 0, 0.525],
        "770": [0, 0.61111, 0, 0, 0.525],
        "771": [0, 0.61111, 0, 0, 0.525],
        "776": [0, 0.61111, 0, 0, 0.525],
        "915": [0, 0.61111, 0, 0, 0.525],
        "916": [0, 0.61111, 0, 0, 0.525],
        "920": [0, 0.61111, 0, 0, 0.525],
        "923": [0, 0.61111, 0, 0, 0.525],
        "926": [0, 0.61111, 0, 0, 0.525],
        "928": [0, 0.61111, 0, 0, 0.525],
        "931": [0, 0.61111, 0, 0, 0.525],
        "933": [0, 0.61111, 0, 0, 0.525],
        "934": [0, 0.61111, 0, 0, 0.525],
        "936": [0, 0.61111, 0, 0, 0.525],
        "937": [0, 0.61111, 0, 0, 0.525],
        "8216": [0, 0.61111, 0, 0, 0.525],
        "8217": [0, 0.61111, 0, 0, 0.525],
        "8242": [0, 0.61111, 0, 0, 0.525],
        "9251": [0.11111, 0.21944, 0, 0, 0.525],
    },
};
BSx100644 Makefile -_raz)S藠O100644 default.cfg ,9kT,OK^jyx100644 generate_fonts.py -{s=η.Wչ,w40000 lib 1& m;倲ъ2*IM100644 makeBlacker isqB7j6ײ100644 makeFF `m_ӿ?A9'P<GL100644 xbbold.mf dh<Kd/:RiL|dѱxQ#!gmake
#
# Version: Apache License 2.0
#
# Copyright (c) 2013 MathJax Project
# Copyright (c) 2013 The MathJax Consortium
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#

CUSTOM=custom.cfg

-include $(CUSTOM)

MFTRACE_MODIFIED=lib/mftrace-modified

all: config fonts

$(CUSTOM):
	@cp default.cfg $(CUSTOM);

$(CUSTOM).pl: $(CUSTOM)
	@echo "Creating Perl config file..."
	@cp $(CUSTOM) $(CUSTOM).pl
	@echo >> $(CUSTOM).pl # ensure that the config file ends by a new line
	@echo "MFTRACE_PATH=`$(WHICH) $(MFTRACE)`" >> $(CUSTOM).pl
	@$(SED) -i "s|^\([A-Z_0-9]*\)=\(.*\)|$$\1='\2';|" $(CUSTOM).pl
	@echo "1;" >> $(CUSTOM).pl

.PHONY: config
config: $(CUSTOM).pl

blacker: $(MFTRACE_MODIFIED)
$(MFTRACE_MODIFIED):
	$(PERL) -I. makeBlacker 15 # values between 10 and 30 seem best

pfa: $(MFTRACE_MODIFIED)
	@echo "cmr10"
	$(PYTHON) $(MFTRACE_MODIFIED) --magnification 1000 --simplify cmr10

	@echo "cmmi10"
	$(PYTHON) $(MFTRACE_MODIFIED) --magnification 1000 --encoding $(TETEXENCODING)/aae443f0.enc --simplify cmmi10

	@echo "cmsy10"
	$(PYTHON) $(MFTRACE_MODIFIED) --magnification 1000 --encoding $(TETEXENCODING)/10037936.enc --simplify cmsy10

	@echo "cmex10"
	$(PYTHON) $(MFTRACE_MODIFIED) --magnification 1000 --simplify cmex10

	@echo "cmbx10"
	$(PYTHON) $(MFTRACE_MODIFIED) --magnification 1000 --simplify cmbx10

	@echo "cmbxti10"
	$(PYTHON) $(MFTRACE_MODIFIED) --magnification 1000 --simplify cmbxti10

	@echo "cmti10"
	$(PYTHON) $(MFTRACE_MODIFIED) --magnification 1000 --simplify cmti10

	@echo "msam10"
	$(PYTHON) $(MFTRACE_MODIFIED) --magnification 1000 --simplify --encoding $(TETEXENCODING)/10037936.enc msam10

	@echo "msbm10"
	$(PYTHON) $(MFTRACE_MODIFIED) --magnification 1000 --simplify --encoding $(TETEXENCODING)/10037936.enc msbm10

	@echo "cmmib10"
	$(PYTHON) $(MFTRACE_MODIFIED) --magnification 1000 --encoding $(TETEXENCODING)/aae443f0.enc --simplify cmmib10

	@echo "cmbsy10"
	$(PYTHON) $(MFTRACE_MODIFIED) --magnification 1000 --encoding $(TETEXENCODING)/10037936.enc --simplify cmbsy10

	@echo "cmtt10"
	$(PYTHON) $(MFTRACE_MODIFIED) --magnification 1000 --simplify cmtt10

	@echo "cmss10"
	$(PYTHON) $(MFTRACE_MODIFIED) --magnification 1000 --simplify cmss10
	@echo "cmssi10"
	$(PYTHON) $(MFTRACE_MODIFIED) --magnification 1000 --simplify cmssi10
	@echo "cmssbx10"
	$(PYTHON) $(MFTRACE_MODIFIED) --magnification 1000 --simplify cmssbx10

	@echo "eufm10"
	cp "`$(KPSEWHICH) eufm10.pfb`" eufm10.pfb
	@echo "eufb10"
	cp "`$(KPSEWHICH) eufb10.pfb`" eufb10.pfb

	# echo "eusm10"
	# $(PYTHON) $(MFTRACE_MODIFIED) --magnification 1000 --simplify eusm10
	# echo "eusb10"
	# $(PYTHON) $(MFTRACE_MODIFIED) --magnification 1000 --simplify eusb10

	@echo "rsfs10"
	$(PYTHON) $(MFTRACE_MODIFIED) --magnification 1000 --simplify --encoding $(BASEENCODING)/tex256.enc rsfs10

	mkdir -p pfa
	rm -f pfa/*
	mv *.pfa pfa
	mv *.pfb pfa

ff: pfa
	mkdir -p ff otf
	rm -f ff/* otf/*
	$(PERL) -I. makeFF

.PHONY: fonts
fonts: ff
	mkdir -p ttf woff woff2
	rm -f ttf/* woff/* woff2/*

	@for file in `ls ff/*.ff | $(SED) 's|ff/\(.*\)\.ff|\1|'`; do \
		echo ""; \
		echo $$file; \
		$(FONTFORGE) -lang=ff -script ff/$$file.ff; \
		\
		echo "Hinting $$file"; \
		if echo "$$file" | $(GREP) -q -e "Size[1-4]" -e "Typewriter"; then \
			$(TTFAUTOHINT) -f none -S --windows-compatibility --symbol ttf/$$file.ttf ttf/$$file.ttf.hinted; \
		else \
			$(TTFAUTOHINT) -f none -S --windows-compatibility ttf/$$file.ttf ttf/$$file.ttf.hinted; \
		fi; \
		mv ttf/$$file.ttf.hinted ttf/$$file.ttf; \
		\
		echo "Generating $$file..."; \
		$(PYTHON) generate_fonts.py ttf/$$file.ttf; \
		done

clean:
	rm -f $(CUSTOM).pl
	rm -f $(MFTRACE_MODIFIED) lib/blacker.mf
	rm -rf pfa ff otf ttf woff woff2
o!x# Note: paths should be absolute, unless they point to programs in your $PATH.

##### Standard programs #####
GREP=grep
PERL=perl
PYTHON=python3
SED=sed
WHICH=which
KPSEWHICH=kpsewhich

##### Font tools #####
# Most of the tools below are standard and should be available from your package manager.
FONTFORGE=fontforge
MFTRACE=mftrace
TTX=ttx
TTFAUTOHINT=ttfautohint

##### TeXLive Encoding
TETEXENCODING=/usr/share/texlive/texmf-texlive/fonts/enc/dvips/tetex/
BASEENCODING=/usr/share/texlive/texmf-texlive/fonts/enc/dvips/base/
 ax#!/usr/bin/env python3

import sys
import os
import json

from fontTools.ttLib import TTFont, sfnt
from fontTools.misc.timeTools import timestampNow
sfnt.USE_ZOPFLI = True

if len(sys.argv) < 2:
    print("Usage: %s <font file>" % sys.argv[0])
    sys.exit(1)

font_file = sys.argv[1]
font_name = os.path.splitext(os.path.basename(font_file))[0]


font = TTFont(font_file, recalcBBoxes=False, recalcTimestamp=False)

# fix timestamp to the epoch
font['head'].created = 0
font['head'].modified = 0

# remove fontforge timestamps
if 'FFTM' in font:
    del font['FFTM']

# remove redundant GDEF table
if 'GDEF' in font:
    del font['GDEF']

# remove Macintosh table
# https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6cmap.html
font['name'].names = [record for record in font['name'].names if record.platformID != 1]
font['cmap'].tables = [table for table in font['cmap'].tables if table.platformID != 1]

# fix OS/2 and hhea metrics
glyf = font['glyf']
ascent = int(max(glyf[c].yMax for c in font.getGlyphOrder() if hasattr(glyf[c], "yMax")))
descent = -int(min(glyf[c].yMin for c in font.getGlyphOrder() if hasattr(glyf[c], "yMin")))

font['OS/2'].usWinAscent = ascent
font['OS/2'].usWinDescent = descent

font['hhea'].ascent = ascent
font['hhea'].descent = -descent

# save TTF
font.save(font_file, reorderTables=None)

# save WOFF
font.flavor = 'woff'
font.save(os.path.join('woff', font_name + '.woff'), reorderTables=None)

# save WOFF2
font.flavor = 'woff2'
font.save(os.path.join('woff2', font_name + '.woff2'), reorderTables=None)
*S
xJ 100644 Extra.otf OʍmےG!\100644 Space.ttx J
3,pnvSx4OTTO 
    CFF CN  p   FFTMTX|     OS/2TZ     `cmap     Bhead-      6hhead      $hmtx      maxp P      namef  p  post 3  P          *_<     u    u   x              x   Z                  P               1   	                     PfEd     8 Z x                                                %       " s                          	        	  
   	     	  D -  	  
   	      	  
     E x t r a  Extra  R e g u l a r  Regular  F o n t F o r g e   2 . 0   :   E x t r a   :   1 2 - 1 0 - 2 0 0 9  FontForge 2.0 : Extra : 12-10-2009  E x t r a  Extra  V e r s i o n   0 0 1 . 0 0 0    Version 001.000   E x t r a  Extra                 <                _   _                                                                                                                                                                                                                                                                                 2                     Extra   - . X   [       ExtraExtra    @ "0E\wE\E88$

          e    t    u5=xv<?xml version="1.0" encoding="UTF-8"?>
<ttFont sfntVersion="OTTO" ttLibVersion="3.28">

  <GlyphOrder>
    <!-- The 'id' attribute is only for humans; it is ignored when parsed. -->
    <GlyphID id="0" name=".notdef"/>
    <GlyphID id="1" name="space"/>
    <GlyphID id="2" name="uni00A0"/>
  </GlyphOrder>

  <head>
    <!-- Most of this table will be recalculated by the compiler -->
    <tableVersion value="1.0"/>
    <fontRevision value="1.0"/>
    <checkSumAdjustment value="0xa98c8795"/>
    <magicNumber value="0x5f0f3cf5"/>
    <flags value="00000000 00000011"/>
    <unitsPerEm value="1000"/>
    <created value="Sun Jan 24 23:04:46 2010"/>
    <modified value="Sat May 14 12:26:22 2011"/>
    <xMin value="50"/>
    <yMin value="0"/>
    <xMax value="200"/>
    <yMax value="533"/>
    <macStyle value="00000000 00000000"/>
    <lowestRecPPEM value="8"/>
    <fontDirectionHint value="2"/>
    <indexToLocFormat value="0"/>
    <glyphDataFormat value="0"/>
  </head>

  <hhea>
    <tableVersion value="0x00010000"/>
    <ascent value="800"/>
    <descent value="-200"/>
    <lineGap value="90"/>
    <advanceWidthMax value="250"/>
    <minLeftSideBearing value="50"/>
    <minRightSideBearing value="50"/>
    <xMaxExtent value="200"/>
    <caretSlopeRise value="1"/>
    <caretSlopeRun value="0"/>
    <caretOffset value="0"/>
    <reserved0 value="0"/>
    <reserved1 value="0"/>
    <reserved2 value="0"/>
    <reserved3 value="0"/>
    <metricDataFormat value="0"/>
    <numberOfHMetrics value="1"/>
  </hhea>

  <maxp>
    <tableVersion value="0x5000"/>
    <numGlyphs value="3"/>
  </maxp>

  <OS_2>
    <!-- The fields 'usFirstCharIndex' and 'usLastCharIndex'
         will be recalculated by the compiler -->
    <version value="2"/>
    <xAvgCharWidth value="225"/>
    <usWeightClass value="400"/>
    <usWidthClass value="5"/>
    <fsType value="00000000 00000000"/>
    <ySubscriptXSize value="650"/>
    <ySubscriptYSize value="700"/>
    <ySubscriptXOffset value="0"/>
    <ySubscriptYOffset value="140"/>
    <ySuperscriptXSize value="650"/>
    <ySuperscriptYSize value="700"/>
    <ySuperscriptXOffset value="0"/>
    <ySuperscriptYOffset value="480"/>
    <yStrikeoutSize value="49"/>
    <yStrikeoutPosition value="258"/>
    <sFamilyClass value="0"/>
    <panose>
      <bFamilyType value="0"/>
      <bSerifStyle value="0"/>
      <bWeight value="0"/>
      <bProportion value="0"/>
      <bContrast value="0"/>
      <bStrokeVariation value="0"/>
      <bArmStyle value="0"/>
      <bLetterForm value="0"/>
      <bMidline value="0"/>
      <bXHeight value="0"/>
    </panose>
    <ulUnicodeRange1 value="10000000 00000000 00000000 11101111"/>
    <ulUnicodeRange2 value="00010000 00000000 11101100 11101101"/>
    <ulUnicodeRange3 value="00000000 00000000 00000000 00000000"/>
    <ulUnicodeRange4 value="00000000 00000000 00000000 00000000"/>
    <achVendID value="PfEd"/>
    <fsSelection value="00000000 01000000"/>
    <usFirstCharIndex value="32"/>
    <usLastCharIndex value="160"/>
    <sTypoAscender value="800"/>
    <sTypoDescender value="-200"/>
    <sTypoLineGap value="90"/>
    <usWinAscent value="533"/>
    <usWinDescent value="0"/>
    <ulCodePageRange1 value="00100000 00000000 00000000 10001111"/>
    <ulCodePageRange2 value="01011110 00000011 00000000 00000000"/>
    <sxHeight value="0"/>
    <sCapHeight value="0"/>
    <usDefaultChar value="32"/>
    <usBreakChar value="32"/>
    <usMaxContext value="1"/>
  </OS_2>

  <name>
    <namerecord nameID="0" platformID="3" platEncID="1" langID="0x409">
      Copyright (c) 2009-2010 Design Science, Inc.
Copyright (c) 2014-2018 Khan Academy
    </namerecord>
    <namerecord nameID="1" platformID="3" platEncID="1" langID="0x409">
      *NAME*
    </namerecord>
    <namerecord nameID="2" platformID="3" platEncID="1" langID="0x409">
      *WEIGHT_S*
    </namerecord>
    <namerecord nameID="3" platformID="3" platEncID="1" langID="0x409">
      FontForge 2.0 : *NAME*-*WEIGHT*
    </namerecord>
    <namerecord nameID="4" platformID="3" platEncID="1" langID="0x409">
      *NAME*-*WEIGHT*
    </namerecord>
    <namerecord nameID="5" platformID="3" platEncID="1" langID="0x409">
      Version 1.1
    </namerecord>
    <namerecord nameID="6" platformID="3" platEncID="1" langID="0x409">
      *NAME*-*WEIGHT*
    </namerecord>
    <namerecord nameID="13" platformID="3" platEncID="1" langID="0x409">
      Copyright (c) 2009-2010, Design Science, Inc. (&lt;www.mathjax.org&gt;)
Copyright (c) 2014-2018 Khan Academy (&lt;www.khanacademy.org&gt;),
with Reserved Font Name *NAME*.

This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license available with a FAQ at:
http://scripts.sil.org/OFL
    </namerecord>
    <namerecord nameID="14" platformID="3" platEncID="1" langID="0x409">
      http://scripts.sil.org/OFL
    </namerecord>
  </name>

  <cmap>
    <tableVersion version="0"/>
    <cmap_format_4 platformID="0" platEncID="3" language="0">
      <map code="0x20" name="space"/><!-- SPACE -->
      <map code="0xa0" name="uni00A0"/><!-- NO-BREAK SPACE -->
    </cmap_format_4>
    <cmap_format_4 platformID="3" platEncID="1" language="0">
      <map code="0x20" name="space"/><!-- SPACE -->
      <map code="0xa0" name="uni00A0"/><!-- NO-BREAK SPACE -->
    </cmap_format_4>
  </cmap>

  <post>
    <formatType value="3.0"/>
    <italicAngle value="0.0"/>
    <underlinePosition value="-125"/>
    <underlineThickness value="50"/>
    <isFixedPitch value="0"/>
    <minMemType42 value="0"/>
    <maxMemType42 value="0"/>
    <minMemType1 value="0"/>
    <maxMemType1 value="0"/>
  </post>

  <CFF>
    <major value="1"/>
    <minor value="0"/>
    <CFFFont name="*NAME*-*WEIGHT*">
      <version value="001.001"/>
      <Notice value="Copyright (c) 2009-2010 Design Science, Inc., Copyright (c) 2014-2018 Khan Academy"/>
      <FullName value="*NAME*-*WEIGHT*"/>
      <FamilyName value="*NAME*"/>
      <Weight value="*NORMAL*"/>
      <isFixedPitch value="0"/>
      <ItalicAngle value="0"/>
      <UnderlinePosition value="-150"/>
      <UnderlineThickness value="50"/>
      <PaintType value="0"/>
      <CharstringType value="2"/>
      <FontMatrix value="0.001 0 0 0.001 0 0"/>
      <FontBBox value="50 0 200 533"/>
      <StrokeWidth value="0"/>
      <!-- charset is dumped separately as the 'GlyphOrder' element -->
      <Encoding name="StandardEncoding"/>
      <Private>
        <BlueScale value="0.03963"/>
        <BlueShift value="0"/>
        <BlueFuzz value="1"/>
        <StdHW value="50"/>
        <StdVW value="50"/>
        <ForceBold value="0"/>
        <LanguageGroup value="0"/>
        <ExpansionFactor value="0.06"/>
        <initialRandomSeed value="0"/>
        <defaultWidthX value="250"/>
        <nominalWidthX value="193"/>
      </Private>
      <CharStrings>
        <CharString name=".notdef">
          0 50 433 50 hstem
          50 50 50 50 vstem
          50 hmoveto
          150 533 -150 hlineto
          50 -483 rmoveto
          433 50 -433 vlineto
          endchar
        </CharString>
        <CharString name="space">
          endchar
        </CharString>
        <CharString name="uni00A0">
          endchar
        </CharString>
      </CharStrings>
    </CFFFont>

    <GlobalSubrs>
      <!-- The 'index' attribute is only for humans; it is ignored when parsed. -->
    </GlobalSubrs>
  </CFF>

  <hmtx>
    <mtx name=".notdef" width="250" lsb="50"/>
    <mtx name="space" width="250" lsb="0"/>
    <mtx name="uni00A0" width="250" lsb="0"/>
  </hmtx>

</ttFont>
WjYFxi#! /usr/bin/perl

#  Creates the metafont file needed for darker copies of the TeX fonts,
#  and modifies mftrace to use it.
#
#  Usage:  ./makeBlacker blackness

require "custom.cfg.pl";

$blacker = shift;
unless ($blacker) {
  print stderr "Usage:  ./makeBlacker blackness\n";
  exit;
}

sub editMftrace {
  my $oldMFTRACE = $MFTRACE_PATH;
  $MFTRACE = "./lib/mftrace-modified";
  print "Editing mftrace\n";
  open(MFT,$oldMFTRACE) || die "Can't read '$oldMFTRACE': $!\n";
  my $MFT = join("",<MFT>);
  close(MFT);
  $MFT =~ s!r"mf '\\mode:=(?:[^;]*)(; [^"]*)"!r"""mf '\\smode:="lib/blacker.mf"$1"""!;
  open(MFT,">$MFTRACE") || die "Can't write '$MFTRACE': $!\n";
  print MFT $MFT;
  close(MFT);
  chmod 0755, $MFTRACE;
}

sub makeBlackerMF {
  my $blacker = shift;
  print "Using blacker = $blacker\n";
  open(BLACKER,">lib/blacker.mf") || die "Can't write 'lib/blacker.mf': $!\n";
  print BLACKER << "  END";
    proofing:=0;
    fontmaking:=1;
    tracingtitles:=0;
    pixels_per_inch:=1200;
    blacker:=$blacker;
    fillin:=0;
    o_correction:=1;
  END
  close(BLACKER);
}

editMftrace();
makeBlackerMF($blacker);

1;
%Rx3#! /usr/bin/perl

#  Creates the FontForge files needed to create the
#  KaTeX fonts from the TeX source files, constructing some
#  glyphs from two or more parts, when needed.
#
#  Usage:  ./makeFF

require "custom.cfg.pl";

#########################################################################

$map{cmr10} = {
  "Main-Regular" => [
    [0,1] => 0x393,         # \Gamma, \Delta
    2 => 0x398,             # \Theta
    3 => 0x39B,             # \Lambda
    4 => 0x39E,             # \Xi
    5 => 0x3A0,             # \Pi
    6 => 0x3A3,             # \Sigma
    [7,8] => 0x3A5,         # \Upsilon, \Phi
    [9,0xA] => 0x3A8,       # \Psi, \Omega

    0x10 => 0x131,          # \i
    0x11 => 0x237,          # \j
    0x12 => 0x2CB,          # \grave
    0x13 => 0x2CA,          # \acute
    0x14 => 0x2C7,          # \check
    0x15 => 0x2D8,          # \breve
    0x16 => 0x2C9,          # \bar
    0x17 => [0xB0,-125,0],  # \degree
    0x17 => 0x02DA,         # \r, ring above
    0x18 => 0xB8,           # \c, cedilla

    [0x21,0x2F] => 0x21,    # !, ", #, $, %, &, ', (, ), *, +, comma, -, ., /
    0x22 => 0x201D,         # "
    0x27 => 0x2019,         # '
    [0x30,0x39] => 0x30,    # 0-9
    [0x3A,0x3B] => 0x3A,    # :, ;
    0x3D => 0x3D,           # =
    [0x3F,0x40] => 0x3F,    # ?, @
    [0x41,0x5A] => 0x41,    # A-Z
    0x5B => 0x5B,           # [
    0x5C => 0x201C,         # ``
    [0x5D,0x5E] => 0x5D,    # ], ^
    0x5E => 0x2C6,          # \hat
    0x5F => 0x2D9,          # \dot
    0x60 => 0x2018,         # `
    [0x61,0x7A] => 0x61,    # a-z
    [0x7B,0x7C] => 0x2013,  # \endash, \emdash
    0x7B => [0x5F,0,-310],  # underline
    0x7D => 0x2DD,          # double acute
    0x7E => [0x7E,0,-350],  # ~
    0x7E => 0x2DC,          # \tilde
    0x7F => 0xA8,           # \ddot
    0x19 => 0xDF,           # sharp S
    0x1A => 0xE6,           # ae ligature
    0x1B => 0x153,          # oe ligature
    0x1C => 0xF8,           # o with slash
    0x1D => 0xC6,           # AE ligature
    0x1E => 0x152,          # OE ligature
    0x1F => 0xD8,           # O with slash
  ],
};

$map{cmmi10} = {
  "Math-Italic" => [
    [0,1] => 0x393,         # \Gamma, \Delta
    2 => 0x398,             # \Theta
    3 => 0x39B,             # \Lambda
    4 => 0x39E,             # \Xi
    5 => 0x3A0,             # \Pi
    6 => 0x3A3,             # \Sigma
    [7,8] => 0x3A5,         # \Upsilon, \Phi
    [9,0xA] => 0x3A8,       # \Psi, \Omega

    [0xB,0xE] => 0x3B1,     # \alpha, \beta, \gamma, \delta
    0xF => 0x3F5,           # \elpsilon
    [0x10,0x18] => 0x3B6,   # \zeta, \eta, \theta, \iota, \kappa, \lambda, \mu, \nu, \xi
    [0x19,0x1A] => 0x3C0,   # \pi, \rho
    [0x1B,0x1D] => 0x3C3,   # \sigma, \tau, \upsilon
    0x1E => 0x3D5,          # \phi
    [0x1F,0x21] => 0x3C7,   # \chi, \psi, \omega
    0x22 => 0x3B5,          # \varepsilon
    0x23 => 0x3D1,          # \vartheta
    0x24 => 0x3D6,          # \varpi
    0x25 => 0x3F1,          # \varrho
    0x26 => 0x3C2,          # \varsigma
    0x27 => 0x3C6,          # \varphi

    [0x41,0x5A] => 0x41,    # A-Z
    [0x61,0x7A] => 0x61,    # a - z
    [0x30,0x39] => 0x30,    # Oldstyle 0-9

    0x6F => 0x3BF,          # omicron
    0x7B => 0xE131,         # \imath (These differ from \i and \j, so use PUA character)
    0x7C => 0xE237,         # \jmath
  ],

  "Main-Regular" => [
    0x28 => 0x21BC,         # \leftharpoonup
    0x29 => 0x21BD,         # \leftharpoondown
    0x2A => 0x21C0,         # \rightharpoonup
    0x2B => 0x21C1,         # \rightharpoondown

    0x2E => 0x25B9,         # \triangleright
    0x2F => 0x25C3,         # \triangleleft

    0x3A => 0x2E,           # .
    0x3B => 0x2C,           # ,
    0x3C => 0x3C,           # <
    0x3D => 0x2215,         # /
    0x3E => 0x3E,           # >
    0x3F => 0x22C6,         # \star
    0x40 => 0x2202,         # \partial

    [0x5B,0x5D] => 0x266D,  # \flat, \natural, \sharp
    0x5E => 0x2323,         # \smile
    0x5F => 0x2322,         # \frown
    0x60 => 0x2113,         # \ell

    0x7D => 0x2118,         # \wp
    0x7E => [0x20D7,-653,0],# \vec
  ],
};

$map{cmsy10} = {
  "Main-Regular" => [
    [0,1] => 0x2212,        # -
    1 => 0x22C5,            # \cdot
    2 => 0xD7,              # \times
    3 => 0x2217,            # \ast
    4 => 0xF7,              # \div
    5 => 0x22C4,            # \diamond
    6 => 0xB1,              # \pm
    7 => 0x2213,            # \mp
    [8,0xC] => 0x2295,      # \oplus, \ominus, \otimes, \oslash, \odot
    0xD => 0x25EF,          # \bigcirc
    [0xE,0xF] => 0x2218,    # \circ, \bullet

    0x10 => 0x224D,         # \asymp
    0x11 => 0x2261,         # \equiv
    [0x12,0x13] => 0x2286,  # \subseteq, \supseteq
    [0x14,0x15] => 0x2264,  # \leq, \geq
    [0x16,0x17] => 0x2AAF,  # \preceq, \succeq
    0x18 => 0x223C,         # \sim
    0x19 => 0x2248,         # \approx
    [0x1A,0x1B] => 0x2282,  # \subset, \supset
    [0x1C,0x1D] => 0x226A,  # \ll, \gg
    [0x1E,0x1F] => 0x227A,  # \prec, \succ

    0x20 => 0x2190,         # \leftarrow
    0x21 => 0x2192,         # \rightarrow
    0x22 => 0x2191,         # \uparrow
    0x23 => 0x2193,         # \downarrow
    0x24 => 0x2194,         # \leftrightarrow
    0x25 => 0x2197,         # \nearrow
    0x26 => 0x2198,         # \searrow
    0x27 => 0x2243,         # \simeq

    0x28 => 0x21D0,         # \Leftarrow
    0x29 => 0x21D2,         # \Rightarrow
    0x2A => 0x21D1,         # \Uparrow
    0x2B => 0x21D3,         # \Downarrow
    0x2C => 0x21D4,         # \Leftrightarrow
    0x2D => 0x2196,         # \nwarrow
    0x2E => 0x2199,         # \swarrow
    0x2F => 0x221D,         # \propto

    0x30 => 0x2032,         # \prime
    0x31 => 0x221E,         # \infty
    0x32 => 0x2208,         # \in
    0x33 => 0x220B,         # \ni
    0x34 => 0x25B3,         # \bigtriangleup and \triangle
    0x35 => 0x25BD,         # \bigtriangledown
    0x36 => 0xE020,         # \not (U+0338 COMBINING LONG SOLIDUS OVERLAY would
                            # be most natural, but we don't use a negative
                            # leading space, so use PUA character)

    0x38 => 0x2200,         # \forall
    0x39 => 0x2203,         # \exists
    0x3A => 0xAC,           # \neg
    0x3B => 0x2205,         # \emptyset
    0x3C => 0x211C,         # \Re
    0x3D => 0x2111,         # \Im
    0x3E => 0x22A4,         # \top
    0x3F => 0x22A5,         # \bot

    0x40 => 0x2135,         # \aleph

    0x5B => 0x222A,         # \cup
    0x5C => 0x2229,         # \cap
    0x5D => 0x228E,         # \uplus
    [0x5E,0x5F] => 0x2227,  # \wedge, \vee

    [0x60,0x61] => 0x22A2,  # \vdash, \dashv
    [0x62,0x63] => 0x230A,  # \lfloor, \rfloor
    [0x64,0x65] => 0x2308,  # \lceil, \rceil
    0x66 => 0x7B,           # {
    0x67 => 0x7D,           # }
    [0x68,0x69] => 0x27E8,  # \langle, \rangle
    0x6A => 0x7C,           # |
    0x6A => 0x2223,         # \vert
    0x6B => 0x2225,         # \Vert
    0x6C => 0x2195,         # \updownarrow
    0x6D => 0x21D5,         # \Updownarrow
    0x6E => 0x5C,           # \backslash
    0x6E => 0x2216,         # \setminus
    0x6F => 0x2240,         # \wr

    0x70 => [0x221A,0,760], # \surd    ### adjust position so font doesn't have a large depth
    0x71 => 0x2A3F,         # \amalg
    0x72 => 0x2207,         # \nabla
    0x73 => 0x222B,         # \int
    0x74 => 0x2294,         # \sqcup
    0x75 => 0x2293,         # \sqcap
    [0x76,0x77] => 0x2291,  # \sqsubseteq, \sqsupseteq
    0x78 => 0xA7,           # \S
    [0x79,0x7A] => 0x2020,  # \dagger, \ddagger
    0x7B => 0xB6,           # \P
    0x7C => 0x2663,         # \clubsuit
    0x7D => 0x2662,         # \diamondsuit
    0x7E => 0x2661,         # \heartsuit
    0x7F => 0x2660,         # \spadesuit
  ],

  "Caligraphic" => [
    [0x41,0x5A] => 0x41,    # A-Z
  ],
};

$map{cmex10} = {
  "Size1" => [
    0 => [0x28,0,810],      # (
    1 => [0x29,0,810],      # )
    2 => [0x5B,0,810],      # [
    3 => [0x5D,0,810],      # ]
    4 => [0x230A,0,810],    # \lfloor
    5 => [0x230B,0,810],    # \rfloor
    6 => [0x2308,0,810],    # \lceil
    7 => [0x2309,0,810],    # \rceil
    8 => [0x7B,0,810],      # {
    9 => [0x7D,0,810],      # }
    0xA => [0x27E8,0,810],  # \langle
    0xB => [0x27E9,0,810],  # \rangle
    0xC => [0x2223,0,606],  # \vert
    0xD => [0x2225,0,606],  # \Vert
    0xE => [0x2F,0,810],    # /
    0xF => [0x5C,0,810],    # \

    0x46 => [0x2A06,0,750], # \bigsqcup
    0x48 => [0x222E,0,805], # \oint
    0x4A => [0x2A00,0,750], # \bigodot
    0x4C => [0x2A01,0,750], # \bigoplus
    0x4E => [0x2A02,0,750], # \bigotimes

    0x50 => [0x2211,0,750], # \sum
    0x51 => [0x220F,0,750], # \prod
    0x52 => [0x222B,0,805], # \int
    0x53 => [0x22C3,0,750], # \bigcup
    0x54 => [0x22C2,0,750], # \bigcap
    0x55 => [0x2A04,0,750], # \biguplus
    0x56 => [0x22C0,0,750], # \bigwedge
    0x57 => [0x22C1,0,750], # \bigvee

    0x60 => [0x2210,0,750], # \coprod
    0x62 => 0x2C6,          # \widehat
    0x62 => [0x302,-556,0], # \widehat (combining)
    0x65 => 0x2DC,          # \widetilde
    0x65 => [0x303,-556,0], # \widetilde (combining)

    0x70 => [0x221A,0,810], # surd
    0x3F => [0x23D0,0,601], # arrow extension
    0x77 => [0x2016,0,601], # Arrow extension (non-standard)
    0x78 => [0x2191,0,600], # uparrow top
    0x79 => [0x2193,0,600], # downarrow bottom
    0x7E => [0x21D1,0,600], # Uparrow top
    0x7F => [0x21D3,0,600], # Downarrow bottom
  ],

  "Size2" => [
    0x10 => [0x28,0,1110],  # (
    0x11 => [0x29,0,1110],  # )
    0x2E => [0x2F,0,1110],  # /
    0x2F => [0x5C,0,1110],  # \
    0x44 => [0x27E8,0,1110],# \langle
    0x45 => [0x27E9,0,1110],# \rangle

    0x47 => [0x2A06,0,950], # \bigsqcup
    0x49 => [0x222E,0,1360],# \oint
    0x4B => [0x2A00,0,950], # \bigodot
    0x4D => [0x2A01,0,950], # \bigoplus
    0x4F => [0x2A02,0,950], # \bigotimes

    0x58 => [0x2211,0,950], # \sum
    0x59 => [0x220F,0,950], # \prod
    0x5A => [0x222B,0,1360],# \int
    0x5B => [0x22C3,0,950], # \bigcup
    0x5C => [0x22C2,0,950], # \bigcap
    0x5D => [0x2A04,0,950], # \biguplus
    0x5E => [0x22C0,0,950], # \bigwedge
    0x5F => [0x22C1,0,950], # \bigvee
    0x61 => [0x2210,0,950], # \coprod

    0x63 => 0x2C6,          # \widehat
    0x63 => [0x302,-1000,0],# \widehat (combining)
    0x66 => 0x2DC,          # \widetilde
    0x66 => [0x303,-1000,0],# \widetilde (combining)

    0x68 => [0x5B,0,1110],  # [
    0x69 => [0x5D,0,1110],  # ]
    0x6A => [0x230A,0,1110],# \lfloor
    0x6B => [0x230B,0,1110],# \rfloor
    0x6C => [0x2308,0,1110],# \lceil
    0x6D => [0x2309,0,1110],# \rceil
    0x6E => [0x7B,0,1110],  # {
    0x6F => [0x7D,0,1110],  # }
    0x71 => [0x221A,0,1110],# surd
  ],

  "Size3" => [
    0x12 => [0x28,0,1410],  # (
    0x13 => [0x29,0,1410],  # )
    0x14 => [0x5B,0,1410],  # [
    0x15 => [0x5D,0,1410],  # ]
    0x16 => [0x230A,0,1410],# \lfloor
    0x17 => [0x230B,0,1410],# \rfloor
    0x18 => [0x2308,0,1410],# \lceil
    0x19 => [0x2309,0,1410],# \rceil
    0x1A => [0x7B,0,1410],  # {
    0x1B => [0x7D,0,1410],  # }
    0x1C => [0x27E8,0,1410],# \langle
    0x1D => [0x27E9,0,1410],# \rangle
    0x1E => [0x2F,0,1410],  # /
    0x1F => [0x5C,0,1410],  # \
    0x64 => 0x2C6,          # \widehat
    0x64 => [0x302,-1444,0],# \widehat (combining)
    0x67 => 0x2DC,          # \widetilde
    0x67 => [0x303,-1444,0],# \widetilde (combining)
    0x72 => [0x221A,0,1410],# surd
  ],

  "Size4" => [
    0x20 => [0x28,0,1710],  # (
    0x21 => [0x29,0,1710],  # )
    0x22 => [0x5B,0,1710],  # [
    0x23 => [0x5D,0,1710],  # ]
    0x24 => [0x230A,0,1710],# \lfloor
    0x25 => [0x230B,0,1710],# \rfloor
    0x26 => [0x2308,0,1710],# \lceil
    0x27 => [0x2309,0,1710],# \rceil
    0x28 => [0x7B,0,1710],  # {
    0x29 => [0x7D,0,1710],  # }
    0x2A => [0x27E8,0,1710],# \langle
    0x2B => [0x27E9,0,1710],# \rangle
    0x2C => [0x2F,0,1710],  # /
    0x2D => [0x5C,0,1710],  # \
    0x73 => [0x221A,0,1710],# surd

    0x30 => [0x239B,0,1115],# left paren upper hook
    0x31 => [0x239E,0,1115],# right paren upper hook
    0x32 => [0x23A1,0,1115],# left square bracket upper corner
    0x33 => [0x23A4,0,1115],# right square bracket upper corner
    0x34 => [0x23A3,0,1115],# left square bracket lower corner
    0x35 => [0x23A6,0,1115],# right square bracket lower hook
    0x36 => [0x23A2,0,601], # left square bracket extension
    0x37 => [0x23A5,0,601], # right square bracket extension
    0x38 => [0x23A7,0,900], # left curly brace upper hook
    0x39 => [0x23AB,0,900], # right curly brace upper hook
    0x3A => 0x23A9,         # left curly brace lower hook
    0x3B => 0x23AD,         # right curly brace lower hook
    0x3C => [0x23A8,0,1150],# left curly brace middle
    0x3D => [0x23AC,0,1150],# right curly brace middle
    0x3E => [0x23AA,0,300], # curly brace extension

    0x40 => [0x239D,0,1115],# left paren lower hook
    0x41 => [0x23A0,0,1115],# right paren lower hook
    0x42 => [0x239C,0,600], # left paren extension
    0x43 => [0x239F,0,600], # right paren extension

    0x74 => [0x23B7,0,915], # radical bottom
    0x75 => [0xE000,0,605], # radical extension (PUA)
    0x76 => [0xE001,0,565], # radical top (PUA)
    [0x7A,0x7D] => 0xE150,  # \braceld, \bracerd, \bracelu, \braceru (PUA)
  ],

  "Main-Regular" => [
    0x38 => [0x23B0,0,900], # left curly brace upper hook, for lgroup, lmoustache
    0x39 => [0x23B1,0,900], # right curly brace upper hook, for rgroup, rmoustache
    0x3A => 0x23A9,         # left curly brace lower hook, for lgroup, rmoustache
    0x3B => 0x23AD,         # right curly brace lower hook, for rgroup, lmoustache
  ],
};

$map{cmti10} = {
  "Main-Italic" => [
    [0,1] => 0x393,         # \Gamma, \Delta
    2 => 0x398,             # \Theta
    3 => 0x39B,             # \Lambda
    4 => 0x39E,             # \Xi
    5 => 0x3A0,             # \Pi
    6 => 0x3A3,             # \Sigma
    [7,8] => 0x3A5,         # \Upsilon, \Phi
    [9,0xA] => 0x3A8,       # \Psi, \Omega

    0x10 => 0x131,          # \i
    0x11 => 0x237,          # \j
    0x12 => 0x2CB,          # \grave
    0x13 => 0x2CA,          # \acute
    0x14 => 0x2C7,          # \check
    0x15 => 0x2D8,          # \breve
    0x16 => 0x2C9,          # \bar
    0x17 => [0xB0,-160,0],  # \degree
    0x17 => 0x02DA,         # \r, ring above
    0x18 => 0xB8,           # \c, cedilla

    [0x21,0x23] => 0x21,    # !, ", #,
    0x22 => 0x201D,         # "
    [0x25,0x2F] => 0x25,    # %, &, ', (, ), *, +, comma, -, ., /
    0x27 => 0x2019,         # '
    [0x30,0x39] => 0x30,    # 0-9
    [0x3A,0x3B] => 0x3A,    # :, ;
    0x3D => 0x3D,           # =
    [0x3F,0x40] => 0x3F,    # ?, @
    [0x41,0x5A] => 0x41,    # A-Z
    0x5B => 0x5B,           # [
    0x5C => 0x201C,         # ``
    [0x5D,0x5E] => 0x5D,    # ], ^
    0x5E => 0x2C6,          # \hat
    0x5F => 0x2D9,          # \dot
    0x60 => 0x2018,         # `
    [0x61,0x7A] => 0x61,    # a-z
    [0x7B,0x7C] => 0x2013,  # \endash, \emdash
    0x7B => [0x5F,0,-310],  # underline
    0x7D => 0x2DD,          # double acute
    0x7E => [0x7E,0,-350],  # ~
    0x7E => 0x2DC,          # \tilde
    0x7F => 0xA8,           # \ddot
    0x19 => 0xDF,           # sharp S
    0x1A => 0xE6,           # ae ligature
    0x1B => 0x153,          # oe ligature
    0x1C => 0xF8,           # o with slash
    0x1D => 0xC6,           # AE ligature
    0x1E => 0x152,          # OE ligature
    0x1F => 0xD8,           # O with slash
  ],

  "Main-Regular" => [
    0x24 => 0xA3,           # pound sign
  ],
};

$map{cmbx10} = {
  "Main-Bold" => [
    [0,1] => 0x393,         # \Gamma, \Delta
    2 => 0x398,             # \Theta
    3 => 0x39B,             # \Lambda
    4 => 0x39E,             # \Xi
    5 => 0x3A0,             # \Pi
    6 => 0x3A3,             # \Sigma
    [7,8] => 0x3A5,         # \Upsilon, \Phi
    [9,0xA] => 0x3A8,       # \Psi, \Omega

    0x10 => 0x131,          # \i
    0x11 => 0x237,          # \j
    0x12 => 0x2CB,          # \grave
    0x13 => 0x2CA,          # \acute
    0x14 => 0x2C7,          # \check
    0x15 => 0x2D8,          # \breve
    0x16 => 0x2C9,          # \bar
    0x17 => [0xB0,-147,0],  # \degree
    0x17 => 0x02DA,         # \r, ring above
    0x18 => 0xB8,           # \c, cedilla

    [0x21,0x2F] => 0x21,    # !, ", #, $, %, &, ', (, ), *, +, comma, -, ., /
    0x22 => 0x201D,         # "
    0x27 => 0x2019,         # '
    [0x30,0x39] => 0x30,    # 0-9
    [0x3A,0x3B] => 0x3A,    # :, ;
    0x3D => 0x3D,           # =
    [0x3F,0x40] => 0x3F,    # ?, @
    [0x41,0x5A] => 0x41,    # A-Z
    0x5B => 0x5B,           # [
    0x5C => 0x201C,         # ``
    [0x5D,0x5E] => 0x5D,    # ], ^
    0x5E => 0x2C6,          # \hat
    0x5F => 0x2D9,          # \dot
    0x60 => 0x2018,         # `
    [0x61,0x7A] => 0x61,    # a-z
    [0x7B,0x7C] => 0x2013,  # \endash, \emdash
    0x7B => [0x5F,0,-310],  # underline
    0x7D => 0x2DD,          # double acute
    0x7E => [0x7E,0,-350],  # ~
    0x7E => 0x2DC,          # \tilde
    0x7F => 0xA8,           # \ddot
    0x19 => 0xDF,           # sharp S
    0x1A => 0xE6,           # ae ligature
    0x1B => 0x153,          # oe ligature
    0x1C => 0xF8,           # o with slash
    0x1D => 0xC6,           # AE ligature
    0x1E => 0x152,          # OE ligature
    0x1F => 0xD8,           # O with slash
  ],
};

$map{cmbxti10} = {
  "Main-BoldItalic" => [
    [0,1] => 0x393,         # \Gamma, \Delta
    2 => 0x398,             # \Theta
    3 => 0x39B,             # \Lambda
    4 => 0x39E,             # \Xi
    5 => 0x3A0,             # \Pi
    6 => 0x3A3,             # \Sigma
    [7,8] => 0x3A5,         # \Upsilon, \Phi
    [9,0xA] => 0x3A8,       # \Psi, \Omega

    0x10 => 0x131,          # \i
    0x11 => 0x237,          # \j
    0x12 => 0x2CB,          # \grave
    0x13 => 0x2CA,          # \acute
    0x14 => 0x2C7,          # \check
    0x15 => 0x2D8,          # \breve
    0x16 => 0x2C9,          # \bar
    0x17 => [0xB0,-160,0],  # \degree
    0x17 => 0x02DA,         # \r, ring above
    0x18 => 0xB8,           # \c, cedilla

    [0x21,0x23] => 0x21,    # !, ", #,
    0x22 => 0x201D,         # "
    [0x25,0x2F] => 0x25,    # %, &, ', (, ), *, +, comma, -, ., /
    0x27 => 0x2019,         # '
    [0x30,0x39] => 0x30,    # 0-9
    [0x3A,0x3B] => 0x3A,    # :, ;
    0x3D => 0x3D,           # =
    [0x3F,0x40] => 0x3F,    # ?, @
    [0x41,0x5A] => 0x41,    # A-Z
    0x5B => 0x5B,           # [
    0x5C => 0x201C,         # ``
    [0x5D,0x5E] => 0x5D,    # ], ^
    0x5E => 0x2C6,          # \hat
    0x5F => 0x2D9,          # \dot
    0x60 => 0x2018,         # `
    [0x61,0x7A] => 0x61,    # a-z
    [0x7B,0x7C] => 0x2013,  # \endash, \emdash
    0x7B => [0x5F,0,-310],  # underline
    0x7D => 0x2DD,          # double acute
    0x7E => [0x7E,0,-350],  # ~
    0x7E => 0x2DC,          # \tilde
    0x7F => 0xA8,           # \ddot
    0x19 => 0xDF,           # sharp S
    0x1A => 0xE6,           # ae ligature
    0x1B => 0x153,          # oe ligature
    0x1C => 0xF8,           # o with slash
    0x1D => 0xC6,           # AE ligature
    0x1E => 0x152,          # OE ligature
    0x1F => 0xD8,           # O with slash
  ],

  "Main-Bold" => [
    0x24 => 0xA3,           # pound sign
  ],
};

$map{cmmib10} = {
  "Math-BoldItalic" => [
    [0,1] => 0x393,         # \Gamma, \Delta
    2 => 0x398,             # \Theta
    3 => 0x39B,             # \Lambda
    4 => 0x39E,             # \Xi
    5 => 0x3A0,             # \Pi
    6 => 0x3A3,             # \Sigma
    [7,8] => 0x3A5,         # \Upsilon, \Phi
    [9,0xA] => 0x3A8,       # \Psi, \Omega

    [0xB,0xE] => 0x3B1,     # \alpha, \beta, \gamma, \delta
    0xF => 0x3F5,           # \elpsilon
    [0x10,0x18] => 0x3B6,   # \zeta, \eta, \theta, \iota, \kappa, \lambda, \mu, \nu, \xi
    [0x19,0x1A] => 0x3C0,   # \pi, \rho
    [0x1B,0x1D] => 0x3C3,   # \sigma, \tau, \upsilon
    0x1E => 0x3D5,          # \phi
    [0x1F,0x21] => 0x3C7,   # \chi, \psi, \omega
    0x22 => 0x3B5,          # \varepsilon
    0x23 => 0x3D1,          # \vartheta
    0x24 => 0x3D6,          # \varpi
    0x25 => 0x3F1,          # \varrho
    0x26 => 0x3C2,          # \varsigma
    0x27 => 0x3C6,          # \varphi

    [0x30,0x39] => 0x30,    # Oldstyle 0-9
    [0x41,0x5A] => 0x41,    # A-Z
    [0x61,0x7A] => 0x61,    # a - z

    0x6F => 0x3BF,          # omicron
    0x7B => 0xE131,         # \imath (PUA)
    0x7C => 0xE237,         # \jmath (PUA)
  ],

  "Main-Bold" => [
    0x28 => 0x21BC,         # \leftharpoonup
    0x29 => 0x21BD,         # \leftharpoondown
    0x2A => 0x21C0,         # \rightharpoonup
    0x2B => 0x21C1,         # \rightharpoondown

    0x2E => 0x25B9,         # \triangleright
    0x2F => 0x25C3,         # \triangleleft

    0x3A => 0x2E,           # .
    0x3B => 0x2C,           # ,
    0x3C => 0x3C,           # <
    0x3D => 0x2215,         # /
    0x3E => 0x3E,           # >
    0x3F => 0x22C6,         # \star
    0x40 => 0x2202,         # \partial

    [0x5B,0x5D] => 0x266D,  # \flat, \natural, \sharp
    0x5E => 0x2323,         # \smile
    0x5F => 0x2322,         # \frown
    0x60 => 0x2113,         # \ell
    0x68 => 0x210F,         # \hbar (bar added below)

    0x7D => 0x2118,         # \wp
    0x7E => [0x20D7,-729,0],# \vec
  ],
};

$map{cmbsy10} = {
  "Main-Bold" => [
    [0,1] => 0x2212,        # -
    1 => 0x22C5,            # \cdot
    2 => 0xD7,              # \times
    3 => 0x2217,            # \ast
    4 => 0xF7,              # \div
    5 => 0x22C4,            # \diamond
    6 => 0xB1,              # \pm
    7 => 0x2213,            # \mp
    [8,0xC] => 0x2295,      # \oplus, \ominus, \otimes, \oslash, \odot
    0xD => 0x25EF,          # \bigcirc
    [0xE,0xF] => 0x2218,    # \circ, \bullet

    0x10 => 0x224D,         # \asymp
    0x11 => 0x2261,         # \equiv
    [0x12,0x13] => 0x2286,  # \subseteq, \supseteq
    [0x14,0x15] => 0x2264,  # \leq, \geq
    [0x16,0x17] => 0x2AAF,  # \preceq, \succeq
    0x18 => 0x223C,         # \sim
    0x19 => 0x2248,         # \approx
    [0x1A,0x1B] => 0x2282,  # \subset, \supset
    [0x1C,0x1D] => 0x226A,  # \ll, \gg
    [0x1E,0x1F] => 0x227A,  # \prec, \succ

    0x20 => 0x2190,         # \leftarrow
    0x21 => 0x2192,         # \rightarrow
    0x22 => 0x2191,         # \uparrow
    0x23 => 0x2193,         # \downarrow
    0x24 => 0x2194,         # \leftrightarrow
    0x25 => 0x2197,         # \nearrow
    0x26 => 0x2198,         # \searrow
    0x27 => 0x2243,         # \simeq

    0x28 => 0x21D0,         # \Leftarrow
    0x29 => 0x21D2,         # \Rightarrow
    0x2A => 0x21D1,         # \Uparrow
    0x2B => 0x21D3,         # \Downarrow
    0x2C => 0x21D4,         # \Leftrightarrow
    0x2D => 0x2196,         # \nwarrow
    0x2E => 0x2199,         # \swarrow
    0x2F => 0x221D,         # \propto

    0x30 => 0x2032,         # \prime
    0x31 => 0x221E,         # \infty
    0x32 => 0x2208,         # \in
    0x33 => 0x220B,         # \ni
    0x34 => 0x25B3,         # \bigtriangleup and \triangle
    0x35 => 0x25BD,         # \bigtriangledown
    0x36 => 0xE020,         # \not

    0x38 => 0x2200,         # \forall
    0x39 => 0x2203,         # \exists
    0x3A => 0xAC,           # \neg
    0x3B => 0x2205,         # \emptyset
    0x3C => 0x211C,         # \Re
    0x3D => 0x2111,         # \Im
    0x3E => 0x22A4,         # \top
    0x3F => 0x22A5,         # \bot

    0x40 => 0x2135,         # \aleph

    0x5B => 0x222A,         # \cup
    0x5C => 0x2229,         # \cap
    0x5D => 0x228E,         # \uplus
    [0x5E,0x5F] => 0x2227,  # \wedge, \vee

    [0x60,0x61] => 0x22A2,  # \vdash, \dashv
    [0x62,0x63] => 0x230A,  # \lfloor, \rfloor
    [0x64,0x65] => 0x2308,  # \lceil, \rceil
    0x66 => 0x7B,           # {
    0x67 => 0x7D,           # }
    [0x68,0x69] => 0x27E8,  # \langle, \rangle
    0x6A => 0x7C,           # |
    0x6A => 0x2223,         # \vert
    0x6B => 0x2225,         # \Vert
    0x6C => 0x2195,         # \updownarrow
    0x6D => 0x21D5,         # \Updownarrow
    0x6E => 0x5C,           # \backslash
    0x6E => 0x2216,         # \setminus
    0x6F => 0x2240,         # \wr

    0x70 => [0x221A,0,760], # \surd    ### adjust position so font doesn't have a large depth
    0x71 => 0x2A3F,         # \amalg
    0x72 => 0x2207,         # \nabla
    0x73 => 0x222B,         # \int
    0x74 => 0x2294,         # \sqcup
    0x75 => 0x2293,         # \sqcap
    [0x76,0x77] => 0x2291,  # \sqsubseteq, \sqsupseteq

    [0x79,0x7A] => 0x2020,  # \dagger, \ddagger

    0x7C => 0x2663,         # \clubsuit
    0x7D => 0x2662,         # \diamondsuit
    0x7E => 0x2661,         # \heartsuit
    0x7F => 0x2660,         # \spadesuit
  ],

  "Caligraphic-Bold" => [
    [0x41,0x5A] => 0x41,    # A-Z
  ],
};

$map{msam10} = {
  "Main-Regular" => [
    0x5C => 0x2220,         # \angle
  ],

  "Main-Bold" => [
    0x5C => 0x2220,         # \angle (emboldened below)
  ],

  "AMS" => [
    0x00 => 0x22A1,         # \boxdot
    0x01 => 0x229E,         # \boxplus
    0x02 => 0x22A0,         # \boxtimes
    0x03 => 0x25A1,         # \square
    0x04 => 0x25A0,         # \blacksquare
    0x05 => 0x22C5,         # \centerdot
    0x06 => 0x25CA,         # \lozenge
    0x07 => 0x29EB,         # \blacklozenge
    0x08 => 0x21BB,         # \circlearrowright
    0x09 => 0x21BA,         # \circlearrowleft
    0x0A => 0x21CC,         # \rightleftharpoons
    0x0B => 0x21CB,         # \leftrightharpoons
    0x0C => 0x229F,         # \boxminus
    0x0D => 0x22A9,         # \Vdash
    0x0E => 0x22AA,         # \Vvdash
    0x0F => 0x22A8,         # \vDash
    0x10 => 0x21A0,         # \twoheadrightarrow
    0x11 => 0x219E,         # \twoheadleftarrow
    0x12 => 0x21C7,         # \leftleftarrows
    0x13 => 0x21C9,         # \rightrightarrows
    0x14 => 0x21C8,         # \upuparrows
    0x15 => 0x21CA,         # \downdownarrows
    0x16 => 0x21BE,         # \upharpoonright
    0x17 => 0x21C2,         # \downharpoonright
    0x18 => 0x21BF,         # \upharpoonleft
    0x19 => 0x21C3,         # \downharpoonleft
    0x1A => 0x21A3,         # \rightarrowtail
    0x1B => 0x21A2,         # \leftarrowtail
    0x1C => 0x21C6,         # \leftrightarrows
    0x1D => 0x21C4,         # \rightleftarrows
    0x1E => 0x21B0,         # \Lsh
    0x1F => 0x21B1,         # \Rsh
    0x20 => 0x21DD,         # \rightsquigarrow
    0x21 => 0x21AD,         # \leftrightsquigarrow
    0x22 => 0x21AB,         # \looparrowleft
    0x23 => 0x21AC,         # \looparrowright
    0x24 => 0x2257,         # \circeq
    0x25 => 0x227F,         # \succsim
    0x26 => 0x2273,         # \gtrsim
    0x27 => 0x2A86,         # \gtrapprox
    0x28 => 0x22B8,         # \multimap
    0x29 => 0x2234,         # \therefore
    0x2A => 0x2235,         # \because
    0x2B => 0x2251,         # \doteqdot
    0x2C => 0x225C,         # \triangleq
    0x2D => 0x227E,         # \precsim
    0x2E => 0x2272,         # \lesssim
    0x2F => 0x2A85,         # \lessapprox
    0x30 => 0x2A95,         # \eqslantless
    0x31 => 0x2A96,         # \eqslantgtr
    0x32 => 0x22DE,         # \curlyeqprec
    0x33 => 0x22DF,         # \curlyeqsucc
    0x34 => 0x227C,         # \preccurlyeq
    0x35 => 0x2266,         # \leqq
    0x36 => 0x2A7D,         # \leqslant
    0x37 => 0x2276,         # \lessgtr
    0x38 => 0x2035,         # \backprime
    0x39 => 0x2212,         # dahsed arrow extension
    0x3A => 0x2253,         # \risingdotseq
    0x3B => 0x2252,         # \fallingdotseq
    0x3C => 0x227D,         # \succcurlyeq
    0x3D => 0x2267,         # \geqq
    0x3E => 0x2A7E,         # \geqslant
    0x3F => 0x2277,         # \gtrless
    0x40 => 0x228F,         # \sqsubset
    0x41 => 0x2290,         # \sqsupset
    0x42 => 0x22B3,         # \vartriangleright
    0x43 => 0x22B2,         # \vartriangleleft
    0x44 => 0x22B5,         # \trianglerighteq
    0x45 => 0x22B4,         # \trianglelefteq
    0x46 => 0x2605,         # \bigstar
    0x47 => 0x226C,         # \between
    0x48 => 0x25BC,         # \blacktriangledown
    0x49 => 0x25B6,         # \blacktriangleright
    0x4A => 0x25C0,         # \blacktriangleleft
    0x4B => 0x2192,         # rightarrow
    0x4C => 0x2190,         # leftarrow
    0x4D => 0x25B3,         # \vartriangle
    0x4E => 0x25B2,         # \blacktriangle
    0x4F => 0x25BD,         # \triangledown
    0x50 => 0x2256,         # \eqcirc
    0x51 => 0x22DA,         # \lesseqgtr
    0x52 => 0x22DB,         # \gtreqless
    0x53 => 0x2A8B,         # \lesseqqgtr
    0x54 => 0x2A8C,         # \gtreqqless
    0x55 => 0x00A5,         # yen
    0x56 => 0x21DB,         # \Rrightarrow
    0x57 => 0x21DA,         # \Lleftarrow
    0x58 => 0x2713,         # checkmark
    0x59 => 0x22BB,         # \veebar
    0x5A => 0x22BC,         # \barwedge
    0x5B => 0x2A5E,         # \doublebarwedge
    0x5C => 0x2220,         # \angle
    0x5D => 0x2221,         # \measuredangle
    0x5E => 0x2222,         # \sphericalangle
    0x5F => 0x221D,         # \varpropto
    0x60 => 0x2323,         # \smallsmile
    0x61 => 0x2322,         # \smallfrown
    0x62 => 0x22D0,         # \Subset
    0x63 => 0x22D1,         # \Supset
    0x64 => 0x22D3,         # \Cup
    0x65 => 0x22D2,         # \Cap
    0x66 => 0x22CF,         # \curlywedge
    0x67 => 0x22CE,         # \curlyvee
    0x68 => 0x22CB,         # \leftthreetimes
    0x69 => 0x22CC,         # \rightthreetimes
    0x6A => 0x2AC5,         # \subseteqq
    0x6B => 0x2AC6,         # \supseteqq
    0x6C => 0x224F,         # \bumpeq
    0x6D => 0x224E,         # \Bumpeq
    0x6E => 0x22D8,         # \lll
    0x6F => 0x22D9,         # \ggg
    0x70 => 0x250C,         # \ulcorner
    0x71 => 0x2510,         # \urcorner
    0x72 => 0x00AE,         # registered sign
    0x73 => 0x24C8,         # \circledS
    0x74 => 0x22D4,         # \pitchfork
    0x75 => 0x2214,         # \dotplus
    0x76 => 0x223D,         # \backsim
    0x77 => 0x22CD,         # \backsimeq
    0x78 => 0x2514,         # \llcorner
    0x79 => 0x2518,         # \lrcorner
    0x7A => 0x2720,         # maltese cross
    0x7B => 0x2201,         # \complement
    0x7C => 0x22BA,         # \intercal
    0x7D => 0x229A,         # \circledcirc
    0x7E => 0x229B,         # \circledast
    0x7F => 0x229D,         # \circleddash
  ],
};

$map{msbm10} = {
  "Size4" => [
    0x5B => 0x2C6,          # \widehat
    0x5B => [0x302,-1889,0],# \widehat (combining)
    0x5D => 0x2DC,          # \widetilde
    0x5D => [0x303,-1889,0],# \widetilde (combining)
  ],

  "Main-Regular" => [
    0x7E => 0x210F,         # \hbar
  ],

  "Main-Italic" => [
    0x7D => 0x210F,         # \hbar (with slant)
  ],

  "AMS" => [
    0x00 => 0xE00C,         # \lvertneqq
    0x01 => 0xE00D,         # \gvertneqq
    0x02 => 0x2270,         # \nleq
    0x03 => 0x2271,         # \ngeq
    0x04 => 0x226E,         # \nless
    0x05 => 0x226F,         # \ngtr
    0x06 => 0x2280,         # \nprec
    0x07 => 0x2281,         # \nsucc
    0x08 => 0x2268,         # \lneqq
    0x09 => 0x2269,         # \gneqq
    0x0A => 0xE010,         # \nleqslant
    0x0B => 0xE00F,         # \ngeqslant
    0x0C => 0x2A87,         # \lneq
    0x0D => 0x2A88,         # \gneq
    0x0E => 0x22E0,         # \npreceq
    0x0F => 0x22E1,         # \nsucceq
    0x10 => 0x22E8,         # \precnsim
    0x11 => 0x22E9,         # \succnsim
    0x12 => 0x22E6,         # \lnsim
    0x13 => 0x22E7,         # \gnsim
    0x14 => 0xE011,         # \nleqq
    0x15 => 0xE00E,         # \ngeqq
    0x16 => 0x2AB5,         # \precneqq
    0x17 => 0x2AB6,         # \succneqq
    0x18 => 0x2AB9,         # \precnapprox
    0x19 => 0x2ABA,         # \succnapprox
    0x1A => 0x2A89,         # \lnapprox
    0x1B => 0x2A8A,         # \gnapprox
    0x1C => 0x2241,         # \nsim
    0x1D => 0x2246,         # \ncong
    0x1E => 0x2571,         # \diagup
    0x1F => 0x2572,         # \diagdown
    0x20 => 0xE01A,         # \varsubsetneq
    0x21 => 0xE01B,         # \varsupsetneq
    0x22 => 0xE016,         # \nsubseteqq
    0x23 => 0xE018,         # \nsupseteqq
    0x24 => 0x2ACB,         # \subsetneqq
    0x25 => 0x2ACC,         # \supsetneqq
    0x26 => 0xE017,         # \varsubsetneqq
    0x27 => 0xE019,         # \varsupsetneqq
    0x28 => 0x228A,         # \subsetneq
    0x29 => 0x228B,         # \supsetneq
    0x2A => 0x2288,         # \nsubseteq
    0x2B => 0x2289,         # \nsupseteq
    0x2C => 0x2226,         # \nparallel
    0x2D => 0x2224,         # \nmid
    0x2E => 0xE006,         # \nshortmid
    0x2F => 0xE007,         # \nshortparallel
    0x30 => 0x22AC,         # \nvdash
    0x31 => 0x22AE,         # \nVdash
    0x32 => 0x22AD,         # \nvDash
    0x33 => 0x22AF,         # \nVDash
    0x34 => 0x22ED,         # \ntrianglerighteq
    0x35 => 0x22EC,         # \ntrianglelefteq
    0x36 => 0x22EA,         # \ntriangleleft
    0x37 => 0x22EB,         # \ntriangleright
    0x38 => 0x219A,         # \nleftarrow
    0x39 => 0x219B,         # \nrightarrow
    0x3A => 0x21CD,         # \nLeftarrow
    0x3B => 0x21CF,         # \nRightarrow
    0x3C => 0x21CE,         # \nLeftrightarrow
    0x3D => 0x21AE,         # \nleftrightarrow
    0x3E => 0x22C7,         # \divideontimes
    0x3F => 0x2205,         # \varnothing
    0x40 => 0x2204,         # \nexists

    [0x41,0x5A] => 0x41,    # A-Z
    0x5C => 0x2C6,          # \widehat
    0x5C => [0x302,-2333,0],# \widehat (combining)
    0x5E => 0x2DC,          # \widetilde
    0x5E => [0x303,-2333,0],# \widetilde (combining)

    0x60 => 0x2132,         # \Finv
    0x61 => 0x2141,         # \Game
    0x66 => 0x2127,         # \mho
    0x67 => 0x00F0,         # \eth
    0x68 => 0x2242,         # minus-tilde
    0x69 => 0x2136,         # \beth
    0x6A => 0x2137,         # \gimel
    0x6B => 0x2138,         # \daleth
    0x6C => 0x22D6,         # \lessdot
    0x6D => 0x22D7,         # \gtrdot
    0x6E => 0x22C9,         # \ltimes
    0x6F => 0x22CA,         # \rtimes
    0x70 => 0x2223,         # \shortmid
    0x71 => 0x2225,         # \shortparallel
    0x72 => 0x2216,         # \smallsetminus
    0x73 => 0x223C,         # \thicksim
    0x74 => 0x2248,         # \thickapprox
    0x75 => 0x224A,         # \approxeq
    0x76 => 0x2AB8,         # \succapprox
    0x77 => 0x2AB7,         # \precapprox
    0x78 => 0x21B6,         # \curvearrowleft
    0x79 => 0x21B7,         # \curvearrowright
    0x7A => 0x03DD,         # \digamma
    0x7B => 0x03F0,         # \varkappa
    0x7A => 0xE008,         # \digamma  (non-standard, for IE)
    0x7B => 0xE009,         # \varkappa (non-standard, for IE)
    0x7C => 0x006B,         # \Bbbk
    0x7D => 0x210F,         # \hslash
    0x7E => 0x0127,         # \hbar
    0x7F => 0x220D,         # \backepsilon
  ],
};

$map{cmss10} = {
  "SansSerif-Regular" => [
    [0,1] => 0x393,         # \Gamma, \Delta
    2 => 0x398,             # \Theta
    3 => 0x39B,             # \Lambda
    4 => 0x39E,             # \Xi
    5 => 0x3A0,             # \Pi
    6 => 0x3A3,             # \Sigma
    [7,8] => 0x3A5,         # \Upsilon, \Phi
    [9,0xA] => 0x3A8,       # \Psi, \Omega

    0x10 => 0x131,          # \i
    0x11 => 0x237,          # \j
    0x12 => 0x2CB,          # \grave
    0x13 => 0x2CA,          # \acute
    0x14 => 0x2C7,          # \check
    0x15 => 0x2D8,          # \breve
    0x16 => 0x2C9,          # \bar
    0x17 => [0xB0,-142,0],  # \degree
    0x17 => 0x02DA,         # \r, ring above
    0x18 => 0xB8,           # \c, cedilla

    [0x21,0x2F] => 0x21,    # !, ", #, $, %, &, ', (, ), *, +, comma, -, ., /
    0x22 => 0x201D,         # "
    0x27 => 0x2019,         # '
    [0x30,0x39] => 0x30,    # 0-9
    [0x3A,0x3B] => 0x3A,    # :, ;
    0x3D => 0x3D,           # =
    [0x3F,0x40] => 0x3F,    # ?, @
    [0x41,0x5A] => 0x41,    # A-Z
    0x5B => 0x5B,           # [
    0x5C => 0x201C,         # ``
    [0x5D,0x5E] => 0x5D,    # ], ^
    0x5E => 0x2C6,          # \hat
    0x5F => 0x2D9,          # \dot
    0x60 => 0x2018,         # `
    [0x61,0x7A] => 0x61,    # a-z
    [0x7B,0x7C] => 0x2013,  # \endash, \emdash
    0x7B => [0x5F,0,-350],  # underline
    0x7D => 0x2DD,          # double acute
    0x7E => [0x7E,0,-350],  # ~
    0x7E => 0x2DC,          # \tilde
    0x7F => 0xA8,           # \ddot
  ],
};

$map{cmssi10} = {
  "SansSerif-Italic" => [
    [0,1] => 0x393,         # \Gamma, \Delta
    2 => 0x398,             # \Theta
    3 => 0x39B,             # \Lambda
    4 => 0x39E,             # \Xi
    5 => 0x3A0,             # \Pi
    6 => 0x3A3,             # \Sigma
    [7,8] => 0x3A5,         # \Upsilon, \Phi
    [9,0xA] => 0x3A8,       # \Psi, \Omega

    0x10 => 0x131,          # \i
    0x11 => 0x237,          # \j
    0x12 => 0x2CB,          # \grave
    0x13 => 0x2CA,          # \acute
    0x14 => 0x2C7,          # \check
    0x15 => 0x2D8,          # \breve
    0x16 => 0x2C9,          # \bar
    0x17 => [0xB0,-113,0],  # \degree
    0x17 => 0x02DA,         # \r, ring above
    0x18 => 0xB8,           # \c, cedilla

    [0x21,0x2F] => 0x21,    # !, ", #, $, %, &, ', (, ), *, +, comma, -, ., /
    0x22 => 0x201D,         # "
    0x27 => 0x2019,         # '
    [0x30,0x39] => 0x30,    # 0-9
    [0x3A,0x3B] => 0x3A,    # :, ;
    0x3D => 0x3D,           # =
    [0x3F,0x40] => 0x3F,    # ?, @
    [0x41,0x5A] => 0x41,    # A-Z
    0x5B => 0x5B,           # [
    0x5C => 0x201C,         # ``
    [0x5D,0x5E] => 0x5D,    # ], ^
    0x5E => 0x2C6,          # \hat
    0x5F => 0x2D9,          # \dot
    0x60 => 0x2018,         # `
    [0x61,0x7A] => 0x61,    # a-z
    [0x7B,0x7C] => 0x2013,  # \endash, \emdash
    0x7B => [0x5F,0,-350],  # underline
    0x7D => 0x2DD,          # double acute
    0x7E => [0x7E,0,-350],  # ~
    0x7E => 0x2DC,          # \tilde
    0x7F => 0xA8,           # \ddot
  ],
};

$map{cmssbx10} = {
  "SansSerif-Bold" => [
    [0,1] => 0x393,         # \Gamma, \Delta
    2 => 0x398,             # \Theta
    3 => 0x39B,             # \Lambda
    4 => 0x39E,             # \Xi
    5 => 0x3A0,             # \Pi
    6 => 0x3A3,             # \Sigma
    [7,8] => 0x3A5,         # \Upsilon, \Phi
    [9,0xA] => 0x3A8,       # \Psi, \Omega

    0x10 => 0x131,          # \i
    0x11 => 0x237,          # \j
    0x13 => 0xB4,           # \acute
    0x14 => 0x2C7,          # \check
    0x15 => 0x2D8,          # \breve
    0x16 => 0x2C9,          # \bar
    0x17 => [0xB0,-58,0],   # \degree
    0x17 => 0x02DA,         # \r, ring above
    0x18 => 0xB8,           # \c, cedilla

    [0x21,0x2F] => 0x21,    # !, ", #, $, %, &, ', (, ), *, +, comma, -, ., /
    0x22 => 0x201D,         # "
    0x27 => 0x2019,         # '
    [0x30,0x39] => 0x30,    # 0-9
    [0x3A,0x3B] => 0x3A,    # :, ;
    0x3D => 0x3D,           # =
    [0x3F,0x40] => 0x3F,    # ?, @
    [0x41,0x5A] => 0x41,    # A-Z
    0x5B => 0x5B,           # [
    0x5C => 0x201C,         # ``
    [0x5D,0x5E] => 0x5D,    # ], ^
    0x5E => 0x2C6,          # \hat
    0x5F => 0x2D9,          # \dot
    0x60 => 0x2018,         # `
    [0x61,0x7A] => 0x61,    # a-z
    [0x7B,0x7C] => 0x2013,  # \endash, \emdash
    0x7B => [0x5F,0,-350],  # underline
    0x7D => 0x2DD,          # double acute
    0x7E => [0x7E,0,-350],  # ~
    0x7E => 0x2DC,          # \tilde
    0x7F => 0xA8,           # \ddot
  ],
};

$map{eufm10} = {
  "Fraktur-Regular" => [
    [0,7] => 0xE300,        # variants
    0x12 => 0x2018,         # left quote
    0x13 => 0x2019,         # right quote
    0x21 => 0x21,           # !
    [0x26,0x2F] => 0x26,    # &, ', (, ), *, +, comma, -, ., /
    [0x30,0x39] => 0x30,    # 0-9
    [0x3A,0x3B] => 0x3A,    # :, ;
    0x3D => 0x3D,           # =
    0x3F => 0x3F,           # ?
    [0x41,0x5A] => 0x41,    # A-Z
    0x5B => 0x5B,           # [
    [0x5D,0x5E] => 0x5D,    # ], ^
    [0x61,0x7A] => 0x61,    # a-z
    0x7D => 0x22,           # "
  ],
};

$map{eufb10} = {
  "Fraktur-Bold" => [
    [1,5] => 0xE301,        # variants
    [8,9] => 0xE308,        # variants
    0x12 => 0x2018,         # left quote
    0x13 => 0x2019,         # right quote
    0x21 => 0x21,           # !
    [0x26,0x2F] => 0x26,    # &, ', (, ), *, +, comma, -, ., /
    [0x30,0x39] => 0x30,    # 0-9
    [0x3A,0x3B] => 0x3A,    # :, ;
    0x3D => 0x3D,           # =
    0x3F => 0x3F,           # ?
    [0x41,0x5A] => 0x41,    # A-Z
    0x5B => 0x5B,           # [
    [0x5D,0x5E] => 0x5D,    # ], ^
    [0x61,0x7A] => 0x61,    # a-z
    0x7D => 0x22,           # "
  ],
};

$map{rsfs10} = {
  "Script-Regular" => [
    [0x41,0x5A] => 0x41,    # A-Z
  ]
};

#$map{eusm10} = {
#  "Script-Regular" => [
#    0x3C => 0x211C,         # \Re
#    0x3D => 0x2111,         # \Im
#    0x40 => 0x2135,         # \aleph
#    [0x41,0x5A] => 0x41,    # A-Z
#    0x66 => 0x7B,           # {
#    0x67 => 0x7D,           # }
#    0x78 => 0xA7,           # \S
#  ],
#};

#$map{eusb10} = {
#  "Script-Bold" => [
#    0x3C => 0x211C,         # \Re
#    0x3D => 0x2111,         # \Im
#    0x40 => 0x2135,         # \aleph
#    [0x41,0x5A] => 0x41,    # A-Z
#    0x66 => 0x7B,           # {
#    0x67 => 0x7D,           # }
#    0x78 => 0xA7,           # \S
#  ],
#};

$map{cmtt10} = {
  "Typewriter" => [
    [0,1] => 0x393,         # \Gamma, \Delta
    2 => 0x398,             # \Theta
    3 => 0x39B,             # \Lambda
    4 => 0x39E,             # \Xi
    5 => 0x3A0,             # \Pi
    6 => 0x3A3,             # \Sigma
    [7,8] => 0x3A5,         # \Upsilon, \Phi
    [9,0xA] => 0x3A8,       # \Psi, \Omega
    0xD => 0x2032,          # '

    0x10 => 0x131,          # \i
    0x11 => 0x237,          # \j
    0x12 => 0x2CB,          # \grave
    0x13 => 0x2CA,          # \acute
    0x14 => 0x2C7,          # \check
    0x15 => 0x2D8,          # \breve
    0x16 => 0x2C9,          # \bar
    0x17 => 0xB0,           # \degree
    0x17 => 0x02DA,         # \r, ring above
    0x18 => 0xB8,           # \c, cedilla
    0x20 => 0x2423,         # graphic representation of space

    [0x21,0x7F] => 0x21,

    0x60 => 0x2018,         # left quote
    0x27 => 0x2019,         # right quote
    0x5E => 0x2C6,          # \hat
    0x5F => 0x2D9,          # \dot
    0x7D => 0x2DD,          # double acute
    0x7E => [0x7E,0,-350],  # ~
    0x7E => 0x2DC,          # \tilde
    0x7F => 0xA8,           # \ddot
  ]
};

#########################################################################

$extra{'Main-Regular'} = {
  cdots => [
    'Select(0u22C5)','Copy()',
    'Select(0u22EF)','Paste()',
    'PasteWithOffset(447,0)',
    'PasteWithOffset(894,0)',
    'SetRBearing(894,1)',
  ],

  ldots => [
    'Select(0u2E)','Copy()',
    'Select(0u2026)','Paste()',
    'PasteWithOffset(447,0)',
    'PasteWithOffset(894,0)',
    'SetRBearing(894,1)',
  ],

  vdots => [
    'Select(0u2E)','Copy()',
    'Select(0u22EE)','Clear()',
    'PasteWithOffset(0,-30)',
    'PasteWithOffset(0,380)',
    'PasteWithOffset(0,780)',
    'SetRBearing(-722,1)',
  ],

  ddots => [
    'Select(0u2E)','Copy()',
    'Select(0u22F1)','Clear()',
    'PasteWithOffset(55,700)',
    'PasteWithOffset(502,400)',
    'PasteWithOffset(949,100)',
    'SetRBearing(282,1)',
  ],

  spaceEn => [
    'Select(0u2002)',
    'SetRBearing(500)',
  ],

  spaceEm => [
    'Select(0u2003)',
    'SetRBearing(999)',
  ],

  space3 => [
    'Select(0u2004)',
    'SetRBearing(333)',
  ],

  space4 => [
    'Select(0u2005)',
    'SetRBearing(250)',
  ],

  space6 => [
    'Select(0u2006)',
    'SetRBearing(167)',
  ],

  thinspace => [
    'Select(0u2009)',
    'SetRBearing(167)',
  ],

  hairspace => [
    'Select(0u200A)',
    'SetRBearing(83)',
  ],

  cong => [
    'Select(0u223C)','Copy()',
    'Select(0u2245)','Clear()',
    'PasteWithOffset(0,222)',
    'Select(0u3D)','Copy()',
    'Select(0u2245)',
    'PasteWithOffset(0,-111)',
    'SetWidth(778)',
  ],

  bowtie => [
    'Select(0u25B9)','Copy()',
    'Select(0u22C8)','Paste()',
    'Select(0u25C3)','Copy()',
    'Select(0u22C8)',
    'PasteWithOffset(400,0)',
    'SetRBearing(400,1)',
    'RemoveOverlap()',
  ],

  models => [
    'Select(0u2223)','Copy()',
    'Select(0u22A8)','Paste()',
    'Select(0u3D)','Copy()',
    'Select(0u22A8)',
    'PasteWithOffset(89,0)',
    'SetRBearing(589,1)',
    'RemoveOverlap()',
  ],

  doteq => [
    'Select(0u3D)','Copy()',
    'Select(0u2250)','Paste()',
    'Select(0u2E)','Copy()',
    'Select(0u2250)',
    'PasteWithOffset(251,550)',
  ],

  not => [
    'Select(0uE020)',
    'SetRBearing(778,1)',
  ],

  #notin => [
  #  'Select(0u2208)','Copy()',
  #  'Select(0u2209)','Paste()',
  #  'Select(0u338)','Copy()',
  #  'Select(0u2209)',
  #  'PasteWithOffset(-55,0)',
  #  'RemoveOverlap()',
  #],

  #noteq => [
  #  'Select(0u3D)','Copy()',
  #  'Select(0u2260)','Paste()',
  #  'Select(0u338)','Copy()',
  #  'Select(0u2260)',
  #  'PasteWithOffset(0,0)',
  #  'RemoveOverlap()',
  #],

  longleftarrow => [
    'Select(0u2190)','Copy()',
    'Select(0u27F5)','Paste()',
    'Select(0u2212)','Copy()',
    'Select(0u27F5)',
    'PasteWithOffset(831,0)',
    'SetRBearing(609,1)',
    'RemoveOverlap()','Simplify()',
  ],

  Longleftarrow => [
    'Select(0u21D0)','Copy()',
    'Select(0u27F8)','Paste()',
    'Select(0u3D)','Copy()',
    'Select(0u27F8)',
    'PasteWithOffset(831,0)',
    'SetRBearing(609,1)',
    'RemoveOverlap()','Simplify()',
  ],

  longrightarrow => [
    'Select(0u2212)','Copy()',
    'Select(0u27F6)','Paste()',
    'Select(0u2192)','Copy()',
    'Select(0u27F6)',
    'PasteWithOffset(609,0)',
    'SetRBearing(860,1)',
    'RemoveOverlap()','Simplify()',
  ],

  Longrightarrow => [
    'Select(0u3D)','Copy()',
    'Select(0u27F9)','Paste()',
    'Select(0u21D2)','Copy()',
    'Select(0u27F9)',
    'PasteWithOffset(638,0)',
    'SetRBearing(860,1)',
    'RemoveOverlap()','Simplify()',
  ],

  leftrightarrow => [
    'Select(0u2190)','Copy()',
    'Select(0u27F7)','Paste()',
    'Select(0u2192)','Copy()',
    'Select(0u27F7)',
    'PasteWithOffset(859,0)',
    'SetRBearing(859,1)',
    'RemoveOverlap()','Simplify()',
  ],

  Leftrightarrow => [
    'Select(0u21D0)','Copy()',
    'Select(0u27FA)','Paste()',
    'Select(0u21D2)','Copy()',
    'Select(0u27FA)',
    'PasteWithOffset(858,0)',
    'SetRBearing(858,1)',
    'RemoveOverlap()','Simplify()',
  ],

  mapsto => [
    'Select(0u2192)','Copy()',
    'Select(0u21A6)','Paste()',
    'Generate("otf/KaTeX_Main-Regular.otf")',
    'Open("pfa/cmsy10.pfa")',
    'Select(0x37)','Copy()',
    'Open("otf/KaTeX_Main-Regular.otf")',
    'Select(0u21A6)',
    'PasteWithOffset(0,0)',
    'RemoveOverlap()','Simplify()',
  ],

  xlongmapsto => [
    'Select(0u27F6)','Copy()',
    'Select(0u27FC)','Paste()',
    'Generate("otf/KaTeX_Main-Regular.otf")',
    'Open("pfa/cmsy10.pfa")',
    'Select(0x37)','Copy()',
    'Open("otf/KaTeX_Main-Regular.otf")',
    'Select(0u27FC)',
    'PasteWithOffset(0,0)',
    'RemoveOverlap()','Simplify()',
  ],

  hookleftarrow => [
    'Select(0u2190)','Copy()',
    'Select(0u21A9)','Paste()',
    'Generate("otf/KaTeX_Main-Regular.otf")',
    'Open("pfa/cmmi10.pfa")',
    'Select(0x2D)','Copy()',
    'Open("otf/KaTeX_Main-Regular.otf")',
    'Select(0u21A9)',
    'PasteWithOffset(848,0)',
    'SetRBearing(126,1)',
    'RemoveOverlap()','Simplify()',
  ],

  hookrightarrow => [
    'Generate("otf/KaTeX_Main-Regular.otf")',
    'Open("pfa/cmmi10.pfa")',
    'Select(0x2C)','Copy()',
    'Open("otf/KaTeX_Main-Regular.otf")',
    'Select(0u21AA)','Paste()',
    'Select(0u2192)','Copy()',
    'Select(0u21AA)',
    'PasteWithOffset(126,0)',
    'SetRBearing(848,1)',
    'RemoveOverlap()','Simplify()',
  ],

  rightleftharpoons => [
    'Select(0u21BD)','Copy()',
    'Select(0u21CC)','Paste()',
    'Select(0u21C0)','Copy()',
    'Select(0u21CC)',
    'PasteWithOffset(0,160)',
    'RemoveOverlap()','Simplify()',
  ],

  lgroup => [
    'Select(0u23B0)','Copy()',
    'Select(0u27EE)','Paste()',
    'Select(0u23A9)','Copy()',
    'Select(0u27EE)',
    'PasteWithOffset(0,0)',
    'Scale(55,0,0)','RoundToInt()','Move(-38,250)',
    'RemoveOverlap()','Simplify()',
    'SetRBearing(-38,1)',
  ],

  rgroup => [
    'Select(0u23B1)','Copy()',
    'Select(0u27EF)','Paste()',
    'Select(0u23AD)','Copy()',
    'Select(0u27EF)',
    'PasteWithOffset(1,0)',
    'Scale(55,0,0)','RoundToInt()','Move(-38,250)',
    'RemoveOverlap()','Simplify()',
    'SetRBearing(-38,1)',
  ],

  lmoustache => [
    'Select(0u23AD)','Copy()',
    'Select(0u23B0)',
    'PasteWithOffset(0,0)',
    'Scale(55,0,0)','RoundToInt()','Move(-38,250)',
    'RemoveOverlap()','Simplify()',
    'SetRBearing(-38,1)',
  ],

  rmoustache => [
    'Select(0u23A9)','Copy()',
    'Select(0u23B1)',
    'PasteWithOffset(0,0)',
    'Scale(55,0,0)','RoundToInt()','Move(-38,250)',
    'RemoveOverlap()','Simplify()',
    'SetRBearing(-38,1)',
  ],

  diacriticals => [
    'Select(0uB0)',  'SetRBearing(-125,1)',   # \degree
    'Select(0u20D7)','SetRBearing(153,1)',    # \vec
  ],

};

$extra{'Main-Bold'} = {
  cdots => [
    'Select(0u22C5)','Copy()',
    'Select(0u22EF)','Paste()',
    'PasteWithOffset(488,0)',
    'PasteWithOffset(976,0)',
    'SetRBearing(976,1)',
  ],

  ldots => [
    'Select(0u2E)','Copy()',
    'Select(0u2026)','Paste()',
    'PasteWithOffset(488,0)',
    'PasteWithOffset(976,0)',
    'SetRBearing(976,1)',
  ],

  vdots => [
    'Select(0u2E)','Copy()',
    'Select(0u22EE)','Clear()',
    'PasteWithOffset(0,-30)',
    'PasteWithOffset(0,380)',
    'PasteWithOffset(0,780)',
    'SetRBearing(-681,1)',
  ],

  ddots => [
    'Select(0u2E)','Copy()',
    'Select(0u22F1)','Clear()',
    'PasteWithOffset(55,700)',
    'PasteWithOffset(502,400)',
    'PasteWithOffset(949,100)',
    'SetRBearing(323,1)',
  ],

  spaceEn => [
    'Select(0u2002)',
    'SetRBearing(500)',
  ],

  spaceEm => [
    'Select(0u2003)',
    'SetRBearing(999)',
  ],

  space3 => [
    'Select(0u2004)',
    'SetRBearing(333)',
  ],

  space4 => [
    'Select(0u2005)',
    'SetRBearing(250)',
  ],

  space6 => [
    'Select(0u2006)',
    'SetRBearing(167)',
  ],

  thinspace => [
    'Select(0u2009)',
    'SetRBearing(167)',
  ],

  hairspace => [
    'Select(0u200A)',
    'SetRBearing(83)',
  ],

  cong => [
    'Select(0u223C)','Copy()',
    'Select(0u2245)','Clear()',
    'PasteWithOffset(0,247)',
    'Select(0u3D)','Copy()',
    'Select(0u2245)',
    'PasteWithOffset(0,-136)',
    'SetWidth(894)',
  ],

  bowtie => [
    'Select(0u25B9)','Copy()',
    'Select(0u22C8)','Paste()',
    'Select(0u25C3)','Copy()',
    'Select(0u22C8)',
    'PasteWithOffset(425,0)',
    'SetRBearing(425,1)',
    'RemoveOverlap()',
  ],

  models => [
    'Select(0u2223)','Copy()',
    'Select(0u22A8)','Paste()',
    'Select(0u3D)','Copy()',
    'Select(0u22A8)',
    'PasteWithOffset(89,0)',
    'SetRBearing(655,1)',
    'RemoveOverlap()',
  ],

  doteq => [
    'Select(0u3D)','Copy()',
    'Select(0u2250)','Paste()',
    'Select(0u2E)','Copy()',
    'Select(0u2250)',
    'PasteWithOffset(288,550)',
  ],

  not => [
    'Select(0uE020)',
    'SetRBearing(894,1)',
  ],

#  notin => [
#    'Select(0u2208)','Copy()',
#    'Select(0u2209)','Paste()',
#    'Select(0u338)','Copy()',
#    'Select(0u2209)',
#    'PasteWithOffset(-63,0)',
#    'PasteWithOffset(831,0)',
#    'RemoveOverlap()',
#  ],

#  noteq => [
#    'Select(0u3D)','Copy()',
#    'Select(0u2260)','Paste()',
#    'Select(0u338)','Copy()',
#    'Select(0u2260)',
#    'PasteWithOffset(0,0)',
#    'PasteWithOffset(894,0)',
#    'RemoveOverlap()',
#  ],

  longleftarrow => [
    'Select(0u2190)','Copy()',
    'Select(0u27F5)','Paste()',
    'Select(0u2212)','Copy()',
    'Select(0u27F5)',
    'PasteWithOffset(944,0)',
    'SetRBearing(655,1)',
    'RemoveOverlap()','Simplify()',
  ],

  Longleftarrow => [
    'Select(0u21D0)','Copy()',
    'Select(0u27F8)','Paste()',
    'Select(0u3D)','Copy()',
    'Select(0u27F8)',
    'PasteWithOffset(975,0)',
    'SetRBearing(718,1)',
    'RemoveOverlap()','Simplify()',
  ],

  longrightarrow => [
    'Select(0u2212)','Copy()',
    'Select(0u27F6)','Paste()',
    'Select(0u2192)','Copy()',
    'Select(0u27F6)',
    'PasteWithOffset(688,0)',
    'SetRBearing(939,1)',
    'RemoveOverlap()','Simplify()',
  ],

  Longrightarrow => [
    'Select(0u3D)','Copy()',
    'Select(0u27F9)','Paste()',
    'Select(0u21D2)','Copy()',
    'Select(0u27F9)',
    'PasteWithOffset(720,0)',
    'SetRBearing(976,1)',
    'RemoveOverlap()','Simplify()',
  ],

  leftrightarrow => [
    'Select(0u2190)','Copy()',
    'Select(0u27F7)','Paste()',
    'Select(0u2192)','Copy()',
    'Select(0u27F7)',
    'PasteWithOffset(976,0)',
    'SetRBearing(976,1)',
    'RemoveOverlap()','Simplify()',
  ],

  Leftrightarrow => [
    'Select(0u21D0)','Copy()',
    'Select(0u27FA)','Paste()',
    'Select(0u21D2)','Copy()',
    'Select(0u27FA)',
    'PasteWithOffset(976,0)',
    'SetRBearing(976,1)',
    'RemoveOverlap()','Simplify()',
  ],

  mapsto => [
    'Select(0u2192)','Copy()',
    'Select(0u21A6)','Paste()',
    'Generate("otf/KaTeX_Main-Bold.otf")',
    'Open("pfa/cmbsy10.pfa")',
    'Select(0x37)','Copy()',
    'Open("otf/KaTeX_Main-Bold.otf")',
    'Select(0u21A6)',
    'PasteWithOffset(0,0)',
    'RemoveOverlap()','Simplify()',
  ],

  xlongmapsto => [
    'Select(0u27F6)','Copy()',
    'Select(0u27FC)','Paste()',
    'Generate("otf/KaTeX_Main-Bold.otf")',
    'Open("pfa/cmbsy10.pfa")',
    'Select(0x37)','Copy()',
    'Open("otf/KaTeX_Main-Bold.otf")',
    'Select(0u27FC)',
    'PasteWithOffset(0,0)',
    'RemoveOverlap()','Simplify()',
  ],

  hookleftarrow => [
    'Select(0u2190)','Copy()',
    'Select(0u21A9)','Paste()',
    'Generate("otf/KaTeX_Main-Bold.otf")',
    'Open("pfa/cmmib10.pfa")',
    'Select(0x2D)','Copy()',
    'Open("otf/KaTeX_Main-Bold.otf")',
    'Select(0u21A9)',
    'PasteWithOffset(965,0)',
    'SetRBearing(132,1)',
    'RemoveOverlap()','Simplify()',
  ],

  hookrightarrow => [
    'Generate("otf/KaTeX_Main-Bold.otf")',
    'Open("pfa/cmmib10.pfa")',
    'Select(0x2C)','Copy()',
    'Open("otf/KaTeX_Main-Bold.otf")',
    'Select(0u21AA)','Paste()',
    'Select(0u2192)','Copy()',
    'Select(0u21AA)',
    'PasteWithOffset(132,0)',
    'SetRBearing(963,1)',
    'RemoveOverlap()','Simplify()',
  ],

  rightleftharpoons => [
    'Select(0u21BD)','Copy()',
    'Select(0u21CC)','Paste()',
    'Select(0u21C0)','Copy()',
    'Select(0u21CC)',
    'PasteWithOffset(0,200)',
    'RemoveOverlap()','Simplify()',
  ],

  hbar => [
    'Select(0u2C9)','Copy()',
    'Select(0u210F)','PasteWithOffset(0,0)',
    'RemoveOverlap()','Simplify()',
  ],

  angle => [
    'Select(0u2220)','Copy()',
    'PasteWithOffset(0,10)',
    'PasteWithOffset(0,20)',
    'RemoveOverlap()','Simplify()',
    'PasteWithOffset(10,0)',
    'RemoveOverlap()','Simplify()',
  ],

  diacriticals => [
    'Select(0uB0)',  'SetRBearing(-147,1)',   # \degree
    'Select(0u20D7)','SetRBearing(154,1)',    # \vec
  ],
};

$extra{'Main-Italic'} = {
  diacriticals => [
    'Select(0uB0)',  'SetRBearing(-160,1)',   # \degree
  ],
};

$extra{'Size1'} = {
  iint => [
    'Select(0u222B)', 'Copy()',
    'Select(0u222C)', 'Paste()',
    'PasteWithOffset(347,0)',
    'SetRBearing(347,1)',
  ],

  iiint => [
    'Select(0u222B)', 'Copy()',
    'Select(0u222D)', 'Paste()',
    'PasteWithOffset(347,0)',
    'PasteWithOffset(694,0)',
    'SetRBearing(694,1)',
  ],
};

$extra{'Size2'} = {
  iint => [
    'Select(0u222B)', 'Copy()',
    'Select(0u222C)', 'Paste()',
    'PasteWithOffset(528,0)',
    'SetRBearing(528,1)',
  ],

  iiint => [
    'Select(0u222B)', 'Copy()',
    'Select(0u222D)', 'Paste()',
    'PasteWithOffset(528,0)',
    'PasteWithOffset(1036,0)',
    'SetRBearing(1036,1)',
  ],
};

$extra{'Size4'} = {
  braceext => [
    'Open("lib/Extra.otf")',
    'Select(0u5F)','Copy()',
    'Open("otf/KaTeX_Size4-Regular.otf")',
    'Select(0uE154)','Paste()',
  ],
};

$extra{"AMS"} = {
  dashleftarrow => [
   'Select(0u2190)', 'Copy()',
   'Select(0u21E0)', 'Paste()',
   'Select(0u2212)','Copy()',
   'Select(0u21E0)',
   'PasteWithOffset(417,0)',
   'PasteWithOffset(834,0)',
   'SetRBearing(834,1)',
  ],

  dashrightarrow => [
   'Select(0u2212)', 'Copy()',
   'Select(0u21E2)', 'Paste()',
   'PasteWithOffset(417,0)',
   'Select(0u2192)','Copy()',
   'Select(0u21E2)','PasteWithOffset(834,0)',
   'SetRBearing(834,1)',
  ],
};

$extra{'Typewriter'} = {
  space => [
    'Select(0u20)','Clear()',
    'SetRBearing(525)',
  ],

  spaceNB => [
    'Select(0uA0)','Clear()',
    'SetRBearing(525)',
  ],
};

$extra{"SansSerif-Regular"} = {
  diacriticals => [
    'Select(0uB0)',  'SetRBearing(-142,1)',   # \degree
  ],
};

$extra{"SansSerif-Italic"} = {
  diacriticals => [
    'Select(0uB0)',  'SetRBearing(-113,1)',   # \degree
  ],
};

$extra{"SansSerif-Bold"} = {
  diacriticals => [
    'Select(0uB0)',  'SetRBearing(-58,1)',   # \degree
  ],
};

#########################################################################

foreach $cmfont (sort (keys %map)) {
  print "Reading $cmfont...\n";
  foreach $mjfont (keys %{$map{$cmfont}}) {
    $fontname = "KaTeX_$mjfont";
    $style = $fontname; $style =~ s/.*?(-|$)//; $style = "Regular" unless $style;
    $normal = "Normal"; $normal = "Bold" if style =~ m/Bold/;
    $family = $fontname; $family =~ s/-.*//;
    $fontname = "$family-$style";
    $STYLE = $style; $STYLE = "Bold Italic" if $STYLE eq "BoldItalic";
    $otf = "otf/$fontname.otf";
    unless (defined($script{$mjfont})) {
      open(SPACE,"lib/Space.ttx"); $lines = join("",<SPACE>); close(SPACE);
      $lines =~ s/\*NAME\*/$family/g; $lines =~ s/\*WEIGHT\*/$style/g;
      $lines =~ s/\*WEIGHT_S\*/$STYLE/g; $lines =~ s/\*NORMAL\*/$normal/g;
      if ($style eq "Regular") {$lines =~ s/\* WEIGHT\*//g} else {$lines =~ s/\* WEIGHT\*/ $STYLE/g}
      open(SPACE,">Space.ttx"); print SPACE $lines; close(SPACE);
      `$TTX -f Space.ttx; mv Space.otf '$otf'`; unlink("Space.ttx");
      $script{$mjfont} = [
        'Open("'.$otf.'")',
        'SetPanose([0,0,'.($style eq 'Bold' ? '8' : '0').',0,0,0,0,0,0,0])',
        'SetOS2Value("Weight",'.($style =~ m/Bold/ ? 700 : 400).')',
        'SetGasp(8,2,16,1,65535,3)',
        'Reencode("unicode")',
        'Generate("'.$otf.'")',
      ];
    }
    $script = $script{$mjfont};
    @remap = @{$map{$cmfont}{$mjfont}};
    while (defined($item = shift(@remap))) {
      $remap = shift(@remap);
      if ($cmfont =~ /^eu/) {
	push(@$script,'Open("pfa/'.$cmfont.'.pfb")');
      } else {
	push(@$script,'Open("pfa/'.$cmfont.'.pfa")');
      }
      if (ref($item) eq "ARRAY") {
	push(@$script,'Select('.sprintf("%d,%d",@$item).')');
      } else {
	push(@$script,'Select('.$item.')');
      }
      push(@$script,"Copy()",'Open("'.$otf.'")');
      if (ref($item) eq "ARRAY") {
	push(@$script,
	  'Select('.sprintf("0u%04x,0u%04x",$remap,$remap+($item->[1]-$item->[0])).')',
          'Paste()',
        );
      } elsif (ref($remap) eq "ARRAY") {
        push(@$script,
          'Select('.sprintf("0u%04x",$remap->[0]).')',
          'Paste()',
          'Move('.$remap->[1].','.$remap->[2].')',
        );
      } else {
	push(@$script,'Select('.sprintf("0u%04x",$remap).')','Paste()');
      }
      push(@$script,'Generate("'.$otf.'")');
    }
  }
}
print "\n";


#
#  Add extra characters by hand
#
foreach $font (keys %extra) {
  foreach $char (sort(keys %{$extra{$font}})) {
    push(@{$script{$font}},join(";\n",@{$extra{$font}{$char}}),"");
  }
}

# Cleanup temporary glyphs
push(@{$script{'Main-Regular'}},
  'Select(0u23A9)',
  'Clear()',
  'Select(0u23AD)',
  'Clear()',
);

#
#  Write all scripts
#
foreach $font (sort keys %script) {
  $family = $font; $family .= "-Regular" unless $family =~ m/-/;
  print "KaTeX_$font\n";
  open(SCRIPT,">","ff/KaTeX_$family.ff");
  print SCRIPT join(";\n",@{$script{$font}},"",
                    'SelectAll()','RoundToInt()',
		    'Simplify()','AddExtrema()','Simplify()',
		    'ClearHints()','AutoHint()','RoundToInt()',
		    'Generate("otf/KaTeX_'.$family.'.otf")',
		    'SelectAll()','AutoInstr()',
                    'Generate("ttf/KaTeX_'.$family.'.ttf")'),"\n";
  close(SCRIPT);
}

1;
i	Ǹxg%% filename: xbbold.mf
%% version: 2.2
%% date: 1995/01/04
%%
%% (katex-fonts) The line 69 is modified to prevent overflow
%%
%% American Mathematical Society
%% Technical Support
%% Publications Technical Group
%% 201 Charles Street
%% Providence, RI 02904
%% USA
%% tel: (401) 455-4080
%%      (800) 321-4267 (USA and Canada only)
%% fax: (401) 331-3842
%% email: tech-support@ams.org
%%
%% Copyright 1995, 2009 American Mathematical Society.
%%
%% This Font Software is licensed under the SIL Open Font License,
%% Version 1.1.  This license is in the accompanying file OFL.txt, and
%% is also available with a FAQ at: http://scripts.sil.org/OFL.
%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Changes of minimal parameters in outlined characters for version 2.1
% done by Stefan Lindner, 18-April-1991

input xbbase;
%%mode_setup; %called by amsyb.mf; two calls confuse Metafont. NGB 15-OCT-1991

%%%%designsize:= font_size;                 %  was 10pt#;
width#:=     designsize;                 %  was 10pt#;
unit#:=      width#/18;
u#:=         width#/54;
smallu#:=    width#/162;
ascender#:=  37/3*unit#;
cap#:=       37/3*unit#;
number#:=    36/3*unit#;
xheight#:=   25/3*unit#;
descender#:= 12/4*unit#;
define_whole_vertical_pixels
  (width,unit,u,smallu,ascender,cap,number,xheight,descender);
wpix(1.90u) (linethickness);
wpix(0.65u) (Sover_bot);
wpix(1.00u) (Aapex,Napex,Vapex,Wapex,Cover,Gover,Oover,Sover_top,Uover);
wpix(9.00u) (Uthin_bracket);
wpix(8.00u) (Kthin_diag_bracket,Xthin_diag_bracket,Ythin_diag_bracket);
wpix(7.00u) (k_thin_diag);
wpix(6.00u) (c_thin_stem_bracket);
wpix(5.00u) (c_thick_stem_bracket,c_inner_bracket,lc_thick_stem_bracket);
wpix(4.00u) (c_round_bracket);
adjpix(1.35u) (serif_thickness);
adjpix(1.30u) (Emid_tip,inbeak);
adjpix(1.50u) (Atip,Btopthin,Bmidthin,Ebot_tip,Ltip,Mapex,
               Ntip,Ttip,Vtip,Wtip,Ztip,outbeak);
adjpix(1.65u) (Bbotthin,Gbotthin,Stopthin);
adjpix(1.75u) (Dtopthin,Ebotarm,Lthin,Tthin);
adjpix(1.80u) (Abar,Ctopthin,Dbotthin,Gtopthin,Jbotthin,Pmidarm,Sbotthin);
adjpix(1.90u) (Emidarm,Etoparm,Othin,Pthin,Rthin,Ydiag,Zthin);
adjpix(2.00u) (kthin,Mthin_diag,Wleftthin);
adjpix(2.10u) (Ctip);
adjpix(2.25u) (Athin,Kthin,Mthin_vert,Nthin,Uthin,Vthin,Wrightthin,Xthin);
adjpix(2.50u) (Hbar);
adjpix(2.60u) (Cbotthin);


%%%% Begin of changes for version 2.1
%(katex-fonts) Originally was pixels_per_inch*designsize < 1500:
if pixels_per_inch < 1500/designsize:
   if pixels_per_inch*designsize < 1000:
      if pixels_per_inch*designsize < 800:
         if pixels_per_inch*designsize < 700:
            minadjpix(0)(8.80u) (stem);
            minadjpix(0)(6.80u) (kdiag);
            minadjpix(0)(7.40u) (kstem);
            minadjpix(0)(7.80u) (Jbulb,Mdiag);
            minadjpix(0)(8.20u) (Kdiag);
            minadjpix(0)(8.30u) (Gstem,Mstem);
            minadjpix(0)(8.60u) (Lstem,Ustem,Ythick_diag);
            minadjpix(0)(8.50u) (Bstem,Estem,Fstem,Ndiag,Rdiag,Xdiag,Zdiag);
            minadjpix(0)(8.90u) (Btopcurve);
            minadjpix(1)(9.30u) (Bbotcurve,Pcurve,Rcurve);
            minadjpix(1)(9.50u) (Ccurve,Dcurve,Gcurve,Ocurve);
         else:
            minadjpix(1)(8.80u) (stem);
            minadjpix(1)(6.80u) (kdiag);
            minadjpix(1)(7.40u) (kstem);
            minadjpix(1)(7.80u) (Jbulb,Mdiag);
            minadjpix(1)(8.20u) (Kdiag);
            minadjpix(1)(8.30u) (Gstem,Mstem);
            minadjpix(1)(8.60u) (Lstem,Ustem,Ythick_diag);
            minadjpix(1)(8.50u) (Bstem,Estem,Fstem,Ndiag,Rdiag,Xdiag,Zdiag);
            minadjpix(1)(8.90u) (Btopcurve);
            minadjpix(2)(9.30u) (Bbotcurve,Pcurve,Rcurve);
            minadjpix(2)(9.50u) (Ccurve,Dcurve,Gcurve,Ocurve);
         fi
      else:
         adjpix(3.0u) (Mapex);
         minadjpix(1)(8.80u) (stem);
         minadjpix(2)(6.80u) (kdiag);
         minadjpix(2)(7.40u) (kstem);
         minadjpix(2)(7.80u) (Jbulb);
         minadjpix(1)(6.00u) (Mdiag);
         minadjpix(2)(8.20u) (Kdiag);
         minadjpix(2)(8.30u) (Gstem)
         minadjpix(2)(8.30u) (Mstem);
         minadjpix(2)(8.60u) (Lstem,Ustem,Ythick_diag);
         minadjpix(2)(8.50u) (Bstem,Ndiag,Rdiag,Xdiag,Zdiag);
         minadjpix(1)(8.50u) (Estem, Fstem);
         minadjpix(2)(8.90u) (Btopcurve);
         minadjpix(3)(9.30u) (Bbotcurve,Pcurve,Rcurve);
         minadjpix(3)(9.50u) (Ccurve,Dcurve,Gcurve,Ocurve);
      fi
   else:
      adjpix(3.0u) (Mapex);
      minadjpix(2)(8.80u) (stem);
      minadjpix(3)(6.80u) (kdiag);
      minadjpix(3)(7.40u) (kstem);
      minadjpix(3)(7.80u) (Jbulb);
      minadjpix(1)(5.00u) (Mdiag);
      minadjpix(3)(8.20u) (Kdiag);
      minadjpix(3)(8.30u) (Gstem);
      minadjpix(2)(8.30u) (Mstem);
      minadjpix(3)(8.60u) (Lstem,Ustem,Ythick_diag);
      minadjpix(3)(8.50u) (Estem,Fstem,Ndiag,Rdiag,Xdiag,Zdiag);
      minadjpix(2)(8.50u) (Bstem);
      minadjpix(3)(8.90u) (Btopcurve);
      minadjpix(3)(9.30u) (Bbotcurve,Pcurve,Rcurve);
      minadjpix(3)(9.50u) (Ccurve,Dcurve,Gcurve,Ocurve)
   fi
else:
   minadjpix(4)(8.80u) (stem);
   minadjpix(4)(6.80u) (kdiag);
   minadjpix(4)(7.40u) (kstem);
   minadjpix(4)(7.80u) (Jbulb,Mdiag);
   minadjpix(4)(8.20u) (Kdiag);
   minadjpix(4)(8.30u) (Gstem,Mstem);
   minadjpix(4)(8.60u) (Lstem,Ustem,Ythick_diag);
   minadjpix(4)(8.50u) (Bstem,Estem,Fstem,Ndiag,Rdiag,Xdiag,Zdiag);
   minadjpix(4)(8.90u) (Btopcurve);
   minadjpix(5)(9.30u) (Bbotcurve,Pcurve,Rcurve);
   minadjpix(5)(9.50u) (Ccurve,Dcurve,Gcurve,Ocurve)
fi;
%%%% end of changes for version 2.1

boolean lowres; lowres:=width<50;
highres_lowres(pullin)    (.85)(1);  % Emidarm
highres_lowres(pulleven)  (1)(1.3);  % Etoparm,Tarms,Zarms
highres_lowres(pullout)   (1.1)(1);  % Ebotarm,Lbotarm
highres_lowres(bracket0)  (.0)(0);   % Ntopleft
highres_lowres(bracket3)  (.3)(0);   % Nthinstems
highres_lowres(bracket01) (.0)(.1);  % Uthin
highres_lowres(bracket32) (.3)(.2);  % Vstems
highres_lowres(bracket4)  (.4)(0);   % P-all,R-all,I-all,F-all
highres_lowres(bracket42) (.4)(.2);  % Xdiag

bool(ctrls):=false;
entasis:=inlimit(0)(0,1);
serif_constant_amt:=0pt;
join_radius:=1;
bool(softpath):=true;

c_thick_stem_bracket:=min(.5cap-eps,c_thick_stem_bracket);
rulepen:=pensquare scaled 1;
extra_beginchar:=extra_beginchar&"save t,p,ref; path p[],p[]',p[]'',ref[];";
extra_beginchar:=extra_beginchar&"pickup pencircle scaled linethickness;";

for x:="R":
 wanted[byte x]:=true; endfor                    % test these characters
 let iff=always_iff;                             % tests all chars in the file

font_normal_space .3width#;         % TeX fontdimen 2 normal word space
font_normal_stretch .15width#;      % TeX fontdimen 3 interword stretch
font_normal_shrink .1width#;        % TeX fontdimen 4 interword shrink
font_x_height xheight#;             % Tex fontdinem 5 for accents
font_quad width#;                   % TeX fontdimen 6 quad width
font_extra_space .1width#;          % TeX fontdimen 7 extra space(period)


input xbcaps
bye                                 % changed from "end" 26 Aug 93; bnb
<hx~/** Include this to ensure that all functions are defined. */
import {_functions} from "./defineFunction";

const functions = _functions;
export default functions;

// TODO(kevinb): have functions return an object and call defineFunction with
// that object in this file instead of relying on side-effects.
import "./functions/accent";
import "./functions/accentunder";
import "./functions/arrow";
import "./functions/pmb";
import "./environments/cd";
import "./functions/char";
import "./functions/color";
import "./functions/cr";
import "./functions/def";
import "./functions/delimsizing";
import "./functions/enclose";
import "./functions/environment";
import "./functions/font";
import "./functions/genfrac";
import "./functions/horizBrace";
import "./functions/href";
import "./functions/hbox";
import "./functions/html";
import "./functions/htmlmathml";
import "./functions/includegraphics";
import "./functions/kern";
import "./functions/lap";
import "./functions/math";
import "./functions/mathchoice";
import "./functions/mclass";
import "./functions/op";
import "./functions/operatorname";
import "./functions/ordgroup";
import "./functions/overline";
import "./functions/phantom";
import "./functions/raisebox";
import "./functions/relax";
import "./functions/rule";
import "./functions/sizing";
import "./functions/smash";
import "./functions/sqrt";
import "./functions/styling";
import "./functions/supsub";
import "./functions/symbolsOp";
import "./functions/symbolsOrd";
import "./functions/symbolsSpacing";
import "./functions/tag";
import "./functions/text";
import "./functions/underline";
import "./functions/vcenter";
import "./functions/verb";
TKkxE100644 accent.ts zo)>9E?100644 accentunder.ts V$ZWcWu c100644 arrow.ts 4
>B~4(F100644 char.ts e!"юN]%100644 color.ts J}
`
F`100644 cr.ts ,ݘ=a%p100644 def.ts EtV<$	M3Wغ(100644 delimsizing.ts XÙQLLH{Sf100644 enclose.ts Tp@QPmFxTd100644 environment.ts }eYP`Nu-Mz^j}2100644 font.ts ϱA*^:NiZԍ[100644 genfrac.ts 'gTaW^Qp100644 hbox.ts ]ӎu1100644 horizBrace.ts ڞK)'Y`.ЀU100644 href.ts (\Oe	0100644 html.ts fJġ=2cgb	&100644 htmlmathml.ts  9	F_HRp100644 includegraphics.ts  osG}T6/:100644 kern.ts  ' M"

n100644 lap.ts 5pCI~հ100644 math.ts l*E2D+x8100644 mathchoice.ts =gjXg100644 mclass.ts xv#)k100644 op.ts b1IHhƦx,100644 operatorname.ts r]M"|2100644 ordgroup.ts ("R)q%s2Gc,100644 overline.ts yY(Ѓr"100644 phantom.ts Q<I2Rϩ100644 pmb.ts J񄧠tJ"1^vV'100644 raisebox.ts X6FcfP"100644 relax.ts ЏW® Й3B100644 rule.ts ƗEpz_18of100644 sizing.ts W<Vw[1yv100644 smash.ts ~YT5Sh100644 sqrt.ts 
1OG'H>k~100644 styling.ts W֪mF100644 supsub.ts GL8{nu100644 symbolsOp.ts o.3|
'\u100644 symbolsOrd.ts ^ɘX100644 symbolsSpacing.ts ,نK@O1Mf?100644 tag.ts #(|TɮV࣌100644 text.ts B߳`j\\&100644 underline.ts ϹCI/4m40000 utils ˢ E=gk$7Yn100644 vcenter.ts 
n_pn*e100644 verb.ts F*Ê-~-Δd+_x'import defineFunction, {normalizeArgument} from "../defineFunction";
import {makeOrd, makeSpan, makeVList, staticSvg, svgData} from "../buildCommon";
import {isCharacterBox} from "../utils";
import {MathNode} from "../mathMLTree";
import {stretchyMathML, stretchySvg} from "../stretchy";
import {assertNodeType} from "../parseNode";
import {assertSpan, assertSymbolDomNode, hasHtmlDomChildren, SymbolNode} from "../domTree";
import {makeEm} from "../units";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";

import type {ParseNode, AnyParseNode} from "../parseNode";
import type {HtmlBuilderSupSub, MathMLBuilder} from "../defineFunction";
import type {HtmlDomNode} from "../domTree";

const getBaseSymbol = (group: HtmlDomNode): SymbolNode | undefined => {
    if (group instanceof SymbolNode) {
        return group;
    }
    if (hasHtmlDomChildren(group) && group.children.length === 1) {
        return getBaseSymbol(group.children[0]);
    }
};

// NOTE: Unlike most `htmlBuilder`s, this one handles not only "accent", but
// also "supsub" since an accent can affect super/subscripting.
export const htmlBuilder: HtmlBuilderSupSub<"accent"> = (grp, options) => {
    // Accents are handled in the TeXbook pg. 443, rule 12.
    let base: AnyParseNode;
    let group: ParseNode<"accent">;

    let supSubGroup;
    if (grp && grp.type === "supsub") {
        // If our base is a character box, and we have superscripts and
        // subscripts, the supsub will defer to us. In particular, we want
        // to attach the superscripts and subscripts to the inner body (so
        // that the position of the superscripts and subscripts won't be
        // affected by the height of the accent). We accomplish this by
        // sticking the base of the accent into the base of the supsub, and
        // rendering that, while keeping track of where the accent is.

        // The real accent group is the base of the supsub group
        group = assertNodeType(grp.base, "accent");
        // The character box is the base of the accent group
        base = group.base;
        // Stick the character box into the base of the supsub group
        grp.base = base;

        // Rerender the supsub group with its new base, and store that
        // result.
        supSubGroup = assertSpan(html.buildGroup(grp, options));

        // reset original base
        grp.base = group;
    } else {
        group = assertNodeType(grp, "accent");
        base = group.base;
    }

    // Build the base group
    const body = html.buildGroup(base, options.havingCrampedStyle());

    // Does the accent need to shift for the skew of a character?
    const mustShift = group.isShifty && isCharacterBox(base);

    // Calculate the skew of the accent. This is based on the line "If the
    // nucleus is not a single character, let s = 0; otherwise set s to the
    // kern amount for the nucleus followed by the \skewchar of its font."
    // Note that our skew metrics are just the kern between each character
    // and the skewchar.
    let skew = 0;
    if (mustShift) {
        // Read the skew from the rendered base symbol.
        // This preserves font metrics from font wrappers like \mathbb.
        skew = getBaseSymbol(body)?.skew ?? 0;
    }

    const accentBelow = group.label === "\\c";

    // calculate the amount of space between the body and the accent
    let clearance = accentBelow
        ? body.height + body.depth
        : Math.min(
            body.height,
            options.fontMetrics().xHeight);

    // Build the accent
    let accentBody;
    if (!group.isStretchy) {
        let accent;
        let width: number;
        if (group.label === "\\vec") {
            // Before version 0.9, \vec used the combining font glyph U+20D7.
            // But browsers, especially Safari, are not consistent in how they
            // render combining characters when not preceded by a character.
            // So now we use an SVG.
            // If Safari reforms, we should consider reverting to the glyph.
            accent = staticSvg("vec", options);
            width = svgData.vec[1];
        } else {
            accent = makeOrd({type: "textord", mode: group.mode, text: group.label},
                options, "textord");
            accent = assertSymbolDomNode(accent);
            // Remove the italic correction of the accent, because it only serves to
            // shift the accent over to a place we don't want.
            accent.italic = 0;
            width = accent.width;
            if (accentBelow) {
                clearance += accent.depth;
            }
        }

        accentBody = makeSpan(["accent-body"], [accent]);

        // "Full" accents expand the width of the resulting symbol to be
        // at least the width of the accent, and overlap directly onto the
        // character without any vertical offset.
        const accentFull = (group.label === "\\textcircled");
        if (accentFull) {
            accentBody.classes.push('accent-full');
            clearance = body.height;
        }

        // Shift the accent over by the skew.
        let left = skew;

        // CSS defines `.katex .accent .accent-body:not(.accent-full) { width: 0 }`
        // so that the accent doesn't contribute to the bounding box.
        // We need to shift the character by its width (effectively half
        // its width) to compensate.
        if (!accentFull) {
            left -= width / 2;
        }

        accentBody.style.left = makeEm(left);

        // \textcircled uses the \bigcirc glyph, so it needs some
        // vertical adjustment to match LaTeX.
        if (group.label === "\\textcircled") {
            accentBody.style.top = ".2em";
        }

        accentBody = makeVList({
            positionType: "firstBaseline",
            children: [
                {type: "elem", elem: body},
                {type: "kern", size: -clearance},
                {type: "elem", elem: accentBody},
            ],
        }, options);

    } else {
        accentBody = stretchySvg(group, options);

        accentBody = makeVList({
            positionType: "firstBaseline",
            children: [
                {type: "elem", elem: body},
                {
                    type: "elem",
                    elem: accentBody,
                    wrapperClasses: ["svg-align"],
                    wrapperStyle: skew > 0
                        ? {
                            width: `calc(100% - ${makeEm(2 * skew)})`,
                            marginLeft: makeEm(2 * skew),
                        }
                        : undefined,
                },
            ],
        }, options);
    }

    const accentWrap =
        makeSpan(["mord", "accent"], [accentBody], options);

    if (supSubGroup) {
        // Here, we replace the "base" child of the supsub with our newly
        // generated accent.
        supSubGroup.children[0] = accentWrap;

        // Since we don't rerun the height calculation after replacing the
        // accent, we manually recalculate height.
        supSubGroup.height = Math.max(accentWrap.height, supSubGroup.height);

        // Accents should always be ords, even when their innards are not.
        supSubGroup.classes[0] = "mord";

        return supSubGroup;
    } else {
        return accentWrap;
    }
};

const mathmlBuilder: MathMLBuilder<"accent"> = (group, options) => {
    const accentNode =
        group.isStretchy ?
            stretchyMathML(group.label) :
            new MathNode("mo", [mml.makeText(group.label, group.mode)]);

    const node = new MathNode(
        "mover",
        [mml.buildGroup(group.base, options), accentNode]);

    node.setAttribute("accent", "true");

    return node;
};

const NON_STRETCHY_ACCENT_REGEX = new RegExp([
    "\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve",
    "\\check", "\\hat", "\\vec", "\\dot", "\\mathring",
].map(accent => `\\${accent}`).join("|"));

// Accents
defineFunction({
    type: "accent",
    names: [
        "\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve",
        "\\check", "\\hat", "\\vec", "\\dot", "\\mathring", "\\widecheck",
        "\\widehat", "\\widetilde", "\\overrightarrow", "\\overleftarrow",
        "\\Overrightarrow", "\\overleftrightarrow", "\\overgroup",
        "\\overlinesegment", "\\overleftharpoon", "\\overrightharpoon",
    ],
    props: {
        numArgs: 1,
    },
    handler: (context, args) => {
        const base = normalizeArgument(args[0]);

        const isStretchy = !NON_STRETCHY_ACCENT_REGEX.test(context.funcName);
        const isShifty = !isStretchy ||
            context.funcName === "\\widehat" ||
            context.funcName === "\\widetilde" ||
            context.funcName === "\\widecheck";

        return {
            type: "accent",
            mode: context.parser.mode,
            label: context.funcName,
            isStretchy: isStretchy,
            isShifty: isShifty,
            base: base,
        };
    },
    htmlBuilder,
    mathmlBuilder,
});

// Text-mode accents
defineFunction({
    type: "accent",
    names: [
        "\\'", "\\`", "\\^", "\\~", "\\=", "\\u", "\\.", '\\"',
        "\\c", "\\r", "\\H", "\\v", "\\textcircled",
    ],
    props: {
        numArgs: 1,
        allowedInText: true,
        allowedInMath: true, // unless in strict mode
        argTypes: ["primitive"],
    },
    handler: (context, args) => {
        const base = args[0];
        let mode = context.parser.mode;

        if (mode === "math") {
            context.parser.settings.reportNonstrict("mathVsTextAccents",
                `LaTeX's accent ${context.funcName} works only in text mode`);
            mode = "text";
        }

        return {
            type: "accent",
            mode: mode,
            label: context.funcName,
            isStretchy: false,
            isShifty: true,
            base: base,
        };
    },
    htmlBuilder,
    mathmlBuilder,
});
{Ewxr// Horizontal overlap functions
import defineFunction from "../defineFunction";
import {makeSpan, makeVList} from "../buildCommon";
import {MathNode} from "../mathMLTree";
import {stretchyMathML, stretchySvg} from "../stretchy";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";

import type {ParseNode} from "../parseNode";

defineFunction({
    type: "accentUnder",
    names: [
        "\\underleftarrow", "\\underrightarrow", "\\underleftrightarrow",
        "\\undergroup", "\\underlinesegment", "\\utilde",
    ],
    props: {
        numArgs: 1,
    },
    handler: ({parser, funcName}, args) => {
        const base = args[0];
        return {
            type: "accentUnder",
            mode: parser.mode,
            label: funcName,
            base: base,
        };
    },
    htmlBuilder: (group: ParseNode<"accentUnder">, options) => {
        // Treat under accents much like underlines.
        const innerGroup = html.buildGroup(group.base, options);

        const accentBody = stretchySvg(group, options);
        const kern = group.label === "\\utilde" ? 0.12 : 0;

        // Generate the vlist, with the appropriate kerns
        const vlist = makeVList({
            positionType: "top",
            positionData: innerGroup.height,
            children: [
                {type: "elem", elem: accentBody, wrapperClasses: ["svg-align"]},
                {type: "kern", size: kern},
                {type: "elem", elem: innerGroup},
            ],
        }, options);

        return makeSpan(["mord", "accentunder"], [vlist], options);
    },
    mathmlBuilder: (group, options) => {
        const accentNode = stretchyMathML(group.label);
        const node = new MathNode(
            "munder",
            [mml.buildGroup(group.base, options), accentNode]
        );
        node.setAttribute("accentunder", "true");
        return node;
    },
});
>xJimport defineFunction from "../defineFunction";
import {makeSpan, makeVList, wrapFragment} from "../buildCommon";
import {MathNode} from "../mathMLTree";
import {stretchyMathML, stretchySvg} from "../stretchy";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";

import type {ParseNode} from "../parseNode";
import type {MathDomNode} from "../mathMLTree";

// Helper function
const paddedNode = (group?: MathDomNode | null | undefined) => {
    const node = new MathNode("mpadded", group ? [group] : []);
    node.setAttribute("width", "+0.6em");
    node.setAttribute("lspace", "0.3em");
    return node;
};

// Stretchy arrows with an optional argument
defineFunction({
    type: "xArrow",
    names: [
        "\\xleftarrow", "\\xrightarrow", "\\xLeftarrow", "\\xRightarrow",
        "\\xleftrightarrow", "\\xLeftrightarrow", "\\xhookleftarrow",
        "\\xhookrightarrow", "\\xmapsto", "\\xrightharpoondown",
        "\\xrightharpoonup", "\\xleftharpoondown", "\\xleftharpoonup",
        "\\xrightleftharpoons", "\\xleftrightharpoons", "\\xlongequal",
        "\\xtwoheadrightarrow", "\\xtwoheadleftarrow", "\\xtofrom",
        // The next 3 functions are here to support the mhchem extension.
        // Direct use of these functions is discouraged and may break someday.
        "\\xrightleftarrows", "\\xrightequilibrium", "\\xleftequilibrium",
        // The next 3 functions are here only to support the {CD} environment.
        "\\\\cdrightarrow", "\\\\cdleftarrow", "\\\\cdlongequal",
    ],
    props: {
        numArgs: 1,
        numOptionalArgs: 1,
    },
    handler({parser, funcName}, args, optArgs) {
        return {
            type: "xArrow",
            mode: parser.mode,
            label: funcName,
            body: args[0],
            below: optArgs[0],
        };
    },
    htmlBuilder(group: ParseNode<"xArrow">, options) {
        const style = options.style;

        // Build the argument groups in the appropriate style.
        // Ref: amsmath.dtx:   \hbox{$\scriptstyle\mkern#3mu{#6}\mkern#4mu$}%

        // Some groups can return document fragments.  Handle those by wrapping
        // them in a span.
        let newOptions = options.havingStyle(style.sup());
        const upperGroup = wrapFragment(
            html.buildGroup(group.body, newOptions, options), options);
        const arrowPrefix = group.label.slice(0, 2) === "\\x" ? "x" : "cd";
        upperGroup.classes.push(arrowPrefix + "-arrow-pad");

        let lowerGroup;
        if (group.below) {
            // Build the lower group
            newOptions = options.havingStyle(style.sub());
            lowerGroup = wrapFragment(
                html.buildGroup(group.below, newOptions, options), options);
            lowerGroup.classes.push(arrowPrefix + "-arrow-pad");
        }

        const arrowBody = stretchySvg(group, options);

        // Re shift: Note that stretchySvg returned arrowBody.depth = 0.
        // The point we want on the math axis is at 0.5 * arrowBody.height.
        const arrowShift = -options.fontMetrics().axisHeight +
            0.5 * arrowBody.height;
        // 2 mu kern. Ref: amsmath.dtx: #7\if0#2\else\mkern#2mu\fi
        let upperShift = -options.fontMetrics().axisHeight
            - 0.5 * arrowBody.height - 0.111; // 0.111 em = 2 mu
        if (upperGroup.depth > 0.25 || group.label === "\\xleftequilibrium") {
            upperShift -= upperGroup.depth;  // shift up if depth encroaches
        }

        // Generate the vlist
        let vlist;
        if (lowerGroup) {
            const lowerShift = -options.fontMetrics().axisHeight
                + lowerGroup.height + 0.5 * arrowBody.height
                + 0.111;
            vlist = makeVList({
                positionType: "individualShift",
                children: [
                    {type: "elem", elem: upperGroup, shift: upperShift},
                    {type: "elem", elem: arrowBody,  shift: arrowShift,
                        wrapperClasses: ["svg-align"]},
                    {type: "elem", elem: lowerGroup, shift: lowerShift},
                ],
            }, options);
        } else {
            vlist = makeVList({
                positionType: "individualShift",
                children: [
                    {type: "elem", elem: upperGroup, shift: upperShift},
                    {type: "elem", elem: arrowBody,  shift: arrowShift,
                        wrapperClasses: ["svg-align"]},
                ],
            }, options);
        }

        return makeSpan(["mrel", "x-arrow"], [vlist], options);
    },
    mathmlBuilder(group, options) {
        const arrowNode = stretchyMathML(group.label);
        arrowNode.setAttribute(
            "minsize", group.label.charAt(0) === "x" ? "1.75em" : "3.0em"
        );
        let node;

        if (group.body) {
            const upperNode = paddedNode(mml.buildGroup(group.body, options));
            if (group.below) {
                const lowerNode = paddedNode(mml.buildGroup(group.below, options));
                node = new MathNode(
                    "munderover", [arrowNode, lowerNode, upperNode]
                );
            } else {
                node = new MathNode("mover", [arrowNode, upperNode]);
            }
        } else if (group.below) {
            const lowerNode = paddedNode(mml.buildGroup(group.below, options));
            node = new MathNode("munder", [arrowNode, lowerNode]);
        } else {
            // This should never happen.
            // Parser.js throws an error if there is no argument.
            node = paddedNode();
            node = new MathNode("mover", [arrowNode, node]);
        }
        return node;
    },
});
οcx?import defineFunction from "../defineFunction";
import ParseError from "../ParseError";
import {assertNodeType} from "../parseNode";

// \@char is an internal function that takes a grouped decimal argument like
// {123} and converts into symbol with code 123.  It is used by the *macro*
// \char defined in macros.js.
defineFunction({
    type: "textord",
    names: ["\\@char"],
    props: {
        numArgs: 1,
        allowedInText: true,
    },
    handler({parser}, args) {
        const arg = assertNodeType(args[0], "ordgroup");
        const group = arg.body;
        let number = "";
        for (let i = 0; i < group.length; i++) {
            const node = assertNodeType(group[i], "textord");
            number += node.text;
        }
        let code = parseInt(number);
        let text;
        if (isNaN(code)) {
            throw new ParseError(`\\@char has non-numeric argument ${number}`);
        // If we drop IE support, the following code could be replaced with
        // text = String.fromCodePoint(code)
        } else if (code < 0 || code >= 0x10ffff) {
            throw new ParseError(`\\@char with invalid code point ${number}`);
        } else if (code <= 0xffff) {
            text = String.fromCharCode(code);
        } else { // Astral code point; split into surrogate halves
            code -= 0x10000;
            text = String.fromCharCode((code >> 10) + 0xd800,
                                       (code & 0x3ff) + 0xdc00);
        }
        return {
            type: "textord",
            mode: parser.mode,
            text: text,
        };
    },
});
N_x)
import defineFunction, {ordargument} from "../defineFunction";
import {makeFragment} from "../buildCommon";
import {MathNode} from "../mathMLTree";
import {assertNodeType} from "../parseNode";
import type {AnyParseNode} from "../parseNode";
import type {HtmlBuilder, MathMLBuilder} from "../defineFunction";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";

const htmlBuilder: HtmlBuilder<"color"> = (group, options) => {
    const elements = html.buildExpression(
        group.body,
        options.withColor(group.color),
        false
    );

    // \color isn't supposed to affect the type of the elements it contains.
    // To accomplish this, we wrap the results in a fragment, so the inner
    // elements will be able to directly interact with their neighbors. For
    // example, `\color{red}{2 +} 3` has the same spacing as `2 + 3`
    return makeFragment(elements);
};

const mathmlBuilder: MathMLBuilder<"color"> = (group, options) => {
    const inner = mml.buildExpression(group.body,
        options.withColor(group.color));

    const node = new MathNode("mstyle", inner);

    node.setAttribute("mathcolor", group.color);

    return node;
};

defineFunction({
    type: "color",
    names: ["\\textcolor"],
    props: {
        numArgs: 2,
        allowedInText: true,
        argTypes: ["color", "original"],
    },
    handler({parser}, args) {
        const color = assertNodeType(args[0], "color-token").color;
        const body = args[1];
        return {
            type: "color",
            mode: parser.mode,
            color,
            body: (ordargument(body) as AnyParseNode[]),
        };
    },
    htmlBuilder,
    mathmlBuilder,
});

defineFunction({
    type: "color",
    names: ["\\color"],
    props: {
        numArgs: 1,
        allowedInText: true,
        argTypes: ["color"],
    },
    handler({parser, breakOnTokenText}, args) {
        const color = assertNodeType(args[0], "color-token").color;

        // Set macro \current@color in current namespace to store the current
        // color, mimicking the behavior of color.sty.
        // This is currently used just to correctly color a \right
        // that follows a \color command.
        parser.gullet.macros.set("\\current@color", color);

        // Parse out the implicit body that should be colored.
        const body: AnyParseNode[] = parser.parseExpression(true, breakOnTokenText);

        return {
            type: "color",
            mode: parser.mode,
            color,
            body,
        };
    },
    htmlBuilder,
    mathmlBuilder,
});
.sx>// Row breaks within tabular environments, and line breaks at top level

import defineFunction from "../defineFunction";
import {makeSpan} from "../buildCommon";
import {MathNode} from "../mathMLTree";
import {calculateSize, makeEm} from "../units";
import {assertNodeType} from "../parseNode";

// \DeclareRobustCommand\\{...\@xnewline}
defineFunction({
    type: "cr",
    names: ["\\\\"],
    props: {
        numArgs: 0,
        numOptionalArgs: 0,
        allowedInText: true,
    },

    handler({parser}, args, optArgs) {
        const size = parser.gullet.future().text === "[" ?
            parser.parseSizeGroup(true) : null;
        const newLine = !parser.settings.displayMode ||
            !parser.settings.useStrictBehavior(
                "newLineInDisplayMode", "In LaTeX, \\\\ or \\newline " +
                "does nothing in display mode");
        return {
            type: "cr",
            mode: parser.mode,
            newLine,
            size: size && assertNodeType(size, "size").value,
        };
    },

    // The following builders are called only at the top level,
    // not within tabular/array environments.

    htmlBuilder(group, options) {
        const span = makeSpan(["mspace"], [], options);
        if (group.newLine) {
            span.classes.push("newline");
            if (group.size) {
                span.style.marginTop =
                    makeEm(calculateSize(group.size, options));
            }
        }
        return span;
    },

    mathmlBuilder(group, options) {
        const node = new MathNode("mspace");
        if (group.newLine) {
            node.setAttribute("linebreak", "newline");
            if (group.size) {
                node.setAttribute("height",
                    makeEm(calculateSize(group.size, options)));
            }
        }
        return node;
    },
});
8$봽x+import defineFunction from "../defineFunction";
import ParseError from "../ParseError";
import {assertNodeType} from "../parseNode";
import {Token} from "../Token";

import type Parser from "../Parser";

const globalMap: Record<string, string> = {
    "\\global": "\\global",
    "\\long": "\\\\globallong",
    "\\\\globallong": "\\\\globallong",
    "\\def": "\\gdef",
    "\\gdef": "\\gdef",
    "\\edef": "\\xdef",
    "\\xdef": "\\xdef",
    "\\let": "\\\\globallet",
    "\\futurelet": "\\\\globalfuture",
};

const checkControlSequence = (tok: Token): string => {
    const name = tok.text;
    if (/^(?:[\\{}$&#^_]|EOF)$/.test(name)) {
        throw new ParseError("Expected a control sequence", tok);
    }
    return name;
};

const getRHS = (parser: Parser): Token => {
    let tok = parser.gullet.popToken();
    if (tok.text === "=") { // consume optional equals
        tok = parser.gullet.popToken();
        if (tok.text === " ") { // consume one optional space
            tok = parser.gullet.popToken();
        }
    }
    return tok;
};

const letCommand = (parser: Parser, name: string, tok: Token, global: boolean) => {
    let macro = parser.gullet.macros.get(tok.text);
    if (macro == null) {
        // don't expand it later even if a macro with the same name is defined
        // e.g., \let\foo=\frac \def\frac{\relax} \frac12
        tok.noexpand = true;
        macro = {
            tokens: [tok],
            numArgs: 0,
            // reproduce the same behavior in expansion
            unexpandable: !parser.gullet.isExpandable(tok.text),
        };
    }
    parser.gullet.macros.set(name, macro, global);
};

// <assignment> -> <non-macro assignment>|<macro assignment>
// <non-macro assignment> -> <simple assignment>|\global<non-macro assignment>
// <macro assignment> -> <definition>|<prefix><macro assignment>
// <prefix> -> \global|\long|\outer
defineFunction({
    type: "internal",
    names: [
        "\\global", "\\long",
        "\\\\globallong", // can’t be entered directly
    ],
    props: {
        numArgs: 0,
        allowedInText: true,
    },
    handler({parser, funcName}) {
        parser.consumeSpaces();
        const token = parser.fetch();
        if (globalMap[token.text]) {
            // KaTeX doesn't have \par, so ignore \long
            if (funcName === "\\global" || funcName === "\\\\globallong") {
                token.text = globalMap[token.text];
            }
            return assertNodeType(parser.parseFunction(), "internal");
        }
        throw new ParseError(`Invalid token after macro prefix`, token);
    },
});

// Basic support for macro definitions: \def, \gdef, \edef, \xdef
// <definition> -> <def><control sequence><definition text>
// <def> -> \def|\gdef|\edef|\xdef
// <definition text> -> <parameter text><left brace><balanced text><right brace>
defineFunction({
    type: "internal",
    names: ["\\def", "\\gdef", "\\edef", "\\xdef"],
    props: {
        numArgs: 0,
        allowedInText: true,
        primitive: true,
    },
    handler({parser, funcName}) {
        let tok = parser.gullet.popToken();
        const name = tok.text;
        if (/^(?:[\\{}$&#^_]|EOF)$/.test(name)) {
            throw new ParseError("Expected a control sequence", tok);
        }

        let numArgs = 0;
        let insert: Token | undefined;
        const delimiters: string[][] = [[]];
        // <parameter text> contains no braces
        while (parser.gullet.future().text !== "{") {
            tok = parser.gullet.popToken();
            if (tok.text === "#") {
                // If the very last character of the <parameter text> is #, so that
                // this # is immediately followed by {, TeX will behave as if the {
                // had been inserted at the right end of both the parameter text
                // and the replacement text.
                if (parser.gullet.future().text === "{") {
                    insert = parser.gullet.future();
                    delimiters[numArgs].push("{");
                    break;
                }

                // A parameter, the first appearance of # must be followed by 1,
                // the next by 2, and so on; up to nine #’s are allowed
                tok = parser.gullet.popToken();
                if (!(/^[1-9]$/.test(tok.text))) {
                    throw new ParseError(`Invalid argument number "${tok.text}"`);
                }
                if (parseInt(tok.text) !== numArgs + 1) {
                    throw new ParseError(
                        `Argument number "${tok.text}" out of order`);
                }
                numArgs++;
                delimiters.push([]);
            } else if (tok.text === "EOF") {
                throw new ParseError("Expected a macro definition");
            } else {
                delimiters[numArgs].push(tok.text);
            }
        }
        // replacement text, enclosed in '{' and '}' and properly nested
        let {tokens} = parser.gullet.consumeArg();
        if (insert) {
            tokens.unshift(insert);
        }

        if (funcName === "\\edef" || funcName === "\\xdef") {
            tokens = parser.gullet.expandTokens(tokens);
            tokens.reverse(); // to fit in with stack order
        }
        // Final arg is the expansion of the macro
        parser.gullet.macros.set(name, {
            tokens,
            numArgs,
            delimiters,
        }, funcName === globalMap[funcName]);

        return {
            type: "internal",
            mode: parser.mode,
        };
    },
});

// <simple assignment> -> <let assignment>
// <let assignment> -> \futurelet<control sequence><token><token>
//     | \let<control sequence><equals><one optional space><token>
// <equals> -> <optional spaces>|<optional spaces>=
defineFunction({
    type: "internal",
    names: [
        "\\let",
        "\\\\globallet", // can’t be entered directly
    ],
    props: {
        numArgs: 0,
        allowedInText: true,
        primitive: true,
    },
    handler({parser, funcName}) {
        const name = checkControlSequence(parser.gullet.popToken());
        parser.gullet.consumeSpaces();
        const tok = getRHS(parser);
        letCommand(parser, name, tok, funcName === "\\\\globallet");
        return {
            type: "internal",
            mode: parser.mode,
        };
    },
});

// ref: https://www.tug.org/TUGboat/tb09-3/tb22bechtolsheim.pdf
defineFunction({
    type: "internal",
    names: [
        "\\futurelet",
        "\\\\globalfuture", // can’t be entered directly
    ],
    props: {
        numArgs: 0,
        allowedInText: true,
        primitive: true,
    },
    handler({parser, funcName}) {
        const name = checkControlSequence(parser.gullet.popToken());
        const middle = parser.gullet.popToken();
        const tok = parser.gullet.popToken();
        letCommand(parser, name, tok, funcName === "\\\\globalfuture");
        parser.gullet.pushToken(tok);
        parser.gullet.pushToken(middle);
        return {
            type: "internal",
            mode: parser.mode,
        };
    },
});
pC/x01import {makeSpan} from "../buildCommon";
import defineFunction from "../defineFunction";
import {makeLeftRightDelim, makeSizedDelim, sizeToMaxHeight} from "../delimiter";
import {MathNode} from "../mathMLTree";
import ParseError from "../ParseError";
import {assertNodeType, checkSymbolNodeType} from "../parseNode";
import {makeEm} from "../units";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";

import type Options from "../Options";
import type {AnyParseNode, ParseNode, SymbolParseNode} from "../parseNode";
import type {FunctionContext} from "../defineFunction";
import type {HtmlDomNode} from "../domTree";

// Extra data needed for the delimiter handler down below
const delimiterSizes: Record<string, {
    mclass: "mopen" | "mclose" | "mrel" | "mord";
    size: 1 | 2 | 3 | 4;
}> = {
    "\\bigl" : {mclass: "mopen",    size: 1},
    "\\Bigl" : {mclass: "mopen",    size: 2},
    "\\biggl": {mclass: "mopen",    size: 3},
    "\\Biggl": {mclass: "mopen",    size: 4},
    "\\bigr" : {mclass: "mclose",   size: 1},
    "\\Bigr" : {mclass: "mclose",   size: 2},
    "\\biggr": {mclass: "mclose",   size: 3},
    "\\Biggr": {mclass: "mclose",   size: 4},
    "\\bigm" : {mclass: "mrel",     size: 1},
    "\\Bigm" : {mclass: "mrel",     size: 2},
    "\\biggm": {mclass: "mrel",     size: 3},
    "\\Biggm": {mclass: "mrel",     size: 4},
    "\\big"  : {mclass: "mord",     size: 1},
    "\\Big"  : {mclass: "mord",     size: 2},
    "\\bigg" : {mclass: "mord",     size: 3},
    "\\Bigg" : {mclass: "mord",     size: 4},
};

const delimiters = new Set([
    "(", "\\lparen", ")", "\\rparen",
    "[", "\\lbrack", "]", "\\rbrack",
    "\\{", "\\lbrace", "\\}", "\\rbrace",
    "\\lfloor", "\\rfloor", "\u230a", "\u230b",
    "\\lceil", "\\rceil", "\u2308", "\u2309",
    "<", ">", "\\langle", "\u27e8", "\\rangle", "\u27e9", "\\lt", "\\gt",
    "\\lvert", "\\rvert", "\\lVert", "\\rVert",
    "\\lgroup", "\\rgroup", "\u27ee", "\u27ef",
    "\\lmoustache", "\\rmoustache", "\u23b0", "\u23b1",
    "/", "\\backslash",
    "|", "\\vert", "\\|", "\\Vert",
    "\\uparrow", "\\Uparrow",
    "\\downarrow", "\\Downarrow",
    "\\updownarrow", "\\Updownarrow",
    ".",
]);

type IsMiddle = {delim: string, options: Options};

/**
 * An HtmlDomNode that carries an `isMiddle` property, used by the
 * \middle command to communicate delimiter info to the \left/\right builder.
 */
type MiddleDelimNode = HtmlDomNode & {isMiddle: IsMiddle};

function isMiddleDelimNode(node: HtmlDomNode): node is MiddleDelimNode {
    return 'isMiddle' in node;
}

// Delimiter functions
function checkDelimiter(
    delim: AnyParseNode,
    context: FunctionContext,
): SymbolParseNode {
    const symDelim = checkSymbolNodeType(delim);
    if (symDelim && delimiters.has(symDelim.text)) {
        return symDelim;
    } else if (symDelim) {
        throw new ParseError(
            `Invalid delimiter '${symDelim.text}' after '${context.funcName}'`,
            delim);
    } else {
        throw new ParseError(`Invalid delimiter type '${delim.type}'`, delim);
    }
}

defineFunction({
    type: "delimsizing",
    names: [
        "\\bigl", "\\Bigl", "\\biggl", "\\Biggl",
        "\\bigr", "\\Bigr", "\\biggr", "\\Biggr",
        "\\bigm", "\\Bigm", "\\biggm", "\\Biggm",
        "\\big",  "\\Big",  "\\bigg",  "\\Bigg",
    ],
    props: {
        numArgs: 1,
        argTypes: ["primitive"],
    },
    handler: (context, args) => {
        const delim = checkDelimiter(args[0], context);

        return {
            type: "delimsizing",
            mode: context.parser.mode,
            size: delimiterSizes[context.funcName].size,
            mclass: delimiterSizes[context.funcName].mclass,
            delim: delim.text,
        };
    },
    htmlBuilder: (group, options) => {
        if (group.delim === ".") {
            // Empty delimiters still count as elements, even though they don't
            // show anything.
            return makeSpan([group.mclass]);
        }

        return makeSizedDelim(
                group.delim, group.size, options, group.mode, [group.mclass]);
    },
    mathmlBuilder: (group) => {
        const children = [];

        if (group.delim !== ".") {
            children.push(mml.makeText(group.delim, group.mode));
        }

        const node = new MathNode("mo", children);

        if (group.mclass === "mopen" ||
            group.mclass === "mclose") {
            // Only some of the delimsizing functions act as fences, and they
            // return "mopen" or "mclose" mclass.
            node.setAttribute("fence", "true");
        } else {
            // Explicitly disable fencing if it's not a fence, to override the
            // defaults.
            node.setAttribute("fence", "false");
        }

        node.setAttribute("stretchy", "true");
        const size = makeEm(sizeToMaxHeight[group.size]);
        node.setAttribute("minsize", size);
        node.setAttribute("maxsize", size);

        return node;
    },
});


function assertParsed(group: ParseNode<"leftright">) {
    if (!group.body) {
        throw new Error("Bug: The leftright ParseNode wasn't fully parsed.");
    }
}


defineFunction({
    type: "leftright-right",
    names: ["\\right"],
    props: {
        numArgs: 1,
        primitive: true,
    },
    handler: (context, args) => {
        // \left case below triggers parsing of \right in
        //   `const right = parser.parseFunction();`
        // uses this return value.
        const color = context.parser.gullet.macros.get("\\current@color");
        if (color && typeof color !== "string") {
            throw new ParseError(
                "\\current@color set to non-string in \\right");
        }
        return {
            type: "leftright-right",
            mode: context.parser.mode,
            delim: checkDelimiter(args[0], context).text,
            color: color as string | null | undefined, // undefined if not set via \color
        };
    },
});


defineFunction({
    type: "leftright",
    names: ["\\left"],
    props: {
        numArgs: 1,
        primitive: true,
    },
    handler: (context, args) => {
        const delim = checkDelimiter(args[0], context);

        const parser = context.parser;
        // Parse out the implicit body
        ++parser.leftrightDepth;
        // parseExpression stops before '\\right'
        const body = parser.parseExpression(false);
        --parser.leftrightDepth;
        // Check the next token
        parser.expect("\\right", false);
        const right = assertNodeType(parser.parseFunction(), "leftright-right");
        return {
            type: "leftright",
            mode: parser.mode,
            body,
            left: delim.text,
            right: right.delim,
            rightColor: right.color,
        };
    },
    htmlBuilder: (group, options) => {
        assertParsed(group);
        // Build the inner expression
        const inner = html.buildExpression(group.body, options, true,
            ["mopen", "mclose"]);

        let innerHeight = 0;
        let innerDepth = 0;
        let hadMiddle = false;

        // Calculate its height and depth
        for (let i = 0; i < inner.length; i++) {
            const node = inner[i];
            if (isMiddleDelimNode(node)) {
                hadMiddle = true;
            } else {
                innerHeight = Math.max(inner[i].height, innerHeight);
                innerDepth = Math.max(inner[i].depth, innerDepth);
            }
        }

        // The size of delimiters is the same, regardless of what style we are
        // in. Thus, to correctly calculate the size of delimiter we need around
        // a group, we scale down the inner size based on the size.
        innerHeight *= options.sizeMultiplier;
        innerDepth *= options.sizeMultiplier;

        let leftDelim;
        if (group.left === ".") {
            // Empty delimiters in \left and \right make null delimiter spaces.
            leftDelim = html.makeNullDelimiter(options, ["mopen"]);
        } else {
            // Otherwise, use leftRightDelim to generate the correct sized
            // delimiter.
            leftDelim = makeLeftRightDelim(
                group.left, innerHeight, innerDepth, options,
                group.mode, ["mopen"]);
        }
        // Add it to the beginning of the expression
        inner.unshift(leftDelim);

        // Handle middle delimiters
        if (hadMiddle) {
            for (let i = 1; i < inner.length; i++) {
                const middleDelim = inner[i];
                if (isMiddleDelimNode(middleDelim)) {
                    const isMiddle = middleDelim.isMiddle;
                    // Apply the options that were active when \middle was called
                    inner[i] = makeLeftRightDelim(
                        isMiddle.delim, innerHeight, innerDepth,
                        isMiddle.options, group.mode, []);
                }
            }
        }

        let rightDelim;
        // Same for the right delimiter, but using color specified by \color
        if (group.right === ".") {
            rightDelim = html.makeNullDelimiter(options, ["mclose"]);
        } else {
            const colorOptions = group.rightColor ?
                options.withColor(group.rightColor) : options;
            rightDelim = makeLeftRightDelim(
                group.right, innerHeight, innerDepth, colorOptions,
                group.mode, ["mclose"]);
        }
        // Add it to the end of the expression.
        inner.push(rightDelim);

        return makeSpan(["minner"], inner, options);
    },
    mathmlBuilder: (group, options) => {
        assertParsed(group);
        const inner = mml.buildExpression(group.body, options);

        if (group.left !== ".") {
            const leftNode = new MathNode(
                "mo", [mml.makeText(group.left, group.mode)]);

            leftNode.setAttribute("fence", "true");

            inner.unshift(leftNode);
        }

        if (group.right !== ".") {
            const rightNode = new MathNode(
                "mo", [mml.makeText(group.right, group.mode)]);

            rightNode.setAttribute("fence", "true");

            if (group.rightColor) {
                rightNode.setAttribute("mathcolor", group.rightColor);
            }

            inner.push(rightNode);
        }

        return mml.makeRow(inner);
    },
});

defineFunction({
    type: "middle",
    names: ["\\middle"],
    props: {
        numArgs: 1,
        primitive: true,
    },
    handler: (context, args) => {
        const delim = checkDelimiter(args[0], context);
        if (!context.parser.leftrightDepth) {
            throw new ParseError("\\middle without preceding \\left", delim);
        }

        return {
            type: "middle",
            mode: context.parser.mode,
            delim: delim.text,
        };
    },
    htmlBuilder: (group, options) => {
        let middleDelim;
        if (group.delim === ".") {
            middleDelim = html.makeNullDelimiter(options, []);
        } else {
            middleDelim = makeSizedDelim(
                group.delim, 1, options,
                group.mode, []);

            // Patch an ad-hoc property onto the node so the \left/\right
            // builder can reconstruct appropriately sized middle delimiters.
            // isMiddle is not part of HtmlDomNode; the read side uses
            // isMiddleDelimNode() to check before accessing.
            (middleDelim as unknown as MiddleDelimNode).isMiddle = {
                delim: group.delim, options,
            };
        }
        return middleDelim;
    },
    mathmlBuilder: (group, options) => {
        // A Firefox \middle will stretch a character vertically only if it
        // is in the fence part of the operator dictionary at:
        // https://www.w3.org/TR/MathML3/appendixc.html.
        // So we need to avoid U+2223 and use plain "|" instead.
        const textNode = (group.delim === "\\vert" || group.delim === "|")
            ? mml.makeText("|", "text")
            : mml.makeText(group.delim, group.mode);
        const middleNode = new MathNode("mo", [textNode]);
        middleNode.setAttribute("fence", "true");
        // MathML gives 5/18em spacing to each <mo> element.
        // \middle should get delimiter spacing instead.
        middleNode.setAttribute("lspace", "0.05em");
        middleNode.setAttribute("rspace", "0.05em");
        return middleNode;
    },
});
gx+import defineFunction from "../defineFunction";
import {makeSpan, makeSvgSpan, makeVList, wrapFragment} from "../buildCommon";
import {isCharacterBox} from "../utils";
import {MathNode} from "../mathMLTree";
import {stretchyEnclose} from "../stretchy";
import {phasePath} from "../svgGeometry";
import {PathNode, SvgNode} from "../domTree";
import {calculateSize, makeEm} from "../units";
import {assertNodeType} from "../parseNode";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";
import type {HtmlBuilder, MathMLBuilder} from "../defineFunction";

const htmlBuilder: HtmlBuilder<"enclose"> = (group, options) => {
    // \cancel, \bcancel, \xcancel, \sout, \fbox, \colorbox, \fcolorbox, \phase
    // Some groups can return document fragments.  Handle those by wrapping
    // them in a span.
    const inner = wrapFragment(
        html.buildGroup(group.body, options), options);

    const label = group.label.slice(1);
    let scale = options.sizeMultiplier;
    let img;
    let imgShift;

    // In the LaTeX cancel package, line geometry is slightly different
    // depending on whether the subject is wider than it is tall, or vice versa.
    // We don't know the width of a group, so as a proxy, we test if
    // the subject is a single character. This captures most of the
    // subjects that should get the "tall" treatment.
    const isSingleChar = isCharacterBox(group.body);

    if (label === "sout") {
        img = makeSpan(["stretchy", "sout"]);
        img.height = options.fontMetrics().defaultRuleThickness / scale;
        imgShift = -0.5 * options.fontMetrics().xHeight;

    } else if (label === "phase") {
        // Set a couple of dimensions from the steinmetz package.
        const lineWeight = calculateSize({number: 0.6, unit: "pt"}, options);
        const clearance = calculateSize({number: 0.35, unit: "ex"}, options);

        // Prevent size changes like \Huge from affecting line thickness
        const newOptions = options.havingBaseSizing();
        scale = scale / newOptions.sizeMultiplier;

        const angleHeight = inner.height + inner.depth + lineWeight + clearance;
        // Reserve a left pad for the angle.
        inner.style.paddingLeft = makeEm(angleHeight / 2 + lineWeight);

        // Create an SVG
        const viewBoxHeight = Math.floor(1000 * angleHeight * scale);
        const path = phasePath(viewBoxHeight);
        const svgNode = new SvgNode([new PathNode("phase", path)], {
            "width": "400em",
            "height": makeEm(viewBoxHeight / 1000),
            "viewBox": `0 0 400000 ${viewBoxHeight}`,
            "preserveAspectRatio": "xMinYMin slice",
        });
        // Wrap it in a span with overflow: hidden.
        img = makeSvgSpan(["hide-tail"], [svgNode], options);
        img.style.height = makeEm(angleHeight);
        imgShift = inner.depth + lineWeight + clearance;

    } else {
        // Add horizontal padding
        if (/cancel/.test(label)) {
            if (!isSingleChar) {
                inner.classes.push("cancel-pad");
            }
        } else if (label === "angl") {
            inner.classes.push("anglpad");
        } else {
            inner.classes.push("boxpad");
        }

        // Add vertical padding
        let topPad;
        let bottomPad;
        let ruleThickness = 0;
        // ref: cancel package: \advance\totalheight2\p@ % "+2"
        if (/box/.test(label)) {
            ruleThickness = Math.max(
                options.fontMetrics().fboxrule, // default
                options.minRuleThickness, // User override.
            );
            topPad = options.fontMetrics().fboxsep +
                (label === "colorbox" ? 0 : ruleThickness);
            bottomPad =  topPad;
        } else if (label === "angl") {
            ruleThickness = Math.max(
                options.fontMetrics().defaultRuleThickness,
                options.minRuleThickness
            );
            topPad = 4 * ruleThickness; // gap = 3 × line, plus the line itself.
            bottomPad = Math.max(0, 0.25 - inner.depth);
        } else {
            topPad = isSingleChar ? 0.2 : 0;
            bottomPad =  topPad;
        }

        img = stretchyEnclose(inner, label, topPad, bottomPad, options);
        if (/fbox|boxed|fcolorbox/.test(label)) {
            img.style.borderStyle = "solid";
            img.style.borderWidth = makeEm(ruleThickness);
        } else if (label === "angl" && ruleThickness !== 0.049) {
            img.style.borderTopWidth = makeEm(ruleThickness);
            img.style.borderRightWidth = makeEm(ruleThickness);
        }
        imgShift = inner.depth + bottomPad;

        if (group.backgroundColor) {
            img.style.backgroundColor = group.backgroundColor;
            if (group.borderColor) {
                img.style.borderColor = group.borderColor;
            }
        }
    }

    let vlist;
    if (group.backgroundColor) {
        vlist = makeVList({
            positionType: "individualShift",
            children: [
                // Put the color background behind inner;
                {type: "elem", elem: img, shift: imgShift},
                {type: "elem", elem: inner, shift: 0},
            ],
        }, options);
    } else {
        const classes = /cancel|phase/.test(label) ? ["svg-align"] : [];
        vlist = makeVList({
            positionType: "individualShift",
            children: [
                // Write the \cancel stroke on top of inner.
                {
                    type: "elem",
                    elem: inner,
                    shift: 0,
                },
                {
                    type: "elem",
                    elem: img,
                    shift: imgShift,
                    wrapperClasses: classes,
                },
            ],
        }, options);
    }

    if (/cancel/.test(label)) {
        // The cancel package documentation says that cancel lines add their height
        // to the expression, but tests show that isn't how it actually works.
        vlist.height = inner.height;
        vlist.depth = inner.depth;
    }

    if (/cancel/.test(label) && !isSingleChar) {
        // cancel does not create horiz space for its line extension.
        return makeSpan(["mord", "cancel-lap"], [vlist], options);
    } else {
        return makeSpan(["mord"], [vlist], options);
    }
};

const mathmlBuilder: MathMLBuilder<"enclose"> = (group, options) => {
    let fboxsep;
    const node = new MathNode(
        group.label.includes("colorbox") ? "mpadded" : "menclose",
        [mml.buildGroup(group.body, options)]
    );
    switch (group.label) {
        case "\\cancel":
            node.setAttribute("notation", "updiagonalstrike");
            break;
        case "\\bcancel":
            node.setAttribute("notation", "downdiagonalstrike");
            break;
        case "\\phase":
            node.setAttribute("notation", "phasorangle");
            break;
        case "\\sout":
            node.setAttribute("notation", "horizontalstrike");
            break;
        case "\\fbox":
            node.setAttribute("notation", "box");
            break;
        case "\\angl":
            node.setAttribute("notation", "actuarial");
            break;
        case "\\fcolorbox":
        case "\\colorbox":
            // <menclose> doesn't have a good notation option. So use <mpadded>
            // instead. Set some attributes that come included with <menclose>.
            fboxsep = options.fontMetrics().fboxsep *
                options.fontMetrics().ptPerEm;
            node.setAttribute("width", `+${2 * fboxsep}pt`);
            node.setAttribute("height", `+${2 * fboxsep}pt`);
            node.setAttribute("lspace", `${fboxsep}pt`); //
            node.setAttribute("voffset", `${fboxsep}pt`);
            if (group.label === "\\fcolorbox") {
                const thk = Math.max(
                    options.fontMetrics().fboxrule, // default
                    options.minRuleThickness, // user override
                );
                node.setAttribute("style", `border: ${makeEm(thk)} solid ${group.borderColor}`);
            }
            break;
        case "\\xcancel":
            node.setAttribute("notation", "updiagonalstrike downdiagonalstrike");
            break;
    }
    if (group.backgroundColor) {
        node.setAttribute("mathbackground", group.backgroundColor);
    }
    return node;
};

defineFunction({
    type: "enclose",
    names: ["\\colorbox"],
    props: {
        numArgs: 2,
        allowedInText: true,
        argTypes: ["color", "hbox"],
    },
    handler({parser, funcName}, args, optArgs) {
        const color = assertNodeType(args[0], "color-token").color;
        const body = args[1];
        return {
            type: "enclose",
            mode: parser.mode,
            label: funcName,
            backgroundColor: color,
            body,
        };
    },
    htmlBuilder,
    mathmlBuilder,
});

defineFunction({
    type: "enclose",
    names: ["\\fcolorbox"],
    props: {
        numArgs: 3,
        allowedInText: true,
        argTypes: ["color", "color", "hbox"],
    },
    handler({parser, funcName}, args, optArgs) {
        const borderColor = assertNodeType(args[0], "color-token").color;
        const backgroundColor = assertNodeType(args[1], "color-token").color;
        const body = args[2];
        return {
            type: "enclose",
            mode: parser.mode,
            label: funcName,
            backgroundColor,
            borderColor,
            body,
        };
    },
    htmlBuilder,
    mathmlBuilder,
});

defineFunction({
    type: "enclose",
    names: ["\\fbox"],
    props: {
        numArgs: 1,
        argTypes: ["hbox"],
        allowedInText: true,
    },
    handler({parser}, args) {
        return {
            type: "enclose",
            mode: parser.mode,
            label: "\\fbox",
            body: args[0],
        };
    },
});

defineFunction({
    type: "enclose",
    names: ["\\cancel", "\\bcancel", "\\xcancel", "\\phase"],
    props: {
        numArgs: 1,
    },
    handler({parser, funcName}, args) {
        const body = args[0];
        return {
            type: "enclose",
            mode: parser.mode,
            label: funcName,
            body,
        };
    },
    htmlBuilder,
    mathmlBuilder,
});

defineFunction({
    type: "enclose",
    names: ["\\sout"],
    props: {
        numArgs: 1,
        allowedInText: true,
    },
    handler({parser, funcName}, args) {
        if (parser.mode === "math") {
            parser.settings.reportNonstrict("mathVsSout",
                `LaTeX's \\sout works only in text mode`);
        }
        const body = args[0];
        return {
            type: "enclose",
            mode: parser.mode,
            label: funcName,
            body,
        };
    },
    htmlBuilder,
    mathmlBuilder,
});

defineFunction({
    type: "enclose",
    names: ["\\angl"],
    props: {
        numArgs: 1,
        argTypes: ["hbox"],
        allowedInText: false,
    },
    handler({parser}, args) {
        return {
            type: "enclose",
            mode: parser.mode,
            label: "\\angl",
            body: args[0],
        };
    },
});
{ϳx	import defineFunction from "../defineFunction";
import ParseError from "../ParseError";
import {assertNodeType} from "../parseNode";
import environments from "../environments";

import type {ParseNode} from "../parseNode";

// Environment delimiters. HTML/MathML rendering is defined in the corresponding
// defineEnvironment definitions.
defineFunction({
    type: "environment",
    names: ["\\begin", "\\end"],
    props: {
        numArgs: 1,
        argTypes: ["text"],
    },
    handler({parser, funcName}, args) {
        const nameGroup = args[0];
        if (nameGroup.type !== "ordgroup") {
            throw new ParseError("Invalid environment name", nameGroup);
        }
        let envName = "";
        for (let i = 0; i < nameGroup.body.length; ++i) {
            envName += assertNodeType(nameGroup.body[i], "textord").text;
        }

        if (funcName === "\\begin") {
            // begin...end is similar to left...right
            if (!environments.hasOwnProperty(envName)) {
                throw new ParseError(
                    "No such environment: " + envName, nameGroup);
            }
            // Build the environment object. Arguments and other information will
            // be made available to the begin and end methods using properties.
            const env = environments[envName];
            const {args, optArgs} =
                parser.parseArguments("\\begin{" + envName + "}", env);
            const context = {
                mode: parser.mode,
                envName,
                parser,
            };
            const result = env.handler(context, args, optArgs);
            parser.expect("\\end", false);
            const endNameToken = parser.nextToken;
            const end = assertNodeType(parser.parseFunction(), "environment");
            if (end.name !== envName) {
                throw new ParseError(
                    `Mismatch: \\begin{${envName}} matched by \\end{${end.name}}`,
                    endNameToken);
            }
            // env.handler returns the specific node type (e.g. "array"),
            // not "environment". This cast is unavoidable: defineFunction
            // requires the handler to return ParseNode<"environment"> but
            // \begin delegates to environment handlers with different types.
            return result as unknown as ParseNode<"environment">;
        }

        return {
            type: "environment",
            mode: parser.mode,
            name: envName,
            nameGroup,
        };
    },
});
IxX// TODO(kevinb): implement \\sl and \\sc

import {binrelClass} from "./mclass";
import defineFunction, {normalizeArgument} from "../defineFunction";
import {isCharacterBox} from "../utils";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";

import type Options from "../Options";
import type {ParseNode} from "../parseNode";
import type {Slice1} from "../types";

const htmlBuilder = (group: ParseNode<"font">, options: Options) => {
    const font = group.font;
    const newOptions = options.withFont(font);
    return html.buildGroup(group.body, newOptions);
};

const mathmlBuilder = (group: ParseNode<"font">, options: Options) => {
    const font = group.font;
    const newOptions = options.withFont(font);
    return mml.buildGroup(group.body, newOptions);
};

const fontAliases = {
    "\\Bbb": "\\mathbb",
    "\\bold": "\\mathbf",
    "\\frak": "\\mathfrak",
} as const;

type OldFontCommands = "\\rm" | "\\sf" | "\\tt" | "\\bf" | "\\it" | "\\cal";
type FontCommands =
    "\\mathrm" | "\\mathit" | "\\mathbf" | "\\mathnormal" | "\\mathsfit" |
    "\\mathbb" | "\\mathcal" | "\\mathfrak" | "\\mathscr" | "\\mathsf" |
    "\\mathtt";

defineFunction({
    type: "font",
    names: [
        // styles, except \boldsymbol defined below
        "\\mathrm", "\\mathit", "\\mathbf", "\\mathnormal", "\\mathsfit",

        // families
        "\\mathbb", "\\mathcal", "\\mathfrak", "\\mathscr", "\\mathsf",
        "\\mathtt",

        // aliases, except \bm defined below
        "\\Bbb", "\\bold", "\\frak",
    ] satisfies (FontCommands | keyof typeof fontAliases)[],
    props: {
        numArgs: 1,
        allowedInArgument: true,
    },
    handler: ({parser, funcName}, args) => {
        const body = normalizeArgument(args[0]);
        let func = funcName;
        if (func in fontAliases) {
            func = fontAliases[func as keyof typeof fontAliases];
        }
        return {
            type: "font",
            mode: parser.mode,
            font: func.slice(1) as Slice1<FontCommands>,
            body,
        };
    },
    htmlBuilder,
    mathmlBuilder,
});

defineFunction({
    type: "mclass",
    names: ["\\boldsymbol", "\\bm"],
    props: {
        numArgs: 1,
    },
    handler: ({parser}, args) => {
        const body = args[0];
        // amsbsy.sty's \boldsymbol uses \binrel spacing to inherit the
        // argument's bin|rel|ord status
        return {
            type: "mclass",
            mode: parser.mode,
            mclass: binrelClass(body),
            body: [
                {
                    type: "font",
                    mode: parser.mode,
                    font: "boldsymbol",
                    body,
                },
            ],
            isCharacterBox: isCharacterBox(body),
        };
    },
});

// Old font changing functions
defineFunction({
    type: "font",
    names: ["\\rm", "\\sf", "\\tt", "\\bf", "\\it", "\\cal"],
    props: {
        numArgs: 0,
        allowedInText: true,
    },
    handler: ({parser, funcName, breakOnTokenText}, args) => {
        const {mode} = parser;
        const body = parser.parseExpression(true, breakOnTokenText);

        return {
            type: "font",
            mode: mode,
            font: `math${funcName.slice(1) as Slice1<OldFontCommands>}`,
            body: {
                type: "ordgroup",
                mode: parser.mode,
                body,
            },
        };
    },
    htmlBuilder,
    mathmlBuilder,
});
xw7import defineFunction, {normalizeArgument} from "../defineFunction";
import {makeLineSpan, makeSpan, makeVList} from "../buildCommon";
import {makeCustomSizedDelim} from "../delimiter";
import {MathNode, TextNode} from "../mathMLTree";
import type {ParseNode} from "../parseNode";
import Style from "../Style";
import {assertNodeType} from "../parseNode";
import * as html from "../buildHTML";
import * as mml from "../buildMathML";
import {calculateSize, makeEm} from "../units";
import type {StyleStr} from "../types";
import type {HtmlBuilder, MathMLBuilder} from "../defineFunction";

const htmlBuilder: HtmlBuilder<"genfrac"> = (group, options) => {
    // Fractions are handled in the TeXbook on pages 444-445, rules 15(a-e).
    const style = options.style;

    const nstyle = style.fracNum();
    const dstyle = style.fracDen();
    let newOptions;

    newOptions = options.havingStyle(nstyle);
    const numerm = html.buildGroup(group.numer, newOptions, options);

    if (group.continued) {
        // \cfrac inserts a \strut into the numerator.
        // Get \strut dimensions from TeXbook page 353.
        const hStrut = 8.5 / options.fontMetrics().ptPerEm;
        const dStrut = 3.5 / options.fontMetrics().ptPerEm;
        numerm.height = numerm.height < hStrut ? hStrut : numerm.height;
        numerm.depth = numerm.depth < dStrut ? dStrut : numerm.depth;
    }

    newOptions = options.havingStyle(dstyle);
    const denomm = html.buildGroup(group.denom, newOptions, options);

    let rule;
    let ruleWidth;
    let ruleSpacing;
    if (group.hasBarLine) {
        if (group.barSize) {
            ruleWidth = calculateSize(group.barSize, options);
            rule = makeLineSpan("frac-line", options, ruleWidth);
        } else {
            rule = makeLineSpan("frac-line", options);
        }
        ruleWidth = rule.height;
        ruleSpacing = rule.height;
    } else {
        rule = null;
        ruleWidth = 0;
        ruleSpacing = options.fontMetrics().defaultRuleThickness;
    }

    // Rule 15b
    let numShift;
    let clearance;
    let denomShift;
    if (style.size === Style.DISPLAY.size) {
        numShift = options.fontMetrics().num1;
        if (ruleWidth > 0) {
            clearance = 3 * ruleSpacing;
        } else {
            clearance = 7 * ruleSpacing;
        }
        denomShift = options.fontMetrics().denom1;
    } else {
        if (ruleWidth > 0) {
            numShift = options.fontMetrics().num2;
            clearance = ruleSpacing;
        } else {
            numShift = options.fontMetrics().num3;
            clearance = 3 * ruleSpacing;
        }
        denomShift = options.fontMetrics().denom2;
    }

    let frac;
    if (!rule) {
        // Rule 15c
        const candidateClearance =
            (numShift - numerm.depth) - (denomm.height - denomShift);
        if (candidateClearance < clearance) {
            numShift += 0.5 * (clearance - candidateClearance);
            denomShift += 0.5 * (clearance - candidateClearance);
        }

        frac = makeVList({
            positionType: "individualShift",
            children: [
                {type: "elem", elem: denomm, shift: denomShift},
                {type: "elem", elem: numerm, shift: -numShift},
            ],
        }, options);
    } else {
        // Rule 15d
        const axisHeight = options.fontMetrics().axisHeight;

        if ((numShift - numerm.depth) - (axisHeight + 0.5 * ruleWidth) <
                clearance) {
            numShift +=
                clearance - ((numShift - numerm.depth) -
                            (axisHeight + 0.5 * ruleWidth));
        }

        if ((axisHeight - 0.5 * ruleWidth) - (denomm.height - denomShift) <
                clearance) {
            denomShift +=
                clearance - ((axisHeight - 0.5 * ruleWidth) -
                            (denomm.height - denomShift));
        }

        const midShift = -(axisHeight - 0.5 * ruleWidth);

        frac = makeVList({
            positionType: "individualShift",
            children: [
                {type: "elem", elem: denomm, shift: denomShift},
                {type: "elem", elem: rule,   shift: midShift},
                {type: "elem", elem: numerm, shift: -numShift},
            ],
        }, options);
    }

    // Since we manually change the style sometimes (with \dfrac or \tfrac),
    // account for the possible size change here.
    newOptions = options.havingStyle(style);
    frac.height *= newOptions.sizeMultiplier / options.sizeMultiplier;
    frac.depth *= newOptions.sizeMultiplier / options.sizeMultiplier;

    // Rule 15e
    let delimSize;
    if (style.size === Style.DISPLAY.size) {
        delimSize = options.fontMetrics().delim1;
    } else if (style.size === Style.SCRIPTSCRIPT.size) {
        delimSize = options.havingStyle(Style.SCRIPT).fontMetrics().delim2;
    } else {
        delimSize = options.fontMetrics().delim2;
    }

    let leftDelim;
    let rightDelim;
    if (group.leftDelim == null) {
        leftDelim = html.makeNullDelimiter(options, ["mopen"]);
    } else {
        leftDelim = makeCustomSizedDelim(
            group.leftDelim, delimSize, true,
            options.havingStyle(style), group.mode, ["mopen"]);
    }

    if (group.continued) {
        rightDelim = makeSpan([]); // zero width for \cfrac
    } else if (group.rightDelim == null) {
        rightDelim = html.makeNullDelimiter(options, ["mclose"]);
    } else {
        rightDelim = makeCustomSizedDelim(
            group.rightDelim, delimSize, true,
            options.havingStyle(style), group.mode, ["mclose"]);
    }

    return makeSpan(
        ["mord"].concat(newOptions.sizingClasses(options)),
        [leftDelim, makeSpan(["mfrac"], [frac]), rightDelim],
        options);
};

const mathmlBuilder: MathMLBuilder<"genfrac"> = (group, options) => {
    const node = new MathNode(
        "mfrac",
        [
            mml.buildGroup(group.numer, options),
            mml.buildGroup(group.denom, options),
        ]);

    if (!group.hasBarLine) {
        node.setAttribute("linethickness", "0px");
    } else if (group.barSize) {
        const ruleWidth = calculateSize(group.barSize, options);
        node.setAttribute("linethickness", makeEm(ruleWidth));
    }

    if (group.leftDelim != null || group.rightDelim != null) {
        const withDelims = [];

        if (group.leftDelim != null) {
            const leftOp = new MathNode(
                "mo",
                [new TextNode(group.leftDelim.replace("\\", ""))]
            );

            leftOp.setAttribute("fence", "true");

            withDelims.push(leftOp);
        }

        withDelims.push(node);

        if (group.rightDelim != null) {
            const rightOp = new MathNode(
                "mo",
                [new TextNode(group.rightDelim.replace("\\", ""))]
            );

            rightOp.setAttribute("fence", "true");

            withDelims.push(rightOp);
        }

        return mml.makeRow(withDelims);
    }

    return node;
};

const wrapWithStyle = (
    frac: ParseNode<"genfrac">,
    style?: StyleStr | null,
): ParseNode<"genfrac"> => {
    if (!style) {
        return frac;
    }

    const wrapper: ParseNode<"styling"> = {
        type: "styling",
        mode: frac.mode,
        style,
        body: [frac],
    };

    // @ts-ignore defineFunction handler needs to return ParseNode<"genfrac">
    return wrapper;
};

defineFunction({
    type: "genfrac",
    names: [
        "\\cfrac", "\\dfrac", "\\frac", "\\tfrac",
        "\\dbinom", "\\binom", "\\tbinom",
        "\\\\atopfrac", // can’t be entered directly
        "\\\\bracefrac", "\\\\brackfrac",   // ditto
    ],
    props: {
        numArgs: 2,
        allowedInArgument: true,
    },
    handler: ({parser, funcName}, args) => {
        const numer = args[0];
        const denom = args[1];
        let hasBarLine: boolean;
        let leftDelim: string | null = null;
        let rightDelim: string | null = null;

        switch (funcName) {
            case "\\cfrac":
            case "\\dfrac":
            case "\\frac":
            case "\\tfrac":
                hasBarLine = true;
                break;
            case "\\\\atopfrac":
                hasBarLine = false;
                break;
            case "\\dbinom":
            case "\\binom":
            case "\\tbinom":
                hasBarLine = false;
                leftDelim = "(";
                rightDelim = ")";
                break;
            case "\\\\bracefrac":
                hasBarLine = false;
                leftDelim = "\\{";
                rightDelim = "\\}";
                break;
            case "\\\\brackfrac":
                hasBarLine = false;
                leftDelim = "[";
                rightDelim = "]";
                break;
            default:
                throw new Error("Unrecognized genfrac command");
        }

        const continued = funcName === "\\cfrac";
        let style = null;
        if (continued || funcName.startsWith("\\d")) {
            style = "display" as StyleStr;
        } else if (funcName.startsWith("\\t")) {
            style = "text" as StyleStr;
        }

        return wrapWithStyle({
            type: "genfrac",
            mode: parser.mode,
            numer,
            denom,
            continued,
            hasBarLine,
            leftDelim,
            rightDelim,
            barSize: null,
        }, style);
    },

    htmlBuilder,
    mathmlBuilder,
});

// Infix generalized fractions -- these are not rendered directly, but replaced
// immediately by one of the variants above.
defineFunction({
    type: "infix",
    names: ["\\over", "\\choose", "\\atop", "\\brace", "\\brack"],
    props: {
        numArgs: 0,
        infix: true,
    },
    handler({parser, funcName, token}) {
        let replaceWith;
        switch (funcName) {
            case "\\over":
                replaceWith = "\\frac";
                break;
            case "\\choose":
                replaceWith = "\\binom";
                break;
            case "\\atop":
                replaceWith = "\\\\atopfrac";
                break;
            case "\\brace":
                replaceWith = "\\\\bracefrac";
                break;
            case "\\brack":
                replaceWith = "\\\\brackfrac";
                break;
            default:
                throw new Error("Unrecognized infix genfrac command");
        }
        return {
            type: "infix",
            mode: parser.mode,
            replaceWith,
            token,
        };
    },
});

const stylArray: StyleStr[] = ["display", "text", "script", "scriptscript"];

const delimFromValue = function(delimString: string): string | null {
    let delim = null;
    if (delimString.length > 0) {
        delim = delimString;
        delim = delim === "." ? null : delim;
    }
    return delim;
};

defineFunction({
    type: "genfrac",
    names: ["\\genfrac"],
    props: {
        numArgs: 6,
        allowedInArgument: true,
        argTypes: ["math", "math", "size", "text", "math", "math"],
    },
    handler({parser}, args) {
        const numer = args[4];
        const denom = args[5];

        // Look into the parse nodes to get the desired delimiters.
        const leftNode = normalizeArgument(args[0]);
        const leftDelim = leftNode.type === "atom" && leftNode.family === "open"
            ? delimFromValue(leftNode.text) : null;
        const rightNode = normalizeArgument(args[1]);
        const rightDelim = rightNode.type === "atom" && rightNode.family === "close"
            ? delimFromValue(rightNode.text) : null;

        const barNode = assertNodeType(args[2], "size");
        let hasBarLine: boolean;
        let barSize = null;
        if (barNode.isBlank) {
            // \genfrac acts differently than \above.
            // \genfrac treats an empty size group as a signal to use a
            // standard bar size. \above would see size = 0 and omit the bar.
            hasBarLine = true;
        } else {
            barSize = barNode.value;
            hasBarLine = barSize.number > 0;
        }

        // Find out if we want displaystyle, textstyle, etc.
        let size = null;
        let styl = args[3];
        if (styl.type === "ordgroup") {
            if (styl.body.length > 0) {
                const textOrd = assertNodeType(styl.body[0], "textord");
                size = stylArray[Number(textOrd.text)] as StyleStr;
            }
        } else {
            styl = assertNodeType(styl, "textord");
            size = stylArray[Number(styl.text)] as StyleStr;
        }

        return wrapWithStyle({
            type: "genfrac",
            mode: parser.mode,
            numer,
            denom,
            continued: false,
            hasBarLine,
            barSize,
            leftDelim,
            rightDelim,
        }, size);
    },
});

// \above is an infix fraction that also defines a fraction bar size.
defineFunction({
    type: "infix",
    names: ["\\above"],
    props: {
        numArgs: 1,
        argTypes: ["size"],
        infix: true,
    },
    handler({parser, funcName, token}, args) {
        return {
            type: "infix",
            mode: parser.mode,
            replaceWith: "\\\\abovefrac",
            size: assertNodeType(args[0], "size").value,
            token,
        };
    },
});

defineFunction({
    type: "genfrac",
    names: ["\\\\abovefrac"],
    props: {
        numArgs: 3,
        argTypes: ["math", "size", "math"],
    },
    handler: ({parser, funcName}, args) => {
        const numer = args[0];
        const barSize = assertNodeType(args[1], "infix").size;

        if (!barSize) {
            throw new Error(
                `\\\\abovefrac expected size, but got ${String(barSize)}`);
        }

        const denom = args[2];

        const hasBarLine = barSize.number > 0;
        return {
            type: "genfrac",
            mode: parser.mode,
            numer,
            denom,
            continued: false,
            hasBarLine,
            barSize,
            leftDelim: null,
            rightDelim: null,
        };
    },
});
d䇽Fxmimport defineFunction, {ordargument} from "../defineFunction";
import {makeFragment} from "../buildCommon";
import {MathNode} from "../mathMLTree";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";

// \hbox is provided for compatibility with LaTeX \vcenter.
// In LaTeX, \vcenter can act only on a box, as in
// \vcenter{\hbox{$\frac{a+b}{\dfrac{c}{d}}$}}
// This function by itself doesn't do anything but prevent a soft line break.

defineFunction({
    type: "hbox",
    names: ["\\hbox"],
    props: {
        numArgs: 1,
        argTypes: ["text"],
        allowedInText: true,
        primitive: true,
    },
    handler({parser}, args) {
        return {
            type: "hbox",
            mode: parser.mode,
            body: ordargument(args[0]),
        };
    },
    htmlBuilder(group, options) {
        const elements = html.buildExpression(group.body, options.withFont(''), false);
        return makeFragment(elements);
    },
    mathmlBuilder(group, options) {
        return new MathNode(
          "mrow", mml.buildExpression(group.body, options.withFont(''))
        );
    },
});
cxjimport defineFunction from "../defineFunction";
import {makeSpan, makeVList} from "../buildCommon";
import {MathNode} from "../mathMLTree";
import {stretchyMathML, stretchySvg} from "../stretchy";
import Style from "../Style";
import {assertNodeType} from "../parseNode";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";

import type {HtmlBuilderSupSub, MathMLBuilder} from "../defineFunction";
import type {ParseNode} from "../parseNode";

// NOTE: Unlike most `htmlBuilder`s, this one handles not only "horizBrace", but
// also "supsub" since an over/underbrace can affect super/subscripting.
export const htmlBuilder: HtmlBuilderSupSub<"horizBrace"> = (grp, options) => {
    const style = options.style;

    // Pull out the `ParseNode<"horizBrace">` if `grp` is a "supsub" node.
    let supSubGroup;
    let group: ParseNode<"horizBrace">;
    if (grp.type === "supsub") {
        // Ref: LaTeX source2e: }}}}\limits}
        // i.e. LaTeX treats the brace similar to an op and passes it
        // with \limits, so we need to assign supsub style.
        supSubGroup = grp.sup ?
            html.buildGroup(grp.sup, options.havingStyle(style.sup()), options) :
            html.buildGroup(grp.sub, options.havingStyle(style.sub()), options);
        group = assertNodeType(grp.base, "horizBrace");
    } else {
        group = assertNodeType(grp, "horizBrace");
    }

    // Build the base group
    const body = html.buildGroup(
        group.base, options.havingBaseStyle(Style.DISPLAY));

    // Create the stretchy element
    const braceBody = stretchySvg(group, options);

    // Generate the vlist, with the appropriate kerns        ┏━━━━━━━━┓
    // This first vlist contains the content and the brace:   equation
    let vlist;
    if (group.isOver) {
        vlist = makeVList({
            positionType: "firstBaseline",
            children: [
                {type: "elem", elem: body},
                {type: "kern", size: 0.1},
                {type: "elem", elem: braceBody,
                    wrapperClasses: ["svg-align"]},
            ],
        }, options);
    } else {
        vlist = makeVList({
            positionType: "bottom",
            positionData: body.depth + 0.1 + braceBody.height,
            children: [
                {type: "elem", elem: braceBody,
                    wrapperClasses: ["svg-align"]},
                {type: "kern", size: 0.1},
                {type: "elem", elem: body},
            ],
        }, options);
    }

    if (supSubGroup) {
        // To write the supsub, wrap the first vlist in another vlist:
        // They can't all go in the same vlist, because the note might be
        // wider than the equation. We want the equation to control the
        // brace width.

        //      note          long note           long note
        //   ┏━━━━━━━━┓   or    ┏━━━┓     not    ┏━━━━━━━━━┓
        //    equation           eqn                 eqn

        const vSpan = makeSpan(
            ["minner", (group.isOver ? "mover" : "munder")],
            [vlist], options);

        if (group.isOver) {
            vlist = makeVList({
                positionType: "firstBaseline",
                children: [
                    {type: "elem", elem: vSpan},
                    {type: "kern", size: 0.2},
                    {type: "elem", elem: supSubGroup},
                ],
            }, options);
        } else {
            vlist = makeVList({
                positionType: "bottom",
                positionData: vSpan.depth + 0.2 + supSubGroup.height +
                    supSubGroup.depth,
                children: [
                    {type: "elem", elem: supSubGroup},
                    {type: "kern", size: 0.2},
                    {type: "elem", elem: vSpan},
                ],
            }, options);
        }
    }

    return makeSpan(
        ["minner", (group.isOver ? "mover" : "munder")], [vlist], options);
};

const mathmlBuilder: MathMLBuilder<"horizBrace"> = (group, options) => {
    const accentNode = stretchyMathML(group.label);
    return new MathNode(
        (group.isOver ? "mover" : "munder"),
        [mml.buildGroup(group.base, options), accentNode]
    );
};

// Horizontal stretchy braces
defineFunction({
    type: "horizBrace",
    names: ["\\overbrace", "\\underbrace", "\\overbracket", "\\underbracket"],
    props: {
        numArgs: 1,
    },
    handler({parser, funcName}, args) {
        return {
            type: "horizBrace",
            mode: parser.mode,
            label: funcName,
            isOver: funcName.includes("\\over"),
            base: args[0],
        };
    },
    htmlBuilder,
    mathmlBuilder,
});
Tx	;import defineFunction, {ordargument} from "../defineFunction";
import {makeAnchor} from "../buildCommon";
import {assertNodeType} from "../parseNode";
import {MathNode} from "../mathMLTree";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";
import type {ParseNode} from "../parseNode";

defineFunction({
    type: "href",
    names: ["\\href"],
    props: {
        numArgs: 2,
        argTypes: ["url", "original"],
        allowedInText: true,
    },
    handler: ({parser}, args) => {
        const body = args[1];
        const href = assertNodeType(args[0], "url").url;

        if (!parser.settings.isTrusted({
            command: "\\href",
            url: href,
        })) {
            return parser.formatUnsupportedCmd("\\href");
        }

        return {
            type: "href",
            mode: parser.mode,
            href,
            body: ordargument(body),
        };
    },
    htmlBuilder: (group, options) => {
        const elements = html.buildExpression(group.body, options, false);
        return makeAnchor(group.href, [], elements, options);
    },
    mathmlBuilder: (group, options) => {
        let math = mml.buildExpressionRow(group.body, options);
        if (!(math instanceof MathNode)) {
            math = new MathNode("mrow", [math]);
        }
        (math as MathNode).setAttribute("href", group.href);
        return math;
    },
});

defineFunction({
    type: "href",
    names: ["\\url"],
    props: {
        numArgs: 1,
        argTypes: ["url"],
        allowedInText: true,
    },
    handler: ({parser}, args) => {
        const href = assertNodeType(args[0], "url").url;

        if (!parser.settings.isTrusted({
            command: "\\url",
            url: href,
        })) {
            return parser.formatUnsupportedCmd("\\url");
        }

        const chars: ParseNode<"textord">[] = [];
        for (let i = 0; i < href.length; i++) {
            let c = href[i];
            if (c === "~") {
                c = "\\textasciitilde";
            }
            chars.push({
                type: "textord",
                mode: "text",
                text: c,
            });
        }
        const body: ParseNode<"text"> = {
            type: "text",
            mode: parser.mode,
            font: "\\texttt",
            body: chars,
        };
        return {
            type: "href",
            mode: parser.mode,
            href,
            body: ordargument(body),
        };
    },
});
y]xOimport defineFunction, {ordargument} from "../defineFunction";
import {makeSpan} from "../buildCommon";
import {assertNodeType} from "../parseNode";
import ParseError from "../ParseError";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";
import type {AnyTrustContext} from "../Settings";

defineFunction({
    type: "html",
    names: ["\\htmlClass", "\\htmlId", "\\htmlStyle", "\\htmlData"],
    props: {
        numArgs: 2,
        argTypes: ["raw", "original"],
        allowedInText: true,
    },
    handler: ({parser, funcName, token}, args) => {
        const value = assertNodeType(args[0], "raw").string;
        const body = args[1];

        if (parser.settings.strict) {
            parser.settings.reportNonstrict("htmlExtension",
                "HTML extension is disabled on strict mode");
        }

        let trustContext: AnyTrustContext;
        const attributes: Record<string, string> = {};

        switch (funcName) {
            case "\\htmlClass":
                attributes.class = value;
                trustContext = {
                    command: "\\htmlClass",
                    class: value,
                };
                break;
            case "\\htmlId":
                attributes.id = value;
                trustContext = {
                    command: "\\htmlId",
                    id: value,
                };
                break;
            case "\\htmlStyle":
                attributes.style = value;
                trustContext = {
                    command: "\\htmlStyle",
                    style: value,
                };
                break;
            case "\\htmlData": {
                const data = value.split(",");
                for (let i = 0; i < data.length; i++) {
                    const item = data[i];
                    const firstEquals = item.indexOf("=");
                    if (firstEquals < 0) {
                        throw new ParseError(`\\htmlData key/value '${item}'` +
                            ` missing equals sign`);
                    }
                    const key = item.slice(0, firstEquals);
                    const value = item.slice(firstEquals + 1);
                    attributes["data-" + key.trim()] = value;
                }

                trustContext = {
                    command: "\\htmlData",
                    attributes,
                };
                break;
            }
            default:
                throw new Error("Unrecognized html command");
        }

        if (!parser.settings.isTrusted(trustContext)) {
            return parser.formatUnsupportedCmd(funcName);
        }
        return {
            type: "html",
            mode: parser.mode,
            attributes,
            body: ordargument(body),
        };
    },
    htmlBuilder: (group, options) => {
        const elements = html.buildExpression(group.body, options, false);

        const classes = ["enclosing"];
        if (group.attributes.class) {
            classes.push(...group.attributes.class.trim().split(/\s+/));
        }

        const span = makeSpan(classes, elements, options);
        for (const attr in group.attributes) {
            if (attr !== "class" && group.attributes.hasOwnProperty(attr)) {
                span.setAttribute(attr, group.attributes[attr]);
            }
        }
        return span;
    },
    mathmlBuilder: (group, options) => {
        return mml.buildExpressionRow(group.body, options);
    },
});
:{`8x~import defineFunction, {ordargument} from "../defineFunction";
import {makeFragment} from "../buildCommon";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";

defineFunction({
    type: "htmlmathml",
    names: ["\\html@mathml"],
    props: {
        numArgs: 2,
        allowedInArgument: true,
        allowedInText: true,
    },
    handler: ({parser}, args) => {
        return {
            type: "htmlmathml",
            mode: parser.mode,
            html:   ordargument(args[0]),
            mathml: ordargument(args[1]),
        };
    },
    htmlBuilder: (group, options) => {
        const elements = html.buildExpression(
            group.html,
            options,
            false
        );
        return makeFragment(elements);
    },
    mathmlBuilder: (group, options) => {
        return mml.buildExpressionRow(group.mathml, options);
    },
});

巹xhimport defineFunction from "../defineFunction";
import type {Measurement} from "../units";
import {calculateSize, validUnit, makeEm} from "../units";
import ParseError from "../ParseError";
import {Img} from "../domTree";
import {MathNode} from "../mathMLTree";
import {assertNodeType} from "../parseNode";
import type {CssStyle} from "../domTree";

const sizeData = function(str: string): Measurement {
    if (/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(str)) {
        // str is a number with no unit specified.
        // default unit is bp, per graphix package.
        return {number: +str, unit: "bp"};
    } else {
        const match = (/([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/).exec(str);
        if (!match) {
            throw new ParseError("Invalid size: '" + str
                + "' in \\includegraphics");
        }
        const data = {
            number: +(match[1] + match[2]), // sign + magnitude, cast to number
            unit: match[3],
        };
        if (!validUnit(data)) {
            throw new ParseError("Invalid unit: '" + data.unit
             + "' in \\includegraphics.");
        }
        return data;
    }
};

defineFunction({
    type: "includegraphics",
    names: ["\\includegraphics"],
    props: {
        numArgs: 1,
        numOptionalArgs: 1,
        argTypes: ["raw", "url"],
        allowedInText: false,
    },
    handler: ({parser}, args, optArgs) => {
        let width = {number: 0, unit: "em"};
        let height = {number: 0.9, unit: "em"};    // sorta character sized.
        let totalheight = {number: 0, unit: "em"};
        let alt = "";

        if (optArgs[0]) {
            const attributeStr = assertNodeType(optArgs[0], "raw").string;

            // Parser.js does not parse key/value pairs. We get a string.
            const attributes = attributeStr.split(",");
            for (let i = 0; i < attributes.length; i++) {
                const keyVal = attributes[i].split("=");
                if (keyVal.length === 2) {
                    const str = keyVal[1].trim();
                    switch (keyVal[0].trim()) {
                        case "alt":
                            alt = str;
                            break;
                        case "width":
                            width = sizeData(str);
                            break;
                        case "height":
                            height = sizeData(str);
                            break;
                        case "totalheight":
                            totalheight = sizeData(str);
                            break;
                        default:
                            throw new ParseError("Invalid key: '" + keyVal[0] +
                                "' in \\includegraphics.");
                    }
                }
            }
        }

        const src = assertNodeType(args[0], "url").url;

        if (alt === "") {
            // No alt given. Use the file name. Strip away the path.
            alt = src;
            alt = alt.replace(/^.*[\\/]/, '');
            alt = alt.substring(0, alt.lastIndexOf('.'));
        }

        if (!parser.settings.isTrusted({
            command: "\\includegraphics",
            url: src,
        })) {
            return parser.formatUnsupportedCmd("\\includegraphics");
        }

        return {
            type: "includegraphics",
            mode: parser.mode,
            alt: alt,
            width: width,
            height: height,
            totalheight: totalheight,
            src: src,
        };
    },
    htmlBuilder: (group, options) => {
        const height = calculateSize(group.height, options);
        let depth = 0;

        if (group.totalheight.number > 0) {
            depth = calculateSize(group.totalheight, options) - height;
        }

        let width = 0;
        if (group.width.number > 0) {
            width = calculateSize(group.width, options);
        }

        const style: CssStyle = {height: makeEm(height + depth)};
        if (width > 0) {
            style.width = makeEm(width);
        }
        if (depth > 0) {
            style.verticalAlign = makeEm(-depth);
        }

        const node = new Img(group.src, group.alt, style);
        node.height = height;
        node.depth = depth;

        return node;
    },
    mathmlBuilder: (group, options) => {
        const node = new MathNode("mglyph", []);
        node.setAttribute("alt", group.alt);

        const height = calculateSize(group.height, options);
        let depth = 0;
        if (group.totalheight.number > 0) {
            depth = calculateSize(group.totalheight, options) - height;
            node.setAttribute("valign", makeEm(-depth));
        }
        node.setAttribute("height", makeEm(height + depth));

        if (group.width.number > 0) {
            const width = calculateSize(group.width, options);
            node.setAttribute("width", makeEm(width));
        }
        node.setAttribute("src", group.src);
        return node;
    },
});
cwxv// Horizontal spacing commands

import defineFunction from "../defineFunction";
import {makeGlue} from "../buildCommon";
import {SpaceNode} from "../mathMLTree";
import {calculateSize} from "../units";
import {assertNodeType} from "../parseNode";

// TODO: \hskip and \mskip should support plus and minus in lengths

defineFunction({
    type: "kern",
    names: ["\\kern", "\\mkern", "\\hskip", "\\mskip"],
    props: {
        numArgs: 1,
        argTypes: ["size"],
        primitive: true,
        allowedInText: true,
    },
    handler({parser, funcName}, args) {
        const size = assertNodeType(args[0], "size");
        if (parser.settings.strict) {
            const mathFunction = (funcName[1] === 'm');  // \mkern, \mskip
            const muUnit = (size.value.unit === 'mu');
            if (mathFunction) {
                if (!muUnit) {
                    parser.settings.reportNonstrict("mathVsTextUnits",
                        `LaTeX's ${funcName} supports only mu units, ` +
                        `not ${size.value.unit} units`);
                }
                if (parser.mode !== "math") {
                    parser.settings.reportNonstrict("mathVsTextUnits",
                        `LaTeX's ${funcName} works only in math mode`);
                }
            } else {  // !mathFunction
                if (muUnit) {
                    parser.settings.reportNonstrict("mathVsTextUnits",
                        `LaTeX's ${funcName} doesn't support mu units`);
                }
            }
        }
        return {
            type: "kern",
            mode: parser.mode,
            dimension: size.value,
        };
    },
    htmlBuilder(group, options) {
        return makeGlue(group.dimension, options);
    },
    mathmlBuilder(group, options) {
        const dimension = calculateSize(group.dimension, options);
        return new SpaceNode(dimension);
    },
});
gE,Tx	// Horizontal overlap functions
import defineFunction from "../defineFunction";
import {makeSpan} from "../buildCommon";
import {MathNode} from "../mathMLTree";
import {makeEm} from "../units";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";

defineFunction({
    type: "lap",
    names: ["\\mathllap", "\\mathrlap", "\\mathclap"],
    props: {
        numArgs: 1,
        allowedInText: true,
    },
    handler: ({parser, funcName}, args) => {
        const body = args[0];
        return {
            type: "lap",
            mode: parser.mode,
            alignment: funcName.slice(5),
            body,
        };
    },
    htmlBuilder: (group, options) => {
        // mathllap, mathrlap, mathclap
        let inner;
        if (group.alignment === "clap") {
            // ref: https://www.math.lsu.edu/~aperlis/publications/mathclap/
            inner = makeSpan(
                [], [html.buildGroup(group.body, options)]);
            // wrap, since CSS will center a .clap > .inner > span
            inner = makeSpan(["inner"], [inner], options);
        } else {
            inner = makeSpan(
                ["inner"], [html.buildGroup(group.body, options)]);
        }
        const fix = makeSpan(["fix"], []);
        let node = makeSpan(
            [group.alignment], [inner, fix], options);

        // At this point, we have correctly set horizontal alignment of the
        // two items involved in the lap.
        // Next, use a strut to set the height of the HTML bounding box.
        // Otherwise, a tall argument may be misplaced.
        // This code resolved issue #1153
        const strut = makeSpan(["strut"]);
        strut.style.height = makeEm(node.height + node.depth);
        if (node.depth) {
            strut.style.verticalAlign = makeEm(-node.depth);
        }
        node.children.unshift(strut);

        // Next, prevent vertical misplacement when next to something tall.
        // This code resolves issue #1234
        node = makeSpan(["thinbox"], [node], options);
        return makeSpan(["mord", "vbox"], [node], options);
    },
    mathmlBuilder: (group, options) => {
        // mathllap, mathrlap, mathclap
        const node = new MathNode(
            "mpadded", [mml.buildGroup(group.body, options)]);

        if (group.alignment !== "rlap")    {
            const offset = (group.alignment === "llap" ? "-1" : "-0.5");
            node.setAttribute("lspace", offset + "width");
        }
        node.setAttribute("width", "0px");

        return node;
    },
});
SxExVimport defineFunction from "../defineFunction";
import ParseError from "../ParseError";

// Switching from text mode back to math mode
defineFunction({
    type: "styling",
    names: ["\\(", "$"],
    props: {
        numArgs: 0,
        allowedInText: true,
        allowedInMath: false,
    },
    handler({funcName, parser}, args) {
        const outerMode = parser.mode;
        parser.switchMode("math");
        const close = (funcName === "\\(" ? "\\)" : "$");
        const body = parser.parseExpression(false, close);
        parser.expect(close);
        parser.switchMode(outerMode);
        return {
            type: "styling",
            mode: parser.mode,
            style: "text",
            resetFont: true,
            body,
        };
    },
});

// Check for extra closing math delimiters
defineFunction({
    type: "text", // Doesn't matter what this is.
    names: ["\\)", "\\]"],
    props: {
        numArgs: 0,
        allowedInText: true,
        allowedInMath: false,
    },
    handler(context, args) {
        throw new ParseError(`Mismatched ${context.funcName}`);
    },
});
ߢFaximport defineFunction, {ordargument} from "../defineFunction";
import {makeFragment} from "../buildCommon";
import Style from "../Style";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";

import type Options from "../Options";
import type {ParseNode} from "../parseNode";

const chooseMathStyle = (group: ParseNode<"mathchoice">, options: Options) => {
    switch (options.style.size) {
        case Style.DISPLAY.size: return group.display;
        case Style.TEXT.size: return group.text;
        case Style.SCRIPT.size: return group.script;
        case Style.SCRIPTSCRIPT.size: return group.scriptscript;
        default: return group.text;
    }
};

defineFunction({
    type: "mathchoice",
    names: ["\\mathchoice"],
    props: {
        numArgs: 4,
        primitive: true,
    },
    handler: ({parser}, args) => {
        return {
            type: "mathchoice",
            mode: parser.mode,
            display:      ordargument(args[0]),
            text:         ordargument(args[1]),
            script:       ordargument(args[2]),
            scriptscript: ordargument(args[3]),
        };
    },
    htmlBuilder: (group, options) => {
        const body = chooseMathStyle(group, options);
        const elements = html.buildExpression(
            body,
            options,
            false
        );
        return makeFragment(elements);
    },
    mathmlBuilder: (group, options) => {
        const body = chooseMathStyle(group, options);
        return mml.buildExpressionRow(body, options);
    },
});
AݘxMimport defineFunction, {ordargument} from "../defineFunction";
import {makeSpan} from "../buildCommon";
import {isCharacterBox} from "../utils";
import {MathNode} from "../mathMLTree";
import type {AnyParseNode} from "../parseNode";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";

import type Options from "../Options";
import type {ParseNode} from "../parseNode";

function htmlBuilder(group: ParseNode<"mclass">, options: Options) {
    const elements = html.buildExpression(group.body, options, true);
    return makeSpan([group.mclass], elements, options);
}

function mathmlBuilder(group: ParseNode<"mclass">, options: Options) {
    let node: MathNode;
    const inner = mml.buildExpression(group.body, options);

    if (group.mclass === "minner") {
        node = new MathNode("mpadded", inner);
    } else if (group.mclass === "mord") {
        if (group.isCharacterBox) {
            node = inner[0];
            node.type = "mi";
        } else {
            node = new MathNode("mi", inner);
        }
    } else {
        if (group.isCharacterBox) {
            node = inner[0];
            node.type = "mo";
        } else {
            node = new MathNode("mo", inner);
        }

        // Set spacing based on what is the most likely adjacent atom type.
        // See TeXbook p170.
        if (group.mclass === "mbin") {
            node.attributes.lspace = "0.22em"; // medium space
            node.attributes.rspace = "0.22em";
        } else if (group.mclass === "mpunct") {
            node.attributes.lspace = "0em";
            node.attributes.rspace = "0.17em"; // thinspace
        } else if (group.mclass === "mopen" || group.mclass === "mclose") {
            node.attributes.lspace = "0em";
            node.attributes.rspace = "0em";
        } else if (group.mclass === "minner") {
            node.attributes.lspace = "0.0556em"; // 1 mu is the most likely option
            node.attributes.width = "+0.1111em";
        }
        // MathML <mo> default space is 5/18 em, so <mrel> needs no action.
        // Ref: https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mo
    }
    return node;
}

// Math class commands except \mathop
defineFunction({
    type: "mclass",
    names: [
        "\\mathord", "\\mathbin", "\\mathrel", "\\mathopen",
        "\\mathclose", "\\mathpunct", "\\mathinner",
    ],
    props: {
        numArgs: 1,
        primitive: true,
    },
    handler({parser, funcName}, args) {
        const body = args[0];
        return {
            type: "mclass",
            mode: parser.mode,
            mclass: "m" + funcName.slice(5), // TODO(kevinb): don't prefix with 'm'
            body: ordargument(body),
            isCharacterBox: isCharacterBox(body),
        };
    },
    htmlBuilder,
    mathmlBuilder,
});

export const binrelClass = (arg: AnyParseNode): string => {
    // \binrel@ spacing varies with (bin|rel|ord) of the atom in the argument.
    // (by rendering separately and with {}s before and after, and measuring
    // the change in spacing).  We'll do roughly the same by detecting the
    // atom type directly.
    const atom = (arg.type === "ordgroup" && arg.body.length ? arg.body[0] : arg);
    if (atom.type === "atom" && (atom.family === "bin" || atom.family === "rel")) {
        return "m" + atom.family;
    } else {
        return "mord";
    }
};

// \@binrel{x}{y} renders like y but as mbin/mrel/mord if x is mbin/mrel/mord.
// This is equivalent to \binrel@{x}\binrel@@{y} in AMSTeX.
defineFunction({
    type: "mclass",
    names: ["\\@binrel"],
    props: {
        numArgs: 2,
    },
    handler({parser}, args) {
        return {
            type: "mclass",
            mode: parser.mode,
            mclass: binrelClass(args[0]),
            body: ordargument(args[1]),
            isCharacterBox: isCharacterBox(args[1]),
        };
    },
});

// Build a relation or stacked op by placing one symbol on top of another
defineFunction({
    type: "mclass",
    names: ["\\stackrel", "\\overset", "\\underset"],
    props: {
        numArgs: 2,
    },
    handler({parser, funcName}, args) {
        const baseArg = args[1];
        const shiftedArg = args[0];

        let mclass;
        if (funcName !== "\\stackrel") {
            // LaTeX applies \binrel spacing to \overset and \underset.
            mclass = binrelClass(baseArg);
        } else {
            mclass = "mrel";  // for \stackrel
        }

        const baseOp: ParseNode<"op"> = {
            type: "op",
            mode: baseArg.mode,
            limits: true,
            alwaysHandleSupSub: true,
            parentIsSupSub: false,
            symbol: false,
            suppressBaseShift: funcName !== "\\stackrel",
            body: ordargument(baseArg),
        };

        const supsub: ParseNode<"supsub"> = {
            type: "supsub",
            mode: shiftedArg.mode,
            base: baseOp,
            sup: funcName === "\\underset" ? null : shiftedArg,
            sub: funcName === "\\underset" ? shiftedArg : null,
        };

        return {
            type: "mclass",
            mode: parser.mode,
            mclass,
            body: [supsub],
            isCharacterBox: isCharacterBox(supsub),
        };
    },
    htmlBuilder,
    mathmlBuilder,
});
,x7*// Limits, symbols
import defineFunction, {ordargument} from "../defineFunction";
import {mathsym, makeSpan, makeSymbol, makeVList, staticSvg} from "../buildCommon";
import {SymbolNode} from "../domTree";
import {MathNode, newDocumentFragment, TextNode} from "../mathMLTree";
import Style from "../Style";
import {assembleSupSub} from "./utils/assembleSupSub";
import {assertNodeType} from "../parseNode";
import {makeEm} from "../units";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";

import type {HtmlBuilderSupSub, MathMLBuilder} from "../defineFunction";
import type {ParseNode} from "../parseNode";

// Most operators have a large successor symbol, but these don't.
const noSuccessor = new Set([
    "\\smallint",
]);

// NOTE: Unlike most `htmlBuilder`s, this one handles not only "op", but also
// "supsub" since some of them (like \int) can affect super/subscripting.
export const htmlBuilder: HtmlBuilderSupSub<"op"> = (grp, options) => {
    // Operators are handled in the TeXbook pg. 443-444, rule 13(a).
    let supGroup;
    let subGroup;
    let hasLimits = false;
    let group: ParseNode<"op">;
    if (grp.type === "supsub") {
        // If we have limits, supsub will pass us its group to handle. Pull
        // out the superscript and subscript and set the group to the op in
        // its base.
        supGroup = grp.sup;
        subGroup = grp.sub;
        group = assertNodeType(grp.base, "op");
        hasLimits = true;
    } else {
        group = assertNodeType(grp, "op");
    }

    const style = options.style;

    let large = false;
    if (style.size === Style.DISPLAY.size &&
        group.symbol &&
        !noSuccessor.has(group.name)) {

        // Most symbol operators get larger in displaystyle (rule 13)
        large = true;
    }

    let base;
    // Italic correction from the symbol glyph, captured before the symbol
    // may be wrapped in a vlist (for \oiint/\oiiint).  Stays 0 for non-symbol ops.
    let symbolItalic;
    if (group.symbol) {
        // If this is a symbol, create the symbol.
        const fontName = large ? "Size2-Regular" : "Size1-Regular";

        let stash = "";
        if (group.name === "\\oiint" || group.name === "\\oiiint") {
            // No font glyphs yet, so use a glyph w/o the oval.
            // TODO: When font glyphs are available, delete this code.
            stash = group.name.slice(1);
            group.name = stash === "oiint" ? "\\iint" : "\\iiint";
        }

        base = makeSymbol(
            group.name, fontName, "math", options,
            ["mop", "op-symbol", large ? "large-op" : "small-op"]);
        symbolItalic = base.italic;

        if (stash.length > 0) {
            // We're in \oiint or \oiiint. Overlay the oval.
            // TODO: When font glyphs are available, delete this code.
            const oval = staticSvg(stash + "Size"
                + (large ? "2" : "1"), options);
            base = makeVList({
                positionType: "individualShift",
                children: [
                    {type: "elem", elem: base, shift: 0},
                    {type: "elem", elem: oval, shift: large ? 0.08 : 0},
                ],
            }, options);
            group.name = "\\" + stash;
            base.classes.unshift("mop");
            // Carry the italic correction from the original symbol to the
            // vlist wrapper so supsub can use it for subscript positioning.
            base.italic = symbolItalic;
        }
    } else if (group.body) {
        // If this is a list, compose that list.
        const inner = html.buildExpression(group.body, options, true);
        if (inner.length === 1 && inner[0] instanceof SymbolNode) {
            base = inner[0];
            base.classes[0] = "mop"; // replace old mclass
        } else {
            base = makeSpan(["mop"], inner, options);
        }
    } else {
        // Otherwise, this is a text operator. Build the text from the
        // operator's name.
        const output = [];
        for (let i = 1; i < group.name!.length; i++) {
            output.push(mathsym(group.name![i], group.mode, options));
        }
        base = makeSpan(["mop"], output, options);
    }

    // If content of op is a single symbol, shift it vertically.
    let baseShift = 0;
    let slant = 0;
    if ((base instanceof SymbolNode
        || group.name === "\\oiint" || group.name === "\\oiiint")
        && !group.suppressBaseShift) {
        // We suppress the shift of the base of \overset and \underset. Otherwise,
        // shift the symbol so its center lies on the axis (rule 13). It
        // appears that our fonts have the centers of the symbols already
        // almost on the axis, so these numbers are very small. Note we
        // don't actually apply this here, but instead it is used either in
        // the vlist creation or separately when there are no limits.
        baseShift = (base.height - base.depth) / 2 -
            options.fontMetrics().axisHeight;

        // The slant of the symbol is just its italic correction.
        // SymbolNode carries .italic natively; Span (for \oiint/\oiiint)
        // only has it set when nonzero, so default to 0.
        slant = base.italic ?? 0;
    }

    if (hasLimits) {
        return assembleSupSub(base, supGroup, subGroup, options,
            style, slant, baseShift);

    } else {
        if (baseShift) {
            base.style.position = "relative";
            base.style.top = makeEm(baseShift);
        }

        return base;
    }
};

const mathmlBuilder: MathMLBuilder<"op"> = (group, options) => {
    let node;

    if (group.symbol) {
        // This is a symbol. Just add the symbol.
        node = new MathNode(
            "mo", [mml.makeText(group.name, group.mode)]);
        if (noSuccessor.has(group.name)) {
            node.setAttribute("largeop", "false");
        }
    } else if (group.body) {
        // This is an operator with children. Add them.
        node = new MathNode(
            "mo", mml.buildExpression(group.body, options));
    } else {
        // This is a text operator. Add all the characters from the
        // operator's name.
        node = new MathNode(
            "mi", [new TextNode(group.name!.slice(1))]);
        // Append an <mo>&ApplyFunction;</mo>.
        // ref: https://www.w3.org/TR/REC-MathML/chap3_2.html#sec3.2.4
        const operator = new MathNode("mo",
            [mml.makeText("\u2061", "text")]);
        if (group.parentIsSupSub) {
            node = new MathNode("mrow", [node, operator]);
        } else {
            node = newDocumentFragment([node, operator]);
        }
    }

    return node;
};

const singleCharBigOps: Record<string, string> = {
    "\u220F": "\\prod",
    "\u2210": "\\coprod",
    "\u2211": "\\sum",
    "\u22c0": "\\bigwedge",
    "\u22c1": "\\bigvee",
    "\u22c2": "\\bigcap",
    "\u22c3": "\\bigcup",
    "\u2a00": "\\bigodot",
    "\u2a01": "\\bigoplus",
    "\u2a02": "\\bigotimes",
    "\u2a04": "\\biguplus",
    "\u2a06": "\\bigsqcup",
};

defineFunction({
    type: "op",
    names: [
        "\\coprod", "\\bigvee", "\\bigwedge", "\\biguplus", "\\bigcap",
        "\\bigcup", "\\intop", "\\prod", "\\sum", "\\bigotimes",
        "\\bigoplus", "\\bigodot", "\\bigsqcup", "\\smallint", "\u220F",
        "\u2210", "\u2211", "\u22c0", "\u22c1", "\u22c2", "\u22c3", "\u2a00",
        "\u2a01", "\u2a02", "\u2a04", "\u2a06",
    ],
    props: {
        numArgs: 0,
    },
    handler: ({parser, funcName}, args) => {
        let fName = funcName;
        if (fName.length === 1) {
            fName = singleCharBigOps[fName];
        }
        return {
            type: "op",
            mode: parser.mode,
            limits: true,
            parentIsSupSub: false,
            symbol: true,
            name: fName,
        };
    },
    htmlBuilder,
    mathmlBuilder,
});

// Note: calling defineFunction with a type that's already been defined only
// works because the same htmlBuilder and mathmlBuilder are being used.
defineFunction({
    type: "op",
    names: ["\\mathop"],
    props: {
        numArgs: 1,
        primitive: true,
    },
    handler: ({parser}, args) => {
        const body = args[0];
        return {
            type: "op",
            mode: parser.mode,
            limits: false,
            parentIsSupSub: false,
            symbol: false,
            body: ordargument(body),
        };
    },
    htmlBuilder,
    mathmlBuilder,
});

// There are 2 flags for operators; whether they produce limits in
// displaystyle, and whether they are symbols and should grow in
// displaystyle. These four groups cover the four possible choices.
const singleCharIntegrals: Record<string, string> = {
    "\u222b": "\\int",
    "\u222c": "\\iint",
    "\u222d": "\\iiint",
    "\u222e": "\\oint",
    "\u222f": "\\oiint",
    "\u2230": "\\oiiint",
};

// No limits, not symbols
defineFunction({
    type: "op",
    names: [
        "\\arcsin", "\\arccos", "\\arctan", "\\arctg", "\\arcctg",
        "\\arg", "\\ch", "\\cos", "\\cosec", "\\cosh", "\\cot", "\\cotg",
        "\\coth", "\\csc", "\\ctg", "\\cth", "\\deg", "\\dim", "\\exp",
        "\\hom", "\\ker", "\\lg", "\\ln", "\\log", "\\sec", "\\sin",
        "\\sinh", "\\sh", "\\tan", "\\tanh", "\\tg", "\\th",
    ],
    props: {
        numArgs: 0,
    },
    handler({parser, funcName}) {
        return {
            type: "op",
            mode: parser.mode,
            limits: false,
            parentIsSupSub: false,
            symbol: false,
            name: funcName,
        };
    },
    htmlBuilder,
    mathmlBuilder,
});

// Limits, not symbols
defineFunction({
    type: "op",
    names: [
        "\\det", "\\gcd", "\\inf", "\\lim", "\\max", "\\min", "\\Pr", "\\sup",
    ],
    props: {
        numArgs: 0,
    },
    handler({parser, funcName}) {
        return {
            type: "op",
            mode: parser.mode,
            limits: true,
            parentIsSupSub: false,
            symbol: false,
            name: funcName,
        };
    },
    htmlBuilder,
    mathmlBuilder,
});

// No limits, symbols
defineFunction({
    type: "op",
    names: [
        "\\int", "\\iint", "\\iiint", "\\oint", "\\oiint", "\\oiiint",
        "\u222b", "\u222c", "\u222d", "\u222e", "\u222f", "\u2230",
    ],
    props: {
        numArgs: 0,
        allowedInArgument: true,
    },
    handler({parser, funcName}) {
        let fName = funcName;
        if (fName.length === 1) {
            fName = singleCharIntegrals[fName];
        }
        return {
            type: "op",
            mode: parser.mode,
            limits: false,
            parentIsSupSub: false,
            symbol: true,
            name: fName,
        };
    },
    htmlBuilder,
    mathmlBuilder,
});
oHUxnimport defineFunction, {ordargument} from "../defineFunction";
import defineMacro from "../defineMacro";
import {makeSpan} from "../buildCommon";
import {MathNode, newDocumentFragment, SpaceNode, TextNode} from "../mathMLTree";
import {SymbolNode} from "../domTree";
import {assembleSupSub} from "./utils/assembleSupSub";
import {assertNodeType} from "../parseNode";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";

import type {HtmlBuilderSupSub, MathMLBuilder} from "../defineFunction";
import type {AnyParseNode, ParseNode} from "../parseNode";

// NOTE: Unlike most `htmlBuilder`s, this one handles not only
// "operatorname", but also  "supsub" since \operatorname* can
// affect super/subscripting.
export const htmlBuilder: HtmlBuilderSupSub<"operatorname"> = (grp, options) => {
    // Operators are handled in the TeXbook pg. 443-444, rule 13(a).
    let supGroup;
    let subGroup;
    let hasLimits = false;
    let group: ParseNode<"operatorname">;
    if (grp.type === "supsub") {
        // If we have limits, supsub will pass us its group to handle. Pull
        // out the superscript and subscript and set the group to the op in
        // its base.
        supGroup = grp.sup;
        subGroup = grp.sub;
        group = assertNodeType(grp.base, "operatorname");
        hasLimits = true;
    } else {
        group = assertNodeType(grp, "operatorname");
    }

    let base;
    if (group.body.length > 0) {
        const body = group.body.map((child): AnyParseNode => {
            const childText = "text" in child ? child.text : undefined;
            if (typeof childText === "string") {
                return {
                    type: "textord",
                    mode: child.mode,
                    text: childText,
                };
            } else {
                return child;
            }
        });

        // Consolidate function names into symbol characters.
        const expression = html.buildExpression(
            body, options.withFont("mathrm"), true);

        for (let i = 0; i < expression.length; i++) {
            const child = expression[i];
            if (child instanceof SymbolNode) {
                // Per amsopn package,
                // change minus to hyphen and \ast to asterisk
                child.text = child.text.replace(/\u2212/, "-")
                    .replace(/\u2217/, "*");
            }
        }
        base = makeSpan(["mop"], expression, options);
    } else {
        base = makeSpan(["mop"], [], options);
    }

    if (hasLimits) {
        return assembleSupSub(base, supGroup, subGroup, options,
            options.style, 0, 0);

    } else {
        return base;
    }
};

const mathmlBuilder: MathMLBuilder<"operatorname"> = (group, options) => {
    // The steps taken here are similar to the html version.
    let expression: Array<MathNode | TextNode> = mml.buildExpression(
        group.body, options.withFont("mathrm"));

    // Is expression a string or has it something like a fraction?
    let isAllString = true;  // default
    for (let i = 0; i < expression.length; i++) {
        const node = expression[i];
        if (node instanceof SpaceNode) {
            // Do nothing
        } else if (node instanceof MathNode) {
            switch (node.type) {
                case "mi":
                case "mn":
                case "mspace":
                case "mtext":
                    break;  // Do nothing yet.
                case "mo": {
                    const child = node.children[0];
                    if (node.children.length === 1 &&
                        child instanceof TextNode) {
                        child.text =
                            child.text.replace(/\u2212/, "-")
                                .replace(/\u2217/, "*");
                    } else {
                        isAllString = false;
                    }
                    break;
                }
                default:
                    isAllString = false;
            }
        } else {
            isAllString = false;
        }
    }

    if (isAllString) {
        // Write a single TextNode instead of multiple nested tags.
        const word = expression.map(node => node.toText()).join("");
        expression = [new TextNode(word)];
    }

    const identifier = new MathNode("mi", expression);
    identifier.setAttribute("mathvariant", "normal");

    // \u2061 is the same as &ApplyFunction;
    // ref: https://www.w3schools.com/charsets/ref_html_entities_a.asp
    const operator = new MathNode("mo",
        [mml.makeText("\u2061", "text")]);

    if (group.parentIsSupSub) {
        return new MathNode("mrow", [identifier, operator]);
    } else {
        return newDocumentFragment([identifier, operator]);
    }
};

// \operatorname
// amsopn.dtx: \mathop{#1\kern\z@\operator@font#3}\newmcodes@
defineFunction({
    type: "operatorname",
    names: ["\\operatorname@", "\\operatornamewithlimits"],
    props: {
        numArgs: 1,
    },
    handler: ({parser, funcName}, args) => {
        const body = args[0];
        return {
            type: "operatorname",
            mode: parser.mode,
            body: ordargument(body),
            alwaysHandleSupSub: (funcName === "\\operatornamewithlimits"),
            limits: false,
            parentIsSupSub: false,
        };
    },
    htmlBuilder,
    mathmlBuilder,
});

defineMacro("\\operatorname",
  "\\@ifstar\\operatornamewithlimits\\operatorname@");
+JK(x~import {defineFunctionBuilders} from "../defineFunction";
import {makeFragment, makeSpan} from "../buildCommon";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";

defineFunctionBuilders({
    type: "ordgroup",
    htmlBuilder(group, options) {
        if (group.semisimple) {
            return makeFragment(
                html.buildExpression(group.body, options, false));
        }
        return makeSpan(
            ["mord"], html.buildExpression(group.body, options, true), options);
    },
    mathmlBuilder(group, options) {
        return mml.buildExpressionRow(group.body, options, true);
    },
});
0N_qximport defineFunction from "../defineFunction";
import {makeLineSpan, makeSpan, makeVList} from "../buildCommon";
import {MathNode, TextNode} from "../mathMLTree";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";

defineFunction({
    type: "overline",
    names: ["\\overline"],
    props: {
        numArgs: 1,
    },
    handler({parser}, args) {
        const body = args[0];
        return {
            type: "overline",
            mode: parser.mode,
            body,
        };
    },
    htmlBuilder(group, options) {
        // Overlines are handled in the TeXbook pg 443, Rule 9.

        // Build the inner group in the cramped style.
        const innerGroup = html.buildGroup(group.body,
            options.havingCrampedStyle());

        // Create the line above the body
        const line = makeLineSpan("overline-line", options);

        // Generate the vlist, with the appropriate kerns
        const defaultRuleThickness = options.fontMetrics().defaultRuleThickness;
        const vlist = makeVList({
            positionType: "firstBaseline",
            children: [
                {type: "elem", elem: innerGroup},
                {type: "kern", size: 3 * defaultRuleThickness},
                {type: "elem", elem: line},
                {type: "kern", size: defaultRuleThickness},
            ],
        }, options);

        return makeSpan(["mord", "overline"], [vlist], options);
    },
    mathmlBuilder(group, options) {
        const operator = new MathNode(
            "mo", [new TextNode("\u203e")]);
        operator.setAttribute("stretchy", "true");

        const node = new MathNode(
            "mover",
            [mml.buildGroup(group.body, options), operator]);
        node.setAttribute("accent", "true");

        return node;
    },
});
;>ximport defineFunction, {ordargument} from "../defineFunction";
import defineMacro from "../defineMacro";
import {makeFragment, makeSpan} from "../buildCommon";
import {MathNode} from "../mathMLTree";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";

defineFunction({
    type: "phantom",
    names: ["\\phantom"],
    props: {
        numArgs: 1,
        allowedInText: true,
    },
    handler: ({parser}, args) => {
        const body = args[0];
        return {
            type: "phantom",
            mode: parser.mode,
            body: ordargument(body),
        };
    },
    htmlBuilder: (group, options) => {
        const elements = html.buildExpression(
            group.body,
            options.withPhantom(),
            false
        );

        // \phantom isn't supposed to affect the elements it contains.
        // See "color" for more details.
        return makeFragment(elements);
    },
    mathmlBuilder: (group, options) => {
        const inner = mml.buildExpression(group.body, options);
        return new MathNode("mphantom", inner);
    },
});

defineMacro("\\hphantom", "\\smash{\\phantom{#1}}");

defineFunction({
    type: "vphantom",
    names: ["\\vphantom"],
    props: {
        numArgs: 1,
        allowedInText: true,
    },
    handler: ({parser}, args) => {
        const body = args[0];
        return {
            type: "vphantom",
            mode: parser.mode,
            body,
        };
    },
    htmlBuilder: (group, options) => {
        const inner = makeSpan(
            ["inner"],
            [html.buildGroup(group.body, options.withPhantom())]);
        const fix = makeSpan(["fix"], []);
        return makeSpan(
            ["mord", "rlap"], [inner, fix], options);
    },
    mathmlBuilder: (group, options) => {
        const inner = mml.buildExpression(ordargument(group.body), options);
        const phantom = new MathNode("mphantom", inner);
        const node = new MathNode("mpadded", [phantom]);
        node.setAttribute("width", "0px");
        return node;
    },
});
-h/ZxVimport defineFunction, {ordargument} from "../defineFunction";
import {makeSpan} from "../buildCommon";
import {MathNode} from "../mathMLTree";
import * as html from "../buildHTML";
import * as mml from "../buildMathML";
import {binrelClass} from "./mclass";

import type {ParseNode} from "../parseNode";

// \pmb is a simulation of bold font.
// The version of \pmb in ambsy.sty works by typesetting three copies
// with small offsets. We use CSS text-shadow.
// It's a hack. Not as good as a real bold font. Better than nothing.

defineFunction({
    type: "pmb",
    names: ["\\pmb"],
    props: {
        numArgs: 1,
        allowedInText: true,
    },
    handler({parser}, args) {
        return {
            type: "pmb",
            mode: parser.mode,
            mclass: binrelClass(args[0]),
            body: ordargument(args[0]),
        };
    },
    htmlBuilder(group: ParseNode<"pmb">, options) {
        const elements = html.buildExpression(group.body, options, true);
        const node = makeSpan([group.mclass], elements, options);
        node.style.textShadow = "0.02em 0.01em 0.04px";
        return node;
    },
    mathmlBuilder(group: ParseNode<"pmb">, style) {
        const inner = mml.buildExpression(group.body, style);
        // Wrap with an <mstyle> element.
        const node = new MathNode("mstyle", inner);
        node.setAttribute("style", "text-shadow: 0.02em 0.01em 0.04px");
        return node;
    },
});

Rx,import defineFunction from "../defineFunction";
import {makeVList} from "../buildCommon";
import {MathNode} from "../mathMLTree";
import {assertNodeType} from "../parseNode";
import {calculateSize} from "../units";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";

// Box manipulation
defineFunction({
    type: "raisebox",
    names: ["\\raisebox"],
    props: {
        numArgs: 2,
        argTypes: ["size", "hbox"],
        allowedInText: true,
    },
    handler({parser}, args) {
        const amount = assertNodeType(args[0], "size").value;
        const body = args[1];
        return {
            type: "raisebox",
            mode: parser.mode,
            dy: amount,
            body,
        };
    },
    htmlBuilder(group, options) {
        const body = html.buildGroup(group.body, options);
        const dy = calculateSize(group.dy, options);
        return makeVList({
            positionType: "shift",
            positionData: -dy,
            children: [{type: "elem", elem: body}],
        }, options);
    },
    mathmlBuilder(group, options) {
        const node = new MathNode(
            "mpadded", [mml.buildGroup(group.body, options)]);
        const dy = group.dy.number + group.dy.unit;
        node.setAttribute("voffset", dy);
        return node;
    },
});
	\xRimport defineFunction from "../defineFunction";

defineFunction({
    type: "internal",
    names: ["\\relax"],
    props: {
        numArgs: 0,
        allowedInText: true,
        allowedInArgument: true,
    },
    handler({parser}) {
        return {
            type: "internal",
            mode: parser.mode,
        };
    },
});
~
`x
import {makeSpan} from "../buildCommon";
import defineFunction from "../defineFunction";
import {MathNode} from "../mathMLTree";
import {assertNodeType} from "../parseNode";
import {calculateSize, makeEm} from "../units";

defineFunction({
    type: "rule",
    names: ["\\rule"],
    props: {
        numArgs: 2,
        numOptionalArgs: 1,
        allowedInText: true,
        allowedInMath: true,
        argTypes: ["size", "size", "size"],
    },
    handler({parser}, args, optArgs) {
        const shift = optArgs[0];
        const width = assertNodeType(args[0], "size");
        const height = assertNodeType(args[1], "size");
        return {
            type: "rule",
            mode: parser.mode,
            shift: shift && assertNodeType(shift, "size").value,
            width: width.value,
            height: height.value,
        };
    },
    htmlBuilder(group, options) {
        // Make an empty span for the rule
        const rule = makeSpan(["mord", "rule"], [], options);

        // Calculate the shift, width, and height of the rule, and account for units
        const width = calculateSize(group.width, options);
        const height = calculateSize(group.height, options);
        const shift = (group.shift) ? calculateSize(group.shift, options) : 0;

        // Style the rule to the right size
        rule.style.borderRightWidth = makeEm(width);
        rule.style.borderTopWidth = makeEm(height);
        rule.style.bottom = makeEm(shift);

        // Record the height and width
        rule.width = width;
        rule.height = height + shift;
        rule.depth = -shift;
        // Font size is the number large enough that the browser will
        // reserve at least `absHeight` space above the baseline.
        // The 1.125 factor was empirically determined
        rule.maxFontSize = height * 1.125 * options.sizeMultiplier;

        return rule;
    },
    mathmlBuilder(group, options) {
        const width = calculateSize(group.width, options);
        const height = calculateSize(group.height, options);
        const shift = (group.shift) ? calculateSize(group.shift, options) : 0;
        const color = options.color && options.getColor() || "black";

        const rule = new MathNode("mspace");
        rule.setAttribute("mathbackground", color);
        rule.setAttribute("width", makeEm(width));
        rule.setAttribute("height", makeEm(height));

        const wrapper = new MathNode("mpadded", [rule]);
        if (shift >= 0) {
            wrapper.setAttribute("height", makeEm(shift));
        } else {
            wrapper.setAttribute("height", makeEm(shift));
            wrapper.setAttribute("depth", makeEm(-shift));
        }
        wrapper.setAttribute("voffset", makeEm(shift));

        return wrapper;
    },
});
X{xKimport {makeFragment} from "../buildCommon";
import defineFunction from "../defineFunction";
import {MathNode} from "../mathMLTree";
import {makeEm} from "../units";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";

import type Options from "../Options";
import type {AnyParseNode} from "../parseNode";
import type {HtmlBuilder} from "../defineFunction";
import type {documentFragment as HtmlDocumentFragment} from "../domTree";

export function sizingGroup(
    value: AnyParseNode[],
    options: Options,
    baseOptions: Options,
): HtmlDocumentFragment {
    const inner = html.buildExpression(value, options, false);
    const multiplier = options.sizeMultiplier / baseOptions.sizeMultiplier;

    // Add size-resetting classes to the inner list and set maxFontSize
    // manually. Handle nested size changes.
    for (let i = 0; i < inner.length; i++) {
        const pos = inner[i].classes.indexOf("sizing");
        if (pos < 0) {
            Array.prototype.push.apply(inner[i].classes,
                options.sizingClasses(baseOptions));
        } else if (inner[i].classes[pos + 1] === "reset-size" + options.size) {
            // This is a nested size change: e.g., inner[i] is the "b" in
            // `\Huge a \small b`. Override the old size (the `reset-` class)
            // but not the new size.
            inner[i].classes[pos + 1] = "reset-size" + baseOptions.size;
        }

        inner[i].height *= multiplier;
        inner[i].depth *= multiplier;
    }

    return makeFragment(inner);
}

const sizeFuncs = [
    "\\tiny", "\\sixptsize", "\\scriptsize", "\\footnotesize", "\\small",
    "\\normalsize", "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge",
];

export const htmlBuilder: HtmlBuilder<"sizing"> = (group, options) => {
    // Handle sizing operators like \Huge. Real TeX doesn't actually allow
    // these functions inside of math expressions, so we do some special
    // handling.
    const newOptions = options.havingSize(group.size);
    return sizingGroup(group.body, newOptions, options);
};

defineFunction({
    type: "sizing",
    names: sizeFuncs,
    props: {
        numArgs: 0,
        allowedInText: true,
    },
    handler: ({breakOnTokenText, funcName, parser}, args) => {
        const body = parser.parseExpression(false, breakOnTokenText);

        return {
            type: "sizing",
            mode: parser.mode,
            // Figure out what size to use based on the list of functions above
            size: sizeFuncs.indexOf(funcName) + 1,
            body,
        };
    },
    htmlBuilder,
    mathmlBuilder: (group, options) => {
        const newOptions = options.havingSize(group.size);
        const inner = mml.buildExpression(group.body, newOptions);

        const node = new MathNode("mstyle", inner);

        // TODO(emily): This doesn't produce the correct size for nested size
        // changes, because we don't keep state of what style we're currently
        // in, so we can't reset the size to normal before changing it.  Now
        // that we're passing an options parameter we should be able to fix
        // this.
        node.setAttribute("mathsize", makeEm(newOptions.sizeMultiplier));

        return node;
    },
});
x// smash, with optional [tb], as in AMS
import defineFunction from "../defineFunction";
import {makeSpan, makeVList} from "../buildCommon";
import {MathNode} from "../mathMLTree";
import {assertNodeType, assertSymbolNodeType} from "../parseNode";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";

defineFunction({
    type: "smash",
    names: ["\\smash"],
    props: {
        numArgs: 1,
        numOptionalArgs: 1,
        allowedInText: true,
    },
    handler: ({parser}, args, optArgs) => {
        let smashHeight = false;
        let smashDepth = false;
        const tbArg = optArgs[0] && assertNodeType(optArgs[0], "ordgroup");
        if (tbArg) {
            // Optional [tb] argument is engaged.
            // ref: amsmath: \renewcommand{\smash}[1][tb]{%
            //               def\mb@t{\ht}\def\mb@b{\dp}\def\mb@tb{\ht\z@\z@\dp}%
            let letter;
            for (let i = 0; i < tbArg.body.length; ++i) {
                const node = tbArg.body[i];
                letter = assertSymbolNodeType(node).text;
                if (letter === "t") {
                    smashHeight = true;
                } else if (letter === "b") {
                    smashDepth = true;
                } else {
                    smashHeight = false;
                    smashDepth = false;
                    break;
                }
            }
        } else {
            smashHeight = true;
            smashDepth = true;
        }

        const body = args[0];
        return {
            type: "smash",
            mode: parser.mode,
            body,
            smashHeight,
            smashDepth,
        };
    },
    htmlBuilder: (group, options) => {
        const node = makeSpan(
            [], [html.buildGroup(group.body, options)]);

        if (!group.smashHeight && !group.smashDepth) {
            return node;
        }

        if (group.smashHeight) {
            node.height = 0;
        }

        if (group.smashDepth) {
            node.depth = 0;
        }

        if (group.smashHeight && group.smashDepth) {
            // Symmetric \smash can stay in inline layout.
            return makeSpan(["mord", "smash"], [node], options);
        }

        // In order to influence makeVList for asymmetric smashing, we have to
        // reset the children.
        if (node.children) {
            for (let i = 0; i < node.children.length; i++) {
                if (group.smashHeight) {
                    node.children[i].height = 0;
                }
                if (group.smashDepth) {
                    node.children[i].depth = 0;
                }
            }
        }

        // At this point, we've reset the TeX-like height and depth values.
        // But the span still has an HTML line height.
        // makeVList applies "display: table-cell", which prevents the browser
        // from acting on that line height. So we'll call makeVList now.

        const smashedNode = makeVList({
            positionType: "firstBaseline",
            children: [{type: "elem", elem: node}],
        }, options);

        // For spacing, TeX treats \smash as a math group (same spacing as ord).
        return makeSpan(["mord"], [smashedNode], options);
    },
    mathmlBuilder: (group, options) => {
        const node = new MathNode(
            "mpadded", [mml.buildGroup(group.body, options)]);

        if (group.smashHeight) {
            node.setAttribute("height", "0px");
        }

        if (group.smashDepth) {
            node.setAttribute("depth", "0px");
        }

        return node;
    },
});
θx'import defineFunction from "../defineFunction";
import {makeSpan, makeVList, wrapFragment} from "../buildCommon";
import {MathNode} from "../mathMLTree";
import {makeSqrtImage} from "../delimiter";
import Style from "../Style";
import {makeEm} from "../units";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";

defineFunction({
    type: "sqrt",
    names: ["\\sqrt"],
    props: {
        numArgs: 1,
        numOptionalArgs: 1,
    },
    handler({parser}, args, optArgs) {
        const index = optArgs[0];
        const body = args[0];
        return {
            type: "sqrt",
            mode: parser.mode,
            body,
            index,
        };
    },
    htmlBuilder(group, options) {
        // Square roots are handled in the TeXbook pg. 443, Rule 11.

        // First, we do the same steps as in overline to build the inner group
        // and line
        let inner = html.buildGroup(group.body, options.havingCrampedStyle());
        if (inner.height === 0) {
            // Render a small surd.
            inner.height = options.fontMetrics().xHeight;
        }

        // Some groups can return document fragments.  Handle those by wrapping
        // them in a span.
        inner = wrapFragment(inner, options);

        // Calculate the minimum size for the \surd delimiter
        const metrics = options.fontMetrics();
        const theta = metrics.defaultRuleThickness;

        let phi = theta;
        if (options.style.id < Style.TEXT.id) {
            phi = options.fontMetrics().xHeight;
        }

        // Calculate the clearance between the body and line
        let lineClearance = theta + phi / 4;

        const minDelimiterHeight = (inner.height + inner.depth +
            lineClearance + theta);

        // Create a sqrt SVG of the required minimum size
        const {span: img, ruleWidth, advanceWidth} =
            makeSqrtImage(minDelimiterHeight, options);

        const delimDepth = img.height - ruleWidth;

        // Adjust the clearance based on the delimiter size
        if (delimDepth > inner.height + inner.depth + lineClearance) {
            lineClearance =
                (lineClearance + delimDepth - inner.height - inner.depth) / 2;
        }

        // Shift the sqrt image
        const imgShift = img.height - inner.height - lineClearance - ruleWidth;

        inner.style.paddingLeft = makeEm(advanceWidth);

        // Overlay the image and the argument.
        const body = makeVList({
            positionType: "firstBaseline",
            children: [
                {type: "elem", elem: inner, wrapperClasses: ["svg-align"]},
                {type: "kern", size: -(inner.height + imgShift)},
                {type: "elem", elem: img},
                {type: "kern", size: ruleWidth},
            ],
        }, options);

        if (!group.index) {
            return makeSpan(["mord", "sqrt"], [body], options);
        } else {
            // Handle the optional root index

            // The index is always in scriptscript style
            const newOptions = options.havingStyle(Style.SCRIPTSCRIPT);
            const rootm = html.buildGroup(group.index, newOptions, options);

            // The amount the index is shifted by. This is taken from the TeX
            // source, in the definition of `\r@@t`.
            const toShift = 0.6 * (body.height - body.depth);

            // Build a VList with the superscript shifted up correctly
            const rootVList = makeVList({
                positionType: "shift",
                positionData: -toShift,
                children: [{type: "elem", elem: rootm}],
            }, options);
            // Add a class surrounding it so we can add on the appropriate
            // kerning
            const rootVListWrap = makeSpan(["root"], [rootVList]);

            return makeSpan(["mord", "sqrt"],
                [rootVListWrap, body], options);
        }
    },
    mathmlBuilder(group, options) {
        const {body, index} = group;
        return index ?
            new MathNode(
                "mroot", [
                    mml.buildGroup(body, options),
                    mml.buildGroup(index, options),
                ]) :
            new MathNode(
                "msqrt", [mml.buildGroup(body, options)]);
    },
});
rxJ
import defineFunction from "../defineFunction";
import {MathNode} from "../mathMLTree";
import Style from "../Style";
import {sizingGroup} from "./sizing";

import * as mml from "../buildMathML";
import type {StyleStr} from "../types";

const styleMap: Record<StyleStr, typeof Style.DISPLAY> = {
    "display": Style.DISPLAY,
    "text": Style.TEXT,
    "script": Style.SCRIPT,
    "scriptscript": Style.SCRIPTSCRIPT,
};

function isStyleStr(s: string): s is StyleStr {
    return s in styleMap;
}

defineFunction({
    type: "styling",
    names: [
        "\\displaystyle", "\\textstyle", "\\scriptstyle",
        "\\scriptscriptstyle",
    ],
    props: {
        numArgs: 0,
        allowedInText: true,
        primitive: true,
    },
    handler({breakOnTokenText, funcName, parser}, args) {
        // parse out the implicit body
        const body = parser.parseExpression(true, breakOnTokenText);

        // TODO: Refactor to avoid duplicating styleMap in multiple places (e.g.
        // here and in buildHTML and de-dupe the enumeration of all the styles).
        const style = funcName.slice(1, funcName.length - 5);
        if (!isStyleStr(style)) {
            throw new Error(`Unknown style: ${style}`);
        }
        return {
            type: "styling",
            mode: parser.mode,
            // Figure out what style to use by pulling out the style from
            // the function name
            style,
            body,
        };
    },
    htmlBuilder(group, options) {
        // Style changes are handled in the TeXbook on pg. 442, Rule 3.
        const newStyle = styleMap[group.style];
        let newOptions = options.havingStyle(newStyle);
        if (group.resetFont) {
            newOptions = newOptions.withFont('');
        }
        return sizingGroup(group.body, newOptions, options);
    },
    mathmlBuilder(group, options) {
        // Figure out what style we're changing to.
        const newStyle = styleMap[group.style];
        let newOptions = options.havingStyle(newStyle);
        if (group.resetFont) {
            newOptions = newOptions.withFont('');
        }

        const inner = mml.buildExpression(group.body, newOptions);

        const node = new MathNode("mstyle", inner);

        const styleAttributes = {
            "display": ["0", "true"],
            "text": ["0", "false"],
            "script": ["1", "false"],
            "scriptscript": ["2", "false"],
        };

        const attr = styleAttributes[group.style];

        node.setAttribute("scriptlevel", attr[0]);
        node.setAttribute("displaystyle", attr[1]);

        return node;
    },
});
;a xp'import {defineFunctionBuilders} from "../defineFunction";
import {makeSpan, makeVList} from "../buildCommon";
import {Span, SymbolNode, type HtmlDomNode} from "../domTree";
import {isCharacterBox} from "../utils";
import {MathNode} from "../mathMLTree";
import {makeEm} from "../units";
import Style from "../Style";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";
import * as accent from "./accent";
import * as horizBrace from "./horizBrace";
import * as op from "./op";
import * as operatorname from "./operatorname";

import type Options from "../Options";
import type {ParseNode} from "../parseNode";
import type {HtmlBuilder} from "../defineFunction";
import type {MathNodeType} from "../mathMLTree";

/**
 * Sometimes, groups perform special rules when they have superscripts or
 * subscripts attached to them. This function lets the `supsub` group know that
 * Sometimes, groups perform special rules when they have superscripts or
 * its inner element should handle the superscripts and subscripts instead of
 * handling them itself.
 */
const htmlBuilderDelegate = function(
    group: ParseNode<"supsub">,
    options: Options,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
): HtmlBuilder<any> | null | undefined {
    const base = group.base;
    if (!base) {
        return null;
    } else if (base.type === "op") {
        // Operators handle supsubs differently when they have limits
        // (e.g. `\displaystyle\sum_2^3`)
        const delegate = base.limits &&
            (options.style.size === Style.DISPLAY.size ||
            base.alwaysHandleSupSub);
        return delegate ? op.htmlBuilder : null;
    } else if (base.type === "operatorname") {
        const delegate = base.alwaysHandleSupSub &&
            (options.style.size === Style.DISPLAY.size || base.limits);
        return delegate ? operatorname.htmlBuilder : null;
    } else if (base.type === "accent") {
        return isCharacterBox(base.base) ? accent.htmlBuilder : null;
    } else if (base.type === "horizBrace") {
        const isSup = !group.sub;
        return isSup === base.isOver ? horizBrace.htmlBuilder : null;
    } else {
        return null;
    }
};

// Super scripts and subscripts, whose precise placement can depend on other
// functions that precede them.
defineFunctionBuilders({
    type: "supsub",
    htmlBuilder(group, options) {
        // Superscript and subscripts are handled in the TeXbook on page
        // 445-446, rules 18(a-f).

        // Here is where we defer to the inner group if it should handle
        // superscripts and subscripts itself.
        const builderDelegate = htmlBuilderDelegate(group, options);
        if (builderDelegate) {
            return builderDelegate(group, options);
        }

        const {base: valueBase, sup: valueSup, sub: valueSub} = group;
        const base = html.buildGroup(valueBase, options);
        let supm;
        let subm;

        const metrics = options.fontMetrics();

        // Rule 18a
        let supShift = 0;
        let subShift = 0;

        const isCharBox = valueBase && isCharacterBox(valueBase);
        if (valueSup) {
            const newOptions = options.havingStyle(options.style.sup());
            supm = html.buildGroup(valueSup, newOptions, options);
            if (!isCharBox) {
                supShift = base.height - newOptions.fontMetrics().supDrop
                    * newOptions.sizeMultiplier / options.sizeMultiplier;
            }
        }

        if (valueSub) {
            const newOptions = options.havingStyle(options.style.sub());
            subm = html.buildGroup(valueSub, newOptions, options);
            if (!isCharBox) {
                subShift = base.depth + newOptions.fontMetrics().subDrop
                    * newOptions.sizeMultiplier / options.sizeMultiplier;
            }
        }

        // Rule 18c
        let minSupShift;
        if (options.style === Style.DISPLAY) {
            minSupShift = metrics.sup1;
        } else if (options.style.cramped) {
            minSupShift = metrics.sup3;
        } else {
            minSupShift = metrics.sup2;
        }

        // scriptspace is a font-size-independent size, so scale it
        // appropriately for use as the marginRight.
        const multiplier = options.sizeMultiplier;
        const marginRight = makeEm((0.5 / metrics.ptPerEm) / multiplier);

        let marginLeft = null;
        if (subm) {
            // Subscripts shouldn't be shifted by the base's italic correction.
            // Account for that by shifting the subscript back the appropriate
            // amount. Note we only do this when the base is a single symbol.
            const isOiint =
                group.base && group.base.type === "op" && group.base.name &&
                (group.base.name === "\\oiint" || group.base.name === "\\oiiint");
            if (base instanceof SymbolNode || isOiint) {
                // SymbolNode has .italic natively; for \oiint/\oiiint the
                // op builder stores .italic on the wrapping Span.
                marginLeft = makeEm(
                    -((base as SymbolNode | Span<HtmlDomNode>).italic ?? 0));
            }
        }

        let supsub;
        if (supm && subm) {
            supShift = Math.max(
                supShift, minSupShift, supm.depth + 0.25 * metrics.xHeight);
            subShift = Math.max(subShift, metrics.sub2);

            const ruleWidth = metrics.defaultRuleThickness;

            // Rule 18e
            const maxWidth = 4 * ruleWidth;
            if ((supShift - supm.depth) - (subm.height - subShift) < maxWidth) {
                subShift = maxWidth - (supShift - supm.depth) + subm.height;
                const psi = 0.8 * metrics.xHeight - (supShift - supm.depth);
                if (psi > 0) {
                    supShift += psi;
                    subShift -= psi;
                }
            }

            const vlistElem = [
                {type: "elem" as const, elem: subm, shift: subShift, marginRight,
                    marginLeft},
                {type: "elem" as const, elem: supm, shift: -supShift, marginRight},
            ];

            supsub = makeVList({
                positionType: "individualShift",
                children: vlistElem,
            }, options);
        } else if (subm) {
            // Rule 18b
            subShift = Math.max(
                subShift, metrics.sub1,
                subm.height - 0.8 * metrics.xHeight);

            const vlistElem =
                [{type: "elem" as const, elem: subm, marginLeft, marginRight}];

            supsub = makeVList({
                positionType: "shift",
                positionData: subShift,
                children: vlistElem,
            }, options);
        } else if (supm) {
            // Rule 18c, d
            supShift = Math.max(supShift, minSupShift,
                supm.depth + 0.25 * metrics.xHeight);

            supsub = makeVList({
                positionType: "shift",
                positionData: -supShift,
                children: [{type: "elem" as const, elem: supm, marginRight}],
            }, options);
        } else {
            throw new Error("supsub must have either sup or sub.");
        }

        // Wrap the supsub vlist in a span.msupsub to reset text-align.
        const mclass = html.getTypeOfDomTree(base, "right") || "mord";
        return makeSpan([mclass],
            [base, makeSpan(["msupsub"], [supsub])],
            options);
    },
    mathmlBuilder(group, options) {
        // Is the inner group a relevant horizontal brace?
        let isBrace = false;
        let isOver;
        let isSup;

        if (group.base && group.base.type === "horizBrace") {
            isSup = !!group.sup;
            if (isSup === group.base.isOver) {
                isBrace = true;
                isOver = group.base.isOver;
            }
        }

        if (group.base &&
            (group.base.type === "op" || group.base.type === "operatorname")) {
            group.base.parentIsSupSub = true;
        }

        const children = [mml.buildGroup(group.base, options)];

        if (group.sub) {
            children.push(mml.buildGroup(group.sub, options));
        }

        if (group.sup) {
            children.push(mml.buildGroup(group.sup, options));
        }

        let nodeType: MathNodeType;
        if (isBrace) {
            nodeType = (isOver ? "mover" : "munder");
        } else if (!group.sub) {
            const base = group.base;
            if (base && base.type === "op" && base.limits &&
                (options.style === Style.DISPLAY || base.alwaysHandleSupSub)) {
                nodeType = "mover";
            } else if (base && base.type === "operatorname" &&
                base.alwaysHandleSupSub &&
                (base.limits || options.style === Style.DISPLAY)) {
                nodeType = "mover";
            } else {
                nodeType = "msup";
            }
        } else if (!group.sup) {
            const base = group.base;
            if (base && base.type === "op" && base.limits &&
                (options.style === Style.DISPLAY || base.alwaysHandleSupSub)) {
                nodeType = "munder";
            } else if (base && base.type === "operatorname" &&
                base.alwaysHandleSupSub &&
                (base.limits || options.style === Style.DISPLAY)) {
                nodeType = "munder";
            } else {
                nodeType = "msub";
            }
        } else {
            const base = group.base;
            if (base && base.type === "op" && base.limits &&
                options.style === Style.DISPLAY) {
                nodeType = "munderover";
            } else if (base && base.type === "operatorname" &&
                base.alwaysHandleSupSub &&
                (options.style === Style.DISPLAY || base.limits)) {
                nodeType = "munderover";
            } else {
                nodeType = "msubsup";
            }
        }

        return new MathNode(nodeType, children);
    },
});
m;Ixmimport {defineFunctionBuilders} from "../defineFunction";
import {mathsym} from "../buildCommon";
import {MathNode} from "../mathMLTree";

import * as mml from "../buildMathML";

// Operator ParseNodes created in Parser.js from symbol Groups in src/symbols.js.

defineFunctionBuilders({
    type: "atom",
    htmlBuilder(group, options) {
        return mathsym(
            group.text, group.mode, options, ["m" + group.family]);
    },
    mathmlBuilder(group, options) {
        const node = new MathNode(
            "mo", [mml.makeText(group.text, group.mode)]);
        if (group.family === "bin") {
            const variant = mml.getVariant(group, options);
            if (variant === "bold-italic") {
                node.setAttribute("mathvariant", variant);
            }
        } else if (group.family === "punct") {
            node.setAttribute("separator", "true");
        } else if (group.family === "open" || group.family === "close") {
            // Delims built here should not stretch vertically.
            // See delimsizing.js for stretchy delims.
            node.setAttribute("stretchy", "false");
        }
        return node;
    },
});
$grx import {defineFunctionBuilders} from "../defineFunction";
import {makeOrd} from "../buildCommon";
import {MathNode} from "../mathMLTree";

import * as mml from "../buildMathML";

import type {ParseNode} from "../parseNode";

// "mathord" and "textord" ParseNodes created in Parser.js from symbol Groups in
// src/symbols.js.

const defaultVariant: Record<string, string> = {
    "mi": "italic",
    "mn": "normal",
    "mtext": "normal",
};

defineFunctionBuilders({
    type: "mathord",
    htmlBuilder(group, options) {
        return makeOrd(group, options, "mathord");
    },
    mathmlBuilder(group: ParseNode<"mathord">, options) {
        const node = new MathNode(
            "mi",
            [mml.makeText(group.text, group.mode, options)]);

        const variant = mml.getVariant(group, options) || "italic";
        if (variant !== defaultVariant[node.type]) {
            node.setAttribute("mathvariant", variant);
        }
        return node;
    },
});

defineFunctionBuilders({
    type: "textord",
    htmlBuilder(group, options) {
        return makeOrd(group, options, "textord");
    },
    mathmlBuilder(group: ParseNode<"textord">, options) {
        const text = mml.makeText(group.text, group.mode, options);
        const variant = mml.getVariant(group, options) || "normal";

        let node;
        if (group.mode === 'text') {
            node = new MathNode("mtext", [text]);
        } else if (/[0-9]/.test(group.text)) {
            node = new MathNode("mn", [text]);
        } else if (group.text === "\\prime") {
            node = new MathNode("mo", [text]);
        } else {
            node = new MathNode("mi", [text]);
        }
        if (variant !== defaultVariant[node.type]) {
            node.setAttribute("mathvariant", variant);
        }

        return node;
    },
});
P/xK
import {defineFunctionBuilders} from "../defineFunction";
import {mathsym, makeOrd, makeSpan} from "../buildCommon";
import {MathNode, TextNode} from "../mathMLTree";
import ParseError from "../ParseError";

// A map of CSS-based spacing functions to their CSS class.
const cssSpace: Record<string, string> = {
    "\\nobreak": "nobreak",
    "\\allowbreak": "allowbreak",
};

// A lookup table to determine whether a spacing function/symbol should be
// treated like a regular space character.  If a symbol or command is a key
// in this table, then it should be a regular space character.  Furthermore,
// the associated value may have a `className` specifying an extra CSS class
// to add to the created `span`.
const regularSpace: Record<string, {className?: string}> = {
    " ": {},
    "\\ ": {},
    "~": {
        className: "nobreak",
    },
    "\\space": {},
    "\\nobreakspace": {
        className: "nobreak",
    },
};

// ParseNode<"spacing"> created in Parser.js from the "spacing" symbol Groups in
// src/symbols.js.
defineFunctionBuilders({
    type: "spacing",
    htmlBuilder(group, options) {
        if (regularSpace.hasOwnProperty(group.text)) {
            const className = regularSpace[group.text].className || "";
            // Spaces are generated by adding an actual space. Each of these
            // things has an entry in the symbols table, so these will be turned
            // into appropriate outputs.
            if (group.mode === "text") {
                const ord = makeOrd(group, options, "textord");
                ord.classes.push(className);
                return ord;
            } else {
                return makeSpan(["mspace", className],
                    [mathsym(group.text, group.mode, options)],
                    options);
            }
        } else if (cssSpace.hasOwnProperty(group.text)) {
            // Spaces based on just a CSS class.
            return makeSpan(
                ["mspace", cssSpace[group.text]],
                [], options);
        } else {
            throw new ParseError(`Unknown type of space "${group.text}"`);
        }
    },
    mathmlBuilder(group, options) {
        let node;

        if (regularSpace.hasOwnProperty(group.text)) {
            node = new MathNode(
                "mtext", [new TextNode("\u00a0")]);
        } else if (cssSpace.hasOwnProperty(group.text)) {
            // CSS-based MathML spaces (\nobreak, \allowbreak) are ignored
            return new MathNode("mspace");
        } else {
            throw new ParseError(`Unknown type of space "${group.text}"`);
        }

        return node;
    },
});
7$
Px	import {defineFunctionBuilders} from "../defineFunction";
import {MathNode} from "../mathMLTree";

import * as mml from "../buildMathML";

const pad = () => {
    const padNode = new MathNode("mtd", []);
    padNode.setAttribute("width", "50%");
    return padNode;
};

defineFunctionBuilders({
    type: "tag",
    mathmlBuilder(group, options) {
        const table = new MathNode("mtable", [
            new MathNode("mtr", [
                pad(),
                new MathNode("mtd", [
                    mml.buildExpressionRow(group.body, options),
                ]),
                pad(),
                new MathNode("mtd", [
                    mml.buildExpressionRow(group.tag, options),
                ]),
            ]),
        ]);
        table.setAttribute("width", "100%");
        return table;

        // TODO: Left-aligned tags.
        // Currently, the group and options passed here do not contain
        // enough info to set tag alignment. `leqno` is in Settings but it is
        // not passed to Options. On the HTML side, leqno is
        // set by a CSS class applied in buildTree.js. That would have worked
        // in MathML if browsers supported <mlabeledtr>. Since they don't, we
        // need to rewrite the way this function is called.
    },
});
vx	import defineFunction, {ordargument} from "../defineFunction";
import type {TextFont} from "../types/fonts";
import {makeSpan} from "../buildCommon";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";
import type Options from "../Options";
import type {ParseNode} from "../parseNode";

// Non-mathy text, possibly in a font
const textFontFamilies: Record<string, TextFont | undefined> = {
    "\\text": undefined,
    "\\textrm": "textrm",
    "\\textsf": "textsf",
    "\\texttt": "texttt",
    "\\textnormal": "textrm",
};

const textFontWeights: Record<string, "textbf" | "textmd"> = {
    "\\textbf": "textbf",
    "\\textmd": "textmd",
};

const textFontShapes: Record<string, "textit" | "textup"> = {
    "\\textit": "textit",
    "\\textup": "textup",
};

const optionsWithFont = (group: ParseNode<"text">, options: Options): Options => {
    const font = group.font;
    // Checks if the argument is a font family or a font style.
    if (!font) {
        return options;
    } else if (textFontFamilies[font]) {
        return options.withTextFontFamily(textFontFamilies[font]);
    } else if (textFontWeights[font]) {
        return options.withTextFontWeight(textFontWeights[font]);
    } else if (font === "\\emph") {
        return options.fontShape === "textit" ?
            options.withTextFontShape("textup") :
            options.withTextFontShape("textit");
    }

    return options.withTextFontShape(textFontShapes[font] as "textit" | "textup");
};

defineFunction({
    type: "text",
    names: [
        // Font families
        "\\text", "\\textrm", "\\textsf", "\\texttt", "\\textnormal",
        // Font weights
        "\\textbf", "\\textmd",
        // Font Shapes
        "\\textit", "\\textup", "\\emph",
    ],
    props: {
        numArgs: 1,
        argTypes: ["text"],
        allowedInArgument: true,
        allowedInText: true,
    },
    handler({parser, funcName}, args) {
        const body = args[0];
        return {
            type: "text",
            mode: parser.mode,
            body: ordargument(body),
            font: funcName,
        };
    },
    htmlBuilder(group, options) {
        const newOptions = optionsWithFont(group, options);
        const inner = html.buildExpression(group.body, newOptions, true);
        return makeSpan(["mord", "text"], inner, newOptions);
    },
    mathmlBuilder(group, options) {
        const newOptions = optionsWithFont(group, options);
        return mml.buildExpressionRow(group.body, newOptions);
    },
});
&Vx	undund+/    allowedInText: trueT/und8	: args[0]AUnd:010.m!82 options);

        // Create the line to go below(-undW1top",
            positionData: innerGroup.heightF2##E@F;undunddunder-Rx- 100644 assembleSupSub.ts U#DL[DM><R4Rx%import {makeSpan, makeVList} from "../../buildCommon";
import * as html from "../../buildHTML";
import {isCharacterBox} from "../../utils";
import type {StyleInterface} from "../../Style";
import type Options from "../../Options";
import type {DomSpan, SymbolNode} from "../../domTree";
import type {AnyParseNode} from "../../parseNode";
import {makeEm} from "../../units";

// For an operator with limits, assemble the base, sup, and sub into a span.

export const assembleSupSub = (
    base: DomSpan | SymbolNode,
    supGroup: AnyParseNode | null | undefined,
    subGroup: AnyParseNode | null | undefined,
    options: Options,
    style: StyleInterface,
    slant: number,
    baseShift: number,
): DomSpan => {
    base = makeSpan([], [base]);
    const subIsSingleCharacter = subGroup &&  isCharacterBox(subGroup);
    let sub;
    let sup;
    // We manually have to handle the superscripts and subscripts. This,
    // aside from the kern calculations, is copied from supsub.
    if (supGroup) {
        const elem = html.buildGroup(
            supGroup, options.havingStyle(style.sup()), options);

        sup = {
            elem,
            kern: Math.max(
                options.fontMetrics().bigOpSpacing1,
                options.fontMetrics().bigOpSpacing3 - elem.depth),
        };
    }

    if (subGroup) {
        const elem = html.buildGroup(
            subGroup, options.havingStyle(style.sub()), options);

        sub = {
            elem,
            kern: Math.max(
                options.fontMetrics().bigOpSpacing2,
                options.fontMetrics().bigOpSpacing4 - elem.height),
        };
    }

    // Build the final group as a vlist of the possible subscript, base,
    // and possible superscript.
    let finalGroup;
    if (sup && sub) {
        const bottom = options.fontMetrics().bigOpSpacing5 +
            sub.elem.height + sub.elem.depth +
            sub.kern +
            base.depth + baseShift;

        finalGroup = makeVList({
            positionType: "bottom",
            positionData: bottom,
            children: [
                {type: "kern", size: options.fontMetrics().bigOpSpacing5},
                {type: "elem", elem: sub.elem, marginLeft: makeEm(-slant)},
                {type: "kern", size: sub.kern},
                {type: "elem", elem: base},
                {type: "kern", size: sup.kern},
                {type: "elem", elem: sup.elem, marginLeft: makeEm(slant)},
                {type: "kern", size: options.fontMetrics().bigOpSpacing5},
            ],
        }, options);
    } else if (sub) {
        const top = base.height - baseShift;

        // Shift the limits by the slant of the symbol. Note
        // that we are supposed to shift the limits by 1/2 of the slant,
        // but since we are centering the limits adding a full slant of
        // margin will shift by 1/2 that.
        finalGroup = makeVList({
            positionType: "top",
            positionData: top,
            children: [
                {type: "kern", size: options.fontMetrics().bigOpSpacing5},
                {type: "elem", elem: sub.elem, marginLeft: makeEm(-slant)},
                {type: "kern", size: sub.kern},
                {type: "elem", elem: base},
            ],
        }, options);
    } else if (sup) {
        const bottom = base.depth + baseShift;

        finalGroup = makeVList({
            positionType: "bottom",
            positionData: bottom,
            children: [
                {type: "elem", elem: base},
                {type: "kern", size: sup.kern},
                {type: "elem", elem: sup.elem, marginLeft: makeEm(slant)},
                {type: "kern", size: options.fontMetrics().bigOpSpacing5},
            ],
        }, options);
    } else {
        // This case probably shouldn't occur (this would mean the
        // supsub was sending us a group with no superscript or
        // subscript) but be safe.
        return base;
    }

    const parts = [finalGroup];
    if (sub && slant !== 0 && !subIsSingleCharacter) {
        // A negative margin-left was applied to the lower limit.
        // Avoid an overlap by placing a spacer on the left on the group.
        const spacer = makeSpan(["mspace"], [], options);
        spacer.style.marginRight = makeEm(slant);
        parts.unshift(spacer);
    }
    return makeSpan(["mop", "op-limits"], parts, options);
};
cA^ximport defineFunction from "../defineFunction";
import {makeVList} from "../buildCommon";
import {MathNode} from "../mathMLTree";

import * as html from "../buildHTML";
import * as mml from "../buildMathML";

// \vcenter:  Vertically center the argument group on the math axis.

defineFunction({
    type: "vcenter",
    names: ["\\vcenter"],
    props: {
        numArgs: 1,
        argTypes: ["original"], // In LaTeX, \vcenter can act only on a box.
        allowedInText: false,
    },
    handler({parser}, args) {
        return {
            type: "vcenter",
            mode: parser.mode,
            body: args[0],
        };
    },
    htmlBuilder(group, options) {
        const body = html.buildGroup(group.body, options);
        const axisHeight = options.fontMetrics().axisHeight;
        const dy = 0.5 * ((body.height - axisHeight) - (body.depth + axisHeight));
        return makeVList({
            positionType: "shift",
            positionData: dy,
            children: [{type: "elem", elem: body}],
        }, options);
    },
    mathmlBuilder(group, options) {
        // There is no way to do this in MathML.
        // Write a class as a breadcrumb in case some post-processor wants
        // to perform a vcenter adjustment.
        // Wrap in mrow to ensure valid MathML when placed inside mo (e.g., \mathrel)
        const mpadded = new MathNode(
            "mpadded", [mml.buildGroup(group.body, options)], ["vcenter"]);
        return new MathNode("mrow", [mpadded]);
    },
});
pp̈́~ximport defineFunction from "../defineFunction";
import {makeSpan, makeSymbol, tryCombineChars} from "../buildCommon";
import {MathNode, TextNode} from "../mathMLTree";
import ParseError from "../ParseError";

import type {ParseNode} from "../parseNode";

defineFunction({
    type: "verb",
    names: ["\\verb"],
    props: {
        numArgs: 0,
        allowedInText: true,
    },
    handler(context, args, optArgs) {
        // \verb and \verb* are dealt with directly in Parser.js.
        // If we end up here, it's because of a failure to match the two delimiters
        // in the regex in Lexer.js.  LaTeX raises the following error when \verb is
        // terminated by end of line (or file).
        throw new ParseError(
            "\\verb ended by end of line instead of matching delimiter");
    },
    htmlBuilder(group, options) {
        const text = makeVerb(group);
        const body = [];
        // \verb enters text mode and therefore is sized like \textstyle
        const newOptions = options.havingStyle(options.style.text());
        for (let i = 0; i < text.length; i++) {
            let c = text[i];
            if (c === '~') {
                c = '\\textasciitilde';
            }
            body.push(makeSymbol(c, "Typewriter-Regular",
                group.mode, newOptions, ["mord", "texttt"]));
        }
        return makeSpan(
            ["mord", "text"].concat(newOptions.sizingClasses(options)),
            tryCombineChars(body),
            newOptions,
        );
    },
    mathmlBuilder(group, options) {
        const text = new TextNode(makeVerb(group));
        const node = new MathNode("mtext", [text]);
        node.setAttribute("mathvariant", "monospace");
        return node;
    },
});

/**
 * Converts verb group into body string.
 *
 * \verb* replaces each space with an open box \u2423
 * \verb replaces each space with a no-break space \xA0
 */
const makeVerb = (group: ParseNode<"verb">): string =>
    group.body.replace(/ /g, group.star ? '\u2423' : '\xA0');
j_xx^/**
 * Predefined macros for KaTeX.
 * This can be used to define some commands in terms of others.
 */

// Export global macros object from defineMacro
import defineMacro, {_macros} from "./defineMacro";
const macros = _macros;
export default macros;

import fontMetricsData from "./fontMetricsData";
import functions from "./functions";
import symbols from "./symbols";
import {makeEm} from "./units";
import ParseError from "./ParseError";

import type {MacroContextInterface} from "./defineMacro";

//////////////////////////////////////////////////////////////////////
// macro tools

defineMacro("\\noexpand", function(context) {
    // The expansion is the token itself; but that token is interpreted
    // as if its meaning were ‘\relax’ if it is a control sequence that
    // would ordinarily be expanded by TeX’s expansion rules.
    const t = context.popToken();
    if (context.isExpandable(t.text)) {
        t.noexpand = true;
        t.treatAsRelax = true;
    }
    return {tokens: [t], numArgs: 0};
});

defineMacro("\\expandafter", function(context) {
    // TeX first reads the token that comes immediately after \expandafter,
    // without expanding it; let’s call this token t. Then TeX reads the
    // token that comes after t (and possibly more tokens, if that token
    // has an argument), replacing it by its expansion. Finally TeX puts
    // t back in front of that expansion.
    const t = context.popToken();
    context.expandOnce(true); // expand only an expandable token
    return {tokens: [t], numArgs: 0};
});

// LaTeX's \@firstoftwo{#1}{#2} expands to #1, skipping #2
// TeX source: \long\def\@firstoftwo#1#2{#1}
defineMacro("\\@firstoftwo", function(context) {
    const args = context.consumeArgs(2);
    return {tokens: args[0], numArgs: 0};
});

// LaTeX's \@secondoftwo{#1}{#2} expands to #2, skipping #1
// TeX source: \long\def\@secondoftwo#1#2{#2}
defineMacro("\\@secondoftwo", function(context) {
    const args = context.consumeArgs(2);
    return {tokens: args[1], numArgs: 0};
});

// LaTeX's \@ifnextchar{#1}{#2}{#3} looks ahead to the next (unexpanded)
// symbol that isn't a space, consuming any spaces but not consuming the
// first nonspace character.  If that nonspace character matches #1, then
// the macro expands to #2; otherwise, it expands to #3.
defineMacro("\\@ifnextchar", function(context) {
    const args = context.consumeArgs(3);  // symbol, if, else
    context.consumeSpaces();
    const nextToken = context.future();
    if (args[0].length === 1 && args[0][0].text === nextToken.text) {
        return {tokens: args[1], numArgs: 0};
    } else {
        return {tokens: args[2], numArgs: 0};
    }
});

// LaTeX's \@ifstar{#1}{#2} looks ahead to the next (unexpanded) symbol.
// If it is `*`, then it consumes the symbol, and the macro expands to #1;
// otherwise, the macro expands to #2 (without consuming the symbol).
// TeX source: \def\@ifstar#1{\@ifnextchar *{\@firstoftwo{#1}}}
defineMacro("\\@ifstar", "\\@ifnextchar *{\\@firstoftwo{#1}}");

// LaTeX's \TextOrMath{#1}{#2} expands to #1 in text mode, #2 in math mode
defineMacro("\\TextOrMath", function(context) {
    const args = context.consumeArgs(2);
    if (context.mode === 'text') {
        return {tokens: args[0], numArgs: 0};
    } else {
        return {tokens: args[1], numArgs: 0};
    }
});

// Lookup table for parsing numbers in base 8 through 16
const digitToNumber: Record<string, number> = {
    "0": 0, "1": 1, "2": 2, "3": 3, "4": 4, "5": 5, "6": 6, "7": 7, "8": 8,
    "9": 9, "a": 10, "A": 10, "b": 11, "B": 11, "c": 12, "C": 12,
    "d": 13, "D": 13, "e": 14, "E": 14, "f": 15, "F": 15,
};

// TeX \char makes a literal character (catcode 12) using the following forms:
// (see The TeXBook, p. 43)
//   \char123  -- decimal
//   \char'123 -- octal
//   \char"123 -- hex
//   \char`x   -- character that can be written (i.e. isn't active)
//   \char`\x  -- character that cannot be written (e.g. %)
// These all refer to characters from the font, so we turn them into special
// calls to a function \@char dealt with in the Parser.
defineMacro("\\char", function(context) {
    let token = context.popToken();
    let base;
    let number = 0;
    if (token.text === "'") {
        base = 8;
        token = context.popToken();
    } else if (token.text === '"') {
        base = 16;
        token = context.popToken();
    } else if (token.text === "`") {
        token = context.popToken();
        if (token.text[0] === "\\") {
            number = token.text.charCodeAt(1);
        } else if (token.text === "EOF") {
            throw new ParseError("\\char` missing argument");
        } else {
            number = token.text.charCodeAt(0);
        }
    } else {
        base = 10;
    }
    if (base) {
        // Parse a number in the given base, starting with first `token`.
        number = digitToNumber[token.text];
        if (number == null || number >= base) {
            throw new ParseError(`Invalid base-${base} digit ${token.text}`);
        }
        let digit;
        while ((digit = digitToNumber[context.future().text]) != null &&
               digit < base) {
            number *= base;
            number += digit;
            context.popToken();
        }
    }
    return `\\@char{${number}}`;
});

// \newcommand{\macro}[args]{definition}
// \renewcommand{\macro}[args]{definition}
// TODO: Optional arguments: \newcommand{\macro}[args][default]{definition}
const newcommand = (
    context: MacroContextInterface,
    existsOK: boolean,
    nonexistsOK: boolean,
    skipIfExists: boolean,
) => {
    let arg = context.consumeArg().tokens;
    if (arg.length !== 1) {
        throw new ParseError(
            "\\newcommand's first argument must be a macro name");
    }
    const name = arg[0].text;

    const exists = context.isDefined(name);
    if (exists && !existsOK) {
        throw new ParseError(`\\newcommand{${name}} attempting to redefine ` +
            `${name}; use \\renewcommand`);
    }
    if (!exists && !nonexistsOK) {
        throw new ParseError(`\\renewcommand{${name}} when command ${name} ` +
            `does not yet exist; use \\newcommand`);
    }

    let numArgs = 0;
    arg = context.consumeArg().tokens;
    if (arg.length === 1 && arg[0].text === "[") {
        let argText = '';
        let token = context.expandNextToken();
        while (token.text !== "]" && token.text !== "EOF") {
            // TODO: Should properly expand arg, e.g., ignore {}s
            argText += token.text;
            token = context.expandNextToken();
        }
        if (!argText.match(/^\s*[0-9]+\s*$/)) {
            throw new ParseError(`Invalid number of arguments: ${argText}`);
        }
        numArgs = parseInt(argText);
        arg = context.consumeArg().tokens;
    }

    if (!(exists && skipIfExists)) {
        // Final arg is the expansion of the macro
        context.macros.set(name, {
            tokens: arg,
            numArgs,
        });
    }
    return '';
};
defineMacro("\\newcommand",
    (context) => newcommand(context, false, true, false));
defineMacro("\\renewcommand",
    (context) => newcommand(context, true, false, false));
defineMacro("\\providecommand",
    (context) => newcommand(context, true, true, true));

// terminal (console) tools
defineMacro("\\message", (context) => {
    const arg = context.consumeArgs(1)[0];
    // eslint-disable-next-line no-console
    console.log(arg.reverse().map(token => token.text).join(""));
    return '';
});
defineMacro("\\errmessage", (context) => {
    const arg = context.consumeArgs(1)[0];
    // eslint-disable-next-line no-console
    console.error(arg.reverse().map(token => token.text).join(""));
    return '';
});
defineMacro("\\show", (context) => {
    const tok = context.popToken();
    const name = tok.text;
    // eslint-disable-next-line no-console
    console.log(tok, context.macros.get(name), functions[name],
        symbols.math[name], symbols.text[name]);
    return '';
});

//////////////////////////////////////////////////////////////////////
// Grouping
// \let\bgroup={ \let\egroup=}
defineMacro("\\bgroup", "{");
defineMacro("\\egroup", "}");

// Symbols from latex.ltx:
// \def~{\nobreakspace{}}
// \def\lq{`}
// \def\rq{'}
// \def \aa {\r a}
// \def \AA {\r A}
defineMacro("~", "\\nobreakspace");
defineMacro("\\lq", "`");
defineMacro("\\rq", "'");
defineMacro("\\aa", "\\r a");
defineMacro("\\AA", "\\r A");

// Copyright (C) and registered (R) symbols. Use raw symbol in MathML.
// \DeclareTextCommandDefault{\textcopyright}{\textcircled{c}}
// \DeclareTextCommandDefault{\textregistered}{\textcircled{%
//      \check@mathfonts\fontsize\sf@size\z@\math@fontsfalse\selectfont R}}
// \DeclareRobustCommand{\copyright}{%
//    \ifmmode{\nfss@text{\textcopyright}}\else\textcopyright\fi}
defineMacro("\\textcopyright", "\\html@mathml{\\textcircled{c}}{\\char`©}");
defineMacro("\\copyright",
    "\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");
defineMacro("\\textregistered",
    "\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");

// Characters omitted from Unicode range 1D400–1D7FF
defineMacro("\u212C", "\\mathscr{B}");  // script
defineMacro("\u2130", "\\mathscr{E}");
defineMacro("\u2131", "\\mathscr{F}");
defineMacro("\u210B", "\\mathscr{H}");
defineMacro("\u2110", "\\mathscr{I}");
defineMacro("\u2112", "\\mathscr{L}");
defineMacro("\u2133", "\\mathscr{M}");
defineMacro("\u211B", "\\mathscr{R}");
defineMacro("\u212D", "\\mathfrak{C}");  // Fraktur
defineMacro("\u210C", "\\mathfrak{H}");
defineMacro("\u2128", "\\mathfrak{Z}");

// Define \Bbbk with a macro that works in both HTML and MathML.
defineMacro("\\Bbbk", "\\Bbb{k}");

// \llap and \rlap render their contents in text mode
defineMacro("\\llap", "\\mathllap{\\textrm{#1}}");
defineMacro("\\rlap", "\\mathrlap{\\textrm{#1}}");
defineMacro("\\clap", "\\mathclap{\\textrm{#1}}");

// \mathstrut from the TeXbook, p 360
defineMacro("\\mathstrut", "\\vphantom{(}");

// \underbar from TeXbook p 353
defineMacro("\\underbar", "\\underline{\\text{#1}}");

// \not is defined by base/fontmath.ltx via
// \DeclareMathSymbol{\not}{\mathrel}{symbols}{"36}
// It's thus treated like a \mathrel, but defined by a symbol that has zero
// width but extends to the right.  We use \rlap to get that spacing.
// For MathML we write U+0338 here. buildMathML.js will then do the overlay.
defineMacro("\\not", "\\html@mathml{\\mathrel{\\mathrlap\\@not}\\nobreak}" +
    "{\\char\"338}");

// Negated symbols from base/fontmath.ltx:
// \def\neq{\not=} \let\ne=\neq
// \DeclareRobustCommand
//   \notin{\mathrel{\m@th\mathpalette\c@ncel\in}}
// \def\c@ncel#1#2{\m@th\ooalign{$\hfil#1\mkern1mu/\hfil$\crcr$#1#2$}}
defineMacro("\\neq", "\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");
defineMacro("\\ne", "\\neq");
defineMacro("\u2260", "\\neq");
defineMacro("\\notin", "\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}"
                       + "{\\mathrel{\\char`∉}}");
defineMacro("\u2209", "\\notin");

// Unicode stacked relations
defineMacro("\u2258", "\\html@mathml{" +
    "\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}" +
    "}{\\mathrel{\\char`\u2258}}");
defineMacro("\u2259",
    "\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`\u2258}}");
defineMacro("\u225A",
    "\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`\u225A}}");
defineMacro("\u225B",
    "\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}" +
    "{\\mathrel{\\char`\u225B}}");
defineMacro("\u225D",
    "\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}" +
    "{\\mathrel{\\char`\u225D}}");
defineMacro("\u225E",
    "\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}" +
    "{\\mathrel{\\char`\u225E}}");
defineMacro("\u225F",
    "\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`\u225F}}");

// Misc Unicode
defineMacro("\u27C2", "\\perp");
defineMacro("\u203C", "\\mathclose{!\\mkern-0.8mu!}");
defineMacro("\u220C", "\\notni");
defineMacro("\u231C", "\\ulcorner");
defineMacro("\u231D", "\\urcorner");
defineMacro("\u231E", "\\llcorner");
defineMacro("\u231F", "\\lrcorner");
defineMacro("\u00A9", "\\copyright");
defineMacro("\u00AE", "\\textregistered");

// The KaTeX fonts have corners at codepoints that don't match Unicode.
// For MathML purposes, use the Unicode code point.
defineMacro("\\ulcorner", "\\html@mathml{\\@ulcorner}{\\mathop{\\char\"231c}}");
defineMacro("\\urcorner", "\\html@mathml{\\@urcorner}{\\mathop{\\char\"231d}}");
defineMacro("\\llcorner", "\\html@mathml{\\@llcorner}{\\mathop{\\char\"231e}}");
defineMacro("\\lrcorner", "\\html@mathml{\\@lrcorner}{\\mathop{\\char\"231f}}");

//////////////////////////////////////////////////////////////////////
// LaTeX_2ε

// \vdots{\vbox{\baselineskip4\p@  \lineskiplimit\z@
// \kern6\p@\hbox{.}\hbox{.}\hbox{.}}}
// We'll call \varvdots, which gets a glyph from symbols.js.
// The zero-width rule gets us an equivalent to the vertical 6pt kern.
defineMacro("\\vdots", "{\\varvdots\\rule{0pt}{15pt}}");
defineMacro("\u22ee", "\\vdots");

//////////////////////////////////////////////////////////////////////
// amsmath.sty
// http://mirrors.concertpass.com/tex-archive/macros/latex/required/amsmath/amsmath.pdf

// Italic Greek capital letters.  AMS defines these with \DeclareMathSymbol,
// but they are equivalent to \mathit{\Letter}.
defineMacro("\\varGamma", "\\mathit{\\Gamma}");
defineMacro("\\varDelta", "\\mathit{\\Delta}");
defineMacro("\\varTheta", "\\mathit{\\Theta}");
defineMacro("\\varLambda", "\\mathit{\\Lambda}");
defineMacro("\\varXi", "\\mathit{\\Xi}");
defineMacro("\\varPi", "\\mathit{\\Pi}");
defineMacro("\\varSigma", "\\mathit{\\Sigma}");
defineMacro("\\varUpsilon", "\\mathit{\\Upsilon}");
defineMacro("\\varPhi", "\\mathit{\\Phi}");
defineMacro("\\varPsi", "\\mathit{\\Psi}");
defineMacro("\\varOmega", "\\mathit{\\Omega}");

//\newcommand{\substack}[1]{\subarray{c}#1\endsubarray}
defineMacro("\\substack", "\\begin{subarray}{c}#1\\end{subarray}");

// \renewcommand{\colon}{\nobreak\mskip2mu\mathpunct{}\nonscript
// \mkern-\thinmuskip{:}\mskip6muplus1mu\relax}
defineMacro("\\colon", "\\nobreak\\mskip2mu\\mathpunct{}" +
    "\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");

// \newcommand{\boxed}[1]{\fbox{\m@th$\displaystyle#1$}}
defineMacro("\\boxed", "\\fbox{$\\displaystyle{#1}$}");

// \def\iff{\DOTSB\;\Longleftrightarrow\;}
// \def\implies{\DOTSB\;\Longrightarrow\;}
// \def\impliedby{\DOTSB\;\Longleftarrow\;}
defineMacro("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;");
defineMacro("\\implies", "\\DOTSB\\;\\Longrightarrow\\;");
defineMacro("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;");

// \def\dddot#1{{\mathop{#1}\limits^{\vbox to-1.4\ex@{\kern-\tw@\ex@
//  \hbox{\normalfont ...}\vss}}}}
// We use \overset which avoids the vertical shift of \mathop.
defineMacro("\\dddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");
defineMacro("\\ddddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");

// AMSMath's automatic \dots, based on \mdots@@ macro.
const dotsByToken: Record<string, string> = {
    ',': '\\dotsc',
    '\\not': '\\dotsb',
    // \keybin@ checks for the following:
    '+': '\\dotsb',
    '=': '\\dotsb',
    '<': '\\dotsb',
    '>': '\\dotsb',
    '-': '\\dotsb',
    '*': '\\dotsb',
    ':': '\\dotsb',
    // Symbols whose definition starts with \DOTSB:
    '\\DOTSB': '\\dotsb',
    '\\coprod': '\\dotsb',
    '\\bigvee': '\\dotsb',
    '\\bigwedge': '\\dotsb',
    '\\biguplus': '\\dotsb',
    '\\bigcap': '\\dotsb',
    '\\bigcup': '\\dotsb',
    '\\prod': '\\dotsb',
    '\\sum': '\\dotsb',
    '\\bigotimes': '\\dotsb',
    '\\bigoplus': '\\dotsb',
    '\\bigodot': '\\dotsb',
    '\\bigsqcup': '\\dotsb',
    '\\And': '\\dotsb',
    '\\longrightarrow': '\\dotsb',
    '\\Longrightarrow': '\\dotsb',
    '\\longleftarrow': '\\dotsb',
    '\\Longleftarrow': '\\dotsb',
    '\\longleftrightarrow': '\\dotsb',
    '\\Longleftrightarrow': '\\dotsb',
    '\\mapsto': '\\dotsb',
    '\\longmapsto': '\\dotsb',
    '\\hookrightarrow': '\\dotsb',
    '\\doteq': '\\dotsb',
    // Symbols whose definition starts with \mathbin:
    '\\mathbin': '\\dotsb',
    // Symbols whose definition starts with \mathrel:
    '\\mathrel': '\\dotsb',
    '\\relbar': '\\dotsb',
    '\\Relbar': '\\dotsb',
    '\\xrightarrow': '\\dotsb',
    '\\xleftarrow': '\\dotsb',
    // Symbols whose definition starts with \DOTSI:
    '\\DOTSI': '\\dotsi',
    '\\int': '\\dotsi',
    '\\oint': '\\dotsi',
    '\\iint': '\\dotsi',
    '\\iiint': '\\dotsi',
    '\\iiiint': '\\dotsi',
    '\\idotsint': '\\dotsi',
    // Symbols whose definition starts with \DOTSX:
    '\\DOTSX': '\\dotsx',
};

const dotsbGroups = new Set(['bin', 'rel']);

defineMacro("\\dots", function(context) {
    // TODO: If used in text mode, should expand to \textellipsis.
    // However, in KaTeX, \textellipsis and \ldots behave the same
    // (in text mode), and it's unlikely we'd see any of the math commands
    // that affect the behavior of \dots when in text mode.  So fine for now
    // (until we support \ifmmode ... \else ... \fi).
    let thedots = '\\dotso';
    const next = context.expandAfterFuture().text;
    if (next in dotsByToken) {
        thedots = dotsByToken[next];
    } else if (next.slice(0, 4) === '\\not') {
        thedots = '\\dotsb';
    } else if (next in symbols.math) {
        if (dotsbGroups.has(symbols.math[next].group)) {
            thedots = '\\dotsb';
        }
    }
    return thedots;
});

const spaceAfterDots = {
    // \rightdelim@ checks for the following:
    ')': true,
    ']': true,
    '\\rbrack': true,
    '\\}': true,
    '\\rbrace': true,
    '\\rangle': true,
    '\\rceil': true,
    '\\rfloor': true,
    '\\rgroup': true,
    '\\rmoustache': true,
    '\\right': true,
    '\\bigr': true,
    '\\biggr': true,
    '\\Bigr': true,
    '\\Biggr': true,
    // \extra@ also tests for the following:
    '$': true,
    // \extrap@ checks for the following:
    ';': true,
    '.': true,
    ',': true,
};

defineMacro("\\dotso", function(context) {
    const next = context.future().text;
    if (next in spaceAfterDots) {
        return "\\ldots\\,";
    } else {
        return "\\ldots";
    }
});

defineMacro("\\dotsc", function(context) {
    const next = context.future().text;
    // \dotsc uses \extra@ but not \extrap@, instead specially checking for
    // ';' and '.', but doesn't check for ','.
    if (next in spaceAfterDots && next !== ',') {
        return "\\ldots\\,";
    } else {
        return "\\ldots";
    }
});

defineMacro("\\cdots", function(context) {
    const next = context.future().text;
    if (next in spaceAfterDots) {
        return "\\@cdots\\,";
    } else {
        return "\\@cdots";
    }
});

defineMacro("\\dotsb", "\\cdots");
defineMacro("\\dotsm", "\\cdots");
defineMacro("\\dotsi", "\\!\\cdots");
// amsmath doesn't actually define \dotsx, but \dots followed by a macro
// starting with \DOTSX implies \dotso, and then \extra@ detects this case
// and forces the added `\,`.
defineMacro("\\dotsx", "\\ldots\\,");

// \let\DOTSI\relax
// \let\DOTSB\relax
// \let\DOTSX\relax
defineMacro("\\DOTSI", "\\relax");
defineMacro("\\DOTSB", "\\relax");
defineMacro("\\DOTSX", "\\relax");

// Spacing, based on amsmath.sty's override of LaTeX defaults
// \DeclareRobustCommand{\tmspace}[3]{%
//   \ifmmode\mskip#1#2\else\kern#1#3\fi\relax}
defineMacro("\\tmspace", "\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");
// \renewcommand{\,}{\tmspace+\thinmuskip{.1667em}}
// TODO: math mode should use \thinmuskip
defineMacro("\\,", "\\tmspace+{3mu}{.1667em}");
// \let\thinspace\,
defineMacro("\\thinspace", "\\,");
// \def\>{\mskip\medmuskip}
// \renewcommand{\:}{\tmspace+\medmuskip{.2222em}}
// TODO: \> and math mode of \: should use \medmuskip = 4mu plus 2mu minus 4mu
defineMacro("\\>", "\\mskip{4mu}");
defineMacro("\\:", "\\tmspace+{4mu}{.2222em}");
// \let\medspace\:
defineMacro("\\medspace", "\\:");
// \renewcommand{\;}{\tmspace+\thickmuskip{.2777em}}
// TODO: math mode should use \thickmuskip = 5mu plus 5mu
defineMacro("\\;", "\\tmspace+{5mu}{.2777em}");
// \let\thickspace\;
defineMacro("\\thickspace", "\\;");
// \renewcommand{\!}{\tmspace-\thinmuskip{.1667em}}
// TODO: math mode should use \thinmuskip
defineMacro("\\!", "\\tmspace-{3mu}{.1667em}");
// \let\negthinspace\!
defineMacro("\\negthinspace", "\\!");
// \newcommand{\negmedspace}{\tmspace-\medmuskip{.2222em}}
// TODO: math mode should use \medmuskip
defineMacro("\\negmedspace", "\\tmspace-{4mu}{.2222em}");
// \newcommand{\negthickspace}{\tmspace-\thickmuskip{.2777em}}
// TODO: math mode should use \thickmuskip
defineMacro("\\negthickspace", "\\tmspace-{5mu}{.277em}");
// \def\enspace{\kern.5em }
defineMacro("\\enspace", "\\kern.5em ");
// \def\enskip{\hskip.5em\relax}
defineMacro("\\enskip", "\\hskip.5em\\relax");
// \def\quad{\hskip1em\relax}
defineMacro("\\quad", "\\hskip1em\\relax");
// \def\qquad{\hskip2em\relax}
defineMacro("\\qquad", "\\hskip2em\\relax");

// \tag@in@display form of \tag
defineMacro("\\tag", "\\@ifstar\\tag@literal\\tag@paren");
defineMacro("\\tag@paren", "\\tag@literal{({#1})}");
defineMacro("\\tag@literal", (context) => {
    if (context.macros.get("\\df@tag")) {
        throw new ParseError("Multiple \\tag");
    }
    return "\\gdef\\df@tag{\\text{#1}}";
});

// \renewcommand{\bmod}{\nonscript\mskip-\medmuskip\mkern5mu\mathbin
//   {\operator@font mod}\penalty900
//   \mkern5mu\nonscript\mskip-\medmuskip}
// \newcommand{\pod}[1]{\allowbreak
//   \if@display\mkern18mu\else\mkern8mu\fi(#1)}
// \renewcommand{\pmod}[1]{\pod{{\operator@font mod}\mkern6mu#1}}
// \newcommand{\mod}[1]{\allowbreak\if@display\mkern18mu
//   \else\mkern12mu\fi{\operator@font mod}\,\,#1}
// TODO: math mode should use \medmuskip = 4mu plus 2mu minus 4mu
defineMacro("\\bmod",
    "\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}" +
    "\\mathbin{\\rm mod}" +
    "\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");
defineMacro("\\pod", "\\allowbreak" +
    "\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");
defineMacro("\\pmod", "\\pod{{\\rm mod}\\mkern6mu#1}");
defineMacro("\\mod", "\\allowbreak" +
    "\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}" +
    "{\\rm mod}\\,\\,#1");

//////////////////////////////////////////////////////////////////////
// LaTeX source2e

// \expandafter\let\expandafter\@normalcr
//     \csname\expandafter\@gobble\string\\ \endcsname
// \DeclareRobustCommand\newline{\@normalcr\relax}
defineMacro("\\newline", "\\\\\\relax");

// \def\TeX{T\kern-.1667em\lower.5ex\hbox{E}\kern-.125emX\@}
// TODO: Doesn't normally work in math mode because \@ fails.  KaTeX doesn't
// support \@ yet, so that's omitted, and we add \text so that the result
// doesn't look funny in math mode.
defineMacro("\\TeX", "\\textrm{\\html@mathml{" +
    "T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX" +
    "}{TeX}}");

// \DeclareRobustCommand{\LaTeX}{L\kern-.36em%
//         {\sbox\z@ T%
//          \vbox to\ht\z@{\hbox{\check@mathfonts
//                               \fontsize\sf@size\z@
//                               \math@fontsfalse\selectfont
//                               A}%
//                         \vss}%
//         }%
//         \kern-.15em%
//         \TeX}
// This code aligns the top of the A with the T (from the perspective of TeX's
// boxes, though visually the A appears to extend above slightly).
// We compute the corresponding \raisebox when A is rendered in \normalsize
// \scriptstyle, which has a scale factor of 0.7 (see Options.js).
const latexRaiseA = makeEm(fontMetricsData['Main-Regular']["T".charCodeAt(0)][1] -
    0.7 * fontMetricsData['Main-Regular']["A".charCodeAt(0)][1]);
defineMacro("\\LaTeX", "\\textrm{\\html@mathml{" +
    `L\\kern-.36em\\raisebox{${latexRaiseA}}{\\scriptstyle A}` +
    "\\kern-.15em\\TeX}{LaTeX}}");

// New KaTeX logo based on tweaking LaTeX logo
defineMacro("\\KaTeX", "\\textrm{\\html@mathml{" +
    `K\\kern-.17em\\raisebox{${latexRaiseA}}{\\scriptstyle A}` +
    "\\kern-.15em\\TeX}{KaTeX}}");

// \DeclareRobustCommand\hspace{\@ifstar\@hspacer\@hspace}
// \def\@hspace#1{\hskip  #1\relax}
// \def\@hspacer#1{\vrule \@width\z@\nobreak
//                 \hskip #1\hskip \z@skip}
defineMacro("\\hspace", "\\@ifstar\\@hspacer\\@hspace");
defineMacro("\\@hspace", "\\hskip #1\\relax");
defineMacro("\\@hspacer", "\\rule{0pt}{0pt}\\hskip #1\\relax");

//////////////////////////////////////////////////////////////////////
// mathtools.sty

//\providecommand\ordinarycolon{:}
defineMacro("\\ordinarycolon", ":");
//\def\vcentcolon{\mathrel{\mathop\ordinarycolon}}
//TODO(edemaine): Not yet centered. Fix via \raisebox or #726
defineMacro("\\vcentcolon", "\\mathrel{\\mathop\\ordinarycolon}");
// \providecommand*\dblcolon{\vcentcolon\mathrel{\mkern-.9mu}\vcentcolon}
defineMacro("\\dblcolon", "\\html@mathml{" +
    "\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}" +
    "{\\mathop{\\char\"2237}}");
// \providecommand*\coloneqq{\vcentcolon\mathrel{\mkern-1.2mu}=}
defineMacro("\\coloneqq", "\\html@mathml{" +
    "\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}" +
    "{\\mathop{\\char\"2254}}"); // ≔
// \providecommand*\Coloneqq{\dblcolon\mathrel{\mkern-1.2mu}=}
defineMacro("\\Coloneqq", "\\html@mathml{" +
    "\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}" +
    "{\\mathop{\\char\"2237\\char\"3d}}");
// \providecommand*\coloneq{\vcentcolon\mathrel{\mkern-1.2mu}\mathrel{-}}
defineMacro("\\coloneq", "\\html@mathml{" +
    "\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}" +
    "{\\mathop{\\char\"3a\\char\"2212}}");
// \providecommand*\Coloneq{\dblcolon\mathrel{\mkern-1.2mu}\mathrel{-}}
defineMacro("\\Coloneq", "\\html@mathml{" +
    "\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}" +
    "{\\mathop{\\char\"2237\\char\"2212}}");
// \providecommand*\eqqcolon{=\mathrel{\mkern-1.2mu}\vcentcolon}
defineMacro("\\eqqcolon", "\\html@mathml{" +
    "\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}" +
    "{\\mathop{\\char\"2255}}"); // ≕
// \providecommand*\Eqqcolon{=\mathrel{\mkern-1.2mu}\dblcolon}
defineMacro("\\Eqqcolon", "\\html@mathml{" +
    "\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}" +
    "{\\mathop{\\char\"3d\\char\"2237}}");
// \providecommand*\eqcolon{\mathrel{-}\mathrel{\mkern-1.2mu}\vcentcolon}
defineMacro("\\eqcolon", "\\html@mathml{" +
    "\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}" +
    "{\\mathop{\\char\"2239}}");
// \providecommand*\Eqcolon{\mathrel{-}\mathrel{\mkern-1.2mu}\dblcolon}
defineMacro("\\Eqcolon", "\\html@mathml{" +
    "\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}" +
    "{\\mathop{\\char\"2212\\char\"2237}}");
// \providecommand*\colonapprox{\vcentcolon\mathrel{\mkern-1.2mu}\approx}
defineMacro("\\colonapprox", "\\html@mathml{" +
    "\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}" +
    "{\\mathop{\\char\"3a\\char\"2248}}");
// \providecommand*\Colonapprox{\dblcolon\mathrel{\mkern-1.2mu}\approx}
defineMacro("\\Colonapprox", "\\html@mathml{" +
    "\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}" +
    "{\\mathop{\\char\"2237\\char\"2248}}");
// \providecommand*\colonsim{\vcentcolon\mathrel{\mkern-1.2mu}\sim}
defineMacro("\\colonsim", "\\html@mathml{" +
    "\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}" +
    "{\\mathop{\\char\"3a\\char\"223c}}");
// \providecommand*\Colonsim{\dblcolon\mathrel{\mkern-1.2mu}\sim}
defineMacro("\\Colonsim", "\\html@mathml{" +
    "\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}" +
    "{\\mathop{\\char\"2237\\char\"223c}}");

// Some Unicode characters are implemented with macros to mathtools functions.
defineMacro("\u2237", "\\dblcolon");  // ::
defineMacro("\u2239", "\\eqcolon");  // -:
defineMacro("\u2254", "\\coloneqq");  // :=
defineMacro("\u2255", "\\eqqcolon");  // =:
defineMacro("\u2A74", "\\Coloneqq");  // ::=

//////////////////////////////////////////////////////////////////////
// colonequals.sty

// Alternate names for mathtools's macros:
defineMacro("\\ratio", "\\vcentcolon");
defineMacro("\\coloncolon", "\\dblcolon");
defineMacro("\\colonequals", "\\coloneqq");
defineMacro("\\coloncolonequals", "\\Coloneqq");
defineMacro("\\equalscolon", "\\eqqcolon");
defineMacro("\\equalscoloncolon", "\\Eqqcolon");
defineMacro("\\colonminus", "\\coloneq");
defineMacro("\\coloncolonminus", "\\Coloneq");
defineMacro("\\minuscolon", "\\eqcolon");
defineMacro("\\minuscoloncolon", "\\Eqcolon");
// \colonapprox name is same in mathtools and colonequals.
defineMacro("\\coloncolonapprox", "\\Colonapprox");
// \colonsim name is same in mathtools and colonequals.
defineMacro("\\coloncolonsim", "\\Colonsim");

// Additional macros, implemented by analogy with mathtools definitions:
defineMacro("\\simcolon",
    "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
defineMacro("\\simcoloncolon",
    "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");
defineMacro("\\approxcolon",
    "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
defineMacro("\\approxcoloncolon",
            "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");

// Present in newtxmath, pxfonts and txfonts
defineMacro("\\notni", "\\html@mathml{\\not\\ni}{\\mathrel{\\char`\u220C}}");
defineMacro("\\limsup", "\\DOTSB\\operatorname*{lim\\,sup}");
defineMacro("\\liminf", "\\DOTSB\\operatorname*{lim\\,inf}");

//////////////////////////////////////////////////////////////////////
// From amsopn.sty
defineMacro("\\injlim", "\\DOTSB\\operatorname*{inj\\,lim}");
defineMacro("\\projlim", "\\DOTSB\\operatorname*{proj\\,lim}");
defineMacro("\\varlimsup", "\\DOTSB\\operatorname*{\\overline{lim}}");
defineMacro("\\varliminf", "\\DOTSB\\operatorname*{\\underline{lim}}");
defineMacro("\\varinjlim", "\\DOTSB\\operatorname*{\\underrightarrow{lim}}");
defineMacro("\\varprojlim", "\\DOTSB\\operatorname*{\\underleftarrow{lim}}");

//////////////////////////////////////////////////////////////////////
// MathML alternates for KaTeX glyphs in the Unicode private area
defineMacro("\\gvertneqq", "\\html@mathml{\\@gvertneqq}{\u2269}");
defineMacro("\\lvertneqq", "\\html@mathml{\\@lvertneqq}{\u2268}");
defineMacro("\\ngeqq", "\\html@mathml{\\@ngeqq}{\u2271}");
defineMacro("\\ngeqslant", "\\html@mathml{\\@ngeqslant}{\u2271}");
defineMacro("\\nleqq", "\\html@mathml{\\@nleqq}{\u2270}");
defineMacro("\\nleqslant", "\\html@mathml{\\@nleqslant}{\u2270}");
defineMacro("\\nshortmid", "\\html@mathml{\\@nshortmid}{∤}");
defineMacro("\\nshortparallel", "\\html@mathml{\\@nshortparallel}{∦}");
defineMacro("\\nsubseteqq", "\\html@mathml{\\@nsubseteqq}{\u2288}");
defineMacro("\\nsupseteqq", "\\html@mathml{\\@nsupseteqq}{\u2289}");
defineMacro("\\varsubsetneq", "\\html@mathml{\\@varsubsetneq}{⊊}");
defineMacro("\\varsubsetneqq", "\\html@mathml{\\@varsubsetneqq}{⫋}");
defineMacro("\\varsupsetneq", "\\html@mathml{\\@varsupsetneq}{⊋}");
defineMacro("\\varsupsetneqq", "\\html@mathml{\\@varsupsetneqq}{⫌}");
defineMacro("\\imath", "\\html@mathml{\\@imath}{\u0131}");
defineMacro("\\jmath", "\\html@mathml{\\@jmath}{\u0237}");

//////////////////////////////////////////////////////////////////////
// stmaryrd and semantic

// The stmaryrd and semantic packages render the next four items by calling a
// glyph. Those glyphs do not exist in the KaTeX fonts. Hence the macros.

defineMacro("\\llbracket", "\\html@mathml{" +
    "\\mathopen{[\\mkern-3.2mu[}}" +
    "{\\mathopen{\\char`\u27e6}}");
defineMacro("\\rrbracket", "\\html@mathml{" +
    "\\mathclose{]\\mkern-3.2mu]}}" +
    "{\\mathclose{\\char`\u27e7}}");

defineMacro("\u27e6", "\\llbracket"); // blackboard bold [
defineMacro("\u27e7", "\\rrbracket"); // blackboard bold ]

defineMacro("\\lBrace", "\\html@mathml{" +
    "\\mathopen{\\{\\mkern-3.2mu[}}" +
    "{\\mathopen{\\char`\u2983}}");
defineMacro("\\rBrace", "\\html@mathml{" +
    "\\mathclose{]\\mkern-3.2mu\\}}}" +
    "{\\mathclose{\\char`\u2984}}");

defineMacro("\u2983", "\\lBrace"); // blackboard bold {
defineMacro("\u2984", "\\rBrace"); // blackboard bold }

// TODO: Create variable sized versions of the last two items. I believe that
// will require new font glyphs.

// The stmaryrd function `\minuso` provides a "Plimsoll" symbol that
// superimposes the characters \circ and \mathminus. Used in chemistry.
defineMacro("\\minuso", "\\mathbin{\\html@mathml{" +
    "{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}" +
    "{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}" +
    "{\\char`⦵}}");
defineMacro("⦵", "\\minuso");

//////////////////////////////////////////////////////////////////////
// texvc.sty

// The texvc package contains macros available in mediawiki pages.
// We omit the functions deprecated at
// https://en.wikipedia.org/wiki/Help:Displaying_a_formula#Deprecated_syntax

// We also omit texvc's \O, which conflicts with \text{\O}

defineMacro("\\darr", "\\downarrow");
defineMacro("\\dArr", "\\Downarrow");
defineMacro("\\Darr", "\\Downarrow");
defineMacro("\\lang", "\\langle");
defineMacro("\\rang", "\\rangle");
defineMacro("\\uarr", "\\uparrow");
defineMacro("\\uArr", "\\Uparrow");
defineMacro("\\Uarr", "\\Uparrow");
defineMacro("\\N", "\\mathbb{N}");
defineMacro("\\R", "\\mathbb{R}");
defineMacro("\\Z", "\\mathbb{Z}");
defineMacro("\\alef", "\\aleph");
defineMacro("\\alefsym", "\\aleph");
defineMacro("\\Alpha", "\\mathrm{A}");
defineMacro("\\Beta", "\\mathrm{B}");
defineMacro("\\bull", "\\bullet");
defineMacro("\\Chi", "\\mathrm{X}");
defineMacro("\\clubs", "\\clubsuit");
defineMacro("\\cnums", "\\mathbb{C}");
defineMacro("\\Complex", "\\mathbb{C}");
defineMacro("\\Dagger", "\\ddagger");
defineMacro("\\diamonds", "\\diamondsuit");
defineMacro("\\empty", "\\emptyset");
defineMacro("\\Epsilon", "\\mathrm{E}");
defineMacro("\\Eta", "\\mathrm{H}");
defineMacro("\\exist", "\\exists");
defineMacro("\\harr", "\\leftrightarrow");
defineMacro("\\hArr", "\\Leftrightarrow");
defineMacro("\\Harr", "\\Leftrightarrow");
defineMacro("\\hearts", "\\heartsuit");
defineMacro("\\image", "\\Im");
defineMacro("\\infin", "\\infty");
defineMacro("\\Iota", "\\mathrm{I}");
defineMacro("\\isin", "\\in");
defineMacro("\\Kappa", "\\mathrm{K}");
defineMacro("\\larr", "\\leftarrow");
defineMacro("\\lArr", "\\Leftarrow");
defineMacro("\\Larr", "\\Leftarrow");
defineMacro("\\lrarr", "\\leftrightarrow");
defineMacro("\\lrArr", "\\Leftrightarrow");
defineMacro("\\Lrarr", "\\Leftrightarrow");
defineMacro("\\Mu", "\\mathrm{M}");
defineMacro("\\natnums", "\\mathbb{N}");
defineMacro("\\Nu", "\\mathrm{N}");
defineMacro("\\Omicron", "\\mathrm{O}");
defineMacro("\\plusmn", "\\pm");
defineMacro("\\rarr", "\\rightarrow");
defineMacro("\\rArr", "\\Rightarrow");
defineMacro("\\Rarr", "\\Rightarrow");
defineMacro("\\real", "\\Re");
defineMacro("\\reals", "\\mathbb{R}");
defineMacro("\\Reals", "\\mathbb{R}");
defineMacro("\\Rho", "\\mathrm{P}");
defineMacro("\\sdot", "\\cdot");
defineMacro("\\sect", "\\S");
defineMacro("\\spades", "\\spadesuit");
defineMacro("\\sub", "\\subset");
defineMacro("\\sube", "\\subseteq");
defineMacro("\\supe", "\\supseteq");
defineMacro("\\Tau", "\\mathrm{T}");
defineMacro("\\thetasym", "\\vartheta");
// TODO: defineMacro("\\varcoppa", "\\\mbox{\\coppa}");
defineMacro("\\weierp", "\\wp");
defineMacro("\\Zeta", "\\mathrm{Z}");

//////////////////////////////////////////////////////////////////////
// statmath.sty
// https://ctan.math.illinois.edu/macros/latex/contrib/statmath/statmath.pdf

defineMacro("\\argmin", "\\DOTSB\\operatorname*{arg\\,min}");
defineMacro("\\argmax", "\\DOTSB\\operatorname*{arg\\,max}");
defineMacro("\\plim", "\\DOTSB\\mathop{\\operatorname{plim}}\\limits");

//////////////////////////////////////////////////////////////////////
// braket.sty
// http://ctan.math.washington.edu/tex-archive/macros/latex/contrib/braket/braket.pdf

defineMacro("\\bra", "\\mathinner{\\langle{#1}|}");
defineMacro("\\ket", "\\mathinner{|{#1}\\rangle}");
defineMacro("\\braket", "\\mathinner{\\langle{#1}\\rangle}");
defineMacro("\\Bra", "\\left\\langle#1\\right|");
defineMacro("\\Ket", "\\left|#1\\right\\rangle");
const braketHelper = (one: boolean) => (context: MacroContextInterface) => {
    const left = context.consumeArg().tokens;
    const middle = context.consumeArg().tokens;
    const middleDouble = context.consumeArg().tokens;
    const right = context.consumeArg().tokens;
    const oldMiddle = context.macros.get("|");
    const oldMiddleDouble = context.macros.get("\\|");
    context.macros.beginGroup();
    const midMacro = (double: boolean) => (context: MacroContextInterface) => {
        if (one) {
            // Only modify the first instance of | or \|
            context.macros.set("|", oldMiddle);
            if (middleDouble.length) {
                context.macros.set("\\|", oldMiddleDouble);
            }
        }
        let doubled = double;
        if (!double && middleDouble.length) {
            // Mimic \@ifnextchar
            const nextToken = context.future();
            if (nextToken.text === "|") {
                context.popToken();
                doubled = true;
            }
        }
        return {
            tokens: doubled ? middleDouble : middle,
            numArgs: 0,
        };
    };
    context.macros.set("|", midMacro(false));
    if (middleDouble.length) {
        context.macros.set("\\|", midMacro(true));
    }
    const arg = context.consumeArg().tokens;
    const expanded = context.expandTokens([
        ...right, ...arg, ...left,  // reversed
    ]);
    context.macros.endGroup();
    return {
        tokens: expanded.reverse(),
        numArgs: 0,
    };
};
defineMacro("\\bra@ket", braketHelper(false));
defineMacro("\\bra@set", braketHelper(true));
defineMacro("\\Braket", "\\bra@ket{\\left\\langle}" +
    "{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");
defineMacro("\\Set", "\\bra@set{\\left\\{\\:}" +
    "{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");
defineMacro("\\set", "\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");
    // has no support for special || or \|

//////////////////////////////////////////////////////////////////////
// actuarialangle.dtx
defineMacro("\\angln", "{\\angl n}");

// Custom Khan Academy colors, should be moved to an optional package
defineMacro("\\blue", "\\textcolor{##6495ed}{#1}");
defineMacro("\\orange", "\\textcolor{##ffa500}{#1}");
defineMacro("\\pink", "\\textcolor{##ff00af}{#1}");
defineMacro("\\red", "\\textcolor{##df0030}{#1}");
defineMacro("\\green", "\\textcolor{##28ae7b}{#1}");
defineMacro("\\gray", "\\textcolor{gray}{#1}");
defineMacro("\\purple", "\\textcolor{##9d38bd}{#1}");
defineMacro("\\blueA", "\\textcolor{##ccfaff}{#1}");
defineMacro("\\blueB", "\\textcolor{##80f6ff}{#1}");
defineMacro("\\blueC", "\\textcolor{##63d9ea}{#1}");
defineMacro("\\blueD", "\\textcolor{##11accd}{#1}");
defineMacro("\\blueE", "\\textcolor{##0c7f99}{#1}");
defineMacro("\\tealA", "\\textcolor{##94fff5}{#1}");
defineMacro("\\tealB", "\\textcolor{##26edd5}{#1}");
defineMacro("\\tealC", "\\textcolor{##01d1c1}{#1}");
defineMacro("\\tealD", "\\textcolor{##01a995}{#1}");
defineMacro("\\tealE", "\\textcolor{##208170}{#1}");
defineMacro("\\greenA", "\\textcolor{##b6ffb0}{#1}");
defineMacro("\\greenB", "\\textcolor{##8af281}{#1}");
defineMacro("\\greenC", "\\textcolor{##74cf70}{#1}");
defineMacro("\\greenD", "\\textcolor{##1fab54}{#1}");
defineMacro("\\greenE", "\\textcolor{##0d923f}{#1}");
defineMacro("\\goldA", "\\textcolor{##ffd0a9}{#1}");
defineMacro("\\goldB", "\\textcolor{##ffbb71}{#1}");
defineMacro("\\goldC", "\\textcolor{##ff9c39}{#1}");
defineMacro("\\goldD", "\\textcolor{##e07d10}{#1}");
defineMacro("\\goldE", "\\textcolor{##a75a05}{#1}");
defineMacro("\\redA", "\\textcolor{##fca9a9}{#1}");
defineMacro("\\redB", "\\textcolor{##ff8482}{#1}");
defineMacro("\\redC", "\\textcolor{##f9685d}{#1}");
defineMacro("\\redD", "\\textcolor{##e84d39}{#1}");
defineMacro("\\redE", "\\textcolor{##bc2612}{#1}");
defineMacro("\\maroonA", "\\textcolor{##ffbde0}{#1}");
defineMacro("\\maroonB", "\\textcolor{##ff92c6}{#1}");
defineMacro("\\maroonC", "\\textcolor{##ed5fa6}{#1}");
defineMacro("\\maroonD", "\\textcolor{##ca337c}{#1}");
defineMacro("\\maroonE", "\\textcolor{##9e034e}{#1}");
defineMacro("\\purpleA", "\\textcolor{##ddd7ff}{#1}");
defineMacro("\\purpleB", "\\textcolor{##c6b9fc}{#1}");
defineMacro("\\purpleC", "\\textcolor{##aa87ff}{#1}");
defineMacro("\\purpleD", "\\textcolor{##7854ab}{#1}");
defineMacro("\\purpleE", "\\textcolor{##543b78}{#1}");
defineMacro("\\mintA", "\\textcolor{##f5f9e8}{#1}");
defineMacro("\\mintB", "\\textcolor{##edf2df}{#1}");
defineMacro("\\mintC", "\\textcolor{##e0e5cc}{#1}");
defineMacro("\\grayA", "\\textcolor{##f6f7f7}{#1}");
defineMacro("\\grayB", "\\textcolor{##f0f1f2}{#1}");
defineMacro("\\grayC", "\\textcolor{##e3e5e6}{#1}");
defineMacro("\\grayD", "\\textcolor{##d6d8da}{#1}");
defineMacro("\\grayE", "\\textcolor{##babec2}{#1}");
defineMacro("\\grayF", "\\textcolor{##888d93}{#1}");
defineMacro("\\grayG", "\\textcolor{##626569}{#1}");
defineMacro("\\grayH", "\\textcolor{##3b3e40}{#1}");
defineMacro("\\grayI", "\\textcolor{##21242c}{#1}");
defineMacro("\\kaBlue", "\\textcolor{##314453}{#1}");
defineMacro("\\kaGreen", "\\textcolor{##71B307}{#1}");
xV/**
 * These objects store data about MathML nodes. This is the MathML equivalent
 * of the types in domTree.js. Since MathML handles its own rendering, and
 * since we're mainly using MathML to improve accessibility, we don't manage
 * any of the styling state that the plain DOM nodes do.
 *
 * The `toNode` and `toMarkup` functions work similarly to how they do in
 * domTree.js, creating namespaced DOM nodes and HTML text markup respectively.
 */

import {escape} from "./utils";
import {DocumentFragment} from "./tree";
import {createClass} from "./domTree";
import {makeEm} from "./units";

import type {VirtualNode} from "./tree";

/**
 * MathML node types used in KaTeX. For a complete list of MathML nodes, see
 * https://developer.mozilla.org/en-US/docs/Web/MathML/Element.
 */
export type MathNodeType =
    "math" | "annotation" | "semantics" |
    "mtext" | "mn" | "mo" | "mi" | "mspace" |
    "mover" | "munder" | "munderover" | "msup" | "msub" | "msubsup" |
    "mfrac" | "mroot" | "msqrt" |
    "mtable" | "mtr" | "mtd" | "mlabeledtr" |
    "mrow" | "menclose" |
    "mstyle" | "mpadded" | "mphantom" | "mglyph";

export interface MathDomNode extends VirtualNode {
    toText(): string;
}

export type documentFragment = DocumentFragment<MathDomNode>;
export function newDocumentFragment(
    children: ReadonlyArray<MathDomNode>
): documentFragment {
    return new DocumentFragment(children);
}

/**
 * This node represents a general purpose MathML node of any type. The
 * constructor requires the type of node to create (for example, `"mo"` or
 * `"mspace"`, corresponding to `<mo>` and `<mspace>` tags).
 */
export class MathNode implements MathDomNode {
    type: MathNodeType;
    attributes: Record<string, string>;
    children: MathDomNode[];
    classes: string[];

    constructor(
        type: MathNodeType,
        children?: MathDomNode[],
        classes?: string[]
    ) {
        this.type = type;
        this.attributes = {};
        this.children = children || [];
        this.classes = classes || [];
    }

    /**
     * Sets an attribute on a MathML node. MathML depends on attributes to convey a
     * semantic content, so this is used heavily.
     */
    setAttribute(name: string, value: string) {
        this.attributes[name] = value;
    }

    /**
     * Gets an attribute on a MathML node.
     */
    getAttribute(name: string): string {
        return this.attributes[name];
    }

    /**
     * Converts the math node into a MathML-namespaced DOM element.
     */
    toNode(): Node {
        const node = document.createElementNS(
            "http://www.w3.org/1998/Math/MathML", this.type);

        for (const attr in this.attributes) {
            if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
                node.setAttribute(attr, this.attributes[attr]);
            }
        }

        if (this.classes.length > 0) {
            node.className = createClass(this.classes);
        }

        for (let i = 0; i < this.children.length; i++) {
            // Combine multiple TextNodes into one TextNode, to prevent
            // screen readers from reading each as a separate word [#3995]
            if (this.children[i] instanceof TextNode &&
                this.children[i + 1] instanceof TextNode) {
                let text = this.children[i].toText() + this.children[++i].toText();
                while (this.children[i + 1] instanceof TextNode) {
                    text += this.children[++i].toText();
                }
                node.appendChild(new TextNode(text).toNode());
            } else {
                node.appendChild(this.children[i].toNode());
            }
        }

        return node;
    }

    /**
     * Converts the math node into an HTML markup string.
     */
    toMarkup(): string {
        let markup = "<" + this.type;

        // Add the attributes
        for (const attr in this.attributes) {
            if (Object.prototype.hasOwnProperty.call(this.attributes, attr)) {
                markup += " " + attr + "=\"";
                markup += escape(this.attributes[attr]);
                markup += "\"";
            }
        }

        if (this.classes.length > 0) {
            markup += ` class ="${escape(createClass(this.classes))}"`;
        }

        markup += ">";

        for (let i = 0; i < this.children.length; i++) {
            markup += this.children[i].toMarkup();
        }

        markup += "</" + this.type + ">";

        return markup;
    }

    /**
     * Converts the math node into a string, similar to innerText, but escaped.
     */
    toText(): string {
        return this.children.map(child => child.toText()).join("");
    }
}

/**
 * This node represents a piece of text.
 */
export class TextNode implements MathDomNode {
    text: string;

    constructor(text: string) {
        this.text = text;
    }

    /**
     * Converts the text node into a DOM text node.
     */
    toNode(): Node {
        return document.createTextNode(this.text);
    }

    /**
     * Converts the text node into escaped HTML markup
     * (representing the text itself).
     */
    toMarkup(): string {
        return escape(this.toText());
    }

    /**
     * Converts the text node into a string
     * (representing the text itself).
     */
    toText(): string {
        return this.text;
    }
}

/**
 * This node represents a space, but may render as <mspace.../> or as text,
 * depending on the width.
 */
export class SpaceNode implements MathDomNode {
    width: number;
    character: string | null | undefined;

    /**
     * Create a Space node with width given in CSS ems.
     */
    constructor(width: number) {
        this.width = width;
        // See https://www.w3.org/TR/2000/WD-MathML2-20000328/chapter6.html
        // for a table of space-like characters.  We use Unicode
        // representations instead of &LongNames; as it's not clear how to
        // make the latter via document.createTextNode.
        if (width >= 0.05555 && width <= 0.05556) {
            this.character = "\u200a";           // &VeryThinSpace;
        } else if (width >= 0.1666 && width <= 0.1667) {
            this.character = "\u2009";           // &ThinSpace;
        } else if (width >= 0.2222 && width <= 0.2223) {
            this.character = "\u2005";           // &MediumSpace;
        } else if (width >= 0.2777 && width <= 0.2778) {
            this.character = "\u2005\u200a";     // &ThickSpace;
        } else if (width >= -0.05556 && width <= -0.05555) {
            this.character = "\u200a\u2063";     // &NegativeVeryThinSpace;
        } else if (width >= -0.1667 && width <= -0.1666) {
            this.character = "\u2009\u2063";     // &NegativeThinSpace;
        } else if (width >= -0.2223 && width <= -0.2222) {
            this.character = "\u205f\u2063";     // &NegativeMediumSpace;
        } else if (width >= -0.2778 && width <= -0.2777) {
            this.character = "\u2005\u2063";     // &NegativeThickSpace;
        } else {
            this.character = null;
        }
    }

    /**
     * Converts the math node into a MathML-namespaced DOM element.
     */
    toNode(): Node {
        if (this.character) {
            return document.createTextNode(this.character);
        } else {
            const node = document.createElementNS(
                "http://www.w3.org/1998/Math/MathML", "mspace");
            node.setAttribute("width", makeEm(this.width));
            return node;
        }
    }

    /**
     * Converts the math node into an HTML markup string.
     */
    toMarkup(): string {
        if (this.character) {
            return `<mtext>${this.character}</mtext>`;
        } else {
            return `<mspace width="${makeEm(this.width)}"/>`;
        }
    }

    /**
     * Converts the math node into a string, similar to innerText.
     */
    toText(): string {
        if (this.character) {
            return this.character;
        } else {
            return " ";
        }
    }
}
=x 100644 README.md @*Vl3F*100644 extract_tfms.py p)}o_۫s100644 extract_ttfs.py )"SGi|`)GlA7100644 format_json.py 	ںFjnod7q100644 mapping.pl ڼ|P#Ml:&ܯ2100644 parse_tfm.py VZcvC_PV_7xq### How to generate new metrics
-------------------------------

There are several requirements for generating the metrics used by KaTeX.

- You need to have an installation of TeX which supports kpathsea. You can check
  this by running `tex --version`, and seeing if it has a line that looks like
  > kpathsea version 6.2.0

- You need the Perl module `JSON`. You can install this either from CPAN
  (e.g. using the `cpan` command line tool: `cpan install JSON`)
  or with your package manager.

- You need the Python module `fonttools`. You can install this either from PyPI
  (using `easy_install` or `pip`: `pip install fonttools`)
  or with your package manager.

Once you have these things, run the following command from the root directory:

    sh ./dockers/fonts/buildMetrics.sh

which should generate new metrics and place them into `fontMetricsData.json`.
You're done!
k,x#!/usr/bin/env python3

import collections
import json
import parse_tfm
import subprocess
import sys


def find_font_path(font_name):
    try:
        font_path = subprocess.check_output(['kpsewhich', font_name])
    except OSError:
        raise RuntimeError("Couldn't find kpsewhich program, make sure you" +
                           " have TeX installed")
    except subprocess.CalledProcessError:
        raise RuntimeError("Couldn't find font metrics: '%s'" % font_name)
    return font_path.strip()


def main():
    mapping = json.load(sys.stdin)

    fonts = [
        'cmbsy10.tfm',
        'cmbx10.tfm',
        'cmbxti10.tfm',
        'cmex10.tfm',
        'cmmi10.tfm',
        'cmmib10.tfm',
        'cmr10.tfm',
        'cmsy10.tfm',
        'cmti10.tfm',
        'msam10.tfm',
        'msbm10.tfm',
        'eufm10.tfm',
        'cmtt10.tfm',
        'rsfs10.tfm',
        'cmss10.tfm',
        'cmssbx10.tfm',
        'cmssi10.tfm',
    ]

    # Extracted by running `\font\a=<font>` and then `\showthe\skewchar\a` in
    # TeX, where `<font>` is the name of the font listed here. The skewchar
    # will be printed out in the output. If it outputs `-1`, that means there
    # is no skewchar, so we use `None` here.
    font_skewchar = {
        'cmbsy10': None,
        'cmbx10': None,
        'cmbxti10': None,
        'cmex10': None,
        'cmmi10': 127,
        'cmmib10': None,
        'cmr10': None,
        'cmsy10': 48,
        'cmti10': None,
        'msam10': None,
        'msbm10': None,
        'eufm10': None,
        'cmtt10': None,
        'rsfs10': None,
        'cmss10': None,
        'cmssbx10': None,
        'cmssi10': None,
    }

    font_name_to_tfm = {}

    for font_name in fonts:
        font_basename = font_name.split('.')[0]
        font_path = find_font_path(font_name)
        font_name_to_tfm[font_basename] = parse_tfm.read_tfm_file(font_path)

    families = collections.defaultdict(dict)

    for family, chars in mapping.items():
        for char, char_data in chars.items():
            char_num = int(char)

            font = char_data['font']
            tex_char_num = int(char_data['char'])
            yshift = float(char_data['yshift'])

            if family == "Script-Regular":
                tfm_char = font_name_to_tfm[font].get_char_metrics(tex_char_num,
                                                                   fix_rsfs=True)
            else:
                tfm_char = font_name_to_tfm[font].get_char_metrics(tex_char_num)

            height = round(tfm_char.height + yshift / 1000.0, 5)
            depth = round(tfm_char.depth - yshift / 1000.0, 5)
            italic = round(tfm_char.italic_correction, 5)
            width = round(tfm_char.width, 5)

            skewkern = 0.0
            if (font_skewchar[font] and
                    font_skewchar[font] in tfm_char.kern_table):
                skewkern = round(
                    tfm_char.kern_table[font_skewchar[font]], 5)

            families[family][char_num] = {
                'height': height,
                'depth': depth,
                'italic': italic,
                'skew': skewkern,
                'width': width
            }

    sys.stdout.write(
        json.dumps(families, separators=(',', ':'), sort_keys=True))

if __name__ == '__main__':
    main()
JxI#!/usr/bin/env python3

from fontTools.ttLib import TTFont
import sys
import json

# map of characters to extract
metrics_to_extract = {
    # Font name
    "AMS-Regular": {
        u"\u21e2": None,  # \dashrightarrow
        u"\u21e0": None,  # \dashleftarrow
    },
    "Main-Regular": {
        # Skew and italic metrics can't be easily parsed from the TTF. Instead,
        # we map each character to a "base character", which is a character
        # from the same font with correct italic and skew metrics. A character
        # maps to None if it doesn't have a base.

        #u"\u2209": None,  # \notin
        #u"\u2260": None,  # \neq
        u"\u2245": None,  # \cong
        u"\u2026": None,  # \ldots
        u"\u22ef": None,  # \cdots
        u"\u22f1": None,  # \ddots
        u"\u22ee": None,  # \vdots
        u"\u22ee": None,  # \vdots
        u"\u22a8": None,  # \models
        u"\u22c8": None,  # \bowtie
        u"\u2250": None,  # \doteq
        u"\u23b0": None,  # \lmoustache
        u"\u23b1": None,  # \rmoustache
        u"\u27ee": None,  # \lgroup
        u"\u27ef": None,  # \rgroup
        u"\u27f5": None,  # \longleftarrow
        u"\u27f8": None,  # \Longleftarrow
        u"\u27f6": None,  # \longrightarrow
        u"\u27f9": None,  # \Longrightarrow
        u"\u27f7": None,  # \longleftrightarrow
        u"\u27fa": None,  # \Longleftrightarrow
        u"\u21a6": None,  # \mapsto
        u"\u27fc": None,  # \longmapsto
        u"\u21a9": None,  # \hookleftarrow
        u"\u21aa": None,  # \hookrightarrow
        u"\u21cc": None,  # \rightleftharpoons
    },
    "Main-Bold": {
        u"\u2245": None,  # \cong
    },
    "Size1-Regular": {
        u"\u222c": u"\u222b",  # \iint, based on \int
        u"\u222d": u"\u222b",  # \iiint, based on \int
    },
    "Size2-Regular": {
        u"\u222c": u"\u222b",  # \iint, based on \int
        u"\u222d": u"\u222b",  # \iiint, based on \int
    },
}


def main():
    start_json = json.load(sys.stdin)

    for font in start_json:
        fontInfo = TTFont("../../fonts/KaTeX_" + font + ".ttf")
        glyf = fontInfo["glyf"]
        widths = fontInfo.getGlyphSet()
        unitsPerEm = float(fontInfo["head"].unitsPerEm)

        # We keep ALL Unicode cmaps, not just fontInfo["cmap"].getcmap(3, 1).
        # This is playing it extra safe, since it reports inconsistencies.
        # Platform 0 is Unicode, platform 3 is Windows. For platform 3,
        # encoding 1 is UCS-2 and encoding 10 is UCS-4.
        cmap = [t.cmap for t in fontInfo["cmap"].tables
                if (t.platformID == 0)
                or (t.platformID == 3 and t.platEncID in (1, 10))]

        chars = metrics_to_extract.get(font, {})
        chars[u"\u0020"] = None  # space
        chars[u"\u00a0"] = None  # nbsp

        for char, base_char in chars.items():
            code = ord(char)
            names = set(t.get(code) for t in cmap)
            if not names:
                sys.stderr.write(
                    "Codepoint {} of font {} maps to no name\n"
                    .format(code, font))
                continue
            if len(names) != 1:
                sys.stderr.write(
                    "Codepoint {} of font {} maps to multiple names: {}\n"
                    .format(code, font, ", ".join(sorted(names))))
                continue
            name = names.pop()

            height = depth = italic = skew = width = 0
            glyph = glyf[name]
            if glyph.numberOfContours:
                height = glyph.yMax / unitsPerEm
                depth = -glyph.yMin / unitsPerEm
            width = widths[name].width / unitsPerEm
            if base_char:
                base_char_str = str(ord(base_char))
                base_metrics = start_json[font][base_char_str]
                italic = base_metrics["italic"]
                skew = base_metrics["skew"]
                width = base_metrics["width"]

            start_json[font][str(code)] = {
                "height": height,
                "depth": depth,
                "italic": italic,
                "skew": skew,
                "width": width
            }

    sys.stdout.write(
        json.dumps(start_json, separators=(',', ':'), sort_keys=True))

if __name__ == "__main__":
    main()
tV1x#!/usr/bin/env python3

import sys
import json

props = ['depth', 'height', 'italic', 'skew']

if len(sys.argv) > 1:
    if sys.argv[1] == '--width':
        props.append('width')

data = json.load(sys.stdin)
sys.stdout.write(
  "// This file is GENERATED by buildMetrics.sh. DO NOT MODIFY.\n")
sep = "export default {\n    "
for font in sorted(data):
    sys.stdout.write(sep + json.dumps(font))
    sep = ": {\n        "
    for glyph in sorted(data[font], key=int):
        sys.stdout.write(sep + json.dumps(glyph) + ": ")

        values = [value if value != 0.0 else 0 for value in
                  [data[font][glyph][key] for key in props]]

        sys.stdout.write(json.dumps(values))
        sep = ",\n        "
    sep = ",\n    },\n    "
sys.stdout.write(",\n    },\n};\n")
PxO\#! /usr/bin/perl

# Adapted from the MathJax-dev repository file /fonts/OTF/TeX/makeFF under the
# Apache 2 license

# We use this file to recover the mapping from TeX fonts to KaTeX fonts, to
# accurately extract the metrics from the corresponding .tfm (TeX font metric)
# files

use JSON;

$map{cmr10} = {
  "Main-Regular" => [
    [0,1] => 0x393,         # \Gamma, \Delta
    2 => 0x398,             # \Theta
    3 => 0x39B,             # \Lambda
    4 => 0x39E,             # \Xi
    5 => 0x3A0,             # \Pi
    6 => 0x3A3,             # \Sigma
    [7,8] => 0x3A5,         # \Upsilon, \Phi
    [9,0xA] => 0x3A8,       # \Psi, \Omega

    0x10 => 0x131,          # \i
    0x11 => 0x237,          # \j
    0x12 => 0x2CB,          # \grave
    0x13 => 0x2CA,          # \acute
    0x14 => 0x2C7,          # \check
    0x15 => 0x2D8,          # \breve
    0x16 => 0x2C9,          # \bar
    0x17 => [0xB0,-125,0],  # \degree
    0x17 => 0x02DA,         # \r, ring above
    0x18 => 0xB8,           # \c, cedilla

    [0x21,0x2F] => 0x21,    # !, ", #, $, %, &, ', (, ), *, +, comma, -, ., /
    0x22 => 0x201D,         # "
    0x27 => 0x2019,         # '
    [0x30,0x39] => 0x30,    # 0-9
    [0x3A,0x3B] => 0x3A,    # :, ;
    0x3D => 0x3D,           # =
    [0x3F,0x40] => 0x3F,    # ?, @
    [0x41,0x5A] => 0x41,    # A-Z
    0x5B => 0x5B,           # [
    0x5C => 0x201C,         # ``
    [0x5D,0x5E] => 0x5D,    # ], ^
    0x5E => 0x2C6,          # \hat
    0x5F => 0x2D9,          # \dot
    0x60 => 0x2018,         # `
    [0x61,0x7A] => 0x61,    # a-z
    [0x7B,0x7C] => 0x2013,  # \endash, \emdash
    0x7B => [0x5F,0,-310],  # underline
    0x7D => 0x2DD,          # double acute
    0x7E => [0x7E,0,-350],  # ~
    0x7E => 0x2DC,          # \tilde
    0x7F => 0xA8,           # \ddot
    0x19 => 0xDF,           # sharp S
    0x1A => 0xE6,           # ae ligature
    0x1B => 0x153,          # oe ligature
    0x1C => 0xF8,           # o with slash
    0x1D => 0xC6,           # AE ligature
    0x1E => 0x152,          # OE ligature
    0x1F => 0xD8,           # O with slash
  ],
};

$map{cmmi10} = {
  "Math-Italic" => [
    [0,1] => 0x393,         # \Gamma, \Delta
    2 => 0x398,             # \Theta
    3 => 0x39B,             # \Lambda
    4 => 0x39E,             # \Xi
    5 => 0x3A0,             # \Pi
    6 => 0x3A3,             # \Sigma
    [7,8] => 0x3A5,         # \Upsilon, \Phi
    [9,0xA] => 0x3A8,       # \Psi, \Omega

    [0xB,0xE] => 0x3B1,     # \alpha, \beta, \gamma, \delta
    0xF => 0x3F5,           # \elpsilon
    [0x10,0x18] => 0x3B6,   # \zeta, \eta, \theta, \iota, \kappa, \lambda, \mu, \nu, \xi
    [0x19,0x1A] => 0x3C0,   # \pi, \rho
    [0x1B,0x1D] => 0x3C3,   # \sigma, \tau, \upsilon
    0x1E => 0x3D5,          # \phi
    [0x1F,0x21] => 0x3C7,   # \chi, \psi, \omega
    0x22 => 0x3B5,          # \varepsilon
    0x23 => 0x3D1,          # \vartheta
    0x24 => 0x3D6,          # \varpi
    0x25 => 0x3F1,          # \varrho
    0x26 => 0x3C2,          # \varsigma
    0x27 => 0x3C6,          # \varphi

    [0x30,0x39] => 0x30,    # Oldstyle 0-9
    [0x41,0x5A] => 0x41,    # A-Z
    [0x61,0x7A] => 0x61,    # a - z

    0x6F => 0x3BF,          # omicron
    0x7B => 0xE131,         # \imath (PUA)
    0x7C => 0xE237,         # \jmath (PUA)
  ],

  "Main-Regular" => [
    0x28 => 0x21BC,         # \leftharpoonup
    0x29 => 0x21BD,         # \leftharpoondown
    0x2A => 0x21C0,         # \rightharpoonup
    0x2B => 0x21C1,         # \rightharpoondown

    0x2E => 0x25B9,         # \triangleright
    0x2F => 0x25C3,         # \triangleleft

    0x3C => 0x3C,           # <
    0x3D => 0x2215,         # /
    0x3E => 0x3E,           # >
    0x3F => 0x22C6,         # \star
    0x40 => 0x2202,         # \partial

    [0x5B,0x5D] => 0x266D,  # \flat, \natural, \sharp
    0x5E => 0x2323,         # \smile
    0x5F => 0x2322,         # \frown
    0x60 => 0x2113,         # \ell

    0x7D => 0x2118,         # \wp
    0x7E => [0x20D7,-653,0],# \vec
  ],
};

$map{cmsy10} = {
  "Main-Regular" => [
    0 => 0x2212,            # -
    1 => 0x22C5,            # \cdot
    2 => 0xD7,              # \times
    3 => 0x2217,            # \ast
    4 => 0xF7,              # \div
    5 => 0x22C4,            # \diamond
    6 => 0xB1,              # \pm
    7 => 0x2213,            # \mp
    [8,0xC] => 0x2295,      # \oplus, \ominus, \otimes, \oslash, \odot
    0xD => 0x25EF,          # \bigcirc
    [0xE,0xF] => 0x2218,    # \circ, \bullet

    0x10 => 0x224D,         # \asymp
    0x11 => 0x2261,         # \equiv
    [0x12,0x13] => 0x2286,  # \subseteq, \supseteq
    [0x14,0x15] => 0x2264,  # \leq, \geq
    [0x16,0x17] => 0x2AAF,  # \preceq, \succeq
    0x18 => 0x223C,         # \sim
    0x19 => 0x2248,         # \approx
    [0x1A,0x1B] => 0x2282,  # \subset, \supset
    [0x1C,0x1D] => 0x226A,  # \ll, \gg
    [0x1E,0x1F] => 0x227A,  # \prec, \succ

    0x20 => 0x2190,         # \leftarrow
    0x21 => 0x2192,         # \rightarrow
    0x22 => 0x2191,         # \uparrow
    0x23 => 0x2193,         # \downarrow
    0x24 => 0x2194,         # \leftrightarrow
    0x25 => 0x2197,         # \nearrow
    0x26 => 0x2198,         # \searrow
    0x27 => 0x2243,         # \simeq

    0x28 => 0x21D0,         # \Leftarrow
    0x29 => 0x21D2,         # \Rightarrow
    0x2A => 0x21D1,         # \Uparrow
    0x2B => 0x21D3,         # \Downarrow
    0x2C => 0x21D4,         # \Leftrightarrow
    0x2D => 0x2196,         # \nwarrow
    0x2E => 0x2199,         # \swarrow
    0x2F => 0x221D,         # \propto

    0x30 => 0x2032,         # \prime
    0x31 => 0x221E,         # \infty
    0x32 => 0x2208,         # \in
    0x33 => 0x220B,         # \ni
    0x34 => 0x25B3,         # \bigtriangleup and \triangle
    0x35 => 0x25BD,         # \bigtriangledown
    0x36 => 0xE020,         # \not

    0x38 => 0x2200,         # \forall
    0x39 => 0x2203,         # \exists
    0x3A => 0xAC,           # \neg
    0x3B => 0x2205,         # \emptyset
    0x3C => 0x211C,         # \Re
    0x3D => 0x2111,         # \Im
    0x3E => 0x22A4,         # \top
    0x3F => 0x22A5,         # \bot

    0x40 => 0x2135,         # \aleph

    0x5B => 0x222A,         # \cup
    0x5C => 0x2229,         # \cap
    0x5D => 0x228E,         # \uplus
    [0x5E,0x5F] => 0x2227,  # \wedge, \vee

    [0x60,0x61] => 0x22A2,  # \vdash, \dashv
    [0x62,0x63] => 0x230A,  # \lfloor, \rfloor
    [0x64,0x65] => 0x2308,  # \lceil, \rceil
    0x66 => 0x7B,           # {
    0x67 => 0x7D,           # }
    [0x68,0x69] => 0x27E8,  # \langle, \rangle
    0x6A => 0x7C,           # |
    0x6A => 0x2223,         # \vert
    0x6B => 0x2225,         # \Vert
    0x6C => 0x2195,         # \updownarrow
    0x6D => 0x21D5,         # \Updownarrow
    0x6E => 0x5C,           # \backslash
    0x6E => 0x2216,         # \setminus
    0x6F => 0x2240,         # \wr

    0x70 => [0x221A,0,760], # \surd    ### adjust position so font doesn't have a large depth
    0x71 => 0x2A3F,         # \amalg
    0x72 => 0x2207,         # \nabla
    0x73 => 0x222B,         # \int
    0x74 => 0x2294,         # \sqcup
    0x75 => 0x2293,         # \sqcap
    [0x76,0x77] => 0x2291,  # \sqsubseteq, \sqsupseteq
    0x78 => 0xA7,           # \S
    [0x79,0x7A] => 0x2020,  # \dagger, \ddagger
    0x7B => 0xB6,           # \P
    0x7C => 0x2663,         # \clubsuit
    0x7D => 0x2662,         # \diamondsuit
    0x7E => 0x2661,         # \heartsuit
    0x7F => 0x2660,         # \spadesuit
  ],

  "Caligraphic-Regular" => [
    [0x41,0x5A] => 0x41,    # A-Z
  ],
};

$map{cmex10} = {
  "Size1" => [
    0 => [0x28,0,810],      # (
    1 => [0x29,0,810],      # )
    2 => [0x5B,0,810],      # [
    3 => [0x5D,0,810],      # ]
    4 => [0x230A,0,810],    # \lfloor
    5 => [0x230B,0,810],    # \rfloor
    6 => [0x2308,0,810],    # \lceil
    7 => [0x2309,0,810],    # \rceil
    8 => [0x7B,0,810],      # {
    9 => [0x7D,0,810],      # }
    0xA => [0x27E8,0,810],  # \langle
    0xB => [0x27E9,0,810],  # \rangle
    0xC => [0x2223,0,606],  # \vert
    0xD => [0x2225,0,606],  # \Vert
    0xE => [0x2F,0,810],    # /
    0xF => [0x5C,0,810],    # \

    0x46 => [0x2A06,0,750], # \bigsqcup
    0x48 => [0x222E,0,805], # \oint
    0x4A => [0x2A00,0,750], # \bigodot
    0x4C => [0x2A01,0,750], # \bigoplus
    0x4E => [0x2A02,0,750], # \bigotimes

    0x50 => [0x2211,0,750], # \sum
    0x51 => [0x220F,0,750], # \prod
    0x52 => [0x222B,0,805], # \int
    0x53 => [0x22C3,0,750], # \bigcup
    0x54 => [0x22C2,0,750], # \bigcap
    0x55 => [0x2A04,0,750], # \biguplus
    0x56 => [0x22C0,0,750], # \bigwedge
    0x57 => [0x22C1,0,750], # \bigvee

    0x60 => [0x2210,0,750], # \coprod
    0x62 => 0x2C6,          # \widehat
    0x62 => [0x302,-556,0], # \widehat (combining)
    0x65 => 0x2DC,          # \widetilde
    0x65 => [0x303,-556,0], # \widetilde (combining)

    0x70 => [0x221A,0,810], # surd
    0x3F => [0x23D0,0,601], # arrow extension
    0x77 => [0x2016,0,601], # Arrow extension (non-standard)
    0x78 => [0x2191,0,600], # uparrow top
    0x79 => [0x2193,0,600], # downarrow bottom
    0x7E => [0x21D1,0,600], # Uparrow top
    0x7F => [0x21D3,0,600], # Downarrow bottom
  ],

  "Size2" => [
    0x10 => [0x28,0,1110],  # (
    0x11 => [0x29,0,1110],  # )
    0x2E => [0x2F,0,1110],  # /
    0x2F => [0x5C,0,1110],  # \
    0x44 => [0x27E8,0,1110],# \langle
    0x45 => [0x27E9,0,1110],# \rangle

    0x47 => [0x2A06,0,950], # \bigsqcup
    0x49 => [0x222E,0,1360],# \oint
    0x4B => [0x2A00,0,950], # \bigodot
    0x4D => [0x2A01,0,950], # \bigoplus
    0x4F => [0x2A02,0,950], # \bigotimes

    0x58 => [0x2211,0,950], # \sum
    0x59 => [0x220F,0,950], # \prod
    0x5A => [0x222B,0,1360],# \int
    0x5B => [0x22C3,0,950], # \bigcup
    0x5C => [0x22C2,0,950], # \bigcap
    0x5D => [0x2A04,0,950], # \biguplus
    0x5E => [0x22C0,0,950], # \bigwedge
    0x5F => [0x22C1,0,950], # \bigvee
    0x61 => [0x2210,0,950], # \coprod

    0x63 => 0x2C6,          # \widehat
    0x63 => [0x302,-1000,0],# \widehat (combining)
    0x66 => 0x2DC,          # \widetilde
    0x66 => [0x303,-1000,0],# \widetilde (combining)

    0x68 => [0x5B,0,1110],  # [
    0x69 => [0x5D,0,1110],  # ]
    0x6A => [0x230A,0,1110],# \lfloor
    0x6B => [0x230B,0,1110],# \rfloor
    0x6C => [0x2308,0,1110],# \lceil
    0x6D => [0x2309,0,1110],# \rceil
    0x6E => [0x7B,0,1110],  # {
    0x6F => [0x7D,0,1110],  # }
    0x71 => [0x221A,0,1110],# surd
  ],

  "Size3" => [
    0x12 => [0x28,0,1410],  # (
    0x13 => [0x29,0,1410],  # )
    0x14 => [0x5B,0,1410],  # [
    0x15 => [0x5D,0,1410],  # ]
    0x16 => [0x230A,0,1410],# \lfloor
    0x17 => [0x230B,0,1410],# \rfloor
    0x18 => [0x2308,0,1410],# \lceil
    0x19 => [0x2309,0,1410],# \rceil
    0x1A => [0x7B,0,1410],  # {
    0x1B => [0x7D,0,1410],  # }
    0x1C => [0x27E8,0,1410],# \langle
    0x1D => [0x27E9,0,1410],# \rangle
    0x1E => [0x2F,0,1410],  # /
    0x1F => [0x5C,0,1410],  # \
    0x64 => 0x2C6,          # \widehat
    0x64 => [0x302,-1444,0],# \widehat (combining)
    0x67 => 0x2DC,          # \widetilde
    0x67 => [0x303,-1444,0],# \widetilde (combining)
    0x72 => [0x221A,0,1410],# surd
  ],

  "Size4" => [
    0x20 => [0x28,0,1710],  # (
    0x21 => [0x29,0,1710],  # )
    0x22 => [0x5B,0,1710],  # [
    0x23 => [0x5D,0,1710],  # ]
    0x24 => [0x230A,0,1710],# \lfloor
    0x25 => [0x230B,0,1710],# \rfloor
    0x26 => [0x2308,0,1710],# \lceil
    0x27 => [0x2309,0,1710],# \rceil
    0x28 => [0x7B,0,1710],  # {
    0x29 => [0x7D,0,1710],  # }
    0x2A => [0x27E8,0,1710],# \langle
    0x2B => [0x27E9,0,1710],# \rangle
    0x2C => [0x2F,0,1710],  # /
    0x2D => [0x5C,0,1710],  # \
    0x73 => [0x221A,0,1710],# surd

    0x30 => [0x239B,0,1115],# left paren upper hook
    0x31 => [0x239E,0,1115],# right paren upper hook
    0x32 => [0x23A1,0,1115],# left square bracket upper corner
    0x33 => [0x23A4,0,1115],# right square bracket upper corner
    0x34 => [0x23A3,0,1115],# left square bracket lower corner
    0x35 => [0x23A6,0,1115],# right square bracket lower hook
    0x36 => [0x23A2,0,601], # left square bracket extension
    0x37 => [0x23A5,0,601], # right square bracket extension
    0x38 => [0x23A7,0,900], # left curly brace upper hook
    0x39 => [0x23AB,0,900], # right curly brace upper hook
    0x3A => 0x23A9,         # left curly brace lower hook
    0x3B => 0x23AD,         # right curly brace lower hook
    0x3C => [0x23A8,0,1150],# left curly brace middle
    0x3D => [0x23AC,0,1150],# right curly brace middle
    0x3E => [0x23AA,0,300], # curly brace extension

    0x40 => [0x239D,0,1115],# left paren lower hook
    0x41 => [0x23A0,0,1115],# right paren lower hook
    0x42 => [0x239C,0,600], # left paren extension
    0x43 => [0x239F,0,600], # right paren extension

    0x74 => [0x23B7,0,915], # radical bottom
    0x75 => [0xE000,0,605], # radical extension (PUA)
    0x76 => [0xE001,0,565], # radical top (PUA)
    [0x7A,0x7D] => 0xE150,  # \braceld, \bracerd, \bracelu, \braceru (PUA)
  ],
};

$map{cmti10} = {
  "Main-Italic" => [
    [0,1] => 0x393,         # \Gamma, \Delta
    2 => 0x398,             # \Theta
    3 => 0x39B,             # \Lambda
    4 => 0x39E,             # \Xi
    5 => 0x3A0,             # \Pi
    6 => 0x3A3,             # \Sigma
    [7,8] => 0x3A5,         # \Upsilon, \Phi
    [9,0xA] => 0x3A8,       # \Psi, \Omega

    0x12 => 0x2CB,          # \grave
    0x13 => 0x2CA,          # \acute
    0x14 => 0x2C7,          # \check
    0x15 => 0x2D8,          # \breve
    0x16 => 0x2C9,          # \bar
    0x17 => [0xB0,-160,0],  # \degree
    0x17 => 0x02DA,         # \r, ring above
    0x18 => 0xB8,           # \c, cedilla

    [0x21,0x23] => 0x21,    # !, ", #,
    0x22 => 0x201D,         # "
    [0x25,0x2F] => 0x25,    # %, &, ', (, ), *, +, comma, -, ., /
    0x27 => 0x2019,         # '
    [0x30,0x39] => 0x30,    # 0-9
    [0x3A,0x3B] => 0x3A,    # :, ;
    0x3D => 0x3D,           # =
    [0x3F,0x40] => 0x3F,    # ?, @
    [0x41,0x5A] => 0x41,    # A-Z
    0x5B => 0x5B,           # [
    0x5C => 0x201C,         # ``
    [0x5D,0x5E] => 0x5D,    # ], ^
    0x5E => 0x2C6,          # \hat
    0x5F => 0x2D9,          # \dot
    0x60 => 0x2018,         # `
    [0x61,0x7A] => 0x61,    # a-z
    [0x7B,0x7C] => 0x2013,  # \endash, \emdash
    0x7B => [0x5F,0,-310],  # underline
    0x7D => 0x2DD,          # double acute
    0x7E => [0x7E,0,-350],  # ~
    0x7E => 0x2DC,          # \tilde
    0x7F => 0xA8,           # \ddot
    0x19 => 0xDF,           # sharp S
    0x1A => 0xE6,           # ae ligature
    0x1B => 0x153,          # oe ligature
    0x1C => 0xF8,           # o with slash
    0x1D => 0xC6,           # AE ligature
    0x1E => 0x152,          # OE ligature
    0x1F => 0xD8,           # O with slash
  ],

  "Main-Regular" => [
    0x24 => 0xA3,           # pound sign
  ],
};

$map{cmbx10} = {
  "Main-Bold" => [
    [0,1] => 0x393,         # \Gamma, \Delta
    2 => 0x398,             # \Theta
    3 => 0x39B,             # \Lambda
    4 => 0x39E,             # \Xi
    5 => 0x3A0,             # \Pi
    6 => 0x3A3,             # \Sigma
    [7,8] => 0x3A5,         # \Upsilon, \Phi
    [9,0xA] => 0x3A8,       # \Psi, \Omega

    0x10 => 0x131,          # \i
    0x11 => 0x237,          # \j
    0x12 => 0x2CB,          # \grave
    0x13 => 0x2CA,          # \acute
    0x14 => 0x2C7,          # \check
    0x15 => 0x2D8,          # \breve
    0x16 => 0x2C9,          # \bar
    0x17 => [0xB0,-147,0],  # \degree
    0x17 => 0x02DA,         # \r, ring above
    0x18 => 0xB8,           # \c, cedilla

    [0x21,0x2F] => 0x21,    # !, ", #, $, %, &, ', (, ), *, +, comma, -, ., /
    0x22 => 0x201D,         # "
    0x27 => 0x2019,         # '
    [0x30,0x39] => 0x30,    # 0-9
    [0x3A,0x3B] => 0x3A,    # :, ;
    0x3D => 0x3D,           # =
    [0x3F,0x40] => 0x3F,    # ?, @
    [0x41,0x5A] => 0x41,    # A-Z
    0x5B => 0x5B,           # [
    0x5C => 0x201C,         # ``
    [0x5D,0x5E] => 0x5D,    # ], ^
    0x5E => 0x2C6,          # \hat
    0x5F => 0x2D9,          # \dot
    0x60 => 0x2018,         # `
    [0x61,0x7A] => 0x61,    # a-z
    [0x7B,0x7C] => 0x2013,  # \endash, \emdash
    0x7B => [0x5F,0,-310],  # underline
    0x7D => 0x2DD,          # double acute
    0x7E => [0x7E,0,-350],  # ~
    0x7E => 0x2DC,          # \tilde
    0x7F => 0xA8,           # \ddot
    0x19 => 0xDF,           # sharp S
    0x1A => 0xE6,           # ae ligature
    0x1B => 0x153,          # oe ligature
    0x1C => 0xF8,           # o with slash
    0x1D => 0xC6,           # AE ligature
    0x1E => 0x152,          # OE ligature
    0x1F => 0xD8,           # O with slash
  ],
};

$map{cmbxti10} = {
  "Main-BoldItalic" => [
    [0,1] => 0x393,         # \Gamma, \Delta
    2 => 0x398,             # \Theta
    3 => 0x39B,             # \Lambda
    4 => 0x39E,             # \Xi
    5 => 0x3A0,             # \Pi
    6 => 0x3A3,             # \Sigma
    [7,8] => 0x3A5,         # \Upsilon, \Phi
    [9,0xA] => 0x3A8,       # \Psi, \Omega

    0x10 => 0x131,          # \i
    0x11 => 0x237,          # \j
    0x12 => 0x2CB,          # \grave
    0x13 => 0x2CA,          # \acute
    0x14 => 0x2C7,          # \check
    0x15 => 0x2D8,          # \breve
    0x16 => 0x2C9,          # \bar
    0x17 => [0xB0,-160,0],  # \degree
    0x17 => 0x02DA,         # \r, ring above
    0x18 => 0xB8,           # \c, cedilla

    [0x21,0x23] => 0x21,    # !, ", #,
    0x22 => 0x201D,         # "
    [0x25,0x2F] => 0x25,    # %, &, ', (, ), *, +, comma, -, ., /
    0x27 => 0x2019,         # '
    [0x30,0x39] => 0x30,    # 0-9
    [0x3A,0x3B] => 0x3A,    # :, ;
    0x3D => 0x3D,           # =
    [0x3F,0x40] => 0x3F,    # ?, @
    [0x41,0x5A] => 0x41,    # A-Z
    0x5B => 0x5B,           # [
    0x5C => 0x201C,         # ``
    [0x5D,0x5E] => 0x5D,    # ], ^
    0x5E => 0x2C6,          # \hat
    0x5F => 0x2D9,          # \dot
    0x60 => 0x2018,         # `
    [0x61,0x7A] => 0x61,    # a-z
    [0x7B,0x7C] => 0x2013,  # \endash, \emdash
    0x7B => [0x5F,0,-310],  # underline
    0x7D => 0x2DD,          # double acute
    0x7E => [0x7E,0,-350],  # ~
    0x7E => 0x2DC,          # \tilde
    0x7F => 0xA8,           # \ddot
    0x19 => 0xDF,           # sharp S
    0x1A => 0xE6,           # ae ligature
    0x1B => 0x153,          # oe ligature
    0x1C => 0xF8,           # o with slash
    0x1D => 0xC6,           # AE ligature
    0x1E => 0x152,          # OE ligature
    0x1F => 0xD8,           # O with slash
  ],

  "Main-Bold" => [
    0x24 => 0xA3,           # pound sign
  ],
};

$map{cmmib10} = {
  "Math-BoldItalic" => [
    [0,1] => 0x393,         # \Gamma, \Delta
    2 => 0x398,             # \Theta
    3 => 0x39B,             # \Lambda
    4 => 0x39E,             # \Xi
    5 => 0x3A0,             # \Pi
    6 => 0x3A3,             # \Sigma
    [7,8] => 0x3A5,         # \Upsilon, \Phi
    [9,0xA] => 0x3A8,       # \Psi, \Omega

    [0xB,0xE] => 0x3B1,     # \alpha, \beta, \gamma, \delta
    0xF => 0x3F5,           # \elpsilon
    [0x10,0x18] => 0x3B6,   # \zeta, \eta, \theta, \iota, \kappa, \lambda, \mu, \nu, \xi
    [0x19,0x1A] => 0x3C0,   # \pi, \rho
    [0x1B,0x1D] => 0x3C3,   # \sigma, \tau, \upsilon
    0x1E => 0x3D5,          # \phi
    [0x1F,0x21] => 0x3C7,   # \chi, \psi, \omega
    0x22 => 0x3B5,          # \varepsilon
    0x23 => 0x3D1,          # \vartheta
    0x24 => 0x3D6,          # \varpi
    0x25 => 0x3F1,          # \varrho
    0x26 => 0x3C2,          # \varsigma
    0x27 => 0x3C6,          # \varphi

    [0x41,0x5A] => 0x41,    # A-Z
    [0x61,0x7A] => 0x61,    # a - z
    [0x30,0x39] => 0x30,    # Oldstyle 0-9

    0x6F => 0x3BF,          # omicron
    0x7B => 0xE131,         # \imath (PUA)
    0x7C => 0xE237,         # \jmath (PUA)
  ],

  "Main-Bold" => [
    0x28 => 0x21BC,         # \leftharpoonup
    0x29 => 0x21BD,         # \leftharpoondown
    0x2A => 0x21C0,         # \rightharpoonup
    0x2B => 0x21C1,         # \rightharpoondown

    0x2E => 0x25B9,         # \triangleright
    0x2F => 0x25C3,         # \triangleleft

    0x3C => 0x3C,           # <
    0x3D => 0x2215,         # /
    0x3E => 0x3E,           # >
    0x3F => 0x22C6,         # \star
    0x40 => 0x2202,         # \partial

    [0x5B,0x5D] => 0x266D,  # \flat, \natural, \sharp
    0x5E => 0x2323,         # \smile
    0x5F => 0x2322,         # \frown
    0x60 => 0x2113,         # \ell
    0x68 => 0x210F,         # \hbar (bar added below)

    0x7D => 0x2118,         # \wp
    0x7E => [0x20D7,-729,0],# \vec
  ],
};

$map{cmbsy10} = {
  "Main-Bold" => [
    0 => 0x2212,            # -
    1 => 0x22C5,            # \cdot
    2 => 0xD7,              # \times
    3 => 0x2217,            # \ast
    4 => 0xF7,              # \div
    5 => 0x22C4,            # \diamond
    6 => 0xB1,              # \pm
    7 => 0x2213,            # \mp
    [8,0xC] => 0x2295,      # \oplus, \ominus, \otimes, \oslash, \odot
    0xD => 0x25EF,          # \bigcirc
    [0xE,0xF] => 0x2218,    # \circ, \bullet

    0x10 => 0x224D,         # \asymp
    0x11 => 0x2261,         # \equiv
    [0x12,0x13] => 0x2286,  # \subseteq, \supseteq
    [0x14,0x15] => 0x2264,  # \leq, \geq
    [0x16,0x17] => 0x2AAF,  # \preceq, \succeq
    0x18 => 0x223C,         # \sim
    0x19 => 0x2248,         # \approx
    [0x1A,0x1B] => 0x2282,  # \subset, \supset
    [0x1C,0x1D] => 0x226A,  # \ll, \gg
    [0x1E,0x1F] => 0x227A,  # \prec, \succ

    0x20 => 0x2190,         # \leftarrow
    0x21 => 0x2192,         # \rightarrow
    0x22 => 0x2191,         # \uparrow
    0x23 => 0x2193,         # \downarrow
    0x24 => 0x2194,         # \leftrightarrow
    0x25 => 0x2197,         # \nearrow
    0x26 => 0x2198,         # \searrow
    0x27 => 0x2243,         # \simeq

    0x28 => 0x21D0,         # \Leftarrow
    0x29 => 0x21D2,         # \Rightarrow
    0x2A => 0x21D1,         # \Uparrow
    0x2B => 0x21D3,         # \Downarrow
    0x2C => 0x21D4,         # \Leftrightarrow
    0x2D => 0x2196,         # \nwarrow
    0x2E => 0x2199,         # \swarrow
    0x2F => 0x221D,         # \propto

    0x30 => 0x2032,         # \prime
    0x31 => 0x221E,         # \infty
    0x32 => 0x2208,         # \in
    0x33 => 0x220B,         # \ni
    0x34 => 0x25B3,         # \bigtriangleup and \triangle
    0x35 => 0x25BD,         # \bigtriangledown
    0x36 => 0xE020,         # \not

    0x38 => 0x2200,         # \forall
    0x39 => 0x2203,         # \exists
    0x3A => 0xAC,           # \neg
    0x3B => 0x2205,         # \emptyset
    0x3C => 0x211C,         # \Re
    0x3D => 0x2111,         # \Im
    0x3E => 0x22A4,         # \top
    0x3F => 0x22A5,         # \bot

    0x40 => 0x2135,         # \aleph

    0x5B => 0x222A,         # \cup
    0x5C => 0x2229,         # \cap
    0x5D => 0x228E,         # \uplus
    [0x5E,0x5F] => 0x2227,  # \wedge, \vee

    [0x60,0x61] => 0x22A2,  # \vdash, \dashv
    [0x62,0x63] => 0x230A,  # \lfloor, \rfloor
    [0x64,0x65] => 0x2308,  # \lceil, \rceil
    0x66 => 0x7B,           # {
    0x67 => 0x7D,           # }
    [0x68,0x69] => 0x27E8,  # \langle, \rangle
    0x6A => 0x7C,           # |
    0x6A => 0x2223,         # \vert
    0x6B => 0x2225,         # \Vert
    0x6C => 0x2195,         # \updownarrow
    0x6D => 0x21D5,         # \Updownarrow
    0x6E => 0x5C,           # \backslash
    0x6E => 0x2216,         # \setminus
    0x6F => 0x2240,         # \wr

    0x70 => [0x221A,0,760], # \surd    ### adjust position so font doesn't have a large depth
    0x71 => 0x2A3F,         # \amalg
    0x72 => 0x2207,         # \nabla
    0x73 => 0x222B,         # \int
    0x74 => 0x2294,         # \sqcup
    0x75 => 0x2293,         # \sqcap
    [0x76,0x77] => 0x2291,  # \sqsubseteq, \sqsupseteq

    [0x79,0x7A] => 0x2020,  # \dagger, \ddagger

    0x7C => 0x2663,         # \clubsuit
    0x7D => 0x2662,         # \diamondsuit
    0x7E => 0x2661,         # \heartsuit
    0x7F => 0x2660,         # \spadesuit
  ],
};

$map{msam10} = {
  "Main-Regular" => [
    0x5C => 0x2220,         # \angle
  ],

  "Main-Bold" => [
    0x5C => 0x2220,         # \angle (emboldened below)
  ],

  "AMS" => [
    0x00 => 0x22A1,         # \boxdot
    0x01 => 0x229E,         # \boxplus
    0x02 => 0x22A0,         # \boxtimes
    0x03 => 0x25A1,         # \square
    0x04 => 0x25A0,         # \blacksquare
    0x05 => 0x22C5,         # \centerdot
    0x06 => 0x25CA,         # \lozenge
    0x07 => 0x29EB,         # \blacklozenge
    0x08 => 0x21BB,         # \circlearrowright
    0x09 => 0x21BA,         # \circlearrowleft
    0x0A => 0x21CC,         # \rightleftharpoons
    0x0B => 0x21CB,         # \leftrightharpoons
    0x0C => 0x229F,         # \boxminus
    0x0D => 0x22A9,         # \Vdash
    0x0E => 0x22AA,         # \Vvdash
    0x0F => 0x22A8,         # \vDash
    0x10 => 0x21A0,         # \twoheadrightarrow
    0x11 => 0x219E,         # \twoheadleftarrow
    0x12 => 0x21C7,         # \leftleftarrows
    0x13 => 0x21C9,         # \rightrightarrows
    0x14 => 0x21C8,         # \upuparrows
    0x15 => 0x21CA,         # \downdownarrows
    0x16 => 0x21BE,         # \upharpoonright
    0x17 => 0x21C2,         # \downharpoonright
    0x18 => 0x21BF,         # \upharpoonleft
    0x19 => 0x21C3,         # \downharpoonleft
    0x1A => 0x21A3,         # \rightarrowtail
    0x1B => 0x21A2,         # \leftarrowtail
    0x1C => 0x21C6,         # \leftrightarrows
    0x1D => 0x21C4,         # \rightleftarrows
    0x1E => 0x21B0,         # \Lsh
    0x1F => 0x21B1,         # \Rsh
    0x20 => 0x21DD,         # \rightsquigarrow
    0x21 => 0x21AD,         # \leftrightsquigarrow
    0x22 => 0x21AB,         # \looparrowleft
    0x23 => 0x21AC,         # \looparrowright
    0x24 => 0x2257,         # \circeq
    0x25 => 0x227F,         # \succsim
    0x26 => 0x2273,         # \gtrsim
    0x27 => 0x2A86,         # \gtrapprox
    0x28 => 0x22B8,         # \multimap
    0x29 => 0x2234,         # \therefore
    0x2A => 0x2235,         # \because
    0x2B => 0x2251,         # \doteqdot
    0x2C => 0x225C,         # \triangleq
    0x2D => 0x227E,         # \precsim
    0x2E => 0x2272,         # \lesssim
    0x2F => 0x2A85,         # \lessapprox
    0x30 => 0x2A95,         # \eqslantless
    0x31 => 0x2A96,         # \eqslantgtr
    0x32 => 0x22DE,         # \curlyeqprec
    0x33 => 0x22DF,         # \curlyeqsucc
    0x34 => 0x227C,         # \preccurlyeq
    0x35 => 0x2266,         # \leqq
    0x36 => 0x2A7D,         # \leqslant
    0x37 => 0x2276,         # \lessgtr
    0x38 => 0x2035,         # \backprime
    0x39 => 0x2212,         # dahsed arrow extension
    0x3A => 0x2253,         # \risingdotseq
    0x3B => 0x2252,         # \fallingdotseq
    0x3C => 0x227D,         # \succcurlyeq
    0x3D => 0x2267,         # \geqq
    0x3E => 0x2A7E,         # \geqslant
    0x3F => 0x2277,         # \gtrless
    0x40 => 0x228F,         # \sqsubset
    0x41 => 0x2290,         # \sqsupset
    0x42 => 0x22B3,         # \vartriangleright
    0x43 => 0x22B2,         # \vartriangleleft
    0x44 => 0x22B5,         # \trianglerighteq
    0x45 => 0x22B4,         # \trianglelefteq
    0x46 => 0x2605,         # \bigstar
    0x47 => 0x226C,         # \between
    0x48 => 0x25BC,         # \blacktriangledown
    0x49 => 0x25B6,         # \blacktriangleright
    0x4A => 0x25C0,         # \blacktriangleleft
    0x4B => 0x2192,         # rightarrow
    0x4C => 0x2190,         # leftarrow
    0x4D => 0x25B3,         # \vartriangle
    0x4E => 0x25B2,         # \blacktriangle
    0x4F => 0x25BD,         # \triangledown
    0x50 => 0x2256,         # \eqcirc
    0x51 => 0x22DA,         # \lesseqgtr
    0x52 => 0x22DB,         # \gtreqless
    0x53 => 0x2A8B,         # \lesseqqgtr
    0x54 => 0x2A8C,         # \gtreqqless
    0x55 => 0x00A5,         # yen
    0x56 => 0x21DB,         # \Rrightarrow
    0x57 => 0x21DA,         # \Lleftarrow
    0x58 => 0x2713,         # checkmark
    0x59 => 0x22BB,         # \veebar
    0x5A => 0x22BC,         # \barwedge
    0x5B => 0x2A5E,         # \doublebarwedge
    0x5C => 0x2220,         # \angle
    0x5D => 0x2221,         # \measuredangle
    0x5E => 0x2222,         # \sphericalangle
    0x5F => 0x221D,         # \varpropto
    0x60 => 0x2323,         # \smallsmile
    0x61 => 0x2322,         # \smallfrown
    0x62 => 0x22D0,         # \Subset
    0x63 => 0x22D1,         # \Supset
    0x64 => 0x22D3,         # \Cup
    0x65 => 0x22D2,         # \Cap
    0x66 => 0x22CF,         # \curlywedge
    0x67 => 0x22CE,         # \curlyvee
    0x68 => 0x22CB,         # \leftthreetimes
    0x69 => 0x22CC,         # \rightthreetimes
    0x6A => 0x2AC5,         # \subseteqq
    0x6B => 0x2AC6,         # \supseteqq
    0x6C => 0x224F,         # \bumpeq
    0x6D => 0x224E,         # \Bumpeq
    0x6E => 0x22D8,         # \lll
    0x6F => 0x22D9,         # \ggg
    0x70 => 0x250C,         # \ulcorner
    0x71 => 0x2510,         # \urcorner
    0x72 => 0x00AE,         # registered sign
    0x73 => 0x24C8,         # \circledS
    0x74 => 0x22D4,         # \pitchfork
    0x75 => 0x2214,         # \dotplus
    0x76 => 0x223D,         # \backsim
    0x77 => 0x22CD,         # \backsimeq
    0x78 => 0x2514,         # \llcorner
    0x79 => 0x2518,         # \lrcorner
    0x7A => 0x2720,         # maltese cross
    0x7B => 0x2201,         # \complement
    0x7C => 0x22BA,         # \intercal
    0x7D => 0x229A,         # \circledcirc
    0x7E => 0x229B,         # \circledast
    0x7F => 0x229D,         # \circleddash
  ],
};

$map{msbm10} = {
  "Size4" => [
    0x5B => 0x2C6,          # \widehat
    0x5B => [0x302,-1889,0],# \widehat (combining)
    0x5D => 0x2DC,          # \widetilde
    0x5D => [0x303,-1889,0],# \widetilde (combining)
  ],

  "Main-Regular" => [
    0x7E => 0x210F,         # \hbar
  ],

  "Main-Italic" => [
    0x7D => 0x210F,         # \hbar (with slant)
  ],

  "AMS" => [
    0x00 => 0xE00C,         # \lvertneqq
    0x01 => 0xE00D,         # \gvertneqq
    0x02 => 0x2270,         # \nleq
    0x03 => 0x2271,         # \ngeq
    0x04 => 0x226E,         # \nless
    0x05 => 0x226F,         # \ngtr
    0x06 => 0x2280,         # \nprec
    0x07 => 0x2281,         # \nsucc
    0x08 => 0x2268,         # \lneqq
    0x09 => 0x2269,         # \gneqq
    0x0A => 0xE010,         # \nleqslant
    0x0B => 0xE00F,         # \ngeqslant
    0x0C => 0x2A87,         # \lneq
    0x0D => 0x2A88,         # \gneq
    0x0E => 0x22E0,         # \npreceq
    0x0F => 0x22E1,         # \nsucceq
    0x10 => 0x22E8,         # \precnsim
    0x11 => 0x22E9,         # \succnsim
    0x12 => 0x22E6,         # \lnsim
    0x13 => 0x22E7,         # \gnsim
    0x14 => 0xE011,         # \nleqq
    0x15 => 0xE00E,         # \ngeqq
    0x16 => 0x2AB5,         # \precneqq
    0x17 => 0x2AB6,         # \succneqq
    0x18 => 0x2AB9,         # \precnapprox
    0x19 => 0x2ABA,         # \succnapprox
    0x1A => 0x2A89,         # \lnapprox
    0x1B => 0x2A8A,         # \gnapprox
    0x1C => 0x2241,         # \nsim
    0x1D => 0x2246,         # \ncong
    0x1E => 0x2571,         # \diagup
    0x1F => 0x2572,         # \diagdown
    0x20 => 0xE01A,         # \varsubsetneq
    0x21 => 0xE01B,         # \varsupsetneq
    0x22 => 0xE016,         # \nsubseteqq
    0x23 => 0xE018,         # \nsupseteqq
    0x24 => 0x2ACB,         # \subsetneqq
    0x25 => 0x2ACC,         # \supsetneqq
    0x26 => 0xE017,         # \varsubsetneqq
    0x27 => 0xE019,         # \varsupsetneqq
    0x28 => 0x228A,         # \subsetneq
    0x29 => 0x228B,         # \supsetneq
    0x2A => 0x2288,         # \nsubseteq
    0x2B => 0x2289,         # \nsupseteq
    0x2C => 0x2226,         # \nparallel
    0x2D => 0x2224,         # \nmid
    0x2E => 0xE006,         # \nshortmid
    0x2F => 0xE007,         # \nshortparallel
    0x30 => 0x22AC,         # \nvdash
    0x31 => 0x22AE,         # \nVdash
    0x32 => 0x22AD,         # \nvDash
    0x33 => 0x22AF,         # \nVDash
    0x34 => 0x22ED,         # \ntrianglerighteq
    0x35 => 0x22EC,         # \ntrianglelefteq
    0x36 => 0x22EA,         # \ntriangleleft
    0x37 => 0x22EB,         # \ntriangleright
    0x38 => 0x219A,         # \nleftarrow
    0x39 => 0x219B,         # \nrightarrow
    0x3A => 0x21CD,         # \nLeftarrow
    0x3B => 0x21CF,         # \nRightarrow
    0x3C => 0x21CE,         # \nLeftrightarrow
    0x3D => 0x21AE,         # \nleftrightarrow
    0x3E => 0x22C7,         # \divideontimes
    0x3F => 0x2205,         # \varnothing
    0x40 => 0x2204,         # \nexists

    [0x41,0x5A] => 0x41,    # A-Z
    0x5C => 0x2C6,          # \widehat
    0x5C => [0x302,-2333,0],# \widehat (combining)
    0x5E => 0x2DC,          # \widetilde
    0x5E => [0x303,-2333,0],# \widetilde (combining)

    0x60 => 0x2132,         # \Finv
    0x61 => 0x2141,         # \Game
    0x66 => 0x2127,         # \mho
    0x67 => 0x00F0,         # \eth
    0x68 => 0x2242,         # minus-tilde
    0x69 => 0x2136,         # \beth
    0x6A => 0x2137,         # \gimel
    0x6B => 0x2138,         # \daleth
    0x6C => 0x22D6,         # \lessdot
    0x6D => 0x22D7,         # \gtrdot
    0x6E => 0x22C9,         # \ltimes
    0x6F => 0x22CA,         # \rtimes
    0x70 => 0x2223,         # \shortmid
    0x71 => 0x2225,         # \shortparallel
    0x72 => 0x2216,         # \smallsetminus
    0x73 => 0x223C,         # \thicksim
    0x74 => 0x2248,         # \thickapprox
    0x75 => 0x224A,         # \approxeq
    0x76 => 0x2AB8,         # \succapprox
    0x77 => 0x2AB7,         # \precapprox
    0x78 => 0x21B6,         # \curvearrowleft
    0x79 => 0x21B7,         # \curvearrowright
    0x7A => 0x03DD,         # \digamma
    0x7B => 0x03F0,         # \varkappa
    0x7A => 0xE008,         # \digamma  (non-standard, for IE)
    0x7B => 0xE009,         # \varkappa (non-standard, for IE)
    0x7C => 0x006B,         # \Bbbk
    0x7D => 0x210F,         # \hslash
    0x7E => 0x0127,         # \hbar
    0x7F => 0x220D,         # \backepsilon
  ],
};

$map{eufm10} = {
  "Fraktur-Regular" => [
    [0,7] => 0xE300,        # variants
    0x12 => 0x2018,         # left quote
    0x13 => 0x2019,         # right quote
    0x21 => 0x21,           # !
    [0x26,0x2F] => 0x26,    # &, ', (, ), *, +, comma, -, ., /
    [0x30,0x39] => 0x30,    # 0-9
    [0x3A,0x3B] => 0x3A,    # :, ;
    0x3D => 0x3D,           # =
    0x3F => 0x3F,           # ?
    [0x41,0x5A] => 0x41,    # A-Z
    0x5B => 0x5B,           # [
    [0x5D,0x5E] => 0x5D,    # ], ^
    [0x61,0x7A] => 0x61,    # a-z
    0x7D => 0x22,           # "
  ],
};

$map{cmtt10} = {
  "Typewriter-Regular" => [
    [0,1] => 0x393,         # \Gamma, \Delta
    2 => 0x398,             # \Theta
    3 => 0x39B,             # \Lambda
    4 => 0x39E,             # \Xi
    5 => 0x3A0,             # \Pi
    6 => 0x3A3,             # \Sigma
    [7,8] => 0x3A5,         # \Upsilon, \Phi
    [9,0xA] => 0x3A8,       # \Psi, \Omega
    0xD => 0x2032,          # '

    0x10 => 0x131,          # \i
    0x11 => 0x237,          # \j
    0x12 => 0x2CB,          # \grave
    0x13 => 0x2CA,          # \acute
    0x14 => 0x2C7,          # \check
    0x15 => 0x2D8,          # \breve
    0x16 => 0x2C9,          # \bar
    0x17 => 0xB0,           # \degree
    0x17 => 0x02DA,         # \r, ring above
    0x18 => 0xB8,           # \c, cedilla
    0x20 => 0x2423,         # graphic representation of space

    [0x21,0x7F] => 0x21,

    0x27 => 0x2018,         # left quote
    0x60 => 0x2019,         # right quote
    0x5E => [0x302,-525,0], # \hat (combining)
    0x7E => [0x303,-525,0], # \tilde (combining)
    0x7F => [0x308,-525,0], # \ddot (combining)
  ],
};

$map{rsfs10} = {
  "Script-Regular" => [
    [0x41,0x5A] => 0x41,    # A-Z
  ],
};

$map{cmssbx10} = {
  "SansSerif-Bold" => [
    [0,1] => 0x393,         # \Gamma, \Delta
    2 => 0x398,             # \Theta
    3 => 0x39B,             # \Lambda
    4 => 0x39E,             # \Xi
    5 => 0x3A0,             # \Pi
    6 => 0x3A3,             # \Sigma
    [7,8] => 0x3A5,         # \Upsilon, \Phi
    [9,0xA] => 0x3A8,       # \Psi, \Omega

    0x10 => 0x131,          # \i
    0x11 => 0x237,          # \j
    0x13 => 0xB4,           # \acute
    0x14 => 0x2C7,          # \check
    0x15 => 0x2D8,          # \breve
    0x16 => 0x2C9,          # \bar
    0x17 => [0xB0,-58,0],   # \degree
    0x17 => 0x02DA,         # \r, ring above
    0x18 => 0xB8,           # \c, cedilla

    [0x21,0x2F] => 0x21,    # !, ", #, $, %, &, ', (, ), *, +, comma, -, ., /
    0x22 => 0x201D,         # "
    0x27 => 0x2019,         # '
    [0x30,0x39] => 0x30,    # 0-9
    [0x3A,0x3B] => 0x3A,    # :, ;
    0x3D => 0x3D,           # =
    [0x3F,0x40] => 0x3F,    # ?, @
    [0x41,0x5A] => 0x41,    # A-Z
    0x5B => 0x5B,           # [
    0x5C => 0x201C,         # ``
    [0x5D,0x5E] => 0x5D,    # ], ^
    0x5E => 0x2C6,          # \hat
    0x5F => 0x2D9,          # \dot
    0x60 => 0x2018,         # `
    [0x61,0x7A] => 0x61,    # a-z
    [0x7B,0x7C] => 0x2013,  # \endash, \emdash
    0x7B => [0x5F,0,-350],  # underline
    0x7D => 0x2DD,          # double acute
    0x7E => [0x7E,0,-350],  # ~
    0x7E => 0x2DC,          # \tilde
    0x7F => 0xA8,           # \ddot
  ],
};

$map{cmss10} = {
  "SansSerif-Regular" => [
    [0,1] => 0x393,         # \Gamma, \Delta
    2 => 0x398,             # \Theta
    3 => 0x39B,             # \Lambda
    4 => 0x39E,             # \Xi
    5 => 0x3A0,             # \Pi
    6 => 0x3A3,             # \Sigma
    [7,8] => 0x3A5,         # \Upsilon, \Phi
    [9,0xA] => 0x3A8,       # \Psi, \Omega

    0x10 => 0x131,          # \i
    0x11 => 0x237,          # \j
    0x12 => 0x2CB,          # \grave
    0x13 => 0x2CA,          # \acute
    0x14 => 0x2C7,          # \check
    0x15 => 0x2D8,          # \breve
    0x16 => 0x2C9,          # \bar
    0x17 => [0xB0,-142,0],  # \degree
    0x17 => 0x02DA,         # \r, ring above
    0x18 => 0xB8,           # \c, cedilla

    [0x21,0x2F] => 0x21,    # !, ", #, $, %, &, ', (, ), *, +, comma, -, ., /
    0x22 => 0x201D,         # "
    0x27 => 0x2019,         # '
    [0x30,0x39] => 0x30,    # 0-9
    [0x3A,0x3B] => 0x3A,    # :, ;
    0x3D => 0x3D,           # =
    [0x3F,0x40] => 0x3F,    # ?, @
    [0x41,0x5A] => 0x41,    # A-Z
    0x5B => 0x5B,           # [
    0x5C => 0x201C,         # ``
    [0x5D,0x5E] => 0x5D,    # ], ^
    0x5E => 0x2C6,          # \hat
    0x5F => 0x2D9,          # \dot
    0x60 => 0x2018,         # `
    [0x61,0x7A] => 0x61,    # a-z
    [0x7B,0x7C] => 0x2013,  # \endash, \emdash
    0x7B => [0x5F,0,-350],  # underline
    0x7D => 0x2DD,          # double acute
    0x7E => [0x7E,0,-350],  # ~
    0x7E => 0x2DC,          # \tilde
    0x7F => 0xA8,           # \ddot
  ],
};

$map{cmssi10} = {
  "SansSerif-Italic" => [
    [0,1] => 0x393,         # \Gamma, \Delta
    2 => 0x398,             # \Theta
    3 => 0x39B,             # \Lambda
    4 => 0x39E,             # \Xi
    5 => 0x3A0,             # \Pi
    6 => 0x3A3,             # \Sigma
    [7,8] => 0x3A5,         # \Upsilon, \Phi
    [9,0xA] => 0x3A8,       # \Psi, \Omega

    0x10 => 0x131,          # \i
    0x11 => 0x237,          # \j
    0x12 => 0x2CB,          # \grave
    0x13 => 0x2CA,          # \acute
    0x14 => 0x2C7,          # \check
    0x15 => 0x2D8,          # \breve
    0x16 => 0x2C9,          # \bar
    0x17 => [0xB0,-113,0],  # \degree
    0x17 => 0x02DA,         # \r, ring above
    0x18 => 0xB8,           # \c, cedilla

    [0x21,0x2F] => 0x21,    # !, ", #, $, %, &, ', (, ), *, +, comma, -, ., /
    0x22 => 0x201D,         # "
    0x27 => 0x2019,         # '
    [0x30,0x39] => 0x30,    # 0-9
    [0x3A,0x3B] => 0x3A,    # :, ;
    0x3D => 0x3D,           # =
    [0x3F,0x40] => 0x3F,    # ?, @
    [0x41,0x5A] => 0x41,    # A-Z
    0x5B => 0x5B,           # [
    0x5C => 0x201C,         # ``
    [0x5D,0x5E] => 0x5D,    # ], ^
    0x5E => 0x2C6,          # \hat
    0x5F => 0x2D9,          # \dot
    0x60 => 0x2018,         # `
    [0x61,0x7A] => 0x61,    # a-z
    [0x7B,0x7C] => 0x2013,  # \endash, \emdash
    0x7B => [0x5F,0,-350],  # underline
    0x7D => 0x2DD,          # double acute
    0x7E => [0x7E,0,-350],  # ~
    0x7E => 0x2DC,          # \tilde
    0x7F => 0xA8,           # \ddot
  ],
};

foreach $cmfont (keys %map) {
    foreach $mjfont (keys %{$map{$cmfont}}) {
        $style = $mjfont; $style =~ s/.*?(-|$)//; $style = "Regular" unless $style;
        $family = $mjfont; $family =~ s/-.*//;
        $fontname = "$family-$style";
        @{$reverse{$fontname}{$cmfont}} = @{$map{$cmfont}{$mjfont}};
    }
}

my %output;

sub add_to_output {
    my ($mjfont,$cmfont,$from,$to) = @_;

    my $xshift = 0, $yshift = 0;

    if (ref($to) eq "ARRAY") {
        $xshift = $to->[1];
        $yshift = $to->[2];
        $to = $to->[0];
    }

    $data = {
        "font" => $cmfont,
        "char" => $from,
        "xshift" => $xshift,
        "yshift" => $yshift
    };

    if (defined($output{$mjfont}{$to})) {
        print STDERR "Duplicate mapping $to for $mjfont: " .
            $output{$mjfont}{$to}{font} . ":" .
            $output{$mjfont}{$to}{char} . " vs. $cmfont:$from\n";
        die "Duplicate mapping!"; # disable this line to see all of them
    }
    $output{$mjfont}{$to} = $data;
}

foreach $mjfont (keys %reverse) {
    foreach $cmfont (keys %{$reverse{$mjfont}}) {
        @remap = @{$reverse{$mjfont}{$cmfont}};
        while (defined($item = shift(@remap))) {
            $remap = shift(@remap);

            if (ref($item) eq "ARRAY") {
                foreach $from ($item->[0]...$item->[1]) {
                    $to = $from - $item->[0] + $remap;
                    add_to_output($mjfont, $cmfont, $from, $to);
                }
            } else {
                add_to_output($mjfont, $cmfont, $item, $remap);
            }
        }
    }
}

print(encode_json(\%output));
Aռx|class CharInfoWord(object):
    def __init__(self, word):
        b1, b2, b3, b4 = (word >> 24,
                          (word & 0xff0000) >> 16,
                          (word & 0xff00) >> 8,
                          word & 0xff)

        self.width_index = b1
        self.height_index = b2 >> 4
        self.depth_index = b2 & 0x0f
        self.italic_index = (b3 & 0b11111100) >> 2
        self.tag = b3 & 0b11
        self.remainder = b4

    def has_ligkern(self):
        return self.tag == 1

    def ligkern_start(self):
        return self.remainder


class LigKernProgram(object):
    def __init__(self, program):
        self.program = program

    def execute(self, start, next_char):
        curr_instruction = start
        while True:
            instruction = self.program[curr_instruction]
            (skip, inst_next_char, op, remainder) = instruction

            if inst_next_char == next_char:
                if op < 128:
                    # Don't worry about ligatures for now, we only need kerns
                    return None
                else:
                    return 256 * (op - 128) + remainder
            elif skip >= 128:
                return None
            else:
                curr_instruction += 1 + skip


class TfmCharMetrics(object):
    def __init__(self, width, height, depth, italic, kern_table):
        self.width = width
        self.height = height
        self.depth = depth
        self.italic_correction = italic
        self.kern_table = kern_table


class TfmFile(object):
    def __init__(self, start_char, end_char, char_info, width_table,
                 height_table, depth_table, italic_table, ligkern_table,
                 kern_table):
        self.start_char = start_char
        self.end_char = end_char
        self.char_info = char_info
        self.width_table = width_table
        self.height_table = height_table
        self.depth_table = depth_table
        self.italic_table = italic_table
        self.ligkern_program = LigKernProgram(ligkern_table)
        self.kern_table = kern_table

    def get_char_metrics(self, char_num, fix_rsfs=False):
        """Return glyph metrics for a unicode code point.

        Arguments:
            char_num: a unicode code point
            fix_rsfs: adjust for rsfs10.tfm's different indexing system
        """
        if char_num < self.start_char or char_num > self.end_char:
            raise RuntimeError("Invalid character number")

        if fix_rsfs:
            # all of the char_nums contained start from zero in rsfs10.tfm
            info = self.char_info[char_num - self.start_char]
        else:
            info = self.char_info[char_num + self.start_char]

        char_kern_table = {}
        if info.has_ligkern():
            for char in range(self.start_char, self.end_char + 1):
                kern = self.ligkern_program.execute(info.ligkern_start(), char)
                if kern:
                    char_kern_table[char] = self.kern_table[kern]

        return TfmCharMetrics(
            self.width_table[info.width_index],
            self.height_table[info.height_index],
            self.depth_table[info.depth_index],
            self.italic_table[info.italic_index],
            char_kern_table)


class TfmReader(object):
    def __init__(self, f):
        self.f = f

    def read_byte(self):
        return ord(self.f.read(1))

    def read_halfword(self):
        b1 = self.read_byte()
        b2 = self.read_byte()
        return (b1 << 8) | b2

    def read_word(self):
        b1 = self.read_byte()
        b2 = self.read_byte()
        b3 = self.read_byte()
        b4 = self.read_byte()
        return (b1 << 24) | (b2 << 16) | (b3 << 8) | b4

    def read_fixword(self):
        word = self.read_word()

        neg = False
        if word & 0x80000000:
            neg = True
            word = (-word & 0xffffffff)

        return (-1 if neg else 1) * word / float(1 << 20)

    def read_bcpl(self, length):
        str_length = self.read_byte()
        data = self.f.read(length - 1)
        return data[:str_length]


def read_tfm_file(file_name):
    with open(file_name, 'rb') as f:
        reader = TfmReader(f)

        # file_size
        reader.read_halfword()
        header_size = reader.read_halfword()

        start_char = reader.read_halfword()
        end_char = reader.read_halfword()

        width_table_size = reader.read_halfword()
        height_table_size = reader.read_halfword()
        depth_table_size = reader.read_halfword()
        italic_table_size = reader.read_halfword()

        ligkern_table_size = reader.read_halfword()
        kern_table_size = reader.read_halfword()

        # extensible_table_size
        reader.read_halfword()
        # parameter_table_size
        reader.read_halfword()

        # checksum
        reader.read_word()
        # design_size
        reader.read_fixword()

        if header_size > 2:
            # coding_scheme
            reader.read_bcpl(40)

        if header_size > 12:
            # font_family
            reader.read_bcpl(20)

        for i in range(header_size - 17):
            reader.read_word()

        char_info = []
        for i in range(start_char, end_char + 1):
            char_info.append(CharInfoWord(reader.read_word()))

        width_table = []
        for i in range(width_table_size):
            width_table.append(reader.read_fixword())

        height_table = []
        for i in range(height_table_size):
            height_table.append(reader.read_fixword())

        depth_table = []
        for i in range(depth_table_size):
            depth_table.append(reader.read_fixword())

        italic_table = []
        for i in range(italic_table_size):
            italic_table.append(reader.read_fixword())

        ligkern_table = []
        for i in range(ligkern_table_size):
            skip = reader.read_byte()
            next_char = reader.read_byte()
            op = reader.read_byte()
            remainder = reader.read_byte()

            ligkern_table.append((skip, next_char, op, remainder))

        kern_table = []
        for i in range(kern_table_size):
            kern_table.append(reader.read_fixword())

        # There is more information, like the ligkern, kern, extensible, and
        # param table, but we don't need these for now

        return TfmFile(start_char, end_char, char_info, width_table,
                       height_table, depth_table, italic_table,
                       ligkern_table, kern_table)
pҿxO8import {NON_ATOMS} from "./atoms";
import type {Atom} from "./atoms";
import type SourceLocation from "./SourceLocation";
import type {AlignSpec, ColSeparationType} from "./environments/array";
import type {DelimiterSize, Mode, StyleStr} from "./types";
import type {MathFont} from "./types/fonts";
import type {Token} from "./Token";
import type {Measurement} from "./units";
export type NodeType = keyof ParseNodeTypes;
export type ParseNode<TYPE extends NodeType> = ParseNodeTypes[TYPE];

// ParseNode's corresponding to Symbol `Group`s in symbols.js.
export type SymbolParseNode =
    ParseNode<"atom"> |
    ParseNode<"accent-token"> |
    ParseNode<"mathord"> |
    ParseNode<"op-token"> |
    ParseNode<"spacing"> |
    ParseNode<"textord">;

// ParseNode from `Parser.formatUnsupportedCmd`
export type UnsupportedCmdParseNode = ParseNode<"color">;

// Union of all possible `ParseNode<>` types.
export type AnyParseNode = ParseNodeTypes[keyof ParseNodeTypes];

// Map from `NodeType` to the corresponding `ParseNode`.
type ParseNodeTypes = {
    "array": {
        type: "array";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        colSeparationType?: ColSeparationType;
        hskipBeforeAndAfter?: boolean;
        addJot?: boolean;
        cols?: AlignSpec[];
        arraystretch: number;
        body: AnyParseNode[][];
        // List of rows in the (2D) array.
        rowGaps: (Measurement | null | undefined)[];
        hLinesBeforeRow: Array<boolean[]>;
            // Whether each row should be automatically numbered, or an explicit tag
        tags?: (boolean | AnyParseNode[])[];
        leqno?: boolean;
        isCD?: boolean;
    };
    "cdlabel": {
        type: "cdlabel";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        side: string;
        label: AnyParseNode;
    };
    "cdlabelparent": {
        type: "cdlabelparent";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        fragment: AnyParseNode;
    };
    "color": {
        type: "color";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        color: string;
        body: AnyParseNode[];
    };
    "color-token": {
        type: "color-token";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        color: string;
    };
    // To avoid requiring run-time type assertions, this more carefully captures
    // the requirements on the fields per the op.js htmlBuilder logic:
    // - `body` and `value` are NEVER set simultaneously.
    // - When `symbol` is true, `body` is set.
    "op": {
        type: "op";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        limits: boolean;
        alwaysHandleSupSub?: boolean;
        suppressBaseShift?: boolean;
        parentIsSupSub: boolean;
        symbol: boolean;
        name: string;
        body?: void;
    } | {
        type: "op";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        limits: boolean;
        alwaysHandleSupSub?: boolean;
        suppressBaseShift?: boolean;
        parentIsSupSub: boolean;
        symbol: false;
        // If 'symbol' is true, `body` *must* be set.
        name?: void;
        body: AnyParseNode[];
    };
    "ordgroup": {
        type: "ordgroup";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        body: AnyParseNode[];
        semisimple?: boolean;
    };
    "raw": {
        type: "raw";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        string: string;
    };
    "size": {
        type: "size";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        value: Measurement;
        isBlank: boolean;
    };
    "styling": {
        type: "styling";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        style: StyleStr;
        resetFont?: boolean;
        body: AnyParseNode[];
    };
    "supsub": {
        type: "supsub";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        base: AnyParseNode | null | undefined;
        sup?: AnyParseNode | null | undefined;
        sub?: AnyParseNode | null | undefined;
    };
    "tag": {
        type: "tag";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        body: AnyParseNode[];
        tag: AnyParseNode[];
    };
    "text": {
        type: "text";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        body: AnyParseNode[];
        font?: string;
    };
    "url": {
        type: "url";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        url: string;
    };
    "verb": {
        type: "verb";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        body: string;
        star: boolean;
    };
    // From symbol groups, constructed in Parser.js via `symbols` lookup.
    // (Some of these have "-token" suffix to distinguish them from existing
    // `ParseNode` types.)
    "atom": {
        type: "atom";
        family: Atom;
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        text: string;
    };
    "mathord": {
        type: "mathord";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        text: string;
    };
    "spacing": {
        type: "spacing";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        text: string;
    };
    "textord": {
        type: "textord";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        text: string;
    };
    // These "-token" types don't have corresponding HTML/MathML builders.
    "accent-token": {
        type: "accent-token";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        text: string;
    };
    "op-token": {
        type: "op-token";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        text: string;
    };
    // From functions.js and functions/*.js. See also "color", "op", "styling",
    // and "text" above.
    "accent": {
        type: "accent";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        label: string;
        isStretchy?: boolean;
        isShifty?: boolean;
        base: AnyParseNode;
    };
    "accentUnder": {
        type: "accentUnder";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        label: string;
        isStretchy?: boolean;
        isShifty?: boolean;
        base: AnyParseNode;
    };
    "cr": {
        type: "cr";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        newLine: boolean;
        size: Measurement | null | undefined;
    };
    "delimsizing": {
        type: "delimsizing";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        size: DelimiterSize;
        mclass: "mopen" | "mclose" | "mrel" | "mord";
        delim: string;
    };
    "enclose": {
        type: "enclose";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        label: string;
        backgroundColor?: string;
        borderColor?: string;
        body: AnyParseNode;
    };
    "environment": {
        type: "environment";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        name: string;
        nameGroup: AnyParseNode;
    };
    "font": {
        type: "font";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        font: Exclude<MathFont, "">;
        body: AnyParseNode;
    };
    "genfrac": {
        type: "genfrac";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        continued: boolean;
        numer: AnyParseNode;
        denom: AnyParseNode;
        hasBarLine: boolean;
        leftDelim: string | null | undefined;
        rightDelim: string | null | undefined;
        barSize: Measurement | null;
    };
    "hbox": {
        type: "hbox";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        body: AnyParseNode[];
    };
    "horizBrace": {
        type: "horizBrace";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        label: string;
        isOver: boolean;
        base: AnyParseNode;
    };
    "href": {
        type: "href";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        href: string;
        body: AnyParseNode[];
    };
    "html": {
        type: "html";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        attributes: Record<string, string>;
        body: AnyParseNode[];
    };
    "htmlmathml": {
        type: "htmlmathml";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        html: AnyParseNode[];
        mathml: AnyParseNode[];
    };
    "includegraphics": {
        type: "includegraphics";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        alt: string;
        width: Measurement;
        height: Measurement;
        totalheight: Measurement;
        src: string;
    };
    "infix": {
        type: "infix";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        replaceWith: string;
        size?: Measurement;
        token: Token | null | undefined;
    };
    "internal": {
        type: "internal";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
    };
    "kern": {
        type: "kern";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        dimension: Measurement;
    };
    "lap": {
        type: "lap";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        alignment: string;
        body: AnyParseNode;
    };
    "leftright": {
        type: "leftright";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        body: AnyParseNode[];
        left: string;
        right: string;
        rightColor: string | null | undefined; // undefined means "inherit"
    };
    "leftright-right": {
        type: "leftright-right";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        delim: string;
        color: string | null | undefined; // undefined means "inherit"
    };
    "mathchoice": {
        type: "mathchoice";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        display: AnyParseNode[];
        text: AnyParseNode[];
        script: AnyParseNode[];
        scriptscript: AnyParseNode[];
    };
    "middle": {
        type: "middle";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        delim: string;
    };
    "mclass": {
        type: "mclass";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        mclass: string;
        body: AnyParseNode[];
        isCharacterBox: boolean;
    };
    "operatorname": {
        type: "operatorname";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        body: AnyParseNode[];
        alwaysHandleSupSub: boolean;
        limits: boolean;
        parentIsSupSub: boolean;
    };
    "overline": {
        type: "overline";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        body: AnyParseNode;
    };
    "phantom": {
        type: "phantom";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        body: AnyParseNode[];
    };
    "vphantom": {
        type: "vphantom";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        body: AnyParseNode;
    };
    "pmb": {
        type: "pmb";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        mclass: string;
        body: AnyParseNode[];
    };
    "raisebox": {
        type: "raisebox";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        dy: Measurement;
        body: AnyParseNode;
    };
    "rule": {
        type: "rule";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        shift: Measurement | null | undefined;
        width: Measurement;
        height: Measurement;
    };
    "sizing": {
        type: "sizing";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        size: number;
        body: AnyParseNode[];
    };
    "smash": {
        type: "smash";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        body: AnyParseNode;
        smashHeight: boolean;
        smashDepth: boolean;
    };
    "sqrt": {
        type: "sqrt";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        body: AnyParseNode;
        index: AnyParseNode | null | undefined;
    };
    "underline": {
        type: "underline";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        body: AnyParseNode;
    };
    "vcenter": {
        type: "vcenter";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        body: AnyParseNode;
    };
    "xArrow": {
        type: "xArrow";
        mode: Mode;
        loc?: SourceLocation | null | undefined;
        label: string;
        body: AnyParseNode;
        below: AnyParseNode | null | undefined;
    };
};

/**
 * Asserts that the node is of the given type and returns it with stricter
 * typing. Throws if the node's type does not match.
 */
export function assertNodeType<NODETYPE extends NodeType>(
    node: AnyParseNode | null | undefined,
    type: NODETYPE,
): ParseNode<NODETYPE> {
    if (!node || node.type !== type) {
        throw new Error(
            `Expected node of type ${type}, but got ` +
            (node ? `node of type ${node.type}` : String(node)));
    }

    return node as ParseNode<NODETYPE>;
}

/**
 * Returns the node more strictly typed iff it is of the given type. Otherwise,
 * returns null.
 */
export function assertSymbolNodeType(node: AnyParseNode | null | undefined): SymbolParseNode {
    const typedNode = checkSymbolNodeType(node);
    if (!typedNode) {
        throw new Error(
            `Expected node of symbol group type, but got ` +
            (node ? `node of type ${node.type}` : String(node)));
    }
    return typedNode;
}

/**
 * Returns the node more strictly typed iff it is of the given type. Otherwise,
 * returns null.
 */
export function checkSymbolNodeType(node: AnyParseNode | null | undefined): SymbolParseNode | null | undefined {
    if (node && (node.type === "atom" || NON_ATOMS.hasOwnProperty(node.type))) {
        return node as SymbolParseNode;
    }
    return null;
}
оcx>/**
 * Provides a single function for parsing an expression using a Parser
 * TODO(emily): Remove this
 */

import Parser from "./Parser";
import ParseError from "./ParseError";
import {Token} from "./Token";

import type Settings from "./Settings";
import type {AnyParseNode} from "./parseNode";

/**
 * Parses an expression using a Parser, then returns the parsed result.
 */
const parseTree = function(
    toParse: string | InstanceType<typeof String>,
    settings: Settings,
): AnyParseNode[] {
    if (!(typeof toParse === 'string' || toParse instanceof String)) {
        throw new TypeError('KaTeX can only parse string typed expression');
    }
    const parser = new Parser(toParse as string, settings);

    // Blank out any \df@tag to avoid spurious "Duplicate \tag" errors
    delete parser.gullet.macros.current["\\df@tag"];

    let tree = parser.parse();

    // Prevent a color definition from persisting between calls to katex.render().
    delete parser.gullet.macros.current["\\current@color"];
    delete parser.gullet.macros.current["\\color"];

    // If the input used \tag, it will set the \df@tag macro to the tag.
    // In this case, we separately parse the tag and wrap the tree.
    if (parser.gullet.macros.get("\\df@tag")) {
        if (!settings.displayMode) {
            throw new ParseError("\\tag works only in display equations");
        }
        tree = [{
            type: "tag",
            mode: "text",
            body: tree,
            tag: parser.subparse([new Token("\\df@tag")]),
        }];
    }

    return tree;
};

export default parseTree;
x?	/**
 * Describes spaces between different classes of atoms.
 */
import type {Measurement} from "./units";

const thinspace: Measurement = {
    number: 3,
    unit: "mu",
};
const mediumspace: Measurement = {
    number: 4,
    unit: "mu",
};
const thickspace: Measurement = {
    number: 5,
    unit: "mu",
};

// Making the type below exact with all optional fields doesn't work due to
// - https://github.com/facebook/flow/issues/4582
// - https://github.com/facebook/flow/issues/5688
// However, since *all* fields are optional, $Shape<> works as suggested in 5688
// above.
export type Spacings = Partial<{
    mord: Measurement;
    mop: Measurement;
    mbin: Measurement;
    mrel: Measurement;
    mopen: Measurement;
    mclose: Measurement;
    mpunct: Measurement;
    minner: Measurement;
}> & {};

// Spacing relationships for display and text styles
export const spacings: {[key in keyof Spacings]?: Spacings} = {
    mord: {
        mop: thinspace,
        mbin: mediumspace,
        mrel: thickspace,
        minner: thinspace,
    },
    mop: {
        mord: thinspace,
        mop: thinspace,
        mrel: thickspace,
        minner: thinspace,
    },
    mbin: {
        mord: mediumspace,
        mop: mediumspace,
        mopen: mediumspace,
        minner: mediumspace,
    },
    mrel: {
        mord: thickspace,
        mop: thickspace,
        mopen: thickspace,
        minner: thickspace,
    },
    mopen: {},
    mclose: {
        mop: thinspace,
        mbin: mediumspace,
        mrel: thickspace,
        minner: thinspace,
    },
    mpunct: {
        mord: thinspace,
        mop: thinspace,
        mrel: thickspace,
        mopen: thinspace,
        mclose: thinspace,
        mpunct: thinspace,
        minner: thinspace,
    },
    minner: {
        mord: thinspace,
        mop: thinspace,
        mbin: mediumspace,
        mrel: thickspace,
        mopen: thinspace,
        mpunct: thinspace,
        minner: thinspace,
    },
};

// Spacing relationships for script and scriptscript styles
export const tightSpacings: {[key in keyof Spacings]?: Spacings} = {
    mord: {
        mop: thinspace,
    },
    mop: {
        mord: thinspace,
        mop: thinspace,
    },
    mbin: {},
    mrel: {},
    mopen: {},
    mclose: {
        mop: thinspace,
    },
    mpunct: {},
    minner: {
        mop: thinspace,
    },
};
>fxQ6/**
 * This file provides support to buildMathML.js and buildHTML.js
 * for stretchy wide elements rendered from SVG files
 * and other CSS trickery.
 */

import {LineNode, PathNode, SvgNode} from "./domTree";
import {makeSpan, makeSvgSpan} from "./buildCommon";
import {MathNode, TextNode} from "./mathMLTree";
import {makeEm} from "./units";

import type Options from "./Options";
import type {ParseNode} from "./parseNode";
import type {DomSpan, HtmlDomNode, SvgSpan} from "./domTree";

const stretchyCodePoint: Record<string, string> = {
    widehat: "^",
    widecheck: "ˇ",
    widetilde: "~",
    utilde: "~",
    overleftarrow: "\u2190",
    underleftarrow: "\u2190",
    xleftarrow: "\u2190",
    overrightarrow: "\u2192",
    underrightarrow: "\u2192",
    xrightarrow: "\u2192",
    underbrace: "\u23df",
    overbrace: "\u23de",
    underbracket: "\u23b5",
    overbracket: "\u23b4",
    overgroup: "\u23e0",
    undergroup: "\u23e1",
    overleftrightarrow: "\u2194",
    underleftrightarrow: "\u2194",
    xleftrightarrow: "\u2194",
    Overrightarrow: "\u21d2",
    xRightarrow: "\u21d2",
    overleftharpoon: "\u21bc",
    xleftharpoonup: "\u21bc",
    overrightharpoon: "\u21c0",
    xrightharpoonup: "\u21c0",
    xLeftarrow: "\u21d0",
    xLeftrightarrow: "\u21d4",
    xhookleftarrow: "\u21a9",
    xhookrightarrow: "\u21aa",
    xmapsto: "\u21a6",
    xrightharpoondown: "\u21c1",
    xleftharpoondown: "\u21bd",
    xrightleftharpoons: "\u21cc",
    xleftrightharpoons: "\u21cb",
    xtwoheadleftarrow: "\u219e",
    xtwoheadrightarrow: "\u21a0",
    xlongequal: "=",
    xtofrom: "\u21c4",
    xrightleftarrows: "\u21c4",
    xrightequilibrium: "\u21cc",  // Not a perfect match.
    xleftequilibrium: "\u21cb",   // None better available.
    "\\cdrightarrow": "\u2192",
    "\\cdleftarrow": "\u2190",
    "\\cdlongequal": "=",
};

export const stretchyMathML = function(label: string): MathNode {
    const node = new MathNode(
        "mo",
        [new TextNode(stretchyCodePoint[label.replace(/^\\/, '')])],
    );
    node.setAttribute("stretchy", "true");
    return node;
};

// Many of the KaTeX SVG images have been adapted from glyphs in KaTeX fonts.
// Copyright (c) 2009-2010, Design Science, Inc. (<www.mathjax.org>)
// Copyright (c) 2014-2017 Khan Academy (<www.khanacademy.org>)
// Licensed under the SIL Open Font License, Version 1.1.
// See \nhttp://scripts.sil.org/OFL

// Very Long SVGs
//    Many of the KaTeX stretchy wide elements use a long SVG image and an
//    overflow: hidden tactic to achieve a stretchy image while avoiding
//    distortion of arrowheads or brace corners.

//    The SVG typically contains a very long (400 em) arrow.

//    The SVG is in a container span that has overflow: hidden, so the span
//    acts like a window that exposes only part of the  SVG.

//    The SVG always has a longer, thinner aspect ratio than the container span.
//    After the SVG fills 100% of the height of the container span,
//    there is a long arrow shaft left over. That left-over shaft is not shown.
//    Instead, it is sliced off because the span's CSS has overflow: hidden.

//    Thus, the reader sees an arrow that matches the subject matter width
//    without distortion.

//    Some functions, such as \cancel, need to vary their aspect ratio. These
//    functions do not get the overflow SVG treatment.

// In the katexImagesData object just below, the dimensions all
// correspond to path geometry inside the relevant SVG.
// For example, \overrightarrow uses the same arrowhead as glyph U+2192
// from the KaTeX Main font. The scaling factor is 1000.
// That is, inside the font, that arrowhead is 522 units tall, which
// corresponds to 0.522 em inside the document.

type SvgData = [string[], number, number, string?];

const katexImagesData: {[key: string]: SvgData} = {
                   //   path(s), minWidth, height, align
    overrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"],
    overleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"],
    underrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"],
    underleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"],
    xrightarrow: [["rightarrow"], 1.469, 522, "xMaxYMin"],
    "\\cdrightarrow": [["rightarrow"], 3.0, 522, "xMaxYMin"], // CD minwwidth2.5pc
    xleftarrow: [["leftarrow"], 1.469, 522, "xMinYMin"],
    "\\cdleftarrow": [["leftarrow"], 3.0, 522, "xMinYMin"],
    Overrightarrow: [["doublerightarrow"], 0.888, 560, "xMaxYMin"],
    xRightarrow: [["doublerightarrow"], 1.526, 560, "xMaxYMin"],
    xLeftarrow: [["doubleleftarrow"], 1.526, 560, "xMinYMin"],
    overleftharpoon: [["leftharpoon"], 0.888, 522, "xMinYMin"],
    xleftharpoonup: [["leftharpoon"], 0.888, 522, "xMinYMin"],
    xleftharpoondown: [["leftharpoondown"], 0.888, 522, "xMinYMin"],
    overrightharpoon: [["rightharpoon"], 0.888, 522, "xMaxYMin"],
    xrightharpoonup: [["rightharpoon"], 0.888, 522, "xMaxYMin"],
    xrightharpoondown: [["rightharpoondown"], 0.888, 522, "xMaxYMin"],
    xlongequal: [["longequal"], 0.888, 334, "xMinYMin"],
    "\\cdlongequal": [["longequal"], 3.0, 334, "xMinYMin"],
    xtwoheadleftarrow: [["twoheadleftarrow"], 0.888, 334, "xMinYMin"],
    xtwoheadrightarrow: [["twoheadrightarrow"], 0.888, 334, "xMaxYMin"],

    overleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522],
    overbrace: [["leftbrace", "midbrace", "rightbrace"], 1.6, 548],
    underbrace: [["leftbraceunder", "midbraceunder", "rightbraceunder"],
        1.6, 548],
    underleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522],
    xleftrightarrow: [["leftarrow", "rightarrow"], 1.75, 522],
    xLeftrightarrow: [["doubleleftarrow", "doublerightarrow"], 1.75, 560],
    xrightleftharpoons: [["leftharpoondownplus", "rightharpoonplus"], 1.75, 716],
    xleftrightharpoons: [["leftharpoonplus", "rightharpoondownplus"],
        1.75, 716],
    xhookleftarrow: [["leftarrow", "righthook"], 1.08, 522],
    xhookrightarrow: [["lefthook", "rightarrow"], 1.08, 522],
    overlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522],
    underlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522],
    overbracket: [["leftbracketover", "rightbracketover"], 1.6, 440],
    underbracket: [["leftbracketunder", "rightbracketunder"], 1.6, 410],
    overgroup: [["leftgroup", "rightgroup"], 0.888, 342],
    undergroup: [["leftgroupunder", "rightgroupunder"], 0.888, 342],
    xmapsto: [["leftmapsto", "rightarrow"], 1.5, 522],
    xtofrom: [["leftToFrom", "rightToFrom"], 1.75, 528],

    // The next three arrows are from the mhchem package.
    // In mhchem.sty, min-length is 2.0em. But these arrows might appear in the
    // document as \xrightarrow or \xrightleftharpoons. Those have
    // min-length = 1.75em, so we set min-length on these next three to match.
    xrightleftarrows: [["baraboveleftarrow", "rightarrowabovebar"], 1.75, 901],
    xrightequilibrium: [["baraboveshortleftharpoon",
        "rightharpoonaboveshortbar"], 1.75, 716],
    xleftequilibrium: [["shortbaraboveleftharpoon",
        "shortrightharpoonabovebar"], 1.75, 716],
};

const wideAccentLabels =
    new Set(["widehat", "widecheck", "widetilde", "utilde"]);

export const stretchySvg = function(
    group: ParseNode<"accent"> | ParseNode<"accentUnder"> | ParseNode<"xArrow">
         | ParseNode<"horizBrace">,
    options: Options,
): DomSpan | SvgSpan {
    // Create a span with inline SVG for the element.
    function buildSvgSpan_(): {
        span: DomSpan | SvgSpan,
        minWidth: number,
        height: number,
    } {
        let viewBoxWidth = 400000;  // default
        const label = group.label.slice(1);
        if (wideAccentLabels.has(label) && 'base' in group) {
            // There are four SVG images available for each function.
            // Choose a taller image when there are more characters.
            const numChars = group.base.type === "ordgroup" ?
                group.base.body.length : 1;
            let viewBoxHeight;
            let pathName;
            let height;

            if (numChars > 5) {
                if (label === "widehat" || label === "widecheck") {
                    viewBoxHeight = 420;
                    viewBoxWidth = 2364;
                    height = 0.42;
                    pathName = label + "4";
                } else {
                    viewBoxHeight = 312;
                    viewBoxWidth = 2340;
                    height = 0.34;
                    pathName = "tilde4";
                }
            } else {
                const imgIndex = [1, 1, 2, 2, 3, 3][numChars];
                if (label === "widehat" || label === "widecheck") {
                    viewBoxWidth = [0, 1062, 2364, 2364, 2364][imgIndex];
                    viewBoxHeight = [0, 239, 300, 360, 420][imgIndex];
                    height = [0, 0.24, 0.3, 0.3, 0.36, 0.42][imgIndex];
                    pathName = label + imgIndex;
                } else {
                    viewBoxWidth = [0, 600, 1033, 2339, 2340][imgIndex];
                    viewBoxHeight = [0, 260, 286, 306, 312][imgIndex];
                    height = [0, 0.26, 0.286, 0.3, 0.306, 0.34][imgIndex];
                    pathName = "tilde" + imgIndex;
                }
            }
            const path = new PathNode(pathName);
            const svgNode = new SvgNode([path], {
                "width": "100%",
                "height": makeEm(height),
                "viewBox": `0 0 ${viewBoxWidth} ${viewBoxHeight}`,
                "preserveAspectRatio": "none",
            });
            return {
                span: makeSvgSpan([], [svgNode], options),
                minWidth: 0,
                height,
            };
        } else {
            const spans = [];

            const data = katexImagesData[label];
            if (!data) {
                throw new Error(`No SVG data for "${label}".`);
            }
            const [paths, minWidth, viewBoxHeight] = data;
            const height = viewBoxHeight / 1000;

            const numSvgChildren = paths.length;
            let widthClasses;
            let aligns;
            if (numSvgChildren === 1) {
                if (data.length !== 4) {
                    throw new Error(
                        `Expected 4-tuple for single-path SVG data "${label}".`);
                }
                widthClasses = ["hide-tail"];
                aligns = [data[3]];
            } else if (numSvgChildren === 2) {
                widthClasses = ["halfarrow-left", "halfarrow-right"];
                aligns = ["xMinYMin", "xMaxYMin"];
            } else if (numSvgChildren === 3) {
                widthClasses = ["brace-left", "brace-center", "brace-right"];
                aligns = ["xMinYMin", "xMidYMin", "xMaxYMin"];
            } else {
                throw new Error(
                    `Correct katexImagesData or update code here to support
                    ${numSvgChildren} children.`);
            }

            for (let i = 0; i < numSvgChildren; i++) {
                const path = new PathNode(paths[i]);

                const svgNode = new SvgNode([path], {
                    "width": "400em",
                    "height": makeEm(height),
                    "viewBox": `0 0 ${viewBoxWidth} ${viewBoxHeight}`,
                    "preserveAspectRatio": aligns[i] + " slice",
                });

                const span = makeSvgSpan(
                    [widthClasses[i]], [svgNode], options);
                if (numSvgChildren === 1) {
                    return {span, minWidth, height};
                } else {
                    span.style.height = makeEm(height);
                    spans.push(span);
                }
            }

            return {
                span: makeSpan(["stretchy"], spans, options),
                minWidth,
                height,
            };
        }
    } // buildSvgSpan_()
    const {span, minWidth, height} = buildSvgSpan_();

    // Note that we are returning span.depth = 0.
    // Any adjustments relative to the baseline must be done in buildHTML.
    span.height = height;
    span.style.height = makeEm(height);
    if (minWidth > 0) {
        span.style.minWidth = makeEm(minWidth);
    }

    return span;
};

export const stretchyEnclose = function(
    inner: HtmlDomNode,
    label: string,
    topPad: number,
    bottomPad: number,
    options: Options,
): DomSpan | SvgSpan {
    // Return an image span for \cancel, \bcancel, \xcancel, \fbox, or \angl
    let img;
    const totalHeight = inner.height + inner.depth + topPad + bottomPad;

    if (/fbox|color|angl/.test(label)) {
        img = makeSpan(["stretchy", label], [], options);

        if (label === "fbox") {
            const color = options.color && options.getColor();
            if (color) {
                img.style.borderColor = color;
            }
        }

    } else {
        // \cancel, \bcancel, or \xcancel
        // Since \cancel's SVG is inline and it omits the viewBox attribute,
        // its stroke-width will not vary with span area.

        const lines = [];
        if (/^[bx]cancel$/.test(label)) {
            lines.push(new LineNode({
                "x1": "0",
                "y1": "0",
                "x2": "100%",
                "y2": "100%",
                "stroke-width": "0.046em",
            }));
        }

        if (/^x?cancel$/.test(label)) {
            lines.push(new LineNode({
                "x1": "0",
                "y1": "100%",
                "x2": "100%",
                "y2": "0",
                "stroke-width": "0.046em",
            }));
        }

        const svgNode = new SvgNode(lines, {
            "width": "100%",
            "height": makeEm(totalHeight),
        });

        img = makeSvgSpan([], [svgNode], options);
    }

    img.height = totalHeight;
    img.style.height = makeEm(totalHeight);

    return img;
};
ܧxw 100644 fonts.scss CgM{|	h!ڌ100644 katex-swap.scss Ffl3K<Cc
G100644 katex.scss "?vjů6j1x&	@use "sass:list";

$font-folder: "../../fonts" !default;
$use-woff2: true !default;
$use-woff: true !default;
$use-ttf: true !default;
$font-display: block !default;

@function generate-src($family, $family-suffix) {
    $src: null;
    @if $use-woff2 {
        $src: list.append($src, url('#{$font-folder}/KaTeX_#{$family}-#{$family-suffix}.woff2') format('woff2'), comma);
    }
    @if $use-woff {
        $src: list.append($src, url('#{$font-folder}/KaTeX_#{$family}-#{$family-suffix}.woff') format('woff'), comma);
    }
    @if $use-ttf {
        $src: list.append($src, url('#{$font-folder}/KaTeX_#{$family}-#{$family-suffix}.ttf') format('truetype'), comma);
    }

    @return $src;
}

@function generate-suffix($weight, $style) {
    $suffix: null;

    @if $weight == normal and $style == normal {
        $suffix: 'Regular';
    }
    @if $weight == normal and $style == italic {
        $suffix: 'Italic';
    }
    @if $weight == bold and $style == normal {
        $suffix: 'Bold';
    }
    @if $weight == bold and $style == italic {
        $suffix: 'BoldItalic';
    }

    @return $suffix;
}

@mixin font-face($family, $weight, $style) {
    $suffix: generate-suffix($weight, $style);
    $src: generate-src($family, $suffix);

    @font-face {
        font-family: 'KaTeX_#{$family}';
        src: $src;
        font-weight: $weight;
        font-style: $style;
        font-display: $font-display;
    }
}

@include font-face('AMS', normal, normal);
@include font-face('Caligraphic', bold, normal);
@include font-face('Caligraphic', normal, normal);
@include font-face('Fraktur', bold, normal);
@include font-face('Fraktur', normal, normal);
@include font-face('Main', bold, normal);
@include font-face('Main', bold, italic);
@include font-face('Main', normal, italic);
@include font-face('Main', normal, normal);
@include font-face('Math', bold, italic);
@include font-face('Math', normal, italic);
@include font-face('SansSerif', bold, normal);
@include font-face('SansSerif', normal, italic);
@include font-face('SansSerif', normal, normal);
@include font-face('Script', normal, normal);
@include font-face('Size1', normal, normal);
@include font-face('Size2', normal, normal);
@include font-face('Size3', normal, normal);
@include font-face('Size4', normal, normal);
@include font-face('Typewriter', normal, normal);
cuxD @use 'katex' with (
  $font-display: swap,
  $version: $version,
);
bx9/* stylelint-disable font-family-no-missing-generic-family-keyword */
@use "sass:list";
@use "sass:math";

@forward "fonts.scss" with (
    $font-folder: "../../fonts" !default,
    $use-woff2: true !default,
    $use-woff: true !default,
    $use-ttf: true !default,
    $font-display: block !default
);

@use "fonts.scss";

// The mu unit is defined as 1/18 em
$mu: calc(1em / 18);

// The version is dynamically set from package.json via webpack.common.js
$version: "" !default;

// CSS margin property for math in display mode
$display-margin: 1em 0 !default;

.katex {
    font: normal 1.21em KaTeX_Main, Times New Roman, serif;
    line-height: 1.2;
    position: relative;

    // Protect elements inside .katex from inheriting text-indent.
    text-indent: 0;

    // Prevent a rendering bug that misplaces \vec in Chrome.
    text-rendering: auto;

    * {
        // Prevent background resetting on elements in Windows's high-contrast
        // mode, while still allowing background/foreground setting on root .katex
        -ms-high-contrast-adjust: none !important;

        // Insulate fraction bars and rules from CSS that sets border-color.
        border-color: currentColor;
    }

    .katex-version::after {
        content: $version;
    }

    .katex-mathml {
        /* Accessibility hack to only show to screen readers
         Found at: http://a11yproject.com/posts/how-to-hide-content/ */
        position: absolute;
        clip-path: inset(50%);
        padding: 0;
        border: 0;
        height: 1px;
        width: 1px;
        overflow: hidden;
    }

    .katex-html {
        /* \newline is an empty block at top level, between .base elements */
        > .newline {
            display: block;
        }
    }

    .base {
        position: relative;
        display: inline-block;
        white-space: nowrap;

        // Fix width of containers of negative spaces, working around Chrome bug.
        width: min-content;
    }

    .strut {
        display: inline-block;
    }

    // Text font weights
    .textbf {
        font-weight: bold;
    }

    // Text font shapes.
    .textit {
        font-style: italic;
    }

    // Text font families.
    .textrm {
        font-family: KaTeX_Main;
    }

    .textsf {
        font-family: KaTeX_SansSerif;
    }

    .texttt {
        font-family: KaTeX_Typewriter;
    }

    // Math fonts.
    .mathnormal {
        font-family: KaTeX_Math;
        font-style: italic;
    }

    .mathit {
        font-family: KaTeX_Main;
        font-style: italic;
    }

    .mathrm {
        font-style: normal;
    }

    .mathbf {
        font-family: KaTeX_Main;
        font-weight: bold;
    }

    .boldsymbol {
        font-family: KaTeX_Math;
        font-weight: bold;
        font-style: italic;
    }

    .amsrm {
        font-family: KaTeX_AMS;
    }

    .mathbb,
    .textbb {
        font-family: KaTeX_AMS;
    }

    .mathcal {
        font-family: KaTeX_Caligraphic;
    }

    .mathfrak,
    .textfrak {
        font-family: KaTeX_Fraktur;
    }

    .mathboldfrak,
    .textboldfrak {
        font-family: KaTeX_Fraktur;
        font-weight: bold;
    }

    .mathtt {
        font-family: KaTeX_Typewriter;
    }

    .mathscr,
    .textscr {
        font-family: KaTeX_Script;
    }

    .mathsf,
    .textsf {
        font-family: KaTeX_SansSerif;
    }

    .mathboldsf,
    .textboldsf {
        font-family: KaTeX_SansSerif;
        font-weight: bold;
    }

    .mathsfit,
    .mathitsf,
    .textitsf {
        font-family: KaTeX_SansSerif;
        font-style: italic;
    }

    .mainrm {
        font-family: KaTeX_Main;
        font-style: normal;
    }

    // This value is also used in fontMetrics.js, if you change it make sure the
    // values match.
    $ptperem: 10;
    $nulldelimiterspace: calc(1.2em / $ptperem);

    $muspace: 0.055556em;       // 1mu
    $thinspace: 0.16667em;      // 3mu
    $mediumspace: 0.22222em;    // 4mu
    $thickspace: 0.27778em;     // 5mu

    .vlist-t {
        display: inline-table;
        table-layout: fixed;
        border-collapse: collapse;
    }

    .vlist-r {
        display: table-row;
    }

    .vlist {
        display: table-cell;
        vertical-align: bottom;
        position: relative;

        > span {
            display: block;
            height: 0;
            position: relative;

            > span {
                display: inline-block;
            }

            > .pstrut {
                overflow: hidden;
                width: 0;
            }
        }
    }

    .vlist-t2 {
        margin-right: -2px;
    }

    .vlist-s {
        // This cell solves Safari rendering problems. It has text content, so
        // its baseline is used for the table. A very small font avoids line-box
        // issues; absolute units prevent user font-size overrides from breaking
        // rendering. Safari refuses to make the box zero-width, so we give it
        // a known width and compensate with negative right margin on the
        // inline-table. To prevent the "width: min-content" Chrome workaround
        // from shrinking this box, we also set min-width.
        display: table-cell;
        vertical-align: bottom;
        font-size: 1px;
        width: 2px;
        min-width: 2px;
    }

    .vbox {
        display: inline-flex;
        flex-direction: column;
        align-items: baseline;
    }

    .hbox {
        display: inline-flex;
        flex-direction: row;
        width: 100%;
    }

    .thinbox {
        display: inline-flex;
        flex-direction: row;
        width: 0;
        max-width: 0; // necessary for Safari
    }

    .msupsub {
        text-align: left;
    }

    .mfrac {
        > span > span {
            text-align: center;
        }

        .frac-line {
            display: inline-block;
            width: 100%;
            border-bottom-style: solid;
        }
    }

    // Prevent Chrome from disappearing frac-lines, rules, etc.
    .mfrac .frac-line,
    .overline .overline-line,
    .underline .underline-line,
    .hline,
    .hdashline,
    .rule {
        min-height: 1px;
    }

    .mspace {
        display: inline-block;
    }

    .smash {
        display: inline;
        line-height: 0;
    }

    .llap,
    .rlap,
    .clap {
        width: 0;
        position: relative;

        > .inner {
            position: absolute;
        }

        > .fix {
            display: inline-block;
        }
    }

    .llap > .inner {
        right: 0;
    }

    .rlap > .inner,
    .clap > .inner {
        left: 0;
    }

    .clap > .inner > span {
        margin-left: -50%;
        margin-right: 50%;
    }

    .rule {
        display: inline-block;
        border: solid 0;
        position: relative;
    }

    .overline .overline-line,
    .underline .underline-line,
    .hline {
        display: inline-block;
        width: 100%;
        border-bottom-style: solid;
    }

    .hdashline {
        display: inline-block;
        width: 100%;
        border-bottom-style: dashed;
    }

    .sqrt {
        > .root {
            /* These values are taken from the definition of `\r@@t`,
             `\mkern 5mu` and `\mkern -10mu`. */
            /* stylelint-disable-next-line declaration-property-value-no-unknown */
            margin-left: calc(5*$mu);
            /* stylelint-disable-next-line declaration-property-value-no-unknown */
            margin-right: calc(-10*$mu);
        }
    }

    .sizing,
    .fontsize-ensurer {
        $sizes: 0.5, 0.6, 0.7, 0.8, 0.9, 1, 1.2, 1.44, 1.728, 2.074, 2.488;

        @for $from from 1 through list.length($sizes) {
            @for $to from 1 through list.length($sizes) {
                &.reset-size#{$from}.size#{$to} {
                    /* stylelint-disable-next-line */
                    font-size: calc(math.div(list.nth($sizes, $to), list.nth($sizes, $from)) * 1em);
                }
            }
        }
    }

    .delimsizing {
        &.size1 { font-family: KaTeX_Size1; }
        &.size2 { font-family: KaTeX_Size2; }
        &.size3 { font-family: KaTeX_Size3; }
        &.size4 { font-family: KaTeX_Size4; }

        &.mult {
            .delim-size1 > span {
                font-family: KaTeX_Size1;
            }

            .delim-size4 > span {
                font-family: KaTeX_Size4;
            }
        }
    }

    .nulldelimiter {
        display: inline-block;
        width: $nulldelimiterspace;
    }

    .delimcenter {
        position: relative;
    }

    .op-symbol {
        position: relative;

        &.small-op {
            font-family: KaTeX_Size1;
        }

        &.large-op {
            font-family: KaTeX_Size2;
        }
    }

    .op-limits {
        > .vlist-t {
            text-align: center;
        }
    }

    .accent {
        > .vlist-t {
            text-align: center;
        }

        .accent-body {
            position: relative; // so that 'left' can shift the accent
        }

        // Accents that are not of the accent-full class have zero width
        // (do not contribute to the width of the final symbol).
        .accent-body:not(.accent-full) {
            width: 0;
        }
    }

    .overlay {
        display: block;
    }

    .mtable {
        .vertical-separator {
            display: inline-block;
            // margin and border-right are set in JavaScript
            min-width: 1px;  // Prevent Chrome from omitting a line.
        }

        .arraycolsep {
            display: inline-block;
        }

        .col-align-c > .vlist-t {
            text-align: center;
        }

        .col-align-l > .vlist-t {
            text-align: left;
        }

        .col-align-r > .vlist-t {
            text-align: right;
        }
    }

    .svg-align {
        text-align: left;
    }

    svg {
        display: block;
        position: absolute; // absolute relative to parent
        width: 100%;
        height: inherit;

        // We want to inherit colors from our environment
        fill: currentColor;
        stroke: currentColor;

        // But path elements should not have an outline by default
        // that would make them bigger than we expect.
        path {
            stroke: none;
        }

        // And we don't want to inherit any other style properties
        // that could affect SVG rendering without affecting font
        // rendering. So we reset these properties to their default
        // values for every <svg> element.
        // See https://www.w3.org/TR/SVG/painting.html
        fill-rule: nonzero;
        fill-opacity: 1;
        stroke-width: 1;
        stroke-linecap: butt;
        stroke-linejoin: miter;
        stroke-miterlimit: 4;
        stroke-dasharray: none;
        stroke-dashoffset: 0;
        stroke-opacity: 1;
    }

    img {
        border-style: none;
        min-width: 0;
        min-height: 0;
        max-width: none;
        max-height: none;
    }

    // Define CSS for image whose width will match its span width.
    .stretchy {
        width: 100%;
        display: block;
        position: relative;
        overflow: hidden;

        &::before,
        &::after {
            content: "";
        }
    }

    // Hide the long tail of a stretchy SVG.
    .hide-tail {
        width: 100%;          // necessary only to get IE to work properly
        position: relative;   // ditto
        overflow: hidden;     // This line applies to all browsers.
    }

    .halfarrow-left {
        position: absolute;
        left: 0;
        width: 50.2%;
        overflow: hidden;
    }

    .halfarrow-right {
        position: absolute;
        right: 0;
        width: 50.2%;
        overflow: hidden;
    }

    .brace-left {
        position: absolute;
        left: 0;
        width: 25.1%;
        overflow: hidden;
    }

    .brace-center {
        position: absolute;
        left: 25%;
        width: 50%;
        overflow: hidden;
    }

    .brace-right {
        position: absolute;
        right: 0;
        width: 25.1%;
        overflow: hidden;
    }

    // Lengthen the extensible arrows via padding.
    .x-arrow-pad {
        padding: 0 0.5em;
    }

    .cd-arrow-pad {
        padding: 0 0.55556em 0 0.27778em;  // \;{#1}\;\;
    }

    .x-arrow,
    .mover,
    .munder {
        text-align: center;
    }

    .boxpad {
        padding: 0 0.3em;              // \fboxsep = 3pt
    }

    .fbox,
    .fcolorbox {
        box-sizing: border-box;
        border: 0.04em solid;         // \fboxrule = 0.4pt
    }

    .cancel-pad {
        padding: 0 0.2em;            // ref: cancel package  \advance\dimen@ 2\p@ %  "+2"
    }

    .cancel-lap {
        margin-left: -0.2em;    // \cancel does not affect horizontal spacing.
        margin-right: -0.2em;   // Apply negative margin to correct for 0.2em padding
    }                           // inside the \cancel group.

    .sout {
        border-bottom-style: solid;
        border-bottom-width: 0.08em;
    }

    .angl {
        // from package actuarialangle, which is always used in a subscript.
        box-sizing: border-box;
        border-top: 0.049em solid;        // defaultRuleThickness in scriptstyle
        border-right: 0.049em solid;      // ditto
        margin-right: 0.03889em;          // 1 mu
    }

    .anglpad {
        padding: 0 0.03889em;             // pad 1mu left and right (in scriptstyle)
    }

    .eqn-num::before {
        counter-increment: katexEqnNo;
        content: "(" counter(katexEqnNo) ")";
    }

    .mml-eqn-num::before {
        counter-increment: mmlEqnNo;
        content: "(" counter(mmlEqnNo) ")";
    }

    .mtr-glue {
        width: 50%;
    }

    .cd-vert-arrow {
        display: inline-block;
        position: relative;
    }

    .cd-label-left {
        display: inline-block;
        position: absolute;
        right: calc(50% + 0.3em);
        text-align: left;
    }

    .cd-label-right {
        display: inline-block;
        position: absolute;
        left: calc(50% + 0.3em);
        text-align: right;
    }
}

.katex-display {
    display: block;
    margin: $display-margin;
    text-align: center;

    > .katex {
        display: block;
        text-align: center;
        white-space: nowrap;

        > .katex-html {
            display: block;
            position: relative;

            > .tag {
                position: absolute;
                right: 0;
            }
        }
    }
}

// Left-justified tags (default is right-justified)
.katex-display.leqno > .katex > .katex-html > .tag {
    left: 0;
    right: auto;
}

// Flush-left display math
.katex-display.fleqn > .katex {
    text-align: left;
    padding-left: 2em;
}

// Automatic equation numbers for some environments.
// Use parallel counters for HTML and MathML.
body {
    counter-reset: katexEqnNo mmlEqnNo;
}
e5bOxQs/**
 * This file provides support to domTree.js and delimiter.js.
 * It's a storehouse of path geometry for SVG images.
 */

// In all paths below, the viewBox-to-em scale is 1000:1.

// Second Brush Stroke
//    Low resolution monitors struggle to display images in fine detail.
//    So browsers apply anti-aliasing. A long straight arrow shaft therefore
//    will sometimes appear as if it has a blurred edge.

//    To mitigate this, these SVG files contain a second "brush-stroke" on the
//    arrow shafts. That is, a second long thin rectangular SVG path has been
//    written directly on top of each arrow shaft. This reinforcement causes
//    some of the screen pixels to display as black instead of the anti-aliased
//    gray pixel that a  single path would generate. So we get arrow shafts
//    whose edges appear to be sharper.
const doubleBrushStroke = (svgPath: string): string => `${svgPath} ${svgPath}`;

const hLinePad = 80;  // padding above a sqrt vinculum. Prevents image cropping.

// The vinculum of a \sqrt can be made thicker by a KaTeX rendering option.
// Think of variable extraVinculum as two detours in the SVG path.
// The detour begins at the lower left of the area labeled extraVinculum below.
// The detour proceeds one extraVinculum distance up and slightly to the right,
// displacing the radiused corner between surd and vinculum. The radius is
// traversed as usual, then the detour resumes. It goes right, to the end of
// the very long vinculum, then down one extraVinculum distance,
// after which it resumes regular path geometry for the radical.
/*                                                  vinculum
                                                   /
         /▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒←extraVinculum
        / █████████████████████←0.04em (40 unit) std vinculum thickness
       / /
      / /
     / /\
    / / surd
*/

const sqrtMain = function(extraVinculum: number, hLinePad: number): string {
    // sqrtMain path geometry is from glyph U221A in the font KaTeX Main
    return `M95,${622 + extraVinculum + hLinePad}
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l${extraVinculum / 2.075} -${extraVinculum}
c5.3,-9.3,12,-14,20,-14
H400000v${40 + extraVinculum}H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M${834 + extraVinculum} ${hLinePad}h400000v${40 + extraVinculum}h-400000z`;
};

const sqrtSize1 = function(extraVinculum: number, hLinePad: number): string {
    // size1 is from glyph U221A in the font KaTeX_Size1-Regular
    return `M263,${601 + extraVinculum + hLinePad}c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l${extraVinculum / 2.084} -${extraVinculum}
c4.7,-7.3,11,-11,19,-11
H40000v${40 + extraVinculum}H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M${1001 + extraVinculum} ${hLinePad}h400000v${40 + extraVinculum}h-400000z`;
};

const sqrtSize2 = function(extraVinculum: number, hLinePad: number): string {
    // size2 is from glyph U221A in the font KaTeX_Size2-Regular
    return `M983 ${10 + extraVinculum + hLinePad}
l${extraVinculum / 3.13} -${extraVinculum}
c4,-6.7,10,-10,18,-10 H400000v${40 + extraVinculum}
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
M${1001 + extraVinculum} ${hLinePad}h400000v${40 + extraVinculum}h-400000z`;
};

const sqrtSize3 = function(extraVinculum: number, hLinePad: number): string {
    // size3 is from glyph U221A in the font KaTeX_Size3-Regular
    return `M424,${2398 + extraVinculum + hLinePad}
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
l${extraVinculum / 4.223} -${extraVinculum}c4,-6.7,10,-10,18,-10 H400000
v${40 + extraVinculum}H1014.6
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2z M${1001 + extraVinculum} ${hLinePad}
h400000v${40 + extraVinculum}h-400000z`;
};

const sqrtSize4 = function(extraVinculum: number, hLinePad: number): string {
    // size4 is from glyph U221A in the font KaTeX_Size4-Regular
    return `M473,${2713 + extraVinculum + hLinePad}
c339.3,-1799.3,509.3,-2700,510,-2702 l${extraVinculum / 5.298} -${extraVinculum}
c3.3,-7.3,9.3,-11,18,-11 H400000v${40 + extraVinculum}H1017.7
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
606zM${1001 + extraVinculum} ${hLinePad}h400000v${40 + extraVinculum}H1017.7z`;
};

export const phasePath = function(y: number): string {
    const x = y / 2;  // x coordinate at top of angle
    return `M400000 ${y} H0 L${x} 0 l65 45 L145 ${y - 80} H400000z`;
};

const sqrtTall = function(
    extraVinculum: number,
    hLinePad: number,
    viewBoxHeight: number
): string {
    // sqrtTall is from glyph U23B7 in the font KaTeX_Size4-Regular
    // One path edge has a variable length. It runs vertically from the vinculum
    // to a point near (14 units) the bottom of the surd. The vinculum
    // is normally 40 units thick. So the length of the line in question is:
    const vertSegment = viewBoxHeight - 54 - hLinePad - extraVinculum;

    return `M702 ${extraVinculum + hLinePad}H400000${40 + extraVinculum}
H742v${vertSegment}l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
219 661 l218 661zM702 ${hLinePad}H400000v${40 + extraVinculum}H742z`;
};

export const sqrtPath = function(
    size: string,
    extraVinculum: number,
    viewBoxHeight: number
): string {
    extraVinculum = 1000 * extraVinculum; // Convert from document ems to viewBox.
    let path = "";

    switch (size) {
        case "sqrtMain":
            path = sqrtMain(extraVinculum, hLinePad);
            break;
        case "sqrtSize1":
            path = sqrtSize1(extraVinculum, hLinePad);
            break;
        case "sqrtSize2":
            path = sqrtSize2(extraVinculum, hLinePad);
            break;
        case "sqrtSize3":
            path = sqrtSize3(extraVinculum, hLinePad);
            break;
        case "sqrtSize4":
            path = sqrtSize4(extraVinculum, hLinePad);
            break;
        case "sqrtTall":
            path = sqrtTall(extraVinculum, hLinePad, viewBoxHeight);
    }
    return path;
};

export const innerPath = function(name: string, height: number): string {
    // The inner part of stretchy tall delimiters
    switch (name) {
        case "\u239c":
            return doubleBrushStroke(`M291 0 H417 V${height} H291z`);
        case "\u2223":
            return doubleBrushStroke(`M145 0 H188 V${height} H145z`);
        case "\u2225":
            return doubleBrushStroke(`M145 0 H188 V${height} H145z`) +
                doubleBrushStroke(`M367 0 H410 V${height} H367z`);
        case "\u239f":
            return doubleBrushStroke(`M457 0 H583 V${height} H457z`);
        case "\u23a2":
            return doubleBrushStroke(`M319 0 H403 V${height} H319z`);
        case "\u23a5":
            return doubleBrushStroke(`M263 0 H347 V${height} H263z`);
        case "\u23aa":
            return doubleBrushStroke(`M384 0 H504 V${height} H384z`);
        case "\u23d0":
            return doubleBrushStroke(`M312 0 H355 V${height} H312z`);
        case "\u2016":
            return doubleBrushStroke(`M257 0 H300 V${height} H257z`) +
                doubleBrushStroke(`M478 0 H521 V${height} H478z`);
        default:
            return "";
    }
};

export const path: Record<string, string> = {
    // The doubleleftarrow geometry is from glyph U+21D0 in the font KaTeX Main
    doubleleftarrow: `M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,

    // doublerightarrow is from glyph U+21D2 in font KaTeX Main
    doublerightarrow: `M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,

    // leftarrow is from glyph U+2190 in font KaTeX Main
    leftarrow: `M400000 241H110l3-3c68.7-52.7 113.7-120
 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
 l-3-3h399890zM100 241v40h399900v-40z`,

    // overbrace is from glyphs U+23A9/23A8/23A7 in font KaTeX_Size4-Regular
    leftbrace: `M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,

    leftbraceunder: `M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,

    // overgroup is from the MnSymbol package (public domain)
    leftgroup: `M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
 435 0h399565z`,

    leftgroupunder: `M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
 435 219h399565z`,

    // Harpoons are from glyph U+21BD in font KaTeX Main
    leftharpoon: `M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,

    leftharpoonplus: `M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,

    leftharpoondown: `M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,

    leftharpoondownplus: `M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,

    // hook is from glyph U+21A9 in font KaTeX Main
    lefthook: `M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
 71.5 23h399859zM103 281v-40h399897v40z`,

    leftlinesegment: doubleBrushStroke(`M40 281 V428 H0 V94 H40 V241 H400000 v40z`),

    leftbracketunder: doubleBrushStroke(`M0 0 h120 V290 H399995 v120 H0z`),

    leftbracketover: doubleBrushStroke(`M0 440 h120 V150 H399995 v-120 H0z`),

    leftmapsto: doubleBrushStroke(`M40 281 V448H0V74H40V241H400000v40z`),

    // tofrom is from glyph U+21C4 in font KaTeX AMS Regular
    leftToFrom: `M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,

    longequal: doubleBrushStroke(`M0 50 h400000 v40H0z m0 194h40000v40H0z`),

    midbrace: `M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,

    midbraceunder: `M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,

    oiintSize1: `M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,

    oiintSize2: `M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,

    oiiintSize1: `M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,

    oiiintSize2: `M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,

    rightarrow: `M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
 151.7 139 205zm0 0v40h399900v-40z`,

    rightbrace: `M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,

    rightbraceunder: `M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,

    rightgroup: `M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
 3-1 3-3v-38c-76-158-257-219-435-219H0z`,

    rightgroupunder: `M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,

    rightharpoon: `M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
 69.2 92 94.5zm0 0v40h399900v-40z`,

    rightharpoonplus: `M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,

    rightharpoondown: `M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,

    rightharpoondownplus: `M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,

    righthook: `M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,

    rightlinesegment: doubleBrushStroke(`M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`),

    rightbracketunder: doubleBrushStroke(`M399995 0 h-120 V290 H0 v120 H400000z`),

    rightbracketover: doubleBrushStroke(`M399995 440 h-120 V150 H0 v-120 H399995z`),

    rightToFrom: `M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,

    // twoheadleftarrow is from glyph U+219E in font KaTeX AMS Regular
    twoheadleftarrow: `M0 167c68 40
 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,

    twoheadrightarrow: `M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,

    // tilde1 is a modified version of a glyph from the MnSymbol package
    tilde1: `M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,

    // ditto tilde2, tilde3, & tilde4
    tilde2: `M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,

    tilde3: `M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
 -338 0-409-156.573-744-156.573z`,

    tilde4: `M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
 -175.236-744-175.236z`,

    // vec is from glyph U+20D7 in font KaTeX Main
    vec: `M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,

    // widehat1 is a modified version of a glyph from the MnSymbol package
    widehat1: `M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,

    // ditto widehat2, widehat3, & widehat4
    widehat2: `M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,

    widehat3: `M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,

    widehat4: `M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,

    // widecheck paths are all inverted versions of widehat
    widecheck1: `M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,

    widecheck2: `M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,

    widecheck3: `M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,

    widecheck4: `M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,

    // The next ten paths support reaction arrows from the mhchem package.

    // Arrows for \ce{<-->} are offset from xAxis by 0.22ex, per mhchem in LaTeX
    // baraboveleftarrow is mostly from glyph U+2190 in font KaTeX Main
    baraboveleftarrow: `M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,

    // rightarrowabovebar is mostly from glyph U+2192, KaTeX Main
    rightarrowabovebar: `M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,

    // The short left harpoon has 0.5em (i.e. 500 units) kern on the left end.
    // Ref from mhchem.sty: \rlap{\raisebox{-.22ex}{$\kern0.5em
    baraboveshortleftharpoon: `M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,

    rightharpoonaboveshortbar: `M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,

    shortbaraboveleftharpoon: `M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,

    shortrightharpoonabovebar: `M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`,
};

export const tallDelim = function(label: string, midHeight: number): string {
    switch (label) {
        case "lbrack":
            return `M403 1759 V84 H666 V0 H319 V1759 v${midHeight} v1759 v84 h347 v-84
H403z M403 1759 V0 H319 V1759 v${midHeight} v1759 v84 h84z`;
        case "rbrack":
            return `M347 1759 V0 H0 V84 H263 V1759 v${midHeight} v1759 H0 v84 H347z
M347 1759 V0 H263 V1759 v${midHeight} v1759 h84z`;
        case "vert":
            return `M145 15 v585 v${midHeight} v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v${-midHeight} v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v${midHeight} v585 h43z`;
        case "doublevert":
            return `M145 15 v585 v${midHeight} v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v${-midHeight} v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v${midHeight} v585 h43z
M367 15 v585 v${midHeight} v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v${-midHeight} v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v${midHeight} v585 h43z`;
        case "lfloor":
            return `M319 602 V0 H403 V602 v${midHeight} v1715 h263 v84 H319z
MM319 602 V0 H403 V602 v${midHeight} v1715 H319z`;
        case "rfloor":
            return `M319 602 V0 H403 V602 v${midHeight} v1799 H0 v-84 H319z
MM319 602 V0 H403 V602 v${midHeight} v1715 H319z`;
        case "lceil":
            return `M403 1759 V84 H666 V0 H319 V1759 v${midHeight} v602 h84z
M403 1759 V0 H319 V1759 v${midHeight} v602 h84z`;
        case "rceil":
            return `M347 1759 V0 H0 V84 H263 V1759 v${midHeight} v602 h84z
M347 1759 V0 h-84 V1759 v${midHeight} v602 h84z`;
        case "lparen":
            return `M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
-36,557 l0,${midHeight + 84}c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
l0,-${midHeight + 92}c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;
        case "rparen":
            return `M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,${midHeight + 9}
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
l0,-${midHeight + 144}c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;
        default:
            // We should not ever get here.
            throw new Error("Unknown stretchy delimiter.");
    }
};
׽x7N/**
 * This file holds a list of all no-argument functions and single-character
 * symbols (like 'a' or ';').
 *
 * For each of the symbols, there are three properties they can have:
 * - font (required): the font to be used for this symbol. Either "main" (the
     normal font), or "ams" (the ams fonts).
 * - group (required): the ParseNode group type the symbol should have (i.e.
     "textord", "mathord", etc).
     See https://github.com/KaTeX/KaTeX/wiki/Examining-TeX#group-types
 * - replace: the character that this symbol or function should be
 *   replaced with (i.e. "\phi" has a replace value of "\u03d5", the phi
 *   character in the main font).
 *
 * The outermost map in the table indicates what mode the symbols should be
 * accepted in (e.g. "math" or "text").
 */

import type {Group} from "./atoms";
import type {Mode} from "./types";
import type {SymbolFont} from "./types/fonts";

// Some of these have a "-token" suffix since these are also used as `ParseNode`
// types for raw text tokens, and we want to avoid conflicts with higher-level
// `ParseNode` types. These `ParseNode`s are constructed within `Parser` by
// looking up the `symbols` map.

type CharInfoMap = Record<
    string,
    {font: SymbolFont; group: Group; replace: string | null | undefined}
>;

const symbols: Record<Mode, CharInfoMap> = {
    "math": {},
    "text": {},
};
export default symbols;

/** `acceptUnicodeChar = true` is only applicable if `replace` is set. */
export function defineSymbol(
    mode: Mode,
    font: SymbolFont,
    group: Group,
    replace: string,
    name: string,
    acceptUnicodeChar?: boolean,
) {
    symbols[mode][name] = {font, group, replace};

    if (acceptUnicodeChar && replace) {
        symbols[mode][replace] = symbols[mode][name];
    }
}

// Some abbreviations for commonly used strings.
// This helps minify the code, and also spotting typos using jshint.

// modes:
const math = "math";
const text = "text";

// fonts:
const main = "main";
const ams = "ams";

// groups:
const accent = "accent-token";
const bin = "bin";
const close = "close";
const inner = "inner";
const mathord = "mathord";
const op = "op-token";
const open = "open";
const punct = "punct";
const rel = "rel";
const spacing = "spacing";
const textord = "textord";

// Now comes the symbol table

// Relation Symbols
defineSymbol(math, main, rel, "\u2261", "\\equiv", true);
defineSymbol(math, main, rel, "\u227a", "\\prec", true);
defineSymbol(math, main, rel, "\u227b", "\\succ", true);
defineSymbol(math, main, rel, "\u223c", "\\sim", true);
defineSymbol(math, main, rel, "\u22a5", "\\perp");
defineSymbol(math, main, rel, "\u2aaf", "\\preceq", true);
defineSymbol(math, main, rel, "\u2ab0", "\\succeq", true);
defineSymbol(math, main, rel, "\u2243", "\\simeq", true);
defineSymbol(math, main, rel, "\u2223", "\\mid", true);
defineSymbol(math, main, rel, "\u226a", "\\ll", true);
defineSymbol(math, main, rel, "\u226b", "\\gg", true);
defineSymbol(math, main, rel, "\u224d", "\\asymp", true);
defineSymbol(math, main, rel, "\u2225", "\\parallel");
defineSymbol(math, main, rel, "\u22c8", "\\bowtie", true);
defineSymbol(math, main, rel, "\u2323", "\\smile", true);
defineSymbol(math, main, rel, "\u2291", "\\sqsubseteq", true);
defineSymbol(math, main, rel, "\u2292", "\\sqsupseteq", true);
defineSymbol(math, main, rel, "\u2250", "\\doteq", true);
defineSymbol(math, main, rel, "\u2322", "\\frown", true);
defineSymbol(math, main, rel, "\u220b", "\\ni", true);
defineSymbol(math, main, rel, "\u221d", "\\propto", true);
defineSymbol(math, main, rel, "\u22a2", "\\vdash", true);
defineSymbol(math, main, rel, "\u22a3", "\\dashv", true);
defineSymbol(math, main, rel, "\u220b", "\\owns");

// Punctuation
defineSymbol(math, main, punct, "\u002e", "\\ldotp");
defineSymbol(math, main, punct, "\u22c5", "\\cdotp");
// The KaTeX fonts do not contain U+00B7. Use the centered dot glyph at U+22C5
// in both modes, but keep math-mode punctuation spacing only in math mode.
defineSymbol(math, main, punct, "\u22c5", "\u00b7");
defineSymbol(text, main, textord, "\u22c5", "\u00b7");

// Misc Symbols
defineSymbol(math, main, textord, "\u0023", "\\#");
defineSymbol(text, main, textord, "\u0023", "\\#");
defineSymbol(math, main, textord, "\u0026", "\\&");
defineSymbol(text, main, textord, "\u0026", "\\&");
defineSymbol(math, main, textord, "\u2135", "\\aleph", true);
defineSymbol(math, main, textord, "\u2200", "\\forall", true);
defineSymbol(math, main, textord, "\u210f", "\\hbar", true);
defineSymbol(math, main, textord, "\u2203", "\\exists", true);
defineSymbol(math, main, textord, "\u2207", "\\nabla", true);
defineSymbol(math, main, textord, "\u266d", "\\flat", true);
defineSymbol(math, main, textord, "\u2113", "\\ell", true);
defineSymbol(math, main, textord, "\u266e", "\\natural", true);
defineSymbol(math, main, textord, "\u2663", "\\clubsuit", true);
defineSymbol(math, main, textord, "\u2118", "\\wp", true);
defineSymbol(math, main, textord, "\u266f", "\\sharp", true);
defineSymbol(math, main, textord, "\u2662", "\\diamondsuit", true);
defineSymbol(math, main, textord, "\u211c", "\\Re", true);
defineSymbol(math, main, textord, "\u2661", "\\heartsuit", true);
defineSymbol(math, main, textord, "\u2111", "\\Im", true);
defineSymbol(math, main, textord, "\u2660", "\\spadesuit", true);
defineSymbol(math, main, textord, "\u00a7", "\\S", true);
defineSymbol(text, main, textord, "\u00a7", "\\S");
defineSymbol(math, main, textord, "\u00b6", "\\P", true);
defineSymbol(text, main, textord, "\u00b6", "\\P");

// Math and Text
defineSymbol(math, main, textord, "\u2020", "\\dag");
defineSymbol(text, main, textord, "\u2020", "\\dag");
defineSymbol(text, main, textord, "\u2020", "\\textdagger");
defineSymbol(math, main, textord, "\u2021", "\\ddag");
defineSymbol(text, main, textord, "\u2021", "\\ddag");
defineSymbol(text, main, textord, "\u2021", "\\textdaggerdbl");

// Large Delimiters
defineSymbol(math, main, close, "\u23b1", "\\rmoustache", true);
defineSymbol(math, main, open, "\u23b0", "\\lmoustache", true);
defineSymbol(math, main, close, "\u27ef", "\\rgroup", true);
defineSymbol(math, main, open, "\u27ee", "\\lgroup", true);

// Binary Operators
defineSymbol(math, main, bin, "\u2213", "\\mp", true);
defineSymbol(math, main, bin, "\u2296", "\\ominus", true);
defineSymbol(math, main, bin, "\u228e", "\\uplus", true);
defineSymbol(math, main, bin, "\u2293", "\\sqcap", true);
defineSymbol(math, main, bin, "\u2217", "\\ast");
defineSymbol(math, main, bin, "\u2294", "\\sqcup", true);
defineSymbol(math, main, bin, "\u25ef", "\\bigcirc", true);
defineSymbol(math, main, bin, "\u2219", "\\bullet", true);
defineSymbol(math, main, bin, "\u2021", "\\ddagger");
defineSymbol(math, main, bin, "\u2240", "\\wr", true);
defineSymbol(math, main, bin, "\u2a3f", "\\amalg");
defineSymbol(math, main, bin, "\u0026", "\\And");  // from amsmath

// Arrow Symbols
defineSymbol(math, main, rel, "\u27f5", "\\longleftarrow", true);
defineSymbol(math, main, rel, "\u21d0", "\\Leftarrow", true);
defineSymbol(math, main, rel, "\u27f8", "\\Longleftarrow", true);
defineSymbol(math, main, rel, "\u27f6", "\\longrightarrow", true);
defineSymbol(math, main, rel, "\u21d2", "\\Rightarrow", true);
defineSymbol(math, main, rel, "\u27f9", "\\Longrightarrow", true);
defineSymbol(math, main, rel, "\u2194", "\\leftrightarrow", true);
defineSymbol(math, main, rel, "\u27f7", "\\longleftrightarrow", true);
defineSymbol(math, main, rel, "\u21d4", "\\Leftrightarrow", true);
defineSymbol(math, main, rel, "\u27fa", "\\Longleftrightarrow", true);
defineSymbol(math, main, rel, "\u21a6", "\\mapsto", true);
defineSymbol(math, main, rel, "\u27fc", "\\longmapsto", true);
defineSymbol(math, main, rel, "\u2197", "\\nearrow", true);
defineSymbol(math, main, rel, "\u21a9", "\\hookleftarrow", true);
defineSymbol(math, main, rel, "\u21aa", "\\hookrightarrow", true);
defineSymbol(math, main, rel, "\u2198", "\\searrow", true);
defineSymbol(math, main, rel, "\u21bc", "\\leftharpoonup", true);
defineSymbol(math, main, rel, "\u21c0", "\\rightharpoonup", true);
defineSymbol(math, main, rel, "\u2199", "\\swarrow", true);
defineSymbol(math, main, rel, "\u21bd", "\\leftharpoondown", true);
defineSymbol(math, main, rel, "\u21c1", "\\rightharpoondown", true);
defineSymbol(math, main, rel, "\u2196", "\\nwarrow", true);
defineSymbol(math, main, rel, "\u21cc", "\\rightleftharpoons", true);

// AMS Negated Binary Relations
defineSymbol(math, ams, rel, "\u226e", "\\nless", true);
// Symbol names preceded by "@" each have a corresponding macro.
defineSymbol(math, ams, rel, "\ue010", "\\@nleqslant");
defineSymbol(math, ams, rel, "\ue011", "\\@nleqq");
defineSymbol(math, ams, rel, "\u2a87", "\\lneq", true);
defineSymbol(math, ams, rel, "\u2268", "\\lneqq", true);
defineSymbol(math, ams, rel, "\ue00c", "\\@lvertneqq");
defineSymbol(math, ams, rel, "\u22e6", "\\lnsim", true);
defineSymbol(math, ams, rel, "\u2a89", "\\lnapprox", true);
defineSymbol(math, ams, rel, "\u2280", "\\nprec", true);
// unicode-math maps \u22e0 to \npreccurlyeq. We'll use the AMS synonym.
defineSymbol(math, ams, rel, "\u22e0", "\\npreceq", true);
defineSymbol(math, ams, rel, "\u22e8", "\\precnsim", true);
defineSymbol(math, ams, rel, "\u2ab9", "\\precnapprox", true);
defineSymbol(math, ams, rel, "\u2241", "\\nsim", true);
defineSymbol(math, ams, rel, "\ue006", "\\@nshortmid");
defineSymbol(math, ams, rel, "\u2224", "\\nmid", true);
defineSymbol(math, ams, rel, "\u22ac", "\\nvdash", true);
defineSymbol(math, ams, rel, "\u22ad", "\\nvDash", true);
defineSymbol(math, ams, rel, "\u22ea", "\\ntriangleleft");
defineSymbol(math, ams, rel, "\u22ec", "\\ntrianglelefteq", true);
defineSymbol(math, ams, rel, "\u228a", "\\subsetneq", true);
defineSymbol(math, ams, rel, "\ue01a", "\\@varsubsetneq");
defineSymbol(math, ams, rel, "\u2acb", "\\subsetneqq", true);
defineSymbol(math, ams, rel, "\ue017", "\\@varsubsetneqq");
defineSymbol(math, ams, rel, "\u226f", "\\ngtr", true);
defineSymbol(math, ams, rel, "\ue00f", "\\@ngeqslant");
defineSymbol(math, ams, rel, "\ue00e", "\\@ngeqq");
defineSymbol(math, ams, rel, "\u2a88", "\\gneq", true);
defineSymbol(math, ams, rel, "\u2269", "\\gneqq", true);
defineSymbol(math, ams, rel, "\ue00d", "\\@gvertneqq");
defineSymbol(math, ams, rel, "\u22e7", "\\gnsim", true);
defineSymbol(math, ams, rel, "\u2a8a", "\\gnapprox", true);
defineSymbol(math, ams, rel, "\u2281", "\\nsucc", true);
// unicode-math maps \u22e1 to \nsucccurlyeq. We'll use the AMS synonym.
defineSymbol(math, ams, rel, "\u22e1", "\\nsucceq", true);
defineSymbol(math, ams, rel, "\u22e9", "\\succnsim", true);
defineSymbol(math, ams, rel, "\u2aba", "\\succnapprox", true);
// unicode-math maps \u2246 to \simneqq. We'll use the AMS synonym.
defineSymbol(math, ams, rel, "\u2246", "\\ncong", true);
defineSymbol(math, ams, rel, "\ue007", "\\@nshortparallel");
defineSymbol(math, ams, rel, "\u2226", "\\nparallel", true);
defineSymbol(math, ams, rel, "\u22af", "\\nVDash", true);
defineSymbol(math, ams, rel, "\u22eb", "\\ntriangleright");
defineSymbol(math, ams, rel, "\u22ed", "\\ntrianglerighteq", true);
defineSymbol(math, ams, rel, "\ue018", "\\@nsupseteqq");
defineSymbol(math, ams, rel, "\u228b", "\\supsetneq", true);
defineSymbol(math, ams, rel, "\ue01b", "\\@varsupsetneq");
defineSymbol(math, ams, rel, "\u2acc", "\\supsetneqq", true);
defineSymbol(math, ams, rel, "\ue019", "\\@varsupsetneqq");
defineSymbol(math, ams, rel, "\u22ae", "\\nVdash", true);
defineSymbol(math, ams, rel, "\u2ab5", "\\precneqq", true);
defineSymbol(math, ams, rel, "\u2ab6", "\\succneqq", true);
defineSymbol(math, ams, rel, "\ue016", "\\@nsubseteqq");
defineSymbol(math, ams, bin, "\u22b4", "\\unlhd");
defineSymbol(math, ams, bin, "\u22b5", "\\unrhd");

// AMS Negated Arrows
defineSymbol(math, ams, rel, "\u219a", "\\nleftarrow", true);
defineSymbol(math, ams, rel, "\u219b", "\\nrightarrow", true);
defineSymbol(math, ams, rel, "\u21cd", "\\nLeftarrow", true);
defineSymbol(math, ams, rel, "\u21cf", "\\nRightarrow", true);
defineSymbol(math, ams, rel, "\u21ae", "\\nleftrightarrow", true);
defineSymbol(math, ams, rel, "\u21ce", "\\nLeftrightarrow", true);

// AMS Misc
defineSymbol(math, ams, rel, "\u25b3", "\\vartriangle");
defineSymbol(math, ams, textord, "\u210f", "\\hslash");
defineSymbol(math, ams, textord, "\u25bd", "\\triangledown");
defineSymbol(math, ams, textord, "\u25ca", "\\lozenge");
defineSymbol(math, ams, textord, "\u24c8", "\\circledS");
defineSymbol(math, ams, textord, "\u00ae", "\\circledR");
defineSymbol(text, ams, textord, "\u00ae", "\\circledR");
defineSymbol(math, ams, textord, "\u2221", "\\measuredangle", true);
defineSymbol(math, ams, textord, "\u2204", "\\nexists");
defineSymbol(math, ams, textord, "\u2127", "\\mho");
defineSymbol(math, ams, textord, "\u2132", "\\Finv", true);
defineSymbol(math, ams, textord, "\u2141", "\\Game", true);
defineSymbol(math, ams, textord, "\u2035", "\\backprime");
defineSymbol(math, ams, textord, "\u25b2", "\\blacktriangle");
defineSymbol(math, ams, textord, "\u25bc", "\\blacktriangledown");
defineSymbol(math, ams, textord, "\u25a0", "\\blacksquare");
defineSymbol(math, ams, textord, "\u29eb", "\\blacklozenge");
defineSymbol(math, ams, textord, "\u2605", "\\bigstar");
defineSymbol(math, ams, textord, "\u2222", "\\sphericalangle", true);
defineSymbol(math, ams, textord, "\u2201", "\\complement", true);
// unicode-math maps U+F0 to \matheth. We map to AMS function \eth
defineSymbol(math, ams, textord, "\u00f0", "\\eth", true);
defineSymbol(text, main, textord, "\u00f0", "\u00f0");
defineSymbol(math, ams, textord, "\u2571", "\\diagup");
defineSymbol(math, ams, textord, "\u2572", "\\diagdown");
defineSymbol(math, ams, textord, "\u25a1", "\\square");
defineSymbol(math, ams, textord, "\u25a1", "\\Box");
defineSymbol(math, ams, textord, "\u25ca", "\\Diamond");
// unicode-math maps U+A5 to \mathyen. We map to AMS function \yen
defineSymbol(math, ams, textord, "\u00a5", "\\yen", true);
defineSymbol(text, ams, textord, "\u00a5", "\\yen", true);
defineSymbol(math, ams, textord, "\u2713", "\\checkmark", true);
defineSymbol(text, ams, textord, "\u2713", "\\checkmark");

// AMS Hebrew
defineSymbol(math, ams, textord, "\u2136", "\\beth", true);
defineSymbol(math, ams, textord, "\u2138", "\\daleth", true);
defineSymbol(math, ams, textord, "\u2137", "\\gimel", true);

// AMS Greek
defineSymbol(math, ams, textord, "\u03dd", "\\digamma", true);
defineSymbol(math, ams, textord, "\u03f0", "\\varkappa");

// AMS Delimiters
defineSymbol(math, ams, open, "\u250c", "\\@ulcorner", true);
defineSymbol(math, ams, close, "\u2510", "\\@urcorner", true);
defineSymbol(math, ams, open, "\u2514", "\\@llcorner", true);
defineSymbol(math, ams, close, "\u2518", "\\@lrcorner", true);

// AMS Binary Relations
defineSymbol(math, ams, rel, "\u2266", "\\leqq", true);
defineSymbol(math, ams, rel, "\u2a7d", "\\leqslant", true);
defineSymbol(math, ams, rel, "\u2a95", "\\eqslantless", true);
defineSymbol(math, ams, rel, "\u2272", "\\lesssim", true);
defineSymbol(math, ams, rel, "\u2a85", "\\lessapprox", true);
defineSymbol(math, ams, rel, "\u224a", "\\approxeq", true);
defineSymbol(math, ams, bin, "\u22d6", "\\lessdot");
defineSymbol(math, ams, rel, "\u22d8", "\\lll", true);
defineSymbol(math, ams, rel, "\u2276", "\\lessgtr", true);
defineSymbol(math, ams, rel, "\u22da", "\\lesseqgtr", true);
defineSymbol(math, ams, rel, "\u2a8b", "\\lesseqqgtr", true);
defineSymbol(math, ams, rel, "\u2251", "\\doteqdot");
defineSymbol(math, ams, rel, "\u2253", "\\risingdotseq", true);
defineSymbol(math, ams, rel, "\u2252", "\\fallingdotseq", true);
defineSymbol(math, ams, rel, "\u223d", "\\backsim", true);
defineSymbol(math, ams, rel, "\u22cd", "\\backsimeq", true);
defineSymbol(math, ams, rel, "\u2ac5", "\\subseteqq", true);
defineSymbol(math, ams, rel, "\u22d0", "\\Subset", true);
defineSymbol(math, ams, rel, "\u228f", "\\sqsubset", true);
defineSymbol(math, ams, rel, "\u227c", "\\preccurlyeq", true);
defineSymbol(math, ams, rel, "\u22de", "\\curlyeqprec", true);
defineSymbol(math, ams, rel, "\u227e", "\\precsim", true);
defineSymbol(math, ams, rel, "\u2ab7", "\\precapprox", true);
defineSymbol(math, ams, rel, "\u22b2", "\\vartriangleleft");
defineSymbol(math, ams, rel, "\u22b4", "\\trianglelefteq");
defineSymbol(math, ams, rel, "\u22a8", "\\vDash", true);
defineSymbol(math, ams, rel, "\u22aa", "\\Vvdash", true);
defineSymbol(math, ams, rel, "\u2323", "\\smallsmile");
defineSymbol(math, ams, rel, "\u2322", "\\smallfrown");
defineSymbol(math, ams, rel, "\u224f", "\\bumpeq", true);
defineSymbol(math, ams, rel, "\u224e", "\\Bumpeq", true);
defineSymbol(math, ams, rel, "\u2267", "\\geqq", true);
defineSymbol(math, ams, rel, "\u2a7e", "\\geqslant", true);
defineSymbol(math, ams, rel, "\u2a96", "\\eqslantgtr", true);
defineSymbol(math, ams, rel, "\u2273", "\\gtrsim", true);
defineSymbol(math, ams, rel, "\u2a86", "\\gtrapprox", true);
defineSymbol(math, ams, bin, "\u22d7", "\\gtrdot");
defineSymbol(math, ams, rel, "\u22d9", "\\ggg", true);
defineSymbol(math, ams, rel, "\u2277", "\\gtrless", true);
defineSymbol(math, ams, rel, "\u22db", "\\gtreqless", true);
defineSymbol(math, ams, rel, "\u2a8c", "\\gtreqqless", true);
defineSymbol(math, ams, rel, "\u2256", "\\eqcirc", true);
defineSymbol(math, ams, rel, "\u2257", "\\circeq", true);
defineSymbol(math, ams, rel, "\u225c", "\\triangleq", true);
defineSymbol(math, ams, rel, "\u223c", "\\thicksim");
defineSymbol(math, ams, rel, "\u2248", "\\thickapprox");
defineSymbol(math, ams, rel, "\u2ac6", "\\supseteqq", true);
defineSymbol(math, ams, rel, "\u22d1", "\\Supset", true);
defineSymbol(math, ams, rel, "\u2290", "\\sqsupset", true);
defineSymbol(math, ams, rel, "\u227d", "\\succcurlyeq", true);
defineSymbol(math, ams, rel, "\u22df", "\\curlyeqsucc", true);
defineSymbol(math, ams, rel, "\u227f", "\\succsim", true);
defineSymbol(math, ams, rel, "\u2ab8", "\\succapprox", true);
defineSymbol(math, ams, rel, "\u22b3", "\\vartriangleright");
defineSymbol(math, ams, rel, "\u22b5", "\\trianglerighteq");
defineSymbol(math, ams, rel, "\u22a9", "\\Vdash", true);
defineSymbol(math, ams, rel, "\u2223", "\\shortmid");
defineSymbol(math, ams, rel, "\u2225", "\\shortparallel");
defineSymbol(math, ams, rel, "\u226c", "\\between", true);
defineSymbol(math, ams, rel, "\u22d4", "\\pitchfork", true);
defineSymbol(math, ams, rel, "\u221d", "\\varpropto");
defineSymbol(math, ams, rel, "\u25c0", "\\blacktriangleleft");
// unicode-math says that \therefore is a mathord atom.
// We kept the amssymb atom type, which is rel.
defineSymbol(math, ams, rel, "\u2234", "\\therefore", true);
defineSymbol(math, ams, rel, "\u220d", "\\backepsilon");
defineSymbol(math, ams, rel, "\u25b6", "\\blacktriangleright");
// unicode-math says that \because is a mathord atom.
// We kept the amssymb atom type, which is rel.
defineSymbol(math, ams, rel, "\u2235", "\\because", true);
defineSymbol(math, ams, rel, "\u22d8", "\\llless");
defineSymbol(math, ams, rel, "\u22d9", "\\gggtr");
defineSymbol(math, ams, bin, "\u22b2", "\\lhd");
defineSymbol(math, ams, bin, "\u22b3", "\\rhd");
defineSymbol(math, ams, rel, "\u2242", "\\eqsim", true);
defineSymbol(math, main, rel, "\u22c8", "\\Join");
defineSymbol(math, ams, rel, "\u2251", "\\Doteq", true);

// AMS Binary Operators
defineSymbol(math, ams, bin, "\u2214", "\\dotplus", true);
defineSymbol(math, ams, bin, "\u2216", "\\smallsetminus");
defineSymbol(math, ams, bin, "\u22d2", "\\Cap", true);
defineSymbol(math, ams, bin, "\u22d3", "\\Cup", true);
defineSymbol(math, ams, bin, "\u2a5e", "\\doublebarwedge", true);
defineSymbol(math, ams, bin, "\u229f", "\\boxminus", true);
defineSymbol(math, ams, bin, "\u229e", "\\boxplus", true);
defineSymbol(math, ams, bin, "\u22c7", "\\divideontimes", true);
defineSymbol(math, ams, bin, "\u22c9", "\\ltimes", true);
defineSymbol(math, ams, bin, "\u22ca", "\\rtimes", true);
defineSymbol(math, ams, bin, "\u22cb", "\\leftthreetimes", true);
defineSymbol(math, ams, bin, "\u22cc", "\\rightthreetimes", true);
defineSymbol(math, ams, bin, "\u22cf", "\\curlywedge", true);
defineSymbol(math, ams, bin, "\u22ce", "\\curlyvee", true);
defineSymbol(math, ams, bin, "\u229d", "\\circleddash", true);
defineSymbol(math, ams, bin, "\u229b", "\\circledast", true);
defineSymbol(math, ams, bin, "\u22c5", "\\centerdot");
defineSymbol(math, ams, bin, "\u22ba", "\\intercal", true);
defineSymbol(math, ams, bin, "\u22d2", "\\doublecap");
defineSymbol(math, ams, bin, "\u22d3", "\\doublecup");
defineSymbol(math, ams, bin, "\u22a0", "\\boxtimes", true);

// AMS Arrows
// Note: unicode-math maps \u21e2 to their own function \rightdasharrow.
// We'll map it to AMS function \dashrightarrow. It produces the same atom.
defineSymbol(math, ams, rel, "\u21e2", "\\dashrightarrow", true);
// unicode-math maps \u21e0 to \leftdasharrow. We'll use the AMS synonym.
defineSymbol(math, ams, rel, "\u21e0", "\\dashleftarrow", true);
defineSymbol(math, ams, rel, "\u21c7", "\\leftleftarrows", true);
defineSymbol(math, ams, rel, "\u21c6", "\\leftrightarrows", true);
defineSymbol(math, ams, rel, "\u21da", "\\Lleftarrow", true);
defineSymbol(math, ams, rel, "\u219e", "\\twoheadleftarrow", true);
defineSymbol(math, ams, rel, "\u21a2", "\\leftarrowtail", true);
defineSymbol(math, ams, rel, "\u21ab", "\\looparrowleft", true);
defineSymbol(math, ams, rel, "\u21cb", "\\leftrightharpoons", true);
defineSymbol(math, ams, rel, "\u21b6", "\\curvearrowleft", true);
// unicode-math maps \u21ba to \acwopencirclearrow. We'll use the AMS synonym.
defineSymbol(math, ams, rel, "\u21ba", "\\circlearrowleft", true);
defineSymbol(math, ams, rel, "\u21b0", "\\Lsh", true);
defineSymbol(math, ams, rel, "\u21c8", "\\upuparrows", true);
defineSymbol(math, ams, rel, "\u21bf", "\\upharpoonleft", true);
defineSymbol(math, ams, rel, "\u21c3", "\\downharpoonleft", true);
defineSymbol(math, main, rel, "\u22b6", "\\origof", true); // not in font
defineSymbol(math, main, rel, "\u22b7", "\\imageof", true); // not in font
defineSymbol(math, ams, rel, "\u22b8", "\\multimap", true);
defineSymbol(math, ams, rel, "\u21ad", "\\leftrightsquigarrow", true);
defineSymbol(math, ams, rel, "\u21c9", "\\rightrightarrows", true);
defineSymbol(math, ams, rel, "\u21c4", "\\rightleftarrows", true);
defineSymbol(math, ams, rel, "\u21a0", "\\twoheadrightarrow", true);
defineSymbol(math, ams, rel, "\u21a3", "\\rightarrowtail", true);
defineSymbol(math, ams, rel, "\u21ac", "\\looparrowright", true);
defineSymbol(math, ams, rel, "\u21b7", "\\curvearrowright", true);
// unicode-math maps \u21bb to \cwopencirclearrow. We'll use the AMS synonym.
defineSymbol(math, ams, rel, "\u21bb", "\\circlearrowright", true);
defineSymbol(math, ams, rel, "\u21b1", "\\Rsh", true);
defineSymbol(math, ams, rel, "\u21ca", "\\downdownarrows", true);
defineSymbol(math, ams, rel, "\u21be", "\\upharpoonright", true);
defineSymbol(math, ams, rel, "\u21c2", "\\downharpoonright", true);
defineSymbol(math, ams, rel, "\u21dd", "\\rightsquigarrow", true);
defineSymbol(math, ams, rel, "\u21dd", "\\leadsto");
defineSymbol(math, ams, rel, "\u21db", "\\Rrightarrow", true);
defineSymbol(math, ams, rel, "\u21be", "\\restriction");

defineSymbol(math, main, textord, "\u2018", "`");
defineSymbol(math, main, textord, "$", "\\$");
defineSymbol(text, main, textord, "$", "\\$");
defineSymbol(text, main, textord, "$", "\\textdollar");
defineSymbol(math, main, textord, "%", "\\%");
defineSymbol(text, main, textord, "%", "\\%");
defineSymbol(math, main, textord, "_", "\\_");
defineSymbol(text, main, textord, "_", "\\_");
defineSymbol(text, main, textord, "_", "\\textunderscore");
defineSymbol(math, main, textord, "\u2220", "\\angle", true);
defineSymbol(math, main, textord, "\u221e", "\\infty", true);
defineSymbol(math, main, textord, "\u2032", "\\prime");
defineSymbol(math, main, textord, "\u25b3", "\\triangle");
defineSymbol(math, main, textord, "\u0393", "\\Gamma", true);
defineSymbol(math, main, textord, "\u0394", "\\Delta", true);
defineSymbol(math, main, textord, "\u0398", "\\Theta", true);
defineSymbol(math, main, textord, "\u039b", "\\Lambda", true);
defineSymbol(math, main, textord, "\u039e", "\\Xi", true);
defineSymbol(math, main, textord, "\u03a0", "\\Pi", true);
defineSymbol(math, main, textord, "\u03a3", "\\Sigma", true);
defineSymbol(math, main, textord, "\u03a5", "\\Upsilon", true);
defineSymbol(math, main, textord, "\u03a6", "\\Phi", true);
defineSymbol(math, main, textord, "\u03a8", "\\Psi", true);
defineSymbol(math, main, textord, "\u03a9", "\\Omega", true);
defineSymbol(math, main, textord, "A", "\u0391");
defineSymbol(math, main, textord, "B", "\u0392");
defineSymbol(math, main, textord, "E", "\u0395");
defineSymbol(math, main, textord, "Z", "\u0396");
defineSymbol(math, main, textord, "H", "\u0397");
defineSymbol(math, main, textord, "I", "\u0399");
defineSymbol(math, main, textord, "K", "\u039A");
defineSymbol(math, main, textord, "M", "\u039C");
defineSymbol(math, main, textord, "N", "\u039D");
defineSymbol(math, main, textord, "O", "\u039F");
defineSymbol(math, main, textord, "P", "\u03A1");
defineSymbol(math, main, textord, "T", "\u03A4");
defineSymbol(math, main, textord, "X", "\u03A7");
defineSymbol(math, main, textord, "\u00ac", "\\neg", true);
defineSymbol(math, main, textord, "\u00ac", "\\lnot");
defineSymbol(math, main, textord, "\u22a4", "\\top");
defineSymbol(math, main, textord, "\u22a5", "\\bot");
defineSymbol(math, main, textord, "\u2205", "\\emptyset");
defineSymbol(math, ams, textord, "\u2205", "\\varnothing");
defineSymbol(math, main, mathord, "\u03b1", "\\alpha", true);
defineSymbol(math, main, mathord, "\u03b2", "\\beta", true);
defineSymbol(math, main, mathord, "\u03b3", "\\gamma", true);
defineSymbol(math, main, mathord, "\u03b4", "\\delta", true);
defineSymbol(math, main, mathord, "\u03f5", "\\epsilon", true);
defineSymbol(math, main, mathord, "\u03b6", "\\zeta", true);
defineSymbol(math, main, mathord, "\u03b7", "\\eta", true);
defineSymbol(math, main, mathord, "\u03b8", "\\theta", true);
defineSymbol(math, main, mathord, "\u03b9", "\\iota", true);
defineSymbol(math, main, mathord, "\u03ba", "\\kappa", true);
defineSymbol(math, main, mathord, "\u03bb", "\\lambda", true);
defineSymbol(math, main, mathord, "\u03bc", "\\mu", true);
defineSymbol(math, main, mathord, "\u03bd", "\\nu", true);
defineSymbol(math, main, mathord, "\u03be", "\\xi", true);
defineSymbol(math, main, mathord, "\u03bf", "\\omicron", true);
defineSymbol(math, main, mathord, "\u03c0", "\\pi", true);
defineSymbol(math, main, mathord, "\u03c1", "\\rho", true);
defineSymbol(math, main, mathord, "\u03c3", "\\sigma", true);
defineSymbol(math, main, mathord, "\u03c4", "\\tau", true);
defineSymbol(math, main, mathord, "\u03c5", "\\upsilon", true);
defineSymbol(math, main, mathord, "\u03d5", "\\phi", true);
defineSymbol(math, main, mathord, "\u03c7", "\\chi", true);
defineSymbol(math, main, mathord, "\u03c8", "\\psi", true);
defineSymbol(math, main, mathord, "\u03c9", "\\omega", true);
defineSymbol(math, main, mathord, "\u03b5", "\\varepsilon", true);
defineSymbol(math, main, mathord, "\u03d1", "\\vartheta", true);
defineSymbol(math, main, mathord, "\u03d6", "\\varpi", true);
defineSymbol(math, main, mathord, "\u03f1", "\\varrho", true);
defineSymbol(math, main, mathord, "\u03c2", "\\varsigma", true);
defineSymbol(math, main, mathord, "\u03c6", "\\varphi", true);
defineSymbol(math, main, bin, "\u2217", "*", true);
defineSymbol(math, main, bin, "+", "+");
defineSymbol(math, main, bin, "\u2212", "-", true);
defineSymbol(math, main, bin, "\u22c5", "\\cdot", true);
defineSymbol(math, main, bin, "\u2218", "\\circ", true);
defineSymbol(math, main, bin, "\u00f7", "\\div", true);
defineSymbol(math, main, bin, "\u00b1", "\\pm", true);
defineSymbol(math, main, bin, "\u00d7", "\\times", true);
defineSymbol(math, main, bin, "\u2229", "\\cap", true);
defineSymbol(math, main, bin, "\u222a", "\\cup", true);
defineSymbol(math, main, bin, "\u2216", "\\setminus", true);
defineSymbol(math, main, bin, "\u2227", "\\land");
defineSymbol(math, main, bin, "\u2228", "\\lor");
defineSymbol(math, main, bin, "\u2227", "\\wedge", true);
defineSymbol(math, main, bin, "\u2228", "\\vee", true);
defineSymbol(math, main, textord, "\u221a", "\\surd");
defineSymbol(math, main, open, "\u27e8", "\\langle", true);
defineSymbol(math, main, open, "\u2223", "\\lvert");
defineSymbol(math, main, open, "\u2225", "\\lVert");
defineSymbol(math, main, close, "?", "?");
defineSymbol(math, main, close, "!", "!");
defineSymbol(math, main, close, "\u27e9", "\\rangle", true);
defineSymbol(math, main, close, "\u2223", "\\rvert");
defineSymbol(math, main, close, "\u2225", "\\rVert");
defineSymbol(math, main, rel, "=", "=");
defineSymbol(math, main, rel, ":", ":");
defineSymbol(math, main, rel, "\u2248", "\\approx", true);
defineSymbol(math, main, rel, "\u2245", "\\cong", true);
defineSymbol(math, main, rel, "\u2265", "\\ge");
defineSymbol(math, main, rel, "\u2265", "\\geq", true);
defineSymbol(math, main, rel, "\u2190", "\\gets");
defineSymbol(math, main, rel, ">", "\\gt", true);
defineSymbol(math, main, rel, "\u2208", "\\in", true);
defineSymbol(math, main, rel, "\ue020", "\\@not");
defineSymbol(math, main, rel, "\u2282", "\\subset", true);
defineSymbol(math, main, rel, "\u2283", "\\supset", true);
defineSymbol(math, main, rel, "\u2286", "\\subseteq", true);
defineSymbol(math, main, rel, "\u2287", "\\supseteq", true);
defineSymbol(math, ams, rel, "\u2288", "\\nsubseteq", true);
defineSymbol(math, ams, rel, "\u2289", "\\nsupseteq", true);
defineSymbol(math, main, rel, "\u22a8", "\\models");
defineSymbol(math, main, rel, "\u2190", "\\leftarrow", true);
defineSymbol(math, main, rel, "\u2264", "\\le");
defineSymbol(math, main, rel, "\u2264", "\\leq", true);
defineSymbol(math, main, rel, "<", "\\lt", true);
defineSymbol(math, main, rel, "\u2192", "\\rightarrow", true);
defineSymbol(math, main, rel, "\u2192", "\\to");
defineSymbol(math, ams, rel, "\u2271", "\\ngeq", true);
defineSymbol(math, ams, rel, "\u2270", "\\nleq", true);
defineSymbol(math, main, spacing, "\u00a0", "\\ ");
defineSymbol(math, main, spacing, "\u00a0", "\\space");
// Ref: LaTeX Source 2e: \DeclareRobustCommand{\nobreakspace}{%
defineSymbol(math, main, spacing, "\u00a0", "\\nobreakspace");
defineSymbol(text, main, spacing, "\u00a0", "\\ ");
defineSymbol(text, main, spacing, "\u00a0", " ");
defineSymbol(text, main, spacing, "\u00a0", "\\space");
defineSymbol(text, main, spacing, "\u00a0", "\\nobreakspace");
defineSymbol(math, main, spacing, "", "\\nobreak");
defineSymbol(math, main, spacing, "", "\\allowbreak");
defineSymbol(math, main, punct, ",", ",");
defineSymbol(math, main, punct, ";", ";");
defineSymbol(math, ams, bin, "\u22bc", "\\barwedge", true);
defineSymbol(math, ams, bin, "\u22bb", "\\veebar", true);
defineSymbol(math, main, bin, "\u2299", "\\odot", true);
defineSymbol(math, main, bin, "\u2295", "\\oplus", true);
defineSymbol(math, main, bin, "\u2297", "\\otimes", true);
defineSymbol(math, main, textord, "\u2202", "\\partial", true);
defineSymbol(math, main, bin, "\u2298", "\\oslash", true);
defineSymbol(math, ams, bin, "\u229a", "\\circledcirc", true);
defineSymbol(math, ams, bin, "\u22a1", "\\boxdot", true);
defineSymbol(math, main, bin, "\u25b3", "\\bigtriangleup");
defineSymbol(math, main, bin, "\u25bd", "\\bigtriangledown");
defineSymbol(math, main, bin, "\u2020", "\\dagger");
defineSymbol(math, main, bin, "\u22c4", "\\diamond");
defineSymbol(math, main, bin, "\u22c6", "\\star");
defineSymbol(math, main, bin, "\u25c3", "\\triangleleft");
defineSymbol(math, main, bin, "\u25b9", "\\triangleright");
defineSymbol(math, main, open, "{", "\\{");
defineSymbol(text, main, textord, "{", "\\{");
defineSymbol(text, main, textord, "{", "\\textbraceleft");
defineSymbol(math, main, close, "}", "\\}");
defineSymbol(text, main, textord, "}", "\\}");
defineSymbol(text, main, textord, "}", "\\textbraceright");
defineSymbol(math, main, open, "{", "\\lbrace");
defineSymbol(math, main, close, "}", "\\rbrace");
defineSymbol(math, main, open, "[", "\\lbrack", true);
defineSymbol(text, main, textord, "[", "\\lbrack", true);
defineSymbol(math, main, close, "]", "\\rbrack", true);
defineSymbol(text, main, textord, "]", "\\rbrack", true);
defineSymbol(math, main, open, "(", "\\lparen", true);
defineSymbol(math, main, close, ")", "\\rparen", true);
defineSymbol(text, main, textord, "<", "\\textless", true); // in T1 fontenc
defineSymbol(text, main, textord, ">", "\\textgreater", true); // in T1 fontenc
defineSymbol(math, main, open, "\u230a", "\\lfloor", true);
defineSymbol(math, main, close, "\u230b", "\\rfloor", true);
defineSymbol(math, main, open, "\u2308", "\\lceil", true);
defineSymbol(math, main, close, "\u2309", "\\rceil", true);
defineSymbol(math, main, textord, "\\", "\\backslash");
defineSymbol(math, main, textord, "\u2223", "|");
defineSymbol(math, main, textord, "\u2223", "\\vert");
defineSymbol(text, main, textord, "|", "\\textbar", true); // in T1 fontenc
defineSymbol(math, main, textord, "\u2225", "\\|");
defineSymbol(math, main, textord, "\u2225", "\\Vert");
defineSymbol(text, main, textord, "\u2225", "\\textbardbl");
defineSymbol(text, main, textord, "~", "\\textasciitilde");
defineSymbol(text, main, textord, "\\", "\\textbackslash");
defineSymbol(text, main, textord, "^", "\\textasciicircum");
defineSymbol(math, main, rel, "\u2191", "\\uparrow", true);
defineSymbol(math, main, rel, "\u21d1", "\\Uparrow", true);
defineSymbol(math, main, rel, "\u2193", "\\downarrow", true);
defineSymbol(math, main, rel, "\u21d3", "\\Downarrow", true);
defineSymbol(math, main, rel, "\u2195", "\\updownarrow", true);
defineSymbol(math, main, rel, "\u21d5", "\\Updownarrow", true);
defineSymbol(math, main, op, "\u2210", "\\coprod");
defineSymbol(math, main, op, "\u22c1", "\\bigvee");
defineSymbol(math, main, op, "\u22c0", "\\bigwedge");
defineSymbol(math, main, op, "\u2a04", "\\biguplus");
defineSymbol(math, main, op, "\u22c2", "\\bigcap");
defineSymbol(math, main, op, "\u22c3", "\\bigcup");
defineSymbol(math, main, op, "\u222b", "\\int");
defineSymbol(math, main, op, "\u222b", "\\intop");
defineSymbol(math, main, op, "\u222c", "\\iint");
defineSymbol(math, main, op, "\u222d", "\\iiint");
defineSymbol(math, main, op, "\u220f", "\\prod");
defineSymbol(math, main, op, "\u2211", "\\sum");
defineSymbol(math, main, op, "\u2a02", "\\bigotimes");
defineSymbol(math, main, op, "\u2a01", "\\bigoplus");
defineSymbol(math, main, op, "\u2a00", "\\bigodot");
defineSymbol(math, main, op, "\u222e", "\\oint");
defineSymbol(math, main, op, "\u222f", "\\oiint");
defineSymbol(math, main, op, "\u2230", "\\oiiint");
defineSymbol(math, main, op, "\u2a06", "\\bigsqcup");
defineSymbol(math, main, op, "\u222b", "\\smallint");
defineSymbol(text, main, inner, "\u2026", "\\textellipsis");
defineSymbol(math, main, inner, "\u2026", "\\mathellipsis");
defineSymbol(text, main, inner, "\u2026", "\\ldots", true);
defineSymbol(math, main, inner, "\u2026", "\\ldots", true);
defineSymbol(math, main, inner, "\u22ef", "\\@cdots", true);
defineSymbol(math, main, inner, "\u22f1", "\\ddots", true);
// \vdots is a macro that uses one of these two symbols (with made-up names):
defineSymbol(math, main, textord, "\u22ee", "\\varvdots");
defineSymbol(text, main, textord, "\u22ee", "\\varvdots");
defineSymbol(math, main, accent, "\u02ca", "\\acute");
defineSymbol(math, main, accent, "\u02cb", "\\grave");
defineSymbol(math, main, accent, "\u00a8", "\\ddot");
defineSymbol(math, main, accent, "\u007e", "\\tilde");
defineSymbol(math, main, accent, "\u02c9", "\\bar");
defineSymbol(math, main, accent, "\u02d8", "\\breve");
defineSymbol(math, main, accent, "\u02c7", "\\check");
defineSymbol(math, main, accent, "\u005e", "\\hat");
defineSymbol(math, main, accent, "\u20d7", "\\vec");
defineSymbol(math, main, accent, "\u02d9", "\\dot");
defineSymbol(math, main, accent, "\u02da", "\\mathring");
// \imath and \jmath should be invariant to \mathrm, \mathbf, etc., so use PUA
defineSymbol(math, main, mathord, "\ue131", "\\@imath");
defineSymbol(math, main, mathord, "\ue237", "\\@jmath");
defineSymbol(math, main, textord, "\u0131", "\u0131");
defineSymbol(math, main, textord, "\u0237", "\u0237");
defineSymbol(text, main, textord, "\u0131", "\\i", true);
defineSymbol(text, main, textord, "\u0237", "\\j", true);
defineSymbol(text, main, textord, "\u00df", "\\ss", true);
defineSymbol(text, main, textord, "\u00e6", "\\ae", true);
defineSymbol(text, main, textord, "\u0153", "\\oe", true);
defineSymbol(text, main, textord, "\u00f8", "\\o", true);
defineSymbol(text, main, textord, "\u00c6", "\\AE", true);
defineSymbol(text, main, textord, "\u0152", "\\OE", true);
defineSymbol(text, main, textord, "\u00d8", "\\O", true);
defineSymbol(text, main, accent, "\u02ca", "\\'"); // acute
defineSymbol(text, main, accent, "\u02cb", "\\`"); // grave
defineSymbol(text, main, accent, "\u02c6", "\\^"); // circumflex
defineSymbol(text, main, accent, "\u02dc", "\\~"); // tilde
defineSymbol(text, main, accent, "\u02c9", "\\="); // macron
defineSymbol(text, main, accent, "\u02d8", "\\u"); // breve
defineSymbol(text, main, accent, "\u02d9", "\\."); // dot above
defineSymbol(text, main, accent, "\u00b8", "\\c"); // cedilla
defineSymbol(text, main, accent, "\u02da", "\\r"); // ring above
defineSymbol(text, main, accent, "\u02c7", "\\v"); // caron
defineSymbol(text, main, accent, "\u00a8", '\\"'); // diaeresis
defineSymbol(text, main, accent, "\u02dd", "\\H"); // double acute
defineSymbol(text, main, accent, "\u25ef", "\\textcircled"); // \bigcirc glyph

// These ligatures are detected and created in Parser.js's `formLigatures`.
export const ligatures = {
    "--": true,
    "---": true,
    "``": true,
    "''": true,
};

defineSymbol(text, main, textord, "\u2013", "--", true);
defineSymbol(text, main, textord, "\u2013", "\\textendash");
defineSymbol(text, main, textord, "\u2014", "---", true);
defineSymbol(text, main, textord, "\u2014", "\\textemdash");
defineSymbol(text, main, textord, "\u2018", "`", true);
defineSymbol(text, main, textord, "\u2018", "\\textquoteleft");
defineSymbol(text, main, textord, "\u2019", "'", true);
defineSymbol(text, main, textord, "\u2019", "\\textquoteright");
defineSymbol(text, main, textord, "\u201c", "``", true);
defineSymbol(text, main, textord, "\u201c", "\\textquotedblleft");
defineSymbol(text, main, textord, "\u201d", "''", true);
defineSymbol(text, main, textord, "\u201d", "\\textquotedblright");
//  \degree from gensymb package
defineSymbol(math, main, textord, "\u00b0", "\\degree", true);
defineSymbol(text, main, textord, "\u00b0", "\\degree");
// \textdegree from inputenc package
defineSymbol(text, main, textord, "\u00b0", "\\textdegree", true);
// TODO: In LaTeX, \pounds can generate a different character in text and math
// mode, but among our fonts, only Main-Regular defines this character "163".
defineSymbol(math, main, textord, "\u00a3", "\\pounds");
defineSymbol(math, main, textord, "\u00a3", "\\mathsterling", true);
defineSymbol(text, main, textord, "\u00a3", "\\pounds");
defineSymbol(text, main, textord, "\u00a3", "\\textsterling", true);
defineSymbol(math, ams, textord, "\u2720", "\\maltese");
defineSymbol(text, ams, textord, "\u2720", "\\maltese");

// There are lots of symbols which are the same, so we add them in afterwards.
// All of these are textords in math mode
const mathTextSymbols = "0123456789/@.\"";
for (let i = 0; i < mathTextSymbols.length; i++) {
    const ch = mathTextSymbols.charAt(i);
    defineSymbol(math, main, textord, ch, ch);
}

// All of these are textords in text mode
const textSymbols = "0123456789!@*()-=+\";:?/.,";
for (let i = 0; i < textSymbols.length; i++) {
    const ch = textSymbols.charAt(i);
    defineSymbol(text, main, textord, ch, ch);
}

// All of these are textords in text mode, and mathords in math mode
const letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
for (let i = 0; i < letters.length; i++) {
    const ch = letters.charAt(i);
    defineSymbol(math, main, mathord, ch, ch);
    defineSymbol(text, main, textord, ch, ch);
}

// Blackboard bold and script letters in Unicode range
defineSymbol(math, ams, textord, "C", "\u2102");  // blackboard bold
defineSymbol(text, ams, textord, "C", "\u2102");
defineSymbol(math, ams, textord, "H", "\u210D");
defineSymbol(text, ams, textord, "H", "\u210D");
defineSymbol(math, ams, textord, "N", "\u2115");
defineSymbol(text, ams, textord, "N", "\u2115");
defineSymbol(math, ams, textord, "P", "\u2119");
defineSymbol(text, ams, textord, "P", "\u2119");
defineSymbol(math, ams, textord, "Q", "\u211A");
defineSymbol(text, ams, textord, "Q", "\u211A");
defineSymbol(math, ams, textord, "R", "\u211D");
defineSymbol(text, ams, textord, "R", "\u211D");
defineSymbol(math, ams, textord, "Z", "\u2124");
defineSymbol(text, ams, textord, "Z", "\u2124");
defineSymbol(math, main, mathord, "h", "\u210E");  // italic h, Planck constant
defineSymbol(text, main, mathord, "h", "\u210E");

// The next loop loads wide (surrogate pair) characters.
// We support some letters in the Unicode range U+1D400 to U+1D7FF,
// Mathematical Alphanumeric Symbols.
// Some editors do not deal well with wide characters. So don't write the
// string into this file. Instead, create the string from the surrogate pair.
let wideChar;
for (let i = 0; i < letters.length; i++) {
    const ch = letters.charAt(i);

    // The hex numbers in the next line are a surrogate pair.
    // 0xD835 is the high surrogate for all letters in the range we support.
    // 0xDC00 is the low surrogate for bold A.
    wideChar = String.fromCharCode(0xD835, 0xDC00 + i);  // A-Z a-z bold
    defineSymbol(math, main, mathord, ch, wideChar);
    defineSymbol(text, main, textord, ch, wideChar);

    wideChar = String.fromCharCode(0xD835, 0xDC34 + i);  // A-Z a-z italic
    defineSymbol(math, main, mathord, ch, wideChar);
    defineSymbol(text, main, textord, ch, wideChar);

    wideChar = String.fromCharCode(0xD835, 0xDC68 + i);  // A-Z a-z bold italic
    defineSymbol(math, main, mathord, ch, wideChar);
    defineSymbol(text, main, textord, ch, wideChar);

    wideChar = String.fromCharCode(0xD835, 0xDD04 + i);  // A-Z a-z Fraktur
    defineSymbol(math, main, mathord, ch, wideChar);
    defineSymbol(text, main, textord, ch, wideChar);

    wideChar = String.fromCharCode(0xD835, 0xDD6C + i);  // A-Z a-z bold Fraktur
    defineSymbol(math, main, mathord, ch, wideChar);
    defineSymbol(text, main, textord, ch, wideChar);

    wideChar = String.fromCharCode(0xD835, 0xDDA0 + i);  // A-Z a-z sans-serif
    defineSymbol(math, main, mathord, ch, wideChar);
    defineSymbol(text, main, textord, ch, wideChar);

    wideChar = String.fromCharCode(0xD835, 0xDDD4 + i);  // A-Z a-z sans bold
    defineSymbol(math, main, mathord, ch, wideChar);
    defineSymbol(text, main, textord, ch, wideChar);

    wideChar = String.fromCharCode(0xD835, 0xDE08 + i);  // A-Z a-z sans italic
    defineSymbol(math, main, mathord, ch, wideChar);
    defineSymbol(text, main, textord, ch, wideChar);

    wideChar = String.fromCharCode(0xD835, 0xDE70 + i);  // A-Z a-z monospace
    defineSymbol(math, main, mathord, ch, wideChar);
    defineSymbol(text, main, textord, ch, wideChar);

    if (i < 26) {
        // KaTeX fonts have only capital letters for blackboard bold and script.
        // See exception for k below.
        wideChar = String.fromCharCode(0xD835, 0xDD38 + i); // A-Z double struck
        defineSymbol(math, main, mathord, ch, wideChar);
        defineSymbol(text, main, textord, ch, wideChar);

        wideChar = String.fromCharCode(0xD835, 0xDC9C + i); // A-Z script
        defineSymbol(math, main, mathord, ch, wideChar);
        defineSymbol(text, main, textord, ch, wideChar);
    }

    // TODO: Add bold script when it is supported by a KaTeX font.
}
// "k" is the only double struck lower case letter in the KaTeX fonts.
wideChar = String.fromCharCode(0xD835, 0xDD5C);   // k double struck
defineSymbol(math, main, mathord, "k", wideChar);
defineSymbol(text, main, textord, "k", wideChar);

// Next, some wide character numerals
for (let i = 0; i < 10; i++) {
    const ch = i.toString();

    wideChar = String.fromCharCode(0xD835, 0xDFCE + i);  // 0-9 bold
    defineSymbol(math, main, mathord, ch, wideChar);
    defineSymbol(text, main, textord, ch, wideChar);

    wideChar = String.fromCharCode(0xD835, 0xDFE2 + i);  // 0-9 sans serif
    defineSymbol(math, main, mathord, ch, wideChar);
    defineSymbol(text, main, textord, ch, wideChar);

    wideChar = String.fromCharCode(0xD835, 0xDFEC + i);  // 0-9 bold sans
    defineSymbol(math, main, mathord, ch, wideChar);
    defineSymbol(text, main, textord, ch, wideChar);

    wideChar = String.fromCharCode(0xD835, 0xDFF6 + i);  // 0-9 monospace
    defineSymbol(math, main, mathord, ch, wideChar);
    defineSymbol(text, main, textord, ch, wideChar);
}

// We add these Latin-1 letters as symbols for backwards-compatibility,
// but they are not actually in the font, nor are they supported by the
// Unicode accent mechanism, so they fall back to Times font and look ugly.
// TODO(edemaine): Fix this.
export const extraLatin = "\u00d0\u00de\u00fe";
for (let i = 0; i < extraLatin.length; i++) {
    const ch = extraLatin.charAt(i);
    defineSymbol(math, main, mathord, ch, ch);
    defineSymbol(text, main, textord, ch, ch);
}
x9import type {CssStyle, HtmlDomNode} from "./domTree";
import type {MathDomNode} from "./mathMLTree";


// To ensure that all nodes have compatible signatures for these methods.
export interface VirtualNode {
    toNode(): Node;
    toMarkup(): string;
}

function isMathDomNode(node: VirtualNode): node is MathDomNode {
    return 'toText' in node;
}


/**
 * This node represents a document fragment, which contains elements, but when
 * placed into the DOM doesn't have any representation itself. It only contains
 * children and doesn't have any DOM node properties.
 */
export class DocumentFragment<ChildType extends VirtualNode>
    implements HtmlDomNode, MathDomNode {
    children: ReadonlyArray<ChildType>;
    classes: string[];
    height: number;
    depth: number;
    maxFontSize: number;
    style: CssStyle;          // Never used; needed for satisfying interface.

    constructor(children: ReadonlyArray<ChildType>) {
        this.children = children;
        this.classes = [];
        this.height = 0;
        this.depth = 0;
        this.maxFontSize = 0;
        this.style = {};
    }

    hasClass(className: string): boolean {
        return this.classes.includes(className);
    }

    /** Convert the fragment into a node. */
    toNode(): Node {
        const frag = document.createDocumentFragment();

        for (let i = 0; i < this.children.length; i++) {
            frag.appendChild(this.children[i].toNode());
        }

        return frag;
    }

    /** Convert the fragment into HTML markup. */
    toMarkup(): string {
        let markup = "";

        // Simply concatenate the markup for the children together.
        for (let i = 0; i < this.children.length; i++) {
            markup += this.children[i].toMarkup();
        }

        return markup;
    }

    /**
     * Converts the math node into a string, similar to innerText. Applies to
     * MathDomNode's only.
     */
    toText(): string {
        return this.children.map((child: ChildType): string => {
            if (isMathDomNode(child)) {
                return child.toText();
            }
            throw new Error(
                `Expected MathDomNode with toText, got ${child.constructor.name}`);
        }).join("");
    }
}
kxH 100644 fonts.ts !IUG^e[100644 index.ts x?,p2d1KH]޵cx5// Math font variants.
export type FontVariant =
    | "bold"
    | "bold-italic"
    | "bold-sans-serif"
    | "double-struck"
    | "fraktur"
    | "italic"
    | "monospace"
    | "normal"
    | "sans-serif"
    | "sans-serif-bold-italic"
    | "sans-serif-italic"
    | "script";

export type FontName =
    | "AMS-Regular"
    | "Caligraphic-Regular"
    | "Fraktur-Regular"
    | "Main-Bold"
    | "Main-BoldItalic"
    | "Main-Italic"
    | "Main-Regular"
    | "Math-BoldItalic"
    | "Math-Italic"
    | "SansSerif-Regular"
    | "SansSerif-Bold"
    | "SansSerif-Italic"
    | "Script-Regular"
    | "Size1-Regular"
    | "Size2-Regular"
    | "Size3-Regular"
    | "Size4-Regular"
    | "Typewriter-Regular";

//[depth, height, italic, skew, width]
export type CharacterMetricsTuple = [depth: number, height: number, italic: number, skew: number, width: number];

export type CharacterMetrics = {
    depth: number;
    height: number;
    italic: number;
    skew: number;
    width: number;
};

export type FontMetrics = {
    cssEmPerMu: number;
    [key: string]: number;
};

export type SymbolFont = "main" | "ams";

export type MathFont =
    | ""
    | "mathrm"
    | "mathit"
    | "mathbf"
    | "mathnormal"
    | "mathsfit"
    | "mathbb"
    | "mathcal"
    | "mathfrak"
    | "mathscr"
    | "mathsf"
    | "mathtt"
    | "boldsymbol";

export type TextFont = "textrm" | "textsf" | "texttt" | "amsrm" | "";

// In these types, "" (empty string) means "no change".
export type FontWeight = "textbf" | "textmd" | "";
export type FontShape = "textit" | "textup" | "";
KxLexport type Mode = "math" | "text";

// LaTeX argument type.
//   - "size": A size-like thing, such as "1em" or "5ex"
//   - "color": An html color, like "#abc" or "blue"
//   - "url": An url string, in which "\" will be ignored
//   -        if it precedes [#$%&~_^\{}]
//   - "raw": A string, allowing single character, percent sign,
//            and nested braces
//   - "original": The same type as the environment that the
//                 function being parsed is in (e.g. used for the
//                 bodies of functions like \textcolor where the
//                 first argument is special and the second
//                 argument is parsed normally)
//   - Mode: Node group parsed in given mode.
export type ArgType = "color" | "size" | "url" | "raw" | "original" | "hbox" |
    "primitive" | Mode;

// LaTeX display style.
export type StyleStr = "text" | "display" | "script" | "scriptscript";

// Allowable token text for "break" arguments in parser.
export type BreakToken = "]" | "}" | "\\endgroup" | "$" | "\\)" | "\\\\" | "\\end" |
    "EOF";

export type DelimiterSize = 1 | 2 | 3 | 4;

export type Slice1<S extends string> =
    S extends `${string}${infer Rest}` ? Rest : "";
qS5xP// Mapping of Unicode accent characters to their LaTeX equivalent in text and
// math mode (when they exist).
// This exports a CommonJS module, allowing to be required in unicodeSymbols
// without transpiling.
/** @type {Record<string, {text: string, math?: string}>} */
const unicodeAccents = {
    '\u0301': {text: "\\'", math: '\\acute'},
    '\u0300': {text: '\\`', math: '\\grave'},
    '\u0308': {text: '\\"', math: '\\ddot'},
    '\u0303': {text: '\\~', math: '\\tilde'},
    '\u0304': {text: '\\=', math: '\\bar'},
    '\u0306': {text: '\\u', math: '\\breve'},
    '\u030c': {text: '\\v', math: '\\check'},
    '\u0302': {text: '\\^', math: '\\hat'},
    '\u0307': {text: '\\.', math: '\\dot'},
    '\u030a': {text: '\\r', math: '\\mathring'},
    '\u030b': {text: '\\H'},
    '\u0327': {text: '\\c'},
};

module.exports = unicodeAccents;
,E޽xr/*
 * This file defines the Unicode scripts and script families that we
 * support. To add new scripts or families, just add a new entry to the
 * scriptData array below. Adding scripts to the scriptData array allows
 * characters from that script to appear in \text{} environments.
 */

/**
 * Each script or script family has a name and an array of blocks.
 * Each block is an array of two numbers which specify the start and
 * end points (inclusive) of a block of Unicode codepoints.
 */
type Script = {
    name: string;
    blocks: Array<Array<number>>;
};

/**
 * Unicode block data for the families of scripts we support in \text{}.
 * Scripts only need to appear here if they do not have font metrics.
 */
const scriptData: Array<Script> = [
    {
        // Latin characters beyond the Latin-1 characters we have metrics for.
        // Needed for Czech, Hungarian and Turkish text, for example.
        name: 'latin',
        blocks: [
            [0x0100, 0x024f],  // Latin Extended-A and Latin Extended-B
            [0x0300, 0x036f],  // Combining Diacritical marks
        ],
    },
    {
        // The Cyrillic script used by Russian and related languages.
        // A Cyrillic subset used to be supported as explicitly defined
        // symbols in symbols.js
        name: 'cyrillic',
        blocks: [[0x0400, 0x04ff]],
    },
    {
        // Armenian
        name: 'armenian',
        blocks: [[0x0530, 0x058F]],
    },
    {
        // The Brahmic scripts of South and Southeast Asia
        // Devanagari (0900–097F)
        // Bengali (0980–09FF)
        // Gurmukhi (0A00–0A7F)
        // Gujarati (0A80–0AFF)
        // Oriya (0B00–0B7F)
        // Tamil (0B80–0BFF)
        // Telugu (0C00–0C7F)
        // Kannada (0C80–0CFF)
        // Malayalam (0D00–0D7F)
        // Sinhala (0D80–0DFF)
        // Thai (0E00–0E7F)
        // Lao (0E80–0EFF)
        // Tibetan (0F00–0FFF)
        // Myanmar (1000–109F)
        name: 'brahmic',
        blocks: [[0x0900, 0x109F]],
    },
    {
        name: 'georgian',
        blocks: [[0x10A0, 0x10ff]],
    },
    {
        // Chinese and Japanese.
        // The "k" in cjk is for Korean, but we've separated Korean out
        name: "cjk",
        blocks: [
            [0x3000, 0x30FF], // CJK symbols and punctuation, Hiragana, Katakana
            [0x4E00, 0x9FAF], // CJK ideograms
            [0xFF00, 0xFF60], // Fullwidth punctuation
            // TODO: add halfwidth Katakana and Romanji glyphs
        ],
    },
    {
        // Korean
        name: 'hangul',
        blocks: [[0xAC00, 0xD7AF]],
    },
];

/**
 * Given a codepoint, return the name of the script or script family
 * it is from, or null if it is not part of a known block
 */
export function scriptFromCodepoint(codepoint: number): string | null | undefined {
    for (let i = 0; i < scriptData.length; i++) {
        const script = scriptData[i];
        for (let i = 0; i < script.blocks.length; i++) {
            const block = script.blocks[i];
            if (codepoint >= block[0] && codepoint <= block[1]) {
                return script.name;
            }
        }
    }
    return null;
}

/**
 * A flattened version of all the supported blocks in a single array.
 * This is an optimization to make supportedCodepoint() fast.
 */
const allBlocks: Array<number> = [];
scriptData.forEach(s => s.blocks.forEach(b => allBlocks.push(...b)));

/**
 * Given a codepoint, return true if it falls within one of the
 * scripts or script families defined above and false otherwise.
 *
 * Micro benchmarks shows that this is faster than
 * /[\u3000-\u30FF\u4E00-\u9FAF\uFF00-\uFF60\uAC00-\uD7AF\u0900-\u109F]/.test()
 * in Firefox, Chrome and Node.
 */
export function supportedCodepoint(codepoint: number): boolean {
    for (let i = 0; i < allBlocks.length; i += 2) {
        if (codepoint >= allBlocks[i] && codepoint <= allBlocks[i + 1]) {
            return true;
        }
    }
    return false;
}
( x|// Helpers for Parser.js handling of Unicode (sub|super)script characters.

export const unicodeSubRegEx = /^[₊₋₌₍₎₀₁₂₃₄₅₆₇₈₉ₐₑₕᵢⱼₖₗₘₙₒₚᵣₛₜᵤᵥₓᵦᵧᵨᵩᵪ]/;

export const uSubsAndSups: Readonly<Record<string, string>> = Object.freeze({
    '₊': '+',
    '₋': '-',
    '₌': '=',
    '₍': '(',
    '₎': ')',
    '₀': '0',
    '₁': '1',
    '₂': '2',
    '₃': '3',
    '₄': '4',
    '₅': '5',
    '₆': '6',
    '₇': '7',
    '₈': '8',
    '₉': '9',
    '\u2090': 'a',
    '\u2091': 'e',
    '\u2095': 'h',
    '\u1D62': 'i',
    '\u2C7C': 'j',
    '\u2096': 'k',
    '\u2097': 'l',
    '\u2098': 'm',
    '\u2099': 'n',
    '\u2092': 'o',
    '\u209A': 'p',
    '\u1D63': 'r',
    '\u209B': 's',
    '\u209C': 't',
    '\u1D64': 'u',
    '\u1D65': 'v',
    '\u2093': 'x',
    '\u1D66': 'β',
    '\u1D67': 'γ',
    '\u1D68': 'ρ',
    '\u1D69': '\u03d5',
    '\u1D6A': 'χ',
    '⁺': '+',
    '⁻': '-',
    '⁼': '=',
    '⁽': '(',
    '⁾': ')',
    '⁰': '0',
    '¹': '1',
    '²': '2',
    '³': '3',
    '⁴': '4',
    '⁵': '5',
    '⁶': '6',
    '⁷': '7',
    '⁸': '8',
    '⁹': '9',
    '\u1D2C': 'A',
    '\u1D2E': 'B',
    '\u1D30': 'D',
    '\u1D31': 'E',
    '\u1D33': 'G',
    '\u1D34': 'H',
    '\u1D35': 'I',
    '\u1D36': 'J',
    '\u1D37': 'K',
    '\u1D38': 'L',
    '\u1D39': 'M',
    '\u1D3A': 'N',
    '\u1D3C': 'O',
    '\u1D3E': 'P',
    '\u1D3F': 'R',
    '\u1D40': 'T',
    '\u1D41': 'U',
    '\u2C7D': 'V',
    '\u1D42': 'W',
    '\u1D43': 'a',
    '\u1D47': 'b',
    '\u1D9C': 'c',
    '\u1D48': 'd',
    '\u1D49': 'e',
    '\u1DA0': 'f',
    '\u1D4D': 'g',
    '\u02B0': 'h',
    '\u2071': 'i',
    '\u02B2': 'j',
    '\u1D4F': 'k',
    '\u02E1': 'l',
    '\u1D50': 'm',
    '\u207F': 'n',
    '\u1D52': 'o',
    '\u1D56': 'p',
    '\u02B3': 'r',
    '\u02E2': 's',
    '\u1D57': 't',
    '\u1D58': 'u',
    '\u1D5B': 'v',
    '\u02B7': 'w',
    '\u02E3': 'x',
    '\u02B8': 'y',
    '\u1DBB': 'z',
    '\u1D5D': 'β',
    '\u1D5E': 'γ',
    '\u1D5F': 'δ',
    '\u1D60': '\u03d5',
    '\u1D61': 'χ',
    '\u1DBF': 'θ',
});
fsOx// @ts-check
// This is an internal module, not part of the KaTeX distribution,
// whose purpose is to generate `unicodeSymbols` in Parser.js
// In this way, only this module, and not the distribution/browser,
// needs String's normalize function. As this file is not transpiled,
// JSDoc type syntax is used.
const accents = require('./unicodeAccents');

/** @type {Record<string, string>} */
const result = {};
const letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" +
    "αβγδεϵζηθϑικλμνξοπϖρϱςστυφϕχψωΓΔΘΛΞΠΣΥΦΨΩ";
for (const letter of letters) {
    for (const accent of Object.getOwnPropertyNames(accents)) {
        const combined = letter + accent;
        const normalized = combined.normalize('NFC');
        if (normalized.length === 1) {
            result[normalized] = combined;
        }
        for (const accent2 of Object.getOwnPropertyNames(accents)) {
            if (accent === accent2) {
                continue;
            }
            const combined2 = combined + accent2;
            const normalized2 = combined2.normalize('NFC');
            if (normalized2.length === 1) {
                result[normalized2] = combined2;
            }
        }
    }
}

module.exports = result;
F*x/**
 * This file does conversion between units.  In particular, it provides
 * calculateSize to convert other units into ems.
 */

import ParseError from "./ParseError";
import Options from "./Options";

// This table gives the number of TeX pts in one of each *absolute* TeX unit.
// Thus, multiplying a length by this number converts the length from units
// into pts.  Dividing the result by ptPerEm gives the number of ems
// *assuming* a font size of ptPerEm (normal size, normal style).
const ptPerUnit: Record<string, number> = {
    // https://en.wikibooks.org/wiki/LaTeX/Lengths and
    // https://tex.stackexchange.com/a/8263
    "pt": 1,            // TeX point
    "mm": 7227 / 2540,  // millimeter
    "cm": 7227 / 254,   // centimeter
    "in": 72.27,        // inch
    "bp": 803 / 800,    // big (PostScript) points
    "pc": 12,           // pica
    "dd": 1238 / 1157,  // didot
    "cc": 14856 / 1157, // cicero (12 didot)
    "nd": 685 / 642,    // new didot
    "nc": 1370 / 107,   // new cicero (12 new didot)
    "sp": 1 / 65536,    // scaled point (TeX's internal smallest unit)
    // https://tex.stackexchange.com/a/41371
    "px": 803 / 800,    // \pdfpxdimen defaults to 1 bp in pdfTeX and LuaTeX
};

// Dictionary of relative units, for fast validity testing.
const relativeUnit = {
    "ex": true,
    "em": true,
    "mu": true,
};

export type Measurement = { number: number, unit: string };

/**
 * Determine whether the specified unit (either a string defining the unit
 * or a "size" parse node containing a unit field) is valid.
 */
export const validUnit = function(unit: string | Measurement): boolean {
    if (typeof unit !== "string") {
        unit = unit.unit;
    }
    return (unit in ptPerUnit || unit in relativeUnit || unit === "ex");
};

/*
 * Convert a "size" parse node (with numeric "number" and string "unit" fields,
 * as parsed by functions.js argType "size") into a CSS em value for the
 * current style/scale.  `options` gives the current options.
 */
export const calculateSize = function(
        sizeValue: Measurement, options: Options): number {
    let scale;
    if (sizeValue.unit in ptPerUnit) {
        // Absolute units
        scale = ptPerUnit[sizeValue.unit]   // Convert unit to pt
           / options.fontMetrics().ptPerEm  // Convert pt to CSS em
           / options.sizeMultiplier;        // Unscale to make absolute units
    } else if (sizeValue.unit === "mu") {
        // `mu` units scale with scriptstyle/scriptscriptstyle.
        scale = options.fontMetrics().cssEmPerMu;
    } else {
        // Other relative units always refer to the *textstyle* font
        // in the current size.
        let unitOptions;
        if (options.style.isTight()) {
            // isTight() means current style is script/scriptscript.
            unitOptions = options.havingStyle(options.style.text());
        } else {
            unitOptions = options;
        }
        // TODO: In TeX these units are relative to the quad of the current
        // *text* font, e.g. cmr10. KaTeX instead uses values from the
        // comparably-sized *Computer Modern symbol* font. At 10pt, these
        // match. At 7pt and 5pt, they differ: cmr7=1.138894, cmsy7=1.170641;
        // cmr5=1.361133, cmsy5=1.472241. Consider $\scriptsize a\kern1emb$.
        // TeX \showlists shows a kern of 1.13889 * fontsize;
        // KaTeX shows a kern of 1.171 * fontsize.
        if (sizeValue.unit === "ex") {
            scale = unitOptions.fontMetrics().xHeight;
        } else if (sizeValue.unit === "em") {
            scale = unitOptions.fontMetrics().quad;
        } else {
            throw new ParseError("Invalid unit: '" + sizeValue.unit + "'");
        }
        if (unitOptions !== options) {
            scale *= unitOptions.sizeMultiplier / options.sizeMultiplier;
        }
    }
    return Math.min(sizeValue.number * scale, options.maxSize);
};

/**
 * Round `n` to 4 decimal places, or to the nearest 1/10,000th em. See
 * https://github.com/KaTeX/KaTeX/pull/2460.
 */
export const makeEm = function(n: number): string {
    return +n.toFixed(4) + "em";
};
tx/**
 * This file contains a list of utility functions which are useful in other
 * files.
 */

import type {AnyParseNode} from "./parseNode";

// hyphenate and escape adapted from Facebook's React under Apache 2 license
const uppercase = /([A-Z])/g;
export const hyphenate = (str: string): string =>
    str.replace(uppercase, "-$1").toLowerCase();

const ESCAPE_LOOKUP: Record<string, string> = {
    "&": "&amp;",
    ">": "&gt;",
    "<": "&lt;",
    "\"": "&quot;",
    "'": "&#x27;",
};

const ESCAPE_REGEX = /[&><"']/g;

/**
 * Escapes text to prevent scripting attacks.
 */
export const escape = (text: unknown): string =>
    String(text).replace(ESCAPE_REGEX, match => ESCAPE_LOOKUP[match]);

/**
 * Sometimes we want to pull out the innermost element of a group. In most
 * cases, this will just be the group itself, but when ordgroups and colors have
 * a single element, we want to pull that out.
 */
export const getBaseElem = (group: AnyParseNode): AnyParseNode => {
    if (group.type === "ordgroup") {
        if (group.body.length === 1) {
            return getBaseElem(group.body[0]);
        } else {
            return group;
        }
    } else if (group.type === "color") {
        if (group.body.length === 1) {
            return getBaseElem(group.body[0]);
        } else {
            return group;
        }
    } else if (group.type === "font") {
        return getBaseElem(group.body);
    } else {
        return group;
    }
};

const characterNodesTypes = new Set(["mathord", "textord", "atom"]);

/**
 * TeXbook algorithms often reference "character boxes", which are simply groups
 * with a single character in them. To decide if something is a character box,
 * we find its innermost group, and see if it is a single character.
 */
export const isCharacterBox = (group: AnyParseNode): boolean =>
    characterNodesTypes.has(getBaseElem(group).type);

/**
 * Return the protocol of a URL, or "_relative" if the URL does not specify a
 * protocol (and thus is relative), or `null` if URL has invalid protocol
 * (so should be outright rejected).
 */
export const protocolFromUrl = (url: string): string | null => {
    // Check for possible leading protocol.
    // https://url.spec.whatwg.org/#url-parsing strips leading whitespace
    // (U+20) or C0 control (U+00-U+1F) characters.
    const protocol = /^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i
    .exec(url);
    if (!protocol) {
        return "_relative";
    }
    // Reject weird colons
    if (protocol[2] !== ":") {
        return null;
    }
    // Reject invalid characters in scheme according to
    // https://datatracker.ietf.org/doc/html/rfc3986#section-3.1
    if (!/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(protocol[1])) {
        return null;
    }
    // Lowercase the protocol
    return protocol[1].toLowerCase();
};
sҴx/**
 * This file provides support for Unicode range U+1D400 to U+1D7FF,
 * Mathematical Alphanumeric Symbols.
 *
 * Function wideCharacterFont takes a wide character as input and returns
 * the font information necessary to render it properly.
 */

import ParseError from "./ParseError";
import type {FontName} from "./types/fonts";

type WideChar = {
    readonly mathClass: string;
    readonly textClass: string;
    readonly font: Extract<FontName,
        | "Main-Bold"
        | "Math-Italic"
        | "Main-BoldItalic"
        | "Script-Regular"
        | "Fraktur-Regular"
        | "AMS-Regular"
        | "SansSerif-Regular"
        | "SansSerif-Bold"
        | "SansSerif-Italic"
        | "Typewriter-Regular"
    > | "";
};

const boldUpright: WideChar = {
    mathClass: "mathbf",
    textClass: "textbf",
    font: "Main-Bold",
};
const italic: WideChar = {
    mathClass: "mathnormal",
    textClass: "textit",
    font: "Math-Italic",
};
const boldItalic: WideChar = {
    mathClass: "boldsymbol",
    textClass: "boldsymbol",
    font: "Main-BoldItalic",
};
const script: WideChar = {
    mathClass: "mathscr",
    textClass: "textscr",
    font: "Script-Regular",
};
const noFont: WideChar = {mathClass: "", textClass: "", font: ""};
const fraktur: WideChar = {
    mathClass: "mathfrak",
    textClass: "textfrak",
    font: "Fraktur-Regular",
};
const doubleStruck: WideChar = {
    mathClass: "mathbb",
    textClass: "textbb",
    font: "AMS-Regular",
};
const boldFraktur: WideChar = {
    mathClass: "mathboldfrak",
    textClass: "textboldfrak",
    font: "Fraktur-Regular",
};
const sansSerif: WideChar = {
    mathClass: "mathsf",
    textClass: "textsf",
    font: "SansSerif-Regular",
};
const boldSansSerif: WideChar = {
    mathClass: "mathboldsf",
    textClass: "textboldsf",
    font: "SansSerif-Bold",
};
const italicSansSerif: WideChar = {
    mathClass: "mathitsf",
    textClass: "textitsf",
    font: "SansSerif-Italic",
};
const monospace: WideChar = {
    mathClass: "mathtt",
    textClass: "texttt",
    font: "Typewriter-Regular",
};

/**
 * Data below is from https://www.unicode.org/charts/PDF/U1D400.pdf
 * That document sorts characters into groups by font type, say bold or italic.
 *
 * In the arrays below, each object consists of three properties:
 *      * The CSS class of that group when in math mode.
 *      * The CSS class of that group when in text mode.
 *      * The font name, so that KaTeX can get font metrics.
 */

const wideLatinLetterData = [
    boldUpright, boldUpright,  // A-Z, a-z
    italic, italic,            // A-Z, a-z
    boldItalic, boldItalic,   // A-Z, a-z
    // Map fancy A-Z letters to script, not calligraphic.
    // This aligns with unicode-math and math fonts (except Cambria Math).
    script, noFont, // A-Z script, a-z — no font
    noFont, noFont, // A-Z bold script, a-z bold script — no font
    fraktur, fraktur,          // A-Z, a-z
    doubleStruck, doubleStruck, // A-Z double-struck, k double-struck
    // Note that we are using a bold font, but font metrics for regular Fraktur.
    boldFraktur, boldFraktur,  // A-Z, a-z
    sansSerif, sansSerif,      // A-Z, a-z
    boldSansSerif, boldSansSerif, // A-Z, a-z
    italicSansSerif, italicSansSerif, // A-Z, a-z
    noFont, noFont,           // A-Z bold italic sans, a-z bold italic sans - no font
    monospace, monospace,     // A-Z, a-z
] as const;

const wideNumeralData = [
    boldUpright,      // 0-9
    noFont,           // 0-9 double-struck. No KaTeX font.
    sansSerif,        // 0-9
    boldSansSerif,   // 0-9
    monospace,       // 0-9
] as const;

export const wideCharacterFont = (
    wideChar: string,
): WideChar => {

    // IE doesn't support codePointAt(). So work with the surrogate pair.
    const H = wideChar.charCodeAt(0);    // high surrogate
    const L = wideChar.charCodeAt(1);    // low surrogate
    const codePoint = ((H - 0xD800) * 0x400) + (L - 0xDC00) + 0x10000;

    if (0x1D400 <= codePoint && codePoint < 0x1D6A4) {
        // wideLatinLetterData contains exactly 26 chars on each row.
        // So we can calculate the relevant row. No traverse necessary.
        const i = Math.floor((codePoint - 0x1D400) / 26);
        return wideLatinLetterData[i];

    } else if (0x1D7CE <= codePoint && codePoint <= 0x1D7FF) {
        // Numerals, ten per row.
        const i = Math.floor((codePoint - 0x1D7CE) / 10);
        return wideNumeralData[i];

    } else if (codePoint === 0x1D6A5 || codePoint === 0x1D6A6) {
        // dotless i or j
        return wideLatinLetterData[0];

    } else if (0x1D6A6 < codePoint && codePoint < 0x1D7CE) {
        // Greek letters. Not supported, yet.
        return noFont;

    } else {
        // We don't support any wide characters outside 1D400–1D7FF.
        throw new ParseError("Unsupported character: " + wideChar);
    }
};
iqx& 100644 katex.d.ts 4WtiȒZ$ x!	// Adapted from
// - https://katex.org/docs/options
// - https://katex.org/docs/api
// - https://katex.org/docs/error
// for v0.16.11 on 2024/12/01
// with some references from https://www.npmjs.com/package/@types/katex

/**
 * For the `trust` option in `KatexOptions`, a custom function
 * `handler(context)` can be provided to customize behavior depending on the
 * context (command, arguments e.g. a URL, etc.)
 * @see https://katex.org/docs/options
 */
export type TrustContext =
    | { command: "\\url", url: string, protocol?: string }
    | { command: "\\href", url: string, protocol?: string }
    | { command: "\\includegraphics", url: string, protocol?: string }
    | { command: "\\htmlClass", class: string }
    | { command: "\\htmlId", id: string }
    | { command: "\\htmlStyle", style: string }
    | { command: "\\htmlData", attributes: Record<string, string> }


export type Catcodes = Record<string, number>;

export interface Lexer {
  input: string;
  tokenRegex: RegExp;
  settings: Required<KatexOptions>;
  catcodes: Catcodes;
}

export interface SourceLocation {
  start: number;
  end: number;
  lexer: Lexer;
}

export interface Token {
  text: string;
  loc: SourceLocation | undefined;
  noexpand?: boolean;
  treatAsRelax?: boolean;
}


export type StrictFunction = (
  errorCode:
    | "unknownSymbol"
    | "unicodeTextInMathMode"
    | "mathVsTextUnits"
    | "commentAtEnd"
    | "htmlExtension"
    | "newLineInDisplayMode",
  errorMsg: string,
  token: Token,
) => boolean | "error" | "warn" | "ignore" | undefined;


/**
 * Options for `katex.render` and `katex.renderToString`.
 * @see https://katex.org/docs/options
 */
export interface KatexOptions {
    /**
     * If `true` the math will be rendered in display mode.
     * If `false` the math will be rendered in inline mode.
     * @see https://katex.org/docs/options
     *
     * @default false
     */
    displayMode?: boolean;
    /**
     * Determines the markup language of the output. The valid choices are:
     * - `html`: Outputs KaTeX in HTML only.
     * - `mathml`: Outputs KaTeX in MathML only.
     * - `htmlAndMathml`: Outputs HTML for visual rendering and includes MathML
     * for accessibility.
     *
     * @default "htmlAndMathml"
     */
    output?: "html" | "mathml" | "htmlAndMathml";
    /**
     * If `true`, display math has `\tag`s rendered on the left instead of the
     * right, like `\usepackage[leqno]{amsmath}` in LaTeX.
     *
     * @default false
     */
    leqno?: boolean;
    /**
     * If `true`, display math renders flush left with a `2em` left margin,
     * like `\documentclass[fleqn]` in LaTeX with the `amsmath` package.
     *
     * @default false
     */
    fleqn?: boolean;
    /**
     * If `true`, KaTeX will throw a `ParseError` when it encounters an
     * unsupported command or invalid LaTeX.
     * If `false`, KaTeX will render unsupported commands as text, and render
     * invalid LaTeX as its source code with hover text giving the error, in
     * the color given by `errorColor`.
     *
     * @default true
     */
    throwOnError?: boolean;
    /**
     * A color string given in the format `"#XXX"` or `"#XXXXXX"`. This option
     * determines the color that unsupported commands and invalid LaTeX are
     * rendered in when `throwOnError` is set to `false`.
     *
     * @default "#cc0000"
     */
    errorColor?: string;
    /**
     * A collection of custom macros.
     * @see https://katex.org/docs/options
     */
    macros?: Record<string, string | object | ((macroExpander:object)
        => string | object)>;
    /**
     * Specifies a minimum thickness, in ems, for fraction lines, `\sqrt` top
     * lines, `{array}` vertical lines, `\hline`, `\hdashline`, `\underline`,
     * `\overline`, and the borders of `\fbox`, `\boxed`, and `\fcolorbox`.
     * The usual value for these items is `0.04`, so for `minRuleThickness`
     * to be effective it should probably take a value slightly above `0.04`,
     * say `0.05` or `0.06`. Negative values will be ignored.
     */
    minRuleThickness?: number;
    /**
     * In early versions of both KaTeX (<0.8.0) and MathJax, the `\color`
     * function expected the content to be a function argument, as in
     * `\color{blue}{hello}`. In current KaTeX, `\color` is a switch, as in
     * `\color{blue}` hello. This matches LaTeX behavior. If you want the old
     * `\color` behavior, set option colorIsTextColor to true.
     */
    colorIsTextColor?: boolean;
    /**
     * All user-specified sizes, e.g. in `\rule{500em}{500em}`, will be capped
     * to `maxSize` ems. If set to `Infinity` (the default), users can make
     * elements and spaces arbitrarily large.
     *
     * @default Infinity
     */
    maxSize?: number;
    /**
     * Limit the number of macro expansions to the specified number, to prevent
     * e.g. infinite macro loops. `\edef` expansion counts all expanded tokens.
     * If set to `Infinity`, the macro expander will try to fully expand as in
     * LaTeX.
     *
     * @default 1000
     */
    maxExpand?: number;
    /**
     * If `false` or `"ignore"`, allow features that make writing LaTeX
     * convenient but are not actually supported by (Xe)LaTeX
     * (similar to MathJax).
     * If `true` or `"error"` (LaTeX faithfulness mode), throw an error for any
     * such transgressions.
     * If `"warn"` (the default), warn about such behavior via `console.warn`.
     * Provide a custom function `handler(errorCode, errorMsg, token)` to
     * customize behavior depending on the type of transgression (summarized by
     * the string code `errorCode` and detailed in `errorMsg`); this function
     * can also return `"ignore"`, `"error"`, or `"warn"` to use a built-in
     * behavior.
     * @see https://katex.org/docs/options
     *
     * @default "warn"
     */
    strict?:
        | boolean
        | "ignore" | "warn" | "error"
        | StrictFunction;
    /**
     * If `false` (do not trust input), prevent any commands like
     * `\includegraphics` that could enable adverse behavior, rendering them
     * instead in `errorColor`.
     * If `true` (trust input), allow all such commands.
     * Provide a custom function `handler(context)` to customize behavior
     * depending on the context (command, arguments e.g. a URL, etc.).
     * @see https://katex.org/docs/options
     *
     * @default false
    */
    trust?: boolean | ((context: TrustContext) => boolean);
    /**
     * Run KaTeX code in the global group. As a consequence, macros defined at
     * the top level by `\def` and `\newcommand` are added to the macros
     * argument and can be used in subsequent render calls. In LaTeX,
     * constructs such as `\begin{equation}` and `$$` create a local group and
     * prevent definitions other than `\gdef` from becoming visible outside of
     * those blocks, so this is KaTeX's default behavior.
     *
     * @default false
     */
    globalGroup?: boolean;
}

/**
 * In-browser rendering
 *
 * Call the `render` function with a TeX expression and a DOM element to
 * render into.
 *
 * @param {string} tex A TeX expression.
 * @param {HTMLElement} element A HTML DOM element.
 * @param {KatexOptions} options An options object.
 * @returns {void}
 * @see https://katex.org/docs/api
 */
export function render(
    tex: string,
    element: HTMLElement,
    options?: KatexOptions,
): void;

/**
 * Server-side rendering or rendering to a string
 *
 * Use the `renderToString` function to generate HTML on the server or to
 * generate an HTML string of the rendered math.
 *
 * @param {string} tex A TeX expression.
 * @param {KatexOptions} options An options object.
 * @returns {string} The HTML string of the rendered math.
 * @see https://katex.org/docs/api
 */
export function renderToString(tex: string, options?: KatexOptions): string;

/**
 * If KaTeX encounters an error (invalid or unsupported LaTeX) and
 * `throwOnError` hasn't been set to `false`, then `katex.render` and
 * `katex.renderToString` will throw an exception of type
 * `ParseError`. The message in this error includes some of the LaTeX source
 * code, so needs to be escaped if you want to render it to HTML.
 * @see https://katex.org/docs/error
 */
export class ParseError implements Error {
    constructor(message: string, token?: object);
    name: "ParseError";
    position: number;
    length: number;
    rawMessage: string;
    message: string;
}

export const version: string;

export as namespace katex;

declare const katex: {
    version: string;
    render: typeof render;
    renderToString: typeof renderToString;
    ParseError: typeof ParseError;
};

export default katex;
Kxk 100644 README.md )J0,<5Ϩ{[:b~100644 package.json 0F1%BFR5240000 src j1"tYL&S>1<<'x=<h1 align="center">
	<img width="250" src="https://jaredwray.com/images/keyv.svg" alt="keyv">
	<br>
	<br>
</h1>

> Simple key-value storage with support for multiple backends

[![build](https://github.com/jaredwray/keyv/actions/workflows/tests.yaml/badge.svg)](https://github.com/jaredwray/keyv/actions/workflows/tests.yaml)
[![codecov](https://codecov.io/gh/jaredwray/keyv/branch/main/graph/badge.svg?token=bRzR3RyOXZ)](https://codecov.io/gh/jaredwray/keyv)
[![npm](https://img.shields.io/npm/dm/keyv.svg)](https://www.npmjs.com/package/keyv)
[![npm](https://img.shields.io/npm/v/keyv.svg)](https://www.npmjs.com/package/keyv)

Keyv provides a consistent interface for key-value storage across multiple backends via storage adapters. It supports TTL based expiry, making it suitable as a cache or a persistent key-value store.

## Features

There are a few existing modules similar to Keyv, however Keyv is different because it:

- Isn't bloated
- Has a simple Promise based API
- Suitable as a TTL based cache or persistent key-value store
- [Easily embeddable](#add-cache-support-to-your-module) inside another module
- Works with any storage that implements the [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) API
- Handles all JSON types plus `Buffer`
- Supports namespaces
- Wide range of [**efficient, well tested**](#official-storage-adapters) storage adapters
- Connection errors are passed through (db failures won't kill your app)
- Supports the current active LTS version of Node.js or higher

## Usage

Install Keyv.

```
npm install --save keyv
```

By default everything is stored in memory, you can optionally also install a storage adapter.

```
npm install --save @keyv/redis
npm install --save @keyv/mongo
npm install --save @keyv/sqlite
npm install --save @keyv/postgres
npm install --save @keyv/mysql
npm install --save @keyv/etcd
```

Create a new Keyv instance, passing your connection string if applicable. Keyv will automatically load the correct storage adapter.

```js
const Keyv = require('keyv');

// One of the following
const keyv = new Keyv();
const keyv = new Keyv('redis://user:pass@localhost:6379');
const keyv = new Keyv('mongodb://user:pass@localhost:27017/dbname');
const keyv = new Keyv('sqlite://path/to/database.sqlite');
const keyv = new Keyv('postgresql://user:pass@localhost:5432/dbname');
const keyv = new Keyv('mysql://user:pass@localhost:3306/dbname');
const keyv = new Keyv('etcd://localhost:2379');

// Handle DB connection errors
keyv.on('error', err => console.log('Connection Error', err));

await keyv.set('foo', 'expires in 1 second', 1000); // true
await keyv.set('foo', 'never expires'); // true
await keyv.get('foo'); // 'never expires'
await keyv.delete('foo'); // true
await keyv.clear(); // undefined
```

### Namespaces

You can namespace your Keyv instance to avoid key collisions and allow you to clear only a certain namespace while using the same database.

```js
const users = new Keyv('redis://user:pass@localhost:6379', { namespace: 'users' });
const cache = new Keyv('redis://user:pass@localhost:6379', { namespace: 'cache' });

await users.set('foo', 'users'); // true
await cache.set('foo', 'cache'); // true
await users.get('foo'); // 'users'
await cache.get('foo'); // 'cache'
await users.clear(); // undefined
await users.get('foo'); // undefined
await cache.get('foo'); // 'cache'
```

### Custom Serializers

Keyv uses [`json-buffer`](https://github.com/dominictarr/json-buffer) for data serialization to ensure consistency across different backends.

You can optionally provide your own serialization functions to support extra data types or to serialize to something other than JSON.

```js
const keyv = new Keyv({ serialize: JSON.stringify, deserialize: JSON.parse });
```

**Warning:** Using custom serializers means you lose any guarantee of data consistency. You should do extensive testing with your serialisation functions and chosen storage engine.

## Official Storage Adapters

The official storage adapters are covered by [over 150 integration tests](https://github.com/jaredwray/keyv/actions/workflows/tests.yaml) to guarantee consistent behaviour. They are lightweight, efficient wrappers over the DB clients making use of indexes and native TTLs where available.

Database | Adapter | Native TTL
---|---|---
Redis | [@keyv/redis](https://github.com/jaredwray/keyv/tree/master/packages/redis) | Yes
MongoDB | [@keyv/mongo](https://github.com/jaredwray/keyv/tree/master/packages/mongo) | Yes 
SQLite | [@keyv/sqlite](https://github.com/jaredwray/keyv/tree/master/packages/sqlite) | No 
PostgreSQL | [@keyv/postgres](https://github.com/jaredwray/keyv/tree/master/packages/postgres) | No 
MySQL | [@keyv/mysql](https://github.com/jaredwray/keyv/tree/master/packages/mysql) | No 
Etcd | [@keyv/etcd](https://github.com/jaredwray/keyv/tree/master/packages/etcd) | Yes
Memcache | [@keyv/memcache](https://github.com/jaredwray/keyv/tree/master/packages/memcache) | Yes

## Third-party Storage Adapters

You can also use third-party storage adapters or build your own. Keyv will wrap these storage adapters in TTL functionality and handle complex types internally.

```js
const Keyv = require('keyv');
const myAdapter = require('./my-storage-adapter');

const keyv = new Keyv({ store: myAdapter });
```

Any store that follows the [`Map`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map) api will work.

```js
new Keyv({ store: new Map() });
```

For example, [`quick-lru`](https://github.com/sindresorhus/quick-lru) is a completely unrelated module that implements the Map API.

```js
const Keyv = require('keyv');
const QuickLRU = require('quick-lru');

const lru = new QuickLRU({ maxSize: 1000 });
const keyv = new Keyv({ store: lru });
```

The following are third-party storage adapters compatible with Keyv:

- [quick-lru](https://github.com/sindresorhus/quick-lru) - Simple "Least Recently Used" (LRU) cache
- [keyv-file](https://github.com/zaaack/keyv-file) - File system storage adapter for Keyv
- [keyv-dynamodb](https://www.npmjs.com/package/keyv-dynamodb) - DynamoDB storage adapter for Keyv
- [keyv-lru](https://www.npmjs.com/package/keyv-lru) - LRU storage adapter for Keyv
- [keyv-null](https://www.npmjs.com/package/keyv-null) - Null storage adapter for Keyv
- [keyv-firestore ](https://github.com/goto-bus-stop/keyv-firestore) – Firebase Cloud Firestore adapter for Keyv
- [keyv-mssql](https://github.com/pmorgan3/keyv-mssql) - Microsoft Sql Server adapter for Keyv
- [keyv-azuretable](https://github.com/howlowck/keyv-azuretable) - Azure Table Storage/API adapter for Keyv
- [keyv-arango](https://github.com/TimMikeladze/keyv-arango) - ArangoDB storage adapter for Keyv
- [keyv-momento](https://github.com/momentohq/node-keyv-adaptor/) - Momento storage adapter for Keyv

## Add Cache Support to your Module

Keyv is designed to be easily embedded into other modules to add cache support. The recommended pattern is to expose a `cache` option in your modules options which is passed through to Keyv. Caching will work in memory by default and users have the option to also install a Keyv storage adapter and pass in a connection string, or any other storage that implements the `Map` API.

You should also set a namespace for your module so you can safely call `.clear()` without clearing unrelated app data.

Inside your module:

```js
class AwesomeModule {
	constructor(opts) {
		this.cache = new Keyv({
			uri: typeof opts.cache === 'string' && opts.cache,
			store: typeof opts.cache !== 'string' && opts.cache,
			namespace: 'awesome-module'
		});
	}
}
```

Now it can be consumed like this:

```js
const AwesomeModule = require('awesome-module');

// Caches stuff in memory by default
const awesomeModule = new AwesomeModule();

// After npm install --save keyv-redis
const awesomeModule = new AwesomeModule({ cache: 'redis://localhost' });

// Some third-party module that implements the Map API
const awesomeModule = new AwesomeModule({ cache: some3rdPartyStore });
```

## Compression

Keyv supports `gzip` and `brotli` compression. To enable compression, pass the `compress` option to the constructor.

```js
const KeyvGzip = require('@keyv/compress-gzip');
const Keyv = require('keyv');

const keyvGzip = new KeyvGzip();
const keyv = new Keyv({ compression: KeyvGzip });
```

You can also pass a custom compression function to the `compression` option. Following the pattern of the official compression adapters.

### Want to build your own? 

Great! Keyv is designed to be easily extended. You can build your own compression adapter by following the pattern of the official compression adapters based on this interface:

```typescript
interface CompressionAdapter {
	async compress(value: any, options?: any);
	async decompress(value: any, options?: any);
	async serialize(value: any);
	async deserialize(value: any);
}
```

In addition to the interface, you can test it with our compression test suite using @keyv/test-suite:

```js
const {keyvCompresstionTests} = require('@keyv/test-suite');
const KeyvGzip = require('@keyv/compress-gzip');

keyvCompresstionTests(test, new KeyvGzip());
```

## API

### new Keyv([uri], [options])

Returns a new Keyv instance.

The Keyv instance is also an `EventEmitter` that will emit an `'error'` event if the storage adapter connection fails.

### uri

Type: `String`<br>
Default: `undefined`

The connection string URI.

Merged into the options object as options.uri.

### options

Type: `Object`

The options object is also passed through to the storage adapter. Check your storage adapter docs for any extra options.

#### options.namespace

Type: `String`<br>
Default: `'keyv'`

Namespace for the current instance.

#### options.ttl

Type: `Number`<br>
Default: `undefined`

Default TTL. Can be overridden by specififying a TTL on `.set()`.

#### options.compression

Type: `@keyv/compress-<compression_package_name>`<br>
Default: `undefined`

Compression package to use. See [Compression](#compression) for more details.

#### options.serialize

Type: `Function`<br>
Default: `JSONB.stringify`

A custom serialization function.

#### options.deserialize

Type: `Function`<br>
Default: `JSONB.parse`

A custom deserialization function.

#### options.store

Type: `Storage adapter instance`<br>
Default: `new Map()`

The storage adapter instance to be used by Keyv.

#### options.adapter

Type: `String`<br>
Default: `undefined`

Specify an adapter to use. e.g `'redis'` or `'mongodb'`.

### Instance

Keys must always be strings. Values can be of any type.

#### .set(key, value, [ttl])

Set a value.

By default keys are persistent. You can set an expiry TTL in milliseconds.

Returns a promise which resolves to `true`.

#### .get(key, [options])

Returns a promise which resolves to the retrieved value.

##### options.raw

Type: `Boolean`<br>
Default: `false`

If set to true the raw DB object Keyv stores internally will be returned instead of just the value.

This contains the TTL timestamp.

#### .delete(key)

Deletes an entry.

Returns a promise which resolves to `true` if the key existed, `false` if not.

#### .clear()

Delete all entries in the current namespace.

Returns a promise which is resolved when the entries have been cleared.

#### .iterator()

Iterate over all entries of the current namespace.

Returns a iterable that can be iterated by for-of loops. For example:

```js
// please note that the "await" keyword should be used here
for await (const [key, value] of this.keyv.iterator()) {
  console.log(key, value);
};
```

# How to Contribute

In this section of the documentation we will cover:

1) How to set up this repository locally
2) How to get started with running commands
3) How to contribute changes using Pull Requests

## Dependencies

This package requires the following dependencies to run:

1) [Yarn V1](https://yarnpkg.com/getting-started/install)
3) [Docker](https://docs.docker.com/get-docker/)

## Setting up your workspace

To contribute to this repository, start by setting up this project locally:

1) Fork this repository into your Git account
2) Clone the forked repository to your local directory using `git clone`
3) Install any of the above missing dependencies

## Launching the project

Once the project is installed locally, you are ready to start up its services:

1) Ensure that your Docker service is running.
2) From the root directory of your project, run the `yarn` command in the command prompt to install yarn.
3) Run the `yarn bootstrap` command to  install any necessary dependencies.
4) Run `yarn test:services:start` to start up this project's Docker container. The container will launch all services within your workspace.

## Available Commands

Once the project is running, you can execute a variety of commands. The root workspace and each subpackage contain a `package.json` file with a  `scripts` field listing all the commands that can be executed from that directory. This project also supports native `yarn`, and `docker` commands.

Here, we'll cover the primary commands that can be executed from the root directory. Unless otherwise noted, these commands can also be executed from a subpackage. If executed from a subpackage, they will only affect that subpackage, rather than the entire workspace.

### `yarn`

The `yarn` command installs yarn in the workspace.

### `yarn bootstrap`

The `yarn bootstrap` command installs all dependencies in the workspace.

### `yarn test:services:start`

The `yarn test:services:start` command starts up the project's Docker container, launching all services in the workspace. This command must be executed from the root directory.

### `yarn test:services:stop`

The `yarn test:services:stop` command brings down the project's Docker container, halting all services. This command must be executed from the root directory.

### `yarn test`

The `yarn test` command runs all tests in the workspace.

### `yarn clean`

The `yarn clean` command removes yarn and all dependencies installed by yarn. After executing this command, you must repeat the steps in *Setting up your workspace* to rebuild your workspace.

## Contributing Changes

Now that you've set up your workspace, you're ready to contribute changes to the `keyv` repository.

1) Make any changes that you would like to contribute in your local workspace.
2) After making these changes, ensure that the project's tests still pass by executing the `yarn test` command in the root directory.
3) Commit your changes and push them to your forked repository.
4) Navigate to the original `keyv` repository and go the *Pull Requests* tab.
5) Click the *New pull request* button, and open a pull request for the branch in your repository that contains your changes.
6) Once your pull request is created, ensure that all checks have passed and that your branch has no conflicts with the base branch. If there are any issues, resolve these changes in your local repository, and then commit and push them to git.
7) Similarly, respond to any reviewer comments or requests for changes by making edits to your local repository and pushing them to Git.
8) Once the pull request has been reviewed, those with write access to the branch will be able to merge your changes into the `keyv` repository.

If you need more information on the steps to create a pull request, you can find a detailed walkthrough in the [Github documentation](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/creating-a-pull-request-from-a-fork)

## License

MIT © Jared Wray
Qx{
	"name": "keyv",
	"version": "4.5.4",
	"description": "Simple key-value storage with support for multiple backends",
	"main": "src/index.js",
	"scripts": {
		"build": "echo 'No build step required.'",
		"prepare": "yarn build",
		"test": "xo && c8 ava --serial",
		"test:ci": "xo && ava --serial",
		"clean": "rm -rf node_modules && rm -rf ./coverage && rm -rf ./test/testdb.sqlite"
	},
	"xo": {
		"rules": {
			"unicorn/prefer-module": 0,
			"unicorn/prefer-node-protocol": 0,
			"@typescript-eslint/consistent-type-definitions": 0,
			"unicorn/no-typeof-undefined": 0,
			"unicorn/prefer-event-target": 0
		}
	},
	"repository": {
		"type": "git",
		"url": "git+https://github.com/jaredwray/keyv.git"
	},
	"keywords": [
		"key",
		"value",
		"store",
		"cache",
		"ttl"
	],
	"author": "Jared Wray <me@jaredwray.com> (http://jaredwray.com)",
	"license": "MIT",
	"bugs": {
		"url": "https://github.com/jaredwray/keyv/issues"
	},
	"homepage": "https://github.com/jaredwray/keyv",
	"dependencies": {
		"json-buffer": "3.0.1"
	},
	"devDependencies": {
		"@keyv/test-suite": "*",
		"eslint": "^8.51.0",
		"eslint-plugin-promise": "^6.1.1",
		"pify": "^5.0.0",
		"timekeeper": "^2.3.1",
		"tsd": "^0.29.0"
	},
	"tsd": {
		"directory": "test"
	},
	"types": "./src/index.d.ts",
	"files": [
		"src"
	]
}
p0xJ 100644 index.d.ts wP⧄kc100644 index.js Sف: bӎ;@Kx|import {EventEmitter} from 'events';

type WithRequiredProperties<T, K extends keyof T> = T & Required<Pick<T, K>>;

declare class Keyv<Value = any, Options extends Record<string, any> = Record<string, unknown>> extends EventEmitter {
	/**
     * `this.opts` is an object containing at least the properties listed
     * below. However, `Keyv.Options` allows arbitrary properties as well.
     * These properties can be specified as the second type parameter to `Keyv`.
     */
	opts: WithRequiredProperties<
	Keyv.Options<Value>,
	'deserialize' | 'namespace' | 'serialize' | 'store' | 'uri'
	> &
	Options;

	/**
     * @param opts The options object is also passed through to the storage adapter. Check your storage adapter docs for any extra options.
     */
	constructor(options?: Keyv.Options<Value> & Options);
	/**
     * @param uri The connection string URI.
     *
     * Merged into the options object as options.uri.
     * @param opts The options object is also passed through to the storage adapter. Check your storage adapter docs for any extra options.
     */
	constructor(uri?: string, options?: Keyv.Options<Value> & Options);

	/** Returns the value. */
	get(key: string, options?: {raw?: false}): Promise<Value | undefined>;
	/** Returns the raw value. */
	get(key: string, options: {raw: true}): Promise<Keyv.DeserializedData<Value> | undefined>;

	/** Returns an array of values. Uses `store.getMany` if it exists, otherwise uses parallel calls to `store.get`. */
	get(key: string[], options?: {raw?: false}): Promise<Array<Value | undefined>>;
	/** Returns an array of raw values. Uses `store.getMany` if it exists, otherwise uses parallel calls to `store.get`. */
	get(key: string[], options: {raw: true}): Promise<Array<Keyv.DeserializedData<Value> | undefined>>;

	/**
     * Set a value.
     *
     * By default keys are persistent. You can set an expiry TTL in milliseconds.
     */
	set(key: string, value: Value, ttl?: number): Promise<true>;
	/**
     * Deletes an entry.
     *
     * Returns `true` if the key existed, `false` if not.
     */
	delete(key: string | string[]): Promise<boolean>;
	/** Delete all entries in the current namespace. */
	clear(): Promise<void>;
	/** Check if key exists in current namespace. */
	has(key: string): Promise<boolean>;
	/** Iterator */
	iterator(namespace?: string): AsyncGenerator<any, void, any>;
	/**
	 * Closes the connection.
	 *
	 * Returns `undefined` when the connection closes.
	 */
	disconnect(): Promise<void>;
}

declare namespace Keyv {
	interface Options<Value> {
		[key: string]: any;

		/** Namespace for the current instance. */
		namespace?: string | undefined;
		/** A custom serialization function. */
		serialize?: ((data: DeserializedData<Value>) => string) | undefined;
		/** A custom deserialization function. */
		deserialize?: ((data: string) => DeserializedData<Value> | undefined) | undefined;
		/** The connection string URI. */
		uri?: string | undefined;
		/** The storage adapter instance to be used by Keyv. */
		store?: Store<string | undefined> | undefined;
		/** Default TTL. Can be overridden by specififying a TTL on `.set()`. */
		ttl?: number | undefined;
		/** Specify an adapter to use. e.g `'redis'` or `'mongodb'`. */
		adapter?: 'redis' | 'mongodb' | 'mongo' | 'sqlite' | 'postgresql' | 'postgres' | 'mysql' | undefined;
		/** Enable compression option **/
		compression?: CompressionAdapter | undefined;
	}

	interface CompressionAdapter {
		compress(value: any, options?: any): Promise<any>;
		decompress(value: any, options?: any): Promise<any>;
		serialize(value: any): Promise<any>;
		deserialize(value: any): Promise<any>;
	}

	interface DeserializedData<Value> {
		value: Value; expires: number | undefined;
	}

	type StoredData<Value> = DeserializedData<Value> | string | undefined;

	interface Store<Value> {
		get(key: string): Value | Promise<Value | undefined> | undefined;
		set(key: string, value: Value, ttl?: number): any;
		delete(key: string): boolean | Promise<boolean>;
		clear(): void | Promise<void>;
		has?(key: string): boolean | Promise<boolean>;
		getMany?(
			keys: string[]
		): Array<StoredData<Value>> | Promise<Array<StoredData<Value>>> | undefined;
	}
}

export = Keyv;
7|Hx4'use strict';

const EventEmitter = require('events');
const JSONB = require('json-buffer');

const loadStore = options => {
	const adapters = {
		redis: '@keyv/redis',
		rediss: '@keyv/redis',
		mongodb: '@keyv/mongo',
		mongo: '@keyv/mongo',
		sqlite: '@keyv/sqlite',
		postgresql: '@keyv/postgres',
		postgres: '@keyv/postgres',
		mysql: '@keyv/mysql',
		etcd: '@keyv/etcd',
		offline: '@keyv/offline',
		tiered: '@keyv/tiered',
	};
	if (options.adapter || options.uri) {
		const adapter = options.adapter || /^[^:+]*/.exec(options.uri)[0];
		return new (require(adapters[adapter]))(options);
	}

	return new Map();
};

const iterableAdapters = [
	'sqlite',
	'postgres',
	'mysql',
	'mongo',
	'redis',
	'tiered',
];

class Keyv extends EventEmitter {
	constructor(uri, {emitErrors = true, ...options} = {}) {
		super();
		this.opts = {
			namespace: 'keyv',
			serialize: JSONB.stringify,
			deserialize: JSONB.parse,
			...((typeof uri === 'string') ? {uri} : uri),
			...options,
		};

		if (!this.opts.store) {
			const adapterOptions = {...this.opts};
			this.opts.store = loadStore(adapterOptions);
		}

		if (this.opts.compression) {
			const compression = this.opts.compression;
			this.opts.serialize = compression.serialize.bind(compression);
			this.opts.deserialize = compression.deserialize.bind(compression);
		}

		if (typeof this.opts.store.on === 'function' && emitErrors) {
			this.opts.store.on('error', error => this.emit('error', error));
		}

		this.opts.store.namespace = this.opts.namespace;

		const generateIterator = iterator => async function * () {
			for await (const [key, raw] of typeof iterator === 'function'
				? iterator(this.opts.store.namespace)
				: iterator) {
				const data = await this.opts.deserialize(raw);
				if (this.opts.store.namespace && !key.includes(this.opts.store.namespace)) {
					continue;
				}

				if (typeof data.expires === 'number' && Date.now() > data.expires) {
					this.delete(key);
					continue;
				}

				yield [this._getKeyUnprefix(key), data.value];
			}
		};

		// Attach iterators
		if (typeof this.opts.store[Symbol.iterator] === 'function' && this.opts.store instanceof Map) {
			this.iterator = generateIterator(this.opts.store);
		} else if (typeof this.opts.store.iterator === 'function' && this.opts.store.opts
			&& this._checkIterableAdaptar()) {
			this.iterator = generateIterator(this.opts.store.iterator.bind(this.opts.store));
		}
	}

	_checkIterableAdaptar() {
		return iterableAdapters.includes(this.opts.store.opts.dialect)
			|| iterableAdapters.findIndex(element => this.opts.store.opts.url.includes(element)) >= 0;
	}

	_getKeyPrefix(key) {
		return `${this.opts.namespace}:${key}`;
	}

	_getKeyPrefixArray(keys) {
		return keys.map(key => `${this.opts.namespace}:${key}`);
	}

	_getKeyUnprefix(key) {
		return key
			.split(':')
			.splice(1)
			.join(':');
	}

	get(key, options) {
		const {store} = this.opts;
		const isArray = Array.isArray(key);
		const keyPrefixed = isArray ? this._getKeyPrefixArray(key) : this._getKeyPrefix(key);
		if (isArray && store.getMany === undefined) {
			const promises = [];
			for (const key of keyPrefixed) {
				promises.push(Promise.resolve()
					.then(() => store.get(key))
					.then(data => (typeof data === 'string') ? this.opts.deserialize(data) : (this.opts.compression ? this.opts.deserialize(data) : data))
					.then(data => {
						if (data === undefined || data === null) {
							return undefined;
						}

						if (typeof data.expires === 'number' && Date.now() > data.expires) {
							return this.delete(key).then(() => undefined);
						}

						return (options && options.raw) ? data : data.value;
					}),
				);
			}

			return Promise.allSettled(promises)
				.then(values => {
					const data = [];
					for (const value of values) {
						data.push(value.value);
					}

					return data;
				});
		}

		return Promise.resolve()
			.then(() => isArray ? store.getMany(keyPrefixed) : store.get(keyPrefixed))
			.then(data => (typeof data === 'string') ? this.opts.deserialize(data) : (this.opts.compression ? this.opts.deserialize(data) : data))
			.then(data => {
				if (data === undefined || data === null) {
					return undefined;
				}

				if (isArray) {
					return data.map((row, index) => {
						if ((typeof row === 'string')) {
							row = this.opts.deserialize(row);
						}

						if (row === undefined || row === null) {
							return undefined;
						}

						if (typeof row.expires === 'number' && Date.now() > row.expires) {
							this.delete(key[index]).then(() => undefined);
							return undefined;
						}

						return (options && options.raw) ? row : row.value;
					});
				}

				if (typeof data.expires === 'number' && Date.now() > data.expires) {
					return this.delete(key).then(() => undefined);
				}

				return (options && options.raw) ? data : data.value;
			});
	}

	set(key, value, ttl) {
		const keyPrefixed = this._getKeyPrefix(key);
		if (typeof ttl === 'undefined') {
			ttl = this.opts.ttl;
		}

		if (ttl === 0) {
			ttl = undefined;
		}

		const {store} = this.opts;

		return Promise.resolve()
			.then(() => {
				const expires = (typeof ttl === 'number') ? (Date.now() + ttl) : null;
				if (typeof value === 'symbol') {
					this.emit('error', 'symbol cannot be serialized');
				}

				value = {value, expires};
				return this.opts.serialize(value);
			})
			.then(value => store.set(keyPrefixed, value, ttl))
			.then(() => true);
	}

	delete(key) {
		const {store} = this.opts;
		if (Array.isArray(key)) {
			const keyPrefixed = this._getKeyPrefixArray(key);
			if (store.deleteMany === undefined) {
				const promises = [];
				for (const key of keyPrefixed) {
					promises.push(store.delete(key));
				}

				return Promise.allSettled(promises)
					.then(values => values.every(x => x.value === true));
			}

			return Promise.resolve()
				.then(() => store.deleteMany(keyPrefixed));
		}

		const keyPrefixed = this._getKeyPrefix(key);
		return Promise.resolve()
			.then(() => store.delete(keyPrefixed));
	}

	clear() {
		const {store} = this.opts;
		return Promise.resolve()
			.then(() => store.clear());
	}

	has(key) {
		const keyPrefixed = this._getKeyPrefix(key);
		const {store} = this.opts;
		return Promise.resolve()
			.then(async () => {
				if (typeof store.has === 'function') {
					return store.has(keyPrefixed);
				}

				const value = await store.get(keyPrefixed);
				return value !== undefined;
			});
	}

	disconnect() {
		const {store} = this.opts;
		if (typeof store.disconnect === 'function') {
			return store.disconnect();
		}
	}
}

module.exports = Keyv;
zx q100644 LICENSE R[o,;MS'
100644 README.md zfO:*[KZO40000 lib 6Cp3v$^X100644 package.json 5mixO>r+D	>3Nx(# levn [![Build Status](https://travis-ci.org/gkz/levn.png)](https://travis-ci.org/gkz/levn) <a name="levn" />
__Light ECMAScript (JavaScript) Value Notation__
Levn is a library which allows you to parse a string into a JavaScript value based on an expected type. It is meant for short amounts of human entered data (eg. config files, command line arguments).

Levn aims to concisely describe JavaScript values in text, and allow for the extraction and validation of those values. Levn uses [type-check](https://github.com/gkz/type-check) for its type format, and to validate the results. MIT license. Version 0.4.1.

__How is this different than JSON?__ levn is meant to be written by humans only, is (due to the previous point) much more concise, can be validated against supplied types, has regex and date literals, and can easily be extended with custom types. On the other hand, it is probably slower and thus less efficient at transporting large amounts of data, which is fine since this is not its purpose.

    npm install levn

For updates on levn, [follow me on twitter](https://twitter.com/gkzahariev).


## Quick Examples

```js
var parse = require('levn').parse;
parse('Number', '2');      // 2
parse('String', '2');      // '2'
parse('String', 'levn');   // 'levn'
parse('String', 'a b');    // 'a b'
parse('Boolean', 'true');  // true

parse('Date', '#2011-11-11#'); // (Date object)
parse('Date', '2011-11-11');   // (Date object)
parse('RegExp', '/[a-z]/gi');  // /[a-z]/gi
parse('RegExp', 're');         // /re/
parse('Int', '2');             // 2

parse('Number | String', 'str'); // 'str'
parse('Number | String', '2');   // 2

parse('[Number]', '[1,2,3]');                      // [1,2,3]
parse('(String, Boolean)', '(hi, false)');         // ['hi', false]
parse('{a: String, b: Number}', '{a: str, b: 2}'); // {a: 'str', b: 2}

// at the top level, you can ommit surrounding delimiters
parse('[Number]', '1,2,3');                      // [1,2,3]
parse('(String, Boolean)', 'hi, false');         // ['hi', false]
parse('{a: String, b: Number}', 'a: str, b: 2'); // {a: 'str', b: 2}

// wildcard - auto choose type
parse('*', '[hi,(null,[42]),{k: true}]'); // ['hi', [null, [42]], {k: true}]
```
## Usage

`require('levn');` returns an object that exposes three properties. `VERSION` is the current version of the library as a string. `parse` and `parsedTypeParse` are functions.

```js
// parse(type, input, options);
parse('[Number]', '1,2,3'); // [1, 2, 3]

// parsedTypeParse(parsedType, input, options);
var parsedType = require('type-check').parseType('[Number]');
parsedTypeParse(parsedType, '1,2,3'); // [1, 2, 3]
```

### parse(type, input, options)

`parse` casts the string `input` into a JavaScript value according to the specified `type` in the [type format](https://github.com/gkz/type-check#type-format) (and taking account the optional `options`) and returns the resulting JavaScript value.

##### arguments
* type - `String` - the type written in the [type format](https://github.com/gkz/type-check#type-format) which to check against
* input - `String` - the value written in the [levn format](#levn-format)
* options - `Maybe Object` - an optional parameter specifying additional [options](#options)

##### returns
`*` - the resulting JavaScript value

##### example
```js
parse('[Number]', '1,2,3'); // [1, 2, 3]
```

### parsedTypeParse(parsedType, input, options)

`parsedTypeParse` casts the string `input` into a JavaScript value according to the specified `type` which has already been parsed (and taking account the optional `options`) and returns the resulting JavaScript value. You can parse a type using the [type-check](https://github.com/gkz/type-check) library's `parseType` function.

##### arguments
* type - `Object` - the type in the parsed type format which to check against
* input - `String` - the value written in the [levn format](#levn-format)
* options - `Maybe Object` - an optional parameter specifying additional [options](#options)

##### returns
`*` - the resulting JavaScript value

##### example
```js
var parsedType = require('type-check').parseType('[Number]');
parsedTypeParse(parsedType, '1,2,3'); // [1, 2, 3]
```

## Levn Format

Levn can use the type information you provide to choose the appropriate value to produce from the input. For the same input, it will choose a different output value depending on the type provided. For example, `parse('Number', '2')` will produce the number `2`, but `parse('String', '2')` will produce the string `"2"`.

If you do not provide type information, and simply use `*`, levn will parse the input according the unambiguous "explicit" mode, which we will now detail - you can also set the `explicit` option to true manually in the [options](#options).

* `"string"`, `'string'` are parsed as a String, eg. `"a msg"` is `"a msg"`
* `#date#` is parsed as a Date, eg. `#2011-11-11#` is `new Date('2011-11-11')`
* `/regexp/flags` is parsed as a RegExp, eg. `/re/gi` is `/re/gi`
* `undefined`, `null`, `NaN`, `true`, and `false` are all their JavaScript equivalents
* `[element1, element2, etc]` is an Array, and the casting procedure is recursively applied to each element. Eg. `[1,2,3]` is `[1,2,3]`.
* `(element1, element2, etc)` is an tuple, and the casting procedure is recursively applied to each element. Eg. `(1, a)` is `(1, a)` (is `[1, 'a']`).
* `{key1: val1, key2: val2, ...}` is an Object, and the casting procedure is recursively applied to each property. Eg. `{a: 1, b: 2}` is `{a: 1, b: 2}`.
* Any test which does not fall under the above, and which does not contain special characters (`[``]``(``)``{``}``:``,`) is a string, eg. `$12- blah` is `"$12- blah"`.

If you do provide type information, you can make your input more concise as the program already has some information about what it expects. Please see the [type format](https://github.com/gkz/type-check#type-format) section of [type-check](https://github.com/gkz/type-check) for more information about how to specify types. There are some rules about what levn can do with the information:

* If a String is expected, and only a String, all characters of the input (including any special ones) will become part of the output. Eg. `[({})]` is `"[({})]"`, and `"hi"` is `'"hi"'`.
* If a Date is expected, the surrounding `#` can be omitted from date literals. Eg. `2011-11-11` is `new Date('2011-11-11')`.
* If a RegExp is expected, no flags need to be specified, and the regex is not using any of the special characters,the opening and closing `/` can be omitted - this will have the affect of setting the source of the regex to the input. Eg. `regex` is `/regex/`.
* If an Array is expected, and it is the root node (at the top level), the opening `[` and closing `]` can be omitted. Eg. `1,2,3` is `[1,2,3]`.
* If a tuple is expected, and it is the root node (at the top level), the opening `(` and closing `)` can be omitted. Eg. `1, a` is `(1, a)` (is `[1, 'a']`).
* If an Object is expected, and it is the root node (at the top level), the opening `{` and closing `}` can be omitted. Eg `a: 1, b: 2` is `{a: 1, b: 2}`.

If you list multiple types (eg. `Number | String`), it will first attempt to cast to the first type and then validate - if the validation fails it will move on to the next type and so forth, left to right. You must be careful as some types will succeed with any input, such as String. Thus put String at the end of your list. In non-explicit mode, Date and RegExp will succeed with a large variety of input - also be careful with these and list them near the end if not last in your list.

Whitespace between special characters and elements is inconsequential.

## Options

Options is an object. It is an optional parameter to the `parse` and `parsedTypeParse` functions.

### Explicit

A `Boolean`. By default it is `false`.

__Example:__

```js
parse('RegExp', 're', {explicit: false});          // /re/
parse('RegExp', 're', {explicit: true});           // Error: ... does not type check...
parse('RegExp | String', 're', {explicit: true});  // 're'
```

`explicit` sets whether to be in explicit mode or not. Using `*` automatically activates explicit mode. For more information, read the [levn format](#levn-format) section.

### customTypes

An `Object`. Empty `{}` by default.

__Example:__

```js
var options = {
  customTypes: {
    Even: {
      typeOf: 'Number',
      validate: function (x) {
        return x % 2 === 0;
      },
      cast: function (x) {
        return {type: 'Just', value: parseInt(x)};
      }
    }
  }
}
parse('Even', '2', options); // 2
parse('Even', '3', options); // Error: Value: "3" does not type check...
```

__Another Example:__
```js
function Person(name, age){
  this.name = name;
  this.age = age;
}
var options = {
  customTypes: {
    Person: {
      typeOf: 'Object',
      validate: function (x) {
        x instanceof Person;
      },
      cast: function (value, options, typesCast) {
        var name, age;
        if ({}.toString.call(value).slice(8, -1) !== 'Object') {
          return {type: 'Nothing'};
        }
        name = typesCast(value.name, [{type: 'String'}], options);
        age = typesCast(value.age, [{type: 'Numger'}], options);
        return {type: 'Just', value: new Person(name, age)};
    }
  }
}
parse('Person', '{name: Laura, age: 25}', options); // Person {name: 'Laura', age: 25}
```

`customTypes` is an object whose keys are the name of the types, and whose values are an object with three properties, `typeOf`, `validate`, and `cast`. For more information about `typeOf` and `validate`, please see the [custom types](https://github.com/gkz/type-check#custom-types) section of type-check.

`cast` is a function which receives three arguments, the value under question, options, and the typesCast function. In `cast`, attempt to cast the value into the specified type. If you are successful, return an object in the format `{type: 'Just', value: CAST-VALUE}`, if you know it won't work, return `{type: 'Nothing'}`.  You can use the `typesCast` function to cast any child values. Remember to pass `options` to it. In your function you can also check for `options.explicit` and act accordingly.

## Technical About

`levn` is written in [LiveScript](http://livescript.net/) - a language that compiles to JavaScript. It uses [type-check](https://github.com/gkz/type-check) to both parse types and validate values. It also uses the [prelude.ls](http://preludels.com/) library.
$xr 100644 cast.js ˚my|D o5100644 index.js h@H]=￤^?*100644 parse-string.js /Պ&L"Fʟh3-nxJ// Generated by LiveScript 1.6.0
(function(){
  var parsedTypeCheck, types, toString$ = {}.toString;
  parsedTypeCheck = require('type-check').parsedTypeCheck;
  types = {
    '*': function(value, options){
      switch (toString$.call(value).slice(8, -1)) {
      case 'Array':
        return typeCast(value, {
          type: 'Array'
        }, options);
      case 'Object':
        return typeCast(value, {
          type: 'Object'
        }, options);
      default:
        return {
          type: 'Just',
          value: typesCast(value, [
            {
              type: 'Undefined'
            }, {
              type: 'Null'
            }, {
              type: 'NaN'
            }, {
              type: 'Boolean'
            }, {
              type: 'Number'
            }, {
              type: 'Date'
            }, {
              type: 'RegExp'
            }, {
              type: 'Array'
            }, {
              type: 'Object'
            }, {
              type: 'String'
            }
          ], (options.explicit = true, options))
        };
      }
    },
    Undefined: function(it){
      if (it === 'undefined' || it === void 8) {
        return {
          type: 'Just',
          value: void 8
        };
      } else {
        return {
          type: 'Nothing'
        };
      }
    },
    Null: function(it){
      if (it === 'null') {
        return {
          type: 'Just',
          value: null
        };
      } else {
        return {
          type: 'Nothing'
        };
      }
    },
    NaN: function(it){
      if (it === 'NaN') {
        return {
          type: 'Just',
          value: NaN
        };
      } else {
        return {
          type: 'Nothing'
        };
      }
    },
    Boolean: function(it){
      if (it === 'true') {
        return {
          type: 'Just',
          value: true
        };
      } else if (it === 'false') {
        return {
          type: 'Just',
          value: false
        };
      } else {
        return {
          type: 'Nothing'
        };
      }
    },
    Number: function(it){
      return {
        type: 'Just',
        value: +it
      };
    },
    Int: function(it){
      return {
        type: 'Just',
        value: +it
      };
    },
    Float: function(it){
      return {
        type: 'Just',
        value: +it
      };
    },
    Date: function(value, options){
      var that;
      if (that = /^\#([\s\S]*)\#$/.exec(value)) {
        return {
          type: 'Just',
          value: new Date(+that[1] || that[1])
        };
      } else if (options.explicit) {
        return {
          type: 'Nothing'
        };
      } else {
        return {
          type: 'Just',
          value: new Date(+value || value)
        };
      }
    },
    RegExp: function(value, options){
      var that;
      if (that = /^\/([\s\S]*)\/([gimy]*)$/.exec(value)) {
        return {
          type: 'Just',
          value: new RegExp(that[1], that[2])
        };
      } else if (options.explicit) {
        return {
          type: 'Nothing'
        };
      } else {
        return {
          type: 'Just',
          value: new RegExp(value)
        };
      }
    },
    Array: function(value, options){
      return castArray(value, {
        of: [{
          type: '*'
        }]
      }, options);
    },
    Object: function(value, options){
      return castFields(value, {
        of: {}
      }, options);
    },
    String: function(it){
      var replace, that;
      if (toString$.call(it).slice(8, -1) !== 'String') {
        return {
          type: 'Nothing'
        };
      }
      replace = function(value, quote){
        return value.replace(/\\([^u]|u[0-9a-fA-F]{4})/g, function(all, escaped){
          switch (escaped[0]) {
          case quote:
            return quote;
          case '\\':
            return '\\';
          case 'b':
            return '\b';
          case 'f':
            return '\f';
          case 'n':
            return '\n';
          case 'r':
            return '\r';
          case 't':
            return '\t';
          case 'u':
            return JSON.parse("\"" + all + "\"");
          default:
            return escaped;
          }
        });
      };
      if (that = it.match(/^'([\s\S]*)'$/)) {
        return {
          type: 'Just',
          value: replace(that[1], "'")
        };
      } else if (that = it.match(/^"([\s\S]*)"$/)) {
        return {
          type: 'Just',
          value: replace(that[1], '"')
        };
      } else {
        return {
          type: 'Just',
          value: it
        };
      }
    }
  };
  function castArray(node, type, options){
    var typeOf, element;
    if (toString$.call(node).slice(8, -1) !== 'Array') {
      return {
        type: 'Nothing'
      };
    }
    typeOf = type.of;
    return {
      type: 'Just',
      value: (function(){
        var i$, ref$, len$, results$ = [];
        for (i$ = 0, len$ = (ref$ = node).length; i$ < len$; ++i$) {
          element = ref$[i$];
          results$.push(typesCast(element, typeOf, options));
        }
        return results$;
      }())
    };
  }
  function castTuple(node, type, options){
    var result, i, i$, ref$, len$, types, cast;
    if (toString$.call(node).slice(8, -1) !== 'Array') {
      return {
        type: 'Nothing'
      };
    }
    result = [];
    i = 0;
    for (i$ = 0, len$ = (ref$ = type.of).length; i$ < len$; ++i$) {
      types = ref$[i$];
      cast = typesCast(node[i], types, options);
      if (toString$.call(cast).slice(8, -1) !== 'Undefined') {
        result.push(cast);
      }
      i++;
    }
    if (node.length <= i) {
      return {
        type: 'Just',
        value: result
      };
    } else {
      return {
        type: 'Nothing'
      };
    }
  }
  function castFields(node, type, options){
    var typeOf, key, value;
    if (toString$.call(node).slice(8, -1) !== 'Object') {
      return {
        type: 'Nothing'
      };
    }
    typeOf = type.of;
    return {
      type: 'Just',
      value: (function(){
        var ref$, resultObj$ = {};
        for (key in ref$ = node) {
          value = ref$[key];
          resultObj$[typesCast(key, [{
            type: 'String'
          }], options)] = typesCast(value, typeOf[key] || [{
            type: '*'
          }], options);
        }
        return resultObj$;
      }())
    };
  }
  function typeCast(node, typeObj, options){
    var type, structure, castFunc, ref$;
    type = typeObj.type, structure = typeObj.structure;
    if (type) {
      castFunc = ((ref$ = options.customTypes[type]) != null ? ref$.cast : void 8) || types[type];
      if (!castFunc) {
        throw new Error("Type not defined: " + type + ".");
      }
      return castFunc(node, options, typesCast);
    } else {
      switch (structure) {
      case 'array':
        return castArray(node, typeObj, options);
      case 'tuple':
        return castTuple(node, typeObj, options);
      case 'fields':
        return castFields(node, typeObj, options);
      }
    }
  }
  function typesCast(node, types, options){
    var i$, len$, type, ref$, valueType, value;
    for (i$ = 0, len$ = types.length; i$ < len$; ++i$) {
      type = types[i$];
      ref$ = typeCast(node, type, options), valueType = ref$.type, value = ref$.value;
      if (valueType === 'Nothing') {
        continue;
      }
      if (parsedTypeCheck([type], value, {
        customTypes: options.customTypes
      })) {
        return value;
      }
    }
    throw new Error("Value " + JSON.stringify(node) + " does not type check against " + JSON.stringify(types) + ".");
  }
  module.exports = function(node, types, options){
    if (!options.explicit && types.length === 1 && types[0].type === 'String') {
      return node;
    }
    return typesCast(node, types, options);
  };
}).call(this);
/e1x// Generated by LiveScript 1.6.0
(function(){
  var parseString, cast, parseType, VERSION, parsedTypeParse, parse;
  parseString = require('./parse-string');
  cast = require('./cast');
  parseType = require('type-check').parseType;
  VERSION = '0.4.1';
  parsedTypeParse = function(parsedType, string, options){
    options == null && (options = {});
    options.explicit == null && (options.explicit = false);
    options.customTypes == null && (options.customTypes = {});
    return cast(parseString(parsedType, string, options), parsedType, options);
  };
  parse = function(type, string, options){
    return parsedTypeParse(parseType(type), string, options);
  };
  module.exports = {
    VERSION: VERSION,
    parse: parse,
    parsedTypeParse: parsedTypeParse
  };
}).call(this);
Bx#// Generated by LiveScript 1.6.0
(function(){
  var reject, special, tokenRegex;
  reject = require('prelude-ls').reject;
  function consumeOp(tokens, op){
    if (tokens[0] === op) {
      return tokens.shift();
    } else {
      throw new Error("Expected '" + op + "', but got '" + tokens[0] + "' instead in " + JSON.stringify(tokens) + ".");
    }
  }
  function maybeConsumeOp(tokens, op){
    if (tokens[0] === op) {
      return tokens.shift();
    }
  }
  function consumeList(tokens, arg$, hasDelimiters){
    var open, close, result, untilTest;
    open = arg$[0], close = arg$[1];
    if (hasDelimiters) {
      consumeOp(tokens, open);
    }
    result = [];
    untilTest = "," + (hasDelimiters ? close : '');
    while (tokens.length && (hasDelimiters && tokens[0] !== close)) {
      result.push(consumeElement(tokens, untilTest));
      maybeConsumeOp(tokens, ',');
    }
    if (hasDelimiters) {
      consumeOp(tokens, close);
    }
    return result;
  }
  function consumeArray(tokens, hasDelimiters){
    return consumeList(tokens, ['[', ']'], hasDelimiters);
  }
  function consumeTuple(tokens, hasDelimiters){
    return consumeList(tokens, ['(', ')'], hasDelimiters);
  }
  function consumeFields(tokens, hasDelimiters){
    var result, untilTest, key;
    if (hasDelimiters) {
      consumeOp(tokens, '{');
    }
    result = {};
    untilTest = "," + (hasDelimiters ? '}' : '');
    while (tokens.length && (!hasDelimiters || tokens[0] !== '}')) {
      key = consumeValue(tokens, ':');
      consumeOp(tokens, ':');
      result[key] = consumeElement(tokens, untilTest);
      maybeConsumeOp(tokens, ',');
    }
    if (hasDelimiters) {
      consumeOp(tokens, '}');
    }
    return result;
  }
  function consumeValue(tokens, untilTest){
    var out;
    untilTest == null && (untilTest = '');
    out = '';
    while (tokens.length && -1 === untilTest.indexOf(tokens[0])) {
      out += tokens.shift();
    }
    return out;
  }
  function consumeElement(tokens, untilTest){
    switch (tokens[0]) {
    case '[':
      return consumeArray(tokens, true);
    case '(':
      return consumeTuple(tokens, true);
    case '{':
      return consumeFields(tokens, true);
    default:
      return consumeValue(tokens, untilTest);
    }
  }
  function consumeTopLevel(tokens, types, options){
    var ref$, type, structure, origTokens, result, finalResult, x$, y$;
    ref$ = types[0], type = ref$.type, structure = ref$.structure;
    origTokens = tokens.concat();
    if (!options.explicit && types.length === 1 && ((!type && structure) || (type === 'Array' || type === 'Object'))) {
      result = structure === 'array' || type === 'Array'
        ? consumeArray(tokens, tokens[0] === '[')
        : structure === 'tuple'
          ? consumeTuple(tokens, tokens[0] === '(')
          : consumeFields(tokens, tokens[0] === '{');
      finalResult = tokens.length ? consumeElement(structure === 'array' || type === 'Array'
        ? (x$ = origTokens, x$.unshift('['), x$.push(']'), x$)
        : (y$ = origTokens, y$.unshift('('), y$.push(')'), y$)) : result;
    } else {
      finalResult = consumeElement(tokens);
    }
    return finalResult;
  }
  special = /\[\]\(\)}{:,/.source;
  tokenRegex = RegExp('("(?:\\\\"|[^"])*")|(\'(?:\\\\\'|[^\'])*\')|(/(?:\\\\/|[^/])*/[a-zA-Z]*)|(#.*#)|([' + special + '])|([^\\s' + special + '](?:\\s*[^\\s' + special + ']+)*)|\\s*');
  module.exports = function(types, string, options){
    var tokens, node;
    options == null && (options = {});
    if (!options.explicit && types.length === 1 && types[0].type === 'String') {
      return string;
    }
    tokens = reject(not$, string.split(tokenRegex));
    node = consumeTopLevel(tokens, types, options);
    if (!node) {
      throw new Error("Error parsing '" + string + "'.");
    }
    return node;
  };
  function not$(x){ return !x; }
}).call(this);
͵8xz{
  "name": "levn",
  "version": "0.4.1",
  "author": "George Zahariev <z@georgezahariev.com>",
  "description": "Light ECMAScript (JavaScript) Value Notation - human written, concise, typed, flexible",
  "homepage": "https://github.com/gkz/levn",
  "keywords": [
    "levn",
    "light",
    "ecmascript",
    "value",
    "notation",
    "json",
    "typed",
    "human",
    "concise",
    "typed",
    "flexible"
  ],
  "files": [
    "lib",
    "README.md",
    "LICENSE"
  ],
  "main": "./lib/",
  "bugs": "https://github.com/gkz/levn/issues",
  "license": "MIT",
  "engines": {
    "node": ">= 0.8.0"
  },
  "repository": {
    "type": "git",
    "url": "git://github.com/gkz/levn.git"
  },
  "scripts": {
    "test": "make test"
  },
  "dependencies": {
    "prelude-ls": "^1.2.1",
    "type-check": "~0.4.0"
  },
  "devDependencies": {
    "livescript": "^1.6.0",
    "mocha": "^7.1.1"
  }
}
cx E100644 index.d.ts !5&ӌ?5<*100644 index.js 5Tj);S'100644 license |JW?z100644 package.json ɻ@[Z`6AI100644 readme.md ֪ɋvYJY0F7Jsbx,declare namespace locatePath {
	interface Options {
		/**
		Current working directory.

		@default process.cwd()
		*/
		readonly cwd?: string;

		/**
		Type of path to match.

		@default 'file'
		*/
		readonly type?: 'file' | 'directory';

		/**
		Allow symbolic links to match if they point to the requested path type.

		@default true
		*/
		readonly allowSymlinks?: boolean;
	}

	interface AsyncOptions extends Options {
		/**
		Number of concurrently pending promises. Minimum: `1`.

		@default Infinity
		*/
		readonly concurrency?: number;

		/**
		Preserve `paths` order when searching.

		Disable this to improve performance if you don't care about the order.

		@default true
		*/
		readonly preserveOrder?: boolean;
	}
}

declare const locatePath: {
	/**
	Synchronously get the first path that exists on disk of multiple paths.

	@param paths - Paths to check.
	@returns The first path that exists or `undefined` if none exists.
	*/
	sync: (
		paths: Iterable<string>,
		options?: locatePath.Options
	) => string | undefined;

	/**
	Get the first path that exists on disk of multiple paths.

	@param paths - Paths to check.
	@returns The first path that exists or `undefined` if none exists.

	@example
	```
	import locatePath = require('locate-path');

	const files = [
		'unicorn.png',
		'rainbow.png', // Only this one actually exists on disk
		'pony.png'
	];

	(async () => {
		console(await locatePath(files));
		//=> 'rainbow'
	})();
	```
	*/
	(paths: Iterable<string>, options?: locatePath.AsyncOptions): Promise<
	string | undefined
	>;
};

export = locatePath;
s	Sx1'use strict';
const path = require('path');
const fs = require('fs');
const {promisify} = require('util');
const pLocate = require('p-locate');

const fsStat = promisify(fs.stat);
const fsLStat = promisify(fs.lstat);

const typeMappings = {
	directory: 'isDirectory',
	file: 'isFile'
};

function checkType({type}) {
	if (type in typeMappings) {
		return;
	}

	throw new Error(`Invalid type specified: ${type}`);
}

const matchType = (type, stat) => type === undefined || stat[typeMappings[type]]();

module.exports = async (paths, options) => {
	options = {
		cwd: process.cwd(),
		type: 'file',
		allowSymlinks: true,
		...options
	};

	checkType(options);

	const statFn = options.allowSymlinks ? fsStat : fsLStat;

	return pLocate(paths, async path_ => {
		try {
			const stat = await statFn(path.resolve(options.cwd, path_));
			return matchType(options.type, stat);
		} catch {
			return false;
		}
	}, options);
};

module.exports.sync = (paths, options) => {
	options = {
		cwd: process.cwd(),
		allowSymlinks: true,
		type: 'file',
		...options
	};

	checkType(options);

	const statFn = options.allowSymlinks ? fs.statSync : fs.lstatSync;

	for (const path_ of paths) {
		try {
			const stat = statFn(path.resolve(options.cwd, path_));

			if (matchType(options.type, stat)) {
				return path_;
			}
		} catch {}
	}
};
nG1x{
	"name": "locate-path",
	"version": "6.0.0",
	"description": "Get the first path that exists on disk of multiple paths",
	"license": "MIT",
	"repository": "sindresorhus/locate-path",
	"funding": "https://github.com/sponsors/sindresorhus",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "https://sindresorhus.com"
	},
	"engines": {
		"node": ">=10"
	},
	"scripts": {
		"test": "xo && ava && tsd"
	},
	"files": [
		"index.js",
		"index.d.ts"
	],
	"keywords": [
		"locate",
		"path",
		"paths",
		"file",
		"files",
		"exists",
		"find",
		"finder",
		"search",
		"searcher",
		"array",
		"iterable",
		"iterator"
	],
	"dependencies": {
		"p-locate": "^5.0.0"
	},
	"devDependencies": {
		"ava": "^2.4.0",
		"tsd": "^0.13.1",
		"xo": "^0.32.1"
	}
}
xb# locate-path [![Build Status](https://travis-ci.com/sindresorhus/locate-path.svg?branch=master)](https://travis-ci.com/github/sindresorhus/locate-path)

> Get the first path that exists on disk of multiple paths

## Install

```
$ npm install locate-path
```

## Usage

Here we find the first file that exists on disk, in array order.

```js
const locatePath = require('locate-path');

const files = [
	'unicorn.png',
	'rainbow.png', // Only this one actually exists on disk
	'pony.png'
];

(async () => {
	console(await locatePath(files));
	//=> 'rainbow'
})();
```

## API

### locatePath(paths, options?)

Returns a `Promise<string>` for the first path that exists or `undefined` if none exists.

#### paths

Type: `Iterable<string>`

Paths to check.

#### options

Type: `object`

##### concurrency

Type: `number`\
Default: `Infinity`\
Minimum: `1`

Number of concurrently pending promises.

##### preserveOrder

Type: `boolean`\
Default: `true`

Preserve `paths` order when searching.

Disable this to improve performance if you don't care about the order.

##### cwd

Type: `string`\
Default: `process.cwd()`

Current working directory.

##### type

Type: `string`\
Default: `'file'`\
Values: `'file' | 'directory'`

The type of paths that can match.

##### allowSymlinks

Type: `boolean`\
Default: `true`

Allow symbolic links to match if they point to the chosen path type.

### locatePath.sync(paths, options?)

Returns the first path that exists or `undefined` if none exists.

#### paths

Type: `Iterable<string>`

Paths to check.

#### options

Type: `object`

##### cwd

Same as above.

##### type

Same as above.

##### allowSymlinks

Same as above.

## Related

- [path-exists](https://github.com/sindresorhus/path-exists) - Check if a path exists

---

<div align="center">
	<b>
		<a href="https://tidelift.com/subscription/pkg/npm-locate-path?utm_source=npm-locate-path&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
	</b>
	<br>
	<sub>
		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
	</sub>
</div>
ee馪x E100644 index.d.ts VGq4qr`100644 index.js g&p_
h۰_100644 license agXpJ>:100644 package.json u4d|+100644 readme.md ye`$UNkxx/**
 * Get the count of the longest repeating streak of `substring` in `value`.
 *
 * @param {string} value
 *   Content to search in.
 * @param {string} substring
 *   Substring to look for, typically one character.
 * @returns {number}
 *   Count of most frequent adjacent `substring`s in `value`.
 */
export function longestStreak(value: string, substring: string): number
,*p3x7/**
 * Get the count of the longest repeating streak of `substring` in `value`.
 *
 * @param {string} value
 *   Content to search in.
 * @param {string} substring
 *   Substring to look for, typically one character.
 * @returns {number}
 *   Count of most frequent adjacent `substring`s in `value`.
 */
export function longestStreak(value, substring) {
  const source = String(value)
  let index = source.indexOf(substring)
  let expected = index
  let count = 0
  let max = 0

  if (typeof substring !== 'string') {
    throw new TypeError('Expected substring')
  }

  while (index !== -1) {
    if (index === expected) {
      if (++count > max) {
        max = count
      }
    } else {
      count = 1
    }

    expected = index + substring.length
    index = source.indexOf(substring, expected)
  }

  return max
}
4x DQ(The MIT License)

Copyright (c) 2015 Titus Wormer <mailto:tituswormer@gmail.com>TG
?
'Software'9
 C
dB
E
Y
GZ'AS IS'
B
F
RD
D
A
7|7{xM{
  "name": "mdast-util-phrasing",
  "version": "4.1.0",
  "description": "mdast utility to check if a node is phrasing content",
  "license": "MIT",
  "keywords": [
    "unist",
    "mdast",
    "mdast=util",
    "util",
    "utility",
    "markdown",
    "phrasing"
  ],
  "repository": "syntax-tree/mdast-util-phrasing",
  "bugs": "https://github.com/syntax-tree/mdast-util-phrasing/issues",
  "funding": {
    "type": "opencollective",
    "url": "https://opencollective.com/unified"
  },
  "author": "Victor Felder <victor@draft.li> (https://draft.li)",
  "contributors": [
    "Victor Felder <victor@draft.li> (https://draft.li)",
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "sideEffects": false,
  "type": "module",
  "exports": "./index.js",
  "files": [
    "lib/",
    "index.d.ts",
    "index.js"
  ],
  "dependencies": {
    "@types/mdast": "^4.0.0",
    "unist-util-is": "^6.0.0"
  },
  "devDependencies": {
    "@types/node": "^20.0.0",
    "c8": "^9.0.0",
    "prettier": "^3.0.0",
    "remark-cli": "^11.0.0",
    "remark-preset-wooorm": "^9.0.0",
    "type-coverage": "^2.0.0",
    "typescript": "^5.0.0",
    "xo": "^0.56.0"
  },
  "scripts": {
    "prepack": "npm run build && npm run format",
    "build": "tsc --build --clean && tsc --build && type-coverage",
    "format": "remark . -qfo && prettier . -w --log-level warn && xo --fix",
    "test-api": "node --conditions development test.js",
    "test-coverage": "c8 --100 --reporter lcov npm run test-api",
    "test": "npm run build && npm run format && npm run test-coverage"
  },
  "prettier": {
    "bracketSpacing": false,
    "semi": false,
    "singleQuote": true,
    "tabWidth": 2,
    "trailingComma": "none",
    "useTabs": false
  },
  "remarkConfig": {
    "plugins": [
      "remark-preset-wooorm"
    ]
  },
  "typeCoverage": {
    "atLeast": 100,
    "detail": true,
    "ignoreCatch": true,
    "strict": true
  },
  "xo": {
    "prettier": true
  }
}
`A'?x{{
  "name": "longest-streak",
  "version": "3.1.0",
  "description": "Count the longest repeating streak of a substring",
  "li$count",
    "length",
    "longest",
    "repeating",
    "streak",
    "substring",
    "character"
  ],
  "repository": "wooorm/longest-streakA!wooorm/longest-streak&Igithub",
    "url": "https://github.com/sponsors/wooorm"
  },
  "author":<-o8main": "index.js",
  "types": "index.d.ts",
  "files": [!,'18.0.0",
    "c8": "^72}4.0.0",
    "xo": "^0.52Pmcheck-coveragetabWidth": 2,
    "useTabsf(E0(.[z ,
    "ignoreCatch": true
  }
}
Vx.# longest-streak

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]

Get the count of the longest repeating streak of `substring` in `value`.

## Contents

*   [What is this?](#what-is-this)
*   [When should I use this?](#when-should-i-use-this)
*   [Install](#install)
*   [Use](#use)
*   [API](#api)
    *   [`longestStreak(value, substring)`](#longeststreakvalue-substring)
*   [Types](#types)
*   [Compatibility](#compatibility)
*   [Security](#security)
*   [Related](#related)
*   [Contribute](#contribute)
*   [License](#license)

## What is this?

This is a tiny package that finds the count of the longest adjacent repeating
substring.

## When should I use this?

This package is rather niche.
I use it for serializing markdown ASTs (particularly fenced code and math).

You can use [`ccount`][ccount] if you need the total count of substrings
occuring in a value.

## Install

This package is [ESM only][esm].
In Node.js (version 14.14+, 16.0+), install with [npm][]:

```sh
npm install longest-streak
```

In Deno with [`esm.sh`][esmsh]:

```js
import {longestStreak} from 'https://esm.sh/longest-streak@3'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {longestStreak} from 'https://esm.sh/longest-streak@3?bundle'
</script>
```

## Use

```js
import {longestStreak} from 'longest-streak'

longestStreak('` foo `` bar `', '`') // => 2
```

## API

This package exports the identifier `longestStreak`.
There is no default export.

### `longestStreak(value, substring)`

Get the count of the longest repeating streak of `substring` in `value`.

###### Parameters

*   `value` (`string`) — content to search in
*   `substring` (`string`) — substring to look for, typically one character

###### Returns

Count of most frequent adjacent `substring`s in `value` (`number`).

## Types

This package is fully typed with [TypeScript][].
It exports no additional types.

## Compatibility

This package is at least compatible with all maintained versions of Node.js.
As of now, that is Node.js 14.14+ and 16.0+.
It also works in Deno and modern browsers.

## Security

This package is safe.

## Related

*   [`wooorm/ccount`](https://github.com/wooorm/ccount)
    — count the total number of `substring`s in `value`
*   [`wooorm/direction`](https://github.com/wooorm/direction)
    — detect directionality: left-to-right, right-to-left, or neutral

## Contribute

Yes please!
See [How to Contribute to Open Source][contribute].

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/wooorm/longest-streak/workflows/main/badge.svg

[build]: https://github.com/wooorm/longest-streak/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/longest-streak.svg

[coverage]: https://codecov.io/github/wooorm/longest-streak

[downloads-badge]: https://img.shields.io/npm/dm/longest-streak.svg

[downloads]: https://www.npmjs.com/package/longest-streak

[size-badge]: https://img.shields.io/bundlephobia/minzip/longest-streak.svg

[size]: https://bundlephobia.com/result?p=longest-streak

[npm]: https://docs.npmjs.com/cli/install

[esmsh]: https://esm.sh

[license]: license

[author]: https://wooorm.com

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[typescript]: https://www.typescriptlang.org

[contribute]: https://opensource.guide/how-to-contribute/

[ccount]: https://github.com/wooorm/ccount
ͣx 100644 index.d.ts iAk.C100644 index.d.ts.map / Z Z<YZgoЇ100644 index.js 5ۜo =ml100644 license Zbv8f,Q)100644 package.json f	&pdȟWG(100644 readme.md %57FjQi+Rz:Zֱx>/**
 * Generate a markdown
 * ([GFM](https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables))
 * table.
 *
 * @param {ReadonlyArray<ReadonlyArray<string | null | undefined>>} table
 *   Table data (matrix of strings).
 * @param {Readonly<Options> | null | undefined} [options]
 *   Configuration (optional).
 * @returns {string}
 *   Result.
 */
export function markdownTable(table: ReadonlyArray<ReadonlyArray<string | null | undefined>>, options?: Readonly<Options> | null | undefined): string;
/**
 * Configuration.
 */
export type MarkdownTableOptions = Options;
/**
 * Configuration.
 */
export type Options = {
    /**
     * Whether to align the delimiters (default: `true`);
     * they are aligned by default:
     *
     * ```markdown
     * | Alpha | B     |
     * | ----- | ----- |
     * | C     | Delta |
     * ```
     *
     * Pass `false` to make them staggered:
     *
     * ```markdown
     * | Alpha | B |
     * | - | - |
     * | C | Delta |
     * ```
     */
    alignDelimiters?: boolean | null | undefined;
    /**
     * How to align columns (default: `''`);
     * one style for all columns or styles for their respective columns;
     * each style is either `'l'` (left), `'r'` (right), or `'c'` (center);
     * other values are treated as `''`, which doesn’t place the colon in the
     * alignment row but does align left;
     * *only the lowercased first character is used, so `Right` is fine.*
     */
    align?: ReadonlyArray<string | null | undefined> | string | null | undefined;
    /**
     * Whether to end each row with the delimiter (default: `true`).
     *
     * > 👉 **Note**: please don’t use this: it could create fragile structures
     * > that aren’t understandable to some markdown parsers.
     *
     * When `true`, there are ending delimiters:
     *
     * ```markdown
     * | Alpha | B     |
     * | ----- | ----- |
     * | C     | Delta |
     * ```
     *
     * When `false`, there are no ending delimiters:
     *
     * ```markdown
     * | Alpha | B
     * | ----- | -----
     * | C     | Delta
     * ```
     */
    delimiterEnd?: boolean | null | undefined;
    /**
     * Whether to begin each row with the delimiter (default: `true`).
     *
     * > 👉 **Note**: please don’t use this: it could create fragile structures
     * > that aren’t understandable to some markdown parsers.
     *
     * When `true`, there are starting delimiters:
     *
     * ```markdown
     * | Alpha | B     |
     * | ----- | ----- |
     * | C     | Delta |
     * ```
     *
     * When `false`, there are no starting delimiters:
     *
     * ```markdown
     * Alpha | B     |
     * ----- | ----- |
     * C     | Delta |
     * ```
     */
    delimiterStart?: boolean | null | undefined;
    /**
     * Whether to add a space of padding between delimiters and cells
     * (default: `true`).
     *
     * When `true`, there is padding:
     *
     * ```markdown
     * | Alpha | B     |
     * | ----- | ----- |
     * | C     | Delta |
     * ```
     *
     * When `false`, there is no padding:
     *
     * ```markdown
     * |Alpha|B    |
     * |-----|-----|
     * |C    |Delta|
     * ```
     */
    padding?: boolean | null | undefined;
    /**
     * Function to detect the length of table cell content (optional);
     * this is used when aligning the delimiters (`|`) between table cells;
     * full-width characters and emoji mess up delimiter alignment when viewing
     * the markdown source;
     * to fix this, you can pass this function,
     * which receives the cell content and returns its “visible” size;
     * note that what is and isn’t visible depends on where the text is displayed.
     *
     * Without such a function, the following:
     *
     * ```js
     * markdownTable([
     * ['Alpha', 'Bravo'],
     * ['中文', 'Charlie'],
     * ['👩‍❤️‍👩', 'Delta']
     * ])
     * ```
     *
     * Yields:
     *
     * ```markdown
     * | Alpha | Bravo |
     * | - | - |
     * | 中文 | Charlie |
     * | 👩‍❤️‍👩 | Delta |
     * ```
     *
     * With [`string-width`](https://github.com/sindresorhus/string-width):
     *
     * ```js
     * import stringWidth from 'string-width'
     *
     * markdownTable(
     * [
     * ['Alpha', 'Bravo'],
     * ['中文', 'Charlie'],
     * ['👩‍❤️‍👩', 'Delta']
     * ],
     * {stringLength: stringWidth}
     * )
     * ```
     *
     * Yields:
     *
     * ```markdown
     * | Alpha | Bravo   |
     * | ----- | ------- |
     * | 中文  | Charlie |
     * | 👩‍❤️‍👩    | Delta   |
     * ```
     */
    stringLength?: ((value: string) => number) | null | undefined;
};
//# sourceMappingURL=index.d.ts.mapحL*xV{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AA6JA;;;;;;;;;;;GAWG;AACH,qCAPW,aAAa,CAAC,aAAa,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC,YAEvD,QAAQ,CAAC,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,GAElC,MAAM,CAsMlB;;;;mCA1WY,OAAO;;;;;;;;;;;;;;;;;;;;;;;sBAON,OAAO,GAAG,IAAI,GAAG,SAAS;;;;;;;;;YAiB1B,aAAa,CAAC,MAAM,GAAG,IAAI,GAAG,SAAS,CAAC,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;;;mBAOpE,OAAO,GAAG,IAAI,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;;;qBAqB1B,OAAO,GAAG,IAAI,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;cAqB1B,OAAO,GAAG,IAAI,GAAG,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mBAmB1B,CAAC,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC,GAAG,IAAI,GAAG,SAAS"}Hx(// To do: next major: remove.
/**
 * @typedef {Options} MarkdownTableOptions
 *   Configuration.
 */

/**
 * @typedef Options
 *   Configuration.
 * @property {boolean | null | undefined} [alignDelimiters=true]
 *   Whether to align the delimiters (default: `true`);
 *   they are aligned by default:
 *
 *   ```markdown
 *   | Alpha | B     |
 *   | ----- | ----- |
 *   | C     | Delta |
 *   ```
 *
 *   Pass `false` to make them staggered:
 *
 *   ```markdown
 *   | Alpha | B |
 *   | - | - |
 *   | C | Delta |
 *   ```
 * @property {ReadonlyArray<string | null | undefined> | string | null | undefined} [align]
 *   How to align columns (default: `''`);
 *   one style for all columns or styles for their respective columns;
 *   each style is either `'l'` (left), `'r'` (right), or `'c'` (center);
 *   other values are treated as `''`, which doesn’t place the colon in the
 *   alignment row but does align left;
 *   *only the lowercased first character is used, so `Right` is fine.*
 * @property {boolean | null | undefined} [delimiterEnd=true]
 *   Whether to end each row with the delimiter (default: `true`).
 *
 *   > 👉 **Note**: please don’t use this: it could create fragile structures
 *   > that aren’t understandable to some markdown parsers.
 *
 *   When `true`, there are ending delimiters:
 *
 *   ```markdown
 *   | Alpha | B     |
 *   | ----- | ----- |
 *   | C     | Delta |
 *   ```
 *
 *   When `false`, there are no ending delimiters:
 *
 *   ```markdown
 *   | Alpha | B
 *   | ----- | -----
 *   | C     | Delta
 *   ```
 * @property {boolean | null | undefined} [delimiterStart=true]
 *   Whether to begin each row with the delimiter (default: `true`).
 *
 *   > 👉 **Note**: please don’t use this: it could create fragile structures
 *   > that aren’t understandable to some markdown parsers.
 *
 *   When `true`, there are starting delimiters:
 *
 *   ```markdown
 *   | Alpha | B     |
 *   | ----- | ----- |
 *   | C     | Delta |
 *   ```
 *
 *   When `false`, there are no starting delimiters:
 *
 *   ```markdown
 *   Alpha | B     |
 *   ----- | ----- |
 *   C     | Delta |
 *   ```
 * @property {boolean | null | undefined} [padding=true]
 *   Whether to add a space of padding between delimiters and cells
 *   (default: `true`).
 *
 *   When `true`, there is padding:
 *
 *   ```markdown
 *   | Alpha | B     |
 *   | ----- | ----- |
 *   | C     | Delta |
 *   ```
 *
 *   When `false`, there is no padding:
 *
 *   ```markdown
 *   |Alpha|B    |
 *   |-----|-----|
 *   |C    |Delta|
 *   ```
 * @property {((value: string) => number) | null | undefined} [stringLength]
 *   Function to detect the length of table cell content (optional);
 *   this is used when aligning the delimiters (`|`) between table cells;
 *   full-width characters and emoji mess up delimiter alignment when viewing
 *   the markdown source;
 *   to fix this, you can pass this function,
 *   which receives the cell content and returns its “visible” size;
 *   note that what is and isn’t visible depends on where the text is displayed.
 *
 *   Without such a function, the following:
 *
 *   ```js
 *   markdownTable([
 *     ['Alpha', 'Bravo'],
 *     ['中文', 'Charlie'],
 *     ['👩‍❤️‍👩', 'Delta']
 *   ])
 *   ```
 *
 *   Yields:
 *
 *   ```markdown
 *   | Alpha | Bravo |
 *   | - | - |
 *   | 中文 | Charlie |
 *   | 👩‍❤️‍👩 | Delta |
 *   ```
 *
 *   With [`string-width`](https://github.com/sindresorhus/string-width):
 *
 *   ```js
 *   import stringWidth from 'string-width'
 *
 *   markdownTable(
 *     [
 *       ['Alpha', 'Bravo'],
 *       ['中文', 'Charlie'],
 *       ['👩‍❤️‍👩', 'Delta']
 *     ],
 *     {stringLength: stringWidth}
 *   )
 *   ```
 *
 *   Yields:
 *
 *   ```markdown
 *   | Alpha | Bravo   |
 *   | ----- | ------- |
 *   | 中文  | Charlie |
 *   | 👩‍❤️‍👩    | Delta   |
 *   ```
 */

/**
 * @param {string} value
 *   Cell value.
 * @returns {number}
 *   Cell size.
 */
function defaultStringLength(value) {
  return value.length
}

/**
 * Generate a markdown
 * ([GFM](https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables))
 * table.
 *
 * @param {ReadonlyArray<ReadonlyArray<string | null | undefined>>} table
 *   Table data (matrix of strings).
 * @param {Readonly<Options> | null | undefined} [options]
 *   Configuration (optional).
 * @returns {string}
 *   Result.
 */
export function markdownTable(table, options) {
  const settings = options || {}
  // To do: next major: change to spread.
  const align = (settings.align || []).concat()
  const stringLength = settings.stringLength || defaultStringLength
  /** @type {Array<number>} Character codes as symbols for alignment per column. */
  const alignments = []
  /** @type {Array<Array<string>>} Cells per row. */
  const cellMatrix = []
  /** @type {Array<Array<number>>} Sizes of each cell per row. */
  const sizeMatrix = []
  /** @type {Array<number>} */
  const longestCellByColumn = []
  let mostCellsPerRow = 0
  let rowIndex = -1

  // This is a superfluous loop if we don’t align delimiters, but otherwise we’d
  // do superfluous work when aligning, so optimize for aligning.
  while (++rowIndex < table.length) {
    /** @type {Array<string>} */
    const row = []
    /** @type {Array<number>} */
    const sizes = []
    let columnIndex = -1

    if (table[rowIndex].length > mostCellsPerRow) {
      mostCellsPerRow = table[rowIndex].length
    }

    while (++columnIndex < table[rowIndex].length) {
      const cell = serialize(table[rowIndex][columnIndex])

      if (settings.alignDelimiters !== false) {
        const size = stringLength(cell)
        sizes[columnIndex] = size

        if (
          longestCellByColumn[columnIndex] === undefined ||
          size > longestCellByColumn[columnIndex]
        ) {
          longestCellByColumn[columnIndex] = size
        }
      }

      row.push(cell)
    }

    cellMatrix[rowIndex] = row
    sizeMatrix[rowIndex] = sizes
  }

  // Figure out which alignments to use.
  let columnIndex = -1

  if (typeof align === 'object' && 'length' in align) {
    while (++columnIndex < mostCellsPerRow) {
      alignments[columnIndex] = toAlignment(align[columnIndex])
    }
  } else {
    const code = toAlignment(align)

    while (++columnIndex < mostCellsPerRow) {
      alignments[columnIndex] = code
    }
  }

  // Inject the alignment row.
  columnIndex = -1
  /** @type {Array<string>} */
  const row = []
  /** @type {Array<number>} */
  const sizes = []

  while (++columnIndex < mostCellsPerRow) {
    const code = alignments[columnIndex]
    let before = ''
    let after = ''

    if (code === 99 /* `c` */) {
      before = ':'
      after = ':'
    } else if (code === 108 /* `l` */) {
      before = ':'
    } else if (code === 114 /* `r` */) {
      after = ':'
    }

    // There *must* be at least one hyphen-minus in each alignment cell.
    let size =
      settings.alignDelimiters === false
        ? 1
        : Math.max(
            1,
            longestCellByColumn[columnIndex] - before.length - after.length
          )

    const cell = before + '-'.repeat(size) + after

    if (settings.alignDelimiters !== false) {
      size = before.length + size + after.length

      if (size > longestCellByColumn[columnIndex]) {
        longestCellByColumn[columnIndex] = size
      }

      sizes[columnIndex] = size
    }

    row[columnIndex] = cell
  }

  // Inject the alignment row.
  cellMatrix.splice(1, 0, row)
  sizeMatrix.splice(1, 0, sizes)

  rowIndex = -1
  /** @type {Array<string>} */
  const lines = []

  while (++rowIndex < cellMatrix.length) {
    const row = cellMatrix[rowIndex]
    const sizes = sizeMatrix[rowIndex]
    columnIndex = -1
    /** @type {Array<string>} */
    const line = []

    while (++columnIndex < mostCellsPerRow) {
      const cell = row[columnIndex] || ''
      let before = ''
      let after = ''

      if (settings.alignDelimiters !== false) {
        const size =
          longestCellByColumn[columnIndex] - (sizes[columnIndex] || 0)
        const code = alignments[columnIndex]

        if (code === 114 /* `r` */) {
          before = ' '.repeat(size)
        } else if (code === 99 /* `c` */) {
          if (size % 2) {
            before = ' '.repeat(size / 2 + 0.5)
            after = ' '.repeat(size / 2 - 0.5)
          } else {
            before = ' '.repeat(size / 2)
            after = before
          }
        } else {
          after = ' '.repeat(size)
        }
      }

      if (settings.delimiterStart !== false && !columnIndex) {
        line.push('|')
      }

      if (
        settings.padding !== false &&
        // Don’t add the opening space if we’re not aligning and the cell is
        // empty: there will be a closing space.
        !(settings.alignDelimiters === false && cell === '') &&
        (settings.delimiterStart !== false || columnIndex)
      ) {
        line.push(' ')
      }

      if (settings.alignDelimiters !== false) {
        line.push(before)
      }

      line.push(cell)

      if (settings.alignDelimiters !== false) {
        line.push(after)
      }

      if (settings.padding !== false) {
        line.push(' ')
      }

      if (
        settings.delimiterEnd !== false ||
        columnIndex !== mostCellsPerRow - 1
      ) {
        line.push('|')
      }
    }

    lines.push(
      settings.delimiterEnd === false
        ? line.join('').replace(/ +$/, '')
        : line.join('')
    )
  }

  return lines.join('\n')
}

/**
 * @param {string | null | undefined} [value]
 *   Value to serialize.
 * @returns {string}
 *   Result.
 */
function serialize(value) {
  return value === null || value === undefined ? '' : String(value)
}

/**
 * @param {string | null | undefined} value
 *   Value.
 * @returns {number}
 *   Alignment.
 */
function toAlignment(value) {
  const code = typeof value === 'string' ? value.codePointAt(0) : 0

  return code === 67 /* `C` */ || code === 99 /* `c` */
    ? 99 /* `c` */
    : code === 76 /* `L` */ || code === 108 /* `l` */
      ? 108 /* `l` */
      : code === 82 /* `R` */ || code === 114 /* `r` */
        ? 114 /* `r` */
        : 0
}
bQ3Jx1{
  "author":<B wooorm/markdown-table/issues,C/description": "Generate a markdown (GFM) table"/-2.0.0",
    "c8": "^10.0.0",
    "chalk": "^562%10.0.0",
    "strip-ansi": "^7<Q*9.0"
  },
  "files": [
    "index.d.ts.map,github",
    "url": "https://github.com/sponsors/wooorm"
  },
  "keywords": [
    "align",
    "markdown",
    "rows",
    "tab"le",
    "tabular",
    "text"
  ]-main": "index.js",
  "name": "markdown-table".4repository": "wooorm/markdown-table",
  "scripts": {[G--frail --output --quiet -- . && prettier --log-level warn --write -- .Zi!check-coverage --reporter lcov --c':z>types": "index.d.ts",
  "type": "module",
  "version": "3.0.4" ],
    "rules": {
      "complexity": "off",
      "unicorn/prefer-switch": "off"
    }
  }
}
a]Űx?# markdown-table

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]

Generate a markdown ([GFM][]) table.

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`markdownTable(table[, options])`](#markdowntabletable-options)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Inspiration](#inspiration)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This is a simple package that takes table data and generates a [GitHub flavored
markdown (GFM)][gfm] table.

## When should I use this?

You can use this package when you want to generate the source code of a GFM
table from some data.

This is a simple solution in that it doesn’t handle escapes or HTML or any of
that.
For a complete but heavier solution, build an AST and serialize it with
[`mdast-util-to-markdown`][mdast-util-to-markdown] (with
[`mdast-util-gfm`][mdast-util-gfm]).

## Install

This package is [ESM only][esm].
In Node.js (version 14.14+, 16.0+), install with [npm][]:

```sh
npm install markdown-table
```

In Deno with [`esm.sh`][esmsh]:

```js
import {markdownTable} from 'https://esm.sh/markdown-table@3'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {markdownTable} from 'https://esm.sh/markdown-table@3?bundle'
</script>
```

## Use

Typical usage (defaults to align left):

```js
import {markdownTable} from 'markdown-table'

markdownTable([
  ['Branch', 'Commit'],
  ['main', '0123456789abcdef'],
  ['staging', 'fedcba9876543210']
])
```

Yields:

```markdown
| Branch  | Commit           |
| ------- | ---------------- |
| main    | 0123456789abcdef |
| staging | fedcba9876543210 |
```

With align:

```js
markdownTable(
  [
    ['Beep', 'No.', 'Boop'],
    ['beep', '1024', 'xyz'],
    ['boop', '3388450', 'tuv'],
    ['foo', '10106', 'qrstuv'],
    ['bar', '45', 'lmno']
  ],
  {align: ['l', 'c', 'r']}
)
```

Yields:

```markdown
| Beep |   No.   |   Boop |
| :--- | :-----: | -----: |
| beep |   1024  |    xyz |
| boop | 3388450 |    tuv |
| foo  |  10106  | qrstuv |
| bar  |    45   |   lmno |
```

## API

This package exports the identifier `markdownTable`.
There is no default export.

### `markdownTable(table[, options])`

Generate a markdown table from table data (matrix of strings).

##### `options`

Configuration (optional).

###### `options.align`

One style for all columns, or styles for their respective columns (`string` or
`Array<string>`).
Each style is either `'l'` (left), `'r'` (right), or `'c'` (center).
Other values are treated as `''`, which doesn’t place the colon in the alignment
row but does align left.
*Only the lowercased first character is used, so `Right` is fine.*

###### `options.padding`

Whether to add a space of padding between delimiters and cells (`boolean`,
default: `true`).

When `true`, there is padding:

```markdown
| Alpha | B     |
| ----- | ----- |
| C     | Delta |
```

When `false`, there is no padding:

```markdown
|Alpha|B    |
|-----|-----|
|C    |Delta|
```

###### `options.delimiterStart`

Whether to begin each row with the delimiter (`boolean`, default: `true`).

> 👉 **Note**: please don’t use this: it could create fragile structures that
> aren’t understandable to some markdown parsers.

When `true`, there are starting delimiters:

```markdown
| Alpha | B     |
| ----- | ----- |
| C     | Delta |
```

When `false`, there are no starting delimiters:

```markdown
Alpha | B     |
----- | ----- |
C     | Delta |
```

###### `options.delimiterEnd`

Whether to end each row with the delimiter (`boolean`, default: `true`).

> 👉 **Note**: please don’t use this: it could create fragile structures that
> aren’t understandable to some markdown parsers.

When `true`, there are ending delimiters:

```markdown
| Alpha | B     |
| ----- | ----- |
| C     | Delta |
```

When `false`, there are no ending delimiters:

```markdown
| Alpha | B
| ----- | -----
| C     | Delta
```

###### `options.alignDelimiters`

Whether to align the delimiters (`boolean`, default: `true`).
By default, they are aligned:

```markdown
| Alpha | B     |
| ----- | ----- |
| C     | Delta |
```

Pass `false` to make them staggered:

```markdown
| Alpha | B |
| - | - |
| C | Delta |
```

###### `options.stringLength`

Function to detect the length of table cell content (`Function`, default:
`s => s.length`).
This is used when aligning the delimiters (`|`) between table cells.
Full-width characters and emoji mess up delimiter alignment when viewing the
markdown source.
To fix this, you can pass this function, which receives the cell content and
returns its “visible” size.
Note that what is and isn’t visible depends on where the text is displayed.

Without such a function, the following:

```js
markdownTable([
  ['Alpha', 'Bravo'],
  ['中文', 'Charlie'],
  ['👩‍❤️‍👩', 'Delta']
])
```

Yields:

```markdown
| Alpha | Bravo |
| - | - |
| 中文 | Charlie |
| 👩‍❤️‍👩 | Delta |
```

With [`string-width`][string-width]:

```js
import stringWidth from 'string-width'

markdownTable(
  [
    ['Alpha', 'Bravo'],
    ['中文', 'Charlie'],
    ['👩‍❤️‍👩', 'Delta']
  ],
  {stringLength: stringWidth}
)
```

Yields:

```markdown
| Alpha | Bravo   |
| ----- | ------- |
| 中文  | Charlie |
| 👩‍❤️‍👩    | Delta   |
```

## Types

This package is fully typed with [TypeScript][].
It exports the additional type `Options`.

## Compatibility

This package is at least compatible with all maintained versions of Node.js.
As of now, that is Node.js 14.14+ and 16.0+.
It also works in Deno and modern browsers.

## Security

This package is safe.

## Inspiration

The original idea and basic implementation was inspired by James Halliday’s
[`text-table`][text-table] library.

## Contribute

Yes please!
See [How to Contribute to Open Source][contribute].

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/wooorm/markdown-table/workflows/main/badge.svg

[build]: https://github.com/wooorm/markdown-table/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/markdown-table.svg

[coverage]: https://codecov.io/github/wooorm/markdown-table

[downloads-badge]: https://img.shields.io/npm/dm/markdown-table.svg

[downloads]: https://www.npmjs.com/package/markdown-table

[size-badge]: https://img.shields.io/bundlephobia/minzip/markdown-table.svg

[size]: https://bundlephobia.com/result?p=markdown-table

[npm]: https://docs.npmjs.com/cli/install

[esmsh]: https://esm.sh

[license]: license

[author]: https://wooorm.com

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[typescript]: https://www.typescriptlang.org

[contribute]: https://opensource.guide/how-to-contribute/

[gfm]: https://docs.github.com/en/github/writing-on-github/working-with-advanced-formatting/organizing-information-with-tables

[text-table]: https://github.com/substack/text-table

[string-width]: https://github.com/sindresorhus/string-width

[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown

[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm
BΩx)100644 index.d.ts %D2rCLǂT=100644 index.d.ts.map ks@J9%W~ˡ100644 index.js bs!a[[#340000 lib ^ýTP*-100644 license Zbv8f,Q)40000 node_modules nZnCY`. 100644 package.json 	P']&W.?Z(100644 readme.md EYG)6.HA q۸"x(export { findAndReplace } from "./lib/index.js";
export type FindAndReplaceList = import("./lib/index.js").FindAndReplaceList;
export type FindAndReplaceTuple = import("./lib/index.js").FindAndReplaceTuple;
export type Find = import("./lib/index.js").Find;
export type Options = import("./lib/index.js").Options;
export type RegExpMatchObject = import("./lib/index.js").RegExpMatchObject;
export type ReplaceFunction = import("./lib/index.js").ReplaceFunction;
export type Replace = import("./lib/index.js").Replace;
//# sourceMappingURL=index.d.ts.map۶ͱx1{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":";iCACa,OAAO,gBAAgB,EAAE,kBAAkB;kCAC3C,OAAO,gBAAgB,EAAE,mBAAmB;mBAC5C,OAAO,gBAAgB,EAAE,IAAI;sBAC7B,OAAO,gBAAgB,EAAE,OAAO;gCAChC,OAAO,gBAAgB,EAAE,iBAAiB;8BAC1C,OAAO,gBAAgB,EAAE,eAAe;sBACxC,OAAO,gBAAgB,EAAE,OAAO"}X& x/**
 * @typedef {import('./lib/index.js').FindAndReplaceList} FindAndReplaceList
 * @typedef {import('./lib/index.js').FindAndReplaceTuple} FindAndReplaceTuple
 * @typedef {import('./lib/index.js').Find} Find
 * @typedef {import('./lib/index.js').Options} Options
 * @typedef {import('./lib/index.js').RegExpMatchObject} RegExpMatchObject
 * @typedef {import('./lib/index.js').ReplaceFunction} ReplaceFunction
 * @typedef {import('./lib/index.js').Replace} Replace
 */

export {findAndReplace} from './lib/index.js'
xt 100644 index.d.ts :`sӿK)G100644 index.d.ts.map q?IZgm/+npG100644 index.js `	'U^<.ixn/**
 * Find patterns in a tree and replace them.
 *
 * The algorithm searches the tree in *preorder* for complete values in `Text`
 * nodes.
 * Partial matches are not supported.
 *
 * @param {Nodes} tree
 *   Tree to change.
 * @param {FindAndReplaceList | FindAndReplaceTuple} list
 *   Patterns to find.
 * @param {Options | null | undefined} [options]
 *   Configuration (when `find` is not `Find`).
 * @returns {undefined}
 *   Nothing.
 */
export function findAndReplace(tree: Nodes, list: FindAndReplaceList | FindAndReplaceTuple, options?: Options | null | undefined): undefined;
/**
 * Info on the match.
 */
export type RegExpMatchObject = {
    /**
     *   The index of the search at which the result was found.
     */
    index: number;
    /**
     *   A copy of the search string in the text node.
     */
    input: string;
    /**
     *   All ancestors of the text node, where the last node is the text itself.
     */
    stack: [...Array<Parents>, Text];
};
/**
 * Pattern to find.
 *
 * Strings are escaped and then turned into global expressions.
 */
export type Find = RegExp | string;
/**
 * Several find and replaces, in array form.
 */
export type FindAndReplaceList = Array<FindAndReplaceTuple>;
/**
 * Find and replace in tuple form.
 */
export type FindAndReplaceTuple = [Find, Replace?];
/**
 * Thing to replace with.
 */
export type Replace = ReplaceFunction | string | null | undefined;
/**
 * Callback called when a search matches.
 */
export type ReplaceFunction = (...parameters: any[]) => Array<PhrasingContent> | PhrasingContent | string | false | null | undefined;
/**
 * Normalized find and replace.
 */
export type Pair = [RegExp, ReplaceFunction];
/**
 * All find and replaced.
 */
export type Pairs = Array<Pair>;
/**
 * Configuration.
 */
export type Options = {
    /**
     * Test for which nodes to ignore (optional).
     */
    ignore?: Test | null | undefined;
};
import type { Nodes } from 'mdast';
import type { Parents } from 'mdast';
import type { Text } from 'mdast';
import type { PhrasingContent } from 'mdast';
import type { Test } from 'unist-util-visit-parents';
//# sourceMappingURL=index.d.ts.maprv+xG{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AA6DA;;;;;;;;;;;;;;;GAeG;AACH,qCATW,KAAK,QAEL,kBAAkB,GAAG,mBAAmB,YAExC,OAAO,GAAG,IAAI,GAAG,SAAS,GAExB,SAAS,CA6HrB;;;;;;;;WA/La,MAAM;;;;WAEN,MAAM;;;;WAEN,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC;;;;;;;mBAG1B,MAAM,GAAG,MAAM;;;;iCAKf,KAAK,CAAC,mBAAmB,CAAC;;;;kCAG1B,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;;;;sBAGhB,eAAe,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS;;;;8CAK1C,GAAG,EAAA,KAMJ,KAAK,CAAC,eAAe,CAAC,GAAG,eAAe,GAAG,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS;;;;mBAQ5E,CAAC,MAAM,EAAE,eAAe,CAAC;;;;oBAGzB,KAAK,CAAC,IAAI,CAAC;;;;;;;;aAKV,IAAI,GAAG,IAAI,GAAG,SAAS;;2BApDyB,OAAO;6BAAP,OAAO;0BAAP,OAAO;qCAAP,OAAO;0BACjB,0BAA0B"}Fx$/**
 * @import {Nodes, Parents, PhrasingContent, Root, Text} from 'mdast'
 * @import {BuildVisitor, Test, VisitorResult} from 'unist-util-visit-parents'
 */

/**
 * @typedef RegExpMatchObject
 *   Info on the match.
 * @property {number} index
 *   The index of the search at which the result was found.
 * @property {string} input
 *   A copy of the search string in the text node.
 * @property {[...Array<Parents>, Text]} stack
 *   All ancestors of the text node, where the last node is the text itself.
 *
 * @typedef {RegExp | string} Find
 *   Pattern to find.
 *
 *   Strings are escaped and then turned into global expressions.
 *
 * @typedef {Array<FindAndReplaceTuple>} FindAndReplaceList
 *   Several find and replaces, in array form.
 *
 * @typedef {[Find, Replace?]} FindAndReplaceTuple
 *   Find and replace in tuple form.
 *
 * @typedef {ReplaceFunction | string | null | undefined} Replace
 *   Thing to replace with.
 *
 * @callback ReplaceFunction
 *   Callback called when a search matches.
 * @param {...any} parameters
 *   The parameters are the result of corresponding search expression:
 *
 *   * `value` (`string`) — whole match
 *   * `...capture` (`Array<string>`) — matches from regex capture groups
 *   * `match` (`RegExpMatchObject`) — info on the match
 * @returns {Array<PhrasingContent> | PhrasingContent | string | false | null | undefined}
 *   Thing to replace with.
 *
 *   * when `null`, `undefined`, `''`, remove the match
 *   * …or when `false`, do not replace at all
 *   * …or when `string`, replace with a text node of that value
 *   * …or when `Node` or `Array<Node>`, replace with those nodes
 *
 * @typedef {[RegExp, ReplaceFunction]} Pair
 *   Normalized find and replace.
 *
 * @typedef {Array<Pair>} Pairs
 *   All find and replaced.
 *
 * @typedef Options
 *   Configuration.
 * @property {Test | null | undefined} [ignore]
 *   Test for which nodes to ignore (optional).
 */

import escape from 'escape-string-regexp'
import {visitParents} from 'unist-util-visit-parents'
import {convert} from 'unist-util-is'

/**
 * Find patterns in a tree and replace them.
 *
 * The algorithm searches the tree in *preorder* for complete values in `Text`
 * nodes.
 * Partial matches are not supported.
 *
 * @param {Nodes} tree
 *   Tree to change.
 * @param {FindAndReplaceList | FindAndReplaceTuple} list
 *   Patterns to find.
 * @param {Options | null | undefined} [options]
 *   Configuration (when `find` is not `Find`).
 * @returns {undefined}
 *   Nothing.
 */
export function findAndReplace(tree, list, options) {
  const settings = options || {}
  const ignored = convert(settings.ignore || [])
  const pairs = toPairs(list)
  let pairIndex = -1

  while (++pairIndex < pairs.length) {
    visitParents(tree, 'text', visitor)
  }

  /** @type {BuildVisitor<Root, 'text'>} */
  function visitor(node, parents) {
    let index = -1
    /** @type {Parents | undefined} */
    let grandparent

    while (++index < parents.length) {
      const parent = parents[index]
      /** @type {Array<Nodes> | undefined} */
      const siblings = grandparent ? grandparent.children : undefined

      if (
        ignored(
          parent,
          siblings ? siblings.indexOf(parent) : undefined,
          grandparent
        )
      ) {
        return
      }

      grandparent = parent
    }

    if (grandparent) {
      return handler(node, parents)
    }
  }

  /**
   * Handle a text node which is not in an ignored parent.
   *
   * @param {Text} node
   *   Text node.
   * @param {Array<Parents>} parents
   *   Parents.
   * @returns {VisitorResult}
   *   Result.
   */
  function handler(node, parents) {
    const parent = parents[parents.length - 1]
    const find = pairs[pairIndex][0]
    const replace = pairs[pairIndex][1]
    let start = 0
    /** @type {Array<Nodes>} */
    const siblings = parent.children
    const index = siblings.indexOf(node)
    let change = false
    /** @type {Array<PhrasingContent>} */
    let nodes = []

    find.lastIndex = 0

    let match = find.exec(node.value)

    while (match) {
      const position = match.index
      /** @type {RegExpMatchObject} */
      const matchObject = {
        index: match.index,
        input: match.input,
        stack: [...parents, node]
      }
      let value = replace(...match, matchObject)

      if (typeof value === 'string') {
        value = value.length > 0 ? {type: 'text', value} : undefined
      }

      // It wasn’t a match after all.
      if (value === false) {
        // False acts as if there was no match.
        // So we need to reset `lastIndex`, which currently being at the end of
        // the current match, to the beginning.
        find.lastIndex = position + 1
      } else {
        if (start !== position) {
          nodes.push({
            type: 'text',
            value: node.value.slice(start, position)
          })
        }

        if (Array.isArray(value)) {
          nodes.push(...value)
        } else if (value) {
          nodes.push(value)
        }

        start = position + match[0].length
        change = true
      }

      if (!find.global) {
        break
      }

      match = find.exec(node.value)
    }

    if (change) {
      if (start < node.value.length) {
        nodes.push({type: 'text', value: node.value.slice(start)})
      }

      parent.children.splice(index, 1, ...nodes)
    } else {
      nodes = [node]
    }

    return index + nodes.length
  }
}

/**
 * Turn a tuple or a list of tuples into pairs.
 *
 * @param {FindAndReplaceList | FindAndReplaceTuple} tupleOrList
 *   Schema.
 * @returns {Pairs}
 *   Clean pairs.
 */
function toPairs(tupleOrList) {
  /** @type {Pairs} */
  const result = []

  if (!Array.isArray(tupleOrList)) {
    throw new TypeError('Expected find and replace tuple or list of tuples')
  }

  /** @type {FindAndReplaceList} */
  // @ts-expect-error: correct.
  const list =
    !tupleOrList[0] || Array.isArray(tupleOrList[0])
      ? tupleOrList
      : [tupleOrList]

  let index = -1

  while (++index < list.length) {
    const tuple = list[index]
    result.push([toExpression(tuple[0]), toFunction(tuple[1])])
  }

  return result
}

/**
 * Turn a find into an expression.
 *
 * @param {Find} find
 *   Find.
 * @returns {RegExp}
 *   Expression.
 */
function toExpression(find) {
  return typeof find === 'string' ? new RegExp(escape(find), 'g') : find
}

/**
 * Turn a replace into a function.
 *
 * @param {Replace} replace
 *   Replace.
 * @returns {ReplaceFunction}
 *   Function.
 */
function toFunction(replace) {
  return typeof replace === 'function'
    ? replace
    : function () {
        return replace
      }
}
Ecx/ 40000 escape-string-regexp nFeplkx E100644 index.d.ts (L<6IJXk"100644 index.js 2?F
7h100644 license |JW?z100644 package.json "Jn{	Iy100644 readme.md *geM7{O$xj from 'escape-string-regexp'Dexport default function escapeStringRegexp(string: string): string;
͠)-x#{
	"name": "escape-string-regexp",
	"version": "5.0.0",
	"description": "Escape RegExp special characters",
	"license": "MIT",
	"repository": "sindresorhus/escape-string-regexp",
	"funding": "https://github.com/sponsors/sindresorhus",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "https://sindresorhus.com"
	},
	"type": "module",
	"exports": "./index.js",
	"engines": {
		"node": ">=12"
	},
	"scripts": {
		"test": "xo && ava && tsd"
	},
	"files": [
		"index.js",
		"index.d.ts"
	],
	"keywords": [
		"escape",
		"regex",
		"regexp",
		"regular",
		"expression",
		"string",
		"special",
		"characters"
	],
	"devDependencies": {
		"ava": "^3.15.0",
		"tsd": "^0.14.0",
		"xo": "^0.38.2"
	}
}
өx4 n import escapeStringRegexp from ''Tk/Vxi%syntax-tree/mdast-util-find-and-repla~@types/mdast": "^4.0.0",
    "escape-string-regexp": "^5.0.0",
    "unist-util-is": "^6.0.0",
    "unist-util-visit-parents": "O^6.0.0"
  },
  "description": "mdast utility to find and replace text in a treeb02r;unist-builder": "^4A&0.60.0"
  },
  "exports": "./index.js"`Bjs",
    "lib/#opencollectiveopencollective.com/unified"
  },
  "keywords": [
    "find",
    "markdown",
    "mdast-util",
    "mdast",
    "unist",
    "u`tility",
    "util",
    "replace"
  ],
  "license": "MIT",
  "name": "mdast-util-find-and-repla%syntax-tree/mdast-util-find-and-replaG>Files": [
      "lib/index.d.ts"
    ],
    "strict": true
  }x$3.0.2Hat": "off"
    }
  }
}
xux)$# mdast-util-find-and-replace

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

[mdast][] utility to find and replace things.

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`findAndReplace(tree, list[, options])`](#findandreplacetree-list-options)
  * [`Find`](#find)
  * [`FindAndReplaceList`](#findandreplacelist)
  * [`FindAndReplaceTuple`](#findandreplacetuple)
  * [`Options`](#options)
  * [`RegExpMatchObject`](#regexpmatchobject)
  * [`Replace`](#replace)
  * [`ReplaceFunction`](#replacefunction)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package is a utility that lets you find patterns (`string`, `RegExp`) in
text and replace them with nodes.

## When should I use this?

This utility is typically useful when you have regexes and want to modify mdast.
One example is when you have some form of “mentions” (such as
`/@([a-z][_a-z0-9])\b/gi`) and want to create links to persons from them.

A similar package, [`hast-util-find-and-replace`][hast-util-find-and-replace]
does the same but on [hast][].

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install mdast-util-find-and-replace
```

In Deno with [`esm.sh`][esmsh]:

```js
import {findAndReplace} from 'https://esm.sh/mdast-util-find-and-replace@3'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {findAndReplace} from 'https://esm.sh/mdast-util-find-and-replace@3?bundle'
</script>
```

## Use

```js
import {findAndReplace} from 'mdast-util-find-and-replace'
import {u} from 'unist-builder'
import {inspect} from 'unist-util-inspect'

const tree = u('paragraph', [
  u('text', 'Some '),
  u('emphasis', [u('text', 'emphasis')]),
  u('text', ' and '),
  u('strong', [u('text', 'importance')]),
  u('text', '.')
])

findAndReplace(tree, [
  [/and/gi, 'or'],
  [/emphasis/gi, 'em'],
  [/importance/gi, 'strong'],
  [
    /Some/g,
    function ($0) {
      return u('link', {url: '//example.com#' + $0}, [u('text', $0)])
    }
  ]
])

console.log(inspect(tree))
```

Yields:

```txt
paragraph[8]
├─0 link[1]
│   │ url: "//example.com#Some"
│   └─0 text "Some"
├─1 text " "
├─2 emphasis[1]
│   └─0 text "em"
├─3 text " "
├─4 text "or"
├─5 text " "
├─6 strong[1]
│   └─0 text "strong"
└─7 text "."
```

## API

This package exports the identifier [`findAndReplace`][api-find-and-replace].
There is no default export.

### `findAndReplace(tree, list[, options])`

Find patterns in a tree and replace them.

The algorithm searches the tree in *[preorder][]* for complete values in
[`Text`][text] nodes.
Partial matches are not supported.

###### Parameters

* `tree` ([`Node`][node])
  — tree to change
* `list` ([`FindAndReplaceList`][api-find-and-replace-list] or
  [`FindAndReplaceTuple`][api-find-and-replace-tuple])
  — one or more find-and-replace pairs
* `options` ([`Options`][api-options])
  — configuration

###### Returns

Nothing (`undefined`).

### `Find`

Pattern to find (TypeScript type).

Strings are escaped and then turned into global expressions.

###### Type

```ts
type Find = RegExp | string
```

### `FindAndReplaceList`

Several find and replaces, in array form (TypeScript type).

###### Type

```ts
type FindAndReplaceList = Array<FindAndReplaceTuple>
```

See [`FindAndReplaceTuple`][api-find-and-replace-tuple].

### `FindAndReplaceTuple`

Find and replace in tuple form (TypeScript type).

###### Type

```ts
type FindAndReplaceTuple = [Find, Replace?]
```

See [`Find`][api-find] and [`Replace`][api-replace].

### `Options`

Configuration (TypeScript type).

###### Fields

* `ignore` ([`Test`][test], optional)
  — test for which elements to ignore

### `RegExpMatchObject`

Info on the match (TypeScript type).

###### Fields

* `index` (`number`)
  — the index of the search at which the result was found
* `input` (`string`)
  — a copy of the search string in the text node
* `stack` ([`Array<Node>`][node])
  — all ancestors of the text node, where the last node is the text itself

### `Replace`

Thing to replace with (TypeScript type).

###### Type

```ts
type Replace = ReplaceFunction | string
```

See [`ReplaceFunction`][api-replace-function].

### `ReplaceFunction`

Callback called when a search matches (TypeScript type).

###### Parameters

The parameters are the result of corresponding search expression:

* `value` (`string`)
  — whole match
* `...capture` (`Array<string>`)
  — matches from regex capture groups
* `match` ([`RegExpMatchObject`][api-regexp-match-object])
  — info on the match

###### Returns

Thing to replace with:

* when `null`, `undefined`, `''`, remove the match
* …or when `false`, do not replace at all
* …or when `string`, replace with a text node of that value
* …or when `Node` or `Array<Node>`, replace with those nodes

## Types

This package is fully typed with [TypeScript][].
It exports the additional types [`Find`][api-find],
[`FindAndReplaceList`][api-find-and-replace-list],
[`FindAndReplaceTuple`][api-find-and-replace-tuple],
[`Options`][api-options],
[`RegExpMatchObject`][api-regexp-match-object],
[`Replace`][api-replace], and
[`ReplaceFunction`][api-replace-function].

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`mdast-util-find-and-replace@^3`, compatible with Node.js 16.

## Security

Use of `mdast-util-find-and-replace` does not involve [hast][] or user content
so there are no openings for [cross-site scripting (XSS)][xss] attacks.

## Related

* [`hast-util-find-and-replace`](https://github.com/syntax-tree/hast-util-find-and-replace)
  — find and replace in hast
* [`hast-util-select`](https://github.com/syntax-tree/hast-util-select)
  — `querySelector`, `querySelectorAll`, and `matches`
* [`unist-util-select`](https://github.com/syntax-tree/unist-util-select)
  — select unist nodes with CSS-like selectors

## Contribute

See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for
ways to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definition -->

[build-badge]: https://github.com/syntax-tree/mdast-util-find-and-replace/workflows/main/badge.svg

[build]: https://github.com/syntax-tree/mdast-util-find-and-replace/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-find-and-replace.svg

[coverage]: https://codecov.io/github/syntax-tree/mdast-util-find-and-replace

[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-find-and-replace.svg

[downloads]: https://www.npmjs.com/package/mdast-util-find-and-replace

[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-find-and-replace

[size]: https://bundlejs.com/?q=mdast-util-find-and-replace

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[collective]: https://opencollective.com/unified

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/syntax-tree/unist/discussions

[npm]: https://docs.npmjs.com/cli/install

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[typescript]: https://www.typescriptlang.org

[license]: license

[author]: https://wooorm.com

[health]: https://github.com/syntax-tree/.github

[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md

[support]: https://github.com/syntax-tree/.github/blob/main/support.md

[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md

[hast]: https://github.com/syntax-tree/hast

[mdast]: https://github.com/syntax-tree/mdast

[node]: https://github.com/syntax-tree/mdast#nodes

[preorder]: https://github.com/syntax-tree/unist#preorder

[text]: https://github.com/syntax-tree/mdast#text

[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting

[test]: https://github.com/syntax-tree/unist-util-is#api

[hast-util-find-and-replace]: https://github.com/syntax-tree/hast-util-find-and-replace

[api-find-and-replace]: #findandreplacetree-list-options

[api-options]: #options

[api-find]: #find

[api-replace]: #replace

[api-replace-function]: #replacefunction

[api-find-and-replace-list]: #findandreplacelist

[api-find-and-replace-tuple]: #findandreplacetuple

[api-regexp-match-object]: #regexpmatchobject
Pưx 	40000 dev '֊"#GKh100644 index.d.ts *~*~h.]YGº100644 index.js l[G=#igB40000 lib "c 3r(100644 license Zbv8f,Q)100644 package.json )j}E{u*ON100644 readme.md H#0.M>	9lL]axh 100644 index.d.ts *~*~h.]YGº100644 index.js ؼ4aIUCqW[P40000 lib IU#	l: dzW_u(Kxaexport type {Encoding, Token, Value} from 'micromark-util-types'
export type {
  CompileContext,
  CompileData,
  Extension,
  Handles,
  Handle,
  OnEnterError,
  OnExitError,
  Options,
  Transform
} from './lib/types.js'
export {fromMarkdown} from './lib/index.js'

declare module 'micromark-util-types' {
  interface TokenTypeMap {
    listItem: 'listItem'
  }

  interface Token {
    _spread?: boolean
  }
}
ފxW // Note: types exported from `index.d.ts`.
export {fromMarkdown} from './lib/index.js'
Px A100644 index.d.ts 0?Pl\6100644 index.d.ts.map 3¢#`#TS|100644 index.js QL/}	100644 types.d.ts qav7ʰȓg2P100644 types.js r!f?W .Zf(IEdx@/**
 * Turn markdown into a syntax tree.
 *
 * @overload
 * @param {Value} value
 * @param {Encoding | null | undefined} [encoding]
 * @param {Options | null | undefined} [options]
 * @returns {Root}
 *
 * @overload
 * @param {Value} value
 * @param {Options | null | undefined} [options]
 * @returns {Root}
 *
 * @param {Value} value
 *   Markdown to parse.
 * @param {Encoding | Options | null | undefined} [encoding]
 *   Character encoding for when `value` is `Buffer`.
 * @param {Options | null | undefined} [options]
 *   Configuration.
 * @returns {Root}
 *   mdast tree.
 */
export function fromMarkdown(value: Value, encoding?: Encoding | null | undefined, options?: Options | null | undefined): Root;
/**
 * Turn markdown into a syntax tree.
 *
 * @overload
 * @param {Value} value
 * @param {Encoding | null | undefined} [encoding]
 * @param {Options | null | undefined} [options]
 * @returns {Root}
 *
 * @overload
 * @param {Value} value
 * @param {Options | null | undefined} [options]
 * @returns {Root}
 *
 * @param {Value} value
 *   Markdown to parse.
 * @param {Encoding | Options | null | undefined} [encoding]
 *   Character encoding for when `value` is `Buffer`.
 * @param {Options | null | undefined} [options]
 *   Configuration.
 * @returns {Root}
 *   mdast tree.
 */
export function fromMarkdown(value: Value, options?: Options | null | undefined): Root;
import type { Value } from 'micromark-util-types';
import type { Encoding } from 'micromark-util-types';
import type { Options } from './types.js';
import type { Root } from 'mdast';
//# sourceMappingURL=index.d.ts.mapxi#dx^{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAwDG,oCACQ,KAAK,aACL,QAAQ,GAAG,IAAI,GAAG,SAAS,YAC3B,OAAO,GAAG,IAAI,GAAG,SAAS,GACxB,IAAI,CAEd;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oCACQ,KAAK,YACL,OAAO,GAAG,IAAI,GAAG,SAAS,GACxB,IAAI,CAEd;2BAvCO,sBAAsB;8BAAtB,sBAAsB;6BAUtB,YAAY;0BAhBZ,OAAO"}Ea}xD}/**
 * @import {
 *   Break,
 *   Blockquote,
 *   Code,
 *   Definition,
 *   Emphasis,
 *   Heading,
 *   Html,
 *   Image,
 *   InlineCode,
 *   Link,
 *   ListItem,
 *   List,
 *   Nodes,
 *   Paragraph,
 *   PhrasingContent,
 *   ReferenceType,
 *   Root,
 *   Strong,
 *   Text,
 *   ThematicBreak
 * } from 'mdast'
 * @import {
 *   Encoding,
 *   Event,
 *   Token,
 *   Value
 * } from 'micromark-util-types'
 * @import {Point} from 'unist'
 * @import {
 *   CompileContext,
 *   CompileData,
 *   Config,
 *   Extension,
 *   Handle,
 *   OnEnterError,
 *   Options
 * } from './types.js'
 */

import {ok as assert} from 'devlop'
import {toString} from 'mdast-util-to-string'
import {parse, postprocess, preprocess} from 'micromark'
import {decodeNumericCharacterReference} from 'micromark-util-decode-numeric-character-reference'
import {decodeString} from 'micromark-util-decode-string'
import {normalizeIdentifier} from 'micromark-util-normalize-identifier'
import {codes, constants, types} from 'micromark-util-symbol'
import {decodeNamedCharacterReference} from 'decode-named-character-reference'
import {stringifyPosition} from 'unist-util-stringify-position'

const own = {}.hasOwnProperty

/**
 * Turn markdown into a syntax tree.
 *
 * @overload
 * @param {Value} value
 * @param {Encoding | null | undefined} [encoding]
 * @param {Options | null | undefined} [options]
 * @returns {Root}
 *
 * @overload
 * @param {Value} value
 * @param {Options | null | undefined} [options]
 * @returns {Root}
 *
 * @param {Value} value
 *   Markdown to parse.
 * @param {Encoding | Options | null | undefined} [encoding]
 *   Character encoding for when `value` is `Buffer`.
 * @param {Options | null | undefined} [options]
 *   Configuration.
 * @returns {Root}
 *   mdast tree.
 */
export function fromMarkdown(value, encoding, options) {
  if (encoding && typeof encoding === 'object') {
    options = encoding
    encoding = undefined
  }

  return compiler(options)(
    postprocess(
      parse(options)
        .document()
        .write(preprocess()(value, encoding, true))
    )
  )
}

/**
 * Note this compiler only understand complete buffering, not streaming.
 *
 * @param {Options | null | undefined} [options]
 */
function compiler(options) {
  /** @type {Config} */
  const config = {
    transforms: [],
    canContainEols: ['emphasis', 'fragment', 'heading', 'paragraph', 'strong'],
    enter: {
      autolink: opener(link),
      autolinkProtocol: onenterdata,
      autolinkEmail: onenterdata,
      atxHeading: opener(heading),
      blockQuote: opener(blockQuote),
      characterEscape: onenterdata,
      characterReference: onenterdata,
      codeFenced: opener(codeFlow),
      codeFencedFenceInfo: buffer,
      codeFencedFenceMeta: buffer,
      codeIndented: opener(codeFlow, buffer),
      codeText: opener(codeText, buffer),
      codeTextData: onenterdata,
      data: onenterdata,
      codeFlowValue: onenterdata,
      definition: opener(definition),
      definitionDestinationString: buffer,
      definitionLabelString: buffer,
      definitionTitleString: buffer,
      emphasis: opener(emphasis),
      hardBreakEscape: opener(hardBreak),
      hardBreakTrailing: opener(hardBreak),
      htmlFlow: opener(html, buffer),
      htmlFlowData: onenterdata,
      htmlText: opener(html, buffer),
      htmlTextData: onenterdata,
      image: opener(image),
      label: buffer,
      link: opener(link),
      listItem: opener(listItem),
      listItemValue: onenterlistitemvalue,
      listOrdered: opener(list, onenterlistordered),
      listUnordered: opener(list),
      paragraph: opener(paragraph),
      reference: onenterreference,
      referenceString: buffer,
      resourceDestinationString: buffer,
      resourceTitleString: buffer,
      setextHeading: opener(heading),
      strong: opener(strong),
      thematicBreak: opener(thematicBreak)
    },
    exit: {
      atxHeading: closer(),
      atxHeadingSequence: onexitatxheadingsequence,
      autolink: closer(),
      autolinkEmail: onexitautolinkemail,
      autolinkProtocol: onexitautolinkprotocol,
      blockQuote: closer(),
      characterEscapeValue: onexitdata,
      characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker,
      characterReferenceMarkerNumeric: onexitcharacterreferencemarker,
      characterReferenceValue: onexitcharacterreferencevalue,
      characterReference: onexitcharacterreference,
      codeFenced: closer(onexitcodefenced),
      codeFencedFence: onexitcodefencedfence,
      codeFencedFenceInfo: onexitcodefencedfenceinfo,
      codeFencedFenceMeta: onexitcodefencedfencemeta,
      codeFlowValue: onexitdata,
      codeIndented: closer(onexitcodeindented),
      codeText: closer(onexitcodetext),
      codeTextData: onexitdata,
      data: onexitdata,
      definition: closer(),
      definitionDestinationString: onexitdefinitiondestinationstring,
      definitionLabelString: onexitdefinitionlabelstring,
      definitionTitleString: onexitdefinitiontitlestring,
      emphasis: closer(),
      hardBreakEscape: closer(onexithardbreak),
      hardBreakTrailing: closer(onexithardbreak),
      htmlFlow: closer(onexithtmlflow),
      htmlFlowData: onexitdata,
      htmlText: closer(onexithtmltext),
      htmlTextData: onexitdata,
      image: closer(onexitimage),
      label: onexitlabel,
      labelText: onexitlabeltext,
      lineEnding: onexitlineending,
      link: closer(onexitlink),
      listItem: closer(),
      listOrdered: closer(),
      listUnordered: closer(),
      paragraph: closer(),
      referenceString: onexitreferencestring,
      resourceDestinationString: onexitresourcedestinationstring,
      resourceTitleString: onexitresourcetitlestring,
      resource: onexitresource,
      setextHeading: closer(onexitsetextheading),
      setextHeadingLineSequence: onexitsetextheadinglinesequence,
      setextHeadingText: onexitsetextheadingtext,
      strong: closer(),
      thematicBreak: closer()
    }
  }

  configure(config, (options || {}).mdastExtensions || [])

  /** @type {CompileData} */
  const data = {}

  return compile

  /**
   * Turn micromark events into an mdast tree.
   *
   * @param {Array<Event>} events
   *   Events.
   * @returns {Root}
   *   mdast tree.
   */
  function compile(events) {
    /** @type {Root} */
    let tree = {type: 'root', children: []}
    /** @type {Omit<CompileContext, 'sliceSerialize'>} */
    const context = {
      stack: [tree],
      tokenStack: [],
      config,
      enter,
      exit,
      buffer,
      resume,
      data
    }
    /** @type {Array<number>} */
    const listStack = []
    let index = -1

    while (++index < events.length) {
      // We preprocess lists to add `listItem` tokens, and to infer whether
      // items the list itself are spread out.
      if (
        events[index][1].type === types.listOrdered ||
        events[index][1].type === types.listUnordered
      ) {
        if (events[index][0] === 'enter') {
          listStack.push(index)
        } else {
          const tail = listStack.pop()
          assert(typeof tail === 'number', 'expected list to be open')
          index = prepareList(events, tail, index)
        }
      }
    }

    index = -1

    while (++index < events.length) {
      const handler = config[events[index][0]]

      if (own.call(handler, events[index][1].type)) {
        handler[events[index][1].type].call(
          Object.assign(
            {sliceSerialize: events[index][2].sliceSerialize},
            context
          ),
          events[index][1]
        )
      }
    }

    // Handle tokens still being open.
    if (context.tokenStack.length > 0) {
      const tail = context.tokenStack[context.tokenStack.length - 1]
      const handler = tail[1] || defaultOnError
      handler.call(context, undefined, tail[0])
    }

    // Figure out `root` position.
    tree.position = {
      start: point(
        events.length > 0 ? events[0][1].start : {line: 1, column: 1, offset: 0}
      ),
      end: point(
        events.length > 0
          ? events[events.length - 2][1].end
          : {line: 1, column: 1, offset: 0}
      )
    }

    // Call transforms.
    index = -1
    while (++index < config.transforms.length) {
      tree = config.transforms[index](tree) || tree
    }

    return tree
  }

  /**
   * @param {Array<Event>} events
   * @param {number} start
   * @param {number} length
   * @returns {number}
   */
  function prepareList(events, start, length) {
    let index = start - 1
    let containerBalance = -1
    let listSpread = false
    /** @type {Token | undefined} */
    let listItem
    /** @type {number | undefined} */
    let lineIndex
    /** @type {number | undefined} */
    let firstBlankLineIndex
    /** @type {boolean | undefined} */
    let atMarker

    while (++index <= length) {
      const event = events[index]

      switch (event[1].type) {
        case types.listUnordered:
        case types.listOrdered:
        case types.blockQuote: {
          if (event[0] === 'enter') {
            containerBalance++
          } else {
            containerBalance--
          }

          atMarker = undefined

          break
        }

        case types.lineEndingBlank: {
          if (event[0] === 'enter') {
            if (
              listItem &&
              !atMarker &&
              !containerBalance &&
              !firstBlankLineIndex
            ) {
              firstBlankLineIndex = index
            }

            atMarker = undefined
          }

          break
        }

        case types.linePrefix:
        case types.listItemValue:
        case types.listItemMarker:
        case types.listItemPrefix:
        case types.listItemPrefixWhitespace: {
          // Empty.

          break
        }

        default: {
          atMarker = undefined
        }
      }

      if (
        (!containerBalance &&
          event[0] === 'enter' &&
          event[1].type === types.listItemPrefix) ||
        (containerBalance === -1 &&
          event[0] === 'exit' &&
          (event[1].type === types.listUnordered ||
            event[1].type === types.listOrdered))
      ) {
        if (listItem) {
          let tailIndex = index
          lineIndex = undefined

          while (tailIndex--) {
            const tailEvent = events[tailIndex]

            if (
              tailEvent[1].type === types.lineEnding ||
              tailEvent[1].type === types.lineEndingBlank
            ) {
              if (tailEvent[0] === 'exit') continue

              if (lineIndex) {
                events[lineIndex][1].type = types.lineEndingBlank
                listSpread = true
              }

              tailEvent[1].type = types.lineEnding
              lineIndex = tailIndex
            } else if (
              tailEvent[1].type === types.linePrefix ||
              tailEvent[1].type === types.blockQuotePrefix ||
              tailEvent[1].type === types.blockQuotePrefixWhitespace ||
              tailEvent[1].type === types.blockQuoteMarker ||
              tailEvent[1].type === types.listItemIndent
            ) {
              // Empty
            } else {
              break
            }
          }

          if (
            firstBlankLineIndex &&
            (!lineIndex || firstBlankLineIndex < lineIndex)
          ) {
            listItem._spread = true
          }

          // Fix position.
          listItem.end = Object.assign(
            {},
            lineIndex ? events[lineIndex][1].start : event[1].end
          )

          events.splice(lineIndex || index, 0, ['exit', listItem, event[2]])
          index++
          length++
        }

        // Create a new list item.
        if (event[1].type === types.listItemPrefix) {
          /** @type {Token} */
          const item = {
            type: 'listItem',
            _spread: false,
            start: Object.assign({}, event[1].start),
            // @ts-expect-error: we’ll add `end` in a second.
            end: undefined
          }
          listItem = item
          events.splice(index, 0, ['enter', item, event[2]])
          index++
          length++
          firstBlankLineIndex = undefined
          atMarker = true
        }
      }
    }

    events[start][1]._spread = listSpread
    return length
  }

  /**
   * Create an opener handle.
   *
   * @param {(token: Token) => Nodes} create
   *   Create a node.
   * @param {Handle | undefined} [and]
   *   Optional function to also run.
   * @returns {Handle}
   *   Handle.
   */
  function opener(create, and) {
    return open

    /**
     * @this {CompileContext}
     * @param {Token} token
     * @returns {undefined}
     */
    function open(token) {
      enter.call(this, create(token), token)
      if (and) and.call(this, token)
    }
  }

  /**
   * @type {CompileContext['buffer']}
   */
  function buffer() {
    this.stack.push({type: 'fragment', children: []})
  }

  /**
   * @type {CompileContext['enter']}
   */
  function enter(node, token, errorHandler) {
    const parent = this.stack[this.stack.length - 1]
    assert(parent, 'expected `parent`')
    assert('children' in parent, 'expected `parent`')
    /** @type {Array<Nodes>} */
    const siblings = parent.children
    siblings.push(node)
    this.stack.push(node)
    this.tokenStack.push([token, errorHandler || undefined])
    node.position = {
      start: point(token.start),
      // @ts-expect-error: `end` will be patched later.
      end: undefined
    }
  }

  /**
   * Create a closer handle.
   *
   * @param {Handle | undefined} [and]
   *   Optional function to also run.
   * @returns {Handle}
   *   Handle.
   */
  function closer(and) {
    return close

    /**
     * @this {CompileContext}
     * @param {Token} token
     * @returns {undefined}
     */
    function close(token) {
      if (and) and.call(this, token)
      exit.call(this, token)
    }
  }

  /**
   * @type {CompileContext['exit']}
   */
  function exit(token, onExitError) {
    const node = this.stack.pop()
    assert(node, 'expected `node`')
    const open = this.tokenStack.pop()

    if (!open) {
      throw new Error(
        'Cannot close `' +
          token.type +
          '` (' +
          stringifyPosition({start: token.start, end: token.end}) +
          '): it’s not open'
      )
    } else if (open[0].type !== token.type) {
      if (onExitError) {
        onExitError.call(this, token, open[0])
      } else {
        const handler = open[1] || defaultOnError
        handler.call(this, token, open[0])
      }
    }

    assert(node.type !== 'fragment', 'unexpected fragment `exit`ed')
    assert(node.position, 'expected `position` to be defined')
    node.position.end = point(token.end)
  }

  /**
   * @type {CompileContext['resume']}
   */
  function resume() {
    return toString(this.stack.pop())
  }

  //
  // Handlers.
  //

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onenterlistordered() {
    this.data.expectingFirstListItemValue = true
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onenterlistitemvalue(token) {
    if (this.data.expectingFirstListItemValue) {
      const ancestor = this.stack[this.stack.length - 2]
      assert(ancestor, 'expected nodes on stack')
      assert(ancestor.type === 'list', 'expected list on stack')
      ancestor.start = Number.parseInt(
        this.sliceSerialize(token),
        constants.numericBaseDecimal
      )
      this.data.expectingFirstListItemValue = undefined
    }
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitcodefencedfenceinfo() {
    const data = this.resume()
    const node = this.stack[this.stack.length - 1]
    assert(node, 'expected node on stack')
    assert(node.type === 'code', 'expected code on stack')
    node.lang = data
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitcodefencedfencemeta() {
    const data = this.resume()
    const node = this.stack[this.stack.length - 1]
    assert(node, 'expected node on stack')
    assert(node.type === 'code', 'expected code on stack')
    node.meta = data
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitcodefencedfence() {
    // Exit if this is the closing fence.
    if (this.data.flowCodeInside) return
    this.buffer()
    this.data.flowCodeInside = true
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitcodefenced() {
    const data = this.resume()
    const node = this.stack[this.stack.length - 1]
    assert(node, 'expected node on stack')
    assert(node.type === 'code', 'expected code on stack')

    node.value = data.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, '')
    this.data.flowCodeInside = undefined
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitcodeindented() {
    const data = this.resume()
    const node = this.stack[this.stack.length - 1]
    assert(node, 'expected node on stack')
    assert(node.type === 'code', 'expected code on stack')

    node.value = data.replace(/(\r?\n|\r)$/g, '')
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitdefinitionlabelstring(token) {
    const label = this.resume()
    const node = this.stack[this.stack.length - 1]
    assert(node, 'expected node on stack')
    assert(node.type === 'definition', 'expected definition on stack')

    node.label = label
    node.identifier = normalizeIdentifier(
      this.sliceSerialize(token)
    ).toLowerCase()
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitdefinitiontitlestring() {
    const data = this.resume()
    const node = this.stack[this.stack.length - 1]
    assert(node, 'expected node on stack')
    assert(node.type === 'definition', 'expected definition on stack')

    node.title = data
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitdefinitiondestinationstring() {
    const data = this.resume()
    const node = this.stack[this.stack.length - 1]
    assert(node, 'expected node on stack')
    assert(node.type === 'definition', 'expected definition on stack')

    node.url = data
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitatxheadingsequence(token) {
    const node = this.stack[this.stack.length - 1]
    assert(node, 'expected node on stack')
    assert(node.type === 'heading', 'expected heading on stack')

    if (!node.depth) {
      const depth = this.sliceSerialize(token).length

      assert(
        depth === 1 ||
          depth === 2 ||
          depth === 3 ||
          depth === 4 ||
          depth === 5 ||
          depth === 6,
        'expected `depth` between `1` and `6`'
      )

      node.depth = depth
    }
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitsetextheadingtext() {
    this.data.setextHeadingSlurpLineEnding = true
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitsetextheadinglinesequence(token) {
    const node = this.stack[this.stack.length - 1]
    assert(node, 'expected node on stack')
    assert(node.type === 'heading', 'expected heading on stack')

    node.depth =
      this.sliceSerialize(token).codePointAt(0) === codes.equalsTo ? 1 : 2
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitsetextheading() {
    this.data.setextHeadingSlurpLineEnding = undefined
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */

  function onenterdata(token) {
    const node = this.stack[this.stack.length - 1]
    assert(node, 'expected node on stack')
    assert('children' in node, 'expected parent on stack')
    /** @type {Array<Nodes>} */
    const siblings = node.children

    let tail = siblings[siblings.length - 1]

    if (!tail || tail.type !== 'text') {
      // Add a new text node.
      tail = text()
      tail.position = {
        start: point(token.start),
        // @ts-expect-error: we’ll add `end` later.
        end: undefined
      }
      siblings.push(tail)
    }

    this.stack.push(tail)
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */

  function onexitdata(token) {
    const tail = this.stack.pop()
    assert(tail, 'expected a `node` to be on the stack')
    assert('value' in tail, 'expected a `literal` to be on the stack')
    assert(tail.position, 'expected `node` to have an open position')
    tail.value += this.sliceSerialize(token)
    tail.position.end = point(token.end)
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */

  function onexitlineending(token) {
    const context = this.stack[this.stack.length - 1]
    assert(context, 'expected `node`')

    // If we’re at a hard break, include the line ending in there.
    if (this.data.atHardBreak) {
      assert('children' in context, 'expected `parent`')
      const tail = context.children[context.children.length - 1]
      assert(tail.position, 'expected tail to have a starting position')
      tail.position.end = point(token.end)
      this.data.atHardBreak = undefined
      return
    }

    if (
      !this.data.setextHeadingSlurpLineEnding &&
      config.canContainEols.includes(context.type)
    ) {
      onenterdata.call(this, token)
      onexitdata.call(this, token)
    }
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */

  function onexithardbreak() {
    this.data.atHardBreak = true
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */

  function onexithtmlflow() {
    const data = this.resume()
    const node = this.stack[this.stack.length - 1]
    assert(node, 'expected node on stack')
    assert(node.type === 'html', 'expected html on stack')

    node.value = data
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */

  function onexithtmltext() {
    const data = this.resume()
    const node = this.stack[this.stack.length - 1]
    assert(node, 'expected node on stack')
    assert(node.type === 'html', 'expected html on stack')

    node.value = data
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */

  function onexitcodetext() {
    const data = this.resume()
    const node = this.stack[this.stack.length - 1]
    assert(node, 'expected node on stack')
    assert(node.type === 'inlineCode', 'expected inline code on stack')

    node.value = data
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */

  function onexitlink() {
    const node = this.stack[this.stack.length - 1]
    assert(node, 'expected node on stack')
    assert(node.type === 'link', 'expected link on stack')

    // Note: there are also `identifier` and `label` fields on this link node!
    // These are used / cleaned here.

    // To do: clean.
    if (this.data.inReference) {
      /** @type {ReferenceType} */
      const referenceType = this.data.referenceType || 'shortcut'

      node.type += 'Reference'
      // @ts-expect-error: mutate.
      node.referenceType = referenceType
      // @ts-expect-error: mutate.
      delete node.url
      delete node.title
    } else {
      // @ts-expect-error: mutate.
      delete node.identifier
      // @ts-expect-error: mutate.
      delete node.label
    }

    this.data.referenceType = undefined
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */

  function onexitimage() {
    const node = this.stack[this.stack.length - 1]
    assert(node, 'expected node on stack')
    assert(node.type === 'image', 'expected image on stack')

    // Note: there are also `identifier` and `label` fields on this link node!
    // These are used / cleaned here.

    // To do: clean.
    if (this.data.inReference) {
      /** @type {ReferenceType} */
      const referenceType = this.data.referenceType || 'shortcut'

      node.type += 'Reference'
      // @ts-expect-error: mutate.
      node.referenceType = referenceType
      // @ts-expect-error: mutate.
      delete node.url
      delete node.title
    } else {
      // @ts-expect-error: mutate.
      delete node.identifier
      // @ts-expect-error: mutate.
      delete node.label
    }

    this.data.referenceType = undefined
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */

  function onexitlabeltext(token) {
    const string = this.sliceSerialize(token)
    const ancestor = this.stack[this.stack.length - 2]
    assert(ancestor, 'expected ancestor on stack')
    assert(
      ancestor.type === 'image' || ancestor.type === 'link',
      'expected image or link on stack'
    )

    // @ts-expect-error: stash this on the node, as it might become a reference
    // later.
    ancestor.label = decodeString(string)
    // @ts-expect-error: same as above.
    ancestor.identifier = normalizeIdentifier(string).toLowerCase()
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */

  function onexitlabel() {
    const fragment = this.stack[this.stack.length - 1]
    assert(fragment, 'expected node on stack')
    assert(fragment.type === 'fragment', 'expected fragment on stack')
    const value = this.resume()
    const node = this.stack[this.stack.length - 1]
    assert(node, 'expected node on stack')
    assert(
      node.type === 'image' || node.type === 'link',
      'expected image or link on stack'
    )

    // Assume a reference.
    this.data.inReference = true

    if (node.type === 'link') {
      /** @type {Array<PhrasingContent>} */
      const children = fragment.children

      node.children = children
    } else {
      node.alt = value
    }
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */

  function onexitresourcedestinationstring() {
    const data = this.resume()
    const node = this.stack[this.stack.length - 1]
    assert(node, 'expected node on stack')
    assert(
      node.type === 'image' || node.type === 'link',
      'expected image or link on stack'
    )
    node.url = data
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */

  function onexitresourcetitlestring() {
    const data = this.resume()
    const node = this.stack[this.stack.length - 1]
    assert(node, 'expected node on stack')
    assert(
      node.type === 'image' || node.type === 'link',
      'expected image or link on stack'
    )
    node.title = data
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */

  function onexitresource() {
    this.data.inReference = undefined
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */

  function onenterreference() {
    this.data.referenceType = 'collapsed'
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */

  function onexitreferencestring(token) {
    const label = this.resume()
    const node = this.stack[this.stack.length - 1]
    assert(node, 'expected node on stack')
    assert(
      node.type === 'image' || node.type === 'link',
      'expected image reference or link reference on stack'
    )

    // @ts-expect-error: stash this on the node, as it might become a reference
    // later.
    node.label = label
    // @ts-expect-error: same as above.
    node.identifier = normalizeIdentifier(
      this.sliceSerialize(token)
    ).toLowerCase()
    this.data.referenceType = 'full'
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */

  function onexitcharacterreferencemarker(token) {
    assert(
      token.type === 'characterReferenceMarkerNumeric' ||
        token.type === 'characterReferenceMarkerHexadecimal'
    )
    this.data.characterReferenceType = token.type
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitcharacterreferencevalue(token) {
    const data = this.sliceSerialize(token)
    const type = this.data.characterReferenceType
    /** @type {string} */
    let value

    if (type) {
      value = decodeNumericCharacterReference(
        data,
        type === types.characterReferenceMarkerNumeric
          ? constants.numericBaseDecimal
          : constants.numericBaseHexadecimal
      )
      this.data.characterReferenceType = undefined
    } else {
      const result = decodeNamedCharacterReference(data)
      assert(result !== false, 'expected reference to decode')
      value = result
    }

    const tail = this.stack[this.stack.length - 1]
    assert(tail, 'expected `node`')
    assert('value' in tail, 'expected `node.value`')
    tail.value += value
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitcharacterreference(token) {
    const tail = this.stack.pop()
    assert(tail, 'expected `node`')
    assert(tail.position, 'expected `node.position`')
    tail.position.end = point(token.end)
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitautolinkprotocol(token) {
    onexitdata.call(this, token)
    const node = this.stack[this.stack.length - 1]
    assert(node, 'expected node on stack')
    assert(node.type === 'link', 'expected link on stack')

    node.url = this.sliceSerialize(token)
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitautolinkemail(token) {
    onexitdata.call(this, token)
    const node = this.stack[this.stack.length - 1]
    assert(node, 'expected node on stack')
    assert(node.type === 'link', 'expected link on stack')

    node.url = 'mailto:' + this.sliceSerialize(token)
  }

  //
  // Creaters.
  //

  /** @returns {Blockquote} */
  function blockQuote() {
    return {type: 'blockquote', children: []}
  }

  /** @returns {Code} */
  function codeFlow() {
    return {type: 'code', lang: null, meta: null, value: ''}
  }

  /** @returns {InlineCode} */
  function codeText() {
    return {type: 'inlineCode', value: ''}
  }

  /** @returns {Definition} */
  function definition() {
    return {
      type: 'definition',
      identifier: '',
      label: null,
      title: null,
      url: ''
    }
  }

  /** @returns {Emphasis} */
  function emphasis() {
    return {type: 'emphasis', children: []}
  }

  /** @returns {Heading} */
  function heading() {
    return {
      type: 'heading',
      // @ts-expect-error `depth` will be set later.
      depth: 0,
      children: []
    }
  }

  /** @returns {Break} */
  function hardBreak() {
    return {type: 'break'}
  }

  /** @returns {Html} */
  function html() {
    return {type: 'html', value: ''}
  }

  /** @returns {Image} */
  function image() {
    return {type: 'image', title: null, url: '', alt: null}
  }

  /** @returns {Link} */
  function link() {
    return {type: 'link', title: null, url: '', children: []}
  }

  /**
   * @param {Token} token
   * @returns {List}
   */
  function list(token) {
    return {
      type: 'list',
      ordered: token.type === 'listOrdered',
      start: null,
      spread: token._spread,
      children: []
    }
  }

  /**
   * @param {Token} token
   * @returns {ListItem}
   */
  function listItem(token) {
    return {
      type: 'listItem',
      spread: token._spread,
      checked: null,
      children: []
    }
  }

  /** @returns {Paragraph} */
  function paragraph() {
    return {type: 'paragraph', children: []}
  }

  /** @returns {Strong} */
  function strong() {
    return {type: 'strong', children: []}
  }

  /** @returns {Text} */
  function text() {
    return {type: 'text', value: ''}
  }

  /** @returns {ThematicBreak} */
  function thematicBreak() {
    return {type: 'thematicBreak'}
  }
}

/**
 * Copy a point-like value.
 *
 * @param {Point} d
 *   Point-like value.
 * @returns {Point}
 *   unist point.
 */
function point(d) {
  return {line: d.line, column: d.column, offset: d.offset}
}

/**
 * @param {Config} combined
 * @param {Array<Array<Extension> | Extension>} extensions
 * @returns {undefined}
 */
function configure(combined, extensions) {
  let index = -1

  while (++index < extensions.length) {
    const value = extensions[index]

    if (Array.isArray(value)) {
      configure(combined, value)
    } else {
      extension(combined, value)
    }
  }
}

/**
 * @param {Config} combined
 * @param {Extension} extension
 * @returns {undefined}
 */
function extension(combined, extension) {
  /** @type {keyof Extension} */
  let key

  for (key in extension) {
    if (own.call(extension, key)) {
      switch (key) {
        case 'canContainEols': {
          const right = extension[key]
          if (right) {
            combined[key].push(...right)
          }

          break
        }

        case 'transforms': {
          const right = extension[key]
          if (right) {
            combined[key].push(...right)
          }

          break
        }

        case 'enter':
        case 'exit': {
          const right = extension[key]
          if (right) {
            Object.assign(combined[key], right)
          }

          break
        }
        // No default
      }
    }
  }
}

/** @type {OnEnterError} */
function defaultOnError(left, right) {
  if (left) {
    throw new Error(
      'Cannot close `' +
        left.type +
        '` (' +
        stringifyPosition({start: left.start, end: left.end}) +
        '): a different token (`' +
        right.type +
        '`, ' +
        stringifyPosition({start: right.start, end: right.end}) +
        ') is open'
    )
  } else {
    throw new Error(
      'Cannot close document, a token (`' +
        right.type +
        '`, ' +
        stringifyPosition({start: right.start, end: right.end}) +
        ') is still open'
    )
  }
}
6Niximport type {Nodes, Parent, PhrasingContent, Root} from 'mdast'
import type {ParseOptions, Token} from 'micromark-util-types'

/**
 * Compiler context.
 */
export interface CompileContext {
  /**
   * Configuration.
   */
  config: Config
  /**
   * Info passed around;
   * key/value store.
   */
  data: CompileData
  /**
   * Stack of nodes.
   */
  stack: Array<Fragment | Nodes>
  /**
   * Stack of tokens.
   */
  tokenStack: Array<TokenTuple>

  /**
   * Capture some of the output data.
   *
   * @param this
   *   Context.
   * @returns
   *   Nothing.
   */
  buffer(this: CompileContext): undefined

  /**
   * Enter a node.
   *
   * @param this
   *   Context.
   * @param node
   *   Node.
   * @param token
   *   Token.
   * @param onError
   *   Error handler.
   * @returns
   *   Nothing.
   */
  enter(
    this: CompileContext,
    node: Nodes,
    token: Token,
    onError?: OnEnterError | null | undefined
  ): undefined

  /**
   * Exit a node.
   *
   * @param this
   *   Context.
   * @param token
   *   Token.
   * @param onError
   *   Error handler.
   * @returns
   *   Nothing.
   */
  exit(
    this: CompileContext,
    token: Token,
    onError?: OnExitError | null | undefined
  ): undefined

  /**
   * Stop capturing and access the output data.
   *
   * @param this
   *   Context.
   * @returns
   *   Nothing.
   */
  resume(this: CompileContext): string

  /**
   * Get the source text that spans a token (or location).
   *
   * @param token
   *   Start/end in stream.
   * @param expandTabs
   *   Whether to expand tabs.
   * @returns
   *   Serialized chunks.
   */
  sliceSerialize(
    token: Pick<Token, 'end' | 'start'>,
    expandTabs?: boolean | undefined
  ): string
}

/**
 * Interface of tracked data.
 *
 * When working on extensions that use more data, extend the corresponding
 * interface to register their types:
 *
 * ```ts
 * declare module 'mdast-util-from-markdown' {
 *   interface CompileData {
 *     // Register a new field.
 *     mathFlowInside?: boolean | undefined
 *   }
 * }
 * ```
 */
export interface CompileData {
  /**
   * Whether we’re inside a hard break.
   */
  atHardBreak?: boolean | undefined

  /**
   * Current character reference type.
   */
  characterReferenceType?:
    | 'characterReferenceMarkerHexadecimal'
    | 'characterReferenceMarkerNumeric'
    | undefined

  /**
   * Whether a first list item value (`1` in `1. a`) is expected.
   */
  expectingFirstListItemValue?: boolean | undefined

  /**
   * Whether we’re in flow code.
   */
  flowCodeInside?: boolean | undefined

  /**
   * Whether we’re in a reference.
   */
  inReference?: boolean | undefined

  /**
   * Whether we’re expecting a line ending from a setext heading, which can be slurped.
   */
  setextHeadingSlurpLineEnding?: boolean | undefined

  /**
   * Current reference.
   */
  referenceType?: 'collapsed' | 'full' | undefined
}

/**
 * Configuration.
 *
 * We have our defaults, but extensions will add more.
 */
export interface Config {
  /**
   * Token types where line endings are used.
   */
  canContainEols: Array<string>
  /**
   * Opening handles.
   */
  enter: Handles
  /**
   * Closing handles.
   */
  exit: Handles
  /**
   * Tree transforms.
   */
  transforms: Array<Transform>
}

/**
 * Change how markdown tokens from micromark are turned into mdast.
 */
export interface Extension {
  /**
   * Token types where line endings are used.
   */
  canContainEols?: Array<string> | null | undefined
  /**
   * Opening handles.
   */
  enter?: Handles | null | undefined
  /**
   * Closing handles.
   */
  exit?: Handles | null | undefined
  /**
   * Tree transforms.
   */
  transforms?: Array<Transform> | null | undefined
}

/**
 * Internal fragment.
 */
export interface Fragment extends Parent {
  /**
   * Node type.
   */
  type: 'fragment'
  /**
   * Children.
   */
  children: Array<PhrasingContent>
}

/**
 * Token types mapping to handles
 */
export type Handles = Record<string, Handle>

/**
 * Handle a token.
 *
 * @param this
 *   Context.
 * @param token
 *   Current token.
 * @returns
 *   Nothing.
 */
export type Handle = (this: CompileContext, token: Token) => undefined | void

/**
 * Handle the case where the `right` token is open, but it is closed (by the
 * `left` token) or because we reached the end of the document.
 *
 * @param this
 *   Context.
 * @param left
 *   Left token.
 * @param right
 *   Right token.
 * @returns
 *   Nothing.
 */
export type OnEnterError = (
  this: Omit<CompileContext, 'sliceSerialize'>,
  left: Token | undefined,
  right: Token
) => undefined

/**
 * Handle the case where the `right` token is open but it is closed by
 * exiting the `left` token.
 *
 * @param this
 *   Context.
 * @param left
 *   Left token.
 * @param right
 *   Right token.
 * @returns
 *   Nothing.
 */
export type OnExitError = (
  this: Omit<CompileContext, 'sliceSerialize'>,
  left: Token,
  right: Token
) => undefined

/**
 * Configuration.
 */
export interface Options extends ParseOptions {
  /**
   * Extensions for this utility to change how tokens are turned into a tree.
   */
  mdastExtensions?: Array<Extension | Array<Extension>> | null | undefined
}

/**
 * Open token on the stack,
 * with an optional error handler for when that token isn’t closed properly.
 */
export type TokenTuple = [token: Token, onError: OnEnterError | undefined]

/**
 * Extra transform, to change the AST afterwards.
 *
 * @param tree
 *   Tree to transform.
 * @returns
 *   New tree or nothing (in which case the current tree is used).
 */
export type Transform = (tree: Root) => Root | null | undefined | void
ߞx4 // Note: types exposed from `types.d.ts`.
export {}
ݷHxY // Note: types exported from `index.d.ts`.
export { fromMarkdown } from './lib/index.js';-.x A100644 index.d.ts 0?Pl\6100644 index.d.ts.map 3¢#`#TS|100644 index.js {q.(NfB100644 types.d.ts qav7ʰȓg2P100644 types.js gQ'3N	Ar$9IWxy뻅d
 toString ;
import {  } from 'micromark';
import {  :;
import { decodeString string';
import {aD ,;
import {  .);
import { stringifyPosition q&;;;;
  }%postprocess(parse(options).document()+));2A;t;;0;
  return compile;
      type: 'root'u;;1M$;
    let index = -1;"9 === "listOrdered" ||  === "listUnordered")O;
#;3);
        }
      }
    }
    index = -1;"(;cObject.assign({
          3/(
        }, context), events[index][1]);/;N0;~0;T*R
        line: 1,
        column: 1,
        offset: 0
      }),
      end: point(J : {
        line: 1,
        column: 1,
        offset: 0
      })
    };(;", P;
    }
    return tree; ;^!;|!;!6;!8;!/4";G"8;"B;"-V"listUnordered":
        case "listOrdered":
        case "blockQuote":
          {
  +$2#++;+$#;
            }
  #O;
            break;
          }
        case "lineEndingBlank":
          {
  +$2M)-stItem && !atMarker && !containerBalance && !1,) {
  $);
              }
    #;
            }
            break;
          }
        case "linePrefix":
        case "listItemValue":
        case "listItemM^arker":
        case "listItemPrefix":
        case "listItemPrefixWhitespace":
          {
  %&4  break;
          }
        default:
          {
  #4;
          }
      }
      if (!containerBalance &&& event[1].type === "listItemPrefix" || containerBalance === -1 && event[0] === 'exit' && (event[1].type === "listUnordered" ||  event[1].type === "listOrdered")';;( ;'(P;
)("lineEnding" ||Q*"lineEndingBlank")7;@)L"lineEndingBlank";)";
              }(" "lineEnding";*$;
            } else if (("linePrefix" ||Q*"blockQuotePrefix" ||Q*"blockQuotePrefixWhitespace" ||Q*"blockQuoteMarker" ||Q*"listItemIndent"+C*;
            }
          }
          if (1,&&!,0\,';#,8{},,6);1/K-4;
          index++;-;a-9"listItemPrefix".;
          listItem = item;1/=;
          index++;-;
$ 
undefined;/;
        }
      }
    }/*;
    return length;,0;5u1:;,6%;n6.I2;
      type: 'fragment'u);!2(2q;1M6parent.children;3;Nnode);4=;O4;,04;5;Q6;n6;7';=7('Cannot close `' + token.type + '` (' + stringifyPosition({
        start: token.start,
        end: token.end
      }) + '): it’s not open');8v;
#U8;8+;
      }
    }9);!2(9K;%:;<P:+;|;<(@q, 10);<8;n6C@[>3=';>3;
    node.lang = data;<bj>';>3;
    node.meta = data;<b?W;
    this.buffer();
@$;<]@#;>3;B hA;
@ 
undefined;<WB+;>3;B2;<SPC>;>3;i;i+@q).toLowerCase();<SPC
e#;>3;
    node.title = data;<SPC
OF4;>3;
    node.url = data;<SGN;KHM;qI;n6C@KI:;<SKJH;
    node.oH#rK61 ? 1 : 2;<SKH;TQLD;1MC;uM-;M[;M;N;
    }N;TTO/;P-;o);TTPI;-QmQ:;
  o(;R(;
      return;
    }
    if (R*R-/S';VS#;n6C/@aS.;T;>3;
    node.value = data;TXU';>3;
    node.value = data;TTV+;>3;
    node.value = data;TTW;;X;!];@]L;@]*8Z;1Ztitle;mG]#8Z ^
;@]*8Z`^;
    }Z(;TTj[<;X;!];@]L;@]*8Z;1Ztitle;mG]#8Z ^
;@]*8Z`^;
    }Z(;TT^@;
q;6;Picm`%;Pii`?;TTRa@;b ;>3;b<	;
    if `XPcX;c;mc;n6C/@aFd<;>3;
    node.url = data;TTe6;>3;
    node.title = data;TT$g2;TQg;;TT6h8;>3;Piu;Pii8@q).toLowerCase();Z'full';TTIojuk-;<TJol:;Al2;sl(;l?data, type === "m" ? 10 : 16);~m3;mF;
      value = result;
    }*OP;n;<TJo<;o);<Sqdp2;>3;0q*;<Sq7;>3;~r6;re_tblockquote'u;/uPs-_tAcode',
      lang: null,
      meta: null,
      value: ''
    };/us3_t#inlineCode',
      value: ''
    };/u*t;/ut1_t	emphasis'u;/u;/uu/_tbreak'
    };/uSv(_thtml',
      value: ''
    };/uv+_timage't",
      alt: null
    };/uw)_tlink't"u;
  }

  /**
q1w;
  }

  /**
q1x;/uJy3_t
paragraph'u;/uy-_tstrong'u;/uz)_ttext',
      value: ''
    };/ujz;_tthematicBreak'
    };zB
    line: d.line,
    column: d.column,
    offset: d.offset
  };{;A|L;|A;m|;|;}s
          {
  ~&;
  #z~.;
            }
            break;
          }~
          {
  ~&;
  #z~.;
            }
            break;
          }l+
          {
  ~&;
  #%;
            }
            break;
  %'Cannot close `' + left.type + '` (' + stringifyPosition({
      start: left.start,
      end: left.end
    }) + '): a differen=t token (`' + right.type + '`, ' + stringifyPosition({
      ,
      end: right.end
    }) + ') is open'); %0 right.type + '`, ' + stringifyPosition({
      8
      end: right.end
    }) + ') is still open');
  }
}I.ef	x 443;Xhx{
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "bugs": "https://github.com/syntax-tree/mdast-util-from-markdown/issues",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "dependencies": {
    "@types/mdast": "^4.0.0",
    "@types/unist": "^3.0.0",
    "decode-named-character-reference": "^1.0.0",
    "devlop": "^1.0.0",
    "mdast-util-to-string": "^4.0.0",
    "micromark": "^4.0.0",
    "micromark-util-decode-numeric-character-reference": "^2.0.0",
    "micromark-util-decode-string": "^2.0.0",
    "micromark-util-normalize-identifier": "^2.0.0",
    "micromark-util-symbol": "^2.0.0",
    "micromark-util-types": "^2.0.0",
    "unist-util-stringify-position": "^4.0.0"
  },
  "description": "mdast utility to parse markdown",
  "devDependencies": {
    "@types/node": "^25.0.0",
    "c8": "^10.0.0",
    "commonmark.json": "^0.31.0",
    "esbuild": "^0.27.0",
    "gzip-size-cli": "^5.0.0",
    "hast-util-from-html": "^2.0.0",
    "hast-util-to-html": "^9.0.0",
    "mdast-util-to-hast": "^13.0.0",
    "micromark-build": "^2.0.0",
    "prettier": "^3.0.0",
    "remark-cli": "^12.0.0",
    "remark-preset-wooorm": "^11.0.0",
    "terser": "^5.0.0",
    "type-coverage": "^2.0.0",
    "typescript": "^5.0.0",
    "xo": "^1.0.0"
  },
  "exports": {
    "development": "./dev/index.js",
    "default": "./index.js"
  },
  "files": [
    "dev/",
    "lib/",
    "index.d.ts",
    "index.js"
  ],
  "funding": {
    "type": "opencollective",
    "url": "https://opencollective.com/unified"
  },
  "keywords": [
    "ast",
    "markdown",
    "markup",
    "mdast-util",
    "mdast",
    "parse",
    "syntax",
    "tree",
    "unist",
    "utility",
    "util"
  ],
  "license": "MIT",
  "name": "mdast-util-from-markdown",
  "prettier": {
    "bracketSpacing": false,
    "semi": false,
    "singleQuote": true,
    "tabWidth": 2,
    "trailingComma": "none",
    "useTabs": false
  },
  "remarkConfig": {
    "plugins": [
      "remark-preset-wooorm"
    ]
  },
  "repository": "syntax-tree/mdast-util-from-markdown",
  "scripts": {
    "build": "tsc --build --clean && tsc --build && type-coverage && micromark-build && esbuild . --bundle --minify | terser | gzip-size --raw",
    "format": "remark --frail --quiet --output -- . && prettier --log-level warn --write -- . && xo --fix",
    "test-api-dev": "node --conditions development test/index.js",
    "test-api-prod": "node --conditions production test/index.js",
    "test-api": "npm run test-api-dev && npm run test-api-prod",
    "test-coverage": "c8 --100 --reporter lcov -- npm run test-api",
    "test": "npm run build && npm run format && npm run test-coverage"
  },
  "sideEffects": false,
  "typeCoverage": {
    "atLeast": 100,
    "strict": true
  },
  "type": "module",
  "version": "2.0.3"
}
,o>x8# mdast-util-from-markdown

[![Build][badge-build-image]][badge-build-url]
[![Coverage][badge-coverage-image]][badge-coverage-url]
[![Downloads][badge-downloads-image]][badge-downloads-url]
[![Size][badge-size-image]][badge-size-url]

**[mdast][github-mdast]** utility that turns markdown into a syntax tree.

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`fromMarkdown(value[, encoding][, options])`](#frommarkdownvalue-encoding-options)
  * [`CompileContext`](#compilecontext)
  * [`CompileData`](#compiledata)
  * [`Encoding`](#encoding)
  * [`Extension`](#extension)
  * [`Handle`](#handle)
  * [`OnEnterError`](#onentererror)
  * [`OnExitError`](#onexiterror)
  * [`Options`](#options)
  * [`Token`](#token)
  * [`Transform`](#transform)
  * [`Value`](#value)
* [List of extensions](#list-of-extensions)
* [Syntax](#syntax)
* [Syntax tree](#syntax-tree)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package is a utility that takes markdown input and turns it into an
[mdast][github-mdast] syntax tree.

This utility uses [`micromark`][github-micromark],
which turns markdown into tokens,
and then turns those tokens into nodes.
This package is used inside [`remark-parse`][github-remark-parse],
which focusses on
making it easier to transform content by abstracting these internals away.

## When should I use this?

If you want to handle syntax trees manually, use this.
When you *just* want to turn markdown into HTML,
use [`micromark`][github-micromark] instead.
For an easier time processing content,
use the **[remark][github-remark]** ecosystem instead.

You can combine this package with other packages to add syntax extensions to
markdown.
Notable examples that deeply integrate with this package are
[`mdast-util-mdx`][github-mdast-util-mdx],
[`mdast-util-gfm`][github-mdast-util-gfm],
[`mdast-util-frontmatter`][github-mdast-util-frontmatter],
[`mdast-util-math`][github-mdast-util-math], and
[`mdast-util-directive`][github-mdast-util-directive].

## Install

This package is [ESM only][github-gist-esm].
In Node.js (version 16+), install with [npm][npmjs-install]:

```sh
npm install mdast-util-from-markdown
```

In Deno with [`esm.sh`][esmsh]:

```js
import {fromMarkdown} from 'https://esm.sh/mdast-util-from-markdown@2'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {fromMarkdown} from 'https://esm.sh/mdast-util-from-markdown@2?bundle'
</script>
```

## Use

Say we have the following markdown file `example.md`:

```markdown
## Hello, *World*!
```

…and our module `example.js` looks as follows:

```js
import fs from 'node:fs/promises'
import {fromMarkdown} from 'mdast-util-from-markdown'

const doc = await fs.readFile('example.md')
const tree = fromMarkdown(doc)

console.log(tree)
```

…now running `node example.js` yields (positional info removed for brevity):

```js
{
  type: 'root',
  children: [
    {
      type: 'heading',
      depth: 2,
      children: [
        {type: 'text', value: 'Hello, '},
        {type: 'emphasis', children: [{type: 'text', value: 'World'}]},
        {type: 'text', value: '!'}
      ]
    }
  ]
}
```

## API

This package exports the identifier [`fromMarkdown`][api-from-markdown].
There is no default export.

The export map supports the [`development` condition][node-packages-conditions].
Run `node --conditions development example.js` to get instrumented dev code.
Without this condition, production code is loaded.

### `fromMarkdown(value[, encoding][, options])`

Turn markdown into a syntax tree.

###### Overloads

* `(value: Value, encoding: Encoding, options?: Options) => Root`
* `(value: Value, options?: Options) => Root`

###### Parameters

* `value` ([`Value`][api-value])
  — markdown to parse
* `encoding` ([`Encoding`][api-encoding], default: `'utf8'`)
  — [character encoding][node-util-encoding] for when `value` is
  [`Uint8Array`][mozilla-uint8-array]
* `options` ([`Options`][api-options], optional)
  — configuration

###### Returns

mdast tree ([`Root`][github-mdast-root]).

### `CompileContext`

mdast compiler context (TypeScript type).

###### Fields

* `stack` ([`Array<Node>`][github-mdast-nodes])
  — stack of nodes
* `tokenStack` (`Array<[Token, OnEnterError | undefined]>`)
  — stack of tokens
* `data` ([`CompileData`][api-compile-data])
  — info passed around; key/value store
* `buffer` (`() => undefined`)
  — capture some of the output data
* `resume` (`() => string`)
  — stop capturing and access the output data
* `enter` (`(node: Node, token: Token, onError?: OnEnterError) => undefined`)
  — enter a node
* `exit` (`(token: Token, onError?: OnExitError) => undefined`)
  — exit a node
* `sliceSerialize` (`(token: Token, expandTabs?: boolean) => string`)
  — get the string value of a token
* `config` (`Required<Extension>`)
  — configuration

### `CompileData`

Interface of tracked data (TypeScript type).

###### Type

```ts
interface CompileData { /* see code */ }
```

When working on extensions that use more data, extend the corresponding
interface to register their types:

```ts
declare module 'mdast-util-from-markdown' {
  interface CompileData {
    // Register a new field.
    mathFlowInside?: boolean | undefined
  }
}
```

### `Encoding`

Encodings supported by the [`Uint8Array`][mozilla-uint8-array] class
(TypeScript type).

See [`micromark`][github-micromark-api] for more info.

###### Type

```ts
type Encoding = 'utf8' | /* … */
```

### `Extension`

Change how markdown tokens from micromark are turned into mdast (TypeScript
type).

###### Properties

* `canContainEols` (`Array<string>`, optional)
  — token types where line endings are used
* `enter` ([`Record<string, Handle>`][api-handle], optional)
  — opening handles
* `exit` ([`Record<string, Handle>`][api-handle], optional)
  — closing handles
* `transforms` ([`Array<Transform>`][api-transform], optional)
  — tree transforms

### `Handle`

Handle a token (TypeScript type).

###### Parameters

* `this` ([`CompileContext`][api-compile-context])
  — context
* `token` ([`Token`][api-token])
  — current token

###### Returns

Nothing (`undefined`).

### `OnEnterError`

Handle the case where the `right` token is open, but it is closed (by the
`left` token) or because we reached the end of the document (TypeScript type).

###### Parameters

* `this` ([`CompileContext`][api-compile-context])
  — context
* `left` ([`Token`][api-token] or `undefined`)
  — left token
* `right` ([`Token`][api-token])
  — right token

###### Returns

Nothing (`undefined`).

### `OnExitError`

Handle the case where the `right` token is open but it is closed by
exiting the `left` token (TypeScript type).

###### Parameters

* `this` ([`CompileContext`][api-compile-context])
  — context
* `left` ([`Token`][api-token])
  — left token
* `right` ([`Token`][api-token])
  — right token

###### Returns

Nothing (`undefined`).

### `Options`

Configuration (TypeScript type).

###### Properties

* `extensions`
  ([`Array<MicromarkExtension>`][github-micromark-extension], optional)
  — micromark extensions to change how markdown is parsed
* `mdastExtensions`
  ([`Array<Extension | Array<Extension>>`][api-extension],
  optional)
  — extensions for this utility to change how tokens are turned into a tree

### `Token`

Token from micromark (TypeScript type).

###### Type

```ts
type Token = { /* … */ }
```

### `Transform`

Extra transform, to change the AST afterwards (TypeScript type).

###### Parameters

* `tree` ([`Root`][github-mdast-root])
  — tree to transform

###### Returns

New tree ([`Root`][github-mdast-root]) or nothing
(in which case the current tree is used).

### `Value`

Contents of the file (TypeScript type).

See [`micromark`][github-micromark-api] for more info.

###### Type

```ts
type Value = Uint8Array | string
```

## List of extensions

* [`syntax-tree/mdast-util-directive`][github-mdast-util-directive]
  — directives
* [`syntax-tree/mdast-util-frontmatter`][github-mdast-util-frontmatter]
  — frontmatter (YAML, TOML, more)
* [`syntax-tree/mdast-util-gfm`][github-mdast-util-gfm]
  — GFM
* [`syntax-tree/mdast-util-gfm-autolink-literal`](https://github.com/syntax-tree/mdast-util-gfm-autolink-literal)
  — GFM autolink literals
* [`syntax-tree/mdast-util-gfm-footnote`](https://github.com/syntax-tree/mdast-util-gfm-footnote)
  — GFM footnotes
* [`syntax-tree/mdast-util-gfm-strikethrough`](https://github.com/syntax-tree/mdast-util-gfm-strikethrough)
  — GFM strikethrough
* [`syntax-tree/mdast-util-gfm-table`](https://github.com/syntax-tree/mdast-util-gfm-table)
  — GFM tables
* [`syntax-tree/mdast-util-gfm-task-list-item`](https://github.com/syntax-tree/mdast-util-gfm-task-list-item)
  — GFM task list items
* [`syntax-tree/mdast-util-math`][github-mdast-util-math]
  — math
* [`syntax-tree/mdast-util-mdx`][github-mdast-util-mdx]
  — MDX
* [`syntax-tree/mdast-util-mdx-expression`](https://github.com/syntax-tree/mdast-util-mdx-expression)
  — MDX expressions
* [`syntax-tree/mdast-util-mdx-jsx`](https://github.com/syntax-tree/mdast-util-mdx-jsx)
  — MDX JSX
* [`syntax-tree/mdast-util-mdxjs-esm`](https://github.com/syntax-tree/mdast-util-mdxjs-esm)
  — MDX ESM

## Syntax

Markdown is parsed according to CommonMark.
Extensions can add support for other syntax.
If you’re interested in extending markdown,
[more information is available in micromark’s
readme][github-micromark-extension].

## Syntax tree

The syntax tree is [mdast][github-mdast].

## Types

This package is fully typed with [TypeScript][].
It exports the additional types
[`CompileContext`][api-compile-context],
[`CompileData`][api-compile-data],
[`Encoding`][api-encoding],
[`Extension`][api-extension],
[`Handle`][api-handle],
[`OnEnterError`][api-on-enter-error],
[`OnExitError`][api-on-exit-error],
[`Options`][api-options],
[`Token`][api-token],
[`Transform`][api-transform], and
[`Value`][api-value].

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`mdast-util-from-markdown@^2`, compatible with Node.js 16.

## Security

As markdown is sometimes used for HTML, and improper use of HTML can open you up
to a [cross-site scripting (XSS)][wikipedia-xss] attack, use of `mdast-util-from-markdown`
can also be unsafe.
When going to HTML, use this utility in combination with
[`hast-util-sanitize`][github-hast-util-sanitize] to make the tree safe.

## Related

* [`syntax-tree/mdast-util-to-markdown`](https://github.com/syntax-tree/mdast-util-to-markdown)
  — serialize mdast as markdown
* [`micromark/micromark`][github-micromark]
  — parse markdown
* [`remarkjs/remark`][github-remark]
  — process markdown

## Contribute

See [`contributing.md`][health-contributing]
in
[`syntax-tree/.github`][health]
for ways to get started.
See [`support.md`][health-support] for ways to get help.

This project has a [code of conduct][health-coc].
By interacting with this repository, organization, or community you agree to
abide by its terms.

## License

[MIT][file-license] © [Titus Wormer][wooorm]

<!-- Definitions -->

[api-compile-context]: #compilecontext

[api-compile-data]: #compiledata

[api-encoding]: #encoding

[api-extension]: #extension

[api-from-markdown]: #frommarkdownvalue-encoding-options

[api-handle]: #handle

[api-on-enter-error]: #onentererror

[api-on-exit-error]: #onexiterror

[api-options]: #options

[api-token]: #token

[api-transform]: #transform

[api-value]: #value

[badge-build-image]: https://github.com/syntax-tree/mdast-util-from-markdown/workflows/main/badge.svg

[badge-build-url]: https://github.com/syntax-tree/mdast-util-from-markdown/actions

[badge-coverage-image]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-from-markdown.svg

[badge-coverage-url]: https://codecov.io/github/syntax-tree/mdast-util-from-markdown

[badge-downloads-image]: https://img.shields.io/npm/dm/mdast-util-from-markdown.svg

[badge-downloads-url]: https://www.npmjs.com/package/mdast-util-from-markdown

[badge-size-image]: https://img.shields.io/bundlejs/size/mdast-util-from-markdown

[badge-size-url]: https://bundlejs.com/?q=mdast-util-from-markdown

[esmsh]: https://esm.sh

[file-license]: license

[github-gist-esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[github-hast-util-sanitize]: https://github.com/syntax-tree/hast-util-sanitize

[github-mdast]: https://github.com/syntax-tree/mdast

[github-mdast-nodes]: https://github.com/syntax-tree/mdast#nodes

[github-mdast-root]: https://github.com/syntax-tree/mdast#root

[github-mdast-util-directive]: https://github.com/syntax-tree/mdast-util-directive

[github-mdast-util-frontmatter]: https://github.com/syntax-tree/mdast-util-frontmatter

[github-mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm

[github-mdast-util-math]: https://github.com/syntax-tree/mdast-util-math

[github-mdast-util-mdx]: https://github.com/syntax-tree/mdast-util-mdx

[github-micromark]: https://github.com/micromark/micromark

[github-micromark-api]: https://github.com/micromark/micromark/tree/main/packages/micromark#micromarkvalue-encoding-options

[github-micromark-extension]: https://github.com/micromark/micromark#extensions

[github-remark]: https://github.com/remarkjs/remark

[github-remark-parse]: https://github.com/remarkjs/remark/tree/main/packages/remark-parse

[health]: https://github.com/syntax-tree/.github

[health-coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md

[health-contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md

[health-support]: https://github.com/syntax-tree/.github/blob/main/support.md

[mozilla-uint8-array]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array

[node-packages-conditions]: https://nodejs.org/api/packages.html#packages_resolving_user_conditions

[node-util-encoding]: https://nodejs.org/api/util.html#whatwg-supported-encodings

[npmjs-install]: https://docs.npmjs.com/cli/install

[typescript]: https://www.typescriptlang.org

[wikipedia-xss]: https://en.wikipedia.org/wiki/Cross-site_scripting

[wooorm]: https://wooorm.com
jE*x  100644 index.d.ts dD/O nu100644 index.js 排L|uE40000 lib 3m>]4!4~MDi100644 license 97#V}n-ƟO^40000 node_modules nZnCY`. 100644 package.json EPowVN^100644 readme.md [GrH g	:dx export type Options = import('./lib/index.js').Options;
export type Matter = import('./lib/index.js').Matter;
export type Info = import('./lib/index.js').Info;
export { frontmatterFromMarkdown, frontmatterToMarkdown } from "./lib/index.js";
6Tٴx /**
 * @typedef {import('./lib/index.js').Options} Options
 * @typedef {import('./lib/index.js').Matter} Matter
 * @typedef {import('./lib/index.js').Info} Info
 */

export {frontmatterFromMarkdown, frontmatterToMarkdown} from './lib/index.js'
IpSxJ 100644 index.d.ts '6610hЪ&^100644 index.js  X`Ի`x/**
 * Create an extension for `mdast-util-from-markdown`.
 *
 * @returns {FromMarkdownExtension}
 *   Extension for `mdast-util-from-markdown`.
 */
export function mathFromMarkdown(): FromMarkdownExtension;
/**
 * Create an extension for `mdast-util-to-markdown`.
 *
 * @param {ToOptions | null | undefined} [options]
 *   Configuration (optional).
 * @returns {ToMarkdownExtension}
 *   Extension for `mdast-util-to-markdown`.
 */
export function mathToMarkdown(options?: ToOptions | null | undefined): ToMarkdownExtension;
export type HastElement = import('hast').Element;
export type HastElementContent = import('hast').ElementContent;
export type CompileContext = import('mdast-util-from-markdown').CompileContext;
export type FromMarkdownExtension = import('mdast-util-from-markdown').Extension;
export type FromMarkdownHandle = import('mdast-util-from-markdown').Handle;
export type ToMarkdownHandle = import('mdast-util-to-markdown').Handle;
export type ToMarkdownExtension = import('mdast-util-to-markdown').Options;
export type InlineMath = import('../index.js').InlineMath;
export type Math = import('../index.js').Math;
/**
 * Configuration.
 */
export type ToOptions = {
    /**
     * Whether to support math (text) with a single dollar (default: `true`).
     *
     * Single dollars work in Pandoc and many other places, but often interfere
     * with “normal” dollars in text.
     * If you turn this off, you can still use two or more dollars for text math.
     */
    singleDollarTextMath?: boolean | null | undefined;
};
}x^	B38KZ"frontmatterFromMarkdown(options?: ^3 frontmatterToMarkdown(options?: >!Literal = import('mdast').Literal~Dfo = import('micromark-extension-frontmatter').Info;
export type Matter = import('micromark-extension-frontmatter').Matter;
expFort type Options = import('micromark-extension-frontmatter').Options;
4ٶxf/**
 * @typedef {import('mdast').Literal} Literal
 *
 * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext
 * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension
 * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle
 * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
 *
 * @typedef {import('micromark-extension-frontmatter').Info} Info
 * @typedef {import('micromark-extension-frontmatter').Matter} Matter
 * @typedef {import('micromark-extension-frontmatter').Options} Options
 */

import {ok as assert} from 'devlop'
import {toMatters} from 'micromark-extension-frontmatter'
import escapeStringRegexp from 'escape-string-regexp'

/**
 * Create an extension for `mdast-util-from-markdown`.
 *
 * @param {Options | null | undefined} [options]
 *   Configuration (optional).
 * @returns {FromMarkdownExtension}
 *   Extension for `mdast-util-from-markdown`.
 */
export function frontmatterFromMarkdown(options) {
  const matters = toMatters(options)
  /** @type {FromMarkdownExtension['enter']} */
  const enter = {}
  /** @type {FromMarkdownExtension['exit']} */
  const exit = {}
  let index = -1

  while (++index < matters.length) {
    const matter = matters[index]
    enter[matter.type] = opener(matter)
    exit[matter.type] = close
    exit[matter.type + 'Value'] = value
  }

  return {enter, exit}
}

/**
 * @param {Matter} matter
 * @returns {FromMarkdownHandle} enter
 */
function opener(matter) {
  return open

  /**
   * @this {CompileContext}
   * @type {FromMarkdownHandle}
   */
  function open(token) {
    // @ts-expect-error: custom.
    this.enter({type: matter.type, value: ''}, token)
    this.buffer()
  }
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function close(token) {
  const data = this.resume()
  const node = this.stack[this.stack.length - 1]
  assert('value' in node)
  this.exit(token)
  // Remove the initial and final eol.
  node.value = data.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, '')
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function value(token) {
  this.config.enter.data.call(this, token)
  this.config.exit.data.call(this, token)
}

/**
 * Create an extension for `mdast-util-to-markdown`.
 *
 * @param {Options | null | undefined} [options]
 *   Configuration (optional).
 * @returns {ToMarkdownExtension}
 *   Extension for `mdast-util-to-markdown`.
 */
export function frontmatterToMarkdown(options) {
  /** @type {ToMarkdownExtension['unsafe']} */
  const unsafe = []
  /** @type {ToMarkdownExtension['handlers']} */
  const handlers = {}
  const matters = toMatters(options)
  let index = -1

  while (++index < matters.length) {
    const matter = matters[index]

    // @ts-expect-error: this can add custom frontmatter nodes.
    // Typing those is the responsibility of the end user.
    handlers[matter.type] = handler(matter)

    const open = fence(matter, 'open')

    unsafe.push({
      atBreak: true,
      character: open.charAt(0),
      after: escapeStringRegexp(open.charAt(1))
    })
  }

  return {unsafe, handlers}
}

/**
 * Create a handle that can serialize a frontmatter node as markdown.
 *
 * @param {Matter} matter
 *   Structure.
 * @returns {(node: Literal) => string} enter
 *   Handler.
 */
function handler(matter) {
  const open = fence(matter, 'open')
  const close = fence(matter, 'close')

  return handle

  /**
   * Serialize a frontmatter node as markdown.
   *
   * @param {Literal} node
   *   Node to serialize.
   * @returns {string}
   *   Serialized node.
   */
  function handle(node) {
    return open + (node.value ? '\n' + node.value : '') + '\n' + close
  }
}

/**
 * Get an `open` or `close` fence.
 *
 * @param {Matter} matter
 *   Structure.
 * @param {'close' | 'open'} prop
 *   Field to get.
 * @returns {string}
 *   Fence.
 */
function fence(matter, prop) {
  return matter.marker
    ? pick(matter.marker, prop).repeat(3)
    : // @ts-expect-error: They’re mutually exclusive.
      pick(matter.fence, prop)
}

/**
 * Take `open` or `close` fields when schema is an info object, or use the
 * given value when it is a string.
 *
 * @param {Info | string} schema
 *   Info object or value.
 * @param {'close' | 'open'} prop
 *   Field to get.
 * @returns {string}
 *   Thing to use for the opening or closing.
 */
function pick(schema, prop) {
  return typeof schema === 'string' ? schema : schema[prop]
}
XPx KJ(The MIT License)

Copyright (c) 2020 Titus Wormer <tituswormer@gmail.com>TG
?
'Software'9
 C
dB
E
Y
GZ'AS IS'
B
F
RD
D
A
7+4ذx@
{
  "name": "mdast-util-frontmatter",
  "version": "2.0.1",
  "description": "mdast extension to parse and serialize frontmatter (YAML, TOML, etc)",
  "license": "MIT",
  "keywords": [
    "unist",
    "mdast",
    "mdast-util",
    "util",
    "utility",
    "markdown",
    "markup",
    "frontmatter",
    "yaml",
    "toml",
    "gfm"
  ],
  "repository": "syntax-tree/mdast-util-frontmatter",
  "bugs": "https://github.com/syntax-tree/mdast-util-frontmatter/issues",
  "funding": {
    "type": "opencollective",
    "url": "https://opencollective.com/unified"
  },
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "sideEffects": false,
  "type": "module",
  "exports": "./index.js",
  "files": [
    "lib/",
    "index.d.ts",
    "index.js"
  ],
  "dependencies": {
    "@types/mdast": "^4.0.0",
    "devlop": "^1.0.0",
    "escape-string-regexp": "^5.0.0",
    "mdast-util-from-markdown": "^2.0.0",
    "mdast-util-to-markdown": "^2.0.0",
    "micromark-extension-frontmatter": "^2.0.0"
  },
  "devDependencies": {
    "@types/node": "^20.0.0",
    "c8": "^8.0.0",
    "prettier": "^3.0.0",
    "remark-cli": "^11.0.0",
    "remark-preset-wooorm": "^9.0.0",
    "type-coverage": "^2.0.0",
    "typescript": "^5.0.0",
    "unist-util-remove-position": "^5.0.0",
    "xo": "^0.56.0"
  },
  "scripts": {
    "prepack": "npm run build && npm run format",
    "build": "tsc --build --clean && tsc --build && type-coverage",
    "format": "remark . -qfo && prettier . -w --log-level warn && xo --fix",
    "test-api-prod": "node --conditions production test.js",
    "test-api-dev": "node --conditions development test.js",
    "test-api": "npm run test-api-dev && npm run test-api-prod",
    "test-coverage": "c8 --100 --reporter lcov npm run test-api",
    "test": "npm run build && npm run format && npm run test-coverage"
  },
  "prettier": {
    "bracketSpacing": false,
    "semi": false,
    "singleQuote": true,
    "tabWidth": 2,
    "trailingComma": "none",
    "useTabs": false
  },
  "remarkConfig": {
    "plugins": [
      "remark-preset-wooorm"
    ]
  },
  "typeCoverage": {
    "atLeast": 100,
    "detail": true,
    "ignoreCatch": true,
    "strict": true
  },
  "xo": {
    "overrides": [
      {
        "files": [
          "**/*.ts"
        ],
        "rules": {
          "@typescript-eslint/consistent-type-definitions": "off"
        }
      }
    ],
    "prettier": true,
    "rules": {
      "unicorn/prefer-at": "off",
      "unicorn/prefer-string-replace-all": "off"
    }
  }
}
x,,# micromark-extension-frontmatter

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

[micromark][] extensions to support frontmatter (YAML, TOML, and more).

## Contents

*   [What is this?](#what-is-this)
*   [When to use this](#when-to-use-this)
*   [Install](#install)
*   [Use](#use)
*   [API](#api)
    *   [`frontmatter(options?)`](#frontmatteroptions)
    *   [`frontmatterHtml(options?)`](#frontmatterhtmloptions)
    *   [`toMatters(options?)`](#tomattersoptions)
    *   [`Info`](#info)
    *   [`Matter`](#matter)
    *   [`Options`](#options)
    *   [`Preset`](#preset)
*   [Examples](#examples)
*   [Authoring](#authoring)
*   [HTML](#html)
*   [CSS](#css)
*   [Syntax](#syntax)
*   [Types](#types)
*   [Compatibility](#compatibility)
*   [Security](#security)
*   [Related](#related)
*   [Contribute](#contribute)
*   [License](#license)

## What is this?

This package contains two extensions that add support for frontmatter syntax
as often used in markdown to [`micromark`][micromark].

Frontmatter is a metadata format in front of the content.
It’s typically written in YAML and is often used with markdown.
Frontmatter does not work everywhere so it makes markdown less portable.

As there is no spec for frontmatter in markdown, these extensions follow how
YAML frontmatter works on `github.com`.
It can also parse TOML frontmatter, just like YAML except that it uses a `+`.

## When to use this

You can use these extensions when you are working with [`micromark`][micromark]
already.

When you need a syntax tree, you can combine this package with
[`mdast-util-frontmatter`][mdast-util-frontmatter].

All these packages are used [`remark-frontmatter`][remark-frontmatter], which
focusses on making it easier to transform content by abstracting these
internals away.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install micromark-extension-frontmatter
```

In Deno with [`esm.sh`][esmsh]:

```js
import {frontmatter, frontmatterHtml} from 'https://esm.sh/micromark-extension-frontmatter@2'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {frontmatter, frontmatterHtml} from 'https://esm.sh/micromark-extension-frontmatter@2?bundle'
</script>
```

## Use

Say our module `example.js` looks as follows:

```js
import {micromark} from 'micromark'
import {frontmatter, frontmatterHtml} from 'micromark-extension-frontmatter'

const output = micromark('---\na: b\n---\n# c', {
  extensions: [frontmatter()],
  htmlExtensions: [frontmatterHtml()]
})

console.log(output)
```

…now running `node example.js` yields:

```html
<h1>c</h1>
```

## API

This package exports the identifiers [`frontmatter`][api-frontmatter],
[`frontmatterHtml`][api-frontmatter-html], and [`toMatters`][api-to-matters].
There is no default export.

The export map supports the [`development` condition][development].
Run `node --conditions development module.js` to get instrumented dev code.
Without this condition, production code is loaded.

### `frontmatter(options?)`

Create an extension for [`micromark`][micromark] to enable frontmatter syntax.

###### Parameters

*   `options` ([`Options`][api-options], default: `['yaml']`)
    — configuration

###### Returns

Extension for `micromark` that can be passed in `extensions`, to enable
frontmatter syntax ([`Extension`][micromark-extension]).

### `frontmatterHtml(options?)`

Create an extension for `micromark` to support frontmatter when serializing to
HTML.

> 👉 **Note**: this makes sure nothing is generated in the output HTML for
> frontmatter.

###### Parameters

*   `options` ([`Options`][api-options], default: `['yaml']`)
    — configuration

###### Returns

Extension for `micromark` that can be passed in `htmlExtensions`, to support
frontmatter when serializing to HTML
([`HtmlExtension`][micromark-html-extension]).

### `toMatters(options?)`

Simplify options by normalizing them to an array of matters.

###### Parameters

*   `options` ([`Options`][api-options], default: `['yaml']`)
    — configuration

###### Returns

List of matters ([`Array<Matter>`][api-matter]).

### `Info`

Sequence (TypeScript type).

Depending on how this structure is used, it reflects a marker or a fence.

###### Fields

*   `open` (`string`)
    — opening
*   `close` (`string`)
    — closing

### `Matter`

Fields describing a kind of matter (TypeScript type).

> 👉 **Note**: using `anywhere` is a terrible idea.
> It’s called frontmatter, not matter-in-the-middle or so.
> This makes your markdown less portable.

> 👉 **Note**: `marker` and `fence` are mutually exclusive.
> If `marker` is set, `fence` must not be set, and vice versa.

###### Fields

*   `type` (`string`)
    — node type to tokenize as
*   `marker` (`string` or [`Info`][api-info])
    — character repeated 3 times, used as complete fences
*   `fence` (`string` or [`Info`][api-info])
    — complete fences
*   `anywhere` (`boolean`, default: `false`)
    — whether matter can be found anywhere in the document, normally only
    matter at the start of the document is recognized

### `Options`

Configuration (TypeScript type).

###### Type

```ts
type Options = Array<Matter | Preset> | Matter | Preset
```

### `Preset`

Known name of a frontmatter style (TypeScript type).

*   `'yaml'` — [`Matter`][api-matter] defined as `{type: 'yaml', marker: '-'}`
*   `'toml'` — [`Matter`][api-matter] defined as `{type: 'toml', marker: '+'}`

###### Type

```ts
type Preset = 'toml' | 'yaml'
```

## Examples

Here are a couple of example of different matter objects and what frontmatter
they match.

To match frontmatter with the same opening and closing fence, namely three of
the same markers, use for example `{type: 'yaml', marker: '-'}`, which matches:

```yaml
---
key: value
---
```

To match frontmatter with different opening and closing fences, which each use
three different markers, use for example
`{type: 'custom', marker: {open: '<', close: '>'}}`, which matches:

```text
<<<
data
>>>
```

To match frontmatter with the same opening and closing fences, which both use
the same custom string, use for example `{type: 'custom', fence: '+=+=+=+'}`,
which matches:

```text
+=+=+=+
data
+=+=+=+
```

To match frontmatter with different opening and closing fences, which each use
different custom strings, use for example
`{type: 'json', fence: {open: '{', close: '}'}}`, which matches:

```json
{
  "key": "value"
}
```

## Authoring

When authoring markdown with frontmatter, it’s recommended to use YAML
frontmatter if possible.
While YAML has some warts, it works in the most places, so using it guarantees
the highest chance of portability.

In certain ecosystems, other flavors are widely used.
For example, in the Rust ecosystem, TOML is often used.
In such cases, using TOML is an okay choice.

When possible, do not use other types of frontmatter, and do not allow
frontmatter anywhere.

## HTML

Frontmatter does not relate to HTML elements.
It is typically stripped, which is what these extensions do.

## CSS

This package does not relate to CSS.

## Syntax

Frontmatter forms with the following BNF:

```bnf
frontmatter ::= fence_open *( eol *line ) eol fence_close
fence_open ::= sequence_open *space_or_tab
fence_close ::= sequence_close *space_or_tab
; Note: options can define custom sequences.
sequence_open ::= 3'+' | 3'-'
; Note: options can define custom sequences.
; Restriction: `sequence_close` must correspond to `sequence_open`.
sequence_close ::= 3'+' | 3'-'

; Character groups for informational purposes.
byte ::= 0x00..=0xFFFF
eol ::= '\n' | '\r' | '\r\n'
line ::= byte - eol
```

Frontmatter can only occur once.
It cannot occur in a container.
It must have a closing fence.
Like flow constructs, it must be followed by an eol (line ending) or
eof (end of file).

## Types

This package is fully typed with [TypeScript][].
It exports the additional types [`Info`][api-info], [`Matter`][api-matter],
[`Options`][api-options], [`Preset`][api-preset].

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-extension-frontmatter@^2`, compatible with Node.js 16.

This package works with `micromark` version `3` and later.

## Security

This package is safe.

## Related

*   [`remark-frontmatter`][remark-frontmatter]
    — remark plugin using this to support frontmatter
*   [`mdast-util-frontmatter`][mdast-util-frontmatter]
    — mdast utility to support frontmatter

## Contribute

See [`contributing.md` in `micromark/.github`][contributing] for ways to get
started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organization, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/micromark/micromark-extension-frontmatter/workflows/main/badge.svg

[build]: https://github.com/micromark/micromark-extension-frontmatter/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark-extension-frontmatter.svg

[coverage]: https://codecov.io/github/micromark/micromark-extension-frontmatter

[downloads-badge]: https://img.shields.io/npm/dm/micromark-extension-frontmatter.svg

[downloads]: https://www.npmjs.com/package/micromark-extension-frontmatter

[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-extension-frontmatter

[size]: https://bundlejs.com/?q=micromark-extension-frontmatter

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[collective]: https://opencollective.com/unified

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/micromark/micromark/discussions

[npm]: https://docs.npmjs.com/cli/install

[esmsh]: https://esm.sh

[license]: license

[author]: https://wooorm.com

[contributing]: https://github.com/micromark/.github/blob/main/contributing.md

[support]: https://github.com/micromark/.github/blob/main/support.md

[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[typescript]: https://www.typescriptlang.org

[development]: https://nodejs.org/api/packages.html#packages_resolving_user_conditions

[micromark]: https://github.com/micromark/micromark

[mdast-util-frontmatter]: https://github.com/syntax-tree/mdast-util-frontmatter

[remark-frontmatter]: https://github.com/remarkjs/remark-frontmatter

[micromark-extension]: https://github.com/micromark/micromark#syntaxextension

[micromark-html-extension]: https://github.com/micromark/micromark#htmlextension

[api-frontmatter]: #frontmatteroptions

[api-frontmatter-html]: #frontmatterhtmloptions

[api-to-matters]: #tomattersoptions

[api-info]: #info

[api-matter]: #matter

[api-options]: #options

[api-preset]: #preset
|Gax)YU# O"!)dast][] extensions to parse and serializeCFromMarkdownfrommarkdown)
ToMarkdown
tomarkdown[jYSyntax tree](#syntax-tree)
    *   [Nodes](#nodes)
    *   [Content model](#content-model~?mdast][].
These extensions plug into
[`mdast-util-from-markdown`][mdast-util-from-markdown] (to support parsing
frontmatter in markdown into a syntax tree) and
[`mdast-util-to-markdown`][mdast-util-to-markdown] (to support serializing
frontmatter in syntax trees to markdown)T GitHub handles frontmatter.
GitHub only supports YAML frontmatter, but these extensions also support
different flavors (such as TOML)?N
`mdast-util-from-markdown` and `mdast-util-to-markdown` already.

When working with `mdast-util-from-markdown`, you must combine this package
with [`1
`][1
].

When you don’tusedirectly with
[`1
`][1
!P"Z@:FromMarkdown, frontmatterToMarkdown} from 'https://esm.sh/O"b:FromMarkdown, frontmatterToMarkdown} from 'https://esm.sh/O"	*hdocument `example.md` contains:

```markdown
+++
title = "New Website"
+++

# Other markdown
```

…and	9.fs from 'node:fs/promises'
import {frontmatter)
)import {fromMarkdown} from 'mdast-util-from-markdown'
import {frontmatterFromMarkdown, frontmatterToMarkdown} from 'mdast-util-Z"'
import {toMarkdown} from 'mdast-util-to-markdown'

const doc = await fs.readFile('example.md')

const tree = fromMarkdown(doc
['yaml', 'toml'])],
  mdastExtensions: [frontmatterFromMarkdown(['yaml', 'toml'])]
})

console.log(tree)

const out = toMarkdowOn(tree, {extensions: [frontmatterToMarkdown(['yaml', 'toml'])]})

console.log(o
0 (positional info removed for brevity):

```js
{
  type: 'root',
  children: [
    {type: 'toml', value: 'title = "New Website"'},
    {
      type: 'heading',
      depth: 1,
      children: [{type: 'text', value: 'Other markdown'}]
    }
  ]
}
```

```8markdown
+++
title = "New Website"
+++

# Other markdown#2
[`frontmatterFromMarkdown`][api-frontmatter-from-markdown] and
[`frontmatterToMarkdown`][api-frontmatter-to-markdown].
There i2s no default export.

### `frontmatterFromMarkdown$7
[`mdast-util-from-markdown`][mdast-util-from-markdown]?optional19Adast-util-from-markdown`
([`FromMarkdownExtension`][from-markdown
ToMarkdown$3
[`mdast-util-to-markdown`][mdast-util-to-markdown]?optional19dast-util-to-markdown`
([`ToMarkdownExtension`][to-markdown-extension]).

### `Info`

Structure of marker or fence (TypeScript  Same as [`Info` from `1
,`][micromark-info].

### `Matter`

StructureSame as [`Matter` from `1
`][micromark-matter].3Same as [`Options` from `1
3`][micromark-options].

## Syntax

See [Syntax in `1
l`][syntax].

## Syntax tree

The following interfaces are added to **[mdast][]** by this utility.

### Nodesother nodes are not enabled by default, but when passing options
> to enable them, they work the same as YAML.

#### `YAML`

```idl
interface YAML <: Literal {
  type: "yaml"
}
```

**YAML** (**[Literal][dfn-literal]**) represents a collection of metadata for
the document in the YAML data serialization language.

**YAML** can be used where **[frontmatter][dfn-frontmatter-content]** content
is expected.
Its content is represented by its `value` field.

For example, the following markdown:

```markdown
---
foo: bar
---
```

Yields:

```js
{type: 'yaml', value: 'foo: bar'}
```

### Content model

#### `FrontmatterContent`

```idl
type FrontmatterContent = YAML
```

**Frontmatter** content represent out-of-band information about the document.

If frontmatter is present, it must be limited to one node in the
*[tree][term-tree]*, and can only exist as a *[head][term-head]*.

#### `FdlowContent` (frontmatter)

```idl
type FlowContentFrontmatter = FrontmatterContent | FlowContent
```zand [`Options`][api-options].

The YAML node type is supported in `@types/mdast` by default.
To add other node types, register them by adding them to
`FrontmatterContentMap`:

```ts
import type {Literal} from 'mdast'

interface Toml extends Literal {
  type: 'toml'
}

declare module 'mdast' {
  interface FrontmatterContentMap {
    // Allow using TOML nodes defined by `mdast-uti.
    toml: Toml
  }
}
```4 S!(`utility works with `mdast-util-from-markdown` version 2+ and
`mdast-util-to-markdown` version 2+!T2"2
`][1
&]
    — micromark extension to parse"3C][contributing] in [`syntax-tree/.github`][health] for
ways to get 
#7*"j$7*"$D*"7%,*%%1P"%2P".&P"&#P"'(syntax-tree/unistW(=)K(
*.(2healtho+syntax-tree/.github(%syntax-tree)Bsyntax-treeR)9syntax-tree)(mdasto+syntax-tree/mdast

[remark*">+dast-util-from-markdown+*"m-markdown

[mdast-util-to-markdown+*to-markdown*92
**Y+infoo+)#info

[micromark-mattero+)#matter

[micromark-optionso+)#options

[syntaxo+)#syntax

[dfn-literalo+%syntax-tree/mdast#literal

[term-treeo+"syntax-tree/unist#tree

[term-heado+&syntax-tree/unist#head

[from-markdown+ *"m-markdown#extension

[to-markdown+ *to-markdown#options

[dfn-frontmatter-content]: #frontmattercontent

[api-frontmatter-from-markdown]: #frontmatterfrommarkdowno,$to-markdown]: #frontmattertomarkdownq,Kc W	x '100644 index.d.ts oՆ;s"100644 index.js  p:}$X=fG40000 lib hܘU+Yk100644 license 97#V}n-ƟO^100644 package.json 7z'Cy100644 readme.md 0f /uOvX	D@6WSx_ export { gfmAutolinkLiteralFromMarkdown, gfmAutolinkLiteralToMarkdown } from "./lib/index.js";
}##xb export {
  gfmAutolinkLiteralFromMarkdown,
  gfmAutolinkLiteralToMarkdown
} from './lib/index.js'
#0xJ 100644 index.d.ts ҽUL<T>'fwYKy.-100644 index.js w$ݑN4/y"C+:B}/x/**
 * Create an extension for `mdast-util-from-markdown` to enable GFM autolink
 * literals in markdown.
 *
 * @returns {FromMarkdownExtension}
 *   Extension for `mdast-util-to-markdown` to enable GFM autolink literals.
 */
export function gfmAutolinkLiteralFromMarkdown(): FromMarkdownExtension;
/**
 * Create an extension for `mdast-util-to-markdown` to enable GFM autolink
 * literals in markdown.
 *
 * @returns {ToMarkdownExtension}
 *   Extension for `mdast-util-to-markdown` to enable GFM autolink literals.
 */
export function gfmAutolinkLiteralToMarkdown(): ToMarkdownExtension;
import type { Extension as FromMarkdownExtension } from 'mdast-util-from-markdown';
import type { Options as ToMarkdownExtension } from 'mdast-util-to-markdown';
}mx5/**
 * @import {RegExpMatchObject, ReplaceFunction} from 'mdast-util-find-and-replace'
 * @import {CompileContext, Extension as FromMarkdownExtension, Handle as FromMarkdownHandle, Transform as FromMarkdownTransform} from 'mdast-util-from-markdown'
 * @import {ConstructName, Options as ToMarkdownExtension} from 'mdast-util-to-markdown'
 * @import {Link, PhrasingContent} from 'mdast'
 */

import {ccount} from 'ccount'
import {ok as assert} from 'devlop'
import {unicodePunctuation, unicodeWhitespace} from 'micromark-util-character'
import {findAndReplace} from 'mdast-util-find-and-replace'

/** @type {ConstructName} */
const inConstruct = 'phrasing'
/** @type {Array<ConstructName>} */
const notInConstruct = ['autolink', 'link', 'image', 'label']

/**
 * Create an extension for `mdast-util-from-markdown` to enable GFM autolink
 * literals in markdown.
 *
 * @returns {FromMarkdownExtension}
 *   Extension for `mdast-util-to-markdown` to enable GFM autolink literals.
 */
export function gfmAutolinkLiteralFromMarkdown() {
  return {
    transforms: [transformGfmAutolinkLiterals],
    enter: {
      literalAutolink: enterLiteralAutolink,
      literalAutolinkEmail: enterLiteralAutolinkValue,
      literalAutolinkHttp: enterLiteralAutolinkValue,
      literalAutolinkWww: enterLiteralAutolinkValue
    },
    exit: {
      literalAutolink: exitLiteralAutolink,
      literalAutolinkEmail: exitLiteralAutolinkEmail,
      literalAutolinkHttp: exitLiteralAutolinkHttp,
      literalAutolinkWww: exitLiteralAutolinkWww
    }
  }
}

/**
 * Create an extension for `mdast-util-to-markdown` to enable GFM autolink
 * literals in markdown.
 *
 * @returns {ToMarkdownExtension}
 *   Extension for `mdast-util-to-markdown` to enable GFM autolink literals.
 */
export function gfmAutolinkLiteralToMarkdown() {
  return {
    unsafe: [
      {
        character: '@',
        before: '[+\\-.\\w]',
        after: '[\\-.\\w]',
        inConstruct,
        notInConstruct
      },
      {
        character: '.',
        before: '[Ww]',
        after: '[\\-.\\w]',
        inConstruct,
        notInConstruct
      },
      {
        character: ':',
        before: '[ps]',
        after: '\\/',
        inConstruct,
        notInConstruct
      }
    ]
  }
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function enterLiteralAutolink(token) {
  this.enter({type: 'link', title: null, url: '', children: []}, token)
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function enterLiteralAutolinkValue(token) {
  this.config.enter.autolinkProtocol.call(this, token)
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function exitLiteralAutolinkHttp(token) {
  this.config.exit.autolinkProtocol.call(this, token)
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function exitLiteralAutolinkWww(token) {
  this.config.exit.data.call(this, token)
  const node = this.stack[this.stack.length - 1]
  assert(node.type === 'link')
  node.url = 'http://' + this.sliceSerialize(token)
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function exitLiteralAutolinkEmail(token) {
  this.config.exit.autolinkEmail.call(this, token)
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function exitLiteralAutolink(token) {
  this.exit(token)
}

/** @type {FromMarkdownTransform} */
function transformGfmAutolinkLiterals(tree) {
  findAndReplace(
    tree,
    [
      [/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi, findUrl],
      [/(?<=^|\s|\p{P}|\p{S})([-.\w+]+)@([-\w]+(?:\.[-\w]+)+)/gu, findEmail]
    ],
    {ignore: ['link', 'linkReference']}
  )
}

/**
 * @type {ReplaceFunction}
 * @param {string} _
 * @param {string} protocol
 * @param {string} domain
 * @param {string} path
 * @param {RegExpMatchObject} match
 * @returns {Array<PhrasingContent> | Link | false}
 */
// eslint-disable-next-line max-params
function findUrl(_, protocol, domain, path, match) {
  let prefix = ''

  // Not an expected previous character.
  if (!previous(match)) {
    return false
  }

  // Treat `www` as part of the domain.
  if (/^w/i.test(protocol)) {
    domain = protocol + domain
    protocol = ''
    prefix = 'http://'
  }

  if (!isCorrectDomain(domain)) {
    return false
  }

  const parts = splitUrl(domain + path)

  if (!parts[0]) return false

  /** @type {Link} */
  const result = {
    type: 'link',
    title: null,
    url: prefix + protocol + parts[0],
    children: [{type: 'text', value: protocol + parts[0]}]
  }

  if (parts[1]) {
    return [result, {type: 'text', value: parts[1]}]
  }

  return result
}

/**
 * @type {ReplaceFunction}
 * @param {string} _
 * @param {string} atext
 * @param {string} label
 * @param {RegExpMatchObject} match
 * @returns {Link | false}
 */
function findEmail(_, atext, label, match) {
  if (
    // Not an expected previous character.
    !previous(match, true) ||
    // Label ends in not allowed character.
    /[-\d_]$/.test(label)
  ) {
    return false
  }

  return {
    type: 'link',
    title: null,
    url: 'mailto:' + atext + '@' + label,
    children: [{type: 'text', value: atext + '@' + label}]
  }
}

/**
 * @param {string} domain
 * @returns {boolean}
 */
function isCorrectDomain(domain) {
  const parts = domain.split('.')

  if (
    parts.length < 2 ||
    (parts[parts.length - 1] &&
      (/_/.test(parts[parts.length - 1]) ||
        !/[a-zA-Z\d]/.test(parts[parts.length - 1]))) ||
    (parts[parts.length - 2] &&
      (/_/.test(parts[parts.length - 2]) ||
        !/[a-zA-Z\d]/.test(parts[parts.length - 2])))
  ) {
    return false
  }

  return true
}

/**
 * @param {string} url
 * @returns {[string, string | undefined]}
 */
function splitUrl(url) {
  const trailExec = /[!"&'),.:;<>?\]}]+$/.exec(url)

  if (!trailExec) {
    return [url, undefined]
  }

  url = url.slice(0, trailExec.index)

  let trail = trailExec[0]
  let closingParenIndex = trail.indexOf(')')
  const openingParens = ccount(url, '(')
  let closingParens = ccount(url, ')')

  while (closingParenIndex !== -1 && openingParens > closingParens) {
    url += trail.slice(0, closingParenIndex + 1)
    trail = trail.slice(closingParenIndex + 1)
    closingParenIndex = trail.indexOf(')')
    closingParens++
  }

  return [url, trail]
}

/**
 * @param {RegExpMatchObject} match
 * @param {boolean | null | undefined} [email=false]
 * @returns {boolean}
 */
function previous(match, email) {
  const code = match.input.charCodeAt(match.index - 1)

  return (
    (match.index === 0 ||
      unicodeWhitespace(code) ||
      unicodePunctuation(code)) &&
    // If it’s an email, the previous character should not be a slash.
    (!email || code !== 47)
  )
}
x {
  "name": "micromark-extension-gfm-task-list-item",
  "version": "2.1.0",
  "description": "micromark extension to support GFM task list items",
  "license": "MIT",
  "keywords": [
    "micromark",
    "micromark-extension",
    "task",
    "list",
    "item",
    "check",
    "checkbox",
    "todo",
    "gfm",
    "markdown",
    "unified"
  ],
  "repository": "micromark/micromark-extension-gfm-task-list-item",
  "bugs": "https://github.com/micromark/micromark-extension-gfm-task-list-item/issues",
  "funding": {
    "type": "opencollective",
    "url": "https://opencollective.com/unified"
  },
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "sideEffects": false,
  "type": "module",
  "files": [
    "dev/",
    "lib/",
    "index.d.ts",
    "index.js"
  ],
  "exports": {
    "development": "./dev/index.js",
    "default": "./index.js"
  },
  "dependencies": {
    "devlop": "^1.0.0",
    "micromark-factory-space": "^2.0.0",
    "micromark-util-character": "^2.0.0",
    "micromark-util-symbol": "^2.0.0",
    "micromark-util-types": "^2.0.0"
  },
  "devDependencies": {
    "@types/node": "^20.0.0",
    "c8": "^10.0.0",
    "control-pictures": "^2.0.0",
    "create-gfm-fixtures": "^1.0.0",
    "micromark": "^4.0.0",
    "micromark-build": "^2.0.0",
    "prettier": "^3.0.0",
    "remark-cli": "^12.0.0",
    "remark-preset-wooorm": "^10.0.0",
    "type-coverage": "^2.0.0",
    "typescript": "^5.0.0",
    "xo": "^0.58.0"
  },
  "scripts": {
    "prepack": "npm run build && npm run format",
    "build": "tsc --build --clean && tsc --build && type-coverage && micromark-build",
    "format": "remark . -qfo && prettier . -w --log-level warn && xo --fix",
    "test-api-prod": "node --conditions production test/index.js",
    "test-api-dev": "node --conditions development test/index.js",
    "test-api": "npm run test-api-dev && npm run test-api-prod",
    "test-coverage": "c8 --100 --reporter lcov npm run test-api",
    "test": "npm run build && npm run format && npm run test-coverage"
  },
  "prettier": {
    "bracketSpacing": false,
    "semi": false,
    "singleQuote": true,
    "tabWidth": 2,
    "trailingComma": "none",
    "useTabs": false
  },
  "remarkConfig": {
    "plugins": [
      "remark-preset-wooorm"
    ]
  },
  "typeCoverage": {
    "atLeast": 100,
    "detail": true,
    "ignoreCatch": true,
    "strict": true
  },
  "xo": {
    "prettier": true,
    "rules": {
      "unicorn/no-this-assignment": "off",
      "unicorn/prefer-string-replace-all": "off"
    },
    "overrides": [
      {
        "files": [
          "**/*.d.ts"
        ],
        "rules": {
          "@typescript-eslint/array-type": [
            "error",
            {
              "default": "generic"
            }
          ],
          "@typescript-eslint/ban-types": [
            "error",
            {
              "extendDefaults": true
            }
          ],
          "@typescript-eslint/consistent-type-definitions": [
            "error",
            "interface"
          ]
        }
      },
      {
        "files": [
          "test/**/*.js"
        ],
        "rules": {
          "no-await-in-loop": "off"
        }
      }
    ]
  }
}
u6mxc{
  "name": "mdast-util-gfm-autolink-literal",
  "version": "2.0.1",
  "description": "mdast extension to parse and serialize GFM autolink literal-unist",
    "mdast",
    "mdast-util",
    "util",
    "utility",
    "markdown",
    "markup",
    "autolink",
    "auto",
    "link",
    "literal",
    "url",
    "raw",
    "gfm"
  ],
  "repository": "syntax-tree/mdast-util-gfm-autolink-literal",
  "+syntax-tree/mdast-util-gfm-autolink-literal=$exports": "./index.js",
  "files": [B6d)mdast": "^4.0.0",
    "ccount": "^2.0.0", dast-util-find-and-replace": "^3332!hast-util-to-html": "^9.0.0",
    "mdast-util-from-markdown": "^2.0.0",
    "mdast-util-to-hast": "^13.0.0",
    "mdast-util-to	-markdown<autolink-literalZ9G
'"test/**/*.js"
 0,	5prefer-a	!code-point": "off"
    }
  }
}
Ox54# micromark-extension-gfm-autolink-literal

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

[micromark][] extensions to support GFM [literal autolinks][spec].

## Contents

* [What is this?](#what-is-this)
* [When to use this](#when-to-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`gfmAutolinkLiteral()`](#gfmautolinkliteral)
  * [`gfmAutolinkLiteralHtml()`](#gfmautolinkliteralhtml)
* [Bugs](#bugs)
* [Authoring](#authoring)
* [HTML](#html)
* [CSS](#css)
* [Syntax](#syntax)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package contains extensions that add support for the extra autolink syntax
enabled by GFM to [`micromark`][micromark].

GitHub employs different algorithms to autolink: one at parse time and one at
transform time (similar to how @mentions are done at transform time).
This difference can be observed because character references and escapes are
handled differently.
But also because issues/PRs/comments omit (perhaps by accident?) the second
algorithm for `www.`, `http://`, and `https://` links (but not for email links).

As this is a syntax extension, it focuses on the first algorithm.
The second algorithm is performed by
[`mdast-util-gfm-autolink-literal`][mdast-util-gfm-autolink-literal].
The `html` part of this micromark extension does not operate on an AST and hence
can’t perform the second algorithm.

The implementation of autolink literal on github.com is currently buggy.
The bugs have been reported on [`cmark-gfm`][cmark-gfm].
This micromark extension matches github.com except for its bugs.

## When to use this

This project is useful when you want to support autolink literals in markdown.

You can use these extensions when you are working with [`micromark`][micromark].
To support all GFM features, use
[`micromark-extension-gfm`][micromark-extension-gfm] instead.

When you need a syntax tree, combine this package with
[`mdast-util-gfm-autolink-literal`][mdast-util-gfm-autolink-literal].

All these packages are used in [`remark-gfm`][remark-gfm], which focusses on
making it easier to transform content by abstracting these internals away.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install micromark-extension-gfm-autolink-literal
```

In Deno with [`esm.sh`][esmsh]:

```js
import {gfmAutolinkLiteral, gfmAutolinkLiteralHtml} from 'https://esm.sh/micromark-extension-gfm-autolink-literal@2'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {gfmAutolinkLiteral, gfmAutolinkLiteralHtml} from 'https://esm.sh/micromark-extension-gfm-autolink-literal@2?bundle'
</script>
```

## Use

```js
import {micromark} from 'micromark'
import {
  gfmAutolinkLiteral,
  gfmAutolinkLiteralHtml
} from 'micromark-extension-gfm-autolink-literal'

const output = micromark('Just a URL: www.example.com.', {
  extensions: [gfmAutolinkLiteral()],
  htmlExtensions: [gfmAutolinkLiteralHtml()]
})

console.log(output)
```

Yields:

```html
<p>Just a URL: <a href="http://www.example.com">www.example.com</a>.</p>
```

## API

This package exports the identifiers
[`gfmAutolinkLiteral`][api-gfm-autolink-literal] and
[`gfmAutolinkLiteralHtml`][api-gfm-autolink-literal-html].
There is no default export.

The export map supports the [`development` condition][development].
Run `node --conditions development module.js` to get instrumented dev code.
Without this condition, production code is loaded.

### `gfmAutolinkLiteral()`

Create an extension for `micromark` to support GitHub autolink literal
syntax.

###### Parameters

Extension for `micromark` that can be passed in `extensions` to enable GFM
autolink literal syntax ([`Extension`][micromark-extension]).

### `gfmAutolinkLiteralHtml()`

Create an HTML extension for `micromark` to support GitHub autolink literal
when serializing to HTML.

###### Parameters

Extension for `micromark` that can be passed in `htmlExtensions` to support
GitHub autolink literal when serializing to HTML
([`HtmlExtension`][micromark-html-extension]).

## Bugs

GitHub’s own algorithm to parse autolink literals contains three bugs.
A smaller bug is left unfixed in this project for consistency.
Two main bugs are not present in this project.
The issues relating to autolink literals are:

* [GFM autolink extension (`www.`, `https?://` parts): links don’t work when
  after bracket](https://github.com/github/cmark-gfm/issues/278)\
  fixed here ✅
* [GFM autolink extension (`www.` part): uppercase does not match on
  issues/PRs/comments](https://github.com/github/cmark-gfm/issues/280)\
  fixed here ✅
* [GFM autolink extension (`www.` part): the word `www`
  matches](https://github.com/github/cmark-gfm/issues/279)\
  present here for consistency

## Authoring

It is recommended to use labels, either with a resource or a definition,
instead of autolink literals, as those allow relative URLs and descriptive
text to explain the URL in prose.

## HTML

GFM autolink literals relate to the `<a>` element in HTML.
See [*§ 4.5.1 The `a` element*][html-a] in the HTML spec for more info.
When an email autolink is used, the string `mailto:` is prepended when
generating the `href` attribute of the hyperlink.
When a www autolink is used, the string `http://` is prepended.

## CSS

As hyperlinks are the fundamental thing that makes the web, you will most
definitely have CSS for `a` elements already.
The same CSS can be used for autolink literals, too.

GitHub itself does not apply interesting CSS to autolink literals.
For any link, it currently (June 2022) [uses][css]:

```css
a {
  background-color: transparent;
  color: #58a6ff;
  text-decoration: none;
}

a:active,
a:hover {
  outline-width: 0;
}

a:hover {
  text-decoration: underline;
}

a:not([href]) {
  color: inherit;
  text-decoration: none;
}
```

## Syntax

Autolink literals form with, roughly, the following BNF:

```bnf
gfm_autolink_literal ::= gfm_protocol_autolink | gfm_www_autolink | gfm_email_autolink

; Restriction: the code before must be `www_autolink_before`.
; Restriction: the code after `.` must not be eof.
www_autolink ::= 3('w' | 'W') '.' [domain [path]]
www_autolink_before ::= eof | eol | space_or_tab | '(' | '*' | '_' | '[' | ']' | '~'

; Restriction: the code before must be `http_autolink_before`.
; Restriction: the code after the protocol must be `http_autolink_protocol_after`.
http_autolink ::= ('h' | 'H') 2('t' | 'T') ('p' | 'P') ['s' | 'S'] ':' 2'/' domain [path]
http_autolink_before ::= byte - ascii_alpha
http_autolink_protocol_after ::= byte - eof - eol - ascii_control - unicode_whitespace - ode_punctuation

; Restriction: the code before must be `email_autolink_before`.
; Restriction: `ascii_digit` may not occur in the last label part of the label.
email_autolink ::= 1*('+' | '-' | '.' | '_' | ascii_alphanumeric) '@' 1*(1*label_segment l_dot_cont) 1*label_segment
email_autolink_before ::= byte - ascii_alpha - '/'

; Restriction: `_` may not occur in the last two domain parts.
domain ::= 1*(url_ampt_cont | domain_punct_cont | '-' | byte - eof - ascii_control - ode_whitespace - unicode_punctuation)
; Restriction: must not be followed by `punct`.
domain_punct_cont ::= '.' | '_'
; Restriction: must not be followed by `char-ref`.
url_ampt_cont ::= '&'

; Restriction: a counter `balance = 0` is increased for every `(`, and decreased for every `)`.
; Restriction: `)` must not be `paren_at_end`.
path ::= 1*(url_ampt_cont | path_punctuation_cont | '(' | ')' | byte - eof - eol - space_or_tab)
; Restriction: must not be followed by `punct`.
path_punctuation_cont ::= trailing_punctuation - '<'
; Restriction: must be followed by `punct` and `balance` must be less than `0`.
paren_at_end ::= ')'

label_segment ::= label_dash_underscore_cont | ascii_alpha | ascii_digit
; Restriction: if followed by `punct`, the whole email autolink is invalid.
label_dash_underscore_cont ::= '-' | '_'
; Restriction: must not be followed by `punct`.
label_dot_cont ::= '.'

punct ::= *trailing_punctuation ( byte - eof - eol - space_or_tab - '<' )
char_ref ::= *ascii_alpha ';' path_end
trailing_punctuation ::= '!' | '"' | '\'' | ')' | '*' | ',' | '.' | ':' | ';' | '<' | '?' | '_' | '~'
```

The grammar for GFM autolink literal is very relaxed: basically anything
except for whitespace is allowed after a prefix.
To use whitespace characters and otherwise impossible characters, in URLs,
you can use percent encoding:

```markdown
https://example.com/alpha%20bravo
```

Yields:

```html
<p><a href="https://example.com/alpha%20bravo">https://example.com/alpha%20bravo</a></p>
```

There are several cases where incorrect encoding of URLs would, in other
languages, result in a parse error.
In markdown, there are no errors, and URLs are normalized.
In addition, many characters are percent encoded
([`sanitizeUri`][micromark-util-sanitize-uri]).
For example:

```markdown
www.a👍b%
```

Yields:

```html
<p><a href="http://www.a%F0%9F%91%8Db%25">www.a👍b%</a></p>
```

There is a big difference between how www and protocol literals work
compared to how email literals work.
The first two are done when parsing, and work like anything else in
markdown.
But email literals are handled afterwards: when everything is parsed, we
look back at the events to figure out if there were email addresses.
This particularly affects how they interleave with character escapes and
character references.

## Types

This package is fully typed with [TypeScript][].
It exports no additional types.

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-extension-gfm-autolink-literal@^2`, compatible with Node.js 16.

This package works with `micromark` version `3` and later.

## Security

This package is safe.
Unlike other links in CommonMark, which allow arbitrary protocols, this
construct always produces safe links.

## Related

* [`micromark-extension-gfm`][micromark-extension-gfm]
  — support all of GFM
* [`mdast-util-gfm-autolink-literal`][mdast-util-gfm-autolink-literal]
  — support all of GFM in mdast
* [`mdast-util-gfm`][mdast-util-gfm]
  — support all of GFM in mdast
* [`remark-gfm`][remark-gfm]
  — support all of GFM in remark

## Contribute

See [`contributing.md` in `micromark/.github`][contributing] for ways to get
started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organization, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/micromark/micromark-extension-gfm-autolink-literal/workflows/main/badge.svg

[build]: https://github.com/micromark/micromark-extension-gfm-autolink-literal/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark-extension-gfm-autolink-literal.svg

[coverage]: https://codecov.io/github/micromark/micromark-extension-gfm-autolink-literal

[downloads-badge]: https://img.shields.io/npm/dm/micromark-extension-gfm-autolink-literal.svg

[downloads]: https://www.npmjs.com/package/micromark-extension-gfm-autolink-literal

[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-extension-gfm-autolink-literal

[size]: https://bundlejs.com/?q=micromark-extension-gfm-autolink-literal

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[collective]: https://opencollective.com/unified

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/micromark/micromark/discussions

[npm]: https://docs.npmjs.com/cli/install

[esmsh]: https://esm.sh

[license]: license

[author]: https://wooorm.com

[contributing]: https://github.com/micromark/.github/blob/main/contributing.md

[support]: https://github.com/micromark/.github/blob/main/support.md

[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[typescript]: https://www.typescriptlang.org

[development]: https://nodejs.org/api/packages.html#packages_resolving_user_conditions

[micromark]: https://github.com/micromark/micromark

[micromark-extension-gfm]: https://github.com/micromark/micromark-extension-gfm

[micromark-util-sanitize-uri]: https://github.com/micromark/micromark/tree/main/packages/micromark-util-sanitize-uri

[micromark-extension]: https://github.com/micromark/micromark#syntaxextension

[micromark-html-extension]: https://github.com/micromark/micromark#htmlextension

[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm

[mdast-util-gfm-autolink-literal]: https://github.com/syntax-tree/mdast-util-gfm-autolink-literal

[remark-gfm]: https://github.com/remarkjs/remark-gfm

[spec]: https://github.github.com/gfm/#autolinks-extension-

[html-a]: https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element

[css]: https://github.com/sindresorhus/github-markdown-css

[cmark-gfm]: https://github.com/github/cmark-gfm

[api-gfm-autolink-literal]: #gfmautolinkliteral

[api-gfm-autolink-literal-html]: #gfmautolinkliteralhtml
	Yx|kO# (*Cdast][] extensions to parse and serialize [GFM][] autolink literalsjFromMarkdown0frommarkdown)
  * [`gfmAutolinkLiteralToMarkdownLtomarkdown)
* [HTML](#html)
* [Syntax](#syntax)
* [Syntax tree](#syntax-tree9ntwoy!
syntax in markdown to [mdast][].
These extensions plug into
[`mdast-util-from-markdown`][mdast-util-from-markdown] (to support parsing
GFM autolinks in markdown into a syntax tree) and
[`mdast-util-to-markdown`][mdast-util-to-markdown] (to support seria1lizing
GFM autolinks in syntax trees to markdown)p`@mentions`W#e corresponding 
[`,(8`][extension] is a syntax extension,
it can only performFtree extension `gfmAutolinkLiteralFromMarkdown` from this package can
{?, and as they are combined, both are done.

## When to use this8
`mdast-util-from-markdown` and `mdast-util-to-markdown` already.

When working with `mdast-util-from-markdown`, you must combi
with
[`,(i`][extension].

When you don’t need a syntax tree, you can use [`micromark`][micromark]
directly with `,(`.

W&syntax trees and want all of GFM, use
6)" instead	!
focusses on ?	:
internals away.

This utility does not handle how markdown is turned to HTML.
That’s done by [`mdast-util-to-hast`][mdast-util-to-hast]	t(#
GAFromMarkdown, gfmAutolinkLiteralToMarkdown} from 'https://esm.sh/(
iAFromMarkdown, gfmAutolinkLiteralToMarkdown} from 'https://esm.sh/("Say our document `example.md` contains:

```markdown
www.example.com, https://example.com, and contact@example.com.
```

…andS our module `example.js` looks as follows:

```js
import fs from 'node:fs/promises'O
} from ',(6'
import {fromMarkdown} from 'mdast-util-from-markdown5FromMarkdown,
  gfmAutolinkLiteralToMarkdown
} from '('
import {toMarkdown} from 'mdast-util-to-markdown'

const doc = await fs.readFile('example.md')

const tree = fromMarkdown(doco,mdastFFromMarkdown()]
})

console.log(tree)

const out = toMarkdown(tree, {eToMarkdown()]})

console.log(out)
```

…now running `node example.js` yields (positional info removed for brevity):

```js
{
  type: 'root',
  children: [
    {
      type: 'paragraph',
      children: [
        {
          type: 'link',
          title: null,
          url: 'http://www.example.com',
          children: [{type: 'text', value: 'www.example.com'}]
        },
        {type: 'text', value: ', '},
        {
          type: 'link',
          title: null,
          url: 'https://example.com',
          children: [{type: 'text', value: 'https://example.com'}]
        },
        {type: 'text', value: ', and '},
        {
          type: 'link',
          title: null,
          url: 'mailto:contact@example.com',
          children: [{type: 'text', value: 'contact@example.com'}]
        },
        {type: 'text', value: '.'}
      ]
    }
  ]
}
```

```markdown
[www.exaTmple.com](http://www.example.com), <https://example.com>, and <contact@example.com>.<GFromMarkdown`]a5-from-markdownToMarkdown`]a5-to-markdown FromMarkdownA[`mdast-util-from-markdown`][mdast-util-from-markdown]
to enable Oin markdown.

###### Returns

Extension for `mdast-util-to-markdown` to enable )
([`FromMarkdownExtension`][from-markdown&
ToMarkdown=[`mdast-util-to-markdown`][mdast-util-to-markdown] to
enable Oin markdown.

###### Returns

Extension for `mdast-util-to-markdown` to enable 
([`ToMarkdownExtension`][to-markdown-extension]).

## HTML

This utility does not handle how markdown is turned to HTML.
ThatTs done by [`mdast-util-to-hast`][mdast-util-to-hast].

## Syntax

See [Syntax in `,(`][syntax].

## Syntax tree

There are no interfaces added to **[mdast][]** by this utility, as it reuses
the existing **[Link][dfn-link]** interface%Adoes not export additional types.

The `Link` type of the mdast nodes is exposed from `@types/mdast`.

## Compatibility

Projecp&(~'(utility works with `mdast-util-from-markdown` version 2+ and
`mdast-util-to-markdown` version 2+.

## Related

* [`remarkjs/rem)-remark plugin to support GFM
* [`syntax-tree/8)(Zame but all of GFM (autolink literals, footnotes, strikethrough, tables,
  tasklists)
* [`O+2`][extension]
  — 	to parse )'C][contributing] in [`syntax-tree/.github`][health] for
ways to get *73++73++D3+`,,3.,1(`, -+(r-((.#(r.(3unist/=1Kesmsh]: https://esm.sh]1102health3".github/0%3.github/blob/HEADo003.github/blob/HEAD0'3,.github/blob/HEAD/code-of-conduct.md

[mdast3'3Ofrom-markdown3-&from-markdown

[mdast-util-to-markdown3- to-markdown

[mdast-util-to-hast3-to-hast

[re15G4	micromark3O+

[@32,"syntax3O+2
#syntax

[/2github.com/gfm/

[dfn-link3'#link

[from-markdown?3 3%from-markdown#extension

[to-markdown?3 3to-markdown#options5from-markdown5frommarkdown5to-markdown5tomarkdown
I!x '100644 index.d.ts I[,CG}Tِ
L;K100644 index.js E+<k̼eawqW40000 lib s}
$tЋyh+f:˽100644 license Zbv8f,Q)100644 package.json ɗ%Pܟ^&:̴Sg~100644 readme.md yŹр؆.XP&X-x-export {gfmFootnoteFromMarkdown, gfmFootnoteToMarkdown} from './lib/index.js'

export interface ToMarkdownOptions {
  // To do: next major: change default.
  /**
   * Use a blank line for the first line of footnote definitions
   * (`boolean`, default: `false`).
   */
  firstLineBlank?: boolean | null | undefined
}

declare module 'mdast-util-to-markdown' {
  interface ConstructNameMap {
    /**
     * Footnote definition.
     *
     * ```markdown
     * > | [^a]: B.
     *     ^^^^^^^^
     * ```
     */
    footnoteDefinition: 'footnoteDefinition'

    /**
     * Footnote reference.
     *
     * ```markdown
     * > | A[^b].
     *      ^^^^
     * ```
     */
    footnoteReference: 'footnoteReference'
  }
}
 MEx // Note: extra types exported from `index.d.ts`.
export {gfmFootnoteFromMarkdown, gfmFootnoteToMarkdown} from './lib/index.js'
.Cxt 100644 index.d.ts 2޿H:2Zc100644 index.d.ts.map /BCj<*<3;`100644 index.js 0r7:2
=f/+8x~/**
 * Create an extension for `mdast-util-from-markdown` to enable GFM footnotes
 * in markdown.
 *
 * @returns {FromMarkdownExtension}
 *   Extension for `mdast-util-from-markdown`.
 */
export function gfmFootnoteFromMarkdown(): FromMarkdownExtension;
/**
 * Create an extension for `mdast-util-to-markdown` to enable GFM footnotes
 * in markdown.
 *
 * @param {ToMarkdownOptions | null | undefined} [options]
 *   Configuration (optional).
 * @returns {ToMarkdownExtension}
 *   Extension for `mdast-util-to-markdown`.
 */
export function gfmFootnoteToMarkdown(options?: ToMarkdownOptions | null | undefined): ToMarkdownExtension;
import type { Extension as FromMarkdownExtension } from 'mdast-util-from-markdown';
import type { ToMarkdownOptions } from 'mdast-util-gfm-footnote';
import type { Options as ToMarkdownExtension } from 'mdast-util-to-markdown';
//# sourceMappingURL=index.d.ts.map;@bx {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AA0HA;;;;;;GAMG;AACH,2CAHa,qBAAqB,CAkBjC;AAED;;;;;;;;GAQG;AACH,gDALW,iBAAiB,GAAG,IAAI,GAAG,SAAS,GAElC,mBAAmB,CAiD/B;wDApMS,0BAA0B;uCACA,yBAAyB;oDAKnD,wBAAwB"}1J.x/**
 * @import {
 *   CompileContext,
 *   Extension as FromMarkdownExtension,
 *   Handle as FromMarkdownHandle
 * } from 'mdast-util-from-markdown'
 * @import {ToMarkdownOptions} from 'mdast-util-gfm-footnote'
 * @import {
 *   Handle as ToMarkdownHandle,
 *   Map,
 *   Options as ToMarkdownExtension
 * } from 'mdast-util-to-markdown'
 * @import {FootnoteDefinition, FootnoteReference} from 'mdast'
 */

import {ok as assert} from 'devlop'
import {normalizeIdentifier} from 'micromark-util-normalize-identifier'

footnoteReference.peek = footnoteReferencePeek

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function enterFootnoteCallString() {
  this.buffer()
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function enterFootnoteCall(token) {
  this.enter({type: 'footnoteReference', identifier: '', label: ''}, token)
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function enterFootnoteDefinitionLabelString() {
  this.buffer()
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function enterFootnoteDefinition(token) {
  this.enter(
    {type: 'footnoteDefinition', identifier: '', label: '', children: []},
    token
  )
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function exitFootnoteCallString(token) {
  const label = this.resume()
  const node = this.stack[this.stack.length - 1]
  assert(node.type === 'footnoteReference')
  node.identifier = normalizeIdentifier(
    this.sliceSerialize(token)
  ).toLowerCase()
  node.label = label
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function exitFootnoteCall(token) {
  this.exit(token)
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function exitFootnoteDefinitionLabelString(token) {
  const label = this.resume()
  const node = this.stack[this.stack.length - 1]
  assert(node.type === 'footnoteDefinition')
  node.identifier = normalizeIdentifier(
    this.sliceSerialize(token)
  ).toLowerCase()
  node.label = label
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function exitFootnoteDefinition(token) {
  this.exit(token)
}

/** @type {ToMarkdownHandle} */
function footnoteReferencePeek() {
  return '['
}

/**
 * @type {ToMarkdownHandle}
 * @param {FootnoteReference} node
 */
function footnoteReference(node, _, state, info) {
  const tracker = state.createTracker(info)
  let value = tracker.move('[^')
  const exit = state.enter('footnoteReference')
  const subexit = state.enter('reference')
  value += tracker.move(
    state.safe(state.associationId(node), {after: ']', before: value})
  )
  subexit()
  exit()
  value += tracker.move(']')
  return value
}

/**
 * Create an extension for `mdast-util-from-markdown` to enable GFM footnotes
 * in markdown.
 *
 * @returns {FromMarkdownExtension}
 *   Extension for `mdast-util-from-markdown`.
 */
export function gfmFootnoteFromMarkdown() {
  return {
    enter: {
      gfmFootnoteCallString: enterFootnoteCallString,
      gfmFootnoteCall: enterFootnoteCall,
      gfmFootnoteDefinitionLabelString: enterFootnoteDefinitionLabelString,
      gfmFootnoteDefinition: enterFootnoteDefinition
    },
    exit: {
      gfmFootnoteCallString: exitFootnoteCallString,
      gfmFootnoteCall: exitFootnoteCall,
      gfmFootnoteDefinitionLabelString: exitFootnoteDefinitionLabelString,
      gfmFootnoteDefinition: exitFootnoteDefinition
    }
  }
}

/**
 * Create an extension for `mdast-util-to-markdown` to enable GFM footnotes
 * in markdown.
 *
 * @param {ToMarkdownOptions | null | undefined} [options]
 *   Configuration (optional).
 * @returns {ToMarkdownExtension}
 *   Extension for `mdast-util-to-markdown`.
 */
export function gfmFootnoteToMarkdown(options) {
  // To do: next major: change default.
  let firstLineBlank = false

  if (options && options.firstLineBlank) {
    firstLineBlank = true
  }

  return {
    handlers: {footnoteDefinition, footnoteReference},
    // This is on by default already.
    unsafe: [{character: '[', inConstruct: ['label', 'phrasing', 'reference']}]
  }

  /**
   * @type {ToMarkdownHandle}
   * @param {FootnoteDefinition} node
   */
  function footnoteDefinition(node, _, state, info) {
    const tracker = state.createTracker(info)
    let value = tracker.move('[^')
    const exit = state.enter('footnoteDefinition')
    const subexit = state.enter('label')
    value += tracker.move(
      state.safe(state.associationId(node), {before: value, after: ']'})
    )
    subexit()

    value += tracker.move(']:')

    if (node.children && node.children.length > 0) {
      tracker.shift(4)

      value += tracker.move(
        (firstLineBlank ? '\n' : ' ') +
          state.indentLines(
            state.containerFlow(node, tracker.current()),
            firstLineBlank ? mapAll : mapExceptFirst
          )
      )
    }

    exit()

    return value
  }
}

/** @type {Map} */
function mapExceptFirst(line, index, blank) {
  return index === 0 ? line : mapAll(line, index, blank)
}

/** @type {Map} */
function mapAll(line, index, blank) {
  return (blank ? '' : '    ') + line
}
Y:Ix^{
  "name": "micromark-extension-gfm-footnote",
  "version": "2.1.0",
  "description": "micromark extension to support GFM footnotes",
  "license": "MIT",
  "keywords": [
    "micromark",
    "micromark-extension",
    "gfm",
    "footnote",
    "note",
    "definition",
    "markdown",
    "unified"
  ],
  "repository": "micromark/micromark-extension-gfm-footnote",
  "bugs": "https://github.com/micromark/micromark-extension-gfm-footnote/issues",
  "funding": {
    "type": "opencollective",
    "url": "https://opencollective.com/unified"
  },
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "sideEffects": false,
  "type": "module",
  "files": [
    "dev/",
    "lib/",
    "index.d.ts",
    "index.js"
  ],
  "exports": {
    "development": "./dev/index.js",
    "default": "./index.js"
  },
  "dependencies": {
    "devlop": "^1.0.0",
    "micromark-core-commonmark": "^2.0.0",
    "micromark-factory-space": "^2.0.0",
    "micromark-util-character": "^2.0.0",
    "micromark-util-normalize-identifier": "^2.0.0",
    "micromark-util-sanitize-uri": "^2.0.0",
    "micromark-util-symbol": "^2.0.0",
    "micromark-util-types": "^2.0.0"
  },
  "devDependencies": {
    "@types/node": "^20.0.0",
    "c8": "^10.0.0",
    "create-gfm-fixtures": "^1.0.0",
    "micromark": "^4.0.0",
    "micromark-build": "^2.0.0",
    "prettier": "^3.0.0",
    "remark-cli": "^12.0.0",
    "remark-preset-wooorm": "^10.0.0",
    "type-coverage": "^2.0.0",
    "typescript": "^5.0.0",
    "xo": "^0.58.0"
  },
  "scripts": {
    "prepack": "npm run build && npm run format",
    "build": "tsc --build --clean && tsc --build && type-coverage && micromark-build",
    "format": "remark . -qfo && prettier . -w --log-level warn && xo --fix",
    "test-api-prod": "node --conditions production test/index.js",
    "test-api-dev": "node --conditions development test/index.js",
    "test-api": "npm run test-api-dev && npm run test-api-prod",
    "test-coverage": "c8 --100 --reporter lcov npm run test-api",
    "test": "npm run build && npm run format && npm run test-coverage"
  },
  "prettier": {
    "bracketSpacing": false,
    "semi": false,
    "singleQuote": true,
    "tabWidth": 2,
    "trailingComma": "none",
    "useTabs": false
  },
  "remarkConfig": {
    "plugins": [
      "remark-preset-wooorm"
    ]
  },
  "typeCoverage": {
    "atLeast": 100,
    "detail": true,
    "ignoreCatch": true,
    "strict": true
  },
  "xo": {
    "prettier": true,
    "rules": {
      "logical-assignment-operators": "off",
      "unicorn/no-this-assignment": "off",
      "unicorn/prefer-at": "off",
      "unicorn/prefer-string-replace-all": "off"
    },
    "overrides": [
      {
        "files": [
          "**/*.d.ts"
        ],
        "rules": {
          "@typescript-eslint/array-type": [
            "error",
            {
              "default": "generic"
            }
          ],
          "@typescript-eslint/ban-types": [
            "error",
            {
              "extendDefaults": true
            }
          ],
          "@typescript-eslint/consistent-type-definitions": [
            "error",
            "interface"
          ]
        }
      },
      {
        "files": [
          "test/**/*.js"
        ],
        "rules": {
          "no-await-in-loop": 0
        }
      }
    ]
  }
}
ʔ0lx{$Mtsyntax-tree/mdast-utilqY@types/mdast": "^4.0.0",
    "devlop": "^1.1.0",
    "mdast-util-from-markdown": "^2.0.0",
    "mdast-util-to-markdown": "^2.0.97Bscription": "mdast extension to parse and serialize GFM footnotes"/2!
	 b1P#60.0"
  },
  "exports": "./index.js,
    "lib/"
  ]gkeywords": [gfmmarkup",
    "mdast-util",
    "mdast",
    "note",
    "unist",
    "utility",
    "util"
  ],
  "license": "MIT",
  "name": "
mdast-utila6syntax-tree/mdast-utilascripts": {B",
    "format": "remark --frail --output --quiet -- . && prettier --log-level warn --write -- . && xo --fix",
    "test-api-de'.js/:ؓ~	&	3xo": {

    ],	-r

    }
  }
}
Ⱥx2# mdast-util-gfm-footnote

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

[mdast][] extensions to parse and serialize [GFM][] footnotes.

## Contents

* [What is this?](#what-is-this)
* [When to use this](#when-to-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`gfmFootnoteFromMarkdown()`](#gfmfootnotefrommarkdown)
  * [`gfmFootnoteToMarkdown(options?)`](#gfmfootnotetomarkdownoptions)
  * [`ToMarkdownOptions`](#tomarkdownoptions)
* [HTML](#html)
* [Syntax](#syntax)
* [Syntax tree](#syntax-tree)
  * [Nodes](#nodes)
  * [Content model](#content-model)
* [Types](#types)
* [Compatibility](#compatibility)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package contains two extensions that add support for GFM footnote syntax
in markdown to [mdast][].
These extensions plug into
[`mdast-util-from-markdown`][mdast-util-from-markdown] (to support parsing
footnotes in markdown into a syntax tree) and
[`mdast-util-to-markdown`][mdast-util-to-markdown] (to support serializing
footnotes in syntax trees to markdown).

GFM footnotes were [announced September 30, 2021][post] but are not specified.
Their implementation on github.com is currently buggy.
The bugs have been reported on [`cmark-gfm`][cmark-gfm].

## When to use this

You can use these extensions when you are working with
`mdast-util-from-markdown` and `mdast-util-to-markdown` already.

When working with `mdast-util-from-markdown`, you must combine this package
with [`micromark-extension-gfm-footnote`][micromark-extension-gfm-footnote].

When you don’t need a syntax tree, you can use [`micromark`][micromark]
directly with `micromark-extension-gfm-footnote`.

When you are working with syntax trees and want all of GFM, use
[`mdast-util-gfm`][mdast-util-gfm] instead.

All these packages are used [`remark-gfm`][remark-gfm], which
focusses on making it easier to transform content by abstracting these
internals away.

This utility does not handle how markdown is turned to HTML.
That’s done by [`mdast-util-to-hast`][mdast-util-to-hast].
If your content is not in English, you should configure that utility.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install mdast-util-gfm-footnote
```

In Deno with [`esm.sh`][esmsh]:

```js
import {gfmFootnoteFromMarkdown, gfmFootnoteToMarkdown} from 'https://esm.sh/mdast-util-gfm-footnote@2'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {gfmFootnoteFromMarkdown, gfmFootnoteToMarkdown} from 'https://esm.sh/mdast-util-gfm-footnote@2?bundle'
</script>
```

## Use

Say our document `example.md` contains:

```markdown
In the Solar System, Mercury[^mercury] and Venus[^venus] have very small tilts.

[^mercury]:
    **Mercury** is the first planet from the Sun and the smallest
    in the Solar System.

[^venus]:
    **Venus** is the second planet from
    the Sun.
```

…and our module `example.js` looks as follows:

```js
import fs from 'node:fs/promises'
import {fromMarkdown} from 'mdast-util-from-markdown'
import {
  gfmFootnoteFromMarkdown,
  gfmFootnoteToMarkdown
} from 'mdast-util-gfm-footnote'
import {toMarkdown} from 'mdast-util-to-markdown'
import {gfmFootnote} from 'micromark-extension-gfm-footnote'

const value = await fs.readFile('example.md', 'utf8')

const tree = fromMarkdown(value, {
  extensions: [gfmFootnote()],
  mdastExtensions: [gfmFootnoteFromMarkdown()]
})

console.log(tree)

const result = toMarkdown(tree, {
  extensions: [gfmFootnoteToMarkdown({firstLineBlank: true})]
})

console.log(result)
```

…now running `node example.js` yields (positional info removed for brevity):

```js
{
  type: 'root',
  children: [
    {
      type: 'paragraph',
      children: [
        {type: 'text', value: 'In the Solar System, Mercury'},
        {type: 'footnoteReference', identifier: 'mercury', label: 'mercury'},
        {type: 'text', value: ' and Venus'},
        {type: 'footnoteReference', identifier: 'venus', label: 'venus'},
        {type: 'text', value: ' have very small tilts.'}
      ]
    },
    {
      type: 'footnoteDefinition',
      identifier: 'mercury',
      label: 'mercury',
      children: [
        {
          type: 'paragraph',
          children: [
            {type: 'strong', children: [{type: 'text', value: 'Mercury'}]},
            {
              type: 'text',
              value:
                ' is the first planet from the Sun and the smallest\n' +
                'in the Solar System.'
            }
          ]
        }
      ]
    },
    {
      type: 'footnoteDefinition',
      identifier: 'venus',
      label: 'venus',
      children: [
        {
          type: 'paragraph',
          children: [
            {type: 'strong', children: [{type: 'text', value: 'Venus'}]},
            {type: 'text', value: ' is the second planet from\nthe Sun.'}
          ]
        }
      ]
    }
  ]
}
```

```markdown
In the Solar System, Mercury[^mercury] and Venus[^venus] have very small tilts.

[^mercury]:
    **Mercury** is the first planet from the Sun and the smallest
    in the Solar System.

[^venus]:
    **Venus** is the second planet from
    the Sun.
```

## API

This package exports the identifiers
[`gfmFootnoteFromMarkdown`][api-gfmfootnotefrommarkdown] and
[`gfmFootnoteToMarkdown`][api-gfmfootnotetomarkdown].
There is no default export.
It exports the type [`ToMarkdownOptions`][api-to-markdown-options].

### `gfmFootnoteFromMarkdown()`

Create an extension for
[`mdast-util-from-markdown`][mdast-util-from-markdown]
to enable GFM footnotes in markdown.

###### Returns

Extension for `mdast-util-from-markdown`
([`FromMarkdownExtension`][frommarkdownextension]).

### `gfmFootnoteToMarkdown(options?)`

Create an extension for
[`mdast-util-to-markdown`][mdast-util-to-markdown]
to enable GFM footnotes in markdown.

###### Parameters

* `options` ([`ToMarkdownOptions`][api-to-markdown-options], optional)
  — configuration

###### Returns

Extension for `mdast-util-to-markdown`
([`ToMarkdownExtension`][tomarkdownextension]).

### `ToMarkdownOptions`

Configuration (TypeScript type).

###### Fields

* `firstLineBlank` (`boolean`, default: `false`)
  — use a blank line for the first line of footnote definitions

## HTML

This utility does not handle how markdown is turned to HTML.
That’s done by [`mdast-util-to-hast`][mdast-util-to-hast].
If your content is not in English, you should configure that utility.

## Syntax

See [Syntax in `micromark-extension-gfm-footnote`][syntax].

## Syntax tree

The following interfaces are added to **[mdast][]** by this utility.

### Nodes

#### `FootnoteDefinition`

```idl
interface FootnoteDefinition <: Parent {
  type: 'footnoteDefinition'
  children: [FlowContent]
}

FootnoteDefinition includes Association
```

**FootnoteDefinition** (**[Parent][dfn-parent]**) represents content relating
to the document that is outside its flow.

**FootnoteDefinition** can be used where **[flow][dfn-flow-content]** content
is expected.
Its content model is also **[flow][dfn-flow-content]** content.

**FootnoteDefinition** includes the mixin
**[Association][dfn-mxn-association]**.

**FootnoteDefinition** should be associated with
**[FootnoteReferences][dfn-footnote-reference]**.

For example, the following markdown:

```markdown
[^alpha]: bravo and charlie.
```

Yields:

```js
{
  type: 'footnoteDefinition',
  identifier: 'alpha',
  label: 'alpha',
  children: [{
    type: 'paragraph',
    children: [{type: 'text', value: 'bravo and charlie.'}]
  }]
}
```

#### `FootnoteReference`

```idl
interface FootnoteReference <: Node {
  type: 'footnoteReference'
}

FootnoteReference includes Association
```

**FootnoteReference** (**[Node][dfn-node]**) represents a marker through
association.

**FootnoteReference** can be used where
**[phrasing][dfn-phrasing-content]** content is expected.
It has no content model.

**FootnoteReference** includes the mixin **[Association][dfn-mxn-association]**.

**FootnoteReference** should be associated with a
**[FootnoteDefinition][dfn-footnote-definition]**.

For example, the following markdown:

```markdown
[^alpha]
```

Yields:

```js
{
  type: 'footnoteReference',
  identifier: 'alpha',
  label: 'alpha'
}
```

### Content model

#### `FlowContent` (GFM footnotes)

```idl
type FlowContentGfm = FootnoteDefinition | FlowContent
```

#### `PhrasingContent` (GFM footnotes)

```idl
type PhrasingContentGfm = FootnoteReference | PhrasingContent
```

## Types

This package is fully typed with [TypeScript][].
It does not export additional types.

The `FootnoteDefinition` and `FootnoteReference` types of the mdast nodes are
exposed from `@types/mdast`.

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`mdast-util-gfm-footnote@^2`, compatible with Node.js 16.

## Related

* [`remark-gfm`][remark-gfm]
  — remark plugin to support GFM
* [`mdast-util-gfm`][mdast-util-gfm]
  — same but all of GFM (autolink literals, footnotes, strikethrough, tables,
  tasklists)
* [`micromark-extension-gfm-footnote`][micromark-extension-gfm-footnote]
  — micromark extension to parse GFM footnotes

## Contribute

See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for
ways to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organization, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[api-gfmfootnotefrommarkdown]: #gfmfootnotefrommarkdown

[api-gfmfootnotetomarkdown]: #gfmfootnotetomarkdownoptions

[api-to-markdown-options]: #tomarkdownoptions

[author]: https://wooorm.com

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[build]: https://github.com/syntax-tree/mdast-util-gfm-footnote/actions

[build-badge]: https://github.com/syntax-tree/mdast-util-gfm-footnote/workflows/main/badge.svg

[chat]: https://github.com/syntax-tree/unist/discussions

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[cmark-gfm]: https://github.com/github/cmark-gfm

[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md

[collective]: https://opencollective.com/unified

[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md

[coverage]: https://codecov.io/github/syntax-tree/mdast-util-gfm-footnote

[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-gfm-footnote.svg

[dfn-flow-content]: #flowcontent-gfm-footnotes

[dfn-footnote-definition]: #footnotedefinition

[dfn-footnote-reference]: #footnotereference

[dfn-mxn-association]: https://github.com/syntax-tree/mdast#association

[dfn-node]: https://github.com/syntax-tree/unist#node

[dfn-parent]: https://github.com/syntax-tree/mdast#parent

[dfn-phrasing-content]: #phrasingcontent-gfm-footnotes

[downloads]: https://www.npmjs.com/package/mdast-util-gfm-footnote

[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-gfm-footnote.svg

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[frommarkdownextension]: https://github.com/syntax-tree/mdast-util-from-markdown#extension

[gfm]: https://github.github.com/gfm/

[health]: https://github.com/syntax-tree/.github

[license]: license

[mdast]: https://github.com/syntax-tree/mdast

[mdast-util-from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown

[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm

[mdast-util-to-hast]: https://github.com/syntax-tree/mdast-util-to-hast

[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown

[micromark]: https://github.com/micromark/micromark

[micromark-extension-gfm-footnote]: https://github.com/micromark/micromark-extension-gfm-footnote

[npm]: https://docs.npmjs.com/cli/install

[post]: https://github.blog/changelog/2021-09-30-footnotes-now-supported-in-markdown-fields/

[remark-gfm]: https://github.com/remarkjs/remark-gfm

[size]: https://bundlejs.com/?q=mdast-util-gfm-footnote

[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-gfm-footnote

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[support]: https://github.com/syntax-tree/.github/blob/main/support.md

[syntax]: https://github.com/micromark/micromark-extension-gfm-footnote#syntax

[tomarkdownextension]: https://github.com/syntax-tree/mdast-util-to-markdown#options

[typescript]: https://www.typescriptlang.org
èx '100644 index.d.ts ӶyS0p`o깘100644 index.js `o#;@~d40000 lib ^^kCݳ2100644 license 97#V}n-ƟO^100644 package.json Mc6.D:ֱ&100644 readme.md ђΦ \3Oǻ2w|t$YǴx{export {
  gfmStrikethroughFromMarkdown,
  gfmStrikethroughToMarkdown
} from './lib/index.js'

// Add custom data tracked to turn a syntax tree into markdown.
declare module 'mdast-util-to-markdown' {
  interface ConstructNameMap {
    /**
     * Whole strikethrough.
     *
     * ```markdown
     * > | ~~a~~
     *     ^^^^^
     * ```
     */
    strikethrough: 'strikethrough'
  }
}
*i{Lx {// Note: extra types in `index.d.ts`.
export {
  gfmStrikethroughFromMarkdown,
  gfmStrikethroughToMarkdown
} from './lib/index.js'
.xJ 100644 index.d.ts zo-ж,=׶dE6100644 index.js cqdV ",^r{qBx./**
 * Create an extension for `mdast-util-from-markdown` to enable GFM
 * strikethrough in markdown.
 *
 * @returns {FromMarkdownExtension}
 *   Extension for `mdast-util-from-markdown` to enable GFM strikethrough.
 */
export function gfmStrikethroughFromMarkdown(): FromMarkdownExtension
/**
 * Create an extension for `mdast-util-to-markdown` to enable GFM
 * strikethrough in markdown.
 *
 * @returns {ToMarkdownExtension}
 *   Extension for `mdast-util-to-markdown` to enable GFM strikethrough.
 */
export function gfmStrikethroughToMarkdown(): ToMarkdownExtension
export type Delete = import('mdast').Delete
export type CompileContext = import('mdast-util-from-markdown').CompileContext
export type FromMarkdownExtension = import('mdast-util-from-markdown').Extension
export type FromMarkdownHandle = import('mdast-util-from-markdown').Handle
export type ConstructName = import('mdast-util-to-markdown').ConstructName
export type ToMarkdownHandle = import('mdast-util-to-markdown').Handle
export type ToMarkdownExtension = import('mdast-util-to-markdown').Options
V͂Axe
/**
 * @typedef {import('mdast').Delete} Delete
 *
 * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext
 * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension
 * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle
 *
 * @typedef {import('mdast-util-to-markdown').ConstructName} ConstructName
 * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle
 * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
 */

/**
 * List of constructs that occur in phrasing (paragraphs, headings), but cannot
 * contain strikethrough.
 * So they sort of cancel each other out.
 * Note: could use a better name.
 *
 * Note: keep in sync with: <https://github.com/syntax-tree/mdast-util-to-markdown/blob/8ce8dbf/lib/unsafe.js#L14>
 *
 * @type {Array<ConstructName>}
 */
const constructsWithoutStrikethrough = [
  'autolink',
  'destinationLiteral',
  'destinationRaw',
  'reference',
  'titleQuote',
  'titleApostrophe'
]

handleDelete.peek = peekDelete

/**
 * Create an extension for `mdast-util-from-markdown` to enable GFM
 * strikethrough in markdown.
 *
 * @returns {FromMarkdownExtension}
 *   Extension for `mdast-util-from-markdown` to enable GFM strikethrough.
 */
export function gfmStrikethroughFromMarkdown() {
  return {
    canContainEols: ['delete'],
    enter: {strikethrough: enterStrikethrough},
    exit: {strikethrough: exitStrikethrough}
  }
}

/**
 * Create an extension for `mdast-util-to-markdown` to enable GFM
 * strikethrough in markdown.
 *
 * @returns {ToMarkdownExtension}
 *   Extension for `mdast-util-to-markdown` to enable GFM strikethrough.
 */
export function gfmStrikethroughToMarkdown() {
  return {
    unsafe: [
      {
        character: '~',
        inConstruct: 'phrasing',
        notInConstruct: constructsWithoutStrikethrough
      }
    ],
    handlers: {delete: handleDelete}
  }
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function enterStrikethrough(token) {
  this.enter({type: 'delete', children: []}, token)
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function exitStrikethrough(token) {
  this.exit(token)
}

/**
 * @type {ToMarkdownHandle}
 * @param {Delete} node
 */
function handleDelete(node, _, state, info) {
  const tracker = state.createTracker(info)
  const exit = state.enter('strikethrough')
  let value = tracker.move('~~')
  value += state.containerPhrasing(node, {
    ...tracker.current(),
    before: value,
    after: '~'
  })
  value += tracker.move('~~')
  exit()
  return value
}

/** @type {ToMarkdownHandle} */
function peekDelete() {
  return '~'
}
2x	+{
  "name": "mdast-util-gfm-strikethrough",
  "version": "2.0.0",
  "description": "mdast extension to parse and serialize GFM strikethrough",
  "license": "MIT",
  "keywords": [
    "unist",
    "mdast",
    "mdast-util",
    "util",
    "utility",
    "markdown",
    "markup",
    "strikethrough",
    "strike",
    "through",
    "del",
    "delete",
    "deletion",
    "gfm"
  ],
  "repository": "syntax-tree/mdast-util-gfm-strikethrough",
  "bugs": "https://github.com/syntax-tree/mdast-util-gfm-strikethrough/issues",
  "funding": {
    "type": "opencollective",
    "url": "https://opencollective.com/unified"
  },
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "sideEffects": false,
  "type": "module",
  "exports": "./index.js",
  "files": [
    "lib/",
    "index.d.ts",
    "index.js"
  ],
  "dependencies": {
    "@types/mdast": "^4.0.0",
    "mdast-util-from-markdown": "^2.0.0",
    "mdast-util-to-markdown": "^2.0.0"
  },
  "devDependencies": {
    "@types/node": "^20.0.0",
    "c8": "^8.0.0",
    "micromark-extension-gfm-strikethrough": "^2.0.0",
    "prettier": "^2.0.0",
    "remark-cli": "^11.0.0",
    "remark-preset-wooorm": "^9.0.0",
    "type-coverage": "^2.0.0",
    "typescript": "^5.0.0",
    "unist-util-remove-position": "^5.0.0",
    "xo": "^0.54.0"
  },
  "scripts": {
    "prepack": "npm run build && npm run format",
    "build": "tsc --build --clean && tsc --build && type-coverage",
    "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
    "test-api-prod": "node --conditions production test.js",
    "test-api-dev": "node --conditions development test.js",
    "test-api": "npm run test-api-dev && npm run test-api-prod",
    "test-coverage": "c8 --100 --reporter lcov npm run test-api",
    "test": "npm run build && npm run format && npm run test-coverage"
  },
  "prettier": {
    "bracketSpacing": false,
    "semi": false,
    "singleQuote": true,
    "tabWidth": 2,
    "trailingComma": "none",
    "useTabs": false
  },
  "remarkConfig": {
    "plugins": [
      "remark-preset-wooorm"
    ]
  },
  "typeCoverage": {
    "atLeast": 100,
    "detail": true,
    "ignoreCatch": true,
    "strict": true
  },
  "xo": {
    "overrides": [
      {
        "files": [
          "**/*.ts"
        ],
        "rules": {
          "@typescript-eslint/consistent-type-definitions": "off"
        }
      }
    ],
    "prettier": true
  }
}
ȂǺx&# mdast-util-gfm-strikethrough

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

[mdast][] extensions to parse and serialize [GFM][] strikethrough.

## Contents

*   [What is this?](#what-is-this)
*   [When to use this](#when-to-use-this)
*   [Install](#install)
*   [Use](#use)
*   [API](#api)
    *   [`gfmStrikethroughFromMarkdown()`](#gfmstrikethroughfrommarkdown)
    *   [`gfmStrikethroughToMarkdown()`](#gfmstrikethroughtomarkdown)
*   [HTML](#html)
*   [Syntax](#syntax)
*   [Syntax tree](#syntax-tree)
    *   [Nodes](#nodes)
    *   [Content model](#content-model)
*   [Types](#types)
*   [Compatibility](#compatibility)
*   [Related](#related)
*   [Contribute](#contribute)
*   [License](#license)

## What is this?

This package contains two extensions that add support for GFM strikethrough
syntax in markdown to [mdast][].
These extensions plug into
[`mdast-util-from-markdown`][mdast-util-from-markdown] (to support parsing
strikethrough in markdown into a syntax tree) and
[`mdast-util-to-markdown`][mdast-util-to-markdown] (to support serializing
strikethrough in syntax trees to markdown).

## When to use this

You can use these extensions when you are working with
`mdast-util-from-markdown` and `mdast-util-to-markdown` already.

When working with `mdast-util-from-markdown`, you must combine this package
with [`micromark-extension-gfm-strikethrough`][extension].

When you don’t need a syntax tree, you can use [`micromark`][micromark]
directly with `micromark-extension-gfm-strikethrough`.

When you are working with syntax trees and want all of GFM, use
[`mdast-util-gfm`][mdast-util-gfm] instead.

All these packages are used [`remark-gfm`][remark-gfm], which
focusses on making it easier to transform content by abstracting these
internals away.

This utility does not handle how markdown is turned to HTML.
That’s done by [`mdast-util-to-hast`][mdast-util-to-hast].
If you want a different element, you should configure that utility.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install mdast-util-gfm-strikethrough
```

In Deno with [`esm.sh`][esmsh]:

```js
import {gfmStrikethroughFromMarkdown, gfmStrikethroughToMarkdown} from 'https://esm.sh/mdast-util-gfm-strikethrough@2'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {gfmStrikethroughFromMarkdown, gfmStrikethroughToMarkdown} from 'https://esm.sh/mdast-util-gfm-strikethrough@2?bundle'
</script>
```

## Use

Say our document `example.md` contains:

```markdown
*Emphasis*, **importance**, and ~~strikethrough~~.
```

…and our module `example.js` looks as follows:

```js
import fs from 'node:fs/promises'
import {gfmStrikethrough} from 'micromark-extension-gfm-strikethrough'
import {fromMarkdown} from 'mdast-util-from-markdown'
import {gfmStrikethroughFromMarkdown, gfmStrikethroughToMarkdown} from 'mdast-util-gfm-strikethrough'
import {toMarkdown} from 'mdast-util-to-markdown'

const doc = await fs.readFile('example.md')

const tree = fromMarkdown(doc, {
  extensions: [gfmStrikethrough()],
  mdastExtensions: [gfmStrikethroughFromMarkdown()]
})

console.log(tree)

const out = toMarkdown(tree, {extensions: [gfmStrikethroughToMarkdown()]})

console.log(out)
```

Now, running `node example` yields:

```js
{
  type: 'root',
  children: [
    {
      type: 'paragraph',
      children: [
        {type: 'emphasis', children: [{type: 'text', value: 'Emphasis'}]},
        {type: 'text', value: ', '},
        {type: 'strong', children: [{type: 'text', value: 'importance'}]},
        {type: 'text', value: ', and '},
        {type: 'delete', children: [{type: 'text', value: 'strikethrough'}]},
        {type: 'text', value: '.'}
      ]
    }
  ]
}
```

```markdown
*Emphasis*, **importance**, and ~~strikethrough~~.
```

## API

This package exports the identifiers
[`gfmStrikethroughFromMarkdown`][api-gfm-strikethrough-from-markdown] and
[`gfmStrikethroughToMarkdown`][api-gfm-strikethrough-to-markdown].
There is no default export.

### `gfmStrikethroughFromMarkdown()`

Create an extension for [`mdast-util-from-markdown`][mdast-util-from-markdown]
to enable GFM strikethrough in markdown.

###### Returns

Extension for `mdast-util-from-markdown` to enable GFM strikethrough
([`FromMarkdownExtension`][from-markdown-extension]).

### `gfmStrikethroughToMarkdown()`

Create an extension for [`mdast-util-to-markdown`][mdast-util-to-markdown] to
enable GFM strikethrough in markdown.

###### Returns

Extension for `mdast-util-to-markdown` to enable GFM strikethrough
([`ToMarkdownExtension`][to-markdown-extension]).

## HTML

This utility does not handle how markdown is turned to HTML.
That’s done by [`mdast-util-to-hast`][mdast-util-to-hast].
If you want a different element, you should configure that utility.

## Syntax

See [Syntax in `micromark-extension-gfm-strikethrough`][syntax].

## Syntax tree

The following interfaces are added to **[mdast][]** by this utility.

### Nodes

#### `Delete`

```idl
interface Delete <: Parent {
  type: 'delete'
  children: [TransparentContent]
}
```

**Delete** (**[Parent][dfn-parent]**) represents contents that are no longer
accurate or no longer relevant.

**Delete** can be used where **[phrasing][dfn-phrasing-content]**
content is expected.
Its content model is **[transparent][dfn-transparent-content]** content.

For example, the following markdown:

```markdown
~~alpha~~
```

Yields:

```js
{
  type: 'delete',
  children: [{type: 'text', value: 'alpha'}]
}
```

### Content model

#### `PhrasingContent` (GFM strikethrough)

```idl
type PhrasingContentGfm = Delete | PhrasingContent
```

## Types

This package is fully typed with [TypeScript][].
It does not export additional types.

The `Delete` type of the mdast node is exposed from `@types/mdast`.

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`mdast-util-gfm-strikethrough@^2`, compatible with Node.js 16.

This utility works with `mdast-util-from-markdown` version 2+ and
`mdast-util-to-markdown` version 2+.

## Related

*   [`remarkjs/remark-gfm`][remark-gfm]
    — remark plugin to support GFM
*   [`syntax-tree/mdast-util-gfm`][mdast-util-gfm]
    — same but all of GFM (autolink literals, footnotes, strikethrough, tables,
    tasklists)
*   [`micromark/micromark-extension-gfm-strikethrough`][extension]
    — micromark extension to parse GFM strikethrough

## Contribute

See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for
ways to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organization, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/syntax-tree/mdast-util-gfm-strikethrough/workflows/main/badge.svg

[build]: https://github.com/syntax-tree/mdast-util-gfm-strikethrough/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-gfm-strikethrough.svg

[coverage]: https://codecov.io/github/syntax-tree/mdast-util-gfm-strikethrough

[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-gfm-strikethrough.svg

[downloads]: https://www.npmjs.com/package/mdast-util-gfm-strikethrough

[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-gfm-strikethrough

[size]: https://bundlejs.com/?q=mdast-util-gfm-strikethrough

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[collective]: https://opencollective.com/unified

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/syntax-tree/unist/discussions

[npm]: https://docs.npmjs.com/cli/install

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[typescript]: https://www.typescriptlang.org

[license]: license

[author]: https://wooorm.com

[health]: https://github.com/syntax-tree/.github

[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md

[support]: https://github.com/syntax-tree/.github/blob/main/support.md

[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md

[gfm]: https://github.github.com/gfm/

[remark-gfm]: https://github.com/remarkjs/remark-gfm

[mdast]: https://github.com/syntax-tree/mdast

[dfn-transparent-content]: https://github.com/syntax-tree/mdast#transparentcontent

[mdast-util-from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown

[from-markdown-extension]: https://github.com/syntax-tree/mdast-util-from-markdown#extension

[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown

[to-markdown-extension]: https://github.com/syntax-tree/mdast-util-to-markdown#options

[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm

[mdast-util-to-hast]: https://github.com/syntax-tree/mdast-util-to-hast

[micromark]: https://github.com/micromark/micromark

[extension]: https://github.com/micromark/micromark-extension-gfm-strikethrough

[syntax]: https://github.com/micromark/micromark-extension-gfm-strikethrough#syntax

[dfn-parent]: https://github.com/syntax-tree/mdast#parent

[dfn-phrasing-content]: #phrasingcontent-gfm-strikethrough

[api-gfm-strikethrough-from-markdown]: #gfmstrikethroughfrommarkdown

[api-gfm-strikethrough-to-markdown]: #gfmstrikethroughtomarkdown
MeVx '100644 index.d.ts ̵6d)8x_m100644 index.js ?+G'{xaLEFvG+Y40000 lib wpjF/7b+ld100644 license 97#V}n-ƟO^100644 package.json ,{BTY8Y100644 readme.md $1s?,i&ilR>xexport type {Options} from './lib/index.js'

export {gfmTableFromMarkdown, gfmTableToMarkdown} from './lib/index.js'

// Add custom data tracked to turn markdown into a tree.
declare module 'mdast-util-from-markdown' {
  interface CompileData {
    /**
     * Whether we’re currently in a table.
     */
    inTable?: boolean | undefined
  }
}

// Add custom data tracked to turn a syntax tree into markdown.
declare module 'mdast-util-to-markdown' {
  interface ConstructNameMap {
    /**
     * Whole table.
     *
     * ```markdown
     * > | | a |
     *     ^^^^^
     * > | | - |
     *     ^^^^^
     * ```
     */
    table: 'table'

    /**
     * Table cell.
     *
     * ```markdown
     * > | | a |
     *     ^^^^^
     *   | | - |
     * ```
     */
    tableCell: 'tableCell'

    /**
     * Table row.
     *
     * ```markdown
     * > | | a |
     *     ^^^^^
     *   | | - |
     * ```
     */
    tableRow: 'tableRow'
  }
}

// Note: `Table` is exposed from `@types/mdast`.
xr // Note: types exposed from `index.d.ts`.
export {gfmTableFromMarkdown, gfmTableToMarkdown} from './lib/index.js'
/H(xJ 100644 index.d.ts u.L>p~ 4sb_&/100644 index.js XEshWmwx~/**
 * Create an extension for `mdast-util-from-markdown` to enable GFM tables in
 * markdown.
 *
 * @returns {FromMarkdownExtension}
 *   Extension for `mdast-util-from-markdown` to enable GFM tables.
 */
export function gfmTableFromMarkdown(): FromMarkdownExtension
/**
 * Create an extension for `mdast-util-to-markdown` to enable GFM tables in
 * markdown.
 *
 * @param {Options | null | undefined} [options]
 *   Configuration.
 * @returns {ToMarkdownExtension}
 *   Extension for `mdast-util-to-markdown` to enable GFM tables.
 */
export function gfmTableToMarkdown(
  options?: Options | null | undefined
): ToMarkdownExtension
export type InlineCode = import('mdast').InlineCode
export type Table = import('mdast').Table
export type TableCell = import('mdast').TableCell
export type TableRow = import('mdast').TableRow
export type MarkdownTableOptions = import('markdown-table').Options
export type CompileContext = import('mdast-util-from-markdown').CompileContext
export type FromMarkdownExtension = import('mdast-util-from-markdown').Extension
export type FromMarkdownHandle = import('mdast-util-from-markdown').Handle
export type ToMarkdownExtension = import('mdast-util-to-markdown').Options
export type ToMarkdownHandle = import('mdast-util-to-markdown').Handle
export type State = import('mdast-util-to-markdown').State
export type Info = import('mdast-util-to-markdown').Info
/**
 * Configuration.
 */
export type Options = {
  /**
   * Whether to add a space of padding between delimiters and cells (default:
   * `true`).
   */
  tableCellPadding?: boolean | null | undefined
  /**
   * Whether to align the delimiters (default: `true`).
   */
  tablePipeAlign?: boolean | null | undefined
  /**
   * Function to detect the length of table cell content, used when aligning
   * the delimiters between cells (optional).
   */
  stringLength?: MarkdownTableOptions['stringLength'] | null | undefined
}
ox/**
 * @typedef {import('mdast').InlineCode} InlineCode
 * @typedef {import('mdast').Table} Table
 * @typedef {import('mdast').TableCell} TableCell
 * @typedef {import('mdast').TableRow} TableRow
 *
 * @typedef {import('markdown-table').Options} MarkdownTableOptions
 *
 * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext
 * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension
 * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle
 *
 * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
 * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle
 * @typedef {import('mdast-util-to-markdown').State} State
 * @typedef {import('mdast-util-to-markdown').Info} Info
 */

/**
 * @typedef Options
 *   Configuration.
 * @property {boolean | null | undefined} [tableCellPadding=true]
 *   Whether to add a space of padding between delimiters and cells (default:
 *   `true`).
 * @property {boolean | null | undefined} [tablePipeAlign=true]
 *   Whether to align the delimiters (default: `true`).
 * @property {MarkdownTableOptions['stringLength'] | null | undefined} [stringLength]
 *   Function to detect the length of table cell content, used when aligning
 *   the delimiters between cells (optional).
 */

import {ok as assert} from 'devlop'
import {markdownTable} from 'markdown-table'
import {defaultHandlers} from 'mdast-util-to-markdown'

/**
 * Create an extension for `mdast-util-from-markdown` to enable GFM tables in
 * markdown.
 *
 * @returns {FromMarkdownExtension}
 *   Extension for `mdast-util-from-markdown` to enable GFM tables.
 */
export function gfmTableFromMarkdown() {
  return {
    enter: {
      table: enterTable,
      tableData: enterCell,
      tableHeader: enterCell,
      tableRow: enterRow
    },
    exit: {
      codeText: exitCodeText,
      table: exitTable,
      tableData: exit,
      tableHeader: exit,
      tableRow: exit
    }
  }
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function enterTable(token) {
  const align = token._align
  assert(align, 'expected `_align` on table')
  this.enter(
    {
      type: 'table',
      align: align.map(function (d) {
        return d === 'none' ? null : d
      }),
      children: []
    },
    token
  )
  this.data.inTable = true
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function exitTable(token) {
  this.exit(token)
  this.data.inTable = undefined
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function enterRow(token) {
  this.enter({type: 'tableRow', children: []}, token)
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function exit(token) {
  this.exit(token)
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function enterCell(token) {
  this.enter({type: 'tableCell', children: []}, token)
}

// Overwrite the default code text data handler to unescape escaped pipes when
// they are in tables.
/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function exitCodeText(token) {
  let value = this.resume()

  if (this.data.inTable) {
    value = value.replace(/\\([\\|])/g, replace)
  }

  const node = this.stack[this.stack.length - 1]
  assert(node.type === 'inlineCode')
  node.value = value
  this.exit(token)
}

/**
 * @param {string} $0
 * @param {string} $1
 * @returns {string}
 */
function replace($0, $1) {
  // Pipes work, backslashes don’t (but can’t escape pipes).
  return $1 === '|' ? $1 : $0
}

/**
 * Create an extension for `mdast-util-to-markdown` to enable GFM tables in
 * markdown.
 *
 * @param {Options | null | undefined} [options]
 *   Configuration.
 * @returns {ToMarkdownExtension}
 *   Extension for `mdast-util-to-markdown` to enable GFM tables.
 */
export function gfmTableToMarkdown(options) {
  const settings = options || {}
  const padding = settings.tableCellPadding
  const alignDelimiters = settings.tablePipeAlign
  const stringLength = settings.stringLength
  const around = padding ? ' ' : '|'

  return {
    unsafe: [
      {character: '\r', inConstruct: 'tableCell'},
      {character: '\n', inConstruct: 'tableCell'},
      // A pipe, when followed by a tab or space (padding), or a dash or colon
      // (unpadded delimiter row), could result in a table.
      {atBreak: true, character: '|', after: '[\t :-]'},
      // A pipe in a cell must be encoded.
      {character: '|', inConstruct: 'tableCell'},
      // A colon must be followed by a dash, in which case it could start a
      // delimiter row.
      {atBreak: true, character: ':', after: '-'},
      // A delimiter row can also start with a dash, when followed by more
      // dashes, a colon, or a pipe.
      // This is a stricter version than the built in check for lists, thematic
      // breaks, and setex heading underlines though:
      // <https://github.com/syntax-tree/mdast-util-to-markdown/blob/51a2038/lib/unsafe.js#L57>
      {atBreak: true, character: '-', after: '[:|-]'}
    ],
    handlers: {
      inlineCode: inlineCodeWithTable,
      table: handleTable,
      tableCell: handleTableCell,
      tableRow: handleTableRow
    }
  }

  /**
   * @type {ToMarkdownHandle}
   * @param {Table} node
   */
  function handleTable(node, _, state, info) {
    return serializeData(handleTableAsData(node, state, info), node.align)
  }

  /**
   * This function isn’t really used normally, because we handle rows at the
   * table level.
   * But, if someone passes in a table row, this ensures we make somewhat sense.
   *
   * @type {ToMarkdownHandle}
   * @param {TableRow} node
   */
  function handleTableRow(node, _, state, info) {
    const row = handleTableRowAsData(node, state, info)
    const value = serializeData([row])
    // `markdown-table` will always add an align row
    return value.slice(0, value.indexOf('\n'))
  }

  /**
   * @type {ToMarkdownHandle}
   * @param {TableCell} node
   */
  function handleTableCell(node, _, state, info) {
    const exit = state.enter('tableCell')
    const subexit = state.enter('phrasing')
    const value = state.containerPhrasing(node, {
      ...info,
      before: around,
      after: around
    })
    subexit()
    exit()
    return value
  }

  /**
   * @param {Array<Array<string>>} matrix
   * @param {Array<string | null | undefined> | null | undefined} [align]
   */
  function serializeData(matrix, align) {
    return markdownTable(matrix, {
      align,
      // @ts-expect-error: `markdown-table` types should support `null`.
      alignDelimiters,
      // @ts-expect-error: `markdown-table` types should support `null`.
      padding,
      // @ts-expect-error: `markdown-table` types should support `null`.
      stringLength
    })
  }

  /**
   * @param {Table} node
   * @param {State} state
   * @param {Info} info
   */
  function handleTableAsData(node, state, info) {
    const children = node.children
    let index = -1
    /** @type {Array<Array<string>>} */
    const result = []
    const subexit = state.enter('table')

    while (++index < children.length) {
      result[index] = handleTableRowAsData(children[index], state, info)
    }

    subexit()

    return result
  }

  /**
   * @param {TableRow} node
   * @param {State} state
   * @param {Info} info
   */
  function handleTableRowAsData(node, state, info) {
    const children = node.children
    let index = -1
    /** @type {Array<string>} */
    const result = []
    const subexit = state.enter('tableRow')

    while (++index < children.length) {
      // Note: the positional info as used here is incorrect.
      // Making it correct would be impossible due to aligning cells?
      // And it would need copy/pasting `markdown-table` into this project.
      result[index] = handleTableCell(children[index], node, state, info)
    }

    subexit()

    return result
  }

  /**
   * @type {ToMarkdownHandle}
   * @param {InlineCode} node
   */
  function inlineCodeWithTable(node, parent, state) {
    let value = defaultHandlers.inlineCode(node, parent, state)

    if (state.stack.includes('tableCell')) {
      value = value.replace(/\|/g, '\\$&')
    }

    return value
  }
}
k,,x<5{
  "name": "mdast-util-gfm-table",
  "version": "2.0A.dast extension to parse and serialize GFM tabl.?unist",
    "mdast",
    "mdast-util",
    "util",
    "utilityRmarkup",
    "table",
    "row",
    "column",
    "cell",
    "tabular",
    "gfm,syntax-tree/mdast-util-gfm-tablm"syntax-tree/mdast-util-gfm-tabl>exports": "./index.js0@types/mdast": "^4.0.0",_arkdown-table": "^3.0.0",
    "mdast-util-from-markdown": "^2.0.0",
    "mdast-util-to-markdownR8	 table21%9.0.0",
    "string-width": "^6G7unist-util-remove-position": "^5.0.0",
    "xo": "^0.54D6Po=A
9t,2b"off"?,
    "prettier": true
  }
}
x>j# mdast-util-gfm-table

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

[mdast][] extensions to parse and serialize [GFM][] tables.

## Contents

*   [What is this?](#what-is-this)
*   [When to use this](#when-to-use-this)
*   [Install](#install)
*   [Use](#use)
*   [API](#api)
    *   [`gfmTableFromMarkdown`](#gfmtablefrommarkdown)
    *   [`gfmTableToMarkdown(options?)`](#gfmtabletomarkdownoptions)
    *   [`Options`](#options)
*   [Examples](#examples)
    *   [Example: `stringLength`](#example-stringlength)
*   [HTML](#html)
*   [Syntax](#syntax)
*   [Syntax tree](#syntax-tree)
    *   [Nodes](#nodes)
    *   [Enumeration](#enumeration)
    *   [Content model](#content-model)
*   [Types](#types)
*   [Compatibility](#compatibility)
*   [Related](#related)
*   [Contribute](#contribute)
*   [License](#license)

## What is this?

This package contains two extensions that add support for GFM table syntax in
markdown to [mdast][].
These extensions plug into
[`mdast-util-from-markdown`][mdast-util-from-markdown] (to support parsing
tables in markdown into a syntax tree) and
[`mdast-util-to-markdown`][mdast-util-to-markdown] (to support serializing
tables in syntax trees to markdown).

## When to use this

You can use these extensions when you are working with
`mdast-util-from-markdown` and `mdast-util-to-markdown` already.

When working with `mdast-util-from-markdown`, you must combine this package
with [`micromark-extension-gfm-table`][extension].

When you don’t need a syntax tree, you can use [`micromark`][micromark]
directly with `micromark-extension-gfm-table`.

When you are working with syntax trees and want all of GFM, use
[`mdast-util-gfm`][mdast-util-gfm] instead.

All these packages are used [`remark-gfm`][remark-gfm], which
focusses on making it easier to transform content by abstracting these
internals away.

This utility does not handle how markdown is turned to HTML.
That’s done by [`mdast-util-to-hast`][mdast-util-to-hast].

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install mdast-util-gfm-table
```

In Deno with [`esm.sh`][esmsh]:

```js
import {gfmTableFromMarkdown, gfmTableToMarkdown} from 'https://esm.sh/mdast-util-gfm-table@2'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {gfmTableFromMarkdown, gfmTableToMarkdown} from 'https://esm.sh/mdast-util-gfm-table@2?bundle'
</script>
```

## Use

Say our document `example.md` contains:

```markdown
| a | b | c | d |
| - | :- | -: | :-: |
| e | f |
| g | h | i | j | k |
```

…and our module `example.js` looks as follows:

```js
import fs from 'node:fs/promises'
import {gfmTable} from 'micromark-extension-gfm-table'
import {fromMarkdown} from 'mdast-util-from-markdown'
import {gfmTableFromMarkdown, gfmTableToMarkdown} from 'mdast-util-gfm-table'
import {toMarkdown} from 'mdast-util-to-markdown'

const doc = await fs.readFile('example.md')

const tree = fromMarkdown(doc, {
  extensions: [gfmTable()],
  mdastExtensions: [gfmTableFromMarkdown()]
})

console.log(tree)

const out = toMarkdown(tree, {extensions: [gfmTableToMarkdown()]})

console.log(out)
```

…now running `node example.js` yields (positional info removed for brevity):

```js
{
  type: 'root',
  children: [
    {
      type: 'table',
      align: [null, 'left', 'right', 'center'],
      children: [
        {
          type: 'tableRow',
          children: [
            {type: 'tableCell', children: [{type: 'text', value: 'a'}]},
            {type: 'tableCell', children: [{type: 'text', value: 'b'}]},
            {type: 'tableCell', children: [{type: 'text', value: 'c'}]},
            {type: 'tableCell', children: [{type: 'text', value: 'd'}]}
          ]
        },
        {
          type: 'tableRow',
          children: [
            {type: 'tableCell', children: [{type: 'text', value: 'e'}]},
            {type: 'tableCell', children: [{type: 'text', value: 'f'}]}
          ]
        },
        {
          type: 'tableRow',
          children: [
            {type: 'tableCell', children: [{type: 'text', value: 'g'}]},
            {type: 'tableCell', children: [{type: 'text', value: 'h'}]},
            {type: 'tableCell', children: [{type: 'text', value: 'i'}]},
            {type: 'tableCell', children: [{type: 'text', value: 'j'}]},
            {type: 'tableCell', children: [{type: 'text', value: 'k'}]}
          ]
        }
      ]
    }
  ]
}
```

```markdown
| a | b  |  c |  d  |   |
| - | :- | -: | :-: | - |
| e | f  |    |     |   |
| g | h  |  i |  j  | k |
```

## API

This package exports the identifiers
[`gfmTableFromMarkdown`][api-gfm-table-from-markdown] and
[`gfmTableToMarkdown`][api-gfm-table-to-markdown].
There is no default export.

### `gfmTableFromMarkdown`

Create an extension for [`mdast-util-from-markdown`][mdast-util-from-markdown]
to enable GFM tables in markdown.

###### Returns

Extension for `mdast-util-from-markdown` to enable GFM tables
([`FromMarkdownExtension`][from-markdown-extension]).

### `gfmTableToMarkdown(options?)`

Create an extension for [`mdast-util-to-markdown`][mdast-util-to-markdown] to
enable GFM tables in markdown.

###### Parameters

*   `options` ([`Options`][api-options], optional)
    — configuration

###### Returns

Extension for `mdast-util-to-markdown` to enable GFM tables
([`ToMarkdownExtension`][to-markdown-extension]).

### `Options`

Configuration (TypeScript type).

###### Fields

*   `tableCellPadding` (`boolean`, default: `true`)
    — whether to add a space of padding between delimiters and cells
*   `tablePipeAlign` (`boolean`, default: `true`)
    — whether to align the delimiters
*   `stringLength` (`((value: string) => number)`, default: `s => s.length`)
    — function to detect the length of table cell content, used when aligning
    the delimiters between cells

## Examples

### Example: `stringLength`

It’s possible to align tables based on the visual width of cells.
First, let’s show the problem:

```js
import {gfmTable} from 'micromark-extension-gfm-table'
import {fromMarkdown} from 'mdast-util-from-markdown'
import {gfmTableFromMarkdown, gfmTableToMarkdown} from 'mdast-util-gfm-table'
import {toMarkdown} from 'mdast-util-to-markdown'

const doc = `| Alpha | Bravo |
| - | - |
| 中文 | Charlie |
| 👩‍❤️‍👩 | Delta |`

const tree = fromMarkdown(doc, {
  extensions: [gfmTable],
  mdastExtensions: [gfmTableFromMarkdown]
})

console.log(toMarkdown(tree, {extensions: [gfmTableToMarkdown()]}))
```

The above code shows how these utilities can be used to format markdown.
The output is as follows:

```markdown
| Alpha    | Bravo   |
| -------- | ------- |
| 中文       | Charlie |
| 👩‍❤️‍👩 | Delta   |
```

To improve the alignment of these full-width characters and emoji, pass a
`stringLength` function that calculates the visual width of cells.
One such algorithm is [`string-width`][string-width].
It can be used like so:

```diff
@@ -2,6 +2,7 @@ import {gfmTable} from 'micromark-extension-gfm-table'
 import {fromMarkdown} from 'mdast-util-from-markdown'
 import {gfmTableFromMarkdown, gfmTableToMarkdown} from 'mdast-util-gfm-table'
 import {toMarkdown} from 'mdast-util-to-markdown'
+import stringWidth from 'string-width'

 const doc = `| Alpha | Bravo |
 | - | - |
@@ -13,4 +14,8 @@ const tree = fromMarkdown(doc, {
   mdastExtensions: [gfmTableFromMarkdown()]
 })

-console.log(toMarkdown(tree, {extensions: [gfmTableToMarkdown()]}))
+console.log(
+  toMarkdown(tree, {
+    extensions: [gfmTableToMarkdown({stringLength: stringWidth})]
+  })
+)
```

The output of our code with these changes is as follows:

```markdown
| Alpha | Bravo   |
| ----- | ------- |
| 中文  | Charlie |
| 👩‍❤️‍👩    | Delta   |
```

## HTML

This utility does not handle how markdown is turned to HTML.
That’s done by [`mdast-util-to-hast`][mdast-util-to-hast].

## Syntax

See [Syntax in `micromark-extension-gfm-table`][syntax].

## Syntax tree

The following interfaces are added to **[mdast][]** by this utility.

### Nodes

#### `Table`

```idl
interface Table <: Parent {
  type: 'table'
  align: [alignType]?
  children: [TableContent]
}
```

**Table** (**[Parent][dfn-parent]**) represents two-dimensional data.

**Table** can be used where **[flow][dfn-flow-content]** content is expected.
Its content model is **[table][dfn-table-content]** content.

The *[head][term-head]* of the node represents the labels of the columns.

An `align` field can be present.
If present, it must be a list of **[alignTypes][dfn-enum-align-type]**.
It represents how cells in columns are aligned.

For example, the following markdown:

```markdown
| foo | bar |
| :-- | :-: |
| baz | qux |
```

Yields:

```js
{
  type: 'table',
  align: ['left', 'center'],
  children: [
    {
      type: 'tableRow',
      children: [
        {
          type: 'tableCell',
          children: [{type: 'text', value: 'foo'}]
        },
        {
          type: 'tableCell',
          children: [{type: 'text', value: 'bar'}]
        }
      ]
    },
    {
      type: 'tableRow',
      children: [
        {
          type: 'tableCell',
          children: [{type: 'text', value: 'baz'}]
        },
        {
          type: 'tableCell',
          children: [{type: 'text', value: 'qux'}]
        }
      ]
    }
  ]
}
```

#### `TableRow`

```idl
interface TableRow <: Parent {
  type: "tableRow"
  children: [RowContent]
}
```

**TableRow** (**[Parent][dfn-parent]**) represents a row of cells in a table.

**TableRow** can be used where **[table][dfn-table-content]** content is
expected.
Its content model is **[row][dfn-row-content]** content.

If the node is a *[head][term-head]*, it represents the labels of the columns
for its parent **[Table][dfn-table]**.

For an example, see **[Table][dfn-table]**.

#### `TableCell`

```idl
interface TableCell <: Parent {
  type: "tableCell"
  children: [PhrasingContent]
}
```

**TableCell** (**[Parent][dfn-parent]**) represents a header cell in a
**[Table][dfn-table]**, if its parent is a *[head][term-head]*, or a data
cell otherwise.

**TableCell** can be used where **[row][dfn-row-content]** content is expected.
Its content model is **[phrasing][dfn-phrasing-content]** content excluding
**[Break][dfn-break]** nodes.

For an example, see **[Table][dfn-table]**.

### Enumeration

#### `alignType`

```idl
enum alignType {
  'center' | 'left' | 'right' | null
}
```

**alignType** represents how phrasing content is aligned
([\[CSSTEXT\]][css-text]).

*   **`'left'`**: See the [`left`][css-left] value of the `text-align` CSS
    property
*   **`'right'`**: See the [`right`][css-right] value of the `text-align`
    CSS property
*   **`'center'`**: See the [`center`][css-center] value of the `text-align`
    CSS property
*   **`null`**: phrasing content is aligned as defined by the host environment

### Content model

#### `FlowContent` (GFM table)

```idl
type FlowContentGfm = Table | FlowContent
```

#### `TableContent`

```idl
type TableContent = TableRow
```

**Table** content represent the rows in a table.

#### `RowContent`

```idl
type RowContent = TableCell
```

**Row** content represent the cells in a row.

## Types

This package is fully typed with [TypeScript][].
It exports the additional type [`Options`][api-options].

The `Table`, `TableRow`, and `TableCell` types of the mdast nodes are exposed
from `@types/mdast`.

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line, `mdast-util-gfm-table@^2`,
compatible with Node.js 16.

This utility works with `mdast-util-from-markdown` version 2+ and
`mdast-util-to-markdown` version 2+.

## Related

*   [`remarkjs/remark-gfm`][remark-gfm]
    — remark plugin to support GFM
*   [`syntax-tree/mdast-util-gfm`][mdast-util-gfm]
    — same but all of GFM (autolink literals, footnotes, strikethrough, tables,
    tasklists)
*   [`micromark/micromark-extension-gfm-table`][extension]
    — micromark extension to parse GFM tables

## Contribute

See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for
ways to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organization, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/syntax-tree/mdast-util-gfm-table/workflows/main/badge.svg

[build]: https://github.com/syntax-tree/mdast-util-gfm-table/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-gfm-table.svg

[coverage]: https://codecov.io/github/syntax-tree/mdast-util-gfm-table

[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-gfm-table.svg

[downloads]: https://www.npmjs.com/package/mdast-util-gfm-table

[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-gfm-table

[size]: https://bundlejs.com/?q=mdast-util-gfm-table

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[collective]: https://opencollective.com/unified

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/syntax-tree/unist/discussions

[npm]: https://docs.npmjs.com/cli/install

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[typescript]: https://www.typescriptlang.org

[license]: license

[author]: https://wooorm.com

[health]: https://github.com/syntax-tree/.github

[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md

[support]: https://github.com/syntax-tree/.github/blob/main/support.md

[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md

[remark-gfm]: https://github.com/remarkjs/remark-gfm

[mdast]: https://github.com/syntax-tree/mdast

[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm

[mdast-util-from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown

[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown

[mdast-util-to-hast]: https://github.com/syntax-tree/mdast-util-to-hast

[micromark]: https://github.com/micromark/micromark

[extension]: https://github.com/micromark/micromark-extension-gfm-table

[syntax]: https://github.com/micromark/micromark-extension-gfm-table#syntax

[gfm]: https://github.github.com/gfm/

[string-width]: https://github.com/sindresorhus/string-width

[css-text]: https://drafts.csswg.org/css-text/

[css-left]: https://drafts.csswg.org/css-text/#valdef-text-align-left

[css-right]: https://drafts.csswg.org/css-text/#valdef-text-align-right

[css-center]: https://drafts.csswg.org/css-text/#valdef-text-align-center

[term-head]: https://github.com/syntax-tree/unist#head

[dfn-parent]: https://github.com/syntax-tree/mdast#parent

[dfn-phrasing-content]: https://github.com/syntax-tree/mdast#phrasingcontent

[dfn-break]: https://github.com/syntax-tree/mdast#break

[from-markdown-extension]: https://github.com/syntax-tree/mdast-util-from-markdown#extension

[to-markdown-extension]: https://github.com/syntax-tree/mdast-util-to-markdown#options

[api-gfm-table-from-markdown]: #gfmtablefrommarkdown

[api-gfm-table-to-markdown]: #gfmtabletomarkdownoptions

[api-options]: #options

[dfn-flow-content]: #flowcontent-gfm-table

[dfn-table-content]: #tablecontent

[dfn-enum-align-type]: #aligntype

[dfn-row-content]: #rowcontent

[dfn-table]: #table
>hx '100644 index.d.ts Y>lg/]100644 index.js Y>lg/]40000 lib b#	U!|jnl100644 license 97#V}n-ƟO^100644 package.json wozhA@7tD100644 readme.md 畜^XQu\GWx\ export {
  gfmTaskListItemFromMarkdown,
  gfmTaskListItemToMarkdown
} from './lib/index.js'

 xJ 100644 index.d.ts V'_eM>jv[100644 index.js jgZ:'Ze*}? `dxG task
 * list itemsXq4task list items.
 */
export function gfmTaskListItemk task list
 * itemsxm4task list items.
 */
export function gfmTaskListItem.UListItem = import('mdast').ListItem
export type Paragraph = import('mdast').Paragraphe?G&^;xb/**
 * @typedef {import('mdast').ListItem} ListItem
 * @typedef {import('mdast').Paragraph} Paragraph
 * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext
 * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension
 * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle
 * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
 * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle
 */

import {ok as assert} from 'devlop'
import {defaultHandlers} from 'mdast-util-to-markdown'

/**
 * Create an extension for `mdast-util-from-markdown` to enable GFM task
 * list items in markdown.
 *
 * @returns {FromMarkdownExtension}
 *   Extension for `mdast-util-from-markdown` to enable GFM task list items.
 */
export function gfmTaskListItemFromMarkdown() {
  return {
    exit: {
      taskListCheckValueChecked: exitCheck,
      taskListCheckValueUnchecked: exitCheck,
      paragraph: exitParagraphWithTaskListItem
    }
  }
}

/**
 * Create an extension for `mdast-util-to-markdown` to enable GFM task list
 * items in markdown.
 *
 * @returns {ToMarkdownExtension}
 *   Extension for `mdast-util-to-markdown` to enable GFM task list items.
 */
export function gfmTaskListItemToMarkdown() {
  return {
    unsafe: [{atBreak: true, character: '-', after: '[:|-]'}],
    handlers: {listItem: listItemWithTaskListItem}
  }
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function exitCheck(token) {
  // We’re always in a paragraph, in a list item.
  const node = this.stack[this.stack.length - 2]
  assert(node.type === 'listItem')
  node.checked = token.type === 'taskListCheckValueChecked'
}

/**
 * @this {CompileContext}
 * @type {FromMarkdownHandle}
 */
function exitParagraphWithTaskListItem(token) {
  const parent = this.stack[this.stack.length - 2]

  if (
    parent &&
    parent.type === 'listItem' &&
    typeof parent.checked === 'boolean'
  ) {
    const node = this.stack[this.stack.length - 1]
    assert(node.type === 'paragraph')
    const head = node.children[0]

    if (head && head.type === 'text') {
      const siblings = parent.children
      let index = -1
      /** @type {Paragraph | undefined} */
      let firstParaghraph

      while (++index < siblings.length) {
        const sibling = siblings[index]
        if (sibling.type === 'paragraph') {
          firstParaghraph = sibling
          break
        }
      }

      if (firstParaghraph === node) {
        // Must start with a space or a tab.
        head.value = head.value.slice(1)

        if (head.value.length === 0) {
          node.children.shift()
        } else if (
          node.position &&
          head.position &&
          typeof head.position.start.offset === 'number'
        ) {
          head.position.start.column++
          head.position.start.offset++
          node.position.start = Object.assign({}, head.position.start)
        }
      }
    }
  }

  this.exit(token)
}

/**
 * @type {ToMarkdownHandle}
 * @param {ListItem} node
 */
function listItemWithTaskListItem(node, parent, state, info) {
  const head = node.children[0]
  const checkable =
    typeof node.checked === 'boolean' && head && head.type === 'paragraph'
  const checkbox = '[' + (node.checked ? 'x' : ' ') + '] '
  const tracker = state.createTracker(info)

  if (checkable) {
    tracker.move(checkbox)
  }

  let value = defaultHandlers.listItem(node, parent, state, {
    ...info,
    ...tracker.current()
  })

  if (checkable) {
    value = value.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/, check)
  }

  return value

  /**
   * @param {string} $0
   * @returns {string}
   */
  function check($0) {
    return $0 + checkbox
  }
}
u볊x)	{
  "name": "mdast-util-gfm-task-list-item",
  "version": "2.0.0",
  "description": "mdast extension to parse and serialize GFM task list items",
  "license": "MIT",
  "keywords": [
    "unist",
    "mdast",
    "mdast-util",
    "util",
    "utility",
    "markdown",
    "markup",
    "task",
    "list",
    "item",
    "check",
    "checkbox",
    "todo",
    "gfm"
  ],
  "repository": "syntax-tree/mdast-util-gfm-task-list-item",
  "bugs": "https://github.com/syntax-tree/mdast-util-gfm-task-list-item/issues",
  "funding": {
    "type": "opencollective",
    "url": "https://opencollective.com/unified"
  },
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "sideEffects": false,
  "type": "module",
  "exports": "./index.js",
  "files": [
    "lib/",
    "index.d.ts",
    "index.js"
  ],
  "dependencies": {
    "@types/mdast": "^4.0.0",
    "devlop": "^1.0.0",
    "mdast-util-from-markdown": "^2.0.0",
    "mdast-util-to-markdown": "^2.0.0"
  },
  "devDependencies": {
    "@types/node": "^20.0.0",
    "c8": "^8.0.0",
    "micromark-extension-gfm-task-list-item": "^2.0.0",
    "prettier": "^2.0.0",
    "remark-cli": "^11.0.0",
    "remark-preset-wooorm": "^9.0.0",
    "type-coverage": "^2.0.0",
    "typescript": "^5.0.0",
    "unist-util-remove-position": "^5.0.0",
    "xo": "^0.54.0"
  },
  "scripts": {
    "prepack": "npm run build && npm run format",
    "build": "tsc --build --clean && tsc --build && type-coverage",
    "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
    "test-api-prod": "node --conditions production test.js",
    "test-api-dev": "node --conditions development test.js",
    "test-api": "npm run test-api-dev && npm run test-api-prod",
    "test-coverage": "c8 --100 --reporter lcov npm run test-api",
    "test": "npm run build && npm run format && npm run test-coverage"
  },
  "prettier": {
    "bracketSpacing": false,
    "semi": false,
    "singleQuote": true,
    "tabWidth": 2,
    "trailingComma": "none",
    "useTabs": false
  },
  "remarkConfig": {
    "plugins": [
      "remark-preset-wooorm"
    ]
  },
  "typeCoverage": {
    "atLeast": 100,
    "detail": true,
    "ignoreCatch": true,
    "strict": true
  },
  "xo": {
    "prettier": true
  }
}
ʱOx&B# mdast-util-gfm-task-list-item

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

[mdast][] extensions to parse and serialize [GFM][] task list items.

## Contents

*   [What is this?](#what-is-this)
*   [When to use this](#when-to-use-this)
*   [Install](#install)
*   [Use](#use)
*   [API](#api)
    *   [`gfmTaskListItemFromMarkdown()`](#gfmtasklistitemfrommarkdown)
    *   [`gfmTaskListItemToMarkdown()`](#gfmtasklistitemtomarkdown)
*   [HTML](#html)
*   [Syntax](#syntax)
*   [Syntax tree](#syntax-tree)
    *   [Nodes](#nodes)
    *   [Content model](#content-model)
*   [Types](#types)
*   [Compatibility](#compatibility)
*   [Related](#related)
*   [Contribute](#contribute)
*   [License](#license)

## What is this?

This package contains two extensions that add support for GFM task list item
syntax in markdown to [mdast][].
These extensions plug into
[`mdast-util-from-markdown`][mdast-util-from-markdown] (to support parsing
task lists in markdown into a syntax tree) and
[`mdast-util-to-markdown`][mdast-util-to-markdown] (to support serializing
task lists in syntax trees to markdown).

## When to use this

You can use these extensions when you are working with
`mdast-util-from-markdown` and `mdast-util-to-markdown` already.

When working with `mdast-util-from-markdown`, you must combine this package
with
[`micromark-extension-gfm-task-list-item`][extension].

When you don’t need a syntax tree, you can use [`micromark`][micromark]
directly with `micromark-extension-gfm-task-list-item`.

When you are working with syntax trees and want all of GFM, use
[`mdast-util-gfm`][mdast-util-gfm] instead.

All these packages are used [`remark-gfm`][remark-gfm], which
focusses on making it easier to transform content by abstracting these
internals away.

This utility does not handle how markdown is turned to HTML.
That’s done by [`mdast-util-to-hast`][mdast-util-to-hast].

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install mdast-util-gfm-task-list-item
```

In Deno with [`esm.sh`][esmsh]:

```js
import {gfmTaskListItemFromMarkdown, gfmTaskListItemToMarkdown} from 'https://esm.sh/mdast-util-gfm-task-list-item@2'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {gfmTaskListItemFromMarkdown, gfmTaskListItemToMarkdown} from 'https://esm.sh/mdast-util-gfm-task-list-item@2?bundle'
</script>
```

## Use

Say our document `example.md` contains:

```markdown
* [ ] To do
* [x] Done

1. Mixed…
2. [x] …messages
```

…and our module `example.js` looks as follows:

```js
import fs from 'node:fs/promises'
import {gfmTaskListItem} from 'micromark-extension-gfm-task-list-item'
import {fromMarkdown} from 'mdast-util-from-markdown'
import {gfmTaskListItemFromMarkdown, gfmTaskListItemToMarkdown} from 'mdast-util-gfm-task-list-item'
import {toMarkdown} from 'mdast-util-to-markdown'

const doc = await fs.readFile('example.md')

const tree = fromMarkdown(doc, {
  extensions: [gfmTaskListItem],
  mdastExtensions: [gfmTaskListItemFromMarkdown]
})

console.log(tree)

const out = toMarkdown(tree, {extensions: [gfmTaskListItemToMarkdown]})

console.log(out)
```

…now running `node example.js` yields (positional info removed for brevity):

```js
{
 type: 'root',
 children: [
   {
     type: 'list',
     ordered: false,
     start: null,
     spread: false,
     children: [
       {
         type: 'listItem',
         spread: false,
         checked: false,
         children: [
           {type: 'paragraph', children: [{type: 'text', value: 'To do'}]}
         ]
       },
       {
         type: 'listItem',
         spread: false,
         checked: true,
         children: [
           {type: 'paragraph', children: [{type: 'text', value: 'Done'}]}
         ]
       }
     ]
   },
   {
     type: 'list',
     ordered: true,
     start: 1,
     spread: false,
     children: [
       {
         type: 'listItem',
         spread: false,
         checked: null,
         children: [
           {type: 'paragraph', children: [{type: 'text', value: 'Mixed…'}]}
         ]
       },
       {
         type: 'listItem',
         spread: false,
         checked: true,
         children: [
           {type: 'paragraph', children: [{type: 'text', value: '…messages'}]}
         ]
       }
     ]
   }
 ]
}
```

```markdown
*   [ ] To do
*   [x] Done

1.  Mixed…
2.  [x] …messages
```

## API

This package exports the identifiers
[`gfmTaskListItemFromMarkdown`][api-gfm-task-list-item-from-markdown] and
[`gfmTaskListItemToMarkdown`][api-gfm-task-list-item-to-markdown].
There is no default export.

### `gfmTaskListItemFromMarkdown()`

Create an extension for [`mdast-util-from-markdown`][mdast-util-from-markdown]
to enable GFM task list items in markdown.

###### Returns

Extension for `mdast-util-from-markdown` to enable GFM task list items
([`FromMarkdownExtension`][frommarkdownextension]).

### `gfmTaskListItemToMarkdown()`

Create an extension for [`mdast-util-to-markdown`][mdast-util-to-markdown] to
enable GFM task list items in markdown.

###### Returns

Extension for `mdast-util-to-markdown` to enable GFM task list items
([`ToMarkdownExtension`][tomarkdownextension]).

## HTML

This utility does not handle how markdown is turned to HTML.
That’s done by [`mdast-util-to-hast`][mdast-util-to-hast].

## Syntax

See [Syntax in `micromark-extension-gfm-task-list-item`][syntax].

## Syntax tree

The following interfaces are added to **[mdast][]** by this utility.

### Nodes

#### `ListItem` (GFM)

```idl
interface ListItemGfm <: ListItem {
  checked: boolean?
}
```

In GFM, a `checked` field can be present.
It represents whether the item is done (when `true`), not done (when `false`),
or indeterminate or not applicable (when `null` or not present).

### Content model

#### `ListContent` (GFM)

```idl
type ListContentGfm = ListItemGfm
```

## Types

This package is fully typed with [TypeScript][].
It does not export additional types.

The `ListItem` type of the mdast nodes are exposed from `@types/mdast`.

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`mdast-util-gfm-task-list-item@^2`, compatible with Node.js 16.

## Related

*   [`remarkjs/remark-gfm`][remark-gfm]
    — remark plugin to support GFM
*   [`syntax-tree/mdast-util-gfm`][mdast-util-gfm]
    — same but all of GFM (autolink literals, footnotes, strikethrough, tables,
    tasklists)
*   [`micromark/micromark-extension-gfm-task-list-item`][extension]
    — micromark extension to parse GFM task list items

## Contribute

See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for
ways to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organization, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/syntax-tree/mdast-util-gfm-task-list-item/workflows/main/badge.svg

[build]: https://github.com/syntax-tree/mdast-util-gfm-task-list-item/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-gfm-task-list-item.svg

[coverage]: https://codecov.io/github/syntax-tree/mdast-util-gfm-task-list-item

[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-gfm-task-list-item.svg

[downloads]: https://www.npmjs.com/package/mdast-util-gfm-task-list-item

[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-gfm-task-list-item

[size]: https://bundlejs.com/?q=mdast-util-gfm-task-list-item

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[collective]: https://opencollective.com/unified

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/syntax-tree/unist/discussions

[npm]: https://docs.npmjs.com/cli/install

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[typescript]: https://www.typescriptlang.org

[license]: license

[author]: https://wooorm.com

[health]: https://github.com/syntax-tree/.github

[contributing]: https://github.com/syntax-tree/.github/blob/HEAD/contributing.md

[support]: https://github.com/syntax-tree/.github/blob/HEAD/support.md

[coc]: https://github.com/syntax-tree/.github/blob/HEAD/code-of-conduct.md

[mdast]: https://github.com/syntax-tree/mdast

[remark-gfm]: https://github.com/remarkjs/remark-gfm

[mdast-util-from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown

[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown

[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm

[mdast-util-to-hast]: https://github.com/syntax-tree/mdast-util-to-hast

[micromark]: https://github.com/micromark/micromark

[extension]: https://github.com/micromark/micromark-extension-gfm-task-list-item

[syntax]: https://github.com/micromark/micromark-extension-gfm-task-list-item#syntax

[frommarkdownextension]: https://github.com/syntax-tree/mdast-util-from-markdown#extension

[tomarkdownextension]: https://github.com/syntax-tree/mdast-util-to-markdown#options

[gfm]: https://github.github.com/gfm/

[api-gfm-task-list-item-from-markdown]: #gfmtasklistitemfrommarkdown

[api-gfm-task-list-item-to-markdown]: #gfmtasklistitemtomarkdown
sx '100644 index.d.ts :9iV2N7&100644 index.js $ƻ\Z!\40000 lib i@Q0D4Emi100644 license Zbv8f,Q)100644 package.json )l~×%z݂nҺ$100644 readme.md O%|8jrkV) 8UFxGimport type {ToMarkdownOptions as FootnoteOptions} from 'mdast-util-gfm-footnote'
import type {Options as TableOptions} from 'mdast-util-gfm-table'

/**
 * Configuration for `gfmToMarkdown` from `mdast-util-gfm`.
 *
 * Currently supports options for `mdast-util-gfm-footnote` and
 * `mdast-util-gfm-table`.
 */
export interface Options extends FootnoteOptions, TableOptions {}

export {gfmFromMarkdown, gfmToMarkdown} from './lib/index.js'
Dxh // Note: types exposed from `index.d.ts`.
export {gfmFromMarkdown, gfmToMarkdown} from './lib/index.js'
$xt 100644 index.d.ts 8.&wb'+זk100644 index.d.ts.map Dhrd(VO100644 index.js kC%	32SyГT\+(ExV/**
 * Create an extension for `mdast-util-from-markdown` to enable GFM (autolink
 * literals, footnotes, strikethrough, tables, tasklists).
 *
 * @returns {Array<FromMarkdownExtension>}
 *   Extension for `mdast-util-from-markdown` to enable GFM (autolink literals,
 *   footnotes, strikethrough, tables, tasklists).
 */
export function gfmFromMarkdown(): Array<FromMarkdownExtension>;
/**
 * Create an extension for `mdast-util-to-markdown` to enable GFM (autolink
 * literals, footnotes, strikethrough, tables, tasklists).
 *
 * @param {Options | null | undefined} [options]
 *   Configuration (optional).
 * @returns {ToMarkdownExtension}
 *   Extension for `mdast-util-to-markdown` to enable GFM (autolink literals,
 *   footnotes, strikethrough, tables, tasklists).
 */
export function gfmToMarkdown(options?: Options | null | undefined): ToMarkdownExtension;
import type { Extension as FromMarkdownExtension } from 'mdast-util-from-markdown';
import type { Options } from 'mdast-util-gfm';
import type { Options as ToMarkdownExtension } from 'mdast-util-to-markdown';
//# sourceMappingURL=index.d.ts.mapBx{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAwBA;;;;;;;GAOG;AACH,mCAJa,KAAK,CAAC,qBAAqB,CAAC,CAYxC;AAED;;;;;;;;;GASG;AACH,wCANW,OAAO,GAAG,IAAI,GAAG,SAAS,GAExB,mBAAmB,CAc/B;wDA7DoD,0BAA0B;6BACrD,gBAAgB;oDACO,wBAAwB"}-Mjvxo/**
 * @import {Extension as FromMarkdownExtension} from 'mdast-util-from-markdown'
 * @import {Options} from 'mdast-util-gfm'
 * @import {Options as ToMarkdownExtension} from 'mdast-util-to-markdown'
 */

import {
  gfmAutolinkLiteralFromMarkdown,
  gfmAutolinkLiteralToMarkdown
} from 'mdast-util-gfm-autolink-literal'
import {
  gfmFootnoteFromMarkdown,
  gfmFootnoteToMarkdown
} from 'mdast-util-gfm-footnote'
import {
  gfmStrikethroughFromMarkdown,
  gfmStrikethroughToMarkdown
} from 'mdast-util-gfm-strikethrough'
import {gfmTableFromMarkdown, gfmTableToMarkdown} from 'mdast-util-gfm-table'
import {
  gfmTaskListItemFromMarkdown,
  gfmTaskListItemToMarkdown
} from 'mdast-util-gfm-task-list-item'

/**
 * Create an extension for `mdast-util-from-markdown` to enable GFM (autolink
 * literals, footnotes, strikethrough, tables, tasklists).
 *
 * @returns {Array<FromMarkdownExtension>}
 *   Extension for `mdast-util-from-markdown` to enable GFM (autolink literals,
 *   footnotes, strikethrough, tables, tasklists).
 */
export function gfmFromMarkdown() {
  return [
    gfmAutolinkLiteralFromMarkdown(),
    gfmFootnoteFromMarkdown(),
    gfmStrikethroughFromMarkdown(),
    gfmTableFromMarkdown(),
    gfmTaskListItemFromMarkdown()
  ]
}

/**
 * Create an extension for `mdast-util-to-markdown` to enable GFM (autolink
 * literals, footnotes, strikethrough, tables, tasklists).
 *
 * @param {Options | null | undefined} [options]
 *   Configuration (optional).
 * @returns {ToMarkdownExtension}
 *   Extension for `mdast-util-to-markdown` to enable GFM (autolink literals,
 *   footnotes, strikethrough, tables, tasklists).
 */
export function gfmToMarkdown(options) {
  return {
    extensions: [
      gfmAutolinkLiteralToMarkdown(),
      gfmFootnoteToMarkdown(options),
      gfmStrikethroughToMarkdown(),
      gfmTableToMarkdown(options),
      gfmTaskListItemToMarkdown()
    ]
  }
}
^-MVx%{[M!syntax-tree/mdast-util-gfm/issues_dmdast-util-from-markdown": "^2.0.0",
    "mdast-util-gfm-autolink-literal": "^2.0.0",
    "mdast-util-gfm-footnote": "^2.0.0",
@dast-util-gfm-strikethrough": "^2.0.0",
    "mdast-util-gfm-tabl	dast-util : "^2.0.0",
    "mdast-util-to-markdown": "^2.0.0"
  },
  "description": "mdast extension to parse and serialize GFM (GitHub Flavored Markdown)"/2!\github-slugger": "^2.0.0",
    "hast-util-to-html": "^9.0.0",
    "mdast-util-to-hast": "^13": "^3`]1GSundici": "^7.0.0",
    "xo": "^0.60.0"
  },
  "exports": "./index.js",
  "files": [N!,
    "lib/"
  ]gkeywords": [
    "autolink",
    "gfm",
    "github",
    "markdown",
    "markup",
    "mdast-util",
    "mdast",
    "striketahrough",
    "table",
    "tagfilter",
    "tasklist",
    "unist",
    "utility",
    "util"
  ]name": "mdast-util-gfm"Q9repository": "syntax-tree/mdast-util-gfm",
  "scripts": {YB",
    "crawlhscript/crawl-tests.jsG--frail --output --quiet -- . && prettier --log-level warn --write -- .--cJ	&Fstrict": true
  },
  "type": "module",
  "version": "3.1.0",
  "xo": {A
#"test/**/*.js"
 0,
    "prettier": true
  }
}
}o x6K# mdast-util-gfm

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

[mdast][] extensions to parse and serialize [GFM][] (autolink literals,
footnotes, strikethrough, tables, tasklists).

## Contents

* [What is this?](#what-is-this)
* [When to use this](#when-to-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`gfmFromMarkdown()`](#gfmfrommarkdown)
  * [`gfmToMarkdown(options?)`](#gfmtomarkdownoptions)
  * [`Options`](#options)
* [HTML](#html)
* [Syntax](#syntax)
* [Syntax tree](#syntax-tree)
* [Types](#types)
* [Compatibility](#compatibility)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package contains two extensions that add support for GFM syntax in
markdown to [mdast][]: autolink literals (`www.x.com`), footnotes (`[^1]`),
strikethrough (`~~stuff~~`), tables (`| cell |…`), and tasklists (`* [x]`).
These extensions plug into
[`mdast-util-from-markdown`][mdast-util-from-markdown] (to support parsing
GFM in markdown into a syntax tree) and
[`mdast-util-to-markdown`][mdast-util-to-markdown] (to support serializing
GFM in syntax trees to markdown).

## When to use this

This project is useful when you want to support the same features that GitHub
does in files in a repo, Gists, and several other places.
Users frequently believe that some of these extensions, specifically autolink
literals and tables, are part of normal markdown, so using `mdast-util-gfm` will
help match your implementation to their understanding of markdown.
There are several edge cases where GitHub’s implementation works in unexpected
ways or even different than described in their spec, so *writing* in GFM is not
always the best choice.

You can use these extensions when you are working with
`mdast-util-from-markdown` and `mdast-util-to-markdown` already.

When working with `mdast-util-from-markdown`, you must combine this package
with [`micromark-extension-gfm`][extension].

Instead of this package, you can also use the extensions separately:

* [`mdast-util-gfm-autolink-literal`](https://github.com/syntax-tree/mdast-util-gfm-autolink-literal)
  — support GFM autolink literals
* [`mdast-util-gfm-footnote`](https://github.com/syntax-tree/mdast-util-gfm-footnote)
  — support GFM footnotes
* [`mdast-util-gfm-strikethrough`](https://github.com/syntax-tree/mdast-util-gfm-strikethrough)
  — support GFM strikethrough
* [`mdast-util-gfm-table`](https://github.com/syntax-tree/mdast-util-gfm-table)
  — support GFM tables
* [`mdast-util-gfm-task-list-item`](https://github.com/syntax-tree/mdast-util-gfm-task-list-item)
  — support GFM tasklists

A different utility, [`mdast-util-frontmatter`][mdast-util-frontmatter], adds
support for frontmatter.
GitHub supports YAML frontmatter for files in repos and Gists but they don’t
treat it as part of GFM.

All these packages are used in [`remark-gfm`][remark-gfm], which
focusses on making it easier to transform content by abstracting these
internals away.

This utility does not handle how markdown is turned to HTML.
That’s done by [`mdast-util-to-hast`][mdast-util-to-hast].
If your content is not in English, you should configure that utility.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install mdast-util-gfm
```

In Deno with [`esm.sh`][esmsh]:

```js
import {gfmFromMarkdown, gfmToMarkdown} from 'https://esm.sh/mdast-util-gfm@3'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {gfmFromMarkdown, gfmToMarkdown} from 'https://esm.sh/mdast-util-gfm@3?bundle'
</script>
```

## Use

Say our document `example.md` contains:

```markdown
# GFM

## Autolink literals

www.example.com, https://example.com, and contact@example.com.

## Footnote

A note[^1]

[^1]: Big note.

## Strikethrough

~one~ or ~~two~~ tildes.

## Table

| a | b  |  c |  d  |
| - | :- | -: | :-: |

## Tasklist

* [ ] to do
* [x] done
```

…and our module `example.js` looks as follows:

```js
import fs from 'node:fs/promises'
import {fromMarkdown} from 'mdast-util-from-markdown'
import {gfmFromMarkdown, gfmToMarkdown} from 'mdast-util-gfm'
import {toMarkdown} from 'mdast-util-to-markdown'
import {gfm} from 'micromark-extension-gfm'

const value = await fs.readFile('example.md', 'utf8')

const tree = fromMarkdown(value, {
  extensions: [gfm()],
  mdastExtensions: [gfmFromMarkdown()]
})

console.log(tree)

const result = toMarkdown(tree, {extensions: [gfmToMarkdown()]})

console.log(result)
```

…now running `node example.js` yields (positional info removed for brevity):

```js
{
  type: 'root',
  children: [
    {type: 'heading', depth: 1, children: [{type: 'text', value: 'GFM'}]},
    {
      type: 'heading',
      depth: 2,
      children: [{type: 'text', value: 'Autolink literals'}]
    },
    {
      type: 'paragraph',
      children: [
        {
          type: 'link',
          title: null,
          url: 'http://www.example.com',
          children: [{type: 'text', value: 'www.example.com'}]
        },
        {type: 'text', value: ', '},
        {
          type: 'link',
          title: null,
          url: 'https://example.com',
          children: [{type: 'text', value: 'https://example.com'}]
        },
        {type: 'text', value: ', and '},
        {
          type: 'link',
          title: null,
          url: 'mailto:contact@example.com',
          children: [{type: 'text', value: 'contact@example.com'}]
        },
        {type: 'text', value: '.'}
      ]
    },
    {type: 'heading', depth: 2, children: [{type: 'text', value: 'Footnote'}]},
    {
      type: 'paragraph',
      children: [
        {type: 'text', value: 'A note'},
        {type: 'footnoteReference', identifier: '1', label: '1'}
      ]
    },
    {
      type: 'footnoteDefinition',
      identifier: '1',
      label: '1',
      children: [
        {type: 'paragraph', children: [{type: 'text', value: 'Big note.'}]}
      ]
    },
    {
      type: 'heading',
      depth: 2,
      children: [{type: 'text', value: 'Strikethrough'}]
    },
    {
      type: 'paragraph',
      children: [
        {
          type: 'delete',
          children: [{type: 'text', value: 'one'}]
        },
        {type: 'text', value: ' or '},
        {
          type: 'delete',
          children: [{type: 'text', value: 'two'}]
        },
        {type: 'text', value: ' tildes.'}
      ]
    },
    {type: 'heading', depth: 2, children: [{type: 'text', value: 'Table'}]},
    {
      type: 'table',
      align: [null, 'left', 'right', 'center'],
      children: [
        {
          type: 'tableRow',
          children: [
            {type: 'tableCell', children: [{type: 'text', value: 'a'}]},
            {type: 'tableCell', children: [{type: 'text', value: 'b'}]},
            {type: 'tableCell', children: [{type: 'text', value: 'c'}]},
            {type: 'tableCell', children: [{type: 'text', value: 'd'}]}
          ]
        }
      ]
    },
    {type: 'heading', depth: 2, children: [{type: 'text', value: 'Tasklist'}]},
    {
      type: 'list',
      ordered: false,
      start: null,
      spread: false,
      children: [
        {
          type: 'listItem',
          spread: false,
          checked: false,
          children: [
            {type: 'paragraph', children: [{type: 'text', value: 'to do'}]}
          ]
        },
        {
          type: 'listItem',
          spread: false,
          checked: true,
          children: [
            {type: 'paragraph', children: [{type: 'text', value: 'done'}]}
          ]
        }
      ]
    }
  ]
}
```

```markdown
# GFM

## Autolink literals

[www.example.com](http://www.example.com), <https://example.com>, and <contact@example.com>.

## Footnote

A note[^1]

[^1]: Big note.

## Strikethrough

~~one~~ or ~~two~~ tildes.

## Table

| a | b  |  c |  d  |
| - | :- | -: | :-: |

## Tasklist

*   [ ] to do
*   [x] done
```

## API

This package exports the identifiers [`gfmFromMarkdown`][api-gfm-from-markdown]
and [`gfmToMarkdown`][api-gfm-to-markdown].
There is no default export.

### `gfmFromMarkdown()`

Create an extension for [`mdast-util-from-markdown`][mdast-util-from-markdown]
to enable GFM (autolink literals, footnotes, strikethrough, tables, tasklists).

###### Returns

Extension for `mdast-util-from-markdown` to enable GFM
([`Array<FromMarkdownExtension>`][from-markdown-extension]).

### `gfmToMarkdown(options?)`

Create an extension for [`mdast-util-to-markdown`][mdast-util-to-markdown]
to enable GFM (autolink literals, footnotes, strikethrough, tables, tasklists).

###### Parameters

* `options` ([`Options`][api-options])
  — configuration

###### Returns

Extension for `mdast-util-to-markdown` to enable GFM
([`Array<ToMarkdownExtension>`][to-markdown-extension]).

### `Options`

Configuration (TypeScript type).

###### Fields

* `firstLineBlank` (`boolean`, default: `false`)
  — use a blank line for the first line of footnote definitions
* `stringLength` (`((value: string) => number)`, default: `s => s.length`)
  — function to detect the length of table cell content, used when aligning
  the delimiters between cells
* `tableCellPadding` (`boolean`, default: `true`)
  — whether to add a space of padding between delimiters and cells
* `tablePipeAlign` (`boolean`, default: `true`)
  — whether to align the delimiters

## HTML

This utility does not handle how markdown is turned to HTML.
That’s done by [`mdast-util-to-hast`][mdast-util-to-hast].

## Syntax

See [Syntax in `micromark-extension-gfm`][syntax].

## Syntax tree

This utility combines several mdast utilities.
See their readmes for the node types supported in the tree:

* [`mdast-util-gfm-autolink-literal`](https://github.com/syntax-tree/mdast-util-gfm-autolink-literal#syntax-tree)
  — GFM autolink literals
* [`mdast-util-gfm-footnote`](https://github.com/syntax-tree/mdast-util-gfm-footnote#syntax-tree)
  — GFM footnotes
* [`mdast-util-gfm-strikethrough`](https://github.com/syntax-tree/mdast-util-gfm-strikethrough#syntax-tree)
  — GFM strikethrough
* [`mdast-util-gfm-table`](https://github.com/syntax-tree/mdast-util-gfm-table#syntax-tree)
  — GFM tables
* [`mdast-util-gfm-task-list-item`](https://github.com/syntax-tree/mdast-util-gfm-task-list-item#syntax-tree)
  — GFM tasklists

## Types

This package is fully typed with [TypeScript][].
It exports the additional type [`Options`][api-options].

The `Delete`, `FootnoteDefinition`, `FootnoteReference`, `Table`, `TableRow`,
and `TableCell` types of the mdast nodes are exposed from `@types/mdast`.

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line, `mdast-util-gfm@^3`,
compatible with Node.js 16.

## Related

* [`remark-gfm`][remark-gfm]
  — remark plugin to support GFM
* [`micromark-extension-gfm`][extension]
  — micromark extension to parse GFM

## Contribute

See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for
ways to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organization, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[api-gfm-from-markdown]: #gfmfrommarkdown

[api-gfm-to-markdown]: #gfmtomarkdownoptions

[api-options]: #options

[author]: https://wooorm.com

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[build]: https://github.com/syntax-tree/mdast-util-gfm/actions

[build-badge]: https://github.com/syntax-tree/mdast-util-gfm/workflows/main/badge.svg

[chat]: https://github.com/syntax-tree/unist/discussions

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md

[collective]: https://opencollective.com/unified

[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md

[coverage]: https://codecov.io/github/syntax-tree/mdast-util-gfm

[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-gfm.svg

[downloads]: https://www.npmjs.com/package/mdast-util-gfm

[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-gfm.svg

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[extension]: https://github.com/micromark/micromark-extension-gfm

[from-markdown-extension]: https://github.com/syntax-tree/mdast-util-from-markdown#extension

[gfm]: https://github.github.com/gfm/

[health]: https://github.com/syntax-tree/.github

[license]: license

[mdast]: https://github.com/syntax-tree/mdast

[mdast-util-from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown

[mdast-util-frontmatter]: https://github.com/syntax-tree/mdast-util-frontmatter

[mdast-util-to-hast]: https://github.com/syntax-tree/mdast-util-to-hast

[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown

[npm]: https://docs.npmjs.com/cli/install

[remark-gfm]: https://github.com/remarkjs/remark-gfm

[size]: https://bundlejs.com/?q=mdast-util-gfm

[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-gfm

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[support]: https://github.com/syntax-tree/.github/blob/main/support.md

[syntax]: https://github.com/micromark/micromark-extension-gfm#syntax

[to-markdown-extension]: https://github.com/syntax-tree/mdast-util-to-markdown#options

[typescript]: https://www.typescriptlang.org
-x '100644 index.d.ts hIxS7nEB100644 index.js ~wKP.}>~VSz40000 lib ug&vɤxQX^cAL100644 license 97#V}n-ƟO^100644 package.json <}+P4r&Ĵ 100644 readme.md zΛ=loiiOX@vxlimport type {Data, Literal} from 'mdast'

export {mathFromMarkdown, mathToMarkdown} from './lib/index.js'

export type {ToOptions} from './lib/index.js'

/**
 * Math (flow).
 */
export interface Math extends Literal {
  /**
   * Node type of math (flow).
   */
  type: 'math'

  /**
   * Custom information relating to the node.
   */
  meta?: string | null | undefined

  /**
   * Data associated with the mdast math (flow).
   */
  data?: MathData | undefined
}

/**
 * Info associated with mdast math (flow) nodes by the ecosystem.
 */
export interface MathData extends Data {}

/**
 * Math (text).
 */
export interface InlineMath extends Literal {
  /**
   * Node type of math (text).
   */
  type: 'inlineMath'

  /**
   * Data associated with the mdast math (text).
   */
  data?: InlineMathData | undefined
}

/**
 * Info associated with mdast math (text) nodes by the ecosystem.
 */
export interface InlineMathData extends Data {}

// Add custom data tracked to turn markdown into a tree.
declare module 'mdast-util-from-markdown' {
  interface CompileData {
    /**
     * Whether we’re in math (flow).
     */
    mathFlowInside?: boolean | undefined
  }
}

// Add custom data tracked to turn a tree into markdown.
declare module 'mdast-util-to-markdown' {
  interface ConstructNameMap {
    /**
     * Math (flow).
     *
     * ```markdown
     * > | $$
     *     ^^
     * > | a
     *     ^
     * > | $$
     *     ^^
     * ```
     */
    mathFlow: 'mathFlow'

    /**
     * Math (flow) meta flag.
     *
     * ```markdown
     * > | $$a
     *       ^
     *   | b
     *   | $$
     * ```
     */
    mathFlowMeta: 'mathFlowMeta'
  }
}

// Add nodes to tree.
declare module 'mdast' {
  interface BlockContentMap {
    math: Math
  }

  interface PhrasingContentMap {
    inlineMath: InlineMath
  }

  interface RootContentMap {
    inlineMath: InlineMath
    math: Math
  }
}
=xk // Note: Types exported from `index.d.ts`.
export {mathFromMarkdown, mathToMarkdown} from './lib/index.js'
&#xJ 100644 index.d.ts  S#LN0Z100644 index.js cS.۵1QYGѾx!H/**
 * @typedef {import('hast').Element} HastElement
 * @typedef {import('hast').ElementContent} HastElementContent
 * @typedef {import('mdast-util-from-markdown').CompileContext} CompileContext
 * @typedef {import('mdast-util-from-markdown').Extension} FromMarkdownExtension
 * @typedef {import('mdast-util-from-markdown').Handle} FromMarkdownHandle
 * @typedef {import('mdast-util-to-markdown').Handle} ToMarkdownHandle
 * @typedef {import('mdast-util-to-markdown').Options} ToMarkdownExtension
 * @typedef {import('../index.js').InlineMath} InlineMath
 * @typedef {import('../index.js').Math} Math
 *
 * @typedef ToOptions
 *   Configuration.
 * @property {boolean | null | undefined} [singleDollarTextMath=true]
 *   Whether to support math (text) with a single dollar (default: `true`).
 *
 *   Single dollars work in Pandoc and many other places, but often interfere
 *   with “normal” dollars in text.
 *   If you turn this off, you can still use two or more dollars for text math.
 */

import {ok as assert} from 'devlop'
import {longestStreak} from 'longest-streak'

/**
 * Create an extension for `mdast-util-from-markdown`.
 *
 * @returns {FromMarkdownExtension}
 *   Extension for `mdast-util-from-markdown`.
 */
export function mathFromMarkdown() {
  return {
    enter: {
      mathFlow: enterMathFlow,
      mathFlowFenceMeta: enterMathFlowMeta,
      mathText: enterMathText
    },
    exit: {
      mathFlow: exitMathFlow,
      mathFlowFence: exitMathFlowFence,
      mathFlowFenceMeta: exitMathFlowMeta,
      mathFlowValue: exitMathData,
      mathText: exitMathText,
      mathTextData: exitMathData
    }
  }

  /**
   * @this {CompileContext}
   * @type {FromMarkdownHandle}
   */
  function enterMathFlow(token) {
    /** @type {HastElement} */
    const code = {
      type: 'element',
      tagName: 'code',
      properties: {className: ['language-math', 'math-display']},
      children: []
    }
    this.enter(
      {
        type: 'math',
        meta: null,
        value: '',
        data: {hName: 'pre', hChildren: [code]}
      },
      token
    )
  }

  /**
   * @this {CompileContext}
   * @type {FromMarkdownHandle}
   */
  function enterMathFlowMeta() {
    this.buffer()
  }

  /**
   * @this {CompileContext}
   * @type {FromMarkdownHandle}
   */
  function exitMathFlowMeta() {
    const data = this.resume()
    const node = this.stack[this.stack.length - 1]
    assert(node.type === 'math')
    node.meta = data
  }

  /**
   * @this {CompileContext}
   * @type {FromMarkdownHandle}
   */
  function exitMathFlowFence() {
    // Exit if this is the closing fence.
    if (this.data.mathFlowInside) return
    this.buffer()
    this.data.mathFlowInside = true
  }

  /**
   * @this {CompileContext}
   * @type {FromMarkdownHandle}
   */
  function exitMathFlow(token) {
    const data = this.resume().replace(/^(\r?\n|\r)|(\r?\n|\r)$/g, '')
    const node = this.stack[this.stack.length - 1]
    assert(node.type === 'math')
    this.exit(token)
    node.value = data
    // @ts-expect-error: we defined it in `enterMathFlow`.
    const code = /** @type {HastElement} */ (node.data.hChildren[0])
    assert(code.type === 'element')
    assert(code.tagName === 'code')
    code.children.push({type: 'text', value: data})
    this.data.mathFlowInside = undefined
  }

  /**
   * @this {CompileContext}
   * @type {FromMarkdownHandle}
   */
  function enterMathText(token) {
    this.enter(
      {
        type: 'inlineMath',
        value: '',
        data: {
          hName: 'code',
          hProperties: {className: ['language-math', 'math-inline']},
          hChildren: []
        }
      },
      token
    )
    this.buffer()
  }

  /**
   * @this {CompileContext}
   * @type {FromMarkdownHandle}
   */
  function exitMathText(token) {
    const data = this.resume()
    const node = this.stack[this.stack.length - 1]
    assert(node.type === 'inlineMath')
    this.exit(token)
    node.value = data
    const children = /** @type {Array<HastElementContent>} */ (
      // @ts-expect-error: we defined it in `enterMathFlow`.
      node.data.hChildren
    )
    children.push({type: 'text', value: data})
  }

  /**
   * @this {CompileContext}
   * @type {FromMarkdownHandle}
   */
  function exitMathData(token) {
    this.config.enter.data.call(this, token)
    this.config.exit.data.call(this, token)
  }
}

/**
 * Create an extension for `mdast-util-to-markdown`.
 *
 * @param {ToOptions | null | undefined} [options]
 *   Configuration (optional).
 * @returns {ToMarkdownExtension}
 *   Extension for `mdast-util-to-markdown`.
 */
export function mathToMarkdown(options) {
  let single = (options || {}).singleDollarTextMath

  if (single === null || single === undefined) {
    single = true
  }

  inlineMath.peek = inlineMathPeek

  return {
    unsafe: [
      {character: '\r', inConstruct: 'mathFlowMeta'},
      {character: '\n', inConstruct: 'mathFlowMeta'},
      {
        character: '$',
        after: single ? undefined : '\\$',
        inConstruct: 'phrasing'
      },
      {character: '$', inConstruct: 'mathFlowMeta'},
      {atBreak: true, character: '$', after: '\\$'}
    ],
    handlers: {math, inlineMath}
  }

  /**
   * @type {ToMarkdownHandle}
   * @param {Math} node
   */
  // Note: fixing this code? Please also fix the similar code for code:
  // <https://github.com/syntax-tree/mdast-util-to-markdown/blob/main/lib/handle/code.js>
  function math(node, _, state, info) {
    const raw = node.value || ''
    const tracker = state.createTracker(info)
    const sequence = '$'.repeat(Math.max(longestStreak(raw, '$') + 1, 2))
    const exit = state.enter('mathFlow')
    let value = tracker.move(sequence)

    if (node.meta) {
      const subexit = state.enter('mathFlowMeta')
      value += tracker.move(
        state.safe(node.meta, {
          after: '\n',
          before: value,
          encode: ['$'],
          ...tracker.current()
        })
      )
      subexit()
    }

    value += tracker.move('\n')

    if (raw) {
      value += tracker.move(raw + '\n')
    }

    value += tracker.move(sequence)
    exit()
    return value
  }

  /**
   * @type {ToMarkdownHandle}
   * @param {InlineMath} node
   */
  // Note: fixing this code? Please also fix the similar code for inline code:
  // <https://github.com/syntax-tree/mdast-util-to-markdown/blob/main/lib/handle/inline-code.js>
  function inlineMath(node, _, state) {
    let value = node.value || ''
    let size = 1

    if (!single) size++

    // If there is a single dollar sign on its own in the math, use a fence of
    // two.
    // If there are two in a row, use one.
    while (
      new RegExp('(^|[^$])' + '\\$'.repeat(size) + '([^$]|$)').test(value)
    ) {
      size++
    }

    const sequence = '$'.repeat(size)

    // If this is not just spaces or eols (tabs don’t count), and either the
    // first and last character are a space or eol, or the first or last
    // character are dollar signs, then pad with spaces.
    if (
      // Contains non-space.
      /[^ \r\n]/.test(value) &&
      // Starts with space and ends with space.
      ((/^[ \r\n]/.test(value) && /[ \r\n]$/.test(value)) ||
        // Starts or ends with dollar.
        /^\$|\$$/.test(value))
    ) {
      value = ' ' + value + ' '
    }

    let index = -1

    // We have a potential problem: certain characters after eols could result in
    // blocks being seen.
    // For example, if someone injected the string `'\n# b'`, then that would
    // result in an ATX heading.
    // We can’t escape characters in `inlineMath`, but because eols are
    // transformed to spaces when going from markdown to HTML anyway, we can swap
    // them out.
    while (++index < state.unsafe.length) {
      const pattern = state.unsafe[index]

      // Only look for `atBreak`s.
      // Btw: note that `atBreak` patterns will always start the regex at LF or
      // CR.
      if (!pattern.atBreak) continue

      const expression = state.compilePattern(pattern)
      /** @type {RegExpExecArray | null} */
      let match

      while ((match = expression.exec(value))) {
        let position = match.index

        // Support CRLF (patterns only look for one of the characters).
        if (
          value.codePointAt(position) === 10 /* `\n` */ &&
          value.codePointAt(position - 1) === 13 /* `\r` */
        ) {
          position--
        }

        value = value.slice(0, position) + ' ' + value.slice(match.index + 1)
      }
    }

    return sequence + value + sequence
  }

  /**
   * @returns {string}
   */
  function inlineMathPeek() {
    return '$'
  }
}
p<.tx{
  "name": "mdast-util-math",
  "version": "3.0.0",
  "description": "mdast extension to parse and serialize math",
  "licenseunist",
    "mdast",
    "mdast-util",
    "util",
    "utility",
    "markdown",
    "markup",
    "math",
    "katex",
    "lBatex",
    "tex"
  ],
  "repository": "syntax-tree/mdast-util-math!syntax-tree/mdast-util-math=$exports": "./index.js",
  "files": [B6d.hast": "^3.0.0",
    "@types/mdast": "^4.0.0",longest-streak": "^3.0.0",
    "mdast-util-from-markdown": "^2.0.0",
    "mdast-util-to-markdown": "^2.1.0",
    "unist-util-remove-position": "^5L8extension-math": "^3`61%9Q5^O).js:~AG
9
@P"off"0 ,	5prefer-a	A
  }
}
2ߘxq0# mdast-util-math

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

[mdast][] extensions to parse and serialize math (`$C_L$`).

## Contents

*   [What is this?](#what-is-this)
*   [When to use this](#when-to-use-this)
*   [Install](#install)
*   [Use](#use)
*   [API](#api)
    *   [`mathFromMarkdown()`](#mathfrommarkdown)
    *   [`mathToMarkdown(options?)`](#mathtomarkdownoptions)
    *   [`InlineMath`](#inlinemath)
    *   [`Math`](#math)
    *   [`ToOptions`](#tooptions)
*   [HTML](#html)
*   [Syntax](#syntax)
*   [Syntax tree](#syntax-tree)
    *   [Nodes](#nodes)
    *   [Content model](#content-model)
*   [Types](#types)
*   [Compatibility](#compatibility)
*   [Related](#related)
*   [Contribute](#contribute)
*   [License](#license)

## What is this?

This package contains two extensions that add support for math syntax in
markdown to [mdast][].
These extensions plug into
[`mdast-util-from-markdown`][mdast-util-from-markdown] (to support parsing
math in markdown into a syntax tree) and
[`mdast-util-to-markdown`][mdast-util-to-markdown] (to support serializing
math in syntax trees to markdown).

## When to use this

This project is useful when you want to support math in markdown.
Extending markdown with a syntax extension makes the markdown less portable.
LaTeX equations are also quite hard.
But this mechanism works well when you want authors, that have some LaTeX
experience, to be able to embed rich diagrams of math in scientific text.

You can use these extensions when you are working with
`mdast-util-from-markdown` and `mdast-util-to-markdown` already.

When working with `mdast-util-from-markdown`, you must combine this package
with [`micromark-extension-math`][micromark-extension-math].

When you don’t need a syntax tree, you can use [`micromark`][micromark]
directly with
[`micromark-extension-math`][micromark-extension-math].

All these packages are used [`remark-math`][remark-math], which
focusses on making it easier to transform content by abstracting these
internals away.

This utility adds [fields on nodes][fields] so that the utility responsible for
turning mdast (markdown) nodes into hast (HTML) nodes,
[`mdast-util-to-hast`][mdast-util-to-hast], turns text (inline) math nodes into
`<code class="language-math math-inline">…</code>` and flow (block) math nodes
into `<pre><code class="language-math math-display">…</code></pre>`.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install mdast-util-math
```

In Deno with [`esm.sh`][esmsh]:

```js
import {mathFromMarkdown, mathToMarkdown} from 'https://esm.sh/mdast-util-math@3'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {mathFromMarkdown, mathToMarkdown} from 'https://esm.sh/mdast-util-math@3?bundle'
</script>
```

## Use

Say our document `example.md` contains:

```markdown
Lift($L$) can be determined by Lift Coefficient ($C_L$) like the following
equation.

$$
L = \frac{1}{2} \rho v^2 S C_L
$$
```

…and our module `example.js` looks as follows:

```js
import fs from 'node:fs/promises'
import {math} from 'micromark-extension-math'
import {fromMarkdown} from 'mdast-util-from-markdown'
import {mathFromMarkdown, mathToMarkdown} from 'mdast-util-math'
import {toMarkdown} from 'mdast-util-to-markdown'

const doc = await fs.readFile('example.md')

const tree = fromMarkdown(doc, {
  extensions: [math()],
  mdastExtensions: [mathFromMarkdown()]
})

console.log(tree)

const out = toMarkdown(tree, {extensions: [mathToMarkdown()]})

console.log(out)
```

…now running `node example.js` yields (positional info and data removed for
brevity):

```js
{
  type: 'root',
  children: [
    {
      type: 'paragraph',
      children: [
        {type: 'text', value: 'Lift('},
        {type: 'inlineMath', value: 'L', data: {/* … */}},
        {type: 'text', value: ') can be determined by Lift Coefficient ('},
        {type: 'inlineMath', value: 'C_L', data: {/* … */}},
        {type: 'text', value: ') like the following\nequation.'}
      ]
    },
    {type: 'math', meta: null, value: 'L = \\frac{1}{2} \\rho v^2 S C_L', data: {/* … */}}
  ]
}
```

```markdown
Lift($L$) can be determined by Lift Coefficient ($C_L$) like the following
equation.

$$
L = \frac{1}{2} \rho v^2 S C_L
$$
```

## API

This package exports the identifiers
[`mathFromMarkdown`][api-math-from-markdown]
and [`mathToMarkdown`][api-math-to-markdown].
There is no default export.

### `mathFromMarkdown()`

Create an extension for [`mdast-util-from-markdown`][mdast-util-from-markdown].

###### Returns

Extension for `mdast-util-from-markdown`
([`FromMarkdownExtension`][from-markdown-extension]).

### `mathToMarkdown(options?)`

Create an extension for [`mdast-util-to-markdown`][mdast-util-to-markdown].

###### Parameters

*   `options` ([`ToOptions`][api-to-options], optional)
    — configuration

###### Returns

Extension for `mdast-util-to-markdown`
([`ToMarkdownExtension`][to-markdown-extension]).

### `InlineMath`

Math (text) (TypeScript type).

###### Type

```ts
import type {Data, Literal} from 'mdast'

interface InlineMath extends Literal {
  type: 'inlineMath'
  data?: InlineMathData | undefined
}

export interface InlineMathData extends Data {}
```

### `Math`

Math (flow) (TypeScript type).

###### Type

```ts
import type {Data, Literal} from 'mdast'

interface Math extends Literal {
  type: 'math'
  meta?: string | null | undefined
  data?: MathData | undefined
}

export interface MathData extends Data {}
```

### `ToOptions`

Configuration (TypeScript type).

###### Fields

*   `singleDollarTextMath` (`boolean`, default: `true`)
    — whether to support math (text) with a single dollar.
    Single dollars work in Pandoc and many other places, but often interfere
    with “normal” dollars in text.
    If you turn this off, you can still use two or more dollars for text math

## HTML

This plugin integrates with [`mdast-util-to-hast`][mdast-util-to-hast].
When mdast is turned into hast the math nodes are turned into
`<code class="language-math math-inline">…</code>` and
`<pre><code class="language-math math-display">…</code></pre>` elements.

## Syntax

See [Syntax in `micromark-extension-frontmatter`][syntax].

## Syntax tree

The following interfaces are added to **[mdast][]** by this utility.

### Nodes

#### `Math`

```idl
interface Math <: Literal {
  type: 'code'
  meta: string?
}
```

**Math** (**[Literal][dfn-literal]**) represents a block of math,
such as LaTeX mathematical expressions.

**Math** can be used where **[flow][dfn-flow-content]** content is expected.
Its content is represented by its `value` field.

This node relates to the **[phrasing][dfn-phrasing-content]** content concept
**[InlineMath][dfn-inline-math]**.

A `meta` field can be present.
It represents custom information relating to the node.

For example, the following markdown:

```markdown
$$
L = \frac{1}{2} \rho v^2 S C_L
$$
```

Yields:

```js
{
  type: 'math',
  meta: null,
  value: 'L = \\frac{1}{2} \\rho v^2 S C_L',
  data: {/* … */}
}
```

#### `InlineMath`

```idl
interface InlineMath <: Literal {
  type: 'inlineMath'
}
```

**InlineMath** (**[Literal][dfn-literal]**) represents a fragment of computer
code, such as a file name, computer program, or anything a computer could parse.

**InlineMath** can be used where **[phrasing][dfn-phrasing-content]** content
is expected.
Its content is represented by its `value` field.

This node relates to the **[flow][dfn-flow-content]** content concept
**[Math][dfn-math]**.

For example, the following markdown:

```markdown
$L$
```

Yields:

```js
{type: 'inlineMath', value: 'L', data: {/* … */}}
```

### Content model

#### `FlowContent` (math)

```idl
type FlowContentMath = Math | FlowContent
```

#### `PhrasingContent` (math)

```idl
type PhrasingContentMath = InlineMath | PhrasingContent
```

## Types

This package is fully typed with [TypeScript][].
It exports the additional types [`InlineMath`][api-inline-math],
[`Math`][api-math], and [`ToOptions`][api-to-options].

It also registers the node types with `@types/mdast`.
If you’re working with the syntax tree, make sure to import this utility
somewhere in your types, as that registers the new node types in the tree.

```js
/**
 * @typedef {import('mdast-util-math')}
 */

import {visit} from 'unist-util-visit'

/** @type {import('mdast').Root} */
const tree = getMdastNodeSomeHow()

visit(tree, function (node) {
  // `node` can now be one of the nodes for math.
})
```

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line, `mdast-util-math@^3`,
compatible with Node.js 16.

This plugin works with `mdast-util-from-markdown` version 2+ and
`mdast-util-to-markdown` version 2+.

## Related

*   [`remark-math`][remark-math]
    — remark plugin to support math
*   [`micromark-extension-math`][micromark-extension-math]
    — micromark extension to parse math

## Contribute

See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for
ways to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organization, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/syntax-tree/mdast-util-math/workflows/main/badge.svg

[build]: https://github.com/syntax-tree/mdast-util-math/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-math.svg

[coverage]: https://codecov.io/github/syntax-tree/mdast-util-math

[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-math.svg

[downloads]: https://www.npmjs.com/package/mdast-util-math

[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-math

[size]: https://bundlejs.com/?q=mdast-util-math

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[collective]: https://opencollective.com/unified

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/syntax-tree/unist/discussions

[npm]: https://docs.npmjs.com/cli/install

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[typescript]: https://www.typescriptlang.org

[license]: license

[author]: https://wooorm.com

[health]: https://github.com/syntax-tree/.github

[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md

[support]: https://github.com/syntax-tree/.github/blob/main/support.md

[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md

[remark-math]: https://github.com/remarkjs/remark-math

[mdast]: https://github.com/syntax-tree/mdast

[mdast-util-from-markdown]: https://github.com/syntax-tree/mdast-util-from-markdown

[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown

[mdast-util-to-hast]: https://github.com/syntax-tree/mdast-util-to-hast

[micromark]: https://github.com/micromark/micromark

[micromark-extension-math]: https://github.com/micromark/micromark-extension-math

[syntax]: https://github.com/micromark/micromark-extension-math#syntax

[fields]: https://github.com/syntax-tree/mdast-util-to-hast#fields-on-nodes

[dfn-literal]: https://github.com/syntax-tree/mdast#literal

[from-markdown-extension]: https://github.com/syntax-tree/mdast-util-from-markdown#extension

[to-markdown-extension]: https://github.com/syntax-tree/mdast-util-to-markdown#options

[api-math-from-markdown]: #mathfrommarkdown

[api-math-to-markdown]: #mathtomarkdownoptions

[api-math]: #math

[api-inline-math]: #inlinemath

[api-to-options]: #tooptions

[dfn-flow-content]: #flowcontent-math

[dfn-phrasing-content]: #phrasingcontent-math

[dfn-inline-math]: #inlinemath-1

[dfn-math]: #math-1
px '100644 index.d.ts |^^*Y100644 index.js &'zn3dU--t6X&40000 lib bqF]=gKL#gG100644 license hQw.[ATqsy100644 package.json *#V-3100644 readme.md 
X逍:^5afsN@x+ export { phrasing } from "./lib/index.js";
Y=x( export {phrasing} from './lib/index.js'
9yIxJ 100644 index.d.ts YƘ duJʹι100644 index.js dv?@mW@ vx9export function phrasing(node?: unknown): node is import("mdast").Break | import("mdast").Delete | import("mdast").Emphasis | import("mdast").FootnoteReference | import("mdast").Image | import("mdast").ImageReference | import("mdast").InlineCode | import("mdast").Link | import("mdast").LinkReference | import("mdast").Strong | import("mdast").Text;
export type Html = import('mdast').Html;
export type PhrasingContent = import('mdast').PhrasingContent;
FTCx0/**
 * @typedef {import('mdast').Html} Html
 * @typedef {import('mdast').PhrasingContent} PhrasingContent
 */

import {convert} from 'unist-util-is'

/**
 * Check if the given value is *phrasing content*.
 *
 * > 👉 **Note**: Excludes `html`, which can be both phrasing or flow.
 *
 * @param node
 *   Thing to check, typically `Node`.
 * @returns
 *   Whether `value` is phrasing content.
 */

export const phrasing =
  /** @type {(node?: unknown) => node is Exclude<PhrasingContent, Html>} */
  (
    convert([
      'break',
      'delete',
      'emphasis',
      // To do: next major: removed since footnotes were added to GFM.
      'footnote',
      'footnoteReference',
      'image',
      'imageReference',
      'inlineCode',
      // Enabled by `mdast-util-math`:
      'inlineMath',
      'link',
      'linkReference',
      // Enabled by `mdast-util-mdx`:
      'mdxJsxTextElement',
      // Enabled by `mdast-util-mdx`:
      'mdxTextExpression',
      'strong',
      'text',
      // Enabled by `mdast-util-directive`:
      'textDirective'
    ])
  )
xF{%x (The MIT License)

Copyright (c) 2017 Titus Wormer <tituswormer@gmail.com>
Copyright (c) 2017 Victor Felder <victor@draft.li>

VE
?
'Software'9
 C
dB
E
Y
GZ'AS IS'
B
F
RD
D
A
7yFizxx\M)# mdast-util-phrasing	.utility to check if a node is phrasing content^="should I use this?](#when-should-iM phrasing(value)`](#phrasingvalue	?Security](#secur>sis a tiny utility to check that a given [node][] is [phrasing
content][phrasing].

## When should I use this?

This utility is typically useful if you’re making other utilities.
It uses [`unist-util-is`][unist-util-is], which you can use for your own cfhecks.

A different utility, [`hast-util-phrasing`][hast-util-phrasing], does the same
but on [hast][]x~phrasing	5phrasing6
"
phrasing@4	Uphrasing6
"
phrasing@4k
 N```js
import {phrasing} from 'mdast-util-phrasing'

phrasing({type: 'paragraph%!Alpha'}]})
// => false

phrasing({3Delta'}]})
// => true1 [`phrasing`][api-phrasingl%phrasing(value)`

Check if the given value is *[phrasing content][phrasing]*.

> 👉 **Note**: Excludes `html`, which can be both phrasing or flow.

###### Parameters

*   `value` (`unknown`)
    — thing to check, typically [`Node`][node]

###### Retu5rns

Whether `value` is phrasing content (`boolean`).Pextra types `mdast-util-phrasing@^4`,
compatible with Node.js 16.

## Security

Use of `mdast-util-phrasing` does not involve **[hast][]**, user content, or
change the tree, so there are no openings for [cross-site scripting (XSS)][xss]
attacks.

## Related

*   [`hast-util-phrasing`]("[hast-util-phrasing)
    — check if a hast node is phrasing content
*   [`unist-util-is`]("4unist-util-is)
    — check if a node passes a testRVictor Feld\phrasingWNphrasing[phrasing"Cphrasingv>phrasing<phrasingphrasing-phrasing-draft.li1!?xss]: https://en.wikipedia.org/wiki/Cross-site_scripting

[hastP%P!hast

[mdastP%P!"nodeP%P!"#nodes

[phraso!%" #phrasingcontent

[unist-util-isP%P!unist-util-is

[hast-util-phraso!%3hast-util-phrasing

[api-phrasing]: #phrasingvalue
LKx '100644 index.d.ts ZyWR0<n@ò100644 index.js $<$̢߭ީĝT40000 lib -pgE*% 100644 license Zbv8f,Q)100644 package.json l78T ]$B*a100644 readme.md -ŐT*lQN&R뇲Rbxexport type {
  ConstructNameMap,
  ConstructName,
  Handle,
  Handlers,
  Info,
  Join,
  Map,
  Options,
  SafeConfig,
  State,
  Tracker,
  Unsafe
} from './lib/types.js'
export {toMarkdown} from './lib/index.js'
export {handle as defaultHandlers} from './lib/handle/index.js'
1[Һ	x e// Note: extra types exposed from `index.d.ts`.
export {toMarkdown} from './lib/index.js'
export {handle as defaultHandlers} from './lib/handle/index.js'
6ڦ&xf100644 configure.d.ts rSB >L<-uZ9eQ100644 configure.d.ts.map psHV>	Ol8100644 configure.js BU1u~ O40000 handle x	»^@EV$100644 index.d.ts a* Je&dqJ100644 index.d.ts.map %,x4L!6100644 index.js 1T@Q\1100644 join.d.ts &xWq*]:DPPI`100644 join.d.ts.map ̀({Jx9100644 join.js 7ݱϸ@100644 types.d.ts LzRď100644 types.js r!f?W .Zf100644 unsafe.d.ts p]@{jU)N100644 unsafe.d.ts.map i.qĎ 100644 unsafe.js ԡ*7k40000 util "{}wwU_shOx/**
 * @param {State} base
 * @param {Options} extension
 * @returns {State}
 */
export function configure(base: State, extension: Options): State;
import type { State } from './types.js';
import type { Options } from './types.js';
//# sourceMappingURL=configure.d.ts.map"U]x G{"version":3,"file":"configure.d.ts","sourceRoot":"","sources":["configure.js"],"names":[],"mappings":"AAMA;;;;GAIG;AACH,gCAJW,KAAK,aACL,OAAO,GACL,KAAK,CA+CjB;2BAvDgC,YAAY;6BAAZ,YAAY"}S|7Yxj/**
 * @import {Options, State} from './types.js'
 */

const own = {}.hasOwnProperty

/**
 * @param {State} base
 * @param {Options} extension
 * @returns {State}
 */
export function configure(base, extension) {
  let index = -1
  /** @type {keyof Options} */
  let key

  // First do subextensions.
  if (extension.extensions) {
    while (++index < extension.extensions.length) {
      configure(base, extension.extensions[index])
    }
  }

  for (key in extension) {
    if (own.call(extension, key)) {
      switch (key) {
        case 'extensions': {
          // Empty.
          break
        }

        /* c8 ignore next 4 */
        case 'unsafe': {
          list(base[key], extension[key])
          break
        }

        case 'join': {
          list(base[key], extension[key])
          break
        }

        case 'handlers': {
          map(base[key], extension[key])
          break
        }

        default: {
          // @ts-expect-error: matches.
          base.options[key] = extension[key]
        }
      }
    }
  }

  return base
}

/**
 * @template T
 * @param {Array<T>} left
 * @param {Array<T> | null | undefined} right
 */
function list(left, right) {
  if (right) {
    left.push(...right)
  }
}

/**
 * @template T
 * @param {Record<string, T>} left
 * @param {Record<string, T> | null | undefined} right
 */
function map(left, right) {
  if (right) {
    Object.assign(left, right)
  }
}
m﬚x	S100644 blockquote.d.ts 6Qi juRHy100644 blockquote.d.ts.map :#7&?`Ehڿ`Hi100644 blockquote.js mBhόyQe100644 break.d.ts <= Y @8100644 break.d.ts.map $F3D100644 break.js O|~4r`100644 code.d.ts &|abeIx0U100644 code.d.ts.map ؖI{M;ijg100644 code.js hNt.>:'6D100644 definition.d.ts U6m=!Y%y]100644 definition.d.ts.map g m 0100644 definition.js QogcsÝ 100644 emphasis.d.ts ?4D~'d_o_36100644 emphasis.d.ts.map Qb\Mu8WWO100644 emphasis.js TtY*Ꮑ6QN100644 heading.d.ts b	Lis&e100644 heading.d.ts.map dn駚#SBIF9U100644 heading.js !79Z>T8µ￭100644 html.d.ts ni.!>%100644 html.d.ts.map wOԛlZ+Q- M100644 html.js I7->(CI
5100644 image-reference.d.ts NSFg{cj-`100644 image-reference.d.ts.map H[C;^zZZ;100644 image-reference.js !Zč㪸ppSJj100644 image.d.ts l1S"DMr+ib100644 image.d.ts.map ˬJ;+zNB[	FGd"100644 image.js \\cq=100644 index.d.ts #X-)Vph,100644 index.d.ts.map a!jmP9id100644 index.js 6,fl.ZG 7100644 inline-code.d.ts ZHbۀ<K0/ 100644 inline-code.d.ts.map K >BʓȏZb;100644 inline-code.js QI3',100644 link-reference.d.ts 9χ/"IR@100644 link-reference.d.ts.map y}	zY^/100644 link-reference.js #MG>pϜAx100644 link.d.ts ƱU,C1,u100644 link.d.ts.map h_[q2YSTUZ100644 link.js ii9$+ɣ"h|100644 list-item.d.ts d|}100644 list-item.d.ts.map 	E#!_e+M.YQm	?+k100644 list-item.js 0-y* j100644 list.d.ts '+VSK8wz?|p100644 list.d.ts.map $d7$BK}9100644 list.js $ 7$J}$&ג100644 paragraph.d.ts ITչK@@9^d100644 paragraph.d.ts.map *ȓ0EH`tJDn100644 paragraph.js ck'x{V/S100644 root.d.ts KU9&f100644 root.d.ts.map jjZUsv\100644 root.js xDehChP100644 strong.d.ts 1&ٌ*v7PS]100644 strong.d.ts.map HCrX٤i(lh* >100644 strong.js G]_x7< k۰t$100644 text.d.ts 6zFD4B[B<100644 text.d.ts.map s|cIl|S-2100644 text.js F> tn["؝<F100644 thematic-break.d.ts J7jYQ<a100644 thematic-break.d.ts.map ֜~CU 100644 thematic-break.js q*r	TkVvK$xC/**
 * @import {Blockquote, Parents} from 'mdast'
 * @import {Info, Map, State} from 'mdast-util-to-markdown'
 */
/**
 * @param {Blockquote} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function blockquote(node: Blockquote, _: Parents | undefined, state: State, info: Info): string;
import type { Blockquote } from 'mdast';
import type { Parents } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
import type { Info } from 'mdast-util-to-markdown';
//# sourceMappingURL=blockquote.d.ts.mapvHx{"version":3,"file":"blockquote.d.ts","sourceRoot":"","sources":["blockquote.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AACH,iCANW,UAAU,KACV,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CAalB;gCAtBqC,OAAO;6BAAP,OAAO;2BACV,wBAAwB;0BAAxB,wBAAwB"}IL7(xz/**
 * @import {Blockquote, Parents} from 'mdast'
 * @import {Info, Map, State} from 'mdast-util-to-markdown'
 */

/**
 * @param {Blockquote} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function blockquote(node, _, state, info) {
  const exit = state.enter('blockquote')
  const tracker = state.createTracker(info)
  tracker.move('> ')
  tracker.shift(2)
  const value = state.indentLines(
    state.containerFlow(node, tracker.current()),
    map
  )
  exit()
  return value
}

/** @type {Map} */
function map(line, _, blank) {
  return '>' + (blank ? '' : ' ') + line
}
ЩxG/**
 * @param {Break} _
 * @param {Parents | undefined} _1
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function hardBreak(_: Break, _1: Parents | undefined, state: State, info: Info): string;
import type { Break } from 'mdast';
import type { Parents } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
import type { Info } from 'mdast-util-to-markdown';
//# sourceMappingURL=break.d.ts.map:x {"version":3,"file":"break.d.ts","sourceRoot":"","sources":["break.js"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,6BANW,KAAK,MACL,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CAiBlB;2BA5BgC,OAAO;6BAAP,OAAO;2BACV,wBAAwB;0BAAxB,wBAAwB"}DG,x>/**
 * @import {Break, Parents} from 'mdast'
 * @import {Info, State} from 'mdast-util-to-markdown'
 */

import {patternInScope} from '../util/pattern-in-scope.js'

/**
 * @param {Break} _
 * @param {Parents | undefined} _1
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function hardBreak(_, _1, state, info) {
  let index = -1

  while (++index < state.unsafe.length) {
    // If we can’t put eols in this construct (setext headings, tables), use a
    // space instead.
    if (
      state.unsafe[index].character === '\n' &&
      patternInScope(state.stack, state.unsafe[index])
    ) {
      return /[ \t]/.test(info.before) ? '' : ' '
    }
  }

  return '\\\n'
}
^vxL/**
 * @param {Code} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function code(node: Code, _: Parents | undefined, state: State, info: Info): string;
import type { Code } from 'mdast';
import type { Parents } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
import type { Info } from 'mdast-util-to-markdown';
//# sourceMappingURL=code.d.ts.map&x {"version":3,"file":"code.d.ts","sourceRoot":"","sources":["code.js"],"names":[],"mappings":"AASA;;;;;;GAMG;AACH,2BANW,IAAI,KACJ,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CAuDlB;0BAnE+B,OAAO;6BAAP,OAAO;2BADJ,wBAAwB;0BAAxB,wBAAwB"}AZCkmx"/**
 * @import {Info, Map, State} from 'mdast-util-to-markdown'
 * @import {Code, Parents} from 'mdast'
 */

import {longestStreak} from 'longest-streak'
import {formatCodeAsIndented} from '../util/format-code-as-indented.js'
import {checkFence} from '../util/check-fence.js'

/**
 * @param {Code} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function code(node, _, state, info) {
  const marker = checkFence(state)
  const raw = node.value || ''
  const suffix = marker === '`' ? 'GraveAccent' : 'Tilde'

  if (formatCodeAsIndented(node, state)) {
    const exit = state.enter('codeIndented')
    const value = state.indentLines(raw, map)
    exit()
    return value
  }

  const tracker = state.createTracker(info)
  const sequence = marker.repeat(Math.max(longestStreak(raw, marker) + 1, 3))
  const exit = state.enter('codeFenced')
  let value = tracker.move(sequence)

  if (node.lang) {
    const subexit = state.enter(`codeFencedLang${suffix}`)
    value += tracker.move(
      state.safe(node.lang, {
        before: value,
        after: ' ',
        encode: ['`'],
        ...tracker.current()
      })
    )
    subexit()
  }

  if (node.lang && node.meta) {
    const subexit = state.enter(`codeFencedMeta${suffix}`)
    value += tracker.move(' ')
    value += tracker.move(
      state.safe(node.meta, {
        before: value,
        after: '\n',
        encode: ['`'],
        ...tracker.current()
      })
    )
    subexit()
  }

  value += tracker.move('\n')

  if (raw) {
    value += tracker.move(raw + '\n')
  }

  value += tracker.move(sequence)
  exit()
  return value
}

/** @type {Map} */
function map(line, _, blank) {
  return (blank ? '' : '    ') + line
}
b#x./**
 * @param {Definition} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function definition(node: Definition, _: Parents | undefined, state: State, info: Info): string;
import type { Definition } from 'mdast';
import type { Parents } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
import type { Info } from 'mdast-util-to-markdown';
//# sourceMappingURL=definition.d.ts.mapUx 	{"version":3,"file":"definition.d.ts","sourceRoot":"","sources":["definition.js"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,iCANW,UAAU,KACV,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CA+DlB;gCAzEqC,OAAO;6BAAP,OAAO;2BADf,wBAAwB;0BAAxB,wBAAwB"}I<nx/**
 * @import {Info, State} from 'mdast-util-to-markdown'
 * @import {Definition, Parents} from 'mdast'
 */

import {checkQuote} from '../util/check-quote.js'

/**
 * @param {Definition} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function definition(node, _, state, info) {
  const quote = checkQuote(state)
  const suffix = quote === '"' ? 'Quote' : 'Apostrophe'
  const exit = state.enter('definition')
  let subexit = state.enter('label')
  const tracker = state.createTracker(info)
  let value = tracker.move('[')
  value += tracker.move(
    state.safe(state.associationId(node), {
      before: value,
      after: ']',
      ...tracker.current()
    })
  )
  value += tracker.move(']: ')

  subexit()

  if (
    // If there’s no url, or…
    !node.url ||
    // If there are control characters or whitespace.
    /[\0- \u007F]/.test(node.url)
  ) {
    subexit = state.enter('destinationLiteral')
    value += tracker.move('<')
    value += tracker.move(
      state.safe(node.url, {before: value, after: '>', ...tracker.current()})
    )
    value += tracker.move('>')
  } else {
    // No whitespace, raw is prettier.
    subexit = state.enter('destinationRaw')
    value += tracker.move(
      state.safe(node.url, {
        before: value,
        after: node.title ? ' ' : '\n',
        ...tracker.current()
      })
    )
  }

  subexit()

  if (node.title) {
    subexit = state.enter(`title${suffix}`)
    value += tracker.move(' ' + quote)
    value += tracker.move(
      state.safe(node.title, {
        before: value,
        after: quote,
        ...tracker.current()
      })
    )
    value += tracker.move(quote)
    subexit()
  }

  exit()

  return value
}
`-x /**
 * @param {Emphasis} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function emphasis(node: Emphasis, _: Parents | undefined, state: State, info: Info): string;
export namespace emphasis {
    export { emphasisPeek as peek };
}
import type { Emphasis } from 'mdast';
import type { Parents } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
import type { Info } from 'mdast-util-to-markdown';
/**
 * @param {Emphasis} _
 * @param {Parents | undefined} _1
 * @param {State} state
 * @returns {string}
 */
declare function emphasisPeek(_: Emphasis, _1: Parents | undefined, state: State): string;
export {};
//# sourceMappingURL=emphasis.d.ts.mapwxD{"version":3,"file":"emphasis.d.ts","sourceRoot":"","sources":["emphasis.js"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,+BANW,QAAQ,KACR,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CA0ClB;;;;8BAxDmC,OAAO;6BAAP,OAAO;2BADb,wBAAwB;0BAAxB,wBAAwB;AA2DtD;;;;;GAKG;AACH,iCALW,QAAQ,MACR,OAAO,GAAG,SAAS,SACnB,KAAK,GACH,MAAM,CAIlB"}\hxx/**
 * @import {Info, State} from 'mdast-util-to-markdown'
 * @import {Emphasis, Parents} from 'mdast'
 */

import {checkEmphasis} from '../util/check-emphasis.js'
import {encodeCharacterReference} from '../util/encode-character-reference.js'
import {encodeInfo} from '../util/encode-info.js'

emphasis.peek = emphasisPeek

/**
 * @param {Emphasis} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function emphasis(node, _, state, info) {
  const marker = checkEmphasis(state)
  const exit = state.enter('emphasis')
  const tracker = state.createTracker(info)
  const before = tracker.move(marker)

  let between = tracker.move(
    state.containerPhrasing(node, {
      after: marker,
      before,
      ...tracker.current()
    })
  )
  const betweenHead = between.charCodeAt(0)
  const open = encodeInfo(
    info.before.charCodeAt(info.before.length - 1),
    betweenHead,
    marker
  )

  if (open.inside) {
    between = encodeCharacterReference(betweenHead) + between.slice(1)
  }

  const betweenTail = between.charCodeAt(between.length - 1)
  const close = encodeInfo(info.after.charCodeAt(0), betweenTail, marker)

  if (close.inside) {
    between = between.slice(0, -1) + encodeCharacterReference(betweenTail)
  }

  const after = tracker.move(marker)

  exit()

  state.attentionEncodeSurroundingInfo = {
    after: close.outside,
    before: open.outside
  }
  return before + between + after
}

/**
 * @param {Emphasis} _
 * @param {Parents | undefined} _1
 * @param {State} state
 * @returns {string}
 */
function emphasisPeek(_, _1, state) {
  return state.options.emphasis || '*'
}
#*x=/**
 * @param {Heading} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function heading(node: Heading, _: Parents | undefined, state: State, info: Info): string;
import type { Heading } from 'mdast';
import type { Parents } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
import type { Info } from 'mdast-util-to-markdown';
//# sourceMappingURL=heading.d.ts.map/x {"version":3,"file":"heading.d.ts","sourceRoot":"","sources":["heading.js"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,8BANW,OAAO,KACP,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CA6DlB;6BAxEkC,OAAO;6BAAP,OAAO;2BADZ,wBAAwB;0BAAxB,wBAAwB"}vFx/**
 * @import {Info, State} from 'mdast-util-to-markdown'
 * @import {Heading, Parents} from 'mdast'
 */

import {encodeCharacterReference} from '../util/encode-character-reference.js'
import {formatHeadingAsSetext} from '../util/format-heading-as-setext.js'

/**
 * @param {Heading} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function heading(node, _, state, info) {
  const rank = Math.max(Math.min(6, node.depth || 1), 1)
  const tracker = state.createTracker(info)

  if (formatHeadingAsSetext(node, state)) {
    const exit = state.enter('headingSetext')
    const subexit = state.enter('phrasing')
    const value = state.containerPhrasing(node, {
      ...tracker.current(),
      before: '\n',
      after: '\n'
    })
    subexit()
    exit()

    return (
      value +
      '\n' +
      (rank === 1 ? '=' : '-').repeat(
        // The whole size…
        value.length -
          // Minus the position of the character after the last EOL (or
          // 0 if there is none)…
          (Math.max(value.lastIndexOf('\r'), value.lastIndexOf('\n')) + 1)
      )
    )
  }

  const sequence = '#'.repeat(rank)
  const exit = state.enter('headingAtx')
  const subexit = state.enter('phrasing')

  // Note: for proper tracking, we should reset the output positions when there
  // is no content returned, because then the space is not output.
  // Practically, in that case, there is no content, so it doesn’t matter that
  // we’ve tracked one too many characters.
  tracker.move(sequence + ' ')

  let value = state.containerPhrasing(node, {
    before: '# ',
    after: '\n',
    ...tracker.current()
  })

  if (/^[\t ]/.test(value)) {
    // To do: what effect has the character reference on tracking?
    value = encodeCharacterReference(value.charCodeAt(0)) + value.slice(1)
  }

  value = value ? sequence + ' ' + value : sequence

  if (state.options.closeAtx) {
    value += ' ' + sequence
  }

  subexit()
  exit()

  return value
}
slx*/**
 * @param {Html} node
 * @returns {string}
 */
export function html(node: Html): string;
export namespace html {
    export { htmlPeek as peek };
}
import type { Html } from 'mdast';
/**
 * @returns {string}
 */
declare function htmlPeek(): string;
export {};
//# sourceMappingURL=html.d.ts.map>dx D{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["html.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH,2BAHW,IAAI,GACF,MAAM,CAIlB;;;;0BAXsB,OAAO;AAa9B;;GAEG;AACH,6BAFa,MAAM,CAIlB"}7L6ӽx /**
 * @import {Html} from 'mdast'
 */

html.peek = htmlPeek

/**
 * @param {Html} node
 * @returns {string}
 */
export function html(node) {
  return node.value || ''
}

/**
 * @returns {string}
 */
function htmlPeek() {
  return '<'
}
}xJ(xs/**
 * @param {ImageReference} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function imageReference(node: ImageReference, _: Parents | undefined, state: State, info: Info): string;
export namespace imageReference {
    export { imageReferencePeek as peek };
}
import type { ImageReference } from 'mdast';
import type { Parents } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
import type { Info } from 'mdast-util-to-markdown';
/**
 * @returns {string}
 */
declare function imageReferencePeek(): string;
export {};
//# sourceMappingURL=image-reference.d.ts.map!⻷x'{"version":3,"file":"image-reference.d.ts","sourceRoot":"","sources":["image-reference.js"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,qCANW,cAAc,KACd,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CA2ClB;;;;oCArDyC,OAAO;6BAAP,OAAO;2BADnB,wBAAwB;0BAAxB,wBAAwB;AAwDtD;;GAEG;AACH,uCAFa,MAAM,CAIlB"}jWgxt/**
 * @import {Info, State} from 'mdast-util-to-markdown'
 * @import {LinkReference, Parents} from 'mdast'
 */

linkReference.peek = linkReferencePeek

/**
 * @param {LinkReference} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function linkReference(node, _, state, info) {
  const type = node.referenceType
  const exit = state.enter('linkReference')
  let subexit = state.enter('label')
  const tracker = state.createTracker(info)
  let value = tracker.move('[')
  const text = state.containerPhrasing(node, {
    before: value,
    after: ']',
    ...tracker.current()
  })
  value += tracker.move(text + '][')

  subexit()
  // Hide the fact that we’re in phrasing, because escapes don’t work.
  const stack = state.stack
  state.stack = []
  subexit = state.enter('reference')
  // Note: for proper tracking, we should reset the output positions when we end
  // up making a `shortcut` reference, because then there is no brace output.
  // Practically, in that case, there is no content, so it doesn’t matter that
  // we’ve tracked one too many characters.
  const reference = state.safe(state.associationId(node), {
    before: value,
    after: ']',
    ...tracker.current()
  })
  subexit()
  state.stack = stack
  exit()

  if (type === 'full' || !text || text !== reference) {
    value += tracker.move(reference + ']')
  } else if (type === 'shortcut') {
    // Remove the unwanted `[`.
    value = value.slice(0, -1)
  } else {
    value += tracker.move(']')
  }

  return value
}

/**
 * @returns {string}
 */
function linkReferencePeek() {
  return '['
}
gtx GGImageK&imageReference.peek = imageImageimage9`imagey&![')
  const alt = state.safe(node.altGal	alt || alG&imageReferencePeek() {
  return '!'
}
X>	$xC/**
 * @param {Image} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function image(node: Image, _: Parents | undefined, state: State, info: Info): string;
export namespace image {
    export { imagePeek as peek };
}
import type { Image } from 'mdast';
import type { Parents } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
import type { Info } from 'mdast-util-to-markdown';
/**
 * @returns {string}
 */
declare function imagePeek(): string;
export {};
//# sourceMappingURL=image.d.ts.map=x{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["image.js"],"names":[],"mappings":"AASA;;;;;;GAMG;AACH,4BANW,KAAK,KACL,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CA4DlB;;;;2BAxEgC,OAAO;6BAAP,OAAO;2BADV,wBAAwB;0BAAxB,wBAAwB;AA2EtD;;GAEG;AACH,8BAFa,MAAM,CAIlB"}NCsx=/**
 * @import {Info, State} from 'mdast-util-to-markdown'
 * @import {Image, Parents} from 'mdast'
 */

import {checkQuote} from '../util/check-quote.js'

image.peek = imagePeek

/**
 * @param {Image} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function image(node, _, state, info) {
  const quote = checkQuote(state)
  const suffix = quote === '"' ? 'Quote' : 'Apostrophe'
  const exit = state.enter('image')
  let subexit = state.enter('label')
  const tracker = state.createTracker(info)
  let value = tracker.move('![')
  value += tracker.move(
    state.safe(node.alt, {before: value, after: ']', ...tracker.current()})
  )
  value += tracker.move('](')

  subexit()

  if (
    // If there’s no url but there is a title…
    (!node.url && node.title) ||
    // If there are control characters or whitespace.
    /[\0- \u007F]/.test(node.url)
  ) {
    subexit = state.enter('destinationLiteral')
    value += tracker.move('<')
    value += tracker.move(
      state.safe(node.url, {before: value, after: '>', ...tracker.current()})
    )
    value += tracker.move('>')
  } else {
    // No whitespace, raw is prettier.
    subexit = state.enter('destinationRaw')
    value += tracker.move(
      state.safe(node.url, {
        before: value,
        after: node.title ? ' ' : ')',
        ...tracker.current()
      })
    )
  }

  subexit()

  if (node.title) {
    subexit = state.enter(`title${suffix}`)
    value += tracker.move(' ' + quote)
    value += tracker.move(
      state.safe(node.title, {
        before: value,
        after: quote,
        ...tracker.current()
      })
    )
    value += tracker.move(quote)
    subexit()
  }

  value += tracker.move(')')
  exit()

  return value
}

/**
 * @returns {string}
 */
function imagePeek() {
  return '!'
}
u=&TxJexport namespace handle {
    export { blockquote };
    export { hardBreak as break };
    export { code };
    export { definition };
    export { emphasis };
    export { hardBreak };
    export { heading };
    export { html };
    export { image };
    export { imageReference };
    export { inlineCode };
    export { link };
    export { linkReference };
    export { list };
    export { listItem };
    export { paragraph };
    export { root };
    export { strong };
    export { text };
    export { thematicBreak };
}
import { blockquote } from './blockquote.js';
import { hardBreak } from './break.js';
import { code } from './code.js';
import { definition } from './definition.js';
import { emphasis } from './emphasis.js';
import { heading } from './heading.js';
import { html } from './html.js';
import { image } from './image.js';
import { imageReference } from './image-reference.js';
import { inlineCode } from './inline-code.js';
import { link } from './link.js';
import { linkReference } from './link-reference.js';
import { list } from './list.js';
import { listItem } from './list-item.js';
import { paragraph } from './paragraph.js';
import { root } from './root.js';
import { strong } from './strong.js';
import { text } from './text.js';
import { thematicBreak } from './thematic-break.js';
//# sourceMappingURL=index.d.ts.map"Ŵxa{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;2BAAyB,iBAAiB;0BAClB,YAAY;qBACjB,WAAW;2BACL,iBAAiB;yBACnB,eAAe;wBAChB,cAAc;qBACjB,WAAW;sBACV,YAAY;+BACH,sBAAsB;2BAC1B,kBAAkB;qBACxB,WAAW;8BACF,qBAAqB;qBAC9B,WAAW;yBACP,gBAAgB;0BACf,gBAAgB;qBACrB,WAAW;uBACT,aAAa;qBACf,WAAW;8BACF,qBAAqB"}gAximport {blockquote} from './blockquote.js'
import {hardBreak} from './break.js'
import {code} from './code.js'
import {definition} from './definition.js'
import {emphasis} from './emphasis.js'
import {heading} from './heading.js'
import {html} from './html.js'
import {image} from './image.js'
import {imageReference} from './image-reference.js'
import {inlineCode} from './inline-code.js'
import {link} from './link.js'
import {linkReference} from './link-reference.js'
import {list} from './list.js'
import {listItem} from './list-item.js'
import {paragraph} from './paragraph.js'
import {root} from './root.js'
import {strong} from './strong.js'
import {text} from './text.js'
import {thematicBreak} from './thematic-break.js'

/**
 * Default (CommonMark) handlers.
 */
export const handle = {
  blockquote,
  break: hardBreak,
  code,
  definition,
  emphasis,
  hardBreak,
  heading,
  html,
  image,
  imageReference,
  inlineCode,
  link,
  linkReference,
  list,
  listItem,
  paragraph,
  root,
  strong,
  text,
  thematicBreak
}
dζ!x/**
 * @param {InlineCode} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @returns {string}
 */
export function inlineCode(node: InlineCode, _: Parents | undefined, state: State): string;
export namespace inlineCode {
    export { inlineCodePeek as peek };
}
import type { InlineCode } from 'mdast';
import type { Parents } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
/**
 * @returns {string}
 */
declare function inlineCodePeek(): string;
export {};
//# sourceMappingURL=inline-code.d.ts.mapvϸ\x{"version":3,"file":"inline-code.d.ts","sourceRoot":"","sources":["inline-code.js"],"names":[],"mappings":"AAOA;;;;;GAKG;AACH,iCALW,UAAU,KACV,OAAO,GAAG,SAAS,SACnB,KAAK,GACH,MAAM,CAyDlB;;;;gCAlEqC,OAAO;6BAAP,OAAO;2BADrB,wBAAwB;AAqEhD;;GAEG;AACH,mCAFa,MAAM,CAIlB"}OMxb/**
 * @import {State} from 'mdast-util-to-markdown'
 * @import {InlineCode, Parents} from 'mdast'
 */

inlineCode.peek = inlineCodePeek

/**
 * @param {InlineCode} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @returns {string}
 */
export function inlineCode(node, _, state) {
  let value = node.value || ''
  let sequence = '`'
  let index = -1

  // If there is a single grave accent on its own in the code, use a fence of
  // two.
  // If there are two in a row, use one.
  while (new RegExp('(^|[^`])' + sequence + '([^`]|$)').test(value)) {
    sequence += '`'
  }

  // If this is not just spaces or eols (tabs don’t count), and either the
  // first or last character are a space, eol, or tick, then pad with spaces.
  if (
    /[^ \r\n]/.test(value) &&
    ((/^[ \r\n]/.test(value) && /[ \r\n]$/.test(value)) || /^`|`$/.test(value))
  ) {
    value = ' ' + value + ' '
  }

  // We have a potential problem: certain characters after eols could result in
  // blocks being seen.
  // For example, if someone injected the string `'\n# b'`, then that would
  // result in an ATX heading.
  // We can’t escape characters in `inlineCode`, but because eols are
  // transformed to spaces when going from markdown to HTML anyway, we can swap
  // them out.
  while (++index < state.unsafe.length) {
    const pattern = state.unsafe[index]
    const expression = state.compilePattern(pattern)
    /** @type {RegExpExecArray | null} */
    let match

    // Only look for `atBreak`s.
    // Btw: note that `atBreak` patterns will always start the regex at LF or
    // CR.
    if (!pattern.atBreak) continue

    while ((match = expression.exec(value))) {
      let position = match.index

      // Support CRLF (patterns only look for one of the characters).
      if (
        value.charCodeAt(position) === 10 /* `\n` */ &&
        value.charCodeAt(position - 1) === 13 /* `\r` */
      ) {
        position--
      }

      value = value.slice(0, position) + ' ' + value.slice(match.index + 1)
    }
  }

  return sequence + value + sequence
}

/**
 * @returns {string}
 */
function inlineCodePeek() {
  return '`'
}
YVx x/**
 * @param {LinklinkReference(node: LinkW!linkReference {
    export { link1)Link_link;9link-reference.d.ts.mapҌ-Sx] link-linkL;oCANW,aAAa,KACb9mCArDwC,OAAO;6BAAP,OAAO;2BADl)sCAFa,MAAM,CAIlB"}H=+xD/**
 * @param {Link} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function link(node: Link, _: Parents | undefined, state: State, info: Info): string;
export namespace link {
    export { linkPeek as peek };
}
import type { Link } from 'mdast';
import type { Parents } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
import type { Info } from 'mdast-util-to-markdown';
/**
 * @param {Link} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @returns {string}
 */
declare function linkPeek(node: Link, _: Parents | undefined, state: State): string;
export {};
//# sourceMappingURL=link.d.ts.mapaWx<{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["link.js"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,2BANW,IAAI,KACJ,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CAuFlB;;;;0BArG+B,OAAO;6BAAP,OAAO;2BADT,wBAAwB;0BAAxB,wBAAwB;AAwGtD;;;;;GAKG;AACH,gCALW,IAAI,KACJ,OAAO,GAAG,SAAS,SACnB,KAAK,GACH,MAAM,CAIlB"}YTxg
/**
 * @import {Info, State} from 'mdast-util-to-markdown'
 * @import {Link, Parents} from 'mdast'
 * @import {Exit} from '../types.js'
 */

import {checkQuote} from '../util/check-quote.js'
import {formatLinkAsAutolink} from '../util/format-link-as-autolink.js'

link.peek = linkPeek

/**
 * @param {Link} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function link(node, _, state, info) {
  const quote = checkQuote(state)
  const suffix = quote === '"' ? 'Quote' : 'Apostrophe'
  const tracker = state.createTracker(info)
  /** @type {Exit} */
  let exit
  /** @type {Exit} */
  let subexit

  if (formatLinkAsAutolink(node, state)) {
    // Hide the fact that we’re in phrasing, because escapes don’t work.
    const stack = state.stack
    state.stack = []
    exit = state.enter('autolink')
    let value = tracker.move('<')
    value += tracker.move(
      state.containerPhrasing(node, {
        before: value,
        after: '>',
        ...tracker.current()
      })
    )
    value += tracker.move('>')
    exit()
    state.stack = stack
    return value
  }

  exit = state.enter('link')
  subexit = state.enter('label')
  let value = tracker.move('[')
  value += tracker.move(
    state.containerPhrasing(node, {
      before: value,
      after: '](',
      ...tracker.current()
    })
  )
  value += tracker.move('](')
  subexit()

  if (
    // If there’s no url but there is a title…
    (!node.url && node.title) ||
    // If there are control characters or whitespace.
    /[\0- \u007F]/.test(node.url)
  ) {
    subexit = state.enter('destinationLiteral')
    value += tracker.move('<')
    value += tracker.move(
      state.safe(node.url, {before: value, after: '>', ...tracker.current()})
    )
    value += tracker.move('>')
  } else {
    // No whitespace, raw is prettier.
    subexit = state.enter('destinationRaw')
    value += tracker.move(
      state.safe(node.url, {
        before: value,
        after: node.title ? ' ' : ')',
        ...tracker.current()
      })
    )
  }

  subexit()

  if (node.title) {
    subexit = state.enter(`title${suffix}`)
    value += tracker.move(' ' + quote)
    value += tracker.move(
      state.safe(node.title, {
        before: value,
        after: quote,
        ...tracker.current()
      })
    )
    value += tracker.move(quote)
    subexit()
  }

  value += tracker.move(')')

  exit()
  return value
}

/**
 * @param {Link} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @returns {string}
 */
function linkPeek(node, _, state) {
  return formatLinkAsAutolink(node, state) ? '<' : '['
}
9
x-/**
 * @param {ListItem} node
 * @param {Parents | undefined} parent
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function listItem(node: ListItem, parent: Parents | undefined, state: State, info: Info): string;
import type { ListItem } from 'mdast';
import type { Parents } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
import type { Info } from 'mdast-util-to-markdown';
//# sourceMappingURL=list-item.d.ts.mapEܢ9x {"version":3,"file":"list-item.d.ts","sourceRoot":"","sources":["list-item.js"],"names":[],"mappings":"AAQA;;;;;;GAMG;AACH,+BANW,QAAQ,UACR,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CAgDlB;8BA3DmC,OAAO;6BAAP,OAAO;2BADR,wBAAwB;0BAAxB,wBAAwB"}'GdxN/**
 * @import {Info, Map, State} from 'mdast-util-to-markdown'
 * @import {ListItem, Parents} from 'mdast'
 */

import {checkBullet} from '../util/check-bullet.js'
import {checkListItemIndent} from '../util/check-list-item-indent.js'

/**
 * @param {ListItem} node
 * @param {Parents | undefined} parent
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function listItem(node, parent, state, info) {
  const listItemIndent = checkListItemIndent(state)
  let bullet = state.bulletCurrent || checkBullet(state)

  // Add the marker value for ordered lists.
  if (parent && parent.type === 'list' && parent.ordered) {
    bullet =
      (typeof parent.start === 'number' && parent.start > -1
        ? parent.start
        : 1) +
      (state.options.incrementListMarker === false
        ? 0
        : parent.children.indexOf(node)) +
      bullet
  }

  let size = bullet.length + 1

  if (
    listItemIndent === 'tab' ||
    (listItemIndent === 'mixed' &&
      ((parent && parent.type === 'list' && parent.spread) || node.spread))
  ) {
    size = Math.ceil(size / 4) * 4
  }

  const tracker = state.createTracker(info)
  tracker.move(bullet + ' '.repeat(size - bullet.length))
  tracker.shift(size)
  const exit = state.enter('listItem')
  const value = state.indentLines(
    state.containerFlow(node, tracker.current()),
    map
  )
  exit()

  return value

  /** @type {Map} */
  function map(line, index, blank) {
    if (index) {
      return (blank ? '' : ' '.repeat(size)) + line
    }

    return (blank ? bullet : bullet + ' '.repeat(size - bullet.length)) + line
  }
}
nxB/**
 * @param {List} node
 * @param {Parents | undefined} parent
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function list(node: List, parent: Parents | undefined, state: State, info: Info): string;
import type { List } from 'mdast';
import type { Parents } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
import type { Info } from 'mdast-util-to-markdown';
//# sourceMappingURL=list.d.ts.mapÚ!x {"version":3,"file":"list.d.ts","sourceRoot":"","sources":["list.js"],"names":[],"mappings":"AAUA;;;;;;GAMG;AACH,2BANW,IAAI,UACJ,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CAoFlB;0BAjG+B,OAAO;6BAAP,OAAO;2BADT,wBAAwB;0BAAxB,wBAAwB"}wCxn/**
 * @import {Info, State} from 'mdast-util-to-markdown'
 * @import {List, Parents} from 'mdast'
 */

import {checkBullet} from '../util/check-bullet.js'
import {checkBulletOther} from '../util/check-bullet-other.js'
import {checkBulletOrdered} from '../util/check-bullet-ordered.js'
import {checkRule} from '../util/check-rule.js'

/**
 * @param {List} node
 * @param {Parents | undefined} parent
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function list(node, parent, state, info) {
  const exit = state.enter('list')
  const bulletCurrent = state.bulletCurrent
  /** @type {string} */
  let bullet = node.ordered ? checkBulletOrdered(state) : checkBullet(state)
  /** @type {string} */
  const bulletOther = node.ordered
    ? bullet === '.'
      ? ')'
      : '.'
    : checkBulletOther(state)
  let useDifferentMarker =
    parent && state.bulletLastUsed ? bullet === state.bulletLastUsed : false

  if (!node.ordered) {
    const firstListItem = node.children ? node.children[0] : undefined

    // If there’s an empty first list item directly in two list items,
    // we have to use a different bullet:
    //
    // ```markdown
    // * - *
    // ```
    //
    // …because otherwise it would become one big thematic break.
    if (
      // Bullet could be used as a thematic break marker:
      (bullet === '*' || bullet === '-') &&
      // Empty first list item:
      firstListItem &&
      (!firstListItem.children || !firstListItem.children[0]) &&
      // Directly in two other list items:
      state.stack[state.stack.length - 1] === 'list' &&
      state.stack[state.stack.length - 2] === 'listItem' &&
      state.stack[state.stack.length - 3] === 'list' &&
      state.stack[state.stack.length - 4] === 'listItem' &&
      // That are each the first child.
      state.indexStack[state.indexStack.length - 1] === 0 &&
      state.indexStack[state.indexStack.length - 2] === 0 &&
      state.indexStack[state.indexStack.length - 3] === 0
    ) {
      useDifferentMarker = true
    }

    // If there’s a thematic break at the start of the first list item,
    // we have to use a different bullet:
    //
    // ```markdown
    // * ---
    // ```
    //
    // …because otherwise it would become one big thematic break.
    if (checkRule(state) === bullet && firstListItem) {
      let index = -1

      while (++index < node.children.length) {
        const item = node.children[index]

        if (
          item &&
          item.type === 'listItem' &&
          item.children &&
          item.children[0] &&
          item.children[0].type === 'thematicBreak'
        ) {
          useDifferentMarker = true
          break
        }
      }
    }
  }

  if (useDifferentMarker) {
    bullet = bulletOther
  }

  state.bulletCurrent = bullet
  const value = state.containerFlow(node, info)
  state.bulletLastUsed = bullet
  state.bulletCurrent = bulletCurrent
  exit()
  return value
}
#x8/**
 * @import {Info, State} from 'mdast-util-to-markdown'
 * @import {Paragraph, Parents} from 'mdast'
 */
/**
 * @param {Paragraph} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function paragraph(node: Paragraph, _: Parents | undefined, state: State, info: Info): string;
import type { Paragraph } from 'mdast';
import type { Parents } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
import type { Info } from 'mdast-util-to-markdown';
//# sourceMappingURL=paragraph.d.ts.map~dx  {"version":3,"file":"paragraph.d.ts","sourceRoot":"","sources":["paragraph.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AACH,gCANW,SAAS,KACT,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CASlB;+BAjBoC,OAAO;6BAAP,OAAO;2BADd,wBAAwB;0BAAxB,wBAAwB"}@Jx,/**
 * @import {Info, State} from 'mdast-util-to-markdown'
 * @import {Paragraph, Parents} from 'mdast'
 */

/**
 * @param {Paragraph} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function paragraph(node, _, state, info) {
  const exit = state.enter('paragraph')
  const subexit = state.enter('phrasing')
  const value = state.containerPhrasing(node, info)
  subexit()
  exit()
  return value
}
e4xL/**
 * @param {Root} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function root(node: Root, _: Parents | undefined, state: State, info: Info): string;
import type { Root } from 'mdast';
import type { Parents } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
import type { Info } from 'mdast-util-to-markdown';
//# sourceMappingURL=root.d.ts.map1x {"version":3,"file":"root.d.ts","sourceRoot":"","sources":["root.js"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,2BANW,IAAI,KACJ,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CAUlB;0BApB+B,OAAO;6BAAP,OAAO;2BADT,wBAAwB;0BAAxB,wBAAwB"}3/C^#x?/**
 * @import {Info, State} from 'mdast-util-to-markdown'
 * @import {Parents, Root} from 'mdast'
 */

import {phrasing} from 'mdast-util-phrasing'

/**
 * @param {Root} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function root(node, _, state, info) {
  // Note: `html` nodes are ambiguous.
  const hasPhrasing = node.children.some(function (d) {
    return phrasing(d)
  })

  const container = hasPhrasing ? state.containerPhrasing : state.containerFlow
  return container.call(state, node, info)
}
Q¦<x-/**
 * @param {Strong} node":Xstrong(node: Strong, _:Sexport namespace strong {
    export { strongPeek as peek };
}
import type { Strong**
 * @param {StrongC:returns {string}
 */
declare function strongPeek(_: Strong':): string;
export {};
//# sourceMappingURL=strong.d.ts.mapΎhx@{"version":3,"file":"strong.d.ts","sourceRoot":"","sources":["strong.js"],"names":[],"mappings":"AAWA;;;;;;GAMG;AACH,6BANW,MAAM,KACN,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CA0ClB;;;;4BAxDiC,OAAO;6BAAP,OAAO;2BADX,wBAAwB;0BAAxB,wBAAwB;AA2DtD;;;;;GAKG;AACH,+BALW,MAAM,MACN,OAAO,GAAG,SAAS,SACnB,KAAK,GACH,MAAM,CAIlB"}7Zͱhx~/**
 * @import {Info, State} from 'mdast-util-to-markdown'
 * @import {Parents, Strong} from 'mdast'
 */

import {checkStrong} from '../util/check-strong.js'
import {encodeCharacterReference} from '../util/encode-character-reference.js'
import {encodeInfo} from '../util/encode-info.js'

strong.peek = strongPeek

/**
 * @param {Strong} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function strong(node, _, state, info) {
  const marker = checkStrong(state)
  const exit = state.enter('strong')
  const tracker = state.createTracker(info)
  const before = tracker.move(marker + marker)

  let between = tracker.move(
    state.containerPhrasing(node, {
      after: marker,
      before,
      ...tracker.current()
    })
  )
  const betweenHead = between.charCodeAt(0)
  const open = encodeInfo(
    info.before.charCodeAt(info.before.length - 1),
    betweenHead,
    marker
  )

  if (open.inside) {
    between = encodeCharacterReference(betweenHead) + between.slice(1)
  }

  const betweenTail = between.charCodeAt(between.length - 1)
  const close = encodeInfo(info.after.charCodeAt(0), betweenTail, marker)

  if (close.inside) {
    between = between.slice(0, -1) + encodeCharacterReference(betweenTail)
  }

  const after = tracker.move(marker + marker)

  exit()

  state.attentionEncodeSurroundingInfo = {
    after: close.outside,
    before: open.outside
  }
  return before + between + after
}

/**
 * @param {Strong} _
 * @param {Parents | undefined} _1
 * @param {State} state
 * @returns {string}
 */
function strongPeek(_, _1, state) {
  return state.options.strong || '*'
}
FN'!x/**
 * @import {Info, State} from 'mdast-util-to-markdown'
 * @import {Parents, Text} from 'mdast'
 */
/**
 * @param {Text} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function text(node: Text, _: Parents | undefined, state: State, info: Info): string;
import type { Text } from 'mdast';
import type { Parents } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
import type { Info } from 'mdast-util-to-markdown';
//# sourceMappingURL=text.d.ts.mapx {"version":3,"file":"text.d.ts","sourceRoot":"","sources":["text.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;GAMG;AACH,2BANW,IAAI,KACJ,OAAO,GAAG,SAAS,SACnB,KAAK,QACL,IAAI,GACF,MAAM,CAIlB;0BAZ+B,OAAO;6BAAP,OAAO;2BADT,wBAAwB;0BAAxB,wBAAwB"}Ex@/**
 * @import {Info, State} from 'mdast-util-to-markdown'
 * @import {Parents, Text} from 'mdast'
 */

/**
 * @param {Text} node
 * @param {Parents | undefined} _
 * @param {State} state
 * @param {Info} info
 * @returns {string}
 */
export function text(node, _, state, info) {
  return state.safe(node.value, info)
}
jxx/**
 * @param {ThematicBreak} _
 * @param {Parents | undefined} _1
 * @param {State} state
 * @returns {string}
 */
export function thematicBreak(_: ThematicBreak, _1: Parents | undefined, state: State): string;
import type { ThematicBreak } from 'mdast';
import type { Parents } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
//# sourceMappingURL=thematic-break.d.ts.mapC-x {"version":3,"file":"thematic-break.d.ts","sourceRoot":"","sources":["thematic-break.js"],"names":[],"mappings":"AAQA;;;;;GAKG;AACH,iCALW,aAAa,MACb,OAAO,GAAG,SAAS,SACnB,KAAK,GACH,MAAM,CAQlB;mCAlBwC,OAAO;6BAAP,OAAO;2BADxB,wBAAwB"}Er#x;/**
 * @import {State} from 'mdast-util-to-markdown'
 * @import {Parents, ThematicBreak} from 'mdast'
 */

import {checkRuleRepetition} from '../util/check-rule-repetition.js'
import {checkRule} from '../util/check-rule.js'

/**
 * @param {ThematicBreak} _
 * @param {Parents | undefined} _1
 * @param {State} state
 * @returns {string}
 */
export function thematicBreak(_, _1, state) {
  const value = (
    checkRule(state) + (state.options.ruleSpaces ? ' ' : '')
  ).repeat(checkRuleRepetition(state))

  return state.options.ruleSpaces ? value.slice(0, -1) : value
}
mx1/**
 * Turn an mdast syntax tree into markdown.
 *
 * @param {Nodes} tree
 *   Tree to serialize.
 * @param {Options | null | undefined} [options]
 *   Configuration (optional).
 * @returns {string}
 *   Serialized markdown representing `tree`.
 */
export function toMarkdown(tree: Nodes, options?: Options | null | undefined): string;
import type { Nodes } from 'mdast';
import type { Options } from 'mdast-util-to-markdown';
//# sourceMappingURL=index.d.ts.mapHx 1{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAmBA;;;;;;;;;GASG;AACH,iCAPW,KAAK,YAEL,OAAO,GAAG,IAAI,GAAG,SAAS,GAExB,MAAM,CAoElB;2BA5FuB,OAAO;6BAD0B,wBAAwB"}\<x7/**
 * @import {Info, Join, Options, SafeConfig, State} from 'mdast-util-to-markdown'
 * @import {Nodes} from 'mdast'
 * @import {Enter, FlowParents, PhrasingParents, TrackFields} from './types.js'
 */

import {zwitch} from 'zwitch'
import {configure} from './configure.js'
import {handle as handlers} from './handle/index.js'
import {join} from './join.js'
import {unsafe} from './unsafe.js'
import {association} from './util/association.js'
import {compilePattern} from './util/compile-pattern.js'
import {containerPhrasing} from './util/container-phrasing.js'
import {containerFlow} from './util/container-flow.js'
import {indentLines} from './util/indent-lines.js'
import {safe} from './util/safe.js'
import {track} from './util/track.js'

/**
 * Turn an mdast syntax tree into markdown.
 *
 * @param {Nodes} tree
 *   Tree to serialize.
 * @param {Options | null | undefined} [options]
 *   Configuration (optional).
 * @returns {string}
 *   Serialized markdown representing `tree`.
 */
export function toMarkdown(tree, options) {
  const settings = options || {}
  /** @type {State} */
  const state = {
    associationId: association,
    containerPhrasing: containerPhrasingBound,
    containerFlow: containerFlowBound,
    createTracker: track,
    compilePattern,
    enter,
    // @ts-expect-error: GFM / frontmatter are typed in `mdast` but not defined
    // here.
    handlers: {...handlers},
    // @ts-expect-error: add `handle` in a second.
    handle: undefined,
    indentLines,
    indexStack: [],
    join: [...join],
    options: {},
    safe: safeBound,
    stack: [],
    unsafe: [...unsafe]
  }

  configure(state, settings)

  if (state.options.tightDefinitions) {
    state.join.push(joinDefinition)
  }

  state.handle = zwitch('type', {
    invalid,
    unknown,
    handlers: state.handlers
  })

  let result = state.handle(tree, undefined, state, {
    before: '\n',
    after: '\n',
    now: {line: 1, column: 1},
    lineShift: 0
  })

  if (
    result &&
    result.charCodeAt(result.length - 1) !== 10 &&
    result.charCodeAt(result.length - 1) !== 13
  ) {
    result += '\n'
  }

  return result

  /** @type {Enter} */
  function enter(name) {
    state.stack.push(name)
    return exit

    /**
     * @returns {undefined}
     */
    function exit() {
      state.stack.pop()
    }
  }
}

/**
 * @param {unknown} value
 * @returns {never}
 */
function invalid(value) {
  throw new Error('Cannot handle value `' + value + '`, expected node')
}

/**
 * @param {unknown} value
 * @returns {never}
 */
function unknown(value) {
  // Always a node.
  const node = /** @type {Nodes} */ (value)
  throw new Error('Cannot handle unknown node `' + node.type + '`')
}

/** @type {Join} */
function joinDefinition(left, right) {
  // No blank line between adjacent definitions.
  if (left.type === 'definition' && left.type === right.type) {
    return 0
  }
}

/**
 * Serialize the children of a parent that contains phrasing children.
 *
 * These children will be joined flush together.
 *
 * @this {State}
 *   Info passed around about the current state.
 * @param {PhrasingParents} parent
 *   Parent of flow nodes.
 * @param {Info} info
 *   Info on where we are in the document we are generating.
 * @returns {string}
 *   Serialized children, joined together.
 */
function containerPhrasingBound(parent, info) {
  return containerPhrasing(parent, this, info)
}

/**
 * Serialize the children of a parent that contains flow children.
 *
 * These children will typically be joined by blank lines.
 * What they are joined by exactly is defined by `Join` functions.
 *
 * @this {State}
 *   Info passed around about the current state.
 * @param {FlowParents} parent
 *   Parent of flow nodes.
 * @param {TrackFields} info
 *   Info on where we are in the document we are generating.
 * @returns {string}
 *   Serialized children, joined by (blank) lines.
 */
function containerFlowBound(parent, info) {
  return containerFlow(parent, this, info)
}

/**
 * Make a string safe for embedding in markdown constructs.
 *
 * In markdown, almost all punctuation characters can, in certain cases,
 * result in something.
 * Whether they do is highly subjective to where they happen and in what
 * they happen.
 *
 * To solve this, `mdast-util-to-markdown` tracks:
 *
 * * Characters before and after something;
 * * What “constructs” we are in.
 *
 * This information is then used by this function to escape or encode
 * special characters.
 *
 * @this {State}
 *   Info passed around about the current state.
 * @param {string | null | undefined} value
 *   Raw value to make safe.
 * @param {SafeConfig} config
 *   Configuration.
 * @returns {string}
 *   Serialized markdown safe for embedding.
 */
function safeBound(value, config) {
  return safe(this, value, config)
}
!:y	x n/** @type {Array<Join>} */
export const join: Array<Join>;
import type { Join } from 'mdast-util-to-markdown';
//# sourceMappingURL=join.d.ts.mapV2,	x c{"version":3,"file":"join.d.ts","sourceRoot":"","sources":["join.js"],"names":[],"mappings":"AAOA,0BAA0B;AAC1B,mBADW,KAAK,CAAC,IAAI,CAAC,CACY;0BAPX,wBAAwB"}T.DxE/**
 * @import {Join} from 'mdast-util-to-markdown'
 */

import {formatCodeAsIndented} from './util/format-code-as-indented.js'
import {formatHeadingAsSetext} from './util/format-heading-as-setext.js'

/** @type {Array<Join>} */
export const join = [joinDefaults]

/** @type {Join} */
function joinDefaults(left, right, parent, state) {
  // Indented code after list or another indented code.
  if (
    right.type === 'code' &&
    formatCodeAsIndented(right, state) &&
    (left.type === 'list' ||
      (left.type === right.type && formatCodeAsIndented(left, state)))
  ) {
    return false
  }

  // Join children of a list or an item.
  // In which case, `parent` has a `spread` field.
  if ('spread' in parent && typeof parent.spread === 'boolean') {
    if (
      left.type === 'paragraph' &&
      // Two paragraphs.
      (left.type === right.type ||
        right.type === 'definition' ||
        // Paragraph followed by a setext heading.
        (right.type === 'heading' && formatHeadingAsSetext(right, state)))
    ) {
      return
    }

    return parent.spread ? 1 : 0
  }
}
$Y 
x0WϨimport type {
  Parents,
  PhrasingContent,
  TableCell,
  TableRow,
  Association,
  Nodes
} from 'mdast'
import type {Point} from 'unist'

/**
 * Get an identifier from an association to match it to others.
 *
 * Associations are nodes that match to something else through an ID:
 * <https://github.com/syntax-tree/mdast#association>.
 *
 * The `label` of an association is the string value: character escapes and
 * references work, and casing is intact.
 * The `identifier` is used to match one association to another:
 * controversially, character escapes and references don’t work in this
 * matching: `&copy;` does not match `©`, and `\+` does not match `+`.
 *
 * But casing is ignored (and whitespace) is trimmed and collapsed: ` A\nb`
 * matches `a b`.
 * So, we do prefer the label when figuring out how we’re going to serialize:
 * it has whitespace, casing, and we can ignore most useless character
 * escapes and all character references.
 *
 * @param node
 *   Node that includes an association.
 * @returns
 *   ID.
 */
export type AssociationId = (node: Association) => string

/**
 * Compile an unsafe pattern to a regex.
 *
 * @param info
 *   Pattern.
 * @returns
 *   Regex.
 */
export type CompilePattern = (info: Unsafe) => RegExp

/**
 * Interface of registered constructs.
 *
 * When working on extensions that use new constructs, extend the corresponding
 * interface to register its name:
 *
 * ```ts
 * declare module 'mdast-util-to-markdown' {
 *   interface ConstructNameMap {
 *     // Register a new construct name (value is used, key should match it).
 *     gfmStrikethrough: 'gfmStrikethrough'
 *   }
 * }
 * ```
 */
export interface ConstructNameMap {
  /**
   * Whole autolink.
   *
   * ```markdown
   * > | <https://example.com> and <admin@example.com>
   *     ^^^^^^^^^^^^^^^^^^^^^     ^^^^^^^^^^^^^^^^^^^
   * ```
   */
  autolink: 'autolink'
  /**
   * Whole block quote.
   *
   * ```markdown
   * > | > a
   *     ^^^
   * > | b
   *     ^
   * ```
   */
  blockquote: 'blockquote'
  /**
   * Whole code (indented).
   *
   * ```markdown
   * ␠␠␠␠console.log(1)
   * ^^^^^^^^^^^^^^^^^^
   * ```
   */
  codeIndented: 'codeIndented'
  /**
   * Whole code (fenced).
   *
   * ````markdown
   * > | ```js
   *     ^^^^^
   * > | console.log(1)
   *     ^^^^^^^^^^^^^^
   * > | ```
   *     ^^^
   * ````
   */
  codeFenced: 'codeFenced'
  /**
   * Code (fenced) language, when fenced with grave accents.
   *
   * ````markdown
   * > | ```js
   *        ^^
   *   | console.log(1)
   *   | ```
   * ````
   */
  codeFencedLangGraveAccent: 'codeFencedLangGraveAccent'
  /**
   * Code (fenced) language, when fenced with tildes.
   *
   * ````markdown
   * > | ~~~js
   *        ^^
   *   | console.log(1)
   *   | ~~~
   * ````
   */
  codeFencedLangTilde: 'codeFencedLangTilde'
  /**
   * Code (fenced) meta string, when fenced with grave accents.
   *
   * ````markdown
   * > | ```js eval
   *           ^^^^
   *   | console.log(1)
   *   | ```
   * ````
   */
  codeFencedMetaGraveAccent: 'codeFencedMetaGraveAccent'
  /**
   * Code (fenced) meta string, when fenced with tildes.
   *
   * ````markdown
   * > | ~~~js eval
   *           ^^^^
   *   | console.log(1)
   *   | ~~~
   * ````
   */
  codeFencedMetaTilde: 'codeFencedMetaTilde'
  /**
   * Whole definition.
   *
   * ```markdown
   * > | [a]: b "c"
   *     ^^^^^^^^^^
   * ```
   */
  definition: 'definition'
  /**
   * Destination (literal) (occurs in definition, image, link).
   *
   * ```markdown
   * > | [a]: <b> "c"
   *          ^^^
   * > | a ![b](<c> "d") e
   *            ^^^
   * ```
   */
  destinationLiteral: 'destinationLiteral'
  /**
   * Destination (raw) (occurs in definition, image, link).
   *
   * ```markdown
   * > | [a]: b "c"
   *          ^
   * > | a ![b](c "d") e
   *            ^
   * ```
   */
  destinationRaw: 'destinationRaw'
  /**
   * Emphasis.
   *
   * ```markdown
   * > | *a*
   *     ^^^
   * ```
   */
  emphasis: 'emphasis'
  /**
   * Whole heading (atx).
   *
   * ```markdown
   * > | # alpha
   *     ^^^^^^^
   * ```
   */
  headingAtx: 'headingAtx'
  /**
   * Whole heading (setext).
   *
   * ```markdown
   * > | alpha
   *     ^^^^^
   * > | =====
   *     ^^^^^
   * ```
   */
  headingSetext: 'headingSetext'
  /**
   * Whole image.
   *
   * ```markdown
   * > | ![a](b)
   *     ^^^^^^^
   * > | ![c]
   *     ^^^^
   * ```
   */
  image: 'image'
  /**
   * Whole image reference.
   *
   * ```markdown
   * > | ![a]
   *     ^^^^
   * ```
   */
  imageReference: 'imageReference'
  /**
   * Label (occurs in definitions, image reference, image, link reference,
   * link).
   *
   * ```markdown
   * > | [a]: b "c"
   *     ^^^
   * > | a [b] c
   *       ^^^
   * > | a ![b][c] d
   *       ^^^^
   * > | a [b](c) d
   *       ^^^
   * ```
   */
  label: 'label'
  /**
   * Whole link.
   *
   * ```markdown
   * > | [a](b)
   *     ^^^^^^
   * > | [c]
   *     ^^^
   * ```
   */
  link: 'link'
  /**
   * Whole link reference.
   *
   * ```markdown
   * > | [a]
   *     ^^^
   * ```
   */
  linkReference: 'linkReference'
  /**
   * List.
   *
   * ```markdown
   * > | * a
   *     ^^^
   * > | 1. b
   *     ^^^^
   * ```
   */
  list: 'list'
  /**
   * List item.
   *
   * ```markdown
   * > | * a
   *     ^^^
   * > | 1. b
   *     ^^^^
   * ```
   */
  listItem: 'listItem'
  /**
   * Paragraph.
   *
   * ```markdown
   * > | a b
   *     ^^^
   * > | c.
   *     ^^
   * ```
   */
  paragraph: 'paragraph'
  /**
   * Phrasing (occurs in headings, paragraphs, etc).
   *
   * ```markdown
   * > | a
   *     ^
   * ```
   */
  phrasing: 'phrasing'
  /**
   * Reference (occurs in image, link).
   *
   * ```markdown
   * > | [a][]
   *        ^^
   * ```
   */
  reference: 'reference'
  /**
   * Strong.
   *
   * ```markdown
   * > | **a**
   *     ^^^^^
   * ```
   */
  strong: 'strong'
  /**
   * Title using single quotes (occurs in definition, image, link).
   *
   * ```markdown
   * > | [a](b 'c')
   *           ^^^
   * ```
   */
  titleApostrophe: 'titleApostrophe'
  /**
   * Title using double quotes (occurs in definition, image, link).
   *
   * ```markdown
   * > | [a](b "c")
   *           ^^^
   * ```
   */
  titleQuote: 'titleQuote'
}

/**
 * Construct names for things generated by `mdast-util-to-markdown`.
 *
 * This is an enum of strings, each being a semantic label, useful to know when
 * serializing whether we’re for example in a double (`"`) or single (`'`)
 * quoted title.
 */
export type ConstructName = ConstructNameMap[keyof ConstructNameMap]

/**
 * Serialize the children of a parent that contains flow children.
 *
 * These children will typically be joined by blank lines.
 * What they are joined by exactly is defined by `Join` functions.
 *
 * @param parent
 *   Parent of flow nodes.
 * @param info
 *   Info on where we are in the document we are generating.
 * @returns
 *   Serialized children, joined by (blank) lines.
 */
export type ContainerFlow = (parent: FlowParents, info: TrackFields) => string

/**
 * Serialize the children of a parent that contains phrasing children.
 *
 * These children will be joined flush together.
 *
 * @param parent
 *   Parent of phrasing nodes.
 * @param info
 *   Info on where we are in the document we are generating.
 * @returns
 *   Serialized children, joined together.
 */
export type ContainerPhrasing = (parent: PhrasingParents, info: Info) => string

/**
 * Track positional info in the output.
 *
 * This info isn’t used yet but such functionality will allow line wrapping,
 * source maps, etc.
 *
 * @param info
 *   Info on where we are in the document we are generating.
 * @returns
 *   Tracker.
 */
export type CreateTracker = (info: TrackFields) => Tracker

/**
 * Whether to encode things — with fields representing the surrounding of a
 * whole.
 */
export interface EncodeSurrounding {
  /**
   * Whether to encode after.
   */
  after: boolean

  /**
   * Whether to encode before.
   */
  before: boolean
}

/**
 * Whether to encode things — with fields representing the relationship to a
 * whole.
 */
export interface EncodeSides {
  /**
   * Whether to encode inside.
   */
  inside: boolean

  /**
   * Whether to encode before.
   */
  outside: boolean
}

/**
 * Enter something.
 *
 * @param name
 *   Label, more similar to a micromark event than an mdast node type.
 * @returns
 *   Revert.
 */
export type Enter = (name: ConstructName) => Exit

/**
 * Exit something.
 *
 * @returns
 *   Nothing.
 */
export type Exit = () => undefined

/**
 * Children of flow nodes.
 */
export type FlowChildren = FlowParents extends {
  children: Array<infer T>
}
  ? T
  : never

/**
 * Parents that are not phrasing,
 * or similar.
 */
export type FlowParents = Exclude<
  Parents,
  PhrasingContent | TableCell | TableRow
>

/**
 * Handle particular nodes.
 *
 * Each key is a node type, each value its corresponding handler.
 */
export type Handlers = Record<Nodes['type'], Handle>

/**
 * Handle a particular node.
 *
 * @param node
 *   Expected mdast node.
 * @param parent
 *   Parent of `node`.
 * @param state
 *   Info passed around about the current state.
 * @param Info
 *   Info on the surrounding of the node that is serialized.
 * @returns
 *   Serialized markdown representing `node`.
 */
export type Handle = (
  node: any,
  parent: Parents | undefined,
  state: State,
  Info: Info
) => string

/**
 * Pad serialized markdown.
 *
 * @param value
 *   Whole fragment of serialized markdown.
 * @param map
 *   Map function.
 * @returns
 *   Padded value.
 */
export type IndentLines = (value: string, map: Map) => string

/**
 * Info on the surrounding of the node that is serialized.
 */
export interface Info extends SafeFields, TrackFields {}

/**
 * How to join two blocks.
 *
 * “Blocks” are typically joined by one blank line.
 * Sometimes it’s nicer to have them flush next to each other, yet other
 * times they cannot occur together at all.
 *
 * Join functions receive two adjacent siblings and their parent and what
 * they return defines how many blank lines to use between them.
 *
 * @param left
 *   First of two adjacent siblings.
 * @param right
 *   Second of two adjacent siblings.
 * @param parent
 *   Parent of the two siblings.
 * @param state
 *   Info passed around about the current state.
 * @returns
 *   How many blank lines to use between the siblings.
 *
 *   Where `true` is as passing `1` and `false` means the nodes cannot be
 *   joined by a blank line, such as two adjacent block quotes or indented code
 *   after a list, in which case a comment will be injected to break them up:
 *
 *   ```markdown
 *   > Quote 1
 *
 *   <!---->
 *
 *   > Quote 2
 *   ```
 *
 *    > 👉 **Note**: abusing this feature will break markdown.
 *    > One such example is when returning `0` for two paragraphs, which will
 *    > result in the text running together, and in the future to be seen as
 *    > one paragraph.
 */
export type Join = (
  left: FlowChildren,
  right: FlowChildren,
  parent: FlowParents,
  state: State
) => boolean | number | null | undefined | void

/**
 * Map function to pad a single line.
 *
 * @param value
 *   A single line of serialized markdown.
 * @param line
 *   Line number relative to the fragment.
 * @param blank
 *   Whether the line is considered blank in markdown.
 * @returns
 *   Padded line.
 */
export type Map = (value: string, line: number, blank: boolean) => string

/**
 * Configuration (optional).
 */
export interface Options {
  /**
   * Marker to use in certain cases where the primary bullet doesn’t work
   * (default: `'-'` when `bullet` is `'*'`, `'*'` otherwise).
   *
   * Cannot be equal to `bullet`.
   */
  bulletOther?: '*' | '+' | '-' | null | undefined
  /**
   * Marker to use for bullets of items in ordered lists (default: `'.'`).
   *
   * There is one case where the primary bullet for ordered items cannot be
   * used:
   *
   * * when two ordered lists appear next to each other: `1. a\n2) b`; to
   * solve
   * that, `'.'` will be used when `bulletOrdered` is `')'`, and `'.'`
   * otherwise
   */
  bulletOrdered?: '.' | ')' | null | undefined
  /**
   * Marker to use for bullets of items in unordered lists (default: `'*'`).
   *
   * There are three cases where the primary bullet cannot be used:
   *
   * * when three or more list items are on their own, the last one is empty,
   * and `bullet` is also a valid `rule`: `* - +`; this would turn into a
   * thematic break if serialized with three primary bullets; `bulletOther`
   * is used for the last item
   * * when a thematic break is the first child of a list item and `bullet` is
   * the same character as `rule`: `- ***`; this would turn into a single
   * thematic break if serialized with primary bullets; `bulletOther` is used
   * for the item
   * * when two unordered lists appear next to each other: `* a\n- b`;
   * `bulletOther` is used for such lists
   */
  bullet?: '*' | '+' | '-' | null | undefined
  /**
   * Whether to add the same number of number signs (`#`) at the end of an ATX
   * heading as the opening sequence (default: `false`).
   */
  closeAtx?: boolean | null | undefined
  /**
   * Marker to use for emphasis (default: `'*'`).
   */
  emphasis?: '*' | '_' | null | undefined
  /**
   * List of extensions to include (optional).
   *
   * Each `ToMarkdownExtension` is an object with the same interface as
   * `Options` here.
   */
  extensions?: Array<Options> | null | undefined
  /**
   * Whether to use fenced code always (default: `true`).
   *
   * The default is to use fenced code if there is a language defined, if the
   * code is empty, or if it starts or ends in blank lines.
   */
  fences?: boolean | null | undefined
  /**
   * Marker to use for fenced code (default: ``'`'``).
   */
  fence?: '`' | '~' | null | undefined
  /**
   * Handle particular nodes (optional).
   *
   * Each key is a node type, each value its corresponding handler.
   */
  handlers?: Partial<Handlers> | null | undefined
  /**
   * Whether to increment the counter of ordered lists items (default: `true`).
   */
  incrementListMarker?: boolean | null | undefined
  /**
   * How to join blocks (optional).
   */
  join?: Array<Join> | null | undefined
  /**
   * How to indent the content of list items (default: `'one'`).
   *
   * Either with the size of the bullet plus one space (when `'one'`), a tab
   * stop (`'tab'`), or depending on the item and its parent list (`'mixed'`,
   * uses `'one'` if the item and list are tight and `'tab'` otherwise).
   */
  listItemIndent?: 'mixed' | 'one' | 'tab' | null | undefined
  /**
   * Marker to use for titles (default: `'"'`).
   */
  quote?: '"' | "'" | null | undefined
  /**
   * Whether to always use resource links (default: `false`).
   *
   * The default is to use autolinks (`<https://example.com>`) when possible
   * and resource links (`[text](url)`) otherwise.
   */
  resourceLink?: boolean | null | undefined
  /**
   * Number of markers to use for thematic breaks (default: `3`).
   */
  ruleRepetition?: number | null | undefined
  /**
   * Whether to add spaces between markers in thematic breaks (default:
   * `false`).
   */
  ruleSpaces?: boolean | null | undefined
  /**
   * Marker to use for thematic breaks (default: `'*'`).
   */
  rule?: '*' | '-' | '_' | null | undefined
  /**
   * Whether to use setext headings when possible (default: `false`).
   *
   * The default is to always use ATX headings (`# heading`) instead of setext
   * headings (`heading\n=======`).
   * Setext headings cannot be used for empty headings or headings with a rank
   * of three or more.
   */
  setext?: boolean | null | undefined
  /**
   * Marker to use for strong (default: `'*'`).
   */
  strong?: '*' | '_' | null | undefined
  /**
   * Whether to join definitions without a blank line (default: `false`).
   *
   * The default is to add blank lines between any flow (“block”) construct.
   * Turning this option on is a shortcut for a join function like so:
   *
   * ```js
   * function joinTightDefinitions(left, right) {
   * if (left.type === 'definition' && right.type === 'definition') {
   * return 0
   * }
   * }
   * ```
   */
  tightDefinitions?: boolean | null | undefined
  /**
   * Schemas that define when characters cannot occur (optional).
   */
  unsafe?: Array<Unsafe> | null | undefined
}

/**
 * Parent of phrasing nodes.
 */
export type PhrasingParents = Parents extends {
  children: Array<infer T>
}
  ? PhrasingContent extends T
    ? Parents
    : never
  : never

/**
 * Configuration for `safe`
 */
export interface SafeConfig extends SafeFields {
  /**
   * Extra characters that *must* be encoded (as character references) instead
   * of escaped (character escapes) (optional).
   *
   * Only ASCII punctuation will use character escapes, so you never need to
   * pass non-ASCII-punctuation here.
   */
  encode?: Array<string> | null | undefined
}

/**
 * Info on the characters that are around the current thing we are generating.
 */
export interface SafeFields {
  /**
   * Characters after this (guaranteed to be one, can be more).
   */
  after: string
  /**
   * Characters before this (guaranteed to be one, can be more).
   */
  before: string
}

/**
 * Make a string safe for embedding in markdown constructs.
 *
 * In markdown, almost all punctuation characters can, in certain cases,
 * result in something.
 * Whether they do is highly subjective to where they happen and in what
 * they happen.
 *
 * To solve this, `mdast-util-to-markdown` tracks:
 *
 * * Characters before and after something;
 * * What “constructs” we are in.
 *
 * This information is then used by this function to escape or encode
 * special characters.
 *
 * @param input
 *   Raw value to make safe.
 * @param config
 *   Configuration.
 * @returns
 *   Serialized markdown safe for embedding.
 */
export type Safe = (
  input: string | null | undefined,
  config: SafeConfig
) => string

/**
 * Info passed around about the current state.
 */
export interface State {
  /**
   * Get an identifier from an association to match it to others.
   */
  associationId: AssociationId
  /**
   * Info on whether to encode the surrounding of *attention*.
   *
   * Whether attention (emphasis, strong, strikethrough) forms
   * depends on the characters inside and outside them.
   * The characters inside can be handled by *attention* itself.
   * However the outside characters are already handled.
   * Or handled afterwards.
   * This field can be used to signal from *attention* that some parent
   * function (practically `containerPhrasing`) has to handle the surrounding.
   */
  attentionEncodeSurroundingInfo: EncodeSurrounding | undefined
  /**
   * List marker currently in use.
   */
  bulletCurrent: string | undefined
  /**
   * List marker previously in use.
   */
  bulletLastUsed: string | undefined
  /**
   * Compile an unsafe pattern to a regex.
   */
  compilePattern: CompilePattern
  /**
   * Serialize the children of a parent that contains phrasing children.
   */
  containerPhrasing: ContainerPhrasing
  /**
   * Serialize the children of a parent that contains flow children.
   */
  containerFlow: ContainerFlow
  /**
   * Track positional info in the output.
   */
  createTracker: CreateTracker
  /**
   * Enter a construct (returns a corresponding exit function).
   */
  enter: Enter
  /**
   * Applied handlers.
   */
  handlers: Handlers
  /**
   * Call the configured handler for the given node.
   */
  handle: Handle
  /**
   * Pad serialized markdown.
   */
  indentLines: IndentLines
  /**
   * Positions of child nodes in their parents.
   */
  indexStack: Array<number>
  /**
   * Applied join handlers.
   */
  join: Array<Join>
  /**
   * Applied user configuration.
   */
  options: Options
  /**
   * Serialize the children of a parent that contains flow children.
   */
  safe: Safe
  /**
   * Stack of constructs we’re in.
   */
  stack: Array<ConstructName>
  /**
   * Applied unsafe patterns.
   */
  unsafe: Array<Unsafe>
}

/**
 * Get current tracked info.
 *
 * @returns
 *   Current tracked info.
 */
export type TrackCurrent = () => TrackFields

/**
 * Info on where we are in the document we are generating.
 */
export interface TrackFields {
  /**
   * Number of columns each line will be shifted by wrapping nodes.
   */
  lineShift: number
  /**
   * Current point.
   */
  now: Point
}

/**
 * Move past some generated markdown.
 *
 * @param value
 *   Generated markdown.
 * @returns
 *   Given markdown.
 */
export type TrackMove = (value: string | null | undefined) => string

/**
 * Define a relative increased line shift (the typical indent for lines).
 *
 * @param value
 *   Relative increment in how much each line will be padded.
 * @returns
 *   Nothing.
 */
export type TrackShift = (value: number) => undefined

/**
 * Track positional info in the output.
 *
 * This info isn’t used yet but such functionality will allow line wrapping,
 * source maps, etc.
 */
export interface Tracker {
  /**
   * Get the current tracked info.
   */
  current: TrackCurrent
  /**
   * Move past some generated markdown.
   */
  move: TrackMove
  /**
   * Define an increased line shift (the typical indent for lines).
   */
  shift: TrackShift
}

/**
 * Schema that defines when a character cannot occur.
 */
export interface Unsafe {
  /**
   * The unsafe pattern (this whole object) compiled as a regex (do not use).
   *
   * This is internal and must not be defined.
   */
  _compiled?: RegExp | null | undefined
  /**
   * `character` is bad when this is after it (optional).
   */
  after?: string | null | undefined
  /**
   * `character` is bad at a break (cannot be used together with `before`) (optional).
   */
  atBreak?: boolean | null | undefined
  /**
   * `character` is bad when this is before it (cannot be used together with
   * `atBreak`) (optional).
   */
  before?: string | null | undefined
  /**
   * Single unsafe character.
   */
  character: string
  /**
   * Constructs where this is bad (optional).
   */
  inConstruct?: Array<ConstructName> | ConstructName | null | undefined
  /**
   * Constructs where this is fine again (optional).
   */
  notInConstruct?: Array<ConstructName> | ConstructName | null | undefined
}
i 	x d/** @type {Array<Unsafe>} */
export const unsafe: Array<Unsafe>;
import type { Unsafe } from 'mdast-util-to-markdown';
//# sourceMappingURL=unsafe.d.ts.mapZK6F
x Z{"version":3,"file":"unsafe.d.ts","sourceRoot":"","sources":["unsafe.js"],"names":[],"mappings":"AAqBA,4BAA4B;AAC5B,qBADW,KAAK,CAAC,MAAM,CAAC,CA4HvB;4BAhJuC,wBAAwB"}m2xq/**
 * @import {ConstructName, Unsafe} from 'mdast-util-to-markdown'
 */

/**
 * List of constructs that occur in phrasing (paragraphs, headings), but cannot
 * contain things like attention (emphasis, strong), images, or links.
 * So they sort of cancel each other out.
 * Note: could use a better name.
 *
 * @type {Array<ConstructName>}
 */
const fullPhrasingSpans = [
  'autolink',
  'destinationLiteral',
  'destinationRaw',
  'reference',
  'titleQuote',
  'titleApostrophe'
]

/** @type {Array<Unsafe>} */
export const unsafe = [
  {character: '\t', after: '[\\r\\n]', inConstruct: 'phrasing'},
  {character: '\t', before: '[\\r\\n]', inConstruct: 'phrasing'},
  {
    character: '\t',
    inConstruct: ['codeFencedLangGraveAccent', 'codeFencedLangTilde']
  },
  {
    character: '\r',
    inConstruct: [
      'codeFencedLangGraveAccent',
      'codeFencedLangTilde',
      'codeFencedMetaGraveAccent',
      'codeFencedMetaTilde',
      'destinationLiteral',
      'headingAtx'
    ]
  },
  {
    character: '\n',
    inConstruct: [
      'codeFencedLangGraveAccent',
      'codeFencedLangTilde',
      'codeFencedMetaGraveAccent',
      'codeFencedMetaTilde',
      'destinationLiteral',
      'headingAtx'
    ]
  },
  {character: ' ', after: '[\\r\\n]', inConstruct: 'phrasing'},
  {character: ' ', before: '[\\r\\n]', inConstruct: 'phrasing'},
  {
    character: ' ',
    inConstruct: ['codeFencedLangGraveAccent', 'codeFencedLangTilde']
  },
  // An exclamation mark can start an image, if it is followed by a link or
  // a link reference.
  {
    character: '!',
    after: '\\[',
    inConstruct: 'phrasing',
    notInConstruct: fullPhrasingSpans
  },
  // A quote can break out of a title.
  {character: '"', inConstruct: 'titleQuote'},
  // A number sign could start an ATX heading if it starts a line.
  {atBreak: true, character: '#'},
  {character: '#', inConstruct: 'headingAtx', after: '(?:[\r\n]|$)'},
  // Dollar sign and percentage are not used in markdown.
  // An ampersand could start a character reference.
  {character: '&', after: '[#A-Za-z]', inConstruct: 'phrasing'},
  // An apostrophe can break out of a title.
  {character: "'", inConstruct: 'titleApostrophe'},
  // A left paren could break out of a destination raw.
  {character: '(', inConstruct: 'destinationRaw'},
  // A left paren followed by `]` could make something into a link or image.
  {
    before: '\\]',
    character: '(',
    inConstruct: 'phrasing',
    notInConstruct: fullPhrasingSpans
  },
  // A right paren could start a list item or break out of a destination
  // raw.
  {atBreak: true, before: '\\d+', character: ')'},
  {character: ')', inConstruct: 'destinationRaw'},
  // An asterisk can start thematic breaks, list items, emphasis, strong.
  {atBreak: true, character: '*', after: '(?:[ \t\r\n*])'},
  {character: '*', inConstruct: 'phrasing', notInConstruct: fullPhrasingSpans},
  // A plus sign could start a list item.
  {atBreak: true, character: '+', after: '(?:[ \t\r\n])'},
  // A dash can start thematic breaks, list items, and setext heading
  // underlines.
  {atBreak: true, character: '-', after: '(?:[ \t\r\n-])'},
  // A dot could start a list item.
  {atBreak: true, before: '\\d+', character: '.', after: '(?:[ \t\r\n]|$)'},
  // Slash, colon, and semicolon are not used in markdown for constructs.
  // A less than can start html (flow or text) or an autolink.
  // HTML could start with an exclamation mark (declaration, cdata, comment),
  // slash (closing tag), question mark (instruction), or a letter (tag).
  // An autolink also starts with a letter.
  // Finally, it could break out of a destination literal.
  {atBreak: true, character: '<', after: '[!/?A-Za-z]'},
  {
    character: '<',
    after: '[!/?A-Za-z]',
    inConstruct: 'phrasing',
    notInConstruct: fullPhrasingSpans
  },
  {character: '<', inConstruct: 'destinationLiteral'},
  // An equals to can start setext heading underlines.
  {atBreak: true, character: '='},
  // A greater than can start block quotes and it can break out of a
  // destination literal.
  {atBreak: true, character: '>'},
  {character: '>', inConstruct: 'destinationLiteral'},
  // Question mark and at sign are not used in markdown for constructs.
  // A left bracket can start definitions, references, labels,
  {atBreak: true, character: '['},
  {character: '[', inConstruct: 'phrasing', notInConstruct: fullPhrasingSpans},
  {character: '[', inConstruct: ['label', 'reference']},
  // A backslash can start an escape (when followed by punctuation) or a
  // hard break (when followed by an eol).
  // Note: typical escapes are handled in `safe`!
  {character: '\\', after: '[\\r\\n]', inConstruct: 'phrasing'},
  // A right bracket can exit labels.
  {character: ']', inConstruct: ['label', 'reference']},
  // Caret is not used in markdown for constructs.
  // An underscore can start emphasis, strong, or a thematic break.
  {atBreak: true, character: '_'},
  {character: '_', inConstruct: 'phrasing', notInConstruct: fullPhrasingSpans},
  // A grave accent can start code (fenced or text), or it can break out of
  // a grave accent code fence.
  {atBreak: true, character: '`'},
  {
    character: '`',
    inConstruct: ['codeFencedLangGraveAccent', 'codeFencedMetaGraveAccent']
  },
  {character: '`', inConstruct: 'phrasing', notInConstruct: fullPhrasingSpans},
  // Left brace, vertical bar, right brace are not used in markdown for
  // constructs.
  // A tilde can start code (fenced).
  {atBreak: true, character: '~'}
]
˨xW100644 association.d.ts iIh
 }p/Ԁw100644 association.d.ts.map Mlv~7҅100644 association.js OM;Y哣nQ100644 check-bullet-ordered.d.ts q/k*KiP\100644 check-bullet-ordered.d.ts.map o?֎A6,m+100644 check-bullet-ordered.js ͬi;В̣cIvg8100644 check-bullet-other.d.ts 6Stf9WsOQfD22100644 check-bullet-other.d.ts.map 	3zs>=pB)100644 check-bullet-other.js .MgM[9}:Y100644 check-bullet.d.ts c|Jz	21b&100644 check-bullet.d.ts.map l&R)-k{RI;X100644 check-bullet.js q$D%	Y|P100644 check-emphasis.d.ts 	cl|9ZR100644 check-emphasis.d.ts.map T!]2uJXB100644 check-emphasis.js 38:)ޙI?\Sw100644 check-fence.d.ts 3:L:|]
YV100644 check-fence.d.ts.map :nl~p7#%100644 check-fence.js ]R̯?g100644 check-list-item-indent.d.ts ?m[n8)ȵIQ100644 check-list-item-indent.d.ts.map W&T87ӿq|b|100644 check-list-item-indent.js z*^'[8iP޳VX100644 check-quote.d.ts H.[@miB100644 check-quote.d.ts.map ܴU ?`|{,}100644 check-quote.js j_O$OIE100644 check-rule-repetition.d.ts #Hax]* z100644 check-rule-repetition.d.ts.map cK"T=ن'100644 check-rule-repetition.js ̑DS8!MhNĴ100644 check-rule.d.ts !QMu_}fm9100644 check-rule.d.ts.map OfC2%tS8100644 check-rule.js ((YE3A
 k100644 check-strong.d.ts fIl\h+9&{aX }100644 check-strong.d.ts.map FnY)(`100644 check-strong.js :ȐM@Jx,%Q100644 compile-pattern.d.ts A=#	j7A栙100644 compile-pattern.d.ts.map Ih(^"ȻU[/100644 compile-pattern.js |O
.O/tj`100644 container-flow.d.ts C8;34vn
֮100644 container-flow.d.ts.map TѨi{Xl100644 container-flow.js 2NCkяn*100644 container-phrasing.d.ts $SZn>`@pkB#100644 container-phrasing.d.ts.map &|ׅܰ:#
100644 container-phrasing.js ;MkʶwѨlv100644 emphasis-strong-marker.d.ts 0wnW)hzu{;//:100644 emphasis-strong-marker.d.ts.map (9N
¡!100644 encode-character-reference.d.ts ?L!Gp3100644 encode-character-reference.d.ts.map ZlH>3Z100644 encode-character-reference.js &eZNn:100644 encode-info.d.ts FG舑FR_MZH~Z0100644 encode-info.d.ts.map УexvfA@J	I100644 encode-info.js 55Ē$w*f100644 format-code-as-indented.d.ts Hxs*Cu-X@100644 format-code-as-indented.d.ts.map |nL\CD3D,`100644 format-code-as-indented.js ]mCyW#_100644 format-heading-as-setext.d.ts .04+dG+3a100644 format-heading-as-setext.d.ts.map =9U9mt8c|S100644 format-heading-as-setext.js `uNO1꽱O100644 format-link-as-autolink.d.ts ccYhQ`_100644 format-link-as-autolink.d.ts.map l.7<WI_&;100644 format-link-as-autolink.js Yi~IV<evL&W}W100644 indent-lines.d.ts @do8U"100644 indent-lines.d.ts.map ~:?&8_100644 indent-lines.js k3QWWDb100644 pattern-in-scope.d.ts 1|	>J1S100644 pattern-in-scope.d.ts.map 6bgE,DT100644 pattern-in-scope.js ʭbd
l$j100644 safe.d.ts 	ۖ	[|Gʵ$100644 safe.d.ts.map W0݀]B4zh100644 safe.js Eo=/EЗV100644 track.d.ts  G@v>@{QA100644 track.d.ts.map &|DX;{:100644 track.js .,7r߷L8fK"xq export function association(node: import("mdast").Association): string;
//# sourceMappingURL=association.d.ts.mapP)?xm {"version":3,"file":"association.d.ts","sourceRoot":"","sources":["association.js"],"names":[],"mappings":""} $ExY/**
 * @import {AssociationId} from '../types.js'
 */

import {decodeString} from 'micromark-util-decode-string'

/**
 * Get an identifier from an association to match it to others.
 *
 * Associations are nodes that match to something else through an ID:
 * <https://github.com/syntax-tree/mdast#association>.
 *
 * The `label` of an association is the string value: character escapes and
 * references work, and casing is intact.
 * The `identifier` is used to match one association to another:
 * controversially, character escapes and references don’t work in this
 * matching: `&copy;` does not match `©`, and `\+` does not match `+`.
 *
 * But casing is ignored (and whitespace) is trimmed and collapsed: ` A\nb`
 * matches `a b`.
 * So, we do prefer the label when figuring out how we’re going to serialize:
 * it has whitespace, casing, and we can ignore most useless character
 * escapes and all character references.
 *
 * @type {AssociationId}
 */
export function association(node) {
  if (node.label || !node.identifier) {
    return node.label || ''
  }

  return decodeString(node.identifier)
}
 ~xw/**
 * @import {Options, State} from 'mdast-util-to-markdown'
 */
/**
 * @param {State} state
 * @returns {Exclude<Options['fence'], null | undefined>}
 */
export function checkFence(state: State): Exclude<Options["fence"], null | undefined>;
import type { State } from 'mdast-util-to-markdown';
import type { Options } from 'mdast-util-to-markdown';
//# sourceMappingURL=check-fence.d.ts.maphxQ |bulletOrdered0BulletOrdered!bulletOrderedܞbullet-ordered.d.ts.map
x{"version":3,"file":"check-bullet-ordered.d.ts","sourceRoot":"","sources":["check-bullet-ordered.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,0CAHW,KAAK,GACH,OAAO,CAAC,OAAO,CAAC,eAAe,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CAc/D;2BAnBgC,wBAAwB;6BAAxB,wBAAwB"}Mڸx'/**
 * @import {Options, State} from 'mdast-util-to-markdown'
 */

/**
 * @param {State} state
 * @returns {Exclude<Options['bulletOrdered'], null | undefined>}
 */
export function checkBulletOrdered(state) {
  const marker = state.options.bulletOrdered || '.'

  if (marker !== '.' && marker !== ')') {
    throw new Error(
      'Cannot serialize items with `' +
        marker +
        '` for `options.bulletOrdered`, expected `.` or `)`'
    )
  }

  return marker
}
{#xU/**
 * @param {State} state
 * @returns {Exclude<Options['bullet'], null | undefined>}
 */
export function checkBulletOther(state: State): Exclude<Options["bullet"], null | undefined>;
import type { State } from 'mdast-util-to-markdown';
import type { Options } from 'mdast-util-to-markdown';
//# sourceMappingURL=check-bullet-other.d.ts.mapxx 	{"version":3,"file":"check-bullet-other.d.ts","sourceRoot":"","sources":["check-bullet-other.js"],"names":[],"mappings":"AAMA;;;GAGG;AACH,wCAHW,KAAK,GACH,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CA6BxD;2BApCgC,wBAAwB;6BAAxB,wBAAwB"}	J5xU/**
 * @import {Options, State} from 'mdast-util-to-markdown'
 */

import {checkBullet} from './check-bullet.js'

/**
 * @param {State} state
 * @returns {Exclude<Options['bullet'], null | undefined>}
 */
export function checkBulletOther(state) {
  const bullet = checkBullet(state)
  const bulletOther = state.options.bulletOther

  if (!bulletOther) {
    return bullet === '*' ? '-' : '*'
  }

  if (bulletOther !== '*' && bulletOther !== '+' && bulletOther !== '-') {
    throw new Error(
      'Cannot serialize items with `' +
        bulletOther +
        '` for `options.bulletOther`, expected `*`, `+`, or `-`'
    )
  }

  if (bulletOther === bullet) {
    throw new Error(
      'Expected `bullet` (`' +
        bullet +
        '`) and `bulletOther` (`' +
        bulletOther +
        '`) to be different'
    )
  }

  return bulletOther
}
vxk/**
 * @import {Options, State} from 'mdast-util-to-markdown'
 */
/**
 * @param {State} state
 * @returns {Exclude<Options['emphasis'], null | undefined>}
 */
export function checkEmphasis(state: State): Exclude<Options["emphasis"], null | undefined>;
import type { State } from 'mdast-util-to-markdown';
import type { Options } from 'mdast-util-to-markdown';
//# sourceMappingURL=check-emphasis.d.ts.mapAD!x4 |bullet0Bullet!bulletbullet.d.ts.mapx.x {"version":3,"file":"check-emphasis.d.ts","sourceRoot":"","sources":["check-emphasis.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,qCAHW,KAAK,GACH,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CAc1D;2BAnBgC,wBAAwB;6BAAxB,wBAAwB"}I}x, bullet#)bulletT9m#QAAQ"x lx+/**
 * @import {Options, State} from 'mdast-util-to-markdown'
 */

/**
 * @param {State} state
 * @returns {Exclude<Options['bullet'], null | undefined>}
 */
export function checkBullet(state) {
  const marker = state.options.bullet || '*'

  if (marker !== '*' && marker !== '+' && marker !== '-') {
    throw new Error(
      'Cannot serialize items with `' +
        marker +
        '` for `options.bullet`, expected `*`, `+`, or `-`'
    )
  }

  return marker
}
иx7/**
 * @import {Options, State} from 'mdast-util-to-markdown'
 */

/**
 * @param {State} state
 * @returns {Exclude<Options['emphasis'], null | undefined>}
 */
export function checkEmphasis(state) {
  const marker = state.options.emphasis || '*'

  if (marker !== '*' && marker !== '_') {
    throw new Error(
      'Cannot serialize emphasis with `' +
        marker +
        '` for `options.emphasis`, expected `*`, or `_`'
    )
  }

  return marker
}
Ox {"version":3,"file":"check-fence.d.ts","sourceRoot":"","sources":["check-fence.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,kCAHW,KAAK,GACH,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CAcvD;2BAnBgC,wBAAwB;6BAAxB,wBAAwB"}JFxD/**
 * @import {Options, State} from 'mdast-util-to-markdown'
 */

/**
 * @param {State} state
 * @returns {Exclude<Options['fence'], null | undefined>}
 */
export function checkFence(state) {
  const marker = state.options.fence || '`'

  if (marker !== '`' && marker !== '~') {
    throw new Error(
      'Cannot serialize code with `' +
        marker +
        '` for `options.fence`, expected `` ` `` or `~`'
    )
  }

  return marker
}
xQ/**
 * @import {Options, State} from 'mdast-util-to-markdown'
 */
/**
 * @param {State} state
 * @returns {Exclude<Options['listItemIndent'], null | undefined>}
 */
export function checkListItemIndent(state: State): Exclude<Options["listItemIndent"], null | undefined>;
import type { State } from 'mdast-util-to-markdown';
import type { Options } from 'mdast-util-to-markdown';
//# sourceMappingURL=check-list-item-indent.d.ts.map*x
{"version":3,"file":"check-list-item-indent.d.ts","sourceRoot":"","sources":["check-list-item-indent.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,2CAHW,KAAK,GACH,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CAchE;2BAnBgC,wBAAwB;6BAAxB,wBAAwB"}O x /**
 * @import {Options, State} from 'mdast-util-to-markdown'
 */

/**
 * @param {State} state
 * @returns {Exclude<Options['listItemIndent'], null | undefined>}
 */
export function checkListItemIndent(state) {
  const style = state.options.listItemIndent || 'one'

  if (style !== 'tab' && style !== 'one' && style !== 'mixed') {
    throw new Error(
      'Cannot serialize items with `' +
        style +
        '` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`'
    )
  }

  return style
}
qrxw/**
 * @import {Options, State} from 'mdast-util-to-markdown'
 */
/**
 * @param {State} state
 * @returns {Exclude<Options['quote'], null | undefined>}
 */
export function checkQuote(state: State): Exclude<Options["quote"], null | undefined>;
import type { State } from 'mdast-util-to-markdown';
import type { Options } from 'mdast-util-to-markdown';
//# sourceMappingURL=check-quote.d.ts.map戔x {"version":3,"file":"check-quote.d.ts","sourceRoot":"","sources":["check-quote.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,kCAHW,KAAK,GACH,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CAcvD;2BAnBgC,wBAAwB;6BAAxB,wBAAwB"}GXxE/**
 * @import {Options, State} from 'mdast-util-to-markdown'
 */

/**
 * @param {State} state
 * @returns {Exclude<Options['quote'], null | undefined>}
 */
export function checkQuote(state) {
  const marker = state.options.quote || '"'

  if (marker !== '"' && marker !== "'") {
    throw new Error(
      'Cannot serialize title with `' +
        marker +
        '` for `options.quote`, expected `"`, or `\'`'
    )
  }

  return marker
}
#xR/**
 * @import {Options, State} from 'mdast-util-to-markdown'
 */
/**
 * @param {State} state
 * @returns {Exclude<Options['ruleRepetition'], null | undefined>}
 */
export function checkRuleRepetition(state: State): Exclude<Options["ruleRepetition"], null | undefined>;
import type { State } from 'mdast-util-to-markdown';
import type { Options } from 'mdast-util-to-markdown';
//# sourceMappingURL=check-rule-repetition.d.ts.map𼗕x{"version":3,"file":"check-rule-repetition.d.ts","sourceRoot":"","sources":["check-rule-repetition.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,2CAHW,KAAK,GACH,OAAO,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CAchE;2BAnBgC,wBAAwB;6BAAxB,wBAAwB"}Ox/**
 * @import {Options, State} from 'mdast-util-to-markdown'
 */

/**
 * @param {State} state
 * @returns {Exclude<Options['ruleRepetition'], null | undefined>}
 */
export function checkRuleRepetition(state) {
  const repetition = state.options.ruleRepetition || 3

  if (repetition < 3) {
    throw new Error(
      'Cannot serialize rules with repetition `' +
        repetition +
        '` for `options.ruleRepetition`, expected `3` or more'
    )
  }

  return repetition
}
fgIx{/**
 * @import {Options, State} from 'mdast-util-to-markdown'
 */
/**
 * @param {State} state
 * @returns {Exclude<Options['rule'], null | undefined>}
 */
export function checkRule(state: State): Exclude<Options["rule"], null | undefined>;
import type { State } from 'mdast-util-to-markdown';
import type { Options } from 'mdast-util-to-markdown';
//# sourceMappingURL=check-rule.d.ts.mapxx {"version":3,"file":"check-rule.d.ts","sourceRoot":"","sources":["check-rule.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,iCAHW,KAAK,GACH,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CActD;2BAnBgC,wBAAwB;6BAAxB,wBAAwB"}Fdx3/**
 * @import {Options, State} from 'mdast-util-to-markdown'
 */

/**
 * @param {State} state
 * @returns {Exclude<Options['rule'], null | undefined>}
 */
export function checkRule(state) {
  const marker = state.options.rule || '*'

  if (marker !== '*' && marker !== '-' && marker !== '_') {
    throw new Error(
      'Cannot serialize rules with `' +
        marker +
        '` for `options.rule`, expected `*`, `-`, or `_`'
    )
  }

  return marker
}
5xs/**
 * @import {Options, State} from 'mdast-util-to-markdown'
 */
/**
 * @param {State} state
 * @returns {Exclude<Options['strong'], null | undefined>}
 */
export function checkStrong(state: State): Exclude<Options["strong"], null | undefined>;
import type { State } from 'mdast-util-to-markdown';
import type { Options } from 'mdast-util-to-markdown';
//# sourceMappingURL=check-strong.d.ts.map8YPx {"version":3,"file":"check-strong.d.ts","sourceRoot":"","sources":["check-strong.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;GAGG;AACH,mCAHW,KAAK,GACH,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,IAAI,GAAG,SAAS,CAAC,CAcxD;2BAnBgC,wBAAwB;6BAAxB,wBAAwB"}XH>xA/**
 * @import {Options, State} from 'mdast-util-to-markdown'
 */

/**
 * @param {State} state
 * @returns {Exclude<Options['strong'], null | undefined>}
 */
export function checkStrong(state) {
  const marker = state.options.strong || '*'

  if (marker !== '*' && marker !== '_') {
    throw new Error(
      'Cannot serialize strong with `' +
        marker +
        '` for `options.strong`, expected `*`, or `_`'
    )
  }

  return marker
}
jxy export function compilePattern(info: import("../types.js").Unsafe): RegExp;
//# sourceMappingURL=compile-pattern.d.ts.mapo`+1xu {"version":3,"file":"compile-pattern.d.ts","sourceRoot":"","sources":["compile-pattern.js"],"names":[],"mappings":""}8V'$xA/**
 * @import {CompilePattern} from '../types.js'
 */

/**
 * @type {CompilePattern}
 */
export function compilePattern(pattern) {
  if (!pattern._compiled) {
    const before =
      (pattern.atBreak ? '[\\r\\n][\\t ]*' : '') +
      (pattern.before ? '(?:' + pattern.before + ')' : '')

    pattern._compiled = new RegExp(
      (before ? '(' + before + ')' : '') +
        (/[|\\{}()[\]^$+*?.-]/.test(pattern.character) ? '\\' : '') +
        pattern.character +
        (pattern.after ? '(?:' + pattern.after + ')' : ''),
      'g'
    )
  }

  return pattern._compiled
}
1,x4/**
 * @import {State} from 'mdast-util-to-markdown'
 * @import {FlowChildren, FlowParents, TrackFields} from '../types.js'
 */
/**
 * @param {FlowParents} parent
 *   Parent of flow nodes.
 * @param {State} state
 *   Info passed around about the current state.
 * @param {TrackFields} info
 *   Info on where we are in the document we are generating.
 * @returns {string}
 *   Serialized children, joined by (blank) lines.
 */
export function containerFlow(parent: FlowParents, state: State, info: TrackFields): string;
import type { FlowParents } from '../types.js';
import type { State } from 'mdast-util-to-markdown';
import type { TrackFields } from '../types.js';
//# sourceMappingURL=container-flow.d.ts.maprx {"version":3,"file":"container-flow.d.ts","sourceRoot":"","sources":["container-flow.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;;;;;;GASG;AACH,sCATW,WAAW,SAEX,KAAK,QAEL,WAAW,GAET,MAAM,CA0ClB;iCApDwD,aAAa;2BAD9C,wBAAwB;iCACS,aAAa"}CGCrx$/**
 * @import {State} from 'mdast-util-to-markdown'
 * @import {FlowChildren, FlowParents, TrackFields} from '../types.js'
 */

/**
 * @param {FlowParents} parent
 *   Parent of flow nodes.
 * @param {State} state
 *   Info passed around about the current state.
 * @param {TrackFields} info
 *   Info on where we are in the document we are generating.
 * @returns {string}
 *   Serialized children, joined by (blank) lines.
 */
export function containerFlow(parent, state, info) {
  const indexStack = state.indexStack
  const children = parent.children || []
  const tracker = state.createTracker(info)
  /** @type {Array<string>} */
  const results = []
  let index = -1

  indexStack.push(-1)

  while (++index < children.length) {
    const child = children[index]

    indexStack[indexStack.length - 1] = index

    results.push(
      tracker.move(
        state.handle(child, parent, state, {
          before: '\n',
          after: '\n',
          ...tracker.current()
        })
      )
    )

    if (child.type !== 'list') {
      state.bulletLastUsed = undefined
    }

    if (index < children.length - 1) {
      results.push(
        tracker.move(between(child, children[index + 1], parent, state))
      )
    }
  }

  indexStack.pop()

  return results.join('')
}

/**
 * @param {FlowChildren} left
 * @param {FlowChildren} right
 * @param {FlowParents} parent
 * @param {State} state
 * @returns {string}
 */
function between(left, right, parent, state) {
  let index = state.join.length

  while (index--) {
    const result = state.join[index](left, right, parent, state)

    if (result === true || result === 1) {
      break
    }

    if (typeof result === 'number') {
      return '\n'.repeat(1 + result)
    }

    if (result === false) {
      return '\n\n<!---->\n\n'
    }
  }

  return '\n\n'
}
T;,x4/**
 * Serialize the children of a parent that contains phrasing children.
 *
 * These children will be joined flush together.
 *
 * @param {PhrasingParents} parent
 *   Parent of flow nodes.
 * @param {State} state
 *   Info passed around about the current state.
 * @param {Info} info
 *   Info on where we are in the document we are generating.
 * @returns {string}
 *   Serialized children, joined together.
 */
export function containerPhrasing(parent: PhrasingParents, state: State, info: Info): string;
import type { PhrasingParents } from '../types.js';
import type { State } from 'mdast-util-to-markdown';
import type { Info } from 'mdast-util-to-markdown';
//# sourceMappingURL=container-phrasing.d.ts.mapox {"version":3,"file":"container-phrasing.d.ts","sourceRoot":"","sources":["container-phrasing.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;GAaG;AACH,0CATW,eAAe,SAEf,KAAK,QAEL,IAAI,GAEF,MAAM,CA0GlB;qCA1HiC,aAAa;2BADT,wBAAwB;0BAAxB,wBAAwB"}HxT/**
 * @import {Handle, Info, State} from 'mdast-util-to-markdown'
 * @import {PhrasingParents} from '../types.js'
 */

import {encodeCharacterReference} from './encode-character-reference.js'

/**
 * Serialize the children of a parent that contains phrasing children.
 *
 * These children will be joined flush together.
 *
 * @param {PhrasingParents} parent
 *   Parent of flow nodes.
 * @param {State} state
 *   Info passed around about the current state.
 * @param {Info} info
 *   Info on where we are in the document we are generating.
 * @returns {string}
 *   Serialized children, joined together.
 */
export function containerPhrasing(parent, state, info) {
  const indexStack = state.indexStack
  const children = parent.children || []
  /** @type {Array<string>} */
  const results = []
  let index = -1
  let before = info.before
  /** @type {string | undefined} */
  let encodeAfter

  indexStack.push(-1)
  let tracker = state.createTracker(info)

  while (++index < children.length) {
    const child = children[index]
    /** @type {string} */
    let after

    indexStack[indexStack.length - 1] = index

    if (index + 1 < children.length) {
      /** @type {Handle} */
      // @ts-expect-error: hush, it’s actually a `zwitch`.
      let handle = state.handle.handlers[children[index + 1].type]
      /** @type {Handle} */
      // @ts-expect-error: hush, it’s actually a `zwitch`.
      if (handle && handle.peek) handle = handle.peek
      after = handle
        ? handle(children[index + 1], parent, state, {
            before: '',
            after: '',
            ...tracker.current()
          }).charAt(0)
        : ''
    } else {
      after = info.after
    }

    // In some cases, html (text) can be found in phrasing right after an eol.
    // When we’d serialize that, in most cases that would be seen as html
    // (flow).
    // As we can’t escape or so to prevent it from happening, we take a somewhat
    // reasonable approach: replace that eol with a space.
    // See: <https://github.com/syntax-tree/mdast-util-to-markdown/issues/15>
    if (
      results.length > 0 &&
      (before === '\r' || before === '\n') &&
      child.type === 'html'
    ) {
      results[results.length - 1] = results[results.length - 1].replace(
        /(\r?\n|\r)$/,
        ' '
      )
      before = ' '

      // To do: does this work to reset tracker?
      tracker = state.createTracker(info)
      tracker.move(results.join(''))
    }

    let value = state.handle(child, parent, state, {
      ...tracker.current(),
      after,
      before
    })

    // If we had to encode the first character after the previous node and it’s
    // still the same character,
    // encode it.
    if (encodeAfter && encodeAfter === value.slice(0, 1)) {
      value =
        encodeCharacterReference(encodeAfter.charCodeAt(0)) + value.slice(1)
    }

    const encodingInfo = state.attentionEncodeSurroundingInfo
    state.attentionEncodeSurroundingInfo = undefined
    encodeAfter = undefined

    // If we have to encode the first character before the current node and
    // it’s still the same character,
    // encode it.
    if (encodingInfo) {
      if (
        results.length > 0 &&
        encodingInfo.before &&
        before === results[results.length - 1].slice(-1)
      ) {
        results[results.length - 1] =
          results[results.length - 1].slice(0, -1) +
          encodeCharacterReference(before.charCodeAt(0))
      }

      if (encodingInfo.after) encodeAfter = after
    }

    tracker.move(value)
    results.push(value)
    before = value.slice(-1)
  }

  indexStack.pop()

  return results.join('')
}
^{x 2/**
 * @this {State}
 * @returns {'*' | '_'}
 */
export function emphasisStrongMarker(this: State): "*" | "_";
import type { State } from '../types.js';
//# sourceMappingURL=emphasis-strong-marker.d.ts.mapLCx C{"version":3,"file":"emphasis-strong-marker.d.ts","sourceRoot":"","sources":["emphasis-strong-marker.js"],"names":[],"mappings":"AAOA;;;GAGG;AACH,mDAFa,GAAG,GAAG,GAAG,CAqBrB;2BA7BuB,aAAa"}z*<gx/**
 * Encode a code point as a character reference.
 *
 * @param {number} code
 *   Code point to encode.
 * @returns {string}
 *   Encoded character reference.
 */
export function encodeCharacterReference(code: number): string;
//# sourceMappingURL=encode-character-reference.d.ts.map{a'x E{"version":3,"file":"encode-character-reference.d.ts","sourceRoot":"","sources":["encode-character-reference.js"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,+CALW,MAAM,GAEJ,MAAM,CAKlB"};ɰx/**
 * Encode a code point as a character reference.
 *
 * @param {number} code
 *   Code point to encode.
 * @returns {string}
 *   Encoded character reference.
 */
export function encodeCharacterReference(code) {
  return '&#x' + code.toString(16).toUpperCase() + ';'
}
aXexX/**
 * Check whether to encode (as a character reference) the characters
 * surrounding an attention run.
 *
 * Which characters are around an attention run influence whether it works or
 * not.
 *
 * See <https://github.com/orgs/syntax-tree/discussions/60> for more info.
 * See this markdown in a particular renderer to see what works:
 *
 * ```markdown
 * |                         | A (letter inside) | B (punctuation inside) | C (whitespace inside) | D (nothing inside) |
 * | ----------------------- | ----------------- | ---------------------- | --------------------- | ------------------ |
 * | 1 (letter outside)      | x*y*z             | x*.*z                  | x* *z                 | x**z               |
 * | 2 (punctuation outside) | .*y*.             | .*.*.                  | .* *.                 | .**.               |
 * | 3 (whitespace outside)  | x *y* z           | x *.* z                | x * * z               | x ** z             |
 * | 4 (nothing outside)     | *x*               | *.*                    | * *                   | **                 |
 * ```
 *
 * @param {number} outside
 *   Code point on the outer side of the run.
 * @param {number} inside
 *   Code point on the inner side of the run.
 * @param {'*' | '_'} marker
 *   Marker of the run.
 *   Underscores are handled more strictly (they form less often) than
 *   asterisks.
 * @returns {EncodeSides}
 *   Whether to encode characters.
 */
export function encodeInfo(outside: number, inside: number, marker: "*" | "_"): EncodeSides;
import type { EncodeSides } from '../types.js';
//# sourceMappingURL=encode-info.d.ts.maplx  {"version":3,"file":"encode-info.d.ts","sourceRoot":"","sources":["encode-info.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAKH,oCAfW,MAAM,UAEN,MAAM,UAEN,GAAG,GAAG,GAAG,GAIP,WAAW,CAgDvB;iCAhF6B,aAAa"}>&Axo/**
 * @import {EncodeSides} from '../types.js'
 */

import {classifyCharacter} from 'micromark-util-classify-character'

/**
 * Check whether to encode (as a character reference) the characters
 * surrounding an attention run.
 *
 * Which characters are around an attention run influence whether it works or
 * not.
 *
 * See <https://github.com/orgs/syntax-tree/discussions/60> for more info.
 * See this markdown in a particular renderer to see what works:
 *
 * ```markdown
 * |                         | A (letter inside) | B (punctuation inside) | C (whitespace inside) | D (nothing inside) |
 * | ----------------------- | ----------------- | ---------------------- | --------------------- | ------------------ |
 * | 1 (letter outside)      | x*y*z             | x*.*z                  | x* *z                 | x**z               |
 * | 2 (punctuation outside) | .*y*.             | .*.*.                  | .* *.                 | .**.               |
 * | 3 (whitespace outside)  | x *y* z           | x *.* z                | x * * z               | x ** z             |
 * | 4 (nothing outside)     | *x*               | *.*                    | * *                   | **                 |
 * ```
 *
 * @param {number} outside
 *   Code point on the outer side of the run.
 * @param {number} inside
 *   Code point on the inner side of the run.
 * @param {'*' | '_'} marker
 *   Marker of the run.
 *   Underscores are handled more strictly (they form less often) than
 *   asterisks.
 * @returns {EncodeSides}
 *   Whether to encode characters.
 */
// Important: punctuation must never be encoded.
// Punctuation is solely used by markdown constructs.
// And by encoding itself.
// Encoding them will break constructs or double encode things.
export function encodeInfo(outside, inside, marker) {
  const outsideKind = classifyCharacter(outside)
  const insideKind = classifyCharacter(inside)

  // Letter outside:
  if (outsideKind === undefined) {
    return insideKind === undefined
      ? // Letter inside:
        // we have to encode *both* letters for `_` as it is looser.
        // it already forms for `*` (and GFMs `~`).
        marker === '_'
        ? {inside: true, outside: true}
        : {inside: false, outside: false}
      : insideKind === 1
        ? // Whitespace inside: encode both (letter, whitespace).
          {inside: true, outside: true}
        : // Punctuation inside: encode outer (letter)
          {inside: false, outside: true}
  }

  // Whitespace outside:
  if (outsideKind === 1) {
    return insideKind === undefined
      ? // Letter inside: already forms.
        {inside: false, outside: false}
      : insideKind === 1
        ? // Whitespace inside: encode both (whitespace).
          {inside: true, outside: true}
        : // Punctuation inside: already forms.
          {inside: false, outside: false}
  }

  // Punctuation outside:
  return insideKind === undefined
    ? // Letter inside: already forms.
      {inside: false, outside: false}
    : insideKind === 1
      ? // Whitespace inside: encode inner (whitespace).
        {inside: true, outside: false}
      : // Punctuation inside: already forms.
        {inside: false, outside: false}
}
xz/**
 * @import {State} from 'mdast-util-to-markdown'
 * @import {Code} from 'mdast'
 */
/**
 * @param {Code} node
 * @param {State} state
 * @returns {boolean}
 */
export function formatCodeAsIndented(node: Code, state: State): boolean;
import type { Code } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
//# sourceMappingURL=format-code-as-indented.d.ts.mapJfx {"version":3,"file":"format-code-as-indented.d.ts","sourceRoot":"","sources":["format-code-as-indented.js"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;;;GAIG;AACH,2CAJW,IAAI,SACJ,KAAK,GACH,OAAO,CAanB;0BAnBsB,OAAO;2BADN,wBAAwB"}XEV#x8/**
 * @import {State} from 'mdast-util-to-markdown'
 * @import {Code} from 'mdast'
 */

/**
 * @param {Code} node
 * @param {State} state
 * @returns {boolean}
 */
export function formatCodeAsIndented(node, state) {
  return Boolean(
    state.options.fences === false &&
      node.value &&
      // If there’s no info…
      !node.lang &&
      // And there’s a non-whitespace character…
      /[^ \r\n]/.test(node.value) &&
      // And the value doesn’t start or end in a blank…
      !/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(node.value)
  )
}
ZĶx-/**
 * @param {Heading} node
 * @param {State} state
 * @returns {boolean}
 */
export function formatHeadingAsSetext(node: Heading, state: State): boolean;
import type { Heading } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
//# sourceMappingURL=format-heading-as-setext.d.ts.maphx '{"version":3,"file":"format-heading-as-setext.d.ts","sourceRoot":"","sources":["format-heading-as-setext.js"],"names":[],"mappings":"AAQA;;;;GAIG;AACH,4CAJW,OAAO,SACP,KAAK,GACH,OAAO,CAsBnB;6BA/ByB,OAAO;2BADT,wBAAwB"}HC.x/**
 * @import {State} from 'mdast-util-to-markdown'
 * @import {Heading} from 'mdast'
 */

import {EXIT, visit} from 'unist-util-visit'
import {toString} from 'mdast-util-to-string'

/**
 * @param {Heading} node
 * @param {State} state
 * @returns {boolean}
 */
export function formatHeadingAsSetext(node, state) {
  let literalWithBreak = false

  // Look for literals with a line break.
  // Note that this also
  visit(node, function (node) {
    if (
      ('value' in node && /\r?\n|\r/.test(node.value)) ||
      node.type === 'break'
    ) {
      literalWithBreak = true
      return EXIT
    }
  })

  return Boolean(
    (!node.depth || node.depth < 3) &&
      toString(node) &&
      (state.options.setext || literalWithBreak)
  )
}
O*x"/**
 * @param {Link} node
 * @param {State} state
 * @returns {boolean}
 */
export function formatLinkAsAutolink(node: Link, state: State): boolean;
import type { Link } from 'mdast';
import type { State } from 'mdast-util-to-markdown';
//# sourceMappingURL=format-link-as-autolink.d.ts.map+d޶x ){"version":3,"file":"format-link-as-autolink.d.ts","sourceRoot":"","sources":["format-link-as-autolink.js"],"names":[],"mappings":"AAOA;;;;GAIG;AACH,2CAJW,IAAI,SACJ,KAAK,GACH,OAAO,CAuBnB;0BA/BsB,OAAO;2BADN,wBAAwB"}BȺ>x/**
 * @import {State} from 'mdast-util-to-markdown'
 * @import {Link} from 'mdast'
 */

import {toString} from 'mdast-util-to-string'

/**
 * @param {Link} node
 * @param {State} state
 * @returns {boolean}
 */
export function formatLinkAsAutolink(node, state) {
  const raw = toString(node)

  return Boolean(
    !state.options.resourceLink &&
      // If there’s a url…
      node.url &&
      // And there’s a no title…
      !node.title &&
      // And the content of `node` is a single text node…
      node.children &&
      node.children.length === 1 &&
      node.children[0].type === 'text' &&
      // And if the url is the same as the content…
      (raw === node.url || 'mailto:' + raw === node.url) &&
      // And that starts w/ a protocol…
      /^[a-z][a-z+.-]+:/i.test(node.url) &&
      // And that doesn’t contain ASCII control codes (character escapes and
      // references don’t work), space, or angle brackets…
      !/[\0- <>\u007F]/.test(node.url)
  )
}
@-x~ export function indentLines(value: string, map: import("../types.js").Map): string;
//# sourceMappingURL=indent-lines.d.ts.map?,xo {"version":3,"file":"indent-lines.d.ts","sourceRoot":"","sources":["indent-lines.js"],"names":[],"mappings":""}.%&xe/**
 * @import {IndentLines} from '../types.js'
 */

const eol = /\r?\n|\r/g

/**
 * @type {IndentLines}
 */
export function indentLines(value, map) {
  /** @type {Array<string>} */
  const result = []
  let start = 0
  let line = 0
  /** @type {RegExpExecArray | null} */
  let match

  while ((match = eol.exec(value))) {
    one(value.slice(start, match.index))
    result.push(match[0])
    start = match.index + match[0].length
    line++
  }

  one(value.slice(start))

  return result.join('')

  /**
   * @param {string} value
   */
  function one(value) {
    result.push(map(value, line, !value))
  }
}
 rx^/**
 * @import {ConstructName, Unsafe} from 'mdast-util-to-markdown'
 */
/**
 * @param {Array<ConstructName>} stack
 * @param {Unsafe} pattern
 * @returns {boolean}
 */
export function patternInScope(stack: Array<ConstructName>, pattern: Unsafe): boolean;
import type { ConstructName } from 'mdast-util-to-markdown';
import type { Unsafe } from 'mdast-util-to-markdown';
//# sourceMappingURL=pattern-in-scope.d.ts.mapВ~x {"version":3,"file":"pattern-in-scope.d.ts","sourceRoot":"","sources":["pattern-in-scope.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,sCAJW,KAAK,CAAC,aAAa,CAAC,WACpB,MAAM,GACJ,OAAO,CAOnB;mCAbuC,wBAAwB;4BAAxB,wBAAwB"}7EƳ0x/**
 * @import {ConstructName, Unsafe} from 'mdast-util-to-markdown'
 */

/**
 * @param {Array<ConstructName>} stack
 * @param {Unsafe} pattern
 * @returns {boolean}
 */
export function patternInScope(stack, pattern) {
  return (
    listInScope(stack, pattern.inConstruct, true) &&
    !listInScope(stack, pattern.notInConstruct, false)
  )
}

/**
 * @param {Array<ConstructName>} stack
 * @param {Unsafe['inConstruct']} list
 * @param {boolean} none
 * @returns {boolean}
 */
function listInScope(stack, list, none) {
  if (typeof list === 'string') {
    list = [list]
  }

  if (!list || list.length === 0) {
    return none
  }

  let index = -1

  while (++index < list.length) {
    if (stack.includes(list[index])) {
      return true
    }
  }

  return false
}
>x/**
 * Make a string safe for embedding in markdown constructs.
 *
 * In markdown, almost all punctuation characters can, in certain cases,
 * result in something.
 * Whether they do is highly subjective to where they happen and in what
 * they happen.
 *
 * To solve this, `mdast-util-to-markdown` tracks:
 *
 * * Characters before and after something;
 * * What “constructs” we are in.
 *
 * This information is then used by this function to escape or encode
 * special characters.
 *
 * @param {State} state
 *   Info passed around about the current state.
 * @param {string | null | undefined} input
 *   Raw value to make safe.
 * @param {SafeConfig} config
 *   Configuration.
 * @returns {string}
 *   Serialized markdown safe for embedding.
 */
export function safe(state: State, input: string | null | undefined, config: SafeConfig): string;
import type { State } from 'mdast-util-to-markdown';
import type { SafeConfig } from 'mdast-util-to-markdown';
//# sourceMappingURL=safe.d.ts.mapVBXx {"version":3,"file":"safe.d.ts","sourceRoot":"","sources":["safe.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,4BATW,KAAK,SAEL,MAAM,GAAG,IAAI,GAAG,SAAS,UAEzB,UAAU,GAER,MAAM,CAoGlB;2BAhImC,wBAAwB;gCAAxB,wBAAwB"}eCx)/**
 * @import {SafeConfig, State} from 'mdast-util-to-markdown'
 */

import {encodeCharacterReference} from './encode-character-reference.js'
import {patternInScope} from './pattern-in-scope.js'

/**
 * Make a string safe for embedding in markdown constructs.
 *
 * In markdown, almost all punctuation characters can, in certain cases,
 * result in something.
 * Whether they do is highly subjective to where they happen and in what
 * they happen.
 *
 * To solve this, `mdast-util-to-markdown` tracks:
 *
 * * Characters before and after something;
 * * What “constructs” we are in.
 *
 * This information is then used by this function to escape or encode
 * special characters.
 *
 * @param {State} state
 *   Info passed around about the current state.
 * @param {string | null | undefined} input
 *   Raw value to make safe.
 * @param {SafeConfig} config
 *   Configuration.
 * @returns {string}
 *   Serialized markdown safe for embedding.
 */
export function safe(state, input, config) {
  const value = (config.before || '') + (input || '') + (config.after || '')
  /** @type {Array<number>} */
  const positions = []
  /** @type {Array<string>} */
  const result = []
  /** @type {Record<number, {before: boolean, after: boolean}>} */
  const infos = {}
  let index = -1

  while (++index < state.unsafe.length) {
    const pattern = state.unsafe[index]

    if (!patternInScope(state.stack, pattern)) {
      continue
    }

    const expression = state.compilePattern(pattern)
    /** @type {RegExpExecArray | null} */
    let match

    while ((match = expression.exec(value))) {
      const before = 'before' in pattern || Boolean(pattern.atBreak)
      const after = 'after' in pattern
      const position = match.index + (before ? match[1].length : 0)

      if (positions.includes(position)) {
        if (infos[position].before && !before) {
          infos[position].before = false
        }

        if (infos[position].after && !after) {
          infos[position].after = false
        }
      } else {
        positions.push(position)
        infos[position] = {before, after}
      }
    }
  }

  positions.sort(numerical)

  let start = config.before ? config.before.length : 0
  const end = value.length - (config.after ? config.after.length : 0)
  index = -1

  while (++index < positions.length) {
    const position = positions[index]

    // Character before or after matched:
    if (position < start || position >= end) {
      continue
    }

    // If this character is supposed to be escaped because it has a condition on
    // the next character, and the next character is definitly being escaped,
    // then skip this escape.
    if (
      (position + 1 < end &&
        positions[index + 1] === position + 1 &&
        infos[position].after &&
        !infos[position + 1].before &&
        !infos[position + 1].after) ||
      (positions[index - 1] === position - 1 &&
        infos[position].before &&
        !infos[position - 1].before &&
        !infos[position - 1].after)
    ) {
      continue
    }

    if (start !== position) {
      // If we have to use a character reference, an ampersand would be more
      // correct, but as backslashes only care about punctuation, either will
      // do the trick
      result.push(escapeBackslashes(value.slice(start, position), '\\'))
    }

    start = position

    if (
      /[!-/:-@[-`{-~]/.test(value.charAt(position)) &&
      (!config.encode || !config.encode.includes(value.charAt(position)))
    ) {
      // Character escape.
      result.push('\\')
    } else {
      // Character reference.
      result.push(encodeCharacterReference(value.charCodeAt(position)))
      start++
    }
  }

  result.push(escapeBackslashes(value.slice(start, end), config.after))

  return result.join('')
}

/**
 * @param {number} a
 * @param {number} b
 * @returns {number}
 */
function numerical(a, b) {
  return a - b
}

/**
 * @param {string} value
 * @param {string} after
 * @returns {string}
 */
function escapeBackslashes(value, after) {
  const expression = /\\(?=[!-/:-@[-`{-~])/g
  /** @type {Array<number>} */
  const positions = []
  /** @type {Array<string>} */
  const results = []
  const whole = value + after
  let index = -1
  let start = 0
  /** @type {RegExpExecArray | null} */
  let match

  while ((match = expression.exec(whole))) {
    positions.push(match.index)
  }

  while (++index < positions.length) {
    if (start !== positions[index]) {
      results.push(value.slice(start, positions[index]))
    }

    results.push('\\')
    start = positions[index]
  }

  results.push(value.slice(start))

  return results.join('')
}
ԍWx }export function track(info: import("../types.js").TrackFields): import("../types.js").Tracker;
//# sourceMappingURL=track.d.ts.map-xa {"version":3,"file":"track.d.ts","sourceRoot":"","sources":["track.js"],"names":[],"mappings":""}Nx/**
 * @import {CreateTracker, TrackCurrent, TrackMove, TrackShift} from '../types.js'
 */

/**
 * Track positional info in the output.
 *
 * @type {CreateTracker}
 */
export function track(config) {
  // Defaults are used to prevent crashes when older utilities somehow activate
  // this code.
  /* c8 ignore next 5 */
  const options = config || {}
  const now = options.now || {}
  let lineShift = options.lineShift || 0
  let line = now.line || 1
  let column = now.column || 1

  return {move, current, shift}

  /**
   * Get the current tracked info.
   *
   * @type {TrackCurrent}
   */
  function current() {
    return {now: {line, column}, lineShift}
  }

  /**
   * Define an increased line shift (the typical indent for lines).
   *
   * @type {TrackShift}
   */
  function shift(value) {
    lineShift += value
  }

  /**
   * Move past some generated markdown.
   *
   * @type {TrackMove}
   */
  function move(input) {
    // eslint-disable-next-line unicorn/prefer-default-parameters
    const value = input || ''
    const chunks = value.split(/\r?\n|\r/g)
    const tail = chunks[chunks.length - 1]
    line += chunks.length - 1
    column =
      chunks.length === 1 ? column + tail.length : 1 + tail.length + lineShift
    return value
  }
}
ϓ۶xf{
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "bugs": "https://github.com/syntax-tree/mdast-util-to-markdown/issues",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "dependencies": {
    "@types/mdast": "^4.0.0",
    "@types/unist": "^3.0.0",
    "longest-streak": "^3.0.0",
    "mdast-util-phrasing": "^4.0.0",
    "mdast-util-to-string": "^4.0.0",
    "micromark-util-classify-character": "^2.0.0",
    "micromark-util-decode-string": "^2.0.0",
    "unist-util-visit": "^5.0.0",
    "zwitch": "^2.0.0"
  },
  "description": "mdast utility to serialize markdown",
  "devDependencies": {
    "@types/node": "^22.0.0",
    "c8": "^10.0.0",
    "mdast-util-from-markdown": "^2.0.0",
    "prettier": "^3.0.0",
    "remark-cli": "^12.0.0",
    "remark-preset-wooorm": "^10.0.0",
    "type-coverage": "^2.0.0",
    "typescript": "^5.0.0",
    "unist-util-remove-position": "^5.0.0",
    "xo": "^0.59.0"
  },
  "exports": "./index.js",
  "files": [
    "lib/",
    "index.d.ts",
    "index.js"
  ],
  "funding": {
    "type": "opencollective",
    "url": "https://opencollective.com/unified"
  },
  "keywords": [
    "ast",
    "compile",
    "markdown",
    "markup",
    "mdast-util",
    "mdast",
    "serialize",
    "stringify",
    "syntax",
    "tree",
    "unist",
    "utility",
    "util"
  ],
  "license": "MIT",
  "name": "mdast-util-to-markdown",
  "prettier": {
    "bracketSpacing": false,
    "semi": false,
    "singleQuote": true,
    "tabWidth": 2,
    "trailingComma": "none",
    "useTabs": false
  },
  "remarkConfig": {
    "plugins": [
      "remark-preset-wooorm"
    ]
  },
  "repository": "syntax-tree/mdast-util-to-markdown",
  "version": "2.1.2",
  "scripts": {
    "prepack": "npm run build && npm run format",
    "build": "tsc --build --clean && tsc --build && type-coverage",
    "format": "remark . -qfo && prettier . -w --log-level warn && xo --fix",
    "test-api": "node --conditions development test/index.js",
    "test-coverage": "c8 --100 --reporter lcov npm run test-api",
    "test": "npm run build && npm run format && npm run test-coverage"
  },
  "sideEffects": false,
  "typeCoverage": {
    "atLeast": 100,
    "ignoreFiles": [
      "lib/types.d.ts"
    ],
    "strict": true
  },
  "type": "module",
  "xo": {
    "overrides": [
      {
        "files": [
          "**/*.d.ts"
        ],
        "rules": {
          "@typescript-eslint/array-type": [
            "error",
            {
              "default": "generic"
            }
          ],
          "@typescript-eslint/ban-types": [
            "error",
            {
              "extendDefaults": true
            }
          ],
          "@typescript-eslint/consistent-type-definitions": [
            "error",
            "interface"
          ]
        }
      },
      {
        "files": [
          "test/**/*.js"
        ],
        "rules": {
          "max-depth": "off",
          "no-await-in-loop": "off"
        }
      }
    ],
    "prettier": true,
    "rules": {
      "complexity": "off",
      "unicorn/prefer-at": "off",
      "unicorn/prefer-code-point": "off"
    }
  }
}
hPm^
xT# mdast-util-to-markdown

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

**[mdast][]** utility that turns a syntax tree into markdown.

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`toMarkdown(tree[, options])`](#tomarkdowntree-options)
  * [`defaultHandlers`](#defaulthandlers)
  * [`ConstructName`](#constructname)
  * [`ConstructNameMap`](#constructnamemap)
  * [`Handle`](#handle)
  * [`Handlers`](#handlers)
  * [`Info`](#info)
  * [`Join`](#join)
  * [`Map`](#map)
  * [`Options`](#options)
  * [`SafeConfig`](#safeconfig)
  * [`State`](#state)
  * [`Tracker`](#tracker)
  * [`Unsafe`](#unsafe)
* [List of extensions](#list-of-extensions)
* [Syntax](#syntax)
* [Syntax tree](#syntax-tree)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package is a utility that takes an [mdast][] syntax tree as input and turns
it into serialized markdown.

This utility is a low level project.
It’s used in [`remark-stringify`][remark-stringify], which focusses on making it
easier to transform content by abstracting these internals away.

## When should I use this?

If you want to handle syntax trees manually, use this.
For an easier time processing content, use the **[remark][]** ecosystem instead.

You can combine this utility with other utilities to add syntax extensions.
Notable examples that deeply integrate with it are
[`mdast-util-gfm`][mdast-util-gfm],
[`mdast-util-mdx`][mdast-util-mdx],
[`mdast-util-frontmatter`][mdast-util-frontmatter],
[`mdast-util-math`][mdast-util-math], and
[`mdast-util-directive`][mdast-util-directive].

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install mdast-util-to-markdown
```

In Deno with [`esm.sh`][esmsh]:

```js
import {toMarkdown} from 'https://esm.sh/mdast-util-to-markdown@2'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {toMarkdown} from 'https://esm.sh/mdast-util-to-markdown@2?bundle'
</script>
```

## Use

Say our module `example.js` looks as follows:

```js
/**
 * @import {Root} from 'mdast'
 */

import {toMarkdown} from 'mdast-util-to-markdown'

/** @type {Root} */
const tree = {
  type: 'root',
  children: [
    {
      type: 'blockquote',
      children: [
        {type: 'thematicBreak'},
        {
          type: 'paragraph',
          children: [
            {type: 'text', value: '- a\nb !'},
            {
              type: 'link',
              url: 'example.com',
              children: [{type: 'text', value: 'd'}]
            }
          ]
        }
      ]
    }
  ]
}

console.log(toMarkdown(tree))
```

…now running `node example.js` yields:

```markdown
> ***
>
> \- a
> b \![d](example.com)
```

> 👉 **Note**: observe the properly escaped characters which would otherwise
> turn into a list and image respectively.

## API

This package exports the identifiers [`defaultHandlers`][api-default-handlers]
and [`toMarkdown`][api-to-markdown].
There is no default export.

### `toMarkdown(tree[, options])`

Turn an **[mdast][]** syntax tree into markdown.

###### Parameters

* `tree` ([`Node`][node])
  — tree to serialize
* `options` ([`Options`][api-options], optional)
  — configuration

###### Returns

Serialized markdown representing `tree` (`string`).

### `defaultHandlers`

Default (CommonMark) handlers ([`Handlers`][api-handlers]).

### `ConstructName`

Construct names for things generated by `mdast-util-to-markdown` (TypeScript
type).

This is an enum of strings, each being a semantic label, useful to know when
serializing whether we’re for example in a double (`"`) or single (`'`) quoted
title.

###### Type

```ts
type ConstructName = ConstructNameMap[keyof ConstructNameMap]
```

### `ConstructNameMap`

Interface of registered constructs (TypeScript type).

###### Type

```ts
interface ConstructNameMap { /* see code */ }
```

When working on extensions that use new constructs, extend the corresponding
interface to register its name:

```ts
declare module 'mdast-util-to-markdown' {
  interface ConstructNameMap {
    // Register a new construct name (value is used, key should match it).
    gfmStrikethrough: 'gfmStrikethrough'
  }
}
```

### `Handle`

Handle a particular node (TypeScript type).

###### Parameters

* `node` (`any`)
  — expected mdast node
* `parent` ([`Node`][node], optional)
  — parent of `node`
* `state` ([`State`][api-state])
  — info passed around about the current state
* `info` ([`Info`][api-info])
  — info on the surrounding of the node that is serialized

###### Returns

Serialized markdown representing `node` (`string`).

### `Handlers`

Handle particular nodes (TypeScript type).

Each key is a node type (`Node['type']`), each value its corresponding handler
([`Handle`][api-handle]).

###### Type

```ts
type Handlers = Record<Node['type'], Handle>
```

### `Info`

Info on the surrounding of the node that is serialized (TypeScript type).

###### Fields

* `now` ([`Point`][point])
  — current point
* `lineShift` (`number`)
  — number of columns each line will be shifted by wrapping nodes
* `before` (`string`)
  — characters before this (guaranteed to be one, can be more)
* `after` (`string`)
  — characters after this (guaranteed to be one, can be more)

### `Join`

How to join two blocks (TypeScript type).

“Blocks” are typically joined by one blank line.
Sometimes it’s nicer to have them flush next to each other, yet other times
they cannot occur together at all.

Join functions receive two adjacent siblings and their parent and what they
return defines how many blank lines to use between them.

###### Parameters

* `left` ([`Node`][node])
  — first of two adjacent siblings
* `right` ([`Node`][node])
  — second of two adjacent siblings
* `parent` ([`Node`][node])
  — parent of the two siblings
* `state` ([`State`][api-state])
  — info passed around about the current state

###### Returns

How many blank lines to use between the siblings (`boolean`, `number`,
optional).

Where `true` is as passing `1` and `false` means the nodes cannot be
joined by a blank line, such as two adjacent block quotes or indented code
after a list, in which case a comment will be injected to break them up:

```markdown
> Quote 1

<!---->

> Quote 2
```

> 👉 **Note**: abusing this feature will break markdown.
> One such example is when returning `0` for two paragraphs, which will result
> in the text running together, and in the future to be seen as one paragraph.

### `Map`

Map function to pad a single line (TypeScript type).

###### Parameters

* `value` (`string`)
  — a single line of serialized markdown
* `line` (`number`)
  — line number relative to the fragment
* `blank` (`boolean`)
  — whether the line is considered blank in markdown

###### Returns

Padded line (`string`).

### `Options`

Configuration (TypeScript type).

##### Fields

The following fields influence how markdown is serialized.

###### `options.bullet`

Marker to use for bullets of items in unordered lists (`'*'`, `'+'`, or `'-'`,
default: `'*'`).

There are three cases where the primary bullet cannot be used:

* when three or more list items are on their own, the last one is empty, and
  `bullet` is also a valid `rule`: `* - +`; this would turn into a thematic
  break if serialized with three primary bullets; `bulletOther` is used for
  the last item
* when a thematic break is the first child of a list item and `bullet` is the
  same character as `rule`: `- ***`; this would turn into a single thematic
  break if serialized with primary bullets; `bulletOther` is used for the
  item
* when two unordered lists appear next to each other: `* a\n- b`;
  `bulletOther` is used for such lists

###### `options.bulletOther`

Marker to use in certain cases where the primary bullet doesn’t work (`'*'`,
`'+'`, or `'-'`, default: `'-'` when `bullet` is `'*'`, `'*'` otherwise).

Cannot be equal to `bullet`.

###### `options.bulletOrdered`

Marker to use for bullets of items in ordered lists (`'.'` or `')'`, default:
`'.'`).

There is one case where the primary bullet for ordered items cannot be used:

* when two ordered lists appear next to each other: `1. a\n2) b`; to solve
  that, `'.'` will be used when `bulletOrdered` is `')'`, and `'.'` otherwise

###### `options.closeAtx`

Whether to add the same number of number signs (`#`) at the end of an ATX
heading as the opening sequence (`boolean`, default: `false`).

###### `options.emphasis`

Marker to use for emphasis (`'*'` or `'_'`, default: `'*'`).

###### `options.fence`

Marker to use for fenced code (``'`'`` or `'~'`, default: ``'`'``).

###### `options.fences`

Whether to use fenced code always (`boolean`, default: `true`).
The default is to use fenced code if there is a language defined, if the code is
empty, or if it starts or ends in blank lines.

###### `options.incrementListMarker`

Whether to increment the counter of ordered lists items (`boolean`, default:
`true`).

###### `options.listItemIndent`

How to indent the content of list items (`'mixed'`, `'one'`, or `'tab'`,
default: `'one'`).
Either with the size of the bullet plus one space (when `'one'`), a tab stop
(`'tab'`), or depending on the item and its parent list (`'mixed'`, uses `'one'`
if the item and list are tight and `'tab'` otherwise).

###### `options.quote`

Marker to use for titles (`'"'` or `"'"`, default: `'"'`).

###### `options.resourceLink`

Whether to always use resource links (`boolean`, default: `false`).
The default is to use autolinks (`<https://example.com>`) when possible
and resource links (`[text](url)`) otherwise.

###### `options.rule`

Marker to use for thematic breaks (`'*'`, `'-'`, or `'_'`, default: `'*'`).

###### `options.ruleRepetition`

Number of markers to use for thematic breaks (`number`, default: `3`, min: `3`).

###### `options.ruleSpaces`

Whether to add spaces between markers in thematic breaks (`boolean`, default:
`false`).

###### `options.setext`

Whether to use setext headings when possible (`boolean`, default: `false`).
The default is to always use ATX headings (`# heading`) instead of setext
headings (`heading\n=======`).
Setext headings cannot be used for empty headings or headings with a rank of
three or more.

###### `options.strong`

Marker to use for strong (`'*'` or `'_'`, default: `'*'`).

###### `options.tightDefinitions`

Whether to join definitions without a blank line (`boolean`, default: `false`).

The default is to add blank lines between any flow (“block”) construct.
Turning this option on is a shortcut for a [`Join`][api-join] function like so:

```js
function joinTightDefinitions(left, right) {
  if (left.type === 'definition' && right.type === 'definition') {
    return 0
  }
}
```

###### `options.handlers`

Handle particular nodes ([`Handlers`][api-handlers], optional).

###### `options.join`

How to join blocks ([`Array<Join>`][api-join], optional).

###### `options.unsafe`

Schemas that define when characters cannot occur
([`Array<Unsafe>`][api-unsafe], optional).

###### `options.extensions`

List of extensions (`Array<Options>`, default: `[]`).
Each extension is an object with the same interface as `Options` itself.

### `SafeConfig`

Configuration passed to `state.safe` (TypeScript type).

###### Fields

* `before` (`string`)
  — characters before this (guaranteed to be one, can be more)
* `after` (`string`)
  — characters after this (guaranteed to be one, can be more)
* `encode` (`Array<string>`, optional)
  — extra characters that *must* be encoded (as character references) instead
  of escaped (character escapes).
  Only ASCII punctuation will use character escapes, so you never need to
  pass non-ASCII-punctuation here

### `State`

Info passed around about the current state (TypeScript type).

###### Fields

* `stack` ([`Array<ConstructName>`][api-construct-name])
  — stack of constructs we’re in
* `indexStack` (`Array<number>`)
  — positions of child nodes in their parents
* `associationId` (`(node: Association) => string`)
  — get an identifier from an association to match it to others (see
  [`Association`][association])
* `enter` (`(construct: ConstructName) => () => undefined`)
  — enter a construct (returns a corresponding exit function)
  (see [`ConstructName`][api-construct-name])
* `indentLines` (`(value: string, map: Map) => string`)
  — pad serialized markdown (see [`Map`][api-map])
* `compilePattern` (`(pattern: Unsafe) => RegExp`)
  — compile an unsafe pattern to a regex (see [`Unsafe`][api-unsafe])
* `containerFlow` (`(parent: Node, info: Info) => string`)
  — serialize flow children (see [`Info`][api-info])
* `containerPhrasing` (`(parent: Node, info: Info) => string`)
  — serialize phrasing children (see [`Info`][api-info])
* `createTracker` (`(info: Info) => Tracker`)
  — track positional info in the output (see [`Info`][api-info],
  [`Tracker`][api-tracker])
* `safe` (`(value: string, config: SafeConfig) => string`)
  — make a string safe for embedding (see [`SafeConfig`][api-safe-config])
* `options` ([`Options`][api-options])
  — applied user configuration
* `unsafe` ([`Array<Unsafe>`][api-unsafe])
  — applied unsafe patterns
* `join` ([`Array<Join>`][api-join])
  — applied join handlers
* `handle` ([`Handle`][api-handle])
  — call the configured handler for the given node
* `handlers` ([`Handlers`][api-handlers])
  — applied handlers
* `bulletCurrent` (`string` or `undefined`)
  — list marker currently in use
* `bulletLastUsed` (`string` or `undefined`)
  — list marker previously in use

### `Tracker`

Track positional info in the output (TypeScript type).

This info isn’t used yet but such functionality will allow line wrapping,
source maps, etc.

###### Fields

* `current` (`() => Info`)
  — get current tracked info
* `shift` (`(value: number) => undefined`)
  — define a relative increased line shift (the typical indent for lines)
* `move` (`(value: string) => string`)
  — move past some generated markdown

### `Unsafe`

Schema that defines when a character cannot occur (TypeScript type).

###### Fields

* `character` (`string`)
  — single unsafe character
* `inConstruct` ([`Array<ConstructName>`][api-construct-name],
  `ConstructName`, optional)
  — constructs where this is bad
* `notInConstruct` ([`Array<ConstructName>`][api-construct-name],
  `ConstructName`, optional)
  — constructs where this is fine again
* `before` (`string`, optional)
  — `character` is bad when this is before it (cannot be used together with
  `atBreak`)
* `after` (`string`, optional)
  — `character` is bad when this is after it
* `atBreak` (`boolean`, optional)
  — `character` is bad at a break (cannot be used together with `before`)

## List of extensions

* [`syntax-tree/mdast-util-directive`](https://github.com/syntax-tree/mdast-util-directive)
  — directives
* [`syntax-tree/mdast-util-frontmatter`](https://github.com/syntax-tree/mdast-util-frontmatter)
  — frontmatter (YAML, TOML, more)
* [`syntax-tree/mdast-util-gfm`](https://github.com/syntax-tree/mdast-util-gfm)
  — GFM
* [`syntax-tree/mdast-util-gfm-autolink-literal`](https://github.com/syntax-tree/mdast-util-gfm-autolink-literal)
  — GFM autolink literals
* [`syntax-tree/mdast-util-gfm-footnote`](https://github.com/syntax-tree/mdast-util-gfm-footnote)
  — GFM footnotes
* [`syntax-tree/mdast-util-gfm-strikethrough`](https://github.com/syntax-tree/mdast-util-gfm-strikethrough)
  — GFM strikethrough
* [`syntax-tree/mdast-util-gfm-table`](https://github.com/syntax-tree/mdast-util-gfm-table)
  — GFM tables
* [`syntax-tree/mdast-util-gfm-task-list-item`](https://github.com/syntax-tree/mdast-util-gfm-task-list-item)
  — GFM task list items
* [`syntax-tree/mdast-util-math`](https://github.com/syntax-tree/mdast-util-math)
  — math
* [`syntax-tree/mdast-util-mdx`](https://github.com/syntax-tree/mdast-util-mdx)
  — MDX
* [`syntax-tree/mdast-util-mdx-expression`](https://github.com/syntax-tree/mdast-util-mdx-expression)
  — MDX expressions
* [`syntax-tree/mdast-util-mdx-jsx`](https://github.com/syntax-tree/mdast-util-mdx-jsx)
  — MDX JSX
* [`syntax-tree/mdast-util-mdxjs-esm`](https://github.com/syntax-tree/mdast-util-mdxjs-esm)
  — MDX ESM

## Syntax

Markdown is serialized according to CommonMark but care is taken to format in
such a way that the resulting markdown should work with most markdown parsers.
Extensions can add support for custom syntax.

## Syntax tree

The syntax tree is [mdast][].

## Types

This package is fully typed with [TypeScript][].
It exports the additional types
[`ConstructName`][api-construct-name],
[`ConstructNameMap`][api-construct-name-map],
[`Handle`][api-handle],
[`Handlers`][api-handlers],
[`Info`][api-info],
[`Join`][api-join],
[`Map`][api-map],
[`Options`][api-options],
[`SafeConfig`][api-safe-config],
[`State`][api-State], and
[`Unsafe`][api-Unsafe].

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line, `mdast-util-to-markdown@^2`,
compatible with Node.js 16.

## Security

`mdast-util-to-markdown` will do its best to serialize markdown to match the
syntax tree, but there are several cases where that is impossible.
It’ll do its best, but complete roundtripping is impossible given that any value
could be injected into the tree.

As markdown is sometimes used for HTML, and improper use of HTML can open you up
to a [cross-site scripting (XSS)][xss] attack, use of `mdast-util-to-markdown`
and parsing it again later could potentially be unsafe.
When parsing markdown afterwards and then going to HTML, use something like
[`hast-util-sanitize`][hast-util-sanitize] to make the tree safe.

## Related

* [`syntax-tree/mdast-util-from-markdown`](https://github.com/syntax-tree/mdast-util-from-markdown)
  — parse markdown to mdast
* [`micromark/micromark`](https://github.com/micromark/micromark)
  — parse markdown
* [`remarkjs/remark`](https://github.com/remarkjs/remark)
  — process markdown

## Contribute

See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for
ways to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organization, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/syntax-tree/mdast-util-to-markdown/workflows/main/badge.svg

[build]: https://github.com/syntax-tree/mdast-util-to-markdown/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/mdast-util-to-markdown.svg

[coverage]: https://codecov.io/github/syntax-tree/mdast-util-to-markdown

[downloads-badge]: https://img.shields.io/npm/dm/mdast-util-to-markdown.svg

[downloads]: https://www.npmjs.com/package/mdast-util-to-markdown

[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=mdast-util-to-markdown

[size]: https://bundlejs.com/?q=mdast-util-to-markdown

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[collective]: https://opencollective.com/unified

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/syntax-tree/unist/discussions

[npm]: https://docs.npmjs.com/cli/install

[esmsh]: https://esm.sh

[license]: license

[author]: https://wooorm.com

[health]: https://github.com/syntax-tree/.github

[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md

[support]: https://github.com/syntax-tree/.github/blob/main/support.md

[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[typescript]: https://www.typescriptlang.org

[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting

[hast-util-sanitize]: https://github.com/syntax-tree/hast-util-sanitize

[point]: https://github.com/syntax-tree/unist#point

[mdast]: https://github.com/syntax-tree/mdast

[node]: https://github.com/syntax-tree/mdast#nodes

[association]: https://github.com/syntax-tree/mdast#association

[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm

[mdast-util-mdx]: https://github.com/syntax-tree/mdast-util-mdx

[mdast-util-frontmatter]: https://github.com/syntax-tree/mdast-util-frontmatter

[mdast-util-math]: https://github.com/syntax-tree/mdast-util-math

[mdast-util-directive]: https://github.com/syntax-tree/mdast-util-directive

[remark]: https://github.com/remarkjs/remark

[remark-stringify]: https://github.com/remarkjs/remark/tree/main/packages/remark-stringify

[api-construct-name]: #constructname

[api-construct-name-map]: #constructnamemap

[api-default-handlers]: #defaulthandlers

[api-handle]: #handle

[api-handlers]: #handlers

[api-info]: #info

[api-join]: #join

[api-map]: #map

[api-options]: #options

[api-safe-config]: #safeconfig

[api-state]: #state

[api-to-markdown]: #tomarkdowntree-options

[api-tracker]: #tracker

[api-unsafe]: #unsafe
ퟚx '100644 index.d.ts ԣ&I<{:100644 index.js t	{x5+a(40000 lib  #Mk/dnW8V:100644 license 2<tD?U100644 package.json HR&aP8Qp100644 readme.md M4 ZKC2{g3OVx_ export {toString} from './lib/index.js'
export type Options = import('./lib/index.js').Options
z!xh /**
 * @typedef {import('./lib/index.js').Options} Options
 */

export {toString} from './lib/index.js'
"dxJ 100644 index.d.ts ԃ4Vx/H%L100644 index.js 0fJ;,-W^\b$)Λ'ѱ4xA/**
 * Get the text content of a node or list of nodes.
 *
 * Prefers the node’s plain-text fields, otherwise serializes its children,
 * and if the given value is an array, serialize the nodes in it.
 *
 * @param {unknown} [value]
 *   Thing to serialize, typically `Node`.
 * @param {Options | null | undefined} [options]
 *   Configuration (optional).
 * @returns {string}
 *   Serialized `value`.
 */
export function toString(
  value?: unknown,
  options?: Options | null | undefined
): string
export type Nodes = import('mdast').Nodes
/**
 * Configuration (optional).
 */
export type Options = {
  /**
   * Whether to use `alt` for `image`s (default: `true`).
   */
  includeImageAlt?: boolean | null | undefined
  /**
   * Whether to use `value` of HTML (default: `true`).
   */
  includeHtml?: boolean | null | undefined
}
I4*xB
/**
 * @typedef {import('mdast').Nodes} Nodes
 *
 * @typedef Options
 *   Configuration (optional).
 * @property {boolean | null | undefined} [includeImageAlt=true]
 *   Whether to use `alt` for `image`s (default: `true`).
 * @property {boolean | null | undefined} [includeHtml=true]
 *   Whether to use `value` of HTML (default: `true`).
 */

/** @type {Options} */
const emptyOptions = {}

/**
 * Get the text content of a node or list of nodes.
 *
 * Prefers the node’s plain-text fields, otherwise serializes its children,
 * and if the given value is an array, serialize the nodes in it.
 *
 * @param {unknown} [value]
 *   Thing to serialize, typically `Node`.
 * @param {Options | null | undefined} [options]
 *   Configuration (optional).
 * @returns {string}
 *   Serialized `value`.
 */
export function toString(value, options) {
  const settings = options || emptyOptions
  const includeImageAlt =
    typeof settings.includeImageAlt === 'boolean'
      ? settings.includeImageAlt
      : true
  const includeHtml =
    typeof settings.includeHtml === 'boolean' ? settings.includeHtml : true

  return one(value, includeImageAlt, includeHtml)
}

/**
 * One node or several nodes.
 *
 * @param {unknown} value
 *   Thing to serialize.
 * @param {boolean} includeImageAlt
 *   Include image `alt`s.
 * @param {boolean} includeHtml
 *   Include HTML.
 * @returns {string}
 *   Serialized node.
 */
function one(value, includeImageAlt, includeHtml) {
  if (node(value)) {
    if ('value' in value) {
      return value.type === 'html' && !includeHtml ? '' : value.value
    }

    if (includeImageAlt && 'alt' in value && value.alt) {
      return value.alt
    }

    if ('children' in value) {
      return all(value.children, includeImageAlt, includeHtml)
    }
  }

  if (Array.isArray(value)) {
    return all(value, includeImageAlt, includeHtml)
  }

  return ''
}

/**
 * Serialize a list of nodes.
 *
 * @param {Array<unknown>} values
 *   Thing to serialize.
 * @param {boolean} includeImageAlt
 *   Include image `alt`s.
 * @param {boolean} includeHtml
 *   Include HTML.
 * @returns {string}
 *   Serialized nodes.
 */
function all(values, includeImageAlt, includeHtml) {
  /** @type {Array<string>} */
  const result = []
  let index = -1

  while (++index < values.length) {
    result[index] = one(values[index], includeImageAlt, includeHtml)
  }

  return result.join('')
}

/**
 * Check if `value` looks like a node.
 *
 * @param {unknown} value
 *   Thing.
 * @returns {value is Nodes}
 *   Whether `value` is a node.
 */
function node(value) {
  return Boolean(value && typeof value === 'object')
}
[Ix Fto-string",
  "version": "4.04($get the plain text content of a nodeK-7#node",
    "string",
    "serialize
/to-str>;to-str~|:-G824Pb<RxM
M/# mdast-util-to-string	)utility to get the text content of a node^="should I use this?](#when-should-iMQtoString(value[, options])`](#tostringvalue-options)
    *   [`Options`](#options	?Security](#secur>sis a tiny utility that gets the textual content of a node.

## When should I use this?

This utility is useful when you have a node, say a heading, and want to get the
text inside it.

This package does not serialize markdown, that’s what
[`mdast-util-zdoes.

Similar packages, [`hast-util-to-string`][hast-util-to-string] and
[`hast-util-to-text`][hast-util-to-text], do the same but on [hast][]x~	to-string	5toString6
"to-string@4	UtoString6
"to-string@4k
 ```js?toString} from 'mdast-util-to-string'

const tree = fromMarkdown('Some _emphasis_, **importance**, and `code`.')

console.log(t;oString(tree)) // => 'Some emphasis, importance, and code.'1 [`toString`][api-to-stringl%toString(value[, options])`

Get the text content of a node or list of nodes.

Prefers the node’s plain-text fields, otherwise serializes its children,
and if the given value is an array, serialize the nodes in it.

###### Parameters

*   `value` (`unknown`)
    — thing to serialize, typically [`Node`][node]
*   `options` ([`Options`][api-options], optional)
    — configuration

###### Returns

Serialized `value` (`string`).

### `Options`

Configuration (TypeScript type).

###### Fields

*   `includeImageAlt` (`boolean`, default: `true`)
    — whether to use `alt` for `image`s
*   `includeHtml` (`boolean`, default: `tr+ue`)
    — whether to use `value` of HTML@4exports the additional type [`Options`][api-options] `mdast-util-to-string@^4`,
compatible with Node.js 16.

## Security

Use of `mdast-util-to-string` does not involve **[hast][]**, user content, or
change the tree, so there are no openings for [cross-site scripting (XSS)][xss]
attacks.

## Related

*   [`hast-util-to-string`]("wooorm/rehype-minify/tree/main/packages/hast-util-to-string)
    — get text content in hast
*   [`hast-util-to-text`](https:/"Zhast-util-to-text)
    — get text content in hast according to the `innerText` algorithm	to-stringWN	to-string[	to-string"C	to-stringv>	to-string<	to-string	to-string-	to-stringRmdastP%P!"#QhastP%P!hast

[hast-util-to-stro!Qrehypejs/rehype-minify/tree/main/packages/hast-util-to-string

[hast-util-to-textP%P!hast-util-to-text

[nodeP%P!"#nodes

[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting

[api-to-string]: #tostringvalue-options

[api-options]: #options
Vx 100644 LICENSE gTScىH1`ȑd100644 README.md i2:5aY`40000 api (-L`j6/׫"R40000 css .P'\srE_
Z100644 index.js ;	u)"40000 l10n تiDˤ$ټ2Ȩ100644 package.json aZr6/eQZxdCC0 1.0 Universal

Statement of Purpose

The laws of most jurisdictions throughout the world automatically confer
exclusive Copyright and Related Rights (defined below) upon the creator and
subsequent owner(s) (each and all, an "owner") of an original work of
authorship and/or a database (each, a "Work").

Certain owners wish to permanently relinquish those rights to a Work for the
purpose of contributing to a commons of creative, cultural and scientific
works ("Commons") that the public can reliably and without fear of later
claims of infringement build upon, modify, incorporate in other works, reuse
and redistribute as freely as possible in any form whatsoever and for any
purposes, including without limitation commercial purposes. These owners may
contribute to the Commons to promote the ideal of a free culture and the
further production of creative, cultural and scientific works, or to gain
reputation or greater distribution for their Work in part through the use and
efforts of others.

For these and/or other purposes and motivations, and without any expectation
of additional consideration or compensation, the person associating CC0 with a
Work (the "Affirmer"), to the extent that he or she is an owner of Copyright
and Related Rights in the Work, voluntarily elects to apply CC0 to the Work
and publicly distribute the Work under its terms, with knowledge of his or her
Copyright and Related Rights in the Work and the meaning and intended legal
effect of CC0 on those rights.

1. Copyright and Related Rights. A Work made available under CC0 may be
protected by copyright and related or neighboring rights ("Copyright and
Related Rights"). Copyright and Related Rights include, but are not limited
to, the following:

  i. the right to reproduce, adapt, distribute, perform, display, communicate,
  and translate a Work;

  ii. moral rights retained by the original author(s) and/or performer(s);

  iii. publicity and privacy rights pertaining to a person's image or likeness
  depicted in a Work;

  iv. rights protecting against unfair competition in regards to a Work,
  subject to the limitations in paragraph 4(a), below;

  v. rights protecting the extraction, dissemination, use and reuse of data in
  a Work;

  vi. database rights (such as those arising under Directive 96/9/EC of the
  European Parliament and of the Council of 11 March 1996 on the legal
  protection of databases, and under any national implementation thereof,
  including any amended or successor version of such directive); and

  vii. other similar, equivalent or corresponding rights throughout the world
  based on applicable law or treaty, and any national implementations thereof.

2. Waiver. To the greatest extent permitted by, but not in contravention of,
applicable law, Affirmer hereby overtly, fully, permanently, irrevocably and
unconditionally waives, abandons, and surrenders all of Affirmer's Copyright
and Related Rights and associated claims and causes of action, whether now
known or unknown (including existing as well as future claims and causes of
action), in the Work (i) in all territories worldwide, (ii) for the maximum
duration provided by applicable law or treaty (including future time
extensions), (iii) in any current or future medium and for any number of
copies, and (iv) for any purpose whatsoever, including without limitation
commercial, advertising or promotional purposes (the "Waiver"). Affirmer makes
the Waiver for the benefit of each member of the public at large and to the
detriment of Affirmer's heirs and successors, fully intending that such Waiver
shall not be subject to revocation, rescission, cancellation, termination, or
any other legal or equitable action to disrupt the quiet enjoyment of the Work
by the public as contemplated by Affirmer's express Statement of Purpose.

3. Public License Fallback. Should any part of the Waiver for any reason be
judged legally invalid or ineffective under applicable law, then the Waiver
shall be preserved to the maximum extent permitted taking into account
Affirmer's express Statement of Purpose. In addition, to the extent the Waiver
is so judged Affirmer hereby grants to each affected person a royalty-free,
non transferable, non sublicensable, non exclusive, irrevocable and
unconditional license to exercise Affirmer's Copyright and Related Rights in
the Work (i) in all territories worldwide, (ii) for the maximum duration
provided by applicable law or treaty (including future time extensions), (iii)
in any current or future medium and for any number of copies, and (iv) for any
purpose whatsoever, including without limitation commercial, advertising or
promotional purposes (the "License"). The License shall be deemed effective as
of the date CC0 was applied by Affirmer to the Work. Should any part of the
License for any reason be judged legally invalid or ineffective under
applicable law, such partial invalidity or ineffectiveness shall not
invalidate the remainder of the License, and in such case Affirmer hereby
affirms that he or she will not (i) exercise any of his or her remaining
Copyright and Related Rights in the Work or (ii) assert any associated claims
and causes of action with respect to the Work, in either case contrary to
Affirmer's express Statement of Purpose.

4. Limitations and Disclaimers.

  a. No trademark or patent rights held by Affirmer are waived, abandoned,
  surrendered, licensed or otherwise affected by this document.

  b. Affirmer offers the Work as-is and makes no representations or warranties
  of any kind concerning the Work, express, implied, statutory or otherwise,
  including without limitation warranties of title, merchantability, fitness
  for a particular purpose, non infringement, or the absence of latent or
  other defects, accuracy, or the present or absence of errors, whether or not
  discoverable, all to the greatest extent permissible under applicable law.

  c. Affirmer disclaims responsibility for clearing rights of other persons
  that may apply to the Work or any use thereof, including without limitation
  any person's Copyright and Related Rights in the Work. Further, Affirmer
  disclaims responsibility for obtaining any necessary consents, permissions
  or other rights required for any use of the Work.

  d. Affirmer understands and acknowledges that Creative Commons is not a
  party to this document and has no duty or obligation with respect to this
  CC0 or use of the Work.

For more information, please see
<http://creativecommons.org/publicdomain/zero/1.0/>
L2yx8# Welcome to MDN data

> **Note**
> We are in the process of deprecating the `mdn/data` package in favor of [`w3c/webref`](https://github.com/w3c/webref).
> If you depend on this project, let us know in our community [GitHub discussions](https://github.com/mdn/mdn-community/discussions/categories/platform).
> Thank you.

[![NPM version](https://img.shields.io/npm/v/mdn-data.svg)](https://www.npmjs.com/package/mdn-data)
[![lint](https://github.com/mdn/data/actions/workflows/lint.yml/badge.svg)](https://github.com/mdn/data/actions/workflows/lint.yml)

This repository contains general data for Web technologies and is maintained by the [MDN team at Mozilla](https://wiki.mozilla.org/MDN).

## Repository contents

The data in this repository is used in MDN Web Docs to build [information boxes](https://developer.mozilla.org/en-US/docs/Web/CSS/background) and [sidebar navigation](https://developer.mozilla.org/en-US/docs/Web/API/Window).
External tools make use of this data as well, for example, the [CSSTree](https://github.com/csstree/csstree/) CSS parser.

There's a top-level directory for each broad area covered: for example, `api` and `css`.
Inside each of these directories is one or more JSON files containing the data.

### api

Contains data about Web APIs:

- API inheritance (interface inheritance and mixin implementations)

### css

Contains data about:

- CSS at-rules
- CSS functions
- CSS properties
- CSS selectors
- CSS syntaxes
- CSS types
- CSS units

For more information, see the [CSS data](./css/README.md) documentation and the [Updating CSS JSON DB](./docs/updating_css_json.md) guide.

### l10n

The l10n folder contains localization strings that are used in the various
json files throughout this repository.

## Problems?

If you find a problem, please [file an issue](https://github.com/mdn/data/issues/new).

## Contributing

We're very happy to accept contributions to this data.
Please familiarize yourself with the schema for the data you're editing, and send us a pull request.
See the [CONTRIBUTING.md](./CONTRIBUTING.md) document for more information.

## See also

- [https://github.com/mdn/browser-compat-data](https://github.com/mdn/browser-compat-data)
  for compatibility data for Web technologies
3(x |100644 index.js Lɶpܾ#)*100644 inheritance.json 	y @CFu`5s100644 inheritance.schema.json pj,j(:" 4x> module.exports = {
  inheritance: require('./inheritance'),
}
0x00{
  "AbsoluteOrientationSensor": {
    "inherits": "OrientationSensor",
    "implements": []
  },
  "AbstractRange": {
    "inherits": null,
    "implements": []
  },
  "Accelerometer": {
    "inherits": "Sensor",
    "implements": []
  },
  "AmbientLightSensor": {
    "inherits": "Sensor",
    "implements": []
  },
  "AnalyserNode": {
    "inherits": "AudioNode",
    "implements": [
      "AudioNodePassThrough"
    ]
  },
  "AnimationEvent": {
    "inherits": "Event",
    "implements": []
  },
  "ArchiveRequest": {
    "inherits": "DOMRequest",
    "implements": []
  },
  "Attr": {
    "inherits": "Node",
    "implements": []
  },
  "AudioBufferSourceNode": {
    "inherits": "AudioScheduledSourceNode",
    "implements": [
      "AudioNodePassThrough"
    ]
  },
  "AudioChannelManager": {
    "inherits": "EventTarget",
    "implements": []
  },
  "AudioContext": {
    "inherits": "BaseAudioContext",
    "implements": []
  },
  "AudioDestinationNode": {
    "inherits": "AudioNode",
    "implements": []
  },
  "AudioNode": {
    "inherits": "EventTarget",
    "implements": []
  },
  "AudioProcessingEvent": {
    "inherits": "Event",
    "implements": []
  },
  "AudioScheduledSourceNode": {
    "inherits": "AudioNode",
    "implements": []
  },
  "AudioStreamTrack": {
    "inherits": "MediaStreamTrack",
    "implements": []
  },
  "AudioTrackList": {
    "inherits": "EventTarget",
    "implements": []
  },
  "AutocompleteErrorEvent": {
    "inherits": "Event",
    "implements": []
  },
  "BarProp": {
    "inherits": null,
    "implements": []
  },
  "BaseAudioContext": {
    "inherits": "EventTarget",
    "implements": []
  },
  "BatteryManager": {
    "inherits": "EventTarget",
    "implements": []
  },
  "BeforeAfterKeyboardEvent": {
    "inherits": "KeyboardEvent",
    "implements": []
  },
  "BeforeInstallPromptEvent": {
    "inherits": "Event",
    "implements": []
  },
  "BeforeUnloadEvent": {
    "inherits": "Event",
    "implements": []
  },
  "BiquadFilterNode": {
    "inherits": "AudioNode",
    "implements": [
      "AudioNodePassThrough"
    ]
  },
  "BlobEvent": {
    "inherits": "Event",
    "implements": []
  },
  "BluetoothAdapter": {
    "inherits": "EventTarget",
    "implements": []
  },
  "BluetoothAdapterEvent": {
    "inherits": "Event",
    "implements": []
  },
  "BluetoothAttributeEvent": {
    "inherits": "Event",
    "implements": []
  },
  "BluetoothDevice": {
    "inherits": "EventTarget",
    "implements": []
  },
  "BluetoothDeviceEvent": {
    "inherits": "Event",
    "implements": []
  },
  "BluetoothDiscoveryHandle": {
    "inherits": "EventTarget",
    "implements": []
  },
  "BluetoothDiscoveryStateChangedEvent": {
    "inherits": "Event",
    "implements": []
  },
  "BluetoothGatt": {
    "inherits": "EventTarget",
    "implements": []
  },
  "BluetoothManager": {
    "inherits": "EventTarget",
    "implements": []
  },
  "BluetoothPairingEvent": {
    "inherits": "Event",
    "implements": []
  },
  "BluetoothStatusChangedEvent": {
    "inherits": "Event",
    "implements": []
  },
  "BoxObject": {
    "inherits": null,
    "implements": []
  },
  "BroadcastChannel": {
    "inherits": "EventTarget",
    "implements": []
  },
  "BrowserElement": {
    "inherits": null,
    "implements": [
      "BrowserElementCommon",
      "BrowserElementPrivileged"
    ]
  },
  "CDATASection": {
    "inherits": "Text",
    "implements": []
  },
  "CFStateChangeEvent": {
    "inherits": "Event",
    "implements": []
  },
  "CSSCounterStyleRule": {
    "inherits": "CSSRule",
    "implements": []
  },
  "CSSFontFaceLoadEvent": {
    "inherits": "Event",
    "implements": []
  },
  "CSSImageValue": {
    "inherits": "CSSStyleValue",
    "implements": []
  },
  "CSSKeywordValue": {
    "inherits": "CSSStyleValue",
    "implements": []
  },
  "CSSMathInvert": {
    "inherits": "CSSMathValue",
    "implements": []
  },
  "CSSMathMax": {
    "inherits": "CSSMathValue",
    "implements": []
  },
  "CSSMathMin": {
    "inherits": "CSSMathValue",
    "implements": []
  },
  "CSSMathNegate": {
    "inherits": "CSSMathValue",
    "implements": []
  },
  "CSSMathProduct": {
    "inherits": "CSSMathValue",
    "implements": []
  },
  "CSSMathSum": {
    "inherits": "CSSMathValue",
    "implements": []
  },
  "CSSMathValue": {
    "inherits": "CSSNumericValue",
    "implements": [
      "CSSMathInvert",
      "CSSMathMax",
      "CSSMathMin",
      "CSSMathNegate",
      "CSSMathProduct",
      "CSSMathSum"
    ]
  },
  "CSSMatrixComponent": {
    "inherits": "CSSTransformComponent",
    "implements": []
  },
  "CSSNumericValue": {
    "inherits": "CSSStyleValue",
    "implements": [
      "CSSMathValue",
      "CSSUnitValue"
    ]
  },
  "CSSPerspective": {
    "inherits": "CSSTransformComponent",
    "implements": []
  },
  "CSSPositionValue": {
    "inherits": "CSSStyleValue",
    "implements": []
  },
  "CSSPrimitiveValue": {
    "inherits": "CSSValue",
    "implements": []
  },
  "CSSPseudoElement": {
    "inherits": "EventTarget",
    "implements": [
      "Animatable"
    ]
  },
  "CSSRotate": {
    "inherits": "CSSTransformComponent",
    "implements": []
  },
  "CSSScale": {
    "inherits": "CSSTransformComponent",
    "implements": []
  },
  "CSSSkew": {
    "inherits": "CSSTransformComponent",
    "implements": []
  },
  "CSSSkewX": {
    "inherits": "CSSTransformComponent",
    "implements": []
  },
  "CSSSkewY": {
    "inherits": "CSSTransformComponent",
    "implements": []
  },
  "CSSStyleDeclaration": {
    "inherits": null,
    "implements": []
  },
  "CSSStyleSheet": {
    "inherits": "StyleSheet",
    "implements": []
  },
  "CSSStyleValue": {
    "inherits": null,
    "implements": [
      "CSSImageValue",
      "CSSKeywordValue",
      "CSSNumericValue",
      "CSSPositionValue",
      "CSSTransformValue",
      "CSSUnitValue",
      "CSSUnparsedValue"
    ]
  },
  "CSSTransformComponent": {
    "inherits": null,
    "implements": [
      "CSSMatrixComponent",
      "CSSPerspective",
      "CSSRotate",
      "CSSScale",
      "CSSSkew",
      "CSSSkewX",
      "CSSSkewY",
      "CSSTranslate"
    ]
  },
  "CSSTransformValue": {
    "inherits": "CSSStyleValue",
    "implements": []
  },
  "CSSTranslate": {
    "inherits": "CSSTransformComponent",
    "implements": []
  },
  "CSSUnitValue": {
    "inherits": "CSSNumericValue",
    "implements": []
  },
  "CSSUnparsedValue": {
    "inherits": "CSSStyleValue",
    "implements": []
  },
  "CSSValueList": {
    "inherits": "CSSValue",
    "implements": []
  },
  "CallEvent": {
    "inherits": "Event",
    "implements": []
  },
  "CallGroupErrorEvent": {
    "inherits": "Event",
    "implements": []
  },
  "CameraClosedEvent": {
    "inherits": "Event",
    "implements": []
  },
  "CameraConfigurationEvent": {
    "inherits": "Event",
    "implements": []
  },
  "CameraControl": {
    "inherits": "MediaStream",
    "implements": []
  },
  "CameraFacesDetectedEvent": {
    "inherits": "Event",
    "implements": []
  },
  "CameraStateChangeEvent": {
    "inherits": "Event",
    "implements": []
  },
  "CanvasCaptureMediaStream": {
    "inherits": "MediaStream",
    "implements": []
  },
  "CaretPosition": {
    "inherits": null,
    "implements": []
  },
  "ChannelMergerNode": {
    "inherits": "AudioNode",
    "implements": []
  },
  "ChannelSplitterNode": {
    "inherits": "AudioNode",
    "implements": []
  },
  "CharacterData": {
    "inherits": "Node",
    "implements": [
      "ChildNode",
      "NonDocumentTypeChildNode"
    ]
  },
  "ChromeWorker": {
    "inherits": "Worker",
    "implements": []
  },
  "Clipboard": {
    "inherits": "EventTarget",
    "implements": []
  },
  "ClipboardEvent": {
    "inherits": "Event",
    "implements": []
  },
  "CloseEvent": {
    "inherits": "Event",
    "implements": []
  },
  "CommandEvent": {
    "inherits": "Event",
    "implements": []
  },
  "Comment": {
    "inherits": "CharacterData",
    "implements": []
  },
  "CompositionEvent": {
    "inherits": "UIEvent",
    "implements": []
  },
  "ConstantSourceNode": {
    "inherits": "AudioScheduledSourceNode",
    "implements": []
  },
  "ContactManager": {
    "inherits": "EventTarget",
    "implements": []
  },
  "ContainerBoxObject": {
    "inherits": "BoxObject",
    "implements": []
  },
  "ConvolverNode": {
    "inherits": "AudioNode",
    "implements": [
      "AudioNodePassThrough"
    ]
  },
  "Crypto": {
    "inherits": null,
    "implements": []
  },
  "CustomEvent": {
    "inherits": "Event",
    "implements": []
  },
  "DOMApplication": {
    "inherits": "EventTarget",
    "implements": []
  },
  "DOMApplicationsManager": {
    "inherits": "EventTarget",
    "implements": []
  },
  "DOMCursor": {
    "inherits": "EventTarget",
    "implements": [
      "DOMRequestShared"
    ]
  },
  "DOMDownload": {
    "inherits": "EventTarget",
    "implements": []
  },
  "DOMDownloadManager": {
    "inherits": "EventTarget",
    "implements": []
  },
  "DOMException": {
    "inherits": null,
    "implements": [
      "ExceptionMembers"
    ]
  },
  "DOMImplementation": {
    "inherits": null,
    "implements": []
  },
  "DOMMatrix": {
    "inherits": "DOMMatrixReadOnly",
    "implements": []
  },
  "DOMMobileMessageError": {
    "inherits": "DOMError",
    "implements": []
  },
  "DOMParser": {
    "inherits": null,
    "implements": []
  },
  "DOMPoint": {
    "inherits": "DOMPointReadOnly",
    "implements": []
  },
  "DOMRect": {
    "inherits": "DOMRectReadOnly",
    "implements": []
  },
  "DOMRequest": {
    "inherits": "EventTarget",
    "implements": [
      "DOMRequestShared"
    ]
  },
  "DOMSettableTokenList": {
    "inherits": "DOMTokenList",
    "implements": []
  },
  "DOMStringMap": {
    "inherits": null,
    "implements": []
  },
  "DOMTokenList": {
    "inherits": null,
    "implements": []
  },
  "DOMTransactionEvent": {
    "inherits": "Event",
    "implements": []
  },
  "DataContainerEvent": {
    "inherits": "Event",
    "implements": []
  },
  "DataErrorEvent": {
    "inherits": "Event",
    "implements": []
  },
  "DataStore": {
    "inherits": "EventTarget",
    "implements": []
  },
  "DataStoreChangeEvent": {
    "inherits": "Event",
    "implements": []
  },
  "DedicatedWorkerGlobalScope": {
    "inherits": "WorkerGlobalScope",
    "implements": []
  },
  "DelayNode": {
    "inherits": "AudioNode",
    "implements": [
      "AudioNodePassThrough"
    ]
  },
  "DesktopNotification": {
    "inherits": "EventTarget",
    "implements": []
  },
  "DeviceLightEvent": {
    "inherits": "Event",
    "implements": []
  },
  "DeviceMotionEvent": {
    "inherits": "Event",
    "implements": []
  },
  "DeviceOrientationEvent": {
    "inherits": "Event",
    "implements": []
  },
  "DeviceProximityEvent": {
    "inherits": "Event",
    "implements": []
  },
  "DeviceStorage": {
    "inherits": "EventTarget",
    "implements": []
  },
  "DeviceStorageChangeEvent": {
    "inherits": "Event",
    "implements": []
  },
  "Document": {
    "inherits": "Node",
    "implements": [
      "FontFaceSource",
      "GeometryUtils",
      "GlobalEventHandlers",
      "OnErrorEventHandlerForNodes",
      "ParentNode",
      "TouchEventHandlers",
      "XPathEvaluator"
    ]
  },
  "DocumentFragment": {
    "inherits": "Node",
    "implements": [
      "ParentNode"
    ]
  },
  "DocumentType": {
    "inherits": "Node",
    "implements": [
      "ChildNode"
    ]
  },
  "DownloadEvent": {
    "inherits": "Event",
    "implements": []
  },
  "DragEvent": {
    "inherits": "MouseEvent",
    "implements": []
  },
  "DynamicsCompressorNode": {
    "inherits": "AudioNode",
    "implements": [
      "AudioNodePassThrough"
    ]
  },
  "Element": {
    "inherits": "Node",
    "implements": [
      "Animatable",
      "ChildNode",
      "GeometryUtils",
      "NonDocumentTypeChildNode",
      "ParentNode"
    ]
  },
  "EngineeringMode": {
    "inherits": "EventTarget",
    "implements": []
  },
  "ErrorEvent": {
    "inherits": "Event",
    "implements": []
  },
  "Event": {
    "inherits": null,
    "implements": []
  },
  "EventSource": {
    "inherits": "EventTarget",
    "implements": []
  },
  "Exception": {
    "inherits": null,
    "implements": [
      "ExceptionMembers"
    ]
  },
  "ExtendableEvent": {
    "inherits": "Event",
    "implements": []
  },
  "FMRadio": {
    "inherits": "EventTarget",
    "implements": []
  },
  "FetchEvent": {
    "inherits": "Event",
    "implements": []
  },
  "File": {
    "inherits": "Blob",
    "implements": []
  },
  "FileList": {
    "inherits": null,
    "implements": []
  },
  "FileReader": {
    "inherits": "EventTarget",
    "implements": []
  },
  "FocusEvent": {
    "inherits": "UIEvent",
    "implements": []
  },
  "FontFaceSet": {
    "inherits": "EventTarget",
    "implements": []
  },
  "FormData": {
    "inherits": null,
    "implements": []
  },
  "GainNode": {
    "inherits": "AudioNode",
    "implements": [
      "AudioNodePassThrough"
    ]
  },
  "GamepadAxisMoveEvent": {
    "inherits": "GamepadEvent",
    "implements": []
  },
  "GamepadButtonEvent": {
    "inherits": "GamepadEvent",
    "implements": []
  },
  "GamepadEvent": {
    "inherits": "Event",
    "implements": []
  },
  "Gyroscope": {
    "inherits": "Sensor",
    "implements": []
  },
  "HMDVRDevice": {
    "inherits": "VRDevice",
    "implements": []
  },
  "HTMLAnchorElement": {
    "inherits": "HTMLElement",
    "implements": [
      "HTMLHyperlinkElementUtils",
      "URLUtilsSearchParams"
    ]
  },
  "HTMLAppletElement": {
    "inherits": "HTMLElement",
    "implements": [
      "MozFrameLoaderOwner",
      "MozImageLoadingContent",
      "MozObjectLoadingContent"
    ]
  },
  "HTMLAreaElement": {
    "inherits": "HTMLElement",
    "implements": [
      "HTMLHyperlinkElementUtils",
      "URLUtilsSearchParams"
    ]
  },
  "HTMLAudioElement": {
    "inherits": "HTMLMediaElement",
    "implements": []
  },
  "HTMLBRElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLBaseElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLBodyElement": {
    "inherits": "HTMLElement",
    "implements": [
      "WindowEventHandlers"
    ]
  },
  "HTMLButtonElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLCanvasElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLCollection": {
    "inherits": null,
    "implements": []
  },
  "HTMLContentElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLDListElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLDataElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLDataListElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLDirectoryElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLDivElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLDocument": {
    "inherits": "Document",
    "implements": []
  },
  "HTMLElement": {
    "inherits": "Element",
    "implements": [
      "GlobalEventHandlers",
      "OnErrorEventHandlerForNodes",
      "TouchEventHandlers"
    ]
  },
  "HTMLEmbedElement": {
    "inherits": "HTMLElement",
    "implements": [
      "MozFrameLoaderOwner",
      "MozImageLoadingContent",
      "MozObjectLoadingContent"
    ]
  },
  "HTMLFieldSetElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLFontElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLFormControlsCollection": {
    "inherits": "HTMLCollection",
    "implements": []
  },
  "HTMLFormElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLFrameElement": {
    "inherits": "HTMLElement",
    "implements": [
      "MozFrameLoaderOwner"
    ]
  },
  "HTMLFrameSetElement": {
    "inherits": "HTMLElement",
    "implements": [
      "WindowEventHandlers"
    ]
  },
  "HTMLHRElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLHeadElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLHeadingElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLHtmlElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLIFrameElement": {
    "inherits": "HTMLElement",
    "implements": [
      "BrowserElement",
      "MozFrameLoaderOwner"
    ]
  },
  "HTMLImageElement": {
    "inherits": "HTMLElement",
    "implements": [
      "MozImageLoadingContent"
    ]
  },
  "HTMLInputElement": {
    "inherits": "HTMLElement",
    "implements": [
      "MozImageLoadingContent",
      "MozPhonetic"
    ]
  },
  "HTMLLIElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLLabelElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLLegendElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLLinkElement": {
    "inherits": "HTMLElement",
    "implements": [
      "LinkStyle"
    ]
  },
  "HTMLMapElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLMarqueeElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLMediaElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLMenuElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLMenuItemElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLMetaElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLMeterElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLModElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLOListElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLObjectElement": {
    "inherits": "HTMLElement",
    "implements": [
      "MozFrameLoaderOwner",
      "MozImageLoadingContent",
      "MozObjectLoadingContent"
    ]
  },
  "HTMLOptGroupElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLOptionElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLOptionsCollection": {
    "inherits": "HTMLCollection",
    "implements": []
  },
  "HTMLOutputElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLParagraphElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLParamElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLPictureElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLPreElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLProgressElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLPropertiesCollection": {
    "inherits": "HTMLCollection",
    "implements": []
  },
  "HTMLQuoteElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLScriptElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLSelectElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLShadowElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLSourceElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLSpanElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLStyleElement": {
    "inherits": "HTMLElement",
    "implements": [
      "LinkStyle"
    ]
  },
  "HTMLTableCaptionElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLTableCellElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLTableColElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLTableElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLTableRowElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLTableSectionElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLTemplateElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLTextAreaElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLTimeElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLTitleElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLTrackElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLUListElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLUnknownElement": {
    "inherits": "HTMLElement",
    "implements": []
  },
  "HTMLVideoElement": {
    "inherits": "HTMLMediaElement",
    "implements": []
  },
  "HashChangeEvent": {
    "inherits": "Event",
    "implements": []
  },
  "History": {
    "inherits": null,
    "implements": []
  },
  "IDBCursorWithValue": {
    "inherits": "IDBCursor",
    "implements": []
  },
  "IDBDatabase": {
    "inherits": "EventTarget",
    "implements": []
  },
  "IDBFileHandle": {
    "inherits": "EventTarget",
    "implements": []
  },
  "IDBFileRequest": {
    "inherits": "DOMRequest",
    "implements": []
  },
  "IDBMutableFile": {
    "inherits": "EventTarget",
    "implements": []
  },
  "IDBOpenDBRequest": {
    "inherits": "IDBRequest",
    "implements": []
  },
  "IDBRequest": {
    "inherits": "EventTarget",
    "implements": []
  },
  "IDBTransaction": {
    "inherits": "EventTarget",
    "implements": []
  },
  "IDBVersionChangeEvent": {
    "inherits": "Event",
    "implements": []
  },
  "IccCardLockError": {
    "inherits": "DOMError",
    "implements": []
  },
  "IccChangeEvent": {
    "inherits": "Event",
    "implements": []
  },
  "ImageCapture": {
    "inherits": "EventTarget",
    "implements": []
  },
  "ImageCaptureErrorEvent": {
    "inherits": "Event",
    "implements": []
  },
  "ImageDocument": {
    "inherits": "HTMLDocument",
    "implements": []
  },
  "InputEvent": {
    "inherits": "UIEvent",
    "implements": []
  },
  "InstallEvent": {
    "inherits": "ExtendableEvent",
    "implements": []
  },
  "InstallTrigger": {
    "inherits": null,
    "implements": []
  },
  "KeyboardEvent": {
    "inherits": "UIEvent",
    "implements": [
      "KeyEvent"
    ]
  },
  "LinearAccelerationSensor": {
    "inherits": "Accelerometer",
    "implements": []
  },
  "ListBoxObject": {
    "inherits": "BoxObject",
    "implements": []
  },
  "LocalMediaStream": {
    "inherits": "MediaStream",
    "implements": []
  },
  "Location": {
    "inherits": null,
    "implements": []
  },
  "Magnetometer": {
    "inherits": "Sensor",
    "implements": []
  },
  "MediaDevices": {
    "inherits": "EventTarget",
    "implements": []
  },
  "MediaElementAudioSourceNode": {
    "inherits": "AudioNode",
    "implements": [
      "AudioNodePassThrough"
    ]
  },
  "MediaEncryptedEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MediaKeyError": {
    "inherits": "Event",
    "implements": []
  },
  "MediaKeyMessageEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MediaKeySession": {
    "inherits": "EventTarget",
    "implements": []
  },
  "MediaRecorder": {
    "inherits": "EventTarget",
    "implements": []
  },
  "MediaSource": {
    "inherits": "EventTarget",
    "implements": []
  },
  "MediaStream": {
    "inherits": "EventTarget",
    "implements": []
  },
  "MediaStreamAudioDestinationNode": {
    "inherits": "AudioNode",
    "implements": []
  },
  "MediaStreamAudioSourceNode": {
    "inherits": "AudioNode",
    "implements": [
      "AudioNodePassThrough"
    ]
  },
  "MediaStreamEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MediaStreamTrackEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MenuBoxObject": {
    "inherits": "BoxObject",
    "implements": []
  },
  "MerchantValidationEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MessageEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MessagePort": {
    "inherits": "EventTarget",
    "implements": [
      "Transferable"
    ]
  },
  "MimeTypeArray": {
    "inherits": null,
    "implements": []
  },
  "MouseEvent": {
    "inherits": "UIEvent",
    "implements": []
  },
  "MouseScrollEvent": {
    "inherits": "MouseEvent",
    "implements": []
  },
  "MozAbortablePromise": {
    "inherits": "_Promise",
    "implements": []
  },
  "MozActivity": {
    "inherits": "DOMRequest",
    "implements": []
  },
  "MozApplicationEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MozCdmaIccInfo": {
    "inherits": "MozIccInfo",
    "implements": []
  },
  "MozCellBroadcast": {
    "inherits": "EventTarget",
    "implements": []
  },
  "MozCellBroadcastEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MozClirModeEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MozContactChangeEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MozEmergencyCbModeEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MozGsmIccInfo": {
    "inherits": "MozIccInfo",
    "implements": []
  },
  "MozIcc": {
    "inherits": "EventTarget",
    "implements": []
  },
  "MozIccManager": {
    "inherits": "EventTarget",
    "implements": []
  },
  "MozInputMethod": {
    "inherits": "EventTarget",
    "implements": []
  },
  "MozInterAppMessageEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MozInterAppMessagePort": {
    "inherits": "EventTarget",
    "implements": []
  },
  "MozMessageDeletedEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MozMmsEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MozMobileConnection": {
    "inherits": "EventTarget",
    "implements": []
  },
  "MozMobileMessageManager": {
    "inherits": "EventTarget",
    "implements": []
  },
  "MozNFC": {
    "inherits": "EventTarget",
    "implements": [
      "MozNFCManager"
    ]
  },
  "MozNFCPeerEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MozNFCTagEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MozOtaStatusEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MozSettingsEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MozSettingsTransactionEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MozSmsEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MozSpeakerManager": {
    "inherits": "EventTarget",
    "implements": []
  },
  "MozStkCommandEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MozVoicemail": {
    "inherits": "EventTarget",
    "implements": []
  },
  "MozVoicemailEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MozWifiConnectionInfoEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MozWifiManager": {
    "inherits": "EventTarget",
    "implements": []
  },
  "MozWifiStationInfoEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MozWifiStatusChangeEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MutationEvent": {
    "inherits": "Event",
    "implements": []
  },
  "MutationObserver": {
    "inherits": null,
    "implements": []
  },
  "MutationRecord": {
    "inherits": null,
    "implements": []
  },
  "NamedNodeMap": {
    "inherits": null,
    "implements": []
  },
  "Navigator": {
    "inherits": null,
    "implements": [
      "NavigatorBattery",
      "NavigatorContentUtils",
      "NavigatorDataStore",
      "NavigatorFeatures",
      "NavigatorGeolocation",
      "NavigatorID",
      "NavigatorLanguage",
      "NavigatorMobileId",
      "NavigatorOnLine",
      "NavigatorStorageUtils"
    ]
  },
  "NetworkInformation": {
    "inherits": "EventTarget",
    "implements": []
  },
  "Node": {
    "inherits": "EventTarget",
    "implements": []
  },
  "NodeIterator": {
    "inherits": null,
    "implements": []
  },
  "NodeList": {
    "inherits": null,
    "implements": []
  },
  "Notification": {
    "inherits": "EventTarget",
    "implements": []
  },
  "NotifyPaintEvent": {
    "inherits": "Event",
    "implements": []
  },
  "OfflineAudioCompletionEvent": {
    "inherits": "Event",
    "implements": []
  },
  "OfflineAudioContext": {
    "inherits": "BaseAudioContext",
    "implements": []
  },
  "OfflineResourceList": {
    "inherits": "EventTarget",
    "implements": []
  },
  "OffscreenCanvas": {
    "inherits": "EventTarget",
    "implements": []
  },
  "OrientationSensor": {
    "inherits": "Sensor",
    "implements": []
  },
  "OscillatorNode": {
    "inherits": "AudioNode",
    "implements": [
      "AudioNodePassThrough"
    ]
  },
  "PageTransitionEvent": {
    "inherits": "Event",
    "implements": []
  },
  "PaintRequest": {
    "inherits": null,
    "implements": []
  },
  "PaintRequestList": {
    "inherits": null,
    "implements": []
  },
  "PannerNode": {
    "inherits": "AudioNode",
    "implements": [
      "AudioNodePassThrough"
    ]
  },
  "PaymentAddress": {
    "inherits": null,
    "implements": []
  },
  "PaymentMethodChangeEvent": {
    "inherits": "PaymentRequestUpdateEvent",
    "implements": []
  },
  "PaymentRequest": {
    "inherits": "EventTarget",
    "implements": []
  },
  "PaymentRequestUpdateEvent": {
    "inherits": "Event",
    "implements": []
  },
  "PaymentResponse": {
    "inherits": "EventTarget",
    "implements": []
  },
  "Performance": {
    "inherits": null,
    "implements": []
  },
  "PerformanceLongTaskTiming": {
    "inherits": "PerformanceEntry",
    "implements": []
  },
  "PerformanceMark": {
    "inherits": "PerformanceEntry",
    "implements": []
  },
  "PerformanceMeasure": {
    "inherits": "PerformanceEntry",
    "implements": []
  },
  "PerformanceNavigationTiming": {
    "inherits": "PerformanceEntry",
    "implements": []
  },
  "PerformancePaintTiming": {
    "inherits": "PerformanceEntry",
    "implements": []
  },
  "PerformanceResourceTiming": {
    "inherits": "PerformanceEntry",
    "implements": []
  },
  "Plugin": {
    "inherits": null,
    "implements": []
  },
  "PluginArray": {
    "inherits": null,
    "implements": []
  },
  "PluginCrashedEvent": {
    "inherits": "Event",
    "implements": []
  },
  "PointerEvent": {
    "inherits": "MouseEvent",
    "implements": []
  },
  "PopStateEvent": {
    "inherits": "Event",
    "implements": []
  },
  "PopupBlockedEvent": {
    "inherits": "Event",
    "implements": []
  },
  "PopupBoxObject": {
    "inherits": "BoxObject",
    "implements": []
  },
  "PositionSensorVRDevice": {
    "inherits": "VRDevice",
    "implements": []
  },
  "PresentationDeviceInfoManager": {
    "inherits": "EventTarget",
    "implements": []
  },
  "ProcessingInstruction": {
    "inherits": "CharacterData",
    "implements": []
  },
  "ProgressEvent": {
    "inherits": "Event",
    "implements": []
  },
  "PromiseRejectionEvent": {
    "inherits": "Event",
    "implements": []
  },
  "PropertyNodeList": {
    "inherits": "NodeList",
    "implements": []
  },
  "PseudoElement": {
    "inherits": null,
    "implements": [
      "GeometryUtils"
    ]
  },
  "RTCDTMFSender": {
    "inherits": "EventTarget",
    "implements": []
  },
  "RTCDTMFToneChangeEvent": {
    "inherits": "Event",
    "implements": []
  },
  "RTCDataChannel": {
    "inherits": "EventTarget",
    "implements": []
  },
  "RTCDataChannelEvent": {
    "inherits": "Event",
    "implements": []
  },
  "RTCDtlsTransport": {
    "inherits": "EventTarget",
    "implements": []
  },
  "RTCIceTransport": {
    "inherits": "EventTarget",
    "implements": []
  },
  "RTCPeerConnection": {
    "inherits": "EventTarget",
    "implements": []
  },
  "RTCPeerConnectionIceEvent": {
    "inherits": "Event",
    "implements": []
  },
  "RTCPeerConnectionIdentityErrorEvent": {
    "inherits": "Event",
    "implements": []
  },
  "RTCPeerConnectionIdentityEvent": {
    "inherits": "Event",
    "implements": []
  },
  "RTCSctpTransport": {
    "inherits": "EventTarget",
    "implements": []
  },
  "RTCTrackEvent": {
    "inherits": "Event",
    "implements": []
  },
  "RadioNodeList": {
    "inherits": "NodeList",
    "implements": []
  },
  "Range": {
    "inherits": "AbstractRange",
    "implements": []
  },
  "RecordErrorEvent": {
    "inherits": "Event",
    "implements": []
  },
  "Rect": {
    "inherits": null,
    "implements": []
  },
  "RelativeOrientationSensor": {
    "inherits": "OrientationSensor",
    "implements": []
  },
  "Request": {
    "inherits": null,
    "implements": [
      "Body"
    ]
  },
  "Response": {
    "inherits": null,
    "implements": [
      "Body"
    ]
  },
  "StaticRange": {
    "inherits": "AbstractRange",
    "implements": []
  },
  "SVGAElement": {
    "inherits": "SVGGraphicsElement",
    "implements": [
      "SVGURIReference"
    ]
  },
  "SVGAltGlyphElement": {
    "inherits": "SVGTextPositioningElement",
    "implements": [
      "SVGURIReference"
    ]
  },
  "SVGAnimateElement": {
    "inherits": "SVGAnimationElement",
    "implements": []
  },
  "SVGAnimateMotionElement": {
    "inherits": "SVGAnimationElement",
    "implements": []
  },
  "SVGAnimateTransformElement": {
    "inherits": "SVGAnimationElement",
    "implements": []
  },
  "SVGAnimatedEnumeration": {
    "inherits": null,
    "implements": []
  },
  "SVGAnimatedInteger": {
    "inherits": null,
    "implements": []
  },
  "SVGAnimatedNumber": {
    "inherits": null,
    "implements": []
  },
  "SVGAnimatedNumberList": {
    "inherits": null,
    "implements": []
  },
  "SVGAnimatedPreserveAspectRatio": {
    "inherits": null,
    "implements": []
  },
  "SVGAnimatedString": {
    "inherits": null,
    "implements": []
  },
  "SVGAnimationElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGTests"
    ]
  },
  "SVGCircleElement": {
    "inherits": "SVGGeometryElement",
    "implements": []
  },
  "SVGClipPathElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGUnitTypes"
    ]
  },
  "SVGComponentTransferFunctionElement": {
    "inherits": "SVGElement",
    "implements": []
  },
  "SVGCursorElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGURIReference"
    ]
  },
  "SVGDefsElement": {
    "inherits": "SVGGraphicsElement",
    "implements": []
  },
  "SVGDescElement": {
    "inherits": "SVGElement",
    "implements": []
  },
  "SVGDocument": {
    "inherits": "Document",
    "implements": []
  },
  "SVGElement": {
    "inherits": "Element",
    "implements": [
      "GlobalEventHandlers",
      "OnErrorEventHandlerForNodes",
      "TouchEventHandlers"
    ]
  },
  "SVGEllipseElement": {
    "inherits": "SVGGeometryElement",
    "implements": []
  },
  "SVGFEBlendElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGFilterPrimitiveStandardAttributes"
    ]
  },
  "SVGFEColorMatrixElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGFilterPrimitiveStandardAttributes"
    ]
  },
  "SVGFEComponentTransferElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGFilterPrimitiveStandardAttributes"
    ]
  },
  "SVGFECompositeElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGFilterPrimitiveStandardAttributes"
    ]
  },
  "SVGFEConvolveMatrixElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGFilterPrimitiveStandardAttributes"
    ]
  },
  "SVGFEDiffuseLightingElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGFilterPrimitiveStandardAttributes"
    ]
  },
  "SVGFEDisplacementMapElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGFilterPrimitiveStandardAttributes"
    ]
  },
  "SVGFEDistantLightElement": {
    "inherits": "SVGElement",
    "implements": []
  },
  "SVGFEDropShadowElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGFilterPrimitiveStandardAttributes"
    ]
  },
  "SVGFEFloodElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGFilterPrimitiveStandardAttributes"
    ]
  },
  "SVGFEFuncAElement": {
    "inherits": "SVGComponentTransferFunctionElement",
    "implements": []
  },
  "SVGFEFuncBElement": {
    "inherits": "SVGComponentTransferFunctionElement",
    "implements": []
  },
  "SVGFEFuncGElement": {
    "inherits": "SVGComponentTransferFunctionElement",
    "implements": []
  },
  "SVGFEFuncRElement": {
    "inherits": "SVGComponentTransferFunctionElement",
    "implements": []
  },
  "SVGFEGaussianBlurElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGFilterPrimitiveStandardAttributes"
    ]
  },
  "SVGFEImageElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGFilterPrimitiveStandardAttributes",
      "SVGURIReference"
    ]
  },
  "SVGFEMergeElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGFilterPrimitiveStandardAttributes"
    ]
  },
  "SVGFEMergeNodeElement": {
    "inherits": "SVGElement",
    "implements": []
  },
  "SVGFEMorphologyElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGFilterPrimitiveStandardAttributes"
    ]
  },
  "SVGFEOffsetElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGFilterPrimitiveStandardAttributes"
    ]
  },
  "SVGFEPointLightElement": {
    "inherits": "SVGElement",
    "implements": []
  },
  "SVGFESpecularLightingElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGFilterPrimitiveStandardAttributes"
    ]
  },
  "SVGFESpotLightElement": {
    "inherits": "SVGElement",
    "implements": []
  },
  "SVGFETileElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGFilterPrimitiveStandardAttributes"
    ]
  },
  "SVGFETurbulenceElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGFilterPrimitiveStandardAttributes"
    ]
  },
  "SVGFilterElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGURIReference",
      "SVGUnitTypes"
    ]
  },
  "SVGForeignObjectElement": {
    "inherits": "SVGGraphicsElement",
    "implements": []
  },
  "SVGGElement": {
    "inherits": "SVGGraphicsElement",
    "implements": []
  },
  "SVGGeometryElement": {
    "inherits": "SVGGraphicsElement",
    "implements": []
  },
  "SVGGradientElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGURIReference",
      "SVGUnitTypes"
    ]
  },
  "SVGGraphicsElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGTests"
    ]
  },
  "SVGImageElement": {
    "inherits": "SVGGraphicsElement",
    "implements": [
      "MozImageLoadingContent",
      "SVGURIReference"
    ]
  },
  "SVGLengthList": {
    "inherits": null,
    "implements": []
  },
  "SVGLineElement": {
    "inherits": "SVGGeometryElement",
    "implements": []
  },
  "SVGLinearGradientElement": {
    "inherits": "SVGGradientElement",
    "implements": []
  },
  "SVGMPathElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGURIReference"
    ]
  },
  "SVGMarkerElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGFitToViewBox"
    ]
  },
  "SVGMaskElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGUnitTypes"
    ]
  },
  "SVGMetadataElement": {
    "inherits": "SVGElement",
    "implements": []
  },
  "SVGNumberList": {
    "inherits": null,
    "implements": []
  },
  "SVGPathElement": {
    "inherits": "SVGGeometryElement",
    "implements": [
      "SVGAnimatedPathData"
    ]
  },
  "SVGPathSegArcAbs": {
    "inherits": "SVGPathSeg",
    "implements": []
  },
  "SVGPathSegArcRel": {
    "inherits": "SVGPathSeg",
    "implements": []
  },
  "SVGPathSegClosePath": {
    "inherits": "SVGPathSeg",
    "implements": []
  },
  "SVGPathSegCurvetoCubicAbs": {
    "inherits": "SVGPathSeg",
    "implements": []
  },
  "SVGPathSegCurvetoCubicRel": {
    "inherits": "SVGPathSeg",
    "implements": []
  },
  "SVGPathSegCurvetoCubicSmoothAbs": {
    "inherits": "SVGPathSeg",
    "implements": []
  },
  "SVGPathSegCurvetoCubicSmoothRel": {
    "inherits": "SVGPathSeg",
    "implements": []
  },
  "SVGPathSegCurvetoQuadraticAbs": {
    "inherits": "SVGPathSeg",
    "implements": []
  },
  "SVGPathSegCurvetoQuadraticRel": {
    "inherits": "SVGPathSeg",
    "implements": []
  },
  "SVGPathSegCurvetoQuadraticSmoothAbs": {
    "inherits": "SVGPathSeg",
    "implements": []
  },
  "SVGPathSegCurvetoQuadraticSmoothRel": {
    "inherits": "SVGPathSeg",
    "implements": []
  },
  "SVGPathSegLinetoAbs": {
    "inherits": "SVGPathSeg",
    "implements": []
  },
  "SVGPathSegLinetoHorizontalAbs": {
    "inherits": "SVGPathSeg",
    "implements": []
  },
  "SVGPathSegLinetoHorizontalRel": {
    "inherits": "SVGPathSeg",
    "implements": []
  },
  "SVGPathSegLinetoRel": {
    "inherits": "SVGPathSeg",
    "implements": []
  },
  "SVGPathSegLinetoVerticalAbs": {
    "inherits": "SVGPathSeg",
    "implements": []
  },
  "SVGPathSegLinetoVerticalRel": {
    "inherits": "SVGPathSeg",
    "implements": []
  },
  "SVGPathSegList": {
    "inherits": null,
    "implements": []
  },
  "SVGPathSegMovetoAbs": {
    "inherits": "SVGPathSeg",
    "implements": []
  },
  "SVGPathSegMovetoRel": {
    "inherits": "SVGPathSeg",
    "implements": []
  },
  "SVGPatternElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGFitToViewBox",
      "SVGURIReference",
      "SVGUnitTypes"
    ]
  },
  "SVGPoint": {
    "inherits": null,
    "implements": []
  },
  "SVGPointList": {
    "inherits": null,
    "implements": []
  },
  "SVGPolygonElement": {
    "inherits": "SVGGeometryElement",
    "implements": [
      "SVGAnimatedPoints"
    ]
  },
  "SVGPolylineElement": {
    "inherits": "SVGGeometryElement",
    "implements": [
      "SVGAnimatedPoints"
    ]
  },
  "SVGPreserveAspectRatio": {
    "inherits": null,
    "implements": []
  },
  "SVGRadialGradientElement": {
    "inherits": "SVGGradientElement",
    "implements": []
  },
  "SVGRect": {
    "inherits": null,
    "implements": []
  },
  "SVGRectElement": {
    "inherits": "SVGGeometryElement",
    "implements": []
  },
  "SVGSVGElement": {
    "inherits": "SVGGraphicsElement",
    "implements": [
      "SVGFitToViewBox",
      "SVGZoomAndPan"
    ]
  },
  "SVGScriptElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGURIReference"
    ]
  },
  "SVGSetElement": {
    "inherits": "SVGAnimationElement",
    "implements": []
  },
  "SVGStopElement": {
    "inherits": "SVGElement",
    "implements": []
  },
  "SVGStringList": {
    "inherits": null,
    "implements": []
  },
  "SVGStyleElement": {
    "inherits": "SVGElement",
    "implements": []
  },
  "SVGSwitchElement": {
    "inherits": "SVGGraphicsElement",
    "implements": []
  },
  "SVGSymbolElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGFitToViewBox",
      "SVGTests"
    ]
  },
  "SVGTSpanElement": {
    "inherits": "SVGTextPositioningElement",
    "implements": []
  },
  "SVGTextContentElement": {
    "inherits": "SVGGraphicsElement",
    "implements": []
  },
  "SVGTextElement": {
    "inherits": "SVGTextPositioningElement",
    "implements": []
  },
  "SVGTextPathElement": {
    "inherits": "SVGTextContentElement",
    "implements": [
      "SVGURIReference"
    ]
  },
  "SVGTextPositioningElement": {
    "inherits": "SVGTextContentElement",
    "implements": []
  },
  "SVGTitleElement": {
    "inherits": "SVGElement",
    "implements": []
  },
  "SVGTransformList": {
    "inherits": null,
    "implements": []
  },
  "SVGUseElement": {
    "inherits": "SVGGraphicsElement",
    "implements": [
      "SVGURIReference"
    ]
  },
  "SVGViewElement": {
    "inherits": "SVGElement",
    "implements": [
      "SVGFitToViewBox",
      "SVGZoomAndPan"
    ]
  },
  "SVGZoomEvent": {
    "inherits": "UIEvent",
    "implements": []
  },
  "Screen": {
    "inherits": "EventTarget",
    "implements": []
  },
  "ScriptProcessorNode": {
    "inherits": "AudioNode",
    "implements": [
      "AudioNodePassThrough"
    ]
  },
  "ScrollAreaEvent": {
    "inherits": "UIEvent",
    "implements": []
  },
  "ScrollBoxObject": {
    "inherits": "BoxObject",
    "implements": []
  },
  "ScrollViewChangeEvent": {
    "inherits": "Event",
    "implements": []
  },
  "Selection": {
    "inherits": null,
    "implements": []
  },
  "SelectionStateChangedEvent": {
    "inherits": "Event",
    "implements": []
  },
  "Sensor": {
    "inherits": "EventTarget",
    "implements": []
  },
  "SensorErrorEvent": {
    "inherits": "Event",
    "implements": []
  },
  "ServiceWorker": {
    "inherits": "EventTarget",
    "implements": [
      "AbstractWorker"
    ]
  },
  "ServiceWorkerContainer": {
    "inherits": "EventTarget",
    "implements": []
  },
  "ServiceWorkerGlobalScope": {
    "inherits": "WorkerGlobalScope",
    "implements": [
      "GlobalFetch"
    ]
  },
  "ServiceWorkerRegistration": {
    "inherits": "EventTarget",
    "implements": []
  },
  "SettingsLock": {
    "inherits": "EventTarget",
    "implements": []
  },
  "SettingsManager": {
    "inherits": "EventTarget",
    "implements": []
  },
  "ShadowRoot": {
    "inherits": "DocumentFragment",
    "implements": []
  },
  "SharedWorker": {
    "inherits": "EventTarget",
    "implements": [
      "AbstractWorker"
    ]
  },
  "SharedWorkerGlobalScope": {
    "inherits": "WorkerGlobalScope",
    "implements": []
  },
  "SimpleGestureEvent": {
    "inherits": "MouseEvent",
    "implements": []
  },
  "SourceBuffer": {
    "inherits": "EventTarget",
    "implements": []
  },
  "SourceBufferList": {
    "inherits": "EventTarget",
    "implements": []
  },
  "SpeechRecognition": {
    "inherits": "EventTarget",
    "implements": []
  },
  "SpeechRecognitionError": {
    "inherits": "Event",
    "implements": []
  },
  "SpeechRecognitionEvent": {
    "inherits": "Event",
    "implements": []
  },
  "SpeechSynthesisEvent": {
    "inherits": "Event",
    "implements": []
  },
  "SpeechSynthesisUtterance": {
    "inherits": "EventTarget",
    "implements": []
  },
  "StereoPannerNode": {
    "inherits": "AudioNode",
    "implements": [
      "AudioNodePassThrough"
    ]
  },
  "StorageEvent": {
    "inherits": "Event",
    "implements": []
  },
  "StylePropertyMap": {
    "inherits": "StylePropertyMapReadOnly",
    "implements": []
  },
  "StylePropertyMapReadOnly": {
    "inherits": null,
    "implements": [
      "StylePropertyMap"
    ]
  },
  "StyleRuleChangeEvent": {
    "inherits": "Event",
    "implements": []
  },
  "StyleSheet": {
    "inherits": null,
    "implements": []
  },
  "StyleSheetApplicableStateChangeEvent": {
    "inherits": "Event",
    "implements": []
  },
  "StyleSheetChangeEvent": {
    "inherits": "Event",
    "implements": []
  },
  "SyncEvent": {
    "inherits": "ExtendableEvent",
    "implements": []
  },
  "TVChannel": {
    "inherits": "EventTarget",
    "implements": []
  },
  "TVCurrentChannelChangedEvent": {
    "inherits": "Event",
    "implements": []
  },
  "TVCurrentSourceChangedEvent": {
    "inherits": "Event",
    "implements": []
  },
  "TVEITBroadcastedEvent": {
    "inherits": "Event",
    "implements": []
  },
  "TVManager": {
    "inherits": "EventTarget",
    "implements": []
  },
  "TVScanningStateChangedEvent": {
    "inherits": "Event",
    "implements": []
  },
  "TVSource": {
    "inherits": "EventTarget",
    "implements": []
  },
  "TVTuner": {
    "inherits": "EventTarget",
    "implements": []
  },
  "TaskAttributionTiming": {
    "inherits": "PerformanceEntry",
    "implements": []
  },
  "Telephony": {
    "inherits": "EventTarget",
    "implements": []
  },
  "TelephonyCall": {
    "inherits": "EventTarget",
    "implements": []
  },
  "TelephonyCallGroup": {
    "inherits": "EventTarget",
    "implements": []
  },
  "Text": {
    "inherits": "CharacterData",
    "implements": [
      "GeometryUtils"
    ]
  },
  "TextTrack": {
    "inherits": "EventTarget",
    "implements": []
  },
  "TextTrackList": {
    "inherits": "EventTarget",
    "implements": []
  },
  "TimeEvent": {
    "inherits": "Event",
    "implements": []
  },
  "Touch": {
    "inherits": null,
    "implements": []
  },
  "TouchEvent": {
    "inherits": "UIEvent",
    "implements": []
  },
  "TouchList": {
    "inherits": null,
    "implements": []
  },
  "TrackEvent": {
    "inherits": "Event",
    "implements": []
  },
  "TransitionEvent": {
    "inherits": "Event",
    "implements": []
  },
  "TreeBoxObject": {
    "inherits": "BoxObject",
    "implements": []
  },
  "TreeColumns": {
    "inherits": null,
    "implements": []
  },
  "TreeWalker": {
    "inherits": null,
    "implements": []
  },
  "UDPMessageEvent": {
    "inherits": "Event",
    "implements": []
  },
  "UDPSocket": {
    "inherits": "EventTarget",
    "implements": []
  },
  "UIEvent": {
    "inherits": "Event",
    "implements": []
  },
  "URL": {
    "inherits": null,
    "implements": [
      "URLUtils",
      "URLUtilsSearchParams"
    ]
  },
  "USSDReceivedEvent": {
    "inherits": "Event",
    "implements": []
  },
  "UndoManager": {
    "inherits": null,
    "implements": []
  },
  "UserProximityEvent": {
    "inherits": "Event",
    "implements": []
  },
  "VRFieldOfView": {
    "inherits": "VRFieldOfViewReadOnly",
    "implements": []
  },
  "VTTCue": {
    "inherits": "EventTarget",
    "implements": []
  },
  "ValidityState": {
    "inherits": null,
    "implements": []
  },
  "VideoStreamTrack": {
    "inherits": "MediaStreamTrack",
    "implements": []
  },
  "VideoTrackList": {
    "inherits": "EventTarget",
    "implements": []
  },
  "WaveShaperNode": {
    "inherits": "AudioNode",
    "implements": [
      "AudioNodePassThrough"
    ]
  },
  "WebGL2RenderingContext": {
    "inherits": "WebGLRenderingContext",
    "implements": []
  },
  "WebGLContextEvent": {
    "inherits": "Event",
    "implements": []
  },
  "WebSocket": {
    "inherits": "EventTarget",
    "implements": []
  },
  "WheelEvent": {
    "inherits": "MouseEvent",
    "implements": []
  },
  "Window": {
    "inherits": null,
    "implements": [
      "ChromeWindow",
      "GlobalCrypto",
      "GlobalEventHandlers",
      "OnErrorEventHandlerForWindow",
      "SpeechSynthesisGetter",
      "TouchEventHandlers",
      "WindowEventHandlers",
      "WindowModal",
      "WindowOrWorkerGlobalScope"
    ]
  },
  "WindowClient": {
    "inherits": "Client",
    "implements": []
  },
  "WindowRoot": {
    "inherits": "EventTarget",
    "implements": []
  },
  "Worker": {
    "inherits": "EventTarget",
    "implements": [
      "AbstractWorker"
    ]
  },
  "WorkerGlobalScope": {
    "inherits": "EventTarget",
    "implements": [
      "GlobalCrypto",
      "WindowOrWorkerGlobalScope"
    ]
  },
  "WorkerLocation": {
    "inherits": null,
    "implements": [
      "URLUtilsReadOnly"
    ]
  },
  "WorkerNavigator": {
    "inherits": null,
    "implements": [
      "NavigatorDataStore",
      "NavigatorID",
      "NavigatorLanguage",
      "NavigatorOnLine"
    ]
  },
  "XMLDocument": {
    "inherits": "Document",
    "implements": []
  },
  "XMLHttpRequest": {
    "inherits": "XMLHttpRequestEventTarget",
    "implements": []
  },
  "XMLHttpRequestEventTarget": {
    "inherits": "EventTarget",
    "implements": []
  },
  "XMLHttpRequestUpload": {
    "inherits": "XMLHttpRequestEventTarget",
    "implements": []
  },
  "XMLSerializer": {
    "inherits": null,
    "implements": []
  },
  "XMLStylesheetProcessingInstruction": {
    "inherits": "ProcessingInstruction",
    "implements": []
  },
  "XPathEvaluator": {
    "inherits": null,
    "implements": []
  },
  "XR": {
    "inherits": "EventTarget",
    "implements": []
  },
  "XRBoundedReferenceSpace": {
    "inherits": "XRReferenceSpace",
    "implements": []
  },
  "XRFrame": {
    "inherits": null,
    "implements": []
  },
  "XRInputSource": {
    "inherits": null,
    "implements": []
  },
  "XRInputSourceArray": {
    "inherits": null,
    "implements": []
  },
  "XRInputSourceEvent": {
    "inherits": "Event",
    "implements": []
  },
  "XRInputSourcesChangeEvent": {
    "inherits": "Event",
    "implements": []
  },
  "XRPose": {
    "inherits": null,
    "implements": []
  },
  "XRReferenceSpace": {
    "inherits": "XRSpace",
    "implements": []
  },
  "XRReferenceSpaceEvent": {
    "inherits": "Event",
    "implements": []
  },
  "XRRenderState": {
    "inherits": null,
    "implements": []
  },
  "XRRigidTransform": {
    "inherits": null,
    "implements": []
  },
  "XRSession": {
    "inherits": "EventTarget",
    "implements": []
  },
  "XRSessionEvent": {
    "inherits": "Event",
    "implements": []
  },
  "XRSpace": {
    "inherits": "EventTarget",
    "implements": []
  },
  "XRView": {
    "inherits": null,
    "implements": []
  },
  "XRViewerPose": {
    "inherits": "XRPose",
    "implements": []
  },
  "XRViewport": {
    "inherits": null,
    "implements": []
  },
  "XRWebGLLayer": {
    "inherits": null,
    "implements": []
  },
  "XULCommandEvent": {
    "inherits": "UIEvent",
    "implements": []
  },
  "XULDocument": {
    "inherits": "Document",
    "implements": []
  },
  "XULElement": {
    "inherits": "Element",
    "implements": [
      "GlobalEventHandlers",
      "MozFrameLoaderOwner",
      "OnErrorEventHandlerForNodes",
      "TouchEventHandlers"
    ]
  }
}
!x{
  "type": "object",
  "additionalProperties": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "inherits": {
        "oneOf": [
          {
            "type": "null"
          },
          {
            "type": "string",
            "minLength": 1
          }
        ]
      },
      "implements": {
        "minItems": 0,
        "uniqueItems": true,
        "items": {
          "type": "string"
        }
      }
    },
    "required": [
      "inherits",
      "implements"
    ]
  }
}
gȫ+xD100644 at-rules.json n+l0O喇盇100644 at-rules.schema.json >r=bq100644 definitions.json J% D.`N100644 functions.json 1ip"U:L$% [100644 functions.schema.json &EɵCO=h+2(w100644 index.js #ef0jj100644 properties.json Wz|/t ?100644 properties.schema.json eҷWuqq`+a100644 selectors.json ^Rx3sf1`YN100644 selectors.schema.json @4^&Y=77\Sl100644 syntaxes.json j)G)JlJfu 100644 syntaxes.schema.json Ec,OBS*e100644 types.json ?ÎtQ.	euِӪ100644 types.schema.json 7 hc"/k$K100644 units.json wԿG9ܵsA100644 units.schema.json yMv0cSn/By[^	xJ:{
  "@charset": {
    "syntax": "@charset \"<charset>\";",
    "groups": [
      "CSS Syntax"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@charset"
  },
  "@counter-style": {
    "syntax": "@counter-style <counter-style-name> {\n  [ system: <counter-system>; ] ||\n  [ symbols: <counter-symbols>; ] ||\n  [ additive-symbols: <additive-symbols>; ] ||\n  [ negative: <negative-symbol>; ] ||\n  [ prefix: <prefix>; ] ||\n  [ suffix: <suffix>; ] ||\n  [ range: <range>; ] ||\n  [ pad: <padding>; ] ||\n  [ speak-as: <speak-as>; ] ||\n  [ fallback: <counter-style-name>; ]\n}",
    "interfaces": [
      "CSSCounterStyleRule"
    ],
    "groups": [
      "CSS Counter Styles"
    ],
    "descriptors": {
      "additive-symbols": {
        "syntax": "[ <integer [0,∞]> && <symbol> ]#",
        "media": "all",
        "initial": "n/a (required)",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "orderOfAppearance",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style/additive-symbols"
      },
      "fallback": {
        "syntax": "<counter-style-name>",
        "media": "all",
        "initial": "decimal",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "uniqueOrder",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style/fallback"
      },
      "negative": {
        "syntax": "<symbol> <symbol>?",
        "media": "all",
        "initial": "\"-\" hyphen-minus",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "orderOfAppearance",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style/negative"
      },
      "pad": {
        "syntax": "<integer [0,∞]> && <symbol>",
        "media": "all",
        "initial": "0 \"\"",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "uniqueOrder",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style/pad"
      },
      "prefix": {
        "syntax": "<symbol>",
        "media": "all",
        "initial": "\"\"",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "uniqueOrder",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style/prefix"
      },
      "range": {
        "syntax": "[ [ <integer> | infinite ]{2} ]# | auto",
        "media": "all",
        "initial": "auto",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "orderOfAppearance",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style/range"
      },
      "speak-as": {
        "syntax": "auto | bullets | numbers | words | spell-out | <counter-style-name>",
        "media": "all",
        "initial": "auto",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "uniqueOrder",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style/speak-as"
      },
      "suffix": {
        "syntax": "<symbol>",
        "media": "all",
        "initial": "\". \"",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "uniqueOrder",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style/suffix"
      },
      "symbols": {
        "syntax": "<symbol>+",
        "media": "all",
        "initial": "n/a (required)",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "orderOfAppearance",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style/symbols"
      },
      "system": {
        "syntax": "cyclic | numeric | alphabetic | symbolic | additive | [ fixed <integer>? ] | [ extends <counter-style-name> ]",
        "media": "all",
        "initial": "symbolic",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "uniqueOrder",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style/system"
      }
    },
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@counter-style"
  },
  "@container": {
    "syntax": "@container <container-condition># {\n  <block-contents>\n}",
    "interfaces": [
      "CSSContainerRule"
    ],
    "groups": [
      "CSS Conditional Rules"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@container"
  },
  "@document": {
    "syntax": "@document [ <url> | url-prefix(<string>) | domain(<string>) | media-document(<string>) | regexp(<string>) ]# {\n  <group-rule-body>\n}",
    "interfaces": [
      "CSSDocumentRule"
    ],
    "groups": [
      "CSS Conditional Rules"
    ],
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@document"
  },
  "@font-face": {
    "syntax": "@font-face {\n  [ font-family: <family-name>; ] ||\n  [ src: <src>; ] ||\n  [ unicode-range: <unicode-range>; ] ||\n  [ font-variant: <font-variant>; ] ||\n  [ font-feature-settings: <font-feature-settings>; ] ||\n  [ font-variation-settings: <font-variation-settings>; ] ||\n  [ font-stretch: <font-stretch>; ] ||\n  [ font-weight: <font-weight>; ] ||\n  [ font-style: <font-style>; ] ||\n  [ size-adjust: <size-adjust>; ] ||\n  [ ascent-override: <ascent-override>; ] ||\n  [ descent-override: <descent-override>; ] ||\n  [ line-gap-override: <line-gap-override>; ]\n}",
    "interfaces": [
      "CSSFontFaceRule"
    ],
    "groups": [
      "CSS Fonts"
    ],
    "descriptors": {
      "ascent-override": {
        "syntax": "normal | <percentage>",
        "media": "all",
        "initial": "normal",
        "percentages": "asSpecified",
        "computed": "asSpecified",
        "order": "orderOfAppearance",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/ascent-override"
      },
      "descent-override": {
        "syntax": "normal | <percentage>",
        "media": "all",
        "initial": "normal",
        "percentages": "asSpecified",
        "computed": "asSpecified",
        "order": "orderOfAppearance",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/descent-override"
      },
      "font-display": {
        "syntax": "auto | block | swap | fallback | optional",
        "media": "visual",
        "percentages": "no",
        "initial": "auto",
        "computed": "asSpecified",
        "order": "uniqueOrder",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/font-display"
      },
      "font-family": {
        "syntax": "<family-name>",
        "media": "all",
        "initial": "n/a (required)",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "uniqueOrder",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/font-family"
      },
      "font-feature-settings": {
        "syntax": "normal | <feature-tag-value>#",
        "media": "all",
        "initial": "normal",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "orderOfAppearance",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/font-feature-settings"
      },
      "font-stretch": {
        "syntax": "<font-stretch-absolute>{1,2}",
        "media": "all",
        "initial": "normal",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "uniqueOrder",
        "status": "obsolete",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/font-stretch"
      },
      "font-style": {
        "syntax": "normal | italic | oblique <angle>{0,2}",
        "media": "all",
        "initial": "normal",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "uniqueOrder",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/font-style"
      },
      "font-variation-settings": {
        "syntax": "normal | [ <string> <number> ]#",
        "media": "all",
        "initial": "normal",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "orderOfAppearance",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/font-variation-settings"
      },
      "font-weight": {
        "syntax": "<font-weight-absolute>{1,2}",
        "media": "all",
        "initial": "normal",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "uniqueOrder",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/font-weight"
      },
      "line-gap-override": {
        "syntax": "normal | <percentage>",
        "media": "all",
        "initial": "normal",
        "percentages": "asSpecified",
        "computed": "asSpecified",
        "order": "orderOfAppearance",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/line-gap-override"
      },
      "size-adjust": {
        "syntax": "<percentage>",
        "media": "all",
        "initial": "100%",
        "percentages": "asSpecified",
        "computed": "asSpecified",
        "order": "orderOfAppearance",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/size-adjust"
      },
      "src": {
        "syntax": "[ <url> [ format( <string># ) ]? | local( <family-name> ) ]#",
        "media": "all",
        "initial": "n/a (required)",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "orderOfAppearance",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/src"
      },
      "unicode-range": {
        "syntax": "<unicode-range-token>#",
        "media": "all",
        "initial": "U+0-10FFFF",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "orderOfAppearance",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face/unicode-range"
      }
    },
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-face"
  },
  "@font-feature-values": {
    "syntax": "@font-feature-values <family-name># {\n  <feature-value-block-list>\n}",
    "interfaces": [
      "CSSFontFeatureValuesRule"
    ],
    "groups": [
      "CSS Fonts"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-feature-values"
  },
  "@font-palette-values": {
    "syntax": "@font-palette-values <dashed-ident> {\n  <declaration-list>\n}",
    "interfaces": [
      "CSSFontPaletteValuesRule"
    ],
    "groups": [
      "CSS Fonts"
    ],
    "descriptors": {
      "base-palette": {
        "syntax": "light | dark | <integer [0,∞]>",
        "media": "all",
        "initial": "n/a (required)",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "uniqueOrder",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-palette-values/base-palette"
      },
      "font-family": {
        "syntax": "<family-name>#",
        "media": "all",
        "initial": "n/a (required)",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "orderOfAppearance",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-palette-values/font-family"
      },
      "override-colors": {
        "syntax": "[ <integer [0,∞]> <color> ]#",
        "media": "all",
        "initial": "n/a (required)",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "orderOfAppearance",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-palette-values/override-colors"
      }
    },
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@font-palette-values"
  },
  "@import": {
    "syntax": "@import [ <string> | <url> ]\n        [ layer | layer(<layer-name>) ]?\n        [ supports( [ <supports-condition> | <declaration> ] ) ]?\n        <media-query-list>? ;",
    "interfaces": [
      "CSSImportRule"
    ],
    "groups": [
      "CSS Cascading and Inheritance"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@import"
  },
  "@keyframes": {
    "syntax": "@keyframes <keyframes-name> {\n  <qualified-rule-list>\n}",
    "interfaces": [
      "CSSKeyframeRule",
      "CSSKeyframesRule"
    ],
    "groups": [
      "CSS Animations"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@keyframes"
  },
  "@layer": {
    "syntax": "@layer [ <layer-name># | <layer-name>?  {\n  <stylesheet>\n} ]",
    "interfaces": [
      "CSSLayerBlockRule",
      "CSSLayerStatementRule"
    ],
    "groups": [
      "CSS Cascading and Inheritance"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@layer"
  },
  "@media": {
    "syntax": "@media <media-query-list> {\n  <group-rule-body>\n}",
    "interfaces": [
      "CSSMediaRule"
    ],
    "groups": [
      "CSS Conditional Rules",
      "Media Queries"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@media"
  },
  "@namespace": {
    "syntax": "@namespace <namespace-prefix>? [ <string> | <url> ];",
    "interfaces": [
      "CSSNamespaceRule"
    ],
    "groups": [
      "CSS Namespaces"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@namespace"
  },
  "@page": {
    "syntax": "@page <page-selector-list> {\n  <page-body>\n}",
    "interfaces": [
      "CSSPageRule"
    ],
    "groups": [
      "CSS Paged Media"
    ],
    "descriptors": {
      "bleed": {
        "syntax": "auto | <length>",
        "media": [
          "visual",
          "paged"
        ],
        "initial": "auto",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "uniqueOrder",
        "status": "standard"
      },
      "marks": {
        "syntax": "none | [ crop || cross ]",
        "media": [
          "visual",
          "paged"
        ],
        "initial": "none",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "orderOfAppearance",
        "status": "standard"
      },
      "page-orientation": {
        "syntax": "upright | rotate-left | rotate-right",
        "media": [
          "visual",
          "paged"
        ],
        "initial": "upright",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "orderOfAppearance",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@page/page-orientation"
      },
      "size": {
        "syntax": "<length [0,∞]>{1,2} | auto | [ <page-size> || [ portrait | landscape ] ]",
        "media": [
          "visual",
          "paged"
        ],
        "initial": "auto",
        "percentages": "no",
        "computed": "asSpecifiedRelativeToAbsoluteLengths",
        "order": "orderOfAppearance",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@page/size"
      }
    },
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@page"
  },
  "@position-try": {
    "syntax": "@position-try <dashed-ident> {\n  <declaration-list>\n}",
    "interfaces": [
      "CSSPositionTryRule"
    ],
    "groups": [
      "CSS Anchor Positioning"
    ],
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@position-try"
  },
  "@property": {
    "syntax": "@property <custom-property-name> {\n  <declaration-list>\n}",
    "interfaces": [
      "CSSPropertyRule"
    ],
    "groups": [
      "CSS Houdini"
    ],
    "descriptors": {
      "inherits": {
        "syntax": "true | false",
        "media": "all",
        "percentages": "no",
        "initial": "auto",
        "computed": "asSpecified",
        "order": "uniqueOrder",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@property/inherits"
      },
      "initial-value": {
        "syntax": "<declaration-value>?",
        "media": "all",
        "initial": "n/a (required)",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "uniqueOrder",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@property/initial-value"
      },
      "syntax": {
        "syntax": "<string>",
        "media": "all",
        "percentages": "no",
        "initial": "n/a (required)",
        "computed": "asSpecified",
        "order": "uniqueOrder",
        "status": "standard",
        "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@property/syntax"
      }
    },
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@property"
  },
  "@scope": {
    "syntax": "@scope [(<scope-start>)]? [to (<scope-end>)]? {\n  <rule-list>\n}",
    "interfaces": [
      "CSSScopeRule"
    ],
    "groups": [
      "CSS Conditional Rules"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@scope"
  },
  "@starting-style": {
    "syntax": "@starting-style {\n  <declaration-list> | <group-rule-body>\n}",
    "interfaces": [
      "CSSStartingStyleRule"
    ],
    "groups": [
      "CSS Transitions"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@starting-style"
  },
  "@supports": {
    "syntax": "@supports <supports-condition> {\n  <group-rule-body>\n}",
    "interfaces": [
      "CSSSupportsRule"
    ],
    "groups": [
      "CSS Conditional Rules"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@supports"
  },
  "@view-transition": {
    "syntax": "@view-transition {\n  <declaration-list>\n}",
    "interfaces": [
      "CSSViewTransitionRule"
    ],
    "groups": [
      "CSS View Transitions"
    ],
    "descriptors": {
      "navigation": {
        "syntax": "auto | none",
        "media": "all",
        "initial": "none",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "uniqueOrder",
        "status": "standard"
      },
      "types": {
        "syntax": "none | <custom-ident>+",
        "media": "all",
        "initial": "none",
        "percentages": "no",
        "computed": "asSpecified",
        "order": "uniqueOrder",
        "status": "standard"
      }
    },
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@view-transition"
  }
}
bx={
  "definitions": {
    "propertyList": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "type": "string",
        "property-reference": {
          "comment": "property-reference is an extension to the JSON schema validator. Here it jumps to the root level of the hierarchy and tests if a value is an existing key there (i.e a defined property). See test/validate-schema.js for implementation details.",
          "$data": "/"
        }
      }
    },
    "animationType": {
      "enum": [
        "angleBasicShapeOrPath",
        "angleOrBasicShapeOrPath",
        "asIfPossibleOtherwiseDiscrete",
        "basicShapeOtherwiseNo",
        "byComputedValue",
        "byComputedValueType",
        "byComputedValueTypeNormalAnimatesAsObliqueZeroDeg",
        "byDynamicRangeLimitMix",
        "color",
        "discrete",
        "discreteButVisibleForDurationWhenAnimatedHidden",
        "discreteButVisibleForDurationWhenAnimatedNone",
        "eachOfShorthandPropertiesExceptUnicodeBiDiAndDirection",
        "filterList",
        "integer",
        "length",
        "lpc",
        "notAnimatable",
        "numberOrLength",
        "number",
        "position",
        "rectangle",
        "repeatableList",
        "shadowList",
        "simpleListOfLpc",
        "simpleListOfLpcDifferenceLpc",
        "superellipseInterpolation",
        "transform",
        "visibility"
      ]
    },
    "percentages": {
      "enum": [
        "blockSizeOfContainingBlock",
        "convertedToNumber",
        "dependsOnLayoutModel",
        "inlineSizeOfContainingBlock",
        "lengthsAsPercentages",
        "logicalHeightOfContainingBlock",
        "logicalWidthOfContainingBlock",
        "logicalHeightOrWidthOfContainingBlock",
        "mapToRange0To1",
        "maxZoomFactor",
        "minZoomFactor",
        "no",
        "referToBorderBox",
        "referToContainingBlockHeight",
        "referToDimensionOfBorderBox",
        "referToDimensionOfContentArea",
        "referToElementFontSize",
        "referToFlexContainersInnerMainSize",
        "referToHeightOfBackgroundPositioningAreaMinusBackgroundImageHeight",
        "referToLineBoxWidth",
        "referToLineHeight",
        "referToParentElementsFontSize",
        "referToSizeOfBackgroundPositioningAreaMinusBackgroundImageSize",
        "referToSizeOfBorderImage",
        "referToSizeOfBoundingBox",
        "referToSizeOfContainingBlock",
        "referToSizeOfElement",
        "referToSizeOfFont",
        "referToSizeOfMaskBorderImage",
        "referToSizeOfMaskPaintingArea",
        "referToSVGViewportHeight",
        "referToSVGViewportSize",
        "referToSVGViewportWidth",
        "referToSVGViewportDiagonal",
        "referToTheUsedValueOfLineHeight",
        "referToTotalPathLength",
        "referToWidthAndHeightOfElement",
        "referToWidthOfAffectedGlyph",
        "referToWidthOfBackgroundPositioningAreaMinusBackgroundImageWidth",
        "referToWidthOfContainingBlock",
        "referToWidthOrHeightOfBorderImageArea",
        "referToReferenceBoxWhenSpecifiedOtherwiseBorderBox",
        "regardingHeightOfGeneratedBoxContainingBlockPercentages0",
        "regardingHeightOfGeneratedBoxContainingBlockPercentagesNone",
        "regardingHeightOfGeneratedBoxContainingBlockPercentagesRelativeToContainingBlock",
        "relativeToBackgroundPositioningArea",
        "relativeToCorrespondingDimensionOfRelevantScrollport",
        "relativeToMaskBorderImageArea",
        "relativeToScrollContainerPaddingBoxAxis",
        "relativeToTheScrollContainersScrollport",
        "relativeToTimelineRangeIfSpecifiedOtherwiseEntireTimeline",
        "relativeToWidthAndHeight"
      ]
    },
    "computed": {
      "enum": [
        "absoluteLength",
        "absoluteLengthOrAsSpecified",
        "absoluteLengthOrKeyword",
        "absoluteLengthOrNone",
        "absoluteLengthOrNormal",
        "absoluteLengthOrPercentage",
        "absoluteLengthOrPercentageNumbersConverted",
        "absoluteLengthSnappedAsLineWidth",
        "absoluteLengthsSpecifiedColorAsSpecified",
        "absoluteLengthZeroOrLarger",
        "absoluteURIOrNone",
        "angleRoundedToNextQuarter",
        "asAutoOrColor",
        "asColorOrAbsoluteURL",
        "asDefinedForBasicShapeWithAbsoluteURIOtherwiseAsSpecified",
        "asLength",
        "asLonghands",
        "asSpecified",
        "asSpecifiedAppliesToEachProperty",
        "asSpecifiedButVisibleOrClipReplacedToAutoOrHiddenIfOtherValueDifferent",
        "asSpecifiedButWithPercentageConvertedToTheEquivalentNumber",
        "asSpecifiedExceptMatchParent",
        "asSpecifiedExceptPositionedFloatingAndRootElementsKeywordMaybeDifferent",
        "asSpecifiedRelativeToAbsoluteLengths",
        "asSpecifiedURLsAbsolute",
        "asSpecifiedWithExceptionOfResolution",
        "asSpecifiedWithLengthsAbsoluteAndNormalComputingToZeroExceptMultiColumn",
        "asSpecifiedWithLengthValuesComputed",
        "asSpecifiedWithVarsSubstituted",
        "autoOnAbsolutelyPositionedElementsValueOfAlignItemsOnParent",
        "autoOrRectangle",
        "autoOrAbsoluteLength",
        "colorPlusThreeAbsoluteLengths",
        "computedColor",
        "computedValueForDynamicRangeLimit",
        "consistsOfTwoDimensionKeywords",
        "consistsOfTwoKeywordsForOriginAndOffsets",
        "correspondingSuperellipse",
        "forLengthAbsoluteValueOtherwisePercentage",
        "autoForTranslucentColorRGBAOtherwiseRGB",
        "keywordOrNumericalValueBolderLighterTransformedToRealValue",
        "keywordPlusIntegerIfDigits",
        "lengthAbsolutePercentageAsSpecifiedOtherwiseAuto",
        "listEachItemConsistingOfAbsoluteLengthPercentageAndOrigin",
        "listEachItemConsistingOfAbsoluteLengthPercentageOrKeyword",
        "listEachItemConsistingOfNormalLengthPercentageOrNameLengthPercentage",
        "listEachItemConsistingOfPairsOfAutoOrLengthPercentage",
        "listEachItemHasTwoKeywordsOnePerDimension",
        "listEachItemIdentifierOrNoneAuto",
        "listEachItemTwoKeywordsOriginOffsets",
        "listOfNoneAutoIdentScrollOrView",
        "noneOrImageWithAbsoluteURI",
        "noneOrOrderedListOfIdentifiers",
        "normalizedAngle",
        "normalOnElementsForPseudosNoneAbsoluteURIStringOrAsSpecified",
        "normalOrComputedTime",
        "oneToFourPercentagesOrAbsoluteLengthsPlusFill",
        "optimumValueOfAbsoluteLengthOrNormal",
        "percentage",
        "percentageAsSpecifiedAbsoluteLengthOrNone",
        "percentageAsSpecifiedOrAbsoluteLength",
        "percentageAutoOrAbsoluteLength",
        "percentageOrAbsoluteLengthPlusKeywords",
        "sameAsBoxOffsets",
        "sameAsMaxWidthAndMaxHeight",
        "sameAsMinWidthAndMinHeight",
        "sameAsWidthAndHeight",
        "specifiedInteger",
        "specifiedIntegerOrAbsoluteLength",
        "specifiedKeywordOrComputedFunction",
        "specifiedValue",
        "specifiedValueClipped0To1",
        "specifiedValueNumberClipped0To1",
        "theComputedLengthAndVisualBox",
        "theKeywordListStyleImageNoneOrComputedValue",
        "theSpecifiedKeyword",
        "theSpecifiedKeywordOrAComputedLengthPercentageValue",
        "translucentValuesRGBAOtherwiseRGB",
        "twoAbsoluteLengthOrPercentages",
        "twoAbsoluteLengths"
      ]
    },
    "appliesto": {
      "enum": [
        "absolutelyPositionedElements",
        "allElements",
        "allElementsAcceptingWidthOrHeight",
        "allElementsAndPseudos",
        "allElementsAndText",
        "allElementsButNonReplacedAndTableColumns",
        "allElementsButNonReplacedAndTableRows",
        "allElementsCreatingNativeWindows",
        "allElementsExceptGeneratedContentOrPseudoElements",
        "allElementsExceptInlineBoxesAndInternalRubyOrTableBoxes",
        "allElementsExceptInternalTableDisplayTypes",
        "allElementsExceptNonReplacedInlineElementsTableRowsColumnsRowColumnGroups",
        "allElementsExceptTableDisplayTypes",
        "allElementsExceptTableElementsWhenCollapse",
        "allElementsExceptTableRowColumnGroupsTableRowsColumns",
        "allElementsExceptTableRowGroupsRowsColumnGroupsAndColumns",
        "allElementsNoEffectIfDisplayNone",
        "allElementsSomeValuesNoEffectOnNonInlineElements",
        "allElementsSVGContainerElements",
        "allElementsSVGContainerGraphicsAndGraphicsReferencingElements",
        "allElementsThatCanReferenceImages",
        "allElementsThatGenerateAPrincipalBox",
        "allElementsTreeAbidingPseudoElementsPageMarginBoxes",
        "allElementsUAsNotRequiredWhenCollapse",
        "anyElementEffectOnProgressAndMeter",
        "asLonghands",
        "beforeAndAfterPseudos",
        "blockContainerElements",
        "blockContainers",
        "blockContainersAndInlineBoxes",
        "blockContainersAndMultiColumnContainers",
        "blockContainersExceptMultiColumnContainers",
        "blockContainersExceptTableWrappers",
        "blockContainersFlexContainersGridContainers",
        "blockContainersFlexContainersGridContainersInlineBoxesTableRowsSVGTextContentElements",
        "blockContainersMultiColumnContainersFlexContainersGridContainers",
        "blockElementsInNormalFlow",
        "blockLevelElements",
        "blockLevelBoxesAndAbsolutelyPositionedBoxesAndGridItems",
        "boxElements",
        "childrenOfBoxElements",
        "directChildrenOfElementsWithDisplayMozBoxMozInlineBox",
        "elementsForWhichLayoutContainmentCanApply",
        "elementsForWhichSizeContainmentCanApply",
        "elementsThatAcceptInput",
        "elementsWithDefaultPreferredSize",
        "elementsWithDisplayBoxOrInlineBox",
        "elementsWithDisplayMarker",
        "elementsWithDisplayMozBoxMozInlineBox",
        "elementsWithOverflowNotVisibleAndReplacedElements",
        "exclusionElements",
        "firstLetterPseudoElementsAndInlineLevelFirstChildren",
        "flexContainers",
        "flexItemsAndAbsolutelyPositionedFlexContainerChildren",
        "flexItemsAndInFlowPseudos",
        "flexItemsGridItemsAbsolutelyPositionedContainerChildren",
        "flexItemsGridItemsAndAbsolutelyPositionedBoxes",
        "floats",
        "gridContainers",
        "gridContainersWithMasonryLayout",
        "gridContainersWithMasonryLayoutInTheirBlockAxis",
        "gridContainersWithMasonryLayoutInTheirInlineAxis",
        "gridItemsAndBoxesWithinGridContainer",
        "iframeElements",
        "images",
        "inFlowBlockLevelElements",
        "inlineBoxesAndBlockContainers",
        "inFlowChildrenOfBoxElements",
        "inlineLevelAndTableCellElements",
        "inlineLevelBoxes",
        "inlineLevelBoxesAndSVGTextContentElements",
        "inlineLevelBoxesFlexItemsGridItemsTableCellsAndSVGTextContentElements",
        "limitedSVGElements",
        "limitedSVGElementsCircle",
        "limitedSVGElementsEllipse",
        "limitedSVGElementsEllipseRect",
        "limitedSVGElementsFilterPrimitives",
        "limitedSVGElementsFloodAndDropShadow",
        "limitedSVGElementsGeometry",
        "limitedSVGElementsGraphics",
        "limitedSVGElementsGraphicsAndUse",
        "limitedSVGElementsLightSource",
        "limitedSVGElementsPath",
        "limitedSVGElementsShapes",
        "limitedSVGElementsShapesAndTextContent",
        "limitedSVGElementsShapeText",
        "limitedSVGElementsStop",
        "limitedSVGElementsTextContent",
        "listItems",
        "maskElements",
        "multicolElements",
        "multiColumnElementsFlexContainersGridContainers",
        "multilineFlexContainers",
        "nonReplacedBlockAndInlineBlockElements",
        "nonReplacedBlockElements",
        "nonReplacedElements",
        "nonReplacedInlineElements",
        "positionedElements",
        "positionedElementsWithADefaultAnchorElement",
        "replacedElements",
        "rubyAnnotationContainers",
        "rubyBasesAnnotationsBaseAnnotationContainers",
        "sameAsMargin",
        "sameAsWidthAndHeight",
        "scrollContainers",
        "scrollingBoxes",
        "tableCaptionElements",
        "tableCellElements",
        "tableElements",
        "textAndBlockContainers",
        "textAndSVGShapes",
        "textElements",
        "textOrElementsThatAcceptInput",
        "textFields",
        "transformableElements"
      ]
    },
    "alsoApplyTo": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "enum": [
          "::first-letter",
          "::first-line",
          "::placeholder"
        ]
      }
    },
    "order": {
      "enum": [
        "canonicalOrder",
        "lengthOrPercentageBeforeKeywordIfBothPresent",
        "lengthOrPercentageBeforeKeywords",
        "oneOrTwoValuesLengthAbsoluteKeywordsPercentages",
        "orderOfAppearance",
        "percentagesOrLengthsFollowedByFill",
        "perGrammar",
        "uniqueOrder"
      ]
    },
    "status": {
      "enum": [
        "standard",
        "nonstandard",
        "experimental",
        "obsolete"
      ]
    },
    "mdn_url": {
      "type": "string",
      "pattern": "^https://developer.mozilla.org/docs/"
    }
  },
  "type": "object",
  "additionalProperties": {
    "type": "object",
    "additionalProperties": false,
    "required": [
      "syntax",
      "inherited",
      "animationType",
      "percentages",
      "groups",
      "initial",
      "appliesto",
      "computed",
      "order",
      "status"
    ],
    "properties": {
      "syntax": {
        "type": "string"
      },
      "media": {
        "oneOf": [
          {
            "type": "string",
            "enum": [
              "all",
              "aural",
              "continuous",
              "interactive",
              "none",
              "noPracticalMedia",
              "paged",
              "visual",
              "visualInContinuousMediaNoEffectInOverflowColumns"
            ]
          },
          {
            "type": "array",
            "minItems": 2,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "enum": [
                "interactive",
                "paged",
                "visual"
              ]
            }
          }
        ]
      },
      "inherited": {
        "type": "boolean"
      },
      "animationType": {
        "oneOf": [
          {
            "$ref": "#/definitions/animationType"
          },
          {
            "$ref": "#/definitions/propertyList"
          }
        ]
      },
      "percentages": {
        "oneOf": [
          {
            "$ref": "#/definitions/percentages"
          },
          {
            "$ref": "#/definitions/propertyList"
          }
        ]
      },
      "groups": {
        "type": "array",
        "minitems": 1,
        "uniqueItems": true,
        "items": {
          "$ref": "definitions.json#/groupList"
        }
      },
      "initial": {
        "oneOf": [
          {
            "type": "string"
          },
          {
            "$ref": "#/definitions/propertyList"
          }
        ]
      },
      "appliesto": {
        "$ref": "#/definitions/appliesto"
      },
      "alsoAppliesTo": {
        "$ref": "#/definitions/alsoApplyTo"
      },
      "computed": {
        "oneOf": [
          {
            "$ref": "#/definitions/computed"
          },
          {
            "$ref": "#/definitions/propertyList"
          }
        ]
      },
      "order": {
        "$ref": "#/definitions/order"
      },
      "stacking": {
        "type": "boolean"
      },
      "status": {
        "$ref": "#/definitions/status"
      },
      "mdn_url": {
        "$ref": "#/definitions/mdn_url"
      }
    }
  },
  "patternProperties": {
    "^--": {
      "$ref": "#/additionalProperties"
    }
  }
}
}';xx@{*stringOrPropertyList": {
      "oneOf": [
:D3
        },
:60:!#:*7 "_3 levels up in67in descriptorsF    "$data": "3"
  87	}
      ]3z4J
interfaces4:#:E3_:9descriptors4object",
    3${
          "type": "object",
      3'  4      "syntax7#
  !<  "media": {
      '5`7:&7&H755"77    ]
      !<:&7:6':#  :"7*F7 5"}7!7      ]
        887,<  "initial": {
  8#	stringOrP:)<88	stringOrP:)<;8	stringOrP:)<  "order": {=7*+2}7	uniqueOrder7,<=F7!22        "experiment537,</3$7)]3/Web/CSS/"
  8:A"required": [
            "syntax",
            "initial",
      N4G      "computed",
            "order",
            "status"
          ]_:=022  "experimental",
  37J=4<7
\30Web/CSS/"
      }
    }4+j4status"
    ]
  }
}
x({
  "groupList": {
    "enum": [
      "Compositing and Blending",
      "CSS Anchor Positioning",
      "CSS Animations",
      "CSS Backgrounds and Borders",
      "CSS Basic User Interface",
      "CSS Box Alignment",
      "CSS Box Model",
      "CSS Box Sizing",
      "CSS Cascading and Inheritance",
      "CSS Color",
      "CSS Conditional Rules",
      "CSS Containment",
      "CSS Counter Styles",
      "CSS Custom Highlight API",
      "CSS Custom Properties for Cascading Variables",
      "CSS Display",
      "CSS Easing Functions",
      "CSS Environment Variables",
      "CSS Flexible Box Layout",
      "CSS Fonts",
      "CSS Form Control Styling",
      "CSS Fragmentation",
      "CSS Generated Content",
      "CSS Grid Layout",
      "CSS Houdini",
      "CSS Images",
      "CSS Inline",
      "CSS Lists and Counters",
      "CSS Logical Properties and Values",
      "CSS Masking",
      "CSS Mobile Text Size Adjustment",
      "CSS Motion Path",
      "CSS Multi-column Layout",
      "CSS Namespaces",
      "CSS Nesting",
      "CSS Overflow",
      "CSS Overscroll Behavior",
      "CSS Paged Media",
      "CSS Positioned Layout",
      "CSS Pseudo-Elements",
      "CSS Resolutions",
      "CSS Rhythmic Sizing",
      "CSS Ruby",
      "CSS Scoping",
      "CSS Scroll Anchoring",
      "CSS Scroll Snap",
      "CSS Scrollbars Styling",
      "CSS Shadow Parts",
      "CSS Shapes",
      "CSS Speech",
      "CSS Syntax",
      "CSS Table",
      "CSS Text",
      "CSS Text Decoration",
      "CSS Transforms",
      "CSS Transitions",
      "CSS Types",
      "CSS Values and Units",
      "CSS View Transitions",
      "CSS Viewport",
      "CSS Will Change",
      "CSS Writing Modes",
      "Filter Effects",
      "Fullscreen API",
      "MathML",
      "Media Queries",
      "Microsoft Extensions",
      "Motion Path",
      "Mozilla Extensions",
      "Pointer Events",
      "Selectors",
      "Scalable Vector Graphics",
      "Scroll-driven Animations",
      "WebKit Extensions",
      "WebVTT",
      "WebXR DOM Overlays"
    ]
  }
}
U8Hxbb{
  "abs()": {
    "syntax": "abs( <calc-sum> )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/abs"
  },
  "acos()": {
    "syntax": "acos( <calc-sum> )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/acos"
  },
  "anchor()": {
    "syntax": "anchor( <anchor-name>? && <anchor-side>, <length-percentage>? )",
    "groups": [
      "CSS Anchor Positioning"
    ],
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/anchor"
  },
  "anchor-size()": {
    "syntax": "anchor-size( [ <anchor-name> || <anchor-size> ]? , <length-percentage>? )",
    "groups": [
      "CSS Anchor Positioning"
    ],
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/anchor-size"
  },
  "asin()": {
    "syntax": "asin( <calc-sum> )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/asin"
  },
  "atan()": {
    "syntax": "atan( <calc-sum> )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/atan"
  },
  "atan2()": {
    "syntax": "atan2( <calc-sum>, <calc-sum> )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/atan2"
  },
  "attr()": {
    "syntax": "attr( <attr-name> <attr-type>? , <declaration-value>? )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/attr"
  },
  "blur()": {
    "syntax": "blur( <length>? )",
    "groups": [
      "Filter Effects"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter-function/blur"
  },
  "brightness()": {
    "syntax": "brightness( [ <number> | <percentage> ]? )",
    "groups": [
      "Filter Effects"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter-function/brightness"
  },
  "calc()": {
    "syntax": "calc( <calc-sum> )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/calc"
  },
  "calc-size()": {
    "syntax": "calc-size( <calc-size-basis>, <calc-sum> )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/calc-size"
  },
  "circle()": {
    "syntax": "circle( <radial-size>? [ at <position> ]? )",
    "groups": [
      "CSS Shapes"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/basic-shape/circle"
  },
  "clamp()": {
    "syntax": "clamp( <calc-sum>#{3} )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/clamp"
  },
  "color()": {
    "syntax": "color( [ from <color> ]? <colorspace-params> [ / [ <alpha-value> | none ] ]? )",
    "groups": [
      "CSS Color"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/color"
  },
  "color-mix()": {
    "syntax": "color-mix( <color-interpolation-method> , [ <color> && <percentage [0,100]>? ]#{2})",
    "groups": [
      "CSS Color"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/color-mix"
  },
  "conic-gradient()": {
    "syntax": "conic-gradient( [ <conic-gradient-syntax> ] )",
    "groups": [
      "CSS Images"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/gradient/conic-gradient"
  },
  "contrast()": {
    "syntax": "contrast( [ <number> | <percentage> ]? )",
    "groups": [
      "Filter Effects"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter-function/contrast"
  },
  "cos()": {
    "syntax": "cos( <calc-sum> )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/cos"
  },
  "counter()": {
    "syntax": "counter( <counter-name>, <counter-style>? )",
    "groups": [
      "CSS Lists and Counters"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/counter"
  },
  "counters()": {
    "syntax": "counters( <counter-name>, <string>, <counter-style>? )",
    "groups": [
      "CSS Lists and Counters"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/counters"
  },
  "cross-fade()": {
    "syntax": "cross-fade( <cf-mixing-image> , <cf-final-image>? )",
    "groups": [
      "CSS Images"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/cross-fade"
  },
  "cubic-bezier()": {
    "syntax": "cubic-bezier( [ <number [0,1]>, <number> ]#{2} )",
    "groups": [
      "CSS Easing Functions"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/easing-function/cubic-bezier"
  },
  "drop-shadow()": {
    "syntax": "drop-shadow( [ <color>? && <length>{2,3} ] )",
    "groups": [
      "Filter Effects"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter-function/drop-shadow"
  },
  "element()": {
    "syntax": "element( <id-selector> )",
    "groups": [
      "CSS Images"
    ],
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/element"
  },
  "ellipse()": {
    "syntax": "ellipse( <radial-size>? [ at <position> ]? )",
    "groups": [
      "CSS Shapes"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/basic-shape/ellipse"
  },
  "env()": {
    "syntax": "env( <custom-ident> , <declaration-value>? )",
    "groups": [
      "CSS Environment Variables"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/env"
  },
  "exp()": {
    "syntax": "exp( <calc-sum> )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/exp"
  },
  "fit-content()": {
    "syntax": "fit-content( <length-percentage [0,∞]> )",
    "groups": [
      "CSS Box Sizing",
      "CSS Grid Layout"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/fit-content_function"
  },
  "grayscale()": {
    "syntax": "grayscale( [ <number> | <percentage> ]? )",
    "groups": [
      "Filter Effects"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter-function/grayscale"
  },
  "hsl()": {
    "syntax": "hsl( <hue>, <percentage>, <percentage>, <alpha-value>? ) | hsl( [ <hue> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )",
    "groups": [
      "CSS Color"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/hsl"
  },
  "hsla()": {
    "syntax": "hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ) | hsla( [ <hue> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )",
    "groups": [
      "CSS Color"
    ],
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/hsl"
  },
  "hue-rotate()": {
    "syntax": "hue-rotate( [ <angle> | <zero> ]? )",
    "groups": [
      "Filter Effects"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter-function/hue-rotate"
  },
  "hwb()": {
    "syntax": "hwb( [ <hue> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )",
    "groups": [
      "CSS Color"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/hwb"
  },
  "hypot()": {
    "syntax": "hypot( <calc-sum># )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/hypot"
  },
  "image()": {
    "syntax": "image( <image-tags>? [ <image-src>? , <color>? ]! )",
    "groups": [
      "CSS Images"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/image/image"
  },
  "image-set()": {
    "syntax": "image-set( <image-set-option># )",
    "groups": [
      "CSS Images"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/image/image-set"
  },
  "inset()": {
    "syntax": "inset( <length-percentage>{1,4} [ round <'border-radius'> ]? )",
    "groups": [
      "CSS Shapes"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/basic-shape/inset"
  },
  "invert()": {
    "syntax": "invert( [ <number> | <percentage> ]? )",
    "groups": [
      "Filter Effects"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter-function/invert"
  },
  "lab()": {
    "syntax": "lab( [<percentage> | <number> | none] [ <percentage> | <number> | none] [ <percentage> | <number> | none] [ / [<alpha-value> | none] ]? )",
    "groups": [
      "CSS Color"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/lab"
  },
  "layer()": {
    "syntax": "layer( <layer-name> )",
    "groups": [
      "CSS Cascading and Inheritance"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/@import/layer_function"
  },
  "lch()": {
    "syntax": "lch( [<percentage> | <number> | none] [ <percentage> | <number> | none] [ <hue> | none] [ / [<alpha-value> | none] ]? )",
    "groups": [
      "CSS Color"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/lch"
  },
  "leader()": {
    "syntax": "leader( <leader-type> )",
    "groups": [
      "CSS Generated Content"
    ],
    "status": "experimental"
  },
  "light-dark()": {
    "syntax": "light-dark( <color>, <color> )",
    "groups": [
      "CSS Color"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/light-dark"
  },
  "linear()": {
    "syntax": "linear( [ <number> && <percentage>{0,2} ]# )",
    "groups": [
      "CSS Easing Functions"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/easing-function/linear"
  },
  "linear-gradient()": {
    "syntax": "linear-gradient( [ <linear-gradient-syntax> ] )",
    "groups": [
      "CSS Images"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/gradient/linear-gradient"
  },
  "log()": {
    "syntax": "log( <calc-sum>, <calc-sum>? )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/log"
  },
  "matrix()": {
    "syntax": "matrix( <number>#{6} )",
    "groups": [
      "CSS Transforms"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/matrix"
  },
  "matrix3d()": {
    "syntax": "matrix3d( <number>#{16} )",
    "groups": [
      "CSS Transforms"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/matrix3d"
  },
  "max()": {
    "syntax": "max( <calc-sum># )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/max"
  },
  "min()": {
    "syntax": "min( <calc-sum># )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/min"
  },
  "minmax()": {
    "syntax": "minmax( [ <length-percentage> | min-content | max-content | auto ] , [ <length-percentage> | <flex> | min-content | max-content | auto ] )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/minmax"
  },
  "mod()": {
    "syntax": "mod( <calc-sum>, <calc-sum> )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mod"
  },
  "oklab()": {
    "syntax": "oklab( [ <percentage> | <number> | none] [ <percentage> | <number> | none] [ <percentage> | <number> | none] [ / [<alpha-value> | none] ]? )",
    "groups": [
      "CSS Color"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/oklab"
  },
  "oklch()": {
    "syntax": "oklch( [ <percentage> | <number> | none] [ <percentage> | <number> | none] [ <hue> | none] [ / [<alpha-value> | none] ]? )",
    "groups": [
      "CSS Color"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/oklch"
  },
  "opacity()": {
    "syntax": "opacity( [ <number> | <percentage> ]? )",
    "groups": [
      "Filter Effects"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter-function/opacity"
  },
  "paint()": {
    "syntax": "paint( <ident>, <declaration-value>? )",
    "groups": [
      "CSS Houdini"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/image/paint"
  },
  "palette-mix()": {
    "syntax": "palette-mix(<color-interpolation-method> , [ [normal | light | dark | <palette-identifier> | <palette-mix()> ] && <percentage [0,100]>? ]#{2})",
    "groups": [
      "CSS Fonts"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-palette/palette-mix"
  },
  "path()": {
    "syntax": "path( <'fill-rule'>? , <string> )",
    "groups": [
      "CSS Shapes"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/basic-shape/path"
  },
  "perspective()": {
    "syntax": "perspective( [ <length [0,∞]> | none ] )",
    "groups": [
      "CSS Transforms"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/perspective"
  },
  "polygon()": {
    "syntax": "polygon( <'fill-rule'>? , [ <length-percentage> <length-percentage> ]# )",
    "groups": [
      "CSS Shapes"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/basic-shape/polygon"
  },
  "pow()": {
    "syntax": "pow( <calc-sum>, <calc-sum> )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/pow"
  },
  "radial-gradient()": {
    "syntax": "radial-gradient( [ <radial-gradient-syntax> ] )",
    "groups": [
      "CSS Images"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/gradient/radial-gradient"
  },
  "ray()": {
    "syntax": "ray( <angle> && <ray-size>? && contain? && [at <position>]? )",
    "groups": [
      "Motion Path"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/ray"
  },
  "rect()": {
    "syntax": "rect( [ <length-percentage> | auto ]{4} [ round <'border-radius'> ]? )",
    "groups": [
      "CSS Shapes"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/basic-shape/rect"
  },
  "rem()": {
    "syntax": "rem( <calc-sum>, <calc-sum> )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/rem"
  },
  "repeating-conic-gradient()": {
    "syntax": "repeating-conic-gradient( [ <conic-gradient-syntax> ] )",
    "groups": [
      "CSS Images"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/gradient/repeating-conic-gradient"
  },
  "repeating-linear-gradient()": {
    "syntax": "repeating-linear-gradient( [ <linear-gradient-syntax> ] )",
    "groups": [
      "CSS Images"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/gradient/repeating-linear-gradient"
  },
  "repeating-radial-gradient()": {
    "syntax": "repeating-radial-gradient( [ <radial-gradient-syntax> ] )",
    "groups": [
      "CSS Images"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/gradient/repeating-radial-gradient"
  },
  "rgb()": {
    "syntax": "rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? ) | rgb( [ <number> | <percentage> | none ]{3} [ / [ <alpha-value> | none ] ]? )",
    "groups": [
      "CSS Color"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/rgb"
  },
  "rgba()": {
    "syntax": "rgba( <percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? ) | rgba( [ <number> | <percentage> | none ]{3} [ / [ <alpha-value> | none ] ]? )",
    "groups": [
      "CSS Color"
    ],
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value/rgb"
  },
  "rotate()": {
    "syntax": "rotate( [ <angle> | <zero> ] )",
    "groups": [
      "CSS Transforms"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/rotate"
  },
  "rotate3d()": {
    "syntax": "rotate3d( <number> , <number> , <number> , [ <angle> | <zero> ] )",
    "groups": [
      "CSS Transforms"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/rotate3d"
  },
  "rotateX()": {
    "syntax": "rotateX( [ <angle> | <zero> ] )",
    "groups": [
      "CSS Transforms"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/rotateX"
  },
  "rotateY()": {
    "syntax": "rotateY( [ <angle> | <zero> ] )",
    "groups": [
      "CSS Transforms"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/rotateY"
  },
  "rotateZ()": {
    "syntax": "rotateZ( [ <angle> | <zero> ] )",
    "groups": [
      "CSS Transforms"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/rotateZ"
  },
  "round()": {
    "syntax": "round( <rounding-strategy>?, <calc-sum>, <calc-sum> )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/round"
  },
  "saturate()": {
    "syntax": "saturate( [ <number> | <percentage> ]? )",
    "groups": [
      "Filter Effects"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter-function/saturate"
  },
  "scale()": {
    "syntax": "scale( [ <number> | <percentage> ]#{1,2} )",
    "groups": [
      "CSS Transforms"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/scale"
  },
  "scale3d()": {
    "syntax": "scale3d( [ <number> | <percentage> ]#{3} )",
    "groups": [
      "CSS Transforms"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/scale3d"
  },
  "scaleX()": {
    "syntax": "scaleX( [ <number> | <percentage> ] )",
    "groups": [
      "CSS Transforms"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/scaleX"
  },
  "scaleY()": {
    "syntax": "scaleY( [ <number> | <percentage> ] )",
    "groups": [
      "CSS Transforms"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/scaleY"
  },
  "scaleZ()": {
    "syntax": "scaleZ( [ <number> | <percentage> ] )",
    "groups": [
      "CSS Transforms"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/scaleZ"
  },
  "scroll()": {
    "syntax": "scroll( [ <scroller> || <axis> ]? )",
    "groups": [
      "Scroll-driven Animations"
    ],
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/animation-timeline/scroll"
  },
  "sepia()": {
    "syntax": "sepia( [ <number> | <percentage> ]? )",
    "groups": [
      "Filter Effects"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter-function/sepia"
  },
  "sign()": {
    "syntax": "sign( <calc-sum> )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/sign"
  },
  "sin()": {
    "syntax": "sin( <calc-sum> )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/sin"
  },
  "skew()": {
    "syntax": "skew( [ <angle> | <zero> ] , [ <angle> | <zero> ]? )",
    "groups": [
      "CSS Transforms"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/skew"
  },
  "skewX()": {
    "syntax": "skewX( [ <angle> | <zero> ] )",
    "groups": [
      "CSS Transforms"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/skewX"
  },
  "skewY()": {
    "syntax": "skewY( [ <angle> | <zero> ] )",
    "groups": [
      "CSS Transforms"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/skewY"
  },
  "sqrt()": {
    "syntax": "sqrt( <calc-sum> )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/sqrt"
  },
  "steps()": {
    "syntax": "steps( <integer>, <step-position>? )",
    "groups": [
      "CSS Easing Functions"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/easing-function/steps"
  },
  "symbols()": {
    "syntax": "symbols( <symbols-type>? [ <string> | <image> ]+ )",
    "groups": [
      "CSS Counter Styles"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/symbols"
  },
  "tan()": {
    "syntax": "tan( <calc-sum> )",
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/tan"
  },
  "target-counter()": {
    "syntax": "target-counter( [ <string> | <url> ] , <custom-ident> , <counter-style>? )",
    "groups": [
      "CSS Generated Content"
    ],
    "status": "experimental"
  },
  "target-counters()": {
    "syntax": "target-counters( [ <string> | <url> ] , <custom-ident> , <string> , <counter-style>? )",
    "groups": [
      "CSS Generated Content"
    ],
    "status": "experimental"
  },
  "target-text()": {
    "syntax": "target-text( [ <string> | <url> ] , [ content | before | after | first-letter ]? )",
    "groups": [
      "CSS Generated Content"
    ],
    "status": "experimental"
  },
  "translate()": {
    "syntax": "translate( <length-percentage> , <length-percentage>? )",
    "groups": [
      "CSS Transforms"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/translate"
  },
  "translate3d()": {
    "syntax": "translate3d( <length-percentage> , <length-percentage> , <length> )",
    "groups": [
      "CSS Transforms"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/translate3d"
  },
  "translateX()": {
    "syntax": "translateX( <length-percentage> )",
    "groups": [
      "CSS Transforms"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/translateX"
  },
  "translateY()": {
    "syntax": "translateY( <length-percentage> )",
    "groups": [
      "CSS Transforms"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/translateY"
  },
  "translateZ()": {
    "syntax": "translateZ( <length> )",
    "groups": [
      "CSS Transforms"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function/translateZ"
  },
  "var()": {
    "syntax": "var( <custom-property-name> , <declaration-value>? )",
    "groups": [
      "CSS Custom Properties for Cascading Variables"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/var"
  },
  "view()": {
    "syntax": "view([<axis> || <'view-timeline-inset'>]?)",
    "groups": [
      "Scroll-driven Animations"
    ],
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/animation-timeline/view"
  },
  "xywh()": {
    "syntax": "xywh( <length-percentage>{2} <length-percentage [0,∞]>{2} [ round <'border-radius'> ]? )",
    "groups": [
      "CSS Shapes"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/basic-shape/xywh"
  }
}
\?n,x7{
  "type": "object",
  "additionalProperties": {
    "type": "object",
    "additionalProperties": false,
    "properties": {
      "syntax": {
        "type": "string"
      },
      "groups": {
        "type": "array",
        "minitems": 1,
        "uniqueItems": true,
        "items": {
          "$ref": "definitions.json#/groupList"
        }
      },
      "status": {
        "enum": [
          "standard",
          "nonstandard",
          "experimental",
          "obsolete"
        ]
      },
      "mdn_url": {
        "type": "string",
        "pattern": "^https://developer.mozilla.org/docs/Web/CSS/"
      }
    },
    "required": [
      "syntax",
      "groups",
      "status"
    ]
  }
}
z@:Ux %{
  "definitions": {
    "status": {
|"nonstandard",
 "obsolete"
      ]
    },
"type": "string",
,6"
    }
  },oAi$ref": "#/definitions/status"&3$ref": "#/definitions/mdn_url"
      }
    }
  }
}
>C0xmodule.exports = {
  atRules:    require('./at-rules'),
  functions:  require('./functions'),
  selectors:  require('./selectors'),
  types:      require('./types'),
  properties: require('./properties'),
  syntaxes:   require('./syntaxes'),
  units:      require('./units'),
}
6Xx   {
  "--*": {
    "syntax": "<declaration-value>",
    "media": "all",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Custom Properties for Cascading Variables"
    ],
    "initial": "seeProse",
    "appliesto": "allElements",
    "computed": "asSpecifiedWithVarsSubstituted",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/--*"
  },
  "-ms-accelerator": {
    "syntax": "false | true",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "false",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-block-progression": {
    "syntax": "tb | rl | bt | lr",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "tb",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-content-zoom-chaining": {
    "syntax": "none | chained",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "none",
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-content-zoom-limit": {
    "syntax": "<'-ms-content-zoom-limit-min'> <'-ms-content-zoom-limit-max'>",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": [
      "-ms-content-zoom-limit-max",
      "-ms-content-zoom-limit-min"
    ],
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": [
      "-ms-content-zoom-limit-max",
      "-ms-content-zoom-limit-min"
    ],
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": [
      "-ms-content-zoom-limit-max",
      "-ms-content-zoom-limit-min"
    ],
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-content-zoom-limit-max": {
    "syntax": "<percentage>",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "maxZoomFactor",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "400%",
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-content-zoom-limit-min": {
    "syntax": "<percentage>",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "minZoomFactor",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "100%",
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-content-zoom-snap": {
    "syntax": "<'-ms-content-zoom-snap-type'> || <'-ms-content-zoom-snap-points'>",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": [
      "-ms-content-zoom-snap-type",
      "-ms-content-zoom-snap-points"
    ],
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": [
      "-ms-content-zoom-snap-type",
      "-ms-content-zoom-snap-points"
    ],
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-content-zoom-snap-points": {
    "syntax": "snapInterval( <percentage>, <percentage> ) | snapList( <percentage># )",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "snapInterval(0%, 100%)",
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-content-zoom-snap-type": {
    "syntax": "none | proximity | mandatory",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "none",
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-content-zooming": {
    "syntax": "none | zoom",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "zoomForTheTopLevelNoneForTheRest",
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-filter": {
    "syntax": "<string>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "\"\"",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-flow-from": {
    "syntax": "[ none | <custom-ident> ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "none",
    "appliesto": "nonReplacedElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-flow-into": {
    "syntax": "[ none | <custom-ident> ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "none",
    "appliesto": "iframeElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-grid-columns": {
    "syntax": "none | <track-list> | <auto-track-list>",
    "media": "visual",
    "inherited": false,
    "animationType": "simpleListOfLpcDifferenceLpc",
    "percentages": "referToDimensionOfContentArea",
    "groups": [
      "CSS Grid Layout"
    ],
    "initial": "none",
    "appliesto": "gridContainers",
    "computed": "asSpecifiedRelativeToAbsoluteLengths",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-grid-rows": {
    "syntax": "none | <track-list> | <auto-track-list>",
    "media": "visual",
    "inherited": false,
    "animationType": "simpleListOfLpcDifferenceLpc",
    "percentages": "referToDimensionOfContentArea",
    "groups": [
      "CSS Grid Layout"
    ],
    "initial": "none",
    "appliesto": "gridContainers",
    "computed": "asSpecifiedRelativeToAbsoluteLengths",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-high-contrast-adjust": {
    "syntax": "auto | none",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-hyphenate-limit-chars": {
    "syntax": "auto | <integer>{1,3}",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-hyphenate-limit-lines": {
    "syntax": "no-limit | <integer>",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "no-limit",
    "appliesto": "blockContainerElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-hyphenate-limit-zone": {
    "syntax": "<percentage> | <length>",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "referToLineBoxWidth",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "0",
    "appliesto": "blockContainerElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-ime-align": {
    "syntax": "auto | after",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-overflow-style": {
    "syntax": "auto | none | scrollbar | -ms-autohiding-scrollbar",
    "media": "interactive",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "auto",
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-scroll-chaining": {
    "syntax": "chained | none",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "chained",
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-scroll-limit": {
    "syntax": "<'-ms-scroll-limit-x-min'> <'-ms-scroll-limit-y-min'> <'-ms-scroll-limit-x-max'> <'-ms-scroll-limit-y-max'>",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": [
      "-ms-scroll-limit-x-min",
      "-ms-scroll-limit-y-min",
      "-ms-scroll-limit-x-max",
      "-ms-scroll-limit-y-max"
    ],
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": [
      "-ms-scroll-limit-x-min",
      "-ms-scroll-limit-y-min",
      "-ms-scroll-limit-x-max",
      "-ms-scroll-limit-y-max"
    ],
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-scroll-limit-x-max": {
    "syntax": "auto | <length>",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "auto",
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-scroll-limit-x-min": {
    "syntax": "<length>",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "0",
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-scroll-limit-y-max": {
    "syntax": "auto | <length>",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "auto",
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-scroll-limit-y-min": {
    "syntax": "<length>",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "0",
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-scroll-rails": {
    "syntax": "none | railed",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "railed",
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-scroll-snap-points-x": {
    "syntax": "snapInterval( <length-percentage>, <length-percentage> ) | snapList( <length-percentage># )",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "snapInterval(0px, 100%)",
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-scroll-snap-points-y": {
    "syntax": "snapInterval( <length-percentage>, <length-percentage> ) | snapList( <length-percentage># )",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "snapInterval(0px, 100%)",
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-scroll-snap-type": {
    "syntax": "none | proximity | mandatory",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "none",
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-scroll-snap-x": {
    "syntax": "<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-x'>",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": [
      "-ms-scroll-snap-type",
      "-ms-scroll-snap-points-x"
    ],
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": [
      "-ms-scroll-snap-type",
      "-ms-scroll-snap-points-x"
    ],
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-scroll-snap-y": {
    "syntax": "<'-ms-scroll-snap-type'> <'-ms-scroll-snap-points-y'>",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": [
      "-ms-scroll-snap-type",
      "-ms-scroll-snap-points-y"
    ],
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": [
      "-ms-scroll-snap-type",
      "-ms-scroll-snap-points-y"
    ],
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-scroll-translation": {
    "syntax": "none | vertical-to-horizontal",
    "media": "interactive",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-scrollbar-3dlight-color": {
    "syntax": "<color>",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "dependsOnUserAgent",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-scrollbar-arrow-color": {
    "syntax": "<color>",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "ButtonText",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-scrollbar-base-color": {
    "syntax": "<color>",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "dependsOnUserAgent",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-scrollbar-darkshadow-color": {
    "syntax": "<color>",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "ThreeDDarkShadow",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-scrollbar-face-color": {
    "syntax": "<color>",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "ThreeDFace",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-scrollbar-highlight-color": {
    "syntax": "<color>",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "ThreeDHighlight",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-scrollbar-shadow-color": {
    "syntax": "<color>",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "ThreeDDarkShadow",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-scrollbar-track-color": {
    "syntax": "<color>",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "Scrollbar",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-text-autospace": {
    "syntax": "none | ideograph-alpha | ideograph-numeric | ideograph-parenthesis | ideograph-space",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-touch-select": {
    "syntax": "grippers | none",
    "media": "interactive",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "grippers",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-user-select": {
    "syntax": "none | element | text",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "text",
    "appliesto": "nonReplacedElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-wrap-flow": {
    "syntax": "auto | both | start | end | maximum | clear",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "auto",
    "appliesto": "blockLevelElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-wrap-margin": {
    "syntax": "<length>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "0",
    "appliesto": "exclusionElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-ms-wrap-through": {
    "syntax": "wrap | none",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Microsoft Extensions"
    ],
    "initial": "wrap",
    "appliesto": "blockLevelElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-moz-appearance": {
    "syntax": "none | button | button-arrow-down | button-arrow-next | button-arrow-previous | button-arrow-up | button-bevel | button-focus | caret | checkbox | checkbox-container | checkbox-label | checkmenuitem | dualbutton | groupbox | listbox | listitem | menuarrow | menubar | menucheckbox | menuimage | menuitem | menuitemtext | menulist | menulist-button | menulist-text | menulist-textfield | menupopup | menuradio | menuseparator | meterbar | meterchunk | progressbar | progressbar-vertical | progresschunk | progresschunk-vertical | radio | radio-container | radio-label | radiomenuitem | range | range-thumb | resizer | resizerpanel | scale-horizontal | scalethumbend | scalethumb-horizontal | scalethumbstart | scalethumbtick | scalethumb-vertical | scale-vertical | scrollbarbutton-down | scrollbarbutton-left | scrollbarbutton-right | scrollbarbutton-up | scrollbarthumb-horizontal | scrollbarthumb-vertical | scrollbartrack-horizontal | scrollbartrack-vertical | searchfield | separator | sheet | spinner | spinner-downbutton | spinner-textfield | spinner-upbutton | splitter | statusbar | statusbarpanel | tab | tabpanel | tabpanels | tab-scroll-arrow-back | tab-scroll-arrow-forward | textfield | textfield-multiline | toolbar | toolbarbutton | toolbarbutton-dropdown | toolbargripper | toolbox | tooltip | treeheader | treeheadercell | treeheadersortarrow | treeitem | treeline | treetwisty | treetwistyopen | treeview | -moz-mac-unified-toolbar | -moz-win-borderless-glass | -moz-win-browsertabbar-toolbox | -moz-win-communicationstext | -moz-win-communications-toolbox | -moz-win-exclude-glass | -moz-win-glass | -moz-win-mediatext | -moz-win-media-toolbox | -moz-window-button-box | -moz-window-button-box-maximized | -moz-window-button-close | -moz-window-button-maximize | -moz-window-button-minimize | -moz-window-button-restore | -moz-window-frame-bottom | -moz-window-frame-left | -moz-window-frame-right | -moz-window-titlebar | -moz-window-titlebar-maximized",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions",
      "WebKit Extensions"
    ],
    "initial": "noneButOverriddenInUserAgentCSS",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/appearance"
  },
  "-moz-binding": {
    "syntax": "<url> | none",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions"
    ],
    "initial": "none",
    "appliesto": "allElementsExceptGeneratedContentOrPseudoElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-moz-border-bottom-colors": {
    "syntax": "<color>+ | none",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-moz-border-left-colors": {
    "syntax": "<color>+ | none",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-moz-border-right-colors": {
    "syntax": "<color>+ | none",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-moz-border-top-colors": {
    "syntax": "<color>+ | none",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-moz-context-properties": {
    "syntax": "none | [ fill | fill-opacity | stroke | stroke-opacity ]#",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions"
    ],
    "initial": "none",
    "appliesto": "allElementsThatCanReferenceImages",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-moz-float-edge": {
    "syntax": "border-box | content-box | margin-box | padding-box",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions"
    ],
    "initial": "content-box",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/-moz-float-edge"
  },
  "-moz-force-broken-image-icon": {
    "syntax": "0 | 1",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions"
    ],
    "initial": "0",
    "appliesto": "images",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/-moz-force-broken-image-icon"
  },
  "-moz-orient": {
    "syntax": "inline | block | horizontal | vertical",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions"
    ],
    "initial": "inline",
    "appliesto": "anyElementEffectOnProgressAndMeter",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/-moz-orient"
  },
  "-moz-outline-radius": {
    "syntax": "<outline-radius>{1,4} [ / <outline-radius>{1,4} ]?",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "-moz-outline-radius-topleft",
      "-moz-outline-radius-topright",
      "-moz-outline-radius-bottomright",
      "-moz-outline-radius-bottomleft"
    ],
    "percentages": [
      "-moz-outline-radius-topleft",
      "-moz-outline-radius-topright",
      "-moz-outline-radius-bottomright",
      "-moz-outline-radius-bottomleft"
    ],
    "groups": [
      "Mozilla Extensions"
    ],
    "initial": [
      "-moz-outline-radius-topleft",
      "-moz-outline-radius-topright",
      "-moz-outline-radius-bottomright",
      "-moz-outline-radius-bottomleft"
    ],
    "appliesto": "allElements",
    "computed": [
      "-moz-outline-radius-topleft",
      "-moz-outline-radius-topright",
      "-moz-outline-radius-bottomright",
      "-moz-outline-radius-bottomleft"
    ],
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-moz-outline-radius-bottomleft": {
    "syntax": "<outline-radius>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToDimensionOfBorderBox",
    "groups": [
      "Mozilla Extensions"
    ],
    "initial": "0",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-moz-outline-radius-bottomright": {
    "syntax": "<outline-radius>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToDimensionOfBorderBox",
    "groups": [
      "Mozilla Extensions"
    ],
    "initial": "0",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-moz-outline-radius-topleft": {
    "syntax": "<outline-radius>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToDimensionOfBorderBox",
    "groups": [
      "Mozilla Extensions"
    ],
    "initial": "0",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-moz-outline-radius-topright": {
    "syntax": "<outline-radius>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToDimensionOfBorderBox",
    "groups": [
      "Mozilla Extensions"
    ],
    "initial": "0",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-moz-stack-sizing": {
    "syntax": "ignore | stretch-to-fit",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions"
    ],
    "initial": "stretch-to-fit",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-moz-text-blink": {
    "syntax": "none | blink",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-moz-user-focus": {
    "syntax": "ignore | normal | select-after | select-before | select-menu | select-same | select-all | none",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/-moz-user-focus"
  },
  "-moz-user-input": {
    "syntax": "auto | none | enabled | disabled",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/-moz-user-input"
  },
  "-moz-user-modify": {
    "syntax": "read-only | read-write | write-only",
    "media": "interactive",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions"
    ],
    "initial": "read-only",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/user-modify"
  },
  "-moz-window-dragging": {
    "syntax": "drag | no-drag",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions"
    ],
    "initial": "drag",
    "appliesto": "allElementsCreatingNativeWindows",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-moz-window-shadow": {
    "syntax": "default | menu | tooltip | sheet | none",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions"
    ],
    "initial": "default",
    "appliesto": "allElementsCreatingNativeWindows",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-webkit-appearance": {
    "syntax": "none | button | button-bevel | caret | checkbox | default-button | inner-spin-button | listbox | listitem | media-controls-background | media-controls-fullscreen-background | media-current-time-display | media-enter-fullscreen-button | media-exit-fullscreen-button | media-fullscreen-button | media-mute-button | media-overlay-play-button | media-play-button | media-seek-back-button | media-seek-forward-button | media-slider | media-sliderthumb | media-time-remaining-display | media-toggle-closed-captions-button | media-volume-slider | media-volume-slider-container | media-volume-sliderthumb | menulist | menulist-button | menulist-text | menulist-textfield | meter | progress-bar | progress-bar-value | push-button | radio | searchfield | searchfield-cancel-button | searchfield-decoration | searchfield-results-button | searchfield-results-decoration | slider-horizontal | slider-vertical | sliderthumb-horizontal | sliderthumb-vertical | square-button | textarea | textfield | -apple-pay-button",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "noneButOverriddenInUserAgentCSS",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/appearance"
  },
  "-webkit-border-after": {
    "syntax": "<'border-top'>",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "border-block-end-width",
      "border-block-end-style",
      "border-block-end-color"
    ],
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": [
      "border-block-end-width",
      "border-block-end-style",
      "border-block-end-color"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-block-end-width",
      "border-block-end-style",
      "border-block-end-color"
    ],
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-webkit-border-after-color": {
    "syntax": "<'border-top-color'>",
    "media": "visual",
    "inherited": false,
    "animationType": "color",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "currentcolor",
    "appliesto": "allElements",
    "computed": "computedColor",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-webkit-border-after-style": {
    "syntax": "<'border-top-style'>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-webkit-border-after-width": {
    "syntax": "<'border-top-width'>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "medium",
    "appliesto": "allElements",
    "computed": "absoluteLengthSnappedAsLineWidth",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-webkit-border-before": {
    "syntax": "<'border-top'>",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "border-block-start-width",
      "border-block-start-style",
      "border-block-start-color"
    ],
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": [
      "border-block-start-width",
      "border-block-start-style",
      "border-block-start-color"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-block-start-width",
      "border-block-start-style",
      "border-block-start-color"
    ],
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/-webkit-border-before"
  },
  "-webkit-border-before-color": {
    "syntax": "<'border-top-color'>",
    "media": "visual",
    "inherited": false,
    "animationType": "color",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "currentcolor",
    "appliesto": "allElements",
    "computed": "computedColor",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-webkit-border-before-style": {
    "syntax": "<'border-top-style'>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-webkit-border-before-width": {
    "syntax": "<'border-top-width'>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "medium",
    "appliesto": "allElements",
    "computed": "absoluteLengthSnappedAsLineWidth",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-webkit-border-end": {
    "syntax": "<'border-top'>",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "border-inline-end-width",
      "border-inline-end-style",
      "border-inline-end-color"
    ],
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": [
      "border-inline-end-width",
      "border-inline-end-style",
      "border-inline-end-color"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-inline-end-width",
      "border-inline-end-style",
      "border-inline-end-color"
    ],
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-webkit-border-end-color": {
    "syntax": "<'border-top-color'>",
    "media": "visual",
    "inherited": false,
    "animationType": "color",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "currentcolor",
    "appliesto": "allElements",
    "computed": "computedColor",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-webkit-border-end-style": {
    "syntax": "<'border-top-style'>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-webkit-border-end-width": {
    "syntax": "<'border-top-width'>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "medium",
    "appliesto": "allElements",
    "computed": "absoluteLengthSnappedAsLineWidth",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-webkit-border-start": {
    "syntax": "<'border-top'>",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "border-inline-start-width",
      "border-inline-start-style",
      "border-inline-start-color"
    ],
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": [
      "border-inline-start-width",
      "border-inline-start-style",
      "border-inline-start-color"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-inline-start-width",
      "border-inline-start-style",
      "border-inline-start-color"
    ],
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-webkit-border-start-color": {
    "syntax": "<'border-top-color'>",
    "media": "visual",
    "inherited": false,
    "animationType": "color",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "currentcolor",
    "appliesto": "allElements",
    "computed": "computedColor",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-webkit-border-start-style": {
    "syntax": "<'border-top-style'>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-webkit-border-start-width": {
    "syntax": "<'border-top-width'>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "medium",
    "appliesto": "allElements",
    "computed": "absoluteLengthSnappedAsLineWidth",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-webkit-box-reflect": {
    "syntax": "[ above | below | right | left ]? <length>? <image>?",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/-webkit-box-reflect"
  },
  "-webkit-line-clamp": {
    "syntax": "none | <integer>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "WebKit Extensions",
      "CSS Overflow"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/-webkit-line-clamp"
  },
  "-webkit-mask": {
    "syntax": "[ <mask-reference> || <position> [ / <bg-size> ]? || <repeat-style> || [ <visual-box> | border | padding | content | text ] || [ <visual-box> | border | padding | content ] ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": [
      "-webkit-mask-image",
      "-webkit-mask-repeat",
      "-webkit-mask-attachment",
      "-webkit-mask-position",
      "-webkit-mask-origin",
      "-webkit-mask-clip"
    ],
    "appliesto": "allElements",
    "computed": [
      "-webkit-mask-image",
      "-webkit-mask-repeat",
      "-webkit-mask-attachment",
      "-webkit-mask-position",
      "-webkit-mask-origin",
      "-webkit-mask-clip"
    ],
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask"
  },
  "-webkit-mask-attachment": {
    "syntax": "<attachment>#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "scroll",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "orderOfAppearance",
    "status": "nonstandard"
  },
  "-webkit-mask-clip": {
    "syntax": "[ <coord-box> | no-clip | border | padding | content | text ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "border",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "orderOfAppearance",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask-clip"
  },
  "-webkit-mask-composite": {
    "syntax": "<composite-style>#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "source-over",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "orderOfAppearance",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/-webkit-mask-composite"
  },
  "-webkit-mask-image": {
    "syntax": "<mask-reference>#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "absoluteURIOrNone",
    "order": "orderOfAppearance",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask-image"
  },
  "-webkit-mask-origin": {
    "syntax": "[ <coord-box> | border | padding | content ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "padding",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "orderOfAppearance",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask-origin"
  },
  "-webkit-mask-position": {
    "syntax": "<position>#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "referToSizeOfElement",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "0% 0%",
    "appliesto": "allElements",
    "computed": "absoluteLengthOrPercentage",
    "order": "orderOfAppearance",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask-position"
  },
  "-webkit-mask-position-x": {
    "syntax": "[ <length-percentage> | left | center | right ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "referToSizeOfElement",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "0%",
    "appliesto": "allElements",
    "computed": "absoluteLengthOrPercentage",
    "order": "orderOfAppearance",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/-webkit-mask-position-x"
  },
  "-webkit-mask-position-y": {
    "syntax": "[ <length-percentage> | top | center | bottom ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "referToSizeOfElement",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "0%",
    "appliesto": "allElements",
    "computed": "absoluteLengthOrPercentage",
    "order": "orderOfAppearance",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/-webkit-mask-position-y"
  },
  "-webkit-mask-repeat": {
    "syntax": "<repeat-style>#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "repeat",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "orderOfAppearance",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask-repeat"
  },
  "-webkit-mask-repeat-x": {
    "syntax": "repeat | no-repeat | space | round",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "repeat",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "orderOfAppearance",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/-webkit-mask-repeat-x"
  },
  "-webkit-mask-repeat-y": {
    "syntax": "repeat | no-repeat | space | round",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "repeat",
    "appliesto": "allElements",
    "computed": "absoluteLengthOrPercentage",
    "order": "orderOfAppearance",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/-webkit-mask-repeat-y"
  },
  "-webkit-mask-size": {
    "syntax": "<bg-size>#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "relativeToBackgroundPositioningArea",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "auto auto",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "orderOfAppearance",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask-size"
  },
  "-webkit-overflow-scrolling": {
    "syntax": "auto | touch",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "auto",
    "appliesto": "scrollingBoxes",
    "computed": "asSpecified",
    "order": "orderOfAppearance",
    "status": "nonstandard"
  },
  "-webkit-tap-highlight-color": {
    "syntax": "<color>",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "black",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/-webkit-tap-highlight-color"
  },
  "-webkit-text-fill-color": {
    "syntax": "<color>",
    "media": "visual",
    "inherited": true,
    "animationType": "color",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "currentcolor",
    "appliesto": "allElements",
    "computed": "computedColor",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/-webkit-text-fill-color"
  },
  "-webkit-text-stroke": {
    "syntax": "<length> || <color>",
    "media": "visual",
    "inherited": true,
    "animationType": [
      "-webkit-text-stroke-width",
      "-webkit-text-stroke-color"
    ],
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": [
      "-webkit-text-stroke-width",
      "-webkit-text-stroke-color"
    ],
    "appliesto": "allElements",
    "computed": [
      "-webkit-text-stroke-width",
      "-webkit-text-stroke-color"
    ],
    "order": "canonicalOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/-webkit-text-stroke"
  },
  "-webkit-text-stroke-color": {
    "syntax": "<color>",
    "media": "visual",
    "inherited": true,
    "animationType": "color",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "currentcolor",
    "appliesto": "allElements",
    "computed": "computedColor",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/-webkit-text-stroke-color"
  },
  "-webkit-text-stroke-width": {
    "syntax": "<length>",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "0",
    "appliesto": "allElements",
    "computed": "absoluteLength",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/-webkit-text-stroke-width"
  },
  "-webkit-touch-callout": {
    "syntax": "default | none",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "default",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/-webkit-touch-callout"
  },
  "-webkit-user-modify": {
    "syntax": "read-only | read-write | read-write-plaintext-only",
    "media": "interactive",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "read-only",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "-webkit-user-select": {
    "syntax": "auto | text | none | all",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "WebKit Extensions"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/user-select"
  },
  "accent-color": {
    "syntax": "auto | <color>",
    "media": "interactive",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Basic User Interface"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "asAutoOrColor",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/accent-color"
  },
  "align-content": {
    "syntax": "normal | <baseline-position> | <content-distribution> | <overflow-position>? <content-position>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Box Alignment",
      "CSS Flexible Box Layout"
    ],
    "initial": "normal",
    "appliesto": "blockContainersMultiColumnContainersFlexContainersGridContainers",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/align-content"
  },
  "align-items": {
    "syntax": "normal | stretch | <baseline-position> | [ <overflow-position>? <self-position> ] | anchor-center",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Box Alignment",
      "CSS Flexible Box Layout"
    ],
    "initial": "normal",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/align-items"
  },
  "align-self": {
    "syntax": "auto | normal | stretch | <baseline-position> | <overflow-position>? <self-position> | anchor-center",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Box Alignment",
      "CSS Flexible Box Layout"
    ],
    "initial": "auto",
    "appliesto": "flexItemsGridItemsAndAbsolutelyPositionedBoxes",
    "computed": "autoOnAbsolutelyPositionedElementsValueOfAlignItemsOnParent",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/align-self"
  },
  "align-tracks": {
    "syntax": "[ normal | <baseline-position> | <content-distribution> | <overflow-position>? <content-position> ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Grid Layout"
    ],
    "initial": "normal",
    "appliesto": "gridContainersWithMasonryLayoutInTheirBlockAxis",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "alignment-baseline": {
    "syntax": "baseline | alphabetic | ideographic | middle | central | mathematical | text-before-edge | text-after-edge",
    "media": "none",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Inline"
    ],
    "initial": "baseline",
    "appliesto": "inlineLevelBoxesFlexItemsGridItemsTableCellsAndSVGTextContentElements",
    "computed": "theSpecifiedKeyword",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/alignment-baseline"
  },
  "all": {
    "syntax": "initial | inherit | unset | revert | revert-layer",
    "media": "noPracticalMedia",
    "inherited": false,
    "animationType": "eachOfShorthandPropertiesExceptUnicodeBiDiAndDirection",
    "percentages": "no",
    "groups": [
      "CSS Cascading and Inheritance"
    ],
    "initial": "noPracticalInitialValue",
    "appliesto": "allElements",
    "computed": "asSpecifiedAppliesToEachProperty",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/all"
  },
  "anchor-name": {
    "syntax": "none | <dashed-ident>#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Anchor Positioning"
    ],
    "initial": "none",
    "appliesto": "allElementsThatGenerateAPrincipalBox",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/anchor-name"
  },
  "anchor-scope": {
    "syntax": "none | all | <dashed-ident>#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Anchor Positioning"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "experimental"
  },
  "animation": {
    "syntax": "<single-animation>#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Animations"
    ],
    "initial": [
      "animation-name",
      "animation-duration",
      "animation-timing-function",
      "animation-delay",
      "animation-iteration-count",
      "animation-direction",
      "animation-fill-mode",
      "animation-play-state",
      "animation-timeline"
    ],
    "appliesto": "allElements",
    "computed": [
      "animation-name",
      "animation-duration",
      "animation-timing-function",
      "animation-delay",
      "animation-direction",
      "animation-iteration-count",
      "animation-fill-mode",
      "animation-play-state",
      "animation-timeline"
    ],
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/animation"
  },
  "animation-composition": {
    "syntax": "<single-animation-composition>#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Animations"
    ],
    "initial": "replace",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/animation-composition"
  },
  "animation-delay": {
    "syntax": "<time>#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Animations"
    ],
    "initial": "0s",
    "appliesto": "allElementsAndPseudos",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/animation-delay"
  },
  "animation-direction": {
    "syntax": "<single-animation-direction>#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Animations"
    ],
    "initial": "normal",
    "appliesto": "allElementsAndPseudos",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/animation-direction"
  },
  "animation-duration": {
    "syntax": "[ auto | <time [0s,∞]> ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Animations"
    ],
    "initial": "0s",
    "appliesto": "allElementsAndPseudos",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/animation-duration"
  },
  "animation-fill-mode": {
    "syntax": "<single-animation-fill-mode>#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Animations"
    ],
    "initial": "none",
    "appliesto": "allElementsAndPseudos",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/animation-fill-mode"
  },
  "animation-iteration-count": {
    "syntax": "<single-animation-iteration-count>#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Animations"
    ],
    "initial": "1",
    "appliesto": "allElementsAndPseudos",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/animation-iteration-count"
  },
  "animation-name": {
    "syntax": "[ none | <keyframes-name> ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Animations"
    ],
    "initial": "none",
    "appliesto": "allElementsAndPseudos",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/animation-name"
  },
  "animation-play-state": {
    "syntax": "<single-animation-play-state>#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Animations"
    ],
    "initial": "running",
    "appliesto": "allElementsAndPseudos",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/animation-play-state"
  },
  "animation-range": {
    "syntax": "[ <'animation-range-start'> <'animation-range-end'>? ]#",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "animation-range-start",
      "animation-range-end"
    ],
    "percentages": "relativeToTimelineRangeIfSpecifiedOtherwiseEntireTimeline",
    "groups": [
      "Scroll-driven Animations"
    ],
    "initial": [
      "animation-range-start",
      "animation-range-end"
    ],
    "appliesto": "allElements",
    "computed": [
      "animation-range-start",
      "animation-range-end"
    ],
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/animation-range"
  },
  "animation-range-end": {
    "syntax": "[ normal | <length-percentage> | <timeline-range-name> <length-percentage>? ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "relativeToTimelineRangeIfSpecifiedOtherwiseEntireTimeline",
    "groups": [
      "Scroll-driven Animations"
    ],
    "initial": "normal",
    "appliesto": "allElements",
    "computed": "listEachItemConsistingOfNormalLengthPercentageOrNameLengthPercentage",
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/animation-range-end"
  },
  "animation-range-start": {
    "syntax": "[ normal | <length-percentage> | <timeline-range-name> <length-percentage>? ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "relativeToTimelineRangeIfSpecifiedOtherwiseEntireTimeline",
    "groups": [
      "Scroll-driven Animations"
    ],
    "initial": "normal",
    "appliesto": "allElements",
    "computed": "listEachItemConsistingOfNormalLengthPercentageOrNameLengthPercentage",
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/animation-range-start"
  },
  "animation-timeline": {
    "syntax": "<single-animation-timeline>#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Animations"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "listEachItemIdentifierOrNoneAuto",
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/animation-timeline"
  },
  "animation-timing-function": {
    "syntax": "<easing-function>#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Animations"
    ],
    "initial": "ease",
    "appliesto": "allElementsAndPseudos",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/animation-timing-function"
  },
  "animation-trigger": {
    "syntax": "[ none | [ <dashed-ident> <animation-action>+ ]+ ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Animations"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/animation-trigger"
  },
  "appearance": {
    "syntax": "none | auto | <compat-auto> | <compat-special>",
    "media": "all",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Basic User Interface"
    ],
    "initial": "none",
    "appli   esto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/appearance"
  },
  "aspect-ratio": {
    "syntax": "auto || <ratio>",
    "media": "all",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Box Sizing"
    ],
    "initial": "auto",
    "appliesto": "allElementsExceptInlineBoxesAndInternalRubyOrTableBoxes",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/aspect-ratio"
  },
  "backdrop-filter": {
    "syntax": "none | <filter-value-list>",
    "media": "visual",
    "inherited": false,
    "animationType": "filterList",
    "percentages": "no",
    "groups": [
      "Filter Effects"
    ],
    "initial": "none",
    "appliesto": "allElementsSVGContainerElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/backdrop-filter"
  },
  "backface-visibility": {
    "syntax": "visible | hidden",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Transforms"
    ],
    "initial": "visible",
    "appliesto": "transformableElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/backface-visibility"
  },
  "background": {
    "syntax": "<bg-layer>#? , <final-bg-layer>",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "background-color",
      "background-image",
      "background-clip",
      "background-position",
      "background-size",
      "background-repeat",
      "background-attachment"
    ],
    "percentages": [
      "background-position",
      "background-size"
    ],
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": [
      "background-image",
      "background-position",
      "background-size",
      "background-repeat",
      "background-origin",
      "background-clip",
      "background-attachment",
      "background-color"
    ],
    "appliesto": "allElements",
    "computed": [
      "background-image",
      "background-position",
      "background-size",
      "background-repeat",
      "background-origin",
      "background-clip",
      "background-attachment",
      "background-color"
    ],
    "order": "orderOfAppearance",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/background"
  },
  "background-attachment": {
    "syntax": "<attachment>#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "scroll",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/background-attachment"
  },
  "background-blend-mode": {
    "syntax": "<blend-mode>#",
    "media": "none",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "Compositing and Blending"
    ],
    "initial": "normal",
    "appliesto": "allElementsSVGContainerGraphicsAndGraphicsReferencingElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/background-blend-mode"
  },
  "background-clip": {
    "syntax": "<bg-clip>#",
    "media": "visual",
    "inherited": false,
    "animationType": "repeatableList",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "border-box",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/background-clip"
  },
  "background-color": {
    "syntax": "<color>",
    "media": "visual",
    "inherited": false,
    "animationType": "color",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "transparent",
    "appliesto": "allElements",
    "computed": "computedColor",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/background-color"
  },
  "background-image": {
    "syntax": "<bg-image>#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecifiedURLsAbsolute",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/background-image"
  },
  "background-origin": {
    "syntax": "<visual-box>#",
    "media": "visual",
    "inherited": false,
    "animationType": "repeatableList",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "padding-box",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/background-origin"
  },
  "background-position": {
    "syntax": "<bg-position>#",
    "media": "visual",
    "inherited": false,
    "animationType": "repeatableList",
    "percentages": "referToSizeOfBackgroundPositioningAreaMinusBackgroundImageSize",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "0% 0%",
    "appliesto": "allElements",
    "computed": [
      "background-position-x",
      "background-position-y"
    ],
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/background-position"
  },
  "background-position-x": {
    "syntax": "[ center | [ [ left | right | x-start | x-end ]? <length-percentage>? ]! ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "repeatableList",
    "percentages": "referToWidthOfBackgroundPositioningAreaMinusBackgroundImageWidth",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "0%",
    "appliesto": "allElements",
    "computed": "listEachItemConsistingOfAbsoluteLengthPercentageAndOrigin",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/background-position-x"
  },
  "background-position-y": {
    "syntax": "[ center | [ [ top | bottom | y-start | y-end ]? <length-percentage>? ]! ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "repeatableList",
    "percentages": "referToHeightOfBackgroundPositioningAreaMinusBackgroundImageHeight",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "0%",
    "appliesto": "allElements",
    "computed": "listEachItemConsistingOfAbsoluteLengthPercentageAndOrigin",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/background-position-y"
  },
  "background-repeat": {
    "syntax": "<repeat-style>#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "repeat",
    "appliesto": "allElements",
    "computed": "listEachItemHasTwoKeywordsOnePerDimension",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/background-repeat"
  },
  "background-size": {
    "syntax": "<bg-size>#",
    "media": "visual",
    "inherited": false,
    "animationType": "repeatableList",
    "percentages": "relativeToBackgroundPositioningArea",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "auto auto",
    "appliesto": "allElements",
    "computed": "asSpecifiedRelativeToAbsoluteLengths",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/background-size"
  },
  "baseline-shift": {
    "syntax": "<length-percentage> | sub | super | baseline",
    "media": "none",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "referToTheUsedValueOfLineHeight",
    "groups": [
      "CSS Inline"
    ],
    "initial": "0",
    "appliesto": "inlineLevelBoxesAndSVGTextContentElements",
    "computed": "theSpecifiedKeywordOrAComputedLengthPercentageValue",
    "order": "perGrammar",
    "status": "standard"
  },
  "baseline-source": {
    "syntax": "auto | first | last",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Inline"
    ],
    "initial": "auto",
    "appliesto": "inlineLevelBoxes",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/baseline-source"
  },
  "block-size": {
    "syntax": "<'width'>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "blockSizeOfContainingBlock",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "auto",
    "appliesto": "sameAsWidthAndHeight",
    "computed": "sameAsWidthAndHeight",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/block-size"
  },
  "border": {
    "syntax": "<line-width> || <line-style> || <color>",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "border-width",
      "border-style",
      "border-color"
    ],
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": [
      "border-width",
      "border-style",
      "border-color"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-width",
      "border-style",
      "border-color"
    ],
    "order": "orderOfAppearance",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border"
  },
  "border-block": {
    "syntax": "<'border-top'>",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "border-block-width",
      "border-block-style",
      "border-block-color"
    ],
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": [
      "border-block-width",
      "border-block-style",
      "border-block-color"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-block-width",
      "border-block-style",
      "border-block-color"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-block"
  },
  "border-block-color": {
    "syntax": "<'border-top-color'>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "border-block-start-color",
      "border-block-end-color"
    ],
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": [
      "border-block-start-color",
      "border-block-end-color"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-block-start-color",
      "border-block-end-color"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-block-color"
  },
  "border-block-end": {
    "syntax": "<'border-top'>",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "border-block-end-width",
      "border-block-end-style",
      "border-block-end-color"
    ],
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": [
      "border-block-end-width",
      "border-block-end-style",
      "border-block-end-color"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-block-end-width",
      "border-block-end-style",
      "border-block-end-color"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-block-end"
  },
  "border-block-end-color": {
    "syntax": "<'border-top-color'>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "currentcolor",
    "appliesto": "allElements",
    "computed": "computedColor",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-block-end-color"
  },
  "border-block-end-style": {
    "syntax": "<'border-top-style'>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-block-end-style"
  },
  "border-block-end-width": {
    "syntax": "<'border-top-width'>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "medium",
    "appliesto": "allElements",
    "computed": "absoluteLengthSnappedAsLineWidth",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-block-end-width"
  },
  "border-block-start": {
    "syntax": "<'border-top'>",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "border-block-start-width",
      "border-block-start-style",
      "border-block-start-color"
    ],
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": [
      "border-block-start-width",
      "border-block-start-style",
      "border-block-start-color"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-block-start-width",
      "border-block-start-style",
      "border-block-start-color"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-block-start"
  },
  "border-block-start-color": {
    "syntax": "<'border-top-color'>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "currentcolor",
    "appliesto": "allElements",
    "computed": "computedColor",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-block-start-color"
  },
  "border-block-start-style": {
    "syntax": "<'border-top-style'>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-block-start-style"
  },
  "border-block-start-width": {
    "syntax": "<'border-top-width'>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "medium",
    "appliesto": "allElements",
    "computed": "absoluteLengthSnappedAsLineWidth",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-block-start-width"
  },
  "border-block-style": {
    "syntax": "<'border-top-style'>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": [
      "border-block-start-style",
      "border-block-end-style"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-block-start-style",
      "border-block-end-style"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-block-style"
  },
  "border-block-width": {
    "syntax": "<'border-top-width'>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "border-block-start-width",
      "border-block-end-width"
    ],
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": [
      "border-block-start-width",
      "border-block-end-width"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-block-start-width",
      "border-block-end-width"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-block-width"
  },
  "border-bottom": {
    "syntax": "<line-width> || <line-style> || <color>",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "border-bottom-width",
      "border-bottom-style",
      "border-bottom-color"
    ],
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": [
      "border-bottom-width",
      "border-bottom-style",
      "border-bottom-color"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-bottom-width",
      "border-bottom-style",
      "border-bottom-color"
    ],
    "order": "orderOfAppearance",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-bottom"
  },
  "border-bottom-color": {
    "syntax": "<'border-top-color'>",
    "media": "visual",
    "inherited": false,
    "animationType": "color",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "currentcolor",
    "appliesto": "allElements",
    "computed": "computedColor",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-bottom-color"
  },
  "border-bottom-left-radius": {
    "syntax": "<length-percentage [0,∞]>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToDimensionOfBorderBox",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "0",
    "appliesto": "allElementsUAsNotRequiredWhenCollapse",
    "computed": "twoAbsoluteLengthOrPercentages",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-bottom-left-radius"
  },
  "border-bottom-right-radius": {
    "syntax": "<length-percentage [0,∞]>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToDimensionOfBorderBox",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "0",
    "appliesto": "allElementsUAsNotRequiredWhenCollapse",
    "computed": "twoAbsoluteLengthOrPercentages",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-bottom-right-radius"
  },
  "border-bottom-style": {
    "syntax": "<line-style>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-bottom-style"
  },
  "border-bottom-width": {
    "syntax": "<line-width>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "medium",
    "appliesto": "allElements",
    "computed": "absoluteLengthSnappedAsLineWidth",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-bottom-width"
  },
  "border-collapse": {
    "syntax": "separate | collapse",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Table"
    ],
    "initial": "separate",
    "appliesto": "tableElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-collapse"
  },
  "border-color": {
    "syntax": "<color>{1,4}",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "border-top-color",
      "border-right-color",
      "border-bottom-color",
      "border-left-color"
    ],
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": [
      "border-top-color",
      "border-right-color",
      "border-bottom-color",
      "border-left-color"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-top-color",
      "border-right-color",
      "border-bottom-color",
      "border-left-color"
    ],
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-color"
  },
  "border-end-end-radius": {
    "syntax": "<'border-top-left-radius'>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToDimensionOfBorderBox",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "0",
    "appliesto": "allElementsUAsNotRequiredWhenCollapse",
    "computed": "twoAbsoluteLengthOrPercentages",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-end-end-radius"
  },
  "border-end-start-radius": {
    "syntax": "<'border-top-left-radius'>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToDimensionOfBorderBox",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "0",
    "appliesto": "allElementsUAsNotRequiredWhenCollapse",
    "computed": "twoAbsoluteLengthOrPercentages",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-end-start-radius"
  },
  "border-image": {
    "syntax": "<'border-image-source'> || <'border-image-slice'> [ / <'border-image-width'> | / <'border-image-width'>? / <'border-image-outset'> ]? || <'border-image-repeat'>",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "border-image-source",
      "border-image-slice",
      "border-image-width",
      "border-image-outset",
      "border-image-repeat"
    ],
    "percentages": [
      "border-image-slice",
      "border-image-width"
    ],
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": [
      "border-image-source",
      "border-image-slice",
      "border-image-width",
      "border-image-outset",
      "border-image-repeat"
    ],
    "appliesto": "allElementsExceptTableElementsWhenCollapse",
    "computed": [
      "border-image-source",
      "border-image-slice",
      "border-image-width",
      "border-image-outset",
      "border-image-repeat"
    ],
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-image"
  },
  "border-image-outset": {
    "syntax": "[ <length [0,∞]> | <number [0,∞]> ]{1,4}",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "0",
    "appliesto": "allElementsExceptTableElementsWhenCollapse",
    "computed": "asSpecifiedRelativeToAbsoluteLengths",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-image-outset"
  },
  "border-image-repeat": {
    "syntax": "[ stretch | repeat | round | space ]{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "stretch",
    "appliesto": "allElementsExceptTableElementsWhenCollapse",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-image-repeat"
  },
  "border-image-slice": {
    "syntax": "[ <number [0,∞]> | <percentage [0,∞]> ]{1,4} && fill?",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "referToSizeOfBorderImage",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "100%",
    "appliesto": "allElementsExceptTableElementsWhenCollapse",
    "computed": "oneToFourPercentagesOrAbsoluteLengthsPlusFill",
    "order": "percentagesOrLengthsFollowedByFill",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-image-slice"
  },
  "border-image-source": {
    "syntax": "none | <image>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "none",
    "appliesto": "allElementsExceptTableElementsWhenCollapse",
    "computed": "noneOrImageWithAbsoluteURI",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-image-source"
  },
  "border-image-width": {
    "syntax": "[ <length-percentage [0,∞]> | <number [0,∞]> | auto ]{1,4}",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "referToWidthOrHeightOfBorderImageArea",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "1",
    "appliesto": "allElementsExceptTableElementsWhenCollapse",
    "computed": "asSpecifiedRelativeToAbsoluteLengths",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-image-width"
  },
  "border-inline": {
    "syntax": "<'border-top'>",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "border-inline-width",
      "border-inline-style",
      "border-inline-color"
    ],
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": [
      "border-inline-width",
      "border-inline-style",
      "border-inline-color"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-inline-width",
      "border-inline-style",
      "border-inline-color"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-inline"
  },
  "border-inline-color": {
    "syntax": "<'border-top-color'>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "border-inline-start-color",
      "border-inline-end-color"
    ],
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": [
      "border-inline-start-color",
      "border-inline-end-color"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-inline-start-color",
      "border-inline-end-color"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-inline-color"
  },
  "border-inline-end": {
    "syntax": "<'border-top'>",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "border-inline-end-width",
      "border-inline-end-style",
      "border-inline-end-color"
    ],
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": [
      "border-inline-end-width",
      "border-inline-end-style",
      "border-inline-end-color"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-inline-end-width",
      "border-inline-end-style",
      "border-inline-end-color"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-inline-end"
  },
  "border-inline-end-color": {
    "syntax": "<'border-top-color'>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "currentcolor",
    "appliesto": "allElements",
    "computed": "computedColor",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-inline-end-color"
  },
  "border-inline-end-style": {
    "syntax": "<'border-top-style'>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-inline-end-style"
  },
  "border-inline-end-width": {
    "syntax": "<'border-top-width'>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "medium",
    "appliesto": "allElements",
    "computed": "absoluteLengthSnappedAsLineWidth",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-inline-end-width"
  },
  "border-inline-start": {
    "syntax": "<'border-top'>",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "border-inline-start-width",
      "border-inline-start-style",
      "border-inline-start-color"
    ],
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": [
      "border-inline-start-width",
      "border-inline-start-style",
      "border-inline-start-color"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-inline-start-width",
      "border-inline-start-style",
      "border-inline-start-color"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-inline-start"
  },
  "border-inline-start-color": {
    "syntax": "<'border-top-color'>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "currentcolor",
    "appliesto": "allElements",
    "computed": "computedColor",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-inline-start-color"
  },
  "border-inline-start-style": {
    "syntax": "<'border-top-style'>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-inline-start-style"
  },
  "border-inline-start-width": {
    "syntax": "<'border-top-width'>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "medium",
    "appliesto": "allElements",
    "computed": "absoluteLengthSnappedAsLineWidth",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-inline-start-width"
  },
  "border-inline-style": {
    "syntax": "<'border-top-style'>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": [
      "border-inline-start-style",
      "border-inline-end-style"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-inline-start-style",
      "border-inline-end-style"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-inline-style"
  },
  "border-inline-width": {
    "syntax": "<'border-top-width'>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "border-inline-start-width",
      "border-inline-end-width"
    ],
    "percentages": "no",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": [
      "border-inline-start-width",
      "border-inline-end-width"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-inline-start-width",
      "border-inline-end-width"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-inline-width"
  },
  "border-left": {
    "syntax": "<line-width> || <line-style> || <color>",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "border-left-width",
      "border-left-style",
      "border-left-color"
    ],
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": [
      "border-left-width",
      "border-left-style",
      "border-left-color"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-left-width",
      "border-left-style",
      "border-left-color"
    ],
    "order": "orderOfAppearance",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-left"
  },
  "border-left-color": {
    "syntax": "<color>",
    "media": "visual",
    "inherited": false,
    "animationType": "color",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "currentcolor",
    "appliesto": "allElements",
    "computed": "computedColor",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-left-color"
  },
  "border-left-style": {
    "syntax": "<line-style>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-left-style"
  },
  "border-left-width": {
    "syntax": "<line-width>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "medium",
    "appliesto": "allElements",
    "computed": "absoluteLengthSnappedAsLineWidth",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-left-width"
  },
  "border-radius": {
    "syntax": "<length-percentage [0,∞]>{1,4} [ / <length-percentage [0,∞]>{1,4} ]?",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "border-top-left-radius",
      "border-top-right-radius",
      "border-bottom-right-radius",
      "border-bottom-left-radius"
    ],
    "percentages": "referToDimensionOfBorderBox",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": [
      "border-top-left-radius",
      "border-top-right-radius",
      "border-bottom-right-radius",
      "border-bottom-left-radius"
    ],
    "appliesto": "allElementsUAsNotRequiredWhenCollapse",
    "computed": [
      "border-top-left-radius",
      "border-top-right-radius",
      "border-bottom-right-radius",
      "border-bottom-left-radius"
    ],
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-radius"
  },
  "border-right": {
    "syntax": "<line-width> || <line-style> || <color>",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "border-right-width",
      "border-right-style",
      "border-right-color"
    ],
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": [
      "border-right-width",
      "border-right-style",
      "border-right-color"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-right-width",
      "border-right-style",
      "border-right-color"
    ],
    "order": "orderOfAppearance",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-right"
  },
  "border-right-color": {
    "syntax": "<color>",
    "media": "visual",
    "inherited": false,
    "animationType": "color",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "currentcolor",
    "appliesto": "allElements",
    "computed": "computedColor",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-right-color"
  },
  "border-right-style": {
    "syntax": "<line-style>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-right-style"
  },
  "border-right-width": {
    "syntax": "<line-width>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "medium",
    "appliesto": "allElements",
    "computed": "absoluteLengthSnappedAsLineWidth",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-right-width"
  },
  "border-shape": {
    "syntax": "none | [ <basic-shape> <geometry-box>?]{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-shape"
  },
  "border-spacing": {
    "syntax": "<length>{1,2}",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Table"
    ],
    "initial": "0",
    "appliesto": "tableElements",
    "computed": "twoAbsoluteLengths",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-spacing"
  },
  "border-start-end-radius": {
    "syntax": "<'border-top-left-radius'>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToDimensionOfBorderBox",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "0",
    "appliesto": "allElementsUAsNotRequiredWhenCollapse",
    "computed": "twoAbsoluteLengthOrPercentages",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-start-end-radius"
  },
  "border-start-start-radius": {
    "syntax": "<'border-top-left-radius'>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToDimensionOfBorderBox",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "0",
    "appliesto": "allElementsUAsNotRequiredWhenCollapse",
    "computed": "twoAbsoluteLengthOrPercentages",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-start-start-radius"
  },
  "border-style": {
    "syntax": "<line-style>{1,4}",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": [
      "border-top-style",
      "border-right-style",
      "border-bottom-style",
      "border-left-style"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-top-style",
      "border-right-style",
      "border-bottom-style",
      "border-left-style"
    ],
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-style"
  },
  "border-top": {
    "syntax": "<line-width> || <line-style> || <color>",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "border-top-width",
      "border-top-style",
      "border-top-color"
    ],
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": [
      "border-top-width",
      "border-top-style",
      "border-top-color"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-top-width",
      "border-top-style",
      "border-top-color"
    ],
    "order": "orderOfAppearance",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-top"
  },
  "border-top-color": {
    "syntax": "<color>",
    "media": "visual",
    "inherited": false,
    "animationType": "color",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "currentcolor",
    "appliesto": "allElements",
    "computed": "computedColor",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-top-color"
  },
  "border-top-left-radius": {
    "syntax": "<length-percentage [0,∞]>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToDimensionOfBorderBox",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "0",
    "appliesto": "allElementsUAsNotRequiredWhenCollapse",
    "computed": "twoAbsoluteLengthOrPercentages",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-top-left-radius"
  },
  "border-top-right-radius": {
    "syntax": "<length-percentage [0,∞]>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToDimensionOfBorderBox",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "0",
    "appliesto": "allElementsUAsNotRequiredWhenCollapse",
    "computed": "twoAbsoluteLengthOrPercentages",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-top-right-radius"
  },
  "border-top-style": {
    "syntax": "<line-style>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-top-style"
  },
  "border-top-width": {
    "syntax": "<line-width>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "medium",
    "appliesto": "allElements",
    "computed": "absoluteLengthSnappedAsLineWidth",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-top-width"
  },
  "border-width": {
    "syntax": "<line-width>{1,4}",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "border-top-width",
      "border-right-width",
      "border-bottom-width",
      "border-left-width"
    ],
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": [
      "border-top-width",
      "border-right-width",
      "border-bottom-width",
      "border-left-width"
    ],
    "appliesto": "allElements",
    "computed": [
      "border-top-width",
      "border-right-width",
      "border-bottom-width",
      "border-left-width"
    ],
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/border-width"
  },
  "bottom": {
    "syntax": "auto | <length-percentage> | <anchor()> | <anchor-size()>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToContainingBlockHeight",
    "groups": [
      "CSS Anchor Positioning",
      "CSS Positioned Layout"
    ],
    "initial": "auto",
    "appliesto": "positionedElements",
    "computed": "lengthAbsolutePercentageAsSpecifiedOtherwiseAuto",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/bottom"
  },
  "box-align": {
    "syntax": "start | center | end | baseline | stretch",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions",
      "WebKit Extensions"
    ],
    "initial": "stretch",
    "appliesto": "elementsWithDisplayBoxOrInlineBox",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/box-align"
  },
  "box-decoration-break": {
    "syntax": "slice | clone",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Fragmentation"
    ],
    "initial": "slice",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/box-decoration-break"
  },
  "box-direction": {
    "syntax": "normal | reverse | inherit",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions",
      "WebKit Extensions"
    ],
    "initial": "normal",
    "appliesto": "elementsWithDisplayBoxOrInlineBox",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/box-direction"
  },
  "box-flex": {
    "syntax": "<number>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions",
      "WebKit Extensions"
    ],
    "initial": "0",
    "appliesto": "directChildrenOfElementsWithDisplayMozBoxMozInlineBox",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/box-flex"
  },
  "box-flex-group": {
    "syntax": "<integer>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions",
      "WebKit Extensions"
    ],
    "initial": "1",
    "appliesto": "inFlowChildrenOfBoxElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/box-flex-group"
  },
  "box-lines": {
    "syntax": "single | multiple",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions",
      "WebKit Extensions"
    ],
    "initial": "single",
    "appliesto": "boxElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/box-lines"
  },
  "box-ordinal-group": {
    "syntax": "<integer>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions",
      "WebKit Extensions"
    ],
    "initial": "1",
    "appliesto": "childrenOfBoxElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/box-ordinal-group"
  },
  "box-orient": {
    "syntax": "horizontal | vertical | inline-axis | block-axis | inherit",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions",
      "WebKit Extensions"
    ],
    "initial": "inline-axis",
    "appliesto": "elementsWithDisplayBoxOrInlineBox",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/box-orient"
  },
  "box-pack": {
    "syntax": "start | center | end | justify",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions",
      "WebKit Extensions"
    ],
    "initial": "start",
    "appliesto": "elementsWithDisplayMozBoxMozInlineBox",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/box-pack"
  },
  "box-shadow": {
    "syntax": "none | <shadow>#",
    "media": "visual",
    "inherited": false,
    "animationType": "shadowList",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "absoluteLengthsSpecifiedColorAsSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/box-shadow"
  },
  "box-sizing": {
    "syntax": "content-box | border-box",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Box Sizing"
    ],
    "initial": "content-box",
    "appliesto": "allElementsAcceptingWidthOrHeight",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/box-sizing"
  },
  "break-after": {
    "syntax": "auto | avoid | always | all | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Fragmentation"
    ],
    "initial": "auto",
    "appliesto": "blockLevelElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/break-after"
  },
  "break-before": {
    "syntax": "auto | avoid | always | all | avoid-page | page | left | right | recto | verso | avoid-column | column | avoid-region | region",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Fragmentation"
    ],
    "initial": "auto",
    "appliesto": "blockLevelElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/break-before"
  },
  "break-inside": {
    "syntax": "auto | avoid | avoid-page | avoid-column | avoid-region",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Fragmentation"
    ],
    "initial": "auto",
    "appliesto": "blockLevelElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/break-inside"
  },
  "caption-side": {
    "syntax": "top | bottom",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Table"
    ],
    "initial": "top",
    "appliesto": "tableCaptionElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/caption-side"
  },
  "caret": {
    "syntax": "<'caret-color'> || <'caret-animation'> || <'caret-shape'>",
    "media": "interactive",
    "inherited": true,
    "animationType": [
      "caret-color",
      "caret-animation",
      "caret-shape"
    ],
    "percentages": "no",
    "groups": [
      "CSS Basic User Interface"
    ],
    "initial": [
      "caret-color",
      "caret-animation",
      "caret-shape"
    ],
    "appliesto": "textOrElementsThatAcceptInput",
    "computed": [
      "caret-color",
      "caret-animation",
      "caret-shape"
    ],
    "order": "perGrammar",
    "status": "standard"
  },
  "caret-animation": {
    "syntax": "auto | manual",
    "media": "interactive",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Basic User Interface"
    ],
    "initial": "auto",
    "appliesto": "textOrElementsThatAcceptInput",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/caret-animation"
  },
  "caret-color": {
    "syntax": "auto | <color>",
    "media": "interactive",
    "inherited": true,
    "animationType": "color",
    "percentages": "no",
    "groups": [
      "CSS Basic User Interface"
    ],
    "initial": "auto",
    "appliesto": "textOrElementsThatAcceptInput",
    "computed": "asAutoOrColor",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/caret-color"
  },
  "caret-shape": {
    "syntax": "auto | bar | block | underscore",
    "media": "interactive",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Basic User Interface"
    ],
    "initial": "auto",
    "appliesto": "textOrElementsThatAcceptInput",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard"
  },
  "clear": {
    "syntax": "none | left | right | both | inline-start | inline-end",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Positioned Layout"
    ],
    "initial": "none",
    "appliesto": "blockLevelElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/clear"
  },
  "clip": {
    "syntax": "<shape> | auto",
    "media": "visual",
    "inherited": false,
    "animationType": "rectangle",
    "percentages": "no",
    "groups": [
      "CSS Masking"
    ],
    "initial": "auto",
    "appliesto": "absolutelyPositionedElements",
    "computed": "autoOrRectangle",
    "order": "uniqueOrder",
    "status": "obsolete",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/clip"
  },
  "clip-path": {
    "syntax": "<clip-source> | [ <basic-shape> || <geometry-box> ] | none",
    "media": "visual",
    "inherited": false,
    "animationType": "basicShapeOtherwiseNo",
    "percentages": "referToReferenceBoxWhenSpecifiedOtherwiseBorderBox",
    "groups": [
      "CSS Masking"
    ],
    "initial": "none",
    "appliesto": "allElementsSVGContainerElements",
    "computed": "asSpecifiedURLsAbsolute",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/clip-path"
  },
  "clip-rule": {
    "syntax": "nonzero | evenodd",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Masking"
    ],
    "initial": "nonzero",
    "appliesto": "limitedSVGElementsGraphics",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/clip-rule"
  },
  "color": {
    "syntax": "<color>",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Color"
    ],
    "initial": "canvastext",
    "appliesto": "allElementsAndText",
    "computed": "computedColor",
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color"
  },
  "color-interpolation-filters": {
    "syntax": "auto | sRGB | linearRGB",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Filter Effects"
    ],
    "initial": "linearRGB",
    "appliesto": "limitedSVGElementsFilterPrimitives",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color-interpolation-filters"
  },
  "color-scheme": {
    "syntax": "normal | [ light | dark | <custom-ident> ]+ && only?",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Color"
    ],
    "initial": "normal",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color-scheme"
  },
  "column-count": {
    "syntax": "<integer> | auto",
    "media": "visual",
    "inherited": false,
    "animationType": "integer",
    "percentages": "no",
    "groups": [
      "CSS Multi-column Layout"
    ],
    "initial": "auto",
    "appliesto": "blockContainersExceptTableWrappers",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/column-count"
  },
  "column-fill": {
    "syntax": "auto | balance",
    "media": "visualInContinuousMediaNoEffectInOverflowColumns",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Multi-column Layout"
    ],
    "initial": "balance",
    "appliesto": "multicolElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/column-fill"
  },
  "column-gap": {
    "syntax": "normal | <length-percentage>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToDimensionOfContentArea",
    "groups": [
      "CSS Box Alignment",
      "CSS Multi-column Layout"
    ],
    "initial": "normal",
    "appliesto": "multiColumnElementsFlexContainersGridContainers",
    "computed": "asSpecifiedWithLengthsAbsoluteAndNormalComputingToZeroExceptMultiColumn",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/column-gap"
  },
  "column-height": {
    "syntax": "auto | <length [0,∞]>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Box Sizing",
      "CSS Multi-column Layout"
    ],
    "initial": "auto",
    "appliesto": "blockContainersExceptTableWrappers",
    "computed": "autoOrAbsoluteLength",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/column-height"
  },
  "column-rule": {
    "syntax": "<'column-rule-width'> || <'column-rule-style'> || <'column-rule-color'>",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "column-rule-width",
      "column-rule-style",
      "column-rule-color"
    ],
    "percentages": "no",
    "groups": [
      "CSS Multi-column Layout"
    ],
    "initial": [
      "column-rule-width",
      "column-rule-style",
      "column-rule-color"
    ],
    "appliesto": "multicolElements",
    "computed": [
      "column-rule-width",
      "column-rule-style",
      "column-rule-color"
    ],
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/column-rule"
  },
  "column-rule-color": {
    "syntax": "<color>",
    "media": "visual",
    "inherited": false,
    "animationType": "color",
    "percentages": "no",
    "groups": [
      "CSS Multi-column Layout"
    ],
    "initial": "currentcolor",
    "appliesto": "multicolElements",
    "computed": "computedColor",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/column-rule-color"
  },
  "column-rule-style": {
    "syntax": "<line-style>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Multi-column Layout"
    ],
    "initial": "none",
    "appliesto": "multicolElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/column-rule-style"
  },
  "column-rule-width": {
    "syntax": "<line-width>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "no",
    "groups": [
      "CSS Multi-column Layout"
    ],
    "initial": "medium",
    "appliesto": "multicolElements",
    "computed": "absoluteLengthSnappedAsLineWidth",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/column-rule-width"
  },
  "column-span": {
    "syntax": "none | all",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Multi-column Layout"
    ],
    "initial": "none",
    "appliesto": "inFlowBlockLevelElements",
    "computed": "asSpecified",
       "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/column-span"
  },
  "column-width": {
    "syntax": "auto | <length [0,∞]>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Box Sizing",
      "CSS Multi-column Layout"
    ],
    "initial": "auto",
    "appliesto": "blockContainersExceptTableWrappers",
    "computed": "autoOrAbsoluteLength",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/column-width"
  },
  "column-wrap": {
    "syntax": "auto | nowrap | wrap",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Box Sizing",
      "CSS Multi-column Layout"
    ],
    "initial": "auto",
    "appliesto": "multicolElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/column-wrap"
  },
  "columns": {
    "syntax": "[ <'column-width'> || <'column-count'> ] [ / <'column-height'> ]?",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "column-width",
      "column-count",
      "column-height"
    ],
    "percentages": "no",
    "groups": [
      "CSS Multi-column Layout"
    ],
    "initial": [
      "column-width",
      "column-count",
      "column-height"
    ],
    "appliesto": "blockContainersExceptTableWrappers",
    "computed": [
      "column-width",
      "column-count",
      "column-height"
    ],
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/columns"
  },
  "contain": {
    "syntax": "none | strict | content | [ [ size || inline-size ] || layout || style || paint ]",
    "media": "all",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Containment"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/contain"
  },
  "contain-intrinsic-block-size": {
    "syntax": "auto? [ none | <length> ]",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Box Sizing"
    ],
    "initial": "none",
    "appliesto": "elementsForWhichSizeContainmentCanApply",
    "computed": "asSpecifiedWithLengthValuesComputed",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-block-size"
  },
  "contain-intrinsic-height": {
    "syntax": "auto? [ none | <length> ]",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Box Sizing"
    ],
    "initial": "none",
    "appliesto": "elementsForWhichSizeContainmentCanApply",
    "computed": "asSpecifiedWithLengthValuesComputed",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-height"
  },
  "contain-intrinsic-inline-size": {
    "syntax": "auto? [ none | <length> ]",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Box Sizing"
    ],
    "initial": "none",
    "appliesto": "elementsForWhichSizeContainmentCanApply",
    "computed": "asSpecifiedWithLengthValuesComputed",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-inline-size"
  },
  "contain-intrinsic-size": {
    "syntax": "[ auto? [ none | <length> ] ]{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "contain-intrinsic-width",
      "contain-intrinsic-height"
    ],
    "percentages": [
      "contain-intrinsic-width",
      "contain-intrinsic-height"
    ],
    "groups": [
      "CSS Box Sizing"
    ],
    "initial": [
      "contain-intrinsic-width",
      "contain-intrinsic-height"
    ],
    "appliesto": "elementsForWhichSizeContainmentCanApply",
    "computed": [
      "contain-intrinsic-width",
      "contain-intrinsic-height"
    ],
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-size"
  },
  "contain-intrinsic-width": {
    "syntax": "auto? [ none | <length> ]",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Box Sizing"
    ],
    "initial": "none",
    "appliesto": "elementsForWhichSizeContainmentCanApply",
    "computed": "asSpecifiedWithLengthValuesComputed",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/contain-intrinsic-width"
  },
  "container": {
    "syntax": "<'container-name'> [ / <'container-type'> ]?",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "container-name",
      "container-type"
    ],
    "percentages": [
      "container-name",
      "container-type"
    ],
    "groups": [
      "CSS Conditional Rules"
    ],
    "initial": [
      "container-name",
      "container-type"
    ],
    "appliesto": "allElements",
    "computed": [
      "container-name",
      "container-type"
    ],
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/container"
  },
  "container-name": {
    "syntax": "none | <custom-ident>+",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Conditional Rules"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "noneOrOrderedListOfIdentifiers",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/container-name"
  },
  "container-type": {
    "syntax": "normal | [ [ size | inline-size ] || scroll-state ]",
    "media": "visual",
    "inherited": false,
    "animationType": "color",
    "percentages": "no",
    "groups": [
      "CSS Conditional Rules"
    ],
    "initial": "normal",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/container-type"
  },
  "content": {
    "syntax": "normal | none | [ <content-replacement> | <content-list> ] [ / [ <string> | <counter> | <attr()> ]+ ]?",
    "media": "all",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Generated Content"
    ],
    "initial": "normal",
    "appliesto": "allElementsTreeAbidingPseudoElementsPageMarginBoxes",
    "computed": "normalOnElementsForPseudosNoneAbsoluteURIStringOrAsSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/content"
  },
  "content-visibility": {
    "syntax": "visible | auto | hidden",
    "media": "all",
    "inherited": false,
    "animationType": "discreteButVisibleForDurationWhenAnimatedHidden",
    "percentages": "no",
    "groups": [
      "CSS Containment"
    ],
    "initial": "visible",
    "appliesto": "elementsForWhichSizeContainmentCanApply",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/content-visibility"
  },
  "corner-block-end-shape": {
    "syntax": "<corner-shape-value>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "corner-end-start-shape",
      "corner-end-end-shape"
    ],
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": [
      "corner-end-start-shape",
      "corner-end-end-shape"
    ],
    "appliesto": "allElements",
    "computed": [
      "corner-end-start-shape",
      "corner-end-end-shape"
    ],
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/corner-block-end-shape"
  },
  "corner-block-start-shape": {
    "syntax": "<corner-shape-value>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "corner-start-start-shape",
      "corner-start-end-shape"
    ],
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": [
      "corner-start-start-shape",
      "corner-start-end-shape"
    ],
    "appliesto": "allElements",
    "computed": [
      "corner-start-start-shape",
      "corner-start-end-shape"
    ],
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/corner-block-start-shape"
  },
  "corner-bottom-shape": {
    "syntax": "<corner-shape-value>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "corner-bottom-left-shape",
      "corner-bottom-right-shape"
    ],
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": [
      "corner-bottom-left-shape",
      "corner-bottom-right-shape"
    ],
    "appliesto": "allElements",
    "computed": [
      "corner-bottom-left-shape",
      "corner-bottom-right-shape"
    ],
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/corner-bottom-shape"
  },
  "corner-bottom-left-shape": {
    "syntax": "<corner-shape-value>",
    "media": "visual",
    "inherited": false,
    "animationType": "superellipseInterpolation",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "round",
    "appliesto": "allElements",
    "computed": "correspondingSuperellipse",
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/corner-bottom-left-shape"
  },
  "corner-bottom-right-shape": {
    "syntax": "<corner-shape-value>",
    "media": "visual",
    "inherited": false,
    "animationType": "superellipseInterpolation",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "round",
    "appliesto": "allElements",
    "computed": "correspondingSuperellipse",
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/corner-bottom-right-shape"
  },
  "corner-end-end-shape": {
    "syntax": "<corner-shape-value>",
    "media": "visual",
    "inherited": false,
    "animationType": "superellipseInterpolation",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "round",
    "appliesto": "allElements",
    "computed": "correspondingSuperellipse",
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/corner-end-end-shape"
  },
  "corner-end-start-shape": {
    "syntax": "<corner-shape-value>",
    "media": "visual",
    "inherited": false,
    "animationType": "superellipseInterpolation",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "round",
    "appliesto": "allElements",
    "computed": "correspondingSuperellipse",
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/corner-end-start-shape"
  },
  "corner-inline-end-shape": {
    "syntax": "<corner-shape-value>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "corner-start-end-shape",
      "corner-end-end-shape"
    ],
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": [
      "corner-start-end-shape",
      "corner-end-end-shape"
    ],
    "appliesto": "allElements",
    "computed": [
      "corner-start-end-shape",
      "corner-end-end-shape"
    ],
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/corner-inline-end-shape"
  },
  "corner-inline-start-shape": {
    "syntax": "<corner-shape-value>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "corner-start-start-shape",
      "corner-start-end-shape"
    ],
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": [
      "corner-start-start-shape",
      "corner-start-end-shape"
    ],
    "appliesto": "allElements",
    "computed": [
      "corner-start-start-shape",
      "corner-start-end-shape"
    ],
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/corner-inline-start-shape"
  },
  "corner-left-shape": {
    "syntax": "<corner-shape-value>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "corner-top-left-shape",
      "corner-bottom-left-shape"
    ],
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": [
      "corner-top-left-shape",
      "corner-bottom-left-shape"
    ],
    "appliesto": "allElements",
    "computed": [
      "corner-top-left-shape",
      "corner-bottom-left-shape"
    ],
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/corner-left-shape"
  },
  "corner-right-shape": {
    "syntax": "<corner-shape-value>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "corner-top-right-shape",
      "corner-bottom-right-shape"
    ],
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": [
      "corner-top-right-shape",
      "corner-bottom-right-shape"
    ],
    "appliesto": "allElements",
    "computed": [
      "corner-top-right-shape",
      "corner-bottom-right-shape"
    ],
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/corner-right-shape"
  },
  "corner-shape": {
    "syntax": "<corner-shape-value>{1,4}",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "corner-top-left-shape",
      "corner-top-right-shape",
      "corner-bottom-left-shape",
      "corner-bottom-right-shape"
    ],
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": [
      "corner-top-left-shape",
      "corner-top-right-shape",
      "corner-bottom-left-shape",
      "corner-bottom-right-shape"
    ],
    "appliesto": "allElements",
    "computed": [
      "corner-top-left-shape",
      "corner-top-right-shape",
      "corner-bottom-left-shape",
      "corner-bottom-right-shape"
    ],
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/corner-shape"
  },
  "corner-start-start-shape": {
    "syntax": "<corner-shape-value>",
    "media": "visual",
    "inherited": false,
    "animationType": "superellipseInterpolation",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "round",
    "appliesto": "allElements",
    "computed": "correspondingSuperellipse",
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/corner-start-start-shape"
  },
  "corner-start-end-shape": {
    "syntax": "<corner-shape-value>",
    "media": "visual",
    "inherited": false,
    "animationType": "superellipseInterpolation",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "round",
    "appliesto": "allElements",
    "computed": "correspondingSuperellipse",
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/corner-start-end-shape"
  },
  "corner-top-shape": {
    "syntax": "<corner-shape-value>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "corner-top-left-shape",
      "corner-top-right-shape"
    ],
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": [
      "corner-top-left-shape",
      "corner-top-right-shape"
    ],
    "appliesto": "allElements",
    "computed": [
      "corner-top-left-shape",
      "corner-top-right-shape"
    ],
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/corner-top-shape"
  },
  "corner-top-left-shape": {
    "syntax": "<corner-shape-value>",
    "media": "visual",
    "inherited": false,
    "animationType": "superellipseInterpolation",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "round",
    "appliesto": "allElements",
    "computed": "correspondingSuperellipse",
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/corner-top-left-shape"
  },
  "corner-top-right-shape": {
    "syntax": "<corner-shape-value>",
    "media": "visual",
    "inherited": false,
    "animationType": "superellipseInterpolation",
    "percentages": "no",
    "groups": [
      "CSS Backgrounds and Borders"
    ],
    "initial": "round",
    "appliesto": "allElements",
    "computed": "correspondingSuperellipse",
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/corner-top-right-shape"
  },
  "counter-increment": {
    "syntax": "[ <counter-name> <integer>? ]+ | none",
    "media": "all",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Lists and Counters"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/counter-increment"
  },
  "counter-reset": {
    "syntax": "[ <counter-name> <integer>? | <reversed-counter-name> <integer>? ]+ | none",
    "media": "all",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Lists and Counters"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/counter-reset"
  },
  "counter-set": {
    "syntax": "[ <counter-name> <integer>? ]+ | none",
    "media": "all",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Lists and Counters"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/counter-set"
  },
  "cursor": {
    "syntax": "[ [ <url> [ <x> <y> ]? , ]* <cursor-predefined> ]",
    "media": [
      "visual",
      "interactive"
    ],
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Basic User Interface"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "asSpecifiedURLsAbsolute",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/cursor"
  },
  "cx": {
    "syntax": "<length> | <percentage>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "referToSVGViewportWidth",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "0",
    "appliesto": "limitedSVGElementsEllipse",
    "computed": "percentageAsSpecifiedOrAbsoluteLength",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/cx"
  },
  "cy": {
    "syntax": "<length> | <percentage>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "referToSVGViewportHeight",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "0",
    "appliesto": "limitedSVGElementsEllipse",
    "computed": "percentageAsSpecifiedOrAbsoluteLength",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/cy"
  },
  "d": {
    "syntax": "none | path(<string>)",
    "media": "visual",
    "inherited": false,
    "animationType": "basicShapeOtherwiseNo",
    "percentages": "no",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "none",
    "appliesto": "limitedSVGElementsPath",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/d"
  },
  "direction": {
    "syntax": "ltr | rtl",
    "media": "visual",
    "inherited": true,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Writing Modes"
    ],
    "initial": "ltr",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/direction"
  },
  "display": {
    "syntax": "[ <display-outside> || <display-inside> ] | <display-listitem> | <display-internal> | <display-box> | <display-legacy>",
    "media": "all",
    "inherited": false,
    "animationType": "discreteButVisibleForDurationWhenAnimatedNone",
    "percentages": "no",
    "groups": [
      "CSS Display"
    ],
    "initial": "inline",
    "appliesto": "allElements",
    "computed": "asSpecifiedExceptPositionedFloatingAndRootElementsKeywordMaybeDifferent",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/display"
  },
  "dominant-baseline": {
    "syntax": "auto | text-bottom | alphabetic | ideographic | middle | central | mathematical | hanging | text-top",
    "media": "all",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Inline",
      "Scalable Vector Graphics"
    ],
    "initial": "auto",
    "appliesto": "blockContainersFlexContainersGridContainersInlineBoxesTableRowsSVGTextContentElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/dominant-baseline"
  },
  "dynamic-range-limit": {
    "syntax": "standard | no-limit | constrained | <dynamic-range-limit-mix()>",
    "media": "visual",
    "inherited": true,
    "animationType": "byDynamicRangeLimitMix",
    "percentages": "no",
    "groups": [
      "CSS Color"
    ],
    "initial": "no-limit",
    "appliesto": "allElements",
    "computed": "computedValueForDynamicRangeLimit",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/dynamic-range-limit"
  },
  "empty-cells": {
    "syntax": "show | hide",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Table"
    ],
    "initial": "show",
    "appliesto": "tableCellElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/empty-cells"
  },
  "field-sizing": {
    "syntax": "content | fixed",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Basic User Interface"
    ],
    "initial": "fixed",
    "appliesto": "elementsWithDefaultPreferredSize",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/field-sizing"
  },
  "fill": {
    "syntax": "<paint>",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "black",
    "appliesto": "limitedSVGElementsShapeText",
    "computed": "asColorOrAbsoluteURL",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/fill"
  },
  "fill-opacity": {
    "syntax": "<'opacity'>",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "mapToRange0To1",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "1",
    "appliesto": "limitedSVGElementsShapeText",
    "computed": "specifiedValueNumberClipped0To1",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/fill-opacity"
  },
  "fill-rule": {
    "syntax": "nonzero | evenodd",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "nonzero",
    "appliesto": "limitedSVGElementsShapeText",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/fill-rule"
  },
  "filter": {
    "syntax": "none | <filter-value-list>",
    "media": "visual",
    "inherited": false,
    "animationType": "filterList",
    "percentages": "no",
    "groups": [
      "Filter Effects"
    ],
    "initial": "none",
    "appliesto": "allElementsSVGContainerElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter"
  },
  "flex": {
    "syntax": "none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "flex-grow",
      "flex-shrink",
      "flex-basis"
    ],
    "percentages": "no",
    "groups": [
      "CSS Flexible Box Layout"
    ],
    "initial": [
      "flex-grow",
      "flex-shrink",
      "flex-basis"
    ],
    "appliesto": "flexItemsAndInFlowPseudos",
    "computed": [
      "flex-grow",
      "flex-shrink",
      "flex-basis"
    ],
    "order": "orderOfAppearance",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/flex"
  },
  "flex-basis": {
    "syntax": "content | <'width'>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToFlexContainersInnerMainSize",
    "groups": [
      "CSS Flexible Box Layout"
    ],
    "initial": "auto",
    "appliesto": "flexItemsAndInFlowPseudos",
    "computed": "asSpecifiedRelativeToAbsoluteLengths",
    "order": "lengthOrPercentageBeforeKeywordIfBothPresent",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/flex-basis"
  },
  "flex-direction": {
    "syntax": "row | row-reverse | column | column-reverse",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Flexible Box Layout"
    ],
    "initial": "row",
    "appliesto": "flexContainers",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/flex-direction"
  },
  "flex-flow": {
    "syntax": "<'flex-direction'> || <'flex-wrap'>",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "flex-direction",
      "flex-wrap"
    ],
    "percentages": "no",
    "groups": [
      "CSS Flexible Box Layout"
    ],
    "initial": [
      "flex-direction",
      "flex-wrap"
    ],
    "appliesto": "flexContainers",
    "computed": [
      "flex-direction",
      "flex-wrap"
    ],
    "order": "orderOfAppearance",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/flex-flow"
  },
  "flex-grow": {
    "syntax": "<number>",
    "media": "visual",
    "inherited": false,
    "animationType": "number",
    "percentages": "no",
    "groups": [
      "CSS Flexible Box Layout"
    ],
    "initial": "0",
    "appliesto": "flexItemsAndInFlowPseudos",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/flex-grow"
  },
  "flex-shrink": {
    "syntax": "<number>",
    "media": "visual",
    "inherited": false,
    "animationType": "number",
    "percentages": "no",
    "groups": [
      "CSS Flexible Box Layout"
    ],
    "initial": "1",
    "appliesto": "flexItemsAndInFlowPseudos",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/flex-shrink"
  },
  "flex-wrap": {
    "syntax": "nowrap | wrap | wrap-reverse",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Flexible Box Layout"
    ],
    "initial": "nowrap",
    "appliesto": "flexContainers",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/flex-wrap"
  },
  "float": {
    "syntax": "left | right | none | inline-start | inline-end",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Positioned Layout"
    ],
    "initial": "none",
    "appliesto": "allElementsNoEffectIfDisplayNone",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/float"
  },
  "flood-color": {
    "syntax": "<color>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValue",
    "percentages": "no",
    "groups": [
      "Filter Effects"
    ],
    "initial": "black",
    "appliesto": "limitedSVGElementsFloodAndDropShadow",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/flood-color"
  },
  "flood-opacity": {
    "syntax": "<'opacity'>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValue",
    "percentages": "no",
    "groups": [
      "Filter Effects"
    ],
    "initial": "black",
    "appliesto": "limitedSVGElementsFloodAndDropShadow",
    "computed": "specifiedValueClipped0To1",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/flood-opacity"
  },
  "font": {
    "syntax": "[ [ <'font-style'> || <font-variant-css2> || <'font-weight'> || <font-width-css3> ]? <'font-size'> [ / <'line-height'> ]? <'font-family'># ] | <system-family-name>",
    "media": "visual",
    "inherited": true,
    "animationType": [
      "font-style",
      "font-variant",
      "font-weight",
      "font-stretch",
      "font-size",
      "line-height",
      "font-family"
    ],
    "percentages": [
      "font-size",
      "line-height"
    ],
    "groups": [
      "CSS Fonts"
    ],
    "initial": [
      "font-style",
      "font-variant",
      "font-weight",
      "font-stretch",
      "font-size",
      "line-height",
      "font-family"
    ],
    "appliesto": "allElementsAndText",
    "computed": [
      "font-style",
      "font-variant",
      "font-weight",
      "font-stretch",
      "font-size",
      "line-height",
      "font-family"
    ],
    "order": "orderOfAppearance",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font"
  },
  "font-family": {
    "syntax": "[ <family-name> | <generic-family> ]#",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "dependsOnUserAgent",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-family"
  },
  "font-feature-settings": {
    "syntax": "normal | <feature-tag-value>#",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "normal",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-feature-settings"
  },
  "font-kerning": {
    "syntax": "auto | normal | none",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "auto",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-kerning"
  },
  "font-language-override": {
    "syntax": "normal | <string>",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "normal",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-language-override"
  },
  "font-optical-sizing": {
    "syntax": "auto | none",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "auto",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-optical-sizing"
  },
  "font-palette": {
    "syntax": "normal | light | dark | <palette-identifier> | <palette-mix()>",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValue",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "normal",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-palette"
  },
  "font-size": {
    "syntax": "<absolute-size> | <relative-size> | <length-percentage [0,∞]> | math",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "referToParentElementsFontSize",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "medium",
    "appliesto": "allElementsAndText",
    "computed": "absoluteLength",
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-size"
  },
  "font-size-adjust": {
    "syntax": "none | [ ex-height | cap-height | ch-width | ic-width | ic-height ]? [ from-font | <number> ]",
    "media": "visual",
    "inherited": true,
    "animationType": "number",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "none",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-size-adjust"
  },
  "font-smooth": {
    "syntax": "auto | never | always | <absolute-size> | <length>",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-smooth"
  },
  "font-stretch": {
    "syntax": "<font-stretch-absolute>",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "normal",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "obsolete",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-stretch"
  },
  "font-style": {
    "syntax": "normal | italic | oblique <angle>?",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueTypeNormalAnimatesAsObliqueZeroDeg",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "normal",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-style"
  },
  "font-synthesis": {
    "syntax": "none | [ weight || style || small-caps || position]",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "weight style small-caps position ",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "orderOfAppearance",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-synthesis"
  },
  "font-synthesis-position": {
    "syntax": "auto | none",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "none",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "orderOfAppearance",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-synthesis-position"
  },
  "font-synthesis-small-caps": {
    "syntax": "auto | none",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "auto",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "orderOfAppearance",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-synthesis-small-caps"
  },
  "font-synthesis-style": {
    "syntax": "auto | none",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "auto",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "orderOfAppearance",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-synthesis-style"
  },
  "font-synthesis-weight": {
    "syntax": "auto | none",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "auto",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "orderOfAppearance",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-synthesis-weight"
  },
  "font-variant": {
    "syntax": "normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> || stylistic( <feature-value-name> ) || historical-forms || styleset( <feature-value-name># ) || character-variant( <feature-value-name># ) || swash( <feature-value-name> ) || ornaments( <feature-value-name> ) || annotation( <feature-value-name> ) || [ small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps ] || <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero || <east-asian-variant-values> || <east-asian-width-values> || ruby ]",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "normal",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-variant"
  },
  "font-variant-alternates": {
    "syntax": "normal | [ stylistic( <feature-value-name> ) || historical-forms || styleset( <feature-value-name># ) || character-variant( <feature-value-name># ) || swash( <feature-value-name> ) || ornaments( <feature-value-name> ) || annotation( <feature-value-name> ) ]",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "normal",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "orderOfAppearance",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-variant-alternates"
  },
  "font-variant-caps": {
    "syntax": "normal | small-caps | all-small-caps | petite-caps | all-petite-caps | unicase | titling-caps",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "normal",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-variant-caps"
  },
  "font-variant-east-asian": {
    "syntax": "normal | [ <east-asian-variant-values> || <east-asian-width-values> || ruby ]",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "normal",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "orderOfAppearance",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-variant-east-asian"
  },
  "font-variant-emoji": {
    "syntax": "normal | text | emoji | unicode",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "normal",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-variant-emoji"
  },
  "font-variant-ligatures": {
    "syntax": "normal | none | [ <common-lig-values> || <discretionary-lig-values> || <historical-lig-values> || <contextual-alt-values> ]",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "normal",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "orderOfAppearance",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-variant-ligatures"
  },
  "font-variant-numeric": {
    "syntax": "normal | [ <numeric-figure-values> || <numeric-spacing-values> || <numeric-fraction-values> || ordinal || slashed-zero ]",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "normal",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "orderOfAppearance",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-variant-numeric"
  },
  "font-variant-position": {
    "syntax": "normal | sub | super",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "normal",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-variant-position"
  },
  "font-variation-settings": {
    "syntax": "normal | [ <string> <number> ]#",
    "media": "visual",
    "inherited": true,
    "animationType": "transform",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "normal",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-variation-settings"
  },
  "font-weight": {
    "syntax": "<font-weight-absolute> | bolder | lighter",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "normal",
    "appliesto": "allElementsAndText",
    "computed": "keywordOrNumericalValueBolderLighterTransformedToRealValue",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/font-weight"
  },
  "font-width": {
    "syntax": "normal | <percentage [0,∞]> | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Fonts"
    ],
    "initial": "normal",
    "appliesto": "allElementsAndText",
    "computed": "percentage",
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "experimental"
  },
  "forced-color-adjust": {
    "syntax": "auto | none | preserve-parent-color",
    "media": "visual",
    "inherited": true,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Color"
    ],
    "initial": "auto",
    "appliesto": "allElementsAndText",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/forced-color-adjust"
  },
  "frame-sizing": {
    "syntax": "auto | content-width | content-height | content-block-size | content-inline-size",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Box Sizing"
    ],
    "initial": "auto",
    "appliesto": "replacedElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/frame-sizing"
  },
  "gap": {
    "syntax": "<'row-gap'> <'column-gap'>?",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "row-gap",
      "column-gap"
    ],
    "percentages": "no",
    "groups": [
      "CSS Box Alignment"
    ],
    "initial": [
      "row-gap",
      "column-gap"
    ],
    "appliesto": "multiColumnElementsFlexContainersGridContainers",
    "computed": [
      "row-gap",
      "column-gap"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/gap"
  },
  "grid": {
    "syntax": "<'grid-template'> | <'grid-template-rows'> / [ auto-flow && dense? ] <'grid-auto-columns'>? | [ auto-flow && dense? ] <'grid-auto-rows'>? / <'grid-template-columns'>",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "grid-template-rows",
      "grid-template-columns",
      "grid-template-areas",
      "grid-auto-rows",
      "grid-auto-columns",
      "grid-auto-flow",
      "grid-column-gap",
      "grid-row-gap",
      "column-gap",
      "row-gap"
    ],
    "percentages": [
      "grid-template-rows",
      "grid-template-columns",
      "grid-auto-rows",
      "grid-auto-columns"
    ],
    "groups": [
      "CSS Grid Layout"
    ],
    "initial": [
      "grid-template-rows",
      "grid-template-columns",
      "grid-template-areas",
      "grid-auto-rows",
      "grid-auto-columns",
      "grid-auto-flow",
      "grid-column-gap",
      "grid-row-gap",
      "column-gap",
      "row-gap"
    ],
    "appliesto": "gridContainers",
    "computed": [
      "grid-template-rows",
      "grid-template-columns",
      "grid-template-areas",
      "grid-auto-rows",
      "grid-auto-columns",
      "grid-auto-flow",
      "grid-column-gap",
      "grid-row-gap",
      "column-gap",
      "row-gap"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/grid"
  },
  "grid-area": {
    "syntax": "<grid-line> [ / <grid-line> ]{0,3}",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Grid Layout"
    ],
    "initial": [
      "grid-row-start",
      "grid-column-start",
      "grid-row-end",
      "grid-column-end"
    ],
    "appliesto": "gridItemsAndBoxesWithinGridContainer",
    "computed": [
      "grid-row-start",
      "grid-column-start",
      "grid-row-end",
      "grid-column-end"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/grid-area"
  },
  "grid-auto-columns": {
    "syntax": "<track-size>+",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "referToDimensionOfContentArea",
    "groups": [
      "CSS Grid Layout"
    ],
    "initial": "auto",
    "appliesto": "gridContainers",
    "computed": "percentageAsSpecifiedOrAbsoluteLength",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/grid-auto-columns"
  },
  "grid-auto-flow": {
    "syntax": "[ row | column ] || dense",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Grid Layout"
    ],
    "initial": "row",
    "appliesto": "gridContainers",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/grid-auto-flow"
  },
  "grid-auto-rows": {
    "syntax": "<track-size>+",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "referToDimensionOfContentArea",
    "groups": [
      "CSS Grid Layout"
    ],
    "initial": "auto",
    "appliesto": "gridContainers",
    "computed": "percentageAsSpecifiedOrAbsoluteLength",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/grid-auto-rows"
  },
  "grid-column": {
    "syntax": "<grid-line> [ / <grid-line> ]?",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Grid Layout"
    ],
    "initial": [
      "grid-column-start",
      "grid-column-end"
    ],
    "appliesto": "gridItemsAndBoxesWithinGridContainer",
    "computed": [
      "grid-column-start",
      "grid-column-end"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/grid-column"
  },
  "grid-column-end": {
    "syntax": "<grid-line>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Grid Layout"
    ],
    "initial": "auto",
    "appliesto": "gridItemsAndBoxesWithinGridContainer",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/grid-column-end"
  },
  "grid-column-gap": {
    "syntax": "<length-percentage>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "referToDimensionOfContentArea",
    "groups": [
      "CSS Grid Layout"
    ],
    "initial": "0",
    "appliesto": "gridContainers",
    "computed": "percentageAsSpecifiedOrAbsoluteLength",
    "order": "uniqueOrder",
    "status": "obsolete",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/column-gap"
  },
  "grid-column-start": {
    "syntax": "<grid-line>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Grid Layout"
    ],
    "initial": "auto",
    "appliesto": "gridItemsAndBoxesWithinGridContainer",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/grid-column-start"
  },
  "grid-gap": {
    "syntax": "<'grid-row-gap'> <'grid-column-gap'>?",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "grid-row-gap",
      "grid-column-gap"
    ],
    "percentages": "no",
    "groups": [
      "CSS Grid Layout"
    ],
    "initial": [
      "grid-row-gap",
      "grid-column-gap"
    ],
    "appliesto": "gridContainers",
    "computed": [
      "grid-row-gap",
      "grid-column-gap"
    ],
    "order": "uniqueOrder",
    "status": "obsolete",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/gap"
  },
  "grid-row": {
    "syntax": "<grid-line> [ / <grid-line> ]?",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Grid Layout"
    ],
    "initial": [
      "grid-row-start",
      "grid-row-end"
    ],
    "appliesto": "gridItemsAndBoxesWithinGridContainer",
    "computed": [
      "grid-row-start",
      "grid-row-end"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/grid-row"
  },
  "grid-row-end": {
    "syntax": "<grid-line>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Grid Layout"
    ],
    "initial": "auto",
    "appliesto": "gridItemsAndBoxesWithinGridContainer",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/grid-row-end"
  },
  "grid-row-gap": {
    "syntax": "<length-percentage>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "referToDimensionOfContentArea",
    "groups": [
      "CSS Grid Layout"
    ],
    "initial": "0",
    "appliesto": "gridContainers",
    "computed": "percentageAsSpecifiedOrAbsoluteLength",
    "order": "uniqueOrder",
    "status": "obsolete",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/row-gap"
  },
  "grid-row-start": {
    "syntax": "<grid-line>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Grid Layout"
    ],
    "initial": "auto",
    "appliesto": "gridItemsAndBoxesWithinGridContainer",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/grid-row-start"
  },
  "grid-template": {
    "syntax": "none | [ <'grid-template-rows'> / <'grid-template-columns'> ] | [ <line-names>? <string> <track-size>? <line-names>? ]+ [ / <explicit-track-list> ]?",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "grid-template-columns",
      "grid-template-rows",
      "grid-template-areas"
    ],
    "percentages": [
      "grid-template-columns",
      "grid-template-rows"
    ],
    "groups": [
      "CSS Grid Layout"
    ],
    "initial": [
      "grid-template-columns",
      "grid-template-rows",
      "grid-template-areas"
    ],
    "appliesto": "gridContainers",
    "computed": [
      "grid-template-columns",
      "grid-template-rows",
      "grid-template-areas"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/grid-template"
  },
  "grid-template-areas": {
    "syntax": "none | <string>+",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Grid Layout"
    ],
    "initial": "none",
    "appliesto": "gridContainers",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/grid-template-areas"
  },
  "grid-template-columns": {
    "syntax": "none | <track-list> | <auto-track-list> | subgrid <line-name-list>?",
    "media": "visual",
    "inherited": false,
    "animationType": "simpleListOfLpcDifferenceLpc",
    "percentages": "referToDimensionOfContentArea",
    "groups": [
      "CSS Grid Layout"
    ],
    "initial": "none",
    "appliesto": "gridContainers",
    "computed": "asSpecifiedRelativeToAbsoluteLengths",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/grid-template-columns"
  },
  "grid-template-rows": {
    "syntax": "none | <track-list> | <auto-track-list> | subgrid <line-name-list>?",
    "media": "visual",
    "inherited": false,
    "animationType": "simpleListOfLpcDifferenceLpc",
    "percentages": "referToDimensionOfContentArea",
    "groups": [
      "CSS Grid Layout"
    ],
    "initial": "none",
    "appliesto": "gridContainers",
    "computed": "asSpecifiedRelativeToAbsoluteLengths",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/grid-template-rows"
  },
  "hanging-punctuation": {
    "syntax": "none | [ first || [ force-end | allow-end ] || last ]",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/hanging-punctuation"
  },
  "height": {
    "syntax": "auto | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "regardingHeightOfGeneratedBoxContainingBlockPercentagesRelativeToContainingBlock",
    "groups": [
      "CSS Box Sizing"
    ],
    "initial": "auto",
    "appliesto": "allElementsButNonReplacedAndTableColumns",
    "computed": "percentageAutoOrAbsoluteLength",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/height"
  },
  "hyphenate-character": {
    "syntax": "auto | <string>",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/hyphenate-character"
  },
  "hyphenate-limit-chars": {
    "syntax": "[ auto | <integer> ]{1,3}",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Text"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/hyphenate-limit-chars"
  },
  "hyphens": {
    "syntax": "none | manual | auto",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text"
    ],
    "initial": "manual",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/hyphens"
  },
  "image-orientation": {
    "syntax": "from-image | <angle> | [ <angle>? flip ]",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Images"
    ],
    "initial": "from-image",
    "appliesto": "allElements",
    "computed": "angleRoundedToNextQuarter",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/image-orientation"
  },
  "image-rendering": {
    "syntax": "auto | crisp-edges | pixelated | smooth",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Images"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/image-rendering"
  },
  "image-resolution": {
    "syntax": "[ from-image || <resolution> ] && snap?",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Images"
    ],
    "initial": "1dppx",
    "appliesto": "allElements",
    "computed": "asSpecifiedWithExceptionOfResolution",
    "order": "uniqueOrder",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/image-resolution"
  },
  "ime-mode": {
    "syntax": "auto | normal | active | inactive | disabled",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Basic User Interface"
    ],
    "initial": "auto",
    "appliesto": "textFields",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "obsolete"
  },
  "initial-letter": {
    "syntax": "normal | [ <number> <integer>? ]",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Inline"
    ],
    "initial": "normal",
    "appliesto": "firstLetterPseudoElementsAndInlineLevelFirstChildren",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/initial-letter"
  },
  "initial-letter-align": {
    "syntax": "[ auto | alph   abetic | hanging | ideographic ]",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Inline"
    ],
    "initial": "auto",
    "appliesto": "firstLetterPseudoElementsAndInlineLevelFirstChildren",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "experimental"
  },
  "inline-size": {
    "syntax": "<'width'>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "inlineSizeOfContainingBlock",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "auto",
    "appliesto": "sameAsWidthAndHeight",
    "computed": "sameAsWidthAndHeight",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/inline-size"
  },
  "inset": {
    "syntax": "<'top'>{1,4}",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "logicalHeightOrWidthOfContainingBlock",
    "groups": [
      "CSS Logical Properties and Values",
      "CSS Positioned Layout"
    ],
    "initial": [
      "top",
      "bottom",
      "left",
      "right"
    ],
    "appliesto": "positionedElements",
    "computed": [
      "top",
      "bottom",
      "left",
      "right"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/inset"
  },
  "inset-block": {
    "syntax": "<'top'>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "logicalHeightOfContainingBlock",
    "groups": [
      "CSS Logical Properties and Values",
      "CSS Positioned Layout"
    ],
    "initial": [
      "inset-block-start",
      "inset-block-end"
    ],
    "appliesto": "positionedElements",
    "computed": [
      "inset-block-start",
      "inset-block-end"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/inset-block"
  },
  "inset-block-end": {
    "syntax": "<'top'>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "logicalHeightOfContainingBlock",
    "groups": [
      "CSS Logical Properties and Values",
      "CSS Positioned Layout"
    ],
    "initial": "auto",
    "appliesto": "positionedElements",
    "computed": "sameAsBoxOffsets",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/inset-block-end"
  },
  "inset-block-start": {
    "syntax": "<'top'>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "logicalHeightOfContainingBlock",
    "groups": [
      "CSS Logical Properties and Values",
      "CSS Positioned Layout"
    ],
    "initial": "auto",
    "appliesto": "positionedElements",
    "computed": "sameAsBoxOffsets",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/inset-block-start"
  },
  "inset-inline": {
    "syntax": "<'top'>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "logicalWidthOfContainingBlock",
    "groups": [
      "CSS Logical Properties and Values",
      "CSS Positioned Layout"
    ],
    "initial": [
      "inset-inline-start",
      "inset-inline-end"
    ],
    "appliesto": "positionedElements",
    "computed": [
      "inset-inline-start",
      "inset-inline-end"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/inset-inline"
  },
  "inset-inline-end": {
    "syntax": "<'top'>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "logicalWidthOfContainingBlock",
    "groups": [
      "CSS Logical Properties and Values",
      "CSS Positioned Layout"
    ],
    "initial": "auto",
    "appliesto": "positionedElements",
    "computed": "sameAsBoxOffsets",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/inset-inline-end"
  },
  "inset-inline-start": {
    "syntax": "<'top'>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "logicalWidthOfContainingBlock",
    "groups": [
      "CSS Logical Properties and Values",
      "CSS Positioned Layout"
    ],
    "initial": "auto",
    "appliesto": "positionedElements",
    "computed": "sameAsBoxOffsets",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/inset-inline-start"
  },
  "interpolate-size": {
    "syntax": "numeric-only | allow-keywords",
    "media": "none",
    "inherited": true,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Values and Units"
    ],
    "initial": "numeric-only",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/interpolate-size"
  },
  "isolation": {
    "syntax": "auto | isolate",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "Compositing and Blending"
    ],
    "initial": "auto",
    "appliesto": "allElementsSVGContainerGraphicsAndGraphicsReferencingElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/isolation"
  },
  "interactivity": {
    "syntax": "auto | inert",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Basic User Interface"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/interactivity"
  },
  "interest-delay": {
    "syntax": "<'interest-delay-start'>{1,2}",
    "media": "visual",
    "inherited": true,
    "animationType": [
      "interest-delay-start",
      "interest-delay-end"
    ],
    "percentages": "no",
    "groups": [
      "CSS Basic User Interface"
    ],
    "initial": [
      "interest-delay-start",
      "interest-delay-end"
    ],
    "appliesto": "allElements",
    "computed": [
      "interest-delay-start",
      "interest-delay-end"
    ],
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/interest-delay-end"
  },
  "interest-delay-end": {
    "syntax": "normal | <time>",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Basic User Interface"
    ],
    "initial": "normal",
    "appliesto": "allElements",
    "computed": "normalOrComputedTime",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/interest-delay-end"
  },
  "interest-delay-start": {
    "syntax": "normal | <time>",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Basic User Interface"
    ],
    "initial": "normal",
    "appliesto": "allElements",
    "computed": "normalOrComputedTime",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/interest-delay-start"
  },
  "justify-content": {
    "syntax": "normal | <content-distribution> | <overflow-position>? [ <content-position> | left | right ]",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Box Alignment",
      "CSS Flexible Box Layout"
    ],
    "initial": "normal",
    "appliesto": "flexContainers",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/justify-content"
  },
  "justify-items": {
    "syntax": "normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ] | legacy | legacy && [ left | right | center ] | anchor-center",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Box Alignment"
    ],
    "initial": "legacy",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/justify-items"
  },
  "justify-self": {
    "syntax": "auto | normal | stretch | <baseline-position> | <overflow-position>? [ <self-position> | left | right ] | anchor-center",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Box Alignment"
    ],
    "initial": "auto",
    "appliesto": "blockLevelBoxesAndAbsolutelyPositionedBoxesAndGridItems",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/justify-self"
  },
  "justify-tracks": {
    "syntax": "[ normal | <content-distribution> | <overflow-position>? [ <content-position> | left | right ] ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Grid Layout"
    ],
    "initial": "normal",
    "appliesto": "gridContainersWithMasonryLayoutInTheirInlineAxis",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "left": {
    "syntax": "auto | <length-percentage> | <anchor()> | <anchor-size()>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToWidthOfContainingBlock",
    "groups": [
      "CSS Anchor Positioning",
      "CSS Positioned Layout"
    ],
    "initial": "auto",
    "appliesto": "positionedElements",
    "computed": "lengthAbsolutePercentageAsSpecifiedOtherwiseAuto",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/left"
  },
  "letter-spacing": {
    "syntax": "normal | <length>",
    "media": "visual",
    "inherited": true,
    "animationType": "length",
    "percentages": "no",
    "groups": [
      "CSS Text"
    ],
    "initial": "normal",
    "appliesto": "allElements",
    "computed": "optimumValueOfAbsoluteLengthOrNormal",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/letter-spacing"
  },
  "lighting-color": {
    "syntax": "<color>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValue",
    "percentages": "no",
    "groups": [
      "Filter Effects"
    ],
    "initial": "white",
    "appliesto": "limitedSVGElementsLightSource",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/lighting-color"
  },
  "line-break": {
    "syntax": "auto | loose | normal | strict | anywhere",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/line-break"
  },
  "line-clamp": {
    "syntax": "none | <integer>",
    "media": "visual",
    "inherited": false,
    "animationType": "integer",
    "percentages": "no",
    "groups": [
      "CSS Overflow"
    ],
    "initial": "none",
    "appliesto": "blockContainersExceptMultiColumnContainers",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/line-clamp"
  },
  "line-height": {
    "syntax": "normal | <number> | <length> | <percentage>",
    "media": "visual",
    "inherited": true,
    "animationType": "numberOrLength",
    "percentages": "referToElementFontSize",
    "groups": [
      "CSS Inline"
    ],
    "initial": "normal",
    "appliesto": "allElements",
    "computed": "absoluteLengthOrAsSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/line-height"
  },
  "line-height-step": {
    "syntax": "<length>",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Rhythmic Sizing"
    ],
    "initial": "0",
    "appliesto": "blockContainers",
    "computed": "absoluteLength",
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/line-height-step"
  },
  "list-style": {
    "syntax": "<'list-style-type'> || <'list-style-position'> || <'list-style-image'>",
    "media": "visual",
    "inherited": true,
    "animationType": [
      "list-style-image",
      "list-style-position",
      "list-style-type"
    ],
    "percentages": "no",
    "groups": [
      "CSS Lists and Counters"
    ],
    "initial": [
      "list-style-type",
      "list-style-position",
      "list-style-image"
    ],
    "appliesto": "listItems",
    "computed": [
      "list-style-image",
      "list-style-position",
      "list-style-type"
    ],
    "order": "orderOfAppearance",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/list-style"
  },
  "list-style-image": {
    "syntax": "<image> | none",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Lists and Counters"
    ],
    "initial": "none",
    "appliesto": "listItems",
    "computed": "theKeywordListStyleImageNoneOrComputedValue",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/list-style-image"
  },
  "list-style-position": {
    "syntax": "inside | outside",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Lists and Counters"
    ],
    "initial": "outside",
    "appliesto": "listItems",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/list-style-position"
  },
  "list-style-type": {
    "syntax": "<counter-style> | <string> | none",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Lists and Counters"
    ],
    "initial": "disc",
    "appliesto": "listItems",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/list-style-type"
  },
  "margin": {
    "syntax": "<'margin-top'>{1,4}",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "referToWidthOfContainingBlock",
    "groups": [
      "CSS Box Model"
    ],
    "initial": [
      "margin-bottom",
      "margin-left",
      "margin-right",
      "margin-top"
    ],
    "appliesto": "allElementsExceptTableDisplayTypes",
    "computed": [
      "margin-bottom",
      "margin-left",
      "margin-right",
      "margin-top"
    ],
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/margin"
  },
  "margin-block": {
    "syntax": "<'margin-top'>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "dependsOnLayoutModel",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": [
      "margin-block-start",
      "margin-block-end"
    ],
    "appliesto": "sameAsMargin",
    "computed": [
      "margin-block-start",
      "margin-block-end"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/margin-block"
  },
  "margin-block-end": {
    "syntax": "<'margin-top'>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "dependsOnLayoutModel",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "0",
    "appliesto": "sameAsMargin",
    "computed": "lengthAbsolutePercentageAsSpecifiedOtherwiseAuto",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/margin-block-end"
  },
  "margin-block-start": {
    "syntax": "<'margin-top'>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "dependsOnLayoutModel",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "0",
    "appliesto": "sameAsMargin",
    "computed": "lengthAbsolutePercentageAsSpecifiedOtherwiseAuto",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/margin-block-start"
  },
  "margin-bottom": {
    "syntax": "<length-percentage> | auto | <anchor-size()>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "referToWidthOfContainingBlock",
    "groups": [
      "CSS Anchor Positioning",
      "CSS Box Model"
    ],
    "initial": "0",
    "appliesto": "allElementsExceptTableDisplayTypes",
    "computed": "percentageAsSpecifiedOrAbsoluteLength",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/margin-bottom"
  },
  "margin-inline": {
    "syntax": "<'margin-top'>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "dependsOnLayoutModel",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": [
      "margin-inline-start",
      "margin-inline-end"
    ],
    "appliesto": "sameAsMargin",
    "computed": [
      "margin-inline-start",
      "margin-inline-end"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/margin-inline"
  },
  "margin-inline-end": {
    "syntax": "<'margin-top'>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "dependsOnLayoutModel",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "0",
    "appliesto": "sameAsMargin",
    "computed": "lengthAbsolutePercentageAsSpecifiedOtherwiseAuto",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/margin-inline-end"
  },
  "margin-inline-start": {
    "syntax": "<'margin-top'>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "dependsOnLayoutModel",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "0",
    "appliesto": "sameAsMargin",
    "computed": "lengthAbsolutePercentageAsSpecifiedOtherwiseAuto",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/margin-inline-start"
  },
  "margin-left": {
    "syntax": "<length-percentage> | auto | <anchor-size()>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "referToWidthOfContainingBlock",
    "groups": [
      "CSS Anchor Positioning",
      "CSS Box Model"
    ],
    "initial": "0",
    "appliesto": "allElementsExceptTableDisplayTypes",
    "computed": "percentageAsSpecifiedOrAbsoluteLength",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/margin-left"
  },
  "margin-right": {
    "syntax": "<length-percentage> | auto | <anchor-size()>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "referToWidthOfContainingBlock",
    "groups": [
      "CSS Anchor Positioning",
      "CSS Box Model"
    ],
    "initial": "0",
    "appliesto": "allElementsExceptTableDisplayTypes",
    "computed": "percentageAsSpecifiedOrAbsoluteLength",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/margin-right"
  },
  "margin-top": {
    "syntax": "<length-percentage> | auto | <anchor-size()>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "referToWidthOfContainingBlock",
    "groups": [
      "CSS Anchor Positioning",
      "CSS Box Model"
    ],
    "initial": "0",
    "appliesto": "allElementsExceptTableDisplayTypes",
    "computed": "percentageAsSpecifiedOrAbsoluteLength",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/margin-top"
  },
  "margin-trim": {
    "syntax": "none | in-flow | all",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Box Model"
    ],
    "initial": "none",
    "appliesto": "blockContainersAndMultiColumnContainers",
    "computed": "asSpecified",
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter"
    ],
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/margin-trim"
  },
  "marker": {
    "syntax": "none | <url>",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": [
      "marker-start",
      "marker-mid",
      "marker-end"
    ],
    "appliesto": "limitedSVGElementsShapes",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/marker"
  },
  "marker-end": {
    "syntax": "none | <url>",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "none",
    "appliesto": "limitedSVGElementsShapes",
    "computed": "asSpecifiedURLsAbsolute",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/marker-end"
  },
  "marker-mid": {
    "syntax": "none | <url>",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "none",
    "appliesto": "limitedSVGElementsShapes",
    "computed": "asSpecifiedURLsAbsolute",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/marker-mid"
  },
  "marker-start": {
    "syntax": "none | <url>",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "none",
    "appliesto": "limitedSVGElementsShapes",
    "computed": "asSpecifiedURLsAbsolute",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/marker-start"
  },
  "mask": {
    "syntax": "<mask-layer>#",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "mask-image",
      "mask-mode",
      "mask-repeat",
      "mask-position",
      "mask-clip",
      "mask-origin",
      "mask-size",
      "mask-composite"
    ],
    "percentages": [
      "mask-position"
    ],
    "groups": [
      "CSS Masking"
    ],
    "initial": [
      "mask-image",
      "mask-mode",
      "mask-repeat",
      "mask-position",
      "mask-clip",
      "mask-origin",
      "mask-size",
      "mask-composite"
    ],
    "appliesto": "allElementsSVGContainerElements",
    "computed": [
      "mask-image",
      "mask-mode",
      "mask-repeat",
      "mask-position",
      "mask-clip",
      "mask-origin",
      "mask-size",
      "mask-composite"
    ],
    "order": "perGrammar",
    "stacking": true,
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask"
  },
  "mask-border": {
    "syntax": "<'mask-border-source'> || <'mask-border-slice'> [ / <'mask-border-width'>? [ / <'mask-border-outset'> ]? ]? || <'mask-border-repeat'> || <'mask-border-mode'>",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "mask-border-mode",
      "mask-border-outset",
      "mask-border-repeat",
      "mask-border-slice",
      "mask-border-source",
      "mask-border-width"
    ],
    "percentages": [
      "mask-border-slice",
      "mask-border-width"
    ],
    "groups": [
      "CSS Masking"
    ],
    "initial": [
      "mask-border-mode",
      "mask-border-outset",
      "mask-border-repeat",
      "mask-border-slice",
      "mask-border-source",
      "mask-border-width"
    ],
    "appliesto": "allElementsSVGContainerElements",
    "computed": [
      "mask-border-mode",
      "mask-border-outset",
      "mask-border-repeat",
      "mask-border-slice",
      "mask-border-source",
      "mask-border-width"
    ],
    "order": "perGrammar",
    "stacking": true,
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask-border"
  },
  "mask-border-mode": {
    "syntax": "luminance | alpha",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Masking"
    ],
    "initial": "alpha",
    "appliesto": "allElementsSVGContainerElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask-border-mode"
  },
  "mask-border-outset": {
    "syntax": "[ <length> | <number> ]{1,4}",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Masking"
    ],
    "initial": "0",
    "appliesto": "allElementsSVGContainerElements",
    "computed": "asSpecifiedRelativeToAbsoluteLengths",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask-border-outset"
  },
  "mask-border-repeat": {
    "syntax": "[ stretch | repeat | round | space ]{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Masking"
    ],
    "initial": "stretch",
    "appliesto": "allElementsSVGContainerElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask-border-repeat"
  },
  "mask-border-slice": {
    "syntax": "<number-percentage>{1,4} fill?",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "referToSizeOfMaskBorderImage",
    "groups": [
      "CSS Masking"
    ],
    "initial": "0",
    "appliesto": "allElementsSVGContainerElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask-border-slice"
  },
  "mask-border-source": {
    "syntax": "none | <image>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Masking"
    ],
    "initial": "none",
    "appliesto": "allElementsSVGContainerElements",
    "computed": "asSpecifiedURLsAbsolute",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask-border-source"
  },
  "mask-border-width": {
    "syntax": "[ <length-percentage> | <number> | auto ]{1,4}",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "relativeToMaskBorderImageArea",
    "groups": [
      "CSS Masking"
    ],
    "initial": "auto",
    "appliesto": "allElementsSVGContainerElements",
    "computed": "asSpecifiedRelativeToAbsoluteLengths",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask-border-width"
  },
  "mask-clip": {
    "syntax": "[ <coord-box> | no-clip ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Masking"
    ],
    "initial": "border-box",
    "appliesto": "allElementsSVGContainerElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask-clip"
  },
  "mask-composite": {
    "syntax": "<compositing-operator>#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Masking"
    ],
    "initial": "add",
    "appliesto": "allElementsSVGContainerElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask-composite"
  },
  "mask-image": {
    "syntax": "<mask-reference>#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Masking"
    ],
    "initial": "none",
    "appliesto": "allElementsSVGContainerElements",
    "computed": "asSpecifiedURLsAbsolute",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask-image"
  },
  "mask-mode": {
    "syntax": "<masking-mode>#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Masking"
    ],
    "initial": "match-source",
    "appliesto": "allElementsSVGContainerElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask-mode"
  },
  "mask-origin": {
    "syntax": "<coord-box>#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Masking"
    ],
    "initial": "border-box",
    "appliesto": "allElementsSVGContainerElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask-origin"
  },
  "mask-position": {
    "syntax": "<position>#",
    "media": "visual",
    "inherited": false,
    "animationType": "repeatableList",
    "percentages": "referToSizeOfMaskPaintingArea",
    "groups": [
      "CSS Masking"
    ],
    "initial": "0% 0%",
    "appliesto": "allElementsSVGContainerElements",
    "computed": "consistsOfTwoKeywordsForOriginAndOffsets",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask-position"
  },
  "mask-repeat": {
    "syntax": "<repeat-style>#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Masking"
    ],
    "initial": "repeat",
    "appliesto": "allElementsSVGContainerElements",
    "computed": "consistsOfTwoDimensionKeywords",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask-repeat"
  },
  "mask-size": {
    "syntax": "<bg-size>#",
    "media": "visual",
    "inherited": false,
    "animationType": "repeatableList",
    "percentages": "no",
    "groups": [
      "CSS Masking"
    ],
    "initial": "auto",
    "appliesto": "allElementsSVGContainerElements",
    "computed": "asSpecifiedRelativeToAbsoluteLengths",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask-size"
  },
  "mask-type": {
    "syntax": "luminance | alpha",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Masking"
    ],
    "initial": "luminance",
    "appliesto": "maskElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mask-type"
  },
  "masonry-auto-flow": {
    "syntax": "[ pack | next ] || [ definite-first | ordered ]",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Grid Layout"
    ],
    "initial": "pack",
    "appliesto": "gridContainersWithMasonryLayout",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/grid-auto-flow"
  },
  "math-depth": {
    "syntax": "auto-add | add(<integer>) | <integer>",
    "media": "visual",
    "inherited": true,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "MathML"
    ],
    "initial": "0",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/math-depth"
  },
  "math-shift": {
    "syntax": "normal | compact",
    "media": "visual",
    "inherited": true,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "MathML"
    ],
    "initial": "normal",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/math-shift"
  },
  "math-style": {
    "syntax": "normal | compact",
    "media": "visual",
    "inherited": true,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "MathML"
    ],
    "initial": "normal",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/math-style"
  },
  "max-block-size": {
    "syntax": "<'max-width'>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "blockSizeOfContainingBlock",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "none",
    "appliesto": "sameAsWidthAndHeight",
    "computed": "sameAsMaxWidthAndMaxHeight",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/max-block-size"
  },
  "max-height": {
    "syntax": "none | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "regardingHeightOfGeneratedBoxContainingBlockPercentagesNone",
    "groups": [
      "CSS Box Sizing"
    ],
    "initial": "none",
    "appliesto": "allElementsButNonReplacedAndTableColumns",
    "computed": "percentageAsSpecifiedAbsoluteLengthOrNone",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/max-height"
  },
  "max-inline-size": {
    "syntax": "<'max-width'>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "inlineSizeOfContainingBlock",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "none",
    "appliesto": "sameAsWidthAndHeight",
    "computed": "sameAsMaxWidthAndMaxHeight",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/max-inline-size"
  },
  "max-lines": {
    "syntax": "none | <integer>",
    "media": "visual",
    "inherited": false,
    "animationType": "integer",
    "percentages": "no",
    "groups": [
      "CSS Overflow"
    ],
    "initial": "none",
    "appliesto": "blockContainersExceptMultiColumnContainers",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "experimental"
  },
  "max-width": {
    "syntax": "none | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToWidthOfContainingBlock",
    "groups": [
      "CSS Box Sizing"
    ],
    "initial": "none",
    "appliesto": "allElementsButNonReplacedAndTableRows",
    "computed": "percentageAsSpecifiedAbsoluteLengthOrNone",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/max-width"
  },
  "min-block-size": {
    "syntax": "<'min-width'>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "blockSizeOfContainingBlock",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "0",
    "appliesto": "sameAsWidthAndHeight",
    "computed": "sameAsMinWidthAndMinHeight",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/min-block-size"
  },
  "min-height": {
    "syntax": "auto | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "regardingHeightOfGeneratedBoxContainingBlockPercentages0",
    "groups": [
      "CSS Box Sizing"
    ],
    "initial": "auto",
    "appliesto": "allElementsButNonReplacedAndTableColumns",
    "computed": "percentageAsSpecifiedOrAbsoluteLength",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/min-height"
  },
  "min-inline-size": {
    "syntax": "<'min-width'>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "inlineSizeOfContainingBlock",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "0",
    "appliesto": "sameAsWidthAndHeight",
    "computed": "sameAsMinWidthAndMinHeight",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/min-inline-size"
  },
  "min-width": {
    "syntax": "auto | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToWidthOfContainingBlock",
    "groups": [
      "CSS Box Sizing"
    ],
    "initial": "auto",
    "appliesto": "allElementsButNonReplacedAndTableRows",
    "computed": "percentageAsSpecifiedOrAbsoluteLength",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/min-width"
  },
  "mix-blend-mode": {
    "syntax": "<blend-mode> | plus-darker | plus-lighter",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "Compositing and Blending"
    ],
    "initial": "normal",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "stacking": true,
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/mix-blend-mode"
  },
  "object-fit": {
    "syntax": "fill | contain | cover | none | scale-down",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Images"
    ],
    "initial": "fill",
    "appliesto": "replacedElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/object-fit"
  },
  "object-position": {
    "syntax": "<position>",
    "media": "visual",
    "inherited": false,
    "animationType": "repeatableList",
    "percentages": "referToWidthAndHeightOfElement",
    "groups": [
      "CSS Images"
    ],
    "initial": "50% 50%",
    "appliesto": "replacedElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/object-position"
  },
  "object-view-box": {
    "syntax": "none | <basic-shape-rect>",
    "media": "visual",
    "inherited": false,
    "animationType": "asIfPossibleOtherwiseDiscrete",
    "percentages": "no",
    "groups": [
      "CSS Images"
    ],
    "initial": "none",
    "appliesto": "replacedElements",
    "computed": "specifiedKeywordOrComputedFunction",
    "order": "perGrammar",
    "status": "experimental"
  },
  "offset": {
    "syntax": "[ <'offset-position'>? [ <'offset-path'> [ <'offset-distance'> || <'offset-rotate'> ]? ]? ]! [ / <'offset-anchor'> ]?",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "offset-position",
      "offset-path",
      "offset-distance",
      "offset-anchor",
      "offset-rotate"
    ],
    "percentages": [
      "offset-position",
      "offset-distance",
      "offset-anchor"
    ],
    "groups": [
      "Motion Path"
    ],
    "initial": [
      "offset-position",
      "offset-path",
      "offset-distance",
      "offset-anchor",
      "offset-rotate"
    ],
    "appliesto": "transformableElements",
    "computed": [
      "offset-position",
      "offset-path",
      "offset-distance",
      "offset-anchor",
      "offset-rotate"
    ],
    "order": "perGrammar",
    "stacking": true,
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/offset"
  },
  "offset-anchor": {
    "syntax": "auto | <position>",
    "media": "visual",
    "inherited": false,
    "animationType": "position",
    "percentages": "relativeToWidthAndHeight",
    "groups": [
      "Motion Path"
    ],
    "initial": "auto",
    "appliesto": "transformableElements",
    "computed": "forLengthAbsoluteValueOtherwisePercentage",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/offset-anchor"
  },
  "offset-distance": {
    "syntax": "<length-percentage>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToTotalPathLength",
    "groups": [
      "Motion Path"
    ],
    "initial": "0",
    "appliesto": "transformableElements",
    "computed": "forLengthAbsoluteValueOtherwisePercentage",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/offset-distance"
  },
  "offset-path": {
    "syntax": "none | <offset-path> || <coord-box>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "Motion Path"
    ],
    "initial": "none",
    "appliesto": "transformableElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "stacking": true,
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/offset-path"
  },
  "offset-position": {
    "syntax": "normal | auto | <position>",
    "media": "visual",
    "inherited": false,
    "animationType": "position",
    "percentages": "referToSizeOfContainingBlock",
    "groups": [
      "Motion Path"
    ],
    "initial": "normal",
    "appliesto": "transformableElements",
    "computed": "forLengthAbsoluteValueOtherwisePercentage",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/offset-position"
  },
  "offset-rotate": {
    "syntax": "[ auto | reverse ] || <angle>",
    "media": "visual",
    "inherited": false,
    "animationType": "angleOrBasicShapeOrPath",
    "percentages": "no",
    "groups": [
      "Motion Path"
    ],
    "initial": "auto",
    "appliesto": "transformableElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/offset-rotate"
  },
  "opacity": {
    "syntax": "<opacity-value>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "mapToRange0To1",
    "groups": [
      "CSS Color"
    ],
    "initial": "1",
    "appliesto": "allElements",
    "computed": "specifiedValueNumberClipped0To1",
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/opacity"
  },
  "order": {
    "syntax": "<integer>",
    "media": "visual",
    "inherited": false,
    "animationType": "integer",
    "percentages": "no",
    "groups": [
      "CSS Display"
    ],
    "initial": "0",
    "appliesto": "flexItemsGridItemsAbsolutelyPositionedContainerChildren",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/order"
  },
  "orphans": {
    "syntax": "<integer>",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Fragmentation"
    ],
    "initial": "2",
    "appliesto": "blockContainerElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/orphans"
  },
  "outline": {
    "syntax": "<'outline-width'> || <'outline-style'> || <'outline-color'>",
    "media": [
      "visual",
      "interactive"
    ],
    "inherited": false,
    "animationType": [
      "outline-width",
      "outline-style",
      "outline-color"
    ],
    "percentages": "no",
    "groups": [
      "CSS Basic User Interface"
    ],
    "initial": [
      "outline-width",
      "outline-style",
      "outline-color"
    ],
    "appliesto": "allElements",
    "computed": [
      "outline-width",
      "outline-style",
      "outline-color"
    ],
    "order": "orderOfAppearance",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/outline"
  },
  "outline-color": {
    "syntax": "auto | <color>",
    "media": [
      "visual",
      "interactive"
    ],
    "inherited": false,
    "animationType": "color",
    "percentages": "no",
    "groups": [
      "CSS Basic User Interface"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "autoForTranslucentColorRGBAOtherwiseRGB",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/outline-color"
  },
  "outline-offset": {
    "syntax": "<length>",
    "media": [
      "visual",
      "interactive"
    ],
    "inherited": false,
    "animationType": "length",
    "percentages": "no",
    "groups": [
      "CSS Basic User Interface"
    ],
    "initial": "0",
    "appliesto": "allElements",
    "computed": "absoluteLengthSnappedAsLineWidth",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/outline-offset"
  },
  "outline-style": {
    "syntax": "auto | <outline-line-style>",
    "media": [
      "visual",
      "interactive"
    ],
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Basic User Interface"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/outline-style"
  },
  "outline-width": {
    "syntax": "<line-width>",
    "media": [
      "visual",
      "interactive"
    ],
    "inherited": false,
    "animationType": "length",
    "percentages": "no",
    "groups": [
      "CSS Basic User Interface"
    ],
    "initial": "medium",
    "appliesto": "allElements",
    "computed": "absoluteLengthSnappedAsLineWidth",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/outline-width"
  },
  "overflow": {
    "syntax": "[ visible | hidden | clip | scroll | auto ]{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Overflow"
    ],
    "initial": "visible",
    "appliesto": "blockContainersFlexContainersGridContainers",
    "computed": [
      "overflow-x",
      "overflow-y"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/overflow"
  },
  "overflow-anchor": {
    "syntax": "auto | none",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Scroll Anchoring"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/overflow-anchor"
  },
  "overflow-block": {
    "syntax": "visible | hidden | clip | scroll | auto",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Overflow"
    ],
    "initial": "auto",
    "appliesto": "blockContainersFlexContainersGridContainers",
    "computed": "asSpecifiedButVisibleOrClipReplacedToAutoOrHiddenIfOtherValueDifferent",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/overflow-block"
  },
  "overflow-clip-box": {
    "syntax": "padding-box | content-box",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Mozilla Extensions"
    ],
    "initial": "padding-box",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "nonstandard"
  },
  "overflow-clip-margin": {
    "syntax": "<visual-box> || <length [0,∞]>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Overflow"
    ],
    "initial": "0px",
    "appliesto": "allElements",
    "computed": "theComputedLengthAndVisualBox",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/overflow-clip-margin"
  },
  "overflow-inline": {
    "syntax": "visible | hidden | clip | scroll | auto",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Overflow"
    ],
    "initial": "auto",
    "appliesto": "blockContainersFlexContainersGridContainers",
    "computed": "asSpecifiedButVisibleOrClipReplacedToAutoOrHiddenIfOtherValueDifferent",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/overflow-inline"
  },
  "overflow-wrap": {
    "syntax": "normal | break-word | anywhere",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text"
    ],
    "initial": "normal",
    "appliesto": "textElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/overflow-wrap"
  },
  "overflow-x": {
    "syntax": "visible | hidden | clip | scroll | auto",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Overflow"
    ],
    "initial": "visible",
    "appliesto": "blockContainersFlexContainersGridContainers",
    "computed": "asSpecifiedButVisibleOrClipReplacedToAutoOrHiddenIfOtherValueDifferent",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/overflow-x"
  },
  "overflow-y": {
    "syntax": "visible | hidden | clip | scroll | auto",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Overflow"
    ],
    "initial": "visible",
    "appliesto": "blockContainersFlexContainersGridContainers",
    "computed": "asSpecifiedButVisibleOrClipReplacedToAutoOrHiddenIfOtherValueDifferent",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/overflow-y"
  },
  "overlay": {
    "syntax": "none | auto",
    "media": "visual",
    "inherited": false,
    "animationType": "discreteButVisibleForDurationWhenAnimatedNone",
    "percentages": "no",
    "groups": [
      "CSS Positioned Layout"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/overlay"
  },
  "overscroll-behavior": {
    "syntax": "[ contain | none | auto ]{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Overscroll Behavior"
    ],
    "initial": "auto",
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": [
      "overscroll-behavior-x",
      "overscroll-behavior-y"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior"
  },
  "overscroll-behavior-block": {
    "syntax": "contain | none | auto",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Overscroll Behavior"
    ],
    "initial": "auto",
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-block"
  },
  "overscroll-behavior-inline": {
    "syntax": "contain | none | auto",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Overscroll Behavior"
    ],
    "initial": "auto",
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-inline"
  },
  "overscroll-behavior-x": {
    "syntax": "contain | none | auto",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Overscroll Behavior"
    ],
    "initial": "auto",
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-x"
  },
  "overscroll-behavior-y": {
    "syntax": "contain | none | auto",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Overscroll Behavior"
    ],
    "initial": "auto",
    "appliesto": "nonReplacedBlockAndInlineBlockElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/overscroll-behavior-y"
  },
  "padding": {
    "syntax": "<'padding-top'>{1,4}",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "referToWidthOfContainingBlock",
    "groups": [
      "CSS Box Model"
    ],
    "initial": [
      "padding-bottom",
      "padding-left",
      "padding-right",
      "padding-top"
    ],
    "appliesto": "allElementsExceptInternalTableDisplayTypes",
    "computed": [
      "padding-bottom",
      "padding-left",
      "padding-right",
      "padding-top"
    ],
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/padding"
  },
  "padding-block": {
    "syntax": "<'padding-top'>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "logicalWidthOfContainingBlock",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": [
      "padding-block-start",
      "padding-block-end"
    ],
    "appliesto": "allElementsExceptInternalTableDisplayTypes",
    "computed": [
      "padding-block-start",
      "padding-block-end"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/padding-block"
  },
  "padding-block-end": {
    "syntax": "<'padding-top'>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "logicalWidthOfContainingBlock",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "0",
    "appliesto": "allElementsExceptInternalTableDisplayTypes",
    "computed": "asLength",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/padding-block-end"
  },
  "padding-block-start": {
    "syntax": "<'padding-top'>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "logicalWidthOfContainingBlock",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "0",
    "appliesto": "allElementsExceptInternalTableDisplayTypes",
    "computed": "asLength",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/padding-block-start"
  },
  "padding-bottom": {
    "syntax": "<length-percentage [0,∞]>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "referToWidthOfContainingBlock",
    "groups": [
      "CSS Box Model"
    ],
    "initial": "0",
    "appliesto": "allElementsExceptInternalTableDisplayTypes",
    "computed": "percentageAsSpecifiedOrAbsoluteLength",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/padding-bottom"
  },
  "padding-inline": {
    "syntax": "<'padding-top'>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "logicalWidthOfContainingBlock",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": [
      "padding-inline-start",
      "padding-inline-end"
    ],
    "appliesto": "allElementsExceptInternalTableDisplayTypes",
    "computed": [
      "padding-inline-start",
      "padding-inline-end"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/padding-inline"
  },
  "padding-inline-end": {
    "syntax": "<'padding-top'>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "logicalWidthOfContainingBlock",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "0",
    "appliesto": "allElementsExceptInternalTableDisplayTypes",
    "computed": "asLength",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/padding-inline-end"
  },
  "padding-inline-start": {
    "syntax": "<'padding-top'>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "logicalWidthOfContainingBlock",
    "groups": [
      "CSS Logical Properties and Values"
    ],
    "initial": "0",
    "appliesto": "allElementsExceptInternalTableDisplayTypes",
    "computed": "asLength",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/padding-inline-start"
  },
  "padding-left": {
    "syntax": "<length-percentage [0,∞]>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "referToWidthOfContainingBlock",
    "groups": [
      "CSS Box Model"
    ],
    "initial": "0",
    "appliesto": "allElementsExceptInternalTableDisplayTypes",
    "computed": "percentageAsSpecifiedOrAbsoluteLength",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/padding-left"
  },
  "padding-right": {
    "syntax": "<length-percentage [0,∞]>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "referToWidthOfContainingBlock",
    "groups": [
      "CSS Box Model"
    ],
    "initial": "0",
    "appliesto": "allElementsExceptInternalTableDisplayTypes",
    "computed": "percentageAsSpecifiedOrAbsoluteLength",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/padding-right"
  },
  "padding-top": {
    "syntax": "<length-percentage [0,∞]>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "referToWidthOfContainingBlock",
    "groups": [
      "CSS Box Model"
    ],
    "initial": "0",
    "appliesto": "allElementsExceptInternalTableDisplayTypes",
    "computed": "percentageAsSpecifiedOrAbsoluteLength",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/padding-top"
  },
  "page": {
    "syntax": "auto | <custom-ident>",
    "media": "paged",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Paged Media"
    ],
    "initial": "auto",
    "appliesto": "blockElementsInNormalFlow",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/page"
  },
  "page-break-after": {
    "syntax": "auto | always | avoid | left | right | recto | verso",
    "media": [
      "visual",
      "paged"
    ],
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Paged Media"
    ],
    "initial": "auto",
    "appliesto": "blockElementsInNormalFlow",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "obsolete",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/page-break-after"
  },
  "page-break-before": {
    "syntax": "auto | always | avoid | left | right | recto | verso",
    "media": [
      "visual",
      "paged"
    ],
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Paged Media"
    ],
    "initial": "auto",
    "appliesto": "blockElementsInNormalFlow",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "obsolete",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/page-break-before"
  },
  "page-break-inside": {
    "syntax": "auto | avoid",
    "media": [
      "visual",
      "paged"
    ],
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Paged Media"
    ],
    "initial": "auto",
    "appliesto": "blockElementsInNormalFlow",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "obsolete",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/page-break-inside"
  },
  "paint-order": {
    "syntax": "normal | [ fill || stroke || markers ]",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "normal",
    "appliesto": "textElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/paint-order"
  },
  "perspective": {
    "syntax": "none | <length>",
    "media": "visual",
    "inherited": false,
    "animationType": "length",
    "percentages": "no",
    "groups": [
      "CSS Transforms"
    ],
    "initial": "none",
    "appliesto": "transformableElements",
    "computed": "absoluteLengthOrNone",
    "order": "uniqueOrder",
    "stacking": true,
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/perspective"
  },
  "perspective-origin": {
    "syntax": "<position>",
    "media": "visual",
    "inherited": false,
    "animationType": "simpleListOfLpc",
    "percentages": "referToSizeOfBoundingBox",
    "groups": [
      "CSS Transforms"
    ],
    "initial": "50% 50%",
    "appliesto": "transformableElements",
    "computed": "forLengthAbsoluteValueOtherw   isePercentage",
    "order": "oneOrTwoValuesLengthAbsoluteKeywordsPercentages",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/perspective-origin"
  },
  "place-content": {
    "syntax": "<'align-content'> <'justify-content'>?",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Box Alignment"
    ],
    "initial": [
      "align-content",
      "justify-content"
    ],
    "appliesto": "multilineFlexContainers",
    "computed": [
      "align-content",
      "justify-content"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/place-content"
  },
  "place-items": {
    "syntax": "<'align-items'> <'justify-items'>?",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Box Alignment"
    ],
    "initial": [
      "align-items",
      "justify-items"
    ],
    "appliesto": "allElements",
    "computed": [
      "align-items",
      "justify-items"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/place-items"
  },
  "place-self": {
    "syntax": "<'align-self'> <'justify-self'>?",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Box Alignment"
    ],
    "initial": [
      "align-self",
      "justify-self"
    ],
    "appliesto": "blockLevelBoxesAndAbsolutelyPositionedBoxesAndGridItems",
    "computed": [
      "align-self",
      "justify-self"
    ],
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/place-self"
  },
  "pointer-events": {
    "syntax": "auto | none | visiblePainted | visibleFill | visibleStroke | visible | painted | fill | stroke | all | inherit",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Basic User Interface"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/pointer-events"
  },
  "position": {
    "syntax": "static | relative | absolute | sticky | fixed",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Positioned Layout"
    ],
    "initial": "static",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "stacking": true,
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/position"
  },
  "position-anchor": {
    "syntax": "normal | auto | none | <anchor-name> | match-parent",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Anchor Positioning"
    ],
    "initial": "normal",
    "appliesto": "absolutelyPositionedElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/position-anchor"
  },
  "position-area": {
    "syntax": "none | <position-area>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Anchor Positioning"
    ],
    "initial": "none",
    "appliesto": "positionedElementsWithADefaultAnchorElement",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/position-area"
  },
  "position-try": {
    "syntax": "<'position-try-order'>? <'position-try-fallbacks'>",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "position-try-fallbacks",
      "position-try-order"
    ],
    "percentages": [
      "position-try-fallbacks",
      "position-try-order"
    ],
    "groups": [
      "CSS Anchor Positioning"
    ],
    "initial": [
      "position-try-fallbacks",
      "position-try-order"
    ],
    "appliesto": "absolutelyPositionedElements",
    "computed": [
      "position-try-fallbacks",
      "position-try-order"
    ],
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/position-try"
  },
  "position-try-fallbacks": {
    "syntax": "none | [ [<dashed-ident> || <try-tactic>] | <'position-area'> ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Anchor Positioning"
    ],
    "initial": "none",
    "appliesto": "absolutelyPositionedElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/position-try-fallbacks"
  },
  "position-try-order": {
    "syntax": "normal | <try-size>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Anchor Positioning"
    ],
    "initial": "normal",
    "appliesto": "absolutelyPositionedElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/position-try-order"
  },
  "position-visibility": {
    "syntax": "always | [ anchors-valid || anchors-visible || no-overflow ]",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Anchor Positioning"
    ],
    "initial": "anchors-visible",
    "appliesto": "absolutelyPositionedElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/position-visibility"
  },
  "print-color-adjust": {
    "syntax": "economy | exact",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Color"
    ],
    "initial": "economy",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/print-color-adjust"
  },
  "quotes": {
    "syntax": "none | auto | [ <string> <string> ]+",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Generated Content"
    ],
    "initial": "dependsOnUserAgent",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/quotes"
  },
  "r": {
    "syntax": "<length> | <percentage>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "referToSVGViewportSize",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "0",
    "appliesto": "limitedSVGElementsCircle",
    "computed": "percentageAsSpecifiedOrAbsoluteLength",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/r"
  },
  "reading-flow": {
    "syntax": "normal | source-order | flex-visual | flex-flow | grid-rows | grid-columns | grid-order",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Display"
    ],
    "initial": "normal",
    "appliesto": "blockContainersFlexContainersGridContainers",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/reading-flow"
  },
  "reading-order": {
    "syntax": "<integer>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Display"
    ],
    "initial": "0",
    "appliesto": "blockContainersFlexContainersGridContainers",
    "computed": "specifiedInteger",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/reading-order"
  },
  "resize": {
    "syntax": "none | both | horizontal | vertical | block | inline",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Basic User Interface"
    ],
    "initial": "none",
    "appliesto": "elementsWithOverflowNotVisibleAndReplacedElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/resize"
  },
  "right": {
    "syntax": "auto | <length-percentage> | <anchor()> | <anchor-size()>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToWidthOfContainingBlock",
    "groups": [
      "CSS Anchor Positioning",
      "CSS Positioned Layout"
    ],
    "initial": "auto",
    "appliesto": "positionedElements",
    "computed": "lengthAbsolutePercentageAsSpecifiedOtherwiseAuto",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/right"
  },
  "rotate": {
    "syntax": "none | <angle> | [ x | y | z | <number>{3} ] && <angle>",
    "media": "visual",
    "inherited": false,
    "animationType": "transform",
    "percentages": "no",
    "groups": [
      "CSS Transforms"
    ],
    "initial": "none",
    "appliesto": "transformableElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "stacking": true,
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/rotate"
  },
  "row-gap": {
    "syntax": "normal | <length-percentage>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToDimensionOfContentArea",
    "groups": [
      "CSS Box Alignment"
    ],
    "initial": "normal",
    "appliesto": "multiColumnElementsFlexContainersGridContainers",
    "computed": "asSpecifiedWithLengthsAbsoluteAndNormalComputingToZeroExceptMultiColumn",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/row-gap"
  },
  "ruby-align": {
    "syntax": "start | center | space-between | space-around",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Ruby"
    ],
    "initial": "space-around",
    "appliesto": "rubyBasesAnnotationsBaseAnnotationContainers",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/ruby-align"
  },
  "ruby-merge": {
    "syntax": "separate | collapse | auto",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Ruby"
    ],
    "initial": "separate",
    "appliesto": "rubyAnnotationContainers",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "experimental"
  },
  "ruby-overhang": {
    "syntax": "auto | none",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Ruby"
    ],
    "initial": "auto",
    "appliesto": "rubyAnnotationContainers",
    "computed": "theSpecifiedKeyword",
    "order": "perGrammar",
    "status": "standard"
  },
  "ruby-position": {
    "syntax": "[ alternate || [ over | under ] ] | inter-character",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Ruby"
    ],
    "initial": "alternate",
    "appliesto": "rubyAnnotationContainers",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/ruby-position"
  },
  "rx": {
    "syntax": "<length-percentage> | auto",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "referToSVGViewportWidth",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "auto",
    "appliesto": "limitedSVGElementsEllipseRect",
    "computed": "percentageAsSpecifiedOrAbsoluteLength",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/rx"
  },
  "ry": {
    "syntax": "<length-percentage> | auto",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "referToSVGViewportHeight",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "auto",
    "appliesto": "limitedSVGElementsEllipseRect",
    "computed": "percentageAsSpecifiedOrAbsoluteLength",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/ry"
  },
  "scale": {
    "syntax": "none | [ <number> | <percentage> ]{1,3}",
    "media": "visual",
    "inherited": false,
    "animationType": "transform",
    "percentages": "no",
    "groups": [
      "CSS Transforms"
    ],
    "initial": "none",
    "appliesto": "transformableElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "stacking": true,
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scale"
  },
  "scroll-behavior": {
    "syntax": "auto | smooth",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Overflow"
    ],
    "initial": "auto",
    "appliesto": "scrollingBoxes",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-behavior"
  },
  "scroll-initial-target": {
    "syntax": "none | nearest",
    "media": "noPracticalMedia",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "theSpecifiedKeyword",
    "order": "perGrammar",
    "status": "experimental"
  },
  "scroll-margin": {
    "syntax": "<length>{1,4}",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": [
      "scroll-margin-bottom",
      "scroll-margin-left",
      "scroll-margin-right",
      "scroll-margin-top"
    ],
    "appliesto": "allElements",
    "computed": [
      "scroll-margin-bottom",
      "scroll-margin-left",
      "scroll-margin-right",
      "scroll-margin-top"
    ],
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-margin"
  },
  "scroll-margin-block": {
    "syntax": "<length>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": [
      "scroll-margin-block-start",
      "scroll-margin-block-end"
    ],
    "appliesto": "allElements",
    "computed": [
      "scroll-margin-block-start",
      "scroll-margin-block-end"
    ],
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-margin-block"
  },
  "scroll-margin-block-end": {
    "syntax": "<length>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "0",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-margin-block-end"
  },
  "scroll-margin-block-start": {
    "syntax": "<length>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "0",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-margin-block-start"
  },
  "scroll-margin-bottom": {
    "syntax": "<length>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "0",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-margin-bottom"
  },
  "scroll-margin-inline": {
    "syntax": "<length>{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": [
      "scroll-margin-inline-start",
      "scroll-margin-inline-end"
    ],
    "appliesto": "allElements",
    "computed": [
      "scroll-margin-inline-start",
      "scroll-margin-inline-end"
    ],
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-margin-inline"
  },
  "scroll-margin-inline-end": {
    "syntax": "<length>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "0",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-margin-inline-end"
  },
  "scroll-margin-inline-start": {
    "syntax": "<length>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "0",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-margin-inline-start"
  },
  "scroll-margin-left": {
    "syntax": "<length>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "0",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-margin-left"
  },
  "scroll-margin-right": {
    "syntax": "<length>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "0",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-margin-right"
  },
  "scroll-margin-top": {
    "syntax": "<length>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "0",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-margin-top"
  },
  "scroll-marker-group": {
    "syntax": "none | before | after",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Overflow"
    ],
    "initial": "none",
    "appliesto": "scrollContainers",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-marker-group"
  },
  "scroll-padding": {
    "syntax": "[ auto | <length-percentage> ]{1,4}",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "relativeToTheScrollContainersScrollport",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": [
      "scroll-padding-bottom",
      "scroll-padding-left",
      "scroll-padding-right",
      "scroll-padding-top"
    ],
    "appliesto": "scrollContainers",
    "computed": [
      "scroll-padding-bottom",
      "scroll-padding-left",
      "scroll-padding-right",
      "scroll-padding-top"
    ],
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-padding"
  },
  "scroll-padding-block": {
    "syntax": "[ auto | <length-percentage> ]{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "relativeToTheScrollContainersScrollport",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": [
      "scroll-padding-block-start",
      "scroll-padding-block-end"
    ],
    "appliesto": "scrollContainers",
    "computed": [
      "scroll-padding-block-start",
      "scroll-padding-block-end"
    ],
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-padding-block"
  },
  "scroll-padding-block-end": {
    "syntax": "auto | <length-percentage>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "relativeToTheScrollContainersScrollport",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "auto",
    "appliesto": "scrollContainers",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-padding-block-end"
  },
  "scroll-padding-block-start": {
    "syntax": "auto | <length-percentage>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "relativeToTheScrollContainersScrollport",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "auto",
    "appliesto": "scrollContainers",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-padding-block-start"
  },
  "scroll-padding-bottom": {
    "syntax": "auto | <length-percentage>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "relativeToTheScrollContainersScrollport",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "auto",
    "appliesto": "scrollContainers",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-padding-bottom"
  },
  "scroll-padding-inline": {
    "syntax": "[ auto | <length-percentage> ]{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "relativeToTheScrollContainersScrollport",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": [
      "scroll-padding-inline-start",
      "scroll-padding-inline-end"
    ],
    "appliesto": "scrollContainers",
    "computed": [
      "scroll-padding-inline-start",
      "scroll-padding-inline-end"
    ],
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-padding-inline"
  },
  "scroll-padding-inline-end": {
    "syntax": "auto | <length-percentage>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "relativeToTheScrollContainersScrollport",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "auto",
    "appliesto": "scrollContainers",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-padding-inline-end"
  },
  "scroll-padding-inline-start": {
    "syntax": "auto | <length-percentage>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "relativeToTheScrollContainersScrollport",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "auto",
    "appliesto": "scrollContainers",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-padding-inline-start"
  },
  "scroll-padding-left": {
    "syntax": "auto | <length-percentage>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "relativeToTheScrollContainersScrollport",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "auto",
    "appliesto": "scrollContainers",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-padding-left"
  },
  "scroll-padding-right": {
    "syntax": "auto | <length-percentage>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "relativeToTheScrollContainersScrollport",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "auto",
    "appliesto": "scrollContainers",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-padding-right"
  },
  "scroll-padding-top": {
    "syntax": "auto | <length-percentage>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "relativeToTheScrollContainersScrollport",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "auto",
    "appliesto": "scrollContainers",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-padding-top"
  },
  "scroll-snap-align": {
    "syntax": "[ none | start | end | center ]{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-snap-align"
  },
  "scroll-snap-coordinate": {
    "syntax": "none | <position>#",
    "media": "interactive",
    "inherited": false,
    "animationType": "position",
    "percentages": "referToBorderBox",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecifiedRelativeToAbsoluteLengths",
    "order": "uniqueOrder",
    "status": "obsolete"
  },
  "scroll-snap-destination": {
    "syntax": "<position>",
    "media": "interactive",
    "inherited": false,
    "animationType": "position",
    "percentages": "relativeToScrollContainerPaddingBoxAxis",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "0px 0px",
    "appliesto": "scrollContainers",
    "computed": "asSpecifiedRelativeToAbsoluteLengths",
    "order": "uniqueOrder",
    "status": "obsolete"
  },
  "scroll-snap-points-x": {
    "syntax": "none | repeat( <length-percentage> )",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "relativeToScrollContainerPaddingBoxAxis",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "none",
    "appliesto": "scrollContainers",
    "computed": "asSpecifiedRelativeToAbsoluteLengths",
    "order": "uniqueOrder",
    "status": "obsolete"
  },
  "scroll-snap-points-y": {
    "syntax": "none | repeat( <length-percentage> )",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "relativeToScrollContainerPaddingBoxAxis",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "none",
    "appliesto": "scrollContainers",
    "computed": "asSpecifiedRelativeToAbsoluteLengths",
    "order": "uniqueOrder",
    "status": "obsolete"
  },
  "scroll-snap-stop": {
    "syntax": "normal | always",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "normal",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-snap-stop"
  },
  "scroll-snap-type": {
    "syntax": "none | [ x | y | block | inline | both ] [ mandatory | proximity ]?",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-snap-type"
  },
  "scroll-snap-type-x": {
    "syntax": "none | mandatory | proximity",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "none",
    "appliesto": "scrollContainers",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "obsolete"
  },
  "scroll-snap-type-y": {
    "syntax": "none | mandatory | proximity",
    "media": "interactive",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Scroll Snap"
    ],
    "initial": "none",
    "appliesto": "scrollContainers",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "obsolete"
  },
  "scroll-target-group": {
    "syntax": "none | auto",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Overflow"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-target-group"
  },
  "scroll-timeline": {
    "syntax": "[ <'scroll-timeline-name'> <'scroll-timeline-axis'>? ]#",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "scroll-timeline-name",
      "scroll-timeline-axis"
    ],
    "percentages": "no",
    "groups": [
      "Scroll-driven Animations"
    ],
    "initial": [
      "scroll-timeline-name",
      "scroll-timeline-axis"
    ],
    "appliesto": "scrollContainers",
    "computed": [
      "scroll-timeline-name",
      "scroll-timeline-axis"
    ],
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-timeline"
  },
  "scroll-timeline-axis": {
    "syntax": "[ block | inline | x | y ]#",
    "media": "interactive",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "Scroll-driven Animations"
    ],
    "initial": "block",
    "appliesto": "scrollContainers",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-timeline-axis"
  },
  "scroll-timeline-name": {
    "syntax": "[ none | <dashed-ident> ]#",
    "media": "interactive",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "Scroll-driven Animations"
    ],
    "initial": "none",
    "appliesto": "scrollContainers",
    "computed": "noneOrOrderedListOfIdentifiers",
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scroll-timeline-name"
  },
  "scrollbar-color": {
    "syntax": "auto | <color>{2}",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Scrollbars Styling"
    ],
    "initial": "auto",
    "appliesto": "scrollingBoxes",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scrollbar-color"
  },
  "scrollbar-gutter": {
    "syntax": "auto | stable && both-edges?",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Overflow"
    ],
    "initial": "auto",
    "appliesto": "scrollingBoxes",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scrollbar-gutter"
  },
  "scrollbar-width": {
    "syntax": "auto | thin | none",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Scrollbars Styling"
    ],
    "initial": "auto",
    "appliesto": "scrollingBoxes",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/scrollbar-width"
  },
  "shape-image-threshold": {
    "syntax": "<opacity-value>",
    "media": "visual",
    "inherited": false,
    "animationType": "number",
    "percentages": "no",
    "groups": [
      "CSS Shapes"
    ],
    "initial": "0.0",
    "appliesto": "floats",
    "computed": "specifiedValueNumberClipped0To1",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/shape-image-threshold"
  },
  "shape-margin": {
    "syntax": "<length-percentage>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToWidthOfContainingBlock",
    "groups": [
      "CSS Shapes"
    ],
    "initial": "0",
    "appliesto": "floats",
    "computed": "asSpecifiedRelativeToAbsoluteLengths",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/shape-margin"
  },
  "shape-outside": {
    "syntax": "none | [ <shape-box> || <basic-shape> ] | <image>",
    "media": "visual",
    "inherited": false,
    "animationType": "basicShapeOtherwiseNo",
    "percentages": "no",
    "groups": [
      "CSS Shapes"
    ],
    "initial": "none",
    "appliesto": "floats",
    "computed": "asDefinedForBasicShapeWithAbsoluteURIOtherwiseAsSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/shape-outside"
  },
  "shape-rendering": {
    "syntax": "auto | optimizeSpeed | crispEdges | geometricPrecision",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "auto",
    "appliesto": "limitedSVGElementsShapes",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/shape-rendering"
  },
  "speak-as": {
    "syntax": "normal | spell-out || digits || [ literal-punctuation | no-punctuation ]",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Speech"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "specifiedValue",
    "order": "perGrammar",
    "status": "experimental"
  },
  "stop-color": {
    "syntax": "<'color'>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "black",
    "appliesto": "limitedSVGElementsStop",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/stop-color"
  },
  "stop-opacity": {
    "syntax": "<'opacity'>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "black",
    "appliesto": "limitedSVGElementsStop",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/stop-opacity"
  },
  "stroke": {
    "syntax": "<paint>",
    "media": "visual",
    "inherited": true,
    "animationType": [
      "stroke-dasharray",
      "stroke-dashoffset",
      "stroke-linecap",
      "stroke-linejoin",
      "stroke-miterlimit",
      "stroke-opacity",
      "stroke-width"
    ],
    "percentages": "no",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": [
      "stroke-dasharray",
      "stroke-dashoffset",
      "stroke-linecap",
      "stroke-linejoin",
      "stroke-miterlimit",
      "stroke-opacity",
      "stroke-width"
    ],
    "appliesto": "asLonghands",
    "computed": "asLonghands",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/stroke"
  },
  "stroke-color": {
    "syntax": "<color>",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValue",
    "percentages": "no",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "transparent",
    "appliesto": "textAndSVGShapes",
    "computed": "computedColor",
    "order": "perGrammar",
    "status": "experimental"
  },
  "stroke-dasharray": {
    "syntax": "none | <dasharray>",
    "media": "visual",
    "inherited": true,
    "animationType": "repeatableList",
    "percentages": "referToSVGViewportDiagonal",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "none",
    "appliesto": "limitedSVGElementsShapes",
    "computed": "listEachItemConsistingOfAbsoluteLengthPercentageOrKeyword",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/stroke-dasharray"
  },
  "stroke-dashoffset": {
    "syntax": "<length-percentage> | <number>",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "referToSVGViewportDiagonal",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "0",
    "appliesto": "limitedSVGElementsShapes",
    "computed": "absoluteLengthOrPercentageNumbersConverted",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/stroke-dashoffset"
  },
  "stroke-linecap": {
    "syntax": "butt | round | square",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "butt",
    "appliesto": "limitedSVGElementsShapes",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/stroke-linecap"
  },
  "stroke-linejoin": {
    "syntax": "miter | miter-clip | round | bevel | arcs",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "miter",
    "appliesto": "limitedSVGElementsShapes",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/stroke-linejoin"
  },
  "stroke-miterlimit": {
    "syntax": "<number>",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "4",
    "appliesto": "limitedSVGElementsShapes",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/stroke-miterlimit"
  },
  "stroke-opacity": {
    "syntax": "<'opacity'>",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "1",
    "appliesto": "limitedSVGElementsShapes",
    "computed": "specifiedValueClipped0To1",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/stroke-opacity"
  },
  "stroke-width": {
    "syntax": "<length-percentage> | <number>",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "referToSVGViewportDiagonal",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "1px",
    "appliesto": "limitedSVGElementsShapes",
    "computed": "absoluteLengthOrPercentageNumbersConverted",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/stroke-width"
  },
  "tab-size": {
    "syntax": "<integer> | <length>",
    "media": "visual",
    "inherited": true,
    "animationType": "length",
    "percentages": "no",
    "groups": [
      "CSS Text"
    ],
    "initial": "8",
    "appliesto": "blockContainers",
    "computed": "specifiedIntegerOrAbsoluteLength",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/tab-size"
  },
  "table-layout": {
    "syntax": "auto | fixed",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Table"
    ],
    "initial": "auto",
    "appliesto": "tableElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/table-layout"
  },
  "text-align": {
    "syntax": "start | end | left | right | center | justify | match-parent",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text"
    ],
    "initial": "startOrNamelessValueIfLTRRightIfRTL",
    "appliesto": "blockContainers",
    "computed": "asSpecifiedExceptMatchParent",
    "order": "orderOfAppearance",
    "alsoAppliesTo": [
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-align"
  },
  "text-align-last": {
    "syntax": "auto | start | end | left | right | center | justify",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text"
    ],
    "initial": "auto",
    "appliesto": "blockContainers",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-align-last"
  },
  "text-anchor": {
    "syntax": "start | middle | end",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "start",
    "appliesto": "limitedSVGElementsTextContent",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-anchor"
  },
  "text-autospace": {
    "syntax": "normal | <autospace> | auto",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text"
    ],
    "initial": "normal",
    "appliesto": "textElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-autospace"
  },
  "text-box": {
    "syntax": "normal | <'text-box-trim'> || <'text-box-edge'>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Inline"
    ],
    "initial": "normal",
    "appliesto": "blockContainersAndInlineBoxes",
    "computed": "theSpecifiedKeyword",
    "order": "perGrammar",
    "status": "standard"
  },
  "text-box-edge": {
    "syntax": "auto | <text-edge>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Inline"
    ],
    "initial": "auto",
    "appliesto": "blockContainersAndInlineBoxes",
    "computed": "theSpecifiedKeyword",
    "order": "perGrammar",
    "status": "standard"
  },
  "text-box-trim": {
    "syntax": "none | trim-start | trim-end | trim-both",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Inline"
    ],
    "initial": "none",
    "appliesto": "blockContainersAndInlineBoxes",
    "computed": "theSpecifiedKeyword",
    "order": "perGrammar",
    "status": "standard"
  },
  "text-combine-upright": {
    "syntax": "none | all | [ digits <integer>? ]",
    "media": "visual",
    "inherited": true,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Writing Modes"
    ],
    "initial": "none",
    "appliesto": "nonReplacedInlineElements",
    "computed": "keywordPlusIntegerIfDigits",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-combine-upright"
  },
  "text-decoration": {
    "syntax": "<'text-decoration-line'> || <'text-decoration-style'> || <'text-decoration-color'> || <'text-decoration-thickness'>",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "text-decoration-color",
      "text-decoration-style",
      "text-decoration-line",
      "text-decoration-thickness"
    ],
    "percentages": "no",
    "groups": [
      "CSS Text Decoration"
    ],
    "initial": [
      "text-decoration-color",
      "text-decoration-style",
      "text-decoration-line"
    ],
    "appliesto": "allElements",
    "computed": [
      "text-decoration-line",
      "text-decoration-style",
      "text-decoration-color",
      "text-decoration-thickness"
    ],
    "order": "orderOfAppearance",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-decoration"
  },
  "text-decoration-color": {
    "syntax": "<color>",
    "media": "visual",
    "inherited": false,
    "animationType": "color",
    "percentages": "no",
    "groups": [
      "CSS Text Decoration"
    ],
    "initial": "currentcolor",
    "appliesto": "allElements",
    "computed": "computedColor",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-decoration-color"
  },
  "text-decoration-inset": {
    "syntax": "<length>{1,2} | auto",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValue",
    "percentages": "no",
    "groups": [
      "CSS Text Decoration"
    ],
    "initial": "0",
    "appliesto": "allElements",
    "computed": "absoluteLengthOrKeyword",
    "order": "perGrammar",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-decoration-inset"
  },
  "text-decoration-line": {
    "syntax": "none | [ underline || overline || line-through || blink ] | spelling-error | grammar-error",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text Decoration"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "orderOfAppearance",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-decoration-line"
  },
  "text-decoration-skip": {
    "syntax": "none | [ objects || [ spaces | [ leading-spaces || trailing-spaces ] ] || edges || box-decoration ]",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text Decoration"
    ],
    "initial": "objects",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "orderOfAppearance",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-decoration-skip"
  },
  "text-decoration-skip-ink": {
    "syntax": "auto | all | none",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text Decoration"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "orderOfAppearance",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-decoration-skip-ink"
  },
  "text-decoration-style": {
    "syntax": "solid | double | dotted | dashed | wavy",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text Decoration"
    ],
    "initial": "solid",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-decoration-style"
  },
  "text-decoration-thickness": {
    "syntax": "auto | from-font | <length> | <percentage>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "referToElementFontSize",
    "groups": [
      "CSS Text Decoration"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-decoration-thickness"
  },
  "text-emphasis": {
    "syntax": "<'text-emphasis-style'> || <'text-emphasis-color'>",
    "media": "visual",
    "inherited": true,
    "animationType": [
      "text-emphasis-color",
      "text-emphasis-style"
    ],
    "percentages": "no",
    "groups": [
      "CSS Text Decoration"
    ],
    "initial": [
      "text-emphasis-style",
      "text-emphasis-color"
    ],
    "appliesto": "allElements",
    "computed": [
      "text-emphasis-style",
      "text-emphasis-color"
    ],
    "order": "orderOfAppearance",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-emphasis"
  },
  "text-emphasis-color": {
    "syntax": "<color>",
    "media": "visual",
    "inherited": true,
    "animationType": "color",
    "percentages": "no",
    "groups": [
      "CSS Text Decoration"
    ],
    "initial": "currentcolor",
    "appliesto": "allElements",
    "computed": "computedColor",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-emphasis-color"
  },
  "text-emphasis-position": {
    "syntax": "auto | [ over | under ] && [ right | left ]?",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text Decoration"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-emphasis-position"
  },
  "text-emphasis-style": {
    "syntax": "none | [ [ filled | open ] || [ dot | circle | double-circle | triangle | sesame ] ] | <string>",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text Decoration"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-emphasis-style"
  },
  "text-indent": {
    "syntax": "<length-percentage> && hanging? && each-line?",
    "media": "visual",
    "inherited": true,
    "animationType": "lpc",
    "percentages": "referToWidthOfContainingBlock",
    "groups": [
      "CSS Text"
    ],
    "initial": "0",
    "appliesto": "blockContainers",
    "computed": "percentageOrAbsoluteLengthPlusKeywords",
    "order": "lengthOrPercentageBeforeKeywords",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-indent"
  },
  "text-justify": {
    "syntax": "auto | inter-character | inter-word | none",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text"
    ],
    "initial": "auto",
    "appliesto": "inlineLevelAndTableCellElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-justify"
  },
  "text-orientation": {
    "syntax": "mixed | upright | sideways",
    "media": "visual",
    "inherited": true,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Writing Modes"
    ],
    "initial": "mixed",
    "appliesto": "allElementsExceptTableRowGroupsRowsColumnGroupsAndColumns",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-orientation"
  },
  "text-overflow": {
    "syntax": "[ clip | ellipsis | <string> ]{1,2}",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Overflow"
    ],
    "initial": "clip",
    "appliesto": "blockContainerElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-overflow"
  },
  "text-rendering": {
    "syntax": "auto | optimizeSpeed | optimizeLegibility | geometricPrecision",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "auto",
    "appliesto": "textElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-rendering"
  },
  "text-shadow": {
    "syntax": "none | <shadow-t>#",
    "media": "visual",
    "inherited": true,
    "animationType": "shadowList",
    "percentages": "no",
    "groups": [
      "CSS Text Decoration"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "colorPlusThreeAbsoluteLengths",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-shadow"
  },
  "text-size-adjust": {
    "syntax": "none | auto | <percentage>",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "referToSizeOfFont",
    "groups": [
      "CSS Mobile Text Size Adjustment"
    ],
    "initial": "autoForSmartphoneBrowsersSupportingInflation",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-size-adjust"
  },
  "text-spacing-trim": {
    "syntax": "space-all | normal | space-first | trim-start",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text"
    ],
    "initial": "normal",
    "appliesto": "textElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-spacing-trim"
  },
  "text-transform": {
    "syntax": "none | [ capitalize | uppercase | lowercase ] || full-width || full-size-kana | math-auto",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text",
      "MathML"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-transform"
  },
  "text-underline-offset": {
    "syntax": "auto | <length> | <percentage>",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "referToElementFontSize",
    "groups": [
      "CSS Text Decoration"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-underline-offset"
  },
  "text-underline-position": {
    "syntax": "auto | from-font | [ under || [ left | right ] ]",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text Decoration"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "orderOfAppearance",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-underline-position"
  },
  "text-wrap": {
    "syntax": "<'text-wrap-mode'> || <'text-wrap-style'>",
    "media": "visual",
    "inherited": true,
    "animationType": [
      "text-wrap-mode",
      "text-wrap-style"
    ],
    "percentages": [
      "text-wrap-mode",
      "text-wrap-style"
    ],
    "groups": [
      "CSS Text"
    ],
    "initial": "wrap",
    "appliesto": "textAndBlockContainers",
    "computed": [
      "text-wrap-mode",
      "text-wrap-style"
    ],
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-wrap"
  },
  "text-wrap-mode": {
    "syntax": "wrap | nowrap",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text"
    ],
    "initial": "wrap",
    "appliesto": "textAndBlockContainers",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-wrap-mode"
  },
  "text-wrap-style": {
    "syntax": "auto | balance | stable | pretty",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text"
    ],
    "initial": "auto",
    "appliesto": "textAndBlockContainers",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-wrap-style"
  },
  "timeline-scope": {
    "syntax": "none | <dashed-ident>#",
    "media": "interactive",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "Scroll-driven Animations"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "noneOrOrderedListOfIdentifiers",
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/timeline-scope"
  },
  "timeline-trigger": {
    "syntax": "none | [ <'timeline-trigger-name'> <'timeline-trigger-source'> <'timeline-trigger-activation-range'> [ '/' <'timeline-trigger-active-range'> ]? ]#",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "timeline-trigger-name",
      "timeline-trigger-source",
      "timeline-trigger-activation-range",
      "timeline-trigger-active-range"
    ],
    "percentages": "no",
    "groups": [
      "CSS Animations"
    ],
    "initial": [
      "timeline-trigger-name",
      "timeline-trigger-source",
      "timeline-trigger-activation-range",
      "timeline-trigger-active-range"
    ],
    "appliesto": "allElements",
    "computed": [
      "timeline-trigger-name",
      "timeline-trigger-source",
      "timeline-trigger-activation-range",
      "timeline-trigger-active-range"
    ],
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/timeline-trigger"
  },
  "timeline-trigger-activation-range": {
    "syntax": "[ <'timeline-trigger-activation-range-start'> <'timeline-trigger-activation-range-end'>? ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": [
      "timeline-trigger-activation-range-start",
      "timeline-trigger-activation-range-end"
    ],
    "groups": [
      "CSS Animations"
    ],
    "initial": [
      "timeline-trigger-activation-range-start",
      "timeline-trigger-activation-range-end"
    ],
    "appliesto": "allElements",
    "computed": [
      "timeline-trigger-activation-range-start",
      "timeline-trigger-activation-range-end"
    ],
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/timeline-trigger-activation-range"
  },
  "timeline-trigger-activation-range-end": {
    "syntax": "[ normal | <length-percentage> | <timeline-range-name> <length-percentage>? ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "relativeToTimelineRangeIfSpecifiedOtherwiseEntireTimeline",
    "groups": [
      "CSS Animations"
    ],
    "initial": "normal",
    "appliesto": "allElements",
    "computed": "listEachItemConsistingOfNormalLengthPercentageOrNameLengthPercentage",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/timeline-trigger-activation-range-end"
  },
  "timeline-trigger-activation-range-start": {
    "syntax": "[ normal | <length-percentage> | <timeline-range-name> <length-percentage>? ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "relativeToTimelineRangeIfSpecifiedOtherwiseEntireTimeline",
    "groups": [
      "CSS Animations"
    ],
    "initial": "normal",
    "appliesto": "allElements",
    "computed": "listEachItemConsistingOfNormalLengthPercentageOrNameLengthPercentage",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/timeline-trigger-activation-range-start"
  },
  "timeline-trigger-active-range": {
    "syntax": "[ <'timeline-trigger-active-range-start'> <'timeline-trigger-active-range-end'>? ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": [
      "timeline-trigger-active-range-start",
      "timeline-trigger-active-range-end"
    ],
    "groups": [
      "CSS Animations"
    ],
    "initial": [
      "timeline-trigger-active-range-start",
      "timeline-trigger-active-range-end"
    ],
    "appliesto": "allElements",
    "computed": [
      "timeline-trigger-active-range-start",
      "timeline-trigger-active-range-end"
    ],
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/timeline-trigger-active-range"
  },
  "timeline-trigger-active-range-end": {
    "syntax": "[ auto | normal | <length-percentage> | <timeline-range-name> <length-percentage>? ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "relativeToTimelineRangeIfSpecifiedOtherwiseEntireTimeline",
    "groups": [
      "CSS Animations"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "listEachItemConsistingOfNormalLengthPercentageOrNameLengthPercentage",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/timeline-trigger-active-range-end"
  },
  "timeline-trigger-active-range-start": {
    "syntax": "[ auto | normal | <length-percentage> | <timeline-range-name> <length-percentage>? ]#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "relativeToTimelineRangeIfSpecifiedOtherwiseEntireTimeline",
    "groups": [
      "CSS Animations"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "listEachItemConsistingOfNormalLengthPercentageOrNameLengthPercentage",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": :QŮ"https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/timeline-trigger-active-range-start"
  },
  "timeline-trigger-name": {
    "syntax": "none | <dashed-ident>#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Animations"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/timeline-trigger-name"
  },
  "timeline-trigger-source": {
    "syntax": "<single-animation-timeline>#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Animations"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "listOfNoneAutoIdentScrollOrView",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/timeline-trigger-source"
  },
  "top": {
    "syntax": "auto | <length-percentage> | <anchor()> | <anchor-size()>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToContainingBlockHeight",
    "groups": [
      "CSS Anchor Positioning",
      "CSS Positioned Layout"
    ],
    "initial": "auto",
    "appliesto": "positionedElements",
    "computed": "lengthAbsolutePercentageAsSpecifiedOtherwiseAuto",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/top"
  },
  "touch-action": {
    "syntax": "auto | none | [ [ pan-x | pan-left | pan-right ] || [ pan-y | pan-up | pan-down ] || pinch-zoom ] | manipulation",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "Pointer Events"
    ],
    "initial": "auto",
    "appliesto": "allElementsExceptNonReplacedInlineElementsTableRowsColumnsRowColumnGroups",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/touch-action"
  },
  "transform": {
    "syntax": "none | <transform-list>",
    "media": "visual",
    "inherited": false,
    "animationType": "transform",
    "percentages": "referToSizeOfBoundingBox",
    "groups": [
      "CSS Transforms"
    ],
    "initial": "none",
    "appliesto": "transformableElements",
    "computed": "asSpecifiedRelativeToAbsoluteLengths",
    "order": "uniqueOrder",
    "stacking": true,
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform"
  },
  "transform-box": {
    "syntax": "content-box | border-box | fill-box | stroke-box | view-box",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Transforms"
    ],
    "initial": "view-box",
    "appliesto": "transformableElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-box"
  },
  "transform-origin": {
    "syntax": "[ <length-percentage> | left | center | right | top | bottom ] | [ [ <length-percentage> | left | center | right ] && [ <length-percentage> | top | center | bottom ] ] <length>?",
    "media": "visual",
    "inherited": false,
    "animationType": "simpleListOfLpc",
    "percentages": "referToSizeOfBoundingBox",
    "groups": [
      "CSS Transforms"
    ],
    "initial": "50% 50% 0",
    "appliesto": "transformableElements",
    "computed": "forLengthAbsoluteValueOtherwisePercentage",
    "order": "oneOrTwoValuesLengthAbsoluteKeywordsPercentages",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-origin"
  },
  "transform-style": {
    "syntax": "flat | preserve-3d",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Transforms"
    ],
    "initial": "flat",
    "appliesto": "transformableElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "stacking": true,
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-style"
  },
  "transition": {
    "syntax": "<single-transition>#",
    "media": "interactive",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Transitions"
    ],
    "initial": [
      "transition-delay",
      "transition-duration",
      "transition-property",
      "transition-timing-function",
      "transition-behavior"
    ],
    "appliesto": "allElementsAndPseudos",
    "computed": [
      "transition-delay",
      "transition-duration",
      "transition-property",
      "transition-timing-function",
      "transition-behavior"
    ],
    "order": "orderOfAppearance",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transition"
  },
  "transition-behavior": {
    "syntax": "<transition-behavior-value>#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Transitions"
    ],
    "initial": "normal",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transition-behavior"
  },
  "transition-delay": {
    "syntax": "<time>#",
    "media": "interactive",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Transitions"
    ],
    "initial": "0s",
    "appliesto": "allElementsAndPseudos",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transition-delay"
  },
  "transition-duration": {
    "syntax": "<time>#",
    "media": "interactive",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Transitions"
    ],
    "initial": "0s",
    "appliesto": "allElementsAndPseudos",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transition-duration"
  },
  "transition-property": {
    "syntax": "none | <single-transition-property>#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Transitions"
    ],
    "initial": "all",
    "appliesto": "allElementsAndPseudos",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transition-property"
  },
  "transition-timing-function": {
    "syntax": "<easing-function>#",
    "media": "interactive",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Transitions"
    ],
    "initial": "ease",
    "appliesto": "allElementsAndPseudos",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transition-timing-function"
  },
  "translate": {
    "syntax": "none | <length-percentage> [ <length-percentage> <length>? ]?",
    "media": "visual",
    "inherited": false,
    "animationType": "transform",
    "percentages": "referToSizeOfBoundingBox",
    "groups": [
      "CSS Transforms"
    ],
    "initial": "none",
    "appliesto": "transformableElements",
    "computed": "asSpecifiedRelativeToAbsoluteLengths",
    "order": "perGrammar",
    "stacking": true,
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/translate"
  },
  "trigger-scope": {
    "syntax": "none | all | <dashed-ident>#",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Animations"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Reference/Properties/trigger-scope"
  },
  "unicode-bidi": {
    "syntax": "normal | embed | isolate | bidi-override | isolate-override | plaintext",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Writing Modes"
    ],
    "initial": "normal",
    "appliesto": "allElementsSomeValuesNoEffectOnNonInlineElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/unicode-bidi"
  },
  "user-select": {
    "syntax": "auto | text | none | all",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Basic User Interface"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/user-select"
  },
  "vector-effect": {
    "syntax": "none | non-scaling-stroke | non-scaling-size | non-rotation | fixed-position",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "none",
    "appliesto": "limitedSVGElementsGraphicsAndUse",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/vector-effect"
  },
  "vertical-align": {
    "syntax": "baseline | sub | super | text-top | text-bottom | middle | top | bottom | <percentage> | <length>",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Inline"
    ],
    "initial": "baseline",
    "appliesto": "asLonghands",
    "computed": "asLonghands",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/vertical-align"
  },
  "view-timeline": {
    "syntax": "[ <'view-timeline-name'> [ <'view-timeline-axis'> || <'view-timeline-inset'> ]? ]#",
    "media": "visual",
    "inherited": false,
    "animationType": [
      "view-timeline-name",
      "view-timeline-axis"
    ],
    "percentages": "no",
    "groups": [
      "Scroll-driven Animations"
    ],
    "initial": [
      "view-timeline-name",
      "view-timeline-axis"
    ],
    "appliesto": "allElements",
    "computed": [
      "view-timeline-name",
      "view-timeline-axis"
    ],
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/view-timeline"
  },
  "view-timeline-axis": {
    "syntax": "[ block | inline | x | y ]#",
    "media": "interactive",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "Scroll-driven Animations"
    ],
    "initial": "block",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/view-timeline-axis"
  },
  "view-timeline-inset": {
    "syntax": "[ [ auto | <length-percentage> ]{1,2} ]#",
    "media": "interactive",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "relativeToCorrespondingDimensionOfRelevantScrollport",
    "groups": [
      "Scroll-driven Animations"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "listEachItemConsistingOfPairsOfAutoOrLengthPercentage",
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/view-timeline-inset"
  },
  "view-timeline-name": {
    "syntax": "[ none | <dashed-ident> ]#",
    "media": "interactive",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "Scroll-driven Animations"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "noneOrOrderedListOfIdentifiers",
    "order": "perGrammar",
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/view-timeline-name"
  },
  "view-transition-class": {
    "syntax": "none | <custom-ident>+",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS View Transitions"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard"
  },
  "view-transition-name": {
    "syntax": "none | <custom-ident> | match-element",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS View Transitions"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/view-transition-name"
  },
  "view-transition-scope": {
    "syntax": "none | all",
    "media": "visual",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS View Transitions"
    ],
    "initial": "none",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/view-transition-scope"
  },
  "visibility": {
    "syntax": "visible | hidden | collapse",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Display",
      "Scalable Vector Graphics"
    ],
    "initial": "visible",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/visibility"
  },
  "white-space": {
    "syntax": "normal | pre | pre-wrap | pre-line | <'white-space-collapse'> || <'text-wrap-mode'>",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text"
    ],
    "initial": "normal",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/white-space"
  },
  "white-space-collapse": {
    "syntax": "collapse | preserve | preserve-breaks | preserve-spaces | break-spaces",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text"
    ],
    "initial": "collapse",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/white-space-collapse"
  },
  "widows": {
    "syntax": "<integer>",
    "media": "visual",
    "inherited": true,
    "animationType": "byComputedValueType",
    "percentages": "no",
    "groups": [
      "CSS Fragmentation"
    ],
    "initial": "2",
    "appliesto": "blockContainerElements",
    "computed": "asSpecified",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/widows"
  },
  "width": {
    "syntax": "auto | <length-percentage [0,∞]> | min-content | max-content | fit-content | fit-content(<length-percentage [0,∞]>) | <calc-size()> | <anchor-size()>",
    "media": "visual",
    "inherited": false,
    "animationType": "lpc",
    "percentages": "referToWidthOfContainingBlock",
    "groups": [
      "CSS Box Sizing"
    ],
    "initial": "auto",
    "appliesto": "allElementsButNonReplacedAndTableRows",
    "computed": "percentageAutoOrAbsoluteLength",
    "order": "lengthOrPercentageBeforeKeywordIfBothPresent",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/width"
  },
  "will-change": {
    "syntax": "auto | <animateable-feature>#",
    "media": "all",
    "inherited": false,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Will Change"
    ],
    "initial": "auto",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/will-change"
  },
  "word-break": {
    "syntax": "normal | break-all | keep-all | break-word | auto-phrase",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text"
    ],
    "initial": "normal",
    "appliesto": "allElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/word-break"
  },
  "word-spacing": {
    "syntax": "normal | <length>",
    "media": "visual",
    "inherited": true,
    "animationType": "length",
    "percentages": "referToWidthOfAffectedGlyph",
    "groups": [
      "CSS Text"
    ],
    "initial": "normal",
    "appliesto": "allElements",
    "computed": "absoluteLength",
    "order": "uniqueOrder",
    "alsoAppliesTo": [
      "::first-letter",
      "::first-line",
      "::placeholder"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/word-spacing"
  },
  "word-wrap": {
    "syntax": "normal | break-word",
    "media": "visual",
    "inherited": true,
    "animationType": "discrete",
    "percentages": "no",
    "groups": [
      "CSS Text"
    ],
    "initial": "normal",
    "appliesto": "nonReplacedInlineElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/overflow-wrap"
  },
  "writing-mode": {
    "syntax": "horizontal-tb | vertical-rl | vertical-lr | sideways-rl | sideways-lr",
    "media": "visual",
    "inherited": true,
    "animationType": "notAnimatable",
    "percentages": "no",
    "groups": [
      "CSS Writing Modes"
    ],
    "initial": "horizontal-tb",
    "appliesto": "allElementsExceptTableRowColumnGroupsTableRowsColumns",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/writing-mode"
  },
  "x": {
    "syntax": "<length> | <percentage>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "referToSVGViewportWidth",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "0",
    "appliesto": "limitedSVGElementsGeometry",
    "computed": "percentageAsSpecifiedOrAbsoluteLength",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/x"
  },
  "y": {
    "syntax": "<length> | <percentage>",
    "media": "visual",
    "inherited": false,
    "animationType": "byComputedValueType",
    "percentages": "referToSVGViewportHeight",
    "groups": [
      "Scalable Vector Graphics"
    ],
    "initial": "0",
    "appliesto": "limitedSVGElementsGeometry",
    "computed": "percentageAsSpecifiedOrAbsoluteLength",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/y"
  },
  "z-index": {
    "syntax": "auto | <integer>",
    "media": "visual",
    "inherited": false,
    "animationType": "integer",
    "percentages": "no",
    "groups": [
      "CSS Positioned Layout"
    ],
    "initial": "auto",
    "appliesto": "positionedElements",
    "computed": "asSpecified",
    "order": "uniqueOrder",
    "stacking": true,
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/z-index"
  },
  "zoom": {
    "syntax": "normal | reset | <number [0,∞]> || <percentage [0,∞]>",
    "media": "visual",
    "inherited": false,
    "animationType": "notAnimatable",
    "percentages": "convertedToNumber",
    "groups": [
      "CSS Viewport"
    ],
    "initial": "1",
    "appliesto": "allElements",
    "computed": "asSpecifiedButWithPercentageConvertedToTheEquivalentNumber",
    "order": "perGrammar",
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/zoom"
  }
}
0xk	{
  "Type selectors": {
    "syntax": "element",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Type_selectors"
  },
  "Class selectors": {
    "syntax": ".class",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Class_selectors"
  },
  "ID selectors": {
    "syntax": "#id",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/ID_selectors"
  },
  "Universal selectors": {
    "syntax": "*",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Universal_selectors"
  },
  "Attribute selectors": {
    "syntax": "[attr=value]",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Attribute_selectors"
  },
  "Nesting selector": {
    "syntax": "A { &B { } }",
    "groups": [
      "CSS Nesting"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Nesting_selector"
  },
  "Selector list": {
    "syntax": ",",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Selector_list"
  },
  "Next-sibling combinator": {
    "syntax": "A + B",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Next-sibling_combinator"
  },
  "Subsequent-sibling combinator": {
    "syntax": "A ~ B",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Subsequent-sibling_combinator"
  },
  "Child combinator": {
    "syntax": "A > B",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Child_combinator"
  },
  "Descendant combinator": {
    "syntax": "A B",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Descendant_combinator"
  },
  "Column combinator": {
    "syntax": "A || B",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Column_combinator"
  },
  "Namespace separator": {
    "syntax": "A | B",
    "groups": [
      "CSS Namespaces"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Namespace_separator"
  },
  "Pseudo-classes": {
    "syntax": ":",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Pseudo-classes"
  },
  "Pseudo-elements": {
    "syntax": "::",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/Pseudo-elements"
  },
  ":active": {
    "syntax": ":active",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:active"
  },
  ":active-view-transition": {
    "syntax": ":active-view-transition",
    "groups": [
      "CSS View Transitions"
    ],
    "status": "standard"
  },
  ":active-view-transition-type()": {
    "syntax": ":active-view-transition-type( <custom-ident># )",
    "groups": [
      "CSS View Transitions"
    ],
    "status": "standard"
  },
  ":any-link": {
    "syntax": ":any-link",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:any-link"
  },
  ":autofill": {
    "syntax": ":autofill",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:autofill"
  },
  ":blank": {
    "syntax": ":blank",
    "groups": [
      "CSS Paged Media"
    ],
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:blank"
  },
  ":buffering": {
    "syntax": ":buffering",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:buffering"
  },
  ":checked": {
    "syntax": ":checked",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:checked"
  },
  ":current": {
    "syntax": ":current",
    "groups": [
      "Selectors"
    ],
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:current"
  },
  ":default": {
    "syntax": ":default",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:default"
  },
  ":defined": {
    "syntax": ":defined",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:defined"
  },
  ":dir()": {
    "syntax": ":dir( [ ltr | rtl ] )",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:dir"
  },
  ":disabled": {
    "syntax": ":disabled",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:disabled"
  },
  ":empty": {
    "syntax": ":empty",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:empty"
  },
  ":enabled": {
    "syntax": ":enabled",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:enabled"
  },
  ":first": {
    "syntax": ":first",
    "groups": [
      "CSS Paged Media"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:first"
  },
  ":first-child": {
    "syntax": ":first-child",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:first-child"
  },
  ":first-of-type": {
    "syntax": ":first-of-type",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:first-of-type"
  },
  ":focus": {
    "syntax": ":focus",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:focus"
  },
  ":focus-visible": {
    "syntax": ":focus-visible",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:focus-visible"
  },
  ":focus-within": {
    "syntax": ":focus-within",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:focus-within"
  },
  ":fullscreen": {
    "syntax": ":fullscreen",
    "groups": [
      "Selectors",
      "Fullscreen API"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:fullscreen"
  },
  ":future": {
    "syntax": ":future",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:future"
  },
  ":has()": {
    "syntax": ":has( <forgiving-relative-selector-list> )",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:has"
  },
  ":has-slotted": {
    "syntax": ":has-slotted",
    "groups": [
      "CSS Scoping"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:has-slotted"
  },
  ":host": {
    "syntax": ":host",
    "groups": [
      "CSS Scoping"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:host"
  },
  ":host()": {
    "syntax": ":host( <compound-selector> )",
    "groups": [
      "CSS Scoping"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:host_function"
  },
  ":host-context()": {
    "syntax": ":host-context( <compound-selector> )",
    "groups": [
      "CSS Scoping"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:host-context"
  },
  ":hover": {
    "syntax": ":hover",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:hover"
  },
  ":in-range": {
    "syntax": ":in-range",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:in-range"
  },
  ":indeterminate": {
    "syntax": ":indeterminate",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:indeterminate"
  },
  ":invalid": {
    "syntax": ":invalid",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:invalid"
  },
  ":is()": {
    "syntax": ":is( <forgiving-selector-list> )",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:is"
  },
  ":lang()": {
    "syntax": ":lang( <language-code> )",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:lang"
  },
  ":last-child": {
    "syntax": ":last-child",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:last-child"
  },
  ":last-of-type": {
    "syntax": ":last-of-type",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:last-of-type"
  },
  ":left": {
    "syntax": ":left",
    "groups": [
      "CSS Paged Media"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:left"
  },
  ":link": {
    "syntax": ":link",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:link"
  },
  ":local-link": {
    "syntax": ":local-link",
    "groups": [
      "Selectors"
    ],
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:local-link"
  },
  ":modal": {
    "syntax": ":modal",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:modal"
  },
  ":muted": {
    "syntax": ":muted",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:muted"
  },
  ":not()": {
    "syntax": ":not( <complex-selector-list> )",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:not"
  },
  ":nth-child()": {
    "syntax": ":nth-child( <an+b> [ of <complex-selector-list> ]? )",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:nth-child"
  },
  ":nth-last-child()": {
    "syntax": ":nth-last-child( <an+b> [ of <complex-selector-list> ]? )",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:nth-last-child"
  },
  ":nth-last-of-type()": {
    "syntax": ":nth-last-of-type( <an+b> )",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:nth-last-of-type"
  },
  ":nth-of-type()": {
    "syntax": ":nth-of-type( <an+b> )",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:nth-of-type"
  },
  ":only-child": {
    "syntax": ":only-child",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:only-child"
  },
  ":only-of-type": {
    "syntax": ":only-of-type",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:only-of-type"
  },
  ":open": {
    "syntax": ":open",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:open"
  },
  ":optional": {
    "syntax": ":optional",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:optional"
  },
  ":out-of-range": {
    "syntax": ":out-of-range",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:out-of-range"
  },
  ":past": {
    "syntax": ":past",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:past"
  },
  ":paused": {
    "syntax": ":paused",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:paused"
  },
  ":picture-in-picture": {
    "syntax": ":picture-in-picture",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:picture-in-picture"
  },
  ":placeholder-shown": {
    "syntax": ":placeholder-shown",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:placeholder-shown"
  },
  ":playing": {
    "syntax": ":playing",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:playing"
  },
  ":popover-open": {
    "syntax": ":popover-open",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:popover-open"
  },
  ":read-only": {
    "syntax": ":read-only",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:read-only"
  },
  ":read-write": {
    "syntax": ":read-write",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:read-write"
  },
  ":required": {
    "syntax": ":required",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:required"
  },
  ":right": {
    "syntax": ":right",
    "groups": [
      "CSS Paged Media"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:right"
  },
  ":root": {
    "syntax": ":root",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:root"
  },
  ":scope": {
    "syntax": ":scope",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:scope"
  },
  ":seeking": {
    "syntax": ":seeking",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:seeking"
  },
  ":stalled": {
    "syntax": ":stalled",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:stalled"
  },
  ":state()": {
    "syntax": ":state( <custom-ident> )",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:state"
  },
  ":target": {
    "syntax": ":target",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:target"
  },
  ":target-current": {
    "syntax": ":target-current",
    "groups": [
      "CSS Overflow"
    ],
    "status": "experimental"
  },
  ":target-within": {
    "syntax": ":target-within",
    "groups": [
      "Selectors"
    ],
    "status": "experimental",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:target-within"
  },
  ":user-invalid": {
    "syntax": ":user-invalid",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:user-invalid"
  },
  ":user-valid": {
    "syntax": ":user-valid",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:user-valid"
  },
  ":valid": {
    "syntax": ":valid",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:valid"
  },
  ":visited": {
    "syntax": ":visited",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:visited"
  },
  ":volume-locked": {
    "syntax": ":volume-locked",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:volume-locked"
  },
  ":where()": {
    "syntax": ":where( <complex-selector-list> )",
    "groups": [
      "Selectors"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/:where"
  },
  ":xr-overlay": {
    "syntax": ":xr-overlay",
    "groups": [
      "WebXR DOM Overlays"
    ],
    "status": "experimental"
  },
  "::-ms-browse": {
    "syntax": "::-ms-browse",
    "groups": [
      "Microsoft Extensions"
    ],
    "status": "nonstandard"
  },
  "::-ms-check": {
    "syntax": "::-ms-check",
    "groups": [
      "Microsoft Extensions"
    ],
    "status": "nonstandard"
  },
  "::-ms-clear": {
    "syntax": "::-ms-clear",
    "groups": [
      "Microsoft Extensions"
    ],
    "status": "nonstandard"
  },
  "::-ms-expand": {
    "syntax": "::-ms-expand",
    "groups": [
      "Microsoft Extensions"
    ],
    "status": "nonstandard"
  },
  "::-ms-fill": {
    "syntax": "::-ms-fill",
    "groups": [
      "Microsoft Extensions"
    ],
    "status": "nonstandard"
  },
  "::-ms-fill-lower": {
    "syntax": "::-ms-fill-lower",
    "groups": [
      "Microsoft Extensions"
    ],
    "status": "nonstandard"
  },
  "::-ms-fill-upper": {
    "syntax": "::-ms-fill-upper",
    "groups": [
      "Microsoft Extensions"
    ],
    "status": "nonstandard"
  },
  "::-ms-reveal": {
    "syntax": "::-ms-reveal",
    "groups": [
      "Microsoft Extensions"
    ],
    "status": "nonstandard"
  },
  "::-ms-thumb": {
    "syntax": "::-ms-thumb",
    "groups": [
      "Microsoft Extensions"
    ],
    "status": "nonstandard"
  },
  "::-ms-ticks-after": {
    "syntax": "::-ms-ticks-after",
    "groups": [
      "Microsoft Extensions"
    ],
    "status": "nonstandard"
  },
  "::-ms-ticks-before": {
    "syntax": "::-ms-ticks-before",
    "groups": [
      "Microsoft Extensions"
    ],
    "status": "nonstandard"
  },
  "::-ms-tooltip": {
    "syntax": "::-ms-tooltip",
    "groups": [
      "Microsoft Extensions"
    ],
    "status": "nonstandard"
  },
  "::-ms-track": {
    "syntax": "::-ms-track",
    "groups": [
      "Microsoft Extensions"
    ],
    "status": "nonstandard"
  },
  "::-ms-value": {
    "syntax": "::-ms-value",
    "groups": [
      "Microsoft Extensions"
    ],
    "status": "nonstandard"
  },
  "::-moz-progress-bar": {
    "syntax": "::-moz-progress-bar",
    "groups": [
      "Mozilla Extensions"
    ],
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::-moz-progress-bar"
  },
  "::-moz-range-progress": {
    "syntax": "::-moz-range-progress",
    "groups": [
      "Mozilla Extensions"
    ],
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::-moz-range-progress"
  },
  "::-moz-range-thumb": {
    "syntax": "::-moz-range-thumb",
    "groups": [
      "Mozilla Extensions"
    ],
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::-moz-range-thumb"
  },
  "::-moz-range-track": {
    "syntax": "::-moz-range-track",
    "groups": [
      "Mozilla Extensions"
    ],
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::-moz-range-track"
  },
  "::-webkit-progress-bar": {
    "syntax": "::-webkit-progress-bar",
    "groups": [
      "WebKit Extensions"
    ],
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::-webkit-progress-bar"
  },
  "::-webkit-progress-inner-value": {
    "syntax": "::-webkit-progress-inner-value",
    "groups": [
      "WebKit Extensions"
    ],
    "status": "nonstandard"
  },
  "::-webkit-progress-value": {
    "syntax": "::-webkit-progress-value",
    "groups": [
      "WebKit Extensions"
    ],
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::-webkit-progress-value"
  },
  "::-webkit-slider-runnable-track": {
    "syntax": "::-webkit-slider-runnable-track",
    "groups": [
      "WebKit Extensions"
    ],
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::-webkit-slider-runnable-track"
  },
  "::-webkit-slider-thumb": {
    "syntax": "::-webkit-slider-thumb",
    "groups": [
      "WebKit Extensions"
    ],
    "status": "nonstandard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::-webkit-slider-thumb"
  },
  "::after": {
    "syntax": "::after",
    "groups": [
      "CSS Pseudo-Elements"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::after"
  },
  "::backdrop": {
    "syntax": "::backdrop",
    "groups": [
      "CSS Pseudo-Elements"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::backdrop"
  },
  "::before": {
    "syntax": "::before",
    "groups": [
      "CSS Pseudo-Elements"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::before"
  },
  "::checkmark": {
    "syntax": "::checkmark",
    "groups": [
      "CSS Form Control Styling"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::checkmark"
  },
  "::cue": {
    "syntax": "::cue",
    "groups": [
      "WebVTT"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::cue"
  },
  "::cue()": {
    "syntax": "::cue( <selector> )",
    "groups": [
      "WebVTT"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::cue"
  },
  "::cue-region": {
    "syntax": "::cue-region",
    "groups": [
      "WebVTT"
    ],
    "status": "experimental"
  },
  "::cue-region()": {
    "syntax": "::cue-region( <selector> )",
    "groups": [
      "WebVTT"
    ],
    "status": "experimental"
  },
  "::details-content": {
    "syntax": "::details-content",
    "groups": [
      "CSS Pseudo-Elements"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::details-content"
  },
  "::file-selector-button": {
    "syntax": "::file-selector-button",
    "groups": [
      "CSS Pseudo-Elements"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::file-selector-button"
  },
  "::first-letter": {
    "syntax": "::first-letter",
    "groups": [
      "CSS Pseudo-Elements"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::first-letter"
  },
  "::first-line": {
    "syntax": "::first-line",
    "groups": [
      "CSS Pseudo-Elements"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::first-line"
  },
  "::grammar-error": {
    "syntax": "::grammar-error",
    "groups": [
      "CSS Pseudo-Elements"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::grammar-error"
  },
  "::highlight()": {
    "syntax": "::highlight( <custom-ident> )",
    "groups": [
      "CSS Pseudo-Elements",
      "CSS Custom Highlight API"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::highlight"
  },
  "::marker": {
    "syntax": "::marker",
    "groups": [
      "CSS Pseudo-Elements",
      "CSS Lists and Counters"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::marker"
  },
  "::part()": {
    "syntax": "::part( <ident>+ )",
    "groups": [
      "CSS Shadow Parts"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::part"
  },
  "::picker-icon": {
    "syntax": "::picker-icon",
    "groups": [
      "CSS Form Control Styling"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::picker-icon"
  },
  "::picker()": {
    "syntax": "::picker( <form-control-identifier>+ )",
    "groups": [
      "CSS Form Control Styling"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::picker"
  },
  "::placeholder": {
    "syntax": "::placeholder",
    "groups": [
      "CSS Pseudo-Elements"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::placeholder"
  },
  "::scroll-marker": {
    "syntax": "::scroll-marker",
    "groups": [
      "CSS Overflow"
    ],
    "status": "experimental"
  },
  "::scroll-marker-group": {
    "syntax": "::scroll-marker-group",
    "groups": [
      "CSS Overflow"
    ],
    "status": "experimental"
  },
  "::selection": {
    "syntax": "::selection",
    "groups": [
      "CSS Pseudo-Elements"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::selection"
  },
  "::slotted()": {
    "syntax": "::slotted( <compound-selector> )",
    "groups": [
      "CSS Scoping"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::slotted"
  },
  "::spelling-error": {
    "syntax": "::spelling-error",
    "groups": [
      "CSS Pseudo-Elements"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::spelling-error"
  },
  "::target-text": {
    "syntax": "::target-text",
    "groups": [
      "CSS Pseudo-Elements"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::target-text"
  },
  "::view-transition": {
    "syntax": "::view-transition",
    "groups": [
      "CSS View Transitions"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::view-transition"
  },
  "::view-transition-group()": {
    "syntax": "::view-transition-group([ '*' | <custom-ident> ])",
    "groups": [
      "CSS View Transitions"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::view-transition-group"
  },
  "::view-transition-image-pair()": {
    "syntax": "::view-transition-image-pair([ '*' | <custom-ident> ])",
    "groups": [
      "CSS View Transitions"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::view-transition-image-pair"
  },
  "::view-transition-new()": {
    "syntax": "::view-transition-new([ '*' | <custom-ident> ])",
    "groups": [
      "CSS View Transitions"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::view-transition-new"
  },
  "::view-transition-old()": {
    "syntax": "::view-transition-old([ '*' | <custom-ident> ])",
    "groups": [
      "CSS View Transitions"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/::view-transition-old"
  }
}
N_x^b{
  "abs()": {
    "syntax": "abs( <calc-sum> )"
  },
  "absolute-size": {
    "syntax": "xx-small | x-small | small | medium | large | x-large | xx-large | xxx-large"
  },
  "acos()": {
    "syntax": "acos( <calc-sum> )"
  },
  "alpha-value": {
    "syntax": "<number> | <percentage>"
  },
  "an+b": {
    "syntax": "odd | even | <integer> | <n-dimension> | '+'?† n | -n | <ndashdigit-dimension> | '+'?† <ndashdigit-ident> | <dashndashdigit-ident> | <n-dimension> <signed-integer> | '+'?† n <signed-integer> | -n <signed-integer> | <ndash-dimension> <signless-integer> | '+'?† n- <signless-integer> | -n- <signless-integer> | <n-dimension> ['+' | '-'] <signless-integer> | '+'?† n ['+' | '-'] <signless-integer> | -n ['+' | '-'] <signless-integer>"
  },
  "anchor()": {
    "syntax": "anchor( <anchor-name>? && <anchor-side>, <length-percentage>? )"
  },
  "anchor-name": {
    "syntax": "<dashed-ident>"
  },
  "anchor-side": {
    "syntax": "inside | outside | top | left | right | bottom | start | end | self-start | self-end | <percentage> | center"
  },
  "anchor-size": {
    "syntax": "width | height | block | inline | self-block | self-inline"
  },
  "anchor-size()": {
    "syntax": "anchor-size( [ <anchor-name> || <anchor-size> ]? , <length-percentage>? )"
  },
  "angle-percentage": {
    "syntax": "<angle> | <percentage>"
  },
  "angular-color-hint": {
    "syntax": "<angle-percentage> | <zero>"
  },
  "angular-color-stop": {
    "syntax": "<color> <color-stop-angle>?"
  },
  "angular-color-stop-list": {
    "syntax": "<angular-color-stop> , [ <angular-color-hint>? , <angular-color-stop> ]#?"
  },
  "animateable-feature": {
    "syntax": "scroll-position | contents | <custom-ident>"
  },
  "animation-action": {
    "syntax": "none | play | play-once | play-forwards | play-backwards | pause | reset | replay"
  },
  "asin()": {
    "syntax": "asin( <calc-sum> )"
  },
  "atan()": {
    "syntax": "atan( <calc-sum> )"
  },
  "atan2()": {
    "syntax": "atan2( <calc-sum>, <calc-sum> )"
  },
  "attachment": {
    "syntax": "scroll | fixed | local"
  },
  "attr()": {
    "syntax": "attr( <attr-name> <attr-type>? , <declaration-value>? )"
  },
  "attr-matcher": {
    "syntax": "[ '~' | '|' | '^' | '$' | '*' ]? '='"
  },
  "attr-modifier": {
    "syntax": "i | s"
  },
  "attr-type": {
    "syntax": "type( <syntax> ) | raw-string | number | <attr-unit>"
  },
  "attribute-selector": {
    "syntax": "'[' <wq-name> ']' | '[' <wq-name> <attr-matcher> [ <string-token> | <ident-token> ] <attr-modifier>? ']'"
  },
  "auto-repeat": {
    "syntax": "repeat( [ auto-fill | auto-fit ] , [ <line-names>? <fixed-size> ]+ <line-names>? )"
  },
  "auto-track-list": {
    "syntax": "[ <line-names>? [ <fixed-size> | <fixed-repeat> ] ]* <line-names>? <auto-repeat>\n[ <line-names>? [ <fixed-size> | <fixed-repeat> ] ]* <line-names>?"
  },
  "axis": {
    "syntax": "block | inline | x | y"
  },
  "baseline-position": {
    "syntax": "[ first | last ]? baseline"
  },
  "basic-shape": {
    "syntax": "<inset()> | <xywh()> | <rect()> | <circle()> | <ellipse()> | <polygon()> | <path()> | shape()"
  },
  "basic-shape-rect": {
    "syntax": "<inset()> | <rect()> | <xywh()>"
  },
  "bg-clip": {
    "syntax": "<visual-box> | border-area | text"
  },
  "bg-image": {
    "syntax": "<image> | none"
  },
  "bg-layer": {
    "syntax": "<bg-image> || <bg-position> [ / <bg-size> ]? || <repeat-style> || <attachment> || <visual-box> || <visual-box>"
  },
  "bg-position": {
    "syntax": "[ [ left | center | right | top | bottom | <length-percentage> ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ] | [ center | [ left | right ] <length-percentage>? ] && [ center | [ top | bottom ] <length-percentage>? ] ]"
  },
  "bg-size": {
    "syntax": "[ <length-percentage [0,∞]> | auto ]{1,2} | cover | contain"
  },
  "blend-mode": {
    "syntax": "normal | multiply | screen | overlay | darken | lighten | color-dodge | color-burn | hard-light | soft-light | difference | exclusion | hue | saturation | color | luminosity"
  },
  "blur()": {
    "syntax": "blur( <length>? )"
  },
  "brightness()": {
    "syntax": "brightness( [ <number> | <percentage> ]? )"
  },
  "calc()": {
    "syntax": "calc( <calc-sum> )"
  },
  "calc-constant": {
    "syntax": "e | pi | infinity | -infinity | NaN"
  },
  "calc-product": {
    "syntax": "<calc-value> [ '*' <calc-value> | '/' <number> ]*"
  },
  "calc-size()": {
    "syntax": "calc-size( <calc-size-basis>, <calc-sum> )"
  },
  "calc-size-basis": {
    "syntax": "<intrinsic-size-keyword> | <calc-size()> | any | <calc-sum>"
  },
  "calc-sum": {
    "syntax": "<calc-product> [ [ '+' | '-' ] <calc-product> ]*"
  },
  "calc-value": {
    "syntax": "<number> | <dimension> | <percentage> | <calc-constant> | ( <calc-sum> )"
  },
  "cf-final-image": {
    "syntax": "<image> | <color>"
  },
  "cf-mixing-image": {
    "syntax": "<percentage>? && <image>"
  },
  "circle()": {
    "syntax": "circle( <radial-size>? [ at <position> ]? )"
  },
  "clamp()": {
    "syntax": "clamp( <calc-sum>#{3} )"
  },
  "class-selector": {
    "syntax": "'.' <ident-token>"
  },
  "clip-source": {
    "syntax": "<url>"
  },
  "color": {
    "syntax": "<color-base> | currentColor | <system-color> | <light-dark()> | <deprecated-system-color>"
  },
  "color()": {
    "syntax": "color( [ from <color> ]? <colorspace-params> [ / [ <alpha-value> | none ] ]? )"
  },
  "color-base": {
    "syntax": "<hex-color> | <color-function> | <named-color> | <color-mix()> | transparent"
  },
  "color-function": {
    "syntax": "<rgb()> | <rgba()> | <hsl()> | <hsla()> | <hwb()> | <lab()> | <lch()> | <oklab()> | <oklch()> | <color()>"
  },
  "color-interpolation-method": {
    "syntax": "in [ <rectangular-color-space> | <polar-color-space> <hue-interpolation-method>? | <custom-color-space> ]"
  },
  "color-mix()": {
    "syntax": "color-mix( <color-interpolation-method> , [ <color> && <percentage [0,100]>? ]#{2})"
  },
  "color-stop": {
    "syntax": "<color-stop-length> | <color-stop-angle>"
  },
  "color-stop-angle": {
    "syntax": "[ <angle-percentage> | <zero> ]{1,2}"
  },
  "color-stop-length": {
    "syntax": "<length-percentage>{1,2}"
  },
  "color-stop-list": {
    "syntax": "<linear-color-stop> , [ <linear-color-hint>? , <linear-color-stop> ]#?"
  },
  "colorspace-params": {
    "syntax": "[<custom-params> | <predefined-rgb-params> | <xyz-params>]"
  },
  "combinator": {
    "syntax": "'>' | '+' | '~' | [ '||' ]"
  },
  "common-lig-values": {
    "syntax": "[ common-ligatures | no-common-ligatures ]"
  },
  "compat-auto": {
    "syntax": "searchfield | textarea | checkbox | radio | menulist | listbox | meter | progress-bar | button"
  },
  "compat-special": {
    "syntax": "textfield | menulist-button"
  },
  "complex-selector": {
    "syntax": "<compound-selector> [ <combinator>? <compound-selector> ]*"
  },
  "complex-selector-list": {
    "syntax": "<complex-selector>#"
  },
  "composite-style": {
    "syntax": "clear | copy | source-over | source-in | source-out | source-atop | destination-over | destination-in | destination-out | destination-atop | xor"
  },
  "compositing-operator": {
    "syntax": "add | subtract | intersect | exclude"
  },
  "compound-selector": {
    "syntax": "[ <type-selector>? <subclass-selector>* [ <pseudo-element-selector> <pseudo-class-selector>* ]* ]!"
  },
  "compound-selector-list": {
    "syntax": "<compound-selector>#"
  },
  "conic-gradient()": {
    "syntax": "conic-gradient( [ <conic-gradient-syntax> ] )"
  },
  "conic-gradient-syntax": {
    "syntax": "[ [ [ from [ <angle> | <zero> ] ]? [ at <position> ]? ] || <color-interpolation-method> ]? , <angular-color-stop-list>"
  },
  "container-condition": {
    "syntax": "[ <container-name>? <container-query>? ]!"
  },
  "container-name": {
    "syntax": "<custom-ident>"
  },
  "container-query": {
    "syntax": "not <query-in-parens> | <query-in-parens> [ [ and <query-in-parens> ]* | [ or <query-in-parens> ]* ]"
  },
  "content-distribution": {
    "syntax": "space-between | space-around | space-evenly | stretch"
  },
  "content-list": {
    "syntax": "[ <string> | <image> | <attr()> | <quote> | <counter> ]+"
  },
  "content-position": {
    "syntax": "center | start | end | flex-start | flex-end"
  },
  "content-replacement": {
    "syntax": "<image>"
  },
  "contextual-alt-values": {
    "syntax": "[ contextual | no-contextual ]"
  },
  "contrast()": {
    "syntax": "contrast( [ <number> | <percentage> ]? )"
  },
  "coord-box": {
    "syntax": "<paint-box> | view-box"
  },
  "corner-shape-value": {
    "syntax": "round | scoop | bevel | notch | square | squircle | <superellipse()>"
  },
  "cos()": {
    "syntax": "cos( <calc-sum> )"
  },
  "counter": {
    "syntax": "<counter()> | <counters()>"
  },
  "counter()": {
    "syntax": "counter( <counter-name>, <counter-style>? )"
  },
  "counter-name": {
    "syntax": "<custom-ident>"
  },
  "counter-style": {
    "syntax": "<counter-style-name> | symbols()"
  },
  "counter-style-name": {
    "syntax": "<custom-ident>"
  },
  "counters()": {
    "syntax": "counters( <counter-name>, <string>, <counter-style>? )"
  },
  "cross-fade()": {
    "syntax": "cross-fade( <cf-mixing-image> , <cf-final-image>? )"
  },
  "cubic-bezier()": {
    "syntax": "cubic-bezier( [ <number [0,1]>, <number> ]#{2} )"
  },
  "cubic-bezier-easing-function": {
    "syntax": "ease | ease-in | ease-out | ease-in-out | <cubic-bezier()>"
  },
  "cursor-predefined": {
    "syntax": "auto | default | none | context-menu | help | pointer | progress | wait | cell | crosshair | text | vertical-text | alias | copy | move | no-drop | not-allowed | e-resize | n-resize | ne-resize | nw-resize | s-resize | se-resize | sw-resize | w-resize | ew-resize | ns-resize | nesw-resize | nwse-resize | col-resize | row-resize | all-scroll | zoom-in | zoom-out | grab | grabbing"
  },
  "custom-color-space": {
    "syntax": "<dashed-ident>"
  },
  "custom-params": {
    "syntax": "<dashed-ident> [ <number> | <percentage> | none ]+"
  },
  "dasharray": {
    "syntax": "[ [ <length-percentage> | <number> ]+ ]#"
  },
  "dashndashdigit-ident": {
    "syntax": "<ident-token>"
  },
  "deprecated-system-color": {
    "syntax": "ActiveBorder | ActiveCaption | AppWorkspace | Background | ButtonHighlight | ButtonShadow | CaptionText | InactiveBorder | InactiveCaption | InactiveCaptionText | InfoBackground | InfoText | Menu | MenuText | Scrollbar | ThreeDDarkShadow | ThreeDFace | ThreeDHighlight | ThreeDLightShadow | ThreeDShadow | Window | WindowFrame | WindowText"
  },
  "discretionary-lig-values": {
    "syntax": "[ discretionary-ligatures | no-discretionary-ligatures ]"
  },
  "display-box": {
    "syntax": "contents | none"
  },
  "display-inside": {
    "syntax": "flow | flow-root | table | flex | grid | ruby"
  },
  "display-internal": {
    "syntax": "table-row-group | table-header-group | table-footer-group | table-row | table-cell | table-column-group | table-column | table-caption | ruby-base | ruby-text | ruby-base-container | ruby-text-container"
  },
  "display-legacy": {
    "syntax": "inline-block | inline-list-item | inline-table | inline-flex | inline-grid"
  },
  "display-listitem": {
    "syntax": "<display-outside>? && [ flow | flow-root ]? && list-item"
  },
  "display-outside": {
    "syntax": "block | inline | run-in"
  },
  "drop-shadow()": {
    "syntax": "drop-shadow( [ <color>? && <length>{2,3} ] )"
  },
  "dynamic-range-limit-mix()": {
    "syntax": "dynamic-range-limit-mix( [ <'dynamic-range-limit'> && <percentage [0,100]> ]#{2,} )"
  },
  "easing-function": {
    "syntax": "<linear-easing-function> | <cubic-bezier-easing-function> | <step-easing-function>"
  },
  "east-asian-variant-values": {
    "syntax": "[ jis78 | jis83 | jis90 | jis04 | simplified | traditional ]"
  },
  "east-asian-width-values": {
    "syntax": "[ full-width | proportional-width ]"
  },
  "element()": {
    "syntax": "element( <id-selector> )"
  },
  "ellipse()": {
    "syntax": "ellipse( <radial-size>? [ at <position> ]? )"
  },
  "env()": {
    "syntax": "env( <custom-ident> , <declaration-value>? )"
  },
  "exp()": {
    "syntax": "exp( <calc-sum> )"
  },
  "explicit-track-list": {
    "syntax": "[ <line-names>? <track-size> ]+ <line-names>?"
  },
  "family-name": {
    "syntax": "<string> | <custom-ident>+"
  },
  "feature-tag-value": {
    "syntax": "<string> [ <integer> | on | off ]?"
  },
  "feature-type": {
    "syntax": "@stylistic | @historical-forms | @styleset | @character-variant | @swash | @ornaments | @annotation"
  },
  "feature-value-block": {
    "syntax": "<feature-type> '{' <feature-value-declaration-list> '}'"
  },
  "feature-value-block-list": {
    "syntax": "<feature-value-block>+"
  },
  "feature-value-declaration": {
    "syntax": "<custom-ident>: <integer>+;"
  },
  "feature-value-declaration-list": {
    "syntax": "<feature-value-declaration>"
  },
  "feature-value-name": {
    "syntax": "<custom-ident>"
  },
  "filter-function": {
    "syntax": "<blur()> | <brightness()> | <contrast()> | <drop-shadow()> | <grayscale()> | <hue-rotate()> | <invert()> | <opacity()> | <saturate()> | <sepia()>"
  },
  "filter-value-list": {
    "syntax": "[ <filter-function> | <url> ]+"
  },
  "final-bg-layer": {
    "syntax": "<bg-image> || <bg-position> [ / <bg-size> ]? || <repeat-style> || <attachment> || <visual-box> || <visual-box> || <'background-color'>"
  },
  "fit-content()": {
    "syntax": "fit-content( <length-percentage [0,∞]> )"
  },
  "fixed-breadth": {
    "syntax": "<length-percentage>"
  },
  "fixed-repeat": {
    "syntax": "repeat( [ <integer [1,∞]> ] , [ <line-names>? <fixed-size> ]+ <line-names>? )"
  },
  "fixed-size": {
    "syntax": "<fixed-breadth> | minmax( <fixed-breadth> , <track-breadth> ) | minmax( <inflexible-breadth> , <fixed-breadth> )"
  },
  "font-stretch-absolute": {
    "syntax": "normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded | <percentage>"
  },
  "font-variant-css2": {
    "syntax": "normal | small-caps"
  },
  "font-weight-absolute": {
    "syntax": "normal | bold | <number [1,1000]>"
  },
  "font-width-css3": {
    "syntax": "normal | ultra-condensed | extra-condensed | condensed | semi-condensed | semi-expanded | expanded | extra-expanded | ultra-expanded"
  },
  "form-control-identifier": {
    "syntax": "select"
  },
  "frequency-percentage": {
    "syntax": "<frequency> | <percentage>"
  },
  "generic-complete": {
    "syntax": "serif | sans-serif | system-ui | cursive | fantasy | math | monospace"
  },
  "general-enclosed": {
    "syntax": "[ <function-token> <any-value> ) ] | ( <ident> <any-value> )"
  },
  "generic-family": {
    "syntax": "<generic-complete> | <generic-incomplete> | emoji | fangsong"
  },
  "generic-incomplete": {
    "syntax": "ui-serif | ui-sans-serif | ui-monospace | ui-rounded"
  },
  "geometry-box": {
    "syntax": "<shape-box> | fill-box | stroke-box | view-box"
  },
  "gradient": {
    "syntax": "<linear-gradient()> | <repeating-linear-gradient()> | <radial-gradient()> | <repeating-radial-gradient()> | <conic-gradient()> | <repeating-conic-gradient()>"
  },
  "grayscale()": {
    "syntax": "grayscale( [ <number> | <percentage> ]? )"
  },
  "grid-line": {
    "syntax": "auto | <custom-ident> | [ <integer> && <custom-ident>? ] | [ span && [ <integer> || <custom-ident> ] ]"
  },
  "historical-lig-values": {
    "syntax": "[ historical-ligatures | no-historical-ligatures ]"
  },
  "hsl()": {
    "syntax": "hsl( <hue>, <percentage>, <percentage>, <alpha-value>? ) | hsl( [ <hue> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )"
  },
  "hsla()": {
    "syntax": "hsla( <hue>, <percentage>, <percentage>, <alpha-value>? ) | hsla( [ <hue> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )"
  },
  "hue": {
    "syntax": "<number> | <angle>"
  },
  "hue-interpolation-method": {
    "syntax": "[ shorter | longer | increasing | decreasing ] hue"
  },
  "hue-rotate()": {
    "syntax": "hue-rotate( [ <angle> | <zero> ]? )"
  },
  "hwb()": {
    "syntax": "hwb( [ <hue> | none ] [ <percentage> | <number> | none ] [ <percentage> | <number> | none ] [ / [ <alpha-value> | none ] ]? )"
  },
  "hypot()": {
    "syntax": "hypot( <calc-sum># )"
  },
  "id-selector": {
    "syntax": "<hash-token>"
  },
  "image": {
    "syntax": "<url> | <image()> | <image-set()> | <element()> | <paint()> | <cross-fade()> | <gradient>"
  },
  "image()": {
    "syntax": "image( <image-tags>? [ <image-src>? , <color>? ]! )"
  },
  "image-set()": {
    "syntax": "image-set( <image-set-option># )"
  },
  "image-set-option": {
    "syntax": "[ <image> | <string> ] [ <resolution> || type(<string>) ]"
  },
  "image-src": {
    "syntax": "<url> | <string>"
  },
  "image-tags": {
    "syntax": "ltr | rtl"
  },
  "inflexible-breadth": {
    "syntax": "<length-percentage> | min-content | max-content | auto"
  },
  "inset()": {
    "syntax": "inset( <length-percentage>{1,4} [ round <'border-radius'> ]? )"
  },
  "integer": {
    "syntax": "<number-token>"
  },
  "invert()": {
    "syntax": "invert( [ <number> | <percentage> ]? )"
  },
  "keyframe-block": {
    "syntax": "<keyframe-selector># {\n  <declaration-list>\n}"
  },
  "keyframe-selector": {
    "syntax": "from | to | <percentage [0,100]> | <timeline-range-name> <percentage>"
  },
  "keyframes-name": {
    "syntax": "<custom-ident> | <string>"
  },
  "lab()": {
    "syntax": "lab( [<percentage> | <number> | none] [ <percentage> | <number> | none] [ <percentage> | <number> | none] [ / [<alpha-value> | none] ]? )"
  },
  "layer()": {
    "syntax": "layer( <layer-name> )"
  },
  "layer-name": {
    "syntax": "<ident> [ '.' <ident> ]*"
  },
  "lch()": {
    "syntax": "lch( [<percentage> | <number> | none] [ <percentage> | <number> | none] [ <hue> | none] [ / [<alpha-value> | none] ]? )"
  },
  "leader()": {
    "syntax": "leader( <leader-type> )"
  },
  "leader-type": {
    "syntax": "dotted | solid | space | <string>"
  },
  "length-percentage": {
    "syntax": "<length> | <percentage>"
  },
  "light-dark()": {
    "syntax": "light-dark( <color>, <color> )"
  },
  "line-name-list": {
    "syntax": "[ <line-names> | <name-repeat> ]+"
  },
  "line-names": {
    "syntax": "'[' <custom-ident>* ']'"
  },
  "line-style": {
    "syntax": "none | hidden | dotted | dashed | solid | double | groove | ridge | inset | outset"
  },
  "line-width": {
    "syntax": "<length> | thin | medium | thick"
  },
  "linear()": {
    "syntax": "linear( [ <number> && <percentage>{0,2} ]# )"
  },
  "linear-color-hint": {
    "syntax": "<length-percentage>"
  },
  "linear-color-stop": {
    "syntax": "<color> <color-stop-length>?"
  },
  "linear-easing-function": {
    "syntax": "linear | <linear()>"
  },
  "linear-gradient()": {
    "syntax": "linear-gradient( [ <linear-gradient-syntax> ] )"
  },
  "linear-gradient-syntax": {
    "syntax": "[ [ <angle> | <zero> | to <side-or-corner> ] || <color-interpolation-method> ]? , <color-stop-list>"
  },
  "log()": {
    "syntax": "log( <calc-sum>, <calc-sum>? )"
  },
  "mask-layer": {
    "syntax": "<mask-reference> || <position> [ / <bg-size> ]? || <repeat-style> || <geometry-box> || [ <geometry-box> | no-clip ] || <compositing-operator> || <masking-mode>"
  },
  "mask-position": {
    "syntax": "[ <length-percentage> | left | center | right ] [ <length-percentage> | top | center | bottom ]?"
  },
  "mask-reference": {
    "syntax": "none | <image> | <mask-source>"
  },
  "mask-source": {
    "syntax": "<url>"
  },
  "masking-mode": {
    "syntax": "alpha | luminance | match-source"
  },
  "matrix()": {
    "syntax": "matrix( <number>#{6} )"
  },
  "matrix3d()": {
    "syntax": "matrix3d( <number>#{16} )"
  },
  "max()": {
    "syntax": "max( <calc-sum># )"
  },
  "media-and": {
    "syntax": "<media-in-parens> [ and <media-in-parens> ]+"
  },
  "media-condition": {
    "syntax": "<media-not> | <media-and> | <media-or> | <media-in-parens>"
  },
  "media-condition-without-or": {
    "syntax": "<media-not> | <media-and> | <media-in-parens>"
  },
  "media-feature": {
    "syntax": "( [ <mf-plain> | <mf-boolean> | <mf-range> ] )"
  },
  "media-in-parens": {
    "syntax": "( <media-condition> ) | <media-feature> | <general-enclosed>"
  },
  "media-not": {
    "syntax": "not <media-in-parens>"
  },
  "media-or": {
    "syntax": "<media-in-parens> [ or <media-in-parens> ]+"
  },
  "media-query": {
    "syntax": "<media-condition> | [ not | only ]? <media-type> [ and <media-condition-without-or> ]?"
  },
  "media-query-list": {
    "syntax": "<media-query>#"
  },
  "media-type": {
    "syntax": "<ident>"
  },
  "mf-boolean": {
    "syntax": "<mf-name>"
  },
  "mf-name": {
    "syntax": "<ident>"
  },
  "mf-plain": {
    "syntax": "<mf-name> : <mf-value>"
  },
  "mf-range": {
    "syntax": "<mf-name> [ '<' | '>' ]? '='? <mf-value>\n| <mf-value> [ '<' | '>' ]? '='? <mf-name>\n| <mf-value> '<' '='? <mf-name> '<' '='? <mf-value>\n| <mf-value> '>' '='? <mf-name> '>' '='? <mf-value>"
  },
  "mf-value": {
    "syntax": "<number> | <dimension> | <ident> | <ratio>"
  },
  "min()": {
    "syntax": "min( <calc-sum># )"
  },
  "minmax()": {
    "syntax": "minmax( [ <length-percentage> | min-content | max-content | auto ] , [ <length-percentage> | <flex> | min-content | max-content | auto ] )"
  },
  "mod()": {
    "syntax": "mod( <calc-sum>, <calc-sum> )"
  },
  "n-dimension": {
    "syntax": "<dimension-token>"
  },
  "name-repeat": {
    "syntax": "repeat( [ <integer [1,∞]> | auto-fill ], <line-names>+ )"
  },
  "named-color": {
    "syntax": "aliceblue | antiquewhite | aqua | aquamarine | azure | beige | bisque | black | blanchedalmond | blue | blueviolet | brown | burlywood | cadetblue | chartreuse | chocolate | coral | cornflowerblue | cornsilk | crimson | cyan | darkblue | darkcyan | darkgoldenrod | darkgray | darkgreen | darkgrey | darkkhaki | darkmagenta | darkolivegreen | darkorange | darkorchid | darkred | darksalmon | darkseagreen | darkslateblue | darkslategray | darkslategrey | darkturquoise | darkviolet | deeppink | deepskyblue | dimgray | dimgrey | dodgerblue | firebrick | floralwhite | forestgreen | fuchsia | gainsboro | ghostwhite | gold | goldenrod | gray | green | greenyellow | grey | honeydew | hotpink | indianred | indigo | ivory | khaki | lavender | lavenderblush | lawngreen | lemonchiffon | lightblue | lightcoral | lightcyan | lightgoldenrodyellow | lightgray | lightgreen | lightgrey | lightpink | lightsalmon | lightseagreen | lightskyblue | lightslategray | lightslategrey | lightsteelblue | lightyellow | lime | limegreen | linen | magenta | maroon | mediumaquamarine | mediumblue | mediumorchid | mediumpurple | mediumseagreen | mediumslateblue | mediumspringgreen | mediumturquoise | mediumvioletred | midnightblue | mintcream | mistyrose | moccasin | navajowhite | navy | oldlace | olive | olivedrab | orange | orangered | orchid | palegoldenrod | palegreen | paleturquoise | palevioletred | papayawhip | peachpuff | peru | pink | plum | powderblue | purple | rebeccapurple | red | rosybrown | royalblue | saddlebrown | salmon | sandybrown | seagreen | seashell | sienna | silver | skyblue | slateblue | slategray | slategrey | snow | springgreen | steelblue | tan | teal | thistle | tomato | turquoise | violet | wheat | white | whitesmoke | yellow | yellowgreen"
  },
  "namespace-prefix": {
    "syntax": "<ident>"
  },
  "ndash-dimension": {
    "syntax": "<dimension-token>"
  },
  "ndashdigit-dimension": {
    "syntax": "<dimension-token>"
  },
  "ndashdigit-ident": {
    "syntax": "<ident-token>"
  },
  "ns-prefix": {
    "syntax": "[ <ident-token> | '*' ]? '|'"
  },
  "number-percentage": {
    "syntax": "<number> | <percentage>"
  },
  "numeric-figure-values": {
    "syntax": "[ lining-nums | oldstyle-nums ]"
  },
  "numeric-fraction-values": {
    "syntax": "[ diagonal-fractions | stacked-fractions ]"
  },
  "numeric-spacing-values": {
    "syntax": "[ proportional-nums | tabular-nums ]"
  },
  "offset-path": {
    "syntax": "<ray()> | <url> | <basic-shape>"
  },
  "oklab()": {
    "syntax": "oklab( [ <percentage> | <number> | none] [ <percentage> | <number> | none] [ <percentage> | <number> | none] [ / [<alpha-value> | none] ]? )"
  },
  "oklch()": {
    "syntax": "oklch( [ <percentage> | <number> | none] [ <percentage> | <number> | none] [ <hue> | none] [ / [<alpha-value> | none] ]? )"
  },
  "opacity()": {
    "syntax": "opacity( [ <number> | <percentage> ]? )"
  },
  "opacity-value": {
    "syntax": "<number> | <percentage>"
  },
  "outline-line-style": {
    "syntax": "none | dotted | dashed | solid | double | groove | ridge | inset | outset"
  },
  "outline-radius": {
    "syntax": "<length> | <percentage>"
  },
  "overflow-position": {
    "syntax": "unsafe | safe"
  },
  "page-body": {
    "syntax": "<declaration>? [ ; <page-body> ]? | <page-margin-box> <page-body>"
  },
  "page-margin-box": {
    "syntax": "<page-margin-box-type> '{' <declaration-list> '}'"
  },
  "page-margin-box-type": {
    "syntax": "@top-left-corner | @top-left | @top-center | @top-right | @top-right-corner | @bottom-left-corner | @bottom-left | @bottom-center | @bottom-right | @bottom-right-corner | @left-top | @left-middle | @left-bottom | @right-top | @right-middle | @right-bottom"
  },
  "page-selector": {
    "syntax": "<pseudo-page>+ | <ident> <pseudo-page>*"
  },
  "page-selector-list": {
    "syntax": "[ <page-selector># ]?"
  },
  "page-size": {
    "syntax": "A5 | A4 | A3 | B5 | B4 | JIS-B5 | JIS-B4 | letter | legal | ledger"
  },
  "paint": {
    "syntax": "none | <color> | <url> [none | <color>]? | context-fill | context-stroke"
  },
  "paint()": {
    "syntax": "paint( <ident>, <declaration-value>? )"
  },
  "paint-box": {
    "syntax": "<visual-box> | fill-box | stroke-box"
  },
  "palette-identifier": {
    "syntax": "<dashed-ident>"
  },
  "palette-mix()": {
    "syntax": "palette-mix(<color-interpolation-method> , [ [normal | light | dark | <palette-identifier> | <palette-mix()> ] && <percentage [0,100]>? ]#{2})"
  },
  "path()": {
    "syntax": "path( <'fill-rule'>? , <string> )"
  },
  "perspective()": {
    "syntax": "perspective( [ <length [0,∞]> | none ] )"
  },
  "polar-color-space": {
    "syntax": "hsl | hwb | lch | oklch"
  },
  "polygon()": {
    "syntax": "polygon( <'fill-rule'>? , [ <length-percentage> <length-percentage> ]# )"
  },
  "position": {
    "syntax": "[ [ left | center | right ] || [ top | center | bottom ] | [ left | center | right | <length-percentage> ] [ top | center | bottom | <length-percentage> ]? | [ [ left | right ] <length-percentage> ] && [ [ top | bottom ] <length-percentage> ] ]"
  },
  "position-area": {
    "syntax": "[ left | center | right | span-left | span-right | x-start | x-end | span-x-start | span-x-end | x-self-start | x-self-end | span-x-self-start | span-x-self-end | span-all ] || [ top | center | bottom | span-top | span-bottom | y-start | y-end | span-y-start | span-y-end | y-self-start | y-self-end | span-y-self-start | span-y-self-end | span-all ] | [ block-start | center | block-end | span-block-start | span-block-end | span-all ] || [ inline-start | center | inline-end | span-inline-start | span-inline-end | span-all ] | [ self-block-start | center | self-block-end | span-self-block-start | span-self-block-end | span-all ] || [ self-inline-start | center | self-inline-end | span-self-inline-start | span-self-inline-end | span-all ] | [ start | center | end | span-start | span-end | span-all ]{1,2} | [ self-start | center | self-end | span-self-start | span-self-end | span-all ]{1,2}"
  },
  "pow()": {
    "syntax": "pow( <calc-sum>, <calc-sum> )"
  },
  "predefined-rgb": {
    "syntax": "srgb | srgb-linear | display-p3 | display-p3-linear | a98-rgb | prophoto-rgb | rec2020"
  },
  "predefined-rgb-params": {
    "syntax": "<predefined-rgb> [ <number> | <percentage> | none ]{3}"
  },
  "pseudo-class-selector": {
    "syntax": "':' <ident-token> | ':' <function-token> <any-value> ')'"
  },
  "pseudo-element-selector": {
    "syntax": "':' <pseudo-class-selector>"
  },
  "pseudo-page": {
    "syntax": ": [ left | right | first | blank ]"
  },
  "query-in-parens": {
    "syntax": "( <container-query> ) | ( <size-feature> ) | style( <style-query> ) | scroll-state( <scroll-state-query> ) | <general-enclosed>"
  },
  "quote": {
    "syntax": "open-quote | close-quote | no-open-quote | no-close-quote"
  },
  "radial-extent": {
    "syntax": "closest-corner | closest-side | farthest-corner | farthest-side"
  },
  "radial-gradient()": {
    "syntax": "radial-gradient( [ <radial-gradient-syntax> ] )"
  },
  "radial-gradient-syntax": {
    "syntax": "[ [ [ <radial-shape> || <radial-size> ]? [ at <position> ]? ] || <color-interpolation-method> ]? , <color-stop-list>"
  },
  "radial-shape": {
    "syntax": "circle | ellipse"
  },
  "radial-size": {
    "syntax": "<radial-extent> | <length [0,∞]> | <length-percentage [0,∞]>{2}"
  },
  "ratio": {
    "syntax": "<number [0,∞]> [ / <number [0,∞]> ]?"
  },
  "ray()": {
    "syntax": "ray( <angle> && <ray-size>? && contain? && [at <position>]? )"
  },
  "ray-size": {
    "syntax": "closest-side | closest-corner | farthest-side | farthest-corner | sides"
  },
  "rect()": {
    "syntax": "rect( [ <length-percentage> | auto ]{4} [ round <'border-radius'> ]? )"
  },
  "rectangular-color-space": {
    "syntax": "srgb | srgb-linear | display-p3 | display-p3-linear | a98-rgb | prophoto-rgb | rec2020 | lab | oklab | xyz | xyz-d50 | xyz-d65"
  },
  "relative-selector": {
    "syntax": "<combinator>? <complex-selector>"
  },
  "relative-selector-list": {
    "syntax": "<relative-selector>#"
  },
  "relative-size": {
    "syntax": "larger | smaller"
  },
  "rem()": {
    "syntax": "rem( <calc-sum>, <calc-sum> )"
  },
  "repeat-style": {
    "syntax": "repeat-x | repeat-y | [ repeat | space | round | no-repeat ]{1,2}"
  },
  "repeating-conic-gradient()": {
    "syntax": "repeating-conic-gradient( [ <conic-gradient-syntax> ] )"
  },
  "repeating-linear-gradient()": {
    "syntax": "repeating-linear-gradient( [ <linear-gradient-syntax> ] )"
  },
  "repeating-radial-gradient()": {
    "syntax": "repeating-radial-gradient( [ <radial-gradient-syntax> ] )"
  },
  "reversed-counter-name": {
    "syntax": "reversed( <counter-name> )"
  },
  "rgb()": {
    "syntax": "rgb( <percentage>#{3} , <alpha-value>? ) | rgb( <number>#{3} , <alpha-value>? ) | rgb( [ <number> | <percentage> | none ]{3} [ / [ <alpha-value> | none ] ]? )"
  },
  "rgba()": {
    "syntax": "rgba( <percentage>#{3} , <alpha-value>? ) | rgba( <number>#{3} , <alpha-value>? ) | rgba( [ <number> | <percentage> | none ]{3} [ / [ <alpha-value> | none ] ]? )"
  },
  "rotate()": {
    "syntax": "rotate( [ <angle> | <zero> ] )"
  },
  "rotate3d()": {
    "syntax": "rotate3d( <number> , <number> , <number> , [ <angle> | <zero> ] )"
  },
  "rotateX()": {
    "syntax": "rotateX( [ <angle> | <zero> ] )"
  },
  "rotateY()": {
    "syntax": "rotateY( [ <angle> | <zero> ] )"
  },
  "rotateZ()": {
    "syntax": "rotateZ( [ <angle> | <zero> ] )"
  },
  "round()": {
    "syntax": "round( <rounding-strategy>?, <calc-sum>, <calc-sum> )"
  },
  "rounding-strategy": {
    "syntax": "nearest | up | down | to-zero"
  },
  "saturate()": {
    "syntax": "saturate( [ <number> | <percentage> ]? )"
  },
  "scale()": {
    "syntax": "scale( [ <number> | <percentage> ]#{1,2} )"
  },
  "scale3d()": {
    "syntax": "scale3d( [ <number> | <percentage> ]#{3} )"
  },
  "scaleX()": {
    "syntax": "scaleX( [ <number> | <percentage> ] )"
  },
  "scaleY()": {
    "syntax": "scaleY( [ <number> | <percentage> ] )"
  },
  "scaleZ()": {
    "syntax": "scaleZ( [ <number> | <percentage> ] )"
  },
  "scope-end": {
    "syntax": "<selector-list>"
  },
  "scope-start": {
    "syntax": "<selector-list>"
  },
  "scroll()": {
    "syntax": "scroll( [ <scroller> || <axis> ]? )"
  },
  "scroller": {
    "syntax": "root | nearest | self"
  },
  "scroll-state-feature": {
    "syntax": "<media-query-list>"
  },
  "scroll-state-in-parens": {
    "syntax": "( <scroll-state-query> ) | ( <scroll-state-feature> ) | <general-enclosed>"
  },
  "scroll-state-query": {
    "syntax": "not <scroll-state-in-parens> | <scroll-state-in-parens> [ [ and <scroll-state-in-parens> ]* | [ or <scroll-state-in-parens> ]* ] | <scroll-state-feature>"
  },
  "selector-list": {
    "syntax": "<complex-selector-list>"
  },
  "self-position": {
    "syntax": "center | start | end | self-start | self-end | flex-start | flex-end"
  },
  "sepia()": {
    "syntax": "sepia( [ <number> | <percentage> ]? )"
  },
  "shadow": {
    "syntax": "inset? && <length>{2,4} && <color>?"
  },
  "shadow-t": {
    "syntax": "[ <length>{2,3} && <color>? ]"
  },
  "shape": {
    "syntax": "rect(<top>, <right>, <bottom>, <left>)"
  },
  "shape-box": {
    "syntax": "<visual-box> | margin-box"
  },
  "side-or-corner": {
    "syntax": "[ left | right ] || [ top | bottom ]"
  },
  "sign()": {
    "syntax": "sign( <calc-sum> )"
  },
  "signed-integer": {
    "syntax": "<number-token>"
  },
  "signless-integer": {
    "syntax": "<number-token>"
  },
  "sin()": {
    "syntax": "sin( <calc-sum> )"
  },
  "single-animation": {
    "syntax": "<'animation-duration'> || <easing-function> || <'animation-delay'> || <single-animation-iteration-count> || <single-animation-direction> || <single-animation-fill-mode> || <single-animation-play-state> || [ none | <keyframes-name> ] || <single-animation-timeline>"
  },
  "single-animation-composition": {
    "syntax": "replace | add | accumulate"
  },
  "single-animation-direction": {
    "syntax": "normal | reverse | alternate | alternate-reverse"
  },
  "single-animation-fill-mode": {
    "syntax": "none | forwards | backwards | both"
  },
  "single-animation-iteration-count": {
    "syntax": "infinite | <number>"
  },
  "single-animation-play-state": {
    "syntax": "running | paused"
  },
  "single-animation-timeline": {
    "syntax": "auto | none | <dashed-ident> | <scroll()> | <view()>"
  },
  "single-transition": {
    "syntax": "[ none | <single-transition-property> ] || <time> || <easing-function> || <time> || <transition-behavior-value>"
  },
  "single-transition-property": {
    "syntax": "all | <custom-ident>"
  },
  "size": {
    "syntax": "closest-side | farthest-side | closest-corner | farthest-corner | <length> | <length-percentage>{2}"
  },
  "size-feature": {
    "syntax": "<media-query-list>"
  },
  "skew()": {
    "syntax": "skew( [ <angle> | <zero> ] , [ <angle> | <zero> ]? )"
  },
  "skewX()": {
    "syntax": "skewX( [ <angle> | <zero> ] )"
  },
  "skewY()": {
    "syntax": "skewY( [ <angle> | <zero> ] )"
  },
  "sqrt()": {
    "syntax": "sqrt( <calc-sum> )"
  },
  "step-position": {
    "syntax": "jump-start | jump-end | jump-none | jump-both | start | end"
  },
  "step-easing-function": {
    "syntax": "step-start | step-end | <steps()>"
  },
  "steps()": {
    "syntax": "steps( <integer>, <step-position>? )"
  },
  "style-feature": {
    "syntax": "<declaration>"
  },
  "style-in-parens": {
    "syntax": "( <style-query> ) | ( <style-feature> ) | <general-enclosed>"
  },
  "style-query": {
    "syntax": "not <style-in-parens> | <style-in-parens> [ [ and <style-in-parens> ]* | [ or <style-in-parens> ]* ] | <style-feature>"
  },
  "subclass-selector": {
    "syntax": "<id-selector> | <class-selector> | <attribute-selector> | <pseudo-class-selector>"
  },
  "superellipse()": {
    "syntax": "superellipse( [ <number> | infinity | -infinity ] )"
  },
  "supports-condition": {
    "syntax": "not <supports-in-parens> | <supports-in-parens> [ and <supports-in-parens> ]* | <supports-in-parens> [ or <supports-in-parens> ]*"
  },
  "supports-decl": {
    "syntax": "( <declaration> )"
  },
  "supports-feature": {
    "syntax": "<supports-decl> | <supports-selector-fn>"
  },
  "supports-in-parens": {
    "syntax": "( <supports-condition> ) | <supports-feature> | <general-enclosed>"
  },
  "supports-selector-fn": {
    "syntax": "selector( <complex-selector> )"
  },
  "symbol": {
    "syntax": "<string> | <image> | <custom-ident>"
  },
  "symbols()": {
    "syntax": "symbols( <symbols-type>? [ <string> | <image> ]+ )"
  },
  "symbols-type": {
    "syntax": "cyclic | numeric | alphabetic | symbolic | fixed"
  },
  "system-color": {
    "syntax": "AccentColor | AccentColorText | ActiveText | ButtonBorder | ButtonFace | ButtonText | Canvas | CanvasText | Field | FieldText | GrayText | Highlight | HighlightText | LinkText | Mark | MarkText | SelectedItem | SelectedItemText | VisitedText"
  },
  "system-family-name": {
    "syntax": "caption | icon | menu | message-box | small-caption | status-bar"
  },
  "tan()": {
    "syntax": "tan( <calc-sum> )"
  },
  "target": {
    "syntax": "<target-counter()> | <target-counters()> | <target-text()>"
  },
  "target-counter()": {
    "syntax": "target-counter( [ <string> | <url> ] , <custom-ident> , <counter-style>? )"
  },
  "target-counters()": {
    "syntax": "target-counters( [ <string> | <url> ] , <custom-ident> , <string> , <counter-style>? )"
  },
  "target-text()": {
    "syntax": "target-text( [ <string> | <url> ] , [ content | before | after | first-letter ]? )"
  },
  "text-edge": {
    "syntax": "[ text | cap | ex | ideographic | ideographic-ink ] [ text | alphabetic | ideographic | ideographic-ink ]?"
  },
  "time-percentage": {
    "syntax": "<time> | <percentage>"
  },
  "timeline-range-name": {
    "syntax": "cover | contain | entry | exit | entry-crossing | exit-crossing"
  },
  "track-breadth": {
    "syntax": "<length-percentage> | <flex> | min-content | max-content | auto"
  },
  "track-list": {
    "syntax": "[ <line-names>? [ <track-size> | <track-repeat> ] ]+ <line-names>?"
  },
  "track-repeat": {
    "syntax": "repeat( [ <integer [1,∞]> ] , [ <line-names>? <track-size> ]+ <line-names>? )"
  },
  "track-size": {
    "syntax": "<track-breadth> | minmax( <inflexible-breadth> , <track-breadth> ) | fit-content( <length-percentage> )"
  },
  "transform-function": {
    "syntax": "<matrix()> | <translate()> | <translateX()> | <translateY()> | <scale()> | <scaleX()> | <scaleY()> | <rotate()> | <skew()> | <skewX()> | <skewY()> | <matrix3d()> | <translate3d()> | <translateZ()> | <scale3d()> | <scaleZ()> | <rotate3d()> | <rotateX()> | <rotateY()> | <rotateZ()> | <perspective()>"
  },
  "transform-list": {
    "syntax": "<transform-function>+"
  },
  "transition-behavior-value": {
    "syntax": "normal | allow-discrete"
  },
  "translate()": {
    "syntax": "translate( <length-percentage> , <length-percentage>? )"
  },
  "translate3d()": {
    "syntax": "translate3d( <length-percentage> , <length-percentage> , <length> )"
  },
  "translateX()": {
    "syntax": "translateX( <length-percentage> )"
  },
  "translateY()": {
    "syntax": "translateY( <length-percentage> )"
  },
  "translateZ()": {
    "syntax": "translateZ( <length> )"
  },
  "try-size": {
    "syntax": "most-width | most-height | most-block-size | most-inline-size"
  },
  "try-tactic": {
    "syntax": "flip-block || flip-inline || flip-start"
  },
  "type-or-unit": {
    "syntax": "string | color | url | integer | number | length | angle | time | frequency | cap | ch | em | ex | ic | lh | rlh | rem | vb | vi | vw | vh | vmin | vmax | mm | Q | cm | in | pt | pc | px | deg | grad | rad | turn | ms | s | Hz | kHz | %"
  },
  "type-selector": {
    "syntax": "<wq-name> | <ns-prefix>? '*'"
  },
  "var()": {
    "syntax": "var( <custom-property-name> , <declaration-value>? )"
  },
  "view()": {
    "syntax": "view([<axis> || <'view-timeline-inset'>]?)"
  },
  "viewport-length": {
    "syntax": "auto | <length-percentage>"
  },
  "visual-box": {
    "syntax": "content-box | padding-box | border-box"
  },
  "wq-name": {
    "syntax": "<ns-prefix>? <ident-token>"
  },
  "xywh()": {
    "syntax": "xywh( <length-percentage>{2} <length-percentage [0,∞]>{2} [ round <'border-radius'> ]? )"
  },
  "xyz": {
    "syntax": "xyz | xyz-d50 | xyz-d65"
  },
  "xyz-params": {
    "syntax": "<xyz> [ <number> | <percentage> | none ]{3}"
  }
}
o9x {
  "type": "object",
  "additionalProperties": {
    "type": "object",
    "additionalProperties": false,
    "required": [
      "syntax"
    ],
    "properties": {
      "syntax": {
        "type": "string"
      }
    }
  }
}
Km?=x({
  "angle": {
    "groups": [
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/angle"
  },
  "angle-percentage": {
    "groups": [
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/angle-percentage"
  },
  "basic-shape": {
    "groups": [
      "CSS Shapes",
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/basic-shape"
  },
  "blend-mode": {
    "groups": [
      "Compositing and Blending",
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/blend-mode"
  },
  "color": {
    "groups": [
      "CSS Color",
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/color_value"
  },
  "custom-ident": {
    "groups": [
      "CSS Will Change",
      "CSS Counter Styles",
      "CSS Lists and Counters",
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/custom-ident"
  },
  "dashed-ident": {
    "groups": [
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/dashed-ident"
  },
  "dimension": {
    "groups": [
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/dimension"
  },
  "display-box": {
    "groups": [
      "CSS Display"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/display-box"
  },
  "display-inside": {
    "groups": [
      "CSS Display"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/display-inside"
  },
  "display-internal": {
    "groups": [
      "CSS Display"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/display-internal"
  },
  "display-legacy": {
    "groups": [
      "CSS Display"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/display-legacy"
  },
  "display-listitem": {
    "groups": [
      "CSS Display"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/display-listitem"
  },
  "display-outside": {
    "groups": [
      "CSS Display"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/display-outside"
  },
  "easing-function": {
    "groups": [
      "CSS Easing Functions"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/easing-function"
  },
  "filter-function": {
    "groups": [
      "Filter Effects"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/filter-function"
  },
  "flex": {
    "groups": [
      "CSS Grid Layout",
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/flex_value"
  },
  "frequency": {
    "groups": [
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/frequency"
  },
  "frequency-percentage": {
    "groups": [
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/frequency-percentage"
  },
  "gradient": {
    "groups": [
      "CSS Images",
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/gradient"
  },
  "ident": {
    "groups": [
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/ident"
  },
  "image": {
    "groups": [
      "CSS Images",
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/image"
  },
  "integer": {
    "groups": [
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/integer"
  },
  "length": {
    "groups": [
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/length"
  },
  "length-percentage": {
    "groups": [
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/length-percentage"
  },
  "line-style": {
    "groups": [
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/line-style"
  },
  "number": {
    "groups": [
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/number"
  },
  "overflow": {
    "groups": [
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/overflow_value"
  },
  "percentage": {
    "groups": [
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/percentage"
  },
  "position": {
    "groups": [
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/position_value"
  },
  "ratio": {
    "groups": [
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/ratio"
  },
  "resolution": {
    "groups": [
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/resolution"
  },
  "shape": {
    "groups": [
      "CSS Types"
    ],
    "status": "obsolete",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/shape"
  },
  "string": {
    "groups": [
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/string"
  },
  "text-edge": {
    "groups": [
      "CSS Types",
      "CSS Inline"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/text-edge"
  },
  "time": {
    "groups": [
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/time"
  },
  "time-percentage": {
    "groups": [
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/time-percentage"
  },
  "transform-function": {
    "groups": [
      "CSS Transforms",
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/transform-function"
  },
  "url": {
    "groups": [
      "CSS Types"
    ],
    "status": "standard",
    "mdn_url": "https://developer.mozilla.org/docs/Web/CSS/url_value"
  }
}
` x p{{3o49=022  "experimental",
  37J=4<7
\30Web/CSS/"
      }
    }4$groups",
      "status"
    ]
  }
}
+!x{
  "cap": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "ch": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "cm": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "deg": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "dpcm": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "dpi": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "dppx": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "em": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "ex": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "fr": {
    "groups": [
      "CSS Values and Units",
      "CSS Flexible Box Layout",
      "CSS Grid Layout"
    ],
    "status": "standard"
  },
  "grad": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "Hz": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "ic": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "in": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "kHz": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "mm": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "ms": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "pc": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "pt": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "px": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "Q": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "rad": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "rem": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "s": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "turn": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "vh": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "vmax": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "vmin": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "vw": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  },
  "x": {
    "groups": [
      "CSS Values and Units"
    ],
    "status": "standard"
  }
}
tx As!$Exb module.exports = {
  api: require('./api'),
  css: require('./css'),
  l10n: require('./l10n'),
}
i*xH 100644 css.json sd7  n100644 index.js ᾤ.(nCa]g.$Ux   {
  "\"\"": {
    "en-US": "\"\" (the empty string)",
    "fr": "\"\" (une chaîne vide)",
    "ja": "\"\" (空文字列)",
    "zh-CN": "\"\"（空字符串）"
  },
  "\". \"": {
    "en-US": "\". \" (full stop followed by a space)",
    "fr": "\". \" (point suivi d'un espace)",
    "ja": "\". \" (ピリオドの後に空白)",
    "zh-CN": "\". \"（句号后跟一个空格）"
  },
  "absoluteLength": {
    "de": "absolute {{cssxref(\"length\")}}",
    "en-US": "absolute {{cssxref(\"length\")}}",
    "fr": "une longueur ({{cssxref(\"length\")}}) absolue",
    "ja": "絶対的な{{cssxref(\"length\", \"長さ\")}}",
    "ru": "абсолютная {{cssxref(\"length\")}}",
    "zh-CN": "绝对 {{cssxref(\"length\")}}",
    "zh-TW": "絕對{{cssxref(\"length\")}}"
  },
  "absoluteLengthOrAsSpecified": {
    "de": "für Prozent- und Längenwerte die absolute Länge, ansonsten wie angegeben",
    "en-US": "for percentage and length values, the absolute length, otherwise as specified",
    "fr": "pour les valeurs en pourcentages ou en longueur, la longueur absolue, sinon, comme défini",
    "ja": "パーセンテージか length を指定すると絶対的な値、それ以外は指定通り",
    "ru": "для процентов и значений длин, абсолютной длины, если другое не указано",
    "zh-CN": "对于百分比和长度值，其为绝对长度，否则为指定值",
    "zh-TW": "百分比和長度值時為絕對長度，否則按指定值"
  },
  "absoluteLengthOrKeyword": {
    "de": "für Prozentwerte und Längenwerte die absolute Länge, ansonsten das Schlüsselwort wie angegeben",
    "en-US": "for percentage and length values, the absolute length, otherwise the keyword as specified",
    "fr": "pour les valeurs exprimées en pourcentages ou en longueur, la longueur absolue, sinon, le mot-clé comme défini",
    "ja": "パーセンテージか長さを指定すると絶対的な値、それ以外は指定されたキーワード",
    "ru": "для процентов и значений длин, абсолютных длин или ключевых слов, если указаны",
    "zh-TW": "百分比和長度值時為絕對長度，否則按指定關鍵字"
  },
  "absoluteLengthOrNone": {
    "de": "die absolute Länge oder <code>none</code>",
    "en-US": "the absolute length or <code>none</code>",
    "fr": "la longueur absolue ou le mot-clé <code>none</code>",
    "ja": "絶対的な長さまたは <code>none</code>",
    "ru": "абсолютная длина или <code>none</code>",
    "zh-TW": "絕對長度或 <code>none</code>"
  },
  "absoluteLengthOrNormal": {
    "de": "die absolute Länge oder das Schlüsselwort <code>normal</code>",
    "en-US": "the absolute length or the keyword <code>normal</code>",
    "fr": "la longueur absolue ou le mot-clé <code>normal</code>",
    "ja": "絶対的な長さまたはキーワード <code>normal</code>",
    "ru": "абсолютная длина или ключевое слово <code>normal</code>",
    "zh-TW": "絕對長度或關鍵字 <code>normal</code>"
  },
  "absoluteLengthOrPercentage": {
    "de": "für {{cssxref(\"length\")}} der absolute Wert, ansonsten ein Prozentwert",
    "en-US": "for {{cssxref(\"length\")}} the absolute value, otherwise a percentage",
    "fr": "pour {{cssxref(\"length\")}}, la valeur absolue, sinon un pourcentage",
    "ja": "{{cssxref(\"length\")}} の場合は絶対的な値、それ以外はパーセント値",
    "ru": "для {{cssxref(\"length\")}} абсолютного значения, иначе процент",
    "zh-TW": "{{cssxref(\"length\")}}情況下為絕對值，否則為百分比"
  },
  "absoluteLengthOrPercentageNumbersConverted": {
    "en-US": "an absolute {{cssxref(\"length\")}} or {{cssxref(\"percentage\")}}, numbers converted to absolute lengths first",
    "fr": "une longueur ({{cssxref(\"length\")}}) absolue ou un pourcentage ({{cssxref(\"percentage\")}}), les nombres étant d'abord convertis en longueurs absolues"
  },
  "absoluteLengthSnappedAsLineWidth": {
    "en-US": "the absolute {{cssxref(\"length\")}}, snapped as a line width"
  },
  "absoluteLengthsSpecifiedColorAsSpecified": {
    "de": "Längen absolut gemacht; angegebene Farben berechnet; ansonsten wie angegeben",
    "en-US": "any length made absolute; any specified color computed; otherwise as specified",
    "fr": "toute longueur sous forme absolue&nbsp;; toute couleur sous forme calculée&nbsp;; sinon comme défini",
    "ja": "指定値（length は全て絶対値となり、color については計算値となる）",
    "ru": "любая абсолютная длина; работает любой указанный цвет; если другое не указано",
    "zh-TW": "任何長度均為絕對值；任何指定顏色均為計算值；否則按指定值"
  },
  "absoluteLengthZeroOrLarger": {
    "de": "the absolute length, zero oder larger",
    "en-US": "the absolute length, zero or larger",
    "fr": "la valeur absolue valant zéro ou plus",
    "ja": "ゼロ以上の絶対的な長さ",
    "ru": "абсолютная длина, ноль или больше",
    "zh-CN": "绝对长度，零或更大",
    "zh-TW": "大於 0 的絕對長度"
  },
  "absolutelyPositionedElements": {
    "de": "absolut positionierte Elemente",
    "en-US": "absolutely positioned elements",
    "fr": "éléments positionnés de manière absolue",
    "ja": "絶対位置指定された要素",
    "ru": "абсолютно позиционированные элементы",
    "zh-CN": "绝对定位元素",
    "zh-TW": "絕對定位的元素"
  },
  "absoluteURIOrNone": {
    "de": "absolute URI oder <code>none</code>",
    "en-US": "absolute URI or <code>none</code>",
    "fr": "une URI absolue ou <code>none</code>",
    "ja": "絶対 URI または <code>none</code>",
    "ru": "абсолютный URI или <code>none</code>",
    "zh-CN": "绝对 URI 或 <code>none</code>",
    "zh-TW": "絕對 URI 或 <code>none</code>"
  },
  "all": {
    "de": "alle",
    "en-US": "all",
    "fr": "tous",
    "ja": "すべて",
    "ru": "всё",
    "zh-CN": "所有",
    "zh-TW": "全部"
  },
  "allElements": {
    "de": "alle Elemente",
    "en-US": "all elements",
    "fr": "tous les éléments",
    "ja": "すべての要素",
    "pl": "wszystkich elementów",
    "ru": "все элементы",
    "zh-CN": "所有元素",
    "zh-TW": "所有元素"
  },
  "allElementsAcceptingWidthOrHeight": {
    "de": "alle Elemente, die Breite oder Höhe akzeptieren",
    "en-US": "all elements that accept width or height",
    "fr": "tous les éléments acceptant une largeur ou une hauteur",
    "ja": "width および height を受け付ける全ての要素",
    "ru": "все элементы, которые могут иметь ширину и высоту",
    "zh-TW": "所有接受寬度或高度的元素"
  },
  "allElementsAndPseudos": {
    "de": "alle Elemente, {{cssxref(\"::before\")}} und {{cssxref(\"::after\")}} <a href=\"/de/docs/Web/CSS/Reference/Selectors/Pseudo-elements\">Pseudoelemente</a>",
    "en-US": "all elements, {{cssxref(\"::before\")}} and {{cssxref(\"::after\")}} <a href=\"/en-US/docs/Web/CSS/Reference/Selectors/Pseudo-elements\">pseudo-elements</a>",
    "es": "todos los elementos y los <a href=\"/es/docs/Web/CSS/Reference/Selectors/Pseudo-elements\">pseudoelementos</a> {{cssxref(\"::before\")}} y {{cssxref(\"::after\")}}",
    "fr": "tous les éléments, ainsi que les <a href=\"/fr/docs/Web/CSS/Reference/Selectors/Pseudo-elements\">pseudo-éléments</a> {{cssxref(\"::before\")}} et {{cssxref(\"::after\")}}",
    "ja": "すべての要素、{{cssxref(\"::before\")}} / {{cssxref(\"::after\")}} <a href=\"/ja/docs/Web/CSS/Reference/Selectors/Pseudo-elements\">擬似要素</a>",
    "ru": "все элементы, {{cssxref(\"::before\")}} и {{cssxref(\"::after\")}} <a href=\"/ru/docs/Web/CSS/Reference/Selectors/Pseudo-elements\">псевдоэлементы</a>",
    "zh-TW": "所有元素，{{cssxref(\"::before\")}} 和 {{cssxref(\"::after\")}} <a href=\"/zh-TW/docs/Web/CSS/Reference/Selectors/Pseudo-elements\">偽元素</a>"
  },
  "allElementsAndText": {
    "en-US": "all elements and text",
    "fr": "tous les éléments et le texte",
    "ja": "すべての要素とテキスト",
    "zh-CN": "所有元素和文本",
    "zh-TW": "所有元素和文字"
  },
  "allElementsButNonReplacedAndTableColumns": {
    "de": "alle Elemente außer nicht ersetzte Inlineelemente, Tabellenspalten und Spaltengruppen",
    "en-US": "all elements but non-replaced inline elements, table columns, and column groups",
    "es": "elementos de bloque o remplazados",
    "fr": "tous les éléments sauf les éléments en ligne non remplacés, les colonnes de tableaux et les groupes de colonnes",
    "ja": "非置換インライン要素、テーブルの列、列グループを除くすべての要素",
    "ru": "все элементы, кроме незаменяемых строчных элементов, табличных колонок и групп колонок",
    "zh-CN": "适用于所有元素，但不包括非替换行级元素、表格列和列组",
    "zh-TW": "所有元素，除了非替換的行內元素、表格行和行群組"
  },
  "allElementsButNonReplacedAndTableRows": {
    "de": "alle Elemente außer nicht ersetzte Inlineelemente, Tabellenzeilen und Zeilengruppen",
    "en-US": "all elements but non-replaced inline elements, table rows, and row groups",
    "fr": "tous les éléments sauf les éléments en ligne non remplacés, les lignes de tableaux et les groupes de lignes",
    "ja": "置換要素でないインライン要素、テーブルの行、行グループを除くすべての要素",
    "ru": "все элементы, кроме незаменяемых строчных элементов, табличных строк и групп строк",
    "zh-TW": "所有元素，除了非替換的行內元素、表格列和列群組"
  },
  "allElementsCreatingNativeWindows": {
    "de": "alle Elemente, die native Fenster erstellen, z. B. &lt;window&gt;, &lt;panel&gt;",
    "en-US": "all elements that create native windows, e.g. &lt;window&gt;, &lt;panel&gt;",
    "fr": "tous les éléments qui créent des fenêtres natives, par exemple &lt;window&gt;, &lt;panel&gt;",
    "ja": "ネイティブウィンドウを生成するすべての要素、たとえば &lt;window&gt;, &lt;panel&gt;",
    "ru": "все элементы, создающие нативные окна, например, &lt;window&gt;, &lt;panel&gt;",
    "zh-TW": "所有能建立原生視窗的元素，例如 &lt;window&gt;、&lt;panel&gt;"
  },
  "allElementsExceptGeneratedContentOrPseudoElements": {
    "de": "alle Elemente außer generierte Inhalte oder Pseudoelemente",
    "en-US": "all elements except generated content or pseudo-elements",
    "fr": "tous les éléments sauf le contenu généré ou les pseudo-éléments",
    "ja": "生成コンテンツや擬似要素を除くすべての要素",
    "ru": "все элементы, кроме сгенерированного контента и псевдоэлементов",
    "zh-TW": "所有元素，除了產生的內容或偽元素"
  },
  "allElementsExceptInlineBoxesAndInternalRubyOrTableBoxes": {
    "de": "all elements except inline boxes and internal ruby or table boxes",
    "en-US": "all elements except inline boxes and internal ruby or table boxes",
    "fr": "all elements except inline boxes and internal ruby or table boxes",
    "ja": "インラインボックスおよび内部のルビまたは表ボックスを除くすべての要素",
    "ru": "all elements except inline boxes and internal ruby or table boxes",
    "zh-TW": "所有元素，除了行內區塊和內部的音標或表格區塊"
  },
  "allElementsExceptInternalTableDisplayTypes": {
    "de": "alle Elemente außer <code>table-row-group</code>, <code>table-header-group</code>, <code>table-footer-group</code>, <code>table-row</code>, <code>table-column-group</code> und <code>table-column</code>",
    "en-US": "all elements, except <code>table-row-group</code>, <code>table-header-group</code>, <code>table-footer-group</code>, <code>table-row</code>, <code>table-column-group</code> and <code>table-column</code>",
    "fr": "tous les éléments exceptés <code>table-row-group</code>, <code>table-header-group</code>, <code>table-footer-group</code>, <code>table-row</code>, <code>table-column-group</code> et <code>table-column</code>",
    "ja": "<code>table-row-group</code>, <code>table-header-group</code>, <code>table-footer-group</code>, <code>table-row</code>, <code>table-column-group</code>, <code>table-column</code> を除くすべての要素",
    "ru": "все элементы, кроме <code>table-row-group</code>, <code>table-header-group</code>, <code>table-footer-group</code>, <code>table-row</code>, <code>table-column-group</code> и <code>table-column</code>",
    "zh-TW": "所有元素，除了 <code>table-row-group</code>、<code>table-header-group</code>、<code>table-footer-group</code>、<code>table-row</code>、<code>table-column-group</code> 和 <code>table-column</code>"
  },
  "allElementsExceptNonReplacedInlineElementsTableRowsColumnsRowColumnGroups": {
    "de": "alle Elemente außer: nicht ersetzte Inlineelemente, Tabellenzeilen, Zeilengruppen, Tabellenspalten und Spaltengruppen",
    "en-US": "all elements except: non-replaced inline elements, table rows, row groups, table columns, and column groups",
    "fr": "tous les éléments sauf&nbsp;: les éléments en ligne non remplacés, les lignes, les groupes de lignes, les colonnes et les groupes de colonnes pour les tableaux",
    "ja": "非置換インライン要素、表の行、行グループ、表の列、列グループを除くすべての要素",
    "ru": "все элементы, кроме: незаменяемых строчных элементов, строк и колонок таблиц",
    "zh-TW": "所有元素，除了非替換的行內元素、表格列、列群組、表格欄和欄群組"
  },
  "allElementsExceptTableDisplayTypes": {
    "de": "alle Elemente außer Elemente mit Tabellen-{{cssxref(\"display\")}}-Typen, die nicht <code>table-caption</code>, <code>table</code> und <code>inline-table</code> entsprechen",
    "en-US": "all elements, except elements with table {{cssxref(\"display\")}} types other than <code>table-caption</code>, <code>table</code> and <code>inline-table</code>",
    "fr": "tous les éléments exceptés ceux dont les types {{cssxref(\"display\")}} pour les tableaux ne sont pas <code>table-caption</code>, <code>table</code> et <code>inline-table</code>",
    "ja": "<code>table-caption</code>, <code>table</code>, <code>inline-table</code> 以外の表の {{cssxref(\"display\")}} 種別を除くすべての要素",
    "ru": "все элементы, кроме элементов с табличным типом {{cssxref(\"display\")}}, отличным от <code>table-caption</code>, <code>table</code> и <code>inline-table</code>",
    "zh-TW": "所有元素，除了表格{{cssxref(\"display\")}}類型為 <code>table-caption</code>、<code>table</code> 和 <code>inline-table</code> 以外的元素"
  },
  "allElementsExceptTableElementsWhenCollapse": {
    "de": "Alle Elemente, außer interne Tabellenelemente, falls {{cssxref(\"border-collapse\")}} <code>collapse</code> ist",
    "en-US": "all elements, except internal table elements when {{cssxref(\"border-collapse\")}} is <code>collapse</code>",
    "fr": "tous les éléments sauf les éléments de table internes lorsque {{cssxref(\"border-collapse\")}} vaut <code>collapse</code>",
    "ja": "すべての要素。ただし {{cssxref(\"border-collapse\")}} が <code>collapse</code> のときはテーブル要素内部にあるものを除く",
    "ru": "все элементы, кроме внутренних табличных элементов, когда {{cssxref(\"border-collapse\")}}:<code>collapse</code>",
    "zh-TW": "所有元素，當 {{cssxref(\"border-collapse\")}} 為 <code>collapse</code> 時，內部表格元素除外"
  },
  "allElementsExceptTableRowColumnGroupsTableRowsColumns": {
    "de": "alle Elemente außer Tabellenzeilengruppen, Tabellenspaltengruppen, Tabellenzeilen und Tabellenspalten",
    "en-US": "all elements except table row groups, table column groups, table rows, and table columns",
    "fr": "tous les éléments exceptés les groupes de lignes, les groupes de colonnes des tableaux et les colonnes de tableaux",
    "ja": "表の行グループ、表の列グループ、表の行、表の列を除くすべての要素",
    "ru": "все элементы, кроме групп табличных строк, групп табличных столбцов, табличных строк и табличных колонок",
    "zh-TW": "所有元素，除了表格行群組、表格列群組、表格行和表格列"
  },
  "allElementsExceptTableRowGroupsRowsColumnGroupsAndColumns": {
    "de": "alle Elemente außer Tabellenzeilengruppen, Zeilen, Spaltengruppen und Spalten",
    "en-US": "all elements, except table row groups, rows, column groups, and columns",
    "fr": "tous les éléments exceptés les groupes de lignes, les lignes, les groupes de colonnes et les colonnes de tableaux",
    "ja": "表の行グループ、列グループ、行、列を除くすべての要素",
    "ru": "все элементы, кроме групп табличных строк, столбцов, групп столбцов и столбцов",
    "zh-TW": "所有元素，除了表格列群組、列、表格欄群組和欄"
  },
  "allElementsNoEffectIfDisplayNone": {
    "de": "alle Elemente, hat jedoch keinen Effekt, falls der Wert von {{cssxref(\"display\")}} <code>none</code> ist",
    "en-US": "all elements, but has no effect if the value of {{cssxref(\"display\")}} is <code>none</code>.",
    "fr": "tous les éléments mais n'a aucun effet si la valeur de <code>display</code> est <code>none</code>.",
    "ja": "すべての要素。ただし {{cssxref(\"display\")}} が <code>none</code> なら効果を持ちません。",
    "ru": "все элементы, но не будет эффекта, если <code>display: none</code>",
    "zh-TW": "所有元素，但 {{cssxref(\"display\")}} 的值為 <code>none</code> 時則無效。"
  },
  "allElementsSomeValuesNoEffectOnNonInlineElements": {
    "de": "Alle Elemente, einige Werte haben keine Wirkung bei non-inline Elementen",
    "en-US": "all elements, though some values have no effect on non-inline elements",
    "fr": "tous les éléments bien que certaines valeurs n'aient pas d'effet sur les éléments qui ne sont pas en ligne",
    "ja": "すべての要素。ただし一部の値はインラインでない要素には効果がありません",
    "ru": "все элементы, хотя некоторые значения не работают на не строчных элементах",
    "zh-TW": "所有元素，但某些值對非行內元素無效"
  },
  "allElementsSVGContainerElements": {
    "de": "alle Elemente; In SVG gilt betrifft dies Containerelemente mit Ausnahme des {{SVGElement(\"defs\")}} Elements und allen Grafikelementen",
    "en-US": "all elements; In SVG, it applies to container elements excluding the {{SVGElement(\"defs\")}} element and all graphics elements",
    "fr": "tous les éléments&nbsp;; en SVG, cela s'applique aux éléments conteneurs à l'exception des éléments {{SVGElement(\"defs\")}} et des éléments graphiques",
    "ja": "すべての要素。 SVG の場合は {{SVGElement(\"defs\")}} 要素やすべてのグラフィック要素を除いたコンテナー要素に適用される",
    "ru": "все элементы; в SVG, это применяется к контейнерам, исключая элемент {{SVGElement(\"defs\")}} и все графические элементы",
    "zh-TW": "所有元素；在 SVG 中，這適用於容器元素，但不包括 {{SVGElement(\"defs\")}} 元素和所有圖形元素"
  },
  "allElementsSVGContainerGraphicsAndGraphicsReferencingElements": {
    "de": "Alle Elemente. In SVG wird er auf Containerelemente, Grafikelemente und Grafiken referenzierende Elemente angewandt.",
    "en-US": "All elements. In SVG, it applies to container elements, graphics elements, and graphics referencing elements.",
    "fr": "Tous les éléments. En SVG, cela s'applique aux éléments de conteneurs, aux éléments graphiques et aux éléments faisant référence à des éléments graphiques.",
    "ja": "すべての要素。 SVG では、コンテナー要素、グラフィック要素、グラフィック参照要素に適用されます。",
    "ru": "Все элементы. В SVG это применяется к контейнерам, графическим элементам и элементам графической отсылки.",
    "zh-TW": "所有元素。在 SVG 中，這適用於容器元素、圖形元素和圖形參考元素。"
  },
  "allElementsThatCanReferenceImages": {
    "en-US": "Any element that can have an image applied to it, for example as a {{cssxref(\"background-image\")}}, {{cssxref(\"border-image\")}}, or {{cssxref(\"list-style-image\")}}.",
    "fr": "Tout élément pouvant avoir une image appliquée, par exemple en tant que {{cssxref(\"background-image\")}}, {{cssxref(\"border-image\")}} ou {{cssxref(\"list-style-image\")}}.",
    "ja": "{{cssxref(\"background-image\")}}, {{cssxref(\"border-image\")}}, {{cssxref(\"list-style-image\")}} などで適用される画像を持つすべての要素。",
    "zh-TW": "任何可以套用圖片的元素，例如作為 {{cssxref(\"background-image\")}}、{{cssxref(\"border-image\")}} 或 {{cssxref(\"list-style-image\")}}。"
  },
  "allElementsThatGenerateAPrincipalBox": {
    "en-US": "All elements that generate a <a href=\"https://drafts.csswg.org/css-display-4/#principal-box\">principal box</a>",
    "fr": "Tous les éléments qui génèrent une <a href=\"https://drafts.csswg.org/css-display-4/#principal-box\">boîte principale <sup>(angl.)</sup></a>"
  },
  "allElementsTreeAbidingPseudoElementsPageMarginBoxes": {
    "ja": "すべての要素、ツリーに現れる擬似要素、ページのマージンボックス",
    "en-US": "All elements, tree-abiding pseudo-elements, and page margin boxes",
    "fr": "Tous les éléments, les pseudo-éléments respectant l'arborescence et les boîtes de marge de page"
  },
  "allElementsUAsNotRequiredWhenCollapse": {
    "de": "alle Elemente; aber User Agents sind nicht gezwungen dies auf <code>table</code> und <code>inline-table</code> Elemente anzuwenden, falls {{cssxref(\"border-collapse\")}} <code>collapse</code> ist. Das Verhalten bei internen Tabellenelementen ist momentan undefiniert.",
    "en-US": "all elements; but User Agents are not required to apply to <code>table</code> and <code>inline-table</code> elements when {{cssxref(\"border-collapse\")}} is <code>collapse</code>. The behavior on internal table elements is undefined for the moment.",
    "fr": "tous les éléments, mais les agents utilisateurs ne sont pas tenus de l'appliquer aux éléments de type <code>table</code> ou <code>inline-table</code> lorsque {{cssxref(\"border-collapse\")}} vaut <code>collapse</code>. Le comportement sur les éléments de type table interne est pour l'instant indéfini.",
    "ja": "すべての要素。ただし、ユーザーエージェントは {{cssxref(\"border-collapse\")}} が <code>collapse</code> である場合に<code>table</code> および <code>inline-table</code> 要素に適用する必要はない。内部表要素での動作は、今のところ未定義。",
    "ru": "все элементы, но браузеры не применяют к элементам <code>table</code> и <code>inline-table</code>, когда {{cssxref(\"border-collapse\")}}:<code>collapse</code>. Поведение на внутритабличных элементах не определено."
  },
  "allHTMLElements": {
    "de": "alle HTML-Elemente",
    "en-US": "all HTML elements",
    "fr": "tous les éléments HTML",
    "ja": "すべての HTML 要素",
    "ru": "все HTML элементы",
    "zh-TW": "所有 HTML 元素"
  },
  "andInEnumeration": {
    "de": " und ",
    "en-US": " and ",
    "fr": " et ",
    "ja": "および",
    "ru": " и ",
    "zh-TW": " 和 "
  },
  "angle": {
    "de": "Winkel",
    "en-US": "angle",
    "fr": "angle",
    "ja": "角度",
    "ru": "угол",
    "zh-TW": "角度"
  },
  "angleBasicShapeOrPath": {
    "de": "{{cssxref(\"<angle>\"}}, {{cssxref(\"<basic-shape>\"}} oder {{cssxref(\"<path()>\"}}",
    "en-US": "{{cssxref(\"<angle>\"}}, {{cssxref(\"<basic-shape>\"}} or {{cssxref(\"<path()>\"}}",
    "fr": "{{cssxref(\"<angle>\"}}, {{cssxref(\"<basic-shape>\"}} ou {{cssxref(\"<path()>\"}}",
    "ja": "{{cssxref(\"<angle>\"}}, {{cssxref(\"<basic-shape>\"}}, {{cssxref(\"<path()>\"}} のいずれか",
    "zh-TW": "{{cssxref(\"<angle>\"}}、{{cssxref(\"<basic-shape>\"}} 或 {{cssxref(\"<path()>\"}}"
  },
  "angleOrBasicShapeOrPath": {
    "de": "als &lt;angle&gt;, &lt;basic-shape&gt; oder &lt;path()&gt;",
    "en-US": "as &lt;angle&gt;, &lt;basic-shape&gt; or &lt;path()&gt;",
    "fr": "comme &lt;angle&gt;, &lt;basic-shape&gt; ou &lt;path()&gt;",
    "ja": "&lt;angle&gt;, &lt;basic-shape&gt;, &lt;path()&gt; の何れかとして",
    "ru": "как &lt;angle&gt;, &lt;basic-shape&gt; или &lt;path()&gt;",
    "zh-TW": "作為 &lt;angle&gt;、&lt;basic-shape&gt; 或 &lt;path()&gt;"
  },
  "angleRoundedToNextQuarter": {
    "de": "ein {{cssxref(\"angle\")}}, auf den nächsten Viertel von <code>0deg</code> gerundet (üblicherweise  <code>1turn)</code>",
    "en-US": "an {{cssxref(\"angle\")}}, rounded to the next quarter turn from <code>0deg</code> and normalized, that is moduloing the value by <code>1turn</code>",
    "fr": "un {{cssxref(\"angle\")}}, arrondi au quart de tour supérieur (à partir de <code>0deg</code>) puis normalisé (modulo) pour obtenir l'angle relatif à un tour",
    "ja": "<code>0deg</code> から次の 4 分の 1 回転に丸めて正規化した {{cssxref(\"angle\")}} を <code>1turn</code> で割った余り",
    "ru": "{{cssxref(\"angle\")}}, с округлением до следующей четверти оборота от <code>0deg</code> и нормализованный так, что значение - <code>1 поворот</code>"
  },
  "animationType": {
    "de": "Animationstyp",
    "en-US": "Animation type",
    "fr": "Type d'animation",
    "ja": "アニメーションの種類",
    "zh-CN": "动画类型",
    "zh-TW": "動畫類型"
  },
  "anyElementEffectOnProgressAndMeter": {
    "de": "beliebige Elemente; es hat eine Auswirkung auf {{HTMLElement(\"progress\")}} und {{HTMLElement(\"meter\")}}, aber nicht auf &lt;input type=\"range\"&gt; oder andere Elemente",
    "en-US": "any element; it has an effect on {{HTMLElement(\"progress\")}} and {{HTMLElement(\"meter\")}}, but not on &lt;input type=\"range\"&gt; or other elements",
    "fr": "n'importe quel élément, aura un effet sur {{HTMLElement(\"progress\")}} et {{HTMLElement(\"meter\")}}, mais pas sur <code>&lt;input type=\"range\"&gt;</code> ou les autres éléments",
    "ja": "任意の要素。これは {{HTMLElement(\"progress\")}} および {{HTMLElement(\"meter\")}} には効果がありますが、 &lt;input type=\"range\"&gt; やその他の要素には効果がありません",
    "ru": "любой элемент; имеет эффект на {{HTMLElement(\"progress\")}} и {{HTMLElement(\"meter\")}}, но не на &lt;input type=\"range\"&gt; или других элементах"
  },
  "appliesTo": {
    "de": "Anwendbar auf",
    "en-US": "Applies to",
    "fr": "Applicabilité",
    "ja": "適用対象",
    "ko": "적용대상",
    "pl": "Stosowana do",
    "pt-BR": "Aplica-se a",
    "ru": "Применяется к",
    "zh-CN": "适用元素",
    "zh-TW": "適用於"
  },
  "applyingToMultiple": {
    "de": "$1$. Auch anwendbar auf $2$.",
    "en-US": "$1$. It also applies to $2$.",
    "fr": "$1$. S'applique aussi à $2$.",
    "ja": "$1$。 $2$ にも適用されます。",
    "ru": "$1$. Это также применяется к $2$.",
    "zh-TW": "$1$。也適用於 $2$。"
  },
  "asAutoOrColor": {
    "en-US": "<code>auto</code> is computed as specified and <code>&lt;color&gt;</code> values are computed as defined for the {{cssxref(\"color\")}} property.",
    "de": "<code>auto</code> wird wie angegeben berechnet und <code>&lt;color&gt;</code> Werte werden wie für die {{cssxref(\"color\")}} Eigenschaft berechnet.",
    "fr": "<code>auto</code> est calculé comme défini et les valeurs <code>&lt;color&gt;</code> sont calculées comme défini pour la propriété {{cssxref(\"color\")}}.",
    "ja": "<code>auto</code> は仕様通りに計算され、 <code>&lt;color&gt;</code> 値は {{cssxref(\"color\")}} プロパティで定義されたように計算される。"
  },
  "asColorOrAbsoluteURL": {
    "en-US": "as specified, but with <code>&lt;color&gt;</code> values computed and <code>&lt;url&gt;</code> values made absolute"
  },
  "asDefinedForBasicShapeWithAbsoluteURIOtherwiseAsSpecified": {
    "de": "wie definiert für {{cssxref(\"basic-shape\")}} (gefolgt von {{cssxref(\"shape-box\")}}, falls angegeben), dem {{cssxref(\"image\")}}, dessen URI absolut gemacht wurde, ansonsten wie angegeben.",
    "en-US": "as defined for {{cssxref(\"basic-shape\")}} (with {{cssxref(\"shape-box\")}} following, if supplied), the {{cssxref(\"image\")}} with its URI made absolute, otherwise as specified.",
    "fr": "comme défini pour {{cssxref(\"basic-shape\")}} (avec {{cssxref(\"shape-box\")}} qui suit s'il est utilisé), l'{{cssxref(\"image\")}} avec son URI rendue absolue, sinon, comme défini.",
    "ja": "{{cssxref(\"basic-shape\")}} で定義された通り (与えられている場合は {{cssxref(\"shape-box\")}} が続く)、 URI を絶対化した {{cssxref(\"image\")}}、それ以外は指定通り。",
    "ru": "как определено для {{cssxref(\"basic-shape\")}} (c {{cssxref(\"shape-box\")}} последующим, если передается),  {{cssxref(\"image\")}} с его абсолютным URI, если другое не указано"
  },
  "asIfPossibleOtherwiseDiscrete": {
    "en-US": "as if possible, otherwise discrete",
    "fr": "si possible, sinon de manière discrète"
  },
  "asLength": {
    "de": "als {{cssxref(\"length\")}}",
    "en-US": "as {{cssxref(\"length\")}}",
    "fr": "comme {{cssxref(\"length\")}}",
    "ja": "{{cssxref(\"length\")}} 通り",
    "ru": "как {{cssxref(\"length\")}}",
    "zh-CN": "为 {{cssxref(\"length\")}} 值"
  },
  "asLonghands": {
    "de": "wie die jeweiligen Kurzschreibweisen:",
    "en-US": "as each of the properties of the shorthand:",
    "fr": "pour chaque propriété individuelle de la propriété raccourcie&nbsp;:",
    "ja": "一括指定の次の各プロパティとして",
    "ru": "как и у каждого из подсвойств этого свойства:",
    "zh-CN": "该简写所对应的每个属性："
  },
  "asSpecified": {
    "de": "wie angegeben",
    "en-US": "as specified",
    "es": "como se especifica",
    "ca": "com s'especifica",
    "fr": "comme défini",
    "ja": "指定通り",
    "pl": "jako określone",
    "ru": "как указано"
  },
  "asSpecifiedAppliesToEachProperty": {
    "de": "wie der angegebene Wert wird er auf alle Eigenschaften angewandt, für die dies eine Kurzschreibweise ist.",
    "en-US": "as the specified value applies to each property this is a shorthand for.",
    "fr": "comme la valeur définie s'applique sur chaque propriété englobée par le raccourci",
    "ja": "この一括指定が対象とする各プロパティに適用する指定された値のまま。",
    "ru": "как указанное значение, применяется к каждому свойству этой короткой записи."
  },
  "asSpecifiedButVisibleOrClipReplacedToAutoOrHiddenIfOtherValueDifferent": {
    "en-US": "as specified, except with <code>visible</code>/<code>clip</code> computing to <code>auto</code>/<code>hidden</code> respectively if one of {{cssxref(\"overflow-x\")}} or {{cssxref(\"overflow-y\")}} is neither <code>visible</code> nor </code>clip</code>",
    "es": "como se especifica, excepto que si {{cssxref(\"overflow-x\")}} o bien {{cssxref(\"overflow-y\")}} es distinto de <code>visible</code> o <code>clip</code>, estos dos valores computan a <code>auto</code> o <code>hidden</code> respectivamente",
    "fr": "comme défini, sauf avec <code>visible</code>/<code>clip</code> qui sont calculés en <code>auto</code>/<code>hidden</code> respectivement si l'une des valeurs de {{cssxref(\"overflow-x\")}} ou {{cssxref(\"overflow-y\")}} n'est ni <code>visible</code> ni <code>clip</code>",
    "ca": "com s'especifica, excepte que si {{cssxref(\"overflow-x\")}} o bé {{cssxref(\"overflow-y\")}} són diferents de <code>visible</code> o <code>clip</code>, aquests dos valors computen a <code>auto</code> o <code>hidden</code> respectivament",
    "ja": "指定通り、ただし {{cssxref(\"overflow-x\")}} と {{cssxref(\"overflow-y\")}} のどちらかが <code>visible</code> でも </code>clip</code> でもない場合は、 <code>visible</code>/<code>clip</code> はそれぞれ <code>auto</code>/<code>hidden</code> と計算される"
  },
  "asSpecifiedButWithPercentageConvertedToTheEquivalentNumber": {
    "en-US": "as specified, but with {{cssxref(\"&lt;percentage&gt;\")}} converted to the equivalent {{cssxref(\"&lt;number&gt;\")}}",
    "fr": "comme défini, mais avec les pourcentages ({{cssxref(\"&lt;percentage&gt;\")}}) convertis en nombres ({{cssxref(\"&lt;number&gt;\")}}) équivalents"
  },
  "asSpecifiedExceptMatchParent": {
    "de": "wie angegeben, außer für den <code>match-parent</code> Wert, welcher in Bezug auf den <code>direction</code> Wert des Elternelements berechnet wird und einen berechneten Wert von <code>left</code> oder <code>right</code> ergibt",
    "en-US": "as specified, except for the <code>match-parent</code> value which is calculated against its parent's <code>direction</code> value and results in a computed value of either <code>left</code> or <code>right</code>",
    "fr": "comme défini, sauf pour la valeur <code>match-parent</code> qui est calculée en fonction de la <code>direction</code> du parent et qui vaut soit <code>left</code>, soit <code>right</code>",
    "ja": "指定値。ただし <code>match-parent</code> 値を除く。この値は親要素の <code>direction</code> の値に基いて計算され、計算値が <code>left</code> または <code>right</code> のどちらかになる",
    "ru": "как указано, кроме значения <code>match-parent</code>, которое вычисляется вместо значения его родителя <code>direction</code>, а результаты в вычисленном значении <code>left</code> или <code>right</code>"
  },
  "asSpecifiedExceptPositionedFloatingAndRootElementsKeywordMaybeDifferent": {
    "de": "wie der angegebene Wert, außer für positionierte und umfließende Elemente und das Wurzelelement. In beiden Fällen kann der berechnete Wert ein Schlüsselwort sein, das nicht dem angegebenen entspricht.",
    "en-US": "as the specified value, except for positioned and floating elements and the root element. In both cases the computed value may be a keyword other than the one specified.",
    "fr": "comme la valeur définie, excepté pour les éléments positionnés et flottants, ainsi que pour l'élément racine. Dans les deux cas, la valeur calculée peut être un mot clé différent de celui défini.",
    "ja": "指定通り。ただし位置指定された要素とフロート、ルート要素を除く。これらは計算値が指定したものと違うキーワードになる可能性があります",
    "ru": "как указанное значение, кроме как для позиционированных и плавающих элементов и корневого элемента. В обоих случаях вычисляемое значение может быть ключевым словом, отличным от указанного.",
    "zh-CN": "为指定的值，但定位元素、浮动元素和根元素除外。在这两种情况下，计算值可能是不同于指定值的其他关键字。"
  },
  "asSpecifiedRelativeToAbsoluteLengths": {
    "de": "relativ zur gleichen Achse der Innenabstandsbox des Scrollcontainers",
    "en-US": "as specified, but with relative lengths converted into absolute lengths",
    "fr": "comme défini, mais avec les longueurs relatives converties en longueurs absolues",
    "ja": "指定通り。ただし相対的な長さはは絶対的な長さに変換される",
    "ru": "как указано, но с относительной длиной, конвертируемой в абсолютные длины"
  },
  "asSpecifiedURLsAbsolute": {
    "de": "wie angegeben, aber mit absoluten {{cssxref(\"url\")}} Werten",
    "en-US": "as specified, but with {{cssxref(\"url\")}} values made absolute",
    "fr": "comme défini, mais avec les valeurs {{cssxref(\"url\")}} rendues absolues",
    "ja": "指定通り、ただし {{cssxref(\"url\")}} の値は絶対パスになる",
    "ru": "как указано, но с абсолютными значениями {{cssxref(\"url\")}}"
  },
  "asSpecifiedWithExceptionOfResolution": {
    "de": "wie angegeben mit Ausnahme von &lt;resolution&gt;, das möglicherweise durch den berechneten Wert für 'snap' geändert wird",
    "en-US": "as specified, except with &lt;resolution&gt; possibly altered by computed for 'snap' value",
    "fr": "tel que défini, sauf avec une résolution ({{cssxref(\"resolution\")}}) éventuellement modifiée lors du calcul par la valeur <code>\"snap\"</code>",
    "ja": "指定通り、ただし &lt;resolution&gt; は 'snap' の値に変更されることがある",
    "ru": "как указано, за исключением &lt;resolution&gt; может изменить значением 'snap'"
  },
  "asSpecifiedWithLengthsAbsoluteAndNormalComputingToZeroExceptMultiColumn": {
    "en-US": "as specified, with &lt;length&gt;s made absolute, and normal computing to zero except on multi-column elements",
    "fr": "tel que défini, avec des longueurs ({{cssxref(\"length\")}}) rendues absolues, et normal calculé à zéro sauf sur les éléments multi-colonnes",
    "ja": "指定通りで、 &lt;length&gt; は絶対長になり、 normal の計算値は段組み要素を除き 0 になる"
  },
  "asSpecifiedWithLengthValuesComputed": {
    "en-US": "as specified, with &lt;length&gt;s values computed",
    "fr": "tel que défini, avec les valeurs de longueurs ({{cssxref(\"length\")}}) calculées"
  },
  "asSpecifiedWithVarsSubstituted": {
    "de": "wie angegeben, wobei Variablen ersetzt werden",
    "en-US": "as specified with variables substituted",
    "fr": "tel que défini avec les variables échangées",
    "ja": "変数を代入して指定した通り"
  },
  "autoForSmartphoneBrowsersSupportingInflation": {
    "de": "<code>auto</code> für Smartphone Browser, die Befüllung unterstützen, <code>none</code> andererseits (und dann unveränderbar).",
    "en-US": "<code>auto</code> for smartphone browsers supporting inflation, <code>none</code> in other cases (and then not modifiable).",
    "fr": "<code>auto</code> pour les navigateurs de smartphones qui supportent l'expansion, <code>none</code> dans les autres cas (non modifiable alors).",
    "ja": "文字拡大に対応しているスマートフォンブラウザーならば <code>auto</code>、それ以外の場合は <code>none</code> (そして変更不可)。",
    "ru": "<code>auto</code> для браузеров в смартфонах поддерживается увеличение, <code>none</code> в других случаях (и позже не изменяется)."
  },
  "autoForTranslucentColorRGBAOtherwiseRGB": {
    "de": "Für das Schlüsselwort <code>auto</code> ist der berechnete Wert <code>currentcolor</code>. Für den Farbwert, falls der Wert durchscheinend ist, ist der berechnete Wert der entsprechende <code>rgba()</code> Wert. Falls nicht, ist er der entsprechende <code>rgb()</code> Wert. Das Schlüsselwort <code>transparent</code> wird zu <code>rgba(0,0,0,0)</code>.",
    "en-US": "For the keyword <code>auto</code>, the computed value is <code>currentcolor</code>. For the color value, if the value is translucent, the computed value will be the <code>rgba()</code> corresponding one. If it isn't, it will be the <code>rgb()</code> corresponding one. The <code>transparent</code> keyword maps to <code>rgba(0,0,0,0)</code>.",
    "fr": "Pour le mot-clé <code>auto</code>, la valeur calculée est <code>currentcolor</code>. Pour la valeur de la couleur, si la valeur est transparente, la valeur calculée sera la valeur <code>rgba()</code> correspondante. S'il n'y en a pas, ce sera la valeur <code>rgb()</code> correspondante. Le mot-clé <code>transparent</code> correspondra à <code>rgba(0,0,0,0)</code>.",
    "ja": "キーワード <code>auto</code> の場合は、計算値も <code>currentcolor</code>。色の場合は、半透明であれば、計算値はそれに一致する <code>rbga()</code> で、不透明であれば、それに一致する <code>rgb()</code>。キーワード <code>transparent</code> は <code>rgba(0,0,0,0)</code> に対応付けられる。",
    "ru": "Для ключевого слова <code>auto</code>, значение - <code>currentcolor</code>. Для значения цвета, если значение имеет прозрачность, соответственно, значение будет через <code>rgba()</code>. Если это не так, это будет <code>rgb()</code>. Ключевое слово <code>transparent</code> отображается, как <code>rgba(0,0,0,0)</code>."
  },
  "autoNonNegativeOrPercentage": {
    "de": "<code>auto</code>, eine nicht negative Zahl oder ein Prozentwert wie angegeben",
    "en-US": "<code>auto</code>, or a non-negative number or percentage as specified",
    "fr": "<code>auto</code> ou un nombre positif ou nul ou un pourcentage, comme défini",
    "ja": "<code>auto</code>、負ではない数、パーセント値の何れかで指定通り",
    "ru": "<code>auto</code>, или задаётся неотрицательное число или процент, как указан"
  },
  "autoOnAbsolutelyPositionedElementsValueOfAlignItemsOnParent": {
    "de": "<code>auto</code> berechnet sich zu sich selbst bei absolut positionierten Elementen und zum berechneten Wert von {{cssxref(\"align-items\")}} des Elternelements (abzüglich veralteter Schlüsselwörter) bei allen anderen Boxen oder <code>start</code>, falls die Box kein Elternelement hat. Sein Verhalten hängt vom Layoutmodell ab, wie für {{cssxref(\"justify-self\")}} beschrieben. Ansonsten der angegebene Wert.",
    "en-US": "<code>auto</code> computes to itself on absolutely-positioned elements, and to the computed value of {{cssxref(\"align-items\")}} on the parent (minus any legacy keywords) on all other boxes, or <code>start</code> if the box has no parent. Its behavior depends on the layout model, as described for {{cssxref(\"justify-self\")}}. Otherwise the specified value.",
    "fr": "<code>auto</code> sera calculé comme <code>auto</code> pour les éléments positionnés de façon absolue, sera calculé comme {{cssxref(\"align-items\")}} sur le parent (excepté les mots-clés historiques utilisés) de toutes les autres boîtes ou comme <code>start</code> si la boîte n'a pas de parent. Son comportement dépend du modèle de disposition, décrit dans {{cssxref(\"justify-self\")}}, sinon ce sera la valeur définie.",
    "ja": "絶対位置指定要素に対しては <code>auto</code> は自分自身に対して計算し、それ以外のすべてのボックスに対しては親の {{cssxref(\"align-items\")}} の計算値 (から古いキーワードを引いた値) に計算し、親が無ければ <code>start</code> になる。この動作は {{cssxref(\"justify-self\")}} で説明したとおり、レイアウトモデルの依存する。それ以外の場合は指定された値となる。",
    "ru": "при <code>auto</code> абсолютно позиционированные элементы вычисляют сами и вычисленное значение {{cssxref(\"align-items\")}} для родителя (кроме ключевых слов) на остальных блоках, или <code>start</code>, если у блока нет родителя. Его поведение зависит от модели макета, описываемой {{cssxref(\"justify-self\")}}. Иначе указанное значение."
  },
  "autoOrAbsoluteLength": {
    "en-US": "<code>auto</code> if specified as <code>auto</code>, otherwise for {{cssxref(\"length\")}} the absolute value specified"
  },
  "autoOrRectangle": {
    "de": "<code>auto</code>, falls als <code>auto</code> angegeben, ansonsten ein Rechteck mit vier Werten, von denen jeder <code>auto</code> ist, falls als <code>auto</code> angegeben, ansonsten die berechnete Länge",
    "en-US": "<code>auto</code> if specified as <code>auto</code>, otherwise a rectangle with four values, each of which is <code>auto</code> if specified as <code>auto</code> or the computed length otherwise",
    "fr": "<code>auto</code> si défini comme <code>auto</code>, sinon un rectangle avec quatre valeurs dont chacune vaut <code>auto</code> si elles sont définies comme <code>auto</code> sinon, la longueur calculée",
    "ja": "<code>auto</code> が指定されていれば <code>auto</code>、それ以外は 4 つの値をともなう矩形。矩形の場合、各値は <code>auto</code> が指定されていれば <code>auto</code>、それ以外では長さの計算値",
    "ru": "<code>auto</code>, если указано как <code>auto</code>, иначе прямоугольник с четырьмя значениями, каждое из которых <code>auto</code>, если указаны как <code>auto</code> или вычисленная длина в противном случае"
  },
  "basicShape": {
    "de": "eine <a href=\"/de/docs/Web/CSS/Reference/Properties/shape-outside#interpolation\" title=\"Werte des <basic-shape> CSS Datentyps interpolieren als einfache Liste. Die Listenwerte interpolieren als Länge, Prozentwert oder calc, wo möglich. Falls Listenwerte nicht einem dieser Typen entsprechen, aber identisch sind, werden diese Werte interpoliert.\">einfache Form</a>",
    "en-US": "a <a href=\"/en-US/docs/Web/CSS/Reference/Properties/shape-outside#interpolation\" title=\"Values of the <basic-shape> CSS data type interpolate as a simple list. The list values interpolate as length, percentage, or calc where possible. If list values are not one of those types but are identical, those values do interpolate.\">basic shape</a>",
    "fr": "une <a href=\"/fr/docs/Web/CSS/Reference/Properties/shape-outside#interpolation\" title=\"Les valeurs de type CSS <forme-basique> sont interpolées comme une liste simple. La liste de valeurs interpole la longueur, le pourcentage ou la valeur calculée. Si les valeurs de la liste ne sont pas de ces types mais sont identiques, les valeurs seront interpolées.\">forme basique (<code>basic-shape</code>)</a>",
    "ja": "<a href=\"/ja/docs/Web/CSS/Reference/Properties/shape-outside#interpolation\" title=\"CSS データ型 <basic-shape> の値は単純なリストとして補間されます。リストの値は、可能であれば長さ、パーセント値、または calc() として補間されます。リストの値がこれらの型のいずれかではなく、同じ値である場合、それらの値は補間されます。\">基本シェイプ</a>",
    "ru": "<a href=\"/ru/docs/Web/CSS/Reference/Properties/shape-outside#interpolation\" title=\"Значения типа <базовая фигура> интерполируются как простой список. Список значений интерполируется как длина, проценты, или расчёт, где возможен. Если список значений не одинакового типа, эти значения интерполируются.\">базовая фигура</a>"
  },
  "basicShapeOtherwiseNo": {
    "de": "ja, wie angegeben für {{cssxref(\"basic-shape\")}}, ansonsten nein",
    "en-US": "yes, as specified for {{cssxref(\"basic-shape\")}}, otherwise no",
    "fr": "oui, comme défini pour {{cssxref(\"basic-shape\")}}, sinon, non",
    "ja": "{{cssxref(\"basic-shape\")}} で指定された場合はあり、それ以外の場合はなし",
    "ru": "да, как указано для {{cssxref(\"basic-shape\")}}, иначе нет"
  },
  "beforeAndAfterPseudos": {
    "de": "{{cssxref(\"::before\")}} und{{cssxref(\"::after\")}} <a href=\"/de/docs/Web/CSS/Reference/Pseudo-elements\">Pseudoelemente</a>",
    "en-US": "{{cssxref(\"::before\")}} and {{cssxref(\"::after\")}} <a href=\"/en-US/docs/Web/CSS/Reference/Pseudo-elements\">pseudo-elements</a>",
    "es": "los <a href=\"/es/docs/Web/CSS/Reference/Pseudo-elements\">pseudoelementos</a> {{cssxref(\"::before\")}} y {{cssxref(\"::after\")}}",
    "fr": "<a href=\"/fr/docs/Web/CSS/Reference/Pseudo-elements\">pseudo-éléments</a> {{cssxref(\"::before\")}} et {{cssxref(\"::after\")}}",
    "ja": "{{cssxref(\"::before\")}} / {{cssxref(\"::after\")}} <a href=\"/ja/docs/Web/CSS/Reference/Pseudo-elements\">擬似要素</a>",
    "ru": "{{cssxref(\"::before\")}} и {{cssxref(\"::after\")}} <a href=\"/ru/docs/Web/CSS/Reference/Pseudo-elements\">псевдоэлементы</a>"
  },
  "blockContainerElements": {
    "de": "Blockcontainerelemente",
    "en-US": "block container elements",
    "fr": "les éléments conteneurs de blocs",
    "ja": "ブロックコンテナー要素",
    "ru": "блочные контейнеры",
    "zh-CN": "区块容器元素"
  },
  "blockContainers": {
    "de": "Blockcontainer",
    "en-US": "block containers",
    "fr": "conteneurs de type bloc",
    "ja": "ブロックコンテナー",
    "ru": "блочные контейнеры",
    "zh-CN": "区块容器"
  },
  "blockContainersAndInlineBoxes": {
    "en-US": "Block containers and inline boxes",
    "fr": "Conteneurs de type bloc et boîtes en ligne"
  },
  "blockContainersAndMultiColumnContainers": {
    "de": "Blockcontainer und mehrspaltige Container",
    "en-US": "Block containers and multi-column containers",
    "fr": "Conteneurs de type bloc et conteneurs multi-colonnes",
    "ja": "ブロックコンテナーと段組みコンテナー"
  },
  "blockContainersExceptMultiColumnContainers": {
    "de": "Blockcontainer außer mehrspaltige Container",
    "en-US": "Block containers except multi-column containers",
    "fr": "Conteneurs de type bloc, sauf les conteneurs multi-colonnes",
    "ja": "段組みコンテナーを除くブロックコンテナー"
  },
  "blockContainersExceptTableWrappers": {
    "de": "Blockcontainer außer Tabellen umgebende Boxen",
    "en-US": "Block containers except table wrapper boxes",
    "fr": "Conteneurs de type bloc, sauf les boîtes englobant les tableaux",
    "ja": "表ラッパーボックスを除くブロックコンテナー"
  },
  "blockContainersFlexContainersGridContainers": {
    "en-US": "Block-containers, flex containers, and grid containers",
    "fr": "Conteneurs de type bloc, conteneurs flexibles et conteneurs de grille",
    "ja": "ブロックコンテナー, フレックスコンテナー, グリッドコンテナー"
  },
  "blockContainersFlexContainersGridContainersInlineBoxesTableRowsSVGTextContentElements": {
    "en-US": "Block-containers, flex containers, grid containers, inline boxes, table rows, and SVG text content elements",
    "fr": "Conteneurs de type bloc, conteneurs flexibles, conteneurs de grille, boîtes en ligne, lignes de tableau et éléments de contenu textuel SVG"
  },
  "blockContainersMultiColumnContainersFlexContainersGridContainers": {
    "en-US": "Block-containers, multi-column containers, flex containers",
    "fr": "Conteneurs de type bloc, conteneurs multi-colonnes et conteneurs flexibles"
  },
  "blockElementsInNormalFlow": {
    "de": "Blocklevelelemente in normalem Fluss des Wurzelelements. User Agents können es auch auf andere Elemente wie <code>table-row</code>-Elemente anwenden.",
    "en-US": "block-level elements in the normal flow of the root element. User agents may also apply it to other elements like <code>table-row</code> elements.",
    "fr": "les éléments de bloc dans le flux normal de l'élément racine. Les agents utilisateurs peuvent également l'appliquer sur d'autres éléments comme <code>table-row</code>.",
    "ja": "ルート要素の通常フロー内におけるブロックレベル要素。ユーザーエージェントは他の要素に <code>table-row</code> 要素のように適用することがあります。",
    "ru": "блочные элементы в нормальном потоке родительского элемента. Браузеры могут также применять это к другим элементам типа <code>table-row</code>."
  },
  "blockLevelBoxesAndAbsolutelyPositionedBoxesAndGridItems": {
    "en-US": "block-level boxes, absolutely-positioned boxes, and grid items",
    "fr": "boîtes de niveau bloc, boîtes positionnées en absolu et éléments de grille"
  },
  "blockLevelElements": {
    "de": "Blocklevel Elemente",
    "en-US": "block-level elements",
    "fr": "éléments de type bloc",
    "ja": "ブロックレベル要素",
    "ru": "блочные элементы"
  },
  "blockSizeOfContainingBlock": {
    "de": "Blockgröße des beinhaltenden Blocks",
    "en-US": "block-size of containing block",
    "fr": "la taille de bloc du bloc englobant",
    "ja": "包含ブロックの block-size",
    "ru": "размер блока, содержащего элемент"
  },
  "boxElements": {
    "de": "Boxelemente",
    "en-US": "box elements",
    "fr": "éléments de boîte",
    "ja": "ボックス要素",
    "ru": "блочные элементы",
    "zh-CN": "盒元素"
  },
  "byComputedValue": {
    "en-US": "by computed value",
    "fr": "par valeur calculée"
  },
  "byComputedValueType": {
    "en-US": "by computed value type",
    "fr": "par type de valeur calculée",
    "ja": "計算値の型による",
    "zh-CN": "按计算值的类型"
  },
  "byComputedValueTypeNormalAnimatesAsObliqueZeroDeg": {
    "en-US": "by computed value type; <code>normal</code> animates as <code>oblique 0deg</code>",
    "fr": "par type de valeur calculée&nbsp;; <code>normal</code> s'anime comme <code>oblique 0deg</code>"
  },
  "byDynamicRangeLimitMix": {
    "en-US": "By <a href=\"/en-US/docs/Web/CSS/Reference/Values/dynamic-range-limit-mix\"><code>dynamic-range-limit-mix()</code></a>",
    "fr": "Par <a href=\"/fr/docs/Web/CSS/Reference/Values/dynamic-range-limit-mix\"><code>dynamic-range-limit-mix()</code></a>"
  },
  "canonicalOrder": {
    "de": "Kanonische Reihenfolge",
    "en-US": "Canonical order",
    "fr": "Ordre canonique",
    "ja": "正規順序",
    "ru": "Канонический порядок",
    "zh-CN": "规范顺序"
  },
  "childrenOfBoxElements": {
    "de": "Kindelemente von Boxelementen",
    "en-US": "children of box elements",
    "fr": "les éléments fils des éléments de boîte",
    "ja": "ボックス要素の子",
    "ru": "потомки блочных элементов"
  },
  "color": {
    "de": "<a href=\"/de/docs/Web/CSS/Reference/Values/color_value#interpolation\">Farbe</a>",
    "en-US": "a <a href=\"/en-US/docs/Web/CSS/Reference/Values/color_value#interpolation\" title=\"Values of the <color> CSS data type are interpolated on each of their red, green, blue components, each handled as a real, floating-point number. Note that interpolation of colors happens in the alpha-premultiplied sRGBA color space to prevent unexpected grey colors to appear.\">color</a>",
    "fr": "une <a href=\"/fr/docs/Web/CSS/Reference/Values/color_value#interpolation\" title=\"Les valeurs de type <couleur> sont interpolées sur chacune des composantes rouge, bleue et verte, considérées chacunes comme un nombre réel à virgule flottante. Notez que l'interpolation des couleurs a lieu dans l'espace couleur sRGBA pré-multiplié pour éviter l'apparition de teintes grises non désirées.\">couleur</a>",
    "ja": "<a href=\"/ja/docs/Web/CSS/Reference/Values/color_value#interpolation\" title=\"CSS の <color> データ型の値は、赤、緑、青のそれぞれの値ごとに、浮動小数点の実数として扱われて補間されます。なお、アルファ事前混合 sRGBA 色空間で色の補間を行うと、予期せずに灰色が現れることがあります。\">色</a>",
    "ru": "<a href=\"/ru/docs/Web/CSS/Reference/Values/color_value#interpolation\" title=\"Значения типа данных CSS <цвет> интерполируются по каждой компоненте - красной, зелёной и голубой - как вещественные числа с плавающей запятой. Обратите внимание, что интерполяция цветов происходит в цветовом пространстве sRGBA, учитывающем прозрачность, для предотвращения появления неожиданных серых цветов.\">цвет</a>"
  },
  "colorPlusThreeAbsoluteLengths": {
    "de": "eine Farbe plus drei absolute Längen",
    "en-US": "a color plus three absolute lengths",
    "fr": "une couleur et trois longueurs absolues",
    "ja": "色に続いて絶対的な長さ 3 つ",
    "ru": "цвет плюс три абсолютных длины"
  },
  "computedColor": {
    "de": "berechnete Farbe",
    "en-US": "computed color",
    "fr": "couleur calculée",
    "ja": "色の計算値",
    "ru": "вычисленный цвет",
    "zh-CN": "颜色计算值"
  },
  "computedValueForDynamicRangeLimit": {
    "en-US": "See <a href=\"https://drafts.csswg.org/css-color-hdr/#computing-dynamic-range-limit\">Computed value for dynamic-range-limit</a>",
    "fr": "Voir <a href=\"https://drafts.csswg.org/css-color-hdr/#computing-dynamic-range-limit\">Valeur calculée pour <code>dynamic-range-limit</code> <sup>(angl.)</sup></a>"
  },
  "consistsOfTwoDimensionKeywords": {
    "de": "Besteht aus zwei Schlüsselwörtern, einem pro Richtung",
    "en-US": "Consists of two keywords, one per dimension",
    "fr": "Deux mots-clés, chacun décrivant une dimension",
    "ja": "2 つのキーワードから成り、方向ごとに 1 つずつ",
    "ru": "Состоит из двух ключевых слов, по одному на размер"
  },
  "consistsOfTwoKeywordsForOriginAndOffsets": {
    "de": "Besteht aus zwei Schlüsselwörtern, die den Ursprung und die beiden Versätze vom Ursprung repräsentieren, wobei beide als absolute Länge angegeben werden (falls eine &lt;length&gt; angegeben wurde), ansonsten einen Prozentwert.",
    "en-US": "Consists of two keywords representing the origin and two offsets from that origin, each given as an absolute length (if given a &lt;length&gt;), otherwise as a percentage.",
    "fr": "Constitué de deux mots-clés représentant l'origine et deux décalages par rapport à cette origine, chacun donné comme une longueur absolue (si une longueur (&lt;length&gt;) est donnée), sinon comme un pourcentage.",
    "ja": "原点を表す 2 つのキーワードと、その原点からの 2 つのオフセットで、それぞれが絶対的な長さ (&lt;length&gt; が指定された場合) またはパーセント値で指定される。",
    "ru": "Состоит из двух ключевых слов, представляющих начало координат и два смещения от этого начала, каждое из которых задаётся как абсолютная длина (если задана &lt;length&gt;), иначе как процент"
  },
  "continuous": {
    "de": "fortlaufend",
    "en-US": "continuous",
    "fr": "continu",
    "ja": "連続メディア",
    "ru": "продолжительный",
    "zh-TW": "連續"
  },
  "convertedToNumber": {
    "en-US": "Converted to {{cssxref(\"&lt;number&gt;\")}}",
    "fr": "Converti en nombre ({{cssxref(\"&lt;number&gt;\")}})"
  },
  "correspondingSuperellipse": {
    "en-US": "The corresponding <a href=\"/en-US/docs/Web/CSS/Reference/Values/superellipse\">superellipse()</a> value.",
    "fr": "La valeur <a href=\"/fr/docs/Web/CSS/Reference/Values/superellipse\">superellipse()</a> correspondante."
  },
  "createsStackingContext": {
    "de": "Erstellt <a href=\"/de/docs/Web/CSS/Guides/Positioned_layout/Stacking_context\">Stapelkontext</a>",
    "en-US": "Creates <a href=\"/en-US/docs/Web/CSS/Guides/Positioned_layout/Stacking_context\">stacking context</a>",
    "fr": "Crée un <a href=\"/fr/docs/Web/CSS/Guides/Positioned_layout/Stacking_context\">contexte d'empilement</a>",
    "ja": "<a href=\"/ja/docs/Web/CSS/Guides/Positioned_layout/Stacking_context\">重ね合わせコンテキスト</a>の生成",
    "ru": "Создаёт <a href=\"/ru/docs/Web/CSS/Guides/Positioned_layout/Stacking_context\">контекст наложения</a>",
    "zh-TW": "建立<a href=\"/zh-TW/docs/Web/CSS/Guides/Positioned_layout/Stacking_context\">堆疊內容</a>"
  },
  "dependsOnLayoutModel": {
    "de": "hängt vom Layoutmodell ab",
    "en-US": "depends on layout model",
    "fr": "dépend du modèle en couches",
    "ja": "レイアウトモデルに依存",
    "ru": "зависит от модели макета",
    "zh-TW": "取決於布置模型"
  },
  "dependsOnUserAgent": {
    "de": "hängt vom User Agent ab",
    "en-US": "depends on user agent",
    "fr": "dépend de l'agent utilisateur",
    "ja": "ユーザエージェントに依存",
    "ru": "зависит от браузера",
    "zh-TW": "取決於使用者代理"
  },
  "directChildrenOfElementsWithDisplayMozBoxMozInlineBox": {
    "de": "Elemente, die direkte Kinder eines Elements mit einem CSS {{cssxref(\"display\")}} Wert von <code>-moz-box</code> oder <code>-moz-inline-box</code> oder <code>-webkit-box</code> oder <code>-webkit-inline-box</code> sind",
    "en-US": "elements that are direct children of an element with a CSS {{cssxref(\"display\")}} value of <code>-moz-box</code> or <code>-moz-inline-box</code> or <code>-webkit-box</code> or <code>-webkit-inline-box</code>",
    "fr": "éléments qui sont des fils direct d'un élément avec {{cssxref(\"display\")}} qui vaut <code>-moz-box</code> ou <code>-moz-inline-box</code> ou <code>-webkit-box</code> ou <code>-webkit-inline-box</code>",
    "ja": "CSS の {{cssxref(\"display\")}} の値が <code>-moz-box</code>, <code>-moz-inline-box</code>, <code>-webkit-box</code>, <code>-webkit-inline-box</code> のいずれかである要素の直接の子要素",
    "ru": "элементы, являющиеся прямыми потомками элемента со свойством {cssxref(\"display\")}} равным <code>-moz-box</code>, <code>-moz-inline-box</code>, <code>-webkit-box</code> или <code>-webkit-inline-box</code>"
  },
  "discrete": {
    "de": "diskret",
    "en-US": "discrete",
    "fr": "discrète",
    "ja": "離散値",
    "zh-CN": "离散值",
    "zh-TW": "離散"
  },
  "discreteButVisibleForDurationWhenAnimatedHidden": {
    "en-US": "Discrete behavior except when animating to or from <code>hidden</code> is visible for the entire duration",
    "fr": "Comportement discret sauf lors de l'animation vers ou depuis <code>hidden</code> qui est visible pendant toute la durée"
  },
  "discreteButVisibleForDurationWhenAnimatedNone": {
    "en-US": "Discrete behavior except when animating to or from <code>none</code> is visible for the entire duration",
    "fr": "Comportement discret sauf lors de l'animation vers ou depuis <code>none</code> qui est visible pendant toute la durée",
    "zh-CN": "离散行为，但如果动画过渡以 <code>none</code> 开始或结束，则其在整个持续时间内都是可见的"
  },
  "eachOfShorthandPropertiesExceptUnicodeBiDiAndDirection": {
    "de": "wie jede der Kurzschreibweisen Eigenschaften (alle Eigenschaften außer {{cssxref(\"unicode-bidi\")}} und {{cssxref(\"direction\")}})",
    "en-US": "as each of the properties of the shor   thand (all properties but {{cssxref(\"unicode-bidi\")}} and {{cssxref(\"direction\")}})",
    "fr": "comme pour chaque propriété de la propriété raccourcie (toutes les propriétés sauf {{cssxref(\"unicode-bidi\")}} et {{cssxref(\"direction\")}})",
    "ja": "この一括指定のそれぞれのプロパティとして ({{cssxref(\"unicode-bidi\")}} と {{cssxref(\"direction\")}}) を除いたすべてのプロパティ",
    "ru": "как у каждого из подсвойств этого свойства (все свойства, кроме {{cssxref(\"unicode-bidi\")}} и {{cssxref(\"direction\")}})"
  },
  "elementsForWhichSizeContainmentCanApply": {
    "en-US": "elements for which size containment can apply",
    "fr": "éléments pour lesquels la contenance de taille peut s'appliquer",
    "zh-CN": "可应用尺寸局限的元素"
  },
  "elementsWithDefaultPreferredSize": {
    "en-US": "Elements with default preferred size",
    "fr": "Éléments avec une taille préférée par défaut",
    "zh-CN": "具有默认偏好尺寸的元素"
  },
  "elementsWithDisplayBoxOrInlineBox": {
    "de": "Elemente mit einem CSS {{cssxref(\"display\")}} Wert von <code>box</code> oder <code>inline-box</code>",
    "en-US": "elements with a CSS {{cssxref(\"display\")}} value of <code>box</code> or <code>inline-box</code>",
    "fr": "éléments avec {{cssxref(\"display\")}} qui vaut <code>box</code> ou <code>inline-box</code>",
    "ja": "CSS の {{cssxref(\"display\")}} の値が <code>box</code> または <code>inline-box</code> である要素",
    "ru": "элементы с значением свойства {{cssxref(\"display\")}} <code>box</code> или <code>inline-box</code>"
  },
  "elementsWithDisplayMarker": {
    "de": "Elemente mit <code>{{cssxref(\"display\")}}: marker;</code>",
    "en-US": "elements with <code>{{cssxref(\"display\")}}: marker;</code>",
    "fr": "éléments avec <code>{{cssxref(\"display\")}}: marker;</code>",
    "ja": "<code>{{cssxref(\"display\")}}: marker;</code> の要素",
    "ru": "элементы с <code>{{cssxref(\"display\")}}: marker;</code>",
    "zh-CN": "设置了 <code>{{cssxref(\"display\")}}: marker;</code> 的元素",
    "zh-TW": "具 <code>{{cssxref(\"display\")}}: marker;</code> 的元素"
  },
  "elementsWithDisplayMozBoxMozInlineBox": {
    "de": "Elemente mit einem CSS {{cssxref(\"display\")}} Wert von <code>-moz-box</code>, <code>-moz-inline-box</code>, <code>-webkit-box</code> oder <code>-webkit-inline-box</code>",
    "en-US": "elements with a CSS {{cssxref(\"display\")}} value of <code>-moz-box</code>, <code>-moz-inline-box</code>, <code>-webkit-box</code> or <code>-webkit-inline-box</code>",
    "fr": "éléments dont CSS {{cssxref(\"display\")}} vaut <code>-moz-box</code>, <code>-moz-inline-box</code>, <code>-webkit-box</code> ou <code>-webkit-inline-box</code>",
    "ja": "CSS の {{cssxref(\"display\")}} の値が <code>-moz-box</code>, <code>-moz-inline-box</code>, <code>-webkit-box</code>, <code>-webkit-inline-box</code> のいずれかである要素",
    "ru": "элементы со значением {{cssxref(\"display\")}}: <code>-moz-box</code>, <code>-moz-inline-box</code>, <code>-webkit-box</code> или <code>-webkit-inline-box</code>",
    "zh-TW": "CSS {{cssxref(\"display\")}} 值為 <code>-moz-box</code>、<code>-moz-inline-box</code>、<code>-webkit-box</code> 或 <code>-webkit-inline-box</code> 的元素"
  },
  "elementsWithOverflowNotVisibleAndReplacedElements": {
    "de": "Elemente, deren {{cssxref(\"overflow\")}} nicht <code>visible</code> ist, und optional ersetzte Elemente, die Bilder oder Videos repräsentieren, und iframes",
    "en-US": "elements with {{cssxref(\"overflow\")}} other than <code>visible</code>, and optionally replaced elements representing images or videos, and iframes",
    "fr": "éléments dont {{cssxref(\"overflow\")}} ne vaut pas <code>visible</code> et éventuellement les éléments remplacés qui représentent des images, des vidéos ou des iframes",
    "ja": "{{cssxref(\"overflow\")}} が <code>visible</code> 以外である要素、任意で画像、動画、iframe を表す置換要素",
    "ru": "элементы с {{cssxref(\"overflow\")}} отличным от <code>visible</code>, и опционально заменяемые элементы представляющие собой картинки, видео и iframe",
    "zh-TW": "{{cssxref(\"overflow\")}} 不是 <code>visible</code> 的元素，以及表示圖片、影片 和 iframe 的可選替換元素。"
  },
  "exclusionElements": {
    "en-US": "exclusion elements",
    "ja": "除外要素",
    "zh-CN": "排除元素"
  },
  "filterList": {
    "de": "eine <a href=\"/de/docs/Web/CSS/Reference/Properties/filter#interpolation\" title=\"Falls beide Filter Funktionslisten gleicher Länge ohne URLs haben, wird jede der Filterfunktionen nach ihren spezifischen Regeln interpoliert. Falls sie unterschiedliche Längen haben, werden die fehlenden äquivalenten Filterfunktionen der längeren Liste unter Verwendung der Standardwerte an das Ende der kürzeren Liste angehängt, anschließend werden alle Filterfunktionen entsprechend ihrer spezifischen Regeln interpoliert. Falls ein Filter 'none' ist, wird er durch die Filterfunktionsliste der anderen unter Verwendung der Standardwerte ersetzt, anschließend werden alle Filterfunktionen entsprechend ihrer spezifischen Regeln interpoliert. Ansonsten wird diskrete Interpolation verwendet.\">Filterfunktionsliste</a>",
    "en-US": "a <a href=\"/en-US/docs/Web/CSS/Reference/Properties/filter#interpolation\" title=\"If both filters have a function list of same length without URL, each of their filters functions is interpolated according to its specific rules. If they have different lengths, the missing equivalent filter functions from the longer list are added to the end of the shorter list using their default values, then all filter functions are interpolated according to their specific rules. If one filter is 'none', it is replaced with the filter functions list of the other one using the filter function default values, then all filter functions are interpolated according to their specific rules. Otherwise discrete interpolation is used.\">filter function list</a>",
    "fr": "une <a href=\"/fr/docs/Web/CSS/Reference/Properties/filter#interpolation\" title=\"Si les deux filtres ont une liste de fonctions de même longueur sans URL, chaque fonction de filtre est interpolée selon les règles qui lui sont propres. Si elles sont de longueur différente, les dernières fonctions de filtre de la liste la plus longue sont ajoutées à la liste la plus courte avec leurs valeurs par défaut et ensuite, toutes les fonctions de filtre sont interpolées entre elles selon leurs règles spécifiques. Dans les autres cas, c'est une interpolation discrète qui est utilisée.\">liste de fonctions de filtre</a>",
    "ja": "<a href=\"/en-US/docs/Web/CSS/Reference/Properties/filter#interpolation\" title=\"両方のフィルターが同じ長さの関数リストを URL なしで持っている場合、 それぞれのフィルター関数はその固有の規則に従って補間されます。両者の長さが異なる場合は、 長い方のリストから欠けている等価なフィルター関数が既定値を使って短い方のリストの最後に追加され、 すべてのフィルター関数がそれぞれの規則に従って補間されます。一方のフィルターが 'none' の場合は，フィルター関数の既定値を用いてもう一方のフィルター関数のリストに置き換えられ，すべてのフィルター関数がその固有の規則に従って補間されます．それ以外の場合は，離散補間が用いられます。\">フィルター関数のリスト</a>"
  },
  "firstLetterPseudoElementsAndInlineLevelFirstChildren": {
    "de": "{{cssxref(\"::first-letter\")}} Pseudoelemente und Inline-Level-Elemente, die die ersten Kinder eines Blockcontainers sind",
    "en-US": "{{cssxref(\"::first-letter\")}} pseudo-elements and inline-level first child of a block container",
    "fr": "pseudo-éléments {{cssxref(\"::first-letter\")}} et le premier fils, en ligne (<i lang=\"en\">inline</i>) d'un conteneur de bloc",
    "ja": "{{cssxref(\"::first-letter\")}} 擬似要素と、ブロックコンテナーの最初のインラインレベルの子",
    "ru": "{{cssxref(\"::first-letter\")}} псевдоэлементы и первые строчные потомки блока"
  },
  "flexContainers": {
    "de": "flexible Container",
    "en-US": "flex containers",
    "fr": "conteneurs flexibles",
    "ja": "フレックスコンテナー",
    "ru": "flex-контейнеры",
    "zh-CN": "弹性容器",
    "zh-TW": "彈性容器"
  },
  "flexItemsAndAbsolutelyPositionedFlexContainerChildren": {
    "de": "flexible Elemente und absolut positionierte Flexcontainerkinder",
    "en-US": "flex items and absolutely-positioned flex container children",
    "fr": "éléments flexibles, ainsi que les enfants absolument positionnés de conteneurs flexibles",
    "ja": "フレックスアイテムおよび絶対位置指定されたフレックスコンテナーの子",
    "ru": "flex-элементы и абсолютно-позицированые потомки flex-контейнера",
    "zh-TW": "彈性項目和絕對定位的彈性容器子元素"
  },
  "flexItemsAndInFlowPseudos": {
    "de": "flexible Elemente einschließlich In-Flow-Pseudo-Elemente",
    "en-US": "flex items, including in-flow pseudo-elements",
    "fr": "éléments flexibles, y compris les pseudo-éléments intégrés dans le flux",
    "ja": "フロー内の擬似要素を含むフレックスアイテム",
    "ru": "flex-элементы, в том числе в потоке псевдоэлементов",
    "zh-TW": "彈性項目，包括 in-flow 的偽元素"
  },
  "flexItemsGridItemsAbsolutelyPositionedContainerChildren": {
    "en-US": "Flex items, grid items, and absolutely-positioned flex and grid container children",
    "fr": "éléments flexibles, éléments de grille, ainsi que les enfants absolument positionnés de conteneurs flexibles et de grille",
    "ja": "フレックスアイテム、グリッドアイテム、フレックスおよびグリッドコンテナーの絶対位置指定の子",
    "ru": "flex-элементы, grid-элементы и абсолютно спозиционированные потомки flex- и grid-контейнеров",
    "zh-TW": "彈性項目、格線項目和絕對定位的彈性和格線容器子元素"
  },
  "flexItemsGridItemsAndAbsolutelyPositionedBoxes": {
    "en-US": "flex items, grid items, and absolutely-positioned boxes",
    "fr": "éléments flexibles, éléments de grille, ainsi que les boîtes positionnées de façon absolue",
    "ja": "フレックスアイテム、グリッドアイテム、絶対位置指定のボックス",
    "zh-tw": "彈性項目、格線項目和絕對定位的區塊"
  },
  "floats": {
    "de": "Flusselemente",
    "en-US": "floats",
    "fr": "flottants",
    "ja": "浮動要素",
    "ru": "плавает",
    "zh-CN": "浮动元素",
    "zh-TW": "浮動"
  },
  "forLengthAbsoluteValueOtherwisePercentage": {
    "de": "for {{cssxref(\"length\")}} the absolute value, otherwise a percentage",
    "en-US": "for {{cssxref(\"length\")}} the absolute value, otherwise a percentage",
    "fr": "pour une valeur de type {{cssxref(\"length\")}} sa valeur absolue, sinon un pourcentage",
    "ja": "{{cssxref(\"length\")}} の場合は絶対的な値、それ以外の場合はパーセント値",
    "ru": "для {{cssxref(\"length\")}} абсолютное значение, иначе процент",
    "zh-CN": "对于 {{cssxref(\"length\")}} 则为绝对值，否则为百分比值"
  },
  "gridContainers": {
    "de": "Gridcontainer",
    "en-US": "grid containers",
    "fr": "conteneurs de grille",
    "ja": "グリッドコンテナー",
    "ru": "сеточные контейнеры",
    "zh-CN": "网格容器",
    "zh-TW": "格線容器"
  },
  "gridContainersWithMasonryLayout": {
    "en-US": "Grid containers with masonry layout",
    "fr": "Conteneurs de grille avec une mise en page en maçonnerie",
    "ja": "マソンリーレイアウトのグリッドコンテナー",
    "zh-TW": "具瀑布流版面的格線容器"
  },
  "gridContainersWithMasonryLayoutInTheirBlockAxis": {
    "en-US": "Grid containers with masonry layout in their block axis",
    "fr": "Conteneurs de grille avec une mise en page en maçonnerie dans leur axe de bloc",
    "ja": "ブロック軸がマソンリーレイアウトのグリッドコンテナー",
    "zh-TW": "區塊軸採瀑布流版面的格線容器"
  },
  "gridContainersWithMasonryLayoutInTheirInlineAxis": {
    "en-US": "Grid containers with masonry layout in their inline axis",
    "fr": "Conteneurs de grille avec une mise en page en maçonnerie dans leur axe en ligne",
    "ja": "インライン軸がマソンリーレイアウトのグリッドコンテナー",
    "zh-TW": "行內軸採瀑布流版面的格線容器"
  },
  "gridItemsAndBoxesWithinGridContainer": {
    "de": "Gridelemente und absolut positionierte Boxen, deren beinhaltender Block ein Gridcontainer ist",
    "en-US": "grid items and absolutely-positioned boxes whose containing block is a grid container",
    "fr": "éléments de grilles et boîtes positionnées de façon absolue dont le bloc englobant est un conteneur de grille",
    "ja": "包含ブロックがグリッドコンテナーであるグリッドアイテムまたは絶対位置指定のボックス",
    "ru": "элементы сетки и абсолютно-позиционированные блоки, находящиеся в сеточном контейнере"
  },
  "iframeElements": {
    "en-US": "iframe elements",
    "fr": "éléments iframe",
    "ja": "iframe 要素",
    "zh-CN": "iframe 元素",
    "zh-TW": "iframe 元素"
  },
  "images": {
    "de": "Bilder",
    "en-US": "images",
    "fr": "images",
    "ja": "画像",
    "ru": "изображения",
    "zh-CN": "图像",
    "zh-TW": "圖片"
  },
  "inFlowBlockLevelElements": {
    "de": "in-flow block-level Elemente",
    "en-US": "in-flow block-level elements",
    "fr": "éléments de type bloc participant au flux",
    "ja": "フロー内のブロックレベル要素",
    "ru": "блочные элементы в потоке",
    "zh-TW": "in-flow 區塊層元素"
  },
  "inFlowChildrenOfBoxElements": {
    "de": "Flusskindelemente von Boxelementen",
    "en-US": "in-flow children of box elements",
    "fr": "les éléments fils dans le flux des éléments de boîte",
    "ja": "フロー内のボックス要素の子",
    "ru": "потомки блочных элементов в потоке"
  },
  "inlineBoxesAndBlockContainers": {
    "en-US": "Inline boxes and block containers",
    "fr": "boîtes en ligne et conteneurs de bloc",
    "zh-TW": "行內方塊和區塊容器"
  },
  "inlineLevelAndTableCellElements": {
    "de": "Inline- und table-cell Elemente",
    "en-US": "inline-level and table-cell elements",
    "fr": "éléments en ligne et à ceux qui sont des cellules de tableau",
    "ja": "インラインレベルおよびテーブルセル要素",
    "ru": "строчным элементам и ячейкам таблиц",
    "zh-TW": "行內層和表格儲存格元素"
  },
  "inlineLevelBoxes": {
    "en-US": "inline-level boxes",
    "fr": "boîtes en ligne"
  },
  "inlineLevelBoxesAndSVGTextContentElements": {
    "en-US": "inline-level boxes and SVG text content elements",
    "fr": "boîtes en ligne et éléments de contenu textuel SVG"
  },
  "inlineLevelBoxesFlexItemsGridItemsTableCellsAndSVGTextContentElements": {
    "en-US": "inline-level boxes, flex items, grid items, table cells, and SVG text content elements",
    "fr": "boîtes en ligne, éléments flexibles, éléments de grille, cellules de tableau et éléments de contenu textuel SVG"
  },
  "inlineSizeOfContainingBlock": {
    "de": "Inlinegröße des beinhaltenden Blocks",
    "en-US": "inline-size of containing block",
    "fr": "la taille en ligne du bloc englobant",
    "ja": "包含ブロックの inline-size",
    "ru": "встроенный размер содержащего блока"
  },
  "integer": {
    "de": "<a href=\"/de/docs/Web/CSS/Reference/Values/integer#interpolation\">Integer</a>",
    "en-US": "an <a href=\"/en-US/docs/Web/CSS/Reference/Values/integer#interpolation\" title=\"Values of the <integer> CSS data type are interpolated via integer discrete steps. The calculation is done as if they were real, floating-point numbers and the discrete value is obtained using the floor function.\">integer</a>",
    "fr": "un <a href=\"/fr/docs/Web/CSS/Reference/Values/integer#interpolation\" title=\"Les valeurs du type <entier> sont interpolées par incrémentation discrète. Le calcul est réalisé comme si les valeurs étaient des nombres réels, en virgule flottante et la valeur discrète est obtenue en utilisant la fonction partie entière.\">entier</a>",
    "ja": "<a href=\"/ja/docs/Web/CSS/Reference/Values/integer#interpolation\" title=\"CSS のデータ型 <integer> の値は整数の離散ステップで補間される。実数の浮動小数点数であるかのように計算され、 floor 関数を用いて離散値が取得される。\">integer</a>",
    "ru": "<a href=\"/ru/docs/Web/CSS/Reference/Values/integer#interpolation\" title=\"Значения типа данных CSS <целое число> интерполируются через целое число дискретных шагов. Вычисления производятся словно над вещественными числами с плавающей запятой, а дискретные значения получаются с использованием функции floor.\">целое число</a>"
  },
  "interactive": {
    "de": "interaktiv",
    "en-US": "interactive",
    "fr": "interactif",
    "ja": "対話的",
    "ru": "интерактивный",
    "zh-TW": "可互動"
  },
  "keywordOrNumericalValueBolderLighterTransformedToRealValue": {
    "de": "das Schlüsselwort oder der numerische Wert wie angegeben, wobei <code>bolder</code> und <code>lighter</code> in einen realen Wert umgewandelt werden",
    "en-US": "the keyword or the numerical value as specified, with <code>bolder</code> and <code>lighter</code> transformed to the real value",
    "fr": "le mot-clé ou la valeur numérique, comme défini, transformé en la valeur réelle avec <code>bolder</code> et <code>lighter</code>",
    "ja": "指定された通りのキーワードまたは数値であり、 <code>bolder</code> および <code>lighter</code> は実数に変換される",
    "ru": "ключевое слово или числовое значение, с <code>bolder</code> и <code>lighter</code>, трансформируемися в действительное значение"
  },
  "keywordPlusIntegerIfDigits": {
    "de": "angegebenes Schlüsselwort plus Ganzzahl, falls 'digits'",
    "en-US": "specified keyword, plus integer if 'digits'",
    "fr": "le mot-clé défini suivi d'un entier si 'digits'",
    "ja": "指定されたキーワード、'digits' の場合は続けて整数",
    "ru": "указанное ключевое слово, плюс целые числа, если цифры"
  },
  "length": {
    "de": "<a href=\"/de/docs/Web/CSS/Reference/Values/length#interpolation\">Längenangabe</a>",
    "en-US": "a <a href=\"/en-US/docs/Web/CSS/Reference/Values/length#interpolation\" title=\"Values of the <length> CSS data type are interpolated as real, floating-point numbers.\">length</a>",
    "fr": "une <a href=\"/fr/docs/Web/CSS/Reference/Values/length#interpolation\" title=\"Les valeurs du type <length>; sont interpolées comme des nombres réels à virgule flottante.\">longueur</a>",
    "ja": "<a href=\"/ja/docs/Web/CSS/Reference/Values/length#interpolation\" title=\"CSS の <length> データ型の値は、実数すなわち浮動小数点数として補間されます。\">length</a>",
    "ru": "<a href=\"/ru/docs/Web/CSS/Reference/Values/length#interpolation\" title=\"Значения типа данных CSS <длина> интерполируются как вещественные числа с плавающей запятой.\">длина</a>"
  },
  "lengthAbsolutePercentageAsSpecifiedOtherwiseAuto": {
    "de": "falls als Länge angegeben, die zugehörige absolute Länge; falls als Prozentwert angegeben, der angegebene Wert; ansonsten <code>auto</code>",
    "en-US": "if specified as a length, the corresponding absolute length; if specified as a percentage, the specified value; otherwise, <code>auto</code>",
    "fr": "si défini par une longueur, la valeur absolue correspondante&nbsp;; si défini par un pourcentage, la valeur telle que définie; sinon, <code>auto</code>",
    "ja": "長さで指定されると相当する絶対的な長さ、パーセント値として指定されると指定値、それ以外では <code>auto</code>",
    "ru": "если указано как длина - абсолютная длина; если указано как проценты - заданное значение; в противном случае <code>auto</code>"
  },
  "lengthOrPercentageBeforeKeywordIfBothPresent": {
    "de": "die Länge oder der Prozentwert vor dem Schlüsselwort, falls beide vorhanden sind",
    "en-US": "the length or percentage before the keyword, if both are present",
    "fr": "la longueur ou le pourcentage avant le mot-clé si les deux sont présents",
    "ja": "両方がある場合は、キーワードの前に長さまたはパーセント値",
    "ru": "длина или проценты перед ключевым словом, если присутствуют оба"
  },
  "lengthOrPercentageBeforeKeywords": {
    "de": "Die Länge oder der Prozentwert vor den Schlüsselwörtern, falls beide angegeben wurden. Falls mehrere Schlüsselwörter angegeben wurden, erscheinen sie in derselben Reihenfolge, wie in der formellen Grammatik angegeben.",
    "en-US": "The length or percentage before the keywords, if both are present. If several keywords are present, they appear in the same order as their appearance in the formal grammar.",
    "fr": "La longueur ou le pourcentage avant les mots-clés, si les deux sont présents. Si plusieurs mots-clés sont présents, ils apparaissent dans le même ordre que dans la grammaire formelle.",
    "ja": "両方がある場合は、キーワードの前に長さまたはパーセント値。複数のキーワードがある場合は、形式文法での出現順と同じ順序で現れる。",
    "ru": "Длина или процент до ключевых слов, если присутствуют оба. Если присутствуют несколько ключевых слов, они появляются в том же порядке, как и в формальной грамматике."
  },
  "lengthsAsPercentages": {
    "en-US": "The lengths may be specified as percentages",
    "fr": "Les longueurs peuvent être définies en pourcentages",
    "zh-TW": "長度可以指定為百分比"
  },
  "limitedSVGElementsCircle": {
    "en-US": "{{SVGElement(\"circle\")}} element in {{SVGElement(\"svg\")}}",
    "fr": "élément {{SVGElement(\"circle\")}} dans {{SVGElement(\"svg\")}}"
  },
  "limitedSVGElementsEllipse": {
    "en-US": "{{SVGElement(\"ellipse\")}} and {{SVGElement(\"circle\")}} elements in {{SVGElement(\"svg\")}}",
    "fr": "éléments {{SVGElement(\"ellipse\")}} et {{SVGElement(\"circle\")}} dans {{SVGElement(\"svg\")}}"
  },
  "limitedSVGElementsEllipseRect": {
    "en-US": "{{SVGElement(\"ellipse\")}} and {{SVGElement(\"rect\")}} elements in {{SVGElement(\"svg\")}}",
    "fr": "éléments {{SVGElement(\"ellipse\")}} et {{SVGElement(\"rect\")}} dans {{SVGElement(\"svg\")}}"
  },
  "limitedSVGElementsFilterPrimitives": {
    "en-US": "The set of elements that control the output of a {{SVGElement(\"filter\")}} element in {{SVGElement(\"svg\")}}",
    "fr": "L'ensemble des éléments qui contrôlent la sortie d'un élément {{SVGElement(\"filter\")}} dans {{SVGElement(\"svg\")}}"
  },
  "limitedSVGElementsFloodAndDropShadow": {
    "en-US": "{{SVGElement(\"feFlood\")}} and {{SVGElement(\"feDropShadow\")}} elements in {{SVGElement(\"svg\")}}",
    "fr": "éléments {{SVGElement(\"feFlood\")}} et {{SVGElement(\"feDropShadow\")}} dans {{SVGElement(\"svg\")}}"
  },
  "limitedSVGElementsGeometry": {
    "en-US": "{{SVGElement(\"svg\")}}, {{SVGElement(\"rect\")}}, {{SVGElement(\"image\")}}, and {{SVGElement(\"foreignObject\")}} elements in {{SVGElement(\"svg\")}}",
    "fr": "éléments {{SVGElement(\"svg\")}}, {{SVGElement(\"rect\")}}, {{SVGElement(\"image\")}} et {{SVGElement(\"foreignObject\")}} dans {{SVGElement(\"svg\")}}"
  },
  "limitedSVGElementsGraphics": {
    "en-US": "{{SVGElement(\"circle\")}}, {{SVGElement(\"ellipse\")}}, {{SVGElement(\"foreignObject\")}}, {{SVGElement(\"image\")}}, {{SVGElement(\"line\")}}, {{SVGElement(\"path\")}}, {{SVGElement(\"polygon\")}}, {{SVGElement(\"polyline\")}}, {{SVGElement(\"rect\")}}, {{SVGElement(\"text\")}}, {{SVGElement(\"textPath\")}}, and {{SVGElement(\"tspan\")}} elements in {{SVGElement(\"svg\")}}",
    "fr": "éléments {{SVGElement(\"circle\")}}, {{SVGElement(\"ellipse\")}}, {{SVGElement(\"foreignObject\")}}, {{SVGElement(\"image\")}}, {{SVGElement(\"line\")}}, {{SVGElement(\"path\")}}, {{SVGElement(\"polygon\")}}, {{SVGElement(\"polyline\")}}, {{SVGElement(\"rect\")}}, {{SVGElement(\"text\")}}, {{SVGElement(\"textPath\")}} et {{SVGElement(\"tspan\")}} dans {{SVGElement(\"svg\")}}"
  },
  "limitedSVGElementsGraphicsAndUse": {
    "en-US": "{{SVGElement(\"circle\")}}, {{SVGElement(\"ellipse\")}}, {{SVGElement(\"foreignObject\")}}, {{SVGElement(\"image\")}}, {{SVGElement(\"line\")}}, {{SVGElement(\"path\")}}, {{SVGElement(\"polygon\")}}, {{SVGElement(\"polyline\")}}, {{SVGElement(\"rect\")}}, {{SVGElement(\"use\")}}, {{SVGElement(\"text\")}}, {{SVGElement(\"textPath\")}}, and {{SVGElement(\"tspan\")}} elements in {{SVGElement(\"svg\")}}",
    "fr": "éléments {{SVGElement(\"circle\")}}, {{SVGElement(\"ellipse\")}}, {{SVGElement(\"foreignObject\")}}, {{SVGElement(\"image\")}}, {{SVGElement(\"line\")}}, {{SVGElement(\"path\")}}, {{SVGElement(\"polygon\")}}, {{SVGElement(\"polyline\")}}, {{SVGElement(\"rect\")}}, {{SVGElement(\"use\")}}, {{SVGElement(\"text\")}}, {{SVGElement(\"textPath\")}} et {{SVGElement(\"tspan\")}} dans {{SVGElement(\"svg\")}}"
  },
  "limitedSVGElementsLightSource": {
    "en-US": "{{SVGElement(\"feDiffuseLighting\")}} and {{SVGElement(\"feSpecularLighting\")}} elements in {{SVGElement(\"svg\")}}",
    "fr": "éléments {{SVGElement(\"feDiffuseLighting\")}} et {{SVGElement(\"feSpecularLighting\")}} dans {{SVGElement(\"svg\")}}"
  },
  "limitedSVGElementsPath": {
    "en-US": "{{SVGElement(\"path\")}} element in {{SVGElement(\"svg\")}}",
    "fr": "élément {{SVGElement(\"path\")}} dans {{SVGElement(\"svg\")}}"
  },
  "limitedSVGElementsShapes": {
    "en-US": "{{SVGElement(\"circle\")}}, {{SVGElement(\"ellipse\")}}, {{SVGElement(\"line\")}}, {{SVGElement(\"path\")}}, {{SVGElement(\"polygon\")}}, {{SVGElement(\"polyline\")}}, and {{SVGElement(\"rect\")}} elements in an <code>svg</code>",
    "fr": "éléments {{SVGElement(\"circle\")}}, {{SVGElement(\"ellipse\")}}, {{SVGElement(\"line\")}}, {{SVGElement(\"path\")}}, {{SVGElement(\"polygon\")}}, {{SVGElement(\"polyline\")}} et {{SVGElement(\"rect\")}} dans un <code>svg</code>"
  },
  "limitedSVGElementsShapesAndTextContent": {
    "en-US": "{{SVGElement(\"circle\")}}, {{SVGElement(\"ellipse\")}}, {{SVGElement(\"line\")}}, {{SVGElement(\"path\")}}, {{SVGElement(\"polygon\")}}, {{SVGElement(\"polyline\")}}, {{SVGElement(\"rect\")}}, {{SVGElement(\"text\")}}, {{SVGElement(\"textPath\")}}, and {{SVGElement(\"tspan\")}} elements in an <code>svg</code>",
    "fr": "éléments {{SVGElement(\"circle\")}}, {{SVGElement(\"ellipse\")}}, {{SVGElement(\"line\")}}, {{SVGElement(\"path\")}}, {{SVGElement(\"polygon\")}}, {{SVGElement(\"polyline\")}}, {{SVGElement(\"rect\")}}, {{SVGElement(\"text\")}}, {{SVGElement(\"textPath\")}} et {{SVGElement(\"tspan\")}} dans un <code>svg</code>"
  },
  "limitedSVGElementsShapeText": {
    "en-US": "SVG shapes and text content elements",
    "fr": "formes SVG et éléments de contenu textuel"
  },
  "limitedSVGElementsStop": {
    "en-US": "{{SVGElement(\"stop\")}} elements in {{SVGElement(\"svg\")}}",
    "fr": "éléments {{SVGElement(\"stop\")}} dans {{SVGElement(\"svg\")}}"
  },
  "limitedSVGElementsTextContent": {
    "en-US": "{{SVGElement(\"text\")}}, {{SVGElement(\"textPath\")}}, and {{SVGElement(\"tspan\")}} elements in {{SVGElement(\"svg\")}}",
    "fr": "éléments {{SVGElement(\"text\")}}, {{SVGElement(\"textPath\")}} et {{SVGElement(\"tspan\")}} dans {{SVGElement(\"svg\")}}"
  },
  "listEachItemConsistingOfAbsoluteLengthPercentageAndOrigin": {
    "de": "Eine Liste, bei der jeder Eintrag aus einem Versatz besteht, der durch eine Kombination aus absoluter Länge und einem Prozentsatz plus einem Ursprungsschlüsselwort definiert wird",
    "en-US": "A list, each item consisting of: an offset given as a combination of an absolute length and a percentage, plus an origin keyword",
    "fr": "Une liste, chaque élément consistant en&nbsp;: un décalage donné comme une combinaison d'une longueur absolue et d'un pourcentage, plus un mot-clé d'origine",
    "ja": "絶対長とパーセント値の組み合わせで与えられるオフセットと原点のキーワードを、各項目として構成されるリスト。",
    "ru": "Список, каждый элемент которого состоит из: смещения, данного комбинацией абсолютной длины и процентов плюс ключевое слово"
  },
  "listEachItemConsistingOfAbsoluteLengthPercentageOrKeyword": {
    "en-US": "A comma separated list of absolute lengths or percentages, numbers converted to absolute lengths first, or keyword specified",
    "fr": "Une liste séparée par des virgules de longueurs absolues ou de pourcentages, les nombres étant d'abord convertis en longueurs absolues, ou de mots-clés définis"
  },
  "listEachItemConsistingOfNormalLengthPercentageOrNameLengthPercentage": {
    "en-US": "A list where each item may be 'normal', a length percentage, or a timeline range name and a length percentage",
    "fr": "Une liste dont chaque élément peut être 'normal', une longueur en pourcentage, ou un nom de plage de chronologie et une longueur en pourcentage",
    "ja": "リストで、それぞれの項目は 'normal'、長さのパーセント値、タイムラインの範囲名と長さのパーセント値のいずれか。",
    "zh-TW": "清單，每個項目應為 'normal'、長度百分比，或時間軸範圍名稱和長度百分比"
  },
  "listEachItemConsistingOfPairsOfAutoOrLengthPercentage": {
    "en-US": "A list where each item may be either 'auto' or a length percentage",
    "fr": "Une liste dont chaque élément peut être soit <code>\"auto\"</code>, soit une longueur en pourcentage",
    "ja": "リストで、それぞれの項目は 'auto' または長さのパーセント値",
    "zh-TW": "清單，每個項目應為 'auto' 或長度百分比"
  },
  "listEachItemHasTwoKeywordsOnePerDimension": {
    "de": "eine Liste, wobei jedes Element aus zwei Schlüsselwörtern besteht, eins pro Dimension",
    "en-US": "a list, each item consisting of two keywords, one per dimension",
    "fr": "une liste dont chaque élément consiste en deux mots-clé, un par dimension",
    "ja": "1 つの方向につき 2 つのキーワードで構成される項目のリスト",
    "ru": "список, каждый элемент которого содержит 2 ключевых слова, по одному на размер"
  },
  "listEachItemIdentifierOrNoneAuto": {
    "en-US": "a list, each item either a case-sensitive CSS identifier or the keywords <code>none</code>, <code>auto</code>",
    "fr": "une liste dont chaque élément est soit un identifiant CSS sensible à la casse, soit les mots-clé <code>none</code>, <code>auto</code>",
    "ja": "リストで、それぞれの項目は大文字小文字を区別する CSS 識別子またはキーワード <code>none</code>, <code>auto</code>",
    "zh-TW": "清單，每個項目應為區分大小寫的 CSS 識別符或關鍵字 <code>none</code>、<code>auto</code>"
  },
  "listEachItemTwoKeywordsOriginOffsets": {
    "de": "a list, each item consisting of two keywords representing the origin undtwo offsets from that origin, each given as an absolute length (if given a {{cssxref(\"length\")}}), otherwise as a percentage",
    "en-US": "a list, each item consisting of two keywords representing the origin and two offsets from that origin, each given as an absolute length (if given a {{cssxref(\"length\")}}), otherwise as a percentage",
    "fr": "une liste dont chaque élément consiste en deux mots-clé représentant l'origine et deux offsets depuis cette origine, chacun étant une longueur absolue (si défini comme une longueur ({{cssxref(\"length\")}})), ou un pourcentage",
    "ja": "それぞれの項目が原点を表す 2 つのキーワードおよびその原点からの 2 つのオフセット値であるリストであり、それぞれが絶対的な長さ ({{cssxref(\"length\")}} が与えられた場合) またはパーセント値で与えられる",
    "ru": "список, каждый элемент которого состоит из двух ключевых слов, представляющих начало координат и два смещения от этого начала, каждое из которых задаётся абсолютной длиной (если дано {{cssxref(\"length\")}}), иначе как проценты"
  },
  "listItems": {
    "de": "Listenelemente",
    "en-US": "list items",
    "fr": "éléments de liste",
    "ja": " リスト項目",
    "ru": "список элементов",
    "zh-CN": "列表项",
    "zh-TW": "清單項目"
  },
  "listOfNoneAutoIdentScrollOrView": {
    "en-US": "A list, with each item being either the keyword <code>none</code>, the keyword <code>auto</code>, a case-sensitive {{cssxref(\"&lt;ident>\")}}, a computed {{cssxref(\"animation-timeline/scroll\")}} function, or a computed {{cssxref(\"animation-timeline/view\")}} function.",
    "fr": "Une liste dont chaque élément est soit le mot-clé <code>none</code>, le mot-clé <code>auto</code>, un identifiant ({{CSSxRef(\"&lt;ident>\")}}), sensible à la casse, une fonction calculée {{CSSxRef(\"animation-timeline/scroll\")}} ou une fonction calculée {{CSSxRef(\"animation-timeline/view\")}}."
  },
  "listSeparator": {
    "de": ", ",
    "en-US": ", ",
    "fr": ", ",
    "ja": "、",
    "ru": ", ",
    "zh-CN": "、",
    "zh-TW": "、"
  },
  "logicalHeightOfContainingBlock": {
    "de": "logische Höhe des beinhaltenden Blocks",
    "en-US": "logical-height of containing block",
    "fr": "hauteur logique du bloc englobant",
    "ja": "包含ブロックの論理的な高さ",
    "ru": "логическая высота контейнера",
    "zh-TW": "包含方塊的邏輯高度"
  },
  "logicalHeightOrWidthOfContainingBlock": {
    "en-US": "relative to the containing block's size in the corresponding axis (e.g. width for left or right, height for top or bottom)",
    "fr": "par rapport à la taille du bloc englobant dans l'axe correspondant (par exemple, la largeur pour la gauche ou la droite, la hauteur pour le haut ou le bas)",
    "ru": "относительно размера содержащего блока на соответствующей оси (например, ширина слева или справа, высота сверху и снизу)"
  },
  "logicalWidthOfContainingBlock": {
    "de": "logische Breite des beinhaltenden Blocks",
    "en-US": "logical-width of containing block",
    "fr": "largeur logique du bloc englobant",
    "ja": "包含ブロックの論理的な幅",
    "ru": "логическая высота содержащего блока",
    "zh-TW": "包含方塊的邏輯寬度"
  },
  "lpc": {
    "de": "$1$, <a href=\"/de/docs/Web/CSS/Reference/Values/percentage#interpolation\">Prozentsatz</a> oder <a href=\"/de/docs/Web/CSS/calc\"><code>calc()</code></a>;",
    "en-US": "$1$, <a href=\"/en-US/docs/Web/CSS/Reference/Values/percentage#interpolation\" title=\"Values of the <percentage> CSS data type are interpolated as real, floating-point numbers.\">percentage</a> or calc();",
    "fr": "$1$, <a href=\"/fr/docs/Web/CSS/Reference/Values/percentage#interpolation\" title=\"Les valeurs du type <pourcentage> sont interpolées comme des nombres réels à virgule flottante.\">pourcentage</a> ou calc()&nbsp;;",
    "ja": "$1$ または <a href=\"/ja/docs/Web/CSS/Reference/Values/percentage#interpolation\" title=\"CSS データ型の <percentage> の値は、実数の浮動小数点数として補間されます。\">パーセント値</a>, calc();",
    "ru": "$1$, <a href=\"/ru/docs/Web/CSS/Reference/Values/percentage#interpolation\" title=\"Значения типа данных CSS <проценты> интерполируются как вещественные числа с плавающей запятой.\">проценты</a> или calc();",
    "zh-TW": "$1$，<a href=\"/zh-TW/docs/Web/CSS/Reference/Values/percentage#interpolation\" title=\"CSS 資料型別 <percentage> 的值會被轉換成實數浮點數進行內插。\">百分比</a> 或 calc();"
  },
  "lpcNote": {
    "de": " wenn beides Längenwerte sind, werden sie als Längenwerte gehandhabt. Wenn beides Prozentsätze sind, werden sie als Prozentsätze gehandhabt. Ansonsten werden beide Werte wie in einer <code>calc()</code> Funktion addiert (Wird ggf. zu Null). Und bei diesen <code>calc()</code> Funktionen wird jede Hälfte als Realzahl interpoliert. ",
    "en-US": " when both values are lengths, they are interpolated as lengths; when both values are percentages, they are interpolated as percentages; otherwise, both values are converted into a <code>calc()</code> function that is the sum of a length and a percentage (each possibly zero), and these <code>calc()</code> functions have each half interpolated as real numbers. ",
    "fr": " quand les deux valeurs sont des longueurs, elles sont interpolées comme des longueurs&nbsp;; quand les deux valeurs sont des pourcentages, elles sont interpolées comme des pourcentages&nbsp;; sinon, les deux valeurs sont converties dans une fonction <code>calc()</code> qui est la somme d'une longueur et d'un pourcentage (chaque valeur pouvant être à zéro), et cette fonction <code>calc()</code> interpole chaque moitié comme un nombre réel. ",
    "ja": "両方の値が length の場合は、length 値として補完されます。両方の値がパーセント値の場合は、パーセント値として補完されます。それ以外の場合は、両方の値が calc() 関数にコンバートされ、length とパーセント値の合計になります (または各値が 0)。そして、これらの <code>calc()</code> 関数は、それぞれ半分ずつ補完された実数を持ちます",
    "ru": " когда оба значения являются длинами, они интерполируются как длины; когда оба значения являются процентами, они интерполируются как проценты; в остальных случаях, оба значения преобразуются функцией <code>calc()</code> в сумму длины и процента (каждый из них может быть равен нулю), а затем эта функция интерполирует каждую половину как вещественные числа.",
    "zh-TW": " 當兩個值都是長度時，按長度進行內插；當兩個值都是百分比時，按百分比進行內插；否則，兩個值皆會被轉換成長度和百分比的和（各可能為零）的 <code>calc()</code> 函數, and these <code>calc()</code> functions have each half interpolated as real numbers."
  },
  "mapToRange0To1": {
    "en-US": "map to the range <code>[0,1]</code>",
    "fr": "mapper à la plage <code>[0,1]</code>",
    "zh-TW": "對應至範圍 <code>[0,1]</code>"
  },
  "maskElements": {
    "de": "{{SVGElement(\"mask\")}} Elemente",
    "en-US": "{{SVGElement(\"mask\")}} elements",
    "fr": "les éléments {{SVGElement(\"mask\")}}",
    "ja": "{{SVGElement(\"mask\")}} 要素",
    "ru": "{{SVGElement(\"mask\")}} элементы",
    "zh-CN": "{{SVGElement(\"mask\")}} 元素",
    "zh-TW": "{{SVGElement(\"mask\")}} 元素"
  },
  "maxZoomFactor": {
    "en-US": "The largest allowed zoom factor. A zoom factor of 100% corresponds to no zooming. Larger values zoom in. Smaller values zoom out.",
    "fr": "Le facteur de zoom maximal autorisé. Un facteur de zoom de 100 % correspond à un zoom nul. Des valeurs plus grandes effectuent un zoom avant. Des valeurs plus petites effectuent un zoom arrière.",
    "ja": "許可されている最大の拡大率。拡大率は 100% がズームなしに対応します。より大きな値でズームインします。より小さな値でズームアウトします。",
    "zh-TW": "允許的最大縮放倍率。縮放倍率 100% 等於不縮放。較大的值會放大，較小的值則會縮小。"
  },
  "media": {
    "de": "Medien",
    "en-US": "Media",
    "fr": "Média",
    "ja": "メディア",
    "pt-BR": "Midia",
    "ru": "Отображение",
    "zh-CN": "适用媒体",
    "zh-TW": "媒體"
  },
  "minZoomFactor": {
    "en-US": "The smallest allowed zoom factor. A zoom factor of 100% corresponds to no zooming. Larger values zoom in. Smaller values zoom out.",
    "fr": "Le facteur de zoom minimal autorisé. Un facteur de zoom de 100 % correspond à un zoom nul. Des valeurs plus grandes effectuent un zoom avant. Des valeurs plus petites effectuent un zoom arrière.",
    "ja": "許可されている最小の拡大率。拡大率は 100% がズームなしに対応します。より大きな値でズームインします。より小さな値でズームアウトします。",
    "zh-TW": "允許的最小縮放倍率。縮放倍率 100% 等於不縮放。較大的值會放大，較小的值則會縮小。"
  },
  "multicolElements": {
    "de": "mehrspaltige Elemente",
    "en-US": "multicol elements",
    "fr": "éléments sur plusieurs colonnes",
    "ja": "段組み要素",
    "ru": "мультиколоночные элементы",
    "zh-TW": "多欄元素"
  },
  "multiColumnElementsFlexContainersGridContainers": {
    "en-US": "multi-column elements, flex containers, grid containers",
    "fr": "éléments multi-colonnes, conteneurs flexibles, conteneurs de grille",
    "ja": "段組み要素、フレックスコンテナー、グリッドコンテナー",
    "zh-TW": "多欄元素、彈性容器、格線容器"
  },
  "multilineFlexContainers": {
    "de": "mehrzeilige flexible Container",
    "en-US": "multi-line flex containers",
    "fr": "conteneurs flexibles multi-lignes",
    "ja": "複数行のフレックスコンテナー",
    "ru": "мультистрочные flex-контейнеры",
    "zh-TW": "多行的彈性容器"
  },
  "no": {
    "de": "Nein",
    "en-US": "no",
    "fr": "non",
    "ja": "なし",
    "pt-BR": "não",
    "ru": "нет",
    "zh-CN": "否",
    "zh-TW": "否"
  },
  "noneButOverriddenInUserAgentCSS": {
    "de": "<code>none</code> (aber dieser Wert wird im User Agent CSS überschrieben)",
    "en-US": "<code>none</code> (but this value is overridden in the user agent CSS)",
    "fr": "<code>none</code> (cette valeur est surchargée par le CSS de l'agent utilisateur)",
    "ja": "<code>none</code> (ただし、この値はユーザーエージェント CSS で上書きされる)",
    "ru": "<code>none</code> (но это значение перезаписано в дефолтном CSS браузера)",
    "zh-TW": "<code>none</code>（但此值會在使用者代理 CSS 中被覆寫）"
  },
  "noneOrImageWithAbsoluteURI": {
    "de": "<code>none</code> oder das Bild mit absoluter URI",
    "en-US": "<code>none</code> or the image with its URI made absolute",
    "fr": "<code>none</code> ou l'image avec son URI rendue absolue",
    "ja": "<code>none</code> または画像の絶対化した URI",
    "ru": "<code>none</code> или изображение с абсолютным URI",
    "zh-TW": "<code>none</code> 或 URI 被設為絕對的圖片"
  },
  "noneOrOrderedListOfIdentifiers": {
    "en-US": "<code>none</code> or an ordered list of identifiers",
    "fr": "<code>none</code> ou une liste ordonnée d'identifiants",
    "ja": "<code>none</code> または識別子の順序付きリスト",
    "zh-TW": "<code>none</code> 或識別符的有序清單"
  },
  "nonReplacedBlockAndInlineBlockElements": {
    "de": "nicht ersetzte Blocklevel Elemente und nicht ersetzte Inlineblock Elemente",
    "en-US": "non-replaced block-level elements and non-replaced inline-block elements",
    "fr": "les éléments de bloc non remplacés et les éléments en bloc en ligne et en bloc (inline-block)",
    "ja": "非置換ブロックレベル要素と非置換インラインブロック要素",
    "ru": "не заменяемые блочные и inline-block элементы"
  },
  "nonReplacedBlockElements": {
    "de": "Nicht ersetzte <code>block</code>-Elemente (außer <code>table</code>-Elemente), <code>table-cell</code>- oder <code>inline-block</code>-Elemente",
    "en-US": "non-replaced <code>block</code> elements (except <code>table</code> elements), <code>table-cell</code> or <code>inline-block</code> elements",
    "fr": "éléments non-remplacés de type <code>block</code> ou <code>table</code>, ou éléments de type <code>table-cell</code> ou <code>inline-block</code>",
    "ja": "非置換ブロック要素 (<code>table</code> 要素を除く)、<code>table-cell</code> 要素、<code>inline-block</code> 要素のいずれか",
    "ru": "не заменяемые блочные элементы (кроме элементов <code>table</code>), <code>table-cell</code> или <code>inline-block</code> элементы"
  },
  "nonReplacedElements": {
    "en-US": "non-replaced elements",
    "fr": "éléments non remplacés",
    "ja": "置換要素以外"
  },
  "nonReplacedInlineElements": {
    "de": "nicht ersetzte Inlineelemente",
    "en-US": "non-replaced inline elements",
    "fr": "les éléments en ligne non remplacés",
    "ja": "置換でないインライン要素",
    "ru": "не заменяемые строчные элементы"
  },
  "noPracticalInitialValue": {
    "de": "Es gibt keinen praktischen Initialwert dafür.",
    "en-US": "There is no practical initial value for it.",
    "fr": "Il n'y a pas de valeur initiale pour cela.",
    "ja": "具体的な初期値なし。",
    "ru": "На практике начального значения нет"
  },
  "noPracticalMedia": {
    "de": "Es gibt kein praktisches Medium dafür.",
    "en-US": "There is no practical media for it.",
    "fr": "Il n'y a pas de média pour cela.",
    "ja": "具体的なメディアなし。",
    "ru": "Для этого нет практического применения."
  },
  "normalizedAngle": {
    "de": "normalisierter Winkel",
    "en-US": "normalized angle",
    "fr": "angle normalisé",
    "ja": "正規化された角度",
    "ru": "нормализованный угол"
  },
  "normalOnElementsForPseudosNoneAbsoluteURIStringOrAsSpecified": {
    "de": "Bei Elementen ist der berechnete Wert immer <code>normal</code>. Falls bei {{cssxref(\"::before\")}} und {{cssxref(\"::after\")}} <code>normal</code> angegeben ist, ist der berechnete Wert <code>none</code>. Ansonsten, für URI Werte die absolute URI; für <code>attr()</code> Werte der resultierende String; für andere Schlüsselwörter wie angegeben.",
    "en-US": "On elements, always computes to <code>normal</code>. On {{cssxref(\"::before\")}} and {{cssxref(\"::after\")}}, if <code>normal</code> is specified, computes to <code>none</code>. Otherwise, for URI values, the absolute URI; for <code>attr()</code> values, the resulting string; for other keywords, as specified.",
    "fr": "Sur les éléments, le résultat du calcul est toujours <code>normal</code>. Sur {{cssxref(\"::before\")}} et {{cssxref(\"::after\")}}, si <code>normal</code> est défini, cela donnera <code>none</code>. Sinon, pour les valeurs d'URI, on aura l'URI absolue&nbsp;; pour les valeurs <code>attr()</code>, on aura la chaine résultante&nbsp;; pour les autres mots-clé, ce sera comme défini.",
    "ja": "要素の場合は、常に <code>normal</code> と計算される。 {{cssxref(\"::before\")}} および {{cssxref(\"::after\")}} の場合、 <code>normal</code> が指定されていれば計算値は <code>none</code>。それ以外の場合、 URI 値の場合は絶対 URI、 <code>attr()</code> 値の場合は結果の文字列、その他のキーワードについては指定通り。",
    "ru": "На элементах всегда вычисляется как <code>normal</code>. На {{cssxref(\"::before\")}} и {{cssxref(\"::after\")}}, если <code>normal</code> указано, интерпретируется как <code>none</code>. Иначе, для значений URI, абсолютного URI; для значений <code>attr()</code> - результирующая строка; для других ключевых слов, как указано."
  },
  "normalOrComputedTime": {
    "en-US": "<code>normal</code> or a computed time",
    "fr": "<code>normal</code> ou un temps calculé"
  },
  "notAnimatable": {
    "en-US": "Not animatable",
    "fr": "Non animable",
    "ja": "アニメーション不可",
    "zh-TW": "不可動"
  },
  "number": {
    "de": "<a href=\"/de/docs/Web/CSS/Reference/Values/number#interpolation\">Nummer</a>",
    "en-US": "a <a href=\"/en-US/docs/Web/CSS/Reference/Values/number#interpolation\" title=\"Values of the <number> CSS data type are interpolated as real, floating-point, numbers.\">number</a>",
    "fr": "un <a href=\"/fr/docs/Web/CSS/Reference/Values/number#interpolation\" title=\"Les valeurs du type <nombre> sont interpolées comme des nombres réels, en virgule flottante.\">nombre</a>",
    "ja": "<a href=\"/ja/docs/Web/CSS/Reference/Values/number#interpolation\" title=\"<number> の CSS データ型の値は浮動小数点数の実数として補完されます。\">数値</a>",
    "ru": "<a href=\"/ru/docs/Web/CSS/Reference/Values/number#interpolation\" title=\"Значения типа данных CSS <число> интерполируются как вещественные числа с плавающей запятой.\">число</a>",
    "zh-TW": "<a href=\"/zh-TW/docs/Web/CSS/Reference/Values/number#interpolation\" title=\"CSS 資料型別 <number> 的值會被轉換成實數浮點數進行內插。\">數字</a>"
  },
  "numberOrLength": {
    "en-US": "either number or length",
    "fr": "soit un nombre, soit une longueur",
    "ja": "数値または長さ",
    "ru": "число или длина",
    "zh-CN": "数字或长度均可",
    "zh-TW": "數字或長度"
  },
  "oneOrTwoValuesLengthAbsoluteKeywordsPercentages": {
    "de": "Einer oder mehrere Werte, mit absolut gemachten Längen und Schlüsselwörtern zu Prozentwerten umgewandelt",
    "en-US": "One or two values, with length made absolute and keywords translated to percentages",
    "fr": "Une ou deux valeurs, avec la longueur en absolue et les mots-clés traduits en pourcentage",
    "ru": "Одно или два значения, с абсолютной длинной и ключевыми словами, переведёнными в проценты",
    "zh-TW": "一個或兩個值，長度會轉換為絕對值，關鍵字則轉換為百分比"
  },
  "oneToFourPercentagesOrAbsoluteLengthsPlusFill": {
    "de": "ein bis vier Prozentwert(e) (wie angegeben) oder absolute Länge(n) plus das Schlüsselwort <code>fill</code>, falls angegeben",
    "en-US": "one to four percentage(s) (as specified) or absolute length(s), plus the keyword <code>fill</code> if specified",
    "fr": "un à quatre pourcentages, comme définis, ou des longueurs absolues, suivis par le mot-clé <code>fill</code> si défini",
    "ja": "1 つから 4 つのパーセント値 (指定通り) または絶対的な長さ。指定されていれば続けてキーワード <code>fill</code>",
    "ru": "одно к четырём процентам (как указано) или абсолютной длине(ам), плюс ключевое слово <code>fill</code>, если указано",
    "zh-TW": "一到四個百分比（如指定）或絕對長度，如果有指定的話，再加上關鍵字 <code>fill</code>"
  },
  "optimumValueOfAbsoluteLengthOrNormal": {
    "de": "ein optimaler Wert, der entweder aus einer absoluten Länge oder dem Schlüsselwort <code>normal</code> besteht",
    "en-US": "an optimum value consisting of either an absolute length or the keyword <code>normal</code>",
    "fr": "une valeur optimale consistant en une longueur absolue ou <code>normal</code>",
    "ja": "絶対的な長さまたはキーワード <code>normal</code> のどちらかから成る最適値",
    "ru": "оптимальное значение состоит из абсолютной длины или ключевого слова <code>normal</code>",
    "zh-TW": "最佳值，由絕對長度或關鍵字 <code>normal</code> 組成"
  },
  "orderOfAppearance": {
    "de": "Reihenfolge des Auftretens in der formalen Grammatik der Werte",
    "en-US": "order of appearance in the formal grammar of the values",
    "fr": "l'ordre d'apparition dans la grammaire formelle des valeurs",
    "ja": "形式文法における値の出現順",
    "ru": "порядок появления в формальной грамматике значений"
  },
  "percentage": {
    "en-US": "percentage",
    "fr": "pourcentage"
  },
  "percentageAsSpecifiedAbsoluteLengthOrNone": {
    "de": "der Prozentwert wie angegeben oder die absolute Länge oder <code>none</code>",
    "en-US": "the percentage as specified or the absolute length or <code>none</code>",
    "fr": "le pourcentage comme défini ou la longueur absolue ou le mot-clé <code>none</code>",
    "ja": "指定されたパーセント値または絶対的な長さ、または <code>none</code>",
    "ru": "проценты, как указаны, абсолютная длина или <code>none</code>",
    "zh-TW": "指定的百分比、絕對長度或 <code>none</code>"
  },
  "percentageAsSpecifiedOrAbsoluteLength": {
    "de": "der Prozentwert wie angegeben oder die absolute Länge",
    "en-US": "the percentage as specified or the absolute length",
    "fr": "le pourcentage tel que défini ou une longueur absolue",
    "ja": "指定されたパーセント値または絶対的な長さ",
    "ru": "процент, как указан, или абсолютная длина",
    "zh-TW": "指定的百分比或絕對長度"
  },
  "percentageAutoOrAbsoluteLength": {
    "de": "ein Prozentwert oder <code>auto</code> oder die absolute Länge",
    "en-US": "a percentage or <code>auto</code> or the absolute length",
    "fr": "un pourcentage ou <code>auto</code> ou une longueur absolue",
    "ja": "パーセント値、 <code>auto</code>、絶対的な長さのいずれか",
    "ru": "процент, <code>auto</code> или абсолютная длина",
    "zh-TW": "百分比、<code>auto</code> 或絕對長度"
  },
  "percentageOrAbsoluteLengthPlusKeywords": {
    "de": "der Prozentwert wie angegeben oder die absolute Länge plus Schlüsselwörter, falls angegeben",
    "en-US": "the percentage as specified or the absolute length, plus any keywords as specified",
    "fr": "le pourcentage tel que défini ou la longueur absolue, ainsi que les mots-clé comme définis",
    "ja": "指定されたパーセント値または絶対的な長さ、続けて指定された任意の数のキーワード",
    "ru": "процент, как указан или абсолютная длина, а также любые ключевые слова",
    "zh-TW": "指定的百分比或絕對長度，再加上指定的任何關鍵字"
  },
  "percentages": {
    "de": "Prozentwerte",
    "en-US": "Percentages",
    "fr": "Pourcentages",
    "ja": "パーセント値",
    "ru": "Проценты",
    "zh-TW": "百分比"
  },
  "percentagesOrLengthsFollowedByFill": {
    "de": "die Prozentwerte oder Längen gefolgt vom Schlüsselwort <code>fill</code>",
    "en-US": "the percentages or lengths, eventually followed by the keyword <code>fill</code>",
    "fr": "les pourcentages ou les longueurs, éventuellement suivis par le mot-clé <code>fill</code>",
    "ja": "パーセント値または長さ、最後にキーワード <code>fill</code> が続く",
    "ru": "проценты или длины, в конечном счете, следует ключевое слово <code>fill</code>",
    "zh-TW": "百分比或長度，最後加上關鍵字 <code>fill</code>"
  },
  "perGrammar": {
    "de": "nach Grammatik",
    "en-US": "per grammar",
    "fr": "selon la grammaire",
    "ja": "文法通り",
    "zh-TW": "按語法"
  },
  "position": {
    "de": "<a href=\"/de/docs/Web/CSS/Reference/Values/position_value#interpolation\" title=\"Werte des <position> Datentyps werden unabhängig für Abszisse und Ordinate interpoliert. Da die Geschwindigkeit für beide durch dieselbe <easing-function> bestimmt wird, wird der Punkt einer Linie folgen.\">Position</a>",
    "en-US": "a <a href=\"/en-US/docs/Web/CSS/Reference/Values/position_value#interpolation\" title=\"Values of the <position> data type are interpolated independently for the abscissa and ordinate. As the speed is defined by the same <easing-function> for both, the point will move following a line.\">position</a>",
    "fr": "une <a href=\"/fr/docs/Web/CSS/Reference/Values/position_value#interpolation\" title=\"Les valeurs de type <position> sont interpolées indépendamment pour les abscisses et pour les ordonnées. La vitesse est définie par la même <easing-function>, le point se déplacera donc suivant une ligne.\">position</a>",
    "ja": "<a href=\"/en-US/docs/Web/CSS/Reference/Values/position_value#interpolation\" title=\"<position> データ型の値は、横軸と縦軸に対して個別に補間されます。速度は両方とも同じ <easing-function> で定義されているので、点は線に沿って移動します。\">position</a>",
    "ru": "<a href=\"/ru/docs/Web/CSS/Reference/Values/position_value#interpolation\" title=\"Значении типа данных <позиция> интерполизуются независимо как абсцисса или ордината. Скорость определяется по одной <временной функции> для обоих координат, точка будет двигаться следуя линии.\">позиция</a>"
  },
  "positionedElements": {
    "de": "positionierte Elemente",
    "en-US": "positioned elements",
    "fr": "éléments positionnés",
    "ja": "位置指定要素",
    "ru": "позиционированные элементы"
  },
  "positionedElementsWithADefaultAnchorElement": {
    "en-US": "Positioned elements with a <a href=\"https://drafts.csswg.org/css-anchor-position-1/#default-anchor-element\">default anchor element</a>",
    "fr": "Éléments positionnés avec un <a href=\"https://drafts.csswg.org/css-anchor-position-1/#default-anchor-element\">élément d'ancrage par défaut <sup>(angl.)</sup></a>"
  },
  "rectangle": {
    "de": "<a href=\"/de/docs/Web/CSS/Reference/Values/shape#interpolation\">Rechteck</a>",
    "en-US": "a <a href=\"/en-US/docs/Web/CSS/Reference/Values/shape#interpolation\" title=\"Values of the <shape> CSS data type which are rectangles are interpolated over their top, right, bottom and left component, each treated as a real, floating-point number.\">rectangle</a>",
    "fr": "un <a href=\"/fr/docs/Web/CSS/Reference/Values/shape#interpolation\" title=\"Valeurs de type CSS <forme> qui ont des rectangles interpolés sur leurs composantes haute, droite, basse et gauche dont chacune est traitée comme un nombre flottant réel.\">rectangle</a>",
    "ja": "<a href=\"/ja/docs/Web/CSS/Reference/Values/shape#interpolation\" title=\"CSS の <shape> データ型が矩形の場合の値は、その上、右、下、左の各部分に補間され、それぞれが浮動小数点数の実数として扱われます。\">rectangle</a>",
    "ru": "<a href=\"/ru/docs/Web/CSS/Reference/Values/shape#interpolation\" title=\"Значения типа данных CSS <фигура>, которые являются прямоугольниками, интерполируются по их верхней, правой, нижней и левой компоненте, каждая из которых трактуется как вещественное число или с плавающей запятой.\">прямоугольник</a>"
  },
  "referToBorderBox": {
    "de": "beziehen sich auf die Rahmenbox des Elements",
    "en-US": "refer to the element's border box",
    "fr": "fait référence à l'élément <code>border box</code>",
    "ja": "要素の境界ボックスに対する相対値",
    "ru": "относятся к границе элемента",
    "zh-TW": "指元素的框線方塊"
  },
  "referToContainingBlockHeight": {
    "de": "bezieht sich auf die Höhe des äußeren Elements",
    "en-US": "refer to the height of the containing block",
    "fr": "se rapporte à la hauteur du bloc contenant",
    "ja": "包含ブロックの高さに対する相対値",
    "ru": "относятся к высоте содержащего блока",
    "zh-TW": "指包含方塊的高度"
  },
  "referToDimensionOfBorderBox": {
    "de": "bezieht sich auf die Größe der Border-Box",
    "en-US": "refer to the corresponding dimension of the border box",
    "fr": "se rapporte à la dimension correspondance de la boîte de bordure",
    "ja": "境界ボックスの対応する寸法に対する相対値",
    "ru": "относятся к соответствующему размеру границы элемента"
  },
  "referToDimensionOfContentArea": {
    "de": "beziehen sich auf die entsprechende Dimension des Inhaltsbereichs",
    "en-US": "refer to corresponding dimension of the content area",
    "fr": "fait référence à la dimension correspondante de la zone de contenu",
    "ja": "コンテンツ領域の対応する寸法に対する相対値",
    "ru": "относятся к соответствующему размеру области содержимого"
  },
  "referToElementFontSize": {
    "de": "bezieht sich auf die Schriftgröße des Elternelements",
    "en-US": "refer to the font size of the element itself",
    "fr": "se rapporte à la taille de la police de l'élément lui-même",
    "ja": "要素自身のフォントサイズに対する相対値",
    "ru": "относятся к размеру шрифта самого элемента",
    "zh-TW": "指元素自身的字體大小"
  },
  "referToFlexContainersInnerMainSize": {
    "de": "bezieht sich auf die Hauptgröße des Flexcontainers",
    "en-US": "refer to the flex container's inner main size",
    "fr": "se rapporte à la principale taille interne du conteneur flexible",
    "ja": "フレックスコンテナーの内部の主要な寸法に対する相対値",
    "ru": "относятся к внутреннему размеру главного flex-контейнера"
  },
  "referToHeightOfBackgroundPositioningAreaMinusBackgroundImageHeight": {
    "de": "bezieht sich auf die Höhe des Hintergrundpositionsbereichs abzüglich der Höhe des Hintergrundbilds",
    "en-US": "refer to height of background positioning area minus height of background image",
    "fr": "fait référence à la hauteur de la zone de positionnement de l'arrière-plan moins la hauteur de l'image d'arrière-plan",
    "ja": "背景配置領域の高さから背景画像の高さを引いた値に対する相対値",
    "ru": "относятся к высоте области позиционирования фона минус высота фонового изображения"
  },
  "referToHeightOfInitialViewport": {
    "de": "beziehen sich auf die Höhe des ursprünglichen Viewports",
    "en-US": "referT to the height of the initial viewport",
    "fr": "fait référence à la hauteur de la zone d'affichage (<i>viewport</i>) initiale",
    "ja": "初期ビューポートの高さに対する相対値",
    "ru": "относятся к высоте изначальной области просмотра",
    "zh-TW": "指初始檢視區的高度"
  },
  "referToLineBoxWidth": {
    "en-US": "calculated with respect to the width of the line box",
    "fr": "calculé par rapport à la largeur de la boîte de ligne",
    "ja": "行ボックスの高さを基準に計算"
  },
  "referToLineHeight": {
    "de": "bezieht sich auf die {{cssxref(\"line-height\")}} des Elements selbst",
    "en-US": "refer to the {{cssxref(\"line-height\")}} of the element itself",
    "fr": "se rapporte à la hauteur de ligne de l'élément lui-même",
    "ja": "要素自身の {{cssxref(\"line-height\")}} に対する相対値",
    "ru": "относятся к {{cssxref(\"line-height\")}} самого элемента",
    "zh-TW": "指元素自身的 {{cssxref(\"line-height\")}}"
  },
  "referToParentElementsFontSize": {
    "de": "bezieht sich auf die Schriftgröße des Elternelements",
    "en-US": "refer to the parent element's font size",
    "fr": "se rapporte à la taille de la police de l'élément parent",
    "ja": " 親要素の font-size に対する相対値",
    "ru": "относятся к размеру шрифта родителя",
    "zh-TW": "指父元素的字體大小"
  },
  "referToReferenceBoxWhenSpecifiedOtherwiseBorderBox": {
    "en-US": "refer to reference box when specified, otherwise border-box",
    "fr": "se rapporte à la boîte de référence lorsqu'elle est définie, sinon à la boîte de bordure",
    "ja": "指定されている場合は参照ボックス、それ以外の場合は境界ボックスに対する相対値"
  },
  "referToSizeOfBackgroundPositioningAreaMinusBackgroundImageSize": {
    "de": "bezieht sich auf die Größe des Hintergrundpositionsbereichs abzüglich der Größe des Hintergrundbilds; die Größe bezieht sich auf die vertikalen und horizontalen Verschiebungen",
    "en-US": "refer to the size of the background positioning area minus size of background image; size refers to the width for horizontal offsets and to the height for vertical offsets",
    "fr": "se rapporte à la taille de la zone de positionnement de l'arrière-plan, moins la taille de l'image; la taille se rapporte à la largeur pour les décalages horizontaux et à la hauteur pour les décalages verticaux",
    "ja": "背景配置領域の高さから背景画像の高さを引いた値に対する相対値。寸法は水平オフセットの幅と垂直オフセットの高さに対する相対値",
    "ru": "относятся к размеру области позиционирования фона минус размер фонового изображения; размер - ширина горизонтальных смещений и высота вертикальных"
  },
  "referToSizeOfBorderImage": {
    "de": "bezieht sich auf die Größe des Bildes",
    "en-US": "refer to the size of the border image",
    "fr": "se rapporte à la taille de l'image de bordure",
    "ja": "境界画像の大きさに対する相対値",
    "ru": "относятся к размеру рамки изображения",
    "zh-TW": "指框線圖片的大小"
  },
  "referToSizeOfBoundingBox": {
    "de": "bezieht sich auf die Größe der äußeren Box",
    "en-US": "refer to the size of bounding box",
    "fr": "se rapporte à la taille de la boîte de l'élément",
    "ja": "囲みボックスの寸法に対する相対値",
    "ru": "ссылается на размер ограничительной рамки",
    "zh-TW": "指邊界框的尺寸"
  },
  "referToSizeOfContainingBlock": {
    "en-US": "refer to the size of containing block",
    "fr": "fait référence à la taille du bloc englobant",
    "zh-TW": "指包含區塊的大小"
  },
  "referToSizeOfElement": {
    "de": "beziehen sich auf die Größe der Box selbst",
    "en-US": "refer to the size of the box itself",
    "fr": "fait référence à la taille de la boîte elle-même",
    "ja": "ボックス自身の寸法に対する相対値",
    "ru": "ссылается на размер самого блока",
    "zh-TW": "指方塊自身的大小"
  },
  "referToSizeOfFont": {
    "de": "ja, beziehen sich auf die entsprechende Größe der Schriftart",
    "en-US": "yes, refer to the corresponding size of the text font",
    "fr": "oui, indique la taille correspondante de la police de texte",
    "ja": "可、テキストのフォントの対応する寸法に対する相対値",
    "ru": "да, относятся к соответствующему размеру шрифта текста",
    "zh-TW": "是，指相應文字字體的大小"
  },
  "referToSizeOfMaskBorderImage": {
    "en-US": "refer to size of the mask border image",
    "fr": "fait référence à la taille de l'image de la bordure du masque",
    "ja": "境界のマスク画像の寸法に対する相対値",
    "zh-TW": "指遮罩框線圖片的大小"
  },
  "referToSizeOfMaskPaintingArea": {
    "de": "beziehen sich auf die Größe des Maskenzeichenbereichs minus der Größe des Maskenebenenbildes (siehe den Text zu {{cssxref(\"background-position\")}})",
    "en-US": "refer to size of mask painting area minus size of mask layer image (see the text for {{cssxref(\"background-position\")}})",
    "fr": "fait référence à la taille du masque pour la zone de pointure moins la taille du masque pour la taille de l'image (voir {{cssxref(\"background-position\")}})",
    "ja": "マスク描画領域の寸法からマスクレイヤー画像の寸法を引いたものに対する相対値 ({{cssxref(\"background-position\")}} のテキストを参照)",
    "ru": "относятся к размеру маски области рисования минус размер маски слоя изображения (смотрите статью о {{cssxref(\"background-position\")}})"
  },
  "referToSVGViewportDiagonal": {
    "en-US": "refer to the normalized diagonal measure of the current SVG viewport's applied {{SVGAttr(\"viewBox\")}}, or of the viewport itself if no <code>viewBox</code> is specified",
    "fr": "se rapporte à la mesure diagonale normalisée du {{SVGAttr(\"viewBox\")}} appliqué à la zone d'affichage (<i lang=\"en\">viewport</i>) SVG actuelle, ou de la zone d'affichage elle-même si aucun <code>viewBox</code> n'est défini"
  },
  "referToSVGViewportHeight": {
    "en-US": "refer to the height of the current SVG viewport",
    "fr": "se rapporte à la hauteur de la zone d'affichage (<i lang=\"en\">viewport</i>) SVG actuelle"
  },
  "referToSVGViewportSize": {
    "en-US": "refer to the normalized diagonal of the current SVG viewport",
    "fr": "se rapporte à la diagonale normalisée de la zone d'affichage (<i lang=\"en\">viewport</i>) SVG actuelle"
  },
  "referToSVGViewportWidth": {
    "en-US": "refer to the width of the current SVG viewport",
    "fr": "se rapporte à la largeur de la zone d'affichage (<i lang=\"en\">viewport</i>) SVG actuelle"
  },
  "referToTheUsedValueOfLineHeight": {
    "en-US": "refer to the used value of {{cssxref(\"line-height\")}}",
    "fr": "se rapporte à la valeur utilisée de la hauteur de ligne ({{cssxref(\"line-height\")}})"
  },
  "referToTotalPathLength": {
    "de": "beziehen sich auf die Gesamtlänge des Pfads",
    "en-US": "refer to the total path length",
    "fr": "se rapporte à la longueur totale du chemin",
    "ja": "パスの全長に対する相対値",
    "ru": "относятся к общей длине пути"
  },
  "referToWidthAndHeightOfElement": {
    "de": "beziehen sich auf Breite und Höhe des Elements",
    "en-US": "refer to width and height of element itself",
    "fr": "se rapporte à la largeur et à la hauteur de l'élément lui-même",
    "ja": "要素自身の幅と高さに対する相対値",
    "ru": "относятся к ширине и высоте самого элемента",
    "zh-TW": "指元素自身的寬度和高度"
  },
  "referToWidthOfAffectedGlyph": {
    "de": "bezieht sich auf die Breite des jeweiligen Zeichens",
    "en-US": "refer to the width of the affected glyph",
    "fr": "se rapporte à la largeur du glyphe concerné",
    "ja": "作用する文字の幅に対する相対値",
    "ru": "зависит от ширины символа"
  },
  "referToWidthOfBackgroundPositioningAreaMinusBackgroundImageWidth": {
    "de": "bezieht sich auf die Breite des Hintergrundpositionsbereichs abzüglich der Höhe des Hintergrundbilds",
    "en-US": "refer to width of background positioning area minus width of background image",
    "fr": "fait référence à la largeur de la zone de positionement de l'arrière-plan moins la largeur de l'image d'arrière-plan",
    "ja": "背景配置領域の幅から背景画像の高さを引いたものに対する相対値",
    "ru": "относятся к ширине области позиционирования фона минус высота фонового изображения",
    "zh-TW": "指背景定位區域的寬度減去背景圖片的寬度"
  },
  "referToWidthOfContainingBlock": {
    "de": "bezieht sich auf die Breite des äußeren Elements",
    "en-US": "refer to the width of the containing block",
    "fr": "se rapporte à la largeur du bloc contenant",
    "ja": "包含ブロックの幅に対する相対値",
    "ru": "ссылается на ширину содержащего блока",
    "zh-TW": "指包含方塊的寬度"
  },
  "referToWidthOfInitialViewport": {
    "de": "beziehen sich auf die Breite des ursprünglichen Viewports",
    "en-US": "refer to the width of the initial viewport",
    "fr": "fait référence à la largeur de la zone d'affichage (<i>viewport</i>) initiale",
    "ja": "初期ビューポートの幅に対する相対値",
    "ru": "относятся к ширине изначальной области просмотра",
    "zh-TW": "指初始檢視區的寬度"
  },
  "referToWidthOrHeightOfBorderImageArea": {
    "de": "bezieht sich auf die Größe des Rahmenbildbereichs",
    "en-US": "refer to the width or height of the border image area",
    "fr": "se rapporte à la largeur ou la hauteur de la zone de l'image de bordure",
    "ja": "境界画像領域の幅または高さに対する相対値",
    "ru": "относятся к высоте или ширине области рамки картинки",
    "zh-TW": "指框線圖片區域的寬度或高度"
  },
  "regardingHeightOfGeneratedBoxContainingBlockPercentages0": {
    "de": "Der Prozentwert wird unter Berücksichtigung der Höhe des die generierte Box beinhaltenden Blocks berechnet. Falls die Höhe des beinhaltenden Blocks nicht explizit angegeben wurde (d. h. sie hängt von der Höhe des Inhalts ab) und dieses Element nicht absolut positioniert ist, wird der Prozentwert wie <code>0</code> behandelt.",
    "en-US": "The percentage is calculated with respect to the height of the generated box's containing block. If the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the percentage value is treated as <code>0</code>.",
    "es": "Se refiere a la altura del bloque contenedor.",
    "fr": "Le pourcentage est exprimé par rapport à la hauteur de la boîte générée par le bloc contenant. Si la hauteur du bloc contenant n'est pas explicitement définie (c'est-à-dire qu'elle dépend de la hauteur du contenu), et si cet élément n'est pas absolument positionné, la valeur du pourcentage est traitée comme si elle valait <code>0</code>.",
    "ja": "パーセント値は、生成ボックスの包含ブロックの高さを基準に計算されます。 包含ブロックの高さが明示的に定義されず (この場合コンテンツの高さに依存します) この要素が絶対位置指定されていない場合は、パーセント値は 0 として扱われます。",
    "ru": "Процент для генерируемого блока рассчитывается по отношению к высоте содержащего блока. Если высота содержащего блока не задана явно (т.е. зависит от высоты содержимого), и этот этот элемент позиционирован не абсолютно, процентное значение интерпретируется как <code>0</code>."
  },
  "regardingHeightOfGeneratedBoxContainingBlockPercentagesNone": {
    "de": "Der Prozentwert wird unter Berücksichtigung der Höhe des die generierte Box beinhaltenden Blocks berechnet. Falls die Höhe des beinhaltenden Blocks nicht explizit angegeben wurde (d. h. sie hängt von der Höhe des Inhalts ab) und dieses Element nicht absolut positioniert ist, wird der Prozentwert wie <code>none</code> behandelt.",
    "en-US": "The percentage is calculated with respect to the height of the generated box's containing block. If the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the percentage value is treated as <code>none</code>.",
    "fr": "Le pourcentage est par rapport à la hauteur de la boîte générée par le bloc contenant. Si la hauteur du bloc contenant n'est pas explicitement définie (c'est-à-dire qu'elle dépend de la hauteur du contenu), et si cet élément n'est pas absolument positionné, la valeur du pourcentage est traitée comme si elle valait <code>none</code>.",
    "ja": "パーセント値は、生成ボックスの包含ブロックの高さを基準に計算されます。 包含ブロックの高さが明示的に定義されず (すなわち、コンテンツの高さに依存します)、この要素が絶対位置指定されていない場合は、パーセント値は <code>none</code> として扱われます。",
    "ru": "Процент для генерируемого блока рассчитывается по отношению к высоте содержащего блока. Если высота содержащего блока не задана явно (т.е. зависит от высоты содержимого), и этот элемент позиционирован не абсолютно, процентное значение интерпретируется как <code>none</code>."
  },
  "regardingHeightOfGeneratedBoxContainingBlockPercentagesRelativeToContainingBlock": {
    "de": "Der Prozentwert wird unter Berücksichtigung der Höhe des die generierte Box beinhaltenden Blocks berechnet. Falls die Höhe des beinhaltenden Blocks nicht explizit angegeben wurde (d. h. sie hängt von der Höhe des Inhalts ab) und dieses Element nicht absolut positioniert ist, ist der berechnete Wert <code>auto</code>. Eine prozentuale Höhe beim Wurzelelement ist relativ zum ursprünglichen beinhaltenden Block.",
    "en-US": "The percentage is calculated with respect to the height of the generated box's containing block. If the height of the containing block is not specified explicitly (i.e., it depends on content height), and this element is not absolutely positioned, the value computes to <code>auto</code>. A percentage height on the root element is relative to the initial containing block.",
    "fr": "Le pourcentage est exprimé par rapport à la hauteur de la boîte générée par le bloc contenant. Si la hauteur du bloc contenant n'est pas explicitement définie (c'est-à-dire qu'elle dépend de la hauteur du contenu), et si cet élément n'est pas absolument positionné, la valeur du pourcentage est traitée comme <code>auto</code> et la hauteur du pourcentage sur l'élément racine est relative au bloc contenant initial.",
    "ja": "パーセント値は、生成ボックスの包含ブロックの高さを基準に計算されます。 包含ブロックの高さが明示的に定義されず (すなわち、コンテンツの高さに依存します)、この要素が絶対位置指定されていない場合は、値は <code>auto</code> になります。ルート要素で高さをパーセント値で指定すると、初期包含ブロックに対する相対値になります。",
    "ru": "Процент для генерируемого блока рассчитывается по отношению к высоте содержащего блока. Если высота содержащего блока не задана явно (т.е. зависит от высоты содержимого), и этот этот элемент позиционирован не абсолютно, значение будет <code>auto</code>. Процентная высота на корневом элементе относительна первоначальному блоку.",
    "zh-TW": "百分比根據產生方塊所包含區塊的高度計算。如果包含區塊的高度沒有明確指定（即取決於內容高度），且此元素非絕對定位，則計算值為 <code>auto</code>。根元素的百分比高度相對於初始包含區塊。"
  },
  "relatedAtRule": {
    "de": "Zugehörige <a href=\"/de/docs/Web/CSS/Reference/At-rules\">@-Regel</a>",
    "en-US": "Related <a href=\"/en-US/docs/Web/CSS/Reference/At-rules\">at-rule</a>",
    "fr": "En lien avec les <a href=\"/fr/docs/Web/CSS/Reference/At-rules\">règles @</a>",
    "ja": "関連する<a href=\"/ja/docs/Web/CSS/Reference/At-rules\">アット規則</a>",
    "ru": "Связано с <a href=\"/ru/docs/Web/CSS/Reference/At-rules\">@-правила</a>",
    "zh-TW": "相關的 <a href=\"/zh-TW/docs/Web/CSS/Reference/At-rules\">at-rule</a>"
  },
  "relativeToBackgroundPositioningArea": {
    "de": "bezieht sich auf den jeweiligen Bereich",
    "en-US": "relative to the background positioning area",
    "fr": "relatifs à la zone de positionnement du fond",
    "ja": "背景配置領域に対する相対値",
    "ru": "относительно области позиционирования фона",
    "zh-TW": "相對於背景定位區域"
  },
  "relativeToCorrespondingDimensionOfRelevantScrollport": {
    "en-US": "Relative to the corresponding dimension of the relevant scrollport",
    "ja": "関連するスクロールポートの対応する寸法との相対値"
  },
  "relativeToMaskBorderImageArea": {
    "en-US": "relative to width/height of the mask border image area",
    "ja": "境界マスク画像領域の幅/高さに対する相対値",
    "zh-TW": "相對於遮罩框線圖片區域的寬度/高度"
  },
  "relativeToScrollContainerPaddingBoxAxis": {
    "de": "relativ zur gleichen Achse der Innenabstandsbox des Scrollcontainers",
    "en-US": "relative to same axis of the padding-box of the scroll container",
    "fr": "relatif au même axe de la <code>padding-box</code> du conteneur d'ascenceur",
    "ja": "スクロールコンテナーのパディングボックスの同じ軸に対する相対値",
    "ru": "относительно той же оси и внутренних отступов прокручиваемого контейнера"
  },
  "relativeToTheScrollContainersScrollport": {
    "en-US": "relative to the scroll container's scrollport",
    "fr": "relatif à la zone de défilement du conteneur de défilement",
    "ja": "スクロールコンテナーのスクロールポートに対する相対値"
  },
  "relativeToTimelineRangeIfSpecifiedOtherwiseEntireTimeline": {
    "en-US": "Relative to the specified named timeline range if specified, otherwise relative to the entire timeline",
    "fr": "Relatif à la plage de la chronologie nommée définie si elle est définie, sinon relatif à l'ensemble de la chronologie",
    "ja": "名前付きタイムラインが指定されていればその範囲、そうでない場合はタイムライン全体からの相対値"
  },
  "relativeToWidthAndHeight": {
    "en-US": "relative to the width and the height of the element's reference box",
    "fr": "relatifs à la largeur et à la hauteur de la boîte de référence de l'élément",
    "zh-TW": "相對於元素參考方塊的寬度和高度"
  },
  "repeatableList": {
    "en-US": "a repeatable list",
    "fr": "une liste répétable",
    "ja": "反復可能リスト",
    "ru": "повторяющийся список из "
  },
  "replacedElements": {
    "de": "ersetzte Elemente",
    "en-US": "replaced elements",
    "fr": "éléments remplacés",
    "ja": "置換要素",
    "ru": "заменяемые элементы",
    "zh-CN": "替换元素"
  },
  "rubyAnnotationContainers": {
    "de": "Ruby-Anmerkungscontainer",
    "en-US": "ruby annotation containers",
    "fr": "annotations ruby des conteneurs",
    "ja": "ルビ注釈コンテナー",
    "ru": "контейнеры ruby-аннотаций",
    "zh-TW": "音標註釋容器"
  },
  "rubyBasesAnnotationsBaseAnnotationContainers": {
    "de": "Ruby-Basiselemente, Ruby-Anmerkungen, Ruby-Basiscontainer, Ruby-Anmerkungscontainer",
    "en-US": "ruby bases, ruby annotations, ruby base containers, ruby annotation containers",
    "fr": "bases ruby, annotations ruby, conteneurs de bases ruby, conteneurs d'annotations ruby",
    "ja": "ルビベース、ルビ注釈、ルビベースコンテナー、ルビ注釈コンテナー",
    "ru": "базовые элементы ruby, аннотации к ruby, базовые ruby контейнеры, контейнеры аннотаций к ruby",
    "zh-TW": "音標基底、音標註釋、音標基底容器、音標註釋容器"
  },
  "sameAsBoxOffsets": {
    "de": "wie die Boxoffsets: {{cssxref(\"top\")}}, {{cssxref(\"right\")}}, {{cssxref(\"bottom\")}}, {{cssxref(\"left\")}} Eigenschaften, mit dem Unterschied, dass die Richtungen logisch sind",
    "en-US": "same as box offsets: {{cssxref(\"top\")}}, {{cssxref(\"right\")}}, {{cssxref(\"bottom\")}}, {{cssxref(\"left\")}} properties except that directions are logical",
    "fr": "identiques aux propriétés qui décalent les boîtes&nbsp;: {{cssxref(\"top\")}}, {{cssxref(\"right\")}}, {{cssxref(\"bottom\")}}, {{cssxref(\"left\")}} sauf que ces directions sont logiques",
    "ja": "方向が論理的である以外はボックスのオフセット、 {{cssxref(\"top\")}}, {{cssxref(\"right\")}}, {{cssxref(\"bottom\")}}, {{cssxref(\"left\")}} と同じ",
    "ru": "также как смещение блоков свойствами: {{cssxref(\"top\")}}, {{cssxref(\"right\")}}, {{cssxref(\"bottom\")}}, {{cssxref(\"left\")}}, кроме того направления логичны"
  },
  "sameAsMargin": {
    "de": "wie bei {{cssxref(\"margin\")}}",
    "en-US": "same as {{cssxref(\"margin\")}}",
    "fr": "identique à {{cssxref(\"margin\")}}",
    "ja": "{{cssxref(\"margin\")}} と同じ",
    "ru": "с таким же {{cssxref(\"margin\")}}",
    "zh-TW": "與 {{cssxref(\"margin\")}} 相同"
  },
  "sameAsMaxWidthAndMaxHeight": {
    "de": "wie bei {{cssxref(\"max-width\")}} und {{cssxref(\"max-height\")}}",
    "en-US": "same as {{cssxref(\"max-width\")}} and {{cssxref(\"max-height\")}}",
    "fr": "identique à {{cssxref(\"max-width\")}} et à {{cssxref(\"max-height\")}}",
    "ja": "{{cssxref(\"max-width\")}} および {{cssxref(\"max-height\")}} と同じ",
    "ru": "с такими же {{cssxref(\"max-width\")}} и {{cssxref(\"max-height\")}}",
    "zh-TW": "與 {{cssxref(\"max-width\")}} 和 {{cssxref(\"max-height\")}} 相同"
  },
  "sameAsMinWidthAndMinHeight": {
    "de": "wie bei {{cssxref(\"min-width\")}} und {{cssxref(\"min-height\")}}",
    "en-US": "same as {{cssxref(\"min-width\")}} and {{cssxref(\"min-height\")}}",
    "fr": "identique à {{cssxref(\"min-width\")}} et à {{cssxref(\"min-height\")}}",
    "ja": "{{cssxref(\"min-width\")}} および {{cssxref(\"min-height\")}} と同じ",
    "ru": "с такими же {{cssxref(\"min-width\")}} и {{cssxref(\"min-height\")}}",
    "zh-TW": "與 {{cssxref(\"min-width\")}} 和 {{cssxref(\"min-height\")}} 相同"
  },
  "sameAsWidthAndHeight": {
    "de": "wie bei {{cssxref(\"width\")}} und {{cssxref(\"height\")}}",
    "en-US": "same as {{cssxref(\"width\")}} and {{cssxref(\"height\")}}",
    "fr": "identique à {{cssxref(\"width\")}} et à {{cssxref(\"height\")}}",
    "ja": "{{cssxref(\"width\")}} および {{cssxref(\"height\")}} と同じ",
    "ru": "с такими же {{cssxref(\"width\")}} и {{cssxref(\"height\")}}",
    "zh-TW": "與 {{cssxref(\"width\")}} 和 {{cssxref(\"height\")}} 相同"
  },
  "scrollContainers": {
    "de": "Scrollcontainer",
    "en-US": "scroll containers",
    "fr": "conteneurs d'ascenseurs",
    "ja": "スクロールコンテナー",
    "ru": "прокручиваемые контейнеры",
    "zh-TW": "捲動容器"
  },
  "scrollingBoxes": {
    "de": "scrollende Boxen",
    "en-US": "scrolling boxes",
    "fr": "boîtes défilantes",
    "ja": "スクロールするボックス",
    "ru": "прокручиваемые блоки",
    "zh-TW": "捲動方塊"
  },
  "seeProse": {
    "de": "siehe Text",
    "en-US": "see prose",
    "fr": "voir le texte",
    "ja": "本文を参照",
    "ru": "смотреть текст"
  },
  "shadowList": {
    "de": "eine <a href=\"/de/docs/Web/CSS/Reference/Properties/box-shadow#interpolation\" title=\"Die color, x, y, blur und spread (falls anwendbar) Komponenten einer Schattenliste werden unabhängig voneinander interpoliert. Falls sich der inset-Wert irgendeines Schattenpaares der beiden Listen unterscheidet, gilt die gesamte liste als nicht interpolierbar. Falls eine Liste kürzer ist als die andere, wird die kürzere mit transparenten Schatten aufgefüllt, deren Längen alle auf 0 gesetzt sind und deren inset-Wert der längeren Liste entspricht.\">Liste von Schatten</a>",
    "en-US": "a <a href=\"/en-US/docs/Web/CSS/Reference/Properties/box-shadow#interpolation\" title=\"The color, x, y, blur and spread (if applicable) components of shadow lists are interpolated independently. If the inset value of any shadow pair differs between both lists, the whole list is uninterpolable. If one list is smaller than the other, it gets padded with transparent shadows with all their lengths set to 0 and its inset value matching the longer list.\">shadow list</a>",
    "fr": "une <a href=\"/fr/docs/Web/CSS/Reference/Properties/box-shadow#interpolation\" title=\"Les composantes de couleur, coordonnées x, y, de flou et d'étalement (si applicable) des listes d'ombres sont interpolées indépendamment. Si la valeur inset de n'importe quelle ombre différe entre les deux listes, toute la liste ne pourra pas être interpolée. Si une liste est plus petite qu'une autre, elle sera complétée avec des ombres transparentes dont les longueurs sont nulles et dont les valeurs d'inset correspondent à celles de la liste plus longue.\">liste d'ombres</a>",
    "ja": "a <a href=\"/ja/docs/Web/CSS/Reference/Properties/box-shadow#interpolation\" title=\"影のリストは、色の成分、 x、 y、 ぼかし、 (適切であれば) 広がりの成分で個別に補完されます。両方のリストで影の組の inset の値が異なる場合は、リスト全体は補完されません。一方のリストがもう一方より短い場合は、 transparent の色の影で補完し、すべての長さが 0 であり、 inset (の有無) が一致するものがあれば、より長いリストに一致します。\">影のリスト</a>",
    "ru": "<a href=\"/ru/docs/Web/CSS/Reference/Properties/box-shadow#interpolation\" title=\"Цвет, абсцисса, ордината, размытие и распространение (если применено) списка теней интерполируются независимо. Если внутреннее значение какой-либо пары теней различается в обоих списках, интерполизуется весь список. Если один список меньше остальных, он дополняется прозрачностью теней со всей их длинной установленной в 0, а его внутреннее значение соответствует длинному списку.\">список теней</a>"
  },
  "simpleList": {
    "de": "ein einfacher Wert der folgenden Eigenschaften: ",
    "en-US": "a simple list of ",
    "fr": "une simple liste de ",
    "ja": "単純なリスト: ",
    "ru": "простой список из ",
    "zh-CN": "由以下类型组成的简单列表："
  },
  "simpleListOfLpc": {
    "en-US": "simple list of length, percentage, or calc",
    "fr": "liste simple de longueur, pourcentage ou calc",
    "ja": "長さ、パーセント値、 calc の単純なリスト",
    "zh-TW": "包含長度、百分比或 calc 的簡單列表"
  },
  "simpleListOfLpcDifferenceLpc": {
    "en-US": "simple list of length, percentage, or calc, provided the only differences are in the values of the length, percentage, or calc components in the list",
    "fr": "liste simple de longueur, pourcentage ou calc, à condition que les seules différences soient dans les valeurs des composants de longueur, pourcentage ou calc dans la liste",
    "ja": "長さ、パーセント値、 calc の単純なリストであり、唯一の違いはリスト内の長さ、パーセント値、 calc の部分の値のみ"
  },
  "specifiedInteger": {
    "en-US": "The specified integer",
    "fr": "L'entier défini"
  },
  "specifiedIntegerOrAbsoluteLength": {
    "de": "die angegebene Ganzzahl oder eine absolute Länge",
    "en-US": "the specified integer or an absolute length",
    "fr": "l'entier défini ou une longueur absolue",
    "ja": "指定された整数値または絶対的な長さ",
    "ru": "указанное целое число или абсолютная длина",
    "zh-TW": "指定的整數或絕對長度"
  },
  "specifiedKeywordOrComputedFunction": {
    "en-US": "specified keyword, or computed function",
    "fr": "mot-clé défini, ou fonction calculée"
  },
  "specifiedValue": {
    "en-US": "specified value",
    "fr": "valeur définie"
  },
  "specifiedValueClipped0To1": {
    "de": "der angegebene Wert, auf den Bereich <code>[0,1]</code> abgeschnitten",
    "en-US": "the specified value, clipped in the range <code>[0,1]</code>",
    "fr": "la valeur définie, écrêtée à l'intervalle <code>[0,1]</code>",
    "ja": "指定値が <code>[0,1]</code> の範囲内にクリップされたもの",
    "ru": "указанное значение, обрезается до диапозона <code>[0,1]</code>",
    "zh-TW": "指定的值，範圍限制在 <code>[0,1]</code>"
  },
  "specifiedValueNumberClipped0To1": {
    "de": "Derselbe wie der angegebene Wert nachdem die {{cssxref(\"number\")}} auf den Bereich [0.0, 1.0] zugeschnitten wurde.",
    "en-US": "The same as the specified value after clipping the {{cssxref(\"number\")}} to the range [0.0, 1.0].",
    "fr": "La même que la valeur définie après avoir écrêté {{cssxref(\"number\")}} dans l'intervalle [0.0, 1.0].",
    "ja": "指定値の {{cssxref(\"number\")}} が [0.0, 1.0] の範囲内にクリップされたものと同じ",
    "ru": "Тоже, что и указанное значение, после обрезки {{cssxref(\"number\")}} до диапозона [0.0, 1.0]."
  },
  "startOrNamelessValueIfLTRRightIfRTL": {
    "de": "<code>start</code> oder ein namenloser Wert, der sich wie <code>left</code> verhält, falls {{cssxref(\"direction\")}} den Wert <code>ltr</code> hat, <code>right</code>, falls {{cssxref(\"direction\")}} den Wert <code>rtl</code> hat, falls <code>start</code> nicht vom Browser unterstützt wird.",
    "en-US": "<code>start</code>, or a nameless value that acts as <code>left</code> if {{cssxref(\"direction\")}} is <code>ltr</code>, <code>right</code> if {{cssxref(\"direction\")}} is <code>rtl</code> if <code>start</code> is not supported by the browser.",
    "fr": "<code>start</code>, ou une valeur non nommée se comportant comme <code>left</code> si {{cssxref(\"direction\")}} est <code>ltr</code>, <code>right</code> si {{cssxref(\"direction\")}} est <code>rtl</code> si <code>start</code> n'est pas supporté par le navigateur",
    "ja": "<code>start</code>。<code>start</code> に対応していないブラウザーでは、{{cssxref(\"direction\", \"書字方向\")}}が <code>ltr</code> なら <code>left</code>、<code>rtl</code> なら <code>right</code> として動作する無名の値",
    "ru": "<code>start</code>, или неназванное значение, которое действует как <code>left</code>, если {{cssxref(\"direction\")}}: <code>ltr</code> или как <code>right</code>, если {{cssxref(\"direction\")}}: <code>rtl</code>, а если <code>start</code> не поддерживается браузером."
  },
  "superellipseInterpolation": {
    "en-US": "Animates as per <a href=\"https://drafts.csswg.org/css-borders/#superellipse-interpolation\">superellipse interpolation</a>.",
    "fr": "Animé selon <a href=\"https://drafts.csswg.org/css-borders/#superellipse-interpolation\">l'interpolation de superellipse <sup>(angl.)</sup></a>."
  },
  "tableCaptionElements": {
    "de": "table-caption Elemente",
    "en-US": "table-caption elements",
    "fr": "éléments qui sont des légendes de tableaux",
    "ja": "表のキャプション要素",
    "ru": "заголовки таблиц",
    "zh-CN": "表格标题元素",
    "zh-TW": "表格標題元素"
  },
  "tableCellElements": {
    "de": "table-cell Elemente",
    "en-US": "table-cell elements",
    "fr": "éléments qui sont des cellules de tableau",
    "ja": "表のセル要素",
    "ru": "ячейки таблицы",
    "zh-CN": "表格单元格元素",
    "zh-TW": "表格儲存格元素"
  },
  "tableElements": {
    "de": "<code>table</code>- und <code>inline-table</code>-Elemente",
    "en-US": "<code>table</code> and <code>inline-table</code> elements",
    "fr": "des éléments <code>table</code> et <code>inline-table</code>",
    "ja": "<code>table</code> および <code>inline-table</code> 要素",
    "ru": "<code>table</code> и <code>inline-table</code> элементы",
    "zh-CN": "<code>table</code> 和 <code>inline-table</code> 元素",
    "zh-TW": "<code>table</code> 和 <code>inline-table</code> 元素"
  },
  "textAndBlockContainers": {
    "en-US": "text and block containers",
    "fr": "conteneurs de texte et de bloc",
    "zh-CN": "文本和区块容器",
    "zh-TW": "文字和區塊容器"
  },
  "textAndSVGShapes": {
    "en-US": "text and SVG shapes",
    "fr": "texte et formes SVG"
  },
  "textElements": {
    "de": "Textelemente",
    "en-US": "text elements",
    "fr": "éléments textes",
    "ja": "テキスト要素",
    "ru": "текстовые элементы",
    "zh-CN": "文本元素",
    "zh-TW": "文字元素"
  },
  "textOrElementsThatAcceptInput": {
    "en-US": "Text or elements that accept text input",
    "fr": "Texte ou éléments qui acceptent une entrée de texte"
  },
  "textFields": {
    "de": "Textfelder",
    "en-US": "text fields",
    "fr": "champs de texte",
    "ja": "テキストフィールド",
    "ru": "текстовые поля",
    "zh-CN": "文本字段",
    "zh-TW": "文字欄位"
  },
  "theComputedLengthAndVisualBox": {
    "en-US": "the computed &lt;length&gt; and a &lt;visual-box&gt; keyword",
    "fr": "la longueur (&lt;length&gt;) calculée et un mot-clé de type &lt;visual-box&gt;",
    "zh-TW": "計算後的 &lt;length&gt; 和 &lt;visual-box&gt; 關鍵字"
  },
  "theKeywordListStyleImageNoneOrComputedValue": {
    "en-US": "The keyword <code>none</code> or the computed &lt;image&gt;",
    "fr": "Le mot-clé <code>none</code> ou l'&lt;image&gt; calculée",
    "zh-TW": "關鍵字 <code>none</code> 或計算後的 &lt;image&gt;"
  },
  "theSpecifiedKeyword": {
    "en-US": "the specified keyword",
    "fr": "le mot-clé défini"
  },
  "theSpecifiedKeywordOrAComputedLengthPercentageValue": {
    "en-US": "the specified keyword or a computed <length-percentage> value",
    "fr": "le mot-clé défini ou une valeur calculée de type &lt;length-percentage&gt;"
  },
  "transform": {
    "de": "Transformation",
    "en-US": "a transform",
    "fr": "une transformation",
    "ja": "座標変換",
    "ru": "трансформация",
    "zh-TW": "變形"
  },
  "transformableElements": {
    "de": "transformierbare Elemente",
    "en-US": "transformable elements",
    "fr": "éléments transformables",
    "ja": "座標変換可能要素",
    "pt-BR": "qualquer elemento transformavel",
    "ru": "трансформируемые элементы",
    "zh-CN": "可变换元素",
    "zh-TW": "可變形元素"
  },
  "translucentValuesRGBAOtherwiseRGB": {
    "de": "Falls der Wert durchscheinend ist, ist der berechnete Wert der entsprechende <code>rgba()</code> Wert. Falls nicht, ist er der entsprechende <code>rgb()</code> Wert. Das <code>transparent</code> Schlüsselwort wird zu <code>rgb(0,0,0)</code>.",
    "en-US": "If the value is translucent, the computed value will be the <code>rgba()</code> corresponding one. If it isn't, it will be the <code>rgb()</code> corresponding one. The <code>transparent</code> keyword maps to <code>rgba(0,0,0,0)</code>.",
    "fr": "si la valeur est translucide, la valeur calculée est la fonction <code>rgba()</code>correspondante. Sinon, la fonction <code>rgb()</code>correspondante. Le mot-clé <code>transparent</code> devient <code>rgb(0,0,0)</code>.",
    "ja": "半透明の値なら、計算値はそれに対応する <code>rgba()</code>。さもなくばその値に対応する <code>rgb()</code>。<code>transparent</code> キーワードは <code>rgba(0,0,0,0)</code> にマップされる。",
    "ru": "Если значение полупрозрачно, значение будет соответствовать <code>rgba()</code>. А если не будет полупрозрачным, то будет использоваться <code>rgb()</code>. Ключевое слово <code>transparent</code> интерпретируется в <code>rgba(0,0,0,0)</code>."
  },
  "twoAbsoluteLengthOrPercentages": {
    "de": "zwei absolute {{cssxref(\"length\")}} oder {{cssxref(\"percentage\")}}",
    "en-US": "two absolute {{cssxref(\"length\")}}s or {{cssxref(\"percentage\")}}s",
    "fr": "deux longueurs ({{cssxref(\"length\")}}) absolues ou deux pourcentages ({{cssxref(\"percentage\")}})",
    "ja": "２つの絶対的な {{cssxref(\"length\")}} または {{cssxref(\"percentage\")}} 値",
    "ru": "две абсолютных {{cssxref(\"length\")}} или {{cssxref(\"percentage\")}}",
    "zh-TW": "兩個絕對 {{cssxref(\"length\")}} 或 {{cssxref(\"percentage\")}}"
  },
  "twoAbsoluteLengths": {
    "de": "zwei absolute Längen",
    "en-US": "two absolute lengths",
    "fr": "deux longueurs absolues",
    "ja": "２つの絶対的な長さ",
    "ru": "две абсолютные длины",
    "zh-CN": "两个绝对长度",
    "zh-TW": "兩個絕對長度"
  },
  "uniqueOrder": {
    "de": "die eindeutige Reihenfolge definiert durch die formale Grammatik",
    "en-US": "the unique non-ambiguous order defined by the formal grammar",
    "es": "el orden único no-ambigüo definido por la gramática formal",
    "fr": "l'ordre unique et non-ambigu défini par la grammaire formelle",
    "ja": "形式文法で定義されている一意のあいまいでない順序",
    "ru": "уникальный неоднозначный порядок, определённый формальной грамматикой"
  },
  "variesFromBrowserToBrowser": {
    "de": "Variiert von einem Browser zum anderen",
    "en-US": "Varies from one browser to another",
    "fr": "Varie d'un navigateur à l'autre",
    "ja": "ブラウザーによって異なる",
    "ru": "Варьируется от браузера к браузеру",
    "zh-TW": "因瀏覽器而異"
  },
  "visibility": {
    "de": "<a href=\"/de/docs/Web/CSS/Reference/Properties/visibility#interpolation\">Sichtbarkeit</a>",
    "en-US": "a <a href=\"/en-US/docs/Web/CSS/Reference/Properties/visibility#interpolation\" title=\"Values of the visibility CSS property are interpolable if the start or the end value is visible. In that case all values of the timing function which are equal to 1 map to visible and non-equal to 1 to non-visible.\">visibility</a>",
    "fr": "une <a href=\"/fr/docs/Web/CSS/Reference/Properties/visibility#interpolation\" title=\"Les valeurs de la propriété CSS visibility sont interpolables si une des valeurs de début ou de fin est visible. Dans ce cas, toutes les valeurs de la fonction de temporisation qui sont égales à 1 sont associées à visible, et celles non égales à 1, à non-visible.\">visibilité</a>",
    "ja": "<a href=\"/en-US/docs/Web/CSS/Reference/Properties/visibility#interpolation\" title=\"CSS の visibility プロパティの値は、開始値または終了値が visible の場合に補間可能である。その場合、タイミング関数の 1 に等しい値がすべて可視に、1 に等しくない値が不可視に対応づけられる。\">visibility</a>",
    "ru": "<a href=\"/ru/docs/Web/CSS/Reference/Properties/visibility#interpolation\" title=\"Значения свойства CSS visibility интерполируются, если начальное или конечное значение установлено в visible. В этом случае все значения временной функции, равные 1 отображаются, а не равные 1 не отображаются.\">видимость</a>"
  },
  "visual": {
    "de": "visuell",
    "en-US": "visual",
    "fr": "visuel",
    "ja": "視覚",
    "ru": "визуальный",
    "zh-CN": "视觉",
    "zh-TW": "視覺"
  },
  "visualInContinuousMediaNoEffectInOverflowColumns": {
    "de": "<code>visual</code>, aber in kontinuierlichen Medien hat sie keinen Effekt in überlaufenden Spalten",
    "en-US": "<code>visual</code>, but, in continuous media, has no effect in overflow columns",
    "fr": "<code>visual</code>, mais n'a pas d'effet sur le débordement des colonnes pour un média continu",
    "ja": "<code>visual</code>。ただし連続メディアではオーバーフローした列に効果なし",
    "ru": "<code>visual</code>, но в сплошной среде, не имеет никакого эффекта при переполнении колонок",
    "zh-CN": "<code>visual</code>，但在连续媒体中，对溢出的列没有影响"
  },
  "yes": {
    "de": "Ja",
    "en-US": "yes",
    "fr": "oui",
    "ja": "あり",
    "pl": "tak",
    "ru": "да",
    "zh-CN": "是",
    "zh-TW": "是"
  },
  "zoomForTheTopLevelNoneForTheRest": {
    "en-US": "zoom for the top level element, none for all other elements",
    "fr": "<code>zoom</code> pour l'élément de niveau supérieur, <code>none</code> pour tous les autres éléments",
    "ja": "最上位要素では zoom、その他の要素では none",
    "zh-CN": "顶层元素为 zoom，所有其他元素为 none",
    "zh-TW": "最上層元素為 zoom，所有其他元素為 none"
  }
}
[Ϻx. module.exports = {
  css: require('./css'),
}
w/x{
  "name": "mdn-data",
  "version": "2.29.0",
  "description": "Open Web data by the Mozilla Developer Network",
  "main": "index.js",
  "files": [
    "api/index.js",
    "api/*.json",
    "css/index.js",
    "css/*.json",
    "l10n/index.js",
    "l10n/*.json"
  ],
  "repository": {
    "type": "git",
    "url": "https://github.com/mdn/data.git"
  },
  "keywords": [
    "data",
    "mdn",
    "mozilla",
    "css"
  ],
  "author": "Mozilla Developer Network",
  "license": "CC0-1.0",
  "bugs": {
    "url": "https://github.com/mdn/data/issues"
  },
  "homepage": "https://developer.mozilla.org",
  "devDependencies": {
    "ajv": "^7.2.4",
    "better-ajv-errors": "^2.0.2"
  },
  "scripts": {
    "lint": "node test/lint",
    "test": "npm run lint"
  }
}
T׈x 40000 dev Oc]՛$H|+(100644 index.d.ts /f\^f3W>100644 index.d.ts.map z} v̇-@&]100644 index.js (clL̅΢pGG40000 lib +eRaca0'K100644 license Zbv8f,Q)100644 package.json 7<RPA(oLٺC100644 readme.md \ȷD:OᅞGq	x m100644 index.d.ts /f\^f3W>100644 index.d.ts.map z} v̇-@&]100644 index.js >	7
A^+)~40000 lib @zpO8wlY$CP8Jx\export { attention } from "./lib/attention.js";
export { autolink } from "./lib/autolink.js";
export { blankLine } from "./lib/blank-line.js";
export { blockQuote } from "./lib/block-quote.js";
export { characterEscape } from "./lib/character-escape.js";
export { characterReference } from "./lib/character-reference.js";
export { codeFenced } from "./lib/code-fenced.js";
export { codeIndented } from "./lib/code-indented.js";
export { codeText } from "./lib/code-text.js";
export { content } from "./lib/content.js";
export { definition } from "./lib/definition.js";
export { hardBreakEscape } from "./lib/hard-break-escape.js";
export { headingAtx } from "./lib/heading-atx.js";
export { htmlFlow } from "./lib/html-flow.js";
export { htmlText } from "./lib/html-text.js";
export { labelEnd } from "./lib/label-end.js";
export { labelStartImage } from "./lib/label-start-image.js";
export { labelStartLink } from "./lib/label-start-link.js";
export { lineEnding } from "./lib/line-ending.js";
export { list } from "./lib/list.js";
export { setextUnderline } from "./lib/setext-underline.js";
export { thematicBreak } from "./lib/thematic-break.js";
//# sourceMappingURL=index.d.ts.map>I	x b{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;GAkBG;AACH,2CALW,MAAM,GAEJ,MAAM,CAmBlB"}I/h*x a_"}PCx>export {attention} from './lib/attention.js'
export {autolink} from './lib/autolink.js'
export {blankLine} from './lib/blank-line.js'
export {blockQuote} from './lib/block-quote.js'
export {characterEscape} from './lib/character-escape.js'
export {characterReference} from './lib/character-reference.js'
export {codeFenced} from './lib/code-fenced.js'
export {codeIndented} from './lib/code-indented.js'
export {codeText} from './lib/code-text.js'
export {content} from './lib/content.js'
export {definition} from './lib/definition.js'
export {hardBreakEscape} from './lib/hard-break-escape.js'
export {headingAtx} from './lib/heading-atx.js'
export {htmlFlow} from './lib/html-flow.js'
export {htmlText} from './lib/html-text.js'
export {labelEnd} from './lib/label-end.js'
export {labelStartImage} from './lib/label-start-image.js'
export {labelStartLink} from './lib/label-start-link.js'
export {lineEnding} from './lib/line-ending.js'
export {list} from './lib/list.js'
export {setextUnderline} from './lib/setext-underline.js'
export {thematicBreak} from './lib/thematic-break.js'
C:xQ100644 attention.d.ts GTrVGIV2qm100644 attention.d.ts.map fkv/cd}100644 attention.js nyH+NY[100644 autolink.d.ts Wi<C'Vmy;S100644 autolink.d.ts.map {rK`iP100644 autolink.js QFj|_?k100644 blank-line.d.ts zY(}l[D100644 blank-line.d.ts.map #nh4x6{'<100644 blank-line.js ۜHs?|h͜=VLDC100644 block-quote.d.ts 39U㡢\100644 block-quote.d.ts.map  2	;;shn100644 block-quote.js Ee.j@N*Ҵ100644 character-escape.d.ts U_4>:ψp>c3100644 character-escape.d.ts.map VH]@P/;100644 character-escape.js Ϫ6OdShp.100644 character-reference.d.ts UO6T100644 character-reference.d.ts.map S}_gb4QrQ6W100644 character-reference.js 	רNXo{N100644 code-fenced.d.ts m_S 	;~*+<HCJM100644 code-fenced.d.ts.map -B`QiӎE@6P100644 code-fenced.js m}lyV*H{100644 code-indented.d.ts <Wls>`R_100644 code-indented.d.ts.map 	9Y.eNҳw6*100644 code-indented.js n|Xr8fe`100644 code-text.d.ts G M/6100644 code-text.d.ts.map U	p41c1100644 code-text.js @}$,U߀100644 content.d.ts 7a!V"100644 content.d.ts.map ptP8NX`100644 content.js MBEXƇ)Pr;G'BUl100644 definition.d.ts i0Yo(H*J100644 definition.d.ts.map Fm:E4km2l]C100644 definition.js YcE}c/P3100644 hard-break-escape.d.ts 2N*@aBvXe100644 hard-break-escape.d.ts.map 7Sc&nBVt100644 hard-break-escape.js }בAQCg$ۏ0vμ=100644 heading-atx.d.ts SyN~}\100644 heading-atx.d.ts.map ,2C?K100644 heading-atx.js tN0/xs*@y*
100644 html-flow.d.ts p	,%'Cĺ100644 html-flow.d.ts.map #3hO*a100644 html-flow.js %M2\5TYˀr1100644 html-text.d.ts AX߽u/F100644 html-text.d.ts.map ԊEvkmzDxb)100644 html-text.js 8ay&^`QGi`100644 label-end.d.ts Ȓۂ:)b72zG100644 label-end.d.ts.map =cHf+[
Ɩ100644 label-end.js I'VN}Bi.E~m|100644 label-start-image.d.ts 
<isd'WXj}100644 label-start-image.d.ts.map tSv۱j.+100644 label-start-image.js DH̝X-ѡR3#100644 label-start-link.d.ts \?ܯ1ŜE'-J100644 label-start-link.d.ts.map B_7%2ӛ100644 label-start-link.js )51`WX1100644 line-ending.d.ts >Odra^100644 line-ending.d.ts.map "dZw8|100644 line-ending.js 3s5.3LH100644 list.d.ts )S)u]y\Xy100644 list.d.ts.map 1d,xl%;100644 list.js UgCANX;Ĳ100644 setext-underline.d.ts 4Oed8fӠX:!100644 setext-underline.d.ts.map )o|h1p	K}100644 setext-underline.js y`gyr)100644 thematic-break.d.ts Q|enpepWĬ100644 thematic-break.d.ts.map 
eyhnݰgU+닥100644 thematic-break.js 5]ّ֯(qbwl(ۤ`	x e/** @type {Construct} */
export const attention: Construct;
import type { Construct } from 'micromark-util-types';
//# sourceMappingURL=attention.d.ts.map7	x f{"version":3,"file":"attention.d.ts","sourceRoot":"","sources":["attention.js"],"names":[],"mappings":"AAoBA,wBAAwB;AACxB,wBADW,SAAS,CAKnB;+BAdS,sBAAsB"}A0xf/**
 * @import {
 *   Code,
 *   Construct,
 *   Event,
 *   Point,
 *   Resolver,
 *   State,
 *   TokenizeContext,
 *   Tokenizer,
 *   Token
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {push, splice} from 'micromark-util-chunked'
import {classifyCharacter} from 'micromark-util-classify-character'
import {resolveAll} from 'micromark-util-resolve-all'
import {codes, constants, types} from 'micromark-util-symbol'

/** @type {Construct} */
export const attention = {
  name: 'attention',
  resolveAll: resolveAllAttention,
  tokenize: tokenizeAttention
}

/**
 * Take all events and resolve attention to emphasis or strong.
 *
 * @type {Resolver}
 */
// eslint-disable-next-line complexity
function resolveAllAttention(events, context) {
  let index = -1
  /** @type {number} */
  let open
  /** @type {Token} */
  let group
  /** @type {Token} */
  let text
  /** @type {Token} */
  let openingSequence
  /** @type {Token} */
  let closingSequence
  /** @type {number} */
  let use
  /** @type {Array<Event>} */
  let nextEvents
  /** @type {number} */
  let offset

  // Walk through all events.
  //
  // Note: performance of this is fine on an mb of normal markdown, but it’s
  // a bottleneck for malicious stuff.
  while (++index < events.length) {
    // Find a token that can close.
    if (
      events[index][0] === 'enter' &&
      events[index][1].type === 'attentionSequence' &&
      events[index][1]._close
    ) {
      open = index

      // Now walk back to find an opener.
      while (open--) {
        // Find a token that can open the closer.
        if (
          events[open][0] === 'exit' &&
          events[open][1].type === 'attentionSequence' &&
          events[open][1]._open &&
          // If the markers are the same:
          context.sliceSerialize(events[open][1]).charCodeAt(0) ===
            context.sliceSerialize(events[index][1]).charCodeAt(0)
        ) {
          // If the opening can close or the closing can open,
          // and the close size *is not* a multiple of three,
          // but the sum of the opening and closing size *is* multiple of three,
          // then don’t match.
          if (
            (events[open][1]._close || events[index][1]._open) &&
            (events[index][1].end.offset - events[index][1].start.offset) % 3 &&
            !(
              (events[open][1].end.offset -
                events[open][1].start.offset +
                events[index][1].end.offset -
                events[index][1].start.offset) %
              3
            )
          ) {
            continue
          }

          // Number of markers to use from the sequence.
          use =
            events[open][1].end.offset - events[open][1].start.offset > 1 &&
            events[index][1].end.offset - events[index][1].start.offset > 1
              ? 2
              : 1

          const start = {...events[open][1].end}
          const end = {...events[index][1].start}
          movePoint(start, -use)
          movePoint(end, use)

          openingSequence = {
            type: use > 1 ? types.strongSequence : types.emphasisSequence,
            start,
            end: {...events[open][1].end}
          }
          closingSequence = {
            type: use > 1 ? types.strongSequence : types.emphasisSequence,
            start: {...events[index][1].start},
            end
          }
          text = {
            type: use > 1 ? types.strongText : types.emphasisText,
            start: {...events[open][1].end},
            end: {...events[index][1].start}
          }
          group = {
            type: use > 1 ? types.strong : types.emphasis,
            start: {...openingSequence.start},
            end: {...closingSequence.end}
          }

          events[open][1].end = {...openingSequence.start}
          events[index][1].start = {...closingSequence.end}

          nextEvents = []

          // If there are more markers in the opening, add them before.
          if (events[open][1].end.offset - events[open][1].start.offset) {
            nextEvents = push(nextEvents, [
              ['enter', events[open][1], context],
              ['exit', events[open][1], context]
            ])
          }

          // Opening.
          nextEvents = push(nextEvents, [
            ['enter', group, context],
            ['enter', openingSequence, context],
            ['exit', openingSequence, context],
            ['enter', text, context]
          ])

          // Always populated by defaults.
          assert(
            context.parser.constructs.insideSpan.null,
            'expected `insideSpan` to be populated'
          )

          // Between.
          nextEvents = push(
            nextEvents,
            resolveAll(
              context.parser.constructs.insideSpan.null,
              events.slice(open + 1, index),
              context
            )
          )

          // Closing.
          nextEvents = push(nextEvents, [
            ['exit', text, context],
            ['enter', closingSequence, context],
            ['exit', closingSequence, context],
            ['exit', group, context]
          ])

          // If there are more markers in the closing, add them after.
          if (events[index][1].end.offset - events[index][1].start.offset) {
            offset = 2
            nextEvents = push(nextEvents, [
              ['enter', events[index][1], context],
              ['exit', events[index][1], context]
            ])
          } else {
            offset = 0
          }

          splice(events, open - 1, index - open + 3, nextEvents)

          index = open + nextEvents.length - offset - 2
          break
        }
      }
    }
  }

  // Remove remaining sequences.
  index = -1

  while (++index < events.length) {
    if (events[index][1].type === 'attentionSequence') {
      events[index][1].type = 'data'
    }
  }

  return events
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeAttention(effects, ok) {
  const attentionMarkers = this.parser.constructs.attentionMarkers.null
  const previous = this.previous
  const before = classifyCharacter(previous)

  /** @type {NonNullable<Code>} */
  let marker

  return start

  /**
   * Before a sequence.
   *
   * ```markdown
   * > | **
   *     ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    assert(
      code === codes.asterisk || code === codes.underscore,
      'expected asterisk or underscore'
    )
    marker = code
    effects.enter('attentionSequence')
    return inside(code)
  }

  /**
   * In a sequence.
   *
   * ```markdown
   * > | **
   *     ^^
   * ```
   *
   * @type {State}
   */
  function inside(code) {
    if (code === marker) {
      effects.consume(code)
      return inside
    }

    const token = effects.exit('attentionSequence')

    // To do: next major: move this to resolver, just like `markdown-rs`.
    const after = classifyCharacter(code)

    // Always populated by defaults.
    assert(attentionMarkers, 'expected `attentionMarkers` to be populated')

    const open =
      !after ||
      (after === constants.characterGroupPunctuation && before) ||
      attentionMarkers.includes(code)
    const close =
      !before ||
      (before === constants.characterGroupPunctuation && after) ||
      attentionMarkers.includes(previous)

    token._open = Boolean(
      marker === codes.asterisk ? open : open && (before || !close)
    )
    token._close = Boolean(
      marker === codes.asterisk ? close : close && (after || !open)
    )
    return ok(code)
  }
}

/**
 * Move a point a bit.
 *
 * Note: `move` only works inside lines! It’s not possible to move past other
 * chunks (replacement characters, tabs, or line endings).
 *
 * @param {Point} point
 *   Point.
 * @param {number} offset
 *   Amount to move.
 * @returns {undefined}
 *   Nothing.
 */
function movePoint(point, offset) {
  point.column += offset
  point.offset += offset
  point._bufferIndex += offset
}
x^	x g/** @type {Construct} */
export const autolink: Construct;
import type { Construct } from 'micromark-util-types';
//# sourceMappingURL=autolink.d.ts.map:6	x g{"version":3,"file":"autolink.d.ts","sourceRoot":"","sources":["autolink.js"],"names":[],"mappings":"AAkBA,wBAAwB;AACxB,uBADW,SAAS,CACkD;+BAb5D,sBAAsB"}0)x6/**
 * @import {
 *   Construct,
 *   State,
 *   TokenizeContext,
 *   Tokenizer
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {
  asciiAlphanumeric,
  asciiAlpha,
  asciiAtext,
  asciiControl
} from 'micromark-util-character'
import {codes, constants, types} from 'micromark-util-symbol'

/** @type {Construct} */
export const autolink = {name: 'autolink', tokenize: tokenizeAutolink}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeAutolink(effects, ok, nok) {
  let size = 0

  return start

  /**
   * Start of an autolink.
   *
   * ```markdown
   * > | a<https://example.com>b
   *      ^
   * > | a<user@example.com>b
   *      ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    assert(code === codes.lessThan, 'expected `<`')
    effects.enter(types.autolink)
    effects.enter(types.autolinkMarker)
    effects.consume(code)
    effects.exit(types.autolinkMarker)
    effects.enter(types.autolinkProtocol)
    return open
  }

  /**
   * After `<`, at protocol or atext.
   *
   * ```markdown
   * > | a<https://example.com>b
   *       ^
   * > | a<user@example.com>b
   *       ^
   * ```
   *
   * @type {State}
   */
  function open(code) {
    if (asciiAlpha(code)) {
      effects.consume(code)
      return schemeOrEmailAtext
    }

    if (code === codes.atSign) {
      return nok(code)
    }

    return emailAtext(code)
  }

  /**
   * At second byte of protocol or atext.
   *
   * ```markdown
   * > | a<https://example.com>b
   *        ^
   * > | a<user@example.com>b
   *        ^
   * ```
   *
   * @type {State}
   */
  function schemeOrEmailAtext(code) {
    // ASCII alphanumeric and `+`, `-`, and `.`.
    if (
      code === codes.plusSign ||
      code === codes.dash ||
      code === codes.dot ||
      asciiAlphanumeric(code)
    ) {
      // Count the previous alphabetical from `open` too.
      size = 1
      return schemeInsideOrEmailAtext(code)
    }

    return emailAtext(code)
  }

  /**
   * In ambiguous protocol or atext.
   *
   * ```markdown
   * > | a<https://example.com>b
   *        ^
   * > | a<user@example.com>b
   *        ^
   * ```
   *
   * @type {State}
   */
  function schemeInsideOrEmailAtext(code) {
    if (code === codes.colon) {
      effects.consume(code)
      size = 0
      return urlInside
    }

    // ASCII alphanumeric and `+`, `-`, and `.`.
    if (
      (code === codes.plusSign ||
        code === codes.dash ||
        code === codes.dot ||
        asciiAlphanumeric(code)) &&
      size++ < constants.autolinkSchemeSizeMax
    ) {
      effects.consume(code)
      return schemeInsideOrEmailAtext
    }

    size = 0
    return emailAtext(code)
  }

  /**
   * After protocol, in URL.
   *
   * ```markdown
   * > | a<https://example.com>b
   *             ^
   * ```
   *
   * @type {State}
   */
  function urlInside(code) {
    if (code === codes.greaterThan) {
      effects.exit(types.autolinkProtocol)
      effects.enter(types.autolinkMarker)
      effects.consume(code)
      effects.exit(types.autolinkMarker)
      effects.exit(types.autolink)
      return ok
    }

    // ASCII control, space, or `<`.
    if (
      code === codes.eof ||
      code === codes.space ||
      code === codes.lessThan ||
      asciiControl(code)
    ) {
      return nok(code)
    }

    effects.consume(code)
    return urlInside
  }

  /**
   * In email atext.
   *
   * ```markdown
   * > | a<user.name@example.com>b
   *              ^
   * ```
   *
   * @type {State}
   */
  function emailAtext(code) {
    if (code === codes.atSign) {
      effects.consume(code)
      return emailAtSignOrDot
    }

    if (asciiAtext(code)) {
      effects.consume(code)
      return emailAtext
    }

    return nok(code)
  }

  /**
   * In label, after at-sign or dot.
   *
   * ```markdown
   * > | a<user.name@example.com>b
   *                 ^       ^
   * ```
   *
   * @type {State}
   */
  function emailAtSignOrDot(code) {
    return asciiAlphanumeric(code) ? emailLabel(code) : nok(code)
  }

  /**
   * In label, where `.` and `>` are allowed.
   *
   * ```markdown
   * > | a<user.name@example.com>b
   *                   ^
   * ```
   *
   * @type {State}
   */
  function emailLabel(code) {
    if (code === codes.dot) {
      effects.consume(code)
      size = 0
      return emailAtSignOrDot
    }

    if (code === codes.greaterThan) {
      // Exit, then change the token type.
      effects.exit(types.autolinkProtocol).type = types.autolinkEmail
      effects.enter(types.autolinkMarker)
      effects.consume(code)
      effects.exit(types.autolinkMarker)
      effects.exit(types.autolink)
      return ok
    }

    return emailValue(code)
  }

  /**
   * In label, where `.` and `>` are *not* allowed.
   *
   * Though, this is also used in `emailLabel` to parse other values.
   *
   * ```markdown
   * > | a<user.name@ex-ample.com>b
   *                    ^
   * ```
   *
   * @type {State}
   */
  function emailValue(code) {
    // ASCII alphanumeric or `-`.
    if (
      (code === codes.dash || asciiAlphanumeric(code)) &&
      size++ < constants.autolinkDomainSizeMax
    ) {
      const next = code === codes.dash ? emailValue : emailLabel
      effects.consume(code)
      return next
    }

    return nok(code)
  }
}
$
x X/** @type {Construct} */
export const characterEscape: Construct;
import type { Construct } from 'micromark-util-types';
//# sourceMappingURL=character-escape.d.ts.map<04x& &blankLin4Zblank-line.d.ts.mapP	x d{"version":3,"file":"blank-line.d.ts","sourceRoot":"","sources":["blank-line.js"],"names":[],"mappings":"AAaA,wBAAwB;AACxB,wBADW,SAAS,CACiD;+BAR3D,sBAAsB"}cS0Lx8/**
 * @import {
 *   Construct,
 *   State,
 *   TokenizeContext,
 *   Tokenizer
 * } from 'micromark-util-types'
 */

import {factorySpace} from 'micromark-factory-space'
import {markdownLineEnding, markdownSpace} from 'micromark-util-character'
import {codes, types} from 'micromark-util-symbol'

/** @type {Construct} */
export const blankLine = {partial: true, tokenize: tokenizeBlankLine}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeBlankLine(effects, ok, nok) {
  return start

  /**
   * Start of blank line.
   *
   * > 👉 **Note**: `␠` represents a space character.
   *
   * ```markdown
   * > | ␠␠␊
   *     ^
   * > | ␊
   *     ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    return markdownSpace(code)
      ? factorySpace(effects, after, types.linePrefix)(code)
      : after(code)
  }

  /**
   * At eof/eol, after optional whitespace.
   *
   * > 👉 **Note**: `␠` represents a space character.
   *
   * ```markdown
   * > | ␠␠␊
   *       ^
   * > | ␊
   *     ^
   * ```
   *
   * @type {State}
   */
  function after(code) {
    return code === codes.eof || markdownLineEnding(code) ? ok(code) : nok(code)
  }
}
-n	x b/** @type {Construct} */
export const blockQuote: Construct;
import type { Construct } from 'micromark-util-types';
//# sourceMappingURL=block-quote.d.ts.mapLC8f	x c{"version":3,"file":"block-quote.d.ts","sourceRoot":"","sources":["block-quote.js"],"names":[],"mappings":"AAeA,wBAAwB;AACxB,yBADW,SAAS,CAMnB;+BAdS,sBAAsB"}1ʰx /**
 * @import {
 *   Construct,
 *   Exiter,
 *   State,
 *   TokenizeContext,
 *   Tokenizer
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {factorySpace} from 'micromark-factory-space'
import {markdownSpace} from 'micromark-util-character'
import {codes, constants, types} from 'micromark-util-symbol'

/** @type {Construct} */
export const blockQuote = {
  continuation: {tokenize: tokenizeBlockQuoteContinuation},
  exit,
  name: 'blockQuote',
  tokenize: tokenizeBlockQuoteStart
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeBlockQuoteStart(effects, ok, nok) {
  const self = this

  return start

  /**
   * Start of block quote.
   *
   * ```markdown
   * > | > a
   *     ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    if (code === codes.greaterThan) {
      const state = self.containerState

      assert(state, 'expected `containerState` to be defined in container')

      if (!state.open) {
        effects.enter(types.blockQuote, {_container: true})
        state.open = true
      }

      effects.enter(types.blockQuotePrefix)
      effects.enter(types.blockQuoteMarker)
      effects.consume(code)
      effects.exit(types.blockQuoteMarker)
      return after
    }

    return nok(code)
  }

  /**
   * After `>`, before optional whitespace.
   *
   * ```markdown
   * > | > a
   *      ^
   * ```
   *
   * @type {State}
   */
  function after(code) {
    if (markdownSpace(code)) {
      effects.enter(types.blockQuotePrefixWhitespace)
      effects.consume(code)
      effects.exit(types.blockQuotePrefixWhitespace)
      effects.exit(types.blockQuotePrefix)
      return ok
    }

    effects.exit(types.blockQuotePrefix)
    return ok(code)
  }
}

/**
 * Start of block quote continuation.
 *
 * ```markdown
 *   | > a
 * > | > b
 *     ^
 * ```
 *
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeBlockQuoteContinuation(effects, ok, nok) {
  const self = this

  return contStart

  /**
   * Start of block quote continuation.
   *
   * Also used to parse the first block quote opening.
   *
   * ```markdown
   *   | > a
   * > | > b
   *     ^
   * ```
   *
   * @type {State}
   */
  function contStart(code) {
    if (markdownSpace(code)) {
      // Always populated by defaults.
      assert(
        self.parser.constructs.disable.null,
        'expected `disable.null` to be populated'
      )

      return factorySpace(
        effects,
        contBefore,
        types.linePrefix,
        self.parser.constructs.disable.null.includes('codeIndented')
          ? undefined
          : constants.tabSize
      )(code)
    }

    return contBefore(code)
  }

  /**
   * At `>`, after optional whitespace.
   *
   * Also used to parse the first block quote opening.
   *
   * ```markdown
   *   | > a
   * > | > b
   *     ^
   * ```
   *
   * @type {State}
   */
  function contBefore(code) {
    return effects.attempt(blockQuote, ok, nok)(code)
  }
}

/** @type {Exiter} */
function exit(effects) {
  effects.exit(types.blockQuote)
}

w
x W{"version":3,"file":"hard-break-escape.d.ts","sourceRoot":"","sources":["hard-break-escape.js"],"names":[],"mappings":"AAaA,wBAAwB;AACxB,8BADW,SAAS,CAInB;+BAXS,sBAAsB"}Q55x  	character*	characterSUuRx-/**
 * @import {
 *   Construct,
 *   State,
 *   TokenizeContext,
 *   Tokenizer
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {asciiPunctuation} from 'micromark-util-character'
import {codes, types} from 'micromark-util-symbol'

/** @type {Construct} */
export const characterEscape = {
  name: 'characterEscape',
  tokenize: tokenizeCharacterEscape
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeCharacterEscape(effects, ok, nok) {
  return start

  /**
   * Start of character escape.
   *
   * ```markdown
   * > | a\*b
   *      ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    assert(code === codes.backslash, 'expected `\\`')
    effects.enter(types.characterEscape)
    effects.enter(types.escapeMarker)
    effects.consume(code)
    effects.exit(types.escapeMarker)
    return inside
  }

  /**
   * After `\`, at punctuation.
   *
   * ```markdown
   * > | a\*b
   *       ^
   * ```
   *
   * @type {State}
   */
  function inside(code) {
    // ASCII punctuation.
    if (asciiPunctuation(code)) {
      effects.enter(types.characterEscapeValue)
      effects.consume(code)
      effects.exit(types.characterEscapeValue)
      effects.exit(types.characterEscape)
      return ok
    }

    return nok(code)
  }
}
&
x R/** @type {Construct} */
export const characterReference: Construct;
import type { Construct } from 'micromark-util-types';
//# sourceMappingURL=character-reference.d.ts.map'>x> 6Y21mBA,wBAAwB;AACxB,iCADW,SAAS,CAInB;+BAhBS,sBAAsB"}Q^Xx_/**
 * @import {
 *   Code,
 *   Construct,
 *   State,
 *   TokenizeContext,
 *   Tokenizer
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {decodeNamedCharacterReference} from 'decode-named-character-reference'
import {
  asciiAlphanumeric,
  asciiDigit,
  asciiHexDigit
} from 'micromark-util-character'
import {codes, constants, types} from 'micromark-util-symbol'

/** @type {Construct} */
export const characterReference = {
  name: 'characterReference',
  tokenize: tokenizeCharacterReference
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeCharacterReference(effects, ok, nok) {
  const self = this
  let size = 0
  /** @type {number} */
  let max
  /** @type {(code: Code) => boolean} */
  let test

  return start

  /**
   * Start of character reference.
   *
   * ```markdown
   * > | a&amp;b
   *      ^
   * > | a&#123;b
   *      ^
   * > | a&#x9;b
   *      ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    assert(code === codes.ampersand, 'expected `&`')
    effects.enter(types.characterReference)
    effects.enter(types.characterReferenceMarker)
    effects.consume(code)
    effects.exit(types.characterReferenceMarker)
    return open
  }

  /**
   * After `&`, at `#` for numeric references or alphanumeric for named
   * references.
   *
   * ```markdown
   * > | a&amp;b
   *       ^
   * > | a&#123;b
   *       ^
   * > | a&#x9;b
   *       ^
   * ```
   *
   * @type {State}
   */
  function open(code) {
    if (code === codes.numberSign) {
      effects.enter(types.characterReferenceMarkerNumeric)
      effects.consume(code)
      effects.exit(types.characterReferenceMarkerNumeric)
      return numeric
    }

    effects.enter(types.characterReferenceValue)
    max = constants.characterReferenceNamedSizeMax
    test = asciiAlphanumeric
    return value(code)
  }

  /**
   * After `#`, at `x` for hexadecimals or digit for decimals.
   *
   * ```markdown
   * > | a&#123;b
   *        ^
   * > | a&#x9;b
   *        ^
   * ```
   *
   * @type {State}
   */
  function numeric(code) {
    if (code === codes.uppercaseX || code === codes.lowercaseX) {
      effects.enter(types.characterReferenceMarkerHexadecimal)
      effects.consume(code)
      effects.exit(types.characterReferenceMarkerHexadecimal)
      effects.enter(types.characterReferenceValue)
      max = constants.characterReferenceHexadecimalSizeMax
      test = asciiHexDigit
      return value
    }

    effects.enter(types.characterReferenceValue)
    max = constants.characterReferenceDecimalSizeMax
    test = asciiDigit
    return value(code)
  }

  /**
   * After markers (`&#x`, `&#`, or `&`), in value, before `;`.
   *
   * The character reference kind defines what and how many characters are
   * allowed.
   *
   * ```markdown
   * > | a&amp;b
   *       ^^^
   * > | a&#123;b
   *        ^^^
   * > | a&#x9;b
   *         ^
   * ```
   *
   * @type {State}
   */
  function value(code) {
    if (code === codes.semicolon && size) {
      const token = effects.exit(types.characterReferenceValue)

      if (
        test === asciiAlphanumeric &&
        !decodeNamedCharacterReference(self.sliceSerialize(token))
      ) {
        return nok(code)
      }

      // To do: `markdown-rs` uses a different name:
      // `CharacterReferenceMarkerSemi`.
      effects.enter(types.characterReferenceMarker)
      effects.consume(code)
      effects.exit(types.characterReferenceMarker)
      effects.exit(types.characterReference)
      return ok
    }

    if (test(code) && size++ < max) {
      effects.consume(code)
      return value
    }

    return nok(code)
  }
}
ƷmB	x b/** @type {Construct} */
export const codeFenced: Construct;
import type { Construct } from 'micromark-util-types';
//# sourceMappingURL=code-fenced.d.ts.map/7	x a{"version":3,"file":"code-fenced.d.ts","sourceRoot":"","sources":["code-fenced.js"],"names":[],"mappings":"AAqBA,wBAAwB;AACxB,yBADW,SAAS,CAKnB;+BAnBS,sBAAsB"}1x (/**
 * @import {
 *   Code,
 *   Construct,
 *   State,
 *   TokenizeContext,
 *   Tokenizer
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {factorySpace} from 'micromark-factory-space'
import {markdownLineEnding, markdownSpace} from 'micromark-util-character'
import {codes, constants, types} from 'micromark-util-symbol'

/** @type {Construct} */
const nonLazyContinuation = {
  partial: true,
  tokenize: tokenizeNonLazyContinuation
}

/** @type {Construct} */
export const codeFenced = {
  concrete: true,
  name: 'codeFenced',
  tokenize: tokenizeCodeFenced
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeCodeFenced(effects, ok, nok) {
  const self = this
  /** @type {Construct} */
  const closeStart = {partial: true, tokenize: tokenizeCloseStart}
  let initialPrefix = 0
  let sizeOpen = 0
  /** @type {NonNullable<Code>} */
  let marker

  return start

  /**
   * Start of code.
   *
   * ```markdown
   * > | ~~~js
   *     ^
   *   | alert(1)
   *   | ~~~
   * ```
   *
   * @type {State}
   */
  function start(code) {
    // To do: parse whitespace like `markdown-rs`.
    return beforeSequenceOpen(code)
  }

  /**
   * In opening fence, after prefix, at sequence.
   *
   * ```markdown
   * > | ~~~js
   *     ^
   *   | alert(1)
   *   | ~~~
   * ```
   *
   * @type {State}
   */
  function beforeSequenceOpen(code) {
    assert(
      code === codes.graveAccent || code === codes.tilde,
      'expected `` ` `` or `~`'
    )

    const tail = self.events[self.events.length - 1]
    initialPrefix =
      tail && tail[1].type === types.linePrefix
        ? tail[2].sliceSerialize(tail[1], true).length
        : 0

    marker = code
    effects.enter(types.codeFenced)
    effects.enter(types.codeFencedFence)
    effects.enter(types.codeFencedFenceSequence)
    return sequenceOpen(code)
  }

  /**
   * In opening fence sequence.
   *
   * ```markdown
   * > | ~~~js
   *      ^
   *   | alert(1)
   *   | ~~~
   * ```
   *
   * @type {State}
   */
  function sequenceOpen(code) {
    if (code === marker) {
      sizeOpen++
      effects.consume(code)
      return sequenceOpen
    }

    if (sizeOpen < constants.codeFencedSequenceSizeMin) {
      return nok(code)
    }

    effects.exit(types.codeFencedFenceSequence)
    return markdownSpace(code)
      ? factorySpace(effects, infoBefore, types.whitespace)(code)
      : infoBefore(code)
  }

  /**
   * In opening fence, after the sequence (and optional whitespace), before info.
   *
   * ```markdown
   * > | ~~~js
   *        ^
   *   | alert(1)
   *   | ~~~
   * ```
   *
   * @type {State}
   */
  function infoBefore(code) {
    if (code === codes.eof || markdownLineEnding(code)) {
      effects.exit(types.codeFencedFence)
      return self.interrupt
        ? ok(code)
        : effects.check(nonLazyContinuation, atNonLazyBreak, after)(code)
    }

    effects.enter(types.codeFencedFenceInfo)
    effects.enter(types.chunkString, {contentType: constants.contentTypeString})
    return info(code)
  }

  /**
   * In info.
   *
   * ```markdown
   * > | ~~~js
   *        ^
   *   | alert(1)
   *   | ~~~
   * ```
   *
   * @type {State}
   */
  function info(code) {
    if (code === codes.eof || markdownLineEnding(code)) {
      effects.exit(types.chunkString)
      effects.exit(types.codeFencedFenceInfo)
      return infoBefore(code)
    }

    if (markdownSpace(code)) {
      effects.exit(types.chunkString)
      effects.exit(types.codeFencedFenceInfo)
      return factorySpace(effects, metaBefore, types.whitespace)(code)
    }

    if (code === codes.graveAccent && code === marker) {
      return nok(code)
    }

    effects.consume(code)
    return info
  }

  /**
   * In opening fence, after info and whitespace, before meta.
   *
   * ```markdown
   * > | ~~~js eval
   *           ^
   *   | alert(1)
   *   | ~~~
   * ```
   *
   * @type {State}
   */
  function metaBefore(code) {
    if (code === codes.eof || markdownLineEnding(code)) {
      return infoBefore(code)
    }

    effects.enter(types.codeFencedFenceMeta)
    effects.enter(types.chunkString, {contentType: constants.contentTypeString})
    return meta(code)
  }

  /**
   * In meta.
   *
   * ```markdown
   * > | ~~~js eval
   *           ^
   *   | alert(1)
   *   | ~~~
   * ```
   *
   * @type {State}
   */
  function meta(code) {
    if (code === codes.eof || markdownLineEnding(code)) {
      effects.exit(types.chunkString)
      effects.exit(types.codeFencedFenceMeta)
      return infoBefore(code)
    }

    if (code === codes.graveAccent && code === marker) {
      return nok(code)
    }

    effects.consume(code)
    return meta
  }

  /**
   * At eol/eof in code, before a non-lazy closing fence or content.
   *
   * ```markdown
   * > | ~~~js
   *          ^
   * > | alert(1)
   *             ^
   *   | ~~~
   * ```
   *
   * @type {State}
   */
  function atNonLazyBreak(code) {
    assert(markdownLineEnding(code), 'expected eol')
    return effects.attempt(closeStart, after, contentBefore)(code)
  }

  /**
   * Before code content, not a closing fence, at eol.
   *
   * ```markdown
   *   | ~~~js
   * > | alert(1)
   *             ^
   *   | ~~~
   * ```
   *
   * @type {State}
   */
  function contentBefore(code) {
    assert(markdownLineEnding(code), 'expected eol')
    effects.enter(types.lineEnding)
    effects.consume(code)
    effects.exit(types.lineEnding)
    return contentStart
  }

  /**
   * Before code content, not a closing fence.
   *
   * ```markdown
   *   | ~~~js
   * > | alert(1)
   *     ^
   *   | ~~~
   * ```
   *
   * @type {State}
   */
  function contentStart(code) {
    return initialPrefix > 0 && markdownSpace(code)
      ? factorySpace(
          effects,
          beforeContentChunk,
          types.linePrefix,
          initialPrefix + 1
        )(code)
      : beforeContentChunk(code)
  }

  /**
   * Before code content, after optional prefix.
   *
   * ```markdown
   *   | ~~~js
   * > | alert(1)
   *     ^
   *   | ~~~
   * ```
   *
   * @type {State}
   */
  function beforeContentChunk(code) {
    if (code === codes.eof || markdownLineEnding(code)) {
      return effects.check(nonLazyContinuation, atNonLazyBreak, after)(code)
    }

    effects.enter(types.codeFlowValue)
    return contentChunk(code)
  }

  /**
   * In code content.
   *
   * ```markdown
   *   | ~~~js
   * > | alert(1)
   *     ^^^^^^^^
   *   | ~~~
   * ```
   *
   * @type {State}
   */
  function contentChunk(code) {
    if (code === codes.eof || markdownLineEnding(code)) {
      effects.exit(types.codeFlowValue)
      return beforeContentChunk(code)
    }

    effects.consume(code)
    return contentChunk
  }

  /**
   * After code.
   *
   * ```markdown
   *   | ~~~js
   *   | alert(1)
   * > | ~~~
   *        ^
   * ```
   *
   * @type {State}
   */
  function after(code) {
    effects.exit(types.codeFenced)
    return ok(code)
  }

  /**
   * @this {TokenizeContext}
   *   Context.
   * @type {Tokenizer}
   */
  function tokenizeCloseStart(effects, ok, nok) {
    let size = 0

    return startBefore

    /**
     *
     *
     * @type {State}
     */
    function startBefore(code) {
      assert(markdownLineEnding(code), 'expected eol')
      effects.enter(types.lineEnding)
      effects.consume(code)
      effects.exit(types.lineEnding)
      return start
    }

    /**
     * Before closing fence, at optional whitespace.
     *
     * ```markdown
     *   | ~~~js
     *   | alert(1)
     * > | ~~~
     *     ^
     * ```
     *
     * @type {State}
     */
    function start(code) {
      // Always populated by defaults.
      assert(
        self.parser.constructs.disable.null,
        'expected `disable.null` to be populated'
      )

      // To do: `enter` here or in next state?
      effects.enter(types.codeFencedFence)
      return markdownSpace(code)
        ? factorySpace(
            effects,
            beforeSequenceClose,
            types.linePrefix,
            self.parser.constructs.disable.null.includes('codeIndented')
              ? undefined
              : constants.tabSize
          )(code)
        : beforeSequenceClose(code)
    }

    /**
     * In closing fence, after optional whitespace, at sequence.
     *
     * ```markdown
     *   | ~~~js
     *   | alert(1)
     * > | ~~~
     *     ^
     * ```
     *
     * @type {State}
     */
    function beforeSequenceClose(code) {
      if (code === marker) {
        effects.enter(types.codeFencedFenceSequence)
        return sequenceClose(code)
      }

      return nok(code)
    }

    /**
     * In closing fence sequence.
     *
     * ```markdown
     *   | ~~~js
     *   | alert(1)
     * > | ~~~
     *     ^
     * ```
     *
     * @type {State}
     */
    function sequenceClose(code) {
      if (code === marker) {
        size++
        effects.consume(code)
        return sequenceClose
      }

      if (size >= sizeOpen) {
        effects.exit(types.codeFencedFenceSequence)
        return markdownSpace(code)
          ? factorySpace(effects, sequenceCloseAfter, types.whitespace)(code)
          : sequenceCloseAfter(code)
      }

      return nok(code)
    }

    /**
     * After closing fence sequence, after optional whitespace.
     *
     * ```markdown
     *   | ~~~js
     *   | alert(1)
     * > | ~~~
     *        ^
     * ```
     *
     * @type {State}
     */
    function sequenceCloseAfter(code) {
      if (code === codes.eof || markdownLineEnding(code)) {
        effects.exit(types.codeFencedFence)
        return ok(code)
      }

      return nok(code)
    }
  }
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeNonLazyContinuation(effects, ok, nok) {
  const self = this

  return start

  /**
   *
   *
   * @type {State}
   */
  function start(code) {
    if (code === codes.eof) {
      return nok(code)
    }

    assert(markdownLineEnding(code), 'expected eol')
    effects.enter(types.lineEnding)
    effects.consume(code)
    effects.exit(types.lineEnding)
    return lineStart
  }

  /**
   *
   *
   * @type {State}
   */
  function lineStart(code) {
    return self.parser.lazy[self.now().line] ? nok(code) : ok(code)
  }
}
9u࿱
x ^/** @type {Construct} */
export const codeIndented: Construct;
import type { Construct } from 'micromark-util-types';
//# sourceMappingURL=code-indented.d.ts.map*9
x _{"version":3,"file":"code-indented.d.ts","sourceRoot":"","sources":["code-indented.js"],"names":[],"mappings":"AAcA,wBAAwB;AACxB,2BADW,SAAS,CAInB;+BAZS,sBAAsB"}<2ʹx/**
 * @import {
 *   Construct,
 *   State,
 *   TokenizeContext,
 *   Tokenizer
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {factorySpace} from 'micromark-factory-space'
import {markdownLineEnding, markdownSpace} from 'micromark-util-character'
import {codes, constants, types} from 'micromark-util-symbol'

/** @type {Construct} */
export const codeIndented = {
  name: 'codeIndented',
  tokenize: tokenizeCodeIndented
}

/** @type {Construct} */
const furtherStart = {partial: true, tokenize: tokenizeFurtherStart}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeCodeIndented(effects, ok, nok) {
  const self = this
  return start

  /**
   * Start of code (indented).
   *
   * > **Parsing note**: it is not needed to check if this first line is a
   * > filled line (that it has a non-whitespace character), because blank lines
   * > are parsed already, so we never run into that.
   *
   * ```markdown
   * > |     aaa
   *     ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    // To do: manually check if interrupting like `markdown-rs`.
    assert(markdownSpace(code))
    effects.enter(types.codeIndented)
    // To do: use an improved `space_or_tab` function like `markdown-rs`,
    // so that we can drop the next state.
    return factorySpace(
      effects,
      afterPrefix,
      types.linePrefix,
      constants.tabSize + 1
    )(code)
  }

  /**
   * At start, after 1 or 4 spaces.
   *
   * ```markdown
   * > |     aaa
   *         ^
   * ```
   *
   * @type {State}
   */
  function afterPrefix(code) {
    const tail = self.events[self.events.length - 1]
    return tail &&
      tail[1].type === types.linePrefix &&
      tail[2].sliceSerialize(tail[1], true).length >= constants.tabSize
      ? atBreak(code)
      : nok(code)
  }

  /**
   * At a break.
   *
   * ```markdown
   * > |     aaa
   *         ^  ^
   * ```
   *
   * @type {State}
   */
  function atBreak(code) {
    if (code === codes.eof) {
      return after(code)
    }

    if (markdownLineEnding(code)) {
      return effects.attempt(furtherStart, atBreak, after)(code)
    }

    effects.enter(types.codeFlowValue)
    return inside(code)
  }

  /**
   * In code content.
   *
   * ```markdown
   * > |     aaa
   *         ^^^^
   * ```
   *
   * @type {State}
   */
  function inside(code) {
    if (code === codes.eof || markdownLineEnding(code)) {
      effects.exit(types.codeFlowValue)
      return atBreak(code)
    }

    effects.consume(code)
    return inside
  }

  /** @type {State} */
  function after(code) {
    effects.exit(types.codeIndented)
    // To do: allow interrupting like `markdown-rs`.
    // Feel free to interrupt.
    // tokenizer.interrupt = false
    return ok(code)
  }
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeFurtherStart(effects, ok, nok) {
  const self = this

  return furtherStart

  /**
   * At eol, trying to parse another indent.
   *
   * ```markdown
   * > |     aaa
   *            ^
   *   |     bbb
   * ```
   *
   * @type {State}
   */
  function furtherStart(code) {
    // To do: improve `lazy` / `pierce` handling.
    // If this is a lazy line, it can’t be code.
    if (self.parser.lazy[self.now().line]) {
      return nok(code)
    }

    if (markdownLineEnding(code)) {
      effects.enter(types.lineEnding)
      effects.consume(code)
      effects.exit(types.lineEnding)
      return furtherStart
    }

    // To do: the code here in `micromark-js` is a bit different from
    // `markdown-rs` because there it can attempt spaces.
    // We can’t yet.
    //
    // To do: use an improved `space_or_tab` function like `markdown-rs`,
    // so that we can drop the next state.
    return factorySpace(
      effects,
      afterPrefix,
      types.linePrefix,
      constants.tabSize + 1
    )(code)
  }

  /**
   * At start, after 1 or 4 spaces.
   *
   * ```markdown
   * > |     aaa
   *         ^
   * ```
   *
   * @type {State}
   */
  function afterPrefix(code) {
    const tail = self.events[self.events.length - 1]
    return tail &&
      tail[1].type === types.linePrefix &&
      tail[2].sliceSerialize(tail[1], true).length >= constants.tabSize
      ? ok(code)
      : markdownLineEnding(code)
        ? furtherStart(code)
        : nok(code)
  }
}
;m	x f/** @type {Construct} */
export const codeText: Construct;
import type { Construct } from 'micromark-util-types';
//# sourceMappingURL=code-text.d.ts.map]16	x f{"version":3,"file":"code-text.d.ts","sourceRoot":"","sources":["code-text.js"],"names":[],"mappings":"AAgBA,wBAAwB;AACxB,uBADW,SAAS,CAMnB;+BAbS,sBAAsB"}$0VxJ/**
 * @import {
 *   Construct,
 *   Previous,
 *   Resolver,
 *   State,
 *   TokenizeContext,
 *   Tokenizer,
 *   Token
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {markdownLineEnding} from 'micromark-util-character'
import {codes, types} from 'micromark-util-symbol'

/** @type {Construct} */
export const codeText = {
  name: 'codeText',
  previous,
  resolve: resolveCodeText,
  tokenize: tokenizeCodeText
}

// To do: next major: don’t resolve, like `markdown-rs`.
/** @type {Resolver} */
function resolveCodeText(events) {
  let tailExitIndex = events.length - 4
  let headEnterIndex = 3
  /** @type {number} */
  let index
  /** @type {number | undefined} */
  let enter

  // If we start and end with an EOL or a space.
  if (
    (events[headEnterIndex][1].type === types.lineEnding ||
      events[headEnterIndex][1].type === 'space') &&
    (events[tailExitIndex][1].type === types.lineEnding ||
      events[tailExitIndex][1].type === 'space')
  ) {
    index = headEnterIndex

    // And we have data.
    while (++index < tailExitIndex) {
      if (events[index][1].type === types.codeTextData) {
        // Then we have padding.
        events[headEnterIndex][1].type = types.codeTextPadding
        events[tailExitIndex][1].type = types.codeTextPadding
        headEnterIndex += 2
        tailExitIndex -= 2
        break
      }
    }
  }

  // Merge adjacent spaces and data.
  index = headEnterIndex - 1
  tailExitIndex++

  while (++index <= tailExitIndex) {
    if (enter === undefined) {
      if (
        index !== tailExitIndex &&
        events[index][1].type !== types.lineEnding
      ) {
        enter = index
      }
    } else if (
      index === tailExitIndex ||
      events[index][1].type === types.lineEnding
    ) {
      events[enter][1].type = types.codeTextData

      if (index !== enter + 2) {
        events[enter][1].end = events[index - 1][1].end
        events.splice(enter + 2, index - enter - 2)
        tailExitIndex -= index - enter - 2
        index = enter + 2
      }

      enter = undefined
    }
  }

  return events
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Previous}
 */
function previous(code) {
  // If there is a previous code, there will always be a tail.
  return (
    code !== codes.graveAccent ||
    this.events[this.events.length - 1][1].type === types.characterEscape
  )
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeCodeText(effects, ok, nok) {
  const self = this
  let sizeOpen = 0
  /** @type {number} */
  let size
  /** @type {Token} */
  let token

  return start

  /**
   * Start of code (text).
   *
   * ```markdown
   * > | `a`
   *     ^
   * > | \`a`
   *      ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    assert(code === codes.graveAccent, 'expected `` ` ``')
    assert(previous.call(self, self.previous), 'expected correct previous')
    effects.enter(types.codeText)
    effects.enter(types.codeTextSequence)
    return sequenceOpen(code)
  }

  /**
   * In opening sequence.
   *
   * ```markdown
   * > | `a`
   *     ^
   * ```
   *
   * @type {State}
   */
  function sequenceOpen(code) {
    if (code === codes.graveAccent) {
      effects.consume(code)
      sizeOpen++
      return sequenceOpen
    }

    effects.exit(types.codeTextSequence)
    return between(code)
  }

  /**
   * Between something and something else.
   *
   * ```markdown
   * > | `a`
   *      ^^
   * ```
   *
   * @type {State}
   */
  function between(code) {
    // EOF.
    if (code === codes.eof) {
      return nok(code)
    }

    // To do: next major: don’t do spaces in resolve, but when compiling,
    // like `markdown-rs`.
    // Tabs don’t work, and virtual spaces don’t make sense.
    if (code === codes.space) {
      effects.enter('space')
      effects.consume(code)
      effects.exit('space')
      return between
    }

    // Closing fence? Could also be data.
    if (code === codes.graveAccent) {
      token = effects.enter(types.codeTextSequence)
      size = 0
      return sequenceClose(code)
    }

    if (markdownLineEnding(code)) {
      effects.enter(types.lineEnding)
      effects.consume(code)
      effects.exit(types.lineEnding)
      return between
    }

    // Data.
    effects.enter(types.codeTextData)
    return data(code)
  }

  /**
   * In data.
   *
   * ```markdown
   * > | `a`
   *      ^
   * ```
   *
   * @type {State}
   */
  function data(code) {
    if (
      code === codes.eof ||
      code === codes.space ||
      code === codes.graveAccent ||
      markdownLineEnding(code)
    ) {
      effects.exit(types.codeTextData)
      return between(code)
    }

    effects.consume(code)
    return data
  }

  /**
   * In closing sequence.
   *
   * ```markdown
   * > | `a`
   *       ^
   * ```
   *
   * @type {State}
   */
  function sequenceClose(code) {
    // More.
    if (code === codes.graveAccent) {
      effects.consume(code)
      size++
      return sequenceClose
    }

    // Done!
    if (size === sizeOpen) {
      effects.exit(types.codeTextSequence)
      effects.exit(types.codeText)
      return ok(code)
    }

    // More or less accents: mark as data.
    token.type = types.codeTextData
    return data(code)
  }
}
ǹGx 7/**
 * No name because it must not be turned off.
 * @type {Construct}
 */
export const content: Construct;
import type { Construct } from 'micromark-util-types';
//# sourceMappingURL=content.d.ts.mapQE	x j{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["content.js"],"names":[],"mappings":"AAiBA;;;GAGG;AACH,sBAFU,SAAS,CAEwD;+BAbjE,sBAAsB"};.Ʊx1/**
 * @import {
 *   Construct,
 *   Resolver,
 *   State,
 *   TokenizeContext,
 *   Tokenizer,
 *   Token
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {factorySpace} from 'micromark-factory-space'
import {markdownLineEnding} from 'micromark-util-character'
import {subtokenize} from 'micromark-util-subtokenize'
import {codes, constants, types} from 'micromark-util-symbol'

/**
 * No name because it must not be turned off.
 * @type {Construct}
 */
export const content = {resolve: resolveContent, tokenize: tokenizeContent}

/** @type {Construct} */
const continuationConstruct = {partial: true, tokenize: tokenizeContinuation}

/**
 * Content is transparent: it’s parsed right now. That way, definitions are also
 * parsed right now: before text in paragraphs (specifically, media) are parsed.
 *
 * @type {Resolver}
 */
function resolveContent(events) {
  subtokenize(events)
  return events
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeContent(effects, ok) {
  /** @type {Token | undefined} */
  let previous

  return chunkStart

  /**
   * Before a content chunk.
   *
   * ```markdown
   * > | abc
   *     ^
   * ```
   *
   * @type {State}
   */
  function chunkStart(code) {
    assert(
      code !== codes.eof && !markdownLineEnding(code),
      'expected no eof or eol'
    )

    effects.enter(types.content)
    previous = effects.enter(types.chunkContent, {
      contentType: constants.contentTypeContent
    })
    return chunkInside(code)
  }

  /**
   * In a content chunk.
   *
   * ```markdown
   * > | abc
   *     ^^^
   * ```
   *
   * @type {State}
   */
  function chunkInside(code) {
    if (code === codes.eof) {
      return contentEnd(code)
    }

    // To do: in `markdown-rs`, each line is parsed on its own, and everything
    // is stitched together resolving.
    if (markdownLineEnding(code)) {
      return effects.check(
        continuationConstruct,
        contentContinue,
        contentEnd
      )(code)
    }

    // Data.
    effects.consume(code)
    return chunkInside
  }

  /**
   *
   *
   * @type {State}
   */
  function contentEnd(code) {
    effects.exit(types.chunkContent)
    effects.exit(types.content)
    return ok(code)
  }

  /**
   *
   *
   * @type {State}
   */
  function contentContinue(code) {
    assert(markdownLineEnding(code), 'expected eol')
    effects.consume(code)
    effects.exit(types.chunkContent)
    assert(previous, 'expected previous token')
    previous.next = effects.enter(types.chunkContent, {
      contentType: constants.contentTypeContent,
      previous
    })
    previous = previous.next
    return chunkInside
  }
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeContinuation(effects, ok, nok) {
  const self = this

  return startLookahead

  /**
   *
   *
   * @type {State}
   */
  function startLookahead(code) {
    assert(markdownLineEnding(code), 'expected a line ending')
    effects.exit(types.chunkContent)
    effects.enter(types.lineEnding)
    effects.consume(code)
    effects.exit(types.lineEnding)
    return factorySpace(effects, prefixed, types.linePrefix)
  }

  /**
   *
   *
   * @type {State}
   */
  function prefixed(code) {
    if (code === codes.eof || markdownLineEnding(code)) {
      return nok(code)
    }

    // Always populated by defaults.
    assert(
      self.parser.constructs.disable.null,
      'expected `disable.null` to be populated'
    )

    const tail = self.events[self.events.length - 1]

    if (
      !self.parser.constructs.disable.null.includes('codeIndented') &&
      tail &&
      tail[1].type === types.linePrefix &&
      tail[2].sliceSerialize(tail[1], true).length >= constants.tabSize
    ) {
      return ok(code)
    }

    return effects.interrupt(self.parser.constructs.flow, nok, ok)(code)
  }
}
L	x c/** @type {Construct} */
export const definition: Construct;
import type { Construct } from 'micromark-util-types';
//# sourceMappingURL=definition.d.ts.map89qx9 k2uBA,wBAAwB;AACxB,yBADW,SAAS,CACwD;+BAlBlE,sBAAsB"}
Yx>/**
 * @import {
 *   Construct,
 *   State,
 *   TokenizeContext,
 *   Tokenizer
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {factoryDestination} from 'micromark-factory-destination'
import {factoryLabel} from 'micromark-factory-label'
import {factorySpace} from 'micromark-factory-space'
import {factoryTitle} from 'micromark-factory-title'
import {factoryWhitespace} from 'micromark-factory-whitespace'
import {
  markdownLineEndingOrSpace,
  markdownLineEnding,
  markdownSpace
} from 'micromark-util-character'
import {normalizeIdentifier} from 'micromark-util-normalize-identifier'
import {codes, types} from 'micromark-util-symbol'

/** @type {Construct} */
export const definition = {name: 'definition', tokenize: tokenizeDefinition}

/** @type {Construct} */
const titleBefore = {partial: true, tokenize: tokenizeTitleBefore}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeDefinition(effects, ok, nok) {
  const self = this
  /** @type {string} */
  let identifier

  return start

  /**
   * At start of a definition.
   *
   * ```markdown
   * > | [a]: b "c"
   *     ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    // Do not interrupt paragraphs (but do follow definitions).
    // To do: do `interrupt` the way `markdown-rs` does.
    // To do: parse whitespace the way `markdown-rs` does.
    effects.enter(types.definition)
    return before(code)
  }

  /**
   * After optional whitespace, at `[`.
   *
   * ```markdown
   * > | [a]: b "c"
   *     ^
   * ```
   *
   * @type {State}
   */
  function before(code) {
    // To do: parse whitespace the way `markdown-rs` does.
    assert(code === codes.leftSquareBracket, 'expected `[`')
    return factoryLabel.call(
      self,
      effects,
      labelAfter,
      // Note: we don’t need to reset the way `markdown-rs` does.
      nok,
      types.definitionLabel,
      types.definitionLabelMarker,
      types.definitionLabelString
    )(code)
  }

  /**
   * After label.
   *
   * ```markdown
   * > | [a]: b "c"
   *        ^
   * ```
   *
   * @type {State}
   */
  function labelAfter(code) {
    identifier = normalizeIdentifier(
      self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1)
    )

    if (code === codes.colon) {
      effects.enter(types.definitionMarker)
      effects.consume(code)
      effects.exit(types.definitionMarker)
      return markerAfter
    }

    return nok(code)
  }

  /**
   * After marker.
   *
   * ```markdown
   * > | [a]: b "c"
   *         ^
   * ```
   *
   * @type {State}
   */
  function markerAfter(code) {
    // Note: whitespace is optional.
    return markdownLineEndingOrSpace(code)
      ? factoryWhitespace(effects, destinationBefore)(code)
      : destinationBefore(code)
  }

  /**
   * Before destination.
   *
   * ```markdown
   * > | [a]: b "c"
   *          ^
   * ```
   *
   * @type {State}
   */
  function destinationBefore(code) {
    return factoryDestination(
      effects,
      destinationAfter,
      // Note: we don’t need to reset the way `markdown-rs` does.
      nok,
      types.definitionDestination,
      types.definitionDestinationLiteral,
      types.definitionDestinationLiteralMarker,
      types.definitionDestinationRaw,
      types.definitionDestinationString
    )(code)
  }

  /**
   * After destination.
   *
   * ```markdown
   * > | [a]: b "c"
   *           ^
   * ```
   *
   * @type {State}
   */
  function destinationAfter(code) {
    return effects.attempt(titleBefore, after, after)(code)
  }

  /**
   * After definition.
   *
   * ```markdown
   * > | [a]: b
   *           ^
   * > | [a]: b "c"
   *               ^
   * ```
   *
   * @type {State}
   */
  function after(code) {
    return markdownSpace(code)
      ? factorySpace(effects, afterWhitespace, types.whitespace)(code)
      : afterWhitespace(code)
  }

  /**
   * After definition, after optional whitespace.
   *
   * ```markdown
   * > | [a]: b
   *           ^
   * > | [a]: b "c"
   *               ^
   * ```
   *
   * @type {State}
   */
  function afterWhitespace(code) {
    if (code === codes.eof || markdownLineEnding(code)) {
      effects.exit(types.definition)

      // Note: we don’t care about uniqueness.
      // It’s likely that that doesn’t happen very frequently.
      // It is more likely that it wastes precious time.
      self.parser.defined.push(identifier)

      // To do: `markdown-rs` interrupt.
      // // You’d be interrupting.
      // tokenizer.interrupt = true
      return ok(code)
    }

    return nok(code)
  }
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeTitleBefore(effects, ok, nok) {
  return titleBefore

  /**
   * After destination, at whitespace.
   *
   * ```markdown
   * > | [a]: b
   *           ^
   * > | [a]: b "c"
   *           ^
   * ```
   *
   * @type {State}
   */
  function titleBefore(code) {
    return markdownLineEndingOrSpace(code)
      ? factoryWhitespace(effects, beforeMarker)(code)
      : nok(code)
  }

  /**
   * At title.
   *
   * ```markdown
   *   | [a]: b
   * > | "c"
   *     ^
   * ```
   *
   * @type {State}
   */
  function beforeMarker(code) {
    return factoryTitle(
      effects,
      titleAfter,
      nok,
      types.definitionTitle,
      types.definitionTitleMarker,
      types.definitionTitleString
    )(code)
  }

  /**
   * After title.
   *
   * ```markdown
   * > | [a]: b "c"
   *               ^
   * ```
   *
   * @type {State}
   */
  function titleAfter(code) {
    return markdownSpace(code)
      ? factorySpace(
          effects,
          titleAfterOptionalWhitespace,
          types.whitespace
        )(code)
      : titleAfterOptionalWhitespace(code)
  }

  /**
   * After title, after optional whitespace.
   *
   * ```markdown
   * > | [a]: b "c"
   *               ^
   * ```
   *
   * @type {State}
   */
  function titleAfterOptionalWhitespace(code) {
    return code === codes.eof || markdownLineEnding(code) ? ok(code) : nok(code)
  }
}
:_x. &	hardBreak/_hard-break-escape.d.ts.mapzPFxe/**
 * @import {
 *   Construct,
 *   State,
 *   TokenizeContext,
 *   Tokenizer
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {markdownLineEnding} from 'micromark-util-character'
import {codes, types} from 'micromark-util-symbol'

/** @type {Construct} */
export const hardBreakEscape = {
  name: 'hardBreakEscape',
  tokenize: tokenizeHardBreakEscape
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeHardBreakEscape(effects, ok, nok) {
  return start

  /**
   * Start of a hard break (escape).
   *
   * ```markdown
   * > | a\
   *      ^
   *   | b
   * ```
   *
   * @type {State}
   */
  function start(code) {
    assert(code === codes.backslash, 'expected `\\`')
    effects.enter(types.hardBreakEscape)
    effects.consume(code)
    return after
  }

  /**
   * After `\`, at eol.
   *
   * ```markdown
   * > | a\
   *       ^
   *   | b
   * ```
   *
   *  @type {State}
   */
  function after(code) {
    if (markdownLineEnding(code)) {
      effects.exit(types.hardBreakEscape)
      return ok(code)
    }

    return nok(code)
  }
}
X	x b/** @type {Construct} */
export const headingAtx: Construct;
import type { Construct } from 'micromark-util-types';
//# sourceMappingURL=heading-atx.d.ts.map>Z8.	x a{"version":3,"file":"heading-atx.d.ts","sourceRoot":"","sources":["heading-atx.js"],"names":[],"mappings":"AAqBA,wBAAwB;AACxB,yBADW,SAAS,CAKnB;+BAlBS,sBAAsB"}2(x4/**
 * @import {
 *   Construct,
 *   Resolver,
 *   State,
 *   TokenizeContext,
 *   Tokenizer,
 *   Token
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {factorySpace} from 'micromark-factory-space'
import {
  markdownLineEndingOrSpace,
  markdownLineEnding,
  markdownSpace
} from 'micromark-util-character'
import {splice} from 'micromark-util-chunked'
import {codes, constants, types} from 'micromark-util-symbol'

/** @type {Construct} */
export const headingAtx = {
  name: 'headingAtx',
  resolve: resolveHeadingAtx,
  tokenize: tokenizeHeadingAtx
}

/** @type {Resolver} */
function resolveHeadingAtx(events, context) {
  let contentEnd = events.length - 2
  let contentStart = 3
  /** @type {Token} */
  let content
  /** @type {Token} */
  let text

  // Prefix whitespace, part of the opening.
  if (events[contentStart][1].type === types.whitespace) {
    contentStart += 2
  }

  // Suffix whitespace, part of the closing.
  if (
    contentEnd - 2 > contentStart &&
    events[contentEnd][1].type === types.whitespace
  ) {
    contentEnd -= 2
  }

  if (
    events[contentEnd][1].type === types.atxHeadingSequence &&
    (contentStart === contentEnd - 1 ||
      (contentEnd - 4 > contentStart &&
        events[contentEnd - 2][1].type === types.whitespace))
  ) {
    contentEnd -= contentStart + 1 === contentEnd ? 2 : 4
  }

  if (contentEnd > contentStart) {
    content = {
      type: types.atxHeadingText,
      start: events[contentStart][1].start,
      end: events[contentEnd][1].end
    }
    text = {
      type: types.chunkText,
      start: events[contentStart][1].start,
      end: events[contentEnd][1].end,
      contentType: constants.contentTypeText
    }

    splice(events, contentStart, contentEnd - contentStart + 1, [
      ['enter', content, context],
      ['enter', text, context],
      ['exit', text, context],
      ['exit', content, context]
    ])
  }

  return events
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeHeadingAtx(effects, ok, nok) {
  let size = 0

  return start

  /**
   * Start of a heading (atx).
   *
   * ```markdown
   * > | ## aa
   *     ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    // To do: parse indent like `markdown-rs`.
    effects.enter(types.atxHeading)
    return before(code)
  }

  /**
   * After optional whitespace, at `#`.
   *
   * ```markdown
   * > | ## aa
   *     ^
   * ```
   *
   * @type {State}
   */
  function before(code) {
    assert(code === codes.numberSign, 'expected `#`')
    effects.enter(types.atxHeadingSequence)
    return sequenceOpen(code)
  }

  /**
   * In opening sequence.
   *
   * ```markdown
   * > | ## aa
   *     ^
   * ```
   *
   * @type {State}
   */
  function sequenceOpen(code) {
    if (
      code === codes.numberSign &&
      size++ < constants.atxHeadingOpeningFenceSizeMax
    ) {
      effects.consume(code)
      return sequenceOpen
    }

    // Always at least one `#`.
    if (code === codes.eof || markdownLineEndingOrSpace(code)) {
      effects.exit(types.atxHeadingSequence)
      return atBreak(code)
    }

    return nok(code)
  }

  /**
   * After something, before something else.
   *
   * ```markdown
   * > | ## aa
   *       ^
   * ```
   *
   * @type {State}
   */
  function atBreak(code) {
    if (code === codes.numberSign) {
      effects.enter(types.atxHeadingSequence)
      return sequenceFurther(code)
    }

    if (code === codes.eof || markdownLineEnding(code)) {
      effects.exit(types.atxHeading)
      // To do: interrupt like `markdown-rs`.
      // // Feel free to interrupt.
      // tokenizer.interrupt = false
      return ok(code)
    }

    if (markdownSpace(code)) {
      return factorySpace(effects, atBreak, types.whitespace)(code)
    }

    // To do: generate `data` tokens, add the `text` token later.
    // Needs edit map, see: `markdown.rs`.
    effects.enter(types.atxHeadingText)
    return data(code)
  }

  /**
   * In further sequence (after whitespace).
   *
   * Could be normal “visible” hashes in the heading or a final sequence.
   *
   * ```markdown
   * > | ## aa ##
   *           ^
   * ```
   *
   * @type {State}
   */
  function sequenceFurther(code) {
    if (code === codes.numberSign) {
      effects.consume(code)
      return sequenceFurther
    }

    effects.exit(types.atxHeadingSequence)
    return atBreak(code)
  }

  /**
   * In text.
   *
   * ```markdown
   * > | ## aa
   *        ^
   * ```
   *
   * @type {State}
   */
  function data(code) {
    if (
      code === codes.eof ||
      code === codes.numberSign ||
      markdownLineEndingOrSpace(code)
    ) {
      effects.exit(types.atxHeadingText)
      return atBreak(code)
    }

    effects.consume(code)
    return data
  }
}
bǧ	x f/** @type {Construct} */
export const htmlFlow: Construct;
import type { Construct } from 'micromark-util-types';
//# sourceMappingURL=html-flow.d.ts.mapd6κ	x e{"version":3,"file":"html-flow.d.ts","sourceRoot":"","sources":["html-flow.js"],"names":[],"mappings":"AAuBA,wBAAwB;AACxB,uBADW,SAAS,CAMnB;+BArBS,sBAAsB"}B(0б	xN>/**
 * @import {
 *   Code,
 *   Construct,
 *   Resolver,
 *   State,
 *   TokenizeContext,
 *   Tokenizer
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {
  asciiAlphanumeric,
  asciiAlpha,
  markdownLineEndingOrSpace,
  markdownLineEnding,
  markdownSpace
} from 'micromark-util-character'
import {htmlBlockNames, htmlRawNames} from 'micromark-util-html-tag-name'
import {codes, constants, types} from 'micromark-util-symbol'
import {blankLine} from './blank-line.js'

/** @type {Construct} */
export const htmlFlow = {
  concrete: true,
  name: 'htmlFlow',
  resolveTo: resolveToHtmlFlow,
  tokenize: tokenizeHtmlFlow
}

/** @type {Construct} */
const blankLineBefore = {partial: true, tokenize: tokenizeBlankLineBefore}
const nonLazyContinuationStart = {
  partial: true,
  tokenize: tokenizeNonLazyContinuationStart
}

/** @type {Resolver} */
function resolveToHtmlFlow(events) {
  let index = events.length

  while (index--) {
    if (
      events[index][0] === 'enter' &&
      events[index][1].type === types.htmlFlow
    ) {
      break
    }
  }

  if (index > 1 && events[index - 2][1].type === types.linePrefix) {
    // Add the prefix start to the HTML token.
    events[index][1].start = events[index - 2][1].start
    // Add the prefix start to the HTML line token.
    events[index + 1][1].start = events[index - 2][1].start
    // Remove the line prefix.
    events.splice(index - 2, 2)
  }

  return events
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeHtmlFlow(effects, ok, nok) {
  const self = this
  /** @type {number} */
  let marker
  /** @type {boolean} */
  let closingTag
  /** @type {string} */
  let buffer
  /** @type {number} */
  let index
  /** @type {Code} */
  let markerB

  return start

  /**
   * Start of HTML (flow).
   *
   * ```markdown
   * > | <x />
   *     ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    // To do: parse indent like `markdown-rs`.
    return before(code)
  }

  /**
   * At `<`, after optional whitespace.
   *
   * ```markdown
   * > | <x />
   *     ^
   * ```
   *
   * @type {State}
   */
  function before(code) {
    assert(code === codes.lessThan, 'expected `<`')
    effects.enter(types.htmlFlow)
    effects.enter(types.htmlFlowData)
    effects.consume(code)
    return open
  }

  /**
   * After `<`, at tag name or other stuff.
   *
   * ```markdown
   * > | <x />
   *      ^
   * > | <!doctype>
   *      ^
   * > | <!--xxx-->
   *      ^
   * ```
   *
   * @type {State}
   */
  function open(code) {
    if (code === codes.exclamationMark) {
      effects.consume(code)
      return declarationOpen
    }

    if (code === codes.slash) {
      effects.consume(code)
      closingTag = true
      return tagCloseStart
    }

    if (code === codes.questionMark) {
      effects.consume(code)
      marker = constants.htmlInstruction
      // To do:
      // tokenizer.concrete = true
      // To do: use `markdown-rs` style interrupt.
      // While we’re in an instruction instead of a declaration, we’re on a `?`
      // right now, so we do need to search for `>`, similar to declarations.
      return self.interrupt ? ok : continuationDeclarationInside
    }

    // ASCII alphabetical.
    if (asciiAlpha(code)) {
      assert(code !== null) // Always the case.
      effects.consume(code)
      buffer = String.fromCharCode(code)
      return tagName
    }

    return nok(code)
  }

  /**
   * After `<!`, at declaration, comment, or CDATA.
   *
   * ```markdown
   * > | <!doctype>
   *       ^
   * > | <!--xxx-->
   *       ^
   * > | <![CDATA[>&<]]>
   *       ^
   * ```
   *
   * @type {State}
   */
  function declarationOpen(code) {
    if (code === codes.dash) {
      effects.consume(code)
      marker = constants.htmlComment
      return commentOpenInside
    }

    if (code === codes.leftSquareBracket) {
      effects.consume(code)
      marker = constants.htmlCdata
      index = 0
      return cdataOpenInside
    }

    // ASCII alphabetical.
    if (asciiAlpha(code)) {
      effects.consume(code)
      marker = constants.htmlDeclaration
      // // Do not form containers.
      // tokenizer.concrete = true
      return self.interrupt ? ok : continuationDeclarationInside
    }

    return nok(code)
  }

  /**
   * After `<!-`, inside a comment, at another `-`.
   *
   * ```markdown
   * > | <!--xxx-->
   *        ^
   * ```
   *
   * @type {State}
   */
  function commentOpenInside(code) {
    if (code === codes.dash) {
      effects.consume(code)
      // // Do not form containers.
      // tokenizer.concrete = true
      return self.interrupt ? ok : continuationDeclarationInside
    }

    return nok(code)
  }

  /**
   * After `<![`, inside CDATA, expecting `CDATA[`.
   *
   * ```markdown
   * > | <![CDATA[>&<]]>
   *        ^^^^^^
   * ```
   *
   * @type {State}
   */
  function cdataOpenInside(code) {
    const value = constants.cdataOpeningString

    if (code === value.charCodeAt(index++)) {
      effects.consume(code)

      if (index === value.length) {
        // // Do not form containers.
        // tokenizer.concrete = true
        return self.interrupt ? ok : continuation
      }

      return cdataOpenInside
    }

    return nok(code)
  }

  /**
   * After `</`, in closing tag, at tag name.
   *
   * ```markdown
   * > | </x>
   *       ^
   * ```
   *
   * @type {State}
   */
  function tagCloseStart(code) {
    if (asciiAlpha(code)) {
      assert(code !== null) // Always the case.
      effects.consume(code)
      buffer = String.fromCharCode(code)
      return tagName
    }

    return nok(code)
  }

  /**
   * In tag name.
   *
   * ```markdown
   * > | <ab>
   *      ^^
   * > | </ab>
   *       ^^
   * ```
   *
   * @type {State}
   */
  function tagName(code) {
    if (
      code === codes.eof ||
      code === codes.slash ||
      code === codes.greaterThan ||
      markdownLineEndingOrSpace(code)
    ) {
      const slash = code === codes.slash
      const name = buffer.toLowerCase()

      if (!slash && !closingTag && htmlRawNames.includes(name)) {
        marker = constants.htmlRaw
        // // Do not form containers.
        // tokenizer.concrete = true
        return self.interrupt ? ok(code) : continuation(code)
      }

      if (htmlBlockNames.includes(buffer.toLowerCase())) {
        marker = constants.htmlBasic

        if (slash) {
          effects.consume(code)
          return basicSelfClosing
        }

        // // Do not form containers.
        // tokenizer.concrete = true
        return self.interrupt ? ok(code) : continuation(code)
      }

      marker = constants.htmlComplete
      // Do not support complete HTML when interrupting.
      return self.interrupt && !self.parser.lazy[self.now().line]
        ? nok(code)
        : closingTag
          ? completeClosingTagAfter(code)
          : completeAttributeNameBefore(code)
    }

    // ASCII alphanumerical and `-`.
    if (code === codes.dash || asciiAlphanumeric(code)) {
      effects.consume(code)
      buffer += String.fromCharCode(code)
      return tagName
    }

    return nok(code)
  }

  /**
   * After closing slash of a basic tag name.
   *
   * ```markdown
   * > | <div/>
   *          ^
   * ```
   *
   * @type {State}
   */
  function basicSelfClosing(code) {
    if (code === codes.greaterThan) {
      effects.consume(code)
      // // Do not form containers.
      // tokenizer.concrete = true
      return self.interrupt ? ok : continuation
    }

    return nok(code)
  }

  /**
   * After closing slash of a complete tag name.
   *
   * ```markdown
   * > | <x/>
   *        ^
   * ```
   *
   * @type {State}
   */
  function completeClosingTagAfter(code) {
    if (markdownSpace(code)) {
      effects.consume(code)
      return completeClosingTagAfter
    }

    return completeEnd(code)
  }

  /**
   * At an attribute name.
   *
   * At first, this state is used after a complete tag name, after whitespace,
   * where it expects optional attributes or the end of the tag.
   * It is also reused after attributes, when expecting more optional
   * attributes.
   *
   * ```markdown
   * > | <a />
   *        ^
   * > | <a :b>
   *        ^
   * > | <a _b>
   *        ^
   * > | <a b>
   *        ^
   * > | <a >
   *        ^
   * ```
   *
   * @type {State}
   */
  function completeAttributeNameBefore(code) {
    if (code === codes.slash) {
      effects.consume(code)
      return completeEnd
    }

    // ASCII alphanumerical and `:` and `_`.
    if (code === codes.colon || code === codes.underscore || asciiAlpha(code)) {
      effects.consume(code)
      return completeAttributeName
    }

    if (markdownSpace(code)) {
      effects.consume(code)
      return completeAttributeNameBefore
    }

    return completeEnd(code)
  }

  /**
   * In attribute name.
   *
   * ```markdown
   * > | <a :b>
   *         ^
   * > | <a _b>
   *         ^
   * > | <a b>
   *         ^
   * ```
   *
   * @type {State}
   */
  function completeAttributeName(code) {
    // ASCII alphanumerical and `-`, `.`, `:`, and `_`.
    if (
      code === codes.dash ||
      code === codes.dot ||
      code === codes.colon ||
      code === codes.underscore ||
      asciiAlphanumeric(code)
    ) {
      effects.consume(code)
      return completeAttributeName
    }

    return completeAttributeNameAfter(code)
  }

  /**
   * After attribute name, at an optional initializer, the end of the tag, or
   * whitespace.
   *
   * ```markdown
   * > | <a b>
   *         ^
   * > | <a b=c>
   *         ^
   * ```
   *
   * @type {State}
   */
  function completeAttributeNameAfter(code) {
    if (code === codes.equalsTo) {
      effects.consume(code)
      return completeAttributeValueBefore
    }

    if (markdownSpace(code)) {
      effects.consume(code)
      return completeAttributeNameAfter
    }

    return completeAttributeNameBefore(code)
  }

  /**
   * Before unquoted, double quoted, or single quoted attribute value, allowing
   * whitespace.
   *
   * ```markdown
   * > | <a b=c>
   *          ^
   * > | <a b="c">
   *          ^
   * ```
   *
   * @type {State}
   */
  function completeAttributeValueBefore(code) {
    if (
      code === codes.eof ||
      code === codes.lessThan ||
      code === codes.equalsTo ||
      code === codes.greaterThan ||
      code === codes.graveAccent
    ) {
      return nok(code)
    }

    if (code === codes.quotationMark || code === codes.apostrophe) {
      effects.consume(code)
      markerB = code
      return completeAttributeValueQuoted
    }

    if (markdownSpace(code)) {
      effects.consume(code)
      return completeAttributeValueBefore
    }

    return completeAttributeValueUnquoted(code)
  }

  /**
   * In double or single quoted attribute value.
   *
   * ```markdown
   * > | <a b="c">
   *           ^
   * > | <a b='c'>
   *           ^
   * ```
   *
   * @type {State}
   */
  function completeAttributeValueQuoted(code) {
    if (code === markerB) {
      effects.consume(code)
      markerB = null
      return completeAttributeValueQuotedAfter
    }

    if (code === codes.eof || markdownLineEnding(code)) {
      return nok(code)
    }

    effects.consume(code)
    return completeAttributeValueQuoted
  }

  /**
   * In unquoted attribute value.
   *
   * ```markdown
   * > | <a b=c>
   *          ^
   * ```
   *
   * @type {State}
   */
  function completeAttributeValueUnquoted(code) {
    if (
      code === codes.eof ||
      code === codes.quotationMark ||
      code === codes.apostrophe ||
      code === codes.slash ||
      code === codes.lessThan ||
      code === codes.equalsTo ||
      code === codes.greaterThan ||
      code === codes.graveAccent ||
      markdownLineEndingOrSpace(code)
    ) {
      return completeAttributeNameAfter(code)
    }

    effects.consume(code)
    return completeAttributeValueUnquoted
  }

  /**
   * After double or single quoted attribute value, before whitespace or the
   * end of the tag.
   *
   * ```markdown
   * > | <a b="c">
   *            ^
   * ```
   *
   * @type {State}
   */
  function completeAttributeValueQuotedAfter(code) {
    if (
      code === codes.slash ||
      code === codes.greaterThan ||
      markdownSpace(code)
    ) {
      return completeAttributeNameBefore(code)
    }

    return nok(code)
  }

  /**
   * In certain circumstances of a complete tag where only an `>` is allowed.
   *
   * ```markdown
   * > | <a b="c">
   *             ^
   * ```
   *
   * @type {State}
   */
  function completeEnd(code) {
    if (code === codes.greaterThan) {
      effects.consume(code)
      return completeAfter
    }

    return nok(code)
  }

  /**
   * After `>` in a complete tag.
   *
   * ```markdown
   * > | <x>
   *        ^
   * ```
   *
   * @type {State}
   */
  function completeAfter(code) {
    if (code === codes.eof || markdownLineEnding(code)) {
      // // Do not form containers.
      // tokenizer.concrete = true
      return continuation(code)
    }

    if (markdownSpace(code)) {
      effects.consume(code)
      return completeAfter
    }

    return nok(code)
  }

  /**
   * In continuation of any HTML kind.
   *
   * ```markdown
   * > | <!--xxx-->
   *          ^
   * ```
   *
   * @type {State}
   */
  function continuation(code) {
    if (code === codes.dash && marker === constants.htmlComment) {
      effects.consume(code)
      return continuationCommentInside
    }

    if (code === codes.lessThan && marker === constants.htmlRaw) {
      effects.consume(code)
      return continuationRawTagOpen
    }

    if (code === codes.greaterThan && marker === constants.htmlDeclaration) {
      effects.consume(code)
      return continuationClose
    }

    if (code === codes.questionMark && marker === constants.htmlInstruction) {
      effects.consume(code)
      return continuationDeclarationInside
    }

    if (code === codes.rightSquareBracket && marker === constants.htmlCdata) {
      effects.consume(code)
      return continuationCdataInside
    }

    if (
      markdownLineEnding(code) &&
      (marker === constants.htmlBasic || marker === constants.htmlComplete)
    ) {
      effects.exit(types.htmlFlowData)
      return effects.check(
        blankLineBefore,
        continuationAfter,
        continuationStart
      )(code)
    }

    if (code === codes.eof || markdownLineEnding(code)) {
      effects.exit(types.htmlFlowData)
      return continuationStart(code)
    }

    effects.consume(code)
    return continuation
  }

  /**
   * In continuation, at eol.
   *
   * ```markdown
   * > | <x>
   *        ^
   *   | asd
   * ```
   *
   * @type {State}
   */
  function continuationStart(code) {
    return effects.check(
      nonLazyContinuationStart,
      continuationStartNonLazy,
      continuationAfter
    )(code)
  }

  /**
   * In continuation, at eol, before non-lazy content.
   *
   * ```markdown
   * > | <x>
   *        ^
   *   | asd
   * ```
   *
   * @type {State}
   */
  function continuationStartNonLazy(code) {
    assert(markdownLineEnding(code))
    effects.enter(types.lineEnding)
    effects.consume(code)
    effects.exit(types.lineEnding)
    return continuationBefore
  }

  /**
   * In continuation, before non-lazy content.
   *
   * ```markdown
   *   | <x>
   * > | asd
   *     ^
   * ```
   *
   * @type {State}
   */
  function continuationBefore(code) {
    if (code === codes.eof || markdownLineEnding(code)) {
      return continuationStart(code)
    }

    effects.enter(types.htmlFlowData)
    return continuation(code)
  }

  /**
   * In comment continuation, after one `-`, expecting another.
   *
   * ```markdown
   * > | <!--xxx-->
   *             ^
   * ```
   *
   * @type {State}
   */
  function continuationCommentInside(code) {
    if (code === codes.dash) {
      effects.consume(code)
      return continuationDeclarationInside
    }

    return continuation(code)
  }

  /**
   * In raw continuation, after `<`, at `/`.
   *
   * ```markdown
   * > | <script>console.log(1)</script>
   *                            ^
   * ```
   *
   * @type {State}
   */
  function continuationRawTagOpen(code) {
    if (code === codes.slash) {
      effects.consume(code)
      buffer = ''
      return continuationRawEndTag
    }

    return continuation(code)
  }

  /**
   * In raw continuation, after `</`, in a raw tag name.
   *
   * ```markdown
   * > | <script>console.log(1)</script>
   *                             ^^^^^^
   * ```
   *
   * @type {State}
   */
  function continuationRawEndTag(code) {
    if (code === codes.greaterThan) {
      const name = buffer.toLowerCase()

      if (htmlRawNames.includes(name)) {
        effects.consume(code)
        return continuationClose
      }

      return continuation(code)
    }

    if (asciiAlpha(code) && buffer.length < constants.htmlRawSizeMax) {
      assert(code !== null) // Always the case.
      effects.consume(code)
      buffer += String.fromCharCode(code)
      return continuationRawEndTag
    }

    return continuation(code)
  }

  /**
   * In cdata continuation, after `]`, expecting `]>`.
   *
   * ```markdown
   * > | <![CDATA[>&<]]>
   *                  ^
   * ```
   *
   * @type {State}
   */
  function continuationCdataInside(code) {
    if (code === codes.rightSquareBracket) {
      effects.consume(code)
      return continuationDeclarationInside
    }

    return continuation(code)
  }

  /**
   * In declaration or instruction continuation, at `>`.
   *
   * ```markdown
   * > | <!-->
   *         ^
   * > | <?>
   *       ^
   * > | <!q>
   *        ^
   * > | <!--ab-->
   *             ^
   * > | <![CDATA[>&<]]>
   *                   ^
   * ```
   *
   * @type {State}
   */
  function continuationDeclarationInside(code) {
    if (code === codes.greaterThan) {
      effects.consume(code)
      return continuationClose
    }

    // More dashes.
    if (code === codes.dash && marker === constants.htmlComment) {
      effects.consume(code)
      return continuationDeclarationInside
    }

    return continuation(code)
  }

  /**
   * In closed continuation: everything we get until the eol/eof is part of it.
   *
   * ```markdown
   * > | <!doctype>
   *               ^
   * ```
   *
   * @type {State}
   */
  function continuationClose(code) {
    if (code === codes.eof || markdownLineEnding(code)) {
      effects.exit(types.htmlFlowData)
      return continuationAfter(code)
    }

    effects.consume(code)
    return continuationClose
  }

  /**
   * Done.
   *
   * ```markdown
   * > | <!doctype>
   *               ^
   * ```
   *
   * @type {State}
   */
  function continuationAfter(code) {
    effects.exit(types.htmlFlow)
    // // Feel free to interrupt.
    // tokenizer.interrupt = false
    // // No longer concrete.
    // tokenizer.concrete = false
    return ok(code)
  }
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeNonLazyContinuationStart(effects, ok, nok) {
  const self = this

  return start

  /**
   * At eol, before continuation.
   *
   * ```markdown
   * > | * ```js
   *            ^
   *   | b
   * ```
   *
   * @type {State}
   */
  function start(code) {
    if (markdownLineEnding(code)) {
      effects.enter(types.lineEnding)
      effects.consume(code)
      effects.exit(types.lineEnding)
      return after
    }

    return nok(code)
  }

  /**
   * A continuation.
   *
   * ```markdown
   *   | * ```js
   * > | b
   *     ^
   * ```
   *
   * @type {State}
   */
  function after(code) {
    return self.parser.lazy[self.now().line] ? nok(code) : ok(code)
  }
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeBlankLineBefore(effects, ok, nok) {
  return start

  /**
   * Before eol, expecting blank line.
   *
   * ```markdown
   * > | <div>
   *          ^
   *   |
   * ```
   *
   * @type {State}
   */
  function start(code) {
    assert(markdownLineEnding(code), 'expected a line ending')
    effects.enter(types.lineEnding)
    effects.consume(code)
    effects.exit(types.lineEnding)
    return effects.attempt(blankLine, ok, nok)
  }
}
-~d	x f/** @type {Construct} */
export const htmlText: Construct;
import type { Construct } from 'micromark-util-types';
//# sourceMappingURL=html-text.d.ts.mapj[6	x e{"version":3,"file":"html-text.d.ts","sourceRoot":"","sources":["html-text.js"],"names":[],"mappings":"AAqBA,wBAAwB;AACxB,uBADW,SAAS,CACkD;+BAf5D,sBAAsB"}I0x"9/**
 * @import {
 *   Code,
 *   Construct,
 *   State,
 *   TokenizeContext,
 *   Tokenizer
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {factorySpace} from 'micromark-factory-space'
import {
  asciiAlphanumeric,
  asciiAlpha,
  markdownLineEndingOrSpace,
  markdownLineEnding,
  markdownSpace
} from 'micromark-util-character'
import {codes, constants, types} from 'micromark-util-symbol'

/** @type {Construct} */
export const htmlText = {name: 'htmlText', tokenize: tokenizeHtmlText}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeHtmlText(effects, ok, nok) {
  const self = this
  /** @type {NonNullable<Code> | undefined} */
  let marker
  /** @type {number} */
  let index
  /** @type {State} */
  let returnState

  return start

  /**
   * Start of HTML (text).
   *
   * ```markdown
   * > | a <b> c
   *       ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    assert(code === codes.lessThan, 'expected `<`')
    effects.enter(types.htmlText)
    effects.enter(types.htmlTextData)
    effects.consume(code)
    return open
  }

  /**
   * After `<`, at tag name or other stuff.
   *
   * ```markdown
   * > | a <b> c
   *        ^
   * > | a <!doctype> c
   *        ^
   * > | a <!--b--> c
   *        ^
   * ```
   *
   * @type {State}
   */
  function open(code) {
    if (code === codes.exclamationMark) {
      effects.consume(code)
      return declarationOpen
    }

    if (code === codes.slash) {
      effects.consume(code)
      return tagCloseStart
    }

    if (code === codes.questionMark) {
      effects.consume(code)
      return instruction
    }

    // ASCII alphabetical.
    if (asciiAlpha(code)) {
      effects.consume(code)
      return tagOpen
    }

    return nok(code)
  }

  /**
   * After `<!`, at declaration, comment, or CDATA.
   *
   * ```markdown
   * > | a <!doctype> c
   *         ^
   * > | a <!--b--> c
   *         ^
   * > | a <![CDATA[>&<]]> c
   *         ^
   * ```
   *
   * @type {State}
   */
  function declarationOpen(code) {
    if (code === codes.dash) {
      effects.consume(code)
      return commentOpenInside
    }

    if (code === codes.leftSquareBracket) {
      effects.consume(code)
      index = 0
      return cdataOpenInside
    }

    if (asciiAlpha(code)) {
      effects.consume(code)
      return declaration
    }

    return nok(code)
  }

  /**
   * In a comment, after `<!-`, at another `-`.
   *
   * ```markdown
   * > | a <!--b--> c
   *          ^
   * ```
   *
   * @type {State}
   */
  function commentOpenInside(code) {
    if (code === codes.dash) {
      effects.consume(code)
      return commentEnd
    }

    return nok(code)
  }

  /**
   * In comment.
   *
   * ```markdown
   * > | a <!--b--> c
   *           ^
   * ```
   *
   * @type {State}
   */
  function comment(code) {
    if (code === codes.eof) {
      return nok(code)
    }

    if (code === codes.dash) {
      effects.consume(code)
      return commentClose
    }

    if (markdownLineEnding(code)) {
      returnState = comment
      return lineEndingBefore(code)
    }

    effects.consume(code)
    return comment
  }

  /**
   * In comment, after `-`.
   *
   * ```markdown
   * > | a <!--b--> c
   *             ^
   * ```
   *
   * @type {State}
   */
  function commentClose(code) {
    if (code === codes.dash) {
      effects.consume(code)
      return commentEnd
    }

    return comment(code)
  }

  /**
   * In comment, after `--`.
   *
   * ```markdown
   * > | a <!--b--> c
   *              ^
   * ```
   *
   * @type {State}
   */
  function commentEnd(code) {
    return code === codes.greaterThan
      ? end(code)
      : code === codes.dash
        ? commentClose(code)
        : comment(code)
  }

  /**
   * After `<![`, in CDATA, expecting `CDATA[`.
   *
   * ```markdown
   * > | a <![CDATA[>&<]]> b
   *          ^^^^^^
   * ```
   *
   * @type {State}
   */
  function cdataOpenInside(code) {
    const value = constants.cdataOpeningString

    if (code === value.charCodeAt(index++)) {
      effects.consume(code)
      return index === value.length ? cdata : cdataOpenInside
    }

    return nok(code)
  }

  /**
   * In CDATA.
   *
   * ```markdown
   * > | a <![CDATA[>&<]]> b
   *                ^^^
   * ```
   *
   * @type {State}
   */
  function cdata(code) {
    if (code === codes.eof) {
      return nok(code)
    }

    if (code === codes.rightSquareBracket) {
      effects.consume(code)
      return cdataClose
    }

    if (markdownLineEnding(code)) {
      returnState = cdata
      return lineEndingBefore(code)
    }

    effects.consume(code)
    return cdata
  }

  /**
   * In CDATA, after `]`, at another `]`.
   *
   * ```markdown
   * > | a <![CDATA[>&<]]> b
   *                    ^
   * ```
   *
   * @type {State}
   */
  function cdataClose(code) {
    if (code === codes.rightSquareBracket) {
      effects.consume(code)
      return cdataEnd
    }

    return cdata(code)
  }

  /**
   * In CDATA, after `]]`, at `>`.
   *
   * ```markdown
   * > | a <![CDATA[>&<]]> b
   *                     ^
   * ```
   *
   * @type {State}
   */
  function cdataEnd(code) {
    if (code === codes.greaterThan) {
      return end(code)
    }

    if (code === codes.rightSquareBracket) {
      effects.consume(code)
      return cdataEnd
    }

    return cdata(code)
  }

  /**
   * In declaration.
   *
   * ```markdown
   * > | a <!b> c
   *          ^
   * ```
   *
   * @type {State}
   */
  function declaration(code) {
    if (code === codes.eof || code === codes.greaterThan) {
      return end(code)
    }

    if (markdownLineEnding(code)) {
      returnState = declaration
      return lineEndingBefore(code)
    }

    effects.consume(code)
    return declaration
  }

  /**
   * In instruction.
   *
   * ```markdown
   * > | a <?b?> c
   *         ^
   * ```
   *
   * @type {State}
   */
  function instruction(code) {
    if (code === codes.eof) {
      return nok(code)
    }

    if (code === codes.questionMark) {
      effects.consume(code)
      return instructionClose
    }

    if (markdownLineEnding(code)) {
      returnState = instruction
      return lineEndingBefore(code)
    }

    effects.consume(code)
    return instruction
  }

  /**
   * In instruction, after `?`, at `>`.
   *
   * ```markdown
   * > | a <?b?> c
   *           ^
   * ```
   *
   * @type {State}
   */
  function instructionClose(code) {
    return code === codes.greaterThan ? end(code) : instruction(code)
  }

  /**
   * After `</`, in closing tag, at tag name.
   *
   * ```markdown
   * > | a </b> c
   *         ^
   * ```
   *
   * @type {State}
   */
  function tagCloseStart(code) {
    // ASCII alphabetical.
    if (asciiAlpha(code)) {
      effects.consume(code)
      return tagClose
    }

    return nok(code)
  }

  /**
   * After `</x`, in a tag name.
   *
   * ```markdown
   * > | a </b> c
   *          ^
   * ```
   *
   * @type {State}
   */
  function tagClose(code) {
    // ASCII alphanumerical and `-`.
    if (code === codes.dash || asciiAlphanumeric(code)) {
      effects.consume(code)
      return tagClose
    }

    return tagCloseBetween(code)
  }

  /**
   * In closing tag, after tag name.
   *
   * ```markdown
   * > | a </b> c
   *          ^
   * ```
   *
   * @type {State}
   */
  function tagCloseBetween(code) {
    if (markdownLineEnding(code)) {
      returnState = tagCloseBetween
      return lineEndingBefore(code)
    }

    if (markdownSpace(code)) {
      effects.consume(code)
      return tagCloseBetween
    }

    return end(code)
  }

  /**
   * After `<x`, in opening tag name.
   *
   * ```markdown
   * > | a <b> c
   *         ^
   * ```
   *
   * @type {State}
   */
  function tagOpen(code) {
    // ASCII alphanumerical and `-`.
    if (code === codes.dash || asciiAlphanumeric(code)) {
      effects.consume(code)
      return tagOpen
    }

    if (
      code === codes.slash ||
      code === codes.greaterThan ||
      markdownLineEndingOrSpace(code)
    ) {
      return tagOpenBetween(code)
    }

    return nok(code)
  }

  /**
   * In opening tag, after tag name.
   *
   * ```markdown
   * > | a <b> c
   *         ^
   * ```
   *
   * @type {State}
   */
  function tagOpenBetween(code) {
    if (code === codes.slash) {
      effects.consume(code)
      return end
    }

    // ASCII alphabetical and `:` and `_`.
    if (code === codes.colon || code === codes.underscore || asciiAlpha(code)) {
      effects.consume(code)
      return tagOpenAttributeName
    }

    if (markdownLineEnding(code)) {
      returnState = tagOpenBetween
      return lineEndingBefore(code)
    }

    if (markdownSpace(code)) {
      effects.consume(code)
      return tagOpenBetween
    }

    return end(code)
  }

  /**
   * In attribute name.
   *
   * ```markdown
   * > | a <b c> d
   *          ^
   * ```
   *
   * @type {State}
   */
  function tagOpenAttributeName(code) {
    // ASCII alphabetical and `-`, `.`, `:`, and `_`.
    if (
      code === codes.dash ||
      code === codes.dot ||
      code === codes.colon ||
      code === codes.underscore ||
      asciiAlphanumeric(code)
    ) {
      effects.consume(code)
      return tagOpenAttributeName
    }

    return tagOpenAttributeNameAfter(code)
  }

  /**
   * After attribute name, before initializer, the end of the tag, or
   * whitespace.
   *
   * ```markdown
   * > | a <b c> d
   *           ^
   * ```
   *
   * @type {State}
   */
  function tagOpenAttributeNameAfter(code) {
    if (code === codes.equalsTo) {
      effects.consume(code)
      return tagOpenAttributeValueBefore
    }

    if (markdownLineEnding(code)) {
      returnState = tagOpenAttributeNameAfter
      return lineEndingBefore(code)
    }

    if (markdownSpace(code)) {
      effects.consume(code)
      return tagOpenAttributeNameAfter
    }

    return tagOpenBetween(code)
  }

  /**
   * Before unquoted, double quoted, or single quoted attribute value, allowing
   * whitespace.
   *
   * ```markdown
   * > | a <b c=d> e
   *            ^
   * ```
   *
   * @type {State}
   */
  function tagOpenAttributeValueBefore(code) {
    if (
      code === codes.eof ||
      code === codes.lessThan ||
      code === codes.equalsTo ||
      code === codes.greaterThan ||
      code === codes.graveAccent
    ) {
      return nok(code)
    }

    if (code === codes.quotationMark || code === codes.apostrophe) {
      effects.consume(code)
      marker = code
      return tagOpenAttributeValueQuoted
    }

    if (markdownLineEnding(code)) {
      returnState = tagOpenAttributeValueBefore
      return lineEndingBefore(code)
    }

    if (markdownSpace(code)) {
      effects.consume(code)
      return tagOpenAttributeValueBefore
    }

    effects.consume(code)
    return tagOpenAttributeValueUnquoted
  }

  /**
   * In double or single quoted attribute value.
   *
   * ```markdown
   * > | a <b c="d"> e
   *             ^
   * ```
   *
   * @type {State}
   */
  function tagOpenAttributeValueQuoted(code) {
    if (code === marker) {
      effects.consume(code)
      marker = undefined
      return tagOpenAttributeValueQuotedAfter
    }

    if (code === codes.eof) {
      return nok(code)
    }

    if (markdownLineEnding(code)) {
      returnState = tagOpenAttributeValueQuoted
      return lineEndingBefore(code)
    }

    effects.consume(code)
    return tagOpenAttributeValueQuoted
  }

  /**
   * In unquoted attribute value.
   *
   * ```markdown
   * > | a <b c=d> e
   *            ^
   * ```
   *
   * @type {State}
   */
  function tagOpenAttributeValueUnquoted(code) {
    if (
      code === codes.eof ||
      code === codes.quotationMark ||
      code === codes.apostrophe ||
      code === codes.lessThan ||
      code === codes.equalsTo ||
      code === codes.graveAccent
    ) {
      return nok(code)
    }

    if (
      code === codes.slash ||
      code === codes.greaterThan ||
      markdownLineEndingOrSpace(code)
    ) {
      return tagOpenBetween(code)
    }

    effects.consume(code)
    return tagOpenAttributeValueUnquoted
  }

  /**
   * After double or single quoted attribute value, before whitespace or the end
   * of the tag.
   *
   * ```markdown
   * > | a <b c="d"> e
   *               ^
   * ```
   *
   * @type {State}
   */
  function tagOpenAttributeValueQuotedAfter(code) {
    if (
      code === codes.slash ||
      code === codes.greaterThan ||
      markdownLineEndingOrSpace(code)
    ) {
      return tagOpenBetween(code)
    }

    return nok(code)
  }

  /**
   * In certain circumstances of a tag where only an `>` is allowed.
   *
   * ```markdown
   * > | a <b c="d"> e
   *               ^
   * ```
   *
   * @type {State}
   */
  function end(code) {
    if (code === codes.greaterThan) {
      effects.consume(code)
      effects.exit(types.htmlTextData)
      effects.exit(types.htmlText)
      return ok
    }

    return nok(code)
  }

  /**
   * At eol.
   *
   * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about
   * > empty tokens.
   *
   * ```markdown
   * > | a <!--a
   *            ^
   *   | b-->
   * ```
   *
   * @type {State}
   */
  function lineEndingBefore(code) {
    assert(returnState, 'expected return state')
    assert(markdownLineEnding(code), 'expected eol')
    effects.exit(types.htmlTextData)
    effects.enter(types.lineEnding)
    effects.consume(code)
    effects.exit(types.lineEnding)
    return lineEndingAfter
  }

  /**
   * After eol, at optional whitespace.
   *
   * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about
   * > empty tokens.
   *
   * ```markdown
   *   | a <!--a
   * > | b-->
   *     ^
   * ```
   *
   * @type {State}
   */
  function lineEndingAfter(code) {
    // Always populated by defaults.
    assert(
      self.parser.constructs.disable.null,
      'expected `disable.null` to be populated'
    )
    return markdownSpace(code)
      ? factorySpace(
          effects,
          lineEndingAfterPrefix,
          types.linePrefix,
          self.parser.constructs.disable.null.includes('codeIndented')
            ? undefined
            : constants.tabSize
        )(code)
      : lineEndingAfterPrefix(code)
  }

  /**
   * After eol, after optional whitespace.
   *
   * > 👉 **Note**: we can’t have blank lines in text, so no need to worry about
   * > empty tokens.
   *
   * ```markdown
   *   | a <!--a
   * > | b-->
   *     ^
   * ```
   *
   * @type {State}
   */
  function lineEndingAfterPrefix(code) {
    effects.enter(types.htmlTextData)
    return returnState(code)
  }
}
r5	x f/** @type {Construct} */
export const labelEnd: Construct;
import type { Construct } from 'micromark-util-types';
//# sourceMappingURL=label-end.d.ts.mapJ!6b	x e{"version":3,"file":"label-end.d.ts","sourceRoot":"","sources":["label-end.js"],"names":[],"mappings":"AAuBA,wBAAwB;AACxB,uBADW,SAAS,CAMnB;+BApBS,sBAAsB"}0bx6Y/**
 * @import {
 *   Construct,
 *   Event,
 *   Resolver,
 *   State,
 *   TokenizeContext,
 *   Tokenizer,
 *   Token
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {factoryDestination} from 'micromark-factory-destination'
import {factoryLabel} from 'micromark-factory-label'
import {factoryTitle} from 'micromark-factory-title'
import {factoryWhitespace} from 'micromark-factory-whitespace'
import {markdownLineEndingOrSpace} from 'micromark-util-character'
import {push, splice} from 'micromark-util-chunked'
import {normalizeIdentifier} from 'micromark-util-normalize-identifier'
import {resolveAll} from 'micromark-util-resolve-all'
import {codes, constants, types} from 'micromark-util-symbol'

/** @type {Construct} */
export const labelEnd = {
  name: 'labelEnd',
  resolveAll: resolveAllLabelEnd,
  resolveTo: resolveToLabelEnd,
  tokenize: tokenizeLabelEnd
}

/** @type {Construct} */
const resourceConstruct = {tokenize: tokenizeResource}
/** @type {Construct} */
const referenceFullConstruct = {tokenize: tokenizeReferenceFull}
/** @type {Construct} */
const referenceCollapsedConstruct = {tokenize: tokenizeReferenceCollapsed}

/** @type {Resolver} */
function resolveAllLabelEnd(events) {
  let index = -1
  /** @type {Array<Event>} */
  const newEvents = []
  while (++index < events.length) {
    const token = events[index][1]
    newEvents.push(events[index])

    if (
      token.type === types.labelImage ||
      token.type === types.labelLink ||
      token.type === types.labelEnd
    ) {
      // Remove the marker.
      const offset = token.type === types.labelImage ? 4 : 2
      token.type = types.data
      index += offset
    }
  }

  // If the events are equal, we don't have to copy newEvents to events
  if (events.length !== newEvents.length) {
    splice(events, 0, events.length, newEvents)
  }

  return events
}

/** @type {Resolver} */
function resolveToLabelEnd(events, context) {
  let index = events.length
  let offset = 0
  /** @type {Token} */
  let token
  /** @type {number | undefined} */
  let open
  /** @type {number | undefined} */
  let close
  /** @type {Array<Event>} */
  let media

  // Find an opening.
  while (index--) {
    token = events[index][1]

    if (open) {
      // If we see another link, or inactive link label, we’ve been here before.
      if (
        token.type === types.link ||
        (token.type === types.labelLink && token._inactive)
      ) {
        break
      }

      // Mark other link openings as inactive, as we can’t have links in
      // links.
      if (events[index][0] === 'enter' && token.type === types.labelLink) {
        token._inactive = true
      }
    } else if (close) {
      if (
        events[index][0] === 'enter' &&
        (token.type === types.labelImage || token.type === types.labelLink) &&
        !token._balanced
      ) {
        open = index

        if (token.type !== types.labelLink) {
          offset = 2
          break
        }
      }
    } else if (token.type === types.labelEnd) {
      close = index
    }
  }

  assert(open !== undefined, '`open` is supposed to be found')
  assert(close !== undefined, '`close` is supposed to be found')

  const group = {
    type: events[open][1].type === types.labelLink ? types.link : types.image,
    start: {...events[open][1].start},
    end: {...events[events.length - 1][1].end}
  }

  const label = {
    type: types.label,
    start: {...events[open][1].start},
    end: {...events[close][1].end}
  }

  const text = {
    type: types.labelText,
    start: {...events[open + offset + 2][1].end},
    end: {...events[close - 2][1].start}
  }

  media = [
    ['enter', group, context],
    ['enter', label, context]
  ]

  // Opening marker.
  media = push(media, events.slice(open + 1, open + offset + 3))

  // Text open.
  media = push(media, [['enter', text, context]])

  // Always populated by defaults.
  assert(
    context.parser.constructs.insideSpan.null,
    'expected `insideSpan.null` to be populated'
  )
  // Between.
  media = push(
    media,
    resolveAll(
      context.parser.constructs.insideSpan.null,
      events.slice(open + offset + 4, close - 3),
      context
    )
  )

  // Text close, marker close, label close.
  media = push(media, [
    ['exit', text, context],
    events[close - 2],
    events[close - 1],
    ['exit', label, context]
  ])

  // Reference, resource, or so.
  media = push(media, events.slice(close + 1))

  // Media close.
  media = push(media, [['exit', group, context]])

  splice(events, open, events.length, media)

  return events
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeLabelEnd(effects, ok, nok) {
  const self = this
  let index = self.events.length
  /** @type {Token} */
  let labelStart
  /** @type {boolean} */
  let defined

  // Find an opening.
  while (index--) {
    if (
      (self.events[index][1].type === types.labelImage ||
        self.events[index][1].type === types.labelLink) &&
      !self.events[index][1]._balanced
    ) {
      labelStart = self.events[index][1]
      break
    }
  }

  return start

  /**
   * Start of label end.
   *
   * ```markdown
   * > | [a](b) c
   *       ^
   * > | [a][b] c
   *       ^
   * > | [a][] b
   *       ^
   * > | [a] b
   * ```
   *
   * @type {State}
   */
  function start(code) {
    assert(code === codes.rightSquareBracket, 'expected `]`')

    // If there is not an okay opening.
    if (!labelStart) {
      return nok(code)
    }

    // If the corresponding label (link) start is marked as inactive,
    // it means we’d be wrapping a link, like this:
    //
    // ```markdown
    // > | a [b [c](d) e](f) g.
    //                  ^
    // ```
    //
    // We can’t have that, so it’s just balanced brackets.
    if (labelStart._inactive) {
      return labelEndNok(code)
    }

    defined = self.parser.defined.includes(
      normalizeIdentifier(
        self.sliceSerialize({start: labelStart.end, end: self.now()})
      )
    )
    effects.enter(types.labelEnd)
    effects.enter(types.labelMarker)
    effects.consume(code)
    effects.exit(types.labelMarker)
    effects.exit(types.labelEnd)
    return after
  }

  /**
   * After `]`.
   *
   * ```markdown
   * > | [a](b) c
   *       ^
   * > | [a][b] c
   *       ^
   * > | [a][] b
   *       ^
   * > | [a] b
   *       ^
   * ```
   *
   * @type {State}
   */
  function after(code) {
    // Note: `markdown-rs` also parses GFM footnotes here, which for us is in
    // an extension.

    // Resource (`[asd](fgh)`)?
    if (code === codes.leftParenthesis) {
      return effects.attempt(
        resourceConstruct,
        labelEndOk,
        defined ? labelEndOk : labelEndNok
      )(code)
    }

    // Full (`[asd][fgh]`) or collapsed (`[asd][]`) reference?
    if (code === codes.leftSquareBracket) {
      return effects.attempt(
        referenceFullConstruct,
        labelEndOk,
        defined ? referenceNotFull : labelEndNok
      )(code)
    }

    // Shortcut (`[asd]`) reference?
    return defined ? labelEndOk(code) : labelEndNok(code)
  }

  /**
   * After `]`, at `[`, but not at a full reference.
   *
   * > 👉 **Note**: we only get here if the label is defined.
   *
   * ```markdown
   * > | [a][] b
   *        ^
   * > | [a] b
   *        ^
   * ```
   *
   * @type {State}
   */
  function referenceNotFull(code) {
    return effects.attempt(
      referenceCollapsedConstruct,
      labelEndOk,
      labelEndNok
    )(code)
  }

  /**
   * Done, we found something.
   *
   * ```markdown
   * > | [a](b) c
   *           ^
   * > | [a][b] c
   *           ^
   * > | [a][] b
   *          ^
   * > | [a] b
   *        ^
   * ```
   *
   * @type {State}
   */
  function labelEndOk(code) {
    // Note: `markdown-rs` does a bunch of stuff here.
    return ok(code)
  }

  /**
   * Done, it’s nothing.
   *
   * There was an okay opening, but we didn’t match anything.
   *
   * ```markdown
   * > | [a](b c
   *        ^
   * > | [a][b c
   *        ^
   * > | [a] b
   *        ^
   * ```
   *
   * @type {State}
   */
  function labelEndNok(code) {
    labelStart._balanced = true
    return nok(code)
  }
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeResource(effects, ok, nok) {
  return resourceStart

  /**
   * At a resource.
   *
   * ```markdown
   * > | [a](b) c
   *        ^
   * ```
   *
   * @type {State}
   */
  function resourceStart(code) {
    assert(code === codes.leftParenthesis, 'expected left paren')
    effects.enter(types.resource)
    effects.enter(types.resourceMarker)
    effects.consume(code)
    effects.exit(types.resourceMarker)
    return resourceBefore
  }

  /**
   * In resource, after `(`, at optional whitespace.
   *
   * ```markdown
   * > | [a](b) c
   *         ^
   * ```
   *
   * @type {State}
   */
  function resourceBefore(code) {
    return markdownLineEndingOrSpace(code)
      ? factoryWhitespace(effects, resourceOpen)(code)
      : resourceOpen(code)
  }

  /**
   * In resource, after optional whitespace, at `)` or a destination.
   *
   * ```markdown
   * > | [a](b) c
   *         ^
   * ```
   *
   * @type {State}
   */
  function resourceOpen(code) {
    if (code === codes.rightParenthesis) {
      return resourceEnd(code)
    }

    return factoryDestination(
      effects,
      resourceDestinationAfter,
      resourceDestinationMissing,
      types.resourceDestination,
      types.resourceDestinationLiteral,
      types.resourceDestinationLiteralMarker,
      types.resourceDestinationRaw,
      types.resourceDestinationString,
      constants.linkResourceDestinationBalanceMax
    )(code)
  }

  /**
   * In resource, after destination, at optional whitespace.
   *
   * ```markdown
   * > | [a](b) c
   *          ^
   * ```
   *
   * @type {State}
   */
  function resourceDestinationAfter(code) {
    return markdownLineEndingOrSpace(code)
      ? factoryWhitespace(effects, resourceBetween)(code)
      : resourceEnd(code)
  }

  /**
   * At invalid destination.
   *
   * ```markdown
   * > | [a](<<) b
   *         ^
   * ```
   *
   * @type {State}
   */
  function resourceDestinationMissing(code) {
    return nok(code)
  }

  /**
   * In resource, after destination and whitespace, at `(` or title.
   *
   * ```markdown
   * > | [a](b ) c
   *           ^
   * ```
   *
   * @type {State}
   */
  function resourceBetween(code) {
    if (
      code === codes.quotationMark ||
      code === codes.apostrophe ||
      code === codes.leftParenthesis
    ) {
      return factoryTitle(
        effects,
        resourceTitleAfter,
        nok,
        types.resourceTitle,
        types.resourceTitleMarker,
        types.resourceTitleString
      )(code)
    }

    return resourceEnd(code)
  }

  /**
   * In resource, after title, at optional whitespace.
   *
   * ```markdown
   * > | [a](b "c") d
   *              ^
   * ```
   *
   * @type {State}
   */
  function resourceTitleAfter(code) {
    return markdownLineEndingOrSpace(code)
      ? factoryWhitespace(effects, resourceEnd)(code)
      : resourceEnd(code)
  }

  /**
   * In resource, at `)`.
   *
   * ```markdown
   * > | [a](b) d
   *          ^
   * ```
   *
   * @type {State}
   */
  function resourceEnd(code) {
    if (code === codes.rightParenthesis) {
      effects.enter(types.resourceMarker)
      effects.consume(code)
      effects.exit(types.resourceMarker)
      effects.exit(types.resource)
      return ok
    }

    return nok(code)
  }
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeReferenceFull(effects, ok, nok) {
  const self = this

  return referenceFull

  /**
   * In a reference (full), at the `[`.
   *
   * ```markdown
   * > | [a][b] d
   *        ^
   * ```
   *
   * @type {State}
   */
  function referenceFull(code) {
    assert(code === codes.leftSquareBracket, 'expected left bracket')
    return factoryLabel.call(
      self,
      effects,
      referenceFullAfter,
      referenceFullMissing,
      types.reference,
      types.referenceMarker,
      types.referenceString
    )(code)
  }

  /**
   * In a reference (full), after `]`.
   *
   * ```markdown
   * > | [a][b] d
   *          ^
   * ```
   *
   * @type {State}
   */
  function referenceFullAfter(code) {
    return self.parser.defined.includes(
      normalizeIdentifier(
        self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1)
      )
    )
      ? ok(code)
      : nok(code)
  }

  /**
   * In reference (full) that was missing.
   *
   * ```markdown
   * > | [a][b d
   *        ^
   * ```
   *
   * @type {State}
   */
  function referenceFullMissing(code) {
    return nok(code)
  }
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeReferenceCollapsed(effects, ok, nok) {
  return referenceCollapsedStart

  /**
   * In reference (collapsed), at `[`.
   *
   * > 👉 **Note**: we only get here if the label is defined.
   *
   * ```markdown
   * > | [a][] d
   *        ^
   * ```
   *
   * @type {State}
   */
  function referenceCollapsedStart(code) {
    // We only attempt a collapsed label if there’s a `[`.
    assert(code === codes.leftSquareBracket, 'expected left bracket')
    effects.enter(types.reference)
    effects.enter(types.referenceMarker)
    effects.consume(code)
    effects.exit(types.referenceMarker)
    return referenceCollapsedOpen
  }

  /**
   * In reference (collapsed), at `]`.
   *
   * > 👉 **Note**: we only get here if the label is defined.
   *
   * ```markdown
   * > | [a][] d
   *         ^
   * ```
   *
   *  @type {State}
   */
  function referenceCollapsedOpen(code) {
    if (code === codes.rightSquareBracket) {
      effects.enter(types.referenceMarker)
      effects.consume(code)
      effects.exit(types.referenceMarker)
      effects.exit(types.reference)
      return ok
    }

    return nok(code)
  }
}
x) +
StartImage._start-image.d.ts.map.
x W{"version":3,"file":"label-start-image.d.ts","sourceRoot":"","sources":["label-start-image.js"],"names":[],"mappings":"AAaA,wBAAwB;AACxB,8BADW,SAAS,CAKnB;+BAZS,sBAAsB"}k5ôxd/**
 * @import {
 *   Construct,
 *   State,
 *   TokenizeContext,
 *   Tokenizer
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {codes, types} from 'micromark-util-symbol'
import {labelEnd} from './label-end.js'

/** @type {Construct} */
export const labelStartImage = {
  name: 'labelStartImage',
  resolveAll: labelEnd.resolveAll,
  tokenize: tokenizeLabelStartImage
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeLabelStartImage(effects, ok, nok) {
  const self = this

  return start

  /**
   * Start of label (image) start.
   *
   * ```markdown
   * > | a ![b] c
   *       ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    assert(code === codes.exclamationMark, 'expected `!`')
    effects.enter(types.labelImage)
    effects.enter(types.labelImageMarker)
    effects.consume(code)
    effects.exit(types.labelImageMarker)
    return open
  }

  /**
   * After `!`, at `[`.
   *
   * ```markdown
   * > | a ![b] c
   *        ^
   * ```
   *
   * @type {State}
   */
  function open(code) {
    if (code === codes.leftSquareBracket) {
      effects.enter(types.labelMarker)
      effects.consume(code)
      effects.exit(types.labelMarker)
      effects.exit(types.labelImage)
      return after
    }

    return nok(code)
  }

  /**
   * After `![`.
   *
   * ```markdown
   * > | a ![b] c
   *         ^
   * ```
   *
   * This is needed in because, when GFM footnotes are enabled, images never
   * form when started with a `^`.
   * Instead, links form:
   *
   * ```markdown
   * ![^a](b)
   *
   * ![^a][b]
   *
   * [b]: c
   * ```
   *
   * ```html
   * <p>!<a href=\"b\">^a</a></p>
   * <p>!<a href=\"c\">^a</a></p>
   * ```
   *
   * @type {State}
   */
  function after(code) {
    // To do: use a new field to do this, this is still needed for
    // `micromark-extension-gfm-footnote`, but the `label-start-link`
    // behavior isn’t.
    // Hidden footnotes hook.
    /* c8 ignore next 3 */
    return code === codes.caret &&
      '_hiddenFootnoteSupport' in self.parser.constructs
      ? nok(code)
      : ok(code)
  }
}
"Wx/ &labelStartL+\label-start-link.d.ts.map*ֶ
x Y{"version":3,"file":"label-start-link.d.ts","sourceRoot":"","sources":["label-start-link.js"],"names":[],"mappings":"AAaA,wBAAwB;AACxB,6BADW,SAAS,CAKnB;+BAZS,sBAAsB"}5Qx/**
 * @import {
 *   Construct,
 *   State,
 *   TokenizeContext,
 *   Tokenizer
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {codes, types} from 'micromark-util-symbol'
import {labelEnd} from './label-end.js'

/** @type {Construct} */
export const labelStartLink = {
  name: 'labelStartLink',
  resolveAll: labelEnd.resolveAll,
  tokenize: tokenizeLabelStartLink
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeLabelStartLink(effects, ok, nok) {
  const self = this

  return start

  /**
   * Start of label (link) start.
   *
   * ```markdown
   * > | a [b] c
   *       ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    assert(code === codes.leftSquareBracket, 'expected `[`')
    effects.enter(types.labelLink)
    effects.enter(types.labelMarker)
    effects.consume(code)
    effects.exit(types.labelMarker)
    effects.exit(types.labelLink)
    return after
  }

  /** @type {State} */
  function after(code) {
    // To do: this isn’t needed in `micromark-extension-gfm-footnote`,
    // remove.
    // Hidden footnotes hook.
    /* c8 ignore next 3 */
    return code === codes.caret &&
      '_hiddenFootnoteSupport' in self.parser.constructs
      ? nok(code)
      : ok(code)
  }
}
	x b/** @type {Construct} */
export const lineEnding: Construct;
import type { Construct } from 'micromark-util-types';
//# sourceMappingURL=line-ending.d.ts.map>}8.	x b{"version":3,"file":"line-ending.d.ts","sourceRoot":"","sources":["line-ending.js"],"names":[],"mappings":"AAcA,wBAAwB;AACxB,yBADW,SAAS,CACwD;+BATlE,sBAAsB"}B1ߵ2x%/**
 * @import {
 *   Construct,
 *   State,
 *   TokenizeContext,
 *   Tokenizer
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {factorySpace} from 'micromark-factory-space'
import {markdownLineEnding} from 'micromark-util-character'
import {types} from 'micromark-util-symbol'

/** @type {Construct} */
export const lineEnding = {name: 'lineEnding', tokenize: tokenizeLineEnding}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeLineEnding(effects, ok) {
  return start

  /** @type {State} */
  function start(code) {
    assert(markdownLineEnding(code), 'expected eol')
    effects.enter(types.lineEnding)
    effects.consume(code)
    effects.exit(types.lineEnding)
    return factorySpace(effects, ok, types.linePrefix)
  }
}
[	x o/** @type {Construct} */
export const list: Construct;
import type { Construct } from 'micromark-util-types';
//# sourceMappingURL=list.d.ts.mapvf3_	x o{"version":3,"file":"list.d.ts","sourceRoot":"","sources":["list.js"],"names":[],"mappings":"AAkBA,wBAAwB;AACxB,mBADW,SAAS,CAMnB;+BAhBS,sBAAsB"}$;,x/**
 * @import {
 *   Code,
 *   Construct,
 *   Exiter,
 *   State,
 *   TokenizeContext,
 *   Tokenizer
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {factorySpace} from 'micromark-factory-space'
import {asciiDigit, markdownSpace} from 'micromark-util-character'
import {codes, constants, types} from 'micromark-util-symbol'
import {blankLine} from './blank-line.js'
import {thematicBreak} from './thematic-break.js'

/** @type {Construct} */
export const list = {
  continuation: {tokenize: tokenizeListContinuation},
  exit: tokenizeListEnd,
  name: 'list',
  tokenize: tokenizeListStart
}

/** @type {Construct} */
const listItemPrefixWhitespaceConstruct = {
  partial: true,
  tokenize: tokenizeListItemPrefixWhitespace
}

/** @type {Construct} */
const indentConstruct = {partial: true, tokenize: tokenizeIndent}

// To do: `markdown-rs` parses list items on their own and later stitches them
// together.

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeListStart(effects, ok, nok) {
  const self = this
  const tail = self.events[self.events.length - 1]
  let initialSize =
    tail && tail[1].type === types.linePrefix
      ? tail[2].sliceSerialize(tail[1], true).length
      : 0
  let size = 0

  return start

  /** @type {State} */
  function start(code) {
    assert(self.containerState, 'expected state')
    const kind =
      self.containerState.type ||
      (code === codes.asterisk || code === codes.plusSign || code === codes.dash
        ? types.listUnordered
        : types.listOrdered)

    if (
      kind === types.listUnordered
        ? !self.containerState.marker || code === self.containerState.marker
        : asciiDigit(code)
    ) {
      if (!self.containerState.type) {
        self.containerState.type = kind
        effects.enter(kind, {_container: true})
      }

      if (kind === types.listUnordered) {
        effects.enter(types.listItemPrefix)
        return code === codes.asterisk || code === codes.dash
          ? effects.check(thematicBreak, nok, atMarker)(code)
          : atMarker(code)
      }

      if (!self.interrupt || code === codes.digit1) {
        effects.enter(types.listItemPrefix)
        effects.enter(types.listItemValue)
        return inside(code)
      }
    }

    return nok(code)
  }

  /** @type {State} */
  function inside(code) {
    assert(self.containerState, 'expected state')
    if (asciiDigit(code) && ++size < constants.listItemValueSizeMax) {
      effects.consume(code)
      return inside
    }

    if (
      (!self.interrupt || size < 2) &&
      (self.containerState.marker
        ? code === self.containerState.marker
        : code === codes.rightParenthesis || code === codes.dot)
    ) {
      effects.exit(types.listItemValue)
      return atMarker(code)
    }

    return nok(code)
  }

  /**
   * @type {State}
   **/
  function atMarker(code) {
    assert(self.containerState, 'expected state')
    assert(code !== codes.eof, 'eof (`null`) is not a marker')
    effects.enter(types.listItemMarker)
    effects.consume(code)
    effects.exit(types.listItemMarker)
    self.containerState.marker = self.containerState.marker || code
    return effects.check(
      blankLine,
      // Can’t be empty when interrupting.
      self.interrupt ? nok : onBlank,
      effects.attempt(
        listItemPrefixWhitespaceConstruct,
        endOfPrefix,
        otherPrefix
      )
    )
  }

  /** @type {State} */
  function onBlank(code) {
    assert(self.containerState, 'expected state')
    self.containerState.initialBlankLine = true
    initialSize++
    return endOfPrefix(code)
  }

  /** @type {State} */
  function otherPrefix(code) {
    if (markdownSpace(code)) {
      effects.enter(types.listItemPrefixWhitespace)
      effects.consume(code)
      effects.exit(types.listItemPrefixWhitespace)
      return endOfPrefix
    }

    return nok(code)
  }

  /** @type {State} */
  function endOfPrefix(code) {
    assert(self.containerState, 'expected state')
    self.containerState.size =
      initialSize +
      self.sliceSerialize(effects.exit(types.listItemPrefix), true).length
    return ok(code)
  }
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeListContinuation(effects, ok, nok) {
  const self = this

  assert(self.containerState, 'expected state')
  self.containerState._closeFlow = undefined

  return effects.check(blankLine, onBlank, notBlank)

  /** @type {State} */
  function onBlank(code) {
    assert(self.containerState, 'expected state')
    assert(typeof self.containerState.size === 'number', 'expected size')
    self.containerState.furtherBlankLines =
      self.containerState.furtherBlankLines ||
      self.containerState.initialBlankLine

    // We have a blank line.
    // Still, try to consume at most the items size.
    return factorySpace(
      effects,
      ok,
      types.listItemIndent,
      self.containerState.size + 1
    )(code)
  }

  /** @type {State} */
  function notBlank(code) {
    assert(self.containerState, 'expected state')
    if (self.containerState.furtherBlankLines || !markdownSpace(code)) {
      self.containerState.furtherBlankLines = undefined
      self.containerState.initialBlankLine = undefined
      return notInCurrentItem(code)
    }

    self.containerState.furtherBlankLines = undefined
    self.containerState.initialBlankLine = undefined
    return effects.attempt(indentConstruct, ok, notInCurrentItem)(code)
  }

  /** @type {State} */
  function notInCurrentItem(code) {
    assert(self.containerState, 'expected state')
    // While we do continue, we signal that the flow should be closed.
    self.containerState._closeFlow = true
    // As we’re closing flow, we’re no longer interrupting.
    self.interrupt = undefined
    // Always populated by defaults.
    assert(
      self.parser.constructs.disable.null,
      'expected `disable.null` to be populated'
    )
    return factorySpace(
      effects,
      effects.attempt(list, ok, nok),
      types.linePrefix,
      self.parser.constructs.disable.null.includes('codeIndented')
        ? undefined
        : constants.tabSize
    )(code)
  }
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeIndent(effects, ok, nok) {
  const self = this

  assert(self.containerState, 'expected state')
  assert(typeof self.containerState.size === 'number', 'expected size')

  return factorySpace(
    effects,
    afterPrefix,
    types.listItemIndent,
    self.containerState.size + 1
  )

  /** @type {State} */
  function afterPrefix(code) {
    assert(self.containerState, 'expected state')
    const tail = self.events[self.events.length - 1]
    return tail &&
      tail[1].type === types.listItemIndent &&
      tail[2].sliceSerialize(tail[1], true).length === self.containerState.size
      ? ok(code)
      : nok(code)
  }
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Exiter}
 */
function tokenizeListEnd(effects) {
  assert(this.containerState, 'expected state')
  assert(typeof this.containerState.type === 'string', 'expected type')
  effects.exit(this.containerState.type)
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeListItemPrefixWhitespace(effects, ok, nok) {
  const self = this

  // Always populated by defaults.
  assert(
    self.parser.constructs.disable.null,
    'expected `disable.null` to be populated'
  )

  return factorySpace(
    effects,
    afterPrefix,
    types.listItemPrefixWhitespace,
    self.parser.constructs.disable.null.includes('codeIndented')
      ? undefined
      : constants.tabSize + 1
  )

  /** @type {State} */
  function afterPrefix(code) {
    const tail = self.events[self.events.length - 1]

    return !markdownSpace(code) &&
      tail &&
      tail[1].type === types.listItemPrefixWhitespace
      ? ok(code)
      : nok(code)
  }
}
D
x X/** @type {Construct} */
export const setextUnderline: Construct;
import type { Construct } from 'micromark-util-types';
//# sourceMappingURL=setext-underline.d.ts.mapƝ<
x X{"version":3,"file":"setext-underline.d.ts","sourceRoot":"","sources":["setext-underline.js"],"names":[],"mappings":"AAgBA,wBAAwB;AACxB,8BADW,SAAS,CAKnB;+BAbS,sBAAsB"}6x-/**
 * @import {
 *   Code,
 *   Construct,
 *   Resolver,
 *   State,
 *   TokenizeContext,
 *   Tokenizer
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {factorySpace} from 'micromark-factory-space'
import {markdownLineEnding, markdownSpace} from 'micromark-util-character'
import {codes, types} from 'micromark-util-symbol'

/** @type {Construct} */
export const setextUnderline = {
  name: 'setextUnderline',
  resolveTo: resolveToSetextUnderline,
  tokenize: tokenizeSetextUnderline
}

/** @type {Resolver} */
function resolveToSetextUnderline(events, context) {
  // To do: resolve like `markdown-rs`.
  let index = events.length
  /** @type {number | undefined} */
  let content
  /** @type {number | undefined} */
  let text
  /** @type {number | undefined} */
  let definition

  // Find the opening of the content.
  // It’ll always exist: we don’t tokenize if it isn’t there.
  while (index--) {
    if (events[index][0] === 'enter') {
      if (events[index][1].type === types.content) {
        content = index
        break
      }

      if (events[index][1].type === types.paragraph) {
        text = index
      }
    }
    // Exit
    else {
      if (events[index][1].type === types.content) {
        // Remove the content end (if needed we’ll add it later)
        events.splice(index, 1)
      }

      if (!definition && events[index][1].type === types.definition) {
        definition = index
      }
    }
  }

  assert(text !== undefined, 'expected a `text` index to be found')
  assert(content !== undefined, 'expected a `text` index to be found')
  assert(events[content][2] === context, 'enter context should be same')
  assert(
    events[events.length - 1][2] === context,
    'enter context should be same'
  )
  const heading = {
    type: types.setextHeading,
    start: {...events[content][1].start},
    end: {...events[events.length - 1][1].end}
  }

  // Change the paragraph to setext heading text.
  events[text][1].type = types.setextHeadingText

  // If we have definitions in the content, we’ll keep on having content,
  // but we need move it.
  if (definition) {
    events.splice(text, 0, ['enter', heading, context])
    events.splice(definition + 1, 0, ['exit', events[content][1], context])
    events[content][1].end = {...events[definition][1].end}
  } else {
    events[content][1] = heading
  }

  // Add the heading exit at the end.
  events.push(['exit', heading, context])

  return events
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeSetextUnderline(effects, ok, nok) {
  const self = this
  /** @type {NonNullable<Code>} */
  let marker

  return start

  /**
   * At start of heading (setext) underline.
   *
   * ```markdown
   *   | aa
   * > | ==
   *     ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    let index = self.events.length
    /** @type {boolean | undefined} */
    let paragraph

    assert(
      code === codes.dash || code === codes.equalsTo,
      'expected `=` or `-`'
    )

    // Find an opening.
    while (index--) {
      // Skip enter/exit of line ending, line prefix, and content.
      // We can now either have a definition or a paragraph.
      if (
        self.events[index][1].type !== types.lineEnding &&
        self.events[index][1].type !== types.linePrefix &&
        self.events[index][1].type !== types.content
      ) {
        paragraph = self.events[index][1].type === types.paragraph
        break
      }
    }

    // To do: handle lazy/pierce like `markdown-rs`.
    // To do: parse indent like `markdown-rs`.
    if (!self.parser.lazy[self.now().line] && (self.interrupt || paragraph)) {
      effects.enter(types.setextHeadingLine)
      marker = code
      return before(code)
    }

    return nok(code)
  }

  /**
   * After optional whitespace, at `-` or `=`.
   *
   * ```markdown
   *   | aa
   * > | ==
   *     ^
   * ```
   *
   * @type {State}
   */
  function before(code) {
    effects.enter(types.setextHeadingLineSequence)
    return inside(code)
  }

  /**
   * In sequence.
   *
   * ```markdown
   *   | aa
   * > | ==
   *     ^
   * ```
   *
   * @type {State}
   */
  function inside(code) {
    if (code === marker) {
      effects.consume(code)
      return inside
    }

    effects.exit(types.setextHeadingLineSequence)

    return markdownSpace(code)
      ? factorySpace(effects, after, types.lineSuffix)(code)
      : after(code)
  }

  /**
   * After sequence, after optional whitespace.
   *
   * ```markdown
   *   | aa
   * > | ==
   *       ^
   * ```
   *
   * @type {State}
   */
  function after(code) {
    if (code === codes.eof || markdownLineEnding(code)) {
      effects.exit(types.setextHeadingLine)
      return ok(code)
    }

    return nok(code)
  }
}
d
Y
x \/** @type {Construct} */
export const thematicBreak: Construct;
import type { Construct } from 'micromark-util-types';
//# sourceMappingURL=thematic-break.d.ts.map:rx6 s/eA,wBAAwB;AACxB,4BADW,SAAS,CAInB;+BAZS,sBAAsB"}ʶxl/**
 * @import {
 *   Code,
 *   Construct,
 *   State,
 *   TokenizeContext,
 *   Tokenizer
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {factorySpace} from 'micromark-factory-space'
import {markdownLineEnding, markdownSpace} from 'micromark-util-character'
import {codes, constants, types} from 'micromark-util-symbol'

/** @type {Construct} */
export const thematicBreak = {
  name: 'thematicBreak',
  tokenize: tokenizeThematicBreak
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeThematicBreak(effects, ok, nok) {
  let size = 0
  /** @type {NonNullable<Code>} */
  let marker

  return start

  /**
   * Start of thematic break.
   *
   * ```markdown
   * > | ***
   *     ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    effects.enter(types.thematicBreak)
    // To do: parse indent like `markdown-rs`.
    return before(code)
  }

  /**
   * After optional whitespace, at marker.
   *
   * ```markdown
   * > | ***
   *     ^
   * ```
   *
   * @type {State}
   */
  function before(code) {
    assert(
      code === codes.asterisk ||
        code === codes.dash ||
        code === codes.underscore,
      'expected `*`, `-`, or `_`'
    )
    marker = code
    return atBreak(code)
  }

  /**
   * After something, before something else.
   *
   * ```markdown
   * > | ***
   *     ^
   * ```
   *
   * @type {State}
   */
  function atBreak(code) {
    if (code === marker) {
      effects.enter(types.thematicBreakSequence)
      return sequence(code)
    }

    if (
      size >= constants.thematicBreakMarkerCountMin &&
      (code === codes.eof || markdownLineEnding(code))
    ) {
      effects.exit(types.thematicBreak)
      return ok(code)
    }

    return nok(code)
  }

  /**
   * In sequence.
   *
   * ```markdown
   * > | ***
   *     ^
   * ```
   *
   * @type {State}
   */
  function sequence(code) {
    if (code === marker) {
      effects.consume(code)
      size++
      return sequence
    }

    effects.exit(types.thematicBreakSequence)
    return markdownSpace(code)
      ? factorySpace(effects, atBreak, types.whitespace)(code)
      : atBreak(code)
  }
}
񕾿Gxexport { attention } from './lib/attention.js';
export { autolink } from './lib/autolink.js';
export { blankLine } from './lib/blank-line.js';
export { blockQuote } from './lib/block-quote.js';
export { characterEscape } from './lib/character-escape.js';
export { characterReference } from './lib/character-reference.js';
export { codeFenced } from './lib/code-fenced.js';
export { codeIndented } from './lib/code-indented.js';
export { codeText } from './lib/code-text.js';
export { content } from './lib/content.js';
export { definition } from './lib/definition.js';
export { hardBreakEscape } from './lib/hard-break-escape.js';
export { headingAtx } from './lib/heading-atx.js';
export { htmlFlow } from './lib/html-flow.js';
export { htmlText } from './lib/html-text.js';
export { labelEnd } from './lib/label-end.js';
export { labelStartImage } from './lib/label-start-image.js';
export { labelStartLink } from './lib/label-start-link.js';
export { lineEnding } from './lib/line-ending.js';
export { list } from './lib/list.js';
export { setextUnderline } from './lib/setext-underline.js';
export { thematicBreak } from './lib/thematic-break.js';tc®xQ100644 attention.d.ts GTrVGIV2qm100644 attention.d.ts.map fkv/cd}100644 attention.js @茮*$rhV֚100644 autolink.d.ts Wi<C'Vmy;S100644 autolink.d.ts.map {rK`iP100644 autolink.js =+\epJvw100644 blank-line.d.ts zY(}l[D100644 blank-line.d.ts.map #nh4x6{'<100644 blank-line.js ($i轿U]IsQ100644 block-quote.d.ts 39U㡢\100644 block-quote.d.ts.map  2	;;shn100644 block-quote.js W|ԏJ|Yvm%ufK100644 character-escape.d.ts U_4>:ψp>c3100644 character-escape.d.ts.map VH]@P/;100644 character-escape.js 6ρjA7an}{̷!100644 character-reference.d.ts UO6T100644 character-reference.d.ts.map S}_gb4QrQ6W100644 character-reference.js ؉ 8g6ar100644 code-fenced.d.ts m_S 	;~*+<HCJM100644 code-fenced.d.ts.map -B`QiӎE@6P100644 code-fenced.js ?@q&tK$F100644 code-indented.d.ts <Wls>`R_100644 code-indented.d.ts.map 	9Y.eNҳw6*100644 code-indented.js q6HăvImQ.$100644 code-text.d.ts G M/6100644 code-text.d.ts.map U	p41c1100644 code-text.js h_PkѢ i100644 content.d.ts 7a!V"100644 content.d.ts.map ptP8NX`100644 content.js P{IUwK݀@Z}100644 definition.d.ts i0Yo(H*J100644 definition.d.ts.map Fm:E4km2l]C100644 definition.js \tr85ibj}dϼj100644 hard-break-escape.d.ts 2N*@aBvXe100644 hard-break-escape.d.ts.map 7Sc&nBVt100644 hard-break-escape.js S
DI@TEaծly100644 heading-atx.d.ts SyN~}\100644 heading-atx.d.ts.map ,2C?K100644 heading-atx.js 9JEU&)ԳH(	100644 html-flow.d.ts p	,%'Cĺ100644 html-flow.d.ts.map #3hO*a100644 html-flow.js -K_9'#;/0ݱ1100644 html-text.d.ts AX߽u/F100644 html-text.d.ts.map ԊEvkmzDxb)100644 html-text.js U	"Ȏr+= Y100644 label-end.d.ts Ȓۂ:)b72zG100644 label-end.d.ts.map =cHf+[
Ɩ100644 label-end.js xHÀ<IӲL100644 label-start-image.d.ts 
<isd'WXj}100644 label-start-image.d.ts.map tSv۱j.+100644 label-start-image.js @0%vdeC!.Z100644 label-start-link.d.ts \?ܯ1ŜE'-J100644 label-start-link.d.ts.map B_7%2ӛ100644 label-start-link.js 'zXiEW2FY
100644 line-ending.d.ts >Odra^100644 line-ending.d.ts.map "dZw8|100644 line-ending.js MMoO?94100644 list.d.ts )S)u]y\Xy100644 list.d.ts.map 1d,xl%;100644 list.js 3h켊ګ88L100644 setext-underline.d.ts 4Oed8fӠX:!100644 setext-underline.d.ts.map )o|h1p	K}100644 setext-underline.js V`ݗ2Q,kCۦU100644 thematic-break.d.ts Q|enpepWĬ100644 thematic-break.d.ts.map 
eyhnݰgU+닥100644 thematic-break.js ?VtjgI"Rj^x_>8 push, splice ;
import { classifyCharacter ?;
import { resolveAll {;;R;- pen;`group;`";`;`;-use;/;-%;Revents[index][0] === 'enter' && &&) {
      open = index;l0"(T,r5 (
;	 !(: +	
% 3)) {
            continue;1
V 9
	
4 > 1 ? 2 : 1;
          const start = {
            _2
          };
          const end = {
            
          };!;;;%"strongSequence" : "emphasisSequence"P'
              _
  };;J"strongSequence" : "emphasisSequence",
            start: {
              
            1;O0B"strongText" : "emphasisText",
            start: {
              _
            
              
  };1:"strong" : "emphasis",
            start: {
              o
            
               
  };"
            o
          };%
             (
          };
          nextEvents = [];40!$S#]);1
2% ['exit ['enter', text, context]]);-B3oresolveAll(* context));;A['exit', text, context],%$]);4;,%N$]);*;6;8;
          break;BK;;
    }
  }
  return events;+;!;-;41;
  return start;umarker = code;';;;
      return inside;
    }4;u;Q'4
    const open = !after || after === 2 && before ||. 7;
    const close = !before || before === 2 && after ||.
previous);marker === 42$+);
    token._close = Boolean(marker === 42$);
    return ok(code);m;+#;
  point._bufferIndex += offset;
}PPx)%9 asciiAlphanumeric, asciiAlpha, asciiAtext, asciiControl !;E3
  name: 'autolink',
 
};;
  return start;9@effects.enter("autolink");
    effects.enter("autolinkMarker");
];
    effects.exit("autolinkMarker");
    effects.enter("autolinkProtocol");
    return open;;,;
    }
    if (code === 64];
    }~;-)code === 43 || code === 45 || code === 46FJ;,;
    }~;58;
      size = 0;	;
    }
:*(code === 43 || code === 45 || code === 46 size++ < 32;&;
    }
    size = 0;~;
T62) {
      effects.exit("autolinkProtocol");
      effects.enter("autolinkMarker");0
X;
      effects.exit("autolinkMarker");
      effects.exit("autolink");
      return ok;K5.code === null || code === 32 || code === 60 ||];
    }
;
!	;I64;8;
    }]8;
  ;
    }
    return nok(code);;46;
      size = 0;8;
    }
    if (code === 62?BR"autolinkProtocol").type = "autolinkEmail";
      effects.enter("autolinkMarker");0
^;
      effects.exit("autolinkMarker");
      effects.exit("autolink");
      return ok;
    }\;1(code === 45 size++ < 634 45^;0
6;
      return next;
    }
    return nok(code);
  }
}cw	{x i		 factorySpace  ;
import { ! !;+4
  partial: true,
 m
};;  ""linePrefix")(code) : after(code);knull3;
  }
}U-+zxM factorySpacea;
import { markdownSpacea

;SG
    (
  F;

/*P_k-;
  return start;62[+;0Z"blockQuote", {
          _container: true
        });
        state.open = true;
      }
"blockQuotePrefix");
1"blockQuoteMarker");
      effects.consume(code);1D"blockQuoteMarker");
      return after;
    }
    return nok(code);"K ");
      effects.consume(code);1"K");1Q"blockQuotePrefix");
      return ok;
    }
    effects.exit("blockQuotePrefix");;;
  return contStart;!	"effects, contBefore, "linePrefix",	=; ? undefined : 4)(code);
    }
    return contBefore(code);
%;F"blockQuote");
}*x
	 asciiPunctuation !;	{;;Deffects.enter("characterEscape");
    effects.enter("escapeMarker");+6;
    effects.exit("escapeMarker");
    return inside;|"p");
  ,;"p");*"characterEscape");
      return ok;
    };
  }
}Q3x>  )7;
import { asciiAlphanumeric, asciiDigit, asciiHexDigit_character';;;
  let size = 0;";4;
  return start;ݓ	"characterReference");	"p");
;
    effects.exit("p");
    return open;&35) { "pP");;"pP");
      return numeric;
    }	)"characterReferenceValue");
    max = 31;.;=
;b88 || code === 120) { "#");;"#"); *"characterReferenceValue");
      max = 6;	;
      return value;
    }	?"characterReferenceValue");
    max = 7;
    test = asciiDigit;=
;T
s59-E"characterReferenceValue");
      if (test === asciiAlphanumeric && !z;|"p");;"p");-"characterReference");
      return ok;
    }B7;
      return value;
    }
    return nok(code);
  }
};~xPH factorySpace  ;
import { !_
;er;;%Y2;2
    partial: true,
   !
  };?;
  let sizeOpen = 0;j0;
  return start;;pp0;
    initialPrefix =@"linePrefix"r/ : 0;
    marker = code;a"codeFenced");a"codeFencedFence");a"#");>;pp;J;
" Open;
    }
    if (sizeOpen < 3;
    }
    effects.exit("#");	4	%'"whitespace")(code) : infoBefore(code);pp	null=3"codeFencedFence");
 ? ok(code) :0@;
    }a"");a4"chunkString", {
      contentType: "string"
    });;p	null=3"chunkString");q"");;
    }R3"chunkString");q"");02"whitespace")(code);
    }
    if (code === 96 && ";
    }
M;
    return info;ppnull=&;
    }a"codeFencedFenceMeta");aK"chunkString", {
      contentType: "string"
    });
    return meta(code);pnull=3"chunkString");q"codeFencedFenceMeta");;
    }
    if (code === 96 && ";
    }
M;
    return meta;V>;&	o"lineEnding");
M:;
    effects.exit("lineEnding");
    return contentStart;&U ? factorySpace(effects, beforeContentChunk, "linePrefix", initialPrefix + 1)(code) :;null=&1?;
    }a"codeFlowValue");;pnull=3"codeFlowValue");&;
    }
M;;;#"codeFenced");
    return ok(code); ;
    return startBefore;\	0!"lineEnding");J;q""lineEnding");
      return start;\D"codeFencedFence");
  	 ? factorySpace(effects, "linePrefix",O= ? undefined : 4)(code) :(code);7"#");"p!	;
      };'!;";"	;
      }"4"#");
    	c#-"whitespace")(code)#	;
      };$null%54"codeFencedFence");
        return ok(code);
      };%;
  return start;@&Unull;
    }a"lineEnding");
M;;
    effects.exit("lineEnding");
    return lineStart;
  }@&6'U;
  }
}n;W71x" factorySpace  ;
import { ! !;tX;1
  partial: true,
 
};
Y4;
  return start;#
    effects.enter("codeIndented");1effects, afterPrefix, "linePrefix", 4 + 1)(code);5;
    return tail && tail[1].type === "linePrefix" &&14 ? atBreak(code) : nok(code);;null;
    }eD;
    }
    effects.enter("codeFlowValue");
    return inside(code);nullq	33"codeFlowValue");
      return atBreak(code);
    }	;
    return inside;
G"codeIndented");`
;
;;n;
    }+effects.enter("lineEnding");
  	;	"lineEnding");
    ;31effects, afterPrefix, "linePrefix", 4 + 1)(code);5;
    return tail && tail[1].type === "linePrefix" &&14 ? ok(code)( ? furtherStart(code) : nok(code);
  }
}!QOx)% markdownLineEnding !;5;;
  let headEnterIndex = 3;	index;0;9$"lineEnding" || #n}$"lineEnding" || "n;e"codeTextData"}N"codeTextPadding";)"codeTextPadding";;2;
        break;cU;
  tailExitIndex++;Oindex !== tailExitIndex && Q*!== "lineEnding") {
        enter = index; Q"lineEnding"""codeTextData";4Y;4;+;	;
      };
    }
  }
  return events;^	;}pcode !== 96 ||	1"characterEscape";^	;
  let sizeOpen = 0;	#;
#;
  return start;R
Aeffects.enter("codeText");
    effects.enter("codeTextSequence");;96;
      sizeOpen++;
  .;
    }
    effects.exit("codeTextSequence");
P;=null;&#32) {
      effects.enter('space');;.;
      return between;_CF96) {
      token = effects.enter("codeTextSequence");
      size = 0;!;
    }!9"lineEnding");9;
      effects.exit("lineEnding");
      return between;''"codeTextData");
    return data(code);	&null || code === 32 || code === 96 || *+xit("codeTextData");M;
    }
;
    return data;96;
      size++;;EK"codeTextSequence");
      effects.exit("codeText");
      return ok(code);BD,"codeTextData";
    return data(code);
  }
}H&<Cx8 factorySpace  ;
import { markdownLineEndingo
;
import { subtokenizeosubtokenize';d
  #
  tokenize: tokenizeContent
};

/*K#
  partial: true,
 |
};;
  return events;
_D;
  return chunkStart;`effects.enter("content");"chunkContent""content"
    });o
(code);null!;:continuationConstruct, contentContinue, contentEnd)(code);.;o
;:s$B"chunkContent");
    effects.exit("content");
    return ok(code);:	8effects.consume(code);
    effects.exit("chunkContent");	#"chunkContent"?"content",
      previous
    });
    previous = previous.next;o
;
;
  return startLookahead;=6h"chunkContent");
    effects.enter("lineEnding");
    effects.consume(code);
    effects.exit("lineEnding");
    return factoryV"linePrefix");\null || !|
nok(code);-5;
    if (!() tail && tail[1].type === "linePrefix" &&z14;
    }I;
  }
}8Gixx/, factoryDestination ;
import { factoryLabel  ;
import { factorySpace @;
import { factoryTitle #title';
import { factoryWhitespace 
;
import {
$, markdownLineEnding, markdownSpace !;
import { 1 D,;
  name: 'definition',
 
};
0
  partial: true,
 H
};Y2;);
  return start;+b"definition");;Γself, effects, labelAfter,
=.Pnok, "definitionLabel", "definitionLabelMarker", "definitionLabelString")(code);HB);
    if (code === 58) {
      effects.enter("definitionMarker");A	_;
      effects.exit("definitionMarker");
      return markerAfter;
    }
    return nok(code);	֓
6
;effects, destinationAfter,
=.nok, "", "", """, "", "String")(code);5;*"whitespace")(code)/;!hnullI3"definition");;f;
    }
    return nok(code);;	蓰
 : nok(code);.effects, titleAfter, nok, "definitionTitle", """, "definitionTitleString")(code);K ? factorySpace(effects,x, "whitespace")(code)v%;nullI;
  }
}qdx / markdownLineEnding !;{;;Neffects.enter("hardBreakEscape");
    effects.consume(code);
    return after;@L"hardBreakEscape");
      return ok(code);
    }
    return nok(code);
  }
}C>}x%" factorySpace  
;
import {#, markdownLineEnding, markdownSpaceoO
;
import { spliceo;;Pl;
  let contentStart = 3;content;";V"whitespace";9 pl	"whitespace"!2;
  }
  if (ql	"atxHeadingSequence" &&$  $"whitespace")!=;
  }c@"atxHeadingText"8R
    };"chunkText"8g"text"
    };B['enterp,* ['exit', text, context],i]);
  }
  return events;;
  return start;8"atxHeading");!	;9	$effects.enter("atxHeadingSequence");?
;]
	35 && size++ < 6a;;9null:"atxHeadingSequence");/;
    }Q;f035) {
      effects.enter("atxHeadingSequence");{;
    }
    if (code === null3"atxHeading");;
    }L"whitespace")(code);"atxHeadingText");; 35a;PFurther;
    }
    effects.exit("atxHeadingSequence");
    return atBreak(code);N	null || code === 35:"atxHeadingText");/;
    }
;
    return data;
  }
}75PxÑ asciiAlphanumeric, asciiAlpha,18OrSpace,18, markdownSpace <
;
import { O #html-tag-name';
import { blankLine ;~;4&
};
const n@D;YZ;
  while (index--) {
    if ($"htmlFlow") {
      break;
    }
  }E2"linePrefix") {)>;p;a?;
  }
  return events;I[0;@%;e*;%;@index;$;
  return start;;>effects.enter("htmlFlow");
    effects.enter("htmlFlowData");
a&;
    return open;1G	334;\
;
    }
    if (code === 474;
7;
      return tagCloseStart;
    }
    if (code === 634;
      marker = 3;bI;1!+/;);
      return tagName;
    };1454;
      marker = 2;;
    }
    if (code === 914$;
      marker = 5;
      index = 0;m;1!@;
      marker = 4;2U.3;
    };1454;2U.3;
    };1	"CDATA[";xJ;	;
      }m;
    };1/;);
      return tagName;
    };`3.01	"null || code === 47 || code === 62a2G[&
c47;@(;T1;
  2*@\	;
      }M6;5;;";];
      }
      marker = 7; {L
closingTag  :!;1!)E45d:;*;
      return tagName;
    };.624;2U.";
    };.;0;
    }${"	;"474;0End;1!F58 || code === 95!3;0#;
    }?&;;0);
    }${"	;`3"n!	/45 || code === 46 || code === 58 || code === 95d:;0#;
    }$,;.$614;0';
    }?&;;0#After;
    }$!;&&01	null || code === 60 || code === 61 || code === 62 || code === 96) {
      return nok(code);
    }
    if (code === 34 || code === 394;
      markerB = code;0',;
    }?&;;0';
    }
&!);`3*;1+;0',p+;
    }
    if (code === nulla2&+;
    }
a&;
&!,;`3*,01	mnull || code === 34 || code === 39 || code === 47 || code === 60 || code === 61 || code === 62 || code === 96a2G[&
}<	$;
    }
a&;
&!	Unquoted;.01	47 || code === 62 || Q}<	$;
    };`3a0624;01;
    };1nulla2;
    }?&;;01;
    };`345 && marker === 24;
aA=+;
    }
    if (code === 60 && marker === 14;
aA5RawTagOpen;
    }
    if (code === 62 && marker === 44;
aA+;
    }
    if (code === 63 && marker === 34;
aA?6+;
    }
    if (code === 93 && marker === 54;
aA~C
;
    }
    if :! && (marker === 6 || marker === 7G<"htmlFlowData");
      return effects.check(blankLineBefore,76 continuationStart)(code);
    }
    if (code === nulla2&>K	xit("htmlFlowData");
aA<;
    }
a&;
>;`3 8n@5, continuationStartNonLazy, continuationAfter)(code);`3 #:effects.enter("lineEnding");
a&";
    effects.exit("lineEnding");
>.<;`3 ;nulla2&}<*;
    }
    effects.enter("htmlFlowData");/>;`3<454;
aA?6;
    }/>;`3a>474;
      buffer = '';
aA?	;
    }/>;`3?62@+;AG;^A!
;
      }
aA<;
    }A-
8) {
     0;*;
aA?	;
    }/>;`3B934;
aA?6;
    }/>;`3=D\624;
aA;E-45 && marker === 24;
aA?6;
    }/>;`3Fnulla2&>K	xit("htmlFlowData");
aAAfter(code);
    }
a&;?H;\H"htmlFlow");I;L_J@;
  return start;fJ"lineEnding");==;
      effects.exit("lineEnding");
      return after;
    };K;L;?Meffects.enter("lineEnding");
a&!;
    effects.exit("lineEnding");N/;
  }
}	tFxZrh factorySpace  );
import { asciiAlphanumeric, asciiAlpha,.#, markdownLineEnding, markdownSpace_character';3
  name: 'htmlText',
 
};;<;$;);
  return start;-8"htmlText");14"htmlTextData");/;
    return open;33)9;
      return declarationOpen;
    }
    if (code === 47)7;
      return tagCloseStart;
    }
    if (code === 63)";
      return instruction;
    }
"M9;);
    }0;'45);_;
    }
    if (code === 91);
      index = 0;;
    }	8!;
      return declaration;
    }0;Q"	45);_
End;
    }0;Q"
null`(;
    }
    if (code === 45);_Close;
    }9comment;!$;
    }/;
    return comment;Q"45);_$End;
    }
    return comment(code);Q"B62 ? end(code) : code === 45 ? commentClose(code) : comment(code);	"CDATA[";J;>;
    }0;Q"vnull`(;
    }
    if (code === 93);;
    }9cdata;!$;
    }/;
    return cdata;Q"b93);O;
    }
    return cdata(code);Q"62;
    }
    if (code === 93);O;
    }
    return cdata(code);Q"null || code === 62;
    }9declaration;!$;
    }/;
    return declaration;Q"null`(;
    }
    if (code === 63);;
    }D;!$;
    }/;
    return instruction;Q"62[ ;;
      return tagClose;
    }0;45:;
      return tagClose;
    }
{(code);Q",;!$;
    }!;;x;
    }
;45:;)-;
    }
    if (code === 47 || code === 62 ||. !
);
    }0;Q"47);
      return end;
    }
"  58 || code === 95!3;)";
    }9_)Between;!$;
    }!;;);
    }
;Q" 	/45 || code === 46 || code === 58 || code === 95:;)";
    } $+;b$61);));
    }9_)&	;!$;
    }!;;)&	;
    }& ;&	@null || code === 60 || code === 61 || code === 62 || code === 96`(*;
    }
    if (code === 34 || code === 39);
      marker = code;)#,;
    }9_);!$;
    }!;;));
    }/; $o)</;Q"g*;\+;)#,"After;
    }
    if (code === null`(;
    }9,;!$;
    }/; $/,;Q",	Onull || code === 34 || code === 39 || code === 60 || code === 61 || code === 96`(-;
    }
    if (code === 47 || code === 62 ||. !
);
    }/; $o)</;[/	47 || code === 62 ||. !
);
    }0;Q"162)\;
      effects.exit("htmlTextData");
      effects.exit("htmlText");
      return ok;
    }0;28	xit("htmlTextData");14"lineEnding");/";
    effects.exit("lineEnding");
%After;4;k6 ? factorySpace(effects,6 "linePrefix",6$7 ? undefined : 4)(code) :8;71"htmlTextData");8;
  }
}QIE4xmb factoryDestination &;
import { factoryLabel label';
import { factoryTitle M ;
import { factoryWhitespace whitespace';
import {-+ "character';
import { push, splice 'chunked';
import { normalizeIdentifier V;
import { resolveAll resolve-all';;M
  
};M = {
  tokenize:-
};M%
  r$
};_*&;5;G;c"`;
    if (token.type === "labelImage" || token.type === "labelLink" || token.type === "labelEnd"	DG"labelImage" ? 4 : 2;
      token.type = "data";
      index += offset;;
  }
  return events;]e;
  let offset = 0;token;/;+P;!
let media;H;nXtoken.type === "link" || token.type === "labelLink" && token._inactive) {
        break;	"labelLink"\
";~
+
 O(token.type === "labelImage" || token.type === "labelLink") && !token._balanced@;Y5"labelLink") {
          offset = 2;
          break;1,"labelEnd") {
      close = index;
    }
  }63"labelLink" ? "link" : "image",
    start: {
      
    },
    end: {
      !#
    }
  };J"label",
    start: {
      
    },
    end: {
      ...events[close][1].end
    }
  };
  const text = {
    type: "labelText",
    start: {
      ...event
    },
    end: {
      +
    }
  };
  media = [_}];W;C;5%_resolveAll(h*7, context));{E['exit', text, context], events[close - 1],]);-Q;~E;-;
  return events;  []0;!;(;';0if ((O	"labelImage" || O	"labelLink") &&!,(;
      break;
    }
  }
  return start;$IQ;g;
    },normalizeIdentifier(self.sliceSerialize({
      start: labelStart.end,
      end: self.now()
    })));
    effects.enter("label(End");
    effects.enter("labelMarker");N4R;
    effects.exit("labelMarker");
    effects.exit("labelEnd");
    return after;te40!resourceConstruct, labelEndOk,[)(code);wX91! labelEndOk,C))(code);zf;><referenceCollapsedConstruct, labelEndOk, labelEndNok)(code);qT;q+;
    return nok(code);1a} 1; ?effects.enter("resource");
    effects.enter("resourceMarker");N4@;
    effects.exit("resourceMarker");
    return resourceBefore;1-(R"Ǔ#1 : resourceOpen(code);1-(#41b$";
    }$	effects, Q%After, Q%
Missing, "Q%", "Q%", "Q% ", "Q%Raw", "Q%String", 32)(code);1-(*&ϓ&4 : resourceEnd(code);M';1-()code === 34 || code === 39 || code === 40g)effects, resourceTitleAfter, nok, "resourceTitle", "resourceTitleMarker", "resourceTitleString")(code);
    }
    return resoury$;1-(w*֓#&End)(code) : resourceEnd(code);1-(	+/41) {
      effects.enter("resourceMarker");
  O4;,"resourceMarker");,9"resource");
      return ok;
    }
    return nok(code);1h-,;-;/%-."self, effects, referenceFullAfter,!/: "reference", "referenceMarker", "referenceString")(code);1/normalizeIdentifier(0H)) ? ok(code) : nok(code);1;1;4+2F
    effects.enter("reference");
    effects.enter("referenceMarker");N4&;
    effects.exit("referenceMarker");4";124093) {
      effects.enter("referenceMarker");
  O4;,"referenceMarker");,@"reference");
      return ok;
    }
    return nok(code);
  }
}F

6xu
 labelEnd ;;;
  return start;5Ceffects.enter("labelImage");
    effects.enter("labelImageMarker");]8;
    effects.exit("labelImageMarker");
    return open;191q"labelMarker");
  ^;
      effects.exit("labelMarker");
      effects.exit("labelImage");
      return after;
    }
    return nok(code);
  }

  /:94 &&3 ? nok(code) : ok(code);
  }
}xlx

 labelEnd ;;;
  return start;1effects.enter("labelLink");
    effects.enter("labelMarker");
    effects.consume(code);
    effects.exit("labelMarker");
    e+ffects.exit("labelLink");
    return after;94 &&3 ? nok(code) : ok(code);
  }
}-`Wx 8 factorySpace  ;
import { markdownLineEnding !;95
  name: 'lineEnding',
 
};; 6effects.enter("lineEnding");!;
    effects.exit("lineEnding");&"linePrefix");
  }
}(@gvxn>0 factorySpace  ;
import { lPcharacter';
import { blankLine } from './blank-line.js';
import { thematicBreak ;'
  
  )K;!e;4&O
};V;=3;p& tail && tail[1].type === "linePrefix"/% : 0;
  let size = 0;
  return start;$4const kind  (code === 42 || code === 43 || code === 45 ? "listUnordered" : "listOrdered");
    if (kind === "listUnordered" ? !self.contaik	- : asciiDigit(code)R;Ykind, {
          _container: true
        });
      }
      if (kind === "listUnordered""listItemPrefix");42 || code === 454 : atMarker(code);
      }M'49"listItemPrefix");"listItemValue");%;
      }
    }
    return nok(code);(B		!10	%;
      return inside;
    }
    if (
  ~[
%! : code === 41 || code === 46)) {"listItemValue");
;
    }
    return nok(code);)F!effects.enter("listItemMarker");
	%;
    effects.exit("listItemMarker");Ad$;@`
/ effects.attempt(l>
 endOfPrefix, otherPrefix));<Ftrue;
    initialSize++;*;)pF"l");	;"l9");
      return endOfPrefix;
    }
    return nok(code);(F= initialSize +"5"listItemPrefix"), true).length;
    return ok(code);A_(; -;N5;$F=A'||;leffects, ok, "listItemIndent",)(code);(if e;^;$;
    }A;A;@H;(l;k_;&\effects,  "linePrefix",$ ? undefined : 4)(code);A;
_'effects, afterPrefix, "listItemIndent",);l9;
    return tail && tail[1].type === "listItemIndent" &&- ? ok(code) : nok(code);A?N2&;;

#
_effects, afterPrefix, "l",$ ? undefined : 4 + 1);l;~# tail && tail[1].type === "l" ? ok(code) : nok(code);
  }
}ع=;}xB%! factorySpace  
;
import {Qn+
;i;;+content;/;+definition;3	"content";
        break;
      }%$"paragraph") {
        text = index;J	"content"f	;
      }P4="definition") {
        definition = index;
      }
    }
  }X"setextHeading",
    start: {
      ...events[content][1].start
    },
    end: {
      `#
    }
  };M"setextHeadingText";;L;
      
	
    };'	,;S	U;
  return events;	;K
0;
  return start;
;[9;}!== "lineEnding" &&1 "linePrefix" &&1 	"content"e7"paragraph";
        break;*"setextHeadingLine");
      marker = code;;
    }
    return nok(code);}	"");
    return inside(code);/;
      return inside;
    }
    effects.exit("");B ? factorySpace(effects, after, "lineSuffix")(code) : after(code);}nullN3N"setextHeadingLine");
      return ok(code);
    }
    return nok(code);
  }
}txK factorySpace  ;
import { !_
;eu;;c0;
  return start;"thematicBreak");]G;(marker = code;
    return atBreak(code);"thematicBreakSequence");+;
    }
    if (size >= 3 && (code === null|D"thematicBreak");
      return ok(code);
    }
    return nok(code);;
      size++;2;
    }
    effects.exit("thematicBreakSequence");="*"whitespace")(code) : atBreak(code);
  }
}~x{
  "name": "micromark-core-commonmark",
  "version": "2.0.3",
  "description": "The CommonMark markdown constructs",
  "license": "MIT",
  "keywords": [
    "micromark",
    "core",
    "commonmark"
  ],
  "repository": "https://github.com/micromark/micromark/tree/main/packages/micromark-core-commonmark",
  "bugs": "https://github.com/micromark/micromark/issues",
  "funding": [
    {
      "type": "GitHub Sponsors",
      "url": "https://github.com/sponsors/unifiedjs"
    },
    {
      "type": "OpenCollective",
      "url": "https://opencollective.com/unified"
    }
  ],
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "sideEffects": false,
  "type": "module",
  "files": [
    "dev/",
    "lib/",
    "index.d.ts.map",
    "index.d.ts",
    "index.js"
  ],
  "exports": {
    "development": "./dev/index.js",
    "default": "./index.js"
  },
  "dependencies": {
    "decode-named-character-reference": "^1.0.0",
    "devlop": "^1.0.0",
    "micromark-factory-destination": "^2.0.0",
    "micromark-factory-label": "^2.0.0",
    "micromark-factory-space": "^2.0.0",
    "micromark-factory-title": "^2.0.0",
    "micromark-factory-whitespace": "^2.0.0",
    "micromark-util-character": "^2.0.0",
    "micromark-util-chunked": "^2.0.0",
    "micromark-util-classify-character": "^2.0.0",
    "micromark-util-html-tag-name": "^2.0.0",
    "micromark-util-normalize-identifier": "^2.0.0",
    "micromark-util-resolve-all": "^2.0.0",
    "micromark-util-subtokenize": "^2.0.0",
    "micromark-util-symbol": "^2.0.0",
    "micromark-util-types": "^2.0.0"
  },
  "scripts": {
    "build": "micromark-build"
  },
  "xo": {
    "envs": [
      "shared-node-browser"
    ],
    "prettier": true,
    "rules": {
      "logical-assignment-operators": "off",
      "max-depth": "off",
      "unicorn/no-this-assignment": "off",
      "unicorn/prefer-at": "off",
      "unicorn/prefer-code-point": "off"
    }
  }
}
_۰x:o# micromark

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][bundle-size-badge]][bundle-size]
[![Sponsors][sponsors-badge]][opencollective]
[![Backers][backers-badge]][opencollective]
[![Chat][chat-badge]][chat]

Markdown parser.

> **Note**: this is the `micromark` package from the micromark monorepo.
> See the [monorepo readme][micromark] for more on the project.
> See this readme for how to use it.

## Feature highlights

<!-- Note: this section has to be in sync with the monorepo readme. -->

* [x] **[compliant][commonmark]** (100% to CommonMark)
* [x] **[extensions][]** (100% [GFM][], 100% [MDX.js][mdxjs], [directives][],
  [frontmatter][], [math][])
* [x] **[safe][security]** (by default)
* [x] **[robust][test]** (±2k tests, 100% coverage, fuzz testing)
* [x] **[small][size-debug]** (smallest CM parser at ±14kb)

## Contents

* [When should I use this?](#when-should-i-use-this)
* [What is this?](#what-is-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`micromark(value[, encoding][, options])`](#micromarkvalue-encoding-options)
  * [`stream(options?)`](#streamoptions)
  * [`Options`](#options)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Contribute](#contribute)
* [Sponsor](#sponsor)
* [License](#license)

## When should I use this?

<!-- Note: this section has to be in sync with the monorepo readme. -->

* If you *just* want to turn markdown into HTML (with maybe a few extensions)
* If you want to do *really complex things* with markdown

See [§ Comparison][comparison] for more info

## What is this?

<!-- Note: this section has to be in sync with the monorepo readme. -->

`micromark` is an open source markdown parser written in JavaScript.
It’s implemented as a state machine that emits concrete tokens, so that every
byte is accounted for, with positional info.
It then compiles those tokens directly to HTML, but other tools can take the
data and for example build an AST which is easier to work with
([`mdast-util-to-markdown`][mdast-util-to-markdown]).

While most markdown parsers work towards compliancy with CommonMark (or GFM),
this project goes further by following how the reference parsers (`cmark`,
`cmark-gfm`) work, which is confirmed with thousands of extra tests.

Other than CommonMark and GFM, micromark also supports common extensions to
markdown such as MDX, math, and frontmatter.

These npm packages have a sibling project in Rust:
[`markdown-rs`][markdown-rs].

* to learn markdown, see this [cheatsheet and tutorial][cheat]
* for more about us, see [`unifiedjs.com`][site]
* for questions, see [Discussions][chat]
* to help, see [contribute][] and [sponsor][] below

## Install

<!-- Note: this section has to be in sync with the monorepo readme. -->

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install micromark
```

In Deno with [`esm.sh`][esmsh]:

```js
import {micromark} from 'https://esm.sh/micromark@3'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {micromark} from 'https://esm.sh/micromark@3?bundle'
</script>
```

## Use

<!-- Note: this section has to be in sync with the `micromark` readme. -->

Typical use (buffering):

```js
import {micromark} from 'micromark'

console.log(micromark('## Hello, *world*!'))
```

Yields:

```html
<h2>Hello, <em>world</em>!</h2>
```

You can pass extensions (in this case [`micromark-extension-gfm`][gfm]):

```js
import {micromark} from 'micromark'
import {gfmHtml, gfm} from 'micromark-extension-gfm'

const value = '* [x] contact@example.com ~~strikethrough~~'

const result = micromark(value, {
  extensions: [gfm()],
  htmlExtensions: [gfmHtml()]
})

console.log(result)
```

Yields:

```html
<ul>
<li><input checked="" disabled="" type="checkbox"> <a href="mailto:contact@example.com">contact@example.com</a> <del>strikethrough</del></li>
</ul>
```

Streaming interface:

```js
import {createReadStream} from 'node:fs'
import {stream} from 'micromark/stream'

createReadStream('example.md')
  .on('error', handleError)
  .pipe(stream())
  .pipe(process.stdout)

function handleError(error) {
  // Handle your error here!
  throw error
}
```

## API

`micromark` core has two entries in its export map: `micromark` and
`micromark/stream`.

`micromark` exports the identifier [`micromark`][api-micromark].
`micromark/stream` exports the identifier [`stream`][api-stream].
There are no default exports.

The export map supports the [`development` condition][development].
Run `node --conditions development module.js` to get instrumented dev code.
Without this condition, production code is loaded.
See [§ Size & debug][size-debug] for more info.

### `micromark(value[, encoding][, options])`

Compile markdown to HTML.

> Note: which encodings are supported depends on the engine.
> For info on Node.js, see *[WHATWG supported encodings][encoding]*.

###### Parameters

* `value` (`string` or [`Uint8Array`][uint8-array])
  — markdown to parse
* `encoding` (`string`, default: `'utf8'`)
  — [character encoding][encoding] to understand `value` as when it’s a
  [`Uint8Array`][uint8-array]
* `options` ([`Options`][api-options], optional)
  — configuration

###### Returns

Compiled HTML (`string`).

### `stream(options?)`

Create a duplex (readable and writable) stream.

Some of the work to parse markdown can be done streaming, but in the
end buffering is required.

micromark does not handle errors for you, so you must handle errors on whatever
streams you pipe into it.
As markdown does not know errors, `micromark` itself does not emit errors.

###### Parameters

* `options` ([`Options`][api-options], optional)
  — configuration

###### Returns

Duplex stream.

### `Options`

Configuration (TypeScript type).

##### Fields

###### `allowDangerousHtml`

Whether to allow (dangerous) HTML (`boolean`, default: `false`).

The default is `false`, which still parses the HTML according to `CommonMark`
but shows the HTML as text instead of as elements.

Pass `true` for trusted content to get actual HTML elements.
See [§ Security][security].

###### `allowDangerousProtocol`

Whether to allow dangerous protocols in links and images (`boolean`, default:
`false`).

The default is `false`, which drops URLs in links and images that use dangerous
protocols.

Pass `true` for trusted content to support all protocols.

URLs that have no protocol (which means it’s relative to the current page, such
as `./some/page.html`) and URLs that have a safe protocol (for images: `http`,
`https`; for links: `http`, `https`, `irc`, `ircs`, `mailto`, `xmpp`), are
safe.
All other URLs are dangerous and dropped.
See [§ Security][security].

###### `defaultLineEnding`

Default line ending to use when compiling to HTML, for line endings not in
`value` (`'\r'`, `'\n'`, or `'\r\n'`; default: first line ending or `'\n'`).

Generally, `micromark` copies line endings (`\r`, `\n`, `\r\n`) in the markdown
document over to the compiled HTML.
In some cases, such as `> a`, CommonMark requires that extra line endings are
added: `<blockquote>\n<p>a</p>\n</blockquote>`.

To create that line ending, the document is checked for the first line ending
that is used.
If there is no line ending, `defaultLineEnding` is used.
If that isn’t configured, `\n` is used.

###### `extensions`

Array of syntax extensions (`Array<SyntaxExtension>`, default: `[]`).
See [§ Extensions][extensions].

###### `htmlExtensions`

Array of syntax extensions (`Array<HtmlExtension>`, default: `[]`).
See [§ Extensions][extensions].

## Types

This package is fully typed with [TypeScript][].
It exports the additional type [`Options`][api-options].

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line, `micromark@4`, compatible
with Node.js 16.

## Security

This package is safe.
See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
submit a security report.

## Contribute

See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.

## Sponsor

<!-- Note: this section has to be in sync with the monorepo readme. -->

Support this effort and give back by sponsoring on [OpenCollective][]!

<table>
<tr valign="middle">
<td width="100%" align="center" colspan="10">
  <br>
  <a href="https://www.salesforce.com">Salesforce</a> 🏅<br><br>
  <a href="https://www.salesforce.com"><img src="https://images.opencollective.com/salesforce/ca8f997/logo/512.png" width="256"></a>
</td>
</tr>
<tr valign="middle">
<td width="20%" align="center" rowspan="2" colspan="2">
  <a href="https://vercel.com">Vercel</a><br><br>
  <a href="https://vercel.com"><img src="https://avatars1.githubusercontent.com/u/14985020?s=256&v=4" width="128"></a>
</td>
<td width="20%" align="center" rowspan="2" colspan="2">
  <a href="https://motif.land">Motif</a><br><br>
  <a href="https://motif.land"><img src="https://avatars1.githubusercontent.com/u/74457950?s=256&v=4" width="128"></a>
</td>
<td width="20%" align="center" rowspan="2" colspan="2">
  <a href="https://www.hashicorp.com">HashiCorp</a><br><br>
  <a href="https://www.hashicorp.com"><img src="https://avatars1.githubusercontent.com/u/761456?s=256&v=4" width="128"></a>
</td>
<td width="20%" align="center" rowspan="2" colspan="2">
  <a href="https://www.gitbook.com">GitBook</a><br><br>
  <a href="https://www.gitbook.com"><img src="https://avatars1.githubusercontent.com/u/7111340?s=256&v=4" width="128"></a>
</td>
<td width="20%" align="center" rowspan="2" colspan="2">
  <a href="https://www.gatsbyjs.org">Gatsby</a><br><br>
  <a href="https://www.gatsbyjs.org"><img src="https://avatars1.githubusercontent.com/u/12551863?s=256&v=4" width="128"></a>
</td>
</tr>
<tr valign="middle">
</tr>
<tr valign="middle">
<td width="20%" align="center" rowspan="2" colspan="2">
  <a href="https://www.netlify.com">Netlify</a><br><br>
  <!--OC has a sharper image-->
  <a href="https://www.netlify.com"><img src="https://images.opencollective.com/netlify/4087de2/logo/256.png" width="128"></a>
</td>
<td width="10%" align="center">
  <a href="https://www.coinbase.com">Coinbase</a><br><br>
  <a href="https://www.coinbase.com"><img src="https://avatars1.githubusercontent.com/u/1885080?s=256&v=4" width="64"></a>
</td>
<td width="10%" align="center">
  <a href="https://themeisle.com">ThemeIsle</a><br><br>
  <a href="https://themeisle.com"><img src="https://avatars1.githubusercontent.com/u/58979018?s=128&v=4" width="64"></a>
</td>
<td width="10%" align="center">
  <a href="https://expo.io">Expo</a><br><br>
  <a href="https://expo.io"><img src="https://avatars1.githubusercontent.com/u/12504344?s=128&v=4" width="64"></a>
</td>
<td width="10%" align="center">
  <a href="https://boostnote.io">Boost Note</a><br><br>
  <a href="https://boostnote.io"><img src="https://images.opencollective.com/boosthub/6318083/logo/128.png" width="64"></a>
</td>
<td width="10%" align="center">
  <a href="https://markdown.space">Markdown Space</a><br><br>
  <a href="https://markdown.space"><img src="https://images.opencollective.com/markdown-space/e1038ed/logo/128.png" width="64"></a>
</td>
<td width="10%" align="center">
  <a href="https://www.holloway.com">Holloway</a><br><br>
  <a href="https://www.holloway.com"><img src="https://avatars1.githubusercontent.com/u/35904294?s=128&v=4" width="64"></a>
</td>
<td width="10%"></td>
<td width="10%"></td>
</tr>
<tr valign="middle">
<td width="100%" align="center" colspan="8">
  <br>
  <a href="https://opencollective.com/unified"><strong>You?</strong></a>
  <br><br>
</td>
</tr>
</table>

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[api-micromark]: #micromarkvalue-encoding-options

[api-options]: #options

[api-stream]: #streamoptions

[author]: https://wooorm.com

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[build]: https://github.com/micromark/micromark/actions

[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg

[bundle-size]: https://bundlejs.com/?q=micromark

[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark

[chat]: https://github.com/micromark/micromark/discussions

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[cheat]: https://commonmark.org/help/

[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md

[commonmark]: https://commonmark.org

[comparison]: https://github.com/micromark/micromark#comparison

[contribute]: #contribute

[contributing]: https://github.com/micromark/.github/blob/main/contributing.md

[coverage]: https://codecov.io/github/micromark/micromark

[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg

[development]: https://nodejs.org/api/packages.html#packages_resolving_user_conditions

[directives]: https://github.com/micromark/micromark-extension-directive

[downloads]: https://www.npmjs.com/package/micromark

[downloads-badge]: https://img.shields.io/npm/dm/micromark.svg

[encoding]: https://nodejs.org/api/util.html#whatwg-supported-encodings

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[extensions]: https://github.com/micromark/micromark#extensions

[frontmatter]: https://github.com/micromark/micromark-extension-frontmatter

[gfm]: https://github.com/micromark/micromark-extension-gfm

[health]: https://github.com/micromark/.github

[license]: https://github.com/micromark/micromark/blob/main/license

[markdown-rs]: https://github.com/wooorm/markdown-rs

[math]: https://github.com/micromark/micromark-extension-math

[mdast-util-to-markdown]: https://github.com/syntax-tree/mdast-util-to-markdown

[mdxjs]: https://github.com/micromark/micromark-extension-mdxjs

[micromark]: https://github.com/micromark/micromark

[npm]: https://docs.npmjs.com/cli/install

[opencollective]: https://opencollective.com/unified

[security]: #security

[securitymd]: https://github.com/micromark/.github/blob/main/security.md

[site]: https://unifiedjs.com

[size-debug]: https://github.com/micromark/micromark#size--debug

[sponsor]: #sponsor

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[support]: https://github.com/micromark/.github/blob/main/support.md

[test]: https://github.com/micromark/micromark#test

[typescript]: https://www.typescriptlang.org

[uint8-array]: https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array
}J$axu%# micromark-core-common[micromark][] constructs that make up the core of CommonMark.
Some of these can be [turned off][disable], but they are often es@sential to
markdown and weird things might happen.

## Contents
%N/kRLicense](#license)

## What is this?

This package exposes the default constructs.IUThis package is useful when you are making your own micromark extensions.

## Installo-core-common8:* as core from 'https://esm.sh/micromark-core-commonmark@1T* as core from 'https://esm.sh/micromark-core-commonmark@1?bundle'
</script>
```

## Use

```js
import {autolink} from 'micromark-core-commonmark'

console.log(autolink) // Do things with `autolink`.
```

## API

This module exports the following identifiers: `attention`, `autolink`,
`blankLine`, `blockQuote`, `characterEscape`, `characterReference`,
`codeFenced`, `codeIndented`, `codeText`, `content`, `definition`,
`hardBreakEscape`, `headingAtx`, `htmlFlow`, `htmlText`, `labelEnd`,
`labelStartImage`, `labelStartLink`, `lineEnding`, `list`, `setextUnderline`,
`thematicBreak`.
There is no default export.

Each identifier refersF to a [construct][].

See the code for more on the exported constructsIno additional typesI
`micromark-core-commonmark@2`, compatible with Node.js 16.
This package works with `micromark@3`.

## Security

This package i.K/-core-common0-core-commona12Knstruct7)#constructs2isable7)#case-turn-off-constructs]46-core-common4@-core-commonmark.svg5jQ6v78C;99+.x 	40000 dev ~M+9Nߵ0h'100644 index.d.ts uaU'2FY_y 100644 index.js skx}Z%r$40000 lib mk#02I^100644 license 97#V}n-ƟO^100644 package.json  DhҶá<ӬzJ100644 readme.md bp֝at8{8ęxh 100644 index.d.ts uaU'2FY_y 100644 index.js skx}Z%r$40000 lib rHe+&7f<k)xnexport {frontmatter} from './lib/syntax.js'
export {frontmatterHtml} from './lib/html.js'
export {toMatters} from './lib/to-matters.js'
export type Info = import('./lib/to-matters.js').Info
export type Matter = import('./lib/to-matters.js').Matter
export type Options = import('./lib/to-matters.js').Options
export type Preset = import('./lib/to-matters.js').Preset
!x/**
 * @typedef {import('./lib/to-matters.js').Info} Info
 * @typedef {import('./lib/to-matters.js').Matter} Matter
 * @typedef {import('./lib/to-matters.js').Options} Options
 * @typedef {import('./lib/to-matters.js').Preset} Preset
 */

export {frontmatter} from './lib/syntax.js'
export {frontmatterHtml} from './lib/html.js'
export {toMatters} from './lib/to-matters.js'

// Note: we don’t have an `index.d.ts` in this extension because all token
// types are dynamic in JS
gx 100644 html.d.ts NEEܪY-P>\100644 html.js *-Ӌi%100644 syntax.d.ts z+wz|pM100644 syntax.js kIcU:L^wěo100644 to-matters.d.ts z%6j13rT100644 to-matters.js h=Ǒ_(^ 6xe/**
 * Create an extension for `micromark` to support frontmatter when serializing
 * to HTML.
 *
 * > 👉 **Note**: this makes sure nothing is generated in the output HTML for
 * > frontmatter.
 *
 * @param {Options | null | undefined} [options='yaml']
 *   Configuration (default: `'yaml'`).
 * @returns {HtmlExtension}
 *   Extension for `micromark` that can be passed in `htmlExtensions`, to
 *   support frontmatter when serializing to HTML.
 */
export function frontmatterHtml(
  options?: Options | null | undefined
): HtmlExtension
export type CompileContext = import('micromark-util-types').CompileContext
export type Handle = import('micromark-util-types').Handle
export type HtmlExtension = import('micromark-util-types').HtmlExtension
export type TokenType = import('micromark-util-types').TokenType
export type Options = import('./to-matters.js').Options
E2\x>/**
 * @typedef {import('micromark-util-types').CompileContext} CompileContext
 * @typedef {import('micromark-util-types').Handle} Handle
 * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension
 * @typedef {import('micromark-util-types').TokenType} TokenType
 * @typedef {import('./to-matters.js').Options} Options
 */

import {toMatters} from './to-matters.js'

/**
 * Create an extension for `micromark` to support frontmatter when serializing
 * to HTML.
 *
 * > 👉 **Note**: this makes sure nothing is generated in the output HTML for
 * > frontmatter.
 *
 * @param {Options | null | undefined} [options='yaml']
 *   Configuration (default: `'yaml'`).
 * @returns {HtmlExtension}
 *   Extension for `micromark` that can be passed in `htmlExtensions`, to
 *   support frontmatter when serializing to HTML.
 */
export function frontmatterHtml(options) {
  const matters = toMatters(options)
  /** @type {HtmlExtension['enter']} */
  const enter = {}
  /** @type {HtmlExtension['exit']} */
  const exit = {}
  let index = -1

  while (++index < matters.length) {
    const type = /** @type {TokenType} */ (matters[index].type)
    enter[type] = start
    exit[type] = end
  }

  return {enter, exit}

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function start() {
    this.buffer()
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function end() {
    this.resume()
    this.setData('slurpOneLineEnding', true)
  }
}
SC?x/**
 * Create an extension for `micromark` to enable frontmatter syntax.
 *
 * @param {Options | null | undefined} [options='yaml']
 *   Configuration (default: `'yaml'`).
 * @returns {Extension}
 *   Extension for `micromark` that can be passed in `extensions`, to
 *   enable frontmatter syntax.
 */
export function frontmatter(options?: Options | null | undefined): Extension
export type Construct = import('micromark-util-types').Construct
export type ConstructRecord = import('micromark-util-types').ConstructRecord
export type Extension = import('micromark-util-types').Extension
export type State = import('micromark-util-types').State
export type TokenType = import('micromark-util-types').TokenType
export type TokenizeContext = import('micromark-util-types').TokenizeContext
export type Tokenizer = import('micromark-util-types').Tokenizer
export type Info = import('./to-matters.js').Info
export type Matter = import('./to-matters.js').Matter
export type Options = import('./to-matters.js').Options
k1jx""/**
 * @typedef {import('micromark-util-types').Construct} Construct
 * @typedef {import('micromark-util-types').ConstructRecord} ConstructRecord
 * @typedef {import('micromark-util-types').Extension} Extension
 * @typedef {import('micromark-util-types').State} State
 * @typedef {import('micromark-util-types').TokenType} TokenType
 * @typedef {import('micromark-util-types').TokenizeContext} TokenizeContext
 * @typedef {import('micromark-util-types').Tokenizer} Tokenizer
 *
 * @typedef {import('./to-matters.js').Info} Info
 * @typedef {import('./to-matters.js').Matter} Matter
 * @typedef {import('./to-matters.js').Options} Options
 */

import {markdownLineEnding, markdownSpace} from 'micromark-util-character'
import {codes, types} from 'micromark-util-symbol'
import {toMatters} from './to-matters.js'

/**
 * Create an extension for `micromark` to enable frontmatter syntax.
 *
 * @param {Options | null | undefined} [options='yaml']
 *   Configuration (default: `'yaml'`).
 * @returns {Extension}
 *   Extension for `micromark` that can be passed in `extensions`, to
 *   enable frontmatter syntax.
 */
export function frontmatter(options) {
  const matters = toMatters(options)
  /** @type {ConstructRecord} */
  const flow = {}
  let index = -1

  while (++index < matters.length) {
    const matter = matters[index]
    const code = fence(matter, 'open').charCodeAt(0)
    const construct = createConstruct(matter)
    const existing = flow[code]

    if (Array.isArray(existing)) {
      existing.push(construct)
    } else {
      // Never a single object, always an array.
      flow[code] = [construct]
    }
  }

  return {flow}
}

/**
 * @param {Matter} matter
 * @returns {Construct}
 */
function createConstruct(matter) {
  const anywhere = matter.anywhere
  const frontmatterType = /** @type {TokenType} */ (matter.type)
  const fenceType = /** @type {TokenType} */ (frontmatterType + 'Fence')
  const sequenceType = /** @type {TokenType} */ (fenceType + 'Sequence')
  const valueType = /** @type {TokenType} */ (frontmatterType + 'Value')
  const closingFenceConstruct = {tokenize: tokenizeClosingFence, partial: true}

  /**
   * Fence to look for.
   *
   * @type {string}
   */
  let buffer
  let bufferIndex = 0

  return {tokenize: tokenizeFrontmatter, concrete: true}

  /**
   * @this {TokenizeContext}
   * @type {Tokenizer}
   */
  function tokenizeFrontmatter(effects, ok, nok) {
    const self = this

    return start

    /**
     * Start of frontmatter.
     *
     * ```markdown
     * > | ---
     *     ^
     *   | title: "Venus"
     *   | ---
     * ```
     *
     * @type {State}
     */
    function start(code) {
      const position = self.now()

      if (
        // Indent not allowed.
        position.column === 1 &&
        // Normally, only allowed in first line.
        (position.line === 1 || anywhere)
      ) {
        buffer = fence(matter, 'open')
        bufferIndex = 0

        if (code === buffer.charCodeAt(bufferIndex)) {
          effects.enter(frontmatterType)
          effects.enter(fenceType)
          effects.enter(sequenceType)
          return openSequence(code)
        }
      }

      return nok(code)
    }

    /**
     * In open sequence.
     *
     * ```markdown
     * > | ---
     *     ^
     *   | title: "Venus"
     *   | ---
     * ```
     *
     * @type {State}
     */
    function openSequence(code) {
      if (bufferIndex === buffer.length) {
        effects.exit(sequenceType)

        if (markdownSpace(code)) {
          effects.enter(types.whitespace)
          return openSequenceWhitespace(code)
        }

        return openAfter(code)
      }

      if (code === buffer.charCodeAt(bufferIndex++)) {
        effects.consume(code)
        return openSequence
      }

      return nok(code)
    }

    /**
     * In whitespace after open sequence.
     *
     * ```markdown
     * > | ---␠
     *        ^
     *   | title: "Venus"
     *   | ---
     * ```
     *
     * @type {State}
     */
    function openSequenceWhitespace(code) {
      if (markdownSpace(code)) {
        effects.consume(code)
        return openSequenceWhitespace
      }

      effects.exit(types.whitespace)
      return openAfter(code)
    }

    /**
     * After open sequence.
     *
     * ```markdown
     * > | ---
     *        ^
     *   | title: "Venus"
     *   | ---
     * ```
     *
     * @type {State}
     */
    function openAfter(code) {
      if (markdownLineEnding(code)) {
        effects.exit(fenceType)
        effects.enter(types.lineEnding)
        effects.consume(code)
        effects.exit(types.lineEnding)
        // Get ready for closing fence.
        buffer = fence(matter, 'close')
        bufferIndex = 0
        return effects.attempt(closingFenceConstruct, after, contentStart)
      }

      // EOF is not okay.
      return nok(code)
    }

    /**
     * Start of content chunk.
     *
     * ```markdown
     *   | ---
     * > | title: "Venus"
     *     ^
     *   | ---
     * ```
     *
     * @type {State}
     */
    function contentStart(code) {
      if (code === codes.eof || markdownLineEnding(code)) {
        return contentEnd(code)
      }

      effects.enter(valueType)
      return contentInside(code)
    }

    /**
     * In content chunk.
     *
     * ```markdown
     *   | ---
     * > | title: "Venus"
     *     ^
     *   | ---
     * ```
     *
     * @type {State}
     */
    function contentInside(code) {
      if (code === codes.eof || markdownLineEnding(code)) {
        effects.exit(valueType)
        return contentEnd(code)
      }

      effects.consume(code)
      return contentInside
    }

    /**
     * End of content chunk.
     *
     * ```markdown
     *   | ---
     * > | title: "Venus"
     *                   ^
     *   | ---
     * ```
     *
     * @type {State}
     */
    function contentEnd(code) {
      // Require a closing fence.
      if (code === codes.eof) {
        return nok(code)
      }

      // Can only be an eol.
      effects.enter(types.lineEnding)
      effects.consume(code)
      effects.exit(types.lineEnding)
      return effects.attempt(closingFenceConstruct, after, contentStart)
    }

    /**
     * After frontmatter.
     *
     * ```markdown
     *   | ---
     *   | title: "Venus"
     * > | ---
     *        ^
     * ```
     *
     * @type {State}
     */
    function after(code) {
      // `code` must be eol/eof.
      effects.exit(frontmatterType)
      return ok(code)
    }
  }

  /** @type {Tokenizer} */
  function tokenizeClosingFence(effects, ok, nok) {
    let bufferIndex = 0

    return closeStart

    /**
     * Start of close sequence.
     *
     * ```markdown
     *   | ---
     *   | title: "Venus"
     * > | ---
     *     ^
     * ```
     *
     * @type {State}
     */
    function closeStart(code) {
      if (code === buffer.charCodeAt(bufferIndex)) {
        effects.enter(fenceType)
        effects.enter(sequenceType)
        return closeSequence(code)
      }

      return nok(code)
    }

    /**
     * In close sequence.
     *
     * ```markdown
     *   | ---
     *   | title: "Venus"
     * > | ---
     *     ^
     * ```
     *
     * @type {State}
     */
    function closeSequence(code) {
      if (bufferIndex === buffer.length) {
        effects.exit(sequenceType)

        if (markdownSpace(code)) {
          effects.enter(types.whitespace)
          return closeSequenceWhitespace(code)
        }

        return closeAfter(code)
      }

      if (code === buffer.charCodeAt(bufferIndex++)) {
        effects.consume(code)
        return closeSequence
      }

      return nok(code)
    }

    /**
     * In whitespace after close sequence.
     *
     * ```markdown
     * > | ---
     *   | title: "Venus"
     *   | ---␠
     *        ^
     * ```
     *
     * @type {State}
     */
    function closeSequenceWhitespace(code) {
      if (markdownSpace(code)) {
        effects.consume(code)
        return closeSequenceWhitespace
      }

      effects.exit(types.whitespace)
      return closeAfter(code)
    }

    /**
     * After close sequence.
     *
     * ```markdown
     *   | ---
     *   | title: "Venus"
     * > | ---
     *        ^
     * ```
     *
     * @type {State}
     */
    function closeAfter(code) {
      if (code === codes.eof || markdownLineEnding(code)) {
        effects.exit(fenceType)
        return ok(code)
      }

      return nok(code)
    }
  }
}

/**
 * @param {Matter} matter
 * @param {'close' | 'open'} prop
 * @returns {string}
 */
function fence(matter, prop) {
  return matter.marker
    ? pick(matter.marker, prop).repeat(3)
    : // @ts-expect-error: They’re mutually exclusive.
      pick(matter.fence, prop)
}

/**
 * @param {Info | string} schema
 * @param {'close' | 'open'} prop
 * @returns {string}
 */
function pick(schema, prop) {
  return typeof schema === 'string' ? schema : schema[prop]
}
^R>x	i/**
 * Simplify options by normalizing them to an array of matters.
 *
 * @param {Options | null | undefined} [options='yaml']
 *   Configuration (default: `'yaml'`).
 * @returns {Array<Matter>}
 *   List of matters.
 */
export function toMatters(options?: Options | null | undefined): Array<Matter>
/**
 * Known name of a frontmatter style.
 */
export type Preset = 'toml' | 'yaml'
/**
 * Sequence.
 *
 * Depending on how this structure is used, it reflects a marker or a fence.
 */
export type Info = {
  /**
   *   Closing.
   */
  close: string
  /**
   *   Opening.
   */
  open: string
}
/**
 * Fields describing a kind of matter.
 */
export type MatterProps = {
  /**
   *   Node type to tokenize as.
   */
  type: string
  /**
   * Whether matter can be found anywhere in the document, normally, only matter
   * at the start of the document is recognized.
   *
   * > 👉 **Note**: using this is a terrible idea.
   * > It’s called frontmatter, not matter-in-the-middle or so.
   * > This makes your markdown less portable.
   */
  anywhere?: boolean | null | undefined
}
/**
 * Marker configuration.
 */
export type MarkerProps = {
  /**
   *   Character repeated 3 times, used as complete fences.
   *
   *   For example the character `'-'` will result in `'---'` being used as the
   *   fence
   *   Pass `open` and `close` to specify different characters for opening and
   *   closing fences.
   */
  marker: Info | string
  /**
   * If `marker` is set, `fence` must not be set.
   */
  fence?: never
}
/**
 * Fence configuration.
 */
export type FenceProps = {
  /**
   *   Complete fences.
   *
   *   This can be used when fences contain different characters or lengths
   *   other than 3.
   *   Pass `open` and `close` to interface to specify different characters for opening and
   *   closing fences.
   */
  fence: Info | string
  /**
   * If `fence` is set, `marker` must not be set.
   */
  marker?: never
}
/**
 * Fields describing a kind of matter.
 *
 * > 👉 **Note**: using `anywhere` is a terrible idea.
 * > It’s called frontmatter, not matter-in-the-middle or so.
 * > This makes your markdown less portable.
 *
 * > 👉 **Note**: `marker` and `fence` are mutually exclusive.
 * > If `marker` is set, `fence` must not be set, and vice versa.
 */
export type Matter = (MatterProps & FenceProps) | (MatterProps & MarkerProps)
/**
 * Configuration.
 */
export type Options = Matter | Preset | Array<Matter | Preset>
:x$x/**
 * @typedef {'toml' | 'yaml'} Preset
 *   Known name of a frontmatter style.
 *
 * @typedef Info
 *   Sequence.
 *
 *   Depending on how this structure is used, it reflects a marker or a fence.
 * @property {string} close
 *   Closing.
 * @property {string} open
 *   Opening.
 *
 * @typedef MatterProps
 *   Fields describing a kind of matter.
 * @property {string} type
 *   Node type to tokenize as.
 * @property {boolean | null | undefined} [anywhere=false]
 *   Whether matter can be found anywhere in the document, normally, only matter
 *   at the start of the document is recognized.
 *
 *   > 👉 **Note**: using this is a terrible idea.
 *   > It’s called frontmatter, not matter-in-the-middle or so.
 *   > This makes your markdown less portable.
 *
 * @typedef MarkerProps
 *   Marker configuration.
 * @property {Info | string} marker
 *   Character repeated 3 times, used as complete fences.
 *
 *   For example the character `'-'` will result in `'---'` being used as the
 *   fence
 *   Pass `open` and `close` to specify different characters for opening and
 *   closing fences.
 * @property {never} [fence]
 *   If `marker` is set, `fence` must not be set.
 *
 * @typedef FenceProps
 *   Fence configuration.
 * @property {Info | string} fence
 *   Complete fences.
 *
 *   This can be used when fences contain different characters or lengths
 *   other than 3.
 *   Pass `open` and `close` to interface to specify different characters for opening and
 *   closing fences.
 * @property {never} [marker]
 *   If `fence` is set, `marker` must not be set.
 *
 * @typedef {(MatterProps & FenceProps) | (MatterProps & MarkerProps)} Matter
 *   Fields describing a kind of matter.
 *
 *   > 👉 **Note**: using `anywhere` is a terrible idea.
 *   > It’s called frontmatter, not matter-in-the-middle or so.
 *   > This makes your markdown less portable.
 *
 *   > 👉 **Note**: `marker` and `fence` are mutually exclusive.
 *   > If `marker` is set, `fence` must not be set, and vice versa.
 *
 * @typedef {Matter | Preset | Array<Matter | Preset>} Options
 *   Configuration.
 */

import {fault} from 'fault'
const own = {}.hasOwnProperty
const markers = {
  yaml: '-',
  toml: '+'
}

/**
 * Simplify options by normalizing them to an array of matters.
 *
 * @param {Options | null | undefined} [options='yaml']
 *   Configuration (default: `'yaml'`).
 * @returns {Array<Matter>}
 *   List of matters.
 */
export function toMatters(options) {
  /** @type {Array<Matter>} */
  const result = []
  let index = -1

  /** @type {Array<Matter | Preset>} */
  const presetsOrMatters = Array.isArray(options)
    ? options
    : options
    ? [options]
    : ['yaml']
  while (++index < presetsOrMatters.length) {
    result[index] = matter(presetsOrMatters[index])
  }
  return result
}

/**
 * Simplify an option.
 *
 * @param {Matter | Preset} option
 *   Configuration.
 * @returns {Matter}
 *   Matter.
 */
function matter(option) {
  let result = option
  if (typeof result === 'string') {
    if (!own.call(markers, result)) {
      throw fault('Missing matter definition for `%s`', result)
    }
    result = {
      type: result,
      marker: markers[result]
    }
  } else if (typeof result !== 'object') {
    throw fault('Expected matter to be an object, not `%j`', result)
  }
  if (!own.call(result, 'type')) {
    throw fault('Missing `type` in matter `%j`', result)
  }
  if (!own.call(result, 'fence') && !own.call(result, 'marker')) {
    throw fault('Missing `marker` or `fence` in matter `%j`', result)
  }
  return result
}
~xx {TS0yaml: '-', toml: '+'{
g
>
    result = {type: result, marker: markers[result]}
  } elseYaJ
;.Ȧx6100644 html.d.ts NEEܪY-P>\100644 html.js S'{E52l@	:}100644 matters.d.ts ۄ;TcKKMs100644 matters.js DW@QVzvfh100644 syntax.d.ts z+wz|pM100644 syntax.js }Lcd0{!a100644 to-matters.d.ts z%6j13rT100644 to-matters.js 1EEmBcͷHly\x6/**
 * @typedef {import('micromark-util-types').CompileContext} CompileContext
 * @typedef {import('micromark-util-types').Handle} Handle
 * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension
 * @typedef {import('micromark-util-types').TokenType} TokenType
 * @typedef {import('./to-matters.js').Options} Options
 */

import {toMatters} from './to-matters.js'

/**
 * Create an extension for `micromark` to support frontmatter when serializing
 * to HTML.
 *
 * > 👉 **Note**: this makes sure nothing is generated in the output HTML for
 * > frontmatter.
 *
 * @param {Options | null | undefined} [options='yaml']
 *   Configuration (default: `'yaml'`).
 * @returns {HtmlExtension}
 *   Extension for `micromark` that can be passed in `htmlExtensions`, to
 *   support frontmatter when serializing to HTML.
 */
export function frontmatterHtml(options) {
  const matters = toMatters(options)
  /** @type {HtmlExtension['enter']} */
  const enter = {}
  /** @type {HtmlExtension['exit']} */
  const exit = {}
  let index = -1
  while (++index < matters.length) {
    const type = /** @type {TokenType} */ matters[index].type
    enter[type] = start
    exit[type] = end
  }
  return {
    enter,
    exit
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function start() {
    this.buffer()
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function end() {
    this.resume()
    this.setData('slurpOneLineEnding', true)
  }
}
Hx0 "/**
 * Simplify one or more optionAm{Acx+ ne or more optionm	sj|	$,xHED	ʓ  return {
    flow
  nmatter.type3.frontmatterType + 'Fence'|1.frontmatterType + 'Value'"
    0
    partial: true
  ]c  return {
    
    concrete: true
  	
  P0-;'whitespace':Oe  }Oe
      }.P'whitespace'_V'lineEnding')''lineEnding'
nullq( Pnullqh"2
null) {
  `[c+'lineEnding')
"'lineEnding'-;'whitespace'(Ou  }O{-?'whitespace'onullq5 +`
!x 	40000 dev @9,Ǘ1wu쟇^S100644 index.d.ts 6;U}tj!VH%/100644 index.js Qh*@$Wo,n40000 lib fa3h|XL&:<vF100644 license 97#V}n-ƟO^100644 package.json +kvH]dp)U:100644 readme.md aez+w=oe5]xh 100644 index.d.ts 6;U}tj!VH%/100644 index.js DVk9Urp]"40000 lib 9Lߔ+:=&Z5("x'export {gfmAutolinkLiteral} from './lib/syntax.js'
export {gfmAutolinkLiteralHtml} from './lib/html.js'

/**
 * Augment types.
 */
declare module 'micromark-util-types' {
  /**
   * Augment token with a field to improve performance.
   */
  interface Token {
    _gfmAutolinkLiteralWalkedInto?: boolean
  }

  /**
   * Token types.
   */
  interface TokenTypeMap {
    literalAutolink: 'literalAutolink'
    literalAutolinkEmail: 'literalAutolinkEmail'
    literalAutolinkHttp: 'literalAutolinkHttp'
    literalAutolinkWww: 'literalAutolinkWww'
  }
}
DHxh export {gfmAutolinkLiteral} from './lib/syntax.js'
export {gfmAutolinkLiteralHtml} from './lib/html.js'
&6	x k100644 html.d.ts %@4JZ2nğ%100644 html.js {EFe٫Sq󓃃U100644 syntax.d.ts -߫S 6rS5r100644 syntax.js N' 
R]3pn;x</**
 * @import {HtmlExtension} from 'micromark-util-types'
 */
/**
 * Create an HTML extension for `micromark` to support GFM task list items when
 * serializing to HTML.
 *
 * @returns {HtmlExtension}
 *   Extension for `micromark` that can be passed in `htmlExtensions` to
 *   support GFM task list items when serializing to HTML.
 */
export function gfmTaskListItemHtml(): HtmlExtension;
import type { HtmlExtension } from 'micromark-util-types';
.aPxX ?<itHub autolink literal
 * whenitHub autolink literal32AutolinkLiteralqR Rx /**
 * @import {CompileContext, Handle, HtmlExtension, Token} from 'micromark-util-types'
 */

import {sanitizeUri} from 'micromark-util-sanitize-uri'

/**
 * Create an HTML extension for `micromark` to support GitHub autolink literal
 * when serializing to HTML.
 *
 * @returns {HtmlExtension}
 *   Extension for `micromark` that can be passed in `htmlExtensions` to
 *   support GitHub autolink literal when serializing to HTML.
 */
export function gfmAutolinkLiteralHtml() {
  return {
    exit: {literalAutolinkEmail, literalAutolinkHttp, literalAutolinkWww}
  }
}

/**
 * @this {CompileContext}
 * @type {Handle}
 */
function literalAutolinkWww(token) {
  anchorFromToken.call(this, token, 'http://')
}

/**
 * @this {CompileContext}
 * @type {Handle}
 */
function literalAutolinkEmail(token) {
  anchorFromToken.call(this, token, 'mailto:')
}

/**
 * @this {CompileContext}
 * @type {Handle}
 */
function literalAutolinkHttp(token) {
  anchorFromToken.call(this, token)
}

/**
 * @this CompileContext
 * @param {Token} token
 * @param {string | null | undefined} [protocol]
 * @returns {undefined}
 */
function anchorFromToken(token, protocol) {
  const url = this.sliceSerialize(token)
  this.tag('<a href="' + sanitizeUri((protocol || '') + url) + '">')
  this.raw(this.encode(url))
  this.tag('</a>')
}
yxN/**
 * Create an extension for `micromark` to support GitHub autolink literal
 * syntax.
 *
 * @returns {Extension}
 *   Extension for `micromark` that can be passed in `extensions` to enable GFM
 *   autolink literal syntax.
 */
export function gfmAutolinkLiteral(): Extension;
import type { Extension } from 'micromark-util-types';
Kot
x<Uê/**
 * @import {Code, ConstructRecord, Event, Extension, Previous, State, TokenizeContext, Tokenizer} from 'micromark-util-types'
 */

import {
  asciiAlpha,
  asciiAlphanumeric,
  asciiControl,
  markdownLineEndingOrSpace,
  unicodePunctuation,
  unicodeWhitespace
} from 'micromark-util-character'
import {codes} from 'micromark-util-symbol'

const wwwPrefix = {tokenize: tokenizeWwwPrefix, partial: true}
const domain = {tokenize: tokenizeDomain, partial: true}
const path = {tokenize: tokenizePath, partial: true}
const trail = {tokenize: tokenizeTrail, partial: true}
const emailDomainDotTrail = {
  tokenize: tokenizeEmailDomainDotTrail,
  partial: true
}

const wwwAutolink = {
  name: 'wwwAutolink',
  tokenize: tokenizeWwwAutolink,
  previous: previousWww
}

const protocolAutolink = {
  name: 'protocolAutolink',
  tokenize: tokenizeProtocolAutolink,
  previous: previousProtocol
}

const emailAutolink = {
  name: 'emailAutolink',
  tokenize: tokenizeEmailAutolink,
  previous: previousEmail
}

/** @type {ConstructRecord} */
const text = {}

/**
 * Create an extension for `micromark` to support GitHub autolink literal
 * syntax.
 *
 * @returns {Extension}
 *   Extension for `micromark` that can be passed in `extensions` to enable GFM
 *   autolink literal syntax.
 */
export function gfmAutolinkLiteral() {
  return {text}
}

/** @type {Code} */
let code = codes.digit0

// Add alphanumerics.
while (code < codes.leftCurlyBrace) {
  text[code] = emailAutolink
  code++
  if (code === codes.colon) code = codes.uppercaseA
  else if (code === codes.leftSquareBracket) code = codes.lowercaseA
}

text[codes.plusSign] = emailAutolink
text[codes.dash] = emailAutolink
text[codes.dot] = emailAutolink
text[codes.underscore] = emailAutolink
text[codes.uppercaseH] = [emailAutolink, protocolAutolink]
text[codes.lowercaseH] = [emailAutolink, protocolAutolink]
text[codes.uppercaseW] = [emailAutolink, wwwAutolink]
text[codes.lowercaseW] = [emailAutolink, wwwAutolink]

// To do: perform email autolink literals on events, afterwards.
// That’s where `markdown-rs` and `cmark-gfm` perform it.
// It should look for `@`, then for atext backwards, and then for a label
// forwards.
// To do: `mailto:`, `xmpp:` protocol as prefix.

/**
 * Email autolink literal.
 *
 * ```markdown
 * > | a contact@example.org b
 *       ^^^^^^^^^^^^^^^^^^^
 * ```
 *
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeEmailAutolink(effects, ok, nok) {
  const self = this
  /** @type {boolean | undefined} */
  let dot
  /** @type {boolean} */
  let data

  return start

  /**
   * Start of email autolink literal.
   *
   * ```markdown
   * > | a contact@example.org b
   *       ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    if (
      !gfmAtext(code) ||
      !previousEmail.call(self, self.previous) ||
      previousUnbalanced(self.events)
    ) {
      return nok(code)
    }

    effects.enter('literalAutolink')
    effects.enter('literalAutolinkEmail')
    return atext(code)
  }

  /**
   * In email atext.
   *
   * ```markdown
   * > | a contact@example.org b
   *       ^
   * ```
   *
   * @type {State}
   */
  function atext(code) {
    if (gfmAtext(code)) {
      effects.consume(code)
      return atext
    }

    if (code === codes.atSign) {
      effects.consume(code)
      return emailDomain
    }

    return nok(code)
  }

  /**
   * In email domain.
   *
   * The reference code is a bit overly complex as it handles the `@`, of which
   * there may be just one.
   * Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L318>
   *
   * ```markdown
   * > | a contact@example.org b
   *               ^
   * ```
   *
   * @type {State}
   */
  function emailDomain(code) {
    // Dot followed by alphanumerical (not `-` or `_`).
    if (code === codes.dot) {
      return effects.check(
        emailDomainDotTrail,
        emailDomainAfter,
        emailDomainDot
      )(code)
    }

    // Alphanumerical, `-`, and `_`.
    if (
      code === codes.dash ||
      code === codes.underscore ||
      asciiAlphanumeric(code)
    ) {
      data = true
      effects.consume(code)
      return emailDomain
    }

    // To do: `/` if xmpp.

    // Note: normally we’d truncate trailing punctuation from the link.
    // However, email autolink literals cannot contain any of those markers,
    // except for `.`, but that can only occur if it isn’t trailing.
    // So we can ignore truncating!
    return emailDomainAfter(code)
  }

  /**
   * In email domain, on dot that is not a trail.
   *
   * ```markdown
   * > | a contact@example.org b
   *                      ^
   * ```
   *
   * @type {State}
   */
  function emailDomainDot(code) {
    effects.consume(code)
    dot = true
    return emailDomain
  }

  /**
   * After email domain.
   *
   * ```markdown
   * > | a contact@example.org b
   *                          ^
   * ```
   *
   * @type {State}
   */
  function emailDomainAfter(code) {
    // Domain must not be empty, must include a dot, and must end in alphabetical.
    // Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L332>.
    if (data && dot && asciiAlpha(self.previous)) {
      effects.exit('literalAutolinkEmail')
      effects.exit('literalAutolink')
      return ok(code)
    }

    return nok(code)
  }
}

/**
 * `www` autolink literal.
 *
 * ```markdown
 * > | a www.example.org b
 *       ^^^^^^^^^^^^^^^
 * ```
 *
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeWwwAutolink(effects, ok, nok) {
  const self = this

  return wwwStart

  /**
   * Start of www autolink literal.
   *
   * ```markdown
   * > | www.example.com/a?b#c
   *     ^
   * ```
   *
   * @type {State}
   */
  function wwwStart(code) {
    if (
      (code !== codes.uppercaseW && code !== codes.lowercaseW) ||
      !previousWww.call(self, self.previous) ||
      previousUnbalanced(self.events)
    ) {
      return nok(code)
    }

    effects.enter('literalAutolink')
    effects.enter('literalAutolinkWww')
    // Note: we *check*, so we can discard the `www.` we parsed.
    // If it worked, we consider it as a part of the domain.
    return effects.check(
      wwwPrefix,
      effects.attempt(domain, effects.attempt(path, wwwAfter), nok),
      nok
    )(code)
  }

  /**
   * After a www autolink literal.
   *
   * ```markdown
   * > | www.example.com/a?b#c
   *                          ^
   * ```
   *
   * @type {State}
   */
  function wwwAfter(code) {
    effects.exit('literalAutolinkWww')
    effects.exit('literalAutolink')
    return ok(code)
  }
}

/**
 * Protocol autolink literal.
 *
 * ```markdown
 * > | a https://example.org b
 *       ^^^^^^^^^^^^^^^^^^^
 * ```
 *
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeProtocolAutolink(effects, ok, nok) {
  const self = this
  let buffer = ''
  let seen = false

  return protocolStart

  /**
   * Start of protocol autolink literal.
   *
   * ```markdown
   * > | https://example.com/a?b#c
   *     ^
   * ```
   *
   * @type {State}
   */
  function protocolStart(code) {
    if (
      (code === codes.uppercaseH || code === codes.lowercaseH) &&
      previousProtocol.call(self, self.previous) &&
      !previousUnbalanced(self.events)
    ) {
      effects.enter('literalAutolink')
      effects.enter('literalAutolinkHttp')
      buffer += String.fromCodePoint(code)
      effects.consume(code)
      return protocolPrefixInside
    }

    return nok(code)
  }

  /**
   * In protocol.
   *
   * ```markdown
   * > | https://example.com/a?b#c
   *     ^^^^^
   * ```
   *
   * @type {State}
   */
  function protocolPrefixInside(code) {
    // `5` is size of `https`
    if (asciiAlpha(code) && buffer.length < 5) {
      // @ts-expect-error: definitely number.
      buffer += String.fromCodePoint(code)
      effects.consume(code)
      return protocolPrefixInside
    }

    if (code === codes.colon) {
      const protocol = buffer.toLowerCase()

      if (protocol === 'http' || protocol === 'https') {
        effects.consume(code)
        return protocolSlashesInside
      }
    }

    return nok(code)
  }

  /**
   * In slashes.
   *
   * ```markdown
   * > | https://example.com/a?b#c
   *           ^^
   * ```
   *
   * @type {State}
   */
  function protocolSlashesInside(code) {
    if (code === codes.slash) {
      effects.consume(code)

      if (seen) {
        return afterProtocol
      }

      seen = true
      return protocolSlashesInside
    }

    return nok(code)
  }

  /**
   * After protocol, before domain.
   *
   * ```markdown
   * > | https://example.com/a?b#c
   *             ^
   * ```
   *
   * @type {State}
   */
  function afterProtocol(code) {
    // To do: this is different from `markdown-rs`:
    // https://github.com/wooorm/markdown-rs/blob/b3a921c761309ae00a51fe348d8a43adbc54b518/src/construct/gfm_autolink_literal.rs#L172-L182
    return code === codes.eof ||
      asciiControl(code) ||
      markdownLineEndingOrSpace(code) ||
      unicodeWhitespace(code) ||
      unicodePunctuation(code)
      ? nok(code)
      : effects.attempt(domain, effects.attempt(path, protocolAfter), nok)(code)
  }

  /**
   * After a protocol autolink literal.
   *
   * ```markdown
   * > | https://example.com/a?b#c
   *                              ^
   * ```
   *
   * @type {State}
   */
  function protocolAfter(code) {
    effects.exit('literalAutolinkHttp')
    effects.exit('literalAutolink')
    return ok(code)
  }
}

/**
 * `www` prefix.
 *
 * ```markdown
 * > | a www.example.org b
 *       ^^^^
 * ```
 *
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeWwwPrefix(effects, ok, nok) {
  let size = 0

  return wwwPrefixInside

  /**
   * In www prefix.
   *
   * ```markdown
   * > | www.example.com
   *     ^^^^
   * ```
   *
   * @type {State}
   */
  function wwwPrefixInside(code) {
    if ((code === codes.uppercaseW || code === codes.lowercaseW) && size < 3) {
      size++
      effects.consume(code)
      return wwwPrefixInside
    }

    if (code === codes.dot && size === 3) {
      effects.consume(code)
      return wwwPrefixAfter
    }

    return nok(code)
  }

  /**
   * After www prefix.
   *
   * ```markdown
   * > | www.example.com
   *         ^
   * ```
   *
   * @type {State}
   */
  function wwwPrefixAfter(code) {
    // If there is *anything*, we can link.
    return code === codes.eof ? nok(code) : ok(code)
  }
}

/**
 * Domain.
 *
 * ```markdown
 * > | a https://example.org b
 *               ^^^^^^^^^^^
 * ```
 *
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeDomain(effects, ok, nok) {
  /** @type {boolean | undefined} */
  let underscoreInLastSegment
  /** @type {boolean | undefined} */
  let underscoreInLastLastSegment
  /** @type {boolean | undefined} */
  let seen

  return domainInside

  /**
   * In domain.
   *
   * ```markdown
   * > | https://example.com/a
   *             ^^^^^^^^^^^
   * ```
   *
   * @type {State}
   */
  function domainInside(code) {
    // Check whether this marker, which is a trailing punctuation
    // marker, optionally followed by more trailing markers, and then
    // followed by an end.
    if (code === codes.dot || code === codes.underscore) {
      return effects.check(trail, domainAfter, domainAtPunctuation)(code)
    }

    // GH documents that only alphanumerics (other than `-`, `.`, and `_`) can
    // occur, which sounds like ASCII only, but they also support `www.點看.com`,
    // so that’s Unicode.
    // Instead of some new production for Unicode alphanumerics, markdown
    // already has that for Unicode punctuation and whitespace, so use those.
    // Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L12>.
    if (
      code === codes.eof ||
      markdownLineEndingOrSpace(code) ||
      unicodeWhitespace(code) ||
      (code !== codes.dash && unicodePunctuation(code))
    ) {
      return domainAfter(code)
    }

    seen = true
    effects.consume(code)
    return domainInside
  }

  /**
   * In domain, at potential trailing punctuation, that was not trailing.
   *
   * ```markdown
   * > | https://example.com
   *                    ^
   * ```
   *
   * @type {State}
   */
  function domainAtPunctuation(code) {
    // There is an underscore in the last segment of the domain
    if (code === codes.underscore) {
      underscoreInLastSegment = true
    }
    // Otherwise, it’s a `.`: save the last segment underscore in the
    // penultimate segment slot.
    else {
      underscoreInLastLastSegment = underscoreInLastSegment
      underscoreInLastSegment = undefined
    }

    effects.consume(code)
    return domainInside
  }

  /**
   * After domain.
   *
   * ```markdown
   * > | https://example.com/a
   *                        ^
   * ```
   *
   * @type {State} */
  function domainAfter(code) {
    // Note: that’s GH says a dot is needed, but it’s not true:
    // <https://github.com/github/cmark-gfm/issues/279>
    if (underscoreInLastLastSegment || underscoreInLastSegment || !seen) {
      return nok(code)
    }

    return ok(code)
  }
}

/**
 * Path.
 *
 * ```markdown
 * > | a https://example.org/stuff b
 *                          ^^^^^^
 * ```
 *
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizePath(effects, ok) {
  let sizeOpen = 0
  let sizeClose = 0

  return pathInside

  /**
   * In path.
   *
   * ```markdown
   * > | https://example.com/a
   *                        ^^
   * ```
   *
   * @type {State}
   */
  function pathInside(code) {
    if (code === codes.leftParenthesis) {
      sizeOpen++
      effects.consume(code)
      return pathInside
    }

    // To do: `markdown-rs` also needs this.
    // If this is a paren, and there are less closings than openings,
    // we don’t check for a trail.
    if (code === codes.rightParenthesis && sizeClose < sizeOpen) {
      return pathAtPunctuation(code)
    }

    // Check whether this trailing punctuation marker is optionally
    // followed by more trailing markers, and then followed
    // by an end.
    if (
      code === codes.exclamationMark ||
      code === codes.quotationMark ||
      code === codes.ampersand ||
      code === codes.apostrophe ||
      code === codes.rightParenthesis ||
      code === codes.asterisk ||
      code === codes.comma ||
      code === codes.dot ||
      code === codes.colon ||
      code === codes.semicolon ||
      code === codes.lessThan ||
      code === codes.questionMark ||
      code === codes.rightSquareBracket ||
      code === codes.underscore ||
      code === codes.tilde
    ) {
      return effects.check(trail, ok, pathAtPunctuation)(code)
    }

    if (
      code === codes.eof ||
      markdownLineEndingOrSpace(code) ||
      unicodeWhitespace(code)
    ) {
      return ok(code)
    }

    effects.consume(code)
    return pathInside
  }

  /**
   * In path, at potential trailing punctuation, that was not trailing.
   *
   * ```markdown
   * > | https://example.com/a"b
   *                          ^
   * ```
   *
   * @type {State}
   */
  function pathAtPunctuation(code) {
    // Count closing parens.
    if (code === codes.rightParenthesis) {
      sizeClose++
    }

    effects.consume(code)
    return pathInside
  }
}

/**
 * Trail.
 *
 * This calls `ok` if this *is* the trail, followed by an end, which means
 * the entire trail is not part of the link.
 * It calls `nok` if this *is* part of the link.
 *
 * ```markdown
 * > | https://example.com").
 *                        ^^^
 * ```
 *
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeTrail(effects, ok, nok) {
  return trail

  /**
   * In trail of domain or path.
   *
   * ```markdown
   * > | https://example.com").
   *                        ^
   * ```
   *
   * @type {State}
   */
  function trail(code) {
    // Regular trailing punctuation.
    if (
      code === codes.exclamationMark ||
      code === codes.quotationMark ||
      code === codes.apostrophe ||
      code === codes.rightParenthesis ||
      code === codes.asterisk ||
      code === codes.comma ||
      code === codes.dot ||
      code === codes.colon ||
      code === codes.semicolon ||
      code === codes.questionMark ||
      code === codes.underscore ||
      code === codes.tilde
    ) {
      effects.consume(code)
      return trail
    }

    // `&` followed by one or more alphabeticals and then a `;`, is
    // as a whole considered as trailing punctuation.
    // In all other cases, it is considered as continuation of the URL.
    if (code === codes.ampersand) {
      effects.consume(code)
      return trailCharacterReferenceStart
    }

    // Needed because we allow literals after `[`, as we fix:
    // <https://github.com/github/cmark-gfm/issues/278>.
    // Check that it is not followed by `(` or `[`.
    if (code === codes.rightSquareBracket) {
      effects.consume(code)
      return trailBracketAfter
    }

    if (
      // `<` is an end.
      code === codes.lessThan ||
      // So is whitespace.
      code === codes.eof ||
      markdownLineEndingOrSpace(code) ||
      unicodeWhitespace(code)
    ) {
      return ok(code)
    }

    return nok(code)
  }

  /**
   * In trail, after `]`.
   *
   * > 👉 **Note**: this deviates from `cmark-gfm` to fix a bug.
   * > See end of <https://github.com/github/cmark-gfm/issues/278> for more.
   *
   * ```markdown
   * > | https://example.com](
   *                         ^
   * ```
   *
   * @type {State}
   */
  function trailBracketAfter(code) {
    // Whitespace or something that could start a resource or reference is the end.
    // Switch back to trail otherwise.
    if (
      code === codes.eof ||
      code === codes.leftParenthesis ||
      code === codes.leftSquareBracket ||
      markdownLineEndingOrSpace(code) ||
      unicodeWhitespace(code)
    ) {
      return ok(code)
    }

    return trail(code)
  }

  /**
   * In character-reference like trail, after `&`.
   *
   * ```markdown
   * > | https://example.com&amp;).
   *                         ^
   * ```
   *
   * @type {State}
   */
  function trailCharacterReferenceStart(code) {
    // When non-alpha, it’s not a trail.
    return asciiAlpha(code) ? trailCharacterReferenceInside(code) : nok(code)
  }

  /**
   * In character-reference like trail.
   *
   * ```markdown
   * > | https://example.com&amp;).
   *                         ^
   * ```
   *
   * @type {State}
   */
  function trailCharacterReferenceInside(code) {
    // Switch back to trail if this is well-formed.
    if (code === codes.semicolon) {
      effects.consume(code)
      return trail
    }

    if (asciiAlpha(code)) {
      effects.consume(code)
      return trailCharacterReferenceInside
    }

    // It’s not a trail.
    return nok(code)
  }
}

/**
 * Dot in email domain trail.
 *
 * This calls `ok` if this *is* the trail, followed by an end, which means
 * the trail is not part of the link.
 * It calls `nok` if this *is* part of the link.
 *
 * ```markdown
 * > | contact@example.org.
 *                        ^
 * ```
 *
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeEmailDomainDotTrail(effects, ok, nok) {
  return start

  /**
   * Dot.
   *
   * ```markdown
   * > | contact@example.org.
   *                    ^   ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    // Must be dot.
    effects.consume(code)
    return after
  }

  /**
   * After dot.
   *
   * ```markdown
   * > | contact@example.org.
   *                     ^   ^
   * ```
   *
   * @type {State}
   */
  function after(code) {
    // Not a trail if alphanumeric.
    return asciiAlphanumeric(code) ? nok(code) : ok(code)
  }
}

/**
 * See:
 * <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L156>.
 *
 * @type {Previous}
 */
function previousWww(code) {
  return (
    code === codes.eof ||
    code === codes.leftParenthesis ||
    code === codes.asterisk ||
    code === codes.underscore ||
    code === codes.leftSquareBracket ||
    code === codes.rightSquareBracket ||
    code === codes.tilde ||
    markdownLineEndingOrSpace(code)
  )
}

/**
 * See:
 * <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L214>.
 *
 * @type {Previous}
 */
function previousProtocol(code) {
  return !asciiAlpha(code)
}

/**
 * @this {TokenizeContext}
 * @type {Previous}
 */
function previousEmail(code) {
  // Do not allow a slash “inside” atext.
  // The reference code is a bit weird, but that’s what it results in.
  // Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L307>.
  // Other than slash, every preceding character is allowed.
  return !(code === codes.slash || gfmAtext(code))
}

/**
 * @param {Code} code
 * @returns {boolean}
 */
function gfmAtext(code) {
  return (
    code === codes.plusSign ||
    code === codes.dash ||
    code === codes.dot ||
    code === codes.underscore ||
    asciiAlphanumeric(code)
  )
}

/**
 * @param {Array<Event>} events
 * @returns {boolean}
 */
function previousUnbalanced(events) {
  let index = events.length
  let result = false

  while (index--) {
    const token = events[index][1]

    if (
      (token.type === 'labelLink' || token.type === 'labelImage') &&
      !token._balanced
    ) {
      result = true
      break
    }

    // If we’ve seen this token, and it was marked as not having any unbalanced
    // bracket before it, we can exit.
    if (token._gfmAutolinkLiteralWalkedInto) {
      result = false
      break
    }
  }

  if (events.length > 0 && !result) {
    // Mark the last token as “walked into” w/o finding
    // anything.
    events[events.length - 1][1]._gfmAutolinkLiteralWalkedInto = true
  }

  return result
}
Lxm export { gfmAutolinkLiteral } from './lib/syntax.js';
export { gfmAutolinkLiteralHtml } from './lib/html.js';'"	x k100644 html.d.ts %@4JZ2nğ%100644 html.js YaE100644 syntax.d.ts -߫S 6rS5r100644 syntax.js k4ӳ4(f)̱HoLnq;,TxB/**
 * @import {CompileContext, Handle, HtmlExtension, Token} from 'micromark-util-types'
 */

import { sanitizeUri } from 'micromark-util-sanitize-uri';

/**
 * Create an HTML extension for `micromark` to support GitHub autolink literal
 * when serializing to HTML.
 *
 * @returns {HtmlExtension}
 *   Extension for `micromark` that can be passed in `htmlExtensions` to
 *   support GitHub autolink literal when serializing to HTML.
 */
export function gfmAutolinkLiteralHtml() {
  return {
    exit: {
      literalAutolinkEmail,
      literalAutolinkHttp,
      literalAutolinkWww
    }
  };
}

/**
 * @this {CompileContext}
 * @type {Handle}
 */
function literalAutolinkWww(token) {
  anchorFromToken.call(this, token, 'http://');
}

/**
 * @this {CompileContext}
 * @type {Handle}
 */
function literalAutolinkEmail(token) {
  anchorFromToken.call(this, token, 'mailto:');
}

/**
 * @this {CompileContext}
 * @type {Handle}
 */
function literalAutolinkHttp(token) {
  anchorFromToken.call(this, token);
}

/**
 * @this CompileContext
 * @param {Token} token
 * @param {string | null | undefined} [protocol]
 * @returns {undefined}
 */
function anchorFromToken(token, protocol) {
  const url = this.sliceSerialize(token);
  this.tag('<a href="' + sanitizeUri((protocol || '') + url) + '">');
  this.raw(this.encode(url));
  this.tag('</a>');
}Ê	x4O˰/**
 * @import {Code, ConstructRecord, Event, Extension, Previous, State, TokenizeContext, Tokenizer} from 'micromark-util-types'
 */

import { asciiAlpha, asciiAlphanumeric, asciiControl, markdownLineEndingOrSpace, unicodePunctuation, unicodeWhitespace } from 'micromark-util-character';
const wwwPrefix = {
  tokenize: tokenizeWwwPrefix,
  partial: true
};
const domain = {
  tokenize: tokenizeDomain,
  partial: true
};
const path = {
  tokenize: tokenizePath,
  partial: true
};
const trail = {
  tokenize: tokenizeTrail,
  partial: true
};
const emailDomainDotTrail = {
  tokenize: tokenizeEmailDomainDotTrail,
  partial: true
};
const wwwAutolink = {
  name: 'wwwAutolink',
  tokenize: tokenizeWwwAutolink,
  previous: previousWww
};
const protocolAutolink = {
  name: 'protocolAutolink',
  tokenize: tokenizeProtocolAutolink,
  previous: previousProtocol
};
const emailAutolink = {
  name: 'emailAutolink',
  tokenize: tokenizeEmailAutolink,
  previous: previousEmail
};

/** @type {ConstructRecord} */
const text = {};

/**
 * Create an extension for `micromark` to support GitHub autolink literal
 * syntax.
 *
 * @returns {Extension}
 *   Extension for `micromark` that can be passed in `extensions` to enable GFM
 *   autolink literal syntax.
 */
export function gfmAutolinkLiteral() {
  return {
    text
  };
}

/** @type {Code} */
let code = 48;

// Add alphanumerics.
while (code < 123) {
  text[code] = emailAutolink;
  code++;
  if (code === 58) code = 65;else if (code === 91) code = 97;
}
text[43] = emailAutolink;
text[45] = emailAutolink;
text[46] = emailAutolink;
text[95] = emailAutolink;
text[72] = [emailAutolink, protocolAutolink];
text[104] = [emailAutolink, protocolAutolink];
text[87] = [emailAutolink, wwwAutolink];
text[119] = [emailAutolink, wwwAutolink];

// To do: perform email autolink literals on events, afterwards.
// That’s where `markdown-rs` and `cmark-gfm` perform it.
// It should look for `@`, then for atext backwards, and then for a label
// forwards.
// To do: `mailto:`, `xmpp:` protocol as prefix.

/**
 * Email autolink literal.
 *
 * ```markdown
 * > | a contact@example.org b
 *       ^^^^^^^^^^^^^^^^^^^
 * ```
 *
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeEmailAutolink(effects, ok, nok) {
  const self = this;
  /** @type {boolean | undefined} */
  let dot;
  /** @type {boolean} */
  let data;
  return start;

  /**
   * Start of email autolink literal.
   *
   * ```markdown
   * > | a contact@example.org b
   *       ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    if (!gfmAtext(code) || !previousEmail.call(self, self.previous) || previousUnbalanced(self.events)) {
      return nok(code);
    }
    effects.enter('literalAutolink');
    effects.enter('literalAutolinkEmail');
    return atext(code);
  }

  /**
   * In email atext.
   *
   * ```markdown
   * > | a contact@example.org b
   *       ^
   * ```
   *
   * @type {State}
   */
  function atext(code) {
    if (gfmAtext(code)) {
      effects.consume(code);
      return atext;
    }
    if (code === 64) {
      effects.consume(code);
      return emailDomain;
    }
    return nok(code);
  }

  /**
   * In email domain.
   *
   * The reference code is a bit overly complex as it handles the `@`, of which
   * there may be just one.
   * Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L318>
   *
   * ```markdown
   * > | a contact@example.org b
   *               ^
   * ```
   *
   * @type {State}
   */
  function emailDomain(code) {
    // Dot followed by alphanumerical (not `-` or `_`).
    if (code === 46) {
      return effects.check(emailDomainDotTrail, emailDomainAfter, emailDomainDot)(code);
    }

    // Alphanumerical, `-`, and `_`.
    if (code === 45 || code === 95 || asciiAlphanumeric(code)) {
      data = true;
      effects.consume(code);
      return emailDomain;
    }

    // To do: `/` if xmpp.

    // Note: normally we’d truncate trailing punctuation from the link.
    // However, email autolink literals cannot contain any of those markers,
    // except for `.`, but that can only occur if it isn’t trailing.
    // So we can ignore truncating!
    return emailDomainAfter(code);
  }

  /**
   * In email domain, on dot that is not a trail.
   *
   * ```markdown
   * > | a contact@example.org b
   *                      ^
   * ```
   *
   * @type {State}
   */
  function emailDomainDot(code) {
    effects.consume(code);
    dot = true;
    return emailDomain;
  }

  /**
   * After email domain.
   *
   * ```markdown
   * > | a contact@example.org b
   *                          ^
   * ```
   *
   * @type {State}
   */
  function emailDomainAfter(code) {
    // Domain must not be empty, must include a dot, and must end in alphabetical.
    // Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L332>.
    if (data && dot && asciiAlpha(self.previous)) {
      effects.exit('literalAutolinkEmail');
      effects.exit('literalAutolink');
      return ok(code);
    }
    return nok(code);
  }
}

/**
 * `www` autolink literal.
 *
 * ```markdown
 * > | a www.example.org b
 *       ^^^^^^^^^^^^^^^
 * ```
 *
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeWwwAutolink(effects, ok, nok) {
  const self = this;
  return wwwStart;

  /**
   * Start of www autolink literal.
   *
   * ```markdown
   * > | www.example.com/a?b#c
   *     ^
   * ```
   *
   * @type {State}
   */
  function wwwStart(code) {
    if (code !== 87 && code !== 119 || !previousWww.call(self, self.previous) || previousUnbalanced(self.events)) {
      return nok(code);
    }
    effects.enter('literalAutolink');
    effects.enter('literalAutolinkWww');
    // Note: we *check*, so we can discard the `www.` we parsed.
    // If it worked, we consider it as a part of the domain.
    return effects.check(wwwPrefix, effects.attempt(domain, effects.attempt(path, wwwAfter), nok), nok)(code);
  }

  /**
   * After a www autolink literal.
   *
   * ```markdown
   * > | www.example.com/a?b#c
   *                          ^
   * ```
   *
   * @type {State}
   */
  function wwwAfter(code) {
    effects.exit('literalAutolinkWww');
    effects.exit('literalAutolink');
    return ok(code);
  }
}

/**
 * Protocol autolink literal.
 *
 * ```markdown
 * > | a https://example.org b
 *       ^^^^^^^^^^^^^^^^^^^
 * ```
 *
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeProtocolAutolink(effects, ok, nok) {
  const self = this;
  let buffer = '';
  let seen = false;
  return protocolStart;

  /**
   * Start of protocol autolink literal.
   *
   * ```markdown
   * > | https://example.com/a?b#c
   *     ^
   * ```
   *
   * @type {State}
   */
  function protocolStart(code) {
    if ((code === 72 || code === 104) && previousProtocol.call(self, self.previous) && !previousUnbalanced(self.events)) {
      effects.enter('literalAutolink');
      effects.enter('literalAutolinkHttp');
      buffer += String.fromCodePoint(code);
      effects.consume(code);
      return protocolPrefixInside;
    }
    return nok(code);
  }

  /**
   * In protocol.
   *
   * ```markdown
   * > | https://example.com/a?b#c
   *     ^^^^^
   * ```
   *
   * @type {State}
   */
  function protocolPrefixInside(code) {
    // `5` is size of `https`
    if (asciiAlpha(code) && buffer.length < 5) {
      // @ts-expect-error: definitely number.
      buffer += String.fromCodePoint(code);
      effects.consume(code);
      return protocolPrefixInside;
    }
    if (code === 58) {
      const protocol = buffer.toLowerCase();
      if (protocol === 'http' || protocol === 'https') {
        effects.consume(code);
        return protocolSlashesInside;
      }
    }
    return nok(code);
  }

  /**
   * In slashes.
   *
   * ```markdown
   * > | https://example.com/a?b#c
   *           ^^
   * ```
   *
   * @type {State}
   */
  function protocolSlashesInside(code) {
    if (code === 47) {
      effects.consume(code);
      if (seen) {
        return afterProtocol;
      }
      seen = true;
      return protocolSlashesInside;
    }
    return nok(code);
  }

  /**
   * After protocol, before domain.
   *
   * ```markdown
   * > | https://example.com/a?b#c
   *             ^
   * ```
   *
   * @type {State}
   */
  function afterProtocol(code) {
    // To do: this is different from `markdown-rs`:
    // https://github.com/wooorm/markdown-rs/blob/b3a921c761309ae00a51fe348d8a43adbc54b518/src/construct/gfm_autolink_literal.rs#L172-L182
    return code === null || asciiControl(code) || markdownLineEndingOrSpace(code) || unicodeWhitespace(code) || unicodePunctuation(code) ? nok(code) : effects.attempt(domain, effects.attempt(path, protocolAfter), nok)(code);
  }

  /**
   * After a protocol autolink literal.
   *
   * ```markdown
   * > | https://example.com/a?b#c
   *                              ^
   * ```
   *
   * @type {State}
   */
  function protocolAfter(code) {
    effects.exit('literalAutolinkHttp');
    effects.exit('literalAutolink');
    return ok(code);
  }
}

/**
 * `www` prefix.
 *
 * ```markdown
 * > | a www.example.org b
 *       ^^^^
 * ```
 *
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeWwwPrefix(effects, ok, nok) {
  let size = 0;
  return wwwPrefixInside;

  /**
   * In www prefix.
   *
   * ```markdown
   * > | www.example.com
   *     ^^^^
   * ```
   *
   * @type {State}
   */
  function wwwPrefixInside(code) {
    if ((code === 87 || code === 119) && size < 3) {
      size++;
      effects.consume(code);
      return wwwPrefixInside;
    }
    if (code === 46 && size === 3) {
      effects.consume(code);
      return wwwPrefixAfter;
    }
    return nok(code);
  }

  /**
   * After www prefix.
   *
   * ```markdown
   * > | www.example.com
   *         ^
   * ```
   *
   * @type {State}
   */
  function wwwPrefixAfter(code) {
    // If there is *anything*, we can link.
    return code === null ? nok(code) : ok(code);
  }
}

/**
 * Domain.
 *
 * ```markdown
 * > | a https://example.org b
 *               ^^^^^^^^^^^
 * ```
 *
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeDomain(effects, ok, nok) {
  /** @type {boolean | undefined} */
  let underscoreInLastSegment;
  /** @type {boolean | undefined} */
  let underscoreInLastLastSegment;
  /** @type {boolean | undefined} */
  let seen;
  return domainInside;

  /**
   * In domain.
   *
   * ```markdown
   * > | https://example.com/a
   *             ^^^^^^^^^^^
   * ```
   *
   * @type {State}
   */
  function domainInside(code) {
    // Check whether this marker, which is a trailing punctuation
    // marker, optionally followed by more trailing markers, and then
    // followed by an end.
    if (code === 46 || code === 95) {
      return effects.check(trail, domainAfter, domainAtPunctuation)(code);
    }

    // GH documents that only alphanumerics (other than `-`, `.`, and `_`) can
    // occur, which sounds like ASCII only, but they also support `www.點看.com`,
    // so that’s Unicode.
    // Instead of some new production for Unicode alphanumerics, markdown
    // already has that for Unicode punctuation and whitespace, so use those.
    // Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L12>.
    if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code) || code !== 45 && unicodePunctuation(code)) {
      return domainAfter(code);
    }
    seen = true;
    effects.consume(code);
    return domainInside;
  }

  /**
   * In domain, at potential trailing punctuation, that was not trailing.
   *
   * ```markdown
   * > | https://example.com
   *                    ^
   * ```
   *
   * @type {State}
   */
  function domainAtPunctuation(code) {
    // There is an underscore in the last segment of the domain
    if (code === 95) {
      underscoreInLastSegment = true;
    }
    // Otherwise, it’s a `.`: save the last segment underscore in the
    // penultimate segment slot.
    else {
      underscoreInLastLastSegment = underscoreInLastSegment;
      underscoreInLastSegment = undefined;
    }
    effects.consume(code);
    return domainInside;
  }

  /**
   * After domain.
   *
   * ```markdown
   * > | https://example.com/a
   *                        ^
   * ```
   *
   * @type {State} */
  function domainAfter(code) {
    // Note: that’s GH says a dot is needed, but it’s not true:
    // <https://github.com/github/cmark-gfm/issues/279>
    if (underscoreInLastLastSegment || underscoreInLastSegment || !seen) {
      return nok(code);
    }
    return ok(code);
  }
}

/**
 * Path.
 *
 * ```markdown
 * > | a https://example.org/stuff b
 *                          ^^^^^^
 * ```
 *
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizePath(effects, ok) {
  let sizeOpen = 0;
  let sizeClose = 0;
  return pathInside;

  /**
   * In path.
   *
   * ```markdown
   * > | https://example.com/a
   *                        ^^
   * ```
   *
   * @type {State}
   */
  function pathInside(code) {
    if (code === 40) {
      sizeOpen++;
      effects.consume(code);
      return pathInside;
    }

    // To do: `markdown-rs` also needs this.
    // If this is a paren, and there are less closings than openings,
    // we don’t check for a trail.
    if (code === 41 && sizeClose < sizeOpen) {
      return pathAtPunctuation(code);
    }

    // Check whether this trailing punctuation marker is optionally
    // followed by more trailing markers, and then followed
    // by an end.
    if (code === 33 || code === 34 || code === 38 || code === 39 || code === 41 || code === 42 || code === 44 || code === 46 || code === 58 || code === 59 || code === 60 || code === 63 || code === 93 || code === 95 || code === 126) {
      return effects.check(trail, ok, pathAtPunctuation)(code);
    }
    if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {
      return ok(code);
    }
    effects.consume(code);
    return pathInside;
  }

  /**
   * In path, at potential trailing punctuation, that was not trailing.
   *
   * ```markdown
   * > | https://example.com/a"b
   *                          ^
   * ```
   *
   * @type {State}
   */
  function pathAtPunctuation(code) {
    // Count closing parens.
    if (code === 41) {
      sizeClose++;
    }
    effects.consume(code);
    return pathInside;
  }
}

/**
 * Trail.
 *
 * This calls `ok` if this *is* the trail, followed by an end, which means
 * the entire trail is not part of the link.
 * It calls `nok` if this *is* part of the link.
 *
 * ```markdown
 * > | https://example.com").
 *                        ^^^
 * ```
 *
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeTrail(effects, ok, nok) {
  return trail;

  /**
   * In trail of domain or path.
   *
   * ```markdown
   * > | https://example.com").
   *                        ^
   * ```
   *
   * @type {State}
   */
  function trail(code) {
    // Regular trailing punctuation.
    if (code === 33 || code === 34 || code === 39 || code === 41 || code === 42 || code === 44 || code === 46 || code === 58 || code === 59 || code === 63 || code === 95 || code === 126) {
      effects.consume(code);
      return trail;
    }

    // `&` followed by one or more alphabeticals and then a `;`, is
    // as a whole considered as trailing punctuation.
    // In all other cases, it is considered as continuation of the URL.
    if (code === 38) {
      effects.consume(code);
      return trailCharacterReferenceStart;
    }

    // Needed because we allow literals after `[`, as we fix:
    // <https://github.com/github/cmark-gfm/issues/278>.
    // Check that it is not followed by `(` or `[`.
    if (code === 93) {
      effects.consume(code);
      return trailBracketAfter;
    }
    if (
    // `<` is an end.
    code === 60 ||
    // So is whitespace.
    code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {
      return ok(code);
    }
    return nok(code);
  }

  /**
   * In trail, after `]`.
   *
   * > 👉 **Note**: this deviates from `cmark-gfm` to fix a bug.
   * > See end of <https://github.com/github/cmark-gfm/issues/278> for more.
   *
   * ```markdown
   * > | https://example.com](
   *                         ^
   * ```
   *
   * @type {State}
   */
  function trailBracketAfter(code) {
    // Whitespace or something that could start a resource or reference is the end.
    // Switch back to trail otherwise.
    if (code === null || code === 40 || code === 91 || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {
      return ok(code);
    }
    return trail(code);
  }

  /**
   * In character-reference like trail, after `&`.
   *
   * ```markdown
   * > | https://example.com&amp;).
   *                         ^
   * ```
   *
   * @type {State}
   */
  function trailCharacterReferenceStart(code) {
    // When non-alpha, it’s not a trail.
    return asciiAlpha(code) ? trailCharacterReferenceInside(code) : nok(code);
  }

  /**
   * In character-reference like trail.
   *
   * ```markdown
   * > | https://example.com&amp;).
   *                         ^
   * ```
   *
   * @type {State}
   */
  function trailCharacterReferenceInside(code) {
    // Switch back to trail if this is well-formed.
    if (code === 59) {
      effects.consume(code);
      return trail;
    }
    if (asciiAlpha(code)) {
      effects.consume(code);
      return trailCharacterReferenceInside;
    }

    // It’s not a trail.
    return nok(code);
  }
}

/**
 * Dot in email domain trail.
 *
 * This calls `ok` if this *is* the trail, followed by an end, which means
 * the trail is not part of the link.
 * It calls `nok` if this *is* part of the link.
 *
 * ```markdown
 * > | contact@example.org.
 *                        ^
 * ```
 *
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeEmailDomainDotTrail(effects, ok, nok) {
  return start;

  /**
   * Dot.
   *
   * ```markdown
   * > | contact@example.org.
   *                    ^   ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    // Must be dot.
    effects.consume(code);
    return after;
  }

  /**
   * After dot.
   *
   * ```markdown
   * > | contact@example.org.
   *                     ^   ^
   * ```
   *
   * @type {State}
   */
  function after(code) {
    // Not a trail if alphanumeric.
    return asciiAlphanumeric(code) ? nok(code) : ok(code);
  }
}

/**
 * See:
 * <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L156>.
 *
 * @type {Previous}
 */
function previousWww(code) {
  return code === null || code === 40 || code === 42 || code === 95 || code === 91 || code === 93 || code === 126 || markdownLineEndingOrSpace(code);
}

/**
 * See:
 * <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L214>.
 *
 * @type {Previous}
 */
function previousProtocol(code) {
  return !asciiAlpha(code);
}

/**
 * @this {TokenizeContext}
 * @type {Previous}
 */
function previousEmail(code) {
  // Do not allow a slash “inside” atext.
  // The reference code is a bit weird, but that’s what it results in.
  // Source: <https://github.com/github/cmark-gfm/blob/ef1cfcb/extensions/autolink.c#L307>.
  // Other than slash, every preceding character is allowed.
  return !(code === 47 || gfmAtext(code));
}

/**
 * @param {Code} code
 * @returns {boolean}
 */
function gfmAtext(code) {
  return code === 43 || code === 45 || code === 46 || code === 95 || asciiAlphanumeric(code);
}

/**
 * @param {Array<Event>} events
 * @returns {boolean}
 */
function previousUnbalanced(events) {
  let index = events.length;
  let result = false;
  while (index--) {
    const token = events[index][1];
    if ((token.type === 'labelLink' || token.type === 'labelImage') && !token._balanced) {
      result = true;
      break;
    }

    // If we’ve seen this token, and it was marked as not having any unbalanced
    // bracket before it, we can exit.
    if (token._gfmAutolinkLiteralWalkedInto) {
      result = false;
      break;
    }
  }
  if (events.length > 0 && !result) {
    // Mark the last token as “walked into” w/o finding
    // anything.
    events[events.length - 1][1]._gfmAutolinkLiteralWalkedInto = true;
  }
  return result;
}Z3x %autolink-literal3Nautolink literalY:literal",
    "url",
    "autolink",
    "auto",
    "link-dautolink-literalCautolink-literalu3+anitize-uri<|
hype": "^1ym
complexity
	2a	
@070Px 	40000 dev /D>Uȿ̓e100644 index.d.ts ↇ:Yɡ>
100644 index.js =K' >-H(40000 lib ~hF6-Ę<100644 license 1D3N_i~ 100644 package.json >lFKkᯉ3ZC100644 readme.md LDjwYHk3GD:Gd!xh 100644 index.d.ts ↇ:Yɡ>
100644 index.js Ek,{;T40000 lib Sӷ3E`2%4-(xAexport {gfmFootnoteHtml, defaultBackLabel} from './lib/html.js'
export {gfmFootnote} from './lib/syntax.js'

/**
 * Generate a back label dynamically.
 *
 * For the following markdown:
 *
 * ```markdown
 * Alpha[^micromark], bravo[^micromark], and charlie[^remark].
 *
 * [^remark]: things about remark
 * [^micromark]: things about micromark
 * ```
 *
 * This function will be called with:
 *
 * * `0` and `0` for the backreference from `things about micromark` to
 *  `alpha`, as it is the first used definition, and the first call to it
 * * `0` and `1` for the backreference from `things about micromark` to
 *  `bravo`, as it is the first used definition, and the second call to it
 * * `1` and `0` for the backreference from `things about remark` to
 *  `charlie`, as it is the second used definition
 *
 * @param referenceIndex
 *   Index of the definition in the order that they are first referenced,
 *   0-indexed.
 * @param rereferenceIndex
 *   Index of calls to the same definition, 0-indexed.
 * @returns
 *   Back label to use when linking back from definitions to their reference.
 */
export type BackLabelTemplate = (
  referenceIndex: number,
  rereferenceIndex: number
) => string

/**
 * Configuration.
 */
export interface HtmlOptions {
  /**
   * Prefix to use before the `id` attribute on footnotes to prevent them from
   * *clobbering* (default: `'user-content-'`).
   *
   * Pass `''` for trusted markdown and when you are careful with
   * polyfilling.
   * You could pass a different prefix.
   *
   * DOM clobbering is this:
   *
   * ```html
   * <p id="x"></p>
   * <script>alert(x) // `x` now refers to the `p#x` DOM element</script>
   * ```
   *
   * The above example shows that elements are made available by browsers, by
   * their ID, on the `window` object.
   * This is a security risk because you might be expecting some other variable
   * at that place.
   * It can also break polyfills.
   * Using a prefix solves these problems.
   */
  clobberPrefix?: string | null | undefined
  /**
   * Textual label to use for the footnotes section (default: `'Footnotes'`).
   *
   * Change it when the markdown is not in English.
   *
   * This label is typically hidden visually (assuming a `sr-only` CSS class
   * is defined that does that) and so affects screen readers only.
   * If you do have such a class, but want to show this section to everyone,
   * pass different attributes with the `labelAttributes` option.
   */
  label?: string | null | undefined
  /**
   * Attributes to use on the footnote label (default: `'class="sr-only"'`).
   *
   * Change it to show the label and add other attributes.
   *
   * This label is typically hidden visually (assuming an `sr-only` CSS class
   * is defined that does that) and so affects screen readers only.
   * If you do have such a class, but want to show this section to everyone,
   * pass an empty string.
   * You can also add different attributes.
   *
   * > 👉 **Note**: `id="footnote-label"` is always added, because footnote
   * > calls use it with `aria-describedby` to provide an accessible label.
   */
  labelAttributes?: string | null | undefined
  /**
   * HTML tag name to use for the footnote label element (default: `'h2'`).
   *
   * Change it to match your document structure.
   *
   * This label is typically hidden visually (assuming a `sr-only` CSS class
   * is defined that does that) and so affects screen readers only.
   * If you do have such a class, but want to show this section to everyone,
   * pass different attributes with the `labelAttributes` option.
   */
  labelTagName?: string | null | undefined
  /**
   * Textual label to describe the backreference back to references (default:
   * `defaultBackLabel`).
   *
   * The default value is:
   *
   * ```js
   * function defaultBackLabel(referenceIndex, rereferenceIndex) {
   *   return (
   *     'Back to reference ' +
   *     (referenceIndex + 1) +
   *     (rereferenceIndex > 1 ? '-' + rereferenceIndex : '')
   *   )
   * }
   * ```
   *
   * Change it when the markdown is not in English.
   *
   * This label is used in the `aria-label` attribute on each backreference
   * (the `↩` links).
   * It affects users of assistive technology.
   */
  backLabel?: BackLabelTemplate | string | null | undefined
}

/**
 * Augment types.
 */
declare module 'micromark-util-types' {
  /**
   * Compile data.
   */
  interface CompileData {
    gfmFootnoteDefinitions?: Record<string, string>
    gfmFootnoteDefinitionStack?: Array<string>
    gfmFootnoteCallCounts?: Record<string, number>
    gfmFootnoteCallOrder?: Array<string>
  }

  /**
   * Parse context.
   */
  interface ParseContext {
    gfmFootnotes?: Array<string>
  }

  /**
   * Token types.
   */
  interface TokenTypeMap {
    gfmFootnoteCall: 'gfmFootnoteCall'
    gfmFootnoteCallLabelMarker: 'gfmFootnoteCallLabelMarker'
    gfmFootnoteCallMarker: 'gfmFootnoteCallMarker'
    gfmFootnoteCallString: 'gfmFootnoteCallString'
    gfmFootnoteDefinition: 'gfmFootnoteDefinition'
    gfmFootnoteDefinitionIndent: 'gfmFootnoteDefinitionIndent'
    gfmFootnoteDefinitionLabel: 'gfmFootnoteDefinitionLabel'
    gfmFootnoteDefinitionLabelMarker: 'gfmFootnoteDefinitionLabelMarker'
    gfmFootnoteDefinitionLabelString: 'gfmFootnoteDefinitionLabelString'
    gfmFootnoteDefinitionMarker: 'gfmFootnoteDefinitionMarker'
    gfmFootnoteDefinitionWhitespace: 'gfmFootnoteDefinitionWhitespace'
  }
}
$	x `// Note: types are exported from `dev/index.d.ts`.
export {gfmFootnote} from './lib/syntax.js'
export {gfmFootnoteHtml, defaultBackLabel} from './lib/html.js'
78ˤ	x k100644 html.d.ts *l53c^Z0X}100644 html.js /=wfGw:zb100644 syntax.d.ts ڣT͔;b+y100644 syntax.js Hd0QZW6DMTȩT="=x /**
 * Generate the default label that GitHub uses on backreferences.
 *
 * @param {number} referenceIndex
 *   Index of the definition in the order that they are first referenced,
 *   0-indexed.
 * @param {number} rereferenceIndex
 *   Index of calls to the same definition, 0-indexed.
 * @returns {string}
 *   Default label.
 */
export function defaultBackLabel(referenceIndex: number, rereferenceIndex: number): string;
/**
 * Create an extension for `micromark` to support GFM footnotes when
 * serializing to HTML.
 *
 * @param {Options | null | undefined} [options={}]
 *   Configuration (optional).
 * @returns {HtmlExtension}
 *   Extension for `micromark` that can be passed in `htmlExtensions` to
 *   support GFM footnotes when serializing to HTML.
 */
export function gfmFootnoteHtml(options?: Options | null | undefined): HtmlExtension;
import type { HtmlOptions as Options } from 'micromark-extension-gfm-footnote';
import type { HtmlExtension } from 'micromark-util-types';
(Y$xf/**
 * @import {HtmlOptions as Options} from 'micromark-extension-gfm-footnote'
 * @import {HtmlExtension} from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {normalizeIdentifier} from 'micromark-util-normalize-identifier'
import {sanitizeUri} from 'micromark-util-sanitize-uri'

const own = {}.hasOwnProperty

/** @type {Options} */
const emptyOptions = {}

/**
 * Generate the default label that GitHub uses on backreferences.
 *
 * @param {number} referenceIndex
 *   Index of the definition in the order that they are first referenced,
 *   0-indexed.
 * @param {number} rereferenceIndex
 *   Index of calls to the same definition, 0-indexed.
 * @returns {string}
 *   Default label.
 */
export function defaultBackLabel(referenceIndex, rereferenceIndex) {
  return (
    'Back to reference ' +
    (referenceIndex + 1) +
    (rereferenceIndex > 1 ? '-' + rereferenceIndex : '')
  )
}

/**
 * Create an extension for `micromark` to support GFM footnotes when
 * serializing to HTML.
 *
 * @param {Options | null | undefined} [options={}]
 *   Configuration (optional).
 * @returns {HtmlExtension}
 *   Extension for `micromark` that can be passed in `htmlExtensions` to
 *   support GFM footnotes when serializing to HTML.
 */
export function gfmFootnoteHtml(options) {
  const config = options || emptyOptions
  const label = config.label || 'Footnotes'
  const labelTagName = config.labelTagName || 'h2'
  const labelAttributes =
    config.labelAttributes === null || config.labelAttributes === undefined
      ? 'class="sr-only"'
      : config.labelAttributes
  const backLabel = config.backLabel || defaultBackLabel
  const clobberPrefix =
    config.clobberPrefix === null || config.clobberPrefix === undefined
      ? 'user-content-'
      : config.clobberPrefix
  return {
    enter: {
      gfmFootnoteDefinition() {
        const stack = this.getData('tightStack')
        stack.push(false)
      },
      gfmFootnoteDefinitionLabelString() {
        this.buffer()
      },
      gfmFootnoteCallString() {
        this.buffer()
      }
    },
    exit: {
      gfmFootnoteDefinition() {
        let definitions = this.getData('gfmFootnoteDefinitions')
        const footnoteStack = this.getData('gfmFootnoteDefinitionStack')
        assert(footnoteStack, 'expected `footnoteStack`')
        const tightStack = this.getData('tightStack')
        const current = footnoteStack.pop()
        const value = this.resume()

        assert(current, 'expected to be in a footnote')

        if (!definitions) {
          this.setData('gfmFootnoteDefinitions', (definitions = {}))
        }

        if (!own.call(definitions, current)) definitions[current] = value

        tightStack.pop()
        this.setData('slurpOneLineEnding', true)
        // “Hack” to prevent a line ending from showing up if we’re in a definition in
        // an empty list item.
        this.setData('lastWasTag')
      },
      gfmFootnoteDefinitionLabelString(token) {
        let footnoteStack = this.getData('gfmFootnoteDefinitionStack')

        if (!footnoteStack) {
          this.setData('gfmFootnoteDefinitionStack', (footnoteStack = []))
        }

        footnoteStack.push(normalizeIdentifier(this.sliceSerialize(token)))
        this.resume() // Drop the label.
        this.buffer() // Get ready for a value.
      },
      gfmFootnoteCallString(token) {
        let calls = this.getData('gfmFootnoteCallOrder')
        let counts = this.getData('gfmFootnoteCallCounts')
        const id = normalizeIdentifier(this.sliceSerialize(token))
        /** @type {number} */
        let counter

        this.resume()

        if (!calls) this.setData('gfmFootnoteCallOrder', (calls = []))
        if (!counts) this.setData('gfmFootnoteCallCounts', (counts = {}))

        const index = calls.indexOf(id)
        const safeId = sanitizeUri(id.toLowerCase())

        if (index === -1) {
          calls.push(id)
          counts[id] = 1
          counter = calls.length
        } else {
          counts[id]++
          counter = index + 1
        }

        const reuseCounter = counts[id]

        this.tag(
          '<sup><a href="#' +
            clobberPrefix +
            'fn-' +
            safeId +
            '" id="' +
            clobberPrefix +
            'fnref-' +
            safeId +
            (reuseCounter > 1 ? '-' + reuseCounter : '') +
            '" data-footnote-ref="" aria-describedby="footnote-label">' +
            String(counter) +
            '</a></sup>'
        )
      },
      null() {
        const calls = this.getData('gfmFootnoteCallOrder') || []
        const counts = this.getData('gfmFootnoteCallCounts') || {}
        const definitions = this.getData('gfmFootnoteDefinitions') || {}
        let index = -1

        if (calls.length > 0) {
          this.lineEndingIfNeeded()
          this.tag(
            '<section data-footnotes="" class="footnotes"><' +
              labelTagName +
              ' id="footnote-label"' +
              (labelAttributes ? ' ' + labelAttributes : '') +
              '>'
          )
          this.raw(this.encode(label))
          this.tag('</' + labelTagName + '>')
          this.lineEndingIfNeeded()
          this.tag('<ol>')
        }

        while (++index < calls.length) {
          // Called definitions are always defined.
          const id = calls[index]
          const safeId = sanitizeUri(id.toLowerCase())
          let referenceIndex = 0
          /** @type {Array<string>} */
          const references = []

          while (++referenceIndex <= counts[id]) {
            references.push(
              '<a href="#' +
                clobberPrefix +
                'fnref-' +
                safeId +
                (referenceIndex > 1 ? '-' + referenceIndex : '') +
                '" data-footnote-backref="" aria-label="' +
                this.encode(
                  typeof backLabel === 'string'
                    ? backLabel
                    : backLabel(index, referenceIndex)
                ) +
                '" class="data-footnote-backref">↩' +
                (referenceIndex > 1
                  ? '<sup>' + referenceIndex + '</sup>'
                  : '') +
                '</a>'
            )
          }

          const reference = references.join(' ')
          let injected = false

          this.lineEndingIfNeeded()
          this.tag('<li id="' + clobberPrefix + 'fn-' + safeId + '">')
          this.lineEndingIfNeeded()
          this.tag(
            definitions[id].replace(/<\/p>(?:\r?\n|\r)?$/, function ($0) {
              injected = true
              return ' ' + reference + $0
            })
          )

          if (!injected) {
            this.lineEndingIfNeeded()
            this.tag(reference)
          }

          this.lineEndingIfNeeded()
          this.tag('</li>')
        }

        if (calls.length > 0) {
          this.lineEndingIfNeeded()
          this.tag('</ol>')
          this.lineEndingIfNeeded()
          this.tag('</section>')
        }
      }
    }
  }
}
fxxG .enable GFM footnotePh
 *   enable GFM footnote FootnoteF[
x4S/**
 * @import {Event, Exiter, Extension, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {blankLine} from 'micromark-core-commonmark'
import {factorySpace} from 'micromark-factory-space'
import {markdownLineEndingOrSpace} from 'micromark-util-character'
import {normalizeIdentifier} from 'micromark-util-normalize-identifier'
import {codes, constants, types} from 'micromark-util-symbol'

const indent = {tokenize: tokenizeIndent, partial: true}

// To do: micromark should support a `_hiddenGfmFootnoteSupport`, which only
// affects label start (image).
// That will let us drop `tokenizePotentialGfmFootnote*`.
// It currently has a `_hiddenFootnoteSupport`, which affects that and more.
// That can be removed when `micromark-extension-footnote` is archived.

/**
 * Create an extension for `micromark` to enable GFM footnote syntax.
 *
 * @returns {Extension}
 *   Extension for `micromark` that can be passed in `extensions` to
 *   enable GFM footnote syntax.
 */
export function gfmFootnote() {
  /** @type {Extension} */
  return {
    document: {
      [codes.leftSquareBracket]: {
        name: 'gfmFootnoteDefinition',
        tokenize: tokenizeDefinitionStart,
        continuation: {tokenize: tokenizeDefinitionContinuation},
        exit: gfmFootnoteDefinitionEnd
      }
    },
    text: {
      [codes.leftSquareBracket]: {
        name: 'gfmFootnoteCall',
        tokenize: tokenizeGfmFootnoteCall
      },
      [codes.rightSquareBracket]: {
        name: 'gfmPotentialFootnoteCall',
        add: 'after',
        tokenize: tokenizePotentialGfmFootnoteCall,
        resolveTo: resolveToPotentialGfmFootnoteCall
      }
    }
  }
}

// To do: remove after micromark update.
/**
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizePotentialGfmFootnoteCall(effects, ok, nok) {
  const self = this
  let index = self.events.length
  const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = [])
  /** @type {Token} */
  let labelStart

  // Find an opening.
  while (index--) {
    const token = self.events[index][1]

    if (token.type === types.labelImage) {
      labelStart = token
      break
    }

    // Exit if we’ve walked far enough.
    if (
      token.type === 'gfmFootnoteCall' ||
      token.type === types.labelLink ||
      token.type === types.label ||
      token.type === types.image ||
      token.type === types.link
    ) {
      break
    }
  }

  return start

  /**
   * @type {State}
   */
  function start(code) {
    assert(code === codes.rightSquareBracket, 'expected `]`')

    if (!labelStart || !labelStart._balanced) {
      return nok(code)
    }

    const id = normalizeIdentifier(
      self.sliceSerialize({start: labelStart.end, end: self.now()})
    )

    if (id.codePointAt(0) !== codes.caret || !defined.includes(id.slice(1))) {
      return nok(code)
    }

    effects.enter('gfmFootnoteCallLabelMarker')
    effects.consume(code)
    effects.exit('gfmFootnoteCallLabelMarker')
    return ok(code)
  }
}

// To do: remove after micromark update.
/** @type {Resolver} */
function resolveToPotentialGfmFootnoteCall(events, context) {
  let index = events.length
  /** @type {Token | undefined} */
  let labelStart

  // Find an opening.
  while (index--) {
    if (
      events[index][1].type === types.labelImage &&
      events[index][0] === 'enter'
    ) {
      labelStart = events[index][1]
      break
    }
  }

  assert(labelStart, 'expected `labelStart` to resolve')

  // Change the `labelImageMarker` to a `data`.
  events[index + 1][1].type = types.data
  events[index + 3][1].type = 'gfmFootnoteCallLabelMarker'

  // The whole (without `!`):
  /** @type {Token} */
  const call = {
    type: 'gfmFootnoteCall',
    start: Object.assign({}, events[index + 3][1].start),
    end: Object.assign({}, events[events.length - 1][1].end)
  }
  // The `^` marker
  /** @type {Token} */
  const marker = {
    type: 'gfmFootnoteCallMarker',
    start: Object.assign({}, events[index + 3][1].end),
    end: Object.assign({}, events[index + 3][1].end)
  }
  // Increment the end 1 character.
  marker.end.column++
  marker.end.offset++
  marker.end._bufferIndex++
  /** @type {Token} */
  const string = {
    type: 'gfmFootnoteCallString',
    start: Object.assign({}, marker.end),
    end: Object.assign({}, events[events.length - 1][1].start)
  }
  /** @type {Token} */
  const chunk = {
    type: types.chunkString,
    contentType: 'string',
    start: Object.assign({}, string.start),
    end: Object.assign({}, string.end)
  }

  /** @type {Array<Event>} */
  const replacement = [
    // Take the `labelImageMarker` (now `data`, the `!`)
    events[index + 1],
    events[index + 2],
    ['enter', call, context],
    // The `[`
    events[index + 3],
    events[index + 4],
    // The `^`.
    ['enter', marker, context],
    ['exit', marker, context],
    // Everything in between.
    ['enter', string, context],
    ['enter', chunk, context],
    ['exit', chunk, context],
    ['exit', string, context],
    // The ending (`]`, properly parsed and labelled).
    events[events.length - 2],
    events[events.length - 1],
    ['exit', call, context]
  ]

  events.splice(index, events.length - index + 1, ...replacement)

  return events
}

/**
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeGfmFootnoteCall(effects, ok, nok) {
  const self = this
  const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = [])
  let size = 0
  /** @type {boolean} */
  let data

  // Note: the implementation of `markdown-rs` is different, because it houses
  // core *and* extensions in one project.
  // Therefore, it can include footnote logic inside `label-end`.
  // We can’t do that, but luckily, we can parse footnotes in a simpler way than
  // needed for labels.
  return start

  /**
   * Start of footnote label.
   *
   * ```markdown
   * > | a [^b] c
   *       ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    assert(code === codes.leftSquareBracket, 'expected `[`')
    effects.enter('gfmFootnoteCall')
    effects.enter('gfmFootnoteCallLabelMarker')
    effects.consume(code)
    effects.exit('gfmFootnoteCallLabelMarker')
    return callStart
  }

  /**
   * After `[`, at `^`.
   *
   * ```markdown
   * > | a [^b] c
   *        ^
   * ```
   *
   * @type {State}
   */
  function callStart(code) {
    if (code !== codes.caret) return nok(code)

    effects.enter('gfmFootnoteCallMarker')
    effects.consume(code)
    effects.exit('gfmFootnoteCallMarker')
    effects.enter('gfmFootnoteCallString')
    effects.enter('chunkString').contentType = 'string'
    return callData
  }

  /**
   * In label.
   *
   * ```markdown
   * > | a [^b] c
   *         ^
   * ```
   *
   * @type {State}
   */
  function callData(code) {
    if (
      // Too long.
      size > constants.linkReferenceSizeMax ||
      // Closing brace with nothing.
      (code === codes.rightSquareBracket && !data) ||
      // Space or tab is not supported by GFM for some reason.
      // `\n` and `[` not being supported makes sense.
      code === codes.eof ||
      code === codes.leftSquareBracket ||
      markdownLineEndingOrSpace(code)
    ) {
      return nok(code)
    }

    if (code === codes.rightSquareBracket) {
      effects.exit('chunkString')
      const token = effects.exit('gfmFootnoteCallString')

      if (!defined.includes(normalizeIdentifier(self.sliceSerialize(token)))) {
        return nok(code)
      }

      effects.enter('gfmFootnoteCallLabelMarker')
      effects.consume(code)
      effects.exit('gfmFootnoteCallLabelMarker')
      effects.exit('gfmFootnoteCall')
      return ok
    }

    if (!markdownLineEndingOrSpace(code)) {
      data = true
    }

    size++
    effects.consume(code)
    return code === codes.backslash ? callEscape : callData
  }

  /**
   * On character after escape.
   *
   * ```markdown
   * > | a [^b\c] d
   *           ^
   * ```
   *
   * @type {State}
   */
  function callEscape(code) {
    if (
      code === codes.leftSquareBracket ||
      code === codes.backslash ||
      code === codes.rightSquareBracket
    ) {
      effects.consume(code)
      size++
      return callData
    }

    return callData(code)
  }
}

/**
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeDefinitionStart(effects, ok, nok) {
  const self = this
  const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = [])
  /** @type {string} */
  let identifier
  let size = 0
  /** @type {boolean | undefined} */
  let data

  return start

  /**
   * Start of GFM footnote definition.
   *
   * ```markdown
   * > | [^a]: b
   *     ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    assert(code === codes.leftSquareBracket, 'expected `[`')
    effects.enter('gfmFootnoteDefinition')._container = true
    effects.enter('gfmFootnoteDefinitionLabel')
    effects.enter('gfmFootnoteDefinitionLabelMarker')
    effects.consume(code)
    effects.exit('gfmFootnoteDefinitionLabelMarker')
    return labelAtMarker
  }

  /**
   * In label, at caret.
   *
   * ```markdown
   * > | [^a]: b
   *      ^
   * ```
   *
   * @type {State}
   */
  function labelAtMarker(code) {
    if (code === codes.caret) {
      effects.enter('gfmFootnoteDefinitionMarker')
      effects.consume(code)
      effects.exit('gfmFootnoteDefinitionMarker')
      effects.enter('gfmFootnoteDefinitionLabelString')
      effects.enter('chunkString').contentType = 'string'
      return labelInside
    }

    return nok(code)
  }

  /**
   * In label.
   *
   * > 👉 **Note**: `cmark-gfm` prevents whitespace from occurring in footnote
   * > definition labels.
   *
   * ```markdown
   * > | [^a]: b
   *       ^
   * ```
   *
   * @type {State}
   */
  function labelInside(code) {
    if (
      // Too long.
      size > constants.linkReferenceSizeMax ||
      // Closing brace with nothing.
      (code === codes.rightSquareBracket && !data) ||
      // Space or tab is not supported by GFM for some reason.
      // `\n` and `[` not being supported makes sense.
      code === codes.eof ||
      code === codes.leftSquareBracket ||
      markdownLineEndingOrSpace(code)
    ) {
      return nok(code)
    }

    if (code === codes.rightSquareBracket) {
      effects.exit('chunkString')
      const token = effects.exit('gfmFootnoteDefinitionLabelString')
      identifier = normalizeIdentifier(self.sliceSerialize(token))
      effects.enter('gfmFootnoteDefinitionLabelMarker')
      effects.consume(code)
      effects.exit('gfmFootnoteDefinitionLabelMarker')
      effects.exit('gfmFootnoteDefinitionLabel')
      return labelAfter
    }

    if (!markdownLineEndingOrSpace(code)) {
      data = true
    }

    size++
    effects.consume(code)
    return code === codes.backslash ? labelEscape : labelInside
  }

  /**
   * After `\`, at a special character.
   *
   * > 👉 **Note**: `cmark-gfm` currently does not support escaped brackets:
   * > <https://github.com/github/cmark-gfm/issues/240>
   *
   * ```markdown
   * > | [^a\*b]: c
   *         ^
   * ```
   *
   * @type {State}
   */
  function labelEscape(code) {
    if (
      code === codes.leftSquareBracket ||
      code === codes.backslash ||
      code === codes.rightSquareBracket
    ) {
      effects.consume(code)
      size++
      return labelInside
    }

    return labelInside(code)
  }

  /**
   * After definition label.
   *
   * ```markdown
   * > | [^a]: b
   *         ^
   * ```
   *
   * @type {State}
   */
  function labelAfter(code) {
    if (code === codes.colon) {
      effects.enter('definitionMarker')
      effects.consume(code)
      effects.exit('definitionMarker')

      if (!defined.includes(identifier)) {
        defined.push(identifier)
      }

      // Any whitespace after the marker is eaten, forming indented code
      // is not possible.
      // No space is also fine, just like a block quote marker.
      return factorySpace(
        effects,
        whitespaceAfter,
        'gfmFootnoteDefinitionWhitespace'
      )
    }

    return nok(code)
  }

  /**
   * After definition prefix.
   *
   * ```markdown
   * > | [^a]: b
   *           ^
   * ```
   *
   * @type {State}
   */
  function whitespaceAfter(code) {
    // `markdown-rs` has a wrapping token for the prefix that is closed here.
    return ok(code)
  }
}

/**
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeDefinitionContinuation(effects, ok, nok) {
  /// Start of footnote definition continuation.
  ///
  /// ```markdown
  ///   | [^a]: b
  /// > |     c
  ///     ^
  /// ```
  //
  // Either a blank line, which is okay, or an indented thing.
  return effects.check(blankLine, ok, effects.attempt(indent, ok, nok))
}

/** @type {Exiter} */
function gfmFootnoteDefinitionEnd(effects) {
  effects.exit('gfmFootnoteDefinition')
}

/**
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeIndent(effects, ok, nok) {
  const self = this

  return factorySpace(
    effects,
    afterPrefix,
    'gfmFootnoteDefinitionIndent',
    constants.tabSize + 1
  )

  /**
   * @type {State}
   */
  function afterPrefix(code) {
    const tail = self.events[self.events.length - 1]
    return tail &&
      tail[1].type === 'gfmFootnoteDefinitionIndent' &&
      tail[2].sliceSerialize(tail[1], true).length === constants.tabSize
      ? ok(code)
      : nok(code)
  }
}
hs
x [// Note: types are exported from `dev/index.d.ts`.
export { gfmFootnote } from './lib/syntax.js';
export { gfmFootnoteHtml, defaultBackLabel } from './lib/html.js';]9	x k100644 html.d.ts *l53c^Z0X}100644 html.js ^@!^JofQ100644 syntax.d.ts ڣT͔;b+y100644 syntax.js ZA:][
:L_;x/**
 * @import {HtmlOptions as Options} from 'micromark-extension-gfm-footnote'
 * @import {HtmlExtension} from 'micromark-util-types'
 */

import { normalizeIdentifier } from 'micromark-util-normalize-identifier';
import { sanitizeUri } from 'micromark-util-sanitize-uri';
const own = {}.hasOwnProperty;

/** @type {Options} */
const emptyOptions = {};

/**
 * Generate the default label that GitHub uses on backreferences.
 *
 * @param {number} referenceIndex
 *   Index of the definition in the order that they are first referenced,
 *   0-indexed.
 * @param {number} rereferenceIndex
 *   Index of calls to the same definition, 0-indexed.
 * @returns {string}
 *   Default label.
 */
export function defaultBackLabel(referenceIndex, rereferenceIndex) {
  return 'Back to reference ' + (referenceIndex + 1) + (rereferenceIndex > 1 ? '-' + rereferenceIndex : '');
}

/**
 * Create an extension for `micromark` to support GFM footnotes when
 * serializing to HTML.
 *
 * @param {Options | null | undefined} [options={}]
 *   Configuration (optional).
 * @returns {HtmlExtension}
 *   Extension for `micromark` that can be passed in `htmlExtensions` to
 *   support GFM footnotes when serializing to HTML.
 */
export function gfmFootnoteHtml(options) {
  const config = options || emptyOptions;
  const label = config.label || 'Footnotes';
  const labelTagName = config.labelTagName || 'h2';
  const labelAttributes = config.labelAttributes === null || config.labelAttributes === undefined ? 'class="sr-only"' : config.labelAttributes;
  const backLabel = config.backLabel || defaultBackLabel;
  const clobberPrefix = config.clobberPrefix === null || config.clobberPrefix === undefined ? 'user-content-' : config.clobberPrefix;
  return {
    enter: {
      gfmFootnoteDefinition() {
        const stack = this.getData('tightStack');
        stack.push(false);
      },
      gfmFootnoteDefinitionLabelString() {
        this.buffer();
      },
      gfmFootnoteCallString() {
        this.buffer();
      }
    },
    exit: {
      gfmFootnoteDefinition() {
        let definitions = this.getData('gfmFootnoteDefinitions');
        const footnoteStack = this.getData('gfmFootnoteDefinitionStack');
        const tightStack = this.getData('tightStack');
        const current = footnoteStack.pop();
        const value = this.resume();
        if (!definitions) {
          this.setData('gfmFootnoteDefinitions', definitions = {});
        }
        if (!own.call(definitions, current)) definitions[current] = value;
        tightStack.pop();
        this.setData('slurpOneLineEnding', true);
        // “Hack” to prevent a line ending from showing up if we’re in a definition in
        // an empty list item.
        this.setData('lastWasTag');
      },
      gfmFootnoteDefinitionLabelString(token) {
        let footnoteStack = this.getData('gfmFootnoteDefinitionStack');
        if (!footnoteStack) {
          this.setData('gfmFootnoteDefinitionStack', footnoteStack = []);
        }
        footnoteStack.push(normalizeIdentifier(this.sliceSerialize(token)));
        this.resume(); // Drop the label.
        this.buffer(); // Get ready for a value.
      },
      gfmFootnoteCallString(token) {
        let calls = this.getData('gfmFootnoteCallOrder');
        let counts = this.getData('gfmFootnoteCallCounts');
        const id = normalizeIdentifier(this.sliceSerialize(token));
        /** @type {number} */
        let counter;
        this.resume();
        if (!calls) this.setData('gfmFootnoteCallOrder', calls = []);
        if (!counts) this.setData('gfmFootnoteCallCounts', counts = {});
        const index = calls.indexOf(id);
        const safeId = sanitizeUri(id.toLowerCase());
        if (index === -1) {
          calls.push(id);
          counts[id] = 1;
          counter = calls.length;
        } else {
          counts[id]++;
          counter = index + 1;
        }
        const reuseCounter = counts[id];
        this.tag('<sup><a href="#' + clobberPrefix + 'fn-' + safeId + '" id="' + clobberPrefix + 'fnref-' + safeId + (reuseCounter > 1 ? '-' + reuseCounter : '') + '" data-footnote-ref="" aria-describedby="footnote-label">' + String(counter) + '</a></sup>');
      },
      null() {
        const calls = this.getData('gfmFootnoteCallOrder') || [];
        const counts = this.getData('gfmFootnoteCallCounts') || {};
        const definitions = this.getData('gfmFootnoteDefinitions') || {};
        let index = -1;
        if (calls.length > 0) {
          this.lineEndingIfNeeded();
          this.tag('<section data-footnotes="" class="footnotes"><' + labelTagName + ' id="footnote-label"' + (labelAttributes ? ' ' + labelAttributes : '') + '>');
          this.raw(this.encode(label));
          this.tag('</' + labelTagName + '>');
          this.lineEndingIfNeeded();
          this.tag('<ol>');
        }
        while (++index < calls.length) {
          // Called definitions are always defined.
          const id = calls[index];
          const safeId = sanitizeUri(id.toLowerCase());
          let referenceIndex = 0;
          /** @type {Array<string>} */
          const references = [];
          while (++referenceIndex <= counts[id]) {
            references.push('<a href="#' + clobberPrefix + 'fnref-' + safeId + (referenceIndex > 1 ? '-' + referenceIndex : '') + '" data-footnote-backref="" aria-label="' + this.encode(typeof backLabel === 'string' ? backLabel : backLabel(index, referenceIndex)) + '" class="data-footnote-backref">↩' + (referenceIndex > 1 ? '<sup>' + referenceIndex + '</sup>' : '') + '</a>');
          }
          const reference = references.join(' ');
          let injected = false;
          this.lineEndingIfNeeded();
          this.tag('<li id="' + clobberPrefix + 'fn-' + safeId + '">');
          this.lineEndingIfNeeded();
          this.tag(definitions[id].replace(/<\/p>(?:\r?\n|\r)?$/, function ($0) {
            injected = true;
            return ' ' + reference + $0;
          }));
          if (!injected) {
            this.lineEndingIfNeeded();
            this.tag(reference);
          }
          this.lineEndingIfNeeded();
          this.tag('</li>');
        }
        if (calls.length > 0) {
          this.lineEndingIfNeeded();
          this.tag('</ol>');
          this.lineEndingIfNeeded();
          this.tag('</section>');
        }
      }
    }
  };
}ܰ꿋x0@/**
 * @import {Event, Exiter, Extension, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'
 */

import { blankLine } from 'micromark-core-commonmark';
import { factorySpace } from 'micromark-factory-space';
import { markdownLineEndingOrSpace } from 'micromark-util-character';
import { normalizeIdentifier } from 'micromark-util-normalize-identifier';
const indent = {
  tokenize: tokenizeIndent,
  partial: true
};

// To do: micromark should support a `_hiddenGfmFootnoteSupport`, which only
// affects label start (image).
// That will let us drop `tokenizePotentialGfmFootnote*`.
// It currently has a `_hiddenFootnoteSupport`, which affects that and more.
// That can be removed when `micromark-extension-footnote` is archived.

/**
 * Create an extension for `micromark` to enable GFM footnote syntax.
 *
 * @returns {Extension}
 *   Extension for `micromark` that can be passed in `extensions` to
 *   enable GFM footnote syntax.
 */
export function gfmFootnote() {
  /** @type {Extension} */
  return {
    document: {
      [91]: {
        name: 'gfmFootnoteDefinition',
        tokenize: tokenizeDefinitionStart,
        continuation: {
          tokenize: tokenizeDefinitionContinuation
        },
        exit: gfmFootnoteDefinitionEnd
      }
    },
    text: {
      [91]: {
        name: 'gfmFootnoteCall',
        tokenize: tokenizeGfmFootnoteCall
      },
      [93]: {
        name: 'gfmPotentialFootnoteCall',
        add: 'after',
        tokenize: tokenizePotentialGfmFootnoteCall,
        resolveTo: resolveToPotentialGfmFootnoteCall
      }
    }
  };
}

// To do: remove after micromark update.
/**
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizePotentialGfmFootnoteCall(effects, ok, nok) {
  const self = this;
  let index = self.events.length;
  const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);
  /** @type {Token} */
  let labelStart;

  // Find an opening.
  while (index--) {
    const token = self.events[index][1];
    if (token.type === "labelImage") {
      labelStart = token;
      break;
    }

    // Exit if we’ve walked far enough.
    if (token.type === 'gfmFootnoteCall' || token.type === "labelLink" || token.type === "label" || token.type === "image" || token.type === "link") {
      break;
    }
  }
  return start;

  /**
   * @type {State}
   */
  function start(code) {
    if (!labelStart || !labelStart._balanced) {
      return nok(code);
    }
    const id = normalizeIdentifier(self.sliceSerialize({
      start: labelStart.end,
      end: self.now()
    }));
    if (id.codePointAt(0) !== 94 || !defined.includes(id.slice(1))) {
      return nok(code);
    }
    effects.enter('gfmFootnoteCallLabelMarker');
    effects.consume(code);
    effects.exit('gfmFootnoteCallLabelMarker');
    return ok(code);
  }
}

// To do: remove after micromark update.
/** @type {Resolver} */
function resolveToPotentialGfmFootnoteCall(events, context) {
  let index = events.length;
  /** @type {Token | undefined} */
  let labelStart;

  // Find an opening.
  while (index--) {
    if (events[index][1].type === "labelImage" && events[index][0] === 'enter') {
      labelStart = events[index][1];
      break;
    }
  }
  // Change the `labelImageMarker` to a `data`.
  events[index + 1][1].type = "data";
  events[index + 3][1].type = 'gfmFootnoteCallLabelMarker';

  // The whole (without `!`):
  /** @type {Token} */
  const call = {
    type: 'gfmFootnoteCall',
    start: Object.assign({}, events[index + 3][1].start),
    end: Object.assign({}, events[events.length - 1][1].end)
  };
  // The `^` marker
  /** @type {Token} */
  const marker = {
    type: 'gfmFootnoteCallMarker',
    start: Object.assign({}, events[index + 3][1].end),
    end: Object.assign({}, events[index + 3][1].end)
  };
  // Increment the end 1 character.
  marker.end.column++;
  marker.end.offset++;
  marker.end._bufferIndex++;
  /** @type {Token} */
  const string = {
    type: 'gfmFootnoteCallString',
    start: Object.assign({}, marker.end),
    end: Object.assign({}, events[events.length - 1][1].start)
  };
  /** @type {Token} */
  const chunk = {
    type: "chunkString",
    contentType: 'string',
    start: Object.assign({}, string.start),
    end: Object.assign({}, string.end)
  };

  /** @type {Array<Event>} */
  const replacement = [
  // Take the `labelImageMarker` (now `data`, the `!`)
  events[index + 1], events[index + 2], ['enter', call, context],
  // The `[`
  events[index + 3], events[index + 4],
  // The `^`.
  ['enter', marker, context], ['exit', marker, context],
  // Everything in between.
  ['enter', string, context], ['enter', chunk, context], ['exit', chunk, context], ['exit', string, context],
  // The ending (`]`, properly parsed and labelled).
  events[events.length - 2], events[events.length - 1], ['exit', call, context]];
  events.splice(index, events.length - index + 1, ...replacement);
  return events;
}

/**
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeGfmFootnoteCall(effects, ok, nok) {
  const self = this;
  const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);
  let size = 0;
  /** @type {boolean} */
  let data;

  // Note: the implementation of `markdown-rs` is different, because it houses
  // core *and* extensions in one project.
  // Therefore, it can include footnote logic inside `label-end`.
  // We can’t do that, but luckily, we can parse footnotes in a simpler way than
  // needed for labels.
  return start;

  /**
   * Start of footnote label.
   *
   * ```markdown
   * > | a [^b] c
   *       ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    effects.enter('gfmFootnoteCall');
    effects.enter('gfmFootnoteCallLabelMarker');
    effects.consume(code);
    effects.exit('gfmFootnoteCallLabelMarker');
    return callStart;
  }

  /**
   * After `[`, at `^`.
   *
   * ```markdown
   * > | a [^b] c
   *        ^
   * ```
   *
   * @type {State}
   */
  function callStart(code) {
    if (code !== 94) return nok(code);
    effects.enter('gfmFootnoteCallMarker');
    effects.consume(code);
    effects.exit('gfmFootnoteCallMarker');
    effects.enter('gfmFootnoteCallString');
    effects.enter('chunkString').contentType = 'string';
    return callData;
  }

  /**
   * In label.
   *
   * ```markdown
   * > | a [^b] c
   *         ^
   * ```
   *
   * @type {State}
   */
  function callData(code) {
    if (
    // Too long.
    size > 999 ||
    // Closing brace with nothing.
    code === 93 && !data ||
    // Space or tab is not supported by GFM for some reason.
    // `\n` and `[` not being supported makes sense.
    code === null || code === 91 || markdownLineEndingOrSpace(code)) {
      return nok(code);
    }
    if (code === 93) {
      effects.exit('chunkString');
      const token = effects.exit('gfmFootnoteCallString');
      if (!defined.includes(normalizeIdentifier(self.sliceSerialize(token)))) {
        return nok(code);
      }
      effects.enter('gfmFootnoteCallLabelMarker');
      effects.consume(code);
      effects.exit('gfmFootnoteCallLabelMarker');
      effects.exit('gfmFootnoteCall');
      return ok;
    }
    if (!markdownLineEndingOrSpace(code)) {
      data = true;
    }
    size++;
    effects.consume(code);
    return code === 92 ? callEscape : callData;
  }

  /**
   * On character after escape.
   *
   * ```markdown
   * > | a [^b\c] d
   *           ^
   * ```
   *
   * @type {State}
   */
  function callEscape(code) {
    if (code === 91 || code === 92 || code === 93) {
      effects.consume(code);
      size++;
      return callData;
    }
    return callData(code);
  }
}

/**
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeDefinitionStart(effects, ok, nok) {
  const self = this;
  const defined = self.parser.gfmFootnotes || (self.parser.gfmFootnotes = []);
  /** @type {string} */
  let identifier;
  let size = 0;
  /** @type {boolean | undefined} */
  let data;
  return start;

  /**
   * Start of GFM footnote definition.
   *
   * ```markdown
   * > | [^a]: b
   *     ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    effects.enter('gfmFootnoteDefinition')._container = true;
    effects.enter('gfmFootnoteDefinitionLabel');
    effects.enter('gfmFootnoteDefinitionLabelMarker');
    effects.consume(code);
    effects.exit('gfmFootnoteDefinitionLabelMarker');
    return labelAtMarker;
  }

  /**
   * In label, at caret.
   *
   * ```markdown
   * > | [^a]: b
   *      ^
   * ```
   *
   * @type {State}
   */
  function labelAtMarker(code) {
    if (code === 94) {
      effects.enter('gfmFootnoteDefinitionMarker');
      effects.consume(code);
      effects.exit('gfmFootnoteDefinitionMarker');
      effects.enter('gfmFootnoteDefinitionLabelString');
      effects.enter('chunkString').contentType = 'string';
      return labelInside;
    }
    return nok(code);
  }

  /**
   * In label.
   *
   * > 👉 **Note**: `cmark-gfm` prevents whitespace from occurring in footnote
   * > definition labels.
   *
   * ```markdown
   * > | [^a]: b
   *       ^
   * ```
   *
   * @type {State}
   */
  function labelInside(code) {
    if (
    // Too long.
    size > 999 ||
    // Closing brace with nothing.
    code === 93 && !data ||
    // Space or tab is not supported by GFM for some reason.
    // `\n` and `[` not being supported makes sense.
    code === null || code === 91 || markdownLineEndingOrSpace(code)) {
      return nok(code);
    }
    if (code === 93) {
      effects.exit('chunkString');
      const token = effects.exit('gfmFootnoteDefinitionLabelString');
      identifier = normalizeIdentifier(self.sliceSerialize(token));
      effects.enter('gfmFootnoteDefinitionLabelMarker');
      effects.consume(code);
      effects.exit('gfmFootnoteDefinitionLabelMarker');
      effects.exit('gfmFootnoteDefinitionLabel');
      return labelAfter;
    }
    if (!markdownLineEndingOrSpace(code)) {
      data = true;
    }
    size++;
    effects.consume(code);
    return code === 92 ? labelEscape : labelInside;
  }

  /**
   * After `\`, at a special character.
   *
   * > 👉 **Note**: `cmark-gfm` currently does not support escaped brackets:
   * > <https://github.com/github/cmark-gfm/issues/240>
   *
   * ```markdown
   * > | [^a\*b]: c
   *         ^
   * ```
   *
   * @type {State}
   */
  function labelEscape(code) {
    if (code === 91 || code === 92 || code === 93) {
      effects.consume(code);
      size++;
      return labelInside;
    }
    return labelInside(code);
  }

  /**
   * After definition label.
   *
   * ```markdown
   * > | [^a]: b
   *         ^
   * ```
   *
   * @type {State}
   */
  function labelAfter(code) {
    if (code === 58) {
      effects.enter('definitionMarker');
      effects.consume(code);
      effects.exit('definitionMarker');
      if (!defined.includes(identifier)) {
        defined.push(identifier);
      }

      // Any whitespace after the marker is eaten, forming indented code
      // is not possible.
      // No space is also fine, just like a block quote marker.
      return factorySpace(effects, whitespaceAfter, 'gfmFootnoteDefinitionWhitespace');
    }
    return nok(code);
  }

  /**
   * After definition prefix.
   *
   * ```markdown
   * > | [^a]: b
   *           ^
   * ```
   *
   * @type {State}
   */
  function whitespaceAfter(code) {
    // `markdown-rs` has a wrapping token for the prefix that is closed here.
    return ok(code);
  }
}

/**
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeDefinitionContinuation(effects, ok, nok) {
  /// Start of footnote definition continuation.
  ///
  /// ```markdown
  ///   | [^a]: b
  /// > |     c
  ///     ^
  /// ```
  //
  // Either a blank line, which is okay, or an indented thing.
  return effects.check(blankLine, ok, effects.attempt(indent, ok, nok));
}

/** @type {Exiter} */
function gfmFootnoteDefinitionEnd(effects) {
  effects.exit('gfmFootnoteDefinition');
}

/**
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeIndent(effects, ok, nok) {
  const self = this;
  return factorySpace(effects, afterPrefix, 'gfmFootnoteDefinitionIndent', 4 + 1);

  /**
   * @type {State}
   */
  function afterPrefix(code) {
    const tail = self.events[self.events.length - 1];
    return tail && tail[1].type === 'gfmFootnoteDefinitionIndent' && tail[2].sliceSerialize(tail[1], true).length === 4 ? ok(code) : nok(code);
  }
}D|x KJ(The MIT License)

Copyright (c) 2021 Titus Wormer <tituswormer@gmail.com>TG
?
'Software'9
 C
dB
E
Y
GZ'AS IS'
B
F
RD
D
A
7,p4ٷ
xT# micromark-extension-gfm-footnote

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

[micromark][] extensions to support GFM [footnotes][post].

## Contents

* [What is this?](#what-is-this)
* [When to use this](#when-to-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`defaultBackLabel(referenceIndex, rereferenceIndex)`](#defaultbacklabelreferenceindex-rereferenceindex)
  * [`gfmFootnote()`](#gfmfootnote)
  * [`gfmFootnoteHtml(options?)`](#gfmfootnotehtmloptions)
  * [`BackLabelTemplate`](#backlabeltemplate)
  * [`HtmlOptions`](#htmloptions)
* [Bugs](#bugs)
* [Authoring](#authoring)
* [HTML](#html)
* [CSS](#css)
* [Syntax](#syntax)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package contains extensions that add support for footnotes as enabled by
GFM to [`micromark`][micromark].

GitHub announced footnotes [on September 30, 2021][post] but did not specify
them in their GFM spec.
As they are implemented in their parser and supported in all places where
other GFM features work, they can be considered part of GFM.
GitHub employs several other features (such as mentions or frontmatter) that
are either not in their parser, or not in all places where GFM features work,
which should not be considered GFM.

The implementation of footnotes on github.com is currently buggy.
The bugs have been reported on [`cmark-gfm`][cmark-gfm].
This micromark extension matches github.com except for its bugs.

## When to use this

This project is useful when you want to support footnotes in markdown.

You can use these extensions when you are working with [`micromark`][micromark].
To support all GFM features, use
[`micromark-extension-gfm`][micromark-extension-gfm] instead.

When you need a syntax tree, combine this package with
[`mdast-util-gfm-footnote`][mdast-util-gfm-footnote].

All these packages are used in [`remark-gfm`][remark-gfm], which focusses on
making it easier to transform content by abstracting these internals away.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install micromark-extension-gfm-footnote
```

In Deno with [`esm.sh`][esmsh]:

```js
import {gfmFootnote, gfmFootnoteHtml} from 'https://esm.sh/micromark-extension-gfm-footnote@2'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {gfmFootnote, gfmFootnoteHtml} from 'https://esm.sh/micromark-extension-gfm-footnote@2?bundle'
</script>
```

## Use

Say our document `example.md` contains:

````markdown
Using footnotes is fun![^1] They let you reference relevant information without disrupting the flow of what you’re trying to say.[^bignote]

[^1]: This is the first footnote.
[^bignote]: Here’s one with multiple paragraphs and code.

    Indent paragraphs to include them in the footnote.

    ```
    my code
    ```

    Add as many paragraphs as you like.

Text here and here and here.
[Learn more about markdown and footnotes in markdown](https://docs.github.com/en/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#footnotes)
````

…and our module `example.js` looks as follows:

```js
import fs from 'node:fs/promises'
import {micromark} from 'micromark'
import {gfmFootnote, gfmFootnoteHtml} from 'micromark-extension-gfm-footnote'

const output = micromark(await fs.readFile('example.md'), {
  extensions: [gfmFootnote()],
  htmlExtensions: [gfmFootnoteHtml()]
})

console.log(output)
```

…now running `node example.js` yields:

```html
<p>Using footnotes is fun!<sup><a href="#user-content-fn-1" id="user-content-fnref-1" data-footnote-ref="" aria-describedby="footnote-label">1</a></sup> They let you reference relevant information without disrupting the flow of what you’re trying to say.<sup><a href="#user-content-fn-bignote" id="user-content-fnref-bignote" data-footnote-ref="" aria-describedby="footnote-label">2</a></sup></p>
<p>Text here and here and here.
<a href="https://docs.github.com/en/github/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#footnotes">Learn more about markdown and footnotes in markdown</a></p>
<section data-footnotes="" class="footnotes"><h2 id="footnote-label" class="sr-only">Footnotes</h2>
<ol>
<li id="user-content-fn-1">
<p>This is the first footnote. <a href="#user-content-fnref-1" data-footnote-backref="" class="data-footnote-backref" aria-label="Back to content">↩</a></p>
</li>
<li id="user-content-fn-bignote">
<p>Here’s one with multiple paragraphs and code.</p>
<p>Indent paragraphs to include them in the footnote.</p>
<pre><code>my code
</code></pre>
<p>Add as many paragraphs as you like. <a href="#user-content-fnref-bignote" data-footnote-backref="" class="data-footnote-backref" aria-label="Back to content">↩</a></p>
</li>
</ol>
</section>
```

## API

This package exports the identifiers
[`defaultBackLabel`][api-default-back-label],
[`gfmFootnote`][api-gfm-footnote], and
[`gfmFootnoteHtml`][api-gfm-footnote-html].
There is no default export.

The export map supports the [`development` condition][development].
Run `node --conditions development module.js` to get instrumented dev code.
Without this condition, production code is loaded.

### `defaultBackLabel(referenceIndex, rereferenceIndex)`

Generate the default label that GitHub uses on backreferences
([`BackLabelTemplate`][api-back-label-template]).

### `gfmFootnote()`

Create an extension for `micromark` to enable GFM footnote syntax.

###### Returns

Extension for `micromark` that can be passed in `extensions` to enable GFM
footnote syntax ([`Extension`][micromark-extension]).

### `gfmFootnoteHtml(options?)`

Create an extension for `micromark` to support GFM footnotes when serializing
to HTML.

###### Parameters

* `options` ([`HtmlOptions`][api-html-options], optional)
  — configuration

###### Returns

Extension for `micromark` that can be passed in `htmlExtensions` to support GFM
footnotes when serializing to HTML
([`HtmlExtension`][micromark-html-extension]).

### `BackLabelTemplate`

Generate a back label dynamically (TypeScript type).

For the following markdown:

```markdown
Alpha[^micromark], bravo[^micromark], and charlie[^remark].

[^remark]: things about remark
[^micromark]: things about micromark
```

This function will be called with:

* `0` and `0` for the backreference from `things about micromark` to
  `alpha`, as it is the first used definition, and the first call to it
* `0` and `1` for the backreference from `things about micromark` to
  `bravo`, as it is the first used definition, and the second call to it
* `1` and `0` for the backreference from `things about remark` to
  `charlie`, as it is the second used definition

###### Parameters

* `referenceIndex` (`number`)
  — index of the definition in the order that they are first referenced,
  0-indexed
* `rereferenceIndex` (`number`)
  — index of calls to the same definition, 0-indexed

###### Returns

Back label to use when linking back from definitions to their reference
(`string`).

### `HtmlOptions`

Configuration (TypeScript type).

##### Fields

###### `clobberPrefix`

Prefix to use before the `id` attribute on footnotes to prevent them from
*clobbering* (`string`, default: `'user-content-'`).

Pass `''` for trusted markdown and when you are careful with polyfilling.
You could pass a different prefix.

DOM clobbering is this:

```html
<p id="x"></p>
<script>alert(x) // `x` now refers to the `p#x` DOM element</script>
```

The above example shows that elements are made available by browsers, by their
ID, on the `window` object.
This is a security risk because you might be expecting some other variable at
that place.
It can also break polyfills.
Using a prefix solves these problems.

###### `label`

Textual label to use for the footnotes section (`string`, default:
`'Footnotes'`).

Change it when the markdown is not in English.

This label is typically hidden visually (assuming a `sr-only` CSS class
is defined that does that) and so affects screen readers only.

###### `labelAttributes`

Attributes to use on the footnote label (`string`, default:
`'class="sr-only"'`).

Change it to show the label and add other attributes.

This label is typically hidden visually (assuming an `sr-only` CSS class
is defined that does that) and so affects screen readers only.
If you do have such a class, but want to show this section to everyone,
pass an empty string.
You can also add different attributes.

> 👉 **Note**: `id="footnote-label"` is always added, because footnote
> calls use it with `aria-describedby` to provide an accessible label.

###### `labelTagName`

HTML tag name to use for the footnote label element (`string`, default:
`'h2'`).

Change it to match your document structure.

This label is typically hidden visually (assuming a `sr-only` CSS class
is defined that does that) and so affects screen readers only.

###### `backLabel`

Textual label to describe the backreference back to footnote calls
([`BackLabelTemplate`][api-back-label-template] or `string`,
default: [`defaultBackLabel`][api-default-back-label]).

Change it when the markdown is not in English.

This label is used in the [`aria-label`][aria-label] attribute on each
backreference (the `↩` links).
It affects users of assistive technology.

## Bugs

GitHub’s own algorithm to parse footnote definitions contains several bugs.
These are not present in this project.
The issues relating to footnote definitions are:

* [Footnote reference call identifiers are trimmed, but definition
  identifiers aren’t](https://github.com/github/cmark-gfm/issues/237)\
  — initial and final whitespace in labels causes them not to match
* [Footnotes are matched case-insensitive, but links keep their casing,
  breaking them](https://github.com/github/cmark-gfm/issues/239)\
  — using uppercase (or any character that will be percent encoded) in
  identifiers breaks links
* [Colons in footnotes generate links w/o
  `href`](https://github.com/github/cmark-gfm/issues/250)\
  — colons in identifiers generate broken links
* [Character escape of `]` does not work in footnote
  identifiers](https://github.com/github/cmark-gfm/issues/240)\
  — some character escapes don’t work
* [Footnotes in links are
  broken](https://github.com/github/cmark-gfm/issues/249)\
  — while `CommonMark` prevents links in links, GitHub does not prevent
  footnotes (which turn into links) in links
* [Footnote-like brackets around image, break that
  image](https://github.com/github/cmark-gfm/issues/275)\
  — images can’t be used in what looks like a footnote call
* [GFM footnotes: line ending in footnote definition label causes text to
  disappear](https://github.com/github/cmark-gfm/issues/282)\
  — line endings in footnote definitions cause text to disappear

## Authoring

When authoring markdown with footnotes it’s recommended to use words instead
of numbers (or letters or anything with an order) as identifiers.
That makes it easier to reuse and reorder footnotes.

It’s recommended to place footnotes definitions at the bottom of the document.

## HTML

GFM footnotes do not, on their own, relate to anything in HTML.
When a footnote reference matches with a definition, they each relate to several
elements in HTML.

The reference relates to `<sup>` and `<a>` elements in HTML:

```html
<sup><a href="#user-content-fn-x" id="user-content-fnref-x" data-footnote-ref="" aria-describedby="footnote-label">1</a></sup></p>
```

…where `x` is the identifier used in the markdown source and `1` the number of
corresponding, listed, definition.

See [*§ 4.5.19 The `sub` and `sup` elements*][html-sup],
[*§ 4.5.1 The `a` element*][html-a], and
[*§ 3.2.6.6 Embedding custom non-visible data with the `data-*`
attributes*][html-data]
in the HTML spec, and
[*§ 6.8 `aria-describedby` property*][aria-describedby]
in WAI-ARIA, for more info.

When one or more definitions are referenced, a footnote section is generated at
the end of the document, using `<section>`, `<h2>`, and `<ol>` elements:

```html
<section data-footnotes="" class="footnotes"><h2 id="footnote-label" class="sr-only">Footnotes</h2>
<ol>…</ol>
</section>
```

Each definition is generated as a `<li>` in the `<ol>` in the order they were
first referenced:

```html
<li id="user-content-fn-1">…</li>
```

Backreferences are injected at the end of the first paragraph, or, when there
is no paragraph, at the end of the definition.
When a definition is referenced multiple times, multiple backreferences are
generated.
Further backreferences use an extra counter in the `href` attribute and
visually in a `<span>` after `↩`.

```html
<a href="#user-content-fnref-1" data-footnote-backref="" class="data-footnote-backref" aria-label="Back to content">↩</a> <a href="#user-content-fnref-1-2" data-footnote-backref="" class="data-footnote-backref" aria-label="Back to content">↩<sup>2</sup></a>
```

See
[*§ 4.5.1 The `a` element*][html-a],
[*§ 4.3.6 The `h1`, `h2`, `h3`, `h4`, `h5`, and `h6` elements*][html-h],
[*§ 4.4.8 The `li` element*][html-li],
[*§ 4.4.5 The `ol` element*][html-ol],
[*§ 4.4.1 The `p` element*][html-p],
[*§ 4.3.3 The `section` element*][html-section], and
[*§ 4.5.19 The `sub` and `sup` elements*][html-sup]
in the HTML spec, and
[*§ 6.8 `aria-label` property*][aria-label]
in WAI-ARIA, for more info.

## CSS

The following CSS is needed to make footnotes look a bit like GitHub (and fixes
a bug).
For the complete actual CSS see
[`sindresorhus/github-markdown-css`](https://github.com/sindresorhus/github-markdown-css).

```css
/* Style the footnotes section. */
.footnotes {
  font-size: smaller;
  color: #8b949e;
  border-top: 1px solid #30363d;
}

/* Hide the section label for visual users. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  word-wrap: normal;
  border: 0;
}

/* Place `[` and `]` around footnote references. */
[data-footnote-ref]::before {
  content: '[';
}

[data-footnote-ref]::after {
  content: ']';
}
```

## Syntax

Footnotes form with, roughly, the following BNF:

```bnf
gfm_footnote_reference ::= gfm_footnote_label

gfm_footnote_definition_start ::= gfm_footnote_label ':' *space_or_tab
; Restriction: blank line allowed.
gfm_footnote_definition_cont ::= 4(space_or_tab)

; Restriction: maximum `999` codes between `^` and `]`.
gfm_footnote_label ::= '[' '^' 1*(gfm_footnote_label_byte | gfm_footnote_label_escape) ']'
gfm_footnote_label_byte ::= text - '[' - '\\' - ']'
gfm_footnote_label_escape ::= '\\' ['[' | '\\' | ']']

; Any byte (u8)
byte ::= 0x00..=0xFFFF
space_or_tab ::= '\t' | ' '
eol ::= '\n' | '\r' | '\r\n'
line ::= byte - eol
text ::= line - space_or_tab
```

Further lines after `gfm_footnote_definition_start` that are not prefixed with
`gfm_footnote_definition_cont` cause the footnote definition to be exited,
except when those lines are lazy continuation or blank.
Like so many things in markdown, footnote definition too are complex.
See [*§ Phase 1: block structure* in `CommonMark`][commonmark-block] for more
on parsing details.

The identifiers in the `label` parts are interpreted as the
[string][micromark-content-types] content type.
That means that character escapes and character references are allowed.

Definitions match to references through identifiers.
To match, both labels must be equal after normalizing with
[`normalizeIdentifier`][micromark-normalize-identifier].
One definition can match to multiple calls.
Multiple definitions with the same, normalized, identifier are ignored: the
first definition is preferred.
To illustrate, the definition with the content of `x` wins:

```markdown
[^a]: x
[^a]: y

[^a]
```

Importantly, while labels *can* include [string][micromark-content-types]
content (character escapes and character references), these are not considered
when matching.
To illustrate, neither definition matches the reference:

```markdown
[^a&amp;b]: x
[^a\&b]: y

[^a&b]
```

Because footnote definitions are containers (like block quotes and list items),
they can contain more footnote definitions.
They can even include references to themselves.

## Types

This package is fully typed with [TypeScript][].
It exports the additional types [`BackLabelTemplate`][api-back-label-template]
and [`HtmlOptions`][api-html-options].

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-extension-gfm-footnote@^2`, compatible with Node.js 16.

This package works with `micromark` version `3` and later.

## Security

This package is safe.
Setting `clobberPrefix = ''` is dangerous, it opens you up to DOM clobbering.
The `labelTagName` and `labelAttributes` options are unsafe when used with user
content, they allow defining arbitrary HTML.

## Related

* [`micromark-extension-gfm`][micromark-extension-gfm]
  — support all of GFM
* [`mdast-util-gfm-footnote`][mdast-util-gfm-footnote]
  — support all of GFM in mdast
* [`mdast-util-gfm`][mdast-util-gfm]
  — support all of GFM in mdast
* [`remark-gfm`][remark-gfm]
  — support all of GFM in remark

## Contribute

See [`contributing.md` in `micromark/.github`][contributing] for ways to get
started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organization, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/micromark/micromark-extension-gfm-footnote/workflows/main/badge.svg

[build]: https://github.com/micromark/micromark-extension-gfm-footnote/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark-extension-gfm-footnote.svg

[coverage]: https://codecov.io/github/micromark/micromark-extension-gfm-footnote

[downloads-badge]: https://img.shields.io/npm/dm/micromark-extension-gfm-footnote.svg

[downloads]: https://www.npmjs.com/package/micromark-extension-gfm-footnote

[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-extension-gfm-footnote

[size]: https://bundlejs.com/?q=micromark-extension-gfm-footnote

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[collective]: https://opencollective.com/unified

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/micromark/micromark/discussions

[npm]: https://docs.npmjs.com/cli/install

[esmsh]: https://esm.sh

[license]: license

[author]: https://wooorm.com

[contributing]: https://github.com/micromark/.github/blob/main/contributing.md

[support]: https://github.com/micromark/.github/blob/main/support.md

[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[typescript]: https://www.typescriptlang.org

[development]: https://nodejs.org/api/packages.html#packages_resolving_user_conditions

[micromark]: https://github.com/micromark/micromark

[micromark-content-types]: https://github.com/micromark/micromark#content-types

[micromark-extension]: https://github.com/micromark/micromark#syntaxextension

[micromark-html-extension]: https://github.com/micromark/micromark#htmlextension

[micromark-normalize-identifier]: https://github.com/micromark/micromark/tree/main/packages/micromark-util-normalize-identifier

[micromark-extension-gfm]: https://github.com/micromark/micromark-extension-gfm

[mdast-util-gfm-footnote]: https://github.com/syntax-tree/mdast-util-gfm-footnote

[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm

[remark-gfm]: https://github.com/remarkjs/remark-gfm

[post]: https://github.blog/changelog/2021-09-30-footnotes-now-supported-in-markdown-fields/

[cmark-gfm]: https://github.com/github/cmark-gfm

[commonmark-block]: https://spec.commonmark.org/0.30/#phase-1-block-structure

[html-a]: https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-a-element

[html-data]: https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes

[html-h]: https://html.spec.whatwg.org/multipage/sections.html#the-h1,-h2,-h3,-h4,-h5,-and-h6-elements

[html-li]: https://html.spec.whatwg.org/multipage/grouping-content.html#the-li-element

[html-ol]: https://html.spec.whatwg.org/multipage/grouping-content.html#the-ol-element

[html-p]: https://html.spec.whatwg.org/multipage/grouping-content.html#the-p-element

[html-section]: https://html.spec.whatwg.org/multipage/sections.html#the-section-element

[html-sup]: https://html.spec.whatwg.org/multipage/text-level-semantics.html#the-sub-and-sup-elements

[aria-describedby]: https://w3c.github.io/aria/#aria-describedby

[aria-label]: https://w3c.github.io/aria/#aria-label

[api-gfm-footnote]: #gfmfootnote

[api-gfm-footnote-html]: #gfmfootnotehtmloptions

[api-html-options]: #htmloptions

[api-default-back-label]: #defaultbacklabelreferenceindex-rereferenceindex

[api-back-label-template]: #backlabeltemplate
/x 	40000 dev  bm'EgC'100644 index.d.ts P'h2f!100644 index.js |"XG:Q240000 lib 9aPbOG@100644 license 97#V}n-ƟO^100644 package.json 1̓
}qys100644 readme.md 8zv"{jꠍd(xh 100644 index.d.ts }<(uƆ]B{05;rxB100644 index.js {x0D{k40000 lib ҵ2'H鱊|),x1export {gfmStrikethroughHtml} from './lib/html.js'
export {gfmStrikethrough} from './lib/syntax.js'

/**
 * Configuration (optional).
 */
export interface Options {
  /**
   * Whether to support strikethrough with a single tilde (default: `true`).
   *
   * Single tildes work on github.com, but are technically prohibited by the
   * GFM spec.
   */
  singleTilde?: boolean | null | undefined
}

/**
 * Augment.
 */
declare module 'micromark-util-types' {
  /**
   * Token types.
   */
  interface TokenTypeMap {
    strikethroughSequence: 'strikethroughSequence'
    strikethroughSequenceTemporary: 'strikethroughSequenceTemporary'
    strikethrough: 'strikethrough'
    strikethroughText: 'strikethroughText'
  }
}
	x l// Note: more types exposed from `index.d.ts`.
export {gfmStrikethroughHtml} from './lib/html.js'
export {gfmStrikethrough} from './lib/syntax.js'
\5-	x k100644 html.d.ts 7krU100644 html.js Dڛ.̑D<100644 syntax.d.ts D',m|jX100644 syntax.js Lr<{G(ig^@>[xA ~strikethrough,strikethrough32StrikethroughqR+.(xq/**
 * @import {HtmlExtension} from 'micromark-util-types'
 */

/**
 * Create an HTML extension for `micromark` to support GFM task list items when
 * serializing to HTML.
 *
 * @returns {HtmlExtension}
 *   Extension for `micromark` that can be passed in `htmlExtensions` to
 *   support GFM task list items when serializing to HTML.
 */
export function gfmTaskListItemHtml() {
  return {
    enter: {
      taskListCheck() {
        this.tag('<input type="checkbox" disabled="" ')
      }
    },
    exit: {
      taskListCheck() {
        this.tag('/>')
      },
      taskListCheckValueChecked() {
        this.tag('checked="" ')
      }
    }
  }
}
s&x rstrikethrough,strikethrough42Strikethroughr'strikethrough<del>$strikethrough</del>')
      }
    }
  }
}
-x/**
 * Create an extension for `micromark` to enable GFM strikethrough syntax.
 *
 * @param {Options | null | undefined} [options={}]
 *   Configuration.
 * @returns {Extension}
 *   Extension for `micromark` that can be passed in `extensions`, to
 *   enable GFM strikethrough syntax.
 */
export function gfmStrikethrough(options?: Options | null | undefined): Extension;
import type { Options } from 'micromark-extension-gfm-strikethrough';
import type { Extension } from 'micromark-util-types';
!xK/**
 * @import {Options} from 'micromark-extension-gfm-strikethrough'
 * @import {Event, Extension, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {splice} from 'micromark-util-chunked'
import {classifyCharacter} from 'micromark-util-classify-character'
import {resolveAll} from 'micromark-util-resolve-all'
import {codes, constants, types} from 'micromark-util-symbol'

/**
 * Create an extension for `micromark` to enable GFM strikethrough syntax.
 *
 * @param {Options | null | undefined} [options={}]
 *   Configuration.
 * @returns {Extension}
 *   Extension for `micromark` that can be passed in `extensions`, to
 *   enable GFM strikethrough syntax.
 */
export function gfmStrikethrough(options) {
  const options_ = options || {}
  let single = options_.singleTilde
  const tokenizer = {
    name: 'strikethrough',
    tokenize: tokenizeStrikethrough,
    resolveAll: resolveAllStrikethrough
  }

  if (single === null || single === undefined) {
    single = true
  }

  return {
    text: {[codes.tilde]: tokenizer},
    insideSpan: {null: [tokenizer]},
    attentionMarkers: {null: [codes.tilde]}
  }

  /**
   * Take events and resolve strikethrough.
   *
   * @type {Resolver}
   */
  function resolveAllStrikethrough(events, context) {
    let index = -1

    // Walk through all events.
    while (++index < events.length) {
      // Find a token that can close.
      if (
        events[index][0] === 'enter' &&
        events[index][1].type === 'strikethroughSequenceTemporary' &&
        events[index][1]._close
      ) {
        let open = index

        // Now walk back to find an opener.
        while (open--) {
          // Find a token that can open the closer.
          if (
            events[open][0] === 'exit' &&
            events[open][1].type === 'strikethroughSequenceTemporary' &&
            events[open][1]._open &&
            // If the sizes are the same:
            events[index][1].end.offset - events[index][1].start.offset ===
              events[open][1].end.offset - events[open][1].start.offset
          ) {
            events[index][1].type = 'strikethroughSequence'
            events[open][1].type = 'strikethroughSequence'

            /** @type {Token} */
            const strikethrough = {
              type: 'strikethrough',
              start: Object.assign({}, events[open][1].start),
              end: Object.assign({}, events[index][1].end)
            }

            /** @type {Token} */
            const text = {
              type: 'strikethroughText',
              start: Object.assign({}, events[open][1].end),
              end: Object.assign({}, events[index][1].start)
            }

            // Opening.
            /** @type {Array<Event>} */
            const nextEvents = [
              ['enter', strikethrough, context],
              ['enter', events[open][1], context],
              ['exit', events[open][1], context],
              ['enter', text, context]
            ]

            const insideSpan = context.parser.constructs.insideSpan.null

            if (insideSpan) {
              // Between.
              splice(
                nextEvents,
                nextEvents.length,
                0,
                resolveAll(insideSpan, events.slice(open + 1, index), context)
              )
            }

            // Closing.
            splice(nextEvents, nextEvents.length, 0, [
              ['exit', text, context],
              ['enter', events[index][1], context],
              ['exit', events[index][1], context],
              ['exit', strikethrough, context]
            ])

            splice(events, open - 1, index - open + 3, nextEvents)

            index = open + nextEvents.length - 2
            break
          }
        }
      }
    }

    index = -1

    while (++index < events.length) {
      if (events[index][1].type === 'strikethroughSequenceTemporary') {
        events[index][1].type = types.data
      }
    }

    return events
  }

  /**
   * @this {TokenizeContext}
   * @type {Tokenizer}
   */
  function tokenizeStrikethrough(effects, ok, nok) {
    const previous = this.previous
    const events = this.events
    let size = 0

    return start

    /** @type {State} */
    function start(code) {
      assert(code === codes.tilde, 'expected `~`')

      if (
        previous === codes.tilde &&
        events[events.length - 1][1].type !== types.characterEscape
      ) {
        return nok(code)
      }

      effects.enter('strikethroughSequenceTemporary')
      return more(code)
    }

    /** @type {State} */
    function more(code) {
      const before = classifyCharacter(previous)

      if (code === codes.tilde) {
        // If this is the third marker, exit.
        if (size > 1) return nok(code)
        effects.consume(code)
        size++
        return more
      }

      if (size < 2 && !single) return nok(code)
      const token = effects.exit('strikethroughSequenceTemporary')
      const after = classifyCharacter(code)
      token._open =
        !after || (after === constants.attentionSideAfter && Boolean(before))
      token._close =
        !before || (before === constants.attentionSideAfter && Boolean(after))
      return ok(code)
    }
  }
}
>)xcexport {gfmStrikethroughHtml} from './lib/html.js'
export {gfmStrikethrough} from './lib/syntax.js'

/**
 * Configuration (optional).
 */
export interface Options {
  /**
   * Whether to support strikethrough with a single tilde (default: `true`).
   *
   * Single tildes work on github.com, but are technically prohibited by the
   * GFM spec.
   */
  singleTilde?: boolean | null | undefined
}

declare module 'micromark-util-types' {
  interface TokenTypeMap {
    strikethroughSequence: 'strikethroughSequence'
    strikethroughSequenceTemporary: 'strikethroughSequenceTemporary'
    strikethrough: 'strikethrough'
    strikethroughText: 'strikethroughText'
  }
}
?C̸	x g// Note: more types exposed from `index.d.ts`.
export { gfmStrikethroughHtml } from './lib/html.js';
export { gfmStrikethrough } from './lib/syntax.js';,6	x k100644 html.d.ts 7krU100644 html.js l >uDnlϩ>100644 syntax.d.ts D',m|jX100644 syntax.js q][
2 cfIADTx 1`,/**
 * Create an HTML e>o support GFM strikethrough% ]#, to
 *   support GFM strikethrough2StrikethroughHtml() {*strikethrough() {
        this.tag('<del>'$strikethrough() {
del>');
      }
    }
  };
}Jxd/**
 * @import {Options} from 'micromark-extension-gfm-strikethrough'
 * @import {Event, Extension, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'
 */

import { splice } from 'micromark-util-chunked';
import { classifyCharacter } from 'micromark-util-classify-character';
import { resolveAll } from 'micromark-util-resolve-all';
/**
 * Create an extension for `micromark` to enable GFM strikethrough syntax.
 *
 * @param {Options | null | undefined} [options={}]
 *   Configuration.
 * @returns {Extension}
 *   Extension for `micromark` that can be passed in `extensions`, to
 *   enable GFM strikethrough syntax.
 */
export function gfmStrikethrough(options) {
  const options_ = options || {};
  let single = options_.singleTilde;
  const tokenizer = {
    name: 'strikethrough',
    tokenize: tokenizeStrikethrough,
    resolveAll: resolveAllStrikethrough
  };
  if (single === null || single === undefined) {
    single = true;
  }
  return {
    text: {
      [126]: tokenizer
    },
    insideSpan: {
      null: [tokenizer]
    },
    attentionMarkers: {
      null: [126]
    }
  };

  /**
   * Take events and resolve strikethrough.
   *
   * @type {Resolver}
   */
  function resolveAllStrikethrough(events, context) {
    let index = -1;

    // Walk through all events.
    while (++index < events.length) {
      // Find a token that can close.
      if (events[index][0] === 'enter' && events[index][1].type === 'strikethroughSequenceTemporary' && events[index][1]._close) {
        let open = index;

        // Now walk back to find an opener.
        while (open--) {
          // Find a token that can open the closer.
          if (events[open][0] === 'exit' && events[open][1].type === 'strikethroughSequenceTemporary' && events[open][1]._open &&
          // If the sizes are the same:
          events[index][1].end.offset - events[index][1].start.offset === events[open][1].end.offset - events[open][1].start.offset) {
            events[index][1].type = 'strikethroughSequence';
            events[open][1].type = 'strikethroughSequence';

            /** @type {Token} */
            const strikethrough = {
              type: 'strikethrough',
              start: Object.assign({}, events[open][1].start),
              end: Object.assign({}, events[index][1].end)
            };

            /** @type {Token} */
            const text = {
              type: 'strikethroughText',
              start: Object.assign({}, events[open][1].end),
              end: Object.assign({}, events[index][1].start)
            };

            // Opening.
            /** @type {Array<Event>} */
            const nextEvents = [['enter', strikethrough, context], ['enter', events[open][1], context], ['exit', events[open][1], context], ['enter', text, context]];
            const insideSpan = context.parser.constructs.insideSpan.null;
            if (insideSpan) {
              // Between.
              splice(nextEvents, nextEvents.length, 0, resolveAll(insideSpan, events.slice(open + 1, index), context));
            }

            // Closing.
            splice(nextEvents, nextEvents.length, 0, [['exit', text, context], ['enter', events[index][1], context], ['exit', events[index][1], context], ['exit', strikethrough, context]]);
            splice(events, open - 1, index - open + 3, nextEvents);
            index = open + nextEvents.length - 2;
            break;
          }
        }
      }
    }
    index = -1;
    while (++index < events.length) {
      if (events[index][1].type === 'strikethroughSequenceTemporary') {
        events[index][1].type = "data";
      }
    }
    return events;
  }

  /**
   * @this {TokenizeContext}
   * @type {Tokenizer}
   */
  function tokenizeStrikethrough(effects, ok, nok) {
    const previous = this.previous;
    const events = this.events;
    let size = 0;
    return start;

    /** @type {State} */
    function start(code) {
      if (previous === 126 && events[events.length - 1][1].type !== "characterEscape") {
        return nok(code);
      }
      effects.enter('strikethroughSequenceTemporary');
      return more(code);
    }

    /** @type {State} */
    function more(code) {
      const before = classifyCharacter(previous);
      if (code === 126) {
        // If this is the third marker, exit.
        if (size > 1) return nok(code);
        effects.consume(code);
        size++;
        return more;
      }
      if (size < 2 && !single) return nok(code);
      const token = effects.exit('strikethroughSequenceTemporary');
      const after = classifyCharacter(code);
      token._open = !after || after === 2 && Boolean(before);
      token._close = !before || before === 2 && Boolean(after);
      return ok(code);
    }
  }
}Pҁx%strikethrough-NstrikethroughXPstrikethrough",
    "strike",
    "through",
    "del",
    "delete",
    "deletQstrikethroughnCstrikethroughutil-chunked0!classify&+resolve-all0!L	ape": "^5U	max-deptha
*
4	"**/*.ts" 2"test/**/*.js"S	k\CAxMA# p%(!Hicromark][] extensions to support GFM [strikethrough][].

## Contents

*q"([Use](#use)
* [API](#api)
  * [`gfmStrikethrough(options?)`](#gfmstrikethroughoptions)
  * [`gfmStrikethroughHtml()`](#gfmstrikohtml)
  * [`Options`](#options)
* [Authoring](#authoring)
* [HTML](#html)
* [CSS](#css)
* [Syntax](#syntax)
* [Types](#types)
*"#-[Security](#security)
* [Related](#related)
*^}= ;strikethrough as enabled
by GFM to [`micromark`][micromark]/This project is useful when you want to support66< [`micromark`][micromark].
To support all GFM features, use
`][].

When youGcombine this package with
[`][]#@ focusses on making
w3 internals awawuq%%	D-, gfmStrikethroughHtml} from 'https://esm.sh/%	g-, gfmStrikethroughHtml} from 'https://esm.sh/%i
"^```js
import {micromark} from 'micromark'
import {
  gfmStrikethrough,
  gfmStrikethroughHtml
j/1
const output = micromark('Some ~strikethrough~.'*htmlZHtml()]
})

console.log(output)
```

Yields:

```html
<p>Some <del>strikethrough</del></p>F] andHtmlhtmll The export map supports the [`development` condition][development].
Run `node --conditions development module.js` to get instrucmented dev code.
Without this condition, production code is loaded.

### `gfmStrikethrough(options?`micromark` `syntax.

###### Parameters

* `options` ([`Options`][api-options], optional)
  — configurationN"icromark` that can be passed in `extensions`, to
enable GFM strikethrough syntax ([`Extension`][micromark-extension]).

### `gfgHtml()`

Create an HTML extension for `micromark` to support GFM strikethrough when
serializing to HTMLM#icromark` that can be passed in `htmlExtensions`, to support
GFM strikethrough when serializing to HTML
([`HtmlExtension`][micromark-html-extension]).

### `Options`

Configuration (TypeScript type).

###### Fields

* `singleTilde` (`boolean`, default: `true`)
  — whether to support strikethrough with a single tilde.
  Single tildes work on github.com, but are technically prohibited by the GFM
  spec

## Authoring

When authoring markdown with strikethrough, it is recommended to use two
markers.
While `github.com` allows single tildes too, it technically prohibits it in
their spec.

## HTML

When tilde sequences match, they together relate to the `<del>` element in
HTML.
See [*§ 4.7.2 The `del` element*][html-del] in the HTML spec for more info.

## CSS

GitHub itself does not apply interesting CSS to `del` elements.
It currently (July 2022) does change `code` in `del`.

```css
del code {
  text-decoration: inherit;
}
```

For the complete actual CSS see
[`sindresorhus/github-markdown-css`][github-markdown-css].

## Syntax

Strikethrough sequences form with the following BNF:

```bnf
gfm_attention_sequence ::= 1*'~'
```

Sequences are matched together to form strikethrough based on which character
they contain, how long they are, and what characteMr occurs before and after
each sequence.
Otherwise they are turned into data.@4exports the additional type [`Options`][api-options]$(hpackage works with `micromark` version `3` and later.

## Security

This package is safe.

## Related

*`][]
  — support all of GFM
* [`][&]
  — support all of GFM in mdast
* "$
  — support all of GFM in mdast
*A#
  — support all of GFM in remark'7 in `micromark/.github`][contributing] for ways to get
7f%/W7f%/D1%.",1%.v4$2q%(q%(q%($f%3 = !2f!"	micromark!B	micromark!9	micromark$"(m N .Udevelopment]: https://nodejs.org/api/packages.html#packages_resolving_user_conditions%8micromark-html# f%#htmlextension

[micromark# f%#syntaxextension

[P%7

[P%P!"@$Ds"6strikethroughO"!/#strikethrough-extension-

[github-markdown-cssP% bgithub-markdown-css

[html-del]: https://html.spec.whatwg.org/multipage/edits.html#the-del-elementa&]: #gfmstrikethroughoptionsa&6html]: #gfmstrikethroughhtml

[api-options]: #options
Mx 	40000 dev f$vR
[Λ100644 index.d.ts |\3iP{2R100644 index.js gӓ}+! 40000 lib  '! t3100644 license Zbv8f,Q)100644 package.json &Cxn#ss%	100644 readme.md /CzNH~DRҦC\bxh 100644 index.d.ts |\3iP{2R100644 index.js ܵV?:Ofʙa8#$40000 lib J-J^ntZ''Oximport type {Align} from './lib/infer.js'

export {gfmTableHtml} from './lib/html.js'
export {gfmTable} from './lib/syntax.js'

/**
 * Augment types.
 */
declare module 'micromark-util-types' {
  /**
   * State tracked to compile events as HTML,
   * extended by `micromark-extension-gfm-table`.
   */
  interface CompileData {
    /**
     * Alignment of current table.
     */
    tableAlign?: Array<Align> | undefined
    /**
     * Current table column.
     */
    tableColumn?: number | undefined
  }

  /**
   * Augment token;
   * `align` is patched on `table` tokens by
   * `micromark-extension-gfm-table`.
   */
  interface Token {
    /**
     * Alignment of current table.
     */
    _align?: Array<Align> | undefined
  }

  /**
   * Map of allowed token types,
   * extended by `micromark-extension-gfm-table`.
   */
  interface TokenTypeMap {
    tableBody: 'tableBody'
    tableCellDivider: 'tableCellDivider'
    tableContent: 'tableContent'
    tableData: 'tableData'
    tableDelimiterFiller: 'tableDelimiterFiller'
    tableDelimiterMarker: 'tableDelimiterMarker'
    tableDelimiterRow: 'tableDelimiterRow'
    tableDelimiter: 'tableDelimiter'
    tableHeader: 'tableHeader'
    tableHead: 'tableHead'
    tableRow: 'tableRow'
    table: 'table'
  }
}
xT export {gfmTableHtml} from './lib/html.js'
export {gfmTable} from './lib/syntax.js'
	ީx&100644 edit-map.d.ts o>]q<M100644 edit-map.d.ts.map "IR>{v9va6100644 edit-map.js =Vq=)M100644 html.d.ts Mfn(AFu100644 html.d.ts.map +)ccg]-100644 html.js /7 DF:x100644 infer.d.ts Xa[|G܆K 100644 infer.d.ts.map ű,ލ:D8Vz0100644 infer.js nN i Uv.100644 syntax.d.ts (널VY100644 syntax.d.ts.map bV]ϩ100644 syntax.js qi0b.Sn3GH;xI/**
 * @import {Event} from 'micromark-util-types'
 */
/**
 * @typedef {[number, number, Array<Event>]} Change
 * @typedef {[number, number, number]} Jump
 */
/**
 * Tracks a bunch of edits.
 */
export class EditMap {
    /**
     * Record of changes.
     *
     * @type {Array<Change>}
     */
    map: Array<Change>;
    /**
     * Create an edit: a remove and/or add at a certain place.
     *
     * @param {number} index
     * @param {number} remove
     * @param {Array<Event>} add
     * @returns {undefined}
     */
    add(index: number, remove: number, add: Array<Event>): undefined;
    /**
     * Done, change the events.
     *
     * @param {Array<Event>} events
     * @returns {undefined}
     */
    consume(events: Array<Event>): undefined;
}
export type Change = [number, number, Array<Event>];
export type Jump = [number, number, number];
import type { Event } from 'micromark-util-types';
//# sourceMappingURL=edit-map.d.ts.mapl'x<{"version":3,"file":"edit-map.d.ts","sourceRoot":"","sources":["edit-map.js"],"names":[],"mappings":"AAAA;;GAEG;AAeH;;;GAGG;AAEH;;GAEG;AACH;IAKI;;;;OAIG;IACH,KAFU,KAAK,CAAC,MAAM,CAAC,CAEV;IAGf;;;;;;;OAOG;IACH,WALW,MAAM,UACN,MAAM,OACN,KAAK,CAAC,KAAK,CAAC,GACV,SAAS,CAIrB;IAeD;;;;;OAKG;IACH,gBAHW,KAAK,CAAC,KAAK,CAAC,GACV,SAAS,CA2DrB;CACF;qBA7GY,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;mBAC9B,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;2BAlBb,sBAAsB"}{xR/**
 * @import {Event} from 'micromark-util-types'
 */

// Port of `edit_map.rs` from `markdown-rs`.
// This should move to `markdown-js` later.

// Deal with several changes in events, batching them together.
//
// Preferably, changes should be kept to a minimum.
// Sometimes, it’s needed to change the list of events, because parsing can be
// messy, and it helps to expose a cleaner interface of events to the compiler
// and other users.
// It can also help to merge many adjacent similar events.
// And, in other cases, it’s needed to parse subcontent: pass some events
// through another tokenizer and inject the result.

/**
 * @typedef {[number, number, Array<Event>]} Change
 * @typedef {[number, number, number]} Jump
 */

/**
 * Tracks a bunch of edits.
 */
export class EditMap {
  /**
   * Create a new edit map.
   */
  constructor() {
    /**
     * Record of changes.
     *
     * @type {Array<Change>}
     */
    this.map = []
  }

  /**
   * Create an edit: a remove and/or add at a certain place.
   *
   * @param {number} index
   * @param {number} remove
   * @param {Array<Event>} add
   * @returns {undefined}
   */
  add(index, remove, add) {
    addImplementation(this, index, remove, add)
  }

  // To do: add this when moving to `micromark`.
  // /**
  //  * Create an edit: but insert `add` before existing additions.
  //  *
  //  * @param {number} index
  //  * @param {number} remove
  //  * @param {Array<Event>} add
  //  * @returns {undefined}
  //  */
  // addBefore(index, remove, add) {
  //   addImplementation(this, index, remove, add, true)
  // }

  /**
   * Done, change the events.
   *
   * @param {Array<Event>} events
   * @returns {undefined}
   */
  consume(events) {
    this.map.sort(function (a, b) {
      return a[0] - b[0]
    })

    /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */
    if (this.map.length === 0) {
      return
    }

    // To do: if links are added in events, like they are in `markdown-rs`,
    // this is needed.
    // // Calculate jumps: where items in the current list move to.
    // /** @type {Array<Jump>} */
    // const jumps = []
    // let index = 0
    // let addAcc = 0
    // let removeAcc = 0
    // while (index < this.map.length) {
    //   const [at, remove, add] = this.map[index]
    //   removeAcc += remove
    //   addAcc += add.length
    //   jumps.push([at, removeAcc, addAcc])
    //   index += 1
    // }
    //
    // . shiftLinks(events, jumps)

    let index = this.map.length
    /** @type {Array<Array<Event>>} */
    const vecs = []
    while (index > 0) {
      index -= 1
      vecs.push(
        events.slice(this.map[index][0] + this.map[index][1]),
        this.map[index][2]
      )

      // Truncate rest.
      events.length = this.map[index][0]
    }

    vecs.push(events.slice())
    events.length = 0

    let slice = vecs.pop()

    while (slice) {
      for (const element of slice) {
        events.push(element)
      }

      slice = vecs.pop()
    }

    // Truncate everything.
    this.map.length = 0
  }
}

/**
 * Create an edit.
 *
 * @param {EditMap} editMap
 * @param {number} at
 * @param {number} remove
 * @param {Array<Event>} add
 * @returns {undefined}
 */
function addImplementation(editMap, at, remove, add) {
  let index = 0

  /* c8 ignore next 3 -- `resolve` is never called without tables, so without edits. */
  if (remove === 0 && add.length === 0) {
    return
  }

  while (index < editMap.map.length) {
    if (editMap.map[index][0] === at) {
      editMap.map[index][1] += remove

      // To do: before not used by tables, use when moving to micromark.
      // if (before) {
      //   add.push(...editMap.map[index][2])
      //   editMap.map[index][2] = add
      // } else {
      editMap.map[index][2].push(...add)
      // }

      return
    }

    index += 1
  }

  editMap.map.push([at, remove, add])
}

// /**
//  * Shift `previous` and `next` links according to `jumps`.
//  *
//  * This fixes links in case there are events removed or added between them.
//  *
//  * @param {Array<Event>} events
//  * @param {Array<Jump>} jumps
//  */
// function shiftLinks(events, jumps) {
//   let jumpIndex = 0
//   let index = 0
//   let add = 0
//   let rm = 0

//   while (index < events.length) {
//     const rmCurr = rm

//     while (jumpIndex < jumps.length && jumps[jumpIndex][0] <= index) {
//       add = jumps[jumpIndex][2]
//       rm = jumps[jumpIndex][1]
//       jumpIndex += 1
//     }

//     // Ignore items that will be removed.
//     if (rm > rmCurr) {
//       index += rm - rmCurr
//     } else {
//       // ?
//       // if let Some(link) = &events[index].link {
//       //     if let Some(next) = link.next {
//       //         events[next].link.as_mut().unwrap().previous = Some(index + add - rm);
//       //         while jumpIndex < jumps.len() && jumps[jumpIndex].0 <= next {
//       //             add = jumps[jumpIndex].2;
//       //             rm = jumps[jumpIndex].1;
//       //             jumpIndex += 1;
//       //         }
//       //         events[index].link.as_mut().unwrap().next = Some(next + add - rm);
//       //         index = next;
//       //         continue;
//       //     }
//       // }
//       index += 1
//     }
//   }
// }
-(xQ ?<itHub tableitHub table25bleqR"//# sourceMappingURL=html.d.ts.map	x k{"version":3,"file":"html.d.ts","sourceRoot":"","sources":["html.js"],"names":[],"mappings":"AAeA;;;;;;;GAOG;AACH,gCAJa,aAAa,CAsHzB;mCAxI+B,sBAAsB"}-෕xW/**
 * @import {HtmlExtension} from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'

const alignment = {
  none: '',
  left: ' align="left"',
  right: ' align="right"',
  center: ' align="center"'
}

// To do: micromark@5: use `infer` here, when all events are exposed.

/**
 * Create an HTML extension for `micromark` to support GitHub tables when
 * serializing to HTML.
 *
 * @returns {HtmlExtension}
 *   Extension for `micromark` that can be passed in `htmlExtensions` to
 *   support GitHub tables when serializing to HTML.
 */
export function gfmTableHtml() {
  return {
    enter: {
      table(token) {
        const tableAlign = token._align
        assert(tableAlign, 'expected `_align`')
        this.lineEndingIfNeeded()
        this.tag('<table>')
        this.setData('tableAlign', tableAlign)
      },
      tableBody() {
        this.tag('<tbody>')
      },
      tableData() {
        const tableAlign = this.getData('tableAlign')
        const tableColumn = this.getData('tableColumn')
        assert(tableAlign, 'expected `tableAlign`')
        assert(typeof tableColumn === 'number', 'expected `tableColumn`')
        const align = alignment[tableAlign[tableColumn]]

        if (align === undefined) {
          // Capture results to ignore them.
          this.buffer()
        } else {
          this.lineEndingIfNeeded()
          this.tag('<td' + align + '>')
        }
      },
      tableHead() {
        this.lineEndingIfNeeded()
        this.tag('<thead>')
      },
      tableHeader() {
        const tableAlign = this.getData('tableAlign')
        const tableColumn = this.getData('tableColumn')
        assert(tableAlign, 'expected `tableAlign`')
        assert(typeof tableColumn === 'number', 'expected `tableColumn`')
        const align = alignment[tableAlign[tableColumn]]
        this.lineEndingIfNeeded()
        this.tag('<th' + align + '>')
      },
      tableRow() {
        this.setData('tableColumn', 0)
        this.lineEndingIfNeeded()
        this.tag('<tr>')
      }
    },
    exit: {
      // Overwrite the default code text data handler to unescape escaped pipes when
      // they are in tables.
      codeTextData(token) {
        let value = this.sliceSerialize(token)

        if (this.getData('tableAlign')) {
          value = value.replace(/\\([\\|])/g, replace)
        }

        this.raw(this.encode(value))
      },
      table() {
        this.setData('tableAlign')
        // Note: we don’t set `slurpAllLineEndings` anymore, in delimiter rows,
        // but we do need to reset it to match a funky newline GH generates for
        // list items combined with tables.
        this.setData('slurpAllLineEndings')
        this.lineEndingIfNeeded()
        this.tag('</table>')
      },
      tableBody() {
        this.lineEndingIfNeeded()
        this.tag('</tbody>')
      },
      tableData() {
        const tableAlign = this.getData('tableAlign')
        const tableColumn = this.getData('tableColumn')
        assert(tableAlign, 'expected `tableAlign`')
        assert(typeof tableColumn === 'number', 'expected `tableColumn`')

        if (tableColumn in tableAlign) {
          this.tag('</td>')
          this.setData('tableColumn', tableColumn + 1)
        } else {
          // Stop capturing.
          this.resume()
        }
      },
      tableHead() {
        this.lineEndingIfNeeded()
        this.tag('</thead>')
      },
      tableHeader() {
        const tableColumn = this.getData('tableColumn')
        assert(typeof tableColumn === 'number', 'expected `tableColumn`')
        this.tag('</th>')
        this.setData('tableColumn', tableColumn + 1)
      },
      tableRow() {
        const tableAlign = this.getData('tableAlign')
        let tableColumn = this.getData('tableColumn')
        assert(tableAlign, 'expected `tableAlign`')
        assert(typeof tableColumn === 'number', 'expected `tableColumn`')

        while (tableColumn < tableAlign.length) {
          this.lineEndingIfNeeded()
          this.tag('<td' + alignment[tableAlign[tableColumn]] + '></td>')
          tableColumn++
        }

        this.setData('tableColumn', tableColumn)
        this.lineEndingIfNeeded()
        this.tag('</tr>')
      }
    }
  }
}

/**
 * @param {string} $0
 * @param {string} $1
 * @returns {string}
 */
function replace($0, $1) {
  // Pipes work, backslashes don’t (but can’t escape pipes).
  return $1 === '|' ? $1 : $0
}
!r4jx</**
 * Figure out the alignment of a GFM table.
 *
 * @param {Readonly<Array<Event>>} events
 *   List of events.
 * @param {number} index
 *   Table enter event.
 * @returns {Array<Align>}
 *   List of aligns.
 */
export function gfmTableAlign(events: Readonly<Array<Event>>, index: number): Array<Align>;
export type Align = "center" | "left" | "none" | "right";
import type { Event } from 'micromark-util-types';
//# sourceMappingURL=infer.d.ts.mapHx{"version":3,"file":"infer.d.ts","sourceRoot":"","sources":["infer.js"],"names":[],"mappings":"AAUA;;;;;;;;;GASG;AACH,sCAPW,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,SAEtB,MAAM,GAEJ,KAAK,CAAC,KAAK,CAAC,CA8CxB;oBA1DY,QAAQ,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO;2BAJzB,sBAAsB"}Q,Igxz/**
 * @import {Event} from 'micromark-util-types'
 */

/**
 * @typedef {'center' | 'left' | 'none' | 'right'} Align
 */

import {ok as assert} from 'devlop'

/**
 * Figure out the alignment of a GFM table.
 *
 * @param {Readonly<Array<Event>>} events
 *   List of events.
 * @param {number} index
 *   Table enter event.
 * @returns {Array<Align>}
 *   List of aligns.
 */
export function gfmTableAlign(events, index) {
  assert(events[index][1].type === 'table', 'expected table')
  let inDelimiterRow = false
  /** @type {Array<Align>} */
  const align = []

  while (index < events.length) {
    const event = events[index]

    if (inDelimiterRow) {
      if (event[0] === 'enter') {
        // Start of alignment value: set a new column.
        // To do: `markdown-rs` uses `tableDelimiterCellValue`.
        if (event[1].type === 'tableContent') {
          align.push(
            events[index + 1][1].type === 'tableDelimiterMarker'
              ? 'left'
              : 'none'
          )
        }
      }
      // Exits:
      // End of alignment value: change the column.
      // To do: `markdown-rs` uses `tableDelimiterCellValue`.
      else if (event[1].type === 'tableContent') {
        if (events[index - 1][1].type === 'tableDelimiterMarker') {
          const alignIndex = align.length - 1

          align[alignIndex] = align[alignIndex] === 'left' ? 'center' : 'right'
        }
      }
      // Done!
      else if (event[1].type === 'tableDelimiterRow') {
        break
      }
    } else if (event[0] === 'enter' && event[1].type === 'tableDelimiterRow') {
      inDelimiterRow = true
    }

    index += 1
  }

  return align
}
|!x/**
 * Create an HTML extension for `micromark` to support GitHub tables syntax.
 *
 * @returns {Extension}
 *   Extension for `micromark` that can be passed in `extensions` to enable GFM
 *   table syntax.
 */
export function gfmTable(): Extension;
/**
 * Cell info.
 */
export type Range = [number, number, number, number];
/**
 * Where we are: `1` for head row, `2` for delimiter row, `3` for body row.
 */
export type RowKind = 0 | 1 | 2 | 3;
import type { Extension } from 'micromark-util-types';
//# sourceMappingURL=syntax.d.ts.mapVmx {"version":3,"file":"syntax.d.ts","sourceRoot":"","sources":["syntax.js"],"names":[],"mappings":"AAuBA;;;;;;GAMG;AACH,4BAJa,SAAS,CAUrB;;;;oBA/BY,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC;;;;sBAGhC,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC;+BAPoE,sBAAsB"}Z}G޼
xUc/**
 * @import {Event, Extension, Point, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'
 */

/**
 * @typedef {[number, number, number, number]} Range
 *   Cell info.
 *
 * @typedef {0 | 1 | 2 | 3} RowKind
 *   Where we are: `1` for head row, `2` for delimiter row, `3` for body row.
 */

import {ok as assert} from 'devlop'
import {factorySpace} from 'micromark-factory-space'
import {
  markdownLineEnding,
  markdownLineEndingOrSpace,
  markdownSpace
} from 'micromark-util-character'
import {codes, constants, types} from 'micromark-util-symbol'
import {EditMap} from './edit-map.js'
import {gfmTableAlign} from './infer.js'

/**
 * Create an HTML extension for `micromark` to support GitHub tables syntax.
 *
 * @returns {Extension}
 *   Extension for `micromark` that can be passed in `extensions` to enable GFM
 *   table syntax.
 */
export function gfmTable() {
  return {
    flow: {
      null: {name: 'table', tokenize: tokenizeTable, resolveAll: resolveTable}
    }
  }
}

/**
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeTable(effects, ok, nok) {
  const self = this
  let size = 0
  let sizeB = 0
  /** @type {boolean | undefined} */
  let seen

  return start

  /**
   * Start of a GFM table.
   *
   * If there is a valid table row or table head before, then we try to parse
   * another row.
   * Otherwise, we try to parse a head.
   *
   * ```markdown
   * > | | a |
   *     ^
   *   | | - |
   * > | | b |
   *     ^
   * ```
   * @type {State}
   */
  function start(code) {
    let index = self.events.length - 1

    while (index > -1) {
      const type = self.events[index][1].type
      if (
        type === types.lineEnding ||
        // Note: markdown-rs uses `whitespace` instead of `linePrefix`
        type === types.linePrefix
      )
        index--
      else break
    }

    const tail = index > -1 ? self.events[index][1].type : null

    const next =
      tail === 'tableHead' || tail === 'tableRow' ? bodyRowStart : headRowBefore

    // Don’t allow lazy body rows.
    if (next === bodyRowStart && self.parser.lazy[self.now().line]) {
      return nok(code)
    }

    return next(code)
  }

  /**
   * Before table head row.
   *
   * ```markdown
   * > | | a |
   *     ^
   *   | | - |
   *   | | b |
   * ```
   *
   * @type {State}
   */
  function headRowBefore(code) {
    effects.enter('tableHead')
    effects.enter('tableRow')
    return headRowStart(code)
  }

  /**
   * Before table head row, after whitespace.
   *
   * ```markdown
   * > | | a |
   *     ^
   *   | | - |
   *   | | b |
   * ```
   *
   * @type {State}
   */
  function headRowStart(code) {
    if (code === codes.verticalBar) {
      return headRowBreak(code)
    }

    // To do: micromark-js should let us parse our own whitespace in extensions,
    // like `markdown-rs`:
    //
    // ```js
    // // 4+ spaces.
    // if (markdownSpace(code)) {
    //   return nok(code)
    // }
    // ```

    seen = true
    // Count the first character, that isn’t a pipe, double.
    sizeB += 1
    return headRowBreak(code)
  }

  /**
   * At break in table head row.
   *
   * ```markdown
   * > | | a |
   *     ^
   *       ^
   *         ^
   *   | | - |
   *   | | b |
   * ```
   *
   * @type {State}
   */
  function headRowBreak(code) {
    if (code === codes.eof) {
      // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.
      return nok(code)
    }

    if (markdownLineEnding(code)) {
      // If anything other than one pipe (ignoring whitespace) was used, it’s fine.
      if (sizeB > 1) {
        sizeB = 0
        // To do: check if this works.
        // Feel free to interrupt:
        self.interrupt = true
        effects.exit('tableRow')
        effects.enter(types.lineEnding)
        effects.consume(code)
        effects.exit(types.lineEnding)
        return headDelimiterStart
      }

      // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.
      return nok(code)
    }

    if (markdownSpace(code)) {
      // To do: check if this is fine.
      // effects.attempt(State::Next(StateName::GfmTableHeadRowBreak), State::Nok)
      // State::Retry(space_or_tab(tokenizer))
      return factorySpace(effects, headRowBreak, types.whitespace)(code)
    }

    sizeB += 1

    if (seen) {
      seen = false
      // Header cell count.
      size += 1
    }

    if (code === codes.verticalBar) {
      effects.enter('tableCellDivider')
      effects.consume(code)
      effects.exit('tableCellDivider')
      // Whether a delimiter was seen.
      seen = true
      return headRowBreak
    }

    // Anything else is cell data.
    effects.enter(types.data)
    return headRowData(code)
  }

  /**
   * In table head row data.
   *
   * ```markdown
   * > | | a |
   *       ^
   *   | | - |
   *   | | b |
   * ```
   *
   * @type {State}
   */
  function headRowData(code) {
    if (
      code === codes.eof ||
      code === codes.verticalBar ||
      markdownLineEndingOrSpace(code)
    ) {
      effects.exit(types.data)
      return headRowBreak(code)
    }

    effects.consume(code)
    return code === codes.backslash ? headRowEscape : headRowData
  }

  /**
   * In table head row escape.
   *
   * ```markdown
   * > | | a\-b |
   *         ^
   *   | | ---- |
   *   | | c    |
   * ```
   *
   * @type {State}
   */
  function headRowEscape(code) {
    if (code === codes.backslash || code === codes.verticalBar) {
      effects.consume(code)
      return headRowData
    }

    return headRowData(code)
  }

  /**
   * Before delimiter row.
   *
   * ```markdown
   *   | | a |
   * > | | - |
   *     ^
   *   | | b |
   * ```
   *
   * @type {State}
   */
  function headDelimiterStart(code) {
    // Reset `interrupt`.
    self.interrupt = false

    // Note: in `markdown-rs`, we need to handle piercing here too.
    if (self.parser.lazy[self.now().line]) {
      return nok(code)
    }

    effects.enter('tableDelimiterRow')
    // Track if we’ve seen a `:` or `|`.
    seen = false

    if (markdownSpace(code)) {
      assert(self.parser.constructs.disable.null, 'expected `disabled.null`')
      return factorySpace(
        effects,
        headDelimiterBefore,
        types.linePrefix,
        self.parser.constructs.disable.null.includes('codeIndented')
          ? undefined
          : constants.tabSize
      )(code)
    }

    return headDelimiterBefore(code)
  }

  /**
   * Before delimiter row, after optional whitespace.
   *
   * Reused when a `|` is found later, to parse another cell.
   *
   * ```markdown
   *   | | a |
   * > | | - |
   *     ^
   *   | | b |
   * ```
   *
   * @type {State}
   */
  function headDelimiterBefore(code) {
    if (code === codes.dash || code === codes.colon) {
      return headDelimiterValueBefore(code)
    }

    if (code === codes.verticalBar) {
      seen = true
      // If we start with a pipe, we open a cell marker.
      effects.enter('tableCellDivider')
      effects.consume(code)
      effects.exit('tableCellDivider')
      return headDelimiterCellBefore
    }

    // More whitespace / empty row not allowed at start.
    return headDelimiterNok(code)
  }

  /**
   * After `|`, before delimiter cell.
   *
   * ```markdown
   *   | | a |
   * > | | - |
   *      ^
   * ```
   *
   * @type {State}
   */
  function headDelimiterCellBefore(code) {
    if (markdownSpace(code)) {
      return factorySpace(
        effects,
        headDelimiterValueBefore,
        types.whitespace
      )(code)
    }

    return headDelimiterValueBefore(code)
  }

  /**
   * Before delimiter cell value.
   *
   * ```markdown
   *   | | a |
   * > | | - |
   *       ^
   * ```
   *
   * @type {State}
   */
  function headDelimiterValueBefore(code) {
    // Align: left.
    if (code === codes.colon) {
      sizeB += 1
      seen = true

      effects.enter('tableDelimiterMarker')
      effects.consume(code)
      effects.exit('tableDelimiterMarker')
      return headDelimiterLeftAlignmentAfter
    }

    // Align: none.
    if (code === codes.dash) {
      sizeB += 1
      // To do: seems weird that this *isn’t* left aligned, but that state is used?
      return headDelimiterLeftAlignmentAfter(code)
    }

    if (code === codes.eof || markdownLineEnding(code)) {
      return headDelimiterCellAfter(code)
    }

    return headDelimiterNok(code)
  }

  /**
   * After delimiter cell left alignment marker.
   *
   * ```markdown
   *   | | a  |
   * > | | :- |
   *        ^
   * ```
   *
   * @type {State}
   */
  function headDelimiterLeftAlignmentAfter(code) {
    if (code === codes.dash) {
      effects.enter('tableDelimiterFiller')
      return headDelimiterFiller(code)
    }

    // Anything else is not ok after the left-align colon.
    return headDelimiterNok(code)
  }

  /**
   * In delimiter cell filler.
   *
   * ```markdown
   *   | | a |
   * > | | - |
   *       ^
   * ```
   *
   * @type {State}
   */
  function headDelimiterFiller(code) {
    if (code === codes.dash) {
      effects.consume(code)
      return headDelimiterFiller
    }

    // Align is `center` if it was `left`, `right` otherwise.
    if (code === codes.colon) {
      seen = true
      effects.exit('tableDelimiterFiller')
      effects.enter('tableDelimiterMarker')
      effects.consume(code)
      effects.exit('tableDelimiterMarker')
      return headDelimiterRightAlignmentAfter
    }

    effects.exit('tableDelimiterFiller')
    return headDelimiterRightAlignmentAfter(code)
  }

  /**
   * After delimiter cell right alignment marker.
   *
   * ```markdown
   *   | |  a |
   * > | | -: |
   *         ^
   * ```
   *
   * @type {State}
   */
  function headDelimiterRightAlignmentAfter(code) {
    if (markdownSpace(code)) {
      return factorySpace(
        effects,
        headDelimiterCellAfter,
        types.whitespace
      )(code)
    }

    return headDelimiterCellAfter(code)
  }

  /**
   * After delimiter cell.
   *
   * ```markdown
   *   | |  a |
   * > | | -: |
   *          ^
   * ```
   *
   * @type {State}
   */
  function headDelimiterCellAfter(code) {
    if (code === codes.verticalBar) {
      return headDelimiterBefore(code)
    }

    if (code === codes.eof || markdownLineEnding(code)) {
      // Exit when:
      // * there was no `:` or `|` at all (it’s a thematic break or setext
      //   underline instead)
      // * the header cell count is not the delimiter cell count
      if (!seen || size !== sizeB) {
        return headDelimiterNok(code)
      }

      // Note: in markdown-rs`, a reset is needed here.
      effects.exit('tableDelimiterRow')
      effects.exit('tableHead')
      // To do: in `markdown-rs`, resolvers need to be registered manually.
      // effects.register_resolver(ResolveName::GfmTable)
      return ok(code)
    }

    return headDelimiterNok(code)
  }

  /**
   * In delimiter row, at a disallowed byte.
   *
   * ```markdown
   *   | | a |
   * > | | x |
   *       ^
   * ```
   *
   * @type {State}
   */
  function headDelimiterNok(code) {
    // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.
    return nok(code)
  }

  /**
   * Before table body row.
   *
   * ```markdown
   *   | | a |
   *   | | - |
   * > | | b |
   *     ^
   * ```
   *
   * @type {State}
   */
  function bodyRowStart(code) {
    // Note: in `markdown-rs` we need to manually take care of a prefix,
    // but in `micromark-js` that is done for us, so if we’re here, we’re
    // never at whitespace.
    effects.enter('tableRow')
    return bodyRowBreak(code)
  }

  /**
   * At break in table body row.
   *
   * ```markdown
   *   | | a |
   *   | | - |
   * > | | b |
   *     ^
   *       ^
   *         ^
   * ```
   *
   * @type {State}
   */
  function bodyRowBreak(code) {
    if (code === codes.verticalBar) {
      effects.enter('tableCellDivider')
      effects.consume(code)
      effects.exit('tableCellDivider')
      return bodyRowBreak
    }

    if (code === codes.eof || markdownLineEnding(code)) {
      effects.exit('tableRow')
      return ok(code)
    }

    if (markdownSpace(code)) {
      return factorySpace(effects, bodyRowBreak, types.whitespace)(code)
    }

    // Anything else is cell content.
    effects.enter(types.data)
    return bodyRowData(code)
  }

  /**
   * In table body row data.
   *
   * ```markdown
   *   | | a |
   *   | | - |
   * > | | b |
   *       ^
   * ```
   *
   * @type {State}
   */
  function bodyRowData(code) {
    if (
      code === codes.eof ||
      code === codes.verticalBar ||
      markdownLineEndingOrSpace(code)
    ) {
      effects.exit(types.data)
      return bodyRowBreak(code)
    }

    effects.consume(code)
    return code === codes.backslash ? bodyRowEscape : bodyRowData
  }

  /**
   * In table body row escape.
   *
   * ```markdown
   *   | | a    |
   *   | | ---- |
   * > | | b\-c |
   *         ^
   * ```
   *
   * @type {State}
   */
  function bodyRowEscape(code) {
    if (code === codes.backslash || code === codes.verticalBar) {
      effects.consume(code)
      return bodyRowData
    }

    return bodyRowData(code)
  }
}

/** @type {Resolver} */

function resolveTable(events, context) {
  let index = -1
  let inFirstCellAwaitingPipe = true
  /** @type {RowKind} */
  let rowKind = 0
  /** @type {Range} */
  let lastCell = [0, 0, 0, 0]
  /** @type {Range} */
  let cell = [0, 0, 0, 0]
  let afterHeadAwaitingFirstBodyRow = false
  let lastTableEnd = 0
  /** @type {Token | undefined} */
  let currentTable
  /** @type {Token | undefined} */
  let currentBody
  /** @type {Token | undefined} */
  let currentCell

  const map = new EditMap()

  while (++index < events.length) {
    const event = events[index]
    const token = event[1]

    if (event[0] === 'enter') {
      // Start of head.
      if (token.type === 'tableHead') {
        afterHeadAwaitingFirstBodyRow = false

        // Inject previous (body end and) table end.
        if (lastTableEnd !== 0) {
          assert(currentTable, 'there should be a table opening')
          flushTableEnd(map, context, lastTableEnd, currentTable, currentBody)
          currentBody = undefined
          lastTableEnd = 0
        }

        // Inject table start.
        currentTable = {
          type: 'table',
          start: Object.assign({}, token.start),
          // Note: correct end is set later.
          end: Object.assign({}, token.end)
        }
        map.add(index, 0, [['enter', currentTable, context]])
      } else if (
        token.type === 'tableRow' ||
        token.type === 'tableDelimiterRow'
      ) {
        inFirstCellAwaitingPipe = true
        currentCell = undefined
        lastCell = [0, 0, 0, 0]
        cell = [0, index + 1, 0, 0]

        // Inject table body start.
        if (afterHeadAwaitingFirstBodyRow) {
          afterHeadAwaitingFirstBodyRow = false
          currentBody = {
            type: 'tableBody',
            start: Object.assign({}, token.start),
            // Note: correct end is set later.
            end: Object.assign({}, token.end)
          }
          map.add(index, 0, [['enter', currentBody, context]])
        }

        rowKind = token.type === 'tableDelimiterRow' ? 2 : currentBody ? 3 : 1
      }
      // Cell data.
      else if (
        rowKind &&
        (token.type === types.data ||
          token.type === 'tableDelimiterMarker' ||
          token.type === 'tableDelimiterFiller')
      ) {
        inFirstCellAwaitingPipe = false

        // First value in cell.
        if (cell[2] === 0) {
          if (lastCell[1] !== 0) {
            cell[0] = cell[1]
            currentCell = flushCell(
              map,
              context,
              lastCell,
              rowKind,
              undefined,
              currentCell
            )
            lastCell = [0, 0, 0, 0]
          }

          cell[2] = index
        }
      } else if (token.type === 'tableCellDivider') {
        if (inFirstCellAwaitingPipe) {
          inFirstCellAwaitingPipe = false
        } else {
          if (lastCell[1] !== 0) {
            cell[0] = cell[1]
            currentCell = flushCell(
              map,
              context,
              lastCell,
              rowKind,
              undefined,
              currentCell
            )
          }

          lastCell = cell
          cell = [lastCell[1], index, 0, 0]
        }
      }
    }
    // Exit events.
    else if (token.type === 'tableHead') {
      afterHeadAwaitingFirstBodyRow = true
      lastTableEnd = index
    } else if (
      token.type === 'tableRow' ||
      token.type === 'tableDelimiterRow'
    ) {
      lastTableEnd = index

      if (lastCell[1] !== 0) {
        cell[0] = cell[1]
        currentCell = flushCell(
          map,
          context,
          lastCell,
          rowKind,
          index,
          currentCell
        )
      } else if (cell[1] !== 0) {
        currentCell = flushCell(map, context, cell, rowKind, index, currentCell)
      }

      rowKind = 0
    } else if (
      rowKind &&
      (token.type === types.data ||
        token.type === 'tableDelimiterMarker' ||
        token.type === 'tableDelimiterFiller')
    ) {
      cell[3] = index
    }
  }

  if (lastTableEnd !== 0) {
    assert(currentTable, 'expected table opening')
    flushTableEnd(map, context, lastTableEnd, currentTable, currentBody)
  }

  map.consume(context.events)

  // To do: move this into `html`, when events are exposed there.
  // That’s what `markdown-rs` does.
  // That needs updates to `mdast-util-gfm-table`.
  index = -1
  while (++index < context.events.length) {
    const event = context.events[index]
    if (event[0] === 'enter' && event[1].type === 'table') {
      event[1]._align = gfmTableAlign(context.events, index)
    }
  }

  return events
}

/**
 * Generate a cell.
 *
 * @param {EditMap} map
 * @param {Readonly<TokenizeContext>} context
 * @param {Readonly<Range>} range
 * @param {RowKind} rowKind
 * @param {number | undefined} rowEnd
 * @param {Token | undefined} previousCell
 * @returns {Token | undefined}
 */
// eslint-disable-next-line max-params
function flushCell(map, context, range, rowKind, rowEnd, previousCell) {
  // `markdown-rs` uses:
  // rowKind === 2 ? 'tableDelimiterCell' : 'tableCell'
  const groupName =
    rowKind === 1
      ? 'tableHeader'
      : rowKind === 2
        ? 'tableDelimiter'
        : 'tableData'
  // `markdown-rs` uses:
  // rowKind === 2 ? 'tableDelimiterCellValue' : 'tableCellText'
  const valueName = 'tableContent'

  // Insert an exit for the previous cell, if there is one.
  //
  // ```markdown
  // > | | aa | bb | cc |
  //          ^-- exit
  //           ^^^^-- this cell
  // ```
  if (range[0] !== 0) {
    assert(previousCell, 'expected previous cell enter')
    previousCell.end = Object.assign({}, getPoint(context.events, range[0]))
    map.add(range[0], 0, [['exit', previousCell, context]])
  }

  // Insert enter of this cell.
  //
  // ```markdown
  // > | | aa | bb | cc |
  //           ^-- enter
  //           ^^^^-- this cell
  // ```
  const now = getPoint(context.events, range[1])
  previousCell = {
    type: groupName,
    start: Object.assign({}, now),
    // Note: correct end is set later.
    end: Object.assign({}, now)
  }
  map.add(range[1], 0, [['enter', previousCell, context]])

  // Insert text start at first data start and end at last data end, and
  // remove events between.
  //
  // ```markdown
  // > | | aa | bb | cc |
  //            ^-- enter
  //             ^-- exit
  //           ^^^^-- this cell
  // ```
  if (range[2] !== 0) {
    const relatedStart = getPoint(context.events, range[2])
    const relatedEnd = getPoint(context.events, range[3])
    /** @type {Token} */
    const valueToken = {
      type: valueName,
      start: Object.assign({}, relatedStart),
      end: Object.assign({}, relatedEnd)
    }
    map.add(range[2], 0, [['enter', valueToken, context]])
    assert(range[3] !== 0)

    if (rowKind !== 2) {
      // Fix positional info on remaining events
      const start = context.events[range[2]]
      const end = context.events[range[3]]
      start[1].end = Object.assign({}, end[1].end)
      start[1].type = types.chunkText
      start[1].contentType = constants.contentTypeText

      // Remove if needed.
      if (range[3] > range[2] + 1) {
        const a = range[2] + 1
        const b = range[3] - range[2] - 1
        map.add(a, b, [])
      }
    }

    map.add(range[3] + 1, 0, [['exit', valueToken, context]])
  }

  // Insert an exit for the last cell, if at the row end.
  //
  // ```markdown
  // > | | aa | bb | cc |
  //                    ^-- exit
  //               ^^^^^^-- this cell (the last one contains two “between” parts)
  // ```
  if (rowEnd !== undefined) {
    previousCell.end = Object.assign({}, getPoint(context.events, rowEnd))
    map.add(rowEnd, 0, [['exit', previousCell, context]])
    previousCell = undefined
  }

  return previousCell
}

/**
 * Generate table end (and table body end).
 *
 * @param {Readonly<EditMap>} map
 * @param {Readonly<TokenizeContext>} context
 * @param {number} index
 * @param {Token} table
 * @param {Token | undefined} tableBody
 */
// eslint-disable-next-line max-params
function flushTableEnd(map, context, index, table, tableBody) {
  /** @type {Array<Event>} */
  const exits = []
  const related = getPoint(context.events, index)

  if (tableBody) {
    tableBody.end = Object.assign({}, related)
    exits.push(['exit', tableBody, context])
  }

  table.end = Object.assign({}, related)
  exits.push(['exit', table, context])

  map.add(index + 1, 0, exits)
}

/**
 * @param {Readonly<Array<Event>>} events
 * @param {number} index
 * @returns {Readonly<Point>}
 */
function getPoint(events, index) {
  const event = events[index]
  const side = event[0] === 'enter' ? 'start' : 'end'
  return event[1][side]
}
LlRxY export { gfmTableHtml } from './lib/html.js';
export { gfmTable } from './lib/syntax.js';aʩx&100644 edit-map.d.ts o>]q<M100644 edit-map.d.ts.map "IR>{v9va6100644 edit-map.js ȼҚHĢ\=100644 html.d.ts Mfn(AFu100644 html.d.ts.map +)ccg]-100644 html.js \J{}}rFџd\100644 infer.d.ts Xa[|G܆K 100644 infer.d.ts.map ű,ލ:D8Vz0100644 infer.js u/0* Em100644 syntax.d.ts (널VY100644 syntax.d.ts.map bV]ϩ100644 syntax.js  [*J]x:&¥-x));;2	;
    });;X;	;;
);
  j
) this.map[index][2]);
B;
    }
4;
    events.length = 0;
    let slice = vecs.pop();PV	;
      };;;;;
  }u;5;
      // }

      return;
    }
    index += 1;
  }&;CiJ׼x/**
 * @import {HtmlExtension} from 'micromark-util-types'
 */

const alignment = {
  none: '',
  left: ' align="left"',
  right: ' align="right"',
  center: ' align="center"'
};

// To do: micromark@5: use `infer` here, when all events are exposed.

/**
 * Create an HTML extension for `micromark` to support GitHub tables when
 * serializing to HTML.
 *
 * @returns {HtmlExtension}
 *   Extension for `micromark` that can be passed in `htmlExtensions` to
 *   support GitHub tables when serializing to HTML.
 */
export function gfmTableHtml() {
  return {
    enter: {
      table(token) {
        const tableAlign = token._align;
        this.lineEndingIfNeeded();
        this.tag('<table>');
        this.setData('tableAlign', tableAlign);
      },
      tableBody() {
        this.tag('<tbody>');
      },
      tableData() {
        const tableAlign = this.getData('tableAlign');
        const tableColumn = this.getData('tableColumn');
        const align = alignment[tableAlign[tableColumn]];
        if (align === undefined) {
          // Capture results to ignore them.
          this.buffer();
        } else {
          this.lineEndingIfNeeded();
          this.tag('<td' + align + '>');
        }
      },
      tableHead() {
        this.lineEndingIfNeeded();
        this.tag('<thead>');
      },
      tableHeader() {
        const tableAlign = this.getData('tableAlign');
        const tableColumn = this.getData('tableColumn');
        const align = alignment[tableAlign[tableColumn]];
        this.lineEndingIfNeeded();
        this.tag('<th' + align + '>');
      },
      tableRow() {
        this.setData('tableColumn', 0);
        this.lineEndingIfNeeded();
        this.tag('<tr>');
      }
    },
    exit: {
      // Overwrite the default code text data handler to unescape escaped pipes when
      // they are in tables.
      codeTextData(token) {
        let value = this.sliceSerialize(token);
        if (this.getData('tableAlign')) {
          value = value.replace(/\\([\\|])/g, replace);
        }
        this.raw(this.encode(value));
      },
      table() {
        this.setData('tableAlign');
        // Note: we don’t set `slurpAllLineEndings` anymore, in delimiter rows,
        // but we do need to reset it to match a funky newline GH generates for
        // list items combined with tables.
        this.setData('slurpAllLineEndings');
        this.lineEndingIfNeeded();
        this.tag('</table>');
      },
      tableBody() {
        this.lineEndingIfNeeded();
        this.tag('</tbody>');
      },
      tableData() {
        const tableAlign = this.getData('tableAlign');
        const tableColumn = this.getData('tableColumn');
        if (tableColumn in tableAlign) {
          this.tag('</td>');
          this.setData('tableColumn', tableColumn + 1);
        } else {
          // Stop capturing.
          this.resume();
        }
      },
      tableHead() {
        this.lineEndingIfNeeded();
        this.tag('</thead>');
      },
      tableHeader() {
        const tableColumn = this.getData('tableColumn');
        this.tag('</th>');
        this.setData('tableColumn', tableColumn + 1);
      },
      tableRow() {
        const tableAlign = this.getData('tableAlign');
        let tableColumn = this.getData('tableColumn');
        while (tableColumn < tableAlign.length) {
          this.lineEndingIfNeeded();
          this.tag('<td' + alignment[tableAlign[tableColumn]] + '></td>');
          tableColumn++;
        }
        this.setData('tableColumn', tableColumn);
        this.lineEndingIfNeeded();
        this.tag('</tr>');
      }
    }
  };
}

/**
 * @param {string} $0
 * @param {string} $1
 * @returns {string}
 */
function replace($0, $1) {
  // Pipes work, backslashes don’t (but can’t escape pipes).
  return $1 === '|' ? $1 : $0;
}ih_
Gx Yzlet inDelimiterRow = false;1;1B;tz4 ? 'left' : 'none');9;
         @@2;K;t-;
    }
    index += 1;
  }
  return align;
}0
xP/**
 * @import {Event, Extension, Point, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'
 */

/**
 * @typedef {[number, number, number, number]} Range
 *   Cell info.
 *
 * @typedef {0 | 1 | 2 | 3} RowKind
 *   Where we are: `1` for head row, `2` for delimiter row, `3` for body row.
 */

import { factorySpace } from 'micromark-factory-space';
import { markdownLineEnding, markdownLineEndingOrSpace, markdownSpace } from 'micromark-util-character';
import { EditMap } from './edit-map.js';
import { gfmTableAlign } from './infer.js';

/**
 * Create an HTML extension for `micromark` to support GitHub tables syntax.
 *
 * @returns {Extension}
 *   Extension for `micromark` that can be passed in `extensions` to enable GFM
 *   table syntax.
 */
export function gfmTable() {
  return {
    flow: {
      null: {
        name: 'table',
        tokenize: tokenizeTable,
        resolveAll: resolveTable
      }
    }
  };
}

/**
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeTable(effects, ok, nok) {
  const self = this;
  let size = 0;
  let sizeB = 0;
  /** @type {boolean | undefined} */
  let seen;
  return start;

  /**
   * Start of a GFM table.
   *
   * If there is a valid table row or table head before, then we try to parse
   * another row.
   * Otherwise, we try to parse a head.
   *
   * ```markdown
   * > | | a |
   *     ^
   *   | | - |
   * > | | b |
   *     ^
   * ```
   * @type {State}
   */
  function start(code) {
    let index = self.events.length - 1;
    while (index > -1) {
      const type = self.events[index][1].type;
      if (type === "lineEnding" ||
      // Note: markdown-rs uses `whitespace` instead of `linePrefix`
      type === "linePrefix") index--;else break;
    }
    const tail = index > -1 ? self.events[index][1].type : null;
    const next = tail === 'tableHead' || tail === 'tableRow' ? bodyRowStart : headRowBefore;

    // Don’t allow lazy body rows.
    if (next === bodyRowStart && self.parser.lazy[self.now().line]) {
      return nok(code);
    }
    return next(code);
  }

  /**
   * Before table head row.
   *
   * ```markdown
   * > | | a |
   *     ^
   *   | | - |
   *   | | b |
   * ```
   *
   * @type {State}
   */
  function headRowBefore(code) {
    effects.enter('tableHead');
    effects.enter('tableRow');
    return headRowStart(code);
  }

  /**
   * Before table head row, after whitespace.
   *
   * ```markdown
   * > | | a |
   *     ^
   *   | | - |
   *   | | b |
   * ```
   *
   * @type {State}
   */
  function headRowStart(code) {
    if (code === 124) {
      return headRowBreak(code);
    }

    // To do: micromark-js should let us parse our own whitespace in extensions,
    // like `markdown-rs`:
    //
    // ```js
    // // 4+ spaces.
    // if (markdownSpace(code)) {
    //   return nok(code)
    // }
    // ```

    seen = true;
    // Count the first character, that isn’t a pipe, double.
    sizeB += 1;
    return headRowBreak(code);
  }

  /**
   * At break in table head row.
   *
   * ```markdown
   * > | | a |
   *     ^
   *       ^
   *         ^
   *   | | - |
   *   | | b |
   * ```
   *
   * @type {State}
   */
  function headRowBreak(code) {
    if (code === null) {
      // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.
      return nok(code);
    }
    if (markdownLineEnding(code)) {
      // If anything other than one pipe (ignoring whitespace) was used, it’s fine.
      if (sizeB > 1) {
        sizeB = 0;
        // To do: check if this works.
        // Feel free to interrupt:
        self.interrupt = true;
        effects.exit('tableRow');
        effects.enter("lineEnding");
        effects.consume(code);
        effects.exit("lineEnding");
        return headDelimiterStart;
      }

      // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.
      return nok(code);
    }
    if (markdownSpace(code)) {
      // To do: check if this is fine.
      // effects.attempt(State::Next(StateName::GfmTableHeadRowBreak), State::Nok)
      // State::Retry(space_or_tab(tokenizer))
      return factorySpace(effects, headRowBreak, "whitespace")(code);
    }
    sizeB += 1;
    if (seen) {
      seen = false;
      // Header cell count.
      size += 1;
    }
    if (code === 124) {
      effects.enter('tableCellDivider');
      effects.consume(code);
      effects.exit('tableCellDivider');
      // Whether a delimiter was seen.
      seen = true;
      return headRowBreak;
    }

    // Anything else is cell data.
    effects.enter("data");
    return headRowData(code);
  }

  /**
   * In table head row data.
   *
   * ```markdown
   * > | | a |
   *       ^
   *   | | - |
   *   | | b |
   * ```
   *
   * @type {State}
   */
  function headRowData(code) {
    if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {
      effects.exit("data");
      return headRowBreak(code);
    }
    effects.consume(code);
    return code === 92 ? headRowEscape : headRowData;
  }

  /**
   * In table head row escape.
   *
   * ```markdown
   * > | | a\-b |
   *         ^
   *   | | ---- |
   *   | | c    |
   * ```
   *
   * @type {State}
   */
  function headRowEscape(code) {
    if (code === 92 || code === 124) {
      effects.consume(code);
      return headRowData;
    }
    return headRowData(code);
  }

  /**
   * Before delimiter row.
   *
   * ```markdown
   *   | | a |
   * > | | - |
   *     ^
   *   | | b |
   * ```
   *
   * @type {State}
   */
  function headDelimiterStart(code) {
    // Reset `interrupt`.
    self.interrupt = false;

    // Note: in `markdown-rs`, we need to handle piercing here too.
    if (self.parser.lazy[self.now().line]) {
      return nok(code);
    }
    effects.enter('tableDelimiterRow');
    // Track if we’ve seen a `:` or `|`.
    seen = false;
    if (markdownSpace(code)) {
      return factorySpace(effects, headDelimiterBefore, "linePrefix", self.parser.constructs.disable.null.includes('codeIndented') ? undefined : 4)(code);
    }
    return headDelimiterBefore(code);
  }

  /**
   * Before delimiter row, after optional whitespace.
   *
   * Reused when a `|` is found later, to parse another cell.
   *
   * ```markdown
   *   | | a |
   * > | | - |
   *     ^
   *   | | b |
   * ```
   *
   * @type {State}
   */
  function headDelimiterBefore(code) {
    if (code === 45 || code === 58) {
      return headDelimiterValueBefore(code);
    }
    if (code === 124) {
      seen = true;
      // If we start with a pipe, we open a cell marker.
      effects.enter('tableCellDivider');
      effects.consume(code);
      effects.exit('tableCellDivider');
      return headDelimiterCellBefore;
    }

    // More whitespace / empty row not allowed at start.
    return headDelimiterNok(code);
  }

  /**
   * After `|`, before delimiter cell.
   *
   * ```markdown
   *   | | a |
   * > | | - |
   *      ^
   * ```
   *
   * @type {State}
   */
  function headDelimiterCellBefore(code) {
    if (markdownSpace(code)) {
      return factorySpace(effects, headDelimiterValueBefore, "whitespace")(code);
    }
    return headDelimiterValueBefore(code);
  }

  /**
   * Before delimiter cell value.
   *
   * ```markdown
   *   | | a |
   * > | | - |
   *       ^
   * ```
   *
   * @type {State}
   */
  function headDelimiterValueBefore(code) {
    // Align: left.
    if (code === 58) {
      sizeB += 1;
      seen = true;
      effects.enter('tableDelimiterMarker');
      effects.consume(code);
      effects.exit('tableDelimiterMarker');
      return headDelimiterLeftAlignmentAfter;
    }

    // Align: none.
    if (code === 45) {
      sizeB += 1;
      // To do: seems weird that this *isn’t* left aligned, but that state is used?
      return headDelimiterLeftAlignmentAfter(code);
    }
    if (code === null || markdownLineEnding(code)) {
      return headDelimiterCellAfter(code);
    }
    return headDelimiterNok(code);
  }

  /**
   * After delimiter cell left alignment marker.
   *
   * ```markdown
   *   | | a  |
   * > | | :- |
   *        ^
   * ```
   *
   * @type {State}
   */
  function headDelimiterLeftAlignmentAfter(code) {
    if (code === 45) {
      effects.enter('tableDelimiterFiller');
      return headDelimiterFiller(code);
    }

    // Anything else is not ok after the left-align colon.
    return headDelimiterNok(code);
  }

  /**
   * In delimiter cell filler.
   *
   * ```markdown
   *   | | a |
   * > | | - |
   *       ^
   * ```
   *
   * @type {State}
   */
  function headDelimiterFiller(code) {
    if (code === 45) {
      effects.consume(code);
      return headDelimiterFiller;
    }

    // Align is `center` if it was `left`, `right` otherwise.
    if (code === 58) {
      seen = true;
      effects.exit('tableDelimiterFiller');
      effects.enter('tableDelimiterMarker');
      effects.consume(code);
      effects.exit('tableDelimiterMarker');
      return headDelimiterRightAlignmentAfter;
    }
    effects.exit('tableDelimiterFiller');
    return headDelimiterRightAlignmentAfter(code);
  }

  /**
   * After delimiter cell right alignment marker.
   *
   * ```markdown
   *   | |  a |
   * > | | -: |
   *         ^
   * ```
   *
   * @type {State}
   */
  function headDelimiterRightAlignmentAfter(code) {
    if (markdownSpace(code)) {
      return factorySpace(effects, headDelimiterCellAfter, "whitespace")(code);
    }
    return headDelimiterCellAfter(code);
  }

  /**
   * After delimiter cell.
   *
   * ```markdown
   *   | |  a |
   * > | | -: |
   *          ^
   * ```
   *
   * @type {State}
   */
  function headDelimiterCellAfter(code) {
    if (code === 124) {
      return headDelimiterBefore(code);
    }
    if (code === null || markdownLineEnding(code)) {
      // Exit when:
      // * there was no `:` or `|` at all (it’s a thematic break or setext
      //   underline instead)
      // * the header cell count is not the delimiter cell count
      if (!seen || size !== sizeB) {
        return headDelimiterNok(code);
      }

      // Note: in markdown-rs`, a reset is needed here.
      effects.exit('tableDelimiterRow');
      effects.exit('tableHead');
      // To do: in `markdown-rs`, resolvers need to be registered manually.
      // effects.register_resolver(ResolveName::GfmTable)
      return ok(code);
    }
    return headDelimiterNok(code);
  }

  /**
   * In delimiter row, at a disallowed byte.
   *
   * ```markdown
   *   | | a |
   * > | | x |
   *       ^
   * ```
   *
   * @type {State}
   */
  function headDelimiterNok(code) {
    // Note: in `markdown-rs`, we need to reset, in `micromark-js` we don‘t.
    return nok(code);
  }

  /**
   * Before table body row.
   *
   * ```markdown
   *   | | a |
   *   | | - |
   * > | | b |
   *     ^
   * ```
   *
   * @type {State}
   */
  function bodyRowStart(code) {
    // Note: in `markdown-rs` we need to manually take care of a prefix,
    // but in `micromark-js` that is done for us, so if we’re here, we’re
    // never at whitespace.
    effects.enter('tableRow');
    return bodyRowBreak(code);
  }

  /**
   * At break in table body row.
   *
   * ```markdown
   *   | | a |
   *   | | - |
   * > | | b |
   *     ^
   *       ^
   *         ^
   * ```
   *
   * @type {State}
   */
  function bodyRowBreak(code) {
    if (code === 124) {
      effects.enter('tableCellDivider');
      effects.consume(code);
      effects.exit('tableCellDivider');
      return bodyRowBreak;
    }
    if (code === null || markdownLineEnding(code)) {
      effects.exit('tableRow');
      return ok(code);
    }
    if (markdownSpace(code)) {
      return factorySpace(effects, bodyRowBreak, "whitespace")(code);
    }

    // Anything else is cell content.
    effects.enter("data");
    return bodyRowData(code);
  }

  /**
   * In table body row data.
   *
   * ```markdown
   *   | | a |
   *   | | - |
   * > | | b |
   *       ^
   * ```
   *
   * @type {State}
   */
  function bodyRowData(code) {
    if (code === null || code === 124 || markdownLineEndingOrSpace(code)) {
      effects.exit("data");
      return bodyRowBreak(code);
    }
    effects.consume(code);
    return code === 92 ? bodyRowEscape : bodyRowData;
  }

  /**
   * In table body row escape.
   *
   * ```markdown
   *   | | a    |
   *   | | ---- |
   * > | | b\-c |
   *         ^
   * ```
   *
   * @type {State}
   */
  function bodyRowEscape(code) {
    if (code === 92 || code === 124) {
      effects.consume(code);
      return bodyRowData;
    }
    return bodyRowData(code);
  }
}

/** @type {Resolver} */

function resolveTable(events, context) {
  let index = -1;
  let inFirstCellAwaitingPipe = true;
  /** @type {RowKind} */
  let rowKind = 0;
  /** @type {Range} */
  let lastCell = [0, 0, 0, 0];
  /** @type {Range} */
  let cell = [0, 0, 0, 0];
  let afterHeadAwaitingFirstBodyRow = false;
  let lastTableEnd = 0;
  /** @type {Token | undefined} */
  let currentTable;
  /** @type {Token | undefined} */
  let currentBody;
  /** @type {Token | undefined} */
  let currentCell;
  const map = new EditMap();
  while (++index < events.length) {
    const event = events[index];
    const token = event[1];
    if (event[0] === 'enter') {
      // Start of head.
      if (token.type === 'tableHead') {
        afterHeadAwaitingFirstBodyRow = false;

        // Inject previous (body end and) table end.
        if (lastTableEnd !== 0) {
          flushTableEnd(map, context, lastTableEnd, currentTable, currentBody);
          currentBody = undefined;
          lastTableEnd = 0;
        }

        // Inject table start.
        currentTable = {
          type: 'table',
          start: Object.assign({}, token.start),
          // Note: correct end is set later.
          end: Object.assign({}, token.end)
        };
        map.add(index, 0, [['enter', currentTable, context]]);
      } else if (token.type === 'tableRow' || token.type === 'tableDelimiterRow') {
        inFirstCellAwaitingPipe = true;
        currentCell = undefined;
        lastCell = [0, 0, 0, 0];
        cell = [0, index + 1, 0, 0];

        // Inject table body start.
        if (afterHeadAwaitingFirstBodyRow) {
          afterHeadAwaitingFirstBodyRow = false;
          currentBody = {
            type: 'tableBody',
            start: Object.assign({}, token.start),
            // Note: correct end is set later.
            end: Object.assign({}, token.end)
          };
          map.add(index, 0, [['enter', currentBody, context]]);
        }
        rowKind = token.type === 'tableDelimiterRow' ? 2 : currentBody ? 3 : 1;
      }
      // Cell data.
      else if (rowKind && (token.type === "data" || token.type === 'tableDelimiterMarker' || token.type === 'tableDelimiterFiller')) {
        inFirstCellAwaitingPipe = false;

        // First value in cell.
        if (cell[2] === 0) {
          if (lastCell[1] !== 0) {
            cell[0] = cell[1];
            currentCell = flushCell(map, context, lastCell, rowKind, undefined, currentCell);
            lastCell = [0, 0, 0, 0];
          }
          cell[2] = index;
        }
      } else if (token.type === 'tableCellDivider') {
        if (inFirstCellAwaitingPipe) {
          inFirstCellAwaitingPipe = false;
        } else {
          if (lastCell[1] !== 0) {
            cell[0] = cell[1];
            currentCell = flushCell(map, context, lastCell, rowKind, undefined, currentCell);
          }
          lastCell = cell;
          cell = [lastCell[1], index, 0, 0];
        }
      }
    }
    // Exit events.
    else if (token.type === 'tableHead') {
      afterHeadAwaitingFirstBodyRow = true;
      lastTableEnd = index;
    } else if (token.type === 'tableRow' || token.type === 'tableDelimiterRow') {
      lastTableEnd = index;
      if (lastCell[1] !== 0) {
        cell[0] = cell[1];
        currentCell = flushCell(map, context, lastCell, rowKind, index, currentCell);
      } else if (cell[1] !== 0) {
        currentCell = flushCell(map, context, cell, rowKind, index, currentCell);
      }
      rowKind = 0;
    } else if (rowKind && (token.type === "data" || token.type === 'tableDelimiterMarker' || token.type === 'tableDelimiterFiller')) {
      cell[3] = index;
    }
  }
  if (lastTableEnd !== 0) {
    flushTableEnd(map, context, lastTableEnd, currentTable, currentBody);
  }
  map.consume(context.events);

  // To do: move this into `html`, when events are exposed there.
  // That’s what `markdown-rs` does.
  // That needs updates to `mdast-util-gfm-table`.
  index = -1;
  while (++index < context.events.length) {
    const event = context.events[index];
    if (event[0] === 'enter' && event[1].type === 'table') {
      event[1]._align = gfmTableAlign(context.events, index);
    }
  }
  return events;
}

/**
 * Generate a cell.
 *
 * @param {EditMap} map
 * @param {Readonly<TokenizeContext>} context
 * @param {Readonly<Range>} range
 * @param {RowKind} rowKind
 * @param {number | undefined} rowEnd
 * @param {Token | undefined} previousCell
 * @returns {Token | undefined}
 */
// eslint-disable-next-line max-params
function flushCell(map, context, range, rowKind, rowEnd, previousCell) {
  // `markdown-rs` uses:
  // rowKind === 2 ? 'tableDelimiterCell' : 'tableCell'
  const groupName = rowKind === 1 ? 'tableHeader' : rowKind === 2 ? 'tableDelimiter' : 'tableData';
  // `markdown-rs` uses:
  // rowKind === 2 ? 'tableDelimiterCellValue' : 'tableCellText'
  const valueName = 'tableContent';

  // Insert an exit for the previous cell, if there is one.
  //
  // ```markdown
  // > | | aa | bb | cc |
  //          ^-- exit
  //           ^^^^-- this cell
  // ```
  if (range[0] !== 0) {
    previousCell.end = Object.assign({}, getPoint(context.events, range[0]));
    map.add(range[0], 0, [['exit', previousCell, context]]);
  }

  // Insert enter of this cell.
  //
  // ```markdown
  // > | | aa | bb | cc |
  //           ^-- enter
  //           ^^^^-- this cell
  // ```
  const now = getPoint(context.events, range[1]);
  previousCell = {
    type: groupName,
    start: Object.assign({}, now),
    // Note: correct end is set later.
    end: Object.assign({}, now)
  };
  map.add(range[1], 0, [['enter', previousCell, context]]);

  // Insert text start at first data start and end at last data end, and
  // remove events between.
  //
  // ```markdown
  // > | | aa | bb | cc |
  //            ^-- enter
  //             ^-- exit
  //           ^^^^-- this cell
  // ```
  if (range[2] !== 0) {
    const relatedStart = getPoint(context.events, range[2]);
    const relatedEnd = getPoint(context.events, range[3]);
    /** @type {Token} */
    const valueToken = {
      type: valueName,
      start: Object.assign({}, relatedStart),
      end: Object.assign({}, relatedEnd)
    };
    map.add(range[2], 0, [['enter', valueToken, context]]);
    if (rowKind !== 2) {
      // Fix positional info on remaining events
      const start = context.events[range[2]];
      const end = context.events[range[3]];
      start[1].end = Object.assign({}, end[1].end);
      start[1].type = "chunkText";
      start[1].contentType = "text";

      // Remove if needed.
      if (range[3] > range[2] + 1) {
        const a = range[2] + 1;
        const b = range[3] - range[2] - 1;
        map.add(a, b, []);
      }
    }
    map.add(range[3] + 1, 0, [['exit', valueToken, context]]);
  }

  // Insert an exit for the last cell, if at the row end.
  //
  // ```markdown
  // > | | aa | bb | cc |
  //                    ^-- exit
  //               ^^^^^^-- this cell (the last one contains two “between” parts)
  // ```
  if (rowEnd !== undefined) {
    previousCell.end = Object.assign({}, getPoint(context.events, rowEnd));
    map.add(rowEnd, 0, [['exit', previousCell, context]]);
    previousCell = undefined;
  }
  return previousCell;
}

/**
 * Generate table end (and table body end).
 *
 * @param {Readonly<EditMap>} map
 * @param {Readonly<TokenizeContext>} context
 * @param {number} index
 * @param {Token} table
 * @param {Token | undefined} tableBody
 */
// eslint-disable-next-line max-params
function flushTableEnd(map, context, index, table, tableBody) {
  /** @type {Array<Event>} */
  const exits = [];
  const related = getPoint(context.events, index);
  if (tableBody) {
    tableBody.end = Object.assign({}, related);
    exits.push(['exit', tableBody, context]);
  }
  table.end = Object.assign({}, related);
  exits.push(['exit', table, context]);
  map.add(index + 1, 0, exits);
}

/**
 * @param {Readonly<Array<Event>>} events
 * @param {number} index
 * @returns {Readonly<Point>}
 */
function getPoint(events, index) {
  const event = events[index];
  const side = event[0] === 'enter' ? 'start' : 'end';
  return event[1][side];
}-y1֛)x {$Mt=table/issuesk_8XBK0tables"/295m	60.0"
  }<Z,
    "lib/"
  ]g/keywords": [
    "cell",
    "column",
    "gfm0micromark",
    "row",
    "table",
    "tabularlicense": "MIT",$table"60table",
  "scripts": {nS--frail --quiet --output -- . && prettier --log-level warn --write -- . && xo --fixrS?Cc--'c~	&	version": "2.1.1",
  "xo": {
z"off"?,	-$complexity": "off",
      "max-deptha
O
2
 
  }
}
qx4># micromark-extension-gfm-table

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

[micromark][] extensions to support GFM [tables][].

## Contents

* [What is this?](#what-is-this)
* [When to use this](#when-to-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`gfmTable()`](#gfmtable)
  * [`gfmTableHtml()`](#gfmtablehtml)
* [Bugs](#bugs)
* [Authoring](#authoring)
* [HTML](#html)
* [CSS](#css)
* [Syntax](#syntax)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package contains extensions that add support for the table syntax enabled
by GFM to [`micromark`][micromark].
These extensions match github.com.

## When to use this

This project is useful when you want to support tables in markdown.

You can use these extensions when you are working with [`micromark`][micromark].
To support all GFM features, use
[`micromark-extension-gfm`][micromark-extension-gfm] instead.

When you need a syntax tree, combine this package with
[`mdast-util-gfm-table`][mdast-util-gfm-table].

All these packages are used in [`remark-gfm`][remark-gfm], which focusses on
making it easier to transform content by abstracting these internals away.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install micromark-extension-gfm-table
```

In Deno with [`esm.sh`][esmsh]:

```js
import {gfmTable, gfmTableHtml} from 'https://esm.sh/micromark-extension-gfm-table@2'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {gfmTable, gfmTableHtml} from 'https://esm.sh/micromark-extension-gfm-table@2?bundle'
</script>
```

## Use

```js
import {micromark} from 'micromark'
import {gfmTable, gfmTableHtml} from 'micromark-extension-gfm-table'

const output = micromark('| a |\n| - |', {
  extensions: [gfmTable()],
  htmlExtensions: [gfmTableHtml()]
})

console.log(output)
```

Yields:

```html
<table>
<thead>
<tr>
<th>a</th>
</tr>
</thead>
</table>
```

## API

This package exports the identifiers [`gfmTable`][api-gfm-table] and
[`gfmTableHtml`][api-gfm-table-html].
There is no default export.

The export map supports the [`development` condition][development].
Run `node --conditions development module.js` to get instrumented dev code.
Without this condition, production code is loaded.

### `gfmTable()`

Create an HTML extension for `micromark` to support GitHub tables syntax.

###### Returns

Extension for `micromark` that can be passed in `extensions` to enable GFM
table syntax ([`Extension`][micromark-extension]).

### `gfmTableHtml()`

Create an HTML extension for `micromark` to support GitHub tables when
serializing to HTML.

###### Returns

Extension for `micromark` that can be passed in `htmlExtensions` to support
GFM tables when serializing to HTML
([`HtmlExtension`][micromark-html-extension]).

## Bugs

GitHub’s own algorithm to parse tables contains a bug.
This bug is not present in this project.
The issue relating to tables is:

* [GFM tables: escaped escapes are incorrectly treated as
  escapes](https://github.com/github/cmark-gfm/issues/277)

## Authoring

When authoring markdown with GFM tables, it’s recommended to *always* put
pipes around cells.
Without them, it can be hard to infer whether the table will work, how many
columns there are, and which column you are currently editing.

It is recommended to not use many columns, as it results in very long lines,
making it hard to infer which column you are currently editing.

For larger tables, particularly when cells vary in size, it is recommended
*not* to manually “pad” cell text.
While it can look better, it results in a lot of time spent realigning
everything when a new, longer cell is added or the longest cell removed, as
every row then must be changed.
Other than costing time, it also causes large diffs in Git.

To illustrate, when authoring large tables, it is discouraged to pad cells
like this:

```markdown
| Alpha bravo charlie |              delta |
| ------------------- | -----------------: |
| Echo                | Foxtrot golf hotel |
```

Instead, use single spaces (and single filler dashes):

```markdown
| Alpha bravo charlie | delta |
| - | -: |
| Echo | Foxtrot golf hotel |
```

## HTML

GFM tables relate to several HTML elements: `<table>`, `<tbody>`, `<td>`,
`<th>`, `<thead>`, and `<tr>`.
See
[*§ 4.9.1 The `table` element*][html-table],
[*§ 4.9.5 The `tbody` element*][html-tbody],
[*§ 4.9.9 The `td` element*][html-td],
[*§ 4.9.10 The `th` element*][html-th],
[*§ 4.9.6 The `thead` element*][html-thead], and
[*§ 4.9.8 The `tr` element*][html-tr]
in the HTML spec for more info.

If the alignment of a column is left, right, or center, a deprecated
`align` attribute is added to each `<th>` and `<td>` element belonging to
that column.
That attribute is interpreted by browsers as if a CSS `text-align` property
was included, with its value set to that same keyword.

## CSS

The following CSS is needed to make tables look a bit like GitHub.
For the complete actual CSS see
[`sindresorhus/github-markdown-css`][github-markdown-css]

```css
/* Light theme. */
:root {
  --color-canvas-default: #ffffff;
  --color-canvas-subtle: #f6f8fa;
  --color-border-default: #d0d7de;
  --color-border-muted: hsla(210, 18%, 87%, 1);
}

/* Dark theme. */
@media (prefers-color-scheme: dark) {
  :root {
    --color-canvas-default: #0d1117;
    --color-canvas-subtle: #161b22;
    --color-border-default: #30363d;
    --color-border-muted: #21262d;
  }
}

table {
  border-spacing: 0;
  border-collapse: collapse;
  display: block;
  margin-top: 0;
  margin-bottom: 16px;
  width: max-content;
  max-width: 100%;
  overflow: auto;
}

tr {
  background-color: var(--color-canvas-default);
  border-top: 1px solid var(--color-border-muted);
}

tr:nth-child(2n) {
  background-color: var(--color-canvas-subtle);
}

td,
th {
  padding: 6px 13px;
  border: 1px solid var(--color-border-default);
}

th {
  font-weight: 600;
}

table img {
  background-color: transparent;
}
```

## Syntax

Tables form with the following BNF:

```abnf
gfmTable ::= gfmTableHead 0*(eol gfmTableBodyRow)

; Restriction: both rows must have the same number of cells.
gfmTableHead ::= gfmTableRow eol gfmTableDelimiterRow

gfmTableRow ::= ["|"] gfmTableCell 0*("|" gfmTableCell) ["|"] *spaceOrTab
gfmTableCell ::= *spaceOrTab gfmTableText *spaceOrTab
gfmTableText ::= 0*(line - "\\" - "|" / "\\" ["\\" / "|"])

gfmTableDelimiterRow ::= ["|"] gfmTableDelimiterCell 0*("|" gfmTableDelimiterCell) ["|"] *spaceOrTab
gfmTableDelimiterCell ::= *spaceOrTab gfmTableDelimiterValue *spaceOrTab
gfmTableDelimiterValue ::= [":"] 1*"-" [":"]
```

As this construct occurs in flow, like all flow constructs, it must be
followed by an eol (line ending) or eof (end of file).

The above grammar shows that basically anything can be a cell or a row.
The main thing that makes something a row, is that it occurs directly before
or after a delimiter row, or after another row.

It is not required for a table to have a body: it can end right after the
delimiter row.

Each column can be marked with an alignment.
The alignment marker is a colon (`:`) used before and/or after delimiter row
filler.
To illustrate:

```markdown
| none | left | right | center |
| ---- | :--- | ----: | :----: |
```

The number of cells in the delimiter row, is the number of columns of the
table.
Only the head row is required to have the same number of cells.
Body rows are not required to have a certain number of cells.
For body rows that have less cells than the number of columns of the table,
empty cells are injected.
When a row has more cells than the number of columns of the table, the
superfluous cells are dropped.
To illustrate:

```markdown
| a | b |
| - | - |
| c |
| d | e | f |
```

Yields:

```html
<table>
<thead>
<tr>
<th>a</th>
<th>b</th>
</tr>
</thead>
<tbody>
<tr>
<td>c</td>
<td></td>
</tr>
<tr>
<td>d</td>
<td>e</td>
</tr>
</tbody>
</table>
```

Each cell’s text is interpreted as the [text][micromark-content-type] content
type.
That means that it can include constructs such as attention (emphasis, strong).

The grammar for cells prohibits the use of `|` in them.
To use pipes in cells, encode them as a character reference or character
escape: `&vert;` (or `&VerticalLine;`, `&verbar;`, `&#124;`, `&#x7c;`) or
`\|`.

Escapes will typically work, but they are not supported in
code (text) (and the math (text) extension).
To work around this, GitHub came up with a rather weird “trick”.
When inside a table cell *and* inside code, escaped pipes *are* decoded.
To illustrate:

```markdown
| Name | Character |
| - | - |
| Left curly brace | `{` |
| Pipe | `\|` |
| Right curly brace | `}` |
```

Yields:

```html
<table>
<thead>
<tr>
<th>Name</th>
<th>Character</th>
</tr>
</thead>
<tbody>
<tr>
<td>Left curly brace</td>
<td><code>{</code></td>
</tr>
<tr>
<td>Pipe</td>
<td><code>|</code></td>
</tr>
<tr>
<td>Right curly brace</td>
<td><code>}</code></td>
</tr>
</tbody>
</table>
```

> 👉 **Note**: no other character can be escaped like this.
> Escaping pipes in code does not work when not inside a table, either.

## Types

This package is fully typed with [TypeScript][].
It exports no additional types.

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-extension-gfm-table@^2`, compatible with Node.js 16.

This package works with `micromark` version `3` and later.

## Security

This package is safe.

## Related

* [`micromark-extension-gfm`][micromark-extension-gfm]
  — support all of GFM
* [`mdast-util-gfm-table`][mdast-util-gfm-table]
  — support all of GFM in mdast
* [`mdast-util-gfm`][mdast-util-gfm]
  — support all of GFM in mdast
* [`remark-gfm`][remark-gfm]
  — support all of GFM in remark

## Contribute

See [`contributing.md` in `micromark/.github`][contributing] for ways to get
started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organization, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/micromark/micromark-extension-gfm-table/workflows/main/badge.svg

[build]: https://github.com/micromark/micromark-extension-gfm-table/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark-extension-gfm-table.svg

[coverage]: https://codecov.io/github/micromark/micromark-extension-gfm-table

[downloads-badge]: https://img.shields.io/npm/dm/micromark-extension-gfm-table.svg

[downloads]: https://www.npmjs.com/package/micromark-extension-gfm-table

[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-extension-gfm-table

[size]: https://bundlejs.com/?q=micromark-extension-gfm-table

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[collective]: https://opencollective.com/unified

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/micromark/micromark/discussions

[npm]: https://docs.npmjs.com/cli/install

[esmsh]: https://esm.sh

[license]: license

[author]: https://wooorm.com

[contributing]: https://github.com/micromark/.github/blob/main/contributing.md

[support]: https://github.com/micromark/.github/blob/main/support.md

[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[typescript]: https://www.typescriptlang.org

[development]: https://nodejs.org/api/packages.html#packages_resolving_user_conditions

[micromark]: https://github.com/micromark/micromark

[micromark-extension]: https://github.com/micromark/micromark#syntaxextension

[micromark-html-extension]: https://github.com/micromark/micromark#htmlextension

[micromark-content-type]: https://github.com/micromark/micromark#content-types

[micromark-extension-gfm]: https://github.com/micromark/micromark-extension-gfm

[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm

[mdast-util-gfm-table]: https://github.com/syntax-tree/mdast-util-gfm-table

[remark-gfm]: https://github.com/remarkjs/remark-gfm

[tables]: https://github.github.com/gfm/#tables-extension-

[html-table]: https://html.spec.whatwg.org/multipage/tables.html#the-table-element

[html-tbody]: https://html.spec.whatwg.org/multipage/tables.html#the-tbody-element

[html-thead]: https://html.spec.whatwg.org/multipage/tables.html#the-thead-element

[html-tr]: https://html.spec.whatwg.org/multipage/tables.html#the-tr-element

[html-td]: https://html.spec.whatwg.org/multipage/tables.html#the-td-element

[html-th]: https://html.spec.whatwg.org/multipage/tables.html#the-th-element

[github-markdown-css]: https://github.com/sindresorhus/github-markdown-css

[api-gfm-table]: #gfmtable

[api-gfm-table-html]: #gfmtablehtml
Yx '100644 index.d.ts w0ώ7EJ100644 index.js w0ώ7EJ40000 lib ؛YVk8|>VO100644 license 97#V}n-ƟO^100644 package.json X?d@GE(=Rv100644 readme.md {.s;#%d	FýTx0 export {gfmTagfilterHtml} from './lib/index.js'
^^xJ 100644 index.d.ts h9)a}j|8;@>100644 index.js Nlxںm[D*kYO#x2/**
 * Create an HTML extension for `micromark` to support GitHubs weird and
 * useless tagfilter when serializing to HTML.
 *
 * @returns {HtmlExtension}
 *   Extension for `micromark` that can be passed in `htmlExtensions` to support
 *   GitHubs weird and useless tagfilter when serializing to HTML.
 */
export function gfmTagfilterHtml(): HtmlExtension
export type CompileContext = import('micromark-util-types').CompileContext
export type HtmlExtension = import('micromark-util-types').HtmlExtension
export type Token = import('micromark-util-types').Token
ȭ\x5/**
 * @typedef {import('micromark-util-types').CompileContext} CompileContext
 * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension
 * @typedef {import('micromark-util-types').Token} Token
 */

// An opening or closing tag start, followed by a case-insensitive specific tag name,
// followed by HTML whitespace, a greater than, or a slash.
const reFlow =
  /<(\/?)(iframe|noembed|noframes|plaintext|script|style|title|textarea|xmp)(?=[\t\n\f\r />])/gi

// As HTML (text) parses tags separately (and very strictly), we don’t need to be
// global.
const reText = new RegExp('^' + reFlow.source, 'i')

/**
 * Create an HTML extension for `micromark` to support GitHubs weird and
 * useless tagfilter when serializing to HTML.
 *
 * @returns {HtmlExtension}
 *   Extension for `micromark` that can be passed in `htmlExtensions` to support
 *   GitHubs weird and useless tagfilter when serializing to HTML.
 */
export function gfmTagfilterHtml() {
  return {
    exit: {
      htmlFlowData(token) {
        exitHtmlData.call(this, token, reFlow)
      },
      htmlTextData(token) {
        exitHtmlData.call(this, token, reText)
      }
    }
  }
}

/**
 * @this {CompileContext}
 * @param {Token} token
 * @param {RegExp} filter
 * @returns {undefined}
 */
function exitHtmlData(token, filter) {
  let value = this.sliceSerialize(token)

  if (this.options.allowDangerousHtml) {
    value = value.replace(filter, '&lt;$1$2')
  }

  this.raw(this.encode(value))
}
49Bx &!
gfm-tagfil)MGFM tagfilterX=tagfilter",
    "tag",
    "filter",
    "dangerous",
    "htb
gfm-tagfilvB
gfm-tagfil@$exports": "./index.js",
  "files": [6-.]BjC=
  }
}
BxR# micromark-extension-gfm-tagfilter

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

[micromark][] extension to support GFM [tag filter][].

## Contents

*   [What is this?](#what-is-this)
*   [When to use this](#when-to-use-this)
*   [Install](#install)
*   [Use](#use)
*   [API](#api)
    *   [`gfmTagfilterHtml()`](#gfmtagfilterhtml)
*   [Authoring](#authoring)
*   [HTML](#html)
*   [CSS](#css)
*   [Syntax](#syntax)
*   [Types](#types)
*   [Compatibility](#compatibility)
*   [Security](#security)
*   [Related](#related)
*   [Contribute](#contribute)
*   [License](#license)

## What is this?

This package contains an extension that adds support for the tagfilter enabled
by GFM to [`micromark`][micromark].
The tagfilter is kinda weird and kinda useless.
This package exists for completeness.
The tag filter is a naïve attempt at XSS protection.
You should use a proper HTML sanitizing algorithm.

## When to use this

This project is useful when you want to match how GitHub works.
You can use this extension when you are working with [`micromark`][micromark]
already.
When you do, you can instead use
[`micromark-extension-gfm`][micromark-extension-gfm], which includes this
extension, to support all GFM features.

When you want to deal with syntax trees, you should instead use
[`hast-util-sanitize`][hast-util-sanitize].

When you use remark and rehype, you should use
[`rehype-sanitize`][rehype-sanitize].

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install micromark-extension-gfm-tagfilter
```

In Deno with [`esm.sh`][esmsh]:

```js
import {gfmTagfilterHtml} from 'https://esm.sh/micromark-extension-gfm-tagfilter@2'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {gfmTagfilterHtml} from 'https://esm.sh/micromark-extension-gfm-tagfilter@2?bundle'
</script>
```

## Use

```js
import {micromark} from 'micromark'
import {gfmTagfilterHtml} from 'micromark-extension-gfm-tagfilter'

const output = micromark('XSS! <script>alert(1)</script>', {
  allowDangerousHtml: true,
  htmlExtensions: [gfmTagfilterHtml()]
})

console.log(output)
```

Yields:

```html
<p>XSS! &lt;script>alert(1)&lt;/script></p>
```

## API

This package exports the identifier
[`gfmTagfilterHtml`][api-gfm-tagfilter-html].
There is no default export.

### `gfmTagfilterHtml()`

Create an HTML extension for `micromark` to support GitHubs weird and
useless tagfilter when serializing to HTML.

###### Returns

Extension for `micromark` that can be passed in `htmlExtensions` to support
GitHubs weird and useless tagfilter when serializing to HTML
([`HtmlExtension`][micromark-html-extension]).

## Authoring

This package relates to malicious authors, not decent authors.

## HTML

GFM tagfilter removes certain dangerous HTML tags: `iframe`, `noembed`,
`noframes`, `plaintext`, `script`, `style`, `title`, `textarea`, and `xmp`.

## CSS

This package does not relate to CSS.

## Syntax

This package does not change how markdown is parsed.

## Types

This package is fully typed with [TypeScript][].
It exports no additional types.

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-extension-gfm-tagfilter@^2`, compatible with Node.js 16.

This package works with `micromark` version `3` and later.

## Security

While micromark is safe by default, this extension only does something when
`allowDangerousHtml: true` is passed, which is an unsafe option.
This package is **not safe**.

## Related

*   [`micromark-extension-gfm`][micromark-extension-gfm]
    — support all of GFM
*   [`hast-util-sanitize`][hast-util-sanitize]
    — hast utility to make trees safe
*   [`rehype-sanitize`][rehype-sanitize]
    — rehype plugin to sanitize HTML

## Contribute

See [`contributing.md` in `micromark/.github`][contributing] for ways to get
started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organization, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/micromark/micromark-extension-gfm-tagfilter/workflows/main/badge.svg

[build]: https://github.com/micromark/micromark-extension-gfm-tagfilter/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark-extension-gfm-tagfilter.svg

[coverage]: https://codecov.io/github/micromark/micromark-extension-gfm-tagfilter

[downloads-badge]: https://img.shields.io/npm/dm/micromark-extension-gfm-tagfilter.svg

[downloads]: https://www.npmjs.com/package/micromark-extension-gfm-tagfilter

[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-extension-gfm-tagfilter

[size]: https://bundlejs.com/?q=micromark-extension-gfm-tagfilter

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[collective]: https://opencollective.com/unified

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/micromark/micromark/discussions

[npm]: https://docs.npmjs.com/cli/install

[esmsh]: https://esm.sh

[license]: license

[author]: https://wooorm.com

[contributing]: https://github.com/micromark/.github/blob/main/contributing.md

[support]: https://github.com/micromark/.github/blob/main/support.md

[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[typescript]: https://www.typescriptlang.org

[micromark]: https://github.com/micromark/micromark

[micromark-html-extension]: https://github.com/micromark/micromark#htmlextension

[micromark-extension-gfm]: https://github.com/micromark/micromark-extension-gfm

[rehype-sanitize]: https://github.com/rehypejs/rehype-sanitize

[hast-util-sanitize]: https://github.com/syntax-tree/hast-util-sanitize

[tag filter]: https://github.github.com/gfm/#disallowed-raw-html-extension-

[api-gfm-tagfilter-html]: #gfmtagfilterhtml
'{x 	40000 dev +E6	ɳT2Xf100644 index.d.ts <)wB/ۑ>sD100644 index.js ќ+LvzaB}Nԛ40000 lib I0"@ō~`9x100644 license 97#V}n-ƟO^100644 package.json ȽQkU6=100644 readme.md d_ٔA.-ďctxh 100644 index.d.ts <)wB/ۑ>sD100644 index.js .}yБkى40000 lib qw6Ҥ%\߼]q)=xOexport {gfmTaskListItemHtml} from './lib/html.js'
export {gfmTaskListItem} from './lib/syntax.js'

/**
 * Augment types.
 */
declare module 'micromark-util-types' {
  /**
   * Token types.
   */
  interface TokenTypeMap {
    taskListCheck: 'taskListCheck'
    taskListCheckMarker: 'taskListCheckMarker'
    taskListCheckValueChecked: 'taskListCheckValueChecked'
    taskListCheckValueUnchecked: 'taskListCheckValueUnchecked'
  }
}
&ڑ޲xb export {gfmTaskListItemHtml} from './lib/html.js'
export {gfmTaskListItem} from './lib/syntax.js'
#	x k100644 html.d.ts w;@Qܮ5o{!100644 html.js JQ*EkS.100644 syntax.d.ts ?GT>JC\
0Ht8100644 syntax.js AttGC׈A M'n9xb/**
 * Create an HTML extension for `micromark` to support GFM task list items
 * syntax.
 *
 * @returns {Extension}
 *   Extension for `micromark` that can be passed in `htmlExtensions` to
 *   support GFM task list items when serializing to HTML.
 */
export function gfmTaskListItem(): Extension;
import type { Extension } from 'micromark-util-types';
S0z]xS/**
 * @import {Extension, State, TokenizeContext, Tokenizer} from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {factorySpace} from 'micromark-factory-space'
import {
  markdownLineEnding,
  markdownLineEndingOrSpace,
  markdownSpace
} from 'micromark-util-character'
import {codes, types} from 'micromark-util-symbol'

const tasklistCheck = {name: 'tasklistCheck', tokenize: tokenizeTasklistCheck}

/**
 * Create an HTML extension for `micromark` to support GFM task list items
 * syntax.
 *
 * @returns {Extension}
 *   Extension for `micromark` that can be passed in `htmlExtensions` to
 *   support GFM task list items when serializing to HTML.
 */
export function gfmTaskListItem() {
  return {
    text: {[codes.leftSquareBracket]: tasklistCheck}
  }
}

/**
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeTasklistCheck(effects, ok, nok) {
  const self = this

  return open

  /**
   * At start of task list item check.
   *
   * ```markdown
   * > | * [x] y.
   *       ^
   * ```
   *
   * @type {State}
   */
  function open(code) {
    assert(code === codes.leftSquareBracket, 'expected `[`')

    if (
      // Exit if there’s stuff before.
      self.previous !== codes.eof ||
      // Exit if not in the first content that is the first child of a list
      // item.
      !self._gfmTasklistFirstContentOfListItem
    ) {
      return nok(code)
    }

    effects.enter('taskListCheck')
    effects.enter('taskListCheckMarker')
    effects.consume(code)
    effects.exit('taskListCheckMarker')
    return inside
  }

  /**
   * In task list item check.
   *
   * ```markdown
   * > | * [x] y.
   *        ^
   * ```
   *
   * @type {State}
   */
  function inside(code) {
    // Currently we match how GH works in files.
    // To match how GH works in comments, use `markdownSpace` (`[\t ]`) instead
    // of `markdownLineEndingOrSpace` (`[\t\n\r ]`).
    if (markdownLineEndingOrSpace(code)) {
      effects.enter('taskListCheckValueUnchecked')
      effects.consume(code)
      effects.exit('taskListCheckValueUnchecked')
      return close
    }

    if (code === codes.uppercaseX || code === codes.lowercaseX) {
      effects.enter('taskListCheckValueChecked')
      effects.consume(code)
      effects.exit('taskListCheckValueChecked')
      return close
    }

    return nok(code)
  }

  /**
   * At close of task list item check.
   *
   * ```markdown
   * > | * [x] y.
   *         ^
   * ```
   *
   * @type {State}
   */
  function close(code) {
    if (code === codes.rightSquareBracket) {
      effects.enter('taskListCheckMarker')
      effects.consume(code)
      effects.exit('taskListCheckMarker')
      effects.exit('taskListCheck')
      return after
    }

    return nok(code)
  }

  /**
   * @type {State}
   */
  function after(code) {
    // EOL in paragraph means there must be something else after it.
    if (markdownLineEnding(code)) {
      return ok(code)
    }

    // Space or tab?
    // Check what comes after.
    if (markdownSpace(code)) {
      return effects.check({tokenize: spaceThenNonSpace}, ok, nok)(code)
    }

    // EOF, or non-whitespace, both wrong.
    return nok(code)
  }
}

/**
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function spaceThenNonSpace(effects, ok, nok) {
  return factorySpace(effects, after, types.whitespace)

  /**
   * After whitespace, after task list item check.
   *
   * ```markdown
   * > | * [x] y.
   *           ^
   * ```
   *
   * @type {State}
   */
  function after(code) {
    // EOF means there was nothing, so bad.
    // EOL means there’s content after it, so good.
    // Impossible to have more spaces.
    // Anything else is good.
    return code === codes.eof ? nok(code) : ok(code)
  }
}
"%xg export { gfmTaskListItemHtml } from './lib/html.js';
export { gfmTaskListItem } from './lib/syntax.js';,$v	x k100644 html.d.ts w;@Qܮ5o{!100644 html.js |՚/[Tl]100644 syntax.d.ts ?GT>JC\
0Ht8100644 syntax.js cʏȔ*':A)xn/**
 * @import {HtmlExtension} from 'micromark-util-types'
 */

/**
 * Create an HTML extension for `micromark` to support GFM task list items when
 * serializing to HTML.
 *
 * @returns {HtmlExtension}
 *   Extension for `micromark` that can be passed in `htmlExtensions` to
 *   support GFM task list items when serializing to HTML.
 */
export function gfmTaskListItemHtml() {
  return {
    enter: {
      taskListCheck() {
        this.tag('<input type="checkbox" disabled="" ');
      }
    },
    exit: {
      taskListCheck() {
        this.tag('/>');
      },
      taskListCheckValueChecked() {
        this.tag('checked="" ');
      }
    }
  };
}Px/**
 * @import {Extension, State, TokenizeContext, Tokenizer} from 'micromark-util-types'
 */

import { factorySpace } from 'micromark-factory-space';
import { markdownLineEnding, markdownLineEndingOrSpace, markdownSpace } from 'micromark-util-character';
const tasklistCheck = {
  name: 'tasklistCheck',
  tokenize: tokenizeTasklistCheck
};

/**
 * Create an HTML extension for `micromark` to support GFM task list items
 * syntax.
 *
 * @returns {Extension}
 *   Extension for `micromark` that can be passed in `htmlExtensions` to
 *   support GFM task list items when serializing to HTML.
 */
export function gfmTaskListItem() {
  return {
    text: {
      [91]: tasklistCheck
    }
  };
}

/**
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeTasklistCheck(effects, ok, nok) {
  const self = this;
  return open;

  /**
   * At start of task list item check.
   *
   * ```markdown
   * > | * [x] y.
   *       ^
   * ```
   *
   * @type {State}
   */
  function open(code) {
    if (
    // Exit if there’s stuff before.
    self.previous !== null ||
    // Exit if not in the first content that is the first child of a list
    // item.
    !self._gfmTasklistFirstContentOfListItem) {
      return nok(code);
    }
    effects.enter('taskListCheck');
    effects.enter('taskListCheckMarker');
    effects.consume(code);
    effects.exit('taskListCheckMarker');
    return inside;
  }

  /**
   * In task list item check.
   *
   * ```markdown
   * > | * [x] y.
   *        ^
   * ```
   *
   * @type {State}
   */
  function inside(code) {
    // Currently we match how GH works in files.
    // To match how GH works in comments, use `markdownSpace` (`[\t ]`) instead
    // of `markdownLineEndingOrSpace` (`[\t\n\r ]`).
    if (markdownLineEndingOrSpace(code)) {
      effects.enter('taskListCheckValueUnchecked');
      effects.consume(code);
      effects.exit('taskListCheckValueUnchecked');
      return close;
    }
    if (code === 88 || code === 120) {
      effects.enter('taskListCheckValueChecked');
      effects.consume(code);
      effects.exit('taskListCheckValueChecked');
      return close;
    }
    return nok(code);
  }

  /**
   * At close of task list item check.
   *
   * ```markdown
   * > | * [x] y.
   *         ^
   * ```
   *
   * @type {State}
   */
  function close(code) {
    if (code === 93) {
      effects.enter('taskListCheckMarker');
      effects.consume(code);
      effects.exit('taskListCheckMarker');
      effects.exit('taskListCheck');
      return after;
    }
    return nok(code);
  }

  /**
   * @type {State}
   */
  function after(code) {
    // EOL in paragraph means there must be something else after it.
    if (markdownLineEnding(code)) {
      return ok(code);
    }

    // Space or tab?
    // Check what comes after.
    if (markdownSpace(code)) {
      return effects.check({
        tokenize: spaceThenNonSpace
      }, ok, nok)(code);
    }

    // EOF, or non-whitespace, both wrong.
    return nok(code);
  }
}

/**
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function spaceThenNonSpace(effects, ok, nok) {
  return factorySpace(effects, after, "whitespace");

  /**
   * After whitespace, after task list item check.
   *
   * ```markdown
   * > | * [x] y.
   *           ^
   * ```
   *
   * @type {State}
   */
  function after(code) {
    // EOF means there was nothing, so bad.
    // EOL means there’s content after it, so good.
    // Impossible to have more spaces.
    // Anything else is good.
    return code === null ? nok(code) : ok(code);
  }
}#ANx"# micromark-extension-gfm-task-list-item

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

[micromark][] extensions to support GFM [task list items][].

## Contents

* [What is this?](#what-is-this)
* [When to use this](#when-to-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`gfmTaskListItem()`](#gfmtasklistitem)
  * [`gfmTaskListItemHtml()`](#gfmtasklistitemhtml)
* [Authoring](#authoring)
* [HTML](#html)
* [CSS](#css)
* [Syntax](#syntax)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package contains extensions that add support for task lists as enabled by
GFM to [`micromark`][micromark].
It matches how task list items work on `github.com`.

## When to use this

This project is useful when you want to support task lists in markdown.

You can use these extensions when you are working with [`micromark`][micromark].
To support all GFM features, use
[`micromark-extension-gfm`][micromark-extension-gfm].

When you need a syntax tree, you can combine this package with
[`mdast-util-gfm-task-list-item`][mdast-util-gfm-task-list-item].

All these packages are used [`remark-gfm`][remark-gfm], which focusses on making
it easier to transform content by abstracting these internals away.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install micromark-extension-gfm-task-list-item
```

In Deno with [`esm.sh`][esmsh]:

```js
import {gfmTaskListItem, gfmTaskListItemHtml} from 'https://esm.sh/micromark-extension-gfm-task-list-item@2'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {gfmTaskListItem, gfmTaskListItemHtml} from 'https://esm.sh/micromark-extension-gfm-task-list-item@2?bundle'
</script>
```

## Use

```js
import {micromark} from 'micromark'
import {
  gfmTaskListItem,
  gfmTaskListItemHtml
} from 'micromark-extension-gfm-task-list-item'

const output = micromark('* [x] a\n* [ ] b', {
  extensions: [gfmTaskListItem()],
  htmlExtensions: [gfmTaskListItemHtml()]
})

console.log(output)
```

Yields:

```html
<ul>
<li><input type="checkbox" disabled="" checked="" /> a</li>
<li><input type="checkbox" disabled="" /> b</li>
</ul>
```

## API

This package exports the identifiers [`gfmTaskListItem`][api-gfm-task-list-item]
and [`gfmTaskListItemHtml`][api-gfm-task-list-item-html].
There is no default export.

The export map supports the [`development` condition][development].
Run `node --conditions development module.js` to get instrumented dev code.
Without this condition, production code is loaded.

### `gfmTaskListItem()`

Create an HTML extension for `micromark` to support GFM task list items
syntax.

###### Returns

Extension for `micromark` that can be passed in `extensions`, to enable GFM
task list items syntax ([`Extension`][micromark-extension]).

### `gfmTaskListItemHtml()`

Create an HTML extension for `micromark` to support GFM task list items when
serializing to HTML.

###### Returns

Extension for `micromark` that can be passed in `htmlExtensions` to support GFM
task list items when serializing to HTML
([`HtmlExtension`][micromark-html-extension]).

## Authoring

It is recommended to use lowercase `x` (instead of uppercase `X`), because in
markdown, it is more common to use lowercase in places where casing does not
matter.
It is also recommended to use a space (instead of a tab), as there is no benefit
of using tabs in this case.

## HTML

Checks relate to the `<input>` element, in the checkbox state (`type=checkbox`),
in HTML.
See [*§ 4.10.5.1.15 Checkbox state (`type=checkbox`)*][html-input-checkbox]
in the HTML spec for more info.

```html
<!--…-->
<li><input type="checkbox" disabled="" /> foo</li>
<li><input type="checkbox" disabled="" checked="" /> bar</li>
<!--…-->
```

## CSS

GitHub itself uses slightly different markup for task list items than they
define in their spec.
When following the spec, as this extension does, only inputs are added.
They can be styled with the following CSS:

```css
input[type="checkbox"] {
  margin: 0 .2em .25em -1.6em;
  vertical-align: middle;
}

input[type="checkbox"]:dir(rtl) {
  margin: 0 -1.6em .25em .2em;
}
```

For the complete actual CSS see
[`sindresorhus/github-markdown-css`][github-markdown-css].

## Syntax

Checks form with the following BNF:

```bnf
gfm_task_list_item_check ::= '[' (0x09 | ' ' | 'X' | 'x') ']'
```

The check is only allowed at the start of the first paragraph, optionally
following zero or more definitions or a blank line, in a list item.
The check must be followed by whitespace (`[\t\n\r ]*`), which is in turn
followed by non-whitespace.

## Types

This package is fully typed with [TypeScript][].
It exports no additional types.

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-extension-gfm-task-list-item@^2`, compatible with Node.js 16.

This package works with `micromark` version `3` and later.

## Security

This package is safe.

## Related

* [`micromark-extension-gfm`][micromark-extension-gfm]
  — support all of GFM
* [`mdast-util-gfm-task-list-item`][mdast-util-gfm-task-list-item]
  — support all of GFM in mdast
* [`mdast-util-gfm`][mdast-util-gfm]
  — support all of GFM in mdast
* [`remark-gfm`][remark-gfm]
  — support all of GFM in remark

## Contribute

See [`contributing.md` in `micromark/.github`][contributing] for ways to get
started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organization, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/micromark/micromark-extension-gfm-task-list-item/workflows/main/badge.svg

[build]: https://github.com/micromark/micromark-extension-gfm-task-list-item/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark-extension-gfm-task-list-item.svg

[coverage]: https://codecov.io/github/micromark/micromark-extension-gfm-task-list-item

[downloads-badge]: https://img.shields.io/npm/dm/micromark-extension-gfm-task-list-item.svg

[downloads]: https://www.npmjs.com/package/micromark-extension-gfm-task-list-item

[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-extension-gfm-task-list-item

[size]: https://bundlejs.com/?q=micromark-extension-gfm-task-list-item

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[collective]: https://opencollective.com/unified

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/micromark/micromark/discussions

[npm]: https://docs.npmjs.com/cli/install

[esmsh]: https://esm.sh

[license]: license

[author]: https://wooorm.com

[contributing]: https://github.com/micromark/.github/blob/main/contributing.md

[support]: https://github.com/micromark/.github/blob/main/support.md

[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[typescript]: https://www.typescriptlang.org

[development]: https://nodejs.org/api/packages.html#packages_resolving_user_conditions

[micromark]: https://github.com/micromark/micromark

[micromark-html-extension]: https://github.com/micromark/micromark#htmlextension

[micromark-extension]: https://github.com/micromark/micromark#syntaxextension

[micromark-extension-gfm]: https://github.com/micromark/micromark-extension-gfm

[mdast-util-gfm-task-list-item]: https://github.com/syntax-tree/mdast-util-gfm-task-list-item

[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm

[remark-gfm]: https://github.com/remarkjs/remark-gfm

[task list items]: https://github.github.com/gfm/#task-list-items-extension-

[github-markdown-css]: https://github.com/sindresorhus/github-markdown-css

[html-input-checkbox]: https://html.spec.whatwg.org/multipage/input.html#checkbox-state-\(type=checkbox\)

[api-gfm-task-list-item]: #gfmtasklistitem

[api-gfm-task-list-item-html]: #gfmtasklistitemhtml
nx E100644 index.d.ts g/ȆMǩ^100644 index.js sXZ6<FkC100644 license 97#V}n-ƟO^100644 package.json :00X~100644 readme.md i@
&~1PJGxv/**
 * Create an extension for `micromark` to enable GFM syntax.
 *
 * @param {Options | null | undefined} [options]
 *   Configuration (optional).
 *
 *   Passed to `micromark-extens-gfm-strikethrough`.
 * @returns {Extension}
 *   Extension for `micromark` that can be passed in `extensions` to enable GFM
 *   syntax.
 */
export function gfm(options?: Options | null | undefined): Extension
/**
 * Create an extension for `micromark` to support GFM when serializing to HTML.
 *
 * @param {HtmlOptions | null | undefined} [options]
 *   Configuration (optional).
 *
 *   Passed to `micromark-extens-gfm-footnote`.
 * @returns {HtmlExtension}
 *   Extension for `micromark` that can be passed in `htmlExtensions` to
 *   support GFM when serializing to HTML.
 */
export function gfmHtml(options?: HtmlOptions | null | undefined): HtmlExtension
export type HtmlOptions = import('micromark-extension-gfm-footnote').HtmlOptions
export type Options = import('micromark-extension-gfm-strikethrough').Options
export type Extension = import('micromark-util-types').Extension
export type HtmlExtension = import('micromark-util-types').HtmlExtension
hy~x/**
 * @typedef {import('micromark-extension-gfm-footnote').HtmlOptions} HtmlOptions
 * @typedef {import('micromark-extension-gfm-strikethrough').Options} Options
 * @typedef {import('micromark-util-types').Extension} Extension
 * @typedef {import('micromark-util-types').HtmlExtension} HtmlExtension
 */

import {
  combineExtensions,
  combineHtmlExtensions
} from 'micromark-util-combine-extensions'
import {
  gfmAutolinkLiteral,
  gfmAutolinkLiteralHtml
} from 'micromark-extension-gfm-autolink-literal'
import {gfmFootnote, gfmFootnoteHtml} from 'micromark-extension-gfm-footnote'
import {
  gfmStrikethrough,
  gfmStrikethroughHtml
} from 'micromark-extension-gfm-strikethrough'
import {gfmTable, gfmTableHtml} from 'micromark-extension-gfm-table'
import {gfmTagfilterHtml} from 'micromark-extension-gfm-tagfilter'
import {
  gfmTaskListItem,
  gfmTaskListItemHtml
} from 'micromark-extension-gfm-task-list-item'

/**
 * Create an extension for `micromark` to enable GFM syntax.
 *
 * @param {Options | null | undefined} [options]
 *   Configuration (optional).
 *
 *   Passed to `micromark-extens-gfm-strikethrough`.
 * @returns {Extension}
 *   Extension for `micromark` that can be passed in `extensions` to enable GFM
 *   syntax.
 */
export function gfm(options) {
  return combineExtensions([
    gfmAutolinkLiteral(),
    gfmFootnote(),
    gfmStrikethrough(options),
    gfmTable(),
    gfmTaskListItem()
  ])
}

/**
 * Create an extension for `micromark` to support GFM when serializing to HTML.
 *
 * @param {HtmlOptions | null | undefined} [options]
 *   Configuration (optional).
 *
 *   Passed to `micromark-extens-gfm-footnote`.
 * @returns {HtmlExtension}
 *   Extension for `micromark` that can be passed in `htmlExtensions` to
 *   support GFM when serializing to HTML.
 */
export function gfmHtml(options) {
  return combineHtmlExtensions([
    gfmAutolinkLiteralHtml(),
    gfmFootnoteHtml(options),
    gfmStrikethroughHtml(),
    gfmTableHtml(),
    gfmTagfilterHtml(),
    gfmTaskListItemHtml()
  ])
}
P$cxO$",
  "version": "3.0G:(GitHub Flavored Markdown)Zgble",
    "strikethrough",
    "tasklist",
    "autolink",
    "footnote",
    "tagfilter",
    "github-cB=$exports": "./index.js",
  "files": [N*dautolink-literal<footnotstrikethrough<blgfil9= combine-extensions<!W81^hast-util-from-html": "^1.0.0",
    "hast-util-select": "^5.0.0",
    "hast-util-to-text": "^39l2.0.0",
    "rehypehype-sort-attributes": "^4z1%9G#undici": "^5.0.0",
    "xo": "^0.546G
4{test,script}ujx93# micromark-extension-gfm

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

[micromark][] extensions to support [GitHub flavored markdown][gfm] (GFM).

## Contents

*   [What is this?](#what-is-this)
*   [When to use this](#when-to-use-this)
*   [Install](#install)
*   [Use](#use)
*   [API](#api)
    *   [`gfm(options?)`](#gfmoptions)
    *   [`gfmHtml(options?)`](#gfmhtmloptions)
    *   [`Options`](#options)
    *   [`HtmlOptions`](#htmloptions)
*   [Bugs](#bugs)
*   [Authoring](#authoring)
*   [HTML](#html)
*   [CSS](#css)
*   [Syntax](#syntax)
*   [Types](#types)
*   [Compatibility](#compatibility)
*   [Security](#security)
*   [Contribute](#contribute)
*   [License](#license)

## What is this?

This package contains extensions that add support for all features enabled by
GFM to [`micromark`][micromark].
It supports autolink literals, footnotes, strikethrough, tables, tagfilter, and
tasklists.

## When to use this

This project is useful when you want to support GFM in markdown.

You can use these extensions when you are working with [`micromark`][micromark].
Alternatively, you can also use the underlying features separately:

*   [`micromark-extension-gfm-autolink-literal`][gfm-autolink-literal]
    — support GFM [autolink literals][]
*   [`micromark-extension-gfm-footnote`][gfm-footnote]
    — support GFM [footnotes][]
*   [`micromark-extension-gfm-strikethrough`][gfm-strikethrough]
    — support GFM [strikethrough][]
*   [`micromark-extension-gfm-table`][gfm-table]
    — support GFM [tables][]
*   [`micromark-extension-gfm-tagfilter`][gfm-tagfilter]
    — support GFM [tagfilter][]
*   [`micromark-extension-gfm-task-list-item`][gfm-task-list-item]
    — support GFM [tasklists][]

When you need a syntax tree, combine this package with
[`mdast-util-gfm`][mdast-util-gfm].

All these packages are used in [`remark-gfm`][remark-gfm], which focusses on
making it easier to transform content by abstracting these internals away.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install micromark-extension-gfm
```

In Deno with [`esm.sh`][esmsh]:

```js
import {gfm, gfmHtml} from 'https://esm.sh/micromark-extension-gfm@3'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {gfm, gfmHtml} from 'https://esm.sh/micromark-extension-gfm@3?bundle'
</script>
```

## Use

Say our document `example.md` contains:

```markdown
# GFM

## Autolink literals

www.example.com, https://example.com, and contact@example.com.

## Footnote

A note[^1]

[^1]: Big note.

## Strikethrough

~one~ or ~~two~~ tildes.

## Table

| a | b  |  c |  d  |
| - | :- | -: | :-: |

## Tag filter

<plaintext>

## Tasklist

* [ ] to do
* [x] done
```

…and our module `example.js` looks as follows:

```js
import fs from 'node:fs/promises'
import {micromark} from 'micromark'
import {gfm, gfmHtml} from 'micromark-extension-gfm'

const output = micromark(await fs.readFile('example.md'), {
  allowDangerousHtml: true,
  extensions: [gfm()],
  htmlExtensions: [gfmHtml()]
})

console.log(output)
```

…now running `node example.js` yields:

```html
<h1>GFM</h1>
<h2>Autolink literals</h2>
<p><a href="http://www.example.com">www.example.com</a>, <a href="https://example.com">https://example.com</a>, and <a href="mailto:contact@example.com">contact@example.com</a>.</p>
<h2>Footnote</h2>
<p>A note<sup><a href="#user-content-fn-1" id="user-content-fnref-1" data-footnote-ref="" aria-describedby="footnote-label">1</a></sup></p>
<h2>Strikethrough</h2>
<p><del>one</del> or <del>two</del> tildes.</p>
<h2>Table</h2>
<table>
<thead>
<tr>
<th>a</th>
<th align="left">b</th>
<th align="right">c</th>
<th align="center">d</th>
</tr>
</thead>
</table>
<h2>Tag filter</h2>
&lt;plaintext>
<h2>Tasklist</h2>
<ul>
<li><input type="checkbox" disabled="" /> to do</li>
<li><input type="checkbox" disabled="" checked="" /> done</li>
</ul>
<section data-footnotes="" class="footnotes"><h2 id="footnote-label" class="sr-only">Footnotes</h2>
<ol>
<li id="user-content-fn-1">
<p>Big note. <a href="#user-content-fnref-1" data-footnote-backref="" class="data-footnote-backref" aria-label="Back to content">↩</a></p>
</li>
</ol>
</section>
```

## API

This package exports the identifiers [`gfm`][api-gfm] and
[`gfmHtml`][api-gfm-html].
There is no default export.

The separate extensions support the [`development` condition][development].
Run `node --conditions development module.js` to get instrumented dev code.
Without this condition, production code is loaded.

### `gfm(options?)`

Create an extension for `micromark` to enable GFM syntax.

###### Parameters

*   `options` ([`Options`][api-options], optional)
    — configuration; passed to
    [`micromark-extens-gfm-strikethrough`][gfm-strikethrough-options]

###### Returns

Extension for `micromark` that can be passed in `extensions` to enable GFM
syntax ([`Extension`][micromark-extension]).

### `gfmHtml(options?)`

Create an extension for `micromark` to support GFM when serializing to HTML.

###### Parameters

*   `options` ([`HtmlOptions`][api-html-options], optional)
    — configuration; passed to
    [`micromark-extens-gfm-footnote`][gfm-footnote-html-options]

###### Returns

Extension for `micromark` that can be passed in `htmlExtensions` to support GFM
when serializing to HTML ([`HtmlExtension`][micromark-html-extension]).

### `Options`

Configuration for syntax (TypeScript type).

###### Type

```ts
export type {Options} from 'micromark-extension-gfm-strikethrough'
```

[See `Options`][gfm-strikethrough-options].

### `HtmlOptions`

Configuration for HTML (TypeScript type).

###### Type

```ts
export type {HtmlOptions} from 'micromark-extension-gfm-footnote'
```

[See `HtmlOptions`][gfm-footnote-html-options].

## Bugs

For bugs present in GFM but not here, or other peculiarities that are
supported, see each corresponding readme:

*   [autolink literal](https://github.com/micromark/micromark-extension-gfm-autolink-literal#bugs)
*   [footnote](https://github.com/micromark/micromark-extension-gfm-footnote#bugs)
*   strikethrough: n/a
*   [table](https://github.com/micromark/micromark-extension-gfm-table#bugs)
*   tagfilter: n/a
*   tasklists: n/a

## Authoring

For recommendations on how to author GFM, see each corresponding readme:

*   [autolink literal](https://github.com/micromark/micromark-extension-gfm-autolink-literal#authoring)
*   [footnote](https://github.com/micromark/micromark-extension-gfm-footnote#authoring)
*   [strikethrough](https://github.com/micromark/micromark-extension-gfm-strikethrough#authoring)
*   [table](https://github.com/micromark/micromark-extension-gfm-table#authoring)
*   tagfilter: n/a
*   [tasklists](https://github.com/micromark/micromark-extension-gfm-task-list-item#authoring)

## HTML

For info on what HTML features GFM relates to, see each corresponding readme:

*   [autolink literal](https://github.com/micromark/micromark-extension-gfm-autolink-literal#html)
*   [footnote](https://github.com/micromark/micromark-extension-gfm-footnote#html)
*   [strikethrough](https://github.com/micromark/micromark-extension-gfm-strikethrough#html)
*   [table](https://github.com/micromark/micromark-extension-gfm-table#html)
*   [tagfilter](https://github.com/micromark/micromark-extension-gfm-tagfilter#html)
*   [tasklists](https://github.com/micromark/micromark-extension-gfm-task-list-item#html)

## CSS

For info on how GitHub styles these features, see each corresponding readme:

*   [autolink literal](https://github.com/micromark/micromark-extension-gfm-autolink-literal#css)
*   [footnote](https://github.com/micromark/micromark-extension-gfm-footnote#css)
*   [strikethrough](https://github.com/micromark/micromark-extension-gfm-strikethrough#css)
*   [table](https://github.com/micromark/micromark-extension-gfm-table#css)
*   tagfilter: n/a
*   [tasklists](https://github.com/micromark/micromark-extension-gfm-task-list-item#css)

## Syntax

For info on the syntax of these features, see each corresponding readme:

*   [autolink literal](https://github.com/micromark/micromark-extension-gfm-autolink-literal#syntax)
*   [footnote](https://github.com/micromark/micromark-extension-gfm-footnote#syntax)
*   [strikethrough](https://github.com/micromark/micromark-extension-gfm-strikethrough#syntax)
*   [table](https://github.com/micromark/micromark-extension-gfm-table#syntax)
*   tagfilter: n/a
*   [tasklists](https://github.com/micromark/micromark-extension-gfm-task-list-item#syntax)

## Types

This package is fully typed with [TypeScript][].
It exports the additional types [`HtmlOptions`][api-html-options] and
[`Options`][api-options].

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-extension-gfm@^3`, compatible with Node.js 16.

This package works with `micromark` version `3` and later.

## Security

This package is safe.
Setting `clobberPrefix = ''` is dangerous, it opens you up to DOM clobbering.
The `labelTagName` and `labelAttributes` options are unsafe when used with user
content, they allow defining arbitrary HTML.

## Contribute

See [`contributing.md` in `micromark/.github`][contributing] for ways to get
started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organization, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/micromark/micromark-extension-gfm/workflows/main/badge.svg

[build]: https://github.com/micromark/micromark-extension-gfm/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark-extension-gfm.svg

[coverage]: https://codecov.io/github/micromark/micromark-extension-gfm

[downloads-badge]: https://img.shields.io/npm/dm/micromark-extension-gfm.svg

[downloads]: https://www.npmjs.com/package/micromark-extension-gfm

[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-extension-gfm

[size]: https://bundlejs.com/?q=micromark-extension-gfm

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[collective]: https://opencollective.com/unified

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/micromark/micromark/discussions

[npm]: https://docs.npmjs.com/cli/install

[esmsh]: https://esm.sh

[license]: license

[author]: https://wooorm.com

[contributing]: https://github.com/micromark/.github/blob/main/contributing.md

[support]: https://github.com/micromark/.github/blob/main/support.md

[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[development]: https://nodejs.org/api/packages.html#packages_resolving_user_conditions

[typescript]: https://www.typescriptlang.org

[gfm]: https://github.github.com/gfm/

[strikethrough]: https://github.github.com/gfm/#strikethrough-extension-

[tables]: https://github.github.com/gfm/#tables-extension-

[tasklists]: https://github.github.com/gfm/#task-list-items-extension-

[autolink literals]: https://github.github.com/gfm/#autolinks-extension-

[tagfilter]: https://github.github.com/gfm/#disallowed-raw-html-extension-

[footnotes]: https://github.blog/changelog/2021-09-30-footnotes-now-supported-in-markdown-fields/

[micromark]: https://github.com/micromark/micromark

[micromark-extension]: https://github.com/micromark/micromark#syntaxextension

[micromark-html-extension]: https://github.com/micromark/micromark#htmlextension

[gfm-strikethrough]: https://github.com/micromark/micromark-extension-gfm-strikethrough

[gfm-strikethrough-options]: https://github.com/micromark/micromark-extension-gfm-strikethrough#options

[gfm-autolink-literal]: https://github.com/micromark/micromark-extension-gfm-autolink-literal

[gfm-footnote]: https://github.com/micromark/micromark-extension-gfm-footnote

[gfm-footnote-html-options]: https://github.com/micromark/micromark-extension-gfm-footnote#htmloptions

[gfm-table]: https://github.com/micromark/micromark-extension-gfm-table

[gfm-tagfilter]: https://github.com/micromark/micromark-extension-gfm-tagfilter

[gfm-task-list-item]: https://github.com/micromark/micromark-extension-gfm-task-list-item

[remark-gfm]: https://github.com/remarkjs/remark-gfm

[mdast-util-gfm]: https://github.com/syntax-tree/mdast-util-gfm

[api-gfm]: #gfmoptions

[api-gfm-html]: #gfmhtmloptions

[api-options]: #options

[api-html-options]: #htmloptions
}6x 	40000 dev Wz<K7&0֚100644 index.d.ts ПWmY"ZΊ100644 index.js Y2+,Yg.a`440000 lib ϋkfZ*7j2100644 license 97#V}n-ƟO^100644 package.json |..MY;9Ǥ;100644 readme.md kW«kWT
c`a-xh 100644 index.d.ts ПWmY"ZΊ100644 index.js 9Tk=o6^Is40000 lib 2xLGn.4+{aximport type {KatexOptions} from 'katex'

export {mathHtml} from './lib/html.js'
export {math} from './lib/syntax.js'

/**
 * Configuration for HTML output.
 *
 * > 👉 **Note**: passed to `katex.renderToString`.
 * > `displayMode` is overwritten by this plugin, to `false` for math in
 * > text (inline), and `true` for math in flow (block).
 */
export interface HtmlOptions extends KatexOptions {
  /**
   * The field `displayMode` cannot be passed to `micromark-extension-math`.
   * It is overwritten by it,
   * to `false` for math in text (inline) and `true` for math in flow (block).
   */
  displayMode?: never
}

/**
 * Configuration.
 */
export interface Options {
  /**
   * Whether to support math (text) with a single dollar (default: `true`).
   *
   * Single dollars work in Pandoc and many other places, but often interfere
   * with “normal” dollars in text.
   * If you turn this off, you can use two or more dollars for text math.
   */
  singleDollarTextMath?: boolean | null | undefined
}

/**
 * Augment types.
 */
declare module 'micromark-util-types' {
  /**
   * Compile data.
   */
  interface CompileData {
    mathFlowOpen?: boolean
  }

  /**
   * Token types.
   */
  interface TokenTypeMap {
    mathFlow: 'mathFlow'
    mathFlowFence: 'mathFlowFence'
    mathFlowFenceMeta: 'mathFlowFenceMeta'
    mathFlowFenceSequence: 'mathFlowFenceSequence'
    mathFlowValue: 'mathFlowValue'
    mathText: 'mathText'
    mathTextData: 'mathTextData'
    mathTextPadding: 'mathTextPadding'
    mathTextSequence: 'mathTextSequence'
  }
}
)Ƿxw // Note: types exported from `index.d.ts`.
export {math} from './lib/syntax.js'
export {mathHtml} from './lib/html.js'
ޡ)Ǩx8100644 html.d.ts 0 a8YRo?w100644 html.js c]pMؗ0UjtC100644 math-flow.d.ts 01E9E#w[Q100644 math-flow.js ו63xNPۢ+100644 math-text.d.ts IAD$(@"=ud100644 math-text.js n_WVJ"\100644 syntax.d.ts 5d4e5A]F100644 syntax.js Pُd9L߅c9lzvx 6math when serializing to
 *X#uses KaTeX to render math5{} {}#wmath/	mathHtml($): HtmlExtension;
import type { HtmlOptions as Options } from 'micromark-extension-math';
import type { HtmlExtension } from 'mC;
0Tἁx/**
 * @import {HtmlOptions as Options} from 'micromark-extension-math'
 * @import {HtmlExtension} from 'micromark-util-types'
 */

import katex from 'katex'

const renderToString = katex.renderToString

/**
 * Create an extension for `micromark` to support math when serializing to
 * HTML.
 *
 * > 👉 **Note**: this uses KaTeX to render math.
 *
 * @param {Options | null | undefined} [options={}]
 *   Configuration (default: `{}`).
 * @returns {HtmlExtension}
 *   Extension for `micromark` that can be passed in `htmlExtensions`, to
 *   support math when serializing to HTML.
 */
export function mathHtml(options) {
  return {
    enter: {
      mathFlow() {
        this.lineEndingIfNeeded()
        this.tag('<div class="math math-display">')
      },
      mathFlowFenceMeta() {
        this.buffer()
      },
      mathText() {
        // Double?
        this.tag('<span class="math math-inline">')
        this.buffer()
      }
    },
    exit: {
      mathFlow() {
        const value = this.resume()
        this.tag(math(value.replace(/(?:\r?\n|\r)$/, ''), true))
        this.tag('</div>')
        this.setData('mathFlowOpen')
        this.setData('slurpOneLineEnding')
      },
      mathFlowFence() {
        // After the first fence.
        if (!this.getData('mathFlowOpen')) {
          this.setData('mathFlowOpen', true)
          this.setData('slurpOneLineEnding', true)
          this.buffer()
        }
      },
      mathFlowFenceMeta() {
        this.resume()
      },
      mathFlowValue(token) {
        this.raw(this.sliceSerialize(token))
      },
      mathText() {
        const value = this.resume()
        this.tag(math(value, false))
        this.tag('</span>')
      },
      mathTextData(token) {
        this.raw(this.sliceSerialize(token))
      }
    }
  }

  /**
   * @param {string} value
   *   Math text.
   * @param {boolean} displayMode
   *   Whether the math is in display mode.
   * @returns {string}
   *   HTML.
   */
  function math(value, displayMode) {
    return renderToString(value, {...options, displayMode})
  }
}
2v<xr /** @type {Construct} */
export const mathFlow: Construct;
import type { Construct } from 'micromark-util-types';
(x'/**
 * @import {Construct, State, TokenizeContext, Tokenizer} from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {factorySpace} from 'micromark-factory-space'
import {markdownLineEnding} from 'micromark-util-character'
import {codes, constants, types} from 'micromark-util-symbol'

/** @type {Construct} */
export const mathFlow = {
  tokenize: tokenizeMathFenced,
  concrete: true,
  name: 'mathFlow'
}

/** @type {Construct} */
const nonLazyContinuation = {
  tokenize: tokenizeNonLazyContinuation,
  partial: true
}

/**
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeMathFenced(effects, ok, nok) {
  const self = this
  const tail = self.events[self.events.length - 1]
  const initialSize =
    tail && tail[1].type === types.linePrefix
      ? tail[2].sliceSerialize(tail[1], true).length
      : 0
  let sizeOpen = 0

  return start

  /**
   * Start of math.
   *
   * ```markdown
   * > | $$
   *     ^
   *   | \frac{1}{2}
   *   | $$
   * ```
   *
   * @type {State}
   */
  function start(code) {
    assert(code === codes.dollarSign, 'expected `$`')
    effects.enter('mathFlow')
    effects.enter('mathFlowFence')
    effects.enter('mathFlowFenceSequence')
    return sequenceOpen(code)
  }

  /**
   * In opening fence sequence.
   *
   * ```markdown
   * > | $$
   *      ^
   *   | \frac{1}{2}
   *   | $$
   * ```
   *
   * @type {State}
   */
  function sequenceOpen(code) {
    if (code === codes.dollarSign) {
      effects.consume(code)
      sizeOpen++
      return sequenceOpen
    }

    if (sizeOpen < 2) {
      return nok(code)
    }

    effects.exit('mathFlowFenceSequence')
    return factorySpace(effects, metaBefore, types.whitespace)(code)
  }

  /**
   * In opening fence, before meta.
   *
   * ```markdown
   * > | $$asciimath
   *       ^
   *   | x < y
   *   | $$
   * ```
   *
   * @type {State}
   */

  function metaBefore(code) {
    if (code === codes.eof || markdownLineEnding(code)) {
      return metaAfter(code)
    }

    effects.enter('mathFlowFenceMeta')
    effects.enter(types.chunkString, {contentType: constants.contentTypeString})
    return meta(code)
  }

  /**
   * In meta.
   *
   * ```markdown
   * > | $$asciimath
   *        ^
   *   | x < y
   *   | $$
   * ```
   *
   * @type {State}
   */
  function meta(code) {
    if (code === codes.eof || markdownLineEnding(code)) {
      effects.exit(types.chunkString)
      effects.exit('mathFlowFenceMeta')
      return metaAfter(code)
    }

    if (code === codes.dollarSign) {
      return nok(code)
    }

    effects.consume(code)
    return meta
  }

  /**
   * After meta.
   *
   * ```markdown
   * > | $$
   *       ^
   *   | \frac{1}{2}
   *   | $$
   * ```
   *
   * @type {State}
   */
  function metaAfter(code) {
    // Guaranteed to be eol/eof.
    effects.exit('mathFlowFence')

    if (self.interrupt) {
      return ok(code)
    }

    return effects.attempt(
      nonLazyContinuation,
      beforeNonLazyContinuation,
      after
    )(code)
  }

  /**
   * After eol/eof in math, at a non-lazy closing fence or content.
   *
   * ```markdown
   *   | $$
   * > | \frac{1}{2}
   *     ^
   * > | $$
   *     ^
   * ```
   *
   * @type {State}
   */
  function beforeNonLazyContinuation(code) {
    return effects.attempt(
      {tokenize: tokenizeClosingFence, partial: true},
      after,
      contentStart
    )(code)
  }

  /**
   * Before math content, definitely not before a closing fence.
   *
   * ```markdown
   *   | $$
   * > | \frac{1}{2}
   *     ^
   *   | $$
   * ```
   *
   * @type {State}
   */
  function contentStart(code) {
    return (
      initialSize
        ? factorySpace(
            effects,
            beforeContentChunk,
            types.linePrefix,
            initialSize + 1
          )
        : beforeContentChunk
    )(code)
  }

  /**
   * Before math content, after optional prefix.
   *
   * ```markdown
   *   | $$
   * > | \frac{1}{2}
   *     ^
   *   | $$
   * ```
   *
   * @type {State}
   */
  function beforeContentChunk(code) {
    if (code === codes.eof) {
      return after(code)
    }

    if (markdownLineEnding(code)) {
      return effects.attempt(
        nonLazyContinuation,
        beforeNonLazyContinuation,
        after
      )(code)
    }

    effects.enter('mathFlowValue')
    return contentChunk(code)
  }

  /**
   * In math content.
   *
   * ```markdown
   *   | $$
   * > | \frac{1}{2}
   *      ^
   *   | $$
   * ```
   *
   * @type {State}
   */
  function contentChunk(code) {
    if (code === codes.eof || markdownLineEnding(code)) {
      effects.exit('mathFlowValue')
      return beforeContentChunk(code)
    }

    effects.consume(code)
    return contentChunk
  }

  /**
   * After math (ha!).
   *
   * ```markdown
   *   | $$
   *   | \frac{1}{2}
   * > | $$
   *       ^
   * ```
   *
   * @type {State}
   */
  function after(code) {
    effects.exit('mathFlow')
    return ok(code)
  }

  /** @type {Tokenizer} */
  function tokenizeClosingFence(effects, ok, nok) {
    let size = 0

    assert(self.parser.constructs.disable.null, 'expected `disable.null`')
    /**
     * Before closing fence, at optional whitespace.
     *
     * ```markdown
     *   | $$
     *   | \frac{1}{2}
     * > | $$
     *     ^
     * ```
     */
    return factorySpace(
      effects,
      beforeSequenceClose,
      types.linePrefix,
      self.parser.constructs.disable.null.includes('codeIndented')
        ? undefined
        : constants.tabSize
    )

    /**
     * In closing fence, after optional whitespace, at sequence.
     *
     * ```markdown
     *   | $$
     *   | \frac{1}{2}
     * > | $$
     *     ^
     * ```
     *
     * @type {State}
     */
    function beforeSequenceClose(code) {
      effects.enter('mathFlowFence')
      effects.enter('mathFlowFenceSequence')
      return sequenceClose(code)
    }

    /**
     * In closing fence sequence.
     *
     * ```markdown
     *   | $$
     *   | \frac{1}{2}
     * > | $$
     *      ^
     * ```
     *
     * @type {State}
     */
    function sequenceClose(code) {
      if (code === codes.dollarSign) {
        size++
        effects.consume(code)
        return sequenceClose
      }

      if (size < sizeOpen) {
        return nok(code)
      }

      effects.exit('mathFlowFenceSequence')
      return factorySpace(effects, afterSequenceClose, types.whitespace)(code)
    }

    /**
     * After closing fence sequence, after optional whitespace.
     *
     * ```markdown
     *   | $$
     *   | \frac{1}{2}
     * > | $$
     *       ^
     * ```
     *
     * @type {State}
     */
    function afterSequenceClose(code) {
      if (code === codes.eof || markdownLineEnding(code)) {
        effects.exit('mathFlowFence')
        return ok(code)
      }

      return nok(code)
    }
  }
}

/**
 * @this {TokenizeContext}
 * @type {Tokenizer}
 */
function tokenizeNonLazyContinuation(effects, ok, nok) {
  const self = this

  return start

  /** @type {State} */
  function start(code) {
    if (code === null) {
      return ok(code)
    }

    assert(markdownLineEnding(code), 'expected eol')
    effects.enter(types.lineEnding)
    effects.consume(code)
    effects.exit(types.lineEnding)
    return lineStart
  }

  /** @type {State} */
  function lineStart(code) {
    return self.parser.lazy[self.now().line] ? nok(code) : ok(code)
  }
}
snxC/**
 * @param {Options | null | undefined} [options={}]
 *   Configuration (default: `{}`).
 * @returns {Construct}
 *   Construct.
 */
export function mathText(options?: Options | null | undefined): Construct;
import type { Options } from 'micromark-extension-math';
import type { Construct } from 'micromark-util-types';
sqxK/**
 * @import {Options} from 'micromark-extension-math'
 * @import {Construct, Previous, Resolver, State, Token, TokenizeContext, Tokenizer} from 'micromark-util-types'
 */

// To do: next major: clean spaces in HTML compiler.
// This has to be coordinated together with `mdast-util-math`.

import {ok as assert} from 'devlop'
import {markdownLineEnding} from 'micromark-util-character'
import {codes, types} from 'micromark-util-symbol'

/**
 * @param {Options | null | undefined} [options={}]
 *   Configuration (default: `{}`).
 * @returns {Construct}
 *   Construct.
 */
export function mathText(options) {
  const options_ = options || {}
  let single = options_.singleDollarTextMath

  if (single === null || single === undefined) {
    single = true
  }

  return {
    tokenize: tokenizeMathText,
    resolve: resolveMathText,
    previous,
    name: 'mathText'
  }

  /**
   * @this {TokenizeContext}
   * @type {Tokenizer}
   */
  function tokenizeMathText(effects, ok, nok) {
    const self = this
    let sizeOpen = 0
    /** @type {number} */
    let size
    /** @type {Token} */
    let token

    return start

    /**
     * Start of math (text).
     *
     * ```markdown
     * > | $a$
     *     ^
     * > | \$a$
     *      ^
     * ```
     *
     * @type {State}
     */
    function start(code) {
      assert(code === codes.dollarSign, 'expected `$`')
      assert(previous.call(self, self.previous), 'expected correct previous')
      effects.enter('mathText')
      effects.enter('mathTextSequence')
      return sequenceOpen(code)
    }

    /**
     * In opening sequence.
     *
     * ```markdown
     * > | $a$
     *     ^
     * ```
     *
     * @type {State}
     */

    function sequenceOpen(code) {
      if (code === codes.dollarSign) {
        effects.consume(code)
        sizeOpen++
        return sequenceOpen
      }

      // Not enough markers in the sequence.
      if (sizeOpen < 2 && !single) {
        return nok(code)
      }

      effects.exit('mathTextSequence')
      return between(code)
    }

    /**
     * Between something and something else.
     *
     * ```markdown
     * > | $a$
     *      ^^
     * ```
     *
     * @type {State}
     */
    function between(code) {
      if (code === codes.eof) {
        return nok(code)
      }

      if (code === codes.dollarSign) {
        token = effects.enter('mathTextSequence')
        size = 0
        return sequenceClose(code)
      }

      // Tabs don’t work, and virtual spaces don’t make sense.
      if (code === codes.space) {
        effects.enter('space')
        effects.consume(code)
        effects.exit('space')
        return between
      }

      if (markdownLineEnding(code)) {
        effects.enter(types.lineEnding)
        effects.consume(code)
        effects.exit(types.lineEnding)
        return between
      }

      // Data.
      effects.enter('mathTextData')
      return data(code)
    }

    /**
     * In data.
     *
     * ```markdown
     * > | $a$
     *      ^
     * ```
     *
     * @type {State}
     */
    function data(code) {
      if (
        code === codes.eof ||
        code === codes.space ||
        code === codes.dollarSign ||
        markdownLineEnding(code)
      ) {
        effects.exit('mathTextData')
        return between(code)
      }

      effects.consume(code)
      return data
    }

    /**
     * In closing sequence.
     *
     * ```markdown
     * > | `a`
     *       ^
     * ```
     *
     * @type {State}
     */

    function sequenceClose(code) {
      // More.
      if (code === codes.dollarSign) {
        effects.consume(code)
        size++
        return sequenceClose
      }

      // Done!
      if (size === sizeOpen) {
        effects.exit('mathTextSequence')
        effects.exit('mathText')
        return ok(code)
      }

      // More or less accents: mark as data.
      token.type = 'mathTextData'
      return data(code)
    }
  }
}

/** @type {Resolver} */
function resolveMathText(events) {
  let tailExitIndex = events.length - 4
  let headEnterIndex = 3
  /** @type {number} */
  let index
  /** @type {number | undefined} */
  let enter

  // If we start and end with an EOL or a space.
  if (
    (events[headEnterIndex][1].type === types.lineEnding ||
      events[headEnterIndex][1].type === 'space') &&
    (events[tailExitIndex][1].type === types.lineEnding ||
      events[tailExitIndex][1].type === 'space')
  ) {
    index = headEnterIndex

    // And we have data.
    while (++index < tailExitIndex) {
      if (events[index][1].type === 'mathTextData') {
        // Then we have padding.
        events[tailExitIndex][1].type = 'mathTextPadding'
        events[headEnterIndex][1].type = 'mathTextPadding'
        headEnterIndex += 2
        tailExitIndex -= 2
        break
      }
    }
  }

  // Merge adjacent spaces and data.
  index = headEnterIndex - 1
  tailExitIndex++

  while (++index <= tailExitIndex) {
    if (enter === undefined) {
      if (
        index !== tailExitIndex &&
        events[index][1].type !== types.lineEnding
      ) {
        enter = index
      }
    } else if (
      index === tailExitIndex ||
      events[index][1].type === types.lineEnding
    ) {
      events[enter][1].type = 'mathTextData'

      if (index !== enter + 2) {
        events[enter][1].end = events[index - 1][1].end
        events.splice(enter + 2, index - enter - 2)
        tailExitIndex -= index - enter - 2
        index = enter + 2
      }

      enter = undefined
    }
  }

  return events
}

/**
 * @this {TokenizeContext}
 * @type {Previous}
 */
function previous(code) {
  // If there is a previous code, there will always be a tail.
  return (
    code !== codes.dollarSign ||
    this.events[this.events.length - 1][1].type === types.characterEscape
  )
}
j,xR 5matES (default: `{}`)l$math syntax.
 */
export function matAfmat;)xl/**
 * @import {Options} from 'micromark-extension-math'
 * @import {Extension} from 'micromark-util-types'
 */

import {codes} from 'micromark-util-symbol'
import {mathFlow} from './math-flow.js'
import {mathText} from './math-text.js'

/**
 * Create an extension for `micromark` to enable math syntax.
 *
 * @param {Options | null | undefined} [options={}]
 *   Configuration (default: `{}`).
 * @returns {Extension}
 *   Extension for `micromark` that can be passed in `extensions`, to
 *   enable math syntax.
 */
export function math(options) {
  return {
    flow: {[codes.dollarSign]: mathFlow},
    text: {[codes.dollarSign]: mathText(options)}
  }
}
OZ{x| // Note: types exported from `index.d.ts`.
export { math } from './lib/syntax.js';
export { mathHtml } from './lib/html.js';*x8100644 html.d.ts 0 a8YRo?w100644 html.js F} ob2<:ELK100644 math-flow.d.ts 01E9E#w[Q100644 math-flow.js djq<D󱲔ʅӣ100644 math-text.d.ts IAD$(@"=ud100644 math-text.js #/c?fIsߍݝY100644 syntax.d.ts 5d4e5A]F100644 syntax.js g+;"_#OyxC/**
 * @import {HtmlOptions as Options} from 'micromark-extension-math'
 * @import {HtmlExtension} from 'micromark-util-types'
 */

import katex from 'katex';
const renderToString = katex.renderToString;

/**
 * Create an extension for `micromark` to support math when serializing to
 * HTML.
 *
 * > 👉 **Note**: this uses KaTeX to render math.
 *
 * @param {Options | null | undefined} [options={}]
 *   Configuration (default: `{}`).
 * @returns {HtmlExtension}
 *   Extension for `micromark` that can be passed in `htmlExtensions`, to
 *   support math when serializing to HTML.
 */
export function mathHtml(options) {
  return {
    enter: {
      mathFlow() {
        this.lineEndingIfNeeded();
        this.tag('<div class="math math-display">');
      },
      mathFlowFenceMeta() {
        this.buffer();
      },
      mathText() {
        // Double?
        this.tag('<span class="math math-inline">');
        this.buffer();
      }
    },
    exit: {
      mathFlow() {
        const value = this.resume();
        this.tag(math(value.replace(/(?:\r?\n|\r)$/, ''), true));
        this.tag('</div>');
        this.setData('mathFlowOpen');
        this.setData('slurpOneLineEnding');
      },
      mathFlowFence() {
        // After the first fence.
        if (!this.getData('mathFlowOpen')) {
          this.setData('mathFlowOpen', true);
          this.setData('slurpOneLineEnding', true);
          this.buffer();
        }
      },
      mathFlowFenceMeta() {
        this.resume();
      },
      mathFlowValue(token) {
        this.raw(this.sliceSerialize(token));
      },
      mathText() {
        const value = this.resume();
        this.tag(math(value, false));
        this.tag('</span>');
      },
      mathTextData(token) {
        this.raw(this.sliceSerialize(token));
      }
    }
  };

  /**
   * @param {string} value
   *   Math text.
   * @param {boolean} displayMode
   *   Whether the math is in display mode.
   * @returns {string}
   *   HTML.
   */
  function math(value, displayMode) {
    return renderToString(value, {
      ...options,
      displayMode
    });
  }
}j}sXx{95g factorySpace  @;
import { markdownLineEnding } from 'micromark-util-character';L`;1X;};3;& tail && tail[1].type === "linePrefix"/) : 0;
  let sizeOpen = 0;
  return start;u');!');!
;;36;
      sizeOpen++;;
    }/;
    } 
;	 metaBefore, "whitespace")(code);!null&;
    }'_;
    effects.enter("chunkString", {
      contentType: "string"
    });
    return meta(code);knull3"chunkString");Q	;	<;
    }
    if (code === 36) {
      return nok(code);
    }?;
    return meta;qH
;$0;
    }
>nonLazyContinuation,~ after)(code);q{
      7
      partial: true
    }, after, contentStart)(code);FinitialSize ?}2beforeContentChunk, "linePrefix", initialSize + 1))(code);F&(Óafter(code);
    }BnonLazyContinuation,~ after)(code);
    }Value');;nullC;&;
    }?;;q;
A;
  }

  /*AqH;Ó	"beforeSequenceClose, "linePrefix",= ? undefined : 4);!;#
;!;36) {
        size++;
    @;
    Close;
      }J6	;
      }Q	;
  "whitespace")(code);null&I;
  ?!;
      }
      return nok(code);;
  return start;X$f<(;
    }
    effects.enter("lineEnding");?!;
    effects.exit("lineEnding");?;T};
  }
}'Fwxd-*,6 markdownLineEnding } from 'micromark-util-character';;-;C;
  }p;j;;
    let size;-';
    return start;f˓;(;
A
;/36!;
        sizeOpen++;>Open;?t
;
      }
'Sequence');
      return between(code);null	;
      }	36$	5;
        size = 0;>(code);	`32space');;8
;	;
      }v
="lineEnding");%;
        effects.exit("lineEnding");; <;\;		&null || code === 32 || code === 36 || 
-;
;
      }

;
      return data;<36!;
        size++;>; oL;');;X;\;dp;
  let headEnterIndex = 3;} */
  let index;0;A9$"lineEnding" ||Q!$"lineEnding" || "Z;x;I;;
        headEnterIndex += 2;;
        break;U;
  tailExitIndex++;1Oindex !== tailExitIndex &&"lineEnding"Z;
      }
    } else if (index === tailExitIndex || events[index][1].type === "lineEnding"e0;Y;4;=;N	;
      }q;
    }
  }
  return events;code !== 36 ||g1"characterEscape";
}ScG&xi/**
 * @import {Options} from 'micromark-extension-math'
 * @import {Extension} from 'micromark-util-types'
 */

import { mathFlow } from './math-flow.js';
import { mathText } from './math-text.js';

/**
 * Create an extension for `micromark` to enable math syntax.
 *
 * @param {Options | null | undefined} [options={}]
 *   Configuration (default: `{}`).
 * @returns {Extension}
 *   Extension for `micromark` that can be passed in `extensions`, to
 *   enable math syntax.
 */
export function math(options) {
  return {
    flow: {
      [36]: mathFlow
    },
    text: {
      [36]: mathText(options)
    }
  };
}ݙ+x!math",
  "version": "3E8math (`$C_L$`)X)math",
    "katex",
    "latex",
    "tex8Umath?math=xU-Kdkatex": "^0.16.0",katex": "^0.16	9G

    ],	-logical-assignment-operators
	2at": "off"
    }
  }
}
	Kx0J# micromark-extension-math

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

[micromark][] extensions to support math (`$C_L$`).

## Contents

* [What is this?](#what-is-this)
* [When to use this](#when-to-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`math(options?)`](#mathoptions)
  * [`mathHtml(options?)`](#mathhtmloptions)
  * [`HtmlOptions`](#htmloptions)
  * [`Options`](#options)
* [Authoring](#authoring)
* [HTML](#html)
* [CSS](#css)
* [Syntax](#syntax)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package contains two extensions that add support for math syntax
in markdown to [`micromark`][micromark].

As there is no spec for math in markdown, this extension follows how code
(fenced and text) works in Commonmark, but uses dollars.

## When to use this

This project is useful when you want to support math in markdown.
Extending markdown with a syntax extension makes the markdown less portable.
LaTeX equations are also quite hard.
But this mechanism works well when you want authors, that have some LaTeX
experience, to be able to embed rich diagrams of math in scientific text.

You can use these extensions when you are working with [`micromark`][micromark]
already.

When you need a syntax tree, you can combine this package with
[`mdast-util-math`][mdast-util-math].

All these packages are used [`remark-math`][remark-math], which focusses on
making it easier to transform content by abstracting these internals away.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

[npm][]:

```sh
npm install micromark-extension-math
```

In Deno with [`esm.sh`][esmsh]:

```js
import {math, mathHtml} from 'https://esm.sh/micromark-extension-math@3'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {math, mathHtml} from 'https://esm.sh/micromark-extension-math@3?bundle'
</script>
```

## Use

Say our document `example.md` contains:

```markdown
Lift($L$) can be determined by Lift Coefficient ($C_L$) like the following equation.

$$
L = \frac{1}{2} \rho v^2 S C_L
$$
```

…and our module `example.js` looks as follows:

```js
import fs from 'node:fs/promises'
import {micromark} from 'micromark'
import {math, mathHtml} from 'micromark-extension-math'

const output = micromark(await fs.readFile('example.md'), {
  extensions: [math()],
  htmlExtensions: [mathHtml()]
})

console.log(output)
```

…now running `node example.js` yields (abbreviated):

```html
<p>Lift(<span class="math math-inline"><span class="katex">…</span></span>) can be determined by Lift Coefficient (<span class="math math-inline"><span class="katex">…</span></span>) like the following equation.</p>
<div class="math math-display"><span class="katex-display"><span class="katex">…</span></span></div>
```

## API

This package exports the identifiers [`math`][api-math] and
[`mathHtml`][api-math-html].
There is no default export.

The export map supports the [`development` condition][development].
Run `node --conditions development module.js` to get instrumented dev code.
Without this condition, production code is loaded.

### `math(options?)`

Create an extension for `micromark` to enable math syntax.

###### Parameters

* `options` ([`Options`][api-options], default: `{}`)
  — configuration

###### Returns

Extension for `micromark` that can be passed in `extensions`, to enable math
syntax ([`Extension`][micromark-extension]).

### `mathHtml(options?)`

Create an extension for `micromark` to support math when serializing to HTML.

> 👉 **Note**: this uses KaTeX to render math.

###### Parameters

* `options` ([`HtmlOptions`][api-html-options], default: `{}`)
  — configuration

###### Returns

Extension for `micromark` that can be passed in `htmlExtensions`, to support
math when serializing to HTML ([`HtmlExtension`][micromark-html-extension]).

### `HtmlOptions`

Configuration for HTML output (optional).

> 👉 **Note**: passed to [`katex.renderToString`][katex-options].
> `displayMode` is overwritten by this plugin, to `false` for math in text
> (inline), and `true` for math in flow (block).

###### Type

```ts
type Options = Omit<import('katex').KatexOptions, 'displayMode'>
```

### `Options`

Configuration (TypeScript type).

###### Fields

* `singleDollarTextMath` (`boolean`, default: `true`)
  — whether to support math (text, inline) with a single dollar.
  Single dollars work in Pandoc and many other places, but often interfere
  with “normal” dollars in text.
  If you turn this off, you use two or more dollars for text math.

## Authoring

When authoring markdown with math, keep in mind that math doesn’t work in most
places.
Notably, GitHub currently has a really weird crappy client-side regex-based
thing.
But on your own (math-heavy?) site it can be great!
You can use code (fenced) with an info string of `math` to improve this, as
that works in many places.

## HTML

Math (flow) does not relate to HTML elements.
`MathML`, which is sort of like SVG but for math, exists but it doesn’t work
well and isn’t widely supported.
Instead, this uses [KaTeX][], which generates MathML as a fallback but also
generates a bunch of divs and spans so math look pretty.
The KaTeX result is wrapped in `<div>` (for flow, block) and `<span>` (for text,
inline) elements, with two classes: `math` and either `math-display` or
`math-inline`.

When turning markdown into HTML, each line ending in math (text) is turned
into a space.

## CSS

The HTML produced by KaTeX requires CSS to render correctly.
You should use `katex.css` somewhere on the page where the math is shown to
style it properly.
At the time of writing, the last version is:

<!-- To do: update and copy paste the one from: https://katex.org/docs/browser -->

```html
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.16.11/dist/katex.min.css">
```

## Syntax

Math forms with the following BNF:

```bnf
; Restriction: the number of markers in the closing sequence must be equal
; to the number of markers in the opening sequence.
math_text ::= sequence_text 1*byte sequence_text
math_flow ::= fence_open *( eol *line ) [ eol fence_close ]

; Restriction: not preceded or followed by the marker.
sequence_text ::= 1*'$'

fence_open ::= sequence_flow meta
; Restriction: the number of markers in the closing fence sequence must be
; equal to or greater than the number of markers in the opening fence
; sequence.
fence_close ::= sequence_flow *space_or_tab
sequence_flow ::= 2*'$'
; Restriction: the marker cannot occur in `meta`
meta ::= 1*line

; Character groups for informational purposes.
byte ::= 0x00..=0xFFFF
eol ::= '\n' | '\r' | '\r\n'
line ::= byte - eol
```

The above grammar shows that it is not possible to create empty math (text).
It is possible to include the sequence marker (dollar) in math (text), by
wrapping it in bigger or smaller sequences:

```markdown
Include more: $a$$b$ or include less: $$a$b$$.
```

It is also possible to include just one marker:

```markdown
Include just one: $$ $ $$.
```

Sequences are “gready”, in that they cannot be preceded or followed by more
markers.
To illustrate:

```markdown
Not math: $$x$.

Not math: $x$$.

Escapes work, this is math: \$$x$.

Escapes work, this is math: $x$\$.
```

Yields:

```html
<p>Not math: $$x$.</p>
<p>Not math: $x$$.</p>
<p>Escapes work, this is math: $<span>…</span>.</p>
<p>Escapes work, this is math: <span>…</span>$.</p>
```

That is because, when turning markdown into HTML, the first and last space,
if both exist and there is also a non-space in the math, are removed.
Line endings, at that stage, are considered as spaces.

As the math (flow) construct occurs in flow, like all flow constructs, it must
be followed by an eol (line ending) or eof (end of file).

The above grammar does not show how indentation of each line is handled.
To parse math (flow), let `x` be the number of `space_or_tab` characters
before the opening fence sequence, after interpreting tabs based on how many
virtual spaces they represent.
Each line of text is then allowed (not required) to be indented with up
to `x` spaces or tabs, which are then ignored as an indent instead of being
considered as part of the content.
This indent does not affect the closing fence.
It can be indented up to a separate 3 real or virtual spaces.
A bigger indent makes it part of the content instead of a fence.

The `meta` part is interpreted as the [string][micromark-content-types] content
type.
That means that character escapes and character references are allowed.

The optional `meta` part is ignored: it is not used when parsing or
rendering.

## Types

This package is fully typed with [TypeScript][].
It exports the additional types [`HtmlOptions`][api-html-options]
and [`Options`][api-options].

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-extension-math@^3`, compatible with Node.js 16.

This package works with `micromark` version `3` and later.

## Security

This package is safe assuming that you trust KaTeX.
Any vulnerability in it could open you to a [cross-site scripting (XSS)][xss]
attack.

## Related

* [`remark-math`][remark-math]
  — remark (and rehype) plugins to support math
* [`mdast-util-math`][mdast-util-math]
  — mdast utility to support math

## Contribute

See [`contributing.md` in `micromark/.github`][contributing] for ways to get
started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organization, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/micromark/micromark-extension-math/workflows/main/badge.svg

[build]: https://github.com/micromark/micromark-extension-math/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark-extension-math.svg

[coverage]: https://codecov.io/github/micromark/micromark-extension-math

[downloads-badge]: https://img.shields.io/npm/dm/micromark-extension-math.svg

[downloads]: https://www.npmjs.com/package/micromark-extension-math

[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-extension-math

[size]: https://bundlejs.com/?q=micromark-extension-math

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[collective]: https://opencollective.com/unified

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/micromark/micromark/discussions

[npm]: https://docs.npmjs.com/cli/install

[esmsh]: https://esm.sh

[license]: license

[author]: https://wooorm.com

[contributing]: https://github.com/micromark/.github/blob/main/contributing.md

[support]: https://github.com/micromark/.github/blob/main/support.md

[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[typescript]: https://www.typescriptlang.org

[development]: https://nodejs.org/api/packages.html#packages_resolving_user_conditions

[micromark]: https://github.com/micromark/micromark

[micromark-content-types]: https://github.com/micromark/micromark#content-types

[micromark-html-extension]: https://github.com/micromark/micromark#htmlextension

[micromark-extension]: https://github.com/micromark/micromark#syntaxextension

[mdast-util-math]: https://github.com/syntax-tree/mdast-util-math

[remark-math]: https://github.com/remarkjs/remark-math

[katex]: https://katex.org

[katex-options]: https://katex.org/docs/options.html

[xss]: https://en.wikipedia.org/wiki/Cross-site_scripting

[api-math]: #mathoptions

[api-math-html]: #mathhtmloptions

[api-options]: #options

[api-html-options]: #htmloptions
?`6x40000 dev 2!Zm|HҲVa100644 index.d.ts ^Z/.j*\100644 index.d.ts.map tnDBr$>eqG100644 index.js  !)
pEKN100644 license Zbv8f,Q)100644 package.json cimɚ_vk100644 readme.md tU4F})D.lhפxt 100644 index.d.ts ^Z/.j*\100644 index.d.ts.map tnDBr$>eqG100644 index.js o
	=`,.KxO/**
 * Parse destinations.
 *
 * ###### Examples
 *
 * ```markdown
 * <a>
 * <a\>b>
 * <a b>
 * <a)>
 * a
 * a\)b
 * a(b)c
 * a(b)
 * ```
 *
 * @param {Effects} effects
 *   Context.
 * @param {State} ok
 *   State switched to when successful.
 * @param {State} nok
 *   State switched to when unsuccessful.
 * @param {TokenType} type
 *   Type for whole (`<a>` or `b`).
 * @param {TokenType} literalType
 *   Type when enclosed (`<a>`).
 * @param {TokenType} literalMarkerType
 *   Type for enclosing (`<` and `>`).
 * @param {TokenType} rawType
 *   Type when not enclosed (`b`).
 * @param {TokenType} stringType
 *   Type for the value (`a` or `b`).
 * @param {number | undefined} [max=Infinity]
 *   Depth of nested parens (inclusive).
 * @returns {State}
 *   Start state.
 */
export function factoryDestination(effects: Effects, ok: State, nok: State, type: TokenType, literalType: TokenType, literalMarkerType: TokenType, rawType: TokenType, stringType: TokenType, max?: number | undefined): State;
import type { Effects } from 'micromark-util-types';
import type { State } from 'micromark-util-types';
import type { TokenType } from 'micromark-util-types';
//# sourceMappingURL=index.d.ts.map.x7{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,4CArBW,OAAO,MAEP,KAAK,OAEL,KAAK,QAEL,SAAS,eAET,SAAS,qBAET,SAAS,WAET,SAAS,cAET,SAAS,QAET,MAAM,GAAG,SAAS,GAEhB,KAAK,CAiNjB;6BA7P2C,sBAAsB;2BAAtB,sBAAsB;+BAAtB,sBAAsB"}XCxW/**
 * @import {Effects, State, TokenType} from 'micromark-util-types'
 */

import {
  asciiControl,
  markdownLineEndingOrSpace,
  markdownLineEnding
} from 'micromark-util-character'
import {codes, constants, types} from 'micromark-util-symbol'

/**
 * Parse destinations.
 *
 * ###### Examples
 *
 * ```markdown
 * <a>
 * <a\>b>
 * <a b>
 * <a)>
 * a
 * a\)b
 * a(b)c
 * a(b)
 * ```
 *
 * @param {Effects} effects
 *   Context.
 * @param {State} ok
 *   State switched to when successful.
 * @param {State} nok
 *   State switched to when unsuccessful.
 * @param {TokenType} type
 *   Type for whole (`<a>` or `b`).
 * @param {TokenType} literalType
 *   Type when enclosed (`<a>`).
 * @param {TokenType} literalMarkerType
 *   Type for enclosing (`<` and `>`).
 * @param {TokenType} rawType
 *   Type when not enclosed (`b`).
 * @param {TokenType} stringType
 *   Type for the value (`a` or `b`).
 * @param {number | undefined} [max=Infinity]
 *   Depth of nested parens (inclusive).
 * @returns {State}
 *   Start state.
 */
export function factoryDestination(
  effects,
  ok,
  nok,
  type,
  literalType,
  literalMarkerType,
  rawType,
  stringType,
  max
) {
  const limit = max || Number.POSITIVE_INFINITY
  let balance = 0

  return start

  /**
   * Start of destination.
   *
   * ```markdown
   * > | <aa>
   *     ^
   * > | aa
   *     ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    if (code === codes.lessThan) {
      effects.enter(type)
      effects.enter(literalType)
      effects.enter(literalMarkerType)
      effects.consume(code)
      effects.exit(literalMarkerType)
      return enclosedBefore
    }

    // ASCII control, space, closing paren.
    if (
      code === codes.eof ||
      code === codes.space ||
      code === codes.rightParenthesis ||
      asciiControl(code)
    ) {
      return nok(code)
    }

    effects.enter(type)
    effects.enter(rawType)
    effects.enter(stringType)
    effects.enter(types.chunkString, {contentType: constants.contentTypeString})
    return raw(code)
  }

  /**
   * After `<`, at an enclosed destination.
   *
   * ```markdown
   * > | <aa>
   *      ^
   * ```
   *
   * @type {State}
   */
  function enclosedBefore(code) {
    if (code === codes.greaterThan) {
      effects.enter(literalMarkerType)
      effects.consume(code)
      effects.exit(literalMarkerType)
      effects.exit(literalType)
      effects.exit(type)
      return ok
    }

    effects.enter(stringType)
    effects.enter(types.chunkString, {contentType: constants.contentTypeString})
    return enclosed(code)
  }

  /**
   * In enclosed destination.
   *
   * ```markdown
   * > | <aa>
   *      ^
   * ```
   *
   * @type {State}
   */
  function enclosed(code) {
    if (code === codes.greaterThan) {
      effects.exit(types.chunkString)
      effects.exit(stringType)
      return enclosedBefore(code)
    }

    if (
      code === codes.eof ||
      code === codes.lessThan ||
      markdownLineEnding(code)
    ) {
      return nok(code)
    }

    effects.consume(code)
    return code === codes.backslash ? enclosedEscape : enclosed
  }

  /**
   * After `\`, at a special character.
   *
   * ```markdown
   * > | <a\*a>
   *        ^
   * ```
   *
   * @type {State}
   */
  function enclosedEscape(code) {
    if (
      code === codes.lessThan ||
      code === codes.greaterThan ||
      code === codes.backslash
    ) {
      effects.consume(code)
      return enclosed
    }

    return enclosed(code)
  }

  /**
   * In raw destination.
   *
   * ```markdown
   * > | aa
   *     ^
   * ```
   *
   * @type {State}
   */
  function raw(code) {
    if (
      !balance &&
      (code === codes.eof ||
        code === codes.rightParenthesis ||
        markdownLineEndingOrSpace(code))
    ) {
      effects.exit(types.chunkString)
      effects.exit(stringType)
      effects.exit(rawType)
      effects.exit(type)
      return ok(code)
    }

    if (balance < limit && code === codes.leftParenthesis) {
      effects.consume(code)
      balance++
      return raw
    }

    if (code === codes.rightParenthesis) {
      effects.consume(code)
      balance--
      return raw
    }

    // ASCII control (but *not* `\0`) and space and `(`.
    // Note: in `markdown-rs`, `\0` exists in codes, in `micromark-js` it
    // doesn’t.
    if (
      code === codes.eof ||
      code === codes.space ||
      code === codes.leftParenthesis ||
      asciiControl(code)
    ) {
      return nok(code)
    }

    effects.consume(code)
    return code === codes.backslash ? rawEscape : raw
  }

  /**
   * After `\`, at special character.
   *
   * ```markdown
   * > | a\*a
   *       ^
   * ```
   *
   * @type {State}
   */
  function rawEscape(code) {
    if (
      code === codes.leftParenthesis ||
      code === codes.rightParenthesis ||
      code === codes.backslash
    ) {
      effects.consume(code)
      return raw
    }

    return raw(code)
  }
}
ؾx./**
 * @import {Effects, State, TokenType} from 'micromark-util-types'
 */

import { asciiControl, markdownLineEndingOrSpace, markdownLineEnding } from 'micromark-util-character';
/**
 * Parse destinations.
 *
 * ###### Examples
 *
 * ```markdown
 * <a>
 * <a\>b>
 * <a b>
 * <a)>
 * a
 * a\)b
 * a(b)c
 * a(b)
 * ```
 *
 * @param {Effects} effects
 *   Context.
 * @param {State} ok
 *   State switched to when successful.
 * @param {State} nok
 *   State switched to when unsuccessful.
 * @param {TokenType} type
 *   Type for whole (`<a>` or `b`).
 * @param {TokenType} literalType
 *   Type when enclosed (`<a>`).
 * @param {TokenType} literalMarkerType
 *   Type for enclosing (`<` and `>`).
 * @param {TokenType} rawType
 *   Type when not enclosed (`b`).
 * @param {TokenType} stringType
 *   Type for the value (`a` or `b`).
 * @param {number | undefined} [max=Infinity]
 *   Depth of nested parens (inclusive).
 * @returns {State}
 *   Start state.
 */
export function factoryDestination(effects, ok, nok, type, literalType, literalMarkerType, rawType, stringType, max) {
  const limit = max || Number.POSITIVE_INFINITY;
  let balance = 0;
  return start;

  /**
   * Start of destination.
   *
   * ```markdown
   * > | <aa>
   *     ^
   * > | aa
   *     ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    if (code === 60) {
      effects.enter(type);
      effects.enter(literalType);
      effects.enter(literalMarkerType);
      effects.consume(code);
      effects.exit(literalMarkerType);
      return enclosedBefore;
    }

    // ASCII control, space, closing paren.
    if (code === null || code === 32 || code === 41 || asciiControl(code)) {
      return nok(code);
    }
    effects.enter(type);
    effects.enter(rawType);
    effects.enter(stringType);
    effects.enter("chunkString", {
      contentType: "string"
    });
    return raw(code);
  }

  /**
   * After `<`, at an enclosed destination.
   *
   * ```markdown
   * > | <aa>
   *      ^
   * ```
   *
   * @type {State}
   */
  function enclosedBefore(code) {
    if (code === 62) {
      effects.enter(literalMarkerType);
      effects.consume(code);
      effects.exit(literalMarkerType);
      effects.exit(literalType);
      effects.exit(type);
      return ok;
    }
    effects.enter(stringType);
    effects.enter("chunkString", {
      contentType: "string"
    });
    return enclosed(code);
  }

  /**
   * In enclosed destination.
   *
   * ```markdown
   * > | <aa>
   *      ^
   * ```
   *
   * @type {State}
   */
  function enclosed(code) {
    if (code === 62) {
      effects.exit("chunkString");
      effects.exit(stringType);
      return enclosedBefore(code);
    }
    if (code === null || code === 60 || markdownLineEnding(code)) {
      return nok(code);
    }
    effects.consume(code);
    return code === 92 ? enclosedEscape : enclosed;
  }

  /**
   * After `\`, at a special character.
   *
   * ```markdown
   * > | <a\*a>
   *        ^
   * ```
   *
   * @type {State}
   */
  function enclosedEscape(code) {
    if (code === 60 || code === 62 || code === 92) {
      effects.consume(code);
      return enclosed;
    }
    return enclosed(code);
  }

  /**
   * In raw destination.
   *
   * ```markdown
   * > | aa
   *     ^
   * ```
   *
   * @type {State}
   */
  function raw(code) {
    if (!balance && (code === null || code === 41 || markdownLineEndingOrSpace(code))) {
      effects.exit("chunkString");
      effects.exit(stringType);
      effects.exit(rawType);
      effects.exit(type);
      return ok(code);
    }
    if (balance < limit && code === 40) {
      effects.consume(code);
      balance++;
      return raw;
    }
    if (code === 41) {
      effects.consume(code);
      balance--;
      return raw;
    }

    // ASCII control (but *not* `\0`) and space and `(`.
    // Note: in `markdown-rs`, `\0` exists in codes, in `micromark-js` it
    // doesn’t.
    if (code === null || code === 32 || code === 40 || asciiControl(code)) {
      return nok(code);
    }
    effects.consume(code);
    return code === 92 ? rawEscape : raw;
  }

  /**
   * After `\`, at special character.
   *
   * ```markdown
   * > | a\*a
   *       ^
   * ```
   *
   * @type {State}
   */
  function rawEscape(code) {
    if (code === 40 || code === 41 || code === 92) {
      effects.consume(code);
      return raw;
    }
    return raw(code);
  }
}QVxa{
  "name": "micromark-factory-destination",
  "version": "2.0.1",
  "description": "micromark factory to parse destinations (found in resources, definitions)",
  "license": "MIT",
  "keywords": [
    "micromark",
    "factory",
    "destination"
  ],
  "repository": "https://github.com/micromark/micromark/tree/main/packages/micromark-factory-destination",
  "bugs": "https://github.com/micromark/micromark/issues",
  "funding": [
    {
      "type": "GitHub Sponsors",
      "url": "https://github.com/sponsors/unifiedjs"
    },
    {
      "type": "OpenCollective",
      "url": "https://opencollective.com/unified"
    }
  ],
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "sideEffects": false,
  "type": "module",
  "files": [
    "dev/",
    "index.d.ts.map",
    "index.d.ts",
    "index.js"
  ],
  "exports": {
    "development": "./dev/index.js",
    "default": "./index.js"
  },
  "dependencies": {
    "micromark-util-character": "^2.0.0",
    "micromark-util-symbol": "^2.0.0",
    "micromark-util-types": "^2.0.0"
  },
  "scripts": {
    "build": "micromark-build"
  },
  "xo": {
    "envs": [
      "shared-node-browser"
    ],
    "prettier": true,
    "rules": {
      "max-params": "off",
      "unicorn/prefer-code-point": "off"
    }
  }
}
kPûxK# micromark-factory-destination

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][bundle-size-badge]][bundle-size]
[![Sponsors][sponsors-badge]][opencollective]
[![Backers][backers-badge]][opencollective]
[![Chat][chat-badge]][chat]

[micromark][] factory to parse destinations (found in resources, definitions).

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`factoryDestination(…)`](#factorydestination)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package exposes states to parse destinations.

## When should I use this?

This package is useful when you are making your own micromark extensions.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install micromark-factory-destination
```

In Deno with [`esm.sh`][esmsh]:

```js
import {factoryDestination} from 'https://esm.sh/micromark-factory-destination@1'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {factoryDestination} from 'https://esm.sh/micromark-factory-destination@1?bundle'
</script>
```

## Use

```js
import {factoryDestination} from 'micromark-factory-destination'
import {codes, types} from 'micromark-util-symbol'

// A micromark tokenizer that uses the factory:
/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeResource(effects, ok, nok) {
  return start

  // …

  /** @type {State} */
  function open(code) {
    if (code === codes.rightParenthesis) {
      return end(code)
    }

    return factoryDestination(
      effects,
      destinationAfter,
      nok,
      types.resourceDestination,
      types.resourceDestinationLiteral,
      types.resourceDestinationLiteralMarker,
      types.resourceDestinationRaw,
      types.resourceDestinationString,
      constants.linkResourceDestinationBalanceMax
    )(code)
  }

  // …
}
```

## API

This module exports the identifier
[`factoryDestination`][api-factory-destination].
There is no default export.

### `factoryDestination(…)`

Parse destinations.

###### Examples

```markdown
<a>
<a\>b>
<a b>
<a)>
a
a\)b
a(b)c
a(b)
```

###### Parameters

* `effects` (`Effects`)
  — context
* `ok` (`State`)
  — state switched to when successful
* `nok` (`State`)
  — state switched to when unsuccessful
* `type` (`string`)
  — type for whole (`<a>` or `b`)
* `literalType` (`string`)
  — type when enclosed (`<a>`)
* `literalMarkerType` (`string`)
  — type for enclosing (`<` and `>`)
* `rawType` (`string`)
  — type when not enclosed (`b`)
* `stringType` (`string`)
  — type for the value (`a` or `b`)
* `max` (`number`, default: `Infinity`)
  — depth of nested parens (inclusive)

###### Returns

Start state (`State`).

## Types

This package is fully typed with [TypeScript][].
It exports no additional types.

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-factory-destination@2`, compatible with Node.js 16.
This package works with `micromark@3`.

## Security

This package is safe.
See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
submit a security report.

## Contribute

See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg

[build]: https://github.com/micromark/micromark/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg

[coverage]: https://codecov.io/github/micromark/micromark

[downloads-badge]: https://img.shields.io/npm/dm/micromark-factory-destination.svg

[downloads]: https://www.npmjs.com/package/micromark-factory-destination

[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-factory-destination

[bundle-size]: https://bundlejs.com/?q=micromark-factory-destination

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[opencollective]: https://opencollective.com/unified

[npm]: https://docs.npmjs.com/cli/install

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/micromark/micromark/discussions

[license]: https://github.com/micromark/micromark/blob/main/license

[author]: https://wooorm.com

[health]: https://github.com/micromark/.github

[securitymd]: https://github.com/micromark/.github/blob/main/security.md

[contributing]: https://github.com/micromark/.github/blob/main/contributing.md

[support]: https://github.com/micromark/.github/blob/main/support.md

[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md

[typescript]: https://www.typescriptlang.org

[micromark]: https://github.com/micromark/micromark

[api-factory-destination]: #factorydestination
߁x40000 dev SOn{/	\$x100644 index.d.ts Bp\}>Iں^G100644 index.d.ts.map -%`xUit100644 index.js &@b@W_100644 license Zbv8f,Q)100644 package.json m&P#C93100644 readme.md 5d)j!{MR׌yOfgxt 100644 index.d.ts Bp\}>Iں^G100644 index.d.ts.map -%`xUit100644 index.js $/顢L\_nUf)<.Cx?/**
 * Parse spaces and tabs.
 *
 * There is no `nok` parameter:
 *
 * *   spaces in markdown are often optional, in which case this factory can be
 *     used and `ok` will be switched to whether spaces were found or not
 * *   one line ending or space can be detected with `markdownSpace(code)` right
 *     before using `factorySpace`
 *
 * ###### Examples
 *
 * Where `␉` represents a tab (plus how much it expands) and `␠` represents a
 * single space.
 *
 * ```markdown
 * ␉
 * ␠␠␠␠
 * ␉␠
 * ```
 *
 * @param {Effects} effects
 *   Context.
 * @param {State} ok
 *   State switched to when successful.
 * @param {TokenType} type
 *   Type (`' \t'`).
 * @param {number | undefined} [max=Infinity]
 *   Max (exclusive).
 * @returns {State}
 *   Start state.
 */
export function factorySpace(effects: Effects, ok: State, type: TokenType, max?: number | undefined): State;
import type { Effects } from 'micromark-util-types';
import type { State } from 'micromark-util-types';
import type { TokenType } from 'micromark-util-types';
//# sourceMappingURL=index.d.ts.mapoLxj/**
 * Parse labels.
 *
 * > 👉 **Note**: labels in markdown are capped at 999 characters in the string.Qd```markdown
 * [a]
 * [a
 * b]
 * [a\]b]
 * ```
 *
 * @this {TokenizeContext}
 *   Tokenize context.
sState} nGunf1of the whole label (`[a]`)p2markerType
 *   Type for the markers (`[` and `]`)p,stringType
 *   Type for the identifier (`a`DLabel(this: TokenizeContext, -n?*rkerType: TokenType, stringType: TokenTypes
izeContextCĝѳx{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,6DAfW,OAAO,MAEP,KAAK,OAEL,KAAK,QAEL,SAAS,cAET,SAAS,cAET,SAAS,GAEP,KAAK,CAkIjB;6BArKS,sBAAsB;2BAAtB,sBAAsB;+BAAtB,sBAAsB;qCAAtB,sBAAsB"}Ooxg/**
 * @import {
 *   Effects,
 *   State,
 *   TokenizeContext,
 *   TokenType
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {markdownLineEnding, markdownSpace} from 'micromark-util-character'
import {codes, constants, types} from 'micromark-util-symbol'

/**
 * Parse labels.
 *
 * > 👉 **Note**: labels in markdown are capped at 999 characters in the string.
 *
 * ###### Examples
 *
 * ```markdown
 * [a]
 * [a
 * b]
 * [a\]b]
 * ```
 *
 * @this {TokenizeContext}
 *   Tokenize context.
 * @param {Effects} effects
 *   Context.
 * @param {State} ok
 *   State switched to when successful.
 * @param {State} nok
 *   State switched to when unsuccessful.
 * @param {TokenType} type
 *   Type of the whole label (`[a]`).
 * @param {TokenType} markerType
 *   Type for the markers (`[` and `]`).
 * @param {TokenType} stringType
 *   Type for the identifier (`a`).
 * @returns {State}
 *   Start state.
 */
export function factoryLabel(effects, ok, nok, type, markerType, stringType) {
  const self = this
  let size = 0
  /** @type {boolean} */
  let seen

  return start

  /**
   * Start of label.
   *
   * ```markdown
   * > | [a]
   *     ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    assert(code === codes.leftSquareBracket, 'expected `[`')
    effects.enter(type)
    effects.enter(markerType)
    effects.consume(code)
    effects.exit(markerType)
    effects.enter(stringType)
    return atBreak
  }

  /**
   * In label, at something, before something else.
   *
   * ```markdown
   * > | [a]
   *      ^
   * ```
   *
   * @type {State}
   */
  function atBreak(code) {
    if (
      size > constants.linkReferenceSizeMax ||
      code === codes.eof ||
      code === codes.leftSquareBracket ||
      (code === codes.rightSquareBracket && !seen) ||
      // To do: remove in the future once we’ve switched from
      // `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,
      // which doesn’t need this.
      // Hidden footnotes hook.
      /* c8 ignore next 3 */
      (code === codes.caret &&
        !size &&
        '_hiddenFootnoteSupport' in self.parser.constructs)
    ) {
      return nok(code)
    }

    if (code === codes.rightSquareBracket) {
      effects.exit(stringType)
      effects.enter(markerType)
      effects.consume(code)
      effects.exit(markerType)
      effects.exit(type)
      return ok
    }

    // To do: indent? Link chunks and EOLs together?
    if (markdownLineEnding(code)) {
      effects.enter(types.lineEnding)
      effects.consume(code)
      effects.exit(types.lineEnding)
      return atBreak
    }

    effects.enter(types.chunkString, {contentType: constants.contentTypeString})
    return labelInside(code)
  }

  /**
   * In label, in text.
   *
   * ```markdown
   * > | [a]
   *      ^
   * ```
   *
   * @type {State}
   */
  function labelInside(code) {
    if (
      code === codes.eof ||
      code === codes.leftSquareBracket ||
      code === codes.rightSquareBracket ||
      markdownLineEnding(code) ||
      size++ > constants.linkReferenceSizeMax
    ) {
      effects.exit(types.chunkString)
      return atBreak(code)
    }

    effects.consume(code)
    if (!seen) seen = !markdownSpace(code)
    return code === codes.backslash ? labelEscape : labelInside
  }

  /**
   * After `\`, at a special character.
   *
   * ```markdown
   * > | [a\*a]
   *        ^
   * ```
   *
   * @type {State}
   */
  function labelEscape(code) {
    if (
      code === codes.leftSquareBracket ||
      code === codes.backslash ||
      code === codes.rightSquareBracket
    ) {
      effects.consume(code)
      size++
      return labelInside
    }

    return labelInside(code)
  }
}
	xu/**
 * @import {
 *   Effects,
 *   State,
 *   TokenizeContext,
 *   TokenType
 * } from 'micromark-util-types'
 */

import { markdownLineEnding, markdownSpace } from 'micromark-util-character';
/**
 * Parse labels.
 *
 * > 👉 **Note**: labels in markdown are capped at 999 characters in the string.
 *
 * ###### Examples
 *
 * ```markdown
 * [a]
 * [a
 * b]
 * [a\]b]
 * ```
 *
 * @this {TokenizeContext}
 *   Tokenize context.
 * @param {Effects} effects
 *   Context.
 * @param {State} ok
 *   State switched to when successful.
 * @param {State} nok
 *   State switched to when unsuccessful.
 * @param {TokenType} type
 *   Type of the whole label (`[a]`).
 * @param {TokenType} markerType
 *   Type for the markers (`[` and `]`).
 * @param {TokenType} stringType
 *   Type for the identifier (`a`).
 * @returns {State}
 *   Start state.
 */
export function factoryLabel(effects, ok, nok, type, markerType, stringType) {
  const self = this;
  let size = 0;
  /** @type {boolean} */
  let seen;
  return start;

  /**
   * Start of label.
   *
   * ```markdown
   * > | [a]
   *     ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    effects.enter(type);
    effects.enter(markerType);
    effects.consume(code);
    effects.exit(markerType);
    effects.enter(stringType);
    return atBreak;
  }

  /**
   * In label, at something, before something else.
   *
   * ```markdown
   * > | [a]
   *      ^
   * ```
   *
   * @type {State}
   */
  function atBreak(code) {
    if (size > 999 || code === null || code === 91 || code === 93 && !seen ||
    // To do: remove in the future once we’ve switched from
    // `micromark-extension-footnote` to `micromark-extension-gfm-footnote`,
    // which doesn’t need this.
    // Hidden footnotes hook.
    /* c8 ignore next 3 */
    code === 94 && !size && '_hiddenFootnoteSupport' in self.parser.constructs) {
      return nok(code);
    }
    if (code === 93) {
      effects.exit(stringType);
      effects.enter(markerType);
      effects.consume(code);
      effects.exit(markerType);
      effects.exit(type);
      return ok;
    }

    // To do: indent? Link chunks and EOLs together?
    if (markdownLineEnding(code)) {
      effects.enter("lineEnding");
      effects.consume(code);
      effects.exit("lineEnding");
      return atBreak;
    }
    effects.enter("chunkString", {
      contentType: "string"
    });
    return labelInside(code);
  }

  /**
   * In label, in text.
   *
   * ```markdown
   * > | [a]
   *      ^
   * ```
   *
   * @type {State}
   */
  function labelInside(code) {
    if (code === null || code === 91 || code === 93 || markdownLineEnding(code) || size++ > 999) {
      effects.exit("chunkString");
      return atBreak(code);
    }
    effects.consume(code);
    if (!seen) seen = !markdownSpace(code);
    return code === 92 ? labelEscape : labelInside;
  }

  /**
   * After `\`, at a special character.
   *
   * ```markdown
   * > | [a\*a]
   *        ^
   * ```
   *
   * @type {State}
   */
  function labelEscape(code) {
    if (code === 91 || code === 92 || code === 93) {
      effects.consume(code);
      size++;
      return labelInside;
    }
    return labelInside(code);
  }
}
ֵ[xJ{
  "name": "micromark-factory-label",
  "version": "2.0.1",
  "description": "micromark factory to parse labels (found in media, definitions)",
  "license": "MIT",
  "keywords": [
    "micromark",
    "factory",
    "label"
  ],
  "repository": "https://github.com/micromark/micromark/tree/main/packages/micromark-factory-label",
  "bugs": "https://github.com/micromark/micromark/issues",
  "funding": [
    {
      "type": "GitHub Sponsors",
      "url": "https://github.com/sponsors/unifiedjs"
    },
    {
      "type": "OpenCollective",
      "url": "https://opencollective.com/unified"
    }
  ],
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "sideEffects": false,
  "type": "module",
  "files": [
    "dev/",
    "index.d.ts.map",
    "index.d.ts",
    "index.js"
  ],
  "exports": {
    "development": "./dev/index.js",
    "default": "./index.js"
  },
  "dependencies": {
    "devlop": "^1.0.0",
    "micromark-util-character": "^2.0.0",
    "micromark-util-symbol": "^2.0.0",
    "micromark-util-types": "^2.0.0"
  },
  "scripts": {
    "build": "micromark-build"
  },
  "xo": {
    "envs": [
      "shared-node-browser"
    ],
    "prettier": true,
    "rules": {
      "logical-assignment-operators": "off",
      "max-params": "off",
      "unicorn/no-this-assignment": "off",
      "unicorn/prefer-code-point": "off"
    }
  }
}
xU	k*# micromark-factory-labe)~bundle-size-badge]][bundle-$open(open75factory to parse labels (found in media, definitions)j9"should I use this?](#when-should-iC!factoryLabel(…)`](#factorylabelQ"Oexposes states to parse labels.

## When should I use this?

This package is useful when you are making your own micromark exte/s	}factory-labe"
6factoryLabe
"factory-label@1
UfactoryLabe
"factory-label@1.ok as assert} from 'devlop'
import {factoryLabel} from 'micromark-factory-label'
import {codes, types} from 'micromark-util-symbol'

// A micromark tokenizer that uses the factory:
/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeDefinition(effects, ok, nok) {
  return start

  // …

  /** @type {State} */
  function start(code) {
    assert(code === codes.leftSquareBracket, 'expected `[`')
    effects.enter(types.definition)
    return factoryLabel.call(
      self,
      effects,
      labelAfter,
      nok,
      types.definitionLabel,
      types.definitionLabelMarker,
      types.definitionLabelString
    )(code)
  }

  // …
}
```

## API

This module exports the identifier [`factoryLabel`][api-factory-labe!### `factoryLabel(…)`

Parse labels.

> 👉 **Note**: labels in markdown are capped at 999 characters in the string.

###### Examples

```markdown
[a]
[a
b]
[a\]b]
```

###### Parameters

* `this` (`TokenizeContext`)
  — tokenize context
* `effects` (`Effects`)
  — context
* `ok` (`State`)
  — state switched to when successful
* `nok` (`State`)
  — state switched to when unsuccessful
* `type` (`string`)
  — type of the whole label (`[a]`)
* `markerType` (`string`)
  — type for the markers (`[` and `]`)
* `stringType` (`string`)
  — type for the identifier (`a`)

###### Returns

Start state (`State`).

## Types
&[factory-label@' '"@3`'&eSee [`security.md`][securitymd] in [`micromark/.github`][health] for how to
submit a security report.)'A][contributing] in [`micromark/.github`][health] for ways
to get *s*+J+W`,?,=factory-labe-<factory-label

[bundle-siz+!-qfactory-label

[bundle-+.)factory-labeq.open/2/.1Kesmsh]: https://esm.sh

[chat+ [/alicense3O+/blob/main/
0(health30

[securitym+!^0security.md/0`1.	micromark3O+%

[api-factory-label]: #factorylabel
:x40000 dev vʐVDw/ltMA100644 index.d.ts ٣*§aH.Xԃ100644 index.d.ts.map B'5l0"SwX100644 index.js da-K<e<sv100644 license Zbv8f,Q)100644 package.json EI>cnMn ߮100644 readme.md v1̹$MK#7Zfxt 100644 index.d.ts ٣*§aH.Xԃ100644 index.d.ts.map B'5l0"SwX100644 index.js \X*i#Kh;.jx {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,sCAXW,OAAO,MAEP,KAAK,QAEL,SAAS,QAET,MAAM,GAAG,SAAS,GAEhB,KAAK,CA6BjB;6BAjE2C,sBAAsB;2BAAtB,sBAAsB;+BAAtB,sBAAsB"}Hұ^x/**
 * @import {Effects, State, TokenType} from 'micromark-util-types'
 */

import {markdownSpace} from 'micromark-util-character'

// To do: implement `spaceOrTab`, `spaceOrTabMinMax`, `spaceOrTabWithOptions`.

/**
 * Parse spaces and tabs.
 *
 * There is no `nok` parameter:
 *
 * *   spaces in markdown are often optional, in which case this factory can be
 *     used and `ok` will be switched to whether spaces were found or not
 * *   one line ending or space can be detected with `markdownSpace(code)` right
 *     before using `factorySpace`
 *
 * ###### Examples
 *
 * Where `␉` represents a tab (plus how much it expands) and `␠` represents a
 * single space.
 *
 * ```markdown
 * ␉
 * ␠␠␠␠
 * ␉␠
 * ```
 *
 * @param {Effects} effects
 *   Context.
 * @param {State} ok
 *   State switched to when successful.
 * @param {TokenType} type
 *   Type (`' \t'`).
 * @param {number | undefined} [max=Infinity]
 *   Max (exclusive).
 * @returns {State}
 *   Start state.
 */
export function factorySpace(effects, ok, type, max) {
  const limit = max ? max - 1 : Number.POSITIVE_INFINITY
  let size = 0

  return start

  /** @type {State} */
  function start(code) {
    if (markdownSpace(code)) {
      effects.enter(type)
      return prefix(code)
    }

    return ok(code)
  }

  /** @type {State} */
  function prefix(code) {
    if (markdownSpace(code) && size++ < limit) {
      effects.consume(code)
      return prefix
    }

    effects.exit(type)
    return ok(code)
  }
}
C'螺^x/**
 * @import {Effects, State, TokenType} from 'micromark-util-types'
 */

import { markdownSpace } from 'micromark-util-character';

// To do: implement `spaceOrTab`, `spaceOrTabMinMax`, `spaceOrTabWithOptions`.

/**
 * Parse spaces and tabs.
 *
 * There is no `nok` parameter:
 *
 * *   spaces in markdown are often optional, in which case this factory can be
 *     used and `ok` will be switched to whether spaces were found or not
 * *   one line ending or space can be detected with `markdownSpace(code)` right
 *     before using `factorySpace`
 *
 * ###### Examples
 *
 * Where `␉` represents a tab (plus how much it expands) and `␠` represents a
 * single space.
 *
 * ```markdown
 * ␉
 * ␠␠␠␠
 * ␉␠
 * ```
 *
 * @param {Effects} effects
 *   Context.
 * @param {State} ok
 *   State switched to when successful.
 * @param {TokenType} type
 *   Type (`' \t'`).
 * @param {number | undefined} [max=Infinity]
 *   Max (exclusive).
 * @returns {State}
 *   Start state.
 */
export function factorySpace(effects, ok, type, max) {
  const limit = max ? max - 1 : Number.POSITIVE_INFINITY;
  let size = 0;
  return start;

  /** @type {State} */
  function start(code) {
    if (markdownSpace(code)) {
      effects.enter(type);
      return prefix(code);
    }
    return ok(code);
  }

  /** @type {State} */
  function prefix(code) {
    if (markdownSpace(code) && size++ < limit) {
      effects.consume(code);
      return prefix;
    }
    effects.exit(type);
    return ok(code);
  }
}?Vxk{
  "name": "micromark-factory-whitespace",
  "version": "2.0.1",
  "description": "micromark factory to parse markdown whitespace (found in lots of places)",
  "license": "MIT",
  "keywords": [
    "micromark",
    "factory",
    "whitespace"
  ],
  "repository": "https://github.com/micromark/micromark/tree/main/packages/micromark-factory-whitespace",
  "bugs": "https://github.com/micromark/micromark/issues",
  "funding": [
    {
      "type": "GitHub Sponsors",
      "url": "https://github.com/sponsors/unifiedjs"
    },
    {
      "type": "OpenCollective",
      "url": "https://opencollective.com/unified"
    }
  ],
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "sideEffects": false,
  "type": "module",
  "files": [
    "dev/",
    "index.d.ts.map",
    "index.d.ts",
    "index.js"
  ],
  "exports": {
    "development": "./dev/index.js",
    "default": "./index.js"
  },
  "dependencies": {
    "micromark-factory-space": "^2.0.0",
    "micromark-util-character": "^2.0.0",
    "micromark-util-symbol": "^2.0.0",
    "micromark-util-types": "^2.0.0"
  },
  "scripts": {
    "build": "micromark-build"
  },
  "xo": {
    "envs": [
      "shared-node-browser"
    ],
    "prettier": true,
    "rules": {
      "unicorn/prefer-code-point": "off"
    }
  }
}
觤xx 

$T}ki[7/ާbx'# micromark-factory-space

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][bundle-size-badge]][bundle-size]
[![Sponsors][sponsors-badge]][opencollective]
[![Backers][backers-badge]][opencollective]
[![Chat][chat-badge]][chat]

[micromark][] factory to parse [markdown space][markdown-space] (found in lots
of places).

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`factorySpace(…)`](#factoryspace)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package exposes states to parse spaces and/or tabs.

## When should I use this?

This package is useful when you are making your own micromark extensions.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install micromark-factory-space
```

In Deno with [`esm.sh`][esmsh]:

```js
import {factorySpace} from 'https://esm.sh/micromark-factory-space@1'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {factorySpace} from 'https://esm.sh/micromark-factory-space@1?bundle'
</script>
```

## Use

```js
import {factorySpace} from 'micromark-factory-space'
import {codes, types} from 'micromark-util-symbol'

// A micromark tokenizer that uses the factory:
/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeCodeFenced(effects, ok, nok) {
  return start

  // …

  /** @type {State} */
  function info(code) {
    if (code === codes.eof || markdownLineEndingOrSpace(code)) {
      effects.exit(types.chunkString)
      effects.exit(types.codeFencedFenceInfo)
      return factorySpace(effects, infoAfter, types.whitespace)(code)
    }

    if (code === codes.graveAccent && code === marker) return nok(code)
    effects.consume(code)
    return info
  }

  // …
}
```

## API

This module exports the identifier [`factorySpace`][api-factory-space].
There is no default export.

### `factorySpace(…)`

Parse spaces and tabs.

There is no `nok` parameter:

* spaces in markdown are often optional, in which case this factory can be
  used and `ok` will be switched to whether spaces were found or not
* one line ending or space can be detected with `markdownSpace(code)` right
  before using `factorySpace`

###### Examples

Where `␉` represents a tab (plus how much it expands) and `␠` represents a
single space.

```markdown
␉
␠␠␠␠
␉␠
```

###### Parameters

* `effects` (`Effects`)
  — context
* `ok` (`State`)
  — state switched to when successful
* `type` (`string`)
  — type (`' \t'`)
* `max` (`number`, default: `Infinity`)
  — max (exclusive)

###### Returns

Start state (`State`).

## Types

This package is fully typed with [TypeScript][].
It exports no additional types.

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-factory-space@2`, compatible with Node.js 16.
This package works with `micromark@3`.

## Security

This package is safe.
See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
submit a security report.

## Contribute

See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg

[build]: https://github.com/micromark/micromark/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg

[coverage]: https://codecov.io/github/micromark/micromark

[downloads-badge]: https://img.shields.io/npm/dm/micromark-factory-space.svg

[downloads]: https://www.npmjs.com/package/micromark-factory-space

[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-factory-space

[bundle-size]: https://bundlejs.com/?q=micromark-factory-space

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[opencollective]: https://opencollective.com/unified

[npm]: https://docs.npmjs.com/cli/install

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/micromark/micromark/discussions

[license]: https://github.com/micromark/micromark/blob/main/license

[author]: https://wooorm.com

[health]: https://github.com/micromark/.github

[securitymd]: https://github.com/micromark/.github/blob/main/security.md

[contributing]: https://github.com/micromark/.github/blob/main/contributing.md

[support]: https://github.com/micromark/.github/blob/main/support.md

[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md

[markdown-space]: https://github.com/micromark/micromark/tree/main/packages/micromark-util-character#markdownspacecode

[typescript]: https://www.typescriptlang.org

[micromark]: https://github.com/micromark/micromark

[api-factory-space]: #factoryspace
fx40000 dev t6PD?9;g100644 index.d.ts mKKh*	,"yada100644 index.d.ts.map vl_U]	100644 index.js l{Jaֳ%}:z2100644 license Zbv8f,Q)100644 package.json CޣK!5#ua100644 readme.md Q޾WC/tQTEext 100644 index.d.ts mKKh*	,"yada100644 index.d.ts.map vl_U]	100644 index.js Gt!L8]M; +*xT/**
 * Parse titles.QF```markdown
 * "a"
 * 'b'
 * (c)
 * "a
 * b"
 * 'a
 *     b'
 * (a\)b)}State} nGunf1(of the whole title (`"a"`, `'b'`, `(c)`)p=markerType
 *   Type for the markers (`"`, `'`, `(`, and `)`)p'stringType
 *   Type for the value (`a`DTitl+n?*rkerType: TokenType, stringType: TokenTypešcx{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAaA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,sCAfW,OAAO,MAEP,KAAK,OAEL,KAAK,QAEL,SAAS,cAET,SAAS,cAET,SAAS,GAEP,KAAK,CA+HjB;6BAlKS,sBAAsB;2BAAtB,sBAAsB;+BAAtB,sBAAsB"}hK%x7/**
 * @import {
 *   Code,
 *   Effects,
 *   State,
 *   TokenType
 * } from 'micromark-util-types'
 */

import {factorySpace} from 'micromark-factory-space'
import {markdownLineEnding} from 'micromark-util-character'
import {codes, constants, types} from 'micromark-util-symbol'

/**
 * Parse titles.
 *
 * ###### Examples
 *
 * ```markdown
 * "a"
 * 'b'
 * (c)
 * "a
 * b"
 * 'a
 *     b'
 * (a\)b)
 * ```
 *
 * @param {Effects} effects
 *   Context.
 * @param {State} ok
 *   State switched to when successful.
 * @param {State} nok
 *   State switched to when unsuccessful.
 * @param {TokenType} type
 *   Type of the whole title (`"a"`, `'b'`, `(c)`).
 * @param {TokenType} markerType
 *   Type for the markers (`"`, `'`, `(`, and `)`).
 * @param {TokenType} stringType
 *   Type for the value (`a`).
 * @returns {State}
 *   Start state.
 */
export function factoryTitle(effects, ok, nok, type, markerType, stringType) {
  /** @type {NonNullable<Code>} */
  let marker

  return start

  /**
   * Start of title.
   *
   * ```markdown
   * > | "a"
   *     ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    if (
      code === codes.quotationMark ||
      code === codes.apostrophe ||
      code === codes.leftParenthesis
    ) {
      effects.enter(type)
      effects.enter(markerType)
      effects.consume(code)
      effects.exit(markerType)
      marker = code === codes.leftParenthesis ? codes.rightParenthesis : code
      return begin
    }

    return nok(code)
  }

  /**
   * After opening marker.
   *
   * This is also used at the closing marker.
   *
   * ```markdown
   * > | "a"
   *      ^
   * ```
   *
   * @type {State}
   */
  function begin(code) {
    if (code === marker) {
      effects.enter(markerType)
      effects.consume(code)
      effects.exit(markerType)
      effects.exit(type)
      return ok
    }

    effects.enter(stringType)
    return atBreak(code)
  }

  /**
   * At something, before something else.
   *
   * ```markdown
   * > | "a"
   *      ^
   * ```
   *
   * @type {State}
   */
  function atBreak(code) {
    if (code === marker) {
      effects.exit(stringType)
      return begin(marker)
    }

    if (code === codes.eof) {
      return nok(code)
    }

    // Note: blank lines can’t exist in content.
    if (markdownLineEnding(code)) {
      // To do: use `space_or_tab_eol_with_options`, connect.
      effects.enter(types.lineEnding)
      effects.consume(code)
      effects.exit(types.lineEnding)
      return factorySpace(effects, atBreak, types.linePrefix)
    }

    effects.enter(types.chunkString, {contentType: constants.contentTypeString})
    return inside(code)
  }

  /**
   *
   *
   * @type {State}
   */
  function inside(code) {
    if (code === marker || code === codes.eof || markdownLineEnding(code)) {
      effects.exit(types.chunkString)
      return atBreak(code)
    }

    effects.consume(code)
    return code === codes.backslash ? escape : inside
  }

  /**
   * After `\`, at a special character.
   *
   * ```markdown
   * > | "a\*b"
   *      ^
   * ```
   *
   * @type {State}
   */
  function escape(code) {
    if (code === marker || code === codes.backslash) {
      effects.consume(code)
      return inside
    }

    return inside(code)
  }
}
ܶx/**
 * @import {
 *   Code,
 *   Effects,
 *   State,
 *   TokenType
 * } from 'micromark-util-types'
 */

import { factorySpace } from 'micromark-factory-space';
import { markdownLineEnding } from 'micromark-util-character';
/**
 * Parse titles.
 *
 * ###### Examples
 *
 * ```markdown
 * "a"
 * 'b'
 * (c)
 * "a
 * b"
 * 'a
 *     b'
 * (a\)b)
 * ```
 *
 * @param {Effects} effects
 *   Context.
 * @param {State} ok
 *   State switched to when successful.
 * @param {State} nok
 *   State switched to when unsuccessful.
 * @param {TokenType} type
 *   Type of the whole title (`"a"`, `'b'`, `(c)`).
 * @param {TokenType} markerType
 *   Type for the markers (`"`, `'`, `(`, and `)`).
 * @param {TokenType} stringType
 *   Type for the value (`a`).
 * @returns {State}
 *   Start state.
 */
export function factoryTitle(effects, ok, nok, type, markerType, stringType) {
  /** @type {NonNullable<Code>} */
  let marker;
  return start;

  /**
   * Start of title.
   *
   * ```markdown
   * > | "a"
   *     ^
   * ```
   *
   * @type {State}
   */
  function start(code) {
    if (code === 34 || code === 39 || code === 40) {
      effects.enter(type);
      effects.enter(markerType);
      effects.consume(code);
      effects.exit(markerType);
      marker = code === 40 ? 41 : code;
      return begin;
    }
    return nok(code);
  }

  /**
   * After opening marker.
   *
   * This is also used at the closing marker.
   *
   * ```markdown
   * > | "a"
   *      ^
   * ```
   *
   * @type {State}
   */
  function begin(code) {
    if (code === marker) {
      effects.enter(markerType);
      effects.consume(code);
      effects.exit(markerType);
      effects.exit(type);
      return ok;
    }
    effects.enter(stringType);
    return atBreak(code);
  }

  /**
   * At something, before something else.
   *
   * ```markdown
   * > | "a"
   *      ^
   * ```
   *
   * @type {State}
   */
  function atBreak(code) {
    if (code === marker) {
      effects.exit(stringType);
      return begin(marker);
    }
    if (code === null) {
      return nok(code);
    }

    // Note: blank lines can’t exist in content.
    if (markdownLineEnding(code)) {
      // To do: use `space_or_tab_eol_with_options`, connect.
      effects.enter("lineEnding");
      effects.consume(code);
      effects.exit("lineEnding");
      return factorySpace(effects, atBreak, "linePrefix");
    }
    effects.enter("chunkString", {
      contentType: "string"
    });
    return inside(code);
  }

  /**
   *
   *
   * @type {State}
   */
  function inside(code) {
    if (code === marker || code === null || markdownLineEnding(code)) {
      effects.exit("chunkString");
      return atBreak(code);
    }
    effects.consume(code);
    return code === 92 ? escape : inside;
  }

  /**
   * After `\`, at a special character.
   *
   * ```markdown
   * > | "a\*b"
   *      ^
   * ```
   *
   * @type {State}
   */
  function escape(code) {
    if (code === marker || code === 92) {
      effects.consume(code);
      return inside;
    }
    return inside(code);
  }
}ۄ^x{
  "name": "micromark-util-decode-string",
  "version": "2.0.1",
  "description": "micromark utility to decode markdown strings",
  "license": "MIT",
  "keywords": [
    "micromark",
    "util",
    "utility",
    "decode",
    "character",
    "reference",
    "escape",
    "string"
  ],
  "repository": "https://github.com/micromark/micromark/tree/main/packages/micromark-util-decode-string",
  "bugs": "https://github.com/micromark/micromark/issues",
  "funding": [
    {
      "type": "GitHub Sponsors",
      "url": "https://github.com/sponsors/unifiedjs"
    },
    {
      "type": "OpenCollective",
      "url": "https://opencollective.com/unified"
    }
  ],
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "sideEffects": false,
  "type": "module",
  "files": [
    "dev/",
    "index.d.ts.map",
    "index.d.ts",
    "index.js"
  ],
  "exports": {
    "development": "./dev/index.js",
    "default": "./index.js"
  },
  "dependencies": {
    "micromark-util-character": "^2.0.0",
    "micromark-util-decode-numeric-character-reference": "^2.0.0",
    "micromark-util-symbol": "^2.0.0",
    "decode-named-character-reference": "^1.0.0"
  },
  "scripts": {
    "build": "micromark-build"
  },
  "xo": {
    "envs": [
      "shared-node-browser"
    ],
    "prettier": true,
    "rules": {
      "unicorn/prefer-code-point": "off",
      "unicorn/prefer-string-replace-all": "off"
    }
  }
}
hzx )
factory-title)5Bfactory to parse markdown titles (found in resources, definitions)=factory",
    "title\factory-titlefactory-spa#=*types": "^2
max-params 
    }
  }
}
Ix# micromark-factory-title

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][bundle-size-badge]][bundle-size]
[![Sponsors][sponsors-badge]][opencollective]
[![Backers][backers-badge]][opencollective]
[![Chat][chat-badge]][chat]

[micromark][] factory to parse markdown titles (found in resources,
definitions).

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`factoryTitle(…)`](#factorytitle)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package exposes states to parse titles.

## When should I use this?

This package is useful when you are making your own micromark extensions.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install micromark-factory-title
```

In Deno with [`esm.sh`][esmsh]:

```js
import {factorySpace} from 'https://esm.sh/micromark-factory-title@1'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {factorySpace} from 'https://esm.sh/micromark-factory-title@1?bundle'
</script>
```

## Use

```js
import {factoryTitle} from 'micromark-factory-title'
import {codes, types} from 'micromark-util-symbol'

// A micromark tokenizer that uses the factory:
/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeDefinition(effects, ok, nok) {
  return start

  // …

  /** @type {State} */
  function before(code) {
    if (
      code === codes.quotationMark ||
      code === codes.apostrophe ||
      code === codes.leftParenthesis
    ) {
      return factoryTitle(
        effects,
        factorySpace(effects, after, types.whitespace),
        nok,
        types.definitionTitle,
        types.definitionTitleMarker,
        types.definitionTitleString
      )(code)
    }

    return nok(code)
  }

  // …
}
```

## API

This module exports the identifier [`factoryTitle`][api-factory-title].
There is no default export.

### `factoryTitle(…)`

Parse titles.

###### Examples

```markdown
"a"
'b'
(c)
"a
b"
'a
    b'
(a\)b)
```

###### Parameters

* `effects` (`Effects`)
  — context
* `ok` (`State`)
  — state switched to when successful
* `nok` (`State`)
  — state switched to when unsuccessful
* `type` (`string`)
  — type of the whole title (`"a"`, `'b'`, `(c)`)
* `markerType` (`string`)
  — type for the markers (`"`, `'`, `(`, and `)`)
* `stringType` (`string`)
  — type for the value (`a`)

###### Returns

Start state (`State`).

## Types

This package is fully typed with [TypeScript][].
It exports no additional types.

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-factory-title@2`, compatible with Node.js 16.
This package works with `micromark@3`.

## Security

This package is safe.
See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
submit a security report.

## Contribute

See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg

[build]: https://github.com/micromark/micromark/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg

[coverage]: https://codecov.io/github/micromark/micromark

[downloads-badge]: https://img.shields.io/npm/dm/micromark-factory-title.svg

[downloads]: https://www.npmjs.com/package/micromark-factory-title

[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-factory-title

[bundle-size]: https://bundlejs.com/?q=micromark-factory-title

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[opencollective]: https://opencollective.com/unified

[npm]: https://docs.npmjs.com/cli/install

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/micromark/micromark/discussions

[license]: https://github.com/micromark/micromark/blob/main/license

[author]: https://wooorm.com

[health]: https://github.com/micromark/.github

[securitymd]: https://github.com/micromark/.github/blob/main/security.md

[contributing]: https://github.com/micromark/.github/blob/main/contributing.md

[support]: https://github.com/micromark/.github/blob/main/support.md

[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md

[typescript]: https://www.typescriptlang.org

[micromark]: https://github.com/micromark/micromark

[api-factory-title]: #factorytitle
~Qwx40000 dev CkfCES6b&x100644 index.d.ts RKF۝
8qiRD/100644 index.d.ts.map QiFFi\FM{L100644 index.js $:Ay+ev0Ik100644 license Zbv8f,Q)100644 package.json s;n2<>re@<K100644 readme.md F@jRӪbNdxt 100644 index.d.ts RKF۝
8qiRD/100644 index.d.ts.map QiFFi\FM{L100644 index.js :{-ѳ)-
cbX.x.x/**
 * Parse spaces and tabs.
 *
 * There is no `nok` parameter:
 *
 * *   line endings or spaces in markdown are often optional, in which case this
 *     factory can be used and `ok` will be switched to whether spaces were found
 *     or not
 * *   one line ending or space can be detected with
 *     `markdownLineEndingOrSpace(code)` right before using `factoryWhitespace`
 *
 * @param {Effects} effects
 *   Context.
 * @param {State} ok
 *   State switched to when successful.
 * @returns {State}
 *   Start state.
 */
export function factoryWhitespace(effects: Effects, ok: State): State;
import type { Effects } from 'micromark-util-types';
import type { State } from 'micromark-util-types';
//# sourceMappingURL=index.d.ts.mapZ~x <{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;GAiBG;AACH,2CAPW,OAAO,MAEP,KAAK,GAEH,KAAK,CA6BjB;6BAnDgC,sBAAsB;2BAAtB,sBAAsB"}9#Qx3
a@IfactorySpace} from 'micromark-factory-space'
import {markdownLineEnding, T/import {typesasymbol'Mline endings or:
 *     factory can ben<
 *    <O
 *     `markdownLineEndingOrSpace(code)` right before using `factoryWhitespacep==Whitespace(effects, ok) {
  /** @type {boolean} */
  let seenbR
LineEnding"s.lineEnding)x#9s.lineEnding)
      seen = true
      return start
    }
&return factorySpace(
        effects,
        start,
        seen ? types.linePrefix : types.lineSuffix
      )(code)
    }

  }

KxL/**
 * @import {Effects, State} from 'micromark-util-types'
 */

import { factorySpace } from 'micromark-factory-space';
import { markdownLineEnding, markdownSpace } from 'micromark-util-character';
/**
 * Parse spaces and tabs.
 *
 * There is no `nok` parameter:
 *
 * *   line endings or spaces in markdown are often optional, in which case this
 *     factory can be used and `ok` will be switched to whether spaces were found
 *     or not
 * *   one line ending or space can be detected with
 *     `markdownLineEndingOrSpace(code)` right before using `factoryWhitespace`
 *
 * @param {Effects} effects
 *   Context.
 * @param {State} ok
 *   State switched to when successful.
 * @returns {State}
 *   Start state.
 */
export function factoryWhitespace(effects, ok) {
  /** @type {boolean} */
  let seen;
  return start;

  /** @type {State} */
  function start(code) {
    if (markdownLineEnding(code)) {
      effects.enter("lineEnding");
      effects.consume(code);
      effects.exit("lineEnding");
      seen = true;
      return start;
    }
    if (markdownSpace(code)) {
      return factorySpace(effects, start, seen ? "linePrefix" : "lineSuffix")(code);
    }
    return ok(code);
  }
}x*# micromark-util-chunked

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][bundle-size-badge]][bundle-size]
[![Sponsors][sponsors-badge]][opencollective]
[![Backers][backers-badge]][opencollective]
[![Chat][chat-badge]][chat]

[micromark][] utility to splice and push with giant arrays.

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`push(list, items)`](#pushlist-items)
  * [`splice(list, start, remove, items)`](#splicelist-start-remove-items)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package exposes an algorithm to splice for giant arrays, which V8 bugs
out on.

## When should I use this?

This package might be useful when you are making your own micromark extensions.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install micromark-util-chunked
```

In Deno with [`esm.sh`][esmsh]:

```js
import {push, splice} from 'https://esm.sh/micromark-util-chunked@1'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {push, splice} from 'https://esm.sh/micromark-util-chunked@1?bundle'
</script>
```

## Use

```js
import {push, splice} from 'micromark-util-chunked'

// …

nextEvents = push(nextEvents, [
  ['enter', events[open][1], context],
  ['exit', events[open][1], context]
])

// …

splice(events, open - 1, index - open + 3, nextEvents)

// …
```

## API

This module exports the identifiers [`push`][api-push]
and [`splice`][api-splice].
There is no default export.

### `push(list, items)`

Append `items` (an array) at the end of `list` (another array).
When `list` was empty, returns `items` instead.

This prevents a potentially expensive operation when `list` is empty,
and adds items in batches to prevent V8 from hanging.

###### Parameters

* `list` (`Array<unknown>`)
  — list to operate on
* `items` (`Array<unknown>`)
  — items to add to `list`

###### Returns

Either `list` or `items` (`Array<unknown>`).

### `splice(list, start, remove, items)`

Like `Array#splice`, but smarter for giant arrays.

`Array#splice` takes all items to be inserted as individual argument which
causes a stack overflow in V8 when trying to insert 100k items for instance.

Otherwise, this does not return the removed items, and takes `items` as an
array instead of rest parameters.

###### Parameters

* `list` (`Array<unknown>`)
  — list to operate on
* `start` (`number`)
  — index to remove/insert at (can be negative)
* `remove` (`number`)
  — number of items to remove
* `items` (`Array<unknown>`)
  — items to inject into `list`

###### Returns

Nothing (`undefined`).

## Types

This package is fully typed with [TypeScript][].
It exports no additional types.

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-util-chunked@2`, compatible with Node.js 16.
This package works with `micromark@3`.

## Security

This package is safe.
See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
submit a security report.

## Contribute

See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg

[build]: https://github.com/micromark/micromark/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg

[coverage]: https://codecov.io/github/micromark/micromark

[downloads-badge]: https://img.shields.io/npm/dm/micromark-util-chunked.svg

[downloads]: https://www.npmjs.com/package/micromark-util-chunked

[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-chunked

[bundle-size]: https://bundlejs.com/?q=micromark-util-chunked

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[opencollective]: https://opencollective.com/unified

[npm]: https://docs.npmjs.com/cli/install

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/micromark/micromark/discussions

[license]: https://github.com/micromark/micromark/blob/main/license

[author]: https://wooorm.com

[health]: https://github.com/micromark/.github

[securitymd]: https://github.com/micromark/.github/blob/main/security.md

[contributing]: https://github.com/micromark/.github/blob/main/contributing.md

[support]: https://github.com/micromark/.github/blob/main/support.md

[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md

[typescript]: https://www.typescriptlang.org

[micromark]: https://github.com/micromark/micromark

[api-push]: #pushlist-items

[api-splice]: #splicelist-start-remove-items
ϖ,ccx?+)# micromark-factory-whitespace#Pfactory to parse [markdown line endings or spaces][ws] (found in
lots of places)g+factoryWhitespace(…)`](#factorywhitespacesstates to parse whitespaceX,isfactory-whitespaceN5factoryWhitespa#factory-whitespaceWfactoryWhitespa#factory-whitespaceL0factoryWhitespace} from 'micromark-factory-whitespace'
import {codes, types} from 'micromark-util-symbol'

// A micromark tokenizer that uses the factory:
/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeTitle(effects, ok, nok) {
  return start

  /** @type {State} */
  function start(code) {
    return markdownLineEndingOrSpace(code)
      L? factoryWhitespace(effects, before)(code)
      : nok(code)
  }

  // …
}g0+
[`factoryWhitespace`][api-factory-whitespa'factoryWhitespace(…)`

Parse spaces and tabs.

There is no `nok` parameter:

* line endings or spaces in markdown are often optional, in which case this
  factory can be used and `ok` will be switched to whether spaces were found
  or not
* one line ending or space can be detected with
  [`markdownLineEndingOrSpace(code)`][ws] right before using
  `factoryWhitespace`

###### P
effects` (`Effects`)
  — context
* `ok` (`State`)
  — state switched to when successful

###### Returns

Start state (`State:ifactory-whitespacefactory-whitespace[;factory-whitespacefactory-whitespaceM3factory-whitespacews`)J/tree/main/packages/micromark-util-character#markdownlineendingorspacecode&j(factory-whitespace]: #factorywhitespace
g;=x40000 dev .!^OCvх4\`100644 index.d.ts RW=K1؟]ԗS100644 index.d.ts.map <peD:)100644 index.js i5+Bp's100644 license Zbv8f,Q)100644 package.json ~9OxKm100644 readme.md #Vr9m2_0!-p`xt 100644 index.d.ts RW=K1؟]ԗS100644 index.d.ts.map <peD:)100644 index.js 7E`&+E
E^,@x@/**
 * Check whether a character code is an ASCII control character.
 *
 * An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)
 * to U+001F (US), or U+007F (DEL).
 *
 * @param {Code} code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export function asciiControl(code: Code): boolean;
/**
 * Check whether a character code is a markdown line ending.
 *
 * A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN
 * LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).
 *
 * In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE
 * RETURN (CR) are replaced by these virtual characters depending on whether
 * they occurred together.
 *
 * @param {Code} code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export function markdownLineEnding(code: Code): boolean;
/**
 * Check whether a character code is a markdown line ending (see
 * `markdownLineEnding`) or markdown space (see `markdownSpace`).
 *
 * @param {Code} code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export function markdownLineEndingOrSpace(code: Code): boolean;
/**
 * Check whether a character code is a markdown space.
 *
 * A **markdown space** is the concrete character U+0020 SPACE (SP) and the
 * virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).
 *
 * In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is
 * replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL
 * SPACE (VS) characters, depending on the column at which the tab occurred.
 *
 * @param {Code} code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export function markdownSpace(code: Code): boolean;
/**
 * Check whether the character code represents an ASCII alpha (`a` through `z`,
 * case insensitive).
 *
 * An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.
 *
 * An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)
 * to U+005A (`Z`).
 *
 * An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)
 * to U+007A (`z`).
 *
 * @param code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export const asciiAlpha: (code: Code) => boolean;
/**
 * Check whether the character code represents an ASCII alphanumeric (`a`
 * through `z`, case insensitive, or `0` through `9`).
 *
 * An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha
 * (see `asciiAlpha`).
 *
 * @param code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export const asciiAlphanumeric: (code: Code) => boolean;
/**
 * Check whether the character code represents an ASCII atext.
 *
 * atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in
 * the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),
 * U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F
 * SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E
 * CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE
 * (`{`) to U+007E TILDE (`~`).
 *
 * See:
 * **\[RFC5322]**:
 * [Internet Message Format](https://tools.ietf.org/html/rfc5322).
 * P. Resnick.
 * IETF.
 *
 * @param code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export const asciiAtext: (code: Code) => boolean;
/**
 * Check whether the character code represents an ASCII digit (`0` through `9`).
 *
 * An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to
 * U+0039 (`9`).
 *
 * @param code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export const asciiDigit: (code: Code) => boolean;
/**
 * Check whether the character code represents an ASCII hex digit (`a` through
 * `f`, case insensitive, or `0` through `9`).
 *
 * An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex
 * digit, or an ASCII lower hex digit.
 *
 * An **ASCII upper hex digit** is a character in the inclusive range U+0041
 * (`A`) to U+0046 (`F`).
 *
 * An **ASCII lower hex digit** is a character in the inclusive range U+0061
 * (`a`) to U+0066 (`f`).
 *
 * @param code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export const asciiHexDigit: (code: Code) => boolean;
/**
 * Check whether the character code represents ASCII punctuation.
 *
 * An **ASCII punctuation** is a character in the inclusive ranges U+0021
 * EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT
 * SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT
 * (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).
 *
 * @param code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export const asciiPunctuation: (code: Code) => boolean;
/**
 * Check whether the character code represents Unicode punctuation.
 *
 * A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,
 * Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`
 * (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`
 * (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII
 * punctuation (see `asciiPunctuation`).
 *
 * See:
 * **\[UNICODE]**:
 * [The Unicode Standard](https://www.unicode.org/versions/).
 * Unicode Consortium.
 *
 * @param code
 *   Code.
 * @returns
 *   Whether it matches.
 */
export const unicodePunctuation: (code: Code) => boolean;
/**
 * Check whether the character code represents Unicode whitespace.
 *
 * Note that this does handle micromark specific markdown whitespace characters.
 * See `markdownLineEndingOrSpace` to check that.
 *
 * A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,
 * Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),
 * U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**).
 *
 * See:
 * **\[UNICODE]**:
 * [The Unicode Standard](https://www.unicode.org/versions/).
 * Unicode Consortium.
 *
 * @param code
 *   Code.
 * @returns
 *   Whether it matches.
 */
export const unicodeWhitespace: (code: Code) => boolean;
import type { Code } from 'micromark-util-types';
//# sourceMappingURL=index.d.ts.mapfpո2x({"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AA8DA;;;;;;;;;;GAUG;AACH,mCALW,IAAI,GAEF,OAAO,CASnB;AAkDD;;;;;;;;;;;;;;GAcG;AACH,yCALW,IAAI,GAEF,OAAO,CAKnB;AAED;;;;;;;;GAQG;AACH,gDALW,IAAI,GAEF,OAAO,CAKnB;AAED;;;;;;;;;;;;;;GAcG;AACH,oCALW,IAAI,GAEF,OAAO,CASnB;AAhLD;;;;;;;;;;;;;;;;GAgBG;AACH,gCAmNoB,IAAI,KAAK,OAAO,CAnNY;AAEhD;;;;;;;;;;;GAWG;AACH,uCAqMoB,IAAI,KAAK,OAAO,CArMqB;AAEzD;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,gCA8KoB,IAAI,KAAK,OAAO,CA9KuB;AAqB3D;;;;;;;;;;GAUG;AACH,gCA8IoB,IAAI,KAAK,OAAO,CA9IM;AAE1C;;;;;;;;;;;;;;;;;GAiBG;AACH,mCA0HoB,IAAI,KAAK,OAAO,CA1HiB;AAErD;;;;;;;;;;;;GAYG;AACH,sCA2GoB,IAAI,KAAK,OAAO,CA3GwB;AA2D5D;;;;;;;;;;;;;;;;;;GAkBG;AACH,wCA6BoB,IAAI,KAAK,OAAO,CA7BwB;AAE5D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,uCAOoB,IAAI,KAAK,OAAO,CAPa;0BAlO1B,sBAAsB"}x)/**
 * @import {Code} from 'micromark-util-types'
 */

import {codes} from 'micromark-util-symbol'

/**
 * Check whether the character code represents an ASCII alpha (`a` through `z`,
 * case insensitive).
 *
 * An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.
 *
 * An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)
 * to U+005A (`Z`).
 *
 * An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)
 * to U+007A (`z`).
 *
 * @param code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export const asciiAlpha = regexCheck(/[A-Za-z]/)

/**
 * Check whether the character code represents an ASCII alphanumeric (`a`
 * through `z`, case insensitive, or `0` through `9`).
 *
 * An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha
 * (see `asciiAlpha`).
 *
 * @param code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export const asciiAlphanumeric = regexCheck(/[\dA-Za-z]/)

/**
 * Check whether the character code represents an ASCII atext.
 *
 * atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in
 * the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),
 * U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F
 * SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E
 * CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE
 * (`{`) to U+007E TILDE (`~`).
 *
 * See:
 * **\[RFC5322]**:
 * [Internet Message Format](https://tools.ietf.org/html/rfc5322).
 * P. Resnick.
 * IETF.
 *
 * @param code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export const asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/)

/**
 * Check whether a character code is an ASCII control character.
 *
 * An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)
 * to U+001F (US), or U+007F (DEL).
 *
 * @param {Code} code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export function asciiControl(code) {
  return (
    // Special whitespace codes (which have negative values), C0 and Control
    // character DEL
    code !== null && (code < codes.space || code === codes.del)
  )
}

/**
 * Check whether the character code represents an ASCII digit (`0` through `9`).
 *
 * An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to
 * U+0039 (`9`).
 *
 * @param code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export const asciiDigit = regexCheck(/\d/)

/**
 * Check whether the character code represents an ASCII hex digit (`a` through
 * `f`, case insensitive, or `0` through `9`).
 *
 * An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex
 * digit, or an ASCII lower hex digit.
 *
 * An **ASCII upper hex digit** is a character in the inclusive range U+0041
 * (`A`) to U+0046 (`F`).
 *
 * An **ASCII lower hex digit** is a character in the inclusive range U+0061
 * (`a`) to U+0066 (`f`).
 *
 * @param code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export const asciiHexDigit = regexCheck(/[\dA-Fa-f]/)

/**
 * Check whether the character code represents ASCII punctuation.
 *
 * An **ASCII punctuation** is a character in the inclusive ranges U+0021
 * EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT
 * SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT
 * (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).
 *
 * @param code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/)

/**
 * Check whether a character code is a markdown line ending.
 *
 * A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN
 * LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).
 *
 * In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE
 * RETURN (CR) are replaced by these virtual characters depending on whether
 * they occurred together.
 *
 * @param {Code} code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export function markdownLineEnding(code) {
  return code !== null && code < codes.horizontalTab
}

/**
 * Check whether a character code is a markdown line ending (see
 * `markdownLineEnding`) or markdown space (see `markdownSpace`).
 *
 * @param {Code} code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export function markdownLineEndingOrSpace(code) {
  return code !== null && (code < codes.nul || code === codes.space)
}

/**
 * Check whether a character code is a markdown space.
 *
 * A **markdown space** is the concrete character U+0020 SPACE (SP) and the
 * virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).
 *
 * In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is
 * replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL
 * SPACE (VS) characters, depending on the column at which the tab occurred.
 *
 * @param {Code} code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export function markdownSpace(code) {
  return (
    code === codes.horizontalTab ||
    code === codes.virtualSpace ||
    code === codes.space
  )
}

// Size note: removing ASCII from the regex and using `asciiPunctuation` here
// In fact adds to the bundle size.
/**
 * Check whether the character code represents Unicode punctuation.
 *
 * A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,
 * Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`
 * (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`
 * (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII
 * punctuation (see `asciiPunctuation`).
 *
 * See:
 * **\[UNICODE]**:
 * [The Unicode Standard](https://www.unicode.org/versions/).
 * Unicode Consortium.
 *
 * @param code
 *   Code.
 * @returns
 *   Whether it matches.
 */
export const unicodePunctuation = regexCheck(/\p{P}|\p{S}/u)

/**
 * Check whether the character code represents Unicode whitespace.
 *
 * Note that this does handle micromark specific markdown whitespace characters.
 * See `markdownLineEndingOrSpace` to check that.
 *
 * A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,
 * Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),
 * U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**).
 *
 * See:
 * **\[UNICODE]**:
 * [The Unicode Standard](https://www.unicode.org/versions/).
 * Unicode Consortium.
 *
 * @param code
 *   Code.
 * @returns
 *   Whether it matches.
 */
export const unicodeWhitespace = regexCheck(/\s/)

/**
 * Create a code check from a regex.
 *
 * @param {RegExp} regex
 *   Expression.
 * @returns {(code: Code) => boolean}
 *   Check.
 */
function regexCheck(regex) {
  return check

  /**
   * Check whether a code matches the bound regex.
   *
   * @param {Code} code
   *   Character code.
   * @returns {boolean}
   *   Whether the character code matches the bound regex.
   */
  function check(code) {
    return code !== null && code > -1 && regex.test(String.fromCharCode(code))
  }
}
ƥuxc/**
 * @import {Code} from 'micromark-util-types'
 */

/**
 * Check whether the character code represents an ASCII alpha (`a` through `z`,
 * case insensitive).
 *
 * An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.
 *
 * An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)
 * to U+005A (`Z`).
 *
 * An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)
 * to U+007A (`z`).
 *
 * @param code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export const asciiAlpha = regexCheck(/[A-Za-z]/);

/**
 * Check whether the character code represents an ASCII alphanumeric (`a`
 * through `z`, case insensitive, or `0` through `9`).
 *
 * An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha
 * (see `asciiAlpha`).
 *
 * @param code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export const asciiAlphanumeric = regexCheck(/[\dA-Za-z]/);

/**
 * Check whether the character code represents an ASCII atext.
 *
 * atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in
 * the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),
 * U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F
 * SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E
 * CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE
 * (`{`) to U+007E TILDE (`~`).
 *
 * See:
 * **\[RFC5322]**:
 * [Internet Message Format](https://tools.ietf.org/html/rfc5322).
 * P. Resnick.
 * IETF.
 *
 * @param code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export const asciiAtext = regexCheck(/[#-'*+\--9=?A-Z^-~]/);

/**
 * Check whether a character code is an ASCII control character.
 *
 * An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)
 * to U+001F (US), or U+007F (DEL).
 *
 * @param {Code} code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export function asciiControl(code) {
  return (
    // Special whitespace codes (which have negative values), C0 and Control
    // character DEL
    code !== null && (code < 32 || code === 127)
  );
}

/**
 * Check whether the character code represents an ASCII digit (`0` through `9`).
 *
 * An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to
 * U+0039 (`9`).
 *
 * @param code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export const asciiDigit = regexCheck(/\d/);

/**
 * Check whether the character code represents an ASCII hex digit (`a` through
 * `f`, case insensitive, or `0` through `9`).
 *
 * An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex
 * digit, or an ASCII lower hex digit.
 *
 * An **ASCII upper hex digit** is a character in the inclusive range U+0041
 * (`A`) to U+0046 (`F`).
 *
 * An **ASCII lower hex digit** is a character in the inclusive range U+0061
 * (`a`) to U+0066 (`f`).
 *
 * @param code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export const asciiHexDigit = regexCheck(/[\dA-Fa-f]/);

/**
 * Check whether the character code represents ASCII punctuation.
 *
 * An **ASCII punctuation** is a character in the inclusive ranges U+0021
 * EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT
 * SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT
 * (`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).
 *
 * @param code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export const asciiPunctuation = regexCheck(/[!-/:-@[-`{-~]/);

/**
 * Check whether a character code is a markdown line ending.
 *
 * A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN
 * LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).
 *
 * In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE
 * RETURN (CR) are replaced by these virtual characters depending on whether
 * they occurred together.
 *
 * @param {Code} code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export function markdownLineEnding(code) {
  return code !== null && code < -2;
}

/**
 * Check whether a character code is a markdown line ending (see
 * `markdownLineEnding`) or markdown space (see `markdownSpace`).
 *
 * @param {Code} code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export function markdownLineEndingOrSpace(code) {
  return code !== null && (code < 0 || code === 32);
}

/**
 * Check whether a character code is a markdown space.
 *
 * A **markdown space** is the concrete character U+0020 SPACE (SP) and the
 * virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).
 *
 * In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is
 * replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL
 * SPACE (VS) characters, depending on the column at which the tab occurred.
 *
 * @param {Code} code
 *   Code.
 * @returns {boolean}
 *   Whether it matches.
 */
export function markdownSpace(code) {
  return code === -2 || code === -1 || code === 32;
}

// Size note: removing ASCII from the regex and using `asciiPunctuation` here
// In fact adds to the bundle size.
/**
 * Check whether the character code represents Unicode punctuation.
 *
 * A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,
 * Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`
 * (Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`
 * (Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII
 * punctuation (see `asciiPunctuation`).
 *
 * See:
 * **\[UNICODE]**:
 * [The Unicode Standard](https://www.unicode.org/versions/).
 * Unicode Consortium.
 *
 * @param code
 *   Code.
 * @returns
 *   Whether it matches.
 */
export const unicodePunctuation = regexCheck(/\p{P}|\p{S}/u);

/**
 * Check whether the character code represents Unicode whitespace.
 *
 * Note that this does handle micromark specific markdown whitespace characters.
 * See `markdownLineEndingOrSpace` to check that.
 *
 * A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,
 * Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),
 * U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**).
 *
 * See:
 * **\[UNICODE]**:
 * [The Unicode Standard](https://www.unicode.org/versions/).
 * Unicode Consortium.
 *
 * @param code
 *   Code.
 * @returns
 *   Whether it matches.
 */
export const unicodeWhitespace = regexCheck(/\s/);

/**
 * Create a code check from a regex.
 *
 * @param {RegExp} regex
 *   Expression.
 * @returns {(code: Code) => boolean}
 *   Check.
 */
function regexCheck(regex) {
  return check;

  /**
   * Check whether a code matches the bound regex.
   *
   * @param {Code} code
   *   Character code.
   * @returns {boolean}
   *   Whether the character code matches the bound regex.
   */
  function check(code) {
    return code !== null && code > -1 && regex.test(String.fromCharCode(code));
  }
}bnWx~{
  "name": "micromark-util-classify-character",
  "version": "2.0.1",
  "description": "micromark utility to classify whether a character is whitespace or punctuation",
  "license": "MIT",
  "keywords": [
    "micromark",
    "util",
    "utility",
    "attention",
    "classify",
    "character"
  ],
  "repository": "https://github.com/micromark/micromark/tree/main/packages/micromark-util-classify-character",
  "bugs": "https://github.com/micromark/micromark/issues",
  "funding": [
    {
      "type": "GitHub Sponsors",
      "url": "https://github.com/sponsors/unifiedjs"
    },
    {
      "type": "OpenCollective",
      "url": "https://opencollective.com/unified"
    }
  ],
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "sideEffects": false,
  "type": "module",
  "files": [
    "dev/",
    "index.d.ts.map",
    "index.d.ts",
    "index.js"
  ],
  "exports": {
    "development": "./dev/index.js",
    "default": "./index.js"
  },
  "dependencies": {
    "micromark-util-character": "^2.0.0",
    "micromark-util-symbol": "^2.0.0",
    "micromark-util-types": "^2.0.0"
  },
  "scripts": {
    "build": "micromark-build"
  },
  "xo": {
    "envs": [
      "shared-node-browser"
    ],
    "prettier": true,
    "rules": {
      "unicorn/prefer-code-point": "off"
    }
  }
}
KxU 

P	,
  "version": "2.1B,handle character codesX kP	libywڰx-/# micromark-util-character

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][bundle-size-badge]][bundle-size]
[![Sponsors][sponsors-badge]][opencollective]
[![Backers][backers-badge]][opencollective]
[![Chat][chat-badge]][chat]

[micromark][] utility to handle [character codes][code].

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`asciiAlpha(code)`](#asciialphacode)
  * [`asciiAlphanumeric(code)`](#asciialphanumericcode)
  * [`asciiAtext(code)`](#asciiatextcode)
  * [`asciiControl(code)`](#asciicontrolcode)
  * [`asciiDigit(code)`](#asciidigitcode)
  * [`asciiHexDigit(code)`](#asciihexdigitcode)
  * [`asciiPunctuation(code)`](#asciipunctuationcode)
  * [`markdownLineEnding(code)`](#markdownlineendingcode)
  * [`markdownLineEndingOrSpace(code)`](#markdownlineendingorspacecode)
  * [`markdownSpace(code)`](#markdownspacecode)
  * [`unicodePunctuation(code)`](#unicodepunctuationcode)
  * [`unicodeWhitespace(code)`](#unicodewhitespacecode)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package exposes algorithms to check whether characters match groups.

## When should I use this?

This package might be useful when you are making your own micromark extensions.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install micromark-util-character
```

In Deno with [`esm.sh`][esmsh]:

```js
import * as character from 'https://esm.sh/micromark-util-character@1'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import * as character from 'https://esm.sh/micromark-util-character@1?bundle'
</script>
```

## Use

```js
import {asciiAlpha} from 'micromark-util-character'

console.log(asciiAlpha(64)) // false
console.log(asciiAlpha(65)) // true
```

## API

This module exports the identifiers
[`asciiAlpha`][api-ascii-alpha],
[`asciiAlphanumeric`][api-ascii-alphanumeric],
[`asciiAtext`][api-ascii-atext],
[`asciiControl`][api-ascii-control],
[`asciiDigit`][api-ascii-digit],
[`asciiHexDigit`][api-ascii-hex-digit],
[`asciiPunctuation`][api-ascii-punctuation],
[`markdownLineEnding`][api-markdown-line-ending],
[`markdownLineEndingOrSpace`][api-markdown-line-ending-or-space],
[`markdownSpace`][api-markdown-space],
[`unicodePunctuation`][api-unicode-punctuation],
[`unicodeWhitespace`][api-unicode-whitespace].
There is no default export.

### `asciiAlpha(code)`

Check whether the [character code][code] represents an ASCII alpha (`a` through
`z`, case insensitive).

An **ASCII alpha** is an ASCII upper alpha or ASCII lower alpha.

An **ASCII upper alpha** is a character in the inclusive range U+0041 (`A`)
to U+005A (`Z`).

An **ASCII lower alpha** is a character in the inclusive range U+0061 (`a`)
to U+007A (`z`).

###### Parameters

* `code` (`Code`)
  — code

###### Returns

Whether it matches (`boolean`).

### `asciiAlphanumeric(code)`

Check whether the [character code][code] represents an ASCII alphanumeric (`a`
through `z`, case insensitive, or `0` through `9`).

An **ASCII alphanumeric** is an ASCII digit (see `asciiDigit`) or ASCII alpha
(see `asciiAlpha`).

###### Parameters

* `code` (`Code`)
  — code

###### Returns

Whether it matches (`boolean`).

### `asciiAtext(code)`

Check whether the [character code][code] represents an ASCII atext.

atext is an ASCII alphanumeric (see `asciiAlphanumeric`), or a character in
the inclusive ranges U+0023 NUMBER SIGN (`#`) to U+0027 APOSTROPHE (`'`),
U+002A ASTERISK (`*`), U+002B PLUS SIGN (`+`), U+002D DASH (`-`), U+002F
SLASH (`/`), U+003D EQUALS TO (`=`), U+003F QUESTION MARK (`?`), U+005E
CARET (`^`) to U+0060 GRAVE ACCENT (`` ` ``), or U+007B LEFT CURLY BRACE
(`{`) to U+007E TILDE (`~`) (**\[RFC5322]**).

See **\[RFC5322]**:\
[Internet Message Format](https://tools.ietf.org/html/rfc5322).\
P. Resnick.\
IETF.

###### Parameters

* `code` (`Code`)
  — code

###### Returns

Whether it matches (`boolean`).

### `asciiControl(code)`

Check whether a [character code][code] is an ASCII control character.

An **ASCII control** is a character in the inclusive range U+0000 NULL (NUL)
to U+001F (US), or U+007F (DEL).

###### Parameters

* `code` (`Code`)
  — code

###### Returns

Whether it matches (`boolean`).

### `asciiDigit(code)`

Check whether the [character code][code] represents an ASCII digit (`0` through
`9`).

An **ASCII digit** is a character in the inclusive range U+0030 (`0`) to
U+0039 (`9`).

###### Parameters

* `code` (`Code`)
  — code

###### Returns

Whether it matches (`boolean`).

### `asciiHexDigit(code)`

Check whether the [character code][code] represents an ASCII hex digit (`a`
through `f`, case insensitive, or `0` through `9`).

An **ASCII hex digit** is an ASCII digit (see `asciiDigit`), ASCII upper hex
digit, or an ASCII lower hex digit.

An **ASCII upper hex digit** is a character in the inclusive range U+0041
(`A`) to U+0046 (`F`).

An **ASCII lower hex digit** is a character in the inclusive range U+0061
(`a`) to U+0066 (`f`).

###### Parameters

* `code` (`Code`)
  — code

###### Returns

Whether it matches (`boolean`).

### `asciiPunctuation(code)`

Check whether the [character code][code] represents ASCII punctuation.

An **ASCII punctuation** is a character in the inclusive ranges U+0021
EXCLAMATION MARK (`!`) to U+002F SLASH (`/`), U+003A COLON (`:`) to U+0040 AT
SIGN (`@`), U+005B LEFT SQUARE BRACKET (`[`) to U+0060 GRAVE ACCENT
(`` ` ``), or U+007B LEFT CURLY BRACE (`{`) to U+007E TILDE (`~`).

###### Parameters

* `code` (`Code`)
  — code

###### Returns

Whether it matches (`boolean`).

### `markdownLineEnding(code)`

Check whether a [character code][code] is a markdown line ending.

A **markdown line ending** is the virtual characters M-0003 CARRIAGE RETURN
LINE FEED (CRLF), M-0004 LINE FEED (LF) and M-0005 CARRIAGE RETURN (CR).

In micromark, the actual character U+000A LINE FEED (LF) and U+000D CARRIAGE
RETURN (CR) are replaced by these virtual characters depending on whether
they occurred together.

###### Parameters

* `code` (`Code`)
  — code

###### Returns

Whether it matches (`boolean`).

### `markdownLineEndingOrSpace(code)`

Check whether a [character code][code] is a markdown line ending (see
`markdownLineEnding`) or markdown space (see `markdownSpace`).

###### Parameters

* `code` (`Code`)
  — code

###### Returns

Whether it matches (`boolean`).

### `markdownSpace(code)`

Check whether a [character code][code] is a markdown space.

A **markdown space** is the concrete character U+0020 SPACE (SP) and the
virtual characters M-0001 VIRTUAL SPACE (VS) and M-0002 HORIZONTAL TAB (HT).

In micromark, the actual character U+0009 CHARACTER TABULATION (HT) is
replaced by one M-0002 HORIZONTAL TAB (HT) and between 0 and 3 M-0001 VIRTUAL
SPACE (VS) characters, depending on the column at which the tab occurred.

###### Parameters

* `code` (`Code`)
  — code

###### Returns

Whether it matches (`boolean`).

### `unicodePunctuation(code)`

Check whether the [character code][code] represents Unicode punctuation.

A **Unicode punctuation** is a character in the Unicode `Pc` (Punctuation,
Connector), `Pd` (Punctuation, Dash), `Pe` (Punctuation, Close), `Pf`
(Punctuation, Final quote), `Pi` (Punctuation, Initial quote), `Po`
(Punctuation, Other), or `Ps` (Punctuation, Open) categories, or an ASCII
punctuation (see `asciiPunctuation`) (**\[UNICODE]**).

See **\[UNICODE]**:\
[The Unicode Standard](https://www.unicode.org/versions/).\
Unicode Consortium.

###### Parameters

* `code` (`Code`)
  — code

###### Returns

Whether it matches (`boolean`).

### `unicodeWhitespace(code)`

Check whether the [character code][code] represents Unicode whitespace.

Note that this does handle micromark specific markdown whitespace characters.
See `markdownLineEndingOrSpace` to check that.

A **Unicode whitespace** is a character in the Unicode `Zs` (Separator,
Space) category, or U+0009 CHARACTER TABULATION (HT), U+000A LINE FEED (LF),
U+000C (FF), or U+000D CARRIAGE RETURN (CR) (**\[UNICODE]**).

See **\[UNICODE]**:\
[The Unicode Standard](https://www.unicode.org/versions/).\
Unicode Consortium.

###### Parameters

* `code` (`Code`)
  — code

###### Returns

Whether it matches (`boolean`).

## Types

This package is fully typed with [TypeScript][].
It exports no additional types.

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-util-character@2`, compatible with Node.js 16.
This package works with `micromark@3`.

## Security

This package is safe.
See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
submit a security report.

## Contribute

See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg

[build]: https://github.com/micromark/micromark/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg

[coverage]: https://codecov.io/github/micromark/micromark

[downloads-badge]: https://img.shields.io/npm/dm/micromark-util-character.svg

[downloads]: https://www.npmjs.com/package/micromark-util-character

[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-character

[bundle-size]: https://bundlejs.com/?q=micromark-util-character

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[opencollective]: https://opencollective.com/unified

[npm]: https://docs.npmjs.com/cli/install

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/micromark/micromark/discussions

[license]: https://github.com/micromark/micromark/blob/main/license

[author]: https://wooorm.com

[health]: https://github.com/micromark/.github

[securitymd]: https://github.com/micromark/.github/blob/main/security.md

[contributing]: https://github.com/micromark/.github/blob/main/contributing.md

[support]: https://github.com/micromark/.github/blob/main/support.md

[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md

[typescript]: https://www.typescriptlang.org

[micromark]: https://github.com/micromark/micromark

[code]: https://github.com/micromark/micromark#preprocess

[api-ascii-alpha]: #asciialphacode

[api-ascii-alphanumeric]: #asciialphanumericcode

[api-ascii-atext]: #asciiatextcode

[api-ascii-control]: #asciicontrolcode

[api-ascii-digit]: #asciidigitcode

[api-ascii-hex-digit]: #asciihexdigitcode

[api-ascii-punctuation]: #asciipunctuationcode

[api-markdown-line-ending]: #markdownlineendingcode

[api-markdown-line-ending-or-space]: #markdownlineendingorspacecode

[api-markdown-space]: #markdownspacecode

[api-unicode-punctuation]: #unicodepunctuationcode

[api-unicode-whitespace]: #unicodewhitespacecode
ghx40000 dev  ڽu	jҭ7100644 index.d.ts  [}Sm8100644 index.d.ts.map C!%9}ѭ3q100644 index.js :K&$ Kőscve100644 license Zbv8f,Q)100644 package.json \ӕZ̮|xvXM100644 readme.md f(23EN\{r08=<f1xt 100644 index.d.ts  [}Sm8100644 index.d.ts.map C!%9}ѭ3q100644 index.js {jq>e|Haȁ	/UxY/**
 * Like `Array#splice`, but smarter for giant arrays.
 *
 * `Array#splice` takes all items to be inserted as individual argument which
 * causes a stack overflow in V8 when trying to insert 100k items for instance.
 *
 * Otherwise, this does not return the removed items, and takes `items` as an
 * array instead of rest parameters.
 *
 * @template {unknown} T
 *   Item type.
 * @param {Array<T>} list
 *   List to operate on.
 * @param {number} start
 *   Index to remove/insert at (can be negative).
 * @param {number} remove
 *   Number of items to remove.
 * @param {Array<T>} items
 *   Items to inject into `list`.
 * @returns {undefined}
 *   Nothing.
 */
export function splice<T extends unknown>(list: Array<T>, start: number, remove: number, items: Array<T>): undefined;
/**
 * Append `items` (an array) at the end of `list` (another array).
 * When `list` was empty, returns `items` instead.
 *
 * This prevents a potentially expensive operation when `list` is empty,
 * and adds items in batches to prevent V8 from hanging.
 *
 * @template {unknown} T
 *   Item type.
 * @param {Array<T>} list
 *   List to operate on.
 * @param {Array<T>} items
 *   Items to add to `list`.
 * @returns {Array<T>}
 *   Either `list` or `items`.
 */
export function push<T extends unknown>(list: Array<T>, items: Array<T>): Array<T>;
//# sourceMappingURL=index.d.ts.mapʣxu{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,uBAbuB,CAAC,SAAX,OAAS,QAEX,KAAK,CAAC,CAAC,CAAC,SAER,MAAM,UAEN,MAAM,SAEN,KAAK,CAAC,CAAC,CAAC,GAEN,SAAS,CA0CrB;AAED;;;;;;;;;;;;;;;GAeG;AACH,qBATuB,CAAC,SAAX,OAAS,QAEX,KAAK,CAAC,CAAC,CAAC,SAER,KAAK,CAAC,CAAC,CAAC,GAEN,KAAK,CAAC,CAAC,CAAC,CAUpB"}UZfx	Jimport {constants} from 'micromark-util-symbol'

/**
 * Like `Array#splice`, but smarter for giant arrays.
 *
 * `Array#splice` takes all items to be inserted as individual argument which
 * causes a stack overflow in V8 when trying to insert 100k items for instance.
 *
 * Otherwise, this does not return the removed items, and takes `items` as an
 * array instead of rest parameters.
 *
 * @template {unknown} T
 *   Item type.
 * @param {Array<T>} list
 *   List to operate on.
 * @param {number} start
 *   Index to remove/insert at (can be negative).
 * @param {number} remove
 *   Number of items to remove.
 * @param {Array<T>} items
 *   Items to inject into `list`.
 * @returns {undefined}
 *   Nothing.
 */
export function splice(list, start, remove, items) {
  const end = list.length
  let chunkStart = 0
  /** @type {Array<unknown>} */
  let parameters

  // Make start between zero and `end` (included).
  if (start < 0) {
    start = -start > end ? 0 : end + start
  } else {
    start = start > end ? end : start
  }

  remove = remove > 0 ? remove : 0

  // No need to chunk the items if there’s only a couple (10k) items.
  if (items.length < constants.v8MaxSafeChunkSize) {
    parameters = Array.from(items)
    parameters.unshift(start, remove)
    // @ts-expect-error Hush, it’s fine.
    list.splice(...parameters)
  } else {
    // Delete `remove` items starting from `start`
    if (remove) list.splice(start, remove)

    // Insert the items in chunks to not cause stack overflows.
    while (chunkStart < items.length) {
      parameters = items.slice(
        chunkStart,
        chunkStart + constants.v8MaxSafeChunkSize
      )
      parameters.unshift(start, 0)
      // @ts-expect-error Hush, it’s fine.
      list.splice(...parameters)

      chunkStart += constants.v8MaxSafeChunkSize
      start += constants.v8MaxSafeChunkSize
    }
  }
}

/**
 * Append `items` (an array) at the end of `list` (another array).
 * When `list` was empty, returns `items` instead.
 *
 * This prevents a potentially expensive operation when `list` is empty,
 * and adds items in batches to prevent V8 from hanging.
 *
 * @template {unknown} T
 *   Item type.
 * @param {Array<T>} list
 *   List to operate on.
 * @param {Array<T>} items
 *   Items to add to `list`.
 * @returns {Array<T>}
 *   Either `list` or `items`.
 */
export function push(list, items) {
  if (list.length > 0) {
    splice(list, list.length, 0, items)
    return list
  }

  return items
}
p,Ⱦx	/**
 * Like `Array#splice`, but smarter for giant arrays.
 *
 * `Array#splice` takes all items to be inserted as individual argument which
 * causes a stack overflow in V8 when trying to insert 100k items for instance.
 *
 * Otherwise, this does not return the removed items, and takes `items` as an
 * array instead of rest parameters.
 *
 * @template {unknown} T
 *   Item type.
 * @param {Array<T>} list
 *   List to operate on.
 * @param {number} start
 *   Index to remove/insert at (can be negative).
 * @param {number} remove
 *   Number of items to remove.
 * @param {Array<T>} items
 *   Items to inject into `list`.
 * @returns {undefined}
 *   Nothing.
 */
export function splice(list, start, remove, items) {
  const end = list.length;
  let chunkStart = 0;
  /** @type {Array<unknown>} */
  let parameters;

  // Make start between zero and `end` (included).
  if (start < 0) {
    start = -start > end ? 0 : end + start;
  } else {
    start = start > end ? end : start;
  }
  remove = remove > 0 ? remove : 0;

  // No need to chunk the items if there’s only a couple (10k) items.
  if (items.length < 10000) {
    parameters = Array.from(items);
    parameters.unshift(start, remove);
    // @ts-expect-error Hush, it’s fine.
    list.splice(...parameters);
  } else {
    // Delete `remove` items starting from `start`
    if (remove) list.splice(start, remove);

    // Insert the items in chunks to not cause stack overflows.
    while (chunkStart < items.length) {
      parameters = items.slice(chunkStart, chunkStart + 10000);
      parameters.unshift(start, 0);
      // @ts-expect-error Hush, it’s fine.
      list.splice(...parameters);
      chunkStart += 10000;
      start += 10000;
    }
  }
}

/**
 * Append `items` (an array) at the end of `list` (another array).
 * When `list` was empty, returns `items` instead.
 *
 * This prevents a potentially expensive operation when `list` is empty,
 * and adds items in batches to prevent V8 from hanging.
 *
 * @template {unknown} T
 *   Item type.
 * @param {Array<T>} list
 *   List to operate on.
 * @param {Array<T>} items
 *   Items to add to `list`.
 * @returns {Array<T>}
 *   Either `list` or `items`.
 */
export function push(list, items) {
  if (list.length > 0) {
    splice(list, list.length, 0, items);
    return list;
  }
  return items;
}{	Hx a
	util-chunked)5,utility to splice and push with giant arrays=:util",
    "utility",
    "chunk",
    "splice",
    "push\util-chunked`a5}x40000 dev D mP|>}/Iנ100644 index.d.ts ۘkU^u#;100644 index.d.ts.map cSK/-j&v100644 index.js lRA^H|++oi100644 license Zbv8f,Q)100644 package.json $x3Y=100644 readme.md x?ɀPQu=bCh<xt 100644 index.d.ts ۘkU^u#;100644 index.d.ts.map cSK/-j&v100644 index.js GEU!.E8+-ܴ-x+/**
 * Classify whether a code represents whitespace, punctuation, or something
 * else.
 *
 * Used for attention (emphasis, strong), whose sequences can open or close
 * based on the class of surrounding characters.
 *
 * > 👉 **Note**: eof (`null`) is seen as whitespace.
 *
 * @param {Code} code
 *   Code.
 * @returns {typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined}
 *   Group.
 */
export function classifyCharacter(code: Code): typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined;
import type { Code } from 'micromark-util-types';
import { constants } from 'micromark-util-symbol';
//# sourceMappingURL=index.d.ts.map \x {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAWA;;;;;;;;;;;;;GAaG;AACH,wCALW,IAAI,GAEF,OAAO,SAAS,CAAC,wBAAwB,GAAG,OAAO,SAAS,CAAC,yBAAyB,GAAG,SAAS,CAe9G;0BApCsB,sBAAsB;0BAQd,uBAAuB"}0D;xG/**
 * @import {Code} from 'micromark-util-types'
 */

import {
  markdownLineEndingOrSpace,
  unicodePunctuation,
  unicodeWhitespace
} from 'micromark-util-character'
import {codes, constants} from 'micromark-util-symbol'

/**
 * Classify whether a code represents whitespace, punctuation, or something
 * else.
 *
 * Used for attention (emphasis, strong), whose sequences can open or close
 * based on the class of surrounding characters.
 *
 * > 👉 **Note**: eof (`null`) is seen as whitespace.
 *
 * @param {Code} code
 *   Code.
 * @returns {typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined}
 *   Group.
 */
export function classifyCharacter(code) {
  if (
    code === codes.eof ||
    markdownLineEndingOrSpace(code) ||
    unicodeWhitespace(code)
  ) {
    return constants.characterGroupWhitespace
  }

  if (unicodePunctuation(code)) {
    return constants.characterGroupPunctuation
  }
}
fGZ2x#/**
 * @import {Code} from 'micromark-util-types'
 */

import { markdownLineEndingOrSpace, unicodePunctuation, unicodeWhitespace } from 'micromark-util-character';
/**
 * Classify whether a code represents whitespace, punctuation, or something
 * else.
 *
 * Used for attention (emphasis, strong), whose sequences can open or close
 * based on the class of surrounding characters.
 *
 * > 👉 **Note**: eof (`null`) is seen as whitespace.
 *
 * @param {Code} code
 *   Code.
 * @returns {typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined}
 *   Group.
 */
export function classifyCharacter(code) {
  if (code === null || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) {
    return 1;
  }
  if (unicodePunctuation(code)) {
    return 2;
  }
}]9VNxj[)# micromark-util-classify89classify whether a character is whitespace or
punctuationf,classifyCharacter(code)`](#classifycharacterf3n algorithm to classify characters into 3 categorieDlassify3>{classifyCharacter}&lassify`{classifyCharacter}&lassify52/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 */
function tokenizeAttention(effects, ok) {
  return start

  // …

  /** @type {State} */
  function sequence(code) {
    if (code === marker) {
      // …
    }

    const token = effects.exit('attentionSequence')
    const after = classifyCharacter(code)
    const open =
      !after || (after === constants.characterGroupPunctuation && before)
    const close =
      !before || (before === constants.characterGroupPunctuation && a fter)
    // …
  }

  // …
}0-
[`classifyCharacter`][api-classify-character
%classifyCharacter(code)`

Classify whether a code represents whitespace, punctuation, or something
else.

Used for attention (emphasis, strong), whose sequences can open or close
based on the class of surrounding characters.

> 👉 **Note**: eof (`null`) is seen as whitespaceADaGroup (`constants.characterGroupWhitespace`,
`constants.characterGroupPunctuation`, or `undefined!olassify}"lassify+&Klassify!'&lassify!'Classifyb'
0api-classify-character]: #classifycharactercode
x 100644 index.d.ts tˋ!_b@}b100644 index.d.ts.map {B֑EtV100644 index.js (MD#'`V#i	100644 license Zbv8f,Q)100644 package.json o	*&d^YGt.100644 readme.md d|~PXķ3x7/**
 * Combine multiple syntax extensions into one.
 *
 * @param {ReadonlyArray<Extension>} extensions
 *   List of syntax extensions.
 * @returns {NormalizedExtension}
 *   A single combined extension.
 */
export function combineExtensions(extensions: ReadonlyArray<Extension>): NormalizedExtension;
/**
 * Combine multiple HTML extensions into one.
 *
 * @param {ReadonlyArray<HtmlExtension>} htmlExtensions
 *   List of HTML extensions.
 * @returns {HtmlExtension}
 *   Single combined HTML extension.
 */
export function combineHtmlExtensions(htmlExtensions: ReadonlyArray<HtmlExtension>): HtmlExtension;
import type { Extension } from 'micromark-util-types';
import type { NormalizedExtension } from 'micromark-util-types';
import type { HtmlExtension } from 'micromark-util-types';
//# sourceMappingURL=index.d.ts.map%ٽx{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAaA;;;;;;;GAOG;AACH,8CALW,aAAa,CAAC,SAAS,CAAC,GAEtB,mBAAmB,CAa/B;AA+DD;;;;;;;GAOG;AACH,sDALW,aAAa,CAAC,aAAa,CAAC,GAE1B,aAAa,CAazB;+BA1GS,sBAAsB;yCAAtB,sBAAsB;mCAAtB,sBAAsB"}NDx	/**
 * @import {
 *   Extension,
 *   Handles,
 *   HtmlExtension,
 *   NormalizedExtension
 * } from 'micromark-util-types'
 */

import {splice} from 'micromark-util-chunked'

const hasOwnProperty = {}.hasOwnProperty

/**
 * Combine multiple syntax extensions into one.
 *
 * @param {ReadonlyArray<Extension>} extensions
 *   List of syntax extensions.
 * @returns {NormalizedExtension}
 *   A single combined extension.
 */
export function combineExtensions(extensions) {
  /** @type {NormalizedExtension} */
  const all = {}
  let index = -1

  while (++index < extensions.length) {
    syntaxExtension(all, extensions[index])
  }

  return all
}

/**
 * Merge `extension` into `all`.
 *
 * @param {NormalizedExtension} all
 *   Extension to merge into.
 * @param {Extension} extension
 *   Extension to merge.
 * @returns {undefined}
 *   Nothing.
 */
function syntaxExtension(all, extension) {
  /** @type {keyof Extension} */
  let hook

  for (hook in extension) {
    const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined
    /** @type {Record<string, unknown>} */
    const left = maybe || (all[hook] = {})
    /** @type {Record<string, unknown> | undefined} */
    const right = extension[hook]
    /** @type {string} */
    let code

    if (right) {
      for (code in right) {
        if (!hasOwnProperty.call(left, code)) left[code] = []
        const value = right[code]
        constructs(
          // @ts-expect-error Looks like a list.
          left[code],
          Array.isArray(value) ? value : value ? [value] : []
        )
      }
    }
  }
}

/**
 * Merge `list` into `existing` (both lists of constructs).
 * Mutates `existing`.
 *
 * @param {Array<unknown>} existing
 *   List of constructs to merge into.
 * @param {Array<unknown>} list
 *   List of constructs to merge.
 * @returns {undefined}
 *   Nothing.
 */
function constructs(existing, list) {
  let index = -1
  /** @type {Array<unknown>} */
  const before = []

  while (++index < list.length) {
    // @ts-expect-error Looks like an object.
    ;(list[index].add === 'after' ? existing : before).push(list[index])
  }

  splice(existing, 0, 0, before)
}

/**
 * Combine multiple HTML extensions into one.
 *
 * @param {ReadonlyArray<HtmlExtension>} htmlExtensions
 *   List of HTML extensions.
 * @returns {HtmlExtension}
 *   Single combined HTML extension.
 */
export function combineHtmlExtensions(htmlExtensions) {
  /** @type {HtmlExtension} */
  const handlers = {}
  let index = -1

  while (++index < htmlExtensions.length) {
    htmlExtension(handlers, htmlExtensions[index])
  }

  return handlers
}

/**
 * Merge `extension` into `all`.
 *
 * @param {HtmlExtension} all
 *   Extension to merge into.
 * @param {HtmlExtension} extension
 *   Extension to merge.
 * @returns {undefined}
 *   Nothing.
 */
function htmlExtension(all, extension) {
  /** @type {keyof HtmlExtension} */
  let hook

  for (hook in extension) {
    const maybe = hasOwnProperty.call(all, hook) ? all[hook] : undefined
    const left = maybe || (all[hook] = {})
    const right = extension[hook]
    /** @type {keyof Handles} */
    let type

    if (right) {
      for (type in right) {
        // @ts-expect-error assume document vs regular handler are managed correctly.
        left[type] = right[type]
      }
    }
  }
}
4
x B
	ombine-extensions.A ombine syntax or html extensionsX%extension",
    "combine",
    "merge)bombine-extensionsD"./index.js"%,unked:dguard-for-in": "off",H6J(Ax# micromark-util-combine-extensions

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][bundle-size-badge]][bundle-size]
[![Sponsors][sponsors-badge]][opencollective]
[![Backers][backers-badge]][opencollective]
[![Chat][chat-badge]][chat]

[micromark][] utility to combine [syntax][] or [html][] extensions.

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`combineExtensions(extensions)`](#combineextensionsextensions)
  * [`combineHtmlExtensions(htmlExtensions)`](#combinehtmlextensionshtmlextensions)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package can merge multiple extensions into one.

## When should I use this?

This package might be useful when you are making “presets”, such as
[`micromark-extension-gfm`][micromark-extension-gfm].

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install micromark-util-combine-extensions
```

In Deno with [`esm.sh`][esmsh]:

```js
import {combineExtensions} from 'https://esm.sh/micromark-util-combine-extensions@1'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {combineExtensions} from 'https://esm.sh/micromark-util-combine-extensions@1?bundle'
</script>
```

## Use

```js
import {gfmAutolinkLiteral} from 'micromark-extension-gfm-autolink-literal'
import {gfmStrikethrough} from 'micromark-extension-gfm-strikethrough'
import {gfmTable} from 'micromark-extension-gfm-table'
import {gfmTaskListItem} from 'micromark-extension-gfm-task-list-item'
import {combineExtensions} from 'micromark-util-combine-extensions'

const gfm = combineExtensions([gfmAutolinkLiteral, gfmStrikethrough(), gfmTable, gfmTaskListItem])
```

## API

This module exports the identifiers
[`combineExtensions`][api-combine-extensions] and
[`combineHtmlExtensions`][api-combine-html-extensions].
There is no default export.

### `combineExtensions(extensions)`

Combine multiple syntax extensions into one.

###### Parameters

* `extensions` (`Array<Extension>`)
  — list of syntax extensions

###### Returns

A single combined extension (`Extension`).

### `combineHtmlExtensions(htmlExtensions)`

Combine multiple html extensions into one.

###### Parameters

* `htmlExtensions` (`Array<HtmlExtension>`)
  — list of HTML extensions

###### Returns

A single combined HTML extension (`HtmlExtension`).

## Types

This package is fully typed with [TypeScript][].
It exports no additional types.

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-util-combine-extensions@2`, compatible with Node.js 16.
This package works with `micromark@3`.

## Security

This package is safe.
See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
submit a security report.

## Contribute

See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg

[build]: https://github.com/micromark/micromark/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg

[coverage]: https://codecov.io/github/micromark/micromark

[downloads-badge]: https://img.shields.io/npm/dm/micromark-util-combine-extensions.svg

[downloads]: https://www.npmjs.com/package/micromark-util-combine-extensions

[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-combine-extensions

[bundle-size]: https://bundlejs.com/?q=micromark-util-combine-extensions

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[opencollective]: https://opencollective.com/unified

[npm]: https://docs.npmjs.com/cli/install

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/micromark/micromark/discussions

[license]: https://github.com/micromark/micromark/blob/main/license

[author]: https://wooorm.com

[health]: https://github.com/micromark/.github

[securitymd]: https://github.com/micromark/.github/blob/main/security.md

[contributing]: https://github.com/micromark/.github/blob/main/contributing.md

[support]: https://github.com/micromark/.github/blob/main/support.md

[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md

[syntax]: https://github.com/micromark/micromark#syntaxextension

[html]: https://github.com/micromark/micromark#htmlextension

[typescript]: https://www.typescriptlang.org

[micromark]: https://github.com/micromark/micromark

[micromark-extension-gfm]: https://github.com/micromark/micromark-extension-gfm

[api-combine-extensions]: #combineextensionsextensions

[api-combine-html-extensions]: #combinehtmlextensionshtmlextensions
Ix40000 dev ޸'D-{Y100644 index.d.ts 3;۽kQ!D100644 index.d.ts.map hQOZw`hv100644 index.js u׺\N.=}#1#100644 license Zbv8f,Q)100644 package.json u@f>Yp}100644 readme.md FśW[SN~sse9xt 100644 index.d.ts 3;۽kQ!D100644 index.d.ts.map hQOZw`hv100644 index.js lB83 J?	G	m5{>JZ)5 x	/**
 * Turn the number (in string form as either hexa- or plain decimal) coming from
 * a numeric character reference into a character.
 *
 * Sort of like `String.fromCodePoint(Number.parseInt(value, base))`, but makes
 * non-characters and control characters safe.
 *
 * @param {string} value
 *   Value to decode.
 * @param {number} base
 *   Numeric base.
 * @returns {string}
 *   Character.
 */
export function decodeNumericCharacterReference(value: string, base: number): string;
//# sourceMappingURL=index.d.ts.mapu
x ^{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,uDAPW,MAAM,QAEN,MAAM,GAEJ,MAAM,CA4BlB"}-0<Lx9import {codes, values} from 'micromark-util-symbol'

/**
 * Turn the number (in string form as either hexa- or plain decimal) coming from
 * a numeric character reference into a character.
 *
 * Sort of like `String.fromCodePoint(Number.parseInt(value, base))`, but makes
 * non-characters and control characters safe.
 *
 * @param {string} value
 *   Value to decode.
 * @param {number} base
 *   Numeric base.
 * @returns {string}
 *   Character.
 */
export function decodeNumericCharacterReference(value, base) {
  const code = Number.parseInt(value, base)

  if (
    // C0 except for HT, LF, FF, CR, space.
    code < codes.ht ||
    code === codes.vt ||
    (code > codes.cr && code < codes.space) ||
    // Control character (DEL) of C0, and C1 controls.
    (code > codes.tilde && code < 160) ||
    // Lone high surrogates and low surrogates.
    (code > 55_295 && code < 57_344) ||
    // Noncharacters.
    (code > 64_975 && code < 65_008) ||
    /* eslint-disable no-bitwise */
    (code & 65_535) === 65_535 ||
    (code & 65_535) === 65_534 ||
    /* eslint-enable no-bitwise */
    // Out of range
    code > 1_114_111
  ) {
    return values.replacementCharacter
  }

  return String.fromCodePoint(code)
}
zBx%/**
 * Turn the number (in string form as either hexa- or plain decimal) coming from
 * a numeric character reference into a character.
 *
 * Sort of like `String.fromCodePoint(Number.parseInt(value, base))`, but makes
 * non-characters and control characters safe.
 *
 * @param {string} value
 *   Value to decode.
 * @param {number} base
 *   Numeric base.
 * @returns {string}
 *   Character.
 */
export function decodeNumericCharacterReference(value, base) {
  const code = Number.parseInt(value, base);
  if (
  // C0 except for HT, LF, FF, CR, space.
  code < 9 || code === 11 || code > 13 && code < 32 ||
  // Control character (DEL) of C0, and C1 controls.
  code > 126 && code < 160 ||
  // Lone high surrogates and low surrogates.
  code > 55_295 && code < 57_344 ||
  // Noncharacters.
  code > 64_975 && code < 65_008 || /* eslint-disable no-bitwise */
  (code & 65_535) === 65_535 || (code & 65_535) === 65_534 || /* eslint-enable no-bitwise */
  // Out of range
  code > 1_114_111) {
    return "\uFFFD";
  }
  return String.fromCodePoint(code);
}HKYx

=util-decode-numeric-character-reference",
  "version": "2.0.2?.utility to decode numeric character references=^util",
    "utility",
    "decode",
    "numeric",
    "number",
    "character",
    "referen^%util-decode-numeric-character-referen^aZ#xc# micromark-util-encode

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][bundle-size-badge]][bundle-size]
[![Sponsors][sponsors-badge]][opencollective]
[![Backers][backers-badge]][opencollective]
[![Chat][chat-badge]][chat]

[micromark][] utility to encode dangerous html characters.

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`encode(value)`](#encodevalue)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package exposes an algorithm to make text safe for embedding in HTML.

## When should I use this?

This package might be useful when you are making your own micromark extensions.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install micromark-util-encode
```

In Deno with [`esm.sh`][esmsh]:

```js
import {encode} from 'https://esm.sh/micromark-util-encode@1'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {encode} from 'https://esm.sh/micromark-util-encode@1?bundle'
</script>
```

## Use

```js
import {encode} from 'micromark-util-encode'

encode('<3') // '&lt;3'
```

## API

This module exports the identifier [`encode`][api-encode].
There is no default export.

### `encode(value)`

Encode only the dangerous HTML characters.

This ensures that certain characters which have special meaning in HTML are
dealt with.
Technically, we can skip `>` and `"` in many cases, but CM includes them.

###### Parameters

* `value` (`string`)
  — value to encode

###### Returns

Encoded value (`string`).

## Types

This package is fully typed with [TypeScript][].
It exports no additional types.

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-util-encode@2`, compatible with Node.js 16.
This package works with `micromark@3`.

## Security

This package is safe.
See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
submit a security report.

## Contribute

See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg

[build]: https://github.com/micromark/micromark/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg

[coverage]: https://codecov.io/github/micromark/micromark

[downloads-badge]: https://img.shields.io/npm/dm/micromark-util-encode.svg

[downloads]: https://www.npmjs.com/package/micromark-util-encode

[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-encode

[bundle-size]: https://bundlejs.com/?q=micromark-util-encode

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[opencollective]: https://opencollective.com/unified

[npm]: https://docs.npmjs.com/cli/install

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/micromark/micromark/discussions

[license]: https://github.com/micromark/micromark/blob/main/license

[author]: https://wooorm.com

[health]: https://github.com/micromark/.github

[securitymd]: https://github.com/micromark/.github/blob/main/security.md

[contributing]: https://github.com/micromark/.github/blob/main/contributing.md

[support]: https://github.com/micromark/.github/blob/main/support.md

[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md

[typescript]: https://www.typescriptlang.org

[micromark]: https://github.com/micromark/micromark

[api-encode]: #encodevalue
*(^qx")2# micromark-util-decode-numeric-character-referenc/"decode numeric character referencedXdecodeNumericCharacterReference(value, base)`](#decodenumericcharacterreferencevalue-bas#decode numeric character references!decode-numeric-character-referenc6decodeNumericCharacterReferenc*'!decode-numeric-character-referencVXdecodeNumericCharacterReferenc*'!decode-numeric-character-referenc1decodeNumericCharacterReference} from 'micromark-util-decode-numeric-character-reference'

decodeNumericCharacterReference('41', 16) // 'A'
decodeNumericCharacterReference('65', 10) // 'A'
decodeNumericCharacterReference('A', 16) // '\n'
decodeNumericCharacterReference('7F', 16) // '�' - Control
decodeNumericCharacterReference('110000', 16) // '�' - Out of range
```

## API
Z#K:
[`decodeNumericCharacterReference`][api-decode-numeric-character-referenc&decodeNumericCharacterReference(value, base)`

Turn the number (in string form as either hexa- or plain decimal) coming from
a numeric character reference into a character.

Sort of like `String.fromCodePoint(Number.parseInt(value, base))`, but makes
non'-characters and control characters safe:_decode
* `base` (`number`, probably `10` or `16`)
  — numeric base

###### Returns

Characterw!decode-numeric-character-referenco
normalize-identifier@normalize-identifieranormalize-identifier8normalize-identifierIPdecode-numeric-character-reference]: #decodenumericcharacterreferencevalue-base
ix40000 dev 7uQs`K&100644 index.d.ts s	w1%	100644 index.d.ts.map w>Bm/XzzQn100644 index.js | kRdf100644 license Zbv8f,Q)100644 package.json &`>H1ٮi100644 readme.md )擎9phWWjMxt 100644 index.d.ts s	w1%	100644 index.d.ts.map w>Bm/XzzQn100644 index.js !Lf?ٛ 0.lxe/**
 * Decode markdown strings (which occur in places such as fenced code info
 * strings, destinations, labels, and titles).
 *
 * The “string” content type allows character escapes and -references.
 * This decodes those.
 *
 * @param {string} value
 *   Value to decode.
 * @returns {string}
 *   Decoded value.
 */
export function decodeString(value: string): string;
//# sourceMappingURL=index.d.ts.map)T1x( aOA;;;;;;;;;;;GAWG;AACH,oKlB"}$Xx{import {decodeNamedCharacterReference} from 'decode-named-character-reference'
import {decodeNumericCharacterReference} from 'micromark-util-decode-numeric-character-reference'
import {codes, constants} from 'micromark-util-symbol'

const characterEscapeOrReference =
  /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi

/**
 * Decode markdown strings (which occur in places such as fenced code info
 * strings, destinations, labels, and titles).
 *
 * The “string” content type allows character escapes and -references.
 * This decodes those.
 *
 * @param {string} value
 *   Value to decode.
 * @returns {string}
 *   Decoded value.
 */
export function decodeString(value) {
  return value.replace(characterEscapeOrReference, decode)
}

/**
 * @param {string} $0
 *   Match.
 * @param {string} $1
 *   Character escape.
 * @param {string} $2
 *   Character reference.
 * @returns {string}
 *   Decoded value
 */
function decode($0, $1, $2) {
  if ($1) {
    // Escape.
    return $1
  }

  // Reference.
  const head = $2.charCodeAt(0)

  if (head === codes.numberSign) {
    const head = $2.charCodeAt(1)
    const hex = head === codes.lowercaseX || head === codes.uppercaseX
    return decodeNumericCharacterReference(
      $2.slice(hex ? 2 : 1),
      hex ? constants.numericBaseHexadecimal : constants.numericBaseDecimal
    )
  }

  return decodeNamedCharacterReference($2) || $0
}
brbNximport { decodeNamedCharacterReference } from 'decode-named-character-reference';
import { decodeNumericCharacterReference } from 'micromark-util-decode-numeric-character-reference';
const characterEscapeOrReference = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;

/**
 * Decode markdown strings (which occur in places such as fenced code info
 * strings, destinations, labels, and titles).
 *
 * The “string” content type allows character escapes and -references.
 * This decodes those.
 *
 * @param {string} value
 *   Value to decode.
 * @returns {string}
 *   Decoded value.
 */
export function decodeString(value) {
  return value.replace(characterEscapeOrReference, decode);
}

/**
 * @param {string} $0
 *   Match.
 * @param {string} $1
 *   Character escape.
 * @param {string} $2
 *   Character reference.
 * @returns {string}
 *   Decoded value
 */
function decode($0, $1, $2) {
  if ($1) {
    // Escape.
    return $1;
  }

  // Reference.
  const head = $2.charCodeAt(0);
  if (head === 35) {
    const head = $2.charCodeAt(1);
    const hex = head === 120 || head === 88;
    return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10);
  }
  return decodeNamedCharacterReference($2) || $0;
}3{i}qx!M$# micromark-util-decode-string}bundle-size-badge]][bundle-$open(open+?icromark][] utility to decode markdown strings.

## Contents

*q"4[When should I use this?](#when-should-i-use-this)
*][Use](#use)
* [API](#api)
  * [`decodeString(value)`](#decodestringvalue)
* [Types](#types)
*"#[Security](#security)
*^}4exposes an algorithm to parse character escapes and character
references.

## When should I use this?

This package might be us6eful when you are making your own micromark extensionsxticromark-util-decode-string	5AdecodeString} from 'https://esm.sh/micromark-util-decode-string@1	UAdecodeString} from 'https://esm.sh/micromark-util-decode-string@1k
 ```js
import {decodeString} from 'micromark-util-decode-string'

decodeString('a &semi; b') // 'a ; b'
decodeString('a \\; b') // 'a ; b'
decodeString('a ; b') // 'a ; b'
```

## API

This module exports the identifier [`decodeString`][api-decode-string]m$decodeString(value)`

Decode markdown strings (which occur in places such as fenced code info strings,
destinations, labels, and titles).

The “string” content type allows character escapes and -references.
This decodes those.

###### Parameters

* `Rvalue` (`string`)
  — value to decode

###### Returns

Decoded value (`string`).@exports no additional typesicromark-util-decode-string@ This package works with `micromark@3`.

## Security

This package is safe.
See [`security.md`][securitymd] in [`micromark/.gith1ub`][health] for how to
submit a security report.<%micromark/.github`][health] for ways
sf%W7f%D1%",1%y1"icromark-util-normalize-identifier2,icromark-util-normalize-identifier

[bundle-,icromark-util-normalize-identifier

[bundle- "icromark-util-normalize-identifieropen2B cf%/discussions

[licenseP%)/blob/main/!Dmicromark/.github

[securitymdP% !
ecurity.mdc!%	micromark!B	micromark!9	micromark$"( .%5'api-decode-string]: #decodestringvalue
ux 100644 index.d.ts v&[#gׁ:n100644 index.d.ts.map ģGiT100644 index.js 9@A"H9GSLz100644 license Zbv8f,Q)100644 package.json lk;Z(,)L\100644 readme.md ')/":AT^E$]Xűxn/**
 * Encode only the dangerous HTML characters.
 *
 * This ensures that certain characters which have special meaning in HTML are
 * dealt with.
 * Technically, we can skip `>` and `"` in many cases, but CM includes them.
 *
 * @param {string} value
 *   Value to encode.
 * @returns {string}
 *   Encoded value.
 */
export function encode(value: string): string;
//# sourceMappingURL=index.d.ts.mapƌ=fx. n'GAWG;AACH,8BALW,MAAM,GAEJ,MAAM,CAqBlB"}1յ/x
const characterReferences = {'"': 'quot', '&': 'amp', '<': 'lt', '>': 'gt'}

/**
 * Encode only the dangerous HTML characters.
 *
 * This ensures that certain characters which have special meaning in HTML are
 * dealt with.
 * Technically, we can skip `>` and `"` in many cases, but CM includes them.
 *
 * @param {string} value
 *   Value to encode.
 * @returns {string}
 *   Encoded value.
 */
export function encode(value) {
  return value.replace(/["&<>]/g, replace)

  /**
   * @param {string} value
   *   Value to replace.
   * @returns {string}
   *   Encoded value.
   */
  function replace(value) {
    return (
      '&' +
      characterReferences[
        /** @type {keyof typeof characterReferences} */ (value)
      ] +
      ';'
    )
  }
}
V6Ex_{
  "name": "micromark-util-encode",
  "version": "2.0.1",
  "description": "micromark utility to encode dangerous html characters",
  "license": "MIT",
  "keywords": [
    "micromark",
    "util",
    "utility",
    "html",
    "encode"
  ],
  "repository": "https://github.com/micromark/micromark/tree/main/packages/micromark-util-encode",
  "bugs": "https://github.com/micromark/micromark/issues",
  "funding": [
    {
      "type": "GitHub Sponsors",
      "url": "https://github.com/sponsors/unifiedjs"
    },
    {
      "type": "OpenCollective",
      "url": "https://opencollective.com/unified"
    }
  ],
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "sideEffects": false,
  "type": "module",
  "files": [
    "index.d.ts.map",
    "index.d.ts",
    "index.js"
  ],
  "exports": "./index.js",
  "xo": {
    "envs": [
      "shared-node-browser"
    ],
    "prettier": true,
    "rules": {
      "unicorn/prefer-string-replace-all": "off",
      "unicorn/prefer-code-point": "off"
    }
  }
}
9HTkx 100644 index.d.ts ^͕!L42H̵Ej100644 index.d.ts.map V.YC~ؗT''100644 index.js 
PT5CX_100644 license Zbv8f,Q)100644 package.json (hgoO/100644 readme.md t-nLq;{>.KX{@x /**
 * List of lowercase HTML “block” tag names.
 *
 * The list, when parsing HTML (flow), results in more relaxed rules (condition
 * 6).
 * Because they are known blocks, the HTML-like syntax doesn’t have to be
 * strictly parsed.
 * For tag names not in this list, a more strict algorithm (condition 7) is used
 * to detect whether the HTML-like syntax is seen as HTML (flow) or not.
 *
 * This is copied from:
 * <https://spec.commonmark.org/0.30/#html-blocks>.
 *
 * > 👉 **Note**: `search` was added in `CommonMark@0.31`.
 */
export const htmlBlockNames: string[];
/**
 * List of lowercase HTML “raw” tag names.
 *
 * The list, when parsing HTML (flow), results in HTML that can include lines
 * without exiting, until a closing tag also in this list is found (condition
 * 1).
 *
 * This module is copied from:
 * <https://spec.commonmark.org/0.30/#html-blocks>.
 *
 * > 👉 **Note**: `textarea` was added in `CommonMark@0.30`.
 */
export const htmlRawNames: string[];
//# sourceMappingURL=index.d.ts.mapV<
x \{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,sCA+DC;AAED;;;;;;;;;;;GAWG;AACH,oCAAkE"}iX0ixo/**
 * List of lowercase HTML “block” tag names.
 *
 * The list, when parsing HTML (flow), results in more relaxed rules (condition
 * 6).
 * Because they are known blocks, the HTML-like syntax doesn’t have to be
 * strictly parsed.
 * For tag names not in this list, a more strict algorithm (condition 7) is used
 * to detect whether the HTML-like syntax is seen as HTML (flow) or not.
 *
 * This is copied from:
 * <https://spec.commonmark.org/0.30/#html-blocks>.
 *
 * > 👉 **Note**: `search` was added in `CommonMark@0.31`.
 */
export const htmlBlockNames = [
  'address',
  'article',
  'aside',
  'base',
  'basefont',
  'blockquote',
  'body',
  'caption',
  'center',
  'col',
  'colgroup',
  'dd',
  'details',
  'dialog',
  'dir',
  'div',
  'dl',
  'dt',
  'fieldset',
  'figcaption',
  'figure',
  'footer',
  'form',
  'frame',
  'frameset',
  'h1',
  'h2',
  'h3',
  'h4',
  'h5',
  'h6',
  'head',
  'header',
  'hr',
  'html',
  'iframe',
  'legend',
  'li',
  'link',
  'main',
  'menu',
  'menuitem',
  'nav',
  'noframes',
  'ol',
  'optgroup',
  'option',
  'p',
  'param',
  'search',
  'section',
  'summary',
  'table',
  'tbody',
  'td',
  'tfoot',
  'th',
  'thead',
  'title',
  'tr',
  'track',
  'ul'
]

/**
 * List of lowercase HTML “raw” tag names.
 *
 * The list, when parsing HTML (flow), results in HTML that can include lines
 * without exiting, until a closing tag also in this list is found (condition
 * 1).
 *
 * This module is copied from:
 * <https://spec.commonmark.org/0.30/#html-blocks>.
 *
 * > 👉 **Note**: `textarea` was added in `CommonMark@0.30`.
 */
export const htmlRawNames = ['pre', 'script', 'style', 'textarea']
)Cx<{
  "name": "micromark-util-html-tag-name",
  "version": "2.0.1",
  "description": "micromark utility with list of html tag names",
  "license": "MIT",
  "keywords": [
    "micromark",
    "util",
    "utility",
    "html",
    "tag",
    "name"
  ],
  "repository": "https://github.com/micromark/micromark/tree/main/packages/micromark-util-html-tag-name",
  "bugs": "https://github.com/micromark/micromark/issues",
  "funding": [
    {
      "type": "GitHub Sponsors",
      "url": "https://github.com/sponsors/unifiedjs"
    },
    {
      "type": "OpenCollective",
      "url": "https://opencollective.com/unified"
    }
  ],
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "sideEffects": false,
  "type": "module",
  "files": [
    "index.d.ts.map",
    "index.d.ts",
    "index.js"
  ],
  "exports": "./index.js",
  "xo": {
    "envs": [
      "shared-node-browser"
    ],
    "prettier": true,
    "rules": {
      "unicorn/prefer-code-point": "off"
    }
  }
}
HG]mrx.)*# micromark-util-html-tag-nam$#utility with list of html tag names~DhtmlBlockNames`](#htmlblocknames)
  * [`htmlRawNames`](#htmlrawnames=%a list of known tag names to markdown/<only useful if you want to build an alternative to micromarkb}util-html-tag-nam6htmlBlockNames, htmlRawNames!util-html-tag-namZXhtmlBlockNames, htmlRawNames!util-html-tag-nam1htmlBlockNames, htmlRawNam[html-tag-name'

console.log(htmlBlockNames) // ['address', 'article', …]
console.log(htmlRawNames) // ['pre', 'script', …]
/Rs [`htmlBlockNames`][api-html-block-names]
and [`htmlRawNames`][api-html-raw-namesR%htmlBlockNames`

List of lowercase HTML “block” tag names (`Array<string>`).

The list, when parsing HTML (flow), results in more relaxed rules (condition
6\).
Because they are known blocks, the HTML-like syntax doesn’t have to be strictly
parsed.
For tag names not in this list, a more strict algorithm (condition 7) is used
to detect whether the HTML-like syntax is seen as HTML (flow) or not.

This is copied from:
<https://spec.commonmark.org/0.30/#html-blocks>.

> 👉 **Note**: `search` was added in `CommonMark@0.31`.

### `htmlRawNames`

List of lowercase HTML “raw” tag names (`Array<string>`).

The list, when parsing HTML (flow), results in HTML that can include lines
without exiting, until a closing tag also in this list is found (condition
1\).

This module is copied from:
<https://spec.commonmark.org/0.30/#html-blocks>.

> 👉 **Note**: `textarea` was added in `CommonMark@0.30`
gutil-html-tag-namutil-html-tag-nam<util-html-tag-namutil-html-tag-nam4util-html-tag-namHhtml-block-names]: #htmlblocknames

[api-html-raw-names]: #htmlrawnames
lx40000 dev H#n+WD.r100644 index.d.ts O`1fcTR100644 index.d.ts.map hJrL-_100644 index.js '_jrz2^Pۓ100644 license Zbv8f,Q)100644 package.json O-)HUكǎmAp100644 readme.md 8:ŕ-!>Ecxt 100644 index.d.ts O`1fcTR100644 index.d.ts.map hJrL-_100644 index.js LWh X/N2x(/**
 * Normalize an identifier (as found in references, definitions).
 *
 * Collapses markdown whitespace, trim, and then lower- and uppercase.
 *
 * Some characters are considered “uppercase”, such as U+03F4 (`ϴ`), but if their
 * lowercase counterpart (U+03B8 (`θ`)) is uppercased will result in a different
 * uppercase character (U+0398 (`Θ`)).
 * So, to get a canonical form, we perform both lower- and uppercase.
 *
 * Using uppercase last makes sure keys will never interact with default
 * prototypal values (such as `constructor`): nothing in the prototype of
 * `Object` is uppercase.
 *
 * @param {string} value
 *   Identifier to normalize.
 * @returns {string}
 *   Normalized identifier.
 */
export function normalizeIdentifier(value: string): string;
//# sourceMappingURL=index.d.ts.mapG5UxTimport {values} from 'micromark-util-symbol'

/**
 * Normalize an identifier (as found in references, definitions).
 *
 * Collapses markdown whitespace, trim, and then lower- and uppercase.
 *
 * Some characters are considered “uppercase”, such as U+03F4 (`ϴ`), but if their
 * lowercase counterpart (U+03B8 (`θ`)) is uppercased will result in a different
 * uppercase character (U+0398 (`Θ`)).
 * So, to get a canonical form, we perform both lower- and uppercase.
 *
 * Using uppercase last makes sure keys will never interact with default
 * prototypal values (such as `constructor`): nothing in the prototype of
 * `Object` is uppercase.
 *
 * @param {string} value
 *   Identifier to normalize.
 * @returns {string}
 *   Normalized identifier.
 */
export function normalizeIdentifier(value) {
  return (
    value
      // Collapse markdown whitespace.
      .replace(/[\t\n\r ]+/g, values.space)
      // Trim.
      .replace(/^ | $/g, '')
      // Some characters are considered “uppercase”, but if their lowercase
      // counterpart is uppercased will result in a different uppercase
      // character.
      // Hence, to get that form, we perform both lower- and uppercase.
      // Upper case makes sure keys will not interact with default prototypal
      // methods: no method is uppercase.
      .toLowerCase()
      .toUpperCase()
  )
}
ZNx/**
 * Normalize an identifier (as found in references, definitions).
 *
 * Collapses markdown whitespace, trim, and then lower- and uppercase.
 *
 * Some characters are considered “uppercase”, such as U+03F4 (`ϴ`), but if their
 * lowercase counterpart (U+03B8 (`θ`)) is uppercased will result in a different
 * uppercase character (U+0398 (`Θ`)).
 * So, to get a canonical form, we perform both lower- and uppercase.
 *
 * Using uppercase last makes sure keys will never interact with default
 * prototypal values (such as `constructor`): nothing in the prototype of
 * `Object` is uppercase.
 *
 * @param {string} value
 *   Identifier to normalize.
 * @returns {string}
 *   Normalized identifier.
 */
export function normalizeIdentifier(value) {
  return value
  // Collapse markdown whitespace.
  .replace(/[\t\n\r ]+/g, " ")
  // Trim.
  .replace(/^ | $/g, '')
  // Some characters are considered “uppercase”, but if their lowercase
  // counterpart is uppercased will result in a different uppercase
  // character.
  // Hence, to get that form, we perform both lower- and uppercase.
  // Upper case makes sure keys will not interact with default prototypal
  // methods: no method is uppercase.
  .toLowerCase().toUpperCase();
}#mx

util-normalize-identifier*52utility normalize identifiers (as found in referenN@util",
    "utility",
    "normalize",
    "id",
    "identifier\util-normalize-identifierdsymbolm3!?,
      "unicorn/prefer-string-replace-all": "off"
    }
  }
}
Y\x6[(## micromark-util-normalize-identifi-normalize identifiersf5normalizeIdentifier(value)`](#normalizeidentifiervalui6n algorithm to normalize identifiers found in markdownEnormalize-identifi;6{normalizeIdentifier}%normalize-identifiX{normalizeIdentifier}%normalize-identifi=2normalizeIdentifier} from 'micromark-util-normalize-identifier'

normalizeIdentifier(' a ') // 'A'
normalizeIdentifier('a\t\r\nb') // 'A B'
normalizeIdentifier('ТОЛПОЙ') // 'ТОЛПОЙ'
normalizeIdentifier('Толпой') // 'ТОЛПОЙ'
```

#)1
[`normalizeIdentifier`][api-normalize-identifier
%normalizeIdentifier(value)`

Normalize an identifier (as found in references, definitions).

Collapses markdown whitespace, trim, and then lower- and uppercase.

Some characters are considered “uppercase”, such as U+03F4 (`ϴ`), but if their
lowercase counterpart (U+03B8 (`θ`)) is uppercased will result in a different
uppercase character (U+0398 (`Θ`)).
So, to get a canonical form, we perform both lower- and uppercase.

Using uppercase last makes sure keys will never interact with default
prototypTal values (such as `constructor`): nothing in the prototype of `Object`
is uppercaseA.value` (`string`)
  — identifier to normaliz Normalized identifier (`string!nnormalize-identifi"normalize-identifi3&Bnormalize-identifi|&normalize-identifi)':normalize-identifij'5api-normalize-identifier]: #normalizeidentifiervalue
?.x 100644 index.d.ts kdWj#iT/i100644 index.d.ts.map 2л{Ld{0.100644 index.js i2ǡ{d[a100644 license Zbv8f,Q)100644 package.json ²)Dw5pl7100644 readme.md GSu,Is,TbPR`.0x/**
 * @import {Event, Resolver, TokenizeContext} from 'micromark-util-types'
 */
/**
 * Call all `resolveAll`s.
 *
 * @param {ReadonlyArray<{resolveAll?: Resolver | undefined}>} constructs
 *   List of constructs, optionally with `resolveAll`s.
 * @param {Array<Event>} events
 *   List of events.
 * @param {TokenizeContext} context
 *   Context used by `tokenize`.
 * @returns {Array<Event>}
 *   Changed events.
 */
export function resolveAll(constructs: ReadonlyArray<{
    resolveAll?: Resolver | undefined;
}>, events: Array<Event>, context: TokenizeContext): Array<Event>;
import type { Resolver } from 'micromark-util-types';
import type { Event } from 'micromark-util-types';
import type { TokenizeContext } from 'micromark-util-types';
//# sourceMappingURL=index.d.ts.mapCzx5{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;;;;;;;;GAWG;AACH,uCATW,aAAa,CAAC;IAAC,UAAU,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAA;CAAC,CAAC,UAElD,KAAK,CAAC,KAAK,CAAC,WAEZ,eAAe,GAEb,KAAK,CAAC,KAAK,CAAC,CAkBxB;8BA9BkD,sBAAsB;2BAAtB,sBAAsB;qCAAtB,sBAAsB"}W1x/**
 * @import {Event, Resolver, TokenizeContext} from 'micromark-util-types'
 */

/**
 * Call all `resolveAll`s.
 *
 * @param {ReadonlyArray<{resolveAll?: Resolver | undefined}>} constructs
 *   List of constructs, optionally with `resolveAll`s.
 * @param {Array<Event>} events
 *   List of events.
 * @param {TokenizeContext} context
 *   Context used by `tokenize`.
 * @returns {Array<Event>}
 *   Changed events.
 */
export function resolveAll(constructs, events, context) {
  /** @type {Array<Resolver>} */
  const called = []
  let index = -1

  while (++index < constructs.length) {
    const resolve = constructs[index].resolveAll

    if (resolve && !called.includes(resolve)) {
      events = resolve(events, context)
      called.push(resolve)
    }
  }

  return events
}
b&YEx[{
  "name": "micromark-util-resolve-all",
  "version": "2.0.1",
  "description": "micromark utility to resolve subtokens",
  "license": "MIT",
  "keywords": [
    "micromark",
    "util",
    "utility",
    "resolve"
  ],
  "repository": "https://github.com/micromark/micromark/tree/main/packages/micromark-util-resolve-all",
  "bugs": "https://github.com/micromark/micromark/issues",
  "funding": [
    {
      "type": "GitHub Sponsors",
      "url": "https://github.com/sponsors/unifiedjs"
    },
    {
      "type": "OpenCollective",
      "url": "https://opencollective.com/unified"
    }
  ],
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "sideEffects": false,
  "type": "module",
  "files": [
    "index.d.ts.map",
    "index.d.ts",
    "index.js"
  ],
  "exports": "./index.js",
  "dependencies": {
    "micromark-util-types": "^2.0.0"
  },
  "xo": {
    "envs": [
      "shared-node-browser"
    ],
    "prettier": true,
    "rules": {
      "unicorn/prefer-code-point": "off"
    }
  }
}
omRḅxX# micromark-util-resolve-all

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][bundle-size-badge]][bundle-size]
[![Sponsors][sponsors-badge]][opencollective]
[![Backers][backers-badge]][opencollective]
[![Chat][chat-badge]][chat]

[micromark][] utility to resolve subtokens.

[Resolvers][resolver] are functions that take events and manipulate them.
This is needed for example because media (links, images) and attention (strong,
italic) aren’t parsed left-to-right.
Instead, their openings and closings are parsed, and when done, their openings
and closings are matched, and left overs are turned into plain text.
Because media and attention can’t overlap, we need to perform that operation
when one closing matches an opening, too.

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`resolveAll(constructs, events, context)`](#resolveallconstructs-events-context)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package exposes a micromark internal that you probably don’t need.

## When should I use this?

This package might be useful when you are making your own micromark extensions.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install micromark-util-resolve-all
```

In Deno with [`esm.sh`][esmsh]:

```js
import {resolveAll} from 'https://esm.sh/micromark-util-resolve-all@1'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {resolveAll} from 'https://esm.sh/micromark-util-resolve-all@1?bundle'
</script>
```

## Use

```js
import {push} from 'micromark-util-chunked'
import {resolveAll} from 'micromark-util-resolve-all'

/**
 * @type {Resolver}
 */
function resolveAllAttention(events, context) {
  // …

  // Walk through all events.
  while (++index < events.length) {
    // Find a token that can close.
    if (
      events[index][0] === 'enter' &&
      events[index][1].type === 'attentionSequence' &&
      events[index][1]._close
    ) {
      open = index

      // Now walk back to find an opener.
      while (open--) {
        // Find a token that can open the closer.
        if (
          // …
        ) {
          // …

          // Opening.
          nextEvents = push(nextEvents, [
            // …
          ])

          // Between.
          nextEvents = push(
            nextEvents,
            resolveAll(
              context.parser.constructs.insideSpan.null,
              events.slice(open + 1, index),
              context
            )
          )

          // Closing.
          nextEvents = push(nextEvents, [
            // …
          ])

          // …
        }
      }
    }
  }

  // …
}
```

## API

This module exports the identifier [`resolveAll`][api-resolve-all].
There is no default export.

### `resolveAll(constructs, events, context)`

Call all `resolveAll`s in `constructs`.

###### Parameters

* `constructs` (`Array<Construct>`)
  — list of constructs, optionally with `resolveAll`s
* `events` (`Array<Event>`)
  — list of events
* `context` (`TokenizeContext`)
  — context used by `tokenize`

###### Returns

Changed events (`Array<Events>`).

## Types

This package is fully typed with [TypeScript][].
It exports no additional types.

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-util-resolve-all@2`, compatible with Node.js 16.
This package works with `micromark@3`.

## Security

This package is safe.
See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
submit a security report.

## Contribute

See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg

[build]: https://github.com/micromark/micromark/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg

[coverage]: https://codecov.io/github/micromark/micromark

[downloads-badge]: https://img.shields.io/npm/dm/micromark-util-resolve-all.svg

[downloads]: https://www.npmjs.com/package/micromark-util-resolve-all

[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-resolve-all

[bundle-size]: https://bundlejs.com/?q=micromark-util-resolve-all

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[opencollective]: https://opencollective.com/unified

[npm]: https://docs.npmjs.com/cli/install

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/micromark/micromark/discussions

[license]: https://github.com/micromark/micromark/blob/main/license

[author]: https://wooorm.com

[health]: https://github.com/micromark/.github

[securitymd]: https://github.com/micromark/.github/blob/main/security.md

[contributing]: https://github.com/micromark/.github/blob/main/contributing.md

[support]: https://github.com/micromark/.github/blob/main/support.md

[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md

[resolver]: https://github.com/micromark/micromark/blob/a571c09/packages/micromark-util-types/index.js#L219

[typescript]: https://www.typescriptlang.org

[micromark]: https://github.com/micromark/micromark

[api-resolve-all]: #resolveallconstructs-events-context
i^x40000 dev bzMJ˓Fi(?100644 index.d.ts 0R)v100644 index.d.ts.map ʹH5$w(EGZ 100644 index.js o%RǾ8P['2100644 license Zbv8f,Q)100644 package.json Ǥx߫
N100644 readme.md -QʏjCm%bWH7}eExt 100644 index.d.ts 0R)v100644 index.d.ts.map ʹH5$w(EGZ 100644 index.js EK^恤VRJ^+ͤ+ʻMx$/**
 * Make a value safe for injection as a URL.
 *
 * This encodes unsafe characters with percent-encoding and skips already
 * encoded sequences (see `normalizeUri`).
 * Further unsafe characters are encoded as character references (see
 * `micromark-util-encode`).
 *
 * A regex of allowed protocols can be given, in which case the URL is
 * sanitized.
 * For example, `/^(https?|ircs?|mailto|xmpp)$/i` can be used for `a[href]`, or
 * `/^https?$/i` for `img[src]` (this is what `github.com` allows).
 * If the URL includes an unknown protocol (one not matched by `protocol`, such
 * as a dangerous example, `javascript:`), the value is ignored.
 *
 * @param {string | null | undefined} url
 *   URI to sanitize.
 * @param {RegExp | null | undefined} [protocol]
 *   Allowed protocols.
 * @returns {string}
 *   Sanitized URI.
 */
export function sanitizeUri(url: string | null | undefined, protocol?: RegExp | null | undefined): string;
/**
 * Normalize a URL.
 *
 * Encode unsafe characters with percent-encoding, skipping already encoded
 * sequences.
 *
 * @param {string} value
 *   URI to normalize.
 * @returns {string}
 *   Normalized URI.
 */
export function normalizeUri(value: string): string;
//# sourceMappingURL=index.d.ts.mapx{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,iCAPW,MAAM,GAAG,IAAI,GAAG,SAAS,aAEzB,MAAM,GAAG,IAAI,GAAG,SAAS,GAEvB,MAAM,CA6BlB;AAED;;;;;;;;;;GAUG;AACH,oCALW,MAAM,GAEJ,MAAM,CA6DlB"}1Jлx4import {asciiAlphanumeric} from 'micromark-util-character'
import {encode} from 'micromark-util-encode'
import {codes, values} from 'micromark-util-symbol'

/**
 * Make a value safe for injection as a URL.
 *
 * This encodes unsafe characters with percent-encoding and skips already
 * encoded sequences (see `normalizeUri`).
 * Further unsafe characters are encoded as character references (see
 * `micromark-util-encode`).
 *
 * A regex of allowed protocols can be given, in which case the URL is
 * sanitized.
 * For example, `/^(https?|ircs?|mailto|xmpp)$/i` can be used for `a[href]`, or
 * `/^https?$/i` for `img[src]` (this is what `github.com` allows).
 * If the URL includes an unknown protocol (one not matched by `protocol`, such
 * as a dangerous example, `javascript:`), the value is ignored.
 *
 * @param {string | null | undefined} url
 *   URI to sanitize.
 * @param {RegExp | null | undefined} [protocol]
 *   Allowed protocols.
 * @returns {string}
 *   Sanitized URI.
 */
export function sanitizeUri(url, protocol) {
  const value = encode(normalizeUri(url || ''))

  if (!protocol) {
    return value
  }

  const colon = value.indexOf(':')
  const questionMark = value.indexOf('?')
  const numberSign = value.indexOf('#')
  const slash = value.indexOf('/')

  if (
    // If there is no protocol, it’s relative.
    colon < 0 ||
    // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.
    (slash > -1 && colon > slash) ||
    (questionMark > -1 && colon > questionMark) ||
    (numberSign > -1 && colon > numberSign) ||
    // It is a protocol, it should be allowed.
    protocol.test(value.slice(0, colon))
  ) {
    return value
  }

  return ''
}

/**
 * Normalize a URL.
 *
 * Encode unsafe characters with percent-encoding, skipping already encoded
 * sequences.
 *
 * @param {string} value
 *   URI to normalize.
 * @returns {string}
 *   Normalized URI.
 */
export function normalizeUri(value) {
  /** @type {Array<string>} */
  const result = []
  let index = -1
  let start = 0
  let skip = 0

  while (++index < value.length) {
    const code = value.charCodeAt(index)
    /** @type {string} */
    let replace = ''

    // A correct percent encoded value.
    if (
      code === codes.percentSign &&
      asciiAlphanumeric(value.charCodeAt(index + 1)) &&
      asciiAlphanumeric(value.charCodeAt(index + 2))
    ) {
      skip = 2
    }
    // ASCII.
    else if (code < 128) {
      if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code))) {
        replace = String.fromCharCode(code)
      }
    }
    // Astral.
    else if (code > 55_295 && code < 57_344) {
      const next = value.charCodeAt(index + 1)

      // A correct surrogate pair.
      if (code < 56_320 && next > 56_319 && next < 57_344) {
        replace = String.fromCharCode(code, next)
        skip = 1
      }
      // Lone surrogate.
      else {
        replace = values.replacementCharacter
      }
    }
    // Unicode.
    else {
      replace = String.fromCharCode(code)
    }

    if (replace) {
      result.push(value.slice(start, index), encodeURIComponent(replace))
      start = index + skip + 1
      replace = ''
    }

    if (skip) {
      index += skip
      skip = 0
    }
  }

  return result.join('') + value.slice(start)
}
ExWimport { asciiAlphanumeric } from 'micromark-util-character';
import { encode } from 'micromark-util-encode';
/**
 * Make a value safe for injection as a URL.
 *
 * This encodes unsafe characters with percent-encoding and skips already
 * encoded sequences (see `normalizeUri`).
 * Further unsafe characters are encoded as character references (see
 * `micromark-util-encode`).
 *
 * A regex of allowed protocols can be given, in which case the URL is
 * sanitized.
 * For example, `/^(https?|ircs?|mailto|xmpp)$/i` can be used for `a[href]`, or
 * `/^https?$/i` for `img[src]` (this is what `github.com` allows).
 * If the URL includes an unknown protocol (one not matched by `protocol`, such
 * as a dangerous example, `javascript:`), the value is ignored.
 *
 * @param {string | null | undefined} url
 *   URI to sanitize.
 * @param {RegExp | null | undefined} [protocol]
 *   Allowed protocols.
 * @returns {string}
 *   Sanitized URI.
 */
export function sanitizeUri(url, protocol) {
  const value = encode(normalizeUri(url || ''));
  if (!protocol) {
    return value;
  }
  const colon = value.indexOf(':');
  const questionMark = value.indexOf('?');
  const numberSign = value.indexOf('#');
  const slash = value.indexOf('/');
  if (
  // If there is no protocol, it’s relative.
  colon < 0 ||
  // If the first colon is after a `?`, `#`, or `/`, it’s not a protocol.
  slash > -1 && colon > slash || questionMark > -1 && colon > questionMark || numberSign > -1 && colon > numberSign ||
  // It is a protocol, it should be allowed.
  protocol.test(value.slice(0, colon))) {
    return value;
  }
  return '';
}

/**
 * Normalize a URL.
 *
 * Encode unsafe characters with percent-encoding, skipping already encoded
 * sequences.
 *
 * @param {string} value
 *   URI to normalize.
 * @returns {string}
 *   Normalized URI.
 */
export function normalizeUri(value) {
  /** @type {Array<string>} */
  const result = [];
  let index = -1;
  let start = 0;
  let skip = 0;
  while (++index < value.length) {
    const code = value.charCodeAt(index);
    /** @type {string} */
    let replace = '';

    // A correct percent encoded value.
    if (code === 37 && asciiAlphanumeric(value.charCodeAt(index + 1)) && asciiAlphanumeric(value.charCodeAt(index + 2))) {
      skip = 2;
    }
    // ASCII.
    else if (code < 128) {
      if (!/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(code))) {
        replace = String.fromCharCode(code);
      }
    }
    // Astral.
    else if (code > 55_295 && code < 57_344) {
      const next = value.charCodeAt(index + 1);

      // A correct surrogate pair.
      if (code < 56_320 && next > 56_319 && next < 57_344) {
        replace = String.fromCharCode(code, next);
        skip = 1;
      }
      // Lone surrogate.
      else {
        replace = "\uFFFD";
      }
    }
    // Unicode.
    else {
      replace = String.fromCharCode(code);
    }
    if (replace) {
      result.push(value.slice(start, index), encodeURIComponent(replace));
      start = index + skip + 1;
      replace = '';
    }
    if (skip) {
      index += skip;
      skip = 0;
    }
  }
  return result.join('') + value.slice(start);
}'
x X
util-sanitize-uri$5utility to sanitize urls=:util",
    "utility",
    "sanitize",
    "clear",
    "ur]util-sanitize-uriHU*encode2t.6xm# micromark-util-sanitize-uri

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][bundle-size-badge]][bundle-size]
[![Sponsors][sponsors-badge]][opencollective]
[![Backers][backers-badge]][opencollective]
[![Chat][chat-badge]][chat]

[micromark][] utility to sanitize urls.

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`normalizeUri(value)`](#normalizeurivalue)
  * [`sanitizeUri(url[, pattern])`](#sanitizeuriurl-pattern)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package exposes an algorithm to make URLs safe.

## When should I use this?

This package might be useful when you are making your own micromark extensions.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install micromark-util-sanitize-uri
```

In Deno with [`esm.sh`][esmsh]:

```js
import {sanitizeUri} from 'https://esm.sh/micromark-util-sanitize-uri@1'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {sanitizeUri} from 'https://esm.sh/micromark-util-sanitize-uri@1?bundle'
</script>
```

## Use

```js
import {sanitizeUri} from 'micromark-util-sanitize-uri'

sanitizeUri('https://example.com/a&amp;b') // 'https://example.com/a&amp;amp;b'
sanitizeUri('https://example.com/a%b') // 'https://example.com/a%25b'
sanitizeUri('https://example.com/a%20b') // 'https://example.com/a%20b'
sanitizeUri('https://example.com/👍') // 'https://example.com/%F0%9F%91%8D'
sanitizeUri('https://example.com/', /^https?$/i) // 'https://example.com/'
sanitizeUri('javascript:alert(1)', /^https?$/i) // ''
sanitizeUri('./example.jpg', /^https?$/i) // './example.jpg'
sanitizeUri('#a', /^https?$/i) // '#a'
```

## API

This module exports the identifiers [`normalizeUri`][api-normalize-uri] and
[`sanitizeUri`][api-sanitize-uri].
There is no default export.

### `normalizeUri(value)`

Normalize a URL.

Encode unsafe characters with percent-encoding, skipping already encoded
sequences.

###### Parameters

* `value` (`string`)
  — URI to normalize

###### Returns

Normalized URI (`string`).

### `sanitizeUri(url[, pattern])`

Make a value safe for injection as a URL.

This encodes unsafe characters with percent-encoding and skips already
encoded sequences (see [`normalizeUri`][api-normalize-uri]).
Further unsafe characters are encoded as character references (see
[`micromark-util-encode`][micromark-util-encode]).

A regex of allowed protocols can be given, in which case the URL is sanitized.
For example, `/^(https?|ircs?|mailto|xmpp)$/i` can be used for `a[href]`, or
`/^https?$/i` for `img[src]` (this is what `github.com` allows).
If the URL includes an unknown protocol (one not matched by `protocol`, such
as a dangerous example, `javascript:`), the value is ignored.

###### Parameters

* `url` (`string`)
  — URI to sanitize
* `pattern` (`RegExp`, optional)
  — allowed protocols

###### Returns

Sanitized URI (`string`).

## Types

This package is fully typed with [TypeScript][].
It exports no additional types.

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-util-sanitize-uri@2`, compatible with Node.js 16.
This package works with `micromark@3`.

## Security

This package is safe.
See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
submit a security report.

## Contribute

See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg

[build]: https://github.com/micromark/micromark/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg

[coverage]: https://codecov.io/github/micromark/micromark

[downloads-badge]: https://img.shields.io/npm/dm/micromark-util-sanitize-uri.svg

[downloads]: https://www.npmjs.com/package/micromark-util-sanitize-uri

[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-sanitize-uri

[bundle-size]: https://bundlejs.com/?q=micromark-util-sanitize-uri

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[opencollective]: https://opencollective.com/unified

[npm]: https://docs.npmjs.com/cli/install

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/micromark/micromark/discussions

[license]: https://github.com/micromark/micromark/blob/main/license

[author]: https://wooorm.com

[health]: https://github.com/micromark/.github

[securitymd]: https://github.com/micromark/.github/blob/main/security.md

[contributing]: https://github.com/micromark/.github/blob/main/contributing.md

[support]: https://github.com/micromark/.github/blob/main/support.md

[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md

[typescript]: https://www.typescriptlang.org

[micromark]: https://github.com/micromark/micromark

[micromark-util-encode]: https://github.com/micromark/micromark/tree/main/packages/micromark-util-encode

[api-normalize-uri]: #normalizeurivalue

[api-sanitize-uri]: #sanitizeuriurl-pattern
WHx 40000 dev Iː}*wa100644 index.d.ts R#Cf4"SE<100644 index.d.ts.map $ܮ	"dpnu100644 index.js F0AmEI@q]u.X40000 lib JN-j_wke100644 license Zbv8f,Q)100644 package.json ć@t&DvPzX-100644 readme.md uY4<n)Oy6%q\	x m100644 index.d.ts R#Cf4"SE<100644 index.d.ts.map $ܮ	"dpnu100644 index.js o䓪HBI)640000 lib 'ani^/e;xd/**
 * Tokenize subcontent.
 *
 * @param {Array<Event>} eventsArray
 *   List of events.
 * @returns {boolean}
 *   Whether subtokens were found.
 */
export function subtokenize(eventsArray: Array<Event>): boolean;
export { SpliceBuffer } from "./lib/splice-buffer.js";
import type { Event } from 'micromark-util-types';
//# sourceMappingURL=index.d.ts.mapzx O{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAYA;;;;;;;GAOG;AAEH,yCANW,KAAK,CAAC,KAAK,CAAC,GAEV,OAAO,CAuHnB;;2BAvIqC,sBAAsB"}74xs/**
 * @import {Chunk, Event, Token} from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {splice} from 'micromark-util-chunked'
import {codes, types} from 'micromark-util-symbol'
import {SpliceBuffer} from './lib/splice-buffer.js'

// Hidden API exposed for testing.
export {SpliceBuffer} from './lib/splice-buffer.js'

/**
 * Tokenize subcontent.
 *
 * @param {Array<Event>} eventsArray
 *   List of events.
 * @returns {boolean}
 *   Whether subtokens were found.
 */
// eslint-disable-next-line complexity
export function subtokenize(eventsArray) {
  /** @type {Record<string, number>} */
  const jumps = {}
  let index = -1
  /** @type {Event} */
  let event
  /** @type {number | undefined} */
  let lineIndex
  /** @type {number} */
  let otherIndex
  /** @type {Event} */
  let otherEvent
  /** @type {Array<Event>} */
  let parameters
  /** @type {Array<Event>} */
  let subevents
  /** @type {boolean | undefined} */
  let more
  const events = new SpliceBuffer(eventsArray)

  while (++index < events.length) {
    while (index in jumps) {
      index = jumps[index]
    }

    event = events.get(index)

    // Add a hook for the GFM tasklist extension, which needs to know if text
    // is in the first content of a list item.
    if (
      index &&
      event[1].type === types.chunkFlow &&
      events.get(index - 1)[1].type === types.listItemPrefix
    ) {
      assert(event[1]._tokenizer, 'expected `_tokenizer` on subtokens')
      subevents = event[1]._tokenizer.events
      otherIndex = 0

      if (
        otherIndex < subevents.length &&
        subevents[otherIndex][1].type === types.lineEndingBlank
      ) {
        otherIndex += 2
      }

      if (
        otherIndex < subevents.length &&
        subevents[otherIndex][1].type === types.content
      ) {
        while (++otherIndex < subevents.length) {
          if (subevents[otherIndex][1].type === types.content) {
            break
          }

          if (subevents[otherIndex][1].type === types.chunkText) {
            subevents[otherIndex][1]._isInFirstContentOfListItem = true
            otherIndex++
          }
        }
      }
    }

    // Enter.
    if (event[0] === 'enter') {
      if (event[1].contentType) {
        Object.assign(jumps, subcontent(events, index))
        index = jumps[index]
        more = true
      }
    }
    // Exit.
    else if (event[1]._container) {
      otherIndex = index
      lineIndex = undefined

      while (otherIndex--) {
        otherEvent = events.get(otherIndex)

        if (
          otherEvent[1].type === types.lineEnding ||
          otherEvent[1].type === types.lineEndingBlank
        ) {
          if (otherEvent[0] === 'enter') {
            if (lineIndex) {
              events.get(lineIndex)[1].type = types.lineEndingBlank
            }

            otherEvent[1].type = types.lineEnding
            lineIndex = otherIndex
          }
        } else if (
          otherEvent[1].type === types.linePrefix ||
          otherEvent[1].type === types.listItemIndent
        ) {
          // Move past.
        } else {
          break
        }
      }

      if (lineIndex) {
        // Fix position.
        event[1].end = {...events.get(lineIndex)[1].start}

        // Switch container exit w/ line endings.
        parameters = events.slice(lineIndex, index)
        parameters.unshift(event)
        events.splice(lineIndex, index - lineIndex + 1, parameters)
      }
    }
  }

  // The changes to the `events` buffer must be copied back into the eventsArray
  splice(eventsArray, 0, Number.POSITIVE_INFINITY, events.slice(0))
  return !more
}

/**
 * Tokenize embedded tokens.
 *
 * @param {SpliceBuffer<Event>} events
 *   Events.
 * @param {number} eventIndex
 *   Index.
 * @returns {Record<string, number>}
 *   Gaps.
 */
function subcontent(events, eventIndex) {
  const token = events.get(eventIndex)[1]
  const context = events.get(eventIndex)[2]
  let startPosition = eventIndex - 1
  /** @type {Array<number>} */
  const startPositions = []
  assert(token.contentType, 'expected `contentType` on subtokens')

  let tokenizer = token._tokenizer

  if (!tokenizer) {
    tokenizer = context.parser[token.contentType](token.start)

    if (token._contentTypeTextTrailing) {
      tokenizer._contentTypeTextTrailing = true
    }
  }

  const childEvents = tokenizer.events
  /** @type {Array<[number, number]>} */
  const jumps = []
  /** @type {Record<string, number>} */
  const gaps = {}
  /** @type {Array<Chunk>} */
  let stream
  /** @type {Token | undefined} */
  let previous
  let index = -1
  /** @type {Token | undefined} */
  let current = token
  let adjust = 0
  let start = 0
  const breaks = [start]

  // Loop forward through the linked tokens to pass them in order to the
  // subtokenizer.
  while (current) {
    // Find the position of the event for this token.
    while (events.get(++startPosition)[1] !== current) {
      // Empty.
    }

    assert(
      !previous || current.previous === previous,
      'expected previous to match'
    )
    assert(!previous || previous.next === current, 'expected next to match')

    startPositions.push(startPosition)

    if (!current._tokenizer) {
      stream = context.sliceStream(current)

      if (!current.next) {
        stream.push(codes.eof)
      }

      if (previous) {
        tokenizer.defineSkip(current.start)
      }

      if (current._isInFirstContentOfListItem) {
        tokenizer._gfmTasklistFirstContentOfListItem = true
      }

      tokenizer.write(stream)

      if (current._isInFirstContentOfListItem) {
        tokenizer._gfmTasklistFirstContentOfListItem = undefined
      }
    }

    // Unravel the next token.
    previous = current
    current = current.next
  }

  // Now, loop back through all events (and linked tokens), to figure out which
  // parts belong where.
  current = token

  while (++index < childEvents.length) {
    if (
      // Find a void token that includes a break.
      childEvents[index][0] === 'exit' &&
      childEvents[index - 1][0] === 'enter' &&
      childEvents[index][1].type === childEvents[index - 1][1].type &&
      childEvents[index][1].start.line !== childEvents[index][1].end.line
    ) {
      assert(current, 'expected a current token')
      start = index + 1
      breaks.push(start)
      // Help GC.
      current._tokenizer = undefined
      current.previous = undefined
      current = current.next
    }
  }

  // Help GC.
  tokenizer.events = []

  // If there’s one more token (which is the cases for lines that end in an
  // EOF), that’s perfect: the last point we found starts it.
  // If there isn’t then make sure any remaining content is added to it.
  if (current) {
    // Help GC.
    current._tokenizer = undefined
    current.previous = undefined
    assert(!current.next, 'expected no next token')
  } else {
    breaks.pop()
  }

  // Now splice the events from the subtokenizer into the current events,
  // moving back to front so that splice indices aren’t affected.
  index = breaks.length

  while (index--) {
    const slice = childEvents.slice(breaks[index], breaks[index + 1])
    const start = startPositions.pop()
    assert(start !== undefined, 'expected a start position when splicing')
    jumps.push([start, start + slice.length - 1])
    events.splice(start, 2, slice)
  }

  jumps.reverse()
  index = -1

  while (++index < jumps.length) {
    gaps[adjust + jumps[index][0]] = adjust + jumps[index][1]
    adjust += jumps[index][1] - jumps[index][0] - 1
  }

  return gaps
}
Pݬx s100644 splice-buffer.d.ts ne#7uݐRu#100644 splice-buffer.d.ts.map C,n~AoF100644 splice-buffer.js 7'*4Z'l{32Ľxm/**
 * Some of the internal operations of micromark do lots of editing
 * operations on very large arrays. This runs into problems with two
 * properties of most circa-2020 JavaScript interpreters:
 *
 *  - Array-length modifications at the high end of an array (push/pop) are
 *    expected to be common and are implemented in (amortized) time
 *    proportional to the number of elements added or removed, whereas
 *    other operations (shift/unshift and splice) are much less efficient.
 *  - Function arguments are passed on the stack, so adding tens of thousands
 *    of elements to an array with `arr.push(...newElements)` will frequently
 *    cause stack overflows. (see <https://stackoverflow.com/questions/22123769/rangeerror-maximum-call-stack-size-exceeded-why>)
 *
 * SpliceBuffers are an implementation of gap buffers, which are a
 * generalization of the "queue made of two stacks" idea. The splice buffer
 * maintains a cursor, and moving the cursor has cost proportional to the
 * distance the cursor moves, but inserting, deleting, or splicing in
 * new information at the cursor is as efficient as the push/pop operation.
 * This allows for an efficient sequence of splices (or pushes, pops, shifts,
 * or unshifts) as long such edits happen at the same part of the array or
 * generally sweep through the array from the beginning to the end.
 *
 * The interface for splice buffers also supports large numbers of inputs by
 * passing a single array argument rather passing multiple arguments on the
 * function call stack.
 *
 * @template T
 *   Item type.
 */
export class SpliceBuffer<T> {
    /**
     * @param {ReadonlyArray<T> | null | undefined} [initial]
     *   Initial items (optional).
     * @returns
     *   Splice buffer.
     */
    constructor(initial?: ReadonlyArray<T> | null | undefined);
    /** @type {Array<T>} */
    left: Array<T>;
    /** @type {Array<T>} */
    right: Array<T>;
    /**
     * Array access;
     * does not move the cursor.
     *
     * @param {number} index
     *   Index.
     * @return {T}
     *   Item.
     */
    get(index: number): T;
    /**
     * The length of the splice buffer, one greater than the largest index in the
     * array.
     */
    get length(): number;
    /**
     * Remove and return `list[0]`;
     * moves the cursor to `0`.
     *
     * @returns {T | undefined}
     *   Item, optional.
     */
    shift(): T | undefined;
    /**
     * Slice the buffer to get an array;
     * does not move the cursor.
     *
     * @param {number} start
     *   Start.
     * @param {number | null | undefined} [end]
     *   End (optional).
     * @returns {Array<T>}
     *   Array of items.
     */
    slice(start: number, end?: number | null | undefined): Array<T>;
    /**
     * Mimics the behavior of Array.prototype.splice() except for the change of
     * interface necessary to avoid segfaults when patching in very large arrays.
     *
     * This operation moves cursor is moved to `start` and results in the cursor
     * placed after any inserted items.
     *
     * @param {number} start
     *   Start;
     *   zero-based index at which to start changing the array;
     *   negative numbers count backwards from the end of the array and values
     *   that are out-of bounds are clamped to the appropriate end of the array.
     * @param {number | null | undefined} [deleteCount=0]
     *   Delete count (default: `0`);
     *   maximum number of elements to delete, starting from start.
     * @param {Array<T> | null | undefined} [items=[]]
     *   Items to include in place of the deleted items (default: `[]`).
     * @return {Array<T>}
     *   Any removed items.
     */
    splice(start: number, deleteCount?: number | null | undefined, items?: Array<T> | null | undefined): Array<T>;
    /**
     * Remove and return the highest-numbered item in the array, so
     * `list[list.length - 1]`;
     * Moves the cursor to `length`.
     *
     * @returns {T | undefined}
     *   Item, optional.
     */
    pop(): T | undefined;
    /**
     * Inserts a single item to the high-numbered side of the array;
     * moves the cursor to `length`.
     *
     * @param {T} item
     *   Item.
     * @returns {undefined}
     *   Nothing.
     */
    push(item: T): undefined;
    /**
     * Inserts many items to the high-numbered side of the array.
     * Moves the cursor to `length`.
     *
     * @param {Array<T>} items
     *   Items.
     * @returns {undefined}
     *   Nothing.
     */
    pushMany(items: Array<T>): undefined;
    /**
     * Inserts a single item to the low-numbered side of the array;
     * Moves the cursor to `0`.
     *
     * @param {T} item
     *   Item.
     * @returns {undefined}
     *   Nothing.
     */
    unshift(item: T): undefined;
    /**
     * Inserts many items to the low-numbered side of the array;
     * moves the cursor to `0`.
     *
     * @param {Array<T>} items
     *   Items.
     * @returns {undefined}
     *   Nothing.
     */
    unshiftMany(items: Array<T>): undefined;
    /**
     * Move the cursor to a specific position in the array. Requires
     * time proportional to the distance moved.
     *
     * If `n < 0`, the cursor will end up at the beginning.
     * If `n > length`, the cursor will end up at the end.
     *
     * @param {number} n
     *   Position.
     * @return {undefined}
     *   Nothing.
     */
    setCursor(n: number): undefined;
}
//# sourceMappingURL=splice-buffer.d.ts.mapɷ@x{"version":3,"file":"splice-buffer.d.ts","sourceRoot":"","sources":["splice-buffer.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,0BAHa,CAAC;IAIZ;;;;;OAKG;IACH,sBALW,aAAa,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,EAU7C;IAJC,uBAAuB;IACvB,MADW,KAAK,CAAC,CAAC,CAAC,CACoB;IACvC,uBAAuB;IACvB,OADW,KAAK,CAAC,CAAC,CAAC,CACJ;IAGjB;;;;;;;;OAQG;IACH,WALW,MAAM,GAEL,CAAC,CAgBZ;IAED;;;OAGG;IACH,qBAEC;IAED;;;;;;OAMG;IACH,SAHa,CAAC,GAAG,SAAS,CAMzB;IAED;;;;;;;;;;OAUG;IACH,aAPW,MAAM,QAEN,MAAM,GAAG,IAAI,GAAG,SAAS,GAEvB,KAAK,CAAC,CAAC,CAAC,CA0BpB;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,cAbW,MAAM,gBAKN,MAAM,GAAG,IAAI,GAAG,SAAS,UAGzB,KAAK,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,SAAS,GAE1B,KAAK,CAAC,CAAC,CAAC,CAcnB;IAED;;;;;;;OAOG;IACH,OAHa,CAAC,GAAG,SAAS,CAMzB;IAED;;;;;;;;OAQG;IACH,WALW,CAAC,GAEC,SAAS,CAMrB;IAED;;;;;;;;OAQG;IACH,gBALW,KAAK,CAAC,CAAC,CAAC,GAEN,SAAS,CAMrB;IAED;;;;;;;;OAQG;IACH,cALW,CAAC,GAEC,SAAS,CAMrB;IAED;;;;;;;;OAQG;IACH,mBALW,KAAK,CAAC,CAAC,CAAC,GAEN,SAAS,CAMrB;IAED;;;;;;;;;;;OAWG;IACH,aALW,MAAM,GAEL,SAAS,CAsBpB;CACF"}hximport {constants} from 'micromark-util-symbol'

/**
 * Some of the internal operations of micromark do lots of editing
 * operations on very large arrays. This runs into problems with two
 * properties of most circa-2020 JavaScript interpreters:
 *
 *  - Array-length modifications at the high end of an array (push/pop) are
 *    expected to be common and are implemented in (amortized) time
 *    proportional to the number of elements added or removed, whereas
 *    other operations (shift/unshift and splice) are much less efficient.
 *  - Function arguments are passed on the stack, so adding tens of thousands
 *    of elements to an array with `arr.push(...newElements)` will frequently
 *    cause stack overflows. (see <https://stackoverflow.com/questions/22123769/rangeerror-maximum-call-stack-size-exceeded-why>)
 *
 * SpliceBuffers are an implementation of gap buffers, which are a
 * generalization of the "queue made of two stacks" idea. The splice buffer
 * maintains a cursor, and moving the cursor has cost proportional to the
 * distance the cursor moves, but inserting, deleting, or splicing in
 * new information at the cursor is as efficient as the push/pop operation.
 * This allows for an efficient sequence of splices (or pushes, pops, shifts,
 * or unshifts) as long such edits happen at the same part of the array or
 * generally sweep through the array from the beginning to the end.
 *
 * The interface for splice buffers also supports large numbers of inputs by
 * passing a single array argument rather passing multiple arguments on the
 * function call stack.
 *
 * @template T
 *   Item type.
 */
export class SpliceBuffer {
  /**
   * @param {ReadonlyArray<T> | null | undefined} [initial]
   *   Initial items (optional).
   * @returns
   *   Splice buffer.
   */
  constructor(initial) {
    /** @type {Array<T>} */
    this.left = initial ? [...initial] : []
    /** @type {Array<T>} */
    this.right = []
  }

  /**
   * Array access;
   * does not move the cursor.
   *
   * @param {number} index
   *   Index.
   * @return {T}
   *   Item.
   */
  get(index) {
    if (index < 0 || index >= this.left.length + this.right.length) {
      throw new RangeError(
        'Cannot access index `' +
          index +
          '` in a splice buffer of size `' +
          (this.left.length + this.right.length) +
          '`'
      )
    }

    if (index < this.left.length) return this.left[index]
    return this.right[this.right.length - index + this.left.length - 1]
  }

  /**
   * The length of the splice buffer, one greater than the largest index in the
   * array.
   */
  get length() {
    return this.left.length + this.right.length
  }

  /**
   * Remove and return `list[0]`;
   * moves the cursor to `0`.
   *
   * @returns {T | undefined}
   *   Item, optional.
   */
  shift() {
    this.setCursor(0)
    return this.right.pop()
  }

  /**
   * Slice the buffer to get an array;
   * does not move the cursor.
   *
   * @param {number} start
   *   Start.
   * @param {number | null | undefined} [end]
   *   End (optional).
   * @returns {Array<T>}
   *   Array of items.
   */
  slice(start, end) {
    /** @type {number} */
    const stop =
      end === null || end === undefined ? Number.POSITIVE_INFINITY : end

    if (stop < this.left.length) {
      return this.left.slice(start, stop)
    }

    if (start > this.left.length) {
      return this.right
        .slice(
          this.right.length - stop + this.left.length,
          this.right.length - start + this.left.length
        )
        .reverse()
    }

    return this.left
      .slice(start)
      .concat(
        this.right.slice(this.right.length - stop + this.left.length).reverse()
      )
  }

  /**
   * Mimics the behavior of Array.prototype.splice() except for the change of
   * interface necessary to avoid segfaults when patching in very large arrays.
   *
   * This operation moves cursor is moved to `start` and results in the cursor
   * placed after any inserted items.
   *
   * @param {number} start
   *   Start;
   *   zero-based index at which to start changing the array;
   *   negative numbers count backwards from the end of the array and values
   *   that are out-of bounds are clamped to the appropriate end of the array.
   * @param {number | null | undefined} [deleteCount=0]
   *   Delete count (default: `0`);
   *   maximum number of elements to delete, starting from start.
   * @param {Array<T> | null | undefined} [items=[]]
   *   Items to include in place of the deleted items (default: `[]`).
   * @return {Array<T>}
   *   Any removed items.
   */
  splice(start, deleteCount, items) {
    /** @type {number} */
    const count = deleteCount || 0

    this.setCursor(Math.trunc(start))
    const removed = this.right.splice(
      this.right.length - count,
      Number.POSITIVE_INFINITY
    )
    if (items) chunkedPush(this.left, items)
    return removed.reverse()
  }

  /**
   * Remove and return the highest-numbered item in the array, so
   * `list[list.length - 1]`;
   * Moves the cursor to `length`.
   *
   * @returns {T | undefined}
   *   Item, optional.
   */
  pop() {
    this.setCursor(Number.POSITIVE_INFINITY)
    return this.left.pop()
  }

  /**
   * Inserts a single item to the high-numbered side of the array;
   * moves the cursor to `length`.
   *
   * @param {T} item
   *   Item.
   * @returns {undefined}
   *   Nothing.
   */
  push(item) {
    this.setCursor(Number.POSITIVE_INFINITY)
    this.left.push(item)
  }

  /**
   * Inserts many items to the high-numbered side of the array.
   * Moves the cursor to `length`.
   *
   * @param {Array<T>} items
   *   Items.
   * @returns {undefined}
   *   Nothing.
   */
  pushMany(items) {
    this.setCursor(Number.POSITIVE_INFINITY)
    chunkedPush(this.left, items)
  }

  /**
   * Inserts a single item to the low-numbered side of the array;
   * Moves the cursor to `0`.
   *
   * @param {T} item
   *   Item.
   * @returns {undefined}
   *   Nothing.
   */
  unshift(item) {
    this.setCursor(0)
    this.right.push(item)
  }

  /**
   * Inserts many items to the low-numbered side of the array;
   * moves the cursor to `0`.
   *
   * @param {Array<T>} items
   *   Items.
   * @returns {undefined}
   *   Nothing.
   */
  unshiftMany(items) {
    this.setCursor(0)
    chunkedPush(this.right, items.reverse())
  }

  /**
   * Move the cursor to a specific position in the array. Requires
   * time proportional to the distance moved.
   *
   * If `n < 0`, the cursor will end up at the beginning.
   * If `n > length`, the cursor will end up at the end.
   *
   * @param {number} n
   *   Position.
   * @return {undefined}
   *   Nothing.
   */
  setCursor(n) {
    if (
      n === this.left.length ||
      (n > this.left.length && this.right.length === 0) ||
      (n < 0 && this.left.length === 0)
    )
      return
    if (n < this.left.length) {
      // Move cursor to the this.left
      const removed = this.left.splice(n, Number.POSITIVE_INFINITY)
      chunkedPush(this.right, removed.reverse())
    } else {
      // Move cursor to the this.right
      const removed = this.right.splice(
        this.left.length + this.right.length - n,
        Number.POSITIVE_INFINITY
      )
      chunkedPush(this.left, removed.reverse())
    }
  }
}

/**
 * Avoid stack overflow by pushing items onto the stack in segments
 *
 * @template T
 *   Item type.
 * @param {Array<T>} list
 *   List to inject into.
 * @param {ReadonlyArray<T>} right
 *   Items to inject.
 * @return {undefined}
 *   Nothing.
 */
function chunkedPush(list, right) {
  /** @type {number} */
  let chunkStart = 0

  if (right.length < constants.v8MaxSafeChunkSize) {
    list.push(...right)
  } else {
    while (chunkStart < right.length) {
      list.push(
        ...right.slice(chunkStart, chunkStart + constants.v8MaxSafeChunkSize)
      )
      chunkStart += constants.v8MaxSafeChunkSize
    }
  }
}
$Ɩx</**
 * @import {Chunk, Event, Token} from 'micromark-util-types'
 */

import { splice } from 'micromark-util-chunked';
import { SpliceBuffer } from './lib/splice-buffer.js';

// Hidden API exposed for testing.
export { SpliceBuffer } from './lib/splice-buffer.js';

/**
 * Tokenize subcontent.
 *
 * @param {Array<Event>} eventsArray
 *   List of events.
 * @returns {boolean}
 *   Whether subtokens were found.
 */
// eslint-disable-next-line complexity
export function subtokenize(eventsArray) {
  /** @type {Record<string, number>} */
  const jumps = {};
  let index = -1;
  /** @type {Event} */
  let event;
  /** @type {number | undefined} */
  let lineIndex;
  /** @type {number} */
  let otherIndex;
  /** @type {Event} */
  let otherEvent;
  /** @type {Array<Event>} */
  let parameters;
  /** @type {Array<Event>} */
  let subevents;
  /** @type {boolean | undefined} */
  let more;
  const events = new SpliceBuffer(eventsArray);
  while (++index < events.length) {
    while (index in jumps) {
      index = jumps[index];
    }
    event = events.get(index);

    // Add a hook for the GFM tasklist extension, which needs to know if text
    // is in the first content of a list item.
    if (index && event[1].type === "chunkFlow" && events.get(index - 1)[1].type === "listItemPrefix") {
      subevents = event[1]._tokenizer.events;
      otherIndex = 0;
      if (otherIndex < subevents.length && subevents[otherIndex][1].type === "lineEndingBlank") {
        otherIndex += 2;
      }
      if (otherIndex < subevents.length && subevents[otherIndex][1].type === "content") {
        while (++otherIndex < subevents.length) {
          if (subevents[otherIndex][1].type === "content") {
            break;
          }
          if (subevents[otherIndex][1].type === "chunkText") {
            subevents[otherIndex][1]._isInFirstContentOfListItem = true;
            otherIndex++;
          }
        }
      }
    }

    // Enter.
    if (event[0] === 'enter') {
      if (event[1].contentType) {
        Object.assign(jumps, subcontent(events, index));
        index = jumps[index];
        more = true;
      }
    }
    // Exit.
    else if (event[1]._container) {
      otherIndex = index;
      lineIndex = undefined;
      while (otherIndex--) {
        otherEvent = events.get(otherIndex);
        if (otherEvent[1].type === "lineEnding" || otherEvent[1].type === "lineEndingBlank") {
          if (otherEvent[0] === 'enter') {
            if (lineIndex) {
              events.get(lineIndex)[1].type = "lineEndingBlank";
            }
            otherEvent[1].type = "lineEnding";
            lineIndex = otherIndex;
          }
        } else if (otherEvent[1].type === "linePrefix" || otherEvent[1].type === "listItemIndent") {
          // Move past.
        } else {
          break;
        }
      }
      if (lineIndex) {
        // Fix position.
        event[1].end = {
          ...events.get(lineIndex)[1].start
        };

        // Switch container exit w/ line endings.
        parameters = events.slice(lineIndex, index);
        parameters.unshift(event);
        events.splice(lineIndex, index - lineIndex + 1, parameters);
      }
    }
  }

  // The changes to the `events` buffer must be copied back into the eventsArray
  splice(eventsArray, 0, Number.POSITIVE_INFINITY, events.slice(0));
  return !more;
}

/**
 * Tokenize embedded tokens.
 *
 * @param {SpliceBuffer<Event>} events
 *   Events.
 * @param {number} eventIndex
 *   Index.
 * @returns {Record<string, number>}
 *   Gaps.
 */
function subcontent(events, eventIndex) {
  const token = events.get(eventIndex)[1];
  const context = events.get(eventIndex)[2];
  let startPosition = eventIndex - 1;
  /** @type {Array<number>} */
  const startPositions = [];
  let tokenizer = token._tokenizer;
  if (!tokenizer) {
    tokenizer = context.parser[token.contentType](token.start);
    if (token._contentTypeTextTrailing) {
      tokenizer._contentTypeTextTrailing = true;
    }
  }
  const childEvents = tokenizer.events;
  /** @type {Array<[number, number]>} */
  const jumps = [];
  /** @type {Record<string, number>} */
  const gaps = {};
  /** @type {Array<Chunk>} */
  let stream;
  /** @type {Token | undefined} */
  let previous;
  let index = -1;
  /** @type {Token | undefined} */
  let current = token;
  let adjust = 0;
  let start = 0;
  const breaks = [start];

  // Loop forward through the linked tokens to pass them in order to the
  // subtokenizer.
  while (current) {
    // Find the position of the event for this token.
    while (events.get(++startPosition)[1] !== current) {
      // Empty.
    }
    startPositions.push(startPosition);
    if (!current._tokenizer) {
      stream = context.sliceStream(current);
      if (!current.next) {
        stream.push(null);
      }
      if (previous) {
        tokenizer.defineSkip(current.start);
      }
      if (current._isInFirstContentOfListItem) {
        tokenizer._gfmTasklistFirstContentOfListItem = true;
      }
      tokenizer.write(stream);
      if (current._isInFirstContentOfListItem) {
        tokenizer._gfmTasklistFirstContentOfListItem = undefined;
      }
    }

    // Unravel the next token.
    previous = current;
    current = current.next;
  }

  // Now, loop back through all events (and linked tokens), to figure out which
  // parts belong where.
  current = token;
  while (++index < childEvents.length) {
    if (
    // Find a void token that includes a break.
    childEvents[index][0] === 'exit' && childEvents[index - 1][0] === 'enter' && childEvents[index][1].type === childEvents[index - 1][1].type && childEvents[index][1].start.line !== childEvents[index][1].end.line) {
      start = index + 1;
      breaks.push(start);
      // Help GC.
      current._tokenizer = undefined;
      current.previous = undefined;
      current = current.next;
    }
  }

  // Help GC.
  tokenizer.events = [];

  // If there’s one more token (which is the cases for lines that end in an
  // EOF), that’s perfect: the last point we found starts it.
  // If there isn’t then make sure any remaining content is added to it.
  if (current) {
    // Help GC.
    current._tokenizer = undefined;
    current.previous = undefined;
  } else {
    breaks.pop();
  }

  // Now splice the events from the subtokenizer into the current events,
  // moving back to front so that splice indices aren’t affected.
  index = breaks.length;
  while (index--) {
    const slice = childEvents.slice(breaks[index], breaks[index + 1]);
    const start = startPositions.pop();
    jumps.push([start, start + slice.length - 1]);
    events.splice(start, 2, slice);
  }
  jumps.reverse();
  index = -1;
  while (++index < jumps.length) {
    gaps[adjust + jumps[index][0]] = adjust + jumps[index][1];
    adjust += jumps[index][1] - jumps[index][0] - 1;
  }
  return gaps;
}-pmx s100644 splice-buffer.d.ts ne#7uݐRu#100644 splice-buffer.d.ts.map C,n~AoF100644 splice-buffer.js PB;@L姠&6`zx>;17; &
; index +# ($) + '`');
    }I	:;	H;	;y
;
    return this.right.pop();B;C;M;
    }<D2,q).reverse();
    }
 	).concat(:G);;~;');-;*;y
#j;L;g;k;+;
Q;g.%;;;
Q};jL m/ ||   return;;N};]));N0;~^;
  if (right.length < 10000;*Dw(/10000));
      chunkStart += 10000;
    }
  }
}>.x M
&util-subtokenize",
  "version": "2.1.0:utility to tokenize subtokens=#util",
    "utility",
    "tokenize\util-subtokenizeHlib>unked	max-depthK&M=x# micromark-util-subtokenize

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][bundle-size-badge]][bundle-size]
[![Sponsors][sponsors-badge]][opencollective]
[![Backers][backers-badge]][opencollective]
[![Chat][chat-badge]][chat]

[micromark][] utility to tokenize subtokens.

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`subtokenize(events)`](#subtokenizeevents)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package exposes a micromark internal that you probably don’t need.

## When should I use this?

This package might be useful when you are making your own micromark extensions.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install micromark-util-subtokenize
```

In Deno with [`esm.sh`][esmsh]:

```js
import {subtokenize} from 'https://esm.sh/micromark-util-subtokenize@1'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {subtokenize} from 'https://esm.sh/micromark-util-subtokenize@1?bundle'
</script>
```

## Use

```js
import {subtokenize} from 'micromark-util-subtokenize'

/**
 * Content is transparent: it’s parsed right now. That way, definitions are also
 * parsed right now: before text in paragraphs (specifically, media) are parsed.
 *
 * @type {Resolver}
 */
function resolveContent(events) {
  subtokenize(events)
  return events
}
```

## API

This module exports the identifiers [`subtokenize`][api-subtokenize].
There is no default export.

### `subtokenize(events)`

Tokenize subcontent.

###### Parameters

* `events` (`Array<Event>`)
  — list of events

###### Returns

Whether subtokens were found (`boolean`).

## Types

This package is fully typed with [TypeScript][].
It exports no additional types.

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-util-subtokenize@2`, compatible with Node.js 16.
This package works with `micromark@3`.

## Security

This package is safe.
See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
submit a security report.

## Contribute

See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[api-subtokenize]: #subtokenizeevents

[author]: https://wooorm.com

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[build]: https://github.com/micromark/micromark/actions

[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg

[bundle-size]: https://bundlejs.com/?q=micromark-util-subtokenize

[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-subtokenize

[chat]: https://github.com/micromark/micromark/discussions

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md

[contributing]: https://github.com/micromark/.github/blob/main/contributing.md

[coverage]: https://codecov.io/github/micromark/micromark

[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg

[downloads]: https://www.npmjs.com/package/micromark-util-subtokenize

[downloads-badge]: https://img.shields.io/npm/dm/micromark-util-subtokenize.svg

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[health]: https://github.com/micromark/.github

[license]: https://github.com/micromark/micromark/blob/main/license

[micromark]: https://github.com/micromark/micromark

[npm]: https://docs.npmjs.com/cli/install

[opencollective]: https://opencollective.com/unified

[securitymd]: https://github.com/micromark/.github/blob/main/security.md

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[support]: https://github.com/micromark/.github/blob/main/support.md

[typescript]: https://www.typescriptlang.org
ux q40000 lib t]'mMBu2100644 license Zbv8f,Q)100644 package.json W
`@nA100644 readme.md KrYJSĶIh{<|E7d%xY100644 codes.d.ts pލ왻:!y100644 codes.d.ts.map ^V#fzZݰC100644 codes.js bq>Ϋ0Gs>100644 constants.d.ts EK5{n9[100644 constants.d.ts.map c4)x~gD"{100644 constants.js ԇn<y)2FC100644 default.d.ts E vHuR[>fUJ49100644 default.d.ts.map #Z[lU-(Yz100644 default.js J&NS<UW{r100644 types.d.ts e!8 Gcebڸ1100644 types.d.ts.map +9$ai̶qzgռ100644 types.js `;Tނjk93 I100644 values.d.ts t2AT߰#100644 values.d.ts.map 2+Qr HV`+4]1100644 values.js Zx\Mtca:2>!SPxexport namespace codes {
    let carriageReturn: -5;
    let lineFeed: -4;
    let carriageReturnLineFeed: -3;
    let horizontalTab: -2;
    let virtualSpace: -1;
    let eof: null;
    let nul: 0;
    let soh: 1;
    let stx: 2;
    let etx: 3;
    let eot: 4;
    let enq: 5;
    let ack: 6;
    let bel: 7;
    let bs: 8;
    let ht: 9;
    let lf: 10;
    let vt: 11;
    let ff: 12;
    let cr: 13;
    let so: 14;
    let si: 15;
    let dle: 16;
    let dc1: 17;
    let dc2: 18;
    let dc3: 19;
    let dc4: 20;
    let nak: 21;
    let syn: 22;
    let etb: 23;
    let can: 24;
    let em: 25;
    let sub: 26;
    let esc: 27;
    let fs: 28;
    let gs: 29;
    let rs: 30;
    let us: 31;
    let space: 32;
    let exclamationMark: 33;
    let quotationMark: 34;
    let numberSign: 35;
    let dollarSign: 36;
    let percentSign: 37;
    let ampersand: 38;
    let apostrophe: 39;
    let leftParenthesis: 40;
    let rightParenthesis: 41;
    let asterisk: 42;
    let plusSign: 43;
    let comma: 44;
    let dash: 45;
    let dot: 46;
    let slash: 47;
    let digit0: 48;
    let digit1: 49;
    let digit2: 50;
    let digit3: 51;
    let digit4: 52;
    let digit5: 53;
    let digit6: 54;
    let digit7: 55;
    let digit8: 56;
    let digit9: 57;
    let colon: 58;
    let semicolon: 59;
    let lessThan: 60;
    let equalsTo: 61;
    let greaterThan: 62;
    let questionMark: 63;
    let atSign: 64;
    let uppercaseA: 65;
    let uppercaseB: 66;
    let uppercaseC: 67;
    let uppercaseD: 68;
    let uppercaseE: 69;
    let uppercaseF: 70;
    let uppercaseG: 71;
    let uppercaseH: 72;
    let uppercaseI: 73;
    let uppercaseJ: 74;
    let uppercaseK: 75;
    let uppercaseL: 76;
    let uppercaseM: 77;
    let uppercaseN: 78;
    let uppercaseO: 79;
    let uppercaseP: 80;
    let uppercaseQ: 81;
    let uppercaseR: 82;
    let uppercaseS: 83;
    let uppercaseT: 84;
    let uppercaseU: 85;
    let uppercaseV: 86;
    let uppercaseW: 87;
    let uppercaseX: 88;
    let uppercaseY: 89;
    let uppercaseZ: 90;
    let leftSquareBracket: 91;
    let backslash: 92;
    let rightSquareBracket: 93;
    let caret: 94;
    let underscore: 95;
    let graveAccent: 96;
    let lowercaseA: 97;
    let lowercaseB: 98;
    let lowercaseC: 99;
    let lowercaseD: 100;
    let lowercaseE: 101;
    let lowercaseF: 102;
    let lowercaseG: 103;
    let lowercaseH: 104;
    let lowercaseI: 105;
    let lowercaseJ: 106;
    let lowercaseK: 107;
    let lowercaseL: 108;
    let lowercaseM: 109;
    let lowercaseN: 110;
    let lowercaseO: 111;
    let lowercaseP: 112;
    let lowercaseQ: 113;
    let lowercaseR: 114;
    let lowercaseS: 115;
    let lowercaseT: 116;
    let lowercaseU: 117;
    let lowercaseV: 118;
    let lowercaseW: 119;
    let lowercaseX: 120;
    let lowercaseY: 121;
    let lowercaseZ: 122;
    let leftCurlyBrace: 123;
    let verticalBar: 124;
    let rightCurlyBrace: 125;
    let tilde: 126;
    let del: 127;
    let byteOrderMarker: 65279;
    let replacementCharacter: 65533;
}
//# sourceMappingURL=codes.d.ts.mapfxa {"version":3,"file":"codes.d.ts","sourceRoot":"","sources":["codes.js"],"names":[],"mappings":""}Mx{/**
 * Character codes.
 *
 * This module is compiled away!
 *
 * micromark works based on character codes.
 * This module contains constants for the ASCII block and the replacement
 * character.
 * A couple of them are handled in a special way, such as the line endings
 * (CR, LF, and CR+LF, commonly known as end-of-line: EOLs), the tab (horizontal
 * tab) and its expansion based on what column it’s at (virtual space),
 * and the end-of-file (eof) character.
 * As values are preprocessed before handling them, the actual characters LF,
 * CR, HT, and NUL (which is present as the replacement character), are
 * guaranteed to not exist.
 *
 * Unicode basic latin block.
 */
export const codes = /** @type {const} */ ({
  carriageReturn: -5,
  lineFeed: -4,
  carriageReturnLineFeed: -3,
  horizontalTab: -2,
  virtualSpace: -1,
  eof: null,
  nul: 0,
  soh: 1,
  stx: 2,
  etx: 3,
  eot: 4,
  enq: 5,
  ack: 6,
  bel: 7,
  bs: 8,
  ht: 9, // `\t`
  lf: 10, // `\n`
  vt: 11, // `\v`
  ff: 12, // `\f`
  cr: 13, // `\r`
  so: 14,
  si: 15,
  dle: 16,
  dc1: 17,
  dc2: 18,
  dc3: 19,
  dc4: 20,
  nak: 21,
  syn: 22,
  etb: 23,
  can: 24,
  em: 25,
  sub: 26,
  esc: 27,
  fs: 28,
  gs: 29,
  rs: 30,
  us: 31,
  space: 32,
  exclamationMark: 33, // `!`
  quotationMark: 34, // `"`
  numberSign: 35, // `#`
  dollarSign: 36, // `$`
  percentSign: 37, // `%`
  ampersand: 38, // `&`
  apostrophe: 39, // `'`
  leftParenthesis: 40, // `(`
  rightParenthesis: 41, // `)`
  asterisk: 42, // `*`
  plusSign: 43, // `+`
  comma: 44, // `,`
  dash: 45, // `-`
  dot: 46, // `.`
  slash: 47, // `/`
  digit0: 48, // `0`
  digit1: 49, // `1`
  digit2: 50, // `2`
  digit3: 51, // `3`
  digit4: 52, // `4`
  digit5: 53, // `5`
  digit6: 54, // `6`
  digit7: 55, // `7`
  digit8: 56, // `8`
  digit9: 57, // `9`
  colon: 58, // `:`
  semicolon: 59, // `;`
  lessThan: 60, // `<`
  equalsTo: 61, // `=`
  greaterThan: 62, // `>`
  questionMark: 63, // `?`
  atSign: 64, // `@`
  uppercaseA: 65, // `A`
  uppercaseB: 66, // `B`
  uppercaseC: 67, // `C`
  uppercaseD: 68, // `D`
  uppercaseE: 69, // `E`
  uppercaseF: 70, // `F`
  uppercaseG: 71, // `G`
  uppercaseH: 72, // `H`
  uppercaseI: 73, // `I`
  uppercaseJ: 74, // `J`
  uppercaseK: 75, // `K`
  uppercaseL: 76, // `L`
  uppercaseM: 77, // `M`
  uppercaseN: 78, // `N`
  uppercaseO: 79, // `O`
  uppercaseP: 80, // `P`
  uppercaseQ: 81, // `Q`
  uppercaseR: 82, // `R`
  uppercaseS: 83, // `S`
  uppercaseT: 84, // `T`
  uppercaseU: 85, // `U`
  uppercaseV: 86, // `V`
  uppercaseW: 87, // `W`
  uppercaseX: 88, // `X`
  uppercaseY: 89, // `Y`
  uppercaseZ: 90, // `Z`
  leftSquareBracket: 91, // `[`
  backslash: 92, // `\`
  rightSquareBracket: 93, // `]`
  caret: 94, // `^`
  underscore: 95, // `_`
  graveAccent: 96, // `` ` ``
  lowercaseA: 97, // `a`
  lowercaseB: 98, // `b`
  lowercaseC: 99, // `c`
  lowercaseD: 100, // `d`
  lowercaseE: 101, // `e`
  lowercaseF: 102, // `f`
  lowercaseG: 103, // `g`
  lowercaseH: 104, // `h`
  lowercaseI: 105, // `i`
  lowercaseJ: 106, // `j`
  lowercaseK: 107, // `k`
  lowercaseL: 108, // `l`
  lowercaseM: 109, // `m`
  lowercaseN: 110, // `n`
  lowercaseO: 111, // `o`
  lowercaseP: 112, // `p`
  lowercaseQ: 113, // `q`
  lowercaseR: 114, // `r`
  lowercaseS: 115, // `s`
  lowercaseT: 116, // `t`
  lowercaseU: 117, // `u`
  lowercaseV: 118, // `v`
  lowercaseW: 119, // `w`
  lowercaseX: 120, // `x`
  lowercaseY: 121, // `y`
  lowercaseZ: 122, // `z`
  leftCurlyBrace: 123, // `{`
  verticalBar: 124, // `|`
  rightCurlyBrace: 125, // `}`
  tilde: 126, // `~`
  del: 127,
  // Unicode Specials block.
  byteOrderMarker: 65_279,
  // Unicode Specials block.
  replacementCharacter: 65_533 // `�`
})
sLx4export namespace constants {
    let attentionSideAfter: 2;
    let attentionSideBefore: 1;
    let atxHeadingOpeningFenceSizeMax: 6;
    let autolinkDomainSizeMax: 63;
    let autolinkSchemeSizeMax: 32;
    let cdataOpeningString: "CDATA[";
    let characterGroupPunctuation: 2;
    let characterGroupWhitespace: 1;
    let characterReferenceDecimalSizeMax: 7;
    let characterReferenceHexadecimalSizeMax: 6;
    let characterReferenceNamedSizeMax: 31;
    let codeFencedSequenceSizeMin: 3;
    let contentTypeContent: "content";
    let contentTypeDocument: "document";
    let contentTypeFlow: "flow";
    let contentTypeString: "string";
    let contentTypeText: "text";
    let hardBreakPrefixSizeMin: 2;
    let htmlBasic: 6;
    let htmlCdata: 5;
    let htmlComment: 2;
    let htmlComplete: 7;
    let htmlDeclaration: 4;
    let htmlInstruction: 3;
    let htmlRawSizeMax: 8;
    let htmlRaw: 1;
    let linkResourceDestinationBalanceMax: 32;
    let linkReferenceSizeMax: 999;
    let listItemValueSizeMax: 10;
    let numericBaseDecimal: 10;
    let numericBaseHexadecimal: 16;
    let tabSize: 4;
    let thematicBreakMarkerCountMin: 3;
    let v8MaxSafeChunkSize: 10000;
}
//# sourceMappingURL=constants.d.ts.mapZ둆xi {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["constants.js"],"names":[],"mappings":""}\#:x	-/**
 * This module is compiled away!
 *
 * Parsing markdown comes with a couple of constants, such as minimum or maximum
 * sizes of certain sequences.
 * Additionally, there are a couple symbols used inside micromark.
 * These are all defined here, but compiled away by scripts.
 */
export const constants = /** @type {const} */ ({
  attentionSideAfter: 2, // Symbol to mark an attention sequence as after content: `a*`
  attentionSideBefore: 1, // Symbol to mark an attention sequence as before content: `*a`
  atxHeadingOpeningFenceSizeMax: 6, // 6 number signs is fine, 7 isn’t.
  autolinkDomainSizeMax: 63, // 63 characters is fine, 64 is too many.
  autolinkSchemeSizeMax: 32, // 32 characters is fine, 33 is too many.
  cdataOpeningString: 'CDATA[', // And preceded by `<![`.
  characterGroupPunctuation: 2, // Symbol used to indicate a character is punctuation
  characterGroupWhitespace: 1, // Symbol used to indicate a character is whitespace
  characterReferenceDecimalSizeMax: 7, // `&#9999999;`.
  characterReferenceHexadecimalSizeMax: 6, // `&#xff9999;`.
  characterReferenceNamedSizeMax: 31, // `&CounterClockwiseContourIntegral;`.
  codeFencedSequenceSizeMin: 3, // At least 3 ticks or tildes are needed.
  contentTypeContent: 'content',
  contentTypeDocument: 'document',
  contentTypeFlow: 'flow',
  contentTypeString: 'string',
  contentTypeText: 'text',
  hardBreakPrefixSizeMin: 2, // At least 2 trailing spaces are needed.
  htmlBasic: 6, // Symbol for `<div`
  htmlCdata: 5, // Symbol for `<![CDATA[]]>`
  htmlComment: 2, // Symbol for `<!---->`
  htmlComplete: 7, // Symbol for `<x>`
  htmlDeclaration: 4, // Symbol for `<!doctype>`
  htmlInstruction: 3, // Symbol for `<?php?>`
  htmlRawSizeMax: 8, // Length of `textarea`.
  htmlRaw: 1, // Symbol for `<script>`
  linkResourceDestinationBalanceMax: 32, // See: <https://spec.commonmark.org/0.30/#link-destination>, <https://github.com/remarkjs/react-markdown/issues/658#issuecomment-984345577>
  linkReferenceSizeMax: 999, // See: <https://spec.commonmark.org/0.30/#link-label>
  listItemValueSizeMax: 10, // See: <https://spec.commonmark.org/0.30/#ordered-list-marker>
  numericBaseDecimal: 10,
  numericBaseHexadecimal: 0x10,
  tabSize: 4, // Tabs have a hard-coded size of 4, per CommonMark.
  thematicBreakMarkerCountMin: 3, // At least 3 asterisks, dashes, or underscores are needed.
  v8MaxSafeChunkSize: 10_000 // V8 (and potentially others) have problems injecting giant arrays into other arrays, hence we operate in chunks.
})
.Kx @export { codes } from "./codes.js";
export { constants } from "./constants.js";
export { types } from "./types.js";
export { values } from "./values.js";
//# sourceMappingURL=default.d.ts.map~Bxe {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["default.js"],"names":[],"mappings":""}!Jx qexport {codes} from './codes.js'
export {constants} from './constants.js'
export {types} from './types.js'
export {values} from './values.js'
3xexport namespace types {
    let data: "data";
    let whitespace: "whitespace";
    let lineEnding: "lineEnding";
    let lineEndingBlank: "lineEndingBlank";
    let linePrefix: "linePrefix";
    let lineSuffix: "lineSuffix";
    let atxHeading: "atxHeading";
    let atxHeadingSequence: "atxHeadingSequence";
    let atxHeadingText: "atxHeadingText";
    let autolink: "autolink";
    let autolinkEmail: "autolinkEmail";
    let autolinkMarker: "autolinkMarker";
    let autolinkProtocol: "autolinkProtocol";
    let characterEscape: "characterEscape";
    let characterEscapeValue: "characterEscapeValue";
    let characterReference: "characterReference";
    let characterReferenceMarker: "characterReferenceMarker";
    let characterReferenceMarkerNumeric: "characterReferenceMarkerNumeric";
    let characterReferenceMarkerHexadecimal: "characterReferenceMarkerHexadecimal";
    let characterReferenceValue: "characterReferenceValue";
    let codeFenced: "codeFenced";
    let codeFencedFence: "codeFencedFence";
    let codeFencedFenceSequence: "codeFencedFenceSequence";
    let codeFencedFenceInfo: "codeFencedFenceInfo";
    let codeFencedFenceMeta: "codeFencedFenceMeta";
    let codeFlowValue: "codeFlowValue";
    let codeIndented: "codeIndented";
    let codeText: "codeText";
    let codeTextData: "codeTextData";
    let codeTextPadding: "codeTextPadding";
    let codeTextSequence: "codeTextSequence";
    let content: "content";
    let definition: "definition";
    let definitionDestination: "definitionDestination";
    let definitionDestinationLiteral: "definitionDestinationLiteral";
    let definitionDestinationLiteralMarker: "definitionDestinationLiteralMarker";
    let definitionDestinationRaw: "definitionDestinationRaw";
    let definitionDestinationString: "definitionDestinationString";
    let definitionLabel: "definitionLabel";
    let definitionLabelMarker: "definitionLabelMarker";
    let definitionLabelString: "definitionLabelString";
    let definitionMarker: "definitionMarker";
    let definitionTitle: "definitionTitle";
    let definitionTitleMarker: "definitionTitleMarker";
    let definitionTitleString: "definitionTitleString";
    let emphasis: "emphasis";
    let emphasisSequence: "emphasisSequence";
    let emphasisText: "emphasisText";
    let escapeMarker: "escapeMarker";
    let hardBreakEscape: "hardBreakEscape";
    let hardBreakTrailing: "hardBreakTrailing";
    let htmlFlow: "htmlFlow";
    let htmlFlowData: "htmlFlowData";
    let htmlText: "htmlText";
    let htmlTextData: "htmlTextData";
    let image: "image";
    let label: "label";
    let labelText: "labelText";
    let labelLink: "labelLink";
    let labelImage: "labelImage";
    let labelMarker: "labelMarker";
    let labelImageMarker: "labelImageMarker";
    let labelEnd: "labelEnd";
    let link: "link";
    let paragraph: "paragraph";
    let reference: "reference";
    let referenceMarker: "referenceMarker";
    let referenceString: "referenceString";
    let resource: "resource";
    let resourceDestination: "resourceDestination";
    let resourceDestinationLiteral: "resourceDestinationLiteral";
    let resourceDestinationLiteralMarker: "resourceDestinationLiteralMarker";
    let resourceDestinationRaw: "resourceDestinationRaw";
    let resourceDestinationString: "resourceDestinationString";
    let resourceMarker: "resourceMarker";
    let resourceTitle: "resourceTitle";
    let resourceTitleMarker: "resourceTitleMarker";
    let resourceTitleString: "resourceTitleString";
    let setextHeading: "setextHeading";
    let setextHeadingText: "setextHeadingText";
    let setextHeadingLine: "setextHeadingLine";
    let setextHeadingLineSequence: "setextHeadingLineSequence";
    let strong: "strong";
    let strongSequence: "strongSequence";
    let strongText: "strongText";
    let thematicBreak: "thematicBreak";
    let thematicBreakSequence: "thematicBreakSequence";
    let blockQuote: "blockQuote";
    let blockQuotePrefix: "blockQuotePrefix";
    let blockQuoteMarker: "blockQuoteMarker";
    let blockQuotePrefixWhitespace: "blockQuotePrefixWhitespace";
    let listOrdered: "listOrdered";
    let listUnordered: "listUnordered";
    let listItemIndent: "listItemIndent";
    let listItemMarker: "listItemMarker";
    let listItemPrefix: "listItemPrefix";
    let listItemPrefixWhitespace: "listItemPrefixWhitespace";
    let listItemValue: "listItemValue";
    let chunkDocument: "chunkDocument";
    let chunkContent: "chunkContent";
    let chunkFlow: "chunkFlow";
    let chunkText: "chunkText";
    let chunkString: "chunkString";
}
//# sourceMappingURL=types.d.ts.map*7xa {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":""}*곻x3L/**
 * This module is compiled away!
 *
 * Here is the list of all types of tokens exposed by micromark, with a short
 * explanation of what they include and where they are found.
 * In picking names, generally, the rule is to be as explicit as possible
 * instead of reusing names.
 * For example, there is a `definitionDestination` and a `resourceDestination`,
 * instead of one shared name.
 */

// Note: when changing the next record, you must also change `TokenTypeMap`
// in `micromark-util-types/index.d.ts`.
export const types = /** @type {const} */ ({
  // Generic type for data, such as in a title, a destination, etc.
  data: 'data',

  // Generic type for syntactic whitespace (tabs, virtual spaces, spaces).
  // Such as, between a fenced code fence and an info string.
  whitespace: 'whitespace',

  // Generic type for line endings (line feed, carriage return, carriage return +
  // line feed).
  lineEnding: 'lineEnding',

  // A line ending, but ending a blank line.
  lineEndingBlank: 'lineEndingBlank',

  // Generic type for whitespace (tabs, virtual spaces, spaces) at the start of a
  // line.
  linePrefix: 'linePrefix',

  // Generic type for whitespace (tabs, virtual spaces, spaces) at the end of a
  // line.
  lineSuffix: 'lineSuffix',

  // Whole ATX heading:
  //
  // ```markdown
  // #
  // ## Alpha
  // ### Bravo ###
  // ```
  //
  // Includes `atxHeadingSequence`, `whitespace`, `atxHeadingText`.
  atxHeading: 'atxHeading',

  // Sequence of number signs in an ATX heading (`###`).
  atxHeadingSequence: 'atxHeadingSequence',

  // Content in an ATX heading (`alpha`).
  // Includes text.
  atxHeadingText: 'atxHeadingText',

  // Whole autolink (`<https://example.com>` or `<admin@example.com>`)
  // Includes `autolinkMarker` and `autolinkProtocol` or `autolinkEmail`.
  autolink: 'autolink',

  // Email autolink w/o markers (`admin@example.com`)
  autolinkEmail: 'autolinkEmail',

  // Marker around an `autolinkProtocol` or `autolinkEmail` (`<` or `>`).
  autolinkMarker: 'autolinkMarker',

  // Protocol autolink w/o markers (`https://example.com`)
  autolinkProtocol: 'autolinkProtocol',

  // A whole character escape (`\-`).
  // Includes `escapeMarker` and `characterEscapeValue`.
  characterEscape: 'characterEscape',

  // The escaped character (`-`).
  characterEscapeValue: 'characterEscapeValue',

  // A whole character reference (`&amp;`, `&#8800;`, or `&#x1D306;`).
  // Includes `characterReferenceMarker`, an optional
  // `characterReferenceMarkerNumeric`, in which case an optional
  // `characterReferenceMarkerHexadecimal`, and a `characterReferenceValue`.
  characterReference: 'characterReference',

  // The start or end marker (`&` or `;`).
  characterReferenceMarker: 'characterReferenceMarker',

  // Mark reference as numeric (`#`).
  characterReferenceMarkerNumeric: 'characterReferenceMarkerNumeric',

  // Mark reference as numeric (`x` or `X`).
  characterReferenceMarkerHexadecimal: 'characterReferenceMarkerHexadecimal',

  // Value of character reference w/o markers (`amp`, `8800`, or `1D306`).
  characterReferenceValue: 'characterReferenceValue',

  // Whole fenced code:
  //
  // ````markdown
  // ```js
  // alert(1)
  // ```
  // ````
  codeFenced: 'codeFenced',

  // A fenced code fence, including whitespace, sequence, info, and meta
  // (` ```js `).
  codeFencedFence: 'codeFencedFence',

  // Sequence of grave accent or tilde characters (` ``` `) in a fence.
  codeFencedFenceSequence: 'codeFencedFenceSequence',

  // Info word (`js`) in a fence.
  // Includes string.
  codeFencedFenceInfo: 'codeFencedFenceInfo',

  // Meta words (`highlight="1"`) in a fence.
  // Includes string.
  codeFencedFenceMeta: 'codeFencedFenceMeta',

  // A line of code.
  codeFlowValue: 'codeFlowValue',

  // Whole indented code:
  //
  // ```markdown
  //     alert(1)
  // ```
  //
  // Includes `lineEnding`, `linePrefix`, and `codeFlowValue`.
  codeIndented: 'codeIndented',

  // A text code (``` `alpha` ```).
  // Includes `codeTextSequence`, `codeTextData`, `lineEnding`, and can include
  // `codeTextPadding`.
  codeText: 'codeText',

  codeTextData: 'codeTextData',

  // A space or line ending right after or before a tick.
  codeTextPadding: 'codeTextPadding',

  // A text code fence (` `` `).
  codeTextSequence: 'codeTextSequence',

  // Whole content:
  //
  // ```markdown
  // [a]: b
  // c
  // =
  // d
  // ```
  //
  // Includes `paragraph` and `definition`.
  content: 'content',
  // Whole definition:
  //
  // ```markdown
  // [micromark]: https://github.com/micromark/micromark
  // ```
  //
  // Includes `definitionLabel`, `definitionMarker`, `whitespace`,
  // `definitionDestination`, and optionally `lineEnding` and `definitionTitle`.
  definition: 'definition',

  // Destination of a definition (`https://github.com/micromark/micromark` or
  // `<https://github.com/micromark/micromark>`).
  // Includes `definitionDestinationLiteral` or `definitionDestinationRaw`.
  definitionDestination: 'definitionDestination',

  // Enclosed destination of a definition
  // (`<https://github.com/micromark/micromark>`).
  // Includes `definitionDestinationLiteralMarker` and optionally
  // `definitionDestinationString`.
  definitionDestinationLiteral: 'definitionDestinationLiteral',

  // Markers of an enclosed definition destination (`<` or `>`).
  definitionDestinationLiteralMarker: 'definitionDestinationLiteralMarker',

  // Unenclosed destination of a definition
  // (`https://github.com/micromark/micromark`).
  // Includes `definitionDestinationString`.
  definitionDestinationRaw: 'definitionDestinationRaw',

  // Text in an destination (`https://github.com/micromark/micromark`).
  // Includes string.
  definitionDestinationString: 'definitionDestinationString',

  // Label of a definition (`[micromark]`).
  // Includes `definitionLabelMarker` and `definitionLabelString`.
  definitionLabel: 'definitionLabel',

  // Markers of a definition label (`[` or `]`).
  definitionLabelMarker: 'definitionLabelMarker',

  // Value of a definition label (`micromark`).
  // Includes string.
  definitionLabelString: 'definitionLabelString',

  // Marker between a label and a destination (`:`).
  definitionMarker: 'definitionMarker',

  // Title of a definition (`"x"`, `'y'`, or `(z)`).
  // Includes `definitionTitleMarker` and optionally `definitionTitleString`.
  definitionTitle: 'definitionTitle',

  // Marker around a title of a definition (`"`, `'`, `(`, or `)`).
  definitionTitleMarker: 'definitionTitleMarker',

  // Data without markers in a title (`z`).
  // Includes string.
  definitionTitleString: 'definitionTitleString',

  // Emphasis (`*alpha*`).
  // Includes `emphasisSequence` and `emphasisText`.
  emphasis: 'emphasis',

  // Sequence of emphasis markers (`*` or `_`).
  emphasisSequence: 'emphasisSequence',

  // Emphasis text (`alpha`).
  // Includes text.
  emphasisText: 'emphasisText',

  // The character escape marker (`\`).
  escapeMarker: 'escapeMarker',

  // A hard break created with a backslash (`\\n`).
  // Note: does not include the line ending.
  hardBreakEscape: 'hardBreakEscape',

  // A hard break created with trailing spaces (`  \n`).
  // Does not include the line ending.
  hardBreakTrailing: 'hardBreakTrailing',

  // Flow HTML:
  //
  // ```markdown
  // <div
  // ```
  //
  // Inlcudes `lineEnding`, `htmlFlowData`.
  htmlFlow: 'htmlFlow',

  htmlFlowData: 'htmlFlowData',

  // HTML in text (the tag in `a <i> b`).
  // Includes `lineEnding`, `htmlTextData`.
  htmlText: 'htmlText',

  htmlTextData: 'htmlTextData',

  // Whole image (`![alpha](bravo)`, `![alpha][bravo]`, `![alpha][]`, or
  // `![alpha]`).
  // Includes `label` and an optional `resource` or `reference`.
  image: 'image',

  // Whole link label (`[*alpha*]`).
  // Includes `labelLink` or `labelImage`, `labelText`, and `labelEnd`.
  label: 'label',

  // Text in an label (`*alpha*`).
  // Includes text.
  labelText: 'labelText',

  // Start a link label (`[`).
  // Includes a `labelMarker`.
  labelLink: 'labelLink',

  // Start an image label (`![`).
  // Includes `labelImageMarker` and `labelMarker`.
  labelImage: 'labelImage',

  // Marker of a label (`[` or `]`).
  labelMarker: 'labelMarker',

  // Marker to start an image (`!`).
  labelImageMarker: 'labelImageMarker',

  // End a label (`]`).
  // Includes `labelMarker`.
  labelEnd: 'labelEnd',

  // Whole link (`[alpha](bravo)`, `[alpha][bravo]`, `[alpha][]`, or `[alpha]`).
  // Includes `label` and an optional `resource` or `reference`.
  link: 'link',

  // Whole paragraph:
  //
  // ```markdown
  // alpha
  // bravo.
  // ```
  //
  // Includes text.
  paragraph: 'paragraph',

  // A reference (`[alpha]` or `[]`).
  // Includes `referenceMarker` and an optional `referenceString`.
  reference: 'reference',

  // A reference marker (`[` or `]`).
  referenceMarker: 'referenceMarker',

  // Reference text (`alpha`).
  // Includes string.
  referenceString: 'referenceString',

  // A resource (`(https://example.com "alpha")`).
  // Includes `resourceMarker`, an optional `resourceDestination` with an optional
  // `whitespace` and `resourceTitle`.
  resource: 'resource',

  // A resource destination (`https://example.com`).
  // Includes `resourceDestinationLiteral` or `resourceDestinationRaw`.
  resourceDestination: 'resourceDestination',

  // A literal resource destination (`<https://example.com>`).
  // Includes `resourceDestinationLiteralMarker` and optionally
  // `resourceDestinationString`.
  resourceDestinationLiteral: 'resourceDestinationLiteral',

  // A resource destination marker (`<` or `>`).
  resourceDestinationLiteralMarker: 'resourceDestinationLiteralMarker',

  // A raw resource destination (`https://example.com`).
  // Includes `resourceDestinationString`.
  resourceDestinationRaw: 'resourceDestinationRaw',

  // Resource destination text (`https://example.com`).
  // Includes string.
  resourceDestinationString: 'resourceDestinationString',

  // A resource marker (`(` or `)`).
  resourceMarker: 'resourceMarker',

  // A resource title (`"alpha"`, `'alpha'`, or `(alpha)`).
  // Includes `resourceTitleMarker` and optionally `resourceTitleString`.
  resourceTitle: 'resourceTitle',

  // A resource title marker (`"`, `'`, `(`, or `)`).
  resourceTitleMarker: 'resourceTitleMarker',

  // Resource destination title (`alpha`).
  // Includes string.
  resourceTitleString: 'resourceTitleString',

  // Whole setext heading:
  //
  // ```markdown
  // alpha
  // bravo
  // =====
  // ```
  //
  // Includes `setextHeadingText`, `lineEnding`, `linePrefix`, and
  // `setextHeadingLine`.
  setextHeading: 'setextHeading',

  // Content in a setext heading (`alpha\nbravo`).
  // Includes text.
  setextHeadingText: 'setextHeadingText',

  // Underline in a setext heading, including whitespace suffix (`==`).
  // Includes `setextHeadingLineSequence`.
  setextHeadingLine: 'setextHeadingLine',

  // Sequence of equals or dash characters in underline in a setext heading (`-`).
  setextHeadingLineSequence: 'setextHeadingLineSequence',

  // Strong (`**alpha**`).
  // Includes `strongSequence` and `strongText`.
  strong: 'strong',

  // Sequence of strong markers (`**` or `__`).
  strongSequence: 'strongSequence',

  // Strong text (`alpha`).
  // Includes text.
  strongText: 'strongText',

  // Whole thematic break:
  //
  // ```markdown
  // * * *
  // ```
  //
  // Includes `thematicBreakSequence` and `whitespace`.
  thematicBreak: 'thematicBreak',

  // A sequence of one or more thematic break markers (`***`).
  thematicBreakSequence: 'thematicBreakSequence',

  // Whole block quote:
  //
  // ```markdown
  // > a
  // >
  // > b
  // ```
  //
  // Includes `blockQuotePrefix` and flow.
  blockQuote: 'blockQuote',
  // The `>` or `> ` of a block quote.
  blockQuotePrefix: 'blockQuotePrefix',
  // The `>` of a block quote prefix.
  blockQuoteMarker: 'blockQuoteMarker',
  // The optional ` ` of a block quote prefix.
  blockQuotePrefixWhitespace: 'blockQuotePrefixWhitespace',

  // Whole ordered list:
  //
  // ```markdown
  // 1. a
  //    b
  // ```
  //
  // Includes `listItemPrefix`, flow, and optionally  `listItemIndent` on further
  // lines.
  listOrdered: 'listOrdered',

  // Whole unordered list:
  //
  // ```markdown
  // - a
  //   b
  // ```
  //
  // Includes `listItemPrefix`, flow, and optionally  `listItemIndent` on further
  // lines.
  listUnordered: 'listUnordered',

  // The indent of further list item lines.
  listItemIndent: 'listItemIndent',

  // A marker, as in, `*`, `+`, `-`, `.`, or `)`.
  listItemMarker: 'listItemMarker',

  // The thing that starts a list item, such as `1. `.
  // Includes `listItemValue` if ordered, `listItemMarker`, and
  // `listItemPrefixWhitespace` (unless followed by a line ending).
  listItemPrefix: 'listItemPrefix',

  // The whitespace after a marker.
  listItemPrefixWhitespace: 'listItemPrefixWhitespace',

  // The numerical value of an ordered item.
  listItemValue: 'listItemValue',

  // Internal types used for subtokenizers, compiled away
  chunkDocument: 'chunkDocument',
  chunkContent: 'chunkContent',
  chunkFlow: 'chunkFlow',
  chunkText: 'chunkText',
  chunkString: 'chunkString'
})
 Yx	Lexport namespace values {
    let ht: "\t";
    let lf: "\n";
    let cr: "\r";
    let space: " ";
    let exclamationMark: "!";
    let quotationMark: "\"";
    let numberSign: "#";
    let dollarSign: "$";
    let percentSign: "%";
    let ampersand: "&";
    let apostrophe: "'";
    let leftParenthesis: "(";
    let rightParenthesis: ")";
    let asterisk: "*";
    let plusSign: "+";
    let comma: ",";
    let dash: "-";
    let dot: ".";
    let slash: "/";
    let digit0: "0";
    let digit1: "1";
    let digit2: "2";
    let digit3: "3";
    let digit4: "4";
    let digit5: "5";
    let digit6: "6";
    let digit7: "7";
    let digit8: "8";
    let digit9: "9";
    let colon: ":";
    let semicolon: ";";
    let lessThan: "<";
    let equalsTo: "=";
    let greaterThan: ">";
    let questionMark: "?";
    let atSign: "@";
    let uppercaseA: "A";
    let uppercaseB: "B";
    let uppercaseC: "C";
    let uppercaseD: "D";
    let uppercaseE: "E";
    let uppercaseF: "F";
    let uppercaseG: "G";
    let uppercaseH: "H";
    let uppercaseI: "I";
    let uppercaseJ: "J";
    let uppercaseK: "K";
    let uppercaseL: "L";
    let uppercaseM: "M";
    let uppercaseN: "N";
    let uppercaseO: "O";
    let uppercaseP: "P";
    let uppercaseQ: "Q";
    let uppercaseR: "R";
    let uppercaseS: "S";
    let uppercaseT: "T";
    let uppercaseU: "U";
    let uppercaseV: "V";
    let uppercaseW: "W";
    let uppercaseX: "X";
    let uppercaseY: "Y";
    let uppercaseZ: "Z";
    let leftSquareBracket: "[";
    let backslash: "\\";
    let rightSquareBracket: "]";
    let caret: "^";
    let underscore: "_";
    let graveAccent: "`";
    let lowercaseA: "a";
    let lowercaseB: "b";
    let lowercaseC: "c";
    let lowercaseD: "d";
    let lowercaseE: "e";
    let lowercaseF: "f";
    let lowercaseG: "g";
    let lowercaseH: "h";
    let lowercaseI: "i";
    let lowercaseJ: "j";
    let lowercaseK: "k";
    let lowercaseL: "l";
    let lowercaseM: "m";
    let lowercaseN: "n";
    let lowercaseO: "o";
    let lowercaseP: "p";
    let lowercaseQ: "q";
    let lowercaseR: "r";
    let lowercaseS: "s";
    let lowercaseT: "t";
    let lowercaseU: "u";
    let lowercaseV: "v";
    let lowercaseW: "w";
    let lowercaseX: "x";
    let lowercaseY: "y";
    let lowercaseZ: "z";
    let leftCurlyBrace: "{";
    let verticalBar: "|";
    let rightCurlyBrace: "}";
    let tilde: "~";
    let replacementCharacter: "�";
}
//# sourceMappingURL=values.d.ts.mapƪxc {"version":3,"file":"values.d.ts","sourceRoot":"","sources":["values.js"],"names":[],"mappings":""}m xL/**
 * This module is compiled away!
 *
 * While micromark works based on character codes, this module includes the
 * string versions of ’em.
 * The C0 block, except for LF, CR, HT, and w/ the replacement character added,
 * are available here.
 */
export const values = /** @type {const} */ ({
  ht: '\t',
  lf: '\n',
  cr: '\r',
  space: ' ',
  exclamationMark: '!',
  quotationMark: '"',
  numberSign: '#',
  dollarSign: '$',
  percentSign: '%',
  ampersand: '&',
  apostrophe: "'",
  leftParenthesis: '(',
  rightParenthesis: ')',
  asterisk: '*',
  plusSign: '+',
  comma: ',',
  dash: '-',
  dot: '.',
  slash: '/',
  digit0: '0',
  digit1: '1',
  digit2: '2',
  digit3: '3',
  digit4: '4',
  digit5: '5',
  digit6: '6',
  digit7: '7',
  digit8: '8',
  digit9: '9',
  colon: ':',
  semicolon: ';',
  lessThan: '<',
  equalsTo: '=',
  greaterThan: '>',
  questionMark: '?',
  atSign: '@',
  uppercaseA: 'A',
  uppercaseB: 'B',
  uppercaseC: 'C',
  uppercaseD: 'D',
  uppercaseE: 'E',
  uppercaseF: 'F',
  uppercaseG: 'G',
  uppercaseH: 'H',
  uppercaseI: 'I',
  uppercaseJ: 'J',
  uppercaseK: 'K',
  uppercaseL: 'L',
  uppercaseM: 'M',
  uppercaseN: 'N',
  uppercaseO: 'O',
  uppercaseP: 'P',
  uppercaseQ: 'Q',
  uppercaseR: 'R',
  uppercaseS: 'S',
  uppercaseT: 'T',
  uppercaseU: 'U',
  uppercaseV: 'V',
  uppercaseW: 'W',
  uppercaseX: 'X',
  uppercaseY: 'Y',
  uppercaseZ: 'Z',
  leftSquareBracket: '[',
  backslash: '\\',
  rightSquareBracket: ']',
  caret: '^',
  underscore: '_',
  graveAccent: '`',
  lowercaseA: 'a',
  lowercaseB: 'b',
  lowercaseC: 'c',
  lowercaseD: 'd',
  lowercaseE: 'e',
  lowercaseF: 'f',
  lowercaseG: 'g',
  lowercaseH: 'h',
  lowercaseI: 'i',
  lowercaseJ: 'j',
  lowercaseK: 'k',
  lowercaseL: 'l',
  lowercaseM: 'm',
  lowercaseN: 'n',
  lowercaseO: 'o',
  lowercaseP: 'p',
  lowercaseQ: 'q',
  lowercaseR: 'r',
  lowercaseS: 's',
  lowercaseT: 't',
  lowercaseU: 'u',
  lowercaseV: 'v',
  lowercaseW: 'w',
  lowercaseX: 'x',
  lowercaseY: 'y',
  lowercaseZ: 'z',
  leftCurlyBrace: '{',
  verticalBar: '|',
  rightCurlyBrace: '}',
  tilde: '~',
  replacementCharacter: '�'
})
m_>x{
  "name": "micromark-util-symbol",
  "version": "2.0.1",
  "description": "micromark utility with symbols",
  "license": "MIT",
  "keywords": [
    "micromark",
    "util",
    "utility",
    "symbol"
  ],
  "repository": "https://github.com/micromark/micromark/tree/main/packages/micromark-util-symbol",
  "bugs": "https://github.com/micromark/micromark/issues",
  "funding": [
    {
      "type": "GitHub Sponsors",
      "url": "https://github.com/sponsors/unifiedjs"
    },
    {
      "type": "OpenCollective",
      "url": "https://opencollective.com/unified"
    }
  ],
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "sideEffects": false,
  "type": "module",
  "files": [
    "lib/"
  ],
  "exports": "./lib/default.js",
  "xo": {
    "envs": [
      "shared-node-browser"
    ],
    "prettier": true,
    "rules": {
      "unicorn/prefer-code-point": "off"
    }
  }
}
'/Lx# micromark-util-symbol

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][bundle-size-badge]][bundle-size]
[![Sponsors][sponsors-badge]][opencollective]
[![Backers][backers-badge]][opencollective]
[![Chat][chat-badge]][chat]

[micromark][] utility with symbols.

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package exposes constants used throughout the micromark ecosystem.

## When should I use this?

This package is useful when you are making your own micromark extensions.
It’s useful to reference these constants by name instead of value while
developing.
[`micromark-build`][micromark-build] compiles them away for production code.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install micromark-util-symbol
```

In Deno with [`esm.sh`][esmsh]:

```js
import * as symbol from 'https://esm.sh/micromark-util-symbol@1'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import * as symbol from 'https://esm.sh/micromark-util-symbol@1?bundle'
</script>
```

## Use

```js
import {codes, constants, types, values} from 'micromark-util-symbol'

console.log(codes.atSign) // 64
console.log(constants.characterReferenceNamedSizeMax) // 31
console.log(types.definitionDestinationRaw) // 'definitionDestinationRaw'
console.log(values.atSign) // '@'
```

## API

This package exports the identifiers `codes`, `constants`, `types`, and
`values`.
There is no default export.

Each identifier is an object mapping strings to values.
See the code for the exposed data.

## Types

This package is fully typed with [TypeScript][].
It exports no additional types.

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-util-symbol@2`, compatible with Node.js 16.
This package works with `micromark@3`.

## Security

This package is safe.
See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
submit a security report.

## Contribute

See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg

[build]: https://github.com/micromark/micromark/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg

[coverage]: https://codecov.io/github/micromark/micromark

[downloads-badge]: https://img.shields.io/npm/dm/micromark-util-symbol.svg

[downloads]: https://www.npmjs.com/package/micromark-util-symbol

[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-symbol

[bundle-size]: https://bundlejs.com/?q=micromark-util-symbol

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[opencollective]: https://opencollective.com/unified

[npm]: https://docs.npmjs.com/cli/install

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/micromark/micromark/discussions

[license]: https://github.com/micromark/micromark/blob/main/license

[author]: https://wooorm.com

[health]: https://github.com/micromark/.github

[securitymd]: https://github.com/micromark/.github/blob/main/security.md

[contributing]: https://github.com/micromark/.github/blob/main/contributing.md

[support]: https://github.com/micromark/.github/blob/main/support.md

[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md

[typescript]: https://www.typescriptlang.org

[micromark]: https://github.com/micromark/micromark

[micromark-build]: https://github.com/micromark/micromark/tree/main/packages/micromark-build
U"ox E100644 index.d.ts `?Qb{,Qk100644 index.js  ]W*A:100644 license Zbv8f,Q)100644 package.json mdXW񲅸ry;100644 readme.md 6$tyZ
		gϡqxKxx~// Note: this file is authored manually, not generated from `index.js`.

/**
 * A character code.
 *
 * This is often the same as what `String#charCodeAt()` yields but micromark
 * adds meaning to certain other values.
 *
 * `null` represents the end of the input stream (called eof).
 * Negative integers are used instead of certain sequences of characters (such
 * as line endings and tabs).
 */
export type Code = number | null

/**
 * A chunk is either a character code or a slice of a buffer in the form of a
 * string.
 *
 * Chunks are used because strings are more efficient storage that character
 * codes, but limited in what they can represent.
 */
export type Chunk = Code | string

/**
 * Enumeration of the content types.
 *
 * Technically `document` is also a content type, which includes containers
 * (lists, block quotes) and flow.
 * As `ContentType` is used on tokens to define the type of subcontent but
 * `document` is the highest level of content, so it’s not listed here.
 *
 * Containers in markdown come from the margin and include more constructs
 * on the lines that define them.
 * Take for example a block quote with a paragraph inside it (such as
 * `> asd`).
 *
 * `flow` represents the sections, such as headings, code, and content, which
 * is also parsed per line
 * An example is HTML, which has a certain starting condition (such as
 * `<script>` on its own line), then continues for a while, until an end
 * condition is found (such as `</style>`).
 * If that line with an end condition is never found, that flow goes until
 * the end.
 *
 * `content` is zero or more definitions, and then zero or one paragraph.
 * It’s a weird one, and needed to make certain edge cases around definitions
 * spec compliant.
 * Definitions are unlike other things in markdown, in that they behave like
 * `text` in that they can contain arbitrary line endings, but *have* to end
 * at a line ending.
 * If they end in something else, the whole definition instead is seen as a
 * paragraph.
 *
 * The content in markdown first needs to be parsed up to this level to
 * figure out which things are defined, for the whole document, before
 * continuing on with `text`, as whether a link or image reference forms or
 * not depends on whether it’s defined.
 * This unfortunately prevents a true streaming markdown to HTML compiler.
 *
 * `text` contains phrasing content such as attention (emphasis, strong),
 * media (links, images), and actual text.
 *
 * `string` is a limited `text` like content type which only allows character
 * references and character escapes.
 * It exists in things such as identifiers (media references, definitions),
 * titles, or URLs.
 */
export type ContentType = 'content' | 'document' | 'flow' | 'string' | 'text'

/**
 * A location in the document (`line`/`column`/`offset`) and chunk (`_index`,
 * `_bufferIndex`).
 *
 * `_bufferIndex` is `-1` when `_index` points to a code chunk and it’s a
 * non-negative integer when pointing to a string chunk.
 *
 * The interface for the location in the document comes from unist `Point`:
 * <https://github.com/syntax-tree/unist#point>
 */
export interface Point {
  /**
   * Position in a string chunk (or `-1` when pointing to a numeric chunk).
   */
  _bufferIndex: number

  /**
   * Position in a list of chunks.
   */
  _index: number

  /**
   * 1-indexed column number.
   */
  column: number

  /**
   * 1-indexed line number.
   */
  line: number

  /**
   * 0-indexed position in the document.
   */
  offset: number
}

/**
 * A token: a span of chunks.
 *
 * Tokens are what the core of micromark produces: the built in HTML compiler
 * or other tools can turn them into different things.
 *
 * Tokens are essentially names attached to a slice of chunks, such as
 * `lineEndingBlank` for certain line endings, or `codeFenced` for a whole
 * fenced code.
 *
 * Sometimes, more info is attached to tokens, such as `_open` and `_close`
 * by `attention` (strong, emphasis) to signal whether the sequence can open
 * or close an attention run.
 *
 * Linked tokens are used because outer constructs are parsed first.
 * Take for example:
 *
 * ```markdown
 * > *a
 * b*.
 * ```
 *
 * 1.  The block quote marker and the space after it is parsed first
 * 2.  The rest of the line is a `chunkFlow` token
 * 3.  The two spaces on the second line are a `linePrefix`
 * 4.  The rest of the line is another `chunkFlow` token
 *
 * The two `chunkFlow` tokens are linked together.
 * The chunks they span are then passed through the flow tokenizer.
 */
export interface Token {
  /**
   * Token type.
   */
  type: TokenType

  /**
   * Point where the token starts.
   */
  start: Point

  /**
   * Point where the token ends.
   */
  end: Point

  /**
   * The previous token in a list of linked tokens.
   */
  previous?: Token | undefined

  /**
   * The next token in a list of linked tokens.
   */
  next?: Token | undefined

  /**
   * Declares a token as having content of a certain type.
   */
  contentType?: ContentType | undefined

  /**
   * Declares that trailing whitespace is sensitive,
   * is allowed,
   * when `contentType` is `text` (or `string`).
   * Normally,
   * trailing spaces and tabs are dropped.
   */
  _contentTypeTextTrailing?: boolean | undefined

  /**
   * Connected tokenizer.
   *
   * Used when dealing with linked tokens.
   * A child tokenizer is needed to tokenize them, which is stored on those
   * tokens.
   */
  _tokenizer?: TokenizeContext | undefined

  /**
   * Field to help parse attention.
   *
   * Depending on the character before sequences (`**`), the sequence can open,
   * close, both, or none.
   */
  _open?: boolean | undefined

  /**
   * Field to help parse attention.
   *
   * Depending on the character before sequences (`**`), the sequence can open,
   * close, both, or none.
   */
  _close?: boolean | undefined

  /**
   * Field to help parse GFM task lists.
   *
   * This boolean is used internally to figure out if a token is in the first
   * content of a list item construct.
   */
  _isInFirstContentOfListItem?: boolean | undefined

  /**
   * Field to help parse containers.
   *
   * This boolean is used internally to figure out if a token is a container
   * token.
   */
  _container?: boolean | undefined

  /**
   * Field to help parse lists.
   *
   * This boolean is used internally to figure out if a list is loose or not.
   */
  _loose?: boolean | undefined

  /**
   * Field to help parse links.
   *
   * This boolean is used internally to figure out if a link opening
   * can’t be used (because links in links are incorrect).
   */
  _inactive?: boolean | undefined

  /**
   * Field to help parse links.
   *
   * This boolean is used internally to figure out if a link opening is
   * balanced: it’s not a link opening but has a balanced closing.
   */
  _balanced?: boolean | undefined
}

/**
 * The start or end of a token amongst other events.
 *
 * Tokens can “contain” other tokens, even though they are stored in a flat
 * list, through `enter`ing before them, and `exit`ing after them.
 */
export type Event = ['enter' | 'exit', Token, TokenizeContext]

/**
 * Open a token.
 *
 * @param type
 *   Token type.
 * @param fields
 *   Extra fields.
 * @returns {Token}
 *   Token.
 */
export type Enter = (
  type: TokenType,
  fields?: Omit<Partial<Token>, 'type'> | undefined
) => Token

/**
 * Close a token.
 *
 * @param type
 *   Token type.
 * @returns
 *   Token.
 */
export type Exit = (type: TokenType) => Token

/**
 * Deal with the character and move to the next.
 *
 * @param code
 *   Current code.
 */
export type Consume = (code: Code) => undefined

/**
 * Attempt deals with several values, and tries to parse according to those
 * values.
 *
 * If a value resulted in `ok`, it worked, the tokens that were made are used,
 * and `ok` is switched to.
 * If the result is `nok`, the attempt failed, so we revert to the original
 * state, and `nok` is used.
 *
 * @param construct
 *   Construct(s) to try.
 * @param ok
 *   State to move to when successful.
 * @param nok
 *   State to move to when unsuccessful.
 * @returns
 *   Next state.
 */
export type Attempt = (
  construct: Array<Construct> | ConstructRecord | Construct,
  ok: State,
  nok?: State | undefined
) => State

/**
 * A context object to transition the state machine.
 */
export interface Effects {
  /**
   * Try to tokenize a construct.
   */
  attempt: Attempt

  /**
   * Attempt, then revert.
   */
  check: Attempt

  /**
   * Deal with the character and move to the next.
   */
  consume: Consume

  /**
   * Start a new token.
   */
  enter: Enter

  /**
   * End a started token.
   */
  exit: Exit

  /**
   * Interrupt is used for stuff right after a line of content.
   */
  interrupt: Attempt
}

/**
 * The main unit in the state machine: a function that gets a character code
 * and has certain effects.
 *
 * A state function should return another function: the next
 * state-as-a-function to go to.
 *
 * But there is one case where they return `undefined`: for the eof character
 * code (at the end of a value).
 * The reason being: well, there isn’t any state that makes sense, so
 * `undefined` works well.
 * Practically that has also helped: if for some reason it was a mistake, then
 * an exception is throw because there is no next function, meaning it
 * surfaces early.
 *
 * @param code
 *   Current code.
 * @returns
 *   Next state.
 */
export type State = (code: Code) => State | undefined

/**
 * A resolver handles and cleans events coming from `tokenize`.
 *
 * @param events
 *   List of events.
 * @param context
 *   Tokenize context.
 * @returns
 *   The given, modified, events.
 */
export type Resolver = (
  events: Array<Event>,
  context: TokenizeContext
) => Array<Event>

/**
 * A tokenize function sets up a state machine to handle character codes streaming in.
 *
 * @param this
 *   Tokenize context.
 * @param effects
 *   Effects.
 * @param ok
 *   State to go to when successful.
 * @param nok
 *   State to go to when unsuccessful.
 * @returns
 *   First state.
 */
export type Tokenizer = (
  this: TokenizeContext,
  effects: Effects,
  ok: State,
  nok: State
) => State

/**
 * Like a tokenizer, but without `ok` or `nok`.
 *
 * @param this
 *   Tokenize context.
 * @param effects
 *   Effects.
 * @returns
 *   First state.
 */
export type Initializer = (this: TokenizeContext, effects: Effects) => State

/**
 * Like a tokenizer, but without `ok` or `nok`, and returning `undefined`.
 *
 * This is the final hook when a container must be closed.
 *
 * @param this
 *   Tokenize context.
 * @param effects
 *   Effects.
 * @returns
 *   Nothing.
 */
export type Exiter = (this: TokenizeContext, effects: Effects) => undefined

/**
 * Guard whether `code` can come before the construct.
 *
 * In certain cases a construct can hook into many potential start characters.
 * Instead of setting up an attempt to parse that construct for most
 * characters, this is a speedy way to reduce that.
 *
 * @param this
 *   Tokenize context.
 * @param code
 *   Previous code.
 * @returns
 *   Whether `code` is allowed before.
 */
export type Previous = (this: TokenizeContext, code: Code) => boolean

/**
 * An object describing how to parse a markdown construct.
 */
export interface Construct {
  /**
   * Whether the construct, when in a `ConstructRecord`, precedes over existing
   * constructs for the same character code when merged.
   *
   * The default is that new constructs precede over existing ones.
   */
  add?: 'after' | 'before' | undefined

  /**
   * Concrete constructs cannot be interrupted by more containers.
   *
   * For example, when parsing the document (containers, such as block quotes
   * and lists) and this construct is parsing fenced code:
   *
   * ````markdown
   * > ```js
   * > - list?
   * ````
   *
   * …then `- list?` cannot form if this fenced code construct is concrete.
   *
   * An example of a construct that is not concrete is a GFM table:
   *
   * ````markdown
   * | a |
   * | - |
   * > | b |
   * ````
   *
   * …`b` is not part of the table.
   */
  concrete?: boolean | undefined

  /**
   * For containers, a continuation construct.
   */
  continuation?: Construct | undefined

  /**
   * For containers, a final hook.
   */
  exit?: Exiter | undefined

  /**
   * Name of the construct, used to toggle constructs off.
   *
   * Named constructs must not be `partial`.
   */
  name?: string | undefined

  /**
   * Whether this construct represents a partial construct.
   *
   * Partial constructs must not have a `name`.
   */
  partial?: boolean | undefined

  /**
   * Guard whether the previous character can come before the construct.
   */
  previous?: Previous | undefined

  /**
   * Resolve all events when the content is complete, from the start to the end.
   * Only used if `tokenize` is successful once in the content.
   *
   * For example, if we’re currently parsing a link title and this construct
   * parses character references, then `resolveAll` is called *if* at least one
   * character reference is found, ranging from the start to the end of the link
   * title to the end.
   */
  resolveAll?: Resolver | undefined

  /**
   * Resolve the events from the start of the content (which includes other
   * constructs) to the last one parsed by `tokenize`.
   *
   * For example, if we’re currently parsing a link title and this construct
   * parses character references, then `resolveTo` is called with the events
   * ranging from the start of the link title to the end of a character
   * reference each time one is found.
   */
  resolveTo?: Resolver | undefined

  /**
   * Resolve the events parsed by `tokenize`.
   *
   * For example, if we’re currently parsing a link title and this construct
   * parses character references, then `resolve` is called with the events
   * ranging from the start to the end of a character reference each time one is
   * found.
   */
  resolve?: Resolver | undefined

  /**
   * Set up a state machine to handle character codes streaming in.
   */
  tokenize: Tokenizer
}

/**
 * Like a construct, but `tokenize` does not accept `ok` or `nok`.
 */
export interface InitialConstruct extends Omit<Construct, 'tokenize'> {
  tokenize: Initializer
}

/**
 * Several constructs, mapped from their initial codes.
 */
export type ConstructRecord = Record<
  string,
  Array<Construct> | Construct | undefined
>

/**
 * State shared between container calls.
 */
export interface ContainerState {
  /**
   * Special field to close the current flow (or containers).
   */
  _closeFlow?: boolean | undefined

  /**
   * Whether there are further blank lines, used by lists.
   */
  furtherBlankLines?: boolean | undefined

  /**
   * Whether there first line is blank, used by lists.
   */
  initialBlankLine?: boolean | undefined

  /**
   * Current marker, used by lists.
   */
  marker?: Code | undefined

  /**
   * Used by block quotes.
   */
  open?: boolean | undefined

  /**
   * Current size, used by lists.
   */
  size?: number | undefined

  /**
   * Current token type, used by lists.
   */
  type?: TokenType | undefined
}

/**
 * A context object that helps w/ tokenizing markdown constructs.
 */
export interface TokenizeContext {
  // To do: next major: remove `_gfmTableDynamicInterruptHack` (no longer
  // needed in micromark-extension-gfm-table@1.0.6).
  /**
   * Internal boolean shared with `micromark-extension-gfm-table` whose body
   * rows are not affected by normal interruption rules.
   * “Normal” rules are, for example, that an empty list item can’t interrupt:
   *
   * ````markdown
   * a
   * *
   * ````
   *
   * The above is one paragraph.
   * These rules don’t apply to table body rows:
   *
   * ````markdown
   * | a |
   * | - |
   * *
   * ````
   *
   * The above list interrupts the table.
   */
  _gfmTableDynamicInterruptHack?: boolean

  /**
   * Internal boolean shared with `micromark-extension-gfm-task-list-item` to
   * signal whether the tokenizer is tokenizing the first content of a list item
   * construct.
   */
  _gfmTasklistFirstContentOfListItem?: boolean | undefined

  /**
   * Declares that trailing whitespace is sensitive,
   * is allowed,
   * when tokenizing `text` (or `string`).
   * Normally,
   * trailing spaces and tabs are dropped.
   */
  _contentTypeTextTrailing?: boolean | undefined

  /**
   * Current code.
   */
  code: Code

  /**
   * Share state set when parsing containers.
   *
   * Containers are parsed in separate phases: their first line (`tokenize`),
   * continued lines (`continuation.tokenize`), and finally `exit`.
   * This record can be used to store some information between these hooks.
   */
  containerState?: ContainerState | undefined

  /**
   * The current construct.
   *
   * Constructs that are not `partial` are set here.
   */
  currentConstruct?: Construct | undefined

  /**
   * Current list of events.
   */
  events: Array<Event>

  /**
   * Whether we’re currently interrupting.
   *
   * Take for example:
   *
   * ```markdown
   * a
   * # b
   * ```
   *
   * At 2:1, we’re “interrupting”.
   */
  interrupt?: boolean | undefined

  /**
   * The relevant parsing context.
   */
  parser: ParseContext

  /**
   * The previous code.
   */
  previous: Code

  /**
   * Define a skip
   *
   * As containers (block quotes, lists), “nibble” a prefix from the margins,
   * where a line starts after that prefix is defined here.
   * When the tokenizers moves after consuming a line ending corresponding to
   * the line number in the given point, the tokenizer shifts past the prefix
   * based on the column in the shifted point.
   *
   * @param point
   *   Skip.
   * @returns
   *   Nothing.
   */
  defineSkip(point: Point): undefined

  /**
   * Get the current place.
   *
   * @returns
   *   Current point.
   */
  now(): Point

  /**
   * Get the source text that spans a token (or location).
   *
   * @param token
   *   Start/end in stream.
   * @param expandTabs
   *   Whether to expand tabs.
   * @returns
   *   Serialized chunks.
   */
  sliceSerialize(
    token: Pick<Token, 'end' | 'start'>,
    expandTabs?: boolean | undefined
  ): string

  /**
   * Get the chunks that span a token (or location).
   *
   * @param token
   *   Start/end in stream.
   * @returns
   *   List of chunks.
   */
  sliceStream(token: Pick<Token, 'end' | 'start'>): Array<Chunk>

  /**
   * Write a slice of chunks.
   *
   * The eof code (`null`) can be used to signal the end of the stream.
   *
   * @param slice
   *   Chunks.
   * @returns
   *   Events.
   */
  write(slice: Array<Chunk>): Array<Event>
}

/**
 * Encodings supported by `TextEncoder`.
 *
 * Arbitrary encodings can be supported depending on how the engine is built.
 * So any string *could* be valid.
 * But you probably want `utf-8`.
 */
export type Encoding =
  // Encodings supported in Node by default or when built with the small-icu option.
  // Does not include aliases.
  | 'utf-8' // Always supported in Node.
  | 'utf-16le' // Always supported in Node.
  | 'utf-16be' // Not supported when ICU is disabled.
  // Everything else (depends on browser, or full ICU data).
  // eslint-disable-next-line @typescript-eslint/ban-types
  | (string & {})

/**
 * Contents of the file.
 *
 * Can either be text, or a `Uint8Array` like structure.
 */
export type Value = Uint8Array | string

/**
 * A syntax extension changes how markdown is tokenized.
 *
 * See: <https://github.com/micromark/micromark#syntaxextension>
 */
export interface Extension {
  attentionMarkers?: {null?: Array<Code> | undefined} | undefined
  contentInitial?: ConstructRecord | undefined
  disable?: {null?: Array<string> | undefined} | undefined
  document?: ConstructRecord | undefined
  flowInitial?: ConstructRecord | undefined
  flow?: ConstructRecord | undefined
  insideSpan?:
    | {null?: Array<Pick<Construct, 'resolveAll'>> | undefined}
    | undefined
  string?: ConstructRecord | undefined
  text?: ConstructRecord | undefined
}

/**
 * A filtered, combined, extension.
 */
export type NormalizedExtension = {
  [Key in keyof Extension]: Exclude<Extension[Key], undefined>
}

/**
 * A full, filtereed, normalized, extension.
 */
export type FullNormalizedExtension = {
  [Key in keyof Extension]-?: Exclude<Extension[Key], undefined>
}

/**
 * Create a context.
 *
 * @param from
 *   Where to create from.
 * @returns
 *   Context.
 */
export type Create = (
  from?: Omit<Point, '_bufferIndex' | '_index'> | undefined
) => TokenizeContext

/**
 * Config defining how to parse.
 */
export interface ParseOptions {
  /**
   * Array of syntax extensions (default: `[]`).
   */
  extensions?: Array<Extension> | null | undefined
}

/**
 * A context object that helps w/ parsing markdown.
 */
export interface ParseContext {
  /**
   * All constructs.
   */
  constructs: FullNormalizedExtension

  /**
   * List of defined identifiers.
   */
  defined: Array<string>

  /**
   * Map of line numbers to whether they are lazy (as opposed to the line before
   * them).
   * Take for example:
   *
   * ```markdown
   * > a
   * b
   * ```
   *
   * L1 here is not lazy, L2 is.
   */
  lazy: Record<number, boolean>

  /**
   * Create a content tokenizer.
   */
  content: Create

  /**
   * Create a document tokenizer.
   */
  document: Create

  /**
   * Create a flow tokenizer.
   */
  flow: Create

  /**
   * Create a string tokenizer.
   */
  string: Create

  /**
   * Create a text tokenizer.
   */
  text: Create
}

/**
 * HTML compiler context.
 */
export interface CompileContext {
  /**
   * Configuration passed by the user.
   */
  options: CompileOptions

  /**
   * Capture some of the output data.
   *
   * @returns
   *   Nothing.
   */
  buffer(): undefined

  /**
   * Make a value safe for injection in HTML (except w/ `ignoreEncode`).
   *
   * @param value
   *   Raw value.
   * @returns
   *   Safe value.
   */
  encode(value: string): string

  /**
   * Get data from the key-value store.
   *
   * @param key
   *   Key.
   * @returns
   *   Value at `key` in compile data.
   */
  getData<Key extends keyof CompileData>(key: Key): CompileData[Key]

  /**
   * Output an extra line ending if the previous value wasn’t EOF/EOL.
   *
   * @returns
   *   Nothing.
   */
  lineEndingIfNeeded(): undefined

  /**
   * Output raw data.
   *
   * @param value
   *   Raw value.
   * @returns
   *   Nothing.
   */
  raw(value: string): undefined

  /**
   * Stop capturing and access the output data.
   *
   * @returns
   *   Captured data.
   */
  resume(): string

  /**
   * Set data into the key-value store.
   *
   * @param key
   *   Key.
   * @param value
   *   Value.
   * @returns
   *   Nothing.
   */
  setData<Key extends keyof CompileData>(
    key: Key,
    value?: CompileData[Key]
  ): undefined

  /**
   * Get the string value of a token.
   *
   * @param token
   *   Start/end in stream.
   * @param expandTabs
   *   Whether to expand tabs.
   * @returns
   *   Serialized chunks.
   */
  sliceSerialize(
    token: Pick<Token, 'end' | 'start'>,
    expandTabs?: boolean | undefined
  ): string

  /**
   * Output (parts of) HTML tags.
   *
   * @param value
   *   Raw value.
   * @returns
   *   Nothing.
   */
  tag(value: string): undefined
}

/**
 * Serialize micromark events as HTML.
 */
export type Compile = (events: Array<Event>) => string

/**
 * Handle one token.
 *
 * @param token
 *   Token.
 * @returns
 *   Nothing.
 */
export type Handle = (this: CompileContext, token: Token) => undefined

/**
 * Handle the whole document.
 *
 * @returns
 *   Nothing.
 */
export type DocumentHandle = (
  this: Omit<CompileContext, 'sliceSerialize'>
) => undefined

/**
 * Token types mapping to handles.
 */
export interface Handles extends Partial<Record<TokenType, Handle>> {
  /**
   * Document handle.
   */
  null?: DocumentHandle
}

/**
 * Normalized extenion.
 */
export interface HtmlExtension {
  enter?: Handles | undefined
  exit?: Handles | undefined
}

/**
 * An HTML extension changes how markdown tokens are serialized.
 */
export type NormalizedHtmlExtension = {
  [Key in keyof HtmlExtension]-?: Exclude<HtmlExtension[Key], undefined>
}

/**
 * Definition.
 */
export interface Definition {
  /**
   * Destination.
   */
  destination?: string | undefined
  /**
   * Title.
   */
  title?: string | undefined
}

/**
 * State tracked to compile events as HTML.
 */
export interface CompileData {
  /**
   * Whether the first list item is expected, used by lists.
   */
  expectFirstItem?: boolean | undefined

  /**
   * Current character reference kind.
   */
  characterReferenceType?: string | undefined

  /**
   * Collected definitions.
   */
  definitions: Record<string, Definition>

  /**
   * Whether we’re in fenced code, used by code (fenced).
   */
  fencedCodeInside?: boolean | undefined

  /**
   * Number of fences that were seen, used by code (fenced).
   */
  fencesCount?: number | undefined

  /**
   * Whether we’ve seen code data, used by code (fenced, indented).
   */
  flowCodeSeenData?: boolean | undefined

  /**
   * Current heading rank, used by heading (atx, setext).
   */
  headingRank?: number | undefined

  /**
   * Ignore encoding unsafe characters, used for example for URLs which are
   * first percent encoded, or by HTML when supporting it.
   */
  ignoreEncode?: boolean | undefined

  /**
   * Whether we’re in code data, used by code (text).
   */
  inCodeText?: boolean | undefined

  /**
   * Whether the last emitted value was a tag.
   */
  lastWasTag?: boolean | undefined

  /**
   * Whether to slurp all future line endings (has to be unset manually).
   */
  slurpAllLineEndings?: boolean | undefined

  /**
   * Whether to slurp the next line ending (resets itself on the next line
   * ending).
   */
  slurpOneLineEnding?: boolean | undefined

  /**
   * Stack of containers, whether they’re tight or not.
   */
  tightStack: Array<boolean>
}

/**
 * Type of line ending in markdown.
 */
export type LineEnding = '\r' | '\n' | '\r\n'

/**
 * Compile options.
 */
export interface CompileOptions {
  /**
   * Whether to allow (dangerous) HTML (`boolean`, default: `false`).
   *
   * The default is `false`, which still parses the HTML according to
   * `CommonMark` but shows the HTML as text instead of as elements.
   *
   * Pass `true` for trusted content to get actual HTML elements.
   */
  allowDangerousHtml?: boolean | null | undefined

  /**
   * Whether to allow dangerous protocols in links and images (`boolean`,
   * default: `false`).
   *
   * The default is `false`, which drops URLs in links and images that use
   * dangerous protocols.
   *
   * Pass `true` for trusted content to support all protocols.
   *
   * URLs that have no protocol (which means it’s relative to the current page,
   * such as `./some/page.html`) and URLs that have a safe protocol (for
   * images: `http`, `https`; for links: `http`, `https`, `irc`, `ircs`,
   * `mailto`, `xmpp`), are safe.
   * All other URLs are dangerous and dropped.
   */
  allowDangerousProtocol?: boolean | null | undefined

  /**
   * Default line ending to use when compiling to HTML, for line endings not in
   * `value`.
   *
   * Generally, `micromark` copies line endings (`\r`, `\n`, `\r\n`) in the
   * markdown document over to the compiled HTML.
   * In some cases, such as `> a`, CommonMark requires that extra line endings
   * are added: `<blockquote>\n<p>a</p>\n</blockquote>`.
   *
   * To create that line ending, the document is checked for the first line
   * ending that is used.
   * If there is no line ending, `defaultLineEnding` is used.
   * If that isn’t configured, `\n` is used.
   */
  defaultLineEnding?: LineEnding | null | undefined

  /**
   * Array of HTML extensions (default: `[]`).
   */
  htmlExtensions?: Array<HtmlExtension> | null | undefined
}

/**
 * Configuration.
 */
export type Options = CompileOptions & ParseOptions

/**
 * Enum of allowed token types.
 */
export type TokenType = keyof TokenTypeMap

// Note: when changing the next interface, you likely also have to change
// `micromark-util-symbol`.
/**
 * Map of allowed token types.
 */
export interface TokenTypeMap {
  // Note: these are compiled away.
  attentionSequence: 'attentionSequence' // To do: remove.
  space: 'space' // To do: remove.

  data: 'data'
  whitespace: 'whitespace'
  lineEnding: 'lineEnding'
  lineEndingBlank: 'lineEndingBlank'
  linePrefix: 'linePrefix'
  lineSuffix: 'lineSuffix'
  atxHeading: 'atxHeading'
  atxHeadingSequence: 'atxHeadingSequence'
  atxHeadingText: 'atxHeadingText'
  autolink: 'autolink'
  autolinkEmail: 'autolinkEmail'
  autolinkMarker: 'autolinkMarker'
  autolinkProtocol: 'autolinkProtocol'
  characterEscape: 'characterEscape'
  characterEscapeValue: 'characterEscapeValue'
  characterReference: 'characterReference'
  characterReferenceMarker: 'characterReferenceMarker'
  characterReferenceMarkerNumeric: 'characterReferenceMarkerNumeric'
  characterReferenceMarkerHexadecimal: 'characterReferenceMarkerHexadecimal'
  characterReferenceValue: 'characterReferenceValue'
  codeFenced: 'codeFenced'
  codeFencedFence: 'codeFencedFence'
  codeFencedFenceSequence: 'codeFencedFenceSequence'
  codeFencedFenceInfo: 'codeFencedFenceInfo'
  codeFencedFenceMeta: 'codeFencedFenceMeta'
  codeFlowValue: 'codeFlowValue'
  codeIndented: 'codeIndented'
  codeText: 'codeText'
  codeTextData: 'codeTextData'
  codeTextPadding: 'codeTextPadding'
  codeTextSequence: 'codeTextSequence'
  content: 'content'
  definition: 'definition'
  definitionDestination: 'definitionDestination'
  definitionDestinationLiteral: 'definitionDestinationLiteral'
  definitionDestinationLiteralMarker: 'definitionDestinationLiteralMarker'
  definitionDestinationRaw: 'definitionDestinationRaw'
  definitionDestinationString: 'definitionDestinationString'
  definitionLabel: 'definitionLabel'
  definitionLabelMarker: 'definitionLabelMarker'
  definitionLabelString: 'definitionLabelString'
  definitionMarker: 'definitionMarker'
  definitionTitle: 'definitionTitle'
  definitionTitleMarker: 'definitionTitleMarker'
  definitionTitleString: 'definitionTitleString'
  emphasis: 'emphasis'
  emphasisSequence: 'emphasisSequence'
  emphasisText: 'emphasisText'
  escapeMarker: 'escapeMarker'
  hardBreakEscape: 'hardBreakEscape'
  hardBreakTrailing: 'hardBreakTrailing'
  htmlFlow: 'htmlFlow'
  htmlFlowData: 'htmlFlowData'
  htmlText: 'htmlText'
  htmlTextData: 'htmlTextData'
  image: 'image'
  label: 'label'
  labelText: 'labelText'
  labelLink: 'labelLink'
  labelImage: 'labelImage'
  labelMarker: 'labelMarker'
  labelImageMarker: 'labelImageMarker'
  labelEnd: 'labelEnd'
  link: 'link'
  paragraph: 'paragraph'
  reference: 'reference'
  referenceMarker: 'referenceMarker'
  referenceString: 'referenceString'
  resource: 'resource'
  resourceDestination: 'resourceDestination'
  resourceDestinationLiteral: 'resourceDestinationLiteral'
  resourceDestinationLiteralMarker: 'resourceDestinationLiteralMarker'
  resourceDestinationRaw: 'resourceDestinationRaw'
  resourceDestinationString: 'resourceDestinationString'
  resourceMarker: 'resourceMarker'
  resourceTitle: 'resourceTitle'
  resourceTitleMarker: 'resourceTitleMarker'
  resourceTitleString: 'resourceTitleString'
  setextHeading: 'setextHeading'
  setextHeadingText: 'setextHeadingText'
  setextHeadingLine: 'setextHeadingLine'
  setextHeadingLineSequence: 'setextHeadingLineSequence'
  strong: 'strong'
  strongSequence: 'strongSequence'
  strongText: 'strongText'
  thematicBreak: 'thematicBreak'
  thematicBreakSequence: 'thematicBreakSequence'
  blockQuote: 'blockQuote'
  blockQuotePrefix: 'blockQuotePrefix'
  blockQuoteMarker: 'blockQuoteMarker'
  blockQuotePrefixWhitespace: 'blockQuotePrefixWhitespace'
  listOrdered: 'listOrdered'
  listUnordered: 'listUnordered'
  listItemIndent: 'listItemIndent'
  listItemMarker: 'listItemMarker'
  listItemPrefix: 'listItemPrefix'
  listItemPrefixWhitespace: 'listItemPrefixWhitespace'
  listItemValue: 'listItemValue'
  chunkDocument: 'chunkDocument'
  chunkContent: 'chunkContent'
  chunkFlow: 'chunkFlow'
  chunkText: 'chunkText'
  chunkString: 'chunkString'
}
ux5 // Note: types exported from `index.d.ts`.
export {}
dxI{
  "name": "micromark-util-types",
  "version": "2.0.2",
  "description": "micromark utility with a couple of typescript types",
  "license": "MIT",
  "keywords": [
    "micromark",
    "util",
    "utility",
    "typescript",
    "types"
  ],
  "repository": "https://github.com/micromark/micromark/tree/main/packages/micromark-util-types",
  "bugs": "https://github.com/micromark/micromark/issues",
  "funding": [
    {
      "type": "GitHub Sponsors",
      "url": "https://github.com/sponsors/unifiedjs"
    },
    {
      "type": "OpenCollective",
      "url": "https://opencollective.com/unified"
    }
  ],
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "sideEffects": false,
  "type": "module",
  "files": [
    "index.d.ts.map",
    "index.d.ts",
    "index.js"
  ],
  "exports": "./index.js",
  "xo": {
    "envs": [
      "shared-node-browser"
    ],
    "overrides": [
      {
        "files": [
          "**/*.d.ts"
        ],
        "rules": {
          "@typescript-eslint/array-type": [
            "error",
            {
              "default": "generic"
            }
          ],
          "@typescript-eslint/ban-types": [
            "error",
            {
              "extendDefaults": true
            }
          ],
          "@typescript-eslint/consistent-type-definitions": [
            "error",
            "interface"
          ]
        }
      }
    ],
    "prettier": true,
    "rules": {
      "unicorn/text-encoding-identifier-case": "off"
    }
  }
}
k@xK# micromark-util-types

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][bundle-size-badge]][bundle-size]
[![Sponsors][sponsors-badge]][opencollective]
[![Backers][backers-badge]][opencollective]
[![Chat][chat-badge]][chat]

[micromark][] utility package with TypeScript types.

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
* [Types](#types)
* [Compatibility](#compatibility)
* [Security](#security)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package exposes TypeScript types shared throughout the micromark
ecosystem.

## When should I use this?

This package is useful when you are making your own, typed, micromark
extensions.

## Install

In Node.js (version 16+), install with [npm][]:

```sh
npm install micromark-util-types
```

In Deno with [`esm.sh`][esmsh]:

```js
import type {Point, /* … */} from 'https://esm.sh/micromark-util-types@1'
```

## Use

```js
/**
 * @import {Point} from 'micromark-util-types'
 */
```

## API

This module exports no identifiers.
There is no default export.

See [the code][code] for all about the exposed types.

## Types

This package is just [TypeScript][] types.
It exports lots of different types.

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`micromark-util-types@2`, compatible with Node.js 16.
This package works with `micromark@3`.

## Security

This package is safe.
See [`security.md`][securitymd] in [`micromark/.github`][health] for how to
submit a security report.

## Contribute

See [`contributing.md`][contributing] in [`micromark/.github`][health] for ways
to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organisation, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[author]: https://wooorm.com

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[build]: https://github.com/micromark/micromark/actions

[build-badge]: https://github.com/micromark/micromark/workflows/main/badge.svg

[bundle-size]: https://bundlejs.com/?q=micromark-util-encode

[bundle-size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=micromark-util-encode

[chat]: https://github.com/micromark/micromark/discussions

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[coc]: https://github.com/micromark/.github/blob/main/code-of-conduct.md

[code]: https://github.com/micromark/micromark/blob/main/packages/micromark-util-types/index.d.ts

[contributing]: https://github.com/micromark/.github/blob/main/contributing.md

[coverage]: https://codecov.io/github/micromark/micromark

[coverage-badge]: https://img.shields.io/codecov/c/github/micromark/micromark.svg

[downloads]: https://www.npmjs.com/package/micromark-util-encode

[downloads-badge]: https://img.shields.io/npm/dm/micromark-util-encode.svg

[esmsh]: https://esm.sh

[health]: https://github.com/micromark/.github

[license]: https://github.com/micromark/micromark/blob/main/license

[micromark]: https://github.com/micromark/micromark

[npm]: https://docs.npmjs.com/cli/install

[opencollective]: https://opencollective.com/unified

[securitymd]: https://github.com/micromark/.github/blob/main/security.md

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[support]: https://github.com/micromark/.github/blob/main/support.md

[typescript]: https://www.typescriptlang.org
xxh40000 dev GYf;Ft100644 index.d.ts FҔ.LhyfQvu100644 index.d.ts.map uCCdWL *F@b100644 index.js w`^&{B.W(40000 lib f~|Oel100644 license Zbv8f,Q)100644 package.json 7u #T'#f100644 readme.md CI80Ăͅߎ100644 stream.d.ts +D~mN렄GE100644 stream.d.ts.map t/=q.}q100644 stream.js uab ,i6"3V\ޤi!򟧩x	100644 index.d.ts FҔ.LhyfQvu100644 index.d.ts.map uCCdWL *F@b100644 index.js _ .n40000 lib hg7YToB4OI1100644 stream.d.ts +D~mN렄GE100644 stream.d.ts.map t/=q.}q100644 stream.js )bFҸnllvviYx'/**
 * Compile markdown to HTML.
 *
 * > Note: which encodings are supported depends on the engine.
 * > For info on Node.js, see:
 * > <https://nodejs.org/api/util.html#whatwg-supported-encodings>.
 *
 * @overload
 * @param {Value} value
 *   Markdown to parse (`string` or `Uint8Array`).
 * @param {Encoding | null | undefined} encoding
 *   Character encoding to understand `value` as when it’s a `Uint8Array`
 *   (`string`, default: `'utf8'`).
 * @param {Options | null | undefined} [options]
 *   Configuration.
 * @returns {string}
 *   Compiled HTML.
 *
 * @overload
 * @param {Value} value
 *   Markdown to parse (`string` or `Uint8Array`).
 * @param {Options | null | undefined} [options]
 *   Configuration.
 * @returns {string}
 *   Compiled HTML.
 *
 * @param {Value} value
 *   Markdown to parse (`string` or `Uint8Array`).
 * @param {Encoding | Options | null | undefined} [encoding]
 *   Character encoding to understand `value` as when it’s a `Uint8Array`
 *   (`string`, default: `'utf8'`).
 * @param {Options | null | undefined} [options]
 *   Configuration.
 * @returns {string}
 *   Compiled HTML.
 */
export function micromark(value: Value, encoding: Encoding | null | undefined, options?: Options | null | undefined): string;
/**
 * Compile markdown to HTML.
 *
 * > Note: which encodings are supported depends on the engine.
 * > For info on Node.js, see:
 * > <https://nodejs.org/api/util.html#whatwg-supported-encodings>.
 *
 * @overload
 * @param {Value} value
 *   Markdown to parse (`string` or `Uint8Array`).
 * @param {Encoding | null | undefined} encoding
 *   Character encoding to understand `value` as when it’s a `Uint8Array`
 *   (`string`, default: `'utf8'`).
 * @param {Options | null | undefined} [options]
 *   Configuration.
 * @returns {string}
 *   Compiled HTML.
 *
 * @overload
 * @param {Value} value
 *   Markdown to parse (`string` or `Uint8Array`).
 * @param {Options | null | undefined} [options]
 *   Configuration.
 * @returns {string}
 *   Compiled HTML.
 *
 * @param {Value} value
 *   Markdown to parse (`string` or `Uint8Array`).
 * @param {Encoding | Options | null | undefined} [encoding]
 *   Character encoding to understand `value` as when it’s a `Uint8Array`
 *   (`string`, default: `'utf8'`).
 * @param {Options | null | undefined} [options]
 *   Configuration.
 * @returns {string}
 *   Compiled HTML.
 */
export function micromark(value: Value, options?: Options | null | undefined): string;
export { compile } from "./lib/compile.js";
export { parse } from "./lib/parse.js";
export { postprocess } from "./lib/postprocess.js";
export { preprocess } from "./lib/preprocess.js";
export type Options = import("micromark-util-types").Options;
import type { Value } from 'micromark-util-types';
import type { Encoding } from 'micromark-util-types';
//# sourceMappingURL=index.d.ts.mapTƨx|{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG,iCACQ,KAAK,YAEL,QAAQ,GAAG,IAAI,GAAG,SAAS,YAG3B,OAAO,GAAG,IAAI,GAAG,SAAS,GAExB,MAAM,CAGhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,iCACQ,KAAK,YAEL,OAAO,GAAG,IAAI,GAAG,SAAS,GAExB,MAAM,CAGhB;;;;;sBAvCU,OAAO,sBAAsB,EAAE,OAAO;2BAJjB,sBAAsB;8BAAtB,sBAAsB"}Ujwwxs/**
 * @import {Encoding, Value} from 'micromark-util-types'
 */

/**
 * @typedef {import('micromark-util-types').Options} Options
 */

import {compile} from './lib/compile.js'
import {parse} from './lib/parse.js'
import {postprocess} from './lib/postprocess.js'
import {preprocess} from './lib/preprocess.js'

export {compile} from './lib/compile.js'
export {parse} from './lib/parse.js'
export {postprocess} from './lib/postprocess.js'
export {preprocess} from './lib/preprocess.js'

/**
 * Compile markdown to HTML.
 *
 * > Note: which encodings are supported depends on the engine.
 * > For info on Node.js, see:
 * > <https://nodejs.org/api/util.html#whatwg-supported-encodings>.
 *
 * @overload
 * @param {Value} value
 *   Markdown to parse (`string` or `Uint8Array`).
 * @param {Encoding | null | undefined} encoding
 *   Character encoding to understand `value` as when it’s a `Uint8Array`
 *   (`string`, default: `'utf8'`).
 * @param {Options | null | undefined} [options]
 *   Configuration.
 * @returns {string}
 *   Compiled HTML.
 *
 * @overload
 * @param {Value} value
 *   Markdown to parse (`string` or `Uint8Array`).
 * @param {Options | null | undefined} [options]
 *   Configuration.
 * @returns {string}
 *   Compiled HTML.
 *
 * @param {Value} value
 *   Markdown to parse (`string` or `Uint8Array`).
 * @param {Encoding | Options | null | undefined} [encoding]
 *   Character encoding to understand `value` as when it’s a `Uint8Array`
 *   (`string`, default: `'utf8'`).
 * @param {Options | null | undefined} [options]
 *   Configuration.
 * @returns {string}
 *   Compiled HTML.
 */
export function micromark(value, encoding, options) {
  if (typeof encoding !== 'string') {
    options = encoding
    encoding = undefined
  }

  return compile(options)(
    postprocess(
      parse(options)
        .document()
        .write(preprocess()(value, encoding, true))
    )
  )
}
c/3x4100644 compile.d.ts SH+45100644 compile.d.ts.map tBNP0}sG&<100644 compile.js o 'P100644 constructs.d.ts <~dM	41m100644 constructs.d.ts.map X/(_5rtU100644 constructs.js ru.78%7n1EL100644 create-tokenizer.d.ts ؓ4)EKTiu100644 create-tokenizer.d.ts.map W۩<&_fmh100644 create-tokenizer.js Bu 9BCΎ40000 initialize )2VMoU_[rODe100644 parse.d.ts _rYd7nc100644 parse.d.ts.map i0>Ts1j100644 parse.js +Fvo\:100644 postprocess.d.ts }`΁{ȷD|Oc100644 postprocess.d.ts.map )\W{se100644 postprocess.js 2LvGsHUi100644 preprocess.d.ts 0ۧͼ+?c)\j100644 preprocess.d.ts.map VXW${p!100644 preprocess.js *eVa֠aS%ػ<uF"x#/**
 * @param {CompileOptions | null | undefined} [options]
 * @returns {Compile}
 */
export function compile(options?: CompileOptions | null | undefined): Compile;
export type Media = {
    image?: boolean | undefined;
    labelId?: string | undefined;
    label?: string | undefined;
    referenceId?: string | undefined;
    destination?: string | undefined;
    title?: string | undefined;
};
import type { CompileOptions } from 'micromark-util-types';
import type { Compile } from 'micromark-util-types';
//# sourceMappingURL=compile.d.ts.maptxG{"version":3,"file":"compile.d.ts","sourceRoot":"","sources":["compile.js"],"names":[],"mappings":"AA6DA;;;GAGG;AACH,kCAHW,cAAc,GAAG,IAAI,GAAG,SAAS,GAC/B,OAAO,CAgkCnB;;YA/lCa,OAAO,GAAG,SAAS;cACnB,MAAM,GAAG,SAAS;YAClB,MAAM,GAAG,SAAS;kBAClB,MAAM,GAAG,SAAS;kBAClB,MAAM,GAAG,SAAS;YAClB,MAAM,GAAG,SAAS;;oCAVtB,sBAAsB;6BAAtB,sBAAsB"}^xvk/**
 * While micromark is a lexer/tokenizer, the common case of going from markdown
 * to html is currently built in as this module, even though the parts can be
 * used separately to build ASTs, CSTs, or many other output formats.
 *
 * Having an HTML compiler built in is useful because it allows us to check for
 * compliancy to CommonMark, the de facto norm of markdown, specified in roughly
 * 600 input/output cases.
 *
 * This module has an interface that accepts lists of events instead of the
 * whole at once, however, because markdown can’t be truly streaming, we buffer
 * events before processing and outputting the final result.
 */

/**
 * @import {
 *   CompileContext,
 *   CompileData,
 *   CompileOptions,
 *   Compile,
 *   Definition,
 *   Event,
 *   Handle,
 *   HtmlExtension,
 *   LineEnding,
 *   NormalizedHtmlExtension,
 *   Token
 * } from 'micromark-util-types'
 */

/**
 * @typedef Media
 * @property {boolean | undefined} [image]
 * @property {string | undefined} [labelId]
 * @property {string | undefined} [label]
 * @property {string | undefined} [referenceId]
 * @property {string | undefined} [destination]
 * @property {string | undefined} [title]
 */

import {decodeNamedCharacterReference} from 'decode-named-character-reference'
import {ok as assert} from 'devlop'
import {push} from 'micromark-util-chunked'
import {combineHtmlExtensions} from 'micromark-util-combine-extensions'
import {decodeNumericCharacterReference} from 'micromark-util-decode-numeric-character-reference'
import {encode as _encode} from 'micromark-util-encode'
import {normalizeIdentifier} from 'micromark-util-normalize-identifier'
import {sanitizeUri} from 'micromark-util-sanitize-uri'
import {codes, constants, types} from 'micromark-util-symbol'

const hasOwnProperty = {}.hasOwnProperty

/**
 * These two are allowlists of safe protocols for full URLs in respectively the
 * `href` (on `<a>`) and `src` (on `<img>`) attributes.
 * They are based on what is allowed on GitHub,
 * <https://github.com/syntax-tree/hast-util-sanitize/blob/9275b21/lib/github.json#L31>
 */
const protocolHref = /^(https?|ircs?|mailto|xmpp)$/i
const protocolSource = /^https?$/i

/**
 * @param {CompileOptions | null | undefined} [options]
 * @returns {Compile}
 */
export function compile(options) {
  const settings = options || {}

  /**
   * Tags is needed because according to markdown, links and emphasis and
   * whatnot can exist in images, however, as HTML doesn’t allow content in
   * images, the tags are ignored in the `alt` attribute, but the content
   * remains.
   *
   * @type {boolean | undefined}
   */
  let tags = true

  /**
   * An object to track identifiers to media (URLs and titles) defined with
   * definitions.
   *
   * @type {Record<string, Definition>}
   */
  const definitions = {}

  /**
   * A lot of the handlers need to capture some of the output data, modify it
   * somehow, and then deal with it.
   * We do that by tracking a stack of buffers, that can be opened (with
   * `buffer`) and closed (with `resume`) to access them.
   *
   * @type {Array<Array<string>>}
   */
  const buffers = [[]]

  /**
   * As we can have links in images and the other way around, where the deepest
   * ones are closed first, we need to track which one we’re in.
   *
   * @type {Array<Media>}
   */
  const mediaStack = []

  /**
   * Same as `mediaStack` for tightness, which is specific to lists.
   * We need to track if we’re currently in a tight or loose container.
   *
   * @type {Array<boolean>}
   */
  const tightStack = []

  /** @type {HtmlExtension} */
  const defaultHandlers = {
    enter: {
      blockQuote: onenterblockquote,
      codeFenced: onentercodefenced,
      codeFencedFenceInfo: buffer,
      codeFencedFenceMeta: buffer,
      codeIndented: onentercodeindented,
      codeText: onentercodetext,
      content: onentercontent,
      definition: onenterdefinition,
      definitionDestinationString: onenterdefinitiondestinationstring,
      definitionLabelString: buffer,
      definitionTitleString: buffer,
      emphasis: onenteremphasis,
      htmlFlow: onenterhtmlflow,
      htmlText: onenterhtml,
      image: onenterimage,
      label: buffer,
      link: onenterlink,
      listItemMarker: onenterlistitemmarker,
      listItemValue: onenterlistitemvalue,
      listOrdered: onenterlistordered,
      listUnordered: onenterlistunordered,
      paragraph: onenterparagraph,
      reference: buffer,
      resource: onenterresource,
      resourceDestinationString: onenterresourcedestinationstring,
      resourceTitleString: buffer,
      setextHeading: onentersetextheading,
      strong: onenterstrong
    },
    exit: {
      atxHeading: onexitatxheading,
      atxHeadingSequence: onexitatxheadingsequence,
      autolinkEmail: onexitautolinkemail,
      autolinkProtocol: onexitautolinkprotocol,
      blockQuote: onexitblockquote,
      characterEscapeValue: onexitdata,
      characterReferenceMarkerHexadecimal: onexitcharacterreferencemarker,
      characterReferenceMarkerNumeric: onexitcharacterreferencemarker,
      characterReferenceValue: onexitcharacterreferencevalue,
      codeFenced: onexitflowcode,
      codeFencedFence: onexitcodefencedfence,
      codeFencedFenceInfo: onexitcodefencedfenceinfo,
      codeFencedFenceMeta: onresumedrop,
      codeFlowValue: onexitcodeflowvalue,
      codeIndented: onexitflowcode,
      codeText: onexitcodetext,
      codeTextData: onexitdata,
      data: onexitdata,
      definition: onexitdefinition,
      definitionDestinationString: onexitdefinitiondestinationstring,
      definitionLabelString: onexitdefinitionlabelstring,
      definitionTitleString: onexitdefinitiontitlestring,
      emphasis: onexitemphasis,
      hardBreakEscape: onexithardbreak,
      hardBreakTrailing: onexithardbreak,
      htmlFlow: onexithtml,
      htmlFlowData: onexitdata,
      htmlText: onexithtml,
      htmlTextData: onexitdata,
      image: onexitmedia,
      label: onexitlabel,
      labelText: onexitlabeltext,
      lineEnding: onexitlineending,
      link: onexitmedia,
      listOrdered: onexitlistordered,
      listUnordered: onexitlistunordered,
      paragraph: onexitparagraph,
      reference: onresumedrop,
      referenceString: onexitreferencestring,
      resource: onresumedrop,
      resourceDestinationString: onexitresourcedestinationstring,
      resourceTitleString: onexitresourcetitlestring,
      setextHeading: onexitsetextheading,
      setextHeadingLineSequence: onexitsetextheadinglinesequence,
      setextHeadingText: onexitsetextheadingtext,
      strong: onexitstrong,
      thematicBreak: onexitthematicbreak
    }
  }

  /**
   * Combine the HTML extensions with the default handlers.
   * An HTML extension is an object whose fields are either `enter` or `exit`
   * (reflecting whether a token is entered or exited).
   * The values at such objects are names of tokens mapping to handlers.
   * Handlers are called, respectively when a token is opener or closed, with
   * that token, and a context as `this`.
   */
  const handlers = /** @type {NormalizedHtmlExtension} */ (
    combineHtmlExtensions([defaultHandlers, ...(settings.htmlExtensions || [])])
  )

  /**
   * Handlers do often need to keep track of some state.
   * That state is provided here as a key-value store (an object).
   *
   * @type {CompileData}
   */
  const data = {
    definitions,
    tightStack
  }

  /**
   * The context for handlers references a couple of useful functions.
   * In handlers from extensions, those can be accessed at `this`.
   * For the handlers here, they can be accessed directly.
   *
   * @type {Omit<CompileContext, 'sliceSerialize'>}
   */
  const context = {
    buffer,
    encode,
    getData,
    lineEndingIfNeeded,
    options: settings,
    raw,
    resume,
    setData,
    tag
  }

  /**
   * Generally, micromark copies line endings (`'\r'`, `'\n'`, `'\r\n'`) in the
   * markdown document over to the compiled HTML.
   * In some cases, such as `> a`, CommonMark requires that extra line endings
   * are added: `<blockquote>\n<p>a</p>\n</blockquote>`.
   * This variable hold the default line ending when given (or `undefined`),
   * and in the latter case will be updated to the first found line ending if
   * there is one.
   */
  let lineEndingStyle = settings.defaultLineEnding

  // Return the function that handles a slice of events.
  return compile

  /**
   * Deal w/ a slice of events.
   * Return either the empty string if there’s nothing of note to return, or the
   * result when done.
   *
   * @param {ReadonlyArray<Event>} events
   * @returns {string}
   */
  function compile(events) {
    let index = -1
    let start = 0
    /** @type {Array<number>} */
    const listStack = []
    // As definitions can come after references, we need to figure out the media
    // (urls and titles) defined by them before handling the references.
    // So, we do sort of what HTML does: put metadata at the start (in head), and
    // then put content after (`body`).
    /** @type {Array<Event>} */
    let head = []
    /** @type {Array<Event>} */
    let body = []

    while (++index < events.length) {
      // Figure out the line ending style used in the document.
      if (
        !lineEndingStyle &&
        (events[index][1].type === types.lineEnding ||
          events[index][1].type === types.lineEndingBlank)
      ) {
        lineEndingStyle = /** @type {LineEnding} */ (
          events[index][2].sliceSerialize(events[index][1])
        )
      }

      // Preprocess lists to infer whether the list is loose or not.
      if (
        events[index][1].type === types.listOrdered ||
        events[index][1].type === types.listUnordered
      ) {
        if (events[index][0] === 'enter') {
          listStack.push(index)
        } else {
          prepareList(events.slice(listStack.pop(), index))
        }
      }

      // Move definitions to the front.
      if (events[index][1].type === types.definition) {
        if (events[index][0] === 'enter') {
          body = push(body, events.slice(start, index))
          start = index
        } else {
          head = push(head, events.slice(start, index + 1))
          start = index + 1
        }
      }
    }

    head = push(head, body)
    head = push(head, events.slice(start))
    index = -1
    const result = head

    // Handle the start of the document, if defined.
    if (handlers.enter.null) {
      handlers.enter.null.call(context)
    }

    // Handle all events.
    while (++index < events.length) {
      const handles = handlers[result[index][0]]
      const kind = result[index][1].type
      const handle = handles[kind]

      if (hasOwnProperty.call(handles, kind) && handle) {
        handle.call(
          {sliceSerialize: result[index][2].sliceSerialize, ...context},
          result[index][1]
        )
      }
    }

    // Handle the end of the document, if defined.
    if (handlers.exit.null) {
      handlers.exit.null.call(context)
    }

    return buffers[0].join('')
  }

  /**
   * Figure out whether lists are loose or not.
   *
   * @param {ReadonlyArray<Event>} slice
   * @returns {undefined}
   */
  function prepareList(slice) {
    const length = slice.length
    let index = 0 // Skip open.
    let containerBalance = 0
    let loose = false
    /** @type {boolean | undefined} */
    let atMarker

    while (++index < length) {
      const event = slice[index]

      if (event[1]._container) {
        atMarker = undefined

        if (event[0] === 'enter') {
          containerBalance++
        } else {
          containerBalance--
        }
      } else
        switch (event[1].type) {
          case types.listItemPrefix: {
            if (event[0] === 'exit') {
              atMarker = true
            }

            break
          }

          case types.linePrefix: {
            // Ignore

            break
          }

          case types.lineEndingBlank: {
            if (event[0] === 'enter' && !containerBalance) {
              if (atMarker) {
                atMarker = undefined
              } else {
                loose = true
              }
            }

            break
          }

          default: {
            atMarker = undefined
          }
        }
    }

    slice[0][1]._loose = loose
  }

  /**
   * @type {CompileContext['setData']}
   */
  function setData(key, value) {
    // @ts-expect-error: assume `value` is omitted (`undefined` is passed) only
    // if allowed.
    data[key] = value
  }

  /**
   * @type {CompileContext['getData']}
   */
  function getData(key) {
    return data[key]
  }

  /** @type {CompileContext['buffer']} */
  function buffer() {
    buffers.push([])
  }

  /** @type {CompileContext['resume']} */
  function resume() {
    const buf = buffers.pop()
    assert(buf !== undefined, 'Cannot resume w/o buffer')
    return buf.join('')
  }

  /** @type {CompileContext['tag']} */
  function tag(value) {
    if (!tags) return
    setData('lastWasTag', true)
    buffers[buffers.length - 1].push(value)
  }

  /** @type {CompileContext['raw']} */
  function raw(value) {
    setData('lastWasTag')
    buffers[buffers.length - 1].push(value)
  }

  /**
   * Output an extra line ending.
   *
   * @returns {undefined}
   */
  function lineEnding() {
    raw(lineEndingStyle || '\n')
  }

  /** @type {CompileContext['lineEndingIfNeeded']} */
  function lineEndingIfNeeded() {
    const buffer = buffers[buffers.length - 1]
    const slice = buffer[buffer.length - 1]
    const previous = slice ? slice.charCodeAt(slice.length - 1) : codes.eof

    if (
      previous === codes.lf ||
      previous === codes.cr ||
      previous === codes.eof
    ) {
      return
    }

    lineEnding()
  }

  /** @type {CompileContext['encode']} */
  function encode(value) {
    return getData('ignoreEncode') ? value : _encode(value)
  }

  //
  // Handlers.
  //

  /**
   * @returns {undefined}
   */
  function onresumedrop() {
    resume()
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onenterlistordered(token) {
    tightStack.push(!token._loose)
    lineEndingIfNeeded()
    tag('<ol')
    setData('expectFirstItem', true)
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onenterlistunordered(token) {
    tightStack.push(!token._loose)
    lineEndingIfNeeded()
    tag('<ul')
    setData('expectFirstItem', true)
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onenterlistitemvalue(token) {
    if (getData('expectFirstItem')) {
      const value = Number.parseInt(
        this.sliceSerialize(token),
        constants.numericBaseDecimal
      )

      if (value !== 1) {
        tag(' start="' + encode(String(value)) + '"')
      }
    }
  }

  /**
   * @returns {undefined}
   */
  function onenterlistitemmarker() {
    if (getData('expectFirstItem')) {
      tag('>')
    } else {
      onexitlistitem()
    }

    lineEndingIfNeeded()
    tag('<li>')
    setData('expectFirstItem')
    // “Hack” to prevent a line ending from showing up if the item is empty.
    setData('lastWasTag')
  }

  /**
   * @returns {undefined}
   */
  function onexitlistordered() {
    onexitlistitem()
    tightStack.pop()
    lineEnding()
    tag('</ol>')
  }

  /**
   * @returns {undefined}
   */
  function onexitlistunordered() {
    onexitlistitem()
    tightStack.pop()
    lineEnding()
    tag('</ul>')
  }

  /**
   * @returns {undefined}
   */
  function onexitlistitem() {
    if (getData('lastWasTag') && !getData('slurpAllLineEndings')) {
      lineEndingIfNeeded()
    }

    tag('</li>')
    setData('slurpAllLineEndings')
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onenterblockquote() {
    tightStack.push(false)
    lineEndingIfNeeded()
    tag('<blockquote>')
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitblockquote() {
    tightStack.pop()
    lineEndingIfNeeded()
    tag('</blockquote>')
    setData('slurpAllLineEndings')
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onenterparagraph() {
    if (!tightStack[tightStack.length - 1]) {
      lineEndingIfNeeded()
      tag('<p>')
    }

    setData('slurpAllLineEndings')
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitparagraph() {
    if (tightStack[tightStack.length - 1]) {
      setData('slurpAllLineEndings', true)
    } else {
      tag('</p>')
    }
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onentercodefenced() {
    lineEndingIfNeeded()
    tag('<pre><code')
    setData('fencesCount', 0)
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitcodefencedfenceinfo() {
    const value = resume()
    tag(' class="language-' + value + '"')
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitcodefencedfence() {
    const count = getData('fencesCount') || 0

    if (!count) {
      tag('>')
      setData('slurpOneLineEnding', true)
    }

    setData('fencesCount', count + 1)
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onentercodeindented() {
    lineEndingIfNeeded()
    tag('<pre><code>')
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitflowcode() {
    const count = getData('fencesCount')

    // One special case is if we are inside a container, and the fenced code was
    // not closed (meaning it runs to the end).
    // In that case, the following line ending, is considered *outside* the
    // fenced code and block quote by micromark, but CM wants to treat that
    // ending as part of the code.
    if (
      count !== undefined &&
      count < 2 &&
      data.tightStack.length > 0 &&
      !getData('lastWasTag')
    ) {
      lineEnding()
    }

    // But in most cases, it’s simpler: when we’ve seen some data, emit an extra
    // line ending when needed.
    if (getData('flowCodeSeenData')) {
      lineEndingIfNeeded()
    }

    tag('</code></pre>')
    if (count !== undefined && count < 2) lineEndingIfNeeded()
    setData('flowCodeSeenData')
    setData('fencesCount')
    setData('slurpOneLineEnding')
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onenterimage() {
    mediaStack.push({image: true})
    tags = undefined // Disallow tags.
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onenterlink() {
    mediaStack.push({})
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitlabeltext(token) {
    mediaStack[mediaStack.length - 1].labelId = this.sliceSerialize(token)
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitlabel() {
    mediaStack[mediaStack.length - 1].label = resume()
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitreferencestring(token) {
    mediaStack[mediaStack.length - 1].referenceId = this.sliceSerialize(token)
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onenterresource() {
    buffer() // We can have line endings in the resource, ignore them.
    mediaStack[mediaStack.length - 1].destination = ''
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onenterresourcedestinationstring() {
    buffer()
    // Ignore encoding the result, as we’ll first percent encode the url and
    // encode manually after.
    setData('ignoreEncode', true)
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitresourcedestinationstring() {
    mediaStack[mediaStack.length - 1].destination = resume()
    setData('ignoreEncode')
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitresourcetitlestring() {
    mediaStack[mediaStack.length - 1].title = resume()
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitmedia() {
    let index = mediaStack.length - 1 // Skip current.
    const media = mediaStack[index]
    const id = media.referenceId || media.labelId
    assert(id !== undefined, 'media should have `referenceId` or `labelId`')
    assert(media.label !== undefined, 'media should have `label`')
    const context =
      media.destination === undefined
        ? definitions[normalizeIdentifier(id)]
        : media

    tags = true

    while (index--) {
      if (mediaStack[index].image) {
        tags = undefined
        break
      }
    }

    if (media.image) {
      tag(
        '<img src="' +
          sanitizeUri(
            context.destination,
            settings.allowDangerousProtocol ? undefined : protocolSource
          ) +
          '" alt="'
      )
      raw(media.label)
      tag('"')
    } else {
      tag(
        '<a href="' +
          sanitizeUri(
            context.destination,
            settings.allowDangerousProtocol ? undefined : protocolHref
          ) +
          '"'
      )
    }

    tag(context.title ? ' title="' + context.title + '"' : '')

    if (media.image) {
      tag(' />')
    } else {
      tag('>')
      raw(media.label)
      tag('</a>')
    }

    mediaStack.pop()
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onenterdefinition() {
    buffer()
    mediaStack.push({})
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitdefinitionlabelstring(token) {
    // Discard label, use the source content instead.
    resume()
    mediaStack[mediaStack.length - 1].labelId = this.sliceSerialize(token)
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onenterdefinitiondestinationstring() {
    buffer()
    setData('ignoreEncode', true)
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitdefinitiondestinationstring() {
    mediaStack[mediaStack.length - 1].destination = resume()
    setData('ignoreEncode')
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitdefinitiontitlestring() {
    mediaStack[mediaStack.length - 1].title = resume()
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitdefinition() {
    const media = mediaStack[mediaStack.length - 1]
    assert(media.labelId !== undefined, 'media should have `labelId`')
    const id = normalizeIdentifier(media.labelId)

    resume()

    if (!hasOwnProperty.call(definitions, id)) {
      definitions[id] = mediaStack[mediaStack.length - 1]
    }

    mediaStack.pop()
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onentercontent() {
    setData('slurpAllLineEndings', true)
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitatxheadingsequence(token) {
    // Exit for further sequences.
    if (getData('headingRank')) return
    setData('headingRank', this.sliceSerialize(token).length)
    lineEndingIfNeeded()
    tag('<h' + getData('headingRank') + '>')
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onentersetextheading() {
    buffer()
    setData('slurpAllLineEndings')
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitsetextheadingtext() {
    setData('slurpAllLineEndings', true)
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitatxheading() {
    tag('</h' + getData('headingRank') + '>')
    setData('headingRank')
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitsetextheadinglinesequence(token) {
    setData(
      'headingRank',
      this.sliceSerialize(token).charCodeAt(0) === codes.equalsTo ? 1 : 2
    )
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitsetextheading() {
    const value = resume()
    lineEndingIfNeeded()
    tag('<h' + getData('headingRank') + '>')
    raw(value)
    tag('</h' + getData('headingRank') + '>')
    setData('slurpAllLineEndings')
    setData('headingRank')
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitdata(token) {
    raw(encode(this.sliceSerialize(token)))
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitlineending(token) {
    if (getData('slurpAllLineEndings')) {
      return
    }

    if (getData('slurpOneLineEnding')) {
      setData('slurpOneLineEnding')
      return
    }

    if (getData('inCodeText')) {
      raw(' ')
      return
    }

    raw(encode(this.sliceSerialize(token)))
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitcodeflowvalue(token) {
    raw(encode(this.sliceSerialize(token)))
    setData('flowCodeSeenData', true)
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexithardbreak() {
    tag('<br />')
  }

  /**
   * @returns {undefined}
   */
  function onenterhtmlflow() {
    lineEndingIfNeeded()
    onenterhtml()
  }

  /**
   * @returns {undefined}
   */
  function onexithtml() {
    setData('ignoreEncode')
  }

  /**
   * @returns {undefined}
   */
  function onenterhtml() {
    if (settings.allowDangerousHtml) {
      setData('ignoreEncode', true)
    }
  }

  /**
   * @returns {undefined}
   */
  function onenteremphasis() {
    tag('<em>')
  }

  /**
   * @returns {undefined}
   */
  function onenterstrong() {
    tag('<strong>')
  }

  /**
   * @returns {undefined}
   */
  function onentercodetext() {
    setData('inCodeText', true)
    tag('<code>')
  }

  /**
   * @returns {undefined}
   */
  function onexitcodetext() {
    setData('inCodeText')
    tag('</code>')
  }

  /**
   * @returns {undefined}
   */
  function onexitemphasis() {
    tag('</em>')
  }

  /**
   * @returns {undefined}
   */
  function onexitstrong() {
    tag('</strong>')
  }

  /**
   * @returns {undefined}
   */
  function onexitthematicbreak() {
    lineEndingIfNeeded()
    tag('<hr />')
  }

  /**
   * @this {CompileContext}
   * @param {Token} token
   * @returns {undefined}
   */
  function onexitcharacterreferencemarker(token) {
    setData('characterReferenceType', token.type)
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitcharacterreferencevalue(token) {
    const value = this.sliceSerialize(token)
    const decoded = getData('characterReferenceType')
      ? decodeNumericCharacterReference(
          value,
          getData('characterReferenceType') ===
            types.characterReferenceMarkerNumeric
            ? constants.numericBaseDecimal
            : constants.numericBaseHexadecimal
        )
      : decodeNamedCharacterReference(value)

    // `decodeNamedCharacterReference` can return `false` for invalid named
    // character references,
    // but everything we’ve tokenized is valid.
    raw(encode(/** @type {string} */ (decoded)))
    setData('characterReferenceType')
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitautolinkprotocol(token) {
    const uri = this.sliceSerialize(token)
    tag(
      '<a href="' +
        sanitizeUri(
          uri,
          settings.allowDangerousProtocol ? undefined : protocolHref
        ) +
        '">'
    )
    raw(encode(uri))
    tag('</a>')
  }

  /**
   * @this {CompileContext}
   * @type {Handle}
   */
  function onexitautolinkemail(token) {
    const uri = this.sliceSerialize(token)
    tag('<a href="' + sanitizeUri('mailto:' + uri) + '">')
    raw(encode(uri))
    tag('</a>')
  }
}
x(/** @satisfies {Extension['document']} */
export const document: {
    42: import("micromark-util-types").Construct;
    43: import("micromark-util-types").Construct;
    45: import("micromark-util-types").Construct;
    48: import("micromark-util-types").Construct;
    49: import("micromark-util-types").Construct;
    50: import("micromark-util-types").Construct;
    51: import("micromark-util-types").Construct;
    52: import("micromark-util-types").Construct;
    53: import("micromark-util-types").Construct;
    54: import("micromark-util-types").Construct;
    55: import("micromark-util-types").Construct;
    56: import("micromark-util-types").Construct;
    57: import("micromark-util-types").Construct;
    62: import("micromark-util-types").Construct;
};
/** @satisfies {Extension['contentInitial']} */
export const contentInitial: {
    91: import("micromark-util-types").Construct;
};
/** @satisfies {Extension['flowInitial']} */
export const flowInitial: {
    [-2]: import("micromark-util-types").Construct;
    [-1]: import("micromark-util-types").Construct;
    32: import("micromark-util-types").Construct;
};
/** @satisfies {Extension['flow']} */
export const flow: {
    35: import("micromark-util-types").Construct;
    42: import("micromark-util-types").Construct;
    45: import("micromark-util-types").Construct[];
    60: import("micromark-util-types").Construct;
    61: import("micromark-util-types").Construct;
    95: import("micromark-util-types").Construct;
    96: import("micromark-util-types").Construct;
    126: import("micromark-util-types").Construct;
};
/** @satisfies {Extension['string']} */
export const string: {
    38: import("micromark-util-types").Construct;
    92: import("micromark-util-types").Construct;
};
/** @satisfies {Extension['text']} */
export const text: {
    [-5]: import("micromark-util-types").Construct;
    [-4]: import("micromark-util-types").Construct;
    [-3]: import("micromark-util-types").Construct;
    33: import("micromark-util-types").Construct;
    38: import("micromark-util-types").Construct;
    42: import("micromark-util-types").Construct;
    60: import("micromark-util-types").Construct[];
    91: import("micromark-util-types").Construct;
    92: import("micromark-util-types").Construct[];
    93: import("micromark-util-types").Construct;
    95: import("micromark-util-types").Construct;
    96: import("micromark-util-types").Construct;
};
export namespace insideSpan {
    let _null: (import("micromark-util-types").Construct | {
        resolveAll: import("micromark-util-types").Resolver;
    })[];
    export { _null as null };
}
export namespace attentionMarkers {
    let _null_1: (42 | 95)[];
    export { _null_1 as null };
}
export namespace disable {
    let _null_2: never[];
    export { _null_2 as null };
}
//# sourceMappingURL=constructs.d.ts.mappx{"version":3,"file":"constructs.d.ts","sourceRoot":"","sources":["constructs.js"],"names":[],"mappings":"AA6BA,yCAAyC;AACzC;;;;;;;;;;;;;;;EAeC;AAED,+CAA+C;AAC/C;;EAEC;AAED,4CAA4C;AAC5C;;;;EAIC;AAED,qCAAqC;AACrC;;;;;;;;;EASC;AAED,uCAAuC;AACvC;;;EAGC;AAED,qCAAqC;AACrC;;;;;;;;;;;;;EAaC"}2Rgx
/**
 * @import {Extension} from 'micromark-util-types'
 */

import {
  attention,
  autolink,
  blockQuote,
  characterEscape,
  characterReference,
  codeFenced,
  codeIndented,
  codeText,
  definition,
  hardBreakEscape,
  headingAtx,
  htmlFlow,
  htmlText,
  labelEnd,
  labelStartImage,
  labelStartLink,
  lineEnding,
  list,
  setextUnderline,
  thematicBreak
} from 'micromark-core-commonmark'
import {codes} from 'micromark-util-symbol'
import {resolver as resolveText} from './initialize/text.js'

/** @satisfies {Extension['document']} */
export const document = {
  [codes.asterisk]: list,
  [codes.plusSign]: list,
  [codes.dash]: list,
  [codes.digit0]: list,
  [codes.digit1]: list,
  [codes.digit2]: list,
  [codes.digit3]: list,
  [codes.digit4]: list,
  [codes.digit5]: list,
  [codes.digit6]: list,
  [codes.digit7]: list,
  [codes.digit8]: list,
  [codes.digit9]: list,
  [codes.greaterThan]: blockQuote
}

/** @satisfies {Extension['contentInitial']} */
export const contentInitial = {
  [codes.leftSquareBracket]: definition
}

/** @satisfies {Extension['flowInitial']} */
export const flowInitial = {
  [codes.horizontalTab]: codeIndented,
  [codes.virtualSpace]: codeIndented,
  [codes.space]: codeIndented
}

/** @satisfies {Extension['flow']} */
export const flow = {
  [codes.numberSign]: headingAtx,
  [codes.asterisk]: thematicBreak,
  [codes.dash]: [setextUnderline, thematicBreak],
  [codes.lessThan]: htmlFlow,
  [codes.equalsTo]: setextUnderline,
  [codes.underscore]: thematicBreak,
  [codes.graveAccent]: codeFenced,
  [codes.tilde]: codeFenced
}

/** @satisfies {Extension['string']} */
export const string = {
  [codes.ampersand]: characterReference,
  [codes.backslash]: characterEscape
}

/** @satisfies {Extension['text']} */
export const text = {
  [codes.carriageReturn]: lineEnding,
  [codes.lineFeed]: lineEnding,
  [codes.carriageReturnLineFeed]: lineEnding,
  [codes.exclamationMark]: labelStartImage,
  [codes.ampersand]: characterReference,
  [codes.asterisk]: attention,
  [codes.lessThan]: [autolink, htmlText],
  [codes.leftSquareBracket]: labelStartLink,
  [codes.backslash]: [hardBreakEscape, characterEscape],
  [codes.rightSquareBracket]: labelEnd,
  [codes.underscore]: attention,
  [codes.graveAccent]: codeText
}

/** @satisfies {Extension['insideSpan']} */
export const insideSpan = {null: [attention, resolveText]}

/** @satisfies {Extension['attentionMarkers']} */
export const attentionMarkers = {null: [codes.asterisk, codes.underscore]}

/** @satisfies {Extension['disable']} */
export const disable = {null: []}
6x~h^x/**
 * Create a tokenizer.
 * Tokenizers deal with one type of data (e.g., containers, flow, text).
 * The parser is the object dealing with it all.
 * `initialize` works like other constructs, except that only its `tokenize`
 * function is used, in which case it doesn’t receive an `ok` or `nok`.
 * `from` can be given to set the point before the first character, although
 * when further lines are indented, they must be set with `defineSkip`.
 *
 * @param {ParseContext} parser
 *   Parser.
 * @param {InitialConstruct} initialize
 *   Construct.
 * @param {Omit<Point, '_bufferIndex' | '_index'> | undefined} [from]
 *   Point (optional).
 * @returns {TokenizeContext}
 *   Context.
 */
export function createTokenizer(parser: ParseContext, initialize: InitialConstruct, from?: Omit<Point, "_bufferIndex" | "_index"> | undefined): TokenizeContext;
/**
 * Restore the state.
 */
export type Restore = () => undefined;
/**
 * Info.
 */
export type Info = {
    /**
     *   Restore.
     */
    restore: Restore;
    /**
     *   From.
     */
    from: number;
};
/**
 * Handle a successful run.
 */
export type ReturnHandle = (construct: Construct, info: Info) => undefined;
import type { ParseContext } from 'micromark-util-types';
import type { InitialConstruct } from 'micromark-util-types';
import type { Point } from 'micromark-util-types';
import type { TokenizeContext } from 'micromark-util-types';
import type { Construct } from 'micromark-util-types';
//# sourceMappingURL=create-tokenizer.d.ts.mapācxo{"version":3,"file":"create-tokenizer.d.ts","sourceRoot":"","sources":["create-tokenizer.js"],"names":[],"mappings":"AAgDA;;;;;;;;;;;;;;;;;GAiBG;AACH,wCATW,YAAY,cAEZ,gBAAgB,SAEhB,IAAI,CAAC,KAAK,EAAE,cAAc,GAAG,QAAQ,CAAC,GAAG,SAAS,GAEhD,eAAe,CAwhB3B;;;;4BApkBY,SAAS;;;;;;;;aAKR,OAAO;;;;UAEP,MAAM;;;;;uCAKT,SAAS,QAET,IAAI,KAEF,SAAS;kCAtBZ,sBAAsB;sCAAtB,sBAAsB;2BAAtB,sBAAsB;qCAAtB,sBAAsB;+BAAtB,sBAAsB"};yu3xE</**
 * @import {
 *   Chunk,
 *   Code,
 *   ConstructRecord,
 *   Construct,
 *   Effects,
 *   InitialConstruct,
 *   ParseContext,
 *   Point,
 *   State,
 *   TokenizeContext,
 *   Token
 * } from 'micromark-util-types'
 */

/**
 * @callback Restore
 *   Restore the state.
 * @returns {undefined}
 *   Nothing.
 *
 * @typedef Info
 *   Info.
 * @property {Restore} restore
 *   Restore.
 * @property {number} from
 *   From.
 *
 * @callback ReturnHandle
 *   Handle a successful run.
 * @param {Construct} construct
 *   Construct.
 * @param {Info} info
 *   Info.
 * @returns {undefined}
 *   Nothing.
 */

import createDebug from 'debug'
import {ok as assert} from 'devlop'
import {markdownLineEnding} from 'micromark-util-character'
import {push, splice} from 'micromark-util-chunked'
import {resolveAll} from 'micromark-util-resolve-all'
import {codes, values} from 'micromark-util-symbol'

const debug = createDebug('micromark')

/**
 * Create a tokenizer.
 * Tokenizers deal with one type of data (e.g., containers, flow, text).
 * The parser is the object dealing with it all.
 * `initialize` works like other constructs, except that only its `tokenize`
 * function is used, in which case it doesn’t receive an `ok` or `nok`.
 * `from` can be given to set the point before the first character, although
 * when further lines are indented, they must be set with `defineSkip`.
 *
 * @param {ParseContext} parser
 *   Parser.
 * @param {InitialConstruct} initialize
 *   Construct.
 * @param {Omit<Point, '_bufferIndex' | '_index'> | undefined} [from]
 *   Point (optional).
 * @returns {TokenizeContext}
 *   Context.
 */
export function createTokenizer(parser, initialize, from) {
  /** @type {Point} */
  let point = {
    _bufferIndex: -1,
    _index: 0,
    line: (from && from.line) || 1,
    column: (from && from.column) || 1,
    offset: (from && from.offset) || 0
  }
  /** @type {Record<string, number>} */
  const columnStart = {}
  /** @type {Array<Construct>} */
  const resolveAllConstructs = []
  /** @type {Array<Chunk>} */
  let chunks = []
  /** @type {Array<Token>} */
  let stack = []
  /** @type {boolean | undefined} */
  let consumed = true

  /**
   * Tools used for tokenizing.
   *
   * @type {Effects}
   */
  const effects = {
    attempt: constructFactory(onsuccessfulconstruct),
    check: constructFactory(onsuccessfulcheck),
    consume,
    enter,
    exit,
    interrupt: constructFactory(onsuccessfulcheck, {interrupt: true})
  }

  /**
   * State and tools for resolving and serializing.
   *
   * @type {TokenizeContext}
   */
  const context = {
    code: codes.eof,
    containerState: {},
    defineSkip,
    events: [],
    now,
    parser,
    previous: codes.eof,
    sliceSerialize,
    sliceStream,
    write
  }

  /**
   * The state function.
   *
   * @type {State | undefined}
   */
  let state = initialize.tokenize.call(context, effects)

  /**
   * Track which character we expect to be consumed, to catch bugs.
   *
   * @type {Code}
   */
  let expectedCode

  if (initialize.resolveAll) {
    resolveAllConstructs.push(initialize)
  }

  return context

  /** @type {TokenizeContext['write']} */
  function write(slice) {
    chunks = push(chunks, slice)

    main()

    // Exit if we’re not done, resolve might change stuff.
    if (chunks[chunks.length - 1] !== codes.eof) {
      return []
    }

    addResult(initialize, 0)

    // Otherwise, resolve, and exit.
    context.events = resolveAll(resolveAllConstructs, context.events, context)

    return context.events
  }

  //
  // Tools.
  //

  /** @type {TokenizeContext['sliceSerialize']} */
  function sliceSerialize(token, expandTabs) {
    return serializeChunks(sliceStream(token), expandTabs)
  }

  /** @type {TokenizeContext['sliceStream']} */
  function sliceStream(token) {
    return sliceChunks(chunks, token)
  }

  /** @type {TokenizeContext['now']} */
  function now() {
    // This is a hot path, so we clone manually instead of `Object.assign({}, point)`
    const {_bufferIndex, _index, line, column, offset} = point
    return {_bufferIndex, _index, line, column, offset}
  }

  /** @type {TokenizeContext['defineSkip']} */
  function defineSkip(value) {
    columnStart[value.line] = value.column
    accountForPotentialSkip()
    debug('position: define skip: `%j`', point)
  }

  //
  // State management.
  //

  /**
   * Main loop (note that `_index` and `_bufferIndex` in `point` are modified by
   * `consume`).
   * Here is where we walk through the chunks, which either include strings of
   * several characters, or numerical character codes.
   * The reason to do this in a loop instead of a call is so the stack can
   * drain.
   *
   * @returns {undefined}
   *   Nothing.
   */
  function main() {
    /** @type {number} */
    let chunkIndex

    while (point._index < chunks.length) {
      const chunk = chunks[point._index]

      // If we’re in a buffer chunk, loop through it.
      if (typeof chunk === 'string') {
        chunkIndex = point._index

        if (point._bufferIndex < 0) {
          point._bufferIndex = 0
        }

        while (
          point._index === chunkIndex &&
          point._bufferIndex < chunk.length
        ) {
          go(chunk.charCodeAt(point._bufferIndex))
        }
      } else {
        go(chunk)
      }
    }
  }

  /**
   * Deal with one code.
   *
   * @param {Code} code
   *   Code.
   * @returns {undefined}
   *   Nothing.
   */
  function go(code) {
    assert(consumed === true, 'expected character to be consumed')
    consumed = undefined
    debug('main: passing `%s` to %s', code, state && state.name)
    expectedCode = code
    assert(typeof state === 'function', 'expected state')
    state = state(code)
  }

  /** @type {Effects['consume']} */
  function consume(code) {
    assert(code === expectedCode, 'expected given code to equal expected code')

    debug('consume: `%s`', code)

    assert(
      consumed === undefined,
      'expected code to not have been consumed: this might be because `return x(code)` instead of `return x` was used'
    )
    assert(
      code === null
        ? context.events.length === 0 ||
            context.events[context.events.length - 1][0] === 'exit'
        : context.events[context.events.length - 1][0] === 'enter',
      'expected last token to be open'
    )

    if (markdownLineEnding(code)) {
      point.line++
      point.column = 1
      point.offset += code === codes.carriageReturnLineFeed ? 2 : 1
      accountForPotentialSkip()
      debug('position: after eol: `%j`', point)
    } else if (code !== codes.virtualSpace) {
      point.column++
      point.offset++
    }

    // Not in a string chunk.
    if (point._bufferIndex < 0) {
      point._index++
    } else {
      point._bufferIndex++

      // At end of string chunk.
      if (
        point._bufferIndex ===
        // Points w/ non-negative `_bufferIndex` reference
        // strings.
        /** @type {string} */ (chunks[point._index]).length
      ) {
        point._bufferIndex = -1
        point._index++
      }
    }

    // Expose the previous character.
    context.previous = code

    // Mark as consumed.
    consumed = true
  }

  /** @type {Effects['enter']} */
  function enter(type, fields) {
    /** @type {Token} */
    // @ts-expect-error Patch instead of assign required fields to help GC.
    const token = fields || {}
    token.type = type
    token.start = now()

    assert(typeof type === 'string', 'expected string type')
    assert(type.length > 0, 'expected non-empty string')
    debug('enter: `%s`', type)

    context.events.push(['enter', token, context])

    stack.push(token)

    return token
  }

  /** @type {Effects['exit']} */
  function exit(type) {
    assert(typeof type === 'string', 'expected string type')
    assert(type.length > 0, 'expected non-empty string')

    const token = stack.pop()
    assert(token, 'cannot close w/o open tokens')
    token.end = now()

    assert(type === token.type, 'expected exit token to match current token')

    assert(
      !(
        token.start._index === token.end._index &&
        token.start._bufferIndex === token.end._bufferIndex
      ),
      'expected non-empty token (`' + type + '`)'
    )

    debug('exit: `%s`', token.type)
    context.events.push(['exit', token, context])

    return token
  }

  /**
   * Use results.
   *
   * @type {ReturnHandle}
   */
  function onsuccessfulconstruct(construct, info) {
    addResult(construct, info.from)
  }

  /**
   * Discard results.
   *
   * @type {ReturnHandle}
   */
  function onsuccessfulcheck(_, info) {
    info.restore()
  }

  /**
   * Factory to attempt/check/interrupt.
   *
   * @param {ReturnHandle} onreturn
   *   Callback.
   * @param {{interrupt?: boolean | undefined} | undefined} [fields]
   *   Fields.
   */
  function constructFactory(onreturn, fields) {
    return hook

    /**
     * Handle either an object mapping codes to constructs, a list of
     * constructs, or a single construct.
     *
     * @param {Array<Construct> | ConstructRecord | Construct} constructs
     *   Constructs.
     * @param {State} returnState
     *   State.
     * @param {State | undefined} [bogusState]
     *   State.
     * @returns {State}
     *   State.
     */
    function hook(constructs, returnState, bogusState) {
      /** @type {ReadonlyArray<Construct>} */
      let listOfConstructs
      /** @type {number} */
      let constructIndex
      /** @type {Construct} */
      let currentConstruct
      /** @type {Info} */
      let info

      return Array.isArray(constructs)
        ? /* c8 ignore next 1 */
          handleListOfConstructs(constructs)
        : 'tokenize' in constructs
          ? // Looks like a construct.
            handleListOfConstructs([/** @type {Construct} */ (constructs)])
          : handleMapOfConstructs(constructs)

      /**
       * Handle a list of construct.
       *
       * @param {ConstructRecord} map
       *   Constructs.
       * @returns {State}
       *   State.
       */
      function handleMapOfConstructs(map) {
        return start

        /** @type {State} */
        function start(code) {
          const left = code !== null && map[code]
          const all = code !== null && map.null
          const list = [
            // To do: add more extension tests.
            /* c8 ignore next 2 */
            ...(Array.isArray(left) ? left : left ? [left] : []),
            ...(Array.isArray(all) ? all : all ? [all] : [])
          ]

          return handleListOfConstructs(list)(code)
        }
      }

      /**
       * Handle a list of construct.
       *
       * @param {ReadonlyArray<Construct>} list
       *   Constructs.
       * @returns {State}
       *   State.
       */
      function handleListOfConstructs(list) {
        listOfConstructs = list
        constructIndex = 0

        if (list.length === 0) {
          assert(bogusState, 'expected `bogusState` to be given')
          return bogusState
        }

        return handleConstruct(list[constructIndex])
      }

      /**
       * Handle a single construct.
       *
       * @param {Construct} construct
       *   Construct.
       * @returns {State}
       *   State.
       */
      function handleConstruct(construct) {
        return start

        /** @type {State} */
        function start(code) {
          // To do: not needed to store if there is no bogus state, probably?
          // Currently doesn’t work because `inspect` in document does a check
          // w/o a bogus, which doesn’t make sense. But it does seem to help perf
          // by not storing.
          info = store()
          currentConstruct = construct

          if (!construct.partial) {
            context.currentConstruct = construct
          }

          // Always populated by defaults.
          assert(
            context.parser.constructs.disable.null,
            'expected `disable.null` to be populated'
          )

          if (
            construct.name &&
            context.parser.constructs.disable.null.includes(construct.name)
          ) {
            return nok(code)
          }

          return construct.tokenize.call(
            // If we do have fields, create an object w/ `context` as its
            // prototype.
            // This allows a “live binding”, which is needed for `interrupt`.
            fields ? Object.assign(Object.create(context), fields) : context,
            effects,
            ok,
            nok
          )(code)
        }
      }

      /** @type {State} */
      function ok(code) {
        assert(code === expectedCode, 'expected code')
        consumed = true
        onreturn(currentConstruct, info)
        return returnState
      }

      /** @type {State} */
      function nok(code) {
        assert(code === expectedCode, 'expected code')
        consumed = true
        info.restore()

        if (++constructIndex < listOfConstructs.length) {
          return handleConstruct(listOfConstructs[constructIndex])
        }

        return bogusState
      }
    }
  }

  /**
   * @param {Construct} construct
   *   Construct.
   * @param {number} from
   *   From.
   * @returns {undefined}
   *   Nothing.
   */
  function addResult(construct, from) {
    if (construct.resolveAll && !resolveAllConstructs.includes(construct)) {
      resolveAllConstructs.push(construct)
    }

    if (construct.resolve) {
      splice(
        context.events,
        from,
        context.events.length - from,
        construct.resolve(context.events.slice(from), context)
      )
    }

    if (construct.resolveTo) {
      context.events = construct.resolveTo(context.events, context)
    }

    assert(
      construct.partial ||
        context.events.length === 0 ||
        context.events[context.events.length - 1][0] === 'exit',
      'expected last token to end'
    )
  }

  /**
   * Store state.
   *
   * @returns {Info}
   *   Info.
   */
  function store() {
    const startPoint = now()
    const startPrevious = context.previous
    const startCurrentConstruct = context.currentConstruct
    const startEventsIndex = context.events.length
    const startStack = Array.from(stack)

    return {from: startEventsIndex, restore}

    /**
     * Restore state.
     *
     * @returns {undefined}
     *   Nothing.
     */
    function restore() {
      point = startPoint
      context.previous = startPrevious
      context.currentConstruct = startCurrentConstruct
      context.events.length = startEventsIndex
      stack = startStack
      accountForPotentialSkip()
      debug('position: restore: `%j`', point)
    }
  }

  /**
   * Move the current point a bit forward in the line when it’s on a column
   * skip.
   *
   * @returns {undefined}
   *   Nothing.
   */
  function accountForPotentialSkip() {
    if (point.line in columnStart && point.column < 2) {
      point.column = columnStart[point.line]
      point.offset += columnStart[point.line] - 1
    }
  }
}

/**
 * Get the chunks from a slice of chunks in the range of a token.
 *
 * @param {ReadonlyArray<Chunk>} chunks
 *   Chunks.
 * @param {Pick<Token, 'end' | 'start'>} token
 *   Token.
 * @returns {Array<Chunk>}
 *   Chunks.
 */
function sliceChunks(chunks, token) {
  const startIndex = token.start._index
  const startBufferIndex = token.start._bufferIndex
  const endIndex = token.end._index
  const endBufferIndex = token.end._bufferIndex
  /** @type {Array<Chunk>} */
  let view

  if (startIndex === endIndex) {
    assert(endBufferIndex > -1, 'expected non-negative end buffer index')
    assert(startBufferIndex > -1, 'expected non-negative start buffer index')
    // @ts-expect-error `_bufferIndex` is used on string chunks.
    view = [chunks[startIndex].slice(startBufferIndex, endBufferIndex)]
  } else {
    view = chunks.slice(startIndex, endIndex)

    if (startBufferIndex > -1) {
      const head = view[0]
      if (typeof head === 'string') {
        view[0] = head.slice(startBufferIndex)
        /* c8 ignore next 4 -- used to be used, no longer */
      } else {
        assert(startBufferIndex === 0, 'expected `startBufferIndex` to be `0`')
        view.shift()
      }
    }

    if (endBufferIndex > 0) {
      // @ts-expect-error `_bufferIndex` is used on string chunks.
      view.push(chunks[endIndex].slice(0, endBufferIndex))
    }
  }

  return view
}

/**
 * Get the string value of a slice of chunks.
 *
 * @param {ReadonlyArray<Chunk>} chunks
 *   Chunks.
 * @param {boolean | undefined} [expandTabs=false]
 *   Whether to expand tabs (default: `false`).
 * @returns {string}
 *   Result.
 */
function serializeChunks(chunks, expandTabs) {
  let index = -1
  /** @type {Array<string>} */
  const result = []
  /** @type {boolean | undefined} */
  let atTab

  while (++index < chunks.length) {
    const chunk = chunks[index]
    /** @type {string} */
    let value

    if (typeof chunk === 'string') {
      value = chunk
    } else
      switch (chunk) {
        case codes.carriageReturn: {
          value = values.cr

          break
        }

        case codes.lineFeed: {
          value = values.lf

          break
        }

        case codes.carriageReturnLineFeed: {
          value = values.cr + values.lf

          break
        }

        case codes.horizontalTab: {
          value = expandTabs ? values.space : values.ht

          break
        }

        case codes.virtualSpace: {
          if (!expandTabs && atTab) continue
          value = values.space

          break
        }

        default: {
          assert(typeof chunk === 'number', 'expected number')
          // Currently only replacement character.
          value = String.fromCharCode(chunk)
        }
      }

    atTab = chunk === codes.horizontalTab
    result.push(value)
  }

  return result.join('')
}
wx&100644 content.d.ts @zNj0
+T100644 content.d.ts.map vp?? ¥\100644 content.js [?~mT8`0o&~100644 document.d.ts Z?vϖ'k\{ssӵW100644 document.d.ts.map M;p4VE^100644 document.js Y<,YАvcL0~100644 flow.d.ts U	F"l o=+100644 flow.d.ts.map \^Ow8̵{,*100644 flow.js w_ \m*}N\Jb100644 text.d.ts _&+3L7	ZÅko100644 text.d.ts.map 56F'Fc)k100644 text.js q
	ryW;{:1һ
x T/** @type {InitialConstruct} */
export const content: InitialConstruct;
import type { InitialConstruct } from 'micromark-util-types';
//# sourceMappingURL=content.d.ts.mapS>;	x h{"version":3,"file":"content.d.ts","sourceRoot":"","sources":["content.js"],"names":[],"mappings":"AAeA,+BAA+B;AAC/B,sBADW,gBAAgB,CACyB;sCAT1C,sBAAsB"}^/x5/**
 * @import {
 *   InitialConstruct,
 *   Initializer,
 *   State,
 *   TokenizeContext,
 *   Token
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {factorySpace} from 'micromark-factory-space'
import {markdownLineEnding} from 'micromark-util-character'
import {codes, constants, types} from 'micromark-util-symbol'

/** @type {InitialConstruct} */
export const content = {tokenize: initializeContent}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Initializer}
 *   Content.
 */
function initializeContent(effects) {
  const contentStart = effects.attempt(
    this.parser.constructs.contentInitial,
    afterContentStartConstruct,
    paragraphInitial
  )
  /** @type {Token} */
  let previous

  return contentStart

  /** @type {State} */
  function afterContentStartConstruct(code) {
    assert(
      code === codes.eof || markdownLineEnding(code),
      'expected eol or eof'
    )

    if (code === codes.eof) {
      effects.consume(code)
      return
    }

    effects.enter(types.lineEnding)
    effects.consume(code)
    effects.exit(types.lineEnding)
    return factorySpace(effects, contentStart, types.linePrefix)
  }

  /** @type {State} */
  function paragraphInitial(code) {
    assert(
      code !== codes.eof && !markdownLineEnding(code),
      'expected anything other than a line ending or EOF'
    )
    effects.enter(types.paragraph)
    return lineStart(code)
  }

  /** @type {State} */
  function lineStart(code) {
    const token = effects.enter(types.chunkText, {
      contentType: constants.contentTypeText,
      previous
    })

    if (previous) {
      previous.next = token
    }

    previous = token

    return data(code)
  }

  /** @type {State} */
  function data(code) {
    if (code === codes.eof) {
      effects.exit(types.chunkText)
      effects.exit(types.paragraph)
      effects.consume(code)
      return
    }

    if (markdownLineEnding(code)) {
      effects.consume(code)
      effects.exit(types.chunkText)
      return lineStart
    }

    // Data.
    effects.consume(code)
    return data
  }
}
cxy/** @type {InitialConstruct} */
export const document: InitialConstruct;
/**
 * Construct and its state.
 */
export type StackItem = [Construct, ContainerState];
import type { InitialConstruct } from 'micromark-util-types';
import type { Construct } from 'micromark-util-types';
import type { ContainerState } from 'micromark-util-types';
//# sourceMappingURL=document.d.ts.map?x &{"version":3,"file":"document.d.ts","sourceRoot":"","sources":["document.js"],"names":[],"mappings":"AAyBA,+BAA+B;AAC/B,uBADW,gBAAgB,CAC2B;;;;wBAXzC,CAAC,SAAS,EAAE,cAAc,CAAC;sCAJ9B,sBAAsB;+BAAtB,sBAAsB;oCAAtB,sBAAsB"}Ax/8/**
 * @import {
 *   Construct,
 *   ContainerState,
 *   InitialConstruct,
 *   Initializer,
 *   Point,
 *   State,
 *   TokenizeContext,
 *   Tokenizer,
 *   Token
 * } from 'micromark-util-types'
 */

/**
 * @typedef {[Construct, ContainerState]} StackItem
 *   Construct and its state.
 */

import {ok as assert} from 'devlop'
import {factorySpace} from 'micromark-factory-space'
import {markdownLineEnding} from 'micromark-util-character'
import {splice} from 'micromark-util-chunked'
import {codes, constants, types} from 'micromark-util-symbol'

/** @type {InitialConstruct} */
export const document = {tokenize: initializeDocument}

/** @type {Construct} */
const containerConstruct = {tokenize: tokenizeContainer}

/**
 * @this {TokenizeContext}
 *   Self.
 * @type {Initializer}
 *   Initializer.
 */
function initializeDocument(effects) {
  const self = this
  /** @type {Array<StackItem>} */
  const stack = []
  let continued = 0
  /** @type {TokenizeContext | undefined} */
  let childFlow
  /** @type {Token | undefined} */
  let childToken
  /** @type {number} */
  let lineStartOffset

  return start

  /** @type {State} */
  function start(code) {
    // First we iterate through the open blocks, starting with the root
    // document, and descending through last children down to the last open
    // block.
    // Each block imposes a condition that the line must satisfy if the block is
    // to remain open.
    // For example, a block quote requires a `>` character.
    // A paragraph requires a non-blank line.
    // In this phase we may match all or just some of the open blocks.
    // But we cannot close unmatched blocks yet, because we may have a lazy
    // continuation line.
    if (continued < stack.length) {
      const item = stack[continued]
      self.containerState = item[1]
      assert(
        item[0].continuation,
        'expected `continuation` to be defined on container construct'
      )
      return effects.attempt(
        item[0].continuation,
        documentContinue,
        checkNewContainers
      )(code)
    }

    // Done.
    return checkNewContainers(code)
  }

  /** @type {State} */
  function documentContinue(code) {
    assert(
      self.containerState,
      'expected `containerState` to be defined after continuation'
    )

    continued++

    // Note: this field is called `_closeFlow` but it also closes containers.
    // Perhaps a good idea to rename it but it’s already used in the wild by
    // extensions.
    if (self.containerState._closeFlow) {
      self.containerState._closeFlow = undefined

      if (childFlow) {
        closeFlow()
      }

      // Note: this algorithm for moving events around is similar to the
      // algorithm when dealing with lazy lines in `writeToChild`.
      const indexBeforeExits = self.events.length
      let indexBeforeFlow = indexBeforeExits
      /** @type {Point | undefined} */
      let point

      // Find the flow chunk.
      while (indexBeforeFlow--) {
        if (
          self.events[indexBeforeFlow][0] === 'exit' &&
          self.events[indexBeforeFlow][1].type === types.chunkFlow
        ) {
          point = self.events[indexBeforeFlow][1].end
          break
        }
      }

      assert(point, 'could not find previous flow chunk')

      exitContainers(continued)

      // Fix positions.
      let index = indexBeforeExits

      while (index < self.events.length) {
        self.events[index][1].end = {...point}
        index++
      }

      // Inject the exits earlier (they’re still also at the end).
      splice(
        self.events,
        indexBeforeFlow + 1,
        0,
        self.events.slice(indexBeforeExits)
      )

      // Discard the duplicate exits.
      self.events.length = index

      return checkNewContainers(code)
    }

    return start(code)
  }

  /** @type {State} */
  function checkNewContainers(code) {
    // Next, after consuming the continuation markers for existing blocks, we
    // look for new block starts (e.g. `>` for a block quote).
    // If we encounter a new block start, we close any blocks unmatched in
    // step 1 before creating the new block as a child of the last matched
    // block.
    if (continued === stack.length) {
      // No need to `check` whether there’s a container, of `exitContainers`
      // would be moot.
      // We can instead immediately `attempt` to parse one.
      if (!childFlow) {
        return documentContinued(code)
      }

      // If we have concrete content, such as block HTML or fenced code,
      // we can’t have containers “pierce” into them, so we can immediately
      // start.
      if (childFlow.currentConstruct && childFlow.currentConstruct.concrete) {
        return flowStart(code)
      }

      // If we do have flow, it could still be a blank line,
      // but we’d be interrupting it w/ a new container if there’s a current
      // construct.
      // To do: next major: remove `_gfmTableDynamicInterruptHack` (no longer
      // needed in micromark-extension-gfm-table@1.0.6).
      self.interrupt = Boolean(
        childFlow.currentConstruct && !childFlow._gfmTableDynamicInterruptHack
      )
    }

    // Check if there is a new container.
    self.containerState = {}
    return effects.check(
      containerConstruct,
      thereIsANewContainer,
      thereIsNoNewContainer
    )(code)
  }

  /** @type {State} */
  function thereIsANewContainer(code) {
    if (childFlow) closeFlow()
    exitContainers(continued)
    return documentContinued(code)
  }

  /** @type {State} */
  function thereIsNoNewContainer(code) {
    self.parser.lazy[self.now().line] = continued !== stack.length
    lineStartOffset = self.now().offset
    return flowStart(code)
  }

  /** @type {State} */
  function documentContinued(code) {
    // Try new containers.
    self.containerState = {}
    return effects.attempt(
      containerConstruct,
      containerContinue,
      flowStart
    )(code)
  }

  /** @type {State} */
  function containerContinue(code) {
    assert(
      self.currentConstruct,
      'expected `currentConstruct` to be defined on tokenizer'
    )
    assert(
      self.containerState,
      'expected `containerState` to be defined on tokenizer'
    )
    continued++
    stack.push([self.currentConstruct, self.containerState])
    // Try another.
    return documentContinued(code)
  }

  /** @type {State} */
  function flowStart(code) {
    if (code === codes.eof) {
      if (childFlow) closeFlow()
      exitContainers(0)
      effects.consume(code)
      return
    }

    childFlow = childFlow || self.parser.flow(self.now())
    effects.enter(types.chunkFlow, {
      _tokenizer: childFlow,
      contentType: constants.contentTypeFlow,
      previous: childToken
    })

    return flowContinue(code)
  }

  /** @type {State} */
  function flowContinue(code) {
    if (code === codes.eof) {
      writeToChild(effects.exit(types.chunkFlow), true)
      exitContainers(0)
      effects.consume(code)
      return
    }

    if (markdownLineEnding(code)) {
      effects.consume(code)
      writeToChild(effects.exit(types.chunkFlow))
      // Get ready for the next line.
      continued = 0
      self.interrupt = undefined
      return start
    }

    effects.consume(code)
    return flowContinue
  }

  /**
   * @param {Token} token
   *   Token.
   * @param {boolean | undefined} [endOfFile]
   *   Whether the token is at the end of the file (default: `false`).
   * @returns {undefined}
   *   Nothing.
   */
  function writeToChild(token, endOfFile) {
    assert(childFlow, 'expected `childFlow` to be defined when continuing')
    const stream = self.sliceStream(token)
    if (endOfFile) stream.push(null)
    token.previous = childToken
    if (childToken) childToken.next = token
    childToken = token
    childFlow.defineSkip(token.start)
    childFlow.write(stream)

    // Alright, so we just added a lazy line:
    //
    // ```markdown
    // > a
    // b.
    //
    // Or:
    //
    // > ~~~c
    // d
    //
    // Or:
    //
    // > | e |
    // f
    // ```
    //
    // The construct in the second example (fenced code) does not accept lazy
    // lines, so it marked itself as done at the end of its first line, and
    // then the content construct parses `d`.
    // Most constructs in markdown match on the first line: if the first line
    // forms a construct, a non-lazy line can’t “unmake” it.
    //
    // The construct in the third example is potentially a GFM table, and
    // those are *weird*.
    // It *could* be a table, from the first line, if the following line
    // matches a condition.
    // In this case, that second line is lazy, which “unmakes” the first line
    // and turns the whole into one content block.
    //
    // We’ve now parsed the non-lazy and the lazy line, and can figure out
    // whether the lazy line started a new flow block.
    // If it did, we exit the current containers between the two flow blocks.
    if (self.parser.lazy[token.start.line]) {
      let index = childFlow.events.length

      while (index--) {
        if (
          // The token starts before the line ending…
          childFlow.events[index][1].start.offset < lineStartOffset &&
          // …and either is not ended yet…
          (!childFlow.events[index][1].end ||
            // …or ends after it.
            childFlow.events[index][1].end.offset > lineStartOffset)
        ) {
          // Exit: there’s still something open, which means it’s a lazy line
          // part of something.
          return
        }
      }

      // Note: this algorithm for moving events around is similar to the
      // algorithm when closing flow in `documentContinue`.
      const indexBeforeExits = self.events.length
      let indexBeforeFlow = indexBeforeExits
      /** @type {boolean | undefined} */
      let seen
      /** @type {Point | undefined} */
      let point

      // Find the previous chunk (the one before the lazy line).
      while (indexBeforeFlow--) {
        if (
          self.events[indexBeforeFlow][0] === 'exit' &&
          self.events[indexBeforeFlow][1].type === types.chunkFlow
        ) {
          if (seen) {
            point = self.events[indexBeforeFlow][1].end
            break
          }

          seen = true
        }
      }

      assert(point, 'could not find previous flow chunk')

      exitContainers(continued)

      // Fix positions.
      index = indexBeforeExits

      while (index < self.events.length) {
        self.events[index][1].end = {...point}
        index++
      }

      // Inject the exits earlier (they’re still also at the end).
      splice(
        self.events,
        indexBeforeFlow + 1,
        0,
        self.events.slice(indexBeforeExits)
      )

      // Discard the duplicate exits.
      self.events.length = index
    }
  }

  /**
   * @param {number} size
   *   Size.
   * @returns {undefined}
   *   Nothing.
   */
  function exitContainers(size) {
    let index = stack.length

    // Exit open containers.
    while (index-- > size) {
      const entry = stack[index]
      self.containerState = entry[1]
      assert(
        entry[0].exit,
        'expected `exit` to be defined on container construct'
      )
      entry[0].exit.call(self, effects)
    }

    stack.length = size
  }

  function closeFlow() {
    assert(
      self.containerState,
      'expected `containerState` to be defined when closing flow'
    )
    assert(childFlow, 'expected `childFlow` to be defined when closing it')
    childFlow.write([codes.eof])
    childToken = undefined
    childFlow = undefined
    self.containerState._closeFlow = undefined
  }
}

/**
 * @this {TokenizeContext}
 *   Context.
 * @type {Tokenizer}
 *   Tokenizer.
 */
function tokenizeContainer(effects, ok, nok) {
  // Always populated by defaults.
  assert(
    this.parser.constructs.disable.null,
    'expected `disable.null` to be populated'
  )
  return factorySpace(
    effects,
    effects.attempt(this.parser.constructs.document, ok, nok),
    types.linePrefix,
    this.parser.constructs.disable.null.includes('codeIndented')
      ? undefined
      : constants.tabSize
  )
}
<
x Z/** @type {InitialConstruct} */
export const flow: InitialConstruct;
import type { InitialConstruct } from 'micromark-util-types';
//# sourceMappingURL=flow.d.ts.mapVU;	x n{"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["flow.js"],"names":[],"mappings":"AAeA,+BAA+B;AAC/B,mBADW,gBAAgB,CACmB;sCAVpC,sBAAsB"}/,wxw/**
 * @import {
 *   InitialConstruct,
 *   Initializer,
 *   State,
 *   TokenizeContext
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {blankLine, content} from 'micromark-core-commonmark'
import {factorySpace} from 'micromark-factory-space'
import {markdownLineEnding} from 'micromark-util-character'
import {codes, types} from 'micromark-util-symbol'

/** @type {InitialConstruct} */
export const flow = {tokenize: initializeFlow}

/**
 * @this {TokenizeContext}
 *   Self.
 * @type {Initializer}
 *   Initializer.
 */
function initializeFlow(effects) {
  const self = this
  const initial = effects.attempt(
    // Try to parse a blank line.
    blankLine,
    atBlankEnding,
    // Try to parse initial flow (essentially, only code).
    effects.attempt(
      this.parser.constructs.flowInitial,
      afterConstruct,
      factorySpace(
        effects,
        effects.attempt(
          this.parser.constructs.flow,
          afterConstruct,
          effects.attempt(content, afterConstruct)
        ),
        types.linePrefix
      )
    )
  )

  return initial

  /** @type {State} */
  function atBlankEnding(code) {
    assert(
      code === codes.eof || markdownLineEnding(code),
      'expected eol or eof'
    )

    if (code === codes.eof) {
      effects.consume(code)
      return
    }

    effects.enter(types.lineEndingBlank)
    effects.consume(code)
    effects.exit(types.lineEndingBlank)
    self.currentConstruct = undefined
    return initial
  }

  /** @type {State} */
  function afterConstruct(code) {
    assert(
      code === codes.eof || markdownLineEnding(code),
      'expected eol or eof'
    )

    if (code === codes.eof) {
      effects.consume(code)
      return
    }

    effects.enter(types.lineEnding)
    effects.consume(code)
    effects.exit(types.lineEnding)
    self.currentConstruct = undefined
    return initial
  }
}
jOcxexport namespace resolver {
    let resolveAll: Resolver;
}
export const string: InitialConstruct;
export const text: InitialConstruct;
import type { Resolver } from 'micromark-util-types';
import type { InitialConstruct } from 'micromark-util-types';
//# sourceMappingURL=text.d.ts.map4h	x i{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["text.js"],"names":[],"mappings":";;;AAeA,sCAAiD;AACjD,oCAA6C;8BARnC,sBAAsB;sCAAtB,sBAAsB"}5.ͷxG/**
 * @import {
 *   Code,
 *   InitialConstruct,
 *   Initializer,
 *   Resolver,
 *   State,
 *   TokenizeContext
 * } from 'micromark-util-types'
 */

import {ok as assert} from 'devlop'
import {codes, constants, types} from 'micromark-util-symbol'

export const resolver = {resolveAll: createResolver()}
export const string = initializeFactory('string')
export const text = initializeFactory('text')

/**
 * @param {'string' | 'text'} field
 *   Field.
 * @returns {InitialConstruct}
 *   Construct.
 */
function initializeFactory(field) {
  return {
    resolveAll: createResolver(
      field === 'text' ? resolveAllLineSuffixes : undefined
    ),
    tokenize: initializeText
  }

  /**
   * @this {TokenizeContext}
   *   Context.
   * @type {Initializer}
   */
  function initializeText(effects) {
    const self = this
    const constructs = this.parser.constructs[field]
    const text = effects.attempt(constructs, start, notText)

    return start

    /** @type {State} */
    function start(code) {
      return atBreak(code) ? text(code) : notText(code)
    }

    /** @type {State} */
    function notText(code) {
      if (code === codes.eof) {
        effects.consume(code)
        return
      }

      effects.enter(types.data)
      effects.consume(code)
      return data
    }

    /** @type {State} */
    function data(code) {
      if (atBreak(code)) {
        effects.exit(types.data)
        return text(code)
      }

      // Data.
      effects.consume(code)
      return data
    }

    /**
     * @param {Code} code
     *   Code.
     * @returns {boolean}
     *   Whether the code is a break.
     */
    function atBreak(code) {
      if (code === codes.eof) {
        return true
      }

      const list = constructs[code]
      let index = -1

      if (list) {
        // Always populated by defaults.
        assert(Array.isArray(list), 'expected `disable.null` to be populated')

        while (++index < list.length) {
          const item = list[index]
          if (!item.previous || item.previous.call(self, self.previous)) {
            return true
          }
        }
      }

      return false
    }
  }
}

/**
 * @param {Resolver | undefined} [extraResolver]
 *   Resolver.
 * @returns {Resolver}
 *   Resolver.
 */
function createResolver(extraResolver) {
  return resolveAllText

  /** @type {Resolver} */
  function resolveAllText(events, context) {
    let index = -1
    /** @type {number | undefined} */
    let enter

    // A rather boring computation (to merge adjacent `data` events) which
    // improves mm performance by 29%.
    while (++index <= events.length) {
      if (enter === undefined) {
        if (events[index] && events[index][1].type === types.data) {
          enter = index
          index++
        }
      } else if (!events[index] || events[index][1].type !== types.data) {
        // Don’t do anything if there is one data token.
        if (index !== enter + 2) {
          events[enter][1].end = events[index - 1][1].end
          events.splice(enter + 2, index - enter - 2)
          index = enter + 2
        }

        enter = undefined
      }
    }

    return extraResolver ? extraResolver(events, context) : events
  }
}

/**
 * A rather ugly set of instructions which again looks at chunks in the input
 * stream.
 * The reason to do this here is that it is *much* faster to parse in reverse.
 * And that we can’t hook into `null` to split the line suffix before an EOF.
 * To do: figure out if we can make this into a clean utility, or even in core.
 * As it will be useful for GFMs literal autolink extension (and maybe even
 * tables?)
 *
 * @type {Resolver}
 */
function resolveAllLineSuffixes(events, context) {
  let eventIndex = 0 // Skip first.

  while (++eventIndex <= events.length) {
    if (
      (eventIndex === events.length ||
        events[eventIndex][1].type === types.lineEnding) &&
      events[eventIndex - 1][1].type === types.data
    ) {
      const data = events[eventIndex - 1][1]
      const chunks = context.sliceStream(data)
      let index = chunks.length
      let bufferIndex = -1
      let size = 0
      /** @type {boolean | undefined} */
      let tabs

      while (index--) {
        const chunk = chunks[index]

        if (typeof chunk === 'string') {
          bufferIndex = chunk.length

          while (chunk.charCodeAt(bufferIndex - 1) === codes.space) {
            size++
            bufferIndex--
          }

          if (bufferIndex) break
          bufferIndex = -1
        }
        // Number
        else if (chunk === codes.horizontalTab) {
          tabs = true
          size++
        } else if (chunk === codes.virtualSpace) {
          // Empty
        } else {
          // Replacement character, exit.
          index++
          break
        }
      }

      // Allow final trailing whitespace.
      if (context._contentTypeTextTrailing && eventIndex === events.length) {
        size = 0
      }

      if (size) {
        const token = {
          type:
            eventIndex === events.length ||
            tabs ||
            size < constants.hardBreakPrefixSizeMin
              ? types.lineSuffix
              : types.hardBreakTrailing,
          start: {
            _bufferIndex: index
              ? bufferIndex
              : data.start._bufferIndex + bufferIndex,
            _index: data.start._index + index,
            line: data.end.line,
            column: data.end.column - size,
            offset: data.end.offset - size
          },
          end: {...data.end}
        }

        data.end = {...token.start}

        if (data.start.offset === data.end.offset) {
          Object.assign(data, token)
        } else {
          events.splice(
            eventIndex,
            0,
            ['enter', token, context],
            ['exit', token, context]
          )
          eventIndex += 2
        }
      }

      eventIndex++
    }
  }

  return events
}
韼xl/**
 * @param {ParseOptions | null | undefined} [options]
 *   Configuration (optional).
 * @returns {ParseContext}
 *   Parser.
 */
export function parse(options?: ParseOptions | null | undefined): ParseContext;
import type { ParseOptions } from 'micromark-util-types';
import type { ParseContext } from 'micromark-util-types';
//# sourceMappingURL=parse.d.ts.map`x >{"version":3,"file":"parse.d.ts","sourceRoot":"","sources":["parse.js"],"names":[],"mappings":"AAkBA;;;;;GAKG;AACH,gCALW,YAAY,GAAG,IAAI,GAAG,SAAS,GAE7B,YAAY,CAoCxB;kCAlDS,sBAAsB;kCAAtB,sBAAsB"}:AXxs/**
 * @import {
 *   Create,
 *   FullNormalizedExtension,
 *   InitialConstruct,
 *   ParseContext,
 *   ParseOptions
 * } from 'micromark-util-types'
 */

import {combineExtensions} from 'micromark-util-combine-extensions'
import {content} from './initialize/content.js'
import {document} from './initialize/document.js'
import {flow} from './initialize/flow.js'
import {string, text} from './initialize/text.js'
import * as defaultConstructs from './constructs.js'
import {createTokenizer} from './create-tokenizer.js'

/**
 * @param {ParseOptions | null | undefined} [options]
 *   Configuration (optional).
 * @returns {ParseContext}
 *   Parser.
 */
export function parse(options) {
  const settings = options || {}
  const constructs = /** @type {FullNormalizedExtension} */ (
    combineExtensions([defaultConstructs, ...(settings.extensions || [])])
  )

  /** @type {ParseContext} */
  const parser = {
    constructs,
    content: create(content),
    defined: [],
    document: create(document),
    flow: create(flow),
    lazy: {},
    string: create(string),
    text: create(text)
  }

  return parser

  /**
   * @param {InitialConstruct} initial
   *   Construct to start with.
   * @returns {Create}
   *   Create a tokenizer.
   */
  function create(initial) {
    return creator
    /** @type {Create} */
    function creator(from) {
      return createTokenizer(parser, initial, from)
    }
  }
}
Jx /**
 * @param {Array<Event>} events
 *   Events.
 * @returns {Array<Event>}
 *   Events.
 */
export function postprocess(events: Array<Event>): Array<Event>;
import type { Event } from 'micromark-util-types';
//# sourceMappingURL=postprocess.d.ts.mapi@U~x 8{"version":3,"file":"postprocess.d.ts","sourceRoot":"","sources":["postprocess.js"],"names":[],"mappings":"AAMA;;;;;GAKG;AACH,oCALW,KAAK,CAAC,KAAK,CAAC,GAEV,KAAK,CAAC,KAAK,CAAC,CASxB;2BAjBuB,sBAAsB"}%/<x:/**
 * @import {Event} from 'micromark-util-types'
 */

import { subtokenize } from 'micromark-util-subtokenize';

/**
 * @param {Array<Event>} events
 *   Events.
 * @returns {Array<Event>}
 *   Events.
 */
export function postprocess(events) {
  while (!subtokenize(events)) {
    // Empty
  }
  return events;
}gvgGx, @subtokenizeM#q
  return events
}
sx//**
 * @returns {Preprocessor}
 *   Preprocess a value.
 */
export function preprocess(): Preprocessor;
/**
 * Preprocess a value.
 */
export type Preprocessor = (value: Value, encoding?: Encoding | null | undefined, end?: boolean | null | undefined) => Array<Chunk>;
import type { Value } from 'micromark-util-types';
import type { Encoding } from 'micromark-util-types';
import type { Chunk } from 'micromark-util-types';
//# sourceMappingURL=preprocess.d.ts.map>x{"version":3,"file":"preprocess.d.ts","sourceRoot":"","sources":["preprocess.js"],"names":[],"mappings":"AAqBA;;;GAGG;AACH,8BAHa,YAAY,CAsHxB;;;;mCArIU,KAAK,aAEL,QAAQ,GAAG,IAAI,GAAG,SAAS,QAE3B,OAAO,GAAG,IAAI,GAAG,SAAS,KAExB,KAAK,CAAC,KAAK,CAAC;2BAZsB,sBAAsB;8BAAtB,sBAAsB;2BAAtB,sBAAsB"}T$x&/**
 * @import {Chunk, Code, Encoding, Value} from 'micromark-util-types'
 */

/**
 * @callback Preprocessor
 *   Preprocess a value.
 * @param {Value} value
 *   Value.
 * @param {Encoding | null | undefined} [encoding]
 *   Encoding when `value` is a typed array (optional).
 * @param {boolean | null | undefined} [end=false]
 *   Whether this is the last chunk (default: `false`).
 * @returns {Array<Chunk>}
 *   Chunks.
 */

import {codes, constants} from 'micromark-util-symbol'

const search = /[\0\t\n\r]/g

/**
 * @returns {Preprocessor}
 *   Preprocess a value.
 */
export function preprocess() {
  let column = 1
  let buffer = ''
  /** @type {boolean | undefined} */
  let start = true
  /** @type {boolean | undefined} */
  let atCarriageReturn

  return preprocessor

  /** @type {Preprocessor} */
  // eslint-disable-next-line complexity
  function preprocessor(value, encoding, end) {
    /** @type {Array<Chunk>} */
    const chunks = []
    /** @type {RegExpMatchArray | null} */
    let match
    /** @type {number} */
    let next
    /** @type {number} */
    let startPosition
    /** @type {number} */
    let endPosition
    /** @type {Code} */
    let code

    value =
      buffer +
      (typeof value === 'string'
        ? value.toString()
        : new TextDecoder(encoding || undefined).decode(value))

    startPosition = 0
    buffer = ''

    if (start) {
      // To do: `markdown-rs` actually parses BOMs (byte order mark).
      if (value.charCodeAt(0) === codes.byteOrderMarker) {
        startPosition++
      }

      start = undefined
    }

    while (startPosition < value.length) {
      search.lastIndex = startPosition
      match = search.exec(value)
      endPosition =
        match && match.index !== undefined ? match.index : value.length
      code = value.charCodeAt(endPosition)

      if (!match) {
        buffer = value.slice(startPosition)
        break
      }

      if (
        code === codes.lf &&
        startPosition === endPosition &&
        atCarriageReturn
      ) {
        chunks.push(codes.carriageReturnLineFeed)
        atCarriageReturn = undefined
      } else {
        if (atCarriageReturn) {
          chunks.push(codes.carriageReturn)
          atCarriageReturn = undefined
        }

        if (startPosition < endPosition) {
          chunks.push(value.slice(startPosition, endPosition))
          column += endPosition - startPosition
        }

        switch (code) {
          case codes.nul: {
            chunks.push(codes.replacementCharacter)
            column++

            break
          }

          case codes.ht: {
            next = Math.ceil(column / constants.tabSize) * constants.tabSize
            chunks.push(codes.horizontalTab)
            while (column++ < next) chunks.push(codes.virtualSpace)

            break
          }

          case codes.lf: {
            chunks.push(codes.lineFeed)
            column = 1

            break
          }

          default: {
            atCarriageReturn = true
            column = 1
          }
        }
      }

      startPosition = endPosition + 1
    }

    if (end) {
      if (atCarriageReturn) chunks.push(codes.carriageReturn)
      if (buffer) chunks.push(buffer)
      chunks.push(codes.eof)
    }

    return chunks
  }
}
2Gx~/**
 * Create a duplex (readable and writable) stream.
 *
 * Some of the work to parse markdown can be done streaming, but in the
 * end buffering is required.
 *
 * micromark does not handle errors for you, so you must handle errors on whatever
 * streams you pipe into it.
 * As markdown does not know errors, `micromark` itself does not emit errors.
 *
 * @param {Options | null | undefined} [options]
 *   Configuration (optional).
 * @returns {MinimalDuplex}
 *   Duplex stream.
 */
export function stream(options?: Options | null | undefined): MinimalDuplex;
export type Options = import("micromark-util-types").Options;
/**
 * Function called when write was successful.
 */
export type Callback = () => undefined;
/**
 * Configuration for piping.
 */
export type PipeOptions = {
    /**
     * Whether to end the destination stream when the source stream ends.
     */
    end?: boolean | null | undefined;
};
/**
 * Duplex stream.
 */
export type MinimalDuplex = Omit<NodeJS.ReadableStream & NodeJS.WritableStream, "isPaused" | "pause" | "read" | "resume" | "setEncoding" | "unpipe" | "unshift" | "wrap">;
//# sourceMappingURL=stream.d.ts.map<xq{"version":3,"file":"stream.d.ts","sourceRoot":"","sources":["stream.js"],"names":[],"mappings":"AA6BA;;;;;;;;;;;;;;GAcG;AACH,iCALW,OAAO,GAAG,IAAI,GAAG,SAAS,GAExB,aAAa,CAoOzB;sBAxQY,OAAO,sBAAsB,EAAE,OAAO;;;;6BAMtC,SAAS;;;;;;;;UAKR,OAAO,GAAG,IAAI,GAAG,SAAS;;;;;4BAG3B,IAAI,CAAC,MAAM,CAAC,cAAc,GAAG,MAAM,CAAC,cAAc,EAAE,UAAU,GAAG,OAAO,GAAG,MAAM,GAAG,QAAQ,GAAG,aAAa,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC"}LnUx/**
 * @import {Encoding, Value} from 'micromark-util-types'
 */

/**
 * @typedef {import('micromark-util-types').Options} Options
 */

/**
 * @callback Callback
 *   Function called when write was successful.
 * @returns {undefined}
 *   Nothing.
 *
 * @typedef PipeOptions
 *   Configuration for piping.
 * @property {boolean | null | undefined} [end]
 *   Whether to end the destination stream when the source stream ends.
 *
 * @typedef {Omit<NodeJS.ReadableStream & NodeJS.WritableStream, 'isPaused' | 'pause' | 'read' | 'resume' | 'setEncoding' | 'unpipe' | 'unshift' | 'wrap'>} MinimalDuplex
 *   Duplex stream.
 */

import {EventEmitter} from 'node:events'
import {compile} from './lib/compile.js'
import {parse} from './lib/parse.js'
import {postprocess} from './lib/postprocess.js'
import {preprocess} from './lib/preprocess.js'

/**
 * Create a duplex (readable and writable) stream.
 *
 * Some of the work to parse markdown can be done streaming, but in the
 * end buffering is required.
 *
 * micromark does not handle errors for you, so you must handle errors on whatever
 * streams you pipe into it.
 * As markdown does not know errors, `micromark` itself does not emit errors.
 *
 * @param {Options | null | undefined} [options]
 *   Configuration (optional).
 * @returns {MinimalDuplex}
 *   Duplex stream.
 */
export function stream(options) {
  const prep = preprocess()
  const tokenize = parse(options).document().write
  const comp = compile(options)
  /** @type {boolean} */
  let ended

  const emitter = /** @type {MinimalDuplex} */ (new EventEmitter())
  // @ts-expect-error: fine.
  emitter.end = end
  emitter.pipe = pipe
  emitter.readable = true
  emitter.writable = true
  // @ts-expect-error: fine.
  emitter.write = write

  return emitter

  /**
   * Write a chunk into memory.
   *
   * @overload
   * @param {Value | null | undefined} [chunk]
   *   Slice of markdown to parse (`string` or `Uint8Array`).
   * @param {Encoding | null | undefined} [encoding]
   *   Character encoding to understand `chunk` as when it’s a `Uint8Array`
   *   (`string`, default: `'utf8'`).
   * @param {Callback | null | undefined} [callback]
   *   Function called when write was successful.
   * @returns {boolean}
   *   Whether write was successful.
   *
   * @overload
   * @param {Value | null | undefined} [chunk]
   *   Slice of markdown to parse (`string` or `Uint8Array`).
   * @param {Callback | null | undefined} [callback]
   *   Function called when write was successful.
   * @returns {boolean}
   *   Whether write was successful.
   *
   * @param {Value | null | undefined} [chunk]
   *   Slice of markdown to parse (`string` or `Uint8Array`).
   * @param {Callback | Encoding | null | undefined} [encoding]
   *   Character encoding to understand `chunk` as when it’s a `Uint8Array`
   *   (`string`, default: `'utf8'`).
   * @param {Callback | null | undefined} [callback]
   *   Function called when write was successful.
   * @returns {boolean}
   *   Whether write was successful.
   */
  function write(chunk, encoding, callback) {
    if (typeof encoding === 'function') {
      callback = encoding
      encoding = undefined
    }

    if (ended) {
      throw new Error('Did not expect `write` after `end`')
    }

    tokenize(prep(chunk || '', encoding))

    if (callback) {
      callback()
    }

    // Signal successful write.
    return true
  }

  /**
   * End the writing.
   *
   * Passes all arguments as a final `write`.
   *
   * @overload
   * @param {Value | null | undefined} [chunk]
   *   Slice of markdown to parse (`string` or `Uint8Array`).
   * @param {Encoding | null | undefined} [encoding]
   *   Character encoding to understand `chunk` as when it’s a `Uint8Array`
   *   (`string`, default: `'utf8'`).
   * @param {Callback | null | undefined} [callback]
   *   Function called when write was successful.
   * @returns {boolean}
   *   Whether write was successful.
   *
   * @overload
   * @param {Value | null | undefined} [chunk]
   *   Slice of markdown to parse (`string` or `Uint8Array`).
   * @param {Callback | null | undefined} [callback]
   *   Function called when write was successful.
   * @returns {boolean}
   *   Whether write was successful.
   *
   * @overload
   * @param {Callback | null | undefined} [callback]
   *   Function called when write was successful.
   * @returns {boolean}
   *   Whether write was successful.
   *
   * @param {Callback | Value | null | undefined} [chunk]
   *   Slice of markdown to parse (`string` or `Uint8Array`).
   * @param {Callback | Encoding | null | undefined} [encoding]
   *   Character encoding to understand `chunk` as when it’s a `Uint8Array`
   *   (`string`, default: `'utf8'`).
   * @param {Callback | null | undefined} [callback]
   *   Function called when write was successful.
   * @returns {boolean}
   *   Whether write was successful.
   */
  function end(chunk, encoding, callback) {
    if (typeof chunk === 'function') {
      encoding = chunk
      chunk = undefined
    }

    if (typeof encoding === 'function') {
      callback = encoding
      encoding = undefined
    }

    write(chunk, encoding, callback)

    emitter.emit('data', comp(postprocess(tokenize(prep('', encoding, true)))))

    emitter.emit('end')
    ended = true
    return true
  }

  /**
   * Pipe the processor into a writable stream.
   *
   * Basically `Stream#pipe`, but inlined and simplified to keep the bundled
   * size down.
   * See: <https://github.com/nodejs/node/blob/43a5170/lib/internal/streams/legacy.js#L13>.
   *
   * @template {NodeJS.WritableStream} Stream
   *   Writable stream.
   * @param {Stream} destination
   *   Stream to pipe into.
   * @param {PipeOptions | null | undefined} [options]
   *   Configuration.
   * @returns {Stream}
   *   Destination stream.
   */
  function pipe(destination, options) {
    emitter.on('data', ondata)
    emitter.on('error', onerror)
    emitter.on('end', cleanup)
    emitter.on('close', cleanup)

    // If the `end` option is not supplied, `destination.end()` will be
    // called when the `end` or `close` events are received.
    // @ts-expect-error `_isStdio` is available on `std{err,out}`
    if (!destination._isStdio && (!options || options.end !== false)) {
      emitter.on('end', onend)
    }

    destination.on('error', onerror)
    destination.on('close', cleanup)

    destination.emit('pipe', emitter)

    return destination

    /**
     * End destination stream.
     *
     * @returns {undefined}
     *   Nothing.
     */
    function onend() {
      if (destination.end) {
        destination.end()
      }
    }

    /**
     * Handle data.
     *
     * @param {string} chunk
     *   Data.
     * @returns {undefined}
     *   Nothing.
     */
    function ondata(chunk) {
      if (destination.writable) {
        destination.write(chunk)
      }
    }

    /**
     * Clean listeners.
     *
     * @returns {undefined}
     *   Nothing.
     */
    function cleanup() {
      emitter.removeListener('data', ondata)
      emitter.removeListener('end', onend)
      emitter.removeListener('error', onerror)
      emitter.removeListener('end', cleanup)
      emitter.removeListener('close', cleanup)

      destination.removeListener('error', onerror)
      destination.removeListener('close', cleanup)
    }

    /**
     * Close dangling pipes and handle unheard errors.
     *
     * @param {Error | null | undefined} [error]
     *   Error, if any.
     * @returns {undefined}
     *   Nothing.
     */
    function onerror(error) {
      cleanup()

      if (!emitter.listenerCount('error')) {
        throw error // Unhandled stream error in pipe.
      }
    }
  }
}
Rеvxe/**
 * @import {Encoding, Value} from 'micromark-util-types'
 */

/**
 * @typedef {import('micromark-util-types').Options} Options
 */

import { compile } from './lib/compile.js';
import { parse } from './lib/parse.js';
import { postprocess } from './lib/postprocess.js';
import { preprocess } from './lib/preprocess.js';
export { compile } from './lib/compile.js';
export { parse } from './lib/parse.js';
export { postprocess } from './lib/postprocess.js';
export { preprocess } from './lib/preprocess.js';

/**
 * Compile markdown to HTML.
 *
 * > Note: which encodings are supported depends on the engine.
 * > For info on Node.js, see:
 * > <https://nodejs.org/api/util.html#whatwg-supported-encodings>.
 *
 * @overload
 * @param {Value} value
 *   Markdown to parse (`string` or `Uint8Array`).
 * @param {Encoding | null | undefined} encoding
 *   Character encoding to understand `value` as when it’s a `Uint8Array`
 *   (`string`, default: `'utf8'`).
 * @param {Options | null | undefined} [options]
 *   Configuration.
 * @returns {string}
 *   Compiled HTML.
 *
 * @overload
 * @param {Value} value
 *   Markdown to parse (`string` or `Uint8Array`).
 * @param {Options | null | undefined} [options]
 *   Configuration.
 * @returns {string}
 *   Compiled HTML.
 *
 * @param {Value} value
 *   Markdown to parse (`string` or `Uint8Array`).
 * @param {Encoding | Options | null | undefined} [encoding]
 *   Character encoding to understand `value` as when it’s a `Uint8Array`
 *   (`string`, default: `'utf8'`).
 * @param {Options | null | undefined} [options]
 *   Configuration.
 * @returns {string}
 *   Compiled HTML.
 */
export function micromark(value, encoding, options) {
  if (typeof encoding !== 'string') {
    options = encoding;
    encoding = undefined;
  }
  return compile(options)(postprocess(parse(options).document().write(preprocess()(value, encoding, true))));
}MA3x4100644 compile.d.ts SH+45100644 compile.d.ts.map tBNP0}sG&<100644 compile.js =	GUbn |)9100644 constructs.d.ts <~dM	41m100644 constructs.d.ts.map X/(_5rtU100644 constructs.js [tgΨAJS};100644 create-tokenizer.d.ts ؓ4)EKTiu100644 create-tokenizer.d.ts.map W۩<&_fmh100644 create-tokenizer.js P]Z:-B{640000 initialize v!BBl|.s$8>100644 parse.d.ts _rYd7nc100644 parse.d.ts.map i0>Ts1j100644 parse.js F1jEwTۥU;100644 postprocess.d.ts }`΁{ȷD|Oc100644 postprocess.d.ts.map )\W{se100644 postprocess.js ͳ+^M*\3es~@100644 preprocess.d.ts 0ۧͼ+?c)\j100644 preprocess.d.ts.map VXW${p!100644 preprocess.js ,Br(Rv|OPKTOxc  );
import { push_?;
import { P_|;
import { _#;
import { encode as _encode_encode';
import { O_\;
import { sanitizeUri_;);N;_#;;	5;R
;A;D;;';R7;8;;; K; ;
    let start = 0;":;Q"F;#2;#q!lineEndingStyle &&_$"lineEnding" || a$"lineEndingBlank")$7
$"%#;O%Y&"listOrdered" || a$"listUnordered"&O;
a/&1;&`"definition"&:b'-;';
a/'1;' + 1;('@(;
'());
    index = -1;(;(};**)b;));)#;)O{
          4*04
          ...context
        }, result[index][1]);
0*s';
    }
    return buffers[0].join('');C+;
    let index = 0;,+;
    let loose = false;_,8;,@;,>;
. 9- ;
a/G---;
        }
      } else-" case "listItemPrefix":
         .".%;
/7break;
          }
        case "linePrefix":
         z.+7;
          }
        case "lineEndingBlank":
         .;Z/4;//-break;
          }
        default:
         /#;
  ( 0;H2	f0;H2	81?;1#17;1c;n2;1#27;2 ;3,;1$P3:;3,;3;1#f4i;4,;4Cnnull;
    if (previous === 10 || previous === 13 || previous === null) {
      return;
    }
    lineEnding();1#5c;_6n;HV#75;>;
    tag('<ol');7%;HV77;>;
    tag('<ul');7%;HV8__, 10);9O	;
      }bD!:G;q@|:;
    }>;
    tag('<li>');7);:k;b:;';A<%;
    lineEnding();
    tag('</ol>');b:;<";A<%;
    lineEnding();
    tag('</ul>');b:;<g;
    }
    tag('</li>');>#;HT=);>;=;HPY>&;>;
    tag('</blockquote>');>#;HT(?V;
      tag('<p>');
    }>#;HP	@h;q@;bS>K@';A;-G, 0);HP=`A-;A+;HP=`MB<;B!;B*;
    }-G, count + 1);1XVXC';A>');HPC8;DFF  &&EE=();E!;
    }
    tag('</code></pre>');F?;G ;-G;>B);HTG0
      image: true
    });
    tags = undefined;G;HP;H\;HP;I?;HPJj;HTJ;Jq;HTK*;K;HPL];
`b);HPLM;;HP'N2;YN5;N2;POjO O' : media;
    tags = true;OT;
        break;
      }
    }nR#/<img src="' + sanitizeUri(context.destination, ?bQQ) + '" alt="');0Q;
      tag('"');q@kcontext.destination, ?bQ#) + '"');
    }.R?;nR(;q@>');0Q0;
      tag('</a>');
    }
    mediaStack.pop();HTKS;mH;HPoUSW;I,^T;HTKS
K;
`b!;HPoU_;
`b);HPoULM;;HPoUV8;iW2;
    resume();Wk;
    }
    mediaStack.pop();1X;HPk[Y[;qY>;>;Y-;HTIZ;>#;HP\Z1;HPk[?;];HP\1\~Y*~\61 ? 1 : 2);HP\/;>;Y-;
    raw(value);].;>#;];HP<^<;HP;^H;
    }^[GB_';
      return;
    }}_0;
      return;
    }_,;HP=`E;G, true);HP`";b>Xa%;
    onenterhtml();b:a';b>.bS;b`;b\;b>{c,;
    tag('<code>');b:=`c";
    tag('</code>');b:id ;b:d";b:e-;
    tag('<hr />');H.e;HPef6;f6g#value,>g& "\" ? 10 : 16)h';'hdecoded));
    s@g ;HPj}i4;k#uri, ?bQ#1) + '">');
    raw(encode(uri));
    tag('</a>');HPjD;k;.;
    raw(encode(uri));
    tag('</a>');
  }
}>zxS/**
 * @import {Extension} from 'micromark-util-types'
 */

import { attention, autolink, blockQuote, characterEscape, characterReference, codeFenced, codeIndented, codeText, definition, hardBreakEscape, headingAtx, htmlFlow, htmlText, labelEnd, labelStartImage, labelStartLink, lineEnding, list, setextUnderline, thematicBreak } from 'micromark-core-commonmark';
import { resolver as resolveText } from './initialize/text.js';

/** @satisfies {Extension['document']} */
export const document = {
  [42]: list,
  [43]: list,
  [45]: list,
  [48]: list,
  [49]: list,
  [50]: list,
  [51]: list,
  [52]: list,
  [53]: list,
  [54]: list,
  [55]: list,
  [56]: list,
  [57]: list,
  [62]: blockQuote
};

/** @satisfies {Extension['contentInitial']} */
export const contentInitial = {
  [91]: definition
};

/** @satisfies {Extension['flowInitial']} */
export const flowInitial = {
  [-2]: codeIndented,
  [-1]: codeIndented,
  [32]: codeIndented
};

/** @satisfies {Extension['flow']} */
export const flow = {
  [35]: headingAtx,
  [42]: thematicBreak,
  [45]: [setextUnderline, thematicBreak],
  [60]: htmlFlow,
  [61]: setextUnderline,
  [95]: thematicBreak,
  [96]: codeFenced,
  [126]: codeFenced
};

/** @satisfies {Extension['string']} */
export const string = {
  [38]: characterReference,
  [92]: characterEscape
};

/** @satisfies {Extension['text']} */
export const text = {
  [-5]: lineEnding,
  [-4]: lineEnding,
  [-3]: lineEnding,
  [33]: labelStartImage,
  [38]: characterReference,
  [42]: attention,
  [60]: [autolink, htmlText],
  [91]: labelStartLink,
  [92]: [hardBreakEscape, characterEscape],
  [93]: labelEnd,
  [95]: attention,
  [96]: codeText
};

/** @satisfies {Extension['insideSpan']} */
export const insideSpan = {
  null: [attention, resolveText]
};

/** @satisfies {Extension['attentionMarkers']} */
export const attentionMarkers = {
  null: [42, 95]
};

/** @satisfies {Extension['disable']} */
export const disable = {
  null: []
};Qw+cx	Ëvl{ markdownLineEnding
;
import { push, splice;
import { resolveAllresolve-all';Igfrom && from.line || 1,
    column: from && from.column || 1,
    offset: from && from.offset || 0
  };`A;D;;);zA,p;"
      interrupt: true
    })
  };	null7
]null
4;
;T{;I;
  }
  return context; OF;
    main();enull) {
      return [];
    });Fu;;;{;$.~
      _bufferIndex,
      _index,
      line,
      column,
      offset
    } = point;
    return {
      _bufferIndex,
     6 _index,
      line,
      column,
      offset
    };$;Z;
Y;;T;;G;
        }
        while (
2"]6;+;3consumed = undefined;;O;-2;>:1;k:de === -3 ? 2 : 1;8 ;
    } else if (code !== -1;
      point.offset++;\;Z(;-
9&"
      chunks[point._index].length`#;
        point._index++;Q;.;1;
    token.type = type;
    token.start = now();[ ;;
    return token;#&;
    token.end = now();[ 2;
    return token; ;9!;!;";
  $;
      A&%;3%);]%'% %"% ?
     &"%[(A&constructs)]) :Q'&;`)K&;

  1!'J;'0;"($z,
R($x(!(5(1];)4;N);
        constructIndex = 0;*,return bogusState;
        }
+5;?+;

  1!'#z,;-';-U;.9 
          if (construct.name &&/@Z/ ;
          }/5/H0"0Pt0A effects, ok, nok)(code);N)1!:1V2;1);1;1HV2;
        info.restore();}2}&;
        }
        return bogusState;3D;
    }/54context.events, from,P7 - from,47);
    }/5c;?9b6k;6+;6;;373;f7);
    return {
      7
      restore
    };7;
  startPrevious;
-!8;
48;
      stack = startStack;8 ;?9,;k:2;:@;;4;<$;5<0;z<;<&?A=C;=9;><;G>U;
p(>:view.shift();
      }
    }\?;
    }
  }
  return view;@6;[A;zA1;AD;A(;B96;
    } else switch (chunk) {
      case -5:
        {aD9"\r";
          break;
        }
      case -4:
        {aD9"\n";
          break;
        }
      case -3:
        {aD@"\r" + "\n";
          break;
        }
      case -2:
        {aDC=" " : "\t";
          break;
        }
      case -1:
       2D/;aD8" ";
          break;
        }
      default:
        {D`;
        }
    }aE;-2;
    result.push(value);
  }
  return result.join('');
}ĵxd fQXEPc)>_^e6ziuthc0ooFc],Gݶ_	6њh]8<!\hhMA킸o+d#Fx> factorySpace  ;
import { markdownLineEnding Acharacter';`9
  
};_&, paragraphInitial);&;
  return contentStart;$'if (code === null7;
      return;
    }
    effects.enter("lineEnding");
!;
    effects.exit("lineEnding");U0"linePrefix");(effects.enter("paragraph");|;(2"chunkText""text"0;H0;
    };
    return data(code);Fnull) {!"chunkText");!"paragraph");;
      return;
    }
    if (;!%"chunkText");
      return lineStart;.;
    return data;
  }
}@Ifexi_T1 factorySpace a ;
import { markdownLineEnding !;
import { splice ;*:"
  tokenize: initializeDocument
};7!
  tokenize: tokenizeContainer
};-&m;g5;
  let continued = 0;=;4;!.;
  return start;$v;+item[1];- documentContinue, checkNewContainers)(code);8;OEcontinued++;	;P3
;%k
\;P&-;<7;sN''*"chunkFlow") {
'5$;
          break;
        }
      }q
;<;)Q/
          ...point
        };
        index++;x)\self.events,) 0,*$);pH;
  ,#;
    }
    return start(code);O(%S;x";R7();CN;containerConstruct,0, thereIsNoNewContainer)(code);O(1;;
;#;O(`;5(;
;O8A;8containerConstruct, containerContinue, flowStart)(code);O(continued++;=;7;O(!#nullM$;q;N;
      return;
    }:;
    effects.enter("chunkFlow"4"flow"b#;;O(&null$"chunkFlow"), true);q;N;
      return;
    }~@;!"chunkFlow"));:;%undefined;
      return start;
    }
Q;;	&;%;7 ;W,;
    childToken = token;&;A-stream);;#.#6#< (
4$5!$$$ #$%;%;P&-;}&8;<7;&q''*"chunkFlow"'Q ;
            break;
          }Q(;
        }
      }q
; (;)Q/
          ...point
        };
        index++;x)\self.events,) 0,*$);pH;*;4+\;+%;!,(;
    }P,;
  }m,F-#null]);
    childToken = undefined;}-;
	.;-
  return factorySpace(effects,/; "linePrefix",W/= ? undefined : 4);
}'9xt blankLine, content ";
import { factorySpace  ;
import { markdownLineEnding 1!;6
  
};;d& blankLine, atBlankEnding,
;effects.attempt("# afterConstruct, factorySpace(effects, effects.attempt(this.parser.constructs.flow, afterConstruct, effects.attempt(content, af%), "linePrefix")));
  return initial;%zif (code === null;
      return;
    }A"lineEndingBlank");j&;
    effects.exit("lineEndingBlank");&;
    return initial;Cif (code === null;
      return;
    }A"lineEnding");j!;
    effects.exit("lineEnding");&;
    return initial;
  }
}Bkx-.+
.)
};42;f.;R5#;;=5;r=;
    return start;m;.\#nulla;
        return;
      }"data");;
      return data;k#"data");
        return text(code);4;
      return data;null	;
      }$;
      let index = -1;<K;c;
          }
        }
      }Q;d; 	[;{	4;	"data"
;
          index++;
H"data"+;Q;4;
        }
        enter = undefined;
      }
    }LC;;C( "lineEnding") &&I$"data"|0;/; ;;
      let size = 0;)8;b<;N;8321;
  --;
          }n!;;8.-2) {
          tabs = true;
          size++;-1Oc;
          break;>	;
      }g: 6 tabs || size < 2 ? "lineSuffix" : "hardBreakTrailing"^4 ? bufferIndex/
            ...data.end
          }
        };$
          ...token.start
        };Z;@*eventIndex, 0,y ['exit', token, context]);
          eventIndex += 2;
        }
      }
      eventIndex++;
    }
  }
  return events;
}.Yxd/**
 * @import {
 *   Create,
 *   FullNormalizedExtension,
 *   InitialConstruct,
 *   ParseContext,
 *   ParseOptions
 * } from 'micromark-util-types'
 */

import { combineExtensions } from 'micromark-util-combine-extensions';
import { content } from './initialize/content.js';
import { document } from './initialize/document.js';
import { flow } from './initialize/flow.js';
import { string, text } from './initialize/text.js';
import * as defaultConstructs from './constructs.js';
import { createTokenizer } from './create-tokenizer.js';

/**
 * @param {ParseOptions | null | undefined} [options]
 *   Configuration (optional).
 * @returns {ParseContext}
 *   Parser.
 */
export function parse(options) {
  const settings = options || {};
  const constructs = /** @type {FullNormalizedExtension} */
  combineExtensions([defaultConstructs, ...(settings.extensions || [])]);

  /** @type {ParseContext} */
  const parser = {
    constructs,
    content: create(content),
    defined: [],
    document: create(document),
    flow: create(flow),
    lazy: {},
    string: create(string),
    text: create(text)
  };
  return parser;

  /**
   * @param {InitialConstruct} initial
   *   Construct to start with.
   * @returns {Create}
   *   Create a tokenizer.
   */
  function create(initial) {
    return creator;
    /** @type {Create} */
    function creator(from) {
      return createTokenizer(parser, initial, from);
    }
  }
}7Nܺ;6xLconst search = /[\0\t\n\r]/g;m;
  let buffer = '';8;,;
  return preprocessor;;9;#next;0;I.;w%;
    value = buffer +8);
    startPosition = 0;
    buffer = '';\z65279	;
      };
    }.R;!;@;+;)@1;
        break;
      }
      if (code === 10 &&! atCarriageReturn-3);?;KF-5);';
        }j;B	0;
        }}	(0:
            {
  /65533);
              column++;
              break;
            }
          case 9:
            {
              next = Math.ceP

4) * 4;
  /-2);
  
0K-1);
              break;
            }
          case 10:
            {
  /-4);
              column = 1;
              break;
            }
          default:
            {
              atCarriageRetu"true;
              column = 1;
  ;
    })8-5);v&9;
      chunks.push(null);
    }
    return chunks;
  }
}x	={
  "name": "micromark",
  "version": "4.0.2",
  "description": "small commonmark compliant markdown parser with positional info and concrete tokens",
  "license": "MIT",
  "keywords": [
    "commonmark",
    "compiler",
    "gfm",
    "html",
    "lexer",
    "markdown",
    "markup",
    "md",
    "unified",
    "parse",
    "parser",
    "plugin",
    "process",
    "remark",
    "render",
    "renderer",
    "token",
    "tokenizer"
  ],
  "repository": "https://github.com/micromark/micromark/tree/main/packages/micromark",
  "bugs": "https://github.com/micromark/micromark/issues",
  "funding": [
    {
      "type": "GitHub Sponsors",
      "url": "https://github.com/sponsors/unifiedjs"
    },
    {
      "type": "OpenCollective",
      "url": "https://opencollective.com/unified"
    }
  ],
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "sideEffects": false,
  "type": "module",
  "files": [
    "dev/",
    "lib/",
    "index.d.ts.map",
    "index.d.ts",
    "index.js",
    "stream.d.ts.map",
    "stream.d.ts",
    "stream.js"
  ],
  "exports": {
    ".": {
      "development": "./dev/index.js",
      "default": "./index.js"
    },
    "./stream": {
      "development": "./dev/stream.js",
      "default": "./stream.js"
    }
  },
  "dependencies": {
    "@types/debug": "^4.0.0",
    "debug": "^4.0.0",
    "decode-named-character-reference": "^1.0.0",
    "devlop": "^1.0.0",
    "micromark-core-commonmark": "^2.0.0",
    "micromark-factory-space": "^2.0.0",
    "micromark-util-character": "^2.0.0",
    "micromark-util-chunked": "^2.0.0",
    "micromark-util-combine-extensions": "^2.0.0",
    "micromark-util-decode-numeric-character-reference": "^2.0.0",
    "micromark-util-encode": "^2.0.0",
    "micromark-util-normalize-identifier": "^2.0.0",
    "micromark-util-resolve-all": "^2.0.0",
    "micromark-util-sanitize-uri": "^2.0.0",
    "micromark-util-subtokenize": "^2.0.0",
    "micromark-util-symbol": "^2.0.0",
    "micromark-util-types": "^2.0.0"
  },
  "scripts": {
    "build": "micromark-build"
  },
  "xo": {
    "envs": [
      "shared-node-browser"
    ],
    "prettier": true,
    "rules": {
      "logical-assignment-operators": "off",
      "max-depth": "off",
      "unicorn/no-this-assignment": "off",
      "unicorn/prefer-at": "off",
      "unicorn/prefer-code-point": "off",
      "unicorn/prefer-event-target": "off"
    }
  }
}
/vw(<xz<<x_ EventEmitter } from 'node:events';
import { compile } from './lib/compile.js';
import { parse ;
import { postprocess ;
import { preprocess *;F';m3; ;%;/new EventEmitter();*1;
  emitter.pipe = pipe;q;;*(;
  return emitter;\;;
    }jM;
    }*;%;7;ED ;
      chunk = undefined;
    }D;;
    }%;4P=;
    emitter.emit('end');
    ended = true;
    return true;M;!;
	cleanup);K!;l/;
    }%;%;&;
    return destination;+;;; nd', onend);/; ;*;n#;n3;;A;7H}	x m100644 LICENSE.md nalY_,RM((100644 README.md *F+UɮɃz40000 dist ~\,!N100644 package.json u䄗&ЊbpTX@X[7`x# Blue Oak Model License

Version 1.0.0

## Purpose

This license gives everyone as much permission to work with
this software as possible, while protecting contributors
from liability.

## Acceptance

In order to receive this license, you must agree to its
rules. The rules of this license are both obligations
under that agreement and conditions to your license.
You must not do anything with this software that triggers
a rule that you cannot or will not follow.

## Copyright

Each contributor licenses you to do everything with this
software that would otherwise infringe that contributor's
copyright in it.

## Notices

You must ensure that everyone who gets a copy of
any part of this software from you, with or without
changes, also gets the text of this license or a link to
<https://blueoakcouncil.org/license/1.0.0>.

## Excuse

If anyone notifies you in writing that you have not
complied with [Notices](#notices), you can keep your
license by taking all practical steps to comply within 30
days after the notice. If you do not do so, your license
ends immediately.

## Patent

Each contributor licenses you to do everything with this
software that would otherwise infringe any patent claims
they can license or become able to license.

## Reliability

No contributor can revoke this license.

## No Liability

**_As far as the law allows, this software comes as is,
without any warranty or condition, and no contributor
will be liable to anyone for any damages related to this
software or this license, under any kind of legal claim._**
g&	xMf# minimatch

A minimal matching utility.

This is the matching library used internally by npm.

It works by converting glob expressions into JavaScript `RegExp`
objects.

## Important Security Consideration!

> [!WARNING]  
> This library uses JavaScript regular expressions. Please read
> the following warning carefully, and be thoughtful about what
> you provide to this library in production systems.

_Any_ library in JavaScript that deals with matching string
patterns using regular expressions will be subject to
[ReDoS](https://owasp.org/www-community/attacks/Regular_expression_Denial_of_Service_-_ReDoS)
if the pattern is generated using untrusted input.

Efforts have been made to mitigate risk as much as is feasible in
such a library, providing maximum recursion depths and so forth,
but these measures can only ultimately protect against accidents,
not malice. A dedicated attacker can _always_ find patterns that
cannot be defended against by a bash-compatible glob pattern
matching system that uses JavaScript regular expressions.

To be extremely clear:

> [!WARNING]  
> **If you create a system where you take user input, and use
> that input as the source of a Regular Expression pattern, in
> this or any extant glob matcher in JavaScript, you will be
> pwned.**

A future version of this library _may_ use a different matching
algorithm which does not exhibit backtracking problems. If and
when that happens, it will likely be a sweeping change, and those
improvements will **not** be backported to legacy versions.

In the near term, it is not reasonable to continue to play
whack-a-mole with security advisories, and so any future ReDoS
reports will be considered "working as intended", and resolved
entirely by this warning.

## Usage

```js
// hybrid module, load with require() or import
import { minimatch } from 'minimatch'
// or:
const { minimatch } = require('minimatch')

minimatch('bar.foo', '*.foo') // true!
minimatch('bar.foo', '*.bar') // false!
minimatch('bar.foo', '*.+(bar|foo)', { debug: true }) // true, and noisy!
```

## Features

Supports these glob features:

- Brace Expansion
- Extended glob matching
- "Globstar" `**` matching
- [Posix character
  classes](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html),
  like `[[:alpha:]]`, supporting the full range of Unicode
  characters. For example, `[[:alpha:]]` will match against
  `'é'`, though `[a-zA-Z]` will not. Collating symbol and set
  matching is not supported, so `[[=e=]]` will _not_ match `'é'`
  and `[[.ch.]]` will not match `'ch'` in locales where `ch` is
  considered a single character.

See:

- `man sh`
- `man bash` [Pattern
  Matching](https://www.gnu.org/software/bash/manual/html_node/Pattern-Matching.html)
- `man 3 fnmatch`
- `man 5 gitignore`

## Windows

**Please only use forward-slashes in glob expressions.**

Though windows uses either `/` or `\` as its path separator, only `/`
characters are used by this glob implementation. You must use
forward-slashes **only** in glob expressions. Back-slashes in patterns
will always be interpreted as escape characters, not path separators.

Note that `\` or `/` _will_ be interpreted as path separators in paths on
Windows, and will match against `/` in glob expressions.

So just always use `/` in patterns.

### UNC Paths

On Windows, UNC paths like `//?/c:/...` or
`//ComputerName/Share/...` are handled specially.

- Patterns starting with a double-slash followed by some
  non-slash characters will preserve their double-slash. As a
  result, a pattern like `//*` will match `//x`, but not `/x`.
- Patterns staring with `//?/<drive letter>:` will _not_ treat
  the `?` as a wildcard character. Instead, it will be treated
  as a normal string.
- Patterns starting with `//?/<drive letter>:/...` will match
  file paths starting with `<drive letter>:/...`, and vice versa,
  as if the `//?/` was not present. This behavior only is
  present when the drive letters are a case-insensitive match to
  one another. The remaining portions of the path/pattern are
  compared case sensitively, unless `nocase:true` is set.

Note that specifying a UNC path using `\` characters as path
separators is always allowed in the file path argument, but only
allowed in the pattern argument when `windowsPathsNoEscape: true`
is set in the options.

## Minimatch Class

Create a minimatch object by instantiating the `minimatch.Minimatch` class.

```javascript
var Minimatch = require('minimatch').Minimatch
var mm = new Minimatch(pattern, options)
```

### Properties

- `pattern` The original pattern the minimatch object represents.
- `options` The options supplied to the constructor.
- `set` A 2-dimensional array of regexp or string expressions.
  Each row in the
  array corresponds to a brace-expanded pattern. Each item in the row
  corresponds to a single path-part. For example, the pattern
  `{a,b/c}/d` would expand to a set of patterns like:

        [ [ a, d ]
        , [ b, c, d ] ]

  If a portion of the pattern doesn't have any "magic" in it
  (that is, it's something like `"foo"` rather than `fo*o?`), then it
  will be left as a string rather than converted to a regular
  expression.

- `regexp` Created by the `makeRe` method. A single regular expression
  expressing the entire pattern. This is useful in cases where you wish
  to use the pattern somewhat like `fnmatch(3)` with `FNM_PATH` enabled.
- `negate` True if the pattern is negated.
- `comment` True if the pattern is a comment.
- `empty` True if the pattern is `""`.

### Methods

- `makeRe()` Generate the `regexp` member if necessary, and return it.
  Will return `false` if the pattern is invalid.
- `match(fname)` Return true if the filename matches the pattern, or
  false otherwise.
- `matchOne(fileArray, patternArray, partial)` Take a `/`-split
  filename, and match it against a single row in the `regExpSet`. This
  method is mainly for internal use, but is exposed so that it can be
  used by a glob-walker that needs to avoid excessive filesystem calls.
- `hasMagic()` Returns true if the parsed pattern contains any
  magic characters. Returns false if all comparator parts are
  string literals. If the `magicalBraces` option is set on the
  constructor, then it will consider brace expansions which are
  not otherwise magical to be magic. If not set, then a pattern
  like `a{b,c}d` will return `false`, because neither `abd` nor
  `acd` contain any special glob characters.

  This does **not** mean that the pattern string can be used as a
  literal filename, as it may contain magic glob characters that
  are escaped. For example, the pattern `\\*` or `[*]` would not
  be considered to have magic, as the matching portion parses to
  the literal string `'*'` and would match a path named `'*'`,
  not `'\\*'` or `'[*]'`. The `minimatch.unescape()` method may
  be used to remove escape characters.

All other methods are internal, and will be called as necessary.

### minimatch(path, pattern, options)

Main export. Tests a path against the pattern using the options.

```javascript
var isJS = minimatch(file, '*.js', { matchBase: true })
```

### minimatch.filter(pattern, options)

Returns a function that tests its
supplied argument, suitable for use with `Array.filter`. Example:

```javascript
var javascripts = fileList.filter(
  minimatch.filter('*.js', { matchBase: true }),
)
```

### minimatch.escape(pattern, options = {})

Escape all magic characters in a glob pattern, so that it will
only ever match literal strings.

If the `windowsPathsNoEscape` option is used, then characters are
escaped by wrapping in `[]`, because a magic character wrapped in
a character class can only be satisfied by that exact character.

Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot
be escaped or unescaped.

### minimatch.unescape(pattern, options = {})

Un-escape a glob string that may contain some escaped characters.

If the `windowsPathsNoEscape` option is used, then square-brace
escapes are removed, but not backslash escapes. For example, it
will turn the string `'[*]'` into `*`, but it will not turn
`'\\*'` into `'*'`, because `\` is a path separator in
`windowsPathsNoEscape` mode.

When `windowsPathsNoEscape` is not set, then both brace escapes
and backslash escapes are removed.

Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot
be escaped or unescaped.

### minimatch.match(list, pattern, options)

Match against the list of
files, in the style of fnmatch or glob. If nothing is matched, and
options.nonull is set, then return a list containing the pattern itself.

```javascript
var javascripts = minimatch.match(fileList, '*.js', { matchBase: true })
```

### minimatch.makeRe(pattern, options)

Make a regular expression object from the pattern.

## Options

All options are `false` by default.

### debug

Dump a ton of stuff to stderr.

### nobrace

Do not expand `{a,b}` and `{1..3}` brace sets.

### noglobstar

Disable `**` matching against multiple folder names.

### dot

Allow patterns to match filenames starting with a period, even if
the pattern does not explicitly have a period in that spot.

Note that by default, `a/**/b` will **not** match `a/.d/b`, unless `dot`
is set.

### noext

Disable "extglob" style patterns like `+(a|b)`.

### nocase

Perform a case-insensitive match.

### nocaseMagicOnly

When used with `{nocase: true}`, create regular expressions that
are case-insensitive, but leave string match portions untouched.
Has no effect when used without `{nocase: true}`.

Useful when some other form of case-insensitive matching is used,
or if the original string representation is useful in some other
way.

### nonull

When a match is not found by `minimatch.match`, return a list containing
the pattern itself if this option is set. When not set, an empty list
is returned if there are no matches.

### magicalBraces

This only affects the results of the `Minimatch.hasMagic` method.

If the pattern contains brace expansions, such as `a{b,c}d`, but
no other magic characters, then the `Minimatch.hasMagic()` method
will return `false` by default. When this option set, it will
return `true` for brace expansion as well as other magic glob
characters.

### matchBase

If set, then patterns without slashes will be matched
against the basename of the path if it contains slashes. For example,
`a?b` would match the path `/xyz/123/acb`, but not `/xyz/acb/123`.

### nocomment

Suppress the behavior of treating `#` at the start of a pattern as a
comment.

### nonegate

Suppress the behavior of treating a leading `!` character as negation.

### flipNegate

Returns from negate expressions the same as if they were not negated.
(Ie, true on a hit, false on a miss.)

### partial

Compare a partial path to a pattern. As long as the parts of the path that
are present are not contradicted by the pattern, it will be treated as a
match. This is useful in applications where you're walking through a
folder structure, and don't yet have the full path, but want to ensure that
you do not walk down paths that can never be a match.

For example,

```js
minimatch('/a/b', '/a/*/c/d', { partial: true }) // true, might be /a/b/c/d
minimatch('/a/b', '/**/d', { partial: true }) // true, might be /a/b/.../d
minimatch('/x/y/z', '/a/**/z', { partial: true }) // false, because x !== a
```

### windowsPathsNoEscape

Use `\\` as a path separator _only_, and _never_ as an escape
character. If set, all `\\` characters are replaced with `/` in
the pattern. Note that this makes it **impossible** to match
against paths containing literal glob pattern characters, but
allows matching with patterns constructed using `path.join()` and
`path.resolve()` on Windows platforms, mimicking the (buggy!)
behavior of earlier versions on Windows. Please use with
caution, and be mindful of [the caveat about Windows
paths](#windows).

For legacy reasons, this is also set if
`options.allowWindowsEscape` is set to the exact value `false`.

### windowsNoMagicRoot

When a pattern starts with a UNC path or drive letter, and in
`nocase:true` mode, do not convert the root portions of the
pattern into a case-insensitive regular expression, and instead
leave them as strings.

This is the default when the platform is `win32` and
`nocase:true` is set.

### preserveMultipleSlashes

By default, multiple `/` characters (other than the leading `//`
in a UNC path, see "UNC Paths" above) are treated as a single
`/`.

That is, a pattern like `a///b` will match the file path `a/b`.

Set `preserveMultipleSlashes: true` to suppress this behavior.

### optimizationLevel

A number indicating the level of optimization that should be done
to the pattern prior to parsing and using it for matches.

Globstar parts `**` are always converted to `*` when `noglobstar`
is set, and multiple adjacent `**` parts are converted into a
single `**` (ie, `a/**/**/b` will be treated as `a/**/b`, as this
is equivalent in all cases).

- `0` - Make no further changes. In this mode, `.` and `..` are
  maintained in the pattern, meaning that they must also appear
  in the same position in the test path string. Eg, a pattern
  like `a/*/../c` will match the string `a/b/../c` but not the
  string `a/c`.
- `1` - (default) Remove cases where a double-dot `..` follows a
  pattern portion that is not `**`, `.`, `..`, or empty `''`. For
  example, the pattern `./a/b/../*` is converted to `./a/*`, and
  so it will match the path string `./a/c`, but not the path
  string `./a/b/../c`. Dots and empty path portions in the
  pattern are preserved.
- `2` (or higher) - Much more aggressive optimizations, suitable
  for use with file-walking cases:
  - Remove cases where a double-dot `..` follows a pattern
    portion that is not `**`, `.`, or empty `''`. Remove empty
    and `.` portions of the pattern, where safe to do so (ie,
    anywhere other than the last position, the first position, or
    the second position in a pattern starting with `/`, as this
    may indicate a UNC path on Windows).
  - Convert patterns containing `<pre>/**/../<p>/<rest>` into the
    equivalent `<pre>/{..,**}/<p>/<rest>`, where `<p>` is a
    a pattern portion other than `.`, `..`, `**`, or empty
    `''`.
  - Dedupe patterns where a `**` portion is present in one and
    omitted in another, and it is not the final path portion, and
    they are otherwise equivalent. So `{a/**/b,a/b}` becomes
    `a/**/b`, because `**` matches against an empty path portion.
  - Dedupe patterns where a `*` portion is present in one, and a
    non-dot pattern other than `**`, `.`, `..`, or `''` is in the
    same position in the other. So `a/{*,x}/b` becomes `a/*/b`,
    because `*` can match against `x`.

  While these optimizations improve the performance of
  file-walking use cases such as [glob](http://npm.im/glob) (ie,
  the reason this module exists), there are cases where it will
  fail to match a literal string that would have been matched in
  optimization level 1 or 0.

  Specifically, while the `Minimatch.match()` method will
  optimize the file path string in the same ways, resulting in
  the same matches, it will fail when tested with the regular
  expression provided by `Minimatch.makeRe()`, unless the path
  string is first processed with
  `minimatch.levelTwoFileOptimize()` or similar.

### platform

When set to `win32`, this will trigger all windows-specific
behaviors (special handling for UNC paths, and treating `\` as
separators in file paths for comparison.)

Defaults to the value of `process.platform`.

### maxGlobstarRecursion

Max number of non-adjacent `**` patterns to recursively walk
down.

The default of `200` is almost certainly high enough for most
purposes, and can handle absurdly excessive patterns.

If the limit is exceeded (which would require very excessively
long patterns and paths containing lots of `**` patterns!), then
it is treated as non-matching, even if the path would normally
match the pattern provided.

That is, this is an intentional false negative, deemed an
acceptable break in correctness for security and performance.

### maxExtglobRecursion

Max depth to traverse for nested extglobs like `*(a|b|c)`

Default is 2, which is quite low, but any higher value swiftly
results in punishing performance impacts. Note that this is _not_
relevant when the globstar types can be safely coalesced into a
single set.

For example, `*(a|@(b|c)|d)` would be flattened into
`*(a|b|c|d)`. Thus, many common extglobs will retain good
performance and never hit this limit, even if they are
excessively deep and complicated.

If the limit is hit, then the extglob characters are simply not
parsed, and the pattern effectively switches into `noextglob:
true` mode for the contents of that nested sub-pattern. This will
typically _not_ result in a match, but is considered a valid
trade-off for security and performance.

## Comparisons to other fnmatch/glob implementations

While strict compliance with the existing standards is a
worthwhile goal, some discrepancies exist between minimatch and
other implementations. Some are intentional, and some are
unavoidable.

If the pattern starts with a `!` character, then it is negated. Set the
`nonegate` flag to suppress this behavior, and treat leading `!`
characters normally. This is perhaps relevant if you wish to start the
pattern with a negative extglob pattern like `!(a|B)`. Multiple `!`
characters at the start of a pattern will negate the pattern multiple
times.

If a pattern starts with `#`, then it is treated as a comment, and
will not match anything. Use `\#` to match a literal `#` at the
start of a line, or set the `nocomment` flag to suppress this behavior.

The double-star character `**` is supported by default, unless the
`noglobstar` flag is set. This is supported in the manner of bsdglob
and bash 4.1, where `**` only has special significance if it is the only
thing in a path part. That is, `a/**/b` will match `a/x/y/b`, but
`a/**b` will not.

If an escaped pattern has no matches, and the `nonull` flag is set,
then minimatch.match returns the pattern as-provided, rather than
interpreting the character escapes. For example,
`minimatch.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than
`"*a?"`. This is akin to setting the `nullglob` option in bash, except
that it does not resolve escaped pattern characters.

If brace expansion is not disabled, then it is performed before any
other interpretation of the glob pattern. Thus, a pattern like
`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded
**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are
checked for validity. Since those two are valid, matching proceeds.

Negated extglob patterns are handled as closely as possible to
Bash semantics, but there are some cases with negative extglobs
which are exceedingly difficult to express in a JavaScript
regular expression. In particular the negated pattern
`<start>!(<pattern>*|)*` will in bash match anything that does
not start with `<start><pattern>`. However,
`<start>!(<pattern>*)*` _will_ match paths starting with
`<start><pattern>`, because the empty string can match against
the negated portion. In this library, `<start>!(<pattern>*|)*`
will _not_ match any pattern starting with `<start>`, due to a
difference in precisely which patterns are considered "greedy" in
Regular Expressions vs bash path expansion. This may be fixable,
but not without incurring some complexity and performance costs,
and the trade-off seems to not be worth pursuing.

Note that `fnmatch(3)` in libc is an extremely naive string comparison
matcher, which does not do anything special for slashes. This library is
designed to be used in glob searching and file walkers, and so it does do
special things with `/`. Thus, `foo*` will not match `foo/bar` in this
library, even though it would in `fnmatch(3)`.
kxA 40000 commonjs {ڇ&Ym`@d40000 esm >}Ug {}?Y݃fIդDxD100644 assert-valid-pattern.d.ts 4קQDy%100644 assert-valid-pattern.d.ts.map 0Qu1ELq100644 assert-valid-pattern.js _kɰW}S100644 assert-valid-pattern.js.map z~?2mR100644 ast.d.ts tϓ"uMnt"*DI100644 ast.d.ts.map ej,,AV:g;100644 ast.js 37i?WK0b+kjX100644 ast.js.map 4&1)hKZ۾/)100644 brace-expressions.d.ts W-vGOnL8U100644 brace-expressions.d.ts.map 	`xP:yHtv100644 brace-expressions.js +{q+N)4˙;acE100644 brace-expressions.js.map <óC0yjTs100644 escape.d.ts $ktĊg]yX 100644 escape.d.ts.map g eNT{?nkD'\B100644 escape.js Up{qZ
100644 escape.js.map cJwcT+Seb3100644 index.d.ts ~3scˡ	100644 index.d.ts.map v ۑ́X!j100644 index.js ZiHxX=uȚŨ7q100644 index.js.map t&vt:=F3Q0100644 package.json [9-UI
qkj;100644 unescape.d.ts ġDs&Ncf?100644 unescape.d.ts.map 	P,T^7ۆ100644 unescape.js dd'hM	f(/p100644 unescape.js.map D8~ō(i_8yKxw export declare const assertValidPattern: (pattern: unknown) => void;
//# sourceMappingURL=assert-valid-pattern.d.ts.mapE+Zx 8{"version":3,"file":"assert-valid-pattern.d.ts","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,kBAAkB,EAAE,CAAC,OAAO,EAAE,OAAO,KAAK,IAUtD,CAAA"}z>8x"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.assertValidPattern = void 0;
const MAX_PATTERN_LENGTH = 1024 * 64;
const assertValidPattern = (pattern) => {
    if (typeof pattern !== 'string') {
        throw new TypeError('invalid pattern');
    }
    if (pattern.length > MAX_PATTERN_LENGTH) {
        throw new TypeError('pattern is too long');
    }
};
exports.assertValidPattern = assertValidPattern;
//# sourceMappingURL=assert-valid-pattern.js.mapy4x@{"version":3,"file":"assert-valid-pattern.js","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":";;;AAAA,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAA;AAC7B,MAAM,kBAAkB,GAA+B,CAC5D,OAAgB,EACW,EAAE;IAC7B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAA;IACxC,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,kBAAkB,EAAE,CAAC;QACxC,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC,CAAA;AAVY,QAAA,kBAAkB,sBAU9B","sourcesContent":["const MAX_PATTERN_LENGTH = 1024 * 64\nexport const assertValidPattern: (pattern: unknown) => void = (\n  pattern: unknown,\n): asserts pattern is string => {\n  if (typeof pattern !== 'string') {\n    throw new TypeError('invalid pattern')\n  }\n\n  if (pattern.length > MAX_PATTERN_LENGTH) {\n    throw new TypeError('pattern is too long')\n  }\n}\n"]}Ó4xMimport type { MinimatchOptions, MMRegExp } from './index.js';
export type ExtglobType = '!' | '?' | '+' | '*' | '@';
export declare class AST {
    #private;
    type: ExtglobType | null;
    id: number;
    get depth(): number;
    constructor(type: ExtglobType | null, parent?: AST, options?: MinimatchOptions);
    get hasMagic(): boolean | undefined;
    toString(): string;
    push(...parts: (string | AST)[]): void;
    toJSON(): unknown[];
    isStart(): boolean;
    isEnd(): boolean;
    copyIn(part: AST | string): void;
    clone(parent: AST): AST;
    static fromGlob(pattern: string, options?: MinimatchOptions): AST;
    toMMPattern(): MMRegExp | string;
    get options(): MinimatchOptions;
    toRegExpSource(allowDot?: boolean): [re: string, body: string, hasMagic: boolean, uflag: boolean];
}
//# sourceMappingURL=ast.d.ts.map19xh{"version":3,"file":"ast.d.ts","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAwC5D,MAAM,MAAM,WAAW,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAA;AAgJrD,qBAAa,GAAG;;IACd,IAAI,EAAE,WAAW,GAAG,IAAI,CAAA;IAexB,EAAE,SAAO;IAET,IAAI,KAAK,IAAI,MAAM,CAElB;gBAgBC,IAAI,EAAE,WAAW,GAAG,IAAI,EACxB,MAAM,CAAC,EAAE,GAAG,EACZ,OAAO,GAAE,gBAAqB;IAahC,IAAI,QAAQ,IAAI,OAAO,GAAG,SAAS,CAUlC;IAGD,QAAQ,IAAI,MAAM;IAkDlB,IAAI,CAAC,GAAG,KAAK,EAAE,CAAC,MAAM,GAAG,GAAG,CAAC,EAAE;IAe/B,MAAM;IAkBN,OAAO,IAAI,OAAO;IAgBlB,KAAK,IAAI,OAAO;IAYhB,MAAM,CAAC,IAAI,EAAE,GAAG,GAAG,MAAM;IAKzB,KAAK,CAAC,MAAM,EAAE,GAAG;IAsQjB,MAAM,CAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,gBAAqB;IAQ/D,WAAW,IAAI,QAAQ,GAAG,MAAM;IA2BhC,IAAI,OAAO,qBAEV;IAuED,cAAc,CACZ,QAAQ,CAAC,EAAE,OAAO,GACjB,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC;CA6OjE"}9xwE"use strict";
// parse a single path portion
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AST = void 0;
const brace_expressions_js_1 = require("./brace-expressions.js");
const unescape_js_1 = require("./unescape.js");
const types = new Set(['!', '?', '+', '*', '@']);
const isExtglobType = (c) => types.has(c);
const isExtglobAST = (c) => isExtglobType(c.type);
// Map of which extglob types can adopt the children of a nested extglob
//
// anything but ! can adopt a matching type:
// +(a|+(b|c)|d) => +(a|b|c|d)
// *(a|*(b|c)|d) => *(a|b|c|d)
// @(a|@(b|c)|d) => @(a|b|c|d)
// ?(a|?(b|c)|d) => ?(a|b|c|d)
//
// * can adopt anything, because 0 or repetition is allowed
// *(a|?(b|c)|d) => *(a|b|c|d)
// *(a|+(b|c)|d) => *(a|b|c|d)
// *(a|@(b|c)|d) => *(a|b|c|d)
//
// + can adopt @, because 1 or repetition is allowed
// +(a|@(b|c)|d) => +(a|b|c|d)
//
// + and @ CANNOT adopt *, because 0 would be allowed
// +(a|*(b|c)|d) => would match "", on *(b|c)
// @(a|*(b|c)|d) => would match "", on *(b|c)
//
// + and @ CANNOT adopt ?, because 0 would be allowed
// +(a|?(b|c)|d) => would match "", on ?(b|c)
// @(a|?(b|c)|d) => would match "", on ?(b|c)
//
// ? can adopt @, because 0 or 1 is allowed
// ?(a|@(b|c)|d) => ?(a|b|c|d)
//
// ? and @ CANNOT adopt * or +, because >1 would be allowed
// ?(a|*(b|c)|d) => would match bbb on *(b|c)
// @(a|*(b|c)|d) => would match bbb on *(b|c)
// ?(a|+(b|c)|d) => would match bbb on +(b|c)
// @(a|+(b|c)|d) => would match bbb on +(b|c)
//
// ! CANNOT adopt ! (nothing else can either)
// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)
//
// ! can adopt @
// !(a|@(b|c)|d) => !(a|b|c|d)
//
// ! CANNOT adopt *
// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed
//
// ! CANNOT adopt +
// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed
//
// ! CANNOT adopt ?
// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match "x"
const adoptionMap = new Map([
    ['!', ['@']],
    ['?', ['?', '@']],
    ['@', ['@']],
    ['*', ['*', '+', '?', '@']],
    ['+', ['+', '@']],
]);
// nested extglobs that can be adopted in, but with the addition of
// a blank '' element.
const adoptionWithSpaceMap = new Map([
    ['!', ['?']],
    ['@', ['?']],
    ['+', ['?', '*']],
]);
// union of the previous two maps
const adoptionAnyMap = new Map([
    ['!', ['?', '@']],
    ['?', ['?', '@']],
    ['@', ['?', '@']],
    ['*', ['*', '+', '?', '@']],
    ['+', ['+', '@', '?', '*']],
]);
// Extglobs that can take over their parent if they are the only child
// the key is parent, value maps child to resulting extglob parent type
// '@' is omitted because it's a special case. An `@` extglob with a single
// member can always be usurped by that subpattern.
const usurpMap = new Map([
    ['!', new Map([['!', '@']])],
    [
        '?',
        new Map([
            ['*', '*'],
            ['+', '*'],
        ]),
    ],
    [
        '@',
        new Map([
            ['!', '!'],
            ['?', '?'],
            ['@', '@'],
            ['*', '*'],
            ['+', '+'],
        ]),
    ],
    [
        '+',
        new Map([
            ['?', '*'],
            ['*', '*'],
        ]),
    ],
]);
// Patterns that get prepended to bind to the start of either the
// entire string, or just a single path portion, to prevent dots
// and/or traversal patterns, when needed.
// Exts don't need the ^ or / bit, because the root binds that already.
const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))';
const startNoDot = '(?!\\.)';
// characters that indicate a start of pattern needs the "no dots" bit,
// because a dot *might* be matched. ( is not in the list, because in
// the case of a child extglob, it will handle the prevention itself.
const addPatternStart = new Set(['[', '.']);
// cases where traversal is A-OK, no dot prevention needed
const justDots = new Set(['..', '.']);
const reSpecials = new Set('().*{}+?[]^$\\!');
const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
// any single thing other than /
const qmark = '[^/]';
// * => any number of characters
const star = qmark + '*?';
// use + when we need to ensure that *something* matches, because the * is
// the only thing in the path portion.
const starNoEmpty = qmark + '+?';
// remove the \ chars that we added if we end up doing a nonmagic compare
// const deslash = (s: string) => s.replace(/\\(.)/g, '$1')
let ID = 0;
class AST {
    type;
    #root;
    #hasMagic;
    #uflag = false;
    #parts = [];
    #parent;
    #parentIndex;
    #negs;
    #filledNegs = false;
    #options;
    #toString;
    // set to true if it's an extglob with no children
    // (which really means one child of '')
    #emptyExt = false;
    id = ++ID;
    get depth() {
        return (this.#parent?.depth ?? -1) + 1;
    }
    [Symbol.for('nodejs.util.inspect.custom')]() {
        return {
            '@@type': 'AST',
            id: this.id,
            type: this.type,
            root: this.#root.id,
            parent: this.#parent?.id,
            depth: this.depth,
            partsLength: this.#parts.length,
            parts: this.#parts,
        };
    }
    constructor(type, parent, options = {}) {
        this.type = type;
        // extglobs are inherently magical
        if (type)
            this.#hasMagic = true;
        this.#parent = parent;
        this.#root = this.#parent ? this.#parent.#root : this;
        this.#options = this.#root === this ? options : this.#root.#options;
        this.#negs = this.#root === this ? [] : this.#root.#negs;
        if (type === '!' && !this.#root.#filledNegs)
            this.#negs.push(this);
        this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
    }
    get hasMagic() {
        /* c8 ignore start */
        if (this.#hasMagic !== undefined)
            return this.#hasMagic;
        /* c8 ignore stop */
        for (const p of this.#parts) {
            if (typeof p === 'string')
                continue;
            if (p.type || p.hasMagic)
                return (this.#hasMagic = true);
        }
        // note: will be undefined until we generate the regexp src and find out
        return this.#hasMagic;
    }
    // reconstructs the pattern
    toString() {
        return (this.#toString !== undefined ? this.#toString
            : !this.type ?
                (this.#toString = this.#parts.map(p => String(p)).join(''))
                : (this.#toString =
                    this.type +
                        '(' +
                        this.#parts.map(p => String(p)).join('|') +
                        ')'));
    }
    #fillNegs() {
        /* c8 ignore start */
        if (this !== this.#root)
            throw new Error('should only call on root');
        if (this.#filledNegs)
            return this;
        /* c8 ignore stop */
        // call toString() once to fill this out
        this.toString();
        this.#filledNegs = true;
        let n;
        while ((n = this.#negs.pop())) {
            if (n.type !== '!')
                continue;
            // walk up the tree, appending everthing that comes AFTER parentIndex
            let p = n;
            let pp = p.#parent;
            while (pp) {
                for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {
                    for (const part of n.#parts) {
                        /* c8 ignore start */
                        if (typeof part === 'string') {
                            throw new Error('string part in extglob AST??');
                        }
                        /* c8 ignore stop */
                        part.copyIn(pp.#parts[i]);
                    }
                }
                p = pp;
                pp = p.#parent;
            }
        }
        return this;
    }
    push(...parts) {
        for (const p of parts) {
            if (p === '')
                continue;
            /* c8 ignore start */
            if (typeof p !== 'string' &&
                !(p instanceof _a && p.#parent === this)) {
                throw new Error('invalid part: ' + p);
            }
            /* c8 ignore stop */
            this.#parts.push(p);
        }
    }
    toJSON() {
        const ret = this.type === null ?
            this.#parts
                .slice()
                .map(p => (typeof p === 'string' ? p : p.toJSON()))
            : [this.type, ...this.#parts.map(p => p.toJSON())];
        if (this.isStart() && !this.type)
            ret.unshift([]);
        if (this.isEnd() &&
            (this === this.#root ||
                (this.#root.#filledNegs && this.#parent?.type === '!'))) {
            ret.push({});
        }
        return ret;
    }
    isStart() {
        if (this.#root === this)
            return true;
        // if (this.type) return !!this.#parent?.isStart()
        if (!this.#parent?.isStart())
            return false;
        if (this.#parentIndex === 0)
            return true;
        // if everything AHEAD of this is a negation, then it's still the "start"
        const p = this.#parent;
        for (let i = 0; i < this.#parentIndex; i++) {
            const pp = p.#parts[i];
            if (!(pp instanceof _a && pp.type === '!')) {
                return false;
            }
        }
        return true;
    }
    isEnd() {
        if (this.#root === this)
            return true;
        if (this.#parent?.type === '!')
            return true;
        if (!this.#parent?.isEnd())
            return false;
        if (!this.type)
            return this.#parent?.isEnd();
        // if not root, it'll always have a parent
        /* c8 ignore start */
        const pl = this.#parent ? this.#parent.#parts.length : 0;
        /* c8 ignore stop */
        return this.#parentIndex === pl - 1;
    }
    copyIn(part) {
        if (typeof part === 'string')
            this.push(part);
        else
            this.push(part.clone(this));
    }
    clone(parent) {
        const c = new _a(this.type, parent);
        for (const p of this.#parts) {
            c.copyIn(p);
        }
        return c;
    }
    static #parseAST(str, ast, pos, opt, extDepth) {
        const maxDepth = opt.maxExtglobRecursion ?? 2;
        let escaping = false;
        let inBrace = false;
        let braceStart = -1;
        let braceNeg = false;
        if (ast.type === null) {
            // outside of a extglob, append until we find a start
            let i = pos;
            let acc = '';
            while (i < str.length) {
                const c = str.charAt(i++);
                // still accumulate escapes at this point, but we do ignore
                // starts that are escaped
                if (escaping || c === '\\') {
                    escaping = !escaping;
                    acc += c;
                    continue;
                }
                if (inBrace) {
                    if (i === braceStart + 1) {
                        if (c === '^' || c === '!') {
                            braceNeg = true;
                        }
                    }
                    else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
                        inBrace = false;
                    }
                    acc += c;
                    continue;
                }
                else if (c === '[') {
                    inBrace = true;
                    braceStart = i;
                    braceNeg = false;
                    acc += c;
                    continue;
                }
                // we don't have to check for adoption here, because that's
                // done at the other recursion point.
                const doRecurse = !opt.noext &&
                    isExtglobType(c) &&
                    str.charAt(i) === '(' &&
                    extDepth <= maxDepth;
                if (doRecurse) {
                    ast.push(acc);
                    acc = '';
                    const ext = new _a(c, ast);
                    i = _a.#parseAST(str, ext, i, opt, extDepth + 1);
                    ast.push(ext);
                    continue;
                }
                acc += c;
            }
            ast.push(acc);
            return i;
        }
        // some kind of extglob, pos is at the (
        // find the next | or )
        let i = pos + 1;
        let part = new _a(null, ast);
        const parts = [];
        let acc = '';
        while (i < str.length) {
            const c = str.charAt(i++);
            // still accumulate escapes at this point, but we do ignore
            // starts that are escaped
            if (escaping || c === '\\') {
                escaping = !escaping;
                acc += c;
                continue;
            }
            if (inBrace) {
                if (i === braceStart + 1) {
                    if (c === '^' || c === '!') {
                        braceNeg = true;
                    }
                }
                else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
                    inBrace = false;
                }
                acc += c;
                continue;
            }
            else if (c === '[') {
                inBrace = true;
                braceStart = i;
                braceNeg = false;
                acc += c;
                continue;
            }
            const doRecurse = !opt.noext &&
                isExtglobType(c) &&
                str.charAt(i) === '(' &&
                /* c8 ignore start - the maxDepth is sufficient here */
                (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)));
            /* c8 ignore stop */
            if (doRecurse) {
                const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
                part.push(acc);
                acc = '';
                const ext = new _a(c, part);
                part.push(ext);
                i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd);
                continue;
            }
            if (c === '|') {
                part.push(acc);
                acc = '';
                parts.push(part);
                part = new _a(null, ast);
                continue;
            }
            if (c === ')') {
                if (acc === '' && ast.#parts.length === 0) {
                    ast.#emptyExt = true;
                }
                part.push(acc);
                acc = '';
                ast.push(...parts, part);
                return i;
            }
            acc += c;
        }
        // unfinished extglob
        // if we got here, it was a malformed extglob! not an extglob, but
        // maybe something else in there.
        ast.type = null;
        ast.#hasMagic = undefined;
        ast.#parts = [str.substring(pos - 1)];
        return i;
    }
    #canAdoptWithSpace(child) {
        return this.#canAdopt(child, adoptionWithSpaceMap);
    }
    #canAdopt(child, map = adoptionMap) {
        if (!child ||
            typeof child !== 'object' ||
            child.type !== null ||
            child.#parts.length !== 1 ||
            this.type === null) {
            return false;
        }
        const gc = child.#parts[0];
        if (!gc || typeof gc !== 'object' || gc.type === null) {
            return false;
        }
        return this.#canAdoptType(gc.type, map);
    }
    #canAdoptType(c, map = adoptionAnyMap) {
        return !!map.get(this.type)?.includes(c);
    }
    #adoptWithSpace(child, index) {
        const gc = child.#parts[0];
        const blank = new _a(null, gc, this.options);
        blank.#parts.push('');
        gc.push(blank);
        this.#adopt(child, index);
    }
    #adopt(child, index) {
        const gc = child.#parts[0];
        this.#parts.splice(index, 1, ...gc.#parts);
        for (const p of gc.#parts) {
            if (typeof p === 'object')
                p.#parent = this;
        }
        this.#toString = undefined;
    }
    #canUsurpType(c) {
        const m = usurpMap.get(this.type);
        return !!m?.has(c);
    }
    #canUsurp(child) {
        if (!child ||
            typeof child !== 'object' ||
            child.type !== null ||
            child.#parts.length !== 1 ||
            this.type === null ||
            this.#parts.length !== 1) {
            return false;
        }
        const gc = child.#parts[0];
        if (!gc || typeof gc !== 'object' || gc.type === null) {
            return false;
        }
        return this.#canUsurpType(gc.type);
    }
    #usurp(child) {
        const m = usurpMap.get(this.type);
        const gc = child.#parts[0];
        const nt = m?.get(gc.type);
        /* c8 ignore start - impossible */
        if (!nt)
            return false;
        /* c8 ignore stop */
        this.#parts = gc.#parts;
        for (const p of this.#parts) {
            if (typeof p === 'object') {
                p.#parent = this;
            }
        }
        this.type = nt;
        this.#toString = undefined;
        this.#emptyExt = false;
    }
    static fromGlob(pattern, options = {}) {
        const ast = new _a(null, undefined, options);
        _a.#parseAST(pattern, ast, 0, options, 0);
        return ast;
    }
    // returns the regular expression if there's magic, or the unescaped
    // string if not.
    toMMPattern() {
        // should only be called on root
        /* c8 ignore start */
        if (this !== this.#root)
            return this.#root.toMMPattern();
        /* c8 ignore stop */
        const glob = this.toString();
        const [re, body, hasMagic, uflag] = this.toRegExpSource();
        // if we're in nocase mode, and not nocaseMagicOnly, then we do
        // still need a regular expression if we have to case-insensitively
        // match capital/lowercase characters.
        const anyMagic = hasMagic ||
            this.#hasMagic ||
            (this.#options.nocase &&
                !this.#options.nocaseMagicOnly &&
                glob.toUpperCase() !== glob.toLowerCase());
        if (!anyMagic) {
            return body;
        }
        const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '');
        return Object.assign(new RegExp(`^${re}$`, flags), {
            _src: re,
            _glob: glob,
        });
    }
    get options() {
        return this.#options;
    }
    // returns the string match, the regexp source, whether there's magic
    // in the regexp (so a regular expression is required) and whether or
    // not the uflag is needed for the regular expression (for posix classes)
    // TODO: instead of injecting the start/end at this point, just return
    // the BODY of the regexp, along with the start/end portions suitable
    // for binding the start/end in either a joined full-path makeRe context
    // (where we bind to (^|/), or a standalone matchPart context (where
    // we bind to ^, and not /).  Otherwise slashes get duped!
    //
    // In part-matching mode, the start is:
    // - if not isStart: nothing
    // - if traversal possible, but not allowed: ^(?!\.\.?$)
    // - if dots allowed or not possible: ^
    // - if dots possible and not allowed: ^(?!\.)
    // end is:
    // - if not isEnd(): nothing
    // - else: $
    //
    // In full-path matching mode, we put the slash at the START of the
    // pattern, so start is:
    // - if first pattern: same as part-matching mode
    // - if not isStart(): nothing
    // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
    // - if dots allowed or not possible: /
    // - if dots possible and not allowed: /(?!\.)
    // end is:
    // - if last pattern, same as part-matching mode
    // - else nothing
    //
    // Always put the (?:$|/) on negated tails, though, because that has to be
    // there to bind the end of the negated pattern portion, and it's easier to
    // just stick it in now rather than try to inject it later in the middle of
    // the pattern.
    //
    // We can just always return the same end, and leave it up to the caller
    // to know whether it's going to be used joined or in parts.
    // And, if the start is adjusted slightly, can do the same there:
    // - if not isStart: nothing
    // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
    // - if dots allowed or not possible: (?:/|^)
    // - if dots possible and not allowed: (?:/|^)(?!\.)
    //
    // But it's better to have a simpler binding without a conditional, for
    // performance, so probably better to return both start options.
    //
    // Then the caller just ignores the end if it's not the first pattern,
    // and the start always gets applied.
    //
    // But that's always going to be $ if it's the ending pattern, or nothing,
    // so the caller can just attach $ at the end of the pattern when building.
    //
    // So the todo is:
    // - better detect what kind of start is needed
    // - return both flavors of starting pattern
    // - attach $ at the end of the pattern when creating the actual RegExp
    //
    // Ah, but wait, no, that all only applies to the root when the first pattern
    // is not an extglob. If the first pattern IS an extglob, then we need all
    // that dot prevention biz to live in the extglob portions, because eg
    // +(*|.x*) can match .xy but not .yx.
    //
    // So, return the two flavors if it's #root and the first child is not an
    // AST, otherwise leave it to the child AST to handle it, and there,
    // use the (?:^|/) style of start binding.
    //
    // Even simplified further:
    // - Since the start for a join is eg /(?!\.) and the start for a part
    // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
    // or start or whatever) and prepend ^ or / at the Regexp construction.
    toRegExpSource(allowDot) {
        const dot = allowDot ?? !!this.#options.dot;
        if (this.#root === this) {
            this.#flatten();
            this.#fillNegs();
        }
        if (!isExtglobAST(this)) {
            const noEmpty = this.isStart() &&
                this.isEnd() &&
                !this.#parts.some(s => typeof s !== 'string');
            const src = this.#parts
                .map(p => {
                const [re, _, hasMagic, uflag] = typeof p === 'string' ?
                    _a.#parseGlob(p, this.#hasMagic, noEmpty)
                    : p.toRegExpSource(allowDot);
                this.#hasMagic = this.#hasMagic || hasMagic;
                this.#uflag = this.#uflag || uflag;
                return re;
            })
                .join('');
            let start = '';
            if (this.isStart()) {
                if (typeof this.#parts[0] === 'string') {
                    // this is the string that will match the start of the pattern,
                    // so we need to protect against dots and such.
                    // '.' and '..' cannot match unless the pattern is that exactly,
                    // even if it starts with . or dot:true is set.
                    const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
                    if (!dotTravAllowed) {
                        const aps = addPatternStart;
                        // check if we have a possibility of matching . or ..,
                        // and prevent that.
                        const needNoTrav = 
                        // dots are allowed, and the pattern starts with [ or .
                        (dot && aps.has(src.charAt(0))) ||
                            // the pattern starts with \., and then [ or .
                            (src.startsWith('\\.') && aps.has(src.charAt(2))) ||
                            // the pattern starts with \.\., and then [ or .
                            (src.startsWith('\\.\\.') && aps.has(src.charAt(4)));
                        // no need to prevent dots if it can't match a dot, or if a
                        // sub-pattern will be preventing it anyway.
                        const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
                        start =
                            needNoTrav ? startNoTraversal
                                : needNoDot ? startNoDot
                                    : '';
                    }
                }
            }
            // append the "end of path portion" pattern to negation tails
            let end = '';
            if (this.isEnd() &&
                this.#root.#filledNegs &&
                this.#parent?.type === '!') {
                end = '(?:$|\\/)';
            }
            const final = start + src + end;
            return [
                final,
                (0, unescape_js_1.unescape)(src),
                (this.#hasMagic = !!this.#hasMagic),
                this.#uflag,
            ];
        }
        // We need to calculate the body *twice* if it's a repeat pattern
        // at the start, once in nodot mode, then again in dot mode, so a
        // pattern like *(?) can match 'x.y'
        const repeated = this.type === '*' || this.type === '+';
        // some kind of extglob
        const start = this.type === '!' ? '(?:(?!(?:' : '(?:';
        let body = this.#partsToRegExp(dot);
        if (this.isStart() && this.isEnd() && !body && this.type !== '!') {
            // invalid extglob, has to at least be *something* present, if it's
            // the entire path portion.
            const s = this.toString();
            const me = this;
            me.#parts = [s];
            me.type = null;
            me.#hasMagic = undefined;
            return [s, (0, unescape_js_1.unescape)(this.toString()), false, false];
        }
        let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ?
            ''
            : this.#partsToRegExp(true);
        if (bodyDotAllowed === body) {
            bodyDotAllowed = '';
        }
        if (bodyDotAllowed) {
            body = `(?:${body})(?:${bodyDotAllowed})*?`;
        }
        // an empty !() is exactly equivalent to a starNoEmpty
        let final = '';
        if (this.type === '!' && this.#emptyExt) {
            final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;
        }
        else {
            const close = this.type === '!' ?
                // !() must match something,but !(x) can match ''
                '))' +
                    (this.isStart() && !dot && !allowDot ? startNoDot : '') +
                    star +
                    ')'
                : this.type === '@' ? ')'
                    : this.type === '?' ? ')?'
                        : this.type === '+' && bodyDotAllowed ? ')'
                            : this.type === '*' && bodyDotAllowed ? `)?`
                                : `)${this.type}`;
            final = start + body + close;
        }
        return [
            final,
            (0, unescape_js_1.unescape)(body),
            (this.#hasMagic = !!this.#hasMagic),
            this.#uflag,
        ];
    }
    #flatten() {
        if (!isExtglobAST(this)) {
            for (const p of this.#parts) {
                if (typeof p === 'object') {
                    p.#flatten();
                }
            }
        }
        else {
            // do up to 10 passes to flatten as much as possible
            let iterations = 0;
            let done = false;
            do {
                done = true;
                for (let i = 0; i < this.#parts.length; i++) {
                    const c = this.#parts[i];
                    if (typeof c === 'object') {
                        c.#flatten();
                        if (this.#canAdopt(c)) {
                            done = false;
                            this.#adopt(c, i);
                        }
                        else if (this.#canAdoptWithSpace(c)) {
                            done = false;
                            this.#adoptWithSpace(c, i);
                        }
                        else if (this.#canUsurp(c)) {
                            done = false;
                            this.#usurp(c);
                        }
                    }
                }
            } while (!done && ++iterations < 10);
        }
        this.#toString = undefined;
    }
    #partsToRegExp(dot) {
        return this.#parts
            .map(p => {
            // extglob ASTs should only contain parent ASTs
            /* c8 ignore start */
            if (typeof p === 'string') {
                throw new Error('string type in extglob ast??');
            }
            /* c8 ignore stop */
            // can ignore hasMagic, because extglobs are already always magic
            const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);
            this.#uflag = this.#uflag || uflag;
            return re;
        })
            .filter(p => !(this.isStart() && this.isEnd()) || !!p)
            .join('|');
    }
    static #parseGlob(glob, hasMagic, noEmpty = false) {
        let escaping = false;
        let re = '';
        let uflag = false;
        // multiple stars that aren't globstars coalesce into one *
        let inStar = false;
        for (let i = 0; i < glob.length; i++) {
            const c = glob.charAt(i);
            if (escaping) {
                escaping = false;
                re += (reSpecials.has(c) ? '\\' : '') + c;
                continue;
            }
            if (c === '*') {
                if (inStar)
                    continue;
                inStar = true;
                re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;
                hasMagic = true;
                continue;
            }
            else {
                inStar = false;
            }
            if (c === '\\') {
                if (i === glob.length - 1) {
                    re += '\\\\';
                }
                else {
                    escaping = true;
                }
                continue;
            }
            if (c === '[') {
                const [src, needUflag, consumed, magic] = (0, brace_expressions_js_1.parseClass)(glob, i);
                if (consumed) {
                    re += src;
                    uflag = uflag || needUflag;
                    i += consumed - 1;
                    hasMagic = hasMagic || magic;
                    continue;
                }
            }
            if (c === '?') {
                re += qmark;
                hasMagic = true;
                continue;
            }
            re += regExpEscape(c);
        }
        return [re, (0, unescape_js_1.unescape)(glob), !!hasMagic, uflag];
    }
}
exports.AST = AST;
_a = AST;
//# sourceMappingURL=ast.js.maph캰x
${"version":3,"file":"ast.js","sourceRoot":"","sources":["../../src/ast.ts"],"names":[],"mappings":";AAAA,8BAA8B;;;;AAE9B,iEAAmD;AAEnD,+CAAwC;AAwCxC,MAAM,KAAK,GAAG,IAAI,GAAG,CAAc,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,CAAA;AAC7D,MAAM,aAAa,GAAG,CAAC,CAAgB,EAAoB,EAAE,CAC3D,KAAK,CAAC,GAAG,CAAC,CAAgB,CAAC,CAAA;AAC7B,MAAM,YAAY,GAAG,CAAC,CAAM,EAAoC,EAAE,CAChE,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;AAEvB,wEAAwE;AACxE,EAAE;AACF,4CAA4C;AAC5C,8BAA8B;AAC9B,8BAA8B;AAC9B,8BAA8B;AAC9B,8BAA8B;AAC9B,EAAE;AACF,2DAA2D;AAC3D,8BAA8B;AAC9B,8BAA8B;AAC9B,8BAA8B;AAC9B,EAAE;AACF,oDAAoD;AACpD,8BAA8B;AAC9B,EAAE;AACF,qDAAqD;AACrD,6CAA6C;AAC7C,6CAA6C;AAC7C,EAAE;AACF,qDAAqD;AACrD,6CAA6C;AAC7C,6CAA6C;AAC7C,EAAE;AACF,2CAA2C;AAC3C,8BAA8B;AAC9B,EAAE;AACF,2DAA2D;AAC3D,6CAA6C;AAC7C,6CAA6C;AAC7C,6CAA6C;AAC7C,6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E,CAAC;gBACd,MAAM,CAAC,GAAG,EAAE,SAAS,EAAE,QAAQ,EAAE,KAAK,CAAC,GAAG,IAAA,iCAAU,EAAC,IAAI,EAAE,CAAC,CAAC,CAAA;gBAC7D,IAAI,QAAQ,EAAE,CAAC;oBACb,EAAE,IAAI,GAAG,CAAA;oBACT,KAAK,GAAG,KAAK,IAAI,SAAS,CAAA;oBAC1B,CAAC,IAAI,QAAQ,GAAG,CAAC,CAAA;oBACjB,QAAQ,GAAG,QAAQ,IAAI,KAAK,CAAA;oBAC5B,SAAQ;gBACV,CAAC;YACH,CAAC;YACD,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;gBACd,EAAE,IAAI,KAAK,CAAA;gBACX,QAAQ,GAAG,IAAI,CAAA;gBACf,SAAQ;YACV,CAAC;YACD,EAAE,IAAI,YAAY,CAAC,CAAC,CAAC,CAAA;QACvB,CAAC;QACD,OAAO,CAAC,EAAE,EAAE,IAAA,sBAAQ,EAAC,IAAI,CAAC,EAAE,CAAC,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;IAChD,CAAC;CACF;AArxBD,kBAqxBC","sourcesContent":["// parse a single path portion\n\nimport { parseClass } from './brace-expressions.js'\nimport type { MinimatchOptions, MMRegExp } from './index.js'\nimport { unescape } from './unescape.js'\n\n// classes [] are handled by the parseClass method\n// for positive extglobs, we sub-parse the contents, and combine,\n// with the appropriate regexp close.\n// for negative extglobs, we sub-parse the contents, but then\n// have to include the rest of the pattern, then the parent, etc.,\n// as the thing that cannot be because RegExp negative lookaheads\n// are different from globs.\n//\n// So for example:\n// a@(i|w!(x|y)z|j)b => ^a(i|w((!?(x|y)zb).*)z|j)b$\n//   1   2 3   4 5 6      1   2    3   46      5 6\n//\n// Assembling the extglob requires not just the negated patterns themselves,\n// but also anything following the negative patterns up to the boundary\n// of the current pattern, plus anything following in the parent pattern.\n//\n//\n// So, first, we parse the string into an AST of extglobs, without turning\n// anything into regexps yet.\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y']}, 'z'], ['j']]}, 'b']\n//\n// Then, for all the negative extglobs, we append whatever comes after in\n// each parent as their tail\n//\n// ['a', {@ [['i'], ['w', {!['x', 'y'], 'z', 'b'}, 'z'], ['j']]}, 'b']\n//\n// Lastly, we turn each of these pieces into a regexp, and join\n//\n//                                 v----- .* because there's more following,\n//                                 v    v  otherwise, .+ because it must be\n//                                 v    v  *something* there.\n// ['^a', {@ ['i', 'w(?:(!?(?:x|y).*zb$).*)z', 'j' ]}, 'b$']\n//   copy what follows into here--^^^^^\n// ['^a', '(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)', 'b$']\n// ['^a(?:i|w(?:(?!(?:x|y).*zb$).*)z|j)b$']\n\nexport type ExtglobType = '!' | '?' | '+' | '*' | '@'\nconst types = new Set<ExtglobType>(['!', '?', '+', '*', '@'])\nconst isExtglobType = (c: string | null): c is ExtglobType =>\n  types.has(c as ExtglobType)\nconst isExtglobAST = (c: AST): c is AST & { type: ExtglobType } =>\n  isExtglobType(c.type)\n\n// Map of which extglob types can adopt the children of a nested extglob\n//\n// anything but ! can adopt a matching type:\n// +(a|+(b|c)|d) => +(a|b|c|d)\n// *(a|*(b|c)|d) => *(a|b|c|d)\n// @(a|@(b|c)|d) => @(a|b|c|d)\n// ?(a|?(b|c)|d) => ?(a|b|c|d)\n//\n// * can adopt anything, because 0 or repetition is allowed\n// *(a|?(b|c)|d) => *(a|b|c|d)\n// *(a|+(b|c)|d) => *(a|b|c|d)\n// *(a|@(b|c)|d) => *(a|b|c|d)\n//\n// + can adopt @, because 1 or repetition is allowed\n// +(a|@(b|c)|d) => +(a|b|c|d)\n//\n// + and @ CANNOT adopt *, because 0 would be allowed\n// +(a|*(b|c)|d) => would match \"\", on *(b|c)\n// @(a|*(b|c)|d) => would match \"\", on *(b|c)\n//\n// + and @ CANNOT adopt ?, because 0 would be allowed\n// +(a|?(b|c)|d) => would match \"\", on ?(b|c)\n// @(a|?(b|c)|d) => would match \"\", on ?(b|c)\n//\n// ? can adopt @, because 0 or 1 is allowed\n// ?(a|@(b|c)|d) => ?(a|b|c|d)\n//\n// ? and @ CANNOT adopt * or +, because >1 would be allowed\n// ?(a|*(b|c)|d) => would match bbb on *(b|c)\n// @(a|*(b|c)|d) => would match bbb on *(b|c)\n// ?(a|+(b|c)|d) => would match bbb on +(b|c)\n// @(a|+(b|c)|d) => would match bbb on +(b|c)\n//\n// ! CANNOT adopt ! (nothing else can either)\n// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)\n//\n// ! can adopt @\n// !(a|@(b|c)|d) => !(a|b|c|d)\n//\n// ! CANNOT adopt *\n// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt +\n// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed\n//\n// ! CANNOT adopt ?\n// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match \"x\"\nconst adoptionMap = new Map<ExtglobType, ExtglobType[]>([\n  ['!', ['@']],\n  ['?', ['?', '@']],\n  ['@', ['@']],\n  ['*', ['*', '+', '?', '@']],\n  ['+', ['+', '@']],\n])\n\n// nested extglobs that can be adopted in, but with the addition of\n// a blank '' element.\nconst adoptionWithSpaceMap = new Map<ExtglobType, ExtglobType[]>([\n  ['!', ['?']],\n  ['@', ['?']],\n  ['+', ['?', '*']],\n])\n\n// union of the previous two maps\nconst adoptionAnyMap = new Map<ExtglobType, ExtglobType[]>([\n  ['!', ['?', '@']],\n  ['?', ['?', '@']],\n  ['@', ['?', '@']],\n  ['*', ['*', '+', '?', '@']],\n  ['+', ['+', '@', '?', '*']],\n])\n\n// Extglobs that can take over their parent if they are the only child\n// the key is parent, value maps child to resulting extglob parent type\n// '@' is omitted because it's a special case. An `@` extglob with a single\n// member can always be usurped by that subpattern.\nconst usurpMap = new Map<\n  ExtglobType,\n  Map<ExtglobType | null, ExtglobType | null>\n>([\n  ['!', new Map([['!', '@']])],\n  [\n    '?',\n    new Map([\n      ['*', '*'],\n      ['+', '*'],\n    ]),\n  ],\n  [\n    '@',\n    new Map([\n      ['!', '!'],\n      ['?', '?'],\n      ['@', '@'],\n      ['*', '*'],\n      ['+', '+'],\n    ]),\n  ],\n  [\n    '+',\n    new Map([\n      ['?', '*'],\n      ['*', '*'],\n    ]),\n  ],\n])\n\n// Patterns that get prepended to bind to the start of either the\n// entire string, or just a single path portion, to prevent dots\n// and/or traversal patterns, when needed.\n// Exts don't need the ^ or / bit, because the root binds that already.\nconst startNoTraversal = '(?!(?:^|/)\\\\.\\\\.?(?:$|/))'\nconst startNoDot = '(?!\\\\.)'\n\n// characters that indicate a start of pattern needs the \"no dots\" bit,\n// because a dot *might* be matched. ( is not in the list, because in\n// the case of a child extglob, it will handle the prevention itself.\nconst addPatternStart = new Set(['[', '.'])\n// cases where traversal is A-OK, no dot prevention needed\nconst justDots = new Set(['..', '.'])\nconst reSpecials = new Set('().*{}+?[]^$\\\\!')\nconst regExpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// any single thing other than /\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n// use + when we need to ensure that *something* matches, because the * is\n// the only thing in the path portion.\nconst starNoEmpty = qmark + '+?'\n\n// remove the \\ chars that we added if we end up doing a nonmagic compare\n// const deslash = (s: string) => s.replace(/\\\\(.)/g, '$1')\n\nlet ID = 0\nexport class AST {\n  type: ExtglobType | null\n  readonly #root: AST\n\n  #hasMagic?: boolean\n  #uflag: boolean = false\n  #parts: (string | AST)[] = []\n  #parent?: AST\n  #parentIndex: number\n  #negs: AST[]\n  #filledNegs: boolean = false\n  #options: MinimatchOptions\n  #toString?: string\n  // set to true if it's an extglob with no children\n  // (which really means one child of '')\n  #emptyExt: boolean = false\n  id = ++ID\n\n  get depth(): number {\n    return (this.#parent?.depth ?? -1) + 1\n  }\n\n  [Symbol.for('nodejs.util.inspect.custom')]() {\n    return {\n      '@@type': 'AST',\n      id: this.id,\n      type: this.type,\n      root: this.#root.id,\n      parent: this.#parent?.id,\n      depth: this.depth,\n      partsLength: this.#parts.length,\n      parts: this.#parts,\n    }\n  }\n\n  constructor(\n    type: ExtglobType | null,\n    parent?: AST,\n    options: MinimatchOptions = {},\n  ) {\n    this.type = type\n    // extglobs are inherently magical\n    if (type) this.#hasMagic = true\n    this.#parent = parent\n    this.#root = this.#parent ? this.#parent.#root : this\n    this.#options = this.#root === this ? options : this.#root.#options\n    this.#negs = this.#root === this ? [] : this.#root.#negs\n    if (type === '!' && !this.#root.#filledNegs) this.#negs.push(this)\n    this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0\n  }\n\n  get hasMagic(): boolean | undefined {\n    /* c8 ignore start */\n    if (this.#hasMagic !== undefined) return this.#hasMagic\n    /* c8 ignore stop */\n    for (const p of this.#parts) {\n      if (typeof p === 'string') continue\n      if (p.type || p.hasMagic) return (this.#hasMagic = true)\n    }\n    // note: will be undefined until we generate the regexp src and find out\n    return this.#hasMagic\n  }\n\n  // reconstructs the pattern\n  toString(): string {\n    return (\n      this.#toString !== undefined ? this.#toString\n      : !this.type ?\n        (this.#toString = this.#parts.map(p => String(p)).join(''))\n      : (this.#toString =\n          this.type +\n          '(' +\n          this.#parts.map(p => String(p)).join('|') +\n          ')')\n    )\n  }\n\n  #fillNegs() {\n    /* c8 ignore start */\n    if (this !== this.#root) throw new Error('should only call on root')\n    if (this.#filledNegs) return this\n    /* c8 ignore stop */\n\n    // call toString() once to fill this out\n    this.toString()\n    this.#filledNegs = true\n    let n: AST | undefined\n    while ((n = this.#negs.pop())) {\n      if (n.type !== '!') continue\n      // walk up the tree, appending everthing that comes AFTER parentIndex\n      let p: AST | undefined = n\n      let pp = p.#parent\n      while (pp) {\n        for (\n          let i = p.#parentIndex + 1;\n          !pp.type && i < pp.#parts.length;\n          i++\n        ) {\n          for (const part of n.#parts) {\n            /* c8 ignore start */\n            if (typeof part === 'string') {\n              throw new Error('string part in extglob AST??')\n            }\n            /* c8 ignore stop */\n            part.copyIn(pp.#parts[i])\n          }\n        }\n        p = pp\n        pp = p.#parent\n      }\n    }\n    return this\n  }\n\n  push(...parts: (string | AST)[]) {\n    for (const p of parts) {\n      if (p === '') continue\n      /* c8 ignore start */\n      if (\n        typeof p !== 'string' &&\n        !(p instanceof AST && p.#parent === this)\n      ) {\n        throw new Error('invalid part: ' + p)\n      }\n      /* c8 ignore stop */\n      this.#parts.push(p)\n    }\n  }\n\n  toJSON() {\n    const ret: unknown[] =\n      this.type === null ?\n        this.#parts\n          .slice()\n          .map(p => (typeof p === 'string' ? p : p.toJSON()))\n      : [this.type, ...this.#parts.map(p => (p as AST).toJSON())]\n    if (this.isStart() && !this.type) ret.unshift([])\n    if (\n      this.isEnd() &&\n      (this === this.#root ||\n        (this.#root.#filledNegs && this.#parent?.type === '!'))\n    ) {\n      ret.push({})\n    }\n    return ret\n  }\n\n  isStart(): boolean {\n    if (this.#root === this) return true\n    // if (this.type) return !!this.#parent?.isStart()\n    if (!this.#parent?.isStart()) return false\n    if (this.#parentIndex === 0) return true\n    // if everything AHEAD of this is a negation, then it's still the \"start\"\n    const p = this.#parent\n    for (let i = 0; i < this.#parentIndex; i++) {\n      const pp = p.#parts[i]\n      if (!(pp instanceof AST && pp.type === '!')) {\n        return false\n      }\n    }\n    return true\n  }\n\n  isEnd(): boolean {\n    if (this.#root === this) return true\n    if (this.#parent?.type === '!') return true\n    if (!this.#parent?.isEnd()) return false\n    if (!this.type) return this.#parent?.isEnd()\n    // if not root, it'll always have a parent\n    /* c8 ignore start */\n    const pl = this.#parent ? this.#parent.#parts.length : 0\n    /* c8 ignore stop */\n    return this.#parentIndex === pl - 1\n  }\n\n  copyIn(part: AST | string) {\n    if (typeof part === 'string') this.push(part)\n    else this.push(part.clone(this))\n  }\n\n  clone(parent: AST) {\n    const c = new AST(this.type, parent)\n    for (const p of this.#parts) {\n      c.copyIn(p)\n    }\n    return c\n  }\n\n  static #parseAST(\n    str: string,\n    ast: AST,\n    pos: number,\n    opt: MinimatchOptions,\n    extDepth: number,\n  ): number {\n    const maxDepth = opt.maxExtglobRecursion ?? 2\n    let escaping = false\n    let inBrace = false\n    let braceStart = -1\n    let braceNeg = false\n    if (ast.type === null) {\n      // outside of a extglob, append until we find a start\n      let i = pos\n      let acc = ''\n      while (i < str.length) {\n        const c = str.charAt(i++)\n        // still accumulate escapes at this point, but we do ignore\n        // starts that are escaped\n        if (escaping || c === '\\\\') {\n          escaping = !escaping\n          acc += c\n          continue\n        }\n\n        if (inBrace) {\n          if (i === braceStart + 1) {\n            if (c === '^' || c === '!') {\n              braceNeg = true\n            }\n          } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n            inBrace = false\n          }\n          acc += c\n          continue\n        } else if (c === '[') {\n          inBrace = true\n          braceStart = i\n          braceNeg = false\n          acc += c\n          continue\n        }\n\n        // we don't have to check for adoption here, because that's\n        // done at the other recursion point.\n        const doRecurse =\n          !opt.noext &&\n          isExtglobType(c) &&\n          str.charAt(i) === '(' &&\n          extDepth <= maxDepth\n        if (doRecurse) {\n          ast.push(acc)\n          acc = ''\n          const ext = new AST(c, ast)\n          i = AST.#parseAST(str, ext, i, opt, extDepth + 1)\n          ast.push(ext)\n          continue\n        }\n        acc += c\n      }\n      ast.push(acc)\n      return i\n    }\n\n    // some kind of extglob, pos is at the (\n    // find the next | or )\n    let i = pos + 1\n    let part = new AST(null, ast)\n    const parts: AST[] = []\n    let acc = ''\n    while (i < str.length) {\n      const c = str.charAt(i++)\n      // still accumulate escapes at this point, but we do ignore\n      // starts that are escaped\n      if (escaping || c === '\\\\') {\n        escaping = !escaping\n        acc += c\n        continue\n      }\n\n      if (inBrace) {\n        if (i === braceStart + 1) {\n          if (c === '^' || c === '!') {\n            braceNeg = true\n          }\n        } else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {\n          inBrace = false\n        }\n        acc += c\n        continue\n      } else if (c === '[') {\n        inBrace = true\n        braceStart = i\n        braceNeg = false\n        acc += c\n        continue\n      }\n\n      const doRecurse =\n        !opt.noext &&\n        isExtglobType(c) &&\n        str.charAt(i) === '(' &&\n        /* c8 ignore start - the maxDepth is sufficient here */\n        (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)))\n      /* c8 ignore stop */\n      if (doRecurse) {\n        const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1\n        part.push(acc)\n        acc = ''\n        const ext = new AST(c, part)\n        part.push(ext)\n        i = AST.#parseAST(str, ext, i, opt, extDepth + depthAdd)\n        continue\n      }\n      if (c === '|') {\n        part.push(acc)\n        acc = ''\n        parts.push(part)\n        part = new AST(null, ast)\n        continue\n      }\n      if (c === ')') {\n        if (acc === '' && ast.#parts.length === 0) {\n          ast.#emptyExt = true\n        }\n        part.push(acc)\n        acc = ''\n        ast.push(...parts, part)\n        return i\n      }\n      acc += c\n    }\n\n    // unfinished extglob\n    // if we got here, it was a malformed extglob! not an extglob, but\n    // maybe something else in there.\n    ast.type = null\n    ast.#hasMagic = undefined\n    ast.#parts = [str.substring(pos - 1)]\n    return i\n  }\n\n  #canAdoptWithSpace(child?: AST | string): child is AST & {\n    type: null\n    parts: [AST & { type: ExtglobType }]\n  } {\n    return this.#canAdopt(child, adoptionWithSpaceMap)\n  }\n\n  #canAdopt(\n    child?: AST | string,\n    map: Map<ExtglobType, ExtglobType[]> = adoptionMap,\n  ): child is AST & {\n    type: null\n    parts: [AST & { type: ExtglobType }]\n  } {\n    if (\n      !child ||\n      typeof child !== 'object' ||\n      child.type !== null ||\n      child.#parts.length !== 1 ||\n      this.type === null\n    ) {\n      return false\n    }\n    const gc = child.#parts[0]\n    if (!gc || typeof gc !== 'object' || gc.type === null) {\n      return false\n    }\n    return (this as AST & { type: ExtglobType }).#canAdoptType(\n      gc.type,\n      map,\n    )\n  }\n  #canAdoptType(\n    c: string,\n    map: Map<ExtglobType, ExtglobType[]> = adoptionAnyMap,\n  ): c is ExtglobType {\n    return !!map.get(this.type as ExtglobType)?.includes(c as ExtglobType)\n  }\n\n  #adoptWithSpace(\n    this: AST & { type: ExtglobType },\n    child: AST & {\n      type: null\n    },\n    index: number,\n  ) {\n    const gc = child.#parts[0] as AST & { type: ExtglobType }\n    const blank = new AST(null, gc, this.options)\n    blank.#parts.push('')\n    gc.push(blank)\n    this.#adopt(child, index)\n  }\n\n  #adopt(\n    child: AST & {\n      type: null\n    },\n    index: number,\n  ) {\n    const gc = child.#parts[0] as AST & { type: ExtglobType }\n    this.#parts.splice(index, 1, ...gc.#parts)\n    for (const p of gc.#parts) {\n      if (typeof p === 'object') p.#parent = this\n    }\n    this.#toString = undefined\n  }\n\n  #canUsurpType(c: string): boolean {\n    const m = usurpMap.get(this.type as ExtglobType)\n    return !!m?.has(c as ExtglobType)\n  }\n\n  #canUsurp(child?: AST | string): child is AST & {\n    type: null\n    parts: [AST & { type: ExtglobType }]\n  } {\n    if (\n      !child ||\n      typeof child !== 'object' ||\n      child.type !== null ||\n      child.#parts.length !== 1 ||\n      this.type === null ||\n      this.#parts.length !== 1\n    ) {\n      return false\n    }\n    const gc = child.#parts[0]\n    if (!gc || typeof gc !== 'object' || gc.type === null) {\n      return false\n    }\n    return (this as AST & { type: ExtglobType }).#canUsurpType(gc.type)\n  }\n\n  #usurp(this: AST & { type: ExtglobType }, child: AST & { type: null }) {\n    const m = usurpMap.get(this.type as ExtglobType)\n    const gc = child.#parts[0] as AST & { type: ExtglobType }\n    const nt = m?.get(gc.type)\n    /* c8 ignore start - impossible */\n    if (!nt) return false\n    /* c8 ignore stop */\n    this.#parts = gc.#parts\n    for (const p of this.#parts) {\n      if (typeof p === 'object') {\n        p.#parent = this\n      }\n    }\n    this.type = nt\n    this.#toString = undefined\n    this.#emptyExt = false\n  }\n\n  static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n    const ast = new AST(null, undefined, options)\n    AST.#parseAST(pattern, ast, 0, options, 0)\n    return ast\n  }\n\n  // returns the regular expression if there's magic, or the unescaped\n  // string if not.\n  toMMPattern(): MMRegExp | string {\n    // should only be called on root\n    /* c8 ignore start */\n    if (this !== this.#root) return this.#root.toMMPattern()\n    /* c8 ignore stop */\n    const glob = this.toString()\n    const [re, body, hasMagic, uflag] = this.toRegExpSource()\n    // if we're in nocase mode, and not nocaseMagicOnly, then we do\n    // still need a regular expression if we have to case-insensitively\n    // match capital/lowercase characters.\n    const anyMagic =\n      hasMagic ||\n      this.#hasMagic ||\n      (this.#options.nocase &&\n        !this.#options.nocaseMagicOnly &&\n        glob.toUpperCase() !== glob.toLowerCase())\n    if (!anyMagic) {\n      return body\n    }\n\n    const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '')\n    return Object.assign(new RegExp(`^${re}$`, flags), {\n      _src: re,\n      _glob: glob,\n    })\n  }\n\n  get options() {\n    return this.#options\n  }\n\n  // returns the string match, the regexp source, whether there's magic\n  // in the regexp (so a regular expression is required) and whether or\n  // not the uflag is needed for the regular expression (for posix classes)\n  // TODO: instead of injecting the start/end at this point, just return\n  // the BODY of the regexp, along with the start/end portions suitable\n  // for binding the start/end in either a joined full-path makeRe context\n  // (where we bind to (^|/), or a standalone matchPart context (where\n  // we bind to ^, and not /).  Otherwise slashes get duped!\n  //\n  // In part-matching mode, the start is:\n  // - if not isStart: nothing\n  // - if traversal possible, but not allowed: ^(?!\\.\\.?$)\n  // - if dots allowed or not possible: ^\n  // - if dots possible and not allowed: ^(?!\\.)\n  // end is:\n  // - if not isEnd(): nothing\n  // - else: $\n  //\n  // In full-path matching mode, we put the slash at the START of the\n  // pattern, so start is:\n  // - if first pattern: same as part-matching mode\n  // - if not isStart(): nothing\n  // - if traversal possible, but not allowed: /(?!\\.\\.?(?:$|/))\n  // - if dots allowed or not possible: /\n  // - if dots possible and not allowed: /(?!\\.)\n  // end is:\n  // - if last pattern, same as part-matching mode\n  // - else nothing\n  //\n  // Always put the (?:$|/) on negated tails, though, because that has to be\n  // there to bind the end of the negated pattern portion, and it's easier to\n  // just stick it in now rather than try to inject it later in the middle of\n  // the pattern.\n  //\n  // We can just always return the same end, and leave it up to the caller\n  // to know whether it's going to be used joined or in parts.\n  // And, if the start is adjusted slightly, can do the same there:\n  // - if not isStart: nothing\n  // - if traversal possible, but not allowed: (?:/|^)(?!\\.\\.?$)\n  // - if dots allowed or not possible: (?:/|^)\n  // - if dots possible and not allowed: (?:/|^)(?!\\.)\n  //\n  // But it's better to have a simpler binding without a conditional, for\n  // performance, so probably better to return both start options.\n  //\n  // Then the caller just ignores the end if it's not the first pattern,\n  // and the start always gets applied.\n  //\n  // But that's always going to be $ if it's the ending pattern, or nothing,\n  // so the caller can just attach $ at the end of the pattern when building.\n  //\n  // So the todo is:\n  // - better detect what kind of start is needed\n  // - return both flavors of starting pattern\n  // - attach $ at the end of the pattern when creating the actual RegExp\n  //\n  // Ah, but wait, no, that all only applies to the root when the first pattern\n  // is not an extglob. If the first pattern IS an extglob, then we need all\n  // that dot prevention biz to live in the extglob portions, because eg\n  // +(*|.x*) can match .xy but not .yx.\n  //\n  // So, return the two flavors if it's #root and the first child is not an\n  // AST, otherwise leave it to the child AST to handle it, and there,\n  // use the (?:^|/) style of start binding.\n  //\n  // Even simplified further:\n  // - Since the start for a join is eg /(?!\\.) and the start for a part\n  // is ^(?!\\.), we can just prepend (?!\\.) to the pattern (either root\n  // or start or whatever) and prepend ^ or / at the Regexp construction.\n  toRegExpSource(\n    allowDot?: boolean,\n  ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n    const dot = allowDot ?? !!this.#options.dot\n    if (this.#root === this) {\n      this.#flatten()\n      this.#fillNegs()\n    }\n    if (!isExtglobAST(this)) {\n      const noEmpty =\n        this.isStart() &&\n        this.isEnd() &&\n        !this.#parts.some(s => typeof s !== 'string')\n      const src = this.#parts\n        .map(p => {\n          const [re, _, hasMagic, uflag] =\n            typeof p === 'string' ?\n              AST.#parseGlob(p, this.#hasMagic, noEmpty)\n            : p.toRegExpSource(allowDot)\n          this.#hasMagic = this.#hasMagic || hasMagic\n          this.#uflag = this.#uflag || uflag\n          return re\n        })\n        .join('')\n\n      let start = ''\n      if (this.isStart()) {\n        if (typeof this.#parts[0] === 'string') {\n          // this is the string that will match the start of the pattern,\n          // so we need to protect against dots and such.\n\n          // '.' and '..' cannot match unless the pattern is that exactly,\n          // even if it starts with . or dot:true is set.\n          const dotTravAllowed =\n            this.#parts.length === 1 && justDots.has(this.#parts[0])\n          if (!dotTravAllowed) {\n            const aps = addPatternStart\n            // check if we have a possibility of matching . or ..,\n            // and prevent that.\n            const needNoTrav =\n              // dots are allowed, and the pattern starts with [ or .\n              (dot && aps.has(src.charAt(0))) ||\n              // the pattern starts with \\., and then [ or .\n              (src.startsWith('\\\\.') && aps.has(src.charAt(2))) ||\n              // the pattern starts with \\.\\., and then [ or .\n              (src.startsWith('\\\\.\\\\.') && aps.has(src.charAt(4)))\n            // no need to prevent dots if it can't match a dot, or if a\n            // sub-pattern will be preventing it anyway.\n            const needNoDot = !dot && !allowDot && aps.has(src.charAt(0))\n\n            start =\n              needNoTrav ? startNoTraversal\n              : needNoDot ? startNoDot\n              : ''\n          }\n        }\n      }\n\n      // append the \"end of path portion\" pattern to negation tails\n      let end = ''\n      if (\n        this.isEnd() &&\n        this.#root.#filledNegs &&\n        this.#parent?.type === '!'\n      ) {\n        end = '(?:$|\\\\/)'\n      }\n      const final = start + src + end\n      return [\n        final,\n        unescape(src),\n        (this.#hasMagic = !!this.#hasMagic),\n        this.#uflag,\n      ]\n    }\n\n    // We need to calculate the body *twice* if it's a repeat pattern\n    // at the start, once in nodot mode, then again in dot mode, so a\n    // pattern like *(?) can match 'x.y'\n\n    const repeated = this.type === '*' || this.type === '+'\n    // some kind of extglob\n    const start = this.type === '!' ? '(?:(?!(?:' : '(?:'\n    let body = (this as AST & { type: ExtglobType }).#partsToRegExp(dot)\n\n    if (this.isStart() && this.isEnd() && !body && this.type !== '!') {\n      // invalid extglob, has to at least be *something* present, if it's\n      // the entire path portion.\n      const s = this.toString()\n      const me = this as AST\n      me.#parts = [s]\n      me.type = null\n      me.#hasMagic = undefined\n      return [s, unescape(this.toString()), false, false]\n    }\n\n    let bodyDotAllowed =\n      !repeated || allowDot || dot || !startNoDot ?\n        ''\n      : this.#partsToRegExp(true)\n    if (bodyDotAllowed === body) {\n      bodyDotAllowed = ''\n    }\n    if (bodyDotAllowed) {\n      body = `(?:${body})(?:${bodyDotAllowed})*?`\n    }\n\n    // an empty !() is exactly equivalent to a starNoEmpty\n    let final = ''\n    if (this.type === '!' && this.#emptyExt) {\n      final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty\n    } else {\n      const close =\n        this.type === '!' ?\n          // !() must match something,but !(x) can match ''\n          '))' +\n          (this.isStart() && !dot && !allowDot ? startNoDot : '') +\n          star +\n          ')'\n        : this.type === '@' ? ')'\n        : this.type === '?' ? ')?'\n        : this.type === '+' && bodyDotAllowed ? ')'\n        : this.type === '*' && bodyDotAllowed ? `)?`\n        : `)${this.type}`\n      final = start + body + close\n    }\n    return [\n      final,\n      unescape(body),\n      (this.#hasMagic = !!this.#hasMagic),\n      this.#uflag,\n    ]\n  }\n\n  #flatten() {\n    if (!isExtglobAST(this)) {\n      for (const p of this.#parts) {\n        if (typeof p === 'object') {\n          p.#flatten()\n        }\n      }\n    } else {\n      // do up to 10 passes to flatten as much as possible\n      let iterations = 0\n      let done = false\n      do {\n        done = true\n        for (let i = 0; i < this.#parts.length; i++) {\n          const c = this.#parts[i]\n          if (typeof c === 'object') {\n            c.#flatten()\n            if (this.#canAdopt(c)) {\n              done = false\n              this.#adopt(c, i)\n            } else if (this.#canAdoptWithSpace(c)) {\n              done = false\n              ;(this as AST & { type: ExtglobType }).#adoptWithSpace(c, i)\n            } else if (this.#canUsurp(c)) {\n              done = false\n              ;(this as AST & { type: ExtglobType }).#usurp(c)\n            }\n          }\n        }\n      } while (!done && ++iterations < 10)\n    }\n    this.#toString = undefined\n  }\n\n  #partsToRegExp(this: AST & { type: ExtglobType }, dot: boolean) {\n    return this.#parts\n      .map(p => {\n        // extglob ASTs should only contain parent ASTs\n        /* c8 ignore start */\n        if (typeof p === 'string') {\n          throw new Error('string type in extglob ast??')\n        }\n        /* c8 ignore stop */\n        // can ignore hasMagic, because extglobs are already always magic\n        const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot)\n        this.#uflag = this.#uflag || uflag\n        return re\n      })\n      .filter(p => !(this.isStart() && this.isEnd()) || !!p)\n      .join('|')\n  }\n\n  static #parseGlob(\n    glob: string,\n    hasMagic: boolean | undefined,\n    noEmpty: boolean = false,\n  ): [re: string, body: string, hasMagic: boolean, uflag: boolean] {\n    let escaping = false\n    let re = ''\n    let uflag = false\n    // multiple stars that aren't globstars coalesce into one *\n    let inStar = false\n    for (let i = 0; i < glob.length; i++) {\n      const c = glob.charAt(i)\n      if (escaping) {\n        escaping = false\n        re += (reSpecials.has(c) ? '\\\\' : '') + c\n        continue\n      }\n      if (c === '*') {\n        if (inStar) continue\n        inStar = true\n        re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star\n        hasMagic = true\n        continue\n      } else {\n        inStar = false\n      }\n      if (c === '\\\\') {\n        if (i === glob.length - 1) {\n          re += '\\\\\\\\'\n        } else {\n          escaping = true\n        }\n        continue\n      }\n      if (c === '[') {\n        const [src, needUflag, consumed, magic] = parseClass(glob, i)\n        if (consumed) {\n          re += src\n          uflag = uflag || needUflag\n          i += consumed - 1\n          hasMagic = hasMagic || magic\n          continue\n        }\n      }\n      if (c === '?') {\n        re += qmark\n        hasMagic = true\n        continue\n      }\n      re += regExpEscape(c)\n    }\n    return [re, unescape(glob), !!hasMagic, uflag]\n  }\n}\n"]}yx export type ParseClassResult = [
    src: string,
    uFlag: boolean,
    consumed: number,
    hasMagic: boolean
];
export declare const parseClass: (glob: string, position: number) => ParseClassResult;
//# sourceMappingURL=brace-expressions.d.ts.map6U˿x?{"version":3,"file":"brace-expressions.d.ts","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":"AAgCA,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,EAAE,MAAM;IACX,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,MAAM;IAChB,QAAQ,EAAE,OAAO;CAClB,CAAA;AAQD,eAAO,MAAM,UAAU,GACrB,MAAM,MAAM,EACZ,UAAU,MAAM,KACf,gBA2HF,CAAA"}]xo"use strict";
// translate the various posix character classes into unicode properties
// this works across all unicode locales
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseClass = void 0;
// { <posix class>: [<translation>, /u flag required, negated]
const posixClasses = {
    '[:alnum:]': ['\\p{L}\\p{Nl}\\p{Nd}', true],
    '[:alpha:]': ['\\p{L}\\p{Nl}', true],
    '[:ascii:]': ['\\x' + '00-\\x' + '7f', false],
    '[:blank:]': ['\\p{Zs}\\t', true],
    '[:cntrl:]': ['\\p{Cc}', true],
    '[:digit:]': ['\\p{Nd}', true],
    '[:graph:]': ['\\p{Z}\\p{C}', true, true],
    '[:lower:]': ['\\p{Ll}', true],
    '[:print:]': ['\\p{C}', true],
    '[:punct:]': ['\\p{P}', true],
    '[:space:]': ['\\p{Z}\\t\\r\\n\\v\\f', true],
    '[:upper:]': ['\\p{Lu}', true],
    '[:word:]': ['\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}', true],
    '[:xdigit:]': ['A-Fa-f0-9', false],
};
// only need to escape a few things inside of brace expressions
// escapes: [ \ ] -
const braceEscape = (s) => s.replace(/[[\]\\-]/g, '\\$&');
// escape all regexp magic characters
const regexpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
// everything has already been escaped, we just have to join
const rangesToString = (ranges) => ranges.join('');
// takes a glob string at a posix brace expression, and returns
// an equivalent regular expression source, and boolean indicating
// whether the /u flag needs to be applied, and the number of chars
// consumed to parse the character class.
// This also removes out of order ranges, and returns ($.) if the
// entire class just no good.
const parseClass = (glob, position) => {
    const pos = position;
    /* c8 ignore start */
    if (glob.charAt(pos) !== '[') {
        throw new Error('not in a brace expression');
    }
    /* c8 ignore stop */
    const ranges = [];
    const negs = [];
    let i = pos + 1;
    let sawStart = false;
    let uflag = false;
    let escaping = false;
    let negate = false;
    let endPos = pos;
    let rangeStart = '';
    WHILE: while (i < glob.length) {
        const c = glob.charAt(i);
        if ((c === '!' || c === '^') && i === pos + 1) {
            negate = true;
            i++;
            continue;
        }
        if (c === ']' && sawStart && !escaping) {
            endPos = i + 1;
            break;
        }
        sawStart = true;
        if (c === '\\') {
            if (!escaping) {
                escaping = true;
                i++;
                continue;
            }
            // escaped \ char, fall through and treat like normal char
        }
        if (c === '[' && !escaping) {
            // either a posix class, a collation equivalent, or just a [
            for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {
                if (glob.startsWith(cls, i)) {
                    // invalid, [a-[] is fine, but not [a-[:alpha]]
                    if (rangeStart) {
                        return ['$.', false, glob.length - pos, true];
                    }
                    i += cls.length;
                    if (neg)
                        negs.push(unip);
                    else
                        ranges.push(unip);
                    uflag = uflag || u;
                    continue WHILE;
                }
            }
        }
        // now it's just a normal character, effectively
        escaping = false;
        if (rangeStart) {
            // throw this range away if it's not valid, but others
            // can still match.
            if (c > rangeStart) {
                ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c));
            }
            else if (c === rangeStart) {
                ranges.push(braceEscape(c));
            }
            rangeStart = '';
            i++;
            continue;
        }
        // now might be the start of a range.
        // can be either c-d or c-] or c<more...>] or c] at this point
        if (glob.startsWith('-]', i + 1)) {
            ranges.push(braceEscape(c + '-'));
            i += 2;
            continue;
        }
        if (glob.startsWith('-', i + 1)) {
            rangeStart = c;
            i += 2;
            continue;
        }
        // not the start of a range, just a single character
        ranges.push(braceEscape(c));
        i++;
    }
    if (endPos < i) {
        // didn't see the end of the class, not a valid class,
        // but might still be valid as a literal match.
        return ['', false, 0, false];
    }
    // if we got no ranges and no negates, then we have a range that
    // cannot possibly match anything, and that poisons the whole glob
    if (!ranges.length && !negs.length) {
        return ['$.', false, glob.length - pos, true];
    }
    // if we got one positive range, and it's a single character, then that's
    // not actually a magic pattern, it's just that one literal character.
    // we should not treat that as "magic", we should just return the literal
    // character. [_] is a perfectly valid way to escape glob magic chars.
    if (negs.length === 0 &&
        ranges.length === 1 &&
        /^\\?.$/.test(ranges[0]) &&
        !negate) {
        const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0];
        return [regexpEscape(r), false, endPos - pos, false];
    }
    const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']';
    const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']';
    const comb = ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'
        : ranges.length ? sranges
            : snegs;
    return [comb, uflag, endPos - pos, true];
};
exports.parseClass = parseClass;
//# sourceMappingURL=brace-expressions.js.map@No̸xH){"version":3,"file":"brace-expressions.js","sourceRoot":"","sources":["../../src/brace-expressions.ts"],"names":[],"mappings":";AAAA,wEAAwE;AACxE,wCAAwC;;;AAExC,8DAA8D;AAC9D,MAAM,YAAY,GAChB;IACE,WAAW,EAAE,CAAC,sBAAsB,EAAE,IAAI,CAAC;IAC3C,WAAW,EAAE,CAAC,eAAe,EAAE,IAAI,CAAC;IACpC,WAAW,EAAE,CAAC,KAAK,GAAG,QAAQ,GAAG,IAAI,EAAE,KAAK,CAAC;IAC7C,WAAW,EAAE,CAAC,YAAY,EAAE,IAAI,CAAC;IACjC,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,WAAW,EAAE,CAAC,cAAc,EAAE,IAAI,EAAE,IAAI,CAAC;IACzC,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,WAAW,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC;IAC7B,WAAW,EAAE,CAAC,QAAQ,EAAE,IAAI,CAAC;IAC7B,WAAW,EAAE,CAAC,uBAAuB,EAAE,IAAI,CAAC;IAC5C,WAAW,EAAE,CAAC,SAAS,EAAE,IAAI,CAAC;IAC9B,UAAU,EAAE,CAAC,6BAA6B,EAAE,IAAI,CAAC;IACjD,Y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AAA;IAET,OAAO,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,GAAG,GAAG,EAAE,IAAI,CAAC,CAAA;AAC1C,CAAC,CAAA;AA9HY,QAAA,UAAU,cA8HtB","sourcesContent":["// translate the various posix character classes into unicode properties\n// this works across all unicode locales\n\n// { <posix class>: [<translation>, /u flag required, negated]\nconst posixClasses: { [k: string]: [e: string, u: boolean, n?: boolean] } =\n  {\n    '[:alnum:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}', true],\n    '[:alpha:]': ['\\\\p{L}\\\\p{Nl}', true],\n    '[:ascii:]': ['\\\\x' + '00-\\\\x' + '7f', false],\n    '[:blank:]': ['\\\\p{Zs}\\\\t', true],\n    '[:cntrl:]': ['\\\\p{Cc}', true],\n    '[:digit:]': ['\\\\p{Nd}', true],\n    '[:graph:]': ['\\\\p{Z}\\\\p{C}', true, true],\n    '[:lower:]': ['\\\\p{Ll}', true],\n    '[:print:]': ['\\\\p{C}', true],\n    '[:punct:]': ['\\\\p{P}', true],\n    '[:space:]': ['\\\\p{Z}\\\\t\\\\r\\\\n\\\\v\\\\f', true],\n    '[:upper:]': ['\\\\p{Lu}', true],\n    '[:word:]': ['\\\\p{L}\\\\p{Nl}\\\\p{Nd}\\\\p{Pc}', true],\n    '[:xdigit:]': ['A-Fa-f0-9', false],\n  }\n\n// only need to escape a few things inside of brace expressions\n// escapes: [ \\ ] -\nconst braceEscape = (s: string) => s.replace(/[[\\]\\\\-]/g, '\\\\$&')\n// escape all regexp magic characters\nconst regexpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\n// everything has already been escaped, we just have to join\nconst rangesToString = (ranges: string[]): string => ranges.join('')\n\nexport type ParseClassResult = [\n  src: string,\n  uFlag: boolean,\n  consumed: number,\n  hasMagic: boolean,\n]\n\n// takes a glob string at a posix brace expression, and returns\n// an equivalent regular expression source, and boolean indicating\n// whether the /u flag needs to be applied, and the number of chars\n// consumed to parse the character class.\n// This also removes out of order ranges, and returns ($.) if the\n// entire class just no good.\nexport const parseClass = (\n  glob: string,\n  position: number,\n): ParseClassResult => {\n  const pos = position\n  /* c8 ignore start */\n  if (glob.charAt(pos) !== '[') {\n    throw new Error('not in a brace expression')\n  }\n  /* c8 ignore stop */\n  const ranges: string[] = []\n  const negs: string[] = []\n\n  let i = pos + 1\n  let sawStart = false\n  let uflag = false\n  let escaping = false\n  let negate = false\n  let endPos = pos\n  let rangeStart = ''\n  WHILE: while (i < glob.length) {\n    const c = glob.charAt(i)\n    if ((c === '!' || c === '^') && i === pos + 1) {\n      negate = true\n      i++\n      continue\n    }\n\n    if (c === ']' && sawStart && !escaping) {\n      endPos = i + 1\n      break\n    }\n\n    sawStart = true\n    if (c === '\\\\') {\n      if (!escaping) {\n        escaping = true\n        i++\n        continue\n      }\n      // escaped \\ char, fall through and treat like normal char\n    }\n    if (c === '[' && !escaping) {\n      // either a posix class, a collation equivalent, or just a [\n      for (const [cls, [unip, u, neg]] of Object.entries(posixClasses)) {\n        if (glob.startsWith(cls, i)) {\n          // invalid, [a-[] is fine, but not [a-[:alpha]]\n          if (rangeStart) {\n            return ['$.', false, glob.length - pos, true]\n          }\n          i += cls.length\n          if (neg) negs.push(unip)\n          else ranges.push(unip)\n          uflag = uflag || u\n          continue WHILE\n        }\n      }\n    }\n\n    // now it's just a normal character, effectively\n    escaping = false\n    if (rangeStart) {\n      // throw this range away if it's not valid, but others\n      // can still match.\n      if (c > rangeStart) {\n        ranges.push(braceEscape(rangeStart) + '-' + braceEscape(c))\n      } else if (c === rangeStart) {\n        ranges.push(braceEscape(c))\n      }\n      rangeStart = ''\n      i++\n      continue\n    }\n\n    // now might be the start of a range.\n    // can be either c-d or c-] or c<more...>] or c] at this point\n    if (glob.startsWith('-]', i + 1)) {\n      ranges.push(braceEscape(c + '-'))\n      i += 2\n      continue\n    }\n    if (glob.startsWith('-', i + 1)) {\n      rangeStart = c\n      i += 2\n      continue\n    }\n\n    // not the start of a range, just a single character\n    ranges.push(braceEscape(c))\n    i++\n  }\n\n  if (endPos < i) {\n    // didn't see the end of the class, not a valid class,\n    // but might still be valid as a literal match.\n    return ['', false, 0, false]\n  }\n\n  // if we got no ranges and no negates, then we have a range that\n  // cannot possibly match anything, and that poisons the whole glob\n  if (!ranges.length && !negs.length) {\n    return ['$.', false, glob.length - pos, true]\n  }\n\n  // if we got one positive range, and it's a single character, then that's\n  // not actually a magic pattern, it's just that one literal character.\n  // we should not treat that as \"magic\", we should just return the literal\n  // character. [_] is a perfectly valid way to escape glob magic chars.\n  if (\n    negs.length === 0 &&\n    ranges.length === 1 &&\n    /^\\\\?.$/.test(ranges[0]) &&\n    !negate\n  ) {\n    const r = ranges[0].length === 2 ? ranges[0].slice(-1) : ranges[0]\n    return [regexpEscape(r), false, endPos - pos, false]\n  }\n\n  const sranges = '[' + (negate ? '^' : '') + rangesToString(ranges) + ']'\n  const snegs = '[' + (negate ? '' : '^') + rangesToString(negs) + ']'\n  const comb =\n    ranges.length && negs.length ? '(' + sranges + '|' + snegs + ')'\n    : ranges.length ? sranges\n    : snegs\n\n  return [comb, uflag, endPos - pos, true]\n}\n"]}Kr0ximport type { MinimatchOptions } from './index.js';
/**
 * Escape all magic characters in a glob pattern.
 *
 * If the {@link MinimatchOptions.windowsPathsNoEscape}
 * option is used, then characters are escaped by wrapping in `[]`, because
 * a magic character wrapped in a character class can only be satisfied by
 * that exact character.  In this mode, `\` is _not_ escaped, because it is
 * not interpreted as a magic character, but instead as a path separator.
 *
 * If the {@link MinimatchOptions.magicalBraces} option is used,
 * then braces (`{` and `}`) will be escaped.
 */
export declare const escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
//# sourceMappingURL=escape.d.ts.mapix"{"version":3,"file":"unescape.d.ts","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAElD;;;;;;;;;;;;;;;;;;GAkBG;AAEH,eAAO,MAAM,QAAQ,GACnB,GAAG,MAAM,EACT,2CAGG,IAAI,CAAC,gBAAgB,EAAE,sBAAsB,GAAG,eAAe,CAAM,WAczE,CAAA"}vR/x8 3LbGAWG;AACH,eAAO,MAAM,MAAM,GACjE
azE,CAAA"}~Nx"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.escape = void 0;
/**
 * Escape all magic characters in a glob pattern.
 *
 * If the {@link MinimatchOptions.windowsPathsNoEscape}
 * option is used, then characters are escaped by wrapping in `[]`, because
 * a magic character wrapped in a character class can only be satisfied by
 * that exact character.  In this mode, `\` is _not_ escaped, because it is
 * not interpreted as a magic character, but instead as a path separator.
 *
 * If the {@link MinimatchOptions.magicalBraces} option is used,
 * then braces (`{` and `}`) will be escaped.
 */
const escape = (s, { windowsPathsNoEscape = false, magicalBraces = false, } = {}) => {
    // don't need to escape +@! because we escape the parens
    // that make those magic, and escaping ! as [!] isn't valid,
    // because [!]] is a valid glob class meaning not ']'.
    if (magicalBraces) {
        return windowsPathsNoEscape ?
            s.replace(/[?*()[\]{}]/g, '[$&]')
            : s.replace(/[?*()[\]\\{}]/g, '\\$&');
    }
    return windowsPathsNoEscape ?
        s.replace(/[?*()[\]]/g, '[$&]')
        : s.replace(/[?*()[\]\\]/g, '\\$&');
};
exports.escape = escape;
//# sourceMappingURL=escape.js.mapIֲvxb{"version":3,"file":"escape.js","sourceRoot":"","sources":["../../src/escape.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;GAWG;AACI,MAAM,MAAM,GAAG,CACpB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,KAAK,MAC+C,EAAE,EACxE,EAAE;IACF,wDAAwD;IACxD,4DAA4D;IAC5D,sDAAsD;IACtD,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC,CAAC;YACzB,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC;YACnC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,EAAE,MAAM,CAAC,CAAA;IACzC,CAAC;IACD,OAAO,oBAAoB,CAAC,CAAC;QACzB,CAAC,CAAC,OAAO,CAAC,YAAY,EAAE,MAAM,CAAC;QACjC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,EAAE,MAAM,CAAC,CAAA;AACvC,CAAC,CAAA;AAlBY,QAAA,MAAM,UAkBlB","sourcesContent":["import type { MinimatchOptions } from './index.js'\n\n/**\n * Escape all magic characters in a glob pattern.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape}\n * option is used, then characters are escaped by wrapping in `[]`, because\n * a magic character wrapped in a character class can only be satisfied by\n * that exact character.  In this mode, `\\` is _not_ escaped, because it is\n * not interpreted as a magic character, but instead as a path separator.\n *\n * If the {@link MinimatchOptions.magicalBraces} option is used,\n * then braces (`{` and `}`) will be escaped.\n */\nexport const escape = (\n  s: string,\n  {\n    windowsPathsNoEscape = false,\n    magicalBraces = false,\n  }: Pick<MinimatchOptions, 'windowsPathsNoEscape' | 'magicalBraces'> = {},\n) => {\n  // don't need to escape +@! because we escape the parens\n  // that make those magic, and escaping ! as [!] isn't valid,\n  // because [!]] is a valid glob class meaning not ']'.\n  if (magicalBraces) {\n    return windowsPathsNoEscape ?\n        s.replace(/[?*()[\\]{}]/g, '[$&]')\n      : s.replace(/[?*()[\\]\\\\{}]/g, '\\\\$&')\n  }\n  return windowsPathsNoEscape ?\n      s.replace(/[?*()[\\]]/g, '[$&]')\n    : s.replace(/[?*()[\\]\\\\]/g, '\\\\$&')\n}\n"]}zRRx?import { AST } from './ast.js';
export type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd';
export interface MinimatchOptions {
    /** do not expand `{x,y}` style braces */
    nobrace?: boolean;
    /** do not treat patterns starting with `#` as a comment */
    nocomment?: boolean;
    /** do not treat patterns starting with `!` as a negation */
    nonegate?: boolean;
    /** print LOTS of debugging output */
    debug?: boolean;
    /** treat `**` the same as `*` */
    noglobstar?: boolean;
    /** do not expand extglobs like `+(a|b)` */
    noext?: boolean;
    /** return the pattern if nothing matches */
    nonull?: boolean;
    /** treat `\\` as a path separator, not an escape character */
    windowsPathsNoEscape?: boolean;
    /**
     * inverse of {@link MinimatchOptions.windowsPathsNoEscape}
     * @deprecated
     */
    allowWindowsEscape?: boolean;
    /**
     * Compare a partial path to a pattern. As long as the parts
     * of the path that are present are not contradicted by the
     * pattern, it will be treated as a match. This is useful in
     * applications where you're walking through a folder structure,
     * and don't yet have the full path, but want to ensure that you
     * do not walk down paths that can never be a match.
     */
    partial?: boolean;
    /** allow matches that start with `.` even if the pattern does not */
    dot?: boolean;
    /** ignore case */
    nocase?: boolean;
    /** ignore case only in wildcard patterns */
    nocaseMagicOnly?: boolean;
    /** consider braces to be "magic" for the purpose of `hasMagic` */
    magicalBraces?: boolean;
    /**
     * If set, then patterns without slashes will be matched
     * against the basename of the path if it contains slashes.
     * For example, `a?b` would match the path `/xyz/123/acb`, but
     * not `/xyz/acb/123`.
     */
    matchBase?: boolean;
    /** invert the results of negated matches */
    flipNegate?: boolean;
    /** do not collapse multiple `/` into a single `/` */
    preserveMultipleSlashes?: boolean;
    /**
     * A number indicating the level of optimization that should be done
     * to the pattern prior to parsing and using it for matches.
     */
    optimizationLevel?: number;
    /** operating system platform */
    platform?: Platform;
    /**
     * When a pattern starts with a UNC path or drive letter, and in
     * `nocase:true` mode, do not convert the root portions of the
     * pattern into a case-insensitive regular expression, and instead
     * leave them as strings.
     *
     * This is the default when the platform is `win32` and
     * `nocase:true` is set.
     */
    windowsNoMagicRoot?: boolean;
    /**
     * max number of `{...}` patterns to expand. Default 100_000.
     */
    braceExpandMax?: number;
    /**
     * Max number of non-adjacent `**` patterns to recursively walk down.
     *
     * The default of 200 is almost certainly high enough for most purposes,
     * and can handle absurdly excessive patterns.
     */
    maxGlobstarRecursion?: number;
    /**
     * Max depth to traverse for nested extglobs like `*(a|b|c)`
     *
     * Default is 2, which is quite low, but any higher value
     * swiftly results in punishing performance impacts. Note
     * that this is *not*  relevant when the globstar types can
     * be safely coalesced into a single set.
     *
     * For example, `*(a|@(b|c)|d)` would be flattened into
     * `*(a|b|c|d)`. Thus, many common extglobs will retain good
     * performance and  never hit this limit, even if they are
     * excessively deep and complicated.
     *
     * If the limit is hit, then the extglob characters are simply
     * not parsed, and the pattern effectively switches into
     * `noextglob: true` mode for the contents of that nested
     * sub-pattern. This will typically _not_ result in a match,
     * but is considered a valid trade-off for security and
     * performance.
     */
    maxExtglobRecursion?: number;
}
export declare const minimatch: {
    (p: string, pattern: string, options?: MinimatchOptions): boolean;
    sep: Sep;
    GLOBSTAR: typeof GLOBSTAR;
    filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
    defaults: (def: MinimatchOptions) => typeof minimatch;
    braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
    makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
    match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
    AST: typeof AST;
    Minimatch: typeof Minimatch;
    escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
    unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
};
export type Sep = '\\' | '/';
export declare const sep: Sep;
export declare const GLOBSTAR: unique symbol;
export declare const filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
export declare const defaults: (def: MinimatchOptions) => typeof minimatch;
export declare const braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
export declare const makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
export declare const match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
export type MMRegExp = RegExp & {
    _src?: string;
    _glob?: string;
};
export type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR;
export type ParseReturn = ParseReturnFiltered | false;
export declare class Minimatch {
    #private;
    options: MinimatchOptions;
    set: ParseReturnFiltered[][];
    pattern: string;
    windowsPathsNoEscape: boolean;
    nonegate: boolean;
    negate: boolean;
    comment: boolean;
    empty: boolean;
    preserveMultipleSlashes: boolean;
    partial: boolean;
    globSet: string[];
    globParts: string[][];
    nocase: boolean;
    isWindows: boolean;
    platform: Platform;
    windowsNoMagicRoot: boolean;
    maxGlobstarRecursion: number;
    regexp: false | null | MMRegExp;
    constructor(pattern: string, options?: MinimatchOptions);
    hasMagic(): boolean;
    debug(..._: unknown[]): void;
    make(): void;
    preprocess(globParts: string[][]): string[][];
    adjascentGlobstarOptimize(globParts: string[][]): string[][];
    levelOneOptimize(globParts: string[][]): string[][];
    levelTwoFileOptimize(parts: string | string[]): string[];
    firstPhasePreProcess(globParts: string[][]): string[][];
    secondPhasePreProcess(globParts: string[][]): string[][];
    partsMatch(a: string[], b: string[], emptyGSMatch?: boolean): false | string[];
    parseNegate(): void;
    matchOne(file: string[], pattern: ParseReturn[], partial?: boolean): boolean;
    braceExpand(): string[];
    parse(pattern: string): ParseReturn;
    makeRe(): false | MMRegExp;
    slashSplit(p: string): string[];
    match(f: string, partial?: boolean): boolean;
    static defaults(def: MinimatchOptions): typeof Minimatch;
}
export { AST } from './ast.js';
export { escape } from './escape.js';
export { unescape } from './unescape.js';
//# sourceMappingURL=index.d.ts.map9qxu{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAI9B,MAAM,MAAM,QAAQ,GAChB,KAAK,GACL,SAAS,GACT,QAAQ,GACR,SAAS,GACT,OAAO,GACP,OAAO,GACP,SAAS,GACT,OAAO,GACP,OAAO,GACP,QAAQ,GACR,QAAQ,CAAA;AAEZ,MAAM,WAAW,gBAAgB;IAC/B,yCAAyC;IACzC,OA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AG,WAAW;IA6CnC,MAAM;IAuGN,UAAU,CAAC,CAAC,EAAE,MAAM;IAepB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,UAAe;IAgEvC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,gBAAgB;CAGtC;AAED,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA"}BxTO"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.unescape = exports.escape = exports.AST = exports.Minimatch = exports.match = exports.makeRe = exports.braceExpand = exports.defaults = exports.filter = exports.GLOBSTAR = exports.sep = exports.minimatch = void 0;
const brace_expansion_1 = require("brace-expansion");
const assert_valid_pattern_js_1 = require("./assert-valid-pattern.js");
const ast_js_1 = require("./ast.js");
const escape_js_1 = require("./escape.js");
const unescape_js_1 = require("./unescape.js");
const minimatch = (p, pattern, options = {}) => {
    (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
    // shortcut: comments match nothing.
    if (!options.nocomment && pattern.charAt(0) === '#') {
        return false;
    }
    return new Minimatch(pattern, options).match(p);
};
exports.minimatch = minimatch;
// Optimized checking for the most common glob patterns.
const starDotExtRE = /^\*+([^+@!?*[(]*)$/;
const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);
const starDotExtTestDot = (ext) => (f) => f.endsWith(ext);
const starDotExtTestNocase = (ext) => {
    ext = ext.toLowerCase();
    return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext);
};
const starDotExtTestNocaseDot = (ext) => {
    ext = ext.toLowerCase();
    return (f) => f.toLowerCase().endsWith(ext);
};
const starDotStarRE = /^\*+\.\*+$/;
const starDotStarTest = (f) => !f.startsWith('.') && f.includes('.');
const starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.');
const dotStarRE = /^\.\*+$/;
const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');
const starRE = /^\*+$/;
const starTest = (f) => f.length !== 0 && !f.startsWith('.');
const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';
const qmarksRE = /^\?+([^+@!?*[(]*)?$/;
const qmarksTestNocase = ([$0, ext = '']) => {
    const noext = qmarksTestNoExt([$0]);
    if (!ext)
        return noext;
    ext = ext.toLowerCase();
    return (f) => noext(f) && f.toLowerCase().endsWith(ext);
};
const qmarksTestNocaseDot = ([$0, ext = '']) => {
    const noext = qmarksTestNoExtDot([$0]);
    if (!ext)
        return noext;
    ext = ext.toLowerCase();
    return (f) => noext(f) && f.toLowerCase().endsWith(ext);
};
const qmarksTestDot = ([$0, ext = '']) => {
    const noext = qmarksTestNoExtDot([$0]);
    return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
};
const qmarksTest = ([$0, ext = '']) => {
    const noext = qmarksTestNoExt([$0]);
    return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
};
const qmarksTestNoExt = ([$0]) => {
    const len = $0.length;
    return (f) => f.length === len && !f.startsWith('.');
};
const qmarksTestNoExtDot = ([$0]) => {
    const len = $0.length;
    return (f) => f.length === len && f !== '.' && f !== '..';
};
/* c8 ignore start */
const defaultPlatform = (typeof process === 'object' && process ?
    (typeof process.env === 'object' &&
        process.env &&
        process.env.__MINIMATCH_TESTING_PLATFORM__) ||
        process.platform
    : 'posix');
const path = {
    win32: { sep: '\\' },
    posix: { sep: '/' },
};
/* c8 ignore stop */
exports.sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep;
exports.minimatch.sep = exports.sep;
exports.GLOBSTAR = Symbol('globstar **');
exports.minimatch.GLOBSTAR = exports.GLOBSTAR;
// any single thing other than /
// don't need to escape / when using new RegExp()
const qmark = '[^/]';
// * => any number of characters
const star = qmark + '*?';
// ** when dots are allowed.  Anything goes, except .. and .
// not (^ or / followed by one or two dots followed by $ or /),
// followed by anything, any number of times.
const twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?';
// not a ^ or / followed by a dot,
// followed by anything, any number of times.
const twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?';
const filter = (pattern, options = {}) => (p) => (0, exports.minimatch)(p, pattern, options);
exports.filter = filter;
exports.minimatch.filter = exports.filter;
const ext = (a, b = {}) => Object.assign({}, a, b);
const defaults = (def) => {
    if (!def || typeof def !== 'object' || !Object.keys(def).length) {
        return exports.minimatch;
    }
    const orig = exports.minimatch;
    const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
    return Object.assign(m, {
        Minimatch: class Minimatch extends orig.Minimatch {
            constructor(pattern, options = {}) {
                super(pattern, ext(def, options));
            }
            static defaults(options) {
                return orig.defaults(ext(def, options)).Minimatch;
            }
        },
        AST: class AST extends orig.AST {
            /* c8 ignore start */
            constructor(type, parent, options = {}) {
                super(type, parent, ext(def, options));
            }
            /* c8 ignore stop */
            static fromGlob(pattern, options = {}) {
                return orig.AST.fromGlob(pattern, ext(def, options));
            }
        },
        unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
        escape: (s, options = {}) => orig.escape(s, ext(def, options)),
        filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
        defaults: (options) => orig.defaults(ext(def, options)),
        makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
        braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
        match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
        sep: orig.sep,
        GLOBSTAR: exports.GLOBSTAR,
    });
};
exports.defaults = defaults;
exports.minimatch.defaults = exports.defaults;
// Brace expansion:
// a{b,c}d -> abd acd
// a{b,}c -> abc ac
// a{0..3}d -> a0d a1d a2d a3d
// a{b,c{d,e}f}g -> abg acdfg acefg
// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
//
// Invalid sets are not expanded.
// a{2..}b -> a{2..}b
// a{b}c -> a{b}c
const braceExpand = (pattern, options = {}) => {
    (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
    // Thanks to Yeting Li <https://github.com/yetingli> for
    // improving this regexp to avoid a ReDOS vulnerability.
    if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
        // shortcut. no need to expand.
        return [pattern];
    }
    return (0, brace_expansion_1.expand)(pattern, { max: options.braceExpandMax });
};
exports.braceExpand = braceExpand;
exports.minimatch.braceExpand = exports.braceExpand;
// parse a component of the expanded set.
// At this point, no pattern may contain "/" in it
// so we're going to return a 2d array, where each entry is the full
// pattern, split on '/', and then turned into a regular expression.
// A regexp is made at the end which joins each array with an
// escaped /, and another full one which joins each regexp with |.
//
// Following the lead of Bash 4.1, note that "**" only has special meaning
// when it is the *only* thing in a path portion.  Otherwise, any series
// of * is equivalent to a single *.  Globstar behavior is enabled by
// default, and can be disabled by setting options.noglobstar.
const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
exports.makeRe = makeRe;
exports.minimatch.makeRe = exports.makeRe;
const match = (list, pattern, options = {}) => {
    const mm = new Minimatch(pattern, options);
    list = list.filter(f => mm.match(f));
    if (mm.options.nonull && !list.length) {
        list.push(pattern);
    }
    return list;
};
exports.match = match;
exports.minimatch.match = exports.match;
// replace stuff like \* with *
const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
class Minimatch {
    options;
    set;
    pattern;
    windowsPathsNoEscape;
    nonegate;
    negate;
    comment;
    empty;
    preserveMultipleSlashes;
    partial;
    globSet;
    globParts;
    nocase;
    isWindows;
    platform;
    windowsNoMagicRoot;
    maxGlobstarRecursion;
    regexp;
    constructor(pattern, options = {}) {
        (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
        options = options || {};
        this.options = options;
        this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;
        this.pattern = pattern;
        this.platform = options.platform || defaultPlatform;
        this.isWindows = this.platform === 'win32';
        // avoid the annoying deprecation flag lol
        const awe = ('allowWindow' + 'sEscape');
        this.windowsPathsNoEscape =
            !!options.windowsPathsNoEscape || options[awe] === false;
        if (this.windowsPathsNoEscape) {
            this.pattern = this.pattern.replace(/\\/g, '/');
        }
        this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
        this.regexp = null;
        this.negate = false;
        this.nonegate = !!options.nonegate;
        this.comment = false;
        this.empty = false;
        this.partial = !!options.partial;
        this.nocase = !!this.options.nocase;
        this.windowsNoMagicRoot =
            options.windowsNoMagicRoot !== undefined ?
                options.windowsNoMagicRoot
                : !!(this.isWindows && this.nocase);
        this.globSet = [];
        this.globParts = [];
        this.set = [];
        // make the set of regexps etc.
        this.make();
    }
    hasMagic() {
        if (this.options.magicalBraces && this.set.length > 1) {
            return true;
        }
        for (const pattern of this.set) {
            for (const part of pattern) {
                if (typeof part !== 'string')
                    return true;
            }
        }
        return false;
    }
    debug(..._) { }
    make() {
        const pattern = this.pattern;
        const options = this.options;
        // empty patterns and comments match nothing.
        if (!options.nocomment && pattern.charAt(0) === '#') {
            this.comment = true;
            return;
        }
        if (!pattern) {
            this.empty = true;
            return;
        }
        // step 1: figure out negation, etc.
        this.parseNegate();
        // step 2: expand braces
        this.globSet = [...new Set(this.braceExpand())];
        if (options.debug) {
            //oxlint-disable-next-line no-console
            this.debug = (...args) => console.error(...args);
        }
        this.debug(this.pattern, this.globSet);
        // step 3: now we have a set, so turn each one into a series of
        // path-portion matching patterns.
        // These will be regexps, except in the case of "**", which is
        // set to the GLOBSTAR object for globstar behavior,
        // and will not contain any / characters
        //
        // First, we preprocess to make the glob pattern sets a bit simpler
        // and deduped.  There are some perf-killing patterns that can cause
        // problems with a glob walk, but we can simplify them down a bit.
        const rawGlobParts = this.globSet.map(s => this.slashSplit(s));
        this.globParts = this.preprocess(rawGlobParts);
        this.debug(this.pattern, this.globParts);
        // glob --> regexps
        let set = this.globParts.map((s, _, __) => {
            if (this.isWindows && this.windowsNoMagicRoot) {
                // check if it's a drive or unc path.
                const isUNC = s[0] === '' &&
                    s[1] === '' &&
                    (s[2] === '?' || !globMagic.test(s[2])) &&
                    !globMagic.test(s[3]);
                const isDrive = /^[a-z]:/i.test(s[0]);
                if (isUNC) {
                    return [
                        ...s.slice(0, 4),
                        ...s.slice(4).map(ss => this.parse(ss)),
                    ];
                }
                else if (isDrive) {
                    return [s[0], ...s.slice(1).map(ss => this.parse(ss))];
                }
            }
            return s.map(ss => this.parse(ss));
        });
        this.debug(this.pattern, set);
        // filter out everything that didn't compile properly.
        this.set = set.filter(s => s.indexOf(false) === -1);
        // do not treat the ? in UNC paths as magic
        if (this.isWindows) {
            for (let i = 0; i < this.set.length; i++) {
                const p = this.set[i];
                if (p[0] === '' &&
                    p[1] === '' &&
                    this.globParts[i][2] === '?' &&
                    typeof p[3] === 'string' &&
                    /^[a-z]:$/i.test(p[3])) {
                    p[2] = '?';
                }
            }
        }
        this.debug(this.pattern, this.set);
    }
    // various transforms to equivalent pattern sets that are
    // faster to process in a filesystem walk.  The goal is to
    // eliminate what we can, and push all ** patterns as far
    // to the right as possible, even if it increases the number
    // of patterns that we have to process.
    preprocess(globParts) {
        // if we're not in globstar mode, then turn ** into *
        if (this.options.noglobstar) {
            for (const partset of globParts) {
                for (let j = 0; j < partset.length; j++) {
                    if (partset[j] === '**') {
                        partset[j] = '*';
                    }
                }
            }
        }
        const { optimizationLevel = 1 } = this.options;
        if (optimizationLevel >= 2) {
            // aggressive optimization for the purpose of fs walking
            globParts = this.firstPhasePreProcess(globParts);
            globParts = this.secondPhasePreProcess(globParts);
        }
        else if (optimizationLevel >= 1) {
            // just basic optimizations to remove some .. parts
            globParts = this.levelOneOptimize(globParts);
        }
        else {
            // just collapse multiple ** portions into one
            globParts = this.adjascentGlobstarOptimize(globParts);
        }
        return globParts;
    }
    // just get rid of adjascent ** portions
    adjascentGlobstarOptimize(globParts) {
        return globParts.map(parts => {
            let gs = -1;
            while (-1 !== (gs = parts.indexOf('**', gs + 1))) {
                let i = gs;
                while (parts[i + 1] === '**') {
                    i++;
                }
                if (i !== gs) {
                    parts.splice(gs, i - gs);
                }
            }
            return parts;
        });
    }
    // get rid of adjascent ** and resolve .. portions
    levelOneOptimize(globParts) {
        return globParts.map(parts => {
            parts = parts.reduce((set, part) => {
                const prev = set[set.length - 1];
                if (part === '**' && prev === '**') {
                    return set;
                }
                if (part === '..') {
                    if (prev && prev !== '..' && prev !== '.' && prev !== '**') {
                        set.pop();
                        return set;
                    }
                }
                set.push(part);
                return set;
            }, []);
            return parts.length === 0 ? [''] : parts;
        });
    }
    levelTwoFileOptimize(parts) {
        if (!Array.isArray(parts)) {
            parts = this.slashSplit(parts);
        }
        let didSomething = false;
        do {
            didSomething = false;
            // <pre>/<e>/<rest> -> <pre>/<rest>
            if (!this.preserveMultipleSlashes) {
                for (let i = 1; i < parts.length - 1; i++) {
                    const p = parts[i];
                    // don't squeeze out UNC patterns
                    if (i === 1 && p === '' && parts[0] === '')
                        continue;
                    if (p === '.' || p === '') {
                        didSomething = true;
                        parts.splice(i, 1);
                        i--;
                    }
                }
                if (parts[0] === '.' &&
                    parts.length === 2 &&
                    (parts[1] === '.' || parts[1] === '')) {
                    didSomething = true;
                    parts.pop();
                }
            }
            // <pre>/<p>/../<rest> -> <pre>/<rest>
            let dd = 0;
            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
                const p = parts[dd - 1];
                if (p &&
                    p !== '.' &&
                    p !== '..' &&
                    p !== '**' &&
                    !(this.isWindows && /^[a-z]:$/i.test(p))) {
                    didSomething = true;
                    parts.splice(dd - 1, 2);
                    dd -= 2;
                }
            }
        } while (didSomething);
        return parts.length === 0 ? [''] : parts;
    }
    // First phase: single-pattern processing
    // <pre> is 1 or more portions
    // <rest> is 1 or more portions
    // <p> is any portion other than ., .., '', or **
    // <e> is . or ''
    //
    // **/.. is *brutal* for filesystem walking performance, because
    // it effectively resets the recursive walk each time it occurs,
    // and ** cannot be reduced out by a .. pattern part like a regexp
    // or most strings (other than .., ., and '') can be.
    //
    // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
    // <pre>/<e>/<rest> -> <pre>/<rest>
    // <pre>/<p>/../<rest> -> <pre>/<rest>
    // **/**/<rest> -> **/<rest>
    //
    // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
    // this WOULD be allowed if ** did follow symlinks, or * didn't
    firstPhasePreProcess(globParts) {
        let didSomething = false;
        do {
            didSomething = false;
            // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
            for (let parts of globParts) {
                let gs = -1;
                while (-1 !== (gs = parts.indexOf('**', gs + 1))) {
                    let gss = gs;
                    while (parts[gss + 1] === '**') {
                        // <pre>/**/**/<rest> -> <pre>/**/<rest>
                        gss++;
                    }
                    // eg, if gs is 2 and gss is 4, that means we have 3 **
                    // parts, and can remove 2 of them.
                    if (gss > gs) {
                        parts.splice(gs + 1, gss - gs);
                    }
                    let next = parts[gs + 1];
                    const p = parts[gs + 2];
                    const p2 = parts[gs + 3];
                    if (next !== '..')
                        continue;
                    if (!p ||
                        p === '.' ||
                        p === '..' ||
                        !p2 ||
                        p2 === '.' ||
                        p2 === '..') {
                        continue;
                    }
                    didSomething = true;
                    // edit parts in place, and push the new one
                    parts.splice(gs, 1);
                    const other = parts.slice(0);
                    other[gs] = '**';
                    globParts.push(other);
                    gs--;
                }
                // <pre>/<e>/<rest> -> <pre>/<rest>
                if (!this.preserveMultipleSlashes) {
                    for (let i = 1; i < parts.length - 1; i++) {
                        const p = parts[i];
                        // don't squeeze out UNC patterns
                        if (i === 1 && p === '' && parts[0] === '')
                            continue;
                        if (p === '.' || p === '') {
                            didSomething = true;
                            parts.splice(i, 1);
                            i--;
                        }
                    }
                    if (parts[0] === '.' &&
                        parts.length === 2 &&
                        (parts[1] === '.' || parts[1] === '')) {
                        didSomething = true;
                        parts.pop();
                    }
                }
                // <pre>/<p>/../<rest> -> <pre>/<rest>
                let dd = 0;
                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
                    const p = parts[dd - 1];
                    if (p && p !== '.' && p !== '..' && p !== '**') {
                        didSomething = true;
                        const needDot = dd === 1 && parts[dd + 1] === '**';
                        const splin = needDot ? ['.'] : [];
                        parts.splice(dd - 1, 2, ...splin);
                        if (parts.length === 0)
                            parts.push('');
                        dd -= 2;
                    }
                }
            }
        } while (didSomething);
        return globParts;
    }
    // second phase: multi-pattern dedupes
    // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
    // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
    // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
    //
    // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
    // ^-- not valid because ** doens't follow symlinks
    secondPhasePreProcess(globParts) {
        for (let i = 0; i < globParts.length - 1; i++) {
            for (let j = i + 1; j < globParts.length; j++) {
                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
                if (matched) {
                    globParts[i] = [];
                    globParts[j] = matched;
                    break;
                }
            }
        }
        return globParts.filter(gs => gs.length);
    }
    partsMatch(a, b, emptyGSMatch = false) {
        let ai = 0;
        let bi = 0;
        let result = [];
        let which = '';
        while (ai < a.length && bi < b.length) {
            if (a[ai] === b[bi]) {
                result.push(which === 'b' ? b[bi] : a[ai]);
                ai++;
                bi++;
            }
            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
                result.push(a[ai]);
                ai++;
            }
            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
                result.push(b[bi]);
                bi++;
            }
            else if (a[ai] === '*' &&
                b[bi] &&
                (this.options.dot || !b[bi].startsWith('.')) &&
                b[bi] !== '**') {
                if (which === 'b')
                    return false;
                which = 'a';
                result.push(a[ai]);
                ai++;
                bi++;
            }
            else if (b[bi] === '*' &&
                a[ai] &&
                (this.options.dot || !a[ai].startsWith('.')) &&
                a[ai] !== '**') {
                if (which === 'a')
                    return false;
                which = 'b';
                result.push(b[bi]);
                ai++;
                bi++;
            }
            else {
                return false;
            }
        }
        // if we fall out of the loop, it means they two are identical
        // as long as their lengths match
        return a.length === b.length && result;
    }
    parseNegate() {
        if (this.nonegate)
            return;
        const pattern = this.pattern;
        let negate = false;
        let negateOffset = 0;
        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
            negate = !negate;
            negateOffset++;
        }
        if (negateOffset)
            this.pattern = pattern.slice(negateOffset);
        this.negate = negate;
    }
    // set partial to true to test if, for example,
    // "/a/b" matches the start of "/*/b/*/d"
    // Partial means, if you run out of file before you run
    // out of pattern, then that's fine, as long as all
    // the parts match.
    matchOne(file, pattern, partial = false) {
        let fileStartIndex = 0;
        let patternStartIndex = 0;
        // UNC paths like //?/X:/... can match X:/... and vice versa
        // Drive letters in absolute drive or unc paths are always compared
        // case-insensitively.
        if (this.isWindows) {
            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
            const fileUNC = !fileDrive &&
                file[0] === '' &&
                file[1] === '' &&
                file[2] === '?' &&
                /^[a-z]:$/i.test(file[3]);
            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
            const patternUNC = !patternDrive &&
                pattern[0] === '' &&
                pattern[1] === '' &&
                pattern[2] === '?' &&
                typeof pattern[3] === 'string' &&
                /^[a-z]:$/i.test(pattern[3]);
            const fdi = fileUNC ? 3
                : fileDrive ? 0
                    : undefined;
            const pdi = patternUNC ? 3
                : patternDrive ? 0
                    : undefined;
            if (typeof fdi === 'number' && typeof pdi === 'number') {
                const [fd, pd] = [
                    file[fdi],
                    pattern[pdi],
                ];
                // start matching at the drive letter index of each
                if (fd.toLowerCase() === pd.toLowerCase()) {
                    pattern[pdi] = fd;
                    patternStartIndex = pdi;
                    fileStartIndex = fdi;
                }
            }
        }
        // resolve and reduce . and .. portions in the file as well.
        // don't need to do the second phase, because it's only one string[]
        const { optimizationLevel = 1 } = this.options;
        if (optimizationLevel >= 2) {
            file = this.levelTwoFileOptimize(file);
        }
        if (pattern.includes(exports.GLOBSTAR)) {
            return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
        }
        return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
    }
    #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
        // split the pattern into head, tail, and middle of ** delimited parts
        const firstgs = pattern.indexOf(exports.GLOBSTAR, patternIndex);
        const lastgs = pattern.lastIndexOf(exports.GLOBSTAR);
        // split the pattern up into globstar-delimited sections
        // the tail has to be at the end, and the others just have
        // to be found in order from the head.
        const [head, body, tail] = partial ?
            [
                pattern.slice(patternIndex, firstgs),
                pattern.slice(firstgs + 1),
                [],
            ]
            : [
                pattern.slice(patternIndex, firstgs),
                pattern.slice(firstgs + 1, lastgs),
                pattern.slice(lastgs + 1),
            ];
        // check the head, from the current file/pattern index.
        if (head.length) {
            const fileHead = file.slice(fileIndex, fileIndex + head.length);
            if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
                return false;
            }
            fileIndex += head.length;
            patternIndex += head.length;
        }
        // now we know the head matches!
        // if the last portion is not empty, it MUST match the end
        // check the tail
        let fileTailMatch = 0;
        if (tail.length) {
            // if head + tail > file, then we cannot possibly match
            if (tail.length + fileIndex > file.length)
                return false;
            // try to match the tail
            let tailStart = file.length - tail.length;
            if (this.#matchOne(file, tail, partial, tailStart, 0)) {
                fileTailMatch = tail.length;
            }
            else {
                // affordance for stuff like a/**/* matching a/b/
                // if the last file portion is '', and there's more to the pattern
                // then try without the '' bit.
                if (file[file.length - 1] !== '' ||
                    fileIndex + tail.length === file.length) {
                    return false;
                }
                tailStart--;
                if (!this.#matchOne(file, tail, partial, tailStart, 0)) {
                    return false;
                }
                fileTailMatch = tail.length + 1;
            }
        }
        // now we know the tail matches!
        // the middle is zero or more portions wrapped in **, possibly
        // containing more ** sections.
        // so a/**/b/**/c/**/d has become **/b/**/c/**
        // if it's empty, it means a/**/b, just verify we have no bad dots
        // if there's no tail, so it ends on /**, then we must have *something*
        // after the head, or it's not a matc
        if (!body.length) {
            let sawSome = !!fileTailMatch;
            for (let i = fileIndex; i < file.length - fileTailMatch; i++) {
                const f = String(file[i]);
                sawSome = true;
                if (f === '.' ||
                    f === '..' ||
                    (!this.options.dot && f.startsWith('.'))) {
                    return false;
                }
            }
            // in partial mode, we just need to get past all file parts
            return partial || sawSome;
        }
        // now we know that there's one or more body sections, which can
        // be matched anywhere from the 0 index (because the head was pruned)
        // through to the length-fileTailMatch index.
        // split the body up into sections, and note the minimum index it can
        // be found at (start with the length of all previous segments)
        // [section, before, after]
        const bodySegments = [[[], 0]];
        let currentBody = bodySegments[0];
        let nonGsParts = 0;
        const nonGsPartsSums = [0];
        for (const b of body) {
            if (b === exports.GLOBSTAR) {
                nonGsPartsSums.push(nonGsParts);
                currentBody = [[], 0];
                bodySegments.push(currentBody);
            }
            else {
                currentBody[0].push(b);
                nonGsParts++;
            }
        }
        let i = bodySegments.length - 1;
        const fileLength = file.length - fileTailMatch;
        for (const b of bodySegments) {
            b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
        }
        return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
    }
    // return false for "nope, not matching"
    // return null for "not matching, cannot keep trying"
    #matchGlobStarBodySections(file, 
    // pattern section, last possible position for it
    bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
        // take the first body segment, and walk from fileIndex to its "after"
        // value at the end
        // If it doesn't match at that position, we increment, until we hit
        // that final possible position, and give up.
        // If it does match, then advance and try to rest.
        // If any of them fail we keep walking forward.
        // this is still a bit recursively painful, but it's more constrained
        // than previous implementations, because we never test something that
        // can't possibly be a valid matching condition.
        const bs = bodySegments[bodyIndex];
        if (!bs) {
            // just make sure that there's no bad dots
            for (let i = fileIndex; i < file.length; i++) {
                sawTail = true;
                const f = file[i];
                if (f === '.' ||
                    f === '..' ||
                    (!this.options.dot && f.startsWith('.'))) {
                    return false;
                }
            }
            return sawTail;
        }
        // have a non-globstar body section to test
        const [body, after] = bs;
        while (fileIndex <= after) {
            const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
            // if limit exceeded, no match. intentional false negative,
            // acceptable break in correctness for security.
            if (m && globStarDepth < this.maxGlobstarRecursion) {
                // match! see if the rest match. if so, we're done!
                const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
                if (sub !== false) {
                    return sub;
                }
            }
            const f = file[fileIndex];
            if (f === '.' ||
                f === '..' ||
                (!this.options.dot && f.startsWith('.'))) {
                return false;
            }
            fileIndex++;
        }
        // walked off. no point continuing
        return partial || null;
    }
    #matchOne(file, pattern, partial, fileIndex, patternIndex) {
        let fi;
        let pi;
        let pl;
        let fl;
        for (fi = fileIndex,
            pi = patternIndex,
            fl = file.length,
            pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
            this.debug('matchOne loop');
            let p = pattern[pi];
            let f = file[fi];
            this.debug(pattern, p, f);
            // should be impossible.
            // some invalid regexp stuff in the set.
            /* c8 ignore start */
            if (p === false || p === exports.GLOBSTAR) {
                return false;
            }
            /* c8 ignore stop */
            // something other than **
            // non-magic patterns just have to match exactly
            // patterns with magic have been turned into regexps.
            let hit;
            if (typeof p === 'string') {
                hit = f === p;
                this.debug('string match', p, f, hit);
            }
            else {
                hit = p.test(f);
                this.debug('pattern match', p, f, hit);
            }
            if (!hit)
                return false;
        }
        // Note: ending in / means that we'll get a final ""
        // at the end of the pattern.  This can only match a
        // corresponding "" at the end of the file.
        // If the file ends in /, then it can only match a
        // a pattern that ends in /, unless the pattern just
        // doesn't have any more for it. But, a/b/ should *not*
        // match "a/b/*", even though "" matches against the
        // [^/]*? pattern, except in partial mode, where it might
        // simply not be reached yet.
        // However, a/b/ should still satisfy a/*
        // now either we fell off the end of the pattern, or we're done.
        if (fi === fl && pi === pl) {
            // ran out of pattern and filename at the same time.
            // an exact hit!
            return true;
        }
        else if (fi === fl) {
            // ran out of file, but still had pattern left.
            // this is ok if we're doing the match as part of
            // a glob fs traversal.
            return partial;
        }
        else if (pi === pl) {
            // ran out of pattern, still have file left.
            // this is only acceptable if we're on the very last
            // empty segment of a file with a trailing slash.
            // a/* should match a/b/
            return fi === fl - 1 && file[fi] === '';
            /* c8 ignore start */
        }
        else {
            // should be unreachable.
            throw new Error('wtf?');
        }
        /* c8 ignore stop */
    }
    braceExpand() {
        return (0, exports.braceExpand)(this.pattern, this.options);
    }
    parse(pattern) {
        (0, assert_valid_pattern_js_1.assertValidPattern)(pattern);
        const options = this.options;
        // shortcuts
        if (pattern === '**')
            return exports.GLOBSTAR;
        if (pattern === '')
            return '';
        // far and away, the most common glob pattern parts are
        // *, *.*, and *.<ext>  Add a fast check method for those.
        let m;
        let fastTest = null;
        if ((m = pattern.match(starRE))) {
            fastTest = options.dot ? starTestDot : starTest;
        }
        else if ((m = pattern.match(starDotExtRE))) {
            fastTest = (options.nocase ?
                options.dot ?
                    starDotExtTestNocaseDot
                    : starDotExtTestNocase
                : options.dot ? starDotExtTestDot
                    : starDotExtTest)(m[1]);
        }
        else if ((m = pattern.match(qmarksRE))) {
            fastTest = (options.nocase ?
                options.dot ?
                    qmarksTestNocaseDot
                    : qmarksTestNocase
                : options.dot ? qmarksTestDot
                    : qmarksTest)(m);
        }
        else if ((m = pattern.match(starDotStarRE))) {
            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
        }
        else if ((m = pattern.match(dotStarRE))) {
            fastTest = dotStarTest;
        }
        const re = ast_js_1.AST.fromGlob(pattern, this.options).toMMPattern();
        if (fastTest && typeof re === 'object') {
            // Avoids overriding in frozen environments
            Reflect.defineProperty(re, 'test', { value: fastTest });
        }
        return re;
    }
    makeRe() {
        if (this.regexp || this.regexp === false)
            return this.regexp;
        // at this point, this.set is a 2d array of partial
        // pattern strings, or "**".
        //
        // It's better to use .match().  This function shouldn't
        // be used, really, but it's pretty convenient sometimes,
        // when you just want to work with a regex.
        const set = this.set;
        if (!set.length) {
            this.regexp = false;
            return this.regexp;
        }
        const options = this.options;
        const twoStar = options.noglobstar ? star
            : options.dot ? twoStarDot
                : twoStarNoDot;
        const flags = new Set(options.nocase ? ['i'] : []);
        // regexpify non-globstar patterns
        // if ** is only item, then we just do one twoStar
        // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
        // if ** is last, append (\/twoStar|) to previous
        // if ** is in the middle, append (\/|\/twoStar\/) to previous
        // then filter out GLOBSTAR symbols
        let re = set
            .map(pattern => {
            const pp = pattern.map(p => {
                if (p instanceof RegExp) {
                    for (const f of p.flags.split(''))
                        flags.add(f);
                }
                return (typeof p === 'string' ? regExpEscape(p)
                    : p === exports.GLOBSTAR ? exports.GLOBSTAR
                        : p._src);
            });
            pp.forEach((p, i) => {
                const next = pp[i + 1];
                const prev = pp[i - 1];
                if (p !== exports.GLOBSTAR || prev === exports.GLOBSTAR) {
                    return;
                }
                if (prev === undefined) {
                    if (next !== undefined && next !== exports.GLOBSTAR) {
                        pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
                    }
                    else {
                        pp[i] = twoStar;
                    }
                }
                else if (next === undefined) {
                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + ')?';
                }
                else if (next !== exports.GLOBSTAR) {
                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
                    pp[i + 1] = exports.GLOBSTAR;
                }
            });
            const filtered = pp.filter(p => p !== exports.GLOBSTAR);
            // For partial matches, we need to make the pattern match
            // any prefix of the full path. We do this by generating
            // alternative patterns that match progressively longer prefixes.
            if (this.partial && filtered.length >= 1) {
                const prefixes = [];
                for (let i = 1; i <= filtered.length; i++) {
                    prefixes.push(filtered.slice(0, i).join('/'));
                }
                return '(?:' + prefixes.join('|') + ')';
            }
            return filtered.join('/');
        })
            .join('|');
        // need to wrap in parens if we had more than one thing with |,
        // otherwise only the first will be anchored to ^ and the last to $
        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
        // must match entire pattern
        // ending in a * or ** will make it less strict.
        re = '^' + open + re + close + '$';
        // In partial mode, '/' should always match as it's a valid prefix for any pattern
        if (this.partial) {
            re = '^(?:\\/|' + open + re.slice(1, -1) + close + ')$';
        }
        // can match anything, as long as it's not this.
        if (this.negate)
            re = '^(?!' + re + ').+$';
        try {
            this.regexp = new RegExp(re, [...flags].join(''));
            /* c8 ignore start */
        }
        catch {
            // should be impossible
            this.regexp = false;
        }
        /* c8 ignore stop */
        return this.regexp;
    }
    slashSplit(p) {
        // if p starts with // on windows, we preserve that
        // so that UNC paths aren't broken.  Otherwise, any number of
        // / characters are coalesced into one, unless
        // preserveMultipleSlashes is set to true.
        if (this.preserveMultipleSlashes) {
            return p.split('/');
        }
        else if (this.isWindows && /^\/\/[^/]+/.test(p)) {
            // add an extra '' for the one we lose
            return ['', ...p.split(/\/+/)];
        }
        else {
            return p.split(/\/+/);
        }
    }
    match(f, partial = this.partial) {
        this.debug('match', f, this.pattern);
        // short-circuit in the case of busted things.
        // comments, etc.
        if (this.comment) {
            return false;
        }
        if (this.empty) {
            return f === '';
        }
        if (f === '/' && partial) {
            return true;
        }
        const options = this.options;
        // windows: need to use /, not \
        if (this.isWindows) {
            f = f.split('\\').join('/');
        }
        // treat the test path as a set of pathparts.
        const ff = this.slashSplit(f);
        this.debug(this.pattern, 'split', ff);
        // just ONE of the pattern sets in this.set needs to match
        // in order for it to be valid.  If negating, then just one
        // match means that we have failed.
        // Either way, return on the first hit.
        const set = this.set;
        this.debug(this.pattern, 'set', set);
        // Find the basename of the path by looking for the last non-empty segment
        let filename = ff[ff.length - 1];
        if (!filename) {
            for (let i = ff.length - 2; !filename && i >= 0; i--) {
                filename = ff[i];
            }
        }
        for (const pattern of set) {
            let file = ff;
            if (options.matchBase && pattern.length === 1) {
                file = [filename];
            }
            const hit = this.matchOne(file, pattern, partial);
            if (hit) {
                if (options.flipNegate) {
                    return true;
                }
                return !this.negate;
            }
        }
        // didn't get any hits.  this is success if it's a negative
        // pattern, failure otherwise.
        if (options.flipNegate) {
            return false;
        }
        return this.negate;
    }
    static defaults(def) {
        return exports.minimatch.defaults(def).Minimatch;
    }
}
exports.Minimatch = Minimatch;
/* c8 ignore start */
var ast_js_2 = require("./ast.js");
Object.defineProperty(exports, "AST", { enumerable: true, get: function () { return ast_js_2.AST; } });
var escape_js_2 = require("./escape.js");
Object.defineProperty(exports, "escape", { enumerable: true, get: function () { return escape_js_2.escape; } });
var unescape_js_2 = require("./unescape.js");
Object.defineProperty(exports, "unescape", { enumerable: true, get: function () { return unescape_js_2.unescape; } });
/* c8 ignore stop */
exports.minimatch.AST = ast_js_1.AST;
exports.minimatch.Minimatch = Minimatch;
exports.minimatch.escape = escape_js_1.escape;
exports.minimatch.unescape = unescape_js_1.unescape;
//# sourceMappingURL=index.js.map:Y)x   {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,qDAAwC;AACxC,uEAA8D;AAE9D,qCAA8B;AAC9B,2CAAoC;AACpC,+CAAwC;AAqHjC,MAAM,SAAS,GAAG,CACvB,CAAS,EACT,OAAe,EACf,UAA4B,EAAE,EAC9B,EAAE;IACF,IAAA,4CAAkB,EAAC,OAAO,CAAC,CAAA;IAE3B,oCAAoC;IACpC,IAAI,CAAC,OAAO,CAAC,SAAS,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,GAAG,EAAE,CAAC;QACpD,OAAO,KAAK,CAAA;IACd,CAAC;IAED,OAAO,IAAI,SAAS,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAA;AACjD,CAAC,CAAA;AAbY,QAAA,SAAS,aAarB;AAED,wDAAwD;AACxD,MAAM,YAAY,GAAG,oBAAoB,CAAA;AACzC,MAAM,cAAc,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,CAAC,CAAS,EAAE,EAAE,CACpD,CAAC,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IAAI,GAAG,EAAE,CAAC;gBACR,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;oBACvB,OAAO,IAAI,CAAA;gBACb,CAAC;gBACD,OAAO,CAAC,IAAI,CAAC,MAAM,CAAA;YACrB,CAAC;QACH,CAAC;QAED,2DAA2D;QAC3D,8BAA8B;QAC9B,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YACvB,OAAO,KAAK,CAAA;QACd,CAAC;QACD,OAAO,IAAI,CAAC,MAAM,CAAA;IACpB,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,GAAqB;QACnC,OAAO,iBAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,CAAA;IAC1C,CAAC;CACF;AAhkCD,8BAgkCC;AACD,qBAAqB;AACrB,mCAA8B;AAArB,6FAAA,GAAG,OAAA;AACZ,yCAAoC;AAA3B,mGAAA,MAAM,OAAA;AACf,6CAAwC;AAA/B,uGAAA,QAAQ,OAAA;AACjB,oBAAoB;AACpB,iBAAS,CAAC,GAAG,GAAG,YAAG,CAAA;AACnB,iBAAS,CAAC,SAAS,GAAG,SAAS,CAAA;AAC/B,iBAAS,CAAC,MAAM,GAAG,kBAAM,CAAA;AACzB,iBAAS,CAAC,QAAQ,GAAG,sBAAQ,CAAA","sourcesContent":["import { expand } from 'brace-expansion'\nimport { assertValidPattern } from './assert-valid-pattern.js'\nimport type { ExtglobType } from './ast.js'\nimport { AST } from './ast.js'\nimport { escape } from './escape.js'\nimport { unescape } from './unescape.js'\n\nexport type Platform =\n  | 'aix'\n  | 'android'\n  | 'darwin'\n  | 'freebsd'\n  | 'haiku'\n  | 'linux'\n  | 'openbsd'\n  | 'sunos'\n  | 'win32'\n  | 'cygwin'\n  | 'netbsd'\n\nexport interface MinimatchOptions {\n  /** do not expand `{x,y}` style braces */\n  nobrace?: boolean\n  /** do not treat patterns starting with `#` as a comment */\n  nocomment?: boolean\n  /** do not treat patterns starting with `!` as a negation */\n  nonegate?: boolean\n  /** print LOTS of debugging output */\n  debug?: boolean\n  /** treat `**` the same as `*` */\n  noglobstar?: boolean\n  /** do not expand extglobs like `+(a|b)` */\n  noext?: boolean\n  /** return the pattern if nothing matches */\n  nonull?: boolean\n  /** treat `\\\\` as a path separator, not an escape character */\n  windowsPathsNoEscape?: boolean\n  /**\n   * inverse of {@link MinimatchOptions.windowsPathsNoEscape}\n   * @deprecated\n   */\n  allowWindowsEscape?: boolean\n  /**\n   * Compare a partial path to a pattern. As long as the parts\n   * of the path that are present are not contradicted by the\n   * pattern, it will be treated as a match. This is useful in\n   * applications where you're walking through a folder structure,\n   * and don't yet have the full path, but want to ensure that you\n   * do not walk down paths that can never be a match.\n   */\n  partial?: boolean\n  /** allow matches that start with `.` even if the pattern does not */\n  dot?: boolean\n  /** ignore case */\n  nocase?: boolean\n  /** ignore case only in wildcard patterns */\n  nocaseMagicOnly?: boolean\n  /** consider braces to be \"magic\" for the purpose of `hasMagic` */\n  magicalBraces?: boolean\n  /**\n   * If set, then patterns without slashes will be matched\n   * against the basename of the path if it contains slashes.\n   * For example, `a?b` would match the path `/xyz/123/acb`, but\n   * not `/xyz/acb/123`.\n   */\n  matchBase?: boolean\n  /** invert the results of negated matches */\n  flipNegate?: boolean\n  /** do not collapse multiple `/` into a single `/` */\n  preserveMultipleSlashes?: boolean\n  /**\n   * A number indicating the level of optimization that should be done\n   * to the pattern prior to parsing and using it for matches.\n   */\n  optimizationLevel?: number\n  /** operating system platform */\n  platform?: Platform\n  /**\n   * When a pattern starts with a UNC path or drive letter, and in\n   * `nocase:true` mode, do not convert the root portions of the\n   * pattern into a case-insensitive regular expression, and instead\n   * leave them as strings.\n   *\n   * This is the default when the platform is `win32` and\n   * `nocase:true` is set.\n   */\n  windowsNoMagicRoot?: boolean\n  /**\n   * max number of `{...}` patterns to expand. Default 100_000.\n   */\n  braceExpandMax?: number\n  /**\n   * Max number of non-adjacent `**` patterns to recursively walk down.\n   *\n   * The default of 200 is almost certainly high enough for most purposes,\n   * and can handle absurdly excessive patterns.\n   */\n  maxGlobstarRecursion?: number\n\n  /**\n   * Max depth to traverse for nested extglobs like `*(a|b|c)`\n   *\n   * Default is 2, which is quite low, but any higher value\n   * swiftly results in punishing performance impacts. Note\n   * that this is *not*  relevant when the globstar types can\n   * be safely coalesced into a single set.\n   *\n   * For example, `*(a|@(b|c)|d)` would be flattened into\n   * `*(a|b|c|d)`. Thus, many common extglobs will retain good\n   * performance and  never hit this limit, even if they are\n   * excessively deep and complicated.\n   *\n   * If the limit is hit, then the extglob characters are simply\n   * not parsed, and the pattern effectively switches into\n   * `noextglob: true` mode for the contents of that nested\n   * sub-pattern. This will typically _not_ result in a match,\n   * but is considered a valid trade-off for security and\n   * performance.\n   */\n  maxExtglobRecursion?: number\n}\n\nexport const minimatch = (\n  p: string,\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  assertValidPattern(pattern)\n\n  // shortcut: comments match nothing.\n  if (!options.nocomment && pattern.charAt(0) === '#') {\n    return false\n  }\n\n  return new Minimatch(pattern, options).match(p)\n}\n\n// Optimized checking for the most common glob patterns.\nconst starDotExtRE = /^\\*+([^+@!?*[(]*)$/\nconst starDotExtTest = (ext: string) => (f: string) =>\n  !f.startsWith('.') && f.endsWith(ext)\nconst starDotExtTestDot = (ext: string) => (f: string) => f.endsWith(ext)\nconst starDotExtTestNocase = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => !f.startsWith('.') && f.toLowerCase().endsWith(ext)\n}\nconst starDotExtTestNocaseDot = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => f.toLowerCase().endsWith(ext)\n}\nconst starDotStarRE = /^\\*+\\.\\*+$/\nconst starDotStarTest = (f: string) =>\n  !f.startsWith('.') && f.includes('.')\nconst starDotStarTestDot = (f: string) =>\n  f !== '.' && f !== '..' && f.includes('.')\nconst dotStarRE = /^\\.\\*+$/\nconst dotStarTest = (f: string) =>\n  f !== '.' && f !== '..' && f.startsWith('.')\nconst starRE = /^\\*+$/\nconst starTest = (f: string) => f.length !== 0 && !f.startsWith('.')\nconst starTestDot = (f: string) =>\n  f.length !== 0 && f !== '.' && f !== '..'\nconst qmarksRE = /^\\?+([^+@!?*[(]*)?$/\nconst qmarksTestNocase = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestNocaseDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTest = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTestNoExt = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && !f.startsWith('.')\n}\nconst qmarksTestNoExtDot = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && f !== '.' && f !== '..'\n}\n\n/* c8 ignore start */\nconst defaultPlatform: Platform = (\n  typeof process === 'object' && process ?\n    (typeof process.env === 'object' &&\n      process.env &&\n      process.env.__MINIMATCH_TESTING_PLATFORM__) ||\n    process.platform\n  : 'posix') as Platform\n\nexport type Sep = '\\\\' | '/'\n\nconst path: { [k: string]: { sep: Sep } } = {\n  win32: { sep: '\\\\' },\n  posix: { sep: '/' },\n}\n/* c8 ignore stop */\n\nexport const sep =\n  defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep\nminimatch.sep = sep\n\nexport const GLOBSTAR = Symbol('globstar **')\nminimatch.GLOBSTAR = GLOBSTAR\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n\n// ** when dots are allowed.  Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\/|^)\\\\.).)*?'\n\nexport const filter =\n  (pattern: string, options: MinimatchOptions = {}) =>\n  (p: string) =>\n    minimatch(p, pattern, options)\nminimatch.filter = filter\n\nconst ext = (a: MinimatchOptions, b: MinimatchOptions = {}) =>\n  Object.assign({}, a, b)\n\nexport const defaults = (def: MinimatchOptions): typeof minimatch => {\n  if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n    return minimatch\n  }\n\n  const orig = minimatch\n\n  const m = (p: string, pattern: string, options: MinimatchOptions = {}) =>\n    orig(p, pattern, ext(def, options))\n\n  return Object.assign(m, {\n    Minimatch: class Minimatch extends orig.Minimatch {\n      constructor(pattern: string, options: MinimatchOptions = {}) {\n        super(pattern, ext(def, options))\n      }\n      static defaults(options: MinimatchOptions) {\n        return orig.defaults(ext(def, options)).Minimatch\n      }\n    },\n\n    AST: class AST extends orig.AST {\n      /* c8 ignore start */\n      constructor(\n        type: ExtglobType | null,\n        parent?: AST,\n        options: MinimatchOptions = {},\n      ) {\n        super(type, parent, ext(def, options))\n      }\n      /* c8 ignore stop */\n\n      static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n        return orig.AST.fromGlob(pattern, ext(def, options))\n      }\n    },\n\n    unescape: (\n      s: string,\n      options: Pick<\n        MinimatchOptions,\n        'windowsPathsNoEscape' | 'magicalBraces'\n      > = {},\n    ) => orig.unescape(s, ext(def, options)),\n\n    escape: (\n      s: string,\n      options: Pick<\n        MinimatchOptions,\n        'windowsPathsNoEscape' | 'magicalBraces'\n      > = {},\n    ) => orig.escape(s, ext(def, options)),\n\n    filter: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.filter(pattern, ext(def, options)),\n\n    defaults: (options: MinimatchOptions) =>\n      orig.defaults(ext(def, options)),\n\n    makeRe: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.makeRe(pattern, ext(def, options)),\n\n    braceExpand: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.braceExpand(pattern, ext(def, options)),\n\n    match: (\n      list: string[],\n      pattern: string,\n      options: MinimatchOptions = {},\n    ) => orig.match(list, pattern, ext(def, options)),\n\n    sep: orig.sep,\n    GLOBSTAR: GLOBSTAR as typeof GLOBSTAR,\n  })\n}\nminimatch.defaults = defaults\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nexport const braceExpand = (\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  assertValidPattern(pattern)\n\n  // Thanks to Yeting Li <https://github.com/yetingli> for\n  // improving this regexp to avoid a ReDOS vulnerability.\n  if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n    // shortcut. no need to expand.\n    return [pattern]\n  }\n\n  return expand(pattern, { max: options.braceExpandMax })\n}\nminimatch.braceExpand = braceExpand\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion.  Otherwise, any series\n// of * is equivalent to a single *.  Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\n\nexport const makeRe = (pattern: string, options: MinimatchOptions = {}) =>\n  new Minimatch(pattern, options).makeRe()\nminimatch.makeRe = makeRe\n\nexport const match = (\n  list: string[],\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  const mm = new Minimatch(pattern, options)\n  list = list.filter(f => mm.match(f))\n  if (mm.options.nonull && !list.length) {\n    list.push(pattern)\n  }\n  return list\n}\nminimatch.match = match\n\n// replace stuff like \\* with *\nconst globMagic = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/\nconst regExpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\nexport type MMRegExp = RegExp & {\n  _src?: string\n  _glob?: string\n}\n\nexport type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR\nexport type ParseReturn = ParseReturnFiltered | false\n\nexport class Minimatch {\n  options: MinimatchOptions\n  set: ParseReturnFiltered[][]\n  pattern: string\n\n  windowsPathsNoEscape: boolean\n  nonegate: boolean\n  negate: boolean\n  comment: boolean\n  empty: boolean\n  preserveMultipleSlashes: boolean\n  partial: boolean\n  globSet: string[]\n  globParts: string[][]\n  nocase: boolean\n\n  isWindows: boolean\n  platform: Platform\n  windowsNoMagicRoot: boolean\n  maxGlobstarRecursion: number\n\n  regexp: false | null | MMRegExp\n  constructor(pattern: string, options: MinimatchOptions = {}) {\n    assertValidPattern(pattern)\n\n    options = options || {}\n    this.options = options\n    this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200\n    this.pattern = pattern\n    this.platform = options.platform || defaultPlatform\n    this.isWindows = this.platform === 'win32'\n    // avoid the annoying deprecation flag lol\n    const awe = ('allowWindow' + 'sEscape') as keyof MinimatchOptions\n    this.windowsPathsNoEscape =\n      !!options.windowsPathsNoEscape || options[awe] === false\n    if (this.windowsPathsNoEscape) {\n      this.pattern = this.pattern.replace(/\\\\/g, '/')\n    }\n    this.preserveMultipleSlashes = !!options.preserveMultipleSlashes\n    this.regexp = null\n    this.negate = false\n    this.nonegate = !!options.nonegate\n    this.comment = false\n    this.empty = false\n    this.partial = !!options.partial\n    this.nocase = !!this.options.nocase\n    this.windowsNoMagicRoot =\n      options.windowsNoMagicRoot !== undefined ?\n        options.windowsNoMagicRoot\n      : !!(this.isWindows && this.nocase)\n\n    this.globSet = []\n    this.globParts = []\n    this.set = []\n\n    // make the set of regexps etc.\n    this.make()\n  }\n\n  hasMagic(): boolean {\n    if (this.options.magicalBraces && this.set.length > 1) {\n      return true\n    }\n    for (const pattern of this.set) {\n      for (const part of pattern) {\n        if (typeof part !== 'string') return true\n      }\n    }\n    return false\n  }\n\n  debug(..._: unknown[]) {}\n\n  make() {\n    const pattern = this.pattern\n    const options = this.options\n\n    // empty patterns and comments match nothing.\n    if (!options.nocomment && pattern.charAt(0) === '#') {\n      this.comment = true\n      return\n    }\n\n    if (!pattern) {\n      this.empty = true\n      return\n    }\n\n    // step 1: figure out negation, etc.\n    this.parseNegate()\n\n    // step 2: expand braces\n    this.globSet = [...new Set(this.braceExpand())]\n\n    if (options.debug) {\n      //oxlint-disable-next-line no-console\n      this.debug = (...args: unknown[]) => console.error(...args)\n    }\n\n    this.debug(this.pattern, this.globSet)\n\n    // step 3: now we have a set, so turn each one into a series of\n    // path-portion matching patterns.\n    // These will be regexps, except in the case of \"**\", which is\n    // set to the GLOBSTAR object for globstar behavior,\n    // and will not contain any / characters\n    //\n    // First, we preprocess to make the glob pattern sets a bit simpler\n    // and deduped.  There are some perf-killing patterns that can cause\n    // problems with a glob walk, but we can simplify them down a bit.\n    const rawGlobParts = this.globSet.map(s => this.slashSplit(s))\n    this.globParts = this.preprocess(rawGlobParts)\n    this.debug(this.pattern, this.globParts)\n\n    // glob --> regexps\n    let set = this.globParts.map((s, _, __) => {\n      if (this.isWindows && this.windowsNoMagicRoot) {\n        // check if it's a drive or unc path.\n        const isUNC =\n          s[0] === '' &&\n          s[1] === '' &&\n          (s[2] === '?' || !globMagic.test(s[2])) &&\n          !globMagic.test(s[3])\n        const isDrive = /^[a-z]:/i.test(s[0])\n        if (isUNC) {\n          return [\n            ...s.slice(0, 4),\n            ...s.slice(4).map(ss => this.parse(ss)),\n          ]\n        } else if (isDrive) {\n          return [s[0], ...s.slice(1).map(ss => this.parse(ss))]\n        }\n      }\n      return s.map(ss => this.parse(ss))\n    })\n\n    this.debug(this.pattern, set)\n\n    // filter out everything that didn't compile properly.\n    this.set = set.filter(\n      s => s.indexOf(false) === -1,\n    ) as ParseReturnFiltered[][]\n\n    // do not treat the ? in UNC paths as magic\n    if (this.isWindows) {\n      for (let i = 0; i < this.set.length; i++) {\n        const p = this.set[i]\n        if (\n          p[0] === '' &&\n          p[1] === '' &&\n          this.globParts[i][2] === '?' &&\n          typeof p[3] === 'string' &&\n          /^[a-z]:$/i.test(p[3])\n        ) {\n          p[2] = '?'\n        }\n      }\n    }\n\n    this.debug(this.pattern, this.set)\n  }\n\n  // various transforms to equivalent pattern sets that are\n  // faster to process in a filesystem walk.  The goal is to\n  // eliminate what we can, and push all ** patterns as far\n  // to the right as possible, even if it increases the number\n  // of patterns that we have to process.\n  preprocess(globParts: string[][]) {\n    // if we're not in globstar mode, then turn ** into *\n    if (this.options.noglobstar) {\n      for (const partset of globParts) {\n        for (let j = 0; j < partset.length; j++) {\n          if (partset[j] === '**') {\n            partset[j] = '*'\n          }\n        }\n      }\n    }\n\n    const { optimizationLevel = 1 } = this.options\n\n    if (optimizationLevel >= 2) {\n      // aggressive optimization for the purpose of fs walking\n      globParts = this.firstPhasePreProcess(globParts)\n      globParts = this.secondPhasePreProcess(globParts)\n    } else if (optimizationLevel >= 1) {\n      // just basic optimizations to remove some .. parts\n      globParts = this.levelOneOptimize(globParts)\n    } else {\n      // just collapse multiple ** portions into one\n      globParts = this.adjascentGlobstarOptimize(globParts)\n    }\n\n    return globParts\n  }\n\n  // just get rid of adjascent ** portions\n  adjascentGlobstarOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      let gs: number = -1\n      while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n        let i = gs\n        while (parts[i + 1] === '**') {\n          i++\n        }\n        if (i !== gs) {\n          parts.splice(gs, i - gs)\n        }\n      }\n      return parts\n    })\n  }\n\n  // get rid of adjascent ** and resolve .. portions\n  levelOneOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      parts = parts.reduce((set: string[], part) => {\n        const prev = set[set.length - 1]\n        if (part === '**' && prev === '**') {\n          return set\n        }\n        if (part === '..') {\n          if (prev && prev !== '..' && prev !== '.' && prev !== '**') {\n            set.pop()\n            return set\n          }\n        }\n        set.push(part)\n        return set\n      }, [])\n      return parts.length === 0 ? [''] : parts\n    })\n  }\n\n  levelTwoFileOptimize(parts: string | string[]) {\n    if (!Array.isArray(parts)) {\n      parts = this.slashSplit(parts)\n    }\n    let didSomething: boolean = false\n\n    do {\n      didSomething = false\n      // <pre>/<e>/<rest> -> <pre>/<rest>\n      if (!this.preserveMultipleSlashes) {\n        for (let i = 1; i < parts.length - 1; i++) {\n          const p = parts[i]\n          // don't squeeze out UNC patterns\n          if (i === 1 && p === '' && parts[0] === '') continue\n          if (p === '.' || p === '') {\n            didSomething = true\n            parts.splice(i, 1)\n            i--\n          }\n        }\n        if (\n          parts[0] === '.' &&\n          parts.length === 2 &&\n          (parts[1] === '.' || parts[1] === '')\n        ) {\n          didSomething = true\n          parts.pop()\n        }\n      }\n\n      // <pre>/<p>/../<rest> -> <pre>/<rest>\n      let dd: number = 0\n      while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n        const p = parts[dd - 1]\n        if (\n          p &&\n          p !== '.' &&\n          p !== '..' &&\n          p !== '**' &&\n          !(this.isWindows && /^[a-z]:$/i.test(p))\n        ) {\n          didSomething = true\n          parts.splice(dd - 1, 2)\n          dd -= 2\n        }\n      }\n    } while (didSomething)\n    return parts.length === 0 ? [''] : parts\n  }\n\n  // First phase: single-pattern processing\n  // <pre> is 1 or more portions\n  // <rest> is 1 or more portions\n  // <p> is any portion other than ., .., '', or **\n  // <e> is . or ''\n  //\n  // **/.. is *brutal* for filesystem walking performance, because\n  // it effectively resets the recursive walk each time it occurs,\n  // and ** cannot be reduced out by a .. pattern part like a regexp\n  // or most strings (other than .., ., and '') can be.\n  //\n  // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}\n  // <pre>/<e>/<rest> -> <pre>/<rest>\n  // <pre>/<p>/../<rest> -> <pre>/<rest>\n  // **/**/<rest> -> **/<rest>\n  //\n  // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow\n  // this WOULD be allowed if ** did follow symlinks, or * didn't\n  firstPhasePreProcess(globParts: string[][]) {\n    let didSomething = false\n    do {\n      didSomething = false\n      // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}\n      for (let parts of globParts) {\n        let gs: number = -1\n        while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n          let gss: number = gs\n          while (parts[gss + 1] === '**') {\n            // <pre>/**/**/<rest> -> <pre>/**/<rest>\n            gss++\n          }\n          // eg, if gs is 2 and gss is 4, that means we have 3 **\n          // parts, and can remove 2 of them.\n          if (gss > gs) {\n            parts.splice(gs + 1, gss - gs)\n          }\n\n          let next = parts[gs + 1]\n          const p = parts[gs + 2]\n          const p2 = parts[gs + 3]\n          if (next !== '..') continue\n          if (\n            !p ||\n            p === '.' ||\n            p === '..' ||\n            !p2 ||\n            p2 === '.' ||\n            p2 === '..'\n          ) {\n            continue\n          }\n          didSomething = true\n          // edit parts in place, and push the new one\n          parts.splice(gs, 1)\n          const other = parts.slice(0)\n          other[gs] = '**'\n          globParts.push(other)\n          gs--\n        }\n\n        // <pre>/<e>/<rest> -> <pre>/<rest>\n        if (!this.preserveMultipleSlashes) {\n          for (let i = 1; i < parts.length - 1; i++) {\n            const p = parts[i]\n            // don't squeeze out UNC patterns\n            if (i === 1 && p === '' && parts[0] === '') continue\n            if (p === '.' || p === '') {\n              didSomething = true\n              parts.splice(i, 1)\n              i--\n            }\n          }\n          if (\n            parts[0] === '.' &&\n            parts.length === 2 &&\n            (parts[1] === '.' || parts[1] === '')\n          ) {\n            didSomething = true\n            parts.pop()\n          }\n        }\n\n        // <pre>/<p>/../<rest> -> <pre>/<rest>\n        let dd: number = 0\n        while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n          const p = parts[dd - 1]\n          if (p && p !== '.' && p !== '..' && p !== '**') {\n            didSomething = true\n            const needDot = dd === 1 && parts[dd + 1] === '**'\n            const splin = needDot ? ['.'] : []\n            parts.splice(dd - 1, 2, ...splin)\n            if (parts.length === 0) parts.push('')\n            dd -= 2\n          }\n        }\n      }\n    } while (didSomething)\n\n    return globParts\n  }\n\n  // second phase: multi-pattern dedupes\n  // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>\n  // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>\n  // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>\n  //\n  // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>\n  // ^-- not valid because ** doens't follow symlinks\n  secondPhasePreProcess(globParts: string[][]): string[][] {\n    for (let i = 0; i < globParts.length - 1; i++) {\n      for (let j = i + 1; j < globParts.length; j++) {\n        const matched = this.partsMatch(\n          globParts[i],\n          globParts[j],\n          !this.preserveMultipleSlashes,\n        )\n        if (matched) {\n          globParts[i] = []\n          globParts[j] = matched\n          break\n        }\n      }\n    }\n    return globParts.filter(gs => gs.length)\n  }\n\n  partsMatch(\n    a: string[],\n    b: string[],\n    emptyGSMatch: boolean = false,\n  ): false | string[] {\n    let ai = 0\n    let bi = 0\n    let result: string[] = []\n    let which: string = ''\n    while (ai < a.length && bi < b.length) {\n      if (a[ai] === b[bi]) {\n        result.push(which === 'b' ? b[bi] : a[ai])\n        ai++\n        bi++\n      } else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {\n        result.push(a[ai])\n        ai++\n      } else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {\n        result.push(b[bi])\n        bi++\n      } else if (\n        a[ai] === '*' &&\n        b[bi] &&\n        (this.options.dot || !b[bi].startsWith('.')) &&\n        b[bi] !== '**'\n      ) {\n        if (which === 'b') return false\n        which = 'a'\n        result.push(a[ai])\n        ai++\n        bi++\n      } else if (\n        b[bi] === '*' &&\n        a[ai] &&\n        (this.options.dot || !a[ai].startsWith('.')) &&\n        a[ai] !== '**'\n      ) {\n        if (which === 'a') return false\n        which = 'b'\n        result.push(b[bi])\n        ai++\n        bi++\n      } else {\n        return false\n      }\n    }\n    // if we fall out of the loop, it means they two are identical\n    // as long as their lengths match\n    return a.length === b.length && result\n  }\n\n  parseRMNegate() {\n    if (this.nonegate) return\n\n    const pattern = this.pattern\n    let negate = false\n    let negateOffset = 0\n\n    for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n      negate = !negate\n      negateOffset++\n    }\n\n    if (negateOffset) this.pattern = pattern.slice(negateOffset)\n    this.negate = negate\n  }\n\n  // set partial to true to test if, for example,\n  // \"/a/b\" matches the start of \"/*/b/*/d\"\n  // Partial means, if you run out of file before you run\n  // out of pattern, then that's fine, as long as all\n  // the parts match.\n  matchOne(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean = false,\n  ) {\n    let fileStartIndex = 0\n    let patternStartIndex = 0\n\n    // UNC paths like //?/X:/... can match X:/... and vice versa\n    // Drive letters in absolute drive or unc paths are always compared\n    // case-insensitively.\n    if (this.isWindows) {\n      const fileDrive =\n        typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0])\n      const fileUNC =\n        !fileDrive &&\n        file[0] === '' &&\n        file[1] === '' &&\n        file[2] === '?' &&\n        /^[a-z]:$/i.test(file[3])\n\n      const patternDrive =\n        typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0])\n      const patternUNC =\n        !patternDrive &&\n        pattern[0] === '' &&\n        pattern[1] === '' &&\n        pattern[2] === '?' &&\n        typeof pattern[3] === 'string' &&\n        /^[a-z]:$/i.test(pattern[3])\n\n      const fdi =\n        fileUNC ? 3\n        : fileDrive ? 0\n        : undefined\n      const pdi =\n        patternUNC ? 3\n        : patternDrive ? 0\n        : undefined\n      if (typeof fdi === 'number' && typeof pdi === 'number') {\n        const [fd, pd]: [string, string] = [\n          file[fdi],\n          pattern[pdi] as string,\n        ]\n        // start matching at the drive letter index of each\n        if (fd.toLowerCase() === pd.toLowerCase()) {\n          pattern[pdi] = fd\n          patternStartIndex = pdi\n          fileStartIndex = fdi\n        }\n      }\n    }\n\n    // resolve and reduce . and .. portions in the file as well.\n    // don't need to do the second phase, because it's only one string[]\n    const { optimizationLevel = 1 } = this.options\n    if (optimizationLevel >= 2) {\n      file = this.levelTwoFileOptimize(file)\n    }\n\n    if (pattern.includes(GLOBSTAR)) {\n      return this.#matchGlobstar(\n        file,\n        pattern,\n        partial,\n        fileStartIndex,\n        patternStartIndex,\n      )\n    }\n\n    return this.#matchOne(\n      file,\n      pattern,\n      partial,\n      fileStartIndex,\n      patternStartIndex,\n    )\n  }\n\n  #matchGlobstar(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean,\n    fileIndex: number,\n    patternIndex: number,\n  ) {\n    // split the pattern into head, tail, and middle of ** delimited parts\n    const firstgs = pattern.indexOf(GLOBSTAR, patternIndex)\n    const lastgs = pattern.lastIndexOf(GLOBSTAR)\n\n    // split the pattern up into globstar-delimited sections\n    // the tail has to be at the end, and the others just have\n    // to be found in order from the head.\n    const [head, body, tail] =\n      partial ?\n        [\n          pattern.slice(patternIndex, firstgs),\n          pattern.slice(firstgs + 1),\n          [],\n        ]\n      : [\n          pattern.slice(patternIndex, firstgs),\n          pattern.slice(firstgs + 1, lastgs),\n          pattern.slice(lastgs + 1),\n        ]\n\n    // check the head, from the current file/pattern index.\n    if (head.length) {\n      const fileHead = file.slice(fileIndex, fileIndex + head.length)\n      if (!this.#matchOne(fileHead, head, partial, 0, 0)) {\n        return false\n      }\n      fileIndex += head.length\n      patternIndex += head.length\n    }\n    // now we know the head matches!\n\n    // if the last portion is not empty, it MUST match the end\n    // check the tail\n    let fileTailMatch: number = 0\n    if (tail.length) {\n      // if head + tail > file, then we cannot possibly match\n      if (tail.length + fileIndex > file.length) return false\n\n      // try to match the tail\n      let tailStart = file.length - tail.length\n      if (this.#matchOne(file, tail, partial, tailStart, 0)) {\n        fileTailMatch = tail.length\n      } else {\n        // affordance for stuff like a/**/* matching a/b/\n        // if the last file portion is '', and there's more to the pattern\n        // then try without the '' bit.\n        if (\n          file[file.length - 1] !== '' ||\n          fileIndex + tail.length === file.length\n        ) {\n          return false\n        }\n        tailStart--\n        if (!this.#matchOne(file, tail, partial, tailStart, 0)) {\n          return false\n        }\n        fileTailMatch = tail.length + 1\n      }\n    }\n\n    // now we know the tail matches!\n\n    // the middle is zero or more portions wrapped in **, possibly\n    // containing more ** sections.\n    // so a/**/b/**/c/**/d has become **/b/**/c/**\n    // if it's empty, it means a/**/b, just verify we have no bad dots\n    // if there's no tail, so it ends on /**, then we must have *something*\n    // after the head, or it's not a matc\n    if (!body.length) {\n      let sawSome = !!fileTailMatch\n      for (let i = fileIndex; i < file.length - fileTailMatch; i++) {\n        const f = String(file[i])\n        sawSome = true\n        if (\n          f === '.' ||\n          f === '..' ||\n          (!this.options.dot && f.startsWith('.'))\n        ) {\n          return false\n        }\n      }\n      // in partial mode, we just need to get past all file parts\n      return partial || sawSome\n    }\n\n    // now we know that there's one or more body sections, which can\n    // be matched anywhere from the 0 index (because the head was pruned)\n    // through to the length-fileTailMatch index.\n    // split the body up into sections, and note the minimum index it can\n    // be found at (start with the length of all previous segments)\n    // [section, before, after]\n    const bodySegments: [ParseReturn[], number][] = [[[], 0]]\n    let currentBody: [ParseReturn[], number] = bodySegments[0]\n    let nonGsParts = 0\n    const nonGsPartsSums: number[] = [0]\n    for (const b of body) {\n      if (b === GLOBSTAR) {\n        nonGsPartsSums.push(nonGsParts)\n        currentBody = [[], 0]\n        bodySegments.push(currentBody)\n      } else {\n        currentBody[0].push(b)\n        nonGsParts++\n      }\n    }\n    let i = bodySegments.length - 1\n    const fileLength = file.length - fileTailMatch\n    for (const b of bodySegments) {\n      b[1] = fileLength - ((nonGsPartsSums[i--] as number) + b[0].length)\n    }\n\n    return !!this.#matchGlobStarBodySections(\n      file,\n      bodySegments,\n      fileIndex,\n      0,\n      partial,\n      0,\n      !!fileTailMatch,\n    )\n  }\n\n  // return false for \"nope, not matching\"\n  // return null for \"not matching, cannot keep trying\"\n  #matchGlobStarBodySections(\n    file: string[],\n    // pattern section, last possible position for it\n    bodySegments: [ParseReturn[], number][],\n    fileIndex: number,\n    bodyIndex: number,\n    partial: boolean,\n    globStarDepth: number,\n    sawTail: boolean,\n  ): boolean | null {\n    // take the first body segment, and walk from fileIndex to its \"after\"\n    // value at the end\n    // If it doesn't match at that position, we increment, until we hit\n    // that final possible position, and give up.\n    // If it does match, then advance and try to rest.\n    // If any of them fail we keep walking forward.\n    // this is still a bit recursively painful, but it's more constrained\n    // than previous implementations, because we never test something that\n    // can't possibly be a valid matching condition.\n    const bs = bodySegments[bodyIndex]\n    if (!bs) {\n      // just make sure that there's no bad dots\n      for (let i = fileIndex; i < file.length; i++) {\n        sawTail = true\n        const f = file[i]\n        if (\n          f === '.' ||\n          f === '..' ||\n          (!this.options.dot && f.startsWith('.'))\n        ) {\n          return false\n        }\n      }\n      return sawTail\n    }\n\n    // have a non-globstar body section to test\n    const [body, after] = bs\n    while (fileIndex <= after) {\n      const m = this.#matchOne(\n        file.slice(0, fileIndex + body.length),\n        body,\n        partial,\n        fileIndex,\n        0,\n      )\n      // if limit exceeded, no match. intentional false negative,\n      // acceptable break in correctness for security.\n      if (m && globStarDepth < this.maxGlobstarRecursion) {\n        // match! see if the rest match. if so, we're done!\n        const sub = this.#matchGlobStarBodySections(\n          file,\n          bodySegments,\n          fileIndex + body.length,\n          bodyIndex + 1,\n          partial,\n          globStarDepth + 1,\n          sawTail,\n        )\n        if (sub !== false) {\n          return sub\n        }\n      }\n      const f = file[fileIndex]\n      if (\n        f === '.' ||\n        f === '..' ||\n        (!this.options.dot && f.startsWith('.'))\n      ) {\n        return false\n      }\n\n      fileIndex++\n    }\n    // walked off. no point continuing\n    return partial || null\n  }\n\n  #matchOne(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean,\n    fileIndex: number,\n    patternIndex: number,\n  ) {\n    let fi: number\n    let pi: number\n    let pl: number\n    let fl: number\n    for (\n      fi = fileIndex,\n        pi = patternIndex,\n        fl = file.length,\n        pl = pattern.length;\n      fi < fl && pi < pl;\n      fi++, pi++\n    ) {\n      this.debug('matchOne loop')\n      let p = pattern[pi]\n      let f = file[fi]\n\n      this.debug(pattern, p, f)\n\n      // should be impossible.\n      // some invalid regexp stuff in the set.\n      /* c8 ignore start */\n      if (p === false || p === GLOBSTAR) {\n        return false\n      }\n      /* c8 ignore stop */\n\n      // something other than **\n      // non-magic patterns just have to match exactly\n      // patterns with magic have been turned into regexps.\n      let hit: boolean\n      if (typeof p === 'string') {\n        hit = f === p\n        this.debug('string match', p, f, hit)\n      } else {\n        hit = p.test(f)\n        this.debug('pattern match', p, f, hit)\n      }\n\n      if (!hit) return false\n    }\n\n    // Note: ending in / means that we'll get a final \"\"\n    // at the end of the pattern.  This can only match a\n    // corresponding \"\" at the end of the file.\n    // If the file ends in /, then it can only match a\n    // a pattern that ends in /, unless the pattern just\n    // doesn't have any more for it. But, a/b/ should *not*\n    // match \"a/b/*\", even though \"\" matches against the\n    // [^/]*? pattern, except in partial mode, where it might\n    // simply not be reached yet.\n    // However, a/b/ should still satisfy a/*\n\n    // now either we fell off the end of the pattern, or we're done.\n    if (fi === fl && pi === pl) {\n      // ran out of pattern and filename at the same time.\n      // an exact hit!\n      return true\n    } else if (fi === fl) {\n      // ran out of file, but still had pattern left.\n      // this is ok if we're doing the match as part of\n      // a glob fs traversal.\n      return partial\n    } else if (pi === pl) {\n      // ran out of pattern, still have file left.\n      // this is only acceptable if we're on the very last\n      // empty segment of a file with a trailing slash.\n      // a/* should match a/b/\n      return fi === fl - 1 && file[fi] === ''\n\n      /* c8 ignore start */\n    } else {\n      // should be unreachable.\n      throw new Error('wtf?')\n    }\n    /* c8 ignore stop */\n  }\n\n  braceExpand() {\n    return braceExpand(this.pattern, this.options)\n  }\n\n  parse(pattern: string): ParseReturn {\n    assertValidPattern(pattern)\n\n    const options = this.options\n\n    // shortcuts\n    if (pattern === '**') return GLOBSTAR\n    if (pattern === '') return ''\n\n    // far and away, the most common glob pattern parts are\n    // *, *.*, and *.<ext>  Add a fast check method for those.\n    let m: RegExpMatchArray | null\n    let fastTest: null | ((f: string) => boolean) = null\n    if ((m = pattern.match(starRE))) {\n      fastTest = options.dot ? starTestDot : starTest\n    } else if ((m = pattern.match(starDotExtRE))) {\n      fastTest = (\n        options.nocase ?\n          options.dot ?\n            starDotExtTestNocaseDot\n          : starDotExtTestNocase\n        : options.dot ? starDotExtTestDot\n        : starDotExtTest)(m[1])\n    } else if ((m = pattern.match(qmarksRE))) {\n      fastTest = (\n        options.nocase ?\n          options.dot ?\n            qmarksTestNocaseDot\n          : qmarksTestNocase\n        : options.dot ? qmarksTestDot\n        : qmarksTest)(m)\n    } else if ((m = pattern.match(starDotStarRE))) {\n      fastTest = options.dot ? starDotStarTestDot : starDotStarTest\n    } else if ((m = pattern.match(dotStarRE))) {\n      fastTest = dotStarTest\n    }\n\n    const re = AST.fromGlob(pattern, this.options).toMMPattern()\n    if (fastTest && typeof re === 'object') {\n      // Avoids overriding in frozen environments\n      Reflect.defineProperty(re, 'test', { value: fastTest })\n    }\n    return re\n  }\n\n  makeRe() {\n    if (this.regexp || this.regexp === false) return this.regexp\n\n    // at this point, this.set is a 2d array of partial\n    // pattern strings, or \"**\".\n    //\n    // It's better to use .match().  This function shouldn't\n    // be used, really, but it's pretty convenient sometimes,\n    // when you just want to work with a regex.\n    const set = this.set\n\n    if (!set.length) {\n      this.regexp = false\n      return this.regexp\n    }\n    const options = this.options\n\n    const twoStar =\n      options.noglobstar ? star\n      : options.dot ? twoStarDot\n      : twoStarNoDot\n    const flags = new Set(options.nocase ? ['i'] : [])\n\n    // regexpify non-globstar patterns\n    // if ** is only item, then we just do one twoStar\n    // if ** is first, and there are more, prepend (\\/|twoStar\\/)? to next\n    // if ** is last, append (\\/twoStar|) to previous\n    // if ** is in the middle, append (\\/|\\/twoStar\\/) to previous\n    // then filter out GLOBSTAR symbols\n    let re = set\n      .map(pattern => {\n        const pp: (string | typeof GLOBSTAR)[] = pattern.map(p => {\n          if (p instanceof RegExp) {\n            for (const f of p.flags.split('')) flags.add(f)\n          }\n          return (\n            typeof p === 'string' ? regExpEscape(p)\n            : p === GLOBSTAR ? GLOBSTAR\n            : p._src\n          )\n        }) as (string | typeof GLOBSTAR)[]\n        pp.forEach((p, i) => {\n          const next = pp[i + 1]\n          const prev = pp[i - 1]\n          if (p !== GLOBSTAR || prev === GLOBSTAR) {\n            return\n          }\n          if (prev === undefined) {\n            if (next !== undefined && next !== GLOBSTAR) {\n              pp[i + 1] = '(?:\\\\/|' + twoStar + '\\\\/)?' + next\n            } else {\n              pp[i] = twoStar\n            }\n          } else if (next === undefined) {\n            pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + ')?'\n          } else if (next !== GLOBSTAR) {\n            pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + '\\\\/)' + next\n            pp[i + 1] = GLOBSTAR\n          }\n        })\n        const filtered = pp.filter(p => p !== GLOBSTAR)\n\n        // For partial matches, we need to make the pattern match\n        // any prefix of the full path. We do this by generating\n        // alternative patterns that match progressively longer prefixes.\n        if (this.partial && filtered.length >= 1) {\n          const prefixes: string[] = []\n          for (let i = 1; i <= filtered.length; i++) {\n            prefixes.push(filtered.slice(0, i).join('/'))\n          }\n          return '(?:' + prefixes.join('|') + ')'\n        }\n\n        return filtered.join('/')\n      })\n      .join('|')\n\n    // need to wrap in parens if we had more than one thing with |,\n    // otherwise only the first will be anchored to ^ and the last to $\n    const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', '']\n    // must match entire pattern\n    // ending in a * or ** will make it less strict.\n    re = '^' + open + re + close + '$'\n\n    // In partial mode, '/' should always match as it's a valid prefix for any pattern\n    if (this.partial) {\n      re = '^(?:\\\\/|' + open + re.slice(1, -1) + close + ')$'\n    }\n\n    // can match anything, as long as it's not this.\n    if (this.negate) re = '^(?!' + re + ').+$'\n\n    try {\n      this.regexp = new RegExp(re, [...flags].join(''))\n      /* c8 ignore start */\n    } catch {\n      // should be impossible\n      this.regexp = false\n    }\n    /* c8 ignore stop */\n    return this.regexp\n  }\n\n  slashSplit(p: string) {\n    // if p starts with // on windows, we preserve that\n    // so that UNC paths aren't broken.  Otherwise, any number of\n    // / characters are coalesced into one, unless\n    // preserveMultipleSlashes is set to true.\n    if (this.preserveMultipleSlashes) {\n      return p.split('/')\n    } else if (this.isWindows && /^\\/\\/[^/]+/.test(p)) {\n      // add an extra '' for the one we lose\n      return ['', ...p.split(/\\/+/)]\n    } else {\n      return p.split(/\\/+/)\n    }\n  }\n\n  match(f: string, partial = this.partial) {\n    this.debug('match', f, this.pattern)\n    // short-circuit in the case of busted things.\n    // comments, etc.\n    if (this.comment) {\n      return false\n    }\n    if (this.empty) {\n      return f === ''\n    }\n\n    if (f === '/' && partial) {\n      return true\n    }\n\n    const options = this.options\n\n    // windows: need to use /, not \\\n    if (this.isWindows) {\n      f = f.split('\\\\').join('/')\n    }\n\n    // treat the test path as a set of pathparts.\n    const ff = this.slashSplit(f)\n    this.debug(this.pattern, 'split', ff)\n\n    // just ONE of the pattern sets in this.set needs to match\n    // in order for it to be valid.  If negating, then just one\n    // match means that we have failed.\n    // Either way, return on the first hit.\n\n    const set = this.set\n    this.debug(this.pattern, 'set', set)\n\n    // Find the basename of the path by looking for the last non-empty segment\n    let filename: string = ff[ff.length - 1]\n    if (!filename) {\n      for (let i = ff.length - 2; !filename && i >= 0; i--) {\n        filename = ff[i]\n      }\n    }\n\n    for (const pattern of set) {\n      let file = ff\n      if (options.matchBase && pattern.length === 1) {\n        file = [filename]\n      }\n      const hit = this.matchOne(file, pattern, partial)\n      if (hit) {\n        if (options.flipNegate) {\n          return true\n        }\n        return !this.negate\n      }\n    }\n\n    // didn't get any hits.  this is success if it's a negative\n    // pattern, failure otherwise.\n    if (options.flipNegate) {\n      return false\n    }\n    return this.negate\n  }\n\n  static defaults(def: MinimatchOptions) {\n    return minimatch.defaults(def).Minimatch\n  }\n}\n/* c8 ignore start */\nexport { AST } from './ast.js'\nexport { escape } from './escape.js'\nexport { unescape } from './unescape.js'\n/* c8 ignore stop */\nminimatch.AST = AST\nminimatch.Minimatch = Minimatch\nminimatch.escape = escape\nminimatch.unescape = unescape\n"]};xCimport type { MinimatchOptions } from './index.js';
/**
 * Un-escape a string that has been escaped with {@link escape}.
 *
 * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
 * square-bracket escapes are removed, but not backslash escapes.
 *
 * For example, it will turn the string `'[*]'` into `*`, but it will not
 * turn `'\\*'` into `'*'`, because `\` is a path separator in
 * `windowsPathsNoEscape` mode.
 *
 * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
 * backslash escapes are removed.
 *
 * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
 * or unescaped.
 *
 * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
 * unescaped.
 */
export declare const unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
//# sourceMappingURL=unescape.d.ts.mapGVxn"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.unescape = void 0;
/**
 * Un-escape a string that has been escaped with {@link escape}.
 *
 * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then
 * square-bracket escapes are removed, but not backslash escapes.
 *
 * For example, it will turn the string `'[*]'` into `*`, but it will not
 * turn `'\\*'` into `'*'`, because `\` is a path separator in
 * `windowsPathsNoEscape` mode.
 *
 * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and
 * backslash escapes are removed.
 *
 * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped
 * or unescaped.
 *
 * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be
 * unescaped.
 */
const unescape = (s, { windowsPathsNoEscape = false, magicalBraces = true, } = {}) => {
    if (magicalBraces) {
        return windowsPathsNoEscape ?
            s.replace(/\[([^/\\])\]/g, '$1')
            : s
                .replace(/((?!\\).|^)\[([^/\\])\]/g, '$1$2')
                .replace(/\\([^/])/g, '$1');
    }
    return windowsPathsNoEscape ?
        s.replace(/\[([^/\\{}])\]/g, '$1')
        : s
            .replace(/((?!\\).|^)\[([^/\\{}])\]/g, '$1$2')
            .replace(/\\([^/{}])/g, '$1');
};
exports.unescape = unescape;
//# sourceMappingURL=unescape.js.mapSx {"version":3,"file":"unescape.js","sourceRoot":"","sources":["../../src/unescape.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;;;;;GAkBG;AAEI,MAAM,QAAQ,GAAG,CACtB,CAAS,EACT,EACE,oBAAoB,GAAG,KAAK,EAC5B,aAAa,GAAG,IAAI,MACgD,EAAE,EACxE,EAAE;IACF,IAAI,aAAa,EAAE,CAAC;QAClB,OAAO,oBAAoB,CAAC,CAAC;YACzB,CAAC,CAAC,OAAO,CAAC,eAAe,EAAE,IAAI,CAAC;YAClC,CAAC,CAAC,CAAC;iBACE,OAAO,CAAC,0BAA0B,EAAE,MAAM,CAAC;iBAC3C,OAAO,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;IACnC,CAAC;IACD,OAAO,oBAAoB,CAAC,CAAC;QACzB,CAAC,CAAC,OAAO,CAAC,iBAAiB,EAAE,IAAI,CAAC;QACpC,CAAC,CAAC,CAAC;aACE,OAAO,CAAC,4BAA4B,EAAE,MAAM,CAAC;aAC7C,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC,CAAA;AACrC,CAAC,CAAA;AAnBY,QAAA,QAAQ,YAmBpB","sourcesContent":["import type { MinimatchOptions } from './index.js'\n\n/**\n * Un-escape a string that has been escaped with {@link escape}.\n *\n * If the {@link MinimatchOptions.windowsPathsNoEscape} option is used, then\n * square-bracket escapes are removed, but not backslash escapes.\n *\n * For example, it will turn the string `'[*]'` into `*`, but it will not\n * turn `'\\\\*'` into `'*'`, because `\\` is a path separator in\n * `windowsPathsNoEscape` mode.\n *\n * When `windowsPathsNoEscape` is not set, then both square-bracket escapes and\n * backslash escapes are removed.\n *\n * Slashes (and backslashes in `windowsPathsNoEscape` mode) cannot be escaped\n * or unescaped.\n *\n * When `magicalBraces` is not set, escapes of braces (`{` and `}`) will not be\n * unescaped.\n */\n\nexport const unescape = (\n  s: string,\n  {\n    windowsPathsNoEscape = false,\n    magicalBraces = true,\n  }: Pick<MinimatchOptions, 'windowsPathsNoEscape' | 'magicalBraces'> = {},\n) => {\n  if (magicalBraces) {\n    return windowsPathsNoEscape ?\n        s.replace(/\\[([^/\\\\])\\]/g, '$1')\n      : s\n          .replace(/((?!\\\\).|^)\\[([^/\\\\])\\]/g, '$1$2')\n          .replace(/\\\\([^/])/g, '$1')\n  }\n  return windowsPathsNoEscape ?\n      s.replace(/\\[([^/\\\\{}])\\]/g, '$1')\n    : s\n        .replace(/((?!\\\\).|^)\\[([^/\\\\{}])\\]/g, '$1$2')\n        .replace(/\\\\([^/{}])/g, '$1')\n}\n"]}>SDxD100644 assert-valid-pattern.d.ts 4קQDy%100644 assert-valid-pattern.d.ts.map 0Qu1ELq100644 assert-valid-pattern.js {SO 6oIsq100644 assert-valid-pattern.js.map UaZ\u|&@cU100644 ast.d.ts tϓ"uMnt"*DI100644 ast.d.ts.map ej,,AV:g;100644 ast.js 9Tedb<?100644 ast.js.map >+U-jP8100644 brace-expressions.d.ts W-vGOnL8U100644 brace-expressions.d.ts.map 	`xP:yHtv100644 brace-expressions.js KIBp@#100644 brace-expressions.js.map KZLpP6z100644 escape.d.ts $ktĊg]yX 100644 escape.d.ts.map g eNT{?nkD'\B100644 escape.js FX峢ƒ߶柳|@h100644 escape.js.map G@PhzJDq.C100644 index.d.ts ~3scˡ	100644 index.d.ts.map v ۑ́X!j100644 index.js jWL100644 index.js.map C:)E3&	$100644 package.json =U~5 JPV100644 unescape.d.ts ġDs&Ncf?100644 unescape.d.ts.map 	P,T^7ۆ100644 unescape.js Ά`R&SFXL^bw100644 unescape.js.map mPs_|'`o+x r&export 0i	PXx -pC,MAAM,CAACvnJxv/// parse a single path portion
var _a;
import { parseClass } from './brace-expressions.js';
import { unescape } from './unescape.js';
const types = new Set(['!', '?', '+', '*', '@']);
const isExtglobType = (c) => types.has(c);
const isExtglobAST = (c) => isExtglobType(c.type);
// Map of which extglob types can adopt the children of a nested extglob
//
// anything but ! can adopt a matching type:
// +(a|+(b|c)|d) => +(a|b|c|d)
// *(a|*(b|c)|d) => *(a|b|c|d)
// @(a|@(b|c)|d) => @(a|b|c|d)
// ?(a|?(b|c)|d) => ?(a|b|c|d)
//
// * can adopt anything, because 0 or repetition is allowed
// *(a|?(b|c)|d) => *(a|b|c|d)
// *(a|+(b|c)|d) => *(a|b|c|d)
// *(a|@(b|c)|d) => *(a|b|c|d)
//
// + can adopt @, because 1 or repetition is allowed
// +(a|@(b|c)|d) => +(a|b|c|d)
//
// + and @ CANNOT adopt *, because 0 would be allowed
// +(a|*(b|c)|d) => would match "", on *(b|c)
// @(a|*(b|c)|d) => would match "", on *(b|c)
//
// + and @ CANNOT adopt ?, because 0 would be allowed
// +(a|?(b|c)|d) => would match "", on ?(b|c)
// @(a|?(b|c)|d) => would match "", on ?(b|c)
//
// ? can adopt @, because 0 or 1 is allowed
// ?(a|@(b|c)|d) => ?(a|b|c|d)
//
// ? and @ CANNOT adopt * or +, because >1 would be allowed
// ?(a|*(b|c)|d) => would match bbb on *(b|c)
// @(a|*(b|c)|d) => would match bbb on *(b|c)
// ?(a|+(b|c)|d) => would match bbb on +(b|c)
// @(a|+(b|c)|d) => would match bbb on +(b|c)
//
// ! CANNOT adopt ! (nothing else can either)
// !(a|!(b|c)|d) => !(a|b|c|d) would fail to match on b (not not b|c)
//
// ! can adopt @
// !(a|@(b|c)|d) => !(a|b|c|d)
//
// ! CANNOT adopt *
// !(a|*(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed
//
// ! CANNOT adopt +
// !(a|+(b|c)|d) => !(a|b|c|d) would match on bbb, not allowed
//
// ! CANNOT adopt ?
// x!(a|?(b|c)|d) => x!(a|b|c|d) would fail to match "x"
const adoptionMap = new Map([
    ['!', ['@']],
    ['?', ['?', '@']],
    ['@', ['@']],
    ['*', ['*', '+', '?', '@']],
    ['+', ['+', '@']],
]);
// nested extglobs that can be adopted in, but with the addition of
// a blank '' element.
const adoptionWithSpaceMap = new Map([
    ['!', ['?']],
    ['@', ['?']],
    ['+', ['?', '*']],
]);
// union of the previous two maps
const adoptionAnyMap = new Map([
    ['!', ['?', '@']],
    ['?', ['?', '@']],
    ['@', ['?', '@']],
    ['*', ['*', '+', '?', '@']],
    ['+', ['+', '@', '?', '*']],
]);
// Extglobs that can take over their parent if they are the only child
// the key is parent, value maps child to resulting extglob parent type
// '@' is omitted because it's a special case. An `@` extglob with a single
// member can always be usurped by that subpattern.
const usurpMap = new Map([
    ['!', new Map([['!', '@']])],
    [
        '?',
        new Map([
            ['*', '*'],
            ['+', '*'],
        ]),
    ],
    [
        '@',
        new Map([
            ['!', '!'],
            ['?', '?'],
            ['@', '@'],
            ['*', '*'],
            ['+', '+'],
        ]),
    ],
    [
        '+',
        new Map([
            ['?', '*'],
            ['*', '*'],
        ]),
    ],
]);
// Patterns that get prepended to bind to the start of either the
// entire string, or just a single path portion, to prevent dots
// and/or traversal patterns, when needed.
// Exts don't need the ^ or / bit, because the root binds that already.
const startNoTraversal = '(?!(?:^|/)\\.\\.?(?:$|/))';
const startNoDot = '(?!\\.)';
// characters that indicate a start of pattern needs the "no dots" bit,
// because a dot *might* be matched. ( is not in the list, because in
// the case of a child extglob, it will handle the prevention itself.
const addPatternStart = new Set(['[', '.']);
// cases where traversal is A-OK, no dot prevention needed
const justDots = new Set(['..', '.']);
const reSpecials = new Set('().*{}+?[]^$\\!');
const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
// any single thing other than /
const qmark = '[^/]';
// * => any number of characters
const star = qmark + '*?';
// use + when we need to ensure that *something* matches, because the * is
// the only thing in the path portion.
const starNoEmpty = qmark + '+?';
// remove the \ chars that we added if we end up doing a nonmagic compare
// const deslash = (s: string) => s.replace(/\\(.)/g, '$1')
let ID = 0;
export class AST {
    type;
    #root;
    #hasMagic;
    #uflag = false;
    #parts = [];
    #parent;
    #parentIndex;
    #negs;
    #filledNegs = false;
    #options;
    #toString;
    // set to true if it's an extglob with no children
    // (which really means one child of '')
    #emptyExt = false;
    id = ++ID;
    get depth() {
        return (this.#parent?.depth ?? -1) + 1;
    }
    [Symbol.for('nodejs.util.inspect.custom')]() {
        return {
            '@@type': 'AST',
            id: this.id,
            type: this.type,
            root: this.#root.id,
            parent: this.#parent?.id,
            depth: this.depth,
            partsLength: this.#parts.length,
            parts: this.#parts,
        };
    }
    constructor(type, parent, options = {}) {
        this.type = type;
        // extglobs are inherently magical
        if (type)
            this.#hasMagic = true;
        this.#parent = parent;
        this.#root = this.#parent ? this.#parent.#root : this;
        this.#options = this.#root === this ? options : this.#root.#options;
        this.#negs = this.#root === this ? [] : this.#root.#negs;
        if (type === '!' && !this.#root.#filledNegs)
            this.#negs.push(this);
        this.#parentIndex = this.#parent ? this.#parent.#parts.length : 0;
    }
    get hasMagic() {
        /* c8 ignore start */
        if (this.#hasMagic !== undefined)
            return this.#hasMagic;
        /* c8 ignore stop */
        for (const p of this.#parts) {
            if (typeof p === 'string')
                continue;
            if (p.type || p.hasMagic)
                return (this.#hasMagic = true);
        }
        // note: will be undefined until we generate the regexp src and find out
        return this.#hasMagic;
    }
    // reconstructs the pattern
    toString() {
        return (this.#toString !== undefined ? this.#toString
            : !this.type ?
                (this.#toString = this.#parts.map(p => String(p)).join(''))
                : (this.#toString =
                    this.type +
                        '(' +
                        this.#parts.map(p => String(p)).join('|') +
                        ')'));
    }
    #fillNegs() {
        /* c8 ignore start */
        if (this !== this.#root)
            throw new Error('should only call on root');
        if (this.#filledNegs)
            return this;
        /* c8 ignore stop */
        // call toString() once to fill this out
        this.toString();
        this.#filledNegs = true;
        let n;
        while ((n = this.#negs.pop())) {
            if (n.type !== '!')
                continue;
            // walk up the tree, appending everthing that comes AFTER parentIndex
            let p = n;
            let pp = p.#parent;
            while (pp) {
                for (let i = p.#parentIndex + 1; !pp.type && i < pp.#parts.length; i++) {
                    for (const part of n.#parts) {
                        /* c8 ignore start */
                        if (typeof part === 'string') {
                            throw new Error('string part in extglob AST??');
                        }
                        /* c8 ignore stop */
                        part.copyIn(pp.#parts[i]);
                    }
                }
                p = pp;
                pp = p.#parent;
            }
        }
        return this;
    }
    push(...parts) {
        for (const p of parts) {
            if (p === '')
                continue;
            /* c8 ignore start */
            if (typeof p !== 'string' &&
                !(p instanceof _a && p.#parent === this)) {
                throw new Error('invalid part: ' + p);
            }
            /* c8 ignore stop */
            this.#parts.push(p);
        }
    }
    toJSON() {
        const ret = this.type === null ?
            this.#parts
                .slice()
                .map(p => (typeof p === 'string' ? p : p.toJSON()))
            : [this.type, ...this.#parts.map(p => p.toJSON())];
        if (this.isStart() && !this.type)
            ret.unshift([]);
        if (this.isEnd() &&
            (this === this.#root ||
                (this.#root.#filledNegs && this.#parent?.type === '!'))) {
            ret.push({});
        }
        return ret;
    }
    isStart() {
        if (this.#root === this)
            return true;
        // if (this.type) return !!this.#parent?.isStart()
        if (!this.#parent?.isStart())
            return false;
        if (this.#parentIndex === 0)
            return true;
        // if everything AHEAD of this is a negation, then it's still the "start"
        const p = this.#parent;
        for (let i = 0; i < this.#parentIndex; i++) {
            const pp = p.#parts[i];
            if (!(pp instanceof _a && pp.type === '!')) {
                return false;
            }
        }
        return true;
    }
    isEnd() {
        if (this.#root === this)
            return true;
        if (this.#parent?.type === '!')
            return true;
        if (!this.#parent?.isEnd())
            return false;
        if (!this.type)
            return this.#parent?.isEnd();
        // if not root, it'll always have a parent
        /* c8 ignore start */
        const pl = this.#parent ? this.#parent.#parts.length : 0;
        /* c8 ignore stop */
        return this.#parentIndex === pl - 1;
    }
    copyIn(part) {
        if (typeof part === 'string')
            this.push(part);
        else
            this.push(part.clone(this));
    }
    clone(parent) {
        const c = new _a(this.type, parent);
        for (const p of this.#parts) {
            c.copyIn(p);
        }
        return c;
    }
    static #parseAST(str, ast, pos, opt, extDepth) {
        const maxDepth = opt.maxExtglobRecursion ?? 2;
        let escaping = false;
        let inBrace = false;
        let braceStart = -1;
        let braceNeg = false;
        if (ast.type === null) {
            // outside of a extglob, append until we find a start
            let i = pos;
            let acc = '';
            while (i < str.length) {
                const c = str.charAt(i++);
                // still accumulate escapes at this point, but we do ignore
                // starts that are escaped
                if (escaping || c === '\\') {
                    escaping = !escaping;
                    acc += c;
                    continue;
                }
                if (inBrace) {
                    if (i === braceStart + 1) {
                        if (c === '^' || c === '!') {
                            braceNeg = true;
                        }
                    }
                    else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
                        inBrace = false;
                    }
                    acc += c;
                    continue;
                }
                else if (c === '[') {
                    inBrace = true;
                    braceStart = i;
                    braceNeg = false;
                    acc += c;
                    continue;
                }
                // we don't have to check for adoption here, because that's
                // done at the other recursion point.
                const doRecurse = !opt.noext &&
                    isExtglobType(c) &&
                    str.charAt(i) === '(' &&
                    extDepth <= maxDepth;
                if (doRecurse) {
                    ast.push(acc);
                    acc = '';
                    const ext = new _a(c, ast);
                    i = _a.#parseAST(str, ext, i, opt, extDepth + 1);
                    ast.push(ext);
                    continue;
                }
                acc += c;
            }
            ast.push(acc);
            return i;
        }
        // some kind of extglob, pos is at the (
        // find the next | or )
        let i = pos + 1;
        let part = new _a(null, ast);
        const parts = [];
        let acc = '';
        while (i < str.length) {
            const c = str.charAt(i++);
            // still accumulate escapes at this point, but we do ignore
            // starts that are escaped
            if (escaping || c === '\\') {
                escaping = !escaping;
                acc += c;
                continue;
            }
            if (inBrace) {
                if (i === braceStart + 1) {
                    if (c === '^' || c === '!') {
                        braceNeg = true;
                    }
                }
                else if (c === ']' && !(i === braceStart + 2 && braceNeg)) {
                    inBrace = false;
                }
                acc += c;
                continue;
            }
            else if (c === '[') {
                inBrace = true;
                braceStart = i;
                braceNeg = false;
                acc += c;
                continue;
            }
            const doRecurse = !opt.noext &&
                isExtglobType(c) &&
                str.charAt(i) === '(' &&
                /* c8 ignore start - the maxDepth is sufficient here */
                (extDepth <= maxDepth || (ast && ast.#canAdoptType(c)));
            /* c8 ignore stop */
            if (doRecurse) {
                const depthAdd = ast && ast.#canAdoptType(c) ? 0 : 1;
                part.push(acc);
                acc = '';
                const ext = new _a(c, part);
                part.push(ext);
                i = _a.#parseAST(str, ext, i, opt, extDepth + depthAdd);
                continue;
            }
            if (c === '|') {
                part.push(acc);
                acc = '';
                parts.push(part);
                part = new _a(null, ast);
                continue;
            }
            if (c === ')') {
                if (acc === '' && ast.#parts.length === 0) {
                    ast.#emptyExt = true;
                }
                part.push(acc);
                acc = '';
                ast.push(...parts, part);
                return i;
            }
            acc += c;
        }
        // unfinished extglob
        // if we got here, it was a malformed extglob! not an extglob, but
        // maybe something else in there.
        ast.type = null;
        ast.#hasMagic = undefined;
        ast.#parts = [str.substring(pos - 1)];
        return i;
    }
    #canAdoptWithSpace(child) {
        return this.#canAdopt(child, adoptionWithSpaceMap);
    }
    #canAdopt(child, map = adoptionMap) {
        if (!child ||
            typeof child !== 'object' ||
            child.type !== null ||
            child.#parts.length !== 1 ||
            this.type === null) {
            return false;
        }
        const gc = child.#parts[0];
        if (!gc || typeof gc !== 'object' || gc.type === null) {
            return false;
        }
        return this.#canAdoptType(gc.type, map);
    }
    #canAdoptType(c, map = adoptionAnyMap) {
        return !!map.get(this.type)?.includes(c);
    }
    #adoptWithSpace(child, index) {
        const gc = child.#parts[0];
        const blank = new _a(null, gc, this.options);
        blank.#parts.push('');
        gc.push(blank);
        this.#adopt(child, index);
    }
    #adopt(child, index) {
        const gc = child.#parts[0];
        this.#parts.splice(index, 1, ...gc.#parts);
        for (const p of gc.#parts) {
            if (typeof p === 'object')
                p.#parent = this;
        }
        this.#toString = undefined;
    }
    #canUsurpType(c) {
        const m = usurpMap.get(this.type);
        return !!m?.has(c);
    }
    #canUsurp(child) {
        if (!child ||
            typeof child !== 'object' ||
            child.type !== null ||
            child.#parts.length !== 1 ||
            this.type === null ||
            this.#parts.length !== 1) {
            return false;
        }
        const gc = child.#parts[0];
        if (!gc || typeof gc !== 'object' || gc.type === null) {
            return false;
        }
        return this.#canUsurpType(gc.type);
    }
    #usurp(child) {
        const m = usurpMap.get(this.type);
        const gc = child.#parts[0];
        const nt = m?.get(gc.type);
        /* c8 ignore start - impossible */
        if (!nt)
            return false;
        /* c8 ignore stop */
        this.#parts = gc.#parts;
        for (const p of this.#parts) {
            if (typeof p === 'object') {
                p.#parent = this;
            }
        }
        this.type = nt;
        this.#toString = undefined;
        this.#emptyExt = false;
    }
    static fromGlob(pattern, options = {}) {
        const ast = new _a(null, undefined, options);
        _a.#parseAST(pattern, ast, 0, options, 0);
        return ast;
    }
    // returns the regular expression if there's magic, or the unescaped
    // string if not.
    toMMPattern() {
        // should only be called on root
        /* c8 ignore start */
        if (this !== this.#root)
            return this.#root.toMMPattern();
        /* c8 ignore stop */
        const glob = this.toString();
        const [re, body, hasMagic, uflag] = this.toRegExpSource();
        // if we're in nocase mode, and not nocaseMagicOnly, then we do
        // still need a regular expression if we have to case-insensitively
        // match capital/lowercase characters.
        const anyMagic = hasMagic ||
            this.#hasMagic ||
            (this.#options.nocase &&
                !this.#options.nocaseMagicOnly &&
                glob.toUpperCase() !== glob.toLowerCase());
        if (!anyMagic) {
            return body;
        }
        const flags = (this.#options.nocase ? 'i' : '') + (uflag ? 'u' : '');
        return Object.assign(new RegExp(`^${re}$`, flags), {
            _src: re,
            _glob: glob,
        });
    }
    get options() {
        return this.#options;
    }
    // returns the string match, the regexp source, whether there's magic
    // in the regexp (so a regular expression is required) and whether or
    // not the uflag is needed for the regular expression (for posix classes)
    // TODO: instead of injecting the start/end at this point, just return
    // the BODY of the regexp, along with the start/end portions suitable
    // for binding the start/end in either a joined full-path makeRe context
    // (where we bind to (^|/), or a standalone matchPart context (where
    // we bind to ^, and not /).  Otherwise slashes get duped!
    //
    // In part-matching mode, the start is:
    // - if not isStart: nothing
    // - if traversal possible, but not allowed: ^(?!\.\.?$)
    // - if dots allowed or not possible: ^
    // - if dots possible and not allowed: ^(?!\.)
    // end is:
    // - if not isEnd(): nothing
    // - else: $
    //
    // In full-path matching mode, we put the slash at the START of the
    // pattern, so start is:
    // - if first pattern: same as part-matching mode
    // - if not isStart(): nothing
    // - if traversal possible, but not allowed: /(?!\.\.?(?:$|/))
    // - if dots allowed or not possible: /
    // - if dots possible and not allowed: /(?!\.)
    // end is:
    // - if last pattern, same as part-matching mode
    // - else nothing
    //
    // Always put the (?:$|/) on negated tails, though, because that has to be
    // there to bind the end of the negated pattern portion, and it's easier to
    // just stick it in now rather than try to inject it later in the middle of
    // the pattern.
    //
    // We can just always return the same end, and leave it up to the caller
    // to know whether it's going to be used joined or in parts.
    // And, if the start is adjusted slightly, can do the same there:
    // - if not isStart: nothing
    // - if traversal possible, but not allowed: (?:/|^)(?!\.\.?$)
    // - if dots allowed or not possible: (?:/|^)
    // - if dots possible and not allowed: (?:/|^)(?!\.)
    //
    // But it's better to have a simpler binding without a conditional, for
    // performance, so probably better to return both start options.
    //
    // Then the caller just ignores the end if it's not the first pattern,
    // and the start always gets applied.
    //
    // But that's always going to be $ if it's the ending pattern, or nothing,
    // so the caller can just attach $ at the end of the pattern when building.
    //
    // So the todo is:
    // - better detect what kind of start is needed
    // - return both flavors of starting pattern
    // - attach $ at the end of the pattern when creating the actual RegExp
    //
    // Ah, but wait, no, that all only applies to the root when the first pattern
    // is not an extglob. If the first pattern IS an extglob, then we need all
    // that dot prevention biz to live in the extglob portions, because eg
    // +(*|.x*) can match .xy but not .yx.
    //
    // So, return the two flavors if it's #root and the first child is not an
    // AST, otherwise leave it to the child AST to handle it, and there,
    // use the (?:^|/) style of start binding.
    //
    // Even simplified further:
    // - Since the start for a join is eg /(?!\.) and the start for a part
    // is ^(?!\.), we can just prepend (?!\.) to the pattern (either root
    // or start or whatever) and prepend ^ or / at the Regexp construction.
    toRegExpSource(allowDot) {
        const dot = allowDot ?? !!this.#options.dot;
        if (this.#root === this) {
            this.#flatten();
            this.#fillNegs();
        }
        if (!isExtglobAST(this)) {
            const noEmpty = this.isStart() &&
                this.isEnd() &&
                !this.#parts.some(s => typeof s !== 'string');
            const src = this.#parts
                .map(p => {
                const [re, _, hasMagic, uflag] = typeof p === 'string' ?
                    _a.#parseGlob(p, this.#hasMagic, noEmpty)
                    : p.toRegExpSource(allowDot);
                this.#hasMagic = this.#hasMagic || hasMagic;
                this.#uflag = this.#uflag || uflag;
                return re;
            })
                .join('');
            let start = '';
            if (this.isStart()) {
                if (typeof this.#parts[0] === 'string') {
                    // this is the string that will match the start of the pattern,
                    // so we need to protect against dots and such.
                    // '.' and '..' cannot match unless the pattern is that exactly,
                    // even if it starts with . or dot:true is set.
                    const dotTravAllowed = this.#parts.length === 1 && justDots.has(this.#parts[0]);
                    if (!dotTravAllowed) {
                        const aps = addPatternStart;
                        // check if we have a possibility of matching . or ..,
                        // and prevent that.
                        const needNoTrav = 
                        // dots are allowed, and the pattern starts with [ or .
                        (dot && aps.has(src.charAt(0))) ||
                            // the pattern starts with \., and then [ or .
                            (src.startsWith('\\.') && aps.has(src.charAt(2))) ||
                            // the pattern starts with \.\., and then [ or .
                            (src.startsWith('\\.\\.') && aps.has(src.charAt(4)));
                        // no need to prevent dots if it can't match a dot, or if a
                        // sub-pattern will be preventing it anyway.
                        const needNoDot = !dot && !allowDot && aps.has(src.charAt(0));
                        start =
                            needNoTrav ? startNoTraversal
                                : needNoDot ? startNoDot
                                    : '';
                    }
                }
            }
            // append the "end of path portion" pattern to negation tails
            let end = '';
            if (this.isEnd() &&
                this.#root.#filledNegs &&
                this.#parent?.type === '!') {
                end = '(?:$|\\/)';
            }
            const final = start + src + end;
            return [
                final,
                unescape(src),
                (this.#hasMagic = !!this.#hasMagic),
                this.#uflag,
            ];
        }
        // We need to calculate the body *twice* if it's a repeat pattern
        // at the start, once in nodot mode, then again in dot mode, so a
        // pattern like *(?) can match 'x.y'
        const repeated = this.type === '*' || this.type === '+';
        // some kind of extglob
        const start = this.type === '!' ? '(?:(?!(?:' : '(?:';
        let body = this.#partsToRegExp(dot);
        if (this.isStart() && this.isEnd() && !body && this.type !== '!') {
            // invalid extglob, has to at least be *something* present, if it's
            // the entire path portion.
            const s = this.toString();
            const me = this;
            me.#parts = [s];
            me.type = null;
            me.#hasMagic = undefined;
            return [s, unescape(this.toString()), false, false];
        }
        let bodyDotAllowed = !repeated || allowDot || dot || !startNoDot ?
            ''
            : this.#partsToRegExp(true);
        if (bodyDotAllowed === body) {
            bodyDotAllowed = '';
        }
        if (bodyDotAllowed) {
            body = `(?:${body})(?:${bodyDotAllowed})*?`;
        }
        // an empty !() is exactly equivalent to a starNoEmpty
        let final = '';
        if (this.type === '!' && this.#emptyExt) {
            final = (this.isStart() && !dot ? startNoDot : '') + starNoEmpty;
        }
        else {
            const close = this.type === '!' ?
                // !() must match something,but !(x) can match ''
                '))' +
                    (this.isStart() && !dot && !allowDot ? startNoDot : '') +
                    star +
                    ')'
                : this.type === '@' ? ')'
                    : this.type === '?' ? ')?'
                        : this.type === '+' && bodyDotAllowed ? ')'
                            : this.type === '*' && bodyDotAllowed ? `)?`
                                : `)${this.type}`;
            final = start + body + close;
        }
        return [
            final,
            unescape(body),
            (this.#hasMagic = !!this.#hasMagic),
            this.#uflag,
        ];
    }
    #flatten() {
        if (!isExtglobAST(this)) {
            for (const p of this.#parts) {
                if (typeof p === 'object') {
                    p.#flatten();
                }
            }
        }
        else {
            // do up to 10 passes to flatten as much as possible
            let iterations = 0;
            let done = false;
            do {
                done = true;
                for (let i = 0; i < this.#parts.length; i++) {
                    const c = this.#parts[i];
                    if (typeof c === 'object') {
                        c.#flatten();
                        if (this.#canAdopt(c)) {
                            done = false;
                            this.#adopt(c, i);
                        }
                        else if (this.#canAdoptWithSpace(c)) {
                            done = false;
                            this.#adoptWithSpace(c, i);
                        }
                        else if (this.#canUsurp(c)) {
                            done = false;
                            this.#usurp(c);
                        }
                    }
                }
            } while (!done && ++iterations < 10);
        }
        this.#toString = undefined;
    }
    #partsToRegExp(dot) {
        return this.#parts
            .map(p => {
            // extglob ASTs should only contain parent ASTs
            /* c8 ignore start */
            if (typeof p === 'string') {
                throw new Error('string type in extglob ast??');
            }
            /* c8 ignore stop */
            // can ignore hasMagic, because extglobs are already always magic
            const [re, _, _hasMagic, uflag] = p.toRegExpSource(dot);
            this.#uflag = this.#uflag || uflag;
            return re;
        })
            .filter(p => !(this.isStart() && this.isEnd()) || !!p)
            .join('|');
    }
    static #parseGlob(glob, hasMagic, noEmpty = false) {
        let escaping = false;
        let re = '';
        let uflag = false;
        // multiple stars that aren't globstars coalesce into one *
        let inStar = false;
        for (let i = 0; i < glob.length; i++) {
            const c = glob.charAt(i);
            if (escaping) {
                escaping = false;
                re += (reSpecials.has(c) ? '\\' : '') + c;
                continue;
            }
            if (c === '*') {
                if (inStar)
                    continue;
                inStar = true;
                re += noEmpty && /^[*]+$/.test(glob) ? starNoEmpty : star;
                hasMagic = true;
                continue;
            }
            else {
                inStar = false;
            }
            if (c === '\\') {
                if (i === glob.length - 1) {
                    re += '\\\\';
                }
                else {
                    escaping = true;
                }
                continue;
            }
            if (c === '[') {
                const [src, needUflag, consumed, magic] = parseClass(glob, i);
                if (consumed) {
                    re += src;
                    uflag = uflag || needUflag;
                    i += consumed - 1;
                    hasMagic = hasMagic || magic;
                    continue;
                }
            }
            if (c === '?') {
                re += qmark;
                hasMagic = true;
                continue;
            }
            re += regExpEscape(c);
        }
        return [re, unescape(glob), !!hasMagic, uflag];
    }
}
_a = AST;
//# sourceMappingURL=ast.js.map<Qx 5c`AAAA,8BAA8B;;AAE9B,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAEnD,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAAM,OAAOTAQAAQ,C.N6
@>QQAAQ,CUYUAAUUjaQAAQpFp
W?
/cRcwL}=h?x ,+rfexport BB-nx$ RR7B,MAAM,CAACb<x 	fexport z0"zsx2 i"AAEA;;;;;;;;;;;GAWG;AACH,MAAM,CAACexx"Timport { expand } from 'brace-expansion';
import { assertValidPattern } from './assert-valid-pattern.js';
import { AST } from './ast.js';
import { escape } from './escape.js';
import { unescape } from './unescape.js';
export const minimatch = (p, pattern, options = {}) => {
    assertValidPattern(pattern);
    // shortcut: comments match nothing.
    if (!options.nocomment && pattern.charAt(0) === '#') {
        return false;
    }
    return new Minimatch(pattern, options).match(p);
};
// Optimized checking for the most common glob patterns.
const starDotExtRE = /^\*+([^+@!?*[(]*)$/;
const starDotExtTest = (ext) => (f) => !f.startsWith('.') && f.endsWith(ext);
const starDotExtTestDot = (ext) => (f) => f.endsWith(ext);
const starDotExtTestNocase = (ext) => {
    ext = ext.toLowerCase();
    return (f) => !f.startsWith('.') && f.toLowerCase().endsWith(ext);
};
const starDotExtTestNocaseDot = (ext) => {
    ext = ext.toLowerCase();
    return (f) => f.toLowerCase().endsWith(ext);
};
const starDotStarRE = /^\*+\.\*+$/;
const starDotStarTest = (f) => !f.startsWith('.') && f.includes('.');
const starDotStarTestDot = (f) => f !== '.' && f !== '..' && f.includes('.');
const dotStarRE = /^\.\*+$/;
const dotStarTest = (f) => f !== '.' && f !== '..' && f.startsWith('.');
const starRE = /^\*+$/;
const starTest = (f) => f.length !== 0 && !f.startsWith('.');
const starTestDot = (f) => f.length !== 0 && f !== '.' && f !== '..';
const qmarksRE = /^\?+([^+@!?*[(]*)?$/;
const qmarksTestNocase = ([$0, ext = '']) => {
    const noext = qmarksTestNoExt([$0]);
    if (!ext)
        return noext;
    ext = ext.toLowerCase();
    return (f) => noext(f) && f.toLowerCase().endsWith(ext);
};
const qmarksTestNocaseDot = ([$0, ext = '']) => {
    const noext = qmarksTestNoExtDot([$0]);
    if (!ext)
        return noext;
    ext = ext.toLowerCase();
    return (f) => noext(f) && f.toLowerCase().endsWith(ext);
};
const qmarksTestDot = ([$0, ext = '']) => {
    const noext = qmarksTestNoExtDot([$0]);
    return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
};
const qmarksTest = ([$0, ext = '']) => {
    const noext = qmarksTestNoExt([$0]);
    return !ext ? noext : (f) => noext(f) && f.endsWith(ext);
};
const qmarksTestNoExt = ([$0]) => {
    const len = $0.length;
    return (f) => f.length === len && !f.startsWith('.');
};
const qmarksTestNoExtDot = ([$0]) => {
    const len = $0.length;
    return (f) => f.length === len && f !== '.' && f !== '..';
};
/* c8 ignore start */
const defaultPlatform = (typeof process === 'object' && process ?
    (typeof process.env === 'object' &&
        process.env &&
        process.env.__MINIMATCH_TESTING_PLATFORM__) ||
        process.platform
    : 'posix');
const path = {
    win32: { sep: '\\' },
    posix: { sep: '/' },
};
/* c8 ignore stop */
export const sep = defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep;
minimatch.sep = sep;
export const GLOBSTAR = Symbol('globstar **');
minimatch.GLOBSTAR = GLOBSTAR;
// any single thing other than /
// don't need to escape / when using new RegExp()
const qmark = '[^/]';
// * => any number of characters
const star = qmark + '*?';
// ** when dots are allowed.  Anything goes, except .. and .
// not (^ or / followed by one or two dots followed by $ or /),
// followed by anything, any number of times.
const twoStarDot = '(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?';
// not a ^ or / followed by a dot,
// followed by anything, any number of times.
const twoStarNoDot = '(?:(?!(?:\\/|^)\\.).)*?';
export const filter = (pattern, options = {}) => (p) => minimatch(p, pattern, options);
minimatch.filter = filter;
const ext = (a, b = {}) => Object.assign({}, a, b);
export const defaults = (def) => {
    if (!def || typeof def !== 'object' || !Object.keys(def).length) {
        return minimatch;
    }
    const orig = minimatch;
    const m = (p, pattern, options = {}) => orig(p, pattern, ext(def, options));
    return Object.assign(m, {
        Minimatch: class Minimatch extends orig.Minimatch {
            constructor(pattern, options = {}) {
                super(pattern, ext(def, options));
            }
            static defaults(options) {
                return orig.defaults(ext(def, options)).Minimatch;
            }
        },
        AST: class AST extends orig.AST {
            /* c8 ignore start */
            constructor(type, parent, options = {}) {
                super(type, parent, ext(def, options));
            }
            /* c8 ignore stop */
            static fromGlob(pattern, options = {}) {
                return orig.AST.fromGlob(pattern, ext(def, options));
            }
        },
        unescape: (s, options = {}) => orig.unescape(s, ext(def, options)),
        escape: (s, options = {}) => orig.escape(s, ext(def, options)),
        filter: (pattern, options = {}) => orig.filter(pattern, ext(def, options)),
        defaults: (options) => orig.defaults(ext(def, options)),
        makeRe: (pattern, options = {}) => orig.makeRe(pattern, ext(def, options)),
        braceExpand: (pattern, options = {}) => orig.braceExpand(pattern, ext(def, options)),
        match: (list, pattern, options = {}) => orig.match(list, pattern, ext(def, options)),
        sep: orig.sep,
        GLOBSTAR: GLOBSTAR,
    });
};
minimatch.defaults = defaults;
// Brace expansion:
// a{b,c}d -> abd acd
// a{b,}c -> abc ac
// a{0..3}d -> a0d a1d a2d a3d
// a{b,c{d,e}f}g -> abg acdfg acefg
// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg
//
// Invalid sets are not expanded.
// a{2..}b -> a{2..}b
// a{b}c -> a{b}c
export const braceExpand = (pattern, options = {}) => {
    assertValidPattern(pattern);
    // Thanks to Yeting Li <https://github.com/yetingli> for
    // improving this regexp to avoid a ReDOS vulnerability.
    if (options.nobrace || !/\{(?:(?!\{).)*\}/.test(pattern)) {
        // shortcut. no need to expand.
        return [pattern];
    }
    return expand(pattern, { max: options.braceExpandMax });
};
minimatch.braceExpand = braceExpand;
// parse a component of the expanded set.
// At this point, no pattern may contain "/" in it
// so we're going to return a 2d array, where each entry is the full
// pattern, split on '/', and then turned into a regular expression.
// A regexp is made at the end which joins each array with an
// escaped /, and another full one which joins each regexp with |.
//
// Following the lead of Bash 4.1, note that "**" only has special meaning
// when it is the *only* thing in a path portion.  Otherwise, any series
// of * is equivalent to a single *.  Globstar behavior is enabled by
// default, and can be disabled by setting options.noglobstar.
export const makeRe = (pattern, options = {}) => new Minimatch(pattern, options).makeRe();
minimatch.makeRe = makeRe;
export const match = (list, pattern, options = {}) => {
    const mm = new Minimatch(pattern, options);
    list = list.filter(f => mm.match(f));
    if (mm.options.nonull && !list.length) {
        list.push(pattern);
    }
    return list;
};
minimatch.match = match;
// replace stuff like \* with *
const globMagic = /[?*]|[+@!]\(.*?\)|\[|\]/;
const regExpEscape = (s) => s.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
export class Minimatch {
    options;
    set;
    pattern;
    windowsPathsNoEscape;
    nonegate;
    negate;
    comment;
    empty;
    preserveMultipleSlashes;
    partial;
    globSet;
    globParts;
    nocase;
    isWindows;
    platform;
    windowsNoMagicRoot;
    maxGlobstarRecursion;
    regexp;
    constructor(pattern, options = {}) {
        assertValidPattern(pattern);
        options = options || {};
        this.options = options;
        this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200;
        this.pattern = pattern;
        this.platform = options.platform || defaultPlatform;
        this.isWindows = this.platform === 'win32';
        // avoid the annoying deprecation flag lol
        const awe = ('allowWindow' + 'sEscape');
        this.windowsPathsNoEscape =
            !!options.windowsPathsNoEscape || options[awe] === false;
        if (this.windowsPathsNoEscape) {
            this.pattern = this.pattern.replace(/\\/g, '/');
        }
        this.preserveMultipleSlashes = !!options.preserveMultipleSlashes;
        this.regexp = null;
        this.negate = false;
        this.nonegate = !!options.nonegate;
        this.comment = false;
        this.empty = false;
        this.partial = !!options.partial;
        this.nocase = !!this.options.nocase;
        this.windowsNoMagicRoot =
            options.windowsNoMagicRoot !== undefined ?
                options.windowsNoMagicRoot
                : !!(this.isWindows && this.nocase);
        this.globSet = [];
        this.globParts = [];
        this.set = [];
        // make the set of regexps etc.
        this.make();
    }
    hasMagic() {
        if (this.options.magicalBraces && this.set.length > 1) {
            return true;
        }
        for (const pattern of this.set) {
            for (const part of pattern) {
                if (typeof part !== 'string')
                    return true;
            }
        }
        return false;
    }
    debug(..._) { }
    make() {
        const pattern = this.pattern;
        const options = this.options;
        // empty patterns and comments match nothing.
        if (!options.nocomment && pattern.charAt(0) === '#') {
            this.comment = true;
            return;
        }
        if (!pattern) {
            this.empty = true;
            return;
        }
        // step 1: figure out negation, etc.
        this.parseNegate();
        // step 2: expand braces
        this.globSet = [...new Set(this.braceExpand())];
        if (options.debug) {
            //oxlint-disable-next-line no-console
            this.debug = (...args) => console.error(...args);
        }
        this.debug(this.pattern, this.globSet);
        // step 3: now we have a set, so turn each one into a series of
        // path-portion matching patterns.
        // These will be regexps, except in the case of "**", which is
        // set to the GLOBSTAR object for globstar behavior,
        // and will not contain any / characters
        //
        // First, we preprocess to make the glob pattern sets a bit simpler
        // and deduped.  There are some perf-killing patterns that can cause
        // problems with a glob walk, but we can simplify them down a bit.
        const rawGlobParts = this.globSet.map(s => this.slashSplit(s));
        this.globParts = this.preprocess(rawGlobParts);
        this.debug(this.pattern, this.globParts);
        // glob --> regexps
        let set = this.globParts.map((s, _, __) => {
            if (this.isWindows && this.windowsNoMagicRoot) {
                // check if it's a drive or unc path.
                const isUNC = s[0] === '' &&
                    s[1] === '' &&
                    (s[2] === '?' || !globMagic.test(s[2])) &&
                    !globMagic.test(s[3]);
                const isDrive = /^[a-z]:/i.test(s[0]);
                if (isUNC) {
                    return [
                        ...s.slice(0, 4),
                        ...s.slice(4).map(ss => this.parse(ss)),
                    ];
                }
                else if (isDrive) {
                    return [s[0], ...s.slice(1).map(ss => this.parse(ss))];
                }
            }
            return s.map(ss => this.parse(ss));
        });
        this.debug(this.pattern, set);
        // filter out everything that didn't compile properly.
        this.set = set.filter(s => s.indexOf(false) === -1);
        // do not treat the ? in UNC paths as magic
        if (this.isWindows) {
            for (let i = 0; i < this.set.length; i++) {
                const p = this.set[i];
                if (p[0] === '' &&
                    p[1] === '' &&
                    this.globParts[i][2] === '?' &&
                    typeof p[3] === 'string' &&
                    /^[a-z]:$/i.test(p[3])) {
                    p[2] = '?';
                }
            }
        }
        this.debug(this.pattern, this.set);
    }
    // various transforms to equivalent pattern sets that are
    // faster to process in a filesystem walk.  The goal is to
    // eliminate what we can, and push all ** patterns as far
    // to the right as possible, even if it increases the number
    // of patterns that we have to process.
    preprocess(globParts) {
        // if we're not in globstar mode, then turn ** into *
        if (this.options.noglobstar) {
            for (const partset of globParts) {
                for (let j = 0; j < partset.length; j++) {
                    if (partset[j] === '**') {
                        partset[j] = '*';
                    }
                }
            }
        }
        const { optimizationLevel = 1 } = this.options;
        if (optimizationLevel >= 2) {
            // aggressive optimization for the purpose of fs walking
            globParts = this.firstPhasePreProcess(globParts);
            globParts = this.secondPhasePreProcess(globParts);
        }
        else if (optimizationLevel >= 1) {
            // just basic optimizations to remove some .. parts
            globParts = this.levelOneOptimize(globParts);
        }
        else {
            // just collapse multiple ** portions into one
            globParts = this.adjascentGlobstarOptimize(globParts);
        }
        return globParts;
    }
    // just get rid of adjascent ** portions
    adjascentGlobstarOptimize(globParts) {
        return globParts.map(parts => {
            let gs = -1;
            while (-1 !== (gs = parts.indexOf('**', gs + 1))) {
                let i = gs;
                while (parts[i + 1] === '**') {
                    i++;
                }
                if (i !== gs) {
                    parts.splice(gs, i - gs);
                }
            }
            return parts;
        });
    }
    // get rid of adjascent ** and resolve .. portions
    levelOneOptimize(globParts) {
        return globParts.map(parts => {
            parts = parts.reduce((set, part) => {
                const prev = set[set.length - 1];
                if (part === '**' && prev === '**') {
                    return set;
                }
                if (part === '..') {
                    if (prev && prev !== '..' && prev !== '.' && prev !== '**') {
                        set.pop();
                        return set;
                    }
                }
                set.push(part);
                return set;
            }, []);
            return parts.length === 0 ? [''] : parts;
        });
    }
    levelTwoFileOptimize(parts) {
        if (!Array.isArray(parts)) {
            parts = this.slashSplit(parts);
        }
        let didSomething = false;
        do {
            didSomething = false;
            // <pre>/<e>/<rest> -> <pre>/<rest>
            if (!this.preserveMultipleSlashes) {
                for (let i = 1; i < parts.length - 1; i++) {
                    const p = parts[i];
                    // don't squeeze out UNC patterns
                    if (i === 1 && p === '' && parts[0] === '')
                        continue;
                    if (p === '.' || p === '') {
                        didSomething = true;
                        parts.splice(i, 1);
                        i--;
                    }
                }
                if (parts[0] === '.' &&
                    parts.length === 2 &&
                    (parts[1] === '.' || parts[1] === '')) {
                    didSomething = true;
                    parts.pop();
                }
            }
            // <pre>/<p>/../<rest> -> <pre>/<rest>
            let dd = 0;
            while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
                const p = parts[dd - 1];
                if (p &&
                    p !== '.' &&
                    p !== '..' &&
                    p !== '**' &&
                    !(this.isWindows && /^[a-z]:$/i.test(p))) {
                    didSomething = true;
                    parts.splice(dd - 1, 2);
                    dd -= 2;
                }
            }
        } while (didSomething);
        return parts.length === 0 ? [''] : parts;
    }
    // First phase: single-pattern processing
    // <pre> is 1 or more portions
    // <rest> is 1 or more portions
    // <p> is any portion other than ., .., '', or **
    // <e> is . or ''
    //
    // **/.. is *brutal* for filesystem walking performance, because
    // it effectively resets the recursive walk each time it occurs,
    // and ** cannot be reduced out by a .. pattern part like a regexp
    // or most strings (other than .., ., and '') can be.
    //
    // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
    // <pre>/<e>/<rest> -> <pre>/<rest>
    // <pre>/<p>/../<rest> -> <pre>/<rest>
    // **/**/<rest> -> **/<rest>
    //
    // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow
    // this WOULD be allowed if ** did follow symlinks, or * didn't
    firstPhasePreProcess(globParts) {
        let didSomething = false;
        do {
            didSomething = false;
            // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}
            for (let parts of globParts) {
                let gs = -1;
                while (-1 !== (gs = parts.indexOf('**', gs + 1))) {
                    let gss = gs;
                    while (parts[gss + 1] === '**') {
                        // <pre>/**/**/<rest> -> <pre>/**/<rest>
                        gss++;
                    }
                    // eg, if gs is 2 and gss is 4, that means we have 3 **
                    // parts, and can remove 2 of them.
                    if (gss > gs) {
                        parts.splice(gs + 1, gss - gs);
                    }
                    let next = parts[gs + 1];
                    const p = parts[gs + 2];
                    const p2 = parts[gs + 3];
                    if (next !== '..')
                        continue;
                    if (!p ||
                        p === '.' ||
                        p === '..' ||
                        !p2 ||
                        p2 === '.' ||
                        p2 === '..') {
                        continue;
                    }
                    didSomething = true;
                    // edit parts in place, and push the new one
                    parts.splice(gs, 1);
                    const other = parts.slice(0);
                    other[gs] = '**';
                    globParts.push(other);
                    gs--;
                }
                // <pre>/<e>/<rest> -> <pre>/<rest>
                if (!this.preserveMultipleSlashes) {
                    for (let i = 1; i < parts.length - 1; i++) {
                        const p = parts[i];
                        // don't squeeze out UNC patterns
                        if (i === 1 && p === '' && parts[0] === '')
                            continue;
                        if (p === '.' || p === '') {
                            didSomething = true;
                            parts.splice(i, 1);
                            i--;
                        }
                    }
                    if (parts[0] === '.' &&
                        parts.length === 2 &&
                        (parts[1] === '.' || parts[1] === '')) {
                        didSomething = true;
                        parts.pop();
                    }
                }
                // <pre>/<p>/../<rest> -> <pre>/<rest>
                let dd = 0;
                while (-1 !== (dd = parts.indexOf('..', dd + 1))) {
                    const p = parts[dd - 1];
                    if (p && p !== '.' && p !== '..' && p !== '**') {
                        didSomething = true;
                        const needDot = dd === 1 && parts[dd + 1] === '**';
                        const splin = needDot ? ['.'] : [];
                        parts.splice(dd - 1, 2, ...splin);
                        if (parts.length === 0)
                            parts.push('');
                        dd -= 2;
                    }
                }
            }
        } while (didSomething);
        return globParts;
    }
    // second phase: multi-pattern dedupes
    // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>
    // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>
    // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>
    //
    // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>
    // ^-- not valid because ** doens't follow symlinks
    secondPhasePreProcess(globParts) {
        for (let i = 0; i < globParts.length - 1; i++) {
            for (let j = i + 1; j < globParts.length; j++) {
                const matched = this.partsMatch(globParts[i], globParts[j], !this.preserveMultipleSlashes);
                if (matched) {
                    globParts[i] = [];
                    globParts[j] = matched;
                    break;
                }
            }
        }
        return globParts.filter(gs => gs.length);
    }
    partsMatch(a, b, emptyGSMatch = false) {
        let ai = 0;
        let bi = 0;
        let result = [];
        let which = '';
        while (ai < a.length && bi < b.length) {
            if (a[ai] === b[bi]) {
                result.push(which === 'b' ? b[bi] : a[ai]);
                ai++;
                bi++;
            }
            else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {
                result.push(a[ai]);
                ai++;
            }
            else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {
                result.push(b[bi]);
                bi++;
            }
            else if (a[ai] === '*' &&
                b[bi] &&
                (this.options.dot || !b[bi].startsWith('.')) &&
                b[bi] !== '**') {
                if (which === 'b')
                    return false;
                which = 'a';
                result.push(a[ai]);
                ai++;
                bi++;
            }
            else if (b[bi] === '*' &&
                a[ai] &&
                (this.options.dot || !a[ai].startsWith('.')) &&
                a[ai] !== '**') {
                if (which === 'a')
                    return false;
                which = 'b';
                result.push(b[bi]);
                ai++;
                bi++;
            }
            else {
                return false;
            }
        }
        // if we fall out of the loop, it means they two are identical
        // as long as their lengths match
        return a.length === b.length && result;
    }
    parseNegate() {
        if (this.nonegate)
            return;
        const pattern = this.pattern;
        let negate = false;
        let negateOffset = 0;
        for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {
            negate = !negate;
            negateOffset++;
        }
        if (negateOffset)
            this.pattern = pattern.slice(negateOffset);
        this.negate = negate;
    }
    // set partial to true to test if, for example,
    // "/a/b" matches the start of "/*/b/*/d"
    // Partial means, if you run out of file before you run
    // out of pattern, then that's fine, as long as all
    // the parts match.
    matchOne(file, pattern, partial = false) {
        let fileStartIndex = 0;
        let patternStartIndex = 0;
        // UNC paths like //?/X:/... can match X:/... and vice versa
        // Drive letters in absolute drive or unc paths are always compared
        // case-insensitively.
        if (this.isWindows) {
            const fileDrive = typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0]);
            const fileUNC = !fileDrive &&
                file[0] === '' &&
                file[1] === '' &&
                file[2] === '?' &&
                /^[a-z]:$/i.test(file[3]);
            const patternDrive = typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0]);
            const patternUNC = !patternDrive &&
                pattern[0] === '' &&
                pattern[1] === '' &&
                pattern[2] === '?' &&
                typeof pattern[3] === 'string' &&
                /^[a-z]:$/i.test(pattern[3]);
            const fdi = fileUNC ? 3
                : fileDrive ? 0
                    : undefined;
            const pdi = patternUNC ? 3
                : patternDrive ? 0
                    : undefined;
            if (typeof fdi === 'number' && typeof pdi === 'number') {
                const [fd, pd] = [
                    file[fdi],
                    pattern[pdi],
                ];
                // start matching at the drive letter index of each
                if (fd.toLowerCase() === pd.toLowerCase()) {
                    pattern[pdi] = fd;
                    patternStartIndex = pdi;
                    fileStartIndex = fdi;
                }
            }
        }
        // resolve and reduce . and .. portions in the file as well.
        // don't need to do the second phase, because it's only one string[]
        const { optimizationLevel = 1 } = this.options;
        if (optimizationLevel >= 2) {
            file = this.levelTwoFileOptimize(file);
        }
        if (pattern.includes(GLOBSTAR)) {
            return this.#matchGlobstar(file, pattern, partial, fileStartIndex, patternStartIndex);
        }
        return this.#matchOne(file, pattern, partial, fileStartIndex, patternStartIndex);
    }
    #matchGlobstar(file, pattern, partial, fileIndex, patternIndex) {
        // split the pattern into head, tail, and middle of ** delimited parts
        const firstgs = pattern.indexOf(GLOBSTAR, patternIndex);
        const lastgs = pattern.lastIndexOf(GLOBSTAR);
        // split the pattern up into globstar-delimited sections
        // the tail has to be at the end, and the others just have
        // to be found in order from the head.
        const [head, body, tail] = partial ?
            [
                pattern.slice(patternIndex, firstgs),
                pattern.slice(firstgs + 1),
                [],
            ]
            : [
                pattern.slice(patternIndex, firstgs),
                pattern.slice(firstgs + 1, lastgs),
                pattern.slice(lastgs + 1),
            ];
        // check the head, from the current file/pattern index.
        if (head.length) {
            const fileHead = file.slice(fileIndex, fileIndex + head.length);
            if (!this.#matchOne(fileHead, head, partial, 0, 0)) {
                return false;
            }
            fileIndex += head.length;
            patternIndex += head.length;
        }
        // now we know the head matches!
        // if the last portion is not empty, it MUST match the end
        // check the tail
        let fileTailMatch = 0;
        if (tail.length) {
            // if head + tail > file, then we cannot possibly match
            if (tail.length + fileIndex > file.length)
                return false;
            // try to match the tail
            let tailStart = file.length - tail.length;
            if (this.#matchOne(file, tail, partial, tailStart, 0)) {
                fileTailMatch = tail.length;
            }
            else {
                // affordance for stuff like a/**/* matching a/b/
                // if the last file portion is '', and there's more to the pattern
                // then try without the '' bit.
                if (file[file.length - 1] !== '' ||
                    fileIndex + tail.length === file.length) {
                    return false;
                }
                tailStart--;
                if (!this.#matchOne(file, tail, partial, tailStart, 0)) {
                    return false;
                }
                fileTailMatch = tail.length + 1;
            }
        }
        // now we know the tail matches!
        // the middle is zero or more portions wrapped in **, possibly
        // containing more ** sections.
        // so a/**/b/**/c/**/d has become **/b/**/c/**
        // if it's empty, it means a/**/b, just verify we have no bad dots
        // if there's no tail, so it ends on /**, then we must have *something*
        // after the head, or it's not a matc
        if (!body.length) {
            let sawSome = !!fileTailMatch;
            for (let i = fileIndex; i < file.length - fileTailMatch; i++) {
                const f = String(file[i]);
                sawSome = true;
                if (f === '.' ||
                    f === '..' ||
                    (!this.options.dot && f.startsWith('.'))) {
                    return false;
                }
            }
            // in partial mode, we just need to get past all file parts
            return partial || sawSome;
        }
        // now we know that there's one or more body sections, which can
        // be matched anywhere from the 0 index (because the head was pruned)
        // through to the length-fileTailMatch index.
        // split the body up into sections, and note the minimum index it can
        // be found at (start with the length of all previous segments)
        // [section, before, after]
        const bodySegments = [[[], 0]];
        let currentBody = bodySegments[0];
        let nonGsParts = 0;
        const nonGsPartsSums = [0];
        for (const b of body) {
            if (b === GLOBSTAR) {
                nonGsPartsSums.push(nonGsParts);
                currentBody = [[], 0];
                bodySegments.push(currentBody);
            }
            else {
                currentBody[0].push(b);
                nonGsParts++;
            }
        }
        let i = bodySegments.length - 1;
        const fileLength = file.length - fileTailMatch;
        for (const b of bodySegments) {
            b[1] = fileLength - (nonGsPartsSums[i--] + b[0].length);
        }
        return !!this.#matchGlobStarBodySections(file, bodySegments, fileIndex, 0, partial, 0, !!fileTailMatch);
    }
    // return false for "nope, not matching"
    // return null for "not matching, cannot keep trying"
    #matchGlobStarBodySections(file, 
    // pattern section, last possible position for it
    bodySegments, fileIndex, bodyIndex, partial, globStarDepth, sawTail) {
        // take the first body segment, and walk from fileIndex to its "after"
        // value at the end
        // If it doesn't match at that position, we increment, until we hit
        // that final possible position, and give up.
        // If it does match, then advance and try to rest.
        // If any of them fail we keep walking forward.
        // this is still a bit recursively painful, but it's more constrained
        // than previous implementations, because we never test something that
        // can't possibly be a valid matching condition.
        const bs = bodySegments[bodyIndex];
        if (!bs) {
            // just make sure that there's no bad dots
            for (let i = fileIndex; i < file.length; i++) {
                sawTail = true;
                const f = file[i];
                if (f === '.' ||
                    f === '..' ||
                    (!this.options.dot && f.startsWith('.'))) {
                    return false;
                }
            }
            return sawTail;
        }
        // have a non-globstar body section to test
        const [body, after] = bs;
        while (fileIndex <= after) {
            const m = this.#matchOne(file.slice(0, fileIndex + body.length), body, partial, fileIndex, 0);
            // if limit exceeded, no match. intentional false negative,
            // acceptable break in correctness for security.
            if (m && globStarDepth < this.maxGlobstarRecursion) {
                // match! see if the rest match. if so, we're done!
                const sub = this.#matchGlobStarBodySections(file, bodySegments, fileIndex + body.length, bodyIndex + 1, partial, globStarDepth + 1, sawTail);
                if (sub !== false) {
                    return sub;
                }
            }
            const f = file[fileIndex];
            if (f === '.' ||
                f === '..' ||
                (!this.options.dot && f.startsWith('.'))) {
                return false;
            }
            fileIndex++;
        }
        // walked off. no point continuing
        return partial || null;
    }
    #matchOne(file, pattern, partial, fileIndex, patternIndex) {
        let fi;
        let pi;
        let pl;
        let fl;
        for (fi = fileIndex,
            pi = patternIndex,
            fl = file.length,
            pl = pattern.length; fi < fl && pi < pl; fi++, pi++) {
            this.debug('matchOne loop');
            let p = pattern[pi];
            let f = file[fi];
            this.debug(pattern, p, f);
            // should be impossible.
            // some invalid regexp stuff in the set.
            /* c8 ignore start */
            if (p === false || p === GLOBSTAR) {
                return false;
            }
            /* c8 ignore stop */
            // something other than **
            // non-magic patterns just have to match exactly
            // patterns with magic have been turned into regexps.
            let hit;
            if (typeof p === 'string') {
                hit = f === p;
                this.debug('string match', p, f, hit);
            }
            else {
                hit = p.test(f);
                this.debug('pattern match', p, f, hit);
            }
            if (!hit)
                return false;
        }
        // Note: ending in / means that we'll get a final ""
        // at the end of the pattern.  This can only match a
        // corresponding "" at the end of the file.
        // If the file ends in /, then it can only match a
        // a pattern that ends in /, unless the pattern just
        // doesn't have any more for it. But, a/b/ should *not*
        // match "a/b/*", even though "" matches against the
        // [^/]*? pattern, except in partial mode, where it might
        // simply not be reached yet.
        // However, a/b/ should still satisfy a/*
        // now either we fell off the end of the pattern, or we're done.
        if (fi === fl && pi === pl) {
            // ran out of pattern and filename at the same time.
            // an exact hit!
            return true;
        }
        else if (fi === fl) {
            // ran out of file, but still had pattern left.
            // this is ok if we're doing the match as part of
            // a glob fs traversal.
            return partial;
        }
        else if (pi === pl) {
            // ran out of pattern, still have file left.
            // this is only acceptable if we're on the very last
            // empty segment of a file with a trailing slash.
            // a/* should match a/b/
            return fi === fl - 1 && file[fi] === '';
            /* c8 ignore start */
        }
        else {
            // should be unreachable.
            throw new Error('wtf?');
        }
        /* c8 ignore stop */
    }
    braceExpand() {
        return braceExpand(this.pattern, this.options);
    }
    parse(pattern) {
        assertValidPattern(pattern);
        const options = this.options;
        // shortcuts
        if (pattern === '**')
            return GLOBSTAR;
        if (pattern === '')
            return '';
        // far and away, the most common glob pattern parts are
        // *, *.*, and *.<ext>  Add a fast check method for those.
        let m;
        let fastTest = null;
        if ((m = pattern.match(starRE))) {
            fastTest = options.dot ? starTestDot : starTest;
        }
        else if ((m = pattern.match(starDotExtRE))) {
            fastTest = (options.nocase ?
                options.dot ?
                    starDotExtTestNocaseDot
                    : starDotExtTestNocase
                : options.dot ? starDotExtTestDot
                    : starDotExtTest)(m[1]);
        }
        else if ((m = pattern.match(qmarksRE))) {
            fastTest = (options.nocase ?
                options.dot ?
                    qmarksTestNocaseDot
                    : qmarksTestNocase
                : options.dot ? qmarksTestDot
                    : qmarksTest)(m);
        }
        else if ((m = pattern.match(starDotStarRE))) {
            fastTest = options.dot ? starDotStarTestDot : starDotStarTest;
        }
        else if ((m = pattern.match(dotStarRE))) {
            fastTest = dotStarTest;
        }
        const re = AST.fromGlob(pattern, this.options).toMMPattern();
        if (fastTest && typeof re === 'object') {
            // Avoids overriding in frozen environments
            Reflect.defineProperty(re, 'test', { value: fastTest });
        }
        return re;
    }
    makeRe() {
        if (this.regexp || this.regexp === false)
            return this.regexp;
        // at this point, this.set is a 2d array of partial
        // pattern strings, or "**".
        //
        // It's better to use .match().  This function shouldn't
        // be used, really, but it's pretty convenient sometimes,
        // when you just want to work with a regex.
        const set = this.set;
        if (!set.length) {
            this.regexp = false;
            return this.regexp;
        }
        const options = this.options;
        const twoStar = options.noglobstar ? star
            : options.dot ? twoStarDot
                : twoStarNoDot;
        const flags = new Set(options.nocase ? ['i'] : []);
        // regexpify non-globstar patterns
        // if ** is only item, then we just do one twoStar
        // if ** is first, and there are more, prepend (\/|twoStar\/)? to next
        // if ** is last, append (\/twoStar|) to previous
        // if ** is in the middle, append (\/|\/twoStar\/) to previous
        // then filter out GLOBSTAR symbols
        let re = set
            .map(pattern => {
            const pp = pattern.map(p => {
                if (p instanceof RegExp) {
                    for (const f of p.flags.split(''))
                        flags.add(f);
                }
                return (typeof p === 'string' ? regExpEscape(p)
                    : p === GLOBSTAR ? GLOBSTAR
                        : p._src);
            });
            pp.forEach((p, i) => {
                const next = pp[i + 1];
                const prev = pp[i - 1];
                if (p !== GLOBSTAR || prev === GLOBSTAR) {
                    return;
                }
                if (prev === undefined) {
                    if (next !== undefined && next !== GLOBSTAR) {
                        pp[i + 1] = '(?:\\/|' + twoStar + '\\/)?' + next;
                    }
                    else {
                        pp[i] = twoStar;
                    }
                }
                else if (next === undefined) {
                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + ')?';
                }
                else if (next !== GLOBSTAR) {
                    pp[i - 1] = prev + '(?:\\/|\\/' + twoStar + '\\/)' + next;
                    pp[i + 1] = GLOBSTAR;
                }
            });
            const filtered = pp.filter(p => p !== GLOBSTAR);
            // For partial matches, we need to make the pattern match
            // any prefix of the full path. We do this by generating
            // alternative patterns that match progressively longer prefixes.
            if (this.partial && filtered.length >= 1) {
                const prefixes = [];
                for (let i = 1; i <= filtered.length; i++) {
                    prefixes.push(filtered.slice(0, i).join('/'));
                }
                return '(?:' + prefixes.join('|') + ')';
            }
            return filtered.join('/');
        })
            .join('|');
        // need to wrap in parens if we had more than one thing with |,
        // otherwise only the first will be anchored to ^ and the last to $
        const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', ''];
        // must match entire pattern
        // ending in a * or ** will make it less strict.
        re = '^' + open + re + close + '$';
        // In partial mode, '/' should always match as it's a valid prefix for any pattern
        if (this.partial) {
            re = '^(?:\\/|' + open + re.slice(1, -1) + close + ')$';
        }
        // can match anything, as long as it's not this.
        if (this.negate)
            re = '^(?!' + re + ').+$';
        try {
            this.regexp = new RegExp(re, [...flags].join(''));
            /* c8 ignore start */
        }
        catch {
            // should be impossible
            this.regexp = false;
        }
        /* c8 ignore stop */
        return this.regexp;
    }
    slashSplit(p) {
        // if p starts with // on windows, we preserve that
        // so that UNC paths aren't broken.  Otherwise, any number of
        // / characters are coalesced into one, unless
        // preserveMultipleSlashes is set to true.
        if (this.preserveMultipleSlashes) {
            return p.split('/');
        }
        else if (this.isWindows && /^\/\/[^/]+/.test(p)) {
            // add an extra '' for the one we lose
            return ['', ...p.split(/\/+/)];
        }
        else {
            return p.split(/\/+/);
        }
    }
    match(f, partial = this.partial) {
        this.debug('match', f, this.pattern);
        // short-circuit in the case of busted things.
        // comments, etc.
        if (this.comment) {
            return false;
        }
        if (this.empty) {
            return f === '';
        }
        if (f === '/' && partial) {
            return true;
        }
        const options = this.options;
        // windows: need to use /, not \
        if (this.isWindows) {
            f = f.split('\\').join('/');
        }
        // treat the test path as a set of pathparts.
        const ff = this.slashSplit(f);
        this.debug(this.pattern, 'split', ff);
        // just ONE of the pattern sets in this.set needs to match
        // in order for it to be valid.  If negating, then just one
        // match means that we have failed.
        // Either way, return on the first hit.
        const set = this.set;
        this.debug(this.pattern, 'set', set);
        // Find the basename of the path by looking for the last non-empty segment
        let filename = ff[ff.length - 1];
        if (!filename) {
            for (let i = ff.length - 2; !filename && i >= 0; i--) {
                filename = ff[i];
            }
        }
        for (const pattern of set) {
            let file = ff;
            if (options.matchBase && pattern.length === 1) {
                file = [filename];
            }
            const hit = this.matchOne(file, pattern, partial);
            if (hit) {
                if (options.flipNegate) {
                    return true;
                }
                return !this.negate;
            }
        }
        // didn't get any hits.  this is success if it's a negative
        // pattern, failure otherwise.
        if (options.flipNegate) {
            return false;
        }
        return this.negate;
    }
    static defaults(def) {
        return minimatch.defaults(def).Minimatch;
    }
}
/* c8 ignore start */
export { AST } from './ast.js';
export { escape } from './escape.js';
export { unescape } from './unescape.js';
/* c8 ignore stop */
minimatch.AST = AST;
minimatch.Minimatch = Minimatch;
minimatch.escape = escape;
minimatch.unescape = unescape;
//# sourceMappingURL=index.js.map)N5)x   {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAA;AACxC,OAAO,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAA;AAE9D,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAA;AAC9B,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AACpC,OAAO,EAAE,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AG,QAAQ,CAAA","sourcesContent":["import { expand } from 'brace-expansion'\nimport { assertValidPattern } from './assert-valid-pattern.js'\nimport type { ExtglobType } from './ast.js'\nimport { AST } from './ast.js'\nimport { escape } from './escape.js'\nimport { unescape } from './unescape.js'\n\nexport type Platform =\n  | 'aix'\n  | 'android'\n  | 'darwin'\n  | 'freebsd'\n  | 'haiku'\n  | 'linux'\n  | 'openbsd'\n  | 'sunos'\n  | 'win32'\n  | 'cygwin'\n  | 'netbsd'\n\nexport interface MinimatchOptions {\n  /** do not expand `{x,y}` style braces */\n  nobrace?: boolean\n  /** do not treat patterns starting with `#` as a comment */\n  nocomment?: boolean\n  /** do not treat patterns starting with `!` as a negation */\n  nonegate?: boolean\n  /** print LOTS of debugging output */\n  debug?: boolean\n  /** treat `**` the same as `*` */\n  noglobstar?: boolean\n  /** do not expand extglobs like `+(a|b)` */\n  noext?: boolean\n  /** return the pattern if nothing matches */\n  nonull?: boolean\n  /** treat `\\\\` as a path separator, not an escape character */\n  windowsPathsNoEscape?: boolean\n  /**\n   * inverse of {@link MinimatchOptions.windowsPathsNoEscape}\n   * @deprecated\n   */\n  allowWindowsEscape?: boolean\n  /**\n   * Compare a partial path to a pattern. As long as the parts\n   * of the path that are present are not contradicted by the\n   * pattern, it will be treated as a match. This is useful in\n   * applications where you're walking through a folder structure,\n   * and don't yet have the full path, but want to ensure that you\n   * do not walk down paths that can never be a match.\n   */\n  partial?: boolean\n  /** allow matches that start with `.` even if the pattern does not */\n  dot?: boolean\n  /** ignore case */\n  nocase?: boolean\n  /** ignore case only in wildcard patterns */\n  nocaseMagicOnly?: boolean\n  /** consider braces to be \"magic\" for the purpose of `hasMagic` */\n  magicalBraces?: boolean\n  /**\n   * If set, then patterns without slashes will be matched\n   * against the basename of the path if it contains slashes.\n   * For example, `a?b` would match the path `/xyz/123/acb`, but\n   * not `/xyz/acb/123`.\n   */\n  matchBase?: boolean\n  /** invert the results of negated matches */\n  flipNegate?: boolean\n  /** do not collapse multiple `/` into a single `/` */\n  preserveMultipleSlashes?: boolean\n  /**\n   * A number indicating the level of optimization that should be done\n   * to the pattern prior to parsing and using it for matches.\n   */\n  optimizationLevel?: number\n  /** operating system platform */\n  platform?: Platform\n  /**\n   * When a pattern starts with a UNC path or drive letter, and in\n   * `nocase:true` mode, do not convert the root portions of the\n   * pattern into a case-insensitive regular expression, and instead\n   * leave them as strings.\n   *\n   * This is the default when the platform is `win32` and\n   * `nocase:true` is set.\n   */\n  windowsNoMagicRoot?: boolean\n  /**\n   * max number of `{...}` patterns to expand. Default 100_000.\n   */\n  braceExpandMax?: number\n  /**\n   * Max number of non-adjacent `**` patterns to recursively walk down.\n   *\n   * The default of 200 is almost certainly high enough for most purposes,\n   * and can handle absurdly excessive patterns.\n   */\n  maxGlobstarRecursion?: number\n\n  /**\n   * Max depth to traverse for nested extglobs like `*(a|b|c)`\n   *\n   * Default is 2, which is quite low, but any higher value\n   * swiftly results in punishing performance impacts. Note\n   * that this is *not*  relevant when the globstar types can\n   * be safely coalesced into a single set.\n   *\n   * For example, `*(a|@(b|c)|d)` would be flattened into\n   * `*(a|b|c|d)`. Thus, many common extglobs will retain good\n   * performance and  never hit this limit, even if they are\n   * excessively deep and complicated.\n   *\n   * If the limit is hit, then the extglob characters are simply\n   * not parsed, and the pattern effectively switches into\n   * `noextglob: true` mode for the contents of that nested\n   * sub-pattern. This will typically _not_ result in a match,\n   * but is considered a valid trade-off for security and\n   * performance.\n   */\n  maxExtglobRecursion?: number\n}\n\nexport const minimatch = (\n  p: string,\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  assertValidPattern(pattern)\n\n  // shortcut: comments match nothing.\n  if (!options.nocomment && pattern.charAt(0) === '#') {\n    return false\n  }\n\n  return new Minimatch(pattern, options).match(p)\n}\n\n// Optimized checking for the most common glob patterns.\nconst starDotExtRE = /^\\*+([^+@!?*[(]*)$/\nconst starDotExtTest = (ext: string) => (f: string) =>\n  !f.startsWith('.') && f.endsWith(ext)\nconst starDotExtTestDot = (ext: string) => (f: string) => f.endsWith(ext)\nconst starDotExtTestNocase = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => !f.startsWith('.') && f.toLowerCase().endsWith(ext)\n}\nconst starDotExtTestNocaseDot = (ext: string) => {\n  ext = ext.toLowerCase()\n  return (f: string) => f.toLowerCase().endsWith(ext)\n}\nconst starDotStarRE = /^\\*+\\.\\*+$/\nconst starDotStarTest = (f: string) =>\n  !f.startsWith('.') && f.includes('.')\nconst starDotStarTestDot = (f: string) =>\n  f !== '.' && f !== '..' && f.includes('.')\nconst dotStarRE = /^\\.\\*+$/\nconst dotStarTest = (f: string) =>\n  f !== '.' && f !== '..' && f.startsWith('.')\nconst starRE = /^\\*+$/\nconst starTest = (f: string) => f.length !== 0 && !f.startsWith('.')\nconst starTestDot = (f: string) =>\n  f.length !== 0 && f !== '.' && f !== '..'\nconst qmarksRE = /^\\?+([^+@!?*[(]*)?$/\nconst qmarksTestNocase = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestNocaseDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  if (!ext) return noext\n  ext = ext.toLowerCase()\n  return (f: string) => noext(f) && f.toLowerCase().endsWith(ext)\n}\nconst qmarksTestDot = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExtDot([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTest = ([$0, ext = '']: RegExpMatchArray) => {\n  const noext = qmarksTestNoExt([$0])\n  return !ext ? noext : (f: string) => noext(f) && f.endsWith(ext)\n}\nconst qmarksTestNoExt = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && !f.startsWith('.')\n}\nconst qmarksTestNoExtDot = ([$0]: RegExpMatchArray) => {\n  const len = $0.length\n  return (f: string) => f.length === len && f !== '.' && f !== '..'\n}\n\n/* c8 ignore start */\nconst defaultPlatform: Platform = (\n  typeof process === 'object' && process ?\n    (typeof process.env === 'object' &&\n      process.env &&\n      process.env.__MINIMATCH_TESTING_PLATFORM__) ||\n    process.platform\n  : 'posix') as Platform\n\nexport type Sep = '\\\\' | '/'\n\nconst path: { [k: string]: { sep: Sep } } = {\n  win32: { sep: '\\\\' },\n  posix: { sep: '/' },\n}\n/* c8 ignore stop */\n\nexport const sep =\n  defaultPlatform === 'win32' ? path.win32.sep : path.posix.sep\nminimatch.sep = sep\n\nexport const GLOBSTAR = Symbol('globstar **')\nminimatch.GLOBSTAR = GLOBSTAR\n\n// any single thing other than /\n// don't need to escape / when using new RegExp()\nconst qmark = '[^/]'\n\n// * => any number of characters\nconst star = qmark + '*?'\n\n// ** when dots are allowed.  Anything goes, except .. and .\n// not (^ or / followed by one or two dots followed by $ or /),\n// followed by anything, any number of times.\nconst twoStarDot = '(?:(?!(?:\\\\/|^)(?:\\\\.{1,2})($|\\\\/)).)*?'\n\n// not a ^ or / followed by a dot,\n// followed by anything, any number of times.\nconst twoStarNoDot = '(?:(?!(?:\\\\/|^)\\\\.).)*?'\n\nexport const filter =\n  (pattern: string, options: MinimatchOptions = {}) =>\n  (p: string) =>\n    minimatch(p, pattern, options)\nminimatch.filter = filter\n\nconst ext = (a: MinimatchOptions, b: MinimatchOptions = {}) =>\n  Object.assign({}, a, b)\n\nexport const defaults = (def: MinimatchOptions): typeof minimatch => {\n  if (!def || typeof def !== 'object' || !Object.keys(def).length) {\n    return minimatch\n  }\n\n  const orig = minimatch\n\n  const m = (p: string, pattern: string, options: MinimatchOptions = {}) =>\n    orig(p, pattern, ext(def, options))\n\n  return Object.assign(m, {\n    Minimatch: class Minimatch extends orig.Minimatch {\n      constructor(pattern: string, options: MinimatchOptions = {}) {\n        super(pattern, ext(def, options))\n      }\n      static defaults(options: MinimatchOptions) {\n        return orig.defaults(ext(def, options)).Minimatch\n      }\n    },\n\n    AST: class AST extends orig.AST {\n      /* c8 ignore start */\n      constructor(\n        type: ExtglobType | null,\n        parent?: AST,\n        options: MinimatchOptions = {},\n      ) {\n        super(type, parent, ext(def, options))\n      }\n      /* c8 ignore stop */\n\n      static fromGlob(pattern: string, options: MinimatchOptions = {}) {\n        return orig.AST.fromGlob(pattern, ext(def, options))\n      }\n    },\n\n    unescape: (\n      s: string,\n      options: Pick<\n        MinimatchOptions,\n        'windowsPathsNoEscape' | 'magicalBraces'\n      > = {},\n    ) => orig.unescape(s, ext(def, options)),\n\n    escape: (\n      s: string,\n      options: Pick<\n        MinimatchOptions,\n        'windowsPathsNoEscape' | 'magicalBraces'\n      > = {},\n    ) => orig.escape(s, ext(def, options)),\n\n    filter: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.filter(pattern, ext(def, options)),\n\n    defaults: (options: MinimatchOptions) =>\n      orig.defaults(ext(def, options)),\n\n    makeRe: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.makeRe(pattern, ext(def, options)),\n\n    braceExpand: (pattern: string, options: MinimatchOptions = {}) =>\n      orig.braceExpand(pattern, ext(def, options)),\n\n    match: (\n      list: string[],\n      pattern: string,\n      options: MinimatchOptions = {},\n    ) => orig.match(list, pattern, ext(def, options)),\n\n    sep: orig.sep,\n    GLOBSTAR: GLOBSTAR as typeof GLOBSTAR,\n  })\n}\nminimatch.defaults = defaults\n\n// Brace expansion:\n// a{b,c}d -> abd acd\n// a{b,}c -> abc ac\n// a{0..3}d -> a0d a1d a2d a3d\n// a{b,c{d,e}f}g -> abg acdfg acefg\n// a{b,c}d{e,f}g -> abdeg acdeg abdeg abdfg\n//\n// Invalid sets are not expanded.\n// a{2..}b -> a{2..}b\n// a{b}c -> a{b}c\nexport const braceExpand = (\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  assertValidPattern(pattern)\n\n  // Thanks to Yeting Li <https://github.com/yetingli> for\n  // improving this regexp to avoid a ReDOS vulnerability.\n  if (options.nobrace || !/\\{(?:(?!\\{).)*\\}/.test(pattern)) {\n    // shortcut. no need to expand.\n    return [pattern]\n  }\n\n  return expand(pattern, { max: options.braceExpandMax })\n}\nminimatch.braceExpand = braceExpand\n\n// parse a component of the expanded set.\n// At this point, no pattern may contain \"/\" in it\n// so we're going to return a 2d array, where each entry is the full\n// pattern, split on '/', and then turned into a regular expression.\n// A regexp is made at the end which joins each array with an\n// escaped /, and another full one which joins each regexp with |.\n//\n// Following the lead of Bash 4.1, note that \"**\" only has special meaning\n// when it is the *only* thing in a path portion.  Otherwise, any series\n// of * is equivalent to a single *.  Globstar behavior is enabled by\n// default, and can be disabled by setting options.noglobstar.\n\nexport const makeRe = (pattern: string, options: MinimatchOptions = {}) =>\n  new Minimatch(pattern, options).makeRe()\nminimatch.makeRe = makeRe\n\nexport const match = (\n  list: string[],\n  pattern: string,\n  options: MinimatchOptions = {},\n) => {\n  const mm = new Minimatch(pattern, options)\n  list = list.filter(f => mm.match(f))\n  if (mm.options.nonull && !list.length) {\n    list.push(pattern)\n  }\n  return list\n}\nminimatch.match = match\n\n// replace stuff like \\* with *\nconst globMagic = /[?*]|[+@!]\\(.*?\\)|\\[|\\]/\nconst regExpEscape = (s: string) =>\n  s.replace(/[-[\\]{}()*+?.,\\\\^$|#\\s]/g, '\\\\$&')\n\nexport type MMRegExp = RegExp & {\n  _src?: string\n  _glob?: string\n}\n\nexport type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR\nexport type ParseReturn = ParseReturnFiltered | false\n\nexport class Minimatch {\n  options: MinimatchOptions\n  set: ParseReturnFiltered[][]\n  pattern: string\n\n  windowsPathsNoEscape: boolean\n  nonegate: boolean\n  negate: boolean\n  comment: boolean\n  empty: boolean\n  preserveMultipleSlashes: boolean\n  partial: boolean\n  globSet: string[]\n  globParts: string[][]\n  nocase: boolean\n\n  isWindows: boolean\n  platform: Platform\n  windowsNoMagicRoot: boolean\n  maxGlobstarRecursion: number\n\n  regexp: false | null | MMRegExp\n  constructor(pattern: string, options: MinimatchOptions = {}) {\n    assertValidPattern(pattern)\n\n    options = options || {}\n    this.options = options\n    this.maxGlobstarRecursion = options.maxGlobstarRecursion ?? 200\n    this.pattern = pattern\n    this.platform = options.platform || defaultPlatform\n    this.isWindows = this.platform === 'win32'\n    // avoid the annoying deprecation flag lol\n    const awe = ('allowWindow' + 'sEscape') as keyof MinimatchOptions\n    this.windowsPathsNoEscape =\n      !!options.windowsPathsNoEscape || options[awe] === false\n    if (this.windowsPathsNoEscape) {\n      this.pattern = this.pattern.replace(/\\\\/g, '/')\n    }\n    this.preserveMultipleSlashes = !!options.preserveMultipleSlashes\n    this.regexp = null\n    this.negate = false\n    this.nonegate = !!options.nonegate\n    this.comment = false\n    this.empty = false\n    this.partial = !!options.partial\n    this.nocase = !!this.options.nocase\n    this.windowsNoMagicRoot =\n      options.windowsNoMagicRoot !== undefined ?\n        options.windowsNoMagicRoot\n      : !!(this.isWindows && this.nocase)\n\n    this.globSet = []\n    this.globParts = []\n    this.set = []\n\n    // make the set of regexps etc.\n    this.make()\n  }\n\n  hasMagic(): boolean {\n    if (this.options.magicalBraces && this.set.length > 1) {\n      return true\n    }\n    for (const pattern of this.set) {\n      for (const part of pattern) {\n        if (typeof part !== 'string') return true\n      }\n    }\n    return false\n  }\n\n  debug(..._: unknown[]) {}\n\n  make() {\n    const pattern = this.pattern\n    const options = this.options\n\n    // empty patterns and comments match nothing.\n    if (!options.nocomment && pattern.charAt(0) === '#') {\n      this.comment = true\n      return\n    }\n\n    if (!pattern) {\n      this.empty = true\n      return\n    }\n\n    // step 1: figure out negation, etc.\n    this.parseNegate()\n\n    // step 2: expand braces\n    this.globSet = [...new Set(this.braceExpand())]\n\n    if (options.debug) {\n      //oxlint-disable-next-line no-console\n      this.debug = (...args: unknown[]) => console.error(...args)\n    }\n\n    this.debug(this.pattern, this.globSet)\n\n    // step 3: now we have a set, so turn each one into a series of\n    // path-portion matching patterns.\n    // These will be regexps, except in the case of \"**\", which is\n    // set to the GLOBSTAR object for globstar behavior,\n    // and will not contain any / characters\n    //\n    // First, we preprocess to make the glob pattern sets a bit simpler\n    // and deduped.  There are some perf-killing patterns that can cause\n    // problems with a glob walk, but we can simplify them down a bit.\n    const rawGlobParts = this.globSet.map(s => this.slashSplit(s))\n    this.globParts = this.preprocess(rawGlobParts)\n    this.debug(this.pattern, this.globParts)\n\n    // glob --> regexps\n    let set = this.globParts.map((s, _, __) => {\n      if (this.isWindows && this.windowsNoMagicRoot) {\n        // check if it's a drive or unc path.\n        const isUNC =\n          s[0] === '' &&\n          s[1] === '' &&\n          (s[2] === '?' || !globMagic.test(s[2])) &&\n          !globMagic.test(s[3])\n        const isDrive = /^[a-z]:/i.test(s[0])\n        if (isUNC) {\n          return [\n            ...s.slice(0, 4),\n            ...s.slice(4).map(ss => this.parse(ss)),\n          ]\n        } else if (isDrive) {\n          return [s[0], ...s.slice(1).map(ss => this.parse(ss))]\n        }\n      }\n      return s.map(ss => this.parse(ss))\n    })\n\n    this.debug(this.pattern, set)\n\n    // filter out everything that didn't compile properly.\n    this.set = set.filter(\n      s => s.indexOf(false) === -1,\n    ) as ParseReturnFiltered[][]\n\n    // do not treat the ? in UNC paths as magic\n    if (this.isWindows) {\n      for (let i = 0; i < this.set.length; i++) {\n        const p = this.set[i]\n        if (\n          p[0] === '' &&\n          p[1] === '' &&\n          this.globParts[i][2] === '?' &&\n          typeof p[3] === 'string' &&\n          /^[a-z]:$/i.test(p[3])\n        ) {\n          p[2] = '?'\n        }\n      }\n    }\n\n    this.debug(this.pattern, this.set)\n  }\n\n  // various transforms to equivalent pattern sets that are\n  // faster to process in a filesystem walk.  The goal is to\n  // eliminate what we can, and push all ** patterns as far\n  // to the right as possible, even if it increases the number\n  // of patterns that we have to process.\n  preprocess(globParts: string[][]) {\n    // if we're not in globstar mode, then turn ** into *\n    if (this.options.noglobstar) {\n      for (const partset of globParts) {\n        for (let j = 0; j < partset.length; j++) {\n          if (partset[j] === '**') {\n            partset[j] = '*'\n          }\n        }\n      }\n    }\n\n    const { optimizationLevel = 1 } = this.options\n\n    if (optimizationLevel >= 2) {\n      // aggressive optimization for the purpose of fs walking\n      globParts = this.firstPhasePreProcess(globParts)\n      globParts = this.secondPhasePreProcess(globParts)\n    } else if (optimizationLevel >= 1) {\n      // just basic optimizations to remove some .. parts\n      globParts = this.levelOneOptimize(globParts)\n    } else {\n      // just collapse multiple ** portions into one\n      globParts = this.adjascentGlobstarOptimize(globParts)\n    }\n\n    return globParts\n  }\n\n  // just get rid of adjascent ** portions\n  adjascentGlobstarOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      let gs: number = -1\n      while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n        let i = gs\n        while (parts[i + 1] === '**') {\n          i++\n        }\n        if (i !== gs) {\n          parts.splice(gs, i - gs)\n        }\n      }\n      return parts\n    })\n  }\n\n  // get rid of adjascent ** and resolve .. portions\n  levelOneOptimize(globParts: string[][]) {\n    return globParts.map(parts => {\n      parts = parts.reduce((set: string[], part) => {\n        const prev = set[set.length - 1]\n        if (part === '**' && prev === '**') {\n          return set\n        }\n        if (part === '..') {\n          if (prev && prev !== '..' && prev !== '.' && prev !== '**') {\n            set.pop()\n            return set\n          }\n        }\n        set.push(part)\n        return set\n      }, [])\n      return parts.length === 0 ? [''] : parts\n    })\n  }\n\n  levelTwoFileOptimize(parts: string | string[]) {\n    if (!Array.isArray(parts)) {\n      parts = this.slashSplit(parts)\n    }\n    let didSomething: boolean = false\n\n    do {\n      didSomething = false\n      // <pre>/<e>/<rest> -> <pre>/<rest>\n      if (!this.preserveMultipleSlashes) {\n        for (let i = 1; i < parts.length - 1; i++) {\n          const p = parts[i]\n          // don't squeeze out UNC patterns\n          if (i === 1 && p === '' && parts[0] === '') continue\n          if (p === '.' || p === '') {\n            didSomething = true\n            parts.splice(i, 1)\n            i--\n          }\n        }\n        if (\n          parts[0] === '.' &&\n          parts.length === 2 &&\n          (parts[1] === '.' || parts[1] === '')\n        ) {\n          didSomething = true\n          parts.pop()\n        }\n      }\n\n      // <pre>/<p>/../<rest> -> <pre>/<rest>\n      let dd: number = 0\n      while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n        const p = parts[dd - 1]\n        if (\n          p &&\n          p !== '.' &&\n          p !== '..' &&\n          p !== '**' &&\n          !(this.isWindows && /^[a-z]:$/i.test(p))\n        ) {\n          didSomething = true\n          parts.splice(dd - 1, 2)\n          dd -= 2\n        }\n      }\n    } while (didSomething)\n    return parts.length === 0 ? [''] : parts\n  }\n\n  // First phase: single-pattern processing\n  // <pre> is 1 or more portions\n  // <rest> is 1 or more portions\n  // <p> is any portion other than ., .., '', or **\n  // <e> is . or ''\n  //\n  // **/.. is *brutal* for filesystem walking performance, because\n  // it effectively resets the recursive walk each time it occurs,\n  // and ** cannot be reduced out by a .. pattern part like a regexp\n  // or most strings (other than .., ., and '') can be.\n  //\n  // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}\n  // <pre>/<e>/<rest> -> <pre>/<rest>\n  // <pre>/<p>/../<rest> -> <pre>/<rest>\n  // **/**/<rest> -> **/<rest>\n  //\n  // **/*/<rest> -> */**/<rest> <== not valid because ** doesn't follow\n  // this WOULD be allowed if ** did follow symlinks, or * didn't\n  firstPhasePreProcess(globParts: string[][]) {\n    let didSomething = false\n    do {\n      didSomething = false\n      // <pre>/**/../<p>/<p>/<rest> -> {<pre>/../<p>/<p>/<rest>,<pre>/**/<p>/<p>/<rest>}\n      for (let parts of globParts) {\n        let gs: number = -1\n        while (-1 !== (gs = parts.indexOf('**', gs + 1))) {\n          let gss: number = gs\n          while (parts[gss + 1] === '**') {\n            // <pre>/**/**/<rest> -> <pre>/**/<rest>\n            gss++\n          }\n          // eg, if gs is 2 and gss is 4, that means we have 3 **\n          // parts, and can remove 2 of them.\n          if (gss > gs) {\n            parts.splice(gs + 1, gss - gs)\n          }\n\n          let next = parts[gs + 1]\n          const p = parts[gs + 2]\n          const p2 = parts[gs + 3]\n          if (next !== '..') continue\n          if (\n            !p ||\n            p === '.' ||\n            p === '..' ||\n            !p2 ||\n            p2 === '.' ||\n            p2 === '..'\n          ) {\n            continue\n          }\n          didSomething = true\n          // edit parts in place, and push the new one\n          parts.splice(gs, 1)\n          const other = parts.slice(0)\n          other[gs] = '**'\n          globParts.push(other)\n          gs--\n        }\n\n        // <pre>/<e>/<rest> -> <pre>/<rest>\n        if (!this.preserveMultipleSlashes) {\n          for (let i = 1; i < parts.length - 1; i++) {\n            const p = parts[i]\n            // don't squeeze out UNC patterns\n            if (i === 1 && p === '' && parts[0] === '') continue\n            if (p === '.' || p === '') {\n              didSomething = true\n              parts.splice(i, 1)\n              i--\n            }\n          }\n          if (\n            parts[0] === '.' &&\n            parts.length === 2 &&\n            (parts[1] === '.' || parts[1] === '')\n          ) {\n            didSomething = true\n            parts.pop()\n          }\n        }\n\n        // <pre>/<p>/../<rest> -> <pre>/<rest>\n        let dd: number = 0\n        while (-1 !== (dd = parts.indexOf('..', dd + 1))) {\n          const p = parts[dd - 1]\n          if (p && p !== '.' && p !== '..' && p !== '**') {\n            didSomething = true\n            const needDot = dd === 1 && parts[dd + 1] === '**'\n            const splin = needDot ? ['.'] : []\n            parts.splice(dd - 1, 2, ...splin)\n            if (parts.length === 0) parts.push('')\n            dd -= 2\n          }\n        }\n      }\n    } while (didSomething)\n\n    return globParts\n  }\n\n  // second phase: multi-pattern dedupes\n  // {<pre>/*/<rest>,<pre>/<p>/<rest>} -> <pre>/*/<rest>\n  // {<pre>/<rest>,<pre>/<rest>} -> <pre>/<rest>\n  // {<pre>/**/<rest>,<pre>/<rest>} -> <pre>/**/<rest>\n  //\n  // {<pre>/**/<rest>,<pre>/**/<p>/<rest>} -> <pre>/**/<rest>\n  // ^-- not valid because ** doens't follow symlinks\n  secondPhasePreProcess(globParts: string[][]): string[][] {\n    for (let i = 0; i < globParts.length - 1; i++) {\n      for (let j = i + 1; j < globParts.length; j++) {\n        const matched = this.partsMatch(\n          globParts[i],\n          globParts[j],\n          !this.preserveMultipleSlashes,\n        )\n        if (matched) {\n          globParts[i] = []\n          globParts[j] = matched\n          break\n        }\n      }\n    }\n    return globParts.filter(gs => gs.length)\n  }\n\n  partsMatch(\n    a: string[],\n    b: string[],\n    emptyGSMatch: boolean = false,\n  ): false | string[] {\n    let ai = 0\n    let bi = 0\n    let result: string[] = []\n    let which: string = ''\n    while (ai < a.length && bi < b.length) {\n      if (a[ai] === b[bi]) {\n        result.push(which === 'b' ? b[bi] : a[ai])\n        ai++\n        bi++\n      } else if (emptyGSMatch && a[ai] === '**' && b[bi] === a[ai + 1]) {\n        result.push(a[ai])\n        ai++\n      } else if (emptyGSMatch && b[bi] === '**' && a[ai] === b[bi + 1]) {\n        result.push(b[bi])\n        bi++\n      } else if (\n        a[ai] === '*' &&\n        b[bi] &&\n        (this.options.dot || !b[bi].startsWith('.')) &&\n        b[bi] !== '**'\n      ) {\n        if (which === 'b') return false\n        which = 'a'\n        result.push(a[ai])\n        ai++\n        bi++\n      } else if (\n        b[bi] === '*' &&\n        a[ai] &&\n        (this.options.dot || !a[ai].startsWith('.')) &&\n        a[ai] !== '**'\n      ) {\n        if (which === 'a') return false\n        which = 'b'\n        result.push(b[bi])\n        ai++\n        bi++\n      } else {\n        return false\n      }\n    }\n    // if we fall out of the loop, it means they two are identical\n    // as long as their lengths match\n    return a.length ===uM b.length && result\n  }\n\n  parseNegate() {\n    if (this.nonegate) return\n\n    const pattern = this.pattern\n    let negate = false\n    let negateOffset = 0\n\n    for (let i = 0; i < pattern.length && pattern.charAt(i) === '!'; i++) {\n      negate = !negate\n      negateOffset++\n    }\n\n    if (negateOffset) this.pattern = pattern.slice(negateOffset)\n    this.negate = negate\n  }\n\n  // set partial to true to test if, for example,\n  // \"/a/b\" matches the start of \"/*/b/*/d\"\n  // Partial means, if you run out of file before you run\n  // out of pattern, then that's fine, as long as all\n  // the parts match.\n  matchOne(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean = false,\n  ) {\n    let fileStartIndex = 0\n    let patternStartIndex = 0\n\n    // UNC paths like //?/X:/... can match X:/... and vice versa\n    // Drive letters in absolute drive or unc paths are always compared\n    // case-insensitively.\n    if (this.isWindows) {\n      const fileDrive =\n        typeof file[0] === 'string' && /^[a-z]:$/i.test(file[0])\n      const fileUNC =\n        !fileDrive &&\n        file[0] === '' &&\n        file[1] === '' &&\n        file[2] === '?' &&\n        /^[a-z]:$/i.test(file[3])\n\n      const patternDrive =\n        typeof pattern[0] === 'string' && /^[a-z]:$/i.test(pattern[0])\n      const patternUNC =\n        !patternDrive &&\n        pattern[0] === '' &&\n        pattern[1] === '' &&\n        pattern[2] === '?' &&\n        typeof pattern[3] === 'string' &&\n        /^[a-z]:$/i.test(pattern[3])\n\n      const fdi =\n        fileUNC ? 3\n        : fileDrive ? 0\n        : undefined\n      const pdi =\n        patternUNC ? 3\n        : patternDrive ? 0\n        : undefined\n      if (typeof fdi === 'number' && typeof pdi === 'number') {\n        const [fd, pd]: [string, string] = [\n          file[fdi],\n          pattern[pdi] as string,\n        ]\n        // start matching at the drive letter index of each\n        if (fd.toLowerCase() === pd.toLowerCase()) {\n          pattern[pdi] = fd\n          patternStartIndex = pdi\n          fileStartIndex = fdi\n        }\n      }\n    }\n\n    // resolve and reduce . and .. portions in the file as well.\n    // don't need to do the second phase, because it's only one string[]\n    const { optimizationLevel = 1 } = this.options\n    if (optimizationLevel >= 2) {\n      file = this.levelTwoFileOptimize(file)\n    }\n\n    if (pattern.includes(GLOBSTAR)) {\n      return this.#matchGlobstar(\n        file,\n        pattern,\n        partial,\n        fileStartIndex,\n        patternStartIndex,\n      )\n    }\n\n    return this.#matchOne(\n      file,\n      pattern,\n      partial,\n      fileStartIndex,\n      patternStartIndex,\n    )\n  }\n\n  #matchGlobstar(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean,\n    fileIndex: number,\n    patternIndex: number,\n  ) {\n    // split the pattern into head, tail, and middle of ** delimited parts\n    const firstgs = pattern.indexOf(GLOBSTAR, patternIndex)\n    const lastgs = pattern.lastIndexOf(GLOBSTAR)\n\n    // split the pattern up into globstar-delimited sections\n    // the tail has to be at the end, and the others just have\n    // to be found in order from the head.\n    const [head, body, tail] =\n      partial ?\n        [\n          pattern.slice(patternIndex, firstgs),\n          pattern.slice(firstgs + 1),\n          [],\n        ]\n      : [\n          pattern.slice(patternIndex, firstgs),\n          pattern.slice(firstgs + 1, lastgs),\n          pattern.slice(lastgs + 1),\n        ]\n\n    // check the head, from the current file/pattern index.\n    if (head.length) {\n      const fileHead = file.slice(fileIndex, fileIndex + head.length)\n      if (!this.#matchOne(fileHead, head, partial, 0, 0)) {\n        return false\n      }\n      fileIndex += head.length\n      patternIndex += head.length\n    }\n    // now we know the head matches!\n\n    // if the last portion is not empty, it MUST match the end\n    // check the tail\n    let fileTailMatch: number = 0\n    if (tail.length) {\n      // if head + tail > file, then we cannot possibly match\n      if (tail.length + fileIndex > file.length) return false\n\n      // try to match the tail\n      let tailStart = file.length - tail.length\n      if (this.#matchOne(file, tail, partial, tailStart, 0)) {\n        fileTailMatch = tail.length\n      } else {\n        // affordance for stuff like a/**/* matching a/b/\n        // if the last file portion is '', and there's more to the pattern\n        // then try without the '' bit.\n        if (\n          file[file.length - 1] !== '' ||\n          fileIndex + tail.length === file.length\n        ) {\n          return false\n        }\n        tailStart--\n        if (!this.#matchOne(file, tail, partial, tailStart, 0)) {\n          return false\n        }\n        fileTailMatch = tail.length + 1\n      }\n    }\n\n    // now we know the tail matches!\n\n    // the middle is zero or more portions wrapped in **, possibly\n    // containing more ** sections.\n    // so a/**/b/**/c/**/d has become **/b/**/c/**\n    // if it's empty, it means a/**/b, just verify we have no bad dots\n    // if there's no tail, so it ends on /**, then we must have *something*\n    // after the head, or it's not a matc\n    if (!body.length) {\n      let sawSome = !!fileTailMatch\n      for (let i = fileIndex; i < file.length - fileTailMatch; i++) {\n        const f = String(file[i])\n        sawSome = true\n        if (\n          f === '.' ||\n          f === '..' ||\n          (!this.options.dot && f.startsWith('.'))\n        ) {\n          return false\n        }\n      }\n      // in partial mode, we just need to get past all file parts\n      return partial || sawSome\n    }\n\n    // now we know that there's one or more body sections, which can\n    // be matched anywhere from the 0 index (because the head was pruned)\n    // through to the length-fileTailMatch index.\n    // split the body up into sections, and note the minimum index it can\n    // be found at (start with the length of all previous segments)\n    // [section, before, after]\n    const bodySegments: [ParseReturn[], number][] = [[[], 0]]\n    let currentBody: [ParseReturn[], number] = bodySegments[0]\n    let nonGsParts = 0\n    const nonGsPartsSums: number[] = [0]\n    for (const b of body) {\n      if (b === GLOBSTAR) {\n        nonGsPartsSums.push(nonGsParts)\n        currentBody = [[], 0]\n        bodySegments.push(currentBody)\n      } else {\n        currentBody[0].push(b)\n        nonGsParts++\n      }\n    }\n    let i = bodySegments.length - 1\n    const fileLength = file.length - fileTailMatch\n    for (const b of bodySegments) {\n      b[1] = fileLength - ((nonGsPartsSums[i--] as number) + b[0].length)\n    }\n\n    return !!this.#matchGlobStarBodySections(\n      file,\n      bodySegments,\n      fileIndex,\n      0,\n      partial,\n      0,\n      !!fileTailMatch,\n    )\n  }\n\n  // return false for \"nope, not matching\"\n  // return null for \"not matching, cannot keep trying\"\n  #matchGlobStarBodySections(\n    file: string[],\n    // pattern section, last possible position for it\n    bodySegments: [ParseReturn[], number][],\n    fileIndex: number,\n    bodyIndex: number,\n    partial: boolean,\n    globStarDepth: number,\n    sawTail: boolean,\n  ): boolean | null {\n    // take the first body segment, and walk from fileIndex to its \"after\"\n    // value at the end\n    // If it doesn't match at that position, we increment, until we hit\n    // that final possible position, and give up.\n    // If it does match, then advance and try to rest.\n    // If any of them fail we keep walking forward.\n    // this is still a bit recursively painful, but it's more constrained\n    // than previous implementations, because we never test something that\n    // can't possibly be a valid matching condition.\n    const bs = bodySegments[bodyIndex]\n    if (!bs) {\n      // just make sure that there's no bad dots\n      for (let i = fileIndex; i < file.length; i++) {\n        sawTail = true\n        const f = file[i]\n        if (\n          f === '.' ||\n          f === '..' ||\n          (!this.options.dot && f.startsWith('.'))\n        ) {\n          return false\n        }\n      }\n      return sawTail\n    }\n\n    // have a non-globstar body section to test\n    const [body, after] = bs\n    while (fileIndex <= after) {\n      const m = this.#matchOne(\n        file.slice(0, fileIndex + body.length),\n        body,\n        partial,\n        fileIndex,\n        0,\n      )\n      // if limit exceeded, no match. intentional false negative,\n      // acceptable break in correctness for security.\n      if (m && globStarDepth < this.maxGlobstarRecursion) {\n        // match! see if the rest match. if so, we're done!\n        const sub = this.#matchGlobStarBodySections(\n          file,\n          bodySegments,\n          fileIndex + body.length,\n          bodyIndex + 1,\n          partial,\n          globStarDepth + 1,\n          sawTail,\n        )\n        if (sub !== false) {\n          return sub\n        }\n      }\n      const f = file[fileIndex]\n      if (\n        f === '.' ||\n        f === '..' ||\n        (!this.options.dot && f.startsWith('.'))\n      ) {\n        return false\n      }\n\n      fileIndex++\n    }\n    // walked off. no point continuing\n    return partial || null\n  }\n\n  #matchOne(\n    file: string[],\n    pattern: ParseReturn[],\n    partial: boolean,\n    fileIndex: number,\n    patternIndex: number,\n  ) {\n    let fi: number\n    let pi: number\n    let pl: number\n    let fl: number\n    for (\n      fi = fileIndex,\n        pi = patternIndex,\n        fl = file.length,\n        pl = pattern.length;\n      fi < fl && pi < pl;\n      fi++, pi++\n    ) {\n      this.debug('matchOne loop')\n      let p = pattern[pi]\n      let f = file[fi]\n\n      this.debug(pattern, p, f)\n\n      // should be impossible.\n      // some invalid regexp stuff in the set.\n      /* c8 ignore start */\n      if (p === false || p === GLOBSTAR) {\n        return false\n      }\n      /* c8 ignore stop */\n\n      // something other than **\n      // non-magic patterns just have to match exactly\n      // patterns with magic have been turned into regexps.\n      let hit: boolean\n      if (typeof p === 'string') {\n        hit = f === p\n        this.debug('string match', p, f, hit)\n      } else {\n        hit = p.test(f)\n        this.debug('pattern match', p, f, hit)\n      }\n\n      if (!hit) return false\n    }\n\n    // Note: ending in / means that we'll get a final \"\"\n    // at the end of the pattern.  This can only match a\n    // corresponding \"\" at the end of the file.\n    // If the file ends in /, then it can only match a\n    // a pattern that ends in /, unless the pattern just\n    // doesn't have any more for it. But, a/b/ should *not*\n    // match \"a/b/*\", even though \"\" matches against the\n    // [^/]*? pattern, except in partial mode, where it might\n    // simply not be reached yet.\n    // However, a/b/ should still satisfy a/*\n\n    // now either we fell off the end of the pattern, or we're done.\n    if (fi === fl && pi === pl) {\n      // ran out of pattern and filename at the same time.\n      // an exact hit!\n      return true\n    } else if (fi === fl) {\n      // ran out of file, but still had pattern left.\n      // this is ok if we're doing the match as part of\n      // a glob fs traversal.\n      return partial\n    } else if (pi === pl) {\n      // ran out of pattern, still have file left.\n      // this is only acceptable if we're on the very last\n      // empty segment of a file with a trailing slash.\n      // a/* should match a/b/\n      return fi === fl - 1 && file[fi] === ''\n\n      /* c8 ignore start */\n    } else {\n      // should be unreachable.\n      throw new Error('wtf?')\n    }\n    /* c8 ignore stop */\n  }\n\n  braceExpand() {\n    return braceExpand(this.pattern, this.options)\n  }\n\n  parse(pattern: string): ParseReturn {\n    assertValidPattern(pattern)\n\n    const options = this.options\n\n    // shortcuts\n    if (pattern === '**') return GLOBSTAR\n    if (pattern === '') return ''\n\n    // far and away, the most common glob pattern parts are\n    // *, *.*, and *.<ext>  Add a fast check method for those.\n    let m: RegExpMatchArray | null\n    let fastTest: null | ((f: string) => boolean) = null\n    if ((m = pattern.match(starRE))) {\n      fastTest = options.dot ? starTestDot : starTest\n    } else if ((m = pattern.match(starDotExtRE))) {\n      fastTest = (\n        options.nocase ?\n          options.dot ?\n            starDotExtTestNocaseDot\n          : starDotExtTestNocase\n        : options.dot ? starDotExtTestDot\n        : starDotExtTest)(m[1])\n    } else if ((m = pattern.match(qmarksRE))) {\n      fastTest = (\n        options.nocase ?\n          options.dot ?\n            qmarksTestNocaseDot\n          : qmarksTestNocase\n        : options.dot ? qmarksTestDot\n        : qmarksTest)(m)\n    } else if ((m = pattern.match(starDotStarRE))) {\n      fastTest = options.dot ? starDotStarTestDot : starDotStarTest\n    } else if ((m = pattern.match(dotStarRE))) {\n      fastTest = dotStarTest\n    }\n\n    const re = AST.fromGlob(pattern, this.options).toMMPattern()\n    if (fastTest && typeof re === 'object') {\n      // Avoids overriding in frozen environments\n      Reflect.defineProperty(re, 'test', { value: fastTest })\n    }\n    return re\n  }\n\n  makeRe() {\n    if (this.regexp || this.regexp === false) return this.regexp\n\n    // at this point, this.set is a 2d array of partial\n    // pattern strings, or \"**\".\n    //\n    // It's better to use .match().  This function shouldn't\n    // be used, really, but it's pretty convenient sometimes,\n    // when you just want to work with a regex.\n    const set = this.set\n\n    if (!set.length) {\n      this.regexp = false\n      return this.regexp\n    }\n    const options = this.options\n\n    const twoStar =\n      options.noglobstar ? star\n      : options.dot ? twoStarDot\n      : twoStarNoDot\n    const flags = new Set(options.nocase ? ['i'] : [])\n\n    // regexpify non-globstar patterns\n    // if ** is only item, then we just do one twoStar\n    // if ** is first, and there are more, prepend (\\/|twoStar\\/)? to next\n    // if ** is last, append (\\/twoStar|) to previous\n    // if ** is in the middle, append (\\/|\\/twoStar\\/) to previous\n    // then filter out GLOBSTAR symbols\n    let re = set\n      .map(pattern => {\n        const pp: (string | typeof GLOBSTAR)[] = pattern.map(p => {\n          if (p instanceof RegExp) {\n            for (const f of p.flags.split('')) flags.add(f)\n          }\n          return (\n            typeof p === 'string' ? regExpEscape(p)\n            : p === GLOBSTAR ? GLOBSTAR\n            : p._src\n          )\n        }) as (string | typeof GLOBSTAR)[]\n        pp.forEach((p, i) => {\n          const next = pp[i + 1]\n          const prev = pp[i - 1]\n          if (p !== GLOBSTAR || prev === GLOBSTAR) {\n            return\n          }\n          if (prev === undefined) {\n            if (next !== undefined && next !== GLOBSTAR) {\n              pp[i + 1] = '(?:\\\\/|' + twoStar + '\\\\/)?' + next\n            } else {\n              pp[i] = twoStar\n            }\n          } else if (next === undefined) {\n            pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + ')?'\n          } else if (next !== GLOBSTAR) {\n            pp[i - 1] = prev + '(?:\\\\/|\\\\/' + twoStar + '\\\\/)' + next\n            pp[i + 1] = GLOBSTAR\n          }\n        })\n        const filtered = pp.filter(p => p !== GLOBSTAR)\n\n        // For partial matches, we need to make the pattern match\n        // any prefix of the full path. We do this by generating\n        // alternative patterns that match progressively longer prefixes.\n        if (this.partial && filtered.length >= 1) {\n          const prefixes: string[] = []\n          for (let i = 1; i <= filtered.length; i++) {\n            prefixes.push(filtered.slice(0, i).join('/'))\n          }\n          return '(?:' + prefixes.join('|') + ')'\n        }\n\n        return filtered.join('/')\n      })\n      .join('|')\n\n    // need to wrap in parens if we had more than one thing with |,\n    // otherwise only the first will be anchored to ^ and the last to $\n    const [open, close] = set.length > 1 ? ['(?:', ')'] : ['', '']\n    // must match entire pattern\n    // ending in a * or ** will make it less strict.\n    re = '^' + open + re + close + '$'\n\n    // In partial mode, '/' should always match as it's a valid prefix for any pattern\n    if (this.partial) {\n      re = '^(?:\\\\/|' + open + re.slice(1, -1) + close + ')$'\n    }\n\n    // can match anything, as long as it's not this.\n    if (this.negate) re = '^(?!' + re + ').+$'\n\n    try {\n      this.regexp = new RegExp(re, [...flags].join(''))\n      /* c8 ignore start */\n    } catch {\n      // should be impossible\n      this.regexp = false\n    }\n    /* c8 ignore stop */\n    return this.regexp\n  }\n\n  slashSplit(p: string) {\n    // if p starts with // on windows, we preserve that\n    // so that UNC paths aren't broken.  Otherwise, any number of\n    // / characters are coalesced into one, unless\n    // preserveMultipleSlashes is set to true.\n    if (this.preserveMultipleSlashes) {\n      return p.split('/')\n    } else if (this.isWindows && /^\\/\\/[^/]+/.test(p)) {\n      // add an extra '' for the one we lose\n      return ['', ...p.split(/\\/+/)]\n    } else {\n      return p.split(/\\/+/)\n    }\n  }\n\n  match(f: string, partial = this.partial) {\n    this.debug('match', f, this.pattern)\n    // short-circuit in the case of busted things.\n    // comments, etc.\n    if (this.comment) {\n      return false\n    }\n    if (this.empty) {\n      return f === ''\n    }\n\n    if (f === '/' && partial) {\n      return true\n    }\n\n    const options = this.options\n\n    // windows: need to use /, not \\\n    if (this.isWindows) {\n      f = f.split('\\\\').join('/')\n    }\n\n    // treat the test path as a set of pathparts.\n    const ff = this.slashSplit(f)\n    this.debug(this.pattern, 'split', ff)\n\n    // just ONE of the pattern sets in this.set needs to match\n    // in order for it to be valid.  If negating, then just one\n    // match means that we have failed.\n    // Either way, return on the first hit.\n\n    const set = this.set\n    this.debug(this.pattern, 'set', set)\n\n    // Find the basename of the path by looking for the last non-empty segment\n    let filename: string = ff[ff.length - 1]\n    if (!filename) {\n      for (let i = ff.length - 2; !filename && i >= 0; i--) {\n        filename = ff[i]\n      }\n    }\n\n    for (const pattern of set) {\n      let file = ff\n      if (options.matchBase && pattern.length === 1) {\n        file = [filename]\n      }\n      const hit = this.matchOne(file, pattern, partial)\n      if (hit) {\n        if (options.flipNegate) {\n          return true\n        }\n        return !this.negate\n      }\n    }\n\n    // didn't get any hits.  this is success if it's a negative\n    // pattern, failure otherwise.\n    if (options.flipNegate) {\n      return false\n    }\n    return this.negate\n  }\n\n  static defaults(def: MinimatchOptions) {\n    return minimatch.defaults(def).Minimatch\n  }\n}\n/* c8 ignore start */\nexport { AST } from './ast.js'\nexport { escape } from './escape.js'\nexport { unescape } from './unescape.js'\n/* c8 ignore stop */\nminimatch.AST = AST\nminimatch.Minimatch = Minimatch\nminimatch.escape = escape\nminimatch.unescape = unescape\n"]}x 
	hexport 'J$6x mpH,MAAM,CAACb
Jqx{
  "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)",
  "name": "minimatch",
  "description": "a glob matcher in javascript",
  "version": "10.2.6",
  "repository": {
    "type": "git",
    "url": "git@github.com:isaacs/minimatch"
  },
  "main": "./dist/commonjs/index.js",
  "types": "./dist/commonjs/index.d.ts",
  "exports": {
    "./package.json": "./package.json",
    ".": {
      "import": {
        "types": "./dist/esm/index.d.ts",
        "default": "./dist/esm/index.js"
      },
      "require": {
        "types": "./dist/commonjs/index.d.ts",
        "default": "./dist/commonjs/index.js"
      }
    }
  },
  "files": [
    "dist"
  ],
  "scripts": {
    "preversion": "npm test",
    "postversion": "npm publish",
    "prepublishOnly": "git push origin --follow-tags",
    "prepare": "tshy",
    "pretest": "npm run prepare",
    "presnap": "npm run prepare",
    "test": "tap",
    "snap": "tap",
    "format": "prettier --write .",
    "benchmark": "node benchmark/index.js",
    "typedoc": "typedoc --tsconfig .tshy/esm.json ./src/*.ts",
    "lint": "oxlint --fix src test",
    "postsnap": "npm run lint",
    "postlint": "npm run format"
  },
  "engines": {
    "node": "18 || 20 || >=22"
  },
  "devDependencies": {
    "@types/node": "^26.1.2",
    "mkdirp": "^3.0.1",
    "oxlint": "^1.76.0",
    "oxlint-tsgolint": "^7.0.2001",
    "prettier": "^3.9.6",
    "tap": "^21.7.5",
    "tshy": "^4.1.3",
    "typedoc": "^0.28.20"
  },
  "funding": {
    "url": "https://github.com/sponsors/isaacs"
  },
  "license": "BlueOak-1.0.0",
  "tshy": {
    "exports": {
      "./package.json": "./package.json",
      ".": "./src/index.ts"
    },
    "selfLink": false
  },
  "type": "module",
  "module": "./dist/esm/index.js",
  "dependencies": {
    "brace-expansion": "^5.0.8"
  }
}
	x h100644 index.js sO8 1nm>100644 license.md ]9!?^+d5uIq100644 package.json Iߎ+J_I	g-P100644 readme.md 
:p#C|uט<x//**
 * Helpers.
 */

var s = 1000;
var m = s * 60;
var h = m * 60;
var d = h * 24;
var w = d * 7;
var y = d * 365.25;

/**
 * Parse or format the given `val`.
 *
 * Options:
 *
 *  - `long` verbose formatting [false]
 *
 * @param {String|Number} val
 * @param {Object} [options]
 * @throws {Error} throw an error if val is not a non-empty string or a number
 * @return {String|Number}
 * @api public
 */

module.exports = function (val, options) {
  options = options || {};
  var type = typeof val;
  if (type === 'string' && val.length > 0) {
    return parse(val);
  } else if (type === 'number' && isFinite(val)) {
    return options.long ? fmtLong(val) : fmtShort(val);
  }
  throw new Error(
    'val is not a non-empty string or a valid number. val=' +
      JSON.stringify(val)
  );
};

/**
 * Parse the given `str` and return milliseconds.
 *
 * @param {String} str
 * @return {Number}
 * @api private
 */

function parse(str) {
  str = String(str);
  if (str.length > 100) {
    return;
  }
  var match = /^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(
    str
  );
  if (!match) {
    return;
  }
  var n = parseFloat(match[1]);
  var type = (match[2] || 'ms').toLowerCase();
  switch (type) {
    case 'years':
    case 'year':
    case 'yrs':
    case 'yr':
    case 'y':
      return n * y;
    case 'weeks':
    case 'week':
    case 'w':
      return n * w;
    case 'days':
    case 'day':
    case 'd':
      return n * d;
    case 'hours':
    case 'hour':
    case 'hrs':
    case 'hr':
    case 'h':
      return n * h;
    case 'minutes':
    case 'minute':
    case 'mins':
    case 'min':
    case 'm':
      return n * m;
    case 'seconds':
    case 'second':
    case 'secs':
    case 'sec':
    case 's':
      return n * s;
    case 'milliseconds':
    case 'millisecond':
    case 'msecs':
    case 'msec':
    case 'ms':
      return n;
    default:
      return undefined;
  }
}

/**
 * Short format for `ms`.
 *
 * @param {Number} ms
 * @return {String}
 * @api private
 */

function fmtShort(ms) {
  var msAbs = Math.abs(ms);
  if (msAbs >= d) {
    return Math.round(ms / d) + 'd';
  }
  if (msAbs >= h) {
    return Math.round(ms / h) + 'h';
  }
  if (msAbs >= m) {
    return Math.round(ms / m) + 'm';
  }
  if (msAbs >= s) {
    return Math.round(ms / s) + 's';
  }
  return ms + 'ms';
}

/**
 * Long format for `ms`.
 *
 * @param {Number} ms
 * @return {String}
 * @api private
 */

function fmtLong(ms) {
  var msAbs = Math.abs(ms);
  if (msAbs >= d) {
    return plural(ms, msAbs, d, 'day');
  }
  if (msAbs >= h) {
    return plural(ms, msAbs, h, 'hour');
  }
  if (msAbs >= m) {
    return plural(ms, msAbs, m, 'minute');
  }
  if (msAbs >= s) {
    return plural(ms, msAbs, s, 'second');
  }
  return ms + ' ms';
}

/**
 * Pluralization helper.
 */

function plural(ms, msAbs, n, name) {
  var isPlural = msAbs >= n * 1.5;
  return Math.round(ms / n) + ' ' + name + (isPlural ? 's' : '');
}
r{Cx7The MIT License (MIT)

Copyright (c) 2020 Vercel, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
Vq-x#{
  "name": "ms",
  "version": "2.1.3",
  "description": "Tiny millisecond conversion utility",
  "repository": "vercel/ms",
  "main": "./index",
  "files": [
    "index.js"
  ],
  "scripts": {
    "precommit": "lint-staged",
    "lint": "eslint lib/* bin/*",
    "test": "mocha tests.js"
  },
  "eslintConfig": {
    "extends": "eslint:recommended",
    "env": {
      "node": true,
      "es6": true
    }
  },
  "lint-staged": {
    "*.js": [
      "npm run lint",
      "prettier --single-quote --write",
      "git add"
    ]
  },
  "license": "MIT",
  "devDependencies": {
    "eslint": "4.18.2",
    "expect.js": "0.3.1",
    "husky": "0.14.3",
    "lint-staged": "5.0.0",
    "mocha": "4.0.1",
    "prettier": "2.0.5"
  }
}
BŁux^# ms

![CI](https://github.com/vercel/ms/workflows/CI/badge.svg)

Use this package to easily convert various time formats to milliseconds.

## Examples

```js
ms('2 days')  // 172800000
ms('1d')      // 86400000
ms('10h')     // 36000000
ms('2.5 hrs') // 9000000
ms('2h')      // 7200000
ms('1m')      // 60000
ms('5s')      // 5000
ms('1y')      // 31557600000
ms('100')     // 100
ms('-3 days') // -259200000
ms('-1h')     // -3600000
ms('-200')    // -200
```

### Convert from Milliseconds

```js
ms(60000)             // "1m"
ms(2 * 60000)         // "2m"
ms(-3 * 60000)        // "-3m"
ms(ms('10 hours'))    // "10h"
```

### Time Format Written-Out

```js
ms(60000, { long: true })             // "1 minute"
ms(2 * 60000, { long: true })         // "2 minutes"
ms(-3 * 60000, { long: true })        // "-3 minutes"
ms(ms('10 hours'), { long: true })    // "10 hours"
```

## Features

- Works both in [Node.js](https://nodejs.org) and in the browser
- If a number is supplied to `ms`, a string with a unit is returned
- If a string that contains the number is supplied, it returns it as a number (e.g.: it returns `100` for `'100'`)
- If you pass a string with a number and a valid unit, the number of equivalent milliseconds is returned

## Related Packages

- [ms.macro](https://github.com/knpwrs/ms.macro) - Run `ms` as a macro at build-time.

## Caught a Bug?

1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local device
2. Link the package to the global module directory: `npm link`
3. Within the module you want to test your local development instance of ms, just link it to the dependencies: `npm link ms`. Instead of the default one from npm, Node.js will now use your clone of ms!

As always, you can run the tests using: `npm test`
9xq 100644 README.md ]u	e:^ǣc100644 index.js ԟ_6j$n*100644 package.json q6.ꁢIBu-x
[Build]:    http://img.shields.io/travis/litejs/natural-compare-lite.png
[Coverage]: http://img.shields.io/coveralls/litejs/natural-compare-lite.png
[1]: https://travis-ci.org/litejs/natural-compare-lite
[2]: https://coveralls.io/r/litejs/natural-compare-lite
[npm package]: https://npmjs.org/package/natural-compare-lite
[GitHub repo]: https://github.com/litejs/natural-compare-lite



    @version    1.4.0
    @date       2015-10-26
    @stability  3 - Stable


Natural Compare &ndash; [![Build][]][1] [![Coverage][]][2]
===============

Compare strings containing a mix of letters and numbers
in the way a human being would in sort order.
This is described as a "natural ordering".

```text
Standard sorting:   Natural order sorting:
    img1.png            img1.png
    img10.png           img2.png
    img12.png           img10.png
    img2.png            img12.png
```

String.naturalCompare returns a number indicating
whether a reference string comes before or after or is the same
as the given string in sort order.
Use it with builtin sort() function.



### Installation

- In browser

```html
<script src=min.natural-compare.js></script>
```

- In node.js: `npm install natural-compare-lite`

```javascript
require("natural-compare-lite")
```

### Usage

```javascript
// Simple case sensitive example
var a = ["z1.doc", "z10.doc", "z17.doc", "z2.doc", "z23.doc", "z3.doc"];
a.sort(String.naturalCompare);
// ["z1.doc", "z2.doc", "z3.doc", "z10.doc", "z17.doc", "z23.doc"]

// Use wrapper function for case insensitivity
a.sort(function(a, b){
  return String.naturalCompare(a.toLowerCase(), b.toLowerCase());
})

// In most cases we want to sort an array of objects
var a = [ {"street":"350 5th Ave", "room":"A-1021"}
        , {"street":"350 5th Ave", "room":"A-21046-b"} ];

// sort by street, then by room
a.sort(function(a, b){
  return String.naturalCompare(a.street, b.street) || String.naturalCompare(a.room, b.room);
})

// When text transformation is needed (eg toLowerCase()),
// it is best for performance to keep
// transformed key in that object.
// There are no need to do text transformation
// on each comparision when sorting.
var a = [ {"make":"Audi", "model":"A6"}
        , {"make":"Kia",  "model":"Rio"} ];

// sort by make, then by model
a.map(function(car){
  car.sort_key = (car.make + " " + car.model).toLowerCase();
})
a.sort(function(a, b){
  return String.naturalCompare(a.sort_key, b.sort_key);
})
```

- Works well with dates in ISO format eg "Rev 2012-07-26.doc".


### Custom alphabet

It is possible to configure a custom alphabet
to achieve a desired order.

```javascript
// Estonian alphabet
String.alphabet = "ABDEFGHIJKLMNOPRSŠZŽTUVÕÄÖÜXYabdefghijklmnoprsšzžtuvõäöüxy"
["t", "z", "x", "õ"].sort(String.naturalCompare)
// ["z", "t", "õ", "x"]

// Russian alphabet
String.alphabet = "АБВГДЕЁЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯабвгдеёжзийклмнопрстуфхцчшщъыьэюя"
["Ё", "А", "Б"].sort(String.naturalCompare)
// ["А", "Б", "Ё"]
```


External links
--------------

-   [GitHub repo][https://github.com/litejs/natural-compare-lite]
-   [jsperf test](http://jsperf.com/natural-sort-2/12)


Licence
-------

Copyright (c) 2012-2015 Lauri Rooden &lt;lauri@rooden.ee&gt;  
[The MIT License](http://lauri.rooden.ee/mit-license.txt)


rԷQx


/*
 * @version    1.4.0
 * @date       2015-10-26
 * @stability  3 - Stable
 * @author     Lauri Rooden (https://github.com/litejs/natural-compare-lite)
 * @license    MIT License
 */


var naturalCompare = function(a, b) {
	var i, codeA
	, codeB = 1
	, posA = 0
	, posB = 0
	, alphabet = String.alphabet

	function getCode(str, pos, code) {
		if (code) {
			for (i = pos; code = getCode(str, i), code < 76 && code > 65;) ++i;
			return +str.slice(pos - 1, i)
		}
		code = alphabet && alphabet.indexOf(str.charAt(pos))
		return code > -1 ? code + 76 : ((code = str.charCodeAt(pos) || 0), code < 45 || code > 127) ? code
			: code < 46 ? 65               // -
			: code < 48 ? code - 1
			: code < 58 ? code + 18        // 0-9
			: code < 65 ? code - 11
			: code < 91 ? code + 11        // A-Z
			: code < 97 ? code - 37
			: code < 123 ? code + 5        // a-z
			: code - 63
	}


	if ((a+="") != (b+="")) for (;codeB;) {
		codeA = getCode(a, posA++)
		codeB = getCode(b, posB++)

		if (codeA < 76 && codeB < 76 && codeA > 66 && codeB > 66) {
			codeA = getCode(a, posA, posA)
			codeB = getCode(b, posB, posA = i)
			posB = i
		}

		if (codeA != codeB) return (codeA < codeB) ? -1 : 1
	}
	return 0
}

try {
	module.exports = naturalCompare;
} catch (e) {
	String.naturalCompare = naturalCompare;
}
ɚ]>x{
  "name": "natural-compare",
  "version": "1.4.0",
  "stability": 3,
  "author": "Lauri Rooden (https://github.com/litejs/natural-compare-lite)",
  "license": "MIT",
  "description": "Compare strings containing a mix of letters and numbers in the way a human being would in sort order.",
  "keywords": [
    "string",
    "natural",
    "order",
    "sort",
    "natsort",
    "natcmp",
    "compare",
    "alphanum",
    "litejs"
  ],
  "main": "index.js",
  "readmeFilename": "README.md",
  "files": [
    "index.js"
  ],
  "scripts": {
    "build": "node node_modules/buildman/index.js --all",
    "test": "node tests/index.js"
  },
  "repository": "git://github.com/litejs/natural-compare-lite.git",
  "bugs": {
    "url": "https://github.com/litejs/natural-compare-lite/issues"
  },
  "devDependencies": {
    "buildman": "*",
    "testman": "*"
  },
  "buildman": {
    "dist/index-min.js": {
      "banner": "/*! litejs.com/MIT-LICENSE.txt */",
      "input": "index.js"
    }
  }
}
O((x q100644 LICENSE dc+\;ـe]100644 README.md zOt<"F}ԗq40000 lib RT+OVKNvsE(100644 package.json E;CCxǈK6NxCopyright (c) Felix Böhm
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS,
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
ExF# nth-check [![Build Status](https://travis-ci.org/fb55/nth-check.svg)](https://travis-ci.org/fb55/nth-check)

Parses and compiles CSS nth-checks to highly optimized functions.

### About

This module can be used to parse & compile nth-checks, as they are found in CSS 3's `nth-child()` and `nth-last-of-type()`. It can be used to check if a given index matches a given nth-rule, or to generate a sequence of indices matching a given nth-rule.

`nth-check` focusses on speed, providing optimized functions for different kinds of nth-child formulas, while still following the [spec](http://www.w3.org/TR/css3-selectors/#nth-child-pseudo).

### API

```js
import nthCheck, { parse, compile } from "nth-check";
```

##### `nthCheck(formula)`

Parses and compiles a formula to a highly optimized function. Combination of `parse` and `compile`.

If the formula doesn't match any elements, it returns [`boolbase`](https://github.com/fb55/boolbase)'s `falseFunc`. Otherwise, a function accepting an _index_ is returned, which returns whether or not the passed _index_ matches the formula.

**Note**: The nth-rule starts counting at `1`, the returned function at `0`.

**Example:**

```js
const check = nthCheck("2n+3");

check(0); // `false`
check(1); // `false`
check(2); // `true`
check(3); // `false`
check(4); // `true`
check(5); // `false`
check(6); // `true`
```

##### `parse(formula)`

Parses the expression, throws an `Error` if it fails. Otherwise, returns an array containing the integer step size and the integer offset of the nth rule.

**Example:**

```js
parse("2n+3"); // [2, 3]
```

##### `compile([a, b])`

Takes an array with two elements (as returned by `.parse`) and returns a highly optimized function.

**Example:**

```js
const check = compile([2, 3]);

check(0); // `false`
check(1); // `false`
check(2); // `true`
check(3); // `false`
check(4); // `true`
check(5); // `false`
check(6); // `true`
```

##### `generate([a, b])`

Returns a function that produces a monotonously increasing sequence of indices.

If the sequence has an end, the returned function will return `null` after the last index in the sequence.

**Example:** An always increasing sequence

```js
const gen = nthCheck.generate([2, 3]);

gen(); // `1`
gen(); // `3`
gen(); // `5`
gen(); // `8`
gen(); // `11`
```

**Example:** With an end value

```js
const gen = nthCheck.generate([-2, 5]);

gen(); // 0
gen(); // 2
gen(); // 4
gen(); // null
```

##### `sequence(formula)`

Parses and compiles a formula to a generator that produces a sequence of indices. Combination of `parse` and `generate`.

**Example:** An always increasing sequence

```js
const gen = nthCheck.sequence("2n+3");

gen(); // `1`
gen(); // `3`
gen(); // `5`
gen(); // `8`
gen(); // `11`
```

**Example:** With an end value

```js
const gen = nthCheck.sequence("-2n+5");

gen(); // 0
gen(); // 2
gen(); // 4
gen(); // null
```

---

License: BSD-2-Clause

## Security contact information

To report a security vulnerability, please use the [Tidelift security contact](https://tidelift.com/security).
Tidelift will coordinate the fix and disclosure.

## `nth-check` for enterprise

Available as part of the Tidelift Subscription

The maintainers of `nth-check` and thousands of other packages are working with Tidelift to deliver commercial support and maintenance for the open source dependencies you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact dependencies you use. [Learn more.](https://tidelift.com/subscription/pkg/npm-nth-check?utm_source=npm-nth-check&utm_medium=referral&utm_campaign=enterprise&utm_term=repo)
]]Fx100644 compile.d.ts cV-"f6b100644 compile.d.ts.map dlZʘ_ѳ_100644 compile.js D"RDD100644 compile.js.map [*8c[
P40000 esm ˏ]҇v-Y100644 index.d.ts ,ӝe0YW100644 index.d.ts.map ͽ<Mz:BMz100644 index.js 0S1M8P!9w100644 index.js.map xWS9W100644 parse.d.ts #-p}(7֪100644 parse.d.ts.map xF#$ܴßv*100644 parse.js BDTr'i100644 parse.js.map &Զhy&aHTљ[xI/**
 * Returns a function that checks if an elements index matches the given rule
 * highly optimized to return the fastest solution.
 *
 * @param parsed A tuple [a, b], as returned by `parse`.
 * @returns A highly optimized function that returns whether an index matches the nth-check.
 * @example
 *
 * ```js
 * const check = nthCheck.compile([2, 3]);
 *
 * check(0); // `false`
 * check(1); // `false`
 * check(2); // `true`
 * check(3); // `false`
 * check(4); // `true`
 * check(5); // `false`
 * check(6); // `true`
 * ```
 */
export declare function compile(parsed: [a: number, b: number]): (index: number) => boolean;
/**
 * Returns a function that produces a monotonously increasing sequence of indices.
 *
 * If the sequence has an end, the returned function will return `null` after
 * the last index in the sequence.
 *
 * @param parsed A tuple [a, b], as returned by `parse`.
 * @returns A function that produces a sequence of indices.
 * @example <caption>Always increasing (2n+3)</caption>
 *
 * ```js
 * const gen = nthCheck.generate([2, 3])
 *
 * gen() // `1`
 * gen() // `3`
 * gen() // `5`
 * gen() // `8`
 * gen() // `11`
 * ```
 *
 * @example <caption>With end value (-2n+10)</caption>
 *
 * ```js
 *
 * const gen = nthCheck.generate([-2, 5]);
 *
 * gen() // 0
 * gen() // 2
 * gen() // 4
 * gen() // null
 * ```
 */
export declare function generate(parsed: [a: number, b: number]): () => number | null;
//# sourceMappingURL=compile.d.ts.mapb"x{"version":3,"file":"compile.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/nth-check/639fd2a4000b69f82350aad8c34cb43f77e483ba/src/","sources":["compile.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,OAAO,CACnB,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,GAC/B,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAgC5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,GAAG,MAAM,MAAM,GAAG,IAAI,CA+B5E"}~&ox"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.generate = exports.compile = void 0;
var boolbase_1 = __importDefault(require("boolbase"));
/**
 * Returns a function that checks if an elements index matches the given rule
 * highly optimized to return the fastest solution.
 *
 * @param parsed A tuple [a, b], as returned by `parse`.
 * @returns A highly optimized function that returns whether an index matches the nth-check.
 * @example
 *
 * ```js
 * const check = nthCheck.compile([2, 3]);
 *
 * check(0); // `false`
 * check(1); // `false`
 * check(2); // `true`
 * check(3); // `false`
 * check(4); // `true`
 * check(5); // `false`
 * check(6); // `true`
 * ```
 */
function compile(parsed) {
    var a = parsed[0];
    // Subtract 1 from `b`, to convert from one- to zero-indexed.
    var b = parsed[1] - 1;
    /*
     * When `b <= 0`, `a * n` won't be lead to any matches for `a < 0`.
     * Besides, the specification states that no elements are
     * matched when `a` and `b` are 0.
     *
     * `b < 0` here as we subtracted 1 from `b` above.
     */
    if (b < 0 && a <= 0)
        return boolbase_1.default.falseFunc;
    // When `a` is in the range -1..1, it matches any element (so only `b` is checked).
    if (a === -1)
        return function (index) { return index <= b; };
    if (a === 0)
        return function (index) { return index === b; };
    // When `b <= 0` and `a === 1`, they match any element.
    if (a === 1)
        return b < 0 ? boolbase_1.default.trueFunc : function (index) { return index >= b; };
    /*
     * Otherwise, modulo can be used to check if there is a match.
     *
     * Modulo doesn't care about the sign, so let's use `a`s absolute value.
     */
    var absA = Math.abs(a);
    // Get `b mod a`, + a if this is negative.
    var bMod = ((b % absA) + absA) % absA;
    return a > 1
        ? function (index) { return index >= b && index % absA === bMod; }
        : function (index) { return index <= b && index % absA === bMod; };
}
exports.compile = compile;
/**
 * Returns a function that produces a monotonously increasing sequence of indices.
 *
 * If the sequence has an end, the returned function will return `null` after
 * the last index in the sequence.
 *
 * @param parsed A tuple [a, b], as returned by `parse`.
 * @returns A function that produces a sequence of indices.
 * @example <caption>Always increasing (2n+3)</caption>
 *
 * ```js
 * const gen = nthCheck.generate([2, 3])
 *
 * gen() // `1`
 * gen() // `3`
 * gen() // `5`
 * gen() // `8`
 * gen() // `11`
 * ```
 *
 * @example <caption>With end value (-2n+10)</caption>
 *
 * ```js
 *
 * const gen = nthCheck.generate([-2, 5]);
 *
 * gen() // 0
 * gen() // 2
 * gen() // 4
 * gen() // null
 * ```
 */
function generate(parsed) {
    var a = parsed[0];
    // Subtract 1 from `b`, to convert from one- to zero-indexed.
    var b = parsed[1] - 1;
    var n = 0;
    // Make sure to always return an increasing sequence
    if (a < 0) {
        var aPos_1 = -a;
        // Get `b mod a`
        var minValue_1 = ((b % aPos_1) + aPos_1) % aPos_1;
        return function () {
            var val = minValue_1 + aPos_1 * n++;
            return val > b ? null : val;
        };
    }
    if (a === 0)
        return b < 0
            ? // There are no result — always return `null`
                function () { return null; }
            : // Return `b` exactly once
                function () { return (n++ === 0 ? b : null); };
    if (b < 0) {
        b += a * Math.ceil(-b / a);
    }
    return function () { return a * n++ + b; };
}
exports.generate = generate;
//# sourceMappingURL=compile.js.mapqӻxd{"version":3,"file":"compile.js","sourceRoot":"https://raw.githubusercontent.com/fb55/nth-check/639fd2a4000b69f82350aad8c34cb43f77e483ba/src/","sources":["compile.ts"],"names":[],"mappings":";;;;;;AAAA,sDAAgC;AAEhC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,OAAO,CACnB,MAA8B;IAE9B,IAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,CAAC;IACpB,6DAA6D;IAC7D,IAAM,CAAC,GAAG,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IAExB;;;;;;OAMG;IACH,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,OAAO,kBAAQ,CAAC,SAAS,CAAC;IAE/C,mFAAmF;IACnF,IAAI,CAAC,KAAK,CAAC,CAAC;QAAE,OAAO,UAAC,KAAK,IAAK,OAAA,KAAK,IAAI,CAAC,EAAV,CAAU,CAAC;IAC3C,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,UAAC,KAAK,IAAK,OAAA,KAAK,KAAK,CAAC,EAAX,CAAW,CAAC;IAC3C,uDAAuD;IACvD,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,kBAAQ,CAAC,QAAQ,CAAC,CAAC,CAAC,UAAC,KAAK,IAAK,OAAA,KAAK,IAAI,CAAC,EAAV,CAAU,CAAC;IAEtE;;;;OAIG;IACH,IAAM,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;IACzB,0CAA0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,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,EAAtB,CAAsB,CAAC;IAEvC,IAAI,CAAC,GAAG,CAAC,EAAE;QACP,CAAC,IAAI,CAAC,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC;KAC9B;IAED,OAAO,cAAM,OAAA,CAAC,GAAG,CAAC,EAAE,GAAG,CAAC,EAAX,CAAW,CAAC;AAC7B,CAAC;AA/BD,4BA+BC"}_9 x100644 compile.d.ts cV-"f6b100644 compile.d.ts.map dlZʘ_ѳ_100644 compile.js 1}7kNTV100644 compile.js.map ̻3^cWk100644 index.d.ts ,ӝe0YW100644 index.d.ts.map ͽ<Mz:BMz100644 index.js 
ohTKtYOoS100644 index.js.map c࠮n`Vb100644 package.json S}_ j1100644 parse.d.ts #-p}(7֪100644 parse.d.ts.map xF#$ܴßv*100644 parse.js Ԏ&<4Py3100644 parse.js.map 30՘MA۝؜ximport boolbase from "boolbase";
/**
 * Returns a function that checks if an elements index matches the given rule
 * highly optimized to return the fastest solution.
 *
 * @param parsed A tuple [a, b], as returned by `parse`.
 * @returns A highly optimized function that returns whether an index matches the nth-check.
 * @example
 *
 * ```js
 * const check = nthCheck.compile([2, 3]);
 *
 * check(0); // `false`
 * check(1); // `false`
 * check(2); // `true`
 * check(3); // `false`
 * check(4); // `true`
 * check(5); // `false`
 * check(6); // `true`
 * ```
 */
export function compile(parsed) {
    const a = parsed[0];
    // Subtract 1 from `b`, to convert from one- to zero-indexed.
    const b = parsed[1] - 1;
    /*
     * When `b <= 0`, `a * n` won't be lead to any matches for `a < 0`.
     * Besides, the specification states that no elements are
     * matched when `a` and `b` are 0.
     *
     * `b < 0` here as we subtracted 1 from `b` above.
     */
    if (b < 0 && a <= 0)
        return boolbase.falseFunc;
    // When `a` is in the range -1..1, it matches any element (so only `b` is checked).
    if (a === -1)
        return (index) => index <= b;
    if (a === 0)
        return (index) => index === b;
    // When `b <= 0` and `a === 1`, they match any element.
    if (a === 1)
        return b < 0 ? boolbase.trueFunc : (index) => index >= b;
    /*
     * Otherwise, modulo can be used to check if there is a match.
     *
     * Modulo doesn't care about the sign, so let's use `a`s absolute value.
     */
    const absA = Math.abs(a);
    // Get `b mod a`, + a if this is negative.
    const bMod = ((b % absA) + absA) % absA;
    return a > 1
        ? (index) => index >= b && index % absA === bMod
        : (index) => index <= b && index % absA === bMod;
}
/**
 * Returns a function that produces a monotonously increasing sequence of indices.
 *
 * If the sequence has an end, the returned function will return `null` after
 * the last index in the sequence.
 *
 * @param parsed A tuple [a, b], as returned by `parse`.
 * @returns A function that produces a sequence of indices.
 * @example <caption>Always increasing (2n+3)</caption>
 *
 * ```js
 * const gen = nthCheck.generate([2, 3])
 *
 * gen() // `1`
 * gen() // `3`
 * gen() // `5`
 * gen() // `8`
 * gen() // `11`
 * ```
 *
 * @example <caption>With end value (-2n+10)</caption>
 *
 * ```js
 *
 * const gen = nthCheck.generate([-2, 5]);
 *
 * gen() // 0
 * gen() // 2
 * gen() // 4
 * gen() // null
 * ```
 */
export function generate(parsed) {
    const a = parsed[0];
    // Subtract 1 from `b`, to convert from one- to zero-indexed.
    let b = parsed[1] - 1;
    let n = 0;
    // Make sure to always return an increasing sequence
    if (a < 0) {
        const aPos = -a;
        // Get `b mod a`
        const minValue = ((b % aPos) + aPos) % aPos;
        return () => {
            const val = minValue + aPos * n++;
            return val > b ? null : val;
        };
    }
    if (a === 0)
        return b < 0
            ? // There are no result — always return `null`
                () => null
            : // Return `b` exactly once
                () => (n++ === 0 ? b : null);
    if (b < 0) {
        b += a * Math.ceil(-b / a);
    }
    return () => a * n++ + b;
}
//# sourceMappingURL=compile.js.mapz#@x5AAAA,OAAO,QAAQ,MAAM,UAAU,CAA%"MAAM,UAAU,OAAO,CACnB,MAA8B;IAE9B,MM"8MMxQI'CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC<*'CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,CAACUQACAAC,KAAK,EAAE,EAAE,CAAC,KAAK,IAAI,CAAC,CAAC;IAEtE;;;;OAIG;IACH,MLDMsCAAC,KAAK,EAAE,EAAE,CAAC-);QAChD,CAAC,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC.CAAC;AACzD,CAAC;AAED	MAAM,UAAUMM"8MMAAM,Q(4QAC5C,OAAO,GAAG,EAAE;YACR,MAAM,GAAG,GAAG,QAAQ,GAAG,IwGAAG,EAAE,CAAC,IO!GAAG,EAAE,CAACyG	GAAG,EAAE!,EAAE,GAAG,CAAC,CAAC;AAC7B,CAAC"}gxsimport { parse } from "./parse.js";
import { compile, generate } from "./compile.js";
export { parse, compile, generate };
/**
 * Parses and compiles a formula to a highly optimized function.
 * Combination of {@link parse} and {@link compile}.
 *
 * If the formula doesn't match any elements,
 * it returns [`boolbase`](https://github.com/fb55/boolbase)'s `falseFunc`.
 * Otherwise, a function accepting an _index_ is returned, which returns
 * whether or not the passed _index_ matches the formula.
 *
 * Note: The nth-rule starts counting at `1`, the returned function at `0`.
 *
 * @param formula The formula to compile.
 * @example
 * const check = nthCheck("2n+3");
 *
 * check(0); // `false`
 * check(1); // `false`
 * check(2); // `true`
 * check(3); // `false`
 * check(4); // `true`
 * check(5); // `false`
 * check(6); // `true`
 */
export default function nthCheck(formula: string): (index: number) => boolean;
/**
 * Parses and compiles a formula to a generator that produces a sequence of indices.
 * Combination of {@link parse} and {@link generate}.
 *
 * @param formula The formula to compile.
 * @returns A function that produces a sequence of indices.
 * @example <caption>Always increasing</caption>
 *
 * ```js
 * const gen = nthCheck.sequence('2n+3')
 *
 * gen() // `1`
 * gen() // `3`
 * gen() // `5`
 * gen() // `8`
 * gen() // `11`
 * ```
 *
 * @example <caption>With end value</caption>
 *
 * ```js
 *
 * const gen = nthCheck.sequence('-2n+5');
 *
 * gen() // 0
 * gen() // 2
 * gen() // 4
 * gen() // null
 * ```
 */
export declare function sequence(formula: string): () => number | null;
//# sourceMappingURL=index.d.ts.mapSJ#x3{"version":3,"file":"index.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/nth-check/639fd2a4000b69f82350aad8c34cb43f77e483ba/src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,KAAK,EAAE,MAAM,KAAK,OAAO,CAE5E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,MAAM,GAAG,IAAI,CAE7D"},?gxwimport { parse } from "./parse.js";
import { compile, generate } from "./compile.js";
export { parse, compile, generate };
/**
 * Parses and compiles a formula to a highly optimized function.
 * Combination of {@link parse} and {@link compile}.
 *
 * If the formula doesn't match any elements,
 * it returns [`boolbase`](https://github.com/fb55/boolbase)'s `falseFunc`.
 * Otherwise, a function accepting an _index_ is returned, which returns
 * whether or not the passed _index_ matches the formula.
 *
 * Note: The nth-rule starts counting at `1`, the returned function at `0`.
 *
 * @param formula The formula to compile.
 * @example
 * const check = nthCheck("2n+3");
 *
 * check(0); // `false`
 * check(1); // `false`
 * check(2); // `true`
 * check(3); // `false`
 * check(4); // `true`
 * check(5); // `false`
 * check(6); // `true`
 */
export default function nthCheck(formula) {
    return compile(parse(formula));
}
/**
 * Parses and compiles a formula to a generator that produces a sequence of indices.
 * Combination of {@link parse} and {@link generate}.
 *
 * @param formula The formula to compile.
 * @returns A function that produces a sequence of indices.
 * @example <caption>Always increasing</caption>
 *
 * ```js
 * const gen = nthCheck.sequence('2n+3')
 *
 * gen() // `1`
 * gen() // `3`
 * gen() // `5`
 * gen() // `8`
 * gen() // `11`
 * ```
 *
 * @example <caption>With end value</caption>
 *
 * ```js
 *
 * const gen = nthCheck.sequence('-2n+5');
 *
 * gen() // 0
 * gen() // 2
 * gen() // 4
 * gen() // null
 * ```
 */
export function sequence(formula) {
    return generate(parse(formula));
}
//# sourceMappingURL=index.js.map|%xT{"version":3,"file":"index.js","sourceRoot":"https://raw.githubusercontent.com/fb55/nth-check/639fd2a4000b69f82350aad8c34cb43f77e483ba/src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAC;AACnC,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAEjD,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC;AAEpC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,OAAO,UAAU,QAAQ,CAAC,OAAe;IAC5C,OAAO,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACnC,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,MAAM,UAAU,QAAQ,CAAC,OAAe;IACpC,OAAO,QAAQ,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AACpC,CAAC"}sײx {"type":"module"}
;xK/**
 * Parses an expression.
 *
 * @throws An `Error` if parsing fails.
 * @returns An array containing the integer step size and the integer offset of the nth rule.
 * @example nthCheck.parse("2n+3"); // returns [2, 3]
 */
export declare function parse(formula: string): [a: number, b: number];
//# sourceMappingURL=parse.d.ts.map3ox+{"version":3,"file":"parse.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/nth-check/639fd2a4000b69f82350aad8c34cb43f77e483ba/src/","sources":["parse.ts"],"names":[],"mappings":"AAOA;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,OAAO,EAAE,MAAM,GAAG,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,CAAC,CA6E7D"}Yx@// Following http://www.w3.org/TR/css3-selectors/#nth-child-pseudo
// Whitespace as per https://www.w3.org/TR/selectors-3/#lex is " \t\r\n\f"
const whitespace = new Set([9, 10, 12, 13, 32]);
const ZERO = "0".charCodeAt(0);
const NINE = "9".charCodeAt(0);
/**
 * Parses an expression.
 *
 * @throws An `Error` if parsing fails.
 * @returns An array containing the integer step size and the integer offset of the nth rule.
 * @example nthCheck.parse("2n+3"); // returns [2, 3]
 */
export function parse(formula) {
    formula = formula.trim().toLowerCase();
    if (formula === "even") {
        return [2, 0];
    }
    else if (formula === "odd") {
        return [2, 1];
    }
    // Parse [ ['-'|'+']? INTEGER? {N} [ S* ['-'|'+'] S* INTEGER ]?
    let idx = 0;
    let a = 0;
    let sign = readSign();
    let number = readNumber();
    if (idx < formula.length && formula.charAt(idx) === "n") {
        idx++;
        a = sign * (number !== null && number !== void 0 ? number : 1);
        skipWhitespace();
        if (idx < formula.length) {
            sign = readSign();
            skipWhitespace();
            number = readNumber();
        }
        else {
            sign = number = 0;
        }
    }
    // Throw if there is anything else
    if (number === null || idx < formula.length) {
        throw new Error(`n-th rule couldn't be parsed ('${formula}')`);
    }
    return [a, sign * number];
    function readSign() {
        if (formula.charAt(idx) === "-") {
            idx++;
            return -1;
        }
        if (formula.charAt(idx) === "+") {
            idx++;
        }
        return 1;
    }
    function readNumber() {
        const start = idx;
        let value = 0;
        while (idx < formula.length &&
            formula.charCodeAt(idx) >= ZERO &&
            formula.charCodeAt(idx) <= NINE) {
            value = value * 10 + (formula.charCodeAt(idx) - ZERO);
            idx++;
        }
        // Return `null` if we didn't read anything.
        return idx === start ? null : value;
    }
    function skipWhitespace() {
        while (idx < formula.length &&
            whitespace.has(formula.charCodeAt(idx))) {
            idx++;
        }
    }
}
//# sourceMappingURL=parse.js.mapxx_{"version":3,"file":"parse.js","sourceRoot":"https://raw.githubusercontent.com/fb55/nth-check/639fd2a4000b69f82350aad8c34cb43f77e483ba/src/","sources":["parse.ts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,kCAAkC;IAClC,IAAI,MAAM,KAAK,IAAI,IAAI,GAAG,GAAG,OAAO,CAAC,MAAM,EAAE;QACzC,MAAM,IAAI,KAAK,CAAC,kCAAkC,OAAO,IAAI,CAAC,CAAC;KAClE;IAED,OAAO,CAAC,CAAC,EAAE,IAAI,GAAG,MAAM,CAAC,CAAC;IAE1B,SAAS,QAAQ;QACb,IAAI,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE;YAC7B,GAAG,EAAE,CAAC;YACN,OAAO,CAAC,CAAC,CAAC;SACb;QAED,IAAI,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,KAAK,GAAG,EAAE;YAC7B,GAAG,EAAE,CAAC;SACT;QAED,OAAO,CAAC,CAAC;IACb,CAAC;IAED,SAAS,UAAU;QACf,MAAM,KAAK,GAAG,GAAG,CAAC;QAClB,IAAI,KAAK,GAAG,CAAC,CAAC;QAEd,OACI,GAAG,GAAG,OAAO,CAAC,MAAM;YACpB,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI;YAC/B,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,IAAI,EACjC;YACE,KAAK,GAAG,KAAK,GAAG,EAAE,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,CAAC;YACtD,GAAG,EAAE,CAAC;SACT;QAED,4CAA4C;QAC5C,OAAO,GAAG,KAAK,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IACxC,CAAC;IAED,SAAS,cAAc;QACnB,OACI,GAAG,GAAG,OAAO,CAAC,MAAM;YACpB,UAAU,CAAC,GAAG,CAAC,OAAO,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,EACzC;YACE,GAAG,EAAE,CAAC;SACT;IACL,CAAC;AACL,CAAC"};>>漊xS"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.sequence = exports.generate = exports.compile = exports.parse = void 0;
var parse_js_1 = require("./parse.js");
Object.defineProperty(exports, "parse", { enumerable: true, get: function () { return parse_js_1.parse; } });
var compile_js_1 = require("./compile.js");
Object.defineProperty(exports, "compile", { enumerable: true, get: function () { return compile_js_1.compile; } });
Object.defineProperty(exports, "generate", { enumerable: true, get: function () { return compile_js_1.generate; } });
/**
 * Parses and compiles a formula to a highly optimized function.
 * Combination of {@link parse} and {@link compile}.
 *
 * If the formula doesn't match any elements,
 * it returns [`boolbase`](https://github.com/fb55/boolbase)'s `falseFunc`.
 * Otherwise, a function accepting an _index_ is returned, which returns
 * whether or not the passed _index_ matches the formula.
 *
 * Note: The nth-rule starts counting at `1`, the returned function at `0`.
 *
 * @param formula The formula to compile.
 * @example
 * const check = nthCheck("2n+3");
 *
 * check(0); // `false`
 * check(1); // `false`
 * check(2); // `true`
 * check(3); // `false`
 * check(4); // `true`
 * check(5); // `false`
 * check(6); // `true`
 */
function nthCheck(formula) {
    return (0, compile_js_1.compile)((0, parse_js_1.parse)(formula));
}
exports.default = nthCheck;
/**
 * Parses and compiles a formula to a generator that produces a sequence of indices.
 * Combination of {@link parse} and {@link generate}.
 *
 * @param formula The formula to compile.
 * @returns A function that produces a sequence of indices.
 * @example <caption>Always increasing</caption>
 *
 * ```js
 * const gen = nthCheck.sequence('2n+3')
 *
 * gen() // `1`
 * gen() // `3`
 * gen() // `5`
 * gen() // `8`
 * gen() // `11`
 * ```
 *
 * @example <caption>With end value</caption>
 *
 * ```js
 *
 * const gen = nthCheck.sequence('-2n+5');
 *
 * gen() // 0
 * gen() // 2
 * gen() // 4
 * gen() // null
 * ```
 */
function sequence(formula) {
    return (0, compile_js_1.generate)((0, parse_js_1.parse)(formula));
}
exports.sequence = sequence;
//# sourceMappingURL=index.js.map)Mر$xA{"version":3,"file":"index.js","sourceRoot":"https://raw.githubusercontent.com/fb55/nth-check/639fd2a4000b69f82350aad8c34cb43f77e483ba/src/","sources":["index.ts"],"names":[],"mappings":";;;AAAA,uCAAmC;AAG1B,sFAHA,gBAAK,OAGA;AAFd,2CAAiD;AAEjC,wFAFP,oBAAO,OAEO;AAAE,yFAFP,qBAAQ,OAEO;AAEjC;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,SAAwB,QAAQ,CAAC,OAAe;IAC5C,OAAO,IAAA,oBAAO,EAAC,IAAA,gBAAK,EAAC,OAAO,CAAC,CAAC,CAAC;AACnC,CAAC;AAFD,2BAEC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,SAAgB,QAAQ,CAAC,OAAe;IACpC,OAAO,IAAA,qBAAQ,EAAC,IAAA,gBAAK,EAAC,OAAO,CAAC,CAAC,CAAC;AACpC,CAAC;AAFD,4BAEC"}1x6	"use strict";
// Following http://www.w3.org/TR/css3-selectors/#nth-child-pseudo
Object.defineProperty(exports, "__esModule", { value: true });
exports.parse = void 0;
// Whitespace as per https://www.w3.org/TR/selectors-3/#lex is " \t\r\n\f"
var whitespace = new Set([9, 10, 12, 13, 32]);
var ZERO = "0".charCodeAt(0);
var NINE = "9".charCodeAt(0);
/**
 * Parses an expression.
 *
 * @throws An `Error` if parsing fails.
 * @returns An array containing the integer step size and the integer offset of the nth rule.
 * @example nthCheck.parse("2n+3"); // returns [2, 3]
 */
function parse(formula) {
    formula = formula.trim().toLowerCase();
    if (formula === "even") {
        return [2, 0];
    }
    else if (formula === "odd") {
        return [2, 1];
    }
    // Parse [ ['-'|'+']? INTEGER? {N} [ S* ['-'|'+'] S* INTEGER ]?
    var idx = 0;
    var a = 0;
    var sign = readSign();
    var number = readNumber();
    if (idx < formula.length && formula.charAt(idx) === "n") {
        idx++;
        a = sign * (number !== null && number !== void 0 ? number : 1);
        skipWhitespace();
        if (idx < formula.length) {
            sign = readSign();
            skipWhitespace();
            number = readNumber();
        }
        else {
            sign = number = 0;
        }
    }
    // Throw if there is anything else
    if (number === null || idx < formula.length) {
        throw new Error("n-th rule couldn't be parsed ('".concat(formula, "')"));
    }
    return [a, sign * number];
    function readSign() {
        if (formula.charAt(idx) === "-") {
            idx++;
            return -1;
        }
        if (formula.charAt(idx) === "+") {
            idx++;
        }
        return 1;
    }
    function readNumber() {
        var start = idx;
        var value = 0;
        while (idx < formula.length &&
            formula.charCodeAt(idx) >= ZERO &&
            formula.charCodeAt(idx) <= NINE) {
            value = value * 10 + (formula.charCodeAt(idx) - ZERO);
            idx++;
        }
        // Return `null` if we didn't read anything.
        return idx === start ? null : value;
    }
    function skipWhitespace() {
        while (idx < formula.length &&
            whitespace.has(formula.charCodeAt(idx))) {
            idx++;
        }
    }
}
exports.parse = parse;
//# sourceMappingURL=parse.js.mapq蟞zxr #;AAAA,kEAAkE;;;AAElE,0EAA0E;AAC1E,IdI@7I@3SAAgBVyCAAkC,OAAO,O*CIn0;AA7ED,sBA6EC"}bx	h{
    "name": "nth-check",
    "version": "2.1.1",
    "description": "Parses and compiles CSS nth-checks to highly optimized functions.",
    "author": "Felix Boehm <me@feedic.com>",
    "license": "BSD-2-Clause",
    "sideEffects": false,
    "funding": {
        "url": "https://github.com/fb55/nth-check?sponsor=1"
    },
    "directories": {
        "lib": "lib/"
    },
    "main": "lib/index.js",
    "types": "lib/index.d.ts",
    "module": "lib/esm/index.js",
    "exports": {
        "require": "./lib/index.js",
        "import": "./lib/esm/index.js"
    },
    "files": [
        "lib/**/*"
    ],
    "scripts": {
        "test": "npm run test:jest && npm run lint",
        "test:jest": "jest",
        "lint": "npm run lint:es && npm run lint:prettier",
        "lint:es": "eslint .",
        "lint:prettier": "npm run prettier -- --check",
        "format": "npm run format:es && npm run format:prettier",
        "format:es": "npm run lint:es -- --fix",
        "format:prettier": "npm run prettier -- --write",
        "prettier": "prettier '**/*.{ts,md,json,yml}'",
        "build": "npm run build:cjs && npm run build:esm",
        "build:cjs": "tsc --sourceRoot https://raw.githubusercontent.com/fb55/nth-check/$(git rev-parse HEAD)/src/",
        "build:esm": "npm run build:cjs -- --module esnext --target es2019 --outDir lib/esm && echo '{\"type\":\"module\"}' > lib/esm/package.json",
        "prepare": "npm run build"
    },
    "repository": {
        "type": "git",
        "url": "https://github.com/fb55/nth-check"
    },
    "keywords": [
        "nth-child",
        "nth",
        "css"
    ],
    "bugs": {
        "url": "https://github.com/fb55/nth-check/issues"
    },
    "homepage": "https://github.com/fb55/nth-check",
    "dependencies": {
        "boolbase": "^1.0.0"
    },
    "devDependencies": {
        "@types/boolbase": "^1.0.1",
        "@types/jest": "^27.5.0",
        "@types/node": "^17.0.35",
        "@typescript-eslint/eslint-plugin": "^5.25.0",
        "@typescript-eslint/parser": "^5.25.0",
        "eslint": "^8.15.0",
        "eslint-config-prettier": "^8.5.0",
        "jest": "^27.5.1",
        "prettier": "^2.6.2",
        "ts-jest": "^27.1.4",
        "typescript": "^4.6.4"
    },
    "jest": {
        "preset": "ts-jest",
        "testEnvironment": "node",
        "moduleNameMapper": {
            "^(.*)\\.js$": "$1"
        }
    },
    "prettier": {
        "tabWidth": 4
    }
}
?ئx I100644 CHANGELOG.md )(,UQ	8%ӹzm100644 LICENSE R[o,;MS'
100644 README.md лC⻫bߙ7C>40000 lib 6FH[StvtDj100644 package.json rn]QbUB|x4# 0.9.0
- update dependencies, in particular `levn` and `type-check` - this could affect behaviour of argument parsing

# 0.8.3
- changes dependency from `wordwrap` to `word-wrap` due to license issue
- update dependencies

# 0.8.2
- fix bug #18 - detect missing value when flag is last item
- update dependencies

# 0.8.1
- update `fast-levenshtein` dependency

# 0.8.0
- update `levn` dependency - supplying a float value to an option with type `Int` now throws an error, instead of silently converting to an `Int`

# 0.7.1
- fix bug with use of `defaults` and `concatRepeatedArrays` or `mergeRepeatedObjects`

# 0.7.0
- added `concatrepeatedarrays` option: `oneValuePerFlag`, only allows one array value per flag
- added `typeAliases` option
- added `parseArgv` which takes an array and parses with the first two items sliced off
- changed enum help style
- bug fixes (#12)
- use of `concatRepeatedArrays` and `mergeRepeatedObjects` at the top level is deprecated, use it as either a per-option option, or set them in the `defaults` object to set them for all objects

# 0.6.0
- added `defaults` lib-option flag, allowing one to set default properties for all options
- added `concatRepeatedArrays` and `mergeRepeatedObjects` as option level properties, allowing you to turn this feature on for specific options only

# 0.5.0
- `Boolean` flags with `default: 'true'`, and no short aliases, will by default show the `--no` version in help

# 0.4.0
- add `mergeRepeatedObjects` setting

# 0.3.0
- add `concatRepeatedArrays` setting
- add `overrideRequired` option setting
- use just Levenshtein string compare algo rather than Levenshtein Damerau to due dependency license issue

# 0.2.2
- bug fixes

# 0.2.1
- improved interpolation
- added changelog

# 0.2.0
- add dependency checks to options - added `dependsOn` as an option property
- add interpolation for `prepend` and `append` text with new `generateHelp` option, `interpolate`

# 0.1.1
- update dependencies

# 0.1.0
- initial release
ǲ\x:8# Optionator
<a name="optionator" />

Optionator is a JavaScript/Node.js option parsing and help generation library used by [eslint](http://eslint.org), [Grasp](http://graspjs.com), [LiveScript](http://livescript.net), [esmangle](https://github.com/estools/esmangle), [escodegen](https://github.com/estools/escodegen), and [many more](https://www.npmjs.com/browse/depended/optionator).

For an online demo, check out the [Grasp online demo](http://www.graspjs.com/#demo).

[About](#about) &middot; [Usage](#usage) &middot; [Settings Format](#settings-format) &middot; [Argument Format](#argument-format)

## Why?
The  problem with other option parsers, such as `yargs` or `minimist`, is they just accept all input, valid or not.
With Optionator, if you mistype an option, it will give you an error (with a suggestion for what you meant).
If you give the wrong type of argument for an option, it will give you an error rather than supplying the wrong input to your application.

    $ cmd --halp
    Invalid option '--halp' - perhaps you meant '--help'?

    $ cmd --count str
    Invalid value for option 'count' - expected type Int, received value: str.

Other helpful features include reformatting the help text based on the size of the console, so that it fits even if the console is narrow, and accepting not just an array (eg. process.argv), but a string or object as well, making things like testing much easier.

## About
Optionator uses [type-check](https://github.com/gkz/type-check) and [levn](https://github.com/gkz/levn) behind the scenes to cast and verify input according the specified types.

MIT license. Version 0.9.4

    npm install optionator

For updates on Optionator, [follow me on twitter](https://twitter.com/gkzahariev).

Optionator is a Node.js module, but can be used in the browser as well if packed with webpack/browserify.

## Usage
`require('optionator');` returns a function. It has one property, `VERSION`, the current version of the library as a string. This function is called with an object specifying your options and other information, see the [settings format section](#settings-format). This in turn returns an object with three properties, `parse`, `parseArgv`, `generateHelp`, and `generateHelpForOption`, which are all functions.

```js
var optionator = require('optionator')({
    prepend: 'Usage: cmd [options]',
    append: 'Version 1.0.0',
    options: [{
        option: 'help',
        alias: 'h',
        type: 'Boolean',
        description: 'displays help'
    }, {
        option: 'count',
        alias: 'c',
        type: 'Int',
        description: 'number of things',
        example: 'cmd --count 2'
    }]
});

var options = optionator.parseArgv(process.argv);
if (options.help) {
    console.log(optionator.generateHelp());
}
...
```

### parse(input, parseOptions)
`parse` processes the `input` according to your settings, and returns an object with the results.

##### arguments
* input - `[String] | Object | String` - the input you wish to parse
* parseOptions - `{slice: Int}` - all options optional
    - `slice` specifies how much to slice away from the beginning if the input is an array or string - by default `0` for string, `2` for array (works with `process.argv`)

##### returns
`Object` - the parsed options, each key is a camelCase version of the option name (specified in dash-case), and each value is the processed value for that option. Positional values are in an array under the `_` key.

##### example
```js
parse(['node', 't.js', '--count', '2', 'positional']); // {count: 2, _: ['positional']}
parse('--count 2 positional');                         // {count: 2, _: ['positional']}
parse({count: 2, _:['positional']});                   // {count: 2, _: ['positional']}
```

### parseArgv(input)
`parseArgv` works exactly like `parse`, but only for array input and it slices off the first two elements.

##### arguments
* input - `[String]` - the input you wish to parse

##### returns
See "returns" section in "parse"

##### example
```js
parseArgv(process.argv);
```

### generateHelp(helpOptions)
`generateHelp` produces help text based on your settings.

##### arguments
* helpOptions - `{showHidden: Boolean, interpolate: Object}` - all options optional
    - `showHidden` specifies whether to show options with `hidden: true` specified, by default it is `false`
    - `interpolate` specify data to be interpolated in `prepend` and `append` text, `{{key}}` is the format - eg. `generateHelp({interpolate:{version: '0.4.2'}})`, will change this `append` text: `Version {{version}}` to `Version 0.4.2`

##### returns
`String` - the generated help text

##### example
```js
generateHelp(); /*
"Usage: cmd [options] positional

  -h, --help       displays help
  -c, --count Int  number of things

Version  1.0.0
"*/
```

### generateHelpForOption(optionName)
`generateHelpForOption` produces expanded help text for the specified with `optionName` option. If an `example` was specified for the option, it will be displayed,  and if a `longDescription` was specified, it will display that instead of the `description`.

##### arguments
* optionName - `String` - the name of the option to display

##### returns
`String` - the generated help text for the option

##### example
```js
generateHelpForOption('count'); /*
"-c, --count Int
description: number of things
example: cmd --count 2
"*/
```

## Settings Format
When your `require('optionator')`, you get a function that takes in a settings object. This object has the type:

    {
      prepend: String,
      append: String,
      options: [{heading: String} | {
        option: String,
        alias: [String] | String,
        type: String,
        enum: [String],
        default: String,
        restPositional: Boolean,
        required: Boolean,
        overrideRequired: Boolean,
        dependsOn: [String] | String,
        concatRepeatedArrays: Boolean | (Boolean, Object),
        mergeRepeatedObjects: Boolean,
        description: String,
        longDescription: String,
        example: [String] | String
      }],
      helpStyle: {
        aliasSeparator: String,
        typeSeparator: String,
        descriptionSeparator: String,
        initialIndent: Int,
        secondaryIndent: Int,
        maxPadFactor: Number
      },
      mutuallyExclusive: [[String | [String]]],
      concatRepeatedArrays: Boolean | (Boolean, Object), // deprecated, set in defaults object
      mergeRepeatedObjects: Boolean, // deprecated, set in defaults object
      positionalAnywhere: Boolean,
      typeAliases: Object,
      defaults: Object
    }

All of the properties are optional (the `Maybe` has been excluded for brevities sake), except for having either `heading: String` or `option: String` in each object in the `options` array.

### Top Level Properties
* `prepend` is an optional string to be placed before the options in the help text
* `append` is an optional string to be placed after the options in the help text
* `options` is a required array specifying your options and headings, the options and headings will be displayed in the order specified
* `helpStyle` is an optional object which enables you to change the default appearance of some aspects of the help text
* `mutuallyExclusive` is an optional array of arrays of either strings or arrays of strings. The top level array is a list of rules, each rule is a list of elements - each element can be either a string (the name of an option), or a list of strings (a group of option names) - there will be an error if more than one element is present
* `concatRepeatedArrays` see description under the "Option Properties" heading - use at the top level is deprecated, if you want to set this for all options, use the `defaults` property
* `mergeRepeatedObjects` see description under the "Option Properties" heading - use at the top level is deprecated, if you want to set this for all options, use the `defaults` property
* `positionalAnywhere` is an optional boolean (defaults to `true`) - when `true` it allows positional arguments anywhere, when `false`, all arguments after the first positional one are taken to be positional as well, even if they look like a flag. For example, with `positionalAnywhere: false`, the arguments `--flag --boom 12 --crack` would have two positional arguments: `12` and `--crack`
* `typeAliases` is an optional object, it allows you to set aliases for types, eg. `{Path: 'String'}` would allow you to use the type `Path` as an alias for the type `String`
* `defaults` is an optional object following the option properties format, which specifies default values for all options. A default will be overridden if manually set. For example, you can do `default: { type: "String" }` to set the default type of all options to `String`, and then override that default in an individual option by setting the `type` property

#### Heading Properties
* `heading` a required string, the name of the heading

#### Option Properties
* `option` the required name of the option - use dash-case, without the leading dashes
* `alias` is an optional string or array of strings which specify any aliases for the option
* `type` is a required string in the [type check](https://github.com/gkz/type-check) [format](https://github.com/gkz/type-check#type-format), this will be used to cast the inputted value and validate it
* `enum` is an optional array of strings, each string will be parsed by [levn](https://github.com/gkz/levn) - the argument value must be one of the resulting values - each potential value must validate against the specified `type`
* `default` is a optional string, which will be parsed by [levn](https://github.com/gkz/levn) and used as the default value if none is set - the value must validate against the specified `type`
* `restPositional` is an optional boolean - if set to `true`, everything after the option will be taken to be a positional argument, even if it looks like a named argument
* `required` is an optional boolean - if set to `true`, the option parsing will fail if the option is not defined
* `overrideRequired` is a optional boolean - if set to `true` and the option is used, and there is another option which is required but not set, it will override the need for the required option and there will be no error - this is useful if you have required options and want to use `--help` or `--version` flags
* `concatRepeatedArrays` is an optional boolean or tuple with boolean and options object (defaults to `false`) - when set to `true` and an option contains an array value and is repeated, the subsequent values for the flag will be appended rather than overwriting the original value - eg. option `g` of type `[String]`: `-g a -g b -g c,d` will result in `['a','b','c','d']`

 You can supply an options object by giving the following value: `[true, options]`. The one currently supported option is `oneValuePerFlag`, this only allows one array value per flag. This is useful if your potential values contain a comma.
* `mergeRepeatedObjects` is an optional boolean (defaults to `false`) - when set to `true` and an option contains an object value and is repeated, the subsequent values for the flag will be merged rather than overwriting the original value - eg. option `g` of type `Object`: `-g a:1 -g b:2 -g c:3,d:4` will result in `{a: 1, b: 2, c: 3, d: 4}`
* `dependsOn` is an optional string or array of strings - if simply a string (the name of another option), it will make sure that that other option is set, if an array of strings, depending on whether `'and'` or `'or'` is first, it will either check whether all (`['and', 'option-a', 'option-b']`), or at least one (`['or', 'option-a', 'option-b']`) other options are set
* `description` is an optional string, which will be displayed next to the option in the help text
* `longDescription` is an optional string, it will be displayed instead of the `description` when `generateHelpForOption` is used
* `example` is an optional string or array of strings with example(s) for the option - these will be displayed when `generateHelpForOption` is used

#### Help Style Properties
* `aliasSeparator` is an optional string, separates multiple names from each other - default: ' ,'
* `typeSeparator` is an optional string, separates the type from the names - default: ' '
* `descriptionSeparator` is an optional string , separates the description from the padded name and type - default: '  '
* `initialIndent` is an optional int - the amount of indent for options - default: 2
* `secondaryIndent` is an optional int - the amount of indent if wrapped fully (in addition to the initial indent) - default: 4
* `maxPadFactor` is an optional number - affects the default level of padding for the names/type, it is multiplied by the average of the length of the names/type - default: 1.5

## Argument Format
At the highest level there are two types of arguments: named, and positional.

Name arguments of any length are prefixed with `--` (eg. `--go`), and those of one character may be prefixed with either `--` or `-` (eg. `-g`).

There are two types of named arguments: boolean flags (eg. `--problemo`, `-p`) which take no value and result in a `true` if they are present, the falsey `undefined` if they are not present, or `false` if present and explicitly prefixed with `no` (eg. `--no-problemo`). Named arguments with values (eg. `--tseries 800`, `-t 800`) are the other type. If the option has a type `Boolean` it will automatically be made into a boolean flag. Any other type results in a named argument that takes a value.

For more information about how to properly set types to get the value you want, take a look at the [type check](https://github.com/gkz/type-check) and [levn](https://github.com/gkz/levn) pages.

You can group single character arguments that use a single `-`, however all except the last must be boolean flags (which take no value). The last may be a boolean flag, or an argument which takes a value - eg. `-ba 2` is equivalent to `-b -a 2`.

Positional arguments are all those values which do not fall under the above - they can be anywhere, not just at the end. For example, in `cmd -b one -a 2 two` where `b` is a boolean flag, and `a` has the type `Number`, there are two positional arguments, `one` and `two`.

Everything after an `--` is positional, even if it looks like a named argument.

You may optionally use `=` to separate option names from values, for example: `--count=2`.

If you specify the option `NUM`, then any argument using a single `-` followed by a number will be valid and will set the value of `NUM`. Eg. `-2` will be parsed into `NUM: 2`.

If duplicate named arguments are present, the last one will be taken.

## Technical About
`optionator` is written in [LiveScript](http://livescript.net/) - a language that compiles to JavaScript. It uses [levn](https://github.com/gkz/levn) to cast arguments to their specified type, and uses [type-check](https://github.com/gkz/type-check) to validate values. It also uses the [prelude.ls](http://preludels.com/) library.
Rxj 100644 help.js YiLzٝBy
V:100644 index.js Ck|)ɗ)F/}WfV.100644 util.js [˶fb XIU{,Px+w// Generated by LiveScript 1.6.0
(function(){
  var ref$, id, find, sort, min, max, map, unlines, nameToRaw, dasherize, naturalJoin, wordWrap, wordwrap, getPreText, setHelpStyleDefaults, generateHelpForOption, generateHelp;
  ref$ = require('prelude-ls'), id = ref$.id, find = ref$.find, sort = ref$.sort, min = ref$.min, max = ref$.max, map = ref$.map, unlines = ref$.unlines;
  ref$ = require('./util'), nameToRaw = ref$.nameToRaw, dasherize = ref$.dasherize, naturalJoin = ref$.naturalJoin;
  wordWrap = require('word-wrap');
  wordwrap = function(a, b){
    var ref$, indent, width;
    ref$ = b === undefined
      ? ['', a - 1]
      : [repeatString$(' ', a), b - a - 1], indent = ref$[0], width = ref$[1];
    return function(text){
      return wordWrap(text, {
        indent: indent,
        width: width,
        trim: true
      });
    };
  };
  getPreText = function(option, arg$, maxWidth){
    var mainName, shortNames, ref$, longNames, type, description, aliasSeparator, typeSeparator, initialIndent, names, namesString, namesStringLen, typeSeparatorString, typeSeparatorStringLen, wrap;
    mainName = option.option, shortNames = (ref$ = option.shortNames) != null
      ? ref$
      : [], longNames = (ref$ = option.longNames) != null
      ? ref$
      : [], type = option.type, description = option.description;
    aliasSeparator = arg$.aliasSeparator, typeSeparator = arg$.typeSeparator, initialIndent = arg$.initialIndent;
    if (option.negateName) {
      mainName = "no-" + mainName;
      if (longNames) {
        longNames = map(function(it){
          return "no-" + it;
        }, longNames);
      }
    }
    names = mainName.length === 1
      ? [mainName].concat(shortNames, longNames)
      : shortNames.concat([mainName], longNames);
    namesString = map(nameToRaw, names).join(aliasSeparator);
    namesStringLen = namesString.length;
    typeSeparatorString = mainName === 'NUM' ? '::' : typeSeparator;
    typeSeparatorStringLen = typeSeparatorString.length;
    if (maxWidth != null && !option.boolean && initialIndent + namesStringLen + typeSeparatorStringLen + type.length > maxWidth) {
      wrap = wordwrap(initialIndent + namesStringLen + typeSeparatorStringLen, maxWidth);
      return namesString + "" + typeSeparatorString + wrap(type).replace(/^\s+/, '');
    } else {
      return namesString + "" + (option.boolean
        ? ''
        : typeSeparatorString + "" + type);
    }
  };
  setHelpStyleDefaults = function(helpStyle){
    helpStyle.aliasSeparator == null && (helpStyle.aliasSeparator = ', ');
    helpStyle.typeSeparator == null && (helpStyle.typeSeparator = ' ');
    helpStyle.descriptionSeparator == null && (helpStyle.descriptionSeparator = '  ');
    helpStyle.initialIndent == null && (helpStyle.initialIndent = 2);
    helpStyle.secondaryIndent == null && (helpStyle.secondaryIndent = 4);
    helpStyle.maxPadFactor == null && (helpStyle.maxPadFactor = 1.5);
  };
  generateHelpForOption = function(getOption, arg$){
    var stdout, helpStyle, ref$;
    stdout = arg$.stdout, helpStyle = (ref$ = arg$.helpStyle) != null
      ? ref$
      : {};
    setHelpStyleDefaults(helpStyle);
    return function(optionName){
      var maxWidth, wrap, option, e, pre, defaultString, restPositionalString, description, fullDescription, that, preDescription, descriptionString, exampleString, examples, seperator;
      maxWidth = stdout != null && stdout.isTTY ? stdout.columns - 1 : null;
      wrap = maxWidth ? wordwrap(maxWidth) : id;
      try {
        option = getOption(dasherize(optionName));
      } catch (e$) {
        e = e$;
        return e.message;
      }
      pre = getPreText(option, helpStyle);
      defaultString = option['default'] && !option.negateName ? "\ndefault: " + option['default'] : '';
      restPositionalString = option.restPositional ? 'Everything after this option is considered a positional argument, even if it looks like an option.' : '';
      description = option.longDescription || option.description && sentencize(option.description);
      fullDescription = description && restPositionalString
        ? description + " " + restPositionalString
        : (that = description || restPositionalString) ? that : '';
      preDescription = 'description:';
      descriptionString = !fullDescription
        ? ''
        : maxWidth && fullDescription.length - 1 - preDescription.length > maxWidth
          ? "\n" + preDescription + "\n" + wrap(fullDescription)
          : "\n" + preDescription + " " + fullDescription;
      exampleString = (that = option.example) ? (examples = [].concat(that), examples.length > 1
        ? "\nexamples:\n" + unlines(examples)
        : "\nexample: " + examples[0]) : '';
      seperator = defaultString || descriptionString || exampleString ? "\n" + repeatString$('=', pre.length) : '';
      return pre + "" + seperator + defaultString + descriptionString + exampleString;
    };
  };
  generateHelp = function(arg$){
    var options, prepend, append, helpStyle, ref$, stdout, aliasSeparator, typeSeparator, descriptionSeparator, maxPadFactor, initialIndent, secondaryIndent;
    options = arg$.options, prepend = arg$.prepend, append = arg$.append, helpStyle = (ref$ = arg$.helpStyle) != null
      ? ref$
      : {}, stdout = arg$.stdout;
    setHelpStyleDefaults(helpStyle);
    aliasSeparator = helpStyle.aliasSeparator, typeSeparator = helpStyle.typeSeparator, descriptionSeparator = helpStyle.descriptionSeparator, maxPadFactor = helpStyle.maxPadFactor, initialIndent = helpStyle.initialIndent, secondaryIndent = helpStyle.secondaryIndent;
    return function(arg$){
      var ref$, showHidden, interpolate, maxWidth, output, out, data, optionCount, totalPreLen, preLens, i$, len$, item, that, pre, descParts, desc, preLen, sortedPreLens, maxPreLen, preLenMean, x, padAmount, descSepLen, fullWrapCount, partialWrapCount, descLen, totalLen, initialSpace, wrapAllFull, i, wrap;
      ref$ = arg$ != null
        ? arg$
        : {}, showHidden = ref$.showHidden, interpolate = ref$.interpolate;
      maxWidth = stdout != null && stdout.isTTY ? stdout.columns - 1 : null;
      output = [];
      out = function(it){
        return output.push(it != null ? it : '');
      };
      if (prepend) {
        out(interpolate ? interp(prepend, interpolate) : prepend);
        out();
      }
      data = [];
      optionCount = 0;
      totalPreLen = 0;
      preLens = [];
      for (i$ = 0, len$ = (ref$ = options).length; i$ < len$; ++i$) {
        item = ref$[i$];
        if (showHidden || !item.hidden) {
          if (that = item.heading) {
            data.push({
              type: 'heading',
              value: that
            });
          } else {
            pre = getPreText(item, helpStyle, maxWidth);
            descParts = [];
            if ((that = item.description) != null) {
              descParts.push(that);
            }
            if (that = item['enum']) {
              descParts.push("either: " + naturalJoin(that));
            }
            if (item['default'] && !item.negateName) {
              descParts.push("default: " + item['default']);
            }
            desc = descParts.join(' - ');
            data.push({
              type: 'option',
              pre: pre,
              desc: desc,
              descLen: desc.length
            });
            preLen = pre.length;
            optionCount++;
            totalPreLen += preLen;
            preLens.push(preLen);
          }
        }
      }
      sortedPreLens = sort(preLens);
      maxPreLen = sortedPreLens[sortedPreLens.length - 1];
      preLenMean = initialIndent + totalPreLen / optionCount;
      x = optionCount > 2 ? min(preLenMean * maxPadFactor, maxPreLen) : maxPreLen;
      for (i$ = sortedPreLens.length - 1; i$ >= 0; --i$) {
        preLen = sortedPreLens[i$];
        if (preLen <= x) {
          padAmount = preLen;
          break;
        }
      }
      descSepLen = descriptionSeparator.length;
      if (maxWidth != null) {
        fullWrapCount = 0;
        partialWrapCount = 0;
        for (i$ = 0, len$ = data.length; i$ < len$; ++i$) {
          item = data[i$];
          if (item.type === 'option') {
            pre = item.pre, desc = item.desc, descLen = item.descLen;
            if (descLen === 0) {
              item.wrap = 'none';
            } else {
              preLen = max(padAmount, pre.length) + initialIndent + descSepLen;
              totalLen = preLen + descLen;
              if (totalLen > maxWidth) {
                if (descLen / 2.5 > maxWidth - preLen) {
                  fullWrapCount++;
                  item.wrap = 'full';
                } else {
                  partialWrapCount++;
                  item.wrap = 'partial';
                }
              } else {
                item.wrap = 'none';
              }
            }
          }
        }
      }
      initialSpace = repeatString$(' ', initialIndent);
      wrapAllFull = optionCount > 1 && fullWrapCount + partialWrapCount * 0.5 > optionCount * 0.5;
      for (i$ = 0, len$ = data.length; i$ < len$; ++i$) {
        i = i$;
        item = data[i$];
        if (item.type === 'heading') {
          if (i !== 0) {
            out();
          }
          out(item.value + ":");
        } else {
          pre = item.pre, desc = item.desc, descLen = item.descLen, wrap = item.wrap;
          if (maxWidth != null) {
            if (wrapAllFull || wrap === 'full') {
              wrap = wordwrap(initialIndent + secondaryIndent, maxWidth);
              out(initialSpace + "" + pre + "\n" + wrap(desc));
              continue;
            } else if (wrap === 'partial') {
              wrap = wordwrap(initialIndent + descSepLen + max(padAmount, pre.length), maxWidth);
              out(initialSpace + "" + pad(pre, padAmount) + descriptionSeparator + wrap(desc).replace(/^\s+/, ''));
              continue;
            }
          }
          if (descLen === 0) {
            out(initialSpace + "" + pre);
          } else {
            out(initialSpace + "" + pad(pre, padAmount) + descriptionSeparator + desc);
          }
        }
      }
      if (append) {
        out();
        out(interpolate ? interp(append, interpolate) : append);
      }
      return unlines(output);
    };
  };
  function pad(str, num){
    var len, padAmount;
    len = str.length;
    padAmount = num - len;
    return str + "" + repeatString$(' ', padAmount > 0 ? padAmount : 0);
  }
  function sentencize(str){
    var first, rest, period;
    first = str.charAt(0).toUpperCase();
    rest = str.slice(1);
    period = /[\.!\?]$/.test(str) ? '' : '.';
    return first + "" + rest + period;
  }
  function interp(string, object){
    return string.replace(/{{([a-zA-Z$_][a-zA-Z$_0-9]*)}}/g, function(arg$, key){
      var ref$;
      return (ref$ = object[key]) != null
        ? ref$
        : "{{" + key + "}}";
    });
  }
  module.exports = {
    generateHelp: generateHelp,
    generateHelpForOption: generateHelpForOption
  };
  function repeatString$(str, n){
    for (var r = ''; n > 0; (n >>= 1) && (str += str)) if (n & 1) r += str;
    return r;
  }
}).call(this);
u1	xbH// Generated by LiveScript 1.6.0
(function(){
  var VERSION, ref$, id, map, compact, any, groupBy, partition, chars, isItNaN, keys, Obj, camelize, deepIs, closestString, nameToRaw, dasherize, naturalJoin, generateHelp, generateHelpForOption, parsedTypeCheck, parseType, parseLevn, camelizeKeys, parseString, main, toString$ = {}.toString, slice$ = [].slice, arrayFrom$ = Array.from || function(x){return slice$.call(x);};
  VERSION = '0.9.4';
  ref$ = require('prelude-ls'), id = ref$.id, map = ref$.map, compact = ref$.compact, any = ref$.any, groupBy = ref$.groupBy, partition = ref$.partition, chars = ref$.chars, isItNaN = ref$.isItNaN, keys = ref$.keys, Obj = ref$.Obj, camelize = ref$.camelize;
  deepIs = require('deep-is');
  ref$ = require('./util'), closestString = ref$.closestString, nameToRaw = ref$.nameToRaw, dasherize = ref$.dasherize, naturalJoin = ref$.naturalJoin;
  ref$ = require('./help'), generateHelp = ref$.generateHelp, generateHelpForOption = ref$.generateHelpForOption;
  ref$ = require('type-check'), parsedTypeCheck = ref$.parsedTypeCheck, parseType = ref$.parseType;
  parseLevn = require('levn').parsedTypeParse;
  camelizeKeys = function(obj){
    var key, value, resultObj$ = {};
    for (key in obj) {
      value = obj[key];
      resultObj$[camelize(key)] = value;
    }
    return resultObj$;
  };
  parseString = function(string){
    var assignOpt, regex, replaceRegex, result;
    assignOpt = '--?[a-zA-Z][-a-z-A-Z0-9]*=';
    regex = RegExp('(?:' + assignOpt + ')?(?:\'(?:\\\\\'|[^\'])+\'|"(?:\\\\"|[^"])+")|[^\'"\\s]+', 'g');
    replaceRegex = RegExp('^(' + assignOpt + ')?[\'"]([\\s\\S]*)[\'"]$');
    result = map(function(it){
      return it.replace(replaceRegex, '$1$2');
    }, string.match(regex) || []);
    return result;
  };
  main = function(libOptions){
    var opts, defaults, required, traverse, getOption, parse;
    opts = {};
    defaults = {};
    required = [];
    if (toString$.call(libOptions.stdout).slice(8, -1) === 'Undefined') {
      libOptions.stdout = process.stdout;
    }
    libOptions.positionalAnywhere == null && (libOptions.positionalAnywhere = true);
    libOptions.typeAliases == null && (libOptions.typeAliases = {});
    libOptions.defaults == null && (libOptions.defaults = {});
    if (libOptions.concatRepeatedArrays != null) {
      libOptions.defaults.concatRepeatedArrays = libOptions.concatRepeatedArrays;
    }
    if (libOptions.mergeRepeatedObjects != null) {
      libOptions.defaults.mergeRepeatedObjects = libOptions.mergeRepeatedObjects;
    }
    traverse = function(options){
      var i$, len$, option, name, k, ref$, v, type, that, e, parsedPossibilities, parsedType, j$, len1$, possibility, rawDependsType, dependsOpts, dependsType, cra, alias, shortNames, longNames;
      if (toString$.call(options).slice(8, -1) !== 'Array') {
        throw new Error('No options defined.');
      }
      for (i$ = 0, len$ = options.length; i$ < len$; ++i$) {
        option = options[i$];
        if (option.heading == null) {
          name = option.option;
          if (opts[name] != null) {
            throw new Error("Option '" + name + "' already defined.");
          }
          for (k in ref$ = libOptions.defaults) {
            v = ref$[k];
            option[k] == null && (option[k] = v);
          }
          if (option.type === 'Boolean') {
            option.boolean == null && (option.boolean = true);
          }
          if (option.parsedType == null) {
            if (!option.type) {
              throw new Error("No type defined for option '" + name + "'.");
            }
            try {
              type = (that = libOptions.typeAliases[option.type]) != null
                ? that
                : option.type;
              option.parsedType = parseType(type);
            } catch (e$) {
              e = e$;
              throw new Error("Option '" + name + "': Error parsing type '" + option.type + "': " + e.message);
            }
          }
          if (option['default']) {
            try {
              defaults[name] = parseLevn(option.parsedType, option['default']);
            } catch (e$) {
              e = e$;
              throw new Error("Option '" + name + "': Error parsing default value '" + option['default'] + "' for type '" + option.type + "': " + e.message);
            }
          }
          if (option['enum'] && !option.parsedPossiblities) {
            parsedPossibilities = [];
            parsedType = option.parsedType;
            for (j$ = 0, len1$ = (ref$ = option['enum']).length; j$ < len1$; ++j$) {
              possibility = ref$[j$];
              try {
                parsedPossibilities.push(parseLevn(parsedType, possibility));
              } catch (e$) {
                e = e$;
                throw new Error("Option '" + name + "': Error parsing enum value '" + possibility + "' for type '" + option.type + "': " + e.message);
              }
            }
            option.parsedPossibilities = parsedPossibilities;
          }
          if (that = option.dependsOn) {
            if (that.length) {
              ref$ = [].concat(option.dependsOn), rawDependsType = ref$[0], dependsOpts = slice$.call(ref$, 1);
              dependsType = rawDependsType.toLowerCase();
              if (dependsOpts.length) {
                if (dependsType === 'and' || dependsType === 'or') {
                  option.dependsOn = [dependsType].concat(arrayFrom$(dependsOpts));
                } else {
                  throw new Error("Option '" + name + "': If you have more than one dependency, you must specify either 'and' or 'or'");
                }
              } else {
                if ((ref$ = dependsType.toLowerCase()) === 'and' || ref$ === 'or') {
                  option.dependsOn = null;
                } else {
                  option.dependsOn = ['and', rawDependsType];
                }
              }
            } else {
              option.dependsOn = null;
            }
          }
          if (option.required) {
            required.push(name);
          }
          opts[name] = option;
          if (option.concatRepeatedArrays != null) {
            cra = option.concatRepeatedArrays;
            if ('Boolean' === toString$.call(cra).slice(8, -1)) {
              option.concatRepeatedArrays = [cra, {}];
            } else if (cra.length === 1) {
              option.concatRepeatedArrays = [cra[0], {}];
            } else if (cra.length !== 2) {
              throw new Error("Invalid setting for concatRepeatedArrays");
            }
          }
          if (option.alias || option.aliases) {
            if (name === 'NUM') {
              throw new Error("-NUM option can't have aliases.");
            }
            if (option.alias) {
              option.aliases == null && (option.aliases = [].concat(option.alias));
            }
            for (j$ = 0, len1$ = (ref$ = option.aliases).length; j$ < len1$; ++j$) {
              alias = ref$[j$];
              if (opts[alias] != null) {
                throw new Error("Option '" + alias + "' already defined.");
              }
              opts[alias] = option;
            }
            ref$ = partition(fn$, option.aliases), shortNames = ref$[0], longNames = ref$[1];
            option.shortNames == null && (option.shortNames = shortNames);
            option.longNames == null && (option.longNames = longNames);
          }
          if ((!option.aliases || option.shortNames.length === 0) && option.type === 'Boolean' && option['default'] === 'true') {
            option.negateName = true;
          }
        }
      }
      function fn$(it){
        return it.length === 1;
      }
    };
    traverse(libOptions.options);
    getOption = function(name){
      var opt, possiblyMeant;
      opt = opts[name];
      if (opt == null) {
        possiblyMeant = closestString(keys(opts), name);
        throw new Error("Invalid option '" + nameToRaw(name) + "'" + (possiblyMeant ? " - perhaps you meant '" + nameToRaw(possiblyMeant) + "'?" : '.'));
      }
      return opt;
    };
    parse = function(input, arg$){
      var slice, obj, positional, restPositional, overrideRequired, prop, setValue, setDefaults, checkRequired, mutuallyExclusiveError, checkMutuallyExclusive, checkDependency, checkDependencies, checkProp, args, key, value, option, ref$, i$, len$, arg, that, result, short, argName, usingAssign, val, flags, len, j$, len1$, i, flag, opt, name, valPrime, negated, noedName;
      slice = (arg$ != null
        ? arg$
        : {}).slice;
      obj = {};
      positional = [];
      restPositional = false;
      overrideRequired = false;
      prop = null;
      setValue = function(name, value){
        var opt, val, cra, e, currentType;
        opt = getOption(name);
        if (opt.boolean) {
          val = value;
        } else {
          try {
            cra = opt.concatRepeatedArrays;
            if (cra != null && cra[0] && cra[1].oneValuePerFlag && opt.parsedType.length === 1 && opt.parsedType[0].structure === 'array') {
              val = [parseLevn(opt.parsedType[0].of, value)];
            } else {
              val = parseLevn(opt.parsedType, value);
            }
          } catch (e$) {
            e = e$;
            throw new Error("Invalid value for option '" + name + "' - expected type " + opt.type + ", received value: " + value + ".");
          }
          if (opt['enum'] && !any(function(it){
            return deepIs(it, val);
          }, opt.parsedPossibilities)) {
            throw new Error("Option " + name + ": '" + val + "' not one of " + naturalJoin(opt['enum']) + ".");
          }
        }
        currentType = toString$.call(obj[name]).slice(8, -1);
        if (obj[name] != null) {
          if (opt.concatRepeatedArrays != null && opt.concatRepeatedArrays[0] && currentType === 'Array') {
            obj[name] = obj[name].concat(val);
          } else if (opt.mergeRepeatedObjects && currentType === 'Object') {
            import$(obj[name], val);
          } else {
            obj[name] = val;
          }
        } else {
          obj[name] = val;
        }
        if (opt.restPositional) {
          restPositional = true;
        }
        if (opt.overrideRequired) {
          overrideRequired = true;
        }
      };
      setDefaults = function(){
        var name, ref$, value;
        for (name in ref$ = defaults) {
          value = ref$[name];
          if (obj[name] == null) {
            obj[name] = value;
          }
        }
      };
      checkRequired = function(){
        var i$, ref$, len$, name;
        if (overrideRequired) {
          return;
        }
        for (i$ = 0, len$ = (ref$ = required).length; i$ < len$; ++i$) {
          name = ref$[i$];
          if (!obj[name]) {
            throw new Error("Option " + nameToRaw(name) + " is required.");
          }
        }
      };
      mutuallyExclusiveError = function(first, second){
        throw new Error("The options " + nameToRaw(first) + " and " + nameToRaw(second) + " are mutually exclusive - you cannot use them at the same time.");
      };
      checkMutuallyExclusive = function(){
        var rules, i$, len$, rule, present, j$, len1$, element, k$, len2$, opt;
        rules = libOptions.mutuallyExclusive;
        if (!rules) {
          return;
        }
        for (i$ = 0, len$ = rules.length; i$ < len$; ++i$) {
          rule = rules[i$];
          present = null;
          for (j$ = 0, len1$ = rule.length; j$ < len1$; ++j$) {
            element = rule[j$];
            if (toString$.call(element).slice(8, -1) === 'Array') {
              for (k$ = 0, len2$ = element.length; k$ < len2$; ++k$) {
                opt = element[k$];
                if (opt in obj) {
                  if (present != null) {
                    mutuallyExclusiveError(present, opt);
                  } else {
                    present = opt;
                    break;
                  }
                }
              }
            } else {
              if (element in obj) {
                if (present != null) {
                  mutuallyExclusiveError(present, element);
                } else {
                  present = element;
                }
              }
            }
          }
        }
      };
      checkDependency = function(option){
        var dependsOn, type, targetOptionNames, i$, len$, targetOptionName, targetOption;
        dependsOn = option.dependsOn;
        if (!dependsOn || option.dependenciesMet) {
          return true;
        }
        type = dependsOn[0], targetOptionNames = slice$.call(dependsOn, 1);
        for (i$ = 0, len$ = targetOptionNames.length; i$ < len$; ++i$) {
          targetOptionName = targetOptionNames[i$];
          targetOption = obj[targetOptionName];
          if (targetOption && checkDependency(targetOption)) {
            if (type === 'or') {
              return true;
            }
          } else if (type === 'and') {
            throw new Error("The option '" + option.option + "' did not have its dependencies met.");
          }
        }
        if (type === 'and') {
          return true;
        } else {
          throw new Error("The option '" + option.option + "' did not meet any of its dependencies.");
        }
      };
      checkDependencies = function(){
        var name;
        for (name in obj) {
          checkDependency(opts[name]);
        }
      };
      checkProp = function(){
        if (prop) {
          throw new Error("Value for '" + prop + "' of type '" + getOption(prop).type + "' required.");
        }
      };
      switch (toString$.call(input).slice(8, -1)) {
      case 'String':
        args = parseString(input.slice(slice != null ? slice : 0));
        break;
      case 'Array':
        args = input.slice(slice != null ? slice : 2);
        break;
      case 'Object':
        obj = {};
        for (key in input) {
          value = input[key];
          if (key !== '_') {
            option = getOption(dasherize(key));
            if (parsedTypeCheck(option.parsedType, value)) {
              obj[option.option] = value;
            } else {
              throw new Error("Option '" + option.option + "': Invalid type for '" + value + "' - expected type '" + option.type + "'.");
            }
          }
        }
        checkMutuallyExclusive();
        checkDependencies();
        setDefaults();
        checkRequired();
        return ref$ = camelizeKeys(obj), ref$._ = input._ || [], ref$;
      default:
        throw new Error("Invalid argument to 'parse': " + input + ".");
      }
      for (i$ = 0, len$ = args.length; i$ < len$; ++i$) {
        arg = args[i$];
        if (arg === '--') {
          restPositional = true;
        } else if (restPositional) {
          positional.push(arg);
        } else {
          if (that = arg.match(/^(--?)([a-zA-Z][-a-zA-Z0-9]*)(=)?(.*)?$/)) {
            result = that;
            checkProp();
            short = result[1].length === 1;
            argName = result[2];
            usingAssign = result[3] != null;
            val = result[4];
            if (usingAssign && val == null) {
              throw new Error("No value for '" + argName + "' specified.");
            }
            if (short) {
              flags = chars(argName);
              len = flags.length;
              for (j$ = 0, len1$ = flags.length; j$ < len1$; ++j$) {
                i = j$;
                flag = flags[j$];
                opt = getOption(flag);
                name = opt.option;
                if (restPositional) {
                  positional.push(flag);
                } else if (i === len - 1) {
                  if (usingAssign) {
                    valPrime = opt.boolean ? parseLevn([{
                      type: 'Boolean'
                    }], val) : val;
                    setValue(name, valPrime);
                  } else if (opt.boolean) {
                    setValue(name, true);
                  } else {
                    prop = name;
                  }
                } else if (opt.boolean) {
                  setValue(name, true);
                } else {
                  throw new Error("Can't set argument '" + flag + "' when not last flag in a group of short flags.");
                }
              }
            } else {
              negated = false;
              if (that = argName.match(/^no-(.+)$/)) {
                negated = true;
                noedName = that[1];
                opt = getOption(noedName);
              } else {
                opt = getOption(argName);
              }
              name = opt.option;
              if (opt.boolean) {
                valPrime = usingAssign ? parseLevn([{
                  type: 'Boolean'
                }], val) : true;
                if (negated) {
                  setValue(name, !valPrime);
                } else {
                  setValue(name, valPrime);
                }
              } else {
                if (negated) {
                  throw new Error("Only use 'no-' prefix for Boolean options, not with '" + noedName + "'.");
                }
                if (usingAssign) {
                  setValue(name, val);
                } else {
                  prop = name;
                }
              }
            }
          } else if (that = arg.match(/^-([0-9]+(?:\.[0-9]+)?)$/)) {
            opt = opts.NUM;
            if (!opt) {
              throw new Error('No -NUM option defined.');
            }
            setValue(opt.option, that[1]);
          } else {
            if (prop) {
              setValue(prop, arg);
              prop = null;
            } else {
              positional.push(arg);
              if (!libOptions.positionalAnywhere) {
                restPositional = true;
              }
            }
          }
        }
      }
      checkProp();
      checkMutuallyExclusive();
      checkDependencies();
      setDefaults();
      checkRequired();
      return ref$ = camelizeKeys(obj), ref$._ = positional, ref$;
    };
    return {
      parse: parse,
      parseArgv: function(it){
        return parse(it, {
          slice: 2
        });
      },
      generateHelp: generateHelp(libOptions),
      generateHelpForOption: generateHelpForOption(getOption, libOptions)
    };
  };
  main.VERSION = VERSION;
  module.exports = main;
  function import$(obj, src){
    var own = {}.hasOwnProperty;
    for (var key in src) if (own.call(src, key)) obj[key] = src[key];
    return obj;
  }
}).call(this);
Mf!q]x%// Generated by LiveScript 1.6.0
(function(){
  var prelude, map, sortBy, fl, closestString, nameToRaw, dasherize, naturalJoin;
  prelude = require('prelude-ls'), map = prelude.map, sortBy = prelude.sortBy;
  fl = require('fast-levenshtein');
  closestString = function(possibilities, input){
    var distances, ref$, string, distance;
    if (!possibilities.length) {
      return;
    }
    distances = map(function(it){
      var ref$, longer, shorter;
      ref$ = input.length > it.length
        ? [input, it]
        : [it, input], longer = ref$[0], shorter = ref$[1];
      return {
        string: it,
        distance: fl.get(longer, shorter)
      };
    })(
    possibilities);
    ref$ = sortBy(function(it){
      return it.distance;
    }, distances)[0], string = ref$.string, distance = ref$.distance;
    return string;
  };
  nameToRaw = function(name){
    if (name.length === 1 || name === 'NUM') {
      return "-" + name;
    } else {
      return "--" + name;
    }
  };
  dasherize = function(string){
    if (/^[A-Z]/.test(string)) {
      return string;
    } else {
      return prelude.dasherize(string);
    }
  };
  naturalJoin = function(array){
    if (array.length < 3) {
      return array.join(' or ');
    } else {
      return array.slice(0, -1).join(', ') + ", or " + array[array.length - 1];
    }
  };
  module.exports = {
    closestString: closestString,
    nameToRaw: nameToRaw,
    dasherize: dasherize,
    naturalJoin: naturalJoin
  };
}).call(this);
y7xy{
  "name": "optionator",
  "version": "0.9.4",
  "author": "George Zahariev <z@georgezahariev.com>",
  "description": "option parsing and help generation",
  "homepage": "https://github.com/gkz/optionator",
  "keywords": [
    "options",
    "flags",
    "option parsing",
    "cli"
  ],
  "files": [
    "lib",
    "README.md",
    "LICENSE"
  ],
  "main": "./lib/",
  "bugs": "https://github.com/gkz/optionator/issues",
  "license": "MIT",
  "engines": {
    "node": ">= 0.8.0"
  },
  "repository": {
    "type": "git",
    "url": "git://github.com/gkz/optionator.git"
  },
  "scripts": {
    "test": "make test"
  },
  "dependencies": {
    "prelude-ls": "^1.2.1",
    "deep-is": "^0.1.3",
    "word-wrap": "^1.2.5",
    "type-check": "^0.4.0",
    "levn": "^0.4.1",
    "fast-levenshtein": "^2.0.6"
  },
  "devDependencies": {
    "livescript": "^1.6.0",
    "mocha": "^10.4.0"
  }
}
،2x E100644 index.d.ts H: U{ORth;100644 index.js ®Rwdcj-100644 license |JW?z100644 package.json vQG6I
:7jhj!100644 readme.md 5pTMptzNMXxudeclare namespace pLimit {
	interface Limit {
		/**
		The number of promises that are currently running.
		*/
		readonly activeCount: number;

		/**
		The number of promises that are waiting to run (i.e. their internal `fn` was not called yet).
		*/
		readonly pendingCount: number;

		/**
		Discard pending promises that are waiting to run.

		This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app.

		Note: This does not cancel promises that are already running.
		*/
		clearQueue: () => void;

		/**
		@param fn - Promise-returning/async function.
		@param arguments - Any arguments to pass through to `fn`. Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a lot of functions.
		@returns The promise returned by calling `fn(...arguments)`.
		*/
		<Arguments extends unknown[], ReturnType>(
			fn: (...arguments: Arguments) => PromiseLike<ReturnType> | ReturnType,
			...arguments: Arguments
		): Promise<ReturnType>;
	}
}

/**
Run multiple promise-returning & async functions with limited concurrency.

@param concurrency - Concurrency limit. Minimum: `1`.
@returns A `limit` function.
*/
declare function pLimit(concurrency: number): pLimit.Limit;

export = pLimit;
s娱_x'use strict';
const Queue = require('yocto-queue');

const pLimit = concurrency => {
	if (!((Number.isInteger(concurrency) || concurrency === Infinity) && concurrency > 0)) {
		throw new TypeError('Expected `concurrency` to be a number from 1 and up');
	}

	const queue = new Queue();
	let activeCount = 0;

	const next = () => {
		activeCount--;

		if (queue.size > 0) {
			queue.dequeue()();
		}
	};

	const run = async (fn, resolve, ...args) => {
		activeCount++;

		const result = (async () => fn(...args))();

		resolve(result);

		try {
			await result;
		} catch {}

		next();
	};

	const enqueue = (fn, resolve, ...args) => {
		queue.enqueue(run.bind(null, fn, resolve, ...args));

		(async () => {
			// This function needs to wait until the next microtask before comparing
			// `activeCount` to `concurrency`, because `activeCount` is updated asynchronously
			// when the run function is dequeued and called. The comparison in the if-statement
			// needs to happen asynchronously as well to get an up-to-date value for `activeCount`.
			await Promise.resolve();

			if (activeCount < concurrency && queue.size > 0) {
				queue.dequeue()();
			}
		})();
	};

	const generator = (fn, ...args) => new Promise(resolve => {
		enqueue(fn, resolve, ...args);
	});

	Object.defineProperties(generator, {
		activeCount: {
			get: () => activeCount
		},
		pendingCount: {
			get: () => queue.size
		},
		clearQueue: {
			value: () => {
				queue.clear();
			}
		}
	});

	return generator;
};

module.exports = pLimit;
:x_{
	"name": "p-limit",
	"version": "3.1.0",
	"description": "Run multiple promise-returning & async functions with limited concurrency",
	"license": "MIT",
	"repository": "sindresorhus/p-limit",
	"funding": "https://github.com/sponsors/sindresorhus",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "https://sindresorhus.com"
	},
	"engines": {
		"node": ">=10"
	},
	"scripts": {
		"test": "xo && ava && tsd"
	},
	"files": [
		"index.js",
		"index.d.ts"
	],
	"keywords": [
		"promise",
		"limit",
		"limited",
		"concurrency",
		"throttle",
		"throat",
		"rate",
		"batch",
		"ratelimit",
		"task",
		"queue",
		"async",
		"await",
		"promises",
		"bluebird"
	],
	"dependencies": {
		"yocto-queue": "^0.1.0"
	},
	"devDependencies": {
		"ava": "^2.4.0",
		"delay": "^4.4.0",
		"in-range": "^2.0.0",
		"random-int": "^2.0.1",
		"time-span": "^4.0.0",
		"tsd": "^0.13.1",
		"xo": "^0.35.0"
	}
}
.Vx
-# p-limit

> Run multiple promise-returning & async functions with limited concurrency

## Install

```
$ npm install p-limit
```

## Usage

```js
const pLimit = require('p-limit');

const limit = pLimit(1);

const input = [
	limit(() => fetchSomething('foo')),
	limit(() => fetchSomething('bar')),
	limit(() => doSomething())
];

(async () => {
	// Only one promise is run at once
	const result = await Promise.all(input);
	console.log(result);
})();
```

## API

### pLimit(concurrency)

Returns a `limit` function.

#### concurrency

Type: `number`\
Minimum: `1`\
Default: `Infinity`

Concurrency limit.

### limit(fn, ...args)

Returns the promise returned by calling `fn(...args)`.

#### fn

Type: `Function`

Promise-returning/async function.

#### args

Any arguments to pass through to `fn`.

Support for passing arguments on to the `fn` is provided in order to be able to avoid creating unnecessary closures. You probably don't need this optimization unless you're pushing a *lot* of functions.

### limit.activeCount

The number of promises that are currently running.

### limit.pendingCount

The number of promises that are waiting to run (i.e. their internal `fn` was not called yet).

### limit.clearQueue()

Discard pending promises that are waiting to run.

This might be useful if you want to teardown the queue at the end of your program's lifecycle or discard any function calls referencing an intermediary state of your app.

Note: This does not cancel promises that are already running.

## FAQ

### How is this different from the [`p-queue`](https://github.com/sindresorhus/p-queue) package?

This package is only about limiting the number of concurrent executions, while `p-queue` is a fully featured queue implementation with lots of different options, introspection, and ability to pause the queue.

## Related

- [p-queue](https://github.com/sindresorhus/p-queue) - Promise queue with concurrency control
- [p-throttle](https://github.com/sindresorhus/p-throttle) - Throttle promise-returning & async functions
- [p-debounce](https://github.com/sindresorhus/p-debounce) - Debounce promise-returning & async functions
- [p-all](https://github.com/sindresorhus/p-all) - Run promise-returning & async functions concurrently with optional limited concurrency
- [More…](https://github.com/sindresorhus/promise-fun)

---

<div align="center">
	<b>
		<a href="https://tidelift.com/subscription/pkg/npm-p-limit?utm_source=npm-p-limit&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
	</b>
	<br>
	<sub>
		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
	</sub>
</div>
vƲx E100644 index.d.ts 8xf\-|TT~~100644 index.js d=eC{100644 license |JW?z100644 package.json -^DU!n0=
e)Ȯ100644 readme.md DcT#&i=[0L[xDdeclare namespace pLocate {
	interface Options {
		/**
		Number of concurrently pending promises returned by `tester`. Minimum: `1`.

		@default Infinity
		*/
		readonly concurrency?: number;

		/**
		Preserve `input` order when searching.

		Disable this to improve performance if you don't care about the order.

		@default true
		*/
		readonly preserveOrder?: boolean;
	}
}

/**
Get the first fulfilled promise that satisfies the provided testing function.

@param input - An iterable of promises/values to test.
@param tester - This function will receive resolved values from `input` and is expected to return a `Promise<boolean>` or `boolean`.
@returns A `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`.

@example
```
import pathExists = require('path-exists');
import pLocate = require('p-locate');

const files = [
	'unicorn.png',
	'rainbow.png', // Only this one actually exists on disk
	'pony.png'
];

(async () => {
	const foundPath = await pLocate(files, file => pathExists(file));

	console.log(foundPath);
	//=> 'rainbow'
})();
```
*/
declare function pLocate<ValueType>(
	input: Iterable<PromiseLike<ValueType> | ValueType>,
	tester: (element: ValueType) => PromiseLike<boolean> | boolean,
	options?: pLocate.Options
): Promise<ValueType | undefined>;

export = pLocate;
bkεHxz'use strict';
const pLimit = require('p-limit');

class EndError extends Error {
	constructor(value) {
		super();
		this.value = value;
	}
}

// The input can also be a promise, so we await it
const testElement = async (element, tester) => tester(await element);

// The input can also be a promise, so we `Promise.all()` them both
const finder = async element => {
	const values = await Promise.all(element);
	if (values[1] === true) {
		throw new EndError(values[0]);
	}

	return false;
};

const pLocate = async (iterable, tester, options) => {
	options = {
		concurrency: Infinity,
		preserveOrder: true,
		...options
	};

	const limit = pLimit(options.concurrency);

	// Start all the promises concurrently with optional limit
	const items = [...iterable].map(element => [element, limit(testElement, element, tester)]);

	// Check the promises either serially or concurrently
	const checkLimit = pLimit(options.preserveOrder ? 1 : Infinity);

	try {
		await Promise.all(items.map(element => checkLimit(finder, element)));
	} catch (error) {
		if (error instanceof EndError) {
			return error.value;
		}

		throw error;
	}
};

module.exports = pLocate;
e@:xQ{
	"name": "p-locate",
	"version": "5.0.0",
	"description": "Get the first fulfilled promise that satisfies the provided testing function",
	"license": "MIT",
	"repository": "sindresorhus/p-locate",
	"funding": "https://github.com/sponsors/sindresorhus",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "https://sindresorhus.com"
	},
	"engines": {
		"node": ">=10"
	},
	"scripts": {
		"test": "xo && ava && tsd"
	},
	"files": [
		"index.js",
		"index.d.ts"
	],
	"keywords": [
		"promise",
		"locate",
		"find",
		"finder",
		"search",
		"searcher",
		"test",
		"array",
		"collection",
		"iterable",
		"iterator",
		"race",
		"fulfilled",
		"fastest",
		"async",
		"await",
		"promises",
		"bluebird"
	],
	"dependencies": {
		"p-limit": "^3.0.2"
	},
	"devDependencies": {
		"ava": "^2.4.0",
		"delay": "^4.1.0",
		"in-range": "^2.0.0",
		"time-span": "^4.0.0",
		"tsd": "^0.13.1",
		"xo": "^0.32.1"
	}
}
Llx	# p-locate [![Build Status](https://travis-ci.com/sindresorhus/p-locate.svg?branch=master)](https://travis-ci.com/github/sindresorhus/p-locate)

> Get the first fulfilled promise that satisfies the provided testing function

Think of it like an async version of [`Array#find`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/find).

## Install

```
$ npm install p-locate
```

## Usage

Here we find the first file that exists on disk, in array order.

```js
const pathExists = require('path-exists');
const pLocate = require('p-locate');

const files = [
	'unicorn.png',
	'rainbow.png', // Only this one actually exists on disk
	'pony.png'
];

(async () => {
	const foundPath = await pLocate(files, file => pathExists(file));

	console.log(foundPath);
	//=> 'rainbow'
})();
```

*The above is just an example. Use [`locate-path`](https://github.com/sindresorhus/locate-path) if you need this.*

## API

### pLocate(input, tester, options?)

Returns a `Promise` that is fulfilled when `tester` resolves to `true` or the iterable is done, or rejects if any of the promises reject. The fulfilled value is the current iterable value or `undefined` if `tester` never resolved to `true`.

#### input

Type: `Iterable<Promise | unknown>`

An iterable of promises/values to test.

#### tester(element)

Type: `Function`

This function will receive resolved values from `input` and is expected to return a `Promise<boolean>` or `boolean`.

#### options

Type: `object`

##### concurrency

Type: `number`\
Default: `Infinity`\
Minimum: `1`

Number of concurrently pending promises returned by `tester`.

##### preserveOrder

Type: `boolean`\
Default: `true`

Preserve `input` order when searching.

Disable this to improve performance if you don't care about the order.

## Related

- [p-map](https://github.com/sindresorhus/p-map) - Map over promises concurrently
- [p-filter](https://github.com/sindresorhus/p-filter) - Filter promises concurrently
- [p-any](https://github.com/sindresorhus/p-any) - Wait for any promise to be fulfilled
- [More…](https://github.com/sindresorhus/promise-fun)

---

<div align="center">
	<b>
		<a href="https://tidelift.com/subscription/pkg/npm-p-locate?utm_source=npm-p-locate&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
	</b>
	<br>
	<sub>
		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
	</sub>
</div>
})x E100644 index.d.ts TNFUcd100644 index.js Cu:3om:100644 license /w}sd!VhL<100644 package.json U%j+3ُ$94|100644 readme.md TVϜ*1GaF:xRdeclare const pathExists: {
	/**
	Check if a path exists.

	@returns Whether the path exists.

	@example
	```
	// foo.ts
	import pathExists = require('path-exists');

	(async () => {
		console.log(await pathExists('foo.ts'));
		//=> true
	})();
	```
	*/
	(path: string): Promise<boolean>;

	/**
	Synchronously check if a path exists.

	@returns Whether the path exists.
	*/
	sync(path: string): boolean;
};

export = pathExists;
Нx['use strict';
const fs = require('fs');
const {promisify} = require('util');

const pAccess = promisify(fs.access);

module.exports = async path => {
	try {
		await pAccess(path);
		return true;
	} catch (_) {
		return false;
	}
};

module.exports.sync = path => {
	try {
		fs.accessSync(path);
		return true;
	} catch (_) {
		return false;
	}
};
LEo(xu{
	"name": "path-key",
	"version": "3.1.1",
	"description": "Get the PATH environment variable key cross-platform",
	"license": "MIT",
	"repository": "sindresorhus/path-key",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "sindresorhus.com"
	},
	"engines": {
		"node": ">=8"
	},
	"scripts": {
		"test": "xo && ava && tsd"
	},
	"files": [
		"index.js",
		"index.d.ts"
	],
	"keywords": [
		"path",
		"key",
		"environment",
		"env",
		"variable",
		"var",
		"get",
		"cross-platform",
		"windows"
	],
	"devDependencies": {
		"@types/node": "^11.13.0",
		"ava": "^1.4.1",
		"tsd": "^0.7.2",
		"xo": "^0.24.0"
	}
}
^_x V{
	"name": "path-exists",
	"version": "4.0.0",
	"description": "Check if a path existsq8exists
exists",
		"exist",
		"file",
		"filepath",
		"fs",
		"filesystem",
		"file-system",
		"access",
		"stat"
	],
	"devDependencies": {L>DFYxl# path-exists [![Build Status](https://travis-ci.org/sindresorhus/path-exists.svg?branch=master)](https://travis-ci.org/sindresorhus/path-exists)

> Check if a path exists

NOTE: `fs.existsSync` has been un-deprecated in Node.js since 6.8.0. If you only need to check synchronously, this module is not needed.

While [`fs.exists()`](https://nodejs.org/api/fs.html#fs_fs_exists_path_callback) is being [deprecated](https://github.com/iojs/io.js/issues/103), there's still a genuine use-case of being able to check if a path exists for other purposes than doing IO with it.

Never use this before handling a file though:

> In particular, checking if a file exists before opening it is an anti-pattern that leaves you vulnerable to race conditions: another process may remove the file between the calls to `fs.exists()` and `fs.open()`. Just open the file and handle the error when it's not there.


## Install

```
$ npm install path-exists
```


## Usage

```js
// foo.js
const pathExists = require('path-exists');

(async () => {
	console.log(await pathExists('foo.js'));
	//=> true
})();
```


## API

### pathExists(path)

Returns a `Promise<boolean>` of whether the path exists.

### pathExists.sync(path)

Returns a `boolean` of whether the path exists.


## Related

- [path-exists-cli](https://github.com/sindresorhus/path-exists-cli) - CLI for this module


## License

MIT © [Sindre Sorhus](https://sindresorhus.com)
죪x E100644 index.d.ts |W]u";03(B100644 index.js A]`'Ň100644 license /w}sd!VhL<100644 package.json ӃUTka7k100644 readme.md -zikB-jmF{@x/// <reference types="node" />

declare namespace pathKey {
	interface Options {
		/**
		Use a custom environment variables object. Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env).
		*/
		readonly env?: {[key: string]: string | undefined};

		/**
		Get the PATH key for a specific platform. Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform).
		*/
		readonly platform?: NodeJS.Platform;
	}
}

declare const pathKey: {
	/**
	Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform.

	@example
	```
	import pathKey = require('path-key');

	const key = pathKey();
	//=> 'PATH'

	const PATH = process.env[key];
	//=> '/usr/local/bin:/usr/bin:/bin'
	```
	*/
	(options?: pathKey.Options): string;

	// TODO: Remove this for the next major release, refactor the whole definition to:
	// declare function pathKey(options?: pathKey.Options): string;
	// export = pathKey;
	default: typeof pathKey;
};

export = pathKey;
Y~x`'use strict';

const pathKey = (options = {}) => {
	const environment = options.env || process.env;
	const platform = options.platform || process.platform;

	if (platform !== 'win32') {
		return 'PATH';
	}

	return Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';
};

module.exports = pathKey;
// TODO: Remove this for the next major release
module.exports.default = pathKey;
LsTxC# path-key [![Build Status](https://travis-ci.org/sindresorhus/path-key.svg?branch=master)](https://travis-ci.org/sindresorhus/path-key)

> Get the [PATH](https://en.wikipedia.org/wiki/PATH_(variable)) environment variable key cross-platform

It's usually `PATH`, but on Windows it can be any casing like `Path`...


## Install

```
$ npm install path-key
```


## Usage

```js
const pathKey = require('path-key');

const key = pathKey();
//=> 'PATH'

const PATH = process.env[key];
//=> '/usr/local/bin:/usr/bin:/bin'
```


## API

### pathKey(options?)

#### options

Type: `object`

##### env

Type: `object`<br>
Default: [`process.env`](https://nodejs.org/api/process.html#process_process_env)

Use a custom environment variables object.

#### platform

Type: `string`<br>
Default: [`process.platform`](https://nodejs.org/api/process.html#process_process_platform)

Get the PATH key for a specific platform.


---

<div align="center">
	<b>
		<a href="https://tidelift.com/subscription/pkg/npm-path-key?utm_source=npm-path-key&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a>
	</b>
	<br>
	<sub>
		Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.
	</sub>
</div>
?wx100644 API.md dfKDj3100644 CHANGELOG.md @F=*2NO100644 LICENSE-MIT :aO6][100644 README.md dܵÓ/\40000 dist :n.HVmH;q%100644 package.json !6QשH100644 postcss-selector-parser.d.ts 
#<͗_bl1c%0[h׸
xhR# API Documentation

*Please use only this documented API when working with the parser. Methods
not documented here are subject to change at any point.*

## `parser` function

This is the module's main entry point.

```js
const parser = require('postcss-selector-parser');
```

### `parser([transform], [options])`

Creates a new `processor` instance

```js
const processor = parser();
```

Or, with optional transform function

```js
const transform = selectors => {
    selectors.walkUniversals(selector => {
        selector.remove();
    });
};

const processor = parser(transform)

// Example
const result = processor.processSync('*.class');
// => .class
```

[See processor documentation](#processor)

Arguments:

* `transform (function)`: Provide a function to work with the parsed AST.
* `options (object)`: Provide default options for all calls on the returned `Processor`.

### `parser.attribute([props])`

Creates a new attribute selector.

```js
parser.attribute({attribute: 'href'});
// => [href]
```

Arguments:

* `props (object)`: The new node's properties.

### `parser.className([props])`

Creates a new class selector.

```js
parser.className({value: 'button'});
// => .button
```

Arguments:

* `props (object)`: The new node's properties.

### `parser.combinator([props])`

Creates a new selector combinator.

```js
parser.combinator({value: '+'});
// => +
```

Arguments:

* `props (object)`: The new node's properties.

Notes:
* **Descendant Combinators** The value of descendant combinators created by the
  parser always just a single space (`" "`). For descendant selectors with no
  comments, additional space is now stored in `node.spaces.before`. Depending
  on the location of comments, additional spaces may be stored in
  `node.raws.spaces.before`, `node.raws.spaces.after`, or `node.raws.value`.
* **Named Combinators** Although, nonstandard and unlikely to ever become a standard,
  named combinators like `/deep/` and `/for/` are parsed as combinators. The
  `node.value` is name after being unescaped and normalized as lowercase. The
  original value for the combinator name is stored in `node.raws.value`.


### `parser.comment([props])`

Creates a new comment.

```js
parser.comment({value: '/* Affirmative, Dave. I read you. */'});
// => /* Affirmative, Dave. I read you. */
```

Arguments:

* `props (object)`: The new node's properties.

### `parser.id([props])`

Creates a new id selector.

```js
parser.id({value: 'search'});
// => #search
```

Arguments:

* `props (object)`: The new node's properties.

### `parser.nesting([props])`

Creates a new nesting selector.

```js
parser.nesting();
// => &
```

Arguments:

* `props (object)`: The new node's properties.

### `parser.pseudo([props])`

Creates a new pseudo selector.

```js
parser.pseudo({value: '::before'});
// => ::before
```

Arguments:

* `props (object)`: The new node's properties.

### `parser.root([props])`

Creates a new root node.

```js
parser.root();
// => (empty)
```

Arguments:

* `props (object)`: The new node's properties.

### `parser.selector([props])`

Creates a new selector node.

```js
parser.selector();
// => (empty)
```

Arguments:

* `props (object)`: The new node's properties.

### `parser.string([props])`

Creates a new string node.

```js
parser.string();
// => (empty)
```

Arguments:

* `props (object)`: The new node's properties.

### `parser.tag([props])`

Creates a new tag selector.

```js
parser.tag({value: 'button'});
// => button
```

Arguments:

* `props (object)`: The new node's properties.

### `parser.universal([props])`

Creates a new universal selector.

```js
parser.universal();
// => *
```

Arguments:

* `props (object)`: The new node's properties.

## Node types

### `node.type`

A string representation of the selector type. It can be one of the following;
`attribute`, `class`, `combinator`, `comment`, `id`, `nesting`, `pseudo`,
`root`, `selector`, `string`, `tag`, or `universal`. Note that for convenience,
these constants are exposed on the main `parser` as uppercased keys. So for
example you can get `id` by querying `parser.ID`.

```js
parser.attribute({attribute: 'href'}).type;
// => 'attribute'
```

### `node.parent`

Returns the parent node.

```js
root.nodes[0].parent === root;
```

### `node.toString()`, `String(node)`, or `'' + node`

Returns a string representation of the node.

```js
const id = parser.id({value: 'search'});
console.log(String(id));
// => #search
```

### `node.next()` & `node.prev()`

Returns the next/previous child of the parent node.

```js
const next = id.next();
if (next && next.type !== 'combinator') {
    throw new Error('Qualified IDs are not allowed!');
}
```

### `node.replaceWith(node[,...nodeN])`

Replace a node with another.

```js
const attr = selectors.first.first;
const className = parser.className({value: 'test'});
attr.replaceWith(className);
```

Arguments:

* `node`: The node to substitute the original with.
...
* `nodeN`: The node to substitute the original with.

### `node.remove()`

Removes the node from its parent node.

```js
if (node.type === 'id') {
    node.remove();
}
```

### `node.clone([opts])`

Returns a copy of a node, detached from any parent containers that the
original might have had.

```js
const cloned = node.clone();
```

### `node.isAtPosition(line, column)`

Return a `boolean` indicating whether this node includes the character at the
position of the given line and column. Returns `undefined` if the nodes lack
sufficient source metadata to determine the position.

Arguments:

* `line`: 1-index based line number relative to the start of the selector.
* `column`: 1-index based column number relative to the start of the selector.

### `node.spaces`

Extra whitespaces around the node will be moved into `node.spaces.before` and
`node.spaces.after`. So for example, these spaces will be moved as they have
no semantic meaning:

```css
      h1     ,     h2   {}
```

For descendent selectors, the value is always a single space.

```css
h1        h2 {}
```

Additional whitespace is found in either the `node.spaces.before` and `node.spaces.after` depending on the presence of comments or other whitespace characters. If the actual whitespace does not start or end with a single space, the node's raw value is set to the actual space(s) found in the source.

### `node.source`

An object describing the node's start/end, line/column source position.

Within the following CSS, the `.bar` class node ...

```css
.foo,
  .bar {}
```

... will contain the following `source` object.

```js
source: {
    start: {
        line: 2,
        column: 3
    },
    end: {
        line: 2,
        column: 6
    }
}
```

### `node.sourceIndex`

The zero-based index of the node within the original source string.

Within the following CSS, the `.baz` class node will have a `sourceIndex` of `12`.

```css
.foo, .bar, .baz {}
```

## Container types

The `root`, `selector`, and `pseudo` nodes have some helper methods for working
with their children.

### `container.nodes`

An array of the container's children.

```js
// Input: h1 h2
selectors.at(0).nodes.length   // => 3
selectors.at(0).nodes[0].value // => 'h1'
selectors.at(0).nodes[1].value // => ' '
```

### `container.first` & `container.last`

The first/last child of the container.

```js
selector.first === selector.nodes[0];
selector.last === selector.nodes[selector.nodes.length - 1];
```

### `container.at(index)`

Returns the node at position `index`.

```js
selector.at(0) === selector.first;
selector.at(0) === selector.nodes[0];
```

Arguments:

* `index`: The index of the node to return.

### `container.atPosition(line, column)`

Returns the node at the source position `line` and `column`.

```js
// Input: :not(.foo),\n#foo > :matches(ol, ul)
selector.atPosition(1, 1); // => :not(.foo)
selector.atPosition(2, 1); // => \n#foo
```

Arguments:

* `line`: The line number of the node to return.
* `column`: The column number of the node to return.

### `container.index(node)`

Return the index of the node within its container.

```js
selector.index(selector.nodes[2]) // => 2
```

Arguments:

* `node`: A node within the current container.

### `container.length`

Proxy to the length of the container's nodes.

```js
container.length === container.nodes.length
```

### `container` Array iterators

The container class provides proxies to certain Array methods; these are:

* `container.map === container.nodes.map`
* `container.reduce === container.nodes.reduce`
* `container.every === container.nodes.every`
* `container.some === container.nodes.some`
* `container.filter === container.nodes.filter`
* `container.sort === container.nodes.sort`

Note that these methods only work on a container's immediate children; recursive
iteration is provided by `container.walk`.

### `container.each(callback)`

Iterate the container's immediate children, calling `callback` for each child.
You may return `false` within the callback to break the iteration.

```js
let className;
selectors.each((selector, index) => {
    if (selector.type === 'class') {
        className = selector.value;
        return false;
    }
});
```

Note that unlike `Array#forEach()`, this iterator is safe to use whilst adding
or removing nodes from the container.

Arguments:

* `callback (function)`: A function to call for each node, which receives `node`
  and `index` arguments.

### `container.walk(callback)`

Like `container#each`, but will also iterate child nodes as long as they are
`container` types.

```js
selectors.walk((selector, index) => {
    // all nodes
});
```

Arguments:

* `callback (function)`: A function to call for each node, which receives `node`
  and `index` arguments.

This iterator is safe to use whilst mutating `container.nodes`,
like `container#each`.

### `container.walk` proxies

The container class provides proxy methods for iterating over types of nodes,
so that it is easier to write modules that target specific selectors. Those
methods are:

* `container.walkAttributes`
* `container.walkClasses`
* `container.walkCombinators`
* `container.walkComments`
* `container.walkIds`
* `container.walkNesting`
* `container.walkPseudos`
* `container.walkTags`
* `container.walkUniversals`

### `container.split(callback)`

This method allows you to split a group of nodes by returning `true` from
a callback. It returns an array of arrays, where each inner array corresponds
to the groups that you created via the callback.

```js
// (input) => h1 h2>>h3
const list = selectors.first.split(selector => {
    return selector.type === 'combinator';
});

// (node values) => [['h1', ' '], ['h2', '>>'], ['h3']]
```

Arguments:

* `callback (function)`: A function to call for each node, which receives `node`
  as an argument.

### `container.prepend(node)` & `container.append(node)`

Add a node to the start/end of the container. Note that doing so will set
the parent property of the node to this container.

```js
const id = parser.id({value: 'search'});
selector.append(id);
```

Arguments:

* `node`: The node to add.

### `container.insertBefore(old, new[, ...newNodes])` & `container.insertAfter(old, new[, ...newNodes])`

Add a node before or after an existing node in a container:

```js
selectors.walk(selector => {
    if (selector.type !== 'class') {
        const className = parser.className({value: 'theme-name'});
        selector.parent.insertAfter(selector, className);
    }
});
```

Arguments:

* `old`: The existing node in the container.
* `new`: The new node to add before/after the existing node.

### `container.removeChild(node)`

Remove the node from the container. Note that you can also use
`node.remove()` if you would like to remove just a single node.

```js
selector.length // => 2
selector.remove(id)
selector.length // => 1;
id.parent       // undefined
```

Arguments:

* `node`: The node to remove.

### `container.removeAll()` or `container.empty()`

Remove all children from the container.

```js
selector.removeAll();
selector.length // => 0
```

## Root nodes

A root node represents a comma separated list of selectors. Indeed, all
a root's `toString()` method does is join its selector children with a ','.
Other than this, it has no special functionality and acts like a container.

### `root.trailingComma`

This will be set to `true` if the input has a trailing comma, in order to
support parsing of legacy CSS hacks.

## Selector nodes

A selector node represents a single complex selector. For example, this
selector string `h1 h2 h3, [href] > p`, is represented as two selector nodes.
It has no special functionality of its own.

## Pseudo nodes

A pseudo selector extends a container node; if it has any parameters of its
own (such as `h1:not(h2, h3)`), they will be its children. Note that the pseudo
`value` will always contain the colons preceding the pseudo identifier. This
is so that both `:before` and `::before` are properly represented in the AST.

## Attribute nodes

### `attribute.quoted`

Returns `true` if the attribute's value is wrapped in quotation marks, false if it is not.
Remains `undefined` if there is no attribute value.

```css
[href=foo] /* false */
[href='foo'] /* true */
[href="foo"] /* true */
[href] /* undefined */
```

### `attribute.qualifiedAttribute`

Returns the attribute name qualified with the namespace if one is given.

### `attribute.offsetOf(part)`

 Returns the offset of the attribute part specified relative to the
 start of the node of the output string. This is useful in raising
 error messages about a specific part of the attribute, especially
 in combination with `attribute.sourceIndex`.

 Returns `-1` if the name is invalid or the value doesn't exist in this
 attribute.

 The legal values for `part` are:

 * `"ns"` - alias for "namespace"
 * `"namespace"` - the namespace if it exists.
 * `"attribute"` - the attribute name
 * `"attributeNS"` - the start of the attribute or its namespace
 * `"operator"` - the match operator of the attribute
 * `"value"` - The value (string or identifier)
 * `"insensitive"` - the case insensitivity flag

### `attribute.raws.unquoted`

Returns the unquoted content of the attribute's value.
Remains `undefined` if there is no attribute value.

```css
[href=foo] /* foo */
[href='foo'] /* foo */
[href="foo"] /* foo */
[href] /* undefined */
```

### `attribute.spaces`

Like `node.spaces` with the `before` and `after` values containing the spaces
around the element, the parts of the attribute can also have spaces before
and after them. The for each of `attribute`, `operator`, `value` and
`insensitive` there is corresponding property of the same nam in
`node.spaces` that has an optional `before` or `after` string containing only
whitespace.

Note that corresponding values in `attributes.raws.spaces` contain values
including any comments. If set, these values will override the
`attribute.spaces` value. Take care to remove them if changing
`attribute.spaces`.

### `attribute.raws`

The raws object stores comments and other information necessary to re-render
the node exactly as it was in the source.

If a comment is embedded within the identifiers for the `namespace`, `attribute`
or `value` then a property is placed in the raws for that value containing the full source of the propery including comments.

If a comment is embedded within the space between parts of the attribute
then the raw for that space is set accordingly.

Setting an attribute's property `raws` value to be deleted.

For now, changing the spaces required also updating or removing any of the
raws values that override them.

Example: `[ /*before*/ href /* after-attr */ = /* after-operator */ te/*inside-value*/st/* wow */ /*omg*/i/*bbq*/ /*whodoesthis*/]` would parse as:

```js
{
  attribute: "href",
  operator: "=",
  value: "test",
  spaces: {
    before: '',
    after: '',
    attribute: { before: '  ', after: '  ' },
    operator: { after: '  ' },
    value: { after: ' ' },
    insensitive: { after: ' ' }
  },
  raws: {
    spaces: {
      attribute: { before: ' /*before*/ ', after: ' /* after-attr */ ' },
      operator: { after: ' /* after-operator */ ' },
      value: { after: '/* wow */ /*omg*/' },
      insensitive: { after: '/*bbq*/ /*whodoesthis*/' }
    },
    unquoted: 'test',
    value: 'te/*inside-value*/st'
  }
}
```

## `Processor`

### `ProcessorOptions`

* `lossless` - When `true`, whitespace is preserved. Defaults to `true`.
* `updateSelector` - When `true`, if any processor methods are passed a postcss
  `Rule` node instead of a string, then that Rule's selector is updated
  with the results of the processing. Defaults to `true`.

### `process|processSync(selectors, [options])`

Processes the `selectors`, returning a string from the result of processing.

Note: when the `updateSelector` option is set, the rule's selector
will be updated with the resulting string.

**Example:**

```js
const parser = require("postcss-selector-parser");
const processor = parser();

let result = processor.processSync(' .class');
console.log(result);
// =>  .class

// Asynchronous operation
let promise = processor.process(' .class').then(result => {
    console.log(result)
    // => .class
});

// To have the parser normalize whitespace values, utilize the options
result = processor.processSync('  .class  ', {lossless: false});
console.log(result);
// => .class

// For better syntax errors, pass a PostCSS Rule node.
const postcss = require('postcss');
rule = postcss.rule({selector: ' #foo    > a,  .class  '});
processor.process(rule, {lossless: false, updateSelector: true}).then(result => {
    console.log(result);
    // => #foo>a,.class
    console.log("rule:", rule.selector);
    // => rule: #foo>a,.class
})
```

Arguments:

* `selectors (string|postcss.Rule)`: Either a selector string or a PostCSS Rule
  node.
* `[options] (object)`: Process options


### `ast|astSync(selectors, [options])`

Like `process()` and `processSync()` but after
processing the `selectors` these methods return the `Root` node of the result
instead of a string.

Note: when the `updateSelector` option is set, the rule's selector
will be updated with the resulting string.

### `transform|transformSync(selectors, [options])`

Like `process()` and `processSync()` but after
processing the `selectors` these methods return the value returned by the
processor callback.

Note: when the `updateSelector` option is set, the rule's selector
will be updated with the resulting string.

### Error Handling Within Selector Processors

The root node passed to the selector processor callback
has a method `error(message, options)` that returns an
error object. This method should always be used to raise
errors relating to the syntax of selectors. The options
to this method are passed to postcss's error constructor
([documentation](http://postcss.org/api/#container-error)).

#### Async Error Example

```js
let processor = (root) => {
    return new Promise((resolve, reject) => {
        root.walkClasses((classNode) => {
            if (/^(.*)[-_]/.test(classNode.value)) {
                let msg = "classes may not have underscores or dashes in them";
                reject(root.error(msg, {
                    index: classNode.sourceIndex + RegExp.$1.length + 1,
                    word: classNode.value
                }));
            }
        });
        resolve();
    });
};

const postcss = require("postcss");
const parser = require("postcss-selector-parser");
const selectorProcessor = parser(processor);
const plugin = postcss.plugin('classValidator', (options) => {
    return (root) => {
        let promises = [];
        root.walkRules(rule => {
            promises.push(selectorProcessor.process(rule));
        });
        return Promise.all(promises);
    };
});
postcss(plugin()).process(`
.foo-bar {
  color: red;
}
`.trim(), {from: 'test.css'}).catch((e) => console.error(e.toString()));

// CssSyntaxError: classValidator: ./test.css:1:5: classes may not have underscores or dashes in them
//
// > 1 | .foo-bar {
//     |     ^
//   2 |   color: red;
//   3 | }
```

#### Synchronous Error Example

```js
let processor = (root) => {
    root.walkClasses((classNode) => {
        if (/.*[-_]/.test(classNode.value)) {
            let msg = "classes may not have underscores or dashes in them";
            throw root.error(msg, {
                index: classNode.sourceIndex,
                word: classNode.value
            });
        }
    });
};

const postcss = require("postcss");
const parser = require("postcss-selector-parser");
const selectorProcessor = parser(processor);
const plugin = postcss.plugin('classValidator', (options) => {
    return (root) => {
        root.walkRules(rule => {
            selectorProcessor.processSync(rule);
        });
    };
});
postcss(plugin()).process(`
.foo-bar {
  color: red;
}
`.trim(), {from: 'test.css'}).catch((e) => console.error(e.toString()));

// CssSyntaxError: classValidator: ./test.css:1:5: classes may not have underscores or dashes in them
//
// > 1 | .foo-bar {
//     |     ^
//   2 |   color: red;
//   3 | }
```
_LŶ	xFO# 7.1.4 - 2026-06-11

- fix: tolerate non-node children when serializing selectors

# 7.1.3 - 2026-06-11

- Improve fix CVE-2026-9358 (NVD) / SNYK-JS-POSTCSSSELECTORPARSER-16873882 (clone/walk)

# 7.1.2 - 2026-06-09

- Fix [CVE-2026-9358](https://github.com/advisories/GHSA-w9m9-85wc-3x92) (NVD) / SNYK-JS-POSTCSSSELECTORPARSER-16873882 ([#316](https://github.com/postcss/postcss-selector-parser/pull/316) by [@MoOx](https://github.com/MoOx))

# 7.1.1

- perf: replace startsWith with strict equality (#308)
- fix(types): add walkUniversal declaration (#311)

# 7.1.0

- feat: insert(Before|After) support multiple new node

# 7.0.0

- Feat: make insertions during iteration safe (major)

# 6.1.2

- Fixed: erroneous trailing combinators in pseudos

# 6.1.1

- Fixed: improve typings of constructor helpers (#292)

# 6.1.0

- Feature: add `sourceIndex` to `Selector` nodes (#290)

# 6.0.16

- Fixed: add missing `index` argument to `each`/`walk` callback types (#289)

# 6.0.15

- Fixed: Node#prev and Node#next type for the first/last node

# 6.0.14

- Fixed: type definitions

# 6.0.13

- Fixed: throw on unexpected pipe symbols

# 6.0.12

- Fixed: `clone` arguments should be optional

# 6.0.11

- Fixed: parse attribute case insensitivity flag

# 6.0.10

- Fixed: `isPseudoElement()` supports `:first-letter` and `:first-line`

# 6.0.9

- Fixed: `Combinator.raws` property type

# 6.0.8

- Fixed: reduced size

# 6.0.7

- Fixed: parse animation percents

# 6.0.6

- Fixed: parse quoted attributes containing a newline correctly

# 6.0.5

- Perf: rework unesc for a 63+% performance boost

# 6.0.4

- Fixed: ts errors

# 6.0.3

- Fixed: replace node built-in "util" module with "util-deprecate"
- Fixed: handle uppercase pseudo elements
- Fixed: do not create invalid combinator before comment

# 6.0.2

- Fixed an issue with parsing and stringifying an empty attribute value

# 6.0.1

- Fixed an issue with unicode surrogate pair parsing

# 6.0.0

- Updated: `cssesc` to 3.0.0 (major)
- Fixed: Issues with escaped `id` and `class` selectors

# 5.0.0

- Allow escaped dot within class name.
- Update PostCSS to 7.0.7 (patch)

# 5.0.0-rc.4

- Fixed an issue where comments immediately after an insensitive (in attribute)
  were not parsed correctly.
- Updated `cssesc` to 2.0.0 (major).
- Removed outdated integration tests.
- Added tests for custom selectors, tags with attributes, the universal
  selector with pseudos, and tokens after combinators.

# 5.0.0-rc.1

To ease adoption of the v5.0 release, we have relaxed the node version
check performed by npm at installation time to allow for node 4, which
remains officially unsupported, but likely to continue working for the
time being.

# 5.0.0-rc.0

This release has **BREAKING CHANGES** that were required to fix regressions
in 4.0.0 and to make the Combinator Node API consistent for all combinator
types. Please read carefully.

## Summary of Changes

* The way a descendent combinator that isn't a single space character (E.g. `.a  .b`) is stored in the AST has changed.
* Named Combinators (E.g. `.a /for/ .b`) are now properly parsed as a combinator.
* It is now possible to look up a node based on the source location of a character in that node and to query nodes if they contain some character.
* Several bug fixes that caused the parser to hang and run out of memory when a `/` was encountered have been fixed.
* The minimum supported version of Node is now `v6.0.0`.

### Changes to the Descendent Combinator

In prior releases, the value of a descendant combinator with multiple spaces included all the spaces.

* `.a   .b`: Extra spaces are now stored as space before.
  - Old & Busted:
    - `combinator.value === "   "`
  - New hotness:
    - `combinator.value === " " && combinator.spaces.before === "  "`
* `.a   /*comment*/.b`: A comment at the end of the combinator causes extra space to become after space.
  - Old & Busted:
    - `combinator.value === "   "`
    - `combinator.raws.value === "   /*comment/"`
  - New hotness:
    - `combinator.value === " "`
    - `combinator.spaces.after === "  "`
    - `combinator.raws.spaces.after === "  /*comment*/"`
* `.a<newline>.b`: whitespace that doesn't start or end with a single space character is stored as a raw value.
  - Old & Busted:
    - `combinator.value === "\n"`
    - `combinator.raws.value === undefined`
  - New hotness:
    - `combinator.value === " "`
    - `combinator.raws.value === "\n"`

### Support for "Named Combinators"

Although, nonstandard and unlikely to ever become a standard, combinators like `/deep/` and `/for/` are now properly supported.

Because they've been taken off the standardization track, there is no spec-official name for combinators of the form `/<ident>/`. However, I talked to [Tab Atkins](https://twitter.com/tabatkins) and we agreed to call them "named combinators" so now they are called that.

Before this release such named combinators were parsed without intention and generated three nodes of type `"tag"` where the first and last nodes had a value of `"/"`.

* `.a /for/ .b` is parsed as a combinator.
  - Old & Busted:
    - `root.nodes[0].nodes[1].type === "tag"`
    - `root.nodes[0].nodes[1].value === "/"`
  - New hotness:
    - `root.nodes[0].nodes[1].type === "combinator"`
    - `root.nodes[0].nodes[1].value === "/for/"`
* `.a /F\6fR/ .b` escapes are handled and uppercase is normalized.
  - Old & Busted:
    - `root.nodes[0].nodes[2].type === "tag"`
    - `root.nodes[0].nodes[2].value === "F\\6fR"`
  - New hotness:
    - `root.nodes[0].nodes[1].type === "combinator"`
    - `root.nodes[0].nodes[1].value === "/for/"`
    - `root.nodes[0].nodes[1].raws.value === "/F\\6fR/"`

### Source position checks and lookups

A new API was added to look up a node based on the source location.

```js
const selectorParser = require("postcss-selector-parser");
// You can find the most specific node for any given character
let combinator = selectorParser.astSync(".a > .b").atPosition(1,4);
combinator.toString() === " > ";
// You can check if a node includes a specific character
// Whitespace surrounding the node that is owned by that node
// is included in the check.
[2,3,4,5,6].map(column => combinator.isAtPosition(1, column));
// => [false, true, true, true, false]
```

# 4.0.0

This release has **BREAKING CHANGES** that were required to fix bugs regarding values with escape sequences. Please read carefully.

* **Identifiers with escapes** - CSS escape sequences are now hidden from the public API by default.
  The normal value of a node like a class name or ID, or an aspect of a node such as attribute
  selector's value, is unescaped. Escapes representing Non-ascii characters are unescaped into
  unicode characters. For example: `bu\tton, .\31 00, #i\2764\FE0Fu, [attr="value is \"quoted\""]`
  will parse respectively to the values `button`, `100`, `i❤️u`, `value is "quoted"`.
  The original escape sequences for these values can be found in the corresponding property name
  in `node.raws`. Where possible, deprecation warnings were added, but the nature
  of escape handling makes it impossible to detect what is escaped or not. Our expectation is
  that most users are neither expecting nor handling escape sequences in their use of this library,
  and so for them, this is a bug fix. Users who are taking care to handle escapes correctly can
  now update their code to remove the escape handling and let us do it for them.

* **Mutating values with escapes** - When you make an update to a node property that has escape handling
  The value is assumed to be unescaped, and any special characters are escaped automatically and
  the corresponding `raws` value is immediately updated. This can result in changes to the original
  escape format. Where the exact value of the escape sequence is important there are methods that
  allow both values to be set in conjunction. There are a number of new convenience methods for
  manipulating values that involve escapes, especially for attributes values where the quote mark
  is involved. See https://github.com/postcss/postcss-selector-parser/pull/133 for an extensive
  write-up on these changes.


**Upgrade/API Example**

In `3.x` there was no unescape handling and internal consistency of several properties was the caller's job to maintain. It was very easy for the developer
to create a CSS file that did not parse correctly when some types of values
were in use.

```js
const selectorParser = require("postcss-selector-parser");
let attr = selectorParser.attribute({attribute: "id", operator: "=", value: "a-value"});
attr.value; // => "a-value"
attr.toString(); // => [id=a-value]
// Add quotes to an attribute's value.
// All these values have to be set by the caller to be consistent:
// no internal consistency is maintained.
attr.raws.unquoted = attr.value
attr.value = "'" + attr.value + "'";
attr.value; // => "'a-value'"
attr.quoted = true;
attr.toString();  // => "[id='a-value']"
```

In `4.0` there is a convenient API for setting and mutating values
that may need escaping. Especially for attributes.

```js
const selectorParser = require("postcss-selector-parser");

// The constructor requires you specify the exact escape sequence
let className = selectorParser.className({value: "illegal class name", raws: {value: "illegal\\ class\\ name"}});
className.toString(); // => '.illegal\\ class\\ name'

// So it's better to set the value as a property
className = selectorParser.className();
// Most properties that deal with identifiers work like this
className.value = "escape for me";
className.value; // => 'escape for me'
className.toString(); // => '.escape\\ for\\ me'

// emoji and all non-ascii are escaped to ensure it works in every css file.
className.value = "😱🦄😍";
className.value; // => '😱🦄😍'
className.toString(); // => '.\\1F631\\1F984\\1F60D'

// you can control the escape sequence if you want, or do bad bad things
className.setPropertyAndEscape('value', 'xxxx', 'yyyy');
className.value; // => "xxxx"
className.toString(); // => ".yyyy"

// Pass a value directly through to the css output without escaping it. 
className.setPropertyWithoutEscape('value', '$REPLACE_ME$');
className.value; // => "$REPLACE_ME$"
className.toString(); // => ".$REPLACE_ME$"

// The biggest changes are to the Attribute class
// passing quoteMark explicitly is required to avoid a deprecation warning.
let attr = selectorParser.attribute({attribute: "id", operator: "=", value: "a-value", quoteMark: null});
attr.toString(); // => "[id=a-value]"
// Get the value with quotes on it and any necessary escapes.
// This is the same as reading attr.value in 3.x.
attr.getQuotedValue(); // => "a-value";
attr.quoteMark; // => null

// Add quotes to an attribute's value.
attr.quoteMark = "'"; // This is all that's required.
attr.toString(); // => "[id='a-value']"
attr.quoted; // => true
// The value is still the same, only the quotes have changed.
attr.value; // => a-value
attr.getQuotedValue(); // => "'a-value'";

// deprecated assignment, no warning because there's no escapes
attr.value = "new-value";
// no quote mark is needed so it is removed
attr.getQuotedValue(); // => "new-value";

// deprecated assignment, 
attr.value = "\"a 'single quoted' value\"";
// > (node:27859) DeprecationWarning: Assigning an attribute a value containing characters that might need to be escaped is deprecated. Call attribute.setValue() instead.
attr.getQuotedValue(); // => '"a \'single quoted\' value"';
// quote mark inferred from first and last characters.
attr.quoteMark; // => '"'

// setValue takes options to make manipulating the value simple.
attr.setValue('foo', {smart: true});
// foo doesn't require any escapes or quotes.
attr.toString(); // => '[id=foo]'
attr.quoteMark; // => null 

// An explicit quote mark can be specified
attr.setValue('foo', {quoteMark: '"'});
attr.toString(); // => '[id="foo"]'

// preserves quote mark by default
attr.setValue('bar');
attr.toString(); // => '[id="bar"]'
attr.quoteMark = null;
attr.toString(); // => '[id=bar]'

// with no arguments, it preserves quote mark even when it's not a great idea
attr.setValue('a value \n that should be quoted');
attr.toString(); // => '[id=a\\ value\\ \\A\\ that\\ should\\ be\\ quoted]'

// smart preservation with a specified default
attr.setValue('a value \n that should be quoted', {smart: true, preferCurrentQuoteMark: true, quoteMark: "'"});
// => "[id='a value \\A  that should be quoted']"
attr.quoteMark = '"';
// => '[id="a value \\A  that should be quoted"]'

// this keeps double quotes because it wants to quote the value and the existing value has double quotes.
attr.setValue('this should be quoted', {smart: true, preferCurrentQuoteMark: true, quoteMark: "'"});
// => '[id="this should be quoted"]'

// picks single quotes because the value has double quotes
attr.setValue('a "double quoted" value', {smart: true, preferCurrentQuoteMark: true, quoteMark: "'"});
// => "[id='a "double quoted" value']"

// setPropertyAndEscape lets you do anything you want. Even things that are a bad idea and illegal.
attr.setPropertyAndEscape('value', 'xxxx', 'the password is 42');
attr.value; // => "xxxx"
attr.toString(); // => "[id=the password is 42]"

// Pass a value directly through to the css output without escaping it. 
attr.setPropertyWithoutEscape('value', '$REPLACEMENT$');
attr.value; // => "$REPLACEMENT$"
attr.toString(); // => "[id=$REPLACEMENT$]"
```

# 3.1.2

* Fix: Removed dot-prop dependency since it's no longer written in es5.

# 3.1.1

* Fix: typescript definitions weren't in the published package.

# 3.1.0

* Fixed numerous bugs in attribute nodes relating to the handling of comments
  and whitespace. There's significant changes to `attrNode.spaces` and `attrNode.raws` since the `3.0.0` release.
* Added `Attribute#offsetOf(part)` to get the offset location of
  attribute parts like `"operator"` and `"value"`. This is most
  often added to `Attribute#sourceIndex` for error reporting.

# 3.0.0

## Breaking changes

* Some tweaks to the tokenizer/attribute selector parsing mean that whitespace
  locations might be slightly different to the 2.x code.
* Better attribute selector parsing with more validation; postcss-selector-parser
  no longer uses regular expressions to parse attribute selectors.
* Added an async API (thanks to @jacobp100); the default `process` API is now
  async, and the sync API is now accessed through `processSync` instead.
* `process()` and `processSync()` now return a string instead of the Processor
  instance.
* Tweaks handling of Less interpolation (thanks to @jwilsson).
* Removes support for Node 0.12.

## Other changes

* `ast()` and `astSync()` methods have been added to the `Processor`. These
  return the `Root` node of the selectors after processing them.
* `transform()` and `transformSync()` methods have been added to the
  `Processor`. These return the value returned by the processor callback
  after processing the selectors.
* Set the parent when inserting a node (thanks to @chriseppstein).
* Correctly adjust indices when using insertBefore/insertAfter (thanks to @tivac).
* Fixes handling of namespaces with qualified tag selectors.
* `process`, `ast` and `transform` (and their sync variants) now accept a
  `postcss` rule node. When provided, better errors are generated and selector
  processing is automatically set back to the rule selector (unless the `updateSelector` option is set to `false`.)
* Now more memory efficient when tokenizing selectors.

### Upgrade hints

The pattern of:

`rule.selector = processor.process(rule.selector).result.toString();`

is now:

`processor.processSync(rule)`

# 2.2.3

* Resolves an issue where the parser would not reduce multiple spaces between an
  ampersand and another simple selector in lossy mode (thanks to @adam-26).

# 2.2.2

* No longer hangs on an unescaped semicolon; instead the parser will throw
  an exception for these cases.

# 2.2.1

* Allows a consumer to specify whitespace tokens when creating a new Node
  (thanks to @Semigradsky).

# 2.2.0

* Added a new option to normalize whitespace when parsing the selector string
  (thanks to @adam-26).

# 2.1.1

* Better unquoted value handling within attribute selectors
  (thanks to @evilebottnawi).

# 2.1.0

* Added: Use string constants for all node types & expose them on the main
  parser instance (thanks to @Aweary).

# 2.0.0

This release contains the following breaking changes:

* Renamed all `eachInside` iterators to `walk`. For example, `eachTag` is now
  `walkTags`, and `eachInside` is now `walk`.
* Renamed `Node#removeSelf()` to `Node#remove()`.
* Renamed `Container#remove()` to `Container#removeChild()`.
* Renamed `Node#raw` to `Node#raws` (thanks to @davidtheclark).
* Now parses `&` as the *nesting* selector, rather than a *tag* selector.
* Fixes misinterpretation of Sass interpolation (e.g. `#{foo}`) as an
  id selector (thanks to @davidtheclark).

and;

* Fixes parsing of attribute selectors with equals signs in them
  (e.g. `[data-attr="foo=bar"]`) (thanks to @montmanu).
* Adds `quoted` and `raw.unquoted` properties to attribute nodes
  (thanks to @davidtheclark).

# 1.3.3

* Fixes an infinite loop on `)` and `]` tokens when they had no opening pairs.
  Now postcss-selector-parser will throw when it encounters these lone tokens.

# 1.3.2

* Now uses plain integers rather than `str.charCodeAt(0)` for compiled builds.

# 1.3.1

* Update flatten to v1.x (thanks to @shinnn).

# 1.3.0

* Adds a new node type, `String`, to fix a crash on selectors such as
  `foo:bar("test")`.

# 1.2.1

* Fixes a crash when the parser encountered a trailing combinator.

# 1.2.0

* A more descriptive error is thrown when the parser expects to find a
  pseudo-class/pseudo-element (thanks to @ashelley).
* Adds support for line/column locations for selector nodes, as well as a
  `Node#sourceIndex` method (thanks to @davidtheclark).

# 1.1.4

* Fixes a crash when a selector started with a `>` combinator. The module will
  now no longer throw if a selector has a leading/trailing combinator node.

# 1.1.3

* Fixes a crash on `@` tokens.

# 1.1.2

* Fixes an infinite loop caused by using parentheses in a non-pseudo element
  context.

# 1.1.1

* Fixes a crash when a backslash ended a selector string.

# 1.1.0

* Adds support for replacing multiple nodes at once with `replaceWith`
  (thanks to @jonathantneal).
* Parser no longer throws on sequential IDs and trailing commas, to support
  parsing of selector hacks.

# 1.0.1

* Fixes using `insertAfter` and `insertBefore` during iteration.

# 1.0.0

* Adds `clone` and `replaceWith` methods to nodes.
* Adds `insertBefore` and `insertAfter` to containers.
* Stabilises API.

# 0.0.5

* Fixes crash on extra whitespace inside a pseudo selector's parentheses.
* Adds sort function to the container class.
* Enables the parser to pass its input through without transforming.
* Iteration-safe `each` and `eachInside`.

# 0.0.4

* Tidy up redundant duplication.
* Fixes a bug where the parser would loop infinitely on universal selectors
  inside pseudo selectors.
* Adds `length` getter and `eachInside`, `map`, `reduce` to the container class.
* When a selector has been removed from the tree, the root node will no longer
  cast it to a string.
* Adds node type iterators to the container class (e.g. `eachComment`).
* Adds filter function to the container class.
* Adds split function to the container class.
* Create new node types by doing `parser.id(opts)` etc.
* Adds support for pseudo classes anywhere in the selector.

# 0.0.3

* Adds `next` and `prev` to the node class.
* Adds `first` and `last` getters to the container class.
* Adds `every` and `some` iterators to the container class.
* Add `empty` alias for `removeAll`.
* Combinators are now types of node.
* Fixes the at method so that it is not an alias for `index`.
* Tidy up creation of new nodes in the parser.
* Refactors how namespaces are handled for consistency & less redundant code.
* Refactors AST to use `nodes` exclusively, and eliminates excessive nesting.
* Fixes nested pseudo parsing.
* Fixes whitespace parsing.

# 0.0.2

* Adds support for namespace selectors.
* Adds support for selectors joined by escaped spaces - such as `.\31\ 0`.

# 0.0.1

* Initial release.
#x# postcss-selector-parser

[![npm package version](https://img.shields.io/github/package-json/v/postcss/postcss-selector-parser) ![npm downloads](https://img.shields.io/npm/dm/postcss-selector-parser)](https://www.npmjs.com/package/postcss-selector-parser)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/postcss/postcss-selector-parser/test.yml)](https://github.com/postcss/postcss-selector-parser/actions)
[![License](https://img.shields.io/github/license/postcss/postcss-selector-parser)](https://github.com/postcss/postcss-selector-parser)  

> Selector parser with built in methods for working with selector strings.

## Install

With [npm](https://npmjs.com/package/postcss-selector-parser) do:

```
npm install postcss-selector-parser
```

## Quick Start

```js
const parser = require('postcss-selector-parser');
const transform = selectors => {
    selectors.walk(selector => {
        // do something with the selector
        console.log(String(selector))
    });
};

const transformed = parser(transform).processSync('h1, h2, h3');
```

To normalize selector whitespace:

```js
const parser = require('postcss-selector-parser');
const normalized = parser().processSync('h1, h2, h3', {lossless: false});
// -> h1,h2,h3
```

Async support is provided through `parser.process` and will resolve a Promise
with the resulting selector string.

## API

Please see [API.md](API.md).

## Security

### Selector nesting depth (CVE-2026-9358)

The parser walks the selector AST recursively, both when parsing and when
serializing it back to a string (`.toString()`). In versions up to and
including `7.1.1`, a selector with extreme nesting — for example thousands of
nested `:not(...)` — could recurse deeply enough to overflow the call stack and
throw `RangeError: Maximum call stack size exceeded`, a potential
denial-of-service when processing untrusted CSS.

This is now bounded by a maximum nesting depth (default: `256`). Beyond that
depth, parsing and serialization throw a regular, catchable `Error` at a
predictable point instead of relying on the runtime hitting its stack limit.
The default is far above any realistic selector, so it does not affect normal
use.

**Practical impact is low.** The only attacker-controlled input is the selector
string itself, which is now capped by the default limit. The limit is
adjustable through the `maxNestingDepth` option, but that option is trusted
configuration provided by the integrating code — it is never derived from the
parsed CSS, so a malicious selector cannot change it:

```js
// Tighten the limit when parsing untrusted input:
parser().processSync(untrustedSelector, {maxNestingDepth: 128});
```

Raising `maxNestingDepth` to a very large value is an explicit, informed choice
and can reintroduce the stack-overflow risk in environments with a small call
stack (e.g. browser workers). The default is recommended unless you have a
specific need.

## Credits

* Huge thanks to Andrey Sitnik (@ai) for work on PostCSS which helped
  accelerate this module's development.

## License

MIT
OGx0100644 index.js ת)s,ق100644 parser.js bz<*vA C5100644 processor.js `i<p]Kf2~m2XKC40000 selectors vkPԾV100644 sortAscending.js n|Fnڋ;5$G100644 tokenTypes.js :w	>$H{nRbb100644 tokenize.js c4oqR5fX40000 util , IcEWƄ '\r~ױrx!"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
var processor_1 = __importDefault(require("./processor"));
var selectors = __importStar(require("./selectors"));
var parser = function (processor) { return new processor_1.default(processor); };
Object.assign(parser, selectors);
delete parser.__esModule;
module.exports = parser;
//# sourceMappingURL=index.js.mapBBx[G"use strict";
var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
var __read = (this && this.__read) || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
};
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
        if (ar || !(i in from)) {
            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
            ar[i] = from[i];
        }
    }
    return to.concat(ar || Array.prototype.slice.call(from));
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
var _a, _b;
Object.defineProperty(exports, "__esModule", { value: true });
var root_1 = __importDefault(require("./selectors/root"));
var selector_1 = __importDefault(require("./selectors/selector"));
var className_1 = __importDefault(require("./selectors/className"));
var comment_1 = __importDefault(require("./selectors/comment"));
var id_1 = __importDefault(require("./selectors/id"));
var tag_1 = __importDefault(require("./selectors/tag"));
var string_1 = __importDefault(require("./selectors/string"));
var pseudo_1 = __importDefault(require("./selectors/pseudo"));
var attribute_1 = __importStar(require("./selectors/attribute"));
var universal_1 = __importDefault(require("./selectors/universal"));
var combinator_1 = __importDefault(require("./selectors/combinator"));
var nesting_1 = __importDefault(require("./selectors/nesting"));
var sortAscending_1 = __importDefault(require("./sortAscending"));
var tokenize_1 = __importStar(require("./tokenize"));
var tokens = __importStar(require("./tokenTypes"));
var types = __importStar(require("./selectors/types"));
var util_1 = require("./util");
var WHITESPACE_TOKENS = (_a = {},
    _a[tokens.space] = true,
    _a[tokens.cr] = true,
    _a[tokens.feed] = true,
    _a[tokens.newline] = true,
    _a[tokens.tab] = true,
    _a);
var WHITESPACE_EQUIV_TOKENS = __assign(__assign({}, WHITESPACE_TOKENS), (_b = {}, _b[tokens.comment] = true, _b));
function tokenStart(token) {
    return {
        line: token[tokenize_1.FIELDS.START_LINE],
        column: token[tokenize_1.FIELDS.START_COL],
    };
}
function tokenEnd(token) {
    return {
        line: token[tokenize_1.FIELDS.END_LINE],
        column: token[tokenize_1.FIELDS.END_COL],
    };
}
function getSource(startLine, startColumn, endLine, endColumn) {
    return {
        start: {
            line: startLine,
            column: startColumn,
        },
        end: {
            line: endLine,
            column: endColumn,
        },
    };
}
function getTokenSource(token) {
    return getSource(token[tokenize_1.FIELDS.START_LINE], token[tokenize_1.FIELDS.START_COL], token[tokenize_1.FIELDS.END_LINE], token[tokenize_1.FIELDS.END_COL]);
}
function getTokenSourceSpan(startToken, endToken) {
    if (!startToken) {
        return undefined;
    }
    return getSource(startToken[tokenize_1.FIELDS.START_LINE], startToken[tokenize_1.FIELDS.START_COL], endToken[tokenize_1.FIELDS.END_LINE], endToken[tokenize_1.FIELDS.END_COL]);
}
function unescapeProp(node, prop) {
    var value = node[prop];
    if (typeof value !== "string") {
        return;
    }
    if (value.indexOf("\\") !== -1) {
        (0, util_1.ensureObject)(node, "raws");
        node[prop] = (0, util_1.unesc)(value);
        if (node.raws[prop] === undefined) {
            node.raws[prop] = value;
        }
    }
    return node;
}
function indexesOf(array, item) {
    var i = -1;
    var indexes = [];
    while ((i = array.indexOf(item, i + 1)) !== -1) {
        indexes.push(i);
    }
    return indexes;
}
function uniqs() {
    var list = Array.prototype.concat.apply([], arguments);
    return list.filter(function (item, i) { return i === list.indexOf(item); });
}
var Parser = /** @class */ (function () {
    function Parser(rule, options) {
        if (options === void 0) { options = {}; }
        this.rule = rule;
        this.options = Object.assign({ lossy: false, safe: false }, options);
        this.position = 0;
        this.nestingDepth = 0;
        this.maxNestingDepth = (0, util_1.resolveMaxNestingDepth)(this.options.maxNestingDepth);
        this.css = typeof this.rule === "string" ? this.rule : this.rule.selector;
        this.tokens = (0, tokenize_1.default)({
            css: this.css,
            error: this._errorGenerator(),
            safe: this.options.safe,
        });
        var rootSource = getTokenSourceSpan(this.tokens[0], this.tokens[this.tokens.length - 1]);
        this.root = new root_1.default({ source: rootSource });
        this.root.errorGenerator = this._errorGenerator();
        var selector = new selector_1.default({
            source: { start: { line: 1, column: 1 } },
            sourceIndex: 0,
        });
        this.root.append(selector);
        this.current = selector;
        this.loop();
    }
    Parser.prototype._errorGenerator = function () {
        var _this = this;
        return function (message, errorOptions) {
            if (typeof _this.rule === "string") {
                return new Error(message);
            }
            return _this.rule.error(message, errorOptions);
        };
    };
    Parser.prototype.attribute = function () {
        var attr = [];
        var startingToken = this.currToken;
        this.position++;
        while (this.position < this.tokens.length &&
            this.currToken[tokenize_1.FIELDS.TYPE] !== tokens.closeSquare) {
            attr.push(this.currToken);
            this.position++;
        }
        if (this.currToken[tokenize_1.FIELDS.TYPE] !== tokens.closeSquare) {
            return this.expected("closing square bracket", this.currToken[tokenize_1.FIELDS.START_POS]);
        }
        var len = attr.length;
        var node = {
            source: getSource(startingToken[1], startingToken[2], this.currToken[3], this.currToken[4]),
            sourceIndex: startingToken[tokenize_1.FIELDS.START_POS],
        };
        if (len === 1 && !~[tokens.word].indexOf(attr[0][tokenize_1.FIELDS.TYPE])) {
            return this.expected("attribute", attr[0][tokenize_1.FIELDS.START_POS]);
        }
        var pos = 0;
        var spaceBefore = "";
        var commentBefore = "";
        var lastAdded = null;
        var spaceAfterMeaningfulToken = false;
        while (pos < len) {
            var token = attr[pos];
            var content = this.content(token);
            var next = attr[pos + 1];
            switch (token[tokenize_1.FIELDS.TYPE]) {
                case tokens.space:
                    // if (
                    //     len === 1 ||
                    //     pos === 0 && this.content(next) === '|'
                    // ) {
                    //     return this.expected('attribute', token[TOKEN.START_POS], content);
                    // }
                    spaceAfterMeaningfulToken = true;
                    if (this.options.lossy) {
                        break;
                    }
                    if (lastAdded) {
                        (0, util_1.ensureObject)(node, "spaces", lastAdded);
                        var prevContent = node.spaces[lastAdded].after || "";
                        node.spaces[lastAdded].after = prevContent + content;
                        var existingComment = (0, util_1.getProp)(node, "raws", "spaces", lastAdded, "after") || null;
                        if (existingComment) {
                            node.raws.spaces[lastAdded].after = existingComment + content;
                        }
                    }
                    else {
                        spaceBefore = spaceBefore + content;
                        commentBefore = commentBefore + content;
                    }
                    break;
                case tokens.asterisk:
                    if (next[tokenize_1.FIELDS.TYPE] === tokens.equals) {
                        node.operator = content;
                        lastAdded = "operator";
                    }
                    else if ((!node.namespace || (lastAdded === "namespace" && !spaceAfterMeaningfulToken)) &&
                        next) {
                        if (spaceBefore) {
                            (0, util_1.ensureObject)(node, "spaces", "attribute");
                            node.spaces.attribute.before = spaceBefore;
                            spaceBefore = "";
                        }
                        if (commentBefore) {
                            (0, util_1.ensureObject)(node, "raws", "spaces", "attribute");
                            node.raws.spaces.attribute.before = spaceBefore;
                            commentBefore = "";
                        }
                        node.namespace = (node.namespace || "") + content;
                        var rawValue = (0, util_1.getProp)(node, "raws", "namespace") || null;
                        if (rawValue) {
                            node.raws.namespace += content;
                        }
                        lastAdded = "namespace";
                    }
                    spaceAfterMeaningfulToken = false;
                    break;
                case tokens.dollar:
                    if (lastAdded === "value") {
                        var oldRawValue = (0, util_1.getProp)(node, "raws", "value");
                        node.value += "$";
                        if (oldRawValue) {
                            node.raws.value = oldRawValue + "$";
                        }
                        break;
                    }
                // Falls through
                case tokens.caret:
                    if (next[tokenize_1.FIELDS.TYPE] === tokens.equals) {
                        node.operator = content;
                        lastAdded = "operator";
                    }
                    spaceAfterMeaningfulToken = false;
                    break;
                case tokens.combinator:
                    if (content === "~" && next[tokenize_1.FIELDS.TYPE] === tokens.equals) {
                        node.operator = content;
                        lastAdded = "operator";
                    }
                    if (content !== "|") {
                        spaceAfterMeaningfulToken = false;
                        break;
                    }
                    if (next[tokenize_1.FIELDS.TYPE] === tokens.equals) {
                        node.operator = content;
                        lastAdded = "operator";
                    }
                    else if (!node.namespace && !node.attribute) {
                        node.namespace = true;
                    }
                    spaceAfterMeaningfulToken = false;
                    break;
                case tokens.word:
                    if (next &&
                        this.content(next) === "|" &&
                        attr[pos + 2] &&
                        attr[pos + 2][tokenize_1.FIELDS.TYPE] !== tokens.equals && // this look-ahead probably fails with comment nodes involved.
                        !node.operator &&
                        !node.namespace) {
                        node.namespace = content;
                        lastAdded = "namespace";
                    }
                    else if (!node.attribute || (lastAdded === "attribute" && !spaceAfterMeaningfulToken)) {
                        if (spaceBefore) {
                            (0, util_1.ensureObject)(node, "spaces", "attribute");
                            node.spaces.attribute.before = spaceBefore;
                            spaceBefore = "";
                        }
                        if (commentBefore) {
                            (0, util_1.ensureObject)(node, "raws", "spaces", "attribute");
                            node.raws.spaces.attribute.before = commentBefore;
                            commentBefore = "";
                        }
                        node.attribute = (node.attribute || "") + content;
                        var rawValue = (0, util_1.getProp)(node, "raws", "attribute") || null;
                        if (rawValue) {
                            node.raws.attribute += content;
                        }
                        lastAdded = "attribute";
                    }
                    else if ((!node.value && node.value !== "") ||
                        (lastAdded === "value" && !(spaceAfterMeaningfulToken || node.quoteMark))) {
                        var unescaped_1 = (0, util_1.unesc)(content);
                        var oldRawValue = (0, util_1.getProp)(node, "raws", "value") || "";
                        var oldValue = node.value || "";
                        node.value = oldValue + unescaped_1;
                        node.quoteMark = null;
                        if (unescaped_1 !== content || oldRawValue) {
                            (0, util_1.ensureObject)(node, "raws");
                            node.raws.value = (oldRawValue || oldValue) + content;
                        }
                        lastAdded = "value";
                    }
                    else {
                        var insensitive = content === "i" || content === "I";
                        if ((node.value || node.value === "") &&
                            (node.quoteMark || spaceAfterMeaningfulToken)) {
                            node.insensitive = insensitive;
                            if (!insensitive || content === "I") {
                                (0, util_1.ensureObject)(node, "raws");
                                node.raws.insensitiveFlag = content;
                            }
                            lastAdded = "insensitive";
                            if (spaceBefore) {
                                (0, util_1.ensureObject)(node, "spaces", "insensitive");
                                node.spaces.insensitive.before = spaceBefore;
                                spaceBefore = "";
                            }
                            if (commentBefore) {
                                (0, util_1.ensureObject)(node, "raws", "spaces", "insensitive");
                                node.raws.spaces.insensitive.before = commentBefore;
                                commentBefore = "";
                            }
                        }
                        else if (node.value || node.value === "") {
                            lastAdded = "value";
                            node.value += content;
                            if (node.raws.value) {
                                node.raws.value += content;
                            }
                        }
                    }
                    spaceAfterMeaningfulToken = false;
                    break;
                case tokens.str:
                    if (!node.attribute || !node.operator) {
                        return this.error("Expected an attribute followed by an operator preceding the string.", {
                            index: token[tokenize_1.FIELDS.START_POS],
                        });
                    }
                    var _a = (0, attribute_1.unescapeValue)(content), unescaped = _a.unescaped, quoteMark = _a.quoteMark;
                    node.value = unescaped;
                    node.quoteMark = quoteMark;
                    lastAdded = "value";
                    (0, util_1.ensureObject)(node, "raws");
                    node.raws.value = content;
                    spaceAfterMeaningfulToken = false;
                    break;
                case tokens.equals:
                    if (!node.attribute) {
                        return this.expected("attribute", token[tokenize_1.FIELDS.START_POS], content);
                    }
                    if (node.value) {
                        return this.error('Unexpected "=" found; an operator was already defined.', {
                            index: token[tokenize_1.FIELDS.START_POS],
                        });
                    }
                    node.operator = node.operator ? node.operator + content : content;
                    lastAdded = "operator";
                    spaceAfterMeaningfulToken = false;
                    break;
                case tokens.comment:
                    if (lastAdded) {
                        if (spaceAfterMeaningfulToken ||
                            (next && next[tokenize_1.FIELDS.TYPE] === tokens.space) ||
                            lastAdded === "insensitive") {
                            var lastComment = (0, util_1.getProp)(node, "spaces", lastAdded, "after") || "";
                            var rawLastComment = (0, util_1.getProp)(node, "raws", "spaces", lastAdded, "after") || lastComment;
                            (0, util_1.ensureObject)(node, "raws", "spaces", lastAdded);
                            node.raws.spaces[lastAdded].after = rawLastComment + content;
                        }
                        else {
                            var lastValue = node[lastAdded] || "";
                            var rawLastValue = (0, util_1.getProp)(node, "raws", lastAdded) || lastValue;
                            (0, util_1.ensureObject)(node, "raws");
                            node.raws[lastAdded] = rawLastValue + content;
                        }
                    }
                    else {
                        commentBefore = commentBefore + content;
                    }
                    break;
                default:
                    return this.error("Unexpected \"".concat(content, "\" found."), { index: token[tokenize_1.FIELDS.START_POS] });
            }
            pos++;
        }
        unescapeProp(node, "attribute");
        unescapeProp(node, "namespace");
        this.newNode(new attribute_1.default(node));
        this.position++;
    };
    /**
     * return a node containing meaningless garbage up to (but not including) the specified token position.
     * if the token position is negative, all remaining tokens are consumed.
     *
     * This returns an array containing a single string node if all whitespace,
     * otherwise an array of comment nodes with space before and after.
     *
     * These tokens are not added to the current selector, the caller can add them or use them to amend
     * a previous node's space metadata.
     *
     * In lossy mode, this returns only comments.
     */
    Parser.prototype.parseWhitespaceEquivalentTokens = function (stopPosition) {
        if (stopPosition < 0) {
            stopPosition = this.tokens.length;
        }
        var startPosition = this.position;
        var nodes = [];
        var space = "";
        var lastComment = undefined;
        do {
            if (WHITESPACE_TOKENS[this.currToken[tokenize_1.FIELDS.TYPE]]) {
                if (!this.options.lossy) {
                    space += this.content();
                }
            }
            else if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.comment) {
                var spaces = {};
                if (space) {
                    spaces.before = space;
                    space = "";
                }
                lastComment = new comment_1.default({
                    value: this.content(),
                    source: getTokenSource(this.currToken),
                    sourceIndex: this.currToken[tokenize_1.FIELDS.START_POS],
                    spaces: spaces,
                });
                nodes.push(lastComment);
            }
        } while (++this.position < stopPosition);
        if (space) {
            if (lastComment) {
                lastComment.spaces.after = space;
            }
            else if (!this.options.lossy) {
                var firstToken = this.tokens[startPosition];
                var lastToken = this.tokens[this.position - 1];
                nodes.push(new string_1.default({
                    value: "",
                    source: getSource(firstToken[tokenize_1.FIELDS.START_LINE], firstToken[tokenize_1.FIELDS.START_COL], lastToken[tokenize_1.FIELDS.END_LINE], lastToken[tokenize_1.FIELDS.END_COL]),
                    sourceIndex: firstToken[tokenize_1.FIELDS.START_POS],
                    spaces: { before: space, after: "" },
                }));
            }
        }
        return nodes;
    };
    /**
     *
     * @param {*} nodes
     */
    Parser.prototype.convertWhitespaceNodesToSpace = function (nodes, requiredSpace) {
        var _this = this;
        if (requiredSpace === void 0) { requiredSpace = false; }
        var space = "";
        var rawSpace = "";
        nodes.forEach(function (n) {
            var spaceBefore = _this.lossySpace(n.spaces.before, requiredSpace);
            var rawSpaceBefore = _this.lossySpace(n.rawSpaceBefore, requiredSpace);
            space +=
                spaceBefore + _this.lossySpace(n.spaces.after, requiredSpace && spaceBefore.length === 0);
            rawSpace +=
                spaceBefore +
                    n.value +
                    _this.lossySpace(n.rawSpaceAfter, requiredSpace && rawSpaceBefore.length === 0);
        });
        if (rawSpace === space) {
            rawSpace = undefined;
        }
        var result = { space: space, rawSpace: rawSpace };
        return result;
    };
    Parser.prototype.isNamedCombinator = function (position) {
        if (position === void 0) { position = this.position; }
        return (this.tokens[position + 0] &&
            this.tokens[position + 0][tokenize_1.FIELDS.TYPE] === tokens.slash &&
            this.tokens[position + 1] &&
            this.tokens[position + 1][tokenize_1.FIELDS.TYPE] === tokens.word &&
            this.tokens[position + 2] &&
            this.tokens[position + 2][tokenize_1.FIELDS.TYPE] === tokens.slash);
    };
    Parser.prototype.namedCombinator = function () {
        if (this.isNamedCombinator()) {
            var nameRaw = this.content(this.tokens[this.position + 1]);
            var name = (0, util_1.unesc)(nameRaw).toLowerCase();
            var raws = {};
            if (name !== nameRaw) {
                raws.value = "/".concat(nameRaw, "/");
            }
            var node = new combinator_1.default({
                value: "/".concat(name, "/"),
                source: getSource(this.currToken[tokenize_1.FIELDS.START_LINE], this.currToken[tokenize_1.FIELDS.START_COL], this.tokens[this.position + 2][tokenize_1.FIELDS.END_LINE], this.tokens[this.position + 2][tokenize_1.FIELDS.END_COL]),
                sourceIndex: this.currToken[tokenize_1.FIELDS.START_POS],
                raws: raws,
            });
            this.position = this.position + 3;
            return node;
        }
        else {
            this.unexpected();
        }
    };
    Parser.prototype.combinator = function () {
        var _this = this;
        if (this.content() === "|") {
            return this.namespace();
        }
        // We need to decide between a space that's a descendant combinator and meaningless whitespace at the end of a selector.
        var nextSigTokenPos = this.locateNextMeaningfulToken(this.position);
        if (nextSigTokenPos < 0 ||
            this.tokens[nextSigTokenPos][tokenize_1.FIELDS.TYPE] === tokens.comma ||
            this.tokens[nextSigTokenPos][tokenize_1.FIELDS.TYPE] === tokens.closeParenthesis) {
            var nodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos);
            if (nodes.length > 0) {
                var last = this.current.last;
                if (last) {
                    var _a = this.convertWhitespaceNodesToSpace(nodes), space = _a.space, rawSpace = _a.rawSpace;
                    if (rawSpace !== undefined) {
                        last.rawSpaceAfter += rawSpace;
                    }
                    last.spaces.after += space;
                }
                else {
                    nodes.forEach(function (n) { return _this.newNode(n); });
                }
            }
            return;
        }
        var firstToken = this.currToken;
        var spaceOrDescendantSelectorNodes = undefined;
        if (nextSigTokenPos > this.position) {
            spaceOrDescendantSelectorNodes = this.parseWhitespaceEquivalentTokens(nextSigTokenPos);
        }
        var node;
        if (this.isNamedCombinator()) {
            node = this.namedCombinator();
        }
        else if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.combinator) {
            node = new combinator_1.default({
                value: this.content(),
                source: getTokenSource(this.currToken),
                sourceIndex: this.currToken[tokenize_1.FIELDS.START_POS],
            });
            this.position++;
        }
        else if (WHITESPACE_TOKENS[this.currToken[tokenize_1.FIELDS.TYPE]]) {
            // pass
        }
        else if (!spaceOrDescendantSelectorNodes) {
            this.unexpected();
        }
        if (node) {
            if (spaceOrDescendantSelectorNodes) {
                var _b = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes), space = _b.space, rawSpace = _b.rawSpace;
                node.spaces.before = space;
                node.rawSpaceBefore = rawSpace;
            }
        }
        else {
            // descendant combinator
            var _c = this.convertWhitespaceNodesToSpace(spaceOrDescendantSelectorNodes, true), space = _c.space, rawSpace = _c.rawSpace;
            if (!rawSpace) {
                rawSpace = space;
            }
            var spaces = {};
            var raws = { spaces: {} };
            if (space.endsWith(" ") && rawSpace.endsWith(" ")) {
                spaces.before = space.slice(0, space.length - 1);
                raws.spaces.before = rawSpace.slice(0, rawSpace.length - 1);
            }
            else if (space[0] === " " && rawSpace[0] === " ") {
                spaces.after = space.slice(1);
                raws.spaces.after = rawSpace.slice(1);
            }
            else {
                raws.value = rawSpace;
            }
            node = new combinator_1.default({
                value: " ",
                source: getTokenSourceSpan(firstToken, this.tokens[this.position - 1]),
                sourceIndex: firstToken[tokenize_1.FIELDS.START_POS],
                spaces: spaces,
                raws: raws,
            });
        }
        if (this.currToken && this.currToken[tokenize_1.FIELDS.TYPE] === tokens.space) {
            node.spaces.after = this.optionalSpace(this.content());
            this.position++;
        }
        return this.newNode(node);
    };
    Parser.prototype.comma = function () {
        if (this.position === this.tokens.length - 1) {
            this.root.trailingComma = true;
            this.position++;
            return;
        }
        this.current._inferEndPosition();
        var selector = new selector_1.default({
            source: {
                start: tokenStart(this.tokens[this.position + 1]),
            },
            sourceIndex: this.tokens[this.position + 1][tokenize_1.FIELDS.START_POS],
        });
        this.current.parent.append(selector);
        this.current = selector;
        this.position++;
    };
    Parser.prototype.comment = function () {
        var current = this.currToken;
        this.newNode(new comment_1.default({
            value: this.content(),
            source: getTokenSource(current),
            sourceIndex: current[tokenize_1.FIELDS.START_POS],
        }));
        this.position++;
    };
    Parser.prototype.error = function (message, opts) {
        throw this.root.error(message, opts);
    };
    Parser.prototype.missingBackslash = function () {
        return this.error("Expected a backslash preceding the semicolon.", {
            index: this.currToken[tokenize_1.FIELDS.START_POS],
        });
    };
    Parser.prototype.missingParenthesis = function () {
        return this.expected("opening parenthesis", this.currToken[tokenize_1.FIELDS.START_POS]);
    };
    Parser.prototype.missingSquareBracket = function () {
        return this.expected("opening square bracket", this.currToken[tokenize_1.FIELDS.START_POS]);
    };
    Parser.prototype.unexpected = function () {
        return this.error("Unexpected '".concat(this.content(), "'. Escaping special characters with \\ may help."), this.currToken[tokenize_1.FIELDS.START_POS]);
    };
    Parser.prototype.unexpectedPipe = function () {
        return this.error("Unexpected '|'.", this.currToken[tokenize_1.FIELDS.START_POS]);
    };
    Parser.prototype.namespace = function () {
        var before = (this.prevToken && this.content(this.prevToken)) || true;
        if (this.nextToken[tokenize_1.FIELDS.TYPE] === tokens.word) {
            this.position++;
            return this.word(before);
        }
        else if (this.nextToken[tokenize_1.FIELDS.TYPE] === tokens.asterisk) {
            this.position++;
            return this.universal(before);
        }
        this.unexpectedPipe();
    };
    Parser.prototype.nesting = function () {
        if (this.nextToken) {
            var nextContent = this.content(this.nextToken);
            if (nextContent === "|") {
                this.position++;
                return;
            }
        }
        var current = this.currToken;
        this.newNode(new nesting_1.default({
            value: this.content(),
            source: getTokenSource(current),
            sourceIndex: current[tokenize_1.FIELDS.START_POS],
        }));
        this.position++;
    };
    Parser.prototype.parentheses = function () {
        var last = this.current.last;
        var unbalanced = 1;
        this.position++;
        if (last && last.type === types.PSEUDO) {
            var selector = new selector_1.default({
                source: { start: tokenStart(this.tokens[this.position]) },
                sourceIndex: this.tokens[this.position][tokenize_1.FIELDS.START_POS],
            });
            var cache = this.current;
            last.append(selector);
            this.current = selector;
            // Track nesting depth so deeply nested pseudo selectors raise a
            // catchable error instead of overflowing the call stack. The
            // counter is restored in `finally` so the parser is never left in
            // an inconsistent state, even on the error path.
            this.nestingDepth++;
            try {
                if (this.nestingDepth > this.maxNestingDepth) {
                    this.error("Cannot parse selector: nesting depth exceeds the maximum of ".concat(this.maxNestingDepth, "."), { index: this.currToken[tokenize_1.FIELDS.START_POS] });
                }
                while (this.position < this.tokens.length && unbalanced) {
                    if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.openParenthesis) {
                        unbalanced++;
                    }
                    if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.closeParenthesis) {
                        unbalanced--;
                    }
                    if (unbalanced) {
                        this.parse();
                    }
                    else {
                        this.current.source.end = tokenEnd(this.currToken);
                        this.current.parent.source.end = tokenEnd(this.currToken);
                        this.position++;
                    }
                }
            }
            finally {
                this.nestingDepth--;
            }
            this.current = cache;
        }
        else {
            // I think this case should be an error. It's used to implement a basic parse of media queries
            // but I don't think it's a good idea.
            var parenStart = this.currToken;
            var parenValue = "(";
            var parenEnd = void 0;
            while (this.position < this.tokens.length && unbalanced) {
                if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.openParenthesis) {
                    unbalanced++;
                }
                if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.closeParenthesis) {
                    unbalanced--;
                }
                parenEnd = this.currToken;
                parenValue += this.parseParenthesisToken(this.currToken);
                this.position++;
            }
            if (last) {
                last.appendToPropertyAndEscape("value", parenValue, parenValue);
            }
            else {
                this.newNode(new string_1.default({
                    value: parenValue,
                    source: getSource(parenStart[tokenize_1.FIELDS.START_LINE], parenStart[tokenize_1.FIELDS.START_COL], parenEnd[tokenize_1.FIELDS.END_LINE], parenEnd[tokenize_1.FIELDS.END_COL]),
                    sourceIndex: parenStart[tokenize_1.FIELDS.START_POS],
                }));
            }
        }
        if (unbalanced) {
            return this.expected("closing parenthesis", this.currToken[tokenize_1.FIELDS.START_POS]);
        }
    };
    Parser.prototype.pseudo = function () {
        var _this = this;
        var pseudoStr = "";
        var startingToken = this.currToken;
        while (this.currToken && this.currToken[tokenize_1.FIELDS.TYPE] === tokens.colon) {
            pseudoStr += this.content();
            this.position++;
        }
        if (!this.currToken) {
            return this.expected(["pseudo-class", "pseudo-element"], this.position - 1);
        }
        if (this.currToken[tokenize_1.FIELDS.TYPE] === tokens.word) {
            this.splitWord(false, function (first, length) {
                pseudoStr += first;
                _this.newNode(new pseudo_1.default({
                    value: pseudoStr,
                    source: getTokenSourceSpan(startingToken, _this.currToken),
                    sourceIndex: startingToken[tokenize_1.FIELDS.START_POS],
                }));
                if (length > 1 && _this.nextToken && _this.nextToken[tokenize_1.FIELDS.TYPE] === tokens.openParenthesis) {
                    _this.error("Misplaced parenthesis.", {
                        index: _this.nextToken[tokenize_1.FIELDS.START_POS],
                    });
                }
            });
        }
        else {
            return this.expected(["pseudo-class", "pseudo-element"], this.currToken[tokenize_1.FIELDS.START_POS]);
        }
    };
    Parser.prototype.space = function () {
        var content = this.content();
        // Handle space before and after the selector
        if (this.position === 0 ||
            this.prevToken[tokenize_1.FIELDS.TYPE] === tokens.comma ||
            this.prevToken[tokenize_1.FIELDS.TYPE] === tokens.openParenthesis ||
            this.current.nodes.every(function (node) { return node.type === "comment"; })) {
            this.spaces = this.optionalSpace(content);
            this.position++;
        }
        else if (this.position === this.tokens.length - 1 ||
            this.nextToken[tokenize_1.FIELDS.TYPE] === tokens.comma ||
            this.nextToken[tokenize_1.FIELDS.TYPE] === tokens.closeParenthesis) {
            this.current.last.spaces.after = this.optionalSpace(content);
            this.position++;
        }
        else {
            this.combinator();
        }
    };
    Parser.prototype.string = function () {
        var current = this.currToken;
        this.newNode(new string_1.default({
            value: this.content(),
            source: getTokenSource(current),
            sourceIndex: current[tokenize_1.FIELDS.START_POS],
        }));
        this.position++;
    };
    Parser.prototype.universal = function (namespace) {
        var nextToken = this.nextToken;
        if (nextToken && this.content(nextToken) === "|") {
            this.position++;
            return this.namespace();
        }
        var current = this.currToken;
        this.newNode(new universal_1.default({
            value: this.content(),
            source: getTokenSource(current),
            sourceIndex: current[tokenize_1.FIELDS.START_POS],
        }), namespace);
        this.position++;
    };
    Parser.prototype.splitWord = function (namespace, firstCallback) {
        var _this = this;
        var nextToken = this.nextToken;
        var word = this.content();
        while (nextToken &&
            ~[tokens.dollar, tokens.caret, tokens.equals, tokens.word].indexOf(nextToken[tokenize_1.FIELDS.TYPE])) {
            this.position++;
            var current = this.content();
            word += current;
            if (current.lastIndexOf("\\") === current.length - 1) {
                var next = this.nextToken;
                if (next && next[tokenize_1.FIELDS.TYPE] === tokens.space) {
                    word += this.requiredSpace(this.content(next));
                    this.position++;
                }
            }
            nextToken = this.nextToken;
        }
        var hasClass = indexesOf(word, ".").filter(function (i) {
            // Allow escaped dot within class name
            var escapedDot = word[i - 1] === "\\";
            // Allow decimal numbers percent in @keyframes
            var isKeyframesPercent = /^\d+\.\d+%$/.test(word);
            return !escapedDot && !isKeyframesPercent;
        });
        var hasId = indexesOf(word, "#").filter(function (i) { return word[i - 1] !== "\\"; });
        // Eliminate Sass interpolations from the list of id indexes
        var interpolations = indexesOf(word, "#{");
        if (interpolations.length) {
            hasId = hasId.filter(function (hashIndex) { return !~interpolations.indexOf(hashIndex); });
        }
        var indices = (0, sortAscending_1.default)(uniqs(__spreadArray(__spreadArray([0], __read(hasClass), false), __read(hasId), false)));
        indices.forEach(function (ind, i) {
            var index = indices[i + 1] || word.length;
            var value = word.slice(ind, index);
            if (i === 0 && firstCallback) {
                return firstCallback.call(_this, value, indices.length);
            }
            var node;
            var current = _this.currToken;
            var sourceIndex = current[tokenize_1.FIELDS.START_POS] + indices[i];
            var source = getSource(current[1], current[2] + ind, current[3], current[2] + (index - 1));
            if (~hasClass.indexOf(ind)) {
                var classNameOpts = {
                    value: value.slice(1),
                    source: source,
                    sourceIndex: sourceIndex,
                };
                node = new className_1.default(unescapeProp(classNameOpts, "value"));
            }
            else if (~hasId.indexOf(ind)) {
                var idOpts = {
                    value: value.slice(1),
                    source: source,
                    sourceIndex: sourceIndex,
                };
                node = new id_1.default(unescapeProp(idOpts, "value"));
            }
            else {
                var tagOpts = {
                    value: value,
                    source: source,
                    sourceIndex: sourceIndex,
                };
                unescapeProp(tagOpts, "value");
                node = new tag_1.default(tagOpts);
            }
            _this.newNode(node, namespace);
            // Ensure that the namespace is used only once
            namespace = null;
        });
        this.position++;
    };
    Parser.prototype.word = function (namespace) {
        var nextToken = this.nextToken;
        if (nextToken && this.content(nextToken) === "|") {
            this.position++;
            return this.namespace();
        }
        return this.splitWord(namespace);
    };
    Parser.prototype.loop = function () {
        while (this.position < this.tokens.length) {
            this.parse(true);
        }
        this.current._inferEndPosition();
        return this.root;
    };
    Parser.prototype.parse = function (throwOnParenthesis) {
        switch (this.currToken[tokenize_1.FIELDS.TYPE]) {
            case tokens.space:
                this.space();
                break;
            case tokens.comment:
                this.comment();
                break;
            case tokens.openParenthesis:
                this.parentheses();
                break;
            case tokens.closeParenthesis:
                if (throwOnParenthesis) {
                    this.missingParenthesis();
                }
                break;
            case tokens.openSquare:
                this.attribute();
                break;
            case tokens.dollar:
            case tokens.caret:
            case tokens.equals:
            case tokens.word:
                this.word();
                break;
            case tokens.colon:
                this.pseudo();
                break;
            case tokens.comma:
                this.comma();
                break;
            case tokens.asterisk:
                this.universal();
                break;
            case tokens.ampersand:
                this.nesting();
                break;
            case tokens.slash:
            case tokens.combinator:
                this.combinator();
                break;
            case tokens.str:
                this.string();
                break;
            // These cases throw; no break needed.
            case tokens.closeSquare:
                this.missingSquareBracket();
            case tokens.semicolon:
                this.missingBackslash();
            default:
                this.unexpected();
        }
    };
    /**
     * Helpers
     */
    Parser.prototype.expected = function (description, index, found) {
        if (Array.isArray(description)) {
            var last = description.pop();
            description = "".concat(description.join(", "), " or ").concat(last);
        }
        var an = /^[aeiou]/.test(description[0]) ? "an" : "a";
        if (!found) {
            return this.error("Expected ".concat(an, " ").concat(description, "."), { index: index });
        }
        return this.error("Expected ".concat(an, " ").concat(description, ", found \"").concat(found, "\" instead."), { index: index });
    };
    Parser.prototype.requiredSpace = function (space) {
        return this.options.lossy ? " " : space;
    };
    Parser.prototype.optionalSpace = function (space) {
        return this.options.lossy ? "" : space;
    };
    Parser.prototype.lossySpace = function (space, required) {
        if (this.options.lossy) {
            return required ? " " : "";
        }
        else {
            return space;
        }
    };
    Parser.prototype.parseParenthesisToken = function (token) {
        var content = this.content(token);
        if (token[tokenize_1.FIELDS.TYPE] === tokens.space) {
            return this.requiredSpace(content);
        }
        else {
            return content;
        }
    };
    Parser.prototype.newNode = function (node, namespace) {
        if (namespace) {
            if (/^ +$/.test(namespace)) {
                if (!this.options.lossy) {
                    this.spaces = (this.spaces || "") + namespace;
                }
                namespace = true;
            }
            node.namespace = namespace;
            unescapeProp(node, "namespace");
        }
        if (this.spaces) {
            node.spaces.before = this.spaces;
            this.spaces = "";
        }
        return this.current.append(node);
    };
    Parser.prototype.content = function (token) {
        if (token === void 0) { token = this.currToken; }
        return this.css.slice(token[tokenize_1.FIELDS.START_POS], token[tokenize_1.FIELDS.END_POS]);
    };
    Object.defineProperty(Parser.prototype, "currToken", {
        get: function () {
            return this.tokens[this.position];
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Parser.prototype, "nextToken", {
        get: function () {
            return this.tokens[this.position + 1];
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Parser.prototype, "prevToken", {
        get: function () {
            return this.tokens[this.position - 1];
        },
        enumerable: false,
        configurable: true
    });
    /**
     * returns the index of the next non-whitespace, non-comment token.
     * returns -1 if no meaningful token is found.
     */
    Parser.prototype.locateNextMeaningfulToken = function (startPosition) {
        if (startPosition === void 0) { startPosition = this.position + 1; }
        var searchPosition = startPosition;
        while (searchPosition < this.tokens.length) {
            if (WHITESPACE_EQUIV_TOKENS[this.tokens[searchPosition][tokenize_1.FIELDS.TYPE]]) {
                searchPosition++;
                continue;
            }
            else {
                return searchPosition;
            }
        }
        return -1;
    };
    return Parser;
}());
exports.default = Parser;
//# sourceMappingURL=parser.js.mapx
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var parser_1 = __importDefault(require("./parser"));
var Processor = /** @class */ (function () {
    function Processor(func, options) {
        this.func = func || function noop() { };
        this.funcRes = null;
        this.options = options;
    }
    Processor.prototype._shouldUpdateSelector = function (rule, options) {
        if (options === void 0) { options = {}; }
        var merged = Object.assign({}, this.options, options);
        if (merged.updateSelector === false) {
            return false;
        }
        else {
            return typeof rule !== "string";
        }
    };
    Processor.prototype._isLossy = function (options) {
        if (options === void 0) { options = {}; }
        var merged = Object.assign({}, this.options, options);
        if (merged.lossless === false) {
            return true;
        }
        else {
            return false;
        }
    };
    Processor.prototype._root = function (rule, options) {
        if (options === void 0) { options = {}; }
        var parser = new parser_1.default(rule, this._parseOptions(options));
        return parser.root;
    };
    Processor.prototype._parseOptions = function (options) {
        var merged = Object.assign({}, this.options, options);
        return {
            lossy: this._isLossy(merged),
            maxNestingDepth: merged.maxNestingDepth,
        };
    };
    Processor.prototype._stringifyOptions = function (options) {
        var merged = Object.assign({}, this.options, options);
        return {
            maxNestingDepth: merged.maxNestingDepth,
        };
    };
    Processor.prototype._run = function (rule, options) {
        var _this = this;
        if (options === void 0) { options = {}; }
        return new Promise(function (resolve, reject) {
            try {
                var root_1 = _this._root(rule, options);
                Promise.resolve(_this.func(root_1))
                    .then(function (transform) {
                    var string = undefined;
                    if (_this._shouldUpdateSelector(rule, options)) {
                        string = root_1.toString(_this._stringifyOptions(options));
                        rule.selector = string;
                    }
                    return { transform: transform, root: root_1, string: string };
                })
                    .then(resolve, reject);
            }
            catch (e) {
                reject(e);
                return;
            }
        });
    };
    Processor.prototype._runSync = function (rule, options) {
        if (options === void 0) { options = {}; }
        var root = this._root(rule, options);
        var transform = this.func(root);
        if (transform && typeof transform.then === "function") {
            throw new Error("Selector processor returned a promise to a synchronous call.");
        }
        var string = undefined;
        if (options.updateSelector && typeof rule !== "string") {
            string = root.toString(this._stringifyOptions(options));
            rule.selector = string;
        }
        return { transform: transform, root: root, string: string };
    };
    /**
     * Process rule into a selector AST.
     *
     * @param rule {postcss.Rule | string} The css selector to be processed
     * @param options The options for processing
     * @returns {Promise<parser.Root>} The AST of the selector after processing it.
     */
    Processor.prototype.ast = function (rule, options) {
        return this._run(rule, options).then(function (result) { return result.root; });
    };
    /**
     * Process rule into a selector AST synchronously.
     *
     * @param rule {postcss.Rule | string} The css selector to be processed
     * @param options The options for processing
     * @returns {parser.Root} The AST of the selector after processing it.
     */
    Processor.prototype.astSync = function (rule, options) {
        return this._runSync(rule, options).root;
    };
    /**
     * Process a selector into a transformed value asynchronously
     *
     * @param rule {postcss.Rule | string} The css selector to be processed
     * @param options The options for processing
     * @returns {Promise<any>} The value returned by the processor.
     */
    Processor.prototype.transform = function (rule, options) {
        return this._run(rule, options).then(function (result) { return result.transform; });
    };
    /**
     * Process a selector into a transformed value synchronously.
     *
     * @param rule {postcss.Rule | string} The css selector to be processed
     * @param options The options for processing
     * @returns {any} The value returned by the processor.
     */
    Processor.prototype.transformSync = function (rule, options) {
        return this._runSync(rule, options).transform;
    };
    /**
     * Process a selector into a new selector string asynchronously.
     *
     * @param rule {postcss.Rule | string} The css selector to be processed
     * @param options The options for processing
     * @returns {string} the selector after processing.
     */
    Processor.prototype.process = function (rule, options) {
        var _this = this;
        return this._run(rule, options).then(function (result) { return result.string || result.root.toString(_this._stringifyOptions(options)); });
    };
    /**
     * Process a selector into a new selector string synchronously.
     *
     * @param rule {postcss.Rule | string} The css selector to be processed
     * @param options The options for processing
     * @returns {string} the selector after processing.
     */
    Processor.prototype.processSync = function (rule, options) {
        var result = this._runSync(rule, options);
        return result.string || result.root.toString(this._stringifyOptions(options));
    };
    return Processor;
}());
exports.default = Processor;
//# sourceMappingURL=processor.js.map9I,x0100644 attribute.js T>O7Y=j100644 className.js n-5\٬yj100644 combinator.js 0J)@d100644 comment.js MbU"100644 constructors.js ]FdFOjl)100644 container.js V)!<AGdc*F100644 guards.js S~dT/100644 id.js O>nU#g100644 index.js OLE	xUI)100644 namespace.js 9)YG%=g"(n100644 nesting.js ^^68O4>ԇ&!100644 node.js u7Kg~"wDq3100644 pseudo.js cJ^C:	kq100644 root.js ۰g~e.z[l100644 selector.js 4M??Dq}kQP100644 string.js 껰!q@GR 100644 tag.js Ҧ1'ɫ&)XC:݌CR100644 types.js >D1 M؈L 100644 universal.js [6J~ǫ9y+cˆ|b	xZH"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.unescapeValue = unescapeValue;
var cssesc_1 = __importDefault(require("cssesc"));
var unesc_1 = __importDefault(require("../util/unesc"));
var namespace_1 = __importDefault(require("./namespace"));
var types_1 = require("./types");
var deprecate = require("util-deprecate");
var WRAPPED_IN_QUOTES = /^('|")([^]*)\1$/;
var warnOfDeprecatedValueAssignment = deprecate(function () { }, "Assigning an attribute a value containing characters that might need to be escaped is deprecated. " +
    "Call attribute.setValue() instead.");
var warnOfDeprecatedQuotedAssignment = deprecate(function () { }, "Assigning attr.quoted is deprecated and has no effect. Assign to attr.quoteMark instead.");
var warnOfDeprecatedConstructor = deprecate(function () { }, "Constructing an Attribute selector with a value without specifying quoteMark is deprecated. Note: The value should be unescaped now.");
function unescapeValue(value) {
    var deprecatedUsage = false;
    var quoteMark = null;
    var unescaped = value;
    var m = unescaped.match(WRAPPED_IN_QUOTES);
    if (m) {
        quoteMark = m[1];
        unescaped = m[2];
    }
    unescaped = (0, unesc_1.default)(unescaped);
    if (unescaped !== value) {
        deprecatedUsage = true;
    }
    return {
        deprecatedUsage: deprecatedUsage,
        unescaped: unescaped,
        quoteMark: quoteMark,
    };
}
function handleDeprecatedContructorOpts(opts) {
    if (opts.quoteMark !== undefined) {
        return opts;
    }
    if (opts.value === undefined) {
        return opts;
    }
    warnOfDeprecatedConstructor();
    var _a = unescapeValue(opts.value), quoteMark = _a.quoteMark, unescaped = _a.unescaped;
    if (!opts.raws) {
        opts.raws = {};
    }
    if (opts.raws.value === undefined) {
        opts.raws.value = opts.value;
    }
    opts.value = unescaped;
    opts.quoteMark = quoteMark;
    return opts;
}
var Attribute = /** @class */ (function (_super) {
    __extends(Attribute, _super);
    function Attribute(opts) {
        if (opts === void 0) { opts = {}; }
        var _this = _super.call(this, handleDeprecatedContructorOpts(opts)) || this;
        _this.type = types_1.ATTRIBUTE;
        _this.raws = _this.raws || {};
        Object.defineProperty(_this.raws, "unquoted", {
            get: deprecate(function () { return _this.value; }, "attr.raws.unquoted is deprecated. Call attr.value instead."),
            set: deprecate(function () { return _this.value; }, "Setting attr.raws.unquoted is deprecated and has no effect. attr.value is unescaped by default now."),
        });
        _this._constructed = true;
        return _this;
    }
    /**
     * Returns the Attribute's value quoted such that it would be legal to use
     * in the value of a css file. The original value's quotation setting
     * used for stringification is left unchanged. See `setValue(value, options)`
     * if you want to control the quote settings of a new value for the attribute.
     *
     * You can also change the quotation used for the current value by setting quoteMark.
     *
     * Options:
     *   * quoteMark {'"' | "'" | null} - Use this value to quote the value. If this
     *     option is not set, the original value for quoteMark will be used. If
     *     indeterminate, a double quote is used. The legal values are:
     *     * `null` - the value will be unquoted and characters will be escaped as necessary.
     *     * `'` - the value will be quoted with a single quote and single quotes are escaped.
     *     * `"` - the value will be quoted with a double quote and double quotes are escaped.
     *   * preferCurrentQuoteMark {boolean} - if true, prefer the source quote mark
     *     over the quoteMark option value.
     *   * smart {boolean} - if true, will select a quote mark based on the value
     *     and the other options specified here. See the `smartQuoteMark()`
     *     method.
     **/
    Attribute.prototype.getQuotedValue = function (options) {
        if (options === void 0) { options = {}; }
        var quoteMark = this._determineQuoteMark(options);
        var cssescopts = CSSESC_QUOTE_OPTIONS[quoteMark];
        var escaped = (0, cssesc_1.default)(this._value, cssescopts);
        return escaped;
    };
    Attribute.prototype._determineQuoteMark = function (options) {
        return options.smart ? this.smartQuoteMark(options) : this.preferredQuoteMark(options);
    };
    /**
     * Set the unescaped value with the specified quotation options. The value
     * provided must not include any wrapping quote marks -- those quotes will
     * be interpreted as part of the value and escaped accordingly.
     */
    Attribute.prototype.setValue = function (value, options) {
        if (options === void 0) { options = {}; }
        this._value = value;
        this._quoteMark = this._determineQuoteMark(options);
        this._syncRawValue();
    };
    /**
     * Intelligently select a quoteMark value based on the value's contents. If
     * the value is a legal CSS ident, it will not be quoted. Otherwise a quote
     * mark will be picked that minimizes the number of escapes.
     *
     * If there's no clear winner, the quote mark from these options is used,
     * then the source quote mark (this is inverted if `preferCurrentQuoteMark` is
     * true). If the quoteMark is unspecified, a double quote is used.
     *
     * @param options This takes the quoteMark and preferCurrentQuoteMark options
     * from the quoteValue method.
     */
    Attribute.prototype.smartQuoteMark = function (options) {
        var v = this.value;
        var numSingleQuotes = v.replace(/[^']/g, "").length;
        var numDoubleQuotes = v.replace(/[^"]/g, "").length;
        if (numSingleQuotes + numDoubleQuotes === 0) {
            var escaped = (0, cssesc_1.default)(v, { isIdentifier: true });
            if (escaped === v) {
                return Attribute.NO_QUOTE;
            }
            else {
                var pref = this.preferredQuoteMark(options);
                if (pref === Attribute.NO_QUOTE) {
                    // pick a quote mark that isn't none and see if it's smaller
                    var quote = this.quoteMark || options.quoteMark || Attribute.DOUBLE_QUOTE;
                    var opts = CSSESC_QUOTE_OPTIONS[quote];
                    var quoteValue = (0, cssesc_1.default)(v, opts);
                    if (quoteValue.length < escaped.length) {
                        return quote;
                    }
                }
                return pref;
            }
        }
        else if (numDoubleQuotes === numSingleQuotes) {
            return this.preferredQuoteMark(options);
        }
        else if (numDoubleQuotes < numSingleQuotes) {
            return Attribute.DOUBLE_QUOTE;
        }
        else {
            return Attribute.SINGLE_QUOTE;
        }
    };
    /**
     * Selects the preferred quote mark based on the options and the current quote mark value.
     * If you want the quote mark to depend on the attribute value, call `smartQuoteMark(opts)`
     * instead.
     */
    Attribute.prototype.preferredQuoteMark = function (options) {
        var quoteMark = options.preferCurrentQuoteMark ? this.quoteMark : options.quoteMark;
        if (quoteMark === undefined) {
            quoteMark = options.preferCurrentQuoteMark ? options.quoteMark : this.quoteMark;
        }
        if (quoteMark === undefined) {
            quoteMark = Attribute.DOUBLE_QUOTE;
        }
        return quoteMark;
    };
    Object.defineProperty(Attribute.prototype, "quoted", {
        get: function () {
            var qm = this.quoteMark;
            return qm === "'" || qm === '"';
        },
        set: function (value) {
            warnOfDeprecatedQuotedAssignment();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Attribute.prototype, "quoteMark", {
        /**
         * returns a single (`'`) or double (`"`) quote character if the value is quoted.
         * returns `null` if the value is not quoted.
         * returns `undefined` if the quotation state is unknown (this can happen when
         * the attribute is constructed without specifying a quote mark.)
         */
        get: function () {
            return this._quoteMark;
        },
        /**
         * Set the quote mark to be used by this attribute's value.
         * If the quote mark changes, the raw (escaped) value at `attr.raws.value` of the attribute
         * value is updated accordingly.
         *
         * @param {"'" | '"' | null} quoteMark The quote mark or `null` if the value should be unquoted.
         */
        set: function (quoteMark) {
            if (!this._constructed) {
                this._quoteMark = quoteMark;
                return;
            }
            if (this._quoteMark !== quoteMark) {
                this._quoteMark = quoteMark;
                this._syncRawValue();
            }
        },
        enumerable: false,
        configurable: true
    });
    Attribute.prototype._syncRawValue = function () {
        var rawValue = (0, cssesc_1.default)(this._value, CSSESC_QUOTE_OPTIONS[this.quoteMark]);
        if (rawValue === this._value) {
            if (this.raws) {
                delete this.raws.value;
            }
        }
        else {
            this.raws.value = rawValue;
        }
    };
    Object.defineProperty(Attribute.prototype, "qualifiedAttribute", {
        get: function () {
            return this.qualifiedName(this.raws.attribute || this.attribute);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Attribute.prototype, "insensitiveFlag", {
        get: function () {
            return this.insensitive ? "i" : "";
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Attribute.prototype, "value", {
        get: function () {
            return this._value;
        },
        /**
         * Before 3.0, the value had to be set to an escaped value including any wrapped
         * quote marks. In 3.0, the semantics of `Attribute.value` changed so that the value
         * is unescaped during parsing and any quote marks are removed.
         *
         * Because the ambiguity of this semantic change, if you set `attr.value = newValue`,
         * a deprecation warning is raised when the new value contains any characters that would
         * require escaping (including if it contains wrapped quotes).
         *
         * Instead, you should call `attr.setValue(newValue, opts)` and pass options that describe
         * how the new value is quoted.
         */
        set: function (v) {
            if (this._constructed) {
                var _a = unescapeValue(v), deprecatedUsage = _a.deprecatedUsage, unescaped = _a.unescaped, quoteMark = _a.quoteMark;
                if (deprecatedUsage) {
                    warnOfDeprecatedValueAssignment();
                }
                if (unescaped === this._value && quoteMark === this._quoteMark) {
                    return;
                }
                this._value = unescaped;
                this._quoteMark = quoteMark;
                this._syncRawValue();
            }
            else {
                this._value = v;
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Attribute.prototype, "insensitive", {
        get: function () {
            return this._insensitive;
        },
        /**
         * Set the case insensitive flag.
         * If the case insensitive flag changes, the raw (escaped) value at `attr.raws.insensitiveFlag`
         * of the attribute is updated accordingly.
         *
         * @param {true | false} insensitive true if the attribute should match case-insensitively.
         */
        set: function (insensitive) {
            if (!insensitive) {
                this._insensitive = false;
                // "i" and "I" can be used in "this.raws.insensitiveFlag" to store the original notation.
                // When setting `attr.insensitive = false` both should be erased to ensure correct serialization.
                if (this.raws && (this.raws.insensitiveFlag === "I" || this.raws.insensitiveFlag === "i")) {
                    this.raws.insensitiveFlag = undefined;
                }
            }
            this._insensitive = insensitive;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Attribute.prototype, "attribute", {
        get: function () {
            return this._attribute;
        },
        set: function (name) {
            this._handleEscapes("attribute", name);
            this._attribute = name;
        },
        enumerable: false,
        configurable: true
    });
    Attribute.prototype._handleEscapes = function (prop, value) {
        if (this._constructed) {
            var escaped = (0, cssesc_1.default)(value, { isIdentifier: true });
            if (escaped !== value) {
                this.raws[prop] = escaped;
            }
            else {
                delete this.raws[prop];
            }
        }
    };
    Attribute.prototype._spacesFor = function (name) {
        var attrSpaces = { before: "", after: "" };
        var spaces = this.spaces[name] || {};
        var rawSpaces = (this.raws.spaces && this.raws.spaces[name]) || {};
        return Object.assign(attrSpaces, spaces, rawSpaces);
    };
    Attribute.prototype._stringFor = function (name, spaceName, concat) {
        if (spaceName === void 0) { spaceName = name; }
        if (concat === void 0) { concat = defaultAttrConcat; }
        var attrSpaces = this._spacesFor(spaceName);
        return concat(this.stringifyProperty(name), attrSpaces);
    };
    /**
     * returns the offset of the attribute part specified relative to the
     * start of the node of the output string.
     *
     * * "ns" - alias for "namespace"
     * * "namespace" - the namespace if it exists.
     * * "attribute" - the attribute name
     * * "attributeNS" - the start of the attribute or its namespace
     * * "operator" - the match operator of the attribute
     * * "value" - The value (string or identifier)
     * * "insensitive" - the case insensitivity flag;
     * @param part One of the possible values inside an attribute.
     * @returns -1 if the name is invalid or the value doesn't exist in this attribute.
     */
    Attribute.prototype.offsetOf = function (name) {
        var count = 1;
        var attributeSpaces = this._spacesFor("attribute");
        count += attributeSpaces.before.length;
        if (name === "namespace" || name === "ns") {
            return this.namespace ? count : -1;
        }
        if (name === "attributeNS") {
            return count;
        }
        count += this.namespaceString.length;
        if (this.namespace) {
            count += 1;
        }
        if (name === "attribute") {
            return count;
        }
        count += this.stringifyProperty("attribute").length;
        count += attributeSpaces.after.length;
        var operatorSpaces = this._spacesFor("operator");
        count += operatorSpaces.before.length;
        var operator = this.stringifyProperty("operator");
        if (name === "operator") {
            return operator ? count : -1;
        }
        count += operator.length;
        count += operatorSpaces.after.length;
        var valueSpaces = this._spacesFor("value");
        count += valueSpaces.before.length;
        var value = this.stringifyProperty("value");
        if (name === "value") {
            return value ? count : -1;
        }
        count += value.length;
        count += valueSpaces.after.length;
        var insensitiveSpaces = this._spacesFor("insensitive");
        count += insensitiveSpaces.before.length;
        if (name === "insensitive") {
            return this.insensitive ? count : -1;
        }
        return -1;
    };
    Attribute.prototype.toString = function () {
        var _this = this;
        var selector = [this.rawSpaceBefore, "["];
        selector.push(this._stringFor("qualifiedAttribute", "attribute"));
        if (this.operator && (this.value || this.value === "")) {
            selector.push(this._stringFor("operator"));
            selector.push(this._stringFor("value"));
            selector.push(this._stringFor("insensitiveFlag", "insensitive", function (attrValue, attrSpaces) {
                if (attrValue.length > 0 &&
                    !_this.quoted &&
                    attrSpaces.before.length === 0 &&
                    !(_this.spaces.value && _this.spaces.value.after)) {
                    attrSpaces.before = " ";
                }
                return defaultAttrConcat(attrValue, attrSpaces);
            }));
        }
        selector.push("]");
        selector.push(this.rawSpaceAfter);
        return selector.join("");
    };
    Attribute.NO_QUOTE = null;
    Attribute.SINGLE_QUOTE = "'";
    Attribute.DOUBLE_QUOTE = '"';
    return Attribute;
}(namespace_1.default));
exports.default = Attribute;
var CSSESC_QUOTE_OPTIONS = (_a = {
        "'": { quotes: "single", wrap: true },
        '"': { quotes: "double", wrap: true }
    },
    _a[null] = { isIdentifier: true },
    _a);
function defaultAttrConcat(attrValue, attrSpaces) {
    return "".concat(attrSpaces.before).concat(attrValue).concat(attrSpaces.after);
}
//# sourceMappingURL=attribute.js.mapox"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var cssesc_1 = __importDefault(require("cssesc"));
var util_1 = require("../util");
var node_1 = __importDefault(require("./node"));
var types_1 = require("./types");
var ClassName = /** @class */ (function (_super) {
    __extends(ClassName, _super);
    function ClassName(opts) {
        var _this = _super.call(this, opts) || this;
        _this.type = types_1.CLASS;
        _this._constructed = true;
        return _this;
    }
    Object.defineProperty(ClassName.prototype, "value", {
        get: function () {
            return this._value;
        },
        set: function (v) {
            if (this._constructed) {
                var escaped = (0, cssesc_1.default)(v, { isIdentifier: true });
                if (escaped !== v) {
                    (0, util_1.ensureObject)(this, "raws");
                    this.raws.value = escaped;
                }
                else if (this.raws) {
                    delete this.raws.value;
                }
            }
            this._value = v;
        },
        enumerable: false,
        configurable: true
    });
    ClassName.prototype.valueToString = function () {
        return "." + _super.prototype.valueToString.call(this);
    };
    return ClassName;
}(node_1.default));
exports.default = ClassName;
//# sourceMappingURL=className.js.mapEXxy"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var node_1 = __importDefault(require("./node"));
var types_1 = require("./types");
var Combinator = /** @class */ (function (_super) {
    __extends(Combinator, _super);
    function Combinator(opts) {
        var _this = _super.call(this, opts) || this;
        _this.type = types_1.COMBINATOR;
        return _this;
    }
    return Combinator;
}(node_1.default));
exports.default = Combinator;
//# sourceMappingURL=combinator.js.mapk1Wxq"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var node_1 = __importDefault(require("./node"));
var types_1 = require("./types");
var Comment = /** @class */ (function (_super) {
    __extends(Comment, _super);
    function Comment(opts) {
        var _this = _super.call(this, opts) || this;
        _this.type = types_1.COMMENT;
        return _this;
    }
    return Comment;
}(node_1.default));
exports.default = Comment;
//# sourceMappingURL=comment.js.mapx"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.universal = exports.tag = exports.string = exports.selector = exports.root = exports.pseudo = exports.nesting = exports.id = exports.comment = exports.combinator = exports.className = exports.attribute = void 0;
var attribute_1 = __importDefault(require("./attribute"));
var className_1 = __importDefault(require("./className"));
var combinator_1 = __importDefault(require("./combinator"));
var comment_1 = __importDefault(require("./comment"));
var id_1 = __importDefault(require("./id"));
var nesting_1 = __importDefault(require("./nesting"));
var pseudo_1 = __importDefault(require("./pseudo"));
var root_1 = __importDefault(require("./root"));
var selector_1 = __importDefault(require("./selector"));
var string_1 = __importDefault(require("./string"));
var tag_1 = __importDefault(require("./tag"));
var universal_1 = __importDefault(require("./universal"));
var attribute = function (opts) { return new attribute_1.default(opts); };
exports.attribute = attribute;
var className = function (opts) { return new className_1.default(opts); };
exports.className = className;
var combinator = function (opts) { return new combinator_1.default(opts); };
exports.combinator = combinator;
var comment = function (opts) { return new comment_1.default(opts); };
exports.comment = comment;
var id = function (opts) { return new id_1.default(opts); };
exports.id = id;
var nesting = function (opts) { return new nesting_1.default(opts); };
exports.nesting = nesting;
var pseudo = function (opts) { return new pseudo_1.default(opts); };
exports.pseudo = pseudo;
var root = function (opts) { return new root_1.default(opts); };
exports.root = root;
var selector = function (opts) { return new selector_1.default(opts); };
exports.selector = selector;
var string = function (opts) { return new string_1.default(opts); };
exports.string = string;
var tag = function (opts) { return new tag_1.default(opts); };
exports.tag = tag;
var universal = function (opts) { return new universal_1.default(opts); };
exports.universal = universal;
//# sourceMappingURL=constructors.js.map4&xI="use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
var __values = (this && this.__values) || function(o) {
    var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
    if (m) return m.call(o);
    if (o && typeof o.length === "number") return {
        next: function () {
            if (o && i >= o.length) o = void 0;
            return { value: o && o[i++], done: !o };
        }
    };
    throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
};
var __read = (this && this.__read) || function (o, n) {
    var m = typeof Symbol === "function" && o[Symbol.iterator];
    if (!m) return o;
    var i = m.call(o), r, ar = [], e;
    try {
        while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
    }
    catch (error) { e = { error: error }; }
    finally {
        try {
            if (r && !r.done && (m = i["return"])) m.call(i);
        }
        finally { if (e) throw e.error; }
    }
    return ar;
};
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
    if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
        if (ar || !(i in from)) {
            if (!ar) ar = Array.prototype.slice.call(from, 0, i);
            ar[i] = from[i];
        }
    }
    return to.concat(ar || Array.prototype.slice.call(from));
};
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = require("../util");
var node_1 = __importDefault(require("./node"));
var types = __importStar(require("./types"));
var Container = /** @class */ (function (_super) {
    __extends(Container, _super);
    function Container(opts) {
        var _this = _super.call(this, opts) || this;
        if (!_this.nodes) {
            _this.nodes = [];
        }
        return _this;
    }
    Container.prototype.append = function (selector) {
        selector.parent = this;
        this.nodes.push(selector);
        return this;
    };
    Container.prototype.prepend = function (selector) {
        selector.parent = this;
        this.nodes.unshift(selector);
        for (var id in this.indexes) {
            this.indexes[id]++;
        }
        return this;
    };
    Container.prototype.at = function (index) {
        return this.nodes[index];
    };
    Container.prototype.index = function (child) {
        if (typeof child === "number") {
            return child;
        }
        return this.nodes.indexOf(child);
    };
    Object.defineProperty(Container.prototype, "first", {
        get: function () {
            return this.at(0);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Container.prototype, "last", {
        get: function () {
            return this.at(this.length - 1);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Container.prototype, "length", {
        get: function () {
            return this.nodes.length;
        },
        enumerable: false,
        configurable: true
    });
    Container.prototype.removeChild = function (child) {
        child = this.index(child);
        this.at(child).parent = undefined;
        this.nodes.splice(child, 1);
        var index;
        for (var id in this.indexes) {
            index = this.indexes[id];
            if (index >= child) {
                this.indexes[id] = index - 1;
            }
        }
        return this;
    };
    Container.prototype.removeAll = function () {
        var e_1, _a;
        try {
            for (var _b = __values(this.nodes), _c = _b.next(); !_c.done; _c = _b.next()) {
                var node = _c.value;
                node.parent = undefined;
            }
        }
        catch (e_1_1) { e_1 = { error: e_1_1 }; }
        finally {
            try {
                if (_c && !_c.done && (_a = _b.return)) _a.call(_b);
            }
            finally { if (e_1) throw e_1.error; }
        }
        this.nodes = [];
        return this;
    };
    Container.prototype.empty = function () {
        return this.removeAll();
    };
    Container.prototype.insertAfter = function (oldNode, newNode) {
        var _a;
        newNode.parent = this;
        var oldIndex = this.index(oldNode);
        var resetNode = [];
        for (var i = 2; i < arguments.length; i++) {
            resetNode.push(arguments[i]);
        }
        (_a = this.nodes).splice.apply(_a, __spreadArray([oldIndex + 1, 0, newNode], __read(resetNode), false));
        newNode.parent = this;
        var index;
        for (var id in this.indexes) {
            index = this.indexes[id];
            if (oldIndex < index) {
                this.indexes[id] = index + arguments.length - 1;
            }
        }
        return this;
    };
    Container.prototype.insertBefore = function (oldNode, newNode) {
        var _a;
        newNode.parent = this;
        var oldIndex = this.index(oldNode);
        var resetNode = [];
        for (var i = 2; i < arguments.length; i++) {
            resetNode.push(arguments[i]);
        }
        (_a = this.nodes).splice.apply(_a, __spreadArray([oldIndex, 0, newNode], __read(resetNode), false));
        newNode.parent = this;
        var index;
        for (var id in this.indexes) {
            index = this.indexes[id];
            if (index >= oldIndex) {
                this.indexes[id] = index + arguments.length - 1;
            }
        }
        return this;
    };
    Container.prototype._findChildAtPosition = function (line, col) {
        var found = undefined;
        this.each(function (node) {
            if (node.atPosition) {
                var foundChild = node.atPosition(line, col);
                if (foundChild) {
                    found = foundChild;
                    return false;
                }
            }
            else if (node.isAtPosition(line, col)) {
                found = node;
                return false;
            }
        });
        return found;
    };
    /**
     * Return the most specific node at the line and column number given.
     * The source location is based on the original parsed location, locations aren't
     * updated as selector nodes are mutated.
     *
     * Note that this location is relative to the location of the first character
     * of the selector, and not the location of the selector in the overall document
     * when used in conjunction with postcss.
     *
     * If not found, returns undefined.
     * @param {number} line The line number of the node to find. (1-based index)
     * @param {number} col  The column number of the node to find. (1-based index)
     */
    Container.prototype.atPosition = function (line, col) {
        if (this.isAtPosition(line, col)) {
            return this._findChildAtPosition(line, col) || this;
        }
        else {
            return undefined;
        }
    };
    Container.prototype._inferEndPosition = function () {
        if (this.last && this.last.source && this.last.source.end) {
            this.source = this.source || {};
            this.source.end = this.source.end || {};
            Object.assign(this.source.end, this.last.source.end);
        }
    };
    Container.prototype.each = function (callback) {
        if (!this.lastEach) {
            this.lastEach = 0;
        }
        if (!this.indexes) {
            this.indexes = {};
        }
        this.lastEach++;
        var id = this.lastEach;
        this.indexes[id] = 0;
        if (!this.length) {
            return undefined;
        }
        var index, result;
        while (this.indexes[id] < this.length) {
            index = this.indexes[id];
            result = callback(this.at(index), index);
            if (result === false) {
                break;
            }
            this.indexes[id] += 1;
        }
        delete this.indexes[id];
        if (result === false) {
            return false;
        }
    };
    Container.prototype.walk = function (callback, depth) {
        if (depth === void 0) { depth = 0; }
        // Bound recursion so a pathologically deep node tree raises a catchable
        // error instead of overflowing the call stack (CVE-2026-9358 / CWE-674).
        if (depth > util_1.MAX_NESTING_DEPTH) {
            throw new Error("Cannot walk selector: nesting depth exceeds the maximum of ".concat(util_1.MAX_NESTING_DEPTH, "."));
        }
        return this.each(function (node, i) {
            var result = callback(node, i);
            if (result !== false && node.length) {
                result = node.walk(callback, depth + 1);
            }
            if (result === false) {
                return false;
            }
        });
    };
    Container.prototype.walkAttributes = function (callback) {
        var _this = this;
        return this.walk(function (selector) {
            if (selector.type === types.ATTRIBUTE) {
                return callback.call(_this, selector);
            }
        });
    };
    Container.prototype.walkClasses = function (callback) {
        var _this = this;
        return this.walk(function (selector) {
            if (selector.type === types.CLASS) {
                return callback.call(_this, selector);
            }
        });
    };
    Container.prototype.walkCombinators = function (callback) {
        var _this = this;
        return this.walk(function (selector) {
            if (selector.type === types.COMBINATOR) {
                return callback.call(_this, selector);
            }
        });
    };
    Container.prototype.walkComments = function (callback) {
        var _this = this;
        return this.walk(function (selector) {
            if (selector.type === types.COMMENT) {
                return callback.call(_this, selector);
            }
        });
    };
    Container.prototype.walkIds = function (callback) {
        var _this = this;
        return this.walk(function (selector) {
            if (selector.type === types.ID) {
                return callback.call(_this, selector);
            }
        });
    };
    Container.prototype.walkNesting = function (callback) {
        var _this = this;
        return this.walk(function (selector) {
            if (selector.type === types.NESTING) {
                return callback.call(_this, selector);
            }
        });
    };
    Container.prototype.walkPseudos = function (callback) {
        var _this = this;
        return this.walk(function (selector) {
            if (selector.type === types.PSEUDO) {
                return callback.call(_this, selector);
            }
        });
    };
    Container.prototype.walkTags = function (callback) {
        var _this = this;
        return this.walk(function (selector) {
            if (selector.type === types.TAG) {
                return callback.call(_this, selector);
            }
        });
    };
    Container.prototype.walkUniversals = function (callback) {
        var _this = this;
        return this.walk(function (selector) {
            if (selector.type === types.UNIVERSAL) {
                return callback.call(_this, selector);
            }
        });
    };
    Container.prototype.split = function (callback) {
        var _this = this;
        var current = [];
        return this.reduce(function (memo, node, index) {
            var split = callback.call(_this, node);
            current.push(node);
            if (split) {
                memo.push(current);
                current = [];
            }
            else if (index === _this.length - 1) {
                memo.push(current);
            }
            return memo;
        }, []);
    };
    Container.prototype.map = function (callback) {
        return this.nodes.map(callback);
    };
    Container.prototype.reduce = function (callback, memo) {
        return this.nodes.reduce(callback, memo);
    };
    Container.prototype.every = function (callback) {
        return this.nodes.every(callback);
    };
    Container.prototype.some = function (callback) {
        return this.nodes.some(callback);
    };
    Container.prototype.filter = function (callback) {
        return this.nodes.filter(callback);
    };
    Container.prototype.sort = function (callback) {
        return this.nodes.sort(callback);
    };
    Container.prototype.toString = function (options) {
        if (options === void 0) { options = {}; }
        return this._stringify(options, 0, (0, util_1.resolveMaxNestingDepth)(options.maxNestingDepth));
    };
    Container.prototype._stringify = function (options, depth, max) {
        var _this = this;
        return this.map(function (child) { return _this._stringifyChild(child, options, depth, max); }).join("");
    };
    // Serialize a child node. Historically `toString` used `this.map(String)`,
    // which leniently coerced anything — including raw arrays inserted via
    // `replaceWith(array)` / `insertBefore` / `insertAfter` (e.g. Tailwind's
    // `:merge()` expansion). Fall back to `String(child)` for values that are not
    // parser nodes so that behaviour is preserved.
    Container.prototype._stringifyChild = function (child, options, depth, max) {
        return typeof child._stringify === "function"
            ? child._stringify(options, depth, max)
            : String(child);
    };
    return Container;
}(node_1.default));
exports.default = Container;
//# sourceMappingURL=container.js.mapqS鲝x	-"use strict";
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isUniversal = exports.isTag = exports.isString = exports.isSelector = exports.isRoot = exports.isPseudo = exports.isNesting = exports.isIdentifier = exports.isComment = exports.isCombinator = exports.isClassName = exports.isAttribute = void 0;
exports.isNode = isNode;
exports.isPseudoElement = isPseudoElement;
exports.isPseudoClass = isPseudoClass;
exports.isContainer = isContainer;
exports.isNamespace = isNamespace;
var types_1 = require("./types");
var IS_TYPE = (_a = {},
    _a[types_1.ATTRIBUTE] = true,
    _a[types_1.CLASS] = true,
    _a[types_1.COMBINATOR] = true,
    _a[types_1.COMMENT] = true,
    _a[types_1.ID] = true,
    _a[types_1.NESTING] = true,
    _a[types_1.PSEUDO] = true,
    _a[types_1.ROOT] = true,
    _a[types_1.SELECTOR] = true,
    _a[types_1.STRING] = true,
    _a[types_1.TAG] = true,
    _a[types_1.UNIVERSAL] = true,
    _a);
function isNode(node) {
    return typeof node === "object" && IS_TYPE[node.type];
}
function isNodeType(type, node) {
    return isNode(node) && node.type === type;
}
exports.isAttribute = isNodeType.bind(null, types_1.ATTRIBUTE);
exports.isClassName = isNodeType.bind(null, types_1.CLASS);
exports.isCombinator = isNodeType.bind(null, types_1.COMBINATOR);
exports.isComment = isNodeType.bind(null, types_1.COMMENT);
exports.isIdentifier = isNodeType.bind(null, types_1.ID);
exports.isNesting = isNodeType.bind(null, types_1.NESTING);
exports.isPseudo = isNodeType.bind(null, types_1.PSEUDO);
exports.isRoot = isNodeType.bind(null, types_1.ROOT);
exports.isSelector = isNodeType.bind(null, types_1.SELECTOR);
exports.isString = isNodeType.bind(null, types_1.STRING);
exports.isTag = isNodeType.bind(null, types_1.TAG);
exports.isUniversal = isNodeType.bind(null, types_1.UNIVERSAL);
function isPseudoElement(node) {
    return ((0, exports.isPseudo)(node) &&
        node.value &&
        (node.value.startsWith("::") ||
            node.value.toLowerCase() === ":before" ||
            node.value.toLowerCase() === ":after" ||
            node.value.toLowerCase() === ":first-letter" ||
            node.value.toLowerCase() === ":first-line"));
}
function isPseudoClass(node) {
    return (0, exports.isPseudo)(node) && !isPseudoElement(node);
}
function isContainer(node) {
    return !!(isNode(node) && node.walk);
}
function isNamespace(node) {
    return (0, exports.isAttribute)(node) || (0, exports.isTag)(node);
}
//# sourceMappingURL=guards.js.mapEB\x;"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var node_1 = __importDefault(require("./node"));
var types_1 = require("./types");
var ID = /** @class */ (function (_super) {
    __extends(ID, _super);
    function ID(opts) {
        var _this = _super.call(this, opts) || this;
        _this.type = types_1.ID;
        return _this;
    }
    ID.prototype.valueToString = function () {
        return "#" + _super.prototype.valueToString.call(this);
    };
    return ID;
}(node_1.default));
exports.default = ID;
//# sourceMappingURL=id.js.map{˼9x`"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
    for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
Object.defineProperty(exports, "__esModule", { value: true });
__exportStar(require("./types"), exports);
__exportStar(require("./constructors"), exports);
__exportStar(require("./guards"), exports);
//# sourceMappingURL=index.js.maph.lxh"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var cssesc_1 = __importDefault(require("cssesc"));
var util_1 = require("../util");
var node_1 = __importDefault(require("./node"));
var Namespace = /** @class */ (function (_super) {
    __extends(Namespace, _super);
    function Namespace() {
        return _super !== null && _super.apply(this, arguments) || this;
    }
    Object.defineProperty(Namespace.prototype, "namespace", {
        get: function () {
            return this._namespace;
        },
        set: function (namespace) {
            if (namespace === true || namespace === "*" || namespace === "&") {
                this._namespace = namespace;
                if (this.raws) {
                    delete this.raws.namespace;
                }
                return;
            }
            var escaped = (0, cssesc_1.default)(namespace, { isIdentifier: true });
            this._namespace = namespace;
            if (escaped !== namespace) {
                (0, util_1.ensureObject)(this, "raws");
                this.raws.namespace = escaped;
            }
            else if (this.raws) {
                delete this.raws.namespace;
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Namespace.prototype, "ns", {
        get: function () {
            return this._namespace;
        },
        set: function (namespace) {
            this.namespace = namespace;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Namespace.prototype, "namespaceString", {
        get: function () {
            if (this.namespace) {
                var ns = this.stringifyProperty("namespace");
                if (ns === true) {
                    return "";
                }
                else {
                    return ns;
                }
            }
            else {
                return "";
            }
        },
        enumerable: false,
        configurable: true
    });
    Namespace.prototype.qualifiedName = function (value) {
        if (this.namespace) {
            return "".concat(this.namespaceString, "|").concat(value);
        }
        else {
            return value;
        }
    };
    Namespace.prototype.valueToString = function () {
        return this.qualifiedName(_super.prototype.valueToString.call(this));
    };
    return Namespace;
}(node_1.default));
exports.default = Namespace;
//# sourceMappingURL=namespace.js.map㶼Xxs"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var node_1 = __importDefault(require("./node"));
var types_1 = require("./types");
var Nesting = /** @class */ (function (_super) {
    __extends(Nesting, _super);
    function Nesting(opts) {
        var _this = _super.call(this, opts) || this;
        _this.type = types_1.NESTING;
        _this.value = "&";
        return _this;
    }
    return Nesting;
}(node_1.default));
exports.default = Nesting;
//# sourceMappingURL=nesting.js.map&⻥x4"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var util_1 = require("../util");
var cloneNode = function (obj, parent, depth) {
    if (depth === void 0) { depth = 0; }
    // Bound recursion so a pathologically deep node tree raises a catchable
    // error instead of overflowing the call stack (CVE-2026-9358 / CWE-674).
    if (depth > util_1.MAX_NESTING_DEPTH) {
        throw new Error("Cannot clone selector: nesting depth exceeds the maximum of ".concat(util_1.MAX_NESTING_DEPTH, "."));
    }
    if (typeof obj !== "object" || obj === null) {
        return obj;
    }
    var cloned = new obj.constructor();
    for (var i in obj) {
        if (!obj.hasOwnProperty(i)) {
            continue;
        }
        var value = obj[i];
        var type = typeof value;
        if (i === "parent" && type === "object") {
            if (parent) {
                cloned[i] = parent;
            }
        }
        else if (value instanceof Array) {
            cloned[i] = value.map(function (j) { return cloneNode(j, cloned, depth + 1); });
        }
        else {
            cloned[i] = cloneNode(value, cloned, depth + 1);
        }
    }
    return cloned;
};
var Node = /** @class */ (function () {
    function Node(opts) {
        if (opts === void 0) { opts = {}; }
        Object.assign(this, opts);
        this.spaces = this.spaces || {};
        this.spaces.before = this.spaces.before || "";
        this.spaces.after = this.spaces.after || "";
    }
    Node.prototype.remove = function () {
        if (this.parent) {
            this.parent.removeChild(this);
        }
        this.parent = undefined;
        return this;
    };
    Node.prototype.replaceWith = function () {
        if (this.parent) {
            for (var index in arguments) {
                this.parent.insertBefore(this, arguments[index]);
            }
            this.remove();
        }
        return this;
    };
    Node.prototype.next = function () {
        return this.parent.at(this.parent.index(this) + 1);
    };
    Node.prototype.prev = function () {
        return this.parent.at(this.parent.index(this) - 1);
    };
    Node.prototype.clone = function (overrides) {
        if (overrides === void 0) { overrides = {}; }
        var cloned = cloneNode(this);
        for (var name in overrides) {
            cloned[name] = overrides[name];
        }
        return cloned;
    };
    /**
     * Some non-standard syntax doesn't follow normal escaping rules for css.
     * This allows non standard syntax to be appended to an existing property
     * by specifying the escaped value. By specifying the escaped value,
     * illegal characters are allowed to be directly inserted into css output.
     * @param {string} name the property to set
     * @param {any} value the unescaped value of the property
     * @param {string} valueEscaped optional. the escaped value of the property.
     */
    Node.prototype.appendToPropertyAndEscape = function (name, value, valueEscaped) {
        if (!this.raws) {
            this.raws = {};
        }
        var originalValue = this[name];
        var originalEscaped = this.raws[name];
        this[name] = originalValue + value; // this may trigger a setter that updates raws, so it has to be set first.
        if (originalEscaped || valueEscaped !== value) {
            this.raws[name] = (originalEscaped || originalValue) + valueEscaped;
        }
        else {
            delete this.raws[name]; // delete any escaped value that was created by the setter.
        }
    };
    /**
     * Some non-standard syntax doesn't follow normal escaping rules for css.
     * This allows the escaped value to be specified directly, allowing illegal
     * characters to be directly inserted into css output.
     * @param {string} name the property to set
     * @param {any} value the unescaped value of the property
     * @param {string} valueEscaped the escaped value of the property.
     */
    Node.prototype.setPropertyAndEscape = function (name, value, valueEscaped) {
        if (!this.raws) {
            this.raws = {};
        }
        this[name] = value; // this may trigger a setter that updates raws, so it has to be set first.
        this.raws[name] = valueEscaped;
    };
    /**
     * When you want a value to passed through to CSS directly. This method
     * deletes the corresponding raw value causing the stringifier to fallback
     * to the unescaped value.
     * @param {string} name the property to set.
     * @param {any} value The value that is both escaped and unescaped.
     */
    Node.prototype.setPropertyWithoutEscape = function (name, value) {
        this[name] = value; // this may trigger a setter that updates raws, so it has to be set first.
        if (this.raws) {
            delete this.raws[name];
        }
    };
    /**
     *
     * @param {number} line The number (starting with 1)
     * @param {number} column The column number (starting with 1)
     */
    Node.prototype.isAtPosition = function (line, column) {
        if (this.source && this.source.start && this.source.end) {
            if (this.source.start.line > line) {
                return false;
            }
            if (this.source.end.line < line) {
                return false;
            }
            if (this.source.start.line === line && this.source.start.column > column) {
                return false;
            }
            if (this.source.end.line === line && this.source.end.column < column) {
                return false;
            }
            return true;
        }
        return undefined;
    };
    Node.prototype.stringifyProperty = function (name) {
        return (this.raws && this.raws[name]) || this[name];
    };
    Object.defineProperty(Node.prototype, "rawSpaceBefore", {
        get: function () {
            var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.before;
            if (rawSpace === undefined) {
                rawSpace = this.spaces && this.spaces.before;
            }
            return rawSpace || "";
        },
        set: function (raw) {
            (0, util_1.ensureObject)(this, "raws", "spaces");
            this.raws.spaces.before = raw;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(Node.prototype, "rawSpaceAfter", {
        get: function () {
            var rawSpace = this.raws && this.raws.spaces && this.raws.spaces.after;
            if (rawSpace === undefined) {
                rawSpace = this.spaces.after;
            }
            return rawSpace || "";
        },
        set: function (raw) {
            (0, util_1.ensureObject)(this, "raws", "spaces");
            this.raws.spaces.after = raw;
        },
        enumerable: false,
        configurable: true
    });
    Node.prototype.valueToString = function () {
        return String(this.stringifyProperty("value"));
    };
    Node.prototype.toString = function () {
        return [this.rawSpaceBefore, this.valueToString(), this.rawSpaceAfter].join("");
    };
    // Internal recursion entry point used by Container serialization. Leaf
    // nodes don't recurse, so they ignore the depth/limit and stringify
    // themselves. Containers override this to thread the nesting depth.
    Node.prototype._stringify = function () {
        return this.toString();
    };
    return Node;
}());
exports.default = Node;
//# sourceMappingURL=node.js.map`₵{xJ"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var container_1 = __importDefault(require("./container"));
var types_1 = require("./types");
var Pseudo = /** @class */ (function (_super) {
    __extends(Pseudo, _super);
    function Pseudo(opts) {
        var _this = _super.call(this, opts) || this;
        _this.type = types_1.PSEUDO;
        return _this;
    }
    Pseudo.prototype._stringify = function (options, depth, max) {
        var _this = this;
        if (depth >= max) {
            throw new Error("Cannot serialize selector: nesting depth exceeds the maximum of ".concat(max, "."));
        }
        var params = this.length
            ? "(" +
                this.map(function (child) { return _this._stringifyChild(child, options, depth + 1, max); }).join(",") +
                ")"
            : "";
        return [this.rawSpaceBefore, this.stringifyProperty("value"), params, this.rawSpaceAfter].join("");
    };
    return Pseudo;
}(container_1.default));
exports.default = Pseudo;
//# sourceMappingURL=pseudo.js.map0ax_"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var container_1 = __importDefault(require("./container"));
var types_1 = require("./types");
var Root = /** @class */ (function (_super) {
    __extends(Root, _super);
    function Root(opts) {
        var _this = _super.call(this, opts) || this;
        _this.type = types_1.ROOT;
        return _this;
    }
    Root.prototype._stringify = function (options, depth, max) {
        var _this = this;
        var str = this.reduce(function (memo, selector) {
            memo.push(_this._stringifyChild(selector, options, depth, max));
            return memo;
        }, []).join(",");
        return this.trailingComma ? str + "," : str;
    };
    Root.prototype.error = function (message, options) {
        if (this._error) {
            return this._error(message, options);
        }
        else {
            return new Error(message);
        }
    };
    Object.defineProperty(Root.prototype, "errorGenerator", {
        set: function (handler) {
            this._error = handler;
        },
        enumerable: false,
        configurable: true
    });
    return Root;
}(container_1.default));
exports.default = Root;
//# sourceMappingURL=root.js.mappqXxx"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var container_1 = __importDefault(require("./container"));
var types_1 = require("./types");
var Selector = /** @class */ (function (_super) {
    __extends(Selector, _super);
    function Selector(opts) {
        var _this = _super.call(this, opts) || this;
        _this.type = types_1.SELECTOR;
        return _this;
    }
    return Selector;
}(container_1.default));
exports.default = Selector;
//# sourceMappingURL=selector.js.mapͫ-Vxj"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var node_1 = __importDefault(require("./node"));
var types_1 = require("./types");
var String = /** @class */ (function (_super) {
    __extends(String, _super);
    function String(opts) {
        var _this = _super.call(this, opts) || this;
        _this.type = types_1.STRING;
        return _this;
    }
    return String;
}(node_1.default));
exports.default = String;
//# sourceMappingURL=string.js.mapVxd"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var namespace_1 = __importDefault(require("./namespace"));
var types_1 = require("./types");
var Tag = /** @class */ (function (_super) {
    __extends(Tag, _super);
    function Tag(opts) {
        var _this = _super.call(this, opts) || this;
        _this.type = types_1.TAG;
        return _this;
    }
    return Tag;
}(namespace_1.default));
exports.default = Tag;
//# sourceMappingURL=tag.js.map)xm"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.UNIVERSAL = exports.ATTRIBUTE = exports.CLASS = exports.COMBINATOR = exports.COMMENT = exports.ID = exports.NESTING = exports.PSEUDO = exports.ROOT = exports.SELECTOR = exports.STRING = exports.TAG = void 0;
exports.TAG = "tag";
exports.STRING = "string";
exports.SELECTOR = "selector";
exports.ROOT = "root";
exports.PSEUDO = "pseudo";
exports.NESTING = "nesting";
exports.ID = "id";
exports.COMMENT = "comment";
exports.COMBINATOR = "combinator";
exports.CLASS = "class";
exports.ATTRIBUTE = "attribute";
exports.UNIVERSAL = "universal";
//# sourceMappingURL=types.js.maphZxV"use strict";
var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        if (typeof b !== "function" && b !== null)
            throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var namespace_1 = __importDefault(require("./namespace"));
var types_1 = require("./types");
var Universal = /** @class */ (function (_super) {
    __extends(Universal, _super);
    function Universal(opts) {
        var _this = _super.call(this, opts) || this;
        _this.type = types_1.UNIVERSAL;
        _this.value = "*";
        return _this;
    }
    return Universal;
}(namespace_1.default));
exports.default = Universal;
//# sourceMappingURL=universal.js.mapǥx "use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = sortAscending;
function sortAscending(list) {
    return list.sort(function (a, b) { return a - b; });
}
//# sourceMappingURL=sortAscending.js.map6Tx"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.combinator = exports.word = exports.comment = exports.str = exports.tab = exports.newline = exports.feed = exports.cr = exports.backslash = exports.bang = exports.slash = exports.doubleQuote = exports.singleQuote = exports.space = exports.greaterThan = exports.pipe = exports.equals = exports.plus = exports.caret = exports.tilde = exports.dollar = exports.closeSquare = exports.openSquare = exports.closeParenthesis = exports.openParenthesis = exports.semicolon = exports.colon = exports.comma = exports.at = exports.asterisk = exports.ampersand = void 0;
exports.ampersand = 38; // `&`.charCodeAt(0);
exports.asterisk = 42; // `*`.charCodeAt(0);
exports.at = 64; // `@`.charCodeAt(0);
exports.comma = 44; // `,`.charCodeAt(0);
exports.colon = 58; // `:`.charCodeAt(0);
exports.semicolon = 59; // `;`.charCodeAt(0);
exports.openParenthesis = 40; // `(`.charCodeAt(0);
exports.closeParenthesis = 41; // `)`.charCodeAt(0);
exports.openSquare = 91; // `[`.charCodeAt(0);
exports.closeSquare = 93; // `]`.charCodeAt(0);
exports.dollar = 36; // `$`.charCodeAt(0);
exports.tilde = 126; // `~`.charCodeAt(0);
exports.caret = 94; // `^`.charCodeAt(0);
exports.plus = 43; // `+`.charCodeAt(0);
exports.equals = 61; // `=`.charCodeAt(0);
exports.pipe = 124; // `|`.charCodeAt(0);
exports.greaterThan = 62; // `>`.charCodeAt(0);
exports.space = 32; // ` `.charCodeAt(0);
exports.singleQuote = 39; // `'`.charCodeAt(0);
exports.doubleQuote = 34; // `"`.charCodeAt(0);
exports.slash = 47; // `/`.charCodeAt(0);
exports.bang = 33; // `!`.charCodeAt(0);
exports.backslash = 92; // '\\'.charCodeAt(0);
exports.cr = 13; // '\r'.charCodeAt(0);
exports.feed = 12; // '\f'.charCodeAt(0);
exports.newline = 10; // '\n'.charCodeAt(0);
exports.tab = 9; // '\t'.charCodeAt(0);
// Expose aliases primarily for readability.
exports.str = exports.singleQuote;
// No good single character representation!
exports.comment = -1;
exports.word = -2;
exports.combinator = -3;
//# sourceMappingURL=tokenTypes.js.map箊x0&"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || (function () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
var _a, _b;
Object.defineProperty(exports, "__esModule", { value: true });
exports.FIELDS = void 0;
exports.default = tokenize;
var t = __importStar(require("./tokenTypes"));
var unescapable = (_a = {},
    _a[t.tab] = true,
    _a[t.newline] = true,
    _a[t.cr] = true,
    _a[t.feed] = true,
    _a);
var wordDelimiters = (_b = {},
    _b[t.space] = true,
    _b[t.tab] = true,
    _b[t.newline] = true,
    _b[t.cr] = true,
    _b[t.feed] = true,
    _b[t.ampersand] = true,
    _b[t.asterisk] = true,
    _b[t.bang] = true,
    _b[t.comma] = true,
    _b[t.colon] = true,
    _b[t.semicolon] = true,
    _b[t.openParenthesis] = true,
    _b[t.closeParenthesis] = true,
    _b[t.openSquare] = true,
    _b[t.closeSquare] = true,
    _b[t.singleQuote] = true,
    _b[t.doubleQuote] = true,
    _b[t.plus] = true,
    _b[t.pipe] = true,
    _b[t.tilde] = true,
    _b[t.greaterThan] = true,
    _b[t.equals] = true,
    _b[t.dollar] = true,
    _b[t.caret] = true,
    _b[t.slash] = true,
    _b);
var hex = {};
var hexChars = "0123456789abcdefABCDEF";
for (var i = 0; i < hexChars.length; i++) {
    hex[hexChars.charCodeAt(i)] = true;
}
/**
 *  Returns the last index of the bar css word
 * @param {string} css The string in which the word begins
 * @param {number} start The index into the string where word's first letter occurs
 */
function consumeWord(css, start) {
    var next = start;
    var code;
    do {
        code = css.charCodeAt(next);
        if (wordDelimiters[code]) {
            return next - 1;
        }
        else if (code === t.backslash) {
            next = consumeEscape(css, next) + 1;
        }
        else {
            // All other characters are part of the word
            next++;
        }
    } while (next < css.length);
    return next - 1;
}
/**
 *  Returns the last index of the escape sequence
 * @param {string} css The string in which the sequence begins
 * @param {number} start The index into the string where escape character (`\`) occurs.
 */
function consumeEscape(css, start) {
    var next = start;
    var code = css.charCodeAt(next + 1);
    if (unescapable[code]) {
        // just consume the escape char
    }
    else if (hex[code]) {
        var hexDigits = 0;
        // consume up to 6 hex chars
        do {
            next++;
            hexDigits++;
            code = css.charCodeAt(next + 1);
        } while (hex[code] && hexDigits < 6);
        // if fewer than 6 hex chars, a trailing space ends the escape
        if (hexDigits < 6 && code === t.space) {
            next++;
        }
    }
    else {
        // the next char is part of the current word
        next++;
    }
    return next;
}
exports.FIELDS = {
    TYPE: 0,
    START_LINE: 1,
    START_COL: 2,
    END_LINE: 3,
    END_COL: 4,
    START_POS: 5,
    END_POS: 6,
};
function tokenize(input) {
    var tokens = [];
    var css = input.css.valueOf();
    var length = css.length;
    var offset = -1;
    var line = 1;
    var start = 0;
    var end = 0;
    var code, content, endColumn, endLine, escaped, escapePos, last, lines, next, nextLine, nextOffset, quote, tokenType;
    function unclosed(what, fix) {
        if (input.safe) {
            // fyi: this is never set to true.
            css += fix;
            next = css.length - 1;
        }
        else {
            throw input.error("Unclosed " + what, line, start - offset, start);
        }
    }
    while (start < length) {
        code = css.charCodeAt(start);
        if (code === t.newline) {
            offset = start;
            line += 1;
        }
        switch (code) {
            case t.space:
            case t.tab:
            case t.newline:
            case t.cr:
            case t.feed:
                next = start;
                do {
                    next += 1;
                    code = css.charCodeAt(next);
                    if (code === t.newline) {
                        offset = next;
                        line += 1;
                    }
                } while (code === t.space ||
                    code === t.newline ||
                    code === t.tab ||
                    code === t.cr ||
                    code === t.feed);
                tokenType = t.space;
                endLine = line;
                endColumn = next - offset - 1;
                end = next;
                break;
            case t.plus:
            case t.greaterThan:
            case t.tilde:
            case t.pipe:
                next = start;
                do {
                    next += 1;
                    code = css.charCodeAt(next);
                } while (code === t.plus || code === t.greaterThan || code === t.tilde || code === t.pipe);
                tokenType = t.combinator;
                endLine = line;
                endColumn = start - offset;
                end = next;
                break;
            // Consume these characters as single tokens.
            case t.asterisk:
            case t.ampersand:
            case t.bang:
            case t.comma:
            case t.equals:
            case t.dollar:
            case t.caret:
            case t.openSquare:
            case t.closeSquare:
            case t.colon:
            case t.semicolon:
            case t.openParenthesis:
            case t.closeParenthesis:
                next = start;
                tokenType = code;
                endLine = line;
                endColumn = start - offset;
                end = next + 1;
                break;
            case t.singleQuote:
            case t.doubleQuote:
                quote = code === t.singleQuote ? "'" : '"';
                next = start;
                do {
                    escaped = false;
                    next = css.indexOf(quote, next + 1);
                    if (next === -1) {
                        unclosed("quote", quote);
                    }
                    escapePos = next;
                    while (css.charCodeAt(escapePos - 1) === t.backslash) {
                        escapePos -= 1;
                        escaped = !escaped;
                    }
                } while (escaped);
                tokenType = t.str;
                endLine = line;
                endColumn = start - offset;
                end = next + 1;
                break;
            default:
                if (code === t.slash && css.charCodeAt(start + 1) === t.asterisk) {
                    next = css.indexOf("*/", start + 2) + 1;
                    if (next === 0) {
                        unclosed("comment", "*/");
                    }
                    content = css.slice(start, next + 1);
                    lines = content.split("\n");
                    last = lines.length - 1;
                    if (last > 0) {
                        nextLine = line + last;
                        nextOffset = next - lines[last].length;
                    }
                    else {
                        nextLine = line;
                        nextOffset = offset;
                    }
                    tokenType = t.comment;
                    line = nextLine;
                    endLine = nextLine;
                    endColumn = next - nextOffset;
                }
                else if (code === t.slash) {
                    next = start;
                    tokenType = code;
                    endLine = line;
                    endColumn = start - offset;
                    end = next + 1;
                }
                else {
                    next = consumeWord(css, start);
                    tokenType = t.word;
                    endLine = line;
                    endColumn = next - offset;
                }
                end = next + 1;
                break;
        }
        // Ensure that the token structure remains consistent
        tokens.push([
            tokenType, // [0] Token type
            line, // [1] Starting line
            start - offset, // [2] Starting column
            endLine, // [3] Ending line
            endColumn, // [4] Ending column
            start, // [5] Start position / Source index
            end, // [6] End position
        ]);
        // Reset offset for the next token
        if (nextOffset) {
            offset = nextOffset;
            nextOffset = null;
        }
        start = end;
    }
    return tokens;
}
//# sourceMappingURL=tokenize.js.map<x 100644 ensureObject.js |d`͐[r|7|f100644 getProp.js ij`
I|̩x100644 index.js amYSz}PO/100644 maxNestingDepth.js HDn}BÝQf100644 stripComments.js 3ԡFEq@̺5#
100644 unesc.js ]AB\ŃA -fb5x6"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = ensureObject;
function ensureObject(obj) {
    var props = [];
    for (var _i = 1; _i < arguments.length; _i++) {
        props[_i - 1] = arguments[_i];
    }
    while (props.length > 0) {
        var prop = props.shift();
        if (!obj[prop]) {
            obj[prop] = {};
        }
        obj = obj[prop];
    }
}
//# sourceMappingURL=ensureObject.js.mapЋx3"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = getProp;
function getProp(obj) {
    var props = [];
    for (var _i = 1; _i < arguments.length; _i++) {
        props[_i - 1] = arguments[_i];
    }
    while (props.length > 0) {
        var prop = props.shift();
        if (!obj[prop]) {
            return undefined;
        }
        obj = obj[prop];
    }
    return obj;
}
//# sourceMappingURL=getProp.js.mapĲZxP"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.MAX_NESTING_DEPTH = exports.resolveMaxNestingDepth = exports.stripComments = exports.ensureObject = exports.getProp = exports.unesc = void 0;
var unesc_1 = require("./unesc");
Object.defineProperty(exports, "unesc", { enumerable: true, get: function () { return __importDefault(unesc_1).default; } });
var getProp_1 = require("./getProp");
Object.defineProperty(exports, "getProp", { enumerable: true, get: function () { return __importDefault(getProp_1).default; } });
var ensureObject_1 = require("./ensureObject");
Object.defineProperty(exports, "ensureObject", { enumerable: true, get: function () { return __importDefault(ensureObject_1).default; } });
var stripComments_1 = require("./stripComments");
Object.defineProperty(exports, "stripComments", { enumerable: true, get: function () { return __importDefault(stripComments_1).default; } });
var maxNestingDepth_1 = require("./maxNestingDepth");
Object.defineProperty(exports, "resolveMaxNestingDepth", { enumerable: true, get: function () { return __importDefault(maxNestingDepth_1).default; } });
Object.defineProperty(exports, "MAX_NESTING_DEPTH", { enumerable: true, get: function () { return maxNestingDepth_1.MAX_NESTING_DEPTH; } });
//# sourceMappingURL=index.js.map" @Fxh"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.MAX_NESTING_DEPTH = void 0;
exports.default = resolveMaxNestingDepth;
/**
 * The default maximum selector nesting depth allowed when parsing or
 * serializing a selector. Going beyond this would otherwise recurse deeply
 * enough to overflow the call stack (CVE-2026-9358 / CWE-674). Real-world
 * selectors never get anywhere near this, so it acts purely as a safety net
 * that turns an uncatchable stack overflow into a catchable error.
 */
exports.MAX_NESTING_DEPTH = 256;
/**
 * Coerce a user-supplied nesting-depth limit into a safe value. Anything that
 * is not a non-negative safe integer (NaN, Infinity, negative numbers, or a
 * non-number) would disable or break the guard, so it falls back to the
 * default.
 *
 * @param {unknown} value the limit provided through the `maxNestingDepth` option
 * @returns {number} a safe, non-negative integer limit
 */
function resolveMaxNestingDepth(value) {
    return Number.isSafeInteger(value) && value >= 0 ? value : exports.MAX_NESTING_DEPTH;
}
//# sourceMappingURL=maxNestingDepth.js.map?%x]"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = stripComments;
function stripComments(str) {
    var s = "";
    var commentStart = str.indexOf("/*");
    var lastEnd = 0;
    while (commentStart >= 0) {
        s = s + str.slice(lastEnd, commentStart);
        var commentEnd = str.indexOf("*/", commentStart + 2);
        if (commentEnd < 0) {
            return s;
        }
        lastEnd = commentEnd + 2;
        commentStart = str.indexOf("/*", lastEnd);
    }
    s = s + str.slice(lastEnd);
    return s;
}
//# sourceMappingURL=stripComments.js.mapu޷x
"use strict";
// Many thanks for this post which made this migration much easier.
// https://mathiasbynens.be/notes/css-escapes
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = unesc;
/**
 *
 * @param {string} str
 * @returns {[string, number]|undefined}
 */
function gobbleHex(str) {
    var lower = str.toLowerCase();
    var hex = "";
    var spaceTerminated = false;
    for (var i = 0; i < 6 && lower[i] !== undefined; i++) {
        var code = lower.charCodeAt(i);
        // check to see if we are dealing with a valid hex char [a-f|0-9]
        var valid = (code >= 97 && code <= 102) || (code >= 48 && code <= 57);
        // https://drafts.csswg.org/css-syntax/#consume-escaped-code-point
        spaceTerminated = code === 32;
        if (!valid) {
            break;
        }
        hex += lower[i];
    }
    if (hex.length === 0) {
        return undefined;
    }
    var codePoint = parseInt(hex, 16);
    var isSurrogate = codePoint >= 0xd800 && codePoint <= 0xdfff;
    // Add special case for
    // "If this number is zero, or is for a surrogate, or is greater than the maximum allowed code point"
    // https://drafts.csswg.org/css-syntax/#maximum-allowed-code-point
    if (isSurrogate || codePoint === 0x0000 || codePoint > 0x10ffff) {
        return ["\uFFFD", hex.length + (spaceTerminated ? 1 : 0)];
    }
    return [String.fromCodePoint(codePoint), hex.length + (spaceTerminated ? 1 : 0)];
}
var CONTAINS_ESCAPE = /\\/;
function unesc(str) {
    var needToProcess = CONTAINS_ESCAPE.test(str);
    if (!needToProcess) {
        return str;
    }
    var ret = "";
    for (var i = 0; i < str.length; i++) {
        if (str[i] === "\\") {
            var gobbled = gobbleHex(str.slice(i + 1, i + 7));
            if (gobbled !== undefined) {
                ret += gobbled[0];
                i += gobbled[1];
                continue;
            }
            // Retain a pair of \\ if double escaped `\\\\`
            // https://github.com/postcss/postcss-selector-parser/commit/268c9a7656fb53f543dc620aa5b73a30ec3ff20e
            if (str[i + 1] === "\\") {
                ret += "\\";
                i++;
                continue;
            }
            // if \\ is at the end of the string retain it
            // https://github.com/postcss/postcss-selector-parser/commit/01a6b346e3612ce1ab20219acc26abdc259ccefb
            if (str.length === i + 1) {
                ret += str[i];
            }
            continue;
        }
        ret += str[i];
    }
    return ret;
}
//# sourceMappingURL=unesc.js.map5zxV{
  "name": "postcss-selector-parser",
  "description": "Selector parser with built in methods for working with selector strings.",
  "version": "7.1.4",
  "devDependencies": {
    "oxfmt": "^0.54.0",
    "oxlint": "^1.69.0",
    "postcss": "^8.4.31",
    "typescript": "^5.4.0"
  },
  "main": "dist/index.js",
  "types": "postcss-selector-parser.d.ts",
  "files": [
    "API.md",
    "CHANGELOG.md",
    "LICENSE-MIT",
    "dist",
    "postcss-selector-parser.d.ts",
    "!**/__tests__",
    "!dist/**/*.map"
  ],
  "scripts": {
    "clean": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\"",
    "build": "npm run clean && tsc",
    "typecheck": "tsc --noEmit --strict postcss-selector-parser.d.ts postcss-selector-parser.test.ts",
    "lint": "oxlint",
    "lint:fix": "oxlint --fix",
    "format": "oxfmt src",
    "format:check": "oxfmt --check src",
    "pretests": "npm run build",
    "tests": "node --test src/__tests__/*.mjs",
    "precoverage": "npm run build",
    "coverage": "node --enable-source-maps --test --experimental-test-coverage --test-coverage-exclude=\"**/__tests__/**\" --test-coverage-lines=94 --test-coverage-branches=94 --test-coverage-functions=96 --test-reporter=spec src/__tests__/*.mjs",
    "test": "npm run lint && npm run typecheck && npm run coverage",
    "prepare": "npm run build",
    "release": "npx npmpub"
  },
  "dependencies": {
    "cssesc": "^3.0.0",
    "util-deprecate": "^1.0.2"
  },
  "license": "MIT",
  "engines": {
    "node": ">=4"
  },
  "homepage": "https://github.com/postcss/postcss-selector-parser",
  "contributors": [
    {
      "name": "Ben Briggs",
      "email": "beneb.info@gmail.com",
      "url": "http://beneb.info"
    },
    {
      "name": "Chris Eppstein",
      "email": "chris@eppsteins.net",
      "url": "http://twitter.com/chriseppstein"
    }
  ],
  "repository": {
    "type": "git",
    "url": "https://github.com/postcss/postcss-selector-parser.git"
  }
}
)P
xT^// Type definitions for postcss-selector-parser 2.2.3
// Definitions by: Chris Eppstein <chris@eppsteins.net>

/*~ Note that ES6 modules cannot directly export callable functions.
 *~ This file should be imported using the CommonJS-style:
 *~   import x = require('someLibrary');
 *~
 *~ Refer to the documentation to understand common
 *~ workarounds for this limitation of ES6 modules.
 */

/*~ This declaration specifies that the function
 *~ is the exported object from the file
 */
export = parser;

// A type that's T but not U.
type Diff<T, U> = T extends U ? never : T;

// TODO: Conditional types in TS 1.8 will really clean this up.
declare function parser(): parser.Processor<never>;
declare function parser<Transform>(processor: parser.AsyncProcessor<Transform>): parser.Processor<Transform, never>;
declare function parser(processor: parser.AsyncProcessor<void>): parser.Processor<never, never>;
declare function parser<Transform>(processor: parser.SyncProcessor<Transform>): parser.Processor<Transform>;
declare function parser(processor: parser.SyncProcessor<void>): parser.Processor<never>;
declare function parser<Transform>(processor?: parser.SyncProcessor<Transform> | parser.AsyncProcessor<Transform>): parser.Processor<Transform>;

/*~ If you want to expose types from your module as well, you can
 *~ place them in this block. Often you will want to describe the
 *~ shape of the return type of the function; that type should
 *~ be declared in here, as this example shows.
 */
declare namespace parser {
    /* copied from postcss -- so we don't need to add a dependency */
    type ErrorOptions = {
        plugin?: string;
        word?: string;
        index?: number
    };
    /* the bits we use of postcss.Rule, copied from postcss -- so we don't need to add a dependency */
    type PostCSSRuleNode = {
        selector: string
        /**
         * @returns postcss.CssSyntaxError but it's a complex object, caller
         *   should cast to it if they have a dependency on postcss.
         */
        error(message: string, options?: ErrorOptions): Error;
    };
    /** Accepts a string  */
    type Selectors = string | PostCSSRuleNode
    type ProcessorFn<ReturnType = void> = (root: parser.Root) => ReturnType;
    type SyncProcessor<Transform = void> = ProcessorFn<Transform>;
    type AsyncProcessor<Transform = void> = ProcessorFn<PromiseLike<Transform>>;

    const TAG: "tag";
    const STRING: "string";
    const SELECTOR: "selector";
    const ROOT: "root";
    const PSEUDO: "pseudo";
    const NESTING: "nesting";
    const ID: "id";
    const COMMENT: "comment";
    const COMBINATOR: "combinator";
    const CLASS: "class";
    const ATTRIBUTE: "attribute";
    const UNIVERSAL: "universal";

    interface NodeTypes {
        tag: Tag,
        string: String,
        selector: Selector,
        root: Root,
        pseudo: Pseudo,
        nesting: Nesting,
        id: Identifier,
        comment: Comment,
        combinator: Combinator,
        class: ClassName,
        attribute: Attribute,
        universal: Universal
    }

    type Node = NodeTypes[keyof NodeTypes];

    function isNode(node: any): node is Node;

    interface Options {
        /**
         * Preserve whitespace when true. Default: true;
         */
        lossless: boolean;
        /**
         * When true and a postcss.Rule is passed, set the result of
         * processing back onto the rule when done. Default: true.
         */
        updateSelector: boolean;
        /**
         * The maximum selector nesting depth allowed while parsing. Selectors
         * nested deeper than this (e.g. `:not(:not(:not(…)))`) raise an error
         * instead of overflowing the call stack. Default: 256.
         */
        maxNestingDepth: number;
    }
    interface StringifyOptions {
        /**
         * The maximum selector nesting depth allowed while serializing.
         * Serializing an AST nested deeper than this raises an error instead of
         * overflowing the call stack. Default: 256.
         */
        maxNestingDepth?: number;
    }
    class Processor<
        TransformType = never,
        SyncSelectorsType extends Selectors | never = Selectors
    > {
        res: Root;
        readonly result: String;
        ast(selectors: Selectors, options?: Partial<Options>): Promise<Root>;
        astSync(selectors: SyncSelectorsType, options?: Partial<Options>): Root;
        transform(selectors: Selectors, options?: Partial<Options>): Promise<TransformType>;
        transformSync(selectors: SyncSelectorsType, options?: Partial<Options>): TransformType;
        process(selectors: Selectors, options?: Partial<Options>): Promise<string>;
        processSync(selectors: SyncSelectorsType, options?: Partial<Options>): string;
    }
    interface ParserOptions {
        css: string;
        error: (message: string, options: ErrorOptions) => Error;
        options: Options;
    }
    class Parser {
        input: ParserOptions;
        lossy: boolean;
        position: number;
        root: Root;
        selectors: string;
        current: Selector;
        constructor(input: ParserOptions);
        /**
         * Raises an error, if the processor is invoked on
         * a postcss Rule node, a better error message is raised.
         */
        error(message: string, options?: ErrorOptions): void;
    }
    interface NodeSource {
        start?: {
            line: number,
            column: number
        },
        end?: {
            line: number,
            column: number
        }
    }
    interface SpaceAround {
      before: string;
      after: string;
    }
    interface Spaces extends SpaceAround {
      [spaceType: string]: string | Partial<SpaceAround> | undefined;
    }
    interface NodeOptions<Value = string> {
        value: Value;
        spaces?: Partial<Spaces>;
        source?: NodeSource;
        sourceIndex?: number;
    }
    interface Base<
        Value extends string | undefined = string,
        ParentType extends Container | undefined = Container | undefined
    > {
        type: keyof NodeTypes;
        parent: ParentType;
        value: Value;
        spaces: Spaces;
        source?: NodeSource;
        sourceIndex: number;
        rawSpaceBefore: string;
        rawSpaceAfter: string;
        remove(): Node;
        replaceWith(...nodes: Node[]): Node;
        next(): Node | undefined;
        prev(): Node | undefined;
        clone(opts?: {[override: string]:any}): this;
        /**
         * Return whether this node includes the character at the position of the given line and column.
         * Returns undefined if the nodes lack sufficient source metadata to determine the position.
         * @param line 1-index based line number relative to the start of the selector.
         * @param column 1-index based column number relative to the start of the selector.
         */
        isAtPosition(line: number, column: number): boolean | undefined;
        /**
         * Some non-standard syntax doesn't follow normal escaping rules for css,
         * this allows the escaped value to be specified directly, allowing illegal characters to be
         * directly inserted into css output.
         * @param name the property to set
         * @param value the unescaped value of the property
         * @param valueEscaped optional. the escaped value of the property.
         */
        setPropertyAndEscape(name: string, value: any, valueEscaped: string): void;
        /**
         * When you want a value to passed through to CSS directly. This method
         * deletes the corresponding raw value causing the stringifier to fallback
         * to the unescaped value.
         * @param name the property to set.
         * @param value The value that is both escaped and unescaped.
         */
        setPropertyWithoutEscape(name: string, value: any): void;
        /**
         * Some non-standard syntax doesn't follow normal escaping rules for css.
         * This allows non standard syntax to be appended to an existing property
         * by specifying the escaped value. By specifying the escaped value,
         * illegal characters are allowed to be directly inserted into css output.
         * @param {string} name the property to set
         * @param {any} value the unescaped value of the property
         * @param {string} valueEscaped optional. the escaped value of the property.
         */
        appendToPropertyAndEscape(name: string, value: any, valueEscaped: string): void;
        toString(options?: StringifyOptions): string;
    }
    interface ContainerOptions extends NodeOptions {
        nodes?: Array<Node>;
    }
    interface Container<
        Value extends string | undefined = string,
        Child extends Node = Node
    > extends Base<Value> {
        nodes: Array<Child>;
        append(selector: Child): this;
        prepend(selector: Child): this;
        at(index: number): Child;
        /**
         * Return the most specific node at the line and column number given.
         * The source location is based on the original parsed location, locations aren't
         * updated as selector nodes are mutated.
         *
         * Note that this location is relative to the location of the first character
         * of the selector, and not the location of the selector in the overall document
         * when used in conjunction with postcss.
         *
         * If not found, returns undefined.
         * @param line The line number of the node to find. (1-based index)
         * @param col  The column number of the node to find. (1-based index)
         */
        atPosition(line: number, column: number): Child;
        index(child: Child): number;
        readonly first: Child;
        readonly last: Child;
        readonly length: number;
        removeChild(child: Child): this;
        removeAll(): this;
        empty(): this;
        insertAfter(oldNode: Child, newNode: Child, ...restNode: Child[]): this;
        insertBefore(oldNode: Child, newNode: Child, ...restNode: Child[]): this;
        each(callback: (node: Child, index: number) => boolean | void): boolean | undefined;
        walk(
            callback: (node: Node, index: number) => boolean | void
        ): boolean | undefined;
        walkAttributes(
            callback: (node: Attribute) => boolean | void
        ): boolean | undefined;
        walkClasses(
            callback: (node: ClassName) => boolean | void
        ): boolean | undefined;
        walkCombinators(
            callback: (node: Combinator) => boolean | void
        ): boolean | undefined;
        walkComments(
            callback: (node: Comment) => boolean | void
        ): boolean | undefined;
        walkIds(
            callback: (node: Identifier) => boolean | void
        ): boolean | undefined;
        walkNesting(
            callback: (node: Nesting) => boolean | void
        ): boolean | undefined;
        walkPseudos(
            callback: (node: Pseudo) => boolean | void
        ): boolean | undefined;
        walkTags(callback: (node: Tag) => boolean | void): boolean | undefined;
        walkUniversals(callback: (node: Universal) => boolean | void): boolean | undefined;
        split(callback: (node: Child) => boolean): [Child[], Child[]];
        map<T>(callback: (node: Child) => T): T[];
        reduce(
            callback: (
                previousValue: Child,
                currentValue: Child,
                currentIndex: number,
                array: readonly Child[]
            ) => Child
        ): Child;
        reduce(
            callback: (
                previousValue: Child,
                currentValue: Child,
                currentIndex: number,
                array: readonly Child[]
            ) => Child,
            initialValue: Child
        ): Child;
        reduce<T>(
            callback: (
                previousValue: T,
                currentValue: Child,
                currentIndex: number,
                array: readonly Child[]
            ) => T,
            initialValue: T
        ): T;
        every(callback: (node: Child) => boolean): boolean;
        some(callback: (node: Child) => boolean): boolean;
        filter(callback: (node: Child) => boolean): Child[];
        sort(callback: (nodeA: Child, nodeB: Child) => number): Child[];
        toString(options?: StringifyOptions): string;
    }
    function isContainer(node: any): node is Root | Selector | Pseudo;

    interface NamespaceOptions<Value extends string | undefined = string> extends NodeOptions<Value> {
        namespace?: string | true;
    }
    interface Namespace<Value extends string | undefined = string> extends Base<Value> {
        /** alias for namespace */
        ns: string | true;
        /**
         *  namespace prefix.
         */
        namespace: string | true;
        /**
         * If a namespace exists, prefix the value provided with it, separated by |.
         */
        qualifiedName(value: string): string;
        /**
         * A string representing the namespace suitable for output.
         */
        readonly namespaceString: string;
    }
    function isNamespace(node: any): node is Attribute | Tag;

    interface Root extends Container<undefined, Selector> {
        type: "root";
        /**
         * Raises an error, if the processor is invoked on
         * a postcss Rule node, a better error message is raised.
         */
        error(message: string, options?: ErrorOptions): Error;
        nodeAt(line: number, column: number): Node
    }
    function root(opts: ContainerOptions): Root;
    function isRoot(node: any): node is Root;

    interface _Selector<S> extends Container<string, Diff<Node, S>> {
        type: "selector";
    }
    type Selector = _Selector<Selector>;
    function selector(opts: ContainerOptions): Selector;
    function isSelector(node: any): node is Selector;

    interface CombinatorRaws {
        value?: string;
        spaces?: {
            before?: string;
            after?: string;
        };
    }
    interface Combinator extends Base {
        type: "combinator";
        raws?: CombinatorRaws;
    }
    function combinator(opts: NodeOptions): Combinator;
    function isCombinator(node: any): node is Combinator;

    interface ClassName extends Base {
        type: "class";
    }
    function className(opts: NamespaceOptions): ClassName;
    function isClassName(node: any): node is ClassName;

    type AttributeOperator = "=" | "~=" | "|=" | "^=" | "$=" | "*=";
    type QuoteMark = '"' | "'" | null;
    interface PreferredQuoteMarkOptions {
        quoteMark?: QuoteMark;
        preferCurrentQuoteMark?: boolean;
    }
    interface SmartQuoteMarkOptions extends PreferredQuoteMarkOptions {
        smart?: boolean;
    }
    interface AttributeOptions extends NamespaceOptions<string | undefined> {
        attribute: string;
        operator?: AttributeOperator;
        insensitive?: boolean;
        quoteMark?: QuoteMark;
        /** @deprecated Use quoteMark instead. */
        quoted?: boolean;
        spaces?: {
            before?: string;
            after?: string;
            attribute?: Partial<SpaceAround>;
            operator?: Partial<SpaceAround>;
            value?: Partial<SpaceAround>;
            insensitive?: Partial<SpaceAround>;
        }
        raws: {
            unquoted?: string;
            attribute?: string;
            operator?: string;
            value?: string;
            insensitive?: string;
            spaces?: {
                attribute?: Partial<Spaces>;
                operator?: Partial<Spaces>;
                value?: Partial<Spaces>;
                insensitive?: Partial<Spaces>;
            }
        };
    }
    interface Attribute extends Namespace<string | undefined> {
        type: "attribute";
        attribute: string;
        operator?: AttributeOperator;
        insensitive?: boolean;
        quoteMark: QuoteMark;
        quoted?: boolean;
        spaces: {
            before: string;
            after: string;
            attribute?: Partial<Spaces>;
            operator?: Partial<Spaces>;
            value?: Partial<Spaces>;
            insensitive?: Partial<Spaces>;
        }
        raws: {
            /** @deprecated The attribute value is unquoted, use that instead.. */
            unquoted?: string;
            attribute?: string;
            operator?: string;
            /** The value of the attribute with quotes and escapes. */
            value?: string;
            insensitive?: string;
            spaces?: {
                attribute?: Partial<Spaces>;
                operator?: Partial<Spaces>;
                value?: Partial<Spaces>;
                insensitive?: Partial<Spaces>;
            }
        };
        /**
         * The attribute name after having been qualified with a namespace.
         */
        readonly qualifiedAttribute: string;

        /**
         * The case insensitivity flag or an empty string depending on whether this
         * attribute is case insensitive.
         */
        readonly insensitiveFlag : 'i' | '';

        /**
         * Returns the attribute's value quoted such that it would be legal to use
         * in the value of a css file. The original value's quotation setting
         * used for stringification is left unchanged. See `setValue(value, options)`
         * if you want to control the quote settings of a new value for the attribute or
         * `set quoteMark(mark)` if you want to change the quote settings of the current
         * value.
         *
         * You can also change the quotation used for the current value by setting quoteMark.
         **/
        getQuotedValue(options?: SmartQuoteMarkOptions): string;

        /**
         * Set the unescaped value with the specified quotation options. The value
         * provided must not include any wrapping quote marks -- those quotes will
         * be interpreted as part of the value and escaped accordingly.
         * @param value
         */
        setValue(value: string, options?: SmartQuoteMarkOptions): void;

        /**
         * Intelligently select a quoteMark value based on the value's contents. If
         * the value is a legal CSS ident, it will not be quoted. Otherwise a quote
         * mark will be picked that minimizes the number of escapes.
         *
         * If there's no clear winner, the quote mark from these options is used,
         * then the source quote mark (this is inverted if `preferCurrentQuoteMark` is
         * true). If the quoteMark is unspecified, a double quote is used.
         **/
        smartQuoteMark(options: PreferredQuoteMarkOptions): QuoteMark;

        /**
         * Selects the preferred quote mark based on the options and the current quote mark value.
         * If you want the quote mark to depend on the attribute value, call `smartQuoteMark(opts)`
         * instead.
         */
        preferredQuoteMark(options: PreferredQuoteMarkOptions): QuoteMark

        /**
         * returns the offset of the attribute part specified relative to the
         * start of the node of the output string.
         *
         * * "ns" - alias for "namespace"
         * * "namespace" - the namespace if it exists.
         * * "attribute" - the attribute name
         * * "attributeNS" - the start of the attribute or its namespace
         * * "operator" - the match operator of the attribute
         * * "value" - The value (string or identifier)
         * * "insensitive" - the case insensitivity flag;
         * @param part One of the possible values inside an attribute.
         * @returns -1 if the name is invalid or the value doesn't exist in this attribute.
         */
        offsetOf(part: "ns" | "namespace" | "attribute" | "attributeNS" | "operator" | "value" | "insensitive"): number;
    }
    function attribute(opts: AttributeOptions): Attribute;
    function isAttribute(node: any): node is Attribute;

    interface Pseudo extends Container<string, Selector> {
        type: "pseudo";
    }
    function pseudo(opts: ContainerOptions): Pseudo;
    /**
     * Checks whether the node is the Pseudo subtype of node.
     */
    function isPseudo(node: any): node is Pseudo;

    /**
     * Checks whether the node is, specifically, a pseudo element instead of
     * pseudo class.
     */
    function isPseudoElement(node: any): node is Pseudo;

    /**
     * Checks whether the node is, specifically, a pseudo class instead of
     * pseudo element.
     */
    function isPseudoClass(node: any): node is Pseudo;


    interface Tag extends Namespace {
        type: "tag";
    }
    function tag(opts: NamespaceOptions): Tag;
    function isTag(node: any): node is Tag;

    interface Comment extends Base {
        type: "comment";
    }
    function comment(opts: NodeOptions): Comment;
    function isComment(node: any): node is Comment;

    interface Identifier extends Base {
        type: "id";
    }
    function id(opts: any): Identifier;
    function isIdentifier(node: any): node is Identifier;

    interface Nesting extends Base {
        type: "nesting";
    }
    function nesting(opts?: any): Nesting;
    function isNesting(node: any): node is Nesting;

    interface String extends Base {
        type: "string";
    }
    function string(opts: NodeOptions): String;
    function isString(node: any): node is String;

    interface Universal extends Base {
        type: "universal";
    }
    function universal(opts?: NamespaceOptions): Universal;
    function isUniversal(node: any): node is Universal;
}
	$x I100644 CHANGELOG.md qBM9&SY'100644 LICENSE R[o,;MS'
100644 README.md !.p`jsbj*}40000 lib ԞΞ&CM8sQ!100644 package.json 4H7h1BxƯ9B(x# 1.2.1
- fix version

# 1.2.0
- add `List.remove`
- build with LiveScript 1.6.0
- update dependencies
- remove coverage calculation

# 1.1.2
- add `Func.memoize`
- fix `zip-all` and `zip-with-all` corner case (no input)
- build with LiveScript 1.4.0

# 1.1.1
- curry `unique-by`, `minimum-by`

# 1.1.0
- added `List` functions: `maximum-by`, `minimum-by`, `unique-by`
- added `List` functions: `at`, `elem-index`, `elem-indices`, `find-index`, `find-indices`
- added `Str` functions: `capitalize`, `camelize`, `dasherize`
- added `Func` function: `over` - eg. ``same-length = (==) `over` (.length)``
- exported `Str.repeat` through main `prelude` object
- fixed definition of `foldr` and `foldr1`, the new correct definition is backwards incompatible with the old, incorrect one
- fixed issue with `fix`
- improved code coverage

# 1.0.3
- build browser versions

# 1.0.2
- bug fix for `flatten` - slight change with bug fix, flattens arrays only, not array-like objects

# 1.0.1
- bug fixes for `drop-while` and `take-while`

# 1.0.0
* massive update - separated functions into separate modules
* functions do not accept multiple types anymore - use different versions in their respective modules in some cases (eg. `Obj.map`), or use `chars` or `values` in other cases to transform into a list
* objects are no longer transformed into functions, simply use `(obj.)` in LiveScript to do that
* browser version now using browserify - use `prelude = require('prelude-ls')`
* added `compact`, `split`, `flatten`, `difference`, `intersection`, `union`, `count-by`, `group-by`, `chars`, `unchars`, `apply`
* added `lists-to-obj` which takes a list of keys and list of values and zips them up into an object, and the converse `obj-to-lists`
* added `pairs-to-obj` which takes a list of pairs (2 element lists) and creates an object, and the converse `obj-to-pairs`
* removed `cons`, `append` - use the concat operator
* removed `compose` - use the compose operator
* removed `obj-to-func` - use partially applied access (eg. `(obj.)`)
* removed `length` - use `(.length)`
* `sort-by` renamed to `sort-with`
* added new `sort-by`
* removed `compare` - just use the new `sort-by`
* `break-it` renamed `break-list`, (`Str.break-str` for the string version)
* added `Str.repeat` which creates a new string by repeating the input n times
* `unfold` as alias to `unfoldr` is no longer used
* fixed up style and compiled with LiveScript 1.1.1
* use Make instead of Slake
* greatly improved tests

# 0.6.0
* fixed various bugs
* added `fix`, a fixpoint (Y combinator) for anonymous recursive functions
* added `unfoldr` (alias `unfold`)
* calling `replicate` with a string now returns a list of strings
* removed `partial`, just use native partial application in LiveScript using the `_` placeholder, or currying
* added `sort`, `sortBy`, and `compare`

# 0.5.0
* removed `lookup` - use (.prop)
* removed `call` - use (.func arg1, arg2)
* removed `pluck` - use map (.prop), xs
* fixed buys wtih `head` and `last`
* added non-minifed browser version, as `prelude-browser.js`
* renamed `prelude-min.js` to `prelude-browser-min.js`
* renamed `zip` to `zipAll`
* renamed `zipWith` to `zipAllWith`
* added `zip`, a curried zip that takes only two arguments
* added `zipWith`, a curried zipWith that takes only two arguments

# 0.4.0
* added `parition` function
* added `curry` function
* removed `elem` function (use `in`)
* removed `notElem` function (use `not in`)

# 0.3.0
* added `listToObject`
* added `unique`
* added `objToFunc`
* added support for using strings in map and the like
* added support for using objects in map and the like
* added ability to use objects instead of functions in certain cases
* removed `error` (just use throw)
* added `tau` constant
* added `join`
* added `values`
* added `keys`
* added `partial`
* renamed `log` to `ln`
* added alias to `head`: `first`
* added `installPrelude` helper

# 0.2.0
* removed functions that simply warp operators as you can now use operators as functions in LiveScript
* `min/max` are now curried and take only 2 arguments
* added `call`

# 0.1.0
* initial public release
jg̵&xe# prelude.ls [![Build Status](https://travis-ci.org/gkz/prelude-ls.png?branch=master)](https://travis-ci.org/gkz/prelude-ls)

is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, <a href="http://livescript.net">LiveScript</a>.

See **[the prelude.ls site](http://preludels.com)** for examples, a reference, and more.

You can install via npm `npm install prelude-ls`

### Development

`make test` to test

`make build` to build `lib` from `src`

`make build-browser` to build browser versions
ޠx /100644 Func.js 	wzxܳ?P100644 List.js y>QgR100644 Num.js 1U8dp100644 Obj.js 2
&+I100644 Str.js Y@m`&ji0D}Z'100644 index.js F`J>vEPHgxv// Generated by LiveScript 1.6.0
var apply, curry, flip, fix, over, memoize, toString$ = {}.toString;
apply = curry$(function(f, list){
  return f.apply(null, list);
});
curry = function(f){
  return curry$(f);
};
flip = curry$(function(f, x, y){
  return f(y, x);
});
fix = function(f){
  return function(g){
    return function(){
      return f(g(g)).apply(null, arguments);
    };
  }(function(g){
    return function(){
      return f(g(g)).apply(null, arguments);
    };
  });
};
over = curry$(function(f, g, x, y){
  return f(g(x), g(y));
});
memoize = function(f){
  var memo;
  memo = {};
  return function(){
    var args, res$, i$, to$, key, arg;
    res$ = [];
    for (i$ = 0, to$ = arguments.length; i$ < to$; ++i$) {
      res$.push(arguments[i$]);
    }
    args = res$;
    key = (function(){
      var i$, ref$, len$, results$ = [];
      for (i$ = 0, len$ = (ref$ = args).length; i$ < len$; ++i$) {
        arg = ref$[i$];
        results$.push(arg + toString$.call(arg).slice(8, -1));
      }
      return results$;
    }()).join('');
    return memo[key] = key in memo
      ? memo[key]
      : f.apply(null, args);
  };
};
module.exports = {
  curry: curry,
  flip: flip,
  fix: fix,
  apply: apply,
  over: over,
  memoize: memoize
};
function curry$(f, bound){
  var context,
  _curry = function(args) {
    return f.length > 1 ? function(){
      var params = args ? args.concat() : [];
      context = bound ? context || this : this;
      return params.push.apply(params, arguments) <
          f.length && arguments.length ?
        _curry.call(context, params) : f.apply(context, params);
    } : f;
  };
  return _curry();
}Sx<G// Generated by LiveScript 1.6.0
var each, map, compact, filter, reject, remove, partition, find, head, first, tail, last, initial, empty, reverse, unique, uniqueBy, fold, foldl, fold1, foldl1, foldr, foldr1, unfoldr, concat, concatMap, flatten, difference, intersection, union, countBy, groupBy, andList, orList, any, all, sort, sortWith, sortBy, sum, product, mean, average, maximum, minimum, maximumBy, minimumBy, scan, scanl, scan1, scanl1, scanr, scanr1, slice, take, drop, splitAt, takeWhile, dropWhile, span, breakList, zip, zipWith, zipAll, zipAllWith, at, elemIndex, elemIndices, findIndex, findIndices, toString$ = {}.toString;
each = curry$(function(f, xs){
  var i$, len$, x;
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    x = xs[i$];
    f(x);
  }
  return xs;
});
map = curry$(function(f, xs){
  var i$, len$, x, results$ = [];
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    x = xs[i$];
    results$.push(f(x));
  }
  return results$;
});
compact = function(xs){
  var i$, len$, x, results$ = [];
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    x = xs[i$];
    if (x) {
      results$.push(x);
    }
  }
  return results$;
};
filter = curry$(function(f, xs){
  var i$, len$, x, results$ = [];
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    x = xs[i$];
    if (f(x)) {
      results$.push(x);
    }
  }
  return results$;
});
reject = curry$(function(f, xs){
  var i$, len$, x, results$ = [];
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    x = xs[i$];
    if (!f(x)) {
      results$.push(x);
    }
  }
  return results$;
});
remove = curry$(function(el, xs){
  var i, x$;
  i = elemIndex(el, xs);
  x$ = xs.slice();
  if (i != null) {
    x$.splice(i, 1);
  }
  return x$;
});
partition = curry$(function(f, xs){
  var passed, failed, i$, len$, x;
  passed = [];
  failed = [];
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    x = xs[i$];
    (f(x) ? passed : failed).push(x);
  }
  return [passed, failed];
});
find = curry$(function(f, xs){
  var i$, len$, x;
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    x = xs[i$];
    if (f(x)) {
      return x;
    }
  }
});
head = first = function(xs){
  return xs[0];
};
tail = function(xs){
  if (!xs.length) {
    return;
  }
  return xs.slice(1);
};
last = function(xs){
  return xs[xs.length - 1];
};
initial = function(xs){
  if (!xs.length) {
    return;
  }
  return xs.slice(0, -1);
};
empty = function(xs){
  return !xs.length;
};
reverse = function(xs){
  return xs.concat().reverse();
};
unique = function(xs){
  var result, i$, len$, x;
  result = [];
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    x = xs[i$];
    if (!in$(x, result)) {
      result.push(x);
    }
  }
  return result;
};
uniqueBy = curry$(function(f, xs){
  var seen, i$, len$, x, val, results$ = [];
  seen = [];
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    x = xs[i$];
    val = f(x);
    if (in$(val, seen)) {
      continue;
    }
    seen.push(val);
    results$.push(x);
  }
  return results$;
});
fold = foldl = curry$(function(f, memo, xs){
  var i$, len$, x;
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    x = xs[i$];
    memo = f(memo, x);
  }
  return memo;
});
fold1 = foldl1 = curry$(function(f, xs){
  return fold(f, xs[0], xs.slice(1));
});
foldr = curry$(function(f, memo, xs){
  var i$, x;
  for (i$ = xs.length - 1; i$ >= 0; --i$) {
    x = xs[i$];
    memo = f(x, memo);
  }
  return memo;
});
foldr1 = curry$(function(f, xs){
  return foldr(f, xs[xs.length - 1], xs.slice(0, -1));
});
unfoldr = curry$(function(f, b){
  var result, x, that;
  result = [];
  x = b;
  while ((that = f(x)) != null) {
    result.push(that[0]);
    x = that[1];
  }
  return result;
});
concat = function(xss){
  return [].concat.apply([], xss);
};
concatMap = curry$(function(f, xs){
  var x;
  return [].concat.apply([], (function(){
    var i$, ref$, len$, results$ = [];
    for (i$ = 0, len$ = (ref$ = xs).length; i$ < len$; ++i$) {
      x = ref$[i$];
      results$.push(f(x));
    }
    return results$;
  }()));
});
flatten = function(xs){
  var x;
  return [].concat.apply([], (function(){
    var i$, ref$, len$, results$ = [];
    for (i$ = 0, len$ = (ref$ = xs).length; i$ < len$; ++i$) {
      x = ref$[i$];
      if (toString$.call(x).slice(8, -1) === 'Array') {
        results$.push(flatten(x));
      } else {
        results$.push(x);
      }
    }
    return results$;
  }()));
};
difference = function(xs){
  var yss, res$, i$, to$, results, len$, x, j$, len1$, ys;
  res$ = [];
  for (i$ = 1, to$ = arguments.length; i$ < to$; ++i$) {
    res$.push(arguments[i$]);
  }
  yss = res$;
  results = [];
  outer: for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    x = xs[i$];
    for (j$ = 0, len1$ = yss.length; j$ < len1$; ++j$) {
      ys = yss[j$];
      if (in$(x, ys)) {
        continue outer;
      }
    }
    results.push(x);
  }
  return results;
};
intersection = function(xs){
  var yss, res$, i$, to$, results, len$, x, j$, len1$, ys;
  res$ = [];
  for (i$ = 1, to$ = arguments.length; i$ < to$; ++i$) {
    res$.push(arguments[i$]);
  }
  yss = res$;
  results = [];
  outer: for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    x = xs[i$];
    for (j$ = 0, len1$ = yss.length; j$ < len1$; ++j$) {
      ys = yss[j$];
      if (!in$(x, ys)) {
        continue outer;
      }
    }
    results.push(x);
  }
  return results;
};
union = function(){
  var xss, res$, i$, to$, results, len$, xs, j$, len1$, x;
  res$ = [];
  for (i$ = 0, to$ = arguments.length; i$ < to$; ++i$) {
    res$.push(arguments[i$]);
  }
  xss = res$;
  results = [];
  for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) {
    xs = xss[i$];
    for (j$ = 0, len1$ = xs.length; j$ < len1$; ++j$) {
      x = xs[j$];
      if (!in$(x, results)) {
        results.push(x);
      }
    }
  }
  return results;
};
countBy = curry$(function(f, xs){
  var results, i$, len$, x, key;
  results = {};
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    x = xs[i$];
    key = f(x);
    if (key in results) {
      results[key] += 1;
    } else {
      results[key] = 1;
    }
  }
  return results;
});
groupBy = curry$(function(f, xs){
  var results, i$, len$, x, key;
  results = {};
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    x = xs[i$];
    key = f(x);
    if (key in results) {
      results[key].push(x);
    } else {
      results[key] = [x];
    }
  }
  return results;
});
andList = function(xs){
  var i$, len$, x;
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    x = xs[i$];
    if (!x) {
      return false;
    }
  }
  return true;
};
orList = function(xs){
  var i$, len$, x;
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    x = xs[i$];
    if (x) {
      return true;
    }
  }
  return false;
};
any = curry$(function(f, xs){
  var i$, len$, x;
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    x = xs[i$];
    if (f(x)) {
      return true;
    }
  }
  return false;
});
all = curry$(function(f, xs){
  var i$, len$, x;
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    x = xs[i$];
    if (!f(x)) {
      return false;
    }
  }
  return true;
});
sort = function(xs){
  return xs.concat().sort(function(x, y){
    if (x > y) {
      return 1;
    } else if (x < y) {
      return -1;
    } else {
      return 0;
    }
  });
};
sortWith = curry$(function(f, xs){
  return xs.concat().sort(f);
});
sortBy = curry$(function(f, xs){
  return xs.concat().sort(function(x, y){
    if (f(x) > f(y)) {
      return 1;
    } else if (f(x) < f(y)) {
      return -1;
    } else {
      return 0;
    }
  });
});
sum = function(xs){
  var result, i$, len$, x;
  result = 0;
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    x = xs[i$];
    result += x;
  }
  return result;
};
product = function(xs){
  var result, i$, len$, x;
  result = 1;
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    x = xs[i$];
    result *= x;
  }
  return result;
};
mean = average = function(xs){
  var sum, i$, len$, x;
  sum = 0;
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    x = xs[i$];
    sum += x;
  }
  return sum / xs.length;
};
maximum = function(xs){
  var max, i$, ref$, len$, x;
  max = xs[0];
  for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) {
    x = ref$[i$];
    if (x > max) {
      max = x;
    }
  }
  return max;
};
minimum = function(xs){
  var min, i$, ref$, len$, x;
  min = xs[0];
  for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) {
    x = ref$[i$];
    if (x < min) {
      min = x;
    }
  }
  return min;
};
maximumBy = curry$(function(f, xs){
  var max, i$, ref$, len$, x;
  max = xs[0];
  for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) {
    x = ref$[i$];
    if (f(x) > f(max)) {
      max = x;
    }
  }
  return max;
});
minimumBy = curry$(function(f, xs){
  var min, i$, ref$, len$, x;
  min = xs[0];
  for (i$ = 0, len$ = (ref$ = xs.slice(1)).length; i$ < len$; ++i$) {
    x = ref$[i$];
    if (f(x) < f(min)) {
      min = x;
    }
  }
  return min;
});
scan = scanl = curry$(function(f, memo, xs){
  var last, x;
  last = memo;
  return [memo].concat((function(){
    var i$, ref$, len$, results$ = [];
    for (i$ = 0, len$ = (ref$ = xs).length; i$ < len$; ++i$) {
      x = ref$[i$];
      results$.push(last = f(last, x));
    }
    return results$;
  }()));
});
scan1 = scanl1 = curry$(function(f, xs){
  if (!xs.length) {
    return;
  }
  return scan(f, xs[0], xs.slice(1));
});
scanr = curry$(function(f, memo, xs){
  xs = xs.concat().reverse();
  return scan(f, memo, xs).reverse();
});
scanr1 = curry$(function(f, xs){
  if (!xs.length) {
    return;
  }
  xs = xs.concat().reverse();
  return scan(f, xs[0], xs.slice(1)).reverse();
});
slice = curry$(function(x, y, xs){
  return xs.slice(x, y);
});
take = curry$(function(n, xs){
  if (n <= 0) {
    return xs.slice(0, 0);
  } else {
    return xs.slice(0, n);
  }
});
drop = curry$(function(n, xs){
  if (n <= 0) {
    return xs;
  } else {
    return xs.slice(n);
  }
});
splitAt = curry$(function(n, xs){
  return [take(n, xs), drop(n, xs)];
});
takeWhile = curry$(function(p, xs){
  var len, i;
  len = xs.length;
  if (!len) {
    return xs;
  }
  i = 0;
  while (i < len && p(xs[i])) {
    i += 1;
  }
  return xs.slice(0, i);
});
dropWhile = curry$(function(p, xs){
  var len, i;
  len = xs.length;
  if (!len) {
    return xs;
  }
  i = 0;
  while (i < len && p(xs[i])) {
    i += 1;
  }
  return xs.slice(i);
});
span = curry$(function(p, xs){
  return [takeWhile(p, xs), dropWhile(p, xs)];
});
breakList = curry$(function(p, xs){
  return span(compose$(p, not$), xs);
});
zip = curry$(function(xs, ys){
  var result, len, i$, len$, i, x;
  result = [];
  len = ys.length;
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    i = i$;
    x = xs[i$];
    if (i === len) {
      break;
    }
    result.push([x, ys[i]]);
  }
  return result;
});
zipWith = curry$(function(f, xs, ys){
  var result, len, i$, len$, i, x;
  result = [];
  len = ys.length;
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    i = i$;
    x = xs[i$];
    if (i === len) {
      break;
    }
    result.push(f(x, ys[i]));
  }
  return result;
});
zipAll = function(){
  var xss, res$, i$, to$, minLength, len$, xs, ref$, i, lresult$, j$, results$ = [];
  res$ = [];
  for (i$ = 0, to$ = arguments.length; i$ < to$; ++i$) {
    res$.push(arguments[i$]);
  }
  xss = res$;
  minLength = undefined;
  for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) {
    xs = xss[i$];
    minLength <= (ref$ = xs.length) || (minLength = ref$);
  }
  for (i$ = 0; i$ < minLength; ++i$) {
    i = i$;
    lresult$ = [];
    for (j$ = 0, len$ = xss.length; j$ < len$; ++j$) {
      xs = xss[j$];
      lresult$.push(xs[i]);
    }
    results$.push(lresult$);
  }
  return results$;
};
zipAllWith = function(f){
  var xss, res$, i$, to$, minLength, len$, xs, ref$, i, results$ = [];
  res$ = [];
  for (i$ = 1, to$ = arguments.length; i$ < to$; ++i$) {
    res$.push(arguments[i$]);
  }
  xss = res$;
  minLength = undefined;
  for (i$ = 0, len$ = xss.length; i$ < len$; ++i$) {
    xs = xss[i$];
    minLength <= (ref$ = xs.length) || (minLength = ref$);
  }
  for (i$ = 0; i$ < minLength; ++i$) {
    i = i$;
    results$.push(f.apply(null, (fn$())));
  }
  return results$;
  function fn$(){
    var i$, ref$, len$, results$ = [];
    for (i$ = 0, len$ = (ref$ = xss).length; i$ < len$; ++i$) {
      xs = ref$[i$];
      results$.push(xs[i]);
    }
    return results$;
  }
};
at = curry$(function(n, xs){
  if (n < 0) {
    return xs[xs.length + n];
  } else {
    return xs[n];
  }
});
elemIndex = curry$(function(el, xs){
  var i$, len$, i, x;
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    i = i$;
    x = xs[i$];
    if (x === el) {
      return i;
    }
  }
});
elemIndices = curry$(function(el, xs){
  var i$, len$, i, x, results$ = [];
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    i = i$;
    x = xs[i$];
    if (x === el) {
      results$.push(i);
    }
  }
  return results$;
});
findIndex = curry$(function(f, xs){
  var i$, len$, i, x;
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    i = i$;
    x = xs[i$];
    if (f(x)) {
      return i;
    }
  }
});
findIndices = curry$(function(f, xs){
  var i$, len$, i, x, results$ = [];
  for (i$ = 0, len$ = xs.length; i$ < len$; ++i$) {
    i = i$;
    x = xs[i$];
    if (f(x)) {
      results$.push(i);
    }
  }
  return results$;
});
module.exports = {
  each: each,
  map: map,
  filter: filter,
  compact: compact,
  reject: reject,
  remove: remove,
  partition: partition,
  find: find,
  head: head,
  first: first,
  tail: tail,
  last: last,
  initial: initial,
  empty: empty,
  reverse: reverse,
  difference: difference,
  intersection: intersection,
  union: union,
  countBy: countBy,
  groupBy: groupBy,
  fold: fold,
  fold1: fold1,
  foldl: foldl,
  foldl1: foldl1,
  foldr: foldr,
  foldr1: foldr1,
  unfoldr: unfoldr,
  andList: andList,
  orList: orList,
  any: any,
  all: all,
  unique: unique,
  uniqueBy: uniqueBy,
  sort: sort,
  sortWith: sortWith,
  sortBy: sortBy,
  sum: sum,
  product: product,
  mean: mean,
  average: average,
  concat: concat,
  concatMap: concatMap,
  flatten: flatten,
  maximum: maximum,
  minimum: minimum,
  maximumBy: maximumBy,
  minimumBy: minimumBy,
  scan: scan,
  scan1: scan1,
  scanl: scanl,
  scanl1: scanl1,
  scanr: scanr,
  scanr1: scanr1,
  slice: slice,
  take: take,
  drop: drop,
  splitAt: splitAt,
  takeWhile: takeWhile,
  dropWhile: dropWhile,
  span: span,
  breakList: breakList,
  zip: zip,
  zipWith: zipWith,
  zipAll: zipAll,
  zipAllWith: zipAllWith,
  at: at,
  elemIndex: elemIndex,
  elemIndices: elemIndices,
  findIndex: findIndex,
  findIndices: findIndices
};
function curry$(f, bound){
  var context,
  _curry = function(args) {
    return f.length > 1 ? function(){
      var params = args ? args.concat() : [];
      context = bound ? context || this : this;
      return params.push.apply(params, arguments) <
          f.length && arguments.length ?
        _curry.call(context, params) : f.apply(context, params);
    } : f;
  };
  return _curry();
}
function in$(x, xs){
  var i = -1, l = xs.length >>> 0;
  while (++i < l) if (x === xs[i]) return true;
  return false;
}
function compose$() {
  var functions = arguments;
  return function() {
    var i, result;
    result = functions[0].apply(this, arguments);
    for (i = 1; i < functions.length; ++i) {
      result = functions[i](result);
    }
    return result;
  };
}
function not$(x){ return !x; }صx	Z// Generated by LiveScript 1.6.0
var max, min, negate, abs, signum, quot, rem, div, mod, recip, pi, tau, exp, sqrt, ln, pow, sin, tan, cos, asin, acos, atan, atan2, truncate, round, ceiling, floor, isItNaN, even, odd, gcd, lcm;
max = curry$(function(x$, y$){
  return x$ > y$ ? x$ : y$;
});
min = curry$(function(x$, y$){
  return x$ < y$ ? x$ : y$;
});
negate = function(x){
  return -x;
};
abs = Math.abs;
signum = function(x){
  if (x < 0) {
    return -1;
  } else if (x > 0) {
    return 1;
  } else {
    return 0;
  }
};
quot = curry$(function(x, y){
  return ~~(x / y);
});
rem = curry$(function(x$, y$){
  return x$ % y$;
});
div = curry$(function(x, y){
  return Math.floor(x / y);
});
mod = curry$(function(x$, y$){
  var ref$;
  return ((x$) % (ref$ = y$) + ref$) % ref$;
});
recip = (function(it){
  return 1 / it;
});
pi = Math.PI;
tau = pi * 2;
exp = Math.exp;
sqrt = Math.sqrt;
ln = Math.log;
pow = curry$(function(x$, y$){
  return Math.pow(x$, y$);
});
sin = Math.sin;
tan = Math.tan;
cos = Math.cos;
asin = Math.asin;
acos = Math.acos;
atan = Math.atan;
atan2 = curry$(function(x, y){
  return Math.atan2(x, y);
});
truncate = function(x){
  return ~~x;
};
round = Math.round;
ceiling = Math.ceil;
floor = Math.floor;
isItNaN = function(x){
  return x !== x;
};
even = function(x){
  return x % 2 === 0;
};
odd = function(x){
  return x % 2 !== 0;
};
gcd = curry$(function(x, y){
  var z;
  x = Math.abs(x);
  y = Math.abs(y);
  while (y !== 0) {
    z = x % y;
    x = y;
    y = z;
  }
  return x;
});
lcm = curry$(function(x, y){
  return Math.abs(Math.floor(x / gcd(x, y) * y));
});
module.exports = {
  max: max,
  min: min,
  negate: negate,
  abs: abs,
  signum: signum,
  quot: quot,
  rem: rem,
  div: div,
  mod: mod,
  recip: recip,
  pi: pi,
  tau: tau,
  exp: exp,
  sqrt: sqrt,
  ln: ln,
  pow: pow,
  sin: sin,
  tan: tan,
  cos: cos,
  acos: acos,
  asin: asin,
  atan: atan,
  atan2: atan2,
  truncate: truncate,
  round: round,
  ceiling: ceiling,
  floor: floor,
  isItNaN: isItNaN,
  even: even,
  odd: odd,
  gcd: gcd,
  lcm: lcm
};
function curry$(f, bound){
  var context,
  _curry = function(args) {
    return f.length > 1 ? function(){
      var params = args ? args.concat() : [];
      context = bound ? context || this : this;
      return params.push.apply(params, arguments) <
          f.length && arguments.length ?
        _curry.call(context, params) : f.apply(context, params);
    } : f;
  };
  return _curry();
}zox~// Generated by LiveScript 1.6.0
var values, keys, pairsToObj, objToPairs, listsToObj, objToLists, empty, each, map, compact, filter, reject, partition, find;
values = function(object){
  var i$, x, results$ = [];
  for (i$ in object) {
    x = object[i$];
    results$.push(x);
  }
  return results$;
};
keys = function(object){
  var x, results$ = [];
  for (x in object) {
    results$.push(x);
  }
  return results$;
};
pairsToObj = function(object){
  var i$, len$, x, resultObj$ = {};
  for (i$ = 0, len$ = object.length; i$ < len$; ++i$) {
    x = object[i$];
    resultObj$[x[0]] = x[1];
  }
  return resultObj$;
};
objToPairs = function(object){
  var key, value, results$ = [];
  for (key in object) {
    value = object[key];
    results$.push([key, value]);
  }
  return results$;
};
listsToObj = curry$(function(keys, values){
  var i$, len$, i, key, resultObj$ = {};
  for (i$ = 0, len$ = keys.length; i$ < len$; ++i$) {
    i = i$;
    key = keys[i$];
    resultObj$[key] = values[i];
  }
  return resultObj$;
});
objToLists = function(object){
  var keys, values, key, value;
  keys = [];
  values = [];
  for (key in object) {
    value = object[key];
    keys.push(key);
    values.push(value);
  }
  return [keys, values];
};
empty = function(object){
  var x;
  for (x in object) {
    return false;
  }
  return true;
};
each = curry$(function(f, object){
  var i$, x;
  for (i$ in object) {
    x = object[i$];
    f(x);
  }
  return object;
});
map = curry$(function(f, object){
  var k, x, resultObj$ = {};
  for (k in object) {
    x = object[k];
    resultObj$[k] = f(x);
  }
  return resultObj$;
});
compact = function(object){
  var k, x, resultObj$ = {};
  for (k in object) {
    x = object[k];
    if (x) {
      resultObj$[k] = x;
    }
  }
  return resultObj$;
};
filter = curry$(function(f, object){
  var k, x, resultObj$ = {};
  for (k in object) {
    x = object[k];
    if (f(x)) {
      resultObj$[k] = x;
    }
  }
  return resultObj$;
});
reject = curry$(function(f, object){
  var k, x, resultObj$ = {};
  for (k in object) {
    x = object[k];
    if (!f(x)) {
      resultObj$[k] = x;
    }
  }
  return resultObj$;
});
partition = curry$(function(f, object){
  var passed, failed, k, x;
  passed = {};
  failed = {};
  for (k in object) {
    x = object[k];
    (f(x) ? passed : failed)[k] = x;
  }
  return [passed, failed];
});
find = curry$(function(f, object){
  var i$, x;
  for (i$ in object) {
    x = object[i$];
    if (f(x)) {
      return x;
    }
  }
});
module.exports = {
  values: values,
  keys: keys,
  pairsToObj: pairsToObj,
  objToPairs: objToPairs,
  listsToObj: listsToObj,
  objToLists: objToLists,
  empty: empty,
  each: each,
  map: map,
  filter: filter,
  compact: compact,
  reject: reject,
  partition: partition,
  find: find
};
function curry$(f, bound){
  var context,
  _curry = function(args) {
    return f.length > 1 ? function(){
      var params = args ? args.concat() : [];
      context = bound ? context || this : this;
      return params.push.apply(params, arguments) <
          f.length && arguments.length ?
        _curry.call(context, params) : f.apply(context, params);
    } : f;
  };
  return _curry();
}?x8// Generated by LiveScript 1.6.0
var split, join, lines, unlines, words, unwords, chars, unchars, reverse, repeat, capitalize, camelize, dasherize;
split = curry$(function(sep, str){
  return str.split(sep);
});
join = curry$(function(sep, xs){
  return xs.join(sep);
});
lines = function(str){
  if (!str.length) {
    return [];
  }
  return str.split('\n');
};
unlines = function(it){
  return it.join('\n');
};
words = function(str){
  if (!str.length) {
    return [];
  }
  return str.split(/[ ]+/);
};
unwords = function(it){
  return it.join(' ');
};
chars = function(it){
  return it.split('');
};
unchars = function(it){
  return it.join('');
};
reverse = function(str){
  return str.split('').reverse().join('');
};
repeat = curry$(function(n, str){
  var result, i$;
  result = '';
  for (i$ = 0; i$ < n; ++i$) {
    result += str;
  }
  return result;
});
capitalize = function(str){
  return str.charAt(0).toUpperCase() + str.slice(1);
};
camelize = function(it){
  return it.replace(/[-_]+(.)?/g, function(arg$, c){
    return (c != null ? c : '').toUpperCase();
  });
};
dasherize = function(str){
  return str.replace(/([^-A-Z])([A-Z]+)/g, function(arg$, lower, upper){
    return lower + "-" + (upper.length > 1
      ? upper
      : upper.toLowerCase());
  }).replace(/^([A-Z]+)/, function(arg$, upper){
    if (upper.length > 1) {
      return upper + "-";
    } else {
      return upper.toLowerCase();
    }
  });
};
module.exports = {
  split: split,
  join: join,
  lines: lines,
  unlines: unlines,
  words: words,
  unwords: unwords,
  chars: chars,
  unchars: unchars,
  reverse: reverse,
  repeat: repeat,
  capitalize: capitalize,
  camelize: camelize,
  dasherize: dasherize
};
function curry$(f, bound){
  var context,
  _curry = function(args) {
    return f.length > 1 ? function(){
      var params = args ? args.concat() : [];
      context = bound ? context || this : this;
      return params.push.apply(params, arguments) <
          f.length && arguments.length ?
        _curry.call(context, params) : f.apply(context, params);
    } : f;
  };
  return _curry();
}fdfxD// Generated by LiveScript 1.6.0
var Func, List, Obj, Str, Num, id, isType, replicate, prelude, toString$ = {}.toString;
Func = require('./Func.js');
List = require('./List.js');
Obj = require('./Obj.js');
Str = require('./Str.js');
Num = require('./Num.js');
id = function(x){
  return x;
};
isType = curry$(function(type, x){
  return toString$.call(x).slice(8, -1) === type;
});
replicate = curry$(function(n, x){
  var i$, results$ = [];
  for (i$ = 0; i$ < n; ++i$) {
    results$.push(x);
  }
  return results$;
});
Str.empty = List.empty;
Str.slice = List.slice;
Str.take = List.take;
Str.drop = List.drop;
Str.splitAt = List.splitAt;
Str.takeWhile = List.takeWhile;
Str.dropWhile = List.dropWhile;
Str.span = List.span;
Str.breakStr = List.breakList;
prelude = {
  Func: Func,
  List: List,
  Obj: Obj,
  Str: Str,
  Num: Num,
  id: id,
  isType: isType,
  replicate: replicate
};
prelude.each = List.each;
prelude.map = List.map;
prelude.filter = List.filter;
prelude.compact = List.compact;
prelude.reject = List.reject;
prelude.partition = List.partition;
prelude.find = List.find;
prelude.head = List.head;
prelude.first = List.first;
prelude.tail = List.tail;
prelude.last = List.last;
prelude.initial = List.initial;
prelude.empty = List.empty;
prelude.reverse = List.reverse;
prelude.difference = List.difference;
prelude.intersection = List.intersection;
prelude.union = List.union;
prelude.countBy = List.countBy;
prelude.groupBy = List.groupBy;
prelude.fold = List.fold;
prelude.foldl = List.foldl;
prelude.fold1 = List.fold1;
prelude.foldl1 = List.foldl1;
prelude.foldr = List.foldr;
prelude.foldr1 = List.foldr1;
prelude.unfoldr = List.unfoldr;
prelude.andList = List.andList;
prelude.orList = List.orList;
prelude.any = List.any;
prelude.all = List.all;
prelude.unique = List.unique;
prelude.uniqueBy = List.uniqueBy;
prelude.sort = List.sort;
prelude.sortWith = List.sortWith;
prelude.sortBy = List.sortBy;
prelude.sum = List.sum;
prelude.product = List.product;
prelude.mean = List.mean;
prelude.average = List.average;
prelude.concat = List.concat;
prelude.concatMap = List.concatMap;
prelude.flatten = List.flatten;
prelude.maximum = List.maximum;
prelude.minimum = List.minimum;
prelude.maximumBy = List.maximumBy;
prelude.minimumBy = List.minimumBy;
prelude.scan = List.scan;
prelude.scanl = List.scanl;
prelude.scan1 = List.scan1;
prelude.scanl1 = List.scanl1;
prelude.scanr = List.scanr;
prelude.scanr1 = List.scanr1;
prelude.slice = List.slice;
prelude.take = List.take;
prelude.drop = List.drop;
prelude.splitAt = List.splitAt;
prelude.takeWhile = List.takeWhile;
prelude.dropWhile = List.dropWhile;
prelude.span = List.span;
prelude.breakList = List.breakList;
prelude.zip = List.zip;
prelude.zipWith = List.zipWith;
prelude.zipAll = List.zipAll;
prelude.zipAllWith = List.zipAllWith;
prelude.at = List.at;
prelude.elemIndex = List.elemIndex;
prelude.elemIndices = List.elemIndices;
prelude.findIndex = List.findIndex;
prelude.findIndices = List.findIndices;
prelude.apply = Func.apply;
prelude.curry = Func.curry;
prelude.flip = Func.flip;
prelude.fix = Func.fix;
prelude.over = Func.over;
prelude.split = Str.split;
prelude.join = Str.join;
prelude.lines = Str.lines;
prelude.unlines = Str.unlines;
prelude.words = Str.words;
prelude.unwords = Str.unwords;
prelude.chars = Str.chars;
prelude.unchars = Str.unchars;
prelude.repeat = Str.repeat;
prelude.capitalize = Str.capitalize;
prelude.camelize = Str.camelize;
prelude.dasherize = Str.dasherize;
prelude.values = Obj.values;
prelude.keys = Obj.keys;
prelude.pairsToObj = Obj.pairsToObj;
prelude.objToPairs = Obj.objToPairs;
prelude.listsToObj = Obj.listsToObj;
prelude.objToLists = Obj.objToLists;
prelude.max = Num.max;
prelude.min = Num.min;
prelude.negate = Num.negate;
prelude.abs = Num.abs;
prelude.signum = Num.signum;
prelude.quot = Num.quot;
prelude.rem = Num.rem;
prelude.div = Num.div;
prelude.mod = Num.mod;
prelude.recip = Num.recip;
prelude.pi = Num.pi;
prelude.tau = Num.tau;
prelude.exp = Num.exp;
prelude.sqrt = Num.sqrt;
prelude.ln = Num.ln;
prelude.pow = Num.pow;
prelude.sin = Num.sin;
prelude.tan = Num.tan;
prelude.cos = Num.cos;
prelude.acos = Num.acos;
prelude.asin = Num.asin;
prelude.atan = Num.atan;
prelude.atan2 = Num.atan2;
prelude.truncate = Num.truncate;
prelude.round = Num.round;
prelude.ceiling = Num.ceiling;
prelude.floor = Num.floor;
prelude.isItNaN = Num.isItNaN;
prelude.even = Num.even;
prelude.odd = Num.odd;
prelude.gcd = Num.gcd;
prelude.lcm = Num.lcm;
prelude.VERSION = '1.2.1';
module.exports = prelude;
function curry$(f, bound){
  var context,
  _curry = function(args) {
    return f.length > 1 ? function(){
      var params = args ? args.concat() : [];
      context = bound ? context || this : this;
      return params.push.apply(params, arguments) <
          f.length && arguments.length ?
        _curry.call(context, params) : f.apply(context, params);
    } : f;
  };
  return _curry();
}Ax{
  "name": "prelude-ls",
  "version": "1.2.1",
  "author": "George Zahariev <z@georgezahariev.com>",
  "description": "prelude.ls is a functionally oriented utility library. It is powerful and flexible. Almost all of its functions are curried. It is written in, and is the recommended base library for, LiveScript.",
  "keywords": [
    "prelude",
    "livescript",
    "utility",
    "ls",
    "coffeescript",
    "javascript",
    "library",
    "functional",
    "array",
    "list",
    "object",
    "string"
  ],
  "main": "lib/",
  "files": [
    "lib/",
    "README.md",
    "LICENSE"
  ],
  "homepage": "http://preludels.com",
  "bugs": "https://github.com/gkz/prelude-ls/issues",
  "license": "MIT",
  "engines": {
    "node": ">= 0.8.0"
  },
  "repository": {
    "type": "git",
    "url": "git://github.com/gkz/prelude-ls.git"
  },
  "scripts": {
    "test": "make test"
  },
  "devDependencies": {
    "livescript": "^1.6.0",
    "uglify-js": "^3.8.1",
    "mocha": "^7.1.1",
    "browserify": "^16.5.1",
    "sinon": "~8.0.1"
  }
}
3/<x 5100644 LICENSE-MIT.txt 
~p݃,ٛڗ wb100644 README.md kz	7M/3100644 package.json ol!bOlo#0Jr100644 punycode.es6.js %_Y]q~*M#ӱ100644 punycode.js %$, /wein[L9xW# Punycode.js [![punycode on npm](https://img.shields.io/npm/v/punycode)](https://www.npmjs.com/package/punycode) [![](https://data.jsdelivr.com/v1/package/npm/punycode/badge)](https://www.jsdelivr.com/package/npm/punycode)

Punycode.js is a robust Punycode converter that fully complies to [RFC 3492](https://tools.ietf.org/html/rfc3492) and [RFC 5891](https://tools.ietf.org/html/rfc5891).

This JavaScript library is the result of comparing, optimizing and documenting different open-source implementations of the Punycode algorithm:

* [The C example code from RFC 3492](https://tools.ietf.org/html/rfc3492#appendix-C)
* [`punycode.c` by _Markus W. Scherer_ (IBM)](http://opensource.apple.com/source/ICU/ICU-400.42/icuSources/common/punycode.c)
* [`punycode.c` by _Ben Noordhuis_](https://github.com/bnoordhuis/punycode/blob/master/punycode.c)
* [JavaScript implementation by _some_](http://stackoverflow.com/questions/183485/can-anyone-recommend-a-good-free-javascript-for-punycode-to-unicode-conversion/301287#301287)
* [`punycode.js` by _Ben Noordhuis_](https://github.com/joyent/node/blob/426298c8c1c0d5b5224ac3658c41e7c2a3fe9377/lib/punycode.js) (note: [not fully compliant](https://github.com/joyent/node/issues/2072))

This project was [bundled](https://github.com/joyent/node/blob/master/lib/punycode.js) with Node.js from [v0.6.2+](https://github.com/joyent/node/compare/975f1930b1...61e796decc) until [v7](https://github.com/nodejs/node/pull/7941) (soft-deprecated).

This project provides a CommonJS module that uses ES2015+ features and JavaScript module, which work in modern Node.js versions and browsers. For the old Punycode.js version that offers the same functionality in a UMD build with support for older pre-ES2015 runtimes, including Rhino, Ringo, and Narwhal, see [v1.4.1](https://github.com/mathiasbynens/punycode.js/releases/tag/v1.4.1).

## Installation

Via [npm](https://www.npmjs.com/):

```bash
npm install punycode --save
```

In [Node.js](https://nodejs.org/):

> ⚠️ Note that userland modules don't hide core modules.
> For example, `require('punycode')` still imports the deprecated core module even if you executed `npm install punycode`.
> Use `require('punycode/')` to import userland modules rather than core modules.

```js
const punycode = require('punycode/');
```

## API

### `punycode.decode(string)`

Converts a Punycode string of ASCII symbols to a string of Unicode symbols.

```js
// decode domain name parts
punycode.decode('maana-pta'); // 'mañana'
punycode.decode('--dqo34k'); // '☃-⌘'
```

### `punycode.encode(string)`

Converts a string of Unicode symbols to a Punycode string of ASCII symbols.

```js
// encode domain name parts
punycode.encode('mañana'); // 'maana-pta'
punycode.encode('☃-⌘'); // '--dqo34k'
```

### `punycode.toUnicode(input)`

Converts a Punycode string representing a domain name or an email address to Unicode. Only the Punycoded parts of the input will be converted, i.e. it doesn’t matter if you call it on a string that has already been converted to Unicode.

```js
// decode domain names
punycode.toUnicode('xn--maana-pta.com');
// → 'mañana.com'
punycode.toUnicode('xn----dqo34k.com');
// → '☃-⌘.com'

// decode email addresses
punycode.toUnicode('джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq');
// → 'джумла@джpумлатест.bрфa'
```

### `punycode.toASCII(input)`

Converts a lowercased Unicode string representing a domain name or an email address to Punycode. Only the non-ASCII parts of the input will be converted, i.e. it doesn’t matter if you call it with a domain that’s already in ASCII.

```js
// encode domain names
punycode.toASCII('mañana.com');
// → 'xn--maana-pta.com'
punycode.toASCII('☃-⌘.com');
// → 'xn----dqo34k.com'

// encode email addresses
punycode.toASCII('джумла@джpумлатест.bрфa');
// → 'джумла@xn--p-8sbkgc5ag7bhce.xn--ba-lmcq'
```

### `punycode.ucs2`

#### `punycode.ucs2.decode(string)`

Creates an array containing the numeric code point values of each Unicode symbol in the string. While [JavaScript uses UCS-2 internally](https://mathiasbynens.be/notes/javascript-encoding), this function will convert a pair of surrogate halves (each of which UCS-2 exposes as separate characters) into a single code point, matching UTF-16.

```js
punycode.ucs2.decode('abc');
// → [0x61, 0x62, 0x63]
// surrogate pair for U+1D306 TETRAGRAM FOR CENTRE:
punycode.ucs2.decode('\uD834\uDF06');
// → [0x1D306]
```

#### `punycode.ucs2.encode(codePoints)`

Creates a string based on an array of numeric code point values.

```js
punycode.ucs2.encode([0x61, 0x62, 0x63]);
// → 'abc'
punycode.ucs2.encode([0x1D306]);
// → '\uD834\uDF06'
```

### `punycode.version`

A string representing the current Punycode.js version number.

## For maintainers

### How to publish a new release

1. On the `main` branch, bump the version number in `package.json`:

    ```sh
    npm version patch -m 'Release v%s'
    ```

    Instead of `patch`, use `minor` or `major` [as needed](https://semver.org/).

    Note that this produces a Git commit + tag.

1. Push the release commit and tag:

    ```sh
    git push && git push --tags
    ```

    Our CI then automatically publishes the new release to npm, under both the [`punycode`](https://www.npmjs.com/package/punycode) and [`punycode.js`](https://www.npmjs.com/package/punycode.js) names.

## Author

| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") |
|---|
| [Mathias Bynens](https://mathiasbynens.be/) |

## License

Punycode.js is available under the [MIT](https://mths.be/mit) license.
#ELx4{
  "name": "punycode",
  "version": "2.3.1",
  "description": "A robust Punycode converter that fully complies to RFC 3492 and RFC 5891, and works on nearly all JavaScript platforms.",
  "homepage": "https://mths.be/punycode",
  "main": "punycode.js",
  "jsnext:main": "punycode.es6.js",
  "module": "punycode.es6.js",
  "engines": {
    "node": ">=6"
  },
  "keywords": [
    "punycode",
    "unicode",
    "idn",
    "idna",
    "dns",
    "url",
    "domain"
  ],
  "license": "MIT",
  "author": {
    "name": "Mathias Bynens",
    "url": "https://mathiasbynens.be/"
  },
  "contributors": [
    {
      "name": "Mathias Bynens",
      "url": "https://mathiasbynens.be/"
    }
  ],
  "repository": {
    "type": "git",
    "url": "https://github.com/mathiasbynens/punycode.js.git"
  },
  "bugs": "https://github.com/mathiasbynens/punycode.js/issues",
  "files": [
    "LICENSE-MIT.txt",
    "punycode.js",
    "punycode.es6.js"
  ],
  "scripts": {
    "test": "mocha tests",
    "build": "node scripts/prepublish.js"
  },
  "devDependencies": {
    "codecov": "^3.8.3",
    "nyc": "^15.1.0",
    "mocha": "^10.2.0"
  },
  "jspm": {
    "map": {
      "./punycode.js": {
        "node": "@node/punycode"
      }
    }
  }
}
O_x1'use strict';

/** Highest positive signed 32-bit float value */
const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1

/** Bootstring parameters */
const base = 36;
const tMin = 1;
const tMax = 26;
const skew = 38;
const damp = 700;
const initialBias = 72;
const initialN = 128; // 0x80
const delimiter = '-'; // '\x2D'

/** Regular expressions */
const regexPunycode = /^xn--/;
const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too.
const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators

/** Error messages */
const errors = {
	'overflow': 'Overflow: input needs wider integers to process',
	'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
	'invalid-input': 'Invalid input'
};

/** Convenience shortcuts */
const baseMinusTMin = base - tMin;
const floor = Math.floor;
const stringFromCharCode = String.fromCharCode;

/*--------------------------------------------------------------------------*/

/**
 * A generic error utility function.
 * @private
 * @param {String} type The error type.
 * @returns {Error} Throws a `RangeError` with the applicable error message.
 */
function error(type) {
	throw new RangeError(errors[type]);
}

/**
 * A generic `Array#map` utility function.
 * @private
 * @param {Array} array The array to iterate over.
 * @param {Function} callback The function that gets called for every array
 * item.
 * @returns {Array} A new array of values returned by the callback function.
 */
function map(array, callback) {
	const result = [];
	let length = array.length;
	while (length--) {
		result[length] = callback(array[length]);
	}
	return result;
}

/**
 * A simple `Array#map`-like wrapper to work with domain name strings or email
 * addresses.
 * @private
 * @param {String} domain The domain name or email address.
 * @param {Function} callback The function that gets called for every
 * character.
 * @returns {String} A new string of characters returned by the callback
 * function.
 */
function mapDomain(domain, callback) {
	const parts = domain.split('@');
	let result = '';
	if (parts.length > 1) {
		// In email addresses, only the domain name should be punycoded. Leave
		// the local part (i.e. everything up to `@`) intact.
		result = parts[0] + '@';
		domain = parts[1];
	}
	// Avoid `split(regex)` for IE8 compatibility. See #17.
	domain = domain.replace(regexSeparators, '\x2E');
	const labels = domain.split('.');
	const encoded = map(labels, callback).join('.');
	return result + encoded;
}

/**
 * Creates an array containing the numeric code points of each Unicode
 * character in the string. While JavaScript uses UCS-2 internally,
 * this function will convert a pair of surrogate halves (each of which
 * UCS-2 exposes as separate characters) into a single code point,
 * matching UTF-16.
 * @see `punycode.ucs2.encode`
 * @see <https://mathiasbynens.be/notes/javascript-encoding>
 * @memberOf punycode.ucs2
 * @name decode
 * @param {String} string The Unicode input string (UCS-2).
 * @returns {Array} The new array of code points.
 */
function ucs2decode(string) {
	const output = [];
	let counter = 0;
	const length = string.length;
	while (counter < length) {
		const value = string.charCodeAt(counter++);
		if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
			// It's a high surrogate, and there is a next character.
			const extra = string.charCodeAt(counter++);
			if ((extra & 0xFC00) == 0xDC00) { // Low surrogate.
				output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
			} else {
				// It's an unmatched surrogate; only append this code unit, in case the
				// next code unit is the high surrogate of a surrogate pair.
				output.push(value);
				counter--;
			}
		} else {
			output.push(value);
		}
	}
	return output;
}

/**
 * Creates a string based on an array of numeric code points.
 * @see `punycode.ucs2.decode`
 * @memberOf punycode.ucs2
 * @name encode
 * @param {Array} codePoints The array of numeric code points.
 * @returns {String} The new Unicode string (UCS-2).
 */
const ucs2encode = codePoints => String.fromCodePoint(...codePoints);

/**
 * Converts a basic code point into a digit/integer.
 * @see `digitToBasic()`
 * @private
 * @param {Number} codePoint The basic numeric code point value.
 * @returns {Number} The numeric value of a basic code point (for use in
 * representing integers) in the range `0` to `base - 1`, or `base` if
 * the code point does not represent a value.
 */
const basicToDigit = function(codePoint) {
	if (codePoint >= 0x30 && codePoint < 0x3A) {
		return 26 + (codePoint - 0x30);
	}
	if (codePoint >= 0x41 && codePoint < 0x5B) {
		return codePoint - 0x41;
	}
	if (codePoint >= 0x61 && codePoint < 0x7B) {
		return codePoint - 0x61;
	}
	return base;
};

/**
 * Converts a digit/integer into a basic code point.
 * @see `basicToDigit()`
 * @private
 * @param {Number} digit The numeric value of a basic code point.
 * @returns {Number} The basic code point whose value (when used for
 * representing integers) is `digit`, which needs to be in the range
 * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
 * used; else, the lowercase form is used. The behavior is undefined
 * if `flag` is non-zero and `digit` has no uppercase form.
 */
const digitToBasic = function(digit, flag) {
	//  0..25 map to ASCII a..z or A..Z
	// 26..35 map to ASCII 0..9
	return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
};

/**
 * Bias adaptation function as per section 3.4 of RFC 3492.
 * https://tools.ietf.org/html/rfc3492#section-3.4
 * @private
 */
const adapt = function(delta, numPoints, firstTime) {
	let k = 0;
	delta = firstTime ? floor(delta / damp) : delta >> 1;
	delta += floor(delta / numPoints);
	for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
		delta = floor(delta / baseMinusTMin);
	}
	return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
};

/**
 * Converts a Punycode string of ASCII-only symbols to a string of Unicode
 * symbols.
 * @memberOf punycode
 * @param {String} input The Punycode string of ASCII-only symbols.
 * @returns {String} The resulting string of Unicode symbols.
 */
const decode = function(input) {
	// Don't use UCS-2.
	const output = [];
	const inputLength = input.length;
	let i = 0;
	let n = initialN;
	let bias = initialBias;

	// Handle the basic code points: let `basic` be the number of input code
	// points before the last delimiter, or `0` if there is none, then copy
	// the first basic code points to the output.

	let basic = input.lastIndexOf(delimiter);
	if (basic < 0) {
		basic = 0;
	}

	for (let j = 0; j < basic; ++j) {
		// if it's not a basic code point
		if (input.charCodeAt(j) >= 0x80) {
			error('not-basic');
		}
		output.push(input.charCodeAt(j));
	}

	// Main decoding loop: start just after the last delimiter if any basic code
	// points were copied; start at the beginning otherwise.

	for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {

		// `index` is the index of the next character to be consumed.
		// Decode a generalized variable-length integer into `delta`,
		// which gets added to `i`. The overflow checking is easier
		// if we increase `i` as we go, then subtract off its starting
		// value at the end to obtain `delta`.
		const oldi = i;
		for (let w = 1, k = base; /* no condition */; k += base) {

			if (index >= inputLength) {
				error('invalid-input');
			}

			const digit = basicToDigit(input.charCodeAt(index++));

			if (digit >= base) {
				error('invalid-input');
			}
			if (digit > floor((maxInt - i) / w)) {
				error('overflow');
			}

			i += digit * w;
			const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);

			if (digit < t) {
				break;
			}

			const baseMinusT = base - t;
			if (w > floor(maxInt / baseMinusT)) {
				error('overflow');
			}

			w *= baseMinusT;

		}

		const out = output.length + 1;
		bias = adapt(i - oldi, out, oldi == 0);

		// `i` was supposed to wrap around from `out` to `0`,
		// incrementing `n` each time, so we'll fix that now:
		if (floor(i / out) > maxInt - n) {
			error('overflow');
		}

		n += floor(i / out);
		i %= out;

		// Insert `n` at position `i` of the output.
		output.splice(i++, 0, n);

	}

	return String.fromCodePoint(...output);
};

/**
 * Converts a string of Unicode symbols (e.g. a domain name label) to a
 * Punycode string of ASCII-only symbols.
 * @memberOf punycode
 * @param {String} input The string of Unicode symbols.
 * @returns {String} The resulting Punycode string of ASCII-only symbols.
 */
const encode = function(input) {
	const output = [];

	// Convert the input in UCS-2 to an array of Unicode code points.
	input = ucs2decode(input);

	// Cache the length.
	const inputLength = input.length;

	// Initialize the state.
	let n = initialN;
	let delta = 0;
	let bias = initialBias;

	// Handle the basic code points.
	for (const currentValue of input) {
		if (currentValue < 0x80) {
			output.push(stringFromCharCode(currentValue));
		}
	}

	const basicLength = output.length;
	let handledCPCount = basicLength;

	// `handledCPCount` is the number of code points that have been handled;
	// `basicLength` is the number of basic code points.

	// Finish the basic string with a delimiter unless it's empty.
	if (basicLength) {
		output.push(delimiter);
	}

	// Main encoding loop:
	while (handledCPCount < inputLength) {

		// All non-basic code points < n have been handled already. Find the next
		// larger one:
		let m = maxInt;
		for (const currentValue of input) {
			if (currentValue >= n && currentValue < m) {
				m = currentValue;
			}
		}

		// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
		// but guard against overflow.
		const handledCPCountPlusOne = handledCPCount + 1;
		if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
			error('overflow');
		}

		delta += (m - n) * handledCPCountPlusOne;
		n = m;

		for (const currentValue of input) {
			if (currentValue < n && ++delta > maxInt) {
				error('overflow');
			}
			if (currentValue === n) {
				// Represent delta as a generalized variable-length integer.
				let q = delta;
				for (let k = base; /* no condition */; k += base) {
					const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
					if (q < t) {
						break;
					}
					const qMinusT = q - t;
					const baseMinusT = base - t;
					output.push(
						stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
					);
					q = floor(qMinusT / baseMinusT);
				}

				output.push(stringFromCharCode(digitToBasic(q, 0)));
				bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);
				delta = 0;
				++handledCPCount;
			}
		}

		++delta;
		++n;

	}
	return output.join('');
};

/**
 * Converts a Punycode string representing a domain name or an email address
 * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
 * it doesn't matter if you call it on a string that has already been
 * converted to Unicode.
 * @memberOf punycode
 * @param {String} input The Punycoded domain name or email address to
 * convert to Unicode.
 * @returns {String} The Unicode representation of the given Punycode
 * string.
 */
const toUnicode = function(input) {
	return mapDomain(input, function(string) {
		return regexPunycode.test(string)
			? decode(string.slice(4).toLowerCase())
			: string;
	});
};

/**
 * Converts a Unicode string representing a domain name or an email address to
 * Punycode. Only the non-ASCII parts of the domain name will be converted,
 * i.e. it doesn't matter if you call it with a domain that's already in
 * ASCII.
 * @memberOf punycode
 * @param {String} input The domain name or email address to convert, as a
 * Unicode string.
 * @returns {String} The Punycode representation of the given domain name or
 * email address.
 */
const toASCII = function(input) {
	return mapDomain(input, function(string) {
		return regexNonASCII.test(string)
			? 'xn--' + encode(string)
			: string;
	});
};

/*--------------------------------------------------------------------------*/

/** Define the public API */
const punycode = {
	/**
	 * A string representing the current Punycode.js version number.
	 * @memberOf punycode
	 * @type String
	 */
	'version': '2.3.1',
	/**
	 * An object of methods to convert from JavaScript's internal character
	 * representation (UCS-2) to Unicode code points, and back.
	 * @see <https://mathiasbynens.be/notes/javascript-encoding>
	 * @memberOf punycode
	 * @type Object
	 */
	'ucs2': {
		'decode': ucs2decode,
		'encode': ucs2encode
	},
	'decode': decode,
	'encode': encode,
	'toASCII': toASCII,
	'toUnicode': toUnicode
};

export { ucs2decode, ucs2encode, decode, encode, toASCII, toUnicode };
export default punycode;
8x1X'use strict';

/** Highest positive signed 32-bit float value */
const maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1

/** Bootstring parameters */
const base = 36;
const tMin = 1;
const tMax = 26;
const skew = 38;
const damp = 700;
const initialBias = 72;
const initialN = 128; // 0x80
const delimiter = '-'; // '\x2D'

/** Regular expressions */
const regexPunycode = /^xn--/;
const regexNonASCII = /[^\0-\x7F]/; // Note: U+007F DEL is excluded too.
const regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators

/** Error messages */
const errors = {
	'overflow': 'Overflow: input needs wider integers to process',
	'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
	'invalid-input': 'Invalid input'
};

/** Convenience shortcuts */
const baseMinusTMin = base - tMin;
const floor = Math.floor;
const stringFromCharCode = String.fromCharCode;

/*--------------------------------------------------------------------------*/

/**
 * A generic error utility function.
 * @private
 * @param {String} type The error type.
 * @returns {Error} Throws a `RangeError` with the applicable error message.
 */
function error(type) {
	throw new RangeError(errors[type]);
}

/**
 * A generic `Array#map` utility function.
 * @private
 * @param {Array} array The array to iterate over.
 * @param {Function} callback The function that gets called for every array
 * item.
 * @returns {Array} A new array of values returned by the callback function.
 */
function map(array, callback) {
	const result = [];
	let length = array.length;
	while (length--) {
		result[length] = callback(array[length]);
	}
	return result;
}

/**
 * A simple `Array#map`-like wrapper to work with domain name strings or email
 * addresses.
 * @private
 * @param {String} domain The domain name or email address.
 * @param {Function} callback The function that gets called for every
 * character.
 * @returns {String} A new string of characters returned by the callback
 * function.
 */
function mapDomain(domain, callback) {
	const parts = domain.split('@');
	let result = '';
	if (parts.length > 1) {
		// In email addresses, only the domain name should be punycoded. Leave
		// the local part (i.e. everything up to `@`) intact.
		result = parts[0] + '@';
		domain = parts[1];
	}
	// Avoid `split(regex)` for IE8 compatibility. See #17.
	domain = domain.replace(regexSeparators, '\x2E');
	const labels = domain.split('.');
	const encoded = map(labels, callback).join('.');
	return result + encoded;
}

/**
 * Creates an array containing the numeric code points of each Unicode
 * character in the string. While JavaScript uses UCS-2 internally,
 * this function will convert a pair of surrogate halves (each of which
 * UCS-2 exposes as separate characters) into a single code point,
 * matching UTF-16.
 * @see `punycode.ucs2.encode`
 * @see <https://mathiasbynens.be/notes/javascript-encoding>
 * @memberOf punycode.ucs2
 * @name decode
 * @param {String} string The Unicode input string (UCS-2).
 * @returns {Array} The new array of code points.
 */
function ucs2decode(string) {
	const output = [];
	let counter = 0;
	const length = string.length;
	while (counter < length) {
		const value = string.charCodeAt(counter++);
		if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
			// It's a high surrogate, and there is a next character.
			const extra = string.charCodeAt(counter++);
			if ((extra & 0xFC00) == 0xDC00) { // Low surrogate.
				output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
			} else {
				// It's an unmatched surrogate; only append this code unit, in case the
				// next code unit is the high surrogate of a surrogate pair.
				output.push(value);
				counter--;
			}
		} else {
			output.push(value);
		}
	}
	return output;
}

/**
 * Creates a string based on an array of numeric code points.
 * @see `punycode.ucs2.decode`
 * @memberOf punycode.ucs2
 * @name encode
 * @param {Array} codePoints The array of numeric code points.
 * @returns {String} The new Unicode string (UCS-2).
 */
const ucs2encode = codePoints => String.fromCodePoint(...codePoints);

/**
 * Converts a basic code point into a digit/integer.
 * @see `digitToBasic()`
 * @private
 * @param {Number} codePoint The basic numeric code point value.
 * @returns {Number} The numeric value of a basic code point (for use in
 * representing integers) in the range `0` to `base - 1`, or `base` if
 * the code point does not represent a value.
 */
const basicToDigit = function(codePoint) {
	if (codePoint >= 0x30 && codePoint < 0x3A) {
		return 26 + (codePoint - 0x30);
	}
	if (codePoint >= 0x41 && codePoint < 0x5B) {
		return codePoint - 0x41;
	}
	if (codePoint >= 0x61 && codePoint < 0x7B) {
		return codePoint - 0x61;
	}
	return base;
};

/**
 * Converts a digit/integer into a basic code point.
 * @see `basicToDigit()`
 * @private
 * @param {Number} digit The numeric value of a basic code point.
 * @returns {Number} The basic code point whose value (when used for
 * representing integers) is `digit`, which needs to be in the range
 * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
 * used; else, the lowercase form is used. The behavior is undefined
 * if `flag` is non-zero and `digit` has no uppercase form.
 */
const digitToBasic = function(digit, flag) {
	//  0..25 map to ASCII a..z or A..Z
	// 26..35 map to ASCII 0..9
	return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
};

/**
 * Bias adaptation function as per section 3.4 of RFC 3492.
 * https://tools.ietf.org/html/rfc3492#section-3.4
 * @private
 */
const adapt = function(delta, numPoints, firstTime) {
	let k = 0;
	delta = firstTime ? floor(delta / damp) : delta >> 1;
	delta += floor(delta / numPoints);
	for (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {
		delta = floor(delta / baseMinusTMin);
	}
	return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
};

/**
 * Converts a Punycode string of ASCII-only symbols to a string of Unicode
 * symbols.
 * @memberOf punycode
 * @param {String} input The Punycode string of ASCII-only symbols.
 * @returns {String} The resulting string of Unicode symbols.
 */
const decode = function(input) {
	// Don't use UCS-2.
	const output = [];
	const inputLength = input.length;
	let i = 0;
	let n = initialN;
	let bias = initialBias;

	// Handle the basic code points: let `basic` be the number of input code
	// points before the last delimiter, or `0` if there is none, then copy
	// the first basic code points to the output.

	let basic = input.lastIndexOf(delimiter);
	if (basic < 0) {
		basic = 0;
	}

	for (let j = 0; j < basic; ++j) {
		// if it's not a basic code point
		if (input.charCodeAt(j) >= 0x80) {
			error('not-basic');
		}
		output.push(input.charCodeAt(j));
	}

	// Main decoding loop: start just after the last delimiter if any basic code
	// points were copied; start at the beginning otherwise.

	for (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {

		// `index` is the index of the next character to be consumed.
		// Decode a generalized variable-length integer into `delta`,
		// which gets added to `i`. The overflow checking is easier
		// if we increase `i` as we go, then subtract off its starting
		// value at the end to obtain `delta`.
		const oldi = i;
		for (let w = 1, k = base; /* no condition */; k += base) {

			if (index >= inputLength) {
				error('invalid-input');
			}

			const digit = basicToDigit(input.charCodeAt(index++));

			if (digit >= base) {
				error('invalid-input');
			}
			if (digit > floor((maxInt - i) / w)) {
				error('overflow');
			}

			i += digit * w;
			const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);

			if (digit < t) {
				break;
			}

			const baseMinusT = base - t;
			if (w > floor(maxInt / baseMinusT)) {
				error('overflow');
			}

			w *= baseMinusT;

		}

		const out = output.length + 1;
		bias = adapt(i - oldi, out, oldi == 0);

		// `i` was supposed to wrap around from `out` to `0`,
		// incrementing `n` each time, so we'll fix that now:
		if (floor(i / out) > maxInt - n) {
			error('overflow');
		}

		n += floor(i / out);
		i %= out;

		// Insert `n` at position `i` of the output.
		output.splice(i++, 0, n);

	}

	return String.fromCodePoint(...output);
};

/**
 * Converts a string of Unicode symbols (e.g. a domain name label) to a
 * Punycode string of ASCII-only symbols.
 * @memberOf punycode
 * @param {String} input The string of Unicode symbols.
 * @returns {String} The resulting Punycode string of ASCII-only symbols.
 */
const encode = function(input) {
	const output = [];

	// Convert the input in UCS-2 to an array of Unicode code points.
	input = ucs2decode(input);

	// Cache the length.
	const inputLength = input.length;

	// Initialize the state.
	let n = initialN;
	let delta = 0;
	let bias = initialBias;

	// Handle the basic code points.
	for (const currentValue of input) {
		if (currentValue < 0x80) {
			output.push(stringFromCharCode(currentValue));
		}
	}

	const basicLength = output.length;
	let handledCPCount = basicLength;

	// `handledCPCount` is the number of code points that have been handled;
	// `basicLength` is the number of basic code points.

	// Finish the basic string with a delimiter unless it's empty.
	if (basicLength) {
		output.push(delimiter);
	}

	// Main encoding loop:
	while (handledCPCount < inputLength) {

		// All non-basic code points < n have been handled already. Find the next
		// larger one:
		let m = maxInt;
		for (const currentValue of input) {
			if (currentValue >= n && currentValue < m) {
				m = currentValue;
			}
		}

		// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
		// but guard against overflow.
		const handledCPCountPlusOne = handledCPCount + 1;
		if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
			error('overflow');
		}

		delta += (m - n) * handledCPCountPlusOne;
		n = m;

		for (const currentValue of input) {
			if (currentValue < n && ++delta > maxInt) {
				error('overflow');
			}
			if (currentValue === n) {
				// Represent delta as a generalized variable-length integer.
				let q = delta;
				for (let k = base; /* no condition */; k += base) {
					const t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);
					if (q < t) {
						break;
					}
					const qMinusT = q - t;
					const baseMinusT = base - t;
					output.push(
						stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))
					);
					q = floor(qMinusT / baseMinusT);
				}

				output.push(stringFromCharCode(digitToBasic(q, 0)));
				bias = adapt(delta, handledCPCountPlusOne, handledCPCount === basicLength);
				delta = 0;
				++handledCPCount;
			}
		}

		++delta;
		++n;

	}
	return output.join('');
};

/**
 * Converts a Punycode string representing a domain name or an email address
 * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
 * it doesn't matter if you call it on a string that has already been
 * converted to Unicode.
 * @memberOf punycode
 * @param {String} input The Punycoded domain name or email address to
 * convert to Unicode.
 * @returns {String} The Unicode representation of the given Punycode
 * string.
 */
const toUnicode = function(input) {
	return mapDomain(input, function(string) {
		return regexPunycode.test(string)
			? decode(string.slice(4).toLowerCase())
			: string;
	});
};

/**
 * Converts a Unicode string representing a domain name or an email address to
 * Punycode. Only the non-ASCII parts of the domain name will be converted,
 * i.e. it doesn't matter if you call it with a domain that's already in
 * ASCII.
 * @memberOf punycode
 * @param {String} input The domain name or email address to convert, as a
 * Unicode string.
 * @returns {String} The Punycode representation of the given domain name or
 * email address.
 */
const toASCII = function(input) {
	return mapDomain(input, function(string) {
		return regexNonASCII.test(string)
			? 'xn--' + encode(string)
			: string;
	});
};

/*--------------------------------------------------------------------------*/

/** Define the public API */
const punycode = {
	/**
	 * A string representing the current Punycode.js version number.
	 * @memberOf punycode
	 * @type String
	 */
	'version': '2.3.1',
	/**
	 * An object of methods to convert from JavaScript's internal character
	 * representation (UCS-2) to Unicode code points, and back.
	 * @see <https://mathiasbynens.be/notes/javascript-encoding>
	 * @memberOf punycode
	 * @type Object
	 */
	'ucs2': {
		'decode': ucs2decode,
		'encode': ucs2encode
	},
	'decode': decode,
	'encode': encode,
	'toASCII': toASCII,
	'toUnicode': toUnicode
};

module.exports = punycode;
hxx100644 LICENSE 1_哖Z/PS.100644 README.md ^y ^:!|40000 bin %-9ԊX:wz^40000 classes {͋B" 7C+V40000 functions Q33(-ۣ!=C100644 index.js `=lK.ϟ40000 internal fG	V;t)r100644 package.json ǻF^sPQ8C100644 preload.js {ޱl6/yƟ100644 range.bnf 7'vH);40000 ranges W%Ѯ
c*:E?xEdsemver(1) -- The semantic versioner for npm
===========================================

## Install

```bash
npm install semver
````

## Usage

As a node module:

```js
const semver = require('semver')

semver.valid('1.2.3') // '1.2.3'
semver.valid('a.b.c') // null
semver.clean('  =v1.2.3   ') // '1.2.3'
semver.satisfies('1.2.3', '1.x || >=2.5.0 || 5.0.0 - 7.2.3') // true
semver.gt('1.2.3', '9.8.7') // false
semver.lt('1.2.3', '9.8.7') // true
semver.minVersion('>=1.0.0') // '1.0.0'
semver.valid(semver.coerce('v2')) // '2.0.0'
semver.valid(semver.coerce('42.6.7.9.3-alpha')) // '42.6.7'
```

You can also just load the module for the function that you care about if
you'd like to minimize your footprint.

```js
// load the whole API at once in a single object
const semver = require('semver')

// or just load the bits you need
// all of them listed here, just pick and choose what you want

// classes
const SemVer = require('semver/classes/semver')
const Comparator = require('semver/classes/comparator')
const Range = require('semver/classes/range')

// functions for working with versions
const semverParse = require('semver/functions/parse')
const semverValid = require('semver/functions/valid')
const semverClean = require('semver/functions/clean')
const semverInc = require('semver/functions/inc')
const semverDiff = require('semver/functions/diff')
const semverMajor = require('semver/functions/major')
const semverMinor = require('semver/functions/minor')
const semverPatch = require('semver/functions/patch')
const semverPrerelease = require('semver/functions/prerelease')
const semverCompare = require('semver/functions/compare')
const semverRcompare = require('semver/functions/rcompare')
const semverCompareLoose = require('semver/functions/compare-loose')
const semverCompareBuild = require('semver/functions/compare-build')
const semverSort = require('semver/functions/sort')
const semverRsort = require('semver/functions/rsort')
const semverTruncate = require('semver/functions/truncate')

// low-level comparators between versions
const semverGt = require('semver/functions/gt')
const semverLt = require('semver/functions/lt')
const semverEq = require('semver/functions/eq')
const semverNeq = require('semver/functions/neq')
const semverGte = require('semver/functions/gte')
const semverLte = require('semver/functions/lte')
const semverCmp = require('semver/functions/cmp')
const semverCoerce = require('semver/functions/coerce')

// working with ranges
const semverSatisfies = require('semver/functions/satisfies')
const semverMaxSatisfying = require('semver/ranges/max-satisfying')
const semverMinSatisfying = require('semver/ranges/min-satisfying')
const semverToComparators = require('semver/ranges/to-comparators')
const semverMinVersion = require('semver/ranges/min-version')
const semverValidRange = require('semver/ranges/valid')
const semverOutside = require('semver/ranges/outside')
const semverGtr = require('semver/ranges/gtr')
const semverLtr = require('semver/ranges/ltr')
const semverIntersects = require('semver/ranges/intersects')
const semverSimplifyRange = require('semver/ranges/simplify')
const semverRangeSubset = require('semver/ranges/subset')
```

As a command-line utility:

```
$ semver -h

A JavaScript implementation of the https://semver.org/ specification
Copyright Isaac Z. Schlueter

Usage: semver [options] <version> [<version> [...]]
Prints valid versions sorted by SemVer precedence

Options:
-r --range <range>
        Print versions that match the specified range.

-i --increment [<level>]
        Increment a version by the specified level.  Level can
        be one of: major, minor, patch, premajor, preminor,
        prepatch, prerelease, or release.  Default level is 'patch'.
        Only one version may be specified.

--preid <identifier>
        Identifier to be used to prefix premajor, preminor,
        prepatch or prerelease version increments.

-l --loose
        Interpret versions and ranges loosely

-n <0|1|false>
        Base number for prerelease identifier (default: 0).
        Use false to omit the number altogether.

-p --include-prerelease
        Always include prerelease versions in range matching

-c --coerce
        Coerce a string into SemVer if possible
        (does not imply --loose)

--rtl
        Coerce version strings right to left

--ltr
        Coerce version strings left to right (default)

Program exits successfully if any valid version satisfies
all supplied ranges, and prints all satisfying versions.

If no satisfying versions are found, then exits failure.

Versions are printed in ascending order, so supplying
multiple versions to the utility will just sort them.
```

## Versions

A "version" is described by the `v2.0.0` specification found at
<https://semver.org/>.

A leading `"="` or `"v"` character is stripped off and ignored.
Support for stripping a leading "v" is kept for compatibility with `v1.0.0` of the SemVer
specification but should not be used anymore.

## Ranges

A `version range` is a set of `comparators` that specify versions
that satisfy the range.

A `comparator` is composed of an `operator` and a `version`.  The set
of primitive `operators` is:

* `<` Less than
* `<=` Less than or equal to
* `>` Greater than
* `>=` Greater than or equal to
* `=` Equal.  If no operator is specified, then equality is assumed,
  so this operator is optional but MAY be included.

For example, the comparator `>=1.2.7` would match the versions
`1.2.7`, `1.2.8`, `2.5.3`, and `1.3.9`, but not the versions `1.2.6`
or `1.1.0`. The comparator `>1` is equivalent to `>=2.0.0` and
would match the versions `2.0.0` and `3.1.0`, but not the versions
`1.0.1` or `1.1.0`.

Comparators can be joined by whitespace to form a `comparator set`,
which is satisfied by the **intersection** of all of the comparators
it includes.

A range is composed of one or more comparator sets, joined by `||`.  A
version matches a range if and only if every comparator in at least
one of the `||`-separated comparator sets is satisfied by the version.

For example, the range `>=1.2.7 <1.3.0` would match the versions
`1.2.7`, `1.2.8`, and `1.2.99`, but not the versions `1.2.6`, `1.3.0`,
or `1.1.0`.

The range `1.2.7 || >=1.2.9 <2.0.0` would match the versions `1.2.7`,
`1.2.9`, and `1.4.6`, but not the versions `1.2.8` or `2.0.0`.

### Prerelease Tags

If a version has a prerelease tag (for example, `1.2.3-alpha.3`) then
it will only be allowed to satisfy comparator sets if at least one
comparator with the same `[major, minor, patch]` tuple also has a
prerelease tag.

For example, the range `>1.2.3-alpha.3` would be allowed to match the
version `1.2.3-alpha.7`, but it would *not* be satisfied by
`3.4.5-alpha.9`, even though `3.4.5-alpha.9` is technically "greater
than" `1.2.3-alpha.3` according to the SemVer sort rules.  The version
range only accepts prerelease tags on the `1.2.3` version.
Version `3.4.5` *would* satisfy the range because it does not have a
prerelease flag, and `3.4.5` is greater than `1.2.3-alpha.7`.

The purpose of this behavior is twofold.  First, prerelease versions
frequently are updated very quickly, and contain many breaking changes
that are (by the author's design) not yet fit for public consumption.
Therefore, by default, they are excluded from range-matching
semantics.

Second, a user who has opted into using a prerelease version has
indicated the intent to use *that specific* set of
alpha/beta/rc versions.  By including a prerelease tag in the range,
the user is indicating that they are aware of the risk.  However, it
is still not appropriate to assume that they have opted into taking a
similar risk on the *next* set of prerelease versions.

Note that this behavior can be suppressed (treating all prerelease
versions as if they were normal versions, for range-matching)
by setting the `includePrerelease` flag on the options
object to any
[functions](https://github.com/npm/node-semver#functions) that do
range matching.

#### Prerelease Identifiers

The method `.inc` takes an additional `identifier` string argument that
will append the value of the string as a prerelease identifier:

```javascript
semver.inc('1.2.3', 'prerelease', 'beta')
// '1.2.4-beta.0'
```

command-line example:

```bash
$ semver 1.2.3 -i prerelease --preid beta
1.2.4-beta.0
```

Which then can be used to increment further:

```bash
$ semver 1.2.4-beta.0 -i prerelease
1.2.4-beta.1
```

To get out of the prerelease phase, use the `release` option:

```bash
$ semver 1.2.4-beta.1 -i release
1.2.4
```

#### Prerelease Identifier Base

The method `.inc` takes an optional parameter 'identifierBase' string
that will let you let your prerelease number as zero-based or one-based.
Set to `false` to omit the prerelease number altogether.
If you do not specify this parameter, it will default to zero-based.

```javascript
semver.inc('1.2.3', 'prerelease', 'beta', '1')
// '1.2.4-beta.1'
```

```javascript
semver.inc('1.2.3', 'prerelease', 'beta', false)
// '1.2.4-beta'
```

command-line example:

```bash
$ semver 1.2.3 -i prerelease --preid beta -n 1
1.2.4-beta.1
```

```bash
$ semver 1.2.3 -i prerelease --preid beta -n false
1.2.4-beta
```

### Advanced Range Syntax

Advanced range syntax desugars to primitive comparators in
deterministic ways.

Advanced ranges may be combined in the same way as primitive
comparators using white space or `||`.

#### Hyphen Ranges `X.Y.Z - A.B.C`

Specifies an inclusive set.

* `1.2.3 - 2.3.4` := `>=1.2.3 <=2.3.4`

If a partial version is provided as the first version in the inclusive
range, then the missing pieces are replaced with zeroes.

* `1.2 - 2.3.4` := `>=1.2.0 <=2.3.4`

If a partial version is provided as the second version in the
inclusive range, then all versions that start with the supplied parts
of the tuple are accepted, but nothing that would be greater than the
provided tuple parts.

* `1.2.3 - 2.3` := `>=1.2.3 <2.4.0-0`
* `1.2.3 - 2` := `>=1.2.3 <3.0.0-0`

#### X-Ranges `1.2.x` `1.X` `1.2.*` `*`

Any of `X`, `x`, or `*` may be used to "stand in" for one of the
numeric values in the `[major, minor, patch]` tuple.

* `*` := `>=0.0.0` (Any non-prerelease version satisfies, unless
  `includePrerelease` is specified, in which case any version at all
  satisfies)
* `1.x` := `>=1.0.0 <2.0.0-0` (Matching major version)
* `1.2.x` := `>=1.2.0 <1.3.0-0` (Matching major and minor versions)

A partial version range is treated as an X-Range, so the special
character is in fact optional.

* `""` (empty string) := `*` := `>=0.0.0`
* `1` := `1.x.x` := `>=1.0.0 <2.0.0-0`
* `1.2` := `1.2.x` := `>=1.2.0 <1.3.0-0`

#### Tilde Ranges `~1.2.3` `~1.2` `~1`

Allows patch-level changes if a minor version is specified on the
comparator.  Allows minor-level changes if not.

* `~1.2.3` := `>=1.2.3 <1.(2+1).0` := `>=1.2.3 <1.3.0-0`
* `~1.2` := `>=1.2.0 <1.(2+1).0` := `>=1.2.0 <1.3.0-0` (Same as `1.2.x`)
* `~1` := `>=1.0.0 <(1+1).0.0` := `>=1.0.0 <2.0.0-0` (Same as `1.x`)
* `~0.2.3` := `>=0.2.3 <0.(2+1).0` := `>=0.2.3 <0.3.0-0`
* `~0.2` := `>=0.2.0 <0.(2+1).0` := `>=0.2.0 <0.3.0-0` (Same as `0.2.x`)
* `~0` := `>=0.0.0 <(0+1).0.0` := `>=0.0.0 <1.0.0-0` (Same as `0.x`)
* `~1.2.3-beta.2` := `>=1.2.3-beta.2 <1.3.0-0` Note that prereleases in
  the `1.2.3` version will be allowed, if they are greater than or
  equal to `beta.2`.  So, `1.2.3-beta.4` would be allowed, but
  `1.2.4-beta.2` would not, because it is a prerelease of a
  different `[major, minor, patch]` tuple.

#### Caret Ranges `^1.2.3` `^0.2.5` `^0.0.4`

Allows changes that do not modify the left-most non-zero element in the
`[major, minor, patch]` tuple.  In other words, this allows patch and
minor updates for versions `1.0.0` and above, patch updates for
versions `0.X >=0.1.0`, and *no* updates for versions `0.0.X`.

Many authors treat a `0.x` version as if the `x` were the major
"breaking-change" indicator.

Caret ranges are ideal when an author may make breaking changes
between `0.2.4` and `0.3.0` releases, which is a common practice.
However, it presumes that there will *not* be breaking changes between
`0.2.4` and `0.2.5`.  It allows for changes that are presumed to be
additive (but non-breaking), according to commonly observed practices.

* `^1.2.3` := `>=1.2.3 <2.0.0-0`
* `^0.2.3` := `>=0.2.3 <0.3.0-0`
* `^0.0.3` := `>=0.0.3 <0.0.4-0`
* `^1.2.3-beta.2` := `>=1.2.3-beta.2 <2.0.0-0` Note that prereleases in
  the `1.2.3` version will be allowed, if they are greater than or
  equal to `beta.2`.  So, `1.2.3-beta.4` would be allowed, but
  `1.2.4-beta.2` would not, because it is a prerelease of a
  different `[major, minor, patch]` tuple.
* `^0.0.3-beta` := `>=0.0.3-beta <0.0.4-0`  Note that prereleases in the
  `0.0.3` version *only* will be allowed, if they are greater than or
  equal to `beta`.  So, `0.0.3-pr.2` would be allowed.

When parsing caret ranges, a missing `patch` value desugars to the
number `0`, but will allow flexibility within that value, even if the
major and minor versions are both `0`.

* `^1.2.x` := `>=1.2.0 <2.0.0-0`
* `^0.0.x` := `>=0.0.0 <0.1.0-0`
* `^0.0` := `>=0.0.0 <0.1.0-0`

A missing `minor` and `patch` values will desugar to zero, but also
allow flexibility within those values, even if the major version is
zero.

* `^1.x` := `>=1.0.0 <2.0.0-0`
* `^0.x` := `>=0.0.0 <1.0.0-0`

### Range Grammar

Putting all this together, here is a Backus-Naur grammar for ranges,
for the benefit of parser authors:

```bnf
range-set  ::= range ( logical-or range ) *
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
range      ::= hyphen | simple ( ' ' simple ) * | ''
hyphen     ::= partial ' - ' partial
simple     ::= primitive | partial | tilde | caret
primitive  ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
partial    ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
xr         ::= 'x' | 'X' | '*' | nr
nr         ::= '0' | ['1'-'9'] ( ['0'-'9'] ) *
tilde      ::= '~' partial
caret      ::= '^' partial
qualifier  ::= ( '-' pre )? ( '+' build )?
pre        ::= prepart ( '.' prepart ) *
prepart    ::= nr | alphanumid
build      ::= buildid ( '.' buildid ) *
alphanumid ::= ( ['0'-'9'] ) * [-A-Za-z] [-0-9A-Za-z] *
buildid    ::= [-0-9A-Za-z]+
```

Note: Prerelease identifiers (`pre`) use `nr` for numeric parts, which
disallows leading zeros (e.g., `1.2.3-00` is invalid). Build metadata
identifiers (`build`) allow any alphanumeric string including leading
zeros (e.g., `1.2.3+00` is valid). This matches the
[SemVer 2.0.0 specification](https://semver.org/#spec-item-9).

## Functions

All methods and classes take a final `options` object argument.  All
options in this object are `false` by default.  The options supported
are:

- `loose`: Be more forgiving about not-quite-valid semver strings.
  (Any resulting output will always be 100% strict compliant, of
  course.)  For backwards compatibility reasons, if the `options`
  argument is a boolean value instead of an object, it is interpreted
  to be the `loose` param.
- `includePrerelease`: Set to suppress the [default
  behavior](https://github.com/npm/node-semver#prerelease-tags) of
  excluding prerelease tagged versions from ranges unless they are
  explicitly opted into.

Strict-mode Comparators and Ranges will be strict about the SemVer
strings that they parse.

* `valid(v)`: Return the parsed version, or null if it's not valid.
* `inc(v, releaseType, options, identifier, identifierBase)`: 
  Return the version incremented by the release
  type (`major`, `premajor`, `minor`, `preminor`, `patch`,
  `prepatch`, `prerelease`, or `release`), or null if it's not valid
  * `premajor` in one call will bump the version up to the next major
    version and down to a prerelease of that major version.
    `preminor`, and `prepatch` work the same way.
  * If called from a non-prerelease version, `prerelease` will work the
    same as `prepatch`. It increments the patch version and then makes a
    prerelease. If the input version is already a prerelease it simply
    increments it.
  * `release` will remove any prerelease part of the version.
  * `identifier` can be used to prefix `premajor`, `preminor`,
    `prepatch`, or `prerelease` version increments. `identifierBase`
    is the base to be used for the `prerelease` identifier.
* `prerelease(v)`: Returns an array of prerelease components, or null
  if none exist. Example: `prerelease('1.2.3-alpha.1') -> ['alpha', 1]`
* `major(v)`: Return the major version number.
* `minor(v)`: Return the minor version number.
* `patch(v)`: Return the patch version number.
* `intersects(r1, r2, loose)`: Return true if the two supplied ranges
  or comparators intersect.
* `parse(v)`: Attempt to parse a string as a semantic version, returning either
  a `SemVer` object or `null`.
* `truncate(v, releaseType)`: Return the version with components _lower_
  than `releaseType` dropped off, e.g.:
  * `major` removes build & prerelease info and sets minor & patch to 0.
  * `minor` removes build & prerelease info, and sets patch to 0
  * `patch` removes build & prerelease info
  * All prerelease types remove build info only

### Comparison

* `gt(v1, v2)`: `v1 > v2`
* `gte(v1, v2)`: `v1 >= v2`
* `lt(v1, v2)`: `v1 < v2`
* `lte(v1, v2)`: `v1 <= v2`
* `eq(v1, v2)`: `v1 == v2` This is true if they're logically equivalent,
  even if they're not the same string.  You already know how to
  compare strings.
* `neq(v1, v2)`: `v1 != v2` The opposite of `eq`.
* `cmp(v1, comparator, v2)`: Pass in a comparison string, and it'll call
  the corresponding function above.  `"==="` and `"!=="` do simple
  string comparison, but are included for completeness.  Throws if an
  invalid comparison string is provided.
* `compare(v1, v2)`: Return `0` if `v1 == v2`, or `1` if `v1` is greater, or `-1` if
  `v2` is greater.  Sorts in ascending order if passed to `Array.sort()`.
* `rcompare(v1, v2)`: The reverse of `compare`.  Sorts an array of versions
  in descending order when passed to `Array.sort()`.
* `compareBuild(v1, v2)`: The same as `compare` but considers `build` when two versions
  are equal.  Sorts in ascending order if passed to `Array.sort()`.
* `compareLoose(v1, v2)`: Short for `compare(v1, v2, { loose: true })`.
* `diff(v1, v2)`: Returns the difference between two versions by the release type
  (`major`, `premajor`, `minor`, `preminor`, `patch`, `prepatch`, or `prerelease`),
  or null if the versions are the same.

### Sorting

* `sort(versions)`: Returns a sorted array of versions based on the `compareBuild` 
  function.
* `rsort(versions)`: The reverse of `sort`. Returns an array of versions based on
  the `compareBuild` function in descending order.

### Comparators

* `intersects(comparator)`: Return true if the comparators intersect

### Ranges

* `validRange(range)`: Return the valid range or null if it's not valid.
* `satisfies(version, range)`: Return true if the version satisfies the
  range.
* `maxSatisfying(versions, range)`: Return the highest version in the list
  that satisfies the range, or `null` if none of them do.
* `minSatisfying(versions, range)`: Return the lowest version in the list
  that satisfies the range, or `null` if none of them do.
* `minVersion(range)`: Return the lowest version that can match
  the given range.
* `gtr(version, range)`: Return `true` if the version is greater than all the
  versions possible in the range.
* `ltr(version, range)`: Return `true` if the version is less than all the
  versions possible in the range.
* `outside(version, range, hilo)`: Return true if the version is outside
  the bounds of the range in either the high or low direction.  The
  `hilo` argument must be either the string `'>'` or `'<'`.  (This is
  the function called by `gtr` and `ltr`.)
* `intersects(range)`: Return true if any of the range comparators intersect.
* `simplifyRange(versions, range)`: Return a "simplified" range that
  matches the same items in the `versions` list as the range specified.  Note
  that it does *not* guarantee that it would match the same versions in all
  cases, only for the set of versions provided.  This is useful when
  generating ranges by joining together multiple versions with `||`
  programmatically, to provide the user with something a bit more
  ergonomic.  If the provided range is shorter in string-length than the
  generated range, then that is returned.
* `subset(subRange, superRange)`: Return `true` if the `subRange` range is
  entirely contained by the `superRange` range.

Note that, since ranges may be non-contiguous, a version might not be
greater than a range, less than a range, *or* satisfy a range!  For
example, the range `1.2 <1.2.9 || >2.0.0` would have a hole from `1.2.9`
until `2.0.0`, so version `1.2.10` would not be greater than the
range (because `2.0.1` satisfies, which is higher), nor less than the
range (since `1.2.8` satisfies, which is lower), and it also does not
satisfy the range.

If you want to know if a version satisfies or does not satisfy a
range, use the `satisfies(version, range)` function.

### Coercion

* `coerce(version, options)`: Coerces a string to semver if possible

This aims to provide a very forgiving translation of a non-semver string to
semver. It looks for the first digit in a string and consumes all
remaining characters which satisfy at least a partial semver (e.g., `1`,
`1.2`, `1.2.3`) up to the max permitted length (256 characters).  Longer
versions are simply truncated (`4.6.3.9.2-alpha2` becomes `4.6.3`).  All
surrounding text is simply ignored (`v3.4 replaces v3.3.1` becomes
`3.4.0`).  Only text which lacks digits will fail coercion (`version one`
is not valid).  The maximum length for any semver component considered for
coercion is 16 characters; longer components will be ignored
(`10000000000000000.4.7.4` becomes `4.7.4`).  The maximum value for any
semver component is `Number.MAX_SAFE_INTEGER || (2**53 - 1)`; higher value
components are invalid (`9999999999999999.4.7.4` is likely invalid).

If the `options.rtl` flag is set, then `coerce` will return the right-most
coercible tuple that does not share an ending index with a longer coercible
tuple.  For example, `1.2.3.4` will return `2.3.4` in rtl mode, not
`4.0.0`.  `1.2.3/4` will return `4.0.0`, because the `4` is not a part of
any other overlapping SemVer tuple.

If the `options.includePrerelease` flag is set, then the `coerce` result will contain
prerelease and build parts of a version.  For example, `1.2.3.4-rc.1+rev.2`
will preserve prerelease `rc.1` and build `rev.2` in the result.

### Clean

* `clean(version)`: Clean a string to be a valid semver if possible

This will return a cleaned and trimmed semver version. If the provided
version is not valid a null will be returned. This does not work for
ranges.

ex.
* `s.clean(' = v 2.1.5foo')`: `null`
* `s.clean(' = v 2.1.5foo', { loose: true })`: `'2.1.5-foo'`
* `s.clean(' = v 2.1.5-foo')`: `null`
* `s.clean(' = v 2.1.5-foo', { loose: true })`: `'2.1.5-foo'`
* `s.clean('=v2.1.5')`: `'2.1.5'`
* `s.clean('  =v2.1.5')`: `'2.1.5'`
* `s.clean('      2.1.5   ')`: `'2.1.5'`
* `s.clean('~1.0.0')`: `null`

## Constants

As a convenience, helper constants are exported to provide information about what `node-semver` supports:

### `RELEASE_TYPES`

- major
- premajor
- minor
- preminor
- patch
- prepatch
- prerelease

```
const semver = require('semver');

if (semver.RELEASE_TYPES.includes(arbitraryUserInput)) {
  console.log('This is a valid release type!');
} else {
  console.warn('This is NOT a valid release type!');
}
```

### `SEMVER_SPEC_VERSION`

2.0.0

```
const semver = require('semver');

console.log('We are currently using the semver specification version:', semver.SEMVER_SPEC_VERSION);
```

## Exported Modules

<!--
TODO: Make sure that all of these items are documented (classes aren't,
eg), and then pull the module name into the documentation for that specific
thing.
-->

You may pull in just the part of this semver utility that you need if you
are sensitive to packing and tree-shaking concerns.  The main
`require('semver')` export uses getter functions to lazily load the parts
of the API that are used.

The following modules are available:

* `require('semver')`
* `require('semver/classes')`
* `require('semver/classes/comparator')`
* `require('semver/classes/range')`
* `require('semver/classes/semver')`
* `require('semver/functions/clean')`
* `require('semver/functions/cmp')`
* `require('semver/functions/coerce')`
* `require('semver/functions/compare')`
* `require('semver/functions/compare-build')`
* `require('semver/functions/compare-loose')`
* `require('semver/functions/diff')`
* `require('semver/functions/eq')`
* `require('semver/functions/gt')`
* `require('semver/functions/gte')`
* `require('semver/functions/inc')`
* `require('semver/functions/lt')`
* `require('semver/functions/lte')`
* `require('semver/functions/major')`
* `require('semver/functions/minor')`
* `require('semver/functions/neq')`
* `require('semver/functions/parse')`
* `require('semver/functions/patch')`
* `require('semver/functions/prerelease')`
* `require('semver/functions/rcompare')`
* `require('semver/functions/rsort')`
* `require('semver/functions/satisfies')`
* `require('semver/functions/sort')`
* `require('semver/functions/truncate')`
* `require('semver/functions/valid')`
* `require('semver/ranges/gtr')`
* `require('semver/ranges/intersects')`
* `require('semver/ranges/ltr')`
* `require('semver/ranges/max-satisfying')`
* `require('semver/ranges/min-satisfying')`
* `require('semver/ranges/min-version')`
* `require('semver/ranges/outside')`
* `require('semver/ranges/simplify')`
* `require('semver/ranges/subset')`
* `require('semver/ranges/to-comparators')`
* `require('semver/ranges/valid')`

%
x% 100644 semver.js ە٦z̆bjx]#!/usr/bin/env node
// Standalone semver comparison program.
// Exits successfully and prints matching version(s) if
// any supplied version is valid and passes all tests.

'use strict'

const argv = process.argv.slice(2)

let versions = []

const range = []

let inc = null

const version = require('../package.json').version

let loose = false

let includePrerelease = false

let coerce = false

let rtl = false

let identifier

let identifierBase

const semver = require('../')
const parseOptions = require('../internal/parse-options')

let reverse = false

let options = {}

const main = () => {
  if (!argv.length) {
    return help()
  }
  while (argv.length) {
    let a = argv.shift()
    const indexOfEqualSign = a.indexOf('=')
    if (indexOfEqualSign !== -1) {
      const value = a.slice(indexOfEqualSign + 1)
      a = a.slice(0, indexOfEqualSign)
      argv.unshift(value)
    }

    switch (a) {
      case '-rv': case '-rev': case '--rev': case '--reverse':
        reverse = true
        break
      case '-l': case '--loose':
        loose = true
        break
      case '-p': case '--include-prerelease':
        includePrerelease = true
        break
      case '-v': case '--version':
        versions.push(argv.shift())
        break
      case '-i': case '--inc': case '--increment':
        if (semver.RELEASE_TYPES.includes(argv[0]) || (argv[0] === 'release')) {
          inc = { value: argv.shift(), maybeErrantValue: null, option: a }
        } else {
          inc = { value: 'patch', maybeErrantValue: argv[0], option: a }
        }
        break
      case '--preid':
        identifier = argv.shift()
        break
      case '-r': case '--range':
        range.push(argv.shift())
        break
      case '-n':
        identifierBase = argv.shift()
        if (identifierBase === 'false') {
          identifierBase = false
        }
        break
      case '-c': case '--coerce':
        coerce = true
        break
      case '--rtl':
        rtl = true
        break
      case '--ltr':
        rtl = false
        break
      case '-h': case '--help': case '-?':
        return help()
      default:
        versions.push(a)
        break
    }
  }

  options = parseOptions({ loose, includePrerelease, rtl })

  if (
    inc &&
    versions.includes(inc.maybeErrantValue) &&
    !semver.valid(inc.maybeErrantValue, options)
  ) {
    console.warn(`Invalid value for ${inc.option}; defaulting to 'patch'. This may become a failure in future major versions.`)
  }

  versions = versions.map((v) => {
    return coerce ? (semver.coerce(v, options) || { version: v }).version : v
  }).filter((v) => {
    return semver.valid(v, options)
  })
  if (!versions.length) {
    return fail()
  }
  if (inc && (versions.length !== 1 || range.length)) {
    return failInc()
  }

  for (let i = 0, l = range.length; i < l; i++) {
    versions = versions.filter((v) => {
      return semver.satisfies(v, range[i], options)
    })
    if (!versions.length) {
      return fail()
    }
  }
  versions
    .sort((a, b) => semver[reverse ? 'rcompare' : 'compare'](a, b, options))
    .map(v => semver.clean(v, options))
    .map(v => inc ? semver.inc(v, inc.value, options, identifier, identifierBase) : v)
    .forEach(v => console.log(v))
}

const failInc = () => {
  console.error('--inc can only be used on a single version with no range')
  fail()
}

const fail = () => process.exit(1)

const help = () => console.log(
`SemVer ${version}

A JavaScript implementation of the https://semver.org/ specification
Copyright Isaac Z. Schlueter

Usage: semver [options] <version> [<version> [...]]
Prints valid versions sorted by SemVer precedence

Options:
-r --range <range>
        Print versions that match the specified range.

-i --increment [<level>]
        Increment a version by the specified level.  Level can
        be one of: major, minor, patch, premajor, preminor,
        prepatch, prerelease, or release.  Default level is 'patch'.
        Only one version may be specified.

--preid <identifier>
        Identifier to be used to prefix premajor, preminor,
        prepatch or prerelease version increments.

-l --loose
        Interpret versions and ranges loosely

-p --include-prerelease
        Always include prerelease versions in range matching

-c --coerce
        Coerce a string into SemVer if possible
        (does not imply --loose)

--rtl
        Coerce version strings right to left

--ltr
        Coerce version strings left to right (default)

-n <base>
        Base number to be used for the prerelease identifier.
        Can be either 0 or 1, or false to omit the number altogether.
        Defaults to 0.

Program exits successfully if any valid version satisfies
all supplied ranges, and prints all satisfying versions.

If no satisfying versions are found, then exits failure.

Versions are printed in ascending order, so supplying
multiple versions to the utility will just sort them.`)

main()
XZ	x i100644 comparator.js d|	vx8<]100644 index.js Nħ&I~!S>uJC100644 range.js UoI+ƒ!@100644 semver.js T8r҆k|޹mb6}R<Qx/'use strict'

const ANY = Symbol('SemVer ANY')
// hoisted class for cyclic dependency
class Comparator {
  static get ANY () {
    return ANY
  }

  constructor (comp, options) {
    options = parseOptions(options)

    if (comp instanceof Comparator) {
      if (comp.loose === !!options.loose) {
        return comp
      } else {
        comp = comp.value
      }
    }

    comp = comp.trim().split(/\s+/).join(' ')
    debug('comparator', comp, options)
    this.options = options
    this.loose = !!options.loose
    this.parse(comp)

    if (this.semver === ANY) {
      this.value = ''
    } else {
      this.value = this.operator + this.semver.version
    }

    debug('comp', this)
  }

  parse (comp) {
    const r = this.options.loose ? re[t.COMPARATORLOOSE] : re[t.COMPARATOR]
    const m = comp.match(r)

    if (!m) {
      throw new TypeError(`Invalid comparator: ${comp}`)
    }

    this.operator = m[1] !== undefined ? m[1] : ''
    if (this.operator === '=') {
      this.operator = ''
    }

    // if it literally is just '>' or '' then allow anything.
    if (!m[2]) {
      this.semver = ANY
    } else {
      this.semver = new SemVer(m[2], this.options.loose)
    }
  }

  toString () {
    return this.value
  }

  test (version) {
    debug('Comparator.test', version, this.options.loose)

    if (this.semver === ANY || version === ANY) {
      return true
    }

    if (typeof version === 'string') {
      try {
        version = new SemVer(version, this.options)
      } catch (er) {
        return false
      }
    }

    return cmp(version, this.operator, this.semver, this.options)
  }

  intersects (comp, options) {
    if (!(comp instanceof Comparator)) {
      throw new TypeError('a Comparator is required')
    }

    if (this.operator === '') {
      if (this.value === '') {
        return true
      }
      return new Range(comp.value, options).test(this.value)
    } else if (comp.operator === '') {
      if (comp.value === '') {
        return true
      }
      return new Range(this.value, options).test(comp.semver)
    }

    options = parseOptions(options)

    // Special cases where nothing can possibly be lower
    if (options.includePrerelease &&
      (this.value === '<0.0.0-0' || comp.value === '<0.0.0-0')) {
      return false
    }
    if (!options.includePrerelease &&
      (this.value.startsWith('<0.0.0') || comp.value.startsWith('<0.0.0'))) {
      return false
    }

    // Same direction increasing (> or >=)
    if (this.operator.startsWith('>') && comp.operator.startsWith('>')) {
      return true
    }
    // Same direction decreasing (< or <=)
    if (this.operator.startsWith('<') && comp.operator.startsWith('<')) {
      return true
    }
    // same SemVer and both sides are inclusive (<= or >=)
    if (
      (this.semver.version === comp.semver.version) &&
      this.operator.includes('=') && comp.operator.includes('=')) {
      return true
    }
    // opposite directions less than
    if (cmp(this.semver, '<', comp.semver, options) &&
      this.operator.startsWith('>') && comp.operator.startsWith('<')) {
      return true
    }
    // opposite directions greater than
    if (cmp(this.semver, '>', comp.semver, options) &&
      this.operator.startsWith('<') && comp.operator.startsWith('>')) {
      return true
    }
    return false
  }
}

module.exports = Comparator

const parseOptions = require('../internal/parse-options')
const { safeRe: re, t } = require('../internal/re')
const cmp = require('../functions/cmp')
const debug = require('../internal/debug')
const SemVer = require('./semver')
const Range = require('./range')
W/x p'use strict'

module.exports = {
  SemVer: require('./semver.js'),
  Range: require('./range.js'),
  Comparator: require('./comparator.js'),
}
1.ex='use strict'

const SPACE_CHARACTERS = /\s+/g

// hoisted class for cyclic dependency
class Range {
  constructor (range, options) {
    options = parseOptions(options)

    if (range instanceof Range) {
      if (
        range.loose === !!options.loose &&
        range.includePrerelease === !!options.includePrerelease
      ) {
        return range
      } else {
        return new Range(range.raw, options)
      }
    }

    if (range instanceof Comparator) {
      // just put it in the set and return
      this.raw = range.value
      this.set = [[range]]
      this.formatted = undefined
      return this
    }

    this.options = options
    this.loose = !!options.loose
    this.includePrerelease = !!options.includePrerelease

    // First reduce all whitespace as much as possible so we do not have to rely
    // on potentially slow regexes like \s*. This is then stored and used for
    // future error messages as well.
    this.raw = range.trim().replace(SPACE_CHARACTERS, ' ')

    // First, split on ||
    this.set = this.raw
      .split('||')
      // map the range to a 2d array of comparators
      .map(r => this.parseRange(r.trim()))
      // throw out any comparator lists that are empty
      // this generally means that it was not a valid range, which is allowed
      // in loose mode, but will still throw if the WHOLE range is invalid.
      .filter(c => c.length)

    if (!this.set.length) {
      throw new TypeError(`Invalid SemVer Range: ${this.raw}`)
    }

    // if we have any that are not the null set, throw out null sets.
    if (this.set.length > 1) {
      // keep the first one, in case they're all null sets
      const first = this.set[0]
      this.set = this.set.filter(c => !isNullSet(c[0]))
      if (this.set.length === 0) {
        this.set = [first]
      } else if (this.set.length > 1) {
        // if we have any that are *, then the range is just *
        for (const c of this.set) {
          if (c.length === 1 && isAny(c[0])) {
            this.set = [c]
            break
          }
        }
      }
    }

    this.formatted = undefined
  }

  get range () {
    if (this.formatted === undefined) {
      this.formatted = ''
      for (let i = 0; i < this.set.length; i++) {
        if (i > 0) {
          this.formatted += '||'
        }
        const comps = this.set[i]
        for (let k = 0; k < comps.length; k++) {
          if (k > 0) {
            this.formatted += ' '
          }
          this.formatted += comps[k].toString().trim()
        }
      }
    }
    return this.formatted
  }

  format () {
    return this.range
  }

  toString () {
    return this.range
  }

  parseRange (range) {
    // strip build metadata so it can't bleed into the version
    range = range.replace(BUILDSTRIPRE, '')

    // memoize range parsing for performance.
    // this is a very hot path, and fully deterministic.
    const memoOpts =
      (this.options.includePrerelease && FLAG_INCLUDE_PRERELEASE) |
      (this.options.loose && FLAG_LOOSE)
    const memoKey = memoOpts + ':' + range
    const cached = cache.get(memoKey)
    if (cached) {
      return cached
    }

    const loose = this.options.loose
    // `1.2.3 - 1.2.4` => `>=1.2.3 <=1.2.4`
    const hr = loose ? re[t.HYPHENRANGELOOSE] : re[t.HYPHENRANGE]
    range = range.replace(hr, hyphenReplace(this.options.includePrerelease))
    debug('hyphen replace', range)

    // `> 1.2.3 < 1.2.5` => `>1.2.3 <1.2.5`
    range = range.replace(re[t.COMPARATORTRIM], comparatorTrimReplace)
    debug('comparator trim', range)

    // `~ 1.2.3` => `~1.2.3`
    range = range.replace(re[t.TILDETRIM], tildeTrimReplace)
    debug('tilde trim', range)

    // `^ 1.2.3` => `^1.2.3`
    range = range.replace(re[t.CARETTRIM], caretTrimReplace)
    debug('caret trim', range)

    // At this point, the range is completely trimmed and
    // ready to be split into comparators.

    let rangeList = range
      .split(' ')
      .map(comp => parseComparator(comp, this.options))
      .join(' ')
      .split(/\s+/)
      // >=0.0.0 is equivalent to *
      .map(comp => replaceGTE0(comp, this.options))

    if (loose) {
      // in loose mode, throw out any that are not valid comparators
      rangeList = rangeList.filter(comp => {
        debug('loose invalid filter', comp, this.options)
        return !!comp.match(re[t.COMPARATORLOOSE])
      })
    }
    debug('range list', rangeList)

    // if any comparators are the null set, then replace with JUST null set
    // if more than one comparator, remove any * comparators
    // also, don't include the same comparator more than once
    const rangeMap = new Map()
    const comparators = rangeList.map(comp => new Comparator(comp, this.options))
    for (const comp of comparators) {
      if (isNullSet(comp)) {
        return [comp]
      }
      rangeMap.set(comp.value, comp)
    }
    if (rangeMap.size > 1 && rangeMap.has('')) {
      rangeMap.delete('')
    }

    const result = [...rangeMap.values()]
    cache.set(memoKey, result)
    return result
  }

  intersects (range, options) {
    if (!(range instanceof Range)) {
      throw new TypeError('a Range is required')
    }

    return this.set.some((thisComparators) => {
      return (
        isSatisfiable(thisComparators, options) &&
        range.set.some((rangeComparators) => {
          return (
            isSatisfiable(rangeComparators, options) &&
            thisComparators.every((thisComparator) => {
              return rangeComparators.every((rangeComparator) => {
                return thisComparator.intersects(rangeComparator, options)
              })
            })
          )
        })
      )
    })
  }

  // if ANY of the sets match ALL of its comparators, then pass
  test (version) {
    if (!version) {
      return false
    }

    if (typeof version === 'string') {
      try {
        version = new SemVer(version, this.options)
      } catch (er) {
        return false
      }
    }

    for (let i = 0; i < this.set.length; i++) {
      if (testSet(this.set[i], version, this.options)) {
        return true
      }
    }
    return false
  }
}

module.exports = Range

const LRU = require('../internal/lrucache')
const cache = new LRU()

const parseOptions = require('../internal/parse-options')
const Comparator = require('./comparator')
const debug = require('../internal/debug')
const SemVer = require('./semver')
const {
  safeRe: re,
  src,
  t,
  comparatorTrimReplace,
  tildeTrimReplace,
  caretTrimReplace,
} = require('../internal/re')
const { FLAG_INCLUDE_PRERELEASE, FLAG_LOOSE } = require('../internal/constants')

// unbounded global build-metadata stripper used by parseRange
const BUILDSTRIPRE = new RegExp(src[t.BUILD], 'g')

const isNullSet = c => c.value === '<0.0.0-0'
const isAny = c => c.value === ''

// take a set of comparators and determine whether there
// exists a version which can satisfy it
const isSatisfiable = (comparators, options) => {
  let result = true
  const remainingComparators = comparators.slice()
  let testComparator = remainingComparators.pop()

  while (result && remainingComparators.length) {
    result = remainingComparators.every((otherComparator) => {
      return testComparator.intersects(otherComparator, options)
    })

    testComparator = remainingComparators.pop()
  }

  return result
}

// comprised of xranges, tildes, stars, and gtlt's at this point.
// already replaced the hyphen ranges
// turn into a set of JUST comparators.
const parseComparator = (comp, options) => {
  comp = comp.replace(re[t.BUILD], '')
  debug('comp', comp, options)
  comp = replaceCarets(comp, options)
  debug('caret', comp)
  comp = replaceTildes(comp, options)
  debug('tildes', comp)
  comp = replaceXRanges(comp, options)
  debug('xrange', comp)
  comp = replaceStars(comp, options)
  debug('stars', comp)
  return comp
}

const isX = id => !id || id.toLowerCase() === 'x' || id === '*'

const invalidXRangeOrder = (M, m, p) => (
  (isX(M) && !isX(m)) ||
  (isX(m) && p && !isX(p))
)

// ~, ~> --> * (any, kinda silly)
// ~2, ~2.x, ~2.x.x, ~>2, ~>2.x ~>2.x.x --> >=2.0.0 <3.0.0-0
// ~2.0, ~2.0.x, ~>2.0, ~>2.0.x --> >=2.0.0 <2.1.0-0
// ~1.2, ~1.2.x, ~>1.2, ~>1.2.x --> >=1.2.0 <1.3.0-0
// ~1.2.3, ~>1.2.3 --> >=1.2.3 <1.3.0-0
// ~1.2.0, ~>1.2.0 --> >=1.2.0 <1.3.0-0
// ~0.0.1 --> >=0.0.1 <0.1.0-0
const replaceTildes = (comp, options) => {
  return comp
    .trim()
    .split(/\s+/)
    .map((c) => replaceTilde(c, options))
    .join(' ')
}

const replaceTilde = (comp, options) => {
  const r = options.loose ? re[t.TILDELOOSE] : re[t.TILDE]
  // if we're including prereleases in the match, then the lower bound is
  // -0, the lowest possible prerelease value, just like x-ranges and carets.
  // this keeps `~1.2` equivalent to the `1.2.x` x-range it's documented as.
  const z = options.includePrerelease ? '-0' : ''
  return comp.replace(r, (_, M, m, p, pr) => {
    debug('tilde', comp, _, M, m, p, pr)
    let ret

    if (isX(M)) {
      ret = ''
    } else if (isX(m)) {
      ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`
    } else if (isX(p)) {
      // ~1.2 == >=1.2.0 <1.3.0-0
      ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`
    } else if (pr) {
      debug('replaceTilde pr', pr)
      ret = `>=${M}.${m}.${p}-${pr
      } <${M}.${+m + 1}.0-0`
    } else {
      // ~1.2.3 == >=1.2.3 <1.3.0-0
      ret = `>=${M}.${m}.${p
      } <${M}.${+m + 1}.0-0`
    }

    debug('tilde return', ret)
    return ret
  })
}

// ^ --> * (any, kinda silly)
// ^2, ^2.x, ^2.x.x --> >=2.0.0 <3.0.0-0
// ^2.0, ^2.0.x --> >=2.0.0 <3.0.0-0
// ^1.2, ^1.2.x --> >=1.2.0 <2.0.0-0
// ^1.2.3 --> >=1.2.3 <2.0.0-0
// ^1.2.0 --> >=1.2.0 <2.0.0-0
// ^0.0.1 --> >=0.0.1 <0.0.2-0
// ^0.1.0 --> >=0.1.0 <0.2.0-0
const replaceCarets = (comp, options) => {
  return comp
    .trim()
    .split(/\s+/)
    .map((c) => replaceCaret(c, options))
    .join(' ')
}

const replaceCaret = (comp, options) => {
  debug('caret', comp, options)
  const r = options.loose ? re[t.CARETLOOSE] : re[t.CARET]
  const z = options.includePrerelease ? '-0' : ''
  return comp.replace(r, (_, M, m, p, pr) => {
    debug('caret', comp, _, M, m, p, pr)
    let ret

    if (isX(M)) {
      ret = ''
    } else if (isX(m)) {
      ret = `>=${M}.0.0${z} <${+M + 1}.0.0-0`
    } else if (isX(p)) {
      if (M === '0') {
        ret = `>=${M}.${m}.0${z} <${M}.${+m + 1}.0-0`
      } else {
        ret = `>=${M}.${m}.0${z} <${+M + 1}.0.0-0`
      }
    } else if (pr) {
      debug('replaceCaret pr', pr)
      if (M === '0') {
        if (m === '0') {
          ret = `>=${M}.${m}.${p}-${pr
          } <${M}.${m}.${+p + 1}-0`
        } else {
          ret = `>=${M}.${m}.${p}-${pr
          } <${M}.${+m + 1}.0-0`
        }
      } else {
        ret = `>=${M}.${m}.${p}-${pr
        } <${+M + 1}.0.0-0`
      }
    } else {
      debug('no pr')
      if (M === '0') {
        if (m === '0') {
          ret = `>=${M}.${m}.${p
          } <${M}.${m}.${+p + 1}-0`
        } else {
          ret = `>=${M}.${m}.${p
          } <${M}.${+m + 1}.0-0`
        }
      } else {
        ret = `>=${M}.${m}.${p
        } <${+M + 1}.0.0-0`
      }
    }

    debug('caret return', ret)
    return ret
  })
}

const replaceXRanges = (comp, options) => {
  debug('replaceXRanges', comp, options)
  return comp
    .split(/\s+/)
    .map((c) => replaceXRange(c, options))
    .join(' ')
}

const replaceXRange = (comp, options) => {
  comp = comp.trim()
  const r = options.loose ? re[t.XRANGELOOSE] : re[t.XRANGE]
  return comp.replace(r, (ret, gtlt, M, m, p, pr) => {
    debug('xRange', comp, ret, gtlt, M, m, p, pr)
    if (invalidXRangeOrder(M, m, p)) {
      return comp
    }

    const xM = isX(M)
    const xm = xM || isX(m)
    const xp = xm || isX(p)
    const anyX = xp

    if (gtlt === '=' && anyX) {
      gtlt = ''
    }

    // if we're including prereleases in the match, then we need
    // to fix this to -0, the lowest possible prerelease value
    pr = options.includePrerelease ? '-0' : ''

    if (xM) {
      if (gtlt === '>' || gtlt === '<') {
        // nothing is allowed
        ret = '<0.0.0-0'
      } else {
        // nothing is forbidden
        ret = '*'
      }
    } else if (gtlt && anyX) {
      // we know patch is an x, because we have any x at all.
      // replace X with 0
      if (xm) {
        m = 0
      }
      p = 0

      if (gtlt === '>') {
        // >1 => >=2.0.0
        // >1.2 => >=1.3.0
        gtlt = '>='
        if (xm) {
          M = +M + 1
          m = 0
          p = 0
        } else {
          m = +m + 1
          p = 0
        }
      } else if (gtlt === '<=') {
        // <=0.7.x is actually <0.8.0, since any 0.7.x should
        // pass.  Similarly, <=7.x is actually <8.0.0, etc.
        gtlt = '<'
        if (xm) {
          M = +M + 1
        } else {
          m = +m + 1
        }
      }

      if (gtlt === '<') {
        pr = '-0'
      }

      ret = `${gtlt + M}.${m}.${p}${pr}`
    } else if (xm) {
      ret = `>=${M}.0.0${pr} <${+M + 1}.0.0-0`
    } else if (xp) {
      ret = `>=${M}.${m}.0${pr
      } <${M}.${+m + 1}.0-0`
    }

    debug('xRange return', ret)

    return ret
  })
}

// Because * is AND-ed with everything else in the comparator,
// and '' means "any version", just remove the *s entirely.
const replaceStars = (comp, options) => {
  debug('replaceStars', comp, options)
  // Looseness is ignored here.  star is always as loose as it gets!
  return comp
    .trim()
    .replace(re[t.STAR], '')
}

const replaceGTE0 = (comp, options) => {
  debug('replaceGTE0', comp, options)
  return comp
    .trim()
    .replace(re[options.includePrerelease ? t.GTE0PRE : t.GTE0], '')
}

// This function is passed to string.replace(re[t.HYPHENRANGE])
// M, m, patch, prerelease, build
// 1.2 - 3.4.5 => >=1.2.0 <=3.4.5
// 1.2.3 - 3.4 => >=1.2.0 <3.5.0-0 Any 3.4.x will do
// 1.2 - 3.4 => >=1.2.0 <3.5.0-0
// TODO build?
const hyphenReplace = incPr => ($0,
  from, fM, fm, fp, fpr, fb,
  to, tM, tm, tp, tpr) => {
  if (isX(fM)) {
    from = ''
  } else if (isX(fm)) {
    from = `>=${fM}.0.0${incPr ? '-0' : ''}`
  } else if (isX(fp)) {
    from = `>=${fM}.${fm}.0${incPr ? '-0' : ''}`
  } else if (fpr) {
    from = `>=${from}`
  } else {
    from = `>=${from}${incPr ? '-0' : ''}`
  }

  if (isX(tM)) {
    to = ''
  } else if (isX(tm)) {
    to = `<${+tM + 1}.0.0-0`
  } else if (isX(tp)) {
    to = `<${tM}.${+tm + 1}.0-0`
  } else if (tpr) {
    to = `<=${tM}.${tm}.${tp}-${tpr}`
  } else if (incPr) {
    to = `<${tM}.${tm}.${+tp + 1}-0`
  } else {
    to = `<=${to}`
  }

  return `${from} ${to}`.trim()
}

const testSet = (set, version, options) => {
  for (let i = 0; i < set.length; i++) {
    if (!set[i].test(version)) {
      return false
    }
  }

  if (version.prerelease.length && !options.includePrerelease) {
    // Find the set of versions that are allowed to have prereleases
    // For example, ^1.2.3-pr.1 desugars to >=1.2.3-pr.1 <2.0.0
    // That should allow `1.2.3-pr.2` to pass.
    // However, `1.2.4-alpha.notready` should NOT be allowed,
    // even though it's within the range set by the comparators.
    for (let i = 0; i < set.length; i++) {
      debug(set[i].semver)
      if (set[i].semver === Comparator.ANY) {
        continue
      }

      if (set[i].semver.prerelease.length > 0) {
        const allowed = set[i].semver
        if (allowed.major === version.major &&
            allowed.minor === version.minor &&
            allowed.patch === version.patch) {
          return true
        }
      }
    }

    // Version has a -pre, but it's not one of the ones we like.
    return false
  }

  return true
}
쭒x&\'use strict'

const debug = require('../internal/debug')
const { MAX_LENGTH, MAX_SAFE_INTEGER } = require('../internal/constants')
const { safeRe: re, t } = require('../internal/re')

const parseOptions = require('../internal/parse-options')
const { compareIdentifiers } = require('../internal/identifiers')

const isPrereleaseIdentifier = (prerelease, identifier) => {
  const identifiers = identifier.split('.')
  if (identifiers.length > prerelease.length) {
    return false
  }

  for (let i = 0; i < identifiers.length; i++) {
    if (compareIdentifiers(prerelease[i], identifiers[i]) !== 0) {
      return false
    }
  }

  return true
}

class SemVer {
  constructor (version, options) {
    options = parseOptions(options)

    if (version instanceof SemVer) {
      if (version.loose === !!options.loose &&
        version.includePrerelease === !!options.includePrerelease) {
        return version
      } else {
        version = version.version
      }
    } else if (typeof version !== 'string') {
      throw new TypeError(`Invalid version. Must be a string. Got type "${typeof version}".`)
    }

    if (version.length > MAX_LENGTH) {
      throw new TypeError(
        `version is longer than ${MAX_LENGTH} characters`
      )
    }

    debug('SemVer', version, options)
    this.options = options
    this.loose = !!options.loose
    // this isn't actually relevant for versions, but keep it so that we
    // don't run into trouble passing this.options around.
    this.includePrerelease = !!options.includePrerelease

    const m = version.trim().match(options.loose ? re[t.LOOSE] : re[t.FULL])

    if (!m) {
      throw new TypeError(`Invalid Version: ${version}`)
    }

    this.raw = version

    // these are actually numbers
    this.major = +m[1]
    this.minor = +m[2]
    this.patch = +m[3]

    if (this.major > MAX_SAFE_INTEGER || this.major < 0) {
      throw new TypeError('Invalid major version')
    }

    if (this.minor > MAX_SAFE_INTEGER || this.minor < 0) {
      throw new TypeError('Invalid minor version')
    }

    if (this.patch > MAX_SAFE_INTEGER || this.patch < 0) {
      throw new TypeError('Invalid patch version')
    }

    // numberify any prerelease numeric ids
    if (!m[4]) {
      this.prerelease = []
    } else {
      this.prerelease = m[4].split('.').map((id) => {
        if (/^[0-9]+$/.test(id)) {
          const num = +id
          if (num >= 0 && num < MAX_SAFE_INTEGER) {
            return num
          }
        }
        return id
      })
    }

    this.build = m[5] ? m[5].split('.') : []
    this.format()
  }

  format () {
    this.version = `${this.major}.${this.minor}.${this.patch}`
    if (this.prerelease.length) {
      this.version += `-${this.prerelease.join('.')}`
    }
    return this.version
  }

  toString () {
    return this.version
  }

  compare (other) {
    debug('SemVer.compare', this.version, this.options, other)
    if (!(other instanceof SemVer)) {
      if (typeof other === 'string' && other === this.version) {
        return 0
      }
      other = new SemVer(other, this.options)
    }

    if (other.version === this.version) {
      return 0
    }

    return this.compareMain(other) || this.comparePre(other)
  }

  compareMain (other) {
    if (!(other instanceof SemVer)) {
      other = new SemVer(other, this.options)
    }

    if (this.major < other.major) {
      return -1
    }
    if (this.major > other.major) {
      return 1
    }
    if (this.minor < other.minor) {
      return -1
    }
    if (this.minor > other.minor) {
      return 1
    }
    if (this.patch < other.patch) {
      return -1
    }
    if (this.patch > other.patch) {
      return 1
    }
    return 0
  }

  comparePre (other) {
    if (!(other instanceof SemVer)) {
      other = new SemVer(other, this.options)
    }

    // NOT having a prerelease is > having one
    if (this.prerelease.length && !other.prerelease.length) {
      return -1
    } else if (!this.prerelease.length && other.prerelease.length) {
      return 1
    } else if (!this.prerelease.length && !other.prerelease.length) {
      return 0
    }

    let i = 0
    do {
      const a = this.prerelease[i]
      const b = other.prerelease[i]
      debug('prerelease compare', i, a, b)
      if (a === undefined && b === undefined) {
        return 0
      } else if (b === undefined) {
        return 1
      } else if (a === undefined) {
        return -1
      } else if (a === b) {
        continue
      } else {
        return compareIdentifiers(a, b)
      }
    } while (++i)
  }

  compareBuild (other) {
    if (!(other instanceof SemVer)) {
      other = new SemVer(other, this.options)
    }

    let i = 0
    do {
      const a = this.build[i]
      const b = other.build[i]
      debug('build compare', i, a, b)
      if (a === undefined && b === undefined) {
        return 0
      } else if (b === undefined) {
        return 1
      } else if (a === undefined) {
        return -1
      } else if (a === b) {
        continue
      } else {
        return compareIdentifiers(a, b)
      }
    } while (++i)
  }

  // preminor will bump the version up to the next minor release, and immediately
  // down to pre-release. premajor and prepatch work the same way.
  inc (release, identifier, identifierBase) {
    if (release.startsWith('pre')) {
      if (!identifier && identifierBase === false) {
        throw new Error('invalid increment argument: identifier is empty')
      }
      // Avoid an invalid semver results
      if (identifier) {
        const match = `-${identifier}`.match(this.options.loose ? re[t.PRERELEASELOOSE] : re[t.PRERELEASE])
        if (!match || match[1] !== identifier) {
          throw new Error(`invalid identifier: ${identifier}`)
        }
      }
    }

    switch (release) {
      case 'premajor':
        this.prerelease.length = 0
        this.patch = 0
        this.minor = 0
        this.major++
        this.inc('pre', identifier, identifierBase)
        break
      case 'preminor':
        this.prerelease.length = 0
        this.patch = 0
        this.minor++
        this.inc('pre', identifier, identifierBase)
        break
      case 'prepatch':
        // If this is already a prerelease, it will bump to the next version
        // drop any prereleases that might already exist, since they are not
        // relevant at this point.
        this.prerelease.length = 0
        this.inc('patch', identifier, identifierBase)
        this.inc('pre', identifier, identifierBase)
        break
      // If the input is a non-prerelease version, this acts the same as
      // prepatch.
      case 'prerelease':
        if (this.prerelease.length === 0) {
          this.inc('patch', identifier, identifierBase)
        }
        this.inc('pre', identifier, identifierBase)
        break
      case 'release':
        if (this.prerelease.length === 0) {
          throw new Error(`version ${this.raw} is not a prerelease`)
        }
        this.prerelease.length = 0
        break

      case 'major':
        // If this is a pre-major version, bump up to the same major version.
        // Otherwise increment major.
        // 1.0.0-5 bumps to 1.0.0
        // 1.1.0 bumps to 2.0.0
        if (
          this.minor !== 0 ||
          this.patch !== 0 ||
          this.prerelease.length === 0
        ) {
          this.major++
        }
        this.minor = 0
        this.patch = 0
        this.prerelease = []
        break
      case 'minor':
        // If this is a pre-minor version, bump up to the same minor version.
        // Otherwise increment minor.
        // 1.2.0-5 bumps to 1.2.0
        // 1.2.1 bumps to 1.3.0
        if (this.patch !== 0 || this.prerelease.length === 0) {
          this.minor++
        }
        this.patch = 0
        this.prerelease = []
        break
      case 'patch':
        // If this is not a pre-release version, it will increment the patch.
        // If it is a pre-release it will bump up to the same patch version.
        // 1.2.0-5 patches to 1.2.0
        // 1.2.0 patches to 1.2.1
        if (this.prerelease.length === 0) {
          this.patch++
        }
        this.prerelease = []
        break
      // This probably shouldn't be used publicly.
      // 1.0.0 'pre' would become 1.0.0-0 which is the wrong direction.
      case 'pre': {
        const base = Number(identifierBase) ? 1 : 0

        if (this.prerelease.length === 0) {
          this.prerelease = [base]
        } else {
          let i = this.prerelease.length
          while (--i >= 0) {
            if (typeof this.prerelease[i] === 'number') {
              this.prerelease[i]++
              i = -2
            }
          }
          if (i === -1) {
            // didn't increment anything
            if (identifier === this.prerelease.join('.') && identifierBase === false) {
              throw new Error('invalid increment argument: identifier already exists')
            }
            this.prerelease.push(base)
          }
        }
        if (identifier) {
          // 1.2.0-beta.1 bumps to 1.2.0-beta.2,
          // 1.2.0-beta.fooblz or 1.2.0-beta bumps to 1.2.0-beta.0
          let prerelease = [identifier, base]
          if (identifierBase === false) {
            prerelease = [identifier]
          }
          if (isPrereleaseIdentifier(this.prerelease, identifier)) {
            const prereleaseBase = this.prerelease[identifier.split('.').length]
            if (isNaN(prereleaseBase)) {
              this.prerelease = prerelease
            }
          } else {
            this.prerelease = prerelease
          }
        }
        break
      }
      default:
        throw new Error(`invalid increment argument: ${release}`)
    }
    this.raw = this.format()
    if (this.build.length) {
      this.raw += `+${this.build.join('.')}`
    }
    return this
  }
}

module.exports = SemVer
e_9xn100644 clean.js yp=ca~I8LG55100644 cmp.js wH}ʬ_P**T{M100644 coerce.js 'YZXxܝ100644 compare-build.js |prV$u86⤊100644 compare-loose.js u1cFtD/E֗*H100644 compare.js c	bl {\"Q100644 diff.js ɚqi]۲o3ŉm100644 eq.js _a+igK100644 gt.js }
	D80OP100644 gte.js |RR*{ы(100644 inc.js :rV!#5PE100644 lt.js /*cɡ@:5l<u100644 lte.js ڞ@NZ
[`ESM100644 major.js ЍNGb7^64R100644 minor.js p":-(Q	.wn100644 neq.js 2kw3a^Ri7100644 parse.js D:~ˎd6f9=QWY100644 patch.js vu/BP8Jt100644 prerelease.js #re2}]e100644 rcompare.js "+/$:R7X<'100644 rsort.js ]= 	hDyVuN100644 satisfies.js &J"*-rqUq`100644 sort.js K2Mi8A =H100644 truncate.js "xȔ6100644 valid.js ~ܵ*V4	Neugx 2'use strict'

const parse = require('./parse')
const clean = (version, options) => {
  const s = parse(version.trim().replace(/^[=v]+/, ''), options)
  return s ? s.version : null
}
module.exports = clean
C_C<x>'use strict'

const eq = require('./eq')
const neq = require('./neq')
const gt = require('./gt')
const gte = require('./gte')
const lt = require('./lt')
const lte = require('./lte')

const cmp = (a, op, b, loose) => {
  switch (op) {
    case '===':
      if (typeof a === 'object') {
        a = a.version
      }
      if (typeof b === 'object') {
        b = b.version
      }
      return a === b

    case '!==':
      if (typeof a === 'object') {
        a = a.version
      }
      if (typeof b === 'object') {
        b = b.version
      }
      return a !== b

    case '':
    case '=':
    case '==':
      return eq(a, b, loose)

    case '!=':
      return neq(a, b, loose)

    case '>':
      return gt(a, b, loose)

    case '>=':
      return gte(a, b, loose)

    case '<':
      return lt(a, b, loose)

    case '<=':
      return lte(a, b, loose)

    default:
      throw new TypeError(`Invalid operator: ${op}`)
  }
}
module.exports = cmp
ZY}x+'use strict'

const SemVer = require('../classes/semver')
const parse = require('./parse')
const { safeRe: re, t } = require('../internal/re')

const coerce = (version, options) => {
  if (version instanceof SemVer) {
    return version
  }

  if (typeof version === 'number') {
    version = String(version)
  }

  if (typeof version !== 'string') {
    return null
  }

  options = options || {}

  let match = null
  if (!options.rtl) {
    match = version.match(options.includePrerelease ? re[t.COERCEFULL] : re[t.COERCE])
  } else {
    // Find the right-most coercible string that does not share
    // a terminus with a more left-ward coercible string.
    // Eg, '1.2.3.4' wants to coerce '2.3.4', not '3.4' or '4'
    // With includePrerelease option set, '1.2.3.4-rc' wants to coerce '2.3.4-rc', not '2.3.4'
    //
    // Walk through the string checking with a /g regexp
    // Manually set the index so as to pick up overlapping matches.
    // Stop when we get a match that ends at the string end, since no
    // coercible string can be more right-ward without the same terminus.
    const coerceRtlRegex = options.includePrerelease ? re[t.COERCERTLFULL] : re[t.COERCERTL]
    let next
    while ((next = coerceRtlRegex.exec(version)) &&
        (!match || match.index + match[0].length !== version.length)
    ) {
      if (!match ||
            next.index + next[0].length !== match.index + match[0].length) {
        match = next
      }
      coerceRtlRegex.lastIndex = next.index + next[1].length + next[2].length
    }
    // leave it in a clean state
    coerceRtlRegex.lastIndex = -1
  }

  if (match === null) {
    return null
  }

  const major = match[2]
  const minor = match[3] || '0'
  const patch = match[4] || '0'
  const prerelease = options.includePrerelease && match[5] ? `-${match[5]}` : ''
  const build = options.includePrerelease && match[6] ? `+${match[6]}` : ''

  return parse(`${major}.${minor}.${patch}${prerelease}${build}`, options)
}
module.exports = coerce
0+}yx'use strict'

const SemVer = require('../classes/semver')
const compareBuild = (a, b, loose) => {
  const versionA = new SemVer(a, loose)
  const versionB = new SemVer(b, loose)
  return versionA.compare(versionB) || versionA.compareBuild(versionB)
}
module.exports = compareBuild
`6x {'use strict'

const compare = require('./compare')
const compareLoose = (a, b) => compare(a, b, true)
module.exports = compareLoose
,\
x U'use strict'

const SemVer = require('../classes/semver')
const compare = (a, b, loose) =>
  new SemVer(a, loose).compare(new SemVer(b, loose))

module.exports = compare
8'Xxp'use strict'

const parse = require('./parse.js')

const diff = (version1, version2) => {
  const v1 = parse(version1, null, true)
  const v2 = parse(version2, null, true)
  const comparison = v1.compare(v2)

  if (comparison === 0) {
    return null
  }

  const v1Higher = comparison > 0
  const highVersion = v1Higher ? v1 : v2
  const lowVersion = v1Higher ? v2 : v1
  const highHasPre = !!highVersion.prerelease.length
  const lowHasPre = !!lowVersion.prerelease.length

  if (lowHasPre && !highHasPre) {
    // Going from prerelease -> no prerelease requires some special casing

    // If the low version has only a major, then it will always be a major
    // Some examples:
    // 1.0.0-1 -> 1.0.0
    // 1.0.0-1 -> 1.1.1
    // 1.0.0-1 -> 2.0.0
    if (!lowVersion.patch && !lowVersion.minor) {
      return 'major'
    }

    // If the main part has no difference
    if (lowVersion.compareMain(highVersion) === 0) {
      if (lowVersion.minor && !lowVersion.patch) {
        return 'minor'
      }
      return 'patch'
    }
  }

  // add the `pre` prefix if we are going to a prerelease version
  const prefix = highHasPre ? 'pre' : ''

  if (v1.major !== v2.major) {
    return prefix + 'major'
  }

  if (v1.minor !== v2.minor) {
    return prefix + 'minor'
  }

  if (v1.patch !== v2.patch) {
    return prefix + 'patch'
  }

  // high and low are prereleases
  return 'prerelease'
}

module.exports = diff
ѴJx~ 'use strict'

const compare = require('./compare')
const eq = (a, b, loose) => compare(a, b, loose) === 0
module.exports = eq
-(-x| 'use strict'

const compare = require('./compare')
const gt = (a, b, loose) => compare(a, b, loose) > 0
module.exports = gt
Q'x 'use strict'

const compare = require('./compare')
const gte = (a, b, loose) => compare(a, b, loose) >= 0
module.exports = gte
` (žx!'use strict'

const SemVer = require('../classes/semver')

const inc = (version, release, options, identifier, identifierBase) => {
  if (typeof (options) === 'string') {
    identifierBase = identifier
    identifier = options
    options = undefined
  }

  try {
    return new SemVer(
      version instanceof SemVer ? version.version : version,
      options
    ).inc(release, identifier, identifierBase).version
  } catch (er) {
    return null
  }
}
module.exports = inc
;Bx| 'use strict'

const compare = require('./compare')
const lt = (a, b, loose) => compare(a, b, loose) < 0
module.exports = lt
'ƿx 'use strict'

const compare = require('./compare')
const lte = (a, b, loose) => compare(a, b, loose) <= 0
module.exports = lte
a>(͸x w'use strict'

const SemVer = require('../classes/semver')
const major = (a, loose) => new SemVer(a, loose).major
module.exports = major
){-x w'use strict'

const SemVer = require('../classes/semver')
const minor = (a, loose) => new SemVer(a, loose).minor
module.exports = minor
.O-Ѱx 'use strict'

const compare = require('./compare')
const neq = (a, b, loose) => compare(a, b, loose) !== 0
module.exports = neq
(xK'use strict'

const SemVer = require('../classes/semver')
const parse = (version, options, throwErrors = false) => {
  if (version instanceof SemVer) {
    return version
  }
  try {
    return new SemVer(version, options)
  } catch (er) {
    if (!throwErrors) {
      return null
    }
    throw er
  }
}

module.exports = parse
jqx w'use strict'

const SemVer = require('../classes/semver')
const patch = (a, loose) => new SemVer(a, loose).patch
module.exports = patch
&`-x 'use strict'

const parse = require('./parse')
const prerelease = (version, options) => {
  const parsed = parse(version, options)
  return (parsed && parsed.prerelease.length) ? parsed.prerelease : null
}
module.exports = prerelease
jQx {'use strict'

const compare = require('./compare')
const rcompare = (a, b, loose) => compare(b, a, loose)
module.exports = rcompare
q,
x \'use strict'

const compareBuild = require('./compare-build')
const rsort = (list, loose) => list.sort((a, b) => compareBuild(b, a, loose))
module.exports = rsort
6x 'use strict'

const Range = require('../classes/range')
const satisfies = (version, range, options) => {
  try {
    range = new Range(range, options)
  } catch (er) {
    return false
  }
  return range.test(version)
}
module.exports = satisfies
RQ
x ^'use strict'

const compareBuild = require('./compare-build')
const sort = (list, loose) => list.sort((a, b) => compareBuild(a, b, loose))
module.exports = sort
85ҽ?x'use strict'

const parse = require('./parse')
const constants = require('../internal/constants')
const SemVer = require('../classes/semver')

const truncate = (version, truncation, options) => {
  if (!constants.RELEASE_TYPES.includes(truncation)) {
    return null
  }

  const clonedVersion = cloneInputVersion(version, options)
  return clonedVersion && doTruncation(clonedVersion, truncation)
}

const cloneInputVersion = (version, options) => {
  const versionStringToParse = (
    version instanceof SemVer ? version.version : version
  )

  return parse(versionStringToParse, options)
}

const doTruncation = (version, truncation) => {
  if (isPrerelease(truncation)) {
    return version.version
  }

  version.prerelease = []

  switch (truncation) {
    case 'major':
      version.minor = 0
      version.patch = 0
      break
    case 'minor':
      version.patch = 0
      break
  }

  return version.format()
}

const isPrerelease = (type) => {
  return type.startsWith('pre')
}

module.exports = truncate
Tx O'use strict'

const parse = require('./parse')
const valid = (version, options) => {
  const v = parse(version, options)
  return v ? v.version : null
}
module.exports = valid
_;<x
|'use strict'

// just pre-load all the stuff that index.js lazily exports
const internalRe = require('./internal/re')
const constants = require('./internal/constants')
const SemVer = require('./classes/semver')
const identifiers = require('./internal/identifiers')
const parse = require('./functions/parse')
const valid = require('./functions/valid')
const clean = require('./functions/clean')
const inc = require('./functions/inc')
const diff = require('./functions/diff')
const major = require('./functions/major')
const minor = require('./functions/minor')
const patch = require('./functions/patch')
const prerelease = require('./functions/prerelease')
const compare = require('./functions/compare')
const rcompare = require('./functions/rcompare')
const compareLoose = require('./functions/compare-loose')
const compareBuild = require('./functions/compare-build')
const sort = require('./functions/sort')
const rsort = require('./functions/rsort')
const gt = require('./functions/gt')
const lt = require('./functions/lt')
const eq = require('./functions/eq')
const neq = require('./functions/neq')
const gte = require('./functions/gte')
const lte = require('./functions/lte')
const cmp = require('./functions/cmp')
const coerce = require('./functions/coerce')
const truncate = require('./functions/truncate')
const Comparator = require('./classes/comparator')
const Range = require('./classes/range')
const satisfies = require('./functions/satisfies')
const toComparators = require('./ranges/to-comparators')
const maxSatisfying = require('./ranges/max-satisfying')
const minSatisfying = require('./ranges/min-satisfying')
const minVersion = require('./ranges/min-version')
const validRange = require('./ranges/valid')
const outside = require('./ranges/outside')
const gtr = require('./ranges/gtr')
const ltr = require('./ranges/ltr')
const intersects = require('./ranges/intersects')
const simplifyRange = require('./ranges/simplify')
const subset = require('./ranges/subset')
module.exports = {
  parse,
  valid,
  clean,
  inc,
  diff,
  major,
  minor,
  patch,
  prerelease,
  compare,
  rcompare,
  compareLoose,
  compareBuild,
  sort,
  rsort,
  gt,
  lt,
  eq,
  neq,
  gte,
  lte,
  cmp,
  coerce,
  truncate,
  Comparator,
  Range,
  satisfies,
  toComparators,
  maxSatisfying,
  minSatisfying,
  minVersion,
  validRange,
  outside,
  gtr,
  ltr,
  intersects,
  simplifyRange,
  subset,
  SemVer,
  re: internalRe.re,
  src: internalRe.src,
  tokens: internalRe.t,
  SEMVER_SPEC_VERSION: constants.SEMVER_SPEC_VERSION,
  RELEASE_TYPES: constants.RELEASE_TYPES,
  compareIdentifiers: identifiers.compareIdentifiers,
  rcompareIdentifiers: identifiers.rcompareIdentifiers,
}
ix 100644 constants.js mC1ݠC+kå100644 debug.js  s 4FqԀr100644 identifiers.js SG-Ջ<Y>:# 100644 lrucache.js RbP\Kpؘ׉100644 parse-options.js REA0!KEraZ100644 re.js .,-2^a ;"^6xi'use strict'

// Note: this is the semver.org version of the spec that it implements
// Not necessarily the package version of this code.
const SEMVER_SPEC_VERSION = '2.0.0'

const MAX_LENGTH = 256
const MAX_SAFE_INTEGER = Number.MAX_SAFE_INTEGER ||
/* istanbul ignore next */ 9007199254740991

// Max safe segment length for coercion.
const MAX_SAFE_COMPONENT_LENGTH = 16

// Max safe length for a build identifier. The max length minus 6 characters for
// the shortest version with a build 0.0.0+BUILD.
const MAX_SAFE_BUILD_LENGTH = MAX_LENGTH - 6

const RELEASE_TYPES = [
  'major',
  'premajor',
  'minor',
  'preminor',
  'patch',
  'prepatch',
  'prerelease',
]

module.exports = {
  MAX_LENGTH,
  MAX_SAFE_COMPONENT_LENGTH,
  MAX_SAFE_BUILD_LENGTH,
  MAX_SAFE_INTEGER,
  RELEASE_TYPES,
  SEMVER_SPEC_VERSION,
  FLAG_INCLUDE_PRERELEASE: 0b001,
  FLAG_LOOSE: 0b010,
}
x 'use strict'

const debug = (
  typeof process === 'object' &&
  process.env &&
  process.env.NODE_DEBUG &&
  /\bsemver\b/i.test(process.env.NODE_DEBUG)
) ? (...args) => console.error('SEMVER', ...args)
  : () => {}

module.exports = debug
I+ x'use strict'

const numeric = /^[0-9]+$/
const compareIdentifiers = (a, b) => {
  if (typeof a === 'number' && typeof b === 'number') {
    return a === b ? 0 : a < b ? -1 : 1
  }

  const anum = numeric.test(a)
  const bnum = numeric.test(b)

  if (anum && bnum) {
    a = +a
    b = +b
  }

  return a === b ? 0
    : (anum && !bnum) ? -1
    : (bnum && !anum) ? 1
    : a < b ? -1
    : 1
}

const rcompareIdentifiers = (a, b) => compareIdentifiers(b, a)

module.exports = {
  compareIdentifiers,
  rcompareIdentifiers,
}
B2x"'use strict'

class LRUCache {
  constructor () {
    this.max = 1000
    this.map = new Map()
  }

  get (key) {
    const value = this.map.get(key)
    if (value === undefined) {
      return undefined
    } else {
      // Remove the key from the map and add it to the end
      this.map.delete(key)
      this.map.set(key, value)
      return value
    }
  }

  delete (key) {
    return this.map.delete(key)
  }

  set (key, value) {
    const deleted = this.delete(key)

    if (!deleted && value !== undefined) {
      // If cache is full, delete the least recently used item
      if (this.map.size >= this.max) {
        const firstKey = this.map.keys().next().value
        this.delete(firstKey)
      }

      this.map.set(key, value)
    }

    return this
  }
}

module.exports = LRUCache
xR'use strict'

// parse out just the options we care about
const looseOption = Object.freeze({ loose: true })
const emptyOpts = Object.freeze({ })
const parseOptions = options => {
  if (!options) {
    return emptyOpts
  }

  if (typeof options !== 'object') {
    return looseOption
  }

  return options
}
module.exports = parseOptions
¯rx4'use strict'

const {
  MAX_SAFE_COMPONENT_LENGTH,
  MAX_SAFE_BUILD_LENGTH,
  MAX_LENGTH,
} = require('./constants')
const debug = require('./debug')
exports = module.exports = {}

// The actual regexps go on exports.re
const re = exports.re = []
const safeRe = exports.safeRe = []
const src = exports.src = []
const safeSrc = exports.safeSrc = []
const t = exports.t = {}
let R = 0

const LETTERDASHNUMBER = '[a-zA-Z0-9-]'

// Replace some greedy regex tokens to prevent regex dos issues. These regex are
// used internally via the safeRe object since all inputs in this library get
// normalized first to trim and collapse all extra whitespace. The original
// regexes are exported for userland consumption and lower level usage. A
// future breaking change could export the safer regex only with a note that
// all input should have extra whitespace removed.
const safeRegexReplacements = [
  ['\\s', 1],
  ['\\d', MAX_LENGTH],
  [LETTERDASHNUMBER, MAX_SAFE_BUILD_LENGTH],
]

const makeSafeRegex = (value) => {
  for (const [token, max] of safeRegexReplacements) {
    value = value
      .split(`${token}*`).join(`${token}{0,${max}}`)
      .split(`${token}+`).join(`${token}{1,${max}}`)
  }
  return value
}

const createToken = (name, value, isGlobal) => {
  const safe = makeSafeRegex(value)
  const index = R++
  debug(name, index, value)
  t[name] = index
  src[index] = value
  safeSrc[index] = safe
  re[index] = new RegExp(value, isGlobal ? 'g' : undefined)
  safeRe[index] = new RegExp(safe, isGlobal ? 'g' : undefined)
}

// The following Regular Expressions can be used for tokenizing,
// validating, and parsing SemVer version strings.

// ## Numeric Identifier
// A single `0`, or a non-zero digit followed by zero or more digits.

createToken('NUMERICIDENTIFIER', '0|[1-9]\\d*')
createToken('NUMERICIDENTIFIERLOOSE', '\\d+')

// ## Non-numeric Identifier
// Zero or more digits, followed by a letter or hyphen, and then zero or
// more letters, digits, or hyphens.

createToken('NONNUMERICIDENTIFIER', `\\d*[a-zA-Z-]${LETTERDASHNUMBER}*`)

// ## Main Version
// Three dot-separated numeric identifiers.

createToken('MAINVERSION', `(${src[t.NUMERICIDENTIFIER]})\\.` +
                   `(${src[t.NUMERICIDENTIFIER]})\\.` +
                   `(${src[t.NUMERICIDENTIFIER]})`)

createToken('MAINVERSIONLOOSE', `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
                        `(${src[t.NUMERICIDENTIFIERLOOSE]})\\.` +
                        `(${src[t.NUMERICIDENTIFIERLOOSE]})`)

// ## Pre-release Version Identifier
// A numeric identifier, or a non-numeric identifier.
// Non-numeric identifiers include numeric identifiers but can be longer.
// Therefore non-numeric identifiers must go first.

createToken('PRERELEASEIDENTIFIER', `(?:${src[t.NONNUMERICIDENTIFIER]
}|${src[t.NUMERICIDENTIFIER]})`)

createToken('PRERELEASEIDENTIFIERLOOSE', `(?:${src[t.NONNUMERICIDENTIFIER]
}|${src[t.NUMERICIDENTIFIERLOOSE]})`)

// ## Pre-release Version
// Hyphen, followed by one or more dot-separated pre-release version
// identifiers.

createToken('PRERELEASE', `(?:-(${src[t.PRERELEASEIDENTIFIER]
}(?:\\.${src[t.PRERELEASEIDENTIFIER]})*))`)

createToken('PRERELEASELOOSE', `(?:-?(${src[t.PRERELEASEIDENTIFIERLOOSE]
}(?:\\.${src[t.PRERELEASEIDENTIFIERLOOSE]})*))`)

// ## Build Metadata Identifier
// Any combination of digits, letters, or hyphens.

createToken('BUILDIDENTIFIER', `${LETTERDASHNUMBER}+`)

// ## Build Metadata
// Plus sign, followed by one or more period-separated build metadata
// identifiers.

createToken('BUILD', `(?:\\+(${src[t.BUILDIDENTIFIER]
}(?:\\.${src[t.BUILDIDENTIFIER]})*))`)

// ## Full Version String
// A main version, followed optionally by a pre-release version and
// build metadata.

// Note that the only major, minor, patch, and pre-release sections of
// the version string are capturing groups.  The build metadata is not a
// capturing group, because it should not ever be used in version
// comparison.

createToken('FULLPLAIN', `v?${src[t.MAINVERSION]
}${src[t.PRERELEASE]}?${
  src[t.BUILD]}?`)

createToken('FULL', `^${src[t.FULLPLAIN]}$`)

// like full, but allows v1.2.3 and =1.2.3, which people do sometimes.
// also, 1.0.0alpha1 (prerelease without the hyphen) which is pretty
// common in the npm registry.
createToken('LOOSEPLAIN', `[v=\\s]*${src[t.MAINVERSIONLOOSE]
}${src[t.PRERELEASELOOSE]}?${
  src[t.BUILD]}?`)

createToken('LOOSE', `^${src[t.LOOSEPLAIN]}$`)

createToken('GTLT', '((?:<|>)?=?)')

// Something like "2.*" or "1.2.x".
// Note that "x.x" is a valid xRange identifier, meaning "any version"
// Only the first item is strictly required.
createToken('XRANGEIDENTIFIERLOOSE', `${src[t.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`)
createToken('XRANGEIDENTIFIER', `${src[t.NUMERICIDENTIFIER]}|x|X|\\*`)

createToken('XRANGEPLAIN', `[v=\\s]*(${src[t.XRANGEIDENTIFIER]})` +
                   `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
                   `(?:\\.(${src[t.XRANGEIDENTIFIER]})` +
                   `(?:${src[t.PRERELEASE]})?${
                     src[t.BUILD]}?` +
                   `)?)?`)

createToken('XRANGEPLAINLOOSE', `[v=\\s]*(${src[t.XRANGEIDENTIFIERLOOSE]})` +
                        `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
                        `(?:\\.(${src[t.XRANGEIDENTIFIERLOOSE]})` +
                        `(?:${src[t.PRERELEASELOOSE]})?${
                          src[t.BUILD]}?` +
                        `)?)?`)

createToken('XRANGE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAIN]}$`)
createToken('XRANGELOOSE', `^${src[t.GTLT]}\\s*${src[t.XRANGEPLAINLOOSE]}$`)

// Coercion.
// Extract anything that could conceivably be a part of a valid semver
createToken('COERCEPLAIN', `${'(^|[^\\d])' +
              '(\\d{1,'}${MAX_SAFE_COMPONENT_LENGTH}})` +
              `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?` +
              `(?:\\.(\\d{1,${MAX_SAFE_COMPONENT_LENGTH}}))?`)
createToken('COERCE', `${src[t.COERCEPLAIN]}(?:$|[^\\d])`)
createToken('COERCEFULL', src[t.COERCEPLAIN] +
              `(?:${src[t.PRERELEASE]})?` +
              `(?:${src[t.BUILD]})?` +
              `(?:$|[^\\d])`)
createToken('COERCERTL', src[t.COERCE], true)
createToken('COERCERTLFULL', src[t.COERCEFULL], true)

// Tilde ranges.
// Meaning is "reasonably at or greater than"
createToken('LONETILDE', '(?:~>?)')

createToken('TILDETRIM', `(\\s*)${src[t.LONETILDE]}\\s+`, true)
exports.tildeTrimReplace = '$1~'

createToken('TILDE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAIN]}$`)
createToken('TILDELOOSE', `^${src[t.LONETILDE]}${src[t.XRANGEPLAINLOOSE]}$`)

// Caret ranges.
// Meaning is "at least and backwards compatible with"
createToken('LONECARET', '(?:\\^)')

createToken('CARETTRIM', `(\\s*)${src[t.LONECARET]}\\s+`, true)
exports.caretTrimReplace = '$1^'

createToken('CARET', `^${src[t.LONECARET]}${src[t.XRANGEPLAIN]}$`)
createToken('CARETLOOSE', `^${src[t.LONECARET]}${src[t.XRANGEPLAINLOOSE]}$`)

// A simple gt/lt/eq thing, or just "" to indicate "any version"
createToken('COMPARATORLOOSE', `^${src[t.GTLT]}\\s*(${src[t.LOOSEPLAIN]})$|^$`)
createToken('COMPARATOR', `^${src[t.GTLT]}\\s*(${src[t.FULLPLAIN]})$|^$`)

// An expression to strip any whitespace between the gtlt and the thing
// it modifies, so that `> 1.2.3` ==> `>1.2.3`
createToken('COMPARATORTRIM', `(\\s*)${src[t.GTLT]
}\\s*(${src[t.LOOSEPLAIN]}|${src[t.XRANGEPLAIN]})`, true)
exports.comparatorTrimReplace = '$1$2$3'

// Something like `1.2.3 - 1.2.4`
// Note that these all use the loose form, because they'll be
// checked against either the strict or loose comparator form
// later.
createToken('HYPHENRANGE', `^\\s*(${src[t.XRANGEPLAIN]})` +
                   `\\s+-\\s+` +
                   `(${src[t.XRANGEPLAIN]})` +
                   `\\s*$`)

createToken('HYPHENRANGELOOSE', `^\\s*(${src[t.XRANGEPLAINLOOSE]})` +
                        `\\s+-\\s+` +
                        `(${src[t.XRANGEPLAINLOOSE]})` +
                        `\\s*$`)

// Star ranges basically just allow anything at all.
createToken('STAR', '(<|>)?=?\\s*\\*')
// >=0.0.0 is like a star
createToken('GTE0', '^\\s*>=\\s*0\\.0\\.0\\s*$')
createToken('GTE0PRE', '^\\s*>=\\s*0\\.0\\.0-0\\s*$')
c35gx}{
  "name": "semver",
  "version": "7.8.5",
  "description": "The semantic version parser used by npm.",
  "main": "index.js",
  "scripts": {
    "test": "tap",
    "snap": "tap",
    "lint": "npm run eslint",
    "postlint": "template-oss-check",
    "lintfix": "npm run eslint -- --fix",
    "posttest": "npm run lint",
    "template-oss-apply": "template-oss-apply --force",
    "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
  },
  "devDependencies": {
    "@npmcli/eslint-config": "^7.0.0",
    "@npmcli/template-oss": "5.0.0",
    "benchmark": "^2.1.4",
    "tap": "^16.0.0"
  },
  "license": "ISC",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/npm/node-semver.git"
  },
  "bin": {
    "semver": "bin/semver.js"
  },
  "files": [
    "bin/",
    "lib/",
    "classes/",
    "functions/",
    "internal/",
    "ranges/",
    "index.js",
    "preload.js",
    "range.bnf"
  ],
  "tap": {
    "timeout": 30,
    "coverage-map": "map.js",
    "nyc-arg": [
      "--exclude",
      "tap-snapshots/**"
    ]
  },
  "engines": {
    "node": ">=10"
  },
  "author": "GitHub Inc.",
  "templateOSS": {
    "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
    "version": "5.0.0",
    "engines": ">=10",
    "distPaths": [
      "classes/",
      "functions/",
      "internal/",
      "ranges/",
      "index.js",
      "preload.js",
      "range.bnf"
    ],
    "allowPaths": [
      "/classes/",
      "/functions/",
      "/internal/",
      "/ranges/",
      "/index.js",
      "/preload.js",
      "/range.bnf",
      "/benchmarks"
    ],
    "publish": "true"
  }
}
rKxS 'use strict'

// XXX remove in v8 or beyond
module.exports = require('./index.js')
~z+xArange-set  ::= range ( logical-or range ) *
logical-or ::= ( ' ' ) * '||' ( ' ' ) *
range      ::= hyphen | simple ( ' ' simple ) * | ''
hyphen     ::= partial ' - ' partial
simple     ::= primitive | partial | tilde | caret
primitive  ::= ( '<' | '>' | '>=' | '<=' | '=' ) partial
partial    ::= xr ( '.' xr ( '.' xr qualifier ? )? )?
xr         ::= 'x' | 'X' | '*' | nr
nr         ::= '0' | [1-9] ( [0-9] ) *
tilde      ::= '~' partial
caret      ::= '^' partial
qualifier  ::= ( '-' pre )? ( '+' build )?
pre        ::= prepart ( '.' prepart ) *
prepart    ::= nr | alphanumid
build      ::= buildid ( '.' buildid ) *
alphanumid ::= ( [0-9] ) * [A-Za-z-] [-0-9A-Za-z] *
buildid    ::= [-0-9A-Za-z]+
~ DxK100644 gtr.js vUJ$LgD{p100644 intersects.js {)=+Z|2zݪ~100644 ltr.js ^VyJ<)&k/N100644 max-satisfying.js ZqWh>+,_< jb100644 min-satisfying.js C&&IC~100644 min-version.js 	Zodz)J100644 outside.js tB,!V*ZK6)100644 simplify.js &'2pܠ['!Zل100644 subset.js I#) ;5&	CB100644 to-comparators.js [Qߤ);LvN100644 valid.js kh_Z&b^z#x 'use strict'

// Determine if version is greater than all the versions possible in the range.
const outside = require('./outside')
const gtr = (version, range, options) => outside(version, range, '>', options)
module.exports = gtr
Px 'use strict'

const Range = require('../classes/range')
const intersects = (r1, r2, options) => {
  r1 = new Range(r1, options)
  r2 = new Range(r2, options)
  return r1.intersects(r2, options)
}
module.exports = intersects
Ix 'use strict'

const outside = require('./outside')
// Determine if version is less than all the versions possible in the range
const ltr = (version, range, options) => outside(version, range, '<', options)
module.exports = ltr
N%xQ'use strict'

const SemVer = require('../classes/semver')
const Range = require('../classes/range')

const maxSatisfying = (versions, range, options) => {
  let max = null
  let maxSV = null
  let rangeObj = null
  try {
    rangeObj = new Range(range, options)
  } catch (er) {
    return null
  }
  versions.forEach((v) => {
    if (rangeObj.test(v)) {
      // satisfies(v, range, options)
      if (!max || maxSV.compare(v) === -1) {
        // compare(max, v, true)
        max = v
        maxSV = new SemVer(max, options)
      }
    }
  })
  return max
}
module.exports = maxSatisfying
#	^x `d	const minn4in = null
  let minin || minSV.compare(v) === ;in, v, true)
        min = v
        minSV = new SemVer(min(in/inSatisfying
/1P^x'use strict'

const SemVer = require('../classes/semver')
const Range = require('../classes/range')
const gt = require('../functions/gt')

const minVersion = (range, loose) => {
  range = new Range(range, loose)

  let minver = new SemVer('0.0.0')
  if (range.test(minver)) {
    return minver
  }

  minver = new SemVer('0.0.0-0')
  if (range.test(minver)) {
    return minver
  }

  minver = null
  for (let i = 0; i < range.set.length; ++i) {
    const comparators = range.set[i]

    let setMin = null
    comparators.forEach((comparator) => {
      // Clone to avoid manipulating the comparator's semver object.
      const compver = new SemVer(comparator.semver.version)
      switch (comparator.operator) {
        case '>':
          if (compver.prerelease.length === 0) {
            compver.patch++
          } else {
            compver.prerelease.push(0)
          }
          compver.raw = compver.format()
          /* fallthrough */
        case '':
        case '>=':
          if (!setMin || gt(compver, setMin)) {
            setMin = compver
          }
          break
        case '<':
        case '<=':
          /* Ignore maximum versions */
          break
        /* istanbul ignore next */
        default:
          throw new Error(`Unexpected operation: ${comparator.operator}`)
      }
    })
    if (setMin && (!minver || gt(minver, setMin))) {
      minver = setMin
    }
  }

  if (minver && range.test(minver)) {
    return minver
  }

  return null
}
module.exports = minVersion
qWZxc'use strict'

const SemVer = require('../classes/semver')
const Comparator = require('../classes/comparator')
const { ANY } = Comparator
const Range = require('../classes/range')
const satisfies = require('../functions/satisfies')
const gt = require('../functions/gt')
const lt = require('../functions/lt')
const lte = require('../functions/lte')
const gte = require('../functions/gte')

const outside = (version, range, hilo, options) => {
  version = new SemVer(version, options)
  range = new Range(range, options)

  let gtfn, ltefn, ltfn, comp, ecomp
  switch (hilo) {
    case '>':
      gtfn = gt
      ltefn = lte
      ltfn = lt
      comp = '>'
      ecomp = '>='
      break
    case '<':
      gtfn = lt
      ltefn = gte
      ltfn = gt
      comp = '<'
      ecomp = '<='
      break
    default:
      throw new TypeError('Must provide a hilo val of "<" or ">"')
  }

  // If it satisfies the range it is not outside
  if (satisfies(version, range, options)) {
    return false
  }

  // From now on, variable terms are as if we're in "gtr" mode.
  // but note that everything is flipped for the "ltr" function.

  for (let i = 0; i < range.set.length; ++i) {
    const comparators = range.set[i]

    let high = null
    let low = null

    comparators.forEach((comparator) => {
      if (comparator.semver === ANY) {
        comparator = new Comparator('>=0.0.0')
      }
      high = high || comparator
      low = low || comparator
      if (gtfn(comparator.semver, high.semver, options)) {
        high = comparator
      } else if (ltfn(comparator.semver, low.semver, options)) {
        low = comparator
      }
    })

    // If the edge version comparator has a operator then our version
    // isn't outside it
    if (high.operator === comp || high.operator === ecomp) {
      return false
    }

    // If the lowest version comparator has an operator and our version
    // is less than it then it isn't higher than the range
    if ((!low.operator || low.operator === comp) &&
        ltefn(version, low.semver)) {
      return false
    } else if (low.operator === ecomp && ltfn(version, low.semver)) {
      return false
    }
  }
  return true
}

module.exports = outside
}/TxK'use strict'

// given a set of versions and a range, create a "simplified" range
// that includes the same versions that the original range does
// If the original range is shorter than the simplified one, return that.
const satisfies = require('../functions/satisfies.js')
const compare = require('../functions/compare.js')
module.exports = (versions, range, options) => {
  const set = []
  let first = null
  let prev = null
  const v = versions.sort((a, b) => compare(a, b, options))
  for (const version of v) {
    const included = satisfies(version, range, options)
    if (included) {
      prev = version
      if (!first) {
        first = version
      }
    } else {
      if (prev) {
        set.push([first, prev])
      }
      prev = null
      first = null
    }
  }
  if (first) {
    set.push([first, null])
  }

  const ranges = []
  for (const [min, max] of set) {
    if (min === max) {
      ranges.push(min)
    } else if (!max && min === v[0]) {
      ranges.push('*')
    } else if (!max) {
      ranges.push(`>=${min}`)
    } else if (min === v[0]) {
      ranges.push(`<=${max}`)
    } else {
      ranges.push(`${min} - ${max}`)
    }
  }
  const simplified = ranges.join(' || ')
  const original = typeof range.raw === 'string' ? range.raw : String(range)
  return simplified.length < original.length ? simplified : range
}
RAжx6'use strict'

const Range = require('../classes/range.js')
const Comparator = require('../classes/comparator.js')
const { ANY } = Comparator
const satisfies = require('../functions/satisfies.js')
const compare = require('../functions/compare.js')

// Complex range `r1 || r2 || ...` is a subset of `R1 || R2 || ...` iff:
// - Every simple range `r1, r2, ...` is a null set, OR
// - Every simple range `r1, r2, ...` which is not a null set is a subset of
//   some `R1, R2, ...`
//
// Simple range `c1 c2 ...` is a subset of simple range `C1 C2 ...` iff:
// - If c is only the ANY comparator
//   - If C is only the ANY comparator, return true
//   - Else if in prerelease mode, return false
//   - else replace c with `[>=0.0.0]`
// - If C is only the ANY comparator
//   - if in prerelease mode, return true
//   - else replace C with `[>=0.0.0]`
// - Let EQ be the set of = comparators in c
// - If EQ is more than one, return true (null set)
// - Let GT be the highest > or >= comparator in c
// - Let LT be the lowest < or <= comparator in c
// - If GT and LT, and GT.semver > LT.semver, return true (null set)
// - If any C is a = range, and GT or LT are set, return false
// - If EQ
//   - If GT, and EQ does not satisfy GT, return true (null set)
//   - If LT, and EQ does not satisfy LT, return true (null set)
//   - If EQ satisfies every C, return true
//   - Else return false
// - If GT
//   - If GT.semver is lower than any > or >= comp in C, return false
//   - If GT is >=, and GT.semver does not satisfy every C, return false
//   - If GT.semver has a prerelease, and not in prerelease mode
//     - If no C has a prerelease and the GT.semver tuple, return false
// - If LT
//   - If LT.semver is greater than any < or <= comp in C, return false
//   - If LT is <=, and LT.semver does not satisfy every C, return false
//   - If LT.semver has a prerelease, and not in prerelease mode
//     - If no C has a prerelease and the LT.semver tuple, return false
// - Else return true

const subset = (sub, dom, options = {}) => {
  if (sub === dom) {
    return true
  }

  sub = new Range(sub, options)
  dom = new Range(dom, options)
  let sawNonNull = false

  OUTER: for (const simpleSub of sub.set) {
    for (const simpleDom of dom.set) {
      const isSub = simpleSubset(simpleSub, simpleDom, options)
      sawNonNull = sawNonNull || isSub !== null
      if (isSub) {
        continue OUTER
      }
    }
    // the null set is a subset of everything, but null simple ranges in
    // a complex range should be ignored.  so if we saw a non-null range,
    // then we know this isn't a subset, but if EVERY simple range was null,
    // then it is a subset.
    if (sawNonNull) {
      return false
    }
  }
  return true
}

const minimumVersionWithPreRelease = [new Comparator('>=0.0.0-0')]
const minimumVersion = [new Comparator('>=0.0.0')]

const simpleSubset = (sub, dom, options) => {
  if (sub === dom) {
    return true
  }

  if (sub.length === 1 && sub[0].semver === ANY) {
    if (dom.length === 1 && dom[0].semver === ANY) {
      return true
    } else if (options.includePrerelease) {
      sub = minimumVersionWithPreRelease
    } else {
      sub = minimumVersion
    }
  }

  if (dom.length === 1 && dom[0].semver === ANY) {
    if (options.includePrerelease) {
      return true
    } else {
      dom = minimumVersion
    }
  }

  const eqSet = new Set()
  let gt, lt
  for (const c of sub) {
    if (c.operator === '>' || c.operator === '>=') {
      gt = higherGT(gt, c, options)
    } else if (c.operator === '<' || c.operator === '<=') {
      lt = lowerLT(lt, c, options)
    } else {
      eqSet.add(c.semver)
    }
  }

  if (eqSet.size > 1) {
    return null
  }

  let gtltComp
  if (gt && lt) {
    gtltComp = compare(gt.semver, lt.semver, options)
    if (gtltComp > 0) {
      return null
    } else if (gtltComp === 0 && (gt.operator !== '>=' || lt.operator !== '<=')) {
      return null
    }
  }

  // will iterate one or zero times
  for (const eq of eqSet) {
    if (gt && !satisfies(eq, String(gt), options)) {
      return null
    }

    if (lt && !satisfies(eq, String(lt), options)) {
      return null
    }

    for (const c of dom) {
      if (!satisfies(eq, String(c), options)) {
        return false
      }
    }

    return true
  }

  let higher, lower
  let hasDomLT, hasDomGT
  // if the subset has a prerelease, we need a comparator in the superset
  // with the same tuple and a prerelease, or it's not a subset
  let needDomLTPre = lt &&
    !options.includePrerelease &&
    lt.semver.prerelease.length ? lt.semver : false
  let needDomGTPre = gt &&
    !options.includePrerelease &&
    gt.semver.prerelease.length ? gt.semver : false
  // exception: <1.2.3-0 is the same as <1.2.3
  if (needDomLTPre && needDomLTPre.prerelease.length === 1 &&
      lt.operator === '<' && needDomLTPre.prerelease[0] === 0) {
    needDomLTPre = false
  }

  for (const c of dom) {
    hasDomGT = hasDomGT || c.operator === '>' || c.operator === '>='
    hasDomLT = hasDomLT || c.operator === '<' || c.operator === '<='
    if (gt) {
      if (needDomGTPre) {
        if (c.semver.prerelease && c.semver.prerelease.length &&
            c.semver.major === needDomGTPre.major &&
            c.semver.minor === needDomGTPre.minor &&
            c.semver.patch === needDomGTPre.patch) {
          needDomGTPre = false
        }
      }
      if (c.operator === '>' || c.operator === '>=') {
        higher = higherGT(gt, c, options)
        if (higher === c && higher !== gt) {
          return false
        }
      } else if (gt.operator === '>=' && !c.test(gt.semver)) {
        return false
      }
    }
    if (lt) {
      if (needDomLTPre) {
        if (c.semver.prerelease && c.semver.prerelease.length &&
            c.semver.major === needDomLTPre.major &&
            c.semver.minor === needDomLTPre.minor &&
            c.semver.patch === needDomLTPre.patch) {
          needDomLTPre = false
        }
      }
      if (c.operator === '<' || c.operator === '<=') {
        lower = lowerLT(lt, c, options)
        if (lower === c && lower !== lt) {
          return false
        }
      } else if (lt.operator === '<=' && !c.test(lt.semver)) {
        return false
      }
    }
    if (!c.operator && (lt || gt) && gtltComp !== 0) {
      return false
    }
  }

  // if there was a < or >, and nothing in the dom, then must be false
  // UNLESS it was limited by another range in the other direction.
  // Eg, >1.0.0 <1.0.1 is still a subset of <2.0.0
  if (gt && hasDomLT && !lt && gtltComp !== 0) {
    return false
  }

  if (lt && hasDomGT && !gt && gtltComp !== 0) {
    return false
  }

  // we needed a prerelease range in a specific tuple, but didn't get one
  // then this isn't a subset.  eg >=1.2.3-pre is not a subset of >=1.0.0,
  // because it includes prereleases in the 1.2.3 tuple
  if (needDomGTPre || needDomLTPre) {
    return false
  }

  return true
}

// >=1.2.3 is lower than >1.2.3
const higherGT = (a, b, options) => {
  if (!a) {
    return b
  }
  const comp = compare(a.semver, b.semver, options)
  return comp > 0 ? a
    : comp < 0 ? b
    : b.operator === '>' && a.operator === '>=' ? b
    : a
}

// <=1.2.3 is higher than <1.2.3
const lowerLT = (a, b, options) => {
  if (!a) {
    return b
  }
  const comp = compare(a.semver, b.semver, options)
  return comp < 0 ? a
    : comp > 0 ? b
    : b.operator === '<' && a.operator === '<=' ? b
    : a
}

module.exports = subset
|x'use strict'

const Range = require('../classes/range')

// Mostly just for testing and legacy API reasons
const toComparators = (range, options) =>
  new Range(range, options).set
    .map(comp => comp.map(c => c.value).join(' ').trim().split(' '))

module.exports = toComparators
\xF'use strict'

const Range = require('../classes/range')
const validRange = (range, options) => {
  try {
    // Return '*' instead of '' so that truthiness works.
    // This will throw if it's invalid anyway
    return new Range(range, options).range || '*'
  } catch (er) {
    return null
  }
}
module.exports = validRange
nFi	x k100644 index.js ]Qw-re 100644 license k,N 5u??100644 package.json F8h%(J}B100644 readme.md BF+@Xת,:!<)x|'use strict';
const shebangRegex = require('shebang-regex');

module.exports = (string = '') => {
	const match = string.match(shebangRegex);

	if (!match) {
		return null;
	}

	const [path, argument] = match[0].replace(/#! ?/, '').split(' ');
	const binary = path.split('/').pop();

	if (binary === 'env') {
		return argument;
	}

	return argument ? `${binary} ${argument}` : binary;
};
{PĘ^xJ ?Kevin Mårtensson <kevinmartensson@gmail.com> (github.com/kevvaSK@"x.{
	"name": "shebang-command",
	"version": "2.0.0",
	"description": "Get the command from a shebang",
	"license": "MIT",
	"repository": "kevva/shebang-command",
	"author": {
		"name": "Kevin Mårtensson",
		"email": "kevinmartensson@gmail.com",
		"url": "github.com/kevva"
	},
	"engines": {
		"node": ">=8"
	},
	"scripts": {
		"test": "xo && ava"
	},
	"files": [
		"index.js"
	],
	"keywords": [
		"cmd",
		"command",
		"parse",
		"shebang"
	],
	"dependencies": {
		"shebang-regex": "^3.0.0"
	},
	"devDependencies": {
		"ava": "^2.3.0",
		"xo": "^0.24.0"
	}
}
ex# shebang-command [![Build Status](https://travis-ci.org/kevva/shebang-command.svg?branch=master)](https://travis-ci.org/kevva/shebang-command)

> Get the command from a shebang


## Install

```
$ npm install shebang-command
```


## Usage

```js
const shebangCommand = require('shebang-command');

shebangCommand('#!/usr/bin/env node');
//=> 'node'

shebangCommand('#!/bin/bash');
//=> 'bash'
```


## API

### shebangCommand(string)

#### string

Type: `string`

String containing a shebang.
âx E100644 index.d.ts a4+
G100644 index.js cJg	f'K6}100644 license /w}sd!VhL<100644 package.json  0hhc3tF100644 readme.md ^φ:ZhRmxɾTaZK3xA/**
Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) line.

@example
```
import shebangRegex = require('shebang-regex');

const string = '#!/usr/bin/env node\nconsole.log("unicorns");';

shebangRegex.test(string);
//=> true

shebangRegex.exec(string)[0];
//=> '#!/usr/bin/env node'

shebangRegex.exec(string)[1];
//=> '/usr/bin/env node'
```
*/
declare const shebangRegex: RegExp;

export = shebangRegex;
|ֺx* 'use strict';
module.exports = /^#!(.*)/;
4\x 
{
	"name": "shebang-regex",
	"version": "3.0.0",
	"description": "Regular expression for matching a shebang line",
	"license": $shebang-regexXregex",
		"regexp",
		"shebang",
		"match",
		"test",
		"line"
	],
	"devDependencies": {L>ϝJ(xv# shebang-regex [![Build Status](https://travis-ci.org/sindresorhus/shebang-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/shebang-regex)

> Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) line


## Install

```
$ npm install shebang-regex
```


## Usage

```js
const shebangRegex = require('shebang-regex');

const string = '#!/usr/bin/env node\nconsole.log("unicorns");';

shebangRegex.test(string);
//=> true

shebangRegex.exec(string)[0];
//=> '#!/usr/bin/env node'

shebangRegex.exec(string)[1];
//=> '/usr/bin/env node'
```


## License

MIT © [Sindre Sorhus](https://sindresorhus.com)
aߢx 100644 LICENSE |~6{;q100644 README.md aIbl	!){l40000 lib M- Rb6ٶ100644 package.json 죭1$[ZΪ100644 source-map.d.ts 숒1=4hʟյ:100644 source-map.js ~(q85[_x	
Copyright (c) 2009-2011, Mozilla Foundation and contributors
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice, this
  list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright notice,
  this list of conditions and the following disclaimer in the documentation
  and/or other materials provided with the distribution.

* Neither the names of the Mozilla Foundation nor the names of project
  contributors may be used to endorse or promote products derived from this
  software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
	ٸxeG# Source Map JS

[![NPM](https://nodei.co/npm/source-map-js.png?downloads=true&downloadRank=true)](https://www.npmjs.com/package/source-map-js)

Difference between original [source-map](https://github.com/mozilla/source-map):

> TL,DR: it's fork of original source-map@0.6, but with perfomance optimizations.

This journey starts from [source-map@0.7.0](https://github.com/mozilla/source-map/blob/master/CHANGELOG.md#070). Some part of it was rewritten to Rust and WASM and API became async.

It's still a major block for many libraries like PostCSS or Sass for example because they need to migrate the whole API to the async way. This is the reason why 0.6.1 has 2x more downloads than 0.7.3 while it's faster several times.

![Downloads count](media/downloads.png)

More important that WASM version has some optimizations in JS code too. This is why [community asked to create branch for 0.6 version](https://github.com/mozilla/source-map/issues/324) and port these optimizations but, sadly, the answer was «no». A bit later I discovered [the issue](https://github.com/mozilla/source-map/issues/370) created by [Ben Rothman (@benthemonkey)](https://github.com/benthemonkey) with no response at all.

[Roman Dvornov (@lahmatiy)](https://github.com/lahmatiy) wrote a [serveral posts](https://t.me/gorshochekvarit/76) (russian, only, sorry) about source-map library in his own Telegram channel. He mentioned the article [«Maybe you don't need Rust and WASM to speed up your JS»](https://mrale.ph/blog/2018/02/03/maybe-you-dont-need-rust-to-speed-up-your-js.html) written by [Vyacheslav Egorov (@mraleph)](https://github.com/mraleph). This article contains optimizations and hacks that lead to almost the same performance compare to WASM implementation.

I decided to fork the original source-map and port these optimizations from the article and several others PR from the original source-map.

---------

This is a library to generate and consume the source map format
[described here][format].

[format]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit

## Use with Node

    $ npm install source-map-js

<!-- ## Use on the Web

    <script src="https://raw.githubusercontent.com/mozilla/source-map/master/dist/source-map.min.js" defer></script> -->

--------------------------------------------------------------------------------

<!-- `npm run toc` to regenerate the Table of Contents -->

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
## Table of Contents

- [Examples](#examples)
  - [Consuming a source map](#consuming-a-source-map)
  - [Generating a source map](#generating-a-source-map)
    - [With SourceNode (high level API)](#with-sourcenode-high-level-api)
    - [With SourceMapGenerator (low level API)](#with-sourcemapgenerator-low-level-api)
- [API](#api)
  - [SourceMapConsumer](#sourcemapconsumer)
    - [new SourceMapConsumer(rawSourceMap)](#new-sourcemapconsumerrawsourcemap)
    - [SourceMapConsumer.prototype.computeColumnSpans()](#sourcemapconsumerprototypecomputecolumnspans)
    - [SourceMapConsumer.prototype.originalPositionFor(generatedPosition)](#sourcemapconsumerprototypeoriginalpositionforgeneratedposition)
    - [SourceMapConsumer.prototype.generatedPositionFor(originalPosition)](#sourcemapconsumerprototypegeneratedpositionfororiginalposition)
    - [SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)](#sourcemapconsumerprototypeallgeneratedpositionsfororiginalposition)
    - [SourceMapConsumer.prototype.hasContentsOfAllSources()](#sourcemapconsumerprototypehascontentsofallsources)
    - [SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])](#sourcemapconsumerprototypesourcecontentforsource-returnnullonmissing)
    - [SourceMapConsumer.prototype.eachMapping(callback, context, order)](#sourcemapconsumerprototypeeachmappingcallback-context-order)
  - [SourceMapGenerator](#sourcemapgenerator)
    - [new SourceMapGenerator([startOfSourceMap])](#new-sourcemapgeneratorstartofsourcemap)
    - [SourceMapGenerator.fromSourceMap(sourceMapConsumer)](#sourcemapgeneratorfromsourcemapsourcemapconsumer)
    - [SourceMapGenerator.prototype.addMapping(mapping)](#sourcemapgeneratorprototypeaddmappingmapping)
    - [SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)](#sourcemapgeneratorprototypesetsourcecontentsourcefile-sourcecontent)
    - [SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])](#sourcemapgeneratorprototypeapplysourcemapsourcemapconsumer-sourcefile-sourcemappath)
    - [SourceMapGenerator.prototype.toString()](#sourcemapgeneratorprototypetostring)
  - [SourceNode](#sourcenode)
    - [new SourceNode([line, column, source[, chunk[, name]]])](#new-sourcenodeline-column-source-chunk-name)
    - [SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])](#sourcenodefromstringwithsourcemapcode-sourcemapconsumer-relativepath)
    - [SourceNode.prototype.add(chunk)](#sourcenodeprototypeaddchunk)
    - [SourceNode.prototype.prepend(chunk)](#sourcenodeprototypeprependchunk)
    - [SourceNode.prototype.setSourceContent(sourceFile, sourceContent)](#sourcenodeprototypesetsourcecontentsourcefile-sourcecontent)
    - [SourceNode.prototype.walk(fn)](#sourcenodeprototypewalkfn)
    - [SourceNode.prototype.walkSourceContents(fn)](#sourcenodeprototypewalksourcecontentsfn)
    - [SourceNode.prototype.join(sep)](#sourcenodeprototypejoinsep)
    - [SourceNode.prototype.replaceRight(pattern, replacement)](#sourcenodeprototypereplacerightpattern-replacement)
    - [SourceNode.prototype.toString()](#sourcenodeprototypetostring)
    - [SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])](#sourcenodeprototypetostringwithsourcemapstartofsourcemap)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## Examples

### Consuming a source map

```js
var rawSourceMap = {
  version: 3,
  file: 'min.js',
  names: ['bar', 'baz', 'n'],
  sources: ['one.js', 'two.js'],
  sourceRoot: 'http://example.com/www/js/',
  mappings: 'CAAC,IAAI,IAAM,SAAUA,GAClB,OAAOC,IAAID;CCDb,IAAI,IAAM,SAAUE,GAClB,OAAOA'
};

var smc = new SourceMapConsumer(rawSourceMap);

console.log(smc.sources);
// [ 'http://example.com/www/js/one.js',
//   'http://example.com/www/js/two.js' ]

console.log(smc.originalPositionFor({
  line: 2,
  column: 28
}));
// { source: 'http://example.com/www/js/two.js',
//   line: 2,
//   column: 10,
//   name: 'n' }

console.log(smc.generatedPositionFor({
  source: 'http://example.com/www/js/two.js',
  line: 2,
  column: 10
}));
// { line: 2, column: 28 }

smc.eachMapping(function (m) {
  // ...
});
```

### Generating a source map

In depth guide:
[**Compiling to JavaScript, and Debugging with Source Maps**](https://hacks.mozilla.org/2013/05/compiling-to-javascript-and-debugging-with-source-maps/)

#### With SourceNode (high level API)

```js
function compile(ast) {
  switch (ast.type) {
  case 'BinaryExpression':
    return new SourceNode(
      ast.location.line,
      ast.location.column,
      ast.location.source,
      [compile(ast.left), " + ", compile(ast.right)]
    );
  case 'Literal':
    return new SourceNode(
      ast.location.line,
      ast.location.column,
      ast.location.source,
      String(ast.value)
    );
  // ...
  default:
    throw new Error("Bad AST");
  }
}

var ast = parse("40 + 2", "add.js");
console.log(compile(ast).toStringWithSourceMap({
  file: 'add.js'
}));
// { code: '40 + 2',
//   map: [object SourceMapGenerator] }
```

#### With SourceMapGenerator (low level API)

```js
var map = new SourceMapGenerator({
  file: "source-mapped.js"
});

map.addMapping({
  generated: {
    line: 10,
    column: 35
  },
  source: "foo.js",
  original: {
    line: 33,
    column: 2
  },
  name: "christopher"
});

console.log(map.toString());
// '{"version":3,"file":"source-mapped.js","sources":["foo.js"],"names":["christopher"],"mappings":";;;;;;;;;mCAgCEA"}'
```

## API

Get a reference to the module:

```js
// Node.js
var sourceMap = require('source-map');

// Browser builds
var sourceMap = window.sourceMap;

// Inside Firefox
const sourceMap = require("devtools/toolkit/sourcemap/source-map.js");
```

### SourceMapConsumer

A SourceMapConsumer instance represents a parsed source map which we can query
for information about the original file positions by giving it a file position
in the generated source.

#### new SourceMapConsumer(rawSourceMap)

The only parameter is the raw source map (either as a string which can be
`JSON.parse`'d, or an object). According to the spec, source maps have the
following attributes:

* `version`: Which version of the source map spec this map is following.

* `sources`: An array of URLs to the original source files.

* `names`: An array of identifiers which can be referenced by individual
  mappings.

* `sourceRoot`: Optional. The URL root from which all sources are relative.

* `sourcesContent`: Optional. An array of contents of the original source files.

* `mappings`: A string of base64 VLQs which contain the actual mappings.

* `file`: Optional. The generated filename this source map is associated with.

```js
var consumer = new sourceMap.SourceMapConsumer(rawSourceMapJsonData);
```

#### SourceMapConsumer.prototype.computeColumnSpans()

Compute the last column for each generated mapping. The last column is
inclusive.

```js
// Before:
consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" })
// [ { line: 2,
//     column: 1 },
//   { line: 2,
//     column: 10 },
//   { line: 2,
//     column: 20 } ]

consumer.computeColumnSpans();

// After:
consumer.allGeneratedPositionsFor({ line: 2, source: "foo.coffee" })
// [ { line: 2,
//     column: 1,
//     lastColumn: 9 },
//   { line: 2,
//     column: 10,
//     lastColumn: 19 },
//   { line: 2,
//     column: 20,
//     lastColumn: Infinity } ]

```

#### SourceMapConsumer.prototype.originalPositionFor(generatedPosition)

Returns the original source, line, and column information for the generated
source's line and column positions provided. The only argument is an object with
the following properties:

* `line`: The line number in the generated source.  Line numbers in
  this library are 1-based (note that the underlying source map
  specification uses 0-based line numbers -- this library handles the
  translation).

* `column`: The column number in the generated source.  Column numbers
  in this library are 0-based.

* `bias`: Either `SourceMapConsumer.GREATEST_LOWER_BOUND` or
  `SourceMapConsumer.LEAST_UPPER_BOUND`. Specifies whether to return the closest
  element that is smaller than or greater than the one we are searching for,
  respectively, if the exact element cannot be found.  Defaults to
  `SourceMapConsumer.GREATEST_LOWER_BOUND`.

and an object is returned with the following properties:

* `source`: The original source file, or null if this information is not
  available.

* `line`: The line number in the original source, or null if this information is
  not available.  The line number is 1-based.

* `column`: The column number in the original source, or null if this
  information is not available.  The column number is 0-based.

* `name`: The original identifier, or null if this information is not available.

```js
consumer.originalPositionFor({ line: 2, column: 10 })
// { source: 'foo.coffee',
//   line: 2,
//   column: 2,
//   name: null }

consumer.originalPositionFor({ line: 99999999999999999, column: 999999999999999 })
// { source: null,
//   line: null,
//   column: null,
//   name: null }
```

#### SourceMapConsumer.prototype.generatedPositionFor(originalPosition)

Returns the generated line and column information for the original source,
line, and column positions provided. The only argument is an object with
the following properties:

* `source`: The filename of the original source.

* `line`: The line number in the original source.  The line number is
  1-based.

* `column`: The column number in the original source.  The column
  number is 0-based.

and an object is returned with the following properties:

* `line`: The line number in the generated source, or null.  The line
  number is 1-based.

* `column`: The column number in the generated source, or null.  The
  column number is 0-based.

```js
consumer.generatedPositionFor({ source: "example.js", line: 2, column: 10 })
// { line: 1,
//   column: 56 }
```

#### SourceMapConsumer.prototype.allGeneratedPositionsFor(originalPosition)

Returns all generated line and column information for the original source, line,
and column provided. If no column is provided, returns all mappings
corresponding to a either the line we are searching for or the next closest line
that has any mappings. Otherwise, returns all mappings corresponding to the
given line and either the column we are searching for or the next closest column
that has any offsets.

The only argument is an object with the following properties:

* `source`: The filename of the original source.

* `line`: The line number in the original source.  The line number is
  1-based.

* `column`: Optional. The column number in the original source.  The
  column number is 0-based.

and an array of objects is returned, each with the following properties:

* `line`: The line number in the generated source, or null.  The line
  number is 1-based.

* `column`: The column number in the generated source, or null.  The
  column number is 0-based.

```js
consumer.allGeneratedpositionsfor({ line: 2, source: "foo.coffee" })
// [ { line: 2,
//     column: 1 },
//   { line: 2,
//     column: 10 },
//   { line: 2,
//     column: 20 } ]
```

#### SourceMapConsumer.prototype.hasContentsOfAllSources()

Return true if we have the embedded source content for every source listed in
the source map, false otherwise.

In other words, if this method returns `true`, then
`consumer.sourceContentFor(s)` will succeed for every source `s` in
`consumer.sources`.

```js
// ...
if (consumer.hasContentsOfAllSources()) {
  consumerReadyCallback(consumer);
} else {
  fetchSources(consumer, consumerReadyCallback);
}
// ...
```

#### SourceMapConsumer.prototype.sourceContentFor(source[, returnNullOnMissing])

Returns the original source content for the source provided. The only
argument is the URL of the original source file.

If the source content for the given source is not found, then an error is
thrown. Optionally, pass `true` as the second param to have `null` returned
instead.

```js
consumer.sources
// [ "my-cool-lib.clj" ]

consumer.sourceContentFor("my-cool-lib.clj")
// "..."

consumer.sourceContentFor("this is not in the source map");
// Error: "this is not in the source map" is not in the source map

consumer.sourceContentFor("this is not in the source map", true);
// null
```

#### SourceMapConsumer.prototype.eachMapping(callback, context, order)

Iterate over each mapping between an original source/line/column and a
generated line/column in this source map.

* `callback`: The function that is called with each mapping. Mappings have the
  form `{ source, generatedLine, generatedColumn, originalLine, originalColumn,
  name }`

* `context`: Optional. If specified, this object will be the value of `this`
  every time that `callback` is called.

* `order`: Either `SourceMapConsumer.GENERATED_ORDER` or
  `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to iterate over
  the mappings sorted by the generated file's line/column order or the
  original's source/line/column order, respectively. Defaults to
  `SourceMapConsumer.GENERATED_ORDER`.

```js
consumer.eachMapping(function (m) { console.log(m); })
// ...
// { source: 'illmatic.js',
//   generatedLine: 1,
//   generatedColumn: 0,
//   originalLine: 1,
//   originalColumn: 0,
//   name: null }
// { source: 'illmatic.js',
//   generatedLine: 2,
//   generatedColumn: 0,
//   originalLine: 2,
//   originalColumn: 0,
//   name: null }
// ...
```
### SourceMapGenerator

An instance of the SourceMapGenerator represents a source map which is being
built incrementally.

#### new SourceMapGenerator([startOfSourceMap])

You may pass an object with the following properties:

* `file`: The filename of the generated source that this source map is
  associated with.

* `sourceRoot`: A root for all relative URLs in this source map.

* `skipValidation`: Optional. When `true`, disables validation of mappings as
  they are added. This can improve performance but should be used with
  discretion, as a last resort. Even then, one should avoid using this flag when
  running tests, if possible.

* `ignoreInvalidMapping`: Optional. When `true`, instead of throwing error on
  invalid mapping, it will be ignored.

```js
var generator = new sourceMap.SourceMapGenerator({
  file: "my-generated-javascript-file.js",
  sourceRoot: "http://example.com/app/js/"
});
```

#### SourceMapGenerator.fromSourceMap(sourceMapConsumer, sourceMapGeneratorOptions)

Creates a new `SourceMapGenerator` from an existing `SourceMapConsumer` instance.

* `sourceMapConsumer` The SourceMap.

* `sourceMapGeneratorOptions` options that will be passed to the SourceMapGenerator constructor which used under the hood.

```js
var generator = sourceMap.SourceMapGenerator.fromSourceMap(consumer, {
  ignoreInvalidMapping: true,
});
```

#### SourceMapGenerator.prototype.addMapping(mapping)

Add a single mapping from original source line and column to the generated
source's line and column for this source map being created. The mapping object
should have the following properties:

* `generated`: An object with the generated line and column positions.

* `original`: An object with the original line and column positions.

* `source`: The original source file (relative to the sourceRoot).

* `name`: An optional original token name for this mapping.

```js
generator.addMapping({
  source: "module-one.scm",
  original: { line: 128, column: 0 },
  generated: { line: 3, column: 456 }
})
```

#### SourceMapGenerator.prototype.setSourceContent(sourceFile, sourceContent)

Set the source content for an original source file.

* `sourceFile` the URL of the original source file.

* `sourceContent` the content of the source file.

```js
generator.setSourceContent("module-one.scm",
                           fs.readFileSync("path/to/module-one.scm"))
```

#### SourceMapGenerator.prototype.applySourceMap(sourceMapConsumer[, sourceFile[, sourceMapPath]])

Applies a SourceMap for a source file to the SourceMap.
Each mapping to the supplied source file is rewritten using the
supplied SourceMap. Note: The resolution for the resulting mappings
is the minimum of this map and the supplied map.

* `sourceMapConsumer`: The SourceMap to be applied.

* `sourceFile`: Optional. The filename of the source file.
  If omitted, sourceMapConsumer.file will be used, if it exists.
  Otherwise an error will be thrown.

* `sourceMapPath`: Optional. The dirname of the path to the SourceMap
  to be applied. If relative, it is relative to the SourceMap.

  This parameter is needed when the two SourceMaps aren't in the same
  directory, and the SourceMap to be applied contains relative source
  paths. If so, those relative source paths need to be rewritten
  relative to the SourceMap.

  If omitted, it is assumed that both SourceMaps are in the same directory,
  thus not needing any rewriting. (Supplying `'.'` has the same effect.)

#### SourceMapGenerator.prototype.toString()

Renders the source map being generated to a string.

```js
generator.toString()
// '{"version":3,"sources":["module-one.scm"],"names":[],"mappings":"...snip...","file":"my-generated-javascript-file.js","sourceRoot":"http://example.com/app/js/"}'
```

### SourceNode

SourceNodes provide a way to abstract over interpolating and/or concatenating
snippets of generated JavaScript source code, while maintaining the line and
column information associated between those snippets and the original source
code. This is useful as the final intermediate representation a compiler might
use before outputting the generated JS and source map.

#### new SourceNode([line, column, source[, chunk[, name]]])

* `line`: The original line number associated with this source node, or null if
  it isn't associated with an original line.  The line number is 1-based.

* `column`: The original column number associated with this source node, or null
  if it isn't associated with an original column.  The column number
  is 0-based.

* `source`: The original source's filename; null if no filename is provided.

* `chunk`: Optional. Is immediately passed to `SourceNode.prototype.add`, see
  below.

* `name`: Optional. The original identifier.

```js
var node = new SourceNode(1, 2, "a.cpp", [
  new SourceNode(3, 4, "b.cpp", "extern int status;\n"),
  new SourceNode(5, 6, "c.cpp", "std::string* make_string(size_t n);\n"),
  new SourceNode(7, 8, "d.cpp", "int main(int argc, char** argv) {}\n"),
]);
```

#### SourceNode.fromStringWithSourceMap(code, sourceMapConsumer[, relativePath])

Creates a SourceNode from generated code and a SourceMapConsumer.

* `code`: The generated code

* `sourceMapConsumer` The SourceMap for the generated code

* `relativePath` The optional path that relative sources in `sourceMapConsumer`
  should be relative to.

```js
var consumer = new SourceMapConsumer(fs.readFileSync("path/to/my-file.js.map", "utf8"));
var node = SourceNode.fromStringWithSourceMap(fs.readFileSync("path/to/my-file.js"),
                                              consumer);
```

#### SourceNode.prototype.add(chunk)

Add a chunk of generated JS to this source node.

* `chunk`: A string snippet of generated JS code, another instance of
   `SourceNode`, or an array where each member is one of those things.

```js
node.add(" + ");
node.add(otherNode);
node.add([leftHandOperandNode, " + ", rightHandOperandNode]);
```

#### SourceNode.prototype.prepend(chunk)

Prepend a chunk of generated JS to this source node.

* `chunk`: A string snippet of generated JS code, another instance of
   `SourceNode`, or an array where each member is one of those things.

```js
node.prepend("/** Build Id: f783haef86324gf **/\n\n");
```

#### SourceNode.prototype.setSourceContent(sourceFile, sourceContent)

Set the source content for a source file. This will be added to the
`SourceMap` in the `sourcesContent` field.

* `sourceFile`: The filename of the source file

* `sourceContent`: The content of the source file

```js
node.setSourceContent("module-one.scm",
                      fs.readFileSync("path/to/module-one.scm"))
```

#### SourceNode.prototype.walk(fn)

Walk over the tree of JS snippets in this node and its children. The walking
function is called once for each snippet of JS and is passed that snippet and
the its original associated source's line/column location.

* `fn`: The traversal function.

```js
var node = new SourceNode(1, 2, "a.js", [
  new SourceNode(3, 4, "b.js", "uno"),
  "dos",
  [
    "tres",
    new SourceNode(5, 6, "c.js", "quatro")
  ]
]);

node.walk(function (code, loc) { console.log("WALK:", code, loc); })
// WALK: uno { source: 'b.js', line: 3, column: 4, name: null }
// WALK: dos { source: 'a.js', line: 1, column: 2, name: null }
// WALK: tres { source: 'a.js', line: 1, column: 2, name: null }
// WALK: quatro { source: 'c.js', line: 5, column: 6, name: null }
```

#### SourceNode.prototype.walkSourceContents(fn)

Walk over the tree of SourceNodes. The walking function is called for each
source file content and is passed the filename and source content.

* `fn`: The traversal function.

```js
var a = new SourceNode(1, 2, "a.js", "generated from a");
a.setSourceContent("a.js", "original a");
var b = new SourceNode(1, 2, "b.js", "generated from b");
b.setSourceContent("b.js", "original b");
var c = new SourceNode(1, 2, "c.js", "generated from c");
c.setSourceContent("c.js", "original c");

var node = new SourceNode(null, null, null, [a, b, c]);
node.walkSourceContents(function (source, contents) { console.log("WALK:", source, ":", contents); })
// WALK: a.js : original a
// WALK: b.js : original b
// WALK: c.js : original c
```

#### SourceNode.prototype.join(sep)

Like `Array.prototype.join` except for SourceNodes. Inserts the separator
between each of this source node's children.

* `sep`: The separator.

```js
var lhs = new SourceNode(1, 2, "a.rs", "my_copy");
var operand = new SourceNode(3, 4, "a.rs", "=");
var rhs = new SourceNode(5, 6, "a.rs", "orig.clone()");

var node = new SourceNode(null, null, null, [ lhs, operand, rhs ]);
var joinedNode = node.join(" ");
```

#### SourceNode.prototype.replaceRight(pattern, replacement)

Call `String.prototype.replace` on the very right-most source snippet. Useful
for trimming white space from the end of a source node, etc.

* `pattern`: The pattern to replace.

* `replacement`: The thing to replace the pattern with.

```js
// Trim trailing white space.
node.replaceRight(/\s*$/, "");
```

#### SourceNode.prototype.toString()

Return the string representation of this source node. Walks over the tree and
concatenates all the various snippets together to one string.

```js
var node = new SourceNode(1, 2, "a.js", [
  new SourceNode(3, 4, "b.js", "uno"),
  "dos",
  [
    "tres",
    new SourceNode(5, 6, "c.js", "quatro")
  ]
]);

node.toString()
// 'unodostresquatro'
```

#### SourceNode.prototype.toStringWithSourceMap([startOfSourceMap])

Returns the string representation of this tree of source nodes, plus a
SourceMapGenerator which contains all the mappings between the generated and
original sources.

The arguments are the same as those to `new SourceMapGenerator`.

```js
var node = new SourceNode(1, 2, "a.js", [
  new SourceNode(3, 4, "b.js", "uno"),
  "dos",
  [
    "tres",
    new SourceNode(5, 6, "c.js", "quatro")
  ]
]);

node.toStringWithSourceMap({ file: "my-output-file.js" })
// { code: 'unodostresquatro',
//   map: [object SourceMapGenerator] }
```
$η#x=100644 array-set.js fdq.100644 base64-vlq.js a+@@q
&nk100644 base64.js k0&Cc4
100644 binary-search.js 
AVYțgdQFy100644 mapping-list.js 'JZ01p:s100644 quick-sort.js #s)aY<T	100644 source-map-consumer.d.ts tKs~eIr,<C*100644 source-map-consumer.js fF6UEz`100644 source-map-generator.d.ts p'"F9100644 source-map-generator.js O[8PB{Mm 100644 source-node.d.ts MBt@;<H0%?100644 source-node.js ;8],3;bd ?1100644 util.js C-)Ч0x}/* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
 * http://opensource.org/licenses/BSD-3-Clause
 */

var util = require('./util');
var has = Object.prototype.hasOwnProperty;
var hasNativeMap = typeof Map !== "undefined";

/**
 * A data structure which is a combination of an array and a set. Adding a new
 * member is O(1), testing for membership is O(1), and finding the index of an
 * element is O(1). Removing elements from the set is not supported. Only
 * strings are supported for membership.
 */
function ArraySet() {
  this._array = [];
  this._set = hasNativeMap ? new Map() : Object.create(null);
}

/**
 * Static method for creating ArraySet instances from an existing array.
 */
ArraySet.fromArray = function ArraySet_fromArray(aArray, aAllowDuplicates) {
  var set = new ArraySet();
  for (var i = 0, len = aArray.length; i < len; i++) {
    set.add(aArray[i], aAllowDuplicates);
  }
  return set;
};

/**
 * Return how many unique items are in this ArraySet. If duplicates have been
 * added, than those do not count towards the size.
 *
 * @returns Number
 */
ArraySet.prototype.size = function ArraySet_size() {
  return hasNativeMap ? this._set.size : Object.getOwnPropertyNames(this._set).length;
};

/**
 * Add the given string to this set.
 *
 * @param String aStr
 */
ArraySet.prototype.add = function ArraySet_add(aStr, aAllowDuplicates) {
  var sStr = hasNativeMap ? aStr : util.toSetString(aStr);
  var isDuplicate = hasNativeMap ? this.has(aStr) : has.call(this._set, sStr);
  var idx = this._array.length;
  if (!isDuplicate || aAllowDuplicates) {
    this._array.push(aStr);
  }
  if (!isDuplicate) {
    if (hasNativeMap) {
      this._set.set(aStr, idx);
    } else {
      this._set[sStr] = idx;
    }
  }
};

/**
 * Is the given string a member of this set?
 *
 * @param String aStr
 */
ArraySet.prototype.has = function ArraySet_has(aStr) {
  if (hasNativeMap) {
    return this._set.has(aStr);
  } else {
    var sStr = util.toSetString(aStr);
    return has.call(this._set, sStr);
  }
};

/**
 * What is the index of the given string in the array?
 *
 * @param String aStr
 */
ArraySet.prototype.indexOf = function ArraySet_indexOf(aStr) {
  if (hasNativeMap) {
    var idx = this._set.get(aStr);
    if (idx >= 0) {
        return idx;
    }
  } else {
    var sStr = util.toSetString(aStr);
    if (has.call(this._set, sStr)) {
      return this._set[sStr];
    }
  }

  throw new Error('"' + aStr + '" is not in the set.');
};

/**
 * What is the element at the given index?
 *
 * @param Number aIdx
 */
ArraySet.prototype.at = function ArraySet_at(aIdx) {
  if (aIdx >= 0 && aIdx < this._array.length) {
    return this._array[aIdx];
  }
  throw new Error('No element indexed by ' + aIdx);
};

/**
 * Returns the array representation of this set (which has the proper indices
 * indicated by indexOf). Note that this is a copy of the internal array used
 * for storing the members so that no one can mess with internal state.
 */
ArraySet.prototype.toArray = function ArraySet_toArray() {
  return this._array.slice();
};

exports.ArraySet = ArraySet;
A=xj/* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
 * http://opensource.org/licenses/BSD-3-Clause
 *
 * Based on the Base 64 VLQ implementation in Closure Compiler:
 * https://code.google.com/p/closure-compiler/source/browse/trunk/src/com/google/debugging/sourcemap/Base64VLQ.java
 *
 * Copyright 2011 The Closure Compiler Authors. All rights reserved.
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met:
 *
 *  * Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *  * Redistributions in binary form must reproduce the above
 *    copyright notice, this list of conditions and the following
 *    disclaimer in the documentation and/or other materials provided
 *    with the distribution.
 *  * Neither the name of Google Inc. nor the names of its
 *    contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

var base64 = require('./base64');

// A single base 64 digit can contain 6 bits of data. For the base 64 variable
// length quantities we use in the source map spec, the first bit is the sign,
// the next four bits are the actual value, and the 6th bit is the
// continuation bit. The continuation bit tells us whether there are more
// digits in this value following this digit.
//
//   Continuation
//   |    Sign
//   |    |
//   V    V
//   101011

var VLQ_BASE_SHIFT = 5;

// binary: 100000
var VLQ_BASE = 1 << VLQ_BASE_SHIFT;

// binary: 011111
var VLQ_BASE_MASK = VLQ_BASE - 1;

// binary: 100000
var VLQ_CONTINUATION_BIT = VLQ_BASE;

/**
 * Converts from a two-complement value to a value where the sign bit is
 * placed in the least significant bit.  For example, as decimals:
 *   1 becomes 2 (10 binary), -1 becomes 3 (11 binary)
 *   2 becomes 4 (100 binary), -2 becomes 5 (101 binary)
 */
function toVLQSigned(aValue) {
  return aValue < 0
    ? ((-aValue) << 1) + 1
    : (aValue << 1) + 0;
}

/**
 * Converts to a two-complement value from a value where the sign bit is
 * placed in the least significant bit.  For example, as decimals:
 *   2 (10 binary) becomes 1, 3 (11 binary) becomes -1
 *   4 (100 binary) becomes 2, 5 (101 binary) becomes -2
 */
function fromVLQSigned(aValue) {
  var isNegative = (aValue & 1) === 1;
  var shifted = aValue >> 1;
  return isNegative
    ? -shifted
    : shifted;
}

/**
 * Returns the base 64 VLQ encoded value.
 */
exports.encode = function base64VLQ_encode(aValue) {
  var encoded = "";
  var digit;

  var vlq = toVLQSigned(aValue);

  do {
    digit = vlq & VLQ_BASE_MASK;
    vlq >>>= VLQ_BASE_SHIFT;
    if (vlq > 0) {
      // There are still more digits in this value, so we must make sure the
      // continuation bit is marked.
      digit |= VLQ_CONTINUATION_BIT;
    }
    encoded += base64.encode(digit);
  } while (vlq > 0);

  return encoded;
};

/**
 * Decodes the next base 64 VLQ value from the given string and returns the
 * value and the rest of the string via the out parameter.
 */
exports.decode = function base64VLQ_decode(aStr, aIndex, aOutParam) {
  var strLen = aStr.length;
  var result = 0;
  var shift = 0;
  var continuation, digit;

  do {
    if (aIndex >= strLen) {
      throw new Error("Expected more digits in base 64 VLQ value.");
    }

    digit = base64.decode(aStr.charCodeAt(aIndex++));
    if (digit === -1) {
      throw new Error("Invalid base64 digit: " + aStr.charAt(aIndex - 1));
    }

    continuation = !!(digit & VLQ_CONTINUATION_BIT);
    digit &= VLQ_BASE_MASK;
    result = result + (digit << shift);
    shift += VLQ_BASE_SHIFT;
  } while (continuation);

  aOutParam.value = fromVLQSigned(result);
  aOutParam.rest = aIndex;
};
#k`x/* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
 * http://opensource.org/licenses/BSD-3-Clause
 */

var intToCharMap = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'.split('');

/**
 * Encode an integer in the range of 0 to 63 to a single base 64 digit.
 */
exports.encode = function (number) {
  if (0 <= number && number < intToCharMap.length) {
    return intToCharMap[number];
  }
  throw new TypeError("Must be between 0 and 63: " + number);
};

/**
 * Decode a single base 64 character code digit to an integer. Returns -1 on
 * failure.
 */
exports.decode = function (charCode) {
  var bigA = 65;     // 'A'
  var bigZ = 90;     // 'Z'

  var littleA = 97;  // 'a'
  var littleZ = 122; // 'z'

  var zero = 48;     // '0'
  var nine = 57;     // '9'

  var plus = 43;     // '+'
  var slash = 47;    // '/'

  var littleOffset = 26;
  var numberOffset = 52;

  // 0 - 25: ABCDEFGHIJKLMNOPQRSTUVWXYZ
  if (bigA <= charCode && charCode <= bigZ) {
    return (charCode - bigA);
  }

  // 26 - 51: abcdefghijklmnopqrstuvwxyz
  if (littleA <= charCode && charCode <= littleZ) {
    return (charCode - littleA + littleOffset);
  }

  // 52 - 61: 0123456789
  if (zero <= charCode && charCode <= nine) {
    return (charCode - zero + numberOffset);
  }

  // 62: +
  if (charCode == plus) {
    return 62;
  }

  // 63: /
  if (charCode == slash) {
    return 63;
  }

  // Invalid base64 digit.
  return -1;
};
?{xf/* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
 * http://opensource.org/licenses/BSD-3-Clause
 */

exports.GREATEST_LOWER_BOUND = 1;
exports.LEAST_UPPER_BOUND = 2;

/**
 * Recursive implementation of binary search.
 *
 * @param aLow Indices here and lower do not contain the needle.
 * @param aHigh Indices here and higher do not contain the needle.
 * @param aNeedle The element being searched for.
 * @param aHaystack The non-empty array being searched.
 * @param aCompare Function which takes two elements and returns -1, 0, or 1.
 * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
 *     'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
 *     closest element that is smaller than or greater than the one we are
 *     searching for, respectively, if the exact element cannot be found.
 */
function recursiveSearch(aLow, aHigh, aNeedle, aHaystack, aCompare, aBias) {
  // This function terminates when one of the following is true:
  //
  //   1. We find the exact element we are looking for.
  //
  //   2. We did not find the exact element, but we can return the index of
  //      the next-closest element.
  //
  //   3. We did not find the exact element, and there is no next-closest
  //      element than the one we are searching for, so we return -1.
  var mid = Math.floor((aHigh - aLow) / 2) + aLow;
  var cmp = aCompare(aNeedle, aHaystack[mid], true);
  if (cmp === 0) {
    // Found the element we are looking for.
    return mid;
  }
  else if (cmp > 0) {
    // Our needle is greater than aHaystack[mid].
    if (aHigh - mid > 1) {
      // The element is in the upper half.
      return recursiveSearch(mid, aHigh, aNeedle, aHaystack, aCompare, aBias);
    }

    // The exact needle element was not found in this haystack. Determine if
    // we are in termination case (3) or (2) and return the appropriate thing.
    if (aBias == exports.LEAST_UPPER_BOUND) {
      return aHigh < aHaystack.length ? aHigh : -1;
    } else {
      return mid;
    }
  }
  else {
    // Our needle is less than aHaystack[mid].
    if (mid - aLow > 1) {
      // The element is in the lower half.
      return recursiveSearch(aLow, mid, aNeedle, aHaystack, aCompare, aBias);
    }

    // we are in termination case (3) or (2) and return the appropriate thing.
    if (aBias == exports.LEAST_UPPER_BOUND) {
      return mid;
    } else {
      return aLow < 0 ? -1 : aLow;
    }
  }
}

/**
 * This is an implementation of binary search which will always try and return
 * the index of the closest element if there is no exact hit. This is because
 * mappings between original and generated line/col pairs are single points,
 * and there is an implicit region between each of them, so a miss just means
 * that you aren't on the very start of a region.
 *
 * @param aNeedle The element you are looking for.
 * @param aHaystack The array that is being searched.
 * @param aCompare A function which takes the needle and an element in the
 *     array and returns -1, 0, or 1 depending on whether the needle is less
 *     than, equal to, or greater than the element, respectively.
 * @param aBias Either 'binarySearch.GREATEST_LOWER_BOUND' or
 *     'binarySearch.LEAST_UPPER_BOUND'. Specifies whether to return the
 *     closest element that is smaller than or greater than the one we are
 *     searching for, respectively, if the exact element cannot be found.
 *     Defaults to 'binarySearch.GREATEST_LOWER_BOUND'.
 */
exports.search = function search(aNeedle, aHaystack, aCompare, aBias) {
  if (aHaystack.length === 0) {
    return -1;
  }

  var index = recursiveSearch(-1, aHaystack.length, aNeedle, aHaystack,
                              aCompare, aBias || exports.GREATEST_LOWER_BOUND);
  if (index < 0) {
    return -1;
  }

  // We have found either the exact element, or the next-closest element than
  // the one we are searching for. However, there may be more than one such
  // element. Make sure we always return the smallest of these.
  while (index - 1 >= 0) {
    if (aCompare(aHaystack[index], aHaystack[index - 1], true) !== 0) {
      break;
    }
    --index;
  }

  return index;
};
M
x#	/* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2014 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
 * http://opensource.org/licenses/BSD-3-Clause
 */

var util = require('./util');

/**
 * Determine whether mappingB is after mappingA with respect to generated
 * position.
 */
function generatedPositionAfter(mappingA, mappingB) {
  // Optimized for most common case
  var lineA = mappingA.generatedLine;
  var lineB = mappingB.generatedLine;
  var columnA = mappingA.generatedColumn;
  var columnB = mappingB.generatedColumn;
  return lineB > lineA || lineB == lineA && columnB >= columnA ||
         util.compareByGeneratedPositionsInflated(mappingA, mappingB) <= 0;
}

/**
 * A data structure to provide a sorted view of accumulated mappings in a
 * performance conscious manner. It trades a neglibable overhead in general
 * case for a large speedup in case of mappings being added in order.
 */
function MappingList() {
  this._array = [];
  this._sorted = true;
  // Serves as infimum
  this._last = {generatedLine: -1, generatedColumn: 0};
}

/**
 * Iterate through internal items. This method takes the same arguments that
 * `Array.prototype.forEach` takes.
 *
 * NOTE: The order of the mappings is NOT guaranteed.
 */
MappingList.prototype.unsortedForEach =
  function MappingList_forEach(aCallback, aThisArg) {
    this._array.forEach(aCallback, aThisArg);
  };

/**
 * Add the given source mapping.
 *
 * @param Object aMapping
 */
MappingList.prototype.add = function MappingList_add(aMapping) {
  if (generatedPositionAfter(this._last, aMapping)) {
    this._last = aMapping;
    this._array.push(aMapping);
  } else {
    this._sorted = false;
    this._array.push(aMapping);
  }
};

/**
 * Returns the flat, sorted array of mappings. The mappings are sorted by
 * generated position.
 *
 * WARNING: This method returns internal data without copying, for
 * performance. The return value must NOT be mutated, and should be treated as
 * an immutable borrow. If you want to take ownership, you must make your own
 * copy.
 */
MappingList.prototype.toArray = function MappingList_toArray() {
  if (!this._sorted) {
    this._array.sort(util.compareByGeneratedPositionsInflated);
    this._sorted = true;
  }
  return this._array;
};

exports.MappingList = MappingList;
cMx/* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
 * http://opensource.org/licenses/BSD-3-Clause
 */

// It turns out that some (most?) JavaScript engines don't self-host
// `Array.prototype.sort`. This makes sense because C++ will likely remain
// faster than JS when doing raw CPU-intensive sorting. However, when using a
// custom comparator function, calling back and forth between the VM's C++ and
// JIT'd JS is rather slow *and* loses JIT type information, resulting in
// worse generated code for the comparator function than would be optimal. In
// fact, when sorting with a comparator, these costs outweigh the benefits of
// sorting in C++. By using our own JS-implemented Quick Sort (below), we get
// a ~3500ms mean speed-up in `bench/bench.html`.

function SortTemplate(comparator) {

/**
 * Swap the elements indexed by `x` and `y` in the array `ary`.
 *
 * @param {Array} ary
 *        The array.
 * @param {Number} x
 *        The index of the first item.
 * @param {Number} y
 *        The index of the second item.
 */
function swap(ary, x, y) {
  var temp = ary[x];
  ary[x] = ary[y];
  ary[y] = temp;
}

/**
 * Returns a random integer within the range `low .. high` inclusive.
 *
 * @param {Number} low
 *        The lower bound on the range.
 * @param {Number} high
 *        The upper bound on the range.
 */
function randomIntInRange(low, high) {
  return Math.round(low + (Math.random() * (high - low)));
}

/**
 * The Quick Sort algorithm.
 *
 * @param {Array} ary
 *        An array to sort.
 * @param {function} comparator
 *        Function to use to compare two items.
 * @param {Number} p
 *        Start index of the array
 * @param {Number} r
 *        End index of the array
 */
function doQuickSort(ary, comparator, p, r) {
  // If our lower bound is less than our upper bound, we (1) partition the
  // array into two pieces and (2) recurse on each half. If it is not, this is
  // the empty array and our base case.

  if (p < r) {
    // (1) Partitioning.
    //
    // The partitioning chooses a pivot between `p` and `r` and moves all
    // elements that are less than or equal to the pivot to the before it, and
    // all the elements that are greater than it after it. The effect is that
    // once partition is done, the pivot is in the exact place it will be when
    // the array is put in sorted order, and it will not need to be moved
    // again. This runs in O(n) time.

    // Always choose a random pivot so that an input array which is reverse
    // sorted does not cause O(n^2) running time.
    var pivotIndex = randomIntInRange(p, r);
    var i = p - 1;

    swap(ary, pivotIndex, r);
    var pivot = ary[r];

    // Immediately after `j` is incremented in this loop, the following hold
    // true:
    //
    //   * Every element in `ary[p .. i]` is less than or equal to the pivot.
    //
    //   * Every element in `ary[i+1 .. j-1]` is greater than the pivot.
    for (var j = p; j < r; j++) {
      if (comparator(ary[j], pivot, false) <= 0) {
        i += 1;
        swap(ary, i, j);
      }
    }

    swap(ary, i + 1, j);
    var q = i + 1;

    // (2) Recurse on each half.

    doQuickSort(ary, comparator, p, q - 1);
    doQuickSort(ary, comparator, q + 1, r);
  }
}

  return doQuickSort;
}

function cloneSort(comparator) {
  let template = SortTemplate.toString();
  let templateFn = new Function(`return ${template}`)();
  return templateFn(comparator);
}

/**
 * Sort the given array in-place with the given comparator function.
 *
 * @param {Array} ary
 *        An array to sort.
 * @param {function} comparator
 *        Function to use to compare two items.
 */

let sortCache = new WeakMap();
exports.quickSort = function (ary, comparator, start = 0) {
  let doQuickSort = sortCache.get(comparator);
  if (doQuickSort === void 0) {
    doQuickSort = cloneSort(comparator);
    sortCache.set(comparator, doQuickSort);
  }
  doQuickSort(ary, comparator, start, ary.length - 1);
};
=x( export { SourceMapConsumer } from '..';
5xl]/* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
 * http://opensource.org/licenses/BSD-3-Clause
 */

var util = require('./util');
var binarySearch = require('./binary-search');
var ArraySet = require('./array-set').ArraySet;
var base64VLQ = require('./base64-vlq');
var quickSort = require('./quick-sort').quickSort;

function SourceMapConsumer(aSourceMap, aSourceMapURL) {
  var sourceMap = aSourceMap;
  if (typeof aSourceMap === 'string') {
    sourceMap = util.parseSourceMapInput(aSourceMap);
  }

  return sourceMap.sections != null
    ? new IndexedSourceMapConsumer(sourceMap, aSourceMapURL)
    : new BasicSourceMapConsumer(sourceMap, aSourceMapURL);
}

SourceMapConsumer.fromSourceMap = function(aSourceMap, aSourceMapURL) {
  return BasicSourceMapConsumer.fromSourceMap(aSourceMap, aSourceMapURL);
}

/**
 * The version of the source mapping spec that we are consuming.
 */
SourceMapConsumer.prototype._version = 3;

// `__generatedMappings` and `__originalMappings` are arrays that hold the
// parsed mapping coordinates from the source map's "mappings" attribute. They
// are lazily instantiated, accessed via the `_generatedMappings` and
// `_originalMappings` getters respectively, and we only parse the mappings
// and create these arrays once queried for a source location. We jump through
// these hoops because there can be many thousands of mappings, and parsing
// them is expensive, so we only want to do it if we must.
//
// Each object in the arrays is of the form:
//
//     {
//       generatedLine: The line number in the generated code,
//       generatedColumn: The column number in the generated code,
//       source: The path to the original source file that generated this
//               chunk of code,
//       originalLine: The line number in the original source that
//                     corresponds to this chunk of generated code,
//       originalColumn: The column number in the original source that
//                       corresponds to this chunk of generated code,
//       name: The name of the original symbol which generated this chunk of
//             code.
//     }
//
// All properties except for `generatedLine` and `generatedColumn` can be
// `null`.
//
// `_generatedMappings` is ordered by the generated positions.
//
// `_originalMappings` is ordered by the original positions.

SourceMapConsumer.prototype.__generatedMappings = null;
Object.defineProperty(SourceMapConsumer.prototype, '_generatedMappings', {
  configurable: true,
  enumerable: true,
  get: function () {
    if (!this.__generatedMappings) {
      this._parseMappings(this._mappings, this.sourceRoot);
    }

    return this.__generatedMappings;
  }
});

SourceMapConsumer.prototype.__originalMappings = null;
Object.defineProperty(SourceMapConsumer.prototype, '_originalMappings', {
  configurable: true,
  enumerable: true,
  get: function () {
    if (!this.__originalMappings) {
      this._parseMappings(this._mappings, this.sourceRoot);
    }

    return this.__originalMappings;
  }
});

SourceMapConsumer.prototype._charIsMappingSeparator =
  function SourceMapConsumer_charIsMappingSeparator(aStr, index) {
    var c = aStr.charAt(index);
    return c === ";" || c === ",";
  };

/**
 * Parse the mappings in a string in to a data structure which we can easily
 * query (the ordered arrays in the `this.__generatedMappings` and
 * `this.__originalMappings` properties).
 */
SourceMapConsumer.prototype._parseMappings =
  function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
    throw new Error("Subclasses must implement _parseMappings");
  };

SourceMapConsumer.GENERATED_ORDER = 1;
SourceMapConsumer.ORIGINAL_ORDER = 2;

SourceMapConsumer.GREATEST_LOWER_BOUND = 1;
SourceMapConsumer.LEAST_UPPER_BOUND = 2;

/**
 * Iterate over each mapping between an original source/line/column and a
 * generated line/column in this source map.
 *
 * @param Function aCallback
 *        The function that is called with each mapping.
 * @param Object aContext
 *        Optional. If specified, this object will be the value of `this` every
 *        time that `aCallback` is called.
 * @param aOrder
 *        Either `SourceMapConsumer.GENERATED_ORDER` or
 *        `SourceMapConsumer.ORIGINAL_ORDER`. Specifies whether you want to
 *        iterate over the mappings sorted by the generated file's line/column
 *        order or the original's source/line/column order, respectively. Defaults to
 *        `SourceMapConsumer.GENERATED_ORDER`.
 */
SourceMapConsumer.prototype.eachMapping =
  function SourceMapConsumer_eachMapping(aCallback, aContext, aOrder) {
    var context = aContext || null;
    var order = aOrder || SourceMapConsumer.GENERATED_ORDER;

    var mappings;
    switch (order) {
    case SourceMapConsumer.GENERATED_ORDER:
      mappings = this._generatedMappings;
      break;
    case SourceMapConsumer.ORIGINAL_ORDER:
      mappings = this._originalMappings;
      break;
    default:
      throw new Error("Unknown order of iteration.");
    }

    var sourceRoot = this.sourceRoot;
    var boundCallback = aCallback.bind(context);
    var names = this._names;
    var sources = this._sources;
    var sourceMapURL = this._sourceMapURL;

    for (var i = 0, n = mappings.length; i < n; i++) {
      var mapping = mappings[i];
      var source = mapping.source === null ? null : sources.at(mapping.source);
      if(source !== null) {
        source = util.computeSourceURL(sourceRoot, source, sourceMapURL);
      }
      boundCallback({
        source: source,
        generatedLine: mapping.generatedLine,
        generatedColumn: mapping.generatedColumn,
        originalLine: mapping.originalLine,
        originalColumn: mapping.originalColumn,
        name: mapping.name === null ? null : names.at(mapping.name)
      });
    }
  };

/**
 * Returns all generated line and column information for the original source,
 * line, and column provided. If no column is provided, returns all mappings
 * corresponding to a either the line we are searching for or the next
 * closest line that has any mappings. Otherwise, returns all mappings
 * corresponding to the given line and either the column we are searching for
 * or the next closest column that has any offsets.
 *
 * The only argument is an object with the following properties:
 *
 *   - source: The filename of the original source.
 *   - line: The line number in the original source.  The line number is 1-based.
 *   - column: Optional. the column number in the original source.
 *    The column number is 0-based.
 *
 * and an array of objects is returned, each with the following properties:
 *
 *   - line: The line number in the generated source, or null.  The
 *    line number is 1-based.
 *   - column: The column number in the generated source, or null.
 *    The column number is 0-based.
 */
SourceMapConsumer.prototype.allGeneratedPositionsFor =
  function SourceMapConsumer_allGeneratedPositionsFor(aArgs) {
    var line = util.getArg(aArgs, 'line');

    // When there is no exact match, BasicSourceMapConsumer.prototype._findMapping
    // returns the index of the closest mapping less than the needle. By
    // setting needle.originalColumn to 0, we thus find the last mapping for
    // the given line, provided such a mapping exists.
    var needle = {
      source: util.getArg(aArgs, 'source'),
      originalLine: line,
      originalColumn: util.getArg(aArgs, 'column', 0)
    };

    needle.source = this._findSourceIndex(needle.source);
    if (needle.source < 0) {
      return [];
    }

    var mappings = [];

    var index = this._findMapping(needle,
                                  this._originalMappings,
                                  "originalLine",
                                  "originalColumn",
                                  util.compareByOriginalPositions,
                                  binarySearch.LEAST_UPPER_BOUND);
    if (index >= 0) {
      var mapping = this._originalMappings[index];

      if (aArgs.column === undefined) {
        var originalLine = mapping.originalLine;

        // Iterate until either we run out of mappings, or we run into
        // a mapping for a different line than the one we found. Since
        // mappings are sorted, this is guaranteed to find all mappings for
        // the line we found.
        while (mapping && mapping.originalLine === originalLine) {
          mappings.push({
            line: util.getArg(mapping, 'generatedLine', null),
            column: util.getArg(mapping, 'generatedColumn', null),
            lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
          });

          mapping = this._originalMappings[++index];
        }
      } else {
        var originalColumn = mapping.originalColumn;

        // Iterate until either we run out of mappings, or we run into
        // a mapping for a different line than the one we were searching for.
        // Since mappings are sorted, this is guaranteed to find all mappings for
        // the line we are searching for.
        while (mapping &&
               mapping.originalLine === line &&
               mapping.originalColumn == originalColumn) {
          mappings.push({
            line: util.getArg(mapping, 'generatedLine', null),
            column: util.getArg(mapping, 'generatedColumn', null),
            lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
          });

          mapping = this._originalMappings[++index];
        }
      }
    }

    return mappings;
  };

exports.SourceMapConsumer = SourceMapConsumer;

/**
 * A BasicSourceMapConsumer instance represents a parsed source map which we can
 * query for information about the original file positions by giving it a file
 * position in the generated source.
 *
 * The first parameter is the raw source map (either as a JSON string, or
 * already parsed to an object). According to the spec, source maps have the
 * following attributes:
 *
 *   - version: Which version of the source map spec this map is following.
 *   - sources: An array of URLs to the original source files.
 *   - names: An array of identifiers which can be referrenced by individual mappings.
 *   - sourceRoot: Optional. The URL root from which all sources are relative.
 *   - sourcesContent: Optional. An array of contents of the original source files.
 *   - mappings: A string of base64 VLQs which contain the actual mappings.
 *   - file: Optional. The generated file this source map is associated with.
 *
 * Here is an example source map, taken from the source map spec[0]:
 *
 *     {
 *       version : 3,
 *       file: "out.js",
 *       sourceRoot : "",
 *       sources: ["foo.js", "bar.js"],
 *       names: ["src", "maps", "are", "fun"],
 *       mappings: "AA,AB;;ABCDE;"
 *     }
 *
 * The second parameter, if given, is a string whose value is the URL
 * at which the source map was found.  This URL is used to compute the
 * sources array.
 *
 * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit?pli=1#
 */
function BasicSourceMapConsumer(aSourceMap, aSourceMapURL) {
  var sourceMap = aSourceMap;
  if (typeof aSourceMap === 'string') {
    sourceMap = util.parseSourceMapInput(aSourceMap);
  }

  var version = util.getArg(sourceMap, 'version');
  var sources = util.getArg(sourceMap, 'sources');
  // Sass 3.3 leaves out the 'names' array, so we deviate from the spec (which
  // requires the array) to play nice here.
  var names = util.getArg(sourceMap, 'names', []);
  var sourceRoot = util.getArg(sourceMap, 'sourceRoot', null);
  var sourcesContent = util.getArg(sourceMap, 'sourcesContent', null);
  var mappings = util.getArg(sourceMap, 'mappings');
  var file = util.getArg(sourceMap, 'file', null);

  // Once again, Sass deviates from the spec and supplies the version as a
  // string rather than a number, so we use loose equality checking here.
  if (version != this._version) {
    throw new Error('Unsupported version: ' + version);
  }

  if (sourceRoot) {
    sourceRoot = util.normalize(sourceRoot);
  }

  sources = sources
    .map(String)
    // Some source maps produce relative source paths like "./foo.js" instead of
    // "foo.js".  Normalize these first so that future comparisons will succeed.
    // See bugzil.la/1090768.
    .map(util.normalize)
    // Always ensure that absolute sources are internally stored relative to
    // the source root, if the source root is absolute. Not doing this would
    // be particularly problematic when the source root is a prefix of the
    // source (valid, but why??). See github issue #199 and bugzil.la/1188982.
    .map(function (source) {
      return sourceRoot && util.isAbsolute(sourceRoot) && util.isAbsolute(source)
        ? util.relative(sourceRoot, source)
        : source;
    });

  // Pass `true` below to allow duplicate names and sources. While source maps
  // are intended to be compressed and deduplicated, the TypeScript compiler
  // sometimes generates source maps with duplicates in them. See Github issue
  // #72 and bugzil.la/889492.
  this._names = ArraySet.fromArray(names.map(String), true);
  this._sources = ArraySet.fromArray(sources, true);

  this._absoluteSources = this._sources.toArray().map(function (s) {
    return util.computeSourceURL(sourceRoot, s, aSourceMapURL);
  });

  this.sourceRoot = sourceRoot;
  this.sourcesContent = sourcesContent;
  this._mappings = mappings;
  this._sourceMapURL = aSourceMapURL;
  this.file = file;
}

BasicSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
BasicSourceMapConsumer.prototype.consumer = SourceMapConsumer;

/**
 * Utility function to find the index of a source.  Returns -1 if not
 * found.
 */
BasicSourceMapConsumer.prototype._findSourceIndex = function(aSource) {
  var relativeSource = aSource;
  if (this.sourceRoot != null) {
    relativeSource = util.relative(this.sourceRoot, relativeSource);
  }

  if (this._sources.has(relativeSource)) {
    return this._sources.indexOf(relativeSource);
  }

  // Maybe aSource is an absolute URL as returned by |sources|.  In
  // this case we can't simply undo the transform.
  var i;
  for (i = 0; i < this._absoluteSources.length; ++i) {
    if (this._absoluteSources[i] == aSource) {
      return i;
    }
  }

  return -1;
};

/**
 * Create a BasicSourceMapConsumer from a SourceMapGenerator.
 *
 * @param SourceMapGenerator aSourceMap
 *        The source map that will be consumed.
 * @param String aSourceMapURL
 *        The URL at which the source map can be found (optional)
 * @returns BasicSourceMapConsumer
 */
BasicSourceMapConsumer.fromSourceMap =
  function SourceMapConsumer_fromSourceMap(aSourceMap, aSourceMapURL) {
    var smc = Object.create(BasicSourceMapConsumer.prototype);

    var names = smc._names = ArraySet.fromArray(aSourceMap._names.toArray(), true);
    var sources = smc._sources = ArraySet.fromArray(aSourceMap._sources.toArray(), true);
    smc.sourceRoot = aSourceMap._sourceRoot;
    smc.sourcesContent = aSourceMap._generateSourcesContent(smc._sources.toArray(),
                                                            smc.sourceRoot);
    smc.file = aSourceMap._file;
    smc._sourceMapURL = aSourceMapURL;
    smc._absoluteSources = smc._sources.toArray().map(function (s) {
      return util.computeSourceURL(smc.sourceRoot, s, aSourceMapURL);
    });

    // Because we are modifying the entries (by converting string sources and
    // names to indices into the sources and names ArraySets), we have to make
    // a copy of the entry or else bad things happen. Shared mutable state
    // strikes again! See github issue #191.

    var generatedMappings = aSourceMap._mappings.toArray().slice();
    var destGeneratedMappings = smc.__generatedMappings = [];
    var destOriginalMappings = smc.__originalMappings = [];

    for (var i = 0, length = generatedMappings.length; i < length; i++) {
      var srcMapping = generatedMappings[i];
      var destMapping = new Mapping;
      destMapping.generatedLine = srcMapping.generatedLine;
      destMapping.generatedColumn = srcMapping.generatedColumn;

      if (srcMapping.source) {
        destMapping.source = sources.indexOf(srcMapping.source);
        destMapping.originalLine = srcMapping.originalLine;
        destMapping.originalColumn = srcMapping.originalColumn;

        if (srcMapping.name) {
          destMapping.name = names.indexOf(srcMapping.name);
        }

        destOriginalMappings.push(destMapping);
      }

      destGeneratedMappings.push(destMapping);
    }

    quickSort(smc.__originalMappings, util.compareByOriginalPositions);

    return smc;
  };

/**
 * The version of the source mapping spec that we are consuming.
 */
BasicSourceMapConsumer.prototype._version = 3;

/**
 * The list of original sources.
 */
Object.defineProperty(BasicSourceMapConsumer.prototype, 'sources', {
  get: function () {
    return this._absoluteSources.slice();
  }
});

/**
 * Provide the JIT with a nice shape / hidden class.
 */
function Mapping() {
  this.generatedLine = 0;
  this.generatedColumn = 0;
  this.source = null;
  this.originalLine = null;
  this.originalColumn = null;
  this.name = null;
}

/**
 * Parse the mappings in a string in to a data structure which we can easily
 * query (the ordered arrays in the `this.__generatedMappings` and
 * `this.__originalMappings` properties).
 */

const compareGenerated = util.compareByGeneratedPositionsDeflatedNoLine;
function sortGenerated(array, start) {
  let l = array.length;
  let n = array.length - start;
  if (n <= 1) {
    return;
  } else if (n == 2) {
    let a = array[start];
    let b = array[start + 1];
    if (compareGenerated(a, b) > 0) {
      array[start] = b;
      array[start + 1] = a;
    }
  } else if (n < 20) {
    for (let i = start; i < l; i++) {
      for (let j = i; j > start; j--) {
        let a = array[j - 1];
        let b = array[j];
        if (compareGenerated(a, b) <= 0) {
          break;
        }
        array[j - 1] = b;
        array[j] = a;
      }
    }
  } else {
    quickSort(array, compareGenerated, start);
  }
}
BasicSourceMapConsumer.prototype._parseMappings =
  function SourceMapConsumer_parseMappings(aStr, aSourceRoot) {
    var generatedLine = 1;
    var previousGeneratedColumn = 0;
    var previousOriginalLine = 0;
    var previousOriginalColumn = 0;
    var previousSource = 0;
    var previousName = 0;
    var length = aStr.length;
    var index = 0;
    var cachedSegments = {};
    var temp = {};
    var originalMappings = [];
    var generatedMappings = [];
    var mapping, str, segment, end, value;

    let subarrayStart = 0;
    while (index < length) {
      if (aStr.charAt(index) === ';') {
        generatedLine++;
        index++;
        previousGeneratedColumn = 0;

        sortGenerated(generatedMappings, subarrayStart);
        subarrayStart = generatedMappings.length;
      }
      else if (aStr.charAt(index) === ',') {
        index++;
      }
      else {
        mapping = new Mapping();
        mapping.generatedLine = generatedLine;

        for (end = index; end < length; end++) {
          if (this._charIsMappingSeparator(aStr, end)) {
            break;
          }
        }
        str = aStr.slice(index, end);

        segment = [];
        while (index < end) {
          base64VLQ.decode(aStr, index, temp);
          value = temp.value;
          index = temp.rest;
          segment.push(value);
        }

        if (segment.length === 2) {
          throw new Error('Found a source, but no line and column');
        }

        if (segment.length === 3) {
          throw new Error('Found a source and line, but no column');
        }

        // Generated column.
        mapping.generatedColumn = previousGeneratedColumn + segment[0];
        previousGeneratedColumn = mapping.generatedColumn;

        if (segment.length > 1) {
          // Original source.
          mapping.source = previousSource + segment[1];
          previousSource += segment[1];

          // Original line.
          mapping.originalLine = previousOriginalLine + segment[2];
          previousOriginalLine = mapping.originalLine;
          // Lines are stored 0-based
          mapping.originalLine += 1;

          // Original column.
          mapping.originalColumn = previousOriginalColumn + segment[3];
          previousOriginalColumn = mapping.originalColumn;

          if (segment.length > 4) {
            // Original name.
            mapping.name = previousName + segment[4];
            previousName += segment[4];
          }
        }

        generatedMappings.push(mapping);
        if (typeof mapping.originalLine === 'number') {
          let currentSource = mapping.source;
          while (originalMappings.length <= currentSource) {
            originalMappings.push(null);
          }
          if (originalMappings[currentSource] === null) {
            originalMappings[currentSource] = [];
          }
          originalMappings[currentSource].push(mapping);
        }
      }
    }

    sortGenerated(generatedMappings, subarrayStart);
    this.__generatedMappings = generatedMappings;

    for (var i = 0; i < originalMappings.length; i++) {
      if (originalMappings[i] != null) {
        quickSort(originalMappings[i], util.compareByOriginalPositionsNoSource);
      }
    }
    this.__originalMappings = [].concat(...originalMappings);
  };

/**
 * Find the mapping that best matches the hypothetical "needle" mapping that
 * we are searching for in the given "haystack" of mappings.
 */
BasicSourceMapConsumer.prototype._findMapping =
  function SourceMapConsumer_findMapping(aNeedle, aMappings, aLineName,
                                         aColumnName, aComparator, aBias) {
    // To return the position we are searching for, we must first find the
    // mapping for the given position and then return the opposite position it
    // points to. Because the mappings are sorted, we can use binary search to
    // find the best mapping.

    if (aNeedle[aLineName] <= 0) {
      throw new TypeError('Line must be greater than or equal to 1, got '
                          + aNeedle[aLineName]);
    }
    if (aNeedle[aColumnName] < 0) {
      throw new TypeError('Column must be greater than or equal to 0, got '
                          + aNeedle[aColumnName]);
    }

    return binarySearch.search(aNeedle, aMappings, aComparator, aBias);
  };

/**
 * Compute the last column for each generated mapping. The last column is
 * inclusive.
 */
BasicSourceMapConsumer.prototype.computeColumnSpans =
  function SourceMapConsumer_computeColumnSpans() {
    for (var index = 0; index < this._generatedMappings.length; ++index) {
      var mapping = this._generatedMappings[index];

      // Mappings do not contain a field for the last generated columnt. We
      // can come up with an optimistic estimate, however, by assuming that
      // mappings are contiguous (i.e. given two consecutive mappings, the
      // first mapping ends where the second one starts).
      if (index + 1 < this._generatedMappings.length) {
        var nextMapping = this._generatedMappings[index + 1];

        if (mapping.generatedLine === nextMapping.generatedLine) {
          mapping.lastGeneratedColumn = nextMapping.generatedColumn - 1;
          continue;
        }
      }

      // The last mapping for each line spans the entire line.
      mapping.lastGeneratedColumn = Infinity;
    }
  };

/**
 * Returns the original source, line, and column information for the generated
 * source's line and column positions provided. The only argument is an object
 * with the following properties:
 *
 *   - line: The line number in the generated source.  The line number
 *     is 1-based.
 *   - column: The column number in the generated source.  The column
 *     number is 0-based.
 *   - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
 *     'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
 *     closest element that is smaller than or greater than the one we are
 *     searching for, respectively, if the exact element cannot be found.
 *     Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
 *
 * and an object is returned with the following properties:
 *
 *   - source: The original source file, or null.
 *   - line: The line number in the original source, or null.  The
 *     line number is 1-based.
 *   - column: The column number in the original source, or null.  The
 *     column number is 0-based.
 *   - name: The original identifier, or null.
 */
BasicSourceMapConsumer.prototype.originalPositionFor =
  function SourceMapConsumer_originalPositionFor(aArgs) {
    var needle = {
      generatedLine: util.getArg(aArgs, 'line'),
      generatedColumn: util.getArg(aArgs, 'column')
    };

    var index = this._findMapping(
      needle,
      this._generatedMappings,
      "generatedLine",
      "generatedColumn",
      util.compareByGeneratedPositionsDeflated,
      util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
    );

    if (index >= 0) {
      var mapping = this._generatedMappings[index];

      if (mapping.generatedLine === needle.generatedLine) {
        var source = util.getArg(mapping, 'source', null);
        if (source !== null) {
          source = this._sources.at(source);
          source = util.computeSourceURL(this.sourceRoot, source, this._sourceMapURL);
        }
        var name = util.getArg(mapping, 'name', null);
        if (name !== null) {
          name = this._names.at(name);
        }
        return {
          source: source,
          line: util.getArg(mapping, 'originalLine', null),
          column: util.getArg(mapping, 'originalColumn', null),
          name: name
        };
      }
    }

    return {
      source: null,
      line: null,
      column: null,
      name: null
    };
  };

/**
 * Return true if we have the source content for every source in the source
 * map, false otherwise.
 */
BasicSourceMapConsumer.prototype.hasContentsOfAllSources =
  function BasicSourceMapConsumer_hasContentsOfAllSources() {
    if (!this.sourcesContent) {
      return false;
    }
    return this.sourcesContent.length >= this._sources.size() &&
      !this.sourcesContent.some(function (sc) { return sc == null; });
  };

/**
 * Returns the original source content. The only argument is the url of the
 * original source file. Returns null if no original source content is
 * available.
 */
BasicSourceMapConsumer.prototype.sourceContentFor =
  function SourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
    if (!this.sourcesContent) {
      return null;
    }

    var index = this._findSourceIndex(aSource);
    if (index >= 0) {
      return this.sourcesContent[index];
    }

    var relativeSource = aSource;
    if (this.sourceRoot != null) {
      relativeSource = util.relative(this.sourceRoot, relativeSource);
    }

    var url;
    if (this.sourceRoot != null
        && (url = util.urlParse(this.sourceRoot))) {
      // XXX: file:// URIs and absolute paths lead to unexpected behavior for
      // many users. We can help them out when they expect file:// URIs to
      // behave like it would if they were running a local HTTP server. See
      // https://bugzilla.mozilla.org/show_bug.cgi?id=885597.
      var fileUriAbsPath = relativeSource.replace(/^file:\/\//, "");
      if (url.scheme == "file"
          && this._sources.has(fileUriAbsPath)) {
        return this.sourcesContent[this._sources.indexOf(fileUriAbsPath)]
      }

      if ((!url.path || url.path == "/")
          && this._sources.has("/" + relativeSource)) {
        return this.sourcesContent[this._sources.indexOf("/" + relativeSource)];
      }
    }

    // This function is used recursively from
    // IndexedSourceMapConsumer.prototype.sourceContentFor. In that case, we
    // don't want to throw if we can't find the source - we just want to
    // return null, so we provide a flag to exit gracefully.
    if (nullOnMissing) {
      return null;
    }
    else {
      throw new Error('"' + relativeSource + '" is not in the SourceMap.');
    }
  };

/**
 * Returns the generated line and column information for the original source,
 * line, and column positions provided. The only argument is an object with
 * the following properties:
 *
 *   - source: The filename of the original source.
 *   - line: The line number in the original source.  The line number
 *     is 1-based.
 *   - column: The column number in the original source.  The column
 *     number is 0-based.
 *   - bias: Either 'SourceMapConsumer.GREATEST_LOWER_BOUND' or
 *     'SourceMapConsumer.LEAST_UPPER_BOUND'. Specifies whether to return the
 *     closest element that is smaller than or greater than the one we are
 *     searching for, respectively, if the exact element cannot be found.
 *     Defaults to 'SourceMapConsumer.GREATEST_LOWER_BOUND'.
 *
 * and an object is returned with the following properties:
 *
 *   - line: The line number in the generated source, or null.  The
 *     line number is 1-based.
 *   - column: The column number in the generated source, or null.
 *     The column number is 0-based.
 */
BasicSourceMapConsumer.prototype.generatedPositionFor =
  function SourceMapConsumer_generatedPositionFor(aArgs) {
    var source = util.getArg(aArgs, 'source');
    source = this._findSourceIndex(source);
    if (source < 0) {
      return {
        line: null,
        column: null,
        lastColumn: null
      };
    }

    var needle = {
      source: source,
      originalLine: util.getArg(aArgs, 'line'),
      originalColumn: util.getArg(aArgs, 'column')
    };

    var index = this._findMapping(
      needle,
      this._originalMappings,
      "originalLine",
      "originalColumn",
      util.compareByOriginalPositions,
      util.getArg(aArgs, 'bias', SourceMapConsumer.GREATEST_LOWER_BOUND)
    );

    if (index >= 0) {
      var mapping = this._originalMappings[index];

      if (mapping.source === needle.source) {
        return {
          line: util.getArg(mapping, 'generatedLine', null),
          column: util.getArg(mapping, 'generatedColumn', null),
          lastColumn: util.getArg(mapping, 'lastGeneratedColumn', null)
        };
      }
    }

    return {
      line: null,
      column: null,
      lastColumn: null
    };
  };

exports.BasicSourceMapConsumer = BasicSourceMapConsumer;

/**
 * An IndexedSourceMapConsumer instance represents a parsed source map which
 * we can query for information. It differs from BasicSourceMapConsumer in
 * that it takes "indexed" source maps (i.e. ones with a "sections" field) as
 * input.
 *
 * The first parameter is a raw source map (either as a JSON string, or already
 * parsed to an object). According to the spec for indexed source maps, they
 * have the following attributes:
 *
 *   - version: Which version of the source map spec this map is following.
 *   - file: Optional. The generated file this source map is associated with.
 *   - sections: A list of section definitions.
 *
 * Each value under the "sections" field has two fields:
 *   - offset: The offset into the original specified at which this section
 *       begins to apply, defined as an object with a "line" and "column"
 *       field.
 *   - map: A source map definition. This source map could also be indexed,
 *       but doesn't have to be.
 *
 * Instead of the "map" field, it's also possible to have a "url" field
 * specifying a URL to retrieve a source map from, but that's currently
 * unsupported.
 *
 * Here's an example source map, taken from the source map spec[0], but
 * modified to omit a section which uses the "url" field.
 *
 *  {
 *    version : 3,
 *    file: "app.js",
 *    sections: [{
 *      offset: {line:100, column:10},
 *      map: {
 *        version : 3,
 *        file: "section.js",
 *        sources: ["foo.js", "bar.js"],
 *        names: ["src", "maps", "are", "fun"],
 *        mappings: "AAAA,E;;ABCDE;"
 *      }
 *    }],
 *  }
 *
 * The second parameter, if given, is a string whose value is the URL
 * at which the source map was found.  This URL is used to compute the
 * sources array.
 *
 * [0]: https://docs.google.com/document/d/1U1RGAehQwRypUTovF1KRlpiOFze0b-_2gc6fAH0KY0k/edit#heading=h.535es3xeprgt
 */
function IndexedSourceMapConsumer(aSourceMap, aSourceMapURL) {
  var sourceMap = aSourceMap;
  if (typeof aSourceMap === 'string') {
    sourceMap = util.parseSourceMapInput(aSourceMap);
  }

  var version = util.getArg(sourceMap, 'version');
  var sections = util.getArg(sourceMap, 'sections');

  if (version != this._version) {
    throw new Error('Unsupported version: ' + version);
  }

  this._sources = new ArraySet();
  this._names = new ArraySet();

  var lastOffset = {
    line: -1,
    column: 0
  };
  this._sections = sections.map(function (s) {
    if (s.url) {
      // The url field will require support for asynchronicity.
      // See https://github.com/mozilla/source-map/issues/16
      throw new Error('Support for url field in sections not implemented.');
    }
    var offset = util.getArg(s, 'offset');
    var offsetLine = util.getArg(offset, 'line');
    var offsetColumn = util.getArg(offset, 'column');

    if (offsetLine < lastOffset.line ||
        (offsetLine === lastOffset.line && offsetColumn < lastOffset.column)) {
      throw new Error('Section offsets must be ordered and non-overlapping.');
    }
    lastOffset = offset;

    return {
      generatedOffset: {
        // The offset fields are 0-based, but we use 1-based indices when
        // encoding/decoding from VLQ.
        generatedLine: offsetLine + 1,
        generatedColumn: offsetColumn + 1
      },
      consumer: new SourceMapConsumer(util.getArg(s, 'map'), aSourceMapURL)
    }
  });
}

IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;

/**
 * The version of the source mapping spec that we are consuming.
 */
IndexedSourceMapConsumer.prototype._version = 3;

/**
 * The list of original sources.
 */
Object.defineProperty(IndexedSourceMapConsumer.prototype, 'sources', {
  get: function () {
    var sources = [];
    for (var i = 0; i < this._sections.length; i++) {
      for (var j = 0; j < this._sections[i].consumer.sources.length; j++) {
        sources.push(this._sections[i].consumer.sources[j]);
      }
    }
    return sources;
  }
});

/**
 * Returns the original source, line, and column information for the generated
 * source's line and column positions provided. The only argument is an object
 * with the following properties:
 *
 *   - line: The line number in the generated source.  The line number
 *     is 1-based.
 *   - column: The column number in the generated source.  The column
 *     number is 0-based.
 *
 * and an object is returned with the following properties:
 *
 *   - source: The original source file, or null.
 *   - line: The line number in the original source, or null.  The
 *     line number is 1-based.
 *   - column: The column number in the original source, or null.  The
 *     column number is 0-based.
 *   - name: The original identifier, or null.
 */
IndexedSourceMapConsumer.prototype.originalPositionFor =
  function IndexedSourceMapConsumer_originalPositionFor(aArgs) {
    var needle = {
      generatedLine: util.getArg(aArgs, 'line'),
      generatedColumn: util.getArg(aArgs, 'column')
    };

    // Find the section containing the generated position we're trying to map
    // to an original position.
    var sectionIndex = binarySearch.search(needle, this._sections,
      function(needle, section) {
        var cmp = needle.generatedLine - section.generatedOffset.generatedLine;
        if (cmp) {
          return cmp;
        }

        return (needle.generatedColumn -
                section.generatedOffset.generatedColumn);
      });
    var section = this._sections[sectionIndex];

    if (!section) {
      return {
        source: null,
        line: null,
        column: null,
        name: null
      };
    }

    return section.consumer.originalPositionFor({
      line: needle.generatedLine -
        (section.generatedOffset.generatedLine - 1),
      column: needle.generatedColumn -
        (section.generatedOffset.generatedLine === needle.generatedLine
         ? section.generatedOffset.generatedColumn - 1
         : 0),
      bias: aArgs.bias
    });
  };

/**
 * Return true if we have the source content for every source in the source
 * map, false otherwise.
 */
IndexedSourceMapConsumer.prototype.hasContentsOfAllSources =
  function IndexedSourceMapConsumer_hasContentsOfAllSources() {
    return this._sections.every(function (s) {
      return s.consumer.hasContentsOfAllSources();
    });
  };

/**
 * Returns the original source content. The only argument is the url of the
 * original source file. Returns null if no original source content is
 * available.
 */
IndexedSourceMapConsumer.prototype.sourceContentFor =
  function IndexedSourceMapConsumer_sourceContentFor(aSource, nullOnMissing) {
    for (var i = 0; i < this._sections.length; i++) {
      var section = this._sections[i];

      var content = section.consumer.sourceContentFor(aSource, true);
      if (content || content === '') {
        return content;
      }
    }
    if (nullOnMissing) {
      return null;
    }
    else {
      throw new Error('"' + aSource + '" is not in the SourceMap.');
    }
  };

/**
 * Returns the generated line and column information for the original source,
 * line, and column positions provided. The only argument is an object with
 * the following properties:
 *
 *   - source: The filename of the original source.
 *   - line: The line number in the original source.  The line number
 *     is 1-based.
 *   - column: The column number in the original source.  The column
 *     number is 0-based.
 *
 * and an object is returned with the following properties:
 *
 *   - line: The line number in the generated source, or null.  The
 *     line number is 1-based. 
 *   - column: The column number in the generated source, or null.
 *     The column number is 0-based.
 */
IndexedSourceMapConsumer.prototype.generatedPositionFor =
  function IndexedSourceMapConsumer_generatedPositionFor(aArgs) {
    for (var i = 0; i < this._sections.length; i++) {
      var section = this._sections[i];

      // Only consider this section if the requested source is in the list of
      // sources of the consumer.
      if (section.consumer._findSourceIndex(util.getArg(aArgs, 'source')) === -1) {
        continue;
      }
      var generatedPosition = section.consumer.generatedPositionFor(aArgs);
      if (generatedPosition) {
        var ret = {
          line: generatedPosition.line +
            (section.generatedOffset.generatedLine - 1),
          column: generatedPosition.column +
            (section.generatedOffset.generatedLine === generatedPosition.line
             ? section.generatedOffset.generatedColumn - 1
             : 0)
        };
        return ret;
      }
    }

    return {
      line: null,
      column: null
    };
  };

/**
 * Parse the mappings in a string in to a data structure which we can easily
 * query (the ordered arrays in the `this.__generatedMappings` and
 * `this.__originalMappings` properties).
 */
IndexedSourceMapConsumer.prototype._parseMappings =
  function IndexedSourceMapConsumer_parseMappings(aStr, aSourceRoot) {
    this.__generatedMappings = [];
    this.__originalMappings = [];
    for (var i = 0; i < this._sections.length; i++) {
      var section = this._sections[i];
      var sectionMappings = section.consumer._generatedMappings;
      for (var j = 0; j < sectionMappings.length; j++) {
        var mapping = sectionMappings[j];

        var source = section.consumer._sources.at(mapping.source);
        if(source !== null) {
          source = util.computeSourceURL(section.consumer.sourceRoot, source, this._sourceMapURL);
        }
        this._sources.add(source);
        source = this._sources.indexOf(source);

        var name = null;
        if (mapping.name) {
          name = section.consumer._names.at(mapping.name);
          this._names.add(name);
          name = this._names.indexOf(name);
        }

        // The mappings coming from the consumer for the section have
        // generated positions relative to the start of the section, so we
        // need to offset them to be relative to the start of the concatenated
        // generated file.
        var adjustedMapping = {
          source: source,
          generatedLine: mapping.generatedLine +
            (section.generatedOffset.generatedLine - 1),
          generatedColumn: mapping.generatedColumn +
            (section.generatedOffset.generatedLine === mapping.generatedLine
            ? section.generatedOffset.generatedColumn - 1
            : 0),
          originalLine: mapping.originalLine,
          originalColumn: mapping.originalColumn,
          name: name
        };

        this.__generatedMappings.push(adjustedMapping);
        if (typeof adjustedMapping.originalLine === 'number') {
          this.__originalMappings.push(adjustedMapping);
        }
      }
    }

    quickSort(this.__generatedMappings, util.compareByGeneratedPositionsDeflated);
    quickSort(this.__originalMappings, util.compareByOriginalPositions);
  };

exports.IndexedSourceMapConsumer = IndexedSourceMapConsumer;
9x) export { SourceMapGenerator } from '..';
DxU:/* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
 * http://opensource.org/licenses/BSD-3-Clause
 */

var base64VLQ = require('./base64-vlq');
var util = require('./util');
var ArraySet = require('./array-set').ArraySet;
var MappingList = require('./mapping-list').MappingList;

/**
 * An instance of the SourceMapGenerator represents a source map which is
 * being built incrementally. You may pass an object with the following
 * properties:
 *
 *   - file: The filename of the generated source.
 *   - sourceRoot: A root for all relative URLs in this source map.
 */
function SourceMapGenerator(aArgs) {
  if (!aArgs) {
    aArgs = {};
  }
  this._file = util.getArg(aArgs, 'file', null);
  this._sourceRoot = util.getArg(aArgs, 'sourceRoot', null);
  this._skipValidation = util.getArg(aArgs, 'skipValidation', false);
  this._ignoreInvalidMapping = util.getArg(aArgs, 'ignoreInvalidMapping', false);
  this._sources = new ArraySet();
  this._names = new ArraySet();
  this._mappings = new MappingList();
  this._sourcesContents = null;
}

SourceMapGenerator.prototype._version = 3;

/**
 * Creates a new SourceMapGenerator based on a SourceMapConsumer
 *
 * @param aSourceMapConsumer The SourceMap.
 */
SourceMapGenerator.fromSourceMap =
  function SourceMapGenerator_fromSourceMap(aSourceMapConsumer, generatorOps) {
    var sourceRoot = aSourceMapConsumer.sourceRoot;
    var generator = new SourceMapGenerator(Object.assign(generatorOps || {}, {
      file: aSourceMapConsumer.file,
      sourceRoot: sourceRoot
    }));
    aSourceMapConsumer.eachMapping(function (mapping) {
      var newMapping = {
        generated: {
          line: mapping.generatedLine,
          column: mapping.generatedColumn
        }
      };

      if (mapping.source != null) {
        newMapping.source = mapping.source;
        if (sourceRoot != null) {
          newMapping.source = util.relative(sourceRoot, newMapping.source);
        }

        newMapping.original = {
          line: mapping.originalLine,
          column: mapping.originalColumn
        };

        if (mapping.name != null) {
          newMapping.name = mapping.name;
        }
      }

      generator.addMapping(newMapping);
    });
    aSourceMapConsumer.sources.forEach(function (sourceFile) {
      var sourceRelative = sourceFile;
      if (sourceRoot !== null) {
        sourceRelative = util.relative(sourceRoot, sourceFile);
      }

      if (!generator._sources.has(sourceRelative)) {
        generator._sources.add(sourceRelative);
      }

      var content = aSourceMapConsumer.sourceContentFor(sourceFile);
      if (content != null) {
        generator.setSourceContent(sourceFile, content);
      }
    });
    return generator;
  };

/**
 * Add a single mapping from original source line and column to the generated
 * source's line and column for this source map being created. The mapping
 * object should have the following properties:
 *
 *   - generated: An object with the generated line and column positions.
 *   - original: An object with the original line and column positions.
 *   - source: The original source file (relative to the sourceRoot).
 *   - name: An optional original token name for this mapping.
 */
SourceMapGenerator.prototype.addMapping =
  function SourceMapGenerator_addMapping(aArgs) {
    var generated = util.getArg(aArgs, 'generated');
    var original = util.getArg(aArgs, 'original', null);
    var source = util.getArg(aArgs, 'source', null);
    var name = util.getArg(aArgs, 'name', null);

    if (!this._skipValidation) {
      if (this._validateMapping(generated, original, source, name) === false) {
        return;
      }
    }

    if (source != null) {
      source = String(source);
      if (!this._sources.has(source)) {
        this._sources.add(source);
      }
    }

    if (name != null) {
      name = String(name);
      if (!this._names.has(name)) {
        this._names.add(name);
      }
    }

    this._mappings.add({
      generatedLine: generated.line,
      generatedColumn: generated.column,
      originalLine: original != null && original.line,
      originalColumn: original != null && original.column,
      source: source,
      name: name
    });
  };

/**
 * Set the source content for a source file.
 */
SourceMapGenerator.prototype.setSourceContent =
  function SourceMapGenerator_setSourceContent(aSourceFile, aSourceContent) {
    var source = aSourceFile;
    if (this._sourceRoot != null) {
      source = util.relative(this._sourceRoot, source);
    }

    if (aSourceContent != null) {
      // Add the source content to the _sourcesContents map.
      // Create a new _sourcesContents map if the property is null.
      if (!this._sourcesContents) {
        this._sourcesContents = Object.create(null);
      }
      this._sourcesContents[util.toSetString(source)] = aSourceContent;
    } else if (this._sourcesContents) {
      // Remove the source file from the _sourcesContents map.
      // If the _sourcesContents map is empty, set the property to null.
      delete this._sourcesContents[util.toSetString(source)];
      if (Object.keys(this._sourcesContents).length === 0) {
        this._sourcesContents = null;
      }
    }
  };

/**
 * Applies the mappings of a sub-source-map for a specific source file to the
 * source map being generated. Each mapping to the supplied source file is
 * rewritten using the supplied source map. Note: The resolution for the
 * resulting mappings is the minimium of this map and the supplied map.
 *
 * @param aSourceMapConsumer The source map to be applied.
 * @param aSourceFile Optional. The filename of the source file.
 *        If omitted, SourceMapConsumer's file property will be used.
 * @param aSourceMapPath Optional. The dirname of the path to the source map
 *        to be applied. If relative, it is relative to the SourceMapConsumer.
 *        This parameter is needed when the two source maps aren't in the same
 *        directory, and the source map to be applied contains relative source
 *        paths. If so, those relative source paths need to be rewritten
 *        relative to the SourceMapGenerator.
 */
SourceMapGenerator.prototype.applySourceMap =
  function SourceMapGenerator_applySourceMap(aSourceMapConsumer, aSourceFile, aSourceMapPath) {
    var sourceFile = aSourceFile;
    // If aSourceFile is omitted, we will use the file property of the SourceMap
    if (aSourceFile == null) {
      if (aSourceMapConsumer.file == null) {
        throw new Error(
          'SourceMapGenerator.prototype.applySourceMap requires either an explicit source file, ' +
          'or the source map\'s "file" property. Both were omitted.'
        );
      }
      sourceFile = aSourceMapConsumer.file;
    }
    var sourceRoot = this._sourceRoot;
    // Make "sourceFile" relative if an absolute Url is passed.
    if (sourceRoot != null) {
      sourceFile = util.relative(sourceRoot, sourceFile);
    }
    // Applying the SourceMap can add and remove items from the sources and
    // the names array.
    var newSources = new ArraySet();
    var newNames = new ArraySet();

    // Find mappings for the "sourceFile"
    this._mappings.unsortedForEach(function (mapping) {
      if (mapping.source === sourceFile && mapping.originalLine != null) {
        // Check if it can be mapped by the source map, then update the mapping.
        var original = aSourceMapConsumer.originalPositionFor({
          line: mapping.originalLine,
          column: mapping.originalColumn
        });
        if (original.source != null) {
          // Copy mapping
          mapping.source = original.source;
          if (aSourceMapPath != null) {
            mapping.source = util.join(aSourceMapPath, mapping.source)
          }
          if (sourceRoot != null) {
            mapping.source = util.relative(sourceRoot, mapping.source);
          }
          mapping.originalLine = original.line;
          mapping.originalColumn = original.column;
          if (original.name != null) {
            mapping.name = original.name;
          }
        }
      }

      var source = mapping.source;
      if (source != null && !newSources.has(source)) {
        newSources.add(source);
      }

      var name = mapping.name;
      if (name != null && !newNames.has(name)) {
        newNames.add(name);
      }

    }, this);
    this._sources = newSources;
    this._names = newNames;

    // Copy sourcesContents of applied map.
    aSourceMapConsumer.sources.forEach(function (sourceFile) {
      var content = aSourceMapConsumer.sourceContentFor(sourceFile);
      if (content != null) {
        if (aSourceMapPath != null) {
          sourceFile = util.join(aSourceMapPath, sourceFile);
        }
        if (sourceRoot != null) {
          sourceFile = util.relative(sourceRoot, sourceFile);
        }
        this.setSourceContent(sourceFile, content);
      }
    }, this);
  };

/**
 * A mapping can have one of the three levels of data:
 *
 *   1. Just the generated position.
 *   2. The Generated position, original position, and original source.
 *   3. Generated and original position, original source, as well as a name
 *      token.
 *
 * To maintain consistency, we validate that any new mapping being added falls
 * in to one of these categories.
 */
SourceMapGenerator.prototype._validateMapping =
  function SourceMapGenerator_validateMapping(aGenerated, aOriginal, aSource,
                                              aName) {
    // When aOriginal is truthy but has empty values for .line and .column,
    // it is most likely a programmer error. In this case we throw a very
    // specific error message to try to guide them the right way.
    // For example: https://github.com/Polymer/polymer-bundler/pull/519
    if (aOriginal && typeof aOriginal.line !== 'number' && typeof aOriginal.column !== 'number') {
      var message = 'original.line and original.column are not numbers -- you probably meant to omit ' +
      'the original mapping entirely and only map the generated position. If so, pass ' +
      'null for the original mapping instead of an object with empty or null values.'

      if (this._ignoreInvalidMapping) {
        if (typeof console !== 'undefined' && console.warn) {
          console.warn(message);
        }
        return false;
      } else {
        throw new Error(message);
      }
    }

    if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
        && aGenerated.line > 0 && aGenerated.column >= 0
        && !aOriginal && !aSource && !aName) {
      // Case 1.
      return;
    }
    else if (aGenerated && 'line' in aGenerated && 'column' in aGenerated
             && aOriginal && 'line' in aOriginal && 'column' in aOriginal
             && aGenerated.line > 0 && aGenerated.column >= 0
             && aOriginal.line > 0 && aOriginal.column >= 0
             && aSource) {
      // Cases 2 and 3.
      return;
    }
    else {
      var message = 'Invalid mapping: ' + JSON.stringify({
        generated: aGenerated,
        source: aSource,
        original: aOriginal,
        name: aName
      });

      if (this._ignoreInvalidMapping) {
        if (typeof console !== 'undefined' && console.warn) {
          console.warn(message);
        }
        return false;
      } else {
        throw new Error(message)
      }
    }
  };

/**
 * Serialize the accumulated mappings in to the stream of base 64 VLQs
 * specified by the source map format.
 */
SourceMapGenerator.prototype._serializeMappings =
  function SourceMapGenerator_serializeMappings() {
    var previousGeneratedColumn = 0;
    var previousGeneratedLine = 1;
    var previousOriginalColumn = 0;
    var previousOriginalLine = 0;
    var previousName = 0;
    var previousSource = 0;
    var result = '';
    var next;
    var mapping;
    var nameIdx;
    var sourceIdx;

    var mappings = this._mappings.toArray();
    for (var i = 0, len = mappings.length; i < len; i++) {
      mapping = mappings[i];
      next = ''

      if (mapping.generatedLine !== previousGeneratedLine) {
        previousGeneratedColumn = 0;
        while (mapping.generatedLine !== previousGeneratedLine) {
          next += ';';
          previousGeneratedLine++;
        }
      }
      else {
        if (i > 0) {
          if (!util.compareByGeneratedPositionsInflated(mapping, mappings[i - 1])) {
            continue;
          }
          next += ',';
        }
      }

      next += base64VLQ.encode(mapping.generatedColumn
                                 - previousGeneratedColumn);
      previousGeneratedColumn = mapping.generatedColumn;

      if (mapping.source != null) {
        sourceIdx = this._sources.indexOf(mapping.source);
        next += base64VLQ.encode(sourceIdx - previousSource);
        previousSource = sourceIdx;

        // lines are stored 0-based in SourceMap spec version 3
        next += base64VLQ.encode(mapping.originalLine - 1
                                   - previousOriginalLine);
        previousOriginalLine = mapping.originalLine - 1;

        next += base64VLQ.encode(mapping.originalColumn
                                   - previousOriginalColumn);
        previousOriginalColumn = mapping.originalColumn;

        if (mapping.name != null) {
          nameIdx = this._names.indexOf(mapping.name);
          next += base64VLQ.encode(nameIdx - previousName);
          previousName = nameIdx;
        }
      }

      result += next;
    }

    return result;
  };

SourceMapGenerator.prototype._generateSourcesContent =
  function SourceMapGenerator_generateSourcesContent(aSources, aSourceRoot) {
    return aSources.map(function (source) {
      if (!this._sourcesContents) {
        return null;
      }
      if (aSourceRoot != null) {
        source = util.relative(aSourceRoot, source);
      }
      var key = util.toSetString(source);
      return Object.prototype.hasOwnProperty.call(this._sourcesContents, key)
        ? this._sourcesContents[key]
        : null;
    }, this);
  };

/**
 * Externalize the source map.
 */
SourceMapGenerator.prototype.toJSON =
  function SourceMapGenerator_toJSON() {
    var map = {
      version: this._version,
      sources: this._sources.toArray(),
      names: this._names.toArray(),
      mappings: this._serializeMappings()
    };
    if (this._file != null) {
      map.file = this._file;
    }
    if (this._sourceRoot != null) {
      map.sourceRoot = this._sourceRoot;
    }
    if (this._sourcesContents) {
      map.sourcesContent = this._generateSourcesContent(map.sources, map.sourceRoot);
    }

    return map;
  };

/**
 * Render the source map being generated to a string.
 */
SourceMapGenerator.prototype.toString =
  function SourceMapGenerator_toString() {
    return JSON.stringify(this.toJSON());
  };

exports.SourceMapGenerator = SourceMapGenerator;
Qlyx! export { SourceNode } from '..';

հx5/* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
 * http://opensource.org/licenses/BSD-3-Clause
 */

var SourceMapGenerator = require('./source-map-generator').SourceMapGenerator;
var util = require('./util');

// Matches a Windows-style `\r\n` newline or a `\n` newline used by all other
// operating systems these days (capturing the result).
var REGEX_NEWLINE = /(\r?\n)/;

// Newline character code for charCodeAt() comparisons
var NEWLINE_CODE = 10;

// Private symbol for identifying `SourceNode`s when multiple versions of
// the source-map library are loaded. This MUST NOT CHANGE across
// versions!
var isSourceNode = "$$$isSourceNode$$$";

/**
 * SourceNodes provide a way to abstract over interpolating/concatenating
 * snippets of generated JavaScript source code while maintaining the line and
 * column information associated with the original source code.
 *
 * @param aLine The original line number.
 * @param aColumn The original column number.
 * @param aSource The original source's filename.
 * @param aChunks Optional. An array of strings which are snippets of
 *        generated JS, or other SourceNodes.
 * @param aName The original identifier.
 */
function SourceNode(aLine, aColumn, aSource, aChunks, aName) {
  this.children = [];
  this.sourceContents = {};
  this.line = aLine == null ? null : aLine;
  this.column = aColumn == null ? null : aColumn;
  this.source = aSource == null ? null : aSource;
  this.name = aName == null ? null : aName;
  this[isSourceNode] = true;
  if (aChunks != null) this.add(aChunks);
}

/**
 * Creates a SourceNode from generated code and a SourceMapConsumer.
 *
 * @param aGeneratedCode The generated code
 * @param aSourceMapConsumer The SourceMap for the generated code
 * @param aRelativePath Optional. The path that relative sources in the
 *        SourceMapConsumer should be relative to.
 */
SourceNode.fromStringWithSourceMap =
  function SourceNode_fromStringWithSourceMap(aGeneratedCode, aSourceMapConsumer, aRelativePath) {
    // The SourceNode we want to fill with the generated code
    // and the SourceMap
    var node = new SourceNode();

    // All even indices of this array are one line of the generated code,
    // while all odd indices are the newlines between two adjacent lines
    // (since `REGEX_NEWLINE` captures its match).
    // Processed fragments are accessed by calling `shiftNextLine`.
    var remainingLines = aGeneratedCode.split(REGEX_NEWLINE);
    var remainingLinesIndex = 0;
    var shiftNextLine = function() {
      var lineContents = getNextLine();
      // The last line of a file might not have a newline.
      var newLine = getNextLine() || "";
      return lineContents + newLine;

      function getNextLine() {
        return remainingLinesIndex < remainingLines.length ?
            remainingLines[remainingLinesIndex++] : undefined;
      }
    };

    // We need to remember the position of "remainingLines"
    var lastGeneratedLine = 1, lastGeneratedColumn = 0;

    // The generate SourceNodes we need a code range.
    // To extract it current and last mapping is used.
    // Here we store the last mapping.
    var lastMapping = null;

    aSourceMapConsumer.eachMapping(function (mapping) {
      if (lastMapping !== null) {
        // We add the code from "lastMapping" to "mapping":
        // First check if there is a new line in between.
        if (lastGeneratedLine < mapping.generatedLine) {
          // Associate first line with "lastMapping"
          addMappingWithCode(lastMapping, shiftNextLine());
          lastGeneratedLine++;
          lastGeneratedColumn = 0;
          // The remaining code is added without mapping
        } else {
          // There is no new line in between.
          // Associate the code between "lastGeneratedColumn" and
          // "mapping.generatedColumn" with "lastMapping"
          var nextLine = remainingLines[remainingLinesIndex] || '';
          var code = nextLine.substr(0, mapping.generatedColumn -
                                        lastGeneratedColumn);
          remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn -
                                              lastGeneratedColumn);
          lastGeneratedColumn = mapping.generatedColumn;
          addMappingWithCode(lastMapping, code);
          // No more remaining code, continue
          lastMapping = mapping;
          return;
        }
      }
      // We add the generated code until the first mapping
      // to the SourceNode without any mapping.
      // Each line is added as separate string.
      while (lastGeneratedLine < mapping.generatedLine) {
        node.add(shiftNextLine());
        lastGeneratedLine++;
      }
      if (lastGeneratedColumn < mapping.generatedColumn) {
        var nextLine = remainingLines[remainingLinesIndex] || '';
        node.add(nextLine.substr(0, mapping.generatedColumn));
        remainingLines[remainingLinesIndex] = nextLine.substr(mapping.generatedColumn);
        lastGeneratedColumn = mapping.generatedColumn;
      }
      lastMapping = mapping;
    }, this);
    // We have processed all mappings.
    if (remainingLinesIndex < remainingLines.length) {
      if (lastMapping) {
        // Associate the remaining code in the current line with "lastMapping"
        addMappingWithCode(lastMapping, shiftNextLine());
      }
      // and add the remaining lines without any mapping
      node.add(remainingLines.splice(remainingLinesIndex).join(""));
    }

    // Copy sourcesContent into SourceNode
    aSourceMapConsumer.sources.forEach(function (sourceFile) {
      var content = aSourceMapConsumer.sourceContentFor(sourceFile);
      if (content != null) {
        if (aRelativePath != null) {
          sourceFile = util.join(aRelativePath, sourceFile);
        }
        node.setSourceContent(sourceFile, content);
      }
    });

    return node;

    function addMappingWithCode(mapping, code) {
      if (mapping === null || mapping.source === undefined) {
        node.add(code);
      } else {
        var source = aRelativePath
          ? util.join(aRelativePath, mapping.source)
          : mapping.source;
        node.add(new SourceNode(mapping.originalLine,
                                mapping.originalColumn,
                                source,
                                code,
                                mapping.name));
      }
    }
  };

/**
 * Add a chunk of generated JS to this source node.
 *
 * @param aChunk A string snippet of generated JS code, another instance of
 *        SourceNode, or an array where each member is one of those things.
 */
SourceNode.prototype.add = function SourceNode_add(aChunk) {
  if (Array.isArray(aChunk)) {
    aChunk.forEach(function (chunk) {
      this.add(chunk);
    }, this);
  }
  else if (aChunk[isSourceNode] || typeof aChunk === "string") {
    if (aChunk) {
      this.children.push(aChunk);
    }
  }
  else {
    throw new TypeError(
      "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
    );
  }
  return this;
};

/**
 * Add a chunk of generated JS to the beginning of this source node.
 *
 * @param aChunk A string snippet of generated JS code, another instance of
 *        SourceNode, or an array where each member is one of those things.
 */
SourceNode.prototype.prepend = function SourceNode_prepend(aChunk) {
  if (Array.isArray(aChunk)) {
    for (var i = aChunk.length-1; i >= 0; i--) {
      this.prepend(aChunk[i]);
    }
  }
  else if (aChunk[isSourceNode] || typeof aChunk === "string") {
    this.children.unshift(aChunk);
  }
  else {
    throw new TypeError(
      "Expected a SourceNode, string, or an array of SourceNodes and strings. Got " + aChunk
    );
  }
  return this;
};

/**
 * Walk over the tree of JS snippets in this node and its children. The
 * walking function is called once for each snippet of JS and is passed that
 * snippet and the its original associated source's line/column location.
 *
 * @param aFn The traversal function.
 */
SourceNode.prototype.walk = function SourceNode_walk(aFn) {
  var chunk;
  for (var i = 0, len = this.children.length; i < len; i++) {
    chunk = this.children[i];
    if (chunk[isSourceNode]) {
      chunk.walk(aFn);
    }
    else {
      if (chunk !== '') {
        aFn(chunk, { source: this.source,
                     line: this.line,
                     column: this.column,
                     name: this.name });
      }
    }
  }
};

/**
 * Like `String.prototype.join` except for SourceNodes. Inserts `aStr` between
 * each of `this.children`.
 *
 * @param aSep The separator.
 */
SourceNode.prototype.join = function SourceNode_join(aSep) {
  var newChildren;
  var i;
  var len = this.children.length;
  if (len > 0) {
    newChildren = [];
    for (i = 0; i < len-1; i++) {
      newChildren.push(this.children[i]);
      newChildren.push(aSep);
    }
    newChildren.push(this.children[i]);
    this.children = newChildren;
  }
  return this;
};

/**
 * Call String.prototype.replace on the very right-most source snippet. Useful
 * for trimming whitespace from the end of a source node, etc.
 *
 * @param aPattern The pattern to replace.
 * @param aReplacement The thing to replace the pattern with.
 */
SourceNode.prototype.replaceRight = function SourceNode_replaceRight(aPattern, aReplacement) {
  var lastChild = this.children[this.children.length - 1];
  if (lastChild[isSourceNode]) {
    lastChild.replaceRight(aPattern, aReplacement);
  }
  else if (typeof lastChild === 'string') {
    this.children[this.children.length - 1] = lastChild.replace(aPattern, aReplacement);
  }
  else {
    this.children.push(''.replace(aPattern, aReplacement));
  }
  return this;
};

/**
 * Set the source content for a source file. This will be added to the SourceMapGenerator
 * in the sourcesContent field.
 *
 * @param aSourceFile The filename of the source file
 * @param aSourceContent The content of the source file
 */
SourceNode.prototype.setSourceContent =
  function SourceNode_setSourceContent(aSourceFile, aSourceContent) {
    this.sourceContents[util.toSetString(aSourceFile)] = aSourceContent;
  };

/**
 * Walk over the tree of SourceNodes. The walking function is called for each
 * source file content and is passed the filename and source content.
 *
 * @param aFn The traversal function.
 */
SourceNode.prototype.walkSourceContents =
  function SourceNode_walkSourceContents(aFn) {
    for (var i = 0, len = this.children.length; i < len; i++) {
      if (this.children[i][isSourceNode]) {
        this.children[i].walkSourceContents(aFn);
      }
    }

    var sources = Object.keys(this.sourceContents);
    for (var i = 0, len = sources.length; i < len; i++) {
      aFn(util.fromSetString(sources[i]), this.sourceContents[sources[i]]);
    }
  };

/**
 * Return the string representation of this source node. Walks over the tree
 * and concatenates all the various snippets together to one string.
 */
SourceNode.prototype.toString = function SourceNode_toString() {
  var str = "";
  this.walk(function (chunk) {
    str += chunk;
  });
  return str;
};

/**
 * Returns the string representation of this source node along with a source
 * map.
 */
SourceNode.prototype.toStringWithSourceMap = function SourceNode_toStringWithSourceMap(aArgs) {
  var generated = {
    code: "",
    line: 1,
    column: 0
  };
  var map = new SourceMapGenerator(aArgs);
  var sourceMappingActive = false;
  var lastOriginalSource = null;
  var lastOriginalLine = null;
  var lastOriginalColumn = null;
  var lastOriginalName = null;
  this.walk(function (chunk, original) {
    generated.code += chunk;
    if (original.source !== null
        && original.line !== null
        && original.column !== null) {
      if(lastOriginalSource !== original.source
         || lastOriginalLine !== original.line
         || lastOriginalColumn !== original.column
         || lastOriginalName !== original.name) {
        map.addMapping({
          source: original.source,
          original: {
            line: original.line,
            column: original.column
          },
          generated: {
            line: generated.line,
            column: generated.column
          },
          name: original.name
        });
      }
      lastOriginalSource = original.source;
      lastOriginalLine = original.line;
      lastOriginalColumn = original.column;
      lastOriginalName = original.name;
      sourceMappingActive = true;
    } else if (sourceMappingActive) {
      map.addMapping({
        generated: {
          line: generated.line,
          column: generated.column
        }
      });
      lastOriginalSource = null;
      sourceMappingActive = false;
    }
    for (var idx = 0, length = chunk.length; idx < length; idx++) {
      if (chunk.charCodeAt(idx) === NEWLINE_CODE) {
        generated.line++;
        generated.column = 0;
        // Mappings end at eol
        if (idx + 1 === length) {
          lastOriginalSource = null;
          sourceMappingActive = false;
        } else if (sourceMappingActive) {
          map.addMapping({
            source: original.source,
            original: {
              line: original.line,
              column: original.column
            },
            generated: {
              line: generated.line,
              column: generated.column
            },
            name: original.name
          });
        }
      } else {
        generated.column++;
      }
    }
  });
  this.walkSourceContents(function (sourceFile, sourceContent) {
    map.setSourceContent(sourceFile, sourceContent);
  });

  return { code: generated.code, map: map };
};

exports.SourceNode = SourceNode;
|Sx+</* -*- Mode: js; js-indent-level: 2; -*- */
/*
 * Copyright 2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE or:
 * http://opensource.org/licenses/BSD-3-Clause
 */

/**
 * This is a helper function for getting values from parameter/options
 * objects.
 *
 * @param args The object we are extracting values from
 * @param name The name of the property we are getting.
 * @param defaultValue An optional value to return if the property is missing
 * from the object. If this is not specified and the property is missing, an
 * error will be thrown.
 */
function getArg(aArgs, aName, aDefaultValue) {
  if (aName in aArgs) {
    return aArgs[aName];
  } else if (arguments.length === 3) {
    return aDefaultValue;
  } else {
    throw new Error('"' + aName + '" is a required argument.');
  }
}
exports.getArg = getArg;

var urlRegexp = /^(?:([\w+\-.]+):)?\/\/(?:(\w+:\w+)@)?([\w.-]*)(?::(\d+))?(.*)$/;
var dataUrlRegexp = /^data:.+\,.+$/;

function urlParse(aUrl) {
  var match = aUrl.match(urlRegexp);
  if (!match) {
    return null;
  }
  return {
    scheme: match[1],
    auth: match[2],
    host: match[3],
    port: match[4],
    path: match[5]
  };
}
exports.urlParse = urlParse;

function urlGenerate(aParsedUrl) {
  var url = '';
  if (aParsedUrl.scheme) {
    url += aParsedUrl.scheme + ':';
  }
  url += '//';
  if (aParsedUrl.auth) {
    url += aParsedUrl.auth + '@';
  }
  if (aParsedUrl.host) {
    url += aParsedUrl.host;
  }
  if (aParsedUrl.port) {
    url += ":" + aParsedUrl.port
  }
  if (aParsedUrl.path) {
    url += aParsedUrl.path;
  }
  return url;
}
exports.urlGenerate = urlGenerate;

var MAX_CACHED_INPUTS = 32;

/**
 * Takes some function `f(input) -> result` and returns a memoized version of
 * `f`.
 *
 * We keep at most `MAX_CACHED_INPUTS` memoized results of `f` alive. The
 * memoization is a dumb-simple, linear least-recently-used cache.
 */
function lruMemoize(f) {
  var cache = [];

  return function(input) {
    for (var i = 0; i < cache.length; i++) {
      if (cache[i].input === input) {
        var temp = cache[0];
        cache[0] = cache[i];
        cache[i] = temp;
        return cache[0].result;
      }
    }

    var result = f(input);

    cache.unshift({
      input,
      result,
    });

    if (cache.length > MAX_CACHED_INPUTS) {
      cache.pop();
    }

    return result;
  };
}

/**
 * Normalizes a path, or the path portion of a URL:
 *
 * - Replaces consecutive slashes with one slash.
 * - Removes unnecessary '.' parts.
 * - Removes unnecessary '<dir>/..' parts.
 *
 * Based on code in the Node.js 'path' core module.
 *
 * @param aPath The path or url to normalize.
 */
var normalize = lruMemoize(function normalize(aPath) {
  var path = aPath;
  var url = urlParse(aPath);
  if (url) {
    if (!url.path) {
      return aPath;
    }
    path = url.path;
  }
  var isAbsolute = exports.isAbsolute(path);
  // Split the path into parts between `/` characters. This is much faster than
  // using `.split(/\/+/g)`.
  var parts = [];
  var start = 0;
  var i = 0;
  while (true) {
    start = i;
    i = path.indexOf("/", start);
    if (i === -1) {
      parts.push(path.slice(start));
      break;
    } else {
      parts.push(path.slice(start, i));
      while (i < path.length && path[i] === "/") {
        i++;
      }
    }
  }

  for (var part, up = 0, i = parts.length - 1; i >= 0; i--) {
    part = parts[i];
    if (part === '.') {
      parts.splice(i, 1);
    } else if (part === '..') {
      up++;
    } else if (up > 0) {
      if (part === '') {
        // The first part is blank if the path is absolute. Trying to go
        // above the root is a no-op. Therefore we can remove all '..' parts
        // directly after the root.
        parts.splice(i + 1, up);
        up = 0;
      } else {
        parts.splice(i, 2);
        up--;
      }
    }
  }
  path = parts.join('/');

  if (path === '') {
    path = isAbsolute ? '/' : '.';
  }

  if (url) {
    url.path = path;
    return urlGenerate(url);
  }
  return path;
});
exports.normalize = normalize;

/**
 * Joins two paths/URLs.
 *
 * @param aRoot The root path or URL.
 * @param aPath The path or URL to be joined with the root.
 *
 * - If aPath is a URL or a data URI, aPath is returned, unless aPath is a
 *   scheme-relative URL: Then the scheme of aRoot, if any, is prepended
 *   first.
 * - Otherwise aPath is a path. If aRoot is a URL, then its path portion
 *   is updated with the result and aRoot is returned. Otherwise the result
 *   is returned.
 *   - If aPath is absolute, the result is aPath.
 *   - Otherwise the two paths are joined with a slash.
 * - Joining for example 'http://' and 'www.example.com' is also supported.
 */
function join(aRoot, aPath) {
  if (aRoot === "") {
    aRoot = ".";
  }
  if (aPath === "") {
    aPath = ".";
  }
  var aPathUrl = urlParse(aPath);
  var aRootUrl = urlParse(aRoot);
  if (aRootUrl) {
    aRoot = aRootUrl.path || '/';
  }

  // `join(foo, '//www.example.org')`
  if (aPathUrl && !aPathUrl.scheme) {
    if (aRootUrl) {
      aPathUrl.scheme = aRootUrl.scheme;
    }
    return urlGenerate(aPathUrl);
  }

  if (aPathUrl || aPath.match(dataUrlRegexp)) {
    return aPath;
  }

  // `join('http://', 'www.example.com')`
  if (aRootUrl && !aRootUrl.host && !aRootUrl.path) {
    aRootUrl.host = aPath;
    return urlGenerate(aRootUrl);
  }

  var joined = aPath.charAt(0) === '/'
    ? aPath
    : normalize(aRoot.replace(/\/+$/, '') + '/' + aPath);

  if (aRootUrl) {
    aRootUrl.path = joined;
    return urlGenerate(aRootUrl);
  }
  return joined;
}
exports.join = join;

exports.isAbsolute = function (aPath) {
  return aPath.charAt(0) === '/' || urlRegexp.test(aPath);
};

/**
 * Make a path relative to a URL or another path.
 *
 * @param aRoot The root path or URL.
 * @param aPath The path or URL to be made relative to aRoot.
 */
function relative(aRoot, aPath) {
  if (aRoot === "") {
    aRoot = ".";
  }

  aRoot = aRoot.replace(/\/$/, '');

  // It is possible for the path to be above the root. In this case, simply
  // checking whether the root is a prefix of the path won't work. Instead, we
  // need to remove components from the root one by one, until either we find
  // a prefix that fits, or we run out of components to remove.
  var level = 0;
  while (aPath.indexOf(aRoot + '/') !== 0) {
    var index = aRoot.lastIndexOf("/");
    if (index < 0) {
      return aPath;
    }

    // If the only part of the root that is left is the scheme (i.e. http://,
    // file:///, etc.), one or more slashes (/), or simply nothing at all, we
    // have exhausted all components, so the path is not relative to the root.
    aRoot = aRoot.slice(0, index);
    if (aRoot.match(/^([^\/]+:\/)?\/*$/)) {
      return aPath;
    }

    ++level;
  }

  // Make sure we add a "../" for each component we removed from the root.
  return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
}
exports.relative = relative;

var supportsNullProto = (function () {
  var obj = Object.create(null);
  return !('__proto__' in obj);
}());

function identity (s) {
  return s;
}

/**
 * Because behavior goes wacky when you set `__proto__` on objects, we
 * have to prefix all the strings in our set with an arbitrary character.
 *
 * See https://github.com/mozilla/source-map/pull/31 and
 * https://github.com/mozilla/source-map/issues/30
 *
 * @param String aStr
 */
function toSetString(aStr) {
  if (isProtoString(aStr)) {
    return '$' + aStr;
  }

  return aStr;
}
exports.toSetString = supportsNullProto ? identity : toSetString;

function fromSetString(aStr) {
  if (isProtoString(aStr)) {
    return aStr.slice(1);
  }

  return aStr;
}
exports.fromSetString = supportsNullProto ? identity : fromSetString;

function isProtoString(s) {
  if (!s) {
    return false;
  }

  var length = s.length;

  if (length < 9 /* "__proto__".length */) {
    return false;
  }

  if (s.charCodeAt(length - 1) !== 95  /* '_' */ ||
      s.charCodeAt(length - 2) !== 95  /* '_' */ ||
      s.charCodeAt(length - 3) !== 111 /* 'o' */ ||
      s.charCodeAt(length - 4) !== 116 /* 't' */ ||
      s.charCodeAt(length - 5) !== 111 /* 'o' */ ||
      s.charCodeAt(length - 6) !== 114 /* 'r' */ ||
      s.charCodeAt(length - 7) !== 112 /* 'p' */ ||
      s.charCodeAt(length - 8) !== 95  /* '_' */ ||
      s.charCodeAt(length - 9) !== 95  /* '_' */) {
    return false;
  }

  for (var i = length - 10; i >= 0; i--) {
    if (s.charCodeAt(i) !== 36 /* '$' */) {
      return false;
    }
  }

  return true;
}

/**
 * Comparator between two mappings where the original positions are compared.
 *
 * Optionally pass in `true` as `onlyCompareGenerated` to consider two
 * mappings with the same original source/line/column, but different generated
 * line and column the same. Useful when searching for a mapping with a
 * stubbed out mapping.
 */
function compareByOriginalPositions(mappingA, mappingB, onlyCompareOriginal) {
  var cmp = strcmp(mappingA.source, mappingB.source);
  if (cmp !== 0) {
    return cmp;
  }

  cmp = mappingA.originalLine - mappingB.originalLine;
  if (cmp !== 0) {
    return cmp;
  }

  cmp = mappingA.originalColumn - mappingB.originalColumn;
  if (cmp !== 0 || onlyCompareOriginal) {
    return cmp;
  }

  cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  if (cmp !== 0) {
    return cmp;
  }

  cmp = mappingA.generatedLine - mappingB.generatedLine;
  if (cmp !== 0) {
    return cmp;
  }

  return strcmp(mappingA.name, mappingB.name);
}
exports.compareByOriginalPositions = compareByOriginalPositions;

function compareByOriginalPositionsNoSource(mappingA, mappingB, onlyCompareOriginal) {
  var cmp

  cmp = mappingA.originalLine - mappingB.originalLine;
  if (cmp !== 0) {
    return cmp;
  }

  cmp = mappingA.originalColumn - mappingB.originalColumn;
  if (cmp !== 0 || onlyCompareOriginal) {
    return cmp;
  }

  cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  if (cmp !== 0) {
    return cmp;
  }

  cmp = mappingA.generatedLine - mappingB.generatedLine;
  if (cmp !== 0) {
    return cmp;
  }

  return strcmp(mappingA.name, mappingB.name);
}
exports.compareByOriginalPositionsNoSource = compareByOriginalPositionsNoSource;

/**
 * Comparator between two mappings with deflated source and name indices where
 * the generated positions are compared.
 *
 * Optionally pass in `true` as `onlyCompareGenerated` to consider two
 * mappings with the same generated line and column, but different
 * source/name/original line and column the same. Useful when searching for a
 * mapping with a stubbed out mapping.
 */
function compareByGeneratedPositionsDeflated(mappingA, mappingB, onlyCompareGenerated) {
  var cmp = mappingA.generatedLine - mappingB.generatedLine;
  if (cmp !== 0) {
    return cmp;
  }

  cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  if (cmp !== 0 || onlyCompareGenerated) {
    return cmp;
  }

  cmp = strcmp(mappingA.source, mappingB.source);
  if (cmp !== 0) {
    return cmp;
  }

  cmp = mappingA.originalLine - mappingB.originalLine;
  if (cmp !== 0) {
    return cmp;
  }

  cmp = mappingA.originalColumn - mappingB.originalColumn;
  if (cmp !== 0) {
    return cmp;
  }

  return strcmp(mappingA.name, mappingB.name);
}
exports.compareByGeneratedPositionsDeflated = compareByGeneratedPositionsDeflated;

function compareByGeneratedPositionsDeflatedNoLine(mappingA, mappingB, onlyCompareGenerated) {
  var cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  if (cmp !== 0 || onlyCompareGenerated) {
    return cmp;
  }

  cmp = strcmp(mappingA.source, mappingB.source);
  if (cmp !== 0) {
    return cmp;
  }

  cmp = mappingA.originalLine - mappingB.originalLine;
  if (cmp !== 0) {
    return cmp;
  }

  cmp = mappingA.originalColumn - mappingB.originalColumn;
  if (cmp !== 0) {
    return cmp;
  }

  return strcmp(mappingA.name, mappingB.name);
}
exports.compareByGeneratedPositionsDeflatedNoLine = compareByGeneratedPositionsDeflatedNoLine;

function strcmp(aStr1, aStr2) {
  if (aStr1 === aStr2) {
    return 0;
  }

  if (aStr1 === null) {
    return 1; // aStr2 !== null
  }

  if (aStr2 === null) {
    return -1; // aStr1 !== null
  }

  if (aStr1 > aStr2) {
    return 1;
  }

  return -1;
}

/**
 * Comparator between two mappings with inflated source and name strings where
 * the generated positions are compared.
 */
function compareByGeneratedPositionsInflated(mappingA, mappingB) {
  var cmp = mappingA.generatedLine - mappingB.generatedLine;
  if (cmp !== 0) {
    return cmp;
  }

  cmp = mappingA.generatedColumn - mappingB.generatedColumn;
  if (cmp !== 0) {
    return cmp;
  }

  cmp = strcmp(mappingA.source, mappingB.source);
  if (cmp !== 0) {
    return cmp;
  }

  cmp = mappingA.originalLine - mappingB.originalLine;
  if (cmp !== 0) {
    return cmp;
  }

  cmp = mappingA.originalColumn - mappingB.originalColumn;
  if (cmp !== 0) {
    return cmp;
  }

  return strcmp(mappingA.name, mappingB.name);
}
exports.compareByGeneratedPositionsInflated = compareByGeneratedPositionsInflated;

/**
 * Strip any JSON XSSI avoidance prefix from the string (as documented
 * in the source maps specification), and then parse the string as
 * JSON.
 */
function parseSourceMapInput(str) {
  return JSON.parse(str.replace(/^\)]}'[^\n]*\n/, ''));
}
exports.parseSourceMapInput = parseSourceMapInput;

/**
 * Compute the URL of a source given the the source root, the source's
 * URL, and the source map's URL.
 */
function computeSourceURL(sourceRoot, sourceURL, sourceMapURL) {
  sourceURL = sourceURL || '';

  if (sourceRoot) {
    // This follows what Chrome does.
    if (sourceRoot[sourceRoot.length - 1] !== '/' && sourceURL[0] !== '/') {
      sourceRoot += '/';
    }
    // The spec says:
    //   Line 4: An optional source root, useful for relocating source
    //   files on a server or removing repeated values in the
    //   “sources” entry.  This value is prepended to the individual
    //   entries in the “source” field.
    sourceURL = sourceRoot + sourceURL;
  }

  // Historically, SourceMapConsumer did not take the sourceMapURL as
  // a parameter.  This mode is still somewhat supported, which is why
  // this code block is conditional.  However, it's preferable to pass
  // the source map URL to SourceMapConsumer, so that this function
  // can implement the source URL resolution algorithm as outlined in
  // the spec.  This block is basically the equivalent of:
  //    new URL(sourceURL, sourceMapURL).toString()
  // ... except it avoids using URL, which wasn't available in the
  // older releases of node still supported by this library.
  //
  // The spec says:
  //   If the sources are not absolute URLs after prepending of the
  //   “sourceRoot”, the sources are resolved relative to the
  //   SourceMap (like resolving script src in a html document).
  if (sourceMapURL) {
    var parsed = urlParse(sourceMapURL);
    if (!parsed) {
      throw new Error("sourceMapURL could not be parsed");
    }
    if (parsed.path) {
      // Strip the last path component, but keep the "/".
      var index = parsed.path.lastIndexOf('/');
      if (index >= 0) {
        parsed.path = parsed.path.substring(0, index + 1);
      }
    }
    sourceURL = join(urlGenerate(parsed), sourceURL);
  }

  return normalize(sourceURL);
}
exports.computeSourceURL = computeSourceURL;
^4Ox	{
  "name": "source-map-js",
  "description": "Generates and consumes source maps",
  "version": "1.2.1",
  "homepage": "https://github.com/7rulnik/source-map-js",
  "author": "Valentin 7rulnik Semirulnik <v7rulnik@gmail.com>",
  "contributors": [
    "Nick Fitzgerald <nfitzgerald@mozilla.com>",
    "Tobias Koppers <tobias.koppers@googlemail.com>",
    "Duncan Beevers <duncan@dweebd.com>",
    "Stephen Crane <scrane@mozilla.com>",
    "Ryan Seddon <seddon.ryan@gmail.com>",
    "Miles Elam <miles.elam@deem.com>",
    "Mihai Bazon <mihai.bazon@gmail.com>",
    "Michael Ficarra <github.public.email@michael.ficarra.me>",
    "Todd Wolfson <todd@twolfson.com>",
    "Alexander Solovyov <alexander@solovyov.net>",
    "Felix Gnass <fgnass@gmail.com>",
    "Conrad Irwin <conrad.irwin@gmail.com>",
    "usrbincc <usrbincc@yahoo.com>",
    "David Glasser <glasser@davidglasser.net>",
    "Chase Douglas <chase@newrelic.com>",
    "Evan Wallace <evan.exe@gmail.com>",
    "Heather Arthur <fayearthur@gmail.com>",
    "Hugh Kennedy <hughskennedy@gmail.com>",
    "David Glasser <glasser@davidglasser.net>",
    "Simon Lydell <simon.lydell@gmail.com>",
    "Jmeas Smith <jellyes2@gmail.com>",
    "Michael Z Goddard <mzgoddard@gmail.com>",
    "azu <azu@users.noreply.github.com>",
    "John Gozde <john@gozde.ca>",
    "Adam Kirkton <akirkton@truefitinnovation.com>",
    "Chris Montgomery <christopher.montgomery@dowjones.com>",
    "J. Ryan Stinnett <jryans@gmail.com>",
    "Jack Herrington <jherrington@walmartlabs.com>",
    "Chris Truter <jeffpalentine@gmail.com>",
    "Daniel Espeset <daniel@danielespeset.com>",
    "Jamie Wong <jamie.lf.wong@gmail.com>",
    "Eddy Bruël <ejpbruel@mozilla.com>",
    "Hawken Rives <hawkrives@gmail.com>",
    "Gilad Peleg <giladp007@gmail.com>",
    "djchie <djchie.dev@gmail.com>",
    "Gary Ye <garysye@gmail.com>",
    "Nicolas Lalevée <nicolas.lalevee@hibnet.org>"
  ],
  "repository": "7rulnik/source-map-js",
  "main": "./source-map.js",
  "files": [
    "source-map.js",
    "source-map.d.ts",
    "lib/"
  ],
  "engines": {
    "node": ">=0.10.0"
  },
  "license": "BSD-3-Clause",
  "scripts": {
    "test": "npm run build && node test/run-tests.js",
    "build": "webpack --color",
    "toc": "doctoc --title '## Table of Contents' README.md && doctoc --title '## Table of Contents' CONTRIBUTING.md"
  },
  "devDependencies": {
    "clean-publish": "^3.1.0",
    "doctoc": "^0.15.0",
    "webpack": "^1.12.0"
  },
  "clean-publish": {
    "cleanDocs": true
  },
  "typings": "source-map.d.ts"
}
sU%zxPexport interface StartOfSourceMap {
    file?: string;
    sourceRoot?: string;
}

export interface RawSourceMap extends StartOfSourceMap {
    version: string;
    sources: string[];
    names: string[];
    sourcesContent?: string[];
    mappings: string;
}

export interface Position {
    line: number;
    column: number;
}

export interface LineRange extends Position {
    lastColumn: number;
}

export interface FindPosition extends Position {
    // SourceMapConsumer.GREATEST_LOWER_BOUND or SourceMapConsumer.LEAST_UPPER_BOUND
    bias?: number;
}

export interface SourceFindPosition extends FindPosition {
    source: string;
}

export interface MappedPosition extends Position {
    source: string;
    name?: string;
}

export interface MappingItem {
    source: string | null;
    generatedLine: number;
    generatedColumn: number;
    originalLine: number | null;
    originalColumn: number | null;
    name: string | null;
}

export class SourceMapConsumer {
    static GENERATED_ORDER: number;
    static ORIGINAL_ORDER: number;

    static GREATEST_LOWER_BOUND: number;
    static LEAST_UPPER_BOUND: number;

    constructor(rawSourceMap: RawSourceMap);
    readonly file: string | undefined | null;
    readonly sourceRoot: string | undefined | null;
    readonly sourcesContent: readonly string[] | null | undefined;
    readonly sources: readonly string[]

    computeColumnSpans(): void;
    originalPositionFor(generatedPosition: FindPosition): MappedPosition;
    generatedPositionFor(originalPosition: SourceFindPosition): LineRange;
    allGeneratedPositionsFor(originalPosition: MappedPosition): Position[];
    hasContentsOfAllSources(): boolean;
    sourceContentFor(source: string, returnNullOnMissing?: boolean): string | null;
    eachMapping(callback: (mapping: MappingItem) => void, context?: any, order?: number): void;
}

export interface Mapping {
    generated: Position;
    original?: Position | null;
    source?: string | null;
    name?: string | null;
}

export class SourceMapGenerator {
    constructor(startOfSourceMap?: StartOfSourceMap);
    static fromSourceMap(sourceMapConsumer: SourceMapConsumer, startOfSourceMap?: StartOfSourceMap): SourceMapGenerator;
    addMapping(mapping: Mapping): void;
    setSourceContent(sourceFile: string, sourceContent: string | null | undefined): void;
    applySourceMap(sourceMapConsumer: SourceMapConsumer, sourceFile?: string, sourceMapPath?: string): void;
    toString(): string;
    toJSON(): RawSourceMap;
}

export interface CodeWithSourceMap {
    code: string;
    map: SourceMapGenerator;
}

export class SourceNode {
    constructor();
    constructor(line: number, column: number, source: string);
    constructor(line: number, column: number, source: string, chunk?: string, name?: string);
    static fromStringWithSourceMap(code: string, sourceMapConsumer: SourceMapConsumer, relativePath?: string): SourceNode;
    add(chunk: string): void;
    prepend(chunk: string): void;
    setSourceContent(sourceFile: string, sourceContent: string): void;
    walk(fn: (chunk: string, mapping: MappedPosition) => void): void;
    walkSourceContents(fn: (file: string, content: string) => void): void;
    join(sep: string): SourceNode;
    replaceRight(pattern: string, replacement: string): SourceNode;
    toString(): string;
    toStringWithSourceMap(startOfSourceMap?: StartOfSourceMap): CodeWithSourceMap;
}
Zxj/*
 * Copyright 2009-2011 Mozilla Foundation and contributors
 * Licensed under the New BSD license. See LICENSE.txt or:
 * http://opensource.org/licenses/BSD-3-Clause
 */
exports.SourceMapGenerator = require('./lib/source-map-generator').SourceMapGenerator;
exports.SourceMapConsumer = require('./lib/source-map-consumer').SourceMapConsumer;
exports.SourceNode = require('./lib/source-node').SourceNode;
nBx q100644 LICENSE R[o,;MS'
100644 README.md p|%S<-qz5#40000 lib /f<tZajsT׬/H100644 package.json *WCX?`>S#s&
1ټx'# type-check [![Build Status](https://travis-ci.org/gkz/type-check.png?branch=master)](https://travis-ci.org/gkz/type-check)

<a name="type-check" />

`type-check` is a library which allows you to check the types of JavaScript values at runtime with a Haskell like type syntax. It is great for checking external input, for testing, or even for adding a bit of safety to your internal code. It is a major component of [levn](https://github.com/gkz/levn). MIT license. Version 0.4.0. Check out the [demo](http://gkz.github.io/type-check/).

For updates on `type-check`, [follow me on twitter](https://twitter.com/gkzahariev).

    npm install type-check

## Quick Examples

```js
// Basic types:
var typeCheck = require('type-check').typeCheck;
typeCheck('Number', 1);               // true
typeCheck('Number', 'str');           // false
typeCheck('Error', new Error);        // true
typeCheck('Undefined', undefined);    // true

// Comment
typeCheck('count::Number', 1);        // true

// One type OR another type:
typeCheck('Number | String', 2);      // true
typeCheck('Number | String', 'str');  // true

// Wildcard, matches all types:
typeCheck('*', 2) // true

// Array, all elements of a single type:
typeCheck('[Number]', [1, 2, 3]);                // true
typeCheck('[Number]', [1, 'str', 3]);            // false

// Tuples, or fixed length arrays with elements of different types:
typeCheck('(String, Number)', ['str', 2]);       // true
typeCheck('(String, Number)', ['str']);          // false
typeCheck('(String, Number)', ['str', 2, 5]);    // false

// Object properties:
typeCheck('{x: Number, y: Boolean}', {x: 2, y: false});             // true
typeCheck('{x: Number, y: Boolean}',       {x: 2});                 // false
typeCheck('{x: Number, y: Maybe Boolean}', {x: 2});                 // true
typeCheck('{x: Number, y: Boolean}',      {x: 2, y: false, z: 3});  // false
typeCheck('{x: Number, y: Boolean, ...}', {x: 2, y: false, z: 3});  // true

// A particular type AND object properties:
typeCheck('RegExp{source: String, ...}', /re/i);          // true
typeCheck('RegExp{source: String, ...}', {source: 're'}); // false

// Custom types:
var opt = {customTypes:
  {Even: { typeOf: 'Number', validate: function(x) { return x % 2 === 0; }}}};
typeCheck('Even', 2, opt); // true

// Nested:
var type = '{a: (String, [Number], {y: Array, ...}), b: Error{message: String, ...}}'
typeCheck(type, {a: ['hi', [1, 2, 3], {y: [1, 'ms']}], b: new Error('oh no')}); // true
```

Check out the [type syntax format](#syntax) and [guide](#guide).

## Usage

`require('type-check');` returns an object that exposes four properties. `VERSION` is the current version of the library as a string. `typeCheck`, `parseType`, and `parsedTypeCheck` are functions.

```js
// typeCheck(type, input, options);
typeCheck('Number', 2);               // true

// parseType(type);
var parsedType = parseType('Number'); // object

// parsedTypeCheck(parsedType, input, options);
parsedTypeCheck(parsedType, 2);       // true
```

### typeCheck(type, input, options)

`typeCheck` checks a JavaScript value `input` against `type` written in the [type format](#type-format) (and taking account the optional `options`) and returns whether the `input` matches the `type`.

##### arguments
* type - `String` - the type written in the [type format](#type-format) which to check against
* input - `*` - any JavaScript value, which is to be checked against the type
* options - `Maybe Object` - an optional parameter specifying additional options, currently the only available option is specifying [custom types](#custom-types)

##### returns
`Boolean` - whether the input matches the type

##### example
```js
typeCheck('Number', 2); // true
```

### parseType(type)

`parseType` parses string `type` written in the [type format](#type-format) into an object representing the parsed type.

##### arguments
* type - `String` - the type written in the [type format](#type-format) which to parse

##### returns
`Object` - an object in the parsed type format representing the parsed type

##### example
```js
parseType('Number'); // [{type: 'Number'}]
```
### parsedTypeCheck(parsedType, input, options)

`parsedTypeCheck` checks a JavaScript value `input` against parsed `type` in the parsed type format (and taking account the optional `options`) and returns whether the `input` matches the `type`. Use this in conjunction with `parseType` if you are going to use a type more than once.

##### arguments
* type - `Object` - the type in the parsed type format which to check against
* input - `*` - any JavaScript value, which is to be checked against the type
* options - `Maybe Object` - an optional parameter specifying additional options, currently the only available option is specifying [custom types](#custom-types)

##### returns
`Boolean` - whether the input matches the type

##### example
```js
parsedTypeCheck([{type: 'Number'}], 2); // true
var parsedType = parseType('String');
parsedTypeCheck(parsedType, 'str');     // true
```

<a name="type-format" />
## Type Format

### Syntax

White space is ignored. The root node is a __Types__.

* __Identifier__ = `[\$\w]+` - a group of any lower or upper case letters, numbers, underscores, or dollar signs - eg. `String`
* __Type__ = an `Identifier`, an `Identifier` followed by a `Structure`, just a `Structure`, or a wildcard `*` - eg. `String`, `Object{x: Number}`, `{x: Number}`, `Array{0: String, 1: Boolean, length: Number}`, `*`
* __Types__ = optionally a comment (an `Identifier` followed by a `::`), optionally the identifier `Maybe`, one or more `Type`, separated by `|` - eg. `Number`, `String | Date`, `Maybe Number`, `Maybe Boolean | String`
* __Structure__ = `Fields`, or a `Tuple`, or an `Array` - eg. `{x: Number}`, `(String, Number)`, `[Date]`
* __Fields__ = a `{`, followed one or more `Field` separated by a comma `,` (trailing comma `,` is permitted), optionally an `...` (always preceded by a comma `,`), followed by a `}` - eg. `{x: Number, y: String}`, `{k: Function, ...}`
* __Field__ = an `Identifier`, followed by a colon `:`, followed by `Types` - eg. `x: Date | String`, `y: Boolean`
* __Tuple__ = a `(`, followed by one or more `Types` separated by a comma `,` (trailing comma `,` is permitted), followed by a `)` - eg `(Date)`, `(Number, Date)`
* __Array__ = a `[` followed by exactly one `Types` followed by a `]` - eg. `[Boolean]`, `[Boolean | Null]`

### Guide

`type-check` uses `Object.toString` to find out the basic type of a value. Specifically,

```js
{}.toString.call(VALUE).slice(8, -1)
{}.toString.call(true).slice(8, -1) // 'Boolean'
```
A basic type, eg. `Number`, uses this check. This is much more versatile than using `typeof` - for example, with `document`, `typeof` produces `'object'` which isn't that useful, and our technique produces `'HTMLDocument'`.

You may check for multiple types by separating types with a `|`. The checker proceeds from left to right, and passes if the value is any of the types - eg. `String | Boolean` first checks if the value is a string, and then if it is a boolean. If it is none of those, then it returns false.

Adding a `Maybe` in front of a list of multiple types is the same as also checking for `Null` and `Undefined` - eg. `Maybe String` is equivalent to `Undefined | Null | String`.

You may add a comment to remind you of what the type is for by following an identifier with a `::` before a type (or multiple types). The comment is simply thrown out.

The wildcard `*` matches all types.

There are three types of structures for checking the contents of a value: 'fields', 'tuple', and 'array'.

If used by itself, a 'fields' structure will pass with any type of object as long as it is an instance of `Object` and the properties pass - this allows for duck typing - eg. `{x: Boolean}`.

To check if the properties pass, and the value is of a certain type, you can specify the type - eg. `Error{message: String}`.

If you want to make a field optional, you can simply use `Maybe` - eg. `{x: Boolean, y: Maybe String}` will still pass if `y` is undefined (or null).

If you don't care if the value has properties beyond what you have specified, you can use the 'etc' operator `...` - eg. `{x: Boolean, ...}` will match an object with an `x` property that is a boolean, and with zero or more other properties.

For an array, you must specify one or more types (separated by `|`) - it will pass for something of any length as long as each element passes the types provided - eg. `[Number]`, `[Number | String]`.

A tuple checks for a fixed number of elements, each of a potentially different type. Each element is separated by a comma - eg. `(String, Number)`.

An array and tuple structure check that the value is of type `Array` by default, but if another type is specified, they will check for that instead - eg. `Int32Array[Number]`. You can use the wildcard `*` to search for any type at all.

Check out the [type precedence](https://github.com/zaboco/type-precedence) library for type-check.

## Options

Options is an object. It is an optional parameter to the `typeCheck` and `parsedTypeCheck` functions. The only current option is `customTypes`.

<a name="custom-types" />
### Custom Types

__Example:__

```js
var options = {
  customTypes: {
    Even: {
      typeOf: 'Number',
      validate: function(x) {
        return x % 2 === 0;
      }
    }
  }
};
typeCheck('Even', 2, options); // true
typeCheck('Even', 3, options); // false
```

`customTypes` allows you to set up custom types for validation. The value of this is an object. The keys of the object are the types you will be matching. Each value of the object will be an object having a `typeOf` property - a string, and `validate` property - a function.

The `typeOf` property is the type the value should be (optional - if not set only `validate` will be used), and `validate` is a function which should return true if the value is of that type. `validate` receives one parameter, which is the value that we are checking.

## Technical About

`type-check` is written in [LiveScript](http://livescript.net/) - a language that compiles to JavaScript. It also uses the [prelude.ls](http://preludels.com/) library.
_q1xq 100644 check.js x'wH&100644 index.js 	L0ݖp100644 parse-type.js `s9dʬ;o9\x0öx)// Generated by LiveScript 1.6.0
(function(){
  var ref$, any, all, isItNaN, types, defaultType, toString$ = {}.toString;
  ref$ = require('prelude-ls'), any = ref$.any, all = ref$.all, isItNaN = ref$.isItNaN;
  types = {
    Number: {
      typeOf: 'Number',
      validate: function(it){
        return !isItNaN(it);
      }
    },
    NaN: {
      typeOf: 'Number',
      validate: isItNaN
    },
    Int: {
      typeOf: 'Number',
      validate: function(it){
        return !isItNaN(it) && it % 1 === 0;
      }
    },
    Float: {
      typeOf: 'Number',
      validate: function(it){
        return !isItNaN(it);
      }
    },
    Date: {
      typeOf: 'Date',
      validate: function(it){
        return !isItNaN(it.getTime());
      }
    }
  };
  defaultType = {
    array: 'Array',
    tuple: 'Array'
  };
  function checkArray(input, type, options){
    return all(function(it){
      return checkMultiple(it, type.of, options);
    }, input);
  }
  function checkTuple(input, type, options){
    var i, i$, ref$, len$, types;
    i = 0;
    for (i$ = 0, len$ = (ref$ = type.of).length; i$ < len$; ++i$) {
      types = ref$[i$];
      if (!checkMultiple(input[i], types, options)) {
        return false;
      }
      i++;
    }
    return input.length <= i;
  }
  function checkFields(input, type, options){
    var inputKeys, numInputKeys, k, numOfKeys, key, ref$, types;
    inputKeys = {};
    numInputKeys = 0;
    for (k in input) {
      inputKeys[k] = true;
      numInputKeys++;
    }
    numOfKeys = 0;
    for (key in ref$ = type.of) {
      types = ref$[key];
      if (!checkMultiple(input[key], types, options)) {
        return false;
      }
      if (inputKeys[key]) {
        numOfKeys++;
      }
    }
    return type.subset || numInputKeys === numOfKeys;
  }
  function checkStructure(input, type, options){
    if (!(input instanceof Object)) {
      return false;
    }
    switch (type.structure) {
    case 'fields':
      return checkFields(input, type, options);
    case 'array':
      return checkArray(input, type, options);
    case 'tuple':
      return checkTuple(input, type, options);
    }
  }
  function check(input, typeObj, options){
    var type, structure, setting, that;
    type = typeObj.type, structure = typeObj.structure;
    if (type) {
      if (type === '*') {
        return true;
      }
      setting = options.customTypes[type] || types[type];
      if (setting) {
        return (setting.typeOf === void 8 || setting.typeOf === toString$.call(input).slice(8, -1)) && setting.validate(input);
      } else {
        return type === toString$.call(input).slice(8, -1) && (!structure || checkStructure(input, typeObj, options));
      }
    } else if (structure) {
      if (that = defaultType[structure]) {
        if (that !== toString$.call(input).slice(8, -1)) {
          return false;
        }
      }
      return checkStructure(input, typeObj, options);
    } else {
      throw new Error("No type defined. Input: " + input + ".");
    }
  }
  function checkMultiple(input, types, options){
    if (toString$.call(types).slice(8, -1) !== 'Array') {
      throw new Error("Types must be in an array. Input: " + input + ".");
    }
    return any(function(it){
      return check(input, it, options);
    }, types);
  }
  module.exports = function(parsedType, input, options){
    options == null && (options = {});
    if (options.customTypes == null) {
      options.customTypes = {};
    }
    return checkMultiple(input, parsedType, options);
  };
}).call(this);
ô-x/// Generated by LiveScript 1.6.0
(function(){
  var VERSION, parseType, parsedTypeCheck, typeCheck;
  VERSION = '0.4.0';
  parseType = require('./parse-type');
  parsedTypeCheck = require('./check');
  typeCheck = function(type, input, options){
    return parsedTypeCheck(parseType(type), input, options);
  };
  module.exports = {
    VERSION: VERSION,
    typeCheck: typeCheck,
    parsedTypeCheck: parsedTypeCheck,
    parseType: parseType
  };
}).call(this);
ԴxO// Generated by LiveScript 1.6.0
(function(){
  var identifierRegex, tokenRegex;
  identifierRegex = /[\$\w]+/;
  function peek(tokens){
    var token;
    token = tokens[0];
    if (token == null) {
      throw new Error('Unexpected end of input.');
    }
    return token;
  }
  function consumeIdent(tokens){
    var token;
    token = peek(tokens);
    if (!identifierRegex.test(token)) {
      throw new Error("Expected text, got '" + token + "' instead.");
    }
    return tokens.shift();
  }
  function consumeOp(tokens, op){
    var token;
    token = peek(tokens);
    if (token !== op) {
      throw new Error("Expected '" + op + "', got '" + token + "' instead.");
    }
    return tokens.shift();
  }
  function maybeConsumeOp(tokens, op){
    var token;
    token = tokens[0];
    if (token === op) {
      return tokens.shift();
    } else {
      return null;
    }
  }
  function consumeArray(tokens){
    var types;
    consumeOp(tokens, '[');
    if (peek(tokens) === ']') {
      throw new Error("Must specify type of Array - eg. [Type], got [] instead.");
    }
    types = consumeTypes(tokens);
    consumeOp(tokens, ']');
    return {
      structure: 'array',
      of: types
    };
  }
  function consumeTuple(tokens){
    var components;
    components = [];
    consumeOp(tokens, '(');
    if (peek(tokens) === ')') {
      throw new Error("Tuple must be of at least length 1 - eg. (Type), got () instead.");
    }
    for (;;) {
      components.push(consumeTypes(tokens));
      maybeConsumeOp(tokens, ',');
      if (')' === peek(tokens)) {
        break;
      }
    }
    consumeOp(tokens, ')');
    return {
      structure: 'tuple',
      of: components
    };
  }
  function consumeFields(tokens){
    var fields, subset, ref$, key, types;
    fields = {};
    consumeOp(tokens, '{');
    subset = false;
    for (;;) {
      if (maybeConsumeOp(tokens, '...')) {
        subset = true;
        break;
      }
      ref$ = consumeField(tokens), key = ref$[0], types = ref$[1];
      fields[key] = types;
      maybeConsumeOp(tokens, ',');
      if ('}' === peek(tokens)) {
        break;
      }
    }
    consumeOp(tokens, '}');
    return {
      structure: 'fields',
      of: fields,
      subset: subset
    };
  }
  function consumeField(tokens){
    var key, types;
    key = consumeIdent(tokens);
    consumeOp(tokens, ':');
    types = consumeTypes(tokens);
    return [key, types];
  }
  function maybeConsumeStructure(tokens){
    switch (tokens[0]) {
    case '[':
      return consumeArray(tokens);
    case '(':
      return consumeTuple(tokens);
    case '{':
      return consumeFields(tokens);
    }
  }
  function consumeType(tokens){
    var token, wildcard, type, structure;
    token = peek(tokens);
    wildcard = token === '*';
    if (wildcard || identifierRegex.test(token)) {
      type = wildcard
        ? consumeOp(tokens, '*')
        : consumeIdent(tokens);
      structure = maybeConsumeStructure(tokens);
      if (structure) {
        return structure.type = type, structure;
      } else {
        return {
          type: type
        };
      }
    } else {
      structure = maybeConsumeStructure(tokens);
      if (!structure) {
        throw new Error("Unexpected character: " + token);
      }
      return structure;
    }
  }
  function consumeTypes(tokens){
    var lookahead, types, typesSoFar, typeObj, type, structure;
    if ('::' === peek(tokens)) {
      throw new Error("No comment before comment separator '::' found.");
    }
    lookahead = tokens[1];
    if (lookahead != null && lookahead === '::') {
      tokens.shift();
      tokens.shift();
    }
    types = [];
    typesSoFar = {};
    if ('Maybe' === peek(tokens)) {
      tokens.shift();
      types = [
        {
          type: 'Undefined'
        }, {
          type: 'Null'
        }
      ];
      typesSoFar = {
        Undefined: true,
        Null: true
      };
    }
    for (;;) {
      typeObj = consumeType(tokens), type = typeObj.type, structure = typeObj.structure;
      if (!typesSoFar[type]) {
        types.push(typeObj);
      }
      if (structure == null) {
        typesSoFar[type] = true;
      }
      if (!maybeConsumeOp(tokens, '|')) {
        break;
      }
    }
    return types;
  }
  tokenRegex = RegExp('\\.\\.\\.|::|->|' + identifierRegex.source + '|\\S', 'g');
  module.exports = function(input){
    var tokens, e;
    if (!input.length) {
      throw new Error('No type specified.');
    }
    tokens = input.match(tokenRegex) || [];
    if (in$('->', tokens)) {
      throw new Error("Function types are not supported.\ To validate that something is a function, you may use 'Function'.");
    }
    try {
      return consumeTypes(tokens);
    } catch (e$) {
      e = e$;
      throw new Error(e.message + " - Remaining tokens: " + JSON.stringify(tokens) + " - Initial input: '" + input + "'");
    }
  };
  function in$(x, xs){
    var i = -1, l = xs.length >>> 0;
    while (++i < l) if (x === xs[i]) return true;
    return false;
  }
}).call(this);
w]4xO{
  "name": "type-check",
  "version": "0.4.0",
  "author": "George Zahariev <z@georgezahariev.com>",
  "description": "type-check allows you to check the types of JavaScript values at runtime with a Haskell like type syntax.",
  "homepage": "https://github.com/gkz/type-check",
  "keywords": [
    "type",
    "check",
    "checking",
    "library"
  ],
  "files": [
    "lib",
    "README.md",
    "LICENSE"
  ],
  "main": "./lib/",
  "bugs": "https://github.com/gkz/type-check/issues",
  "license": "MIT",
  "engines": {
    "node": ">= 0.8.0"
  },
  "repository": {
    "type": "git",
    "url": "git://github.com/gkz/type-check.git"
  },
  "scripts": {
    "test": "make test"
  },
  "dependencies": {
    "prelude-ls": "^1.2.1"
  },
  "devDependencies": {
    "livescript": "^1.6.0",
    "mocha": "^7.1.1",
    "browserify": "^16.5.1"
  }
}
ydpx100644 index.d.ts ]ThJ*yQ`Xs?PJ100644 index.d.ts.map .7P*;&a$100644 index.js ]sIZN]]/X40000 lib mt?'xy?<s[100644 license ϧfrrcG100644 package.json f{ЇtHB$s^100644 readme.md }®wr})Xmofx export type Check = import("./lib/index.js").Check;
export type Test = import("./lib/index.js").Test;
export type TestFunction = import("./lib/index.js").TestFunction;
export { is, convert } from "./lib/index.js";
//# sourceMappingURL=index.d.ts.mapcUx I{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"oBACa,OAAO,gBAAgB,EAAE,KAAK;mBAC9B,OAAO,gBAAgB,EAAE,IAAI;2BAC7B,OAAO,gBAAgB,EAAE,YAAY"}sM6Kx &/**
 * @typedef {import('./lib/index.js').Check} Check
 * @typedef {import('./lib/index.js').Test} Test
 * @typedef {import('./lib/index.js').TestFunction} TestFunction
 */

export {is, convert} from './lib/index.js'
_ Hyxt 100644 index.d.ts @o RwhF1100644 index.d.ts.map 6jS z4o|100644 index.js J<<=I6?FGj,>xo/**
 * @import {Node, Parent} from 'unist'
 */
/**
 * @template Fn
 * @template Fallback
 * @typedef {Fn extends (value: any) => value is infer Thing ? Thing : Fallback} Predicate
 */
/**
 * @callback Check
 *   Check that an arbitrary value is a node.
 * @param {unknown} this
 *   The given context.
 * @param {unknown} [node]
 *   Anything (typically a node).
 * @param {number | null | undefined} [index]
 *   The node’s position in its parent.
 * @param {Parent | null | undefined} [parent]
 *   The node’s parent.
 * @returns {boolean}
 *   Whether this is a node and passes a test.
 *
 * @typedef {Record<string, unknown> | Node} Props
 *   Object to check for equivalence.
 *
 *   Note: `Node` is included as it is common but is not indexable.
 *
 * @typedef {Array<Props | TestFunction | string> | ReadonlyArray<Props | TestFunction | string> | Props | TestFunction | string | null | undefined} Test
 *   Check for an arbitrary node.
 *
 * @callback TestFunction
 *   Check if a node passes a test.
 * @param {unknown} this
 *   The given context.
 * @param {Node} node
 *   A node.
 * @param {number | undefined} [index]
 *   The node’s position in its parent.
 * @param {Parent | undefined} [parent]
 *   The node’s parent.
 * @returns {boolean | undefined | void}
 *   Whether this node passes the test.
 *
 *   Note: `void` is included until TS sees no return as `undefined`.
 */
/**
 * Check if `node` is a `Node` and whether it passes the given test.
 *
 * @param {unknown} node
 *   Thing to check, typically `Node`.
 * @param {Test} test
 *   A check for a specific node.
 * @param {number | null | undefined} index
 *   The node’s position in its parent.
 * @param {Parent | null | undefined} parent
 *   The node’s parent.
 * @param {unknown} context
 *   Context object (`this`) to pass to `test` functions.
 * @returns {boolean}
 *   Whether `node` is a node and passes a test.
 */
export const is: ((<Condition extends ReadonlyArray<string>>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {
    type: Condition[number];
}) & (<Condition extends Array<string>>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {
    type: Condition[number];
}) & (<Condition extends string>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {
    type: Condition;
}) & (<Condition extends Props>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) & (<Condition extends TestFunction>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) & ((node?: null | undefined) => false) & ((node: unknown, test?: null | undefined, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) & ((node: unknown, test?: Test, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => boolean));
/**
 * Generate an assertion from a test.
 *
 * Useful if you’re going to test many nodes, for example when creating a
 * utility where something else passes a compatible test.
 *
 * The created function is a bit faster because it expects valid input only:
 * a `node`, `index`, and `parent`.
 *
 * @param {Test} test
 *   *   when nullish, checks if `node` is a `Node`.
 *   *   when `string`, works like passing `(node) => node.type === test`.
 *   *   when `function` checks if function passed the node is true.
 *   *   when `object`, checks that all keys in test are in node, and that they have (strictly) equal values.
 *   *   when `array`, checks if any one of the subtests pass.
 * @returns {Check}
 *   An assertion.
 */
export const convert: ((<Condition extends string>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {
    type: Condition;
}) & (<Condition extends Props>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) & (<Condition extends TestFunction>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) & ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) & ((test?: Test) => Check));
export type Predicate<Fn, Fallback> = Fn extends (value: any) => value is infer Thing ? Thing : Fallback;
/**
 * Check that an arbitrary value is a node.
 */
export type Check = (this: unknown, node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined) => boolean;
/**
 * Object to check for equivalence.
 *
 * Note: `Node` is included as it is common but is not indexable.
 */
export type Props = Record<string, unknown> | Node;
/**
 * Check for an arbitrary node.
 */
export type Test = Array<Props | TestFunction | string> | ReadonlyArray<Props | TestFunction | string> | Props | TestFunction | string | null | undefined;
/**
 * Check if a node passes a test.
 */
export type TestFunction = (this: unknown, node: Node, index?: number | undefined, parent?: Parent | undefined) => boolean | undefined | void;
import type { Parent } from 'unist';
import type { Node } from 'unist';
//# sourceMappingURL=index.d.ts.mapX x^{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,iBAGY,CACT,CAAK,CAAC,SAAS,SAAS,aAAa,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,GAAG;IAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAAC,CAAA;CAAC,CAAC,GACrN,CAAK,CAAC,SAAS,SAAS,KAAK,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,GAAG;IAAC,IAAI,EAAE,SAAS,CAAC,MAAM,CAA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MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,GAC7J,CAAK,CAAC,IAAI,CAAC,EAAE,IAAI,KAAK,KAAK,CAAC,CACzB,CA8BH;sBA9KU,EAAE,EACF,QAAQ,IACR,EAAE,SAAS,CAAC,KAAK,EAAE,GAAG,KAAK,KAAK,IAAI,MAAM,KAAK,GAAG,KAAK,GAAG,QAAQ;;;;2BAMpE,OAAO,SAEP,OAAO,UAEP,MAAM,GAAG,IAAI,GAAG,SAAS,WAEzB,MAAM,GAAG,IAAI,GAAG,SAAS,KAEvB,OAAO;;;;;;oBAGP,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;;;;mBAK9B,KAAK,CAAC,KAAK,GAAG,YAAY,GAAG,MAAM,CAAC,GAAG,aAAa,CAAC,KAAK,GAAG,YAAY,GAAG,MAAM,CAAC,GAAG,KAAK,GAAG,YAAY,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS;;;;kCAKxI,OAAO,QAEP,IAAI,UAEJ,MAAM,GAAG,SAAS,WAElB,MAAM,GAAG,SAAS,KAEhB,OAAO,GAAG,SAAS,GAAG,IAAI;4BAzCR,OAAO;0BAAP,OAAO"}uzx#/**
 * @import {Node, Parent} from 'unist'
 */

/**
 * @template Fn
 * @template Fallback
 * @typedef {Fn extends (value: any) => value is infer Thing ? Thing : Fallback} Predicate
 */

/**
 * @callback Check
 *   Check that an arbitrary value is a node.
 * @param {unknown} this
 *   The given context.
 * @param {unknown} [node]
 *   Anything (typically a node).
 * @param {number | null | undefined} [index]
 *   The node’s position in its parent.
 * @param {Parent | null | undefined} [parent]
 *   The node’s parent.
 * @returns {boolean}
 *   Whether this is a node and passes a test.
 *
 * @typedef {Record<string, unknown> | Node} Props
 *   Object to check for equivalence.
 *
 *   Note: `Node` is included as it is common but is not indexable.
 *
 * @typedef {Array<Props | TestFunction | string> | ReadonlyArray<Props | TestFunction | string> | Props | TestFunction | string | null | undefined} Test
 *   Check for an arbitrary node.
 *
 * @callback TestFunction
 *   Check if a node passes a test.
 * @param {unknown} this
 *   The given context.
 * @param {Node} node
 *   A node.
 * @param {number | undefined} [index]
 *   The node’s position in its parent.
 * @param {Parent | undefined} [parent]
 *   The node’s parent.
 * @returns {boolean | undefined | void}
 *   Whether this node passes the test.
 *
 *   Note: `void` is included until TS sees no return as `undefined`.
 */

/**
 * Check if `node` is a `Node` and whether it passes the given test.
 *
 * @param {unknown} node
 *   Thing to check, typically `Node`.
 * @param {Test} test
 *   A check for a specific node.
 * @param {number | null | undefined} index
 *   The node’s position in its parent.
 * @param {Parent | null | undefined} parent
 *   The node’s parent.
 * @param {unknown} context
 *   Context object (`this`) to pass to `test` functions.
 * @returns {boolean}
 *   Whether `node` is a node and passes a test.
 */
export const is =
  // Note: overloads in JSDoc can’t yet use different `@template`s.
  /**
   * @type {(
   *   (<Condition extends ReadonlyArray<string>>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition[number]}) &
   *   (<Condition extends Array<string>>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition[number]}) &
   *   (<Condition extends string>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &
   *   (<Condition extends Props>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &
   *   (<Condition extends TestFunction>(node: unknown, test: Condition, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &
   *   ((node?: null | undefined) => false) &
   *   ((node: unknown, test?: null | undefined, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &
   *   ((node: unknown, test?: Test, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => boolean)
   * )}
   */
  (
    /**
     * @param {unknown} [node]
     * @param {Test} [test]
     * @param {number | null | undefined} [index]
     * @param {Parent | null | undefined} [parent]
     * @param {unknown} [context]
     * @returns {boolean}
     */
    // eslint-disable-next-line max-params
    function (node, test, index, parent, context) {
      const check = convert(test)

      if (
        index !== undefined &&
        index !== null &&
        (typeof index !== 'number' ||
          index < 0 ||
          index === Number.POSITIVE_INFINITY)
      ) {
        throw new Error('Expected positive finite index')
      }

      if (
        parent !== undefined &&
        parent !== null &&
        (!is(parent) || !parent.children)
      ) {
        throw new Error('Expected parent node')
      }

      if (
        (parent === undefined || parent === null) !==
        (index === undefined || index === null)
      ) {
        throw new Error('Expected both parent and index')
      }

      return looksLikeANode(node)
        ? check.call(context, node, index, parent)
        : false
    }
  )

/**
 * Generate an assertion from a test.
 *
 * Useful if you’re going to test many nodes, for example when creating a
 * utility where something else passes a compatible test.
 *
 * The created function is a bit faster because it expects valid input only:
 * a `node`, `index`, and `parent`.
 *
 * @param {Test} test
 *   *   when nullish, checks if `node` is a `Node`.
 *   *   when `string`, works like passing `(node) => node.type === test`.
 *   *   when `function` checks if function passed the node is true.
 *   *   when `object`, checks that all keys in test are in node, and that they have (strictly) equal values.
 *   *   when `array`, checks if any one of the subtests pass.
 * @returns {Check}
 *   An assertion.
 */
export const convert =
  // Note: overloads in JSDoc can’t yet use different `@template`s.
  /**
   * @type {(
   *   (<Condition extends string>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & {type: Condition}) &
   *   (<Condition extends Props>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Condition) &
   *   (<Condition extends TestFunction>(test: Condition) => (node: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node & Predicate<Condition, Node>) &
   *   ((test?: null | undefined) => (node?: unknown, index?: number | null | undefined, parent?: Parent | null | undefined, context?: unknown) => node is Node) &
   *   ((test?: Test) => Check)
   * )}
   */
  (
    /**
     * @param {Test} [test]
     * @returns {Check}
     */
    function (test) {
      if (test === null || test === undefined) {
        return ok
      }

      if (typeof test === 'function') {
        return castFactory(test)
      }

      if (typeof test === 'object') {
        return Array.isArray(test)
          ? anyFactory(test)
          : // Cast because `ReadonlyArray` goes into the above but `isArray`
            // narrows to `Array`.
            propertiesFactory(/** @type {Props} */ (test))
      }

      if (typeof test === 'string') {
        return typeFactory(test)
      }

      throw new Error('Expected function, string, or object as test')
    }
  )

/**
 * @param {Array<Props | TestFunction | string>} tests
 * @returns {Check}
 */
function anyFactory(tests) {
  /** @type {Array<Check>} */
  const checks = []
  let index = -1

  while (++index < tests.length) {
    checks[index] = convert(tests[index])
  }

  return castFactory(any)

  /**
   * @this {unknown}
   * @type {TestFunction}
   */
  function any(...parameters) {
    let index = -1

    while (++index < checks.length) {
      if (checks[index].apply(this, parameters)) return true
    }

    return false
  }
}

/**
 * Turn an object into a test for a node with a certain fields.
 *
 * @param {Props} check
 * @returns {Check}
 */
function propertiesFactory(check) {
  const checkAsRecord = /** @type {Record<string, unknown>} */ (check)

  return castFactory(all)

  /**
   * @param {Node} node
   * @returns {boolean}
   */
  function all(node) {
    const nodeAsRecord = /** @type {Record<string, unknown>} */ (
      /** @type {unknown} */ (node)
    )

    /** @type {string} */
    let key

    for (key in check) {
      if (nodeAsRecord[key] !== checkAsRecord[key]) return false
    }

    return true
  }
}

/**
 * Turn a string into a test for a node with a certain type.
 *
 * @param {string} check
 * @returns {Check}
 */
function typeFactory(check) {
  return castFactory(type)

  /**
   * @param {Node} node
   */
  function type(node) {
    return node && node.type === check
  }
}

/**
 * Turn a custom test into a test for a node that passes that test.
 *
 * @param {TestFunction} testFunction
 * @returns {Check}
 */
function castFactory(testFunction) {
  return check

  /**
   * @this {unknown}
   * @type {Check}
   */
  function check(value, index, parent) {
    return Boolean(
      looksLikeANode(value) &&
        testFunction.call(
          this,
          value,
          typeof index === 'number' ? index : undefined,
          parent || undefined
        )
    )
  }
}

function ok() {
  return true
}

/**
 * @param {unknown} value
 * @returns {value is Node}
 */
function looksLikeANode(value) {
  return value !== null && typeof value === 'object' && 'type' in value
}
3gϲgx KJ(The MIT license)

Copyright (c) 2015 Titus Wormer <tituswormer@gmail.com>TG
?
'Software'9
 C
dB
E
Y
GZ'AS IS'
B
F
RD
D
A
7B4xP
{
  "name": "unist-util-is",
  "version": "6.0.1",
  "description": "unist utility to check if a node passes a test",
  "license": "MIT",
  "keywords": [
    "unist",
    "unist-util",
    "util",
    "utility",
    "tree",
    "node",
    "is",
    "equal",
    "check",
    "test",
    "type"
  ],
  "repository": "syntax-tree/unist-util-is",
  "bugs": "https://github.com/syntax-tree/unist-util-is/issues",
  "funding": {
    "type": "opencollective",
    "url": "https://opencollective.com/unified"
  },
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
    "Christian Murphy <christian.murphy.42@gmail.com>",
    "Lucas Brandstaetter <lucas@brandstaetter.tech> (https://github.com/Roang-zero1)"
  ],
  "sideEffects": false,
  "type": "module",
  "exports": "./index.js",
  "files": [
    "lib/",
    "index.d.ts.map",
    "index.d.ts",
    "index.js"
  ],
  "dependencies": {
    "@types/unist": "^3.0.0"
  },
  "devDependencies": {
    "@types/mdast": "^4.0.0",
    "@types/node": "^24.0.0",
    "c8": "^10.0.0",
    "prettier": "^3.0.0",
    "remark-cli": "^12.0.0",
    "remark-preset-wooorm": "^11.0.0",
    "tsd": "^0.33.0",
    "type-coverage": "^2.0.0",
    "typescript": "^5.0.0",
    "xo": "^0.58.0"
  },
  "scripts": {
    "prepack": "npm run build && npm run format",
    "build": "tsc --build --clean && tsc --build && tsd && type-coverage",
    "format": "remark . -qfo && prettier . -w --log-level warn && xo --fix",
    "test-api": "node --conditions development test/index.js",
    "test-coverage": "c8 --100 --reporter lcov npm run test-api",
    "test": "npm run build && npm run format && npm run test-coverage"
  },
  "prettier": {
    "bracketSpacing": false,
    "semi": false,
    "singleQuote": true,
    "tabWidth": 2,
    "trailingComma": "none",
    "useTabs": false
  },
  "remarkConfig": {
    "plugins": [
      "remark-preset-wooorm"
    ]
  },
  "typeCoverage": {
    "atLeast": 100,
    "detail": true,
    "#": "needed `any`s",
    "ignoreFiles": [
      "lib/index.d.ts"
    ],
    "ignoreCatch": true,
    "strict": true
  },
  "xo": {
    "overrides": [
      {
        "files": [
          "**/*.ts"
        ],
        "rules": {
          "@typescript-eslint/consistent-type-definitions": "off",
          "@typescript-eslint/no-unnecessary-type-arguments": "off",
          "@typescript-eslint/no-unsafe-argument": "off",
          "@typescript-eslint/no-unsafe-assignment": "off",
          "import/no-extraneous-dependencies": "off"
        }
      }
    ],
    "prettier": true
  }
}
'رx"N# unist-util-is

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

[unist][] utility to check if nodes pass a test.

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`is(node[, test[, index, parent[, context]]])`](#isnode-test-index-parent-context)
  * [`convert(test)`](#converttest)
  * [`Check`](#check)
  * [`Test`](#test)
  * [`TestFunction`](#testfunction)
* [Examples](#examples)
  * [Example of `convert`](#example-of-convert)
* [Types](#types)
* [Compatibility](#compatibility)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This package is a small utility that checks that a node is a certain node.

## When should I use this?

Use this small utility if you find yourself repeating code for checking what
nodes are.

A similar package, [`hast-util-is-element`][hast-util-is-element], works on hast
elements.

For more advanced tests, [`unist-util-select`][unist-util-select] can be used
to match against CSS selectors.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install unist-util-is
```

In Deno with [`esm.sh`][esmsh]:

```js
import {is} from 'https://esm.sh/unist-util-is@6'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {is} from 'https://esm.sh/unist-util-is@6?bundle'
</script>
```

## Use

```js
import {is} from 'unist-util-is'

const node = {type: 'strong'}
const parent = {type: 'paragraph', children: [node]}

is() // => false
is({children: []}) // => false
is(node) // => true
is(node, 'strong') // => true
is(node, 'emphasis') // => false

is(node, node) // => true
is(parent, {type: 'paragraph'}) // => true
is(parent, {type: 'strong'}) // => false

is(node, test) // => false
is(node, test, 4, parent) // => false
is(node, test, 5, parent) // => true

function test(node, n) {
  return n === 5
}
```

## API

This package exports the identifiers [`convert`][api-convert] and
[`is`][api-is].
There is no default export.

### `is(node[, test[, index, parent[, context]]])`

Check if `node` is a `Node` and whether it passes the given test.

###### Parameters

* `node` (`unknown`, optional)
  — thing to check, typically [`Node`][node]
* `test` ([`Test`][api-test], optional)
  — a test for a specific element
* `index` (`number`, optional)
  — the node’s position in its parent
* `parent` ([`Node`][node], optional)
  — the node’s parent
* `context` (`unknown`, optional)
  — context object (`this`) to call `test` with

###### Returns

Whether `node` is a [`Node`][node] and passes a test (`boolean`).

###### Throws

When an incorrect `test`, `index`, or `parent` is given.
There is no error thrown when `node` is not a node.

### `convert(test)`

Generate a check from a test.

Useful if you’re going to test many nodes, for example when creating a
utility where something else passes a compatible test.

The created function is a bit faster because it expects valid input only:
a `node`, `index`, and `parent`.

###### Parameters

* `test` ([`Test`][api-test], optional)
  — a test for a specific node

###### Returns

A check ([`Check`][api-check]).

### `Check`

Check that an arbitrary value is a node (TypeScript type).

###### Parameters

* `this` (`unknown`, optional)
  — context object (`this`) to call `test` with
* `node` (`unknown`)
  — anything (typically a node)
* `index` (`number`, optional)
  — the node’s position in its parent
* `parent` ([`Node`][node], optional)
  — the node’s parent

###### Returns

Whether this is a node and passes a test (`boolean`).

### `Test`

Check for an arbitrary node (TypeScript type).

###### Type

```ts
type Test =
  | Array<Record<string, unknown> | TestFunction | string>
  | Record<string, unknown>
  | TestFunction
  | string
  | null
  | undefined
```

Checks that the given thing is a node, and then:

* when `string`, checks that the node has that tag name
* when `function`, see  [`TestFunction`][api-test-function]
* when `object`, checks that all keys in test are in node, and that they have
  (strictly) equal values
* when `Array`, checks if one of the subtests pass

### `TestFunction`

Check if a node passes a test (TypeScript type).

###### Parameters

* `node` ([`Node`][node])
  — a node
* `index` (`number` or `undefined`)
  — the node’s position in its parent
* `parent` ([`Node`][node] or `undefined`)
  — the node’s parent

###### Returns

Whether this node passes the test (`boolean`, optional).

## Examples

### Example of `convert`

```js
import {u} from 'unist-builder'
import {convert} from 'unist-util-is'

const test = convert('leaf')

const tree = u('tree', [
  u('node', [u('leaf', '1')]),
  u('leaf', '2'),
  u('node', [u('leaf', '3'), u('leaf', '4')]),
  u('leaf', '5')
])

const leafs = tree.children.filter(function (child, index) {
  return test(child, index, tree)
})

console.log(leafs)
```

Yields:

```js
[{type: 'leaf', value: '2'}, {type: 'leaf', value: '5'}]
```

## Types

This package is fully typed with [TypeScript][].
It exports the additional types [`Check`][api-check],
[`Test`][api-test],
[`TestFunction`][api-test-function].

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line, `unist-util-is@^6`,
compatible with Node.js 16.

## Related

* [`unist-util-find-after`](https://github.com/syntax-tree/unist-util-find-after)
  — find a node after another node
* [`unist-util-find-before`](https://github.com/syntax-tree/unist-util-find-before)
  — find a node before another node
* [`unist-util-find-all-after`](https://github.com/syntax-tree/unist-util-find-all-after)
  — find all nodes after another node
* [`unist-util-find-all-before`](https://github.com/syntax-tree/unist-util-find-all-before)
  — find all nodes before another node
* [`unist-util-find-all-between`](https://github.com/mrzmmr/unist-util-find-all-between)
  — find all nodes between two nodes
* [`unist-util-filter`](https://github.com/syntax-tree/unist-util-filter)
  — create a new tree with nodes that pass a check
* [`unist-util-remove`](https://github.com/syntax-tree/unist-util-remove)
  — remove nodes from tree

## Contribute

See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for
ways to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organization, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[api-check]: #check

[api-convert]: #converttest

[api-is]: #isnode-test-index-parent-context

[api-test]: #test

[api-test-function]: #testfunction

[author]: https://wooorm.com

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[build]: https://github.com/syntax-tree/unist-util-is/actions

[build-badge]: https://github.com/syntax-tree/unist-util-is/workflows/main/badge.svg

[chat]: https://github.com/syntax-tree/unist/discussions

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md

[collective]: https://opencollective.com/unified

[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md

[coverage]: https://codecov.io/github/syntax-tree/unist-util-is

[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-is.svg

[downloads]: https://www.npmjs.com/package/unist-util-is

[downloads-badge]: https://img.shields.io/npm/dm/unist-util-is.svg

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[hast-util-is-element]: https://github.com/syntax-tree/hast-util-is-element

[health]: https://github.com/syntax-tree/.github

[license]: license

[node]: https://github.com/syntax-tree/unist#node

[npm]: https://docs.npmjs.com/cli/install

[size]: https://bundlejs.com/?q=unist-util-is

[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=unist-util-is

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[support]: https://github.com/syntax-tree/.github/blob/main/support.md

[typescript]: https://www.typescriptlang.org

[unist]: https://github.com/syntax-tree/unist

[unist-util-select]: https://github.com/syntax-tree/unist-util-select
0x '100644 index.d.ts 2K>~s
j8100644 index.js 䱮N6Q`]xt40000 lib z|?/9qD(_y100644 license `nΑz)asL100644 package.json 6.cT©LA100644 readme.md [-leYqsJH"Txe export {removePosition} from './lib/index.js'
export type Options = import('./lib/index.js').Options
si$!xn /**
 * @typedef {import('./lib/index.js').Options} Options
 */

export {removePosition} from './lib/index.js'
$xJ 100644 index.d.ts #4Rg$NR"100644 index.js иbHP	8%xU/**
 * Remove the `position` field from a tree.
 *
 * @param {Node} tree
 *   Tree to clean.
 * @param {Options | null | undefined} [options={force: false}]
 *   Configuration (default: `{force: false}`).
 * @returns {undefined}
 *   Nothing.
 */
export function removePosition(
  tree: Node,
  options?: Options | null | undefined
): undefined
export type Node = import('unist').Node
/**
 * Configuration.
 */
export type Options = {
  /**
   * Whether to use `delete` to remove `position` fields.
   *
   * The default is to set them to `undefined`.
   */
  force?: boolean | null | undefined
}
25xV/**
 * @typedef {import('unist').Node} Node
 */

/**
 * @typedef Options
 *   Configuration.
 * @property {boolean | null | undefined} [force=false]
 *   Whether to use `delete` to remove `position` fields.
 *
 *   The default is to set them to `undefined`.
 */

import {visit} from 'unist-util-visit'

/**
 * Remove the `position` field from a tree.
 *
 * @param {Node} tree
 *   Tree to clean.
 * @param {Options | null | undefined} [options={force: false}]
 *   Configuration (default: `{force: false}`).
 * @returns {undefined}
 *   Nothing.
 */
export function removePosition(tree, options) {
  const config = options || {}
  const force = config.force || false

  visit(tree, remove)

  /**
   * @param {Node} node
   */
  function remove(node) {
    if (force) {
      delete node.position
    } else {
      node.position = undefined
    }
  }
}
/О7x KJ(The MIT License)

Copyright (c) 2016 Titus Wormer <tituswormer@gmail.com>TG
?
'Software'9
 C
dB
E
Y
GZ'AS IS'
B
F
RD
D
A
7.4ݷxW{
  "name": "unist-util-remove-position",
  "version": "5.0.0",
  "description": "unist utility to remove positions from a tree",
  "license": "MIT",
  "keywords": [
    "unist",
    "unist-util",
    "util",
    "utility",
    "remove",
    "position",
    "location",
    "clean",
    "force"
  ],
  "repository": "syntax-tree/unist-util-remove-position",
  "bugs": "https://github.com/syntax-tree/unist-util-remove-position/issues",
  "funding": {
    "type": "opencollective",
    "url": "https://opencollective.com/unified"
  },
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
    "Merlijn Vos <merlijn@soverin.net>"
  ],
  "sideEffects": false,
  "type": "module",
  "exports": "./index.js",
  "files": [
    "lib/",
    "index.d.ts",
    "index.js"
  ],
  "dependencies": {
    "@types/unist": "^3.0.0",
    "unist-util-visit": "^5.0.0"
  },
  "devDependencies": {
    "@types/mdast": "^4.0.0",
    "@types/node": "^20.0.0",
    "c8": "^8.0.0",
    "mdast-util-from-markdown": "^1.0.0",
    "prettier": "^2.0.0",
    "remark-cli": "^11.0.0",
    "remark-preset-wooorm": "^9.0.0",
    "tsd": "^0.28.0",
    "type-coverage": "^2.0.0",
    "typescript": "^5.0.0",
    "unist-builder": "^3.0.0",
    "xo": "^0.54.0"
  },
  "scripts": {
    "prepack": "npm run build && npm run format",
    "build": "tsc --build --clean && tsc --build && tsd && type-coverage",
    "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
    "test-api": "node --conditions development test.js",
    "test-coverage": "c8 --100 --reporter lcov npm run test-api",
    "test": "npm run build && npm run format && npm run test-coverage"
  },
  "prettier": {
    "bracketSpacing": false,
    "semi": false,
    "singleQuote": true,
    "tabWidth": 2,
    "trailingComma": "none",
    "useTabs": false
  },
  "remarkConfig": {
    "plugins": [
      "remark-preset-wooorm"
    ]
  },
  "typeCoverage": {
    "atLeast": 100,
    "detail": true,
    "ignoreCatch": true,
    "strict": true
  },
  "xo": {
    "prettier": true
  }
}
kqx# unist-util-remove-position

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

[unist][] utility to remove positional info from a tree.

## Contents

*   [What is this?](#what-is-this)
*   [When should I use this?](#when-should-i-use-this)
*   [Install](#install)
*   [Use](#use)
*   [API](#api)
    *   [`removePosition(node[, options])`](#removepositionnode-options)
    *   [`Options`](#options)
*   [Types](#types)
*   [Compatibility](#compatibility)
*   [Contribute](#contribute)
*   [License](#license)

## What is this?

This is a small utility that helps you remove the `position` field from nodes in
a unist tree.

## When should I use this?

Often, positional info is the whole reason, or an important reason, for using
ASTs.
Sometimes, especially when comparing trees, or when inserting one tree into
another, the positional info is at best useless and at worst harmful.
In those cases, you can use this utility to remove `position` fields from a
tree.

You might find the utility [`unist-util-position`][unist-util-position]
useful to instead get clean position info from a tree, or
[`unist-util-generated`][unist-util-generated] useful to check whether a node is
considered to be generated (not in the original input file).

You might also enjoy
[`unist-util-stringify-position`][unist-util-stringify-position] when you want
to display positional info to users.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install unist-util-remove-position
```

In Deno with [`esm.sh`][esmsh]:

```js
import {removePosition} from 'https://esm.sh/unist-util-remove-position@5'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {removePosition} from 'https://esm.sh/unist-util-remove-position@5?bundle'
</script>
```

## Use

```js
import {fromMarkdown} from 'mdast-util-from-markdown'
import {removePosition} from 'unist-util-remove-position'

const tree = fromMarkdown('Some _emphasis_, **importance**, and `code`.')

removePosition(tree, {force: true})

console.dir(tree, {depth: null})
```

Yields:

```js
{
  type: 'root',
  children: [
    {
      type: 'paragraph',
      children: [
        {type: 'text', value: 'Some '},
        {type: 'emphasis', children: [{type: 'text', value: 'emphasis'}]},
        {type: 'text', value: ', '},
        {type: 'strong', children: [{type: 'text', value: 'importance'}]},
        {type: 'text', value: ', and '},
        {type: 'inlineCode', value: 'code'},
        {type: 'text', value: '.'}
      ]
    }
  ]
}
```

## API

This package exports the identifier [`removePosition`][removeposition].
There is no default export.

### `removePosition(node[, options])`

Remove the `position` field from a tree.

###### Parameters

*   `node` ([`Node`][node])
    — tree to clean
*   `options` ([`Options`][options], optional)
    — configuration

###### Returns

Nothing (`undefined`).

### `Options`

Configuration (TypeScript type).

###### Fields

*   `force` (`boolean`, default: `false`)
    — whether to use `delete` to remove `position` fields, the default is to
    set them to `undefined`

## Types

This package is fully typed with [TypeScript][].
It exports the additional type [`Options`][options].

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`unist-util-remove-position@^5`, compatible with Node.js 16.

## Contribute

See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for
ways to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organization, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/syntax-tree/unist-util-remove-position/workflows/main/badge.svg

[build]: https://github.com/syntax-tree/unist-util-remove-position/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-remove-position.svg

[coverage]: https://codecov.io/github/syntax-tree/unist-util-remove-position

[downloads-badge]: https://img.shields.io/npm/dm/unist-util-remove-position.svg

[downloads]: https://www.npmjs.com/package/unist-util-remove-position

[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=unist-util-remove-position

[size]: https://bundlejs.com/?q=unist-util-remove-position

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[collective]: https://opencollective.com/unified

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/syntax-tree/unist/discussions

[npm]: https://docs.npmjs.com/cli/install

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[typescript]: https://www.typescriptlang.org

[license]: license

[author]: https://wooorm.com

[health]: https://github.com/syntax-tree/.github

[contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md

[support]: https://github.com/syntax-tree/.github/blob/main/support.md

[coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md

[unist]: https://github.com/syntax-tree/unist

[node]: https://github.com/syntax-tree/unist#node

[unist-util-position]: https://github.com/syntax-tree/unist-util-position

[unist-util-generated]: https://github.com/syntax-tree/unist-util-generated

[unist-util-stringify-position]: https://github.com/syntax-tree/unist-util-stringify-position

[removeposition]: #removepositionnode-options

[options]: #options
rmx '100644 index.d.ts >Ot.H100644 index.js >Ot.H40000 lib sQZ?FIDrZ>	100644 license `nΑz)asL100644 package.json 3EP'|]l΢i-100644 readme.md i,t(igBw+Px1 export {stringifyPosition} from './lib/index.js'
!xJ 100644 index.d.ts @2
eo6$k0x2~100644 index.js d`Za߶IL|;ٹ|:qx/**
 * @typedef {import('unist').Node} Node
 * @typedef {import('unist').Point} Point
 * @typedef {import('unist').Position} Position
 */
/**
 * @typedef NodeLike
 * @property {string} type
 * @property {PositionLike | null | undefined} [position]
 *
 * @typedef PointLike
 * @property {number | null | undefined} [line]
 * @property {number | null | undefined} [column]
 * @property {number | null | undefined} [offset]
 *
 * @typedef PositionLike
 * @property {PointLike | null | undefined} [start]
 * @property {PointLike | null | undefined} [end]
 */
/**
 * Serialize the positional info of a point, position (start and end points),
 * or node.
 *
 * @param {Node | NodeLike | Point | PointLike | Position | PositionLike | null | undefined} [value]
 *   Node, position, or point.
 * @returns {string}
 *   Pretty printed positional info of a node (`string`).
 *
 *   In the format of a range `ls:cs-le:ce` (when given `node` or `position`)
 *   or a point `l:c` (when given `point`), where `l` stands for line, `c` for
 *   column, `s` for `start`, and `e` for end.
 *   An empty string (`''`) is returned if the given value is neither `node`,
 *   `position`, nor `point`.
 */
export function stringifyPosition(
  value?:
    | Node
    | NodeLike
    | Point
    | PointLike
    | Position
    | PositionLike
    | null
    | undefined
): string
export type Node = import('unist').Node
export type Point = import('unist').Point
export type Position = import('unist').Position
export type NodeLike = {
  type: string
  position?: PositionLike | null | undefined
}
export type PointLike = {
  line?: number | null | undefined
  column?: number | null | undefined
  offset?: number | null | undefined
}
export type PositionLike = {
  start?: PointLike | null | undefined
  end?: PointLike | null | undefined
}
vebxK/**
 * @typedef {import('unist').Node} Node
 * @typedef {import('unist').Point} Point
 * @typedef {import('unist').Position} Position
 */

/**
 * @typedef NodeLike
 * @property {string} type
 * @property {PositionLike | null | undefined} [position]
 *
 * @typedef PointLike
 * @property {number | null | undefined} [line]
 * @property {number | null | undefined} [column]
 * @property {number | null | undefined} [offset]
 *
 * @typedef PositionLike
 * @property {PointLike | null | undefined} [start]
 * @property {PointLike | null | undefined} [end]
 */

/**
 * Serialize the positional info of a point, position (start and end points),
 * or node.
 *
 * @param {Node | NodeLike | Point | PointLike | Position | PositionLike | null | undefined} [value]
 *   Node, position, or point.
 * @returns {string}
 *   Pretty printed positional info of a node (`string`).
 *
 *   In the format of a range `ls:cs-le:ce` (when given `node` or `position`)
 *   or a point `l:c` (when given `point`), where `l` stands for line, `c` for
 *   column, `s` for `start`, and `e` for end.
 *   An empty string (`''`) is returned if the given value is neither `node`,
 *   `position`, nor `point`.
 */
export function stringifyPosition(value) {
  // Nothing.
  if (!value || typeof value !== 'object') {
    return ''
  }

  // Node.
  if ('position' in value || 'type' in value) {
    return position(value.position)
  }

  // Position.
  if ('start' in value || 'end' in value) {
    return position(value)
  }

  // Point.
  if ('line' in value || 'column' in value) {
    return point(value)
  }

  // ?
  return ''
}

/**
 * @param {Point | PointLike | null | undefined} point
 * @returns {string}
 */
function point(point) {
  return index(point && point.line) + ':' + index(point && point.column)
}

/**
 * @param {Position | PositionLike | null | undefined} pos
 * @returns {string}
 */
function position(pos) {
  return point(pos && pos.start) + '-' + point(pos && pos.end)
}

/**
 * @param {number | null | undefined} value
 * @returns {number}
 */
function index(value) {
  return value && typeof value === 'number' ? value : 1
}
fƼEfx 2	stringify49*Aserialize a node, position, or point as a human readable locationf 2point",
    "node",
    "stringify",
    "tostring%/	stringifyZA	stringifyrU^:"G5]xK//# ]pretty printof a nodQLstringifyPosition(node|position|point)`](#stringifypositionnodepositionpointY?+Security](#security)
*   [Related](#relatedPpackage is a utility that takes any [unist][] (whether mdast, hast, etc)
node, position, or point, and serializes its positional info9This utility is useful to display where something occurred in the original
document, in one standard way, for humans.
For examp<le, when throwing errors or warning messages about something)~h5	stringify*h@4,U	stringify*h@4.	stringify,h'

stringifyPosition({line: 2, column: 3}) // => '2:3' (point)
stringifyPosition({start: {line: 2}, end: {line: 3}}) // => '2:1-3:1' (position)
stringifyPosition({
  type: 'text',
  value: '!',
  position: {
    start: {line: 5, column: 11},
    end: {li2ne: 5, column: 12}
  }
}) // => '5:11-5:12' (node)
4stringifyPosition`][stringify	-2stringifyPosition(node|position|point)`

Serialize3of a point, position (start and end points), or
nod~;node whose `position` fields to serialize
*   `position` ([`Position`][position])
    — position whose `start` and `end` points to serialize
*   `point` ([`Point`][point])
    — point whose `line` and `column` fields to serialize

###### Returns

Pretty printed positional info of a node (`string`).

In the format of a range `ls:cs-le:ce` (when given `node` or `position`) or a
point `l:c` (when given `point`), where `l` stands for line, `c` for column, `s`
for `start`, and `e` for end.
An empty strinSg (`''`) is returned if the given value is neither `node`,
`position`, nor `point`.	Hno additional typesyh@^4#3Security

This project is safe.

## Related

*   [``](*	C)
    — check if a node is generated
*   [`unist-util-position`](*5position)
    — get positional info of nodes
*   [``](9	)
    —/ trees
*   [`unist-util-source`](*Fsource)
    — get the source of a value (node or position) in a file' in contributing] for ways to get
.?h|Nh[hCCh>h<h-h-hs2}H/#position

[pointQ"A#point

[stringifyposition]: #stringifypositionnodepositionpoint
#x '100644 index.d.ts і͛!:IIiD100644 index.js ^ai8nJ7r(40000 lib +)]f,aܠ100644 license `nΑz)asL100644 package.json 1p gI!C|a100644 readme.md .Z0@@1P>[Rx]export type {Test} from 'unist-util-is'
export type {
  Action,
  ActionTuple,
  BuildVisitor,
  // Undocumented: used in `unist-util-visit`:
  InclusiveDescendant,
  Index,
  // Undocumented: used in `unist-util-visit`:
  Matches,
  Visitor,
  VisitorResult
} from './lib/index.js'
export {CONTINUE, EXIT, SKIP, visitParents} from './lib/index.js'
uxl // Note: types exported from `index.d.ts`
export {CONTINUE, EXIT, SKIP, visitParents} from './lib/index.js'
$^xk100644 color.d.ts ّpXNg;100644 color.d.ts.map Q:nTu2HҲ100644 color.js U~&ȇj`100644 color.node.d.ts PA$h}100644 color.node.d.ts.map .hr}100644 color.node.js 64%иB100644 index.d.ts hR_2C[5O100644 index.d.ts.map ͺEs|[b#.100644 index.js q5ԽE(LIɳJx /**
 * @param {string} d
 * @returns {string}
 */
export function color(d: string): string;
//# sourceMappingURL=color.d.ts.mapn+"x s{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["color.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,yBAHW,MAAM,GACJ,MAAM,CAIlB"}gT+xZ /**
 * @param {string} d
 * @returns {string}
 */
export function color(d) {
  return d
}
5x {/**
 * @param {string} d
 * @returns {string}
 */
export function color(d: string): string;
//# sourceMappingURL=color.node.d.ts.mapLk,	x i{"version":3,"file":"color.node.d.ts","sourceRoot":"","sources":["color.node.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,yBAHW,MAAM,GACJ,MAAM,CAIlB"}k.xx /**
 * @param {string} d
 * @returns {string}
 */
export function color(d) {
  return '\u001B[33m' + d + '\u001B[39m'
}
$Qx"/**
 * Visit nodes, with ancestral information.
 *
 * This algorithm performs *depth-first* *tree traversal* in *preorder*
 * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).
 *
 * You can choose for which nodes `visitor` is called by passing a `test`.
 * For complex tests, you should test yourself in `visitor`, as it will be
 * faster and will have improved type information.
 *
 * Walking the tree is an intensive task.
 * Make use of the return values of the visitor when possible.
 * Instead of walking a tree multiple times, walk it once, use `unist-util-is`
 * to check if a node matches, and then perform different operations.
 *
 * You can change the tree.
 * See `Visitor` for more info.
 *
 * @overload
 * @param {Tree} tree
 * @param {Check} check
 * @param {BuildVisitor<Tree, Check>} visitor
 * @param {boolean | null | undefined} [reverse]
 * @returns {undefined}
 *
 * @overload
 * @param {Tree} tree
 * @param {BuildVisitor<Tree>} visitor
 * @param {boolean | null | undefined} [reverse]
 * @returns {undefined}
 *
 * @param {UnistNode} tree
 *   Tree to traverse.
 * @param {Visitor | Test} test
 *   `unist-util-is`-compatible test
 * @param {Visitor | boolean | null | undefined} [visitor]
 *   Handle each node.
 * @param {boolean | null | undefined} [reverse]
 *   Traverse in reverse preorder (NRL) instead of the default preorder (NLR).
 * @returns {undefined}
 *   Nothing.
 *
 * @template {UnistNode} Tree
 *   Node type.
 * @template {Test} Check
 *   `unist-util-is`-compatible test.
 */
export function visitParents<Tree extends UnistNode, Check extends Test>(tree: Tree, check: Check, visitor: BuildVisitor<Tree, Check>, reverse?: boolean | null | undefined): undefined;
/**
 * Visit nodes, with ancestral information.
 *
 * This algorithm performs *depth-first* *tree traversal* in *preorder*
 * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).
 *
 * You can choose for which nodes `visitor` is called by passing a `test`.
 * For complex tests, you should test yourself in `visitor`, as it will be
 * faster and will have improved type information.
 *
 * Walking the tree is an intensive task.
 * Make use of the return values of the visitor when possible.
 * Instead of walking a tree multiple times, walk it once, use `unist-util-is`
 * to check if a node matches, and then perform different operations.
 *
 * You can change the tree.
 * See `Visitor` for more info.
 *
 * @overload
 * @param {Tree} tree
 * @param {Check} check
 * @param {BuildVisitor<Tree, Check>} visitor
 * @param {boolean | null | undefined} [reverse]
 * @returns {undefined}
 *
 * @overload
 * @param {Tree} tree
 * @param {BuildVisitor<Tree>} visitor
 * @param {boolean | null | undefined} [reverse]
 * @returns {undefined}
 *
 * @param {UnistNode} tree
 *   Tree to traverse.
 * @param {Visitor | Test} test
 *   `unist-util-is`-compatible test
 * @param {Visitor | boolean | null | undefined} [visitor]
 *   Handle each node.
 * @param {boolean | null | undefined} [reverse]
 *   Traverse in reverse preorder (NRL) instead of the default preorder (NLR).
 * @returns {undefined}
 *   Nothing.
 *
 * @template {UnistNode} Tree
 *   Node type.
 * @template {Test} Check
 *   `unist-util-is`-compatible test.
 */
export function visitParents<Tree extends UnistNode, Check extends Test>(tree: Tree, visitor: BuildVisitor<Tree>, reverse?: boolean | null | undefined): undefined;
/**
 * Continue traversing as normal.
 */
export const CONTINUE: true;
/**
 * Stop traversing immediately.
 */
export const EXIT: false;
/**
 * Do not traverse this node’s children.
 */
export const SKIP: "skip";
/**
 * Test from `unist-util-is`.
 *
 * Note: we have remove and add `undefined`, because otherwise when generating
 * automatic `.d.ts` files, TS tries to flatten paths from a local perspective,
 * which doesn’t work when publishing on npm.
 */
export type Test = Exclude<import("unist-util-is").Test, undefined> | undefined;
/**
 * Get the value of a type guard `Fn`.
 */
export type Predicate<Fn, Fallback> = (Fn extends (value: any) => value is infer Thing ? Thing : Fallback);
/**
 * Check whether a node matches a primitive check in the type system.
 */
export type MatchesOne<Value, Check> = (Check extends null | undefined ? Value : Value extends {
    type: Check;
} ? Value : Value extends Check ? Value : Check extends Function ? Predicate<Check, Value> extends Value ? Predicate<Check, Value> : never : never);
/**
 * Check whether a node matches a check in the type system.
 */
export type Matches<Value, Check> = (Check extends ReadonlyArray<infer T> ? MatchesOne<Value, T> : Check extends Array<infer T> ? MatchesOne<Value, T> : MatchesOne<Value, Check>);
/**
 * Number; capped reasonably.
 */
export type Uint = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10;
/**
 * Increment a number in the type system.
 */
export type Increment<I extends Uint = 0> = I extends 0 ? 1 : I extends 1 ? 2 : I extends 2 ? 3 : I extends 3 ? 4 : I extends 4 ? 5 : I extends 5 ? 6 : I extends 6 ? 7 : I extends 7 ? 8 : I extends 8 ? 9 : 10;
/**
 * Collect nodes that can be parents of `Child`.
 */
export type InternalParent<Node extends UnistNode, Child extends UnistNode> = (Node extends UnistParent ? Node extends {
    children: Array<infer Children>;
} ? Child extends Children ? Node : never : never : never);
/**
 * Collect nodes in `Tree` that can be parents of `Child`.
 */
export type Parent<Tree extends UnistNode, Child extends UnistNode> = InternalParent<InclusiveDescendant<Tree>, Child>;
/**
 * Collect nodes in `Tree` that can be ancestors of `Child`.
 */
export type InternalAncestor<Node extends UnistNode, Child extends UnistNode, Max extends Uint = 10, Depth extends Uint = 0> = (Depth extends Max ? never : InternalParent<Node, Child> | InternalAncestor<Node, InternalParent<Node, Child>, Max, Increment<Depth>>);
/**
 * Collect nodes in `Tree` that can be ancestors of `Child`.
 */
export type Ancestor<Tree extends UnistNode, Child extends UnistNode> = InternalAncestor<InclusiveDescendant<Tree>, Child>;
/**
 * Collect all (inclusive) descendants of `Tree`.
 *
 * > 👉 **Note**: for performance reasons, this seems to be the fastest way to
 * > recurse without actually running into an infinite loop, which the
 * > previous version did.
 * >
 * > Practically, a max of `2` is typically enough assuming a `Root` is
 * > passed, but it doesn’t improve performance.
 * > It gets higher with `List > ListItem > Table > TableRow > TableCell`.
 * > Using up to `10` doesn’t hurt or help either.
 */
export type InclusiveDescendant<Tree extends UnistNode, Max extends Uint = 10, Depth extends Uint = 0> = (Tree extends UnistParent ? Depth extends Max ? Tree : Tree | InclusiveDescendant<Tree["children"][number], Max, Increment<Depth>> : Tree);
/**
 * Union of the action types.
 */
export type Action = "skip" | boolean;
/**
 * Move to the sibling at `index` next (after node itself is completely
 * traversed).
 *
 * Useful if mutating the tree, such as removing the node the visitor is
 * currently on, or any of its previous siblings.
 * Results less than 0 or greater than or equal to `children.length` stop
 * traversing the parent.
 */
export type Index = number;
/**
 * List with one or two values, the first an action, the second an index.
 */
export type ActionTuple = [(Action | null | undefined | void)?, (Index | null | undefined)?];
/**
 * Any value that can be returned from a visitor.
 */
export type VisitorResult = Action | ActionTuple | Index | null | undefined | void;
/**
 * Handle a node (matching `test`, if given).
 *
 * Visitors are free to transform `node`.
 * They can also transform the parent of node (the last of `ancestors`).
 *
 * Replacing `node` itself, if `SKIP` is not returned, still causes its
 * descendants to be walked (which is a bug).
 *
 * When adding or removing previous siblings of `node` (or next siblings, in
 * case of reverse), the `Visitor` should return a new `Index` to specify the
 * sibling to traverse after `node` is traversed.
 * Adding or removing next siblings of `node` (or previous siblings, in case
 * of reverse) is handled as expected without needing to return a new `Index`.
 *
 * Removing the children property of an ancestor still results in them being
 * traversed.
 */
export type Visitor<Visited extends UnistNode = UnistNode, VisitedParents extends UnistParent = UnistParent> = (node: Visited, ancestors: Array<VisitedParents>) => VisitorResult;
/**
 * Build a typed `Visitor` function from a tree and a test.
 *
 * It will infer which values are passed as `node` and which as `parents`.
 */
export type BuildVisitor<Tree extends UnistNode = UnistNode, Check extends Test = Test> = Visitor<Matches<InclusiveDescendant<Tree>, Check>, Ancestor<Tree, Matches<InclusiveDescendant<Tree>, Check>>>;
import type { Node as UnistNode } from 'unist';
import type { Parent as UnistParent } from 'unist';
//# sourceMappingURL=index.d.ts.map߲xR{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmQG,6BAwBsB,IAAI,SAAhB,SAAW,EAEJ,KAAK,SAAX,IAAK,QAzBR,IAAI,SACJ,KAAK,WACL,YAAY,CAAC,IAAI,EAAE,KAAK,CAAC,YACzB,OAAO,GAAG,IAAI,GAAG,SAAS,GACxB,SAAS,CAEnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAiBsB,IAAI,SAAhB,SAAW,EAEJ,KAAK,SAAX,IAAK,QAlBR,IAAI,WACJ,YAAY,CAAC,IAAI,CAAC,YAClB,OAAO,GAAG,IAAI,GAAG,SAAS,GACxB,SAAS,CAEnB;AA9CH;;GAEG;AACH,uBAAwB,IAAI,CAAA;AAE5B;;GAEG;AACH,mBAAoB,KAAK,CAAA;AAEzB;;GAEG;AACH,mBAAoB,MAAM,CAAA;;;;;;;;mBA1Ob,OAAO,CAAC,OAAO,eAAe,EAAE,IAAI,EAAE,SAAS,CAAC,GAAG,SAAS;;;;sBAe5D,EAAE,EAEF,QAAQ,IARR,CACR,EAAE,SAA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;;;4BAGlE,MAAM,GAAG,WAAW,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;;;;;;;;;;;;;;;;;;;oBAmCzC,OAAO,SAApB,SAAW,cAEI,cAAc,SAA7B,WAAa,yBAff,OAAO,aAEP,KAAK,CAAC,cAAc,CAAC,KAEnB,aAAa;;;;;;yBAoBA,IAAI,SAAjB,SAAW,cAEH,KAAK,SAAZ,IAAK,WANN,OAAO,CAAC,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,EAAE,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC,mBAAmB,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC;uCAjN/D,OAAO;2CAAP,OAAO"}<.x-/**
 * @import {Node as UnistNode, Parent as UnistParent} from 'unist'
 */

/**
 * @typedef {Exclude<import('unist-util-is').Test, undefined> | undefined} Test
 *   Test from `unist-util-is`.
 *
 *   Note: we have remove and add `undefined`, because otherwise when generating
 *   automatic `.d.ts` files, TS tries to flatten paths from a local perspective,
 *   which doesn’t work when publishing on npm.
 */

/**
 * @typedef {(
 *   Fn extends (value: any) => value is infer Thing
 *   ? Thing
 *   : Fallback
 * )} Predicate
 *   Get the value of a type guard `Fn`.
 * @template Fn
 *   Value; typically function that is a type guard (such as `(x): x is Y`).
 * @template Fallback
 *   Value to yield if `Fn` is not a type guard.
 */

/**
 * @typedef {(
 *   Check extends null | undefined // No test.
 *   ? Value
 *   : Value extends {type: Check} // String (type) test.
 *   ? Value
 *   : Value extends Check // Partial test.
 *   ? Value
 *   : Check extends Function // Function test.
 *   ? Predicate<Check, Value> extends Value
 *     ? Predicate<Check, Value>
 *     : never
 *   : never // Some other test?
 * )} MatchesOne
 *   Check whether a node matches a primitive check in the type system.
 * @template Value
 *   Value; typically unist `Node`.
 * @template Check
 *   Value; typically `unist-util-is`-compatible test, but not arrays.
 */

/**
 * @typedef {(
 *   Check extends ReadonlyArray<infer T>
 *   ? MatchesOne<Value, T>
 *   : Check extends Array<infer T>
 *   ? MatchesOne<Value, T>
 *   : MatchesOne<Value, Check>
 * )} Matches
 *   Check whether a node matches a check in the type system.
 * @template Value
 *   Value; typically unist `Node`.
 * @template Check
 *   Value; typically `unist-util-is`-compatible test.
 */

/**
 * @typedef {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10} Uint
 *   Number; capped reasonably.
 */

/**
 * @typedef {I extends 0 ? 1 : I extends 1 ? 2 : I extends 2 ? 3 : I extends 3 ? 4 : I extends 4 ? 5 : I extends 5 ? 6 : I extends 6 ? 7 : I extends 7 ? 8 : I extends 8 ? 9 : 10} Increment
 *   Increment a number in the type system.
 * @template {Uint} [I=0]
 *   Index.
 */

/**
 * @typedef {(
 *   Node extends UnistParent
 *   ? Node extends {children: Array<infer Children>}
 *     ? Child extends Children ? Node : never
 *     : never
 *   : never
 * )} InternalParent
 *   Collect nodes that can be parents of `Child`.
 * @template {UnistNode} Node
 *   All node types in a tree.
 * @template {UnistNode} Child
 *   Node to search for.
 */

/**
 * @typedef {InternalParent<InclusiveDescendant<Tree>, Child>} Parent
 *   Collect nodes in `Tree` that can be parents of `Child`.
 * @template {UnistNode} Tree
 *   All node types in a tree.
 * @template {UnistNode} Child
 *   Node to search for.
 */

/**
 * @typedef {(
 *   Depth extends Max
 *   ? never
 *   :
 *     | InternalParent<Node, Child>
 *     | InternalAncestor<Node, InternalParent<Node, Child>, Max, Increment<Depth>>
 * )} InternalAncestor
 *   Collect nodes in `Tree` that can be ancestors of `Child`.
 * @template {UnistNode} Node
 *   All node types in a tree.
 * @template {UnistNode} Child
 *   Node to search for.
 * @template {Uint} [Max=10]
 *   Max; searches up to this depth.
 * @template {Uint} [Depth=0]
 *   Current depth.
 */

/**
 * @typedef {InternalAncestor<InclusiveDescendant<Tree>, Child>} Ancestor
 *   Collect nodes in `Tree` that can be ancestors of `Child`.
 * @template {UnistNode} Tree
 *   All node types in a tree.
 * @template {UnistNode} Child
 *   Node to search for.
 */

/**
 * @typedef {(
 *   Tree extends UnistParent
 *     ? Depth extends Max
 *       ? Tree
 *       : Tree | InclusiveDescendant<Tree['children'][number], Max, Increment<Depth>>
 *     : Tree
 * )} InclusiveDescendant
 *   Collect all (inclusive) descendants of `Tree`.
 *
 *   > 👉 **Note**: for performance reasons, this seems to be the fastest way to
 *   > recurse without actually running into an infinite loop, which the
 *   > previous version did.
 *   >
 *   > Practically, a max of `2` is typically enough assuming a `Root` is
 *   > passed, but it doesn’t improve performance.
 *   > It gets higher with `List > ListItem > Table > TableRow > TableCell`.
 *   > Using up to `10` doesn’t hurt or help either.
 * @template {UnistNode} Tree
 *   Tree type.
 * @template {Uint} [Max=10]
 *   Max; searches up to this depth.
 * @template {Uint} [Depth=0]
 *   Current depth.
 */

/**
 * @typedef {'skip' | boolean} Action
 *   Union of the action types.
 *
 * @typedef {number} Index
 *   Move to the sibling at `index` next (after node itself is completely
 *   traversed).
 *
 *   Useful if mutating the tree, such as removing the node the visitor is
 *   currently on, or any of its previous siblings.
 *   Results less than 0 or greater than or equal to `children.length` stop
 *   traversing the parent.
 *
 * @typedef {[(Action | null | undefined | void)?, (Index | null | undefined)?]} ActionTuple
 *   List with one or two values, the first an action, the second an index.
 *
 * @typedef {Action | ActionTuple | Index | null | undefined | void} VisitorResult
 *   Any value that can be returned from a visitor.
 */

/**
 * @callback Visitor
 *   Handle a node (matching `test`, if given).
 *
 *   Visitors are free to transform `node`.
 *   They can also transform the parent of node (the last of `ancestors`).
 *
 *   Replacing `node` itself, if `SKIP` is not returned, still causes its
 *   descendants to be walked (which is a bug).
 *
 *   When adding or removing previous siblings of `node` (or next siblings, in
 *   case of reverse), the `Visitor` should return a new `Index` to specify the
 *   sibling to traverse after `node` is traversed.
 *   Adding or removing next siblings of `node` (or previous siblings, in case
 *   of reverse) is handled as expected without needing to return a new `Index`.
 *
 *   Removing the children property of an ancestor still results in them being
 *   traversed.
 * @param {Visited} node
 *   Found node.
 * @param {Array<VisitedParents>} ancestors
 *   Ancestors of `node`.
 * @returns {VisitorResult}
 *   What to do next.
 *
 *   An `Index` is treated as a tuple of `[CONTINUE, Index]`.
 *   An `Action` is treated as a tuple of `[Action]`.
 *
 *   Passing a tuple back only makes sense if the `Action` is `SKIP`.
 *   When the `Action` is `EXIT`, that action can be returned.
 *   When the `Action` is `CONTINUE`, `Index` can be returned.
 * @template {UnistNode} [Visited=UnistNode]
 *   Visited node type.
 * @template {UnistParent} [VisitedParents=UnistParent]
 *   Ancestor type.
 */

/**
 * @typedef {Visitor<Matches<InclusiveDescendant<Tree>, Check>, Ancestor<Tree, Matches<InclusiveDescendant<Tree>, Check>>>} BuildVisitor
 *   Build a typed `Visitor` function from a tree and a test.
 *
 *   It will infer which values are passed as `node` and which as `parents`.
 * @template {UnistNode} [Tree=UnistNode]
 *   Tree type.
 * @template {Test} [Check=Test]
 *   Test type.
 */

import {convert} from 'unist-util-is'
import {color} from 'unist-util-visit-parents/do-not-use-color'

/** @type {Readonly<ActionTuple>} */
const empty = []

/**
 * Continue traversing as normal.
 */
export const CONTINUE = true

/**
 * Stop traversing immediately.
 */
export const EXIT = false

/**
 * Do not traverse this node’s children.
 */
export const SKIP = 'skip'

/**
 * Visit nodes, with ancestral information.
 *
 * This algorithm performs *depth-first* *tree traversal* in *preorder*
 * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).
 *
 * You can choose for which nodes `visitor` is called by passing a `test`.
 * For complex tests, you should test yourself in `visitor`, as it will be
 * faster and will have improved type information.
 *
 * Walking the tree is an intensive task.
 * Make use of the return values of the visitor when possible.
 * Instead of walking a tree multiple times, walk it once, use `unist-util-is`
 * to check if a node matches, and then perform different operations.
 *
 * You can change the tree.
 * See `Visitor` for more info.
 *
 * @overload
 * @param {Tree} tree
 * @param {Check} check
 * @param {BuildVisitor<Tree, Check>} visitor
 * @param {boolean | null | undefined} [reverse]
 * @returns {undefined}
 *
 * @overload
 * @param {Tree} tree
 * @param {BuildVisitor<Tree>} visitor
 * @param {boolean | null | undefined} [reverse]
 * @returns {undefined}
 *
 * @param {UnistNode} tree
 *   Tree to traverse.
 * @param {Visitor | Test} test
 *   `unist-util-is`-compatible test
 * @param {Visitor | boolean | null | undefined} [visitor]
 *   Handle each node.
 * @param {boolean | null | undefined} [reverse]
 *   Traverse in reverse preorder (NRL) instead of the default preorder (NLR).
 * @returns {undefined}
 *   Nothing.
 *
 * @template {UnistNode} Tree
 *   Node type.
 * @template {Test} Check
 *   `unist-util-is`-compatible test.
 */
export function visitParents(tree, test, visitor, reverse) {
  /** @type {Test} */
  let check

  if (typeof test === 'function' && typeof visitor !== 'function') {
    reverse = visitor
    // @ts-expect-error no visitor given, so `visitor` is test.
    visitor = test
  } else {
    // @ts-expect-error visitor given, so `test` isn’t a visitor.
    check = test
  }

  const is = convert(check)
  const step = reverse ? -1 : 1

  factory(tree, undefined, [])()

  /**
   * @param {UnistNode} node
   * @param {number | undefined} index
   * @param {Array<UnistParent>} parents
   */
  function factory(node, index, parents) {
    const value = /** @type {Record<string, unknown>} */ (
      node && typeof node === 'object' ? node : {}
    )

    if (typeof value.type === 'string') {
      const name =
        // `hast`
        typeof value.tagName === 'string'
          ? value.tagName
          : // `xast`
            typeof value.name === 'string'
            ? value.name
            : undefined

      Object.defineProperty(visit, 'name', {
        value:
          'node (' + color(node.type + (name ? '<' + name + '>' : '')) + ')'
      })
    }

    return visit

    function visit() {
      /** @type {Readonly<ActionTuple>} */
      let result = empty
      /** @type {Readonly<ActionTuple>} */
      let subresult
      /** @type {number} */
      let offset
      /** @type {Array<UnistParent>} */
      let grandparents

      if (!test || is(node, index, parents[parents.length - 1] || undefined)) {
        // @ts-expect-error: `visitor` is now a visitor.
        result = toResult(visitor(node, parents))

        if (result[0] === EXIT) {
          return result
        }
      }

      if ('children' in node && node.children) {
        const nodeAsParent = /** @type {UnistParent} */ (node)

        if (nodeAsParent.children && result[0] !== SKIP) {
          offset = (reverse ? nodeAsParent.children.length : -1) + step
          grandparents = parents.concat(nodeAsParent)

          while (offset > -1 && offset < nodeAsParent.children.length) {
            const child = nodeAsParent.children[offset]

            subresult = factory(child, offset, grandparents)()

            if (subresult[0] === EXIT) {
              return subresult
            }

            offset =
              typeof subresult[1] === 'number' ? subresult[1] : offset + step
          }
        }
      }

      return result
    }
  }
}

/**
 * Turn a return value into a clean result.
 *
 * @param {VisitorResult} value
 *   Valid return values from visitors.
 * @returns {Readonly<ActionTuple>}
 *   Clean result.
 */
function toResult(value) {
  if (Array.isArray(value)) {
    return value
  }

  if (typeof value === 'number') {
    return [CONTINUE, value]
  }

  return value === null || value === undefined ? empty : [value]
}
㳤xC
{
  "name": "unist-util-visit-parents",
  "version": "6.0.2",
  "description": "unist utility to recursively walk over nodes, with ancestral information",
  "license": "MIT",
  "keywords": [
    "unist",
    "unist-util",
    "util",
    "utility",
    "tree",
    "ast",
    "visit",
    "traverse",
    "walk",
    "check",
    "parent",
    "parents"
  ],
  "repository": "syntax-tree/unist-util-visit-parents",
  "bugs": "https://github.com/syntax-tree/unist-util-visit-parents/issues",
  "funding": {
    "type": "opencollective",
    "url": "https://opencollective.com/unified"
  },
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "sideEffects": false,
  "type": "module",
  "exports": {
    ".": "./index.js",
    "./do-not-use-color": {
      "node": "./lib/color.node.js",
      "default": "./lib/color.js"
    }
  },
  "types": "index.d.ts",
  "files": [
    "lib/",
    "index.d.ts.map",
    "index.d.ts",
    "index.js"
  ],
  "dependencies": {
    "@types/unist": "^3.0.0",
    "unist-util-is": "^6.0.0"
  },
  "devDependencies": {
    "@types/hast": "^3.0.0",
    "@types/mdast": "^4.0.0",
    "@types/node": "^24.0.0",
    "@types/xast": "^2.0.0",
    "c8": "^10.0.0",
    "mdast-util-from-markdown": "^2.0.0",
    "mdast-util-gfm": "^3.0.0",
    "micromark-extension-gfm": "^3.0.0",
    "prettier": "^3.0.0",
    "remark-cli": "^12.0.0",
    "remark-preset-wooorm": "^10.0.0",
    "strip-ansi": "^7.0.0",
    "tsd": "^0.33.0",
    "type-coverage": "^2.0.0",
    "typescript": "^5.0.0",
    "xo": "^0.58.0"
  },
  "scripts": {
    "prepack": "npm run build && npm run format",
    "build": "tsc --build --clean && tsc --build && tsd && type-coverage",
    "format": "remark . -qfo && prettier . -w --log-level warn && xo --fix",
    "test-api": "node --conditions development test.js",
    "test-coverage": "c8 --100 --reporter lcov npm run test-api",
    "test": "npm run build && npm run format && npm run test-coverage"
  },
  "prettier": {
    "bracketSpacing": false,
    "semi": false,
    "singleQuote": true,
    "tabWidth": 2,
    "trailingComma": "none",
    "useTabs": false
  },
  "remarkConfig": {
    "plugins": [
      "remark-preset-wooorm"
    ]
  },
  "typeCoverage": {
    "atLeast": 100,
    "detail": true,
    "#": "needed `any`s",
    "ignoreFiles": [
      "lib/index.d.ts"
    ],
    "ignoreCatch": true,
    "strict": true
  },
  "xo": {
    "prettier": true,
    "rules": {
      "unicorn/prefer-at": "off",
      "unicorn/prefer-string-replace-all": "off"
    }
  }
}
O󎻂x+(# unist-util-visit-parents

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]
[![Sponsors][sponsors-badge]][collective]
[![Backers][backers-badge]][collective]
[![Chat][chat-badge]][chat]

[unist][] utility to walk the tree with a stack of parents.

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`visitParents(tree[, test], visitor[, reverse])`](#visitparentstree-test-visitor-reverse)
  * [`CONTINUE`](#continue)
  * [`EXIT`](#exit)
  * [`SKIP`](#skip)
  * [`Action`](#action)
  * [`ActionTuple`](#actiontuple)
  * [`BuildVisitor`](#buildvisitor)
  * [`Index`](#index)
  * [`Test`](#test)
  * [`Visitor`](#visitor)
  * [`VisitorResult`](#visitorresult)
* [Types](#types)
* [Compatibility](#compatibility)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This is a very important utility for working with unist as it lets you walk the
tree.

## When should I use this?

You can use this utility when you want to walk the tree and want to know about
every parent of each node.
You can use [`unist-util-visit`][unist-util-visit] if you don’t care about the
entire stack of parents.

## Install

This package is [ESM only][esm].
In Node.js (version 16+), install with [npm][]:

```sh
npm install unist-util-visit-parents
```

In Deno with [`esm.sh`][esmsh]:

```js
import {visitParents} from 'https://esm.sh/unist-util-visit-parents@6'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {visitParents} from 'https://esm.sh/unist-util-visit-parents@6?bundle'
</script>
```

## Use

```js
import {visitParents} from 'unist-util-visit-parents'
import {fromMarkdown} from 'mdast-util-from-markdown'

const tree = fromMarkdown('Some *emphasis*, **strong**, and `code`.')

visitParents(tree, 'strong', function (node, ancestors) {
  console.log(node.type, ancestors.map(ancestor => ancestor.type))
})
```

Yields:

```js
strong ['root', 'paragraph']
```

## API

This package exports the identifiers [`CONTINUE`][api-continue],
[`EXIT`][api-exit], [`SKIP`][api-skip], and [`visitParents`][api-visitparents].
There is no default export.

### `visitParents(tree[, test], visitor[, reverse])`

Visit nodes, with ancestral information.

This algorithm performs *[depth-first][]* *[tree traversal][tree-traversal]*
in *[preorder][]* (**NLR**) or if `reverse` is given, in *reverse preorder*
(**NRL**).

You can choose for which nodes `visitor` is called by passing a `test`.
For complex tests, you should test yourself in `visitor`, as it will be
faster and will have improved type information.

Walking the tree is an intensive task.
Make use of the return values of the visitor when possible.
Instead of walking a tree multiple times, walk it once, use
[`unist-util-is`][unist-util-is] to check if a node matches, and then perform
different operations.

You can change the tree.
See [`Visitor`][api-visitor] for more info.

###### Parameters

* `tree` ([`Node`][node])
  — tree to traverse
* `test` ([`Test`][api-test], optional)
  — [`unist-util-is`][unist-util-is]-compatible test
* `visitor` ([`Visitor`][api-visitor])
  — handle each node
* `reverse` (`boolean`, default: `false`)
  — traverse in reverse preorder (NRL) instead of the default preorder (NLR)

###### Returns

Nothing (`undefined`).

### `CONTINUE`

Continue traversing as normal (`true`).

### `EXIT`

Stop traversing immediately (`false`).

### `SKIP`

Do not traverse this node’s children (`'skip'`).

### `Action`

Union of the action types (TypeScript type).

###### Type

```ts
type Action = typeof CONTINUE | typeof EXIT | typeof SKIP
```

### `ActionTuple`

List with one or two values, the first an action, the second an index
(TypeScript type).

###### Type

```ts
type ActionTuple = [
  (Action | null | undefined | void)?,
  (Index | null | undefined)?
]
```

### `BuildVisitor`

Build a typed `Visitor` function from a tree and a test (TypeScript type).

It will infer which values are passed as `node` and which as `parents`.

###### Type parameters

* `Tree` ([`Node`][node], default: `Node`)
  — tree type
* `Check` ([`Test`][api-test], default: `Test`)
  — test type

###### Returns

[`Visitor`][api-visitor].

### `Index`

Move to the sibling at `index` next (after node itself is completely
traversed) (TypeScript type).

Useful if mutating the tree, such as removing the node the visitor is currently
on, or any of its previous siblings.
Results less than `0` or greater than or equal to `children.length` stop
traversing the parent.

###### Type

```ts
type Index = number
```

### `Test`

[`unist-util-is`][unist-util-is] compatible test (TypeScript type).

### `Visitor`

Handle a node (matching `test`, if given) (TypeScript type).

Visitors are free to transform `node`.
They can also transform the parent of node (the last of `ancestors`).

Replacing `node` itself, if `SKIP` is not returned, still causes its
descendants to be walked (which is a bug).

When adding or removing previous siblings of `node` (or next siblings, in
case of reverse), the `Visitor` should return a new `Index` to specify the
sibling to traverse after `node` is traversed.
Adding or removing next siblings of `node` (or previous siblings, in case
of reverse) is handled as expected without needing to return a new `Index`.

Removing the children property of an ancestor still results in them being
traversed.

###### Parameters

* `node` ([`Node`][node])
  — found node
* `parents` ([`Array<Node>`][node])
  — ancestors of `node`

###### Returns

What to do next.

An `Index` is treated as a tuple of `[CONTINUE, Index]`.
An `Action` is treated as a tuple of `[Action]`.

Passing a tuple back only makes sense if the `Action` is `SKIP`.
When the `Action` is `EXIT`, that action can be returned.
When the `Action` is `CONTINUE`, `Index` can be returned.

### `VisitorResult`

Any value that can be returned from a visitor (TypeScript type).

###### Type

```ts
type VisitorResult =
  | Action
  | ActionTuple
  | Index
  | null
  | undefined
  | void
```

## Types

This package is fully typed with [TypeScript][].
It exports the additional types [`Action`][api-action],
[`ActionTuple`][api-actiontuple], [`BuildVisitor`][api-buildvisitor],
[`Index`][api-index], [`Test`][api-test], [`Visitor`][api-visitor], and
[`VisitorResult`][api-visitorresult].

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line,
`unist-util-visit-parents@^6`, compatible with Node.js 16.

## Related

* [`unist-util-visit`](https://github.com/syntax-tree/unist-util-visit)
  — walk the tree with one parent
* [`unist-util-filter`](https://github.com/syntax-tree/unist-util-filter)
  — create a new tree with all nodes that pass a test
* [`unist-util-map`](https://github.com/syntax-tree/unist-util-map)
  — create a new tree with all nodes mapped by a given function
* [`unist-util-flatmap`](https://gitlab.com/staltz/unist-util-flatmap)
  — create a new tree by mapping (to an array) with the given function
* [`unist-util-remove`](https://github.com/syntax-tree/unist-util-remove)
  — remove nodes from a tree that pass a test
* [`unist-util-select`](https://github.com/syntax-tree/unist-util-select)
  — select nodes with CSS-like selectors

## Contribute

See [`contributing.md`][contributing] in [`syntax-tree/.github`][health] for
ways to get started.
See [`support.md`][support] for ways to get help.

This project has a [code of conduct][coc].
By interacting with this repository, organization, or community you agree to
abide by its terms.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definition -->

[build-badge]: https://github.com/syntax-tree/unist-util-visit-parents/workflows/main/badge.svg

[build]: https://github.com/syntax-tree/unist-util-visit-parents/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-visit-parents.svg

[coverage]: https://codecov.io/github/syntax-tree/unist-util-visit-parents

[downloads-badge]: https://img.shields.io/npm/dm/unist-util-visit-parents.svg

[downloads]: https://www.npmjs.com/package/unist-util-visit-parents

[size-badge]: https://img.shields.io/badge/dynamic/json?label=minzipped%20size&query=$.size.compressedSize&url=https://deno.bundlejs.com/?q=unist-util-visit-parents

[size]: https://bundlejs.com/?q=unist-util-visit-parents

[sponsors-badge]: https://opencollective.com/unified/sponsors/badge.svg

[backers-badge]: https://opencollective.com/unified/backers/badge.svg

[collective]: https://opencollective.com/unified

[chat-badge]: https://img.shields.io/badge/chat-discussions-success.svg

[chat]: https://github.com/syntax-tree/unist/discussions

[npm]: https://docs.npmjs.com/cli/install

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[typescript]: https://www.typescriptlang.org

[license]: license

[author]: https://wooorm.com

[health]: https://github.com/syntax-tree/.github

[contributing]: https://github.com/syntax-tree/.github/blob/HEAD/contributing.md

[support]: https://github.com/syntax-tree/.github/blob/HEAD/support.md

[coc]: https://github.com/syntax-tree/.github/blob/HEAD/code-of-conduct.md

[unist]: https://github.com/syntax-tree/unist

[node]: https://github.com/syntax-tree/unist#node

[depth-first]: https://github.com/syntax-tree/unist#depth-first-traversal

[tree-traversal]: https://github.com/syntax-tree/unist#tree-traversal

[preorder]: https://github.com/syntax-tree/unist#preorder

[unist-util-visit]: https://github.com/syntax-tree/unist-util-visit

[unist-util-is]: https://github.com/syntax-tree/unist-util-is

[api-visitparents]: #visitparentstree-test-visitor-reverse

[api-continue]: #continue

[api-exit]: #exit

[api-skip]: #skip

[api-action]: #action

[api-actiontuple]: #actiontuple

[api-buildvisitor]: #buildvisitor

[api-index]: #index

[api-test]: #test

[api-visitor]: #visitor

[api-visitorresult]: #visitorresult
-$x '100644 index.d.ts 
3ZHBwF:̟`3s100644 index.js GG'ͩ~zfz40000 lib #ez?Ѷ#fa2100644 license 2<tD?U100644 package.json s`ӸǢ=14100644 readme.md O"i@WiIM2U3x  export type {Test} from 'unist-util-is'
export type {
  Action,
  ActionTuple,
  Index,
  VisitorResult
} from 'unist-util-visit-parents'
export type {Visitor, BuildVisitor} from './lib/index.js'
export {CONTINUE, EXIT, SKIP, visit} from './lib/index.js'
cW޵xe // Note: types exported from `index.d.ts`
export {CONTINUE, EXIT, SKIP, visit} from './lib/index.js'
!xt 100644 index.d.ts :iM100644 index.d.ts.map -]zJaS*&{BHճ100644 index.js i{)D֋h:Cȶ-(;NxNEC/**
 * Visit nodes.@	OrVisitor%# (optional, omit to pass a visitor)M$	OrReverse( (when test is omitted, pass `reverse`).)maybeReverse=fal.@	OrVisitor%# (optional, omit to pass a visitor)M$	OrReverse( (when test is omitted, pass `reverse`).)maybeReverse=fal9V=any1Check[number]Hs`parent``parent`8 jAncestor 6index: { .? number | undefined : never, parent: Ancestor ? Ancestor | undefined : never!Cnode and all possible parentsX!L!	FromMatchz 
, Ancestor /> = Visitor<Visited, Parent<Ancestor, Visited>>!1list of descendantsM!W!FromDescendants<Descendant'X = (BuildVisitorFromMatch<Matches<Descendant, Check>, Extract<Descendant, UnistParent>>)!!a(BuildVisitorFromDescendantN"#)s"fimport type { VisitorResult } from 'unist-util-visit-parents';
export { CONTINUE, EXIT, SKIP } from "unist-util-visit-parents";"$L)xgwPG,sBAw`*s];;;;;;;mBA/PUO>iBeS,KAAK,EAEL,KAAK,IAR,GAAG,CAAC,GAC9 GhC;;;;;;;;;gCA8B'}	eoBAoDsB,OAAO,SAApB,SAAW,cAEI,QAAQ,SAAvB,WAAa,yBAjBf,OAAO,SAEP,OAAO,SAAS,SAAS,GAAG,MAAM,GAAG,SAAS,GAAG,KAAK,UAEtD,QAAQ,SAAS,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,KAAK,KAEzD,aAAa;;;;;;kCAoBD,OAAO,SAAnB,SAAW,EAEG,QAAQ,SAAtB,WAAa,IANb,OAAO,CAAC,OAAO,EAAE,MAAM,CAAC,Q.AAQ,EAAE,OAAO,CAAC,CAAC;;;;;;wCAoB/B,UAAU,SAAtmIAXN,CACR,qBAAqB,CACnB,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,EAC1B,OAAO,CAAC,UAAU,EAAE,WAAW,CAAC,CACjC,CACF;;;;;;yBAoBsB,IAAI,SAAjB,SAAXN,CACR,2BAA2B,CACzB:CzB,KAAK,CACN,CACF;uCAvNuD,OAAO;2CAAP,OAAO;mCAClC,0BAA0B"}߶/xn%/**
 * @import {Node as UnistNode, Parent as UnistParent} from 'unist'
 * @import {VisitorResult} from 'unist-util-visit-parents'
 */

/**
 * @typedef {Exclude<import('unist-util-is').Test, undefined> | undefined} Test
 *   Test from `unist-util-is`.
 *
 *   Note: we have remove and add `undefined`, because otherwise when generating
 *   automatic `.d.ts` files, TS tries to flatten paths from a local perspective,
 *   which doesn’t work when publishing on npm.
 */

// To do: use types from `unist-util-visit-parents` when it’s released.

/**
 * @typedef {(
 *   Fn extends (value: any) => value is infer Thing
 *   ? Thing
 *   : Fallback
 * )} Predicate
 *   Get the value of a type guard `Fn`.
 * @template Fn
 *   Value; typically function that is a type guard (such as `(x): x is Y`).
 * @template Fallback
 *   Value to yield if `Fn` is not a type guard.
 */

/**
 * @typedef {(
 *   Check extends null | undefined // No test.
 *   ? Value
 *   : Value extends {type: Check} // String (type) test.
 *   ? Value
 *   : Value extends Check // Partial test.
 *   ? Value
 *   : Check extends Function // Function test.
 *   ? Predicate<Check, Value> extends Value
 *     ? Predicate<Check, Value>
 *     : never
 *   : never // Some other test?
 * )} MatchesOne
 *   Check whether a node matches a primitive check in the type system.
 * @template Value
 *   Value; typically unist `Node`.
 * @template Check
 *   Value; typically `unist-util-is`-compatible test, but not arrays.
 */

/**
 * @typedef {(
 *   Check extends ReadonlyArray<any>
 *   ? MatchesOne<Value, Check[number]>
 *   : MatchesOne<Value, Check>
 * )} Matches
 *   Check whether a node matches a check in the type system.
 * @template Value
 *   Value; typically unist `Node`.
 * @template Check
 *   Value; typically `unist-util-is`-compatible test.
 */

/**
 * @typedef {0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10} Uint
 *   Number; capped reasonably.
 */

/**
 * @typedef {I extends 0 ? 1 : I extends 1 ? 2 : I extends 2 ? 3 : I extends 3 ? 4 : I extends 4 ? 5 : I extends 5 ? 6 : I extends 6 ? 7 : I extends 7 ? 8 : I extends 8 ? 9 : 10} Increment
 *   Increment a number in the type system.
 * @template {Uint} [I=0]
 *   Index.
 */

/**
 * @typedef {(
 *   Node extends UnistParent
 *   ? Node extends {children: Array<infer Children>}
 *     ? Child extends Children ? Node : never
 *     : never
 *   : never
 * )} InternalParent
 *   Collect nodes that can be parents of `Child`.
 * @template {UnistNode} Node
 *   All node types in a tree.
 * @template {UnistNode} Child
 *   Node to search for.
 */

/**
 * @typedef {InternalParent<InclusiveDescendant<Tree>, Child>} Parent
 *   Collect nodes in `Tree` that can be parents of `Child`.
 * @template {UnistNode} Tree
 *   All node types in a tree.
 * @template {UnistNode} Child
 *   Node to search for.
 */

/**
 * @typedef {(
 *   Depth extends Max
 *   ? never
 *   :
 *     | InternalParent<Node, Child>
 *     | InternalAncestor<Node, InternalParent<Node, Child>, Max, Increment<Depth>>
 * )} InternalAncestor
 *   Collect nodes in `Tree` that can be ancestors of `Child`.
 * @template {UnistNode} Node
 *   All node types in a tree.
 * @template {UnistNode} Child
 *   Node to search for.
 * @template {Uint} [Max=10]
 *   Max; searches up to this depth.
 * @template {Uint} [Depth=0]
 *   Current depth.
 */

/**
 * @typedef {(
 *   Tree extends UnistParent
 *     ? Depth extends Max
 *       ? Tree
 *       : Tree | InclusiveDescendant<Tree['children'][number], Max, Increment<Depth>>
 *     : Tree
 * )} InclusiveDescendant
 *   Collect all (inclusive) descendants of `Tree`.
 *
 *   > 👉 **Note**: for performance reasons, this seems to be the fastest way to
 *   > recurse without actually running into an infinite loop, which the
 *   > previous version did.
 *   >
 *   > Practically, a max of `2` is typically enough assuming a `Root` is
 *   > passed, but it doesn’t improve performance.
 *   > It gets higher with `List > ListItem > Table > TableRow > TableCell`.
 *   > Using up to `10` doesn’t hurt or help either.
 * @template {UnistNode} Tree
 *   Tree type.
 * @template {Uint} [Max=10]
 *   Max; searches up to this depth.
 * @template {Uint} [Depth=0]
 *   Current depth.
 */

/**
 * @callback Visitor
 *   Handle a node (matching `test`, if given).
 *
 *   Visitors are free to transform `node`.
 *   They can also transform `parent`.
 *
 *   Replacing `node` itself, if `SKIP` is not returned, still causes its
 *   descendants to be walked (which is a bug).
 *
 *   When adding or removing previous siblings of `node` (or next siblings, in
 *   case of reverse), the `Visitor` should return a new `Index` to specify the
 *   sibling to traverse after `node` is traversed.
 *   Adding or removing next siblings of `node` (or previous siblings, in case
 *   of reverse) is handled as expected without needing to return a new `Index`.
 *
 *   Removing the children property of `parent` still results in them being
 *   traversed.
 * @param {Visited} node
 *   Found node.
 * @param {Visited extends UnistNode ? number | undefined : never} index
 *   Index of `node` in `parent`.
 * @param {Ancestor extends UnistParent ? Ancestor | undefined : never} parent
 *   Parent of `node`.
 * @returns {VisitorResult}
 *   What to do next.
 *
 *   An `Index` is treated as a tuple of `[CONTINUE, Index]`.
 *   An `Action` is treated as a tuple of `[Action]`.
 *
 *   Passing a tuple back only makes sense if the `Action` is `SKIP`.
 *   When the `Action` is `EXIT`, that action can be returned.
 *   When the `Action` is `CONTINUE`, `Index` can be returned.
 * @template {UnistNode} [Visited=UnistNode]
 *   Visited node type.
 * @template {UnistParent} [Ancestor=UnistParent]
 *   Ancestor type.
 */

/**
 * @typedef {Visitor<Visited, Parent<Ancestor, Visited>>} BuildVisitorFromMatch
 *   Build a typed `Visitor` function from a node and all possible parents.
 *
 *   It will infer which values are passed as `node` and which as `parent`.
 * @template {UnistNode} Visited
 *   Node type.
 * @template {UnistParent} Ancestor
 *   Parent type.
 */

/**
 * @typedef {(
 *   BuildVisitorFromMatch<
 *     Matches<Descendant, Check>,
 *     Extract<Descendant, UnistParent>
 *   >
 * )} BuildVisitorFromDescendants
 *   Build a typed `Visitor` function from a list of descendants and a test.
 *
 *   It will infer which values are passed as `node` and which as `parent`.
 * @template {UnistNode} Descendant
 *   Node type.
 * @template {Test} Check
 *   Test type.
 */

/**
 * @typedef {(
 *   BuildVisitorFromDescendants<
 *     InclusiveDescendant<Tree>,
 *     Check
 *   >
 * )} BuildVisitor
 *   Build a typed `Visitor` function from a tree and a test.
 *
 *   It will infer which values are passed as `node` and which as `parent`.
 * @template {UnistNode} [Tree=UnistNode]
 *   Node type.
 * @template {Test} [Check=Test]
 *   Test type.
 */

import {visitParents} from 'unist-util-visit-parents'

export {CONTINUE, EXIT, SKIP} from 'unist-util-visit-parents'

/**
 * Visit nodes.
 *
 * This algorithm performs *depth-first* *tree traversal* in *preorder*
 * (**NLR**) or if `reverse` is given, in *reverse preorder* (**NRL**).
 *
 * You can choose for which nodes `visitor` is called by passing a `test`.
 * For complex tests, you should test yourself in `visitor`, as it will be
 * faster and will have improved type information.
 *
 * Walking the tree is an intensive task.
 * Make use of the return values of the visitor when possible.
 * Instead of walking a tree multiple times, walk it once, use `unist-util-is`
 * to check if a node matches, and then perform different operations.
 *
 * You can change the tree.
 * See `Visitor` for more info.
 *
 * @overload
 * @param {Tree} tree
 * @param {Check} check
 * @param {BuildVisitor<Tree, Check>} visitor
 * @param {boolean | null | undefined} [reverse]
 * @returns {undefined}
 *
 * @overload
 * @param {Tree} tree
 * @param {BuildVisitor<Tree>} visitor
 * @param {boolean | null | undefined} [reverse]
 * @returns {undefined}
 *
 * @param {UnistNode} tree
 *   Tree to traverse.
 * @param {Visitor | Test} testOrVisitor
 *   `unist-util-is`-compatible test (optional, omit to pass a visitor).
 * @param {Visitor | boolean | null | undefined} [visitorOrReverse]
 *   Handle each node (when test is omitted, pass `reverse`).
 * @param {boolean | null | undefined} [maybeReverse=false]
 *   Traverse in reverse preorder (NRL) instead of the default preorder (NLR).
 * @returns {undefined}
 *   Nothing.
 *
 * @template {UnistNode} Tree
 *   Node type.
 * @template {Test} Check
 *   `unist-util-is`-compatible test.
 */
export function visit(tree, testOrVisitor, visitorOrReverse, maybeReverse) {
  /** @type {boolean | null | undefined} */
  let reverse
  /** @type {Test} */
  let test
  /** @type {Visitor} */
  let visitor

  if (
    typeof testOrVisitor === 'function' &&
    typeof visitorOrReverse !== 'function'
  ) {
    test = undefined
    visitor = testOrVisitor
    reverse = visitorOrReverse
  } else {
    // @ts-expect-error: assume the overload with test was given.
    test = testOrVisitor
    // @ts-expect-error: assume the overload with test was given.
    visitor = visitorOrReverse
    reverse = maybeReverse
  }

  visitParents(tree, test, overload, reverse)

  /**
   * @param {UnistNode} node
   * @param {Array<UnistParent>} parents
   */
  function overload(node, parents) {
    const parent = parents[parents.length - 1]
    const index = parent ? parent.children.indexOf(node) : undefined
    return visitor(node, index, parent)
  }
}
ck33%x:{
  "name": "unist-util-visit",
  "version": "5.1.0",
  "description": "unist utility to visit nodes",
  "license": "MIT",
  "kuni*remark",
    "retext",
    "rehype",
    "mdast",
    "hast",
    "xast",
    "nlcst",
    "natural",
    "language",
    "mark	Khtml",
    "xml",
    "tree",
    "ast",
    "node",
    "visit",
    "walkQ$unist-util-visit-unist-util-visitZ,
    "Eugene Sharygin <eush77@gmail.com>",
    "Richard Gibson <richard.gibson@gmail.com>v.map9ITunist": "^3.0.0",
    "unist-util-is": "^6.0.0",
    "unist-util-visit-parents": "^6N.u5.0.0",
    "c8": "^10A	gfm": "^3 	gfm": "^362%11.0.0",
    "tsd": "^0.33E
xo": "^1.0vso6F#": "needed `any`s",
    "ignoreFiles": [
      "lib/index.d.ts"
    ]Bspace": true	G
    }
  }
}
@}x!d# unist-util-visit

[![Build][badge-build-image]][badge-build-url]
[![Coverage][badge-coverage-image]][badge-coverage-url]
[![Downloads][badge-downloads-image]][badge-downloads-url]
[![Size][badge-size-image]][badge-size-url]

[unist][github-unist] utility to walk the tree.

## Contents

* [What is this?](#what-is-this)
* [When should I use this?](#when-should-i-use-this)
* [Install](#install)
* [Use](#use)
* [API](#api)
  * [`visit(tree[, test], visitor[, reverse])`](#visittree-test-visitor-reverse)
  * [`CONTINUE`](#continue)
  * [`EXIT`](#exit)
  * [`SKIP`](#skip)
  * [`Action`](#action)
  * [`ActionTuple`](#actiontuple)
  * [`BuildVisitor`](#buildvisitor)
  * [`Index`](#index)
  * [`Test`](#test)
  * [`Visitor`](#visitor)
  * [`VisitorResult`](#visitorresult)
* [Compatibility](#compatibility)
* [Related](#related)
* [Contribute](#contribute)
* [License](#license)

## What is this?

This is a very important utility for working with unist as it lets you walk the
tree.

## When should I use this?

You can use this utility when you want to walk the tree.
You can use [`unist-util-visit-parents`][github-vp] if you care about the
entire stack of parents.

## Install

This package is [ESM only][github-gist-esm].
In Node.js (version 16+),
install with [npm][npmjs-install]:

```sh
npm install unist-util-visit
```

In Deno with [`esm.sh`][esmsh]:

```js
import {CONTINUE, EXIT, SKIP, visit} from 'https://esm.sh/unist-util-visit@5'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {CONTINUE, EXIT, SKIP, visit} from 'https://esm.sh/unist-util-visit@5?bundle'
</script>
```

## Use

```js
import {fromMarkdown} from 'mdast-util-from-markdown'
import {visit} from 'unist-util-visit'

const tree = fromMarkdown('Some *emphasis*, **strong**, and `code`.')

visit(tree, 'text', function (node, index, parent) {
  console.log([node.value, parent ? parent.type : index])
})
```

Yields:

```js
[ 'Some ', 'paragraph' ]
[ 'emphasis', 'emphasis' ]
[ ', ', 'paragraph' ]
[ 'strong', 'strong' ]
[ ', and ', 'paragraph' ]
[ '.', 'paragraph' ]
```

## API

This package exports the identifiers
[`CONTINUE`][api-continue],
[`EXIT`][api-exit],
[`SKIP`][api-skip], and
[`visit`][api-visit].
It exports the [TypeScript][] types
[`ActionTuple`][api-action-tuple],
[`Action`][api-action],
[`BuildVisitor`][api-build-visitor],
[`Index`][api-index],
[`Test`][api-test],
[`VisitorResult`][api-visitor-result], and
[`Visitor`][api-visitor].
There is no default export.

### `visit(tree[, test], visitor[, reverse])`

This function works exactly the same as
[`unist-util-visit-parents`][github-vp],
but [`Visitor`][api-visitor] has a different signature.

### `CONTINUE`

Continue traversing as normal (`true`).

### `EXIT`

Stop traversing immediately (`false`).

### `SKIP`

Do not traverse this node’s children (`'skip'`).

### `Action`

Union of the action types (TypeScript type).
See [`Action` in `unist-util-visit-parents`][github-vp-action].

### `ActionTuple`

List with an action and an index (TypeScript type).
See [`ActionTuple` in `unist-util-visit-parents`][github-vp-action-tuple].

### `BuildVisitor`

Build a typed `Visitor` function from a tree and a test (TypeScript type).
See [`BuildVisitor` in `unist-util-visit-parents`][github-vp-build-visitor].

### `Index`

Move to the sibling at `index` next (TypeScript type).
See [`Index` in `unist-util-visit-parents`][github-vp-index].

### `Test`

[`unist-util-is`][github-unist-util-is] compatible test
(TypeScript type).

### `Visitor`

Handle a node (matching `test`, if given) (TypeScript type).

Visitors are free to transform `node`.
They can also transform `parent`.

Replacing `node` itself, if `SKIP` is not returned, still causes its
descendants to be walked (which is a bug).

When adding or removing previous siblings of `node` (or next siblings, in
case of reverse), the `Visitor` should return a new `Index` to specify the
sibling to traverse after `node` is traversed.
Adding or removing next siblings of `node` (or previous siblings, in case
of reverse) is handled as expected without needing to return a new `Index`.

Removing the children property of `parent` still results in them being
traversed.

###### Parameters

* `node` ([`Node`][github-unist-node])
  — found node
* `index` (`number` or `undefined`)
  — index of `node` in `parent`
* `parent` ([`Node`][github-unist-node] or `undefined`)
  — parent of `node`

###### Returns

What to do next.

An `Index` is treated as a tuple of `[CONTINUE, Index]`.
An `Action` is treated as a tuple of `[Action]`.

Passing a tuple back only makes sense if the `Action` is `SKIP`.
When the `Action` is `EXIT`, that action can be returned.
When the `Action` is `CONTINUE`, `Index` can be returned.

### `VisitorResult`

Any value that can be returned from a visitor (TypeScript type).
See [`VisitorResult` in
`unist-util-visit-parents`][github-vp-visitor-result].

## Compatibility

Projects maintained by the unified collective are compatible with maintained
versions of Node.js.

When we cut a new major release, we drop support for unmaintained versions of
Node.
This means we try to keep the current release line, `unist-util-visit@^5`,
compatible with Node.js 16.

## Related

* [`unist-util-visit-parents`][github-vp]
  — walk the tree with a stack of parents
* [`unist-util-filter`](https://github.com/syntax-tree/unist-util-filter)
  — create a new tree with all nodes that pass a test
* [`unist-util-map`](https://github.com/syntax-tree/unist-util-map)
  — create a new tree with all nodes mapped by a given function
* [`unist-util-flatmap`](https://gitlab.com/staltz/unist-util-flatmap)
  — create a new tree by mapping (to an array) with the given function
* [`unist-util-remove`](https://github.com/syntax-tree/unist-util-remove)
  — remove nodes from a tree that pass a test
* [`unist-util-select`](https://github.com/syntax-tree/unist-util-select)
  — select nodes with CSS-like selectors

## Contribute

See [`contributing.md`][health-contributing] in [`syntax-tree/.github`][health]
for ways to get started.
See [`support.md`][health-support] for ways to get help.

This project has a [code of conduct][health-coc].
By interacting with this repository,
organization,
or community you agree to abide by its terms.

## License

[MIT][file-license] © [Titus Wormer][wooorm]

<!-- Definition -->

[api-action]: #action

[api-action-tuple]: #actiontuple

[api-build-visitor]: #buildvisitor

[api-continue]: #continue

[api-exit]: #exit

[api-index]: #index

[api-skip]: #skip

[api-test]: #test

[api-visit]: #visittree-test-visitor-reverse

[api-visitor]: #visitor

[api-visitor-result]: #visitorresult

[badge-build-image]: https://github.com/syntax-tree/unist-util-visit/workflows/main/badge.svg

[badge-build-url]: https://github.com/syntax-tree/unist-util-visit/actions

[badge-coverage-image]: https://img.shields.io/codecov/c/github/syntax-tree/unist-util-visit.svg

[badge-coverage-url]: https://codecov.io/github/syntax-tree/unist-util-visit

[badge-downloads-image]: https://img.shields.io/npm/dm/unist-util-visit.svg

[badge-downloads-url]: https://www.npmjs.com/package/unist-util-visit

[badge-size-image]: https://img.shields.io/bundlejs/size/unist-util-visit

[badge-size-url]: https://bundlejs.com/?q=unist-util-visit

[esmsh]: https://esm.sh

[file-license]: license

[github-gist-esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[github-unist]: https://github.com/syntax-tree/unist

[github-unist-node]: https://github.com/syntax-tree/unist#nodes

[github-unist-util-is]: https://github.com/syntax-tree/unist-util-is

[github-vp]: https://github.com/syntax-tree/unist-util-visit-parents

[github-vp-action]: https://github.com/syntax-tree/unist-util-visit-parents#action

[github-vp-action-tuple]: https://github.com/syntax-tree/unist-util-visit-parents#actiontuple

[github-vp-build-visitor]: https://github.com/syntax-tree/unist-util-visit-parents#buildvisitor

[github-vp-index]: https://github.com/syntax-tree/unist-util-visit-parents#index

[github-vp-visitor-result]: https://github.com/syntax-tree/unist-util-visit-parents#visitorresult

[health]: https://github.com/syntax-tree/.github

[health-coc]: https://github.com/syntax-tree/.github/blob/main/code-of-conduct.md

[health-contributing]: https://github.com/syntax-tree/.github/blob/main/contributing.md

[health-support]: https://github.com/syntax-tree/.github/blob/main/support.md

[npmjs-install]: https://docs.npmjs.com/cli/install

[typescript]: https://www.typescriptlang.org

[wooorm]: https://wooorm.com
&Xޤx K100644 LICENSE 8CL`b6C100644 README.md CH\4l.9	p40000 dist 
9LȚ$P
VxPOi100644 package.json ޕؼo(z100644 yarn.lock <B%djS7*vguG,xvCopyright 2011 Gary Court. >X M1.	K0.

2.	hIJ9GARY COURT "AS IS" AND RM F %GARY COURT OR CONTRIBUTORS BE LIABLE 4J J J M cM E
The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted aNs representing official policies, either expressed or implied, of Gary Court.
cTx# URI.js

URI.js is an [RFC 3986](http://www.ietf.org/rfc/rfc3986.txt) compliant, scheme extendable URI parsing/validating/resolving library for all JavaScript environments (browsers, Node.js, etc).
It is also compliant with the IRI ([RFC 3987](http://www.ietf.org/rfc/rfc3987.txt)), IDNA ([RFC 5890](http://www.ietf.org/rfc/rfc5890.txt)), IPv6 Address ([RFC 5952](http://www.ietf.org/rfc/rfc5952.txt)), IPv6 Zone Identifier ([RFC 6874](http://www.ietf.org/rfc/rfc6874.txt)) specifications.

URI.js has an extensive test suite, and works in all (Node.js, web) environments. It weighs in at 6.4kb (gzipped, 17kb deflated).

## API

### Parsing

	URI.parse("uri://user:pass@example.com:123/one/two.three?q1=a1&q2=a2#body");
	//returns:
	//{
	//  scheme : "uri",
	//  userinfo : "user:pass",
	//  host : "example.com",
	//  port : 123,
	//  path : "/one/two.three",
	//  query : "q1=a1&q2=a2",
	//  fragment : "body"
	//}

### Serializing

	URI.serialize({scheme : "http", host : "example.com", fragment : "footer"}) === "http://example.com/#footer"

### Resolving

	URI.resolve("uri://a/b/c/d?q", "../../g") === "uri://a/g"

### Normalizing

	URI.normalize("HTTP://ABC.com:80/%7Esmith/home.html") === "http://abc.com/~smith/home.html"

### Comparison

	URI.equal("example://a/b/c/%7Bfoo%7D", "eXAMPLE://a/./b/../b/%63/%7bfoo%7d") === true

### IP Support

	//IPv4 normalization
	URI.normalize("//192.068.001.000") === "//192.68.1.0"

	//IPv6 normalization
	URI.normalize("//[2001:0:0DB8::0:0001]") === "//[2001:0:db8::1]"

	//IPv6 zone identifier support
	URI.parse("//[2001:db8::7%25en1]");
	//returns:
	//{
	//  host : "2001:db8::7%en1"
	//}

### IRI Support

	//convert IRI to URI
	URI.serialize(URI.parse("http://examplé.org/rosé")) === "http://xn--exampl-gva.org/ros%C3%A9"
	//convert URI to IRI
	URI.serialize(URI.parse("http://xn--exampl-gva.org/ros%C3%A9"), {iri:true}) === "http://examplé.org/rosé"

### Options

All of the above functions can accept an additional options argument that is an object that can contain one or more of the following properties:

*	`scheme` (string)

	Indicates the scheme that the URI should be treated as, overriding the URI's normal scheme parsing behavior.

*	`reference` (string)

	If set to `"suffix"`, it indicates that the URI is in the suffix format, and the validator will use the option's `scheme` property to determine the URI's scheme.

*	`tolerant` (boolean, false)

	If set to `true`, the parser will relax URI resolving rules.

*	`absolutePath` (boolean, false)

	If set to `true`, the serializer will not resolve a relative `path` component.

*	`iri` (boolean, false)

	If set to `true`, the serializer will unescape non-ASCII characters as per [RFC 3987](http://www.ietf.org/rfc/rfc3987.txt).

*	`unicodeSupport` (boolean, false)

	If set to `true`, the parser will unescape non-ASCII characters in the parsed output as per [RFC 3987](http://www.ietf.org/rfc/rfc3987.txt).

*	`domainHost` (boolean, false)

	If set to `true`, the library will treat the `host` component as a domain name, and convert IDNs (International Domain Names) as per [RFC 5891](http://www.ietf.org/rfc/rfc5891.txt).

## Scheme Extendable

URI.js supports inserting custom [scheme](http://en.wikipedia.org/wiki/URI_scheme) dependent processing rules. Currently, URI.js has built in support for the following schemes:

*	http \[[RFC 2616](http://www.ietf.org/rfc/rfc2616.txt)\]
*	https \[[RFC 2818](http://www.ietf.org/rfc/rfc2818.txt)\]
*	ws \[[RFC 6455](http://www.ietf.org/rfc/rfc6455.txt)\]
*	wss \[[RFC 6455](http://www.ietf.org/rfc/rfc6455.txt)\]
*	mailto \[[RFC 6068](http://www.ietf.org/rfc/rfc6068.txt)\]
*	urn \[[RFC 2141](http://www.ietf.org/rfc/rfc2141.txt)\]
*	urn:uuid \[[RFC 4122](http://www.ietf.org/rfc/rfc4122.txt)\]

### HTTP/HTTPS Support

	URI.equal("HTTP://ABC.COM:80", "http://abc.com/") === true
	URI.equal("https://abc.com", "HTTPS://ABC.COM:443/") === true

### WS/WSS Support

	URI.parse("wss://example.com/foo?bar=baz");
	//returns:
	//{
	//	scheme : "wss",
	//	host: "example.com",
	//	resourceName: "/foo?bar=baz",
	//	secure: true,
	//}

	URI.equal("WS://ABC.COM:80/chat#one", "ws://abc.com/chat") === true

### Mailto Support

	URI.parse("mailto:alpha@example.com,bravo@example.com?subject=SUBSCRIBE&body=Sign%20me%20up!");
	//returns:
	//{
	//	scheme : "mailto",
	//	to : ["alpha@example.com", "bravo@example.com"],
	//	subject : "SUBSCRIBE",
	//	body : "Sign me up!"
	//}

	URI.serialize({
		scheme : "mailto",
		to : ["alpha@example.com"],
		subject : "REMOVE",
		body : "Please remove me",
		headers : {
			cc : "charlie@example.com"
		}
	}) === "mailto:alpha@example.com?cc=charlie@example.com&subject=REMOVE&body=Please%20remove%20me"

### URN Support

	URI.parse("urn:example:foo");
	//returns:
	//{
	//	scheme : "urn",
	//	nid : "example",
	//	nss : "foo",
	//}

#### URN UUID Support

	URI.parse("urn:uuid:f81d4fae-7dec-11d0-a765-00a0c91e6bf6");
	//returns:
	//{
	//	scheme : "urn",
	//	nid : "uuid",
	//	uuid : "f81d4fae-7dec-11d0-a765-00a0c91e6bf6",
	//}

## Usage

To load in a browser, use the following tag:

	<script type="text/javascript" src="uri-js/dist/es5/uri.all.min.js"></script>

To load in a CommonJS/Module environment, first install with npm/yarn by running on the command line:

	npm install uri-js
	# OR
	yarn add uri-js

Then, in your code, load it using:

	const URI = require("uri-js");

If you are writing your code in ES6+ (ESNEXT) or TypeScript, you would load it using:

	import * as URI from "uri-js";

Or you can load just what you need using named exports:

	import { parse, serialize, resolve, resolveComponents, normalize, equal, removeDotSegments, pctEncChar, pctDecChars, escapeComponent, unescapeComponent } from "uri-js";

## Breaking changes

### Breaking changes from 3.x

URN parsing has been completely changed to better align with the specification. Scheme is now always `urn`, but has two new properties: `nid` which contains the Namspace Identifier, and `nss` which contains the Namespace Specific String. The `nss` property will be removed by higher order scheme handlers, such as the UUID URN scheme handler.

The UUID of a URN can now be found in the `uuid` property.

### Breaking changes from 2.x

URI validation has been removed as it was slow, exposed a vulnerabilty, and was generally not useful.

### Breaking changes from 1.x

The `errors` array on parsed components is now an `error` string.
3x? 40000 es5 ]F:LŇ
%]W40000 esnext <\*ΪfXݗ_9,x 100644 uri.all.d.ts Q5'p_ٓǠ100644 uri.all.js o~0^CԦs100644 uri.all.js.map [0 .a}$100644 uri.all.min.d.ts Q5'p_ٓǠ100644 uri.all.min.js E-)N{100644 uri.all.min.js.map BziKbh$d뵱iuzffx	qexport interface URIComponents {
    scheme?: string;
    userinfo?: string;
    host?: string;
    port?: number | string;
    path?: string;
    query?: string;
    fragment?: string;
    reference?: string;
    error?: string;
}
export interface URIOptions {
    scheme?: string;
    reference?: string;
    tolerant?: boolean;
    absolutePath?: boolean;
    iri?: boolean;
    unicodeSupport?: boolean;
    domainHost?: boolean;
}
export interface URISchemeHandler<Components extends URIComponents = URIComponents, Options extends URIOptions = URIOptions, ParentComponents extends URIComponents = URIComponents> {
    scheme: string;
    parse(components: ParentComponents, options: Options): Components;
    serialize(components: Components, options: Options): ParentComponents;
    unicodeSupport?: boolean;
    domainHost?: boolean;
    absolutePath?: boolean;
}
export interface URIRegExps {
    NOT_SCHEME: RegExp;
    NOT_USERINFO: RegExp;
    NOT_HOST: RegExp;
    NOT_PATH: RegExp;
    NOT_PATH_NOSCHEME: RegExp;
    NOT_QUERY: RegExp;
    NOT_FRAGMENT: RegExp;
    ESCAPE: RegExp;
    UNRESERVED: RegExp;
    OTHER_CHARS: RegExp;
    PCT_ENCODED: RegExp;
    IPV4ADDRESS: RegExp;
    IPV6ADDRESS: RegExp;
}
export declare const SCHEMES: {
    [scheme: string]: URISchemeHandler;
};
export declare function pctEncChar(chr: string): string;
export declare function pctDecChars(str: string): string;
export declare function parse(uriString: string, options?: URIOptions): URIComponents;
export declare function removeDotSegments(input: string): string;
export declare function serialize(components: URIComponents, options?: URIOptions): string;
export declare function resolveComponents(base: URIComponents, relative: URIComponents, options?: URIOptions, skipNormalization?: boolean): URIComponents;
export declare function resolve(baseURI: string, relativeURI: string, options?: URIOptions): string;
export declare function normalize(uri: string, options?: URIOptions): string;
export declare function normalize(uri: URIComponents, options?: URIOptions): URIComponents;
export declare function equal(uriA: string, uriB: string, options?: URIOptions): boolean;
export declare function equal(uriA: URIComponents, uriB: URIComponents, options?: URIOptions): boolean;
export declare function escapeComponent(str: string, options?: URIOptions): string;
export declare function unescapeComponent(str: string, options?: URIOptions): string;
ZE߸x' /** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
(function (global, factory) {
	typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
	typeof define === 'function' && define.amd ? define(['exports'], factory) :
	(factory((global.URI = global.URI || {})));
}(this, (function (exports) { 'use strict';

function merge() {
    for (var _len = arguments.length, sets = Array(_len), _key = 0; _key < _len; _key++) {
        sets[_key] = arguments[_key];
    }

    if (sets.length > 1) {
        sets[0] = sets[0].slice(0, -1);
        var xl = sets.length - 1;
        for (var x = 1; x < xl; ++x) {
            sets[x] = sets[x].slice(1, -1);
        }
        sets[xl] = sets[xl].slice(1);
        return sets.join('');
    } else {
        return sets[0];
    }
}
function subexp(str) {
    return "(?:" + str + ")";
}
function typeOf(o) {
    return o === undefined ? "undefined" : o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase();
}
function toUpperCase(str) {
    return str.toUpperCase();
}
function toArray(obj) {
    return obj !== undefined && obj !== null ? obj instanceof Array ? obj : typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj) : [];
}
function assign(target, source) {
    var obj = target;
    if (source) {
        for (var key in source) {
            obj[key] = source[key];
        }
    }
    return obj;
}

function buildExps(isIRI) {
    var ALPHA$$ = "[A-Za-z]",
        CR$ = "[\\x0D]",
        DIGIT$$ = "[0-9]",
        DQUOTE$$ = "[\\x22]",
        HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"),
        //case-insensitive
    LF$$ = "[\\x0A]",
        SP$$ = "[\\x20]",
        PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)),
        //expanded
    GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]",
        SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",
        RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),
        UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]",
        //subset, excludes bidi control characters
    IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]",
        //subset
    UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$),
        SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"),
        USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"),
        DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$),
        DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$),
        //relaxed parsing rules
    IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$),
        H16$ = subexp(HEXDIG$$ + "{1,4}"),
        LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$),
        IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$),
        //                           6( h16 ":" ) ls32
    IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$),
        //                      "::" 5( h16 ":" ) ls32
    IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$),
        //[               h16 ] "::" 4( h16 ":" ) ls32
    IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$),
        //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
    IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$),
        //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
    IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$),
        //[ *3( h16 ":" ) h16 ] "::"    h16 ":"   ls32
    IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$),
        //[ *4( h16 ":" ) h16 ] "::"              ls32
    IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$),
        //[ *5( h16 ":" ) h16 ] "::"              h16
    IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"),
        //[ *6( h16 ":" ) h16 ] "::"
    IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")),
        ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"),
        //RFC 6874
    IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$),
        //RFC 6874
    IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$),
        //RFC 6874, with relaxed parsing rules
    IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"),
        IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"),
        //RFC 6874
    REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"),
        HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$),
        PORT$ = subexp(DIGIT$$ + "*"),
        AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"),
        PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")),
        SEGMENT$ = subexp(PCHAR$ + "*"),
        SEGMENT_NZ$ = subexp(PCHAR$ + "+"),
        SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"),
        PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"),
        PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"),
        //simplified
    PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$),
        //simplified
    PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$),
        //simplified
    PATH_EMPTY$ = "(?!" + PCHAR$ + ")",
        PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$),
        QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"),
        FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"),
        HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$),
        URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"),
        RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$),
        RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"),
        URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$),
        ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"),
        GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$",
        RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$",
        ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$",
        SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$",
        AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$";
    return {
        NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"),
        NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
        NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
        NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
        NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
        NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"),
        NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"),
        ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"),
        UNRESERVED: new RegExp(UNRESERVED$$, "g"),
        OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"),
        PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"),
        IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"),
        IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules
    };
}
var URI_PROTOCOL = buildExps(false);

var IRI_PROTOCOL = buildExps(true);

var slicedToArray = function () {
  function sliceIterator(arr, i) {
    var _arr = [];
    var _n = true;
    var _d = false;
    var _e = undefined;

    try {
      for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
        _arr.push(_s.value);

        if (i && _arr.length === i) break;
      }
    } catch (err) {
      _d = true;
      _e = err;
    } finally {
      try {
        if (!_n && _i["return"]) _i["return"]();
      } finally {
        if (_d) throw _e;
      }
    }

    return _arr;
  }

  return function (arr, i) {
    if (Array.isArray(arr)) {
      return arr;
    } else if (Symbol.iterator in Object(arr)) {
      return sliceIterator(arr, i);
    } else {
      throw new TypeError("Invalid attempt to destructure non-iterable instance");
    }
  };
}();













var toConsumableArray = function (arr) {
  if (Array.isArray(arr)) {
    for (var i = 0, arr2 = Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];

    return arr2;
  } else {
    return Array.from(arr);
  }
};

/** Highest positive signed 32-bit float value */

var maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1

/** Bootstring parameters */
var base = 36;
var tMin = 1;
var tMax = 26;
var skew = 38;
var damp = 700;
var initialBias = 72;
var initialN = 128; // 0x80
var delimiter = '-'; // '\x2D'

/** Regular expressions */
var regexPunycode = /^xn--/;
var regexNonASCII = /[^\0-\x7E]/; // non-ASCII chars
var regexSeparators = /[\x2E\u3002\uFF0E\uFF61]/g; // RFC 3490 separators

/** Error messages */
var errors = {
	'overflow': 'Overflow: input needs wider integers to process',
	'not-basic': 'Illegal input >= 0x80 (not a basic code point)',
	'invalid-input': 'Invalid input'
};

/** Convenience shortcuts */
var baseMinusTMin = base - tMin;
var floor = Math.floor;
var stringFromCharCode = String.fromCharCode;

/*--------------------------------------------------------------------------*/

/**
 * A generic error utility function.
 * @private
 * @param {String} type The error type.
 * @returns {Error} Throws a `RangeError` with the applicable error message.
 */
function error$1(type) {
	throw new RangeError(errors[type]);
}

/**
 * A generic `Array#map` utility function.
 * @private
 * @param {Array} array The array to iterate over.
 * @param {Function} callback The function that gets called for every array
 * item.
 * @returns {Array} A new array of values returned by the callback function.
 */
function map(array, fn) {
	var result = [];
	var length = array.length;
	while (length--) {
		result[length] = fn(array[length]);
	}
	return result;
}

/**
 * A simple `Array#map`-like wrapper to work with domain name strings or email
 * addresses.
 * @private
 * @param {String} domain The domain name or email address.
 * @param {Function} callback The function that gets called for every
 * character.
 * @returns {Array} A new string of characters returned by the callback
 * function.
 */
function mapDomain(string, fn) {
	var parts = string.split('@');
	var result = '';
	if (parts.length > 1) {
		// In email addresses, only the domain name should be punycoded. Leave
		// the local part (i.e. everything up to `@`) intact.
		result = parts[0] + '@';
		string = parts[1];
	}
	// Avoid `split(regex)` for IE8 compatibility. See #17.
	string = string.replace(regexSeparators, '\x2E');
	var labels = string.split('.');
	var encoded = map(labels, fn).join('.');
	return result + encoded;
}

/**
 * Creates an array containing the numeric code points of each Unicode
 * character in the string. While JavaScript uses UCS-2 internally,
 * this function will convert a pair of surrogate halves (each of which
 * UCS-2 exposes as separate characters) into a single code point,
 * matching UTF-16.
 * @see `punycode.ucs2.encode`
 * @see <https://mathiasbynens.be/notes/javascript-encoding>
 * @memberOf punycode.ucs2
 * @name decode
 * @param {String} string The Unicode input string (UCS-2).
 * @returns {Array} The new array of code points.
 */
function ucs2decode(string) {
	var output = [];
	var counter = 0;
	var length = string.length;
	while (counter < length) {
		var value = string.charCodeAt(counter++);
		if (value >= 0xD800 && value <= 0xDBFF && counter < length) {
			// It's a high surrogate, and there is a next character.
			var extra = string.charCodeAt(counter++);
			if ((extra & 0xFC00) == 0xDC00) {
				// Low surrogate.
				output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);
			} else {
				// It's an unmatched surrogate; only append this code unit, in case the
				// next code unit is the high surrogate of a surrogate pair.
				output.push(value);
				counter--;
			}
		} else {
			output.push(value);
		}
	}
	return output;
}

/**
 * Creates a string based on an array of numeric code points.
 * @see `punycode.ucs2.decode`
 * @memberOf punycode.ucs2
 * @name encode
 * @param {Array} codePoints The array of numeric code points.
 * @returns {String} The new Unicode string (UCS-2).
 */
var ucs2encode = function ucs2encode(array) {
	return String.fromCodePoint.apply(String, toConsumableArray(array));
};

/**
 * Converts a basic code point into a digit/integer.
 * @see `digitToBasic()`
 * @private
 * @param {Number} codePoint The basic numeric code point value.
 * @returns {Number} The numeric value of a basic code point (for use in
 * representing integers) in the range `0` to `base - 1`, or `base` if
 * the code point does not represent a value.
 */
var basicToDigit = function basicToDigit(codePoint) {
	if (codePoint - 0x30 < 0x0A) {
		return codePoint - 0x16;
	}
	if (codePoint - 0x41 < 0x1A) {
		return codePoint - 0x41;
	}
	if (codePoint - 0x61 < 0x1A) {
		return codePoint - 0x61;
	}
	return base;
};

/**
 * Converts a digit/integer into a basic code point.
 * @see `basicToDigit()`
 * @private
 * @param {Number} digit The numeric value of a basic code point.
 * @returns {Number} The basic code point whose value (when used for
 * representing integers) is `digit`, which needs to be in the range
 * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is
 * used; else, the lowercase form is used. The behavior is undefined
 * if `flag` is non-zero and `digit` has no uppercase form.
 */
var digitToBasic = function digitToBasic(digit, flag) {
	//  0..25 map to ASCII a..z or A..Z
	// 26..35 map to ASCII 0..9
	return digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);
};

/**
 * Bias adaptation function as per section 3.4 of RFC 3492.
 * https://tools.ietf.org/html/rfc3492#section-3.4
 * @private
 */
var adapt = function adapt(delta, numPoints, firstTime) {
	var k = 0;
	delta = firstTime ? floor(delta / damp) : delta >> 1;
	delta += floor(delta / numPoints);
	for (; /* no initialization */delta > baseMinusTMin * tMax >> 1; k += base) {
		delta = floor(delta / baseMinusTMin);
	}
	return floor(k + (baseMinusTMin + 1) * delta / (delta + skew));
};

/**
 * Converts a Punycode string of ASCII-only symbols to a string of Unicode
 * symbols.
 * @memberOf punycode
 * @param {String} input The Punycode string of ASCII-only symbols.
 * @returns {String} The resulting string of Unicode symbols.
 */
var decode = function decode(input) {
	// Don't use UCS-2.
	var output = [];
	var inputLength = input.length;
	var i = 0;
	var n = initialN;
	var bias = initialBias;

	// Handle the basic code points: let `basic` be the number of input code
	// points before the last delimiter, or `0` if there is none, then copy
	// the first basic code points to the output.

	var basic = input.lastIndexOf(delimiter);
	if (basic < 0) {
		basic = 0;
	}

	for (var j = 0; j < basic; ++j) {
		// if it's not a basic code point
		if (input.charCodeAt(j) >= 0x80) {
			error$1('not-basic');
		}
		output.push(input.charCodeAt(j));
	}

	// Main decoding loop: start just after the last delimiter if any basic code
	// points were copied; start at the beginning otherwise.

	for (var index = basic > 0 ? basic + 1 : 0; index < inputLength;) /* no final expression */{

		// `index` is the index of the next character to be consumed.
		// Decode a generalized variable-length integer into `delta`,
		// which gets added to `i`. The overflow checking is easier
		// if we increase `i` as we go, then subtract off its starting
		// value at the end to obtain `delta`.
		var oldi = i;
		for (var w = 1, k = base;; /* no condition */k += base) {

			if (index >= inputLength) {
				error$1('invalid-input');
			}

			var digit = basicToDigit(input.charCodeAt(index++));

			if (digit >= base || digit > floor((maxInt - i) / w)) {
				error$1('overflow');
			}

			i += digit * w;
			var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;

			if (digit < t) {
				break;
			}

			var baseMinusT = base - t;
			if (w > floor(maxInt / baseMinusT)) {
				error$1('overflow');
			}

			w *= baseMinusT;
		}

		var out = output.length + 1;
		bias = adapt(i - oldi, out, oldi == 0);

		// `i` was supposed to wrap around from `out` to `0`,
		// incrementing `n` each time, so we'll fix that now:
		if (floor(i / out) > maxInt - n) {
			error$1('overflow');
		}

		n += floor(i / out);
		i %= out;

		// Insert `n` at position `i` of the output.
		output.splice(i++, 0, n);
	}

	return String.fromCodePoint.apply(String, output);
};

/**
 * Converts a string of Unicode symbols (e.g. a domain name label) to a
 * Punycode string of ASCII-only symbols.
 * @memberOf punycode
 * @param {String} input The string of Unicode symbols.
 * @returns {String} The resulting Punycode string of ASCII-only symbols.
 */
var encode = function encode(input) {
	var output = [];

	// Convert the input in UCS-2 to an array of Unicode code points.
	input = ucs2decode(input);

	// Cache the length.
	var inputLength = input.length;

	// Initialize the state.
	var n = initialN;
	var delta = 0;
	var bias = initialBias;

	// Handle the basic code points.
	var _iteratorNormalCompletion = true;
	var _didIteratorError = false;
	var _iteratorError = undefined;

	try {
		for (var _iterator = input[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
			var _currentValue2 = _step.value;

			if (_currentValue2 < 0x80) {
				output.push(stringFromCharCode(_currentValue2));
			}
		}
	} catch (err) {
		_didIteratorError = true;
		_iteratorError = err;
	} finally {
		try {
			if (!_iteratorNormalCompletion && _iterator.return) {
				_iterator.return();
			}
		} finally {
			if (_didIteratorError) {
				throw _iteratorError;
			}
		}
	}

	var basicLength = output.length;
	var handledCPCount = basicLength;

	// `handledCPCount` is the number of code points that have been handled;
	// `basicLength` is the number of basic code points.

	// Finish the basic string with a delimiter unless it's empty.
	if (basicLength) {
		output.push(delimiter);
	}

	// Main encoding loop:
	while (handledCPCount < inputLength) {

		// All non-basic code points < n have been handled already. Find the next
		// larger one:
		var m = maxInt;
		var _iteratorNormalCompletion2 = true;
		var _didIteratorError2 = false;
		var _iteratorError2 = undefined;

		try {
			for (var _iterator2 = input[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
				var currentValue = _step2.value;

				if (currentValue >= n && currentValue < m) {
					m = currentValue;
				}
			}

			// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,
			// but guard against overflow.
		} catch (err) {
			_didIteratorError2 = true;
			_iteratorError2 = err;
		} finally {
			try {
				if (!_iteratorNormalCompletion2 && _iterator2.return) {
					_iterator2.return();
				}
			} finally {
				if (_didIteratorError2) {
					throw _iteratorError2;
				}
			}
		}

		var handledCPCountPlusOne = handledCPCount + 1;
		if (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {
			error$1('overflow');
		}

		delta += (m - n) * handledCPCountPlusOne;
		n = m;

		var _iteratorNormalCompletion3 = true;
		var _didIteratorError3 = false;
		var _iteratorError3 = undefined;

		try {
			for (var _iterator3 = input[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
				var _currentValue = _step3.value;

				if (_currentValue < n && ++delta > maxInt) {
					error$1('overflow');
				}
				if (_currentValue == n) {
					// Represent delta as a generalized variable-length integer.
					var q = delta;
					for (var k = base;; /* no condition */k += base) {
						var t = k <= bias ? tMin : k >= bias + tMax ? tMax : k - bias;
						if (q < t) {
							break;
						}
						var qMinusT = q - t;
						var baseMinusT = base - t;
						output.push(stringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0)));
						q = floor(qMinusT / baseMinusT);
					}

					output.push(stringFromCharCode(digitToBasic(q, 0)));
					bias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);
					delta = 0;
					++handledCPCount;
				}
			}
		} catch (err) {
			_didIteratorError3 = true;
			_iteratorError3 = err;
		} finally {
			try {
				if (!_iteratorNormalCompletion3 && _iterator3.return) {
					_iterator3.return();
				}
			} finally {
				if (_didIteratorError3) {
					throw _iteratorError3;
				}
			}
		}

		++delta;
		++n;
	}
	return output.join('');
};

/**
 * Converts a Punycode string representing a domain name or an email address
 * to Unicode. Only the Punycoded parts of the input will be converted, i.e.
 * it doesn't matter if you call it on a string that has already been
 * converted to Unicode.
 * @memberOf punycode
 * @param {String} input The Punycoded domain name or email address to
 * convert to Unicode.
 * @returns {String} The Unicode representation of the given Punycode
 * string.
 */
var toUnicode = function toUnicode(input) {
	return mapDomain(input, function (string) {
		return regexPunycode.test(string) ? decode(string.slice(4).toLowerCase()) : string;
	});
};

/**
 * Converts a Unicode string representing a domain name or an email address to
 * Punycode. Only the non-ASCII parts of the domain name will be converted,
 * i.e. it doesn't matter if you call it with a domain that's already in
 * ASCII.
 * @memberOf punycode
 * @param {String} input The domain name or email address to convert, as a
 * Unicode string.
 * @returns {String} The Punycode representation of the given domain name or
 * email address.
 */
var toASCII = function toASCII(input) {
	return mapDomain(input, function (string) {
		return regexNonASCII.test(string) ? 'xn--' + encode(string) : string;
	});
};

/*--------------------------------------------------------------------------*/

/** Define the public API */
var punycode = {
	/**
  * A string representing the current Punycode.js version number.
  * @memberOf punycode
  * @type String
  */
	'version': '2.1.0',
	/**
  * An object of methods to convert from JavaScript's internal character
  * representation (UCS-2) to Unicode code points, and back.
  * @see <https://mathiasbynens.be/notes/javascript-encoding>
  * @memberOf punycode
  * @type Object
  */
	'ucs2': {
		'decode': ucs2decode,
		'encode': ucs2encode
	},
	'decode': decode,
	'encode': encode,
	'toASCII': toASCII,
	'toUnicode': toUnicode
};

/**
 * URI.js
 *
 * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.
 * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
 * @see http://github.com/garycourt/uri-js
 */
/**
 * Copyright 2011 Gary Court. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification, are
 * permitted provided that the following conditions are met:
 *
 *    1. Redistributions of source code must retain the above copyright notice, this list of
 *       conditions and the following disclaimer.
 *
 *    2. Redistributions in binary form must reproduce the above copyright notice, this list
 *       of conditions and the following disclaimer in the documentation and/or other materials
 *       provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * The views and conclusions contained in the software and documentation are those of the
 * authors and should not be interpreted as representing official policies, either expressed
 * or implied, of Gary Court.
 */
var SCHEMES = {};
function pctEncChar(chr) {
    var c = chr.charCodeAt(0);
    var e = void 0;
    if (c < 16) e = "%0" + c.toString(16).toUpperCase();else if (c < 128) e = "%" + c.toString(16).toUpperCase();else if (c < 2048) e = "%" + (c >> 6 | 192).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();else e = "%" + (c >> 12 | 224).toString(16).toUpperCase() + "%" + (c >> 6 & 63 | 128).toString(16).toUpperCase() + "%" + (c & 63 | 128).toString(16).toUpperCase();
    return e;
}
function pctDecChars(str) {
    var newStr = "";
    var i = 0;
    var il = str.length;
    while (i < il) {
        var c = parseInt(str.substr(i + 1, 2), 16);
        if (c < 128) {
            newStr += String.fromCharCode(c);
            i += 3;
        } else if (c >= 194 && c < 224) {
            if (il - i >= 6) {
                var c2 = parseInt(str.substr(i + 4, 2), 16);
                newStr += String.fromCharCode((c & 31) << 6 | c2 & 63);
            } else {
                newStr += str.substr(i, 6);
            }
            i += 6;
        } else if (c >= 224) {
            if (il - i >= 9) {
                var _c = parseInt(str.substr(i + 4, 2), 16);
                var c3 = parseInt(str.substr(i + 7, 2), 16);
                newStr += String.fromCharCode((c & 15) << 12 | (_c & 63) << 6 | c3 & 63);
            } else {
                newStr += str.substr(i, 9);
            }
            i += 9;
        } else {
            newStr += str.substr(i, 3);
            i += 3;
        }
    }
    return newStr;
}
function _normalizeComponentEncoding(components, protocol) {
    function decodeUnreserved(str) {
        var decStr = pctDecChars(str);
        return !decStr.match(protocol.UNRESERVED) ? str : decStr;
    }
    if (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, "");
    if (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
    if (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
    if (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
    if (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
    if (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
    return components;
}

function _stripLeadingZeros(str) {
    return str.replace(/^0*(.*)/, "$1") || "0";
}
function _normalizeIPv4(host, protocol) {
    var matches = host.match(protocol.IPV4ADDRESS) || [];

    var _matches = slicedToArray(matches, 2),
        address = _matches[1];

    if (address) {
        return address.split(".").map(_stripLeadingZeros).join(".");
    } else {
        return host;
    }
}
function _normalizeIPv6(host, protocol) {
    var matches = host.match(protocol.IPV6ADDRESS) || [];

    var _matches2 = slicedToArray(matches, 3),
        address = _matches2[1],
        zone = _matches2[2];

    if (address) {
        var _address$toLowerCase$ = address.toLowerCase().split('::').reverse(),
            _address$toLowerCase$2 = slicedToArray(_address$toLowerCase$, 2),
            last = _address$toLowerCase$2[0],
            first = _address$toLowerCase$2[1];

        var firstFields = first ? first.split(":").map(_stripLeadingZeros) : [];
        var lastFields = last.split(":").map(_stripLeadingZeros);
        var isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);
        var fieldCount = isLastFieldIPv4Address ? 7 : 8;
        var lastFieldsStart = lastFields.length - fieldCount;
        var fields = Array(fieldCount);
        for (var x = 0; x < fieldCount; ++x) {
            fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';
        }
        if (isLastFieldIPv4Address) {
            fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);
        }
        var allZeroFields = fields.reduce(function (acc, field, index) {
            if (!field || field === "0") {
                var lastLongest = acc[acc.length - 1];
                if (lastLongest && lastLongest.index + lastLongest.length === index) {
                    lastLongest.length++;
                } else {
                    acc.push({ index: index, length: 1 });
                }
            }
            return acc;
        }, []);
        var longestZeroFields = allZeroFields.sort(function (a, b) {
            return b.length - a.length;
        })[0];
        var newHost = void 0;
        if (longestZeroFields && longestZeroFields.length > 1) {
            var newFirst = fields.slice(0, longestZeroFields.index);
            var newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);
            newHost = newFirst.join(":") + "::" + newLast.join(":");
        } else {
            newHost = fields.join(":");
        }
        if (zone) {
            newHost += "%" + zone;
        }
        return newHost;
    } else {
        return host;
    }
}
var URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;
var NO_MATCH_IS_UNDEFINED = "".match(/(){0}/)[1] === undefined;
function parse(uriString) {
    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

    var components = {};
    var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
    if (options.reference === "suffix") uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString;
    var matches = uriString.match(URI_PARSE);
    if (matches) {
        if (NO_MATCH_IS_UNDEFINED) {
            //store each component
            components.scheme = matches[1];
            components.userinfo = matches[3];
            components.host = matches[4];
            components.port = parseInt(matches[5], 10);
            components.path = matches[6] || "";
            components.query = matches[7];
            components.fragment = matches[8];
            //fix port number
            if (isNaN(components.port)) {
                components.port = matches[5];
            }
        } else {
            //IE FIX for improper RegExp matching
            //store each component
            components.scheme = matches[1] || undefined;
            components.userinfo = uriString.indexOf("@") !== -1 ? matches[3] : undefined;
            components.host = uriString.indexOf("//") !== -1 ? matches[4] : undefined;
            components.port = parseInt(matches[5], 10);
            components.path = matches[6] || "";
            components.query = uriString.indexOf("?") !== -1 ? matches[7] : undefined;
            components.fragment = uriString.indexOf("#") !== -1 ? matches[8] : undefined;
            //fix port number
            if (isNaN(components.port)) {
                components.port = uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined;
            }
        }
        if (components.host) {
            //normalize IP hosts
            components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);
        }
        //determine reference type
        if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {
            components.reference = "same-document";
        } else if (components.scheme === undefined) {
            components.reference = "relative";
        } else if (components.fragment === undefined) {
            components.reference = "absolute";
        } else {
            components.reference = "uri";
        }
        //check for reference errors
        if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) {
            components.error = components.error || "URI is not a " + options.reference + " reference.";
        }
        //find scheme handler
        var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
        //check if scheme can't handle IRIs
        if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
            //if host component is a domain name
            if (components.host && (options.domainHost || schemeHandler && schemeHandler.domainHost)) {
                //convert Unicode IDN -> ASCII IDN
                try {
                    components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());
                } catch (e) {
                    components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e;
                }
            }
            //convert IRI -> URI
            _normalizeComponentEncoding(components, URI_PROTOCOL);
        } else {
            //normalize encodings
            _normalizeComponentEncoding(components, protocol);
        }
        //perform scheme specific parsing
        if (schemeHandler && schemeHandler.parse) {
            schemeHandler.parse(components, options);
        }
    } else {
        components.error = components.error || "URI can not be parsed.";
    }
    return components;
}

function _recomposeAuthority(components, options) {
    var protocol = options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL;
    var uriTokens = [];
    if (components.userinfo !== undefined) {
        uriTokens.push(components.userinfo);
        uriTokens.push("@");
    }
    if (components.host !== undefined) {
        //normalize IP hosts, add brackets and escape zone separator for IPv6
        uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, function (_, $1, $2) {
            return "[" + $1 + ($2 ? "%25" + $2 : "") + "]";
        }));
    }
    if (typeof components.port === "number" || typeof components.port === "string") {
        uriTokens.push(":");
        uriTokens.push(String(components.port));
    }
    return uriTokens.length ? uriTokens.join("") : undefined;
}

var RDS1 = /^\.\.?\//;
var RDS2 = /^\/\.(\/|$)/;
var RDS3 = /^\/\.\.(\/|$)/;
var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/;
function removeDotSegments(input) {
    var output = [];
    while (input.length) {
        if (input.match(RDS1)) {
            input = input.replace(RDS1, "");
        } else if (input.match(RDS2)) {
            input = input.replace(RDS2, "/");
        } else if (input.match(RDS3)) {
            input = input.replace(RDS3, "/");
            output.pop();
        } else if (input === "." || input === "..") {
            input = "";
        } else {
            var im = input.match(RDS5);
            if (im) {
                var s = im[0];
                input = input.slice(s.length);
                output.push(s);
            } else {
                throw new Error("Unexpected dot segment condition");
            }
        }
    }
    return output.join("");
}

function serialize(components) {
    var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};

    var protocol = options.iri ? IRI_PROTOCOL : URI_PROTOCOL;
    var uriTokens = [];
    //find scheme handler
    var schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
    //perform scheme specific serialization
    if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);
    if (components.host) {
        //if host component is an IPv6 address
        if (protocol.IPV6ADDRESS.test(components.host)) {}
        //TODO: normalize IPv6 address as per RFC 5952

        //if host component is a domain name
        else if (options.domainHost || schemeHandler && schemeHandler.domainHost) {
                //convert IDN via punycode
                try {
                    components.host = !options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host);
                } catch (e) {
                    components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
                }
            }
    }
    //normalize encoding
    _normalizeComponentEncoding(components, protocol);
    if (options.reference !== "suffix" && components.scheme) {
        uriTokens.push(components.scheme);
        uriTokens.push(":");
    }
    var authority = _recomposeAuthority(components, options);
    if (authority !== undefined) {
        if (options.reference !== "suffix") {
            uriTokens.push("//");
        }
        uriTokens.push(authority);
        if (components.path && components.path.charAt(0) !== "/") {
            uriTokens.push("/");
        }
    }
    if (components.path !== undefined) {
        var s = components.path;
        if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
            s = removeDotSegments(s);
        }
        if (authority === undefined) {
            s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//"
        }
        uriTokens.push(s);
    }
    if (components.query !== undefined) {
        uriTokens.push("?");
        uriTokens.push(components.query);
    }
    if (components.fragment !== undefined) {
        uriTokens.push("#");
        uriTokens.push(components.fragment);
    }
    return uriTokens.join(""); //merge tokens into a string
}

function resolveComponents(base, relative) {
    var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
    var skipNormalization = arguments[3];

    var target = {};
    if (!skipNormalization) {
        base = parse(serialize(base, options), options); //normalize base components
        relative = parse(serialize(relative, options), options); //normalize relative components
    }
    options = options || {};
    if (!options.tolerant && relative.scheme) {
        target.scheme = relative.scheme;
        //target.authority = relative.authority;
        target.userinfo = relative.userinfo;
        target.host = relative.host;
        target.port = relative.port;
        target.path = removeDotSegments(relative.path || "");
        target.query = relative.query;
    } else {
        if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {
            //target.authority = relative.authority;
            target.userinfo = relative.userinfo;
            target.host = relative.host;
            target.port = relative.port;
            target.path = removeDotSegments(relative.path || "");
            target.query = relative.query;
        } else {
            if (!relative.path) {
                target.path = base.path;
                if (relative.query !== undefined) {
                    target.query = relative.query;
                } else {
                    target.query = base.query;
                }
            } else {
                if (relative.path.charAt(0) === "/") {
                    target.path = removeDotSegments(relative.path);
                } else {
                    if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
                        target.path = "/" + relative.path;
                    } else if (!base.path) {
                        target.path = relative.path;
                    } else {
                        target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
                    }
                    target.path = removeDotSegments(target.path);
                }
                target.query = relative.query;
            }
            //target.authority = base.authority;
            target.userinfo = base.userinfo;
            target.host = base.host;
            target.port = base.port;
        }
        target.scheme = base.scheme;
    }
    target.fragment = relative.fragment;
    return target;
}

function resolve(baseURI, relativeURI, options) {
    var schemelessOptions = assign({ scheme: 'null' }, options);
    return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
}

function normalize(uri, options) {
    if (typeof uri === "string") {
        uri = serialize(parse(uri, options), options);
    } else if (typeOf(uri) === "object") {
        uri = parse(serialize(uri, options), options);
    }
    return uri;
}

function equal(uriA, uriB, options) {
    if (typeof uriA === "string") {
        uriA = serialize(parse(uriA, options), options);
    } else if (typeOf(uriA) === "object") {
        uriA = serialize(uriA, options);
    }
    if (typeof uriB === "string") {
        uriB = serialize(parse(uriB, options), options);
    } else if (typeOf(uriB) === "object") {
        uriB = serialize(uriB, options);
    }
    return uriA === uriB;
}

function escapeComponent(str, options) {
    return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE, pctEncChar);
}

function unescapeComponent(str, options) {
    return str && str.toString().replace(!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED, pctDecChars);
}

var handler = {
    scheme: "http",
    domainHost: true,
    parse: function parse(components, options) {
        //report missing host
        if (!components.host) {
            components.error = components.error || "HTTP URIs must have a host.";
        }
        return components;
    },
    serialize: function serialize(components, options) {
        var secure = String(components.scheme).toLowerCase() === "https";
        //normalize the default port
        if (components.port === (secure ? 443 : 80) || components.port === "") {
            components.port = undefined;
        }
        //normalize the empty path
        if (!components.path) {
            components.path = "/";
        }
        //NOTE: We do not parse query strings for HTTP URIs
        //as WWW Form Url Encoded query strings are part of the HTML4+ spec,
        //and not the HTTP spec.
        return components;
    }
};

var handler$1 = {
    scheme: "https",
    domainHost: handler.domainHost,
    parse: handler.parse,
    serialize: handler.serialize
};

function isSecure(wsComponents) {
    return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
}
//RFC 6455
var handler$2 = {
    scheme: "ws",
    domainHost: true,
    parse: function parse(components, options) {
        var wsComponents = components;
        //indicate if the secure flag is set
        wsComponents.secure = isSecure(wsComponents);
        //construct resouce name
        wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');
        wsComponents.path = undefined;
        wsComponents.query = undefined;
        return wsComponents;
    },
    serialize: function serialize(wsComponents, options) {
        //normalize the default port
        if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
            wsComponents.port = undefined;
        }
        //ensure scheme matches secure flag
        if (typeof wsComponents.secure === 'boolean') {
            wsComponents.scheme = wsComponents.secure ? 'wss' : 'ws';
            wsComponents.secure = undefined;
        }
        //reconstruct path from resource name
        if (wsComponents.resourceName) {
            var _wsComponents$resourc = wsComponents.resourceName.split('?'),
                _wsComponents$resourc2 = slicedToArray(_wsComponents$resourc, 2),
                path = _wsComponents$resourc2[0],
                query = _wsComponents$resourc2[1];

            wsComponents.path = path && path !== '/' ? path : undefined;
            wsComponents.query = query;
            wsComponents.resourceName = undefined;
        }
        //forbid fragment component
        wsComponents.fragment = undefined;
        return wsComponents;
    }
};

var handler$3 = {
    scheme: "wss",
    domainHost: handler$2.domainHost,
    parse: handler$2.parse,
    serialize: handler$2.serialize
};

var O = {};
var isIRI = true;
//RFC 3986
var UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]";
var HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive
var PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded
//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =
//const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]";
//const WSP$$ = "[\\x20\\x09]";
//const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]";  //(%d1-8 / %d11-12 / %d14-31 / %d127)
//const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$);  //%d33 / %d35-91 / %d93-126 / obs-qtext
//const VCHAR$$ = "[\\x21-\\x7E]";
//const WSP$$ = "[\\x20\\x09]";
//const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$));  //%d0 / CR / LF / obs-qtext
//const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+");
//const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$);
//const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"');
var ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";
var QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";
var VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]");
var SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";
var UNRESERVED = new RegExp(UNRESERVED$$, "g");
var PCT_ENCODED = new RegExp(PCT_ENCODED$, "g");
var NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g");
var NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g");
var NOT_HFVALUE = NOT_HFNAME;
function decodeUnreserved(str) {
    var decStr = pctDecChars(str);
    return !decStr.match(UNRESERVED) ? str : decStr;
}
var handler$4 = {
    scheme: "mailto",
    parse: function parse$$1(components, options) {
        var mailtoComponents = components;
        var to = mailtoComponents.to = mailtoComponents.path ? mailtoComponents.path.split(",") : [];
        mailtoComponents.path = undefined;
        if (mailtoComponents.query) {
            var unknownHeaders = false;
            var headers = {};
            var hfields = mailtoComponents.query.split("&");
            for (var x = 0, xl = hfields.length; x < xl; ++x) {
                var hfield = hfields[x].split("=");
                switch (hfield[0]) {
                    case "to":
                        var toAddrs = hfield[1].split(",");
                        for (var _x = 0, _xl = toAddrs.length; _x < _xl; ++_x) {
                            to.push(toAddrs[_x]);
                        }
                        break;
                    case "subject":
                        mailtoComponents.subject = unescapeComponent(hfield[1], options);
                        break;
                    case "body":
                        mailtoComponents.body = unescapeComponent(hfield[1], options);
                        break;
                    default:
                        unknownHeaders = true;
                        headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);
                        break;
                }
            }
            if (unknownHeaders) mailtoComponents.headers = headers;
        }
        mailtoComponents.query = undefined;
        for (var _x2 = 0, _xl2 = to.length; _x2 < _xl2; ++_x2) {
            var addr = to[_x2].split("@");
            addr[0] = unescapeComponent(addr[0]);
            if (!options.unicodeSupport) {
                //convert Unicode IDN -> ASCII IDN
                try {
                    addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());
                } catch (e) {
                    mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e;
                }
            } else {
                addr[1] = unescapeComponent(addr[1], options).toLowerCase();
            }
            to[_x2] = addr.join("@");
        }
        return mailtoComponents;
    },
    serialize: function serialize$$1(mailtoComponents, options) {
        var components = mailtoComponents;
        var to = toArray(mailtoComponents.to);
        if (to) {
            for (var x = 0, xl = to.length; x < xl; ++x) {
                var toAddr = String(to[x]);
                var atIdx = toAddr.lastIndexOf("@");
                var localPart = toAddr.slice(0, atIdx).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);
                var domain = toAddr.slice(atIdx + 1);
                //convert IDN via punycode
                try {
                    domain = !options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain);
                } catch (e) {
                    components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
                }
                to[x] = localPart + "@" + domain;
            }
            components.path = to.join(",");
        }
        var headers = mailtoComponents.headers = mailtoComponents.headers || {};
        if (mailtoComponents.subject) headers["subject"] = mailtoComponents.subject;
        if (mailtoComponents.body) headers["body"] = mailtoComponents.body;
        var fields = [];
        for (var name in headers) {
            if (headers[name] !== O[name]) {
                fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) + "=" + headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar));
            }
        }
        if (fields.length) {
            components.query = fields.join("&");
        }
        return components;
    }
};

var URN_PARSE = /^([^\:]+)\:(.*)/;
//RFC 2141
var handler$5 = {
    scheme: "urn",
    parse: function parse$$1(components, options) {
        var matches = components.path && components.path.match(URN_PARSE);
        var urnComponents = components;
        if (matches) {
            var scheme = options.scheme || urnComponents.scheme || "urn";
            var nid = matches[1].toLowerCase();
            var nss = matches[2];
            var urnScheme = scheme + ":" + (options.nid || nid);
            var schemeHandler = SCHEMES[urnScheme];
            urnComponents.nid = nid;
            urnComponents.nss = nss;
            urnComponents.path = undefined;
            if (schemeHandler) {
                urnComponents = schemeHandler.parse(urnComponents, options);
            }
        } else {
            urnComponents.error = urnComponents.error || "URN can not be parsed.";
        }
        return urnComponents;
    },
    serialize: function serialize$$1(urnComponents, options) {
        var scheme = options.scheme || urnComponents.scheme || "urn";
        var nid = urnComponents.nid;
        var urnScheme = scheme + ":" + (options.nid || nid);
        var schemeHandler = SCHEMES[urnScheme];
        if (schemeHandler) {
            urnComponents = schemeHandler.serialize(urnComponents, options);
        }
        var uriComponents = urnComponents;
        var nss = urnComponents.nss;
        uriComponents.path = (nid || options.nid) + ":" + nss;
        return uriComponents;
    }
};

var UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
//RFC 4122
var handler$6 = {
    scheme: "urn:uuid",
    parse: function parse(urnComponents, options) {
        var uuidComponents = urnComponents;
        uuidComponents.uuid = uuidComponents.nss;
        uuidComponents.nss = undefined;
        if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {
            uuidComponents.error = uuidComponents.error || "UUID is not valid.";
        }
        return uuidComponents;
    },
    serialize: function serialize(uuidComponents, options) {
        var urnComponents = uuidComponents;
        //normalize UUID
        urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
        return urnComponents;
    }
};

SCHEMES[handler.scheme] = handler;
SCHEMES[handler$1.scheme] = handler$1;
SCHEMES[handler$2.scheme] = handler$2;
SCHEMES[handler$3.scheme] = handler$3;
SCHEMES[handler$4.scheme] = handler$4;
SCHEMES[handler$5.scheme] = handler$5;
SCHEMES[handler$6.scheme] = handler$6;

exports.SCHEMES = SCHEMES;
exports.pctEncChar = pctEncChar;
exports.pctDecChars = pctDecChars;
exports.parse = parse;
exports.removeDotSegments = removeDotSegments;
exports.serialize = serialize;
exports.resolveComponents = resolveComponents;
exports.resolve = resolve;
exports.normalize = normalize;
exports.equal = equal;
exports.escapeComponent = escapeComponent;
exports.unescapeComponent = unescapeComponent;

Object.defineProperty(exports, '__esModule', { value: true });

})));
//# sourceMappingURL=uri.all.js.map
 'հ1x   {"version":3,"file":"uri.all.js","sources":["../../src/index.ts","../../src/schemes/urn-uuid.ts","../../src/schemes/urn.ts","../../src/schemes/mailto.ts","../../src/schemes/wss.ts","../../src/schemes/ws.ts","../../src/schemes/https.ts","../../src/schemes/http.ts","../../src/uri.ts","../../node_modules/punycode/punycode.es6.js","../../src/regexps-iri.ts","../../src/regexps-uri.ts","../../src/util.ts"],"sourcesContent":["import { SCHEMES } from \"./uri\";\n\nimport http from \"./schemes/http\";\nSCHEMES[http.scheme] = http;\n\nimport https from \"./schemes/https\";\nSCHEMES[https.scheme] = https;\n\nimport ws from \"./schemes/ws\";\nSCHEMES[ws.scheme] = ws;\n\nimport wss from \"./schemes/wss\";\nSCHEMES[wss.scheme] = wss;\n\nimport mailto from \"./schemes/mailto\";\nSCHEMES[mailto.scheme] = mailto;\n\nimport urn from \"./schemes/urn\";\nSCHEMES[urn.scheme] = urn;\n\nimport uuid from \"./schemes/urn-uuid\";\nSCHEMES[uuid.scheme] = uuid;\n\nexport * from \"./uri\";\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { URNComponents } from \"./urn\";\nimport { SCHEMES } from \"../uri\";\n\nexport interface UUIDComponents extends URNComponents {\n\tuuid?: string;\n}\n\nconst UUID = /^[0-9A-Fa-f]{8}(?:\\-[0-9A-Fa-f]{4}){3}\\-[0-9A-Fa-f]{12}$/;\nconst UUID_PARSE = /^[0-9A-Fa-f\\-]{36}/;\n\n//RFC 4122\nconst handler:URISchemeHandler<UUIDComponents, URIOptions, URNComponents> = {\n\tscheme : \"urn:uuid\",\n\n\tparse : function (urnComponents:URNComponents, options:URIOptions):UUIDComponents {\n\t\tconst uuidComponents = urnComponents as UUIDComponents;\n\t\tuuidComponents.uuid = uuidComponents.nss;\n\t\tuuidComponents.nss = undefined;\n\n\t\tif (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {\n\t\t\tuuidComponents.error = uuidComponents.error || \"UUID is not valid.\";\n\t\t}\n\n\t\treturn uuidComponents;\n\t},\n\n\tserialize : function (uuidComponents:UUIDComponents, options:URIOptions):URNComponents {\n\t\tconst urnComponents = uuidComponents as URNComponents;\n\t\t//normalize UUID\n\t\turnComponents.nss = (uuidComponents.uuid || \"\").toLowerCase();\n\t\treturn urnComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, SCHEMES } from \"../uri\";\n\nexport interface URNComponents extends URIComponents {\n\tnid?:string;\n\tnss?:string;\n}\n\nexport interface URNOptions extends URIOptions {\n\tnid?:string;\n}\n\nconst NID$ = \"(?:[0-9A-Za-z][0-9A-Za-z\\\\-]{1,31})\";\nconst PCT_ENCODED$ = \"(?:\\\\%[0-9A-Fa-f]{2})\";\nconst TRANS$$ = \"[0-9A-Za-z\\\\(\\\\)\\\\+\\\\,\\\\-\\\\.\\\\:\\\\=\\\\@\\\\;\\\\$\\\\_\\\\!\\\\*\\\\'\\\\/\\\\?\\\\#]\";\nconst NSS$ = \"(?:(?:\" + PCT_ENCODED$ + \"|\" + TRANS$$ + \")+)\";\nconst URN_SCHEME = new RegExp(\"^urn\\\\:(\" + NID$ + \")$\");\nconst URN_PATH = new RegExp(\"^(\" + NID$ + \")\\\\:(\" + NSS$ + \")$\");\nconst URN_PARSE = /^([^\\:]+)\\:(.*)/;\nconst URN_EXCLUDED = /[\\x00-\\x20\\\\\\\"\\&\\<\\>\\[\\]\\^\\`\\{\\|\\}\\~\\x7F-\\xFF]/g;\n\n//RFC 2141\nconst handler:URISchemeHandler<URNComponents,URNOptions> = {\n\tscheme : \"urn\",\n\n\tparse : function (components:URIComponents, options:URNOptions):URNComponents {\n\t\tconst matches = components.path && components.path.match(URN_PARSE);\n\t\tlet urnComponents = components as URNComponents;\n\n\t\tif (matches) {\n\t\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\t\tconst nid = matches[1].toLowerCase();\n\t\t\tconst nss = matches[2];\n\t\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\t\turnComponents.nid = nid;\n\t\t\turnComponents.nss = nss;\n\t\t\turnComponents.path = undefined;\n\n\t\t\tif (schemeHandler) {\n\t\t\t\turnComponents = schemeHandler.parse(urnComponents, options) as URNComponents;\n\t\t\t}\n\t\t} else {\n\t\t\turnComponents.error = urnComponents.error || \"URN can not be parsed.\";\n\t\t}\n\n\t\treturn urnComponents;\n\t},\n\n\tserialize : function (urnComponents:URNComponents, options:URNOptions):URIComponents {\n\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\tconst nid = urnComponents.nid;\n\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\tif (schemeHandler) {\n\t\t\turnComponents = schemeHandler.serialize(urnComponents, options) as URNComponents;\n\t\t}\n\n\t\tconst uriComponents = urnComponents as URIComponents;\n\t\tconst nss = urnComponents.nss;\n\t\turiComponents.path = `${nid || options.nid}:${nss}`;\n\n\t\treturn uriComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, pctDecChars, unescapeComponent } from \"../uri\";\nimport punycode from \"punycode\";\nimport { merge, subexp, toUpperCase, toArray } from \"../util\";\n\nexport interface MailtoHeaders {\n\t[hfname:string]:string\n}\n\nexport interface MailtoComponents extends URIComponents {\n\tto:Array<string>,\n\theaders?:MailtoHeaders,\n\tsubject?:string,\n\tbody?:string\n}\n\nconst O:MailtoHeaders = {};\nconst isIRI = true;\n\n//RFC 3986\nconst UNRESERVED$$ = \"[A-Za-z0-9\\\\-\\\\.\\\\_\\\\~\" + (isIRI ? \"\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF\" : \"\") + \"]\";\nconst HEXDIG$$ = \"[0-9A-Fa-f]\";  //case-insensitive\nconst PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$));  //expanded\n\n//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =\n//const ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\#\\\\$\\\\%\\\\&\\\\'\\\\*\\\\+\\\\-\\\\/\\\\=\\\\?\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QTEXT$$ = \"[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x7F]\";  //(%d1-8 / %d11-12 / %d14-31 / %d127)\n//const QTEXT$$ = merge(\"[\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E]\", OBS_QTEXT$$);  //%d33 / %d35-91 / %d93-126 / obs-qtext\n//const VCHAR$$ = \"[\\\\x21-\\\\x7E]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QP$ = subexp(\"\\\\\\\\\" + merge(\"[\\\\x00\\\\x0D\\\\x0A]\", OBS_QTEXT$$));  //%d0 / CR / LF / obs-qtext\n//const FWS$ = subexp(subexp(WSP$$ + \"*\" + \"\\\\x0D\\\\x0A\") + \"?\" + WSP$$ + \"+\");\n//const QUOTED_PAIR$ = subexp(subexp(\"\\\\\\\\\" + subexp(VCHAR$$ + \"|\" + WSP$$)) + \"|\" + OBS_QP$);\n//const QUOTED_STRING$ = subexp('\\\\\"' + subexp(FWS$ + \"?\" + QCONTENT$) + \"*\" + FWS$ + \"?\" + '\\\\\"');\nconst ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\$\\\\%\\\\'\\\\*\\\\+\\\\-\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\nconst QTEXT$$ = \"[\\\\!\\\\$\\\\%\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\-\\\\.0-9\\\\<\\\\>A-Z\\\\x5E-\\\\x7E]\";\nconst VCHAR$$ = merge(QTEXT$$, \"[\\\\\\\"\\\\\\\\]\");\nconst DOT_ATOM_TEXT$ = subexp(ATEXT$$ + \"+\" + subexp(\"\\\\.\" + ATEXT$$ + \"+\") + \"*\");\nconst QUOTED_PAIR$ = subexp(\"\\\\\\\\\" + VCHAR$$);\nconst QCONTENT$ = subexp(QTEXT$$ + \"|\" + QUOTED_PAIR$);\nconst QUOTED_STRING$ = subexp('\\\\\"' + QCONTENT$ + \"*\" + '\\\\\"');\n\n//RFC 6068\nconst DTEXT_NO_OBS$$ = \"[\\\\x21-\\\\x5A\\\\x5E-\\\\x7E]\";  //%d33-90 / %d94-126\nconst SOME_DELIMS$$ = \"[\\\\!\\\\$\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\:\\\\@]\";\nconst QCHAR$ = subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$ + \"|\" + SOME_DELIMS$$);\nconst DOMAIN$ = subexp(DOT_ATOM_TEXT$ + \"|\" + \"\\\\[\" + DTEXT_NO_OBS$$ + \"*\" + \"\\\\]\");\nconst LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + \"|\" + QUOTED_STRING$);\nconst ADDR_SPEC$ = subexp(LOCAL_PART$ + \"\\\\@\" + DOMAIN$);\nconst TO$ = subexp(ADDR_SPEC$ + subexp(\"\\\\,\" + ADDR_SPEC$) + \"*\");\nconst HFNAME$ = subexp(QCHAR$ + \"*\");\nconst HFVALUE$ = HFNAME$;\nconst HFIELD$ = subexp(HFNAME$ + \"\\\\=\" + HFVALUE$);\nconst HFIELDS2$ = subexp(HFIELD$ + subexp(\"\\\\&\" + HFIELD$) + \"*\");\nconst HFIELDS$ = subexp(\"\\\\?\" + HFIELDS2$);\nconst MAILTO_URI = new RegExp(\"^mailto\\\\:\" + TO$ + \"?\" + HFIELDS$ + \"?$\");\n\nconst UNRESERVED = new RegExp(UNRESERVED$$, \"g\");\nconst PCT_ENCODED = new RegExp(PCT_ENCODED$, \"g\");\nconst NOT_LOCAL_PART = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", '[\\\\\"]', VCHAR$$), \"g\");\nconst NOT_DOMAIN = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", \"[\\\\[]\", DTEXT_NO_OBS$$, \"[\\\\]]\"), \"g\");\nconst NOT_HFNAME = new RegExp(merge(\"[^]\", UNRESERVED$$, SOME_DELIMS$$), \"g\");\nconst NOT_HFVALUE = NOT_HFNAME;\nconst TO = new RegExp(\"^\" + TO$ + \"$\");\nconst HFIELDS = new RegExp(\"^\" + HFIELDS2$ + \"$\");\n\nfunction decodeUnreserved(str:string):string {\n\tconst decStr = pctDecChars(str);\n\treturn (!decStr.match(UNRESERVED) ? str : decStr);\n}\n\nconst handler:URISchemeHandler<MailtoComponents> =  {\n\tscheme : \"mailto\",\n\n\tparse : function (components:URIComponents, options:URIOptions):MailtoComponents {\n\t\tconst mailtoComponents = components as MailtoComponents;\n\t\tconst to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(\",\") : []);\n\t\tmailtoComponents.path = undefined;\n\n\t\tif (mailtoComponents.query) {\n\t\t\tlet unknownHeaders = false\n\t\t\tconst headers:MailtoHeaders = {};\n\t\t\tconst hfields = mailtoComponents.query.split(\"&\");\n\n\t\t\tfor (let x = 0, xl = hfields.length; x < xl; ++x) {\n\t\t\t\tconst hfield = hfields[x].split(\"=\");\n\n\t\t\t\tswitch (hfield[0]) {\n\t\t\t\t\tcase \"to\":\n\t\t\t\t\t\tconst toAddrs = hfield[1].split(\",\");\n\t\t\t\t\t\tfor (let x = 0, xl = toAddrs.length; x < xl; ++x) {\n\t\t\t\t\t\t\tto.push(toAddrs[x]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"subject\":\n\t\t\t\t\t\tmailtoComponents.subject = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"body\":\n\t\t\t\t\t\tmailtoComponents.body = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tunknownHeaders = true;\n\t\t\t\t\t\theaders[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (unknownHeaders) mailtoComponents.headers = headers;\n\t\t}\n\n\t\tmailtoComponents.query = undefined;\n\n\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\tconst addr = to[x].split(\"@\");\n\n\t\t\taddr[0] = unescapeComponent(addr[0]);\n\n\t\t\tif (!options.unicodeSupport) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\taddr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tmailtoComponents.error = mailtoComponents.error || \"Email address's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddr[1] = unescapeComponent(addr[1], options).toLowerCase();\n\t\t\t}\n\n\t\t\tto[x] = addr.join(\"@\");\n\t\t}\n\n\t\treturn mailtoComponents;\n\t},\n\n\tserialize : function (mailtoComponents:MailtoComponents, options:URIOptions):URIComponents {\n\t\tconst components = mailtoComponents as URIComponents;\n\t\tconst to = toArray(mailtoComponents.to);\n\t\tif (to) {\n\t\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\t\tconst toAddr = String(to[x]);\n\t\t\t\tconst atIdx = toAddr.lastIndexOf(\"@\");\n\t\t\t\tconst localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);\n\t\t\t\tlet domain = toAddr.slice(atIdx + 1);\n\n\t\t\t\t//convert IDN via punycode\n\t\t\t\ttry {\n\t\t\t\t\tdomain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Email address's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t\t}\n\n\t\t\t\tto[x] = localPart + \"@\" + domain;\n\t\t\t}\n\n\t\t\tcomponents.path = to.join(\",\");\n\t\t}\n\n\t\tconst headers = mailtoComponents.headers = mailtoComponents.headers || {};\n\n\t\tif (mailtoComponents.subject) headers[\"subject\"] = mailtoComponents.subject;\n\t\tif (mailtoComponents.body) headers[\"body\"] = mailtoComponents.body;\n\n\t\tconst fields = [];\n\t\tfor (const name in headers) {\n\t\t\tif (headers[name] !== O[name]) {\n\t\t\t\tfields.push(\n\t\t\t\t\tname.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) +\n\t\t\t\t\t\"=\" +\n\t\t\t\t\theaders[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (fields.length) {\n\t\t\tcomponents.query = fields.join(\"&\");\n\t\t}\n\n\t\treturn components;\n\t}\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport ws from \"./ws\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"wss\",\n\tdomainHost : ws.domainHost,\n\tparse : ws.parse,\n\tserialize : ws.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nexport interface WSComponents extends URIComponents {\n\tresourceName?: string;\n\tsecure?: boolean;\n}\n\nfunction isSecure(wsComponents:WSComponents):boolean {\n\treturn typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === \"wss\";\n}\n\n//RFC 6455\nconst handler:URISchemeHandler = {\n\tscheme : \"ws\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):WSComponents {\n\t\tconst wsComponents = components as WSComponents;\n\n\t\t//indicate if the secure flag is set\n\t\twsComponents.secure = isSecure(wsComponents);\n\n\t\t//construct resouce name\n\t\twsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');\n\t\twsComponents.path = undefined;\n\t\twsComponents.query = undefined;\n\n\t\treturn wsComponents;\n\t},\n\n\tserialize : function (wsComponents:WSComponents, options:URIOptions):URIComponents {\n\t\t//normalize the default port\n\t\tif (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === \"\") {\n\t\t\twsComponents.port = undefined;\n\t\t}\n\n\t\t//ensure scheme matches secure flag\n\t\tif (typeof wsComponents.secure === 'boolean') {\n\t\t\twsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws');\n\t\t\twsComponents.secure = undefined;\n\t\t}\n\n\t\t//reconstruct path from resource name\n\t\tif (wsComponents.resourceName) {\n\t\t\tconst [path, query] = wsComponents.resourceName.split('?');\n\t\t\twsComponents.path = (path && path !== '/' ? path : undefined);\n\t\t\twsComponents.query = query;\n\t\t\twsComponents.resourceName = undefined;\n\t\t}\n\n\t\t//forbid fragment component\n\t\twsComponents.fragment = undefined;\n\n\t\treturn wsComponents;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport http from \"./http\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"https\",\n\tdomainHost : http.domainHost,\n\tparse : http.parse,\n\tserialize : http.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"http\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\t//report missing host\n\t\tif (!components.host) {\n\t\t\tcomponents.error = components.error || \"HTTP URIs must have a host.\";\n\t\t}\n\n\t\treturn components;\n\t},\n\n\tserialize : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\tconst secure = String(components.scheme).toLowerCase() === \"https\";\n\n\t\t//normalize the default port\n\t\tif (components.port === (secure ? 443 : 80) || components.port === \"\") {\n\t\t\tcomponents.port = undefined;\n\t\t}\n\t\t\n\t\t//normalize the empty path\n\t\tif (!components.path) {\n\t\t\tcomponents.path = \"/\";\n\t\t}\n\n\t\t//NOTE: We do not parse query strings for HTTP URIs\n\t\t//as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n\t\t//and not the HTTP spec.\n\n\t\treturn components;\n\t}\n};\n\nexport default handler;","/**\n * URI.js\n *\n * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.\n * @author <a href=\"mailto:gary.court@gmail.com\">Gary Court</a>\n * @see http://github.com/garycourt/uri-js\n */\n\n/**\n * Copyright 2011 Gary Court. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n *    1. Redistributions of source code must retain the above copyright notice, this list of\n *       conditions and the following disclaimer.\n *\n *    2. Redistributions in binary form must reproduce the above copyright notice, this list\n *       of conditions and the following disclaimer in the documentation and/or other materials\n *       provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation are those of the\n * authors and should not be interpreted as representing official policies, either expressed\n * or implied, of Gary Court.\n */\n\nimport URI_PROTOCOL from \"./regexps-uri\";\nimport IRI_PROTOCOL from \"./regexps-iri\";\nimport punycode from \"punycode\";\nimport { toUpperCase, typeOf, assign } from \"./util\";\n\nexport interface URIComponents {\n\tscheme?:string;\n\tuserinfo?:string;\n\thost?:string;\n\tport?:number|string;\n\tpath?:string;\n\tquery?:string;\n\tfragment?:string;\n\treference?:string;\n\terror?:string;\n}\n\nexport interface URIOptions {\n\tscheme?:string;\n\treference?:string;\n\ttolerant?:boolean;\n\tabsolutePath?:boolean;\n\tiri?:boolean;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n}\n\nexport interface URISchemeHandler<Components extends URIComponents = URIComponents, Options extends URIOptions = URIOptions, ParentComponents extends URIComponents = URIComponents> {\n\tscheme:string;\n\tparse(components:ParentComponents, options:Options):Components;\n\tserialize(components:Components, options:Options):ParentComponents;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n\tabsolutePath?:boolean;\n}\n\nexport interface URIRegExps {\n\tNOT_SCHEME : RegExp,\n\tNOT_USERINFO : RegExp,\n\tNOT_HOST : RegExp,\n\tNOT_PATH : RegExp,\n\tNOT_PATH_NOSCHEME : RegExp,\n\tNOT_QUERY : RegExp,\n\tNOT_FRAGMENT : RegExp,\n\tESCAPE : RegExp,\n\tUNRESERVED : RegExp,\n\tOTHER_CHARS : RegExp,\n\tPCT_ENCODED : RegExp,\n\tIPV4ADDRESS : RegExp,\n\tIPV6ADDRESS : RegExp,\n}\n\nexport const SCHEMES:{[scheme:string]:URISchemeHandler} = {};\n\nexport function pctEncChar(chr:string):string {\n\tconst c = chr.charCodeAt(0);\n\tlet e:string;\n\n\tif (c < 16) e = \"%0\" + c.toString(16).toUpperCase();\n\telse if (c < 128) e = \"%\" + c.toString(16).toUpperCase();\n\telse if (c < 2048) e = \"%\" + ((c >> 6) | 192).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\telse e = \"%\" + ((c >> 12) | 224).toString(16).toUpperCase() + \"%\" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\n\treturn e;\n}\n\nexport function pctDecChars(str:string):string {\n\tlet newStr = \"\";\n\tlet i = 0;\n\tconst il = str.length;\n\n\twhile (i < il) {\n\t\tconst c = parseInt(str.substr(i + 1, 2), 16);\n\n\t\tif (c < 128) {\n\t\t\tnewStr += String.fromCharCode(c);\n\t\t\ti += 3;\n\t\t}\n\t\telse if (c >= 194 && c < 224) {\n\t\t\tif ((il - i) >= 6) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 6);\n\t\t\t}\n\t\t\ti += 6;\n\t\t}\n\t\telse if (c >= 224) {\n\t\t\tif ((il - i) >= 9) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tconst c3 = parseInt(str.substr(i + 7, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 9);\n\t\t\t}\n\t\t\ti += 9;\n\t\t}\n\t\telse {\n\t\t\tnewStr += str.substr(i, 3);\n\t\t\ti += 3;\n\t\t}\n\t}\n\n\treturn newStr;\n}\n\nfunction _normalizeComponentEncoding(components:URIComponents, protocol:URIRegExps) {\n\tfunction decodeUnreserved(str:string):string {\n\t\tconst decStr = pctDecChars(str);\n\t\treturn (!decStr.match(protocol.UNRESERVED) ? str : decStr);\n\t}\n\n\tif (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, \"\");\n\tif (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\n\treturn components;\n};\n\nfunction _stripLeadingZeros(str:string):string {\n\treturn str.replace(/^0*(.*)/, \"$1\") || \"0\";\n}\n\nfunction _normalizeIPv4(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV4ADDRESS) || [];\n\tconst [, address] = matches;\n\t\n\tif (address) {\n\t\treturn address.split(\".\").map(_stripLeadingZeros).join(\".\");\n\t} else {\n\t\treturn host;\n\t}\n}\n\nfunction _normalizeIPv6(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV6ADDRESS) || [];\n\tconst [, address, zone] = matches;\n\n\tif (address) {\n\t\tconst [last, first] = address.toLowerCase().split('::').reverse();\n\t\tconst firstFields = first ? first.split(\":\").map(_stripLeadingZeros) : [];\n\t\tconst lastFields = last.split(\":\").map(_stripLeadingZeros);\n\t\tconst isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);\n\t\tconst fieldCount = isLastFieldIPv4Address ? 7 : 8;\n\t\tconst lastFieldsStart = lastFields.length - fieldCount;\n\t\tconst fields = Array<string>(fieldCount);\n\n\t\tfor (let x = 0; x < fieldCount; ++x) {\n\t\t\tfields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';\n\t\t}\n\n\t\tif (isLastFieldIPv4Address) {\n\t\t\tfields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);\n\t\t}\n\n\t\tconst allZeroFields = fields.reduce<Array<{index:number,length:number}>>((acc, field, index) => {\n\t\t\tif (!field || field === \"0\") {\n\t\t\t\tconst lastLongest = acc[acc.length - 1];\n\t\t\t\tif (lastLongest && lastLongest.index + lastLongest.length === index) {\n\t\t\t\t\tlastLongest.length++;\n\t\t\t\t} else {\n\t\t\t\t\tacc.push({ index, length : 1 });\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, []);\n\n\t\tconst longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0];\n\n\t\tlet newHost:string;\n\t\tif (longestZeroFields && longestZeroFields.length > 1) {\n\t\t\tconst newFirst = fields.slice(0, longestZeroFields.index) ;\n\t\t\tconst newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);\n\t\t\tnewHost = newFirst.join(\":\") + \"::\" + newLast.join(\":\");\n\t\t} else {\n\t\t\tnewHost = fields.join(\":\");\n\t\t}\n\n\t\tif (zone) {\n\t\t\tnewHost += \"%\" + zone;\n\t\t}\n\n\t\treturn newHost;\n\t} else {\n\t\treturn host;\n\t}\n}\n\nconst URI_PARSE = /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:([^\\/?#@]*)@)?(\\[[^\\/?#\\]]+\\]|[^\\/?#:]*)(?:\\:(\\d*))?))?([^?#]*)(?:\\?([^#]*))?(?:#((?:.|\\n|\\r)*))?/i;\nconst NO_MATCH_IS_UNDEFINED = (<RegExpMatchArray>(\"\").match(/(){0}/))[1] === undefined;\n\nexport function parse(uriString:string, options:URIOptions = {}):URIComponents {\n\tconst components:URIComponents = {};\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\n\tif (options.reference === \"suffix\") uriString = (options.scheme ? options.scheme + \":\" : \"\") + \"//\" + uriString;\n\n\tconst matches = uriString.match(URI_PARSE);\n\n\tif (matches) {\n\t\tif (NO_MATCH_IS_UNDEFINED) {\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1];\n\t\t\tcomponents.userinfo = matches[3];\n\t\t\tcomponents.host = matches[4];\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = matches[7];\n\t\t\tcomponents.fragment = matches[8];\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = matches[5];\n\t\t\t}\n\t\t} else {  //IE FIX for improper RegExp matching\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1] || undefined;\n\t\t\tcomponents.userinfo = (uriString.indexOf(\"@\") !== -1 ? matches[3] : undefined);\n\t\t\tcomponents.host = (uriString.indexOf(\"//\") !== -1 ? matches[4] : undefined);\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = (uriString.indexOf(\"?\") !== -1 ? matches[7] : undefined);\n\t\t\tcomponents.fragment = (uriString.indexOf(\"#\") !== -1 ? matches[8] : undefined);\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = (uriString.match(/\\/\\/(?:.|\\n)*\\:(?:\\/|\\?|\\#|$)/) ? matches[4] : undefined);\n\t\t\t}\n\t\t}\n\n\t\tif (components.host) {\n\t\t\t//normalize IP hosts\n\t\t\tcomponents.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);\n\t\t}\n\n\t\t//determine reference type\n\t\tif (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {\n\t\t\tcomponents.reference = \"same-document\";\n\t\t} else if (components.scheme === undefined) {\n\t\t\tcomponents.reference = \"relative\";\n\t\t} else if (components.fragment === undefined) {\n\t\t\tcomponents.reference = \"absolute\";\n\t\t} else {\n\t\t\tcomponents.reference = \"uri\";\n\t\t}\n\n\t\t//check for reference errors\n\t\tif (options.reference && options.reference !== \"suffix\" && options.reference !== components.reference) {\n\t\t\tcomponents.error = components.error || \"URI is not a \" + options.reference + \" reference.\";\n\t\t}\n\n\t\t//find scheme handler\n\t\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t\t//check if scheme can't handle IRIs\n\t\tif (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n\t\t\t//if host component is a domain name\n\t\t\tif (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\tcomponents.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//convert IRI -> URI\n\t\t\t_normalizeComponentEncoding(components, URI_PROTOCOL);\n\t\t} else {\n\t\t\t//normalize encodings\n\t\t\t_normalizeComponentEncoding(components, protocol);\n\t\t}\n\n\t\t//perform scheme specific parsing\n\t\tif (schemeHandler && schemeHandler.parse) {\n\t\t\tschemeHandler.parse(components, options);\n\t\t}\n\t} else {\n\t\tcomponents.error = components.error || \"URI can not be parsed.\";\n\t}\n\n\treturn components;\n};\n\nfunction _recomposeAuthority(components:URIComponents, options:URIOptions):string|undefined {\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array<string> = [];\n\n\tif (components.userinfo !== undefined) {\n\t\turiTokens.push(components.userinfo);\n\t\turiTokens.push(\"@\");\n\t}\n\n\tif (components.host !== undefined) {\n\t\t//normalize IP hosts, add brackets and escape zone separator for IPv6\n\t\turiTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => \"[\" + $1 + ($2 ? \"%25\" + $2 : \"\") + \"]\"));\n\t}\n\n\tif (typeof components.port === \"number\" || typeof components.port === \"string\") {\n\t\turiTokens.push(\":\");\n\t\turiTokens.push(String(components.port));\n\t}\n\n\treturn uriTokens.length ? uriTokens.join(\"\") : undefined;\n};\n\nconst RDS1 = /^\\.\\.?\\//;\nconst RDS2 = /^\\/\\.(\\/|$)/;\nconst RDS3 = /^\\/\\.\\.(\\/|$)/;\nconst RDS4 = /^\\.\\.?$/;\nconst RDS5 = /^\\/?(?:.|\\n)*?(?=\\/|$)/;\n\nexport function removeDotSegments(input:string):string {\n\tconst output:Array<string> = [];\n\n\twhile (input.length) {\n\t\tif (input.match(RDS1)) {\n\t\t\tinput = input.replace(RDS1, \"\");\n\t\t} else if (input.match(RDS2)) {\n\t\t\tinput = input.replace(RDS2, \"/\");\n\t\t} else if (input.match(RDS3)) {\n\t\t\tinput = input.replace(RDS3, \"/\");\n\t\t\toutput.pop();\n\t\t} else if (input === \".\" || input === \"..\") {\n\t\t\tinput = \"\";\n\t\t} else {\n\t\t\tconst im = input.match(RDS5);\n\t\t\tif (im) {\n\t\t\t\tconst s = im[0];\n\t\t\t\tinput = input.slice(s.length);\n\t\t\t\toutput.push(s);\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Unexpected dot segment condition\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn output.join(\"\");\n};\n\nexport function serialize(components:URIComponents, options:URIOptions = {}):string {\n\tconst protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array<string> = [];\n\n\t//find scheme handler\n\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t//perform scheme specific serialization\n\tif (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);\n\n\tif (components.host) {\n\t\t//if host component is an IPv6 address\n\t\tif (protocol.IPV6ADDRESS.test(components.host)) {\n\t\t\t//TODO: normalize IPv6 address as per RFC 5952\n\t\t}\n\n\t\t//if host component is a domain name\n\t\telse if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) {\n\t\t\t//convert IDN via punycode\n\t\t\ttry {\n\t\t\t\tcomponents.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host));\n\t\t\t} catch (e) {\n\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t}\n\t\t}\n\t}\n\n\t//normalize encoding\n\t_normalizeComponentEncoding(components, protocol);\n\n\tif (options.reference !== \"suffix\" && components.scheme) {\n\t\turiTokens.push(components.scheme);\n\t\turiTokens.push(\":\");\n\t}\n\n\tconst authority = _recomposeAuthority(components, options);\n\tif (authority !== undefined) {\n\t\tif (options.reference !== \"suffix\") {\n\t\t\turiTokens.push(\"//\");\n\t\t}\n\n\t\turiTokens.push(authority);\n\n\t\tif (components.path && components.path.charAt(0) !== \"/\") {\n\t\t\turiTokens.push(\"/\");\n\t\t}\n\t}\n\n\tif (components.path !== undefined) {\n\t\tlet s = components.path;\n\n\t\tif (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n\t\t\ts = removeDotSegments(s);\n\t\t}\n\n\t\tif (authority === undefined) {\n\t\t\ts = s.replace(/^\\/\\//, \"/%2F\");  //don't allow the path to start with \"//\"\n\t\t}\n\n\t\turiTokens.push(s);\n\t}\n\n\tif (components.query !== undefined) {\n\t\turiTokens.push(\"?\");\n\t\turiTokens.push(components.query);\n\t}\n\n\tif (components.fragment !== undefined) {\n\t\turiTokens.push(\"#\");\n\t\turiTokens.push(components.fragment);\n\t}\n\n\treturn uriTokens.join(\"\");  //merge tokens into a string\n};\n\nexport function resolveComponents(base:URIComponents, relative:URIComponents, options:URIOptions = {}, skipNormalization?:boolean):URIComponents {\n\tconst target:URIComponents = {};\n\n\tif (!skipNormalization) {\n\t\tbase = parse(serialize(base, options), options);  //normalize base components\n\t\trelative = parse(serialize(relative, options), options);  //normalize relative components\n\t}\n\toptions = options || {};\n\n\tif (!options.tolerant && relative.scheme) {\n\t\ttarget.scheme = relative.scheme;\n\t\t//target.authority = relative.authority;\n\t\ttarget.userinfo = relative.userinfo;\n\t\ttarget.host = relative.host;\n\t\ttarget.port = relative.port;\n\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\ttarget.query = relative.query;\n\t} else {\n\t\tif (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n\t\t\t//target.authority = relative.authority;\n\t\t\ttarget.userinfo = relative.userinfo;\n\t\t\ttarget.host = relative.host;\n\t\t\ttarget.port = relative.port;\n\t\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\t\ttarget.query = relative.query;\n\t\t} else {\n\t\t\tif (!relative.path) {\n\t\t\t\ttarget.path = base.path;\n\t\t\t\tif (relative.query !== undefined) {\n\t\t\t\t\ttarget.query = relative.query;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.query = base.query;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (relative.path.charAt(0) === \"/\") {\n\t\t\t\t\ttarget.path = removeDotSegments(relative.path);\n\t\t\t\t} else {\n\t\t\t\t\tif ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n\t\t\t\t\t\ttarget.path = \"/\" + relative.path;\n\t\t\t\t\t} else if (!base.path) {\n\t\t\t\t\t\ttarget.path = relative.path;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttarget.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n\t\t\t\t\t}\n\t\t\t\t\ttarget.path = removeDotSegments(target.path);\n\t\t\t\t}\n\t\t\t\ttarget.query = relative.query;\n\t\t\t}\n\t\t\t//target.authority = base.authority;\n\t\t\ttarget.userinfo = base.userinfo;\n\t\t\ttarget.host = base.host;\n\t\t\ttarget.port = base.port;\n\t\t}\n\t\ttarget.scheme = base.scheme;\n\t}\n\n\ttarget.fragment = relative.fragment;\n\n\treturn target;\n};\n\nexport function resolve(baseURI:string, relativeURI:string, options?:URIOptions):string {\n\tconst schemelessOptions = assign({ scheme : 'null' }, options);\n\treturn serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);\n};\n\nexport function normalize(uri:string, options?:URIOptions):string;\nexport function normalize(uri:URIComponents, options?:URIOptions):URIComponents;\nexport function normalize(uri:any, options?:URIOptions):any {\n\tif (typeof uri === \"string\") {\n\t\turi = serialize(parse(uri, options), options);\n\t} else if (typeOf(uri) === \"object\") {\n\t\turi = parse(serialize(<URIComponents>uri, options), options);\n\t}\n\n\treturn uri;\n};\n\nexport function equal(uriA:string, uriB:string, options?: URIOptions):boolean;\nexport function equal(uriA:URIComponents, uriB:URIComponents, options?:URIOptions):boolean;\nexport function equal(uriA:any, uriB:any, options?:URIOptions):boolean {\n\tif (typeof uriA === \"string\") {\n\t\turiA = serialize(parse(uriA, options), options);\n\t} else if (typeOf(uriA) === \"object\") {\n\t\turiA = serialize(<URIComponents>uriA, options);\n\t}\n\n\tif (typeof uriB === \"string\") {\n\t\turiB = serialize(parse(uriB, options), options);\n\t} else if (typeOf(uriB) === \"object\") {\n\t\turiB = serialize(<URIComponents>uriB, options);\n\t}\n\n\treturn uriA === uriB;\n};\n\nexport function escapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar);\n};\n\nexport function unescapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars);\n};\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tconst parts = string.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tconst labels = string.split('.');\n\tconst encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see <https://mathiasbynens.be/notes/javascript-encoding>\n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = array => String.fromCodePoint(...array);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t//  0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tlet oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tlet inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tlet basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue == n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.1.0',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see <https://mathiasbynens.be/notes/javascript-encoding>\n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport default punycode;\n","import { URIRegExps } from \"./uri\";\nimport { buildExps } from \"./regexps-uri\";\n\nexport default buildExps(true);\n","import { URIRegExps } from \"./uri\";\nimport { merge, subexp } from \"./util\";\n\nexport function buildExps(isIRI:boolean):URIRegExps {\n\tconst\n\t\tALPHA$$ = \"[A-Za-z]\",\n\t\tCR$ = \"[\\\\x0D]\",\n\t\tDIGIT$$ = \"[0-9]\",\n\t\tDQUOTE$$ = \"[\\\\x22]\",\n\t\tHEXDIG$$ = merge(DIGIT$$, \"[A-Fa-f]\"),  //case-insensitive\n\t\tLF$$ = \"[\\\\x0A]\",\n\t\tSP$$ = \"[\\\\x20]\",\n\t\tPCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)),  //expanded\n\t\tGEN_DELIMS$$ = \"[\\\\:\\\\/\\\\?\\\\#\\\\[\\\\]\\\\@]\",\n\t\tSUB_DELIMS$$ = \"[\\\\!\\\\$\\\\&\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\=]\",\n\t\tRESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),\n\t\tUCSCHAR$$ = isIRI ? \"[\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF]\" : \"[]\",  //subset, excludes bidi control characters\n\t\tIPRIVATE$$ = isIRI ? \"[\\\\uE000-\\\\uF8FF]\" : \"[]\",  //subset\n\t\tUNRESERVED$$ = merge(ALPHA$$, DIGIT$$, \"[\\\\-\\\\.\\\\_\\\\~]\", UCSCHAR$$),\n\t\tSCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\") + \"*\"),\n\t\tUSERINFO$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\")) + \"*\"),\n\t\tDEC_OCTET$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"[1-9]\" + DIGIT$$) + \"|\" + DIGIT$$),\n\t\tDEC_OCTET_RELAXED$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"0?[1-9]\" + DIGIT$$) + \"|0?0?\" + DIGIT$$),  //relaxed parsing rules\n\t\tIPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$),\n\t\tH16$ = subexp(HEXDIG$$ + \"{1,4}\"),\n\t\tLS32$ = subexp(subexp(H16$ + \"\\\\:\" + H16$) + \"|\" + IPV4ADDRESS$),\n\t\tIPV6ADDRESS1$ = subexp(                                                            subexp(H16$ + \"\\\\:\") + \"{6}\" + LS32$), //                           6( h16 \":\" ) ls32\n\t\tIPV6ADDRESS2$ = subexp(                                                 \"\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{5}\" + LS32$), //                      \"::\" 5( h16 \":\" ) ls32\n\t\tIPV6ADDRESS3$ = subexp(subexp(                                 H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{4}\" + LS32$), //[               h16 ] \"::\" 4( h16 \":\" ) ls32\n\t\tIPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,1}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{3}\" + LS32$), //[ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n\t\tIPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,2}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{2}\" + LS32$), //[ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n\t\tIPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,3}\" + H16$) + \"?\\\\:\\\\:\" +        H16$ + \"\\\\:\"          + LS32$), //[ *3( h16 \":\" ) h16 ] \"::\"    h16 \":\"   ls32\n\t\tIPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,4}\" + H16$) + \"?\\\\:\\\\:\"                                + LS32$), //[ *4( h16 \":\" ) h16 ] \"::\"              ls32\n\t\tIPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,5}\" + H16$) + \"?\\\\:\\\\:\"                                + H16$ ), //[ *5( h16 \":\" ) h16 ] \"::\"              h16\n\t\tIPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,6}\" + H16$) + \"?\\\\:\\\\:\"                                       ), //[ *6( h16 \":\" ) h16 ] \"::\"\n\t\tIPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join(\"|\")),\n\t\tZONEID$ = subexp(subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$) + \"+\"),  //RFC 6874\n\t\tIPV6ADDRZ$ = subexp(IPV6ADDRESS$ + \"\\\\%25\" + ZONEID$),  //RFC 6874\n\t\tIPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + ZONEID$),  //RFC 6874, with relaxed parsing rules\n\t\tIPVFUTURE$ = subexp(\"[vV]\" + HEXDIG$$ + \"+\\\\.\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\") + \"+\"),\n\t\tIP_LITERAL$ = subexp(\"\\\\[\" + subexp(IPV6ADDRZ_RELAXED$ + \"|\" + IPV6ADDRESS$ + \"|\" + IPVFUTURE$) + \"\\\\]\"),  //RFC 6874\n\t\tREG_NAME$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$)) + \"*\"),\n\t\tHOST$ = subexp(IP_LITERAL$ + \"|\" + IPV4ADDRESS$ + \"(?!\" + REG_NAME$ + \")\" + \"|\" + REG_NAME$),\n\t\tPORT$ = subexp(DIGIT$$ + \"*\"),\n\t\tAUTHORITY$ = subexp(subexp(USERINFO$ + \"@\") + \"?\" + HOST$ + subexp(\"\\\\:\" + PORT$) + \"?\"),\n\t\tPCHAR$ = subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@]\")),\n\t\tSEGMENT$ = subexp(PCHAR$ + \"*\"),\n\t\tSEGMENT_NZ$ = subexp(PCHAR$ + \"+\"),\n\t\tSEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\@]\")) + \"+\"),\n\t\tPATH_ABEMPTY$ = subexp(subexp(\"\\\\/\" + SEGMENT$) + \"*\"),\n\t\tPATH_ABSOLUTE$ = subexp(\"\\\\/\" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + \"?\"),  //simplified\n\t\tPATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$),  //simplified\n\t\tPATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$),  //simplified\n\t\tPATH_EMPTY$ = \"(?!\" + PCHAR$ + \")\",\n\t\tPATH$ = subexp(PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tQUERY$ = subexp(subexp(PCHAR$ + \"|\" + merge(\"[\\\\/\\\\?]\", IPRIVATE$$)) + \"*\"),\n\t\tFRAGMENT$ = subexp(subexp(PCHAR$ + \"|[\\\\/\\\\?]\") + \"*\"),\n\t\tHIER_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tURI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tRELATIVE_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$),\n\t\tRELATIVE$ = subexp(RELATIVE_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tURI_REFERENCE$ = subexp(URI$ + \"|\" + RELATIVE$),\n\t\tABSOLUTE_URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\"),\n\n\t\tGENERIC_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tRELATIVE_REF$ = \"^(){0}\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tABSOLUTE_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?$\",\n\t\tSAMEDOC_REF$ = \"^\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tAUTHORITY_REF$ = \"^\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?$\"\n\t;\n\n\treturn {\n\t\tNOT_SCHEME : new RegExp(merge(\"[^]\", ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\"), \"g\"),\n\t\tNOT_USERINFO : new RegExp(merge(\"[^\\\\%\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_HOST : new RegExp(merge(\"[^\\\\%\\\\[\\\\]\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH : new RegExp(merge(\"[^\\\\%\\\\/\\\\:\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH_NOSCHEME : new RegExp(merge(\"[^\\\\%\\\\/\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_QUERY : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\", IPRIVATE$$), \"g\"),\n\t\tNOT_FRAGMENT : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\"), \"g\"),\n\t\tESCAPE : new RegExp(merge(\"[^]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tUNRESERVED : new RegExp(UNRESERVED$$, \"g\"),\n\t\tOTHER_CHARS : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, RESERVED$$), \"g\"),\n\t\tPCT_ENCODED : new RegExp(PCT_ENCODED$, \"g\"),\n\t\tIPV4ADDRESS : new RegExp(\"^(\" + IPV4ADDRESS$ + \")$\"),\n\t\tIPV6ADDRESS : new RegExp(\"^\\\\[?(\" + IPV6ADDRESS$ + \")\" + subexp(subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + \"(\" + ZONEID$ + \")\") + \"?\\\\]?$\")  //RFC 6874, with relaxed parsing rules\n\t};\n}\n\nexport default buildExps(false);\n","export function merge(...sets:Array<string>):string {\n\tif (sets.length > 1) {\n\t\tsets[0] = sets[0].slice(0, -1);\n\t\tconst xl = sets.length - 1;\n\t\tfor (let x = 1; x < xl; ++x) {\n\t\t\tsets[x] = sets[x].slice(1, -1);\n\t\t}\n\t\tsets[xl] = sets[xl].slice(1);\n\t\treturn sets.join('');\n\t} else {\n\t\treturn sets[0];\n\t}\n}\n\nexport function subexp(str:string):string {\n\treturn \"(?:\" + str + \")\";\n}\n\nexport function typeOf(o:any):string {\n\treturn o === undefined ? \"undefined\" : (o === null ? \"null\" : Object.prototype.toString.call(o).split(\" \").pop().split(\"]\").shift().toLowerCase());\n}\n\nexport function toUpperCase(str:string):string {\n\treturn str.toUpperCase();\n}\n\nexport function toArray(obj:any):Array<any> {\n\treturn obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== \"number\" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : [];\n}\n\n\nexport function assign(target: object, source: any): any {\n\tconst obj = target as any;\n\tif (source) {\n\t\tfor (const key in source) {\n\t\t\tobj[key] = source[key];\n\t\t}\n\t}\n\treturn obj;\n}"],"names":["SCHEMES","uuid","scheme","urn","mailto","wss","ws","https","http","urnComponents","nss","uuidComponents","toLowerCase","options","error","tolerant","match","UUID","undefined","handler","uriComponents","path","nid","schemeHandler","serialize","urnScheme","parse","matches","components","URN_PARSE","query","fields","join","length","push","name","replace","PCT_ENCODED","decodeUnreserved","toUpperCase","NOT_HFNAME","pctEncChar","headers","NOT_HFVALUE","O","mailtoComponents","body","subject","to","x","localPart","domain","iri","e","punycode","toASCII","unescapeComponent","toUnicode","toAddr","slice","atIdx","NOT_LOCAL_PART","lastIndexOf","String","xl","toArray","addr","unicodeSupport","split","unknownHeaders","hfield","toAddrs","hfields","decStr","UNRESERVED","str","pctDecChars","RegExp","merge","UNRESERVED$$","SOME_DELIMS$$","ATEXT$$","VCHAR$$","PCT_ENCODED$","QTEXT$$","subexp","HEXDIG$$","isIRI","domainHost","wsComponents","fragment","resourceName","secure","port","isSecure","host","toString","URI_PROTOCOL","IRI_PROTOCOL","ESCAPE","escapeComponent","uriA","uriB","typeOf","equal","uri","normalize","resolveComponents","baseURI","schemelessOptions","relativeURI","assign","resolve","target","relative","base","userinfo","removeDotSegments","charAt","skipNormalization","uriTokens","s","authority","absolutePath","reference","_recomposeAuthority","protocol","IPV6ADDRESS","test","output","Error","input","im","RDS5","pop","RDS3","RDS2","RDS1","$1","$2","_normalizeIPv6","_normalizeIPv4","_","uriString","isNaN","indexOf","parseInt","NO_MATCH_IS_UNDEFINED","URI_PARSE","newHost","zone","newFirst","newLast","longestZeroFields","index","b","a","allZeroFields","sort","acc","lastLongest","field","reduce","fieldCount","isLastFieldIPv4Address","firstFields","lastFields","lastFieldsStart","Array","IPV4ADDRESS","last","map","_stripLeadingZeros","first","address","reverse","NOT_FRAGMENT","NOT_QUERY","NOT_PATH","NOT_PATH_NOSCHEME","NOT_HOST","NOT_USERINFO","NOT_SCHEME","_normalizeComponentEncoding","newStr","substr","i","fromCharCode","c","c2","c3","il","chr","charCodeAt","encode","decode","ucs2encode","ucs2decode","regexNonASCII","string","mapDomain","regexPunycode","n","delta","handledCPCount","adapt","handledCPCountPlusOne","basicLength","stringFromCharCode","digitToBasic","q","floor","qMinusT","baseMinusT","t","k","bias","tMin","tMax","currentValue","maxInt","m","inputLength","delimiter","initialBias","initialN","fromCodePoint","splice","out","oldi","w","digit","basicToDigit","basic","j","baseMinusTMin","skew","numPoints","firstTime","damp","flag","codePoint","array","value","extra","counter","result","encoded","labels","fn","regexSeparators","parts","RangeError","errors","type","Math","buildExps","IPV6ADDRESS$","ZONEID$","IPV4ADDRESS$","RESERVED$$","SUB_DELIMS$$","IPRIVATE$$","ALPHA$$","DIGIT$$","AUTHORITY_REF$","USERINFO$","HOST$","PORT$","SAMEDOC_REF$","FRAGMENT$","ABSOLUTE_REF$","SCHEME$","PATH_ABEMPTY$","PATH_ABSOLUTE$","PATH_ROOTLESS$","PATH_EMPTY$","QUERY$","RELATIVE_REF$","PATH_NOSCHEME$","GENERIC_REF$","ABSOLUTE_URI$","HIER_PART$","URI_REFERENCE$","URI$","RELATIVE$","RELATIVE_PART$","AUTHORITY$","PCHAR$","PATH$","SEGMENT_NZ$","SEGMENT_NZ_NC$","SEGMENT$","IP_LITERAL$","REG_NAME$","IPV6ADDRZ_RELAXED$","IPVFUTURE$","IPV6ADDRESS1$","IPV6ADDRESS2$","IPV6ADDRESS3$","IPV6ADDRESS4$","IPV6ADDRESS5$","IPV6ADDRESS6$","IPV6ADDRESS7$","IPV6ADDRESS8$","IPV6ADDRESS9$","H16$","LS32$","DEC_OCTET_RELAXED$","DEC_OCTET$","UCSCHAR$$","GEN_DELIMS$$","SP$$","DQUOTE$$","CR$","obj","key","source","setInterval","call","prototype","o","Object","shift","sets"],"mappings":";;;;;;;AYAA,SAAA8E,KAAA,GAAA;sCAAyBsP,IAAzB;YAAA;;;QACKA,KAAKnS,MAAL,GAAc,CAAlB,EAAqB;aACf,CAAL,IAAUmS,KAAK,CAAL,EAAQzQ,KAAR,CAAc,CAAd,EAAiB,CAAC,CAAlB,CAAV;YACMK,KAAKoQ,KAAKnS,MAAL,GAAc,CAAzB;aACK,IAAIgB,IAAI,CAAb,EAAgBA,IAAIe,EAApB,EAAwB,EAAEf,CAA1B,EAA6B;iBACvBA,CAAL,IAAUmR,KA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AA/C;;eAGMH,cAAP;KAZ0E;eAe/D,mBAAUA,cAAV,EAAyCE,OAAzC,EAAb;YACQJ,gBAAgBE,cAAtB;;sBAEcD,GAAd,GAAoB,CAACC,eAAeV,IAAf,IAAuB,EAAxB,EAA4BW,WAA5B,EAApB;eACOH,aAAP;;CAnBF,CAuBA;;ADhCAT,QAAQQ,QAAKN,MAAb,IAAuBM,OAAvB;AAEA,AACAR,QAAQO,UAAML,MAAd,IAAwBK,SAAxB;AAEA,AACAP,QAAQM,UAAGJ,MAAX,IAAqBI,SAArB;AAEA,AACAN,QAAQK,UAAIH,MAAZ,IAAsBG,SAAtB;AAEA,AACAL,QAAQI,UAAOF,MAAf,IAAyBE,SAAzB;AAEA,AACAJ,QAAQG,UAAID,MAAZ,IAAsBC,SAAtB;AAEA,AACAH,QAAQC,UAAKC,MAAb,IAAuBD,SAAvB,CAEA;;;;;;;;;;;;;;;;;"}Nix0Cϼ/** @license URI.js v4.4.1 (c) 2011 Gary Court. License: http://github.com/garycourt/uri-js */
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports):"function"==typeof define&&define.amd?define(["exports"],r):r(e.URI=e.URI||{})}(this,function(e){"use strict";function r(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];if(r.length>1){r[0]=r[0].slice(0,-1);for(var t=r.length-1,o=1;o<t;++o)r[o]=r[o].slice(1,-1);return r[t]=r[t].slice(1),r.join("")}return r[0]}function n(e){return"(?:"+e+")"}function t(e){return e===undefined?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function o(e){return e.toUpperCase()}function a(e){return e!==undefined&&null!==e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function i(e,r){var n=e;if(r)for(var t in r)n[t]=r[t];return n}function u(e){var t=r("[0-9]","[A-Fa-f]"),o=n(n("%[EFef]"+t+"%"+t+t+"%"+t+t)+"|"+n("%[89A-Fa-f]"+t+"%"+t+t)+"|"+n("%"+t+t)),a="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",i=r("[\\:\\/\\?\\#\\[\\]\\@]",a),u=e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",s=e?"[\\uE000-\\uF8FF]":"[]",f=r("[A-Za-z]","[0-9]","[\\-\\.\\_\\~]",u),c=n(n("25[0-5]")+"|"+n("2[0-4][0-9]")+"|"+n("1[0-9][0-9]")+"|"+n("0?[1-9][0-9]")+"|0?0?[0-9]"),p=n(c+"\\."+c+"\\."+c+"\\."+c),h=n(t+"{1,4}"),d=n(n(h+"\\:"+h)+"|"+p),l=n(n(h+"\\:")+"{6}"+d),m=n("\\:\\:"+n(h+"\\:")+"{5}"+d),g=n(n(h)+"?\\:\\:"+n(h+"\\:")+"{4}"+d),v=n(n(n(h+"\\:")+"{0,1}"+h)+"?\\:\\:"+n(h+"\\:")+"{3}"+d),E=n(n(n(h+"\\:")+"{0,2}"+h)+"?\\:\\:"+n(h+"\\:")+"{2}"+d),C=n(n(n(h+"\\:")+"{0,3}"+h)+"?\\:\\:"+h+"\\:"+d),y=n(n(n(h+"\\:")+"{0,4}"+h)+"?\\:\\:"+d),S=n(n(n(h+"\\:")+"{0,5}"+h)+"?\\:\\:"+h),A=n(n(n(h+"\\:")+"{0,6}"+h)+"?\\:\\:"),D=n([l,m,g,v,E,C,y,S,A].join("|")),w=n(n(f+"|"+o)+"+");return{NOT_SCHEME:new RegExp(r("[^]","[A-Za-z]","[0-9]","[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(r("[^\\%\\:]",f,a),"g"),NOT_HOST:new RegExp(r("[^\\%\\[\\]\\:]",f,a),"g"),NOT_PATH:new RegExp(r("[^\\%\\/\\:\\@]",f,a),"g"),NOT_PATH_NOSCHEME:new RegExp(r("[^\\%\\/\\@]",f,a),"g"),NOT_QUERY:new RegExp(r("[^\\%]",f,a,"[\\:\\@\\/\\?]",s),"g"),NOT_FRAGMENT:new RegExp(r("[^\\%]",f,a,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(r("[^]",f,a),"g"),UNRESERVED:new RegExp(f,"g"),OTHER_CHARS:new RegExp(r("[^\\%]",f,i),"g"),PCT_ENCODED:new RegExp(o,"g"),IPV4ADDRESS:new RegExp("^("+p+")$"),IPV6ADDRESS:new RegExp("^\\[?("+D+")"+n(n("\\%25|\\%(?!"+t+"{2})")+"("+w+")")+"?\\]?$")}}function s(e){throw new RangeError(H[e])}function f(e,r){for(var n=[],t=e.length;t--;)n[t]=r(e[t]);return n}function c(e,r){var n=e.split("@"),t="";return n.length>1&&(t=n[0]+"@",e=n[1]),e=e.replace(j,"."),t+f(e.split("."),r).join(".")}function p(e){for(var r=[],n=0,t=e.length;n<t;){var o=e.charCodeAt(n++);if(o>=55296&&o<=56319&&n<t){var a=e.charCodeAt(n++);56320==(64512&a)?r.push(((1023&o)<<10)+(1023&a)+65536):(r.push(o),n--)}else r.push(o)}return r}function h(e){var r=e.charCodeAt(0);return r<16?"%0"+r.toString(16).toUpperCase():r<128?"%"+r.toString(16).toUpperCase():r<2048?"%"+(r>>6|192).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase():"%"+(r>>12|224).toString(16).toUpperCase()+"%"+(r>>6&63|128).toString(16).toUpperCase()+"%"+(63&r|128).toString(16).toUpperCase()}function d(e){for(var r="",n=0,t=e.length;n<t;){var o=parseInt(e.substr(n+1,2),16);if(o<128)r+=String.fromCharCode(o),n+=3;else if(o>=194&&o<224){if(t-n>=6){var a=parseInt(e.substr(n+4,2),16);r+=String.fromCharCode((31&o)<<6|63&a)}else r+=e.substr(n,6);n+=6}else if(o>=224){if(t-n>=9){var i=parseInt(e.substr(n+4,2),16),u=parseInt(e.substr(n+7,2),16);r+=String.fromCharCode((15&o)<<12|(63&i)<<6|63&u)}else r+=e.substr(n,9);n+=9}else r+=e.substr(n,3),n+=3}return r}function l(e,r){function n(e){var n=d(e);return n.match(r.UNRESERVED)?n:e}return e.scheme&&(e.scheme=String(e.scheme).replace(r.PCT_ENCODED,n).toLowerCase().replace(r.NOT_SCHEME,"")),e.userinfo!==undefined&&(e.userinfo=String(e.userinfo).replace(r.PCT_ENCODED,n).replace(r.NOT_USERINFO,h).replace(r.PCT_ENCODED,o)),e.host!==undefined&&(e.host=String(e.host).replace(r.PCT_ENCODED,n).toLowerCase().replace(r.NOT_HOST,h).replace(r.PCT_ENCODED,o)),e.path!==undefined&&(e.path=String(e.path).replace(r.PCT_ENCODED,n).replace(e.scheme?r.NOT_PATH:r.NOT_PATH_NOSCHEME,h).replace(r.PCT_ENCODED,o)),e.query!==undefined&&(e.query=String(e.query).replace(r.PCT_ENCODED,n).replace(r.NOT_QUERY,h).replace(r.PCT_ENCODED,o)),e.fragment!==undefined&&(e.fragment=String(e.fragment).replace(r.PCT_ENCODED,n).replace(r.NOT_FRAGMENT,h).replace(r.PCT_ENCODED,o)),e}function m(e){return e.replace(/^0*(.*)/,"$1")||"0"}function g(e,r){var n=e.match(r.IPV4ADDRESS)||[],t=T(n,2),o=t[1];return o?o.split(".").map(m).join("."):e}function v(e,r){var n=e.match(r.IPV6ADDRESS)||[],t=T(n,3),o=t[1],a=t[2];if(o){for(var i=o.toLowerCase().split("::").reverse(),u=T(i,2),s=u[0],f=u[1],c=f?f.split(":").map(m):[],p=s.split(":").map(m),h=r.IPV4ADDRESS.test(p[p.length-1]),d=h?7:8,l=p.length-d,v=Array(d),E=0;E<d;++E)v[E]=c[E]||p[l+E]||"";h&&(v[d-1]=g(v[d-1],r));var C=v.reduce(function(e,r,n){if(!r||"0"===r){var t=e[e.length-1];t&&t.index+t.length===n?t.length++:e.push({index:n,length:1})}return e},[]),y=C.sort(function(e,r){return r.length-e.length})[0],S=void 0;if(y&&y.length>1){var A=v.slice(0,y.index),D=v.slice(y.index+y.length);S=A.join(":")+"::"+D.join(":")}else S=v.join(":");return a&&(S+="%"+a),S}return e}function E(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n={},t=!1!==r.iri?R:F;"suffix"===r.reference&&(e=(r.scheme?r.scheme+":":"")+"//"+e);var o=e.match(K);if(o){W?(n.scheme=o[1],n.userinfo=o[3],n.host=o[4],n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=o[7],n.fragment=o[8],isNaN(n.port)&&(n.port=o[5])):(n.scheme=o[1]||undefined,n.userinfo=-1!==e.indexOf("@")?o[3]:undefined,n.host=-1!==e.indexOf("//")?o[4]:undefined,n.port=parseInt(o[5],10),n.path=o[6]||"",n.query=-1!==e.indexOf("?")?o[7]:undefined,n.fragment=-1!==e.indexOf("#")?o[8]:undefined,isNaN(n.port)&&(n.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?o[4]:undefined)),n.host&&(n.host=v(g(n.host,t),t)),n.scheme!==undefined||n.userinfo!==undefined||n.host!==undefined||n.port!==undefined||n.path||n.query!==undefined?n.scheme===undefined?n.reference="relative":n.fragment===undefined?n.reference="absolute":n.reference="uri":n.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==n.reference&&(n.error=n.error||"URI is not a "+r.reference+" reference.");var a=J[(r.scheme||n.scheme||"").toLowerCase()];if(r.unicodeSupport||a&&a.unicodeSupport)l(n,t);else{if(n.host&&(r.domainHost||a&&a.domainHost))try{n.host=B.toASCII(n.host.replace(t.PCT_ENCODED,d).toLowerCase())}catch(i){n.error=n.error||"Host's domain name can not be converted to ASCII via punycode: "+i}l(n,F)}a&&a.parse&&a.parse(n,r)}else n.error=n.error||"URI can not be parsed.";return n}function C(e,r){var n=!1!==r.iri?R:F,t=[];return e.userinfo!==undefined&&(t.push(e.userinfo),t.push("@")),e.host!==undefined&&t.push(v(g(String(e.host),n),n).replace(n.IPV6ADDRESS,function(e,r,n){return"["+r+(n?"%25"+n:"")+"]"})),"number"!=typeof e.port&&"string"!=typeof e.port||(t.push(":"),t.push(String(e.port))),t.length?t.join(""):undefined}function y(e){for(var r=[];e.length;)if(e.match(X))e=e.replace(X,"");else if(e.match(ee))e=e.replace(ee,"/");else if(e.match(re))e=e.replace(re,"/"),r.pop();else if("."===e||".."===e)e="";else{var n=e.match(ne);if(!n)throw new Error("Unexpected dot segment condition");var t=n[0];e=e.slice(t.length),r.push(t)}return r.join("")}function S(e){var r=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{},n=r.iri?R:F,t=[],o=J[(r.scheme||e.scheme||"").toLowerCase()];if(o&&o.serialize&&o.serialize(e,r),e.host)if(n.IPV6ADDRESS.test(e.host));else if(r.domainHost||o&&o.domainHost)try{e.host=r.iri?B.toUnicode(e.host):B.toASCII(e.host.replace(n.PCT_ENCODED,d).toLowerCase())}catch(u){e.error=e.error||"Host's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+u}l(e,n),"suffix"!==r.reference&&e.scheme&&(t.push(e.scheme),t.push(":"));var a=C(e,r);if(a!==undefined&&("suffix"!==r.reference&&t.push("//"),t.push(a),e.path&&"/"!==e.path.charAt(0)&&t.push("/")),e.path!==undefined){var i=e.path;r.absolutePath||o&&o.absolutePath||(i=y(i)),a===undefined&&(i=i.replace(/^\/\//,"/%2F")),t.push(i)}return e.query!==undefined&&(t.push("?"),t.push(e.query)),e.fragment!==undefined&&(t.push("#"),t.push(e.fragment)),t.join("")}function A(e,r){var n=arguments.length>2&&arguments[2]!==undefined?arguments[2]:{},t=arguments[3],o={};return t||(e=E(S(e,n),n),r=E(S(r,n),n)),n=n||{},!n.tolerant&&r.scheme?(o.scheme=r.scheme,o.userinfo=r.userinfo,o.host=r.host,o.port=r.port,o.path=y(r.path||""),o.query=r.query):(r.userinfo!==undefined||r.host!==undefined||r.port!==undefined?(o.userinfo=r.userinfo,o.host=r.host,o.port=r.port,o.path=y(r.path||""),o.query=r.query):(r.path?("/"===r.path.charAt(0)?o.path=y(r.path):(e.userinfo===undefined&&e.host===undefined&&e.port===undefined||e.path?e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+r.path:o.path=r.path:o.path="/"+r.path,o.path=y(o.path)),o.query=r.query):(o.path=e.path,r.query!==undefined?o.query=r.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=r.fragment,o}function D(e,r,n){var t=i({scheme:"null"},n);return S(A(E(e,t),E(r,t),t,!0),t)}function w(e,r){return"string"==typeof e?e=S(E(e,r),r):"object"===t(e)&&(e=E(S(e,r),r)),e}function b(e,r,n){return"string"==typeof e?e=S(E(e,n),n):"object"===t(e)&&(e=S(e,n)),"string"==typeof r?r=S(E(r,n),n):"object"===t(r)&&(r=S(r,n)),e===r}function x(e,r){return e&&e.toString().replace(r&&r.iri?R.ESCAPE:F.ESCAPE,h)}function O(e,r){return e&&e.toString().replace(r&&r.iri?R.PCT_ENCODED:F.PCT_ENCODED,d)}function N(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}function I(e){var r=d(e);return r.match(he)?r:e}var F=u(!1),R=u(!0),T=function(){function e(e,r){var n=[],t=!0,o=!1,a=undefined;try{for(var i,u=e[Symbol.iterator]();!(t=(i=u.next()).done)&&(n.push(i.value),!r||n.length!==r);t=!0);}catch(s){o=!0,a=s}finally{try{!t&&u["return"]&&u["return"]()}finally{if(o)throw a}}return n}return function(r,n){if(Array.isArray(r))return r;if(Symbol.iterator in Object(r))return e(r,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),_=function(e){if(Array.isArray(e)){for(var r=0,n=Array(e.length);r<e.length;r++)n[r]=e[r];return n}return Array.from(e)},P=2147483647,q=/^xn--/,U=/[^\0-\x7E]/,j=/[\x2E\u3002\uFF0E\uFF61]/g,H={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},z=Math.floor,L=String.fromCharCode,$=function(e){return String.fromCodePoint.apply(String,_(e))},M=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:36},V=function(e,r){return e+22+75*(e<26)-((0!=r)<<5)},k=function(e,r,n){var t=0;for(e=n?z(e/700):e>>1,e+=z(e/r);e>455;t+=36)e=z(e/35);return z(t+36*e/(e+38))},Z=function(e){var r=[],n=e.length,t=0,o=128,a=72,i=e.lastIndexOf("-");i<0&&(i=0);for(var u=0;u<i;++u)e.charCodeAt(u)>=128&&s("not-basic"),r.push(e.charCodeAt(u));for(var f=i>0?i+1:0;f<n;){for(var c=t,p=1,h=36;;h+=36){f>=n&&s("invalid-input");var d=M(e.charCodeAt(f++));(d>=36||d>z((P-t)/p))&&s("overflow"),t+=d*p;var l=h<=a?1:h>=a+26?26:h-a;if(d<l)break;var m=36-l;p>z(P/m)&&s("overflow"),p*=m}var g=r.length+1;a=k(t-c,g,0==c),z(t/g)>P-o&&s("overflow"),o+=z(t/g),t%=g,r.splice(t++,0,o)}return String.fromCodePoint.apply(String,r)},G=function(e){var r=[];e=p(e);var n=e.length,t=128,o=0,a=72,i=!0,u=!1,f=undefined;try{for(var c,h=e[Symbol.iterator]();!(i=(c=h.next()).done);i=!0){var d=c.value;d<128&&r.push(L(d))}}catch(U){u=!0,f=U}finally{try{!i&&h["return"]&&h["return"]()}finally{if(u)throw f}}var l=r.length,m=l;for(l&&r.push("-");m<n;){var g=P,v=!0,E=!1,C=undefined;try{for(var y,S=e[Symbol.iterator]();!(v=(y=S.next()).done);v=!0){var A=y.value;A>=t&&A<g&&(g=A)}}catch(U){E=!0,C=U}finally{try{!v&&S["return"]&&S["return"]()}finally{if(E)throw C}}var D=m+1;g-t>z((P-o)/D)&&s("overflow"),o+=(g-t)*D,t=g;var w=!0,b=!1,x=undefined;try{for(var O,N=e[Symbol.iterator]();!(w=(O=N.next()).done);w=!0){var I=O.value;if(I<t&&++o>P&&s("overflow"),I==t){for(var F=o,R=36;;R+=36){var T=R<=a?1:R>=a+26?26:R-a;if(F<T)break;var _=F-T,q=36-T;r.push(L(V(T+_%q,0))),F=z(_/q)}r.push(L(V(F,0))),a=k(o,D,m==l),o=0,++m}}}catch(U){b=!0,x=U}finally{try{!w&&N["return"]&&N["return"]()}finally{if(b)throw x}}++o,++t}return r.join("")},Q=function(e){return c(e,function(e){return q.test(e)?Z(e.slice(4).toLowerCase()):e})},Y=function(e){return c(e,function(e){return U.test(e)?"xn--"+G(e):e})},B={version:"2.1.0",ucs2:{decode:p,encode:$},decode:Z,encode:G,toASCII:Y,toUnicode:Q},J={},K=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,W="".match(/(){0}/)[1]===undefined,X=/^\.\.?\//,ee=/^\/\.(\/|$)/,re=/^\/\.\.(\/|$)/,ne=/^\/?(?:.|\n)*?(?=\/|$)/,te={scheme:"http",domainHost:!0,parse:function(e,r){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,r){var n="https"===String(e.scheme).toLowerCase();return e.port!==(n?443:80)&&""!==e.port||(e.port=undefined),e.path||(e.path="/"),e}},oe={scheme:"https",domainHost:te.domainHost,parse:te.parse,serialize:te.serialize},ae={scheme:"ws",domainHost:!0,parse:function(e,r){var n=e;return n.secure=N(n),n.resourceName=(n.path||"/")+(n.query?"?"+n.query:""),n.path=undefined,n.query=undefined,n},serialize:function(e,r){if(e.port!==(N(e)?443:80)&&""!==e.port||(e.port=undefined),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=undefined),e.resourceName){var n=e.resourceName.split("?"),t=T(n,2),o=t[0],a=t[1];e.path=o&&"/"!==o?o:undefined,e.query=a,e.resourceName=undefined}return e.fragment=undefined,e}},ie={scheme:"wss",domainHost:ae.domainHost,parse:ae.parse,serialize:ae.serialize},ue={},se="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",fe="[0-9A-Fa-f]",ce=n(n("%[EFef][0-9A-Fa-f]%"+fe+fe+"%"+fe+fe)+"|"+n("%[89A-Fa-f][0-9A-Fa-f]%"+fe+fe)+"|"+n("%"+fe+fe)),pe=r("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),he=new RegExp(se,"g"),de=new RegExp(ce,"g"),le=new RegExp(r("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',pe),"g"),me=new RegExp(r("[^]",se,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g"),ge=me,ve={scheme:"mailto",parse:function(e,r){var n=e,t=n.to=n.path?n.path.split(","):[];if(n.path=undefined,n.query){for(var o=!1,a={},i=n.query.split("&"),u=0,s=i.length;u<s;++u){var f=i[u].split("=");switch(f[0]){case"to":for(var c=f[1].split(","),p=0,h=c.length;p<h;++p)t.push(c[p]);break;case"subject":n.subject=O(f[1],r);break;case"body":n.body=O(f[1],r);break;default:o=!0,a[O(f[0],r)]=O(f[1],r)}}o&&(n.headers=a)}n.query=undefined;for(var d=0,l=t.length;d<l;++d){var m=t[d].split("@");if(m[0]=O(m[0]),r.unicodeSupport)m[1]=O(m[1],r).toLowerCase();else try{m[1]=B.toASCII(O(m[1],r).toLowerCase())}catch(g){n.error=n.error||"Email address's domain name can not be converted to ASCII via punycode: "+g}t[d]=m.join("@")}return n},serialize:function(e,r){var n=e,t=a(e.to);if(t){for(var i=0,u=t.length;i<u;++i){var s=String(t[i]),f=s.lastIndexOf("@"),c=s.slice(0,f).replace(de,I).replace(de,o).replace(le,h),p=s.slice(f+1);try{p=r.iri?B.toUnicode(p):B.toASCII(O(p,r).toLowerCase())}catch(g){n.error=n.error||"Email address's domain name can not be converted to "+(r.iri?"Unicode":"ASCII")+" via punycode: "+g}t[i]=c+"@"+p}n.path=t.join(",")}var d=e.headers=e.headers||{};e.subject&&(d.subject=e.subject),e.body&&(d.body=e.body);var l=[];for(var m in d)d[m]!==ue[m]&&l.push(m.replace(de,I).replace(de,o).replace(me,h)+"="+d[m].replace(de,I).replace(de,o).replace(ge,h));return l.length&&(n.query=l.join("&")),n}},Ee=/^([^\:]+)\:(.*)/,Ce={scheme:"urn",parse:function(e,r){var n=e.path&&e.path.match(Ee),t=e;if(n){var o=r.scheme||t.scheme||"urn",a=n[1].toLowerCase(),i=n[2],u=o+":"+(r.nid||a),s=J[u];t.nid=a,t.nss=i,t.path=undefined,s&&(t=s.parse(t,r))}else t.error=t.error||"URN can not be parsed.";return t},serialize:function(e,r){var n=r.scheme||e.scheme||"urn",t=e.nid,o=n+":"+(r.nid||t),a=J[o];a&&(e=a.serialize(e,r));var i=e,u=e.nss;return i.path=(t||r.nid)+":"+u,i}},ye=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Se={scheme:"urn:uuid",parse:function(e,r){var n=e;return n.uuid=n.nss,n.nss=undefined,r.tolerant||n.uuid&&n.uuid.match(ye)||(n.error=n.error||"UUID is not valid."),n},serialize:function(e,r){var n=e;return n.nss=(e.uuid||"").toLowerCase(),n}};J[te.scheme]=te,J[oe.scheme]=oe,J[ae.scheme]=ae,J[ie.scheme]=ie,J[ve.scheme]=ve,J[Ce.scheme]=Ce,J[Se.scheme]=Se,e.SCHEMES=J,e.pctEncChar=h,e.pctDecChars=d,e.parse=E,e.removeDotSegments=y,e.serialize=S,e.resolveComponents=A,e.resolve=D,e.normalize=w,e.equal=b,e.escapeComponent=x,e.unescapeComponent=O,Object.defineProperty(e,"__esModule",{value:!0})});
//# sourceMappingURL=uri.all.min.js.mapZ(x   {"version":3,"sources":["../../src/util.ts","../../src/regexps-uri.ts","../../node_modules/punycode/punycode.es6.js","../../src/uri.ts","../../src/schemes/ws.ts","../../src/schemes/mailto.ts","../../src/regexps-iri.ts","../../src/schemes/http.ts","../../src/schemes/https.ts","../../src/schemes/wss.ts","../../src/schemes/urn.ts","../../src/schemes/urn-uuid.ts","../../src/index.ts"],"names":["merge","sets","Array","_len","_key","arguments","length","slice","xl","x","join","subexp","str","typeOf","o","undefined","Object","prototype","toString","call","split","pop","shift","toLowerCase","toUpperCase","toArray","obj","setInterval","assign","target","source","key","buildExps","isIRI","HEXDIG$$","PCT_ENCODED$","SUB_DELIMS$$","RESERVED$$","UCSCHAR$$","DEC_OCTET_RELAXED$","H16$","LS32$","IPV4ADDRESS$","IPV6ADDRESS1$","IPV6ADDRESS2$","IPV6ADDRESS3$","IPV6ADDRESS4$","IPV6ADDRESS5$","IPV6ADDRESS6$","IPV6ADDRESS7$","IPV6ADDRESS8$","IPV6ADDRESS9$","ZONEID$","UNRESERVED$$","RegExp","IPRIVATE$$","IPV6ADDRESS$","error","type","RangeError","errors","map","array","fn","result","mapDomain","string","parts","replace","regexSeparators","ucs2decode","output","counter","value","charCodeAt","extra","push","pctEncChar","chr","c","pctDecChars","newStr","i","il","parseInt","substr","String","fromCharCode","c2","c3","_normalizeComponentEncoding","components","protocol","decodeUnreserved","decStr","match","UNRESERVED","scheme","PCT_ENCODED","NOT_SCHEME","userinfo","NOT_USERINFO","host","NOT_HOST","path","NOT_PATH","NOT_PATH_NOSCHEME","query","NOT_QUERY","fragment","NOT_FRAGMENT","_stripLeadingZeros","_normalizeIPv4","matches","IPV4ADDRESS","address","_matches","_normalizeIPv6","IPV6ADDRESS","_matches2","zone","reverse","last","_address$toLowerCase$2","first","firstFields","lastFields","isLastFieldIPv4Address","test","fieldCount","lastFieldsStart","fields","allZeroFields","reduce","acc","field","index","lastLongest","longestZeroFields","sort","a","b","newHost","newFirst","newLast","parse","uriString","options","iri","IRI_PROTOCOL","URI_PROTOCOL","reference","URI_PARSE","NO_MATCH_IS_UNDEFINED","port","isNaN","indexOf","schemeHandler","SCHEMES","unicodeSupport","domainHost","punycode","toASCII","e","_recomposeAuthority","uriTokens","_","$1","$2","removeDotSegments","input","RDS1","RDS2","RDS3","im","RDS5","Error","s","serialize","toUnicode","authority","charAt","absolutePath","resolveComponents","base","relative","skipNormalization","tolerant","lastIndexOf","resolve","baseURI","relativeURI","schemelessOptions","normalize","uri","equal","uriA","uriB","escapeComponent","ESCAPE","unescapeComponent","isSecure","wsComponents","secure","maxInt","regexPunycode","regexNonASCII","floor","Math","stringFromCharCode","ucs2encode","fromCodePoint","apply","toConsumableArray","basicToDigit","codePoint","digitToBasic","digit","flag","adapt","delta","numPoints","firstTime","k","baseMinusTMin","decode","inputLength","n","bias","basic","j","oldi","w","t","baseMinusT","out","splice","encode","_step","Symbol","iterator","_iteratorNormalCompletion","_iterator","next","done","currentValue","basicLength","handledCPCount","m","_step2","_iteratorNormalCompletion2","_iterator2","handledCPCountPlusOne","_step3","_iteratorNormalCompletion3","_iterator3","q","qMinusT","handler","http","resourceName","_wsComponents$resourc2","ws","O","VCHAR$$","NOT_LOCAL_PART","NOT_HFNAME","NOT_HFVALUE","mailtoComponents","to","unknownHeaders","headers","hfields","hfield","toAddrs","subject","body","addr","toAddr","atIdx","localPart","domain","name","URN_PARSE","urnComponents","nid","nss","urnScheme","uriComponents","UUID","uuidComponents","uuid","https","wss","mailto","urn"],"mappings":";4LAAA,SAAAA,gCAAyBC,EAAzBC,MAAAC,GAAAC,EAAA,EAAAA,EAAAD,EAAAC,MAAAA,GAAAC,UAAAD,MACKH,EAAKK,OAAS,EAAG,GACf,GAAKL,EAAK,GAAGM,MAAM,GAAI,OAEvB,GADCC,GAAKP,EAAKK,OAAS,EAChBG,EAAI,EAAGA,EAAID,IAAMC,IACpBA,GAAKR,EAAKQ,GAAGF,MAAM,GAAI,YAExBC,GAAMP,EAAKO,GAAID,MAAM,GACnBN,EAAKS,KAAK,UAEVT,GAAK,GAId,QAAAU,GAAuBC,SACf,MAAQA,EAAM,IAGtB,QAAAC,GAAuBC,SACfA,KAAMC,UAAY,YAAqB,OAAND,EAAa,OAASE,OAAOC,UAAUC,SA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MnM,QAAUmM,GAExBtI,EACQwG,GAAGrK,QAAUqK,GAErBxG,EACQuI,GAAIpM,QAAUoM,GAEtBvI,EACQwI,GAAOrM,QAAUqM,GAEzBxI,EACQyI,GAAItM,QAAUsM,GAEtBzI,EACQqI,GAAKlM,QAAUkM","file":"dist/es5/uri.all.min.js","sourcesContent":["export function merge(...sets:Array<string>):string {\n\tif (sets.length > 1) {\n\t\tsets[0] = sets[0].slice(0, -1);\n\t\tconst xl = sets.length - 1;\n\t\tfor (let x = 1; x < xl; ++x) {\n\t\t\tsets[x] = sets[x].slice(1, -1);\n\t\t}\n\t\tsets[xl] = sets[xl].slice(1);\n\t\treturn sets.join('');\n\t} else {\n\t\treturn sets[0];\n\t}\n}\n\nexport function subexp(str:string):string {\n\treturn \"(?:\" + str + \")\";\n}\n\nexport function typeOf(o:any):string {\n\treturn o === undefined ? \"undefined\" : (o === null ? \"null\" : Object.prototype.toString.call(o).split(\" \").pop().split(\"]\").shift().toLowerCase());\n}\n\nexport function toUpperCase(str:string):string {\n\treturn str.toUpperCase();\n}\n\nexport function toArray(obj:any):Array<any> {\n\treturn obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== \"number\" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : [];\n}\n\n\nexport function assign(target: object, source: any): any {\n\tconst obj = target as any;\n\tif (source) {\n\t\tfor (const key in source) {\n\t\t\tobj[key] = source[key];\n\t\t}\n\t}\n\treturn obj;\n}","import { URIRegExps } from \"./uri\";\nimport { merge, subexp } from \"./util\";\n\nexport function buildExps(isIRI:boolean):URIRegExps {\n\tconst\n\t\tALPHA$$ = \"[A-Za-z]\",\n\t\tCR$ = \"[\\\\x0D]\",\n\t\tDIGIT$$ = \"[0-9]\",\n\t\tDQUOTE$$ = \"[\\\\x22]\",\n\t\tHEXDIG$$ = merge(DIGIT$$, \"[A-Fa-f]\"),  //case-insensitive\n\t\tLF$$ = \"[\\\\x0A]\",\n\t\tSP$$ = \"[\\\\x20]\",\n\t\tPCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$)),  //expanded\n\t\tGEN_DELIMS$$ = \"[\\\\:\\\\/\\\\?\\\\#\\\\[\\\\]\\\\@]\",\n\t\tSUB_DELIMS$$ = \"[\\\\!\\\\$\\\\&\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\=]\",\n\t\tRESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$),\n\t\tUCSCHAR$$ = isIRI ? \"[\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF]\" : \"[]\",  //subset, excludes bidi control characters\n\t\tIPRIVATE$$ = isIRI ? \"[\\\\uE000-\\\\uF8FF]\" : \"[]\",  //subset\n\t\tUNRESERVED$$ = merge(ALPHA$$, DIGIT$$, \"[\\\\-\\\\.\\\\_\\\\~]\", UCSCHAR$$),\n\t\tSCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\") + \"*\"),\n\t\tUSERINFO$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\")) + \"*\"),\n\t\tDEC_OCTET$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"[1-9]\" + DIGIT$$) + \"|\" + DIGIT$$),\n\t\tDEC_OCTET_RELAXED$ = subexp(subexp(\"25[0-5]\") + \"|\" + subexp(\"2[0-4]\" + DIGIT$$) + \"|\" + subexp(\"1\" + DIGIT$$ + DIGIT$$) + \"|\" + subexp(\"0?[1-9]\" + DIGIT$$) + \"|0?0?\" + DIGIT$$),  //relaxed parsing rules\n\t\tIPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$ + \"\\\\.\" + DEC_OCTET_RELAXED$),\n\t\tH16$ = subexp(HEXDIG$$ + \"{1,4}\"),\n\t\tLS32$ = subexp(subexp(H16$ + \"\\\\:\" + H16$) + \"|\" + IPV4ADDRESS$),\n\t\tIPV6ADDRESS1$ = subexp(                                                            subexp(H16$ + \"\\\\:\") + \"{6}\" + LS32$), //                           6( h16 \":\" ) ls32\n\t\tIPV6ADDRESS2$ = subexp(                                                 \"\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{5}\" + LS32$), //                      \"::\" 5( h16 \":\" ) ls32\n\t\tIPV6ADDRESS3$ = subexp(subexp(                                 H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{4}\" + LS32$), //[               h16 ] \"::\" 4( h16 \":\" ) ls32\n\t\tIPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,1}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{3}\" + LS32$), //[ *1( h16 \":\" ) h16 ] \"::\" 3( h16 \":\" ) ls32\n\t\tIPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,2}\" + H16$) + \"?\\\\:\\\\:\" + subexp(H16$ + \"\\\\:\") + \"{2}\" + LS32$), //[ *2( h16 \":\" ) h16 ] \"::\" 2( h16 \":\" ) ls32\n\t\tIPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,3}\" + H16$) + \"?\\\\:\\\\:\" +        H16$ + \"\\\\:\"          + LS32$), //[ *3( h16 \":\" ) h16 ] \"::\"    h16 \":\"   ls32\n\t\tIPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,4}\" + H16$) + \"?\\\\:\\\\:\"                                + LS32$), //[ *4( h16 \":\" ) h16 ] \"::\"              ls32\n\t\tIPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,5}\" + H16$) + \"?\\\\:\\\\:\"                                + H16$ ), //[ *5( h16 \":\" ) h16 ] \"::\"              h16\n\t\tIPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + \"\\\\:\") + \"{0,6}\" + H16$) + \"?\\\\:\\\\:\"                                       ), //[ *6( h16 \":\" ) h16 ] \"::\"\n\t\tIPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join(\"|\")),\n\t\tZONEID$ = subexp(subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$) + \"+\"),  //RFC 6874\n\t\tIPV6ADDRZ$ = subexp(IPV6ADDRESS$ + \"\\\\%25\" + ZONEID$),  //RFC 6874\n\t\tIPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + ZONEID$),  //RFC 6874, with relaxed parsing rules\n\t\tIPVFUTURE$ = subexp(\"[vV]\" + HEXDIG$$ + \"+\\\\.\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:]\") + \"+\"),\n\t\tIP_LITERAL$ = subexp(\"\\\\[\" + subexp(IPV6ADDRZ_RELAXED$ + \"|\" + IPV6ADDRESS$ + \"|\" + IPVFUTURE$) + \"\\\\]\"),  //RFC 6874\n\t\tREG_NAME$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$)) + \"*\"),\n\t\tHOST$ = subexp(IP_LITERAL$ + \"|\" + IPV4ADDRESS$ + \"(?!\" + REG_NAME$ + \")\" + \"|\" + REG_NAME$),\n\t\tPORT$ = subexp(DIGIT$$ + \"*\"),\n\t\tAUTHORITY$ = subexp(subexp(USERINFO$ + \"@\") + \"?\" + HOST$ + subexp(\"\\\\:\" + PORT$) + \"?\"),\n\t\tPCHAR$ = subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@]\")),\n\t\tSEGMENT$ = subexp(PCHAR$ + \"*\"),\n\t\tSEGMENT_NZ$ = subexp(PCHAR$ + \"+\"),\n\t\tSEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + \"|\" + merge(UNRESERVED$$, SUB_DELIMS$$, \"[\\\\@]\")) + \"+\"),\n\t\tPATH_ABEMPTY$ = subexp(subexp(\"\\\\/\" + SEGMENT$) + \"*\"),\n\t\tPATH_ABSOLUTE$ = subexp(\"\\\\/\" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + \"?\"),  //simplified\n\t\tPATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$),  //simplified\n\t\tPATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$),  //simplified\n\t\tPATH_EMPTY$ = \"(?!\" + PCHAR$ + \")\",\n\t\tPATH$ = subexp(PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tQUERY$ = subexp(subexp(PCHAR$ + \"|\" + merge(\"[\\\\/\\\\?]\", IPRIVATE$$)) + \"*\"),\n\t\tFRAGMENT$ = subexp(subexp(PCHAR$ + \"|[\\\\/\\\\?]\") + \"*\"),\n\t\tHIER_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$),\n\t\tURI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tRELATIVE_PART$ = subexp(subexp(\"\\\\/\\\\/\" + AUTHORITY$ + PATH_ABEMPTY$) + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$),\n\t\tRELATIVE$ = subexp(RELATIVE_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\" + subexp(\"\\\\#\" + FRAGMENT$) + \"?\"),\n\t\tURI_REFERENCE$ = subexp(URI$ + \"|\" + RELATIVE$),\n\t\tABSOLUTE_URI$ = subexp(SCHEME$ + \"\\\\:\" + HIER_PART$ + subexp(\"\\\\?\" + QUERY$) + \"?\"),\n\n\t\tGENERIC_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tRELATIVE_REF$ = \"^(){0}\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_NOSCHEME$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tABSOLUTE_REF$ = \"^(\" + SCHEME$ + \")\\\\:\" + subexp(subexp(\"\\\\/\\\\/(\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?)\") + \"?(\" + PATH_ABEMPTY$ + \"|\" + PATH_ABSOLUTE$ + \"|\" + PATH_ROOTLESS$ + \"|\" + PATH_EMPTY$ + \")\") + subexp(\"\\\\?(\" + QUERY$ + \")\") + \"?$\",\n\t\tSAMEDOC_REF$ = \"^\" + subexp(\"\\\\#(\" + FRAGMENT$ + \")\") + \"?$\",\n\t\tAUTHORITY_REF$ = \"^\" + subexp(\"(\" + USERINFO$ + \")@\") + \"?(\" + HOST$ + \")\" + subexp(\"\\\\:(\" + PORT$ + \")\") + \"?$\"\n\t;\n\n\treturn {\n\t\tNOT_SCHEME : new RegExp(merge(\"[^]\", ALPHA$$, DIGIT$$, \"[\\\\+\\\\-\\\\.]\"), \"g\"),\n\t\tNOT_USERINFO : new RegExp(merge(\"[^\\\\%\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_HOST : new RegExp(merge(\"[^\\\\%\\\\[\\\\]\\\\:]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH : new RegExp(merge(\"[^\\\\%\\\\/\\\\:\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_PATH_NOSCHEME : new RegExp(merge(\"[^\\\\%\\\\/\\\\@]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tNOT_QUERY : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\", IPRIVATE$$), \"g\"),\n\t\tNOT_FRAGMENT : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, SUB_DELIMS$$, \"[\\\\:\\\\@\\\\/\\\\?]\"), \"g\"),\n\t\tESCAPE : new RegExp(merge(\"[^]\", UNRESERVED$$, SUB_DELIMS$$), \"g\"),\n\t\tUNRESERVED : new RegExp(UNRESERVED$$, \"g\"),\n\t\tOTHER_CHARS : new RegExp(merge(\"[^\\\\%]\", UNRESERVED$$, RESERVED$$), \"g\"),\n\t\tPCT_ENCODED : new RegExp(PCT_ENCODED$, \"g\"),\n\t\tIPV4ADDRESS : new RegExp(\"^(\" + IPV4ADDRESS$ + \")$\"),\n\t\tIPV6ADDRESS : new RegExp(\"^\\\\[?(\" + IPV6ADDRESS$ + \")\" + subexp(subexp(\"\\\\%25|\\\\%(?!\" + HEXDIG$$ + \"{2})\") + \"(\" + ZONEID$ + \")\") + \"?\\\\]?$\")  //RFC 6874, with relaxed parsing rules\n\t};\n}\n\nexport default buildExps(false);\n","'use strict';\n\n/** Highest positive signed 32-bit float value */\nconst maxInt = 2147483647; // aka. 0x7FFFFFFF or 2^31-1\n\n/** Bootstring parameters */\nconst base = 36;\nconst tMin = 1;\nconst tMax = 26;\nconst skew = 38;\nconst damp = 700;\nconst initialBias = 72;\nconst initialN = 128; // 0x80\nconst delimiter = '-'; // '\\x2D'\n\n/** Regular expressions */\nconst regexPunycode = /^xn--/;\nconst regexNonASCII = /[^\\0-\\x7E]/; // non-ASCII chars\nconst regexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g; // RFC 3490 separators\n\n/** Error messages */\nconst errors = {\n\t'overflow': 'Overflow: input needs wider integers to process',\n\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t'invalid-input': 'Invalid input'\n};\n\n/** Convenience shortcuts */\nconst baseMinusTMin = base - tMin;\nconst floor = Math.floor;\nconst stringFromCharCode = String.fromCharCode;\n\n/*--------------------------------------------------------------------------*/\n\n/**\n * A generic error utility function.\n * @private\n * @param {String} type The error type.\n * @returns {Error} Throws a `RangeError` with the applicable error message.\n */\nfunction error(type) {\n\tthrow new RangeError(errors[type]);\n}\n\n/**\n * A generic `Array#map` utility function.\n * @private\n * @param {Array} array The array to iterate over.\n * @param {Function} callback The function that gets called for every array\n * item.\n * @returns {Array} A new array of values returned by the callback function.\n */\nfunction map(array, fn) {\n\tconst result = [];\n\tlet length = array.length;\n\twhile (length--) {\n\t\tresult[length] = fn(array[length]);\n\t}\n\treturn result;\n}\n\n/**\n * A simple `Array#map`-like wrapper to work with domain name strings or email\n * addresses.\n * @private\n * @param {String} domain The domain name or email address.\n * @param {Function} callback The function that gets called for every\n * character.\n * @returns {Array} A new string of characters returned by the callback\n * function.\n */\nfunction mapDomain(string, fn) {\n\tconst parts = string.split('@');\n\tlet result = '';\n\tif (parts.length > 1) {\n\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t// the local part (i.e. everything up to `@`) intact.\n\t\tresult = parts[0] + '@';\n\t\tstring = parts[1];\n\t}\n\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\tstring = string.replace(regexSeparators, '\\x2E');\n\tconst labels = string.split('.');\n\tconst encoded = map(labels, fn).join('.');\n\treturn result + encoded;\n}\n\n/**\n * Creates an array containing the numeric code points of each Unicode\n * character in the string. While JavaScript uses UCS-2 internally,\n * this function will convert a pair of surrogate halves (each of which\n * UCS-2 exposes as separate characters) into a single code point,\n * matching UTF-16.\n * @see `punycode.ucs2.encode`\n * @see <https://mathiasbynens.be/notes/javascript-encoding>\n * @memberOf punycode.ucs2\n * @name decode\n * @param {String} string The Unicode input string (UCS-2).\n * @returns {Array} The new array of code points.\n */\nfunction ucs2decode(string) {\n\tconst output = [];\n\tlet counter = 0;\n\tconst length = string.length;\n\twhile (counter < length) {\n\t\tconst value = string.charCodeAt(counter++);\n\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t// It's a high surrogate, and there is a next character.\n\t\t\tconst extra = string.charCodeAt(counter++);\n\t\t\tif ((extra & 0xFC00) == 0xDC00) { // Low surrogate.\n\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t} else {\n\t\t\t\t// It's an unmatched surrogate; only append this code unit, in case the\n\t\t\t\t// next code unit is the high surrogate of a surrogate pair.\n\t\t\t\toutput.push(value);\n\t\t\t\tcounter--;\n\t\t\t}\n\t\t} else {\n\t\t\toutput.push(value);\n\t\t}\n\t}\n\treturn output;\n}\n\n/**\n * Creates a string based on an array of numeric code points.\n * @see `punycode.ucs2.decode`\n * @memberOf punycode.ucs2\n * @name encode\n * @param {Array} codePoints The array of numeric code points.\n * @returns {String} The new Unicode string (UCS-2).\n */\nconst ucs2encode = array => String.fromCodePoint(...array);\n\n/**\n * Converts a basic code point into a digit/integer.\n * @see `digitToBasic()`\n * @private\n * @param {Number} codePoint The basic numeric code point value.\n * @returns {Number} The numeric value of a basic code point (for use in\n * representing integers) in the range `0` to `base - 1`, or `base` if\n * the code point does not represent a value.\n */\nconst basicToDigit = function(codePoint) {\n\tif (codePoint - 0x30 < 0x0A) {\n\t\treturn codePoint - 0x16;\n\t}\n\tif (codePoint - 0x41 < 0x1A) {\n\t\treturn codePoint - 0x41;\n\t}\n\tif (codePoint - 0x61 < 0x1A) {\n\t\treturn codePoint - 0x61;\n\t}\n\treturn base;\n};\n\n/**\n * Converts a digit/integer into a basic code point.\n * @see `basicToDigit()`\n * @private\n * @param {Number} digit The numeric value of a basic code point.\n * @returns {Number} The basic code point whose value (when used for\n * representing integers) is `digit`, which needs to be in the range\n * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n * used; else, the lowercase form is used. The behavior is undefined\n * if `flag` is non-zero and `digit` has no uppercase form.\n */\nconst digitToBasic = function(digit, flag) {\n\t//  0..25 map to ASCII a..z or A..Z\n\t// 26..35 map to ASCII 0..9\n\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n};\n\n/**\n * Bias adaptation function as per section 3.4 of RFC 3492.\n * https://tools.ietf.org/html/rfc3492#section-3.4\n * @private\n */\nconst adapt = function(delta, numPoints, firstTime) {\n\tlet k = 0;\n\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\tdelta += floor(delta / numPoints);\n\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\tdelta = floor(delta / baseMinusTMin);\n\t}\n\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n};\n\n/**\n * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n * symbols.\n * @memberOf punycode\n * @param {String} input The Punycode string of ASCII-only symbols.\n * @returns {String} The resulting string of Unicode symbols.\n */\nconst decode = function(input) {\n\t// Don't use UCS-2.\n\tconst output = [];\n\tconst inputLength = input.length;\n\tlet i = 0;\n\tlet n = initialN;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points: let `basic` be the number of input code\n\t// points before the last delimiter, or `0` if there is none, then copy\n\t// the first basic code points to the output.\n\n\tlet basic = input.lastIndexOf(delimiter);\n\tif (basic < 0) {\n\t\tbasic = 0;\n\t}\n\n\tfor (let j = 0; j < basic; ++j) {\n\t\t// if it's not a basic code point\n\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\terror('not-basic');\n\t\t}\n\t\toutput.push(input.charCodeAt(j));\n\t}\n\n\t// Main decoding loop: start just after the last delimiter if any basic code\n\t// points were copied; start at the beginning otherwise.\n\n\tfor (let index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t// `index` is the index of the next character to be consumed.\n\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t// which gets added to `i`. The overflow checking is easier\n\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t// value at the end to obtain `delta`.\n\t\tlet oldi = i;\n\t\tfor (let w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\tif (index >= inputLength) {\n\t\t\t\terror('invalid-input');\n\t\t\t}\n\n\t\t\tconst digit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\ti += digit * w;\n\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\tif (digit < t) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tconst baseMinusT = base - t;\n\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tw *= baseMinusT;\n\n\t\t}\n\n\t\tconst out = output.length + 1;\n\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t// incrementing `n` each time, so we'll fix that now:\n\t\tif (floor(i / out) > maxInt - n) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tn += floor(i / out);\n\t\ti %= out;\n\n\t\t// Insert `n` at position `i` of the output.\n\t\toutput.splice(i++, 0, n);\n\n\t}\n\n\treturn String.fromCodePoint(...output);\n};\n\n/**\n * Converts a string of Unicode symbols (e.g. a domain name label) to a\n * Punycode string of ASCII-only symbols.\n * @memberOf punycode\n * @param {String} input The string of Unicode symbols.\n * @returns {String} The resulting Punycode string of ASCII-only symbols.\n */\nconst encode = function(input) {\n\tconst output = [];\n\n\t// Convert the input in UCS-2 to an array of Unicode code points.\n\tinput = ucs2decode(input);\n\n\t// Cache the length.\n\tlet inputLength = input.length;\n\n\t// Initialize the state.\n\tlet n = initialN;\n\tlet delta = 0;\n\tlet bias = initialBias;\n\n\t// Handle the basic code points.\n\tfor (const currentValue of input) {\n\t\tif (currentValue < 0x80) {\n\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t}\n\t}\n\n\tlet basicLength = output.length;\n\tlet handledCPCount = basicLength;\n\n\t// `handledCPCount` is the number of code points that have been handled;\n\t// `basicLength` is the number of basic code points.\n\n\t// Finish the basic string with a delimiter unless it's empty.\n\tif (basicLength) {\n\t\toutput.push(delimiter);\n\t}\n\n\t// Main encoding loop:\n\twhile (handledCPCount < inputLength) {\n\n\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t// larger one:\n\t\tlet m = maxInt;\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\tm = currentValue;\n\t\t\t}\n\t\t}\n\n\t\t// Increase `delta` enough to advance the decoder's <n,i> state to <m,0>,\n\t\t// but guard against overflow.\n\t\tconst handledCPCountPlusOne = handledCPCount + 1;\n\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\terror('overflow');\n\t\t}\n\n\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\tn = m;\n\n\t\tfor (const currentValue of input) {\n\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\t\t\tif (currentValue == n) {\n\t\t\t\t// Represent delta as a generalized variable-length integer.\n\t\t\t\tlet q = delta;\n\t\t\t\tfor (let k = base; /* no condition */; k += base) {\n\t\t\t\t\tconst t = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconst qMinusT = q - t;\n\t\t\t\t\tconst baseMinusT = base - t;\n\t\t\t\t\toutput.push(\n\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t);\n\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t}\n\n\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\tdelta = 0;\n\t\t\t\t++handledCPCount;\n\t\t\t}\n\t\t}\n\n\t\t++delta;\n\t\t++n;\n\n\t}\n\treturn output.join('');\n};\n\n/**\n * Converts a Punycode string representing a domain name or an email address\n * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n * it doesn't matter if you call it on a string that has already been\n * converted to Unicode.\n * @memberOf punycode\n * @param {String} input The Punycoded domain name or email address to\n * convert to Unicode.\n * @returns {String} The Unicode representation of the given Punycode\n * string.\n */\nconst toUnicode = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexPunycode.test(string)\n\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t: string;\n\t});\n};\n\n/**\n * Converts a Unicode string representing a domain name or an email address to\n * Punycode. Only the non-ASCII parts of the domain name will be converted,\n * i.e. it doesn't matter if you call it with a domain that's already in\n * ASCII.\n * @memberOf punycode\n * @param {String} input The domain name or email address to convert, as a\n * Unicode string.\n * @returns {String} The Punycode representation of the given domain name or\n * email address.\n */\nconst toASCII = function(input) {\n\treturn mapDomain(input, function(string) {\n\t\treturn regexNonASCII.test(string)\n\t\t\t? 'xn--' + encode(string)\n\t\t\t: string;\n\t});\n};\n\n/*--------------------------------------------------------------------------*/\n\n/** Define the public API */\nconst punycode = {\n\t/**\n\t * A string representing the current Punycode.js version number.\n\t * @memberOf punycode\n\t * @type String\n\t */\n\t'version': '2.1.0',\n\t/**\n\t * An object of methods to convert from JavaScript's internal character\n\t * representation (UCS-2) to Unicode code points, and back.\n\t * @see <https://mathiasbynens.be/notes/javascript-encoding>\n\t * @memberOf punycode\n\t * @type Object\n\t */\n\t'ucs2': {\n\t\t'decode': ucs2decode,\n\t\t'encode': ucs2encode\n\t},\n\t'decode': decode,\n\t'encode': encode,\n\t'toASCII': toASCII,\n\t'toUnicode': toUnicode\n};\n\nexport default punycode;\n","/**\n * URI.js\n *\n * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.\n * @author <a href=\"mailto:gary.court@gmail.com\">Gary Court</a>\n * @see http://github.com/garycourt/uri-js\n */\n\n/**\n * Copyright 2011 Gary Court. All rights reserved.\n *\n * Redistribution and use in source and binary forms, with or without modification, are\n * permitted provided that the following conditions are met:\n *\n *    1. Redistributions of source code must retain the above copyright notice, this list of\n *       conditions and the following disclaimer.\n *\n *    2. Redistributions in binary form must reproduce the above copyright notice, this list\n *       of conditions and the following disclaimer in the documentation and/or other materials\n *       provided with the distribution.\n *\n * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED\n * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND\n * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR\n * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON\n * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING\n * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n *\n * The views and conclusions contained in the software and documentation are those of the\n * authors and should not be interpreted as representing official policies, either expressed\n * or implied, of Gary Court.\n */\n\nimport URI_PROTOCOL from \"./regexps-uri\";\nimport IRI_PROTOCOL from \"./regexps-iri\";\nimport punycode from \"punycode\";\nimport { toUpperCase, typeOf, assign } from \"./util\";\n\nexport interface URIComponents {\n\tscheme?:string;\n\tuserinfo?:string;\n\thost?:string;\n\tport?:number|string;\n\tpath?:string;\n\tquery?:string;\n\tfragment?:string;\n\treference?:string;\n\terror?:string;\n}\n\nexport interface URIOptions {\n\tscheme?:string;\n\treference?:string;\n\ttolerant?:boolean;\n\tabsolutePath?:boolean;\n\tiri?:boolean;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n}\n\nexport interface URISchemeHandler<Components extends URIComponents = URIComponents, Options extends URIOptions = URIOptions, ParentComponents extends URIComponents = URIComponents> {\n\tscheme:string;\n\tparse(components:ParentComponents, options:Options):Components;\n\tserialize(components:Components, options:Options):ParentComponents;\n\tunicodeSupport?:boolean;\n\tdomainHost?:boolean;\n\tabsolutePath?:boolean;\n}\n\nexport interface URIRegExps {\n\tNOT_SCHEME : RegExp,\n\tNOT_USERINFO : RegExp,\n\tNOT_HOST : RegExp,\n\tNOT_PATH : RegExp,\n\tNOT_PATH_NOSCHEME : RegExp,\n\tNOT_QUERY : RegExp,\n\tNOT_FRAGMENT : RegExp,\n\tESCAPE : RegExp,\n\tUNRESERVED : RegExp,\n\tOTHER_CHARS : RegExp,\n\tPCT_ENCODED : RegExp,\n\tIPV4ADDRESS : RegExp,\n\tIPV6ADDRESS : RegExp,\n}\n\nexport const SCHEMES:{[scheme:string]:URISchemeHandler} = {};\n\nexport function pctEncChar(chr:string):string {\n\tconst c = chr.charCodeAt(0);\n\tlet e:string;\n\n\tif (c < 16) e = \"%0\" + c.toString(16).toUpperCase();\n\telse if (c < 128) e = \"%\" + c.toString(16).toUpperCase();\n\telse if (c < 2048) e = \"%\" + ((c >> 6) | 192).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\telse e = \"%\" + ((c >> 12) | 224).toString(16).toUpperCase() + \"%\" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + \"%\" + ((c & 63) | 128).toString(16).toUpperCase();\n\n\treturn e;\n}\n\nexport function pctDecChars(str:string):string {\n\tlet newStr = \"\";\n\tlet i = 0;\n\tconst il = str.length;\n\n\twhile (i < il) {\n\t\tconst c = parseInt(str.substr(i + 1, 2), 16);\n\n\t\tif (c < 128) {\n\t\t\tnewStr += String.fromCharCode(c);\n\t\t\ti += 3;\n\t\t}\n\t\telse if (c >= 194 && c < 224) {\n\t\t\tif ((il - i) >= 6) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 6);\n\t\t\t}\n\t\t\ti += 6;\n\t\t}\n\t\telse if (c >= 224) {\n\t\t\tif ((il - i) >= 9) {\n\t\t\t\tconst c2 = parseInt(str.substr(i + 4, 2), 16);\n\t\t\t\tconst c3 = parseInt(str.substr(i + 7, 2), 16);\n\t\t\t\tnewStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));\n\t\t\t} else {\n\t\t\t\tnewStr += str.substr(i, 9);\n\t\t\t}\n\t\t\ti += 9;\n\t\t}\n\t\telse {\n\t\t\tnewStr += str.substr(i, 3);\n\t\t\ti += 3;\n\t\t}\n\t}\n\n\treturn newStr;\n}\n\nfunction _normalizeComponentEncoding(components:URIComponents, protocol:URIRegExps) {\n\tfunction decodeUnreserved(str:string):string {\n\t\tconst decStr = pctDecChars(str);\n\t\treturn (!decStr.match(protocol.UNRESERVED) ? str : decStr);\n\t}\n\n\tif (components.scheme) components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, \"\");\n\tif (components.userinfo !== undefined) components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.host !== undefined) components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.path !== undefined) components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.query !== undefined) components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\tif (components.fragment !== undefined) components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);\n\n\treturn components;\n};\n\nfunction _stripLeadingZeros(str:string):string {\n\treturn str.replace(/^0*(.*)/, \"$1\") || \"0\";\n}\n\nfunction _normalizeIPv4(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV4ADDRESS) || [];\n\tconst [, address] = matches;\n\t\n\tif (address) {\n\t\treturn address.split(\".\").map(_stripLeadingZeros).join(\".\");\n\t} else {\n\t\treturn host;\n\t}\n}\n\nfunction _normalizeIPv6(host:string, protocol:URIRegExps):string {\n\tconst matches = host.match(protocol.IPV6ADDRESS) || [];\n\tconst [, address, zone] = matches;\n\n\tif (address) {\n\t\tconst [last, first] = address.toLowerCase().split('::').reverse();\n\t\tconst firstFields = first ? first.split(\":\").map(_stripLeadingZeros) : [];\n\t\tconst lastFields = last.split(\":\").map(_stripLeadingZeros);\n\t\tconst isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);\n\t\tconst fieldCount = isLastFieldIPv4Address ? 7 : 8;\n\t\tconst lastFieldsStart = lastFields.length - fieldCount;\n\t\tconst fields = Array<string>(fieldCount);\n\n\t\tfor (let x = 0; x < fieldCount; ++x) {\n\t\t\tfields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';\n\t\t}\n\n\t\tif (isLastFieldIPv4Address) {\n\t\t\tfields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);\n\t\t}\n\n\t\tconst allZeroFields = fields.reduce<Array<{index:number,length:number}>>((acc, field, index) => {\n\t\t\tif (!field || field === \"0\") {\n\t\t\t\tconst lastLongest = acc[acc.length - 1];\n\t\t\t\tif (lastLongest && lastLongest.index + lastLongest.length === index) {\n\t\t\t\t\tlastLongest.length++;\n\t\t\t\t} else {\n\t\t\t\t\tacc.push({ index, length : 1 });\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, []);\n\n\t\tconst longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0];\n\n\t\tlet newHost:string;\n\t\tif (longestZeroFields && longestZeroFields.length > 1) {\n\t\t\tconst newFirst = fields.slice(0, longestZeroFields.index) ;\n\t\t\tconst newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);\n\t\t\tnewHost = newFirst.join(\":\") + \"::\" + newLast.join(\":\");\n\t\t} else {\n\t\t\tnewHost = fields.join(\":\");\n\t\t}\n\n\t\tif (zone) {\n\t\t\tnewHost += \"%\" + zone;\n\t\t}\n\n\t\treturn newHost;\n\t} else {\n\t\treturn host;\n\t}\n}\n\nconst URI_PARSE = /^(?:([^:\\/?#]+):)?(?:\\/\\/((?:([^\\/?#@]*)@)?(\\[[^\\/?#\\]]+\\]|[^\\/?#:]*)(?:\\:(\\d*))?))?([^?#]*)(?:\\?([^#]*))?(?:#((?:.|\\n|\\r)*))?/i;\nconst NO_MATCH_IS_UNDEFINED = (<RegExpMatchArray>(\"\").match(/(){0}/))[1] === undefined;\n\nexport function parse(uriString:string, options:URIOptions = {}):URIComponents {\n\tconst components:URIComponents = {};\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\n\tif (options.reference === \"suffix\") uriString = (options.scheme ? options.scheme + \":\" : \"\") + \"//\" + uriString;\n\n\tconst matches = uriString.match(URI_PARSE);\n\n\tif (matches) {\n\t\tif (NO_MATCH_IS_UNDEFINED) {\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1];\n\t\t\tcomponents.userinfo = matches[3];\n\t\t\tcomponents.host = matches[4];\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = matches[7];\n\t\t\tcomponents.fragment = matches[8];\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = matches[5];\n\t\t\t}\n\t\t} else {  //IE FIX for improper RegExp matching\n\t\t\t//store each component\n\t\t\tcomponents.scheme = matches[1] || undefined;\n\t\t\tcomponents.userinfo = (uriString.indexOf(\"@\") !== -1 ? matches[3] : undefined);\n\t\t\tcomponents.host = (uriString.indexOf(\"//\") !== -1 ? matches[4] : undefined);\n\t\t\tcomponents.port = parseInt(matches[5], 10);\n\t\t\tcomponents.path = matches[6] || \"\";\n\t\t\tcomponents.query = (uriString.indexOf(\"?\") !== -1 ? matches[7] : undefined);\n\t\t\tcomponents.fragment = (uriString.indexOf(\"#\") !== -1 ? matches[8] : undefined);\n\n\t\t\t//fix port number\n\t\t\tif (isNaN(components.port)) {\n\t\t\t\tcomponents.port = (uriString.match(/\\/\\/(?:.|\\n)*\\:(?:\\/|\\?|\\#|$)/) ? matches[4] : undefined);\n\t\t\t}\n\t\t}\n\n\t\tif (components.host) {\n\t\t\t//normalize IP hosts\n\t\t\tcomponents.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);\n\t\t}\n\n\t\t//determine reference type\n\t\tif (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {\n\t\t\tcomponents.reference = \"same-document\";\n\t\t} else if (components.scheme === undefined) {\n\t\t\tcomponents.reference = \"relative\";\n\t\t} else if (components.fragment === undefined) {\n\t\t\tcomponents.reference = \"absolute\";\n\t\t} else {\n\t\t\tcomponents.reference = \"uri\";\n\t\t}\n\n\t\t//check for reference errors\n\t\tif (options.reference && options.reference !== \"suffix\" && options.reference !== components.reference) {\n\t\t\tcomponents.error = components.error || \"URI is not a \" + options.reference + \" reference.\";\n\t\t}\n\n\t\t//find scheme handler\n\t\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t\t//check if scheme can't handle IRIs\n\t\tif (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {\n\t\t\t//if host component is a domain name\n\t\t\tif (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\tcomponents.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t}\n\t\t\t//convert IRI -> URI\n\t\t\t_normalizeComponentEncoding(components, URI_PROTOCOL);\n\t\t} else {\n\t\t\t//normalize encodings\n\t\t\t_normalizeComponentEncoding(components, protocol);\n\t\t}\n\n\t\t//perform scheme specific parsing\n\t\tif (schemeHandler && schemeHandler.parse) {\n\t\t\tschemeHandler.parse(components, options);\n\t\t}\n\t} else {\n\t\tcomponents.error = components.error || \"URI can not be parsed.\";\n\t}\n\n\treturn components;\n};\n\nfunction _recomposeAuthority(components:URIComponents, options:URIOptions):string|undefined {\n\tconst protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array<string> = [];\n\n\tif (components.userinfo !== undefined) {\n\t\turiTokens.push(components.userinfo);\n\t\turiTokens.push(\"@\");\n\t}\n\n\tif (components.host !== undefined) {\n\t\t//normalize IP hosts, add brackets and escape zone separator for IPv6\n\t\turiTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => \"[\" + $1 + ($2 ? \"%25\" + $2 : \"\") + \"]\"));\n\t}\n\n\tif (typeof components.port === \"number\" || typeof components.port === \"string\") {\n\t\turiTokens.push(\":\");\n\t\turiTokens.push(String(components.port));\n\t}\n\n\treturn uriTokens.length ? uriTokens.join(\"\") : undefined;\n};\n\nconst RDS1 = /^\\.\\.?\\//;\nconst RDS2 = /^\\/\\.(\\/|$)/;\nconst RDS3 = /^\\/\\.\\.(\\/|$)/;\nconst RDS4 = /^\\.\\.?$/;\nconst RDS5 = /^\\/?(?:.|\\n)*?(?=\\/|$)/;\n\nexport function removeDotSegments(input:string):string {\n\tconst output:Array<string> = [];\n\n\twhile (input.length) {\n\t\tif (input.match(RDS1)) {\n\t\t\tinput = input.replace(RDS1, \"\");\n\t\t} else if (input.match(RDS2)) {\n\t\t\tinput = input.replace(RDS2, \"/\");\n\t\t} else if (input.match(RDS3)) {\n\t\t\tinput = input.replace(RDS3, \"/\");\n\t\t\toutput.pop();\n\t\t} else if (input === \".\" || input === \"..\") {\n\t\t\tinput = \"\";\n\t\t} else {\n\t\t\tconst im = input.match(RDS5);\n\t\t\tif (im) {\n\t\t\t\tconst s = im[0];\n\t\t\t\tinput = input.slice(s.length);\n\t\t\t\toutput.push(s);\n\t\t\t} else {\n\t\t\t\tthrow new Error(\"Unexpected dot segment condition\");\n\t\t\t}\n\t\t}\n\t}\n\n\treturn output.join(\"\");\n};\n\nexport function serialize(components:URIComponents, options:URIOptions = {}):string {\n\tconst protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL);\n\tconst uriTokens:Array<string> = [];\n\n\t//find scheme handler\n\tconst schemeHandler = SCHEMES[(options.scheme || components.scheme || \"\").toLowerCase()];\n\n\t//perform scheme specific serialization\n\tif (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(components, options);\n\n\tif (components.host) {\n\t\t//if host component is an IPv6 address\n\t\tif (protocol.IPV6ADDRESS.test(components.host)) {\n\t\t\t//TODO: normalize IPv6 address as per RFC 5952\n\t\t}\n\n\t\t//if host component is a domain name\n\t\telse if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) {\n\t\t\t//convert IDN via punycode\n\t\t\ttry {\n\t\t\t\tcomponents.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host));\n\t\t\t} catch (e) {\n\t\t\t\tcomponents.error = components.error || \"Host's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t}\n\t\t}\n\t}\n\n\t//normalize encoding\n\t_normalizeComponentEncoding(components, protocol);\n\n\tif (options.reference !== \"suffix\" && components.scheme) {\n\t\turiTokens.push(components.scheme);\n\t\turiTokens.push(\":\");\n\t}\n\n\tconst authority = _recomposeAuthority(components, options);\n\tif (authority !== undefined) {\n\t\tif (options.reference !== \"suffix\") {\n\t\t\turiTokens.push(\"//\");\n\t\t}\n\n\t\turiTokens.push(authority);\n\n\t\tif (components.path && components.path.charAt(0) !== \"/\") {\n\t\t\turiTokens.push(\"/\");\n\t\t}\n\t}\n\n\tif (components.path !== undefined) {\n\t\tlet s = components.path;\n\n\t\tif (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {\n\t\t\ts = removeDotSegments(s);\n\t\t}\n\n\t\tif (authority === undefined) {\n\t\t\ts = s.replace(/^\\/\\//, \"/%2F\");  //don't allow the path to start with \"//\"\n\t\t}\n\n\t\turiTokens.push(s);\n\t}\n\n\tif (components.query !== undefined) {\n\t\turiTokens.push(\"?\");\n\t\turiTokens.push(components.query);\n\t}\n\n\tif (components.fragment !== undefined) {\n\t\turiTokens.push(\"#\");\n\t\turiTokens.push(components.fragment);\n\t}\n\n\treturn uriTokens.join(\"\");  //merge tokens into a string\n};\n\nexport function resolveComponents(base:URIComponents, relative:URIComponents, options:URIOptions = {}, skipNormalization?:boolean):URIComponents {\n\tconst target:URIComponents = {};\n\n\tif (!skipNormalization) {\n\t\tbase = parse(serialize(base, options), options);  //normalize base components\n\t\trelative = parse(serialize(relative, options), options);  //normalize relative components\n\t}\n\toptions = options || {};\n\n\tif (!options.tolerant && relative.scheme) {\n\t\ttarget.scheme = relative.scheme;\n\t\t//target.authority = relative.authority;\n\t\ttarget.userinfo = relative.userinfo;\n\t\ttarget.host = relative.host;\n\t\ttarget.port = relative.port;\n\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\ttarget.query = relative.query;\n\t} else {\n\t\tif (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {\n\t\t\t//target.authority = relative.authority;\n\t\t\ttarget.userinfo = relative.userinfo;\n\t\t\ttarget.host = relative.host;\n\t\t\ttarget.port = relative.port;\n\t\t\ttarget.path = removeDotSegments(relative.path || \"\");\n\t\t\ttarget.query = relative.query;\n\t\t} else {\n\t\t\tif (!relative.path) {\n\t\t\t\ttarget.path = base.path;\n\t\t\t\tif (relative.query !== undefined) {\n\t\t\t\t\ttarget.query = relative.query;\n\t\t\t\t} else {\n\t\t\t\t\ttarget.query = base.query;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif (relative.path.charAt(0) === \"/\") {\n\t\t\t\t\ttarget.path = removeDotSegments(relative.path);\n\t\t\t\t} else {\n\t\t\t\t\tif ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {\n\t\t\t\t\t\ttarget.path = \"/\" + relative.path;\n\t\t\t\t\t} else if (!base.path) {\n\t\t\t\t\t\ttarget.path = relative.path;\n\t\t\t\t\t} else {\n\t\t\t\t\t\ttarget.path = base.path.slice(0, base.path.lastIndexOf(\"/\") + 1) + relative.path;\n\t\t\t\t\t}\n\t\t\t\t\ttarget.path = removeDotSegments(target.path);\n\t\t\t\t}\n\t\t\t\ttarget.query = relative.query;\n\t\t\t}\n\t\t\t//target.authority = base.authority;\n\t\t\ttarget.userinfo = base.userinfo;\n\t\t\ttarget.host = base.host;\n\t\t\ttarget.port = base.port;\n\t\t}\n\t\ttarget.scheme = base.scheme;\n\t}\n\n\ttarget.fragment = relative.fragment;\n\n\treturn target;\n};\n\nexport function resolve(baseURI:string, relativeURI:string, options?:URIOptions):string {\n\tconst schemelessOptions = assign({ scheme : 'null' }, options);\n\treturn serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);\n};\n\nexport function normalize(uri:string, options?:URIOptions):string;\nDsexport function normalize(uri:URIComponents, options?:URIOptions):URIComponents;\nexport function normalize(uri:any, options?:URIOptions):any {\n\tif (typeof uri === \"string\") {\n\t\turi = serialize(parse(uri, options), options);\n\t} else if (typeOf(uri) === \"object\") {\n\t\turi = parse(serialize(<URIComponents>uri, options), options);\n\t}\n\n\treturn uri;\n};\n\nexport function equal(uriA:string, uriB:string, options?: URIOptions):boolean;\nexport function equal(uriA:URIComponents, uriB:URIComponents, options?:URIOptions):boolean;\nexport function equal(uriA:any, uriB:any, options?:URIOptions):boolean {\n\tif (typeof uriA === \"string\") {\n\t\turiA = serialize(parse(uriA, options), options);\n\t} else if (typeOf(uriA) === \"object\") {\n\t\turiA = serialize(<URIComponents>uriA, options);\n\t}\n\n\tif (typeof uriB === \"string\") {\n\t\turiB = serialize(parse(uriB, options), options);\n\t} else if (typeOf(uriB) === \"object\") {\n\t\turiB = serialize(<URIComponents>uriB, options);\n\t}\n\n\treturn uriA === uriB;\n};\n\nexport function escapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar);\n};\n\nexport function unescapeComponent(str:string, options?:URIOptions):string {\n\treturn str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars);\n};\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nexport interface WSComponents extends URIComponents {\n\tresourceName?: string;\n\tsecure?: boolean;\n}\n\nfunction isSecure(wsComponents:WSComponents):boolean {\n\treturn typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === \"wss\";\n}\n\n//RFC 6455\nconst handler:URISchemeHandler = {\n\tscheme : \"ws\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):WSComponents {\n\t\tconst wsComponents = components as WSComponents;\n\n\t\t//indicate if the secure flag is set\n\t\twsComponents.secure = isSecure(wsComponents);\n\n\t\t//construct resouce name\n\t\twsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');\n\t\twsComponents.path = undefined;\n\t\twsComponents.query = undefined;\n\n\t\treturn wsComponents;\n\t},\n\n\tserialize : function (wsComponents:WSComponents, options:URIOptions):URIComponents {\n\t\t//normalize the default port\n\t\tif (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === \"\") {\n\t\t\twsComponents.port = undefined;\n\t\t}\n\n\t\t//ensure scheme matches secure flag\n\t\tif (typeof wsComponents.secure === 'boolean') {\n\t\t\twsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws');\n\t\t\twsComponents.secure = undefined;\n\t\t}\n\n\t\t//reconstruct path from resource name\n\t\tif (wsComponents.resourceName) {\n\t\t\tconst [path, query] = wsComponents.resourceName.split('?');\n\t\t\twsComponents.path = (path && path !== '/' ? path : undefined);\n\t\t\twsComponents.query = query;\n\t\t\twsComponents.resourceName = undefined;\n\t\t}\n\n\t\t//forbid fragment component\n\t\twsComponents.fragment = undefined;\n\n\t\treturn wsComponents;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, pctDecChars, unescapeComponent } from \"../uri\";\nimport punycode from \"punycode\";\nimport { merge, subexp, toUpperCase, toArray } from \"../util\";\n\nexport interface MailtoHeaders {\n\t[hfname:string]:string\n}\n\nexport interface MailtoComponents extends URIComponents {\n\tto:Array<string>,\n\theaders?:MailtoHeaders,\n\tsubject?:string,\n\tbody?:string\n}\n\nconst O:MailtoHeaders = {};\nconst isIRI = true;\n\n//RFC 3986\nconst UNRESERVED$$ = \"[A-Za-z0-9\\\\-\\\\.\\\\_\\\\~\" + (isIRI ? \"\\\\xA0-\\\\u200D\\\\u2010-\\\\u2029\\\\u202F-\\\\uD7FF\\\\uF900-\\\\uFDCF\\\\uFDF0-\\\\uFFEF\" : \"\") + \"]\";\nconst HEXDIG$$ = \"[0-9A-Fa-f]\";  //case-insensitive\nconst PCT_ENCODED$ = subexp(subexp(\"%[EFef]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%[89A-Fa-f]\" + HEXDIG$$ + \"%\" + HEXDIG$$ + HEXDIG$$) + \"|\" + subexp(\"%\" + HEXDIG$$ + HEXDIG$$));  //expanded\n\n//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =\n//const ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\#\\\\$\\\\%\\\\&\\\\'\\\\*\\\\+\\\\-\\\\/\\\\=\\\\?\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QTEXT$$ = \"[\\\\x01-\\\\x08\\\\x0B\\\\x0C\\\\x0E-\\\\x1F\\\\x7F]\";  //(%d1-8 / %d11-12 / %d14-31 / %d127)\n//const QTEXT$$ = merge(\"[\\\\x21\\\\x23-\\\\x5B\\\\x5D-\\\\x7E]\", OBS_QTEXT$$);  //%d33 / %d35-91 / %d93-126 / obs-qtext\n//const VCHAR$$ = \"[\\\\x21-\\\\x7E]\";\n//const WSP$$ = \"[\\\\x20\\\\x09]\";\n//const OBS_QP$ = subexp(\"\\\\\\\\\" + merge(\"[\\\\x00\\\\x0D\\\\x0A]\", OBS_QTEXT$$));  //%d0 / CR / LF / obs-qtext\n//const FWS$ = subexp(subexp(WSP$$ + \"*\" + \"\\\\x0D\\\\x0A\") + \"?\" + WSP$$ + \"+\");\n//const QUOTED_PAIR$ = subexp(subexp(\"\\\\\\\\\" + subexp(VCHAR$$ + \"|\" + WSP$$)) + \"|\" + OBS_QP$);\n//const QUOTED_STRING$ = subexp('\\\\\"' + subexp(FWS$ + \"?\" + QCONTENT$) + \"*\" + FWS$ + \"?\" + '\\\\\"');\nconst ATEXT$$ = \"[A-Za-z0-9\\\\!\\\\$\\\\%\\\\'\\\\*\\\\+\\\\-\\\\^\\\\_\\\\`\\\\{\\\\|\\\\}\\\\~]\";\nconst QTEXT$$ = \"[\\\\!\\\\$\\\\%\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\-\\\\.0-9\\\\<\\\\>A-Z\\\\x5E-\\\\x7E]\";\nconst VCHAR$$ = merge(QTEXT$$, \"[\\\\\\\"\\\\\\\\]\");\nconst DOT_ATOM_TEXT$ = subexp(ATEXT$$ + \"+\" + subexp(\"\\\\.\" + ATEXT$$ + \"+\") + \"*\");\nconst QUOTED_PAIR$ = subexp(\"\\\\\\\\\" + VCHAR$$);\nconst QCONTENT$ = subexp(QTEXT$$ + \"|\" + QUOTED_PAIR$);\nconst QUOTED_STRING$ = subexp('\\\\\"' + QCONTENT$ + \"*\" + '\\\\\"');\n\n//RFC 6068\nconst DTEXT_NO_OBS$$ = \"[\\\\x21-\\\\x5A\\\\x5E-\\\\x7E]\";  //%d33-90 / %d94-126\nconst SOME_DELIMS$$ = \"[\\\\!\\\\$\\\\'\\\\(\\\\)\\\\*\\\\+\\\\,\\\\;\\\\:\\\\@]\";\nconst QCHAR$ = subexp(UNRESERVED$$ + \"|\" + PCT_ENCODED$ + \"|\" + SOME_DELIMS$$);\nconst DOMAIN$ = subexp(DOT_ATOM_TEXT$ + \"|\" + \"\\\\[\" + DTEXT_NO_OBS$$ + \"*\" + \"\\\\]\");\nconst LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + \"|\" + QUOTED_STRING$);\nconst ADDR_SPEC$ = subexp(LOCAL_PART$ + \"\\\\@\" + DOMAIN$);\nconst TO$ = subexp(ADDR_SPEC$ + subexp(\"\\\\,\" + ADDR_SPEC$) + \"*\");\nconst HFNAME$ = subexp(QCHAR$ + \"*\");\nconst HFVALUE$ = HFNAME$;\nconst HFIELD$ = subexp(HFNAME$ + \"\\\\=\" + HFVALUE$);\nconst HFIELDS2$ = subexp(HFIELD$ + subexp(\"\\\\&\" + HFIELD$) + \"*\");\nconst HFIELDS$ = subexp(\"\\\\?\" + HFIELDS2$);\nconst MAILTO_URI = new RegExp(\"^mailto\\\\:\" + TO$ + \"?\" + HFIELDS$ + \"?$\");\n\nconst UNRESERVED = new RegExp(UNRESERVED$$, \"g\");\nconst PCT_ENCODED = new RegExp(PCT_ENCODED$, \"g\");\nconst NOT_LOCAL_PART = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", '[\\\\\"]', VCHAR$$), \"g\");\nconst NOT_DOMAIN = new RegExp(merge(\"[^]\", ATEXT$$, \"[\\\\.]\", \"[\\\\[]\", DTEXT_NO_OBS$$, \"[\\\\]]\"), \"g\");\nconst NOT_HFNAME = new RegExp(merge(\"[^]\", UNRESERVED$$, SOME_DELIMS$$), \"g\");\nconst NOT_HFVALUE = NOT_HFNAME;\nconst TO = new RegExp(\"^\" + TO$ + \"$\");\nconst HFIELDS = new RegExp(\"^\" + HFIELDS2$ + \"$\");\n\nfunction decodeUnreserved(str:string):string {\n\tconst decStr = pctDecChars(str);\n\treturn (!decStr.match(UNRESERVED) ? str : decStr);\n}\n\nconst handler:URISchemeHandler<MailtoComponents> =  {\n\tscheme : \"mailto\",\n\n\tparse : function (components:URIComponents, options:URIOptions):MailtoComponents {\n\t\tconst mailtoComponents = components as MailtoComponents;\n\t\tconst to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(\",\") : []);\n\t\tmailtoComponents.path = undefined;\n\n\t\tif (mailtoComponents.query) {\n\t\t\tlet unknownHeaders = false\n\t\t\tconst headers:MailtoHeaders = {};\n\t\t\tconst hfields = mailtoComponents.query.split(\"&\");\n\n\t\t\tfor (let x = 0, xl = hfields.length; x < xl; ++x) {\n\t\t\t\tconst hfield = hfields[x].split(\"=\");\n\n\t\t\t\tswitch (hfield[0]) {\n\t\t\t\t\tcase \"to\":\n\t\t\t\t\t\tconst toAddrs = hfield[1].split(\",\");\n\t\t\t\t\t\tfor (let x = 0, xl = toAddrs.length; x < xl; ++x) {\n\t\t\t\t\t\t\tto.push(toAddrs[x]);\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"subject\":\n\t\t\t\t\t\tmailtoComponents.subject = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"body\":\n\t\t\t\t\t\tmailtoComponents.body = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tunknownHeaders = true;\n\t\t\t\t\t\theaders[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif (unknownHeaders) mailtoComponents.headers = headers;\n\t\t}\n\n\t\tmailtoComponents.query = undefined;\n\n\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\tconst addr = to[x].split(\"@\");\n\n\t\t\taddr[0] = unescapeComponent(addr[0]);\n\n\t\t\tif (!options.unicodeSupport) {\n\t\t\t\t//convert Unicode IDN -> ASCII IDN\n\t\t\t\ttry {\n\t\t\t\t\taddr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());\n\t\t\t\t} catch (e) {\n\t\t\t\t\tmailtoComponents.error = mailtoComponents.error || \"Email address's domain name can not be converted to ASCII via punycode: \" + e;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\taddr[1] = unescapeComponent(addr[1], options).toLowerCase();\n\t\t\t}\n\n\t\t\tto[x] = addr.join(\"@\");\n\t\t}\n\n\t\treturn mailtoComponents;\n\t},\n\n\tserialize : function (mailtoComponents:MailtoComponents, options:URIOptions):URIComponents {\n\t\tconst components = mailtoComponents as URIComponents;\n\t\tconst to = toArray(mailtoComponents.to);\n\t\tif (to) {\n\t\t\tfor (let x = 0, xl = to.length; x < xl; ++x) {\n\t\t\t\tconst toAddr = String(to[x]);\n\t\t\t\tconst atIdx = toAddr.lastIndexOf(\"@\");\n\t\t\t\tconst localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);\n\t\t\t\tlet domain = toAddr.slice(atIdx + 1);\n\n\t\t\t\t//convert IDN via punycode\n\t\t\t\ttry {\n\t\t\t\t\tdomain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain));\n\t\t\t\t} catch (e) {\n\t\t\t\t\tcomponents.error = components.error || \"Email address's domain name can not be converted to \" + (!options.iri ? \"ASCII\" : \"Unicode\") + \" via punycode: \" + e;\n\t\t\t\t}\n\n\t\t\t\tto[x] = localPart + \"@\" + domain;\n\t\t\t}\n\n\t\t\tcomponents.path = to.join(\",\");\n\t\t}\n\n\t\tconst headers = mailtoComponents.headers = mailtoComponents.headers || {};\n\n\t\tif (mailtoComponents.subject) headers[\"subject\"] = mailtoComponents.subject;\n\t\tif (mailtoComponents.body) headers[\"body\"] = mailtoComponents.body;\n\n\t\tconst fields = [];\n\t\tfor (const name in headers) {\n\t\t\tif (headers[name] !== O[name]) {\n\t\t\t\tfields.push(\n\t\t\t\t\tname.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) +\n\t\t\t\t\t\"=\" +\n\t\t\t\t\theaders[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar)\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t\tif (fields.length) {\n\t\t\tcomponents.query = fields.join(\"&\");\n\t\t}\n\n\t\treturn components;\n\t}\n}\n\nexport default handler;","import { URIRegExps } from \"./uri\";\nimport { buildExps } from \"./regexps-uri\";\n\nexport default buildExps(true);\n","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"http\",\n\n\tdomainHost : true,\n\n\tparse : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\t//report missing host\n\t\tif (!components.host) {\n\t\t\tcomponents.error = components.error || \"HTTP URIs must have a host.\";\n\t\t}\n\n\t\treturn components;\n\t},\n\n\tserialize : function (components:URIComponents, options:URIOptions):URIComponents {\n\t\tconst secure = String(components.scheme).toLowerCase() === \"https\";\n\n\t\t//normalize the default port\n\t\tif (components.port === (secure ? 443 : 80) || components.port === \"\") {\n\t\t\tcomponents.port = undefined;\n\t\t}\n\t\t\n\t\t//normalize the empty path\n\t\tif (!components.path) {\n\t\t\tcomponents.path = \"/\";\n\t\t}\n\n\t\t//NOTE: We do not parse query strings for HTTP URIs\n\t\t//as WWW Form Url Encoded query strings are part of the HTML4+ spec,\n\t\t//and not the HTTP spec.\n\n\t\treturn components;\n\t}\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport http from \"./http\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"https\",\n\tdomainHost : http.domainHost,\n\tparse : http.parse,\n\tserialize : http.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport ws from \"./ws\";\n\nconst handler:URISchemeHandler = {\n\tscheme : \"wss\",\n\tdomainHost : ws.domainHost,\n\tparse : ws.parse,\n\tserialize : ws.serialize\n}\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { pctEncChar, SCHEMES } from \"../uri\";\n\nexport interface URNComponents extends URIComponents {\n\tnid?:string;\n\tnss?:string;\n}\n\nexport interface URNOptions extends URIOptions {\n\tnid?:string;\n}\n\nconst NID$ = \"(?:[0-9A-Za-z][0-9A-Za-z\\\\-]{1,31})\";\nconst PCT_ENCODED$ = \"(?:\\\\%[0-9A-Fa-f]{2})\";\nconst TRANS$$ = \"[0-9A-Za-z\\\\(\\\\)\\\\+\\\\,\\\\-\\\\.\\\\:\\\\=\\\\@\\\\;\\\\$\\\\_\\\\!\\\\*\\\\'\\\\/\\\\?\\\\#]\";\nconst NSS$ = \"(?:(?:\" + PCT_ENCODED$ + \"|\" + TRANS$$ + \")+)\";\nconst URN_SCHEME = new RegExp(\"^urn\\\\:(\" + NID$ + \")$\");\nconst URN_PATH = new RegExp(\"^(\" + NID$ + \")\\\\:(\" + NSS$ + \")$\");\nconst URN_PARSE = /^([^\\:]+)\\:(.*)/;\nconst URN_EXCLUDED = /[\\x00-\\x20\\\\\\\"\\&\\<\\>\\[\\]\\^\\`\\{\\|\\}\\~\\x7F-\\xFF]/g;\n\n//RFC 2141\nconst handler:URISchemeHandler<URNComponents,URNOptions> = {\n\tscheme : \"urn\",\n\n\tparse : function (components:URIComponents, options:URNOptions):URNComponents {\n\t\tconst matches = components.path && components.path.match(URN_PARSE);\n\t\tlet urnComponents = components as URNComponents;\n\n\t\tif (matches) {\n\t\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\t\tconst nid = matches[1].toLowerCase();\n\t\t\tconst nss = matches[2];\n\t\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\t\turnComponents.nid = nid;\n\t\t\turnComponents.nss = nss;\n\t\t\turnComponents.path = undefined;\n\n\t\t\tif (schemeHandler) {\n\t\t\t\turnComponents = schemeHandler.parse(urnComponents, options) as URNComponents;\n\t\t\t}\n\t\t} else {\n\t\t\turnComponents.error = urnComponents.error || \"URN can not be parsed.\";\n\t\t}\n\n\t\treturn urnComponents;\n\t},\n\n\tserialize : function (urnComponents:URNComponents, options:URNOptions):URIComponents {\n\t\tconst scheme = options.scheme || urnComponents.scheme || \"urn\";\n\t\tconst nid = urnComponents.nid;\n\t\tconst urnScheme = `${scheme}:${options.nid || nid}`;\n\t\tconst schemeHandler = SCHEMES[urnScheme];\n\n\t\tif (schemeHandler) {\n\t\t\turnComponents = schemeHandler.serialize(urnComponents, options) as URNComponents;\n\t\t}\n\n\t\tconst uriComponents = urnComponents as URIComponents;\n\t\tconst nss = urnComponents.nss;\n\t\turiComponents.path = `${nid || options.nid}:${nss}`;\n\n\t\treturn uriComponents;\n\t},\n};\n\nexport default handler;","import { URISchemeHandler, URIComponents, URIOptions } from \"../uri\";\nimport { URNComponents } from \"./urn\";\nimport { SCHEMES } from \"../uri\";\n\nexport interface UUIDComponents extends URNComponents {\n\tuuid?: string;\n}\n\nconst UUID = /^[0-9A-Fa-f]{8}(?:\\-[0-9A-Fa-f]{4}){3}\\-[0-9A-Fa-f]{12}$/;\nconst UUID_PARSE = /^[0-9A-Fa-f\\-]{36}/;\n\n//RFC 4122\nconst handler:URISchemeHandler<UUIDComponents, URIOptions, URNComponents> = {\n\tscheme : \"urn:uuid\",\n\n\tparse : function (urnComponents:URNComponents, options:URIOptions):UUIDComponents {\n\t\tconst uuidComponents = urnComponents as UUIDComponents;\n\t\tuuidComponents.uuid = uuidComponents.nss;\n\t\tuuidComponents.nss = undefined;\n\n\t\tif (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {\n\t\t\tuuidComponents.error = uuidComponents.error || \"UUID is not valid.\";\n\t\t}\n\n\t\treturn uuidComponents;\n\t},\n\n\tserialize : function (uuidComponents:UUIDComponents, options:URIOptions):URNComponents {\n\t\tconst urnComponents = uuidComponents as URNComponents;\n\t\t//normalize UUID\n\t\turnComponents.nss = (uuidComponents.uuid || \"\").toLowerCase();\n\t\treturn urnComponents;\n\t},\n};\n\nexport default handler;","import { SCHEMES } from \"./uri\";\n\nimport http from \"./schemes/http\";\nSCHEMES[http.scheme] = http;\n\nimport https from \"./schemes/https\";\nSCHEMES[https.scheme] = https;\n\nimport ws from \"./schemes/ws\";\nSCHEMES[ws.scheme] = ws;\n\nimport wss from \"./schemes/wss\";\nSCHEMES[wss.scheme] = wss;\n\nimport mailto from \"./schemes/mailto\";\nSCHEMES[mailto.scheme] = mailto;\n\nimport urn from \"./schemes/urn\";\nSCHEMES[urn.scheme] = urn;\n\nimport uuid from \"./schemes/urn-uuid\";\nSCHEMES[uuid.scheme] = uuid;\n\nexport * from \"./uri\";\n"]}pU'xw100644 index.d.ts vCh;zYC頧100644 index.js S[a(HW"c{{100644 index.js.map 	qy' 1y8100644 regexps-iri.d.ts otO}ݞ4^.100644 regexps-iri.js 4ޘ;GḼnOUi100644 regexps-iri.js.map "iŀDy磘pc~<#6100644 regexps-uri.d.ts `Q[R 		΋0 100644 regexps-uri.js Y37	ʧ100644 regexps-uri.js.map N=^I:cn-40000 schemes  '.ÏZZHNZ|100644 uri.d.ts Q5'p_ٓǠ100644 uri.js eeF˗{100644 uri.js.map .r*a.GLΗ1100644 util.d.ts |uCΫubu100644 util.js '70Z#1100644 util.js.map K~4`8KA(x6x export * from "./uri";
^!ximport { SCHEMES } from "./uri";
import http from "./schemes/http";
SCHEMES[http.scheme] = http;
import https from "./schemes/https";
SCHEMES[https.scheme] = https;
import ws from "./schemes/ws";
SCHEMES[ws.scheme] = ws;
import wss from "./schemes/wss";
SCHEMES[wss.scheme] = wss;
import mailto from "./schemes/mailto";
SCHEMES[mailto.scheme] = mailto;
import urn from "./schemes/urn";
SCHEMES[urn.scheme] = urn;
import uuid from "./schemes/urn-uuid";
SCHEMES[uuid.scheme] = uuid;
export * from "./uri";
//# sourceMappingURL=index.js.mapb.x{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,OAAO,IAAI,MAAM,gBAAgB,CAAC;AAClC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAE5B,OAAO,KAAK,MAAM,iBAAiB,CAAC;AACpC,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC;AAE9B,OAAO,EAAE,MAAM,cAAc,CAAC;AAC9B,OAAO,CAAC,EAAE,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC;AAExB,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAE1B,OAAO,MAAM,MAAM,kBAAkB,CAAC;AACtC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,MAAM,CAAC;AAEhC,OAAO,GAAG,MAAM,eAAe,CAAC;AAChC,OAAO,CAAC,GAAG,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC;AAE1B,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC;AAE5B,cAAc,OAAO,CAAC"}vxa import { URIRegExps } from "./uri";
declare const _default: URIRegExps;
export default _default;
q!xr import { buildExps } from "./regexps-uri";
export default buildExps(true);
//# sourceMappingURL=regexps-iri.js.map+(ڰx ?{"version":3,"file":"regexps-iri.js","sourceRoot":"","sources":["../../src/regexps-iri.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAE1C,eAAe,SAAS,CAAC,IAAI,CAAC,CAAC"}9
x _import { URIRegExps } from "./uri";
export declare function buildExps(isIRI: boolean): URIRegExps;
declare const _default: URIRegExps;
export default _default;
	8dxzimport { merge, subexp } from "./util";
export function buildExps(isIRI) {
    const ALPHA$$ = "[A-Za-z]", CR$ = "[\\x0D]", DIGIT$$ = "[0-9]", DQUOTE$$ = "[\\x22]", HEXDIG$$ = merge(DIGIT$$, "[A-Fa-f]"), //case-insensitive
    LF$$ = "[\\x0A]", SP$$ = "[\\x20]", PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)), //expanded
    GEN_DELIMS$$ = "[\\:\\/\\?\\#\\[\\]\\@]", SUB_DELIMS$$ = "[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]", RESERVED$$ = merge(GEN_DELIMS$$, SUB_DELIMS$$), UCSCHAR$$ = isIRI ? "[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]" : "[]", //subset, excludes bidi control characters
    IPRIVATE$$ = isIRI ? "[\\uE000-\\uF8FF]" : "[]", //subset
    UNRESERVED$$ = merge(ALPHA$$, DIGIT$$, "[\\-\\.\\_\\~]", UCSCHAR$$), SCHEME$ = subexp(ALPHA$$ + merge(ALPHA$$, DIGIT$$, "[\\+\\-\\.]") + "*"), USERINFO$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]")) + "*"), DEC_OCTET$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("[1-9]" + DIGIT$$) + "|" + DIGIT$$), DEC_OCTET_RELAXED$ = subexp(subexp("25[0-5]") + "|" + subexp("2[0-4]" + DIGIT$$) + "|" + subexp("1" + DIGIT$$ + DIGIT$$) + "|" + subexp("0?[1-9]" + DIGIT$$) + "|0?0?" + DIGIT$$), //relaxed parsing rules
    IPV4ADDRESS$ = subexp(DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$ + "\\." + DEC_OCTET_RELAXED$), H16$ = subexp(HEXDIG$$ + "{1,4}"), LS32$ = subexp(subexp(H16$ + "\\:" + H16$) + "|" + IPV4ADDRESS$), IPV6ADDRESS1$ = subexp(subexp(H16$ + "\\:") + "{6}" + LS32$), //                           6( h16 ":" ) ls32
    IPV6ADDRESS2$ = subexp("\\:\\:" + subexp(H16$ + "\\:") + "{5}" + LS32$), //                      "::" 5( h16 ":" ) ls32
    IPV6ADDRESS3$ = subexp(subexp(H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{4}" + LS32$), //[               h16 ] "::" 4( h16 ":" ) ls32
    IPV6ADDRESS4$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,1}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{3}" + LS32$), //[ *1( h16 ":" ) h16 ] "::" 3( h16 ":" ) ls32
    IPV6ADDRESS5$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,2}" + H16$) + "?\\:\\:" + subexp(H16$ + "\\:") + "{2}" + LS32$), //[ *2( h16 ":" ) h16 ] "::" 2( h16 ":" ) ls32
    IPV6ADDRESS6$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,3}" + H16$) + "?\\:\\:" + H16$ + "\\:" + LS32$), //[ *3( h16 ":" ) h16 ] "::"    h16 ":"   ls32
    IPV6ADDRESS7$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,4}" + H16$) + "?\\:\\:" + LS32$), //[ *4( h16 ":" ) h16 ] "::"              ls32
    IPV6ADDRESS8$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,5}" + H16$) + "?\\:\\:" + H16$), //[ *5( h16 ":" ) h16 ] "::"              h16
    IPV6ADDRESS9$ = subexp(subexp(subexp(H16$ + "\\:") + "{0,6}" + H16$) + "?\\:\\:"), //[ *6( h16 ":" ) h16 ] "::"
    IPV6ADDRESS$ = subexp([IPV6ADDRESS1$, IPV6ADDRESS2$, IPV6ADDRESS3$, IPV6ADDRESS4$, IPV6ADDRESS5$, IPV6ADDRESS6$, IPV6ADDRESS7$, IPV6ADDRESS8$, IPV6ADDRESS9$].join("|")), ZONEID$ = subexp(subexp(UNRESERVED$$ + "|" + PCT_ENCODED$) + "+"), //RFC 6874
    IPV6ADDRZ$ = subexp(IPV6ADDRESS$ + "\\%25" + ZONEID$), //RFC 6874
    IPV6ADDRZ_RELAXED$ = subexp(IPV6ADDRESS$ + subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + ZONEID$), //RFC 6874, with relaxed parsing rules
    IPVFUTURE$ = subexp("[vV]" + HEXDIG$$ + "+\\." + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:]") + "+"), IP_LITERAL$ = subexp("\\[" + subexp(IPV6ADDRZ_RELAXED$ + "|" + IPV6ADDRESS$ + "|" + IPVFUTURE$) + "\\]"), //RFC 6874
    REG_NAME$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$)) + "*"), HOST$ = subexp(IP_LITERAL$ + "|" + IPV4ADDRESS$ + "(?!" + REG_NAME$ + ")" + "|" + REG_NAME$), PORT$ = subexp(DIGIT$$ + "*"), AUTHORITY$ = subexp(subexp(USERINFO$ + "@") + "?" + HOST$ + subexp("\\:" + PORT$) + "?"), PCHAR$ = subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@]")), SEGMENT$ = subexp(PCHAR$ + "*"), SEGMENT_NZ$ = subexp(PCHAR$ + "+"), SEGMENT_NZ_NC$ = subexp(subexp(PCT_ENCODED$ + "|" + merge(UNRESERVED$$, SUB_DELIMS$$, "[\\@]")) + "+"), PATH_ABEMPTY$ = subexp(subexp("\\/" + SEGMENT$) + "*"), PATH_ABSOLUTE$ = subexp("\\/" + subexp(SEGMENT_NZ$ + PATH_ABEMPTY$) + "?"), //simplified
    PATH_NOSCHEME$ = subexp(SEGMENT_NZ_NC$ + PATH_ABEMPTY$), //simplified
    PATH_ROOTLESS$ = subexp(SEGMENT_NZ$ + PATH_ABEMPTY$), //simplified
    PATH_EMPTY$ = "(?!" + PCHAR$ + ")", PATH$ = subexp(PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), QUERY$ = subexp(subexp(PCHAR$ + "|" + merge("[\\/\\?]", IPRIVATE$$)) + "*"), FRAGMENT$ = subexp(subexp(PCHAR$ + "|[\\/\\?]") + "*"), HIER_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$), URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), RELATIVE_PART$ = subexp(subexp("\\/\\/" + AUTHORITY$ + PATH_ABEMPTY$) + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$), RELATIVE$ = subexp(RELATIVE_PART$ + subexp("\\?" + QUERY$) + "?" + subexp("\\#" + FRAGMENT$) + "?"), URI_REFERENCE$ = subexp(URI$ + "|" + RELATIVE$), ABSOLUTE_URI$ = subexp(SCHEME$ + "\\:" + HIER_PART$ + subexp("\\?" + QUERY$) + "?"), GENERIC_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", RELATIVE_REF$ = "^(){0}" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_NOSCHEME$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", ABSOLUTE_REF$ = "^(" + SCHEME$ + ")\\:" + subexp(subexp("\\/\\/(" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?)") + "?(" + PATH_ABEMPTY$ + "|" + PATH_ABSOLUTE$ + "|" + PATH_ROOTLESS$ + "|" + PATH_EMPTY$ + ")") + subexp("\\?(" + QUERY$ + ")") + "?$", SAMEDOC_REF$ = "^" + subexp("\\#(" + FRAGMENT$ + ")") + "?$", AUTHORITY_REF$ = "^" + subexp("(" + USERINFO$ + ")@") + "?(" + HOST$ + ")" + subexp("\\:(" + PORT$ + ")") + "?$";
    return {
        NOT_SCHEME: new RegExp(merge("[^]", ALPHA$$, DIGIT$$, "[\\+\\-\\.]"), "g"),
        NOT_USERINFO: new RegExp(merge("[^\\%\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
        NOT_HOST: new RegExp(merge("[^\\%\\[\\]\\:]", UNRESERVED$$, SUB_DELIMS$$), "g"),
        NOT_PATH: new RegExp(merge("[^\\%\\/\\:\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
        NOT_PATH_NOSCHEME: new RegExp(merge("[^\\%\\/\\@]", UNRESERVED$$, SUB_DELIMS$$), "g"),
        NOT_QUERY: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]", IPRIVATE$$), "g"),
        NOT_FRAGMENT: new RegExp(merge("[^\\%]", UNRESERVED$$, SUB_DELIMS$$, "[\\:\\@\\/\\?]"), "g"),
        ESCAPE: new RegExp(merge("[^]", UNRESERVED$$, SUB_DELIMS$$), "g"),
        UNRESERVED: new RegExp(UNRESERVED$$, "g"),
        OTHER_CHARS: new RegExp(merge("[^\\%]", UNRESERVED$$, RESERVED$$), "g"),
        PCT_ENCODED: new RegExp(PCT_ENCODED$, "g"),
        IPV4ADDRESS: new RegExp("^(" + IPV4ADDRESS$ + ")$"),
        IPV6ADDRESS: new RegExp("^\\[?(" + IPV6ADDRESS$ + ")" + subexp(subexp("\\%25|\\%(?!" + HEXDIG$$ + "{2})") + "(" + ZONEID$ + ")") + "?\\]?$") //RFC 6874, with relaxed parsing rules
    };
}
export default buildExps(false);
//# sourceMappingURL=regexps-uri.js.mapx[ {"version":3,"file":"regexps-uri.js","sourceRoot":"","sources":["../../src/regexps-uri.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEvC,MAAM,oBAAoB,KAAa;IACtC,MACC,OAAO,GAAG,UAAU,EACpB,GAAG,GAAG,SAAS,EACf,OAAO,GAAG,OAAO,EACjB,QAAQ,GAAG,SAAS,EACpB,QAAQ,GAAG,KAAK,CAAC,OAAO,EAAE,UAAU,CAAC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;QACtF,SAAS,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,CAAC,EAAE,GAAG,CAAC;QACtG,YAAY,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,CAAC,EAAE,GAAG,CAAC;QAC7F,MAAM,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,YAAY,EAAE,YAAY,CAAC,EAAE,GAAG,CAAC;QAClE,UAAU,EAAG,IAAI,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC;QAC1C,WAAW,EAAG,IAAI,MAAM,CAAC,KAAK,CAAC,QAAQ,EAAE,YAAY,EAAE,UAAU,CAAC,EAAE,GAAG,CAAC;QACxE,WAAW,EAAG,IAAI,MAAM,CAAC,YAAY,EAAE,GAAG,CAAC;QAC3C,WAAW,EAAG,IAAI,MAAM,CAAC,IAAI,GAAG,YAAY,GAAG,IAAI,CAAC;QACpD,WAAW,EAAG,IAAI,MAAM,CAAC,QAAQ,GAAG,YAAY,GAAG,GAAG,GAAG,MAAM,CAAC,MAAM,CAAC,cAAc,GAAG,QAAQ,GAAG,MAAM,CAAC,GAAG,GAAG,GAAG,OAAO,GAAG,GAAG,CAAC,GAAG,QAAQ,CAAC,CAAE,sCAAsC;KACrL,CAAC;AACH,CAAC;AAED,eAAe,SAAS,CAAC,KAAK,CAAC,CAAC"}ã=1x100644 http.d.ts [/5BAe\Ud5RZX100644 http.js jbTv'100644 http.js.map pMȟf100644 https.d.ts [/5BAe\Ud5RZX100644 https.js Knvg|G+r)100644 https.js.map 8[f4p100644 mailto.d.ts *7q'	eG100644 mailto.js %Sq<ތ!\th$100644 mailto.js.map ۩a+	{sYyP100644 urn-uuid.d.ts _.y?OtvU_4O6100644 urn-uuid.js UHѦgcQ100644 urn-uuid.js.map ;z:6JhA{.100644 urn.d.ts ~/lbx+er?ug100644 urn.js ]?s ߢI!ɑ&.t100644 urn.js.map C:,|d̕Q100644 ws.d.ts G[$a5#S'7100644 ws.js w5U npR8100644 ws.js.map h]fɳyE[\100644 wss.d.ts [/5BAe\Ud5RZX100644 wss.js ,nŊ[Ȑ.2100644 wss.js.map G^J /,'d1xl import { URISchemeHandler } from "../uri";
declare const handler: URISchemeHandler;
export default handler;

l%;x@const handler = {
    scheme: "http",
    domainHost: true,
    parse: function (components, options) {
        //report missing host
        if (!components.host) {
            components.error = components.error || "HTTP URIs must have a host.";
        }
        return components;
    },
    serialize: function (components, options) {
        const secure = String(components.scheme).toLowerCase() === "https";
        //normalize the default port
        if (components.port === (secure ? 443 : 80) || components.port === "") {
            components.port = undefined;
        }
        //normalize the empty path
        if (!components.path) {
            components.path = "/";
        }
        //NOTE: We do not parse query strings for HTTP URIs
        //as WWW Form Url Encoded query strings are part of the HTML4+ spec,
        //and not the HTTP spec.
        return components;
    }
};
export default handler;
//# sourceMappingURL=http.js.mapH"n4xI{"version":3,"file":"http.js","sourceRoot":"","sources":["../../../src/schemes/http.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,MAAM;IAEf,UAAU,EAAG,IAAI;IAEjB,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,qBAAqB;QACrB,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;YACrB,UAAU,CAAC,KAAK,GAAG,UAAU,CAAC,KAAK,IAAI,6BAA6B,CAAC;SACrE;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;IAED,SAAS,EAAG,UAAU,UAAwB,EAAE,OAAkB;QACjE,MAAM,MAAM,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,OAAO,CAAC;QAEnE,4BAA4B;QAC5B,IAAI,UAAU,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,UAAU,CAAC,IAAI,KAAK,EAAE,EAAE;YACtE,UAAU,CAAC,IAAI,GAAG,SAAS,CAAC;SAC5B;QAED,0BAA0B;QAC1B,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE;YACrB,UAAU,CAAC,IAAI,GAAG,GAAG,CAAC;SACtB;QAED,mDAAmD;QACnD,oEAAoE;QACpE,wBAAwB;QAExB,OAAO,UAAU,CAAC;IACnB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"},Ex +import http from "./http";
const handler = {
    scheme: "https",
    domainHost: http.domainHost,
    parse: http.parse,
    serialize: http.serialize
};
export default handler;
//# sourceMappingURL=https.js.mapG}x8{"version":3,"file":"https.js","sourceRoot":"","sources":["../../../src/schemes/https.ts"],"names":[],"mappings":"AACA,OAAO,IAAI,MAAM,QAAQ,CAAC;AAE1B,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,OAAO;IAChB,UAAU,EAAG,IAAI,CAAC,UAAU;IAC5B,KAAK,EAAG,IAAI,CAAC,KAAK;IAClB,SAAS,EAAG,IAAI,CAAC,SAAS;CAC1B,CAAA;AAED,eAAe,OAAO,CAAC"}pWǷxgimport { URISchemeHandler, URIComponents } from "../uri";
export interface MailtoHeaders {
    [hfname: string]: string;
}
export interface MailtoComponents extends URIComponents {
    to: Array<string>;
    headers?: MailtoHeaders;
    subject?: string;
    body?: string;
}
declare const handler: URISchemeHandler<MailtoComponents>;
export default handler;
|xBimport { pctEncChar, pctDecChars, unescapeComponent } from "../uri";
import punycode from "punycode";
import { merge, subexp, toUpperCase, toArray } from "../util";
const O = {};
const isIRI = true;
//RFC 3986
const UNRESERVED$$ = "[A-Za-z0-9\\-\\.\\_\\~" + (isIRI ? "\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF" : "") + "]";
const HEXDIG$$ = "[0-9A-Fa-f]"; //case-insensitive
const PCT_ENCODED$ = subexp(subexp("%[EFef]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%[89A-Fa-f]" + HEXDIG$$ + "%" + HEXDIG$$ + HEXDIG$$) + "|" + subexp("%" + HEXDIG$$ + HEXDIG$$)); //expanded
//RFC 5322, except these symbols as per RFC 6068: @ : / ? # [ ] & ; =
//const ATEXT$$ = "[A-Za-z0-9\\!\\#\\$\\%\\&\\'\\*\\+\\-\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~]";
//const WSP$$ = "[\\x20\\x09]";
//const OBS_QTEXT$$ = "[\\x01-\\x08\\x0B\\x0C\\x0E-\\x1F\\x7F]";  //(%d1-8 / %d11-12 / %d14-31 / %d127)
//const QTEXT$$ = merge("[\\x21\\x23-\\x5B\\x5D-\\x7E]", OBS_QTEXT$$);  //%d33 / %d35-91 / %d93-126 / obs-qtext
//const VCHAR$$ = "[\\x21-\\x7E]";
//const WSP$$ = "[\\x20\\x09]";
//const OBS_QP$ = subexp("\\\\" + merge("[\\x00\\x0D\\x0A]", OBS_QTEXT$$));  //%d0 / CR / LF / obs-qtext
//const FWS$ = subexp(subexp(WSP$$ + "*" + "\\x0D\\x0A") + "?" + WSP$$ + "+");
//const QUOTED_PAIR$ = subexp(subexp("\\\\" + subexp(VCHAR$$ + "|" + WSP$$)) + "|" + OBS_QP$);
//const QUOTED_STRING$ = subexp('\\"' + subexp(FWS$ + "?" + QCONTENT$) + "*" + FWS$ + "?" + '\\"');
const ATEXT$$ = "[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]";
const QTEXT$$ = "[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]";
const VCHAR$$ = merge(QTEXT$$, "[\\\"\\\\]");
const DOT_ATOM_TEXT$ = subexp(ATEXT$$ + "+" + subexp("\\." + ATEXT$$ + "+") + "*");
const QUOTED_PAIR$ = subexp("\\\\" + VCHAR$$);
const QCONTENT$ = subexp(QTEXT$$ + "|" + QUOTED_PAIR$);
const QUOTED_STRING$ = subexp('\\"' + QCONTENT$ + "*" + '\\"');
//RFC 6068
const DTEXT_NO_OBS$$ = "[\\x21-\\x5A\\x5E-\\x7E]"; //%d33-90 / %d94-126
const SOME_DELIMS$$ = "[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]";
const QCHAR$ = subexp(UNRESERVED$$ + "|" + PCT_ENCODED$ + "|" + SOME_DELIMS$$);
const DOMAIN$ = subexp(DOT_ATOM_TEXT$ + "|" + "\\[" + DTEXT_NO_OBS$$ + "*" + "\\]");
const LOCAL_PART$ = subexp(DOT_ATOM_TEXT$ + "|" + QUOTED_STRING$);
const ADDR_SPEC$ = subexp(LOCAL_PART$ + "\\@" + DOMAIN$);
const TO$ = subexp(ADDR_SPEC$ + subexp("\\," + ADDR_SPEC$) + "*");
const HFNAME$ = subexp(QCHAR$ + "*");
const HFVALUE$ = HFNAME$;
const HFIELD$ = subexp(HFNAME$ + "\\=" + HFVALUE$);
const HFIELDS2$ = subexp(HFIELD$ + subexp("\\&" + HFIELD$) + "*");
const HFIELDS$ = subexp("\\?" + HFIELDS2$);
const MAILTO_URI = new RegExp("^mailto\\:" + TO$ + "?" + HFIELDS$ + "?$");
const UNRESERVED = new RegExp(UNRESERVED$$, "g");
const PCT_ENCODED = new RegExp(PCT_ENCODED$, "g");
const NOT_LOCAL_PART = new RegExp(merge("[^]", ATEXT$$, "[\\.]", '[\\"]', VCHAR$$), "g");
const NOT_DOMAIN = new RegExp(merge("[^]", ATEXT$$, "[\\.]", "[\\[]", DTEXT_NO_OBS$$, "[\\]]"), "g");
const NOT_HFNAME = new RegExp(merge("[^]", UNRESERVED$$, SOME_DELIMS$$), "g");
const NOT_HFVALUE = NOT_HFNAME;
const TO = new RegExp("^" + TO$ + "$");
const HFIELDS = new RegExp("^" + HFIELDS2$ + "$");
function decodeUnreserved(str) {
    const decStr = pctDecChars(str);
    return (!decStr.match(UNRESERVED) ? str : decStr);
}
const handler = {
    scheme: "mailto",
    parse: function (components, options) {
        const mailtoComponents = components;
        const to = mailtoComponents.to = (mailtoComponents.path ? mailtoComponents.path.split(",") : []);
        mailtoComponents.path = undefined;
        if (mailtoComponents.query) {
            let unknownHeaders = false;
            const headers = {};
            const hfields = mailtoComponents.query.split("&");
            for (let x = 0, xl = hfields.length; x < xl; ++x) {
                const hfield = hfields[x].split("=");
                switch (hfield[0]) {
                    case "to":
                        const toAddrs = hfield[1].split(",");
                        for (let x = 0, xl = toAddrs.length; x < xl; ++x) {
                            to.push(toAddrs[x]);
                        }
                        break;
                    case "subject":
                        mailtoComponents.subject = unescapeComponent(hfield[1], options);
                        break;
                    case "body":
                        mailtoComponents.body = unescapeComponent(hfield[1], options);
                        break;
                    default:
                        unknownHeaders = true;
                        headers[unescapeComponent(hfield[0], options)] = unescapeComponent(hfield[1], options);
                        break;
                }
            }
            if (unknownHeaders)
                mailtoComponents.headers = headers;
        }
        mailtoComponents.query = undefined;
        for (let x = 0, xl = to.length; x < xl; ++x) {
            const addr = to[x].split("@");
            addr[0] = unescapeComponent(addr[0]);
            if (!options.unicodeSupport) {
                //convert Unicode IDN -> ASCII IDN
                try {
                    addr[1] = punycode.toASCII(unescapeComponent(addr[1], options).toLowerCase());
                }
                catch (e) {
                    mailtoComponents.error = mailtoComponents.error || "Email address's domain name can not be converted to ASCII via punycode: " + e;
                }
            }
            else {
                addr[1] = unescapeComponent(addr[1], options).toLowerCase();
            }
            to[x] = addr.join("@");
        }
        return mailtoComponents;
    },
    serialize: function (mailtoComponents, options) {
        const components = mailtoComponents;
        const to = toArray(mailtoComponents.to);
        if (to) {
            for (let x = 0, xl = to.length; x < xl; ++x) {
                const toAddr = String(to[x]);
                const atIdx = toAddr.lastIndexOf("@");
                const localPart = (toAddr.slice(0, atIdx)).replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_LOCAL_PART, pctEncChar);
                let domain = toAddr.slice(atIdx + 1);
                //convert IDN via punycode
                try {
                    domain = (!options.iri ? punycode.toASCII(unescapeComponent(domain, options).toLowerCase()) : punycode.toUnicode(domain));
                }
                catch (e) {
                    components.error = components.error || "Email address's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
                }
                to[x] = localPart + "@" + domain;
            }
            components.path = to.join(",");
        }
        const headers = mailtoComponents.headers = mailtoComponents.headers || {};
        if (mailtoComponents.subject)
            headers["subject"] = mailtoComponents.subject;
        if (mailtoComponents.body)
            headers["body"] = mailtoComponents.body;
        const fields = [];
        for (const name in headers) {
            if (headers[name] !== O[name]) {
                fields.push(name.replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFNAME, pctEncChar) +
                    "=" +
                    headers[name].replace(PCT_ENCODED, decodeUnreserved).replace(PCT_ENCODED, toUpperCase).replace(NOT_HFVALUE, pctEncChar));
            }
        }
        if (fields.length) {
            components.query = fields.join("&");
        }
        return components;
    }
};
export default handler;
//# sourceMappingURL=mailto.js.map gx){"version":3,"file":"mailto.js","sourceRoot":"","sources":["../../../src/schemes/mailto.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AACpE,OAAO,QAAQ,MAAM,UAAU,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAa9D,MAAM,CAAC,GAAiB,EAAE,CAAC;AAC3B,MAAM,KAAK,GAAG,IAAI,CAAC;AAEnB,UAAU;AACV,MAAM,YAAY,GAAG,wBAAwB,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,2EAA2E,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC;AACjJ,MAAM,QAAQ,GAAG,aAAa,CAAC,CAAE,kBAAkB;AACnD,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,SAAS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MAAM,CAAC,IAAI,CACV,IAAI,CAAC,OAAO,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,UAAU,EAAE,UAAU,CAAC;oBAC7G,GAAG;oBACH,OAAO,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,gBAAgB,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,OAAO,CAAC,WAAW,EAAE,UAAU,CAAC,CACvH,CAAC;aACF;SACD;QACD,IAAI,MAAM,CAAC,MAAM,EAAE;YAClB,UAAU,CAAC,KAAK,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACpC;QAED,OAAO,UAAU,CAAC;IACnB,CAAC;CACD,CAAA;AAED,eAAe,OAAO,CAAC"}ZS55ximport { URISchemeHandler, URIOptions } from "../uri";
import { URNComponents } from "./urn";
export interface UUIDComponents extends URNComponents {
    uuid?: string;
}
declare const handler: URISchemeHandler<UUIDComponents, URIOptions, URNComponents>;
export default handler;
$:aٴ6xdconst UUID = /^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/;
const UUID_PARSE = /^[0-9A-Fa-f\-]{36}/;
//RFC 4122
const handler = {
    scheme: "urn:uuid",
    parse: function (urnComponents, options) {
        const uuidComponents = urnComponents;
        uuidComponents.uuid = uuidComponents.nss;
        uuidComponents.nss = undefined;
        if (!options.tolerant && (!uuidComponents.uuid || !uuidComponents.uuid.match(UUID))) {
            uuidComponents.error = uuidComponents.error || "UUID is not valid.";
        }
        return uuidComponents;
    },
    serialize: function (uuidComponents, options) {
        const urnComponents = uuidComponents;
        //normalize UUID
        urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
        return urnComponents;
    },
};
export default handler;
//# sourceMappingURL=urn-uuid.js.mapDT4x@{"version":3,"file":"urn-uuid.js","sourceRoot":"","sources":["../../../src/schemes/urn-uuid.ts"],"names":[],"mappings":"AAQA,MAAM,IAAI,GAAG,0DAA0D,CAAC;AACxE,MAAM,UAAU,GAAG,oBAAoB,CAAC;AAExC,UAAU;AACV,MAAM,OAAO,GAA+D;IAC3E,MAAM,EAAG,UAAU;IAEnB,KAAK,EAAG,UAAU,aAA2B,EAAE,OAAkB;QAChE,MAAM,cAAc,GAAG,aAA+B,CAAC;QACvD,cAAc,CAAC,IAAI,GAAG,cAAc,CAAC,GAAG,CAAC;QACzC,cAAc,CAAC,GAAG,GAAG,SAAS,CAAC;QAE/B,IAAI,CAAC,OAAO,CAAC,QAAQ,IAAI,CAAC,CAAC,cAAc,CAAC,IAAI,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,EAAE;YACpF,cAAc,CAAC,KAAK,GAAG,cAAc,CAAC,KAAK,IAAI,oBAAoB,CAAC;SACpE;QAED,OAAO,cAAc,CAAC;IACvB,CAAC;IAED,SAAS,EAAG,UAAU,cAA6B,EAAE,OAAkB;QACtE,MAAM,aAAa,GAAG,cAA+B,CAAC;QACtD,gBAAgB;QAChB,aAAa,CAAC,GAAG,GAAG,CAAC,cAAc,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;QAC9D,OAAO,aAAa,CAAC;IACtB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"}xDimport { URISchemeHandler, URIComponents, URIOptions } from "../uri";
export interface URNComponents extends URIComponents {
    nid?: string;
    nss?: string;
}
export interface URNOptions extends URIOptions {
    nid?: string;
}
declare const handler: URISchemeHandler<URNComponents, URNOptions>;
export default handler;
ipǲximport { SCHEMES } from "../uri";
const NID$ = "(?:[0-9A-Za-z][0-9A-Za-z\\-]{1,31})";
const PCT_ENCODED$ = "(?:\\%[0-9A-Fa-f]{2})";
const TRANS$$ = "[0-9A-Za-z\\(\\)\\+\\,\\-\\.\\:\\=\\@\\;\\$\\_\\!\\*\\'\\/\\?\\#]";
const NSS$ = "(?:(?:" + PCT_ENCODED$ + "|" + TRANS$$ + ")+)";
const URN_SCHEME = new RegExp("^urn\\:(" + NID$ + ")$");
const URN_PATH = new RegExp("^(" + NID$ + ")\\:(" + NSS$ + ")$");
const URN_PARSE = /^([^\:]+)\:(.*)/;
const URN_EXCLUDED = /[\x00-\x20\\\"\&\<\>\[\]\^\`\{\|\}\~\x7F-\xFF]/g;
//RFC 2141
const handler = {
    scheme: "urn",
    parse: function (components, options) {
        const matches = components.path && components.path.match(URN_PARSE);
        let urnComponents = components;
        if (matches) {
            const scheme = options.scheme || urnComponents.scheme || "urn";
            const nid = matches[1].toLowerCase();
            const nss = matches[2];
            const urnScheme = `${scheme}:${options.nid || nid}`;
            const schemeHandler = SCHEMES[urnScheme];
            urnComponents.nid = nid;
            urnComponents.nss = nss;
            urnComponents.path = undefined;
            if (schemeHandler) {
                urnComponents = schemeHandler.parse(urnComponents, options);
            }
        }
        else {
            urnComponents.error = urnComponents.error || "URN can not be parsed.";
        }
        return urnComponents;
    },
    serialize: function (urnComponents, options) {
        const scheme = options.scheme || urnComponents.scheme || "urn";
        const nid = urnComponents.nid;
        const urnScheme = `${scheme}:${options.nid || nid}`;
        const schemeHandler = SCHEMES[urnScheme];
        if (schemeHandler) {
            urnComponents = schemeHandler.serialize(urnComponents, options);
        }
        const uriComponents = urnComponents;
        const nss = urnComponents.nss;
        uriComponents.path = `${nid || options.nid}:${nss}`;
        return uriComponents;
    },
};
export default handler;
//# sourceMappingURL=urn.js.mapaEhyxl{"version":3,"file":"urn.js","sourceRoot":"","sources":["../../../src/schemes/urn.ts"],"names":[],"mappings":"AACA,OAAO,EAAc,OAAO,EAAE,MAAM,QAAQ,CAAC;AAW7C,MAAM,IAAI,GAAG,qCAAqC,CAAC;AACnD,MAAM,YAAY,GAAG,uBAAuB,CAAC;AAC7C,MAAM,OAAO,GAAG,mEAAmE,CAAC;AACpF,MAAM,IAAI,GAAG,QAAQ,GAAG,YAAY,GAAG,GAAG,GA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AC;SACtE;QAED,OAAO,aAAa,CAAC;IACtB,CAAC;IAED,SAAS,EAAG,UAAU,aAA2B,EAAE,OAAkB;QACpE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,aAAa,CAAC,MAAM,IAAI,KAAK,CAAC;QAC/D,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC;QAC9B,MAAM,SAAS,GAAG,GAAG,MAAM,IAAI,OAAO,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC;QACpD,MAAM,aAAa,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;QAEzC,IAAI,aAAa,EAAE;YAClB,aAAa,GAAG,aAAa,CAAC,SAAS,CAAC,aAAa,EAAE,OAAO,CAAkB,CAAC;SACjF;QAED,MAAM,aAAa,GAAG,aAA8B,CAAC;QACrD,MAAM,GAAG,GAAG,aAAa,CAAC,GAAG,CAAC;QAC9B,aAAa,CAAC,IAAI,GAAG,GAAG,GAAG,IAAI,OAAO,CAAC,GAAG,IAAI,GAAG,EAAE,CAAC;QAEpD,OAAO,aAAa,CAAC;IACtB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"}x import { URISchemeHandler, URIComponents } from "../uri";
export interface WSComponents extends URIComponents {
    resourceName?: string;
    secure?: boolean;
}
declare const handler: URISchemeHandler;
export default handler;
Oջgx{function isSecure(wsComponents) {
    return typeof wsComponents.secure === 'boolean' ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
}
//RFC 6455
const handler = {
    scheme: "ws",
    domainHost: true,
    parse: function (components, options) {
        const wsComponents = components;
        //indicate if the secure flag is set
        wsComponents.secure = isSecure(wsComponents);
        //construct resouce name
        wsComponents.resourceName = (wsComponents.path || '/') + (wsComponents.query ? '?' + wsComponents.query : '');
        wsComponents.path = undefined;
        wsComponents.query = undefined;
        return wsComponents;
    },
    serialize: function (wsComponents, options) {
        //normalize the default port
        if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
            wsComponents.port = undefined;
        }
        //ensure scheme matches secure flag
        if (typeof wsComponents.secure === 'boolean') {
            wsComponents.scheme = (wsComponents.secure ? 'wss' : 'ws');
            wsComponents.secure = undefined;
        }
        //reconstruct path from resource name
        if (wsComponents.resourceName) {
            const [path, query] = wsComponents.resourceName.split('?');
            wsComponents.path = (path && path !== '/' ? path : undefined);
            wsComponents.query = query;
            wsComponents.resourceName = undefined;
        }
        //forbid fragment component
        wsComponents.fragment = undefined;
        return wsComponents;
    }
};
export default handler;
//# sourceMappingURL=ws.js.mapSdxJ{"version":3,"file":"ws.js","sourceRoot":"","sources":["../../../src/schemes/ws.ts"],"names":[],"mappings":"AAOA,kBAAkB,YAAyB;IAC1C,OAAO,OAAO,YAAY,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,WAAW,EAAE,KAAK,KAAK,CAAC;AAC7H,CAAC;AAED,UAAU;AACV,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,IAAI;IAEb,UAAU,EAAG,IAAI;IAEjB,KAAK,EAAG,UAAU,UAAwB,EAAE,OAAkB;QAC7D,MAAM,YAAY,GAAG,UAA0B,CAAC;QAEhD,oCAAoC;QACpC,YAAY,CAAC,MAAM,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;QAE7C,wBAAwB;QACxB,YAAY,CAAC,YAAY,GAAG,CAAC,YAAY,CAAC,IAAI,IAAI,GAAG,CAAC,GAAG,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,GAAG,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;QAC9G,YAAY,CAAC,IAAI,GAAG,SAAS,CAAC;QAC9B,YAAY,CAAC,KAAK,GAAG,SAAS,CAAC;QAE/B,OAAO,YAAY,CAAC;IACrB,CAAC;IAED,SAAS,EAAG,UAAU,YAAyB,EAAE,OAAkB;QAClE,4BAA4B;QAC5B,IAAI,YAAY,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,YAAY,CAAC,IAAI,KAAK,EAAE,EAAE;YAC1F,YAAY,CAAC,IAAI,GAAG,SAAS,CAAC;SAC9B;QAED,mCAAmC;QACnC,IAAI,OAAO,YAAY,CAAC,MAAM,KAAK,SAAS,EAAE;YAC7C,YAAY,CAAC,MAAM,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;YAC3D,YAAY,CAAC,MAAM,GAAG,SAAS,CAAC;SAChC;QAED,qCAAqC;QACrC,IAAI,YAAY,CAAC,YAAY,EAAE;YAC9B,MAAM,CAAC,IAAI,EAAE,KAAK,CAAC,GAAG,YAAY,CAAC,YAAY,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;YAC3D,YAAY,CAAC,IAAI,GAAG,CAAC,IAAI,IAAI,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;YAC9D,YAAY,CAAC,KAAK,GAAG,KAAK,CAAC;YAC3B,YAAY,CAAC,YAAY,GAAG,SAAS,CAAC;SACtC;QAED,2BAA2B;QAC3B,YAAY,CAAC,QAAQ,GAAG,SAAS,CAAC;QAElC,OAAO,YAAY,CAAC;IACrB,CAAC;CACD,CAAC;AAEF,eAAe,OAAO,CAAC"}Zx 9import ws from "./ws";
const handler = {
    scheme: "wss",
    domainHost: ws.domainHost,
    parse: ws.parse,
    serialize: ws.serialize
};
export default handler;
//# sourceMappingURL=wss.js.mapAAx3{"version":3,"file":"wss.js","sourceRoot":"","sources":["../../../src/schemes/wss.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,MAAM,CAAC;AAEtB,MAAM,OAAO,GAAoB;IAChC,MAAM,EAAG,KAAK;IACd,UAAU,EAAG,EAAE,CAAC,UAAU;IAC1B,KAAK,EAAG,EAAE,CAAC,KAAK;IAChB,SAAS,EAAG,EAAE,CAAC,SAAS;CACxB,CAAA;AAED,eAAe,OAAO,CAAC"}k?V'	xNF/**
 * URI.js
 *
 * @fileoverview An RFC 3986 compliant, scheme extendable URI parsing/validating/resolving library for JavaScript.
 * @author <a href="mailto:gary.court@gmail.com">Gary Court</a>
 * @see http://github.com/garycourt/uri-js
 */
/**
 * Copyright 2011 Gary Court. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without modification, are
 * permitted provided that the following conditions are met:
 *
 *    1. Redistributions of source code must retain the above copyright notice, this list of
 *       conditions and the following disclaimer.
 *
 *    2. Redistributions in binary form must reproduce the above copyright notice, this list
 *       of conditions and the following disclaimer in the documentation and/or other materials
 *       provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY GARY COURT ``AS IS'' AND ANY EXPRESS OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
 * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GARY COURT OR
 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * The views and conclusions contained in the software and documentation are those of the
 * authors and should not be interpreted as representing official policies, either expressed
 * or implied, of Gary Court.
 */
import URI_PROTOCOL from "./regexps-uri";
import IRI_PROTOCOL from "./regexps-iri";
import punycode from "punycode";
import { toUpperCase, typeOf, assign } from "./util";
export const SCHEMES = {};
export function pctEncChar(chr) {
    const c = chr.charCodeAt(0);
    let e;
    if (c < 16)
        e = "%0" + c.toString(16).toUpperCase();
    else if (c < 128)
        e = "%" + c.toString(16).toUpperCase();
    else if (c < 2048)
        e = "%" + ((c >> 6) | 192).toString(16).toUpperCase() + "%" + ((c & 63) | 128).toString(16).toUpperCase();
    else
        e = "%" + ((c >> 12) | 224).toString(16).toUpperCase() + "%" + (((c >> 6) & 63) | 128).toString(16).toUpperCase() + "%" + ((c & 63) | 128).toString(16).toUpperCase();
    return e;
}
export function pctDecChars(str) {
    let newStr = "";
    let i = 0;
    const il = str.length;
    while (i < il) {
        const c = parseInt(str.substr(i + 1, 2), 16);
        if (c < 128) {
            newStr += String.fromCharCode(c);
            i += 3;
        }
        else if (c >= 194 && c < 224) {
            if ((il - i) >= 6) {
                const c2 = parseInt(str.substr(i + 4, 2), 16);
                newStr += String.fromCharCode(((c & 31) << 6) | (c2 & 63));
            }
            else {
                newStr += str.substr(i, 6);
            }
            i += 6;
        }
        else if (c >= 224) {
            if ((il - i) >= 9) {
                const c2 = parseInt(str.substr(i + 4, 2), 16);
                const c3 = parseInt(str.substr(i + 7, 2), 16);
                newStr += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63));
            }
            else {
                newStr += str.substr(i, 9);
            }
            i += 9;
        }
        else {
            newStr += str.substr(i, 3);
            i += 3;
        }
    }
    return newStr;
}
function _normalizeComponentEncoding(components, protocol) {
    function decodeUnreserved(str) {
        const decStr = pctDecChars(str);
        return (!decStr.match(protocol.UNRESERVED) ? str : decStr);
    }
    if (components.scheme)
        components.scheme = String(components.scheme).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_SCHEME, "");
    if (components.userinfo !== undefined)
        components.userinfo = String(components.userinfo).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_USERINFO, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
    if (components.host !== undefined)
        components.host = String(components.host).replace(protocol.PCT_ENCODED, decodeUnreserved).toLowerCase().replace(protocol.NOT_HOST, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
    if (components.path !== undefined)
        components.path = String(components.path).replace(protocol.PCT_ENCODED, decodeUnreserved).replace((components.scheme ? protocol.NOT_PATH : protocol.NOT_PATH_NOSCHEME), pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
    if (components.query !== undefined)
        components.query = String(components.query).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_QUERY, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
    if (components.fragment !== undefined)
        components.fragment = String(components.fragment).replace(protocol.PCT_ENCODED, decodeUnreserved).replace(protocol.NOT_FRAGMENT, pctEncChar).replace(protocol.PCT_ENCODED, toUpperCase);
    return components;
}
;
function _stripLeadingZeros(str) {
    return str.replace(/^0*(.*)/, "$1") || "0";
}
function _normalizeIPv4(host, protocol) {
    const matches = host.match(protocol.IPV4ADDRESS) || [];
    const [, address] = matches;
    if (address) {
        return address.split(".").map(_stripLeadingZeros).join(".");
    }
    else {
        return host;
    }
}
function _normalizeIPv6(host, protocol) {
    const matches = host.match(protocol.IPV6ADDRESS) || [];
    const [, address, zone] = matches;
    if (address) {
        const [last, first] = address.toLowerCase().split('::').reverse();
        const firstFields = first ? first.split(":").map(_stripLeadingZeros) : [];
        const lastFields = last.split(":").map(_stripLeadingZeros);
        const isLastFieldIPv4Address = protocol.IPV4ADDRESS.test(lastFields[lastFields.length - 1]);
        const fieldCount = isLastFieldIPv4Address ? 7 : 8;
        const lastFieldsStart = lastFields.length - fieldCount;
        const fields = Array(fieldCount);
        for (let x = 0; x < fieldCount; ++x) {
            fields[x] = firstFields[x] || lastFields[lastFieldsStart + x] || '';
        }
        if (isLastFieldIPv4Address) {
            fields[fieldCount - 1] = _normalizeIPv4(fields[fieldCount - 1], protocol);
        }
        const allZeroFields = fields.reduce((acc, field, index) => {
            if (!field || field === "0") {
                const lastLongest = acc[acc.length - 1];
                if (lastLongest && lastLongest.index + lastLongest.length === index) {
                    lastLongest.length++;
                }
                else {
                    acc.push({ index, length: 1 });
                }
            }
            return acc;
        }, []);
        const longestZeroFields = allZeroFields.sort((a, b) => b.length - a.length)[0];
        let newHost;
        if (longestZeroFields && longestZeroFields.length > 1) {
            const newFirst = fields.slice(0, longestZeroFields.index);
            const newLast = fields.slice(longestZeroFields.index + longestZeroFields.length);
            newHost = newFirst.join(":") + "::" + newLast.join(":");
        }
        else {
            newHost = fields.join(":");
        }
        if (zone) {
            newHost += "%" + zone;
        }
        return newHost;
    }
    else {
        return host;
    }
}
const URI_PARSE = /^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i;
const NO_MATCH_IS_UNDEFINED = ("").match(/(){0}/)[1] === undefined;
export function parse(uriString, options = {}) {
    const components = {};
    const protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);
    if (options.reference === "suffix")
        uriString = (options.scheme ? options.scheme + ":" : "") + "//" + uriString;
    const matches = uriString.match(URI_PARSE);
    if (matches) {
        if (NO_MATCH_IS_UNDEFINED) {
            //store each component
            components.scheme = matches[1];
            components.userinfo = matches[3];
            components.host = matches[4];
            components.port = parseInt(matches[5], 10);
            components.path = matches[6] || "";
            components.query = matches[7];
            components.fragment = matches[8];
            //fix port number
            if (isNaN(components.port)) {
                components.port = matches[5];
            }
        }
        else { //IE FIX for improper RegExp matching
            //store each component
            components.scheme = matches[1] || undefined;
            components.userinfo = (uriString.indexOf("@") !== -1 ? matches[3] : undefined);
            components.host = (uriString.indexOf("//") !== -1 ? matches[4] : undefined);
            components.port = parseInt(matches[5], 10);
            components.path = matches[6] || "";
            components.query = (uriString.indexOf("?") !== -1 ? matches[7] : undefined);
            components.fragment = (uriString.indexOf("#") !== -1 ? matches[8] : undefined);
            //fix port number
            if (isNaN(components.port)) {
                components.port = (uriString.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/) ? matches[4] : undefined);
            }
        }
        if (components.host) {
            //normalize IP hosts
            components.host = _normalizeIPv6(_normalizeIPv4(components.host, protocol), protocol);
        }
        //determine reference type
        if (components.scheme === undefined && components.userinfo === undefined && components.host === undefined && components.port === undefined && !components.path && components.query === undefined) {
            components.reference = "same-document";
        }
        else if (components.scheme === undefined) {
            components.reference = "relative";
        }
        else if (components.fragment === undefined) {
            components.reference = "absolute";
        }
        else {
            components.reference = "uri";
        }
        //check for reference errors
        if (options.reference && options.reference !== "suffix" && options.reference !== components.reference) {
            components.error = components.error || "URI is not a " + options.reference + " reference.";
        }
        //find scheme handler
        const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
        //check if scheme can't handle IRIs
        if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
            //if host component is a domain name
            if (components.host && (options.domainHost || (schemeHandler && schemeHandler.domainHost))) {
                //convert Unicode IDN -> ASCII IDN
                try {
                    components.host = punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase());
                }
                catch (e) {
                    components.error = components.error || "Host's domain name can not be converted to ASCII via punycode: " + e;
                }
            }
            //convert IRI -> URI
            _normalizeComponentEncoding(components, URI_PROTOCOL);
        }
        else {
            //normalize encodings
            _normalizeComponentEncoding(components, protocol);
        }
        //perform scheme specific parsing
        if (schemeHandler && schemeHandler.parse) {
            schemeHandler.parse(components, options);
        }
    }
    else {
        components.error = components.error || "URI can not be parsed.";
    }
    return components;
}
;
function _recomposeAuthority(components, options) {
    const protocol = (options.iri !== false ? IRI_PROTOCOL : URI_PROTOCOL);
    const uriTokens = [];
    if (components.userinfo !== undefined) {
        uriTokens.push(components.userinfo);
        uriTokens.push("@");
    }
    if (components.host !== undefined) {
        //normalize IP hosts, add brackets and escape zone separator for IPv6
        uriTokens.push(_normalizeIPv6(_normalizeIPv4(String(components.host), protocol), protocol).replace(protocol.IPV6ADDRESS, (_, $1, $2) => "[" + $1 + ($2 ? "%25" + $2 : "") + "]"));
    }
    if (typeof components.port === "number" || typeof components.port === "string") {
        uriTokens.push(":");
        uriTokens.push(String(components.port));
    }
    return uriTokens.length ? uriTokens.join("") : undefined;
}
;
const RDS1 = /^\.\.?\//;
const RDS2 = /^\/\.(\/|$)/;
const RDS3 = /^\/\.\.(\/|$)/;
const RDS4 = /^\.\.?$/;
const RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/;
export function removeDotSegments(input) {
    const output = [];
    while (input.length) {
        if (input.match(RDS1)) {
            input = input.replace(RDS1, "");
        }
        else if (input.match(RDS2)) {
            input = input.replace(RDS2, "/");
        }
        else if (input.match(RDS3)) {
            input = input.replace(RDS3, "/");
            output.pop();
        }
        else if (input === "." || input === "..") {
            input = "";
        }
        else {
            const im = input.match(RDS5);
            if (im) {
                const s = im[0];
                input = input.slice(s.length);
                output.push(s);
            }
            else {
                throw new Error("Unexpected dot segment condition");
            }
        }
    }
    return output.join("");
}
;
export function serialize(components, options = {}) {
    const protocol = (options.iri ? IRI_PROTOCOL : URI_PROTOCOL);
    const uriTokens = [];
    //find scheme handler
    const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
    //perform scheme specific serialization
    if (schemeHandler && schemeHandler.serialize)
        schemeHandler.serialize(components, options);
    if (components.host) {
        //if host component is an IPv6 address
        if (protocol.IPV6ADDRESS.test(components.host)) {
            //TODO: normalize IPv6 address as per RFC 5952
        }
        //if host component is a domain name
        else if (options.domainHost || (schemeHandler && schemeHandler.domainHost)) {
            //convert IDN via punycode
            try {
                components.host = (!options.iri ? punycode.toASCII(components.host.replace(protocol.PCT_ENCODED, pctDecChars).toLowerCase()) : punycode.toUnicode(components.host));
            }
            catch (e) {
                components.error = components.error || "Host's domain name can not be converted to " + (!options.iri ? "ASCII" : "Unicode") + " via punycode: " + e;
            }
        }
    }
    //normalize encoding
    _normalizeComponentEncoding(components, protocol);
    if (options.reference !== "suffix" && components.scheme) {
        uriTokens.push(components.scheme);
        uriTokens.push(":");
    }
    const authority = _recomposeAuthority(components, options);
    if (authority !== undefined) {
        if (options.reference !== "suffix") {
            uriTokens.push("//");
        }
        uriTokens.push(authority);
        if (components.path && components.path.charAt(0) !== "/") {
            uriTokens.push("/");
        }
    }
    if (components.path !== undefined) {
        let s = components.path;
        if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
            s = removeDotSegments(s);
        }
        if (authority === undefined) {
            s = s.replace(/^\/\//, "/%2F"); //don't allow the path to start with "//"
        }
        uriTokens.push(s);
    }
    if (components.query !== undefined) {
        uriTokens.push("?");
        uriTokens.push(components.query);
    }
    if (components.fragment !== undefined) {
        uriTokens.push("#");
        uriTokens.push(components.fragment);
    }
    return uriTokens.join(""); //merge tokens into a string
}
;
export function resolveComponents(base, relative, options = {}, skipNormalization) {
    const target = {};
    if (!skipNormalization) {
        base = parse(serialize(base, options), options); //normalize base components
        relative = parse(serialize(relative, options), options); //normalize relative components
    }
    options = options || {};
    if (!options.tolerant && relative.scheme) {
        target.scheme = relative.scheme;
        //target.authority = relative.authority;
        target.userinfo = relative.userinfo;
        target.host = relative.host;
        target.port = relative.port;
        target.path = removeDotSegments(relative.path || "");
        target.query = relative.query;
    }
    else {
        if (relative.userinfo !== undefined || relative.host !== undefined || relative.port !== undefined) {
            //target.authority = relative.authority;
            target.userinfo = relative.userinfo;
            target.host = relative.host;
            target.port = relative.port;
            target.path = removeDotSegments(relative.path || "");
            target.query = relative.query;
        }
        else {
            if (!relative.path) {
                target.path = base.path;
                if (relative.query !== undefined) {
                    target.query = relative.query;
                }
                else {
                    target.query = base.query;
                }
            }
            else {
                if (relative.path.charAt(0) === "/") {
                    target.path = removeDotSegments(relative.path);
                }
                else {
                    if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
                        target.path = "/" + relative.path;
                    }
                    else if (!base.path) {
                        target.path = relative.path;
                    }
                    else {
                        target.path = base.path.slice(0, base.path.lastIndexOf("/") + 1) + relative.path;
                    }
                    target.path = removeDotSegments(target.path);
                }
                target.query = relative.query;
            }
            //target.authority = base.authority;
            target.userinfo = base.userinfo;
            target.host = base.host;
            target.port = base.port;
        }
        target.scheme = base.scheme;
    }
    target.fragment = relative.fragment;
    return target;
}
;
export function resolve(baseURI, relativeURI, options) {
    const schemelessOptions = assign({ scheme: 'null' }, options);
    return serialize(resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true), schemelessOptions);
}
;
export function normalize(uri, options) {
    if (typeof uri === "string") {
        uri = serialize(parse(uri, options), options);
    }
    else if (typeOf(uri) === "object") {
        uri = parse(serialize(uri, options), options);
    }
    return uri;
}
;
export function equal(uriA, uriB, options) {
    if (typeof uriA === "string") {
        uriA = serialize(parse(uriA, options), options);
    }
    else if (typeOf(uriA) === "object") {
        uriA = serialize(uriA, options);
    }
    if (typeof uriB === "string") {
        uriB = serialize(parse(uriB, options), options);
    }
    else if (typeOf(uriB) === "object") {
        uriB = serialize(uriB, options);
    }
    return uriA === uriB;
}
;
export function escapeComponent(str, options) {
    return str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.ESCAPE : IRI_PROTOCOL.ESCAPE), pctEncChar);
}
;
export function unescapeComponent(str, options) {
    return str && str.toString().replace((!options || !options.iri ? URI_PROTOCOL.PCT_ENCODED : IRI_PROTOCOL.PCT_ENCODED), pctDecChars);
}
;
//# sourceMappingURL=uri.js.mapȔ[	xK{"version":3,"file":"uri.js","sourceRoot":"","sources":["../../src/uri.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAAO,YAAY,MAAM,eAAe,CAAC;AACzC,OAA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GAAU,EAAE,OAAmB;IAC9D,OAAO,GAAG,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,EAAE,UAAU,CAAC,CAAC;AAC1H,CAAC;AAAA,CAAC;AAEF,MAAM,4BAA4B,GAAU,EAAE,OAAmB;IAChE,OAAO,GAAG,IAAI,GAAG,CAAC,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,CAAC,CAAC,YAAY,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC,CAAC;AACrI,CAAC;AAAA,CAAC"}9h>xWexport declare function merge(...sets: Array<string>): string;
export declare function subexp(str: string): string;
export declare function typeOf(o: any): string;
export declare function toUpperCase(str: string): string;
export declare function toArray(obj: any): Array<any>;
export declare function assign(target: object, source: any): any;
<|RExZexport function merge(...sets) {
    if (sets.length > 1) {
        sets[0] = sets[0].slice(0, -1);
        const xl = sets.length - 1;
        for (let x = 1; x < xl; ++x) {
            sets[x] = sets[x].slice(1, -1);
        }
        sets[xl] = sets[xl].slice(1);
        return sets.join('');
    }
    else {
        return sets[0];
    }
}
export function subexp(str) {
    return "(?:" + str + ")";
}
export function typeOf(o) {
    return o === undefined ? "undefined" : (o === null ? "null" : Object.prototype.toString.call(o).split(" ").pop().split("]").shift().toLowerCase());
}
export function toUpperCase(str) {
    return str.toUpperCase();
}
export function toArray(obj) {
    return obj !== undefined && obj !== null ? (obj instanceof Array ? obj : (typeof obj.length !== "number" || obj.split || obj.setInterval || obj.call ? [obj] : Array.prototype.slice.call(obj))) : [];
}
export function assign(target, source) {
    const obj = target;
    if (source) {
        for (const key in source) {
            obj[key] = source[key];
        }
    }
    return obj;
}
//# sourceMapp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B,GAAU;IACrC,OAAO,GAAG,CAAC,WAAW,EAAE,CAAC;AAC1B,CAAC;AAED,MAAM,kBAAkB,GAAO;IAC9B,OAAO,GAAG,KAAK,SAAS,IAAI,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,GAAG,CAAC,MAAM,KAAK,QAAQ,IAAI,GAAG,CAAC,KAAK,IAAI,GAAG,CAAC,WAAW,IAAI,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AACvM,CAAC;AAGD,MAAM,iBAAiB,MAAc,EAAE,MAAW;IACjD,MAAM,GAAG,GAAG,MAAa,CAAC;IAC1B,IAAI,MAAM,EAAE;QACX,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;YACzB,GAAG,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;SACvB;KACD;IACD,OAAO,GAAG,CAAC;AACZ,CAAC"}S6x|{
  "name": "uri-js",
  "version": "4.4.1",
  "description": "An RFC 3986/3987 compliant, scheme extendable URI/IRI parsing/validating/resolving library for JavaScript.",
  "main": "dist/es5/uri.all.js",
  "types": "dist/es5/uri.all.d.ts",
  "directories": {
    "test": "tests"
  },
  "files": [
    "dist",
    "package.json",
    "yarn.lock",
    "README.md",
    "CHANGELOG",
    "LICENSE"
  ],
  "scripts": {
    "build:esnext": "tsc",
    "build:es5": "rollup -c && cp dist/esnext/uri.d.ts dist/es5/uri.all.d.ts && npm run build:es5:fix-sourcemap",
    "build:es5:fix-sourcemap": "sorcery -i dist/es5/uri.all.js",
    "build:es5:min": "uglifyjs dist/es5/uri.all.js --support-ie8 --output dist/es5/uri.all.min.js --in-source-map dist/es5/uri.all.js.map --source-map uri.all.min.js.map --comments --compress --mangle --pure-funcs merge subexp && mv uri.all.min.js.map dist/es5/ && cp dist/es5/uri.all.d.ts dist/es5/uri.all.min.d.ts",
    "build": "npm run build:esnext && npm run build:es5 && npm run build:es5:min",
    "clean": "rm -rf dist",
    "test": "mocha -u mocha-qunit-ui dist/es5/uri.all.js tests/tests.js"
  },
  "repository": {
    "type": "git",
    "url": "http://github.com/garycourt/uri-js"
  },
  "keywords": [
    "URI",
    "IRI",
    "IDN",
    "URN",
    "UUID",
    "HTTP",
    "HTTPS",
    "WS",
    "WSS",
    "MAILTO",
    "RFC3986",
    "RFC3987",
    "RFC5891",
    "RFC2616",
    "RFC2818",
    "RFC2141",
    "RFC4122",
    "RFC4291",
    "RFC5952",
    "RFC6068",
    "RFC6455",
    "RFC6874"
  ],
  "author": "Gary Court <gary.court@gmail.com>",
  "license": "BSD-2-Clause",
  "bugs": {
    "url": "https://github.com/garycourt/uri-js/issues"
  },
  "homepage": "https://github.com/garycourt/uri-js",
  "devDependencies": {
    "babel-cli": "^6.26.0",
    "babel-plugin-external-helpers": "^6.22.0",
    "babel-preset-latest": "^6.24.1",
    "mocha": "^8.2.1",
    "mocha-qunit-ui": "^0.1.3",
    "rollup": "^0.41.6",
    "rollup-plugin-babel": "^2.7.1",
    "rollup-plugin-node-resolve": "^2.0.0",
    "sorcery": "^0.10.0",
    "typescript": "^2.8.1",
    "uglify-js": "^2.8.14"
  },
  "dependencies": {
    "punycode": "^2.1.0"
  }
}
j82x   # THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1


"@ungap/promise-all-settled@1.1.2":
  version "1.1.2"
  resolved "https://registry.yarnpkg.com/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz#aa58042711d6e3275dd37dc597e5d31e8c290a44"
  integrity sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==

align-text@^0.1.1, align-text@^0.1.3:
  version "0.1.4"
  resolved "https://registry.yarnpkg.com/align-text/-/align-text-0.1.4.tgz#0cd90a561093f35d0a99256c22b7069433fad117"
  dependencies:
    kind-of "^3.0.2"
    longest "^1.0.1"
    repeat-string "^1.5.2"

ansi-colors@4.1.1:
  version "4.1.1"
  resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348"
  integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==

ansi-regex@^2.0.0:
  version "2.1.1"
  resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
  integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8=

ansi-regex@^3.0.0:
  version "3.0.0"
  resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
  integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=

ansi-regex@^4.1.0:
  version "4.1.0"
  resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997"
  integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==

ansi-styles@^2.2.1:
  version "2.2.1"
  resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe"
  integrity sha1-tDLdM1i2NM914eRmQ2gkBTPB3b4=

ansi-styles@^3.2.0:
  version "3.2.1"
  resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d"
  integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==
  dependencies:
    color-convert "^1.9.0"

ansi-styles@^4.1.0:
  version "4.3.0"
  resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
  integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
  dependencies:
    color-convert "^2.0.1"

anymatch@^1.3.0:
  version "1.3.2"
  resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-1.3.2.tgz#553dcb8f91e3c889845dfdba34c77721b90b9d7a"
  integrity sha512-0XNayC8lTHQ2OI8aljNCN3sSx6hsr/1+rlcDAotXJR7C1oZZHCNsfpbKwMjRA3Uqb5tF1Rae2oloTr4xpq+WjA==
  dependencies:
    micromatch "^2.1.5"
    normalize-path "^2.0.0"

anymatch@~3.1.1:
  version "3.1.1"
  resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.1.tgz#c55ecf02185e2469259399310c173ce31233b142"
  integrity sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==
  dependencies:
    normalize-path "^3.0.0"
    picomatch "^2.0.4"

argparse@^1.0.7:
  version "1.0.10"
  resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
  integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==
  dependencies:
    sprintf-js "~1.0.2"

arr-diff@^2.0.0:
  version "2.0.0"
  resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-2.0.0.tgz#8f3b827f955a8bd669697e4a4256ac3ceae356cf"
  integrity sha1-jzuCf5Vai9ZpaX5KQlasPOrjVs8=
  dependencies:
    arr-flatten "^1.0.1"

arr-diff@^4.0.0:
  version "4.0.0"
  resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520"
  integrity sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=

arr-flatten@^1.0.1, arr-flatten@^1.1.0:
  version "1.1.0"
  resolved "https://registry.yarnpkg.com/arr-flatten/-/arr-flatten-1.1.0.tgz#36048bbff4e7b47e136644316c99669ea5ae91f1"
  integrity sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==

arr-union@^3.1.0:
  version "3.1.0"
  resolved "https://registry.yarnpkg.com/arr-union/-/arr-union-3.1.0.tgz#e39b09aea9def866a8f206e288af63919bae39c4"
  integrity sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=

array-unique@^0.2.1:
  version "0.2.1"
  resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.2.1.tgz#a1d97ccafcbc2625cc70fadceb36a50c58b01a53"
  integrity sha1-odl8yvy8JiXMcPrc6zalDFiwGlM=

array-unique@^0.3.2:
  version "0.3.2"
  resolved "https://registry.yarnpkg.com/array-unique/-/array-unique-0.3.2.tgz#a894b75d4bc4f6cd679ef3244a9fd8f46ae2d428"
  integrity sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=

assign-symbols@^1.0.0:
  version "1.0.0"
  resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367"
  integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=

async-each@^1.0.0:
  version "1.0.3"
  resolved "https://registry.yarnpkg.com/async-each/-/async-each-1.0.3.tgz#b727dbf87d7651602f06f4d4ac387f47d91b0cbf"
  integrity sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==

atob@^2.1.2:
  version "2.1.2"
  resolved "https://registry.yarnpkg.com/atob/-/atob-2.1.2.tgz#6d9517eb9e030d2436666651e86bd9f6f13533c9"
  integrity sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==

babel-cli@^6.26.0:
  version "6.26.0"
  resolved "https://registry.yarnpkg.com/babel-cli/-/babel-cli-6.26.0.tgz#502ab54874d7db88ad00b887a06383ce03d002f1"
  integrity sha1-UCq1SHTX24itALiHoGODzgPQAvE=
  dependencies:
    babel-core "^6.26.0"
    babel-polyfill "^6.26.0"
    babel-register "^6.26.0"
    babel-runtime "^6.26.0"
    commander "^2.11.0"
    convert-source-map "^1.5.0"
    fs-readdir-recursive "^1.0.0"
    glob "^7.1.2"
    lodash "^4.17.4"
    output-file-sync "^1.1.2"
    path-is-absolute "^1.0.1"
    slash "^1.0.0"
    source-map "^0.5.6"
    v8flags "^2.1.1"
  optionalDependencies:
    chokidar "^1.6.1"

babel-code-frame@^6.26.0:
  version "6.26.0"
  resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b"
  integrity sha1-Y/1D99weO7fONZR9uP42mj9Yx0s=
  dependencies:
    chalk "^1.1.3"
    esutils "^2.0.2"
    js-tokens "^3.0.2"

babel-core@6:
  version "6.26.0"
  resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.0.tgz#af32f78b31a6fcef119c87b0fd8d9753f03a0bb8"
  dependencies:
    babel-code-frame "^6.26.0"
    babel-generator "^6.26.0"
    babel-helpers "^6.24.1"
    babel-messages "^6.23.0"
    babel-register "^6.26.0"
    babel-runtime "^6.26.0"
    babel-template "^6.26.0"
    babel-traverse "^6.26.0"
    babel-types "^6.26.0"
    babylon "^6.18.0"
    convert-source-map "^1.5.0"
    debug "^2.6.8"
    json5 "^0.5.1"
    lodash "^4.17.4"
    minimatch "^3.0.4"
    path-is-absolute "^1.0.1"
    private "^0.1.7"
    slash "^1.0.0"
    source-map "^0.5.6"

babel-core@^6.26.0:
  version "6.26.3"
  resolved "https://registry.yarnpkg.com/babel-core/-/babel-core-6.26.3.tgz#b2e2f09e342d0f0c88e2f02e067794125e75c207"
  integrity sha512-6jyFLuDmeidKmUEb3NM+/yawG0M2bDZ9Z1qbZP59cyHLz8kYGKYwpJP0UwUKKUiTRNvxfLesJnTedqczP7cTDA==
  dependencies:
    babel-code-frame "^6.26.0"
    babel-generator "^6.26.0"
    babel-helpers "^6.24.1"
    babel-messages "^6.23.0"
    babel-register "^6.26.0"
    babel-runtime "^6.26.0"
    babel-template "^6.26.0"
    babel-traverse "^6.26.0"
    babel-types "^6.26.0"
    babylon "^6.18.0"
    convert-source-map "^1.5.1"
    debug "^2.6.9"
    json5 "^0.5.1"
    lodash "^4.17.4"
    minimatch "^3.0.4"
    path-is-absolute "^1.0.1"
    private "^0.1.8"
    slash "^1.0.0"
    source-map "^0.5.7"

babel-generator@^6.26.0:
  version "6.26.1"
  resolved "https://registry.yarnpkg.com/babel-generator/-/babel-generator-6.26.1.tgz#1844408d3b8f0d35a404ea7ac180f087a601bd90"
  integrity sha512-HyfwY6ApZj7BYTcJURpM5tznulaBvyio7/0d4zFOeMPUmfxkCjHocCuoLa2SAGzBI8AREcH3eP3758F672DppA==
  dependencies:
    babel-messages "^6.23.0"
    babel-runtime "^6.26.0"
    babel-types "^6.26.0"
    detect-indent "^4.0.0"
    jsesc "^1.3.0"
    lodash "^4.17.4"
    source-map "^0.5.7"
    trim-right "^1.0.1"

babel-helper-builder-binary-assignment-operator-visitor@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-helper-builder-binary-assignment-operator-visitor/-/babel-helper-builder-binary-assignment-operator-visitor-6.24.1.tgz#cce4517ada356f4220bcae8a02c2b346f9a56664"
  dependencies:
    babel-helper-explode-assignable-expression "^6.24.1"
    babel-runtime "^6.22.0"
    babel-types "^6.24.1"

babel-helper-call-delegate@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-helper-call-delegate/-/babel-helper-call-delegate-6.24.1.tgz#ece6aacddc76e41c3461f88bfc575bd0daa2df8d"
  dependencies:
    babel-helper-hoist-variables "^6.24.1"
    babel-runtime "^6.22.0"
    babel-traverse "^6.24.1"
    babel-types "^6.24.1"

babel-helper-define-map@^6.24.1:
  version "6.26.0"
  resolved "https://registry.yarnpkg.com/babel-helper-define-map/-/babel-helper-define-map-6.26.0.tgz#a5f56dab41a25f97ecb498c7ebaca9819f95be5f"
  dependencies:
    babel-helper-function-name "^6.24.1"
    babel-runtime "^6.26.0"
    babel-types "^6.26.0"
    lodash "^4.17.4"

babel-helper-explode-assignable-expression@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-helper-explode-assignable-expression/-/babel-helper-explode-assignable-expression-6.24.1.tgz#f25b82cf7dc10433c55f70592d5746400ac22caa"
  dependencies:
    babel-runtime "^6.22.0"
    babel-traverse "^6.24.1"
    babel-types "^6.24.1"

babel-helper-function-name@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-helper-function-name/-/babel-helper-function-name-6.24.1.tgz#d3475b8c03ed98242a25b48351ab18399d3580a9"
  dependencies:
    babel-helper-get-function-arity "^6.24.1"
    babel-runtime "^6.22.0"
    babel-template "^6.24.1"
    babel-traverse "^6.24.1"
    babel-types "^6.24.1"

babel-helper-get-function-arity@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-helper-get-function-arity/-/babel-helper-get-function-arity-6.24.1.tgz#8f7782aa93407c41d3aa50908f89b031b1b6853d"
  dependencies:
    babel-runtime "^6.22.0"
    babel-types "^6.24.1"

babel-helper-hoist-variables@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-helper-hoist-variables/-/babel-helper-hoist-variables-6.24.1.tgz#1ecb27689c9d25513eadbc9914a73f5408be7a76"
  dependencies:
    babel-runtime "^6.22.0"
    babel-types "^6.24.1"

babel-helper-optimise-call-expression@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-helper-optimise-call-expression/-/babel-helper-optimise-call-expression-6.24.1.tgz#f7a13427ba9f73f8f4fa993c54a97882d1244257"
  dependencies:
    babel-runtime "^6.22.0"
    babel-types "^6.24.1"

babel-helper-regex@^6.24.1:
  version "6.26.0"
  resolved "https://registry.yarnpkg.com/babel-helper-regex/-/babel-helper-regex-6.26.0.tgz#325c59f902f82f24b74faceed0363954f6495e72"
  dependencies:
    babel-runtime "^6.26.0"
    babel-types "^6.26.0"
    lodash "^4.17.4"

babel-helper-remap-async-to-generator@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-helper-remap-async-to-generator/-/babel-helper-remap-async-to-generator-6.24.1.tgz#5ec581827ad723fecdd381f1c928390676e4551b"
  dependencies:
    babel-helper-function-name "^6.24.1"
    babel-runtime "^6.22.0"
    babel-template "^6.24.1"
    babel-traverse "^6.24.1"
    babel-types "^6.24.1"

babel-helper-replace-supers@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-helper-replace-supers/-/babel-helper-replace-supers-6.24.1.tgz#bf6dbfe43938d17369a213ca8a8bf74b6a90ab1a"
  dependencies:
    babel-helper-optimise-call-expression "^6.24.1"
    babel-messages "^6.23.0"
    babel-runtime "^6.22.0"
    babel-template "^6.24.1"
    babel-traverse "^6.24.1"
    babel-types "^6.24.1"

babel-helpers@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-helpers/-/babel-helpers-6.24.1.tgz#3471de9caec388e5c850e597e58a26ddf37602b2"
  integrity sha1-NHHenK7DiOXIUOWX5Yom3fN2ArI=
  dependencies:
    babel-runtime "^6.22.0"
    babel-template "^6.24.1"

babel-messages@^6.23.0:
  version "6.23.0"
  resolved "https://registry.yarnpkg.com/babel-messages/-/babel-messages-6.23.0.tgz#f3cdf4703858035b2a2951c6ec5edf6c62f2630e"
  integrity sha1-8830cDhYA1sqKVHG7F7fbGLyYw4=
  dependencies:
    babel-runtime "^6.22.0"

babel-plugin-check-es2015-constants@^6.22.0:
  version "6.22.0"
  resolved "https://registry.yarnpkg.com/babel-plugin-check-es2015-constants/-/babel-plugin-check-es2015-constants-6.22.0.tgz#35157b101426fd2ffd3da3f75c7d1e91835bbf8a"
  dependencies:
    babel-runtime "^6.22.0"

babel-plugin-external-helpers@^6.22.0:
  version "6.22.0"
  resolved "https://registry.yarnpkg.com/babel-plugin-external-helpers/-/babel-plugin-external-helpers-6.22.0.tgz#2285f48b02bd5dede85175caf8c62e86adccefa1"
  dependencies:
    babel-runtime "^6.22.0"

babel-plugin-syntax-async-functions@^6.8.0:
  version "6.13.0"
  resolved "https://registry.yarnpkg.com/babel-plugin-syntax-async-functions/-/babel-plugin-syntax-async-functions-6.13.0.tgz#cad9cad1191b5ad634bf30ae0872391e0647be95"

babel-plugin-syntax-exponentiation-operator@^6.8.0:
  version "6.13.0"
  resolved "https://registry.yarnpkg.com/babel-plugin-syntax-exponentiation-operator/-/babel-plugin-syntax-exponentiation-operator-6.13.0.tgz#9ee7e8337290da95288201a6a57f4170317830de"

babel-plugin-syntax-trailing-function-commas@^6.22.0:
  version "6.22.0"
  resolved "https://registry.yarnpkg.com/babel-plugin-syntax-trailing-function-commas/-/babel-plugin-syntax-trailing-function-commas-6.22.0.tgz#ba0360937f8d06e40180a43fe0d5616fff532cf3"

babel-plugin-transform-async-to-generator@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-async-to-generator/-/babel-plugin-transform-async-to-generator-6.24.1.tgz#6536e378aff6cb1d5517ac0e40eb3e9fc8d08761"
  dependencies:
    babel-helper-remap-async-to-generator "^6.24.1"
    babel-plugin-syntax-async-functions "^6.8.0"
    babel-runtime "^6.22.0"

babel-plugin-transform-es2015-arrow-functions@^6.22.0:
  version "6.22.0"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-arrow-functions/-/babel-plugin-transform-es2015-arrow-functions-6.22.0.tgz#452692cb711d5f79dc7f85e440ce41b9f244d221"
  dependencies:
    babel-runtime "^6.22.0"

babel-plugin-transform-es2015-block-scoped-functions@^6.22.0:
  version "6.22.0"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoped-functions/-/babel-plugin-transform-es2015-block-scoped-functions-6.22.0.tgz#bbc51b49f964d70cb8d8e0b94e820246ce3a6141"
  dependencies:
    babel-runtime "^6.22.0"

babel-plugin-transform-es2015-block-scoping@^6.24.1:
  version "6.26.0"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-block-scoping/-/babel-plugin-transform-es2015-block-scoping-6.26.0.tgz#d70f5299c1308d05c12f463813b0a09e73b1895f"
  dependencies:
    babel-runtime "^6.26.0"
    babel-template "^6.26.0"
    babel-traverse "^6.26.0"
    babel-types "^6.26.0"
    lodash "^4.17.4"

babel-plugin-transform-es2015-classes@^6.24.1, babel-plugin-transform-es2015-classes@^6.9.0:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-classes/-/babel-plugin-transform-es2015-classes-6.24.1.tgz#5a4c58a50c9c9461e564b4b2a3bfabc97a2584db"
  dependencies:
    babel-helper-define-map "^6.24.1"
    babel-helper-function-name "^6.24.1"
    babel-helper-optimise-call-expression "^6.24.1"
    babel-helper-replace-supers "^6.24.1"
    babel-messages "^6.23.0"
    babel-runtime "^6.22.0"
    babel-template "^6.24.1"
    babel-traverse "^6.24.1"
    babel-types "^6.24.1"

babel-plugin-transform-es2015-computed-properties@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-computed-properties/-/babel-plugin-transform-es2015-computed-properties-6.24.1.tgz#6fe2a8d16895d5634f4cd999b6d3480a308159b3"
  dependencies:
    babel-runtime "^6.22.0"
    babel-template "^6.24.1"

babel-plugin-transform-es2015-destructuring@^6.22.0:
  version "6.23.0"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-destructuring/-/babel-plugin-transform-es2015-destructuring-6.23.0.tgz#997bb1f1ab967f682d2b0876fe358d60e765c56d"
  dependencies:
    babel-runtime "^6.22.0"

babel-plugin-transform-es2015-duplicate-keys@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-duplicate-keys/-/babel-plugin-transform-es2015-duplicate-keys-6.24.1.tgz#73eb3d310ca969e3ef9ec91c53741a6f1576423e"
  dependencies:
    babel-runtime "^6.22.0"
    babel-types "^6.24.1"

babel-plugin-transform-es2015-for-of@^6.22.0:
  version "6.23.0"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-for-of/-/babel-plugin-transform-es2015-for-of-6.23.0.tgz#f47c95b2b613df1d3ecc2fdb7573623c75248691"
  dependencies:
    babel-runtime "^6.22.0"

babel-plugin-transform-es2015-function-name@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-function-name/-/babel-plugin-transform-es2015-function-name-6.24.1.tgz#834c89853bc36b1af0f3a4c5dbaa94fd8eacaa8b"
  dependencies:
    babel-helper-function-name "^6.24.1"
    babel-runtime "^6.22.0"
    babel-types "^6.24.1"

babel-plugin-transform-es2015-literals@^6.22.0:
  version "6.22.0"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-literals/-/babel-plugin-transform-es2015-literals-6.22.0.tgz#4f54a02d6cd66cf915280019a31d31925377ca2e"
  dependencies:
    babel-runtime "^6.22.0"

babel-plugin-transform-es2015-modules-amd@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-amd/-/babel-plugin-transform-es2015-modules-amd-6.24.1.tgz#3b3e54017239842d6d19c3011c4bd2f00a00d154"
  dependencies:
    babel-plugin-transform-es2015-modules-commonjs "^6.24.1"
    babel-runtime "^6.22.0"
    babel-template "^6.24.1"

babel-plugin-transform-es2015-modules-commonjs@^6.24.1:
  version "6.26.0"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-commonjs/-/babel-plugin-transform-es2015-modules-commonjs-6.26.0.tgz#0d8394029b7dc6abe1a97ef181e00758dd2e5d8a"
  dependencies:
    babel-plugin-transform-strict-mode "^6.24.1"
    babel-runtime "^6.26.0"
    babel-template "^6.26.0"
    babel-types "^6.26.0"

babel-plugin-transform-es2015-modules-systemjs@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-systemjs/-/babel-plugin-transform-es2015-modules-systemjs-6.24.1.tgz#ff89a142b9119a906195f5f106ecf305d9407d23"
  dependencies:
    babel-helper-hoist-variables "^6.24.1"
    babel-runtime "^6.22.0"
    babel-template "^6.24.1"

babel-plugin-transform-es2015-modules-umd@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-modules-umd/-/babel-plugin-transform-es2015-modules-umd-6.24.1.tgz#ac997e6285cd18ed6176adb607d602344ad38468"
  dependencies:
    babel-plugin-transform-es2015-modules-amd "^6.24.1"
    babel-runtime "^6.22.0"
    babel-template "^6.24.1"

babel-plugin-transform-es2015-object-super@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-object-super/-/babel-plugin-transform-es2015-object-super-6.24.1.tgz#24cef69ae21cb83a7f8603dad021f572eb278f8d"
  dependencies:
    babel-helper-replace-supers "^6.24.1"
    babel-runtime "^6.22.0"

babel-plugin-transform-es2015-parameters@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-parameters/-/babel-plugin-transform-es2015-parameters-6.24.1.tgz#57ac351ab49caf14a97cd13b09f66fdf0a625f2b"
  dependencies:
    babel-helper-call-delegate "^6.24.1"
    babel-helper-get-function-arity "^6.24.1"
    babel-runtime "^6.22.0"
    babel-template "^6.24.1"
    babel-traverse "^6.24.1"
    babel-types "^6.24.1"

babel-plugin-transform-es2015-shorthand-properties@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-shorthand-properties/-/babel-plugin-transform-es2015-shorthand-properties-6.24.1.tgz#24f875d6721c87661bbd99a4622e51f14de38aa0"
  dependencies:
    babel-runtime "^6.22.0"
    babel-types "^6.24.1"

babel-plugin-transform-es2015-spread@^6.22.0:
  version "6.22.0"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-spread/-/babel-plugin-transform-es2015-spread-6.22.0.tgz#d6d68a99f89aedc4536c81a542e8dd9f1746f8d1"
  dependencies:
    babel-runtime "^6.22.0"

babel-plugin-transform-es2015-sticky-regex@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-sticky-regex/-/babel-plugin-transform-es2015-sticky-regex-6.24.1.tgz#00c1cdb1aca71112cdf0cf6126c2ed6b457ccdbc"
  dependencies:
    babel-helper-regex "^6.24.1"
    babel-runtime "^6.22.0"
    babel-types "^6.24.1"

babel-plugin-transform-es2015-template-literals@^6.22.0:
  version "6.22.0"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-template-literals/-/babel-plugin-transform-es2015-template-literals-6.22.0.tgz#a84b3450f7e9f8f1f6839d6d687da84bb1236d8d"
  dependencies:
    babel-runtime "^6.22.0"

babel-plugin-transform-es2015-typeof-symbol@^6.22.0:
  version "6.23.0"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-typeof-symbol/-/babel-plugin-transform-es2015-typeof-symbol-6.23.0.tgz#dec09f1cddff94b52ac73d505c84df59dcceb372"
  dependencies:
    babel-runtime "^6.22.0"

babel-plugin-transform-es2015-unicode-regex@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-es2015-unicode-regex/-/babel-plugin-transform-es2015-unicode-regex-6.24.1.tgz#d38b12f42ea7323f729387f18a7c5ae1faeb35e9"
  dependencies:
    babel-helper-regex "^6.24.1"
    babel-runtime "^6.22.0"
    regexpu-core "^2.0.0"

babel-plugin-transform-exponentiation-operator@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-exponentiation-operator/-/babel-plugin-transform-exponentiation-operator-6.24.1.tgz#2ab0c9c7f3098fa48907772bb813fe41e8de3a0e"
  dependencies:
    babel-helper-builder-binary-assignment-operator-visitor "^6.24.1"
    babel-plugin-syntax-exponentiation-operator "^6.8.0"
    babel-runtime "^6.22.0"

babel-plugin-transform-regenerator@^6.24.1:
  version "6.26.0"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-regenerator/-/babel-plugin-transform-regenerator-6.26.0.tgz#e0703696fbde27f0a3efcacf8b4dca2f7b3a8f2f"
  dependencies:
    regenerator-transform "^0.10.0"

babel-plugin-transform-strict-mode@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-plugin-transform-strict-mode/-/babel-plugin-transform-strict-mode-6.24.1.tgz#d5faf7aa578a65bbe591cf5edae04a0c67020758"
  dependencies:
    babel-runtime "^6.22.0"
    babel-types "^6.24.1"

babel-polyfill@^6.26.0:
  version "6.26.0"
  resolved "https://registry.yarnpkg.com/babel-polyfill/-/babel-polyfill-6.26.0.tgz#379937abc67d7895970adc621f284cd966cf2153"
  integrity sha1-N5k3q8Z9eJWXCtxiHyhM2WbPIVM=
  dependencies:
    babel-runtime "^6.26.0"
    core-js "^2.5.0"
    regenerator-runtime "^0.10.5"

babel-preset-es2015@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-preset-es2015/-/babel-preset-es2015-6.24.1.tgz#d44050d6bc2c9feea702aaf38d727a0210538939"
  dependencies:
    babel-plugin-check-es2015-constants "^6.22.0"
    babel-plugin-transform-es2015-arrow-functions "^6.22.0"
    babel-plugin-transform-es2015-block-scoped-functions "^6.22.0"
    babel-plugin-transform-es2015-block-scoping "^6.24.1"
    babel-plugin-transform-es2015-classes "^6.24.1"
    babel-plugin-transform-es2015-computed-properties "^6.24.1"
    babel-plugin-transform-es2015-destructuring "^6.22.0"
    babel-plugin-transform-es2015-duplicate-keys "^6.24.1"
    babel-plugin-transform-es2015-for-of "^6.22.0"
    babel-plugin-transform-es2015-function-name "^6.24.1"
    babel-plugin-transform-es2015-literals "^6.22.0"
    babel-plugin-transform-es2015-modules-amd "^6.24.1"
    babel-plugin-transform-es2015-modules-commonjs "^6.24.1"
    babel-plugin-transform-es2015-modules-systemjs "^6.24.1"
    babel-plugin-transform-es2015-modules-umd "^6.24.1"
    babel-plugin-transform-es2015-object-super "^6.24.1"
    babel-plugin-transform-es2015-parameters "^6.24.1"
    babel-plugin-transform-es2015-shorthand-properties "^6.24.1"
    babel-plugin-transform-es2015-spread "^6.22.0"
    babel-plugin-transform-es2015-sticky-regex "^6.24.1"
    babel-plugin-transform-es2015-template-literals "^6.22.0"
    babel-plugin-transform-es2015-typeof-symbol "^6.22.0"
    babel-plugin-transform-es2015-unicode-regex "^6.24.1"
    babel-plugin-transform-regenerator "^6.24.1"

babel-preset-es2016@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-preset-es2016/-/babel-preset-es2016-6.24.1.tgz#f900bf93e2ebc0d276df9b8ab59724ebfd959f8b"
  dependencies:
    babel-plugin-transform-exponentiation-operator "^6.24.1"

babel-preset-es2017@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-preset-es2017/-/babel-preset-es2017-6.24.1.tgz#597beadfb9f7f208bcfd8a12e9b2b29b8b2f14d1"
  dependencies:
    babel-plugin-syntax-trailing-function-commas "^6.22.0"
    babel-plugin-transform-async-to-generator "^6.24.1"

babel-preset-latest@^6.24.1:
  version "6.24.1"
  resolved "https://registry.yarnpkg.com/babel-preset-latest/-/babel-preset-latest-6.24.1.tgz#677de069154a7485c2d25c577c02f624b85b85e8"
  dependencies:
    babel-preset-es2015 "^6.24.1"
    babel-preset-es2016 "^6.24.1"
    babel-preset-es2017 "^6.24.1"

babel-register@^6.26.0:
  version "6.26.0"
  resolved "https://registry.yarnpkg.com/babel-register/-/babel-register-6.26.0.tgz#6ed021173e2fcb486d7acb45c6009a856f647071"
  integrity sha1-btAhFz4vy0htestFxgCahW9kcHE=
  dependencies:
    babel-core "^6.26.0"
    babel-runtime "^6.26.0"
    core-js "^2.5.0"
    home-or-tmp "^2.0.0"
    lodash "^4.17.4"
    mkdirp "^0.5.1"
    source-map-support "^0.4.15"

babel-runtime@^6.18.0, babel-runtime@^6.22.0, babel-runtime@^6.26.0:
  version "6.26.0"
  resolved "https://registry.yarnpkg.com/babel-runtime/-/babel-runtime-6.26.0.tgz#965c7058668e82b55d7bfe04ff2337bc8b5647fe"
  integrity sha1-llxwWGaOgrVde/4E/yM3vItWR/4=
  dependencies:
    core-js "^2.4.0"
    regenerator-runtime "^0.11.0"

babel-template@^6.24.1, babel-template@^6.26.0:
  version "6.26.0"
  resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02"
  integrity sha1-3gPi0WOWsGn0bdn/+FIfsaDjXgI=
  dependencies:
    babel-runtime "^6.26.0"
    babel-traverse "^6.26.0"
    babel-types "^6.26.0"
    babylon "^6.18.0"
    lodash "^4.17.4"

babel-traverse@^6.24.1, babel-traverse@^6.26.0:
  version "6.26.0"
  resolved "https://registry.yarnpkg.com/babel-traverse/-/babel-traverse-6.26.0.tgz#46a9cbd7edcc62c8e5c064e2d2d8d0f4035766ee"
  dependencies:
    babel-code-frame "^6.26.0"
    babel-messages "^6.23.0"
    babel-runtime "^6.26.0"
    babel-types "^6.26.0"
    babylon "^6.18.0"
    debug "^2.6.8"
    globals "^9.18.0"
    invariant "^2.2.2"
    lodash "^4.17.4"

babel-types@^6.19.0, babel-types@^6.24.1, babel-types@^6.26.0:
  version "6.26.0"
  resolved "https://registry.yarnpkg.com/babel-types/-/babel-types-6.26.0.tgz#a3b073f94ab49eb6fa55cd65227a334380632497"
  dependencies:
    babel-runtime "^6.26.0"
    esutils "^2.0.2"
    lodash "^4.17.4"
    to-fast-properties "^1.0.3"

babylon@^6.18.0:
  version "6.18.0"
  resolved "https://registry.yarnpkg.com/babylon/-/babylon-6.18.0.tgz#af2f3b88fa6f5c1e4c634d1a0f8eac4f55b395e3"
  integrity sha512-q/UEjfGJ2Cm3oKV71DJz9d25TPnq5rhBVL2Q4fA5wcC3jcrdn7+SssEybFIxwAvvP+YCsCYNKughoF33GxgycQ==

balanced-match@^1.0.0:
  version "1.0.0"
  resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.0.tgz#89b4d199ab2bee49de164ea02b89ce462d71b767"
  integrity sha1-ibTRmasr7kneFk6gK4nORi1xt2c=

base@^0.11.1:
  version "0.11.2"
  resolved "https://registry.yarnpkg.com/base/-/base-0.11.2.tgz#7bde5ced145b6d551a90db87f83c558b4eb48a8f"
  integrity sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==
  dependencies:
    cache-base "^1.0.1"
    class-utils "^0.3.5"
    component-emitter "^1.2.1"
    define-property "^1.0.0"
    isobject "^3.0.1"
    mixin-deep "^1.2.0"
    pascalcase "^0.1.1"

binary-extensions@^1.0.0:
  version "1.13.1"
  resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-1.13.1.tgz#598afe54755b2868a5330d2aff9d4ebb53209b65"
  integrity sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==

binary-extensions@^2.0.0:
  version "2.1.0"
  resolved "https://registry.yarnpkg.com/binary-extensions/-/binary-extensions-2.1.0.tgz#30fa40c9e7fe07dbc895678cd287024dea241dd9"
  integrity sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==

bindings@^1.5.0:
  version "1.5.0"
  resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df"
  integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==
  dependencies:
    file-uri-to-path "1.0.0"

brace-expansion@^1.1.7:
  version "1.1.11"
  resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd"
  integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==
  dependencies:
    balanced-match "^1.0.0"
    concat-map "0.0.1"

braces@^1.8.2:
  version "1.8.5"
  resolved "https://registry.yarnpkg.com/braces/-/braces-1.8.5.tgz#ba77962e12dff969d6b76711e914b737857bf6a7"
  integrity sha1-uneWLhLf+WnWt2cR6RS3N4V79qc=
  dependencies:
    expand-range "^1.8.1"
    preserve "^0.2.0"
    repeat-element "^1.1.2"

braces@^2.3.1:
  version "2.3.2"
  resolved "https://registry.yarnpkg.com/braces/-/braces-2.3.2.tgz#5979fd3f14cd531565e5fa2df1abfff1dfaee729"
  integrity sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==
  dependencies:
    arr-flatten "^1.1.0"
    array-unique "^0.3.2"
    extend-shallow "^2.0.1"
    fill-range "^4.0.0"
    isobject "^3.0.1"
    repeat-element "^1.1.2"
    snapdragon "^0.8.1"
    snapdragon-node "^2.0.1"
    split-string "^3.0.2"
    to-regex "^3.0.1"

braces@~3.0.2:
  version "3.0.2"
  resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107"
  integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==
  dependencies:
    fill-range "^7.0.1"

browser-resolve@^1.11.0:
  version "1.11.2"
  resolved "https://registry.yarnpkg.com/browser-resolve/-/browser-resolve-1.11.2.tgz#8ff09b0a2c421718a1051c260b32e48f442938ce"
  dependencies:
    resolve "1.1.7"

browser-stdout@1.3.1:
  version "1.3.1"
  resolved "https://registry.yarnpkg.com/browser-stdout/-/browser-stdout-1.3.1.tgz#baa559ee14ced73452229bad7326467c61fabd60"
  integrity sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==

buffer-crc32@^0.2.5:
  version "0.2.13"
  resolved "https://registry.yarnpkg.com/buffer-crc32/-/buffer-crc32-0.2.13.tgz#0d333e3f00eac50aa1454abd30ef8c2a5d9a7242"

builtin-modules@^1.1.0:
  version "1.1.1"
  resolved "https://registry.yarnpkg.com/builtin-modules/-/builtin-modules-1.1.1.tgz#270f076c5a72c02f5b65a47df94c5fe3a278892f"

cache-base@^1.0.1:
  version "1.0.1"
  resolved "https://registry.yarnpkg.com/cache-base/-/cache-base-1.0.1.tgz#0a7f46416831c8b662ee36fe4e7c59d76f666ab2"
  integrity sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==
  dependencies:
    collection-visit "^1.0.0"
    component-emitter "^1.2.1"
    get-value "^2.0.6"
    has-value "^1.0.0"
    isobject "^3.0.1"
    set-value "^2.0.0"
    to-object-path "^0.3.0"
    union-value "^1.0.0"
    unset-value "^1.0.0"

camelcase@^1.0.2:
  version "1.2.1"
  resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-1.2.1.tgz#9bb5304d2e0b56698b2c758b08a3eaa9daa58a39"

camelcase@^5.0.0:
  version "5.3.1"
  resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320"
  integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==

camelcase@^6.0.0:
  version "6.2.0"
  resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-6.2.0.tgz#924af881c9d525ac9d87f40d964e5cea982a1809"
  integrity sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==

center-align@^0.1.1:
  version "0.1.3"
  resolved "https://registry.yarnpkg.com/center-align/-/center-align-0.1.3.tgz#aa0d32629b6ee972200411cbd4461c907bc2b7ad"
  dependencies:
    align-text "^0.1.3"
    lazy-cache "^1.0.3"

chalk@^1.1.3:
  version "1.1.3"
  resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98"
  integrity sha1-qBFcVeSnAv5NFQq9OHKCKn4J/Jg=
  dependencies:
    ansi-styles "^2.2.1"
    escape-string-regexp "^1.0.2"
    has-ansi "^2.0.0"
    strip-ansi "^3.0.0"
    supports-color "^2.0.0"

chalk@^4.0.0:
  version "4.1.0"
  resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.0.tgz#4e14870a618d9e2edd97dd8345fd9d9dc315646a"
  integrity sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==
  dependencies:
    ansi-styles "^4.1.0"
    supports-color "^7.1.0"

chokidar@3.4.3:
  version "3.4.3"
  resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.4.3.tgz#c1df38231448e45ca4ac588e6c79573ba6a57d5b"
  integrity sha512-DtM3g7juCXQxFVSNPNByEC2+NImtBuxQQvWlHunpJIS5Ocr0lG306cC7FCi7cEA0fzmybPUIl4txBIobk1gGOQ==
  dependencies:
    anymatch "~3.1.1"
    braces "~3.0.2"
    glob-parent "~5.1.0"
    is-binary-path "~2.1.0"
    is-glob "~4.0.1"
    normalize-path "~3.0.0"
    readdirp "~3.5.0"
  optionalDependencies:
    fsevents "~2.1.2"

chokidar@^1.6.1:
  version "1.7.0"
  resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-1.7.0.tgz#798e689778151c8076b4b360e5edd28cda2bb468"
  integrity sha1-eY5ol3gVHIB2tLNg5e3SjNortGg=
  dependencies:
    anymatch "^1.3.0"
    async-each "^1.0.0"
    glob-parent "^2.0.0"
    inherits "^2.0.1"
    is-binary-path "^1.0.0"
    is-glob "^2.0.0"
    path-is-absolute "^1.0.0"
    readdirp "^2.0.0"
  optionalDependencies:
    fsevents "^1.0.0"

class-utils@^0.3.5:
  version "0.3.6"
  resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463"
  integrity sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==
  dependencies:
    arr-union "^3.1.0"
    define-property "^0.2.5"
    isobject "^3.0.0"
    static-extend "^0.1.1"

cliui@^2.1.0:
  version "2.1.0"
  resolved "https://registry.yarnpkg.com/cliui/-/cliui-2.1.0.tgz#4b475760ff80264c762c3a1719032e91c7fea0d1"
  dependencies:
    center-align "^0.1.1"
    right-align "^0.1.1"
    wordwrap "0.0.2"

cliui@^5.0.0:
  version "5.0.0"
  resolved "https://registry.yarnpkg.com/cliui/-/cliui-5.0.0.tgz#deefcfdb2e800784aa34f46fa08e06851c7bbbc5"
  integrity sha512-PYeGSEmmHM6zvoef2w8TPzlrnNpXIjTipYK780YswmIP9vjxmd6Y2a3CB2Ks6/AU8NHjZugXvo8w3oWM2qnwXA==
  dependencies:
    string-width "^3.1.0"
    strip-ansi "^5.2.0"
    wrap-ansi "^5.1.0"

collection-visit@^1.0.0:
  version "1.0.0"
  resolved "https://registry.yarnpkg.com/collection-visit/-/collection-visit-1.0.0.tgz#4bc0373c164bc3291b4d368c829cf1a80a59dca0"
  integrity sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=
  dependencies:
    map-visit "^1.0.0"
    object-visit "^1.0.0"

color-convert@^1.9.0:
  version "1.9.3"
  resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8"
  integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==
  dependencies:
    color-name "1.1.3"

color-convert@^2.0.1:
  version "2.0.1"
  resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
  integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
  dependencies:
    color-name "~1.1.4"

color-name@1.1.3:
  version "1.1.3"
  resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25"
  integrity sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=

color-name@~1.1.4:
  version "1.1.4"
  resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
  integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==

commander@^2.11.0:
  version "2.20.3"
  resolved "https://registry.yarnpkg.com/commander/-/commander-2.20.3.tgz#fd485e84c03eb4881c20722ba48035e8531aeb33"
  integrity sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==

component-emitter@^1.2.1:
  version "1.3.0"
  resolved "https://registry.yarnpkg.com/component-emitter/-/component-emitter-1.3.0.tgz#16e4070fba8ae29b679f2215853ee181ab2eabc0"
  integrity sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==

concat-map@0.0.1:
  version "0.0.1"
  resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
  integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=

convert-source-map@^1.5.0, convert-source-map@^1.5.1:
  version "1.7.0"
  resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.7.0.tgz#17a2cb882d7f77d3490585e2ce6c524424a3a442"
  integrity sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==
  dependencies:
    safe-buffer "~5.1.1"

copy-descriptor@^0.1.0:
  version "0.1.1"
  resolved "https://registry.yarnpkg.com/copy-descriptor/-/copy-descriptor-0.1.1.tgz#676f6eb3c39997c2ee1ac3a924fd6124748f578d"
  integrity sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=

core-js@^2.4.0, core-js@^2.5.0:
  version "2.6.12"
  resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.12.tgz#d9333dfa7b065e347cc5682219d6f690859cc2ec"
  integrity sha512-Kb2wC0fvsWfQrgk8HU5lW6U/Lcs8+9aaYcy4ZFc6DDlo4nZ7n70dEgE5rtR0oG6ufKDUnrwfWL1mXR5ljDatrQ==

core-util-is@~1.0.0:
  version "1.0.2"
  resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
  integrity sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=

debug@4.2.0:
  version "4.2.0"
  resolved "https://registry.yarnpkg.com/debug/-/debug-4.2.0.tgz#7f150f93920e94c58f5574c2fd01a3110effe7f1"
  integrity sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==
  dependencies:
    ms "2.1.2"

debug@^2.2.0, debug@^2.3.3, debug@^2.6.8, debug@^2.6.9:
  version "2.6.9"
  resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
  integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==
  dependencies:
    ms "2.0.0"

decamelize@^1.0.0, decamelize@^1.2.0:
  version "1.2.0"
  resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290"

decamelize@^4.0.0:
  version "4.0.0"
  resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-4.0.0.tgz#aa472d7bf660eb15f3494efd531cab7f2a709837"
  integrity sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==

decode-uri-component@^0.2.0:
  version "0.2.0"
  resolved "https://registry.yarnpkg.com/decode-uri-component/-/decode-uri-component-0.2.0.tgz#eb3913333458775cb84cd1a1fae062106bb87545"
  integrity sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=

define-property@^0.2.5:
  version "0.2.5"
  resolved "https://registry.yarnpkg.com/define-property/-/define-property-0.2.5.tgz#c35b1ef918ec3c990f9a5bc57be04aacec5c8116"
  integrity sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=
  dependencies:
    is-descriptor "^0.1.0"

define-property@^1.0.0:
  version "1.0.0"
  resolved "https://registry.yarnpkg.com/define-property/-/define-property-1.0.0.tgz#769ebaaf3f4a63aad3af9e8d304c9bbe79bfb0e6"
  integrity sha1-dp66rz9KY6rTr56NMEybvnm/sOY=
  dependencies:
    is-descriptor "^1.0.0"

define-property@^2.0.2:
  version "2.0.2"
  resolved "https://registry.yarnpkg.com/define-property/-/define-property-2.0.2.tgz#d459689e8d654ba77e02a817f8710d702cb16e9d"
  integrity sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==
  dependencies:
    is-descriptor "^1.0.2"
    isobject "^3.0.1"

detect-indent@^4.0.0:
  version "4.0.0"
  resolved "https://registry.yarnpkg.com/detect-indent/-/detect-indent-4.0.0.tgz#f76d064352cdf43a1cb6ce619c4ee3a9475de208"
  integrity sha1-920GQ1LN9Docts5hnE7jqUdd4gg=
  dependencies:
    repeating "^2.0.0"

diff@4.0.2:
  version "4.0.2"
  resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
  integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==

emoji-regex@^7.0.1:
  version "7.0.3"
  resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156"
  integrity sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==

es6-promise@^3.1.2:
  version "3.3.1"
  resolved "https://registry.yarnpkg.com/es6-promise/-/es6-promise-3.3.1.tgz#a08cdde84ccdbf34d027a1451bc91d4bcd28a613"

escape-string-regexp@4.0.0:
  version "4.0.0"
  resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34"
  integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==

escape-string-regexp@^1.0.2:
  version "1.0.5"
  resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
  integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=

esprima@^4.0.0:
  version "4.0.1"
  resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71"
  integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==

estree-walker@^0.2.1:
  version "0.2.1"
  resolved "https://registry.yarnpkg.com/estree-walker/-/estree-walker-0.2.1.tgz#bdafe8095383d8414d5dc2ecf4c9173b6db9412e"

esutils@^2.0.2:
  version "2.0.3"
  resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64"
  integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==

expand-brackets@^0.1.4:
  version "0.1.5"
  resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-0.1.5.tgz#df07284e342a807cd733ac5af72411e581d1177b"
  integrity sha1-3wcoTjQqgHzXM6xa9yQR5YHRF3s=
  dependencies:
    is-posix-bracket "^0.1.0"

expand-brackets@^2.1.4:
  version "2.1.4"
  resolved "https://registry.yarnpkg.com/expand-brackets/-/expand-brackets-2.1.4.tgz#b77735e315ce30f6b6eff0f83b04151a22449622"
  integrity sha1-t3c14xXOMPa27/D4OwQVGiJEliI=
  dependencies:
    debug "^2.3.3"
    define-property "^0.2.5"
    extend-shallow "^2.0.1"
    posix-character-classes "^0.1.0"
    regex-not "^1.0.0"
    snapdragon "^0.8.1"
    to-regex "^3.0.1"

expand-range@^1.8.1:
  version "1.8.2"
  resolved "https://registry.yarnpkg.com/expand-range/-/expand-range-1.8.2.tgz#a299effd335fe2721ebae8e257ec79644fc85337"
  integrity sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=
  dependencies:
    fill-range "^2.1.0"

extend-shallow@^2.0.1:
  version "2.0.1"
  resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-2.0.1.tgz#51af7d614ad9a9f610ea1bafbb989d6b1c56890f"
  integrity sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=
  dependencies:
    is-extendable "^0.1.0"

extend-shallow@^3.0.0, extend-shallow@^3.0.2:
  version "3.0.2"
  resolved "https://registry.yarnpkg.com/extend-shallow/-/extend-shallow-3.0.2.tgz#26a71aaf073b39fb2127172746131c2704028db8"
  integrity sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=
  dependencies:
    assign-symbols "^1.0.0"
    is-extendable "^1.0.1"

extglob@^0.3.1:
  version "0.3.2"
  resolved "https://registry.yarnpkg.com/extglob/-/extglob-0.3.2.tgz#2e18ff3d2f49ab2765cec9023f011daa8d8349a1"
  integrity sha1-Lhj/PS9JqydlzskCPwEdqo2DSaE=
  dependencies:
    is-extglob "^1.0.0"

extglob@^2.0.4:
  version "2.0.4"
  resolved "https://registry.yarnpkg.com/extglob/-/extglob-2.0.4.tgz#ad00fe4dc612a9232e8718711dc5cb5ab0285543"
  integrity sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==
  dependencies:
    array-unique "^0.3.2"
    define-property "^1.0.0"
    expand-brackets "^2.1.4"
    extend-shallow "^2.0.1"
    fragment-cache "^0.2.1"
    regex-not "^1.0.0"
    snapdragon "^0.8.1"
    to-regex "^3.0.1"

file-uri-to-path@1.0.0:
  version "1.0.0"
  resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd"
  integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==

filename-regex@^2.0.0:
  version "2.0.1"
  resolved "https://registry.yarnpkg.com/filename-regex/-/filename-regex-2.0.1.tgz#c1c4b9bee3e09725ddb106b75c1e301fe2f18b26"
  integrity sha1-wcS5vuPglyXdsQa3XB4wH+LxiyY=

fill-range@^2.1.0:
  version "2.2.4"
  resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-2.2.4.tgz#eb1e773abb056dcd8df2bfdf6af59b8b3a936565"
  integrity sha512-cnrcCbj01+j2gTG921VZPnHbjmdAf8oQV/iGeV2kZxGSyfYjjTyY79ErsK1WJWMpw6DaApEX72binqJE+/d+5Q==
  dependencies:
    is-number "^2.1.0"
    isobject "^2.0.0"
    randomatic "^3.0.0"
    repeat-element "^1.1.2"
    repeat-string "^1.5.2"

fill-range@^4.0.0:
  version "4.0.0"
  resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-4.0.0.tgz#d544811d428f98eb06a63dc402d2403c328c38f7"
  integrity sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=
  dependencies:
    extend-shallow "^2.0.1"
    is-number "^3.0.0"
    repeat-string "^1.6.1"
    to-regex-range "^2.1.0"

fill-range@^7.0.1:
  version "7.0.1"
  resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40"
  integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==
  dependencies:
    to-regex-range "^5.0.1"

find-up@5.0.0:
  version "5.0.0"
  resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc"
  integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==
  dependencies:
    locate-path "^6.0.0"
    path-exists "^4.0.0"

find-up@^3.0.0:
  version "3.0.0"
  resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73"
  integrity sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==
  dependencies:
    locate-path "^3.0.0"

flat@^5.0.2:
  version "5.0.2"
  resolved "https://registry.yarnpkg.com/flat/-/flat-5.0.2.tgz#8ca6fe332069ffa9d324c327198c598259ceb241"
  integrity sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==

for-in@^1.0.1, for-in@^1.0.2:
  version "1.0.2"
  resolved "https://registry.yarnpkg.com/for-in/-/for-in-1.0.2.tgz#81068d295a8142ec0ac726c6e2200c30fb6d5e80"
  integrity sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=

for-own@^0.1.4:
  version "0.1.5"
  resolved "https://registry.yarnpkg.com/for-own/-/for-own-0.1.5.tgz#5265c681a4f294dabbf17c9509b6763aa84510ce"
  integrity sha1-UmXGgaTylNq78XyVCbZ2OqhFEM4=
  dependencies:
    for-in "^1.0.1"

fragment-cache@^0.2.1:
  version "0.2.1"
  resolved "https://registry.yarnpkg.com/fragment-cache/-/fragment-cache-0.2.1.tgz#4290fad27f13e89be7f33799c6bc5a0abfff0d19"
  integrity sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=
  dependencies:
    map-cache "^0.2.2"

fs-readdir-recursive@^1.0.0:
  version "1.1.0"
  resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27"
  integrity sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==

fs.realpath@^1.0.0:
  version "1.0.0"
  resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f"
  integrity sha1-FQStJSMVjKpA20onh8sBQRmU6k8=

fsevents@^1.0.0:
  version "1.2.13"
  resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-1.2.13.tgz#f325cb0455592428bcf11b383370ef70e3bfcc38"
  integrity sha512-oWb1Z6mkHIskLzEJ/XWX0srkpkTQ7vaopMQkyaEIoq0fmtFVxOthb8cCxeT+p3ynTdkk/RZwbgG4brR5BeWECw==
  dependencies:
    bindings "^1.5.0"
    nan "^2.12.1"

fsevents@~2.1.2:
  version "2.1.3"
  resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.1.3.tgz#fb738703ae8d2f9fe900c33836ddebee8b97f23e"
  integrity sha512-Auw9a4AxqWpa9GUfj370BMPzzyncfBABW8Mab7BGWBYDj4Isgq+cDKtx0i6u9jcX9pQDnswsaaOTgTmA5pEjuQ==

get-caller-file@^2.0.1:
  version "2.0.5"
  resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e"
  integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==

get-value@^2.0.3, get-value@^2.0.6:
  version "2.0.6"
  resolved "https://registry.yarnpkg.com/get-value/-/get-value-2.0.6.tgz#dc15ca1c672387ca76bd37ac0a395ba2042a2c28"
  integrity sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=

glob-base@^0.3.0:
  version "0.3.0"
  resolved "https://registry.yarnpkg.com/glob-base/-/glob-base-0.3.0.tgz#dbb164f6221b1c0b1ccf82aea328b497df0ea3c4"
  integrity sha1-27Fk9iIbHAscz4Kuoyi0l98Oo8Q=
  dependencies:
    glob-parent "^2.0.0"
    is-glob "^2.0.0"

glob-parent@^2.0.0:
  version "2.0.0"
  resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-2.0.0.tgz#81383d72db054fcccf5336daa902f182f6edbb28"
  integrity sha1-gTg9ctsFT8zPUzbaqQLxgvbtuyg=
  dependencies:
    is-glob "^2.0.0"

glob-parent@~5.1.0:
  version "5.1.1"
  resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229"
  integrity sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==
  dependencies:
    is-glob "^4.0.1"

glob@7.1.6, glob@^7.1.2, glob@^7.1.3:
  version "7.1.6"
  resolved "https://registry.yarnpkg.com/glob/-/glob-7.1.6.tgz#141f33b81a7c2492e125594307480c46679278a6"
  integrity sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==
  dependencies:
    fs.realpath "^1.0.0"
    inflight "^1.0.4"
    inherits "2"
    minimatch "^3.0.4"
    once "^1.3.0"
    path-is-absolute "^1.0.0"

globals@^9.18.0:
  version "9.18.0"
  resolved "https://registry.yarnpkg.com/globals/-/globals-9.18.0.tgz#aa3896b3e69b487f17e31ed2143d69a8e30c2d8a"
  integrity sha512-S0nG3CLEQiY/ILxqtztTWH/3iRRdyBLw6KMDxnKMchrtbj2OFmehVh0WUCfW3DUrIgx/qFrJPICrq4Z4sTR9UQ==

graceful-fs@^4.1.11, graceful-fs@^4.1.4:
  version "4.2.4"
  resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.4.tgz#2256bde14d3632958c465ebc96dc467ca07a29fb"
  integrity sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==

graceful-fs@^4.1.3:
  version "4.2.3"
  resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.3.tgz#4a12ff1b60376ef09862c2093edd908328be8423"

growl@1.10.5:
  version "1.10.5"
  resolved "https://registry.yarnpkg.com/growl/-/growl-1.10.5.tgz#f2735dc2283674fa67478b10181059355c369e5e"
  integrity sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==

has-ansi@^2.0.0:
  version "2.0.0"
  resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91"
  integrity sha1-NPUEnOHs3ysGSa8+8k5F7TVBbZE=
  dependencies:
    ansi-regex "^2.0.0"

has-flag@^4.0.0:
  version "4.0.0"
  resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
  integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==

has-value@^0.3.1:
  version "0.3.1"
  resolved "https://registry.yarnpkg.com/has-value/-/has-value-0.3.1.tgz#7b1f58bada62ca827ec0a2078025654845995e1f"
  integrity sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=
  dependencies:
    get-value "^2.0.3"
    has-values "^0.1.4"
    isobject "^2.0.0"

has-value@^1.0.0:
  version "1.0.0"
  resolved "https://registry.yarnpkg.com/has-value/-/has-value-1.0.0.tgz#18b281da585b1c5c51def24c930ed29a0be6b177"
  integrity sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=
  dependencies:
    get-value "^2.0.6"
    has-values "^1.0.0"
    isobject "^3.0.0"

has-values@^0.1.4:
  version "0.1.4"
  resolved "https://registry.yarnpkg.com/has-values/-/has-values-0.1.4.tgz#6d61de95d91dfca9b9a02089ad384bff8f62b771"
  integrity sha1-bWHeldkd/Km5oCCJrThL/49it3E=

has-values@^1.0.0:
  version "1.0.0"
  resolved "https://registry.yarnpkg.com/has-values/-/has-values-1.0.0.tgz#95b0b63fec2146619a6fe57fe75628d5a39efe4f"
  integrity sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=
  dependencies:
    is-number "^3.0.0"
    kind-of "^4.0.0"

he@1.2.0:
  version "1.2.0"
  resolved "https://registry.yarnpkg.com/he/-/he-1.2.0.tgz#84ae65fa7eafb165fddb61566ae14baf05664f0f"
  integrity sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==

home-or-tmp@^2.0.0:
  version "2.0.0"
  resolved "https://registry.yarnpkg.com/home-or-tmp/-/home-or-tmp-2.0.0.tgz#e36c3f2d2cae7d746a857e38d18d5f32a7882db8"
  integrity sha1-42w/LSyufXRqhX440Y1fMqeILbg=
  dependencies:
    os-homedir "^1.0.0"
    os-tmpdir "^1.0.1"

inflight@^1.0.4:
  version "1.0.6"
  resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9"
  integrity sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=
  dependencies:
    once "^1.3.0"
    wrappy "1"

inherits@2, inherits@^2.0.1, inherits@~2.0.3:
  version "2.0.4"
  resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
  integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==

invariant@^2.2.2:
  version "2.2.4"
  resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6"
  integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==
  dependencies:
    loose-envify "^1.0.0"

is-accessor-descriptor@^0.1.6:
  version "0.1.6"
  resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz#a9e12cb3ae8d876727eeef3843f8a0897b5c98d6"
  integrity sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=
  dependencies:
    kind-of "^3.0.2"

is-accessor-descriptor@^1.0.0:
  version "1.0.0"
  resolved "https://registry.yarnpkg.com/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz#169c2f6d3df1f992618072365c9b0ea1f6878656"
  integrity sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==
  dependencies:
    kind-of "^6.0.0"

is-binary-path@^1.0.0:
  version "1.0.1"
  resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-1.0.1.tgz#75f16642b480f187a711c814161fd3a4a7655898"
  integrity sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=
  dependencies:
    binary-extensions "^1.0.0"

is-binary-path@~2.1.0:
  version "2.1.0"
  resolved "https://registry.yarnpkg.com/is-binary-path/-/is-binary-path-2.1.0.tgz#ea1f7f3b80f064236e83470f86c09c254fb45b09"
  integrity sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==
  dependencies:
    binary-extensions "^2.0.0"

is-buffer@^1.1.5:
  version "1.1.6"
  resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be"
  integrity sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==

is-data-descriptor@^0.1.4:
  version "0.1.4"
  resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz#0b5ee648388e2c860282e793f1856fec3f301b56"
  integrity sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=
  dependencies:
    kind-of "^3.0.2"

is-data-descriptor@^1.0.0:
  version "1.0.0"
  resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz#d84876321d0e7add03990406abbbbd36ba9268c7"
  integrity sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==
  dependencies:
    kind-of "^6.0.0"

is-descriptor@^0.1.0:
  version "0.1.6"
  resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-0.1.6.tgz#366d8240dde487ca51823b1ab9f07a10a78251ca"
  integrity sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==
  dependencies:
    is-accessor-descriptor "^0.1.6"
    is-data-descriptor "^0.1.4"
    kind-of "^5.0.0"

is-descriptor@^1.0.0, is-descriptor@^1.0.2:
  version "1.0.2"
  resolved "https://registry.yarnpkg.com/is-descriptor/-/is-descriptor-1.0.2.tgz#3b159746a66604b04f8c81524ba365c5f14d86ec"
  integrity sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==
  dependencies:
    is-accessor-descriptor "^1.0.0"
    is-data-descriptor "^1.0.0"
    kind-of "^6.0.2"

is-dotfile@^1.0.0:
  version "1.0.3"
  resolved "https://registry.yarnpkg.com/is-dotfile/-/is-dotfile-1.0.3.tgz#a6a2f32ffd2dfb04f5ca25ecd0f6b83cf798a1e1"
  integrity sha1-pqLzL/0t+wT1yiXs0Pa4PPeYoeE=

is-equal-shallow@^0.1.3:
  version "0.1.3"
  resolved "https://registry.yarnpkg.com/is-equal-shallow/-/is-equal-shallow-0.1.3.tgz#2238098fc221de0bcfa5d9eac4c45d638aa1c534"
  integrity sha1-IjgJj8Ih3gvPpdnqxMRdY4qhxTQ=
  dependencies:
    is-primitive "^2.0.0"

is-extendable@^0.1.0, is-extendable@^0.1.1:
  version "0.1.1"
  resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-0.1.1.tgz#62b110e289a471418e3ec36a617d472e301dfc89"
  integrity sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=

is-extendable@^1.0.1:
  version "1.0.1"
  resolved "https://registry.yarnpkg.com/is-extendable/-/is-extendable-1.0.1.tgz#a7470f9e426733d81bd81e1155264e3a3507cab4"
  integrity sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==
  dependencies:
    is-plain-object "^2.0.4"

is-extglob@^1.0.0:
  version "1.0.0"
  resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-1.0.0.tgz#ac468177c4943405a092fc8f29760c6ffc6206c0"
  integrity sha1-rEaBd8SUNAWgkvyPKXYMb/xiBsA=

is-extglob@^2.1.1:
  version "2.1.1"
  resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2"
  integrity sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=

is-finite@^1.0.0:
  version "1.1.0"
  resolved "https://registry.yarnpkg.com/is-finite/-/is-finite-1.1.0.tgz#904135c77fb42c0641d6aa1bcdbc4daa8da082f3"
  integrity sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==

is-fullwidth-code-point@^2.0.0:
  version "2.0.0"
  resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f"
  integrity sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=

is-glob@^2.0.0, is-glob@^2.0.1:
  version "2.0.1"
  resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-2.0.1.tgz#d096f926a3ded5600f3fdfd91198cb0888c2d863"
  integrity sha1-0Jb5JqPe1WAPP9/ZEZjLCIjC2GM=
  dependencies:
    is-extglob "^1.0.0"

is-glob@^4.0.1, is-glob@~4.0.1:
  version "4.0.1"
  resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.1.tgz#7567dbe9f2f5e2467bc77ab83c4a29482407a5dc"
  integrity sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==
  dependencies:
    is-extglob "^2.1.1"

is-number@^2.1.0:
  version "2.1.0"
  resolved "https://registry.yarnpkg.com/is-number/-/is-number-2.1.0.tgz#01fcbbb393463a548f2f466cce16dece49db908f"
  integrity sha1-Afy7s5NGOlSPL0ZszhbezknbkI8=
  dependencies:
    kind-of "^3.0.2"

is-number@^3.0.0:
  version "3.0.0"
  resolved "https://registry.yarnpkg.com/is-number/-/is-number-3.0.0.tgz#24fd6201a4782cf50561c810276afc7d12d71195"
  integrity sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=
  dependencies:
    kind-of "^3.0.2"

is-number@^4.0.0:
  version "4.0.0"
  resolved "https://registry.yarnpkg.com/is-number/-/is-number-4.0.0.tgz#0026e37f5454d73e356dfe6564699867c6a7f0ff"
  integrity sha512-rSklcAIlf1OmFdyAqbnWTLVelsQ58uvZ66S/ZyawjWqIviTWCjg2PzVGw8WUA+nNuPTqb4wgA+NszrJ+08LlgQ==

is-number@^7.0.0:
  version "7.0.0"
  resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b"
  integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==

is-plain-obj@^2.1.0:
  version "2.1.0"
  resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-2.1.0.tgz#45e42e37fccf1f40da8e5f76ee21515840c09287"
  integrity sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==

is-plain-object@^2.0.3, is-plain-object@^2.0.4:
  version "2.0.4"
  resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677"
  integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==
  dependencies:
    isobject "^3.0.1"

is-posix-bracket@^0.1.0:
  version "0.1.1"
  resolved "https://registry.yarnpkg.com/is-posix-bracket/-/is-posix-bracket-0.1.1.tgz#3334dc79774368e92f016e6fbc0a88f5cd6e6bc4"
  integrity sha1-MzTceXdDaOkvAW5vvAqI9c1ua8Q=

is-primitive@^2.0.0:
  version "2.0.0"
  resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-2.0.0.tgz#207bab91638499c07b2adf240a41a87210034575"
  integrity sha1-IHurkWOEmcB7Kt8kCkGochADRXU=

is-windows@^1.0.2:
  version "1.0.2"
  resolved "https://registry.yarnpkg.com/is-windows/-/is-windows-1.0.2.tgz#d1850eb9791ecd18e6182ce12a30f396634bb19d"
  integrity sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==

isarray@1.0.0, isarray@~1.0.0:
  version "1.0.0"
  resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
  integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=

isexe@^2.0.0:
  version "2.0.0"
  resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
  integrity sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=

isobject@^2.0.0:
  version "2.1.0"
  resolved "https://registry.yarnpkg.com/isobject/-/isobject-2.1.0.tgz#f065561096a3f1da2ef46272f815c840d87e0c89"
  integrity sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=
  dependencies:
    isarray "1.0.0"

isobject@^3.0.0, isobject@^3.0.1:
  version "3.0.1"
  resolved "https://registry.yarnpkg.com/isobject/-/isobject-3.0.1.tgz#4e431e92b11a9731636aa1f9c8d1ccbcfdab78df"
  integrity sha1-TkMekrEalzFjaqH5yNHMvP2reN8=

"js-tokens@^3.0.0 || ^4.0.0":
  version "4.0.0"
  resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499"
  integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==

js-tokens@^3.0.2:
  version "3.0.2"
  resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-3.0.2.tgz#9866df395102130e38f7f996bceb65443209c25b"
  integrity sha1-mGbfOVECEw449/mWvOtlRDIJwls=

js-yaml@3.14.0:
  version "3.14.0"
  resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.0.tgz#a7a34170f26a21bb162424d8adacb4113a69e482"
  integrity sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==
  dependencies:
    argparse "^1.0.7"
    esprima "^4.0.0"

jsesc@^1.3.0:
  version "1.3.0"
  resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-1.3.0.tgz#46c3fec8c1892b12b0833db9bc7622176dbab34b"
  integrity sha1-RsP+yMGJKxKwgz25vHYiF226s0s=

jsesc@~0.5.0:
  version "0.5.0"
  resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d"

json5@^0.5.1:
  version "0.5.1"
  resolved "https://registry.yarnpkg.com/json5/-/json5-0.5.1.tgz#1eade7acc012034ad84e2396767ead9fa5495821"
  integrity sha1-Hq3nrMASA0rYTiOWdn6tn6VJWCE=

kind-of@^3.0.2, kind-of@^3.0.3, kind-of@^3.2.0:
  version "3.2.2"
  resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-3.2.2.tgz#31ea21a734bab9bbb0f32466d893aea51e4a3c64"
  integrity sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=
  dependencies:
    is-buffer "^1.1.5"

kind-of@^4.0.0:
  version "4.0.0"
  resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-4.0.0.tgz#20813df3d712928b207378691a45066fae72dd57"
  integrity sha1-IIE989cSkosgc3hpGkUGb65y3Vc=
  dependencies:
    is-buffer "^1.1.5"

kind-of@^5.0.0:
  version "5.1.0"
  resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-5.1.0.tgz#729c91e2d857b7a419a1f9aa65685c4c33f5845d"
  integrity sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02iVmTB80Pw==

kind-of@^6.0.0, kind-of@^6.0.2:
  version "6.0.3"
  resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd"
  integrity sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==

lazy-cache@^1.0.3:
  version "1.0.4"
  resolved "https://registry.yarnpkg.com/lazy-cache/-/lazy-cache-1.0.4.tgz#a1d78fc3a50474cb80845d3b3b6e1da49a446e8e"

locate-path@^3.0.0:
  version "3.0.0"
  resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-3.0.0.tgz#dbec3b3ab759758071b58fe59fc41871af21400e"
  integrity sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==
  dependencies:
    p-locate "^3.0.0"
    path-exists "^3.0.0"

locate-path@^6.0.0:
  version "6.0.0"
  resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286"
  integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==
  dependencies:
    p-locate "^5.0.0"

lodash@^4.17.4:
  version "4.17.20"
  resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.20.tgz#b44a9b6297bcb698f1c51a3545a2b3b368d59c52"
  integrity sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==

log-symbols@4.0.0:
  version "4.0.0"
  resolved "https://registry.yarnpkg.com/log-symbols/-/log-symbols-4.0.0.tgz#69b3cc46d20f448eccdb75ea1fa733d9e821c920"
  integrity sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==
  dependencies:
    chalk "^4.0.0"

longest@^1.0.1:
  version "1.0.1"
  resolved "https://registry.yarnpkg.com/longest/-/longest-1.0.1.tgz#30a0b2da38f73770e8294a0d22e6625ed77d0097"

loose-envify@^1.0.0:
  version "1.4.0"
  resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf"
  integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==
  dependencies:
    js-tokens "^3.0.0 || ^4.0.0"

map-cache@^0.2.2:
  version "0.2.2"
  resolved "https://registry.yarnpkg.com/map-cache/-/map-cache-0.2.2.tgz#c32abd0bd6525d9b051645bb4f26ac5dc98a0dbf"
  integrity sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=

map-visit@^1.0.0:
  version "1.0.0"
  resolved "https://registry.yarnpkg.com/map-visit/-/map-visit-1.0.0.tgz#ecdca8f13144e660f1b5bd41f12f3479d98dfb8f"
  integrity sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=
  dependencies:
    object-visit "^1.0.0"

math-random@^1.0.1:
  version "1.0.4"
  resolved "https://registry.yarnpkg.com/math-random/-/math-random-1.0.4.tgz#5dd6943c938548267016d4e34f057583080c514c"
  integrity sha512-rUxjysqif/BZQH2yhd5Aaq7vXMSx9NdEsQcyA07uEzIvxgI7zIr33gGsh+RU0/XjmQpCW7RsVof1vlkvQVCK5A==

micromatch@^2.1.5:
  version "2.3.11"
  resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-2.3.11.tgz#86677c97d1720b363431d04d0d15293bd38c1565"
  integrity sha1-hmd8l9FyCzY0MdBNDRUpO9OMFWU=
  dependencies:
    arr-diff "^2.0.0"
    array-unique "^0.2.1"
    braces "^1.8.2"
    expand-brackets "^0.1.4"
    extglob "^0.3.1"
    filename-regex "^2.0.0"
    is-extglob "^1.0.0"
    is-glob "^2.0.1"
    kind-of "^3.0.2"
    normalize-path "^2.0.1"
    object.omit "^2.0.0"
    parse-glob "^3.0.4"
    regex-cache "^0.4.2"

micromatch@^3.1.10:
  version "3.1.10"
  resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-3.1.10.tgz#70859bc95c9840952f359a068a3fc49f9ecfac23"
  integrity sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==
  dependencies:
    arr-diff "^4.0.0"
    array-unique "^0.3.2"
    braces "^2.3.1"
    define-property "^2.0.2"
    extend-shallow "^3.0.2"
    extglob "^2.0.4"
    fragment-cache "^0.2.1"
    kind-of "^6.0.2"
    nanomatch "^1.2.9"
    object.pick "^1.3.0"
    regex-not "^1.0.0"
    snapdragon "^0.8.1"
    to-regex "^3.0.2"

minimatch@3.0.4, minimatch@^3.0.2, minimatch@^3.0.4:
  version "3.0.4"
  resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.0.4.tgz#5166e286457f03306064be5497e8dbb0c3d32083"
  dependencies:
    brace-expansion "^1.1.7"

minimist@^1.2.0, minimist@^1.2.5:
  version "1.2.5"
  resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
  integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==

mixin-deep@^1.2.0:
  version "1.3.2"
  resolved "https://registry.yarnpkg.com/mixin-deep/-/mixin-deep-1.3.2.tgz#1120b43dc359a785dce65b55b82e257ccf479566"
  integrity sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==
  dependencies:
    for-in "^1.0.2"
    is-extendable "^1.0.1"

mkdirp@^0.5.1:
  version "0.5.5"
  resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
  integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==
  dependencies:
    minimist "^1.2.5"

mocha-qunit-ui@^0.1.3:
  version "0.1.3"
  resolved "https://registry.yarnpkg.com/mocha-qunit-ui/-/mocha-qunit-ui-0.1.3.tgz#e3e1ff1dac33222b10cef681efd7f82664141ea9"

mocha@^8.2.1:
  version "8.2.1"
  resolved "https://registry.yarnpkg.com/mocha/-/mocha-8.2.1.tgz#f2fa68817ed0e53343d989df65ccd358bc3a4b39"
  integrity sha512-cuLBVfyFfFqbNR0uUKbDGXKGk+UDFe6aR4os78XIrMQpZl/nv7JYHcvP5MFIAb374b2zFXsdgEGwmzMtP0Xg8w==
  dependencies:
    "@ungap/promise-all-settled" "1.1.2"
    ansi-colors "4.1.1"
    browser-stdout "1.3.1"
    chokidar "3.4.3"
    debug "4.2.0"
    diff "4.0.2"
    escape-string-regexp "4.0.0"
    find-up "5.0.0"
    glob "7.1.6"
    growl "1.10.5"
    he "1.2.0"
    js-yaml "3.14.0"
    log-symbols "4.0.0"
    minimatch "3.0.4"
    ms "2.1.2"
    nanoid "3.1.12"
    serialize-javascript "5.0.1"
    strip-json-comments "3.1.1"
    supports-color "7.2.0"
    which "2.0.2"
    wide-align "1.1.3"
    workerpool "6.0.2"
    yargs "13.3.2"
    yargs-parser "13.1.2"
    yargs-unparser "2.0.0"

ms@2.0.0:
  version "2.0.0"
  resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8"
  integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=

ms@2.1.2:
  version "2.1.2"
  resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
  integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==

nan@^2.12.1:
  version "2.14.2"
  resolved "https://registry.yarnpkg.com/nan/-/nan-2.14.2.tgz#f5376400695168f4cc694ac9393d0c9585eeea19"
  integrity sha512-M2ufzIiINKCuDfBSAUr1vWQ+vuVcA9kqx8JJUsbQi6yf1uGRyb7HfpdfUr5qLXf3B/t8dPvcjhKMmlfnP47EzQ==

nanoid@3.1.12:
  version "3.1.12"
  resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.12.tgz#6f7736c62e8d39421601e4a0c77623a97ea69654"
  integrity sha512-1qstj9z5+x491jfiC4Nelk+f8XBad7LN20PmyWINJEMRSf3wcAjAWysw1qaA8z6NSKe2sjq1hRSDpBH5paCb6A==

nanomatch@^1.2.9:
  version "1.2.13"
  resolved "https://registry.yarnpkg.com/nanomatch/-/nanomatch-1.2.13.tgz#b87a8aa4fc0de8fe6be88895b38983ff265bd119"
  integrity sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==
  dependencies:
    arr-diff "^4.0.0"
    array-unique "^0.3.2"
    define-property "^2.0.2"
    extend-shallow "^3.0.2"
    fragment-cache "^0.2.1"
    is-windows "^1.0.2"
    kind-of "^6.0.2"
    object.pick "^1.3.0"
    regex-not "^1.0.0"
    snapdragon "^0.8.1"
    to-regex "^3.0.1"

normalize-path@^2.0.0, normalize-path@^2.0.1:
  version "2.1.1"
  resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-2.1.1.tgz#1ab28b556e198363a8c1a6f7e6fa20137fe6aed9"
  integrity sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=
  dependencies:
    remove-trailing-separator "^1.0.1"

normalize-path@^3.0.0, normalize-path@~3.0.0:
  version "3.0.0"
  resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65"
  integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==

object-assign@^4.1.0:
  version "4.1.1"
  resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
  integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=

object-copy@^0.1.0:
  version "0.1.0"
  resolved "https://registry.yarnpkg.com/object-copy/-/object-copy-0.1.0.tgz#7e7d858b781bd7c991a41ba975ed3812754e998c"
  integrity sha1-fn2Fi3gb18mRpBupde04EnVOmYw=
  dependencies:
    copy-descriptor "^0.1.0"
    define-property "^0.2.5"
    kind-of "^3.0.3"

object-visit@^1.0.0:
  version "1.0.1"
  resolved "https://registry.yarnpkg.com/object-visit/-/object-visit-1.0.1.tgz#f79c4493af0c5377b59fe39d395e41042dd045bb"
  integrity sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=
  dependencies:
    isobject "^3.0.0"

object.omit@^2.0.0:
  version "2.0.1"
  resolved "https://registry.yarnpkg.com/object.omit/-/object.omit-2.0.1.tgz#1a9c744829f39dbb858c76ca3579ae2a54ebd1fa"
  integrity sha1-Gpx0SCnznbuFjHbKNXmuKlTr0fo=
  dependencies:
    for-own "^0.1.4"
    is-extendable "^0.1.1"

object.pick@^1.3.0:
  version "1.3.0"
  resolved "https://registry.yarnpkg.com/object.pick/-/object.pick-1.3.0.tgz#87a10ac4c1694bd2e1cbf53591a66141fb5dd747"
  integrity sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=
  dependencies:
    isobject "^3.0.1"

once@^1.3.0:
  version "1.4.0"
  resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
  integrity sha1-WDsap3WWHUsROsF9nFC6753Xa9E=
  dependencies:
    wrappy "1"

os-homedir@^1.0.0:
  version "1.0.2"
  resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
  integrity sha1-/7xJiDNuDoM94MFox+8VISGqf7M=

os-tmpdir@^1.0.1:
  version "1.0.2"
  resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274"
  integrity sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=

output-file-sync@^1.1.2:
  version "1.1.2"
  resolved "https://registry.yarnpkg.com/output-file-sync/-/output-file-sync-1.1.2.tgz#d0a33eefe61a205facb90092e826598d5245ce76"
  integrity sha1-0KM+7+YaIF+suQCS6CZZjVJFznY=
  dependencies:
    graceful-fs "^4.1.4"
    mkdirp "^0.5.1"
    object-assign "^4.1.0"

p-limit@^2.0.0:
  version "2.3.0"
  resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1"
  integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==
  dependencies:
    p-try "^2.0.0"

p-limit@^3.0.2:
  version "3.1.0"
  resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b"
  integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==
  dependencies:
    yocto-queue "^0.1.0"

p-locate@^3.0.0:
  version "3.0.0"
  resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-3.0.0.tgz#322d69a05c0264b25997d9f40cd8a891ab0064a4"
  integrity sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==
  dependencies:
    p-limit "^2.0.0"

p-locate@^5.0.0:
  version "5.0.0"
  resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834"
  integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==
  dependencies:
    p-limit "^3.0.2"

p-try@^2.0.0:
  version "2.2.0"
  resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6"
  integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==

parse-glob@^3.0.4:
  version "3.0.4"
  resolved "https://registry.yarnpkg.com/parse-glob/-/parse-glob-3.0.4.tgz#b2c376cfb11f35513badd173ef0bb6e3a388391c"
  integrity sha1-ssN2z7EfNVE7rdFz7wu246OIORw=
  dependencies:
    glob-base "^0.3.0"
    is-dotfile "^1.0.0"
    is-extglob "^1.0.0"
    is-glob "^2.0.0"

pascalcase@^0.1.1:
  version "0.1.1"
  resolved "https://registry.yarnpkg.com/pascalcase/-/pascalcase-0.1.1.tgz#b363e55e8006ca6fe21784d2db22bd15d7917f14"
  integrity sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=

path-exists@^3.0.0:
  version "3.0.0"
  resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515"
  integrity sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=

path-exists@^4.0.0:
  version "4.0.0"
  resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3"
  integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==

path-is-absolute@^1.0.0, path-is-absolute@^1.0.1:
  version "1.0.1"
  resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f"
  integrity sha1-F0uSaHNVNP+8es5r9TpanhtcX18=

path-parse@^1.0.5:
  version "1.0.5"
  resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.5.tgz#3c1adf871ea9cd6c9431b6ea2bd74a0ff055c4c1"

picomatch@^2.0.4, picomatch@^2.2.1:
  version "2.2.2"
  resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.2.2.tgz#21f333e9b6b8eaff02468f5146ea406d345f4dad"
  integrity sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==

posix-character-classes@^0.1.0:
  version "0.1.1"
  resolved "https://registry.yarnpkg.com/posix-character-classes/-/posix-character-classes-0.1.1.tgz#01eac0fe3b5af71a2a6c02feabb8c1fef7e00eab"
  integrity sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=

preserve@^0.2.0:
  version "0.2.0"
  resolved "https://registry.yarnpkg.com/preserve/-/preserve-0.2.0.tgz#815ed1f6ebc65926f865b310c0713bcb3315ce4b"
  integrity sha1-gV7R9uvGWSb4ZbMQwHE7yzMVzks=

private@^0.1.6, private@^0.1.7, private@^0.1.8:
  version "0.1.8"
  resolved "https://registry.yarnpkg.com/private/-/private-0.1.8.tgz#2381edb3689f7a53d653190060fcf822d2f368ff"

process-nextick-args@~2.0.0:
  version "2.0.1"
  resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
  integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==

punycode@^2.1.0:
  version "2.1.0"
  resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.0.tgz#5f863edc89b96db09074bad7947bf09056ca4e7d"

randomatic@^3.0.0:
  version "3.1.1"
  resolved "https://registry.yarnpkg.com/randomatic/-/randomatic-3.1.1.tgz#b776efc59375984e36c537b2f51a1f0aff0da1ed"
  integrity sha512-TuDE5KxZ0J461RVjrJZCJc+J+zCkTb1MbH9AQUq68sMhOMcy9jLcb3BrZKgp9q9Ncltdg4QVqWrH02W2EFFVYw==
  dependencies:
    is-number "^4.0.0"
    kind-of "^6.0.0"
    math-random "^1.0.1"

randombytes@^2.1.0:
  version "2.1.0"
  resolved "https://registry.yarnpkg.com/randombytes/-/randombytes-2.1.0.tgz#df6f84372f0270dc65cdf6291349ab7a473d4f2a"
  integrity sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==
  dependencies:
    safe-buffer "^5.1.0"

readable-stream@^2.0.2:
  version "2.3.7"
  resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57"
  integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==
  dependencies:
    core-util-is "~1.0.0"
    inherits "~2.0.3"
    isarray "~1.0.0"
    process-nextick-args "~2.0.0"
    safe-buffer "~5.1.1"
    string_decoder "~1.1.1"
    util-deprecate "~1.0.1"

readdirp@^2.0.0:
  version "2.2.1"
  resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-2.2.1.tgz#0e87622a3325aa33e892285caf8b4e846529a525"
  integrity sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==
  dependencies:
    graceful-fs "^4.1.11"
    micromatch "^3.1.10"
    readable-stream "^2.0.2"

readdirp@~3.5.0:
  version "3.5.0"
  resolved "https://registry.yarnpkg.com/readdirp/-/readdirp-3.5.0.tgz#9ba74c019b15d365278d2e91bb8c48d7b4d42c9e"
  integrity sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==
  dependencies:
    picomatch "^2.2.1"

regenerate@^1.2.1:
  version "1.3.3"
  resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.3.3.tgz#0c336d3980553d755c39b586ae3b20aa49c82b7f"

regenerator-runtime@^0.10.5:
  version "0.10.5"
  resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.10.5.tgz#336c3efc1220adcedda2c9fab67b5a7955a33658"
  integrity sha1-M2w+/BIgrc7dosn6tntaeVWjNlg=

regenerator-runtime@^0.11.0:
  version "0.11.1"
  resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz#be05ad7f9bf7d22e056f9726cee5017fbf19e2e9"
  integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==

regenerator-transform@^0.10.0:
  version "0.10.1"
  resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.10.1.tgz#1e4996837231da8b7f3cf4114d71b5691a0680dd"
  dependencies:
    babel-runtime "^6.18.0"
    babel-types "^6.19.0"
    private "^0.1.6"

regex-cache@^0.4.2:
  version "0.4.4"
  resolved "https://registry.yarnpkg.com/regex-cache/-/regex-cache-0.4.4.tgz#75bdc58a2a1496cec48a12835bc54c8d562336dd"
  integrity sha512-nVIZwtCjkC9YgvWkpM55B5rBhBYRZhAaJbgcFYXXsHnbZ9UZI9nnVWYZpBlCqv9ho2eZryPnWrZGsOdPwVWXWQ==
  dependencies:
    is-equal-shallow "^0.1.3"

regex-not@^1.0.0, regex-not@^1.0.2:
  version "1.0.2"
  resolved "https://registry.yarnpkg.com/regex-not/-/regex-not-1.0.2.tgz#1f4ece27e00b0b65e0247a6810e6a85d83a5752c"
  integrity sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==
  dependencies:
    extend-shallow "^3.0.2"
    safe-regex "^1.1.0"

regexpu-core@^2.0.0:
  version "2.0.0"
  resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-2.0.0.tgz#49d038837b8dcf8bfa5b9a42139938e6ea2ae240"
  dependencies:
    regenerate "^1.2.1"
    regjsgen "^0.2.0"
    regjsparser "^0.1.4"

regjsgen@^0.2.0:
  version "0.2.0"
  resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.2.0.tgz#6c016adeac554f75823fe37ac05b92d5a4edb1f7"

regjsparser@^0.1.4:
  version "0.1.5"
  resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.1.5.tgz#7ee8f84dc6fa792d3fd0ae228d24bd949ead205c"
  dependencies:
    jsesc "~0.5.0"

remove-trailing-separator@^1.0.1:
  version "1.1.0"
  resolved "https://registry.yarnpkg.com/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz#c24bce2a283adad5bc3f58e0d48249b92379d8ef"
  integrity sha1-wkvOKig62tW8P1jg1IJJuSN52O8=

repeat-element@^1.1.2:
  version "1.1.3"
  resolved "https://registry.yarnpkg.com/repeat-element/-/repeat-element-1.1.3.tgz#782e0d825c0c5a3bb39731f84efee6b742e6b1ce"
  integrity sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==

repeat-string@^1.5.2, repeat-string@^1.6.1:
  version "1.6.1"
  resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637"
  integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc=

repeating@^2.0.0:
  version "2.0.1"
  resolved "https://registry.yarnpkg.com/repeating/-/repeating-2.0.1.tgz#5214c53a926d3552707527fbab415dbc08d06dda"
  integrity sha1-UhTFOpJtNVJwdSf7q0FdvAjQbdo=
  dependencies:
    is-finite "^1.0.0"

require-directory@^2.1.1:
  version "2.1.1"
  resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42"
  integrity sha1-jGStX9MNqxyXbiNE/+f3kqam30I=

require-main-filename@^2.0.0:
  version "2.0.0"
  resolved "https://registry.yarnpkg.com/require-main-filename/-/require-main-filename-2.0.0.tgz#d0b329ecc7cc0f61649f62215be69af54aa8989b"
  integrity sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==

resolve-url@^0.2.1:
  version "0.2.1"
  resolved "https://registry.yarnpkg.com/resolve-url/-/resolve-url-0.2.1.tgz#2c637fe77c893afd2a663fe21aa9080068e2052a"
  integrity sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=

resolve@1.1.7:
  version "1.1.7"
  resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.1.7.tgz#203114d82ad2c5ed9e8e0411b3932875e889e97b"

resolve@^1.1.6:
  version "1.6.0"
  resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.6.0.tgz#0fbd21278b27b4004481c395349e7aba60a9ff5c"
  dependencies:
    path-parse "^1.0.5"

ret@~0.1.10:
  version "0.1.15"
  resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc"
  integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==

right-align@^0.1.1:
  version "0.1.3"
  resolved "https://registry.yarnpkg.com/right-align/-/right-align-0.1.3.tgz#61339b722fe6a3515689210d24e14c96148613ef"
  dependencies:
    align-text "^0.1.1"

rimraf@^2.5.2:
  version "2.7.1"
  resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-2.7.1.tgz#35797f13a7fdadc566142c29d4f07ccad483e3ec"
  dependencies:
    glob "^7.1.3"

rollup-plugin-babel@^2.7.1:
  version "2.7.1"
  resolved "https://registry.yarnpkg.com/rollup-plugin-babel/-/rollup-plugin-babel-2.7.1.tgz#16528197b0f938a1536f44683c7a93d573182f57"
  dependencies:
    babel-core "6"
    babel-plugin-transform-es2015-classes "^6.9.0"
    object-assign "^4.1.0"
    rollup-pluginutils "^1.5.0"

rollup-plugin-node-resolve@^2.0.0:
  version "2.1.1"
  resolved "https://registry.yarnpkg.com/rollup-plugin-node-resolve/-/rollup-plugin-node-resolve-2.1.1.tgz#cbb783b0d15b02794d58915350b2f0d902b8ddc8"
  dependencies:
    browser-resolve "^1.11.0"
    builtin-modules "^1.1.0"
    resolve "^1.1.6"

rollup-pluginutils@^1.5.0:
  version "1.5.2"
  resolved "https://registry.yarnpkg.com/rollup-pluginutils/-/rollup-pluginutils-1.5.2.tgz#1e156e778f94b7255bfa1b3d0178be8f5c552408"
  dependencies:
    estree-walker "^0.2.1"
    minimatch "^3.0.2"

rollup@^0.41.6:
  version "0.41.6"
  resolved "https://registry.yarnpkg.com/rollup/-/rollup-0.41.6.tgz#e0d05497877a398c104d816d2733a718a7a94e2a"
  dependencies:
    source-map-support "^0.4.0"

safe-buffer@^5.1.0:
  version "5.2.1"
  resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
  integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==

safe-buffer@~5.1.0, safe-buffer@~5.1.1:
  version "5.1.2"
  resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
  integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==

safe-regex@^1.1.0:
  version "1.1.0"
  resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e"
  integrity sha1-QKNmnzsHfR6UPURinhV91IAjvy4=
  dependencies:
    ret "~0.1.10"

sander@^0.5.0:
  version "0.5.1"
  resolved "https://registry.yarnpkg.com/sander/-/sander-0.5.1.tgz#741e245e231f07cafb6fdf0f133adfa216a502ad"
  dependencies:
    es6-promise "^3.1.2"
    graceful-fs "^4.1.3"
    mkdirp "^0.5.1"
    rimraf "^2.5.2"

serialize-javascript@5.0.1:
  version "5.0.1"
  resolved "https://registry.yarnpkg.com/serialize-javascript/-/serialize-javascript-5.0.1.tgz#7886ec848049a462467a97d3d918ebb2aaf934f4"
  integrity sha512-SaaNal9imEO737H2c05Og0/8LUXG7EnsZyMa8MzkmuHoELfT6txuj0cMqRj6zfPKnmQ1yasR4PCJc8x+M4JSPA==
  dependencies:
    randombytes "^2.1.0"

set-blocking@^2.0.0:
  version "2.0.0"
  resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"

set-value@^2.0.0, set-value@^2.0.1:
  version "2.0.1"
  resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b"
  integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==
  dependencies:
    extend-shallow "^2.0.1"
    is-extendable "^0.1.1"
    is-plain-object "^2.0.3"
    split-string "^3.0.1"

slash@^1.0.0:
  version "1.0.0"
  resolved "https://registry.yarnpkg.com/slash/-/slash-1.0.0.tgz#c41f2f6c39fc16d1cd17ad4b5d896114ae470d55"
  integrity sha1-xB8vbDn8FtHNF61LXYlhFK5HDVU=

snapdragon-node@^2.0.1:
  version "2.1.1"
  resolved "https://registry.yarnpkg.com/snapdragon-node/-/snapdragon-node-2.1.1.tgz#6c175f86ff14bdb0724563e8f3c1b021a286853b"
  integrity sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==
  dependencies:
    define-property "^1.0.0"
    isobject "^3.0.0"
    snapdragon-util "^3.0.1"

snapdragon-util@^3.0.1:
  version "3.0.1"
  resolved "https://registry.yarnpkg.com/snapdragon-util/-/snapdragon-util-3.0.1.tgz#f956479486f2acd79700693f6f7b805e45ab56e2"
  integrity sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==
  dependencies:
    kind-of "^3.2.0"

snapdragon@^0.8.1:
  version "0.8.2"
  resolved "https://registry.yarnpkg.com/snapdragon/-/snapdragon-0.8.2.tgz#64922e7c565b0e14204ba1aa7d6964278d25182d"
  integrity sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==
  dependencies:
    base "^0.11.1"
    debug "^2.2.0"
    define-property "^0.2.5"
    extend-shallow "^2.0.1"
    map-cache "^0.2.2"
    source-map "^0.5.6"
    source-map-resolve "^0.5.0"
    use "^3.1.0"

sorcery@^0.10.0:
  version "0.10.0"
  resolved "https://registry.yarnpkg.com/sorcery/-/sorcery-0.10.0.tgz#8ae90ad7d7cb05fc59f1ab0c637845d5c15a52b7"
  dependencies:
    buffer-crc32 "^0.2.5"
    minimist "^1.2.0"
    sander "^0.5.0"
    sourcemap-codec "^1.3.0"

source-map-resolve@^0.5.0:
  version "0.5.3"
  resolved "https://registry.yarnpkg.com/source-map-resolve/-/source-map-resolve-0.5.3.tgz#190866bece7553e1f8f267a2ee82c606b5509a1a"
  integrity sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==
  dependencies:
    atob "^2.1.2"
    decode-uri-component "^0.2.0"
    resolve-url "^0.2.1"
    source-map-url "^0.4.0"
    urix "^0.1.0"

source-map-support@^0.4.0, source-map-support@^0.4.15:
  version "0.4.18"
  resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.4.18.tgz#0286a6de8be42641338594e97ccea75f0a2c585f"
  dependencies:
    source-map "^0.5.6"

source-map-url@^0.4.0:
  version "0.4.0"
  resolved "https://registry.yarnpkg.com/source-map-url/-/source-map-url-0.4.0.tgz#3e935d7ddd73631b97659956d55128e87b5084a3"
  integrity sha1-PpNdfd1zYxuXZZlW1VEo6HtQhKM=

source-map@^0.5.6, source-map@^0.5.7, source-map@~0.5.1:
  version "0.5.7"
  resolved "https://registry.yarnpkg.com/source-map/-/source-map-0.5.7.tgz#8a039d2d1021d22d1ea14c80d8ea468ba2ef3fcc"
  integrity sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=

sourcemap-codec@^1.3.0:
  version "1.4.1"
  resolved "https://registry.yarnpkg.com/sourcemap-codec/-/sourcemap-codec-1.4.1.tgz#c8fd92d91889e902a07aee392bdd2c5863958ba2"

split-string@^3.0.1, split-string@^3.0.2:
  version "3.1.0"
  resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2"
  integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==
  dependencies:
    extend-shallow "^3.0.0"

sprintf-js@~1.0.2:
  version "1.0.3"
  resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"
  integrity sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=

static-extend@^0.1.1:
  version "0.1.2"
  resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6"
  integrity sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=
  dependencies:
    define-property "^0.2.5"
    object-copy "^0.1.0"

"string-width@^1.0.2 || 2":
  version "2.1.1"
  resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e"
  integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==
  dependencies:
    is-fullwidth-code-point "^2.0.0"
    strip-ansi "^4.0.0"

string-width@^3.0.0, string-width@^3.1.0:
  version "3.1.0"
  resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961"
  integrity sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==
  dependencies:
    emoji-regex "^7.0.1"
    is-fullwidth-code-point "^2.0.0"
    strip-ansi "^5.1.0"

string_decoder@~1.1.1:
  version "1.1.1"
  resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
  integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==
  dependencies:
    safe-buffer "~5.1.0"

strip-ansi@^3.0.0:
  version "3.0.1"
  resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
  integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=
  dependencies:
    ansi-regex "^2.0.0"

strip-ansi@^4.0.0:
  version "4.0.0"
  resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f"
  integrity sha1-qEeQIusaw2iocTibY1JixQXuNo8=
  dependencies:
    ansi-regex "^3.0.0"

strip-ansi@^5.0.0, strip-ansi@^5.1.0, strip-ansi@^5.2.0:
  version "5.2.0"
  resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae"
  integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==
  dependencies:
    ansi-regex "^4.1.0"

strip-json-comments@3.1.1:
  version "3.1.1"
  resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006"
  integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==

supports-color@7.2.0, supports-color@^7.1.0:
  version "7.2.0"
  resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
  integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==
  dependencies:
    has-flag "^4.0.0"

supports-color@^2.0.0:
  version "2.0.0"
  resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7"
  integrity sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=

to-fast-properties@^1.0.3:
  version "1.0.3"
  resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-1.0.3.tgz#b83571fa4d8c25b82e231b06e3a3055de4ca1a47"
  integrity sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=

to-object-path@^0.3.0:
  version "0.3.0"
  resolved "https://registry.yarnpkg.com/to-object-path/-/to-object-path-0.3.0.tgz#297588b7b0e7e0ac08e04e672f85c1f4999e17af"
  integrity sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=
  dependencies:
    kind-of "^3.0.2"

to-regex-range@^2.1.0:
  version "2.1.1"
  resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-2.1.1.tgz#7c80c17b9dfebe599e27367e0d4dd5590141db38"
  integrity sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=
  dependencies:
    is-number "^3.0.0"
    repeat-string "^1.6.1"

to-regex-range@^5.0.1:
  version "5.0.1"
  resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4"
  integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==
  dependencies:
    is-number "^7.0.0"

to-regex@^3.0.1, to-regex@^3.0.2:
  version "3.0.2"
  resolved "https://registry.yarnpkg.com/to-regex/-/to-regex-3.0.2.tgz#13cfdd9b336552f30b51f33a8ae1b42a7a7599ce"
  integrity sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==
  dependencies:
    define-property "^2.0.2"
    extend-shallow "^3.0.2"
    regex-not "^1.0.2"
    safe-regex "^1.1.0"

trim-right@^1.0.1:
  version "1.0.1"
  resolved "https://registry.yarnpkg.com/trim-right/-/trim-right-1.0.1.tgz#cb2e1203067e0c8de1f614094b9fe45704ea6003"
  integrity sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=

typescript@^2.8.1:
  version "2.8.1"
  resolved "https://registry.yarnpkg.com/typescript/-/typescript-2.8.1.tgz#6160e4f8f195d5ba81d4876f9c0cc1fbc0820624"

uglify-js@^2.8.14:
  version "2.8.29"
  resolved "https://registry.yarnpkg.com/uglify-js/-/uglify-js-2.8.29.tgz#29c5733148057bb4e1f75df35b7a9cb72e6a59dd"
  dependencies:
    source-map "~0.5.1"
    yargs "~3.10.0"
  optionalDependencies:
    uglify-to-browserify "~1.0.0"

uglify-to-browserify@~1.0.0:
  version "1.0.2"
  resolved "https://registry.yarnpkg.com/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz#6e0924d6bda6b5afe349e39a6d632850a0f882b7"

union-value@^1.0.0:
  version "1.0.1"
  resolved "https://registry.yarnpkg.com/union-value/-/union-value-1.0.1.tgz#0b6fe7b835aecda61c6ea4d4f02c14221e109847"
  integrity sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==
  dependencies:
    arr-union "^3.1.0"
    get-value "^2.0.6"
    is-extendable "^0.1.1"
    set-value "^2.0.1"

unset-value@^1.0.0:
  version "1.0.0"
  resolved "https://registry.yarnpkg.com/unset-value/-/unset-value-1.0.0.tgz#8376873f7d2335179ffb1e6fc3a8ed0dfc8ab559"
  integrity sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=
  dependencies:
    has-value "^0.3.1"
    isobject "^3.0.0"

urix@^0.1.0:
  version "0.1.0"
  resolved "https://registry.yarnpkg.com/urix/-/urix-0.1.0.tgz#da937f7a62e21fec1fd18d49b35c2935067a6c72"
  integrity sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=

use@^3.1.0:
  version "3.1.1"
  resolved "https://registry.yarnpkg.com/use/-/use-3.1.1.tgz#d50c8cac79a19fbc20f2911f56eb973f4e10070f"
  integrity sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==

user-home@^1.1.1:
  version "1.1.1"
  resolved "https://registry.yarnpkg.com/user-home/-/user-home-1.1.1.tgz#2b5be23a32b63a7c9deb8d0f28d485724a3df190"
  integrity sha1-K1viOjK2Onyd640PKNSFcko98ZA=

util-deprecate@~1.0.1:
  version "1.0.2"
  resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
  integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=

v8flags@^2.1.1:
  version "2.1.1"
  resolved "https://registry.yarnpkg.com/v8flags/-/v8flags-2.1.1.tgz#aab1a1fa30d45f88dd321148875ac02c0b55e5b4"
  integrity sha1-qrGh+jDUX4jdMhFIh1rALAtV5bQ=
  dependencies:
    user-home "^1.1.1"

which-module@^2.0.0:
  version "2.0.0"
  resolved "https://registry.yarnpkg.com/which-module/-/which-module-2.0.0.tgz#d9ef07dce77b9902b8a3a8fa4b31c3e3f7e6e87a"
  integrity sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=

which@2.0.2:
  version "2.0.2"
  resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1"
  integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==
  dependencies:
    isexe "^2.0.0"

wide-align@1.1.3:
  version "1.1.3"
  resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.3.tgz#ae074e6bdc0c14a431e804e624549c633b000457"
  integrity sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==
  dependencies:
    string-width "^1.0.2 || 2"

window-size@0.1.0:
  version "0.1.0"
  resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.0.tgz#5438cd2ea93b202efa3a19fe8887aee7c94f9c9d"

wordwrap@0.0.2:
  version "0.0.2"
  resolved "https://registry.yarnpkg.com/wordwrap/-/wordwrap-0.0.2.tgz#b79669bb42ecb409f83d583cad52ca17eaa1643f"

workerpool@6.0.2:
  version "6.0.2"
  resolved "https://registry.yarnpkg.com/workerpool/-/workerpool-6.0.2.tgz#e241b43d8d033f1beb52c7851069456039d1d438"
  integrity sha512-DSNyvOpFKrNusaaUwk+ej6cBj1bmhLcBfj80elGk+ZIo5JSkq+unB1dLKEOcNfJDZgjGICfhQ0Q5TbP0PvF4+Q==

wrap-ansi@^5.1.0:
  version "5.1.0"
  resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-5.1.0.tgz#1fd1f67235d5b6d0fee781056001bfb694c03b09"
  integrity sha512-QC1/iN/2/RPVJ5jYK8BGttj5z83LmSKmvbvrXPNCLZSEb32KKVDJDl/MOt2N01qU2H/FkzEa9PKto1BqDjtd7Q==
  dependencies:
    ansi-styles "^3.2.0"
    string-width "^3.0.0"
    strip-ansi "^5.0.0"

wrappy@1:
  version "1.0.2"
  resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
  integrity sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=

y18n@^4.0.0:
  version "4.0.1"
  resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.1.tgz#8db2b83c31c5d75099bb890b23f3094891e247d4"
  integrity sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==

yargs-parser@13.1.2, yargs-parser@^13.1.2:
  version "13.1.2"
  resolved "https://registry.yarnpkg.com/yargs-parser/-/yargs-parser-13.1.2.tgz#130f09702ebaeef2650d54ce6e3e5706f7a4fb38"
  integrity sha512-3lbsNRf/j+A4QuSZfDRA7HRSfWrzO0YjqTJd5kjAq37Zep1CEgaYmrH9Q3GwPiB9cHyd1Y1UwggGhJGoxipbzg==
  dependencies:
    camelcase "^5.0.0"
    decamelize "^1.2.0"

yargs-unparser@2.0.0:
  version "2.0.0"
  resolved "https://registry.yarnpkg.com/yargs-unparser/-/yargs-unparser-2.0.0.tgz#f131f9226911ae5d9ad38c432fe809366c2325eb"
  integrity sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==
  dependencies:
    camelcase "^6.0.0"
    decamelize "^4.0.0"
    flat "^5.0.2"
    is-plain-obj "^2.1.0"

yargs@13.3.2:
  version "13.3.2"
  resolved "https://registry.yarnpkg.com/yargs/-/yargs-13.3.2.tgz#ad7ffefec1aa59565ac915f82dccb38a9c31a2dd"
  integrity sha512-AX3Zw5iPruN5ie6xGRIDgqkT+ZhnRlZMLMHAs8tg7nRruy2Nb+i5o9bwghAogtM08q1dpr2LVoS8KSTMYpWXUw==
  dependencies:
    cliui "^5.0.0"
    find-up "^3.0.0"
    get-caller-file "^2.0.1"
    require-directory "^2.1.1"
    require-main-filename "^2.0.0"
    set-blocking "^2.0.0"
    string-width "^3.0.0"
    which-module "^2.0.0"
    y18n "^4.0.0"
    yargs-parser "^13.1.2"

yargs@~3.10.0:
  version "3.10.0"
  resolved "https://registry.yarnpkg.com/yargs/-/yargs-3.10.0.tgz#f7ee7bd857dd7c1d2d38c0e74efbd681d1431fd1"
  dependencies:
    camelcase "^1.0.2"
    cliui "^2.1.0"
    decamelize "^1.0.0"
    window-size "0.1.0"

yocto-queue@^0.1.0:
  version "0.1.0"
  resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
  integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==
q8x  100644 History.md gSr适G#	CZ100644 LICENSE j`%ɺ%KB]100644 README.md ub/P`_Gx`)100644 browser.js TeZ,K6gұ100644 node.js ^oc$M0P100644 package.json .yiu4HXyd\x
1.0.2 / 2015-10-07
==================

  * use try/catch when checking `localStorage` (#3, @kumavis)

1.0.1 / 2014-11-25
==================

  * browser: use `console.warn()` for deprecation calls
  * browser: more jsdocs

1.0.0 / 2014-04-30
==================

  * initial commit
)M݄xDM(The MIT License)

Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>.=
obtaining a copy }-
 in the Software without
4	 to use,
 {
Software is ,
K
included in all 1p
EXPRESS OR 4
OF MERCHANTABILITY, $
& AUTHORS OR COPYRIGHT
W1 LIABILITY,
<
FROM, 7
 SOFTWARE.
"7ahx}util-deprecate
==============
### The Node.js `util.deprecate()` function with browser support

In Node.js, this module simply re-exports the `util.deprecate()` function.

In the web browser (i.e. via browserify), a browser-specific implementation
of the `util.deprecate()` function is used.


## API

A `deprecate()` function is the only thing exposed by this module.

``` javascript
// setup:
exports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead');


// users see:
foo();
// foo() is deprecated, use bar() instead
foo();
foo();
```


## License

(The MIT License)

Copyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>

Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.
]XdxN
/**
 * Module exports.
 */

module.exports = deprecate;

/**
 * Mark that a method should not be used.
 * Returns a modified function which warns once by default.
 *
 * If `localStorage.noDeprecation = true` is set, then it is a no-op.
 *
 * If `localStorage.throwDeprecation = true` is set, then deprecated functions
 * will throw an Error when invoked.
 *
 * If `localStorage.traceDeprecation = true` is set, then deprecated functions
 * will invoke `console.trace()` instead of `console.error()`.
 *
 * @param {Function} fn - the function to deprecate
 * @param {String} msg - the string to print to the console when `fn` is invoked
 * @returns {Function} a new "deprecated" version of `fn`
 * @api public
 */

function deprecate (fn, msg) {
  if (config('noDeprecation')) {
    return fn;
  }

  var warned = false;
  function deprecated() {
    if (!warned) {
      if (config('throwDeprecation')) {
        throw new Error(msg);
      } else if (config('traceDeprecation')) {
        console.trace(msg);
      } else {
        console.warn(msg);
      }
      warned = true;
    }
    return fn.apply(this, arguments);
  }

  return deprecated;
}

/**
 * Checks `localStorage` for boolean values for the given `name`.
 *
 * @param {String} name
 * @returns {Boolean}
 * @api private
 */

function config (name) {
  // accessing global.localStorage can trigger a DOMException in sandboxed iframes
  try {
    if (!global.localStorage) return false;
  } catch (_) {
    return false;
  }
  var val = global.localStorage[name];
  if (null == val) return false;
  return String(val).toLowerCase() === 'true';
}
Xx{ 
/**
 * For Node.js, simply re-export the core `util.deprecate` function.
 */

module.exports = require('util').deprecate;
3)8+xI{
  "name": "util-deprecate",
  "version": "1.0.2",
  "description": "The Node.js `util.deprecate()` function with browser support",
  "main": "node.js",
  "browser": "browser.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "repository": {
    "type": "git",
    "url": "git://github.com/TooTallNate/util-deprecate.git"
  },
  "keywords": [
    "util",
    "deprecate",
    "browserify",
    "browser",
    "node"
  ],
  "author": "Nathan Rajlich <nathan@tootallnate.net> (http://n8.io/)",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/TooTallNate/util-deprecate/issues"
  },
  "homepage": "https://github.com/TooTallNate/util-deprecate"
}
ԩx p100644 LICENSE 
w'w100644 README.md Wkt(\Rz840000 dist /{EKv100644 package.json y࿟hkNt߿TLh4˚;ףex7 .MIT License

Copyright (c) 2016 Toru Nagashima@pxi*# vue-eslint-parser

[![npm version](https://img.shields.io/npm/v/vue-eslint-parser.svg)](https://www.npmjs.com/package/vue-eslint-parser)
[![Downloads/month](https://img.shields.io/npm/dm/vue-eslint-parser.svg)](http://www.npmtrends.com/vue-eslint-parser)
[![Build Status](https://github.com/vuejs/vue-eslint-parser/workflows/CI/badge.svg)](https://github.com/vuejs/vue-eslint-parser/actions)

The ESLint custom parser for `.vue` files.

## ⤴️ Motivation

This parser allows us to lint the `<template>` of `.vue` files. We can make mistakes easily on `<template>` if we use complex directives and expressions in the template. This parser and the rules of [eslint-plugin-vue](https://github.com/vuejs/eslint-plugin-vue) would catch some of the mistakes.

## 💿 Installation

```bash
npm install --save-dev eslint vue-eslint-parser
```

## 📖 Usage

Write `parser` option into your `eslint.config.*` file.

```js
import vueParser from "vue-eslint-parser"
export default [
    js.configs.recommended,
    {
        files: ["*.vue", "**/*.vue"],
        languageOptions: {
            parser: vueParser,
        },
    }
]
```

## 🔧 Options

`parserOptions` has the same properties as what [espree](https://github.com/eslint/espree#usage), the default parser of ESLint, is supporting.
For example:

```js
import vueParser from "vue-eslint-parser"
export default [
    {
        files: ["*.vue", "**/*.vue"],
        languageOptions: {
            parser: vueParser,
            sourceType: "module",
            ecmaVersion: "latest",
            parserOptions: {
                ecmaFeatures: {
                    globalReturn: false,
                    impliedStrict: false,
                    jsx: false
                }
            }
        },
    }
]
```

### parserOptions.parser

You can use `parserOptions.parser` property to specify a custom parser to parse `<script>` tags.
Other properties than parser would be given to the specified parser.
For example:

```js
import vueParser from "vue-eslint-parser"
import babelParser from "@babel/eslint-parser"
export default [
    {
        files: ["*.vue", "**/*.vue"],
        languageOptions: {
            parser: vueParser,
            parserOptions: {
                parser: babelParser,
            }
        },
    }
]
```

```js
import vueParser from "vue-eslint-parser"
import tsParser from "@typescript-eslint/parser"
export default [
    {
        files: ["*.vue", "**/*.vue"],
        languageOptions: {
            parser: vueParser,
            parserOptions: {
                parser: tsParser,
            }
        },
    }
]
```

You can also specify an object and change the parser separately for `<script lang="...">`.

```js
import vueParser from "vue-eslint-parser"
import tsParser from "@typescript-eslint/parser"
export default [
    {
        files: ["*.vue", "**/*.vue"],
        languageOptions: {
            parser: vueParser,
            parserOptions: {
                "parser": {
                    // Script parser for `<script>`
                    "js": "espree",

                    // Script parser for `<script lang="ts">`
                    "ts": tsParser,

                    // Script parser for vue directives (e.g. `v-if=` or `:attribute=`)
                    // and vue interpolations (e.g. `{{variable}}`).
                    // If not specified, the parser determined by `<script lang ="...">` is used.
                    "<template>": "espree",
                }
            }
        },
    }
]
```

If the `parserOptions.parser` is `false`, the `vue-eslint-parser` skips parsing `<script>` tags completely.
This is useful for people who use the language ESLint community doesn't provide custom parser implementation.

### parserOptions.vueFeatures

You can use `parserOptions.vueFeatures` property to specify how to parse related to Vue features.
For example:

```js
import vueParser from "vue-eslint-parser"
export default [
    {
        files: ["*.vue", "**/*.vue"],
        languageOptions: {
            parser: vueParser,
            parserOptions: {
                vueFeatures: {
                    filter: true,
                    interpolationAsNonHTML: true,
                    styleCSSVariableInjection: true,
                    customMacros: []
                }
            }
        },
    }
]
```

### parserOptions.vueFeatures.filter

You can use `parserOptions.vueFeatures.filter` property to specify whether to parse the Vue2 filter. If you specify `false`, the parser does not parse `|` as a filter.
For example:

```json
{
    "parserOptions": {
        "vueFeatures": {
            "filter": false
        }
    }
}
```

If you specify `false`, it can be parsed in the same way as Vue 3.
The following template parses as a bitwise operation.

```vue
<template>
  <div>{{ a | b }}</div>
</template>
```

However, the following template that are valid in Vue 2 cannot be parsed.

```vue
<template>
  <div>{{ a | valid:filter }}</div>
</template>
```

### parserOptions.vueFeatures.interpolationAsNonHTML

You can use `parserOptions.vueFeatures.interpolationAsNonHTML` property to specify whether to parse the interpolation as HTML. If you specify `true`, the parser handles the interpolation as non-HTML (However, you can use HTML escaping in the interpolation). Default is `true`.
For example:

```json
{
    "parserOptions": {
        "vueFeatures": {
            "interpolationAsNonHTML": true
        }
    }
}
```

If you specify `true`, it can be parsed in the same way as Vue 3.
The following template can be parsed well.

```vue
<template>
  <div>{{a<b}}</div>
</template>
```

But, it cannot be parsed with Vue 2.

### parserOptions.vueFeatures.styleCSSVariableInjection

If set to `true`, to parse expressions in `v-bind` CSS functions inside `<style>` tags. `v-bind()` is parsed into the `VExpressionContainer` AST node and held in the `VElement` of `<style>`. Default is `true`.

See also to [here](https://github.com/vuejs/rfcs/blob/master/active-rfcs/0043-sfc-style-variables.md).

### parserOptions.vueFeatures.customMacros

Specifies an array of names of custom macros other than Vue standard macros.  
For example, if you have a custom macro `defineFoo()` and you want it processed by the parser, specify `["defineFoo"]`.

Note that this option only works in `<script setup>`.

### parserOptions.templateTokenizer

**This is an experimental feature. It may be changed or deleted without notice in the minor version.**

You can use `parserOptions.templateTokenizer` property to specify custom tokenizers to parse `<template lang="...">` tags.

For example to enable parsing of pug templates:

```jsonc
{
    "parserOptions": {
        "templateTokenizer": {
             // template tokenizer for `<template lang="pug">`
            "pug": "vue-eslint-parser-template-tokenizer-pug",
        }
    }
}
```

This option is only intended for plugin developers. **Be careful** when using this option directly, as it may change behaviour of rules you might have enabled.  
If you just want **pug** support, use [eslint-plugin-vue-pug](https://github.com/rashfael/eslint-plugin-vue-pug) instead, which uses this option internally.

See [implementing-custom-template-tokenizers.md](./docs/implementing-custom-template-tokenizers.md) for information on creating your own template tokenizer.

## 🎇 Usage for custom rules / plugins

- This parser provides `parserServices` to traverse `<template>`.
    - `defineTemplateBodyVisitor(templateVisitor, scriptVisitor, options)` ... returns ESLint visitor to traverse `<template>`.
    - `getTemplateBodyTokenStore()` ... returns ESLint `TokenStore` to get the tokens of `<template>`.
    - `getDocumentFragment()` ... returns the root `VDocumentFragment`.
    - `defineCustomBlocksVisitor(context, customParser, rule, scriptVisitor)` ... returns ESLint visitor that parses and traverses the contents of the custom block.
    - `defineDocumentVisitor(documentVisitor, options)` ... returns ESLint visitor to traverses the document.
- [ast.md](./docs/ast.md) is `<template>` AST specification.
- [mustache-interpolation-spacing.js](https://github.com/vuejs/eslint-plugin-vue/blob/b434ff99d37f35570fa351681e43ba2cf5746db3/lib/rules/mustache-interpolation-spacing.js) is an example.
- Check your version of ESLint as the location of `defineTemplateBodyVisitor` was moved from `context` to `context.sourceCode` after major version `9.x`

### `defineTemplateBodyVisitor(templateBodyVisitor, scriptVisitor, options)`

*Arguments*

- `templateBodyVisitor` ... Event handlers for `<template>`.
- `scriptVisitor` ... Event handlers for `<script>` or scripts. (optional)
- `options` ... Options. (optional)
  - `templateBodyTriggerSelector` ... Script AST node selector that triggers the templateBodyVisitor. Default is `"Program:exit"`. (optional)

```ts
import { AST } from "vue-eslint-parser"

export function create(context) {
    return context.sourceCode.parserServices.defineTemplateBodyVisitor(
        // Event handlers for <template>.
        {
            VElement(node: AST.VElement): void {
                //...
            }
        },
        // Event handlers for <script> or scripts. (optional)
        {
            Program(node: AST.ESLintProgram): void {
                //...
            }
        },
        // Options. (optional)
        {
            templateBodyTriggerSelector: "Program:exit"
        }
    )
}
```

## ⚠️ Known Limitations

Some rules make warnings due to the outside of `<script>` tags.
Please disable those rules for `.vue` files as necessary.

- [eol-last](http://eslint.org/docs/rules/eol-last)
- [linebreak-style](http://eslint.org/docs/rules/linebreak-style)
- [max-len](http://eslint.org/docs/rules/max-len)
- [max-lines](http://eslint.org/docs/rules/max-lines)
- [no-trailing-spaces](http://eslint.org/docs/rules/no-trailing-spaces)
- [unicode-bom](http://eslint.org/docs/rules/unicode-bom)
- Other rules which are using the source code text instead of AST might be confused as well.

## 📰 Changelog

- [GitHub Releases](https://github.com/vuejs/vue-eslint-parser/releases)

## 🍻 Contributing

Welcome contributing!

Please use GitHub's Issues/PRs.

If you want to write code, please execute `npm install` after you cloned this repository.
The `npm install` command installs dependencies.

### Development Tools

- `npm test` runs tests and measures coverage.
- `npm run build` compiles TypeScript source code to `index.js`, `index.js.map`, and `index.d.ts` in `dist`.
- `npm run coverage` shows the coverage result of `npm test` command with the default browser.
- `npm run lint` runs ESLint.
- `npm run update-fixtures` updates files in `test/fixtures/ast` directory based on `test/fixtures/ast/*/source.vue` files.
- `npm run watch` runs `build`, `update-fixtures`, and tests with `--watch` option.
Qxu 100644 index.cjs i/mUMd⨮"100644 index.cjs.map qEUia100644 index.d.cts D$\w?cye+}MKH,ضx   /**
 * @author Toru Nagashima <https://github.com/mysticatea>
 * See LICENSE file in root directory for full license.
 */
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
//#region \0rolldown/runtime.js
var __create = Object.create;
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __getProtoOf = Object.getPrototypeOf;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __exportAll = (all, no_symbols) => {
	let target = {};
	for (var name in all) {
		__defProp(target, name, {
			get: all[name],
			enumerable: true
		});
	}
	if (!no_symbols) {
		__defProp(target, Symbol.toStringTag, { value: "Module" });
	}
	return target;
};
var __copyProps = (to, from, except, desc) => {
	if (from && typeof from === "object" || typeof from === "function") {
		for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
			key = keys[i];
			if (!__hasOwnProp.call(to, key) && key !== except) {
				__defProp(to, key, {
					get: ((k) => from[k]).bind(null, key),
					enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
				});
			}
		}
	}
	return to;
};
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
	value: mod,
	enumerable: true
}) : target, mod));

//#endregion
let path = require("path");
path = __toESM(path);
let eslint_visitor_keys = require("eslint-visitor-keys");
eslint_visitor_keys = __toESM(eslint_visitor_keys);
let assert = require("assert");
assert = __toESM(assert);
let debug = require("debug");
debug = __toESM(debug);
let eslint_scope = require("eslint-scope");
eslint_scope = __toESM(eslint_scope);
let semver = require("semver");
let module$1 = require("module");
let espree = require("espree");
espree = __toESM(espree);
let events = require("events");
events = __toESM(events);
let esquery = require("esquery");
esquery = __toESM(esquery);

//#region src/ast/errors.ts
/**
* Check whether the given value has acorn style location information.
* @param x The value to check.
* @returns `true` if the value has acorn style location information.
*/
function isAcornStyleParseError(x) {
	return typeof x.message === "string" && typeof x.pos === "number" && typeof x.loc === "object" && x.loc !== null && typeof x.loc.line === "number" && typeof x.loc.column === "number";
}
/**
* Check whether the given value is probably a TSError.
* @param x The value to check.
* @returns `true` if the given value is probably a TSError.
*/
function isTSError(x) {
	return !(x instanceof ParseError) && typeof x.message === "string" && typeof x.index === "number" && typeof x.lineNumber === "number" && typeof x.column === "number" && x.name === "TSError";
}
/**
* HTML parse errors.
*/
var ParseError = class ParseError extends SyntaxError {
	code;
	index;
	lineNumber;
	column;
	/**
	* Create new parser error object.
	* @param code The error code. See also: https://html.spec.whatwg.org/multipage/parsing.html#parse-errors
	* @param offset The offset number of this error.
	* @param line The line number of this error.
	* @param column The column number of this error.
	*/
	static fromCode(code, offset, line, column) {
		return new ParseError(code, code, offset, line, column);
	}
	/**
	* Normalize the error object.
	* @param x The error object to normalize.
	*/
	static normalize(x) {
		if (isTSError(x)) return new ParseError(x.message, void 0, x.index, x.lineNumber, x.column);
		if (ParseError.isParseError(x)) return x;
		if (isAcornStyleParseError(x)) return new ParseError(x.message, void 0, x.pos, x.loc.line, x.loc.column);
		return null;
	}
	/**
	* Initialize this ParseError instance.
	* @param message The error message.
	* @param code The error code. See also: https://html.spec.whatwg.org/multipage/parsing.html#parse-errors
	* @param offset The offset number of this error.
	* @param line The line number of this error.
	* @param column The column number of this error.
	*/
	constructor(message, code, offset, line, column) {
		super(message);
		this.code = code;
		this.index = offset;
		this.lineNumber = line;
		this.column = column;
	}
	/**
	* Type guard for ParseError.
	* @param x The value to check.
	* @returns `true` if the value has `message`, `pos`, `loc` properties.
	*/
	static isParseError(x) {
		return x instanceof ParseError || typeof x.message === "string" && typeof x.index === "number" && typeof x.lineNumber === "number" && typeof x.column === "number";
	}
};

//#endregion
//#region src/ast/nodes.ts
/**
* Constants of namespaces.
* @see https://infra.spec.whatwg.org/#namespaces
*/
const NS = Object.freeze({
	HTML: "http://www.w3.org/1999/xhtml",
	MathML: "http://www.w3.org/1998/Math/MathML",
	SVG: "http://www.w3.org/2000/svg",
	XLink: "http://www.w3.org/1999/xlink",
	XML: "http://www.w3.org/XML/1998/namespace",
	XMLNS: "http://www.w3.org/2000/xmlns/"
});

//#endregion
//#region src/ast/traverse.ts
const KEYS = eslint_visitor_keys.unionWith({
	VAttribute: ["key", "value"],
	VDirectiveKey: [
		"name",
		"argument",
		"modifiers"
	],
	VDocumentFragment: ["children"],
	VElement: [
		"startTag",
		"children",
		"endTag"
	],
	VEndTag: [],
	VExpressionContainer: ["expression"],
	VFilter: ["callee", "arguments"],
	VFilterSequenceExpression: ["expression", "filters"],
	VForExpression: ["left", "right"],
	VIdentifier: [],
	VLiteral: [],
	VOnExpression: ["body"],
	VSlotScopeExpression: ["params"],
	VStartTag: ["attributes"],
	VText: [],
	VGenericExpression: ["params"]
});
/**
* Check that the given key should be traversed or not.
* @param key The key to check.
* @param value The value of the key in the node.
* @returns `true` if the key should be traversed.
*/
function fallbackKeysFilter(key, value = null) {
	return key !== "comments" && key !== "leadingComments" && key !== "loc" && key !== "parent" && key !== "range" && key !== "tokens" && key !== "trailingComments" && value !== null && typeof value === "object" && (typeof value.type === "string" || Array.isArray(value));
}
/**
* Get the keys of the given node to traverse it.
* @param node The node to get.
* @returns The keys to traverse.
*/
function getFallbackKeys(node) {
	return Object.keys(node).filter((key) => fallbackKeysFilter(key, node[key]));
}
/**
* Check wheather a given value is a node.
* @param x The value to check.
* @returns `true` if the value is a node.
*/
function isNode(x) {
	return x !== null && typeof x === "object" && typeof x.type === "string";
}
/**
* Traverse the given node.
* @param node The node to traverse.
* @param parent The parent node.
* @param visitor The node visitor.
*/
function traverse(node, parent, visitor) {
	let i = 0;
	let j = 0;
	visitor.enterNode(node, parent);
	const keys = (visitor.visitorKeys ?? KEYS)[node.type] ?? getFallbackKeys(node);
	for (i = 0; i < keys.length; ++i) {
		const child = node[keys[i]];
		if (Array.isArray(child)) {
			for (j = 0; j < child.length; ++j) if (isNode(child[j])) traverse(child[j], node, visitor);
		} else if (isNode(child)) traverse(child, node, visitor);
	}
	visitor.leaveNode(node, parent);
}
/**
* Traverse the given AST tree.
* @param node Root node to traverse.
* @param visitor Visitor.
*/
function traverseNodes(node, visitor) {
	traverse(node, null, visitor);
}

//#endregion
//#region src/ast/index.ts
var ast_exports = /* @__PURE__ */ __exportAll({
	KEYS: () => KEYS,
	NS: () => NS,
	ParseError: () => ParseError,
	getFallbackKeys: () => getFallbackKeys,
	traverseNodes: () => traverseNodes
});

//#endregion
//#region src/utils/utils.ts
/**
* @see https://github.com/vuejs/vue-next/blob/48de8a42b7fed7a03f7f1ff5d53d6a704252cafe/packages/shared/src/index.ts#L109
*/
function camelize(str) {
	return str.replace(/-(\w)/gu, (_, c) => c ? c.toUpperCase() : "");
}
/**
* A binary search implementation that finds the index at which `predicate`
* stops returning `true` and starts returning `false` (consistently) when run
* on the items of the array. It **assumes** that mapping the array via the
* predicate results in the shape `[...true[], ...false[]]`. *For any other case
* the result is unpredictable*.
*
* This is the base implementation of the `sortedIndex` functions which define
* the predicate for the user, for common use-cases.
*
* It is similar to `findIndex`, but runs at O(logN), whereas the latter is
* general purpose function which runs on any array and predicate, but runs at
* O(N) time.
*
* MIT License | Copyright (c) 2018 remeda | https://remedajs.com/
*
* The implementation is copied from remeda package:
* https://github.com/remeda/remeda/blob/df5fe74841c07bc356bbaa2c89bc7ba0cafafd0a/packages/remeda/src/internal/binarySearchCutoffIndex.ts#L15
*/
function binarySearchCutoffIndex(array, predicate) {
	let lowIndex = 0;
	let highIndex = array.length;
	while (lowIndex < highIndex) {
		const pivotIndex = lowIndex + highIndex >>> 1;
		const pivot = array[pivotIndex];
		if (predicate(pivot, pivotIndex, array)) lowIndex = pivotIndex + 1;
		else highIndex = pivotIndex;
	}
	return highIndex;
}
/**
* Find the insertion position (index) of an item in an array with items sorted
* in ascending order; so that `splice(sortedIndex, 0, item)` would result in
* maintaining the array's sort-ness. The array can contain duplicates.
* If the item already exists in the array the index would be of the *last*
* occurrence of the item.
*
* Runs in O(logN) time.
*
* @param item - The item to insert.
* @returns Insertion index (In the range 0..data.length).
* @signature
*    R.sortedLastIndex(item)(data)
* @example
*    R.pipe(['a','a','b','c','c'], sortedLastIndex('c')) // => 5
*
* MIT License | Copyright (c) 2018 remeda | https://remedajs.com/
*
* The implementation is copied from remeda package:
* https://github.com/remeda/remeda/blob/df5fe74841c07bc356bbaa2c89bc7ba0cafafd0a/packages/remeda/src/sortedLastIndex.ts#L51
*/
function sortedLastIndex(array, item) {
	return binarySearchCutoffIndex(array, (pivot) => pivot <= item);
}
/**
* Find the insertion position (index) of an item in an array with items sorted
* in ascending order using a value function; so that
* `splice(sortedIndex, 0, item)` would result in maintaining the arrays sort-
* ness. The array can contain duplicates.
* If the item already exists in the array the index would be of the *first*
* occurrence of the item.
*
* Runs in O(logN) time.
*
* See also:
* * `findIndex` - scans a possibly unsorted array in-order (linear search).
* * `sortedIndex` - like this function, but doesn't take a callbackfn.
* * `sortedLastIndexBy` - like this function, but finds the last suitable index.
* * `sortedLastIndex` - like `sortedIndex`, but finds the last suitable index.
* * `rankBy` - scans a possibly unsorted array in-order, returning the index based on a sorting criteria.
*
* @param data - The (ascending) sorted array.
* @param item - The item to insert.
* @param valueFunction - All comparisons would be performed on the result of
* calling this function on each compared item. Preferably this function should
* return a `number` or `string`. This function should be the same as the one
* provided to sortBy to sort the array. The function is called exactly once on
* each items that is compared against in the array, and once at the beginning
* on `item`. When called on `item` the `index` argument is `undefined`.
* @returns Insertion index (In the range 0..data.length).
* @signature
*    R.sortedIndexBy(data, item, valueFunction)
* @example
*    R.sortedIndexBy([{age:20},{age:22}],{age:21},prop('age')) // => 1
*
* MIT License | Copyright (c) 2018 remeda | https://remedajs.com/
*
* The implementation is copied from remeda package:
* https://github.com/remeda/remeda/blob/df5fe74841c07bc356bbaa2c89bc7ba0cafafd0a/packages/remeda/src/sortedIndexBy.ts#L37
*/
function sortedIndexBy(array, item, valueFunction) {
	const value = valueFunction(item, void 0, array);
	return binarySearchCutoffIndex(array, (pivot, index) => valueFunction(pivot, index, array) < value);
}
/**
* Find the insertion position (index) of an item in an array with items sorted
* in ascending order using a value function; so that
* `splice(sortedIndex, 0, item)` would result in maintaining the arrays sort-
* ness. The array can contain duplicates.
* If the item already exists in the array the index would be of the *last*
* occurrence of the item.
*
* Runs in O(logN) time.
*
* See also:
* * `findIndex` - scans a possibly unsorted array in-order (linear search).
* * `sortedLastIndex` - a simplified version of this function, without a callbackfn.
* * `sortedIndexBy` - like this function, but returns the first suitable index.
* * `sortedIndex` - like `sortedLastIndex` but without a callbackfn.
* * `rankBy` - scans a possibly unsorted array in-order, returning the index based on a sorting criteria.
*
* @param data - The (ascending) sorted array.
* @param item - The item to insert.
* @param valueFunction - All comparisons would be performed on the result of
* calling this function on each compared item. Preferably this function should
* return a `number` or `string`. This function should be the same as the one
* provided to sortBy to sort the array. The function is called exactly once on
* each items that is compared against in the array, and once at the beginning
* on `item`. When called on `item` the `index` argument is `undefined`.
* @returns Insertion index (In the range 0..data.length).
* @signature
*    R.sortedLastIndexBy(data, item, valueFunction)
* @example
*    R.sortedLastIndexBy([{age:20},{age:22}],{age:21},prop('age')) // => 1
*
* MIT License | Copyright (c) 2018 remeda | https://remedajs.com/
*
* The implementation is copied from remeda package:
* https://github.com/remeda/remeda/blob/df5fe74841c07bc356bbaa2c89bc7ba0cafafd0a/packages/remeda/src/sortedLastIndexBy.ts#L37
*/
function sortedLastIndexBy(array, item, valueFunction) {
	const value = valueFunction(item, void 0, array);
	return binarySearchCutoffIndex(array, (pivot, index) => valueFunction(pivot, index, array) <= value);
}
/**
* Creates a duplicate-free version of an array.
*
* This function takes an array and returns a new array containing only the unique values
* from the original array, preserving the order of first occurrence.
*
* @template T - The type of elements in the array.
* @param {T[]} arr - The array to process.
* @returns {T[]} A new array with only unique values from the original array.
*
* @example
* const array = [1, 2, 2, 3, 4, 4, 5];
* const result = uniq(array);
* // result will be [1, 2, 3, 4, 5]
*
* MIT © Viva Republica, Inc. | https://es-toolkit.dev/
*
* The implementation is copied from es-toolkit package:
* https://github.com/toss/es-toolkit/blob/16709839f131269b84cdd96e9645df52648ccedf/src/array/uniq.ts#L16
*/
function uniq(arr) {
	return Array.from(new Set(arr));
}
/**
* Returns the intersection of multiple arrays.
*
* This function takes multiple arrays and returns a new array containing the elements that are
* present in all provided arrays. It effectively filters out any elements that are not found
* in every array.
*
* @template T - The type of elements in the arrays.
* @param {...(ArrayLike<T> | null | undefined)} arrays - The arrays to compare.
* @returns {T[]} A new array containing the elements that are present in all arrays.
*
* @example
* const array1 = [1, 2, 3, 4, 5];
* const array2 = [3, 4, 5, 6, 7];
* const result = intersection(array1, array2);
* // result will be [3, 4, 5] since these elements are in both arrays.
*
* MIT © Viva Republica, Inc. | https://es-toolkit.dev/
*
* The implementation is copied from es-toolkit package:
* https://github.com/toss/es-toolkit/blob/16709839f131269b84cdd96e9645df52648ccedf/src/compat/array/intersection.ts#L22
* https://github.com/toss/es-toolkit/blob/16709839f131269b84cdd96e9645df52648ccedf/src/array/intersection.ts#L19
*/
function intersection(...arrays) {
	if (arrays.length === 0) return [];
	let result = uniq(arrays[0]);
	for (let i = 1; i < arrays.length; i++) {
		const array = arrays[i];
		const secondSet = new Set(array);
		result = result.filter((item) => secondSet.has(item));
	}
	return result;
}
/**
* This function takes multiple arrays and returns a new array containing only the unique values
* from all input arrays, preserving the order of their first occurrence.
*
* @template T - The type of elements in the arrays.
* @param {Array<ArrayLike<T> | null | undefined>} arrays - The arrays to inspect.
* @returns {T[]} Returns the new array of combined unique values.
*
* @example
* // Returns [2, 1]
* union([2], [1, 2]);
*
* @example
* // Returns [2, 1, 3]
* union([2], [1, 2], [2, 3]);
*
* @example
* // Returns [1, 3, 2, [5], [4]] (does not deeply flatten nested arrays)
* union([1, 3, 2], [1, [5]], [2, [4]]);
*
* @example
* // Returns [0, 2, 1] (ignores non-array values like 3 and { '0': 1 })
* union([0], 3, { '0': 1 }, null, [2, 1]);
* @example
* // Returns [0, 'a', 2, 1] (treats array-like object { 0: 'a', length: 1 } as a valid array)
* union([0], { 0: 'a', length: 1 }, [2, 1]);
*
* MIT © Viva Republica, Inc. | https://es-toolkit.dev/
*
* The implementation is copied from es-toolkit package:
* https://github.com/toss/es-toolkit/blob/16709839f131269b84cdd96e9645df52648ccedf/src/compat/array/union.ts#L61
* https://github.com/toss/es-toolkit/blob/16709839f131269b84cdd96e9645df52648ccedf/src/compat/array/flattenDepth.ts#L21
*/
function union(...arrays) {
	return uniq(arrays.flat());
}

//#endregion
//#region src/common/lines-and-columns.ts
/**
* A class for getting lines and columns location.
*/
var LinesAndColumns = class {
	ltOffsets;
	/**
	* Initialize.
	* @param ltOffsets The list of the offset of line terminators.
	*/
	constructor(ltOffsets) {
		this.ltOffsets = ltOffsets;
	}
	/**
	* Calculate the location of the given index.
	* @param index The index to calculate their location.
	* @returns The location of the index.
	*/
	getLocFromIndex(index) {
		const line = sortedLastIndex(this.ltOffsets, index) + 1;
		return {
			line,
			column: index - (line === 1 ? 0 : this.ltOffsets[line - 2])
		};
	}
	createOffsetLocationCalculator(offset) {
		return {
			getFixOffset() {
				return offset;
			},
			getLocFromIndex: this.getLocFromIndex.bind(this)
		};
	}
};

//#endregion
//#region src/common/location-calculator.ts
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
/**
* Location calculators.
*
* HTML tokenizers remove several characters to handle HTML entities and line terminators.
* Tokens have the processed text as their value, but tokens have offsets and locations in the original text.
* This calculator calculates the original locations from the processed texts.
*
* This calculator will be used for:
*
* - Adjusts the locations of script ASTs.
* - Creates expression containers in postprocess.
*/
var LocationCalculatorForHtml = class LocationCalculatorForHtml extends LinesAndColumns {
	gapOffsets;
	baseOffset;
	baseIndexOfGap;
	shiftOffset;
	/**
	* Initialize this calculator.
	* @param gapOffsets The list of the offset of removed characters in tokenization phase.
	* @param ltOffsets The list of the offset of line terminators.
	* @param baseOffset The base offset to calculate locations.
	* @param shiftOffset The shift offset to calculate locations.
	*/
	constructor(gapOffsets, ltOffsets, baseOffset, shiftOffset = 0) {
		super(ltOffsets);
		this.gapOffsets = gapOffsets;
		this.ltOffsets = ltOffsets;
		this.baseOffset = baseOffset ?? 0;
		this.baseIndexOfGap = this.baseOffset === 0 ? 0 : sortedLastIndex(gapOffsets, this.baseOffset);
		this.shiftOffset = shiftOffset;
	}
	/**
	* Get sub calculator which have the given base offset.
	* @param offset The base offset of new sub calculator.
	* @returns Sub calculator.
	*/
	getSubCalculatorAfter(offset) {
		return new LocationCalculatorForHtml(this.gapOffsets, this.ltOffsets, this.baseOffset + offset, this.shiftOffset);
	}
	/**
	* Get sub calculator that shifts the given offset.
	* @param offset The shift of new sub calculator.
	* @returns Sub calculator.
	*/
	getSubCalculatorShift(offset) {
		return new LocationCalculatorForHtml(this.gapOffsets, this.ltOffsets, this.baseOffset, this.shiftOffset + offset);
	}
	/**
	* Calculate gap at the given index.
	* @param index The index to calculate gap.
	*/
	_getGap(index) {
		const offsets = this.gapOffsets;
		let g0 = sortedLastIndex(offsets, index + this.baseOffset);
		let pos = index + this.baseOffset + g0 - this.baseIndexOfGap;
		while (g0 < offsets.length && offsets[g0] <= pos) {
			g0 += 1;
			pos += 1;
		}
		return g0 - this.baseIndexOfGap;
	}
	/**
	* Calculate the location of the given index.
	* @param index The index to calculate their location.
	* @returns The location of the index.
	*/
	getLocation(index) {
		return this.getLocFromIndex(this.getOffsetWithGap(index));
	}
	/**
	* Calculate the offset of the given index.
	* @param index The index to calculate their location.
	* @returns The offset of the index.
	*/
	getOffsetWithGap(index) {
		return index + this.getFixOffset(index);
	}
	/**
	* Gets the fix location offset of the given offset with using the base offset of this calculator.
	* @param offset The offset to modify.
	*/
	getFixOffset(offset) {
		const shiftOffset = this.shiftOffset;
		const gap = this._getGap(offset + shiftOffset);
		return this.baseOffset + gap + shiftOffset;
	}
};

//#endregion
//#region src/common/debug.ts
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
const debug$1 = (0, debug.default)("vue-eslint-parser");

//#endregion
//#region src/common/ast-utils.ts
/**
* Check whether the node is a `<script>` element.
* @param node The node to check.
* @returns `true` if the node is a `<script>` element.
*/
function isScriptElement(node) {
	return node.type === "VElement" && node.name === "script";
}
/**
* Checks whether the given script element is `<script setup>`.
*/
function isScriptSetupElement(script) {
	return isScriptElement(script) && script.startTag.attributes.some((attr) => !attr.directive && attr.key.name === "setup");
}
/**
* Check whether the node is a `<template>` element.
* @param node The node to check.
* @returns `true` if the node is a `<template>` element.
*/
function isTemplateElement(node) {
	return node.type === "VElement" && node.name === "template";
}
/**
* Check whether the node is a `<style>` element.
* @param node The node to check.
* @returns `true` if the node is a `<style>` element.
*/
function isStyleElement(node) {
	return node.type === "VElement" && node.name === "style";
}
/**
* Get the belonging document of the given node.
* @param leafNode The node to get.
* @returns The belonging document.
*/
function getOwnerDocument(leafNode) {
	let node = leafNode;
	while (node != null && node.type !== "VDocumentFragment") node = node.parent;
	return node;
}
/**
* Check whether the attribute node is a `lang` attribute.
* @param attribute The attribute node to check.
* @returns `true` if the attribute node is a `lang` attribute.
*/
function isLang(attribute) {
	return attribute.directive === false && attribute.key.name === "lang";
}
/**
* Get the `lang` attribute value from a given element.
* @param element The element to get.
* @param defaultLang The default value of the `lang` attribute.
* @returns The `lang` attribute value.
*/
function getLang(element) {
	return (element?.startTag.attributes.find(isLang))?.value?.value || null;
}
/**
* Check whether the given script element has `lang="ts"`.
* @param element The element to check.
* @returns The given script element has `lang="ts"`.
*/
function isTSLang(element) {
	const lang = getLang(element);
	return lang === "ts" || lang === "tsx";
}
/**
* Find `generic` directive from given `<script>` element
*/
function findGenericDirective(element) {
	return element.startTag.attributes.find((attr) => attr.directive && attr.value?.expression?.type === "VGenericExpression") || null;
}

//#endregion
//#region src/common/parser-object.ts
function isParserObject(value) {
	return isEnhancedParserObject(value) || isBasicParserObject(value);
}
function isEnhancedParserObject(value) {
	return Boolean(value && typeof value.parseForESLint === "function");
}
function isBasicParserObject(value) {
	return Boolean(value && typeof value.parse === "function");
}

//#endregion
//#region src/common/parser-options.ts
function isSFCFile(parserOptions) {
	if (parserOptions.filePath === "<input>") return true;
	return path.extname(parserOptions.filePath || "unknown.vue") === ".vue";
}
/**
* Gets the script parser name from the given parser lang.
*/
function getScriptParser(parser, getParserLang) {
	if (isParserObject(parser)) return parser;
	if (parser && typeof parser === "object") {
		const parserLang = getParserLang();
		const parserLangs = parserLang == null ? [] : typeof parserLang === "string" ? [parserLang] : parserLang;
		for (const lang of parserLangs) {
			const parserForLang = lang && parser[lang];
			if (typeof parserForLang === "string" || isParserObject(parserForLang)) return parserForLang;
		}
		return parser.js;
	}
	return typeof parser === "string" ? parser : void 0;
}
function getParserLangFromSFC(doc) {
	if (doc) {
		const scripts = doc.children.filter(isScriptElement);
		const script = scripts.length === 2 && scripts.find(isScriptSetupElement) || scripts[0];
		if (script) return getLang(script);
	}
	return null;
}

//#endregion
//#region src/common/eslint-scope.ts
let escopeCache = null;
/**
* Load the newest `eslint-scope` from the loaded ESLint or dependency.
*/
function getEslintScope() {
	return escopeCache ?? (escopeCache = getNewest());
}
/**
* Load the newest `eslint-scope` from the dependency.
*/
function getNewest() {
	let newest = eslint_scope;
	const userEscope = getEslintScopeFromUser();
	if (userEscope.version != null && (0, semver.lte)(newest.version, userEscope.version)) newest = userEscope;
	return newest;
}
/**
* Load `eslint-scope` from the user dir.
*/
function getEslintScopeFromUser() {
	try {
		const cwd = process.cwd();
		return (0, module$1.createRequire)(path.default.join(cwd, "__placeholder__.js"))("eslint-scope");
	} catch {
		return eslint_scope;
	}
}

//#endregion
//#region src/common/espree.ts
let espreeCache = null;
/**
* Gets the espree that the given ecmaVersion can parse.
*/
function getEspree() {
	return espreeCache ?? (espreeCache = getNewestEspree());
}
function getEcmaVersionIfUseEspree(parserOptions) {
	if (parserOptions.parser != null && parserOptions.parser !== "espree") return;
	if (parserOptions.ecmaVersion === "latest" || parserOptions.ecmaVersion == null) return getDefaultEcmaVersion();
	return normalizeEcmaVersion(parserOptions.ecmaVersion);
}
/**
* Load `espree` from the user dir.
*/
function getEspreeFromUser() {
	try {
		const cwd = process.cwd();
		return (0, module$1.createRequire)(path.default.join(cwd, "__placeholder__.js"))("espree");
	} catch {
		return espree;
	}
}
/**
* Load the newest `espree` from the dependency.
*/
function getNewestEspree() {
	let newest = espree;
	const userEspree = getEspreeFromUser();
	if (userEspree.version != null && (0, semver.lte)(newest.version, userEspree.version)) newest = userEspree;
	return newest;
}
function getDefaultEcmaVersion() {
	return getLatestEcmaVersion(getEspree());
}
/**
* Normalize ECMAScript version
*/
function normalizeEcmaVersion(version) {
	if (version > 5 && version < 2015) return version + 2009;
	return version;
}
function getLatestEcmaVersion(espree$1) {
	return normalizeEcmaVersion(espree$1.latestEcmaVersion);
}

//#endregion
//#region src/script-setup/parser-options.ts
const DEFAULT_ECMA_VERSION = "latest";
const ANALYZE_SCOPE_DEFAULT_ECMA_VERSION = 2022;

//#endregion
//#region src/script/scope-analyzer.ts
/**
* Check whether the given reference is unique in the belonging array.
* @param reference The current reference to check.
* @param index The index of the reference.
* @param references The belonging array of the reference.
*/
function isUnique(reference, index, references) {
	return index === 0 || reference.identifier !== references[index - 1].identifier;
}
/**
* Check whether a given variable has that definition.
* @param variable The variable to check.
* @returns `true` if the variable has that definition.
*/
function hasDefinition(variable) {
	return variable.defs.length >= 1;
}
/**
* Transform the given reference object.
* @param reference The source reference object.
* @returns The transformed reference object.
*/
function transformReference(reference) {
	const ret = {
		id: reference.identifier,
		mode: reference.isReadOnly() ? "r" : reference.isWriteOnly() ? "w" : "rw",
		variable: null,
		isValueReference: reference.isValueReference,
		isTypeReference: reference.isTypeReference
	};
	Object.defineProperty(ret, "variable", { enumerable: false });
	return ret;
}
/**
* Transform the given variable object.
* @param variable The source variable object.
* @returns The transformed variable object.
*/
function transformVariable(variable, kind) {
	const ret = {
		id: variable.defs[0].name,
		kind,
		references: []
	};
	Object.defineProperty(ret, "references", { enumerable: false });
	return ret;
}
/**
* Get the `for` statement scope.
* @param scope The global scope.
* @returns The `for` statement scope.
*/
function getForScope(scope) {
	const child = scope.childScopes[0];
	return child.block === scope.block ? child.childScopes[0] : child;
}
function analyzeScope(ast, parserOptions) {
	const ecmaVersion = getEcmaVersionIfUseEspree(parserOptions) ?? ANALYZE_SCOPE_DEFAULT_ECMA_VERSION;
	const ecmaFeatures = parserOptions.ecmaFeatures ?? {};
	const sourceType = parserOptions.sourceType ?? "script";
	return getEslintScope().analyze(ast, {
		ignoreEval: true,
		nodejsScope: false,
		impliedStrict: ecmaFeatures.impliedStrict,
		ecmaVersion,
		sourceType,
		fallback: getFallbackKeys
	});
}
/**
* Analyze the scope of the given AST.
* @param {ParserResult} parserResult The parser result to analyze.
* @param parserOptions
*/
function analyze(parserResult, parserOptions) {
	return (parserResult.scopeManager || analyzeScope(parserResult.ast, parserOptions)).globalScope;
}
/**
* Analyze the external references of the given AST.
* @param {ParserResult} parserResult The parser result to analyze.
* @returns {Reference[]} The reference objects of external references.
*/
function analyzeExternalReferences(parserResult, parserOptions) {
	return analyze(parserResult, parserOptions).through.filter(isUnique).map(transformReference);
}
/**
* Analyze the external references of the given AST.
* @param {ParserResult} parserResult The parser result to analyze.
* @returns {Reference[]} The reference objects of external references.
*/
function analyzeVariablesAndExternalReferences(parserResult, kind, parserOptions) {
	const scope = analyze(parserResult, parserOptions);
	return {
		variables: getForScope(scope).variables.filter(hasDefinition).map((v) => transformVariable(v, kind)),
		references: scope.through.filter(isUnique).map(transformReference)
	};
}

//#endregion
//#region src/common/fix-locations.ts
/**
* Do post-process of parsing an expression.
*
* 1. Set `node.parent`.
* 2. Fix `node.range` and `node.loc` for HTML entities.
*
* @param result The parsing result to modify.
* @param locationCalculator The location calculator to modify.
*/
function fixLocations(result, locationCalculator) {
	fixNodeLocations(result.ast, result.visitorKeys, locationCalculator);
	for (const token of result.ast.tokens ?? []) fixLocation(token, locationCalculator);
	for (const comment of result.ast.comments ?? []) fixLocation(comment, locationCalculator);
}
function fixNodeLocations(rootNode, visitorKeys, locationCalculator) {
	const traversed = /* @__PURE__ */ new Map();
	traverseNodes(rootNode, {
		visitorKeys,
		enterNode(node, parent) {
			if (!traversed.has(node)) {
				traversed.set(node, node);
				node.parent = parent;
				if (traversed.has(node.range)) {
					if (!traversed.has(node.loc)) {
						node.loc.start = locationCalculator.getLocFromIndex(node.range[0]);
						node.loc.end = locationCalculator.getLocFromIndex(node.range[1]);
						traversed.set(node.loc, node);
					} else if (node.start != null || node.end != null) {
						const traversedNode = traversed.get(node.range);
						if (traversedNode.type === node.type) {
							node.start = traversedNode.start;
							node.end = traversedNode.end;
						}
					}
				} else {
					fixLocation(node, locationCalculator);
					traversed.set(node.range, node);
					traversed.set(node.loc, node);
				}
			}
		},
		leaveNode() {}
	});
}
/**
* Modify the location information of the given node with using the base offset and gaps of this calculator.
* @param node The node to modify their location.
*/
function fixLocation(node, locationCalculator) {
	const range = node.range;
	const loc = node.loc;
	const d0 = locationCalculator.getFixOffset(range[0], "start");
	const d1 = locationCalculator.getFixOffset(range[1], "end");
	if (d0 !== 0) {
		range[0] += d0;
		if (node.start != null) node.start += d0;
		loc.start = locationCalculator.getLocFromIndex(range[0]);
	}
	if (d1 !== 0) {
		range[1] += d1;
		if (node.end != null) node.end += d0;
		loc.end = locationCalculator.getLocFromIndex(range[1]);
	}
	return node;
}
/**
* Modify the location information of the given error with using the base offset and gaps of this calculator.
* @param error The error to modify their location.
*/
function fixErrorLocation(error, locationCalculator) {
	const diff = locationCalculator.getFixOffset(error.index, "start");
	error.index += diff;
	const loc = locationCalculator.getLocFromIndex(error.index);
	error.lineNumber = loc.line;
	error.column = loc.column;
}

//#endregion
//#region src/script/generic.ts
function extractGeneric(element) {
	const genericAttr = findGenericDirective(element);
	if (!genericAttr) return null;
	const genericNode = genericAttr.value.expression;
	return {
		node: genericNode,
		defineTypes: genericNode.params.map((t, i) => ({
			node: t,
			define: `type ${t.name.name} = ${getConstraint(t, genericNode.rawParams[i])}`
		})),
		postprocess({ result, getTypeBlock, isRemoveTarget, getTypeDefScope }) {
			removeTypeDeclarations(getTypeBlock?.(result.ast) ?? result.ast, isRemoveTarget);
			if (result.ast.tokens) removeTypeDeclarationTokens(result.ast.tokens, isRemoveTarget);
			if (result.ast.comments) removeTypeDeclarationTokens(result.ast.comments, isRemoveTarget);
			if (result.scopeManager) {
				const typeDefScope = getTypeDefScope(result.scopeManager);
				restoreScope(result.scopeManager, typeDefScope, isRemoveTarget);
			}
		}
	};
	function removeTypeDeclarations(node, isRemoveTarget) {
		for (let index = node.body.length - 1; index >= 0; index--) if (isRemoveTarget(node.body[index])) node.body.splice(index, 1);
	}
	function removeTypeDeclarationTokens(tokens, isRemoveTarget) {
		for (let index = tokens.length - 1; index >= 0; index--) if (isRemoveTarget(tokens[index])) tokens.splice(index, 1);
	}
	function restoreScope(scopeManager, typeDefScope, isRemoveTarget) {
		for (const variable of [...typeDefScope.variables]) {
			let def = variable.defs.find((d) => isRemoveTarget(d.name));
			while (def) {
				removeVariableDef(variable, def, typeDefScope);
				def = variable.defs.find((d) => isRemoveTarget(d.name));
			}
		}
		for (const reference of [...typeDefScope.references]) if (isRemoveTarget(reference.identifier)) removeReference(reference, typeDefScope);
		for (const scope of [...scopeManager.scopes]) if (isRemoveTarget(scope.block)) removeScope(scopeManager, scope);
	}
}
function getConstraint(node, rawParam) {
	if (!node.constraint) return "unknown";
	let index = rawParam.indexOf(node.name.name) + node.name.name.length;
	let startIndex = null;
	while (index < rawParam.length) {
		if (startIndex == null) {
			if (rawParam.startsWith("extends", index)) {
				startIndex = index = index + 7;
				continue;
			}
		} else if (rawParam[index] === "=") {
			if (rawParam[index + 1] === ">") {
				index += 2;
				continue;
			}
			return rawParam.slice(startIndex, index);
		}
		if (rawParam.startsWith("//", index)) {
			const lfIndex = rawParam.indexOf("\n", index);
			if (lfIndex >= 0) {
				index = lfIndex + 1;
				continue;
			}
			return "unknown";
		}
		if (rawParam.startsWith("/*", index)) {
			const endIndex = rawParam.indexOf("*/", index);
			if (endIndex >= 0) {
				index = endIndex + 2;
				continue;
			}
			return "unknown";
		}
		index++;
	}
	if (startIndex == null) return "unknown";
	return rawParam.slice(startIndex);
}
/** Remove variable def */
function removeVariableDef(variable, def, scope) {
	const defIndex = variable.defs.indexOf(def);
	if (defIndex < 0) return;
	variable.defs.splice(defIndex, 1);
	if (variable.defs.length === 0) {
		referencesToThrough(variable.references, scope);
		variable.references.forEach((r) => {
			if (r.init) r.init = false;
			r.resolved = null;
		});
		scope.variables.splice(scope.variables.indexOf(variable), 1);
		const name = variable.name;
		if (variable === scope.set.get(name)) scope.set.delete(name);
	} else {
		const idIndex = variable.identifiers.indexOf(def.name);
		if (idIndex >= 0) variable.identifiers.splice(idIndex, 1);
	}
}
/** Move reference to through */
function referencesToThrough(references, baseScope) {
	let scope = baseScope;
	while (scope) {
		addAllReferences(scope.through, references);
		scope = scope.upper;
	}
}
/**
* Add all references to array
*/
function addAllReferences(list, elements) {
	list.push(...elements);
	list.sort((a, b) => a.identifier.range[0] - b.identifier.range[0]);
}
/** Remove reference */
function removeReference(reference, baseScope) {
	if (reference.resolved) if (reference.resolved.defs.some((d) => d.name === reference.identifier)) {
		const varIndex = baseScope.variables.indexOf(reference.resolved);
		if (varIndex >= 0) baseScope.variables.splice(varIndex, 1);
		const name = reference.identifier.name;
		if (reference.resolved === baseScope.set.get(name)) baseScope.set.delete(name);
	} else {
		const refIndex = reference.resolved.references.indexOf(reference);
		if (refIndex >= 0) reference.resolved.references.splice(refIndex, 1);
	}
	let scope = baseScope;
	while (scope) {
		const refIndex = scope.references.indexOf(reference);
		if (refIndex >= 0) scope.references.splice(refIndex, 1);
		const throughIndex = scope.through.indexOf(reference);
		if (throughIndex >= 0) scope.through.splice(throughIndex, 1);
		scope = scope.upper;
	}
}
/** Remove scope */
function removeScope(scopeManager, scope) {
	for (const childScope of scope.childScopes) removeScope(scopeManager, childScope);
	while (scope.references[0]) removeReference(scope.references[0], scope);
	const upper = scope.upper;
	if (upper) {
		const index = upper.childScopes.indexOf(scope);
		if (index >= 0) upper.childScopes.splice(index, 1);
	}
	const index = scopeManager.scopes.indexOf(scope);
	if (index >= 0) scopeManager.scopes.splice(index, 1);
}

//#endregion
//#region src/script/index.ts
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
const ALIAS_ITERATOR = /^([\s\S]*?(?:\s|\)))(\bin\b|\bof\b)([\s\S]*)$/u;
const PARENS = /^(\s*\()([\s\S]*?)(\)\s*)$/u;
const DUMMY_PARENT$2 = {};
const IS_FUNCTION_EXPRESSION = /^\s*([\w$_]+|(async\s*)?\([^)]*?\))\s*(:[^=]+)?=>|^\s*(async\s+)?function(?:\s+[\w$]+)?\s*\(/u;
const IS_SIMPLE_PATH = /^[A-Za-z_$][\w$]*(?:\.[A-Za-z_$][\w$]*|\['[^']*?'\]|\["[^"]*?"\]|\[\d+\]|\[[A-Za-z_$][\w$]*\])*$/u;
/**
* Parse the alias and iterator of 'v-for' directive values.
* @param code The code to parse.
* @returns The parsed result.
*/
function processVForAliasAndIterator(code) {
	const match = ALIAS_ITERATOR.exec(code);
	if (match != null) {
		const aliases = match[1];
		const parenMatch = PARENS.exec(aliases);
		return {
			aliases,
			hasParens: Boolean(parenMatch),
			aliasesWithBrackets: parenMatch ? `${parenMatch[1].slice(0, -1)}[${parenMatch[2]}]${parenMatch[3].slice(1)}` : `[${aliases.slice(0, -1)}]`,
			delimiter: match[2] || "",
			iterator: match[3]
		};
	}
	return {
		aliases: "",
		hasParens: false,
		aliasesWithBrackets: "",
		delimiter: "",
		iterator: code
	};
}
/**
* Get the comma token before a given node.
* @param tokens The token list.
* @param node The node to get the comma before this node.
* @returns The comma token.
*/
function getCommaTokenBeforeNode(tokens, node) {
	let tokenIndex = sortedIndexBy(tokens, { range: node.range }, (t) => t.range[0]);
	while (tokenIndex >= 0) {
		const token = tokens[tokenIndex];
		if (token.type === "Punctuator" && token.value === ",") return token;
		tokenIndex -= 1;
	}
	return null;
}
/**
* Throw syntax error for empty.
* @param locationCalculator The location calculator to get line/column.
*/
function throwEmptyError(locationCalculator, expected) {
	const loc = locationCalculator.getLocation(0);
	const err = new ParseError(`Expected to be ${expected}, but got empty.`, void 0, 0, loc.line, loc.column);
	fixErrorLocation(err, locationCalculator);
	throw err;
}
/**
* Throw syntax error for unexpected token.
* @param locationCalculator The location calculator to get line/column.
* @param name The token name.
* @param token The token object to get that location.
*/
function throwUnexpectedTokenError(name, token) {
	throw new ParseError(`Unexpected token '${name}'.`, void 0, token.range[0], token.loc.start.line, token.loc.start.column);
}
/**
* Throw syntax error of outside of code.
* @param locationCalculator The location calculator to get line/column.
*/
function throwErrorAsAdjustingOutsideOfCode(err, code, locationCalculator) {
	if (ParseError.isParseError(err)) {
		const endOffset = locationCalculator.getOffsetWithGap(code.length);
		if (err.index >= endOffset) err.message = "Unexpected end of expression.";
	}
	throw err;
}
/**
* Parse the given source code.
*
* @param code The source code to parse.
* @param locationCalculator The location calculator for fixLocations.
* @param parserOptions The parser options.
* @returns The result of parsing.
*/
function parseScriptFragment(code, locationCalculator, parserOptions) {
	return parseScriptFragmentWithOption(code, locationCalculator, parserOptions);
}
/**
* Parse the given source code.
*
* @param code The source code to parse.
* @param locationCalculator The location calculator for fixLocations.
* @param parserOptions The parser options.
* @param processOptions The process options.
* @returns The result of parsing.
*/
function parseScriptFragmentWithOption(code, locationCalculator, parserOptions, processOptions) {
	try {
		const result = parseScript$1(code, parserOptions);
		processOptions?.preFixLocationProcess?.(result);
		fixLocations(result, locationCalculator);
		return result;
	} catch (err) {
		const perr = ParseError.normalize(err);
		if (perr) {
			fixErrorLocation(perr, locationCalculator);
			throw perr;
		}
		throw err;
	}
}
const validDivisionCharRE = /[\w).+\-_$\]]/u;
/**
* This is a fork of https://github.com/vuejs/vue/blob/2686818beb5728e3b7aa22f47a3b3f0d39d90c8e/src/compiler/parser/filter-parser.js
* @param exp the expression to process filters.
*/
function splitFilters(exp) {
	const result = [];
	let inSingle = false;
	let inDouble = false;
	let inTemplateString = false;
	let inRegex = false;
	let curly = 0;
	let square = 0;
	let paren = 0;
	let lastFilterIndex = 0;
	let c = 0;
	let prev = 0;
	for (let i = 0; i < exp.length; i++) {
		prev = c;
		c = exp.charCodeAt(i);
		if (inSingle) {
			if (c === 39 && prev !== 92) inSingle = false;
		} else if (inDouble) {
			if (c === 34 && prev !== 92) inDouble = false;
		} else if (inTemplateString) {
			if (c === 96 && prev !== 92) inTemplateString = false;
		} else if (inRegex) {
			if (c === 47 && prev !== 92) inRegex = false;
		} else if (c === 124 && exp.charCodeAt(i + 1) !== 124 && exp.charCodeAt(i - 1) !== 124 && !curly && !square && !paren) {
			result.push(exp.slice(lastFilterIndex, i));
			lastFilterIndex = i + 1;
		} else {
			switch (c) {
				case 34:
					inDouble = true;
					break;
				case 39:
					inSingle = true;
					break;
				case 96:
					inTemplateString = true;
					break;
				case 40:
					paren++;
					break;
				case 41:
					paren--;
					break;
				case 91:
					square++;
					break;
				case 93:
					square--;
					break;
				case 123:
					curly++;
					break;
				case 125:
					curly--;
					break;
			}
			if (c === 47) {
				let j = i - 1;
				let p;
				for (; j >= 0; j--) {
					p = exp.charAt(j);
					if (p !== " ") break;
				}
				if (!p || !validDivisionCharRE.test(p)) inRegex = true;
			}
		}
	}
	result.push(exp.slice(lastFilterIndex));
	return result;
}
/**
* Parse the source code of inline scripts.
* @param code The source code of inline scripts.
* @param locationCalculator The location calculator for the inline script.
* @param parserOptions The parser options.
* @returns The result of parsing.
*/
function parseExpressionBody(code, locationCalculator, parserOptions, allowEmpty = false) {
	debug$1("[script] parse expression: \"0(%s)\"", code);
	try {
		const result = parseScriptFragment(`0(${code})`, locationCalculator.getSubCalculatorShift(-2), parserOptions);
		const { ast } = result;
		const tokens = ast.tokens ?? [];
		const comments = ast.comments ?? [];
		const references = analyzeExternalReferences(result, parserOptions);
		const callExpression = ast.body[0].expression;
		const expression = callExpression.arguments[0];
		if (!allowEmpty && !expression) return throwEmptyError(locationCalculator, "an expression");
		if (expression?.type === "SpreadElement") return throwUnexpectedTokenError("...", expression);
		if (callExpression.arguments[1]) {
			const node = callExpression.arguments[1];
			return throwUnexpectedTokenError(",", getCommaTokenBeforeNode(tokens, node) || node);
		}
		tokens.shift();
		tokens.shift();
		tokens.pop();
		return {
			expression,
			tokens,
			comments,
			references,
			variables: []
		};
	} catch (err) {
		return throwErrorAsAdjustingOutsideOfCode(err, code, locationCalculator);
	}
}
/**
* Parse the source code of inline scripts.
* @param code The source code of inline scripts.
* @param locationCalculator The location calculator for the inline script.
* @param parserOptions The parser options.
* @returns The result of parsing.
*/
function parseFilter(code, locationCalculator, parserOptions) {
	debug$1("[script] parse filter: \"%s\"", code);
	try {
		const expression = {
			type: "VFilter",
			parent: null,
			range: [0, 0],
			loc: {},
			callee: null,
			arguments: []
		};
		const tokens = [];
		const comments = [];
		const references = [];
		const paren = code.indexOf("(");
		const calleeCode = paren === -1 ? code : code.slice(0, paren);
		const argsCode = paren === -1 ? null : code.slice(paren);
		if (calleeCode.trim()) {
			const spaces = /^\s*/u.exec(calleeCode)[0];
			const subCalculator = locationCalculator.getSubCalculatorShift(spaces.length);
			const { ast } = parseScriptFragment(`"${calleeCode.trim()}"`, subCalculator, parserOptions);
			const callee = ast.body[0].expression;
			if (callee.type !== "Literal") {
				const { loc, range } = ast.tokens[0];
				return throwUnexpectedTokenError("\"", {
					range: [range[1] - 1, range[1]],
					loc: {
						start: {
							line: loc.end.line,
							column: loc.end.column - 1
						},
						end: loc.end
					}
				});
			}
			expression.callee = {
				type: "Identifier",
				parent: expression,
				range: [callee.range[0], subCalculator.getOffsetWithGap(calleeCode.trim().length)],
				loc: {
					start: callee.loc.start,
					end: subCalculator.getLocation(calleeCode.trim().length)
				},
				name: String(callee.value)
			};
			tokens.push({
				type: "Identifier",
				value: calleeCode.trim(),
				range: expression.callee.range,
				loc: expression.callee.loc
			});
		} else return throwEmptyError(locationCalculator, "a filter name");
		if (argsCode != null) {
			const result = parseScriptFragment(`0${argsCode}`, locationCalculator.getSubCalculatorAfter(paren).getSubCalculatorShift(-1), parserOptions);
			const { ast } = result;
			const callExpression = ast.body[0].expression;
			ast.tokens.shift();
			if (callExpression.type !== "CallExpression" || callExpression.callee.type !== "Literal") {
				let nestCount = 1;
				for (const token of ast.tokens.slice(1)) {
					if (nestCount === 0) return throwUnexpectedTokenError(token.value, token);
					if (token.type === "Punctuator" && token.value === "(") nestCount += 1;
					if (token.type === "Punctuator" && token.value === ")") nestCount -= 1;
				}
				const token = ast.tokens.at(-1);
				return throwUnexpectedTokenError(token.value, token);
			}
			for (const argument of callExpression.arguments) {
				argument.parent = expression;
				expression.arguments.push(argument);
			}
			tokens.push(...ast.tokens);
			comments.push(...ast.comments);
			references.push(...analyzeExternalReferences(result, parserOptions));
		}
		const firstToken = tokens[0];
		const lastToken = tokens.at(-1);
		expression.range = [firstToken.range[0], lastToken.range[1]];
		expression.loc = {
			start: firstToken.loc.start,
			end: lastToken.loc.end
		};
		return {
			expression,
			tokens,
			comments,
			references,
			variables: []
		};
	} catch (err) {
		return throwErrorAsAdjustingOutsideOfCode(err, code, locationCalculator);
	}
}
function loadParser(parser) {
	if (parser !== "espree") return require(parser);
	return getEspree();
}
/**
* Parse the given source code.
*
* @param code The source code to parse.
* @param parserOptions The parser options.
* @returns The result of parsing.
*/
function parseScript$1(code, parserOptions) {
	const parser = typeof parserOptions.parser === "string" ? loadParser(parserOptions.parser) : isParserObject(parserOptions.parser) ? parserOptions.parser : getEspree();
	const { parser: _, ...scriptParserOptions } = parserOptions;
	const result = isEnhancedParserObject(parser) ? parser.parseForESLint(code, scriptParserOptions) : parser.parse(code, scriptParserOptions);
	if (result.ast != null) return result;
	return { ast: result };
}
/**
* Parse the source code of the given `<script>` element.
* @param node The `<script>` element to parse.
* @param sfcCode The source code of SFC.
* @param linesAndColumns The lines and columns location calculator.
* @param parserOptions The parser options.
* @returns The result of parsing.
*/
function parseScriptElement(node, sfcCode, linesAndColumns, originalParserOptions) {
	const parserOptions = {
		...originalParserOptions,
		ecmaVersion: originalParserOptions.ecmaVersion ?? DEFAULT_ECMA_VERSION
	};
	let generic = null;
	let code;
	let offset;
	const textNode = node.children[0];
	if (textNode?.type === "VText") {
		const [scriptStartOffset, scriptEndOffset] = textNode.range;
		code = sfcCode.slice(scriptStartOffset, scriptEndOffset);
		offset = scriptStartOffset;
		generic = extractGeneric(node);
		if (generic) {
			const defineTypesCode = `${generic.defineTypes.map((e) => e.define).join(";")};\n`;
			code = defineTypesCode + code;
			offset -= defineTypesCode.length;
		}
	} else {
		code = "";
		offset = node.startTag.range[1];
	}
	const locationCalculator = linesAndColumns.createOffsetLocationCalculator(offset);
	const result = parseScriptFragment(code, locationCalculator, parserOptions);
	if (generic) {
		generic.postprocess({
			result,
			isRemoveTarget(nodeOrToken) {
				return nodeOrToken.range[1] <= textNode.range[0];
			},
			getTypeDefScope(scopeManager) {
				return scopeManager.globalScope.childScopes.find((s) => s.type === "module") ?? scopeManager.globalScope;
			}
		});
		const startToken = [
			result.ast.body[0],
			result.ast.tokens?.[0],
			result.ast.comments?.[0]
		].filter((e) => Boolean(e)).sort((a, b) => a.range[0] - b.range[0]).find((t) => Boolean(t));
		if (startToken && result.ast.range[0] !== startToken.range[0]) {
			result.ast.range[0] = startToken.range[0];
			if (result.ast.start != null) result.ast.start = startToken.start;
			result.ast.loc.start = { ...startToken.loc.start };
		}
	}
	if (result.ast.tokens != null) {
		const startTag = node.startTag;
		const endTag = node.endTag;
		result.ast.tokens.unshift({
			type: "Punctuator",
			range: startTag.range,
			loc: startTag.loc,
			value: "<script>"
		});
		if (endTag != null) result.ast.tokens.push({
			type: "Punctuator",
			range: endTag.range,
			loc: endTag.loc,
			value: "<\/script>"
		});
	}
	return result;
}
/**
* Parse the source code of inline scripts.
* @param code The source code of inline scripts.
* @param locationCalculator The location calculator for the inline script.
* @param parserOptions The parser options.
* @returns The result of parsing.
*/
function parseExpression(code, locationCalculator, parserOptions, { allowEmpty = false, allowFilters = false } = {}) {
	debug$1("[script] parse expression: \"%s\"", code);
	const [mainCode, ...filterCodes] = allowFilters && (parserOptions.vueFeatures?.filter ?? true) ? splitFilters(code) : [code];
	if (filterCodes.length === 0) return parseExpressionBody(code, locationCalculator, parserOptions, allowEmpty);
	const retB = parseExpressionBody(mainCode, locationCalculator, parserOptions);
	if (!retB.expression) return retB;
	const ret = retB;
	ret.expression = {
		type: "VFilterSequenceExpression",
		parent: null,
		expression: retB.expression,
		filters: [],
		range: [...retB.expression.range],
		loc: { ...retB.expression.loc }
	};
	ret.expression.expression.parent = ret.expression;
	let prevLoc = mainCode.length;
	for (const filterCode of filterCodes) {
		ret.tokens.push(fixLocation({
			type: "Punctuator",
			value: "|",
			range: [prevLoc, prevLoc + 1],
			loc: {}
		}, locationCalculator));
		const retF = parseFilter(filterCode, locationCalculator.getSubCalculatorShift(prevLoc + 1), parserOptions);
		if (retF) {
			if (retF.expression) {
				ret.expression.filters.push(retF.expression);
				retF.expression.parent = ret.expression;
			}
			ret.tokens.push(...retF.tokens);
			ret.comments.push(...retF.comments);
			ret.references.push(...retF.references);
		}
		prevLoc += 1 + filterCode.length;
	}
	const lastToken = ret.tokens.at(-1);
	ret.expression.range[1] = lastToken.range[1];
	ret.expression.loc.end = lastToken.loc.end;
	return ret;
}
/**
* Parse the source code of inline scripts.
* @param code The source code of inline scripts.
* @param locationCalculator The location calculator for the inline script.
* @param parserOptions The parser options.
* @returns The result of parsing.
*/
function parseVForExpression(code, locationCalculator, parserOptions) {
	if (code.trim() === "") throwEmptyError(locationCalculator, "'<alias> in <expression>'");
	if (isEcmaVersion5(parserOptions)) return parseVForExpressionForEcmaVersion5(code, locationCalculator, parserOptions);
	const processed = processVForAliasAndIterator(code);
	if (!processed.aliases.trim()) return throwEmptyError(locationCalculator, "an alias");
	try {
		debug$1("[script] parse v-for expression: \"for(%s%s%s);\"", processed.aliasesWithBrackets, processed.delimiter, processed.iterator);
		const result = parseScriptFragment(`for(let ${processed.aliasesWithBrackets}${processed.delimiter}${processed.iterator});`, locationCalculator.getSubCalculatorShift(processed.hasParens ? -8 : -9), parserOptions);
		const { ast } = result;
		const tokens = ast.tokens ?? [];
		const comments = ast.comments ?? [];
		const scope = analyzeVariablesAndExternalReferences(result, "v-for", parserOptions);
		const references = scope.references;
		const variables = scope.variables;
		const statement = ast.body[0];
		const left = statement.left.declarations[0].id.elements;
		const right = statement.right;
		if (!processed.hasParens && !left.length) return throwEmptyError(locationCalculator, "an alias");
		tokens.shift();
		tokens.shift();
		tokens.shift();
		tokens.pop();
		tokens.pop();
		const closeOffset = statement.left.range[1] - 1;
		const closeIndex = tokens.findIndex((t) => t.range[0] === closeOffset);
		if (processed.hasParens) {
			const open = tokens[0];
			if (open != null) open.value = "(";
			const close = tokens[closeIndex];
			if (close != null) close.value = ")";
		} else {
			tokens.splice(closeIndex, 1);
			tokens.shift();
		}
		const firstToken = tokens[0] || statement.left;
		const lastToken = tokens[tokens.length - 1] || statement.right;
		const expression = {
			type: "VForExpression",
			range: [firstToken.range[0], lastToken.range[1]],
			loc: {
				start: firstToken.loc.start,
				end: lastToken.loc.end
			},
			parent: DUMMY_PARENT$2,
			left,
			right
		};
		for (const l of left) if (l != null) l.parent = expression;
		right.parent = expression;
		return {
			expression,
			tokens,
			comments,
			references,
			variables
		};
	} catch (err) {
		return throwErrorAsAdjustingOutsideOfCode(err, code, locationCalculator);
	}
}
function isEcmaVersion5(parserOptions) {
	const ecmaVersion = getEcmaVersionIfUseEspree(parserOptions);
	return ecmaVersion != null && ecmaVersion <= 5;
}
function parseVForExpressionForEcmaVersion5(code, locationCalculator, parserOptions) {
	const processed = processVForAliasAndIterator(code);
	if (!processed.aliases.trim()) return throwEmptyError(locationCalculator, "an alias");
	try {
		const tokens = [];
		const comments = [];
		const parsedAliases = parseVForAliasesForEcmaVersion5(processed.aliasesWithBrackets, locationCalculator.getSubCalculatorShift(processed.hasParens ? 0 : -1), parserOptions);
		if (processed.hasParens) {
			const open = parsedAliases.tokens[0];
			if (open != null) open.value = "(";
			const close = parsedAliases.tokens.at(-1);
			if (close != null) close.value = ")";
		} else {
			parsedAliases.tokens.shift();
			parsedAliases.tokens.pop();
		}
		tokens.push(...parsedAliases.tokens);
		comments.push(...parsedAliases.comments);
		const { left, variables } = parsedAliases;
		if (!processed.hasParens && !left.length) return throwEmptyError(locationCalculator, "an alias");
		const delimiterStart = processed.aliases.length;
		const delimiterEnd = delimiterStart + processed.delimiter.length;
		tokens.push(fixLocation({
			type: processed.delimiter === "in" ? "Keyword" : "Identifier",
			value: processed.delimiter,
			start: delimiterStart,
			end: delimiterEnd,
			loc: {},
			range: [delimiterStart, delimiterEnd]
		}, locationCalculator));
		const parsedIterator = parseVForIteratorForEcmaVersion5(processed.iterator, locationCalculator.getSubCalculatorShift(delimiterEnd), parserOptions);
		tokens.push(...parsedIterator.tokens);
		comments.push(...parsedIterator.comments);
		const { right, references } = parsedIterator;
		const firstToken = tokens[0];
		const lastToken = tokens.at(-1) || firstToken;
		const expression = {
			type: "VForExpression",
			range: [firstToken.range[0], lastToken.range[1]],
			loc: {
				start: firstToken.loc.start,
				end: lastToken.loc.end
			},
			parent: DUMMY_PARENT$2,
			left,
			right
		};
		for (const l of left) if (l != null) l.parent = expression;
		right.parent = expression;
		return {
			expression,
			tokens,
			comments,
			references,
			variables
		};
	} catch (err) {
		return throwErrorAsAdjustingOutsideOfCode(err, code, locationCalculator);
	}
}
function parseVForAliasesForEcmaVersion5(code, locationCalculator, parserOptions) {
	const result = parseScriptFragment(`0(${code})`, locationCalculator.getSubCalculatorShift(-2), parserOptions);
	const { ast } = result;
	const tokens = ast.tokens ?? [];
	const comments = ast.comments ?? [];
	const variables = analyzeExternalReferences(result, parserOptions).map(transformVariable);
	const left = ast.body[0].expression.arguments[0].elements.filter((e) => {
		if (e == null || e.type === "Identifier") return true;
		const errorToken = tokens.find((t) => e.range[0] <= t.range[0] && t.range[1] <= e.range[1]);
		return throwUnexpectedTokenError(errorToken.value, errorToken);
	});
	tokens.shift();
	tokens.shift();
	tokens.pop();
	return {
		left,
		tokens,
		comments,
		variables
	};
	function transformVariable(reference) {
		const ret = {
			id: reference.id,
			kind: "v-for",
			references: []
		};
		Object.defineProperty(ret, "references", { enumerable: false });
		return ret;
	}
}
function parseVForIteratorForEcmaVersion5(code, locationCalculator, parserOptions) {
	const result = parseScriptFragment(`0(${code})`, locationCalculator.getSubCalculatorShift(-2), parserOptions);
	const { ast } = result;
	const tokens = ast.tokens ?? [];
	const comments = ast.comments ?? [];
	const references = analyzeExternalReferences(result, parserOptions);
	const expression = ast.body[0].expression.arguments[0];
	if (!expression) return throwEmptyError(locationCalculator, "an expression");
	if (expression?.type === "SpreadElement") return throwUnexpectedTokenError("...", expression);
	const right = expression;
	tokens.shift();
	tokens.shift();
	tokens.pop();
	return {
		right,
		tokens,
		comments,
		references
	};
}
/**
* Parse the source code of inline scripts.
* @param code The source code of inline scripts.
* @param locationCalculator The location calculator for the inline script.
* @param parserOptions The parser options.
* @returns The result of parsing.
*/
function parseVOnExpression(code, locationCalculator, parserOptions) {
	if (IS_FUNCTION_EXPRESSION.test(code) || IS_SIMPLE_PATH.test(code)) return parseExpressionBody(code, locationCalculator, parserOptions);
	return parseVOnExpressionBody(code, locationCalculator, parserOptions);
}
/**
* Parse the source code of inline scripts.
* @param code The source code of inline scripts.
* @param locationCalculator The location calculator for the inline script.
* @param parserOptions The parser options.
* @returns The result of parsing.
*/
function parseVOnExpressionBody(code, locationCalculator, parserOptions) {
	debug$1("[script] parse v-on expression: \"void function($event){%s}\"", code);
	if (code.trim() === "") throwEmptyError(locationCalculator, "statements");
	try {
		const result = parseScriptFragment(`void function($event){${code}}`, locationCalculator.getSubCalculatorShift(-22), parserOptions);
		const { ast } = result;
		const references = analyzeExternalReferences(result, parserOptions);
		const block = ast.body[0].expression.argument.body;
		const body = block.body;
		const firstStatement = body[0];
		const lastStatement = body.at(-1);
		const expression = {
			type: "VOnExpression",
			range: [firstStatement != null ? firstStatement.range[0] : block.range[0] + 1, lastStatement != null ? lastStatement.range[1] : block.range[1] - 1],
			loc: {
				start: firstStatement != null ? firstStatement.loc.start : locationCalculator.getLocation(1),
				end: lastStatement != null ? lastStatement.loc.end : locationCalculator.getLocation(code.length + 1)
			},
			parent: DUMMY_PARENT$2,
			body
		};
		const tokens = ast.tokens ?? [];
		const comments = ast.comments ?? [];
		for (const b of body) b.parent = expression;
		tokens.splice(0, 6);
		tokens.pop();
		return {
			expression,
			tokens,
			comments,
			references,
			variables: []
		};
	} catch (err) {
		return throwErrorAsAdjustingOutsideOfCode(err, code, locationCalculator);
	}
}
/**
* Parse the source code of `slot-scope` directive.
* @param code The source code of `slot-scope` directive.
* @param locationCalculator The location calculator for the inline script.
* @param parserOptions The parser options.
* @returns The result of parsing.
*/
function parseSlotScopeExpression(code, locationCalculator, parserOptions) {
	debug$1("[script] parse slot-scope expression: \"void function(%s) {}\"", code);
	if (code.trim() === "") throwEmptyError(locationCalculator, "an identifier or an array/object pattern");
	try {
		const result = parseScriptFragment(`void function(${code}) {}`, locationCalculator.getSubCalculatorShift(-14), parserOptions);
		const { ast } = result;
		const functionDecl = ast.body[0].expression.argument;
		const params = functionDecl.params;
		if (params.length === 0) return {
			expression: null,
			tokens: [],
			comments: [],
			references: [],
			variables: []
		};
		const tokens = ast.tokens ?? [];
		const comments = ast.comments ?? [];
		const scope = analyzeVariablesAndExternalReferences(result, "scope", parserOptions);
		const references = scope.references;
		const variables = scope.variables;
		const firstParam = params[0];
		const lastParam = params.at(-1);
		const expression = {
			type: "VSlotScopeExpression",
			range: [firstParam.range[0], lastParam.range[1]],
			loc: {
				start: firstParam.loc.start,
				end: lastParam.loc.end
			},
			parent: DUMMY_PARENT$2,
			params: functionDecl.params
		};
		for (const param of params) param.parent = expression;
		tokens.shift();
		tokens.shift();
		tokens.shift();
		tokens.pop();
		tokens.pop();
		tokens.pop();
		return {
			expression,
			tokens,
			comments,
			references,
			variables
		};
	} catch (err) {
		return throwErrorAsAdjustingOutsideOfCode(err, code, locationCalculator);
	}
}
/**
* Parse the source code of `generic` directive.
* @param code The source code of `generic` directive.
* @param locationCalculator The location calculator for the inline script.
* @param parserOptions The parser options.
* @returns The result of parsing.
*/
function parseGenericEx   pression(code, locationCalculator, parserOptions) {
	debug$1("[script] parse generic definition: \"void function<%s>() {}\"", code);
	if (code.trim() === "") throwEmptyError(locationCalculator, "a type parameter");
	function getParams(result) {
		const { ast } = result;
		return ast.body[0].expression.argument.typeParameters?.params;
	}
	try {
		const rawParams = [];
		const scriptLet = `void function<${code}>(){}`;
		const result = parseScriptFragmentWithOption(scriptLet, locationCalculator.getSubCalculatorShift(-14), {
			...parserOptions,
			project: void 0,
			projectService: void 0
		}, { preFixLocationProcess(preResult) {
			const params = getParams(preResult);
			if (params) for (const param of params) rawParams.push(scriptLet.slice(param.range[0], param.range[1]));
		} });
		const { ast } = result;
		const params = getParams(result);
		if (!params || params.length === 0) return {
			expression: null,
			tokens: [],
			comments: [],
			references: [],
			variables: []
		};
		const tokens = ast.tokens ?? [];
		const comments = ast.comments ?? [];
		const scope = analyzeVariablesAndExternalReferences(result, "generic", parserOptions);
		const references = scope.references;
		const variables = scope.variables;
		const firstParam = params[0];
		const lastParam = params.at(-1);
		const expression = {
			type: "VGenericExpression",
			range: [firstParam.range[0], lastParam.range[1]],
			loc: {
				start: firstParam.loc.start,
				end: lastParam.loc.end
			},
			parent: DUMMY_PARENT$2,
			params,
			rawParams
		};
		for (const param of params) param.parent = expression;
		tokens.shift();
		tokens.shift();
		tokens.shift();
		tokens.pop();
		tokens.pop();
		tokens.pop();
		tokens.pop();
		tokens.pop();
		return {
			expression,
			tokens,
			comments,
			references,
			variables
		};
	} catch (err) {
		return throwErrorAsAdjustingOutsideOfCode(err, code, locationCalculator);
	}
}

//#endregion
//#region src/common/token-utils.ts
/**
* Replace the tokens in the given range.
* @param document The document that the node is belonging to.
* @param node The node to specify the range of replacement.
* @param newTokens The new tokens.
*/
function replaceTokens(document, node, newTokens) {
	if (document == null) return;
	const index = sortedIndexBy(document.tokens, node, byRange0);
	const count = sortedLastIndexBy(document.tokens, node, byRange1) - index;
	document.tokens.splice(index, count, ...newTokens);
}
/**
* Replace and split the tokens in the given range.
* @param document The document that the node is belonging to.
* @param node The node to specify the range of replacement.
* @param newTokens The new tokens.
*/
function replaceAndSplitTokens(document, node, newTokens) {
	if (document == null) return;
	const index = sortedIndexBy(document.tokens, node, byRange0);
	if (document.tokens.length === index || node.range[0] < document.tokens[index].range[0]) {
		const beforeToken = document.tokens[index - 1];
		const value = beforeToken.value;
		const splitOffset = node.range[0] - beforeToken.range[0];
		const afterToken = {
			type: beforeToken.type,
			range: [node.range[0], beforeToken.range[1]],
			loc: {
				start: { ...node.loc.start },
				end: { ...beforeToken.loc.end }
			},
			value: value.slice(splitOffset)
		};
		beforeToken.range[1] = node.range[0];
		beforeToken.loc.end = { ...node.loc.start };
		beforeToken.value = value.slice(0, splitOffset);
		document.tokens.splice(index, 0, afterToken);
	}
	let lastIndex = sortedLastIndexBy(document.tokens, node, byRange1);
	if (lastIndex === 0 || node.range[1] < document.tokens[lastIndex].range[1]) {
		const beforeToken = document.tokens[lastIndex];
		const value = beforeToken.value;
		const splitOffset = beforeToken.range[1] - beforeToken.range[0] - (beforeToken.range[1] - node.range[1]);
		const afterToken = {
			type: beforeToken.type,
			range: [node.range[1], beforeToken.range[1]],
			loc: {
				start: { ...node.loc.end },
				end: { ...beforeToken.loc.end }
			},
			value: value.slice(splitOffset)
		};
		beforeToken.range[1] = node.range[1];
		beforeToken.loc.end = { ...node.loc.end };
		beforeToken.value = value.slice(0, splitOffset);
		document.tokens.splice(lastIndex + 1, 0, afterToken);
		lastIndex++;
	}
	const count = lastIndex - index;
	document.tokens.splice(index, count, ...newTokens);
}
/**
* Insert the given comment tokens.
* @param document The document that the node is belonging to.
* @param newComments The comments to insert.
*/
function insertComments(document, newComments) {
	if (document == null || newComments.length === 0) return;
	const index = sortedIndexBy(document.comments, newComments[0], byRange0);
	document.comments.splice(index, 0, ...newComments);
}
/**
* Create a simple token.
* @param type The type of new token.
* @param start The offset of the start position of new token.
* @param end The offset of the end position of new token.
* @param value The value of new token.
* @returns The new token.
*/
function createSimpleToken(type, start, end, value, linesAndColumns) {
	return {
		type,
		range: [start, end],
		loc: {
			start: linesAndColumns.getLocFromIndex(start),
			end: linesAndColumns.getLocFromIndex(end)
		},
		value
	};
}
/**
* Get `x.range[0]`.
* @param x The object to get.
* @returns `x.range[0]`.
*/
function byRange0(x) {
	return x.range[0];
}
/**
* Get `x.range[1]`.
* @param x The object to get.
* @returns `x.range[1]`.
*/
function byRange1(x) {
	return x.range[1];
}

//#endregion
//#region src/common/error-utils.ts
/**
* Insert the given error.
* @param document The document that the node is belonging to.
* @param error The error to insert.
*/
function insertError(document, error) {
	if (document == null) return;
	const index = sortedIndexBy(document.errors, error, byIndex);
	document.errors.splice(index, 0, error);
}
/**
* Get `x.pos`.
* @param x The object to get.
* @returns `x.pos`.
*/
function byIndex(x) {
	return x.index;
}

//#endregion
//#region src/template/index.ts
const shorthandSign = /^[.:@#]/u;
const shorthandNameMap = {
	":": "bind",
	".": "bind",
	"@": "on",
	"#": "slot"
};
const invalidDynamicArgumentNextChar = /^[\s\r\n=/>]$/u;
/**
* Gets the tag name from the given node or token.
* For SFC, it returns the value of `rawName` to be case sensitive.
*/
function getTagName$1(startTagOrElement, isSFC) {
	return isSFC ? startTagOrElement.rawName : startTagOrElement.name;
}
/**
* Parse the given attribute name as a directive key.
* @param node The identifier node to parse.
* @param document The document to add parsing errors.
* @returns The directive key node.
*/
function parseDirectiveKeyStatically(node, document) {
	const { name: text, rawName: rawText, range: [offset], loc: { start: { column, line } } } = node;
	const directiveKey = {
		type: "VDirectiveKey",
		range: node.range,
		loc: node.loc,
		parent: node.parent,
		name: null,
		argument: null,
		modifiers: []
	};
	let i = 0;
	function createIdentifier(start, end, name) {
		return {
			type: "VIdentifier",
			parent: directiveKey,
			range: [offset + start, offset + end],
			loc: {
				start: {
					column: column + start,
					line
				},
				end: {
					column: column + end,
					line
				}
			},
			name: name || text.slice(start, end),
			rawName: rawText.slice(start, end)
		};
	}
	if (shorthandSign.test(text)) {
		const sign = text[0];
		directiveKey.name = createIdentifier(0, 1, shorthandNameMap[sign]);
		i = 1;
	} else {
		const colon = text.indexOf(":");
		if (colon !== -1) {
			directiveKey.name = createIdentifier(0, colon);
			i = colon + 1;
		}
	}
	if (directiveKey.name != null && text[i] === "[") {
		const len = text.slice(i).lastIndexOf("]");
		if (len !== -1) {
			directiveKey.argument = createIdentifier(i, i + len + 1);
			i = i + len + 1 + (text[i + len + 1] === "." ? 1 : 0);
		}
	}
	const modifiers = text.slice(i).split(".").map((modifierName) => {
		const modifier = createIdentifier(i, i + modifierName.length);
		if (modifierName === "" && i < text.length) insertError(document, new ParseError(`Unexpected token '${text[i]}'`, void 0, offset + i, line, column + i));
		i += modifierName.length + 1;
		return modifier;
	});
	if (directiveKey.name == null) directiveKey.name = modifiers.shift();
	else if (directiveKey.argument == null && modifiers[0].name !== "") directiveKey.argument = modifiers.shift() ?? null;
	directiveKey.modifiers = modifiers.filter(isNotEmptyModifier);
	if (directiveKey.name.name === "v-") insertError(document, new ParseError(`Unexpected token '${text[directiveKey.name.range[1] - offset]}'`, void 0, directiveKey.name.range[1], directiveKey.name.loc.end.line, directiveKey.name.loc.end.column));
	if (directiveKey.name.rawName === "." && !directiveKey.modifiers.some(isPropModifier)) {
		const pos = (directiveKey.argument || directiveKey.name).range[1] - offset;
		const propModifier = createIdentifier(pos, pos, "prop");
		directiveKey.modifiers.unshift(propModifier);
	}
	return directiveKey;
}
/**
* Check whether a given identifier node is `prop` or not.
* @param node The identifier node to check.
*/
function isPropModifier(node) {
	return node.name === "prop";
}
/**
* Check whether a given identifier node is empty or not.
* @param node The identifier node to check.
*/
function isNotEmptyModifier(node) {
	return node.name !== "";
}
/**
* Parse the tokens of a given key node.
* @param node The key node to parse.
*/
function parseDirectiveKeyTokens(node) {
	const { name, argument, modifiers } = node;
	const shorthand = name.range[1] - name.range[0] === 1;
	const tokens = [];
	if (shorthand) tokens.push({
		type: "Punctuator",
		range: name.range,
		loc: name.loc,
		value: name.rawName
	});
	else {
		tokens.push({
			type: "HTMLIdentifier",
			range: name.range,
			loc: name.loc,
			value: name.rawName
		});
		if (argument) tokens.push({
			type: "Punctuator",
			range: [name.range[1], argument.range[0]],
			loc: {
				start: name.loc.end,
				end: argument.loc.start
			},
			value: ":"
		});
	}
	if (argument) tokens.push({
		type: "HTMLIdentifier",
		range: argument.range,
		loc: argument.loc,
		value: argument.rawName
	});
	let lastNode = argument || name;
	for (const modifier of modifiers) {
		if (modifier.rawName === "") continue;
		tokens.push({
			type: "Punctuator",
			range: [lastNode.range[1], modifier.range[0]],
			loc: {
				start: lastNode.loc.end,
				end: modifier.loc.start
			},
			value: "."
		}, {
			type: "HTMLIdentifier",
			range: modifier.range,
			loc: modifier.loc,
			value: modifier.rawName
		});
		lastNode = modifier;
	}
	return tokens;
}
/**
* Convert `node.argument` property to a `VExpressionContainer` node if it's a dynamic argument.
* @param text The source code text of the directive key node.
* @param node The directive key node to convert.
* @param document The belonging document node.
* @param parserOptions The parser options to parse.
* @param locationCalculator The location calculator to parse.
*/
function convertDynamicArgument(node, document, parserOptions, locationCalculator) {
	const { argument } = node;
	if (!(argument != null && argument.type === "VIdentifier" && argument.name.startsWith("[") && argument.name.endsWith("]"))) return;
	const { rawName, range, loc } = argument;
	try {
		const { comments, expression, references, tokens } = parseExpression(rawName.slice(1, -1), locationCalculator.getSubCalculatorAfter(range[0] + 1), parserOptions);
		node.argument = {
			type: "VExpressionContainer",
			range,
			loc,
			parent: node,
			expression,
			references
		};
		if (expression != null) expression.parent = node.argument;
		tokens.unshift(createSimpleToken("Punctuator", range[0], range[0] + 1, "[", locationCalculator));
		tokens.push(createSimpleToken("Punctuator", range[1] - 1, range[1], "]", locationCalculator));
		replaceTokens(document, node.argument, tokens);
		insertComments(document, comments);
	} catch (error) {
		debug$1("[template] Parse error: %s", error);
		if (ParseError.isParseError(error)) {
			node.argument = {
				type: "VExpressionContainer",
				range,
				loc,
				parent: node,
				expression: null,
				references: []
			};
			insertError(document, error);
		} else throw error;
	}
}
/**
* Parse the given attribute name as a directive key.
* @param node The identifier node to parse.
* @returns The directive key node.
*/
function createDirectiveKey(node, document, parserOptions, locationCalculator) {
	const directiveKey = parseDirectiveKeyStatically(node, document);
	replaceTokens(document, directiveKey, parseDirectiveKeyTokens(directiveKey));
	if (directiveKey.name.name.startsWith("v-")) directiveKey.name.name = directiveKey.name.name.slice(2);
	if (directiveKey.name.rawName.startsWith("v-")) directiveKey.name.rawName = directiveKey.name.rawName.slice(2);
	convertDynamicArgument(directiveKey, document, parserOptions, locationCalculator);
	return directiveKey;
}
/**
* Parse the given attribute value as an expression.
* @param code Whole source code text.
* @param parserOptions The parser options to parse expressions.
* @param globalLocationCalculator The location calculator to adjust the locations of nodes.
* @param node The attribute node to replace. This function modifies this node directly.
* @param tagName The name of this tag.
* @param directiveKey The key of this directive.
*/
function parseAttributeValue(code, parserOptions, scriptParserOptions, globalLocationCalculator, node, element, directiveKey) {
	const firstChar = code[node.range[0]];
	const quoted = firstChar === "\"" || firstChar === "'";
	const locationCalculator = globalLocationCalculator.getSubCalculatorAfter(node.range[0] + (quoted ? 1 : 0));
	const directiveKind = getStandardDirectiveKind(parserOptions, element, directiveKey);
	let result;
	if (quoted && node.value === "") result = {
		expression: null,
		tokens: [],
		comments: [],
		variables: [],
		references: []
	};
	else if (directiveKind === "for") result = parseVForExpression(node.value, locationCalculator, parserOptions);
	else if (directiveKind === "on" && directiveKey.argument != null) result = parseVOnExpression(node.value, locationCalculator, parserOptions);
	else if (directiveKind === "slot") result = parseSlotScopeExpression(node.value, locationCalculator, parserOptions);
	else if (directiveKind === "bind") result = parseExpression(node.value, locationCalculator, parserOptions, { allowFilters: true });
	else if (directiveKind === "generic") result = parseGenericExpression(node.value, locationCalculator, scriptParserOptions);
	else result = parseExpression(node.value, locationCalculator, parserOptions);
	if (quoted) {
		result.tokens.unshift(createSimpleToken("Punctuator", node.range[0], node.range[0] + 1, firstChar, globalLocationCalculator));
		result.tokens.push(createSimpleToken("Punctuator", node.range[1] - 1, node.range[1], firstChar, globalLocationCalculator));
	}
	return result;
}
function getStandardDirectiveKind(parserOptions, element, directiveKey) {
	const directiveName = directiveKey.name.name;
	if (directiveName === "for") return "for";
	else if (directiveName === "on") return "on";
	else if (directiveName === "slot" || directiveName === "slot-scope" || directiveName === "scope" && getTagName$1(element, isSFCFile(parserOptions)) === "template") return "slot";
	else if (directiveName === "bind") return "bind";
	else if (directiveName === "generic" && element.parent.type === "VDocumentFragment" && getTagName$1(element, isSFCFile(parserOptions)) === "script" && isScriptSetupElement(element) && isTSLang(element)) return "generic";
	return null;
}
/**
* Resolve the variable of the given reference.
* @param referene The reference to resolve.
* @param element The belonging element of the reference.
*/
function resolveReference(referene, element) {
	let node = element;
	while (node?.type === "VElement") {
		for (const variable of node.variables) if (variable.id.name === referene.id.name) {
			referene.variable = variable;
			variable.references.push(referene);
			return;
		}
		node = node.parent;
	}
}
/**
* Replace the given attribute by a directive.
* @param code Whole source code text.
* @param parserOptions The parser options to parse expressions.
* @param locationCalculator The location calculator to adjust the locations of nodes.
* @param node The attribute node to replace. This function modifies this node directly.
*/
function convertToDirective(code, parserOptions, scriptParserOptions, locationCalculator, node) {
	debug$1("[template] convert to directive: %s=\"%s\" %j", node.key.name, node.value?.value, node.range);
	const document = getOwnerDocument(node);
	const directive = node;
	directive.directive = true;
	directive.key = createDirectiveKey(node.key, document, parserOptions, locationCalculator);
	const { argument } = directive.key;
	if (argument?.type === "VIdentifier" && argument.name.startsWith("[")) {
		const nextChar = code[argument.range[1]];
		if (nextChar == null || invalidDynamicArgumentNextChar.test(nextChar)) insertError(document, new ParseError(`Dynamic argument cannot contain the '${nextChar == null ? "EOF" : JSON.stringify(nextChar).slice(1, -1)}' character.`, void 0, argument.range[1], argument.loc.end.line, argument.loc.end.column));
	}
	if (node.value == null) {
		if (directive.key.name.name === "bind") convertForVBindSameNameShorthandValue(directive, parserOptions, locationCalculator);
		return;
	}
	try {
		const ret = parseAttributeValue(code, parserOptions, scriptParserOptions, locationCalculator, node.value, node.parent.parent, directive.key);
		directive.value = {
			type: "VExpressionContainer",
			range: node.value.range,
			loc: node.value.loc,
			parent: directive,
			expression: ret.expression,
			references: ret.references
		};
		if (ret.expression != null) ret.expression.parent = directive.value;
		for (const variable of ret.variables) node.parent.parent.variables.push(variable);
		replaceTokens(document, node.value, ret.tokens);
		insertComments(document, ret.comments);
	} catch (err) {
		debug$1("[template] Parse error: %s", err);
		if (ParseError.isParseError(err)) {
			directive.value = {
				type: "VExpressionContainer",
				range: node.value.range,
				loc: node.value.loc,
				parent: directive,
				expression: null,
				references: []
			};
			insertError(document, err);
		} else throw err;
	}
}
function convertForVBindSameNameShorthandValue(directive, parserOptions, locationCalculator) {
	if (directive.key.name.name !== "bind" || directive.key.argument == null || directive.key.argument.type !== "VIdentifier") return;
	const vId = directive.key.argument;
	const camelName = camelize(vId.rawName);
	let result = null;
	try {
		result = parseScriptFragment(camelName, locationCalculator.getSubCalculatorAfter(vId.range[0]), parserOptions);
	} catch (err) {
		debug$1("[template] Parse error: %s", err);
	}
	if (result == null || result.ast.body.length !== 1 || result.ast.body[0].type !== "ExpressionStatement" || result.ast.body[0].expression.type !== "Identifier") return;
	const id = result.ast.body[0].expression;
	id.range[1] = vId.range[1];
	id.loc.end = { ...vId.loc.end };
	if (id.end != null) id.end = vId.end;
	directive.value = {
		type: "VExpressionContainer",
		range: [...vId.range],
		loc: {
			start: { ...vId.loc.start },
			end: { ...vId.loc.end }
		},
		parent: directive,
		expression: id,
		references: [{
			id,
			mode: "r",
			variable: null
		}]
	};
	id.parent = directive.value;
}
/**
* Parse the content of the given mustache.
* @param parserOptions The parser options to parse expressions.
* @param globalLocationCalculator The location calculator to adjust the locations of nodes.
* @param node The expression container node. This function modifies the `expression` and `references` properties of this node.
* @param mustache The information of mustache to parse.
*/
function processMustache(parserOptions, globalLocationCalculator, node, mustache) {
	const range = [mustache.startToken.range[1], mustache.endToken.range[0]];
	debug$1("[template] convert mustache {{%s}} %j", mustache.value, range);
	const document = getOwnerDocument(node);
	try {
		const locationCalculator = globalLocationCalculator.getSubCalculatorAfter(range[0]);
		const ret = parseExpression(mustache.value, locationCalculator, parserOptions, {
			allowEmpty: true,
			allowFilters: true
		});
		node.expression = ret.expression ?? null;
		node.references = ret.references;
		if (ret.expression != null) ret.expression.parent = node;
		replaceTokens(document, { range }, ret.tokens);
		insertComments(document, ret.comments);
	} catch (err) {
		debug$1("[template] Parse error: %s", err);
		if (ParseError.isParseError(err)) insertError(document, err);
		else throw err;
	}
}
/**
* Resolve all references of the given expression container.
* @param container The expression container to resolve references.
*/
function resolveReferences(container) {
	let element = container.parent;
	while (element != null && element.type !== "VElement") element = element.parent;
	if (element != null) for (const reference of container.references) resolveReference(reference, element);
}

//#endregion
//#region src/html/util/attribute-names.ts
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
const SVG_ATTRIBUTE_NAME_MAP = new Map([
	["attributename", "attributeName"],
	["attributetype", "attributeType"],
	["basefrequency", "baseFrequency"],
	["baseprofile", "baseProfile"],
	["calcmode", "calcMode"],
	["clippathunits", "clipPathUnits"],
	["diffuseconstant", "diffuseConstant"],
	["edgemode", "edgeMode"],
	["filterunits", "filterUnits"],
	["glyphref", "glyphRef"],
	["gradienttransform", "gradientTransform"],
	["gradientunits", "gradientUnits"],
	["kernelmatrix", "kernelMatrix"],
	["kernelunitlength", "kernelUnitLength"],
	["keypoints", "keyPoints"],
	["keysplines", "keySplines"],
	["keytimes", "keyTimes"],
	["lengthadjust", "lengthAdjust"],
	["limitingconeangle", "limitingConeAngle"],
	["markerheight", "markerHeight"],
	["markerunits", "markerUnits"],
	["markerwidth", "markerWidth"],
	["maskcontentunits", "maskContentUnits"],
	["maskunits", "maskUnits"],
	["numoctaves", "numOctaves"],
	["pathlength", "pathLength"],
	["patterncontentunits", "patternContentUnits"],
	["patterntransform", "patternTransform"],
	["patternunits", "patternUnits"],
	["pointsatx", "pointsAtX"],
	["pointsaty", "pointsAtY"],
	["pointsatz", "pointsAtZ"],
	["preservealpha", "preserveAlpha"],
	["preserveaspectratio", "preserveAspectRatio"],
	["primitiveunits", "primitiveUnits"],
	["refx", "refX"],
	["refy", "refY"],
	["repeatcount", "repeatCount"],
	["repeatdur", "repeatDur"],
	["requiredextensions", "requiredExtensions"],
	["requiredfeatures", "requiredFeatures"],
	["specularconstant", "specularConstant"],
	["specularexponent", "specularExponent"],
	["spreadmethod", "spreadMethod"],
	["startoffset", "startOffset"],
	["stddeviation", "stdDeviation"],
	["stitchtiles", "stitchTiles"],
	["surfacescale", "surfaceScale"],
	["systemlanguage", "systemLanguage"],
	["tablevalues", "tableValues"],
	["targetx", "targetX"],
	["targety", "targetY"],
	["textlength", "textLength"],
	["viewbox", "viewBox"],
	["viewtarget", "viewTarget"],
	["xchannelselector", "xChannelSelector"],
	["ychannelselector", "yChannelSelector"],
	["zoomandpan", "zoomAndPan"]
]);
const MATHML_ATTRIBUTE_NAME_MAP = new Map([["definitionurl", "definitionUrl"]]);

//#endregion
//#region src/html/util/tag-names.ts
/**
* HTML tag names of void elements.
*/
const HTML_VOID_ELEMENT_TAGS = new Set([
	"area",
	"base",
	"br",
	"col",
	"embed",
	"hr",
	"img",
	"input",
	"link",
	"meta",
	"param",
	"source",
	"track",
	"wbr"
]);
/**
* https://github.com/vuejs/vue/blob/e4da249ab8ef32a0b8156c840c9d2b9773090f8a/src/platforms/web/compiler/util.js#L12
*/
const HTML_CAN_BE_LEFT_OPEN_TAGS = new Set([
	"colgroup",
	"li",
	"options",
	"p",
	"td",
	"tfoot",
	"th",
	"thead",
	"tr",
	"source"
]);
/**
* https://github.com/vuejs/vue/blob/e4da249ab8ef32a0b8156c840c9d2b9773090f8a/src/platforms/web/compiler/util.js#L18
*/
const HTML_NON_FHRASING_TAGS = new Set([
	"address",
	"article",
	"aside",
	"base",
	"blockquote",
	"body",
	"caption",
	"col",
	"colgroup",
	"dd",
	"details",
	"dialog",
	"div",
	"dl",
	"dt",
	"fieldset",
	"figcaption",
	"figure",
	"footer",
	"form",
	"h1",
	"h2",
	"h3",
	"h4",
	"h5",
	"h6",
	"head",
	"header",
	"hgroup",
	"hr",
	"html",
	"legend",
	"li",
	"menuitem",
	"meta",
	"optgroup",
	"option",
	"param",
	"rp",
	"rt",
	"source",
	"style",
	"summary",
	"tbody",
	"td",
	"tfoot",
	"th",
	"thead",
	"title",
	"tr",
	"track"
]);
/**
* HTML tag names of RCDATA.
*/
const HTML_RCDATA_TAGS = new Set(["title", "textarea"]);
/**
* HTML tag names of RAWTEXT.
*/
const HTML_RAWTEXT_TAGS = new Set([
	"style",
	"xmp",
	"iframe",
	"noembed",
	"noframes",
	"noscript",
	"script"
]);
/**
* SVG tag names.
*/
const SVG_TAGS$1 = new Set([
	"a",
	"altGlyph",
	"altGlyphDef",
	"altGlyphItem",
	"animate",
	"animateColor",
	"animateMotion",
	"animateTransform",
	"animation",
	"audio",
	"canvas",
	"circle",
	"clipPath",
	"color-profile",
	"cursor",
	"defs",
	"desc",
	"discard",
	"ellipse",
	"feBlend",
	"feColorMatrix",
	"feComponentTransfer",
	"feComposite",
	"feConvolveMatrix",
	"feDiffuseLighting",
	"feDisplacementMap",
	"feDistantLight",
	"feDropShadow",
	"feFlood",
	"feFuncA",
	"feFuncB",
	"feFuncG",
	"feFuncR",
	"feGaussianBlur",
	"feImage",
	"feMerge",
	"feMergeNode",
	"feMorphology",
	"feOffset",
	"fePointLight",
	"feSpecularLighting",
	"feSpotLight",
	"feTile",
	"feTurbulence",
	"filter",
	"font",
	"font-face",
	"font-face-format",
	"font-face-name",
	"font-face-src",
	"font-face-uri",
	"foreignObject",
	"g",
	"glyph",
	"glyphRef",
	"handler",
	"hatch",
	"hatchpath",
	"hkern",
	"iframe",
	"image",
	"line",
	"linearGradient",
	"listener",
	"marker",
	"mask",
	"mesh",
	"meshgradient",
	"meshpatch",
	"meshrow",
	"metadata",
	"missing-glyph",
	"mpath",
	"path",
	"pattern",
	"polygon",
	"polyline",
	"prefetch",
	"radialGradient",
	"rect",
	"script",
	"set",
	"solidColor",
	"solidcolor",
	"stop",
	"style",
	"svg",
	"switch",
	"symbol",
	"tbreak",
	"text",
	"textArea",
	"textPath",
	"title",
	"tref",
	"tspan",
	"unknown",
	"use",
	"video",
	"view",
	"vkern"
]);
/**
* The map from lowercase names to actual names in SVG.
*/
const SVG_ELEMENT_NAME_MAP = /* @__PURE__ */ new Map();
for (const name of SVG_TAGS$1) if (/[A-Z]/.test(name)) SVG_ELEMENT_NAME_MAP.set(name.toLowerCase(), name);

//#endregion
//#region src/html/intermediate-tokenizer.ts
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
const DUMMY_PARENT$1 = Object.freeze({});
/**
* Concatenate token values.
* @param text Concatenated text.
* @param token The token to concatenate.
*/
function concat(text, token) {
	return text + token.value;
}
/**
* The class to create HTML tokens from ESTree-like tokens which are created by a Tokenizer.
*/
var IntermediateTokenizer = class {
	tokenizer;
	currentToken;
	attribute;
	attributeNames;
	expressionStartToken;
	expressionTokens;
	tokens;
	comments;
	/**
	* The source code text.
	*/
	get text() {
		return this.tokenizer.text;
	}
	/**
	* The parse errors.
	*/
	get errors() {
		return this.tokenizer.errors;
	}
	/**
	* The current state.
	*/
	get state() {
		return this.tokenizer.state;
	}
	set state(value) {
		this.tokenizer.state = value;
	}
	/**
	* The current namespace.
	*/
	get namespace() {
		return this.tokenizer.namespace;
	}
	set namespace(value) {
		this.tokenizer.namespace = value;
	}
	/**
	* The current flag of expression enabled.
	*/
	get expressionEnabled() {
		return this.tokenizer.expressionEnabled;
	}
	set expressionEnabled(value) {
		this.tokenizer.expressionEnabled = value;
	}
	/**
	* Initialize this intermediate tokenizer.
	* @param tokenizer The tokenizer.
	*/
	constructor(tokenizer) {
		this.tokenizer = tokenizer;
		this.currentToken = null;
		this.attribute = null;
		this.attributeNames = /* @__PURE__ */ new Set();
		this.expressionStartToken = null;
		this.expressionTokens = [];
		this.tokens = [];
		this.comments = [];
	}
	/**
	* Get the next intermediate token.
	* @returns The intermediate token or null.
	*/
	nextToken() {
		let token = null;
		let result = null;
		while (result == null && (token = this.tokenizer.nextToken()) != null) result = this[token.type](token);
		if (result == null && token == null && this.currentToken != null) result = this.commit();
		return result;
	}
	/**
	* Commit the current token.
	*/
	commit() {
		(0, assert.default)(this.currentToken != null || this.expressionStartToken != null);
		let token = this.currentToken;
		this.currentToken = null;
		this.attribute = null;
		if (this.expressionStartToken != null) {
			const start = this.expressionStartToken;
			const end = this.expressionTokens.at(-1) || start;
			const value = this.expressionTokens.reduce(concat, start.value);
			this.expressionStartToken = null;
			this.expressionTokens = [];
			if (token == null) token = {
				type: "Text",
				range: [start.range[0], end.range[1]],
				loc: {
					start: start.loc.start,
					end: end.loc.end
				},
				value
			};
			else if (token.type === "Text") {
				token.range[1] = end.range[1];
				token.loc.end = end.loc.end;
				token.value += value;
			} else throw new Error("unreachable");
		}
		return token;
	}
	/**
	* Report an invalid character error.
	* @param code The error code.
	*/
	reportParseError(token, code) {
		const error = ParseError.fromCode(code, token.range[0], token.loc.start.line, token.loc.start.column);
		this.errors.push(error);
		debug$1("[html] syntax error:", error.message);
	}
	/**
	* Process the given comment token.
	* @param token The comment token to process.
	*/
	processComment(token) {
		this.comments.push(token);
		if (this.currentToken?.type === "Text") return this.commit();
		return null;
	}
	/**
	* Process the given text token.
	* @param token The text token to process.
	*/
	processText(token) {
		this.tokens.push(token);
		let result = null;
		if (this.expressionStartToken != null) {
			if ((this.expressionTokens.at(-1) || this.expressionStartToken).range[1] === token.range[0]) {
				this.expressionTokens.push(token);
				return null;
			}
			result = this.commit();
		} else if (this.currentToken != null) {
			if (this.currentToken.type === "Text" && this.currentToken.range[1] === token.range[0]) {
				this.currentToken.value += token.value;
				this.currentToken.range[1] = token.range[1];
				this.currentToken.loc.end = token.loc.end;
				return null;
			}
			result = this.commit();
		}
		(0, assert.default)(this.currentToken == null);
		this.currentToken = {
			type: "Text",
			range: [token.range[0], token.range[1]],
			loc: {
				start: token.loc.start,
				end: token.loc.end
			},
			value: token.value
		};
		return result;
	}
	/**
	* Process a HTMLAssociation token.
	* @param token The token to process.
	*/
	HTMLAssociation(token) {
		this.tokens.push(token);
		if (this.attribute != null) {
			this.attribute.range[1] = token.range[1];
			this.attribute.loc.end = token.loc.end;
			if (this.currentToken == null || this.currentToken.type !== "StartTag") throw new Error("unreachable");
			this.currentToken.range[1] = token.range[1];
			this.currentToken.loc.end = token.loc.end;
		}
		return null;
	}
	/**
	* Process a HTMLBogusComment token.
	* @param token The token to process.
	*/
	HTMLBogusComment(token) {
		return this.processComment(token);
	}
	/**
	* Process a HTMLCDataText token.
	* @param token The token to process.
	*/
	HTMLCDataText(token) {
		return this.processText(token);
	}
	/**
	* Process a HTMLComment token.
	* @param token The token to process.
	*/
	HTMLComment(token) {
		return this.processComment(token);
	}
	/**
	* Process a HTMLEndTagOpen token.
	* @param token The token to process.
	*/
	HTMLEndTagOpen(token) {
		this.tokens.push(token);
		let result = null;
		if (this.currentToken != null || this.expressionStartToken != null) result = this.commit();
		this.currentToken = {
			type: "EndTag",
			range: [token.range[0], token.range[1]],
			loc: {
				start: token.loc.start,
				end: token.loc.end
			},
			name: token.value
		};
		return result;
	}
	/**
	* Process a HTMLIdentifier token.
	* @param token The token to process.
	*/
	HTMLIdentifier(token) {
		this.tokens.push(token);
		if (this.currentToken == null || this.currentToken.type === "Text" || this.currentToken.type === "Mustache") throw new Error("unreachable");
		if (this.currentToken.type === "EndTag") {
			this.reportParseError(token, "end-tag-with-attributes");
			return null;
		}
		if (this.attributeNames.has(token.value)) this.reportParseError(token, "duplicate-attribute");
		this.attributeNames.add(token.value);
		this.attribute = {
			type: "VAttribute",
			range: [token.range[0], token.range[1]],
			loc: {
				start: token.loc.start,
				end: token.loc.end
			},
			parent: DUMMY_PARENT$1,
			directive: false,
			key: {
				type: "VIdentifier",
				range: [token.range[0], token.range[1]],
				loc: {
					start: token.loc.start,
					end: token.loc.end
				},
				parent: DUMMY_PARENT$1,
				name: token.value,
				rawName: this.text.slice(token.range[0], token.range[1])
			},
			value: null
		};
		this.attribute.key.parent = this.attribute;
		this.currentToken.range[1] = token.range[1];
		this.currentToken.loc.end = token.loc.end;
		this.currentToken.attributes.push(this.attribute);
		return null;
	}
	/**
	* Process a HTMLLiteral token.
	* @param token The token to process.
	*/
	HTMLLiteral(token) {
		this.tokens.push(token);
		if (this.attribute != null) {
			this.attribute.range[1] = token.range[1];
			this.attribute.loc.end = token.loc.end;
			this.attribute.value = {
				type: "VLiteral",
				range: [token.range[0], token.range[1]],
				loc: {
					start: token.loc.start,
					end: token.loc.end
				},
				parent: this.attribute,
				value: token.value
			};
			if (this.currentToken == null || this.currentToken.type !== "StartTag") throw new Error("unreachable");
			this.currentToken.range[1] = token.range[1];
			this.currentToken.loc.end = token.loc.end;
		}
		return null;
	}
	/**
	* Process a HTMLRCDataText token.
	* @param token The token to process.
	*/
	HTMLRCDataText(token) {
		return this.processText(token);
	}
	/**
	* Process a HTMLRawText token.
	* @param token The token to process.
	*/
	HTMLRawText(token) {
		return this.processText(token);
	}
	/**
	* Process a HTMLSelfClosingTagClose token.
	* @param token The token to process.
	*/
	HTMLSelfClosingTagClose(token) {
		this.tokens.push(token);
		if (this.currentToken == null || this.currentToken.type === "Text") throw new Error("unreachable");
		if (this.currentToken.type === "StartTag") this.currentToken.selfClosing = true;
		else this.reportParseError(token, "end-tag-with-trailing-solidus");
		this.currentToken.range[1] = token.range[1];
		this.currentToken.loc.end = token.loc.end;
		return this.commit();
	}
	/**
	* Process a HTMLTagClose token.
	* @param token The token to process.
	*/
	HTMLTagClose(token) {
		this.tokens.push(token);
		if (this.currentToken == null || this.currentToken.type === "Text") throw new Error("unreachable");
		this.currentToken.range[1] = token.range[1];
		this.currentToken.loc.end = token.loc.end;
		return this.commit();
	}
	/**
	* Process a HTMLTagOpen token.
	* @param token The token to process.
	*/
	HTMLTagOpen(token) {
		this.tokens.push(token);
		let result = null;
		if (this.currentToken != null || this.expressionStartToken != null) result = this.commit();
		this.currentToken = {
			type: "StartTag",
			range: [token.range[0], token.range[1]],
			loc: {
				start: token.loc.start,
				end: token.loc.end
			},
			name: token.value,
			rawName: this.text.slice(token.range[0] + 1, token.range[1]),
			selfClosing: false,
			attributes: []
		};
		this.attribute = null;
		this.attributeNames.clear();
		return result;
	}
	/**
	* Process a HTMLText token.
	* @param token The token to process.
	*/
	HTMLText(token) {
		return this.processText(token);
	}
	/**
	* Process a HTMLWhitespace token.
	* @param token The token to process.
	*/
	HTMLWhitespace(token) {
		return this.processText(token);
	}
	/**
	* Process a VExpressionStart token.
	* @param token The token to process.
	*/
	VExpressionStart(token) {
		if (this.expressionStartToken != null) return this.processText(token);
		const result = this.currentToken != null && this.currentToken.range[1] !== token.range[0] ? this.commit() : null;
		this.tokens.push(token);
		this.expressionStartToken = token;
		return result;
	}
	/**
	* Process a VExpressionEnd token.
	* @param token The token to process.
	*/
	VExpressionEnd(token) {
		if (this.expressionStartToken == null) return this.processText(token);
		const start = this.expressionStartToken;
		const end = this.expressionTokens.at(-1) || start;
		if (token.range[0] === start.range[1]) {
			this.tokens.pop();
			this.expressionStartToken = null;
			const result = this.processText(start);
			this.processText(token);
			return result;
		}
		if (end.range[1] !== token.range[0]) {
			const result = this.commit();
			this.processText(token);
			return result;
		}
		const value = this.expressionTokens.reduce(concat, "");
		this.tokens.push(token);
		this.expressionStartToken = null;
		this.expressionTokens = [];
		const result = this.currentToken != null ? this.commit() : null;
		this.currentToken = {
			type: "Mustache",
			range: [start.range[0], token.range[1]],
			loc: {
				start: start.loc.start,
				end: token.loc.end
			},
			value,
			startToken: start,
			endToken: token
		};
		return result || this.commit();
	}
};

//#endregion
//#region src/html/parser.ts
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
const DIRECTIVE_NAME = /^(?:v-|[.:@#]).*[^.:@#]$/u;
const DT_DD = /^d[dt]$/u;
const DUMMY_PARENT = Object.freeze({});
/**
* Gets the tag name from the given node or token.
* For SFC, it returns the value of `rawName` to be case sensitive.
*/
function getTagName(startTagOrElement, isSFC) {
	return isSFC ? startTagOrElement.rawName : startTagOrElement.name;
}
/**
* Check whether the element is a MathML text integration point or not.
* @see https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher
* @param element The current element.
* @param isSFC For SFC, give `true`.
* @returns `true` if the element is a MathML text integration point.
*/
function isMathMLIntegrationPoint(element, isSFC) {
	if (element.namespace === NS.MathML) {
		const name = getTagName(element, isSFC);
		return name === "mi" || name === "mo" || name === "mn" || name === "ms" || name === "mtext";
	}
	return false;
}
/**
* Check whether the element is a HTML integration point or not.
* @see https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher
* @param element The current element.
* @param isSFC For SFC, give `true`.
* @returns `true` if the element is a HTML integration point.
*/
function isHTMLIntegrationPoint(element, isSFC) {
	if (element.namespace === NS.MathML) return getTagName(element, isSFC) === "annotation-xml" && element.startTag.attributes.some((a) => a.directive === false && a.key.name === "encoding" && a.value != null && (a.value.value === "text/html" || a.value.value === "application/xhtml+xml"));
	if (element.namespace === NS.SVG) {
		const name = getTagName(element, isSFC);
		return name === "foreignObject" || name === "desc" || name === "title";
	}
	return false;
}
/**
* Adjust element names by the current namespace.
* @param name The lowercase element name to adjust.
* @param namespace The current namespace.
* @returns The adjusted element name.
*/
function adjustElementName(name, namespace) {
	if (namespace === NS.SVG) return SVG_ELEMENT_NAME_MAP.get(name) || name;
	return name;
}
/**
* Adjust attribute names by the current namespace.
* @param name The lowercase attribute name to adjust.
* @param namespace The current namespace.
* @returns The adjusted attribute name.
*/
function adjustAttributeName(name, namespace) {
	if (namespace === NS.SVG) return SVG_ATTRIBUTE_NAME_MAP.get(name) || name;
	if (namespace === NS.MathML) return MATHML_ATTRIBUTE_NAME_MAP.get(name) || name;
	return name;
}
/**
* Set the location of the last child node to the end location of the given node.
* @param node The node to commit the end location.
*/
function propagateEndLocation(node) {
	const lastChild = (node.type === "VElement" ? node.endTag : null) || node.children.at(-1);
	if (lastChild != null) {
		node.range[1] = lastChild.range[1];
		node.loc.end = lastChild.loc.end;
	}
}
/**
* The parser of HTML.
* This is not following to the HTML spec completely because Vue.js template spec is pretty different to HTML.
*/
var Parser = class {
	tokenizer;
	locationCalculator;
	baseParserOptions;
	isSFC;
	document;
	elementStack;
	vPreElement;
	postProcessesForScript = [];
	/**
	* The source code text.
	*/
	get text() {
		return this.tokenizer.text;
	}
	/**
	* The tokens.
	*/
	get tokens() {
		return this.tokenizer.tokens;
	}
	/**
	* The comments.
	*/
	get comments() {
		return this.tokenizer.comments;
	}
	/**
	* The syntax errors which are found in this parsing.
	*/
	get errors() {
		return this.tokenizer.errors;
	}
	/**
	* The current namespace.
	*/
	get namespace() {
		return this.tokenizer.namespace;
	}
	set namespace(value) {
		this.tokenizer.namespace = value;
	}
	/**
	* The current flag of expression enabled.
	*/
	get expressionEnabled() {
		return this.tokenizer.expressionEnabled;
	}
	set expressionEnabled(value) {
		this.tokenizer.expressionEnabled = value;
	}
	/**
	* Get the current node.
	*/
	get currentNode() {
		return this.elementStack.at(-1) || this.document;
	}
	/**
	* Check if the current location is in a v-pre element.
	*/
	get isInVPreElement() {
		return this.vPreElement != null;
	}
	/**
	* Initialize this parser.
	* @param tokenizer The tokenizer to parse.
	* @param parserOptions The parser options to parse inline expressions.
	*/
	constructor(tokenizer, parserOptions) {
		this.tokenizer = new IntermediateTokenizer(tokenizer);
		this.locationCalculator = new LocationCalculatorForHtml(tokenizer.gaps, tokenizer.lineTerminators);
		this.baseParserOptions = parserOptions;
		this.isSFC = isSFCFile(parserOptions);
		this.document = {
			type: "VDocumentFragment",
			range: [0, 0],
			loc: {
				start: {
					line: 1,
					column: 0
				},
				end: {
					line: 1,
					column: 0
				}
			},
			parent: null,
			children: [],
			tokens: this.tokens,
			comments: this.comments,
			errors: this.errors
		};
		this.elementStack = [];
		this.vPreElement = null;
		this.postProcessesForScript = [];
	}
	/**
	* Parse the HTML which was given in this constructor.
	* @returns The result of parsing.
	*/
	parse() {
		let token = null;
		while ((token = this.tokenizer.nextToken()) != null) this[token.type](token);
		this.popElementStackUntil(0);
		propagateEndLocation(this.document);
		const doc = this.document;
		const htmlParserOptions = {
			...this.baseParserOptions,
			parser: getScriptParser(this.baseParserOptions.parser, function* () {
				yield "<template>";
				yield getParserLangFromSFC(doc);
			}),
			project: void 0,
			projectService: void 0
		};
		const scriptParserOptions = {
			...this.baseParserOptions,
			parser: getScriptParser(this.baseParserOptions.parser, () => getParserLangFromSFC(doc))
		};
		for (const proc of this.postProcessesForScript) proc(htmlParserOptions, scriptParserOptions);
		this.postProcessesForScript = [];
		return doc;
	}
	/**
	* Report an invalid character error.
	* @param code The error code.
	*/
	reportParseError(token, code) {
		const error = ParseError.fromCode(code, token.range[0], token.loc.start.line, token.loc.start.column);
		this.errors.push(error);
		debug$1("[html] syntax error:", error.message);
	}
	/**
	* Pop an element from the current element stack.
	*/
	popElementStack() {
		(0, assert.default)(this.elementStack.length >= 1);
		const element = this.elementStack.pop();
		propagateEndLocation(element);
		const current = this.currentNode;
		this.namespace = current.type === "VElement" ? current.namespace : NS.HTML;
		if (this.vPreElement === element) {
			this.vPreElement = null;
			this.expressionEnabled = true;
		}
		if (this.elementStack.length === 0) this.expressionEnabled = false;
	}
	/**
	* Pop elements from the current element stack.
	* @param index The index of the element you want to pop.
	*/
	popElementStackUntil(index) {
		while (this.elementStack.length > index) this.popElementStack();
	}
	/**
	* Gets the tag name from the given node or token.
	* For SFC, it returns the value of `rawName` to be case sensitive.
	*/
	getTagName(startTagOrElement) {
		return getTagName(startTagOrElement, this.isSFC);
	}
	/**
	* Detect the namespace of the new element.
	* @param token The StartTag token to detect.
	* @returns The namespace of the new element.
	*/
	detectNamespace(token) {
		const name = this.getTagName(token);
		let ns = this.namespace;
		if (ns === NS.MathML || ns === NS.SVG) {
			const element = this.currentNode;
			if (element.type === "VElement") {
				if (element.namespace === NS.MathML && this.getTagName(element) === "annotation-xml" && name === "svg") return NS.SVG;
				if (isHTMLIntegrationPoint(element, this.isSFC) || isMathMLIntegrationPoint(element, this.isSFC) && name !== "mglyph" && name !== "malignmark") ns = NS.HTML;
			}
		}
		if (ns === NS.HTML) {
			if (name === "svg") return NS.SVG;
			if (name === "math") return NS.MathML;
		}
		if (name === "template") {
			const value = token.attributes.find((a) => a.key.name === "xmlns")?.value?.value;
			if (value === NS.HTML || value === NS.MathML || value === NS.SVG) return value;
		}
		return ns;
	}
	/**
	* Close the current element if necessary.
	* @param token The start tag to check.
	*/
	closeCurrentElementIfNecessary(token) {
		const element = this.currentNode;
		if (element.type !== "VElement") return;
		const name = this.getTagName(token);
		const elementName = this.getTagName(element);
		if (elementName === "p" && HTML_NON_FHRASING_TAGS.has(name)) this.popElementStack();
		if (elementName === name && HTML_CAN_BE_LEFT_OPEN_TAGS.has(name)) this.popElementStack();
		if (DT_DD.test(elementName) && DT_DD.test(name)) this.popElementStack();
	}
	/**
	* Adjust and validate the given attribute node.
	* @param node The attribute node to handle.
	* @param namespace The current namespace.
	*/
	processAttribute(node, namespace) {
		if (this.needConvertToDirective(node)) {
			this.postProcessesForScript.push((parserOptions, scriptParserOptions) => {
				convertToDirective(this.text, parserOptions, scriptParserOptions, this.locationCalculator, node);
			});
			return;
		}
		node.key.name = adjustAttributeName(node.key.name, namespace);
		const key = this.getTagName(node.key);
		const value = node.value?.value;
		if (key === "xmlns" && value !== namespace) this.reportParseError(node, "x-invalid-namespace");
		else if (key === "xmlns:xlink" && value !== NS.XLink) this.reportParseError(node, "x-invalid-namespace");
	}
	/**
	* Checks whether the given attribute node is need convert to directive.
	* @param node The node to check
	*/
	needConvertToDirective(node) {
		const element = node.parent.parent;
		const tagName = this.getTagName(element);
		const attrName = this.getTagName(node.key);
		if (attrName === "generic" && element.parent.type === "VDocumentFragment" && isScriptSetupElement(element) && isTSLang(element)) return true;
		if (!(this.expressionEnabled || attrName === "v-pre" && !this.isInVPreElement)) return false;
		return DIRECTIVE_NAME.test(attrName) || attrName === "slot-scope" || tagName === "template" && attrName === "scope";
	}
	/**
	* Process the given template text token with a configured template tokenizer, based on language.
	* @param token The template text token to process.
	* @param templateTokenizerOption The template tokenizer option.
	*/
	processTemplateText(token, templateTokenizerOption) {
		const templateTokenizer = new (typeof templateTokenizerOption === "function" ? templateTokenizerOption : require(templateTokenizerOption))(token.value, this.text, {
			startingLine: token.loc.start.line,
			startingColumn: token.loc.start.column
		});
		const rootTokenizer = this.tokenizer;
		this.tokenizer = templateTokenizer;
		let templateToken = null;
		while ((templateToken = templateTokenizer.nextToken()) != null) this[templateToken.type](templateToken);
		this.tokenizer = rootTokenizer;
		const index = sortedIndexBy(this.tokenizer.tokens, token, (x) => x.range[0]);
		const count = sortedLastIndexBy(this.tokenizer.tokens, token, (x) => x.range[1]) - index;
		this.tokenizer.tokens.splice(index, count, ...templateTokenizer.tokens);
		this.tokenizer.comments.push(...templateTokenizer.comments);
		this.tokenizer.errors.push(...templateTokenizer.errors);
	}
	/**
	* Handle the start tag token.
	* @param token The token to handle.
	*/
	StartTag(token) {
		debug$1("[html] StartTag %j", token);
		this.closeCurrentElementIfNecessary(token);
		const parent = this.currentNode;
		const namespace = this.detectNamespace(token);
		const element = {
			type: "VElement",
			range: [token.range[0], token.range[1]],
			loc: {
				start: token.loc.start,
				end: token.loc.end
			},
			parent,
			name: adjustElementName(token.name, namespace),
			rawName: token.rawName,
			namespace,
			startTag: {
				type: "VStartTag",
				range: token.range,
				loc: token.loc,
				parent: DUMMY_PARENT,
				selfClosing: token.selfClosing,
				attributes: token.attributes
			},
			children: [],
			endTag: null,
			variables: []
		};
		const hasVPre = !this.isInVPreElement && token.attributes.some((a) => this.getTagName(a.key) === "v-pre");
		if (hasVPre) this.expressionEnabled = false;
		parent.children.push(element);
		element.startTag.parent = element;
		for (const attribute of token.attributes) {
			attribute.parent = element.startTag;
			this.processAttribute(attribute, namespace);
		}
		this.postProcessesForScript.push(() => {
			for (const attribute of element.startTag.attributes) if (attribute.directive) {
				if (attribute.key.argument?.type === "VExpressionContainer") resolveReferences(attribute.key.argument);
				if (attribute.value != null) resolveReferences(attribute.value);
			}
		});
		const isVoid = namespace === NS.HTML && HTML_VOID_ELEMENT_TAGS.has(this.getTagName(element));
		if (token.selfClosing && !isVoid && namespace === NS.HTML) this.reportParseError(token, "non-void-html-element-start-tag-with-trailing-solidus");
		if (token.selfClosing || isVoid) {
			this.expressionEnabled = !this.isInVPreElement;
			return;
		}
		this.elementStack.push(element);
		if (hasVPre) {
			(0, assert.default)(this.vPreElement === null);
			this.vPreElement = element;
		}
		this.namespace = namespace;
		if (namespace === NS.HTML) {
			const elementName = this.getTagName(element);
			if (element.parent.type === "VDocumentFragment") {
				const lang = element.startTag.attributes.find((a) => !a.directive && a.key.name === "lang")?.value?.value;
				if (elementName === "template") {
					this.expressionEnabled = true;
					if (lang && lang !== "html") {
						this.tokenizer.state = "RAWTEXT";
						this.expressionEnabled = false;
					}
				} else if (this.isSFC) {
					if (!lang || lang !== "html") this.tokenizer.state = "RAWTEXT";
				} else {
					if (HTML_RCDATA_TAGS.has(elementName)) this.tokenizer.state = "RCDATA";
					if (HTML_RAWTEXT_TAGS.has(elementName)) this.tokenizer.state = "RAWTEXT";
				}
			} else {
				if (HTML_RCDATA_TAGS.has(elementName)) this.tokenizer.state = "RCDATA";
				if (HTML_RAWTEXT_TAGS.has(elementName)) this.tokenizer.state = "RAWTEXT";
			}
		}
	}
	/**
	* Handle the end tag token.
	* @param token The token to handle.
	*/
	EndTag(token) {
		debug$1("[html] EndTag %j", token);
		const i = this.elementStack.findLastIndex((el) => el.name.toLowerCase() === token.name);
		if (i === -1) {
			this.reportParseError(token, "x-invalid-end-tag");
			return;
		}
		const element = this.elementStack[i];
		element.endTag = {
			type: "VEndTag",
			range: token.range,
			loc: token.loc,
			parent: element
		};
		this.popElementStackUntil(i);
	}
	/**
	* Handle the text token.
	* @param token The token to handle.
	*/
	Text(token) {
		debug$1("[html] Text %j", token);
		const parent = this.currentNode;
		if (token.value && parent.type === "VElement" && parent.name === "template" && parent.parent.type === "VDocumentFragment") {
			const lang = (parent.startTag.attributes.find((a) => a.key.name === "lang")?.value)?.value;
			if (lang && lang !== "html") {
				const templateTokenizerOption = this.baseParserOptions.templateTokenizer?.[lang];
				if (templateTokenizerOption) {
					this.processTemplateText(token, templateTokenizerOption);
					return;
				}
			}
		}
		parent.children.push({
			type: "VText",
			range: token.range,
			loc: token.loc,
			parent,
			value: token.value
		});
	}
	/**
	* Handle the text token.
	* @param token The token to handle.
	*/
	Mustache(token) {
		debug$1("[html] Mustache %j", token);
		const parent = this.currentNode;
		const container = {
			type: "VExpressionContainer",
			range: token.range,
			loc: token.loc,
			parent,
			expression: null,
			references: []
		};
		parent.children.push(container);
		this.postProcessesForScript.push((parserOptions) => {
			processMustache(parserOptions, this.locationCalculator, container, token);
			resolveReferences(container);
		});
	}
};

//#endregion
//#region src/html/util/alternative-cr.ts
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
/**
* Code mapping of HTML numeric entities.
*/
const alternativeCR = new Map([
	[128, 8364],
	[130, 8218],
	[131, 402],
	[132, 8222],
	[133, 8230],
	[134, 8224],
	[135, 8225],
	[136, 710],
	[137, 8240],
	[138, 352],
	[139, 8249],
	[140, 338],
	[142, 381],
	[145, 8216],
	[146, 8217],
	[147, 8220],
	[148, 8221],
	[149, 8226],
	[150, 8211],
	[151, 8212],
	[152, 732],
	[153, 8482],
	[154, 353],
	[155, 8250],
	[156, 339],
	[158, 382],
	[159, 376]
]);

//#endregion
//#region src/html/util/entities.ts
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
/**
* HTML entities which are separated by their length.
*/
const entitySets = [
	{
		"length": 32,
		"entities": { "CounterClockwiseContourIntegral;": [8755] }
	},
	{
		"length": 25,
		"entities": {
			"ClockwiseContourIntegral;": [8754],
			"DoubleLongLeftRightArrow;": [10234]
		}
	},
	{
		"length": 24,
		"entities": { "NotNestedGreaterGreater;": [10914, 824] }
	},
	{
		"length": 23,
		"entities": {
			"DiacriticalDoubleAcute;": [733],
			"NotSquareSupersetEqual;": [8931]
		}
	},
	{
		"length": 22,
		"entities": {
			"CloseCurlyDoubleQuote;": [8221],
			"DoubleContourIntegral;": [8751],
			"FilledVerySmallSquare;": [9642],
			"NegativeVeryThinSpace;": [8203],
			"NotPrecedesSlantEqual;": [8928],
			"NotRightTriangleEqual;": [8941],
			"NotSucceedsSlantEqual;": [8929]
		}
	},
	{
		"length": 21,
		"entities": {
			"CapitalDifferentialD;": [8517],
			"DoubleLeftRightArrow;": [8660],
			"DoubleLongRightArrow;": [10233],
			"EmptyVerySmallSquare;": [9643],
			"NestedGreaterGreater;": [8811],
			"NotDoubleVerticalBar;": [8742],
			"NotGreaterSlantEqual;": [10878, 824],
			"NotLeftTriangleEqual;": [8940],
			"NotSquareSubsetEqual;": [8930],
			"OpenCurlyDoubleQuote;": [8220],
			"ReverseUpEquilibrium;": [10607]
		}
	},
	{
		"length": 20,
		"entities": {
			"DoubleLongLeftArrow;": [10232],
			"DownLeftRightVector;": [10576],
			"LeftArrowRightArrow;": [8646],
			"NegativeMediumSpace;": [8203],
			"NotGreaterFullEqual;": [8807, 824],
			"NotRightTriangleBar;": [10704, 824],
			"RightArrowLeftArrow;": [8644],
			"SquareSupersetEqual;": [8850],
			"leftrightsquigarrow;": [8621]
		}
	},
	{
		"length": 19,
		"entities": {
			"DownRightTeeVector;": [10591],
			"DownRightVectorBar;": [10583],
			"LongLeftRightArrow;": [10231],
			"Longleftrightarrow;": [10234],
			"NegativeThickSpace;": [8203],
			"NotLeftTriangleBar;": [10703, 824],
			"PrecedesSlantEqual;": [8828],
			"ReverseEquilibrium;": [8651],
			"RightDoubleBracket;": [10215],
			"RightDownTeeVector;": [10589],
			"RightDownVectorBar;": [10581],
			"RightTriangleEqual;": [8885],
			"SquareIntersection;": [8851],
			"SucceedsSlantEqual;": [8829],
			"blacktriangleright;": [9656],
			"longleftrightarrow;": [10231]
		}
	},
	{
		"length": 18,
		"entities": {
			"DoubleUpDownArrow;": [8661],
			"DoubleVerticalBar;": [8741],
			"DownLeftTeeVector;": [10590],
			"DownLeftVectorBar;": [10582],
			"FilledSmallSquare;": [9724],
			"GreaterSlantEqual;": [10878],
			"LeftDoubleBracket;": [10214],
			"LeftDownTeeVector;": [10593],
			"LeftDownVectorBar;": [10585],
			"LeftTriangleEqual;": [8884],
			"NegativeThinSpace;": [8203],
			"NotGreaterGreater;": [8811, 824],
			"NotLessSlantEqual;": [10877, 824],
			"NotNestedLessLess;": [10913, 824],
			"NotReverseElement;": [8716],
			"NotSquareSuperset;": [8848, 824],
			"NotTildeFullEqual;": [8775],
			"RightAngleBracket;": [10217],
			"RightUpDownVector;": [10575],
			"SquareSubsetEqual;": [8849],
			"VerticalSeparator;": [10072],
			"blacktriangledown;": [9662],
			"blacktriangleleft;": [9666],
			"leftrightharpoons;": [8651],
			"rightleftharpoons;": [8652],
			"twoheadrightarrow;": [8608]
		}
	},
	{
		"length": 17,
		"entities": {
			"DiacriticalAcute;": [180],
			"DiacriticalGrave;": [96],
			"DiacriticalTilde;": [732],
			"DoubleRightArrow;": [8658],
			"DownArrowUpArrow;": [8693],
			"EmptySmallSquare;": [9723],
			"GreaterEqualLess;": [8923],
			"GreaterFullEqual;": [8807],
			"LeftAngleBracket;": [10216],
			"LeftUpDownVector;": [10577],
			"LessEqualGreater;": [8922],
			"NonBreakingSpace;": [160],
			"NotPrecedesEqual;": [10927, 824],
			"NotRightTriangle;": [8939],
			"NotSucceedsEqual;": [10928, 824],
			"NotSucceedsTilde;": [8831, 824],
			"NotSupersetEqual;": [8841],
			"RightTriangleBar;": [10704],
			"RightUpTeeVector;": [10588],
			"RightUpVectorBar;": [10580],
			"UnderParenthesis;": [9181],
			"UpArrowDownArrow;": [8645],
			"circlearrowright;": [8635],
			"downharpoonright;": [8642],
			"ntrianglerighteq;": [8941],
			"rightharpoondown;": [8641],
			"rightrightarrows;": [8649],
			"twoheadleftarrow;": [8606],
			"vartriangleright;": [8883]
		}
	},
	{
		"length": 16,
		"entities": {
			"CloseCurlyQuote;": [8217],
			"ContourIntegral;": [8750],
			"DoubleDownArrow;": [8659],
			"DoubleLeftArrow;": [8656],
			"DownRightVector;": [8641],
			"LeftRightVector;": [10574],
			"LeftTriangleBar;": [10703],
			"LeftUpTeeVector;": [10592],
			"LeftUpVectorBar;": [10584],
			"LowerRightArrow;": [8600],
			"NotGreaterEqual;": [8817],
			"NotGreaterTilde;": [8821],
			"NotHumpDownHump;": [8782, 824],
			"NotLeftTriangle;": [8938],
			"NotSquareSubset;": [8847, 824],
			"OverParenthesis;": [9180],
			"RightDownVector;": [8642],
			"ShortRightArrow;": [8594],
			"UpperRightArrow;": [8599],
			"bigtriangledown;": [9661],
			"circlearrowleft;": [8634],
			"curvearrowright;": [8631],
			"downharpoonleft;": [8643],
			"leftharpoondown;": [8637],
			"leftrightarrows;": [8646],
			"nLeftrightarrow;": [8654],
			"nleftrightarrow;": [8622],
			"ntrianglelefteq;": [8940],
			"rightleftarrows;": [8644],
			"rightsquigarrow;": [8605],
			"rightthreetimes;": [8908],
			"straightepsilon;": [1013],
			"trianglerighteq;": [8885],
			"vartriangleleft;": [8882]
		}
	},
	{
		"length": 15,
		"entities": {
			"DiacriticalDot;": [729],
			"DoubleRightTee;": [8872],
			"DownLeftVector;": [8637],
			"GreaterGreater;": [10914],
			"HorizontalLine;": [9472],
			"InvisibleComma;": [8291],
			"InvisibleTimes;": [8290],
			"LeftDownVector;": [8643],
			"LeftRightArrow;": [8596],
			"Leftrightarrow;": [8660],
			"LessSlantEqual;": [10877],
			"LongRightArrow;": [10230],
			"Longrightarrow;": [10233],
			"LowerLeftArrow;": [8601],
			"NestedLessLess;": [8810],
			"NotGreaterLess;": [8825],
			"NotLessGreater;": [8824],
			"NotSubsetEqual;": [8840],
			"NotVerticalBar;": [8740],
			"OpenCurlyQuote;": [8216],
			"ReverseElement;": [8715],
			"RightTeeVector;": [10587],
			"RightVectorBar;": [10579],
			"ShortDownArrow;": [8595],
			"ShortLeftArrow;": [8592],
			"SquareSuperset;": [8848],
			"TildeFullEqual;": [8773],
			"UpperLeftArrow;": [8598],
			"ZeroWidthSpace;": [8203],
			"curvearrowleft;": [8630],
			"doublebarwedge;": [8966],
			"downdownarrows;": [8650],
			"hookrightarrow;": [8618],
			"leftleftarrows;": [8647],
			"leftrightarrow;": [8596],
			"leftthreetimes;": [8907],
			"longrightarrow;": [10230],
			"looparrowright;": [8620],
			"nshortparallel;": [8742],
			"ntriangleright;": [8939],
			"rightarrowtail;": [8611],
			"rightharpoonup;": [8640],
			"trianglelefteq;": [8884],
			"upharpoonright;": [8638]
		}
	},
	{
		"length": 14,
		"entities": {
			"ApplyFunction;": [8289],
			"DifferentialD;": [8518],
			"DoubleLeftTee;": [10980],
			"DoubleUpArrow;": [8657],
			"LeftTeeVector;": [10586],
			"LeftVectorBar;": [10578],
			"LessFullEqual;": [8806],
			"LongLeftArrow;": [10229],
			"Longleftarrow;": [10232],
			"NotEqualTilde;": [8770, 824],
			"NotTildeEqual;": [8772],
			"NotTildeTilde;": [8777],
			"Poincareplane;": [8460],
			"PrecedesEqual;": [10927],
			"PrecedesTilde;": [8830],
			"RightArrowBar;": [8677],
			"RightTeeArrow;": [8614],
			"RightTriangle;": [8883],
			"RightUpVector;": [8638],
			"SucceedsEqual;": [10928],
			"SucceedsTilde;": [8831],
			"SupersetEqual;": [8839],
			"UpEquilibrium;": [10606],
			"VerticalTilde;": [8768],
			"VeryThinSpace;": [8202],
			"bigtriangleup;": [9651],
			"blacktriangle;": [9652],
			"divideontimes;": [8903],
			"fallingdotseq;": [8786],
			"hookleftarrow;": [8617],
			"leftarrowtail;": [8610],
			"leftharpoonup;": [8636],
			"longleftarrow;": [10229],
			"looparrowleft;": [8619],
			"measuredangle;": [8737],
			"ntriangleleft;": [8938],
			"shortparallel;": [8741],
			"smallsetminus;": [8726],
			"triangleright;": [9657],
			"upharpoonleft;": [8639],
			"varsubsetneqq;": [10955, 65024],
			"varsupsetneqq;": [10956, 65024]
		}
	},
	{
		"length": 13,
		"entities": {
			"DownArrowBar;": [10515],
			"DownTeeArrow;": [8615],
			"ExponentialE;": [8519],
			"GreaterEqual;": [8805],
			"GreaterTilde;": [8819],
			"HilbertSpace;": [8459],
			"HumpDownHump;": [8782],
			"Intersection;": [8898],
			"LeftArrowBar;": [8676],
			"LeftTeeArrow;": [8612],
			"LeftTriangle;": [8882],
			"LeftUpVector;": [8639],
			"NotCongruent;": [8802],
			"NotHumpEqual;": [8783, 824],
			"NotLessEqual;": [8816],
			"NotLessTilde;": [8820],
			"Proportional;": [8733],
			"RightCeiling;": [8969],
			"RoundImplies;": [10608],
			"ShortUpArrow;": [8593],
			"SquareSubset;": [8847],
			"UnderBracket;": [9141],
			"VerticalLine;": [124],
			"blacklozenge;": [10731],
			"exponentiale;": [8519],
			"risingdotseq;": [8787],
			"triangledown;": [9663],
			"triangleleft;": [9667],
			"varsubsetneq;": [8842, 65024],
			"varsupsetneq;": [8843, 65024]
		}
	},
	{
		"length": 12,
		"entities": {
			"CircleMinus;": [8854],
			"CircleTimes;": [8855],
			"Equilibrium;": [8652],
			"GreaterLess;": [8823],
			"LeftCeiling;": [8968],
			"LessGreater;": [8822],
			"MediumSpace;": [8287],
			"NotLessLess;": [8810, 824],
			"NotPrecedes;": [8832],
			"NotSucceeds;": [8833],
			"NotSuperset;": [8835, 8402],
			"OverBracket;": [9140],
			"RightVector;": [8640],
			"Rrightarrow;": [8667],
			"RuleDelayed;": [10740],
			"SmallCircle;": [8728],
			"SquareUnion;": [8852],
			"SubsetEqual;": [8838],
			"UpDownArrow;": [8597],
			"Updownarrow;": [8661],
			"VerticalBar;": [8739],
			"backepsilon;": [1014],
			"blacksquare;": [9642],
			"circledcirc;": [8858],
			"circleddash;": [8861],
			"curlyeqprec;": [8926],
			"curlyeqsucc;": [8927],
			"diamondsuit;": [9830],
			"eqslantless;": [10901],
			"expectation;": [8496],
			"nRightarrow;": [8655],
			"nrightarrow;": [8603],
			"preccurlyeq;": [8828],
			"precnapprox;": [10937],
			"quaternions;": [8461],
			"straightphi;": [981],
			"succcurlyeq;": [8829],
			"succnapprox;": [10938],
			"thickapprox;": [8776],
			"updownarrow;": [8597]
		}
	},
	{
		"length": 11,
		"entities": {
			"Bernoullis;": [8492],
			"CirclePlus;": [8853],
			"EqualTilde;": [8770],
			"Fouriertrf;": [8497],
			"ImaginaryI;": [8520],
			"Laplacetrf;": [8466],
			"LeftVector;": [8636],
			"Lleftarrow;": [8666],
			"NotElement;": [8713],
			"NotGreater;": [8815],
			"Proportion;": [8759],
			"RightArrow;": [8594],
			"RightFloor;": [8971],
			"Rightarrow;": [8658],
			"ThickSpace;": [8287, 8202],
			"TildeEqual;": [8771],
			"TildeTilde;": [8776],
			"UnderBrace;": [9183],
			"UpArrowBar;": [10514],
			"UpTeeArrow;": [8613],
			"circledast;": [8859],
			"complement;": [8705],
			"curlywedge;": [8911],
			"eqslantgtr;": [10902],
			"gtreqqless;": [10892],
			"lessapprox;": [10885],
			"lesseqqgtr;": [10891],
			"lmoustache;": [9136],
			"longmapsto;": [10236],
			"mapstodown;": [8615],
			"mapstoleft;": [8612],
			"nLeftarrow;": [8653],
			"nleftarrow;": [8602],
			"nsubseteqq;": [10949, 824],
			"nsupseteqq;": [10950, 824],
			"precapprox;": [10935],
			"rightarrow;": [8594],
			"rmoustache;": [9137],
			"sqsubseteq;": [8849],
	   		"sqsupseteq;": [8850],
			"subsetneqq;": [10955],
			"succapprox;": [10936],
			"supsetneqq;": [10956],
			"upuparrows;": [8648],
			"varepsilon;": [1013],
			"varnothing;": [8709]
		}
	},
	{
		"length": 10,
		"entities": {
			"Backslash;": [8726],
			"CenterDot;": [183],
			"CircleDot;": [8857],
			"Congruent;": [8801],
			"Coproduct;": [8720],
			"DoubleDot;": [168],
			"DownArrow;": [8595],
			"DownBreve;": [785],
			"Downarrow;": [8659],
			"HumpEqual;": [8783],
			"LeftArrow;": [8592],
			"LeftFloor;": [8970],
			"Leftarrow;": [8656],
			"LessTilde;": [8818],
			"Mellintrf;": [8499],
			"MinusPlus;": [8723],
			"NotCupCap;": [8813],
			"NotExists;": [8708],
			"NotSubset;": [8834, 8402],
			"OverBrace;": [9182],
			"PlusMinus;": [177],
			"Therefore;": [8756],
			"ThinSpace;": [8201],
			"TripleDot;": [8411],
			"UnionPlus;": [8846],
			"backprime;": [8245],
			"backsimeq;": [8909],
			"bigotimes;": [10754],
			"centerdot;": [183],
			"checkmark;": [10003],
			"complexes;": [8450],
			"dotsquare;": [8865],
			"downarrow;": [8595],
			"gtrapprox;": [10886],
			"gtreqless;": [8923],
			"gvertneqq;": [8809, 65024],
			"heartsuit;": [9829],
			"leftarrow;": [8592],
			"lesseqgtr;": [8922],
			"lvertneqq;": [8808, 65024],
			"ngeqslant;": [10878, 824],
			"nleqslant;": [10877, 824],
			"nparallel;": [8742],
			"nshortmid;": [8740],
			"nsubseteq;": [8840],
			"nsupseteq;": [8841],
			"pitchfork;": [8916],
			"rationals;": [8474],
			"spadesuit;": [9824],
			"subseteqq;": [10949],
			"subsetneq;": [8842],
			"supseteqq;": [10950],
			"supsetneq;": [8843],
			"therefore;": [8756],
			"triangleq;": [8796],
			"varpropto;": [8733]
		}
	},
	{
		"length": 9,
		"entities": {
			"DDotrahd;": [10513],
			"DotEqual;": [8784],
			"Integral;": [8747],
			"LessLess;": [10913],
			"NotEqual;": [8800],
			"NotTilde;": [8769],
			"PartialD;": [8706],
			"Precedes;": [8826],
			"RightTee;": [8866],
			"Succeeds;": [8827],
			"SuchThat;": [8715],
			"Superset;": [8835],
			"Uarrocir;": [10569],
			"UnderBar;": [95],
			"andslope;": [10840],
			"angmsdaa;": [10664],
			"angmsdab;": [10665],
			"angmsdac;": [10666],
			"angmsdad;": [10667],
			"angmsdae;": [10668],
			"angmsdaf;": [10669],
			"angmsdag;": [10670],
			"angmsdah;": [10671],
			"angrtvbd;": [10653],
			"approxeq;": [8778],
			"awconint;": [8755],
			"backcong;": [8780],
			"barwedge;": [8965],
			"bbrktbrk;": [9142],
			"bigoplus;": [10753],
			"bigsqcup;": [10758],
			"biguplus;": [10756],
			"bigwedge;": [8896],
			"boxminus;": [8863],
			"boxtimes;": [8864],
			"bsolhsub;": [10184],
			"capbrcup;": [10825],
			"circledR;": [174],
			"circledS;": [9416],
			"cirfnint;": [10768],
			"clubsuit;": [9827],
			"cupbrcap;": [10824],
			"curlyvee;": [8910],
			"cwconint;": [8754],
			"doteqdot;": [8785],
			"dotminus;": [8760],
			"drbkarow;": [10512],
			"dzigrarr;": [10239],
			"elinters;": [9191],
			"emptyset;": [8709],
			"eqvparsl;": [10725],
			"fpartint;": [10765],
			"geqslant;": [10878],
			"gesdotol;": [10884],
			"gnapprox;": [10890],
			"hksearow;": [10533],
			"hkswarow;": [10534],
			"imagline;": [8464],
			"imagpart;": [8465],
			"infintie;": [10717],
			"integers;": [8484],
			"intercal;": [8890],
			"intlarhk;": [10775],
			"laemptyv;": [10676],
			"ldrushar;": [10571],
			"leqslant;": [10877],
			"lesdotor;": [10883],
			"llcorner;": [8990],
			"lnapprox;": [10889],
			"lrcorner;": [8991],
			"lurdshar;": [10570],
			"mapstoup;": [8613],
			"multimap;": [8888],
			"naturals;": [8469],
			"ncongdot;": [10861, 824],
			"notindot;": [8949, 824],
			"otimesas;": [10806],
			"parallel;": [8741],
			"plusacir;": [10787],
			"pointint;": [10773],
			"precneqq;": [10933],
			"precnsim;": [8936],
			"profalar;": [9006],
			"profline;": [8978],
			"profsurf;": [8979],
			"raemptyv;": [10675],
			"realpart;": [8476],
			"rppolint;": [10770],
			"rtriltri;": [10702],
			"scpolint;": [10771],
			"setminus;": [8726],
			"shortmid;": [8739],
			"smeparsl;": [10724],
			"sqsubset;": [8847],
			"sqsupset;": [8848],
			"subseteq;": [8838],
			"succneqq;": [10934],
			"succnsim;": [8937],
			"supseteq;": [8839],
			"thetasym;": [977],
			"thicksim;": [8764],
			"timesbar;": [10801],
			"triangle;": [9653],
			"triminus;": [10810],
			"trpezium;": [9186],
			"ulcorner;": [8988],
			"urcorner;": [8989],
			"varkappa;": [1008],
			"varsigma;": [962],
			"vartheta;": [977]
		}
	},
	{
		"length": 8,
		"entities": {
			"Because;": [8757],
			"Cayleys;": [8493],
			"Cconint;": [8752],
			"Cedilla;": [184],
			"Diamond;": [8900],
			"DownTee;": [8868],
			"Element;": [8712],
			"Epsilon;": [917],
			"Implies;": [8658],
			"LeftTee;": [8867],
			"NewLine;": [10],
			"NoBreak;": [8288],
			"NotLess;": [8814],
			"Omicron;": [927],
			"OverBar;": [8254],
			"Product;": [8719],
			"UpArrow;": [8593],
			"Uparrow;": [8657],
			"Upsilon;": [933],
			"alefsym;": [8501],
			"angrtvb;": [8894],
			"angzarr;": [9084],
			"asympeq;": [8781],
			"backsim;": [8765],
			"because;": [8757],
			"bemptyv;": [10672],
			"between;": [8812],
			"bigcirc;": [9711],
			"bigodot;": [10752],
			"bigstar;": [9733],
			"bnequiv;": [8801, 8421],
			"boxplus;": [8862],
			"ccupssm;": [10832],
			"cemptyv;": [10674],
			"cirscir;": [10690],
			"coloneq;": [8788],
			"congdot;": [10861],
			"cudarrl;": [10552],
			"cudarrr;": [10549],
			"cularrp;": [10557],
			"curarrm;": [10556],
			"dbkarow;": [10511],
			"ddagger;": [8225],
			"ddotseq;": [10871],
			"demptyv;": [10673],
			"diamond;": [8900],
			"digamma;": [989],
			"dotplus;": [8724],
			"dwangle;": [10662],
			"epsilon;": [949],
			"eqcolon;": [8789],
			"equivDD;": [10872],
			"gesdoto;": [10882],
			"gtquest;": [10876],
			"gtrless;": [8823],
			"harrcir;": [10568],
			"intprod;": [10812],
			"isindot;": [8949],
			"larrbfs;": [10527],
			"larrsim;": [10611],
			"lbrksld;": [10639],
			"lbrkslu;": [10637],
			"ldrdhar;": [10599],
			"lesdoto;": [10881],
			"lessdot;": [8918],
			"lessgtr;": [8822],
			"lesssim;": [8818],
			"lotimes;": [10804],
			"lozenge;": [9674],
			"ltquest;": [10875],
			"luruhar;": [10598],
			"maltese;": [10016],
			"minusdu;": [10794],
			"napprox;": [8777],
			"natural;": [9838],
			"nearrow;": [8599],
			"nexists;": [8708],
			"notinva;": [8713],
			"notinvb;": [8951],
			"notinvc;": [8950],
			"notniva;": [8716],
			"notnivb;": [8958],
			"notnivc;": [8957],
			"npolint;": [10772],
			"npreceq;": [10927, 824],
			"nsqsube;": [8930],
			"nsqsupe;": [8931],
			"nsubset;": [8834, 8402],
			"nsucceq;": [10928, 824],
			"nsupset;": [8835, 8402],
			"nvinfin;": [10718],
			"nvltrie;": [8884, 8402],
			"nvrtrie;": [8885, 8402],
			"nwarrow;": [8598],
			"olcross;": [10683],
			"omicron;": [959],
			"orderof;": [8500],
			"orslope;": [10839],
			"pertenk;": [8241],
			"planckh;": [8462],
			"pluscir;": [10786],
			"plussim;": [10790],
			"plustwo;": [10791],
			"precsim;": [8830],
			"quatint;": [10774],
			"questeq;": [8799],
			"rarrbfs;": [10528],
			"rarrsim;": [10612],
			"rbrksld;": [10638],
			"rbrkslu;": [10640],
			"rdldhar;": [10601],
			"realine;": [8475],
			"rotimes;": [10805],
			"ruluhar;": [10600],
			"searrow;": [8600],
			"simplus;": [10788],
			"simrarr;": [10610],
			"subedot;": [10947],
			"submult;": [10945],
			"subplus;": [10943],
			"subrarr;": [10617],
			"succsim;": [8831],
			"supdsub;": [10968],
			"supedot;": [10948],
			"suphsol;": [10185],
			"suphsub;": [10967],
			"suplarr;": [10619],
			"supmult;": [10946],
			"supplus;": [10944],
			"swarrow;": [8601],
			"topfork;": [10970],
			"triplus;": [10809],
			"tritime;": [10811],
			"uparrow;": [8593],
			"upsilon;": [965],
			"uwangle;": [10663],
			"vzigzag;": [10650],
			"zigrarr;": [8669]
		}
	},
	{
		"length": 7,
		"entities": {
			"Aacute;": [193],
			"Abreve;": [258],
			"Agrave;": [192],
			"Assign;": [8788],
			"Atilde;": [195],
			"Barwed;": [8966],
			"Bumpeq;": [8782],
			"Cacute;": [262],
			"Ccaron;": [268],
			"Ccedil;": [199],
			"Colone;": [10868],
			"Conint;": [8751],
			"CupCap;": [8781],
			"Dagger;": [8225],
			"Dcaron;": [270],
			"DotDot;": [8412],
			"Dstrok;": [272],
			"Eacute;": [201],
			"Ecaron;": [282],
			"Egrave;": [200],
			"Exists;": [8707],
			"ForAll;": [8704],
			"Gammad;": [988],
			"Gbreve;": [286],
			"Gcedil;": [290],
			"HARDcy;": [1066],
			"Hstrok;": [294],
			"Iacute;": [205],
			"Igrave;": [204],
			"Itilde;": [296],
			"Jsercy;": [1032],
			"Kcedil;": [310],
			"Lacute;": [313],
			"Lambda;": [923],
			"Lcaron;": [317],
			"Lcedil;": [315],
			"Lmidot;": [319],
			"Lstrok;": [321],
			"Nacute;": [323],
			"Ncaron;": [327],
			"Ncedil;": [325],
			"Ntilde;": [209],
			"Oacute;": [211],
			"Odblac;": [336],
			"Ograve;": [210],
			"Oslash;": [216],
			"Otilde;": [213],
			"Otimes;": [10807],
			"Racute;": [340],
			"Rarrtl;": [10518],
			"Rcaron;": [344],
			"Rcedil;": [342],
			"SHCHcy;": [1065],
			"SOFTcy;": [1068],
			"Sacute;": [346],
			"Scaron;": [352],
			"Scedil;": [350],
			"Square;": [9633],
			"Subset;": [8912],
			"Supset;": [8913],
			"Tcaron;": [356],
			"Tcedil;": [354],
			"Tstrok;": [358],
			"Uacute;": [218],
			"Ubreve;": [364],
			"Udblac;": [368],
			"Ugrave;": [217],
			"Utilde;": [360],
			"Vdashl;": [10982],
			"Verbar;": [8214],
			"Vvdash;": [8874],
			"Yacute;": [221],
			"Zacute;": [377],
			"Zcaron;": [381],
			"aacute;": [225],
			"abreve;": [259],
			"agrave;": [224],
			"andand;": [10837],
			"angmsd;": [8737],
			"angsph;": [8738],
			"apacir;": [10863],
			"approx;": [8776],
			"atilde;": [227],
			"barvee;": [8893],
			"barwed;": [8965],
			"becaus;": [8757],
			"bernou;": [8492],
			"bigcap;": [8898],
			"bigcup;": [8899],
			"bigvee;": [8897],
			"bkarow;": [10509],
			"bottom;": [8869],
			"bowtie;": [8904],
			"boxbox;": [10697],
			"bprime;": [8245],
			"brvbar;": [166],
			"bullet;": [8226],
			"bumpeq;": [8783],
			"cacute;": [263],
			"capand;": [10820],
			"capcap;": [10827],
			"capcup;": [10823],
			"capdot;": [10816],
			"ccaron;": [269],
			"ccedil;": [231],
			"circeq;": [8791],
			"cirmid;": [10991],
			"colone;": [8788],
			"commat;": [64],
			"compfn;": [8728],
			"conint;": [8750],
			"coprod;": [8720],
			"copysr;": [8471],
			"cularr;": [8630],
			"cupcap;": [10822],
			"cupcup;": [10826],
			"cupdot;": [8845],
			"curarr;": [8631],
			"curren;": [164],
			"cylcty;": [9005],
			"dagger;": [8224],
			"daleth;": [8504],
			"dcaron;": [271],
			"dfisht;": [10623],
			"divide;": [247],
			"divonx;": [8903],
			"dlcorn;": [8990],
			"dlcrop;": [8973],
			"dollar;": [36],
			"drcorn;": [8991],
			"drcrop;": [8972],
			"dstrok;": [273],
			"eacute;": [233],
			"easter;": [10862],
			"ecaron;": [283],
			"ecolon;": [8789],
			"egrave;": [232],
			"egsdot;": [10904],
			"elsdot;": [10903],
			"emptyv;": [8709],
			"emsp13;": [8196],
			"emsp14;": [8197],
			"eparsl;": [10723],
			"eqcirc;": [8790],
			"equals;": [61],
			"equest;": [8799],
			"female;": [9792],
			"ffilig;": [64259],
			"ffllig;": [64260],
			"forall;": [8704],
			"frac12;": [189],
			"frac13;": [8531],
			"frac14;": [188],
			"frac15;": [8533],
			"frac16;": [8537],
			"frac18;": [8539],
			"frac23;": [8532],
			"frac25;": [8534],
			"frac34;": [190],
			"frac35;": [8535],
			"frac38;": [8540],
			"frac45;": [8536],
			"frac56;": [8538],
			"frac58;": [8541],
			"frac78;": [8542],
			"gacute;": [501],
			"gammad;": [989],
			"gbreve;": [287],
			"gesdot;": [10880],
			"gesles;": [10900],
			"gtlPar;": [10645],
			"gtrarr;": [10616],
			"gtrdot;": [8919],
			"gtrsim;": [8819],
			"hairsp;": [8202],
			"hamilt;": [8459],
			"hardcy;": [1098],
			"hearts;": [9829],
			"hellip;": [8230],
			"hercon;": [8889],
			"homtht;": [8763],
			"horbar;": [8213],
			"hslash;": [8463],
			"hstrok;": [295],
			"hybull;": [8259],
			"hyphen;": [8208],
			"iacute;": [237],
			"igrave;": [236],
			"iiiint;": [10764],
			"iinfin;": [10716],
			"incare;": [8453],
			"inodot;": [305],
			"intcal;": [8890],
			"iquest;": [191],
			"isinsv;": [8947],
			"itilde;": [297],
			"jsercy;": [1112],
			"kappav;": [1008],
			"kcedil;": [311],
			"kgreen;": [312],
			"lAtail;": [10523],
			"lacute;": [314],
			"lagran;": [8466],
			"lambda;": [955],
			"langle;": [10216],
			"larrfs;": [10525],
			"larrhk;": [8617],
			"larrlp;": [8619],
			"larrpl;": [10553],
			"larrtl;": [8610],
			"latail;": [10521],
			"lbrace;": [123],
			"lbrack;": [91],
			"lcaron;": [318],
			"lcedil;": [316],
			"ldquor;": [8222],
			"lesdot;": [10879],
			"lesges;": [10899],
			"lfisht;": [10620],
			"lfloor;": [8970],
			"lharul;": [10602],
			"llhard;": [10603],
			"lmidot;": [320],
			"lmoust;": [9136],
			"loplus;": [10797],
			"lowast;": [8727],
			"lowbar;": [95],
			"lparlt;": [10643],
			"lrhard;": [10605],
			"lsaquo;": [8249],
			"lsquor;": [8218],
			"lstrok;": [322],
			"lthree;": [8907],
			"ltimes;": [8905],
			"ltlarr;": [10614],
			"ltrPar;": [10646],
			"mapsto;": [8614],
			"marker;": [9646],
			"mcomma;": [10793],
			"midast;": [42],
			"midcir;": [10992],
			"middot;": [183],
			"minusb;": [8863],
			"minusd;": [8760],
			"mnplus;": [8723],
			"models;": [8871],
			"mstpos;": [8766],
			"nVDash;": [8879],
			"nVdash;": [8878],
			"nacute;": [324],
			"nbumpe;": [8783, 824],
			"ncaron;": [328],
			"ncedil;": [326],
			"nearhk;": [10532],
			"nequiv;": [8802],
			"nesear;": [10536],
			"nexist;": [8708],
			"nltrie;": [8940],
			"notinE;": [8953, 824],
			"nparsl;": [11005, 8421],
			"nprcue;": [8928],
			"nrarrc;": [10547, 824],
			"nrarrw;": [8605, 824],
			"nrtrie;": [8941],
			"nsccue;": [8929],
			"nsimeq;": [8772],
			"ntilde;": [241],
			"numero;": [8470],
			"nvDash;": [8877],
			"nvHarr;": [10500],
			"nvdash;": [8876],
			"nvlArr;": [10498],
			"nvrArr;": [10499],
			"nwarhk;": [10531],
			"nwnear;": [10535],
			"oacute;": [243],
			"odblac;": [337],
			"odsold;": [10684],
			"ograve;": [242],
			"ominus;": [8854],
			"origof;": [8886],
			"oslash;": [248],
			"otilde;": [245],
			"otimes;": [8855],
			"parsim;": [10995],
			"percnt;": [37],
			"period;": [46],
			"permil;": [8240],
			"phmmat;": [8499],
			"planck;": [8463],
			"plankv;": [8463],
			"plusdo;": [8724],
			"plusdu;": [10789],
			"plusmn;": [177],
			"preceq;": [10927],
			"primes;": [8473],
			"prnsim;": [8936],
			"propto;": [8733],
			"prurel;": [8880],
			"puncsp;": [8200],
			"qprime;": [8279],
			"rAtail;": [10524],
			"racute;": [341],
			"rangle;": [10217],
			"rarrap;": [10613],
			"rarrfs;": [10526],
			"rarrhk;": [8618],
			"rarrlp;": [8620],
			"rarrpl;": [10565],
			"rarrtl;": [8611],
			"ratail;": [10522],
			"rbrace;": [125],
			"rbrack;": [93],
			"rcaron;": [345],
			"rcedil;": [343],
			"rdquor;": [8221],
			"rfisht;": [10621],
			"rfloor;": [8971],
			"rharul;": [10604],
			"rmoust;": [9137],
			"roplus;": [10798],
			"rpargt;": [10644],
			"rsaquo;": [8250],
			"rsquor;": [8217],
			"rthree;": [8908],
			"rtimes;": [8906],
			"sacute;": [347],
			"scaron;": [353],
			"scedil;": [351],
			"scnsim;": [8937],
			"searhk;": [10533],
			"seswar;": [10537],
			"sfrown;": [8994],
			"shchcy;": [1097],
			"sigmaf;": [962],
			"sigmav;": [962],
			"simdot;": [10858],
			"smashp;": [10803],
			"softcy;": [1100],
			"solbar;": [9023],
			"spades;": [9824],
			"sqcaps;": [8851, 65024],
			"sqcups;": [8852, 65024],
			"sqsube;": [8849],
			"sqsupe;": [8850],
			"square;": [9633],
			"squarf;": [9642],
			"ssetmn;": [8726],
			"ssmile;": [8995],
			"sstarf;": [8902],
			"subdot;": [10941],
			"subset;": [8834],
			"subsim;": [10951],
			"subsub;": [10965],
			"subsup;": [10963],
			"succeq;": [10928],
			"supdot;": [10942],
			"supset;": [8835],
			"supsim;": [10952],
			"supsub;": [10964],
			"supsup;": [10966],
			"swarhk;": [10534],
			"swnwar;": [10538],
			"target;": [8982],
			"tcaron;": [357],
			"tcedil;": [355],
			"telrec;": [8981],
			"there4;": [8756],
			"thetav;": [977],
			"thinsp;": [8201],
			"thksim;": [8764],
			"timesb;": [8864],
			"timesd;": [10800],
			"topbot;": [9014],
			"topcir;": [10993],
			"tprime;": [8244],
			"tridot;": [9708],
			"tstrok;": [359],
			"uacute;": [250],
			"ubreve;": [365],
			"udblac;": [369],
			"ufisht;": [10622],
			"ugrave;": [249],
			"ulcorn;": [8988],
			"ulcrop;": [8975],
			"urcorn;": [8989],
			"urcrop;": [8974],
			"utilde;": [361],
			"vangrt;": [10652],
			"varphi;": [981],
			"varrho;": [1009],
			"veebar;": [8891],
			"vellip;": [8942],
			"verbar;": [124],
			"vsubnE;": [10955, 65024],
			"vsubne;": [8842, 65024],
			"vsupnE;": [10956, 65024],
			"vsupne;": [8843, 65024],
			"wedbar;": [10847],
			"wedgeq;": [8793],
			"weierp;": [8472],
			"wreath;": [8768],
			"xoplus;": [10753],
			"xotime;": [10754],
			"xsqcup;": [10758],
			"xuplus;": [10756],
			"xwedge;": [8896],
			"yacute;": [253],
			"zacute;": [378],
			"zcaron;": [382],
			"zeetrf;": [8488]
		}
	},
	{
		"length": 6,
		"entities": {
			"AElig;": [198],
			"Aacute": [193],
			"Acirc;": [194],
			"Agrave": [192],
			"Alpha;": [913],
			"Amacr;": [256],
			"Aogon;": [260],
			"Aring;": [197],
			"Atilde": [195],
			"Breve;": [728],
			"Ccedil": [199],
			"Ccirc;": [264],
			"Colon;": [8759],
			"Cross;": [10799],
			"Dashv;": [10980],
			"Delta;": [916],
			"Eacute": [201],
			"Ecirc;": [202],
			"Egrave": [200],
			"Emacr;": [274],
			"Eogon;": [280],
			"Equal;": [10869],
			"Gamma;": [915],
			"Gcirc;": [284],
			"Hacek;": [711],
			"Hcirc;": [292],
			"IJlig;": [306],
			"Iacute": [205],
			"Icirc;": [206],
			"Igrave": [204],
			"Imacr;": [298],
			"Iogon;": [302],
			"Iukcy;": [1030],
			"Jcirc;": [308],
			"Jukcy;": [1028],
			"Kappa;": [922],
			"Ntilde": [209],
			"OElig;": [338],
			"Oacute": [211],
			"Ocirc;": [212],
			"Ograve": [210],
			"Omacr;": [332],
			"Omega;": [937],
			"Oslash": [216],
			"Otilde": [213],
			"Prime;": [8243],
			"RBarr;": [10512],
			"Scirc;": [348],
			"Sigma;": [931],
			"THORN;": [222],
			"TRADE;": [8482],
			"TSHcy;": [1035],
			"Theta;": [920],
			"Tilde;": [8764],
			"Uacute": [218],
			"Ubrcy;": [1038],
			"Ucirc;": [219],
			"Ugrave": [217],
			"Umacr;": [362],
			"Union;": [8899],
			"Uogon;": [370],
			"UpTee;": [8869],
			"Uring;": [366],
			"VDash;": [8875],
			"Vdash;": [8873],
			"Wcirc;": [372],
			"Wedge;": [8896],
			"Yacute": [221],
			"Ycirc;": [374],
			"aacute": [225],
			"acirc;": [226],
			"acute;": [180],
			"aelig;": [230],
			"agrave": [224],
			"aleph;": [8501],
			"alpha;": [945],
			"amacr;": [257],
			"amalg;": [10815],
			"angle;": [8736],
			"angrt;": [8735],
			"angst;": [197],
			"aogon;": [261],
			"aring;": [229],
			"asymp;": [8776],
			"atilde": [227],
			"awint;": [10769],
			"bcong;": [8780],
			"bdquo;": [8222],
			"bepsi;": [1014],
			"blank;": [9251],
			"blk12;": [9618],
			"blk14;": [9617],
			"blk34;": [9619],
			"block;": [9608],
			"boxDL;": [9559],
			"boxDR;": [9556],
			"boxDl;": [9558],
			"boxDr;": [9555],
			"boxHD;": [9574],
			"boxHU;": [9577],
			"boxHd;": [9572],
			"boxHu;": [9575],
			"boxUL;": [9565],
			"boxUR;": [9562],
			"boxUl;": [9564],
			"boxUr;": [9561],
			"boxVH;": [9580],
			"boxVL;": [9571],
			"boxVR;": [9568],
			"boxVh;": [9579],
			"boxVl;": [9570],
			"boxVr;": [9567],
			"boxdL;": [9557],
			"boxdR;": [9554],
			"boxdl;": [9488],
			"boxdr;": [9484],
			"boxhD;": [9573],
			"boxhU;": [9576],
			"boxhd;": [9516],
			"boxhu;": [9524],
			"boxuL;": [9563],
			"boxuR;": [9560],
			"boxul;": [9496],
			"boxur;": [9492],
			"boxvH;": [9578],
			"boxvL;": [9569],
			"boxvR;": [9566],
			"boxvh;": [9532],
			"boxvl;": [9508],
			"boxvr;": [9500],
			"breve;": [728],
			"brvbar": [166],
			"bsemi;": [8271],
			"bsime;": [8909],
			"bsolb;": [10693],
			"bumpE;": [10926],
			"bumpe;": [8783],
			"caret;": [8257],
			"caron;": [711],
			"ccaps;": [10829],
			"ccedil": [231],
			"ccirc;": [265],
			"ccups;": [10828],
			"cedil;": [184],
			"check;": [10003],
			"clubs;": [9827],
			"colon;": [58],
			"comma;": [44],
			"crarr;": [8629],
			"cross;": [10007],
			"csube;": [10961],
			"csupe;": [10962],
			"ctdot;": [8943],
			"cuepr;": [8926],
			"cuesc;": [8927],
			"cupor;": [10821],
			"curren": [164],
			"cuvee;": [8910],
			"cuwed;": [8911],
			"cwint;": [8753],
			"dashv;": [8867],
			"dblac;": [733],
			"ddarr;": [8650],
			"delta;": [948],
			"dharl;": [8643],
			"dharr;": [8642],
			"diams;": [9830],
			"disin;": [8946],
			"divide": [247],
			"doteq;": [8784],
			"dtdot;": [8945],
			"dtrif;": [9662],
			"duarr;": [8693],
			"duhar;": [10607],
			"eDDot;": [10871],
			"eacute": [233],
			"ecirc;": [234],
			"efDot;": [8786],
			"egrave": [232],
			"emacr;": [275],
			"empty;": [8709],
			"eogon;": [281],
			"eplus;": [10865],
			"epsiv;": [1013],
			"eqsim;": [8770],
			"equiv;": [8801],
			"erDot;": [8787],
			"erarr;": [10609],
			"esdot;": [8784],
			"exist;": [8707],
			"fflig;": [64256],
			"filig;": [64257],
			"fjlig;": [102, 106],
			"fllig;": [64258],
			"fltns;": [9649],
			"forkv;": [10969],
			"frac12": [189],
			"frac14": [188],
			"frac34": [190],
			"frasl;": [8260],
			"frown;": [8994],
			"gamma;": [947],
			"gcirc;": [285],
			"gescc;": [10921],
			"gimel;": [8503],
			"gneqq;": [8809],
			"gnsim;": [8935],
			"grave;": [96],
			"gsime;": [10894],
			"gsiml;": [10896],
			"gtcir;": [10874],
			"gtdot;": [8919],
			"harrw;": [8621],
			"hcirc;": [293],
			"hoarr;": [8703],
			"iacute": [237],
			"icirc;": [238],
			"iexcl;": [161],
			"igrave": [236],
			"iiint;": [8749],
			"iiota;": [8489],
			"ijlig;": [307],
			"imacr;": [299],
			"image;": [8465],
			"imath;": [305],
			"imped;": [437],
			"infin;": [8734],
			"iogon;": [303],
			"iprod;": [10812],
			"iquest": [191],
			"isinE;": [8953],
			"isins;": [8948],
			"isinv;": [8712],
			"iukcy;": [1110],
			"jcirc;": [309],
			"jmath;": [567],
			"jukcy;": [1108],
			"kappa;": [954],
			"lAarr;": [8666],
			"lBarr;": [10510],
			"langd;": [10641],
			"laquo;": [171],
			"larrb;": [8676],
			"lates;": [10925, 65024],
			"lbarr;": [10508],
			"lbbrk;": [10098],
			"lbrke;": [10635],
			"lceil;": [8968],
			"ldquo;": [8220],
			"lescc;": [10920],
			"lhard;": [8637],
			"lharu;": [8636],
			"lhblk;": [9604],
			"llarr;": [8647],
			"lltri;": [9722],
			"lneqq;": [8808],
			"lnsim;": [8934],
			"loang;": [10220],
			"loarr;": [8701],
			"lobrk;": [10214],
			"lopar;": [10629],
			"lrarr;": [8646],
			"lrhar;": [8651],
			"lrtri;": [8895],
			"lsime;": [10893],
			"lsimg;": [10895],
			"lsquo;": [8216],
			"ltcir;": [10873],
			"ltdot;": [8918],
			"ltrie;": [8884],
			"ltrif;": [9666],
			"mDDot;": [8762],
			"mdash;": [8212],
			"micro;": [181],
			"middot": [183],
			"minus;": [8722],
			"mumap;": [8888],
			"nabla;": [8711],
			"napid;": [8779, 824],
			"napos;": [329],
			"natur;": [9838],
			"nbump;": [8782, 824],
			"ncong;": [8775],
			"ndash;": [8211],
			"neArr;": [8663],
			"nearr;": [8599],
			"nedot;": [8784, 824],
			"nesim;": [8770, 824],
			"ngeqq;": [8807, 824],
			"ngsim;": [8821],
			"nhArr;": [8654],
			"nharr;": [8622],
			"nhpar;": [10994],
			"nlArr;": [8653],
			"nlarr;": [8602],
			"nleqq;": [8806, 824],
			"nless;": [8814],
			"nlsim;": [8820],
			"nltri;": [8938],
			"notin;": [8713],
			"notni;": [8716],
			"npart;": [8706, 824],
			"nprec;": [8832],
			"nrArr;": [8655],
			"nrarr;": [8603],
			"nrtri;": [8939],
			"nsime;": [8772],
			"nsmid;": [8740],
			"nspar;": [8742],
			"nsubE;": [10949, 824],
			"nsube;": [8840],
			"nsucc;": [8833],
			"nsupE;": [10950, 824],
			"nsupe;": [8841],
			"ntilde": [241],
			"numsp;": [8199],
			"nvsim;": [8764, 8402],
			"nwArr;": [8662],
			"nwarr;": [8598],
			"oacute": [243],
			"ocirc;": [244],
			"odash;": [8861],
			"oelig;": [339],
			"ofcir;": [10687],
			"ograve": [242],
			"ohbar;": [10677],
			"olarr;": [8634],
			"olcir;": [10686],
			"oline;": [8254],
			"omacr;": [333],
			"omega;": [969],
			"operp;": [10681],
			"oplus;": [8853],
			"orarr;": [8635],
			"order;": [8500],
			"oslash": [248],
			"otilde": [245],
			"ovbar;": [9021],
			"parsl;": [11005],
			"phone;": [9742],
			"plusb;": [8862],
			"pluse;": [10866],
			"plusmn": [177],
			"pound;": [163],
			"prcue;": [8828],
			"prime;": [8242],
			"prnap;": [10937],
			"prsim;": [8830],
			"quest;": [63],
			"rAarr;": [8667],
			"rBarr;": [10511],
			"radic;": [8730],
			"rangd;": [10642],
			"range;": [10661],
			"raquo;": [187],
			"rarrb;": [8677],
			"rarrc;": [10547],
			"rarrw;": [8605],
			"ratio;": [8758],
			"rbarr;": [10509],
			"rbbrk;": [10099],
			"rbrke;": [10636],
			"rceil;": [8969],
			"rdquo;": [8221],
			"reals;": [8477],
			"rhard;": [8641],
			"rharu;": [8640],
			"rlarr;": [8644],
			"rlhar;": [8652],
			"rnmid;": [10990],
			"roang;": [10221],
			"roarr;": [8702],
			"robrk;": [10215],
			"ropar;": [10630],
			"rrarr;": [8649],
			"rsquo;": [8217],
			"rtrie;": [8885],
			"rtrif;": [9656],
			"sbquo;": [8218],
			"sccue;": [8829],
			"scirc;": [349],
			"scnap;": [10938],
			"scsim;": [8831],
			"sdotb;": [8865],
			"sdote;": [10854],
			"seArr;": [8664],
			"searr;": [8600],
			"setmn;": [8726],
			"sharp;": [9839],
			"sigma;": [963],
			"simeq;": [8771],
			"simgE;": [10912],
			"simlE;": [10911],
			"simne;": [8774],
			"slarr;": [8592],
			"smile;": [8995],
			"smtes;": [10924, 65024],
			"sqcap;": [8851],
			"sqcup;": [8852],
			"sqsub;": [8847],
			"sqsup;": [8848],
			"srarr;": [8594],
			"starf;": [9733],
			"strns;": [175],
			"subnE;": [10955],
			"subne;": [8842],
			"supnE;": [10956],
			"supne;": [8843],
			"swArr;": [8665],
			"swarr;": [8601],
			"szlig;": [223],
			"theta;": [952],
			"thkap;": [8776],
			"thorn;": [254],
			"tilde;": [732],
			"times;": [215],
			"trade;": [8482],
			"trisb;": [10701],
			"tshcy;": [1115],
			"twixt;": [8812],
			"uacute": [250],
			"ubrcy;": [1118],
			"ucirc;": [251],
			"udarr;": [8645],
			"udhar;": [10606],
			"ugrave": [249],
			"uharl;": [8639],
			"uharr;": [8638],
			"uhblk;": [9600],
			"ultri;": [9720],
			"umacr;": [363],
			"uogon;": [371],
			"uplus;": [8846],
			"upsih;": [978],
			"uring;": [367],
			"urtri;": [9721],
			"utdot;": [8944],
			"utrif;": [9652],
			"uuarr;": [8648],
			"vBarv;": [10985],
			"vDash;": [8872],
			"varpi;": [982],
			"vdash;": [8866],
			"veeeq;": [8794],
			"vltri;": [8882],
			"vnsub;": [8834, 8402],
			"vnsup;": [8835, 8402],
			"vprop;": [8733],
			"vrtri;": [8883],
			"wcirc;": [373],
			"wedge;": [8743],
			"xcirc;": [9711],
			"xdtri;": [9661],
			"xhArr;": [10234],
			"xharr;": [10231],
			"xlArr;": [10232],
			"xlarr;": [10229],
			"xodot;": [10752],
			"xrArr;": [10233],
			"xrarr;": [10230],
			"xutri;": [9651],
			"yacute": [253],
			"ycirc;": [375]
		}
	},
	{
		"length": 5,
		"entities": {
			"AElig": [198],
			"Acirc": [194],
			"Aopf;": [120120],
			"Aring": [197],
			"Ascr;": [119964],
			"Auml;": [196],
			"Barv;": [10983],
			"Beta;": [914],
			"Bopf;": [120121],
			"Bscr;": [8492],
			"CHcy;": [1063],
			"COPY;": [169],
			"Cdot;": [266],
			"Copf;": [8450],
			"Cscr;": [119966],
			"DJcy;": [1026],
			"DScy;": [1029],
			"DZcy;": [1039],
			"Darr;": [8609],
			"Dopf;": [120123],
			"Dscr;": [119967],
			"Ecirc": [202],
			"Edot;": [278],
			"Eopf;": [120124],
			"Escr;": [8496],
			"Esim;": [10867],
			"Euml;": [203],
			"Fopf;": [120125],
			"Fscr;": [8497],
			"GJcy;": [1027],
			"Gdot;": [288],
			"Gopf;": [120126],
			"Gscr;": [119970],
			"Hopf;": [8461],
			"Hscr;": [8459],
			"IEcy;": [1045],
			"IOcy;": [1025],
			"Icirc": [206],
			"Idot;": [304],
			"Iopf;": [120128],
			"Iota;": [921],
			"Iscr;": [8464],
			"Iuml;": [207],
			"Jopf;": [120129],
			"Jscr;": [119973],
			"KHcy;": [1061],
			"KJcy;": [1036],
			"Kopf;": [120130],
			"Kscr;": [119974],
			"LJcy;": [1033],
			"Lang;": [10218],
			"Larr;": [8606],
			"Lopf;": [120131],
			"Lscr;": [8466],
			"Mopf;": [120132],
			"Mscr;": [8499],
			"NJcy;": [1034],
			"Nopf;": [8469],
			"Nscr;": [119977],
			"Ocirc": [212],
			"Oopf;": [120134],
			"Oscr;": [119978],
			"Ouml;": [214],
			"Popf;": [8473],
			"Pscr;": [119979],
			"QUOT;": [34],
			"Qopf;": [8474],
			"Qscr;": [119980],
			"Rang;": [10219],
			"Rarr;": [8608],
			"Ropf;": [8477],
			"Rscr;": [8475],
			"SHcy;": [1064],
			"Sopf;": [120138],
			"Sqrt;": [8730],
			"Sscr;": [119982],
			"Star;": [8902],
			"THORN": [222],
			"TScy;": [1062],
			"Topf;": [120139],
			"Tscr;": [119983],
			"Uarr;": [8607],
			"Ucirc": [219],
			"Uopf;": [120140],
			"Upsi;": [978],
			"Uscr;": [119984],
			"Uuml;": [220],
			"Vbar;": [10987],
			"Vert;": [8214],
			"Vopf;": [120141],
			"Vscr;": [119985],
			"Wopf;": [120142],
			"Wscr;": [119986],
			"Xopf;": [120143],
			"Xscr;": [119987],
			"YAcy;": [1071],
			"YIcy;": [1031],
			"YUcy;": [1070],
			"Yopf;": [120144],
			"Yscr;": [119988],
			"Yuml;": [376],
			"ZHcy;": [1046],
			"Zdot;": [379],
			"Zeta;": [918],
			"Zopf;": [8484],
			"Zscr;": [119989],
			"acirc": [226],
			"acute": [180],
			"aelig": [230],
			"andd;": [10844],
			"andv;": [10842],
			"ange;": [10660],
			"aopf;": [120146],
			"apid;": [8779],
			"apos;": [39],
			"aring": [229],
			"ascr;": [119990],
			"auml;": [228],
			"bNot;": [10989],
			"bbrk;": [9141],
			"beta;": [946],
			"beth;": [8502],
			"bnot;": [8976],
			"bopf;": [120147],
			"boxH;": [9552],
			"boxV;": [9553],
			"boxh;": [9472],
			"boxv;": [9474],
			"bscr;": [119991],
			"bsim;": [8765],
			"bsol;": [92],
			"bull;": [8226],
			"bump;": [8782],
			"caps;": [8745, 65024],
			"cdot;": [267],
			"cedil": [184],
			"cent;": [162],
			"chcy;": [1095],
			"cirE;": [10691],
			"circ;": [710],
			"cire;": [8791],
			"comp;": [8705],
			"cong;": [8773],
			"copf;": [120148],
			"copy;": [169],
			"cscr;": [119992],
			"csub;": [10959],
			"csup;": [10960],
			"cups;": [8746, 65024],
			"dArr;": [8659],
			"dHar;": [10597],
			"darr;": [8595],
			"dash;": [8208],
			"diam;": [8900],
			"djcy;": [1106],
			"dopf;": [120149],
			"dscr;": [119993],
			"dscy;": [1109],
			"dsol;": [10742],
			"dtri;": [9663],
			"dzcy;": [1119],
			"eDot;": [8785],
			"ecir;": [8790],
			"ecirc": [234],
			"edot;": [279],
			"emsp;": [8195],
			"ensp;": [8194],
			"eopf;": [120150],
			"epar;": [8917],
			"epsi;": [949],
			"escr;": [8495],
			"esim;": [8770],
			"euml;": [235],
			"euro;": [8364],
			"excl;": [33],
			"flat;": [9837],
			"fnof;": [402],
			"fopf;": [120151],
			"fork;": [8916],
			"fscr;": [119995],
			"gdot;": [289],
			"geqq;": [8807],
			"gesl;": [8923, 65024],
			"gjcy;": [1107],
			"gnap;": [10890],
			"gneq;": [10888],
			"gopf;": [120152],
			"gscr;": [8458],
			"gsim;": [8819],
			"gtcc;": [10919],
			"gvnE;": [8809, 65024],
			"hArr;": [8660],
			"half;": [189],
			"harr;": [8596],
			"hbar;": [8463],
			"hopf;": [120153],
			"hscr;": [119997],
			"icirc": [238],
			"iecy;": [1077],
			"iexcl": [161],
			"imof;": [8887],
			"iocy;": [1105],
			"iopf;": [120154],
			"iota;": [953],
			"iscr;": [119998],
			"isin;": [8712],
			"iuml;": [239],
			"jopf;": [120155],
			"jscr;": [119999],
			"khcy;": [1093],
			"kjcy;": [1116],
			"kopf;": [120156],
			"kscr;": [12e4],
			"lArr;": [8656],
			"lHar;": [10594],
			"lang;": [10216],
			"laquo": [171],
			"larr;": [8592],
			"late;": [10925],
			"lcub;": [123],
			"ldca;": [10550],
			"ldsh;": [8626],
			"leqq;": [8806],
			"lesg;": [8922, 65024],
			"ljcy;": [1113],
			"lnap;": [10889],
			"lneq;": [10887],
			"lopf;": [120157],
			"lozf;": [10731],
			"lpar;": [40],
			"lscr;": [120001],
			"lsim;": [8818],
			"lsqb;": [91],
			"ltcc;": [10918],
			"ltri;": [9667],
			"lvnE;": [8808, 65024],
			"macr;": [175],
			"male;": [9794],
			"malt;": [10016],
			"micro": [181],
			"mlcp;": [10971],
			"mldr;": [8230],
			"mopf;": [120158],
			"mscr;": [120002],
			"nGtv;": [8811, 824],
			"nLtv;": [8810, 824],
			"nang;": [8736, 8402],
			"napE;": [10864, 824],
			"nbsp;": [160],
			"ncap;": [10819],
			"ncup;": [10818],
			"ngeq;": [8817],
			"nges;": [10878, 824],
			"ngtr;": [8815],
			"nisd;": [8954],
			"njcy;": [1114],
			"nldr;": [8229],
			"nleq;": [8816],
			"nles;": [10877, 824],
			"nmid;": [8740],
			"nopf;": [120159],
			"npar;": [8742],
			"npre;": [10927, 824],
			"nsce;": [10928, 824],
			"nscr;": [120003],
			"nsim;": [8769],
			"nsub;": [8836],
			"nsup;": [8837],
			"ntgl;": [8825],
			"ntlg;": [8824],
			"nvap;": [8781, 8402],
			"nvge;": [8805, 8402],
			"nvgt;": [62, 8402],
			"nvle;": [8804, 8402],
			"nvlt;": [60, 8402],
			"oast;": [8859],
			"ocir;": [8858],
			"ocirc": [244],
			"odiv;": [10808],
			"odot;": [8857],
			"ogon;": [731],
			"oint;": [8750],
			"omid;": [10678],
			"oopf;": [120160],
			"opar;": [10679],
			"ordf;": [170],
			"ordm;": [186],
			"oror;": [10838],
			"oscr;": [8500],
			"osol;": [8856],
			"ouml;": [246],
			"para;": [182],
			"part;": [8706],
			"perp;": [8869],
			"phiv;": [981],
			"plus;": [43],
			"popf;": [120161],
			"pound": [163],
			"prap;": [10935],
			"prec;": [8826],
			"prnE;": [10933],
			"prod;": [8719],
			"prop;": [8733],
			"pscr;": [120005],
			"qint;": [10764],
			"qopf;": [120162],
			"qscr;": [120006],
			"quot;": [34],
			"rArr;": [8658],
			"rHar;": [10596],
			"race;": [8765, 817],
			"rang;": [10217],
			"raquo": [187],
			"rarr;": [8594],
			"rcub;": [125],
			"rdca;": [10551],
			"rdsh;": [8627],
			"real;": [8476],
			"rect;": [9645],
			"rhov;": [1009],
			"ring;": [730],
			"ropf;": [120163],
			"rpar;": [41],
			"rscr;": [120007],
			"rsqb;": [93],
			"rtri;": [9657],
			"scap;": [10936],
			"scnE;": [10934],
			"sdot;": [8901],
			"sect;": [167],
			"semi;": [59],
			"sext;": [10038],
			"shcy;": [1096],
			"sime;": [8771],
			"simg;": [10910],
			"siml;": [10909],
			"smid;": [8739],
			"smte;": [10924],
			"solb;": [10692],
			"sopf;": [120164],
			"spar;": [8741],
			"squf;": [9642],
			"sscr;": [120008],
			"star;": [9734],
			"subE;": [10949],
			"sube;": [8838],
			"succ;": [8827],
			"sung;": [9834],
			"sup1;": [185],
			"sup2;": [178],
			"sup3;": [179],
			"supE;": [10950],
			"supe;": [8839],
			"szlig": [223],
			"tbrk;": [9140],
			"tdot;": [8411],
			"thorn": [254],
			"times": [215],
			"tint;": [8749],
			"toea;": [10536],
			"topf;": [120165],
			"tosa;": [10537],
			"trie;": [8796],
			"tscr;": [120009],
			"tscy;": [1094],
			"uArr;": [8657],
			"uHar;": [10595],
			"uarr;": [8593],
			"ucirc": [251],
			"uopf;": [120166],
			"upsi;": [965],
			"uscr;": [120010],
			"utri;": [9653],
			"uuml;": [252],
			"vArr;": [8661],
			"vBar;": [10984],
			"varr;": [8597],
			"vert;": [124],
			"vopf;": [120167],
			"vscr;": [120011],
			"wopf;": [120168],
			"wscr;": [120012],
			"xcap;": [8898],
			"xcup;": [8899],
			"xmap;": [10236],
			"xnis;": [8955],
			"xopf;": [120169],
			"xscr;": [120013],
			"xvee;": [8897],
			"yacy;": [1103],
			"yicy;": [1111],
			"yopf;": [120170],
			"yscr;": [120014],
			"yucy;": [1102],
			"yuml;": [255],
			"zdot;": [380],
			"zeta;": [950],
			"zhcy;": [1078],
			"zopf;": [120171],
			"zscr;": [120015],
			"zwnj;": [8204]
		}
	},
	{
		"length": 4,
		"entities": {
			"AMP;": [38],
			"Acy;": [1040],
			"Afr;": [120068],
			"And;": [10835],
			"Auml": [196],
			"Bcy;": [1041],
			"Bfr;": [120069],
			"COPY": [169],
			"Cap;": [8914],
			"Cfr;": [8493],
			"Chi;": [935],
			"Cup;": [8915],
			"Dcy;": [1044],
			"Del;": [8711],
			"Dfr;": [120071],
			"Dot;": [168],
			"ENG;": [330],
			"ETH;": [208],
			"Ecy;": [1069],
			"Efr;": [120072],
			"Eta;": [919],
			"Euml": [203],
			"Fcy;": [1060],
			"Ffr;": [120073],
			"Gcy;": [1043],
			"Gfr;": [120074],
			"Hat;": [94],
			"Hfr;": [8460],
			"Icy;": [1048],
			"Ifr;": [8465],
			"Int;": [8748],
			"Iuml": [207],
			"Jcy;": [1049],
			"Jfr;": [120077],
			"Kcy;": [1050],
			"Kfr;": [120078],
			"Lcy;": [1051],
			"Lfr;": [120079],
			"Lsh;": [8624],
			"Map;": [10501],
			"Mcy;": [1052],
			"Mfr;": [120080],
			"Ncy;": [1053],
			"Nfr;": [120081],
			"Not;": [10988],
			"Ocy;": [1054],
			"Ofr;": [120082],
			"Ouml": [214],
			"Pcy;": [1055],
			"Pfr;": [120083],
			"Phi;": [934],
			"Psi;": [936],
			"QUOT": [34],
			"Qfr;": [120084],
			"REG;": [174],
			"Rcy;": [1056],
			"Rfr;": [8476],
			"Rho;": [929],
			"Rsh;": [8625],
			"Scy;": [1057],
			"Sfr;": [120086],
			"Sub;": [8912],
			"Sum;": [8721],
			"Sup;": [8913],
			"Tab;": [9],
			"Tau;": [932],
			"Tcy;": [1058],
			"Tfr;": [120087],
			"Ucy;": [1059],
			"Ufr;": [120088],
			"Uuml": [220],
			"Vcy;": [1042],
			"Vee;": [8897],
			"Vfr;": [120089],
			"Wfr;": [120090],
			"Xfr;": [120091],
			"Ycy;": [1067],
			"Yfr;": [120092],
			"Zcy;": [1047],
			"Zfr;": [8488],
			"acE;": [8766, 819],
			"acd;": [8767],
			"acy;": [1072],
			"afr;": [120094],
			"amp;": [38],
			"and;": [8743],
			"ang;": [8736],
			"apE;": [10864],
			"ape;": [8778],
			"ast;": [42],
			"auml": [228],
			"bcy;": [1073],
			"bfr;": [120095],
			"bne;": [61, 8421],
			"bot;": [8869],
			"cap;": [8745],
			"cent": [162],
			"cfr;": [120096],
			"chi;": [967],
			"cir;": [9675],
			"copy": [169],
			"cup;": [8746],
			"dcy;": [1076],
			"deg;": [176],
			"dfr;": [120097],
			"die;": [168],
			"div;": [247],
			"dot;": [729],
			"ecy;": [1101],
			"efr;": [120098],
			"egs;": [10902],
			"ell;": [8467],
			"els;": [10901],
			"eng;": [331],
			"eta;": [951],
			"eth;": [240],
			"euml": [235],
			"fcy;": [1092],
			"ffr;": [120099],
			"gEl;": [10892],
			"gap;": [10886],
			"gcy;": [1075],
			"gel;": [8923],
			"geq;": [8805],
			"ges;": [10878],
			"gfr;": [120100],
			"ggg;": [8921],
			"glE;": [10898],
			"gla;": [10917],
			"glj;": [10916],
			"gnE;": [8809],
			"gne;": [10888],
			"hfr;": [120101],
			"icy;": [1080],
			"iff;": [8660],
			"ifr;": [120102],
			"int;": [8747],
			"iuml": [239],
			"jcy;": [1081],
			"jfr;": [120103],
			"kcy;": [1082],
			"kfr;": [120104],
			"lEg;": [10891],
			"lap;": [10885],
			"lat;": [10923],
			"lcy;": [1083],
			"leg;": [8922],
			"leq;": [8804],
			"les;": [10877],
			"lfr;": [120105],
			"lgE;": [10897],
			"lnE;": [8808],
			"lne;": [10887],
			"loz;": [9674],
			"lrm;": [8206],
			"lsh;": [8624],
			"macr": [175],
			"map;": [8614],
			"mcy;": [1084],
			"mfr;": [120106],
			"mho;": [8487],
			"mid;": [8739],
			"nGg;": [8921, 824],
			"nGt;": [8811, 8402],
			"nLl;": [8920, 824],
			"nLt;": [8810, 8402],
			"nap;": [8777],
			"nbsp": [160],
			"ncy;": [1085],
			"nfr;": [120107],
			"ngE;": [8807, 824],
			"nge;": [8817],
			"ngt;": [8815],
			"nis;": [8956],
			"niv;": [8715],
			"nlE;": [8806, 824],
			"nle;": [8816],
			"nlt;": [8814],
			"not;": [172],
			"npr;": [8832],
			"nsc;": [8833],
			"num;": [35],
			"ocy;": [1086],
			"ofr;": [120108],
			"ogt;": [10689],
			"ohm;": [937],
			"olt;": [10688],
			"ord;": [10845],
			"ordf": [170],
			"ordm": [186],
			"orv;": [10843],
			"ouml": [246],
			"par;": [8741],
			"para": [182],
			"pcy;": [1087],
			"pfr;": [120109],
			"phi;": [966],
			"piv;": [982],
			"prE;": [10931],
			"pre;": [10927],
			"psi;": [968],
			"qfr;": [120110],
			"quot": [34],
			"rcy;": [1088],
			"reg;": [174],
			"rfr;": [120111],
			"rho;": [961],
			"rlm;": [8207],
			"rsh;": [8625],
			"scE;": [10932],
			"sce;": [10928],
			"scy;": [1089],
			"sect": [167],
			"sfr;": [120112],
			"shy;": [173],
			"sim;": [8764],
			"smt;": [10922],
			"sol;": [47],
			"squ;": [9633],
			"sub;": [8834],
			"sum;": [8721],
			"sup1": [185],
			"sup2": [178],
			"sup3": [179],
			"sup;": [8835],
			"tau;": [964],
			"tcy;": [1090],
			"tfr;": [120113],
			"top;": [8868],
			"ucy;": [1091],
			"ufr;": [120114],
			"uml;": [168],
			"uuml": [252],
			"vcy;": [1074],
			"vee;": [8744],
			"vfr;": [120115],
			"wfr;": [120116],
			"xfr;": [120117],
			"ycy;": [1099],
			"yen;": [165],
			"yfr;": [120118],
			"yuml": [255],
			"zcy;": [1079],
			"zfr;": [120119],
			"zwj;": [8205]
		}
	},
	{
		"length": 3,
		"entities": {
			"AMP": [38],
			"DD;": [8517],
			"ETH": [208],
			"GT;": [62],
			"Gg;": [8921],
			"Gt;": [8811],
			"Im;": [8465],
			"LT;": [60],
			"Ll;": [8920],
			"Lt;": [8810],
			"Mu;": [924],
			"Nu;": [925],
			"Or;": [10836],
			"Pi;": [928],
			"Pr;": [10939],
			"REG": [174],
			"Re;": [8476],
			"Sc;": [10940],
			"Xi;": [926],
			"ac;": [8766],
			"af;": [8289],
			"amp": [38],
			"ap;": [8776],
			"dd;": [8518],
			"deg": [176],
			"ee;": [8519],
			"eg;": [10906],
			"el;": [10905],
			"eth": [240],
			"gE;": [8807],
			"ge;": [8805],
			"gg;": [8811],
			"gl;": [8823],
			"gt;": [62],
			"ic;": [8291],
			"ii;": [8520],
			"in;": [8712],
			"it;": [8290],
			"lE;": [8806],
			"le;": [8804],
			"lg;": [8822],
			"ll;": [8810],
			"lt;": [60],
			"mp;": [8723],
			"mu;": [956],
			"ne;": [8800],
			"ni;": [8715],
			"not": [172],
			"nu;": [957],
			"oS;": [9416],
			"or;": [8744],
			"pi;": [960],
			"pm;": [177],
			"pr;": [8826],
			"reg": [174],
			"rx;": [8478],
			"sc;": [8827],
			"shy": [173],
			"uml": [168],
			"wp;": [8472],
			"wr;": [8768],
			"xi;": [958],
			"yen": [165]
		}
	},
	{
		"length": 2,
		"entities": {
			"GT": [62],
			"LT": [60],
			"gt": [62],
			"lt": [60]
		}
	}
];

//#endregion
//#region src/html/util/unicode.ts
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
const EOF = -1;
const NULL = 0;
const TABULATION = 9;
const CARRIAGE_RETURN = 13;
const LINE_FEED = 10;
const FORM_FEED = 12;
const SPACE = 32;
const EXCLAMATION_MARK = 33;
const QUOTATION_MARK = 34;
const NUMBER_SIGN = 35;
const AMPERSAND = 38;
const APOSTROPHE = 39;
const LEFT_PARENTHESIS = 40;
const RIGHT_PARENTHESIS = 41;
const ASTERISK = 42;
const HYPHEN_MINUS = 45;
const SOLIDUS = 47;
const DIGIT_0 = 48;
const DIGIT_9 = 57;
const COLON = 58;
const SEMICOLON = 59;
const LESS_THAN_SIGN = 60;
const EQUALS_SIGN = 61;
const GREATER_THAN_SIGN = 62;
const QUESTION_MARK = 63;
const LATIN_CAPITAL_A = 65;
const LATIN_CAPITAL_D = 68;
const LATIN_CAPITAL_F = 70;
const LATIN_CAPITAL_X = 88;
const LATIN_CAPITAL_Z = 90;
const LEFT_SQUARE_BRACKET = 91;
const REVERSE_SOLIDUS = 92;
const RIGHT_SQUARE_BRACKET = 93;
const GRAVE_ACCENT = 96;
const LATIN_SMALL_A = 97;
const LATIN_SMALL_F = 102;
const LATIN_SMALL_X = 120;
const LATIN_SMALL_Z = 122;
const LEFT_CURLY_BRACKET = 123;
const RIGHT_CURLY_BRACKET = 125;
const NULL_REPLACEMENT = 65533;
/**
* Check whether the code point is a whitespace.
* @param cp The code point to check.
* @returns `true` if the code point is a whitespace.
*/
function isWhitespace(cp) {
	return cp === TABULATION || cp === LINE_FEED || cp === FORM_FEED || cp === CARRIAGE_RETURN || cp === SPACE;
}
/**
* Check whether the code point is an uppercase letter character.
* @param cp The code point to check.
* @returns `true` if the code point is an uppercase letter character.
*/
function isUpperLetter(cp) {
	return cp >= LATIN_CAPITAL_A && cp <= LATIN_CAPITAL_Z;
}
/**
* Check whether the code point is a lowercase letter character.
* @param cp The code point to check.
* @returns `true` if the code point is a lowercase letter character.
*/
function isLowerLetter(cp) {
	return cp >= LATIN_SMALL_A && cp <= LATIN_SMALL_Z;
}
/**
* Check whether the code point is a letter character.
* @param cp The code point to check.
* @returns `true` if the code point is a letter character.
*/
function isLetter(cp) {
	return isLowerLetter(cp) || isUpperLetter(cp);
}
/**
* Check whether the code point is a digit character.
* @param cp The code point to check.
* @returns `true` if the code point is a digit character.
*/
function isDigit(cp) {
	return cp >= DIGIT_0 && cp <= DIGIT_9;
}
/**
* Check whether the code point is a digit character.
* @param cp The code point to check.
* @returns `true` if the code point is a digit character.
*/
function isUpperHexDigit(cp) {
	return cp >= LATIN_CAPITAL_A && cp <= LATIN_CAPITAL_F;
}
/**
* Check whether the code point is a digit character.
* @param cp The code point to check.
* @returns `true` if the code point is a digit character.
*/
function isLowerHexDigit(cp) {
	return cp >= LATIN_SMALL_A && cp <= LATIN_SMALL_F;
}
/**
* Check whether the code point is a digit character.
* @param cp The code point to check.
* @returns `true` if the code point is a digit character.
*/
function isHexDigit(cp) {
	return isDigit(cp) || isUpperHexDigit(cp) || isLowerHexDigit(cp);
}
/**
* Check whether the code point is a control character.
* @param cp The code point to check.
* @returns `true` if the code point is a control character.
*/
function isControl(cp) {
	return cp >= 0 && cp <= 31 || cp >= 127 && cp <= 159;
}
/**
* Check whether the code point is a surrogate character.
* @param cp The code point to check.
* @returns `true` if the code point is a surrogate character.
*/
function isSurrogate(cp) {
	return cp >= 55296 && cp <= 57343;
}
/**
* Check whether the code point is a surrogate pair character.
* @param cp The code point to check.
* @returns `true` if the code point is a surrogate pair character.
*/
function isSurrogatePair(cp) {
	return cp >= 56320 && cp <= 57343;
}
/**
* Check whether the code point is a surrogate character.
* @param cp The code point to check.
* @returns `true` if the code point is a surrogate character.
*/
function isNonCharacter(cp) {
	return cp >= 64976 && cp <= 65007 || (cp & 65534) === 65534 && cp <= 1114111;
}
/**
* Convert the given character to lowercases.
* @param cp The code point to convert.
* @returns Converted code point.
*/
function toLowerCodePoint(cp) {
	return cp + 32;
}

//#endregion
//#region src/html/tokenizer.ts
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
/**
* Tokenizer for HTML.
*/
var Tokenizer = class {
	text;
	gaps;
	lineTerminators;
	parserOptions;
	lastCodePoint;
	lastCodePointRaw;
	offset;
	column;
	line;
	returnState;
	vExpressionScriptState = null;
	reconsuming;
	buffer;
	crStartOffset;
	crCode;
	committedToken;
	provisionalToken;
	currentToken;
	lastTagOpenToken;
	tokenStartOffset;
	tokenStartLine;
	tokenStartColumn;
	/**
	* The current state.
	*/
	state;
	/**
	* Syntax errors.
	*/
	errors;
	/**
	* The current namespace.
	*/
	namespace;
	/**
	* The flag which enables expression tokens.
	* If this is true, this tokenizer will generate V_EXPRESSION_START and V_EXPRESSION_END tokens.
	*/
	expressionEnabled;
	/**
	* Initialize this tokenizer.
	* @param text The source code to tokenize.
	* @param parserOptions The parser options.
	*/
	constructor(text, parserOptions) {
		debug$1("[html] the source code length: %d", text.length);
		this.text = text;
		this.gaps = [];
		this.lineTerminators = [];
		this.parserOptions = parserOptions || {};
		this.lastCodePoint = this.lastCodePointRaw = NULL;
		this.offset = -1;
		this.column = -1;
		this.line = 1;
		this.state = "DATA";
		this.returnState = "DATA";
		this.reconsuming = false;
		this.buffer = [];
		this.crStartOffset = -1;
		this.crCode = 0;
		this.errors = [];
		this.committedToken = null;
		this.provisionalToken = null;
		this.currentToken = null;
		this.lastTagOpenToken = null;
		this.tokenStartOffset = -1;
		this.tokenStartColumn = -1;
		this.tokenStartLine = 1;
		this.namespace = NS.HTML;
		this.expressionEnabled = false;
	}
	/**
	* Get the next token.
	* @returns The next token or null.
	*/
	nextToken() {
		let cp = this.lastCodePoint;
		while (this.committedToken == null && (cp !== EOF || this.reconsuming)) {
			if (this.provisionalToken != null && !this.isProvisionalState()) {
				this.commitProvisionalToken();
				if (this.committedToken != null) break;
			}
			if (this.reconsuming) {
				this.reconsuming = false;
				cp = this.lastCodePoint;
			} else cp = this.consumeNextCodePoint();
			debug$1("[html] parse", cp, this.state);
			this.state = this[this.state](cp);
		}
		{
			const token = this.consumeCommittedToken();
			if (token != null) return token;
		}
		(0, assert.default)(cp === EOF);
		if (this.currentToken != null) {
			this.endToken();
			const token = this.consumeCommittedToken();
			if (token != null) return token;
		}
		return this.currentToken;
	}
	/**
	* Consume the last committed token.
	* @returns The last committed token.
	*/
	consumeCommittedToken() {
		const token = this.committedToken;
		this.committedToken = null;
		return token;
	}
	/**
	* Consume the next code point.
	* @returns The consumed code point.
	*/
	consumeNextCodePoint() {
		if (this.offset >= this.text.length) {
			this.lastCodePoint = this.lastCodePointRaw = EOF;
			return EOF;
		}
		this.offset += this.lastCodePoint >= 65536 ? 2 : 1;
		if (this.offset >= this.text.length) {
			this.advanceLocation();
			this.lastCodePoint = this.lastCodePointRaw = EOF;
			return EOF;
		}
		const cp = this.text.codePointAt(this.offset);
		if (isSurrogate(this.text.charCodeAt(this.offset)) && !isSurrogatePair(this.text.charCodeAt(this.offset + 1))) this.reportParseError("surrogate-in-input-stream");
		if (isNonCharacter(cp)) this.reportParseError("noncharacter-in-input-stream");
		if (isControl(cp) && !isWhitespace(cp) && cp !== NULL) this.reportParseError("control-character-in-input-stream");
		if (this.lastCodePointRaw === CARRIAGE_RETURN && cp === LINE_FEED) {
			this.lastCodePoint = this.lastCodePointRaw = LINE_FEED;
			this.gaps.push(this.offset);
			return this.consumeNextCodePoint();
		}
		this.advanceLocation();
		this.lastCodePoint = this.lastCodePointRaw = cp;
		if (cp === CARRIAGE_RETURN) {
			this.lastCodePoint = LINE_FEED;
			return LINE_FEED;
		}
		return cp;
	}
	/**
	* Advance the current line and column.
	*/
	advanceLocation() {
		if (this.lastCodePointRaw === LINE_FEED) {
			this.lineTerminators.push(this.offset);
			this.line += 1;
			this.column = 0;
		} else this.column += this.lastCodePoint >= 65536 ? 2 : 1;
	}
	/**
	* Directive reconsuming the current code point as the given state.
	* @param state The next state.
	* @returns The next state.
	*/
	reconsumeAs(state) {
		this.reconsuming = true;
		return state;
	}
	/**
	* Report an invalid character error.
	* @param code The error code.
	*/
	reportParseError(code) {
		const error = ParseError.fromCode(code, this.offset, this.line, this.column);
		this.errors.push(error);
		debug$1("[html] syntax error:", error.message);
	}
	/**
	* Mark the current location as a start of tokens.
	*/
	setStartTokenMark() {
		this.tokenStartOffset = this.offset;
		this.tokenStartLine = this.line;
		this.tokenStartColumn = this.column;
	}
	/**
	* Mark the current location as a start of tokens.
	*/
	clearStartTokenMark() {
		this.tokenStartOffset = -1;
	}
	/**
	* Start new token.
	* @param type The type of new token.
	* @returns The new token.
	*/
	startToken(type) {
		if (this.tokenStartOffset === -1) this.setStartTokenMark();
		const offset = this.tokenStartOffset;
		const line = this.tokenStartLine;
		const column = this.tokenStartColumn;
		if (this.currentToken != null) this.endToken();
		this.tokenStartOffset = -1;
		debug$1("[html] start token: %d %s", offset, (this.currentToken = {
			type,
			range: [offset, -1],
			loc: {
				start: {
					line,
					column
				},
				end: {
					line: -1,
					column: -1
				}
			},
			value: ""
		}).type);
		return this.currentToken;
	}
	/**
	* Commit the current token.
	* @returns The ended token.
	*/
	endToken() {
		if (this.currentToken == null) throw new Error("Invalid state");
		if (this.tokenStartOffset === -1) this.setStartTokenMark();
		const token = this.currentToken;
		const offset = this.tokenStartOffset;
		const line = this.tokenStartLine;
		const column = this.tokenStartColumn;
		const provisional = this.isProvisionalState();
		this.currentToken = null;
		this.tokenStartOffset = -1;
		token.range[1] = offset;
		token.loc.end.line = line;
		token.loc.end.column = column;
		if (token.range[0] === offset && !provisional) {
			debug$1("[html] abandon token: %j %s %j", token.range, token.type, token.value);
			return null;
		}
		if (provisional) {
			if (this.provisionalToken != null) this.commitProvisionalToken();
			this.provisionalToken = token;
			debug$1("[html] provisional-commit token: %j %s %j", token.range, token.type, token.value);
		} else this.commitToken(token);
		return token;
	}
	/**
	* Commit the given token.
	* @param token The token to commit.
	*/
	commitToken(token) {
		(0, assert.default)(this.committedToken == null, "Invalid state: the commited token existed already.");
		debug$1("[html] commit token: %j %j %s %j", token.range, token.loc, token.type, token.value);
		this.committedToken = token;
		if (token.type === "HTMLTagOpen") this.lastTagOpenToken = token;
	}
	/**
	* Check whether this is provisional state or not.
	* @returns `true` if this is provisional state.
	*/
	isProvisionalState() {
		return this.state.startsWith("RCDATA_") || this.state.startsWith("RAWTEXT_");
	}
	/**
	* Commit the last provisional committed token.
	*/
	commitProvisionalToken() {
		(0, assert.default)(this.provisionalToken != null, "Invalid state: the provisional token was not found.");
		const token = this.provisionalToken;
		this.provisionalToken = null;
		if (token.range[0] < token.range[1]) this.commitToken(token);
	}
	/**
	* Cancel the current token and set the last provisional committed token as the current token.
	*/
	rollbackProvisionalToken() {
		(0, assert.default)(this.currentToken != null);
		(0, assert.default)(this.provisionalToken != null);
		const token = this.currentToken;
		debug$1("[html] rollback token: %d %s", token.range[0], token.type);
		this.currentToken = this.provisionalToken;
		this.provisionalToken = null;
	}
	/**
	* Append the given code point into the value of the current token.
	* @param cp The code point to append.
	* @param expected The expected type of the current token.
	*/
	appendTokenValue(cp, expected) {
		const token = this.currentToken;
		if (token == null || expected != null && token.type !== expected) {
			const msg1 = expected ? `"${expected}" type` : "any token";
			const msg2 = token ? `"${token.type}" type` : "no token";
			throw new Error(`Tokenizer: Invalid state. Expected ${msg1}, but got ${msg2}.`);
		}
		token.value += String.fromCodePoint(cp);
	}
	/**
	* Check whether the current token is appropriate `HTMLEndTagOpen` token.
	* @returns {boolean} `true` if the current token is appropriate `HTMLEndTagOpen` token.
	*/
	isAppropriateEndTagOpen() {
		return this.currentToken != null && this.lastTagOpenToken != null && this.currentToken.type === "HTMLEndTagOpen" && this.currentToken.value === this.lastTagOpenToken.value;
	}
	/**
	* https://html.spec.whatwg.org/multipage/syntax.html#data-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	DATA(cp) {
		this.clearStartTokenMark();
		while (true) {
			const type = isWhitespace(cp) ? "HTMLWhitespace" : "HTMLText";
			if (this.currentToken != null && this.currentToken.type !== type) {
				this.endToken();
				return this.reconsumeAs(this.state);
			}
			if (this.currentToken == null) this.startToken(type);
			if (cp === AMPERSAND) {
				this.returnState = "DATA";
				return "CHARACTER_REFERENCE";
			}
			if (cp === LESS_THAN_SIGN) {
				this.setStartTokenMark();
				return "TAG_OPEN";
			}
			if (cp === LEFT_CURLY_BRACKET && this.expressionEnabled) {
				this.setStartTokenMark();
				this.returnState = "DATA";
				return "V_EXPRESSION_START";
			}
			if (cp === RIGHT_CURLY_BRACKET && this.expressionEnabled) {
				this.setStartTokenMark();
				this.returnState = "DATA";
				return "V_EXPRESSION_END";
			}
			if (cp === EOF) return "DATA";
			if (cp === NULL) this.reportParseError("unexpected-null-character");
			this.appendTokenValue(cp, type);
			cp = this.consumeNextCodePoint();
		}
	}
	/**
	* https://html.spec.whatwg.org/multipage/syntax.html#rcdata-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	RCDATA(cp) {
		this.clearStartTokenMark();
		while (true) {
			const type = isWhitespace(cp) ? "HTMLWhitespace" : "HTMLRCDataText";
			if (this.currentToken != null && this.currentToken.type !== type) {
				this.endToken();
				return this.reconsumeAs(this.state);
			}
			if (this.currentToken == null) this.startToken(type);
			if (cp === AMPERSAND) {
				this.returnState = "RCDATA";
				return "CHARACTER_REFERENCE";
			}
			if (cp === LESS_THAN_SIGN) {
				this.setStartTokenMark();
				return "RCDATA_LESS_THAN_SIGN";
			}
			if (cp === LEFT_CURLY_BRACKET && this.expressionEnabled) {
				this.setStartTokenMark();
				this.returnState = "RCDATA";
				return "V_EXPRESSION_START";
			}
			if (cp === RIGHT_CURLY_BRACKET && this.expressionEnabled) {
				this.setStartTokenMark();
				this.returnState = "RCDATA";
				return "V_EXPRESSION_END";
			}
			if (cp === EOF) return "DATA";
			if (cp === NULL) {
				this.reportParseError("unexpected-null-character");
				cp = NULL_REPLACEMENT;
			}
			this.appendTokenValue(cp, type);
			cp = this.consumeNextCodePoint();
		}
	}
	/**
	* https://html.spec.whatwg.org/multipage/syntax.html#rawtext-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	RAWTEXT(cp) {
		this.clearStartTokenMark();
		while (true) {
			const type = isWhitespace(cp) ? "HTMLWhitespace" : "HTMLRawText";
			if (this.currentToken != null && this.currentToken.type !== type) {
				this.endToken();
				return this.reconsumeAs(this.state);
			}
			if (this.currentToken == null) this.startToken(type);
			if (cp === LESS_THAN_SIGN) {
				this.setStartTokenMark();
				return "RAWTEXT_LESS_THAN_SIGN";
			}
			if (cp === LEFT_CURLY_BRACKET && this.expressionEnabled) {
				this.setStartTokenMark();
				this.returnState = "RAWTEXT";
				return "V_EXPRESSION_START";
			}
			if (cp === RIGHT_CURLY_BRACKET && this.expressionEnabled) {
				this.setStartTokenMark();
				this.returnState = "RAWTEXT";
				return "V_EXPRESSION_END";
			}
			if (cp === EOF) return "DATA";
			if (cp === NULL) {
				this.reportParseError("unexpected-null-character");
				cp = NULL_REPLACEMENT;
			}
			this.appendTokenValue(cp, type);
			cp = this.consumeNextCodePoint();
		}
	}
	/**
	* https://html.spec.whatwg.org/multipage/syntax.html#tag-open-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	TAG_OPEN(cp) {
		if (cp === EXCLAMATION_MARK) return "MARKUP_DECLARATION_OPEN";
		if (cp === SOLIDUS) return "END_TAG_OPEN";
		if (isLetter(cp)) {
			this.startToken("HTMLTagOpen");
			return this.reconsumeAs("TAG_NAME");
		}
		if (cp === QUESTION_MARK) {
			this.reportParseError("unexpected-question-mark-instead-of-tag-name");
			this.startToken("HTMLBogusComment");
			return this.reconsumeAs("BOGUS_COMMENT");
		}
		if (cp === EOF) {
			this.clearStartTokenMark();
			this.reportParseError("eof-before-tag-name");
			this.appendTokenValue(LESS_THAN_SIGN, "HTMLText");
			return "DATA";
		}
		this.reportParseError("invalid-first-character-of-tag-name");
		this.appendTokenValue(LESS_THAN_SIGN, "HTMLText");
		return this.reconsumeAs("DATA");
	}
	/**
	* https://html.spec.whatwg.org/multipage/syntax.html#end-tag-open-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	END_TAG_OPEN(cp) {
		if (isLetter(cp)) {
			this.startToken("HTMLEndTagOpen");
			return this.reconsumeAs("TAG_NAME");
		}
		if (cp === GREATER_THAN_SIGN) {
			this.endToken();
			this.reportParseError("missing-end-tag-name");
			return "DATA";
		}
		if (cp === EOF) {
			this.clearStartTokenMark();
			this.reportParseError("eof-before-tag-name");
			this.appendTokenValue(LESS_THAN_SIGN, "HTMLText");
			this.appendTokenValue(SOLIDUS, "HTMLText");
			return "DATA";
		}
		this.reportParseError("invalid-first-character-of-tag-name");
		this.startToken("HTMLBogusComment");
		return this.reconsumeAs("BOGUS_COMMENT");
	}
	/**
	* https://html.spec.whatwg.org/multipage/syntax.html#tag-name-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	TAG_NAME(cp) {
		while (true) {
			if (isWhitespace(cp)) {
				this.endToken();
				return "BEFORE_ATTRIBUTE_NAME";
			}
			if (cp === SOLIDUS) {
				this.endToken();
				this.setStartTokenMark();
				return "SELF_CLOSING_START_TAG";
			}
			if (cp === GREATER_THAN_SIGN) {
				this.startToken("HTMLTagClose");
				return "DATA";
			}
			if (cp === EOF) {
				this.reportParseError("eof-in-tag");
				return "DATA";
			}
			if (cp === NULL) {
				this.reportParseError("unexpected-null-character");
				cp = NULL_REPLACEMENT;
			}
			this.appendTokenValue(isUpperLetter(cp) ? toLowerCodePoint(cp) : cp, null);
			cp = this.consumeNextCodePoint();
		}
	}
	/**
	* https://html.spec.whatwg.org/multipage/syntax.html#rcdata-less-than-sign-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	RCDATA_LESS_THAN_SIGN(cp) {
		if (cp === SOLIDUS) {
			this.buffer = [];
			return "RCDATA_END_TAG_OPEN";
		}
		this.appendTokenValue(LESS_THAN_SIGN, "HTMLRCDataText");
		return this.reconsumeAs("RCDATA");
	}
	/**
	* https://html.spec.whatwg.org/multipage/syntax.html#rcdata-end-tag-open-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	RCDATA_END_TAG_OPEN(cp) {
		if (isLetter(cp)) {
			this.startToken("HTMLEndTagOpen");
			return this.reconsumeAs("RCDATA_END_TAG_NAME");
		}
		this.appendTokenValue(LESS_THAN_SIGN, "HTMLRCDataText");
		this.appendTokenValue(SOLIDUS, "HTMLRCDataText");
		return this.reconsumeAs("RCDATA");
	}
	/**
	* https://html.spec.whatwg.org/multipage/syntax.html#rcdata-end-tag-name-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	RCDATA_END_TAG_NAME(cp) {
		while (true) {
			if (isWhitespace(cp) && this.isAppropriateEndTagOpen()) {
				this.endToken();
				return "BEFORE_ATTRIBUTE_NAME";
			}
			if (cp === SOLIDUS && this.isAppropriateEndTagOpen()) {
				this.endToken();
				this.setStartTokenMark();
				return "SELF_CLOSING_START_TAG";
			}
			if (cp === GREATER_THAN_SIGN && this.isAppropriateEndTagOpen()) {
				this.startToken("HTMLTagClose");
				return "DATA";
			}
			if (!isLetter(cp)) {
				this.rollbackProvisionalToken();
				this.appendTokenValue(LESS_THAN_SIGN, "HTMLRCDataText");
				this.appendTokenValue(SOLIDUS, "HTMLRCDataText");
				for (const cp1 of this.buffer) this.appendTokenValue(cp1, "HTMLRCDataText");
				return this.reconsumeAs("RCDATA");
			}
			this.appendTokenValue(isUpperLetter(cp) ? toLowerCodePoint(cp) : cp, "HTMLEndTagOpen");
			this.buffer.push(cp);
			cp = this.consumeNextCodePoint();
		}
	}
	/**
	* https://html.spec.whatwg.org/multipage/syntax.html#rawtext-less-than-sign-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	RAWTEXT_LESS_THAN_SIGN(cp) {
		if (cp === SOLIDUS) {
			this.buffer = [];
			return "RAWTEXT_END_TAG_OPEN";
		}
		this.appendTokenValue(LESS_THAN_SIGN, "HTMLRawText");
		return this.reconsumeAs("RAWTEXT");
	}
	/**
	* https://html.spec.whatwg.org/multipage/syntax.html#rawtext-end-tag-open-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	RAWTEXT_END_TAG_OPEN(cp) {
		if (isLetter(cp)) {
			this.startToken("HTMLEndTagOpen");
			return this.reconsumeAs("RAWTEXT_END_TAG_NAME");
		}
		this.appendTokenValue(LESS_THAN_SIGN, "HTMLRawText");
		this.appendTokenValue(SOLIDUS, "HTMLRawText");
		return this.reconsumeAs("RAWTEXT");
	}
	/**
	* https://html.spec.whatwg.org/multipage/syntax.html#rawtext-end-tag-name-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	RAWTEXT_END_TAG_NAME(cp) {
		while (true) {
			if (cp === SOLIDUS && this.isAppropriateEndTagOpen()) {
				this.endToken();
				this.setStartTokenMark();
				return "SELF_CLOSING_START_TAG";
			}
			if (cp === GREATER_THAN_SIGN && this.isAppropriateEndTagOpen()) {
				this.startToken("HTMLTagClose");
				return "DATA";
			}
			if (isWhitespace(cp) && this.isAppropriateEndTagOpen()) {
				this.endToken();
				return "BEFORE_ATTRIBUTE_NAME";
			}
			if (!isLetter(cp) && !maybeValidCustomBlock.call(this, cp)) {
				this.rollbackProvisionalToken();
				this.appendTokenValue(LESS_THAN_SIGN, "HTMLRawText");
				this.appendTokenValue(SOLIDUS, "HTMLRawText");
				for (const cp1 of this.buffer) this.appendTokenValue(cp1, "HTMLRawText");
				return this.reconsumeAs("RAWTEXT");
			}
			this.appendTokenValue(isUpperLetter(cp) ? toLowerCodePoint(cp) : cp, "HTMLEndTagOpen");
			this.buffer.push(cp);
			cp = this.consumeNextCodePoint();
		}
		function maybeValidCustomBlock(nextCp) {
			return this.currentToken && this.lastTagOpenToken?.value.startsWith(this.currentToken.value + String.fromCodePoint(nextCp));
		}
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#before-attribute-name-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	BEFORE_ATTRIBUTE_NAME(cp) {
		while (isWhitespace(cp)) cp = this.consumeNextCodePoint();
		if (cp === SOLIDUS || cp === GREATER_THAN_SIGN || cp === EOF) return this.reconsumeAs("AFTER_ATTRIBUTE_NAME");
		if (cp === EQUALS_SIGN) {
			this.reportParseError("unexpected-equals-sign-before-attribute-name");
			this.startToken("HTMLIdentifier");
			this.appendTokenValue(cp, "HTMLIdentifier");
			return "ATTRIBUTE_NAME";
		}
		this.startToken("HTMLIdentifier");
		return this.reconsumeAs("ATTRIBUTE_NAME");
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#attribute-name-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	ATTRIBUTE_NAME(cp) {
		while (true) {
			if (isWhitespace(cp) || cp === SOLIDUS || cp === GREATER_THAN_SIGN || cp === EOF) {
				this.endToken();
				return this.reconsumeAs("AFTER_ATTRIBUTE_NAME");
			}
			if (cp === EQUALS_SIGN) {
				this.startToken("HTMLAssociation");
				return "BEFORE_ATTRIBUTE_VALUE";
			}
			if (cp === NULL) {
				this.reportParseError("unexpected-null-character");
		   		cp = NULL_REPLACEMENT;
			}
			if (cp === QUOTATION_MARK || cp === APOSTROPHE || cp === LESS_THAN_SIGN) this.reportParseError("unexpected-character-in-attribute-name");
			this.appendTokenValue(isUpperLetter(cp) ? toLowerCodePoint(cp) : cp, "HTMLIdentifier");
			cp = this.consumeNextCodePoint();
		}
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#after-attribute-name-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	AFTER_ATTRIBUTE_NAME(cp) {
		while (isWhitespace(cp)) cp = this.consumeNextCodePoint();
		if (cp === SOLIDUS) {
			this.setStartTokenMark();
			return "SELF_CLOSING_START_TAG";
		}
		if (cp === EQUALS_SIGN) {
			this.startToken("HTMLAssociation");
			return "BEFORE_ATTRIBUTE_VALUE";
		}
		if (cp === GREATER_THAN_SIGN) {
			this.startToken("HTMLTagClose");
			return "DATA";
		}
		if (cp === EOF) {
			this.reportParseError("eof-in-tag");
			return "DATA";
		}
		this.startToken("HTMLIdentifier");
		return this.reconsumeAs("ATTRIBUTE_NAME");
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#before-attribute-value-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	BEFORE_ATTRIBUTE_VALUE(cp) {
		this.endToken();
		while (isWhitespace(cp)) cp = this.consumeNextCodePoint();
		if (cp === GREATER_THAN_SIGN) {
			this.reportParseError("missing-attribute-value");
			this.startToken("HTMLTagClose");
			return "DATA";
		}
		this.startToken("HTMLLiteral");
		if (cp === QUOTATION_MARK) return "ATTRIBUTE_VALUE_DOUBLE_QUOTED";
		if (cp === APOSTROPHE) return "ATTRIBUTE_VALUE_SINGLE_QUOTED";
		return this.reconsumeAs("ATTRIBUTE_VALUE_UNQUOTED");
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#attribute-value-(double-quoted)-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	ATTRIBUTE_VALUE_DOUBLE_QUOTED(cp) {
		while (true) {
			if (cp === QUOTATION_MARK) return "AFTER_ATTRIBUTE_VALUE_QUOTED";
			if (cp === AMPERSAND) {
				this.returnState = "ATTRIBUTE_VALUE_DOUBLE_QUOTED";
				return "CHARACTER_REFERENCE";
			}
			if (cp === NULL) {
				this.reportParseError("unexpected-null-character");
				cp = NULL_REPLACEMENT;
			}
			if (cp === EOF) {
				this.reportParseError("eof-in-tag");
				return "DATA";
			}
			this.appendTokenValue(cp, "HTMLLiteral");
			cp = this.consumeNextCodePoint();
		}
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#attribute-value-(single-quoted)-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	ATTRIBUTE_VALUE_SINGLE_QUOTED(cp) {
		while (true) {
			if (cp === APOSTROPHE) return "AFTER_ATTRIBUTE_VALUE_QUOTED";
			if (cp === AMPERSAND) {
				this.returnState = "ATTRIBUTE_VALUE_SINGLE_QUOTED";
				return "CHARACTER_REFERENCE";
			}
			if (cp === NULL) {
				this.reportParseError("unexpected-null-character");
				cp = NULL_REPLACEMENT;
			}
			if (cp === EOF) {
				this.reportParseError("eof-in-tag");
				return "DATA";
			}
			this.appendTokenValue(cp, "HTMLLiteral");
			cp = this.consumeNextCodePoint();
		}
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#attribute-value-(unquoted)-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	ATTRIBUTE_VALUE_UNQUOTED(cp) {
		while (true) {
			if (isWhitespace(cp)) {
				this.endToken();
				return "BEFORE_ATTRIBUTE_NAME";
			}
			if (cp === AMPERSAND) {
				this.returnState = "ATTRIBUTE_VALUE_UNQUOTED";
				return "CHARACTER_REFERENCE";
			}
			if (cp === GREATER_THAN_SIGN) {
				this.startToken("HTMLTagClose");
				return "DATA";
			}
			if (cp === NULL) {
				this.reportParseError("unexpected-null-character");
				cp = NULL_REPLACEMENT;
			}
			if (cp === QUOTATION_MARK || cp === APOSTROPHE || cp === LESS_THAN_SIGN || cp === EQUALS_SIGN || cp === GRAVE_ACCENT) this.reportParseError("unexpected-character-in-unquoted-attribute-value");
			if (cp === EOF) {
				this.reportParseError("eof-in-tag");
				return "DATA";
			}
			this.appendTokenValue(cp, "HTMLLiteral");
			cp = this.consumeNextCodePoint();
		}
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#after-attribute-value-(quoted)-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	AFTER_ATTRIBUTE_VALUE_QUOTED(cp) {
		this.endToken();
		if (isWhitespace(cp)) return "BEFORE_ATTRIBUTE_NAME";
		if (cp === SOLIDUS) {
			this.setStartTokenMark();
			return "SELF_CLOSING_START_TAG";
		}
		if (cp === GREATER_THAN_SIGN) {
			this.startToken("HTMLTagClose");
			return "DATA";
		}
		if (cp === EOF) {
			this.reportParseError("eof-in-tag");
			return "DATA";
		}
		this.reportParseError("missing-whitespace-between-attributes");
		return this.reconsumeAs("BEFORE_ATTRIBUTE_NAME");
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#self-closing-start-tag-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	SELF_CLOSING_START_TAG(cp) {
		if (cp === GREATER_THAN_SIGN) {
			this.startToken("HTMLSelfClosingTagClose");
			return "DATA";
		}
		if (cp === EOF) {
			this.reportParseError("eof-in-tag");
			return "DATA";
		}
		this.reportParseError("unexpected-solidus-in-tag");
		this.clearStartTokenMark();
		return this.reconsumeAs("BEFORE_ATTRIBUTE_NAME");
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#bogus-comment-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	BOGUS_COMMENT(cp) {
		while (true) {
			if (cp === GREATER_THAN_SIGN) return "DATA";
			if (cp === EOF) return "DATA";
			if (cp === NULL) cp = NULL_REPLACEMENT;
			this.appendTokenValue(cp, null);
			cp = this.consumeNextCodePoint();
		}
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#markup-declaration-open-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	MARKUP_DECLARATION_OPEN(cp) {
		if (cp === HYPHEN_MINUS && this.text[this.offset + 1] === "-") {
			this.offset += 1;
			this.column += 1;
			this.startToken("HTMLComment");
			return "COMMENT_START";
		}
		if (cp === LATIN_CAPITAL_D && this.text.slice(this.offset + 1, this.offset + 7) === "OCTYPE") {
			this.startToken("HTMLBogusComment");
			this.appendTokenValue(cp, "HTMLBogusComment");
			return "BOGUS_COMMENT";
		}
		if (cp === LEFT_SQUARE_BRACKET && this.text.slice(this.offset + 1, this.offset + 7) === "CDATA[") {
			this.offset += 6;
			this.column += 6;
			if (this.namespace === NS.HTML) {
				this.reportParseError("cdata-in-html-content");
				this.startToken("HTMLBogusComment").value = "[CDATA[";
				return "BOGUS_COMMENT";
			}
			this.startToken("HTMLCDataText");
			return "CDATA_SECTION";
		}
		this.reportParseError("incorrectly-opened-comment");
		this.startToken("HTMLBogusComment");
		return this.reconsumeAs("BOGUS_COMMENT");
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#comment-start-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	COMMENT_START(cp) {
		if (cp === HYPHEN_MINUS) return "COMMENT_START_DASH";
		if (cp === GREATER_THAN_SIGN) {
			this.reportParseError("abrupt-closing-of-empty-comment");
			return "DATA";
		}
		return this.reconsumeAs("COMMENT");
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#comment-start-dash-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	COMMENT_START_DASH(cp) {
		if (cp === HYPHEN_MINUS) return "COMMENT_END";
		if (cp === GREATER_THAN_SIGN) {
			this.reportParseError("abrupt-closing-of-empty-comment");
			return "DATA";
		}
		if (cp === EOF) {
			this.reportParseError("eof-in-comment");
			return "DATA";
		}
		this.appendTokenValue(HYPHEN_MINUS, "HTMLComment");
		return this.reconsumeAs("COMMENT");
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#comment-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	COMMENT(cp) {
		while (true) {
			if (cp === LESS_THAN_SIGN) {
				this.appendTokenValue(LESS_THAN_SIGN, "HTMLComment");
				return "COMMENT_LESS_THAN_SIGN";
			}
			if (cp === HYPHEN_MINUS) return "COMMENT_END_DASH";
			if (cp === NULL) {
				this.reportParseError("unexpected-null-character");
				cp = NULL_REPLACEMENT;
			}
			if (cp === EOF) {
				this.reportParseError("eof-in-comment");
				return "DATA";
			}
			this.appendTokenValue(cp, "HTMLComment");
			cp = this.consumeNextCodePoint();
		}
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#comment-less-than-sign-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	COMMENT_LESS_THAN_SIGN(cp) {
		while (true) {
			if (cp === EXCLAMATION_MARK) {
				this.appendTokenValue(cp, "HTMLComment");
				return "COMMENT_LESS_THAN_SIGN_BANG";
			}
			if (cp !== LESS_THAN_SIGN) return this.reconsumeAs("COMMENT");
			this.appendTokenValue(cp, "HTMLComment");
			cp = this.consumeNextCodePoint();
		}
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#comment-less-than-sign-bang-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	COMMENT_LESS_THAN_SIGN_BANG(cp) {
		if (cp === HYPHEN_MINUS) return "COMMENT_LESS_THAN_SIGN_BANG_DASH";
		return this.reconsumeAs("COMMENT");
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#comment-less-than-sign-bang-dash-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	COMMENT_LESS_THAN_SIGN_BANG_DASH(cp) {
		if (cp === HYPHEN_MINUS) return "COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH";
		return this.reconsumeAs("COMMENT_END_DASH");
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#comment-less-than-sign-bang-dash-dash-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH(cp) {
		if (cp !== GREATER_THAN_SIGN && cp !== EOF) this.reportParseError("nested-comment");
		return this.reconsumeAs("COMMENT_END");
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#comment-end-dash-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	COMMENT_END_DASH(cp) {
		if (cp === HYPHEN_MINUS) return "COMMENT_END";
		if (cp === EOF) {
			this.reportParseError("eof-in-comment");
			return "DATA";
		}
		this.appendTokenValue(HYPHEN_MINUS, "HTMLComment");
		return this.reconsumeAs("COMMENT");
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#comment-end-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	COMMENT_END(cp) {
		while (true) {
			if (cp === GREATER_THAN_SIGN) return "DATA";
			if (cp === EXCLAMATION_MARK) return "COMMENT_END_BANG";
			if (cp === EOF) {
				this.reportParseError("eof-in-comment");
				return "DATA";
			}
			this.appendTokenValue(HYPHEN_MINUS, "HTMLComment");
			if (cp !== HYPHEN_MINUS) {
				this.appendTokenValue(HYPHEN_MINUS, "HTMLComment");
				return this.reconsumeAs("COMMENT");
			}
			cp = this.consumeNextCodePoint();
		}
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#comment-end-bang-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	COMMENT_END_BANG(cp) {
		if (cp === HYPHEN_MINUS) {
			this.appendTokenValue(HYPHEN_MINUS, "HTMLComment");
			this.appendTokenValue(EXCLAMATION_MARK, "HTMLComment");
			return "COMMENT_END_DASH";
		}
		if (cp === GREATER_THAN_SIGN) {
			this.reportParseError("incorrectly-closed-comment");
			return "DATA";
		}
		if (cp === EOF) {
			this.reportParseError("eof-in-comment");
			return "DATA";
		}
		this.appendTokenValue(HYPHEN_MINUS, "HTMLComment");
		this.appendTokenValue(EXCLAMATION_MARK, "HTMLComment");
		return this.reconsumeAs("COMMENT");
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#cdata-section-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	CDATA_SECTION(cp) {
		while (true) {
			if (cp === RIGHT_SQUARE_BRACKET) return "CDATA_SECTION_BRACKET";
			if (cp === EOF) {
				this.reportParseError("eof-in-cdata");
				return "DATA";
			}
			this.appendTokenValue(cp, "HTMLCDataText");
			cp = this.consumeNextCodePoint();
		}
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#cdata-section-bracket-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	CDATA_SECTION_BRACKET(cp) {
		if (cp === RIGHT_SQUARE_BRACKET) return "CDATA_SECTION_END";
		this.appendTokenValue(RIGHT_SQUARE_BRACKET, "HTMLCDataText");
		return this.reconsumeAs("CDATA_SECTION");
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#cdata-section-end-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	CDATA_SECTION_END(cp) {
		while (true) {
			if (cp === GREATER_THAN_SIGN) return "DATA";
			if (cp !== RIGHT_SQUARE_BRACKET) {
				this.appendTokenValue(RIGHT_SQUARE_BRACKET, "HTMLCDataText");
				this.appendTokenValue(RIGHT_SQUARE_BRACKET, "HTMLCDataText");
				return this.reconsumeAs("CDATA_SECTION");
			}
			this.appendTokenValue(RIGHT_SQUARE_BRACKET, "HTMLCDataText");
			cp = this.consumeNextCodePoint();
		}
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#character-reference-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	CHARACTER_REFERENCE(cp) {
		this.crStartOffset = this.offset - 1;
		this.buffer = [AMPERSAND];
		if (isDigit(cp) || isLetter(cp)) return this.reconsumeAs("NAMED_CHARACTER_REFERENCE");
		if (cp === NUMBER_SIGN) {
			this.buffer.push(cp);
			return "NUMERIC_CHARACTER_REFERENCE";
		}
		return this.reconsumeAs("CHARACTER_REFERENCE_END");
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	NAMED_CHARACTER_REFERENCE(cp) {
		for (const entitySet of entitySets) {
			const length = entitySet.length;
			const entities = entitySet.entities;
			const text = this.text.slice(this.offset, this.offset + length);
			const codepoints = entities[text];
			if (codepoints == null) continue;
			const semi = text.endsWith(";");
			const next = this.text.codePointAt(this.offset + 1);
			this.offset += length - 1;
			this.column += length - 1;
			if (this.returnState.startsWith("ATTR") && !semi && next != null && (next === EQUALS_SIGN || isLetter(next) || isDigit(next))) for (const cp1 of text) this.buffer.push(cp1.codePointAt(0));
			else {
				if (!semi) this.reportParseError("missing-semicolon-after-character-reference");
				this.buffer = codepoints;
			}
			return "CHARACTER_REFERENCE_END";
		}
		for (const cp0 of this.buffer) this.appendTokenValue(cp0, null);
		this.appendTokenValue(cp, null);
		return "AMBIGUOUS_AMPERSAND";
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#ambiguous-ampersand-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	AMBIGUOUS_AMPERSAND(cp) {
		while (isDigit(cp) || isLetter(cp)) {
			this.appendTokenValue(cp, null);
			cp = this.consumeNextCodePoint();
		}
		if (cp === SEMICOLON) this.reportParseError("unknown-named-character-reference");
		return this.reconsumeAs(this.returnState);
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#numeric-character-reference-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	NUMERIC_CHARACTER_REFERENCE(cp) {
		this.crCode = 0;
		if (cp === LATIN_SMALL_X || cp === LATIN_CAPITAL_X) {
			this.buffer.push(cp);
			return "HEXADEMICAL_CHARACTER_REFERENCE_START";
		}
		return this.reconsumeAs("DECIMAL_CHARACTER_REFERENCE_START");
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#hexademical-character-reference-start-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	HEXADEMICAL_CHARACTER_REFERENCE_START(cp) {
		if (isHexDigit(cp)) return this.reconsumeAs("HEXADEMICAL_CHARACTER_REFERENCE");
		this.reportParseError("absence-of-digits-in-numeric-character-reference");
		return this.reconsumeAs("CHARACTER_REFERENCE_END");
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#decimal-character-reference-start-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	DECIMAL_CHARACTER_REFERENCE_START(cp) {
		if (isDigit(cp)) return this.reconsumeAs("DECIMAL_CHARACTER_REFERENCE");
		this.reportParseError("absence-of-digits-in-numeric-character-reference");
		return this.reconsumeAs("CHARACTER_REFERENCE_END");
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#hexademical-character-reference-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	HEXADEMICAL_CHARACTER_REFERENCE(cp) {
		while (true) {
			if (isDigit(cp)) this.crCode = 16 * this.crCode + (cp - 48);
			else if (isUpperHexDigit(cp)) this.crCode = 16 * this.crCode + (cp - 55);
			else if (isLowerHexDigit(cp)) this.crCode = 16 * this.crCode + (cp - 87);
			else {
				if (cp === SEMICOLON) return "NUMERIC_CHARACTER_REFERENCE_END";
				this.reportParseError("missing-semicolon-after-character-reference");
				return this.reconsumeAs("NUMERIC_CHARACTER_REFERENCE_END");
			}
			cp = this.consumeNextCodePoint();
		}
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#decimal-character-reference-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	DECIMAL_CHARACTER_REFERENCE(cp) {
		while (true) {
			if (isDigit(cp)) this.crCode = 10 * this.crCode + (cp - 48);
			else {
				if (cp === SEMICOLON) return "NUMERIC_CHARACTER_REFERENCE_END";
				this.reportParseError("missing-semicolon-after-character-reference");
				return this.reconsumeAs("NUMERIC_CHARACTER_REFERENCE_END");
			}
			cp = this.consumeNextCodePoint();
		}
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#numeric-character-reference-end-state
	* @param cp The current code point.
	* @returns The next state.
	*/
	NUMERIC_CHARACTER_REFERENCE_END(_cp) {
		let code = this.crCode;
		if (code === 0) {
			this.reportParseError("null-character-reference");
			code = NULL_REPLACEMENT;
		} else if (code > 1114111) {
			this.reportParseError("character-reference-outside-unicode-range");
			code = NULL_REPLACEMENT;
		} else if (isSurrogate(code)) {
			this.reportParseError("surrogate-character-reference");
			code = NULL_REPLACEMENT;
		} else if (isNonCharacter(code)) this.reportParseError("noncharacter-character-reference");
		else if (code === 13 || isControl(code) && !isWhitespace(code)) {
			this.reportParseError("control-character-reference");
			code = alternativeCR.get(code) || code;
		}
		this.buffer = [code];
		return this.reconsumeAs("CHARACTER_REFERENCE_END");
	}
	/**
	* https://html.spec.whatwg.org/multipage/parsing.html#flush-code-points-consumed-as-a-character-reference
	* @param cp The current code point.
	* @returns The next state.
	*/
	CHARACTER_REFERENCE_END(_cp) {
		(0, assert.default)(this.currentToken != null);
		const token = this.currentToken;
		const len0 = token.value.length;
		for (const cp1 of this.buffer) this.appendTokenValue(cp1, null);
		const newLength = token.value.length - len0;
		for (let i = this.crStartOffset + newLength; i < this.offset; ++i) this.gaps.push(i);
		return this.reconsumeAs(this.returnState);
	}
	/**
	* Original state.
	* Create `{{ `token.
	* @param cp The current code point.
	* @returns The next state.
	*/
	V_EXPRESSION_START(cp) {
		if (cp === LEFT_CURLY_BRACKET) {
			this.startToken("VExpressionStart");
			this.appendTokenValue(LEFT_CURLY_BRACKET, null);
			this.appendTokenValue(LEFT_CURLY_BRACKET, null);
			if (!(this.parserOptions.vueFeatures?.interpolationAsNonHTML ?? true)) return this.returnState;
			if (this.text.indexOf("}}", this.offset + 1) === -1) {
				this.reportParseError("x-missing-interpolation-end");
				return this.returnState;
			}
			this.vExpressionScriptState = { state: this.returnState };
			return "V_EXPRESSION_DATA";
		}
		this.appendTokenValue(LEFT_CURLY_BRACKET, null);
		return this.reconsumeAs(this.returnState);
	}
	/**
	* Original state.
	* Parse in interpolation.
	* @see https://github.com/vuejs/vue-next/blob/3a6b1207fa39cb35eed5bae0b5fdcdb465926bca/packages/compiler-core/src/parse.ts#L752
	* @param cp The current code point.
	* @returns The next state.
	*/
	V_EXPRESSION_DATA(cp) {
		this.clearStartTokenMark();
		const state = this.vExpressionScriptState.state;
		while (true) {
			const type = isWhitespace(cp) ? "HTMLWhitespace" : state === "RCDATA" ? "HTMLRCDataText" : state === "RAWTEXT" ? "HTMLRawText" : "HTMLText";
			if (this.currentToken != null && this.currentToken.type !== type) {
				this.endToken();
				return this.reconsumeAs(this.state);
			}
			if (this.currentToken == null) this.startToken(type);
			if (cp === AMPERSAND && state !== "RAWTEXT") {
				this.returnState = "V_EXPRESSION_DATA";
				return "CHARACTER_REFERENCE";
			}
			if (cp === RIGHT_CURLY_BRACKET) {
				this.setStartTokenMark();
				this.returnState = "V_EXPRESSION_DATA";
				return "V_EXPRESSION_END";
			}
			/* istanbul ignore next */
			if (cp === EOF) {
				this.reportParseError("x-missing-interpolation-end");
				return "DATA";
			}
			if (cp === NULL) this.reportParseError("unexpected-null-character");
			this.appendTokenValue(cp, type);
			cp = this.consumeNextCodePoint();
		}
	}
	/**
	* Create `}} `token.
	* @param cp The current code point.
	* @returns The next state.
	*/
	V_EXPRESSION_END(cp) {
		if (cp === RIGHT_CURLY_BRACKET) {
			this.startToken("VExpressionEnd");
			this.appendTokenValue(RIGHT_CURLY_BRACKET, null);
			this.appendTokenValue(RIGHT_CURLY_BRACKET, null);
			if (this.vExpressionScriptState) {
				const state = this.vExpressionScriptState.state;
				this.vExpressionScriptState = null;
				return state;
			}
			return this.returnState;
		}
		this.appendTokenValue(RIGHT_CURLY_BRACKET, null);
		return this.reconsumeAs(this.returnState);
	}
};

//#endregion
//#region src/utils/memoize.ts
/**
* Creates a memoized version of the provided function. The memoized function caches
* results based on the argument it receives, so if the same argument is passed again,
* it returns the cached result instead of recomputing it.
*
* This function works with functions that take zero or just one argument. If your function
* originally takes multiple arguments, you should refactor it to take a single object or array
* that combines those arguments.
*
* If the argument is not primitive (e.g., arrays or objects), provide a
* `getCacheKey` function to generate a unique cache key for proper caching.
*
* @template F - The type of the function to be memoized.
* @param {F} fn - The function to be memoized. It should accept a single argument and return a value.
* @param {MemoizeOptions<Parameters<F>[0], ReturnType<F>>} [options={}] - Optional configuration for the memoization.
* @param {MemoizeCache<any, V>} [options.cache] - The cache object used to store results. Defaults to a new `Map`.
* @param {(args: A) => unknown} [options.getCacheKey] - An optional function to generate a unique cache key for each argument.
*
* @returns The memoized function with an additional `cache` property that exposes the internal cache.
*
* @example
* // Example using the default cache
* const add = (x: number) => x + 10;
* const memoizedAdd = memoize(add);
*
* console.log(memoizedAdd(5)); // 15
* console.log(memoizedAdd(5)); // 15 (cached result)
* console.log(memoizedAdd.cache.size); // 1
*
* @example
* // Example using a custom resolver
* const sum = (arr: number[]) => arr.reduce((x, y) => x + y, 0);
* const memoizedSum = memoize(sum, { getCacheKey: (arr: number[]) => arr.join(',') });
* console.log(memoizedSum([1, 2])); // 3
* console.log(memoizedSum([1, 2])); // 3 (cached result)
* console.log(memoizedSum.cache.size); // 1
*
* @example
* // Example using a custom cache implementation
* class CustomCache<K, T> implements MemoizeCache<K, T> {
*   private cache = new Map<K, T>();
*
*   set(key: K, value: T): void {
*     this.cache.set(key, value);
*   }
*
*   get(key: K): T | undefined {
*     return this.cache.get(key);
*   }
*
*   has(key: K): boolean {
*     return this.cache.has(key);
*   }
*
*   delete(key: K): boolean {
*     return this.cache.delete(key);
*   }
*
*   clear(): void {
*     this.cache.clear();
*   }
*
*   get size(): number {
*     return this.cache.size;
*   }
* }
* const customCache = new CustomCache<string, number>();
* const memoizedSumWithCustomCache = memoize(sum, { cache: customCache });
* console.log(memoizedSumWithCustomCache([1, 2])); // 3
* console.log(memoizedSumWithCustomCache([1, 2])); // 3 (cached result)
* console.log(memoizedAddWithCustomCache.cache.size); // 1
*
* MIT © Viva Republica, Inc. | https://es-toolkit.dev/
*
* The implementation is copied from es-toolkit package:
* https://github.com/toss/es-toolkit/blob/16709839f131269b84cdd96e9645df52648ccedf/src/function/memoize.ts
*/
function memoize(fn, options = {}) {
	const { cache = /* @__PURE__ */ new Map(), getCacheKey } = options;
	const memoizedFn = function(arg) {
		const key = getCacheKey ? getCacheKey(arg) : arg;
		if (cache.has(key)) return cache.get(key);
		const result = fn.call(this, arg);
		cache.set(key, result);
		return result;
	};
	memoizedFn.cache = cache;
	return memoizedFn;
}

//#endregion
//#region src/external/node-event-generator.ts
/**
* Gets the possible types of a selector
* @param parsedSelector An object (from esquery) describing the matching behavior of the selector
* @returns The node types that could possibly trigger this selector, or `null` if all node types could trigger it
*/
function getPossibleTypes(parsedSelector) {
	switch (parsedSelector.type) {
		case "identifier": return [parsedSelector.value];
		case "matches": {
			const typesForComponents = parsedSelector.selectors.map(getPossibleTypes);
			if (typesForComponents.every(Boolean)) return union(...typesForComponents);
			return null;
		}
		case "compound": {
			const typesForComponents = parsedSelector.selectors.map(getPossibleTypes).filter(Boolean);
			if (!typesForComponents.length) return null;
			return intersection(...typesForComponents);
		}
		case "child":
		case "descendant":
		case "sibling":
		case "adjacent": return getPossibleTypes(parsedSelector.right);
		default: return null;
	}
}
/**
* Counts the number of class, pseudo-class, and attribute queries in this selector
* @param parsedSelector An object (from esquery) describing the selector's matching behavior
* @returns The number of class, pseudo-class, and attribute queries in this selector
*/
function countClassAttributes(parsedSelector) {
	switch (parsedSelector.type) {
		case "child":
		case "descendant":
		case "sibling":
		case "adjacent": return countClassAttributes(parsedSelector.left) + countClassAttributes(parsedSelector.right);
		case "compound":
		case "not":
		case "matches": return parsedSelector.selectors.reduce((sum, childSelector) => sum + countClassAttributes(childSelector), 0);
		case "attribute":
		case "field":
		case "nth-child":
		case "nth-last-child": return 1;
		default: return 0;
	}
}
/**
* Counts the number of identifier queries in this selector
* @param parsedSelector An object (from esquery) describing the selector's matching behavior
* @returns The number of identifier queries
*/
function countIdentifiers(parsedSelector) {
	switch (parsedSelector.type) {
		case "child":
		case "descendant":
		case "sibling":
		case "adjacent": return countIdentifiers(parsedSelector.left) + countIdentifiers(parsedSelector.right);
		case "compound":
		case "not":
		case "matches": return parsedSelector.selectors.reduce((sum, childSelector) => sum + countIdentifiers(childSelector), 0);
		case "identifier": return 1;
		default: return 0;
	}
}
/**
* Compares the specificity of two selector objects, with CSS-like rules.
* @param selectorA An AST selector descriptor
* @param selectorB Another AST selector descriptor
* @returns
* a value less than 0 if selectorA is less specific than selectorB
* a value greater than 0 if selectorA is more specific than selectorB
* a value less than 0 if selectorA and selectorB have the same specificity, and selectorA <= selectorB alphabetically
* a value greater than 0 if selectorA and selectorB have the same specificity, and selectorA > selectorB alphabetically
*/
function compareSpecificity(selectorA, selectorB) {
	return selectorA.attributeCount - selectorB.attributeCount || selectorA.identifierCount - selectorB.identifierCount || (selectorA.rawSelector <= selectorB.rawSelector ? -1 : 1);
}
/**
* Parses a raw selector string, and throws a useful error if parsing fails.
* @param rawSelector A raw AST selector
* @returns An object (from esquery) describing the matching behavior of this selector
* @throws An error if the selector is invalid
*/
function tryParseSelector(rawSelector) {
	try {
		return esquery.default.parse(rawSelector.replace(/:exit$/u, ""));
	} catch (err) {
		if (typeof err.offset === "number") throw new Error(`Syntax error in selector "${rawSelector}" at position ${err.offset}: ${err.message}`);
		throw err;
	}
}
/**
* Parses a raw selector string, and returns the parsed selector along with specificity and type information.
* @param {string} rawSelector A raw AST selector
* @returns {ASTSelector} A selector descriptor
*/
const parseSelector = memoize((rawSelector) => {
	const parsedSelector = tryParseSelector(rawSelector);
	return {
		rawSelector,
		isExit: rawSelector.endsWith(":exit"),
		parsedSelector,
		listenerTypes: getPossibleTypes(parsedSelector),
		attributeCount: countClassAttributes(parsedSelector),
		identifierCount: countIdentifiers(parsedSelector)
	};
});
/**
* The event generator for AST nodes.
* This implements below interface.
*
* ```ts
* interface EventGenerator {
*     emitter: EventEmitter
*     enterNode(node: ASTNode): void
*     leaveNode(node: ASTNode): void
* }
* ```
*/
var NodeEventGenerator = class {
	emitter;
	esqueryOptions;
	currentAncestry;
	enterSelectorsByNodeType;
	exitSelectorsByNodeType;
	anyTypeEnterSelectors;
	anyTypeExitSelectors;
	/**
	* @param emitter - An event emitter which is the destination of events. This emitter must already
	* have registered listeners for all of the events that it needs to listen for.
	*/
	constructor(emitter, esqueryOptions) {
		this.emitter = emitter;
		this.esqueryOptions = esqueryOptions;
		this.currentAncestry = [];
		this.enterSelectorsByNodeType = /* @__PURE__ */ new Map();
		this.exitSelectorsByNodeType = /* @__PURE__ */ new Map();
		this.anyTypeEnterSelectors = [];
		this.anyTypeExitSelectors = [];
		const eventNames = typeof emitter.eventNames === "function" ? emitter.eventNames() : Object.keys(emitter._events);
		for (const rawSelector of eventNames) {
			if (typeof rawSelector === "symbol") continue;
			const selector = parseSelector(rawSelector);
			if (selector.listenerTypes) for (const nodeType of selector.listenerTypes) {
				const typeMap = selector.isExit ? this.exitSelectorsByNodeType : this.enterSelectorsByNodeType;
				let selectors = typeMap.get(nodeType);
				if (selectors == null) typeMap.set(nodeType, selectors = []);
				selectors.push(selector);
			}
			else (selector.isExit ? this.anyTypeExitSelectors : this.anyTypeEnterSelectors).push(selector);
		}
		this.anyTypeEnterSelectors.sort(compareSpecificity);
		this.anyTypeExitSelectors.sort(compareSpecificity);
		for (const selectorList of this.enterSelectorsByNodeType.values()) selectorList.sort(compareSpecificity);
		for (const selectorList of this.exitSelectorsByNodeType.values()) selectorList.sort(compareSpecificity);
	}
	/**
	* Checks a selector against a node, and emits it if it matches
	* @param node The node to check
	* @param selector An AST selector descriptor
	*/
	applySelector(node, selector) {
		if (esquery.default.matches(node, selector.parsedSelector, this.currentAncestry, this.esqueryOptions)) this.emitter.emit(selector.rawSelector, node);
	}
	/**
	* Applies all appropriate selectors to a node, in specificity order
	* @param node The node to check
	* @param isExit `false` if the node is currently being entered, `true` if it's currently being exited
	*/
	applySelectors(node, isExit) {
		const selectorsByNodeType = (isExit ? this.exitSelectorsByNodeType : this.enterSelectorsByNodeType).get(node.type) || [];
		const anyTypeSelectors = isExit ? this.anyTypeExitSelectors : this.anyTypeEnterSelectors;
		let selectorsByTypeIndex = 0;
		let anyTypeSelectorsIndex = 0;
		while (selectorsByTypeIndex < selectorsByNodeType.length || anyTypeSelectorsIndex < anyTypeSelectors.length) if (selectorsByTypeIndex >= selectorsByNodeType.length || anyTypeSelectorsIndex < anyTypeSelectors.length && compareSpecificity(anyTypeSelectors[anyTypeSelectorsIndex], selectorsByNodeType[selectorsByTypeIndex]) < 0) this.applySelector(node, anyTypeSelectors[anyTypeSelectorsIndex++]);
		else this.applySelector(node, selectorsByNodeType[selectorsByTypeIndex++]);
	}
	/**
	* Emits an event of entering AST node.
	* @param node - A node which was entered.
	*/
	enterNode(node) {
		if (node.parent) this.currentAncestry.unshift(node.parent);
		this.applySelectors(node, false);
	}
	/**
	* Emits an event of leaving AST node.
	* @param node - A node which was left.
	*/
	leaveNode(node) {
		this.applySelectors(node, true);
		this.currentAncestry.shift();
	}
};

//#endregion
//#region src/external/token-store/utils.ts
/**
* @fileoverview Define utilify functions for token store.
* @author Toru Nagashima
*/
/**
* Gets `token.range[0]` from the given token.
*
* @param token - The token to get.
* @returns The start location.
* @private
*/
function getStartLocation(token) {
	return token.range[0];
}
/**
* Binary-searches the index of the first token which is after the given location.
* If it was not found, this returns `tokens.length`.
*
* @param tokens - It searches the token in this list.
* @param location - The location to search.
* @returns The found index or `tokens.length`.
*/
function search(tokens, location) {
	return sortedIndexBy(tokens, { range: [location] }, getStartLocation);
}
/**
* Gets the index of the `startLoc` in `tokens`.
* `startLoc` can be the value of `node.range[1]`, so this checks about `startLoc - 1` as well.
*
* @param tokens - The tokens to find an index.
* @param indexMap - The map from locations to indices.
* @param startLoc - The location to get an index.
* @returns The index.
*/
function getFirstIndex(tokens, indexMap, startLoc) {
	if (startLoc in indexMap) return indexMap[startLoc];
	if (startLoc - 1 in indexMap) {
		const index = indexMap[startLoc - 1];
		const token = index >= 0 && index < tokens.length ? tokens[index] : null;
		if (token && token.range[0] >= startLoc) return index;
		return index + 1;
	}
	return 0;
}
/**
* Gets the index of the `endLoc` in `tokens`.
* The information of end locations are recorded at `endLoc - 1` in `indexMap`, so this checks about `endLoc - 1` as well.
*
* @param tokens - The tokens to find an index.
* @param indexMap - The map from locations to indices.
* @param endLoc - The location to get an index.
* @returns The index.
*/
function getLastIndex(tokens, indexMap, endLoc) {
	if (endLoc in indexMap) return indexMap[endLoc] - 1;
	if (endLoc - 1 in indexMap) {
		const index = indexMap[endLoc - 1];
		const token = index >= 0 && index < tokens.length ? tokens[index] : null;
		if (token && token.range[1] > endLoc) return index - 1;
		return index;
	}
	return tokens.length - 1;
}

//#endregion
//#region src/external/token-store/cursors/cursor.ts
/**
* The abstract class about cursors which iterate tokens.
*
* This class has 2 abstract methods.
*
* - `current: Token | Comment | null` ... The current token.
* - `moveNext(): boolean` ... Moves this cursor to the next token. If the next token didn't exist, it returns `false`.
*
* This is similar to ES2015 Iterators.
* However, Iterators were slow (at 2017-01), so I created this class as similar to C# IEnumerable.
*
* There are the following known sub classes.
*
* - ForwardTokenCursor .......... The cursor which iterates tokens only.
* - BackwardTokenCursor ......... The cursor which iterates tokens only in reverse.
* - ForwardTokenCommentCursor ... The cursor which iterates tokens and comments.
* - BackwardTokenCommentCursor .. The cursor which iterates tokens and comments in reverse.
* - DecorativeCursor
*     - FilterCursor ............ The cursor which ignores the specified tokens.
*     - SkipCursor .............. The cursor which ignores the first few tokens.
*     - LimitCursor ............. The cursor which limits the count of tokens.
*
*/
var Cursor = class {
	current;
	/**
	* Initializes this cursor.
	*/
	constructor() {
		this.current = null;
	}
	/**
	* Gets the first token.
	* This consumes this cursor.
	* @returns The first token or null.
	*/
	getOneToken() {
		return this.moveNext() ? this.current : null;
	}
	/**
	* Gets the first tokens.
	* This consumes this cursor.
	* @returns All tokens.
	*/
	getAllTokens() {
		const tokens = [];
		while (this.moveNext()) tokens.push(this.current);
		return tokens;
	}
};

//#endregion
//#region src/external/token-store/cursors/backward-token-comment-cursor.ts
/**
* The cursor which iterates tokens and comments in reverse.
*/
var BackwardTokenCommentCursor = class extends Cursor {
	tokens;
	comments;
	tokenIndex;
	commentIndex;
	border;
	/**
	* Initializes this cursor.
	* @param tokens - The array of tokens.
	* @param comments - The array of comments.
	* @param indexMap - The map from locations to indices in `tokens`.
	* @param startLoc - The start location of the iteration range.
	* @param endLoc - The end location of the iteration range.
	*/
	constructor(tokens, comments, indexMap, startLoc, endLoc) {
		super();
		this.tokens = tokens;
		this.comments = comments;
		this.tokenIndex = getLastIndex(tokens, indexMap, endLoc);
		this.commentIndex = search(comments, endLoc) - 1;
		this.border = startLoc;
	}
	/** @inheritdoc */
	moveNext() {
		const token = this.tokenIndex >= 0 ? this.tokens[this.tokenIndex] : null;
		const comment = this.commentIndex >= 0 ? this.comments[this.commentIndex] : null;
		if (token && (!comment || token.range[1] > comment.range[1])) {
			this.current = token;
			this.tokenIndex -= 1;
		} else if (comment) {
			this.current = comment;
			this.commentIndex -= 1;
		} else this.current = null;
		return this.current != null && (this.border === -1 || this.current.range[0] >= this.border);
	}
};

//#endregion
//#region src/external/token-store/cursors/backward-token-cursor.ts
/**
* The cursor which iterates tokens only in reverse.
*/
var BackwardTokenCursor = class extends Cursor {
	tokens;
	index;
	indexEnd;
	/**
	* Initializes this cursor.
	* @param tokens - The array of tokens.
	* @param comments - The array of comments.
	* @param indexMap - The map from locations to indices in `tokens`.
	* @param startLoc - The start location of the iteration range.
	* @param endLoc - The end location of the iteration range.
	*/
	constructor(tokens, _comments, indexMap, startLoc, endLoc) {
		super();
		this.tokens = tokens;
		this.index = getLastIndex(tokens, indexMap, endLoc);
		this.indexEnd = getFirstIndex(tokens, indexMap, startLoc);
	}
	/** @inheritdoc */
	moveNext() {
		if (this.index >= this.indexEnd) {
			this.current = this.tokens[this.index];
			this.index -= 1;
			return true;
		}
		return false;
	}
	/** @inheritdoc */
	getOneToken() {
		return this.index >= this.indexEnd ? this.tokens[this.index] : null;
	}
};

//#endregion
//#region src/external/token-store/cursors/decorative-cursor.ts
/**
* @fileoverview Define the abstract class about cursors which manipulate another cursor.
* @author Toru Nagashima
*/
/**
* The abstract class about cursors which manipulate another cursor.
*/
var DecorativeCursor = class extends Cursor {
	cursor;
	/**
	* Initializes this cursor.
	* @param cursor - The cursor to be decorated.
	*/
	constructor(cursor) {
		super();
		this.cursor = cursor;
	}
	/** @inheritdoc */
	moveNext() {
		const retv = this.cursor.moveNext();
		this.current = this.cursor.current;
		return retv;
	}
};

//#endregion
//#region src/external/token-store/cursors/filter-cursor.ts
/**
* The decorative cursor which ignores specified tokens.
*/
var FilterCursor = class extends DecorativeCursor {
	predicate;
	/**
	* Initializes this cursor.
	* @param cursor - The cursor to be decorated.
	* @param predicate - The predicate function to decide tokens this cursor iterates.
	*/
	constructor(cursor, predicate) {
		super(cursor);
		this.predicate = predicate;
	}
	/** @inheritdoc */
	moveNext() {
		const predicate = this.predicate;
		while (super.moveNext()) if (predicate(this.current)) return true;
		return false;
	}
};

//#endregion
//#region src/external/token-store/cursors/forward-token-comment-cursor.ts
/**
* The cursor which iterates tokens and comments.
*/
var ForwardTokenCommentCursor = class extends Cursor {
	tokens;
	comments;
	tokenIndex;
	commentIndex;
	border;
	/**
	* Initializes this cursor.
	* @param tokens - The array of tokens.
	* @param comments - The array of comments.
	* @param indexMap - The map from locations to indices in `tokens`.
	* @param startLoc - The start location of the iteration range.
	* @param endLoc - The end location of the iteration range.
	*/
	constructor(tokens, comments, indexMap, startLoc, endLoc) {
		super();
		this.tokens = tokens;
		this.comments = comments;
		this.tokenIndex = getFirstIndex(tokens, indexMap, startLoc);
		this.commentIndex = search(comments, startLoc);
		this.border = endLoc;
	}
	/** @inheritdoc */
	moveNext() {
		const token = this.tokenIndex < this.tokens.length ? this.tokens[this.tokenIndex] : null;
		const comment = this.commentIndex < this.comments.length ? this.comments[this.commentIndex] : null;
		if (token && (!comment || token.range[0] < comment.range[0])) {
			this.current = token;
			this.tokenIndex += 1;
		} else if (comment) {
			this.current = comment;
			this.commentIndex += 1;
		} else this.current = null;
		return this.current != null && (this.border === -1 || this.current.range[1] <= this.border);
	}
};

//#endregion
//#region src/external/token-store/cursors/forward-token-cursor.ts
/**
* The cursor which iterates tokens only.
*/
var ForwardTokenCursor = class extends Cursor {
	tokens;
	index;
	indexEnd;
	/**
	* Initializes this cursor.
	* @param tokens - The array of tokens.
	* @param comments - The array of comments.
	* @param indexMap - The map from locations to indices in `tokens`.
	* @param startLoc - The start location of the iteration range.
	* @param endLoc - The end location of the iteration range.
	*/
	constructor(tokens, _comments, indexMap, startLoc, endLoc) {
		super();
		this.tokens = tokens;
		this.index = getFirstIndex(tokens, indexMap, startLoc);
		this.indexEnd = getLastIndex(tokens, indexMap, endLoc);
	}
	/** @inheritdoc */
	moveNext() {
		if (this.index <= this.indexEnd) {
			this.current = this.tokens[this.index];
			this.index += 1;
			return true;
		}
		return false;
	}
	/** @inheritdoc */
	getOneToken() {
		return this.index <= this.indexEnd ? this.tokens[this.index] : null;
	}
	/** @inheritdoc */
	getAllTokens() {
		return this.tokens.slice(this.index, this.indexEnd + 1);
	}
};

//#endregion
//#region src/external/token-store/cursors/limit-cursor.ts
/**
* The decorative cursor which limits the number of tokens.
*/
var LimitCursor = class extends DecorativeCursor {
	count;
	/**
	* Initializes this cursor.
	* @param cursor - The cursor to be decorated.
	* @param count - The count of tokens this cursor iterates.
	*/
	constructor(cursor, count) {
		super(cursor);
		this.count = count;
	}
	/** @inheritdoc */
	moveNext() {
		if (this.count > 0) {
			this.count -= 1;
			return super.moveNext();
		}
		return false;
	}
};

//#endregion
//#region src/external/token-store/cursors/skip-cursor.ts
/**
* The decorative cursor which ignores the first few tokens.
*/
var SkipCursor = class extends DecorativeCursor {
	count;
	/**
	* Initializes this cursor.
	* @param cursor - The cursor to be decorated.
	* @param count - The count of tokens this cursor skips.
	*/
	constructor(cursor, count) {
		super(cursor);
		this.count = count;
	}
	/** @inheritdoc */
	moveNext() {
		while (this.count > 0) {
			this.count -= 1;
			if (!super.moveNext()) return false;
		}
		return super.moveNext();
	}
};

//#endregion
//#region src/external/token-store/cursors/index.ts
/**
* The cursor factory.
* @private
*/
var CursorFactory = class {
	TokenCursor;
	TokenCommentCursor;
	/**
	* Initializes this cursor.
	* @param TokenCursor - The class of the cursor which iterates tokens only.
	* @param TokenCommentCursor - The class of the cursor which iterates the mix of tokens and comments.
	*/
	constructor(TokenCursor, TokenCommentCursor) {
		this.TokenCursor = TokenCursor;
		this.TokenCommentCursor = TokenCommentCursor;
	}
	/**
	* Creates a base cursor instance that can be decorated by createCursor.
	*
	* @param tokens - The array of tokens.
	* @param comments - The array of comments.
	* @param indexMap - The map from locations to indices in `tokens`.
	* @param startLoc - The start location of the iteration range.
	* @param endLoc - The end location of the iteration range.
	* @param includeComments - The flag to iterate comments as well.
	* @returns The created base cursor.
	*/
	createBaseCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments) {
		return new (includeComments ? this.TokenCommentCursor : this.TokenCursor)(tokens, comments, indexMap, startLoc, endLoc);
	}
	/**
	* Creates a cursor that iterates tokens with normalized options.
	*
	* @param tokens - The array of tokens.
	* @param comments - The array of comments.
	* @param indexMap - The map from locations to indices in `tokens`.
	* @param startLoc - The start location of the iteration range.
	* @param endLoc - The end location of the iteration range.
	* @param includeComments - The flag to iterate comments as well.
	* @param filter - The predicate function to choose tokens.
	* @param skip - The count of tokens the cursor skips.
	* @param count - The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility.
	* @returns The created cursor.
	*/
	createCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments, filter, skip, count) {
		let cursor = this.createBaseCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments);
		if (filter) cursor = new FilterCursor(cursor, filter);
		if (skip >= 1) cursor = new SkipCursor(cursor, skip);
		if (count >= 0) cursor = new LimitCursor(cursor, count);
		return cursor;
	}
};
const forward = new CursorFactory(ForwardTokenCursor, ForwardTokenCommentCursor);
const backward = new CursorFactory(BackwardTokenCursor, BackwardTokenCommentCursor);

//#endregion
//#region src/external/token-store/cursors/padded-token-cursor.ts
/**
* The cursor which iterates tokens only, with inflated range.
* This is for the backward compatibility of padding options.
*/
var PaddedTokenCursor = class extends ForwardTokenCursor {
	/**
	* Initializes this cursor.
	* @param tokens - The array of tokens.
	* @param comments - The array of comments.
	* @param indexMap - The map from locations to indices in `tokens`.
	* @param startLoc - The start location of the iteration range.
	* @param endLoc - The end location of the iteration range.
	* @param beforeCount - The number of tokens this cursor iterates before start.
	* @param afterCount - The number of tokens this cursor iterates after end.
	*/
	constructor(tokens, comments, indexMap, startLoc, endLoc, beforeCount, afterCount) {
		super(tokens, comments, indexMap, startLoc, endLoc);
		this.index = Math.max(0, this.index - beforeCount);
		this.indexEnd = Math.min(tokens.length - 1, this.indexEnd + afterCount);
	}
};

//#endregion
//#region src/external/token-store/index.ts
/**
* @fileoverview Object to handle access and retrieval of tokens.
* @author Brandon Mills
*/
/**
* Check whether the given token is a comment token or not.
* @param token The token to check.
* @returns `true` if the token is a comment token.
*/
function isCommentToken(token) {
	return token.type === "Line" || token.type === "Block" || token.type === "Shebang";
}
/**
* Creates the map from locations to indices in `tokens`.
*
* The first/last location of tokens is mapped to the index of the token.
* The first/last location of comments is mapped to the index of the next token of each comment.
*
* @param tokens - The array of tokens.
* @param comments - The array of comments.
* @returns The map from locations to indices in `tokens`.
* @private
*/
function createIndexMap(tokens, comments) {
	const map = Object.create(null);
	let tokenIndex = 0;
	let commentIndex = 0;
	let nextStart = 0;
	let range = null;
	while (tokenIndex < tokens.length || commentIndex < comments.length) {
		nextStart = commentIndex < comments.length ? comments[commentIndex].range[0] : Number.MAX_SAFE_INTEGER;
		while (tokenIndex < tokens.length && (range = tokens[tokenIndex].range)[0] < nextStart) {
			map[range[0]] = tokenIndex;
			map[range[1] - 1] = tokenIndex;
			tokenIndex += 1;
		}
		nextStart = tokenIndex < tokens.length ? tokens[tokenIndex].range[0] : Number.MAX_SAFE_INTEGER;
		while (commentIndex < comments.length && (range = comments[commentIndex].range)[0] < nextStart) {
			map[range[0]] = tokenIndex;
			map[range[1] - 1] = tokenIndex;
			commentIndex += 1;
		}
	}
	return map;
}
/**
* Creates the cursor iterates tokens with options.
*
* @param factory - The cursor factory to initialize cursor.
* @param tokens - The array of tokens.
* @param comments - The array of comments.
* @param indexMap - The map from locations to indices in `tokens`.
* @param startLoc - The start location of the iteration range.
* @param endLoc - The end location of the iteration range.
* @param opts - The option object. If this is a number then it's `opts.skip`. If this is a function then it's `opts.filter`.
* @returns The created cursor.
* @private
*/
function createCursorWithSkip(factory, tokens, comments, indexMap, startLoc, endLoc, opts) {
	let includeComments = false;
	let skip = 0;
	let filter = null;
	if (typeof opts === "number") skip = opts | 0;
	else if (typeof opts === "function") filter = opts;
	else if (opts) {
		includeComments = Boolean(opts.includeComments);
		skip = opts.skip || 0;
		filter = opts.filter || null;
	}
	(0, assert.default)(skip >= 0, "options.skip should be zero or a positive integer.");
	(0, assert.default)(!filter || typeof filter === "function", "options.filter should be a function.");
	return factory.createCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments, filter, skip, -1);
}
/**
* Creates the cursor iterates tokens with options.
*
* @param factory - The cursor factory to initialize cursor.
* @param tokens - The array of tokens.
* @param comments - The array of comments.
* @param indexMap - The map from locations to indices in `tokens`.
* @param startLoc - The start location of the iteration range.
* @param endLoc - The end location of the iteration range.
* @param opts - The option object. If this is a number then it's `opts.count`. If this is a function then it's `opts.filter`.
* @returns The created cursor.
* @private
*/
function createCursorWithCount(factory, tokens, comments, indexMap, startLoc, endLoc, opts) {
	let includeComments = false;
	let count = 0;
	let countExists = false;
	let filter = null;
	if (typeof opts === "number") {
		count = opts | 0;
		countExists = true;
	} else if (typeof opts === "function") filter = opts;
	else if (opts) {
		includeComments = Boolean(opts.includeComments);
		count = opts.count || 0;
		countExists = typeof opts.count === "number";
		filter = opts.filter || null;
	}
	(0, assert.default)(count >= 0, "options.count should be zero or a positive integer.");
	(0, assert.default)(!filter || typeof filter === "function", "options.filter should be a function.");
	return factory.createCursor(tokens, comments, indexMap, startLoc, endLoc, includeComments, filter, 0, countExists ? count : -1);
}
/**
* Creates the cursor iterates tokens with options.
*
* @param tokens - The array of tokens.
* @param comments - The array of comments.
* @param indexMap - The map from locations to indices in `tokens`.
* @param startLoc - The start location of the iteration range.
* @param endLoc - The end location of the iteration range.
* @param beforeCount - The number of tokens before the node to retrieve.
* @param afterCount - The number of tokens after the node to retrieve.
* @returns The created cursor.
* @private
*/
function createCursorWithPadding(tokens, comments, indexMap, startLoc, endLoc, beforeCount, afterCount) {
	if (typeof beforeCount === "undefined" && typeof afterCount === "undefined") return new ForwardTokenCursor(tokens, comments, indexMap, startLoc, endLoc);
	if (typeof beforeCount === "number" || typeof beforeCount === "undefined") return new PaddedTokenCursor(tokens, comments, indexMap, startLoc, endLoc, beforeCount || 0, afterCount || 0);
	return createCursorWithCount(forward, tokens, comments, indexMap, startLoc, endLoc, beforeCount);
}
/**
* Gets comment tokens that are adjacent to the current cursor position.
* @param cursor - A cursor instance.
* @returns An array of comment tokens adjacent to the current cursor position.
* @private
*/
function getAdjacentCommentTokensFromCursor(cursor) {
	const tokens = [];
	let currentToken = cursor.getOneToken();
	while (currentToken && isCommentToken(currentToken)) {
		tokens.push(currentToken);
		currentToken = cursor.getOneToken();
	}
	return tokens;
}
/**
* The token store.
*
* This class provides methods to get tokens by locations as fast as possible.
* The methods are a part of public API, so we should be careful if it changes this class.
*
* People can get tokens in O(1) by the hash map which is mapping from the location of tokens/comments to tokens.
* Also people can get a mix of tokens and comments in O(log k), the k is the number of comments.
* Assuming that comments to be much fewer than tokens, this does not make hash map from token's locations to comments to reduce memory cost.
* This uses binary-searching instead for comments.
*/
var TokenStore = class {
	_tokens;
	_comments;
	_indexMap;
	/**
	* Initializes this token store.
	* @param tokens - The array of tokens.
	* @param comments - The array of comments.
	*/
	constructor(tokens, comments) {
		this._tokens = tokens;
		this._comments = comments;
		this._indexMap = createIndexMap(tokens, comments);
	}
	/**
	* Gets the token starting at the specified index.
	* @param offset - Index of the start of the token's range.
	* @param options - The option object.
	* @returns The token starting at index, or null if no such token.
	*/
	getTokenByRangeStart(offset, options) {
		const includeComments = Boolean(options && options.includeComments);
		const token = forward.createBaseCursor(this._tokens, this._comments, this._indexMap, offset, -1, includeComments).getOneToken();
		if (token?.range[0] === offset) return token;
		return null;
	}
	/**
	* Gets the first token of the given node.
	* @param node - The AST node.
	* @param options - The option object.
	* @returns An object representing the token.
	*/
	getFirstToken(node, options) {
		return createCursorWithSkip(forward, this._tokens, this._comments, this._indexMap, node.range[0], node.range[1], options).getOneToken();
	}
	/**
	* Gets the last token of the given node.
	* @param node - The AST node.
	* @param options - The option object.
	* @returns An object representing the token.
	*/
	getLastToken(node, options) {
		return createCursorWithSkip(backward, this._tokens, this._comments, this._indexMap, node.range[0], node.range[1], options).getOneToken();
	}
	/**
	* Gets the token that precedes a given node or token.
	* @param node - The AST node or token.
	* @param options - The option object.
	* @returns An object representing the token.
	*/
	getTokenBefore(node, options) {
		return createCursorWithSkip(backward, this._tokens, this._comments, this._indexMap, -1, node.range[0], options).getOneToken();
	}
	/**
	* Gets the token that follows a given node or token.
	* @param node - The AST node or token.
	* @param options - The option object.
	* @returns An object representing the token.
	*/
	getTokenAfter(node, options) {
		return createCursorWithSkip(forward, this._tokens, this._comments, this._indexMap, node.range[1], -1, options).getOneToken();
	}
	/**
	* Gets the first token between two non-overlapping nodes.
	* @param left - Node before the desired token range.
	* @param right - Node after the desired token range.
	* @param options - The option object.
	* @returns An object representing the token.
	*/
	getFirstTokenBetween(left, right, options) {
		return createCursorWithSkip(forward, this._tokens, this._comments, this._indexMap, left.range[1], right.range[0], options).getOneToken();
	}
	/**
	* Gets the last token between two non-overlapping nodes.
	* @param left Node before the desired token range.
	* @param right Node after the desired token range.
	* @param options - The option object.
	* @returns An object representing the token.
	*/
	getLastTokenBetween(left, right, options) {
		return createCursorWithSkip(backward, this._tokens, this._comments, this._indexMap, left.range[1], right.range[0], options).getOneToken();
	}
	/**
	* Gets the token that precedes a given node or token in the token stream.
	* This is defined for backward compatibility. Use `includeComments` option instead.
	* TODO: We have a plan to remove this in a future major version.
	* @param node The AST node or token.
	* @param skip A number of tokens to skip.
	* @returns An object representing the token.
	* @deprecated
	*/
	getTokenOrCommentBefore(node, skip) {
		return this.getTokenBefore(node, {
			includeComments: true,
			skip
		});
	}
	/**
	* Gets the token that follows a given node or token in the token stream.
	* This is defined for backward compatibility. Use `includeComments` option instead.
	* TODO: We have a plan to remove this in a future major version.
	* @param node The AST node or token.
	* @param skip A number of tokens to skip.
	* @returns An object representing the token.
	* @deprecated
	*/
	getTokenOrCommentAfter(node, skip) {
		return this.getTokenAfter(node, {
			includeComments: true,
			skip
		});
	}
	/**
	* Gets the first `count` tokens of the given node.
	* @param node - The AST node.
	* @param [options=0] - The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
	* @param [options.includeComments=false] - The flag to iterate comments as well.
	* @param [options.filter=null] - The predicate function to choose tokens.
	* @param [options.count=0] - The maximum count of tokens the cursor iterates.
	* @returns Tokens.
	*/
	getFirstTokens(node, options) {
		return createCursorWithCount(forward, this._tokens, this._comments, this._indexMap, node.range[0], node.range[1], options).getAllTokens();
	}
	/**
	* Gets the last `count` tokens of the given node.
	* @param node - The AST node.
	* @param [options=0] - The option object. Same options as getFirstTokens()
	* @returns Tokens.
	*/
	getLastTokens(node, options) {
		return createCursorWithCount(backward, this._tokens, this._comments, this._indexMap, node.range[0], node.range[1], options).getAllTokens().reverse();
	}
	/**
	* Gets the `count` tokens that precedes a given node or token.
	* @param node - The AST node or token.
	* @param [options=0] - The option object. Same options as getFirstTokens()
	* @returns Tokens.
	*/
	getTokensBefore(node, options) {
		return createCursorWithCount(backward, this._tokens, this._comments, this._indexMap, -1, node.range[0], options).getAllTokens().reverse();
	}
	/**
	* Gets the `count` tokens that follows a given node or token.
	* @param node - The AST node or token.
	* @param [options=0] - The option object. Same options as getFirstTokens()
	* @returns Tokens.
	*/
	getTokensAfter(node, options) {
		return createCursorWithCount(forward, this._tokens, this._comments, this._indexMap, node.range[1], -1, options).getAllTokens();
	}
	/**
	* Gets the first `count` tokens between two non-overlapping nodes.
	* @param left - Node before the desired token range.
	* @param right - Node after the desired token range.
	* @param [options=0] - The option object. Same options as getFirstTokens()
	* @returns Tokens between left and right.
	*/
	getFirstTokensBetween(left, right, options) {
		return createCursorWithCount(forward, this._tokens, this._comments, this._indexMap, left.range[1], right.range[0], options).getAllTokens();
	}
	/**
	* Gets the last `count` tokens between two non-overlapping nodes.
	* @param left Node before the desired token range.
	* @param right Node after the desired token range.
	* @param [options=0] - The option object. Same options as getFirstTokens()
	* @returns Tokens between left and right.
	*/
	getLastTokensBetween(left, right, options) {
		return createCursorWithCount(backward, this._tokens, this._comments, this._indexMap, left.range[1], right.range[0], options).getAllTokens().reverse();
	}
	/**
	* Gets all tokens that are related to the given node.
	* @param node - The AST node.
	* @param beforeCount - The number of tokens before the node to retrieve.
	* @param afterCount - The number of tokens after the node to retrieve.
	* @returns Array of objects representing tokens.
	*/
	getTokens(node, beforeCount, afterCount) {
		return createCursorWithPadding(this._tokens, this._comments, this._indexMap, node.range[0], node.range[1], beforeCount, afterCount).getAllTokens();
	}
	/**
	* Gets all of the tokens between two non-overlapping nodes.
	* @param left Node before the desired token range.
	* @param right Node after the desired token range.
	* @param padding Number of extra tokens on either side of center.
	* @returns Tokens between left and right.
	*/
	getTokensBetween(left, right, padding) {
		return createCursorWithPadding(this._tokens, this._comments, this._indexMap, left.range[1], right.range[0], padding, typeof padding === "number" ? padding : void 0).getAllTokens();
	}
	/**
	* Checks whether any comments exist or not between the given 2 nodes.
	*
	* @param left - The node to check.
	* @param right - The node to check.
	* @returns `true` if one or more comments exist.
	*/
	commentsExistBetween(left, right) {
		const index = search(this._comments, left.range[1]);
		return index < this._comments.length && this._comments[index].range[1] <= right.range[0];
	}
	/**
	* Gets all comment tokens directly before the given node or token.
	* @param nodeOrToken The AST node or token to check for adjacent comment tokens.
	* @returns An array of comments in occurrence order.
	*/
	getCommentsBefore(nodeOrToken) {
		return getAdjacentCommentTokensFromCursor(createCursorWithCount(backward, this._tokens, this._comments, this._indexMap, -1, nodeOrToken.range[0], { includeComments: true })).reverse();
	}
	/**
	* Gets all comment tokens directly after the given node or token.
	* @param nodeOrToken The AST node or token to check for adjacent comment tokens.
	* @returns An array of comments in occurrence order.
	*/
	getCommentsAfter(nodeOrToken) {
		return getAdjacentCommentTokensFromCursor(createCursorWithCount(forward, this._tokens, this._comments, this._indexMap, nodeOrToken.range[1], -1, { includeComments: true }));
	}
	/**
	* Gets all comment tokens inside the given node.
	* @param node The AST node to get the comments for.
	* @returns An array of comments in occurrence order.
	*/
	getCommentsInside(node) {
		return this.getTokens(node, {
			includeComments: true,
			filter: isCommentToken
		});
	}
	/**
	* Returns the location of the given node or token.
	* @param nodeOrToken The node or token to get the location of.
	* @returns The location of the node or token.
	*/
	getLoc(nodeOrToken) {
		return nodeOrToken.loc;
	}
	/**
	* Returns the range of the given node or token.
	* @param nodeOrToken The node or token to get the range of.
	* @returns The range of the node or token.
	*/
	getRange(nodeOrToken) {
		return nodeOrToken.range;
	}
};

//#endregion
//#region src/sfc/custom-block/index.ts
/**
* Checks whether the given node is VElement.
*/
function isVElement(node) {
	return node.type === "VElement";
}
/**
* Get the all custom blocks from given document
* @param document
*/
function getCustomBlocks(document) {
	return document ? document.children.filter(isVElement).filter((block) => block.name !== "script" && block.name !== "template" && block.name !== "style") : [];
}
/**
* Parse the source code of the given custom block element.
* @param node The custom block element to parse.
* @param parser The custom parser.
* @param globalLocationCalculator The location calculator for fixLocations.
* @param parserOptions The parser options.
* @returns The result of parsing.
*/
function parseCustomBlockElement(node, parser, globalLocationCalculator, parserOptions) {
	const text = node.children[0];
	const { code, range, loc } = text?.type === "VText" ? {
		code: text.value,
		range: text.range,
		loc: text.loc
	} : {
		code: "",
		range: [node.startTag.range[1], node.endTag.range[0]],
		loc: {
			start: node.startTag.loc.end,
			end: node.endTag.loc.start
		}
	};
	const locationCalculator = globalLocationCalculator.getSubCalculatorAfter(range[0]);
	try {
		return parseCustomBlockFragment(code, parser, locationCalculator, parserOptions);
	} catch (e) {
		if (!(e instanceof Error)) throw e;
		return {
			error: e,
			ast: {
				type: "Program",
				sourceType: "module",
				loc: {
					start: { ...loc.start },
					end: { ...loc.end }
				},
				range: [...range],
				body: [],
				tokens: [],
				comments: []
			}
		};
	}
}
/**
* Parse the given source code.
*
* @param code The source code to parse.
* @param parser The custom parser.
* @param locationCalculator The location calculator for fixLocations.
* @param parserOptions The parser options.
* @returns The result of parsing.
*/
function parseCustomBlockFragment(code, parser, locationCalculator, parserOptions) {
	try {
		const result = parseBlock(code, parser, {
			ecmaVersion: DEFAULT_ECMA_VERSION,
			loc: true,
			range: true,
			raw: true,
			tokens: true,
			comment: true,
			eslintVisitorKeys: true,
			eslintScopeManager: true,
			...parserOptions
		});
		fixLocations(result, locationCalculator);
		return result;
	} catch (err) {
		const perr = ParseError.normalize(err);
		if (perr) {
			fixErrorLocation(perr, locationCalculator);
			throw perr;
		}
		throw err;
	}
}
function parseBlock(code, parser, parserOptions) {
	const result = isEnhancedParserObject(parser) ? parser.parseForESLint(code, parserOptions) : parser.parse(code, parserOptions);
	if (result.ast != null) return result;
	return { ast: result };
}
/**
* Create shared context.
*
* @param text The source code of SFC.
* @param customBlock The custom block node.
* @param parsedResult The parse result data
* @param parserOptions The parser options.
*/
function createCustomBlockSharedContext({ text, customBlock, parsedResult, globalLocationCalculator, parserOptions }) {
	let sourceCode;
	let currentNode;
	return {
		serCurrentNode(node) {
			currentNode = node;
		},
		context: {
			getAncestors: () => getSourceCode().getAncestors(currentNode),
			getDeclaredVariables: (...args) => getSourceCode().getDeclaredVariables(...args),
			getScope: () => getSourceCode().getScope(currentNode),
			markVariableAsUsed: (name) => getSourceCode().markVariableAsUsed(name, currentNode),
			get parserServices() {
				return getSourceCode().parserServices;
			},
			getSourceCode,
			get sourceCode() {
				return getSourceCode();
			}
		}
	};
	function getSourceCode() {
		if (sourceCode) return sourceCode;
		const scopeManager = getScopeManager();
		const originalSourceCode = new (require("eslint")).SourceCode({
			text,
			ast: parsedResult.ast,
			parserServices: {
				customBlock,
				parseCustomBlockElement(parser, options) {
					return parseCustomBlockElement(customBlock, parser, globalLocationCalculator, {
						...parserOptions,
						...options
					});
				},
				...parsedResult.services,
				...parsedResult.error ? { parseError: parsedResult.error } : {}
			},
			scopeManager,
			visitorKeys: parsedResult.visitorKeys
		});
		const polyfills = {
			markVariableAsUsed: (name, node) => markVariableAsUsed(scopeManager, node, parsedResult.ast, name),
			getScope: (node) => getScope(scopeManager, node),
			getAncestors: (node) => getAncestors(node),
			getDeclaredVariables: (...args) => scopeManager.getDeclaredVariables(...args)
		};
		return sourceCode = new Proxy(originalSourceCode, { get(_target, prop) {
			return originalSourceCode[prop] || polyfills[prop];
		} });
	}
	function getScopeManager() {
		if (parsedResult.scopeManager) return parsedResult.scopeManager;
		const ecmaVersion = getEcmaVersionIfUseEspree(parserOptions) ?? ANALYZE_SCOPE_DEFAULT_ECMA_VERSION;
		const ecmaFeatures = parserOptions.ecmaFeatures ?? {};
		const sourceType = parserOptions.sourceType ?? "script";
		return getEslintScope().analyze(parsedResult.ast, {
			ignoreEval: true,
			nodejsScope: false,
			impliedStrict: ecmaFeatures.impliedStrict,
			ecmaVersion,
			sourceType,
			fallback: getFallbackKeys
		});
	}
}
/**
* Gets all the ancestors of a given node
* @param {ASTNode} node The node
* @returns {ASTNode[]} All the ancestor nodes in the AST, not including the provided node, starting
* from the root node and going inwards to the parent node.
*/
function getAncestors(node) {
	const ancestorsStartingAtParent = [];
	for (let ancestor = node.parent; ancestor; ancestor = ancestor.parent) ancestorsStartingAtParent.push(ancestor);
	return ancestorsStartingAtParent.reverse();
}
/**
* Gets the scope for the current node
* @param {ScopeManager} scopeManager The scope manager for this AST
* @param {ASTNode} currentNode The node to get the scope of
* @returns {eslint-scope.Scope} The scope information for this node
*/
function getScope(scopeManager, currentNode) {
	const inner = currentNode.type !== "Program";
	for (let node = currentNode; node; node = node.parent ?? null) {
		const scope = scopeManager.acquire(node, inner);
		if (scope) {
			if (scope.type === "function-expression-name") return scope.childScopes[0];
			return scope;
		}
	}
	return scopeManager.scopes[0];
}
/**
* Marks a variable as used in the current scope
* @param {ScopeManager} scopeManager The scope manager for this AST. The scope may be mutated by this function.
* @param {ASTNode} currentNode The node currently being traversed
* @param {Object} parserOptions The options used to parse this text
* @param {string} name The name of the variable that should be marked as used.
* @returns {boolean} True if the variable was found and marked as used, false if not.
*/
function markVariableAsUsed(scopeManager, currentNode, program, name) {
	const currentScope = getScope(scopeManager, currentNode);
	let initialScope = currentScope;
	if (currentScope.type === "global" && currentScope.childScopes.length > 0 && currentScope.childScopes[0].block === program) initialScope = currentScope.childScopes[0];
	for (let scope = initialScope; scope; scope = scope.upper) {
		const variable = scope.variables.find((scopeVar) => scopeVar.name === name);
		if (variable) {
			variable.eslintUsed = true;
			return true;
		}
	}
	return false;
}

//#endregion
//#region src/parser-services.ts
/**
* Define the parser service
* @param rootAST
*/
function define(sourceText, rootAST, document, globalLocationCalculator, { parserOptions }) {
	const templateBodyEmitters = /* @__PURE__ */ new Map();
	const stores = /* @__PURE__ */ new WeakMap();
	const documentEmitters = /* @__PURE__ */ new Map();
	const customBlocksEmitters = /* @__PURE__ */ new Map();
	const isSFC = isSFCFile(parserOptions);
	return {
		defineTemplateBodyVisitor(templateBodyVisitor, scriptVisitor, options) {
			if (scriptVisitor == null) scriptVisitor = {};
			if (rootAST.templateBody == null) return scriptVisitor;
			const templateBodyTriggerSelector = options?.templateBodyTriggerSelector ?? "Program:exit";
			let emitter = templateBodyEmitters.get(templateBodyTriggerSelector);
			if (emitter == null) {
				emitter = new events.default();
				emitter.setMaxListeners(0);
				templateBodyEmitters.set(templateBodyTriggerSelector, emitter);
				const programExitHandler = scriptVisitor[templateBodyTriggerSelector];
				scriptVisitor[templateBodyTriggerSelector] = (node) => {
					try {
						if (typeof programExitHandler === "function") programExitHandler(node);
						const generator = new NodeEventGenerator(emitter, {
							visitorKeys: KEYS,
							fallback: getFallbackKeys
						});
						traverseNodes(rootAST.templateBody, generator);
					} finally {
						scriptVisitor[templateBodyTriggerSelector] = programExitHandler;
						templateBodyEmitters.delete(templateBodyTriggerSelector);
					}
				};
			}
			for (const selector of Object.keys(templateBodyVisitor)) emitter.on(selector, templateBodyVisitor[selector]);
			return scriptVisitor;
		},
		defineDocumentVisitor(documentVisitor, options) {
			const scriptVisitor = {};
			if (!document) return scriptVisitor;
			const documentTriggerSelector = options?.triggerSelector ?? "Program:exit";
			let emitter = documentEmitters.get(documentTriggerSelector);
			if (emitter == null) {
				emitter = new events.default();
				emitter.setMaxListeners(0);
				documentEmitters.set(documentTriggerSelector, emitter);
				const programExitHandler = scriptVisitor[documentTriggerSelector];
				scriptVisitor[documentTriggerSelector] = (node) => {
					try {
						if (typeof programExitHandler === "function") programExitHandler(node);
						traverseNodes(document, new NodeEventGenerator(emitter, {
							visitorKeys: KEYS,
							fallback: getFallbackKeys
						}));
					} finally {
						scriptVisitor[documentTriggerSelector] = programExitHandler;
						documentEmitters.delete(documentTriggerSelector);
					}
				};
			}
			for (const selector of Object.keys(documentVisitor)) emitter.on(selector, documentVisitor[selector]);
			return scriptVisitor;
		},
		defineCustomBlocksVisitor(context, parser, rule, scriptVisitor) {
			if (scriptVisitor == null) scriptVisitor = {};
			if (!isSFC) return scriptVisitor;
			parserOptions = { ...parserOptions };
			const customBlocks = getCustomBlocks(document).filter((block) => block.endTag && !block.startTag.attributes.some((attr) => !attr.directive && attr.key.name === "src"));
			if (!customBlocks.length || globalLocationCalculator == null) return {};
			const key = parser.parseForESLint ?? parser.parse;
			let factories = customBlocksEmitters.get(key);
			if (factories == null) {
				factories = [];
				customBlocksEmitters.set(key, factories);
				const visitorFactories = factories;
				const programExitHandler = scriptVisitor["Program:exit"];
				scriptVisitor["Program:exit"] = (node) => {
					try {
						if (typeof programExitHandler === "function") programExitHandler(node);
						for (const customBlock of customBlocks) {
							const lang = getLang(customBlock);
							const activeVisitorFactories = visitorFactories.filter((f) => f.test(lang, customBlock));
							if (!activeVisitorFactories.length) continue;
							const parsedResult = parseCustomBlockElement(customBlock, parser, globalLocationCalculator, parserOptions);
							const { serCurrentNode, context: customBlockContext } = createCustomBlockSharedContext({
								text: sourceText,
								customBlock,
								parsedResult,
								globalLocationCalculator,
								parserOptions
							});
							const emitter = new events.default();
							emitter.setMaxListeners(0);
							for (const factory of activeVisitorFactories) {
								const ctx = { ...customBlockContext };
								ctx.__proto__ = factory.context;
								const visitor = factory.create(ctx);
								for (const selector of Object.keys(visitor ?? {})) emitter.on(selector, visitor[selector]);
							}
							const generator = new NodeEventGenerator(emitter, {
								visitorKeys: parsedResult.visitorKeys,
								fallback: getFallbackKeys
							});
							traverseNodes(parsedResult.ast, {
								visitorKeys: parsedResult.visitorKeys,
								enterNode(n) {
									serCurrentNode(n);
									generator.enterNode(n);
								},
								leaveNode(n) {
									serCurrentNode(n);
									generator.leaveNode(n);
								}
							});
						}
					} finally {
						scriptVisitor["Program:exit"] = programExitHandler;
						customBlocksEmitters.delete(key);
					}
				};
			}
			const target = rule.target;
			const test = typeof target === "function" ? target : Array.isArray(target) ? (lang) => Boolean(lang && target.includes(lang)) : (lang) => target === lang;
			factories.push({
				context,
				test,
				create: rule.create
			});
			return scriptVisitor;
		},
		getTemplateBodyTokenStore() {
			const key = document || stores;
			let store = stores.get(key);
			if (!store) {
				store = document != null ? new TokenStore(document.tokens, document.comments) : new TokenStore([], []);
				stores.set(key, store);
			}
			return store;
		},
		getDocumentFragment() {
			return document;
		}
	};
}

//#endregion
//#region src/script-setup/index.ts
/**
* `parseScriptSetupElements` rewrites the source code so that it can parse
* the combination of `<script>` and `<script setup>`, and parses it source code with JavaScript parser.
* This class holds the information to restore the AST and token locations parsed in the rewritten source code.
*/
var CodeBlocks = class {
	code;
	remapBlocks = [];
	splitPunctuators = [];
	constructor() {
		this.code = "";
	}
	get length() {
		return this.code.length;
	}
	append(codeLet, originalOffset) {
		const rangeStart = this.code.length;
		this.code += codeLet.trimEnd();
		this.remapBlocks.push({
			range: [rangeStart, this.code.length],
			offset: originalOffset - rangeStart
		});
	}
	appendSplitPunctuators(punctuator) {
		this.splitPunctuators.push(this.code.length, this.code.length + 1);
		this.code += `\n${punctuator}\n`;
	}
	appendCodeBlocks(codeBlocks) {
		const start = this.code.length;
		this.code += codeBlocks.code;
		this.remapBlocks.push(...codeBlocks.remapBlocks.map((b) => ({
			range: [b.range[0] + start, b.range[1] + start],
			offset: b.offset - start
		})));
		this.splitPunctuators.push(...codeBlocks.splitPunctuators.map((s) => s + start));
	}
};
/**
* Some named exports need to be replaced with a different syntax to successfully parse
* the combination of `<script>` and `<script setup>`.
* e.g. `export {a,b}` -> `({a,b});`, `export let a` -> `let a`
* This class holds the callbacks to restore the rewritten syntax AST back to the original `export` AST.
*/
var RestoreASTCallbacks = class {
	callbacks = [];
	addCallback(originalOffsetStart, range, callback) {
		this.callbacks.push({
			range: [originalOffsetStart + range[0], originalOffsetStart + range[1]],
			callback
		});
	}
	restore(program, scriptSetupStatements, linesAndColumns) {
		if (this.callbacks.length === 0) return;
		const callbacks = new Set(this.callbacks);
		for (const statement of scriptSetupStatements) for (const cb of callbacks) if (cb.range[0] <= statement.range[0] && statement.range[1] <= cb.range[1]) {
			const restored = cb.callback(statement);
			if (restored) {
				const removeIndex = program.body.indexOf(statement);
				if (removeIndex >= 0) {
					program.body.splice(removeIndex, 1);
					program.body.push(restored.statement);
					program.tokens.push(...restored.tokens);
					restored.statement.parent = program;
					callbacks.delete(cb);
					break;
				}
			}
		}
		if (callbacks.size) {
			const [cb] = callbacks;
			const loc = linesAndColumns.getLocFromIndex(cb.range[0]);
			throw new ParseError("Could not parse <script setup>. Failed to restore ExportNamedDeclaration.", void 0, cb.range[0], loc.line, loc.column);
		}
	}
};
function parseScript(code, parserOptions, locationCalculatorForError) {
	try {
		return parseScript$1(code, parserOptions);
	} catch (err) {
		const perr = ParseError.normalize(err);
		if (perr) {
			fixErrorLocation(perr, locationCalculatorForError);
			throw perr;
		}
		throw err;
	}
}
/**
* Parse the source code of the given `<script setup>` and `<script>` elements.
* @param scriptSetupElement The `<script setup>` element to parse.
* @param nodes The `<script>` elements to parse.
* @param sfcCode The source code of SFC.
* @param linesAndColumns The lines and columns location calculator.
* @param parserOptions The parser options.
* @returns The result of parsing.
*/
function parseScriptSetupElements(scriptSetupElement, scriptElement, sfcCode, linesAndColumns, originalParserOptions) {
	const parserOptions = {
		...originalParserOptions,
		ecmaVersion: originalParserOptions.ecmaVersion ?? DEFAULT_ECMA_VERSION
	};
	const scriptSetupModuleCodeBlocks = getScriptSetupModuleCodeBlocks(scriptSetupElement, scriptElement, sfcCode, linesAndColumns, parserOptions);
	if (!scriptSetupModuleCodeBlocks) return parseScriptFragment("", linesAndColumns.createOffsetLocationCalculator(scriptSetupElement.startTag.range[1]), parserOptions);
	const locationCalculator = {
		getFixOffset(offset, kind) {
			const test = kind === "start" ? (block) => block.range[0] <= offset && offset < block.range[1] : (block) => block.range[0] < offset && offset <= block.range[1];
			for (const block of scriptSetupModuleCodeBlocks.codeBlocks.remapBlocks) if (test(block)) return block.offset;
			return offset;
		},
		getLocFromIndex: linesAndColumns.getLocFromIndex.bind(linesAndColumns)
	};
	const result = parseScript(scriptSetupModuleCodeBlocks.codeBlocks.code, parserOptions, locationCalculator);
	if (scriptSetupModuleCodeBlocks.postprocess) scriptSetupModuleCodeBlocks.postprocess(result, { scriptSetupBlockRange: scriptSetupModuleCodeBlocks.scriptSetupBlockRange });
	const scriptSetupStatements = remapAST(result, scriptSetupModuleCodeBlocks);
	remapLocationAndTokens(result, scriptSetupModuleCodeBlocks, locationCalculator);
	if (scriptSetupModuleCodeBlocks.restoreASTCallbacks) scriptSetupModuleCodeBlocks.restoreASTCallbacks.restore(result.ast, scriptSetupStatements, linesAndColumns);
	if (result.ast.tokens != null) {
		for (const node of [scriptSetupElement, scriptElement]) {
			const startTag = node.startTag;
			const endTag = node.endTag;
			result.ast.tokens.unshift({
				type: "Punctuator",
				range: startTag.range,
				loc: startTag.loc,
				value: "<script>"
			});
			if (endTag != null) result.ast.tokens.push({
				type: "Punctuator",
				range: endTag.range,
				loc: endTag.loc,
				value: "<\/script>"
			});
		}
		result.ast.tokens.sort((a, b) => a.range[0] - b.range[0]);
	}
	if (result.ast.comments != null) result.ast.comments.sort((a, b) => a.range[0] - b.range[0]);
	result.ast.body.sort((a, b) => a.range[0] - b.range[0]);
	const programStartOffset = result.ast.body.reduce((start, node) => Math.min(start, node.range[0]), result.ast.range[0]);
	result.ast.range[0] = programStartOffset;
	result.ast.loc.start = locationCalculator.getLocFromIndex(programStartOffset);
	if (result.ast.start != null) result.ast.start = [scriptSetupElement, scriptElement].reduce((start, node) => {
		const textNode = node.children[0];
		return Math.min(start, textNode?.type === "VText" ? textNode.range[0] : node.startTag.range[1]);
	}, result.ast.start);
	const programEndOffset = result.ast.body.reduce((end, node) => Math.max(end, node.range[1]), 0);
	result.ast.range[1] = programEndOffset;
	result.ast.loc.end = locationCalculator.getLocFromIndex(programEndOffset);
	if (result.ast.end != null) result.ast.end = [scriptSetupElement, scriptElement].reduce((end, node) => {
		const textNode = node.children[0];
		return Math.max(end, textNode?.type === "VText" ? textNode.range[1] : node.endTag?.range[0] ?? node.range[1]);
	}, 0);
	return result;
}
/**
* Parses the scripts of the given `<script>` elements and returns
* the reconstructed source code as a parseable script.
* It also returns information for remapping the location.
*
* For examples, the script is reconstructed as follows.
*
* Example 1:
*
* ```vue
* <script>
* export let count = 42
* <\/script>
* <script setup>
* import MyComponent from './MyComponent.vue'
* let count = 42
* <\/script>
* ```
*
* ↓
*
* ```js
* export let count = 42
* ;
* import MyComponent from './MyComponent.vue';
* {
* let count = 42
* }
* ```
*
* Example 2:
*
* ```vue
* <script>
* export let count = 42
* <\/script>
* <script setup>
* import MyComponent1 from './MyComponent1.vue'
* let count = 42
* import MyComponent2 from './MyComponent2.vue'
* let a
* <\/script>
* ```
*
* ↓
*
* ```js
* export let count = 42
* ;
* import MyComponent1 from './MyComponent1.vue';
* import MyComponent2 from './MyComponent2.vue';
* {
* let count = 42;
* let a
* }
* ```
*
* Example 3:
*
* ```vue
* <script>
* export let count = 42
* export let count2 = 42
* <\/script>
* <script setup>
* import MyComponent1 from './MyComponent1.vue'
* let count = 42
* export {count as ns}
* export let count2 = 42
* count2++
* <\/script>
* ```
*
* ↓
*
* ```js
* export let count = 42
* export let count2 = 42
* ;
* import MyComponent1 from './MyComponent1.vue';
* {
* let count = 42;
* let a
* ;
* ({count})
* ;
* let count2 = 42
* ;
* count2++
* ;
* }
* ```
*/
function getScriptSetupModuleCodeBlocks(scriptSetupElement, scriptElement, sfcCode, linesAndColumns, parserOptions) {
	const scriptSetupCodeBlocks = getScriptSetupCodeBlocks(scriptSetupElement, sfcCode, linesAndColumns, parserOptions);
	const textNode = scriptElement.children[0];
	if (textNode == null || textNode.type !== "VText") return scriptSetupCodeBlocks;
	const [scriptStartOffset, scriptEndOffset] = textNode.range;
	const codeBlocks = new CodeBlocks();
	codeBlocks.append(sfcCode.slice(scriptStartOffset, scriptEndOffset), scriptStartOffset);
	if (scriptSetupCodeBlocks == null) return { codeBlocks };
	codeBlocks.appendSplitPunctuators(";");
	const scriptSetupOffset = codeBlocks.length;
	codeBlocks.appendCodeBlocks(scriptSetupCodeBlocks.codeBlocks);
	return {
		codeBlocks,
		scriptSetupBlockRange: [scriptSetupCodeBlocks.scriptSetupBlockRange[0] + scriptSetupOffset, scriptSetupCodeBlocks.scriptSetupBlockRange[1] + scriptSetupOffset],
		postprocess: scriptSetupCodeBlocks.postprocess,
		restoreASTCallbacks: scriptSetupCodeBlocks.restoreASTCallbacks
	};
}
/**
* Parses the script in the given `<script setup>` and returns the source code with
* the import blocks and other statements reconstructed.
* It also returns information for remapping the location.
*/
function getScriptSetupCodeBlocks(node, sfcCode, linesAndColumns, parserOptions) {
	const textNode = node.children[0];
	if (textNode == null || textNode.type !== "VText") return null;
	const [scriptSetupStartOffset, scriptSetupEndOffset] = textNode.range;
	const scriptCode = sfcCode.slice(scriptSetupStartOffset, scriptSetupEndOffset);
	const offsetLocationCalculator = linesAndColumns.createOffsetLocationCalculator(scriptSetupStartOffset);
	const { ast, visitorKeys } = parseScript(scriptCode, {
		...parserOptions,
		project: void 0,
		projectService: void 0
	}, offsetLocationCalculator);
	const importCodeBlocks = new CodeBlocks();
	const statementCodeBlocks = new CodeBlocks();
	const exportDefaultCodeBlocks = new CodeBlocks();
	const restoreASTCallbacks = new RestoreASTCallbacks();
	let usedOffset = 0;
	/**
	* Consume and append the given range of code to the given codeBlocks.
	*/
	function append(codeBlocks, start, end) {
		if (start < end) {
			codeBlocks.append(scriptCode.slice(start, end), scriptSetupStartOffset + start);
			usedOffset = end;
			return true;
		}
		return false;
	}
	/**
	* Append the given range of import or export statement to the given codeBlocks.
	*/
	function appendRangeAsStatement(codeBlocks, start, end) {
		if (append(codeBlocks, start, end)) codeBlocks.appendSplitPunctuators(";");
	}
	function transformExportNamed(body) {
		const [start, end] = getNodeFullRange(body);
		appendRangeAsStatement(statementCodeBlocks, usedOffset, start);
		const tokens = ast.tokens;
		const exportTokenIndex = tokens.findIndex((t) => t.range[0] === body.range[0]);
		const exportToken = tokens[exportTokenIndex];
		if (exportToken?.value === "export") {
			append(statementCodeBlocks, usedOffset, exportToken.range[0]);
			if (body.declaration) {
				appendRangeAsStatement(statementCodeBlocks, exportToken.range[1], end);
				restoreASTCallbacks.addCallback(scriptSetupStartOffset, [start, end], (statement) => {
					if (statement.type !== body.declaration.type) return null;
					fixNodeLocations(body, visitorKeys, offsetLocationCalculator);
					fixLocation(exportToken, offsetLocationCalculator);
					body.declaration = statement;
					statement.parent = body;
					return {
						statement: body,
						tokens: [exportToken]
					};
				});
			} else {
				statementCodeBlocks.appendSplitPunctuators("(");
				const restoreTokens = [exportToken];
				let startOffset = exportToken.range[1];
				for (const spec of body.specifiers) if (spec.local.range[0] < spec.exported.range[0]) {
					const localTokenIndex = tokens.findIndex((t) => t.range[0] === spec.local.range[0], exportTokenIndex);
					checkToken(tokens[localTokenIndex], spec.local.name);
					const asToken = tokens[localTokenIndex + 1];
					checkToken(asToken, "as");
					restoreTokens.push(asToken);
					const exportedToken = tokens[localTokenIndex + 2];
					checkToken(exportedToken, spec.exported.type === "Identifier" ? spec.exported.name : spec.exported.raw);
					restoreTokens.push(exportedToken);
					append(statementCodeBlocks, startOffset, asToken.range[0]);
					append(statementCodeBlocks, asToken.range[1], exportedToken.range[0]);
					startOffset = exportedToken.range[1];
				}
				append(statementCodeBlocks, startOffset, end);
				statementCodeBlocks.appendSplitPunctuators(")");
				statementCodeBlocks.appendSplitPunctuators(";");
				restoreASTCallbacks.addCallback(scriptSetupStartOffset, [start, end], (statement) => {
					if (statement.type !== "ExpressionStatement" || statement.expression.type !== "ObjectExpression") return null;
					const locals = [];
					for (const prop of statement.expression.properties) {
						if (prop.type !== "Property" || prop.value.type !== "Identifier") return null;
						locals.push(prop.value);
					}
					if (body.specifiers.length !== locals.length) return null;
					const map = /* @__PURE__ */ new Map();
					for (let index = 0; index < body.specifiers.length; index++) {
						const spec = body.specifiers[index];
						const local = locals[index];
						map.set(spec, local);
					}
					fixNodeLocations(body, visitorKeys, offsetLocationCalculator);
					for (const token of restoreTokens) fixLocation(token, offsetLocationCalculator);
					for (const [spec, local] of map) {
						spec.local = local;
						local.parent = spec;
					}
					return {
						statement: body,
						tokens: restoreTokens
					};
				});
			}
		} else appendRangeAsStatement(statementCodeBlocks, usedOffset, end);
	}
	for (const body of ast.body) if (body.type === "ImportDeclaration" || body.type === "ExportAllDeclaration" || body.type === "ExportNamedDeclaration" && body.source != null) {
		const [start, end] = getNodeFullRange(body);
		appendRangeAsStatement(statementCodeBlocks, usedOffset, start);
		appendRangeAsStatement(importCodeBlocks, start, end);
	} else if (body.type === "ExportDefaultDeclaration") {
		const [start, end] = getNodeFullRange(body);
		appendRangeAsStatement(statementCodeBlocks, usedOffset, start);
		appendRangeAsStatement(exportDefaultCodeBlocks, start, end);
	} else if (body.type === "ExportNamedDeclaration") transformExportNamed(body);
	appendRangeAsStatement(statementCodeBlocks, usedOffset, scriptSetupEndOffset);
	const codeBlocks = new CodeBlocks();
	let postprocess = () => {};
	codeBlocks.appendCodeBlocks(importCodeBlocks);
	const scriptSetupBlockRangeStart = codeBlocks.length;
	codeBlocks.appendSplitPunctuators("{");
	const generic = extractGeneric(node);
	if (generic) {
		const defineGenericTypeRangeStart = codeBlocks.length;
		for (const defineType of generic.defineTypes) {
			codeBlocks.append(defineType.define, defineType.node.range[0]);
			codeBlocks.appendSplitPunctuators(";");
		}
		const defineGenericTypeRangeEnd = codeBlocks.length;
		postprocess = (eslintResult, context) => {
			const diffOffset = context.scriptSetupBlockRange[0] - scriptSetupBlockRangeStart;
			const defineGenericTypeRange = [defineGenericTypeRangeStart + diffOffset, defineGenericTypeRangeEnd + diffOffset];
			function isTypeBlock(block) {
				return block.type === "BlockStatement" && context.scriptSetupBlockRange[0] <= block.range[0] && block.range[1] <= context.scriptSetupBlockRange[1];
			}
			generic.postprocess({
				result: eslintResult,
				getTypeBlock: (program) => program.body.find(isTypeBlock),
				isRemoveTarget(nodeOrToken) {
					return defineGenericTypeRange[0] <= nodeOrToken.range[0] && nodeOrToken.range[1] <= defineGenericTypeRange[1];
				},
				getTypeDefScope(scopeManager) {
					return (scopeManager.globalScope.childScopes.find((s) => s.type === "module") ?? scopeManager.globalScope).childScopes.find((scope) => isTypeBlock(scope.block));
				}
			});
		};
	}
	codeBlocks.appendCodeBlocks(statementCodeBlocks);
	codeBlocks.appendSplitPunctuators("}");
	const scriptSetupBlockRangeEnd = codeBlocks.length;
	codeBlocks.appendCodeBlocks(exportDefaultCodeBlocks);
	return {
		codeBlocks,
		scriptSetupBlockRange: [scriptSetupBlockRangeStart, scriptSetupBlockRangeEnd],
		postprocess,
		restoreASTCallbacks
	};
	function getNodeFullRange(n) {
		let start = n.range[0];
		let end = n.range[1];
		traverseNodes(n, {
			visitorKeys,
			enterNode(c) {
				start = Math.min(start, c.range[0]);
				end = Math.max(end, c.range[1]);
			},
			leaveNode() {}
		});
		return [start, end];
	}
	function checkToken(token, value) {
		if (token.value === value) return;
		const perr = new ParseError(`Could not parse <script setup>. Expected "${value}", but it was "${token.value}".`, void 0, token.range[0], token.loc.start.line, token.loc.start.column);
		fixErrorLocation(perr, offsetLocationCalculator);
		throw perr;
	}
}
function remapAST(result, { scriptSetupBlockRange, codeBlocks }) {
	if (!scriptSetupBlockRange) return [];
	let scriptSetupBlock = null;
	const scriptSetupStatements = [];
	for (let index = result.ast.body.length - 1; index >= 0; index--) {
		const body = result.ast.body[index];
		if (body.type === "BlockStatement") {
			if (scriptSetupBlockRange[0] <= body.range[0] && body.range[1] <= scriptSetupBlockRange[1]) {
				if (scriptSetupBlock) throw new Error(`Unexpected state error: An unexpected block statement was found. ${JSON.stringify(body.loc)}`);
				scriptSetupBlock = body;
				scriptSetupStatements.push(...body.body.filter((b) => !isSplitPunctuatorsEmptyStatement(b)));
				result.ast.body.splice(index, 1, ...scriptSetupStatements);
			}
		} else if (body.type === "EmptyStatement") {
			if (isSplitPunctuatorsEmptyStatement(body)) result.ast.body.splice(index, 1);
		}
	}
	if (result.scopeManager && scriptSetupBlock) {
		const blockScope = result.scopeManager.acquire(scriptSetupBlock, true);
		remapScope(result.scopeManager, blockScope);
	}
	return scriptSetupStatements;
	function isSplitPunctuatorsEmptyStatement(body) {
		return body.type === "EmptyStatement" && codeBlocks.splitPunctuators.includes(body.range[1] - 1);
	}
	function remapScope(scopeManager, blockScope) {
		const moduleScope = blockScope.upper;
		for (const reference of blockScope.references) {
			reference.from = moduleScope;
			moduleScope.references.push(reference);
		}
		for (const variable of blockScope.variables) {
			variable.scope = moduleScope;
			const alreadyVariable = moduleScope.variables.find((v) => v.name === variable.name);
			if (alreadyVariable) {
				alreadyVariable.defs.push(...variable.defs);
				alreadyVariable.identifiers.push(...variable.identifiers);
				alreadyVariable.references.push(...variable.references);
				for (const reference of variable.references) reference.resolved = alreadyVariable;
			} else {
				moduleScope.variables.push(variable);
				moduleScope.set.set(variable.name, variable);
			}
		}
		const upper = blockScope.upper;
		if (upper) {
			const index = upper.childScopes.indexOf(blockScope);
			if (index >= 0) upper.childScopes.splice(index, 1);
		}
		const index = scopeManager.scopes.indexOf(blockScope);
		if (index >= 0) scopeManager.scopes.splice(index, 1);
	}
}
function remapLocationAndTokens(result, { codeBlocks }, locationCalculator) {
	const tokens = result.ast.tokens ?? [];
	const endMap = /* @__PURE__ */ new Map();
	const buffer = [];
	for (let index = tokens.length - 1; index >= 0; index--) {
		const token = tokens[index];
		if (token.range[0] + 1 === token.range[1] && codeBlocks.splitPunctuators.includes(token.range[0])) {
			tokens.splice(index, 1);
			buffer.push(token.range[1]);
			continue;
		} else {
			for (const end of buffer) endMap.set(end, token.range[1]);
			buffer.length = 0;
		}
	}
	traverseNodes(result.ast, {
		visitorKeys: result.visitorKeys,
		enterNode(node) {
			const rangeEnd = endMap.get(node.range[1]);
			if (rangeEnd != null) node.range[1] = rangeEnd;
			if (node.end) {
				if (endMap.get(node.end) != null) node.end = rangeEnd;
			}
		},
		leaveNode() {}
	});
	fixLocations(result, locationCalculator);
}

//#endregion
//#region src/style/tokenizer.ts
let CSSTokenType = /* @__PURE__ */ function(CSSTokenType) {
	CSSTokenType["Quoted"] = "Quoted";
	CSSTokenType["Block"] = "Block";
	CSSTokenType["Line"] = "Line";
	CSSTokenType["Word"] = "Word";
	CSSTokenType["Punctuator"] = "Punctuator";
	return CSSTokenType;
}({});
/**
* A simplified CSS tokenizer.
* The tokenizer is implemented with reference to the CSS specification,
* but it does not follow it. This tokenizer only does the tokenization needed to properly handle `v-bind()`.
* @see https://drafts.csswg.org/css-syntax/#tokenization
*/
var CSSTokenizer = class {
	text;
	options;
	cp;
	offset;
	nextOffset;
	reconsuming;
	/**
	* Initialize this tokenizer.
	* @param text The source code to tokenize.
	* @param options The tokenizer options.
	*/
	constructor(text, startOffset, options) {
		debug$1("[css] the source code length: %d", text.length);
		this.text = text;
		this.options = { inlineComment: options?.inlineComment ?? false };
		this.cp = NULL;
		this.offset = startOffset - 1;
		this.nextOffset = startOffset;
		this.reconsuming = false;
	}
	/**
	* Get the next token.
	* @returns The next token or null.
	*/
	nextToken() {
		let cp;
		if (this.reconsuming) {
			cp = this.cp;
			this.reconsuming = false;
		} else cp = this.consumeNextCodePoint();
		while (isWhitespace(cp)) cp = this.consumeNextCodePoint();
		if (cp === EOF) return null;
		const start = this.offset;
		return this.consumeNextToken(cp, start);
	}
	/**
	* Get the next code point.
	* @returns The code point.
	*/
	nextCodePoint() {
		if (this.nextOffset >= this.text.length) return EOF;
		return this.text.codePointAt(this.nextOffset);
	}
	/**
	* Consume the next code point.
	* @returns The consumed code point.
	*/
	consumeNextCodePoint() {
		if (this.offset >= this.text.length) {
			this.cp = EOF;
			return EOF;
		}
		this.offset = this.nextOffset;
		if (this.offset >= this.text.length) {
			this.cp = EOF;
			return EOF;
		}
		let cp = this.text.codePointAt(this.offset);
		if (cp === CARRIAGE_RETURN) {
			this.nextOffset = this.offset + 1;
			if (this.text.codePointAt(this.nextOffset) === LINE_FEED) this.nextOffset++;
			cp = LINE_FEED;
		} else this.nextOffset = this.offset + (cp >= 65536 ? 2 : 1);
		this.cp = cp;
		return cp;
	}
	consumeNextToken(cp, start) {
		if (cp === SOLIDUS) {
			const nextCp = this.nextCodePoint();
			if (nextCp === ASTERISK) return this.consumeComment(start);
			if (nextCp === SOLIDUS && this.options.inlineComment) return this.consumeInlineComment(start);
		}
		if (isQuote(cp)) return this.consumeString(start, cp);
		if (isPunctuator(cp)) return {
			type: CSSTokenType.Punctuator,
			range: [start, start + 1],
			value: String.fromCodePoint(cp)
		};
		return this.consumeWord(start);
	}
	/**
	* Consume word
	*/
	consumeWord(start) {
		let cp = this.consumeNextCodePoint();
		while (!isWhitespace(cp) && !isPunctuator(cp) && !isQuote(cp)) cp = this.consumeNextCodePoint();
		this.reconsuming = true;
		const range = [start, this.offset];
		const text = this.text;
		let value;
		return {
			type: CSSTokenType.Word,
			range,
			get value() {
				return value ??= text.slice(...range);
			}
		};
	}
	/**
	* https://drafts.csswg.org/css-syntax/#consume-string-token
	*/
	consumeString(start, quote) {
		let valueEndOffset = null;
		let cp = this.consumeNextCodePoint();
		while (cp !== EOF) {
			if (cp === quote) {
				valueEndOffset = this.offset;
				break;
			}
			if (cp === REVERSE_SOLIDUS) this.consumeNextCodePoint();
			cp = this.consumeNextCodePoint();
		}
		const text = this.text;
		let value;
		const valueRange = [start + 1, valueEndOffset ?? this.nextOffset];
		return {
			type: CSSTokenType.Quoted,
			range: [start, this.nextOffset],
			valueRange,
			get value() {
				return value ??= text.slice(...valueRange);
			},
			quote: String.fromCodePoint(quote)
		};
	}
	/**
	* https://drafts.csswg.org/css-syntax/#consume-comment
	*/
	consumeComment(start) {
		this.consumeNextCodePoint();
		let valueEndOffset = null;
		let cp = this.consumeNextCodePoint();
		while (cp !== EOF) {
			if (cp === ASTERISK) {
				cp = this.consumeNextCodePoint();
				if (cp === SOLIDUS) {
					valueEndOffset = this.offset - 1;
					break;
				}
			}
			cp = this.consumeNextCodePoint();
		}
		const valueRange = [start + 2, valueEndOffset ?? this.nextOffset];
		const text = this.text;
		let value;
		return {
			type: CSSTokenType.Block,
			range: [start, this.nextOffset],
			valueRange,
			get value() {
				return value ??= text.slice(...valueRange);
			}
		};
	}
	/**
	* Consume inline comment
	*/
	consumeInlineComment(start) {
		this.consumeNextCodePoint();
		let valueEndOffset = null;
		let cp = this.consumeNextCodePoint();
		while (cp !== EOF) {
			if (cp === LINE_FEED) {
				valueEndOffset = this.offset - 1;
				break;
			}
			cp = this.consumeNextCodePoint();
		}
		const valueRange = [start + 2, valueEndOffset ?? this.nextOffset];
		const text = this.text;
		let value;
		return {
			type: CSSTokenType.Line,
			range: [start, this.nextOffset],
			valueRange,
			get value() {
				return value ??= text.slice(...valueRange);
			}
		};
	}
};
function isPunctuator(cp) {
	return cp === COLON || cp === SEMICOLON || cp === LEFT_PARENTHESIS || cp === RIGHT_PARENTHESIS || cp === LEFT_CURLY_BRACKET || cp === RIGHT_CURLY_BRACKET || cp === LEFT_SQUARE_BRACKET || cp === RIGHT_SQUARE_BRACKET || cp === SOLIDUS || cp === ASTERISK;
}
function isQuote(cp) {
	return cp === APOSTROPHE || cp === QUOTATION_MARK;
}

//#endregion
//#region src/style/index.ts
var CSSTokenScanner = class {
	reconsuming = [];
	tokenizer;
	constructor(text, options) {
		this.tokenizer = new CSSTokenizer(text, 0, options);
	}
	nextToken() {
		return this.reconsuming.shift() ?? this.tokenizer.nextToken();
	}
	reconsume(...tokens) {
		this.reconsuming.push(...tokens);
	}
};
/**
* Parse the source code of the given `<style>` elements.
* @param elements The `<style>` elements to parse.
* @param globalLocationCalculator The location calculator for fixLocations.
* @param parserOptions The parser options.
* @returns The result of parsing.
*/
function parseStyleElements(elements, globalLocationCalculator, originalParserOptions) {
	const parserOptions = {
		...originalParserOptions,
		ecmaVersion: originalParserOptions.ecmaVersion ?? DEFAULT_ECMA_VERSION
	};
	for (const style of elements) {
		style.style = true;
		parseStyleElement(style, globalLocationCalculator, parserOptions, { inlineComment: (getLang(style) || "css") !== "css" });
	}
}
function parseStyleElement(style, globalLocationCalculator, parserOptions, cssOptions) {
	if (style.children.length !== 1) return;
	const textNode = style.children[0];
	if (textNode.type !== "VText") return;
	const code = textNode.value;
	if (!/v-bind\s*(?:\(|\/)/u.test(code)) return;
	const locationCalculator = globalLocationCalculator.getSubCalculatorAfter(textNode.range[0]);
	parseStyle(getOwnerDocument(style), style, code, locationCalculator, parserOptions, cssOptions);
}
function parseStyle(document, style, code, locationCalculator, parserOptions, cssOptions) {
	let textStart = 0;
	for (const { range, exprRange, quote, openingParenOffset, comments } of iterateVBind(code, cssOptions)) {
		insertComments(document, comments.map((c) => createSimpleToken(c.type, locationCalculator.getOffsetWithGap(c.range[0]), locationCalculator.getOffsetWithGap(c.range[1]), c.value, locationCalculator)));
		const container = {
			type: "VExpressionContainer",
			range: [locationCalculator.getOffsetWithGap(range[0]), locationCalculator.getOffsetWithGap(range[1])],
			loc: {
				start: locationCalculator.getLocation(range[0]),
				end: locationCalculator.getLocation(range[1])
			},
			parent: style,
			expression: null,
			references: []
		};
		const openingParenStart = locationCalculator.getOffsetWithGap(openingParenOffset);
		const beforeTokens = [createSimpleToken("HTMLRawText", container.range[0], container.range[0] + 6, "v-bind", locationCalculator), createSimpleToken("Punctuator", openingParenStart, openingParenStart + 1, "(", locationCalculator)];
		const afterTokens = [createSimpleToken("Punctuator", container.range[1] - 1, container.range[1], ")", locationCalculator)];
		if (quote) {
			const openStart = locationCalculator.getOffsetWithGap(exprRange[0] - 1);
			beforeTokens.push(createSimpleToken("Punctuator", openStart, openStart + 1, quote, locationCalculator));
			const closeStart = locationCalculator.getOffsetWithGap(exprRange[1]);
			afterTokens.unshift(createSimpleToken("Punctuator", closeStart, closeStart + 1, quote, locationCalculator));
		}
		const beforeLast = beforeTokens[beforeTokens.length - 1];
		replaceAndSplitTokens(document, {
			range: [container.range[0], beforeLast.range[1]],
			loc: {
				start: container.loc.start,
				end: beforeLast.loc.end
			}
		}, beforeTokens);
		const afterFirst = afterTokens[0];
		replaceAndSplitTokens(document, {
			range: [afterFirst.range[0], container.range[1]],
			loc: {
				start: afterFirst.loc.start,
				end: container.loc.end
			}
		}, afterTokens);
		const lastChild = style.children[style.children.length - 1];
		style.children.push(container);
		if (lastChild.type === "VText") {
			const newTextNode = {
				type: "VText",
				range: [container.range[1], lastChild.range[1]],
				loc: {
					start: { ...container.loc.end },
					end: { ...lastChild.loc.end }
				},
				parent: style,
				value: code.slice(range[1])
			};
			style.children.push(newTextNode);
			lastChild.range[1] = container.range[0];
			lastChild.loc.end = { ...container.loc.start };
			lastChild.value = code.slice(textStart, range[0]);
			textStart = range[1];
		}
		try {
			const ret = parseExpression(code.slice(...exprRange), locationCalculator.getSubCalculatorShift(exprRange[0]), parserOptions, {
				allowEmpty: false,
				allowFilters: false
			});
			if (ret.expression) {
				ret.expression.parent = container;
				container.expression = ret.expression;
				container.references = ret.references;
			}
			replaceAndSplitTokens(document, {
				range: [beforeLast.range[1], afterFirst.range[0]],
				loc: {
					start: beforeLast.loc.end,
					end: afterFirst.loc.start
				}
			}, ret.tokens);
			insertComments(document, ret.comments);
			for (const variable of ret.variables) style.variables.push(variable);
			resolveReferences(container);
		} catch (err) {
			debug$1("[style] Parse error: %s", err);
			if (ParseError.isParseError(err)) insertError(document, err);
			else throw err;
		}
	}
}
/**
* Iterate the `v-bind()` information.
*/
function* iterateVBind(code, cssOptions) {
	const tokenizer = new CSSTokenScanner(code, cssOptions);
	let token;
	while (token = tokenizer.nextToken()) {
		if (token.type !== CSSTokenType.Word || token.value !== "v-bind") continue;
		const openingParen = findVBindOpeningParen(tokenizer);
		if (!openingParen) continue;
		const arg = parseVBindArg(tokenizer);
		if (!arg) continue;
		yield {
			range: [token.range[0], arg.closingParen.range[1]],
			exprRange: arg.exprRange,
			quote: arg.quote,
			openingParenOffset: openingParen.openingParen.range[0],
			comments: [...openingParen.comments, ...arg.comments]
		};
	}
}
function findVBindOpeningParen(tokenizer) {
	const comments = [];
	let token;
	while (token = tokenizer.nextToken()) {
		if (token.type === CSSTokenType.Punctuator && token.value === "(") return {
			openingParen: token,
			comments
		};
		else if (isComment(token)) {
			comments.push(token);
			continue;
		}
		tokenizer.reconsume(...comments, token);
		return null;
	}
	return null;
}
function parseVBindArg(tokenizer) {
	const tokensBuffer = [];
	const comments = [];
	const tokens = [];
	const closeTokenStack = [];
	let token;
	while (token = tokenizer.nextToken()) {
		if (token.type === CSSTokenType.Punctuator) {
			if (token.value === ")" && !closeTokenStack.length) {
				if (tokens.length === 1 && tokens[0].type === CSSTokenType.Quoted) {
					const quotedToken = tokens[0];
					return {
						exprRange: quotedToken.valueRange,
						quote: quotedToken.quote,
						closingParen: token,
						comments
					};
				}
				return {
					exprRange: [(tokensBuffer[0] ?? token).range[0], token.range[0]],
					quote: null,
					closingParen: token,
					comments: []
				};
			}
			if (token.value === closeTokenStack[0]) closeTokenStack.shift();
			else if (token.value === "(") closeTokenStack.unshift(")");
		}
		tokensBuffer.push(token);
		if (isComment(token)) comments.push(token);
		else tokens.push(token);
	}
	tokenizer.reconsume(...tokensBuffer);
	return null;
}
function isComment(token) {
	return token.type === CSSTokenType.Block || token.type === CSSTokenType.Line;
}

//#endregion
//#region src/script-setup/scope-analyzer.ts
const BUILTIN_COMPONENTS = new Set([
	"template",
	"slot",
	"component",
	"Component",
	"transition",
	"Transition",
	"transition-group",
	"TransitionGroup",
	"keep-alive",
	"KeepAlive",
	"teleport",
	"Teleport",
	"suspense",
	"Suspense"
]);
const BUILTIN_DIRECTIVES = new Set([
	"bind",
	"on",
	"text",
	"html",
	"show",
	"if",
	"else",
	"else-if",
	"for",
	"model",
	"slot",
	"pre",
	"cloak",
	"once",
	"memo",
	"is"
]);
/**
* @see https://github.com/vuejs/core/blob/48de8a42b7fed7a03f7f1ff5d53d6a704252cafe/packages/shared/src/domTagConfig.ts#L5-L28
*/
const HTML_TAGS = "html,body,base,head,link,meta,style,title,address,article,aside,footer,header,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,option,output,progress,select,textarea,details,dialog,menu,summary,template,blockquote,iframe,tfoot";
const SVG_TAGS = "svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view";
const NATIVE_TAGS = new Set([...HTML_TAGS.split(","), ...SVG_TAGS.split(",")]);
const COMPILER_MACROS_AT_ROOT = new Set([
	"defineProps",
	"defineEmits",
	"defineExpose",
	"withDefaults",
	"defineOptions",
	"defineSlots",
	"defineModel"
]);
function capitalize(str) {
	return str[0].toUpperCase() + str.slice(1);
}
/**
* Analyze `<script setup>` scope.
* This method does the following process:
*
* 1. Add a virtual reference to the variables used in the template to mark them as used.
* (This is the same way typescript-eslint marks a `React` variable.)
*
* 2. If compiler macros were used, add these variables as global variables.
*/
function analyzeScriptSetupScope(scopeManager, templateBody, df, parserOptions) {
	analyzeUsedInTemplateVariables(scopeManager, templateBody, df);
	analyzeScriptSetupVariables(scopeManager, df, parserOptions);
}
function extractVariables(scopeManager) {
	const scriptVariables = /* @__PURE__ */ new Map();
	const globalScope = scopeManager.globalScope;
	if (!globalScope) return scriptVariables;
	for (const variable of globalScope.variables) scriptVariables.set(variable.name, variable);
	const moduleScope = globalScope.childScopes.find((scope) => scope.type === "module");
	for (const variable of moduleScope?.variables ?? []) scriptVariables.set(variable.name, variable);
	return scriptVariables;
}
/**
* Analyze the variables used in the template.
* Add a virtual reference to the variables used in the template to mark them as used.
* (This is the same way typescript-eslint marks a `React` variable.)
*/
function analyzeUsedInTemplateVariables(scopeManager, templateBody, df) {
	const scriptVariables = extractVariables(scopeManager);
	const markedVariables = /* @__PURE__ */ new Set();
	/**
	* @see https://github.com/vuejs/vue-next/blob/48de8a42b7fed7a03f7f1ff5d53d6a704252cafe/packages/compiler-core/src/transforms/transformElement.ts#L335
	*/
	function markSetupReferenceVariableAsUsed(name) {
		if (scriptVariables.has(name)) {
			markVariableAsUsed(name);
			return true;
		}
		const camelName = camelize(name);
		if (scriptVariables.has(camelName)) {
			markVariableAsUsed(camelName);
			return true;
		}
		const pascalName = capitalize(camelName);
		if (scriptVariables.has(pascalName)) {
			markVariableAsUsed(pascalName);
			return true;
		}
		return false;
	}
	function markVariableAsUsed(nameOrRef) {
		let name;
		let isValueReference;
		let isTypeReference;
		if (typeof nameOrRef === "string") name = nameOrRef;
		else {
			name = nameOrRef.id.name;
			isValueReference = nameOrRef.isValueReference;
			isTypeReference = nameOrRef.isTypeReference;
		}
		const variable = scriptVariables.get(name);
		if (!variable || variable.identifiers.length === 0) return;
		if (markedVariables.has(name)) return;
		markedVariables.add(name);
		const reference = new (getEslintScope()).Reference();
		reference.vueUsedInTemplate = true;
		reference.from = variable.scope;
		reference.identifier = variable.identifiers[0];
		reference.isWrite = () => false;
		reference.isWriteOnly = () => false;
		reference.isRead = () => true;
		reference.isReadOnly = () => true;
		reference.isReadWrite = () => false;
		reference.isValueReference = isValueReference;
		reference.isTypeReference = isTypeReference;
		variable.references.push(reference);
		reference.resolved = variable;
		variable.eslintUsed = true;
	}
	function processVExpressionContainer(node) {
		for (const reference of node.references.filter((ref) => ref.variable == null)) markVariableAsUsed(reference);
	}
	function processVElement(node) {
		if (node.rawName === node.name && NATIVE_TAGS.has(node.rawName) || BUILTIN_COMPONENTS.has(node.rawName)) return;
		if (!markSetupReferenceVariableAsUsed(node.rawName)) {
			const dotIndex = node.rawName.indexOf(".");
			if (dotIndex > 0) markSetupReferenceVariableAsUsed(node.rawName.slice(0, dotIndex));
		}
	}
	function processVAttribute(node) {
		if (node.directive) {
			if (BUILTIN_DIRECTIVES.has(node.key.name.name)) return;
			markSetupReferenceVariableAsUsed(`v-${node.key.name.rawName}`);
		} else if (node.key.name === "ref" && node.value) markVariableAsUsed(node.value.value);
	}
	if (templateBody) traverseNodes(templateBody, {
		enterNode(node) {
			if (node.type === "VExpressionContainer") processVExpressionContainer(node);
			else if (node.type === "VElement") processVElement(node);
			else if (node.type === "VAttribute") processVAttribute(node);
		},
		leaveNode() {}
	});
	for (const child of df.children) if (child.type === "VElement") {
		if (isScriptSetupElement(child)) {
			const generic = findGenericDirective(child);
			if (generic) processVExpressionContainer(generic.value);
		} else if (child.name === "style") {
			for (const node of child.children) if (node.type === "VExpressionContainer") processVExpressionContainer(node);
		}
	}
}
/**
* Analyze <script setup> variables.
* - Analyze compiler macros.
*   If compiler macros were used, add these variables as global variables.
* - Generic variables.
*   If defined generics are used, add these variables as global variables.
*/
function analyzeScriptSetupVariables(scopeManager, df, parserOptions) {
	const globalScope = scopeManager.globalScope;
	if (!globalScope) return;
	const customMacros = new Set(parserOptions.vueFeatures?.customMacros && Array.isArray(parserOptions.vueFeatures.customMacros) ? parserOptions.vueFeatures.customMacros : []);
	const genericDefineNames = /* @__PURE__ */ new Set();
	const scriptSetupElement = df.children.filter(isScriptElement).find(isScriptSetupElement);
	if (scriptSetupElement && findGenericDirective(scriptSetupElement)) {
		for (const variable of scriptSetupElement.variables) if (variable.kind === "generic") genericDefineNames.add(variable.id.name);
	}
	const newThrough = [];
	for (const reference of globalScope.through) {
		if (COMPILER_MACROS_AT_ROOT.has(reference.identifier.name) || customMacros.has(reference.identifier.name)) {
			if (reference.from.type === "global" || reference.from.type === "module") {
				addCompilerMacroVariable(reference);
				continue;
			}
		}
		if (genericDefineNames.has(reference.identifier.name)) {
			addGenericVariable(reference);
			continue;
		}
		newThrough.push(reference);
	}
	globalScope.through = newThrough;
	function addCompilerMacroVariable(reference) {
		addVariable(globalScope, reference);
	}
	function addGenericVariable(reference) {
		addVariable(globalScope, reference);
	}
}
function addVariable(scope, reference) {
	const name = reference.identifier.name;
	let variable = scope.set.get(name);
	if (!variable) {
		variable = new (getEslintScope()).Variable();
		variable.name = name;
		variable.scope = scope;
		scope.variables.push(variable);
		scope.set.set(name, variable);
	}
	reference.resolved = variable;
	variable.references.push(reference);
}

//#endregion
//#region package.json
var name = "vue-eslint-parser";
var version = "10.4.1";

//#endregion
//#region src/index.ts
/**
* @author Toru Nagashima <https://github.com/mysticatea>
* @copyright 2017 Toru Nagashima. All rights reserved.
* See LICENSE file in root directory for full license.
*/
const STARTS_WITH_LT = /^\s*</u;
/**
* Check whether the code is a Vue.js component.
* @param code The source code to check.
* @param options The parser options.
* @returns `true` if the source code is a Vue.js component.
*/
function isVueFile(code, options) {
	const filePath = options.filePath || "unknown.js";
	return path.extname(filePath) === ".vue" || STARTS_WITH_LT.test(code);
}
/**
* Parse the given source code.
* @param code The source code to parse.
* @param parserOptions The parser options.
* @returns The parsing result.
*/
function parseForESLint(code, parserOptions) {
	const options = {
		comment: true,
		loc: true,
		range: true,
		tokens: true,
		...parserOptions
	};
	let result;
	let document;
	let locationCalculator;
	if (!isVueFile(code, options)) {
		result = parseAsScript(code, options);
		document = null;
		locationCalculator = null;
	} else ({result, document, locationCalculator} = parseAsSFC(code, options));
	result.services = {
		...result.services,
		...define(code, result.ast, document, locationCalculator, { parserOptions: options })
	};
	return result;
}
/**
* Parse the given source code.
* @param code The source code to parse.
* @param options The parser options.
* @returns The parsing result.
*/
function parse(code, options) {
	return parseForESLint(code, options).ast;
}
function parseAsSFC(code, options) {
	const optionsForTemplate = {
		...options,
		ecmaVersion: options.ecmaVersion ?? DEFAULT_ECMA_VERSION
	};
	const skipParsingScript = options.parser === false;
	const tokenizer = new Tokenizer(code, optionsForTemplate);
	const rootAST = new Parser(tokenizer, optionsForTemplate).parse();
	const locationCalculator = new LocationCalculatorForHtml(tokenizer.gaps, tokenizer.lineTerminators);
	const scripts = rootAST.children.filter(isScriptElement);
	const template = rootAST.children.find(isTemplateElement);
	const templateLang = getLang(template) || "html";
	const hasTemplateTokenizer = options?.templateTokenizer?.[templateLang];
	const concreteInfo = {
		tokens: rootAST.tokens,
		comments: rootAST.comments,
		errors: rootAST.errors
	};
	const templateBody = template != null && (templateLang === "html" || hasTemplateTokenizer) ? Object.assign(template, concreteInfo) : void 0;
	const scriptParser = getScriptParser(options.parser, () => getParserLangFromSFC(rootAST));
	let result;
	let scriptSetup;
	if (skipParsingScript || !scripts.length) result = parseScript$1("", {
		...options,
		ecmaVersion: options.ecmaVersion ?? DEFAULT_ECMA_VERSION,
		parser: scriptParser
	});
	else if (scripts.length === 2 && (scriptSetup = scripts.find(isScriptSetupElement))) result = parseScriptSetupElements(scriptSetup, scripts.find((e) => e !== scriptSetup), code, new LinesAndColumns(tokenizer.lineTerminators), {
		...options,
		parser: scriptParser
	});
	else result = parseScriptElement(scripts[0], code, new LinesAndColumns(tokenizer.lineTerminators), {
		...options,
		parser: scriptParser
	});
	if (options.vueFeatures?.styleCSSVariableInjection ?? true) parseStyleElements(rootAST.children.filter(isStyleElement), locationCalculator, {
		...options,
		parser: getScriptParser(options.parser, function* () {
			yield "<template>";
			yield getParserLangFromSFC(rootAST);
		}),
		project: void 0,
		projectService: void 0
	});
	result.ast.templateBody = templateBody;
	if (options.eslintScopeManager) {
		if (scripts.some(isScriptSetupElement)) {
			if (!result.scopeManager) result.scopeManager = analyzeScope(result.ast, options);
			analyzeScriptSetupScope(result.scopeManager, templateBody, rootAST, options);
		}
	}
	return {
		result,
		locationCalculator,
		document: rootAST
	};
}
function parseAsScript(code, options) {
	return parseScript$1(code, {
		...options,
		ecmaVersion: options.ecmaVersion ?? DEFAULT_ECMA_VERSION,
		parser: getScriptParser(options.parser, () => {
			const ext = (path.extname(options.filePath || "unknown.js").toLowerCase() || "").slice(1);
			if (/^[jt]sx$/u.test(ext)) return [ext, ext.slice(0, -1)];
			return ext;
		})
	});
}
const meta = {
	name,
	version
};

//#endregion
Object.defineProperty(exports, 'AST', {
  enumerable: true,
  get: function () {
    return ast_exports;
  }
});
exports.meta = meta;
exports.parse = parse;
exports.parseForESLint = parseForESLint;
//# sourceMappingURL=index.cjs.mapBXx   {"version":3,"file":"index.cjs","names":["Evk","debug","escope","dependencyEspree","espree","DUMMY_PARENT","parseScript","getTagName","SVG_TAGS","DUMMY_PARENT","cursors.forward","cursors.backward","EventEmitter","parseScriptBase","services.define","HTMLTokenizer","HTMLParser","parseScript"],"sources":["../src/ast/errors.ts","../src/ast/nodes.ts","../src/ast/traverse.ts","../src/ast/index.ts","../src/utils/utils.ts","../src/common/lines-and-columns.ts","../src/common/location-calculator.ts","../src/common/debug.ts","../src/common/ast-utils.ts","../src/common/parser-object.ts","../src/common/parser-options.ts","../src/common/eslint-scope.ts","../src/common/espree.ts","../src/script-setup/parser-options.ts","../src/script/scope-analyzer.ts","../src/common/fix-locations.ts","../src/script/generic.ts","../src/script/index.ts","../src/common/token-utils.ts","../src/common/error-utils.ts","../src/template/index.ts","../src/html/util/attribute-names.ts","../src/html/util/tag-names.ts","../src/html/intermediate-tokenizer.ts","../src/html/parser.ts","../src/html/util/alternative-cr.ts","../src/html/util/entities.ts","../src/html/util/unicode.ts","../src/html/tokenizer.ts","../src/utils/memoize.ts","../src/external/node-event-generator.ts","../src/external/token-store/utils.ts","../src/external/token-store/cursors/cursor.ts","../src/external/token-store/cursors/backward-token-comment-cursor.ts","../src/external/token-store/cursors/backward-token-cursor.ts","../src/external/token-store/cursors/decorative-cursor.ts","../src/external/token-store/cursors/filter-cursor.ts","../src/external/token-store/cursors/forward-token-comment-cursor.ts","../src/external/token-store/cursors/forward-token-cursor.ts","../src/external/token-store/cursors/limit-cursor.ts","../src/external/token-store/cursors/skip-cursor.ts","../src/external/token-store/cursors/index.ts","../src/external/token-store/cursors/padded-token-cursor.ts","../src/external/token-store/index.ts","../src/sfc/custom-block/index.ts","../src/parser-services.ts","../src/script-setup/index.ts","../src/style/tokenizer.ts","../src/style/index.ts","../src/script-setup/scope-analyzer.ts","../package.json","../src/index.ts"],"sourcesContent":["/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * @copyright 2017 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\nimport type { Location } from \"./locations\"\n\n/**\n * Check whether the given value has acorn style location information.\n * @param x The value to check.\n * @returns `true` if the value has acorn style location information.\n */\nfunction isAcornStyleParseError(\n    x: any,\n): x is { message: string; pos: number; loc: Location } {\n    return (\n        typeof x.message === \"string\" &&\n        typeof x.pos === \"number\" &&\n        typeof x.loc === \"object\" &&\n        x.loc !== null &&\n        typeof x.loc.line === \"number\" &&\n        typeof x.loc.column === \"number\"\n    )\n}\n\n/**\n * Check whether the given value is probably a TSError.\n * @param x The value to check.\n * @returns `true` if the given value is probably a TSError.\n */\nfunction isTSError(\n    x: any,\n): x is { message: string; index: number; lineNumber: number; column: number } {\n    return (\n        !(x instanceof ParseError) &&\n        typeof x.message === \"string\" &&\n        typeof x.index === \"number\" &&\n        typeof x.lineNumber === \"number\" &&\n        typeof x.column === \"number\" &&\n        x.name === \"TSError\"\n    )\n}\n\n/**\n * HTML parse errors.\n */\nexport class ParseError extends SyntaxError {\n    public code?: ErrorCode\n    public index: number\n    public lineNumber: number\n    public column: number\n\n    /**\n     * Create new parser error object.\n     * @param code The error code. See also: https://html.spec.whatwg.org/multipage/parsing.html#parse-errors\n     * @param offset The offset number of this error.\n     * @param line The line number of this error.\n     * @param column The column number of this error.\n     */\n    public static fromCode(\n        code: ErrorCode,\n        offset: number,\n        line: number,\n        column: number,\n    ): ParseError {\n        return new ParseError(code, code, offset, line, column)\n    }\n\n    /**\n     * Normalize the error object.\n     * @param x The error object to normalize.\n     */\n    public static normalize(x: any): ParseError | null {\n        if (isTSError(x)) {\n            return new ParseError(\n                x.message,\n                undefined,\n                x.index,\n                x.lineNumber,\n                x.column,\n            )\n        }\n        if (ParseError.isParseError(x)) {\n            return x\n        }\n        if (isAcornStyleParseError(x)) {\n            return new ParseError(\n                x.message,\n                undefined,\n                x.pos,\n                x.loc.line,\n                x.loc.column,\n            )\n        }\n        return null\n    }\n\n    /**\n     * Initialize this ParseError instance.\n     * @param message The error message.\n     * @param code The error code. See also: https://html.spec.whatwg.org/multipage/parsing.html#parse-errors\n     * @param offset The offset number of this error.\n     * @param line The line number of this error.\n     * @param column The column number of this error.\n     */\n    public constructor(\n        message: string,\n        code: ErrorCode | undefined,\n        offset: number,\n        line: number,\n        column: number,\n    ) {\n        super(message)\n        this.code = code\n        this.index = offset\n        this.lineNumber = line\n        this.column = column\n    }\n\n    /**\n     * Type guard for ParseError.\n     * @param x The value to check.\n     * @returns `true` if the value has `message`, `pos`, `loc` properties.\n     */\n    public static isParseError(x: any): x is ParseError {\n        return (\n            x instanceof ParseError ||\n            (typeof x.message === \"string\" &&\n                typeof x.index === \"number\" &&\n                typeof x.lineNumber === \"number\" &&\n                typeof x.column === \"number\")\n        )\n    }\n}\n\n/**\n * The error codes of HTML syntax errors.\n * https://html.spec.whatwg.org/multipage/parsing.html#parse-errors\n */\nexport type ErrorCode =\n    | \"abrupt-closing-of-empty-comment\"\n    | \"absence-of-digits-in-numeric-character-reference\"\n    | \"cdata-in-html-content\"\n    | \"character-reference-outside-unicode-range\"\n    | \"control-character-in-input-stream\"\n    | \"control-character-reference\"\n    | \"eof-before-tag-name\"\n    | \"eof-in-cdata\"\n    | \"eof-in-comment\"\n    | \"eof-in-tag\"\n    | \"incorrectly-closed-comment\"\n    | \"incorrectly-opened-comment\"\n    | \"invalid-first-character-of-tag-name\"\n    | \"missing-attribute-value\"\n    | \"missing-end-tag-name\"\n    | \"missing-semicolon-after-character-reference\"\n    | \"missing-whitespace-between-attributes\"\n    | \"nested-comment\"\n    | \"noncharacter-character-reference\"\n    | \"noncharacter-in-input-stream\"\n    | \"null-character-reference\"\n    | \"surrogate-character-reference\"\n    | \"surrogate-in-input-stream\"\n    | \"unexpected-character-in-attribute-name\"\n    | \"unexpected-character-in-unquoted-attribute-value\"\n    | \"unexpected-equals-sign-before-attribute-name\"\n    | \"unexpected-null-character\"\n    | \"unexpected-question-mark-instead-of-tag-name\"\n    | \"unexpected-solidus-in-tag\"\n    | \"unknown-named-character-reference\"\n    | \"end-tag-with-attributes\"\n    | \"duplicate-attribute\"\n    | \"end-tag-with-trailing-solidus\"\n    | \"non-void-html-element-start-tag-with-trailing-solidus\"\n    | \"x-invalid-end-tag\"\n    | \"x-invalid-namespace\"\n    | \"x-missing-interpolation-end\"\n// ---- Use RAWTEXT state for <script> elements instead ----\n// \"eof-in-script-html-comment-like-text\" |\n// ---- Use BOGUS_COMMENT state for DOCTYPEs instead ----\n// \"abrupt-doctype-public-identifier\" |\n// \"abrupt-doctype-system-identifier\" |\n// \"eof-in-doctype\" |\n// \"invalid-character-sequence-after-doctype-name\" |\n// \"missing-doctype-name\" |\n// \"missing-doctype-public-identifier\" |\n// \"missing-doctype-system-identifier\" |\n// \"missing-quote-before-doctype-public-identifier\" |\n// \"missing-quote-before-doctype-system-identifier\" |\n// \"missing-whitespace-after-doctype-public-keyword\" |\n// \"missing-whitespace-after-doctype-system-keyword\" |\n// \"missing-whitespace-before-doctype-name\" |\n// \"missing-whitespace-between-doctype-public-and-system-identifiers\" |\n// \"unexpected-character-after-doctype-system-identifier\" |\n","/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * @copyright 2017 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\nimport type { ScopeManager } from \"eslint-scope\"\nimport type { ParseError } from \"./errors\"\nimport type { HasLocation } from \"./locations\"\nimport type { Token } from \"./tokens\"\nimport type { TSESTree } from \"@typescript-eslint/utils\"\nimport type { ParserServices } from \"../parser-services\"\n\n//------------------------------------------------------------------------------\n// Common\n//------------------------------------------------------------------------------\n\n/**\n * Objects which have their parent.\n */\nexport interface HasParent {\n    parent?: Node | null\n}\n\n/**\n * The union type for all nodes.\n */\nexport type Node =\n    | ESLintNode\n    | VNode\n    | VForExpression\n    | VOnExpression\n    | VSlotScopeExpression\n    | VGenericExpression\n    | VFilterSequenceExpression\n    | VFilter\n\n//------------------------------------------------------------------------------\n// Script\n//------------------------------------------------------------------------------\n\n/**\n * The union type for ESLint nodes.\n */\nexport type ESLintNode =\n    | ESLintIdentifier\n    | ESLintLiteral\n    | ESLintProgram\n    | ESLintSwitchCase\n    | ESLintCatchClause\n    | ESLintVariableDeclarator\n    | ESLintStatement\n    | ESLintExpression\n    | ESLintProperty\n    | ESLintAssignmentProperty\n    | ESLintSuper\n    | ESLintTemplateElement\n    | ESLintSpreadElement\n    | ESLintPattern\n    | ESLintClassBody\n    | ESLintMethodDefinition\n    | ESLintPropertyDefinition\n    | ESLintStaticBlock\n    | ESLintPrivateIdentifier\n    | ESLintModuleDeclaration\n    | ESLintModuleSpecifier\n    | ESLintImportExpression\n    | ESLintLegacyRestProperty\n\n/**\n * The parsing result of ESLint custom parsers.\n */\nexport interface ESLintExtendedProgram {\n    ast: ESLintProgram\n    services?: ParserServices\n    visitorKeys?: { [type: string]: string[] }\n    scopeManager?: ScopeManager\n}\n\nexport interface ESLintProgram extends HasLocation, HasParent {\n    type: \"Program\"\n    sourceType: \"script\" | \"module\"\n    body: (ESLintStatement | ESLintModuleDeclaration)[]\n    templateBody?: VElement & HasConcreteInfo\n    tokens?: Token[]\n    comments?: Token[]\n    errors?: ParseError[]\n}\n\nexport type ESLintStatement =\n    | ESLintExpressionStatement\n    | ESLintBlockStatement\n    | ESLintEmptyStatement\n    | ESLintDebuggerStatement\n    | ESLintWithStatement\n    | ESLintReturnStatement\n    | ESLintLabeledStatement\n    | ESLintBreakStatement\n    | ESLintContinueStatement\n    | ESLintIfStatement\n    | ESLintSwitchStatement\n    | ESLintThrowStatement\n    | ESLintTryStatement\n    | ESLintWhileStatement\n    | ESLintDoWhileStatement\n    | ESLintForStatement\n    | ESLintForInStatement\n    | ESLintForOfStatement\n    | ESLintDeclaration\n\nexport interface ESLintEmptyStatement extends HasLocation, HasParent {\n    type: \"EmptyStatement\"\n}\n\nexport interface ESLintBlockStatement extends HasLocation, HasParent {\n    type: \"BlockStatement\"\n    body: ESLintStatement[]\n}\n\nexport interface ESLintExpressionStatement extends HasLocation, HasParent {\n    type: \"ExpressionStatement\"\n    expression: ESLintExpression\n}\n\nexport interface ESLintIfStatement extends HasLocation, HasParent {\n    type: \"IfStatement\"\n    test: ESLintExpression\n    consequent: ESLintStatement\n    alternate: ESLintStatement | null\n}\n\nexport interface ESLintSwitchStatement extends HasLocation, HasParent {\n    type: \"SwitchStatement\"\n    discriminant: ESLintExpression\n    cases: ESLintSwitchCase[]\n}\n\nexport interface ESLintSwitchCase extends HasLocation, HasParent {\n    type: \"SwitchCase\"\n    test: ESLintExpression | null\n    consequent: ESLintStatement[]\n}\n\nexport interface ESLintWhileStatement extends HasLocation, HasParent {\n    type: \"WhileStatement\"\n    test: ESLintExpression\n    body: ESLintStatement\n}\n\nexport interface ESLintDoWhileStatement extends HasLocation, HasParent {\n    type: \"DoWhileStatement\"\n    body: ESLintStatement\n    test: ESLintExpression\n}\n\nexport interface ESLintForStatement extends HasLocation, HasParent {\n    type: \"ForStatement\"\n    init: ESLintVariableDeclaration | ESLintExpression | null\n    test: ESLintExpression | null\n    update: ESLintExpression | null\n    body: ESLintStatement\n}\n\nexport interface ESLintForInStatement extends HasLocation, HasParent {\n    type: \"ForInStatement\"\n    left: ESLintVariableDeclaration | ESLintPattern\n    right: ESLintExpression\n    body: ESLintStatement\n}\n\nexport interface ESLintForOfStatement extends HasLocation, HasParent {\n    type: \"ForOfStatement\"\n    left: ESLintVariableDeclaration | ESLintPattern\n    right: ESLintExpression\n    body: ESLintStatement\n    await: boolean\n}\n\nexport interface ESLintLabeledStatement extends HasLocation, HasParent {\n    type: \"LabeledStatement\"\n    label: ESLintIdentifier\n    body: ESLintStatement\n}\n\nexport interface ESLintBreakStatement extends HasLocation, HasParent {\n    type: \"BreakStatement\"\n    label: ESLintIdentifier | null\n}\n\nexport interface ESLintContinueStatement extends HasLocation, HasParent {\n    type: \"ContinueStatement\"\n    label: ESLintIdentifier | null\n}\n\nexport interface ESLintReturnStatement extends HasLocation, HasParent {\n    type: \"ReturnStatement\"\n    argument: ESLintExpression | null\n}\n\nexport interface ESLintThrowStatement extends HasLocation, HasParent {\n    type: \"ThrowStatement\"\n    argument: ESLintExpression\n}\n\nexport interface ESLintTryStatement extends HasLocation, HasParent {\n    type: \"TryStatement\"\n    block: ESLintBlockStatement\n    handler: ESLintCatchClause | null\n    finalizer: ESLintBlockStatement | null\n}\n\nexport interface ESLintCatchClause extends HasLocation, HasParent {\n    type: \"CatchClause\"\n    param: ESLintPattern | null\n    body: ESLintBlockStatement\n}\n\nexport interface ESLintWithStatement extends HasLocation, HasParent {\n    type: \"WithStatement\"\n    object: ESLintExpression\n    body: ESLintStatement\n}\n\nexport interface ESLintDebuggerStatement extends HasLocation, HasParent {\n    type: \"DebuggerStatement\"\n}\n\nexport type ESLintDeclaration =\n    | ESLintFunctionDeclaration\n    | ESLintVariableDeclaration\n    | ESLintClassDeclaration\n\nexport interface ESLintFunctionDeclaration extends HasLocation, HasParent {\n    type: \"FunctionDeclaration\"\n    async: boolean\n    generator: boolean\n    id: ESLintIdentifier | null\n    params: ESLintPattern[]\n    body: ESLintBlockStatement\n}\n\nexport interface ESLintVariableDeclaration extends HasLocation, HasParent {\n    type: \"VariableDeclaration\"\n    kind: \"var\" | \"let\" | \"const\"\n    declarations: ESLintVariableDeclarator[]\n}\n\nexport interface ESLintVariableDeclarator extends HasLocation, HasParent {\n    type: \"VariableDeclarator\"\n    id: ESLintPattern\n    init: ESLintExpression | null\n}\n\nexport interface ESLintClassDeclaration extends HasLocation, HasParent {\n    type: \"ClassDeclaration\"\n    id: ESLintIdentifier | null\n    superClass: ESLintExpression | null\n    body: ESLintClassBody\n}\n\nexport interface ESLintClassBody extends HasLocation, HasParent {\n    type: \"ClassBody\"\n    body: (\n        | ESLintMethodDefinition\n        | ESLintPropertyDefinition\n        | ESLintStaticBlock\n    )[]\n}\n\nexport interface ESLintMethodDefinition extends HasLocation, HasParent {\n    type: \"MethodDefinition\"\n    kind: \"constructor\" | \"method\" | \"get\" | \"set\"\n    computed: boolean\n    static: boolean\n    key: ESLintExpression | ESLintPrivateIdentifier\n    value: ESLintFunctionExpression\n}\nexport interface ESLintPropertyDefinition extends HasLocation, HasParent {\n    type: \"PropertyDefinition\"\n    computed: boolean\n    static: boolean\n    key: ESLintExpression | ESLintPrivateIdentifier\n    value: ESLintExpression | null\n}\n\nexport interface ESLintStaticBlock\n    extends HasLocation, HasParent, Omit<ESLintBlockStatement, \"type\"> {\n    type: \"StaticBlock\"\n    body: ESLintStatement[]\n}\n\nexport interface ESLintPrivateIdentifier extends HasLocation, HasParent {\n    type: \"PrivateIdentifier\"\n    name: string\n}\n\nexport type ESLintModuleDeclaration =\n    | ESLintImportDeclaration\n    | ESLintExportNamedDeclaration\n    | ESLintExportDefaultDeclaration\n    | ESLintExportAllDeclaration\n\nexport type ESLintModuleSpecifier =\n    | ESLintImportSpecifier\n    | ESLintImportDefaultSpecifier\n    | ESLintImportNamespaceSpecifier\n    | ESLintExportSpecifier\n\nexport interface ESLintImportDeclaration extends HasLocation, HasParent {\n    type: \"ImportDeclaration\"\n    specifiers: (\n        | ESLintImportSpecifier\n        | ESLintImportDefaultSpecifier\n        | ESLintImportNamespaceSpecifier\n    )[]\n    source: ESLintLiteral\n}\n\nexport interface ESLintImportSpecifier extends HasLocation, HasParent {\n    type: \"ImportSpecifier\"\n    imported: ESLintIdentifier | ESLintStringLiteral\n    local: ESLintIdentifier\n}\n\nexport interface ESLintImportDefaultSpecifier extends HasLocation, HasParent {\n    type: \"ImportDefaultSpecifier\"\n    local: ESLintIdentifier\n}\n\nexport interface ESLintImportNamespaceSpecifier extends HasLocation, HasParent {\n    type: \"ImportNamespaceSpecifier\"\n    local: ESLintIdentifier\n}\n\nexport interface ESLintImportExpression extends HasLocation, HasParent {\n    type: \"ImportExpression\"\n    source: ESLintExpression\n}\n\nexport interface ESLintExportNamedDeclaration extends HasLocation, HasParent {\n    type: \"ExportNamedDeclaration\"\n    declaration?: ESLintDeclaration | null\n    specifiers: ESLintExportSpecifier[]\n    source?: ESLintLiteral | null\n}\n\nexport interface ESLintExportSpecifier extends HasLocation, HasParent {\n    type: \"ExportSpecifier\"\n    local: ESLintIdentifier | ESLintStringLiteral\n    exported: ESLintIdentifier | ESLintStringLiteral\n}\n\nexport interface ESLintExportDefaultDeclaration extends HasLocation, HasParent {\n    type: \"ExportDefaultDeclaration\"\n    declaration: ESLintDeclaration | ESLintExpression\n}\n\nexport interface ESLintExportAllDeclaration extends HasLocation, HasParent {\n    type: \"ExportAllDeclaration\"\n    exported: ESLintIdentifier | ESLintStringLiteral | null\n    source: ESLintLiteral\n}\n\nexport type ESLintExpression =\n    | ESLintThisExpression\n    | ESLintArrayExpression\n    | ESLintObjectExpression\n    | ESLintFunctionExpression\n    | ESLintArrowFunctionExpression\n    | ESLintYieldExpression\n    | ESLintLiteral\n    | ESLintUnaryExpression\n    | ESLintUpdateExpression\n    | ESLintBinaryExpression\n    | ESLintAssignmentExpression\n    | ESLintLogicalExpression\n    | ESLintMemberExpression\n    | ESLintConditionalExpression\n    | ESLintCallExpression\n    | ESLintNewExpression\n    | ESLintSequenceExpression\n    | ESLintTemplateLiteral\n    | ESLintTaggedTemplateExpression\n    | ESLintClassExpression\n    | ESLintMetaProperty\n    | ESLintIdentifier\n    | ESLintAwaitExpression\n    | ESLintChainExpression\n\nexport interface ESLintIdentifier extends HasLocation, HasParent {\n    type: \"Identifier\"\n    name: string\n}\ninterface ESLintLiteralBase extends HasLocation, HasParent {\n    type: \"Literal\"\n    value: string | boolean | null | number | RegExp | bigint\n    raw: string\n    regex?: {\n        pattern: string\n        flags: string\n    }\n    bigint?: string\n}\nexport interface ESLintStringLiteral extends ESLintLiteralBase {\n    value: string\n    regex?: undefined\n    bigint?: undefined\n}\nexport interface ESLintBooleanLiteral extends ESLintLiteralBase {\n    value: boolean\n    regex?: undefined\n    bigint?: undefined\n}\nexport interface ESLintNullLiteral extends ESLintLiteralBase {\n    value: null\n    regex?: undefined\n    bigint?: undefined\n}\nexport interface ESLintNumberLiteral extends ESLintLiteralBase {\n    value: number\n    regex?: undefined\n    bigint?: undefined\n}\nexport interface ESLintRegExpLiteral extends ESLintLiteralBase {\n    value: null | RegExp\n    regex: {\n        pattern: string\n        flags: string\n    }\n    bigint?: undefined\n}\nexport interface ESLintBigIntLiteral extends ESLintLiteralBase {\n    value: null | bigint\n    regex?: undefined\n    bigint: string\n}\nexport type ESLintLiteral =\n    | ESLintStringLiteral\n    | ESLintBooleanLiteral\n    | ESLintNullLiteral\n    | ESLintNumberLiteral\n    | ESLintRegExpLiteral\n    | ESLintBigIntLiteral\n\nexport interface ESLintThisExpression extends HasLocation, HasParent {\n    type: \"ThisExpression\"\n}\n\nexport interface ESLintArrayExpression extends HasLocation, HasParent {\n    type: \"ArrayExpression\"\n    elements: (ESLintExpression | ESLintSpreadElement)[]\n}\n\nexport interface ESLintObjectExpression extends HasLocation, HasParent {\n    type: \"ObjectExpression\"\n    properties: (\n        | ESLintProperty\n        | ESLintSpreadElement\n        | ESLintLegacySpreadProperty\n    )[]\n}\n\nexport interface ESLintProperty extends HasLocation, HasParent {\n    type: \"Property\"\n    kind: \"init\" | \"get\" | \"set\"\n    method: boolean\n    shorthand: boolean\n    computed: boolean\n    key: ESLintExpression\n    value: ESLintExpression | ESLintPattern\n}\n\nexport interface ESLintFunctionExpression extends HasLocation, HasParent {\n    type: \"FunctionExpression\"\n    async: boolean\n    generator: boolean\n    id: ESLintIdentifier | null\n    params: ESLintPattern[]\n    body: ESLintBlockStatement\n}\n\nexport interface ESLintArrowFunctionExpression extends HasLocation, HasParent {\n    type: \"ArrowFunctionExpression\"\n    async: boolean\n    generator: boolean\n    id: ESLintIdentifier | null\n    params: ESLintPattern[]\n    body: ESLintBlockStatement | ESLintExpression\n}\n\nexport interface ESLintSequenceExpression extends HasLocation, HasParent {\n    type: \"SequenceExpression\"\n    expressions: ESLintExpression[]\n}\n\nexport interface ESLintUnaryExpression extends HasLocation, HasParent {\n    type: \"UnaryExpression\"\n    operator: \"-\" | \"+\" | \"!\" | \"~\" | \"typeof\" | \"void\" | \"delete\"\n    prefix: boolean\n    argument: ESLintExpression\n}\n\nexport interface ESLintBinaryExpression extends HasLocation, HasParent {\n    type: \"BinaryExpression\"\n    operator:\n        | \"==\"\n        | \"!=\"\n        | \"===\"\n        | \"!==\"\n        | \"<\"\n        | \"<=\"\n        | \">\"\n        | \">=\"\n        | \"<<\"\n        | \">>\"\n        | \">>>\"\n        | \"+\"\n        | \"-\"\n        | \"*\"\n        | \"/\"\n        | \"%\"\n        | \"**\"\n        | \"|\"\n        | \"^\"\n        | \"&\"\n        | \"in\"\n        | \"instanceof\"\n    left: ESLintExpression | ESLintPrivateIdentifier\n    right: ESLintExpression\n}\n\nexport interface ESLintAssignmentExpression extends HasLocation, HasParent {\n    type: \"AssignmentExpression\"\n    operator:\n        | \"=\"\n        | \"+=\"\n        | \"-=\"\n        | \"*=\"\n        | \"/=\"\n        | \"%=\"\n        | \"**=\"\n        | \"<<=\"\n        | \">>=\"\n        | \">>>=\"\n        | \"|=\"\n        | \"^=\"\n        | \"&=\"\n        | \"||=\"\n        | \"&&=\"\n        | \"??=\"\n    left: ESLintPattern\n    right: ESLintExpression\n}\n\nexport interface ESLintUpdateExpression extends HasLocation, HasParent {\n    type: \"UpdateExpression\"\n    operator: \"++\" | \"--\"\n    argument: ESLintExpression\n    prefix: boolean\n}\n\nexport interface ESLintLogicalExpression extends HasLocation, HasParent {\n    type: \"LogicalExpression\"\n    operator: \"||\" | \"&&\" | \"??\"\n    left: ESLintExpression\n    right: ESLintExpression\n}\n\nexport interface ESLintConditionalExpression extends HasLocation, HasParent {\n    type: \"ConditionalExpression\"\n    test: ESLintExpression\n    alternate: ESLintExpression\n    consequent: ESLintExpression\n}\n\nexport interface ESLintCallExpression extends HasLocation, HasParent {\n    type: \"CallExpression\"\n    optional: boolean\n    callee: ESLintExpression | ESLintSuper\n    arguments: (ESLintExpression | ESLintSpreadElement)[]\n}\n\nexport interface ESLintSuper extends HasLocation, HasParent {\n    type: \"Super\"\n}\n\nexport interface ESLintNewExpression extends HasLocation, HasParent {\n    type: \"NewExpression\"\n    callee: ESLintExpression\n    arguments: (ESLintExpression | ESLintSpreadElement)[]\n}\n\nexport interface ESLintMemberExpression extends HasLocation, HasParent {\n    type: \"MemberExpression\"\n    optional: boolean\n    computed: boolean\n    object: ESLintExpression | ESLintSuper\n    property: ESLintExpression | ESLintPrivateIdentifier\n}\n\nexport interface ESLintYieldExpression extends HasLocation, HasParent {\n    type: \"YieldExpression\"\n    delegate: boolean\n    argument: ESLintExpression | null\n}\n\nexport interface ESLintAwaitExpression extends HasLocation, HasParent {\n    type: \"AwaitExpression\"\n    argument: ESLintExpression\n}\n\nexport interface ESLintTemplateLiteral extends HasLocation, HasParent {\n    type: \"TemplateLiteral\"\n    quasis: ESLintTemplateElement[]\n    expressions: ESLintExpression[]\n}\n\nexport interface ESLintTaggedTemplateExpression extends HasLocation, HasParent {\n    type: \"TaggedTemplateExpression\"\n    tag: ESLintExpression\n    quasi: ESLintTemplateLiteral\n}\n\nexport interface ESLintTemplateElement extends HasLocation, HasParent {\n    type: \"TemplateElement\"\n    tail: boolean\n    value: {\n        cooked: string | null\n        raw: string\n    }\n}\n\nexport interface ESLintClassExpression extends HasLocation, HasParent {\n    type: \"ClassExpression\"\n    id: ESLintIdentifier | null\n    superClass: ESLintExpression | null\n    body: ESLintClassBody\n}\n\nexport interface ESLintMetaProperty extends HasLocation, HasParent {\n    type: \"MetaProperty\"\n    meta: ESLintIdentifier\n    property: ESLintIdentifier\n}\n\nexport type ESLintPattern =\n    | ESLintIdentifier\n    | ESLintObjectPattern\n    | ESLintArrayPattern\n    | ESLintRestElement\n    | ESLintAssignmentPattern\n    | ESLintMemberExpression\n    | ESLintLegacyRestProperty\n\nexport interface ESLintObjectPattern extends HasLocation, HasParent {\n    type: \"ObjectPattern\"\n    properties: (\n        | ESLintAssignmentProperty\n        | ESLintRestElement\n        | ESLintLegacyRestProperty\n    )[]\n}\n\nexport interface ESLintAssignmentProperty extends ESLintProperty {\n    value: ESLintPattern\n    kind: \"init\"\n    method: false\n}\n\nexport interface ESLintArrayPattern extends HasLocation, HasParent {\n    type: \"ArrayPattern\"\n    elements: ESLintPattern[]\n}\n\nexport interface ESLintRestElement extends HasLocation, HasParent {\n    type: \"RestElement\"\n    argument: ESLintPattern\n}\n\nexport interface ESLintSpreadElement extends HasLocation, HasParent {\n    type: \"SpreadElement\"\n    argument: ESLintExpression\n}\n\nexport interface ESLintAssignmentPattern extends HasLocation, HasParent {\n    type: \"AssignmentPattern\"\n    left: ESLintPattern\n    right: ESLintExpression\n}\n\nexport type ESLintChainElement = ESLintCallExpression | ESLintMemberExpression\n\nexport interface ESLintChainExpression extends HasLocation, HasParent {\n    type: \"ChainExpression\"\n    expression: ESLintChainElement\n}\n\n/**\n * Legacy for babel-eslint and espree.\n */\nexport interface ESLintLegacyRestProperty extends HasLocation, HasParent {\n    type: \"RestProperty\" | \"ExperimentalRestProperty\"\n    argument: ESLintPattern\n}\n\n/**\n * Legacy for babel-eslint and espree.\n */\nexport interface ESLintLegacySpreadProperty extends HasLocation, HasParent {\n    type: \"SpreadProperty\" | \"ExperimentalSpreadProperty\"\n    argument: ESLintExpression\n}\n\n//------------------------------------------------------------------------------\n// Template\n//------------------------------------------------------------------------------\n\n/**\n * Constants of namespaces.\n * @see https://infra.spec.whatwg.org/#namespaces\n */\nexport const NS = Object.freeze({\n    HTML: \"http://www.w3.org/1999/xhtml\",\n    MathML: \"http://www.w3.org/1998/Math/MathML\",\n    SVG: \"http://www.w3.org/2000/svg\",\n    XLink: \"http://www.w3.org/1999/xlink\",\n    XML: \"http://www.w3.org/XML/1998/namespace\",\n    XMLNS: \"http://www.w3.org/2000/xmlns/\",\n})\n\n/**\n * Type of namespaces.\n */\nexport type Namespace =\n    | typeof NS.HTML\n    | typeof NS.MathML\n    | typeof NS.SVG\n    | typeof NS.XLink\n    | typeof NS.XML\n    | typeof NS.XMLNS\n\n/**\n * Type of variable definitions.\n */\nexport interface Variable {\n    id: ESLintIdentifier\n    kind: \"v-for\" | \"scope\" | \"generic\"\n    references: Reference[]\n}\n\n/**\n * Type of variable references.\n */\nexport interface Reference {\n    id: ESLintIdentifier\n    mode: \"rw\" | \"r\" | \"w\"\n    variable: Variable | null\n\n    // For typescript-eslint\n    isValueReference?: boolean\n    isTypeReference?: boolean\n}\n\n/**\n * The node of `v-for` directives.\n */\nexport interface VForExpression extends HasLocation, HasParent {\n    type: \"VForExpression\"\n    parent: VExpressionContainer\n    left: ESLintPattern[]\n    right: ESLintExpression\n}\n\n/**\n * The node of `v-on` directives.\n */\nexport interface VOnExpression extends HasLocation, HasParent {\n    type: \"VOnExpression\"\n    parent: VExpressionContainer\n    body: ESLintStatement[]\n}\n\n/**\n * The node of `slot-scope` directives.\n */\nexport interface VSlotScopeExpression extends HasLocation, HasParent {\n    type: \"VSlotScopeExpression\"\n    parent: VExpressionContainer\n    params: ESLintPattern[]\n}\n\n/**\n * The node of `generic` directives.\n */\nexport interface VGenericExpression extends HasLocation, HasParent {\n    type: \"VGenericExpression\"\n    parent: VExpressionContainer\n    params: TSESTree.TSTypeParameterDeclaration[\"params\"]\n    rawParams: string[]\n}\n\n/**\n * The node of a filter sequence which is separated by `|`.\n */\nexport interface VFilterSequenceExpression extends HasLocation, HasParent {\n    type: \"VFilterSequenceExpression\"\n    parent: VExpressionContainer\n    expression: ESLintExpression\n    filters: VFilter[]\n}\n\n/**\n * The node of a filter sequence which is separated by `|`.\n */\nexport interface VFilter extends HasLocation, HasParent {\n    type: \"VFilter\"\n    parent: VFilterSequenceExpression\n    callee: ESLintIdentifier\n    arguments: (ESLintExpression | ESLintSpreadElement)[]\n}\n\n/**\n * The union type of any nodes.\n */\nexport type VNode =\n    | VAttribute\n    | VDirective\n    | VDirectiveKey\n    | VDocumentFragment\n    | VElement\n    | VEndTag\n    | VExpressionContainer\n    | VIdentifier\n    | VLiteral\n    | VStartTag\n    | VText\n\n/**\n * Text nodes.\n */\nexport interface VText extends HasLocation, HasParent {\n    type: \"VText\"\n    parent: VDocumentFragment | VElement\n    value: string\n}\n\n/**\n * The node of JavaScript expression in text.\n * e.g. `{{ name }}`\n */\nexport interface VExpressionContainer extends HasLocation, HasParent {\n    type: \"VExpressionContainer\"\n    parent: VDocumentFragment | VElement | VDirective | VDirectiveKey\n    expression:\n        | ESLintExpression\n        | VFilterSequenceExpression\n        | VForExpression\n        | VOnExpression\n        | VSlotScopeExpression\n        | VGenericExpression\n        | null\n    references: Reference[]\n}\n\n/**\n * Attribute name nodes.\n */\nexport interface VIdentifier extends HasLocation, HasParent {\n    type: \"VIdentifier\"\n    parent: VAttribute | VDirectiveKey\n    name: string\n    rawName: string\n}\n\n/**\n * Attribute name nodes.\n */\nexport interface VDirectiveKey extends HasLocation, HasParent {\n    type: \"VDirectiveKey\"\n    parent: VDirective\n    name: VIdentifier\n    argument: VExpressionContainer | VIdentifier | null\n    modifiers: VIdentifier[]\n}\n\n/**\n * Attribute value nodes.\n */\nexport interface VLiteral extends HasLocation, HasParent {\n    type: \"VLiteral\"\n    parent: VAttribute\n    value: string\n}\n\n/**\n * Static attribute nodes.\n */\nexport interface VAttribute extends HasLocation, HasParent {\n    type: \"VAttribute\"\n    parent: VStartTag\n    directive: false\n    key: VIdentifier\n    value: VLiteral | null\n}\n\n/**\n * Directive nodes.\n */\nexport interface VDirective extends HasLocation, HasParent {\n    type: \"VAttribute\"\n    parent: VStartTag\n    directive: true\n    key: VDirectiveKey\n    value: VExpressionContainer | null\n}\n\n/**\n * Start tag nodes.\n */\nexport interface VStartTag extends HasLocation, HasParent {\n    type: \"VStartTag\"\n    parent: VElement\n    selfClosing: boolean\n    attributes: (VAttribute | VDirective)[]\n}\n\n/**\n * End tag nodes.\n */\nexport interface VEndTag extends HasLocation, HasParent {\n    type: \"VEndTag\"\n    parent: VElement\n}\n\n/**\n * The property which has concrete information.\n */\nexport interface HasConcreteInfo {\n    tokens: Token[]\n    comments: Token[]\n    errors: ParseError[]\n}\n\n/**\n * Element nodes.\n */\nexport interface VElement extends HasLocation, HasParent {\n    type: \"VElement\"\n    parent: VDocumentFragment | VElement\n    namespace: Namespace\n    name: string\n    rawName: string\n    startTag: VStartTag\n    children: (VElement | VText | VExpressionContainer)[]\n    endTag: VEndTag | null\n    variables: Variable[]\n}\n\n/**\n * Root nodes.\n */\nexport interface VDocumentFragment\n    extends HasLocation, HasParent, HasConcreteInfo {\n    type: \"VDocumentFragment\"\n    parent: null\n    children: (VElement | VText | VExpressionContainer | VStyleElement)[]\n}\n\n/**\n * Style element nodes.\n */\nexport interface VStyleElement extends VElement {\n    type: \"VElement\"\n    name: \"style\"\n    style: true\n    children: (VText | VExpressionContainer)[]\n}\n","/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * @copyright 2017 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\nimport type { VisitorKeys } from \"eslint-visitor-keys\"\nimport * as Evk from \"eslint-visitor-keys\"\nimport type { Node } from \"./nodes\"\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\nexport const KEYS = Evk.unionWith({\n    VAttribute: [\"key\", \"value\"],\n    VDirectiveKey: [\"name\", \"argument\", \"modifiers\"],\n    VDocumentFragment: [\"children\"],\n    VElement: [\"startTag\", \"children\", \"endTag\"],\n    VEndTag: [],\n    VExpressionContainer: [\"expression\"],\n    VFilter: [\"callee\", \"arguments\"],\n    VFilterSequenceExpression: [\"expression\", \"filters\"],\n    VForExpression: [\"left\", \"right\"],\n    VIdentifier: [],\n    VLiteral: [],\n    VOnExpression: [\"body\"],\n    VSlotScopeExpression: [\"params\"],\n    VStartTag: [\"attributes\"],\n    VText: [],\n    VGenericExpression: [\"params\"],\n})\n\n/**\n * Check that the given key should be traversed or not.\n * @param key The key to check.\n * @param value The value of the key in the node.\n * @returns `true` if the key should be traversed.\n */\nfunction fallbackKeysFilter(key: string, value: any = null): boolean {\n    return (\n        key !== \"comments\" &&\n        key !== \"leadingComments\" &&\n        key !== \"loc\" &&\n        key !== \"parent\" &&\n        key !== \"range\" &&\n        key !== \"tokens\" &&\n        key !== \"trailingComments\" &&\n        value !== null &&\n        typeof value === \"object\" &&\n        (typeof value.type === \"string\" || Array.isArray(value))\n    )\n}\n\n/**\n * Get the keys of the given node to traverse it.\n * @param node The node to get.\n * @returns The keys to traverse.\n */\nexport function getFallbackKeys(node: Node): string[] {\n    return Object.keys(node).filter((key) =>\n        fallbackKeysFilter(key, node[key as keyof Node]),\n    )\n}\n\n/**\n * Check wheather a given value is a node.\n * @param x The value to check.\n * @returns `true` if the value is a node.\n */\nfunction isNode(x: any): x is Node {\n    return x !== null && typeof x === \"object\" && typeof x.type === \"string\"\n}\n\n/**\n * Traverse the given node.\n * @param node The node to traverse.\n * @param parent The parent node.\n * @param visitor The node visitor.\n */\nfunction traverse(node: Node, parent: Node | null, visitor: Visitor): void {\n    let i = 0\n    let j = 0\n\n    visitor.enterNode(node, parent)\n\n    const keys =\n        (visitor.visitorKeys ?? KEYS)[node.type] ?? getFallbackKeys(node)\n    for (i = 0; i < keys.length; ++i) {\n        const child = (node as any)[keys[i]]\n\n        if (Array.isArray(child)) {\n            for (j = 0; j < child.length; ++j) {\n                if (isNode(child[j])) {\n                    traverse(child[j], node, visitor)\n                }\n            }\n        } else if (isNode(child)) {\n            traverse(child, node, visitor)\n        }\n    }\n\n    visitor.leaveNode(node, parent)\n}\n\n//------------------------------------------------------------------------------\n// Exports\n//------------------------------------------------------------------------------\n\nexport interface Visitor {\n    visitorKeys?: VisitorKeys\n    enterNode(node: Node, parent: Node | null): void\n    leaveNode(node: Node, parent: Node | null): void\n}\n\n/**\n * Traverse the given AST tree.\n * @param node Root node to traverse.\n * @param visitor Visitor.\n */\nexport function traverseNodes(node: Node, visitor: Visitor): void {\n    traverse(node, null, visitor)\n}\n","/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * @copyright 2017 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\n\nexport * from \"./errors\"\nexport * from \"./locations\"\nexport * from \"./nodes\"\nexport * from \"./tokens\"\nexport * from \"./traverse\"\n","/**\n * @see https://github.com/vuejs/vue-next/blob/48de8a42b7fed7a03f7f1ff5d53d6a704252cafe/packages/shared/src/index.ts#L109\n */\nexport function camelize(str: string) {\n    return str.replace(/-(\\w)/gu, (_, c) => (c ? c.toUpperCase() : \"\"))\n}\n\n/**\n * A binary search implementation that finds the index at which `predicate`\n * stops returning `true` and starts returning `false` (consistently) when run\n * on the items of the array. It **assumes** that mapping the array via the\n * predicate results in the shape `[...true[], ...false[]]`. *For any other case\n * the result is unpredictable*.\n *\n * This is the base implementation of the `sortedIndex` functions which define\n * the predicate for the user, for common use-cases.\n *\n * It is similar to `findIndex`, but runs at O(logN), whereas the latter is\n * general purpose function which runs on any array and predicate, but runs at\n * O(N) time.\n *\n * MIT License | Copyright (c) 2018 remeda | https://remedajs.com/\n *\n * The implementation is copied from remeda package:\n * https://github.com/remeda/remeda/blob/df5fe74841c07bc356bbaa2c89bc7ba0cafafd0a/packages/remeda/src/internal/binarySearchCutoffIndex.ts#L15\n */\nfunction binarySearchCutoffIndex<T>(\n    array: readonly T[],\n    predicate: (value: T, index: number, data: readonly T[]) => boolean,\n): number {\n    let lowIndex = 0\n    let highIndex = array.length\n\n    while (lowIndex < highIndex) {\n        const pivotIndex = (lowIndex + highIndex) >>> 1\n        const pivot = array[pivotIndex]\n\n        if (predicate(pivot, pivotIndex, array)) {\n            lowIndex = pivotIndex + 1\n        } else {\n            highIndex = pivotIndex\n        }\n    }\n\n    return highIndex\n}\n\n/**\n * Find the insertion position (index) of an item in an array with items sorted\n * in ascending order; so that `splice(sortedIndex, 0, item)` would result in\n * maintaining the array's sort-ness. The array can contain duplicates.\n * If the item already exists in the array the index would be of the *last*\n * occurrence of the item.\n *\n * Runs in O(logN) time.\n *\n * @param item - The item to insert.\n * @returns Insertion index (In the range 0..data.length).\n * @signature\n *    R.sortedLastIndex(item)(data)\n * @example\n *    R.pipe(['a','a','b','c','c'], sortedLastIndex('c')) // => 5\n *\n * MIT License | Copyright (c) 2018 remeda | https://remedajs.com/\n *\n * The implementation is copied from remeda package:\n * https://github.com/remeda/remeda/blob/df5fe74841c07bc356bbaa2c89bc7ba0cafafd0a/packages/remeda/src/sortedLastIndex.ts#L51\n */\nexport function sortedLastIndex<T>(array: readonly T[], item: T): number {\n    return binarySearchCutoffIndex(array, (pivot) => pivot <= item)\n}\n\n/**\n * Find the insertion position (index) of an item in an array with items sorted\n * in ascending order using a value function; so that\n * `splice(sortedIndex, 0, item)` would result in maintaining the arrays sort-\n * ness. The array can contain duplicates.\n * If the item already exists in the array the index would be of the *first*\n * occurrence of the item.\n *\n * Runs in O(logN) time.\n *\n * See also:\n * * `findIndex` - scans a possibly unsorted array in-order (linear search).\n * * `sortedIndex` - like this function, but doesn't take a callbackfn.\n * * `sortedLastIndexBy` - like this function, but finds the last suitable index.\n * * `sortedLastIndex` - like `sortedIndex`, but finds the last suitable index.\n * * `rankBy` - scans a possibly unsorted array in-order, returning the index based on a sorting criteria.\n *\n * @param data - The (ascending) sorted array.\n * @param item - The item to insert.\n * @param valueFunction - All comparisons would be performed on the result of\n * calling this function on each compared item. Preferably this function should\n * return a `number` or `string`. This function should be the same as the one\n * provided to sortBy to sort the array. The function is called exactly once on\n * each items that is compared against in the array, and once at the beginning\n * on `item`. When called on `item` the `index` argument is `undefined`.\n * @returns Insertion index (In the range 0..data.length).\n * @signature\n *    R.sortedIndexBy(data, item, valueFunction)\n * @example\n *    R.sortedIndexBy([{age:20},{age:22}],{age:21},prop('age')) // => 1\n *\n * MIT License | Copyright (c) 2018 remeda | https://remedajs.com/\n *\n * The implementation is copied from remeda package:\n * https://github.com/remeda/remeda/blob/df5fe74841c07bc356bbaa2c89bc7ba0cafafd0a/packages/remeda/src/sortedIndexBy.ts#L37\n */\nexport function sortedIndexBy<T>(\n    array: readonly T[],\n    item: T,\n    valueFunction: (\n        item: T,\n        index: number | undefined,\n        data: readonly T[],\n    ) => number,\n): number {\n    const value = valueFunction(item, undefined, array)\n\n    return binarySearchCutoffIndex(\n        array,\n        (pivot, index) => valueFunction(pivot, index, array) < value,\n    )\n}\n\n/**\n * Find the insertion position (index) of an item in an array with items sorted\n * in ascending order using a value function; so that\n * `splice(sortedIndex, 0, item)` would result in maintaining the arrays sort-\n * ness. The array can contain duplicates.\n * If the item already exists in the array the index would be of the *last*\n * occurrence of the item.\n *\n * Runs in O(logN) time.\n *\n * See also:\n * * `findIndex` - scans a possibly unsorted array in-order (linear search).\n * * `sortedLastIndex` - a simplified version of this function, without a callbackfn.\n * * `sortedIndexBy` - like this function, but returns the first suitable index.\n * * `sortedIndex` - like `sortedLastIndex` but without a callbackfn.\n * * `rankBy` - scans a possibly unsorted array in-order, returning the index based on a sorting criteria.\n *\n * @param data - The (ascending) sorted array.\n * @param item - The item to insert.\n * @param valueFunction - All comparisons would be performed on the result of\n * calling this function on each compared item. Preferably this function should\n * return a `number` or `string`. This function should be the same as the one\n * provided to sortBy to sort the array. The function is called exactly once on\n * each items that is compared against in the array, and once at the beginning\n * on `item`. When called on `item` the `index` argument is `undefined`.\n * @returns Insertion index (In the range 0..data.length).\n * @signature\n *    R.sortedLastIndexBy(data, item, valueFunction)\n * @example\n *    R.sortedLastIndexBy([{age:20},{age:22}],{age:21},prop('age')) // => 1\n *\n * MIT License | Copyright (c) 2018 remeda | https://remedajs.com/\n *\n * The implementation is copied from remeda package:\n * https://github.com/remeda/remeda/blob/df5fe74841c07bc356bbaa2c89bc7ba0cafafd0a/packages/remeda/src/sortedLastIndexBy.ts#L37\n */\nexport function sortedLastIndexBy<T>(\n    array: readonly T[],\n    item: T,\n    valueFunction: (\n        item: T,\n        index: number | undefined,\n        data: readonly T[],\n    ) => number,\n): number {\n    const value = valueFunction(item, undefined, array)\n\n    return binarySearchCutoffIndex(\n        array,\n        (pivot, index) => valueFunction(pivot, index, array) <= value,\n    )\n}\n\n/**\n * Creates a duplicate-free version of an array.\n *\n * This function takes an array and returns a new array containing only the unique values\n * from the original array, preserving the order of first occurrence.\n *\n * @template T - The type of elements in the array.\n * @param {T[]} arr - The array to process.\n * @returns {T[]} A new array with only unique values from the original array.\n *\n * @example\n * const array = [1, 2, 2, 3, 4, 4, 5];\n * const result = uniq(array);\n * // result will be [1, 2, 3, 4, 5]\n *\n * MIT © Viva Republica, Inc. | https://es-toolkit.dev/\n *\n * The implementation is copied from es-toolkit package:\n * https://github.com/toss/es-toolkit/blob/16709839f131269b84cdd96e9645df52648ccedf/src/array/uniq.ts#L16\n */\nexport function uniq<T>(arr: readonly T[]): T[] {\n    return Array.from(new Set(arr))\n}\n\n/**\n * Returns the intersection of multiple arrays.\n *\n * This function takes multiple arrays and returns a new array containing the elements that are\n * present in all provided arrays. It effectively filters out any elements that are not found\n * in every array.\n *\n * @template T - The type of elements in the arrays.\n * @param {...(ArrayLike<T> | null | undefined)} arrays - The arrays to compare.\n * @returns {T[]} A new array containing the elements that are present in all arrays.\n *\n * @example\n * const array1 = [1, 2, 3, 4, 5];\n * const array2 = [3, 4, 5, 6, 7];\n * const result = intersection(array1, array2);\n * // result will be [3, 4, 5] since these elements are in both arrays.\n *\n * MIT © Viva Republica, Inc. | https://es-toolkit.dev/\n *\n * The implementation is copied from es-toolkit package:\n * https://github.com/toss/es-toolkit/blob/16709839f131269b84cdd96e9645df52648ccedf/src/compat/array/intersection.ts#L22\n * https://github.com/toss/es-toolkit/blob/16709839f131269b84cdd96e9645df52648ccedf/src/array/intersection.ts#L19\n */\nexport function intersection<T>(...arrays: (T[] | null | undefined)[]): T[] {\n    if (arrays.length === 0) {\n        return []\n    }\n\n    let result: T[] = uniq(arrays[0]!)\n\n    for (let i = 1; i < arrays.length; i++) {\n        const array = arrays[i]\n        const secondSet = new Set(array)\n\n        result = result.filter((item) => secondSet.has(item))\n    }\n\n    return result\n}\n\n/**\n * This function takes multiple arrays and returns a new array containing only the unique values\n * from all input arrays, preserving the order of their first occurrence.\n *\n * @template T - The type of elements in the arrays.\n * @param {Array<ArrayLike<T> | null | undefined>} arrays - The arrays to inspect.\n * @returns {T[]} Returns the new array of combined unique values.\n *\n * @example\n * // Returns [2, 1]\n * union([2], [1, 2]);\n *\n * @example\n * // Returns [2, 1, 3]\n * union([2], [1, 2], [2, 3]);\n *\n * @example\n * // Returns [1, 3, 2, [5], [4]] (does not deeply flatten nested arrays)\n * union([1, 3, 2], [1, [5]], [2, [4]]);\n *\n * @example\n * // Returns [0, 2, 1] (ignores non-array values like 3 and { '0': 1 })\n * union([0], 3, { '0': 1 }, null, [2, 1]);\n * @example\n * // Returns [0, 'a', 2, 1] (treats array-like object { 0: 'a', length: 1 } as a valid array)\n * union([0], { 0: 'a', length: 1 }, [2, 1]);\n *\n * MIT © Viva Republica, Inc. | https://es-toolkit.dev/\n *\n * The implementation is copied from es-toolkit package:\n * https://github.com/toss/es-toolkit/blob/16709839f131269b84cdd96e9645df52648ccedf/src/compat/array/union.ts#L61\n * https://github.com/toss/es-toolkit/blob/16709839f131269b84cdd96e9645df52648ccedf/src/compat/array/flattenDepth.ts#L21\n */\nexport function union<T>(...arrays: T[][]): T[] {\n    const flattened = arrays.flat()\n\n    return uniq(flattened)\n}\n","import { sortedLastIndex } from \"../utils/utils\"\nimport type { Location } from \"../ast/index\"\nimport type { LocationCalculator } from \"./location-calculator\"\n/**\n * A class for getting lines and columns location.\n */\nexport class LinesAndColumns {\n    protected ltOffsets: number[]\n\n    /**\n     * Initialize.\n     * @param ltOffsets The list of the offset of line terminators.\n     */\n    public constructor(ltOffsets: number[]) {\n        this.ltOffsets = ltOffsets\n    }\n\n    /**\n     * Calculate the location of the given index.\n     * @param index The index to calculate their location.\n     * @returns The location of the index.\n     */\n    public getLocFromIndex(index: number): Location {\n        const line = sortedLastIndex(this.ltOffsets, index) + 1\n        const column = index - (line === 1 ? 0 : this.ltOffsets[line - 2])\n        return { line, column }\n    }\n\n    public createOffsetLocationCalculator(offset: number): LocationCalculator {\n        return {\n            getFixOffset() {\n                return offset\n            },\n            getLocFromIndex: this.getLocFromIndex.bind(this),\n        }\n    }\n}\n","/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * @copyright 2017 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\nimport { sortedLastIndex } from \"../utils/utils\"\nimport type { Location } from \"../ast/index\"\nimport { LinesAndColumns } from \"./lines-and-columns\"\n\n/**\n * Location calculators.\n */\nexport interface LocationCalculator {\n    /**\n     * Gets the fix location offset of the given offset with using the base offset of this calculator.\n     * @param offset The offset to modify.\n     */\n    getFixOffset(offset: number, kind: \"start\" | \"end\"): number\n\n    /**\n     * Calculate the location of the given index.\n     * @param index The index to calculate their location.\n     * @returns The location of the index.\n     */\n    getLocFromIndex(index: number): Location\n}\n\n/**\n * Location calculators.\n *\n * HTML tokenizers remove several characters to handle HTML entities and line terminators.\n * Tokens have the processed text as their value, but tokens have offsets and locations in the original text.\n * This calculator calculates the original locations from the processed texts.\n *\n * This calculator will be used for:\n *\n * - Adjusts the locations of script ASTs.\n * - Creates expression containers in postprocess.\n */\nexport class LocationCalculatorForHtml\n    extends LinesAndColumns\n    implements LocationCalculator\n{\n    private gapOffsets: number[]\n    private baseOffset: number\n    private baseIndexOfGap: number\n    private shiftOffset: number\n\n    /**\n     * Initialize this calculator.\n     * @param gapOffsets The list of the offset of removed characters in tokenization phase.\n     * @param ltOffsets The list of the offset of line terminators.\n     * @param baseOffset The base offset to calculate locations.\n     * @param shiftOffset The shift offset to calculate locations.\n     */\n    public constructor(\n        gapOffsets: number[],\n        ltOffsets: number[],\n        baseOffset?: number,\n        shiftOffset = 0,\n    ) {\n        super(ltOffsets)\n        this.gapOffsets = gapOffsets\n        this.ltOffsets = ltOffsets\n        this.baseOffset = baseOffset ?? 0\n        this.baseIndexOfGap =\n            this.baseOffset === 0\n                ? 0\n                : sortedLastIndex(gapOffsets, this.baseOffset)\n        this.shiftOffset = shiftOffset\n    }\n\n    /**\n     * Get sub calculator which have the given base offset.\n     * @param offset The base offset of new sub calculator.\n     * @returns Sub calculator.\n     */\n    public getSubCalculatorAfter(offset: number): LocationCalculatorForHtml {\n        return new LocationCalculatorForHtml(\n            this.gapOffsets,\n            this.ltOffsets,\n            this.baseOffset + offset,\n            this.shiftOffset,\n        )\n    }\n\n    /**\n     * Get sub calculator that shifts the given offset.\n     * @param offset The shift of new sub calculator.\n     * @returns Sub calculator.\n     */\n    public getSubCalculatorShift(offset: number): LocationCalculatorForHtml {\n        return new LocationCalculatorForHtml(\n            this.gapOffsets,\n            this.ltOffsets,\n            this.baseOffset,\n            this.shiftOffset + offset,\n        )\n    }\n\n    /**\n     * Calculate gap at the given index.\n     * @param index The index to calculate gap.\n     */\n    private _getGap(index: number): number {\n        const offsets = this.gapOffsets\n        let g0 = sortedLastIndex(offsets, index + this.baseOffset)\n        let pos = index + this.baseOffset + g0 - this.baseIndexOfGap\n\n        while (g0 < offsets.length && offsets[g0] <= pos) {\n            g0 += 1\n            pos += 1\n        }\n\n        return g0 - this.baseIndexOfGap\n    }\n\n    /**\n     * Calculate the location of the given index.\n     * @param index The index to calculate their location.\n     * @returns The location of the index.\n     */\n    public getLocation(index: number): Location {\n        return this.getLocFromIndex(this.getOffsetWithGap(index))\n    }\n\n    /**\n     * Calculate the offset of the given index.\n     * @param index The index to calculate their location.\n     * @returns The offset of the index.\n     */\n    public getOffsetWithGap(index: number): number {\n        return index + this.getFixOffset(index)\n    }\n\n    /**\n     * Gets the fix location offset of the given offset with using the base offset of this calculator.\n     * @param offset The offset to modify.\n     */\n    public getFixOffset(offset: number): number {\n        const shiftOffset = this.shiftOffset\n        const gap = this._getGap(offset + shiftOffset)\n        return this.baseOffset + gap + shiftOffset\n    }\n}\n","/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * @copyright 2017 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\nimport debugFactory from \"debug\"\nexport const debug = debugFactory(\"vue-eslint-parser\")\n","import type {\n    VAttribute,\n    VDirective,\n    VDocumentFragment,\n    VElement,\n    VExpressionContainer,\n    VGenericExpression,\n    VNode,\n} from \"../ast/index\"\n\n/**\n * Check whether the node is a `<script>` element.\n * @param node The node to check.\n * @returns `true` if the node is a `<script>` element.\n */\nexport function isScriptElement(node: VNode): node is VElement {\n    return node.type === \"VElement\" && node.name === \"script\"\n}\n\n/**\n * Checks whether the given script element is `<script setup>`.\n */\nexport function isScriptSetupElement(script: VElement): boolean {\n    return (\n        isScriptElement(script) &&\n        script.startTag.attributes.some(\n            (attr) => !attr.directive && attr.key.name === \"setup\",\n        )\n    )\n}\n\n/**\n * Check whether the node is a `<template>` element.\n * @param node The node to check.\n * @returns `true` if the node is a `<template>` element.\n */\nexport function isTemplateElement(node: VNode): node is VElement {\n    return node.type === \"VElement\" && node.name === \"template\"\n}\n\n/**\n * Check whether the node is a `<style>` element.\n * @param node The node to check.\n * @returns `true` if the node is a `<style>` element.\n */\nexport function isStyleElement(node: VNode): node is VElement {\n    return node.type === \"VElement\" && node.name === \"style\"\n}\n\n/**\n * Get the belonging document of the given node.\n * @param leafNode The node to get.\n * @returns The belonging document.\n */\nexport function getOwnerDocument(leafNode: VNode): VDocumentFragment | null {\n    let node: VNode | null = leafNode\n    while (node != null && node.type !== \"VDocumentFragment\") {\n        node = node.parent\n    }\n    return node\n}\n\n/**\n * Check whether the attribute node is a `lang` attribute.\n * @param attribute The attribute node to check.\n * @returns `true` if the attribute node is a `lang` attribute.\n */\nexport function isLang(\n    attribute: VAttribute | VDirective,\n): attribute is VAttribute {\n    return attribute.directive === false && attribute.key.name === \"lang\"\n}\n\n/**\n * Get the `lang` attribute value from a given element.\n * @param element The element to get.\n * @param defaultLang The default value of the `lang` attribute.\n * @returns The `lang` attribute value.\n */\nexport function getLang(element: VElement | undefined): string | null {\n    const langAttr = element?.startTag.attributes.find(isLang)\n    const lang = langAttr?.value?.value\n    return lang || null\n}\n/**\n * Check whether the given script element has `lang=\"ts\"`.\n * @param element The element to check.\n * @returns The given script element has `lang=\"ts\"`.\n */\nexport function isTSLang(element: VElement | undefined): boolean {\n    const lang = getLang(element)\n    // See https://github.com/vuejs/core/blob/28e30c819df5e4fc301c98f7be938fa13e8be3bc/packages/compiler-sfc/src/compileScript.ts#L179\n    return lang === \"ts\" || lang === \"tsx\"\n}\n\nexport type GenericDirective = VDirective & {\n    value: VExpressionContainer & {\n        expression: VGenericExpression\n    }\n}\n\n/**\n * Find `generic` directive from given `<script>` element\n */\nexport function findGenericDirective(\n    element: VElement,\n): GenericDirective | null {\n    return (\n        element.startTag.attributes.find(\n            (attr): attr is GenericDirective =>\n                attr.directive &&\n                attr.value?.expression?.type === \"VGenericExpression\",\n        ) || null\n    )\n}\n","import type { ESLintExtendedProgram, ESLintProgram } from \"../ast/index\"\n\n/**\n * The type of basic ESLint custom parser.\n * e.g. espree\n */\nexport type BasicParserObject<R = ESLintProgram> = {\n    parse(code: string, options: any): R\n    parseForESLint: undefined\n}\n/**\n * The type of ESLint custom parser enhanced for ESLint.\n * e.g. @babel/eslint-parser, @typescript-eslint/parser\n */\nexport type EnhancedParserObject<R = ESLintExtendedProgram> = {\n    parseForESLint(code: string, options: any): R\n    parse: undefined\n}\n\n/**\n * The type of ESLint (custom) parsers.\n */\nexport type ParserObject<R1 = ESLintExtendedProgram, R2 = ESLintProgram> =\n    | EnhancedParserObject<R1>\n    | BasicParserObject<R2>\n\nexport function isParserObject<R1, R2>(\n    value: ParserObject<R1, R2> | {} | undefined | null,\n): value is ParserObject<R1, R2> {\n    return isEnhancedParserObject(value) || isBasicParserObject(value)\n}\nexport function isEnhancedParserObject<R>(\n    value: EnhancedParserObject<R> | {} | undefined | null,\n): value is EnhancedParserObject<R> {\n    return Boolean(value && typeof (value as any).parseForESLint === \"function\")\n}\nexport function isBasicParserObject<R>(\n    value: BasicParserObject<R> | {} | undefined | null,\n): value is BasicParserObject<R> {\n    return Boolean(value && typeof (value as any).parse === \"function\")\n}\n","import * as path from \"path\"\nimport type { VDocumentFragment } from \"../ast/index\"\nimport type { CustomTemplateTokenizerConstructor } from \"../html/custom-tokenizer\"\nimport { getLang, isScriptElement, isScriptSetupElement } from \"./ast-utils\"\nimport type { ParserObject } from \"./parser-object\"\nimport { isParserObject } from \"./parser-object\"\n\nexport interface ParserOptions {\n    // vue-eslint-parser options\n    parser?:\n        | boolean\n        | string\n        | ParserObject\n        | Record<string, string | ParserObject | undefined>\n    vueFeatures?: {\n        interpolationAsNonHTML?: boolean // default true\n        filter?: boolean // default true\n        styleCSSVariableInjection?: boolean // default true\n        customMacros?: string[]\n    }\n\n    // espree options\n    ecmaVersion?: number | \"latest\"\n    sourceType?: \"script\" | \"module\"\n    ecmaFeatures?: { [key: string]: any }\n\n    // @typescript-eslint/parser options\n    jsxPragma?: string\n    jsxFragmentName?: string | null\n    lib?: string[]\n\n    project?: string | string[]\n    projectService?: boolean | ProjectServiceOptions\n    projectFolderIgnoreList?: string[]\n    tsconfigRootDir?: string\n    extraFileExtensions?: string[]\n    warnOnUnsupportedTypeScriptVersion?: boolean\n\n    // set by eslint\n    filePath?: string\n    // enables by eslint\n    comment?: boolean\n    loc?: boolean\n    range?: boolean\n    tokens?: boolean\n\n    // From ESLint\n    eslintScopeManager?: boolean\n\n    // others\n    // [key: string]: any\n\n    templateTokenizer?: Record<\n        string,\n        string | CustomTemplateTokenizerConstructor | undefined\n    >\n}\n\ninterface ProjectServiceOptions {\n    allowDefaultProject?: string[]\n    defaultProject?: string\n    loadTypeScriptPlugins?: boolean\n    maximumDefaultProjectFileMatchCount_THIS_WILL_SLOW_DOWN_LINTING?: number\n}\n\nexport function isSFCFile(parserOptions: ParserOptions) {\n    if (parserOptions.filePath === \"<input>\") {\n        return true\n    }\n    return path.extname(parserOptions.filePath || \"unknown.vue\") === \".vue\"\n}\n\n/**\n * Gets the script parser name from the given parser lang.\n */\nexport function getScriptParser(\n    parser:\n        | boolean\n        | string\n        | ParserObject\n        | Record<string, string | ParserObject | undefined>\n        | undefined,\n    getParserLang: () => string | null | Iterable<string | null>,\n): string | ParserObject | undefined {\n    if (isParserObject(parser)) {\n        return parser\n    }\n    if (parser && typeof parser === \"object\") {\n        const parserLang = getParserLang()\n        const parserLangs =\n            parserLang == null\n                ? []\n                : typeof parserLang === \"string\"\n                  ? [parserLang]\n                  : parserLang\n        for (const lang of parserLangs) {\n            const parserForLang = lang && parser[lang]\n            if (\n                typeof parserForLang === \"string\" ||\n                isParserObject(parserForLang)\n            ) {\n                return parserForLang\n            }\n        }\n        return parser.js\n    }\n    return typeof parser === \"string\" ? parser : undefined\n}\n\nexport function getParserLangFromSFC(doc: VDocumentFragment): string | null {\n    if (doc) {\n        const scripts = doc.children.filter(isScriptElement)\n        const script =\n            (scripts.length === 2 && scripts.find(isScriptSetupElement)) ||\n            scripts[0]\n        if (script) {\n            return getLang(script)\n        }\n    }\n    return null\n}\n","import * as escope from \"eslint-scope\"\nimport { lte } from \"semver\"\nimport path from \"path\"\nimport { createRequire } from \"module\"\n\ntype ESLintScope = typeof escope & {\n    version: string\n}\nlet escopeCache: ESLintScope | null = null\n\n/**\n * Load the newest `eslint-scope` from the loaded ESLint or dependency.\n */\nexport function getEslintScope(): ESLintScope {\n    return escopeCache ?? (escopeCache = getNewest())\n}\n\n/**\n * Load the newest `eslint-scope` from the    dependency.\n */\nfunction getNewest(): ESLintScope {\n    let newest = escope\n    const userEscope = getEslintScopeFromUser()\n    if (userEscope.version != null && lte(newest.version, userEscope.version)) {\n        newest = userEscope\n    }\n    return newest\n}\n\n/**\n * Load `eslint-scope` from the user dir.\n */\nfunction getEslintScopeFromUser(): ESLintScope {\n    try {\n        const cwd = process.cwd()\n        const relativeTo = path.join(cwd, \"__placeholder__.js\")\n        return createRequire(relativeTo)(\"eslint-scope\")\n    } catch {\n        return escope\n    }\n}\n","import type { ParserOptions } from \"../common/parser-options\"\n// @ts-expect-error -- ignore\nimport * as dependencyEspree from \"espree\"\nimport { lte } from \"semver\"\nimport path from \"path\"\nimport type { BasicParserObject } from \"./parser-object\"\nimport { createRequire } from \"module\"\n\ntype Espree = BasicParserObject & {\n    latestEcmaVersion: number\n    version: string\n}\nlet espreeCache: Espree | null = null\n\n/**\n * Gets the espree that the given ecmaVersion can parse.\n */\nexport function getEspree(): Espree {\n    return espreeCache ?? (espreeCache = getNewestEspree())\n}\n\nexport function getEcmaVersionIfUseEspree(\n    parserOptions: ParserOptions,\n): number | undefined {\n    if (parserOptions.parser != null && parserOptions.parser !== \"espree\") {\n        return undefined\n    }\n\n    if (\n        parserOptions.ecmaVersion === \"latest\" ||\n        parserOptions.ecmaVersion == null\n    ) {\n        return getDefaultEcmaVersion()\n    }\n    return normalizeEcmaVersion(parserOptions.ecmaVersion)\n}\n\n/**\n * Load `espree` from the user dir.\n */\nfunction getEspreeFromUser(): Espree {\n    try {\n        const cwd = process.cwd()\n        const relativeTo = path.join(cwd, \"__placeholder__.js\")\n        return createRequire(relativeTo)(\"espree\")\n    } catch {\n        return dependencyEspree\n    }\n}\n\n/**\n * Load the newest `espree` from the dependency.\n */\nfunction getNewestEspree(): Espree {\n    let newest = dependencyEspree\n    const userEspree = getEspreeFromUser()\n    if (userEspree.version != null && lte(newest.version, userEspree.version)) {\n        newest = userEspree\n    }\n    return newest\n}\n\nfunction getDefaultEcmaVersion(): number {\n    return getLatestEcmaVersion(getEspree())\n}\n\n/**\n * Normalize ECMAScript version\n */\nfunction normalizeEcmaVersion(version: number) {\n    if (version > 5 && version < 2015) {\n        return version + 2009\n    }\n    return version\n}\n\nfunction getLatestEcmaVersion(espree: Espree) {\n    return normalizeEcmaVersion(espree.latestEcmaVersion)\n}\n","export const DEFAULT_ECMA_VERSION = \"latest\"\n\nexport const ANALYZE_SCOPE_DEFAULT_ECMA_VERSION = 2022\n","/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * @copyright 2017 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\nimport type * as escopeTypes from \"eslint-scope\"\nimport type { ParserOptions } from \"../common/parser-options\"\nimport type {\n    ESLintIdentifier,\n    ESLintProgram,\n    Reference,\n    Variable,\n} from \"../ast/index\"\nimport { getFallbackKeys } from \"../ast/index\"\nimport { getEslintScope } from \"../common/eslint-scope\"\nimport { getEcmaVersionIfUseEspree } from \"../common/espree\"\nimport { ANALYZE_SCOPE_DEFAULT_ECMA_VERSION } from \"../script-setup/parser-options\"\n\ntype ParserResult = {\n    ast: ESLintProgram\n    scopeManager?: escopeTypes.ScopeManager\n}\n\n/**\n * Check whether the given reference is unique in the belonging array.\n * @param reference The current reference to check.\n * @param index The index of the reference.\n * @param references The belonging array of the reference.\n */\nfunction isUnique(\n    reference: escopeTypes.Reference,\n    index: number,\n    references: escopeTypes.Reference[],\n): boolean {\n    return (\n        index === 0 || reference.identifier !== references[index - 1].identifier\n    )\n}\n\n/**\n * Check whether a given variable has that definition.\n * @param variable The variable to check.\n * @returns `true` if the variable has that definition.\n */\nfunction hasDefinition(variable: escopeTypes.Variable): boolean {\n    return variable.defs.length >= 1\n}\n\n/**\n * Transform the given reference object.\n * @param reference The source reference object.\n * @returns The transformed reference object.\n */\nfunction transformReference(reference: escopeTypes.Reference): Reference {\n    const ret: Reference = {\n        id: reference.identifier as ESLintIdentifier,\n        mode: reference.isReadOnly()\n            ? \"r\"\n            : reference.isWriteOnly()\n              ? \"w\"\n              : /* otherwise */ \"rw\",\n        variable: null,\n        isValueReference: reference.isValueReference,\n        isTypeReference: reference.isTypeReference,\n    }\n    Object.defineProperty(ret, \"variable\", { enumerable: false })\n\n    return ret\n}\n\n/**\n * Transform the given variable object.\n * @param variable The source variable object.\n * @returns The transformed variable object.\n */\nfunction transformVariable(\n    variable: escopeTypes.Variable,\n    kind: Variable[\"kind\"],\n): Variable {\n    const ret: Variable = {\n        id: variable.defs[0].name as ESLintIdentifier,\n        kind,\n        references: [],\n    }\n    Object.defineProperty(ret, \"references\", { enumerable: false })\n\n    return ret\n}\n\n/**\n * Get the `for` statement scope.\n * @param scope The global scope.\n * @returns The `for` statement scope.\n */\nfunction getForScope(scope: escopeTypes.Scope): escopeTypes.Scope {\n    const child = scope.childScopes[0]\n    return child.block === scope.block ? child.childScopes[0] : child\n}\n\nexport function analyzeScope(\n    ast: ESLintProgram,\n    parserOptions: ParserOptions,\n): escopeTypes.ScopeManager {\n    const ecmaVersion =\n        getEcmaVersionIfUseEspree(parserOptions) ??\n        ANALYZE_SCOPE_DEFAULT_ECMA_VERSION\n    const ecmaFeatures = parserOptions.ecmaFeatures ?? {}\n    const sourceType = parserOptions.sourceType ?? \"script\"\n    const result = getEslintScope().analyze(ast, {\n        ignoreEval: true,\n        nodejsScope: false,\n        impliedStrict: ecmaFeatures.impliedStrict,\n        ecmaVersion,\n        sourceType,\n        fallback: getFallbackKeys,\n    })\n\n    return result\n}\n\n/**\n * Analyze the scope of the given AST.\n * @param {ParserResult} parserResult The parser result to analyze.\n * @param parserOptions\n */\nfunction analyze(\n    parserResult: ParserResult,\n    parserOptions: ParserOptions,\n): escopeTypes.Scope {\n    const scopeManager =\n        parserResult.scopeManager ||\n        analyzeScope(parserResult.ast, parserOptions)\n    return scopeManager.globalScope\n}\n\n/**\n * Analyze the external references of the given AST.\n * @param {ParserResult} parserResult The parser result to analyze.\n * @returns {Reference[]} The reference objects of external references.\n */\nexport function analyzeExternalReferences(\n    parserResult: ParserResult,\n    parserOptions: ParserOptions,\n): Reference[] {\n    const scope = analyze(parserResult, parserOptions)\n    return scope.through.filter(isUnique).map(transformReference)\n}\n\n/**\n * Analyze the external references of the given AST.\n * @param {ParserResult} parserResult The parser result to analyze.\n * @returns {Reference[]} The reference objects of external references.\n */\nexport function analyzeVariablesAndExternalReferences(\n    parserResult: ParserResult,\n    kind: Variable[\"kind\"],\n    parserOptions: ParserOptions,\n): { variables: Variable[]; references: Reference[] } {\n    const scope = analyze(parserResult, parserOptions)\n    return {\n        variables: getForScope(scope)\n            .variables.filter(hasDefinition)\n            .map((v) => transformVariable(v, kind)),\n        references: scope.through.filter(isUnique).map(transformReference),\n    }\n}\n","import type {\n    ESLintExtendedProgram,\n    ESLintNode,\n    HasLocation,\n    LocationRange,\n    Node,\n    ParseError,\n} from \"../ast/index\"\nimport { traverseNodes } from \"../ast/index\"\nimport type { LocationCalculator } from \"./location-calculator\"\n\n/**\n * Do post-process of parsing an expression.\n *\n * 1. Set `node.parent`.\n * 2. Fix `node.range` and `node.loc` for HTML entities.\n *\n * @param result The parsing result to modify.\n * @param locationCalculator The location calculator to modify.\n */\nexport function fixLocations(\n    result: ESLintExtendedProgram,\n    locationCalculator: LocationCalculator,\n): void {\n    fixNodeLocations(result.ast, result.visitorKeys, locationCalculator)\n\n    for (const token of result.ast.tokens ?? []) {\n        fixLocation(token, locationCalculator)\n    }\n    for (const comment of result.ast.comments ?? []) {\n        fixLocation(comment, locationCalculator)\n    }\n}\n\nexport function fixNodeLocations(\n    rootNode: ESLintNode,\n    visitorKeys: ESLintExtendedProgram[\"visitorKeys\"],\n    locationCalculator: LocationCalculator,\n): void {\n    // There are cases which the same node instance appears twice in the tree.\n    // E.g. `let {a} = {}` // This `a` appears twice at `Property#key` and `Property#value`.\n    const traversed = new Map<Node | number[] | LocationRange, Node>()\n\n    traverseNodes(rootNode, {\n        visitorKeys,\n\n        enterNode(node, parent) {\n            if (!traversed.has(node)) {\n                traversed.set(node, node)\n                node.parent = parent\n\n                // `babel-eslint@8` has shared `Node#range` with multiple nodes.\n                // See also: https://github.com/vuejs/eslint-plugin-vue/issues/208\n                if (traversed.has(node.range)) {\n                    if (!traversed.has(node.loc)) {\n                        // However, `Node#loc` may not be shared.\n                        // See also: https://github.com/vuejs/vue-eslint-parser/issues/84\n                        node.loc.start = locationCalculator.getLocFromIndex(\n                            node.range[0],\n                        )\n                        node.loc.end = locationCalculator.getLocFromIndex(\n                            node.range[1],\n                        )\n                        traversed.set(node.loc, node)\n                    } else if (node.start != null || node.end != null) {\n                        const traversedNode = traversed.get(node.range)!\n                        if (traversedNode.type === node.type) {\n                            node.start = traversedNode.start\n                            node.end = traversedNode.end\n                        }\n                    }\n                } else {\n                    fixLocation(node, locationCalculator)\n                    traversed.set(node.range, node)\n                    traversed.set(node.loc, node)\n                }\n            }\n        },\n\n        leaveNode() {\n            // Do nothing.\n        },\n    })\n}\n\n/**\n * Modify the location information of the given node with using the base offset and gaps of this calculator.\n * @param node The node to modify their location.\n */\nexport function fixLocation<T extends HasLocation>(\n    node: T,\n    locationCalculator: LocationCalculator,\n): T {\n    const range = node.range\n    const loc = node.loc\n    const d0 = locationCalculator.getFixOffset(range[0], \"start\")\n    const d1 = locationCalculator.getFixOffset(range[1], \"end\")\n\n    if (d0 !== 0) {\n        range[0] += d0\n        if (node.start != null) {\n            node.start += d0\n        }\n        loc.start = locationCalculator.getLocFromIndex(range[0])\n    }\n    if (d1 !== 0) {\n        range[1] += d1\n        if (node.end != null) {\n            node.end += d0\n        }\n        loc.end = locationCalculator.getLocFromIndex(range[1])\n    }\n\n    return node\n}\n\n/**\n * Modify the location information of the given error with using the base offset and gaps of this calculator.\n * @param error The error to modify their location.\n */\nexport function fixErrorLocation(\n    error: ParseError,\n    locationCalculator: LocationCalculator,\n) {\n    const diff = locationCalculator.getFixOffset(error.index, \"start\")\n\n    error.index += diff\n\n    const loc = locationCalculator.getLocFromIndex(error.index)\n    error.lineNumber = loc.line\n    error.column = loc.column\n}\n","import type {\n    ESLintExtendedProgram,\n    ESLintProgram,\n    HasLocation,\n    Token,\n    VElement,\n    VGenericExpression,\n} from \"../ast/index\"\nimport type { TSESTree } from \"@typescript-eslint/utils\"\nimport type {\n    Reference,\n    Scope,\n    Variable,\n    ScopeManager,\n    VariableDefinition,\n} from \"eslint-scope\"\nimport { findGenericDirective } from \"../common/ast-utils\"\n\nexport type GenericProcessInfo = {\n    node: VGenericExpression\n    defineTypes: {\n        node: VGenericExpression[\"params\"][number]\n        define: string\n    }[]\n    postprocess: (context: GenericPostprocessContext) => void\n}\nexport type GenericPostprocessContext = {\n    result: ESLintExtendedProgram\n    getTypeBlock?: (node: ESLintProgram) => {\n        body: ESLintProgram[\"body\"]\n    }\n    isRemoveTarget: (nodeOrToken: HasLocation) => boolean\n    getTypeDefScope: (scopeManager: ScopeManager) => Scope\n}\nexport function extractGeneric(element: VElement): GenericProcessInfo | null {\n    const genericAttr = findGenericDirective(element)\n    if (!genericAttr) {\n        return null\n    }\n    const genericNode = genericAttr.value.expression\n    const defineTypes = genericNode.params.map((t, i) => ({\n        node: t,\n        define: `type ${t.name.name} = ${getConstraint(\n            t,\n            genericNode.rawParams[i],\n        )}`,\n    }))\n\n    return {\n        node: genericNode,\n        defineTypes,\n        postprocess({ result, getTypeBlock, isRemoveTarget, getTypeDefScope }) {\n            const node = getTypeBlock?.(result.ast) ?? result.ast\n            removeTypeDeclarations(node, isRemoveTarget)\n            if (result.ast.tokens) {\n                removeTypeDeclarationTokens(result.ast.tokens, isRemoveTarget)\n            }\n            if (result.ast.comments) {\n                removeTypeDeclarationTokens(result.ast.comments, isRemoveTarget)\n            }\n            if (result.scopeManager) {\n                const typeDefScope = getTypeDefScope(result.scopeManager)\n                restoreScope(result.scopeManager, typeDefScope, isRemoveTarget)\n            }\n        },\n    }\n\n    function removeTypeDeclarations(\n        node: {\n            body: ESLintProgram[\"body\"]\n        },\n        isRemoveTarget: (nodeOrToken: HasLocation) => boolean,\n    ) {\n        for (let index = node.body.length - 1; index >= 0; index--) {\n            if (isRemoveTarget(node.body[index])) {\n                node.body.splice(index, 1)\n            }\n        }\n    }\n\n    function removeTypeDeclarationTokens(\n        tokens: Token[],\n        isRemoveTarget: (nodeOrToken: HasLocation) => boolean,\n    ) {\n        for (let index = tokens.length - 1; index >= 0; index--) {\n            if (isRemoveTarget(tokens[index])) {\n                tokens.splice(index, 1)\n            }\n        }\n    }\n\n    function restoreScope(\n        scopeManager: ScopeManager,\n        typeDefScope: Scope,\n        isRemoveTarget: (nodeOrToken: HasLocation) => boolean,\n    ) {\n        // eslint-disable-next-line unicorn/no-useless-spread -- The original array is mutated\n        for (const variable of [...typeDefScope.variables]) {\n            let def = variable.defs.find((d) =>\n                isRemoveTarget(d.name as HasLocation),\n            )\n            while (def) {\n                removeVariableDef(variable, def, typeDefScope)\n                def = variable.defs.find((d) =>\n                    isRemoveTarget(d.name as HasLocation),\n                )\n            }\n        }\n        // eslint-disable-next-line unicorn/no-useless-spread -- The original array is mutated\n        for (const reference of [...typeDefScope.references]) {\n            if (isRemoveTarget(reference.identifier as HasLocation)) {\n                removeReference(reference, typeDefScope)\n            }\n        }\n\n        // eslint-disable-next-line unicorn/no-useless-spread -- The original array is mutated\n        for (const scope of [...scopeManager.scopes]) {\n            if (isRemoveTarget(scope.block as HasLocation)) {\n                removeScope(scopeManager, scope)\n            }\n        }\n    }\n}\n\nfunction getConstraint(node: TSESTree.TSTypeParameter, rawParam: string) {\n    if (!node.constraint) {\n        return \"unknown\"\n    }\n    let index = rawParam.indexOf(node.name.name) + node.name.name.length\n    let startIndex: number | null = null\n    while (index < rawParam.length) {\n        if (startIndex == null) {\n            if (rawParam.startsWith(\"extends\", index)) {\n                startIndex = index = index + 7\n                continue\n            }\n        } else if (rawParam[index] === \"=\") {\n            if (rawParam[index + 1] === \">\") {\n                // Arrow function type\n                index += 2\n                continue\n            }\n            return rawParam.slice(startIndex, index)\n        }\n        if (rawParam.startsWith(\"//\", index)) {\n            // Skip line comment\n            const lfIndex = rawParam.indexOf(\"\\n\", index)\n            if (lfIndex >= 0) {\n                index = lfIndex + 1\n                continue\n            }\n            return \"unknown\"\n        }\n        if (rawParam.startsWith(\"/*\", index)) {\n            // Skip block comment\n            const endIndex = rawParam.indexOf(\"*/\", index)\n            if (endIndex >= 0) {\n                index = endIndex + 2\n                continue\n            }\n            return \"unknown\"\n        }\n        index++\n    }\n    if (startIndex == null) {\n        return \"unknown\"\n    }\n\n    return rawParam.slice(startIndex)\n}\n\n/** Remove variable def */\nfunction removeVariableDef(\n    variable: Variable,\n    def: VariableDefinition,\n    scope: Scope,\n): void {\n    const defIndex = variable.defs.indexOf(def)\n    if (defIndex < 0) {\n        return\n    }\n    variable.defs.splice(defIndex, 1)\n    if (variable.defs.length === 0) {\n        // Remove variable\n        referencesToThrough(variable.references, scope)\n        variable.references.forEach((r) => {\n            if ((r as any).init) {\n                ;(r as any).init = false\n            }\n            r.resolved = null\n        })\n        scope.variables.splice(scope.variables.indexOf(variable), 1)\n        const name = variable.name\n        if (variable === scope.set.get(name)) {\n            scope.set.delete(name)\n        }\n    } else {\n        const idIndex = variable.identifiers.indexOf(def.name)\n        if (idIndex >= 0) {\n            variable.identifiers.splice(idIndex, 1)\n        }\n    }\n}\n\n/** Move reference to through */\nfunction referencesToThrough(references: Reference[], baseScope: Scope) {\n    let scope: Scope | null = baseScope\n    while (scope) {\n        addAllReferences(scope.through, references)\n        scope = scope.upper\n    }\n}\n\n/**\n * Add all references to array\n */\nfunction addAllReferences(list: Reference[], elements: Reference[]): void {\n    list.push(...elements)\n    list.sort((a, b) => a.identifier.range![0] - b.identifier.range![0])\n}\n\n/** Remove reference */\nfunction removeReference(reference: Reference, baseScope: Scope): void {\n    if (reference.resolved) {\n        if (\n            reference.resolved.defs.some((d) => d.name === reference.identifier)\n        ) {\n            // remove var\n            const varIndex = baseScope.variables.indexOf(reference.resolved)\n            if (varIndex >= 0) {\n                baseScope.variables.splice(varIndex, 1)\n            }\n            const name = reference.identifier.name\n            if (reference.resolved === baseScope.set.get(name)) {\n                baseScope.set.delete(name)\n            }\n        } else {\n            const refIndex = reference.resolved.references.indexOf(reference)\n            if (refIndex >= 0) {\n                reference.resolved.references.splice(refIndex, 1)\n            }\n        }\n    }\n\n    let scope: Scope | null = baseScope\n    while (scope) {\n        const refIndex = scope.references.indexOf(reference)\n        if (refIndex >= 0) {\n            scope.references.splice(refIndex, 1)\n        }\n        const throughIndex = scope.through.indexOf(reference)\n        if (throughIndex >= 0) {\n            scope.through.splice(throughIndex, 1)\n        }\n        scope = scope.upper\n    }\n}\n\n/** Remove scope */\nfunction removeScope(scopeManager: ScopeManager, scope: Scope): void {\n    for (const childScope of scope.childScopes) {\n        removeScope(scopeManager, childScope)\n    }\n\n    while (scope.references[0]) {\n        removeReference(scope.references[0], scope)\n    }\n    const upper = scope.upper\n    if (upper) {\n        const index = upper.childScopes.indexOf(scope)\n        if (index >= 0) {\n            upper.childScopes.splice(index, 1)\n        }\n    }\n    const index = scopeManager.scopes.indexOf(scope)\n    if (index >= 0) {\n        scopeManager.scopes.splice(index, 1)\n    }\n}\n","/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * @copyright 2017 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\nimport { sortedIndexBy } from \"../utils/utils\"\nimport type {\n    ESLintArrayExpression,\n    ESLintArrayPattern,\n    ESLintCallExpression,\n    ESLintExpression,\n    ESLintExpressionStatement,\n    ESLintExtendedProgram,\n    ESLintForInStatement,\n    ESLintForOfStatement,\n    ESLintFunctionExpression,\n    ESLintIdentifier,\n    ESLintUnaryExpression,\n    ESLintVariableDeclaration,\n    HasLocation,\n    Node,\n    Reference,\n    Token,\n    Variable,\n    VElement,\n    VFilter,\n    VFilterSequenceExpression,\n    VForExpression,\n    VOnExpression,\n    VSlotScopeExpression,\n    OffsetRange,\n    VGenericExpression,\n} from \"../ast/index\"\nimport { ParseError } from \"../ast/index\"\nimport { debug } from \"../common/debug\"\nimport type {\n    LocationCalculator,\n    LocationCalculatorForHtml,\n} from \"../common/location-calculator\"\nimport {\n    analyzeExternalReferences,\n    analyzeVariablesAndExternalReferences,\n} from \"./scope-analyzer\"\nimport { getEcmaVersionIfUseEspree, getEspree } from \"../common/espree\"\nimport type { ParserOptions } from \"../common/parser-options\"\nimport {\n    fixErrorLocation,\n    fixLocation,\n    fixLocations,\n} from \"../common/fix-locations\"\nimport { DEFAULT_ECMA_VERSION } from \"../script-setup/parser-options\"\nimport type { LinesAndColumns } from \"../common/lines-and-columns\"\nimport type { ParserObject } from \"../common/parser-object\"\nimport { isEnhancedParserObject, isParserObject } from \"../common/parser-object\"\nimport type { TSESTree } from \"@typescript-eslint/utils\"\nimport type { GenericProcessInfo } from \"./generic\"\nimport { extractGeneric } from \"./generic\"\n\n// [1] = aliases.\n// [2] = delimiter.\n// [3] = iterator.\nconst ALIAS_ITERATOR = /^([\\s\\S]*?(?:\\s|\\)))(\\bin\\b|\\bof\\b)([\\s\\S]*)$/u\nconst PARENS = /^(\\s*\\()([\\s\\S]*?)(\\)\\s*)$/u\nconst DUMMY_PARENT: any = {}\n\n// Like Vue, it judges whether it is a function expression or not.\n// https://github.com/vuejs/core/blob/fef2acb2049fce3407dff17fe8af1836b97dfd73/packages/compiler-core/src/transforms/vOn.ts#L19\nconst IS_FUNCTION_EXPRESSION =\n    /^\\s*([\\w$_]+|(async\\s*)?\\([^)]*?\\))\\s*(:[^=]+)?=>|^\\s*(async\\s+)?function(?:\\s+[\\w$]+)?\\s*\\(/u\n//        ^^^^^^^ omit paren argument                                 ^^^^^^^^ function keyword\n//                 ^^^^^ <--- async keyword (optional) ---> ^^^^^\n//                           ^^------^^ arguments with parens                       ^^^^^^ named function (optional)\n//                                         ^^^^^^^^^ return types (optional)\n//                                                  ^^ arrow                                   ^^ opening paren\n\nconst IS_SIMPLE_PATH =\n    /^[A-Za-z_$][\\w$]*(?:\\.[A-Za-z_$][\\w$]*|\\['[^']*?'\\]|\\[\"[^\"]*?\"\\]|\\[\\d+\\]|\\[[A-Za-z_$][\\w$]*\\])*$/u\n\n/**\n * Parse the alias and iterator of 'v-for' directive values.\n * @param code The code to parse.\n * @returns The parsed result.\n */\nfunction processVForAliasAndIterator(code: string): {\n    aliases: string\n    hasParens: boolean\n    delimiter: string\n    iterator: string\n    aliasesWithBrackets: string\n} {\n    const match = ALIAS_ITERATOR.exec(code)\n    if (match != null) {\n        const aliases = match[1]\n        const parenMatch = PARENS.exec(aliases)\n        return {\n            aliases,\n            hasParens: Boolean(parenMatch),\n            aliasesWithBrackets: parenMatch\n                ? `${parenMatch[1].slice(0, -1)}[${\n                      parenMatch[2]\n                  }]${parenMatch[3].slice(1)}`\n                : `[${aliases.slice(0, -1)}]`,\n            delimiter: match[2] || \"\",\n            iterator: match[3],\n        }\n    }\n    return {\n        aliases: \"\",\n        hasParens: false,\n        aliasesWithBrackets: \"\",\n        delimiter: \"\",\n        iterator: code,\n    }\n}\n\n/**\n * Get the comma token before a given node.\n * @param tokens The token list.\n * @param node The node to get the comma before this node.\n * @returns The comma token.\n */\nfunction getCommaTokenBeforeNode(tokens: Token[], node: Node): Token | null {\n    let tokenIndex = sortedIndexBy(\n        tokens as { range: OffsetRange }[],\n        { range: node.range },\n        (t) => t.range[0],\n    )\n\n    while (tokenIndex >= 0) {\n        const token = tokens[tokenIndex]\n        if (token.type === \"Punctuator\" && token.value === \",\") {\n            return token\n        }\n        tokenIndex -= 1\n    }\n\n    return null\n}\n\n/**\n * Throw syntax error for empty.\n * @param locationCalculator The location calculator to get line/column.\n */\nfunction throwEmptyError(\n    locationCalculator: LocationCalculatorForHtml,\n    expected: string,\n): never {\n    const loc = locationCalculator.getLocation(0)\n    const err = new ParseError(\n        `Expected to be ${expected}, but got empty.`,\n        undefined,\n        0,\n        loc.line,\n        loc.column,\n    )\n    fixErrorLocation(err, locationCalculator)\n\n    throw err\n}\n\n/**\n * Throw syntax error for unexpected token.\n * @param locationCalculator The location calculator to get line/column.\n * @param name The token name.\n * @param token The token object to get that location.\n */\nfunction throwUnexpectedTokenError(name: string, token: HasLocation): never {\n    const err = new ParseError(\n        `Unexpected token '${name}'.`,\n        undefined,\n        token.range[0],\n        token.loc.start.line,\n        token.loc.start.column,\n    )\n\n    throw err\n}\n\n/**\n * Throw syntax error of outside of code.\n * @param locationCalculator The location calculator to get line/column.\n */\nfunction throwErrorAsAdjustingOutsideOfCode(\n    err: any,\n    code: string,\n    locationCalculator: LocationCalculatorForHtml,\n): never {\n    if (ParseError.isParseError(err)) {\n        const endOffset = locationCalculator.getOffsetWithGap(code.length)\n        if (err.index >= endOffset) {\n            err.message = \"Unexpected end of expression.\"\n        }\n    }\n\n    throw err\n}\n\n/**\n * Parse the given source code.\n *\n * @param code The source code to parse.\n * @param locationCalculator The location calculator for fixLocations.\n * @param parserOptions The parser options.\n * @returns The result of parsing.\n */\nexport function parseScriptFragment(\n    code: string,\n    locationCalculator: LocationCalculator,\n    parserOptions: ParserOptions,\n): ESLintExtendedProgram {\n    return parseScriptFragmentWithOption(\n        code,\n        locationCalculator,\n        parserOptions,\n    )\n}\n\n/**\n * Parse the given source code.\n *\n * @param code The source code to parse.\n * @param locationCalculator The location calculator for fixLocations.\n * @param parserOptions The parser options.\n * @param processOptions The process options.\n * @returns The result of parsing.\n */\nfunction parseScriptFragmentWithOption(\n    code: string,\n    locationCalculator: LocationCalculator,\n    parserOptions: ParserOptions,\n    processOptions?: {\n        preFixLocationProcess?: (result: ESLintExtendedProgram) => void\n    },\n): ESLintExtendedProgram {\n    try {\n        const result = parseScript(code, parserOptions)\n        processOptions?.preFixLocationProcess?.(result)\n        fixLocations(result, locationCalculator)\n        return result\n    } catch (err) {\n        const perr = ParseError.normalize(err)\n        if (perr) {\n            fixErrorLocation(perr, locationCalculator)\n            throw perr\n        }\n        throw err\n    }\n}\n\nconst validDivisionCharRE = /[\\w).+\\-_$\\]]/u\n\n/**\n * This is a fork of https://github.com/vuejs/vue/blob/2686818beb5728e3b7aa22f47a3b3f0d39d90c8e/src/compiler/parser/filter-parser.js\n * @param exp the expression to process filters.\n */\n//eslint-disable-next-line complexity\nfunction splitFilters(exp: string): string[] {\n    const result: string[] = []\n    let inSingle = false\n    let inDouble = false\n    let inTemplateString = false\n    let inRegex = false\n    let curly = 0\n    let square = 0\n    let paren = 0\n    let lastFilterIndex = 0\n    let c = 0\n    let prev = 0\n\n    for (let i = 0; i < exp.length; i++) {\n        prev = c\n        c = exp.charCodeAt(i)\n        if (inSingle) {\n            if (c === 0x27 && prev !== 0x5c) {\n                inSingle = false\n            }\n        } else if (inDouble) {\n            if (c === 0x22 && prev !== 0x5c) {\n                inDouble = false\n            }\n        } else if (inTemplateString) {\n            if (c === 0x60 && prev !== 0x5c) {\n                inTemplateString = false\n            }\n        } else if (inRegex) {\n            if (c === 0x2f && prev !== 0x5c) {\n                inRegex = false\n            }\n        } else if (\n            c === 0x7c && // pipe\n            exp.charCodeAt(i + 1) !== 0x7c &&\n            exp.charCodeAt(i - 1) !== 0x7c &&\n            !curly &&\n            !square &&\n            !paren\n        ) {\n            result.push(exp.slice(lastFilterIndex, i))\n            lastFilterIndex = i + 1\n        } else {\n            switch (c) {\n                case 0x22: // \"\n                    inDouble = true\n                    break\n                case 0x27: // '\n                    inSingle = true\n                    break\n                case 0x60: // `\n                    inTemplateString = true\n                    break\n                case 0x28: // (\n                    paren++\n                    break\n                case 0x29: // )\n                    paren--\n                    break\n                case 0x5b: // [\n                    square++\n                    break\n                case 0x5d: // ]\n                    square--\n                    break\n                case 0x7b: // {\n                    curly++\n                    break\n                case 0x7d: // }\n                    curly--\n                    break\n                // no default\n            }\n            if (c === 0x2f) {\n                // /\n                let j = i - 1\n                let p\n                // find first non-whitespace prev char\n                for (; j >= 0; j--) {\n                    p = exp.charAt(j)\n                    if (p !== \" \") {\n                        break\n                    }\n                }\n                if (!p || !validDivisionCharRE.test(p)) {\n                    inRegex = true\n                }\n            }\n        }\n    }\n\n    result.push(exp.slice(lastFilterIndex))\n\n    return result\n}\n\n/**\n * Parse the source code of inline scripts.\n * @param code The source code of inline scripts.\n * @param locationCalculator The location calculator for the inline script.\n * @param parserOptions The parser options.\n * @returns The result of parsing.\n */\nfunction parseExpressionBody(\n    code: string,\n    locationCalculator: LocationCalculatorForHtml,\n    parserOptions: ParserOptions,\n    allowEmpty = false,\n): ExpressionParseResult<ESLintExpression> {\n    debug('[script] parse expression: \"0(%s)\"', code)\n\n    try {\n        const result = parseScriptFragment(\n            `0(${code})`,\n            locationCalculator.getSubCalculatorShift(-2),\n            parserOptions,\n        )\n        const { ast } = result\n        const tokens = ast.tokens ?? []\n        const comments = ast.comments ?? []\n        const references = analyzeExternalReferences(result, parserOptions)\n        const statement = ast.body[0] as ESLintExpressionStatement\n        const callExpression = statement.expression as ESLintCallExpression\n        const expression = callExpression.arguments[0]\n\n        if (!allowEmpty && !expression) {\n            return throwEmptyError(locationCalculator, \"an expression\")\n        }\n        if (expression?.type === \"SpreadElement\") {\n            return throwUnexpectedTokenError(\"...\", expression)\n        }\n        if (callExpression.arguments[1]) {\n            const node = callExpression.arguments[1]\n            return throwUnexpectedTokenError(\n                \",\",\n                getCommaTokenBeforeNode(tokens, node) || node,\n            )\n        }\n\n        // Remove parens.\n        tokens.shift()\n        tokens.shift()\n        tokens.pop()\n\n        return { expression, tokens, comments, references, variables: [] }\n    } catch (err) {\n        return throwErrorAsAdjustingOutsideOfCode(err, code, locationCalculator)\n    }\n}\n\n/**\n * Parse the source code of inline scripts.\n * @param code The source code of inline scripts.\n * @param locationCalculator The location calculator for the inline script.\n * @param parserOptions The parser options.\n * @returns The result of parsing.\n */\nfunction parseFilter(\n    code: string,\n    locationCalculator: LocationCalculatorForHtml,\n    parserOptions: ParserOptions,\n): ExpressionParseResult<VFilter> | null {\n    debug('[script] parse filter: \"%s\"', code)\n\n    try {\n        const expression: VFilter = {\n            type: \"VFilter\",\n            parent: null as any,\n            range: [0, 0],\n            loc: {} as any,\n            callee: null as any,\n            arguments: [],\n        }\n        const tokens: Token[] = []\n        const comments: Token[] = []\n        const references: Reference[] = []\n\n        // Parse the callee.\n        const paren = code.indexOf(\"(\")\n        const calleeCode = paren === -1 ? code : code.slice(0, paren)\n        const argsCode = paren === -1 ? null : code.slice(paren)\n\n        // Parse the callee.\n        if (calleeCode.trim()) {\n            const spaces = /^\\s*/u.exec(calleeCode)![0]\n            const subCalculator = locationCalculator.getSubCalculatorShift(\n                spaces.length,\n            )\n            const { ast } = parseScriptFragment(\n                `\"${calleeCode.trim()}\"`,\n                subCalculator,\n                parserOptions,\n            )\n            const statement = ast.body[0] as ESLintExpressionStatement\n            const callee = statement.expression\n            if (callee.type !== \"Literal\") {\n                const { loc, range } = ast.tokens![0]\n                return throwUnexpectedTokenError('\"', {\n                    range: [range[1] - 1, range[1]],\n                    loc: {\n                        start: {\n                            line: loc.end.line,\n                            column: loc.end.column - 1,\n                        },\n                        end: loc.end,\n                    },\n                })\n            }\n\n            expression.callee = {\n                type: \"Identifier\",\n                parent: expression,\n                range: [\n                    callee.range[0],\n                    subCalculator.getOffsetWithGap(calleeCode.trim().length),\n                ],\n                loc: {\n                    start: callee.loc.start,\n                    end: subCalculator.getLocation(calleeCode.trim().length),\n                },\n                name: String(callee.value),\n            }\n            tokens.push({\n                type: \"Identifier\",\n                value: calleeCode.trim(),\n                range: expression.callee.range,\n                loc: expression.callee.loc,\n            })\n        } else {\n            return throwEmptyError(locationCalculator, \"a filter name\")\n        }\n\n        // Parse the arguments.\n        if (argsCode != null) {\n            const result = parseScriptFragment(\n                `0${argsCode}`,\n                locationCalculator\n                    .getSubCalculatorAfter(paren)\n                    .getSubCalculatorShift(-1),\n                parserOptions,\n            )\n            const { ast } = result\n            const statement = ast.body[0] as ESLintExpressionStatement\n            const callExpression = statement.expression\n\n            ast.tokens!.shift()\n\n            if (\n                callExpression.type !== \"CallExpression\" ||\n                callExpression.callee.type !== \"Literal\"\n            ) {\n                // Report the next token of `)`.\n                let nestCount = 1\n                for (const token of ast.tokens!.slice(1)) {\n                    if (nestCount === 0) {\n                        return throwUnexpectedTokenError(token.value, token)\n                    }\n                    if (token.type === \"Punctuator\" && token.value === \"(\") {\n                        nestCount += 1\n                    }\n                    if (token.type === \"Punctuator\" && token.value === \")\") {\n                        nestCount -= 1\n                    }\n                }\n\n                const token = ast.tokens!.at(-1)!\n                return throwUnexpectedTokenError(token.value, token)\n            }\n\n            for (const argument of callExpression.arguments) {\n                argument.parent = expression\n                expression.arguments.push(argument)\n            }\n            tokens.push(...ast.tokens!)\n            comments.push(...ast.comments!)\n            references.push(...analyzeExternalReferences(result, parserOptions))\n        }\n\n        // Update range.\n        const firstToken = tokens[0]\n        const lastToken = tokens.at(-1)!\n        expression.range = [firstToken.range[0], lastToken.range[1]]\n        expression.loc = { start: firstToken.loc.start, end: lastToken.loc.end }\n\n        return { expression, tokens, comments, references, variables: [] }\n    } catch (err) {\n        return throwErrorAsAdjustingOutsideOfCode(err, code, locationCalculator)\n    }\n}\n\n/**\n * The result of parsing expressions.\n */\nexport interface ExpressionParseResult<T extends Node> {\n    expression: T | null\n    tokens: Token[]\n    comments: Token[]\n    references: Reference[]\n    variables: Variable[]\n}\n\nfunction loadParser(parser: string) {\n    if (parser !== \"espree\") {\n        // eslint-disable-next-line @typescript-eslint/no-require-imports\n        return require(parser)\n    }\n    return getEspree()\n}\n\n/**\n * Parse the given source code.\n *\n * @param code The source code to parse.\n * @param parserOptions The parser options.\n * @returns The result of parsing.\n */\nexport function parseScript(\n    code: string,\n    parserOptions: ParserOptions,\n): ESLintExtendedProgram {\n    const parser: ParserObject =\n        typeof parserOptions.parser === \"string\"\n            ? loadParser(parserOptions.parser)\n            : isParserObject(parserOptions.parser)\n              ? parserOptions.parser\n              : getEspree()\n\n    // `parser` option is only used by `vue-eslint-parser`,\n    // which could break the final parser under the hood\n    // like `@babel/eslint-parser` v8\n    const { parser: _, ...scriptParserOptions } = parserOptions\n\n    const result: any = isEnhancedParserObject(parser)\n        ? parser.parseForESLint(code, scriptParserOptions)\n        : parser.parse(code, scriptParserOptions)\n\n    if (result.ast != null) {\n        return result\n    }\n    return { ast: result }\n}\n\n/**\n * Parse the source code of the given `<script>` element.\n * @param node The `<script>` element to parse.\n * @param sfcCode The source code of SFC.\n * @param linesAndColumns The lines and columns location calculator.\n * @param parserOptions The parser options.\n * @returns The result of parsing.\n */\nexport function parseScriptElement(\n    node: VElement,\n    sfcCode: string,\n    linesAndColumns: LinesAndColumns,\n    originalParserOptions: ParserOptions,\n): ESLintExtendedProgram {\n    const parserOptions: ParserOptions = {\n        ...originalParserOptions,\n        ecmaVersion: originalParserOptions.ecmaVersion ?? DEFAULT_ECMA_VERSION,\n    }\n\n    let generic: GenericProcessInfo | null = null\n    let code: string\n    let offset: number\n    const textNode = node.children[0]\n    if (textNode?.type === \"VText\") {\n        const [scriptStartOffset, scriptEndOffset] = textNode.range\n        code = sfcCode.slice(scriptStartOffset, scriptEndOffset)\n        offset = scriptStartOffset\n        generic = extractGeneric(node)\n        if (generic) {\n            const defineTypesCode = `${generic.defineTypes\n                .map((e) => e.define)\n                .join(\";\")};\\n`\n            code = defineTypesCode + code\n            offset -= defineTypesCode.length\n        }\n    } else {\n        code = \"\"\n        offset = node.startTag.range[1]\n    }\n    const locationCalculator =\n        linesAndColumns.createOffsetLocationCalculator(offset)\n    const result = parseScriptFragment(code, locationCalculator, parserOptions)\n    if (generic) {\n        generic.postprocess({\n            result,\n            isRemoveTarget(nodeOrToken) {\n                return nodeOrToken.range[1] <= textNode.range[0]\n            },\n            getTypeDefScope(scopeManager) {\n                return (\n                    scopeManager.globalScope.childScopes.find(\n                        (s) => s.type === \"module\",\n                    ) ?? scopeManager.globalScope\n                )\n            },\n        })\n        const startToken = [\n            result.ast.body[0],\n            result.ast.tokens?.[0],\n            result.ast.comments?.[0],\n        ]\n            .filter((e): e is NonNullable<typeof e> => Boolean(e))\n            .sort((a, b) => a.range[0] - b.range[0])\n            .find((t) => Boolean(t))\n\n        // Restore Program node location\n        if (startToken && result.ast.range[0] !== startToken.range[0]) {\n            result.ast.range[0] = startToken.range[0]\n            if (result.ast.start != null) {\n                result.ast.start = startToken.start\n            }\n            result.ast.loc.start = { ...startToken.loc.start }\n        }\n    }\n    // Needs the tokens of start/end tags for `lines-around-*` rules to work\n    // correctly.\n    if (result.ast.tokens != null) {\n        const startTag = node.startTag\n        const endTag = node.endTag\n\n        result.ast.tokens.unshift({\n            type: \"Punctuator\",\n            range: startTag.range,\n            loc: startTag.loc,\n            value: \"<script>\",\n        })\n        if (endTag != null) {\n            result.ast.tokens.push({\n                type: \"Punctuator\",\n                range: endTag.range,\n                loc: endTag.loc,\n                value: \"</script>\",\n            })\n        }\n    }\n\n    return result\n}\n\n/**\n * Parse the source code of inline scripts.\n * @param code The source code of inline scripts.\n * @param locationCalculator The location calculator for the inline script.\n * @param parserOptions The parser options.\n * @returns The result of parsing.\n */\nexport function parseExpression(\n    code: string,\n    locationCalculator: LocationCalculatorForHtml,\n    parserOptions: ParserOptions,\n    { allowEmpty = false, allowFilters = false } = {},\n): ExpressionParseResult<ESLintExpression | VFilterSequenceExpression> {\n    debug('[script] parse expression: \"%s\"', code)\n\n    const [mainCode, ...filterCodes] =\n        allowFilters && (parserOptions.vueFeatures?.filter ?? true)\n            ? splitFilters(code)\n            : [code]\n    if (filterCodes.length === 0) {\n        return parseExpressionBody(\n            code,\n            locationCalculator,\n            parserOptions,\n            allowEmpty,\n        )\n    }\n\n    // Parse expression\n    const retB = parseExpressionBody(\n        mainCode,\n        locationCalculator,\n        parserOptions,\n    )\n    if (!retB.expression) {\n        return retB\n    }\n    const ret =\n        retB as unknown as ExpressionParseResult<VFilterSequenceExpression>\n\n    ret.expression = {\n        type: \"VFilterSequenceExpression\",\n        parent: null as any,\n        expression: retB.expression,\n        filters: [],\n        range: [...retB.expression.range] as const,\n        loc: { ...retB.expression.loc },\n    }\n    ret.expression.expression.parent = ret.expression\n\n    // Parse filters\n    let prevLoc = mainCode.length\n    for (const filterCode of filterCodes) {\n        // Pipe token.\n        ret.tokens.push(\n            fixLocation(\n                {\n                    type: \"Punctuator\",\n                    value: \"|\",\n                    range: [prevLoc, prevLoc + 1],\n                    loc: {} as any,\n                },\n                locationCalculator,\n            ),\n        )\n\n        // Parse a filter\n        const retF = parseFilter(\n            filterCode,\n            locationCalculator.getSubCalculatorShift(prevLoc + 1),\n            parserOptions,\n        )\n        if (retF) {\n            if (retF.expression) {\n                ret.expression.filters.push(retF.expression)\n                retF.expression.parent = ret.expression\n            }\n            ret.tokens.push(...retF.tokens)\n            ret.comments.push(...retF.comments)\n            ret.references.push(...retF.references)\n        }\n\n        prevLoc += 1 + filterCode.length\n    }\n\n    // Update range.\n    const lastToken = ret.tokens.at(-1)!\n    ret.expression.range[1] = lastToken.range[1]\n    ret.expression.loc.end = lastToken.loc.end\n\n    return ret\n}\n\n/**\n * Parse the source code of inline scripts.\n * @param code The source code of inline scripts.\n * @param locationCalculator The location calculator for the inline script.\n * @param parserOptions The parser options.\n * @returns The result of parsing.\n */\n// eslint-disable-next-line complexity\nexport function parseVForExpression(\n    code: string,\n    locationCalculator: LocationCalculatorForHtml,\n    parserOptions: ParserOptions,\n): ExpressionParseResult<VForExpression> {\n    if (code.trim() === \"\") {\n        throwEmptyError(locationCalculator, \"'<alias> in <expression>'\")\n    }\n\n    if (isEcmaVersion5(parserOptions)) {\n        return parseVForExpressionForEcmaVersion5(\n            code,\n            locationCalculator,\n            parserOptions,\n        )\n    }\n    const processed = processVForAliasAndIterator(code)\n\n    if (!processed.aliases.trim()) {\n        return throwEmptyError(locationCalculator, \"an alias\")\n    }\n    try {\n        debug(\n            '[script] parse v-for expression: \"for(%s%s%s);\"',\n            processed.aliasesWithBrackets,\n            processed.delimiter,\n            processed.iterator,\n        )\n\n        const result = parseScriptFragment(\n            `for(let ${processed.aliasesWithBrackets}${processed.delimiter}${processed.iterator});`,\n            locationCalculator.getSubCalculatorShift(\n                processed.hasParens ? -8 : -9,\n            ),\n            parserOptions,\n        )\n        const { ast } = result\n        const tokens = ast.tokens ?? []\n        const comments = ast.comments ?? []\n        const scope = analyzeVariablesAndExternalReferences(\n            result,\n            \"v-for\",\n            parserOptions,\n        )\n        const references = scope.references\n        const variables = scope.variables\n        const statement = ast.body[0] as\n            | ESLintForInStatement\n            | ESLintForOfStatement\n        const varDecl = statement.left as ESLintVariableDeclaration\n        const id = varDecl.declarations[0].id as ESLintArrayPattern\n        const left = id.elements\n        const right = statement.right\n\n        if (!processed.hasParens && !left.length) {\n            return throwEmptyError(locationCalculator, \"an alias\")\n        }\n        // Remove `for` `(` `let` `)` `;`.\n        tokens.shift()\n        tokens.shift()\n        tokens.shift()\n        tokens.pop()\n        tokens.pop()\n\n        const closeOffset = statement.left.range[1] - 1\n        const closeIndex = tokens.findIndex((t) => t.range[0] === closeOffset)\n\n        if (processed.hasParens) {\n            // Restore parentheses from array brackets.\n            const open = tokens[0]\n            if (open != null) {\n                open.value = \"(\"\n            }\n            const close = tokens[closeIndex]\n            if (close != null) {\n                close.value = \")\"\n            }\n        } else {\n            // Remove array brackets.\n            tokens.splice(closeIndex, 1)\n            tokens.shift()\n        }\n        const firstToken = tokens[0] || statement.left\n        const lastToken = tokens[tokens.length - 1] || statement.right\n        const expression: VForExpression = {\n            type: \"VForExpression\",\n            range: [firstToken.range[0], lastToken.range[1]],\n            loc: { start: firstToken.loc.start, end: lastToken.loc.end },\n            parent: DUMMY_PARENT,\n            left,\n            right,\n        }\n\n        // Modify parent.\n        for (const l of left) {\n            if (l != null) {\n                l.parent = expression\n            }\n        }\n        right.parent = expression\n\n        return { expression, tokens, comments, references, variables }\n    } catch (err) {\n        return throwErrorAsAdjustingOutsideOfCode(err, code, locationCalculator)\n    }\n}\n\nfunction isEcmaVersion5(parserOptions: ParserOptions) {\n    const ecmaVersion = getEcmaVersionIfUseEspree(parserOptions)\n    return ecmaVersion != null && ecmaVersion <= 5\n}\n\nfunction parseVForExpressionForEcmaVersion5(\n    code: string,\n    locationCalculator: LocationCalculatorForHtml,\n    parserOptions: ParserOptions,\n): ExpressionParseResult<VForExpression> {\n    const processed = processVForAliasAndIterator(code)\n\n    if (!processed.aliases.trim()) {\n        return throwEmptyError(locationCalculator, \"an alias\")\n    }\n    try {\n        const tokens: Token[] = []\n        const comments: Token[] = []\n\n        const parsedAliases = parseVForAliasesForEcmaVersion5(\n            processed.aliasesWithBrackets,\n            locationCalculator.getSubCalculatorShift(\n                processed.hasParens ? 0 : -1,\n            ),\n            parserOptions,\n        )\n\n        if (processed.hasParens) {\n            // Restore parentheses from array brackets.\n            const open = parsedAliases.tokens[0]\n            if (open != null) {\n                open.value = \"(\"\n            }\n            const close = parsedAliases.tokens.at(-1)\n            if (close != null) {\n                close.value = \")\"\n            }\n        } else {\n            // Remove array brackets.\n            parsedAliases.tokens.shift()\n            parsedAliases.tokens.pop()\n        }\n        tokens.push(...parsedAliases.tokens)\n        comments.push(...parsedAliases.comments)\n        const { left, variables } = parsedAliases\n\n        if (!processed.hasParens && !left.length) {\n            return throwEmptyError(locationCalculator, \"an alias\")\n        }\n\n        const delimiterStart = processed.aliases.length\n        const delimiterEnd = delimiterStart + processed.delimiter.length\n        tokens.push(\n            fixLocation(\n                {\n                    type:\n                        processed.delimiter === \"in\" ? \"Keyword\" : \"Identifier\",\n                    value: processed.delimiter,\n                    start: delimiterStart,\n                    end: delimiterEnd,\n                    loc: {} as any,\n                    range: [delimiterStart, delimiterEnd],\n                },\n                locationCalculator,\n            ),\n        )\n\n        const parsedIterator = parseVForIteratorForEcmaVersion5(\n            processed.iterator,\n            locationCalculator.getSubCalculatorShift(delimiterEnd),\n            parserOptions,\n        )\n\n        tokens.push(...parsedIterator.tokens)\n        comments.push(...parsedIterator.comments)\n        const { right, references } = parsedIterator\n        const firstToken = tokens[0]\n        const lastToken = tokens.at(-1) || firstToken\n        const expression: VForExpression = {\n            type: \"VForExpression\",\n            range: [firstToken.range[0], lastToken.range[1]],\n            loc: { start: firstToken.loc.start, end: lastToken.loc.end },\n            parent: DUMMY_PARENT,\n            left,\n            right,\n        }\n\n        // Modify parent.\n        for (const l of left) {\n            if (l != null) {\n                l.parent = expression\n            }\n        }\n        right.parent = expression\n\n        return { expression, tokens, comments, references, variables }\n    } catch (err) {\n        return throwErrorAsAdjustingOutsideOfCode(err, code, locationCalculator)\n    }\n}\n\nfunction parseVForAliasesForEcmaVersion5(\n    code: string,\n    locationCalculator: LocationCalculatorForHtml,\n    parserOptions: ParserOptions,\n) {\n    const result = parseScriptFragment(\n        `0(${code})`,\n        locationCalculator.getSubCalculatorShift(-2),\n        parserOptions,\n    )\n    const { ast } = result\n    const tokens = ast.tokens ?? []\n    const comments = ast.comments ?? []\n    const variables = analyzeExternalReferences(result, parserOptions).map(\n        transformVariable,\n    )\n\n    const statement = ast.body[0] as ESLintExpressionStatement\n    const callExpression = statement.expression as ESLintCallExpression\n    const expression = callExpression.arguments[0] as ESLintArrayExpression\n\n    const left: ESLintIdentifier[] = expression.elements.filter(\n        (e): e is ESLintIdentifier => {\n            if (e == null || e.type === \"Identifier\") {\n                return true\n            }\n            const errorToken = tokens.find(\n                (t) => e.range[0] <= t.range[0] && t.range[1] <= e.range[1],\n            )!\n            return throwUnexpectedTokenError(errorToken.value, errorToken)\n        },\n    )\n    // Remove parens.\n    tokens.shift()\n    tokens.shift()\n    tokens.pop()\n\n    return { left, tokens, comments, variables }\n\n    function transformVariable(reference: Reference): Variable {\n        const ret: Variable = {\n            id: reference.id,\n            kind: \"v-for\",\n            references: [],\n        }\n        Object.defineProperty(ret, \"references\", { enumerable: false })\n\n        return ret\n    }\n}\n\nfunction parseVForIteratorForEcmaVersion5(\n    code: string,\n    locationCalculator: LocationCalculatorForHtml,\n    parserOptions: ParserOptions,\n) {\n    const result = parseScriptFragment(\n        `0(${code})`,\n        locationCalculator.getSubCalculatorShift(-2),\n        parserOptions,\n    )\n    const { ast } = result\n    const tokens = ast.tokens ?? []\n    const comments = ast.comments ?? []\n    const references = analyzeExternalReferences(result, parserOptions)\n\n    const statement = ast.body[0] as ESLintExpressionStatement\n    const callExpression = statement.expression as ESLintCallExpression\n    const expression = callExpression.arguments[0]\n\n    if (!expression) {\n        return throwEmptyError(locationCalculator, \"an expression\")\n    }\n    if (expression?.type === \"SpreadElement\") {\n        return throwUnexpectedTokenError(\"...\", expression)\n    }\n    const right = expression\n\n    // Remove parens.\n    tokens.shift()\n    tokens.shift()\n    tokens.pop()\n    return { right, tokens, comments, references }\n}\n\n/**\n * Parse the source code of inline scripts.\n * @param code The source code of inline scripts.\n * @param locationCalculator The location calculator for the inline script.\n * @param parserOptions The parser options.\n * @returns The result of parsing.\n */\nexport function parseVOnExpression(\n    code: string,\n    locationCalculator: LocationCalculatorForHtml,\n    parserOptions: ParserOptions,\n): ExpressionParseResult<ESLintExpression | VOnExpression> {\n    if (IS_FUNCTION_EXPRESSION.test(code) || IS_SIMPLE_PATH.test(code)) {\n        return parseExpressionBody(code, locationCalculator, parserOptions)\n    }\n    return parseVOnExpressionBody(code, locationCalculator, parserOptions)\n}\n\n/**\n * Parse the source code of inline scripts.\n * @param code The source code of inline scripts.\n * @param locationCalculator The location calculator for the inline script.\n * @param parserOptions The parser options.\n * @returns The result of parsing.\n */\nfunction parseVOnExpressionBody(\n    code: string,\n    locationCalculator: LocationCalculatorForHtml,\n    parserOptions: ParserOptions,\n): ExpressionParseResult<VOnExpression> {\n    debug('[script] parse v-on expression: \"void function($event){%s}\"', code)\n\n    if (code.trim() === \"\") {\n        throwEmptyError(locationCalculator, \"statements\")\n    }\n\n    try {\n        const result = parseScriptFragment(\n            `void function($event){${code}}`,\n            locationCalculator.getSubCalculatorShift(-22),\n            parserOptions,\n        )\n        const { ast } = result\n        const references = analyzeExternalReferences(result, parserOptions)\n        const outermostStatement = ast.body[0] as ESLintExpressionStatement\n        const functionDecl = (\n            outermostStatement.expression as ESLintUnaryExpression\n        ).argument as ESLintFunctionExpression\n        const block = functionDecl.body\n        const body = block.body\n        const firstStatement = body[0]\n        const lastStatement = body.at(-1)\n        const expression: VOnExpression = {\n            type: \"VOnExpression\",\n            range: [\n                firstStatement != null\n                    ? firstStatement.range[0]\n                    : block.range[0] + 1,\n                lastStatement != null\n                    ? lastStatement.range[1]\n                    : block.range[1] - 1,\n            ],\n            loc: {\n                start:\n                    firstStatement != null\n                        ? firstStatement.loc.start\n                        : locationCalculator.getLocation(1),\n                end:\n                    lastStatement != null\n                        ? lastStatement.loc.end\n                        : locationCalculator.getLocation(code.length + 1),\n            },\n            parent: DUMMY_PARENT,\n            body,\n        }\n        const tokens = ast.tokens ?? []\n        const comments = ast.comments ?? []\n\n        // Modify parent.\n        for (const b of body) {\n            b.parent = expression\n        }\n\n        // Remove braces.\n        tokens.splice(0, 6)\n        tokens.pop()\n\n        return { expression, tokens, comments, references, variables: [] }\n    } catch (err) {\n        return throwErrorAsAdjustingOutsideOfCode(err, code, locationCalculator)\n    }\n}\n\n/**\n * Parse the source code of `slot-scope` directive.\n * @param code The source code of `slot-scope` directive.\n * @param locationCalculator The location calculator for the inline script.\n * @param parserOptions The parser options.\n * @returns The result of parsing.\n */\nexport function parseSlotScopeExpression(\n    code: string,\n    locationCalculator: LocationCalculatorForHtml,\n    parserOptions: ParserOptions,\n): ExpressionParseResult<VSlotScopeExpression> {\n    debug('[script] parse slot-scope expression: \"void function(%s) {}\"', code)\n\n    if (code.trim() === \"\") {\n        throwEmptyError(\n            locationCalculator,\n            \"an identifier or an array/object pattern\",\n        )\n    }\n\n    try {\n        const result = parseScriptFragment(\n            `void function(${code}) {}`,\n            locationCalculator.getSubCalculatorShift(-14),\n            parserOptions,\n        )\n        const { ast } = result\n        const statement = ast.body[0] as ESLintExpressionStatement\n        const rawExpression = statement.expression as ESLintUnaryExpression\n        const functionDecl = rawExpression.argument as ESLintFunctionExpression\n        const params = functionDecl.params\n\n        if (params.length === 0) {\n            return {\n                expression: null,\n                tokens: [],\n                comments: [],\n                references: [],\n                variables: [],\n            }\n        }\n\n        const tokens = ast.tokens ?? []\n        const comments = ast.comments ?? []\n        const scope = analyzeVariablesAndExternalReferences(\n            result,\n            \"scope\",\n            parserOptions,\n        )\n        const references = scope.references\n        const variables = scope.variables\n        const firstParam = params[0]\n        const lastParam = params.at(-1)!\n        const expression: VSlotScopeExpression = {\n            type: \"VSlotScopeExpression\",\n            range: [firstParam.range[0], lastParam.range[1]],\n            loc: { start: firstParam.loc.start, end: lastParam.loc.end },\n            parent: DUMMY_PARENT,\n            params: functionDecl.params,\n        }\n\n        // Modify parent.\n        for (const param of params) {\n            param.parent = expression\n        }\n\n        // Remove `void` `function` `(` `)` `{` `}`.\n        tokens.shift()\n        tokens.shift()\n        tokens.shift()\n        tokens.pop()\n        tokens.pop()\n        tokens.pop()\n\n        return { expression, tokens, comments, references, variables }\n    } catch (err) {\n        return throwErrorAsAdjustingOutsideOfCode(err, code, locationCalculator)\n    }\n}\n\n/**\n * Parse the source code of `generic` directive.\n * @param code The source code of `generic` directive.\n * @param locationCalculator The location calculator for the inline script.\n * @param parserOptions The parser options.\n * @returns The result of parsing.\n */\nexport function parseGenericExpression(\n    code: string,\n    locationCalculator: LocationCalculatorForHtml,\n    parserOptions: ParserOptions,\n): ExpressionParseResult<VGenericExpression> {\n    debug('[script] parse generic definition: \"void function<%s>() {}\"', code)\n\n    if (code.trim() === \"\") {\n        throwEmptyError(locationCalculator, \"a type parameter\")\n    }\n\n    function getParams(result: ESLintExtendedProgram) {\n        const { ast } = result\n        const statement = ast.body[0] as ESLintExpressionStatement\n        const rawExpression = statement.expression as ESLintUnaryExpression\n        const classDecl = rawExpression.argument as ESLintFunctionExpression\n        const typeParameters = (classDecl as TSESTree.FunctionExpression)\n            .typeParameters\n        return typeParameters?.params\n    }\n\n    try {\n        const rawParams: string[] = []\n        const scriptLet = `void function<${code}>(){}`\n        const result = parseScriptFragmentWithOption(\n            scriptLet,\n            locationCalculator.getSubCalculatorShift(-14),\n            { ...parserOptions, project: undefined, projectService: undefined },\n            {\n                preFixLocationProcess(preResult) {\n                    const params = getParams(preResult)\n                    if (params) {\n                        for (const param of params) {\n                            rawParams.push(\n                                scriptLet.slice(param.range[0], param.range[1]),\n                            )\n                        }\n                    }\n                },\n            },\n        )\n        const { ast } = result\n        const params = getParams(result)\n\n        if (!params || params.length === 0) {\n            return {\n                expression: null,\n                tokens: [],\   n                comments: [],\n                references: [],\n                variables: [],\n            }\n        }\n\n        const tokens = ast.tokens ?? []\n        const comments = ast.comments ?? []\n        const scope = analyzeVariablesAndExternalReferences(\n            result,\n            \"generic\",\n            parserOptions,\n        )\n        const references = scope.references\n        const variables = scope.variables\n        const firstParam = params[0]\n        const lastParam = params.at(-1)!\n        const expression: VGenericExpression = {\n            type: \"VGenericExpression\",\n            range: [firstParam.range[0], lastParam.range[1]],\n            loc: { start: firstParam.loc.start, end: lastParam.loc.end },\n            parent: DUMMY_PARENT,\n            params,\n            rawParams,\n        }\n\n        // Modify parent.\n        for (const param of params) {\n            ;(param as any).parent = expression\n        }\n\n        // Remove `void` `function` `<` `>` `(` `)` `{` `}`.\n        tokens.shift()\n        tokens.shift()\n        tokens.shift()\n        tokens.pop()\n        tokens.pop()\n        tokens.pop()\n        tokens.pop()\n        tokens.pop()\n\n        return { expression, tokens, comments, references, variables }\n    } catch (err) {\n        return throwErrorAsAdjustingOutsideOfCode(err, code, locationCalculator)\n    }\n}\n","import { sortedIndexBy, sortedLastIndexBy } from \"../utils/utils\"\nimport type { LocationRange, Token, VDocumentFragment } from \"../ast/index\"\nimport type { LinesAndColumns } from \"./lines-and-columns\"\n\ninterface HasRange {\n    range: [number, number]\n}\n/**\n * Replace the tokens in the given range.\n * @param document The document that the node is belonging to.\n * @param node The node to specify the range of replacement.\n * @param newTokens The new tokens.\n */\nexport function replaceTokens(\n    document: VDocumentFragment | null,\n    node: HasRange,\n    newTokens: Token[],\n): void {\n    if (document == null) {\n        return\n    }\n\n    const index = sortedIndexBy(document.tokens, node, byRange0)\n    const count = sortedLastIndexBy(document.tokens, node, byRange1) - index\n    document.tokens.splice(index, count, ...newTokens)\n}\n\n/**\n * Replace and split the tokens in the given range.\n * @param document The document that the node is belonging to.\n * @param node The node to specify the range of replacement.\n * @param newTokens The new tokens.\n */\nexport function replaceAndSplitTokens(\n    document: VDocumentFragment | null,\n    node: HasRange & {\n        loc: LocationRange\n    },\n    newTokens: Token[],\n): void {\n    if (document == null) {\n        return\n    }\n\n    const index = sortedIndexBy(document.tokens, node, byRange0)\n    if (\n        document.tokens.length === index ||\n        node.range[0] < document.tokens[index].range[0]\n    ) {\n        // split\n        const beforeToken = document.tokens[index - 1]\n        const value = beforeToken.value\n        const splitOffset = node.range[0] - beforeToken.range[0]\n        const afterToken: Token = {\n            type: beforeToken.type,\n            range: [node.range[0], beforeToken.range[1]],\n            loc: {\n                start: { ...node.loc.start },\n                end: { ...beforeToken.loc.end },\n            },\n            value: value.slice(splitOffset),\n        }\n        beforeToken.range[1] = node.range[0]\n        beforeToken.loc.end = { ...node.loc.start }\n        beforeToken.value = value.slice(0, splitOffset)\n        document.tokens.splice(index, 0, afterToken)\n    }\n    let lastIndex = sortedLastIndexBy(document.tokens, node, byRange1)\n    if (\n        lastIndex === 0 ||\n        node.range[1] < document.tokens[lastIndex].range[1]\n    ) {\n        // split\n        const beforeToken = document.tokens[lastIndex]\n        const value = beforeToken.value\n        const splitOffset =\n            beforeToken.range[1] -\n            beforeToken.range[0] -\n            (beforeToken.range[1] - node.range[1])\n        const afterToken: Token = {\n            type: beforeToken.type,\n            range: [node.range[1], beforeToken.range[1]],\n            loc: {\n                start: { ...node.loc.end },\n                end: { ...beforeToken.loc.end },\n            },\n            value: value.slice(splitOffset),\n        }\n        beforeToken.range[1] = node.range[1]\n        beforeToken.loc.end = { ...node.loc.end }\n        beforeToken.value = value.slice(0, splitOffset)\n        document.tokens.splice(lastIndex + 1, 0, afterToken)\n        lastIndex++\n    }\n    const count = lastIndex - index\n    document.tokens.splice(index, count, ...newTokens)\n}\n\n/**\n * Insert the given comment tokens.\n * @param document The document that the node is belonging to.\n * @param newComments The comments to insert.\n */\nexport function insertComments(\n    document: VDocumentFragment | null,\n    newComments: Token[],\n): void {\n    if (document == null || newComments.length === 0) {\n        return\n    }\n\n    const index = sortedIndexBy(document.comments, newComments[0], byRange0)\n    document.comments.splice(index, 0, ...newComments)\n}\n\n/**\n * Create a simple token.\n * @param type The type of new token.\n * @param start The offset of the start position of new token.\n * @param end The offset of the end position of new token.\n * @param value The value of new token.\n * @returns The new token.\n */\nexport function createSimpleToken(\n    type: string,\n    start: number,\n    end: number,\n    value: string,\n    linesAndColumns: LinesAndColumns,\n): Token {\n    return {\n        type,\n        range: [start, end],\n        loc: {\n            start: linesAndColumns.getLocFromIndex(start),\n            end: linesAndColumns.getLocFromIndex(end),\n        },\n        value,\n    }\n}\n\n/**\n * Get `x.range[0]`.\n * @param x The object to get.\n * @returns `x.range[0]`.\n */\nfunction byRange0(x: HasRange): number {\n    return x.range[0]\n}\n\n/**\n * Get `x.range[1]`.\n * @param x The object to get.\n * @returns `x.range[1]`.\n */\nfunction byRange1(x: HasRange): number {\n    return x.range[1]\n}\n","import type { ParseError, VDocumentFragment } from \"../ast/index\"\nimport { sortedIndexBy } from \"../utils/utils\"\n/**\n * Insert the given error.\n * @param document The document that the node is belonging to.\n * @param error The error to insert.\n */\nexport function insertError(\n    document: VDocumentFragment | null,\n    error: ParseError,\n): void {\n    if (document == null) {\n        return\n    }\n\n    const index = sortedIndexBy(document.errors, error, byIndex)\n    document.errors.splice(index, 0, error)\n}\n\n/**\n * Get `x.pos`.\n * @param x The object to get.\n * @returns `x.pos`.\n */\nfunction byIndex(x: ParseError): number {\n    return x.index\n}\n","/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * @copyright 2017 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\nimport type { ParserOptions } from \"../common/parser-options\"\nimport { isSFCFile } from \"../common/parser-options\"\nimport type {\n    ESLintExpression,\n    ESLintExtendedProgram,\n    ESLintIdentifier,\n    Reference,\n    Token,\n    VAttribute,\n    VDirective,\n    VDirectiveKey,\n    VDocumentFragment,\n    VElement,\n    VExpressionContainer,\n    VFilterSequenceExpression,\n    VForExpression,\n    VGenericExpression,\n    VIdentifier,\n    VLiteral,\n    VNode,\n    VOnExpression,\n    VSlotScopeExpression,\n} from \"../ast/index\"\nimport { ParseError } from \"../ast/index\"\nimport { debug } from \"../common/debug\"\nimport type { LocationCalculatorForHtml } from \"../common/location-calculator\"\nimport type { ExpressionParseResult } from \"../script/index\"\nimport {\n    parseExpression,\n    parseVForExpression,\n    parseVOnExpression,\n    parseSlotScopeExpression,\n    parseGenericExpression,\n    parseScriptFragment,\n} from \"../script/index\"\nimport {\n    createSimpleToken,\n    insertComments,\n    replaceTokens,\n} from \"../common/token-utils\"\nimport {\n    getOwnerDocument,\n    isScriptSetupElement,\n    isTSLang,\n} from \"../common/ast-utils\"\nimport { insertError } from \"../common/error-utils\"\nimport { camelize } from \"../utils/utils\"\n\nconst shorthandSign = /^[.:@#]/u\nconst shorthandNameMap = { \":\": \"bind\", \".\": \"bind\", \"@\": \"on\", \"#\": \"slot\" }\nconst invalidDynamicArgumentNextChar = /^[\\s\\r\\n=/>]$/u\n\n/**\n * Gets the tag name from the given node or token.\n * For SFC, it returns the value of `rawName` to be case sensitive.\n */\nfunction getTagName(\n    startTagOrElement: { name: string; rawName: string },\n    isSFC: boolean,\n) {\n    return isSFC ? startTagOrElement.rawName : startTagOrElement.name\n}\n\n/**\n * Parse the given attribute name as a directive key.\n * @param node The identifier node to parse.\n * @param document The document to add parsing errors.\n * @returns The directive key node.\n */\nfunction parseDirectiveKeyStatically(\n    node: VIdentifier,\n    document: VDocumentFragment | null,\n): VDirectiveKey {\n    const {\n        name: text,\n        rawName: rawText,\n        range: [offset],\n        loc: {\n            start: { column, line },\n        },\n    } = node\n    const directiveKey: VDirectiveKey = {\n        type: \"VDirectiveKey\",\n        range: node.range,\n        loc: node.loc,\n        parent: node.parent as any,\n        name: null as any,\n        argument: null as VIdentifier | null,\n        modifiers: [] as VIdentifier[],\n    }\n    let i = 0\n\n    function createIdentifier(\n        start: number,\n        end: number,\n        name?: string,\n    ): VIdentifier {\n        return {\n            type: \"VIdentifier\",\n            parent: directiveKey,\n            range: [offset + start, offset + end],\n            loc: {\n                start: { column: column + start, line },\n                end: { column: column + end, line },\n            },\n            name: name || text.slice(start, end),\n            rawName: rawText.slice(start, end),\n        }\n    }\n\n    // Parse.\n    if (shorthandSign.test(text)) {\n        const sign = text[0] as \":\" | \".\" | \"@\" | \"#\"\n        directiveKey.name = createIdentifier(0, 1, shorthandNameMap[sign])\n        i = 1\n    } else {\n        const colon = text.indexOf(\":\")\n        if (colon !== -1) {\n            directiveKey.name = createIdentifier(0, colon)\n            i = colon + 1\n        }\n    }\n\n    if (directiveKey.name != null && text[i] === \"[\") {\n        // Dynamic argument.\n        const len = text.slice(i).lastIndexOf(\"]\")\n        if (len !== -1) {\n            directiveKey.argument = createIdentifier(i, i + len + 1)\n            i = i + len + 1 + (text[i + len + 1] === \".\" ? 1 : 0)\n        }\n    }\n\n    const modifiers = text\n        .slice(i)\n        .split(\".\")\n        .map((modifierName) => {\n            const modifier = createIdentifier(i, i + modifierName.length)\n            if (modifierName === \"\" && i < text.length) {\n                insertError(\n                    document,\n                    new ParseError(\n                        `Unexpected token '${text[i]}'`,\n                        undefined,\n                        offset + i,\n                        line,\n                        column + i,\n                    ),\n                )\n            }\n            i += modifierName.length + 1\n            return modifier\n        })\n\n    if (directiveKey.name == null) {\n        directiveKey.name = modifiers.shift()!\n    } else if (directiveKey.argument == null && modifiers[0].name !== \"\") {\n        directiveKey.argument = modifiers.shift() ?? null\n    }\n    directiveKey.modifiers = modifiers.filter(isNotEmptyModifier)\n\n    if (directiveKey.name.name === \"v-\") {\n        insertError(\n            document,\n            new ParseError(\n                `Unexpected token '${\n                    text[directiveKey.name.range[1] - offset]\n                }'`,\n                undefined,\n                directiveKey.name.range[1],\n                directiveKey.name.loc.end.line,\n                directiveKey.name.loc.end.column,\n            ),\n        )\n    }\n\n    // v-bind.prop shorthand\n    if (\n        directiveKey.name.rawName === \".\" &&\n        !directiveKey.modifiers.some(isPropModifier)\n    ) {\n        const pos =\n            (directiveKey.argument || directiveKey.name).range[1] - offset\n        const propModifier = createIdentifier(pos, pos, \"prop\")\n        directiveKey.modifiers.unshift(propModifier)\n    }\n\n    return directiveKey\n}\n\n/**\n * Check whether a given identifier node is `prop` or not.\n * @param node The identifier node to check.\n */\nfunction isPropModifier(node: VIdentifier): boolean {\n    return node.name === \"prop\"\n}\n\n/**\n * Check whether a given identifier node is empty or not.\n * @param node The identifier node to check.\n */\nfunction isNotEmptyModifier(node: VIdentifier): boolean {\n    return node.name !== \"\"\n}\n\n/**\n * Parse the tokens of a given key node.\n * @param node The key node to parse.\n */\nfunction parseDirectiveKeyTokens(node: VDirectiveKey): Token[] {\n    const { name, argument, modifiers } = node\n    const shorthand = name.range[1] - name.range[0] === 1\n    const tokens: Token[] = []\n\n    if (shorthand) {\n        tokens.push({\n            type: \"Punctuator\",\n            range: name.range,\n            loc: name.loc,\n            value: name.rawName,\n        })\n    } else {\n        tokens.push({\n            type: \"HTMLIdentifier\",\n            range: name.range,\n            loc: name.loc,\n            value: name.rawName,\n        })\n\n        if (argument) {\n            tokens.push({\n                type: \"Punctuator\",\n                range: [name.range[1], argument.range[0]],\n                loc: { start: name.loc.end, end: argument.loc.start },\n                value: \":\",\n            })\n        }\n    }\n\n    if (argument) {\n        tokens.push({\n            type: \"HTMLIdentifier\",\n            range: argument.range,\n            loc: argument.loc,\n            value: (argument as VIdentifier).rawName,\n        })\n    }\n\n    let lastNode = (argument as VIdentifier | null) || name\n    for (const modifier of modifiers) {\n        if (modifier.rawName === \"\") {\n            continue\n        }\n\n        tokens.push(\n            {\n                type: \"Punctuator\",\n                range: [lastNode.range[1], modifier.range[0]],\n                loc: { start: lastNode.loc.end, end: modifier.loc.start },\n                value: \".\",\n            },\n            {\n                type: \"HTMLIdentifier\",\n                range: modifier.range,\n                loc: modifier.loc,\n                value: modifier.rawName,\n            },\n        )\n        lastNode = modifier\n    }\n\n    return tokens\n}\n\n/**\n * Convert `node.argument` property to a `VExpressionContainer` node if it's a dynamic argument.\n * @param text The source code text of the directive key node.\n * @param node The directive key node to convert.\n * @param document The belonging document node.\n * @param parserOptions The parser options to parse.\n * @param locationCalculator The location calculator to parse.\n */\nfunction convertDynamicArgument(\n    node: VDirectiveKey,\n    document: VDocumentFragment | null,\n    parserOptions: ParserOptions,\n    locationCalculator: LocationCalculatorForHtml,\n): void {\n    const { argument } = node\n    if (\n        !(\n            argument != null &&\n            argument.type === \"VIdentifier\" &&\n            argument.name.startsWith(\"[\") &&\n            argument.name.endsWith(\"]\")\n        )\n    ) {\n        return\n    }\n\n    const { rawName, range, loc } = argument\n    try {\n        const { comments, expression, references, tokens } = parseExpression(\n            rawName.slice(1, -1),\n            locationCalculator.getSubCalculatorAfter(range[0] + 1),\n            parserOptions,\n        )\n\n        node.argument = {\n            type: \"VExpressionContainer\",\n            range,\n            loc,\n            parent: node,\n            expression,\n            references,\n        }\n\n        if (expression != null) {\n            expression.parent = node.argument\n        }\n\n        // Add tokens of `[` and `]`.\n        tokens.unshift(\n            createSimpleToken(\n                \"Punctuator\",\n                range[0],\n                range[0] + 1,\n                \"[\",\n                locationCalculator,\n            ),\n        )\n        tokens.push(\n            createSimpleToken(\n                \"Punctuator\",\n                range[1] - 1,\n                range[1],\n                \"]\",\n                locationCalculator,\n            ),\n        )\n\n        replaceTokens(document, node.argument, tokens)\n        insertComments(document, comments)\n    } catch (error) {\n        debug(\"[template] Parse error: %s\", error)\n\n        if (ParseError.isParseError(error)) {\n            node.argument = {\n                type: \"VExpressionContainer\",\n                range,\n                loc,\n                parent: node,\n                expression: null,\n                references: [],\n            }\n            insertError(document, error)\n        } else {\n            throw error\n        }\n    }\n}\n\n/**\n * Parse the given attribute name as a directive key.\n * @param node The identifier node to parse.\n * @returns The directive key node.\n */\nfunction createDirectiveKey(\n    node: VIdentifier,\n    document: VDocumentFragment | null,\n    parserOptions: ParserOptions,\n    locationCalculator: LocationCalculatorForHtml,\n): VDirectiveKey {\n    // Parse node and tokens.\n    const directiveKey = parseDirectiveKeyStatically(node, document)\n    const tokens = parseDirectiveKeyTokens(directiveKey)\n    replaceTokens(document, directiveKey, tokens)\n\n    // Drop `v-` prefix.\n    if (directiveKey.name.name.startsWith(\"v-\")) {\n        directiveKey.name.name = directiveKey.name.name.slice(2)\n    }\n    if (directiveKey.name.rawName.startsWith(\"v-\")) {\n        directiveKey.name.rawName = directiveKey.name.rawName.slice(2)\n    }\n\n    // Parse dynamic argument.\n    convertDynamicArgument(\n        directiveKey,\n        document,\n        parserOptions,\n        locationCalculator,\n    )\n\n    return directiveKey\n}\n\n/**\n * Parse the given attribute value as an expression.\n * @param code Whole source code text.\n * @param parserOptions The parser options to parse expressions.\n * @param globalLocationCalculator The location calculator to adjust the locations of nodes.\n * @param node The attribute node to replace. This function modifies this node directly.\n * @param tagName The name of this tag.\n * @param directiveKey The key of this directive.\n */\nfunction parseAttributeValue(\n    code: string,\n    parserOptions: ParserOptions,\n    scriptParserOptions: ParserOptions,\n    globalLocationCalculator: LocationCalculatorForHtml,\n    node: VLiteral,\n    element: VElement,\n    directiveKey: VDirectiveKey,\n): ExpressionParseResult<\n    | ESLintExpression\n    | VFilterSequenceExpression\n    | VForExpression\n    | VOnExpression\n    | VSlotScopeExpression\n    | VGenericExpression\n> {\n    const firstChar = code[node.range[0]]\n    const quoted = firstChar === '\"' || firstChar === \"'\"\n    const locationCalculator = globalLocationCalculator.getSubCalculatorAfter(\n        node.range[0] + (quoted ? 1 : 0),\n    )\n    const directiveKind = getStandardDirectiveKind(\n        parserOptions,\n        element,\n        directiveKey,\n    )\n\n    let result: ExpressionParseResult<\n        | ESLintExpression\n        | VFilterSequenceExpression\n        | VForExpression\n        | VOnExpression\n        | VSlotScopeExpression\n        | VGenericExpression\n    >\n    if (quoted && node.value === \"\") {\n        result = {\n            expression: null,\n            tokens: [],\n            comments: [],\n            variables: [],\n            references: [],\n        }\n    } else if (directiveKind === \"for\") {\n        result = parseVForExpression(\n            node.value,\n            locationCalculator,\n            parserOptions,\n        )\n    } else if (directiveKind === \"on\" && directiveKey.argument != null) {\n        result = parseVOnExpression(\n            node.value,\n            locationCalculator,\n            parserOptions,\n        )\n    } else if (directiveKind === \"slot\") {\n        result = parseSlotScopeExpression(\n            node.value,\n            locationCalculator,\n            parserOptions,\n        )\n    } else if (directiveKind === \"bind\") {\n        result = parseExpression(\n            node.value,\n            locationCalculator,\n            parserOptions,\n            { allowFilters: true },\n        )\n    } else if (directiveKind === \"generic\") {\n        result = parseGenericExpression(\n            node.value,\n            locationCalculator,\n            scriptParserOptions,\n        )\n    } else {\n        result = parseExpression(node.value, locationCalculator, parserOptions)\n    }\n\n    // Add the tokens of quotes.\n    if (quoted) {\n        result.tokens.unshift(\n            createSimpleToken(\n                \"Punctuator\",\n                node.range[0],\n                node.range[0] + 1,\n                firstChar,\n                globalLocationCalculator,\n            ),\n        )\n        result.tokens.push(\n            createSimpleToken(\n                \"Punctuator\",\n                node.range[1] - 1,\n                node.range[1],\n                firstChar,\n                globalLocationCalculator,\n            ),\n        )\n    }\n\n    return result\n}\n\nfunction getStandardDirectiveKind(\n    parserOptions: ParserOptions,\n    element: VElement,\n    directiveKey: VDirectiveKey,\n) {\n    const directiveName = directiveKey.name.name\n\n    if (directiveName === \"for\") {\n        return \"for\"\n    } else if (directiveName === \"on\") {\n        return \"on\"\n    } else if (\n        directiveName === \"slot\" ||\n        directiveName === \"slot-scope\" ||\n        (directiveName === \"scope\" &&\n            getTagName(element, isSFCFile(parserOptions)) === \"template\")\n    ) {\n        return \"slot\"\n    } else if (directiveName === \"bind\") {\n        return \"bind\"\n    } else if (\n        directiveName === \"generic\" &&\n        element.parent.type === \"VDocumentFragment\" &&\n        getTagName(element, isSFCFile(parserOptions)) === \"script\" &&\n        isScriptSetupElement(element) &&\n        isTSLang(element)\n    ) {\n        return \"generic\"\n    }\n    return null\n}\n\n/**\n * Resolve the variable of the given reference.\n * @param referene The reference to resolve.\n * @param element The belonging element of the reference.\n */\nfunction resolveReference(referene: Reference, element: VElement): void {\n    let node: VNode | null = element\n\n    // Find the variable of this reference.\n    while (node?.type === \"VElement\") {\n        for (const variable of node.variables) {\n            if (variable.id.name === referene.id.name) {\n                referene.variable = variable\n                variable.references.push(referene)\n                return\n            }\n        }\n\n        node = node.parent\n    }\n}\n\n/**\n * Information of a mustache.\n */\nexport interface Mustache {\n    value: string\n    startToken: Token\n    endToken: Token\n}\n\n/**\n * Replace the given attribute by a directive.\n * @param code Whole source code text.\n * @param parserOptions The parser options to parse expressions.\n * @param locationCalculator The location calculator to adjust the locations of nodes.\n * @param node The attribute node to replace. This function modifies this node directly.\n */\nexport function convertToDirective(\n    code: string,\n    parserOptions: ParserOptions,\n    scriptParserOptions: ParserOptions,\n    locationCalculator: LocationCalculatorForHtml,\n    node: VAttribute,\n): void {\n    debug(\n        '[template] convert to directive: %s=\"%s\" %j',\n        node.key.name,\n        node.value?.value,\n        node.range,\n    )\n\n    const document = getOwnerDocument(node)\n    const directive: VDirective = node as any\n    directive.directive = true\n    directive.key = createDirectiveKey(\n        node.key,\n        document,\n        parserOptions,\n        locationCalculator,\n    )\n\n    const { argument } = directive.key\n    if (argument?.type === \"VIdentifier\" && argument.name.startsWith(\"[\")) {\n        const nextChar = code[argument.range[1]]\n        if (nextChar == null || invalidDynamicArgumentNextChar.test(nextChar)) {\n            const char =\n                nextChar == null ? \"EOF\" : JSON.stringify(nextChar).slice(1, -1)\n            insertError(\n                document,\n                new ParseError(\n                    `Dynamic argument cannot contain the '${char}' character.`,\n                    undefined,\n                    argument.range[1],\n                    argument.loc.end.line,\n                    argument.loc.end.column,\n                ),\n            )\n        }\n    }\n\n    if (node.value == null) {\n        if (directive.key.name.name === \"bind\") {\n            // v-bind same-name shorthand (Vue 3.4+)\n            convertForVBindSameNameShorthandValue(\n                directive,\n                parserOptions,\n                locationCalculator,\n            )\n        }\n        return\n    }\n\n    try {\n        const ret = parseAttributeValue(\n            code,\n            parserOptions,\n            scriptParserOptions,\n            locationCalculator,\n            node.value,\n            node.parent.parent,\n            directive.key,\n        )\n\n        directive.value = {\n            type: \"VExpressionContainer\",\n            range: node.value.range,\n            loc: node.value.loc,\n            parent: directive,\n            expression: ret.expression,\n            references: ret.references,\n        }\n        if (ret.expression != null) {\n            ret.expression.parent = directive.value\n        }\n\n        for (const variable of ret.variables) {\n            node.parent.parent.variables.push(variable)\n        }\n\n        replaceTokens(document, node.value, ret.tokens)\n        insertComments(document, ret.comments)\n    } catch (err) {\n        debug(\"[template] Parse error: %s\", err)\n\n        if (ParseError.isParseError(err)) {\n            directive.value = {\n                type: \"VExpressionContainer\",\n                range: node.value.range,\n                loc: node.value.loc,\n                parent: directive,\n                expression: null,\n                references: [],\n            }\n            insertError(document, err)\n        } else {\n            throw err\n        }\n    }\n}\n\nfunction convertForVBindSameNameShorthandValue(\n    directive: VDirective,\n    parserOptions: ParserOptions,\n    locationCalculator: LocationCalculatorForHtml,\n) {\n    if (\n        directive.key.name.name !== \"bind\" ||\n        directive.key.argument == null ||\n        directive.key.argument.type !== \"VIdentifier\"\n    ) {\n        return\n    }\n    // v-bind same-name shorthand (Vue 3.4+)\n    const vId = directive.key.argument\n    const camelName = camelize(vId.rawName)\n    let result: ESLintExtendedProgram | null = null\n    try {\n        result = parseScriptFragment(\n            camelName,\n            locationCalculator.getSubCalculatorAfter(vId.range[0]),\n            parserOptions,\n        )\n    } catch (err) {\n        debug(\"[template] Parse error: %s\", err)\n    }\n    if (\n        result == null ||\n        result.ast.body.length !== 1 ||\n        result.ast.body[0].type !== \"ExpressionStatement\" ||\n        result.ast.body[0].expression.type !== \"Identifier\"\n    ) {\n        return\n    }\n    const id: ESLintIdentifier = result.ast.body[0].expression\n    id.range[1] = vId.range[1]\n    id.loc.end = { ...vId.loc.end }\n    if (id.end != null) {\n        id.end = vId.end\n    }\n    directive.value = {\n        type: \"VExpressionContainer\",\n        range: [...vId.range],\n        loc: {\n            start: { ...vId.loc.start },\n            end: { ...vId.loc.end },\n        },\n        parent: directive,\n        expression: id,\n        references: [\n            {\n                id,\n                mode: \"r\",\n                variable: null,\n            },\n        ],\n    }\n    id.parent = directive.value\n}\n\n/**\n * Parse the content of the given mustache.\n * @param parserOptions The parser options to parse expressions.\n * @param globalLocationCalculator The location calculator to adjust the locations of nodes.\n * @param node The expression container node. This function modifies the `expression` and `references` properties of this node.\n * @param mustache The information of mustache to parse.\n */\nexport function processMustache(\n    parserOptions: ParserOptions,\n    globalLocationCalculator: LocationCalculatorForHtml,\n    node: VExpressionContainer,\n    mustache: Mustache,\n): void {\n    const range: [number, number] = [\n        mustache.startToken.range[1],\n        mustache.endToken.range[0],\n    ]\n    debug(\"[template] convert mustache {{%s}} %j\", mustache.value, range)\n\n    const document = getOwnerDocument(node)\n    try {\n        const locationCalculator =\n            globalLocationCalculator.getSubCalculatorAfter(range[0])\n        const ret = parseExpression(\n            mustache.value,\n            locationCalculator,\n            parserOptions,\n            { allowEmpty: true, allowFilters: true },\n        )\n\n        node.expression = ret.expression ?? null\n        node.references = ret.references\n        if (ret.expression != null) {\n            ret.expression.parent = node\n        }\n\n        replaceTokens(document, { range }, ret.tokens)\n        insertComments(document, ret.comments)\n    } catch (err) {\n        debug(\"[template] Parse error: %s\", err)\n\n        if (ParseError.isParseError(err)) {\n            insertError(document, err)\n        } else {\n            throw err\n        }\n    }\n}\n\n/**\n * Resolve all references of the given expression container.\n * @param container The expression container to resolve references.\n */\nexport function resolveReferences(container: VExpressionContainer): void {\n    let element: VNode | null = container.parent\n\n    // Get the belonging element.\n    while (element != null && element.type !== \"VElement\") {\n        element = element.parent\n    }\n\n    // Resolve.\n    if (element != null) {\n        for (const reference of container.references) {\n            resolveReference(reference, element)\n        }\n    }\n}\n","/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * @copyright 2017 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\nexport const SVG_ATTRIBUTE_NAME_MAP = new Map([\n    [\"attributename\", \"attributeName\"],\n    [\"attributetype\", \"attributeType\"],\n    [\"basefrequency\", \"baseFrequency\"],\n    [\"baseprofile\", \"baseProfile\"],\n    [\"calcmode\", \"calcMode\"],\n    [\"clippathunits\", \"clipPathUnits\"],\n    [\"diffuseconstant\", \"diffuseConstant\"],\n    [\"edgemode\", \"edgeMode\"],\n    [\"filterunits\", \"filterUnits\"],\n    [\"glyphref\", \"glyphRef\"],\n    [\"gradienttransform\", \"gradientTransform\"],\n    [\"gradientunits\", \"gradientUnits\"],\n    [\"kernelmatrix\", \"kernelMatrix\"],\n    [\"kernelunitlength\", \"kernelUnitLength\"],\n    [\"keypoints\", \"keyPoints\"],\n    [\"keysplines\", \"keySplines\"],\n    [\"keytimes\", \"keyTimes\"],\n    [\"lengthadjust\", \"lengthAdjust\"],\n    [\"limitingconeangle\", \"limitingConeAngle\"],\n    [\"markerheight\", \"markerHeight\"],\n    [\"markerunits\", \"markerUnits\"],\n    [\"markerwidth\", \"markerWidth\"],\n    [\"maskcontentunits\", \"maskContentUnits\"],\n    [\"maskunits\", \"maskUnits\"],\n    [\"numoctaves\", \"numOctaves\"],\n    [\"pathlength\", \"pathLength\"],\n    [\"patterncontentunits\", \"patternContentUnits\"],\n    [\"patterntransform\", \"patternTransform\"],\n    [\"patternunits\", \"patternUnits\"],\n    [\"pointsatx\", \"pointsAtX\"],\n    [\"pointsaty\", \"pointsAtY\"],\n    [\"pointsatz\", \"pointsAtZ\"],\n    [\"preservealpha\", \"preserveAlpha\"],\n    [\"preserveaspectratio\", \"preserveAspectRatio\"],\n    [\"primitiveunits\", \"primitiveUnits\"],\n    [\"refx\", \"refX\"],\n    [\"refy\", \"refY\"],\n    [\"repeatcount\", \"repeatCount\"],\n    [\"repeatdur\", \"repeatDur\"],\n    [\"requiredextensions\", \"requiredExtensions\"],\n    [\"requiredfeatures\", \"requiredFeatures\"],\n    [\"specularconstant\", \"specularConstant\"],\n    [\"specularexponent\", \"specularExponent\"],\n    [\"spreadmethod\", \"spreadMethod\"],\n    [\"startoffset\", \"startOffset\"],\n    [\"stddeviation\", \"stdDeviation\"],\n    [\"stitchtiles\", \"stitchTiles\"],\n    [\"surfacescale\", \"surfaceScale\"],\n    [\"systemlanguage\", \"systemLanguage\"],\n    [\"tablevalues\", \"tableValues\"],\n    [\"targetx\", \"targetX\"],\n    [\"targety\", \"targetY\"],\n    [\"textlength\", \"textLength\"],\n    [\"viewbox\", \"viewBox\"],\n    [\"viewtarget\", \"viewTarget\"],\n    [\"xchannelselector\", \"xChannelSelector\"],\n    [\"ychannelselector\", \"yChannelSelector\"],\n    [\"zoomandpan\", \"zoomAndPan\"],\n])\n\nexport const MATHML_ATTRIBUTE_NAME_MAP = new Map([\n    [\"definitionurl\", \"definitionUrl\"]\n])\n","/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * @copyright 2017 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\n\n/**\n * HTML tag names.\n */\nexport const HTML_TAGS = new Set([\n    \"a\", \"abbr\", \"address\", \"area\", \"article\",\"aside\", \"audio\", \"b\", \"base\",\n    \"bdi\", \"bdo\", \"blockquote\", \"body\", \"br\", \"button\", \"canvas\", \"caption\",\n    \"cite\", \"code\", \"col\", \"colgroup\", \"data\", \"datalist\", \"dd\", \"del\",\n    \"details\", \"dfn\", \"dialog\", \"div\", \"dl\", \"document\", \"dt\", \"em\", \"embed\",\n    \"fieldset\", \"figcaption\", \"figure\", \"footer\", \"form\", \"h1\", \"h2\", \"h3\",\n    \"h4\", \"h5\", \"h6\", \"head\", \"header\", \"hgroup\", \"hr\", \"html\", \"i\", \"iframe\",\n    \"img\", \"input\", \"ins\", \"kbd\", \"label\", \"legend\", \"li\", \"link\", \"main\",\n    \"map\", \"mark\", \"marquee\", \"menu\", \"meta\", \"meter\", \"nav\", \"noscript\",\n    \"object\", \"ol\", \"optgroup\", \"option\", \"output\", \"p\", \"param\", \"picture\",\n    \"pre\", \"progress\", \"q\", \"rp\", \"rt\", \"ruby\", \"s\", \"samp\", \"script\",\n    \"section\", \"select\", \"slot\", \"small\", \"source\", \"span\", \"strong\", \"style\",\n    \"sub\", \"summary\", \"sup\", \"table\", \"tbody\", \"td\", \"template\", \"textarea\",\n    \"tfoot\", \"th\", \"thead\", \"time\", \"title\", \"tr\", \"track\", \"u\", \"ul\", \"var\",\n    \"video\", \"wbr\"\n])\n\n/**\n * HTML tag names of void elements.\n */\nexport const HTML_VOID_ELEMENT_TAGS = new Set([\n    \"area\", \"base\", \"br\", \"col\", \"embed\", \"hr\", \"img\", \"input\", \"link\", \"meta\",\n    \"param\", \"source\", \"track\", \"wbr\",\n])\n\n/**\n * https://github.com/vuejs/vue/blob/e4da249ab8ef32a0b8156c840c9d2b9773090f8a/src/platforms/web/compiler/util.js#L12\n */\nexport const HTML_CAN_BE_LEFT_OPEN_TAGS = new Set([\n    \"colgroup\", \"li\", \"options\", \"p\", \"td\", \"tfoot\", \"th\", \"thead\", \n    \"tr\", \"source\",\n])\n\n/**\n * https://github.com/vuejs/vue/blob/e4da249ab8ef32a0b8156c840c9d2b9773090f8a/src/platforms/web/compiler/util.js#L18\n */\nexport const HTML_NON_FHRASING_TAGS = new Set([\n    \"address\", \"article\", \"aside\", \"base\", \"blockquote\", \"body\", \"caption\", \n    \"col\", \"colgroup\", \"dd\", \"details\", \"dialog\", \"div\", \"dl\", \"dt\", \"fieldset\", \n    \"figcaption\", \"figure\", \"footer\", \"form\", \"h1\", \"h2\", \"h3\", \"h4\", \"h5\", \n    \"h6\", \"head\", \"header\", \"hgroup\", \"hr\", \"html\", \"legend\", \"li\", \"menuitem\", \n    \"meta\", \"optgroup\", \"option\", \"param\", \"rp\", \"rt\", \"source\", \"style\", \n    \"summary\", \"tbody\", \"td\", \"tfoot\", \"th\", \"thead\", \"title\", \"tr\", \"track\",\n])\n\n/**\n * HTML tag names of RCDATA.\n */\nexport const HTML_RCDATA_TAGS = new Set([\n    \"title\", \"textarea\",\n])\n\n/**\n * HTML tag names of RAWTEXT.\n */\nexport const HTML_RAWTEXT_TAGS = new Set([\n    \"style\", \"xmp\", \"iframe\", \"noembed\", \"noframes\", \"noscript\", \"script\",\n])\n\n/**\n * SVG tag names.\n */\nexport const SVG_TAGS = new Set([\n    \"a\", \"altGlyph\", \"altGlyphDef\", \"altGlyphItem\", \"animate\", \"animateColor\", \n    \"animateMotion\", \"animateTransform\", \"animation\", \"audio\", \"canvas\", \n    \"circle\", \"clipPath\", \"color-profile\", \"cursor\", \"defs\", \"desc\", \"discard\", \n    \"ellipse\", \"feBlend\", \"feColorMatrix\", \"feComponentTransfer\", \"feComposite\", \n    \"feConvolveMatrix\", \"feDiffuseLighting\", \"feDisplacementMap\", \n    \"feDistantLight\", \"feDropShadow\", \"feFlood\", \"feFuncA\", \"feFuncB\", \n    \"feFuncG\", \"feFuncR\", \"feGaussianBlur\", \"feImage\", \"feMerge\", \"feMergeNode\", \n    \"feMorphology\", \"feOffset\", \"fePointLight\", \"feSpecularLighting\", \n    \"feSpotLight\", \"feTile\", \"feTurbulence\", \"filter\", \"font\", \"font-face\", \n    \"font-face-format\", \"font-face-name\", \"font-face-src\", \"font-face-uri\", \n    \"foreignObject\", \"g\", \"glyph\", \"glyphRef\", \"handler\", \"hatch\", \"hatchpath\", \n    \"hkern\", \"iframe\", \"image\", \"line\", \"linearGradient\", \"listener\", \"marker\", \n    \"mask\", \"mesh\", \"meshgradient\", \"meshpatch\", \"meshrow\", \"metadata\", \n    \"missing-glyph\", \"mpath\", \"path\", \"pattern\", \"polygon\", \"polyline\", \n    \"prefetch\", \"radialGradient\", \"rect\", \"script\", \"set\", \"solidColor\", \n    \"solidcolor\", \"stop\", \"style\", \"svg\", \"switch\", \"symbol\", \"tbreak\", \"text\", \n    \"textArea\", \"textPath\", \"title\", \"tref\", \"tspan\", \"unknown\", \"use\", \"video\", \n    \"view\", \"vkern\",\n])\n\n/**\n * The map from lowercase names to actual names in SVG.\n */\nexport const SVG_ELEMENT_NAME_MAP = new Map<string, string>()\nfor (const name of SVG_TAGS) {\n    if (/[A-Z]/.test(name)) {\n        SVG_ELEMENT_NAME_MAP.set(name.toLowerCase(), name)\n    }\n}\n\n/**\n * MathML tag names.\n */\nexport const MATHML_TAGS = new Set([\n    \"abs\", \"and\", \"annotation\", \"annotation-xml\", \"apply\", \"approx\", \"arccos\", \n    \"arccosh\", \"arccot\", \"arccoth\", \"arccsc\", \"arccsch\", \"arcsec\", \"arcsech\", \n    \"arcsin\", \"arcsinh\", \"arctan\", \"arctanh\", \"arg\", \"bind\", \"bvar\", \"card\", \n    \"cartesianproduct\", \"cbytes\", \"ceiling\", \"cerror\", \"ci\", \"cn\", \"codomain\", \n    \"complexes\", \"compose\", \"condition\", \"conjugate\", \"cos\", \"cosh\", \"cot\", \n    \"coth\", \"cs\", \"csc\", \"csch\", \"csymbol\", \"curl\", \"declare\", \"degree\", \n    \"determinant\", \"diff\", \"divergence\", \"divide\", \"domain\", \n    \"domainofapplication\", \"emptyset\", \"encoding\", \"eq\", \"equivalent\", \n    \"eulergamma\", \"exists\", \"exp\", \"exponentiale\", \"factorial\", \"factorof\", \n    \"false\", \"floor\", \"fn\", \"forall\", \"function\", \"gcd\", \"geq\", \"grad\", \"gt\", \n    \"ident\", \"image\", \"imaginary\", \"imaginaryi\", \"implies\", \"in\", \"infinity\", \n    \"int\", \"integers\", \"intersect\", \"interval\", \"inverse\", \"lambda\", \n    \"laplacian\", \"lcm\", \"leq\", \"limit\", \"list\", \"ln\", \"log\", \"logbase\", \n    \"lowlimit\", \"lt\", \"m:apply\", \"m:mrow\", \"maction\", \"malign\", \"maligngroup\", \n    \"malignmark\", \"malignscope\", \"math\", \"matrix\", \"matrixrow\", \"max\", \"mean\", \n    \"median\", \"menclose\", \"merror\", \"mfenced\", \"mfrac\", \"mfraction\", \"mglyph\", \n    \"mi\", \"mi\\\"\", \"min\", \"minus\", \"mlabeledtr\", \"mlongdiv\", \"mmultiscripts\", \n    \"mn\", \"mo\", \"mode\", \"moment\", \"momentabout\", \"mover\", \"mpadded\", \"mphantom\", \n    \"mprescripts\", \"mroot\", \"mrow\", \"ms\", \"mscarries\", \"mscarry\", \"msgroup\", \n    \"msline\", \"mspace\", \"msqrt\", \"msrow\", \"mstack\", \"mstyle\", \"msub\", \"msubsup\", \n    \"msup\", \"mtable\", \"mtd\", \"mtext\", \"mtr\", \"munder\", \"munderover\", \n    \"naturalnumbers\", \"neq\", \"none\", \"not\", \"notanumber\", \"notin\", \n    \"notprsubset\", \"notsubset\", \"or\", \"otherwise\", \"outerproduct\", \n    \"partialdiff\", \"pi\", \"piece\", \"piecewice\", \"piecewise\", \"plus\", \"power\", \n    \"primes\", \"product\", \"prsubset\", \"quotient\", \"rationals\", \"real\", \"reals\", \n    \"reln\", \"rem\", \"root\", \"scalarproduct\", \"sdev\", \"sec\", \"sech\", \"select\", \n    \"selector\", \"semantics\", \"sep\", \"set\", \"setdiff\", \"share\", \"sin\", \"sinh\", \n    \"span\", \"subset\", \"sum\", \"tan\", \"tanh\", \"tendsto\", \"times\", \"transpose\", \n    \"true\", \"union\", \"uplimit\", \"var\", \"variance\", \"vector\", \"vectorproduct\", \n    \"xor\",\n])\n","/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * @copyright 2017 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\nimport assert from \"assert\"\nimport type {\n    ErrorCode,\n    HasLocation,\n    Namespace,\n    Token,\n    VAttribute,\n} from \"../ast/index\"\nimport { ParseError } from \"../ast/index\"\nimport { debug } from \"../common/debug\"\nimport type { Tokenizer, TokenizerState, TokenType } from \"./tokenizer\"\n\nconst DUMMY_PARENT: any = Object.freeze({})\n\n/**\n * Concatenate token values.\n * @param text Concatenated text.\n * @param token The token to concatenate.\n */\nfunction concat(text: string, token: Token): string {\n    return text + token.value\n}\n\n/**\n * The type of intermediate tokens.\n */\nexport type IntermediateToken = StartTag | EndTag | Text | Mustache\n\n/**\n * The type of start tags.\n */\nexport interface StartTag extends HasLocation {\n    type: \"StartTag\"\n    name: string\n    rawName: string\n    selfClosing: boolean\n    attributes: VAttribute[]\n}\n\n/**\n * The type of end tags.\n */\nexport interface EndTag extends HasLocation {\n    type: \"EndTag\"\n    name: string\n}\n\n/**\n * The type of text chunks.\n */\nexport interface Text extends HasLocation {\n    type: \"Text\"\n    value: string\n}\n\n/**\n * The type of text chunks of an expression container.\n */\nexport interface Mustache extends HasLocation {\n    type: \"Mustache\"\n    value: string\n    startToken: Token\n    endToken: Token\n}\n\n/**\n * The class to create HTML tokens from ESTree-like tokens which are created by a Tokenizer.\n */\nexport class IntermediateTokenizer {\n    private tokenizer: Tokenizer\n    private currentToken: IntermediateToken | null\n    private attribute: VAttribute | null\n    private attributeNames: Set<string>\n    private expressionStartToken: Token | null\n    private expressionTokens: Token[]\n\n    public readonly tokens: Token[]\n    public readonly comments: Token[]\n\n    /**\n     * The source code text.\n     */\n    public get text(): string {\n        return this.tokenizer.text\n    }\n\n    /**\n     * The parse errors.\n     */\n    public get errors(): ParseError[] {\n        return this.tokenizer.errors\n    }\n\n    /**\n     * The current state.\n     */\n    public get state(): TokenizerState {\n        return this.tokenizer.state\n    }\n    public set state(value: TokenizerState) {\n        this.tokenizer.state = value\n    }\n\n    /**\n     * The current namespace.\n     */\n    public get namespace(): Namespace {\n        return this.tokenizer.namespace\n    }\n    public set namespace(value: Namespace) {\n        this.tokenizer.namespace = value\n    }\n\n    /**\n     * The current flag of expression enabled.\n     */\n    public get expressionEnabled(): boolean {\n        return this.tokenizer.expressionEnabled\n    }\n    public set expressionEnabled(value: boolean) {\n        this.tokenizer.expressionEnabled = value\n    }\n\n    /**\n     * Initialize this intermediate tokenizer.\n     * @param tokenizer The tokenizer.\n     */\n    public constructor(tokenizer: Tokenizer) {\n        this.tokenizer = tokenizer\n        this.currentToken = null\n        this.attribute = null\n        this.attributeNames = new Set<string>()\n        this.expressionStartToken = null\n        this.expressionTokens = []\n        this.tokens = []\n        this.comments = []\n    }\n\n    /**\n     * Get the next intermediate token.\n     * @returns The intermediate token or null.\n     */\n    public nextToken(): IntermediateToken | null {\n        let token: Token | null = null\n        let result: IntermediateToken | null = null\n\n        while (result == null && (token = this.tokenizer.nextToken()) != null) {\n            result = this[token.type as TokenType](token)\n        }\n\n        if (result == null && token == null && this.currentToken != null) {\n            result = this.commit()\n        }\n\n        return result\n    }\n\n    /**\n     * Commit the current token.\n     */\n    private commit(): IntermediateToken {\n        assert(this.currentToken != null || this.expressionStartToken != null)\n\n        let token = this.currentToken\n        this.currentToken = null\n        this.attribute = null\n\n        if (this.expressionStartToken != null) {\n            // VExpressionEnd was not found.\n            // Concatenate the deferred tokens to the committed token.\n            const start = this.expressionStartToken\n            const end = this.expressionTokens.at(-1) || start\n            const value = this.expressionTokens.reduce(concat, start.value)\n            this.expressionStartToken = null\n            this.expressionTokens = []\n\n            if (token == null) {\n                token = {\n                    type: \"Text\",\n                    range: [start.range[0], end.range[1]],\n                    loc: { start: start.loc.start, end: end.loc.end },\n                    value,\n                }\n            } else if (token.type === \"Text\") {\n                token.range[1] = end.range[1]\n                token.loc.end = end.loc.end\n                token.value += value\n            } else {\n                throw new Error(\"unreachable\")\n            }\n        }\n\n        return token as IntermediateToken\n    }\n\n    /**\n     * Report an invalid character error.\n     * @param code The error code.\n     */\n    private reportParseError(token: HasLocation, code: ErrorCode): void {\n        const error = ParseError.fromCode(\n            code,\n            token.range[0],\n            token.loc.start.line,\n            token.loc.start.column,\n        )\n        this.errors.push(error)\n\n        debug(\"[html] syntax error:\", error.message)\n    }\n\n    /**\n     * Process the given comment token.\n     * @param token The comment token to process.\n     */\n    private processComment(token: Token): IntermediateToken | null {\n        this.comments.push(token)\n\n        if (this.currentToken?.type === \"Text\") {\n            return this.commit()\n        }\n        return null\n    }\n\n    /**\n     * Process the given text token.\n     * @param token The text token to process.\n     */\n    private processText(token: Token): IntermediateToken | null {\n        this.tokens.push(token)\n\n        let result: IntermediateToken | null = null\n\n        if (this.expressionStartToken != null) {\n            // Defer this token until a VExpressionEnd token or a non-text token appear.\n            const lastToken =\n                this.expressionTokens.at(-1) || this.expressionStartToken\n            if (lastToken.range[1] === token.range[0]) {\n                this.expressionTokens.push(token)\n                return null\n            }\n\n            result = this.commit()\n        } else if (this.currentToken != null) {\n            // Concatenate this token to the current text token.\n            if (\n                this.currentToken.type === \"Text\" &&\n                this.currentToken.range[1] === token.range[0]\n            ) {\n                this.currentToken.value += token.value\n                this.currentToken.range[1] = token.range[1]\n                this.currentToken.loc.end = token.loc.end\n                return null\n            }\n\n            result = this.commit()\n        }\n        assert(this.currentToken == null)\n\n        this.currentToken = {\n            type: \"Text\",\n            range: [token.range[0], token.range[1]],\n            loc: { start: token.loc.start, end: token.loc.end },\n            value: token.value,\n        }\n\n        return result\n    }\n\n    /**\n     * Process a HTMLAssociation token.\n     * @param token The token to process.\n     */\n    protected HTMLAssociation(token: Token): IntermediateToken | null {\n        this.tokens.push(token)\n\n        if (this.attribute != null) {\n            this.attribute.range[1] = token.range[1]\n            this.attribute.loc.end = token.loc.end\n\n            if (\n                this.currentToken == null ||\n                this.currentToken.type !== \"StartTag\"\n            ) {\n                throw new Error(\"unreachable\")\n            }\n            this.currentToken.range[1] = token.range[1]\n            this.currentToken.loc.end = token.loc.end\n        }\n\n        return null\n    }\n\n    /**\n     * Process a HTMLBogusComment token.\n     * @param token The token to process.\n     */\n    protected HTMLBogusComment(token: Token): IntermediateToken | null {\n        return this.processComment(token)\n    }\n\n    /**\n     * Process a HTMLCDataText token.\n     * @param token The token to process.\n     */\n    protected HTMLCDataText(token: Token): IntermediateToken | null {\n        return this.processText(token)\n    }\n\n    /**\n     * Process a HTMLComment token.\n     * @param token The token to process.\n     */\n    protected HTMLComment(token: Token): IntermediateToken | null {\n        return this.processComment(token)\n    }\n\n    /**\n     * Process a HTMLEndTagOpen token.\n     * @param token The token to process.\n     */\n    protected HTMLEndTagOpen(token: Token): IntermediateToken | null {\n        this.tokens.push(token)\n\n        let result: IntermediateToken | null = null\n\n        if (this.currentToken != null || this.expressionStartToken != null) {\n            result = this.commit()\n        }\n\n        this.currentToken = {\n            type: \"EndTag\",\n            range: [token.range[0], token.range[1]],\n            loc: { start: token.loc.start, end: token.loc.end },\n            name: token.value,\n        }\n\n        return result\n    }\n\n    /**\n     * Process a HTMLIdentifier token.\n     * @param token The token to process.\n     */\n    protected HTMLIdentifier(token: Token): IntermediateToken | null {\n        this.tokens.push(token)\n\n        if (\n            this.currentToken == null ||\n            this.currentToken.type === \"Text\" ||\n            this.currentToken.type === \"Mustache\"\n        ) {\n            throw new Error(\"unreachable\")\n        }\n        if (this.currentToken.type === \"EndTag\") {\n            this.reportParseError(token, \"end-tag-with-attributes\")\n            return null\n        }\n        if (this.attributeNames.has(token.value)) {\n            this.reportParseError(token, \"duplicate-attribute\")\n        }\n        this.attributeNames.add(token.value)\n\n        this.attribute = {\n            type: \"VAttribute\",\n            range: [token.range[0], token.range[1]],\n            loc: { start: token.loc.start, end: token.loc.end },\n            parent: DUMMY_PARENT,\n            directive: false,\n            key: {\n                type: \"VIdentifier\",\n                range: [token.range[0], token.range[1]],\n                loc: { start: token.loc.start, end: token.loc.end },\n                parent: DUMMY_PARENT,\n                name: token.value,\n                rawName: this.text.slice(token.range[0], token.range[1]),\n            },\n            value: null,\n        }\n        this.attribute.key.parent = this.attribute\n\n        this.currentToken.range[1] = token.range[1]\n        this.currentToken.loc.end = token.loc.end\n        this.currentToken.attributes.push(this.attribute)\n\n        return null\n    }\n\n    /**\n     * Process a HTMLLiteral token.\n     * @param token The token to process.\n     */\n    protected HTMLLiteral(token: Token): IntermediateToken | null {\n        this.tokens.push(token)\n\n        if (this.attribute != null) {\n            this.attribute.range[1] = token.range[1]\n            this.attribute.loc.end = token.loc.end\n            this.attribute.value = {\n                type: \"VLiteral\",\n                range: [token.range[0], token.range[1]],\n                loc: { start: token.loc.start, end: token.loc.end },\n                parent: this.attribute,\n                value: token.value,\n            }\n\n            if (\n                this.currentToken == null ||\n                this.currentToken.type !== \"StartTag\"\n            ) {\n                throw new Error(\"unreachable\")\n            }\n            this.currentToken.range[1] = token.range[1]\n            this.currentToken.loc.end = token.loc.end\n        }\n\n        return null\n    }\n\n    /**\n     * Process a HTMLRCDataText token.\n     * @param token The token to process.\n     */\n    protected HTMLRCDataText(token: Token): IntermediateToken | null {\n        return this.processText(token)\n    }\n\n    /**\n     * Process a HTMLRawText token.\n     * @param token The token to process.\n     */\n    protected HTMLRawText(token: Token): IntermediateToken | null {\n        return this.processText(token)\n    }\n\n    /**\n     * Process a HTMLSelfClosingTagClose token.\n     * @param token The token to process.\n     */\n    protected HTMLSelfClosingTagClose(token: Token): IntermediateToken | null {\n        this.tokens.push(token)\n\n        if (this.currentToken == null || this.currentToken.type === \"Text\") {\n            throw new Error(\"unreachable\")\n        }\n\n        if (this.currentToken.type === \"StartTag\") {\n            this.currentToken.selfClosing = true\n        } else {\n            this.reportParseError(token, \"end-tag-with-trailing-solidus\")\n        }\n\n        this.currentToken.range[1] = token.range[1]\n        this.currentToken.loc.end = token.loc.end\n\n        return this.commit()\n    }\n\n    /**\n     * Process a HTMLTagClose token.\n     * @param token The token to process.\n     */\n    protected HTMLTagClose(token: Token): IntermediateToken | null {\n        this.tokens.push(token)\n\n        if (this.currentToken == null || this.currentToken.type === \"Text\") {\n            throw new Error(\"unreachable\")\n        }\n\n        this.currentToken.range[1] = token.range[1]\n        this.currentToken.loc.end = token.loc.end\n\n        return this.commit()\n    }\n\n    /**\n     * Process a HTMLTagOpen token.\n     * @param token The token to process.\n     */\n    protected HTMLTagOpen(token: Token): IntermediateToken | null {\n        this.tokens.push(token)\n\n        let result: IntermediateToken | null = null\n\n        if (this.currentToken != null || this.expressionStartToken != null) {\n            result = this.commit()\n        }\n\n        this.currentToken = {\n            type: \"StartTag\",\n            range: [token.range[0], token.range[1]],\n            loc: { start: token.loc.start, end: token.loc.end },\n            name: token.value,\n            rawName: this.text.slice(token.range[0] + 1, token.range[1]),\n            selfClosing: false,\n            attributes: [],\n        }\n        this.attribute = null\n        this.attributeNames.clear()\n\n        return result\n    }\n\n    /**\n     * Process a HTMLText token.\n     * @param token The token to process.\n     */\n    protected HTMLText(token: Token): IntermediateToken | null {\n        return this.processText(token)\n    }\n\n    /**\n     * Process a HTMLWhitespace token.\n     * @param token The token to process.\n     */\n    protected HTMLWhitespace(token: Token): IntermediateToken | null {\n        return this.processText(token)\n    }\n\n    /**\n     * Process a VExpressionStart token.\n     * @param token The token to process.\n     */\n    protected VExpressionStart(token: Token): IntermediateToken | null {\n        if (this.expressionStartToken != null) {\n            return this.processText(token)\n        }\n        const separated =\n            this.currentToken != null &&\n            this.currentToken.range[1] !== token.range[0]\n        const result = separated ? this.commit() : null\n\n        this.tokens.push(token)\n        this.expressionStartToken = token\n\n        return result\n    }\n\n    /**\n     * Process a VExpressionEnd token.\n     * @param token The token to process.\n     */\n    protected VExpressionEnd(token: Token): IntermediateToken | null {\n        if (this.expressionStartToken == null) {\n            return this.processText(token)\n        }\n\n        const start = this.expressionStartToken\n        const end = this.expressionTokens.at(-1) || start\n\n        // If it's '{{}}', it's handled as a text.\n        if (token.range[0] === start.range[1]) {\n            this.tokens.pop()\n            this.expressionStartToken = null\n            const result = this.processText(start)\n            this.processText(token)\n            return result\n        }\n\n        // If invalid notation `</>` exists directly before this token, separate it.\n        if (end.range[1] !== token.range[0]) {\n            const result = this.commit()\n            this.processText(token)\n            return result\n        }\n\n        // Clear state.\n        const value = this.expressionTokens.reduce(concat, \"\")\n        this.tokens.push(token)\n        this.expressionStartToken = null\n        this.expressionTokens = []\n\n        // Create token.\n        const result = this.currentToken != null ? this.commit() : null\n        this.currentToken = {\n            type: \"Mustache\",\n            range: [start.range[0], token.range[1]],\n            loc: { start: start.loc.start, end: token.loc.end },\n            value,\n            startToken: start,\n            endToken: token,\n        }\n\n        return result || this.commit()\n    }\n}\n","/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * @copyright 2017 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\nimport assert from \"assert\"\nimport type {\n    ErrorCode,\n    HasLocation,\n    Namespace,\n    Token,\n    VAttribute,\n    VDocumentFragment,\n    VElement,\n    VExpressionContainer,\n    VLiteral,\n} from \"../ast/index\"\nimport { NS, ParseError } from \"../ast/index\"\nimport { debug } from \"../common/debug\"\nimport { LocationCalculatorForHtml } from \"../common/location-calculator\"\nimport {\n    convertToDirective,\n    processMustache,\n    resolveReferences,\n} from \"../template/index\"\nimport {\n    MATHML_ATTRIBUTE_NAME_MAP,\n    SVG_ATTRIBUTE_NAME_MAP,\n} from \"./util/attribute-names\"\nimport {\n    HTML_CAN_BE_LEFT_OPEN_TAGS,\n    HTML_NON_FHRASING_TAGS,\n    HTML_RAWTEXT_TAGS,\n    HTML_RCDATA_TAGS,\n    HTML_VOID_ELEMENT_TAGS,\n    SVG_ELEMENT_NAME_MAP,\n} from \"./util/tag-names\"\nimport type {\n    IntermediateToken,\n    EndTag,\n    Mustache,\n    StartTag,\n    Text,\n} from \"./intermediate-tokenizer\"\nimport { IntermediateTokenizer } from \"./intermediate-tokenizer\"\nimport type { Tokenizer } from \"./tokenizer\"\nimport type { ParserOptions } from \"../common/parser-options\"\nimport {\n    isSFCFile,\n    getScriptParser,\n    getParserLangFromSFC,\n} from \"../common/parser-options\"\nimport { sortedIndexBy, sortedLastIndexBy } from \"../utils/utils\"\nimport type {\n    CustomTemplateTokenizer,\n    CustomTemplateTokenizerConstructor,\n} from \"./custom-tokenizer\"\nimport { isScriptSetupElement, isTSLang } from \"../common/ast-utils\"\n\nconst DIRECTIVE_NAME = /^(?:v-|[.:@#]).*[^.:@#]$/u\nconst DT_DD = /^d[dt]$/u\nconst DUMMY_PARENT: any = Object.freeze({})\n\n/**\n * Gets the tag name from the given node or token.\n * For SFC, it returns the value of `rawName` to be case sensitive.\n */\nfunction getTagName(\n    startTagOrElement: { name: string; rawName: string },\n    isSFC: boolean,\n) {\n    return isSFC ? startTagOrElement.rawName : startTagOrElement.name\n}\n\n/**\n * Check whether the element is a MathML text integration point or not.\n * @see https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher\n * @param element The current element.\n * @param isSFC For SFC, give `true`.\n * @returns `true` if the element is a MathML text integration point.\n */\nfunction isMathMLIntegrationPoint(element: VElement, isSFC: boolean): boolean {\n    if (element.namespace === NS.MathML) {\n        const name = getTagName(element, isSFC)\n        return (\n            name === \"mi\" ||\n            name === \"mo\" ||\n            name === \"mn\" ||\n            name === \"ms\" ||\n            name === \"mtext\"\n        )\n    }\n    return false\n}\n\n/**\n * Check whether the element is a HTML integration point or not.\n * @see https://html.spec.whatwg.org/multipage/parsing.html#tree-construction-dispatcher\n * @param element The current element.\n * @param isSFC For SFC, give `true`.\n * @returns `true` if the element is a HTML integration point.\n */\nfunction isHTMLIntegrationPoint(element: VElement, isSFC: boolean): boolean {\n    if (element.namespace === NS.MathML) {\n        return (\n            getTagName(element, isSFC) === \"annotation-xml\" &&\n            element.startTag.attributes.some(\n                (a) =>\n                    a.directive === false &&\n                    a.key.name === \"encoding\" &&\n                    a.value != null &&\n                    (a.value.value === \"text/html\" ||\n                        a.value.value === \"application/xhtml+xml\"),\n            )\n        )\n    }\n    if (element.namespace === NS.SVG) {\n        const name = getTagName(element, isSFC)\n        return name === \"foreignObject\" || name === \"desc\" || name === \"title\"\n    }\n\n    return false\n}\n\n/**\n * Adjust element names by the current namespace.\n * @param name The lowercase element name to adjust.\n * @param namespace The current namespace.\n * @returns The adjusted element name.\n */\nfunction adjustElementName(name: string, namespace: Namespace): string {\n    if (namespace === NS.SVG) {\n        return SVG_ELEMENT_NAME_MAP.get(name) || name\n    }\n    return name\n}\n\n/**\n * Adjust attribute names by the current namespace.\n * @param name The lowercase attribute name to adjust.\n * @param namespace The current namespace.\n * @returns The adjusted attribute name.\n */\nfunction adjustAttributeName(name: string, namespace: Namespace): string {\n    if (namespace === NS.SVG) {\n        return SVG_ATTRIBUTE_NAME_MAP.get(name) || name\n    }\n    if (namespace === NS.MathML) {\n        return MATHML_ATTRIBUTE_NAME_MAP.get(name) || name\n    }\n    return name\n}\n\n/**\n * Set the location of the last child node to the end location of the given node.\n * @param node The node to commit the end location.\n */\nfunction propagateEndLocation(node: VDocumentFragment | VElement): void {\n    const lastChild =\n        (node.type === \"VElement\" ? node.endTag : null) || node.children.at(-1)\n    if (lastChild != null) {\n        node.range[1] = lastChild.range[1]\n        node.loc.end = lastChild.loc.end\n    }\n}\n\n/**\n * The parser of HTML.\n * This is not following to the HTML spec completely because Vue.js template spec is pretty different to HTML.\n */\nexport class Parser {\n    private tokenizer: IntermediateTokenizer | CustomTemplateTokenizer\n    private locationCalculator: LocationCalculatorForHtml\n    private baseParserOptions: ParserOptions\n    private isSFC: boolean\n    private document: VDocumentFragment\n    private elementStack: VElement[]\n    private vPreElement: VElement | null\n    private postProcessesForScript: ((\n        htmlParserOptions: ParserOptions,\n        scriptParserOptions: ParserOptions,\n    ) => void)[] = []\n\n    /**\n     * The source code text.\n     */\n    private get text(): string {\n        return this.tokenizer.text\n    }\n\n    /**\n     * The tokens.\n     */\n    private get tokens(): Token[] {\n        return this.tokenizer.tokens\n    }\n\n    /**\n     * The comments.\n        */\n    private get comments(): Token[] {\n        return this.tokenizer.comments\n    }\n\n    /**\n     * The syntax errors which are found in this parsing.\n     */\n    private get errors(): ParseError[] {\n        return this.tokenizer.errors\n    }\n\n    /**\n     * The current namespace.\n     */\n    private get namespace(): Namespace {\n        return this.tokenizer.namespace\n    }\n    private set namespace(value: Namespace) {\n        this.tokenizer.namespace = value\n    }\n\n    /**\n     * The current flag of expression enabled.\n     */\n    private get expressionEnabled(): boolean {\n        return this.tokenizer.expressionEnabled\n    }\n    private set expressionEnabled(value: boolean) {\n        this.tokenizer.expressionEnabled = value\n    }\n\n    /**\n     * Get the current node.\n     */\n    private get currentNode(): VDocumentFragment | VElement {\n        return this.elementStack.at(-1) || this.document\n    }\n\n    /**\n     * Check if the current location is in a v-pre element.\n     */\n    private get isInVPreElement(): boolean {\n        return this.vPreElement != null\n    }\n\n    /**\n     * Initialize this parser.\n     * @param tokenizer The tokenizer to parse.\n     * @param parserOptions The parser options to parse inline expressions.\n     */\n    public constructor(tokenizer: Tokenizer, parserOptions: ParserOptions) {\n        this.tokenizer = new IntermediateTokenizer(tokenizer)\n        this.locationCalculator = new LocationCalculatorForHtml(\n            tokenizer.gaps,\n            tokenizer.lineTerminators,\n        )\n        this.baseParserOptions = parserOptions\n        this.isSFC = isSFCFile(parserOptions)\n        this.document = {\n            type: \"VDocumentFragment\",\n            range: [0, 0],\n            loc: {\n                start: { line: 1, column: 0 },\n                end: { line: 1, column: 0 },\n            },\n            parent: null,\n            children: [],\n            tokens: this.tokens,\n            comments: this.comments,\n            errors: this.errors,\n        }\n        this.elementStack = []\n        this.vPreElement = null\n\n        this.postProcessesForScript = []\n    }\n\n    /**\n     * Parse the HTML which was given in this constructor.\n     * @returns The result of parsing.\n     */\n    public parse(): VDocumentFragment {\n        let token: IntermediateToken | null = null\n        while ((token = this.tokenizer.nextToken()) != null) {\n            ;(this as any)[token.type](token)\n        }\n\n        this.popElementStackUntil(0)\n        propagateEndLocation(this.document)\n\n        const doc = this.document\n\n        const htmlParserOptions = {\n            ...this.baseParserOptions,\n            parser: getScriptParser(\n                this.baseParserOptions.parser,\n                function* () {\n                    yield \"<template>\"\n                    yield getParserLangFromSFC(doc)\n                },\n            ),\n            project: undefined,\n            projectService: undefined,\n        }\n        const scriptParserOptions = {\n            ...this.baseParserOptions,\n            parser: getScriptParser(this.baseParserOptions.parser, () =>\n                getParserLangFromSFC(doc),\n            ),\n        }\n        for (const proc of this.postProcessesForScript) {\n            proc(htmlParserOptions, scriptParserOptions)\n        }\n        this.postProcessesForScript = []\n\n        return doc\n    }\n\n    /**\n     * Report an invalid character error.\n     * @param code The error code.\n     */\n    private reportParseError(token: HasLocation, code: ErrorCode): void {\n        const error = ParseError.fromCode(\n            code,\n            token.range[0],\n            token.loc.start.line,\n            token.loc.start.column,\n        )\n        this.errors.push(error)\n\n        debug(\"[html] syntax error:\", error.message)\n    }\n\n    /**\n     * Pop an element from the current element stack.\n     */\n    private popElementStack(): void {\n        assert(this.elementStack.length >= 1)\n\n        const element = this.elementStack.pop()!\n        propagateEndLocation(element)\n\n        // Update the current namespace.\n        const current = this.currentNode\n        this.namespace =\n            current.type === \"VElement\" ? current.namespace : NS.HTML\n\n        // Update v-pre state.\n        if (this.vPreElement === element) {\n            this.vPreElement = null\n            this.expressionEnabled = true\n        }\n\n        // Update expression flag.\n        if (this.elementStack.length === 0) {\n            this.expressionEnabled = false\n        }\n    }\n\n    /**\n     * Pop elements from the current element stack.\n     * @param index The index of the element you want to pop.\n     */\n    private popElementStackUntil(index: number): void {\n        while (this.elementStack.length > index) {\n            this.popElementStack()\n        }\n    }\n\n    /**\n     * Gets the tag name from the given node or token.\n     * For SFC, it returns the value of `rawName` to be case sensitive.\n     */\n    private getTagName(startTagOrElement: { name: string; rawName: string }) {\n        return getTagName(startTagOrElement, this.isSFC)\n    }\n\n    /**\n     * Detect the namespace of the new element.\n     * @param token The StartTag token to detect.\n     * @returns The namespace of the new element.\n     */\n    //eslint-disable-next-line complexity\n    private detectNamespace(token: StartTag): Namespace {\n        const name = this.getTagName(token)\n        let ns = this.namespace\n\n        if (ns === NS.MathML || ns === NS.SVG) {\n            const element = this.currentNode\n            if (element.type === \"VElement\") {\n                if (\n                    element.namespace === NS.MathML &&\n                    this.getTagName(element) === \"annotation-xml\" &&\n                    name === \"svg\"\n                ) {\n                    return NS.SVG\n                }\n                if (\n                    isHTMLIntegrationPoint(element, this.isSFC) ||\n                    (isMathMLIntegrationPoint(element, this.isSFC) &&\n                        name !== \"mglyph\" &&\n                        name !== \"malignmark\")\n                ) {\n                    ns = NS.HTML\n                }\n            }\n        }\n\n        if (ns === NS.HTML) {\n            if (name === \"svg\") {\n                return NS.SVG\n            }\n            if (name === \"math\") {\n                return NS.MathML\n            }\n        }\n\n        if (name === \"template\") {\n            const xmlns = token.attributes.find((a) => a.key.name === \"xmlns\")\n            const value = xmlns?.value?.value\n\n            if (value === NS.HTML || value === NS.MathML || value === NS.SVG) {\n                return value\n            }\n        }\n\n        return ns\n    }\n\n    /**\n     * Close the current element if necessary.\n     * @param token The start tag to check.\n     */\n    private closeCurrentElementIfNecessary(token: StartTag): void {\n        const element = this.currentNode\n        if (element.type !== \"VElement\") {\n            return\n        }\n        const name = this.getTagName(token)\n        const elementName = this.getTagName(element)\n\n        if (elementName === \"p\" && HTML_NON_FHRASING_TAGS.has(name)) {\n            this.popElementStack()\n        }\n        if (elementName === name && HTML_CAN_BE_LEFT_OPEN_TAGS.has(name)) {\n            this.popElementStack()\n        }\n        if (DT_DD.test(elementName) && DT_DD.test(name)) {\n            this.popElementStack()\n        }\n    }\n\n    /**\n     * Adjust and validate the given attribute node.\n     * @param node The attribute node to handle.\n     * @param namespace The current namespace.\n     */\n    private processAttribute(node: VAttribute, namespace: Namespace): void {\n        if (this.needConvertToDirective(node)) {\n            this.postProcessesForScript.push(\n                (parserOptions, scriptParserOptions) => {\n                    convertToDirective(\n                        this.text,\n                        parserOptions,\n                        scriptParserOptions,\n                        this.locationCalculator,\n                        node,\n                    )\n                },\n            )\n            return\n        }\n\n        node.key.name = adjustAttributeName(node.key.name, namespace)\n        const key = this.getTagName(node.key)\n        const value = node.value?.value\n\n        if (key === \"xmlns\" && value !== namespace) {\n            this.reportParseError(node, \"x-invalid-namespace\")\n        } else if (key === \"xmlns:xlink\" && value !== NS.XLink) {\n            this.reportParseError(node, \"x-invalid-namespace\")\n        }\n    }\n    /**\n     * Checks whether the given attribute node is need convert to directive.\n     * @param node The node to check\n     */\n    private needConvertToDirective(node: VAttribute) {\n        const element = node.parent.parent\n        const tagName = this.getTagName(element)\n        const attrName = this.getTagName(node.key)\n\n        if (\n            attrName === \"generic\" &&\n            element.parent.type === \"VDocumentFragment\" &&\n            isScriptSetupElement(element) &&\n            isTSLang(element)\n        ) {\n            return true\n        }\n        const expressionEnabled =\n            this.expressionEnabled ||\n            (attrName === \"v-pre\" && !this.isInVPreElement)\n        if (!expressionEnabled) {\n            return false\n        }\n        return (\n            DIRECTIVE_NAME.test(attrName) ||\n            attrName === \"slot-scope\" ||\n            (tagName === \"template\" && attrName === \"scope\")\n        )\n    }\n\n    /**\n     * Process the given template text token with a configured template tokenizer, based on language.\n     * @param token The template text token to process.\n     * @param templateTokenizerOption The template tokenizer option.\n     */\n    private processTemplateText(\n        token: Text,\n        templateTokenizerOption: string | CustomTemplateTokenizerConstructor,\n    ): void {\n        const TemplateTokenizer: CustomTemplateTokenizerConstructor =\n            typeof templateTokenizerOption === \"function\"\n                ? templateTokenizerOption\n                : // eslint-disable-next-line @typescript-eslint/no-require-imports\n                  require(templateTokenizerOption)\n        const templateTokenizer = new TemplateTokenizer(\n            token.value,\n            this.text,\n            {\n                startingLine: token.loc.start.line,\n                startingColumn: token.loc.start.column,\n            },\n        )\n\n        // override this.tokenizer to forward expressionEnabled and state changes\n        const rootTokenizer = this.tokenizer\n        this.tokenizer = templateTokenizer\n\n        let templateToken: IntermediateToken | null = null\n        while ((templateToken = templateTokenizer.nextToken()) != null) {\n            ;(this as any)[templateToken.type](templateToken)\n        }\n\n        this.tokenizer = rootTokenizer\n\n        const index = sortedIndexBy(\n            this.tokenizer.tokens,\n            token,\n            (x) => x.range[0],\n        )\n        const count =\n            sortedLastIndexBy(this.tokenizer.tokens, token, (x) => x.range[1]) -\n            index\n        this.tokenizer.tokens.splice(index, count, ...templateTokenizer.tokens)\n        this.tokenizer.comments.push(...templateTokenizer.comments)\n        this.tokenizer.errors.push(...templateTokenizer.errors)\n    }\n\n    /**\n     * Handle the start tag token.\n     * @param token The token to handle.\n     */\n    //eslint-disable-next-line complexity\n    protected StartTag(token: StartTag): void {\n        debug(\"[html] StartTag %j\", token)\n\n        this.closeCurrentElementIfNecessary(token)\n\n        const parent = this.currentNode\n        const namespace = this.detectNamespace(token)\n        const element: VElement = {\n            type: \"VElement\",\n            range: [token.range[0], token.range[1]],\n            loc: { start: token.loc.start, end: token.loc.end },\n            parent,\n            name: adjustElementName(token.name, namespace),\n            rawName: token.rawName,\n            namespace,\n            startTag: {\n                type: \"VStartTag\",\n                range: token.range,\n                loc: token.loc,\n                parent: DUMMY_PARENT,\n                selfClosing: token.selfClosing,\n                attributes: token.attributes,\n            },\n            children: [],\n            endTag: null,\n            variables: [],\n        }\n        const hasVPre =\n            !this.isInVPreElement &&\n            token.attributes.some((a) => this.getTagName(a.key) === \"v-pre\")\n\n        // Disable expression if v-pre\n        if (hasVPre) {\n            this.expressionEnabled = false\n        }\n\n        // Setup relations.\n        parent.children.push(element)\n        element.startTag.parent = element\n        for (const attribute of token.attributes) {\n            attribute.parent = element.startTag\n            this.processAttribute(attribute, namespace)\n        }\n\n        // Resolve references.\n        this.postProcessesForScript.push(() => {\n            for (const attribute of element.startTag.attributes) {\n                if (attribute.directive) {\n                    if (\n                        attribute.key.argument?.type === \"VExpressionContainer\"\n                    ) {\n                        resolveReferences(attribute.key.argument)\n                    }\n                    if (attribute.value != null) {\n                        resolveReferences(attribute.value)\n                    }\n                }\n            }\n        })\n\n        // Check whether the self-closing is valid.\n        const isVoid =\n            namespace === NS.HTML &&\n            HTML_VOID_ELEMENT_TAGS.has(this.getTagName(element))\n        if (token.selfClosing && !isVoid && namespace === NS.HTML) {\n            this.reportParseError(\n                token,\n                \"non-void-html-element-start-tag-with-trailing-solidus\",\n            )\n        }\n\n        // Vue.js supports self-closing elements even if it's not one of void elements.\n        if (token.selfClosing || isVoid) {\n            this.expressionEnabled = !this.isInVPreElement\n            return\n        }\n\n        // Push to stack.\n        this.elementStack.push(element)\n        if (hasVPre) {\n            assert(this.vPreElement === null)\n            this.vPreElement = element\n        }\n        this.namespace = namespace\n\n        // Update the content type of this element.\n        if (namespace === NS.HTML) {\n            const elementName = this.getTagName(element)\n            if (element.parent.type === \"VDocumentFragment\") {\n                const langAttr = element.startTag.attributes.find(\n                    (a) => !a.directive && a.key.name === \"lang\",\n                ) as VAttribute | undefined\n                const lang = langAttr?.value?.value\n\n                if (elementName === \"template\") {\n                    this.expressionEnabled = true\n                    if (lang && lang !== \"html\") {\n                        // It is not an HTML template.\n                        this.tokenizer.state = \"RAWTEXT\"\n                        this.expressionEnabled = false\n                    }\n                } else if (this.isSFC) {\n                    // Element is Custom Block. e.g. <i18n>\n                    // Referred to the Vue parser. See https://github.com/vuejs/vue-next/blob/cbaa3805064cb581fc2007cf63774c91d39844fe/packages/compiler-sfc/src/parse.ts#L127\n                    if (!lang || lang !== \"html\") {\n                        // Custom Block is not HTML.\n                        this.tokenizer.state = \"RAWTEXT\"\n                    }\n                } else {\n                    if (HTML_RCDATA_TAGS.has(elementName)) {\n                        this.tokenizer.state = \"RCDATA\"\n                    }\n                    if (HTML_RAWTEXT_TAGS.has(elementName)) {\n                        this.tokenizer.state = \"RAWTEXT\"\n                    }\n                }\n            } else {\n                if (HTML_RCDATA_TAGS.has(elementName)) {\n                    this.tokenizer.state = \"RCDATA\"\n                }\n                if (HTML_RAWTEXT_TAGS.has(elementName)) {\n                    this.tokenizer.state = \"RAWTEXT\"\n                }\n            }\n        }\n    }\n\n    /**\n     * Handle the end tag token.\n     * @param token The token to handle.\n     */\n    protected EndTag(token: EndTag): void {\n        debug(\"[html] EndTag %j\", token)\n\n        const i = this.elementStack.findLastIndex(\n            (el) => el.name.toLowerCase() === token.name,\n        )\n        if (i === -1) {\n            this.reportParseError(token, \"x-invalid-end-tag\")\n            return\n        }\n\n        const element = this.elementStack[i]\n        element.endTag = {\n            type: \"VEndTag\",\n            range: token.range,\n            loc: token.loc,\n            parent: element,\n        }\n\n        this.popElementStackUntil(i)\n    }\n\n    /**\n     * Handle the text token.\n     * @param token The token to handle.\n     */\n    protected Text(token: Text): void {\n        debug(\"[html] Text %j\", token)\n        const parent = this.currentNode\n        if (\n            token.value &&\n            parent.type === \"VElement\" &&\n            parent.name === \"template\" &&\n            parent.parent.type === \"VDocumentFragment\"\n        ) {\n            const langAttribute = parent.startTag.attributes.find(\n                (a) => a.key.name === \"lang\",\n            )\n            const lang = (langAttribute?.value as VLiteral)?.value\n            if (lang && lang !== \"html\") {\n                const templateTokenizerOption =\n                    this.baseParserOptions.templateTokenizer?.[lang]\n                if (templateTokenizerOption) {\n                    this.processTemplateText(token, templateTokenizerOption)\n                    return\n                }\n            }\n        }\n        parent.children.push({\n            type: \"VText\",\n            range: token.range,\n            loc: token.loc,\n            parent,\n            value: token.value,\n        })\n    }\n\n    /**\n     * Handle the text token.\n     * @param token The token to handle.\n     */\n    protected Mustache(token: Mustache): void {\n        debug(\"[html] Mustache %j\", token)\n\n        const parent = this.currentNode\n        const container: VExpressionContainer = {\n            type: \"VExpressionContainer\",\n            range: token.range,\n            loc: token.loc,\n            parent,\n            expression: null,\n            references: [],\n        }\n        // Set relationship.\n        parent.children.push(container)\n\n        this.postProcessesForScript.push((parserOptions) => {\n            processMustache(\n                parserOptions,\n                this.locationCalculator,\n                container,\n                token,\n            )\n            // Resolve references.\n            resolveReferences(container)\n        })\n    }\n}\n","/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * @copyright 2017 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\n\n/**\n * Code mapping of HTML numeric entities.\n */\nexport const alternativeCR = new Map(\n    [[128, 8364], [130, 8218], [131, 402], [132, 8222], [133, 8230], [134, 8224], [135, 8225], [136, 710], [137, 8240], [138, 352], [139, 8249], [140, 338], [142, 381], [145, 8216], [146, 8217], [147, 8220], [148, 8221], [149, 8226], [150, 8211], [151, 8212], [152, 732], [153, 8482], [154, 353], [155, 8250], [156, 339], [158, 382], [159, 376]]\n)\n","/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * @copyright 2017 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\n\n/**\n * HTML entities which are separated by their length.\n */\nexport const entitySets: {\n    length: number,\n    entities: {\n        [name: string]: number[] | undefined\n    }\n}[] = [{\"length\":32,\"entities\":{\"CounterClockwiseContourIntegral;\":[8755]}},{\"length\":25,\"entities\":{\"ClockwiseContourIntegral;\":[8754],\"DoubleLongLeftRightArrow;\":[10234]}},{\"length\":24,\"entities\":{\"NotNestedGreaterGreater;\":[10914,824]}},{\"length\":23,\"entities\":{\"DiacriticalDoubleAcute;\":[733],\"NotSquareSupersetEqual;\":[8931]}},{\"length\":22,\"entities\":{\"CloseCurlyDoubleQuote;\":[8221],\"DoubleContourIntegral;\":[8751],\"FilledVerySmallSquare;\":[9642],\"NegativeVeryThinSpace;\":[8203],\"NotPrecedesSlantEqual;\":[8928],\"NotRightTriangleEqual;\":[8941],\"NotSucceedsSlantEqual;\":[8929]}},{\"length\":21,\"entities\":{\"CapitalDifferentialD;\":[8517],\"DoubleLeftRightArrow;\":[8660],\"DoubleLongRightArrow;\":[10233],\"EmptyVerySmallSquare;\":[9643],\"NestedGreaterGreater;\":[8811],\"NotDoubleVerticalBar;\":[8742],\"NotGreaterSlantEqual;\":[10878,824],\"NotLeftTriangleEqual;\":[8940],\"NotSquareSubsetEqual;\":[8930],\"OpenCurlyDoubleQuote;\":[8220],\"ReverseUpEquilibrium;\":[10607]}},{\"length\":20,\"entities\":{\"DoubleLongLeftArrow;\":[10232],\"DownLeftRightVector;\":[10576],\"LeftArrowRightArrow;\":[8646],\"NegativeMediumSpace;\":[8203],\"NotGreaterFullEqual;\":[8807,824],\"NotRightTriangleBar;\":[10704,824],\"RightArrowLeftArrow;\":[8644],\"SquareSupersetEqual;\":[8850],\"leftrightsquigarrow;\":[8621]}},{\"length\":19,\"entities\":{\"DownRightTeeVector;\":[10591],\"DownRightVectorBar;\":[10583],\"LongLeftRightArrow;\":[10231],\"Longleftrightarrow;\":[10234],\"NegativeThickSpace;\":[8203],\"NotLeftTriangleBar;\":[10703,824],\"PrecedesSlantEqual;\":[8828],\"ReverseEquilibrium;\":[8651],\"RightDoubleBracket;\":[10215],\"RightDownTeeVector;\":[10589],\"RightDownVectorBar;\":[10581],\"RightTriangleEqual;\":[8885],\"SquareIntersection;\":[8851],\"SucceedsSlantEqual;\":[8829],\"blacktriangleright;\":[9656],\"longleftrightarrow;\":[10231]}},{\"length\":18,\"entities\":{\"DoubleUpDownArrow;\":[8661],\"DoubleVerticalBar;\":[8741],\"DownLeftTeeVector;\":[10590],\"DownLeftVectorBar;\":[10582],\"FilledSmallSquare;\":[9724],\"GreaterSlantEqual;\":[10878],\"LeftDoubleBracket;\":[10214],\"LeftDownTeeVector;\":[10593],\"LeftDownVectorBar;\":[10585],\"LeftTriangleEqual;\":[8884],\"NegativeThinSpace;\":[8203],\"NotGreaterGreater;\":[8811,824],\"NotLessSlantEqual;\":[10877,824],\"NotNestedLessLess;\":[10913,824],\"NotReverseElement;\":[8716],\"NotSquareSuperset;\":[8848,824],\"NotTildeFullEqual;\":[8775],\"RightAngleBracket;\":[10217],\"RightUpDownVector;\":[10575],\"SquareSubsetEqual;\":[8849],\"VerticalSeparator;\":[10072],\"blacktriangledown;\":[9662],\"blacktriangleleft;\":[9666],\"leftrightharpoons;\":[8651],\"rightleftharpoons;\":[8652],\"twoheadrightarrow;\":[8608]}},{\"length\":17,\"entities\":{\"DiacriticalAcute;\":[180],\"DiacriticalGrave;\":[96],\"DiacriticalTilde;\":[732],\"DoubleRightArrow;\":[8658],\"DownArrowUpArrow;\":[8693],\"EmptySmallSquare;\":[9723],\"GreaterEqualLess;\":[8923],\"GreaterFullEqual;\":[8807],\"LeftAngleBracket;\":[10216],\"LeftUpDownVector;\":[10577],\"LessEqualGreater;\":[8922],\"NonBreakingSpace;\":[160],\"NotPrecedesEqual;\":[10927,824],\"NotRightTriangle;\":[8939],\"NotSucceedsEqual;\":[10928,824],\"NotSucceedsTilde;\":[8831,824],\"NotSupersetEqual;\":[8841],\"RightTriangleBar;\":[10704],\"RightUpTeeVector;\":[10588],\"RightUpVectorBar;\":[10580],\"UnderParenthesis;\":[9181],\"UpArrowDownArrow;\":[8645],\"circlearrowright;\":[8635],\"downharpoonright;\":[8642],\"ntrianglerighteq;\":[8941],\"rightharpoondown;\":[8641],\"rightrightarrows;\":[8649],\"twoheadleftarrow;\":[8606],\"vartriangleright;\":[8883]}},{\"length\":16,\"entities\":{\"CloseCurlyQuote;\":[8217],\"ContourIntegral;\":[8750],\"DoubleDownArrow;\":[8659],\"DoubleLeftArrow;\":[8656],\"DownRightVector;\":[8641],\"LeftRightVector;\":[10574],\"LeftTriangleBar;\":[10703],\"LeftUpTeeVector;\":[10592],\"LeftUpVectorBar;\":[10584],\"LowerRightArrow;\":[8600],\"NotGreaterEqual;\":[8817],\"NotGreaterTilde;\":[8821],\"NotHumpDownHump;\":[8782,824],\"NotLeftTriangle;\":[8938],\"NotSquareSubset;\":[8847,824],\"OverParenthesis;\":[9180],\"RightDownVector;\":[8642],\"ShortRightArrow;\":[8594],\"UpperRightArrow;\":[8599],\"bigtriangledown;\":[9661],\"circlearrowleft;\":[8634],\"curvearrowright;\":[8631],\"downharpoonleft;\":[8643],\"leftharpoondown;\":[8637],\"leftrightarrows;\":[8646],\"nLeftrightarrow;\":[8654],\"nleftrightarrow;\":[8622],\"ntrianglelefteq;\":[8940],\"rightleftarrows;\":[8644],\"rightsquigarrow;\":[8605],\"rightthreetimes;\":[8908],\"straightepsilon;\":[1013],\"trianglerighteq;\":[8885],\"vartriangleleft;\":[8882]}},{\"length\":15,\"entities\":{\"DiacriticalDot;\":[729],\"DoubleRightTee;\":[8872],\"DownLeftVector;\":[8637],\"GreaterGreater;\":[10914],\"HorizontalLine;\":[9472],\"InvisibleComma;\":[8291],\"InvisibleTimes;\":[8290],\"LeftDownVector;\":[8643],\"LeftRightArrow;\":[8596],\"Leftrightarrow;\":[8660],\"LessSlantEqual;\":[10877],\"LongRightArrow;\":[10230],\"Longrightarrow;\":[10233],\"LowerLeftArrow;\":[8601],\"NestedLessLess;\":[8810],\"NotGreaterLess;\":[8825],\"NotLessGreater;\":[8824],\"NotSubsetEqual;\":[8840],\"NotVerticalBar;\":[8740],\"OpenCurlyQuote;\":[8216],\"ReverseElement;\":[8715],\"RightTeeVector;\":[10587],\"RightVectorBar;\":[10579],\"ShortDownArrow;\":[8595],\"ShortLeftArrow;\":[8592],\"SquareSuperset;\":[8848],\"TildeFullEqual;\":[8773],\"UpperLeftArrow;\":[8598],\"ZeroWidthSpace;\":[8203],\"curvearrowleft;\":[8630],\"doublebarwedge;\":[8966],\"downdownarrows;\":[8650],\"hookrightarrow;\":[8618],\"leftleftarrows;\":[8647],\"leftrightarrow;\":[8596],\"leftthreetimes;\":[8907],\"longrightarrow;\":[10230],\"looparrowright;\":[8620],\"nshortparallel;\":[8742],\"ntriangleright;\":[8939],\"rightarrowtail;\":[8611],\"rightharpoonup;\":[8640],\"trianglelefteq;\":[8884],\"upharpoonright;\":[8638]}},{\"length\":14,\"entities\":{\"ApplyFunction;\":[8289],\"DifferentialD;\":[8518],\"DoubleLeftTee;\":[10980],\"DoubleUpArrow;\":[8657],\"LeftTeeVector;\":[10586],\"LeftVectorBar;\":[10578],\"LessFullEqual;\":[8806],\"LongLeftArrow;\":[10229],\"Longleftarrow;\":[10232],\"NotEqualTilde;\":[8770,824],\"NotTildeEqual;\":[8772],\"NotTildeTilde;\":[8777],\"Poincareplane;\":[8460],\"PrecedesEqual;\":[10927],\"PrecedesTilde;\":[8830],\"RightArrowBar;\":[8677],\"RightTeeArrow;\":[8614],\"RightTriangle;\":[8883],\"RightUpVector;\":[8638],\"SucceedsEqual;\":[10928],\"SucceedsTilde;\":[8831],\"SupersetEqual;\":[8839],\"UpEquilibrium;\":[10606],\"VerticalTilde;\":[8768],\"VeryThinSpace;\":[8202],\"bigtriangleup;\":[9651],\"blacktriangle;\":[9652],\"divideontimes;\":[8903],\"fallingdotseq;\":[8786],\"hookleftarrow;\":[8617],\"leftarrowtail;\":[8610],\"leftharpoonup;\":[8636],\"longleftarrow;\":[10229],\"looparrowleft;\":[8619],\"measuredangle;\":[8737],\"ntriangleleft;\":[8938],\"shortparallel;\":[8741],\"smallsetminus;\":[8726],\"triangleright;\":[9657],\"upharpoonleft;\":[8639],\"varsubsetneqq;\":[10955,65024],\"varsupsetneqq;\":[10956,65024]}},{\"length\":13,\"entities\":{\"DownArrowBar;\":[10515],\"DownTeeArrow;\":[8615],\"ExponentialE;\":[8519],\"GreaterEqual;\":[8805],\"GreaterTilde;\":[8819],\"HilbertSpace;\":[8459],\"HumpDownHump;\":[8782],\"Intersection;\":[8898],\"LeftArrowBar;\":[8676],\"LeftTeeArrow;\":[8612],\"LeftTriangle;\":[8882],\"LeftUpVector;\":[8639],\"NotCongruent;\":[8802],\"NotHumpEqual;\":[8783,824],\"NotLessEqual;\":[8816],\"NotLessTilde;\":[8820],\"Proportional;\":[8733],\"RightCeiling;\":[8969],\"RoundImplies;\":[10608],\"ShortUpArrow;\":[8593],\"SquareSubset;\":[8847],\"UnderBracket;\":[9141],\"VerticalLine;\":[124],\"blacklozenge;\":[10731],\"exponentiale;\":[8519],\"risingdotseq;\":[8787],\"triangledown;\":[9663],\"triangleleft;\":[9667],\"varsubsetneq;\":[8842,65024],\"varsupsetneq;\":[8843,65024]}},{\"length\":12,\"entities\":{\"CircleMinus;\":[8854],\"CircleTimes;\":[8855],\"Equilibrium;\":[8652],\"GreaterLess;\":[8823],\"LeftCeiling;\":[8968],\"LessGreater;\":[8822],\"MediumSpace;\":[8287],\"NotLessLess;\":[8810,824],\"NotPrecedes;\":[8832],\"NotSucceeds;\":[8833],\"NotSuperset;\":[8835,8402],\"OverBracket;\":[9140],\"RightVector;\":[8640],\"Rrightarrow;\":[8667],\"RuleDelayed;\":[10740],\"SmallCircle;\":[8728],\"SquareUnion;\":[8852],\"SubsetEqual;\":[8838],\"UpDownArrow;\":[8597],\"Updownarrow;\":[8661],\"VerticalBar;\":[8739],\"backepsilon;\":[1014],\"blacksquare;\":[9642],\"circledcirc;\":[8858],\"circleddash;\":[8861],\"curlyeqprec;\":[8926],\"curlyeqsucc;\":[8927],\"diamondsuit;\":[9830],\"eqslantless;\":[10901],\"expectation;\":[8496],\"nRightarrow;\":[8655],\"nrightarrow;\":[8603],\"preccurlyeq;\":[8828],\"precnapprox;\":[10937],\"quaternions;\":[8461],\"straightphi;\":[981],\"succcurlyeq;\":[8829],\"succnapprox;\":[10938],\"thickapprox;\":[8776],\"updownarrow;\":[8597]}},{\"length\":11,\"entities\":{\"Bernoullis;\":[8492],\"CirclePlus;\":[8853],\"EqualTilde;\":[8770],\"Fouriertrf;\":[8497],\"ImaginaryI;\":[8520],\"Laplacetrf;\":[8466],\"LeftVector;\":[8636],\"Lleftarrow;\":[8666],\"NotElement;\":[8713],\"NotGreater;\":[8815],\"Proportion;\":[8759],\"RightArrow;\":[8594],\"RightFloor;\":[8971],\"Rightarrow;\":[8658],\"ThickSpace;\":[8287,8202],\"TildeEqual;\":[8771],\"TildeTilde;\":[8776],\"UnderBrace;\":[9183],\"UpArrowBar;\":[10514],\"UpTeeArrow;\":[8613],\"circledast;\":[8859],\"complement;\":[8705],\"curlywedge;\":[8911],\"eqslantgtr;\":[10902],\"gtreqqless;\":[10892],\"lessapprox;\":[10885],\"lesseqqgtr;\":[10891],\"lmoustache;\":[9136],\"longmapsto;\":[10236],\"mapstodown;\":[8615],\"mapstoleft;\":[8612],\"nLeftarrow;\":[8653],\"nleftarrow;\":[8602],\"nsubseteqq;\":[10949,824],\"nsupseteqq;\":[10950,824],\"precapprox;\":[10935],\"rightarrow;\":[8594],\"rmoustache;\":[9137],\"sqsubseteq;\":[8849],\"sqsupseteq;\":[8850],\"subsetneqq;\":[10955],\"succapprox;\":[10936],\"supsetneqq;\":[10956],\"upuparrows;\":[8648],\"varepsilon;\":[1013],\"varnothing;\":[8709]}},{\"length\":10,\"entities\":{\"Backslash;\":[8726],\"CenterDot;\":[183],\"CircleDot;\":[8857],\"Congruent;\":[8801],\"Coproduct;\":[8720],\"DoubleDot;\":[168],\"DownArrow;\":[8595],\"DownBreve;\":[785],\"Downarrow;\":[8659],\"HumpEqual;\":[8783],\"LeftArrow;\":[8592],\"LeftFloor;\":[8970],\"Leftarrow;\":[8656],\"LessTilde;\":[8818],\"Mellintrf;\":[8499],\"MinusPlus;\":[8723],\"NotCupCap;\":[8813],\"NotExists;\":[8708],\"NotSubset;\":[8834,8402],\"OverBrace;\":[9182],\"PlusMinus;\":[177],\"Therefore;\":[8756],\"ThinSpace;\":[8201],\"TripleDot;\":[8411],\"UnionPlus;\":[8846],\"backprime;\":[8245],\"backsimeq;\":[8909],\"bigotimes;\":[10754],\"centerdot;\":[183],\"checkmark;\":[10003],\"complexes;\":[8450],\"dotsquare;\":[8865],\"downarrow;\":[8595],\"gtrapprox;\":[10886],\"gtreqless;\":[8923],\"gvertneqq;\":[8809,65024],\"heartsuit;\":[9829],\"leftarrow;\":[8592],\"lesseqgtr;\":[8922],\"lvertneqq;\":[8808,65024],\"ngeqslant;\":[10878,824],\"nleqslant;\":[10877,824],\"nparallel;\":[8742],\"nshortmid;\":[8740],\"nsubseteq;\":[8840],\"nsupseteq;\":[8841],\"pitchfork;\":[8916],\"rationals;\":[8474],\"spadesuit;\":[9824],\"subseteqq;\":[10949],\"subsetneq;\":[8842],\"supseteqq;\":[10950],\"supsetneq;\":[8843],\"therefore;\":[8756],\"triangleq;\":[8796],\"varpropto;\":[8733]}},{\"length\":9,\"entities\":{\"DDotrahd;\":[10513],\"DotEqual;\":[8784],\"Integral;\":[8747],\"LessLess;\":[10913],\"NotEqual;\":[8800],\"NotTilde;\":[8769],\"PartialD;\":[8706],\"Precedes;\":[8826],\"RightTee;\":[8866],\"Succeeds;\":[8827],\"SuchThat;\":[8715],\"Superset;\":[8835],\"Uarrocir;\":[10569],\"UnderBar;\":[95],\"andslope;\":[10840],\"angmsdaa;\":[10664],\"angmsdab;\":[10665],\"angmsdac;\":[10666],\"angmsdad;\":[10667],\"angmsdae;\":[10668],\"angmsdaf;\":[10669],\"angmsdag;\":[10670],\"angmsdah;\":[10671],\"angrtvbd;\":[10653],\"approxeq;\":[8778],\"awconint;\":[8755],\"backcong;\":[8780],\"barwedge;\":[8965],\"bbrktbrk;\":[9142],\"bigoplus;\":[10753],\"bigsqcup;\":[10758],\"biguplus;\":[10756],\"bigwedge;\":[8896],\"boxminus;\":[8863],\"boxtimes;\":[8864],\"bsolhsub;\":[10184],\"capbrcup;\":[10825],\"circledR;\":[174],\"circledS;\":[9416],\"cirfnint;\":[10768],\"clubsuit;\":[9827],\"cupbrcap;\":[10824],\"curlyvee;\":[8910],\"cwconint;\":[8754],\"doteqdot;\":[8785],\"dotminus;\":[8760],\"drbkarow;\":[10512],\"dzigrarr;\":[10239],\"elinters;\":[9191],\"emptyset;\":[8709],\"eqvparsl;\":[10725],\"fpartint;\":[10765],\"geqslant;\":[10878],\"gesdotol;\":[10884],\"gnapprox;\":[10890],\"hksearow;\":[10533],\"hkswarow;\":[10534],\"imagline;\":[8464],\"imagpart;\":[8465],\"infintie;\":[10717],\"integers;\":[8484],\"intercal;\":[8890],\"intlarhk;\":[10775],\"laemptyv;\":[10676],\"ldrushar;\":[10571],\"leqslant;\":[10877],\"lesdotor;\":[10883],\"llcorner;\":[8990],\"lnapprox;\":[10889],\"lrcorner;\":[8991],\"lurdshar;\":[10570],\"mapstoup;\":[8613],\"multimap;\":[8888],\"naturals;\":[8469],\"ncongdot;\":[10861,824],\"notindot;\":[8949,824],\"otimesas;\":[10806],\"parallel;\":[8741],\"plusacir;\":[10787],\"pointint;\":[10773],\"precneqq;\":[10933],\"precnsim;\":[8936],\"profalar;\":[9006],\"profline;\":[8978],\"profsurf;\":[8979],\"raemptyv;\":[10675],\"realpart;\":[8476],\"rppolint;\":[10770],\"rtriltri;\":[10702],\"scpolint;\":[10771],\"setminus;\":[8726],\"shortmid;\":[8739],\"smeparsl;\":[10724],\"sqsubset;\":[8847],\"sqsupset;\":[8848],\"subseteq;\":[8838],\"succneqq;\":[10934],\"succnsim;\":[8937],\"supseteq;\":[8839],\"thetasym;\":[977],\"thicksim;\":[8764],\"timesbar;\":[10801],\"triangle;\":[9653],\"triminus;\":[10810],\"trpezium;\":[9186],\"ulcorner;\":[8988],\"urcorner;\":[8989],\"varkappa;\":[1008],\"varsigma;\":[962],\"vartheta;\":[977]}},{\"length\":8,\"entities\":{\"Because;\":[8757],\"Cayleys;\":[8493],\"Cconint;\":[8752],\"Cedilla;\":[184],\"Diamond;\":[8900],\"DownTee;\":[8868],\"Element;\":[8712],\"Epsilon;\":[917],\"Implies;\":[8658],\"LeftTee;\":[8867],\"NewLine;\":[10],\"NoBreak;\":[8288],\"NotLess;\":[8814],\"Omicron;\":[927],\"OverBar;\":[8254],\"Product;\":[8719],\"UpArrow;\":[8593],\"Uparrow;\":[8657],\"Upsilon;\":[933],\"alefsym;\":[8501],\"angrtvb;\":[8894],\"angzarr;\":[9084],\"asympeq;\":[8781],\"backsim;\":[8765],\"because;\":[8757],\"bemptyv;\":[10672],\"between;\":[8812],\"bigcirc;\":[9711],\"bigodot;\":[10752],\"bigstar;\":[9733],\"bnequiv;\":[8801,8421],\"boxplus;\":[8862],\"ccupssm;\":[10832],\"cemptyv;\":[10674],\"cirscir;\":[10690],\"coloneq;\":[8788],\"congdot;\":[10861],\"cudarrl;\":[10552],\"cudarrr;\":[10549],\"cularrp;\":[10557],\"curarrm;\":[10556],\"dbkarow;\":[10511],\"ddagger;\":[8225],\"ddotseq;\":[10871],\"demptyv;\":[10673],\"diamond;\":[8900],\"digamma;\":[989],\"dotplus;\":[8724],\"dwangle;\":[10662],\"epsilon;\":[949],\"eqcolon;\":[8789],\"equivDD;\":[10872],\"gesdoto;\":[10882],\"gtquest;\":[10876],\"gtrless;\":[8823],\"harrcir;\":[10568],\"intprod;\":[10812],\"isindot;\":[8949],\"larrbfs;\":[10527],\"larrsim;\":[10611],\"lbrksld;\":[10639],\"lbrkslu;\":[10637],\"ldrdhar;\":[10599],\"lesdoto;\":[10881],\"lessdot;\":[8918],\"lessgtr;\":[8822],\"lesssim;\":[8818],\"lotimes;\":[10804],\"lozenge;\":[9674],\"ltquest;\":[10875],\"luruhar;\":[10598],\"maltese;\":[10016],\"minusdu;\":[10794],\"napprox;\":[8777],\"natural;\":[9838],\"nearrow;\":[8599],\"nexists;\":[8708],\"notinva;\":[8713],\"notinvb;\":[8951],\"notinvc;\":[8950],\"notniva;\":[8716],\"notnivb;\":[8958],\"notnivc;\":[8957],\"npolint;\":[10772],\"npreceq;\":[10927,824],\"nsqsube;\":[8930],\"nsqsupe;\":[8931],\"nsubset;\":[8834,8402],\"nsucceq;\":[10928,824],\"nsupset;\":[8835,8402],\"nvinfin;\":[10718],\"nvltrie;\":[8884,8402],\"nvrtrie;\":[8885,8402],\"nwarrow;\":[8598],\"olcross;\":[10683],\"omicron;\":[959],\"orderof;\":[8500],\"orslope;\":[10839],\"pertenk;\":[8241],\"planckh;\":[8462],\"pluscir;\":[10786],\"plussim;\":[10790],\"plustwo;\":[10791],\"precsim;\":[8830],\"quatint;\":[10774],\"questeq;\":[8799],\"rarrbfs;\":[10528],\"rarrsim;\":[10612],\"rbrksld;\":[10638],\"rbrkslu;\":[10640],\"rdldhar;\":[10601],\"realine;\":[8475],\"rotimes;\":[10805],\"ruluhar;\":[10600],\"searrow;\":[8600],\"simplus;\":[10788],\"simrarr;\":[10610],\"subedot;\":[10947],\"submult;\":[10945],\"subplus;\":[10943],\"subrarr;\":[10617],\"succsim;\":[8831],\"supdsub;\":[10968],\"supedot;\":[10948],\"suphsol;\":[10185],\"suphsub;\":[10967],\"suplarr;\":[10619],\"supmult;\":[10946],\"supplus;\":[10944],\"swarrow;\":[8601],\"topfork;\":[10970],\"triplus;\":[10809],\"tritime;\":[10811],\"uparrow;\":[8593],\"upsilon;\":[965],\"uwangle;\":[10663],\"vzigzag;\":[10650],\"zigrarr;\":[8669]}},{\"length\":7,\"entities\":{\"Aacute;\":[193],\"Abreve;\":[258],\"Agrave;\":[192],\"Assign;\":[8788],\"Atilde;\":[195],\"Barwed;\":[8966],\"Bumpeq;\":[8782],\"Cacute;\":[262],\"Ccaron;\":[268],\"Ccedil;\":[199],\"Colone;\":[10868],\"Conint;\":[8751],\"CupCap;\":[8781],\"Dagger;\":[8225],\"Dcaron;\":[270],\"DotDot;\":[8412],\"Dstrok;\":[272],\"Eacute;\":[201],\"Ecaron;\":[282],\"Egrave;\":[200],\"Exists;\":[8707],\"ForAll;\":[8704],\"Gammad;\":[988],\"Gbreve;\":[286],\"Gcedil;\":[290],\"HARDcy;\":[1066],\"Hstrok;\":[294],\"Iacute;\":[205],\"Igrave;\":[204],\"Itilde;\":[296],\"Jsercy;\":[1032],\"Kcedil;\":[310],\"Lacute;\":[313],\"Lambda;\":[923],\"Lcaron;\":[317],\"Lcedil;\":[315],\"Lmidot;\":[319],\"Lstrok;\":[321],\"Nacute;\":[323],\"Ncaron;\":[327],\"Ncedil;\":[325],\"Ntilde;\":[209],\"Oacute;\":[211],\"Odblac;\":[336],\"Ograve;\":[210],\"Oslash;\":[216],\"Otilde;\":[213],\"Otimes;\":[10807],\"Racute;\":[340],\"Rarrtl;\":[10518],\"Rcaron;\":[344],\"Rcedil;\":[342],\"SHCHcy;\":[1065],\"SOFTcy;\":[1068],\"Sacute;\":[346],\"Scaron;\":[352],\"Scedil;\":[350],\"Square;\":[9633],\"Subset;\":[8912],\"Supset;\":[8913],\"Tcaron;\":[356],\"Tcedil;\":[354],\"Tstrok;\":[358],\"Uacute;\":[218],\"Ubreve;\":[364],\"Udblac;\":[368],\"Ugrave;\":[217],\"Utilde;\":[360],\"Vdashl;\":[10982],\"Verbar;\":[8214],\"Vvdash;\":[8874],\"Yacute;\":[221],\"Zacute;\":[377],\"Zcaron;\":[381],\"aacute;\":[225],\"abreve;\":[259],\"agrave;\":[224],\"andand;\":[10837],\"angmsd;\":[8737],\"angsph;\":[8738],\"apacir;\":[10863],\"approx;\":[8776],\"atilde;\":[227],\"barvee;\":[8893],\"barwed;\":[8965],\"becaus;\":[8757],\"bernou;\":[8492],\"bigcap;\":[8898],\"bigcup;\":[8899],\"bigvee;\":[8897],\"bkarow;\":[10509],\"bottom;\":[8869],\"bowtie;\":[8904],\"boxbox;\":[10697],\"bprime;\":[8245],\"brvbar;\":[166],\"bullet;\":[8226],\"bumpeq;\":[8783],\"cacute;\":[263],\"capand;\":[10820],\"capcap;\":[10827],\"capcup;\":[10823],\"capdot;\":[10816],\"ccaron;\":[269],\"ccedil;\":[231],\"circeq;\":[8791],\"cirmid;\":[10991],\"colone;\":[8788],\"commat;\":[64],\"compfn;\":[8728],\"conint;\":[8750],\"coprod;\":[8720],\"copysr;\":[8471],\"cularr;\":[8630],\"cupcap;\":[10822],\"cupcup;\":[10826],\"cupdot;\":[8845],\"curarr;\":[8631],\"curren;\":[164],\"cylcty;\":[9005],\"dagger;\":[8224],\"daleth;\":[8504],\"dcaron;\":[271],\"dfisht;\":[10623],\"divide;\":[247],\"divonx;\":[8903],\"dlcorn;\":[8990],\"dlcrop;\":[8973],\"dollar;\":[36],\"drcorn;\":[8991],\"drcrop;\":[8972],\"dstrok;\":[273],\"eacute;\":[233],\"easter;\":[10862],\"ecaron;\":[283],\"ecolon;\":[8789],\"egrave;\":[232],\"egsdot;\":[10904],\"elsdot;\":[10903],\"emptyv;\":[8709],\"emsp13;\":[8196],\"emsp14;\":[8197],\"eparsl;\":[10723],\"eqcirc;\":[8790],\"equals;\":[61],\"equest;\":[8799],\"female;\":[9792],\"ffilig;\":[64259],\"ffllig;\":[64260],\"forall;\":[8704],\"frac12;\":[189],\"frac13;\":[8531],\"frac14;\":[188],\"frac15;\":[8533],\"frac16;\":[8537],\"frac18;\":[8539],\"frac23;\":[8532],\"frac25;\":[8534],\"frac34;\":[190],\"frac35;\":[8535],\"frac38;\":[8540],\"frac45;\":[8536],\"frac56;\":[8538],\"frac58;\":[8541],\"frac78;\":[8542],\"gacute;\":[501],\"gammad;\":[989],\"gbreve;\":[287],\"gesdot;\":[10880],\"gesles;\":[10900],\"gtlPar;\":[10645],\"gtrarr;\":[10616],\"gtrdot;\":[8919],\"gtrsim;\":[8819],\"hairsp;\":[8202],\"hamilt;\":[8459],\"hardcy;\":[1098],\"hearts;\":[9829],\"hellip;\":[8230],\"hercon;\":[8889],\"homtht;\":[8763],\"horbar;\":[8213],\"hslash;\":[8463],\"hstrok;\":[295],\"hybull;\":[8259],\"hyphen;\":[8208],\"iacute;\":[237],\"igrave;\":[236],\"iiiint;\":[10764],\"iinfin;\":[10716],\"incare;\":[8453],\"inodot;\":[305],\"intcal;\":[8890],\"iquest;\":[191],\"isinsv;\":[8947],\"itilde;\":[297],\"jsercy;\":[1112],\"kappav;\":[1008],\"kcedil;\":[311],\"kgreen;\":[312],\"lAtail;\":[10523],\"lacute;\":[314],\"lagran;\":[8466],\"lambda;\":[955],\"langle;\":[10216],\"larrfs;\":[10525],\"larrhk;\":[8617],\"larrlp;\":[8619],\"larrpl;\":[10553],\"larrtl;\":[8610],\"latail;\":[10521],\"lbrace;\":[123],\"lbrack;\":[91],\"lcaron;\":[318],\"lcedil;\":[316],\"ldquor;\":[8222],\"lesdot;\":[10879],\"lesges;\":[10899],\"lfisht;\":[10620],\"lfloor;\":[8970],\"lharul;\":[10602],\"llhard;\":[10603],\"lmidot;\":[320],\"lmoust;\":[9136],\"loplus;\":[10797],\"lowast;\":[8727],\"lowbar;\":[95],\"lparlt;\":[10643],\"lrhard;\":[10605],\"lsaquo;\":[8249],\"lsquor;\":[8218],\"lstrok;\":[322],\"lthree;\":[8907],\"ltimes;\":[8905],\"ltlarr;\":[10614],\"ltrPar;\":[10646],\"mapsto;\":[8614],\"marker;\":[9646],\"mcomma;\":[10793],\"midast;\":[42],\"midcir;\":[10992],\"middot;\":[183],\"minusb;\":[8863],\"minusd;\":[8760],\"mnplus;\":[8723],\"models;\":[8871],\"mstpos;\":[8766],\"nVDash;\":[8879],\"nVdash;\":[8878],\"nacute;\":[324],\"nbumpe;\":[8783,824],\"ncaron;\":[328],\"ncedil;\":[326],\"nearhk;\":[10532],\"nequiv;\":[8802],\"nesear;\":[10536],\"nexist;\":[8708],\"nltrie;\":[8940],\"notinE;\":[8953,824],\"nparsl;\":[11005,8421],\"nprcue;\":[8928],\"nrarrc;\":[10547,824],\"nrarrw;\":[8605,824],\"nrtrie;\":[8941],\"nsccue;\":[8929],\"nsimeq;\":[8772],\"ntilde;\":[241],\"numero;\":[8470],\"nvDash;\":[8877],\"nvHarr;\":[10500],\"nvdash;\":[8876],\"nvlArr;\":[10498],\"nvrArr;\":[10499],\"nwarhk;\":[10531],\"nwnear;\":[10535],\"oacute;\":[243],\"odblac;\":[337],\"odsold;\":[10684],\"ograve;\":[242],\"ominus;\":[8854],\"origof;\":[8886],\"oslash;\":[248],\"otilde;\":[245],\"otimes;\":[8855],\"parsim;\":[10995],\"percnt;\":[37],\"period;\":[46],\"permil;\":[8240],\"phmmat;\":[8499],\"planck;\":[8463],\"plankv;\":[8463],\"plusdo;\":[8724],\"plusdu;\":[10789],\"plusmn;\":[177],\"preceq;\":[10927],\"primes;\":[8473],\"prnsim;\":[8936],\"propto;\":[8733],\"prurel;\":[8880],\"puncsp;\":[8200],\"qprime;\":[8279],\"rAtail;\":[10524],\"racute;\":[341],\"rangle;\":[10217],\"rarrap;\":[10613],\"rarrfs;\":[10526],\"rarrhk;\":[8618],\"rarrlp;\":[8620],\"rarrpl;\":[10565],\"rarrtl;\":[8611],\"ratail;\":[10522],\"rbrace;\":[125],\"rbrack;\":[93],\"rcaron;\":[345],\"rcedil;\":[343],\"rdquor;\":[8221],\"rfisht;\":[10621],\"rfloor;\":[8971],\"rharul;\":[10604],\"rmoust;\":[9137],\"roplus;\":[10798],\"rpargt;\":[10644],\"rsaquo;\":[8250],\"rsquor;\":[8217],\"rthree;\":[8908],\"rtimes;\":[8906],\"sacute;\":[347],\"scaron;\":[353],\"scedil;\":[351],\"scnsim;\":[8937],\"searhk;\":[10533],\"seswar;\":[10537],\"sfrown;\":[8994],\"shchcy;\":[1097],\"sigmaf;\":[962],\"sigmav;\":[962],\"simdot;\":[10858],\"smashp;\":[10803],\"softcy;\":[1100],\"solbar;\":[9023],\"spades;\":[9824],\"sqcaps;\":[8851,65024],\"sqcups;\":[8852,65024],\"sqsube;\":[8849],\"sqsupe;\":[8850],\"square;\":[9633],\"squarf;\":[9642],\"ssetmn;\":[8726],\"ssmile;\":[8995],\"sstarf;\":[8902],\"subdot;\":[10941],\"subset;\":[8834],\"subsim;\":[10951],\"subsub;\":[10965],\"subsup;\":[10963],\"succeq;\":[10928],\"supdot;\":[10942],\"supset;\":[8835],\"supsim;\":[10952],\"supsub;\":[10964],\"supsup;\":[10966],\"swarhk;\":[10534],\"swnwar;\":[10538],\"target;\":[8982],\"tcaron;\":[357],\"tcedil;\":[355],\"telrec;\":[8981],\"there4;\":[8756],\"thetav;\":[977],\"thinsp;\":[8201],\"thksim;\":[8764],\"timesb;\":[8864],\"timesd;\":[10800],\"topbot;\":[9014],\"topcir;\":[10993],\"tprime;\":[8244],\"tridot;\":[9708],\"tstrok;\":[359],\"uacute;\":[250],\"ubreve;\":[365],\"udblac;\":[369],\"ufisht;\":[10622],\"ugrave;\":[249],\"ulcorn;\":[8988],\"ulcrop;\":[8975],\"urcorn;\":[8989],\"urcrop;\":[8974],\"utilde;\":[361],\"vangrt;\":[10652],\"varphi;\":[981],\"varrho;\":[1009],\"veebar;\":[8891],\"vellip;\":[8942],\"verbar;\":[124],\"vsubnE;\":[10955,65024],\"vsubne;\":[8842,65024],\"vsupnE;\":[10956,65024],\"vsupne;\":[8843,65024],\"wedbar;\":[10847],\"wedgeq;\":[8793],\"weierp;\":[8472],\"wreath;\":[8768],\"xoplus;\":[10753],\"xotime;\":[10754],\"xsqcup;\":[10758],\"xuplus;\":[10756],\"xwedge;\":[8896],\"yacute;\":[253],\"zacute;\":[378],\"zcaron;\":[382],\"zeetrf;\":[8488]}},{\"length\":6,\"entities\":{\"AElig;\":[198],\"Aacute\":[193],\"Acirc;\":[194],\"Agrave\":[192],\"Alpha;\":[913],\"Amacr;\":[256],\"Aogon;\":[260],\"Aring;\":[197],\"Atilde\":[195],\"Breve;\":[728],\"Ccedil\":[199],\"Ccirc;\":[264],\"Colon;\":[8759],\"Cross;\":[10799],\"Dashv;\":[10980],\"Delta;\":[916],\"Eacute\":[201],\"Ecirc;\":[202],\"Egrave\":[200],\"Emacr;\":[274],\"Eogon;\":[280],\"Equal;\":[10869],\"Gamma;\":[915],\"Gcirc;\":[284],\"Hacek;\":[711],\"Hcirc;\":[292],\"IJlig;\":[306],\"Iacute\":[205],\"Icirc;\":[206],\"Igrave\":[204],\"Imacr;\":[298],\"Iogon;\":[302],\"Iukcy;\":[1030],\"Jcirc;\":[308],\"Jukcy;\":[1028],\"Kappa;\":[922],\"Ntilde\":[209],\"OElig;\":[338],\"Oacute\":[211],\"Ocirc;\":[212],\"Ograve\":[210],\"Omacr;\":[332],\"Omega;\":[937],\"Oslash\":[216],\"Otilde\":[213],\"Prime;\":[8243],\"RBarr;\":[10512],\"Scirc;\":[348],\"Sigma;\":[931],\"THORN;\":[222],\"TRADE;\":[8482],\"TSHcy;\":[1035],\"Theta;\":[920],\"Tilde;\":[8764],\"Uacute\":[218],\"Ubrcy;\":[1038],\"Ucirc;\":[219],\"Ugrave\":[217],\"Umacr;\":[362],\"Union;\":[8899],\"Uogon;\":[370],\"UpTee;\":[8869],\"Uring;\":[366],\"VDash;\":[8875],\"Vdash;\":[8873],\"Wcirc;\":[372],\"Wedge;\":[8896],\"Yacute\":[221],\"Ycirc;\":[374],\"aacute\":[225],\"acirc;\":[226],\"acute;\":[180],\"aelig;\":[230],\"agrave\":[224],\"aleph;\":[8501],\"alpha;\":[945],\"amacr;\":[257],\"amalg;\":[10815],\"angle;\":[8736],\"angrt;\":[8735],\"angst;\":[197],\"aogon;\":[261],\"aring;\":[229],\"asymp;\":[8776],\"atilde\":[227],\"awint;\":[10769],\"bcong;\":[8780],\"bdquo;\":[8222],\"bepsi;\":[1014],\"blank;\":[9251],\"blk12;\":[9618],\"blk14;\":[9617],\"blk34;\":[9619],\"block;\":[9608],\"boxDL;\":[9559],\"boxDR;\":[9556],\"boxDl;\":[9558],\"boxDr;\":[9555],\"boxHD;\":[9574],\"boxHU;\":[9577],\"boxHd;\":[9572],\"boxHu;\":[9575],\"boxUL;\":[9565],\"boxUR;\":[9562],\"boxUl;\":[9564],\"boxUr;\":[9561],\"boxVH;\":[9580],\"boxVL;\":[9571],\"boxVR;\":[9568],\"boxVh;\":[9579],\"boxVl;\":[9570],\"boxVr;\":[9567],\"boxdL;\":[9557],\"boxdR;\":[9554],\"boxdl;\":[9488],\"boxdr;\":[9484],\"boxhD;\":[9573],\"boxhU;\":[9576],\"boxhd;\":[9516],\"boxhu;\":[9524],\"boxuL;\":[9563],\"boxuR;\":[9560],\"boxul;\":[9496],\"boxur;\":[9492],\"boxvH;\":[9578],\"boxvL;\":[9569],\"boxvR;\":[9566],\"boxvh;\":[9532],\"boxvl;\":[9508],\"boxvr;\":[9500],\"breve;\":[728],\"brvbar\":[166],\"bsemi;\":[8271],\"bsime;\":[8909],\"bsolb;\":[10693],\"bumpE;\":[10926],\"bumpe;\":[8783],\"caret;\":[8257],\"caron;\":[711],\"ccaps;\":[10829],\"ccedil\":[231],\"ccirc;\":[265],\"ccups;\":[10828],\"cedil;\":[184],\"check;\":[10003],\"clubs;\":[9827],\"colon;\":[58],\"comma;\":[44],\"crarr;\":[8629],\"cross;\":[10007],\"csube;\":[10961],\"csupe;\":[10962],\"ctdot;\":[8943],\"cuepr;\":[8926],\"cuesc;\":[8927],\"cupor;\":[10821],\"curren\":[164],\"cuvee;\":[8910],\"cuwed;\":[8911],\"cwint;\":[8753],\"dashv;\":[8867],\"dblac;\":[733],\"ddarr;\":[8650],\"delta;\":[948],\"dharl;\":[8643],\"dharr;\":[8642],\"diams;\":[9830],\"disin;\":[8946],\"divide\":[247],\"doteq;\":[8784],\"dtdot;\":[8945],\"dtrif;\":[9662],\"duarr;\":[8693],\"duhar;\":[10607],\"eDDot;\":[10871],\"eacute\":[233],\"ecirc;\":[234],\"efDot;\":[8786],\"egrave\":[232],\"emacr;\":[275],\"empty;\":[8709],\"eogon;\":[281],\"eplus;\":[10865],\"epsiv;\":[1013],\"eqsim;\":[8770],\"equiv;\":[8801],\"erDot;\":[8787],\"erarr;\":[10609],\"esdot;\":[8784],\"exist;\":[8707],\"fflig;\":[64256],\"filig;\":[64257],\"fjlig;\":[102,106],\"fllig;\":[64258],\"fltns;\":[9649],\"forkv;\":[10969],\"frac12\":[189],\"frac14\":[188],\"frac34\":[190],\"frasl;\":[8260],\"frown;\":[8994],\"gamma;\":[947],\"gcirc;\":[285],\"gescc;\":[10921],\"gimel;\":[8503],\"gneqq;\":[8809],\"gnsim;\":[8935],\"grave;\":[96],\"gsime;\":[10894],\"gsiml;\":[10896],\"gtcir;\":[10874],\"gtdot;\":[8919],\"harrw;\":[8621],\"hcirc;\":[293],\"hoarr;\":[8703],\"iacute\":[237],\"icirc;\":[238],\"iexcl;\":[161],\"igrave\":[236],\"iiint;\":[8749],\"iiota;\":[8489],\"ijlig;\":[307],\"imacr;\":[299],\"image;\":[8465],\"imath;\":[305],\"imped;\":[437],\"infin;\":[8734],\"iogon;\":[303],\"iprod;\":[10812],\"iquest\":[191],\"isinE;\":[8953],\"isins;\":[8948],\"isinv;\":[8712],\"iukcy;\":[1110],\"jcirc;\":[309],\"jmath;\":[567],\"jukcy;\":[1108],\"kappa;\":[954],\"lAarr;\":[8666],\"lBarr;\":[10510],\"langd;\":[10641],\"laquo;\":[171],\"larrb;\":[8676],\"lates;\":[10925,65024],\"lbarr;\":[10508],\"lbbrk;\":[10098],\"lbrke;\":[10635],\"lceil;\":[8968],\"ldquo;\":[8220],\"lescc;\":[10920],\"lhard;\":[8637],\"lharu;\":[8636],\"lhblk;\":[9604],\"llarr;\":[8647],\"lltri;\":[9722],\"lneqq;\":[8808],\"lnsim;\":[8934],\"loang;\":[10220],\"loarr;\":[8701],\"lobrk;\":[10214],\"lopar;\":[10629],\"lrarr;\":[8646],\"lrhar;\":[8651],\"lrtri;\":[8895],\"lsime;\":[10893],\"lsimg;\":[10895],\"lsquo;\":[8216],\"ltcir;\":[10873],\"ltdot;\":[8918],\"ltrie;\":[8884],\"ltrif;\":[9666],\"mDDot;\":[8762],\"mdash;\":[8212],\"micro;\":[181],\"middot\":[183],\"minus;\":[8722],\"mumap;\":[8888],\"nabla;\":[8711],\"napid;\":[8779,824],\"napos;\":[329],\"natur;\":[9838],\"nbump;\":[8782,824],\"ncong;\":[8775],\"ndash;\":[8211],\"neArr;\":[8663],\"nearr;\":[8599],\"nedot;\":[8784,824],\"nesim;\":[8770,824],\"ngeqq;\":[8807,824],\"ngsim;\":[8821],\"nhArr;\":[8654],\"nharr;\":[8622],\"nhpar;\":[10994],\"nlArr;\":[8653],\"nlarr;\":[8602],\"nleqq;\":[8806,824],\"nless;\":[8814],\"nlsim;\":[8820],\"nltri;\":[8938],\"notin;\":[8713],\"notni;\":[8716],\"npart;\":[8706,824],\"nprec;\":[8832],\"nrArr;\":[8655],\"nrarr;\":[8603],\"nrtri;\":[8939],\"nsime;\":[8772],\"nsmid;\":[8740],\"nspar;\":[8742],\"nsubE;\":[10949,824],\"nsube;\":[8840],\"nsucc;\":[8833],\"nsupE;\":[10950,824],\"nsupe;\":[8841],\"ntilde\":[241],\"numsp;\":[8199],\"nvsim;\":[8764,8402],\"nwArr;\":[8662],\"nwarr;\":[8598],\"oacute\":[243],\"ocirc;\":[244],\"odash;\":[8861],\"oelig;\":[339],\"ofcir;\":[10687],\"ograve\":[242],\"ohbar;\":[10677],\"olarr;\":[8634],\"olcir;\":[10686],\"oline;\":[8254],\"omacr;\":[333],\"omega;\":[969],\"operp;\":[10681],\"oplus;\":[8853],\"orarr;\":[8635],\"order;\":[8500],\"oslash\":[248],\"otilde\":[245],\"ovbar;\":[9021],\"parsl;\":[11005],\"phone;\":[9742],\"plusb;\":[8862],\"pluse;\":[10866],\"plusmn\":[177],\"pound;\":[163],\"prcue;\":[8828],\"prime;\":[8242],\"prnap;\":[10937],\"prsim;\":[8830],\"quest;\":[63],\"rAarr;\":[8667],\"rBarr;\":[10511],\"radic;\":[8730],\"rangd;\":[10642],\"range;\":[10661],\"raquo;\":[187],\"rarrb;\":[8677],\"rarrc;\":[10547],\"rarrw;\":[8605],\"ratio;\":[8758],\"rbarr;\":[10509],\"rbbrk;\":[10099],\"rbrke;\":[10636],\"rceil;\":[8969],\"rdquo;\":[8221],\"reals;\":[8477],\"rhard;\":[8641],\"rharu;\":[8640],\"rlarr;\":[8644],\"rlhar;\":[8652],\"rnmid;\":[10990],\"roang;\":[10221],\"roarr;\":[8702],\"robrk;\":[10215],\"ropar;\":[10630],\"rrarr;\":[8649],\"rsquo;\":[8217],\"rtrie;\":[8885],\"rtrif;\":[9656],\"sbquo;\":[8218],\"sccue;\":[8829],\"scirc;\":[349],\"scnap;\":[10938],\"scsim;\":[8831],\"sdotb;\":[8865],\"sdote;\":[10854],\"seArr;\":[8664],\"searr;\":[8600],\"setmn;\":[8726],\"sharp;\":[9839],\"sigma;\":[963],\"simeq;\":[8771],\"simgE;\":[10912],\"simlE;\":[10911],\"simne;\":[8774],\"slarr;\":[8592],\"smile;\":[8995],\"smtes;\":[10924,65024],\"sqcap;\":[8851],\"sqcup;\":[8852],\"sqsub;\":[8847],\"sqsup;\":[8848],\"srarr;\":[8594],\"starf;\":[9733],\"strns;\":[175],\"subnE;\":[10955],\"subne;\":[8842],\"supnE;\":[10956],\"supne;\":[8843],\"swArr;\":[8665],\"swarr;\":[8601],\"szlig;\":[223],\"theta;\":[952],\"thkap;\":[8776],\"thorn;\":[254],\"tilde;\":[732],\"times;\":[215],\"trade;\":[8482],\"trisb;\":[10701],\"tshcy;\":[1115],\"twixt;\":[8812],\"uacute\":[250],\"ubrcy;\":[1118],\"ucirc;\":[251],\"udarr;\":[8645],\"udhar;\":[10606],\"ugrave\":[249],\"uharl;\":[8639],\"uharr;\":[8638],\"uhblk;\":[9600],\"ultri;\":[9720],\"umacr;\":[363],\"uogon;\":[371],\"uplus;\":[8846],\"upsih;\":[978],\"uring;\":[367],\"urtri;\":[9721],\"utdot;\":[8944],\"utrif;\":[9652],\"uuarr;\":[8648],\"vBarv;\":[10985],\"vDash;\":[8872],\"varpi;\":[982],\"vdash;\":[8866],\"veeeq;\":[8794],\"vltri;\":[8882],\"vnsub;\":[8834,8402],\"vnsup;\":[8835,8402],\"vprop;\":[8733],\"vrtri;\":[8883],\"wcirc;\":[373],\"wedge;\":[8743],\"xcirc;\":[9711],\"xdtri;\":[9661],\"xhArr;\":[10234],\"xharr;\":[10231],\"xlArr;\":[10232],\"xlarr;\":[10229],\"xodot;\":[10752],\"xrArr;\":[10233],\"xrarr;\":[10230],\"xutri;\":[9651],\"yacute\":[253],\"ycirc;\":[375]}},{\"length\":5,\"entities\":{\"AElig\":[198],\"Acirc\":[194],\"Aopf;\":[120120],\"Aring\":[197],\"Ascr;\":[119964],\"Auml;\":[196],\"Barv;\":[10983],\"Beta;\":[914],\"Bopf;\":[120121],\"Bscr;\":[8492],\"CHcy;\":[1063],\"COPY;\":[169],\"Cdot;\":[266],\"Copf;\":[8450],\"Cscr;\":[119966],\"DJcy;\":[1026],\"DScy;\":[1029],\"DZcy;\":[1039],\"Darr;\":[8609],\"Dopf;\":[120123],\"Dscr;\":[119967],\"Ecirc\":[202],\"Edot;\":[278],\"Eopf;\":[120124],\"Escr;\":[8496],\"Esim;\":[10867],\"Euml;\":[203],\"Fopf;\":[120125],\"Fscr;\":[8497],\"GJcy;\":[1027],\"Gdot;\":[288],\"Gopf;\":[120126],\"Gscr;\":[119970],\"Hopf;\":[8461],\"Hscr;\":[8459],\"IEcy;\":[1045],\"IOcy;\":[1025],\"Icirc\":[206],\"Idot;\":[304],\"Iopf;\":[120128],\"Iota;\":[921],\"Iscr;\":[8464],\"Iuml;\":[207],\"Jopf;\":[120129],\"Jscr;\":[119973],\"KHcy;\":[1061],\"KJcy;\":[1036],\"Kopf;\":[120130],\"Kscr;\":[119974],\"LJcy;\":[1033],\"Lang;\":[10218],\"Larr;\":[8606],\"Lopf;\":[120131],\"Lscr;\":[8466],\"Mopf;\":[120132],\"Mscr;\":[8499],\"NJcy;\":[1034],\"Nopf;\":[8469],\"Nscr;\":[119977],\"Ocirc\":[212],\"Oopf;\":[120134],\"Oscr;\":[119978],\"Ouml;\":[214],\"Popf;\":[8473],\"Pscr;\":[119979],\"QUOT;\":[34],\"Qopf;\":[8474],\"Qscr;\":[119980],\"Rang;\":[10219],\"Rarr;\":[8608],\"Ropf;\":[8477],\"Rscr;\":[8475],\"SHcy;\":[1064],\"Sopf;\":[120138],\"Sqrt;\":[8730],\"Sscr;\":[119982],\"Star;\":[8902],\"THORN\":[222],\"TScy;\":[1062],\"Topf;\":[120139],\"Tscr;\":[119983],\"Uarr;\":[8607],\"Ucirc\":[219],\"Uopf;\":[120140],\"Upsi;\":[978],\"Uscr;\":[119984],\"Uuml;\":[220],\"Vbar;\":[10987],\"Vert;\":[8214],\"Vopf;\":[120141],\"Vscr;\":[119985],\"Wopf;\":[120142],\"Wscr;\":[119986],\"Xopf;\":[120143],\"Xscr;\":[119987],\"YAcy;\":[1071],\"YIcy;\":[1031],\"YUcy;\":[1070],\"Yopf;\":[120144],\"Yscr;\":[119988],\"Yuml;\":[376],\"ZHcy;\":[1046],\"Zdot;\":[379],\"Zeta;\":[918],\"Zopf;\":[8484],\"Zscr;\":[119989],\"acirc\":[226],\"acute\":[180],\"aelig\":[230],\"andd;\":[10844],\"andv;\":[10842],\"ange;\":[10660],\"aopf;\":[120146],\"apid;\":[8779],\"apos;\":[39],\"aring\":[229],\"ascr;\":[119990],\"auml;\":[228],\"bNot;\":[10989],\"bbrk;\":[9141],\"beta;\":[946],\"beth;\":[8502],\"bnot;\":[8976],\"bopf;\":[120147],\"boxH;\":[9552],\"boxV;\":[9553],\"boxh;\":[9472],\"boxv;\":[9474],\"bscr;\":[119991],\"bsim;\":[8765],\"bsol;\":[92],\"bull;\":[8226],\"bump;\":[8782],\"caps;\":[8745,65024],\"cdot;\":[267],\"cedil\":[184],\"cent;\":[162],\"chcy;\":[1095],\"cirE;\":[10691],\"circ;\":[710],\"cire;\":[8791],\"comp;\":[8705],\"cong;\":[8773],\"copf;\":[120148],\"copy;\":[169],\"cscr;\":[119992],\"csub;\":[10959],\"csup;\":[10960],\"cups;\":[8746,65024],\"dArr;\":[8659],\"dHar;\":[10597],\"darr;\":[8595],\"dash;\":[8208],\"diam;\":[8900],\"djcy;\":[1106],\"dopf;\":[120149],\"dscr;\":[119993],\"dscy;\":[1109],\"dsol;\":[10742],\"dtri;\":[9663],\"dzcy;\":[1119],\"eDot;\":[8785],\"ecir;\":[8790],\"ecirc\":[234],\"edot;\":[279],\"emsp;\":[8195],\"ensp;\":[8194],\"eopf;\":[120150],\"epar;\":[8917],\"epsi;\":[949],\"escr;\":[8495],\"esim;\":[8770],\"euml;\":[235],\"euro;\":[8364],\"excl;\":[33],\"flat;\":[9837],\"fnof;\":[402],\"fopf;\":[120151],\"fork;\":[8916],\"fscr;\":[119995],\"gdot;\":[289],\"geqq;\":[8807],\"gesl;\":[8923,65024],\"gjcy;\":[1107],\"gnap;\":[10890],\"gneq;\":[10888],\"gopf;\":[120152],\"gscr;\":[8458],\"gsim;\":[8819],\"gtcc;\":[10919],\"gvnE;\":[8809,65024],\"hArr;\":[8660],\"half;\":[189],\"harr;\":[8596],\"hbar;\":[8463],\"hopf;\":[120153],\"hscr;\":[119997],\"icirc\":[238],\"iecy;\":[1077],\"iexcl\":[161],\"imof;\":[8887],\"iocy;\":[1105],\"iopf;\":[120154],\"iota;\":[953],\"iscr;\":[119998],\"isin;\":[8712],\"iuml;\":[239],\"jopf;\":[120155],\"jscr;\":[119999],\"khcy;\":[1093],\"kjcy;\":[1116],\"kopf;\":[120156],\"kscr;\":[120000],\"lArr;\":[8656],\"lHar;\":[10594],\"lang;\":[10216],\"laquo\":[171],\"larr;\":[8592],\"late;\":[10925],\"lcub;\":[123],\"ldca;\":[10550],\"ldsh;\":[8626],\"leqq;\":[8806],\"lesg;\":[8922,65024],\"ljcy;\":[1113],\"lnap;\":[10889],\"lneq;\":[10887],\"lopf;\":[120157],\"lozf;\":[10731],\"lpar;\":[40],\"lscr;\":[120001],\"lsim;\":[8818],\"lsqb;\":[91],\"ltcc;\":[10918],\"ltri;\":[9667],\"lvnE;\":[8808,65024],\"macr;\":[175],\"male;\":[9794],\"malt;\":[10016],\"micro\":[181],\"mlcp;\":[10971],\"mldr;\":[8230],\"mopf;\":[120158],\"mscr;\":[120002],\"nGtv;\":[8811,824],\"nLtv;\":[8810,824],\"nang;\":[8736,8402],\"napE;\":[10864,824],\"nbsp;\":[160],\"ncap;\":[10819],\"ncup;\":[10818],\"ngeq;\":[8817],\"nges;\":[10878,824],\"ngtr;\":[8815],\"nisd;\":[8954],\"njcy;\":[1114],\"nldr;\":[8229],\"nleq;\":[8816],\"nles;\":[10877,824],\"nmid;\":[8740],\"nopf;\":[120159],\"npar;\":[8742],\"npre;\":[10927,824],\"nsce;\":[10928,824],\"nscr;\":[120003],\"nsim;\":[8769],\"nsub;\":[8836],\"nsup;\":[8837],\"ntgl;\":[8825],\"ntlg;\":[8824],\"nvap;\":[8781,8402],\"nvge;\":[8805,8402],\"nvgt;\":[62,8402],\"nvle;\":[8804,8402],\"nvlt;\":[60,8402],\"oast;\":[8859],\"ocir;\":[8858],\"ocirc\":[244],\"odiv;\":[10808],\"odot;\":[8857],\"ogon;\":[731],\"oint;\":[8750],\"omid;\":[10678],\"oopf;\":[120160],\"opar;\":[10679],\"ordf;\":[170],\"ordm;\":[186],\"oror;\":[10838],\"oscr;\":[8500],\"osol;\":[8856],\"ouml;\":[246],\"para;\":[182],\"part;\":[8706],\"perp;\":[8869],\"phiv;\":[981],\"plus;\":[43],\"popf;\":[120161],\"pound\":[163],\"prap;\":[10935],\"prec;\":[8826],\"prnE;\":[10933],\"prod;\":[8719],\"prop;\":[8733],\"pscr;\":[120005],\"qint;\":[10764],\"qopf;\":[120162],\"qscr;\":[120006],\"quot;\":[34],\"rArr;\":[8658],\"rHar;\":[10596],\"race;\":[8765,817],\"rang;\":[10217],\"raquo\":[187],\"rarr;\":[8594],\"rcub;\":[125],\"rdca;\":[10551],\"rdsh;\":[8627],\"real;\":[8476],\"rect;\":[9645],\"rhov;\":[1009],\"ring;\":[730],\"ropf;\":[120163],\"rpar;\":[41],\"rscr;\":[120007],\"rsqb;\":[93],\"rtri;\":[9657],\"scap;\":[10936],\"scnE;\":[10934],\"sdot;\":[8901],\"sect;\":[167],\"semi;\":[59],\"sext;\":[10038],\"shcy;\":[1096],\"sime;\":[8771],\"simg;\":[10910],\"siml;\":[10909],\"smid;\":[8739],\"smte;\":[10924],\"solb;\":[10692],\"sopf;\":[120164],\"spar;\":[8741],\"squf;\":[9642],\"sscr;\":[120008],\"star;\":[9734],\"subE;\":[10949],\"sube;\":[8838],\"succ;\":[8827],\"sung;\":[9834],\"sup1;\":[185],\"sup2;\":[178],\"sup3;\":[179],\"supE;\":[10950],\"supe;\":[8839],\"szlig\":[223],\"tbrk;\":[9140],\"tdot;\":[8411],\"thorn\":[254],\"times\":[215],\"tint;\":[8749],\"toea;\":[10536],\"topf;\":[120165],\"tosa;\":[10537],\"trie;\":[8796],\"tscr;\":[120009],\"tscy;\":[1094],\"uArr;\":[8657],\"uHar;\":[10595],\"uarr;\":[8593],\"ucirc\":[251],\"uopf;\":[120166],\"upsi;\":[965],\"uscr;\":[120010],\"utri;\":[9653],\"uuml;\":[252],\"vArr;\":[8661],\"vBar;\":[10984],\"varr;\":[8597],\"vert;\":[124],\"vopf;\":[120167],\"vscr;\":[120011],\"wopf;\":[120168],\"wscr;\":[120012],\"xcap;\":[8898],\"xcup;\":[8899],\"xmap;\":[10236],\"xnis;\":[8955],\"xopf;\":[120169],\"xscr;\":[120013],\"xvee;\":[8897],\"yacy;\":[1103],\"yicy;\":[1111],\"yopf;\":[120170],\"yscr;\":[120014],\"yucy;\":[1102],\"yuml;\":[255],\"zdot;\":[380],\"zeta;\":[950],\"zhcy;\":[1078],\"zopf;\":[120171],\"zscr;\":[120015],\"zwnj;\":[8204]}},{\"length\":4,\"entities\":{\"AMP;\":[38],\"Acy;\":[1040],\"Afr;\":[120068],\"And;\":[10835],\"Auml\":[196],\"Bcy;\":[1041],\"Bfr;\":[120069],\"COPY\":[169],\"Cap;\":[8914],\"Cfr;\":[8493],\"Chi;\":[935],\"Cup;\":[8915],\"Dcy;\":[1044],\"Del;\":[8711],\"Dfr;\":[120071],\"Dot;\":[168],\"ENG;\":[330],\"ETH;\":[208],\"Ecy;\":[1069],\"Efr;\":[120072],\"Eta;\":[919],\"Euml\":[203],\"Fcy;\":[1060],\"Ffr;\":[120073],\"Gcy;\":[1043],\"Gfr;\":[120074],\"Hat;\":[94],\"Hfr;\":[8460],\"Icy;\":[1048],\"Ifr;\":[8465],\"Int;\":[8748],\"Iuml\":[207],\"Jcy;\":[1049],\"Jfr;\":[120077],\"Kcy;\":[1050],\"Kfr;\":[120078],\"Lcy;\":[1051],\"Lfr;\":[120079],\"Lsh;\":[8624],\"Map;\":[10501],\"Mcy;\":[1052],\"Mfr;\":[120080],\"Ncy;\":[1053],\"Nfr;\":[120081],\"Not;\":[10988],\"Ocy;\":[1054],\"Ofr;\":[120082],\"Ouml\":[214],\"Pcy;\":[1055],\"Pfr;\":[120083],\"Phi;\":[934],\"Psi;\":[936],\"QUOT\":[34],\"Qfr;\":[120084],\"REG;\":[174],\"Rcy;\":[1056],\"Rfr;\":[8476],\"Rho;\":[929],\"Rsh;\":[8625],\"Scy;\":[1057],\"Sfr;\":[120086],\"Sub;\":[8912],\"Sum;\":[8721],\"Sup;\":[8913],\"Tab;\":[9],\"Tau;\":[932],\"Tcy;\":[1058],\"Tfr;\":[120087],\"Ucy;\":[1059],\"Ufr;\":[120088],\"Uuml\":[220],\"Vcy;\":[1042],\"Vee;\":[8897],\"Vfr;\":[120089],\"Wfr;\":[120090],\"Xfr;\":[120091],\"Ycy;\":[1067],\"Yfr;\":[120092],\"Zcy;\":[1047],\"Zfr;\":[8488],\"acE;\":[8766,819],\"acd;\":[8767],\"acy;\":[1072],\"afr;\":[120094],\"amp;\":[38],\"and;\":[8743],\"ang;\":[8736],\"apE;\":[10864],\"ape;\":[8778],\"ast;\":[42],\"auml\":[228],\"bcy;\":[1073],\"bfr;\":[120095],\"bne;\":[61,8421],\"bot;\":[8869],\"cap;\":[8745],\"cent\":[162],\"cfr;\":[120096],\"chi;\":[967],\"cir;\":[9675],\"copy\":[169],\"cup;\":[8746],\"dcy;\":[1076],\"deg;\":[176],\"dfr;\":[120097],\"die;\":[168],\"div;\":[247],\"dot;\":[729],\"ecy;\":[1101],\"efr;\":[120098],\"egs;\":[10902],\"ell;\":[8467],\"els;\":[10901],\"eng;\":[331],\"eta;\":[951],\"eth;\":[240],\"euml\":[235],\"fcy;\":[1092],\"ffr;\":[120099],\"gEl;\":[10892],\"gap;\":[10886],\"gcy;\":[1075],\"gel;\":[8923],\"geq;\":[8805],\"ges;\":[10878],\"gfr;\":[120100],\"ggg;\":[8921],\"glE;\":[10898],\"gla;\":[10917],\"glj;\":[10916],\"gnE;\":[8809],\"gne;\":[10888],\"hfr;\":[120101],\"icy;\":[1080],\"iff;\":[8660],\"ifr;\":[120102],\"int;\":[8747],\"iuml\":[239],\"jcy;\":[1081],\"jfr;\":[120103],\"kcy;\":[1082],\"kfr;\":[120104],\"lEg;\":[10891],\"lap;\":[10885],\"lat;\":[10923],\"lcy;\":[1083],\"leg;\":[8922],\"leq;\":[8804],\"les;\":[10877],\"lfr;\":[120105],\"lgE;\":[10897],\"lnE;\":[8808],\"lne;\":[10887],\"loz;\":[9674],\"lrm;\":[8206],\"lsh;\":[8624],\"macr\":[175],\"map;\":[8614],\"mcy;\":[1084],\"mfr;\":[120106],\"mho;\":[8487],\"mid;\":[8739],\"nGg;\":[8921,824],\"nGt;\":[8811,8402],\"nLl;\":[8920,824],\"nLt;\":[8810,8402],\"nap;\":[8777],\"nbsp\":[160],\"ncy;\":[1085],\"nfr;\":[120107],\"ngE;\":[8807,824],\"nge;\":[8817],\"ngt;\":[8815],\"nis;\":[8956],\"niv;\":[8715],\"nlE;\":[8806,824],\"nle;\":[8816],\"nlt;\":[8814],\"not;\":[172],\"npr;\":[8832],\"nsc;\":[8833],\"num;\":[35],\"ocy;\":[1086],\"ofr;\":[120108],\"ogt;\":[10689],\"ohm;\":[937],\"olt;\":[10688],\"ord;\":[10845],\"ordf\":[170],\"ordm\":[186],\"orv;\":[10843],\"ouml\":[246],\"par;\":[8741],\"para\":[182],\"pcy;\":[1087],\"pfr;\":[120109],\"phi;\":[966],\"piv;\":[982],\"prE;\":[10931],\"pre;\":[10927],\"psi;\":[968],\"qfr;\":[120110],\"quot\":[34],\"rcy;\":[1088],\"reg;\":[174],\"rfr;\":[120111],\"rho;\":[961],\"rlm;\":[8207],\"rsh;\":[8625],\"scE;\":[10932],\"sce;\":[10928],\"scy;\":[1089],\"sect\":[167],\"sfr;\":[120112],\"shy;\":[173],\"sim;\":[8764],\"smt;\":[10922],\"sol;\":[47],\"squ;\":[9633],\"sub;\":[8834],\"sum;\":[8721],\"sup1\":[185],\"sup2\":[178],\"sup3\":[179],\"sup;\":[8835],\"tau;\":[964],\"tcy;\":[1090],\"tfr;\":[120113],\"top;\":[8868],\"ucy;\":[1091],\"ufr;\":[120114],\"uml;\":[168],\"uuml\":[252],\"vcy;\":[1074],\"vee;\":[8744],\"vfr;\":[120115],\"wfr;\":[120116],\"xfr;\":[120117],\"ycy;\":[1099],\"yen;\":[165],\"yfr;\":[120118],\"yuml\":[255],\"zcy;\":[1079],\"zfr;\":[120119],\"zwj;\":[8205]}},{\"length\":3,\"entities\":{\"AMP\":[38],\"DD;\":[8517],\"ETH\":[208],\"GT;\":[62],\"Gg;\":[8921],\"Gt;\":[8811],\"Im;\":[8465],\"LT;\":[60],\"Ll;\":[8920],\"Lt;\":[8810],\"Mu;\":[924],\"Nu;\":[925],\"Or;\":[10836],\"Pi;\":[928],\"Pr;\":[10939],\"REG\":[174],\"Re;\":[8476],\"Sc;\":[10940],\"Xi;\":[926],\"ac;\":[8766],\"af;\":[8289],\"amp\":[38],\"ap;\":[8776],\"dd;\":[8518],\"deg\":[176],\"ee;\":[8519],\"eg;\":[10906],\"el;\":[10905],\"eth\":[240],\"gE;\":[8807],\"ge;\":[8805],\"gg;\":[8811],\"gl;\":[8823],\"gt;\":[62],\"ic;\":[8291],\"ii;\":[8520],\"in;\":[8712],\"it;\":[8290],\"lE;\":[8806],\"le;\":[8804],\"lg;\":[8822],\"ll;\":[8810],\"lt;\":[60],\"mp;\":[8723],\"mu;\":[956],\"ne;\":[8800],\"ni;\":[8715],\"not\":[172],\"nu;\":[957],\"oS;\":[9416],\"or;\":[8744],\"pi;\":[960],\"pm;\":[177],\"pr;\":[8826],\"reg\":[174],\"rx;\":[8478],\"sc;\":[8827],\"shy\":[173],\"uml\":[168],\"wp;\":[8472],\"wr;\":[8768],\"xi;\":[958],\"yen\":[165]}},{\"length\":2,\"entities\":{\"GT\":[62],\"LT\":[60],\"gt\":[62],\"lt\":[60]}}]\n","/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * @copyright 2017 Toru Nagashima. All rights reserved.\n * See LIC   ENSE file in root directory for full license.\n */\n\nexport const EOF = -1\nexport const NULL = 0x00\nexport const TABULATION = 0x09\nexport const CARRIAGE_RETURN = 0x0d\nexport const LINE_FEED = 0x0a\nexport const FORM_FEED = 0x0c\nexport const SPACE = 0x20\nexport const EXCLAMATION_MARK = 0x21 // !\nexport const QUOTATION_MARK = 0x22 // \"\nexport const NUMBER_SIGN = 0x23 // #\nexport const AMPERSAND = 0x26 // &\nexport const APOSTROPHE = 0x27 // '\nexport const LEFT_PARENTHESIS = 0x28 // (\nexport const RIGHT_PARENTHESIS = 0x29 // )\nexport const ASTERISK = 0x2a // *\nexport const HYPHEN_MINUS = 0x2d // -\nexport const SOLIDUS = 0x2f // /\nexport const DIGIT_0 = 0x30\nexport const DIGIT_9 = 0x39\nexport const COLON = 0x3a // :\nexport const SEMICOLON = 0x3b // ;\nexport const LESS_THAN_SIGN = 0x3c // <\nexport const EQUALS_SIGN = 0x3d // =\nexport const GREATER_THAN_SIGN = 0x3e // >\nexport const QUESTION_MARK = 0x3f // ?\nexport const LATIN_CAPITAL_A = 0x41\nexport const LATIN_CAPITAL_D = 0x44\nexport const LATIN_CAPITAL_F = 0x46\nexport const LATIN_CAPITAL_X = 0x58\nexport const LATIN_CAPITAL_Z = 0x5a\nexport const LEFT_SQUARE_BRACKET = 0x5b // [\nexport const REVERSE_SOLIDUS = 0x5c // \\\nexport const RIGHT_SQUARE_BRACKET = 0x5d // ]\nexport const GRAVE_ACCENT = 0x60 // `\nexport const LATIN_SMALL_A = 0x61\nexport const LATIN_SMALL_F = 0x66\nexport const LATIN_SMALL_X = 0x78\nexport const LATIN_SMALL_Z = 0x7a\nexport const LEFT_CURLY_BRACKET = 0x7b // {\nexport const RIGHT_CURLY_BRACKET = 0x7d // }\nexport const NULL_REPLACEMENT = 0xfffd\n\n/**\n * Check whether the code point is a whitespace.\n * @param cp The code point to check.\n * @returns `true` if the code point is a whitespace.\n */\nexport function isWhitespace(cp: number): boolean {\n    return (\n        cp === TABULATION ||\n        cp === LINE_FEED ||\n        cp === FORM_FEED ||\n        cp === CARRIAGE_RETURN ||\n        cp === SPACE\n    )\n}\n\n/**\n * Check whether the code point is an uppercase letter character.\n * @param cp The code point to check.\n * @returns `true` if the code point is an uppercase letter character.\n */\nexport function isUpperLetter(cp: number): boolean {\n    return cp >= LATIN_CAPITAL_A && cp <= LATIN_CAPITAL_Z\n}\n\n/**\n * Check whether the code point is a lowercase letter character.\n * @param cp The code point to check.\n * @returns `true` if the code point is a lowercase letter character.\n */\nexport function isLowerLetter(cp: number): boolean {\n    return cp >= LATIN_SMALL_A && cp <= LATIN_SMALL_Z\n}\n\n/**\n * Check whether the code point is a letter character.\n * @param cp The code point to check.\n * @returns `true` if the code point is a letter character.\n */\nexport function isLetter(cp: number): boolean {\n    return isLowerLetter(cp) || isUpperLetter(cp)\n}\n\n/**\n * Check whether the code point is a digit character.\n * @param cp The code point to check.\n * @returns `true` if the code point is a digit character.\n */\nexport function isDigit(cp: number): boolean {\n    return cp >= DIGIT_0 && cp <= DIGIT_9\n}\n\n/**\n * Check whether the code point is a digit character.\n * @param cp The code point to check.\n * @returns `true` if the code point is a digit character.\n */\nexport function isUpperHexDigit(cp: number): boolean {\n    return cp >= LATIN_CAPITAL_A && cp <= LATIN_CAPITAL_F\n}\n\n/**\n * Check whether the code point is a digit character.\n * @param cp The code point to check.\n * @returns `true` if the code point is a digit character.\n */\nexport function isLowerHexDigit(cp: number): boolean {\n    return cp >= LATIN_SMALL_A && cp <= LATIN_SMALL_F\n}\n\n/**\n * Check whether the code point is a digit character.\n * @param cp The code point to check.\n * @returns `true` if the code point is a digit character.\n */\nexport function isHexDigit(cp: number): boolean {\n    return isDigit(cp) || isUpperHexDigit(cp) || isLowerHexDigit(cp)\n}\n\n/**\n * Check whether the code point is a control character.\n * @param cp The code point to check.\n * @returns `true` if the code point is a control character.\n */\nexport function isControl(cp: number): boolean {\n    return (cp >= 0 && cp <= 0x1f) || (cp >= 0x7f && cp <= 0x9f)\n}\n\n/**\n * Check whether the code point is a surrogate character.\n * @param cp The code point to check.\n * @returns `true` if the code point is a surrogate character.\n */\nexport function isSurrogate(cp: number): boolean {\n    return cp >= 0xd800 && cp <= 0xdfff\n}\n\n/**\n * Check whether the code point is a surrogate pair character.\n * @param cp The code point to check.\n * @returns `true` if the code point is a surrogate pair character.\n */\nexport function isSurrogatePair(cp: number): boolean {\n    return cp >= 0xdc00 && cp <= 0xdfff\n}\n\n/**\n * Check whether the code point is a surrogate character.\n * @param cp The code point to check.\n * @returns `true` if the code point is a surrogate character.\n */\nexport function isNonCharacter(cp: number): boolean {\n    return (\n        (cp >= 0xfdd0 && cp <= 0xfdef) ||\n        ((cp & 0xfffe) === 0xfffe && cp <= 0x10ffff)\n    )\n}\n\n// export function isReservedCodePoint(cp: number): boolean {\n//     return (cp >= 0xD800 && cp <= 0xDFFF) || cp > 0x10FFFF\n// }\n\n/**\n * Convert the given character to lowercases.\n * @param cp The code point to convert.\n * @returns Converted code point.\n */\nexport function toLowerCodePoint(cp: number): number {\n    return cp + 0x0020\n}\n","/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * @copyright 2017 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\n\n/*eslint-disable no-param-reassign */\n\nimport assert from \"assert\"\nimport { debug } from \"../common/debug\"\nimport type { ErrorCode, Namespace, Token } from \"../ast/index\"\nimport { NS, ParseError } from \"../ast/index\"\nimport { alternativeCR } from \"./util/alternative-cr\"\nimport { entitySets } from \"./util/entities\"\nimport {\n    AMPERSAND,\n    APOSTROPHE,\n    CARRIAGE_RETURN,\n    EOF,\n    EQUALS_SIGN,\n    EXCLAMATION_MARK,\n    GRAVE_ACCENT,\n    GREATER_THAN_SIGN,\n    HYPHEN_MINUS,\n    isControl,\n    isDigit,\n    isHexDigit,\n    isLetter,\n    isLowerHexDigit,\n    isNonCharacter,\n    isSurrogate,\n    isSurrogatePair,\n    isUpperHexDigit,\n    isUpperLetter,\n    isWhitespace,\n    LATIN_CAPITAL_D,\n    LATIN_CAPITAL_X,\n    LATIN_SMALL_X,\n    LEFT_CURLY_BRACKET,\n    LEFT_SQUARE_BRACKET,\n    LESS_THAN_SIGN,\n    LINE_FEED,\n    NULL,\n    NULL_REPLACEMENT,\n    NUMBER_SIGN,\n    QUESTION_MARK,\n    QUOTATION_MARK,\n    RIGHT_CURLY_BRACKET,\n    RIGHT_SQUARE_BRACKET,\n    SEMICOLON,\n    SOLIDUS,\n    toLowerCodePoint,\n} from \"./util/unicode\"\nimport type { ParserOptions } from \"../common/parser-options\"\n\n/**\n * Enumeration of token types.\n */\nexport type TokenType =\n    | \"HTMLAssociation\"\n    | \"HTMLBogusComment\"\n    | \"HTMLCDataText\"\n    | \"HTMLComment\"\n    | \"HTMLEndTagOpen\"\n    | \"HTMLIdentifier\"\n    | \"HTMLLiteral\"\n    | \"HTMLRCDataText\"\n    | \"HTMLRawText\"\n    | \"HTMLSelfClosingTagClose\"\n    | \"HTMLTagClose\"\n    | \"HTMLTagOpen\"\n    | \"HTMLText\"\n    | \"HTMLWhitespace\"\n    | \"VExpressionStart\"\n    | \"VExpressionEnd\"\n\n/**\n * Enumeration of tokenizer's state types.\n */\nexport type TokenizerState =\n    | \"DATA\"\n    | \"TAG_OPEN\"\n    | \"END_TAG_OPEN\"\n    | \"TAG_NAME\"\n    | \"RCDATA\"\n    | \"RCDATA_LESS_THAN_SIGN\"\n    | \"RCDATA_END_TAG_OPEN\"\n    | \"RCDATA_END_TAG_NAME\"\n    | \"RAWTEXT\"\n    | \"RAWTEXT_LESS_THAN_SIGN\"\n    | \"RAWTEXT_END_TAG_OPEN\"\n    | \"RAWTEXT_END_TAG_NAME\"\n    | \"BEFORE_ATTRIBUTE_NAME\"\n    | \"ATTRIBUTE_NAME\"\n    | \"AFTER_ATTRIBUTE_NAME\"\n    | \"BEFORE_ATTRIBUTE_VALUE\"\n    | \"ATTRIBUTE_VALUE_DOUBLE_QUOTED\"\n    | \"ATTRIBUTE_VALUE_SINGLE_QUOTED\"\n    | \"ATTRIBUTE_VALUE_UNQUOTED\"\n    | \"AFTER_ATTRIBUTE_VALUE_QUOTED\"\n    | \"SELF_CLOSING_START_TAG\"\n    | \"BOGUS_COMMENT\"\n    | \"MARKUP_DECLARATION_OPEN\"\n    | \"COMMENT_START\"\n    | \"COMMENT_START_DASH\"\n    | \"COMMENT\"\n    | \"COMMENT_LESS_THAN_SIGN\"\n    | \"COMMENT_LESS_THAN_SIGN_BANG\"\n    | \"COMMENT_LESS_THAN_SIGN_BANG_DASH\"\n    | \"COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH\"\n    | \"COMMENT_END_DASH\"\n    | \"COMMENT_END\"\n    | \"COMMENT_END_BANG\"\n    | \"CDATA_SECTION\"\n    | \"CDATA_SECTION_BRACKET\"\n    | \"CDATA_SECTION_END\"\n    | \"CHARACTER_REFERENCE\"\n    | \"NAMED_CHARACTER_REFERENCE\"\n    | \"AMBIGUOUS_AMPERSAND\"\n    | \"NUMERIC_CHARACTER_REFERENCE\"\n    | \"HEXADEMICAL_CHARACTER_REFERENCE_START\"\n    | \"DECIMAL_CHARACTER_REFERENCE_START\"\n    | \"HEXADEMICAL_CHARACTER_REFERENCE\"\n    | \"DECIMAL_CHARACTER_REFERENCE\"\n    | \"NUMERIC_CHARACTER_REFERENCE_END\"\n    | \"CHARACTER_REFERENCE_END\"\n    | \"V_EXPRESSION_START\"\n    | \"V_EXPRESSION_DATA\"\n    | \"V_EXPRESSION_END\"\n// ---- Use RAWTEXT state for <script> elements instead ----\n// \"SCRIPT_DATA\" |\n// \"SCRIPT_DATA_LESS_THAN_SIGN\" |\n// \"SCRIPT_DATA_END_TAG_OPEN\" |\n// \"SCRIPT_DATA_END_TAG_NAME\" |\n// \"SCRIPT_DATA_ESCAPE_START\" |\n// \"SCRIPT_DATA_ESCAPE_START_DASH\" |\n// \"SCRIPT_DATA_ESCAPED\" |\n// \"SCRIPT_DATA_ESCAPED_DASH\" |\n// \"SCRIPT_DATA_ESCAPED_DASH_DASH\" |\n// \"SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN\" |\n// \"SCRIPT_DATA_ESCAPED_END_TAG_OPEN\" |\n// \"SCRIPT_DATA_ESCAPED_END_TAG_NAME\" |\n// \"SCRIPT_DATA_DOUBLE_ESCAPE_START\" |\n// \"SCRIPT_DATA_DOUBLE_ESCAPED\" |\n// \"SCRIPT_DATA_DOUBLE_ESCAPED_DASH\" |\n// \"SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH\" |\n// \"SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN\" |\n// \"SCRIPT_DATA_DOUBLE_ESCAPE_END\" |\n// ---- Use BOGUS_COMMENT state for DOCTYPEs instead ----\n// \"DOCTYPE\" |\n// \"DOCTYPE_NAME\" |\n// \"AFTER_DOCTYPE_NAME\" |\n// \"BEFORE_DOCTYPE_PUBLIC_IDENTIFIER\" |\n// \"DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED\" |\n// \"DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED\" |\n// \"BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS\" |\n// \"BEFORE_DOCTYPE_SYSTEM_IDENTIFIER\" |\n// \"DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED\" |\n// \"DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED\" |\n// \"AFTER_DOCTYPE_SYSTEM_IDENTIFIER\" |\n// \"BOGUS_DOCTYPE\"\n\n/**\n * Tokenizer for HTML.\n */\nexport class Tokenizer {\n    // Reading\n    public readonly text: string\n    public readonly gaps: number[]\n    public readonly lineTerminators: number[]\n    private readonly parserOptions: ParserOptions\n    private lastCodePoint: number\n    private lastCodePointRaw: number\n    private offset: number\n    private column: number\n    private line: number\n\n    // Tokenizing\n    private returnState: TokenizerState\n    private vExpressionScriptState: { state: TokenizerState } | null = null\n    private reconsuming: boolean\n    private buffer: number[]\n    private crStartOffset: number\n    private crCode: number\n    private committedToken: Token | null\n    private provisionalToken: Token | null // can be rollbacked.\n    private currentToken: Token | null\n    private lastTagOpenToken: Token | null\n    private tokenStartOffset: number\n    private tokenStartLine: number\n    private tokenStartColumn: number\n\n    /**\n     * The current state.\n     */\n    public state: TokenizerState\n\n    /**\n     * Syntax errors.\n     */\n    public errors: ParseError[]\n\n    /**\n     * The current namespace.\n     */\n    public namespace: Namespace\n\n    /**\n     * The flag which enables expression tokens.\n     * If this is true, this tokenizer will generate V_EXPRESSION_START and V_EXPRESSION_END tokens.\n     */\n    public expressionEnabled: boolean\n\n    /**\n     * Initialize this tokenizer.\n     * @param text The source code to tokenize.\n     * @param parserOptions The parser options.\n     */\n    public constructor(text: string, parserOptions?: ParserOptions) {\n        debug(\"[html] the source code length: %d\", text.length)\n        this.text = text\n        this.gaps = []\n        this.lineTerminators = []\n        this.parserOptions = parserOptions || {}\n        this.lastCodePoint = this.lastCodePointRaw = NULL\n        this.offset = -1\n        this.column = -1\n        this.line = 1\n        this.state = \"DATA\"\n        this.returnState = \"DATA\"\n        this.reconsuming = false\n        this.buffer = []\n        this.crStartOffset = -1\n        this.crCode = 0\n        this.errors = []\n        this.committedToken = null\n        this.provisionalToken = null\n        this.currentToken = null\n        this.lastTagOpenToken = null\n        this.tokenStartOffset = -1\n        this.tokenStartColumn = -1\n        this.tokenStartLine = 1\n        this.namespace = NS.HTML\n        this.expressionEnabled = false\n    }\n\n    /**\n     * Get the next token.\n     * @returns The next token or null.\n     */\n    public nextToken(): Token | null {\n        let cp = this.lastCodePoint\n        while (\n            this.committedToken == null &&\n            (cp !== EOF || this.reconsuming)\n        ) {\n            if (this.provisionalToken != null && !this.isProvisionalState()) {\n                this.commitProvisionalToken()\n                if (this.committedToken != null) {\n                    break\n                }\n            }\n\n            if (this.reconsuming) {\n                this.reconsuming = false\n                cp = this.lastCodePoint\n            } else {\n                cp = this.consumeNextCodePoint()\n            }\n\n            debug(\"[html] parse\", cp, this.state)\n            this.state = this[this.state](cp)\n        }\n\n        {\n            const token = this.consumeCommittedToken()\n            if (token != null) {\n                return token\n            }\n        }\n\n        assert(cp === EOF)\n\n        if (this.currentToken != null) {\n            this.endToken()\n\n            const token = this.consumeCommittedToken()\n            if (token != null) {\n                return token\n            }\n        }\n        return this.currentToken\n    }\n\n    /**\n     * Consume the last committed token.\n     * @returns The last committed token.\n     */\n    private consumeCommittedToken(): Token | null {\n        const token = this.committedToken\n        this.committedToken = null\n        return token\n    }\n\n    /**\n     * Consume the next code point.\n     * @returns The consumed code point.\n     */\n    private consumeNextCodePoint(): number {\n        if (this.offset >= this.text.length) {\n            this.lastCodePoint = this.lastCodePointRaw = EOF\n            return EOF\n        }\n\n        this.offset += this.lastCodePoint >= 0x10000 ? 2 : 1\n        if (this.offset >= this.text.length) {\n            this.advanceLocation()\n            this.lastCodePoint = this.lastCodePointRaw = EOF\n            return EOF\n        }\n\n        const cp = this.text.codePointAt(this.offset) as number\n\n        if (\n            isSurrogate(this.text.charCodeAt(this.offset)) &&\n            !isSurrogatePair(this.text.charCodeAt(this.offset + 1))\n        ) {\n            this.reportParseError(\"surrogate-in-input-stream\")\n        }\n        if (isNonCharacter(cp)) {\n            this.reportParseError(\"noncharacter-in-input-stream\")\n        }\n        if (isControl(cp) && !isWhitespace(cp) && cp !== NULL) {\n            this.reportParseError(\"control-character-in-input-stream\")\n        }\n\n        // Skip LF to convert CRLF → LF.\n        if (this.lastCodePointRaw === CARRIAGE_RETURN && cp === LINE_FEED) {\n            this.lastCodePoint = this.lastCodePointRaw = LINE_FEED\n            this.gaps.push(this.offset)\n            return this.consumeNextCodePoint()\n        }\n\n        // Update locations.\n        this.advanceLocation()\n        this.lastCodePoint = this.lastCodePointRaw = cp\n\n        // To convert CRLF → LF.\n        if (cp === CARRIAGE_RETURN) {\n            this.lastCodePoint = LINE_FEED\n            return LINE_FEED\n        }\n\n        return cp\n    }\n\n    /**\n     * Advance the current line and column.\n     */\n    private advanceLocation(): void {\n        if (this.lastCodePointRaw === LINE_FEED) {\n            this.lineTerminators.push(this.offset)\n            this.line += 1\n            this.column = 0\n        } else {\n            this.column += this.lastCodePoint >= 0x10000 ? 2 : 1\n        }\n    }\n\n    /**\n     * Directive reconsuming the current code point as the given state.\n     * @param state The next state.\n     * @returns The next state.\n     */\n    private reconsumeAs(state: TokenizerState): TokenizerState {\n        this.reconsuming = true\n        return state\n    }\n\n    /**\n     * Report an invalid character error.\n     * @param code The error code.\n     */\n    private reportParseError(code: ErrorCode): void {\n        const error = ParseError.fromCode(\n            code,\n            this.offset,\n            this.line,\n            this.column,\n        )\n        this.errors.push(error)\n\n        debug(\"[html] syntax error:\", error.message)\n    }\n\n    /**\n     * Mark the current location as a start of tokens.\n     */\n    private setStartTokenMark(): void {\n        this.tokenStartOffset = this.offset\n        this.tokenStartLine = this.line\n        this.tokenStartColumn = this.column\n    }\n\n    /**\n     * Mark the current location as a start of tokens.\n     */\n    private clearStartTokenMark(): void {\n        this.tokenStartOffset = -1\n    }\n\n    /**\n     * Start new token.\n     * @param type The type of new token.\n     * @returns The new token.\n     */\n    private startToken(type: TokenType): Token {\n        if (this.tokenStartOffset === -1) {\n            this.setStartTokenMark()\n        }\n        const offset = this.tokenStartOffset\n        const line = this.tokenStartLine\n        const column = this.tokenStartColumn\n\n        if (this.currentToken != null) {\n            this.endToken()\n        }\n        this.tokenStartOffset = -1\n\n        const token = (this.currentToken = {\n            type,\n            range: [offset, -1],\n            loc: {\n                start: { line, column },\n                end: { line: -1, column: -1 },\n            },\n            value: \"\",\n        })\n\n        debug(\"[html] start token: %d %s\", offset, token.type)\n        return this.currentToken\n    }\n\n    /**\n     * Commit the current token.\n     * @returns The ended token.\n     */\n    private endToken(): Token | null {\n        if (this.currentToken == null) {\n            throw new Error(\"Invalid state\")\n        }\n        if (this.tokenStartOffset === -1) {\n            this.setStartTokenMark()\n        }\n        const token = this.currentToken\n        const offset = this.tokenStartOffset\n        const line = this.tokenStartLine\n        const column = this.tokenStartColumn\n        const provisional = this.isProvisionalState()\n\n        this.currentToken = null\n        this.tokenStartOffset = -1\n\n        token.range[1] = offset\n        token.loc.end.line = line\n        token.loc.end.column = column\n\n        if (token.range[0] === offset && !provisional) {\n            debug(\n                \"[html] abandon token: %j %s %j\",\n                token.range,\n                token.type,\n                token.value,\n            )\n            return null\n        }\n\n        if (provisional) {\n            if (this.provisionalToken != null) {\n                this.commitProvisionalToken()\n            }\n            this.provisionalToken = token\n            debug(\n                \"[html] provisional-commit token: %j %s %j\",\n                token.range,\n                token.type,\n                token.value,\n            )\n        } else {\n            this.commitToken(token)\n        }\n\n        return token\n    }\n\n    /**\n     * Commit the given token.\n     * @param token The token to commit.\n     */\n    private commitToken(token: Token): void {\n        assert(\n            this.committedToken == null,\n            \"Invalid state: the commited token existed already.\",\n        )\n        debug(\n            \"[html] commit token: %j %j %s %j\",\n            token.range,\n            token.loc,\n            token.type,\n            token.value,\n        )\n\n        this.committedToken = token\n        if (token.type === \"HTMLTagOpen\") {\n            this.lastTagOpenToken = token\n        }\n    }\n\n    /**\n     * Check whether this is provisional state or not.\n     * @returns `true` if this is provisional state.\n     */\n    private isProvisionalState(): boolean {\n        return (\n            this.state.startsWith(\"RCDATA_\") ||\n            this.state.startsWith(\"RAWTEXT_\")\n        )\n    }\n\n    /**\n     * Commit the last provisional committed token.\n     */\n    private commitProvisionalToken(): void {\n        assert(\n            this.provisionalToken != null,\n            \"Invalid state: the provisional token was not found.\",\n        )\n\n        const token = this.provisionalToken\n        this.provisionalToken = null\n\n        if (token.range[0] < token.range[1]) {\n            this.commitToken(token)\n        }\n    }\n\n    /**\n     * Cancel the current token and set the last provisional committed token as the current token.\n     */\n    private rollbackProvisionalToken(): void {\n        assert(this.currentToken != null)\n        assert(this.provisionalToken != null)\n\n        const token = this.currentToken\n        debug(\"[html] rollback token: %d %s\", token.range[0], token.type)\n\n        this.currentToken = this.provisionalToken\n        this.provisionalToken = null\n    }\n\n    /**\n     * Append the given code point into the value of the current token.\n     * @param cp The code point to append.\n     * @param expected The expected type of the current token.\n     */\n    private appendTokenValue(cp: number, expected: TokenType | null): void {\n        const token = this.currentToken\n        if (token == null || (expected != null && token.type !== expected)) {\n            const msg1 = expected ? `\"${expected}\" type` : \"any token\"\n            const msg2 = token ? `\"${token.type}\" type` : \"no token\"\n\n            throw new Error(\n                `Tokenizer: Invalid state. Expected ${msg1}, but got ${msg2}.`,\n            )\n        }\n\n        token.value += String.fromCodePoint(cp)\n    }\n\n    /**\n     * Check whether the current token is appropriate `HTMLEndTagOpen` token.\n     * @returns {boolean} `true` if the current token is appropriate `HTMLEndTagOpen` token.\n     */\n    private isAppropriateEndTagOpen(): boolean {\n        return (\n            this.currentToken != null &&\n            this.lastTagOpenToken != null &&\n            this.currentToken.type === \"HTMLEndTagOpen\" &&\n            this.currentToken.value === this.lastTagOpenToken.value\n        )\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/syntax.html#data-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected DATA(cp: number): TokenizerState {\n        this.clearStartTokenMark()\n\n        while (true) {\n            const type = isWhitespace(cp) ? \"HTMLWhitespace\" : \"HTMLText\"\n            if (this.currentToken != null && this.currentToken.type !== type) {\n                this.endToken()\n                return this.reconsumeAs(this.state)\n            }\n            if (this.currentToken == null) {\n                this.startToken(type)\n            }\n\n            if (cp === AMPERSAND) {\n                this.returnState = \"DATA\"\n                return \"CHARACTER_REFERENCE\"\n            }\n            if (cp === LESS_THAN_SIGN) {\n                this.setStartTokenMark()\n                return \"TAG_OPEN\"\n            }\n            if (cp === LEFT_CURLY_BRACKET && this.expressionEnabled) {\n                this.setStartTokenMark()\n                this.returnState = \"DATA\"\n                return \"V_EXPRESSION_START\"\n            }\n            if (cp === RIGHT_CURLY_BRACKET && this.expressionEnabled) {\n                this.setStartTokenMark()\n                this.returnState = \"DATA\"\n                return \"V_EXPRESSION_END\"\n            }\n            if (cp === EOF) {\n                return \"DATA\"\n            }\n\n            if (cp === NULL) {\n                this.reportParseError(\"unexpected-null-character\")\n            }\n            this.appendTokenValue(cp, type)\n\n            cp = this.consumeNextCodePoint()\n        }\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/syntax.html#rcdata-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected RCDATA(cp: number): TokenizerState {\n        this.clearStartTokenMark()\n\n        while (true) {\n            const type = isWhitespace(cp) ? \"HTMLWhitespace\" : \"HTMLRCDataText\"\n            if (this.currentToken != null && this.currentToken.type !== type) {\n                this.endToken()\n                return this.reconsumeAs(this.state)\n            }\n            if (this.currentToken == null) {\n                this.startToken(type)\n            }\n\n            if (cp === AMPERSAND) {\n                this.returnState = \"RCDATA\"\n                return \"CHARACTER_REFERENCE\"\n            }\n            if (cp === LESS_THAN_SIGN) {\n                this.setStartTokenMark()\n                return \"RCDATA_LESS_THAN_SIGN\"\n            }\n            if (cp === LEFT_CURLY_BRACKET && this.expressionEnabled) {\n                this.setStartTokenMark()\n                this.returnState = \"RCDATA\"\n                return \"V_EXPRESSION_START\"\n            }\n            if (cp === RIGHT_CURLY_BRACKET && this.expressionEnabled) {\n                this.setStartTokenMark()\n                this.returnState = \"RCDATA\"\n                return \"V_EXPRESSION_END\"\n            }\n            if (cp === EOF) {\n                return \"DATA\"\n            }\n\n            if (cp === NULL) {\n                this.reportParseError(\"unexpected-null-character\")\n                cp = NULL_REPLACEMENT\n            }\n            this.appendTokenValue(cp, type)\n\n            cp = this.consumeNextCodePoint()\n        }\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/syntax.html#rawtext-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected RAWTEXT(cp: number): TokenizerState {\n        this.clearStartTokenMark()\n\n        while (true) {\n            const type = isWhitespace(cp) ? \"HTMLWhitespace\" : \"HTMLRawText\"\n            if (this.currentToken != null && this.currentToken.type !== type) {\n                this.endToken()\n                return this.reconsumeAs(this.state)\n            }\n            if (this.currentToken == null) {\n                this.startToken(type)\n            }\n\n            if (cp === LESS_THAN_SIGN) {\n                this.setStartTokenMark()\n                return \"RAWTEXT_LESS_THAN_SIGN\"\n            }\n            if (cp === LEFT_CURLY_BRACKET && this.expressionEnabled) {\n                this.setStartTokenMark()\n                this.returnState = \"RAWTEXT\"\n                return \"V_EXPRESSION_START\"\n            }\n            if (cp === RIGHT_CURLY_BRACKET && this.expressionEnabled) {\n                this.setStartTokenMark()\n                this.returnState = \"RAWTEXT\"\n                return \"V_EXPRESSION_END\"\n            }\n            if (cp === EOF) {\n                return \"DATA\"\n            }\n\n            if (cp === NULL) {\n                this.reportParseError(\"unexpected-null-character\")\n                cp = NULL_REPLACEMENT\n            }\n            this.appendTokenValue(cp, type)\n\n            cp = this.consumeNextCodePoint()\n        }\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/syntax.html#tag-open-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected TAG_OPEN(cp: number): TokenizerState {\n        if (cp === EXCLAMATION_MARK) {\n            return \"MARKUP_DECLARATION_OPEN\"\n        }\n        if (cp === SOLIDUS) {\n            return \"END_TAG_OPEN\"\n        }\n        if (isLetter(cp)) {\n            this.startToken(\"HTMLTagOpen\")\n            return this.reconsumeAs(\"TAG_NAME\")\n        }\n        if (cp === QUESTION_MARK) {\n            this.reportParseError(\n                \"unexpected-question-mark-instead-of-tag-name\",\n            )\n            this.startToken(\"HTMLBogusComment\")\n            return this.reconsumeAs(\"BOGUS_COMMENT\")\n        }\n        if (cp === EOF) {\n            this.clearStartTokenMark()\n            this.reportParseError(\"eof-before-tag-name\")\n            this.appendTokenValue(LESS_THAN_SIGN, \"HTMLText\")\n            return \"DATA\"\n        }\n\n        this.reportParseError(\"invalid-first-character-of-tag-name\")\n        this.appendTokenValue(LESS_THAN_SIGN, \"HTMLText\")\n        return this.reconsumeAs(\"DATA\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/syntax.html#end-tag-open-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected END_TAG_OPEN(cp: number): TokenizerState {\n        if (isLetter(cp)) {\n            this.startToken(\"HTMLEndTagOpen\")\n            return this.reconsumeAs(\"TAG_NAME\")\n        }\n        if (cp === GREATER_THAN_SIGN) {\n            this.endToken() // < Commit or abandon the current text token.\n            this.reportParseError(\"missing-end-tag-name\")\n            return \"DATA\"\n        }\n        if (cp === EOF) {\n            this.clearStartTokenMark()\n            this.reportParseError(\"eof-before-tag-name\")\n            this.appendTokenValue(LESS_THAN_SIGN, \"HTMLText\")\n            this.appendTokenValue(SOLIDUS, \"HTMLText\")\n            return \"DATA\"\n        }\n\n        this.reportParseError(\"invalid-first-character-of-tag-name\")\n        this.startToken(\"HTMLBogusComment\")\n        return this.reconsumeAs(\"BOGUS_COMMENT\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/syntax.html#tag-name-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected TAG_NAME(cp: number): TokenizerState {\n        while (true) {\n            if (isWhitespace(cp)) {\n                this.endToken()\n                return \"BEFORE_ATTRIBUTE_NAME\"\n            }\n            if (cp === SOLIDUS) {\n                this.endToken()\n                this.setStartTokenMark()\n                return \"SELF_CLOSING_START_TAG\"\n            }\n            if (cp === GREATER_THAN_SIGN) {\n                this.startToken(\"HTMLTagClose\")\n                return \"DATA\"\n            }\n            if (cp === EOF) {\n                this.reportParseError(\"eof-in-tag\")\n                return \"DATA\"\n            }\n            if (cp === NULL) {\n                this.reportParseError(\"unexpected-null-character\")\n                cp = NULL_REPLACEMENT\n            }\n\n            this.appendTokenValue(\n                isUpperLetter(cp) ? toLowerCodePoint(cp) : cp,\n                null,\n            )\n\n            cp = this.consumeNextCodePoint()\n        }\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/syntax.html#rcdata-less-than-sign-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected RCDATA_LESS_THAN_SIGN(cp: number): TokenizerState {\n        if (cp === SOLIDUS) {\n            this.buffer = []\n            return \"RCDATA_END_TAG_OPEN\"\n        }\n\n        this.appendTokenValue(LESS_THAN_SIGN, \"HTMLRCDataText\")\n        return this.reconsumeAs(\"RCDATA\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/syntax.html#rcdata-end-tag-open-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected RCDATA_END_TAG_OPEN(cp: number): TokenizerState {\n        if (isLetter(cp)) {\n            this.startToken(\"HTMLEndTagOpen\")\n            return this.reconsumeAs(\"RCDATA_END_TAG_NAME\")\n        }\n\n        this.appendTokenValue(LESS_THAN_SIGN, \"HTMLRCDataText\")\n        this.appendTokenValue(SOLIDUS, \"HTMLRCDataText\")\n        return this.reconsumeAs(\"RCDATA\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/syntax.html#rcdata-end-tag-name-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected RCDATA_END_TAG_NAME(cp: number): TokenizerState {\n        while (true) {\n            if (isWhitespace(cp) && this.isAppropriateEndTagOpen()) {\n                this.endToken()\n                return \"BEFORE_ATTRIBUTE_NAME\"\n            }\n            if (cp === SOLIDUS && this.isAppropriateEndTagOpen()) {\n                this.endToken()\n                this.setStartTokenMark()\n                return \"SELF_CLOSING_START_TAG\"\n            }\n            if (cp === GREATER_THAN_SIGN && this.isAppropriateEndTagOpen()) {\n                this.startToken(\"HTMLTagClose\")\n                return \"DATA\"\n            }\n            if (!isLetter(cp)) {\n                this.rollbackProvisionalToken()\n                this.appendTokenValue(LESS_THAN_SIGN, \"HTMLRCDataText\")\n                this.appendTokenValue(SOLIDUS, \"HTMLRCDataText\")\n                for (const cp1 of this.buffer) {\n                    this.appendTokenValue(cp1, \"HTMLRCDataText\")\n                }\n                return this.reconsumeAs(\"RCDATA\")\n            }\n\n            this.appendTokenValue(\n                isUpperLetter(cp) ? toLowerCodePoint(cp) : cp,\n                \"HTMLEndTagOpen\",\n            )\n            this.buffer.push(cp)\n\n            cp = this.consumeNextCodePoint()\n        }\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/syntax.html#rawtext-less-than-sign-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected RAWTEXT_LESS_THAN_SIGN(cp: number): TokenizerState {\n        if (cp === SOLIDUS) {\n            this.buffer = []\n            return \"RAWTEXT_END_TAG_OPEN\"\n        }\n\n        this.appendTokenValue(LESS_THAN_SIGN, \"HTMLRawText\")\n        return this.reconsumeAs(\"RAWTEXT\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/syntax.html#rawtext-end-tag-open-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected RAWTEXT_END_TAG_OPEN(cp: number): TokenizerState {\n        if (isLetter(cp)) {\n            this.startToken(\"HTMLEndTagOpen\")\n            return this.reconsumeAs(\"RAWTEXT_END_TAG_NAME\")\n        }\n\n        this.appendTokenValue(LESS_THAN_SIGN, \"HTMLRawText\")\n        this.appendTokenValue(SOLIDUS, \"HTMLRawText\")\n        return this.reconsumeAs(\"RAWTEXT\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/syntax.html#rawtext-end-tag-name-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected RAWTEXT_END_TAG_NAME(cp: number): TokenizerState {\n        while (true) {\n            if (cp === SOLIDUS && this.isAppropriateEndTagOpen()) {\n                this.endToken()\n                this.setStartTokenMark()\n                return \"SELF_CLOSING_START_TAG\"\n            }\n            if (cp === GREATER_THAN_SIGN && this.isAppropriateEndTagOpen()) {\n                this.startToken(\"HTMLTagClose\")\n                return \"DATA\"\n            }\n            if (isWhitespace(cp) && this.isAppropriateEndTagOpen()) {\n                this.endToken()\n                return \"BEFORE_ATTRIBUTE_NAME\"\n            }\n            if (!isLetter(cp) && !maybeValidCustomBlock.call(this, cp)) {\n                this.rollbackProvisionalToken()\n                this.appendTokenValue(LESS_THAN_SIGN, \"HTMLRawText\")\n                this.appendTokenValue(SOLIDUS, \"HTMLRawText\")\n                for (const cp1 of this.buffer) {\n                    this.appendTokenValue(cp1, \"HTMLRawText\")\n                }\n                return this.reconsumeAs(\"RAWTEXT\")\n            }\n\n            this.appendTokenValue(\n                isUpperLetter(cp) ? toLowerCodePoint(cp) : cp,\n                \"HTMLEndTagOpen\",\n            )\n            this.buffer.push(cp)\n\n            cp = this.consumeNextCodePoint()\n        }\n\n        function maybeValidCustomBlock(this: Tokenizer, nextCp: number) {\n            return (\n                this.currentToken &&\n                this.lastTagOpenToken?.value.startsWith(\n                    this.currentToken.value + String.fromCodePoint(nextCp),\n                )\n            )\n        }\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#before-attribute-name-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected BEFORE_ATTRIBUTE_NAME(cp: number): TokenizerState {\n        while (isWhitespace(cp)) {\n            cp = this.consumeNextCodePoint()\n        }\n\n        if (cp === SOLIDUS || cp === GREATER_THAN_SIGN || cp === EOF) {\n            return this.reconsumeAs(\"AFTER_ATTRIBUTE_NAME\")\n        }\n\n        if (cp === EQUALS_SIGN) {\n            this.reportParseError(\n                \"unexpected-equals-sign-before-attribute-name\",\n            )\n            this.startToken(\"HTMLIdentifier\")\n            this.appendTokenValue(cp, \"HTMLIdentifier\")\n            return \"ATTRIBUTE_NAME\"\n        }\n\n        this.startToken(\"HTMLIdentifier\")\n        return this.reconsumeAs(\"ATTRIBUTE_NAME\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#attribute-name-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected ATTRIBUTE_NAME(cp: number): TokenizerState {\n        while (true) {\n            if (\n                isWhitespace(cp) ||\n                cp === SOLIDUS ||\n                cp === GREATER_THAN_SIGN ||\n                cp === EOF\n            ) {\n                this.endToken()\n                return this.reconsumeAs(\"AFTER_ATTRIBUTE_NAME\")\n            }\n            if (cp === EQUALS_SIGN) {\n                this.startToken(\"HTMLAssociation\")\n                return \"BEFORE_ATTRIBUTE_VALUE\"\n            }\n\n            if (cp === NULL) {\n                this.reportParseError(\"unexpected-null-character\")\n                cp = NULL_REPLACEMENT\n            }\n            if (\n                cp === QUOTATION_MARK ||\n                cp === APOSTROPHE ||\n                cp === LESS_THAN_SIGN\n            ) {\n                this.reportParseError(\"unexpected-character-in-attribute-name\")\n            }\n\n            this.appendTokenValue(\n                isUpperLetter(cp) ? toLowerCodePoint(cp) : cp,\n                \"HTMLIdentifier\",\n            )\n            cp = this.consumeNextCodePoint()\n        }\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#after-attribute-name-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected AFTER_ATTRIBUTE_NAME(cp: number): TokenizerState {\n        while (isWhitespace(cp)) {\n            cp = this.consumeNextCodePoint()\n        }\n\n        if (cp === SOLIDUS) {\n            this.setStartTokenMark()\n            return \"SELF_CLOSING_START_TAG\"\n        }\n        if (cp === EQUALS_SIGN) {\n            this.startToken(\"HTMLAssociation\")\n            return \"BEFORE_ATTRIBUTE_VALUE\"\n        }\n        if (cp === GREATER_THAN_SIGN) {\n            this.startToken(\"HTMLTagClose\")\n            return \"DATA\"\n        }\n\n        if (cp === EOF) {\n            this.reportParseError(\"eof-in-tag\")\n            return \"DATA\"\n        }\n\n        this.startToken(\"HTMLIdentifier\")\n        return this.reconsumeAs(\"ATTRIBUTE_NAME\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#before-attribute-value-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected BEFORE_ATTRIBUTE_VALUE(cp: number): TokenizerState {\n        this.endToken()\n\n        while (isWhitespace(cp)) {\n            cp = this.consumeNextCodePoint()\n        }\n\n        if (cp === GREATER_THAN_SIGN) {\n            this.reportParseError(\"missing-attribute-value\")\n            this.startToken(\"HTMLTagClose\")\n            return \"DATA\"\n        }\n\n        this.startToken(\"HTMLLiteral\")\n        if (cp === QUOTATION_MARK) {\n            return \"ATTRIBUTE_VALUE_DOUBLE_QUOTED\"\n        }\n        if (cp === APOSTROPHE) {\n            return \"ATTRIBUTE_VALUE_SINGLE_QUOTED\"\n        }\n        return this.reconsumeAs(\"ATTRIBUTE_VALUE_UNQUOTED\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#attribute-value-(double-quoted)-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected ATTRIBUTE_VALUE_DOUBLE_QUOTED(cp: number): TokenizerState {\n        while (true) {\n            if (cp === QUOTATION_MARK) {\n                return \"AFTER_ATTRIBUTE_VALUE_QUOTED\"\n            }\n            if (cp === AMPERSAND) {\n                this.returnState = \"ATTRIBUTE_VALUE_DOUBLE_QUOTED\"\n                return \"CHARACTER_REFERENCE\"\n            }\n\n            if (cp === NULL) {\n                this.reportParseError(\"unexpected-null-character\")\n                cp = NULL_REPLACEMENT\n            }\n            if (cp === EOF) {\n                this.reportParseError(\"eof-in-tag\")\n                return \"DATA\"\n            }\n\n            this.appendTokenValue(cp, \"HTMLLiteral\")\n            cp = this.consumeNextCodePoint()\n        }\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#attribute-value-(single-quoted)-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected ATTRIBUTE_VALUE_SINGLE_QUOTED(cp: number): TokenizerState {\n        while (true) {\n            if (cp === APOSTROPHE) {\n                return \"AFTER_ATTRIBUTE_VALUE_QUOTED\"\n            }\n            if (cp === AMPERSAND) {\n                this.returnState = \"ATTRIBUTE_VALUE_SINGLE_QUOTED\"\n                return \"CHARACTER_REFERENCE\"\n            }\n\n            if (cp === NULL) {\n                this.reportParseError(\"unexpected-null-character\")\n                cp = NULL_REPLACEMENT\n            }\n            if (cp === EOF) {\n                this.reportParseError(\"eof-in-tag\")\n                return \"DATA\"\n            }\n\n            this.appendTokenValue(cp, \"HTMLLiteral\")\n            cp = this.consumeNextCodePoint()\n        }\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#attribute-value-(unquoted)-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected ATTRIBUTE_VALUE_UNQUOTED(cp: number): TokenizerState {\n        while (true) {\n            if (isWhitespace(cp)) {\n                this.endToken()\n                return \"BEFORE_ATTRIBUTE_NAME\"\n            }\n            if (cp === AMPERSAND) {\n                this.returnState = \"ATTRIBUTE_VALUE_UNQUOTED\"\n                return \"CHARACTER_REFERENCE\"\n            }\n            if (cp === GREATER_THAN_SIGN) {\n                this.startToken(\"HTMLTagClose\")\n                return \"DATA\"\n            }\n\n            if (cp === NULL) {\n                this.reportParseError(\"unexpected-null-character\")\n                cp = NULL_REPLACEMENT\n            }\n            if (\n                cp === QUOTATION_MARK ||\n                cp === APOSTROPHE ||\n                cp === LESS_THAN_SIGN ||\n                cp === EQUALS_SIGN ||\n                cp === GRAVE_ACCENT\n            ) {\n                this.reportParseError(\n                    \"unexpected-character-in-unquoted-attribute-value\",\n                )\n            }\n            if (cp === EOF) {\n                this.reportParseError(\"eof-in-tag\")\n                return \"DATA\"\n            }\n\n            this.appendTokenValue(cp, \"HTMLLiteral\")\n            cp = this.consumeNextCodePoint()\n        }\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#after-attribute-value-(quoted)-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected AFTER_ATTRIBUTE_VALUE_QUOTED(cp: number): TokenizerState {\n        this.endToken()\n\n        if (isWhitespace(cp)) {\n            return \"BEFORE_ATTRIBUTE_NAME\"\n        }\n        if (cp === SOLIDUS) {\n            this.setStartTokenMark()\n            return \"SELF_CLOSING_START_TAG\"\n        }\n        if (cp === GREATER_THAN_SIGN) {\n            this.startToken(\"HTMLTagClose\")\n            return \"DATA\"\n        }\n\n        if (cp === EOF) {\n            this.reportParseError(\"eof-in-tag\")\n            return \"DATA\"\n        }\n\n        this.reportParseError(\"missing-whitespace-between-attributes\")\n        return this.reconsumeAs(\"BEFORE_ATTRIBUTE_NAME\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#self-closing-start-tag-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected SELF_CLOSING_START_TAG(cp: number): TokenizerState {\n        if (cp === GREATER_THAN_SIGN) {\n            this.startToken(\"HTMLSelfClosingTagClose\")\n\n            // Vue.js supports self-closing elements.\n            // So don't switch to RCDATA/RAWTEXT from any elements.\n            return \"DATA\"\n        }\n\n        if (cp === EOF) {\n            this.reportParseError(\"eof-in-tag\")\n            return \"DATA\"\n        }\n\n        this.reportParseError(\"unexpected-solidus-in-tag\")\n        this.clearStartTokenMark()\n        return this.reconsumeAs(\"BEFORE_ATTRIBUTE_NAME\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#bogus-comment-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected BOGUS_COMMENT(cp: number): TokenizerState {\n        while (true) {\n            if (cp === GREATER_THAN_SIGN) {\n                return \"DATA\"\n            }\n\n            if (cp === EOF) {\n                return \"DATA\"\n            }\n            if (cp === NULL) {\n                cp = NULL_REPLACEMENT\n            }\n            this.appendTokenValue(cp, null)\n\n            cp = this.consumeNextCodePoint()\n        }\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#markup-declaration-open-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected MARKUP_DECLARATION_OPEN(cp: number): TokenizerState {\n        if (cp === HYPHEN_MINUS && this.text[this.offset + 1] === \"-\") {\n            this.offset += 1\n            this.column += 1\n\n            this.startToken(\"HTMLComment\")\n            return \"COMMENT_START\"\n        }\n        if (\n            cp === LATIN_CAPITAL_D &&\n            this.text.slice(this.offset + 1, this.offset + 7) === \"OCTYPE\"\n        ) {\n            // It does not support DOCTYPE.\n            // this.offset += 6\n            // this.column += 6\n            // return \"DOCTYPE\"\n\n            // TODO\n            this.startToken(\"HTMLBogusComment\")\n            this.appendTokenValue(cp, \"HTMLBogusComment\")\n            return \"BOGUS_COMMENT\"\n        }\n        if (\n            cp === LEFT_SQUARE_BRACKET &&\n            this.text.slice(this.offset + 1, this.offset + 7) === \"CDATA[\"\n        ) {\n            this.offset += 6\n            this.column += 6\n\n            if (this.namespace === NS.HTML) {\n                this.reportParseError(\"cdata-in-html-content\")\n                this.startToken(\"HTMLBogusComment\").value = \"[CDATA[\"\n                return \"BOGUS_COMMENT\"\n            }\n\n            this.startToken(\"HTMLCDataText\")\n            return \"CDATA_SECTION\"\n        }\n\n        this.reportParseError(\"incorrectly-opened-comment\")\n        this.startToken(\"HTMLBogusComment\")\n        return this.reconsumeAs(\"BOGUS_COMMENT\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#comment-start-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected COMMENT_START(cp: number): TokenizerState {\n        if (cp === HYPHEN_MINUS) {\n            return \"COMMENT_START_DASH\"\n        }\n        if (cp === GREATER_THAN_SIGN) {\n            this.reportParseError(\"abrupt-closing-of-empty-comment\")\n            return \"DATA\"\n        }\n\n        return this.reconsumeAs(\"COMMENT\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#comment-start-dash-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected COMMENT_START_DASH(cp: number): TokenizerState {\n        if (cp === HYPHEN_MINUS) {\n            return \"COMMENT_END\"\n        }\n\n        if (cp === GREATER_THAN_SIGN) {\n            this.reportParseError(\"abrupt-closing-of-empty-comment\")\n            return \"DATA\"\n        }\n        if (cp === EOF) {\n            this.reportParseError(\"eof-in-comment\")\n            return \"DATA\"\n        }\n\n        this.appendTokenValue(HYPHEN_MINUS, \"HTMLComment\")\n        return this.reconsumeAs(\"COMMENT\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#comment-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected COMMENT(cp: number): TokenizerState {\n        while (true) {\n            if (cp === LESS_THAN_SIGN) {\n                this.appendTokenValue(LESS_THAN_SIGN, \"HTMLComment\")\n                return \"COMMENT_LESS_THAN_SIGN\"\n            }\n            if (cp === HYPHEN_MINUS) {\n                return \"COMMENT_END_DASH\"\n            }\n\n            if (cp === NULL) {\n                this.reportParseError(\"unexpected-null-character\")\n                cp = NULL_REPLACEMENT\n            }\n            if (cp === EOF) {\n                this.reportParseError(\"eof-in-comment\")\n                return \"DATA\"\n            }\n\n            this.appendTokenValue(cp, \"HTMLComment\")\n            cp = this.consumeNextCodePoint()\n        }\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#comment-less-than-sign-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected COMMENT_LESS_THAN_SIGN(cp: number): TokenizerState {\n        while (true) {\n            if (cp === EXCLAMATION_MARK) {\n                this.appendTokenValue(cp, \"HTMLComment\")\n                return \"COMMENT_LESS_THAN_SIGN_BANG\"\n            }\n            if (cp !== LESS_THAN_SIGN) {\n                return this.reconsumeAs(\"COMMENT\")\n            }\n\n            this.appendTokenValue(cp, \"HTMLComment\")\n            cp = this.consumeNextCodePoint()\n        }\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#comment-less-than-sign-bang-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected COMMENT_LESS_THAN_SIGN_BANG(cp: number): TokenizerState {\n        if (cp === HYPHEN_MINUS) {\n            return \"COMMENT_LESS_THAN_SIGN_BANG_DASH\"\n        }\n        return this.reconsumeAs(\"COMMENT\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#comment-less-than-sign-bang-dash-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected COMMENT_LESS_THAN_SIGN_BANG_DASH(cp: number): TokenizerState {\n        if (cp === HYPHEN_MINUS) {\n            return \"COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH\"\n        }\n        return this.reconsumeAs(\"COMMENT_END_DASH\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#comment-less-than-sign-bang-dash-dash-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH(\n        cp: number,\n    ): TokenizerState {\n        if (cp !== GREATER_THAN_SIGN && cp !== EOF) {\n            this.reportParseError(\"nested-comment\")\n        }\n        return this.reconsumeAs(\"COMMENT_END\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#comment-end-dash-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected COMMENT_END_DASH(cp: number): TokenizerState {\n        if (cp === HYPHEN_MINUS) {\n            return \"COMMENT_END\"\n        }\n\n        if (cp === EOF) {\n            this.reportParseError(\"eof-in-comment\")\n            return \"DATA\"\n        }\n\n        this.appendTokenValue(HYPHEN_MINUS, \"HTMLComment\")\n        return this.reconsumeAs(\"COMMENT\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#comment-end-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected COMMENT_END(cp: number): TokenizerState {\n        while (true) {\n            if (cp === GREATER_THAN_SIGN) {\n                return \"DATA\"\n            }\n            if (cp === EXCLAMATION_MARK) {\n                return \"COMMENT_END_BANG\"\n            }\n\n            if (cp === EOF) {\n                this.reportParseError(\"eof-in-comment\")\n                return \"DATA\"\n            }\n\n            this.appendTokenValue(HYPHEN_MINUS, \"HTMLComment\")\n\n            if (cp !== HYPHEN_MINUS) {\n                this.appendTokenValue(HYPHEN_MINUS, \"HTMLComment\")\n                return this.reconsumeAs(\"COMMENT\")\n            }\n            cp = this.consumeNextCodePoint()\n        }\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#comment-end-bang-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected COMMENT_END_BANG(cp: number): TokenizerState {\n        if (cp === HYPHEN_MINUS) {\n            this.appendTokenValue(HYPHEN_MINUS, \"HTMLComment\")\n            this.appendTokenValue(EXCLAMATION_MARK, \"HTMLComment\")\n            return \"COMMENT_END_DASH\"\n        }\n\n        if (cp === GREATER_THAN_SIGN) {\n            this.reportParseError(\"incorrectly-closed-comment\")\n            return \"DATA\"\n        }\n        if (cp === EOF) {\n            this.reportParseError(\"eof-in-comment\")\n            return \"DATA\"\n        }\n\n        this.appendTokenValue(HYPHEN_MINUS, \"HTMLComment\")\n        this.appendTokenValue(EXCLAMATION_MARK, \"HTMLComment\")\n        return this.reconsumeAs(\"COMMENT\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#cdata-section-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected CDATA_SECTION(cp: number): TokenizerState {\n        while (true) {\n            if (cp === RIGHT_SQUARE_BRACKET) {\n                return \"CDATA_SECTION_BRACKET\"\n            }\n\n            if (cp === EOF) {\n                this.reportParseError(\"eof-in-cdata\")\n                return \"DATA\"\n            }\n\n            this.appendTokenValue(cp, \"HTMLCDataText\")\n            cp = this.consumeNextCodePoint()\n        }\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#cdata-section-bracket-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected CDATA_SECTION_BRACKET(cp: number): TokenizerState {\n        if (cp === RIGHT_SQUARE_BRACKET) {\n            return \"CDATA_SECTION_END\"\n        }\n\n        this.appendTokenValue(RIGHT_SQUARE_BRACKET, \"HTMLCDataText\")\n        return this.reconsumeAs(\"CDATA_SECTION\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#cdata-section-end-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected CDATA_SECTION_END(cp: number): TokenizerState {\n        while (true) {\n            if (cp === GREATER_THAN_SIGN) {\n                return \"DATA\"\n            }\n            if (cp !== RIGHT_SQUARE_BRACKET) {\n                this.appendTokenValue(RIGHT_SQUARE_BRACKET, \"HTMLCDataText\")\n                this.appendTokenValue(RIGHT_SQUARE_BRACKET, \"HTMLCDataText\")\n                return this.reconsumeAs(\"CDATA_SECTION\")\n            }\n\n            this.appendTokenValue(RIGHT_SQUARE_BRACKET, \"HTMLCDataText\")\n            cp = this.consumeNextCodePoint()\n        }\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#character-reference-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected CHARACTER_REFERENCE(cp: number): TokenizerState {\n        this.crStartOffset = this.offset - 1\n        this.buffer = [AMPERSAND]\n\n        if (isDigit(cp) || isLetter(cp)) {\n            return this.reconsumeAs(\"NAMED_CHARACTER_REFERENCE\")\n        }\n        if (cp === NUMBER_SIGN) {\n            this.buffer.push(cp)\n            return \"NUMERIC_CHARACTER_REFERENCE\"\n        }\n        return this.reconsumeAs(\"CHARACTER_REFERENCE_END\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected NAMED_CHARACTER_REFERENCE(cp: number): TokenizerState {\n        for (const entitySet of entitySets) {\n            const length = entitySet.length\n            const entities = entitySet.entities\n            const text = this.text.slice(this.offset, this.offset + length)\n            const codepoints = entities[text]\n\n            if (codepoints == null) {\n                continue\n            }\n\n            const semi = text.endsWith(\";\")\n            const next = this.text.codePointAt(this.offset + 1)\n\n            this.offset += length - 1\n            this.column += length - 1\n\n            if (\n                this.returnState.startsWith(\"ATTR\") &&\n                !semi &&\n                next != null &&\n                (next === EQUALS_SIGN || isLetter(next) || isDigit(next))\n            ) {\n                for (const cp1 of text) {\n                    this.buffer.push(cp1.codePointAt(0) as number)\n                }\n            } else {\n                if (!semi) {\n                    this.reportParseError(\n                        \"missing-semicolon-after-character-reference\",\n                    )\n                }\n                this.buffer = codepoints\n            }\n\n            return \"CHARACTER_REFERENCE_END\"\n        }\n\n        for (const cp0 of this.buffer) {\n            this.appendTokenValue(cp0, null)\n        }\n        this.appendTokenValue(cp, null)\n\n        return \"AMBIGUOUS_AMPERSAND\"\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#ambiguous-ampersand-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected AMBIGUOUS_AMPERSAND(cp: number): TokenizerState {\n        while (isDigit(cp) || isLetter(cp)) {\n            this.appendTokenValue(cp, null)\n            cp = this.consumeNextCodePoint()\n        }\n\n        if (cp === SEMICOLON) {\n            this.reportParseError(\"unknown-named-character-reference\")\n        }\n        return this.reconsumeAs(this.returnState)\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#numeric-character-reference-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected NUMERIC_CHARACTER_REFERENCE(cp: number): TokenizerState {\n        this.crCode = 0\n\n        if (cp === LATIN_SMALL_X || cp === LATIN_CAPITAL_X) {\n            this.buffer.push(cp)\n            return \"HEXADEMICAL_CHARACTER_REFERENCE_START\"\n        }\n        return this.reconsumeAs(\"DECIMAL_CHARACTER_REFERENCE_START\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#hexademical-character-reference-start-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected HEXADEMICAL_CHARACTER_REFERENCE_START(\n        cp: number,\n    ): TokenizerState {\n        if (isHexDigit(cp)) {\n            return this.reconsumeAs(\"HEXADEMICAL_CHARACTER_REFERENCE\")\n        }\n\n        this.reportParseError(\n            \"absence-of-digits-in-numeric-character-reference\",\n        )\n        return this.reconsumeAs(\"CHARACTER_REFERENCE_END\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#decimal-character-reference-start-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected DECIMAL_CHARACTER_REFERENCE_START(cp: number): TokenizerState {\n        if (isDigit(cp)) {\n            return this.reconsumeAs(\"DECIMAL_CHARACTER_REFERENCE\")\n        }\n\n        this.reportParseError(\n            \"absence-of-digits-in-numeric-character-reference\",\n        )\n        return this.reconsumeAs(\"CHARACTER_REFERENCE_END\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#hexademical-character-reference-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected HEXADEMICAL_CHARACTER_REFERENCE(cp: number): TokenizerState {\n        while (true) {\n            if (isDigit(cp)) {\n                this.crCode = 16 * this.crCode + (cp - 0x30)\n            } else if (isUpperHexDigit(cp)) {\n                this.crCode = 16 * this.crCode + (cp - 0x37)\n            } else if (isLowerHexDigit(cp)) {\n                this.crCode = 16 * this.crCode + (cp - 0x57)\n            } else {\n                if (cp === SEMICOLON) {\n                    return \"NUMERIC_CHARACTER_REFERENCE_END\"\n                }\n\n                this.reportParseError(\n                    \"missing-semicolon-after-character-reference\",\n                )\n                return this.reconsumeAs(\"NUMERIC_CHARACTER_REFERENCE_END\")\n            }\n\n            cp = this.consumeNextCodePoint()\n        }\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#decimal-character-reference-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected DECIMAL_CHARACTER_REFERENCE(cp: number): TokenizerState {\n        while (true) {\n            if (isDigit(cp)) {\n                this.crCode = 10 * this.crCode + (cp - 0x30)\n            } else {\n                if (cp === SEMICOLON) {\n                    return \"NUMERIC_CHARACTER_REFERENCE_END\"\n                }\n\n                this.reportParseError(\n                    \"missing-semicolon-after-character-reference\",\n                )\n                return this.reconsumeAs(\"NUMERIC_CHARACTER_REFERENCE_END\")\n            }\n\n            cp = this.consumeNextCodePoint()\n        }\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#numeric-character-reference-end-state\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected NUMERIC_CHARACTER_REFERENCE_END(_cp: number): TokenizerState {\n        let code = this.crCode\n\n        if (code === 0) {\n            this.reportParseError(\"null-character-reference\")\n            code = NULL_REPLACEMENT\n        } else if (code > 0x10ffff) {\n            this.reportParseError(\"character-reference-outside-unicode-range\")\n            code = NULL_REPLACEMENT\n        } else if (isSurrogate(code)) {\n            this.reportParseError(\"surrogate-character-reference\")\n            code = NULL_REPLACEMENT\n        } else if (isNonCharacter(code)) {\n            this.reportParseError(\"noncharacter-character-reference\")\n        } else if (code === 0x0d || (isControl(code) && !isWhitespace(code))) {\n            this.reportParseError(\"control-character-reference\")\n            code = alternativeCR.get(code) || code\n        }\n\n        this.buffer = [code]\n        return this.reconsumeAs(\"CHARACTER_REFERENCE_END\")\n    }\n\n    /**\n     * https://html.spec.whatwg.org/multipage/parsing.html#flush-code-points-consumed-as-a-character-reference\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected CHARACTER_REFERENCE_END(_cp: number): TokenizerState {\n        assert(this.currentToken != null)\n\n        // The this.buffer.length is not new length since it includes surrogate pairs.\n        // Calculate new length.\n        const token = this.currentToken\n        const len0 = token.value.length\n        for (const cp1 of this.buffer) {\n            this.appendTokenValue(cp1, null)\n        }\n        const newLength = token.value.length - len0\n\n        // Make gaps in the difference of length.\n        for (let i = this.crStartOffset + newLength; i    < this.offset; ++i) {\n            this.gaps.push(i)\n        }\n\n        return this.reconsumeAs(this.returnState)\n    }\n\n    /**\n     * Original state.\n     * Create `{{ `token.\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected V_EXPRESSION_START(cp: number): TokenizerState {\n        if (cp === LEFT_CURLY_BRACKET) {\n            this.startToken(\"VExpressionStart\")\n            this.appendTokenValue(LEFT_CURLY_BRACKET, null)\n            this.appendTokenValue(LEFT_CURLY_BRACKET, null)\n\n            if (\n                !(\n                    this.parserOptions.vueFeatures?.interpolationAsNonHTML ??\n                    true\n                )\n            ) {\n                return this.returnState\n            }\n\n            const closeIndex = this.text.indexOf(\"}}\", this.offset + 1)\n            if (closeIndex === -1) {\n                this.reportParseError(\"x-missing-interpolation-end\")\n                return this.returnState\n            }\n            this.vExpressionScriptState = {\n                state: this.returnState,\n            }\n            return \"V_EXPRESSION_DATA\"\n        }\n\n        this.appendTokenValue(LEFT_CURLY_BRACKET, null)\n        return this.reconsumeAs(this.returnState)\n    }\n\n    /**\n     * Original state.\n     * Parse in interpolation.\n     * @see https://github.com/vuejs/vue-next/blob/3a6b1207fa39cb35eed5bae0b5fdcdb465926bca/packages/compiler-core/src/parse.ts#L752\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected V_EXPRESSION_DATA(cp: number): TokenizerState {\n        this.clearStartTokenMark()\n        const state = this.vExpressionScriptState!.state\n\n        while (true) {\n            const type = isWhitespace(cp)\n                ? \"HTMLWhitespace\"\n                : state === \"RCDATA\"\n                  ? \"HTMLRCDataText\"\n                  : state === \"RAWTEXT\"\n                    ? \"HTMLRawText\"\n                    : \"HTMLText\"\n            if (this.currentToken != null && this.currentToken.type !== type) {\n                this.endToken()\n                return this.reconsumeAs(this.state)\n            }\n            if (this.currentToken == null) {\n                this.startToken(type)\n            }\n\n            if (cp === AMPERSAND && state !== \"RAWTEXT\") {\n                this.returnState = \"V_EXPRESSION_DATA\"\n                return \"CHARACTER_REFERENCE\"\n            }\n            // if (cp === LESS_THAN_SIGN) {\n            //     this.setStartTokenMark()\n            //     return \"TAG_OPEN\"\n            // }\n            if (cp === RIGHT_CURLY_BRACKET) {\n                this.setStartTokenMark()\n                this.returnState = \"V_EXPRESSION_DATA\"\n                return \"V_EXPRESSION_END\"\n            }\n            // Already checked\n            /* istanbul ignore next */\n            if (cp === EOF) {\n                this.reportParseError(\"x-missing-interpolation-end\")\n                return \"DATA\"\n            }\n\n            if (cp === NULL) {\n                this.reportParseError(\"unexpected-null-character\")\n            }\n            this.appendTokenValue(cp, type)\n\n            cp = this.consumeNextCodePoint()\n        }\n    }\n    /**\n     * Create `}} `token.\n     * @param cp The current code point.\n     * @returns The next state.\n     */\n    protected V_EXPRESSION_END(cp: number): TokenizerState {\n        if (cp === RIGHT_CURLY_BRACKET) {\n            this.startToken(\"VExpressionEnd\")\n            this.appendTokenValue(RIGHT_CURLY_BRACKET, null)\n            this.appendTokenValue(RIGHT_CURLY_BRACKET, null)\n            if (this.vExpressionScriptState) {\n                const state = this.vExpressionScriptState.state\n                this.vExpressionScriptState = null\n                return state\n            }\n            return this.returnState\n        }\n\n        this.appendTokenValue(RIGHT_CURLY_BRACKET, null)\n        return this.reconsumeAs(this.returnState)\n    }\n}\n\n/*eslint-enable no-param-reassign */\n","/**\n * Creates a memoized version of the provided function. The memoized function caches\n * results based on the argument it receives, so if the same argument is passed again,\n * it returns the cached result instead of recomputing it.\n *\n * This function works with functions that take zero or just one argument. If your function\n * originally takes multiple arguments, you should refactor it to take a single object or array\n * that combines those arguments.\n *\n * If the argument is not primitive (e.g., arrays or objects), provide a\n * `getCacheKey` function to generate a unique cache key for proper caching.\n *\n * @template F - The type of the function to be memoized.\n * @param {F} fn - The function to be memoized. It should accept a single argument and return a value.\n * @param {MemoizeOptions<Parameters<F>[0], ReturnType<F>>} [options={}] - Optional configuration for the memoization.\n * @param {MemoizeCache<any, V>} [options.cache] - The cache object used to store results. Defaults to a new `Map`.\n * @param {(args: A) => unknown} [options.getCacheKey] - An optional function to generate a unique cache key for each argument.\n *\n * @returns The memoized function with an additional `cache` property that exposes the internal cache.\n *\n * @example\n * // Example using the default cache\n * const add = (x: number) => x + 10;\n * const memoizedAdd = memoize(add);\n *\n * console.log(memoizedAdd(5)); // 15\n * console.log(memoizedAdd(5)); // 15 (cached result)\n * console.log(memoizedAdd.cache.size); // 1\n *\n * @example\n * // Example using a custom resolver\n * const sum = (arr: number[]) => arr.reduce((x, y) => x + y, 0);\n * const memoizedSum = memoize(sum, { getCacheKey: (arr: number[]) => arr.join(',') });\n * console.log(memoizedSum([1, 2])); // 3\n * console.log(memoizedSum([1, 2])); // 3 (cached result)\n * console.log(memoizedSum.cache.size); // 1\n *\n * @example\n * // Example using a custom cache implementation\n * class CustomCache<K, T> implements MemoizeCache<K, T> {\n *   private cache = new Map<K, T>();\n *\n *   set(key: K, value: T): void {\n *     this.cache.set(key, value);\n *   }\n *\n *   get(key: K): T | undefined {\n *     return this.cache.get(key);\n *   }\n *\n *   has(key: K): boolean {\n *     return this.cache.has(key);\n *   }\n *\n *   delete(key: K): boolean {\n *     return this.cache.delete(key);\n *   }\n *\n *   clear(): void {\n *     this.cache.clear();\n *   }\n *\n *   get size(): number {\n *     return this.cache.size;\n *   }\n * }\n * const customCache = new CustomCache<string, number>();\n * const memoizedSumWithCustomCache = memoize(sum, { cache: customCache });\n * console.log(memoizedSumWithCustomCache([1, 2])); // 3\n * console.log(memoizedSumWithCustomCache([1, 2])); // 3 (cached result)\n * console.log(memoizedAddWithCustomCache.cache.size); // 1\n *\n * MIT © Viva Republica, Inc. | https://es-toolkit.dev/\n *\n * The implementation is copied from es-toolkit package:\n * https://github.com/toss/es-toolkit/blob/16709839f131269b84cdd96e9645df52648ccedf/src/function/memoize.ts\n */\nexport function memoize<F extends (...args: any) => any>(\n    fn: F,\n    options: {\n        cache?: MemoizeCache<any, ReturnType<F>>\n        getCacheKey?: (args: Parameters<F>[0]) => unknown\n    } = {},\n): F & { cache: MemoizeCache<any, ReturnType<F>> } {\n    const { cache = new Map<unknown, ReturnType<F>>(), getCacheKey } = options\n\n    const memoizedFn = function (\n        this: unknown,\n        arg: Parameters<F>[0],\n    ): ReturnType<F> {\n        const key = getCacheKey ? getCacheKey(arg) : arg\n\n        if (cache.has(key)) {\n            return cache.get(key)!\n        }\n\n        const result = fn.call(this, arg)\n\n        cache.set(key, result)\n\n        return result\n    }\n\n    memoizedFn.cache = cache\n\n    return memoizedFn as F & { cache: MemoizeCache<any, ReturnType<F>> }\n}\n\n/**\n * Represents a cache for memoization, allowing storage and retrieval of computed values.\n *\n * @template K - The type of keys used to store values in the cache.\n * @template V - The type of values stored in the cache.\n */\ninterface MemoizeCache<K, V> {\n    /**\n     * Stores a value in the cache with the specified key.\n     *\n     * @param key - The key to associate with the value.\n     * @param value - The value to store in the cache.\n     */\n    set(key: K, value: V): void\n\n    /**\n     * Retrieves a value from the cache by its key.\n     *\n     * @param key - The key of the value to retrieve.\n     * @returns The value associated with the key, or undefined if the key does not exist.\n     */\n    get(key: K): V | undefined\n\n    /**\n     * Checks if a value exists in the cache for the specified key.\n     *\n     * @param key - The key to check for existence in the cache.\n     * @returns True if the cache contains the key, false otherwise.\n     */\n    has(key: K): boolean\n\n    /**\n     * Deletes a value from the cache by its key.\n     *\n     * @param key - The key of the value to delete.\n     * @returns True if the value was successfully deleted, false otherwise.\n     */\n    delete(key: K): boolean | void\n\n    /**\n     * Clears all values from the cache.\n     */\n    clear(): void\n\n    /**\n     * The number of entries in the cache.\n     */\n    size: number\n}\n","/**\n * This file is copied from `eslint/lib/util/node-event-generator.js`\n */\nimport type EventEmitter from \"events\"\nimport type { ESQueryOptions, Selector } from \"esquery\"\nimport esquery from \"esquery\"\nimport { memoize } from \"../utils/memoize\"\nimport { union, intersection } from \"../utils/utils\"\nimport type { Node } from \"../ast/index\"\n\ninterface NodeSelector {\n    rawSelector: string\n    isExit: boolean\n    parsedSelector: Selector\n    listenerTypes: string[] | null\n    attributeCount: number\n    identifierCount: number\n}\n\n/**\n * Gets the possible types of a selector\n * @param parsedSelector An object (from esquery) describing the matching behavior of the selector\n * @returns The node types that could possibly trigger this selector, or `null` if all node types could trigger it\n */\nfunction getPossibleTypes(parsedSelector: Selector): string[] | null {\n    switch (parsedSelector.type) {\n        case \"identifier\":\n            return [parsedSelector.value]\n\n        case \"matches\": {\n            const typesForComponents =\n                parsedSelector.selectors.map(getPossibleTypes)\n\n            if (typesForComponents.every(Boolean)) {\n                return union(...(typesForComponents as string[][]))\n            }\n            return null\n        }\n\n        case \"compound\": {\n            const typesForComponents = parsedSelector.selectors\n                .map(getPossibleTypes)\n                .filter(Boolean) as string[][]\n\n            // If all of the components could match any type, then the compound could also match any type.\n            if (!typesForComponents.length) {\n                return null\n            }\n\n            // If at least one of the components could only match a particular type, the compound could only match\n            // the intersection of those types.\n            return intersection(...typesForComponents)\n        }\n\n        case \"child\":\n        case \"descendant\":\n        case \"sibling\":\n        case \"adjacent\":\n            return getPossibleTypes(parsedSelector.right)\n\n        default:\n            return null\n    }\n}\n\n/**\n * Counts the number of class, pseudo-class, and attribute queries in this selector\n * @param parsedSelector An object (from esquery) describing the selector's matching behavior\n * @returns The number of class, pseudo-class, and attribute queries in this selector\n */\nfunction countClassAttributes(parsedSelector: Selector): number {\n    switch (parsedSelector.type) {\n        case \"child\":\n        case \"descendant\":\n        case \"sibling\":\n        case \"adjacent\":\n            return (\n                countClassAttributes(parsedSelector.left) +\n                countClassAttributes(parsedSelector.right)\n            )\n\n        case \"compound\":\n        case \"not\":\n        case \"matches\":\n            return parsedSelector.selectors.reduce(\n                (sum, childSelector) =>\n                    sum + countClassAttributes(childSelector),\n                0,\n            )\n\n        case \"attribute\":\n        case \"field\":\n        case \"nth-child\":\n        case \"nth-last-child\":\n            return 1\n\n        default:\n            return 0\n    }\n}\n\n/**\n * Counts the number of identifier queries in this selector\n * @param parsedSelector An object (from esquery) describing the selector's matching behavior\n * @returns The number of identifier queries\n */\nfunction countIdentifiers(parsedSelector: Selector): number {\n    switch (parsedSelector.type) {\n        case \"child\":\n        case \"descendant\":\n        case \"sibling\":\n        case \"adjacent\":\n            return (\n                countIdentifiers(parsedSelector.left) +\n                countIdentifiers(parsedSelector.right)\n            )\n\n        case \"compound\":\n        case \"not\":\n        case \"matches\":\n            return parsedSelector.selectors.reduce(\n                (sum, childSelector) => sum + countIdentifiers(childSelector),\n                0,\n            )\n\n        case \"identifier\":\n            return 1\n\n        default:\n            return 0\n    }\n}\n\n/**\n * Compares the specificity of two selector objects, with CSS-like rules.\n * @param selectorA An AST selector descriptor\n * @param selectorB Another AST selector descriptor\n * @returns\n * a value less than 0 if selectorA is less specific than selectorB\n * a value greater than 0 if selectorA is more specific than selectorB\n * a value less than 0 if selectorA and selectorB have the same specificity, and selectorA <= selectorB alphabetically\n * a value greater than 0 if selectorA and selectorB have the same specificity, and selectorA > selectorB alphabetically\n */\nfunction compareSpecificity(\n    selectorA: NodeSelector,\n    selectorB: NodeSelector,\n): number {\n    return (\n        selectorA.attributeCount - selectorB.attributeCount ||\n        selectorA.identifierCount - selectorB.identifierCount ||\n        (selectorA.rawSelector <= selectorB.rawSelector ? -1 : 1)\n    )\n}\n\n/**\n * Parses a raw selector string, and throws a useful error if parsing fails.\n * @param rawSelector A raw AST selector\n * @returns An object (from esquery) describing the matching behavior of this selector\n * @throws An error if the selector is invalid\n */\nfunction tryParseSelector(rawSelector: string): Selector {\n    try {\n        return esquery.parse(rawSelector.replace(/:exit$/u, \"\"))\n    } catch (err: any) {\n        if (typeof err.offset === \"number\") {\n            throw new Error(\n                `Syntax error in selector \"${rawSelector}\" at position ${err.offset}: ${err.message}`,\n            )\n        }\n        throw err\n    }\n}\n\n/**\n * Parses a raw selector string, and returns the parsed selector along with specificity and type information.\n * @param {string} rawSelector A raw AST selector\n * @returns {ASTSelector} A selector descriptor\n */\nconst parseSelector = memoize<(rawSelector: string) => NodeSelector>(\n    (rawSelector) => {\n        const parsedSelector = tryParseSelector(rawSelector)\n\n        return {\n            rawSelector,\n            isExit: rawSelector.endsWith(\":exit\"),\n            parsedSelector,\n            listenerTypes: getPossibleTypes(parsedSelector),\n            attributeCount: countClassAttributes(parsedSelector),\n            identifierCount: countIdentifiers(parsedSelector),\n        }\n    },\n)\n\n//------------------------------------------------------------------------------\n// Public Interface\n//------------------------------------------------------------------------------\n\n/**\n * The event generator for AST nodes.\n * This implements below interface.\n *\n * ```ts\n * interface EventGenerator {\n *     emitter: EventEmitter\n *     enterNode(node: ASTNode): void\n *     leaveNode(node: ASTNode): void\n * }\n * ```\n */\nexport default class NodeEventGenerator {\n    public emitter: EventEmitter\n    public esqueryOptions: ESQueryOptions\n\n    private currentAncestry: Node[]\n    private enterSelectorsByNodeType: Map<string, NodeSelector[]>\n    private exitSelectorsByNodeType: Map<string, NodeSelector[]>\n    private anyTypeEnterSelectors: NodeSelector[]\n    private anyTypeExitSelectors: NodeSelector[]\n\n    /**\n     * @param emitter - An event emitter which is the destination of events. This emitter must already\n     * have registered listeners for all of the events that it needs to listen for.\n     */\n    public constructor(emitter: EventEmitter, esqueryOptions: ESQueryOptions) {\n        this.emitter = emitter\n        this.esqueryOptions = esqueryOptions\n        this.currentAncestry = []\n        this.enterSelectorsByNodeType = new Map()\n        this.exitSelectorsByNodeType = new Map()\n        this.anyTypeEnterSelectors = []\n        this.anyTypeExitSelectors = []\n\n        const eventNames =\n            typeof emitter.eventNames === \"function\"\n                ? // Use the built-in eventNames() function if available (Node 6+)\n                  emitter.eventNames()\n                : /*\n                   * Otherwise, use the private _events property.\n                   * Using a private property isn't ideal here, but this seems to\n                   * be the best way to get a list of event names without overriding\n                   * addEventListener, which would hurt performance. This property\n                   * is widely used and unlikely to be removed in a future version\n                   * (see https://github.com/nodejs/node/issues/1817). Also, future\n                   * node versions will have eventNames() anyway.\n                   */\n                  Object.keys((emitter as any)._events)\n\n        for (const rawSelector of eventNames) {\n            if (typeof rawSelector === \"symbol\") {\n                continue\n            }\n            const selector = parseSelector(rawSelector)\n\n            if (selector.listenerTypes) {\n                for (const nodeType of selector.listenerTypes) {\n                    const typeMap = selector.isExit\n                        ? this.exitSelectorsByNodeType\n                        : this.enterSelectorsByNodeType\n\n                    let selectors = typeMap.get(nodeType)\n                    if (selectors == null) {\n                        typeMap.set(nodeType, (selectors = []))\n                    }\n                    selectors.push(selector)\n                }\n            } else {\n                ;(selector.isExit\n                    ? this.anyTypeExitSelectors\n                    : this.anyTypeEnterSelectors\n                ).push(selector)\n            }\n        }\n\n        this.anyTypeEnterSelectors.sort(compareSpecificity)\n        this.anyTypeExitSelectors.sort(compareSpecificity)\n        for (const selectorList of this.enterSelectorsByNodeType.values()) {\n            selectorList.sort(compareSpecificity)\n        }\n        for (const selectorList of this.exitSelectorsByNodeType.values()) {\n            selectorList.sort(compareSpecificity)\n        }\n    }\n\n    /**\n     * Checks a selector against a node, and emits it if it matches\n     * @param node The node to check\n     * @param selector An AST selector descriptor\n     */\n    private applySelector(node: Node, selector: NodeSelector): void {\n        if (\n            esquery.matches(\n                node,\n                selector.parsedSelector,\n                this.currentAncestry,\n                this.esqueryOptions,\n            )\n        ) {\n            this.emitter.emit(selector.rawSelector, node)\n        }\n    }\n\n    /**\n     * Applies all appropriate selectors to a node, in specificity order\n     * @param node The node to check\n     * @param isExit `false` if the node is currently being entered, `true` if it's currently being exited\n     */\n    private applySelectors(node: Node, isExit: boolean): void {\n        const selectorsByNodeType =\n            (isExit\n                ? this.exitSelectorsByNodeType\n                : this.enterSelectorsByNodeType\n            ).get(node.type) || []\n        const anyTypeSelectors = isExit\n            ? this.anyTypeExitSelectors\n            : this.anyTypeEnterSelectors\n\n        // selectorsByNodeType and anyTypeSelectors were already sorted by specificity in the constructor.\n        // Iterate through each of them, applying selectors in the right order.\n        let selectorsByTypeIndex = 0\n        let anyTypeSelectorsIndex = 0\n\n        while (\n            selectorsByTypeIndex < selectorsByNodeType.length ||\n            anyTypeSelectorsIndex < anyTypeSelectors.length\n        ) {\n            if (\n                selectorsByTypeIndex >= selectorsByNodeType.length ||\n                (anyTypeSelectorsIndex < anyTypeSelectors.length &&\n                    compareSpecificity(\n                        anyTypeSelectors[anyTypeSelectorsIndex],\n                        selectorsByNodeType[selectorsByTypeIndex],\n                    ) < 0)\n            ) {\n                this.applySelector(\n                    node,\n                    anyTypeSelectors[anyTypeSelectorsIndex++],\n                )\n            } else {\n                this.applySelector(\n                    node,\n                    selectorsByNodeType[selectorsByTypeIndex++],\n                )\n            }\n        }\n    }\n\n    /**\n     * Emits an event of entering AST node.\n     * @param node - A node which was entered.\n     */\n    public enterNode(node: Node): void {\n        if (node.parent) {\n            this.currentAncestry.unshift(node.parent)\n        }\n        this.applySelectors(node, false)\n    }\n\n    /**\n     * Emits an event of leaving AST node.\n     * @param node - A node which was left.\n     */\n    public leaveNode(node: Node): void {\n        this.applySelectors(node, true)\n        this.currentAncestry.shift()\n    }\n}\n","/**\n * @fileoverview Define utilify functions for token store.\n * @author Toru Nagashima\n */\nimport { sortedIndexBy } from \"../../utils/utils\"\nimport type { HasLocation } from \"../../ast/index\"\n\n/**\n * Gets `token.range[0]` from the given token.\n *\n * @param token - The token to get.\n * @returns The start location.\n * @private\n */\nfunction getStartLocation(token: { range: number[] }): number {\n    return token.range[0]\n}\n\n/**\n * Binary-searches the index of the first token which is after the given location.\n * If it was not found, this returns `tokens.length`.\n *\n * @param tokens - It searches the token in this list.\n * @param location - The location to search.\n * @returns The found index or `tokens.length`.\n */\nexport function search(tokens: HasLocation[], location: number): number {\n    return sortedIndexBy(\n        tokens as { range: number[] }[],\n        { range: [location] },\n        getStartLocation,\n    )\n}\n\n/**\n * Gets the index of the `startLoc` in `tokens`.\n * `startLoc` can be the value of `node.range[1]`, so this checks about `startLoc - 1` as well.\n *\n * @param tokens - The tokens to find an index.\n * @param indexMap - The map from locations to indices.\n * @param startLoc - The location to get an index.\n * @returns The index.\n */\nexport function getFirstIndex(\n    tokens: HasLocation[],\n    indexMap: { [key: number]: number },\n    startLoc: number,\n): number {\n    if (startLoc in indexMap) {\n        return indexMap[startLoc]\n    }\n    if (startLoc - 1 in indexMap) {\n        const index = indexMap[startLoc - 1]\n        const token = index >= 0 && index < tokens.length ? tokens[index] : null\n\n        // For the map of \"comment's location -> token's index\", it points the next token of a comment.\n        // In that case, +1 is unnecessary.\n        if (token && token.range[0] >= startLoc) {\n            return index\n        }\n        return index + 1\n    }\n    return 0\n}\n\n/**\n * Gets the index of the `endLoc` in `tokens`.\n * The information of end locations are recorded at `endLoc - 1` in `indexMap`, so this checks about `endLoc - 1` as well.\n *\n * @param tokens - The tokens to find an index.\n * @param indexMap - The map from locations to indices.\n * @param endLoc - The location to get an index.\n * @returns The index.\n */\nexport function getLastIndex(\n    tokens: HasLocation[],\n    indexMap: { [key: number]: number },\n    endLoc: number,\n): number {\n    if (endLoc in indexMap) {\n        return indexMap[endLoc] - 1\n    }\n    if (endLoc - 1 in indexMap) {\n        const index = indexMap[endLoc - 1]\n        const token = index >= 0 && index < tokens.length ? tokens[index] : null\n\n        // For the map of \"comment's location -> token's index\", it points the next token of a comment.\n        // In that case, -1 is necessary.\n        if (token && token.range[1] > endLoc) {\n            return index - 1\n        }\n        return index\n    }\n    return tokens.length - 1\n}\n","/**\n * @fileoverview Define the abstract class about cursors which iterate tokens.\n * @author Toru Nagashima\n */\nimport type { Token } from \"../../../ast/index\"\n\n/**\n * The abstract class about cursors which iterate tokens.\n *\n * This class has 2 abstract methods.\n *\n * - `current: Token | Comment | null` ... The current token.\n * - `moveNext(): boolean` ... Moves this cursor to the next token. If the next token didn't exist, it returns `false`.\n *\n * This is similar to ES2015 Iterators.\n * However, Iterators were slow (at 2017-01), so I created this class as similar to C# IEnumerable.\n *\n * There are the following known sub classes.\n *\n * - ForwardTokenCursor .......... The cursor which iterates tokens only.\n * - BackwardTokenCursor ......... The cursor which iterates tokens only in reverse.\n * - ForwardTokenCommentCursor ... The cursor which iterates tokens and comments.\n * - BackwardTokenCommentCursor .. The cursor which iterates tokens and comments in reverse.\n * - DecorativeCursor\n *     - FilterCursor ............ The cursor which ignores the specified tokens.\n *     - SkipCursor .............. The cursor which ignores the first few tokens.\n *     - LimitCursor ............. The cursor which limits the count of tokens.\n *\n */\nexport default abstract class Cursor {\n    public current: Token | null\n\n    /**\n     * Initializes this cursor.\n     */\n    public constructor() {\n        this.current = null\n    }\n\n    /**\n     * Gets the first token.\n     * This consumes this cursor.\n     * @returns The first token or null.\n     */\n    public getOneToken(): Token | null {\n        return this.moveNext() ? this.current : null\n    }\n\n    /**\n     * Gets the first tokens.\n     * This consumes this cursor.\n     * @returns All tokens.\n     */\n    public getAllTokens(): Token[] {\n        const tokens: Token[] = []\n\n        while (this.moveNext()) {\n            tokens.push(this.current as Token)\n        }\n\n        return tokens\n    }\n\n    /**\n     * Moves this cursor to the next token.\n     * @returns {boolean} `true` if the next token exists.\n     * @abstract\n     */\n    public abstract moveNext(): boolean\n}\n","/**\n * @fileoverview Define the cursor which iterates tokens and comments in reverse.\n * @author Toru Nagashima\n */\nimport type { Token } from \"../../../ast/index\"\nimport { getLastIndex, search } from \"../utils\"\nimport Cursor from \"./cursor\"\n\n/**\n * The cursor which iterates tokens and comments in reverse.\n */\nexport default class BackwardTokenCommentCursor extends Cursor {\n    private tokens: Token[]\n    private comments: Token[]\n    private tokenIndex: number\n    private commentIndex: number\n    private border: number\n\n    /**\n     * Initializes this cursor.\n     * @param tokens - The array of tokens.\n     * @param comments - The array of comments.\n     * @param indexMap - The map from locations to indices in `tokens`.\n     * @param startLoc - The start location of the iteration range.\n     * @param endLoc - The end location of the iteration range.\n     */\n    public constructor(\n        tokens: Token[],\n        comments: Token[],\n        indexMap: { [key: number]: number },\n        startLoc: number,\n        endLoc: number,\n    ) {\n        super()\n        this.tokens = tokens\n        this.comments = comments\n        this.tokenIndex = getLastIndex(tokens, indexMap, endLoc)\n        this.commentIndex = search(comments, endLoc) - 1\n        this.border = startLoc\n    }\n\n    /** @inheritdoc */\n    public moveNext(): boolean {\n        const token = this.tokenIndex >= 0 ? this.tokens[this.tokenIndex] : null\n        const comment =\n            this.commentIndex >= 0 ? this.comments[this.commentIndex] : null\n\n        if (token && (!comment || token.range[1] > comment.range[1])) {\n            this.current = token\n            this.tokenIndex -= 1\n        } else if (comment) {\n            this.current = comment\n            this.commentIndex -= 1\n        } else {\n            this.current = null\n        }\n\n        return (\n            this.current != null &&\n            (this.border === -1 || this.current.range[0] >= this.border)\n        )\n    }\n}\n","/**\n * @fileoverview Define the cursor which iterates tokens only in reverse.\n * @author Toru Nagashima\n */\nimport type { Token } from \"../../../ast/index\"\nimport { getFirstIndex, getLastIndex } from \"../utils\"\nimport Cursor from \"./cursor\"\n\n/**\n * The cursor which iterates tokens only in reverse.\n */\nexport default class BackwardTokenCursor extends Cursor {\n    private tokens: Token[]\n    private index: number\n    private indexEnd: number\n\n    /**\n     * Initializes this cursor.\n     * @param tokens - The array of tokens.\n     * @param comments - The array of comments.\n     * @param indexMap - The map from locations to indices in `tokens`.\n     * @param startLoc - The start location of the iteration range.\n     * @param endLoc - The end location of the iteration range.\n     */\n    public constructor(\n        tokens: Token[],\n        _comments: Token[],\n        indexMap: { [key: number]: number },\n        startLoc: number,\n        endLoc: number,\n    ) {\n        super()\n        this.tokens = tokens\n        this.index = getLastIndex(tokens, indexMap, endLoc)\n        this.indexEnd = getFirstIndex(tokens, indexMap, startLoc)\n    }\n\n    /** @inheritdoc */\n    public moveNext(): boolean {\n        if (this.index >= this.indexEnd) {\n            this.current = this.tokens[this.index]\n            this.index -= 1\n            return true\n        }\n        return false\n    }\n\n    //\n    // Shorthand for performance.\n    //\n\n    /** @inheritdoc */\n    public getOneToken(): Token | null {\n        return this.index >= this.indexEnd ? this.tokens[this.index] : null\n    }\n}\n","/**\n * @fileoverview Define the abstract class about cursors which manipulate another cursor.\n * @author Toru Nagashima\n */\nimport Cursor from \"./cursor\"\n\n//------------------------------------------------------------------------------\n// Exports\n//------------------------------------------------------------------------------\n\n/**\n * The abstract class about cursors which manipulate another cursor.\n */\nexport default class DecorativeCursor extends Cursor {\n    protected cursor: Cursor\n\n    /**\n     * Initializes this cursor.\n     * @param cursor - The cursor to be decorated.\n     */\n    public constructor(cursor: Cursor) {\n        super()\n        this.cursor = cursor\n    }\n\n    /** @inheritdoc */\n    public moveNext(): boolean {\n        const retv = this.cursor.moveNext()\n\n        this.current = this.cursor.current\n\n        return retv\n    }\n}\n","/**\n * @fileoverview Define the cursor which ignores specified tokens.\n * @author Toru Nagashima\n */\nimport type { Token } from \"../../../ast/index\"\nimport type Cursor from \"./cursor\"\nimport DecorativeCursor from \"./decorative-cursor\"\n\n/**\n * The decorative cursor which ignores specified tokens.\n */\nexport default class FilterCursor extends DecorativeCursor {\n    private predicate: (token: Token) => boolean\n\n    /**\n     * Initializes this cursor.\n     * @param cursor - The cursor to be decorated.\n     * @param predicate - The predicate function to decide tokens this cursor iterates.\n     */\n    public constructor(cursor: Cursor, predicate: (token: Token) => boolean) {\n        super(cursor)\n        this.predicate = predicate\n    }\n\n    /** @inheritdoc */\n    public moveNext(): boolean {\n        const predicate = this.predicate\n\n        while (super.moveNext()) {\n            if (predicate(this.current as Token)) {\n                return true\n            }\n        }\n        return false\n    }\n}\n","/**\n * @fileoverview Define the cursor which iterates tokens and comments.\n * @author Toru Nagashima\n */\nimport type { Token } from \"../../../ast/index\"\nimport { getFirstIndex, search } from \"../utils\"\nimport Cursor from \"./cursor\"\n\n/**\n * The cursor which iterates tokens and comments.\n */\nexport default class ForwardTokenCommentCursor extends Cursor {\n    private tokens: Token[]\n    private comments: Token[]\n    private tokenIndex: number\n    private commentIndex: number\n    private border: number\n\n    /**\n     * Initializes this cursor.\n     * @param tokens - The array of tokens.\n     * @param comments - The array of comments.\n     * @param indexMap - The map from locations to indices in `tokens`.\n     * @param startLoc - The start location of the iteration range.\n     * @param endLoc - The end location of the iteration range.\n     */\n    public constructor(\n        tokens: Token[],\n        comments: Token[],\n        indexMap: { [key: number]: number },\n        startLoc: number,\n        endLoc: number,\n    ) {\n        super()\n        this.tokens = tokens\n        this.comments = comments\n        this.tokenIndex = getFirstIndex(tokens, indexMap, startLoc)\n        this.commentIndex = search(comments, startLoc)\n        this.border = endLoc\n    }\n\n    /** @inheritdoc */\n    public moveNext(): boolean {\n        const token =\n            this.tokenIndex < this.tokens.length\n                ? this.tokens[this.tokenIndex]\n                : null\n        const comment =\n            this.commentIndex < this.comments.length\n                ? this.comments[this.commentIndex]\n                : null\n\n        if (token && (!comment || token.range[0] < comment.range[0])) {\n            this.current = token\n            this.tokenIndex += 1\n        } else if (comment) {\n            this.current = comment\n            this.commentIndex += 1\n        } else {\n            this.current = null\n        }\n\n        return (\n            this.current != null &&\n            (this.border === -1 || this.current.range[1] <= this.border)\n        )\n    }\n}\n","/**\n * @fileoverview Define the cursor which iterates tokens only.\n * @author Toru Nagashima\n */\nimport type { Token } from \"../../../ast/index\"\nimport { getFirstIndex, getLastIndex } from \"../utils\"\nimport Cursor from \"./cursor\"\n\n/**\n * The cursor which iterates tokens only.\n */\nexport default class ForwardTokenCursor extends Cursor {\n    private tokens: Token[]\n    protected index: number\n    protected indexEnd: number\n\n    /**\n     * Initializes this cursor.\n     * @param tokens - The array of tokens.\n     * @param comments - The array of comments.\n     * @param indexMap - The map from locations to indices in `tokens`.\n     * @param startLoc - The start location of the iteration range.\n     * @param endLoc - The end location of the iteration range.\n     */\n    public constructor(\n        tokens: Token[],\n        _comments: Token[],\n        indexMap: { [key: number]: number },\n        startLoc: number,\n        endLoc: number,\n    ) {\n        super()\n        this.tokens = tokens\n        this.index = getFirstIndex(tokens, indexMap, startLoc)\n        this.indexEnd = getLastIndex(tokens, indexMap, endLoc)\n    }\n\n    /** @inheritdoc */\n    public moveNext(): boolean {\n        if (this.index <= this.indexEnd) {\n            this.current = this.tokens[this.index]\n            this.index += 1\n            return true\n        }\n        return false\n    }\n\n    //\n    // Shorthand for performance.\n    //\n\n    /** @inheritdoc */\n    public getOneToken(): Token | null {\n        return this.index <= this.indexEnd ? this.tokens[this.index] : null\n    }\n\n    /** @inheritdoc */\n    public getAllTokens(): Token[] {\n        return this.tokens.slice(this.index, this.indexEnd + 1)\n    }\n}\n","/**\n * @fileoverview Define the cursor which limits the number of tokens.\n * @author Toru Nagashima\n */\nimport type Cursor from \"./cursor\"\nimport DecorativeCursor from \"./decorative-cursor\"\n\n/**\n * The decorative cursor which limits the number of tokens.\n */\nexport default class LimitCursor extends DecorativeCursor {\n    private count: number\n\n    /**\n     * Initializes this cursor.\n     * @param cursor - The cursor to be decorated.\n     * @param count - The count of tokens this cursor iterates.\n     */\n    public constructor(cursor: Cursor, count: number) {\n        super(cursor)\n        this.count = count\n    }\n\n    /** @inheritdoc */\n    public moveNext(): boolean {\n        if (this.count > 0) {\n            this.count -= 1\n            return super.moveNext()\n        }\n        return false\n    }\n}\n","/**\n * @fileoverview Define the cursor which ignores the first few tokens.\n * @author Toru Nagashima\n */\nimport type Cursor from \"./cursor\"\nimport DecorativeCursor from \"./decorative-cursor\"\n\n/**\n * The decorative cursor which ignores the first few tokens.\n */\nexport default class SkipCursor extends DecorativeCursor {\n    private count: number\n\n    /**\n     * Initializes this cursor.\n     * @param cursor - The cursor to be decorated.\n     * @param count - The count of tokens this cursor skips.\n     */\n    public constructor(cursor: Cursor, count: number) {\n        super(cursor)\n        this.count = count\n    }\n\n    /** @inheritdoc */\n    public moveNext(): boolean {\n        while (this.count > 0) {\n            this.count -= 1\n            if (!super.moveNext()) {\n                return false\n            }\n        }\n        return super.moveNext()\n    }\n}\n","/**\n * @fileoverview Define 2 token factories; forward and backward.\n * @author Toru Nagashima\n */\nimport type { Token } from \"../../../ast/index\"\nimport BackwardTokenCommentCursor from \"./backward-token-comment-cursor\"\nimport BackwardTokenCursor from \"./backward-token-cursor\"\nimport type Cursor from \"./cursor\"\nimport FilterCursor from \"./filter-cursor\"\nimport ForwardTokenCommentCursor from \"./forward-token-comment-cursor\"\nimport ForwardTokenCursor from \"./forward-token-cursor\"\nimport LimitCursor from \"./limit-cursor\"\nimport SkipCursor from \"./skip-cursor\"\n\n/**\n * The cursor factory.\n * @private\n */\nexport class CursorFactory {\n    private TokenCursor: typeof BackwardTokenCursor | typeof ForwardTokenCursor\n    private TokenCommentCursor:\n        | typeof BackwardTokenCommentCursor\n        | typeof ForwardTokenCommentCursor\n\n    /**\n     * Initializes this cursor.\n     * @param TokenCursor - The class of the cursor which iterates tokens only.\n     * @param TokenCommentCursor - The class of the cursor which iterates the mix of tokens and comments.\n     */\n    public constructor(\n        TokenCursor: typeof BackwardTokenCursor | typeof ForwardTokenCursor,\n        TokenCommentCursor:\n            | typeof BackwardTokenCommentCursor\n            | typeof ForwardTokenCommentCursor,\n    ) {\n        this.TokenCursor = TokenCursor\n        this.TokenCommentCursor = TokenCommentCursor\n    }\n\n    /**\n     * Creates a base cursor instance that can be decorated by createCursor.\n     *\n     * @param tokens - The array of tokens.\n     * @param comments - The array of comments.\n     * @param indexMap - The map from locations to indices in `tokens`.\n     * @param startLoc - The start location of the iteration range.\n     * @param endLoc - The end location of the iteration range.\n     * @param includeComments - The flag to iterate comments as well.\n     * @returns The created base cursor.\n     */\n    public createBaseCursor(\n        tokens: Token[],\n        comments: Token[],\n        indexMap: { [key: number]: number },\n        startLoc: number,\n        endLoc: number,\n        includeComments: boolean,\n    ): Cursor {\n        const TokenCursor = includeComments\n            ? this.TokenCommentCursor\n            : this.TokenCursor\n        return new TokenCursor(tokens, comments, indexMap, startLoc, endLoc)\n    }\n\n    /**\n     * Creates a cursor that iterates tokens with normalized options.\n     *\n     * @param tokens - The array of tokens.\n     * @param comments - The array of comments.\n     * @param indexMap - The map from locations to indices in `tokens`.\n     * @param startLoc - The start location of the iteration range.\n     * @param endLoc - The end location of the iteration range.\n     * @param includeComments - The flag to iterate comments as well.\n     * @param filter - The predicate function to choose tokens.\n     * @param skip - The count of tokens the cursor skips.\n     * @param count - The maximum count of tokens the cursor iterates. Zero is no iteration for backward compatibility.\n     * @returns The created cursor.\n     */\n    // eslint-disable-next-line max-params\n    public createCursor(\n        tokens: Token[],\n        comments: Token[],\n        indexMap: { [key: number]: number },\n        startLoc: number,\n        endLoc: number,\n        includeComments: boolean,\n        filter: ((token: Token) => boolean) | null,\n        skip: number,\n        count: number,\n    ): Cursor {\n        let cursor = this.createBaseCursor(\n            tokens,\n            comments,\n            indexMap,\n            startLoc,\n            endLoc,\n            includeComments,\n        )\n\n        if (filter) {\n            cursor = new FilterCursor(cursor, filter)\n        }\n        if (skip >= 1) {\n            cursor = new SkipCursor(cursor, skip)\n        }\n        if (count >= 0) {\n            cursor = new LimitCursor(cursor, count)\n        }\n\n        return cursor\n    }\n}\n\nexport const forward = new CursorFactory(\n    ForwardTokenCursor,\n    ForwardTokenCommentCursor,\n)\nexport const backward = new CursorFactory(\n    BackwardTokenCursor,\n    BackwardTokenCommentCursor,\n)\n","/**\n * @fileoverview Define the cursor which iterates tokens only, with inflated range.\n * @author Toru Nagashima\n */\nimport type { Token } from \"../../../ast/index\"\nimport ForwardTokenCursor from \"./forward-token-cursor\"\n\n/**\n * The cursor which iterates tokens only, with inflated range.\n * This is for the backward compatibility of padding options.\n */\nexport default class PaddedTokenCursor extends ForwardTokenCursor {\n    /**\n     * Initializes this cursor.\n     * @param tokens - The array of tokens.\n     * @param comments - The array of comments.\n     * @param indexMap - The map from locations to indices in `tokens`.\n     * @param startLoc - The start location of the iteration range.\n     * @param endLoc - The end location of the iteration range.\n     * @param beforeCount - The number of tokens this cursor iterates before start.\n     * @param afterCount - The number of tokens this cursor iterates after end.\n     */\n    public constructor(\n        tokens: Token[],\n        comments: Token[],\n        indexMap: { [key: number]: number },\n        startLoc: number,\n        endLoc: number,\n        beforeCount: number,\n        afterCount: number,\n    ) {\n        super(tokens, comments, indexMap, startLoc, endLoc)\n        this.index = Math.max(0, this.index - beforeCount)\n        this.indexEnd = Math.min(tokens.length - 1, this.indexEnd + afterCount)\n    }\n}\n","/**\n * @fileoverview Object to handle access and retrieval of tokens.\n * @author Brandon Mills\n */\nimport assert from \"assert\"\nimport type { HasLocation, Token } from \"../../ast/index\"\nimport * as cursors from \"./cursors/index\"\nimport type Cursor from \"./cursors/cursor\"\nimport ForwardTokenCursor from \"./cursors/forward-token-cursor\"\nimport PaddedTokenCursor from \"./cursors/padded-token-cursor\"\nimport { search } from \"./utils\"\n\nexport type SkipOptions =\n    | number\n    | ((token: Token) => boolean)\n    | {\n          includeComments?: boolean\n          filter?: (token: Token) => boolean\n          skip?: number\n      }\nexport type CountOptions =\n    | number\n    | ((token: Token) => boolean)\n    | {\n          includeComments?: boolean\n          filter?: (token: Token) => boolean\n          count?: number\n      }\n\n/**\n * Check whether the given token is a comment token or not.\n * @param token The token to check.\n * @returns `true` if the token is a comment token.\n */\nfunction isCommentToken(token: Token): boolean {\n    return (\n        token.type === \"Line\" ||\n        token.type === \"Block\" ||\n        token.type === \"Shebang\"\n    )\n}\n\n/**\n * Creates the map from locations to indices in `tokens`.\n *\n * The first/last location of tokens is mapped to the index of the token.\n * The first/last location of comments is mapped to the index of the next token of each comment.\n *\n * @param tokens - The array of tokens.\n * @param comments - The array of comments.\n * @returns The map from locations to indices in `tokens`.\n * @private\n */\nfunction createIndexMap(\n    tokens: Token[],\n    comments: Token[],\n): { [key: number]: number } {\n    const map = Object.create(null)\n    let tokenIndex = 0\n    let commentIndex = 0\n    let nextStart = 0\n    let range: [number, number] | null = null\n\n    while (tokenIndex < tokens.length || commentIndex < comments.length) {\n        nextStart =\n            commentIndex < comments.length\n                ? comments[commentIndex].range[0]\n                : Number.MAX_SAFE_INTEGER\n        while (\n            tokenIndex < tokens.length &&\n            (range = tokens[tokenIndex].range)[0] < nextStart\n        ) {\n            map[range[0]] = tokenIndex\n            map[range[1] - 1] = tokenIndex\n            tokenIndex += 1\n        }\n\n        nextStart =\n            tokenIndex < tokens.length\n                ? tokens[tokenIndex].range[0]\n                : Number.MAX_SAFE_INTEGER\n        while (\n            commentIndex < comments.length &&\n            (range = comments[commentIndex].range)[0] < nextStart\n        ) {\n            map[range[0]] = tokenIndex\n            map[range[1] - 1] = tokenIndex\n            commentIndex += 1\n        }\n    }\n\n    return map\n}\n\n/**\n * Creates the cursor iterates tokens with options.\n *\n * @param factory - The cursor factory to initialize cursor.\n * @param tokens - The array of tokens.\n * @param comments - The array of comments.\n * @param indexMap - The map from locations to indices in `tokens`.\n * @param startLoc - The start location of the iteration range.\n * @param endLoc - The end location of the iteration range.\n * @param opts - The option object. If this is a number then it's `opts.skip`. If this is a function then it's `opts.filter`.\n * @returns The created cursor.\n * @private\n */\nfunction createCursorWithSkip(\n    factory: cursors.CursorFactory,\n    tokens: Token[],\n    comments: Token[],\n    indexMap: { [key: number]: number },\n    startLoc: number,\n    endLoc: number,\n    opts?: SkipOptions,\n): Cursor {\n    let includeComments = false\n    let skip = 0\n    let filter: ((token: Token) => boolean) | null = null\n\n    if (typeof opts === \"number\") {\n        skip = opts | 0\n    } else if (typeof opts === \"function\") {\n        filter = opts\n    } else if (opts) {\n        includeComments = Boolean(opts.includeComments)\n        skip = opts.skip || 0\n        filter = opts.filter || null\n    }\n    assert(skip >= 0, \"options.skip should be zero or a positive integer.\")\n    assert(\n        !filter || typeof filter === \"function\",\n        \"options.filter should be a function.\",\n    )\n\n    return factory.createCursor(\n        tokens,\n        comments,\n        indexMap,\n        startLoc,\n        endLoc,\n        includeComments,\n        filter,\n        skip,\n        -1,\n    )\n}\n\n/**\n * Creates the cursor iterates tokens with options.\n *\n * @param factory - The cursor factory to initialize cursor.\n * @param tokens - The array of tokens.\n * @param comments - The array of comments.\n * @param indexMap - The map from locations to indices in `tokens`.\n * @param startLoc - The start location of the iteration range.\n * @param endLoc - The end location of the iteration range.\n * @param opts - The option object. If this is a number then it's `opts.count`. If this is a function then it's `opts.filter`.\n * @returns The created cursor.\n * @private\n */\nfunction createCursorWithCount(\n    factory: cursors.CursorFactory,\n    tokens: Token[],\n    comments: Token[],\n    indexMap: { [key: number]: number },\n    startLoc: number,\n    endLoc: number,\n    opts?: CountOptions,\n): Cursor {\n    let includeComments = false\n    let count = 0\n    let countExists = false\n    let filter: ((token: Token) => boolean) | null = null\n\n    if (typeof opts === \"number\") {\n        count = opts | 0\n        countExists = true\n    } else if (typeof opts === \"function\") {\n        filter = opts\n    } else if (opts) {\n        includeComments = Boolean(opts.includeComments)\n        count = opts.count || 0\n        countExists = typeof opts.count === \"number\"\n        filter = opts.filter || null\n    }\n    assert(count >= 0, \"options.count should be zero or a positive integer.\")\n    assert(\n        !filter || typeof filter === \"function\",\n        \"options.filter should be a function.\",\n    )\n\n    return factory.createCursor(\n        tokens,\n        comments,\n        indexMap,\n        startLoc,\n        endLoc,\n        includeComments,\n        filter,\n        0,\n        countExists ? count : -1,\n    )\n}\n\n/**\n * Creates the cursor iterates tokens with options.\n *\n * @param tokens - The array of tokens.\n * @param comments - The array of comments.\n * @param indexMap - The map from locations to indices in `tokens`.\n * @param startLoc - The start location of the iteration range.\n * @param endLoc - The end location of the iteration range.\n * @param beforeCount - The number of tokens before the node to retrieve.\n * @param afterCount - The number of tokens after the node to retrieve.\n * @returns The created cursor.\n * @private\n */\nfunction createCursorWithPadding(\n    tokens: Token[],\n    comments: Token[],\n    indexMap: { [key: number]: number },\n    startLoc: number,\n    endLoc: number,\n    beforeCount?: CountOptions,\n    afterCount?: number,\n): Cursor {\n    if (\n        typeof beforeCount === \"undefined\" &&\n        typeof afterCount === \"undefined\"\n    ) {\n        return new ForwardTokenCursor(\n            tokens,\n            comments,\n            indexMap,\n            startLoc,\n            endLoc,\n        )\n    }\n    if (typeof beforeCount === \"number\" || typeof beforeCount === \"undefined\") {\n        return new PaddedTokenCursor(\n            tokens,\n            comments,\n            indexMap,\n            startLoc,\n            endLoc,\n            beforeCount || 0,\n            afterCount || 0,\n        )\n    }\n    return createCursorWithCount(\n        cursors.forward,\n        tokens,\n        comments,\n        indexMap,\n        startLoc,\n        endLoc,\n        beforeCount,\n    )\n}\n\n/**\n * Gets comment tokens that are adjacent to the current cursor position.\n * @param cursor - A cursor instance.\n * @returns An array of comment tokens adjacent to the current cursor position.\n * @private\n */\nfunction getAdjacentCommentTokensFromCursor(cursor: Cursor): Token[] {\n    const tokens: Token[] = []\n    let currentToken = cursor.getOneToken()\n\n    while (currentToken && isCommentToken(currentToken)) {\n        tokens.push(currentToken)\n        currentToken = cursor.getOneToken()\n    }\n\n    return tokens\n}\n\n//------------------------------------------------------------------------------\n// Exports\n//------------------------------------------------------------------------------\n\n/**\n * The token store.\n *\n * This class provides methods to get tokens by locations as fast as possible.\n * The methods are a part of public API, so we should be careful if it changes this class.\n *\n * People can get tokens in O(1) by the hash map which is mapping from the location of tokens/comments to tokens.\n * Also people can get a mix of tokens and comments in O(log k), the k is the number of comments.\n * Assuming that comments to be much fewer than tokens, this does not make hash map from token's locations to comments to reduce memory cost.\n * This uses binary-searching instead for comments.\n */\nexport default class TokenStore {\n    private _tokens: Token[]\n    private _comments: Token[]\n    private _indexMap: { [key: number]: number }\n\n    /**\n     * Initializes this token store.\n     * @param tokens - The array of tokens.\n     * @param comments - The array of comments.\n     */\n    public constructor(tokens: Token[], comments: Token[]) {\n        this._tokens = tokens\n        this._comments = comments\n        this._indexMap = createIndexMap(tokens, comments)\n    }\n\n    //--------------------------------------------------------------------------\n    // Gets single token.\n    //--------------------------------------------------------------------------\n\n    /**\n     * Gets the token starting at the specified index.\n     * @param offset - Index of the start of the token's range.\n     * @param options - The option object.\n     * @returns The token starting at index, or null if no such token.\n     */\n    public getTokenByRangeStart(\n        offset: number,\n        options?: { includeComments: boolean },\n    ): Token | null {\n        const includeComments = Boolean(options && options.includeComments)\n        const token = cursors.forward\n            .createBaseCursor(\n                this._tokens,\n                this._comments,\n                this._indexMap,\n                offset,\n                -1,\n                includeComments,\n            )\n            .getOneToken()\n\n        if (token?.range[0] === offset) {\n            return token\n        }\n        return null\n    }\n\n    /**\n     * Gets the first token of the given node.\n     * @param node - The AST node.\n     * @param options - The option object.\n     * @returns An object representing the token.\n     */\n    public getFirstToken(\n        node: HasLocation,\n        options?: SkipOptions,\n    ): Token | null {\n        return createCursorWithSkip(\n            cursors.forward,\n            this._tokens,\n            this._comments,\n            this._indexMap,\n            node.range[0],\n            node.range[1],\n            options,\n        ).getOneToken()\n    }\n\n    /**\n     * Gets the last token of the given node.\n     * @param node - The AST node.\n     * @param options - The option object.\n     * @returns An object representing the token.\n     */\n    public getLastToken(\n        node: HasLocation,\n        options?: SkipOptions,\n    ): Token | null {\n        return createCursorWithSkip(\n            cursors.backward,\n            this._tokens,\n            this._comments,\n            this._indexMap,\n            node.range[0],\n            node.range[1],\n            options,\n        ).getOneToken()\n    }\n\n    /**\n     * Gets the token that precedes a given node or token.\n     * @param node - The AST node or token.\n     * @param options - The option object.\n     * @returns An object representing the token.\n     */\n    public getTokenBefore(\n        node: HasLocation,\n        options?: SkipOptions,\n    ): Token | null {\n        return createCursorWithSkip(\n            cursors.backward,\n            this._tokens,\n            this._comments,\n            this._indexMap,\n            -1,\n            node.range[0],\n            options,\n        ).getOneToken()\n    }\n\n    /**\n     * Gets the token that follows a given node or token.\n     * @param node - The AST node or token.\n     * @param options - The option object.\n     * @returns An object representing the token.\n     */\n    public getTokenAfter(\n        node: HasLocation,\n        options?: SkipOptions,\n    ): Token | null {\n        return createCursorWithSkip(\n            cursors.forward,\n            this._tokens,\n            this._comments,\n            this._indexMap,\n            node.range[1],\n            -1,\n            options,\n        ).getOneToken()\n    }\n\n    /**\n     * Gets the first token between two non-overlapping nodes.\n     * @param left - Node before the desired token range.\n     * @param right - Node after the desired token range.\n     * @param options - The option object.\n     * @returns An object representing the token.\n     */\n    public getFirstTokenBetween(\n        left: HasLocation,\n        right: HasLocation,\n        options?: SkipOptions,\n    ): Token | null {\n        return createCursorWithSkip(\n            cursors.forward,\n            this._tokens,\n            this._comments,\n            this._indexMap,\n            left.range[1],\n            right.range[0],\n            options,\n        ).getOneToken()\n    }\n\n    /**\n     * Gets the last token between two non-overlapping nodes.\n     * @param left Node before the desired token range.\n     * @param right Node after the desired token range.\n     * @param options - The option object.\n     * @returns An object representing the token.\n     */\n    public getLastTokenBetween(\n        left: HasLocation,\n        right: HasLocation,\n        options?: SkipOptions,\n    ): Token | null {\n        return createCursorWithSkip(\n            cursors.backward,\n            this._tokens,\n            this._comments,\n            this._indexMap,\n            left.range[1],\n            right.range[0],\n            options,\n        ).getOneToken()\n    }\n\n    /**\n     * Gets the token that precedes a given node or token in the token stream.\n     * This is defined for backward compatibility. Use `includeComments` option instead.\n     * TODO: We have a plan to remove this in a future major version.\n     * @param node The AST node or token.\n     * @param skip A number of tokens to skip.\n     * @returns An object representing the token.\n     * @deprecated\n     */\n    public getTokenOrCommentBefore(\n        node: HasLocation,\n        skip?: number,\n    ): Token | null {\n        return this.getTokenBefore(node, { includeComments: true, skip })\n    }\n\n    /**\n     * Gets the token that follows a given node or token in the token stream.\n     * This is defined for backward compatibility. Use `includeComments` option instead.\n     * TODO: We have a plan to remove this in a future major version.\n     * @param node The AST node or token.\n     * @param skip A number of tokens to skip.\n     * @returns An object representing the token.\n     * @deprecated\n     */\n    public getTokenOrCommentAfter(\n        node: HasLocation,\n        skip?: number,\n    ): Token | null {\n        return this.getTokenAfter(node, { includeComments: true, skip })\n    }\n\n    //--------------------------------------------------------------------------\n    // Gets multiple tokens.\n    //--------------------------------------------------------------------------\n\n    /**\n     * Gets the first `count` tokens of the given node.\n     * @param node - The AST node.\n     * @param [options=0] - The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.\n     * @param [options.includeComments=false] - The flag to iterate comments as well.\n     * @param [options.filter=null] - The predicate function to choose tokens.\n     * @param [options.count=0] - The maximum count of tokens the cursor iterates.\n     * @returns Tokens.\n     */\n    public getFirstTokens(node: HasLocation, options?: CountOptions): Token[] {\n        return createCursorWithCount(\n            cursors.forward,\n            this._tokens,\n            this._comments,\n            this._indexMap,\n            node.range[0],\n            node.range[1],\n            options,\n        ).getAllTokens()\n    }\n\n    /**\n     * Gets the last `count` tokens of the given node.\n     * @param node - The AST node.\n     * @param [options=0] - The option object. Same options as getFirstTokens()\n     * @returns Tokens.\n     */\n    public getLastTokens(node: HasLocation, options?: CountOptions) {\n        return createCursorWithCount(\n            cursors.backward,\n            this._tokens,\n            this._comments,\n            this._indexMap,\n            node.range[0],\n            node.range[1],\n            options,\n        )\n            .getAllTokens()\n            .reverse()\n    }\n\n    /**\n     * Gets the `count` tokens that precedes a given node or token.\n     * @param node - The AST node or token.\n     * @param [options=0] - The option object. Same options as getFirstTokens()\n     * @returns Tokens.\n     */\n    public getTokensBefore(node: HasLocation, options?: CountOptions): Token[] {\n        return createCursorWithCount(\n            cursors.backward,\n            this._tokens,\n            this._comments,\n            this._indexMap,\n            -1,\n            node.range[0],\n            options,\n        )\n            .getAllTokens()\n            .reverse()\n    }\n\n    /**\n     * Gets the `count` tokens that follows a given node or token.\n     * @param node - The AST node or token.\n     * @param [options=0] - The option object. Same options as getFirstTokens()\n     * @returns Tokens.\n     */\n    public getTokensAfter(node: HasLocation, options?: CountOptions): Token[] {\n        return createCursorWithCount(\n            cursors.forward,\n            this._tokens,\n            this._comments,\n            this._indexMap,\n            node.range[1],\n            -1,\n            options,\n        ).getAllTokens()\n    }\n\n    /**\n     * Gets the first `count` tokens between two non-overlapping nodes.\n     * @param left - Node before the desired token range.\n     * @param right - Node after the desired token range.\n     * @param [options=0] - The option object. Same options as getFirstTokens()\n     * @returns Tokens between left and right.\n     */\n    public getFirstTokensBetween(\n        left: HasLocation,\n        right: HasLocation,\n        options?: CountOptions,\n    ): Token[] {\n        return createCursorWithCount(\n            cursors.forward,\n            this._tokens,\n            this._comments,\n            this._indexMap,\n            left.range[1],\n            right.range[0],\n            options,\n        ).getAllTokens()\n    }\n\n    /**\n     * Gets the last `count` tokens between two non-overlapping nodes.\n     * @param left Node before the desired token range.\n     * @param right Node after the desired token range.\n     * @param [options=0] - The option object. Same options as getFirstTokens()\n     * @returns Tokens between left and right.\n     */\n    public getLastTokensBetween(\n        left: HasLocation,\n        right: HasLocation,\n        options?: CountOptions,\n    ): Token[] {\n        return createCursorWithCount(\n            cursors.backward,\n            this._tokens,\n            this._comments,\n            this._indexMap,\n            left.range[1],\n            right.range[0],\n            options,\n        )\n            .getAllTokens()\n            .reverse()\n    }\n\n    /**\n     * Gets all tokens that are related to the given node.\n     * @param node - The AST node.\n     * @param beforeCount - The number of tokens before the node to retrieve.\n     * @param afterCount - The number of tokens after the node to retrieve.\n     * @returns Array of objects representing tokens.\n     */\n    public getTokens(\n        node: HasLocation,\n        beforeCount?: CountOptions,\n        afterCount?: number,\n    ): Token[] {\n        return createCursorWithPadding(\n            this._tokens,\n            this._comments,\n            this._indexMap,\n            node.range[0],\n            node.range[1],\n            beforeCount,\n            afterCount,\n        ).getAllTokens()\n    }\n\n    /**\n     * Gets all of th   e tokens between two non-overlapping nodes.\n     * @param left Node before the desired token range.\n     * @param right Node after the desired token range.\n     * @param padding Number of extra tokens on either side of center.\n     * @returns Tokens between left and right.\n     */\n    public getTokensBetween(\n        left: HasLocation,\n        right: HasLocation,\n        padding?: CountOptions,\n    ): Token[] {\n        return createCursorWithPadding(\n            this._tokens,\n            this._comments,\n            this._indexMap,\n            left.range[1],\n            right.range[0],\n            padding,\n            typeof padding === \"number\" ? padding : undefined,\n        ).getAllTokens()\n    }\n\n    //--------------------------------------------------------------------------\n    // Others.\n    //--------------------------------------------------------------------------\n\n    /**\n     * Checks whether any comments exist or not between the given 2 nodes.\n     *\n     * @param left - The node to check.\n     * @param right - The node to check.\n     * @returns `true` if one or more comments exist.\n     */\n    public commentsExistBetween(\n        left: HasLocation,\n        right: HasLocation,\n    ): boolean {\n        const index = search(this._comments, left.range[1])\n\n        return (\n            index < this._comments.length &&\n            this._comments[index].range[1] <= right.range[0]\n        )\n    }\n\n    /**\n     * Gets all comment tokens directly before the given node or token.\n     * @param nodeOrToken The AST node or token to check for adjacent comment tokens.\n     * @returns An array of comments in occurrence order.\n     */\n    public getCommentsBefore(nodeOrToken: HasLocation): Token[] {\n        const cursor = createCursorWithCount(\n            cursors.backward,\n            this._tokens,\n            this._comments,\n            this._indexMap,\n            -1,\n            nodeOrToken.range[0],\n            { includeComments: true },\n        )\n\n        return getAdjacentCommentTokensFromCursor(cursor).reverse()\n    }\n\n    /**\n     * Gets all comment tokens directly after the given node or token.\n     * @param nodeOrToken The AST node or token to check for adjacent comment tokens.\n     * @returns An array of comments in occurrence order.\n     */\n    public getCommentsAfter(nodeOrToken: HasLocation): Token[] {\n        const cursor = createCursorWithCount(\n            cursors.forward,\n            this._tokens,\n            this._comments,\n            this._indexMap,\n            nodeOrToken.range[1],\n            -1,\n            { includeComments: true },\n        )\n\n        return getAdjacentCommentTokensFromCursor(cursor)\n    }\n\n    /**\n     * Gets all comment tokens inside the given node.\n     * @param node The AST node to get the comments for.\n     * @returns An array of comments in occurrence order.\n     */\n    public getCommentsInside(node: HasLocation): Token[] {\n        return this.getTokens(node, {\n            includeComments: true,\n            filter: isCommentToken,\n        })\n    }\n\n    /**\n     * Returns the location of the given node or token.\n     * @param nodeOrToken The node or token to get the location of.\n     * @returns The location of the node or token.\n     */\n    // eslint-disable-next-line class-methods-use-this\n    public getLoc(nodeOrToken: HasLocation) {\n        return nodeOrToken.loc\n    }\n\n    /**\n     * Returns the range of the given node or token.\n     * @param nodeOrToken The node or token to get the range of.\n     * @returns The range of the node or token.\n     */\n    // eslint-disable-next-line class-methods-use-this\n    public getRange(nodeOrToken: HasLocation) {\n        return nodeOrToken.range\n    }\n}\n","import type { Rule, SourceCode } from \"eslint\"\nimport type { ScopeManager, Scope } from \"eslint-scope\"\nimport type {\n    ESLintExtendedProgram,\n    Node,\n    OffsetRange,\n    VDocumentFragment,\n    VElement,\n    VExpressionContainer,\n    VText,\n} from \"../../ast/index\"\nimport { getFallbackKeys, ParseError } from \"../../ast/index\"\nimport { getEslintScope } from \"../../common/eslint-scope\"\nimport { getEcmaVersionIfUseEspree } from \"../../common/espree\"\nimport { fixErrorLocation, fixLocations } from \"../../common/fix-locations\"\nimport type { LocationCalculatorForHtml } from \"../../common/location-calculator\"\nimport type { ParserObject } from \"../../common/parser-object\"\nimport { isEnhancedParserObject } from \"../../common/parser-object\"\nimport type { ParserOptions } from \"../../common/parser-options\"\nimport {\n    ANALYZE_SCOPE_DEFAULT_ECMA_VERSION,\n    DEFAULT_ECMA_VERSION,\n} from \"../../script-setup/parser-options\"\n\nexport type ESLintCustomBlockParser = ParserObject<any, any>\n\nexport type CustomBlockContext = {\n    getSourceCode(): SourceCode\n    sourceCode: SourceCode\n    parserServices: any\n    getAncestors(): any[]\n    getDeclaredVariables(node: any): any[]\n    getScope(): any\n    markVariableAsUsed(name: string): boolean\n\n    // Same as the original context.\n    id: string\n    options: any[]\n    settings: { [name: string]: any }\n    parserPath: string\n    parserOptions: any\n    getFilename(): string\n    report(descriptor: Rule.ReportDescriptor): void\n}\n\n/**\n * Checks whether the given node is VElement.\n */\nfunction isVElement(\n    node: VElement | VExpressionContainer | VText,\n): node is VElement {\n    return node.type === \"VElement\"\n}\n\n/**\n * Get the all custom blocks from given document\n * @param document\n */\nexport function getCustomBlocks(\n    document: VDocumentFragment | null,\n): VElement[] {\n    return document\n        ? document.children\n              .filter(isVElement)\n              .filter(\n                  (block) =>\n                      block.name !== \"script\" &&\n                      block.name !== \"template\" &&\n                      block.name !== \"style\",\n              )\n        : []\n}\n\n/**\n * Parse the source code of the given custom block element.\n * @param node The custom block element to parse.\n * @param parser The custom parser.\n * @param globalLocationCalculator The location calculator for fixLocations.\n * @param parserOptions The parser options.\n * @returns The result of parsing.\n */\nexport function parseCustomBlockElement(\n    node: VElement,\n    parser: ESLintCustomBlockParser,\n    globalLocationCalculator: LocationCalculatorForHtml,\n    parserOptions: ParserOptions,\n): ESLintExtendedProgram & { error?: ParseError | Error } {\n    const text = node.children[0]\n    const { code, range, loc } =\n        text?.type === \"VText\"\n            ? {\n                  code: text.value,\n                  range: text.range,\n                  loc: text.loc,\n              }\n            : {\n                  code: \"\",\n                  range: [\n                      node.startTag.range[1],\n                      node.endTag!.range[0],\n                  ] as OffsetRange,\n                  loc: {\n                      start: node.startTag.loc.end,\n                      end: node.endTag!.loc.start,\n                  },\n              }\n    const locationCalculator = globalLocationCalculator.getSubCalculatorAfter(\n        range[0],\n    )\n    try {\n        return parseCustomBlockFragment(\n            code,\n            parser,\n            locationCalculator,\n            parserOptions,\n        )\n    } catch (e) {\n        if (!(e instanceof Error)) {\n            throw e\n        }\n        return {\n            error: e,\n            ast: {\n                type: \"Program\",\n                sourceType: \"module\",\n                loc: {\n                    start: {\n                        ...loc.start,\n                    },\n                    end: {\n                        ...loc.end,\n                    },\n                },\n                range: [...range],\n                body: [],\n                tokens: [],\n                comments: [],\n            },\n        }\n    }\n}\n\n/**\n * Parse the given source code.\n *\n * @param code The source code to parse.\n * @param parser The custom parser.\n * @param locationCalculator The location calculator for fixLocations.\n * @param parserOptions The parser options.\n * @returns The result of parsing.\n */\nfunction parseCustomBlockFragment(\n    code: string,\n    parser: ESLintCustomBlockParser,\n    locationCalculator: LocationCalculatorForHtml,\n    parserOptions: ParserOptions,\n): ESLintExtendedProgram {\n    try {\n        const result = parseBlock(code, parser, {\n            ecmaVersion: DEFAULT_ECMA_VERSION,\n            loc: true,\n            range: true,\n            raw: true,\n            tokens: true,\n            comment: true,\n            eslintVisitorKeys: true,\n            eslintScopeManager: true,\n            ...parserOptions,\n        })\n        fixLocations(result, locationCalculator)\n        return result\n    } catch (err) {\n        const perr = ParseError.normalize(err)\n        if (perr) {\n            fixErrorLocation(perr, locationCalculator)\n            throw perr\n        }\n        throw err\n    }\n}\n\nfunction parseBlock(\n    code: string,\n    parser: ESLintCustomBlockParser,\n    parserOptions: any,\n): any {\n    const result = isEnhancedParserObject(parser)\n        ? parser.parseForESLint(code, parserOptions)\n        : parser.parse(code, parserOptions)\n\n    if (result.ast != null) {\n        return result\n    }\n    return { ast: result }\n}\n\n/**\n * Create shared context.\n *\n * @param text The source code of SFC.\n * @param customBlock The custom block node.\n * @param parsedResult The parse result data\n * @param parserOptions The parser options.\n */\nexport function createCustomBlockSharedContext({\n    text,\n    customBlock,\n    parsedResult,\n    globalLocationCalculator,\n    parserOptions,\n}: {\n    text: string\n    customBlock: VElement\n    parsedResult: ESLintExtendedProgram & { error?: ParseError | Error }\n    globalLocationCalculator: LocationCalculatorForHtml\n    parserOptions: any\n}) {\n    let sourceCode: SourceCode\n    let currentNode: any\n    return {\n        serCurrentNode(node: any) {\n            currentNode = node\n        },\n        context: {\n            getAncestors: () => getSourceCode().getAncestors(currentNode),\n            getDeclaredVariables: (...args: any[]) =>\n                // @ts-expect-error -- ignore\n                getSourceCode().getDeclaredVariables(...args),\n            getScope: () => getSourceCode().getScope(currentNode),\n            markVariableAsUsed: (name: string) =>\n                getSourceCode().markVariableAsUsed(name, currentNode),\n            get parserServices() {\n                return getSourceCode().parserServices\n            },\n            getSourceCode,\n            get sourceCode() {\n                return getSourceCode()\n            },\n        },\n    }\n\n    function getSourceCode(): SourceCode {\n        if (sourceCode) {\n            return sourceCode\n        }\n\n        const scopeManager = getScopeManager()\n\n        // eslint-disable-next-line @typescript-eslint/no-require-imports\n        const originalSourceCode = new (require(\"eslint\").SourceCode)({\n            text,\n            ast: parsedResult.ast,\n            parserServices: {\n                customBlock,\n                parseCustomBlockElement(\n                    parser: ESLintCustomBlockParser,\n                    options: any,\n                ) {\n                    return parseCustomBlockElement(\n                        customBlock,\n                        parser,\n                        globalLocationCalculator,\n                        { ...parserOptions, ...options },\n                    )\n                },\n                ...parsedResult.services,\n                ...(parsedResult.error\n                    ? { parseError: parsedResult.error }\n                    : {}),\n            },\n            scopeManager,\n            visitorKeys: parsedResult.visitorKeys,\n        })\n\n        const polyfills = {\n            markVariableAsUsed: (name: string, node: any) =>\n                markVariableAsUsed(scopeManager, node, parsedResult.ast, name),\n            getScope: (node: any) => getScope(scopeManager, node),\n            getAncestors: (node: any) => getAncestors(node),\n            getDeclaredVariables: (...args: any[]) =>\n                // @ts-expect-error -- ignore\n                scopeManager.getDeclaredVariables(...args),\n        }\n\n        return (sourceCode = new Proxy(originalSourceCode, {\n            get(_target, prop) {\n                return originalSourceCode[prop] || (polyfills as any)[prop]\n            },\n        }))\n    }\n\n    function getScopeManager() {\n        if (parsedResult.scopeManager) {\n            return parsedResult.scopeManager\n        }\n\n        const ecmaVersion =\n            getEcmaVersionIfUseEspree(parserOptions) ??\n            ANALYZE_SCOPE_DEFAULT_ECMA_VERSION\n        const ecmaFeatures = parserOptions.ecmaFeatures ?? {}\n        const sourceType = parserOptions.sourceType ?? \"script\"\n        return getEslintScope().analyze(parsedResult.ast, {\n            ignoreEval: true,\n            nodejsScope: false,\n            impliedStrict: ecmaFeatures.impliedStrict,\n            ecmaVersion,\n            sourceType,\n            fallback: getFallbackKeys,\n        })\n    }\n}\n\n/* The following source code is copied from `eslint/lib/linter/linter.js` */\n\n/**\n * Gets all the ancestors of a given node\n * @param {ASTNode} node The node\n * @returns {ASTNode[]} All the ancestor nodes in the AST, not including the provided node, starting\n * from the root node and going inwards to the parent node.\n */\nfunction getAncestors(node: Node) {\n    const ancestorsStartingAtParent = []\n\n    for (let ancestor = node.parent; ancestor; ancestor = ancestor.parent) {\n        ancestorsStartingAtParent.push(ancestor)\n    }\n\n    return ancestorsStartingAtParent.reverse()\n}\n\n/**\n * Gets the scope for the current node\n * @param {ScopeManager} scopeManager The scope manager for this AST\n * @param {ASTNode} currentNode The node to get the scope of\n * @returns {eslint-scope.Scope} The scope information for this node\n */\nfunction getScope(scopeManager: ScopeManager, currentNode: Node) {\n    // On Program node, get the outermost scope to avoid return Node.js special function scope or ES modules scope.\n    const inner = currentNode.type !== \"Program\"\n\n    for (\n        let node: Node | null = currentNode;\n        node;\n        node = node.parent ?? null\n    ) {\n        const scope = scopeManager.acquire(node as any, inner)\n\n        if (scope) {\n            if (scope.type === \"function-expression-name\") {\n                return scope.childScopes[0]\n            }\n            return scope\n        }\n    }\n\n    return scopeManager.scopes[0]\n}\n\n/**\n * Marks a variable as used in the current scope\n * @param {ScopeManager} scopeManager The scope manager for this AST. The scope may be mutated by this function.\n * @param {ASTNode} currentNode The node currently being traversed\n * @param {Object} parserOptions The options used to parse this text\n * @param {string} name The name of the variable that should be marked as used.\n * @returns {boolean} True if the variable was found and marked as used, false if not.\n */\nfunction markVariableAsUsed(\n    scopeManager: ScopeManager,\n    currentNode: Node,\n    program: Node,\n    name: string,\n) {\n    const currentScope = getScope(scopeManager, currentNode)\n    let initialScope = currentScope\n    if (\n        currentScope.type === \"global\" &&\n        currentScope.childScopes.length > 0 &&\n        // top-level scopes refer to a `Program` node\n        currentScope.childScopes[0].block === program\n    ) {\n        initialScope = currentScope.childScopes[0]\n    }\n\n    for (let scope: Scope | null = initialScope; scope; scope = scope.upper) {\n        const variable = scope.variables.find(\n            (scopeVar) => scopeVar.name === name,\n        )\n\n        if (variable) {\n            // @ts-expect-error -- ignore\n            variable.eslintUsed = true\n            return true\n        }\n    }\n\n    return false\n}\n","/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * @copyright 2017 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\nimport type { Rule } from \"eslint\"\nimport EventEmitter from \"events\"\nimport NodeEventGenerator from \"./external/node-event-generator\"\nimport TokenStore from \"./external/token-store/index\"\nimport type {\n    ESLintProgram,\n    VElement,\n    VDocumentFragment,\n    VAttribute,\n} from \"./ast/index\"\nimport { getFallbackKeys, KEYS, traverseNodes } from \"./ast/traverse\"\nimport type { LocationCalculatorForHtml } from \"./common/location-calculator\"\nimport type {\n    CustomBlockContext,\n    ESLintCustomBlockParser,\n} from \"./sfc/custom-block/index\"\nimport {\n    createCustomBlockSharedContext,\n    getCustomBlocks,\n    parseCustomBlockElement,\n} from \"./sfc/custom-block/index\"\nimport type { ParserOptions } from \"./common/parser-options\"\nimport { isSFCFile } from \"./common/parser-options\"\nimport { getLang } from \"./common/ast-utils\"\n\n//------------------------------------------------------------------------------\n// Helpers\n//------------------------------------------------------------------------------\n\ntype CustomBlockVisitorFactory = (context: CustomBlockContext) =>\n    | {\n          [key: string]: (...args: any) => void\n      }\n    | null\n    | undefined\n\n//------------------------------------------------------------------------------\n// Exports\n//------------------------------------------------------------------------------\n\nexport interface ParserServices {\n    /**\n     * Define handlers to traverse the template body.\n     * @param templateBodyVisitor The template body handlers.\n     * @param scriptVisitor The script handlers. This is optional.\n     * @param options The options. This is optional.\n     */\n    defineTemplateBodyVisitor(\n        templateBodyVisitor: { [key: string]: (...args: any) => void },\n        scriptVisitor?: { [key: string]: (...args: any) => void },\n        options?: { templateBodyTriggerSelector: \"Program\" | \"Program:exit\" },\n    ): object\n\n    /**\n     * Define handlers to traverse the document.\n     * @param documentVisitor The document handlers.\n     * @param options The options. This is optional.\n     */\n    defineDocumentVisitor(\n        documentVisitor: { [key: string]: (...args: any) => void },\n        options?: { triggerSelector: \"Program\" | \"Program:exit\" },\n    ): object\n\n    /**\n     * Define handlers to traverse custom blocks.\n     * @param context The rule context.\n     * @param parser The custom parser.\n     * @param rule The custom block rule definition\n     * @param scriptVisitor The script handlers. This is optional.\n     */\n    defineCustomBlocksVisitor(\n        context: Rule.RuleContext,\n        parser: ESLintCustomBlockParser,\n        rule: {\n            target:\n                | string\n                | string[]\n                | ((lang: string | null, customBlock: VElement) => boolean)\n            create: CustomBlockVisitorFactory\n        },\n        scriptVisitor?: { [key: string]: (...args: any) => void },\n    ): { [key: string]: (...args: any) => void }\n\n    /**\n     * Get the token store of the template body.\n     * @returns The token store of template body.\n     */\n    getTemplateBodyTokenStore(): TokenStore\n\n    /**\n     * Get the root document fragment.\n     * @returns The root document fragment.\n     */\n    getDocumentFragment(): VDocumentFragment | null\n}\n\n/**\n * Define the parser service\n * @param rootAST\n */\nexport function define(\n    sourceText: string,\n    rootAST: ESLintProgram,\n    document: VDocumentFragment | null,\n    globalLocationCalculator: LocationCalculatorForHtml | null,\n    { parserOptions }: { parserOptions: ParserOptions },\n): ParserServices {\n    const templateBodyEmitters = new Map<string, EventEmitter>()\n    const stores = new WeakMap<object, TokenStore>()\n\n    const documentEmitters = new Map<string, EventEmitter>()\n\n    const customBlocksEmitters = new Map<\n        | ESLintCustomBlockParser[\"parseForESLint\"]\n        | ESLintCustomBlockParser[\"parse\"],\n        {\n            context: Rule.RuleContext\n            test: (lang: string | null, customBlock: VElement) => boolean\n            create: CustomBlockVisitorFactory\n        }[]\n    >()\n\n    const isSFC = isSFCFile(parserOptions)\n\n    return {\n        /**\n         * Define handlers to traverse the template body.\n         * @param templateBodyVisitor The template body handlers.\n         * @param scriptVisitor The script handlers. This is optional.\n         */\n        defineTemplateBodyVisitor(\n            templateBodyVisitor: { [key: string]: (...args: any) => void },\n            scriptVisitor?: { [key: string]: (...args: any) => void },\n            options?: {\n                templateBodyTriggerSelector: \"Program\" | \"Program:exit\"\n            },\n        ): object {\n            if (scriptVisitor == null) {\n                scriptVisitor = {} //eslint-disable-line no-param-reassign\n            }\n            if (rootAST.templateBody == null) {\n                return scriptVisitor\n            }\n            const templateBodyTriggerSelector =\n                options?.templateBodyTriggerSelector ?? \"Program:exit\"\n\n            let emitter = templateBodyEmitters.get(templateBodyTriggerSelector)\n\n            // If this is the first time, initialize the intermediate event emitter.\n            if (emitter == null) {\n                emitter = new EventEmitter()\n                emitter.setMaxListeners(0)\n                templateBodyEmitters.set(templateBodyTriggerSelector, emitter)\n\n                const programExitHandler =\n                    scriptVisitor[templateBodyTriggerSelector]\n                scriptVisitor[templateBodyTriggerSelector] = (node) => {\n                    try {\n                        if (typeof programExitHandler === \"function\") {\n                            programExitHandler(node)\n                        }\n\n                        // Traverse template body.\n                        const generator = new NodeEventGenerator(emitter!, {\n                            visitorKeys: KEYS,\n                            fallback: getFallbackKeys,\n                        })\n                        traverseNodes(\n                            rootAST.templateBody as VElement,\n                            generator,\n                        )\n                    } finally {\n                        scriptVisitor[templateBodyTriggerSelector] =\n                            programExitHandler\n                        templateBodyEmitters.delete(templateBodyTriggerSelector)\n                    }\n                }\n            }\n\n            // Register handlers into the intermediate event emitter.\n            for (const selector of Object.keys(templateBodyVisitor)) {\n                emitter.on(selector, templateBodyVisitor[selector])\n            }\n\n            return scriptVisitor\n        },\n\n        /**\n         * Define handlers to traverse the document.\n         * @param documentVisitor The document handlers.\n         * @param options The options. This is optional.\n         */\n        defineDocumentVisitor(\n            documentVisitor: { [key: string]: (...args: any) => void },\n            options?: { triggerSelector: \"Program\" | \"Program:exit\" },\n        ): object {\n            const scriptVisitor: { [key: string]: (...args: any) => void } = {}\n            if (!document) {\n                return scriptVisitor\n            }\n\n            const documentTriggerSelector =\n                options?.triggerSelector ?? \"Program:exit\"\n\n            let emitter = documentEmitters.get(documentTriggerSelector)\n\n            // If this is the first time, initialize the intermediate event emitter.\n            if (emitter == null) {\n                emitter = new EventEmitter()\n                emitter.setMaxListeners(0)\n                documentEmitters.set(documentTriggerSelector, emitter)\n\n                const programExitHandler =\n                    scriptVisitor[documentTriggerSelector]\n                scriptVisitor[documentTriggerSelector] = (node) => {\n                    try {\n                        if (typeof programExitHandler === \"function\") {\n                            programExitHandler(node)\n                        }\n\n                        // Traverse document.\n                        const generator = new NodeEventGenerator(emitter!, {\n                            visitorKeys: KEYS,\n                            fallback: getFallbackKeys,\n                        })\n                        traverseNodes(document, generator)\n                    } finally {\n                        scriptVisitor[documentTriggerSelector] =\n                            programExitHandler\n                        documentEmitters.delete(documentTriggerSelector)\n                    }\n                }\n            }\n\n            // Register handlers into the intermediate event emitter.\n            for (const selector of Object.keys(documentVisitor)) {\n                emitter.on(selector, documentVisitor[selector])\n            }\n\n            return scriptVisitor\n        },\n\n        /**\n         * Define handlers to traverse custom blocks.\n         * @param context The rule context.\n         * @param parser The custom parser.\n         * @param rule The custom block rule definition\n         * @param scriptVisitor The script handlers. This is optional.\n         */\n        defineCustomBlocksVisitor(\n            context: Rule.RuleContext,\n            parser: ESLintCustomBlockParser,\n            rule: {\n                target:\n                    | string\n                    | string[]\n                    | ((lang: string | null, customBlock: VElement) => boolean)\n                create: CustomBlockVisitorFactory\n            },\n            scriptVisitor?: { [key: string]: (...args: any) => void },\n        ): { [key: string]: (...args: any) => void } {\n            if (scriptVisitor == null) {\n                scriptVisitor = {} //eslint-disable-line no-param-reassign\n            }\n            if (!isSFC) {\n                return scriptVisitor\n            }\n            parserOptions = { ...parserOptions } //eslint-disable-line no-param-reassign\n            const customBlocks = getCustomBlocks(document).filter(\n                (block) =>\n                    block.endTag &&\n                    !block.startTag.attributes.some(\n                        (attr): attr is VAttribute =>\n                            !attr.directive && attr.key.name === \"src\",\n                    ),\n            )\n            if (!customBlocks.length || globalLocationCalculator == null) {\n                return {}\n            }\n            const key = parser.parseForESLint ?? parser.parse\n            let factories = customBlocksEmitters.get(key)\n\n            // If this is the first time, initialize the intermediate event emitter.\n            if (factories == null) {\n                factories = []\n                customBlocksEmitters.set(key, factories)\n                const visitorFactories = factories\n\n                const programExitHandler = scriptVisitor[\"Program:exit\"]\n                scriptVisitor[\"Program:exit\"] = (node) => {\n                    try {\n                        if (typeof programExitHandler === \"function\") {\n                            programExitHandler(node)\n                        }\n                        for (const customBlock of customBlocks) {\n                            const lang = getLang(customBlock)\n\n                            const activeVisitorFactories =\n                                visitorFactories.filter((f) =>\n                                    f.test(lang, customBlock),\n                                )\n                            if (!activeVisitorFactories.length) {\n                                continue\n                            }\n\n                            const parsedResult = parseCustomBlockElement(\n                                customBlock,\n                                parser,\n                                globalLocationCalculator,\n                                parserOptions,\n                            )\n\n                            const {\n                                serCurrentNode,\n                                context: customBlockContext,\n                            } = createCustomBlockSharedContext({\n                                text: sourceText,\n                                customBlock,\n                                parsedResult,\n                                globalLocationCalculator,\n                                parserOptions,\n                            })\n\n                            const emitter = new EventEmitter()\n                            emitter.setMaxListeners(0)\n\n                            for (const factory of activeVisitorFactories) {\n                                const ctx = {\n                                    ...customBlockContext,\n                                }\n                                // @ts-expect-error -- custom context\n                                ctx.__proto__ = factory.context\n\n                                const visitor = factory.create(\n                                    ctx as CustomBlockContext,\n                                )\n                                // Register handlers into the intermediate event emitter.\n                                for (const selector of Object.keys(\n                                    visitor ?? {},\n                                )) {\n                                    emitter.on(selector, visitor![selector])\n                                }\n                            }\n\n                            // Traverse custom block.\n                            const generator = new NodeEventGenerator(emitter, {\n                                visitorKeys: parsedResult.visitorKeys,\n                                fallback: getFallbackKeys,\n                            })\n                            traverseNodes(parsedResult.ast, {\n                                visitorKeys: parsedResult.visitorKeys,\n                                enterNode(n) {\n                                    serCurrentNode(n)\n                                    generator.enterNode(n)\n                                },\n                                leaveNode(n) {\n                                    serCurrentNode(n)\n                                    generator.leaveNode(n)\n                                },\n                            })\n                        }\n                    } finally {\n                        scriptVisitor[\"Program:exit\"] = programExitHandler\n                        customBlocksEmitters.delete(key)\n                    }\n                }\n            }\n\n            const target = rule.target\n            const test =\n                typeof target === \"function\"\n                    ? target\n                    : Array.isArray(target)\n                      ? (lang: string | null) =>\n                            Boolean(lang && target.includes(lang))\n                      : (lang: string | null) => target === lang\n            factories.push({\n                context,\n                test,\n                create: rule.create,\n            })\n\n            return scriptVisitor\n        },\n\n        /**\n         * Get the token store of the template body.\n         * @returns The token store of template body.\n         */\n        getTemplateBodyTokenStore(): TokenStore {\n            const key = document || stores\n            let store = stores.get(key)\n\n            if (!store) {\n                store =\n                    document != null\n                        ? new TokenStore(document.tokens, document.comments)\n                        : new TokenStore([], [])\n                stores.set(key, store)\n            }\n\n            return store\n        },\n\n        /**\n         * Get the root document fragment.\n         * @returns The root document fragment.\n         */\n        getDocumentFragment(): VDocumentFragment | null {\n            return document\n        },\n    }\n}\n","/**\n * @author Yosuke Ota <https://github.com/ota-meshi>\n * See LICENSE file in root directory for full license.\n */\nimport type { ScopeManager, Scope } from \"eslint-scope\"\nimport type {\n    ESLintBlockStatement,\n    ESLintExportNamedDeclaration,\n    ESLintExportSpecifier,\n    ESLintExtendedProgram,\n    ESLintIdentifier,\n    ESLintModuleDeclaration,\n    ESLintNode,\n    ESLintProgram,\n    ESLintStatement,\n    Token,\n    VElement,\n} from \"../ast/index\"\nimport { ParseError, traverseNodes } from \"../ast/index\"\nimport {\n    fixErrorLocation,\n    fixLocation,\n    fixLocations,\n    fixNodeLocations,\n} from \"../common/fix-locations\"\nimport type { LinesAndColumns } from \"../common/lines-and-columns\"\nimport type { LocationCalculator } from \"../common/location-calculator\"\nimport type { ParserOptions } from \"../common/parser-options\"\nimport {\n    parseScript as parseScriptBase,\n    parseScriptFragment,\n} from \"../script/index\"\nimport { extractGeneric } from \"../script/generic\"\nimport { DEFAULT_ECMA_VERSION } from \"./parser-options\"\n\ntype RemapBlock = {\n    range: [number, number]\n    offset: number\n}\n\n/**\n * `parseScriptSetupElements` rewrites the source code so that it can parse\n * the combination of `<script>` and `<script setup>`, and parses it source code with JavaScript parser.\n * This class holds the information to restore the AST and token locations parsed in the rewritten source code.\n */\nclass CodeBlocks {\n    public code: string\n    // The location information for remapping.\n    public remapBlocks: RemapBlock[] = []\n    // The list of extra punctuation locations added to split the statement.\n    public splitPunctuators: number[] = []\n\n    public constructor() {\n        this.code = \"\"\n    }\n    public get length() {\n        return this.code.length\n    }\n    public append(codeLet: string, originalOffset: number) {\n        const rangeStart = this.code.length\n        this.code += codeLet.trimEnd()\n        this.remapBlocks.push({\n            range: [rangeStart, this.code.length],\n            offset: originalOffset - rangeStart,\n        })\n    }\n    public appendSplitPunctuators(punctuator: string) {\n        this.splitPunctuators.push(this.code.length, this.code.length + 1)\n        this.code += `\\n${punctuator}\\n`\n    }\n    public appendCodeBlocks(codeBlocks: CodeBlocks) {\n        const start = this.code.length\n        this.code += codeBlocks.code\n        this.remapBlocks.push(\n            ...codeBlocks.remapBlocks.map(\n                (b): RemapBlock => ({\n                    range: [b.range[0] + start, b.range[1] + start],\n                    offset: b.offset - start,\n                }),\n            ),\n        )\n        this.splitPunctuators.push(\n            ...codeBlocks.splitPunctuators.map((s) => s + start),\n        )\n    }\n}\n\ntype RestoreASTCallback = (node: ESLintStatement) => {\n    statement: ESLintStatement | ESLintModuleDeclaration\n    tokens: Token[]\n} | null\n/**\n * Some named exports need to be replaced with a different syntax to successfully parse\n * the combination of `<script>` and `<script setup>`.\n * e.g. `export {a,b}` -> `({a,b});`, `export let a` -> `let a`\n * This class holds the callbacks to restore the rewritten syntax AST back to the original `export` AST.\n */\nclass RestoreASTCallbacks {\n    private callbacks: {\n        range: [number, number]\n        callback: RestoreASTCallback\n    }[] = []\n    public addCallback(\n        originalOffsetStart: number,\n        range: [number, number],\n        callback: RestoreASTCallback,\n    ) {\n        this.callbacks.push({\n            range: [\n                originalOffsetStart + range[0],\n                originalOffsetStart + range[1],\n            ],\n            callback,\n        })\n    }\n    public restore(\n        program: ESLintProgram,\n        scriptSetupStatements: ESLintStatement[],\n        linesAndColumns: LinesAndColumns,\n    ) {\n        if (this.callbacks.length === 0) {\n            return\n        }\n        const callbacks = new Set(this.callbacks)\n        for (const statement of scriptSetupStatements) {\n            for (const cb of callbacks) {\n                if (\n                    cb.range[0] <= statement.range[0] &&\n                    statement.range[1] <= cb.range[1]\n                ) {\n                    const restored = cb.callback(statement)\n                    if (restored) {\n                        const removeIndex = program.body.indexOf(statement)\n                        if (removeIndex >= 0) {\n                            program.body.splice(removeIndex, 1)\n                            program.body.push(restored.statement)\n                            program.tokens!.push(...restored.tokens)\n                            restored.statement.parent = program\n                            callbacks.delete(cb)\n                            break\n                        }\n                    }\n                }\n            }\n        }\n        if (callbacks.size) {\n            const [cb] = callbacks\n            const loc = linesAndColumns.getLocFromIndex(cb.range[0])\n            throw new ParseError(\n                \"Could not parse <script setup>. Failed to restore ExportNamedDeclaration.\",\n                undefined,\n                cb.range[0],\n                loc.line,\n                loc.column,\n            )\n        }\n    }\n}\n\ntype Postprocess = (\n    result: ESLintExtendedProgram,\n    context: { scriptSetupBlockRange: [number, number] },\n) => void\n\ntype ScriptSetupCodeBlocks = {\n    codeBlocks: CodeBlocks\n    // The location of the code of the statements in `<script setup>`.\n    scriptSetupBlockRange: [number, number]\n    // Post process\n    postprocess: Postprocess\n    // Used to restore ExportNamedDeclaration.\n    restoreASTCallbacks: RestoreASTCallbacks\n}\ntype ScriptSetupModuleCodeBlocks =\n    | ScriptSetupCodeBlocks\n    | {\n          codeBlocks: CodeBlocks\n          scriptSetupBlockRange?: undefined\n          postprocess?: undefined\n          restoreASTCallbacks?: undefined\n      }\n\nfunction parseScript(\n    code: string,\n    parserOptions: ParserOptions,\n    locationCalculatorForError: LocationCalculator,\n) {\n    try {\n        return parseScriptBase(code, parserOptions)\n    } catch (err) {\n        const perr = ParseError.normalize(err)\n        if (perr) {\n            // console.log(code)\n            fixErrorLocation(perr, locationCalculatorForError)\n            throw perr\n        }\n        throw err\n    }\n}\n\n/**\n * Parse the source code of the given `<script setup>` and `<script>` elements.\n * @param scriptSetupElement The `<script setup>` element to parse.\n * @param nodes The `<script>` elements to parse.\n * @param sfcCode The source code of SFC.\n * @param linesAndColumns The lines and columns location calculator.\n * @param parserOptions The parser options.\n * @returns The result of parsing.\n */\nexport function parseScriptSetupElements(\n    scriptSetupElement: VElement,\n    scriptElement: VElement,\n    sfcCode: string,\n    linesAndColumns: LinesAndColumns,\n    originalParserOptions: ParserOptions,\n): ESLintExtendedProgram {\n    const parserOptions: ParserOptions = {\n        ...originalParserOptions,\n        ecmaVersion: originalParserOptions.ecmaVersion ?? DEFAULT_ECMA_VERSION,\n    }\n    const scriptSetupModuleCodeBlocks = getScriptSetupModuleCodeBlocks(\n        scriptSetupElement,\n        scriptElement,\n        sfcCode,\n        linesAndColumns,\n        parserOptions,\n    )\n    if (!scriptSetupModuleCodeBlocks) {\n        return parseScriptFragment(\n            \"\",\n            linesAndColumns.createOffsetLocationCalculator(\n                scriptSetupElement.startTag.range[1],\n            ),\n            parserOptions,\n        )\n    }\n\n    const locationCalculator: LocationCalculator = {\n        getFixOffset(offset, kind) {\n            const test: (block: RemapBlock) => boolean =\n                kind === \"start\"\n                    ? (block) =>\n                          block.range[0] <= offset && offset < block.range[1]\n                    : (block) =>\n                          block.range[0] < offset && offset <= block.range[1]\n\n            for (const block of scriptSetupModuleCodeBlocks.codeBlocks\n                .remapBlocks) {\n                if (test(block)) {\n                    return block.offset\n                }\n            }\n            return offset\n        },\n        getLocFromIndex: linesAndColumns.getLocFromIndex.bind(linesAndColumns),\n    }\n\n    const result = parseScript(\n        scriptSetupModuleCodeBlocks.codeBlocks.code,\n        parserOptions,\n        locationCalculator,\n    )\n    if (scriptSetupModuleCodeBlocks.postprocess) {\n        scriptSetupModuleCodeBlocks.postprocess(result, {\n            scriptSetupBlockRange:\n                scriptSetupModuleCodeBlocks.scriptSetupBlockRange,\n        })\n    }\n\n    /* Remap ASTs */\n    const scriptSetupStatements = remapAST(result, scriptSetupModuleCodeBlocks)\n\n    /* Remap locations */\n    remapLocationAndTokens(\n        result,\n        scriptSetupModuleCodeBlocks,\n        locationCalculator,\n    )\n\n    if (scriptSetupModuleCodeBlocks.restoreASTCallbacks) {\n        scriptSetupModuleCodeBlocks.restoreASTCallbacks.restore(\n            result.ast,\n            scriptSetupStatements,\n            linesAndColumns,\n        )\n    }\n\n    // Adjust AST and tokens\n    if (result.ast.tokens != null) {\n        for (const node of [scriptSetupElement, scriptElement]) {\n            const startTag = node.startTag\n            const endTag = node.endTag\n\n            result.ast.tokens.unshift({\n                type: \"Punctuator\",\n                range: startTag.range,\n                loc: startTag.loc,\n                value: \"<script>\",\n            })\n            if (endTag != null) {\n                result.ast.tokens.push({\n                    type: \"Punctuator\",\n                    range: endTag.range,\n                    loc: endTag.loc,\n                    value: \"</script>\",\n                })\n            }\n        }\n        result.ast.tokens.sort((a, b) => a.range[0] - b.range[0])\n    }\n\n    if (result.ast.comments != null) {\n        result.ast.comments.sort((a, b) => a.range[0] - b.range[0])\n    }\n    result.ast.body.sort((a, b) => a.range[0] - b.range[0])\n\n    const programStartOffset = result.ast.body.reduce(\n        (start, node) => Math.min(start, node.range[0]),\n        result.ast.range[0],\n    )\n    result.ast.range[0] = programStartOffset\n    result.ast.loc.start =\n        locationCalculator.getLocFromIndex(programStartOffset)\n    if (result.ast.start != null) {\n        result.ast.start = [scriptSetupElement, scriptElement].reduce(\n            (start, node) => {\n                const textNode = node.children[0]\n                return Math.min(\n                    start,\n                    textNode?.type === \"VText\"\n                        ? textNode.range[0]\n                        : node.startTag.range[1],\n                )\n            },\n            result.ast.start,\n        )\n    }\n\n    const programEndOffset = result.ast.body.reduce(\n        (end, node) => Math.max(end, node.range[1]),\n        0,\n    )\n    result.ast.range[1] = programEndOffset\n    result.ast.loc.end = locationCalculator.getLocFromIndex(programEndOffset)\n    if (result.ast.end != null) {\n        result.ast.end = [scriptSetupElement, scriptElement].reduce(\n            (end, node) => {\n                const textNode = node.children[0]\n                return Math.max(\n                    end,\n                    textNode?.type === \"VText\"\n                        ? textNode.range[1]\n                        : (node.endTag?.range[0] ?? node.range[1]),\n                )\n            },\n            0,\n        )\n    }\n\n    return result\n}\n\n/**\n * Parses the scripts of the given `<script>` elements and returns\n * the reconstructed source code as a parseable script.\n * It also returns information for remapping the location.\n *\n * For examples, the script is reconstructed as follows.\n *\n * Example 1:\n *\n * ```vue\n * <script>\n * export let count = 42\n * </script>\n * <script setup>\n * import MyComponent from './MyComponent.vue'\n * let count = 42\n * </script>\n * ```\n *\n * ↓\n *\n * ```js\n * export let count = 42\n * ;\n * import MyComponent from './MyComponent.vue';\n * {\n * let count = 42\n * }\n * ```\n *\n * Example 2:\n *\n * ```vue\n * <script>\n * export let count = 42\n * </script>\n * <script setup>\n * import MyComponent1 from './MyComponent1.vue'\n * let count = 42\n * import MyComponent2 from './MyComponent2.vue'\n * let a\n * </script>\n * ```\n *\n * ↓\n *\n * ```js\n * export let count = 42\n * ;\n * import MyComponent1 from './MyComponent1.vue';\n * import MyComponent2 from './MyComponent2.vue';\n * {\n * let count = 42;\n * let a\n * }\n * ```\n *\n * Example 3:\n *\n * ```vue\n * <script>\n * export let count = 42\n * export let count2 = 42\n * </script>\n * <script setup>\n * import MyComponent1 from './MyComponent1.vue'\n * let count = 42\n * export {count as ns}\n * export let count2 = 42\n * count2++\n * </script>\n * ```\n *\n * ↓\n *\n * ```js\n * export let count = 42\n * export let count2 = 42\n * ;\n * import MyComponent1 from './MyComponent1.vue';\n * {\n * let count = 42;\n * let a\n * ;\n * ({count})\n * ;\n * let count2 = 42\n * ;\n * count2++\n * ;\n * }\n * ```\n */\nfunction getScriptSetupModuleCodeBlocks(\n    scriptSetupElement: VElement,\n    scriptElement: VElement,\n    sfcCode: string,\n    linesAndColumns: LinesAndColumns,\n    parserOptions: ParserOptions,\n): ScriptSetupModuleCodeBlocks | null {\n    const scriptSetupCodeBlocks = getScriptSetupCodeBlocks(\n        scriptSetupElement,\n        sfcCode,\n        linesAndColumns,\n        parserOptions,\n    )\n\n    const textNode = scriptElement.children[0]\n    if (textNode == null || textNode.type !== \"VText\") {\n        return scriptSetupCodeBlocks\n    }\n\n    const [scriptStartOffset, scriptEndOffset] = textNode.range\n    const codeBlocks = new CodeBlocks()\n    codeBlocks.append(\n        sfcCode.slice(scriptStartOffset, scriptEndOffset),\n        scriptStartOffset,\n    )\n    if (scriptSetupCodeBlocks == null) {\n        return { codeBlocks }\n    }\n\n    codeBlocks.appendSplitPunctuators(\";\")\n    const scriptSetupOffset = codeBlocks.length\n    codeBlocks.appendCodeBlocks(scriptSetupCodeBlocks.codeBlocks)\n    return {\n        codeBlocks,\n        scriptSetupBlockRange: [\n            scriptSetupCodeBlocks.scriptSetupBlockRange[0] + scriptSetupOffset,\n            scriptSetupCodeBlocks.scriptSetupBlockRange[1] + scriptSetupOffset,\n        ],\n        postprocess: scriptSetupCodeBlocks.postprocess,\n        restoreASTCallbacks: scriptSetupCodeBlocks.restoreASTCallbacks,\n    }\n}\n\n/**\n * Parses the script in the given `<script setup>` and returns the source code with\n * the import blocks and other statements reconstructed.\n * It also returns information for remapping the location.\n */\nfunction getScriptSetupCodeBlocks(\n    node: VElement,\n    sfcCode: string,\n    linesAndColumns: LinesAndColumns,\n    parserOptions: ParserOptions,\n): ScriptSetupCodeBlocks | null {\n    const textNode = node.children[0]\n    if (textNode == null || textNode.type !== \"VText\") {\n        return null\n    }\n\n    const [scriptSetupStartOffset, scriptSetupEndOffset] = textNode.range\n    const scriptCode = sfcCode.slice(\n        scriptSetupStartOffset,\n        scriptSetupEndOffset,\n    )\n\n    const offsetLocationCalculator =\n        linesAndColumns.createOffsetLocationCalculator(scriptSetupStartOffset)\n\n    const { ast, visitorKeys } = parseScript(\n        scriptCode,\n        { ...parserOptions, project: undefined, projectService: undefined },\n        offsetLocationCalculator,\n    )\n\n    // Holds the `import` and re-`export` statements.\n    // All import and re-`export` statements are hoisted to the top.\n    const importCodeBlocks = new CodeBlocks()\n    // Holds statements other than `import`, re-`export` and `export default` statements.\n    // This is moved to a block statement to avoid conflicts with variables of the same name in `<script>`.\n    const statementCodeBlocks = new CodeBlocks()\n    // Holds `export default` statements.\n    // All `export default` statements are move to the bottom.\n    const exportDefaultCodeBlocks = new CodeBlocks()\n    // It holds the information to restore the transformation source code of the export statements held in `statementCodeBlocks`.\n    const restoreASTCallbacks = new RestoreASTCallbacks()\n\n    let usedOffset = 0\n\n    /**\n     * Consume and append the given range of code to the given codeBlocks.\n     */\n    function append(codeBlocks: CodeBlocks, start: number, end: number) {\n        if (start < end) {\n            codeBlocks.append(\n                scriptCode.slice(start, end),\n                scriptSetupStartOffset + start,\n            )\n            usedOffset = end\n            return true\n        }\n        return false\n    }\n\n    /**\n     * Append the given range of import or export statement to the given codeBlocks.\n     */\n    function appendRangeAsStatement(\n        codeBlocks: CodeBlocks,\n        start: number,\n        end: number,\n    ) {\n        if (append(codeBlocks, start, end)) {\n            codeBlocks.appendSplitPunctuators(\";\")\n        }\n    }\n\n    function transformExportNamed(body: ESLintExportNamedDeclaration) {\n        const [start, end] = getNodeFullRange(body)\n        // Consume code up to the start position.\n        appendRangeAsStatement(statementCodeBlocks, usedOffset, start)\n\n        const tokens = ast.tokens!\n        const exportTokenIndex = tokens.findIndex(\n            (t) => t.range[0] === body.range[0],\n        )\n        const exportToken = tokens[exportTokenIndex]\n        if (exportToken?.value === \"export\") {\n            // Consume code up to the start position of `export`.\n            // The code may contain legacy decorators.\n            append(statementCodeBlocks, usedOffset, exportToken.range[0])\n            if (body.declaration) {\n                // Append declaration section (Skip `export` token)\n                appendRangeAsStatement(\n                    statementCodeBlocks,\n                    exportToken.range[1],\n                    end,\n                )\n\n                restoreASTCallbacks.addCallback(\n                    scriptSetupStartOffset,\n                    [start, end],\n                    (statement) => {\n                        if (statement.type !== body.declaration!.type) {\n                            return null\n                        }\n                        fixNodeLocations(\n                            body,\n                            visitorKeys,\n                            offsetLocationCalculator,\n                        )\n                        fixLocation(exportToken, offsetLocationCalculator)\n                        body.declaration = statement\n                        statement.parent = body\n                        return {\n                            statement: body,\n                            tokens: [exportToken],\n                        }\n                    },\n                )\n            } else {\n                // Append the code that converted specifiers to destructuring.\n                statementCodeBlocks.appendSplitPunctuators(\"(\")\n                const restoreTokens: Token[] = [exportToken]\n                let startOffset = exportToken.range[1]\n                for (const spec of body.specifiers) {\n                    if (spec.local.range[0] < spec.exported.range[0]) {\n                        // {a as b}\n                        const localTokenIndex = tokens.findIndex(\n                            (t) => t.range[0] === spec.local.range[0],\n                            exportTokenIndex,\n                        )\n                        checkToken(\n                            tokens[localTokenIndex],\n                            (spec.local as ESLintIdentifier).name,\n                        )\n                        const asToken = tokens[localTokenIndex + 1]\n                        checkToken(asToken, \"as\")\n                        restoreTokens.push(asToken)\n                        const exportedToken = tokens[localTokenIndex + 2]\n                        checkToken(\n                            exportedToken,\n                            spec.exported.type === \"Identifier\"\n                                ? spec.exported.name\n                                : spec.exported.raw,\n                        )\n                        restoreTokens.push(exportedToken)\n                        // Skip `as` token\n                        append(\n                            statementCodeBlocks,\n                            startOffset,\n                            asToken.range[0],\n                        )\n                        append(\n                            statementCodeBlocks,\n                            asToken.range[1],\n                            exportedToken.range[0],\n                        )\n                        startOffset = exportedToken.range[1]\n                    }\n                }\n                append(statementCodeBlocks, startOffset, end)\n                statementCodeBlocks.appendSplitPunctuators(\")\")\n                statementCodeBlocks.appendSplitPunctuators(\";\")\n\n                restoreASTCallbacks.addCallback(\n                    scriptSetupStartOffset,\n                    [start, end],\n                    (statement) => {\n                        if (\n                            statement.type !== \"ExpressionStatement\" ||\n                            statement.expression.type !== \"ObjectExpression\"\n                        ) {\n                            return null\n                        }\n                        // preprocess and check\n                        const locals: ESLintIdentifier[] = []\n                        for (const prop of statement.expression.properties) {\n                            if (\n                                prop.type !== \"Property\" ||\n                                prop.value.type !== \"Identifier\"\n                            ) {\n                                return null\n                            }\n                            locals.push(prop.value)\n                        }\n                        if (body.specifiers.length !== locals.length) {\n                            return null\n                        }\n                        const map = new Map<\n                            ESLintExportSpecifier,\n                            ESLintIdentifier\n                        >()\n                        for (\n                            let index = 0;\n                            index < body.specifiers.length;\n                            index++\n                        ) {\n                            const spec = body.specifiers[index]\n                            const local = locals[index]\n                            map.set(spec, local)\n                        }\n\n                        // restore\n                        fixNodeLocations(\n                            body,\n                            visitorKeys,\n                            offsetLocationCalculator,\n                        )\n                        for (const token of restoreTokens) {\n                            fixLocation(token, offsetLocationCalculator)\n                        }\n                        for (const [spec, local] of map) {\n                            spec.local = local\n                            local.parent = spec\n                        }\n                        return {\n                            statement: body,\n                            tokens: restoreTokens,\n                        }\n                    },\n                )\n            }\n        } else {\n            // Unknown format\n            appendRangeAsStatement(statementCodeBlocks, usedOffset, end)\n        }\n    }\n\n    for (const body of ast.body) {\n        if (\n            body.type === \"ImportDeclaration\" ||\n            body.type === \"ExportAllDeclaration\" ||\n            (body.type === \"ExportNamedDeclaration\" && body.source != null)\n        ) {\n            const [start, end] = getNodeFullRange(body)\n            // Consume code up to the start position.\n            appendRangeAsStatement(statementCodeBlocks, usedOffset, start)\n            // Append declaration\n            appendRangeAsStatement(importCodeBlocks, start, end)\n        } else if (body.type === \"ExportDefaultDeclaration\") {\n            const [start, end] = getNodeFullRange(body)\n            // Consume code up to the start position.\n            appendRangeAsStatement(statementCodeBlocks, usedOffset, start)\n            // Append declaration\n            appendRangeAsStatement(exportDefaultCodeBlocks, start, end)\n        } else if (body.type === \"ExportNamedDeclaration\") {\n            // Transform ExportNamedDeclaration\n            // The transformed statement ASTs are restored by RestoreASTCallbacks.\n            // e.g.\n            // - `export let v = 42` -> `let v = 42`\n            // - `export {foo, bar as Bar}` -> `({foo, bar})`\n            transformExportNamed(body)\n        }\n    }\n    // Consume the remaining code.\n    appendRangeAsStatement(\n        statementCodeBlocks,\n        usedOffset,\n        scriptSetupEndOffset,\n    )\n\n    // Creates a code block that combines import, statement block, and export default.\n    const codeBlocks = new CodeBlocks()\n\n    let postprocess: Postprocess = () => {\n        // noop\n    }\n\n    codeBlocks.appendCodeBlocks(importCodeBlocks)\n    const scriptSetupBlockRangeStart = codeBlocks.length\n    codeBlocks.appendSplitPunctuators(\"{\")\n    const generic = extractGeneric(node)\n    if (generic) {\n        const defineGenericTypeRangeStart = codeBlocks.length\n        for (const defineType of generic.defineTypes) {\n            codeBlocks.append(defineType.define, defineType.node.range[0])\n            codeBlocks.appendSplitPunctuators(\";\")\n        }\n        const defineGenericTypeRangeEnd = codeBlocks.length\n        postprocess = (eslintResult, context) => {\n            const diffOffset =\n                context.scriptSetupBlockRange[0] - scriptSetupBlockRangeStart\n            const defineGenericTypeRange = [\n                defineGenericTypeRangeStart + diffOffset,\n                defineGenericTypeRangeEnd + diffOffset,\n            ] as const\n\n            function isTypeBlock(\n                block: ESLintNode,\n            ): block is ESLintBlockStatement {\n                return (\n                    block.type === \"BlockStatement\" &&\n                    context.scriptSetupBlockRange[0] <= block.range[0] &&\n                    block.range[1] <= context.scriptSetupBlockRange[1]\n                )\n            }\n\n            generic.postprocess({\n                result: eslintResult,\n                getTypeBlock: (program) => program.body.find(isTypeBlock)!,\n                isRemoveTarget(nodeOrToken) {\n                    return (\n                        defineGenericTypeRange[0] <= nodeOrToken.range[0] &&\n                        nodeOrToken.range[1] <= defineGenericTypeRange[1]\n                    )\n                },\n                getTypeDefScope(scopeManager) {\n                    const moduleScope =\n                        scopeManager.globalScope.childScopes.find(\n                            (s) => s.type === \"module\",\n                        ) ?? scopeManager.globalScope\n                    return moduleScope.childScopes.find((scope) =>\n                        isTypeBlock(scope.block as ESLintNode),\n                    )!\n                },\n            })\n        }\n    }\n    codeBlocks.appendCodeBlocks(statementCodeBlocks)\n    codeBlocks.appendSplitPunctuators(\"}\")\n    const scriptSetupBlockRangeEnd = codeBlocks.length\n    codeBlocks.appendCodeBlocks(exportDefaultCodeBlocks)\n    return {\n        codeBlocks,\n        scriptSetupBlockRange: [\n            scriptSetupBlockRangeStart,\n            scriptSetupBlockRangeEnd,\n        ],\n        postprocess,\n        restoreASTCallbacks,\n    }\n\n    function getNodeFullRange(n: ESLintNode) {\n        let start = n.range[0]\n        let end = n.range[1]\n        traverseNodes(n, {\n            visitorKeys,\n            enterNode(c) {\n                start = Math.min(start, c.range[0])\n                end = Math.max(end, c.range[1])\n            },\n            leaveNode() {\n                // Do nothing.\n            },\n        })\n        return [start, end] as const\n    }\n\n    function checkToken(token: Token, value: string) {\n        if (token.value === value) {\n            return\n        }\n\n        const perr = new ParseError(\n            `Could not parse <script setup>. Expected \"${value}\", but it was \"${token.value}\".`,\n            undefined,\n            token.range[0],\n            token.loc.start.line,\n            token.loc.start.column,\n        )\n        fixErrorLocation(perr, offsetLocationCalculator)\n        throw perr\n    }\n}\n\nfunction remapAST(\n    result: ESLintExtendedProgram,\n    { scriptSetupBlockRange, codeBlocks }: ScriptSetupModuleCodeBlocks,\n): ESLintStatement[] {\n    if (!scriptSetupBlockRange) {\n        return []\n    }\n\n    let scriptSetupBlock: ESLintBlockStatement | null = null\n    const scriptSetupStatements: ESLintStatement[] = []\n    for (let index = result.ast.body.length - 1; index >= 0; index--) {\n        const body = result.ast.body[index]\n\n        if (body.type === \"BlockStatement\") {\n            if (\n                scriptSetupBlockRange[0] <= body.range[0] &&\n                body.range[1] <= scriptSetupBlockRange[1]\n            ) {\n                if (scriptSetupBlock) {\n                    throw new Error(\n                        `Unexpected state error: An unexpected block statement was found. ${JSON.stringify(\n                            body.loc,\n                        )}`,\n                    )\n                }\n                scriptSetupBlock = body\n                scriptSetupStatements.push(\n                    ...body.body.filter(\n                        (b) => !isSplitPunctuatorsEmptyStatement(b),\n                    ),\n                )\n                result.ast.body.splice(index, 1, ...scriptSetupStatements)\n            }\n        } else if (body.type === \"EmptyStatement\") {\n            if (isSplitPunctuatorsEmptyStatement(body)) {\n                // remove\n                result.ast.body.splice(index, 1)\n            }\n        }\n    }\n\n    if (result.scopeManager && scriptSetupBlock) {\n        const blockScope = result.scopeManager.acquire(\n            scriptSetupBlock as never,\n            true,\n        )!\n        remapScope(result.scopeManager, blockScope)\n    }\n\n    return scriptSetupStatements\n\n    function isSplitPunctuatorsEmptyStatement(body: ESLintStatement) {\n        return (\n            body.type === \"EmptyStatement\" &&\n            codeBlocks.splitPunctuators.includes(body.range[1] - 1)\n        )\n    }\n\n    function remapScope(scopeManager: ScopeManager, blockScope: Scope) {\n        const moduleScope = blockScope.upper!\n\n        // Restore references\n        for (const reference of blockScope.references) {\n            reference.from = moduleScope\n            moduleScope.references.push(reference)\n        }\n        // Restore variables\n        for (const variable of blockScope.variables) {\n            variable.scope = moduleScope\n            const alreadyVariable = moduleScope.variables.find(\n                (v) => v.name === variable.name,\n            )\n            if (alreadyVariable) {\n                alreadyVariable.defs.push(...variable.defs)\n                alreadyVariable.identifiers.push(...variable.identifiers)\n                alreadyVariable.references.push(...variable.references)\n                for (const reference of variable.references)    {\n                    reference.resolved = alreadyVariable\n                }\n            } else {\n                moduleScope.variables.push(variable)\n                moduleScope.set.set(variable.name, variable)\n            }\n        }\n        // Remove scope\n        const upper = blockScope.upper\n        if (upper) {\n            const index = upper.childScopes.indexOf(blockScope)\n            if (index >= 0) {\n                upper.childScopes.splice(index, 1)\n            }\n        }\n        const index = scopeManager.scopes.indexOf(blockScope)\n        if (index >= 0) {\n            scopeManager.scopes.splice(index, 1)\n        }\n    }\n}\n\nfunction remapLocationAndTokens(\n    result: ESLintExtendedProgram,\n    { codeBlocks }: ScriptSetupModuleCodeBlocks,\n    locationCalculator: LocationCalculator,\n) {\n    const tokens = result.ast.tokens ?? []\n\n    const endMap = new Map<number, number>()\n    const buffer: number[] = []\n    for (let index = tokens.length - 1; index >= 0; index--) {\n        const token = tokens[index]\n\n        if (\n            token.range[0] + 1 === token.range[1] &&\n            codeBlocks.splitPunctuators.includes(token.range[0])\n        ) {\n            // remove\n            tokens.splice(index, 1)\n            buffer.push(token.range[1])\n            continue\n        } else {\n            for (const end of buffer) {\n                endMap.set(end, token.range[1])\n            }\n            buffer.length = 0\n        }\n    }\n\n    traverseNodes(result.ast, {\n        visitorKeys: result.visitorKeys,\n        enterNode(node) {\n            const rangeEnd = endMap.get(node.range[1])\n            if (rangeEnd != null) {\n                node.range[1] = rangeEnd\n            }\n            if (node.end) {\n                const end = endMap.get(node.end)\n                if (end != null) {\n                    node.end = rangeEnd\n                }\n            }\n        },\n        leaveNode() {\n            // Do nothing.\n        },\n    })\n\n    fixLocations(result, locationCalculator)\n}\n","import { debug } from \"../common/debug\"\nimport type { OffsetRange } from \"../ast/index\"\nimport {\n    APOSTROPHE,\n    ASTERISK,\n    CARRIAGE_RETURN,\n    EOF,\n    isWhitespace,\n    LEFT_CURLY_BRACKET,\n    LEFT_PARENTHESIS,\n    LINE_FEED,\n    NULL,\n    QUOTATION_MARK,\n    REVERSE_SOLIDUS,\n    RIGHT_CURLY_BRACKET,\n    RIGHT_PARENTHESIS,\n    SOLIDUS,\n    COLON,\n    SEMICOLON,\n    LEFT_SQUARE_BRACKET,\n    RIGHT_SQUARE_BRACKET,\n} from \"../html/util/unicode\"\n\nexport const enum CSSTokenType {\n    Quoted = \"Quoted\",\n    Block = \"Block\",\n    Line = \"Line\",\n    Word = \"Word\",\n    Punctuator = \"Punctuator\",\n}\n\nexport interface CSSWordToken {\n    type: CSSTokenType.Word\n    value: string\n    range: OffsetRange\n}\nexport interface CSSQuotedToken {\n    type: CSSTokenType.Quoted\n    valueRange: OffsetRange\n    value: string\n    range: OffsetRange\n    quote: '\"' | \"'\"\n}\nexport interface CSSPunctuatorToken {\n    type: CSSTokenType.Punctuator\n    value: string\n    range: OffsetRange\n}\nexport interface CSSCommentToken {\n    type: CSSTokenType.Block | CSSTokenType.Line\n    valueRange: OffsetRange\n    value: string\n    range: OffsetRange\n}\nexport type CSSToken =\n    | CSSWordToken\n    | CSSQuotedToken\n    | CSSPunctuatorToken\n    | CSSCommentToken\n\nexport type CSSTokenizeOption = { inlineComment?: boolean }\n\n/**\n * A simplified CSS tokenizer.\n * The tokenizer is implemented with reference to the CSS specification,\n * but it does not follow it. This tokenizer only does the tokenization needed to properly handle `v-bind()`.\n * @see https://drafts.csswg.org/css-syntax/#tokenization\n */\nexport class CSSTokenizer {\n    // Reading\n    public readonly text: string\n    private readonly options: CSSTokenizeOption\n    private cp: number\n    private offset: number\n    private nextOffset: number\n\n    // Tokenizing\n    private reconsuming: boolean\n\n    /**\n     * Initialize this tokenizer.\n     * @param text The source code to tokenize.\n     * @param options The tokenizer options.\n     */\n    public constructor(\n        text: string,\n        startOffset: number,\n        options?: CSSTokenizeOption,\n    ) {\n        debug(\"[css] the source code length: %d\", text.length)\n        this.text = text\n        this.options = {\n            inlineComment: options?.inlineComment ?? false,\n        }\n        this.cp = NULL\n        this.offset = startOffset - 1\n        this.nextOffset = startOffset\n        this.reconsuming = false\n    }\n\n    /**\n     * Get the next token.\n     * @returns The next token or null.\n     */\n    public nextToken(): CSSToken | null {\n        let cp\n        if (this.reconsuming) {\n            cp = this.cp\n            this.reconsuming = false\n        } else {\n            cp = this.consumeNextCodePoint()\n        }\n        // Skip whitespaces\n        while (isWhitespace(cp)) {\n            cp = this.consumeNextCodePoint()\n        }\n        if (cp === EOF) {\n            return null\n        }\n\n        const start = this.offset\n        return this.consumeNextToken(cp, start)\n    }\n\n    /**\n     * Get the next code point.\n     * @returns The code point.\n     */\n    private nextCodePoint(): number {\n        if (this.nextOffset >= this.text.length) {\n            return EOF\n        }\n        return this.text.codePointAt(this.nextOffset)!\n    }\n\n    /**\n     * Consume the next code point.\n     * @returns The consumed code point.\n     */\n    private consumeNextCodePoint(): number {\n        if (this.offset >= this.text.length) {\n            this.cp = EOF\n            return EOF\n        }\n\n        this.offset = this.nextOffset\n\n        if (this.offset >= this.text.length) {\n            this.cp = EOF\n            return EOF\n        }\n\n        let cp = this.text.codePointAt(this.offset)!\n        if (cp === CARRIAGE_RETURN) {\n            this.nextOffset = this.offset + 1\n            if (this.text.codePointAt(this.nextOffset)! === LINE_FEED) {\n                this.nextOffset++\n            }\n            cp = LINE_FEED\n        } else {\n            this.nextOffset = this.offset + (cp >= 0x10000 ? 2 : 1)\n        }\n\n        this.cp = cp\n\n        return cp\n    }\n\n    private consumeNextToken(cp: number, start: number): CSSToken | null {\n        if (cp === SOLIDUS) {\n            const nextCp = this.nextCodePoint()\n            if (nextCp === ASTERISK) {\n                return this.consumeComment(start)\n            }\n            if (nextCp === SOLIDUS && this.options.inlineComment) {\n                return this.consumeInlineComment(start)\n            }\n        }\n        if (isQuote(cp)) {\n            return this.consumeString(start, cp)\n        }\n        if (isPunctuator(cp)) {\n            return {\n                type: CSSTokenType.Punctuator,\n                range: [start, start + 1],\n                value: String.fromCodePoint(cp),\n            }\n        }\n        return this.consumeWord(start)\n    }\n\n    /**\n     * Consume word\n     */\n    private consumeWord(start: number): CSSToken {\n        let cp = this.consumeNextCodePoint()\n        while (!isWhitespace(cp) && !isPunctuator(cp) && !isQuote(cp)) {\n            cp = this.consumeNextCodePoint()\n        }\n        this.reconsuming = true\n        const range: OffsetRange = [start, this.offset]\n        const text = this.text\n        let value: string\n        return {\n            type: CSSTokenType.Word,\n            range,\n            get value() {\n                return (value ??= text.slice(...range))\n            },\n        }\n    }\n\n    /**\n     * https://drafts.csswg.org/css-syntax/#consume-string-token\n     */\n    private consumeString(start: number, quote: number): CSSToken {\n        let valueEndOffset: number | null = null\n        let cp = this.consumeNextCodePoint()\n        while (cp !== EOF) {\n            if (cp === quote) {\n                valueEndOffset = this.offset\n                break\n            }\n            // PostCSS seems to continue parsing.\n            // if (cp === LINE_FEED) {\n            //     // Bad string\n            //     this.reconsuming = true\n            //     valueEndOffset = this.offset\n            //     break\n            // }\n            if (cp === REVERSE_SOLIDUS) {\n                // Escape\n                this.consumeNextCodePoint()\n            }\n            cp = this.consumeNextCodePoint()\n        }\n        const text = this.text\n        let value: string\n        const valueRange: OffsetRange = [\n            start + 1,\n            valueEndOffset ?? this.nextOffset,\n        ]\n        return {\n            type: CSSTokenType.Quoted,\n            range: [start, this.nextOffset],\n            valueRange,\n            get value() {\n                return (value ??= text.slice(...valueRange))\n            },\n            quote: String.fromCodePoint(quote) as never,\n        }\n    }\n    /**\n     * https://drafts.csswg.org/css-syntax/#consume-comment\n     */\n    private consumeComment(start: number): CSSToken {\n        this.consumeNextCodePoint() // consume \"*\"\n        let valueEndOffset: number | null = null\n        let cp = this.consumeNextCodePoint()\n        while (cp !== EOF) {\n            if (cp === ASTERISK) {\n                cp = this.consumeNextCodePoint()\n                if (cp === SOLIDUS) {\n                    valueEndOffset = this.offset - 1\n                    break\n                }\n            }\n            cp = this.consumeNextCodePoint()\n        }\n        const valueRange: OffsetRange = [\n            start + 2,\n            valueEndOffset ?? this.nextOffset,\n        ]\n        const text = this.text\n        let value: string\n        return {\n            type: CSSTokenType.Block,\n            range: [start, this.nextOffset],\n            valueRange,\n            get value() {\n                return (value ??= text.slice(...valueRange))\n            },\n        }\n    }\n    /**\n     * Consume inline comment\n     */\n    private consumeInlineComment(start: number): CSSToken {\n        this.consumeNextCodePoint() // consume \"/\"\n        let valueEndOffset: number | null = null\n        let cp = this.consumeNextCodePoint()\n        while (cp !== EOF) {\n            if (cp === LINE_FEED) {\n                valueEndOffset = this.offset - 1\n                break\n            }\n            cp = this.consumeNextCodePoint()\n        }\n        const valueRange: OffsetRange = [\n            start + 2,\n            valueEndOffset ?? this.nextOffset,\n        ]\n        const text = this.text\n        let value: string\n        return {\n            type: CSSTokenType.Line,\n            range: [start, this.nextOffset],\n            valueRange,\n            get value() {\n                return (value ??= text.slice(...valueRange))\n            },\n        }\n    }\n}\n\nfunction isPunctuator(cp: number): boolean {\n    return (\n        cp === COLON ||\n        cp === SEMICOLON ||\n        // Brackets\n        cp === LEFT_PARENTHESIS ||\n        cp === RIGHT_PARENTHESIS ||\n        cp === LEFT_CURLY_BRACKET ||\n        cp === RIGHT_CURLY_BRACKET ||\n        cp === LEFT_SQUARE_BRACKET ||\n        cp === RIGHT_SQUARE_BRACKET ||\n        // Maybe v-bind() in calc()\n        cp === SOLIDUS ||\n        cp === ASTERISK\n    )\n}\n\nfunction isQuote(cp: number): boolean {\n    return cp === APOSTROPHE || cp === QUOTATION_MARK\n}\n","import type {\n    OffsetRange,\n    Token,\n    VDocumentFragment,\n    VElement,\n    VExpressionContainer,\n    VStyleElement,\n    VText,\n} from \"../ast/index\"\nimport { ParseError } from \"../ast/index\"\nimport { getLang, getOwnerDocument } from \"../common/ast-utils\"\nimport { debug } from \"../common/debug\"\nimport { insertError } from \"../common/error-utils\"\nimport type { LocationCalculatorForHtml } from \"../common/location-calculator\"\nimport type { ParserOptions } from \"../common/parser-options\"\nimport {\n    createSimpleToken,\n    insertComments,\n    replaceAndSplitTokens,\n} from \"../common/token-utils\"\nimport { parseExpression } from \"../script/index\"\nimport { DEFAULT_ECMA_VERSION } from \"../script-setup/parser-options\"\nimport { resolveReferences } from \"../template/index\"\nimport type {\n    CSSCommentToken,\n    CSSPunctuatorToken,\n    CSSToken,\n    CSSTokenizeOption,\n} from \"./tokenizer\"\nimport { CSSTokenType, CSSTokenizer } from \"./tokenizer\"\n\nclass CSSTokenScanner {\n    private reconsuming: CSSToken[] = []\n    private tokenizer: CSSTokenizer\n    public constructor(text: string, options: CSSTokenizeOption) {\n        this.tokenizer = new CSSTokenizer(text, 0, options)\n    }\n    public nextToken(): CSSToken | null {\n        return this.reconsuming.shift() ?? this.tokenizer.nextToken()\n    }\n    public reconsume(...tokens: CSSToken[]) {\n        this.reconsuming.push(...tokens)\n    }\n}\n\n/**\n * Parse the source code of the given `<style>` elements.\n * @param elements The `<style>` elements to parse.\n * @param globalLocationCalculator The location calculator for fixLocations.\n * @param parserOptions The parser options.\n * @returns The result of parsing.\n */\nexport function parseStyleElements(\n    elements: VElement[],\n    globalLocationCalculator: LocationCalculatorForHtml,\n    originalParserOptions: ParserOptions,\n): void {\n    const parserOptions: ParserOptions = {\n        ...originalParserOptions,\n        ecmaVersion: originalParserOptions.ecmaVersion ?? DEFAULT_ECMA_VERSION,\n    }\n\n    for (const style of elements) {\n        ;(style as VStyleElement).style = true\n        parseStyleElement(\n            style as VStyleElement,\n            globalLocationCalculator,\n            parserOptions,\n            {\n                inlineComment: (getLang(style) || \"css\") !== \"css\",\n            },\n        )\n    }\n}\n\nfunction parseStyleElement(\n    style: VStyleElement,\n    globalLocationCalculator: LocationCalculatorForHtml,\n    parserOptions: ParserOptions,\n    cssOptions: CSSTokenizeOption,\n) {\n    if (style.children.length !== 1) {\n        return\n    }\n    const textNode = style.children[0]\n    if (textNode.type !== \"VText\") {\n        return\n    }\n    const code = textNode.value\n    // short circuit\n    if (!/v-bind\\s*(?:\\(|\\/)/u.test(code)) {\n        return\n    }\n\n    const locationCalculator = globalLocationCalculator.getSubCalculatorAfter(\n        textNode.range[0],\n    )\n    const document = getOwnerDocument(style)\n    parseStyle(\n        document,\n        style,\n        code,\n        locationCalculator,\n        parserOptions,\n        cssOptions,\n    )\n}\n\nfunction parseStyle(\n    document: VDocumentFragment | null,\n    style: VStyleElement,\n    code: string,\n    locationCalculator: LocationCalculatorForHtml,\n    parserOptions: ParserOptions,\n    cssOptions: CSSTokenizeOption,\n) {\n    let textStart = 0\n    for (const {\n        range,\n        exprRange,\n        quote,\n        openingParenOffset,\n        comments,\n    } of iterateVBind(code, cssOptions)) {\n        insertComments(\n            document,\n            comments.map((c) =>\n                createSimpleToken(\n                    c.type,\n                    locationCalculator.getOffsetWithGap(c.range[0]),\n                    locationCalculator.getOffsetWithGap(c.range[1]),\n                    c.value,\n                    locationCalculator,\n                ),\n            ),\n        )\n\n        const container: VExpressionContainer = {\n            type: \"VExpressionContainer\",\n            range: [\n                locationCalculator.getOffsetWithGap(range[0]),\n                locationCalculator.getOffsetWithGap(range[1]),\n            ],\n            loc: {\n                start: locationCalculator.getLocation(range[0]),\n                end: locationCalculator.getLocation(range[1]),\n            },\n            parent: style,\n            expression: null,\n            references: [],\n        }\n\n        const openingParenStart =\n            locationCalculator.getOffsetWithGap(openingParenOffset)\n        const beforeTokens: Token[] = [\n            createSimpleToken(\n                \"HTMLRawText\",\n                container.range[0],\n                container.range[0] + 6 /* v-bind */,\n                \"v-bind\",\n                locationCalculator,\n            ),\n            createSimpleToken(\n                \"Punctuator\",\n                openingParenStart,\n                openingParenStart + 1,\n                \"(\",\n                locationCalculator,\n            ),\n        ]\n        const afterTokens: Token[] = [\n            createSimpleToken(\n                \"Punctuator\",\n                container.range[1] - 1,\n                container.range[1],\n                \")\",\n                locationCalculator,\n            ),\n        ]\n        if (quote) {\n            const openStart = locationCalculator.getOffsetWithGap(\n                exprRange[0] - 1,\n            )\n            beforeTokens.push(\n                createSimpleToken(\n                    \"Punctuator\",\n                    openStart,\n                    openStart + 1,\n                    quote,\n                    locationCalculator,\n                ),\n            )\n            const closeStart = locationCalculator.getOffsetWithGap(exprRange[1])\n            afterTokens.unshift(\n                createSimpleToken(\n                    \"Punctuator\",\n                    closeStart,\n                    closeStart + 1,\n                    quote,\n                    locationCalculator,\n                ),\n            )\n        }\n        const beforeLast = beforeTokens[beforeTokens.length - 1]\n        replaceAndSplitTokens(\n            document,\n            {\n                range: [container.range[0], beforeLast.range[1]],\n                loc: { start: container.loc.start, end: beforeLast.loc.end },\n            },\n            beforeTokens,\n        )\n        const afterFirst = afterTokens[0]\n        replaceAndSplitTokens(\n            document,\n            {\n                range: [afterFirst.range[0], container.range[1]],\n                loc: { start: afterFirst.loc.start, end: container.loc.end },\n            },\n            afterTokens,\n        )\n\n        const lastChild = style.children[style.children.length - 1]\n        style.children.push(container)\n        if (lastChild.type === \"VText\") {\n            const newTextNode: VText = {\n                type: \"VText\",\n                range: [container.range[1], lastChild.range[1]],\n                loc: {\n                    start: { ...container.loc.end },\n                    end: { ...lastChild.loc.end },\n                },\n                parent: style,\n                value: code.slice(range[1]),\n            }\n            style.children.push(newTextNode)\n\n            lastChild.range[1] = container.range[0]\n            lastChild.loc.end = { ...container.loc.start }\n            lastChild.value = code.slice(textStart, range[0])\n            textStart = range[1]\n        }\n        try {\n            const ret = parseExpression(\n                code.slice(...exprRange),\n                locationCalculator.getSubCalculatorShift(exprRange[0]),\n                parserOptions,\n                { allowEmpty: false, allowFilters: false },\n            )\n            if (ret.expression) {\n                ret.expression.parent = container\n                container.expression = ret.expression\n                container.references = ret.references\n            }\n            replaceAndSplitTokens(\n                document,\n                {\n                    range: [beforeLast.range[1], afterFirst.range[0]],\n                    loc: {\n                        start: beforeLast.loc.end,\n                        end: afterFirst.loc.start,\n                    },\n                },\n                ret.tokens,\n            )\n            insertComments(document, ret.comments)\n\n            for (const variable of ret.variables) {\n                style.variables.push(variable)\n            }\n            resolveReferences(container)\n        } catch (err) {\n            debug(\"[style] Parse error: %s\", err)\n\n            if (ParseError.isParseError(err)) {\n                insertError(document, err)\n            } else {\n                throw err\n            }\n        }\n    }\n}\n\ntype VBindLocations = {\n    range: OffsetRange\n    exprRange: OffsetRange\n    quote: '\"' | \"'\" | null\n    openingParenOffset: number\n    comments: CSSCommentToken[]\n}\n\n/**\n * Iterate the `v-bind()` information.\n */\nfunction* iterateVBind(\n    code: string,\n    cssOptions: CSSTokenizeOption,\n): IterableIterator<VBindLocations> {\n    const tokenizer = new CSSTokenScanner(code, cssOptions)\n\n    let token\n    while ((token = tokenizer.nextToken())) {\n        if (token.type !== CSSTokenType.Word || token.value !== \"v-bind\") {\n            continue\n        }\n        const openingParen = findVBindOpeningParen(tokenizer)\n        if (!openingParen) {\n            continue\n        }\n        const arg = parseVBindArg(tokenizer)\n        if (!arg) {\n            continue\n        }\n        yield {\n            range: [token.range[0], arg.closingParen.range[1]],\n            exprRange: arg.exprRange,\n            quote: arg.quote,\n            openingParenOffset: openingParen.openingParen.range[0],\n            comments: [...openingParen.comments, ...arg.comments],\n        }\n    }\n}\n\nfunction findVBindOpeningParen(tokenizer: CSSTokenScanner): {\n    openingParen: CSSPunctuatorToken\n    comments: CSSCommentToken[]\n} | null {\n    const comments: CSSCommentToken[] = []\n    let token\n    while ((token = tokenizer.nextToken())) {\n        if (token.type === CSSTokenType.Punctuator && token.value === \"(\") {\n            return {\n                openingParen: token,\n                comments,\n            }\n        } else if (isComment(token)) {\n            // Comment between `v-bind` and opening paren.\n            comments.push(token)\n            continue\n        }\n        tokenizer.reconsume(...comments, token)\n        // There were no opening parens.\n        return null\n    }\n    return null\n}\n\nfunction parseVBindArg(tokenizer: CSSTokenScanner): {\n    exprRange: OffsetRange\n    quote: '\"' | \"'\" | null\n    closingParen: CSSPunctuatorToken\n    comments: CSSCommentToken[]\n} | null {\n    const tokensBuffer: CSSToken[] = []\n    const comments: CSSCommentToken[] = []\n    const tokens: CSSToken[] = []\n    const closeTokenStack: string[] = []\n    let token\n    while ((token = tokenizer.nextToken())) {\n        if (token.type === CSSTokenType.Punctuator) {\n            if (token.value === \")\" && !closeTokenStack.length) {\n                if (\n                    tokens.length === 1 &&\n                    tokens[0].type === CSSTokenType.Quoted\n                ) {\n                    // for v-bind( 'expr' ), and v-bind( /**/ 'expr' /**/ )\n                    const quotedToken = tokens[0]\n                    return {\n                        exprRange: quotedToken.valueRange,\n                        quote: quotedToken.quote,\n                        closingParen: token,\n                        comments,\n                    }\n                }\n                const startToken = tokensBuffer[0] ?? token\n                return {\n                    exprRange: [startToken.range[0], token.range[0]],\n                    quote: null,\n                    closingParen: token,\n                    comments: [],\n                }\n            }\n\n            if (token.value === closeTokenStack[0]) {\n                closeTokenStack.shift()\n            } else if (token.value === \"(\") {\n                closeTokenStack.unshift(\")\")\n            }\n        }\n\n        tokensBuffer.push(token)\n        if (isComment(token)) {\n            comments.push(token)\n        } else {\n            tokens.push(token)\n        }\n    }\n    tokenizer.reconsume(...tokensBuffer)\n    return null\n}\n\nfunction isComment(token: CSSToken): token is CSSCommentToken {\n    return token.type === CSSTokenType.Block || token.type === CSSTokenType.Line\n}\n","import type * as escopeTypes from \"eslint-scope\"\nimport type { ParserOptions } from \"../common/parser-options\"\nimport type {\n    Reference,\n    VAttribute,\n    VDirective,\n    VDocumentFragment,\n    VElement,\n    VExpressionContainer,\n} from \"../ast/index\"\nimport { traverseNodes } from \"../ast/index\"\nimport { getEslintScope } from \"../common/eslint-scope\"\nimport {\n    findGenericDirective,\n    isScriptElement,\n    isScriptSetupElement,\n} from \"../common/ast-utils\"\nimport { camelize } from \"../utils/utils\"\n\nconst BUILTIN_COMPONENTS = new Set([\n    \"template\",\n    \"slot\",\n    \"component\",\n    \"Component\",\n    \"transition\",\n    \"Transition\",\n    \"transition-group\",\n    \"TransitionGroup\",\n    \"keep-alive\",\n    \"KeepAlive\",\n    \"teleport\",\n    \"Teleport\",\n    \"suspense\",\n    \"Suspense\",\n])\n\nconst BUILTIN_DIRECTIVES = new Set([\n    \"bind\",\n    \"on\",\n    \"text\",\n    \"html\",\n    \"show\",\n    \"if\",\n    \"else\",\n    \"else-if\",\n    \"for\",\n    \"model\",\n    \"slot\",\n    \"pre\",\n    \"cloak\",\n    \"once\",\n    \"memo\",\n    \"is\",\n])\n\n/**\n * @see https://github.com/vuejs/core/blob/48de8a42b7fed7a03f7f1ff5d53d6a704252cafe/packages/shared/src/domTagConfig.ts#L5-L28\n */\n// https://developer.mozilla.org/en-US/docs/Web/HTML/Element\nconst HTML_TAGS =\n    \"html,body,base,head,link,meta,style,title,address,article,aside,footer,\" +\n    \"header,h1,h2,h3,h4,h5,h6,nav,section,div,dd,dl,dt,figcaption,\" +\n    \"figure,picture,hr,img,li,main,ol,p,pre,ul,a,b,abbr,bdi,bdo,br,cite,code,\" +\n    \"data,dfn,em,i,kbd,mark,q,rp,rt,ruby,s,samp,small,span,strong,sub,sup,\" +\n    \"time,u,var,wbr,area,audio,map,track,video,embed,object,param,source,\" +\n    \"canvas,script,noscript,del,ins,caption,col,colgroup,table,thead,tbody,td,\" +\n    \"th,tr,button,datalist,fieldset,form,input,label,legend,meter,optgroup,\" +\n    \"option,output,progress,select,textarea,details,dialog,menu,\" +\n    \"summary,template,blockquote,iframe,tfoot\"\n\n// https://developer.mozilla.org/en-US/docs/Web/SVG/Element\nconst SVG_TAGS =\n    \"svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,\" +\n    \"defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,\" +\n    \"feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,\" +\n    \"feDistanceLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,\" +\n    \"feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,\" +\n    \"fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,\" +\n    \"foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,\" +\n    \"mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,\" +\n    \"polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,\" +\n    \"text,textPath,title,tspan,unknown,use,view\"\n\nconst NATIVE_TAGS = new Set([...HTML_TAGS.split(\",\"), ...SVG_TAGS.split(\",\")])\n\nconst COMPILER_MACROS_AT_ROOT = new Set([\n    \"defineProps\",\n    \"defineEmits\",\n    \"defineExpose\",\n    \"withDefaults\",\n    // Added in Vue 3.3\n    \"defineOptions\",\n    \"defineSlots\",\n    // Added in Vue 3.4\n    \"defineModel\",\n])\n\nfunction capitalize(str: string) {\n    return str[0].toUpperCase() + str.slice(1)\n}\n\n/**\n * Analyze `<script setup>` scope.\n * This method does the following process:\n *\n * 1. Add a virtual reference to the variables used in the template to mark them as used.\n * (This is the same way typescript-eslint marks a `React` variable.)\n *\n * 2. If compiler macros were used, add these variables as global variables.\n */\nexport function analyzeScriptSetupScope(\n    scopeManager: escopeTypes.ScopeManager,\n    templateBody: VElement | undefined,\n    df: VDocumentFragment,\n    parserOptions: ParserOptions,\n): void {\n    analyzeUsedInTemplateVariables(scopeManager, templateBody, df)\n\n    analyzeScriptSetupVariables(scopeManager, df, parserOptions)\n}\n\nfunction extractVariables(scopeManager: escopeTypes.ScopeManager) {\n    const scriptVariables = new Map<string, escopeTypes.Variable>()\n    const globalScope = scopeManager.globalScope\n    if (!globalScope) {\n        return scriptVariables\n    }\n    for (const variable of globalScope.variables) {\n        scriptVariables.set(variable.name, variable)\n    }\n    const moduleScope = globalScope.childScopes.find(\n        (scope) => scope.type === \"module\",\n    )\n    for (const variable of moduleScope?.variables ?? []) {\n        scriptVariables.set(variable.name, variable)\n    }\n    return scriptVariables\n}\n\n/**\n * Analyze the variables used in the template.\n * Add a virtual reference to the variables used in the template to mark them as used.\n * (This is the same way typescript-eslint marks a `React` variable.)\n */\nfunction analyzeUsedInTemplateVariables(\n    scopeManager: escopeTypes.ScopeManager,\n    templateBody: VElement | undefined,\n    df: VDocumentFragment,\n) {\n    const scriptVariables = extractVariables(scopeManager)\n\n    const markedVariables = new Set<string>()\n\n    /**\n     * @see https://github.com/vuejs/vue-next/blob/48de8a42b7fed7a03f7f1ff5d53d6a704252cafe/packages/compiler-core/src/transforms/transformElement.ts#L335\n     */\n    function markSetupReferenceVariableAsUsed(name: string) {\n        if (scriptVariables.has(name)) {\n            markVariableAsUsed(name)\n            return true\n        }\n        const camelName = camelize(name)\n        if (scriptVariables.has(camelName)) {\n            markVariableAsUsed(camelName)\n            return true\n        }\n        const pascalName = capitalize(camelName)\n        if (scriptVariables.has(pascalName)) {\n            markVariableAsUsed(pascalName)\n            return true\n        }\n        return false\n    }\n\n    function markVariableAsUsed(nameOrRef: string | Reference) {\n        let name: string\n        let isValueReference: boolean | undefined\n        let isTypeReference: boolean | undefined\n        if (typeof nameOrRef === \"string\") {\n            name = nameOrRef\n        } else {\n            name = nameOrRef.id.name\n            isValueReference = nameOrRef.isValueReference\n            isTypeReference = nameOrRef.isTypeReference\n        }\n        const variable = scriptVariables.get(name)\n        if (!variable || variable.identifiers.length === 0) {\n            return\n        }\n        if (markedVariables.has(name)) {\n            return\n        }\n        markedVariables.add(name)\n\n        const reference = new (getEslintScope().Reference)()\n        ;(reference as any).vueUsedInTemplate = true // Mark for debugging.\n        reference.from = variable.scope\n        reference.identifier = variable.identifiers[0]\n        reference.isWrite = () => false\n        reference.isWriteOnly = () => false\n        reference.isRead = () => true\n        reference.isReadOnly = () => true\n        reference.isReadWrite = () => false\n        // For typescript-eslint\n        reference.isValueReference = isValueReference\n        reference.isTypeReference = isTypeReference\n\n        variable.references.push(reference)\n        reference.resolved = variable\n\n        // This needs to be marked to avoid false positives with `@typescript-eslint/no-unused-vars` and `no-useless-assignment`.\n        ;(variable as any).eslintUsed = true\n    }\n\n    function processVExpressionContainer(node: VExpressionContainer) {\n        for (const reference of node.references.filter(\n            (ref) => ref.variable == null,\n        )) {\n            markVariableAsUsed(reference)\n        }\n    }\n\n    function processVElement(node: VElement) {\n        if (\n            (node.rawName === node.name && NATIVE_TAGS.has(node.rawName)) ||\n            BUILTIN_COMPONENTS.has(node.rawName)\n        ) {\n            return\n        }\n        if (!markSetupReferenceVariableAsUsed(node.rawName)) {\n            // Check namespace\n            // https://github.com/vuejs/vue-next/blob/48de8a42b7fed7a03f7f1ff5d53d6a704252cafe/packages/compiler-core/src/transforms/transformElement.ts#L306\n            const dotIndex = node.rawName.indexOf(\".\")\n            if (dotIndex > 0) {\n                markSetupReferenceVariableAsUsed(\n                    node.rawName.slice(0, dotIndex),\n                )\n            }\n        }\n    }\n\n    function processVAttribute(node: VAttribute | VDirective) {\n        if (node.directive) {\n            if (BUILTIN_DIRECTIVES.has(node.key.name.name)) {\n                return\n            }\n            markSetupReferenceVariableAsUsed(`v-${node.key.name.rawName}`)\n        } else if (node.key.name === \"ref\" && node.value) {\n            markVariableAsUsed(node.value.value)\n        }\n    }\n\n    if (templateBody) {\n        // Analyze `<template>`\n        traverseNodes(templateBody, {\n            enterNode(node) {\n                if (node.type === \"VExpressionContainer\") {\n                    processVExpressionContainer(node)\n                } else if (node.type === \"VElement\") {\n                    processVElement(node)\n                } else if (node.type === \"VAttribute\") {\n                    processVAttribute(node)\n                }\n            },\n            leaveNode() {\n                /* noop */\n            },\n        })\n    }\n\n    for (const child of df.children) {\n        if (child.type === \"VElement\") {\n            if (isScriptSetupElement(child)) {\n                // Analyze <script setup lang=\"ts\" generic=\"...\">\n                const generic = findGenericDirective(child)\n                if (generic) {\n                    processVExpressionContainer(generic.value)\n                }\n            } else if (child.name === \"style\") {\n                // Analyze CSS v-bind()\n                for (const node of child.children) {\n                    if (node.type === \"VExpressionContainer\") {\n                        processVExpressionContainer(node)\n                    }\n                }\n            }\n        }\n    }\n}\n\n/**\n * Analyze <script setup> variables.\n * - Analyze compiler macros.\n *   If compiler macros were used, add these variables as global variables.\n * - Generic variables.\n *   If defined generics are used, add these variables as global variables.\n */\nfunction analyzeScriptSetupVariables(\n    scopeManager: escopeTypes.ScopeManager,\n    df: VDocumentFragment,\n    parserOptions: ParserOptions,\n) {\n    const globalScope = scopeManager.globalScope\n    if (!globalScope) {\n        return\n    }\n    const customMacros = new Set(\n        parserOptions.vueFeatures?.customMacros &&\n            Array.isArray(parserOptions.vueFeatures.customMacros)\n            ? parserOptions.vueFeatures.customMacros\n            : [],\n    )\n\n    const genericDefineNames = new Set<string>()\n    const scriptElements = df.children.filter(isScriptElement)\n    const scriptSetupElement = scriptElements.find(isScriptSetupElement)\n    if (scriptSetupElement && findGenericDirective(scriptSetupElement)) {\n        for (const variable of scriptSetupElement.variables) {\n            if (variable.kind === \"generic\") {\n                genericDefineNames.add(variable.id.name)\n            }\n        }\n    }\n\n    const newThrough: escopeTypes.Reference[] = []\n    for (const reference of globalScope.through) {\n        if (\n            COMPILER_MACROS_AT_ROOT.has(reference.identifier.name) ||\n            customMacros.has(reference.identifier.name)\n        ) {\n            if (\n                reference.from.type === \"global\" ||\n                reference.from.type === \"module\"\n            ) {\n                addCompilerMacroVariable(reference)\n                // This reference is removed from `Scope#through`.\n                continue\n            }\n        }\n        if (genericDefineNames.has(reference.identifier.name)) {\n            addGenericVariable(reference)\n            // This reference is removed from `Scope#through`.\n            continue\n        }\n\n        newThrough.push(reference)\n    }\n\n    globalScope.through = newThrough\n\n    function addCompilerMacroVariable(reference: escopeTypes.Reference) {\n        addVariable(globalScope, reference)\n    }\n\n    function addGenericVariable(reference: escopeTypes.Reference) {\n        addVariable(globalScope, reference)\n    }\n}\n\nfunction addVariable(\n    scope: escopeTypes.Scope,\n    reference: escopeTypes.Reference,\n) {\n    const name = reference.identifier.name\n    let variable = scope.set.get(name)\n    if (!variable) {\n        variable = new (getEslintScope().Variable)()\n        variable.name = name\n        variable.scope = scope\n        scope.variables.push(variable)\n        scope.set.set(name, variable)\n    }\n    // Links the variable and the reference.\n    reference.resolved = variable\n    variable.references.push(reference)\n}\n","","/**\n * @author Toru Nagashima <https://github.com/mysticatea>\n * @copyright 2017 Toru Nagashima. All rights reserved.\n * See LICENSE file in root directory for full license.\n */\nimport * as path from \"path\"\nimport * as AST from \"./ast/index\"\nimport { LocationCalculatorForHtml } from \"./common/location-calculator\"\nimport { HTMLParser, HTMLTokenizer } from \"./html/index\"\nimport { parseScript, parseScriptElement } from \"./script/index\"\nimport * as services from \"./parser-services\"\nimport type { ParserOptions } from \"./common/parser-options\"\nimport { getScriptParser, getParserLangFromSFC } from \"./common/parser-options\"\nimport { parseScriptSetupElements } from \"./script-setup/index\"\nimport { LinesAndColumns } from \"./common/lines-and-columns\"\nimport type { VElement } from \"./ast/index\"\nimport { DEFAULT_ECMA_VERSION } from \"./script-setup/parser-options\"\nimport {\n    getLang,\n    isScriptElement,\n    isScriptSetupElement,\n    isStyleElement,\n    isTemplateElement,\n} from \"./common/ast-utils\"\nimport { parseStyleElements } from \"./style/index\"\nimport { analyzeScope } from \"./script/scope-analyzer\"\nimport { analyzeScriptSetupScope } from \"./script-setup/scope-analyzer\"\nimport { name, version } from \"../package.json\" with { type: \"json\" }\n\nconst STARTS_WITH_LT = /^\\s*</u\n\n/**\n * Check whether the code is a Vue.js component.\n * @param code The source code to check.\n * @param options The parser options.\n * @returns `true` if the source code is a Vue.js component.\n */\nfunction isVueFile(code: string, options: ParserOptions): boolean {\n    const filePath = options.filePath || \"unknown.js\"\n    return path.extname(filePath) === \".vue\" || STARTS_WITH_LT.test(code)\n}\n\n/**\n * Parse the given source code.\n * @param code The source code to parse.\n * @param parserOptions The parser options.\n * @returns The parsing result.\n */\nexport function parseForESLint(\n    code: string,\n    parserOptions: any,\n): AST.ESLintExtendedProgram {\n    const options: ParserOptions = {\n        comment: true,\n        loc: true,\n        range: true,\n        tokens: true,\n        ...parserOptions,\n    }\n\n    let result: AST.ESLintExtendedProgram\n    let document: AST.VDocumentFragment | null\n    let locationCalculator: LocationCalculatorForHtml | null\n    if (!isVueFile(code, options)) {\n        result = parseAsScript(code, options)\n        document = null\n        locationCalculator = null\n    } else {\n        ;({ result, document, locationCalculator } = parseAsSFC(code, options))\n    }\n\n    result.services = {\n        ...result.services,\n        ...services.define(code, result.ast, document, locationCalculator, {\n            parserOptions: options,\n        }),\n    }\n\n    return result\n}\n\n/**\n * Parse the given source code.\n * @param code The source code to parse.\n * @param options The parser options.\n * @returns The parsing result.\n */\nexport function parse(code: string, options?: any): AST.ESLintProgram {\n    return parseForESLint(code, options).ast\n}\n\nexport { AST }\n\n// eslint-disable-next-line complexity -- ignore\nfunction parseAsSFC(code: string, options: ParserOptions) {\n    const optionsForTemplate = {\n        ...options,\n        ecmaVersion: options.ecmaVersion ?? DEFAULT_ECMA_VERSION,\n    }\n    const skipParsingScript = options.parser === false\n    const tokenizer = new HTMLTokenizer(code, optionsForTemplate)\n    const rootAST = new HTMLParser(tokenizer, optionsForTemplate).parse()\n\n    const locationCalculator = new LocationCalculatorForHtml(\n        tokenizer.gaps,\n        tokenizer.lineTerminators,\n    )\n    const scripts = rootAST.children.filter(isScriptElement)\n    const template = rootAST.children.find(isTemplateElement)\n    const templateLang = getLang(template) || \"html\"\n    const hasTemplateTokenizer = options?.templateTokenizer?.[templateLang]\n    const concreteInfo: AST.HasConcreteInfo = {\n        tokens: rootAST.tokens,\n        comments: rootAST.comments,\n        errors: rootAST.errors,\n    }\n    const templateBody =\n        template != null && (templateLang === \"html\" || hasTemplateTokenizer)\n            ? Object.assign(template, concreteInfo)\n            : undefined\n\n    const scriptParser = getScriptParser(options.parser, () =>\n        getParserLangFromSFC(rootAST),\n    )\n    let result: AST.ESLintExtendedProgram\n    let scriptSetup: VElement | undefined\n    if (skipParsingScript || !scripts.length) {\n        result = parseScript(\"\", {\n            ...options,\n            ecmaVersion: options.ecmaVersion ?? DEFAULT_ECMA_VERSION,\n            parser: scriptParser,\n        })\n    } else if (\n        scripts.length === 2 &&\n        (scriptSetup = scripts.find(isScriptSetupElement))\n    ) {\n        result = parseScriptSetupElements(\n            scriptSetup,\n            scripts.find((e) => e !== scriptSetup)!,\n            code,\n            new LinesAndColumns(tokenizer.lineTerminators),\n            {\n                ...options,\n                parser: scriptParser,\n            },\n        )\n    } else {\n        result = parseScriptElement(\n            scripts[0],\n            code,\n            new LinesAndColumns(tokenizer.lineTerminators),\n            {\n                ...options,\n                parser: scriptParser,\n            },\n        )\n    }\n\n    if (options.vueFeatures?.styleCSSVariableInjection ?? true) {\n        const styles = rootAST.children.filter(isStyleElement)\n        parseStyleElements(styles, locationCalculator, {\n            ...options,\n            parser: getScriptParser(options.parser, function* () {\n                yield \"<template>\"\n                yield getParserLangFromSFC(rootAST)\n            }),\n            project: undefined,\n            projectService: undefined,\n        })\n    }\n    result.ast.templateBody = templateBody\n\n    if (options.eslintScopeManager) {\n        if (scripts.some(isScriptSetupElement)) {\n            if (!result.scopeManager) {\n                result.scopeManager = analyzeScope(result.ast, options)\n            }\n            analyzeScriptSetupScope(\n                result.scopeManager,\n                templateBody,\n                rootAST,\n                options,\n            )\n        }\n    }\n\n    return {\n        result,\n        locationCalculator,\n        document: rootAST,\n    }\n}\n\nfunction parseAsScript(code: string, options: ParserOptions) {\n    return parseScript(code, {\n        ...options,\n        ecmaVersion: options.ecmaVersion ?? DEFAULT_ECMA_VERSION,\n        parser: getScriptParser(options.parser, () => {\n            const ext = (\n                path.extname(options.filePath || \"unknown.js\").toLowerCase() ||\n                \"\"\n            )\n                // remove dot\n                .slice(1)\n            if (/^[jt]sx$/u.test(ext)) {\n                return [ext, ext.slice(0, -1)]\n            }\n\n            return ext\n        }),\n    })\n}\n\nexport const meta = {\n    name,\n    version,\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA,SAAS,uBACL,GACoD;AACpD,QACI,OAAO,EAAE,YAAY,YACrB,OAAO,EAAE,QAAQ,YACjB,OAAO,EAAE,QAAQ,YACjB,EAAE,QAAQ,QACV,OAAO,EAAE,IAAI,SAAS,YACtB,OAAO,EAAE,IAAI,WAAW;;;;;;;AAShC,SAAS,UACL,GAC2E;AAC3E,QACI,EAAE,aAAa,eACf,OAAO,EAAE,YAAY,YACrB,OAAO,EAAE,UAAU,YACnB,OAAO,EAAE,eAAe,YACxB,OAAO,EAAE,WAAW,YACpB,EAAE,SAAS;;;;;AAOnB,IAAa,aAAb,MAAa,mBAAmB,YAAY;CACxC,AAAO;CACP,AAAO;CACP,AAAO;CACP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AAQ,KAAK,qBAAqB,EAAE;AACpC,OAAI,CAAC,OAAO,aACR,QAAO,eAAe,aAAa,OAAO,KAAK,QAAQ;AAE3D,2BACI,OAAO,cACP,cACA,SACA,QACH;;;AAIT,QAAO;EACH;EACA;EACA,UAAU;EACb;;AAGL,SAAS,cAAc,MAAc,SAAwB;AACzD,QAAOA,cAAY,MAAM;EACrB,GAAG;EACH,aAAa,QAAQ,eAAe;EACpC,QAAQ,gBAAgB,QAAQ,cAAc;GAC1C,MAAM,OACF,KAAK,QAAQ,QAAQ,YAAY,aAAa,CAAC,aAAa,IAC5D,IAGC,MAAM,EAAE;AACb,OAAI,YAAY,KAAK,IAAI,CACrB,QAAO,CAAC,KAAK,IAAI,MAAM,GAAG,GAAG,CAAC;AAGlC,UAAO;IACT;EACL,CAAC;;AAGN,MAAa,OAAO;CAChB;CACA;CACH"}Da;x   /**
 * @author Toru Nagashima <https://github.com/mysticatea>
 * See LICENSE file in root directory for full license.
 */
import { ScopeManager } from "eslint-scope";
import { Rule, SourceCode } from "eslint";
import { VisitorKeys as VisitorKeys$1 } from "eslint-visitor-keys";

//#region \0rolldown/runtime.js
//#endregion
//#region src/ast/errors.d.ts
/**
 * HTML parse errors.
 */
declare class ParseError extends SyntaxError {
  code?: ErrorCode;
  index: number;
  lineNumber: number;
  column: number;
  /**
   * Create new parser error object.
   * @param code The error code. See also: https://html.spec.whatwg.org/multipage/parsing.html#parse-errors
   * @param offset The offset number of this error.
   * @param line The line number of this error.
   * @param column The column number of this error.
   */
  static fromCode(code: ErrorCode, offset: number, line: number, column: number): ParseError;
  /**
   * Normalize the error object.
   * @param x The error object to normalize.
   */
  static normalize(x: any): ParseError | null;
  /**
   * Initialize this ParseError instance.
   * @param message The error message.
   * @param code The error code. See also: https://html.spec.whatwg.org/multipage/parsing.html#parse-errors
   * @param offset The offset number of this error.
   * @param line The line number of this error.
   * @param column The column number of this error.
   */
  constructor(message: string, code: ErrorCode | undefined, offset: number, line: number, column: number);
  /**
   * Type guard for ParseError.
   * @param x The value to check.
   * @returns `true` if the value has `message`, `pos`, `loc` properties.
   */
  static isParseError(x: any): x is ParseError;
}
/**
 * The error codes of HTML syntax errors.
 * https://html.spec.whatwg.org/multipage/parsing.html#parse-errors
 */
type ErrorCode = "abrupt-closing-of-empty-comment" | "absence-of-digits-in-numeric-character-reference" | "cdata-in-html-content" | "character-reference-outside-unicode-range" | "control-character-in-input-stream" | "control-character-reference" | "eof-before-tag-name" | "eof-in-cdata" | "eof-in-comment" | "eof-in-tag" | "incorrectly-closed-comment" | "incorrectly-opened-comment" | "invalid-first-character-of-tag-name" | "missing-attribute-value" | "missing-end-tag-name" | "missing-semicolon-after-character-reference" | "missing-whitespace-between-attributes" | "nested-comment" | "noncharacter-character-reference" | "noncharacter-in-input-stream" | "null-character-reference" | "surrogate-character-reference" | "surrogate-in-input-stream" | "unexpected-character-in-attribute-name" | "unexpected-character-in-unquoted-attribute-value" | "unexpected-equals-sign-before-attribute-name" | "unexpected-null-character" | "unexpected-question-mark-instead-of-tag-name" | "unexpected-solidus-in-tag" | "unknown-named-character-reference" | "end-tag-with-attributes" | "duplicate-attribute" | "end-tag-with-trailing-solidus" | "non-void-html-element-start-tag-with-trailing-solidus" | "x-invalid-end-tag" | "x-invalid-namespace" | "x-missing-interpolation-end";
//#endregion
//#region src/ast/locations.d.ts
/**
 * @author Toru Nagashima <https://github.com/mysticatea>
 * @copyright 2017 Toru Nagashima. All rights reserved.
 * See LICENSE file in root directory for full license.
 */
/**
 * Location information in lines and columns.
 */
interface Location {
  /**
   * The line number. This is 1-based.
   */
  line: number;
  /**
   * The column number. This is 0-based.
   */
  column: number;
}
/**
 * Range information in lines and columns.
 */
interface LocationRange {
  /**
   * The start location.
   */
  start: Location;
  /**
   * The end location.
   */
  end: Location;
}
/**
 * Location information in offsets.
 * This is 0-based.
 */
type Offset = number;
/**
 * Range information in offsets.
 * The 1st element is the start offset.
 * The 2nd element is the end offset.
 *
 * This is 0-based.
 */
type OffsetRange = [Offset, Offset];
/**
 * Objects which have their location.
 */
interface HasLocation {
  range: OffsetRange;
  loc: LocationRange;
  start?: number;
  end?: number;
}
//#endregion
//#region src/ast/tokens.d.ts
/**
 * Tokens.
 */
interface Token$1 extends HasLocation {
  /**
   * Token types.
   */
  type: string;
  /**
   * Processed values.
   */
  value: string;
}
//#endregion
//#region node_modules/@typescript-eslint/types/dist/generated/ast-spec.d.ts
declare type Accessibility = 'private' | 'protected' | 'public';
declare type AccessorProperty = AccessorPropertyComputedName | AccessorPropertyNonComputedName;
declare interface AccessorPropertyComputedName extends PropertyDefinitionComputedNameBase {
  type: AST_NODE_TYPES.AccessorProperty;
}
declare interface AccessorPropertyNonComputedName extends PropertyDefinitionNonComputedNameBase {
  type: AST_NODE_TYPES.AccessorProperty;
}
declare interface ArrayExpression extends BaseNode {
  type: AST_NODE_TYPES.ArrayExpression;
  /**
   * an element will be `null` in the case of a sparse array: `[1, ,3]`
   */
  elements: (Expression | SpreadElement | null)[];
}
declare interface ArrayPattern extends BaseNode {
  type: AST_NODE_TYPES.ArrayPattern;
  decorators: Decorator[];
  elements: (DestructuringPattern | null)[];
  optional: boolean;
  typeAnnotation: TSTypeAnnotation | undefined;
}
declare interface ArrowFunctionExpression extends BaseNode {
  type: AST_NODE_TYPES.ArrowFunctionExpression;
  async: boolean;
  body: BlockStatement | Expression;
  expression: boolean;
  generator: false;
  id: null;
  params: Parameter[];
  returnType: TSTypeAnnotation | undefined;
  typeParameters: TSTypeParameterDeclaration | undefined;
}
declare interface AssignmentExpression extends BaseNode {
  type: AST_NODE_TYPES.AssignmentExpression;
  left: Expression;
  operator: ValueOf<AssignmentOperatorToText>;
  right: Expression;
}
declare interface AssignmentOperatorToText {
  [SyntaxKind.AmpersandAmpersandEqualsToken]: '&&=';
  [SyntaxKind.AmpersandEqualsToken]: '&=';
  [SyntaxKind.AsteriskAsteriskEqualsToken]: '**=';
  [SyntaxKind.AsteriskEqualsToken]: '*=';
  [SyntaxKind.BarBarEqualsToken]: '||=';
  [SyntaxKind.BarEqualsToken]: '|=';
  [SyntaxKind.CaretEqualsToken]: '^=';
  [SyntaxKind.EqualsToken]: '=';
  [SyntaxKind.GreaterThanGreaterThanEqualsToken]: '>>=';
  [SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken]: '>>>=';
  [SyntaxKind.LessThanLessThanEqualsToken]: '<<=';
  [SyntaxKind.MinusEqualsToken]: '-=';
  [SyntaxKind.PercentEqualsToken]: '%=';
  [SyntaxKind.PlusEqualsToken]: '+=';
  [SyntaxKind.QuestionQuestionEqualsToken]: '??=';
  [SyntaxKind.SlashEqualsToken]: '/=';
}
declare interface AssignmentPattern extends BaseNode {
  type: AST_NODE_TYPES.AssignmentPattern;
  decorators: Decorator[];
  left: BindingName;
  optional: boolean;
  right: Expression;
  typeAnnotation: TSTypeAnnotation | undefined;
}
declare enum AST_NODE_TYPES {
  AccessorProperty = "AccessorProperty",
  ArrayExpression = "ArrayExpression",
  ArrayPattern = "ArrayPattern",
  ArrowFunctionExpression = "ArrowFunctionExpression",
  AssignmentExpression = "AssignmentExpression",
  AssignmentPattern = "AssignmentPattern",
  AwaitExpression = "AwaitExpression",
  BinaryExpression = "BinaryExpression",
  BlockStatement = "BlockStatement",
  BreakStatement = "BreakStatement",
  CallExpression = "CallExpression",
  CatchClause = "CatchClause",
  ChainExpression = "ChainExpression",
  ClassBody = "ClassBody",
  ClassDeclaration = "ClassDeclaration",
  ClassExpression = "ClassExpression",
  ConditionalExpression = "ConditionalExpression",
  ContinueStatement = "ContinueStatement",
  DebuggerStatement = "DebuggerStatement",
  Decorator = "Decorator",
  DoWhileStatement = "DoWhileStatement",
  EmptyStatement = "EmptyStatement",
  ExportAllDeclaration = "ExportAllDeclaration",
  ExportDefaultDeclaration = "ExportDefaultDeclaration",
  ExportNamedDeclaration = "ExportNamedDeclaration",
  ExportSpecifier = "ExportSpecifier",
  ExpressionStatement = "ExpressionStatement",
  ForInStatement = "ForInStatement",
  ForOfStatement = "ForOfStatement",
  ForStatement = "ForStatement",
  FunctionDeclaration = "FunctionDeclaration",
  FunctionExpression = "FunctionExpression",
  Identifier = "Identifier",
  IfStatement = "IfStatement",
  ImportAttribute = "ImportAttribute",
  ImportDeclaration = "ImportDeclaration",
  ImportDefaultSpecifier = "ImportDefaultSpecifier",
  ImportExpression = "ImportExpression",
  ImportNamespaceSpecifier = "ImportNamespaceSpecifier",
  ImportSpecifier = "ImportSpecifier",
  JSXAttribute = "JSXAttribute",
  JSXClosingElement = "JSXClosingElement",
  JSXClosingFragment = "JSXClosingFragment",
  JSXElement = "JSXElement",
  JSXEmptyExpression = "JSXEmptyExpression",
  JSXExpressionContainer = "JSXExpressionContainer",
  JSXFragment = "JSXFragment",
  JSXIdentifier = "JSXIdentifier",
  JSXMemberExpression = "JSXMemberExpression",
  JSXNamespacedName = "JSXNamespacedName",
  JSXOpeningElement = "JSXOpeningElement",
  JSXOpeningFragment = "JSXOpeningFragment",
  JSXSpreadAttribute = "JSXSpreadAttribute",
  JSXSpreadChild = "JSXSpreadChild",
  JSXText = "JSXText",
  LabeledStatement = "LabeledStatement",
  Literal = "Literal",
  LogicalExpression = "LogicalExpression",
  MemberExpression = "MemberExpression",
  MetaProperty = "MetaProperty",
  MethodDefinition = "MethodDefinition",
  NewExpression = "NewExpression",
  ObjectExpression = "ObjectExpression",
  ObjectPattern = "ObjectPattern",
  PrivateIdentifier = "PrivateIdentifier",
  Program = "Program",
  Property = "Property",
  PropertyDefinition = "PropertyDefinition",
  RestElement = "RestElement",
  ReturnStatement = "ReturnStatement",
  SequenceExpression = "SequenceExpression",
  SpreadElement = "SpreadElement",
  StaticBlock = "StaticBlock",
  Super = "Super",
  SwitchCase = "SwitchCase",
  SwitchStatement = "SwitchStatement",
  TaggedTemplateExpression = "TaggedTemplateExpression",
  TemplateElement = "TemplateElement",
  TemplateLiteral = "TemplateLiteral",
  ThisExpression = "ThisExpression",
  ThrowStatement = "ThrowStatement",
  TryStatement = "TryStatement",
  UnaryExpression = "UnaryExpression",
  UpdateExpression = "UpdateExpression",
  VariableDeclaration = "VariableDeclaration",
  VariableDeclarator = "VariableDeclarator",
  WhileStatement = "WhileStatement",
  WithStatement = "WithStatement",
  YieldExpression = "YieldExpression",
  TSAbstractAccessorProperty = "TSAbstractAccessorProperty",
  TSAbstractKeyword = "TSAbstractKeyword",
  TSAbstractMethodDefinition = "TSAbstractMethodDefinition",
  TSAbstractPropertyDefinition = "TSAbstractPropertyDefinition",
  TSAnyKeyword = "TSAnyKeyword",
  TSArrayType = "TSArrayType",
  TSAsExpression = "TSAsExpression",
  TSAsyncKeyword = "TSAsyncKeyword",
  TSBigIntKeyword = "TSBigIntKeyword",
  TSBooleanKeyword = "TSBooleanKeyword",
  TSCallSignatureDeclaration = "TSCallSignatureDeclaration",
  TSClassImplements = "TSClassImplements",
  TSConditionalType = "TSConditionalType",
  TSConstructorType = "TSConstructorType",
  TSConstructSignatureDeclaration = "TSConstructSignatureDeclaration",
  TSDeclareFunction = "TSDeclareFunction",
  TSDeclareKeyword = "TSDeclareKeyword",
  TSEmptyBodyFunctionExpression = "TSEmptyBodyFunctionExpression",
  TSEnumBody = "TSEnumBody",
  TSEnumDeclaration = "TSEnumDeclaration",
  TSEnumMember = "TSEnumMember",
  TSExportAssignment = "TSExportAssignment",
  TSExportKeyword = "TSExportKeyword",
  TSExternalModuleReference = "TSExternalModuleReference",
  TSFunctionType = "TSFunctionType",
  TSImportEqualsDeclaration = "TSImportEqualsDeclaration",
  TSImportType = "TSImportType",
  TSIndexedAccessType = "TSIndexedAccessType",
  TSIndexSignature = "TSIndexSignature",
  TSInferType = "TSInferType",
  TSInstantiationExpression = "TSInstantiationExpression",
  TSInterfaceBody = "TSInterfaceBody",
  TSInterfaceDeclaration = "TSInterfaceDeclaration",
  TSInterfaceHeritage = "TSInterfaceHeritage",
  TSIntersectionType = "TSIntersectionType",
  TSIntrinsicKeyword = "TSIntrinsicKeyword",
  TSLiteralType = "TSLiteralType",
  TSMappedType = "TSMappedType",
  TSMethodSignature = "TSMethodSignature",
  TSModuleBlock = "TSModuleBlock",
  TSModuleDeclaration = "TSModuleDeclaration",
  TSNamedTupleMember = "TSNamedTupleMember",
  TSNamespaceExportDeclaration = "TSNamespaceExportDeclaration",
  TSNeverKeyword = "TSNeverKeyword",
  TSNonNullExpression = "TSNonNullExpression",
  TSNullKeyword = "TSNullKeyword",
  TSNumberKeyword = "TSNumberKeyword",
  TSObjectKeyword = "TSObjectKeyword",
  TSOptionalType = "TSOptionalType",
  TSParameterProperty = "TSParameterProperty",
  TSPrivateKeyword = "TSPrivateKeyword",
  TSPropertySignature = "TSPropertySignature",
  TSProtectedKeyword = "TSProtectedKeyword",
  TSPublicKeyword = "TSPublicKeyword",
  TSQualifiedName = "TSQualifiedName",
  TSReadonlyKeyword = "TSReadonlyKeyword",
  TSRestType = "TSRestType",
  TSSatisfiesExpression = "TSSatisfiesExpression",
  TSStaticKeyword = "TSStaticKeyword",
  TSStringKeyword = "TSStringKeyword",
  TSSymbolKeyword = "TSSymbolKeyword",
  TSTemplateLiteralType = "TSTemplateLiteralType",
  TSThisType = "TSThisType",
  TSTupleType = "TSTupleType",
  TSTypeAliasDeclaration = "TSTypeAliasDeclaration",
  TSTypeAnnotation = "TSTypeAnnotation",
  TSTypeAssertion = "TSTypeAssertion",
  TSTypeLiteral = "TSTypeLiteral",
  TSTypeOperator = "TSTypeOperator",
  TSTypeParameter = "TSTypeParameter",
  TSTypeParameterDeclaration = "TSTypeParameterDeclaration",
  TSTypeParameterInstantiation = "TSTypeParameterInstantiation",
  TSTypePredicate = "TSTypePredicate",
  TSTypeQuery = "TSTypeQuery",
  TSTypeReference = "TSTypeReference",
  TSUndefinedKeyword = "TSUndefinedKeyword",
  TSUnionType = "TSUnionType",
  TSUnknownKeyword = "TSUnknownKeyword",
  TSVoidKeyword = "TSVoidKeyword"
}
declare enum AST_TOKEN_TYPES {
  Boolean = "Boolean",
  Identifier = "Identifier",
  JSXIdentifier = "JSXIdentifier",
  PrivateIdentifier = "PrivateIdentifier",
  JSXText = "JSXText",
  Keyword = "Keyword",
  Null = "Null",
  Numeric = "Numeric",
  Punctuator = "Punctuator",
  RegularExpression = "RegularExpression",
  String = "String",
  Template = "Template",
  Block = "Block",
  Line = "Line"
}
declare interface AwaitExpression extends BaseNode {
  type: AST_NODE_TYPES.AwaitExpression;
  argument: Expression;
}
declare interface BaseNode extends NodeOrTokenData {
  type: AST_NODE_TYPES;
}
declare interface BaseToken extends NodeOrTokenData {
  type: AST_TOKEN_TYPES;
  value: string;
}
declare interface BigIntLiteral extends LiteralBase {
  bigint: string;
  value: bigint | null;
}
declare type BinaryExpression = PrivateInExpression | SymmetricBinaryExpression;
declare interface BinaryOperatorToText {
  [SyntaxKind.AmpersandAmpersandToken]: '&&';
  [SyntaxKind.AmpersandToken]: '&';
  [SyntaxKind.AsteriskAsteriskToken]: '**';
  [SyntaxKind.AsteriskToken]: '*';
  [SyntaxKind.BarBarToken]: '||';
  [SyntaxKind.BarToken]: '|';
  [SyntaxKind.CaretToken]: '^';
  [SyntaxKind.EqualsEqualsEqualsToken]: '===';
  [SyntaxKind.EqualsEqualsToken]: '==';
  [SyntaxKind.ExclamationEqualsEqualsToken]: '!==';
  [SyntaxKind.ExclamationEqualsToken]: '!=';
  [SyntaxKind.GreaterThanEqualsToken]: '>=';
  [SyntaxKind.GreaterThanGreaterThanGreaterThanToken]: '>>>';
  [SyntaxKind.GreaterThanGreaterThanToken]: '>>';
  [SyntaxKind.GreaterThanToken]: '>';
  [SyntaxKind.InKeyword]: 'in';
  [SyntaxKind.InstanceOfKeyword]: 'instanceof';
  [SyntaxKind.LessThanEqualsToken]: '<=';
  [SyntaxKind.LessThanLessThanToken]: '<<';
  [SyntaxKind.LessThanToken]: '<';
  [SyntaxKind.MinusToken]: '-';
  [SyntaxKind.PercentToken]: '%';
  [SyntaxKind.PlusToken]: '+';
  [SyntaxKind.SlashToken]: '/';
}
declare type BindingName = BindingPattern | Identifier;
declare type BindingPattern = ArrayPattern | ObjectPattern;
declare interface BlockComment extends BaseToken {
  type: AST_TOKEN_TYPES.Block;
}
declare interface BlockStatement extends BaseNode {
  type: AST_NODE_TYPES.BlockStatement;
  body: Statement[];
}
declare interface BooleanLiteral extends LiteralBase {
  raw: 'false' | 'true';
  value: boolean;
}
declare interface BooleanToken extends BaseToken {
  type: AST_TOKEN_TYPES.Boolean;
}
declare interface BreakStatement extends BaseNode {
  type: AST_NODE_TYPES.BreakStatement;
  label: Identifier | null;
}
declare interface CallExpression extends BaseNode {
  type: AST_NODE_TYPES.CallExpression;
  arguments: CallExpressionArgument[];
  callee: Expression;
  optional: boolean;
  typeArguments: TSTypeParameterInstantiation | undefined;
}
declare type CallExpressionArgument = Expression | SpreadElement;
declare interface CatchClause extends BaseNode {
  type: AST_NODE_TYPES.CatchClause;
  body: BlockStatement;
  param: BindingName | null;
}
declare type ChainElement = CallExpression | MemberExpression | TSNonNullExpression;
declare interface ChainExpression extends BaseNode {
  type: AST_NODE_TYPES.ChainExpression;
  expression: ChainElement;
}
declare interface ClassBase extends BaseNode {
  /**
   * Whether the class is an abstract class.
   * @example
   * ```ts
   * abstract class Foo {}
   * ```
   */
  abstract: boolean;
  /**
   * The class body.
   */
  body: ClassBody;
  /**
   * Whether the class has been `declare`d:
   * @example
   * ```ts
   * declare class Foo {}
   * ```
   */
  declare: boolean;
  /**
   * The decorators declared for the class.
   * @example
   * ```ts
   * @deco
   * class Foo {}
   * ```
   */
  decorators: Decorator[];
  /**
   * The class's name.
   * - For a `ClassExpression` this may be `null` if the name is omitted.
   * - For a `ClassDeclaration` this may be `null` if and only if the parent is
   *   an `ExportDefaultDeclaration`.
   */
  id: Identifier | null;
  /**
   * The implemented interfaces for the class.
   */
  implements: TSClassImplements[];
  /**
   * The super class this class extends.
   */
  superClass: LeftHandSideExpression | null;
  /**
   * The generic type parameters passed to the superClass.
   */
  superTypeArguments: TSTypeParameterInstantiation | undefined;
  /**
   * The generic type parameters declared for the class.
   */
  typeParameters: TSTypeParameterDeclaration | undefined;
}
declare interface ClassBody extends BaseNode {
  type: AST_NODE_TYPES.ClassBody;
  body: ClassElement[];
}
declare type ClassDeclaration = ClassDeclarationWithName | ClassDeclarationWithOptionalName;
declare interface ClassDeclarationBase extends ClassBase {
  type: AST_NODE_TYPES.ClassDeclaration;
}
/**
 * A normal class declaration:
 * ```
 * class A {}
 * ```
 */
declare interface ClassDeclarationWithName extends ClassDeclarationBase {
  id: Identifier;
}
/**
 * Default-exported class declarations have optional names:
 * ```
 * export default class {}
 * ```
 */
declare interface ClassDeclarationWithOptionalName extends ClassDeclarationBase {
  id: Identifier | null;
}
declare type ClassElement = AccessorProperty | MethodDefinition | PropertyDefinition | StaticBlock | TSAbstractAccessorProperty | TSAbstractMethodDefinition | TSAbstractPropertyDefinition | TSIndexSignature;
declare interface ClassExpression extends ClassBase {
  type: AST_NODE_TYPES.ClassExpression;
  abstract: false;
  declare: false;
}
declare interface ClassMethodDefinitionNonComputedNameBase extends MethodDefinitionBase {
  computed: false;
  key: ClassPropertyNameNonComputed;
}
declare interface ClassPropertyDefinitionNonComputedNameBase extends PropertyDefinitionBase {
  computed: false;
  key: ClassPropertyNameNonComputed;
}
declare type ClassPropertyNameNonComputed = PrivateIdentifier | PropertyNameNonComputed;
declare type Comment = BlockComment | LineComment;
declare interface ConditionalExpression extends BaseNode {
  type: AST_NODE_TYPES.ConditionalExpression;
  alternate: Expression;
  consequent: Expression;
  test: Expression;
}
declare interface ConstDeclaration extends LetOrConstOrVarDeclarationBase {
  /**
   * In a `declare const` declaration, the declarators may have initializers, but
   * not definite assignment assertions. Each declarator cannot have both an
   * initializer and a type annotation.
   *
   * Even if the declaration has no `declare`, it may still be ambient and have
   * no initializer.
   */
  declarations: VariableDeclaratorMaybeInit[];
  kind: 'const';
}
declare interface ContinueStatement extends BaseNode {
  type: AST_NODE_TYPES.ContinueStatement;
  label: Identifier | null;
}
declare interface DebuggerStatement extends BaseNode {
  type: AST_NODE_TYPES.DebuggerStatement;
}
declare interface Decorator extends BaseNode {
  type: AST_NODE_TYPES.Decorator;
  expression: LeftHandSideExpression;
}
declare type DefaultExportDeclarations = ClassDeclarationWithOptionalName | Expression | FunctionDeclarationWithName | FunctionDeclarationWithOptionalName | TSDeclareFunction | TSEnumDeclaration | TSInterfaceDeclaration | TSModuleDeclaration | TSTypeAliasDeclaration | VariableDeclaration;
declare type DestructuringPattern = ArrayPattern | AssignmentPattern | Identifier | MemberExpression | ObjectPattern | RestElement;
declare interface DoWhileStatement extends BaseNode {
  type: AST_NODE_TYPES.DoWhileStatement;
  body: Statement;
  test: Expression;
}
declare interface EmptyStatement extends BaseNode {
  type: AST_NODE_TYPES.EmptyStatement;
}
declare type EntityName = Identifier | ThisExpression | TSQualifiedName;
declare interface ExportAllDeclaration extends BaseNode {
  type: AST_NODE_TYPES.ExportAllDeclaration;
  /**
   * The assertions declared for the export.
   * @example
   * ```ts
   * export * from 'mod' assert \{ type: 'json' \};
   * ```
   * @deprecated Replaced with {@link `attributes`}.
   */
  assertions: ImportAttribute[];
  /**
   * The attributes declared for the export.
   * @example
   * ```ts
   * export * from 'mod' with \{ type: 'json' \};
   * ```
   */
  attributes: ImportAttribute[];
  /**
   * The name for the exported items (`as X`). `null` if no name is assigned.
   */
  exported: Identifier | null;
  /**
   * The kind of the export.
   */
  exportKind: ExportKind;
  /**
   * The source module being exported from.
   */
  source: StringLiteral;
}
declare type ExportAndImportKind = 'type' | 'value';
declare interface ExportDefaultDeclaration extends BaseNode {
  type: AST_NODE_TYPES.ExportDefaultDeclaration;
  /**
   * The declaration being exported.
   */
  declaration: DefaultExportDeclarations;
  /**
   * The kind of the export. Always `value` for default exports.
   */
  exportKind: 'value';
}
declare type ExportKind = ExportAndImportKind;
declare type ExportNamedDeclaration = ExportNamedDeclarationWithoutSourceWithMultiple | ExportNamedDeclarationWithoutSourceWithSingle | ExportNamedDeclarationWithSource;
declare interface ExportNamedDeclarationBase extends BaseNode {
  type: AST_NODE_TYPES.ExportNamedDeclaration;
  /**
   * The assertions declared for the export.
   * @example
   * ```ts
   * export { foo } from 'mod' assert \{ type: 'json' \};
   * ```
   * This will be an empty array if `source` is `null`
   * @deprecated Replaced with {@link `attributes`}.
   */
  assertions: ImportAttribute[];
  /**
   * The attributes declared for the export.
   * @example
   * ```ts
   * export { foo } from 'mod' with \{ type: 'json' \};
   * ```
   * This will be an empty array if `source` is `null`
   */
  attributes: ImportAttribute[];
  /**
   * The exported declaration.
   * @example
   * ```ts
   * export const x = 1;
   * ```
   * This will be `null` if `source` is not `null`, or if there are `specifiers`
   */
  declaration: NamedExportDeclarations | null;
  /**
   * The kind of the export.
   */
  exportKind: ExportKind;
  /**
   * The source module being exported from.
   */
  source: StringLiteral | null;
  /**
   * The specifiers being exported.
   * @example
   * ```ts
   * export { a, b };
   * ```
   * This will be an empty array if `declaration` is not `null`
   */
  specifiers: ExportSpecifier[];
}
/**
 * Exporting names from the current module.
 * ```
 * export {};
 * export { a, b };
 * ```
 */
declare interface ExportNamedDeclarationWithoutSourceWithMultiple extends ExportNamedDeclarationBase {
  /**
   * This will always be an empty array.
   * @deprecated Replaced with {@link `attributes`}.
   */
  assertions: ImportAttribute[];
  /**
   * This will always be an empty array.
   */
  attributes: ImportAttribute[];
  declaration: null;
  source: null;
  specifiers: ExportSpecifierWithIdentifierLocal[];
}
/**
 * Exporting a single named declaration.
 * ```
 * export const x = 1;
 * ```
 */
declare interface ExportNamedDeclarationWithoutSourceWithSingle extends ExportNamedDeclarationBase {
  /**
   * This will always be an empty array.
   * @deprecated Replaced with {@link `attributes`}.
   */
  assertions: ImportAttribute[];
  /**
   * This will always be an empty array.
   */
  attributes: ImportAttribute[];
  declaration: NamedExportDeclarations;
  source: null;
  /**
   * This will always be an empty array.
   */
  specifiers: ExportSpecifierWithIdentifierLocal[];
}
/**
 * Export names from another module.
 * ```
 * export { a, b } from 'mod';
 * ```
 */
declare interface ExportNamedDeclarationWithSource extends ExportNamedDeclarationBase {
  declaration: null;
  source: StringLiteral;
}
declare type ExportSpecifier = ExportSpecifierWithIdentifierLocal | ExportSpecifierWithStringOrLiteralLocal;
declare interface ExportSpecifierBase extends BaseNode {
  type: AST_NODE_TYPES.ExportSpecifier;
  exported: Identifier | StringLiteral;
  exportKind: ExportKind;
  local: Identifier | StringLiteral;
}
declare interface ExportSpecifierWithIdentifierLocal extends ExportSpecifierBase {
  local: Identifier;
}
declare interface ExportSpecifierWithStringOrLiteralLocal extends ExportSpecifierBase {
  local: Identifier | StringLiteral;
}
declare type Expression = ArrayExpression | ArrayPattern | ArrowFunctionExpression | AssignmentExpression | AwaitExpression | BinaryExpression | CallExpression | ChainExpression | ClassExpression | ConditionalExpression | FunctionExpression | Identifier | ImportExpression | JSXElement | JSXFragment | LiteralExpression | LogicalExpression | MemberExpression | MetaProperty | NewExpression | ObjectExpression | ObjectPattern | SequenceExpression | Super | TaggedTemplateExpression | TemplateLiteral | ThisExpression | TSAsExpression | TSInstantiationExpression | TSNonNullExpression | TSSatisfiesExpression | TSTypeAssertion | UnaryExpression | UpdateExpression | YieldExpression;
declare interface ExpressionStatement extends BaseNode {
  type: AST_NODE_TYPES.ExpressionStatement;
  directive: string | undefined;
  expression: Expression;
}
declare type ForInitialiser = Expression | LetOrConstOrVarDeclaration;
declare interface ForInStatement extends BaseNode {
  type: AST_NODE_TYPES.ForInStatement;
  body: Statement;
  left: ForInitialiser;
  right: Expression;
}
declare type ForOfInitialiser = Expression | LetOrConstOrVarDeclaration | UsingInForOfDeclaration;
declare interface ForOfStatement extends BaseNode {
  type: AST_NODE_TYPES.ForOfStatement;
  await: boolean;
  body: Statement;
  left: ForOfInitialiser;
  right: Expression;
}
declare interface ForStatement extends BaseNode {
  type: AST_NODE_TYPES.ForStatement;
  body: Statement;
  init: Expression | ForInitialiser | null;
  test: Expression | null;
  update: Expression | null;
}
declare interface FunctionBase extends BaseNode {
  /**
   * Whether the function is async:
   * ```
   * async function foo() {}
   * const x = async function () {}
   * const x = async () => {}
   * ```
   */
  async: boolean;
  /**
   * The body of the function.
   * - For an `ArrowFunctionExpression` this may be an `Expression` or `BlockStatement`.
   * - For a `FunctionDeclaration` or `FunctionExpression` this is always a `BlockStatement`.
   * - For a `TSDeclareFunction` this is always `undefined`.
   * - For a `TSEmptyBodyFunctionExpression` this is always `null`.
   */
  body: BlockStatement | Expression | null | undefined;
  /**
   * This is only `true` if and only if the node is a `TSDeclareFunction` and it has `declare`:
   * ```
   * declare function foo() {}
   * ```
   */
  declare: boolean;
  /**
   * This is only ever `true` if and only the node is an `ArrowFunctionExpression` and the body
   * is an expression:
   * ```
   * (() => 1)
   * ```
   */
  expression: boolean;
  /**
   * Whether the function is a generator function:
   * ```
   * function *foo() {}
   * const x = function *() {}
   * ```
   * This is always `false` for arrow functions as they cannot be generators.
   */
  generator: boolean;
  /**
   * The function's name.
   * - For an `ArrowFunctionExpression` this is always `null`.
   * - For a `FunctionExpression` this may be `null` if the name is omitted.
   * - For a `FunctionDeclaration` or `TSDeclareFunction` this may be `null` if
   *   and only if the parent is an `ExportDefaultDeclaration`.
   */
  id: Identifier | null;
  /**
   * The list of parameters declared for the function.
   */
  params: Parameter[];
  /**
   * The return type annotation for the function.
   */
  returnType: TSTypeAnnotation | undefined;
  /**
   * The generic type parameter declaration for the function.
   */
  typeParameters: TSTypeParameterDeclaration | undefined;
}
declare type FunctionDeclaration = FunctionDeclarationWithName | FunctionDeclarationWithOptionalName;
declare interface FunctionDeclarationBase extends FunctionBase {
  type: AST_NODE_TYPES.FunctionDeclaration;
  body: BlockStatement;
  declare: false;
  expression: false;
}
/**
 * A normal function declaration:
 * ```
 * function f() {}
 * ```
 */
declare interface FunctionDeclarationWithName extends FunctionDeclarationBase {
  id: Identifier;
}
/**
 * Default-exported function declarations have optional names:
 * ```
 * export default function () {}
 * ```
 */
declare interface FunctionDeclarationWithOptionalName extends FunctionDeclarationBase {
  id: Identifier | null;
}
declare interface FunctionExpression extends FunctionBase {
  type: AST_NODE_TYPES.FunctionExpression;
  body: BlockStatement;
  expression: false;
}
declare type FunctionLike = ArrowFunctionExpression | FunctionDeclaration | FunctionExpression | TSDeclareFunction | TSEmptyBodyFunctionExpression;
declare interface Identifier extends BaseNode {
  type: AST_NODE_TYPES.Identifier;
  decorators: Decorator[];
  name: string;
  optional: boolean;
  typeAnnotation: TSTypeAnnotation | undefined;
}
declare interface IdentifierToken extends BaseToken {
  type: AST_TOKEN_TYPES.Identifier;
}
declare interface IfStatement extends BaseNode {
  type: AST_NODE_TYPES.IfStatement;
  alternate: Statement | null;
  consequent: Statement;
  test: Expression;
}
declare interface ImportAttribute extends BaseNode {
  type: AST_NODE_TYPES.ImportAttribute;
  key: Identifier | Literal;
  value: Literal;
}
declare type ImportClause = ImportDefaultSpecifier | ImportNamespaceSpecifier | ImportSpecifier;
declare interface ImportDeclaration extends BaseNode {
  type: AST_NODE_TYPES.ImportDeclaration;
  /**
   * The assertions declared for the export.
   * @example
   * ```ts
   * import * from 'mod' assert \{ type: 'json' \};
   * ```
   * @deprecated Replaced with {@link `attributes`}.
   */
  assertions: ImportAttribute[];
  /**
   * The attributes declared for the export.
   * @example
   * ```ts
   * import * from 'mod' with \{ type: 'json' \};
   * ```
   */
  attributes: ImportAttribute[];
  /**
   * The kind of the import.
   */
  importKind: ImportKind;
  /**
   * The source module being imported from.
   */
  source: StringLiteral;
  /**
   * The specifiers being imported.
   * If this is an empty array then either there are no specifiers:
   * ```
   * import {} from 'mod';
   * ```
   * Or it is a side-effect import:
   * ```
   * import 'mod';
   * ```
   */
  specifiers: ImportClause[];
}
declare interface ImportDefaultSpecifier extends BaseNode {
  type: AST_NODE_TYPES.ImportDefaultSpecifier;
  local: Identifier;
}
declare interface ImportExpression extends BaseNode {
  type: AST_NODE_TYPES.ImportExpression;
  /**
   * The attributes declared for the dynamic import.
   * @example
   * ```ts
   * import('mod', \{ assert: \{ type: 'json' \} \});
   * ```
   * @deprecated Replaced with {@link `options`}.
   */
  attributes: Expression | null;
  /**
   * The options bag declared for the dynamic import.
   * @example
   * ```ts
   * import('mod', \{ assert: \{ type: 'json' \} \});
   * ```
   */
  options: Expression | null;
  source: Expression;
}
declare type ImportKind = ExportAndImportKind;
declare interface ImportNamespaceSpecifier extends BaseNode {
  type: AST_NODE_TYPES.ImportNamespaceSpecifier;
  local: Identifier;
}
declare interface ImportSpecifier extends BaseNode {
  type: AST_NODE_TYPES.ImportSpecifier;
  imported: Identifier | StringLiteral;
  importKind: ImportKind;
  local: Identifier;
}
declare interface JSXAttribute extends BaseNode {
  type: AST_NODE_TYPES.JSXAttribute;
  name: JSXIdentifier | JSXNamespacedName;
  value: JSXElement | JSXExpression | Literal | null;
}
declare type JSXChild = JSXElement | JSXExpression | JSXFragment | JSXText;
declare interface JSXClosingElement extends BaseNode {
  type: AST_NODE_TYPES.JSXClosingElement;
  name: JSXTagNameExpression;
}
declare interface JSXClosingFragment extends BaseNode {
  type: AST_NODE_TYPES.JSXClosingFragment;
}
declare interface JSXElement extends BaseNode {
  type: AST_NODE_TYPES.JSXElement;
  children: JSXChild[];
  closingElement: JSXClosingElement | null;
  openingElement: JSXOpeningElement;
}
declare interface JSXEmptyExpression extends BaseNode {
  type: AST_NODE_TYPES.JSXEmptyExpression;
}
declare type JSXExpression = JSXExpressionContainer | JSXSpreadChild;
declare interface JSXExpressionContainer extends BaseNode {
  type: AST_NODE_TYPES.JSXExpressionContainer;
  expression: Expression | JSXEmptyExpression;
}
declare interface JSXFragment extends BaseNode {
  type: AST_NODE_TYPES.JSXFragment;
  children: JSXChild[];
  closingFragment: JSXClosingFragment;
  openingFragment: JSXOpeningFragment;
}
declare interface JSXIdentifier extends BaseNode {
  type: AST_NODE_TYPES.JSXIdentifier;
  name: string;
}
declare interface JSXIdentifierToken extends BaseToken {
  type: AST_TOKEN_TYPES.JSXIdentifier;
}
declare interface JSXMemberExpression extends BaseNode {
  type: AST_NODE_TYPES.JSXMemberExpression;
  object: JSXTagNameExpression;
  property: JSXIdentifier;
}
declare interface JSXNamespacedName extends BaseNode {
  type: AST_NODE_TYPES.JSXNamespacedName;
  name: JSXIdentifier;
  namespace: JSXIdentifier;
}
declare interface JSXOpeningElement extends BaseNode {
  type: AST_NODE_TYPES.JSXOpeningElement;
  attributes: (JSXAttribute | JSXSpreadAttribute)[];
  name: JSXTagNameExpression;
  selfClosing: boolean;
  typeArguments: TSTypeParameterInstantiation | undefined;
}
declare interface JSXOpeningFragment extends BaseNode {
  type: AST_NODE_TYPES.JSXOpeningFragment;
}
declare interface JSXSpreadAttribute extends BaseNode {
  type: AST_NODE_TYPES.JSXSpreadAttribute;
  argument: Expression;
}
declare interface JSXSpreadChild extends BaseNode {
  type: AST_NODE_TYPES.JSXSpreadChild;
  expression: Expression | JSXEmptyExpression;
}
declare type JSXTagNameExpression = JSXIdentifier | JSXMemberExpression | JSXNamespacedName;
declare interface JSXText extends BaseNode {
  type: AST_NODE_TYPES.JSXText;
  raw: string;
  value: string;
}
declare interface JSXTextToken extends BaseToken {
  type: AST_TOKEN_TYPES.JSXText;
}
declare interface KeywordToken extends BaseToken {
  type: AST_TOKEN_TYPES.Keyword;
}
declare interface LabeledStatement extends BaseNode {
  type: AST_NODE_TYPES.LabeledStatement;
  body: Statement;
  label: Identifier;
}
declare type LeftHandSideExpression = ArrayExpression | ArrayPattern | ArrowFunctionExpression | CallExpression | ClassExpression | FunctionExpression | Identifier | JSXElement | JSXFragment | LiteralExpression | MemberExpression | MetaProperty | ObjectExpression | ObjectPattern | SequenceExpression | Super | TaggedTemplateExpression | ThisExpression | TSAsExpression | TSNonNullExpression | TSTypeAssertion;
declare type LetOrConstOrVarDeclaration = ConstDeclaration | LetOrVarDeclaredDeclaration | LetOrVarNonDeclaredDeclaration;
declare interface LetOrConstOrVarDeclarationBase extends BaseNode {
  type: AST_NODE_TYPES.VariableDeclaration;
  /**
   * The variables declared by this declaration.
   * Always non-empty.
   * @example
   * ```ts
   * let x;
   * let y, z;
   * ```
   */
  declarations: LetOrConstOrVarDeclarator[];
  /**
   * Whether the declaration is `declare`d
   * @example
   * ```ts
   * declare const x = 1;
   * ```
   */
  declare: boolean;
  /**
   * The keyword used to declare the variable(s)
   * @example
   * ```ts
   * const x = 1;
   * let y = 2;
   * var z = 3;
   * ```
   */
  kind: 'const' | 'let' | 'var';
}
declare type LetOrConstOrVarDeclarator = VariableDeclaratorDefiniteAssignment | VariableDeclaratorMaybeInit | VariableDeclaratorNoInit;
declare interface LetOrVarDeclaredDeclaration extends LetOrConstOrVarDeclarationBase {
  /**
   * In a `declare let` declaration, the declarators must not have definite assignment
   * assertions or initializers.
   *
   * @example
   * ```ts
   * using x = 1;
   * using y =1, z = 2;
   * ```
   */
  declarations: VariableDeclaratorNoInit[];
  declare: true;
  kind: 'let' | 'var';
}
declare interface LetOrVarNonDeclaredDeclaration extends LetOrConstOrVarDeclarationBase {
  /**
   * In a `let`/`var` declaration, the declarators may have definite assignment
   * assertions or initializers, but not both.
   */
  declarations: (VariableDeclaratorDefiniteAssignment | VariableDeclaratorMaybeInit)[];
  declare: false;
  kind: 'let' | 'var';
}
declare interface LineComment extends BaseToken {
  type: AST_TOKEN_TYPES.Line;
}
declare type Literal = BigIntLiteral | BooleanLiteral | NullLiteral | NumberLiteral | RegExpLiteral | StringLiteral;
declare interface LiteralBase extends BaseNode {
  type: AST_NODE_TYPES.Literal;
  raw: string;
  value: bigint | boolean | number | string | RegExp | null;
}
declare type LiteralExpression = Literal | TemplateLiteral;
declare interface LogicalExpression extends BaseNode {
  type: AST_NODE_TYPES.LogicalExpression;
  left: Expression;
  operator: '&&' | '??' | '||';
  right: Expression;
}
declare type MemberExpression = MemberExpressionComputedName | MemberExpressionNonComputedName;
declare interface MemberExpressionBase extends BaseNode {
  computed: boolean;
  object: Expression;
  optional: boolean;
  property: Expression | Identifier | PrivateIdentifier;
}
declare interface MemberExpressionComputedName extends MemberExpressionBase {
  type: AST_NODE_TYPES.MemberExpression;
  computed: true;
  property: Expression;
}
declare interface MemberExpressionNonComputedName extends MemberExpressionBase {
  type: AST_NODE_TYPES.MemberExpression;
  computed: false;
  property: Identifier | PrivateIdentifier;
}
declare interface MetaProperty extends BaseNode {
  type: AST_NODE_TYPES.MetaProperty;
  meta: Identifier;
  property: Identifier;
}
declare type MethodDefinition = MethodDefinitionComputedName | MethodDefinitionNonComputedName;
/** this should not be directly used - instead use MethodDefinitionComputedNameBase or MethodDefinitionNonComputedNameBase */
declare interface MethodDefinitionBase extends BaseNode {
  accessibility: Accessibility | undefined;
  computed: boolean;
  decorators: Decorator[];
  key: PropertyName;
  kind: 'constructor' | 'get' | 'method' | 'set';
  optional: boolean;
  override: boolean;
  static: boolean;
  value: FunctionExpression | TSEmptyBodyFunctionExpression;
}
declare interface MethodDefinitionComputedName extends MethodDefinitionComputedNameBase {
  type: AST_NODE_TYPES.MethodDefinition;
}
declare interface MethodDefinitionComputedNameBase extends MethodDefinitionBase {
  computed: true;
  key: PropertyNameComputed;
}
declare interface MethodDefinitionNonComputedName extends ClassMethodDefinitionNonComputedNameBase {
  type: AST_NODE_TYPES.MethodDefinition;
}
declare interface MethodDefinitionNonComputedNameBase extends MethodDefinitionBase {
  computed: false;
  key: PropertyNameNonComputed;
}
declare type NamedExportDeclarations = ClassDeclarationWithName | ClassDeclarationWithOptionalName | FunctionDeclarationWithName | FunctionDeclarationWithOptionalName | TSDeclareFunction | TSEnumDeclaration | TSImportEqualsDeclaration | TSInterfaceDeclaration | TSModuleDeclaration | TSTypeAliasDeclaration | VariableDeclaration;
declare interface NewExpression extends BaseNode {
  type: AST_NODE_TYPES.NewExpression;
  arguments: CallExpressionArgument[];
  callee: Expression;
  typeArguments: TSTypeParameterInstantiation | undefined;
}
declare type Node$1 = AccessorProperty | ArrayExpression | ArrayPattern | ArrowFunctionExpression | AssignmentExpression | AssignmentPattern | AwaitExpression | BinaryExpression | BlockStatement | BreakStatement | CallExpression | CatchClause | ChainExpression | ClassBody | ClassDeclaration | ClassExpression | ConditionalExpression | ContinueStatement | DebuggerStatement | Decorator | DoWhileStatement | EmptyStatement | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ExportSpecifier | ExpressionStatement | ForInStatement | ForOfStatement | ForStatement | FunctionDeclaration | FunctionExpression | Identifier | IfStatement | ImportAttribute | ImportDeclaration | ImportDefaultSpecifier | ImportExpression | ImportNamespaceSpecifier | ImportSpecifier | JSXAttribute | JSXClosingElement | JSXClosingFragment | JSXElement | JSXEmptyExpression | JSXExpressionContainer | JSXFragment | JSXIdentifier | JSXMemberExpression | JSXNamespacedName | JSXOpeningElement | JSXOpeningFragment | JSXSpreadAttribute | JSXSpreadChild | JSXText | LabeledStatement | Literal | LogicalExpression | MemberExpression | MetaProperty | MethodDefinition | NewExpression | ObjectExpression | ObjectPattern | PrivateIdentifier | Program$1 | Property | PropertyDefinition | RestElement | ReturnStatement | SequenceExpression | SpreadElement | StaticBlock | Super | SwitchCase | SwitchStatement | TaggedTemplateExpression | TemplateElement | TemplateLiteral | ThisExpression | ThrowStatement | TryStatement | TSAbstractAccessorProperty | TSAbstractKeyword | TSAbstractMethodDefinition | TSAbstractPropertyDefinition | TSAnyKeyword | TSArrayType | TSAsExpression | TSAsyncKeyword | TSBigIntKeyword | TSBooleanKeyword | TSCallSignatureDeclaration | TSClassImplements | TSConditionalType | TSConstructorType | TSConstructSignatureDeclaration | TSDeclareFunction | TSDeclareKeyword | TSEmptyBodyFunctionExpression | TSEnumBody | TSEnumDeclaration | TSEnumMember | TSExportAssignment | TSExportKeyword | TSExternalModuleReference | TSFunctionType | TSImportEqualsDeclaration | TSImportType | TSIndexedAccessType | TSIndexSignature | TSInferType | TSInstantiationExpression | TSInterfaceBody | TSInterfaceDeclaration | TSInterfaceHeritage | TSIntersectionType | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSMethodSignature | TSModuleBlock | TSModuleDeclaration | TSNamedTupleMember | TSNamespaceExportDeclaration | TSNeverKeyword | TSNonNullExpression | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSParameterProperty | TSPrivateKeyword | TSPropertySignature | TSProtectedKeyword | TSPublicKeyword | TSQualifiedName | TSReadonlyKeyword | TSRestType | TSSatisfiesExpression | TSStaticKeyword | TSStringKeyword | TSSymbolKeyword | TSTemplateLiteralType | TSThisType | TSTupleType | TSTypeAliasDeclaration | TSTypeAnnotation | TSTypeAssertion | TSTypeLiteral | TSTypeOperator | TSTypeParameter | TSTypeParameterDeclaration | TSTypeParameterInstantiation | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword | UnaryExpression | UpdateExpression | VariableDeclaration | VariableDeclarator | WhileStatement | WithStatement | YieldExpression;
declare interface NodeOrTokenData {
  type: string;
  /**
   * The source location information of the node.
   *
   * The loc property is defined as nullable by ESTree, but ESLint requires this property.
   */
  loc: SourceLocation;
  range: Range;
}
declare interface NullLiteral extends LiteralBase {
  raw: 'null';
  value: null;
}
declare interface NullToken extends BaseToken {
  type: AST_TOKEN_TYPES.Null;
}
declare interface NumberLiteral extends LiteralBase {
  value: number;
}
declare interface NumericToken extends BaseToken {
  type: AST_TOKEN_TYPES.Numeric;
}
declare interface ObjectExpression extends BaseNode {
  type: AST_NODE_TYPES.ObjectExpression;
  properties: ObjectLiteralElement[];
}
declare type ObjectLiteralElement = Property | SpreadElement;
declare interface ObjectPattern extends BaseNode {
  type: AST_NODE_TYPES.ObjectPattern;
  decorators: Decorator[];
  optional: boolean;
  properties: (Property | RestElement)[];
  typeAnnotation: TSTypeAnnotation | undefined;
}
declare type Parameter = ArrayPattern | AssignmentPattern | Identifier | ObjectPattern | RestElement | TSParameterProperty;
declare type ParameterPropertyParameter = (AssignmentPattern & {
  left: Identifier;
}) | Identifier;
declare interface Position {
  /**
   * Column number on the line (0-indexed)
   */
  column: number;
  /**
   * Line number (1-indexed)
   */
  line: number;
}
declare interface PrivateIdentifier extends BaseNode {
  type: AST_NODE_TYPES.PrivateIdentifier;
  name: string;
}
declare interface PrivateIdentifierToken extends BaseToken {
  type: AST_TOKEN_TYPES.PrivateIdentifier;
}
declare interface PrivateInExpression extends BaseNode {
  type: AST_NODE_TYPES.BinaryExpression;
  left: PrivateIdentifier;
  operator: 'in';
  right: Expression;
}
declare interface Program$1 extends NodeOrTokenData {
  type: AST_NODE_TYPES.Program;
  body: ProgramStatement[];
  comments: Comment[] | undefined;
  sourceType: 'module' | 'script';
  tokens: Token[] | undefined;
}
declare type ProgramStatement = ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ImportDeclaration | Statement | TSImportEqualsDeclaration | TSNamespaceExportDeclaration;
declare type Property = PropertyComputedName | PropertyNonComputedName;
declare interface PropertyBase extends BaseNode {
  type: AST_NODE_TYPES.Property;
  computed: boolean;
  key: PropertyName;
  kind: 'get' | 'init' | 'set';
  method: boolean;
  optional: boolean;
  shorthand: boolean;
  value: AssignmentPattern | BindingName | Expression | TSEmptyBodyFunctionExpression;
}
declare interface PropertyComputedName extends PropertyBase {
  computed: true;
  key: PropertyNameComputed;
}
declare type PropertyDefinition = PropertyDefinitionComputedName | PropertyDefinitionNonComputedName;
declare interface PropertyDefinitionBase extends BaseNode {
  accessibility: Accessibility | undefined;
  computed: boolean;
  declare: boolean;
  decorators: Decorator[];
  definite: boolean;
  key: PropertyName;
  optional: boolean;
  override: boolean;
  readonly: boolean;
  static: boolean;
  typeAnnotation: TSTypeAnnotation | undefined;
  value: Expression | null;
}
declare interface PropertyDefinitionComputedName extends PropertyDefinitionComputedNameBase {
  type: AST_NODE_TYPES.PropertyDefinition;
}
declare interface PropertyDefinitionComputedNameBase extends PropertyDefinitionBase {
  computed: true;
  key: PropertyNameComputed;
}
declare interface PropertyDefinitionNonComputedName extends ClassPropertyDefinitionNonComputedNameBase {
  type: AST_NODE_TYPES.PropertyDefinition;
}
declare interface PropertyDefinitionNonComputedNameBase extends PropertyDefinitionBase {
  computed: false;
  key: PropertyNameNonComputed;
}
declare type PropertyName = ClassPropertyNameNonComputed | PropertyNameComputed | PropertyNameNonComputed;
declare type PropertyNameComputed = Expression;
declare type PropertyNameNonComputed = Identifier | NumberLiteral | StringLiteral;
declare interface PropertyNonComputedName extends PropertyBase {
  computed: false;
  key: PropertyNameNonComputed;
}
declare interface PunctuatorToken extends BaseToken {
  type: AST_TOKEN_TYPES.Punctuator;
  value: ValueOf<PunctuatorTokenToText>;
}
declare interface PunctuatorTokenToText extends AssignmentOperatorToText {
  [SyntaxKind.AmpersandAmpersandToken]: '&&';
  [SyntaxKind.AmpersandToken]: '&';
  [SyntaxKind.AsteriskAsteriskToken]: '**';
  [SyntaxKind.AsteriskToken]: '*';
  [SyntaxKind.AtToken]: '@';
  [SyntaxKind.BacktickToken]: '`';
  [SyntaxKind.BarBarToken]: '||';
  [SyntaxKind.BarToken]: '|';
  [SyntaxKind.CaretToken]: '^';
  [SyntaxKind.CloseBraceToken]: '}';
  [SyntaxKind.CloseBracketToken]: ']';
  [SyntaxKind.CloseParenToken]: ')';
  [SyntaxKind.ColonToken]: ':';
  [SyntaxKind.CommaToken]: ',';
  [SyntaxKind.DotDotDotToken]: '...';
  [SyntaxKind.DotToken]: '.';
  [SyntaxKind.EqualsEqualsEqualsToken]: '===';
  [SyntaxKind.EqualsEqualsToken]: '==';
  [SyntaxKind.EqualsGreaterThanToken]: '=>';
  [SyntaxKind.ExclamationEqualsEqualsToken]: '!==';
  [SyntaxKind.ExclamationEqualsToken]: '!=';
  [SyntaxKind.ExclamationToken]: '!';
  [SyntaxKind.GreaterThanEqualsToken]: '>=';
  [SyntaxKind.GreaterThanGreaterThanGreaterThanToken]: '>>>';
  [SyntaxKind.GreaterThanGreaterThanToken]: '>>';
  [SyntaxKind.GreaterThanToken]: '>';
  [SyntaxKind.HashToken]: '#';
  [SyntaxKind.LessThanEqualsToken]: '<=';
  [SyntaxKind.LessThanLessThanToken]: '<<';
  [SyntaxKind.LessThanSlashToken]: '</';
  [SyntaxKind.LessThanToken]: '<';
  [SyntaxKind.MinusMinusToken]: '--';
  [SyntaxKind.MinusToken]: '-';
  [SyntaxKind.OpenBraceToken]: '{';
  [SyntaxKind.OpenBracketToken]: '[';
  [SyntaxKind.OpenParenToken]: '(';
  [SyntaxKind.PercentToken]: '%';
  [SyntaxKind.PlusPlusToken]: '++';
  [SyntaxKind.PlusToken]: '+';
  [SyntaxKind.QuestionDotToken]: '?.';
  [SyntaxKind.QuestionQuestionToken]: '??';
  [SyntaxKind.QuestionToken]: '?';
  [SyntaxKind.SemicolonToken]: ';';
  [SyntaxKind.SlashToken]: '/';
  [SyntaxKind.TildeToken]: '~';
}
/**
 * An array of two numbers.
 * Both numbers are a 0-based index which is the position in the array of source code characters.
 * The first is the start position of the node, the second is the end position of the node.
 */
declare type Range = [number, number];
declare interface RegExpLiteral extends LiteralBase {
  regex: {
    flags: string;
    pattern: string;
  };
  value: RegExp | null;
}
declare interface RegularExpressionToken extends BaseToken {
  type: AST_TOKEN_TYPES.RegularExpression;
  regex: {
    flags: string;
    pattern: string;
  };
}
declare interface RestElement extends BaseNode {
  type: AST_NODE_TYPES.RestElement;
  argument: DestructuringPattern;
  decorators: Decorator[];
  optional: boolean;
  typeAnnotation: TSTypeAnnotation | undefined;
  value: AssignmentPattern | undefined;
}
declare interface ReturnStatement extends BaseNode {
  type: AST_NODE_TYPES.ReturnStatement;
  argument: Expression | null;
}
declare interface SequenceExpression extends BaseNode {
  type: AST_NODE_TYPES.SequenceExpression;
  expressions: Expression[];
}
declare interface SourceLocation {
  /**
   * The position of the first character after the parsed source region
   */
  end: Position;
  /**
   * The position of the first character of the parsed source region
   */
  start: Position;
}
declare interface SpreadElement extends BaseNode {
  type: AST_NODE_TYPES.SpreadElement;
  argument: Expression;
}
declare type Statement = BlockStatement | BreakStatement | ClassDeclarationWithName | ContinueStatement | DebuggerStatement | DoWhileStatement | EmptyStatement | ExportAllDeclaration | ExportDefaultDeclaration | ExportNamedDeclaration | ExpressionStatement | ForInStatement | ForOfStatement | ForStatement | FunctionDeclarationWithName | IfStatement | ImportDeclaration | LabeledStatement | ReturnStatement | SwitchStatement | ThrowStatement | TryStatement | TSDeclareFunction | TSEnumDeclaration | TSExportAssignment | TSImportEqualsDeclaration | TSInterfaceDeclaration | TSModuleDeclaration | TSNamespaceExportDeclaration | TSTypeAliasDeclaration | VariableDeclaration | WhileStatement | WithStatement;
declare interface StaticBlock extends BaseNode {
  type: AST_NODE_TYPES.StaticBlock;
  body: Statement[];
}
declare interface StringLiteral extends LiteralBase {
  value: string;
}
declare interface StringToken extends BaseToken {
  type: AST_TOKEN_TYPES.String;
}
declare interface Super extends BaseNode {
  type: AST_NODE_TYPES.Super;
}
declare interface SwitchCase extends BaseNode {
  type: AST_NODE_TYPES.SwitchCase;
  consequent: Statement[];
  test: Expression | null;
}
declare interface SwitchStatement extends BaseNode {
  type: AST_NODE_TYPES.SwitchStatement;
  cases: SwitchCase[];
  discriminant: Expression;
}
declare interface SymmetricBinaryExpression extends BaseNode {
  type: AST_NODE_TYPES.BinaryExpression;
  left: Expression;
  operator: ValueOf<BinaryOperatorToText>;
  right: Expression;
}
declare interface TaggedTemplateExpression extends BaseNode {
  type: AST_NODE_TYPES.TaggedTemplateExpression;
  quasi: TemplateLiteral;
  tag: Expression;
  typeArguments: TSTypeParameterInstantiation | undefined;
}
declare interface TemplateElement extends BaseNode {
  type: AST_NODE_TYPES.TemplateElement;
  tail: boolean;
  value: {
    cooked: string | null;
    raw: string;
  };
}
declare interface TemplateLiteral extends BaseNode {
  type: AST_NODE_TYPES.TemplateLiteral;
  expressions: Expression[];
  quasis: TemplateElement[];
}
declare interface TemplateToken extends BaseToken {
  type: AST_TOKEN_TYPES.Template;
}
declare interface ThisExpression extends BaseNode {
  type: AST_NODE_TYPES.ThisExpression;
}
declare interface ThrowStatement extends BaseNode {
  type: AST_NODE_TYPES.ThrowStatement;
  argument: Expression;
}
declare type Token = BooleanToken | Comment | IdentifierToken | JSXIdentifierToken | JSXTextToken | KeywordToken | NullToken | NumericToken | PrivateIdentifierToken | PunctuatorToken | RegularExpressionToken | StringToken | TemplateToken;
declare interface TryStatement extends BaseNode {
  type: AST_NODE_TYPES.TryStatement;
  block: BlockStatement;
  finalizer: BlockStatement | null;
  handler: CatchClause | null;
}
declare type TSAbstractAccessorProperty = TSAbstractAccessorPropertyComputedName | TSAbstractAccessorPropertyNonComputedName;
declare interface TSAbstractAccessorPropertyComputedName extends PropertyDefinitionComputedNameBase {
  type: AST_NODE_TYPES.TSAbstractAccessorProperty;
  value: null;
}
declare interface TSAbstractAccessorPropertyNonComputedName extends PropertyDefinitionNonComputedNameBase {
  type: AST_NODE_TYPES.TSAbstractAccessorProperty;
  value: null;
}
declare interface TSAbstractKeyword extends BaseNode {
  type: AST_NODE_TYPES.TSAbstractKeyword;
}
declare type TSAbstractMethodDefinition = TSAbstractMethodDefinitionComputedName | TSAbstractMethodDefinitionNonComputedName;
declare interface TSAbstractMethodDefinitionComputedName extends MethodDefinitionComputedNameBase {
  type: AST_NODE_TYPES.TSAbstractMethodDefinition;
}
declare interface TSAbstractMethodDefinitionNonComputedName extends MethodDefinitionNonComputedNameBase {
  type: AST_NODE_TYPES.TSAbstractMethodDefinition;
}
declare type TSAbstractPropertyDefinition = TSAbstractPropertyDefinitionComputedName | TSAbstractPropertyDefinitionNonComputedName;
declare interface TSAbstractPropertyDefinitionComputedName extends PropertyDefinitionComputedNameBase {
  type: AST_NODE_TYPES.TSAbstractPropertyDefinition;
  value: null;
}
declare interface TSAbstractPropertyDefinitionNonComputedName extends PropertyDefinitionNonComputedNameBase {
  type: AST_NODE_TYPES.TSAbstractPropertyDefinition;
  value: null;
}
declare interface TSAnyKeyword extends BaseNode {
  type: AST_NODE_TYPES.TSAnyKeyword;
}
declare interface TSArrayType extends BaseNode {
  type: AST_NODE_TYPES.TSArrayType;
  elementType: TypeNode;
}
declare interface TSAsExpression extends BaseNode {
  type: AST_NODE_TYPES.TSAsExpression;
  expression: Expression;
  typeAnnotation: TypeNode;
}
declare interface TSAsyncKeyword extends BaseNode {
  type: AST_NODE_TYPES.TSAsyncKeyword;
}
declare interface TSBigIntKeyword extends BaseNode {
  type: AST_NODE_TYPES.TSBigIntKeyword;
}
declare interface TSBooleanKeyword extends BaseNode {
  type: AST_NODE_TYPES.TSBooleanKeyword;
}
declare interface TSCallSignatureDeclaration extends TSFunctionSignatureBase {
  type: AST_NODE_TYPES.TSCallSignatureDeclaration;
}
declare interface TSClassImplements extends TSHeritageBase {
  type: AST_NODE_TYPES.TSClassImplements;
}
declare interface TSConditionalType extends BaseNode {
  type: AST_NODE_TYPES.TSConditionalType;
  checkType: TypeNode;
  extendsType: TypeNode;
  falseType: TypeNode;
  trueType: TypeNode;
}
declare interface TSConstructorType extends TSFunctionSignatureBase {
  type: AST_NODE_TYPES.TSConstructorType;
  abstract: boolean;
}
declare interface TSConstructSignatureDeclaration extends TSFunctionSignatureBase {
  type: AST_NODE_TYPES.TSConstructSignatureDeclaration;
}
declare type TSDeclareFunction = TSDeclareFunctionNoDeclare | TSDeclareFunctionWithDeclare;
declare interface TSDeclareFunctionBase extends FunctionBase {
  type: AST_NODE_TYPES.TSDeclareFunction;
  /**
   * TS1183: An implementation cannot be declared in ambient contexts.
   */
  body: undefined;
  /**
   * Whether the declaration has `declare` modifier.
   */
  declare: boolean;
  expression: false;
}
/**
 * Function declaration without the `declare` keyword:
 * ```
 * function foo(): void;
 * ```
 * This can either be an overload signature or a declaration in an ambient context
 * (e.g. `declare module`)
 */
declare interface TSDeclareFunctionNoDeclare extends TSDeclareFunctionBase {
  declare: false;
  /**
   * - TS1221: Generators are not allowed in an ambient context.
   * - TS1222: An overload signature cannot be declared as a generator.
   */
  generator: false;
}
/**
 * Function declaration with the `declare` keyword:
 * ```
 * declare function foo(): void;
 * ```
 */
declare interface TSDeclareFunctionWithDeclare extends TSDeclareFunctionBase {
  /**
   * TS1040: 'async' modifier cannot be used in an ambient context.
   */
  async: false;
  declare: true;
  /**
   * TS1221: Generators are not allowed in an ambient context.
   */
  generator: false;
}
declare interface TSDeclareKeyword extends BaseNode {
  type: AST_NODE_TYPES.TSDeclareKeyword;
}
declare interface TSEmptyBodyFunctionExpression extends FunctionBase {
  type: AST_NODE_TYPES.TSEmptyBodyFunctionExpression;
  body: null;
  id: null;
}
declare interface TSEnumBody extends BaseNode {
  type: AST_NODE_TYPES.TSEnumBody;
  members: TSEnumMember[];
}
declare interface TSEnumDeclaration extends BaseNode {
  type: AST_NODE_TYPES.TSEnumDeclaration;
  /**
   * The body of the enum.
   */
  body: TSEnumBody;
  /**
   * Whether this is a `const` enum.
   * @example
   * ```ts
   * const enum Foo {}
   * ```
   */
  const: boolean;
  /**
   * Whether this is a `declare`d enum.
   * @example
   * ```ts
   * declare enum Foo {}
   * ```
   */
  declare: boolean;
  /**
   * The enum name.
   */
  id: Identifier;
  /**
   * The enum members.
   * @deprecated Use {@link body} instead.
   */
  members: TSEnumMember[];
}
declare interface TSEnumMember extends BaseNode {
  type: AST_NODE_TYPES.TSEnumMember;
  id: Identifier | StringLiteral;
  initializer: Expression | undefined;
  /**
   * @deprecated the enum member is always non-computed.
   */
  computed: boolean;
}
declare interface TSExportAssignment extends BaseNode {
  type: AST_NODE_TYPES.TSExportAssignment;
  expression: Expression;
}
declare interface TSExportKeyword extends BaseNode {
  type: AST_NODE_TYPES.TSExportKeyword;
}
declare interface TSExternalModuleReference extends BaseNode {
  type: AST_NODE_TYPES.TSExternalModuleReference;
  expression: StringLiteral;
}
declare interface TSFunctionSignatureBase extends BaseNode {
  params: Parameter[];
  returnType: TSTypeAnnotation | undefined;
  typeParameters: TSTypeParameterDeclaration | undefined;
}
declare interface TSFunctionType extends TSFunctionSignatureBase {
  type: AST_NODE_TYPES.TSFunctionType;
}
declare interface TSHeritageBase extends BaseNode {
  expression: Expression;
  typeArguments: TSTypeParameterInstantiation | undefined;
}
declare type TSImportEqualsDeclaration = TSImportEqualsNamespaceDeclaration | TSImportEqualsRequireDeclaration;
declare interface TSImportEqualsDeclarationBase extends BaseNode {
  type: AST_NODE_TYPES.TSImportEqualsDeclaration;
  /**
   * The locally imported name.
   */
  id: Identifier;
  /**
   * The kind of the import. Always `'value'` unless `moduleReference` is a
   * `TSExternalModuleReference`.
   */
  importKind: ImportKind;
  /**
   * The value being aliased.
   * @example
   * ```ts
   * import F1 = A;
   * import F2 = A.B.C;
   * import F3 = require('mod');
   * ```
   */
  moduleReference: Identifier | TSExternalModuleReference | TSQualifiedName;
}
declare interface TSImportEqualsNamespaceDeclaration extends TSImportEqualsDeclarationBase {
  /**
   * The kind of the import.
   */
  importKind: 'value';
  /**
   * The value being aliased.
   * ```
   * import F1 = A;
   * import F2 = A.B.C;
   * ```
   */
  moduleReference: Identifier | TSQualifiedName;
}
declare interface TSImportEqualsRequireDeclaration extends TSImportEqualsDeclarationBase {
  /**
   * The kind of the import.
   */
  importKind: ImportKind;
  /**
   * The value being aliased.
   * ```
   * import F3 = require('mod');
   * ```
   */
  moduleReference: TSExternalModuleReference;
}
declare interface TSImportType extends BaseNode {
  type: AST_NODE_TYPES.TSImportType;
  /** @deprecated Use {@link `source`} instead. */
  argument: TypeNode;
  options: ObjectExpression | null;
  qualifier: EntityName | null;
  source: StringLiteral;
  typeArguments: TSTypeParameterInstantiation | null;
}
declare interface TSIndexedAccessType extends BaseNode {
  type: AST_NODE_TYPES.TSIndexedAccessType;
  indexType: TypeNode;
  objectType: TypeNode;
}
declare interface TSIndexSignature extends BaseNode {
  type: AST_NODE_TYPES.TSIndexSignature;
  accessibility: Accessibility | undefined;
  parameters: Parameter[];
  readonly: boolean;
  static: boolean;
  typeAnnotation: TSTypeAnnotation | undefined;
}
declare interface TSInferType extends BaseNode {
  type: AST_NODE_TYPES.TSInferType;
  typeParameter: TSTypeParameter;
}
declare interface TSInstantiationExpression extends BaseNode {
  type: AST_NODE_TYPES.TSInstantiationExpression;
  expression: Expression;
  typeArguments: TSTypeParameterInstantiation;
}
declare interface TSInterfaceBody extends BaseNode {
  type: AST_NODE_TYPES.TSInterfaceBody;
  body: TypeElement[];
}
declare interface TSInterfaceDeclaration extends BaseNode {
  type: AST_NODE_TYPES.TSInterfaceDeclaration;
  /**
   * The body of the interface
   */
  body: TSInterfaceBody;
  /**
   * Whether the interface was `declare`d
   */
  declare: boolean;
  /**
   * The types this interface `extends`
   */
  extends: TSInterfaceHeritage[];
  /**
   * The name of this interface
   */
  id: Identifier;
  /**
   * The generic type parameters declared for the interface. Empty declaration
   * (`<>`) is different from no declaration.
   */
  typeParameters: TSTypeParameterDeclaration | undefined;
}
declare interface TSInterfaceHeritage extends TSHeritageBase {
  type: AST_NODE_TYPES.TSInterfaceHeritage;
}
declare interface TSIntersectionType extends BaseNode {
  type: AST_NODE_TYPES.TSIntersectionType;
  types: TypeNode[];
}
declare interface TSIntrinsicKeyword extends BaseNode {
  type: AST_NODE_TYPES.TSIntrinsicKeyword;
}
declare interface TSLiteralType extends BaseNode {
  type: AST_NODE_TYPES.TSLiteralType;
  literal: Exclude<LiteralExpression, NullLiteral | RegExpLiteral> | UnaryExpressionMinus | UnaryExpressionPlus;
}
declare interface TSMappedType extends BaseNode {
  type: AST_NODE_TYPES.TSMappedType;
  constraint: TypeNode;
  key: Identifier;
  nameType: TypeNode | null;
  optional: boolean | '+' | '-' | undefined;
  readonly: boolean | '+' | '-' | undefined;
  typeAnnotation: TypeNode | undefined;
  /** @deprecated Use {@link `constraint`} and {@link `key`} instead. */
  typeParameter: TSTypeParameter;
}
declare type TSMethodSignature = TSMethodSignatureComputedName | TSMethodSignatureNonComputedName;
declare interface TSMethodSignatureBase extends BaseNode {
  type: AST_NODE_TYPES.TSMethodSignature;
  accessibility: Accessibility | undefined;
  computed: boolean;
  key: PropertyName;
  kind: 'get' | 'method' | 'set';
  optional: boolean;
  params: Parameter[];
  readonly: boolean;
  returnType: TSTypeAnnotation | undefined;
  static: boolean;
  typeParameters: TSTypeParameterDeclaration | undefined;
}
declare interface TSMethodSignatureComputedName extends TSMethodSignatureBase {
  computed: true;
  key: PropertyNameComputed;
}
declare interface TSMethodSignatureNonComputedName extends TSMethodSignatureBase {
  computed: false;
  key: PropertyNameNonComputed;
}
declare interface TSModuleBlock extends BaseNode {
  type: AST_NODE_TYPES.TSModuleBlock;
  body: ProgramStatement[];
}
declare type TSModuleDeclaration = TSModuleDeclarationGlobal | TSModuleDeclarationModule | TSModuleDeclarationNamespace;
declare interface TSModuleDeclarationBase extends BaseNode {
  type: AST_NODE_TYPES.TSModuleDeclaration;
  /**
   * The body of the module.
   * This can only be `undefined` for the code `declare module 'mod';`
   */
 !! body?: TSModuleBlock;
  /**
   * Whether the module is `declare`d
   * @example
   * ```ts
   * declare namespace F {}
   * ```
   */
  declare: boolean;
  /**
   * Whether this is a global declaration
   * @example
   * ```ts
   * declare global {}
   * ```
   *
   * @deprecated Use {@link kind} instead
   */
  global: boolean;
  /**
   * The name of the module
   * ```
   * namespace A {}
   * namespace A.B.C {}
   * module 'a' {}
   * ```
   */
  id: Identifier | Literal | TSQualifiedName;
  /**
   * The keyword used to define this module declaration
   * @example
   * ```ts
   * namespace Foo {}
   * ^^^^^^^^^
   *
   * module 'foo' {}
   * ^^^^^^
   *
   * global {}
   * ^^^^^^
   * ```
   */
  kind: TSModuleDeclarationKind;
}
declare interface TSModuleDeclarationGlobal extends TSModuleDeclarationBase {
  body: TSModuleBlock;
  /**
   * This will always be an Identifier with name `global`
   */
  id: Identifier;
  kind: 'global';
}
declare type TSModuleDeclarationKind = 'global' | 'module' | 'namespace';
declare type TSModuleDeclarationModule = TSModuleDeclarationModuleWithIdentifierId | TSModuleDeclarationModuleWithStringId;
declare interface TSModuleDeclarationModuleBase extends TSModuleDeclarationBase {
  kind: 'module';
}
/**
 * The legacy module declaration, replaced with namespace declarations.
 * ```
 * module A {}
 * ```
 */
declare interface TSModuleDeclarationModuleWithIdentifierId extends TSModuleDeclarationModuleBase {
  body: TSModuleBlock;
  id: Identifier;
  kind: 'module';
}
declare type TSModuleDeclarationModuleWithStringId = TSModuleDeclarationModuleWithStringIdDeclared | TSModuleDeclarationModuleWithStringIdNotDeclared;
/**
 * A string module declaration that is declared:
 * ```
 * declare module 'foo' {}
 * declare module 'foo';
 * ```
 */
declare interface TSModuleDeclarationModuleWithStringIdDeclared extends TSModuleDeclarationModuleBase {
  body?: TSModuleBlock;
  declare: true;
  id: StringLiteral;
  kind: 'module';
}
/**
 * A string module declaration that is not declared:
 * ```
 * module 'foo' {}
 * ```
 */
declare interface TSModuleDeclarationModuleWithStringIdNotDeclared extends TSModuleDeclarationModuleBase {
  body: TSModuleBlock;
  declare: false;
  id: StringLiteral;
  kind: 'module';
}
declare interface TSModuleDeclarationNamespace extends TSModuleDeclarationBase {
  body: TSModuleBlock;
  id: Identifier | TSQualifiedName;
  kind: 'namespace';
}
declare interface TSNamedTupleMember extends BaseNode {
  type: AST_NODE_TYPES.TSNamedTupleMember;
  elementType: TypeNode;
  label: Identifier;
  optional: boolean;
}
/**
 * For the following declaration:
 * ```
 * export as namespace X;
 * ```
 */
declare interface TSNamespaceExportDeclaration extends BaseNode {
  type: AST_NODE_TYPES.TSNamespaceExportDeclaration;
  /**
   * The name of the global variable that's exported as namespace
   */
  id: Identifier;
}
declare interface TSNeverKeyword extends BaseNode {
  type: AST_NODE_TYPES.TSNeverKeyword;
}
declare interface TSNonNullExpression extends BaseNode {
  type: AST_NODE_TYPES.TSNonNullExpression;
  expression: Expression;
}
declare interface TSNullKeyword extends BaseNode {
  type: AST_NODE_TYPES.TSNullKeyword;
}
declare interface TSNumberKeyword extends BaseNode {
  type: AST_NODE_TYPES.TSNumberKeyword;
}
declare interface TSObjectKeyword extends BaseNode {
  type: AST_NODE_TYPES.TSObjectKeyword;
}
declare interface TSOptionalType extends BaseNode {
  type: AST_NODE_TYPES.TSOptionalType;
  typeAnnotation: TypeNode;
}
declare interface TSParameterProperty extends BaseNode {
  type: AST_NODE_TYPES.TSParameterProperty;
  accessibility: Accessibility | undefined;
  decorators: Decorator[];
  override: boolean;
  parameter: ParameterPropertyParameter;
  readonly: boolean;
  static: boolean;
}
declare interface TSPrivateKeyword extends BaseNode {
  type: AST_NODE_TYPES.TSPrivateKeyword;
}
declare type TSPropertySignature = TSPropertySignatureComputedName | TSPropertySignatureNonComputedName;
declare interface TSPropertySignatureBase extends BaseNode {
  type: AST_NODE_TYPES.TSPropertySignature;
  accessibility: Accessibility | undefined;
  computed: boolean;
  key: PropertyName;
  optional: boolean;
  readonly: boolean;
  static: boolean;
  typeAnnotation: TSTypeAnnotation | undefined;
}
declare interface TSPropertySignatureComputedName extends TSPropertySignatureBase {
  computed: true;
  key: PropertyNameComputed;
}
declare interface TSPropertySignatureNonComputedName extends TSPropertySignatureBase {
  computed: false;
  key: PropertyNameNonComputed;
}
declare interface TSProtectedKeyword extends BaseNode {
  type: AST_NODE_TYPES.TSProtectedKeyword;
}
declare interface TSPublicKeyword extends BaseNode {
  type: AST_NODE_TYPES.TSPublicKeyword;
}
declare interface TSQualifiedName extends BaseNode {
  type: AST_NODE_TYPES.TSQualifiedName;
  left: EntityName;
  right: Identifier;
}
declare interface TSReadonlyKeyword extends BaseNode {
  type: AST_NODE_TYPES.TSReadonlyKeyword;
}
declare interface TSRestType extends BaseNode {
  type: AST_NODE_TYPES.TSRestType;
  typeAnnotation: TypeNode;
}
declare interface TSSatisfiesExpression extends BaseNode {
  type: AST_NODE_TYPES.TSSatisfiesExpression;
  expression: Expression;
  typeAnnotation: TypeNode;
}
declare interface TSStaticKeyword extends BaseNode {
  type: AST_NODE_TYPES.TSStaticKeyword;
}
declare interface TSStringKeyword extends BaseNode {
  type: AST_NODE_TYPES.TSStringKeyword;
}
declare interface TSSymbolKeyword extends BaseNode {
  type: AST_NODE_TYPES.TSSymbolKeyword;
}
declare interface TSTemplateLiteralType extends BaseNode {
  type: AST_NODE_TYPES.TSTemplateLiteralType;
  quasis: TemplateElement[];
  types: TypeNode[];
}
declare interface TSThisType extends BaseNode {
  type: AST_NODE_TYPES.TSThisType;
}
declare interface TSTupleType extends BaseNode {
  type: AST_NODE_TYPES.TSTupleType;
  elementTypes: TypeNode[];
}
declare interface TSTypeAliasDeclaration extends BaseNode {
  type: AST_NODE_TYPES.TSTypeAliasDeclaration;
  /**
   * Whether the type was `declare`d.
   * @example
   * ```ts
   * declare type T = 1;
   * ```
   */
  declare: boolean;
  /**
   * The name of the type.
   */
  id: Identifier;
  /**
   * The "value" (type) of the declaration
   */
  typeAnnotation: TypeNode;
  /**
   * The generic type parameters declared for the type. Empty declaration
   * (`<>`) is different from no declaration.
   */
  typeParameters: TSTypeParameterDeclaration | undefined;
}
declare interface TSTypeAnnotation extends BaseNode {
  type: AST_NODE_TYPES.TSTypeAnnotation;
  typeAnnotation: TypeNode;
}
declare interface TSTypeAssertion extends BaseNode {
  type: AST_NODE_TYPES.TSTypeAssertion;
  expression: Expression;
  typeAnnotation: TypeNode;
}
declare interface TSTypeLiteral extends BaseNode {
  type: AST_NODE_TYPES.TSTypeLiteral;
  members: TypeElement[];
}
declare interface TSTypeOperator extends BaseNode {
  type: AST_NODE_TYPES.TSTypeOperator;
  operator: 'keyof' | 'readonly' | 'unique';
  typeAnnotation: TypeNode | undefined;
}
declare interface TSTypeParameter extends BaseNode {
  type: AST_NODE_TYPES.TSTypeParameter;
  const: boolean;
  constraint: TypeNode | undefined;
  default: TypeNode | undefined;
  in: boolean;
  name: Identifier;
  out: boolean;
}
declare interface TSTypeParameterDeclaration extends BaseNode {
  type: AST_NODE_TYPES.TSTypeParameterDeclaration;
  params: TSTypeParameter[];
}
declare interface TSTypeParameterInstantiation extends BaseNode {
  type: AST_NODE_TYPES.TSTypeParameterInstantiation;
  params: TypeNode[];
}
declare interface TSTypePredicate extends BaseNode {
  type: AST_NODE_TYPES.TSTypePredicate;
  asserts: boolean;
  parameterName: Identifier | TSThisType;
  typeAnnotation: TSTypeAnnotation | null;
}
declare interface TSTypeQuery extends BaseNode {
  type: AST_NODE_TYPES.TSTypeQuery;
  exprName: EntityName | TSImportType;
  typeArguments: TSTypeParameterInstantiation | undefined;
}
declare interface TSTypeReference extends BaseNode {
  type: AST_NODE_TYPES.TSTypeReference;
  typeArguments: TSTypeParameterInstantiation | undefined;
  typeName: EntityName;
}
declare interface TSUndefinedKeyword extends BaseNode {
  type: AST_NODE_TYPES.TSUndefinedKeyword;
}
declare interface TSUnionType extends BaseNode {
  type: AST_NODE_TYPES.TSUnionType;
  types: TypeNode[];
}
declare interface TSUnknownKeyword extends BaseNode {
  type: AST_NODE_TYPES.TSUnknownKeyword;
}
declare interface TSVoidKeyword extends BaseNode {
  type: AST_NODE_TYPES.TSVoidKeyword;
}
declare type TypeElement = TSCallSignatureDeclaration | TSConstructSignatureDeclaration | TSIndexSignature | TSMethodSignature | TSPropertySignature;
declare type TypeNode = TSAbstractKeyword | TSAnyKeyword | TSArrayType | TSAsyncKeyword | TSBigIntKeyword | TSBooleanKeyword | TSConditionalType | TSConstructorType | TSDeclareKeyword | TSExportKeyword | TSFunctionType | TSImportType | TSIndexedAccessType | TSInferType | TSIntersectionType | TSIntrinsicKeyword | TSLiteralType | TSMappedType | TSNamedTupleMember | TSNeverKeyword | TSNullKeyword | TSNumberKeyword | TSObjectKeyword | TSOptionalType | TSPrivateKeyword | TSProtectedKeyword | TSPublicKeyword | TSQualifiedName | TSReadonlyKeyword | TSRestType | TSStaticKeyword | TSStringKeyword | TSSymbolKeyword | TSTemplateLiteralType | TSThisType | TSTupleType | TSTypeLiteral | TSTypeOperator | TSTypePredicate | TSTypeQuery | TSTypeReference | TSUndefinedKeyword | TSUnionType | TSUnknownKeyword | TSVoidKeyword;
declare type UnaryExpression = UnaryExpressionBitwiseNot | UnaryExpressionDelete | UnaryExpressionMinus | UnaryExpressionNot | UnaryExpressionPlus | UnaryExpressionTypeof | UnaryExpressionVoid;
declare interface UnaryExpressionBase extends BaseNode {
  argument: Expression;
  operator: string;
  prefix: boolean;
}
declare type UnaryExpressionBitwiseNot = UnaryExpressionSpecific<'~'>;
declare type UnaryExpressionDelete = UnaryExpressionSpecific<'delete'>;
declare type UnaryExpressionMinus = UnaryExpressionSpecific<'-'>;
declare type UnaryExpressionNot = UnaryExpressionSpecific<'!'>;
declare type UnaryExpressionPlus = UnaryExpressionSpecific<'+'>;
declare interface UnaryExpressionSpecific<T extends string> extends UnaryExpressionBase {
  type: AST_NODE_TYPES.UnaryExpression;
  operator: T;
}
declare type UnaryExpressionTypeof = UnaryExpressionSpecific<'typeof'>;
declare type UnaryExpressionVoid = UnaryExpressionSpecific<'void'>;
declare interface UpdateExpression extends UnaryExpressionBase {
  type: AST_NODE_TYPES.UpdateExpression;
  operator: '++' | '--';
}
declare type UsingDeclaration = UsingInForOfDeclaration | UsingInNormalContextDeclaration;
declare interface UsingDeclarationBase extends BaseNode {
  type: AST_NODE_TYPES.VariableDeclaration;
  /**
   * This value will always be `false`
   * because 'declare' modifier cannot appear on a 'using' declaration.
   */
  declare: false;
  /**
   * The keyword used to declare the variable(s)
   * @example
   * ```ts
   * using x = 1;
   * await using y = 2;
   * ```
   */
  kind: 'await using' | 'using';
}
declare type UsingDeclarator = UsingInForOfDeclarator | UsingInNormalContextDeclarator;
declare interface UsingInForOfDeclaration extends UsingDeclarationBase {
  /**
   * The variables declared by this declaration.
   * Always has exactly one element.
   * @example
   * ```ts
   * for (using x of y) {}
   * ```
   */
  declarations: [UsingInForOfDeclarator];
}
declare interface UsingInForOfDeclarator extends VariableDeclaratorBase {
  definite: false;
  id: Identifier;
  init: null;
}
declare interface UsingInNormalContextDeclaration extends UsingDeclarationBase {
  /**
   * The variables declared by this declaration.
   * Always non-empty.
   * @example
   * ```ts
   * using x = 1;
   * using y = 1, z = 2;
   * ```
   */
  declarations: UsingInNormalContextDeclarator[];
}
declare interface UsingInNormalContextDeclarator extends VariableDeclaratorBase {
  definite: false;
  id: Identifier;
  init: Expression;
}
declare type ValueOf<T> = T[keyof T];
declare type VariableDeclaration = LetOrConstOrVarDeclaration | UsingDeclaration;
declare type VariableDeclarator = LetOrConstOrVarDeclarator | UsingDeclarator;
declare interface VariableDeclaratorBase extends BaseNode {
  type: AST_NODE_TYPES.VariableDeclarator;
  /**
   * Whether there's definite assignment assertion (`let x!: number`).
   * If `true`, then: `id` must be an identifier with a type annotation,
   * `init` must be `null`, and the declarator must be a `var`/`let` declarator.
   */
  definite: boolean;
  /**
   * The name(s) of the variable(s).
   */
  id: BindingName;
  /**
   * The initializer expression of the variable. Must be present for `const` unless
   * in a `declare const`.
   */
  init: Expression | null;
}
declare interface VariableDeclaratorDefiniteAssignment extends VariableDeclaratorBase {
  definite: true;
  /**
   * The name of the variable. Must have a type annotation.
   */
  id: Identifier;
  init: null;
}
declare interface VariableDeclaratorMaybeInit extends VariableDeclaratorBase {
  definite: false;
}
declare interface VariableDeclaratorNoInit extends VariableDeclaratorBase {
  definite: false;
  init: null;
}
declare interface WhileStatement extends BaseNode {
  type: AST_NODE_TYPES.WhileStatement;
  body: Statement;
  test: Expression;
}
declare interface WithStatement extends BaseNode {
  type: AST_NODE_TYPES.WithStatement;
  body: Statement;
  object: Expression;
}
declare interface YieldExpression extends BaseNode {
  type: AST_NODE_TYPES.YieldExpression;
  argument: Expression | null;
  delegate: boolean;
}
//#endregion
//#region node_modules/@typescript-eslint/types/dist/ts-estree.d.ts
declare module './generated/ast-spec' {
  interface BaseNode {
    parent: Node$1;
  }
  interface Program {
    /**
     * @remarks This never-used property exists only as a convenience for code that tries to access node parents repeatedly.
     */
    parent?: never;
  }
  interface AccessorPropertyComputedName {
    parent: ClassBody;
  }
  interface AccessorPropertyNonComputedName {
    parent: ClassBody;
  }
  interface TSAbstractAccessorPropertyComputedName {
    parent: ClassBody;
  }
  interface TSAbstractAccessorPropertyNonComputedName {
    parent: ClassBody;
  }
  interface VariableDeclaratorDefiniteAssignment {
    parent: VariableDeclaration;
  }
  interface VariableDeclaratorMaybeInit {
    parent: VariableDeclaration;
  }
  interface VariableDeclaratorNoInit {
    parent: VariableDeclaration;
  }
  interface UsingInForOfDeclarator {
    parent: VariableDeclaration;
  }
  interface UsingInNormalContextDeclarator {
    parent: VariableDeclaration;
  }
  interface CatchClause {
    parent: TryStatement;
  }
  interface ClassBody {
    parent: ClassDeclaration | ClassExpression;
  }
  interface ImportAttribute {
    parent: ExportAllDeclaration | ExportNamedDeclaration | ImportDeclaration | TSImportType;
  }
  interface ImportDefaultSpecifier {
    parent: ImportDeclaration;
  }
  interface ImportNamespaceSpecifier {
    parent: ImportDeclaration;
  }
  interface ImportSpecifier {
    parent: ExportAllDeclaration | ExportNamedDeclaration | ImportDeclaration;
  }
  interface ExportDefaultDeclaration {
    parent: BlockStatement | Program$1 | TSModuleBlock;
  }
  interface ExportNamedDeclarationWithoutSourceWithMultiple {
    parent: BlockStatement | Program$1 | TSModuleBlock;
  }
  interface ExportNamedDeclarationWithoutSourceWithSingle {
    parent: BlockStatement | Program$1 | TSModuleBlock;
  }
  interface ExportNamedDeclarationWithSource {
    parent: BlockStatement | Program$1 | TSModuleBlock;
  }
  interface FunctionDeclarationWithName {
    parent: BlockStatement | ExportDefaultDeclaration | ExportNamedDeclaration | Program$1;
  }
  interface FunctionDeclarationWithOptionalName {
    parent: ExportDefaultDeclaration;
  }
  interface JSXAttribute {
    parent: JSXOpeningElement;
  }
  interface JSXClosingElement {
    parent: JSXElement;
  }
  interface JSXClosingFragment {
    parent: JSXFragment;
  }
  interface JSXOpeningElement {
    parent: JSXElement;
  }
  interface JSXOpeningFragment {
    parent: JSXFragment;
  }
  interface JSXSpreadAttribute {
    parent: JSXOpeningElement;
  }
  interface MethodDefinitionComputedName {
    parent: ClassBody;
  }
  interface MethodDefinitionNonComputedName {
    parent: ClassBody;
  }
  interface TSAbstractMethodDefinitionComputedName {
    parent: ClassBody;
  }
  interface TSAbstractMethodDefinitionNonComputedName {
    parent: ClassBody;
  }
  interface PropertyComputedName {
    parent: ObjectExpression | ObjectPattern;
  }
  interface PropertyNonComputedName {
    parent: ObjectExpression | ObjectPattern;
  }
  interface PropertyDefinitionComputedName {
    parent: ClassBody;
  }
  interface PropertyDefinitionNonComputedName {
    parent: ClassBody;
  }
  interface TSAbstractPropertyDefinitionComputedName {
    parent: ClassBody;
  }
  interface TSAbstractPropertyDefinitionNonComputedName {
    parent: ClassBody;
  }
  interface SpreadElement {
    parent: ArrayExpression | CallExpression | NewExpression | ObjectExpression;
  }
  interface StaticBlock {
    parent: ClassBody;
  }
  interface SwitchCase {
    parent: SwitchStatement;
  }
  interface TemplateElement {
    parent: TemplateLiteral | TSTemplateLiteralType;
  }
  interface TSCallSignatureDeclaration {
    parent: TSInterfaceBody | TSTypeLiteral;
  }
  interface TSConstructSignatureDeclaration {
    parent: TSInterfaceBody | TSTypeLiteral;
  }
  interface TSClassImplements {
    parent: ClassDeclaration | ClassExpression;
  }
  interface TSEnumBody {
    parent: TSEnumDeclaration;
  }
  interface TSEnumMember {
    parent: TSEnumBody;
  }
  interface TSIndexSignature {
    parent: ClassBody | TSInterfaceBody | TSTypeLiteral;
  }
  interface TSInterfaceBody {
    parent: TSInterfaceDeclaration;
  }
  interface TSInterfaceHeritage {
    parent: TSInterfaceBody;
  }
  interface TSMethodSignatureComputedName {
    parent: TSInterfaceBody | TSTypeLiteral;
  }
  interface TSMethodSignatureNonComputedName {
    parent: TSInterfaceBody | TSTypeLiteral;
  }
  interface TSModuleBlock {
    parent: TSModuleDeclaration;
  }
  interface TSParameterProperty {
    parent: FunctionLike;
  }
  interface TSPropertySignatureComputedName {
    parent: TSInterfaceBody | TSTypeLiteral;
  }
  interface TSPropertySignatureNonComputedName {
    parent: TSInterfaceBody | TSTypeLiteral;
  }
  interface TSTypeParameter {
    parent: TSInferType | TSMappedType | TSTypeParameterDeclaration;
  }
  interface ExportSpecifierWithIdentifierLocal {
    parent: ExportNamedDeclaration;
  }
  interface ExportSpecifierWithStringOrLiteralLocal {
    parent: ExportNamedDeclaration;
  }
}
//#endregion
//#region node_modules/@typescript-eslint/typescript-estree/dist/ts-estree/ts-nodes.d.ts
declare module 'typescript' {
  interface AssertClause extends undefined {}
  interface AssertEntry extends undefined {}
  interface SatisfiesExpression extends undefined {}
  interface JsxNamespacedName extends undefined {}
  interface ImportAttribute extends undefined {}
  interface ImportAttributes extends undefined {}
}
//#endregion
//#region node_modules/@typescript-eslint/typescript-estree/dist/parseSettings/index.d.ts
declare module 'typescript' {
  enum JSDocParsingMode {}
}
declare module 'typescript/lib/tsserverlibrary' {
  enum JSDocParsingMode {}
}
/**
 * Internal settings used by the parser to run on a file.
 */
//#endregion
//#region src/external/token-store/index.d.ts
type SkipOptions = number | ((token: Token$1) => boolean) | {
  includeComments?: boolean;
  filter?: (token: Token$1) => boolean;
  skip?: number;
};
type CountOptions = number | ((token: Token$1) => boolean) | {
  includeComments?: boolean;
  filter?: (token: Token$1) => boolean;
  count?: number;
};
/**
 * The token store.
 *
 * This class provides methods to get tokens by locations as fast as possible.
 * The methods are a part of public API, so we should be careful if it changes this class.
 *
 * People can get tokens in O(1) by the hash map which is mapping from the location of tokens/comments to tokens.
 * Also people can get a mix of tokens and comments in O(log k), the k is the number of comments.
 * Assuming that comments to be much fewer than tokens, this does not make hash map from token's locations to comments to reduce memory cost.
 * This uses binary-searching instead for comments.
 */
declare class TokenStore {
  private _tokens;
  private _comments;
  private _indexMap;
  /**
   * Initializes this token store.
   * @param tokens - The array of tokens.
   * @param comments - The array of comments.
   */
  constructor(tokens: Token$1[], comments: Token$1[]);
  /**
   * Gets the token starting at the specified index.
   * @param offset - Index of the start of the token's range.
   * @param options - The option object.
   * @returns The token starting at index, or null if no such token.
   */
  getTokenByRangeStart(offset: number, options?: {
    includeComments: boolean;
  }): Token$1 | null;
  /**
   * Gets the first token of the given node.
   * @param node - The AST node.
   * @param options - The option object.
   * @returns An object representing the token.
   */
  getFirstToken(node: HasLocation, options?: SkipOptions): Token$1 | null;
  /**
   * Gets the last token of the given node.
   * @param node - The AST node.
   * @param options - The option object.
   * @returns An object representing the token.
   */
  getLastToken(node: HasLocation, options?: SkipOptions): Token$1 | null;
  /**
   * Gets the token that precedes a given node or token.
   * @param node - The AST node or token.
   * @param options - The option object.
   * @returns An object representing the token.
   */
  getTokenBefore(node: HasLocation, options?: SkipOptions): Token$1 | null;
  /**
   * Gets the token that follows a given node or token.
   * @param node - The AST node or token.
   * @param options - The option object.
   * @returns An object representing the token.
   */
  getTokenAfter(node: HasLocation, options?: SkipOptions): Token$1 | null;
  /**
   * Gets the first token between two non-overlapping nodes.
   * @param left - Node before the desired token range.
   * @param right - Node after the desired token range.
   * @param options - The option object.
   * @returns An object representing the token.
   */
  getFirstTokenBetween(left: HasLocation, right: HasLocation, options?: SkipOptions): Token$1 | null;
  /**
   * Gets the last token between two non-overlapping nodes.
   * @param left Node before the desired token range.
   * @param right Node after the desired token range.
   * @param options - The option object.
   * @returns An object representing the token.
   */
  getLastTokenBetween(left: HasLocation, right: HasLocation, options?: SkipOptions): Token$1 | null;
  /**
   * Gets the token that precedes a given node or token in the token stream.
   * This is defined for backward compatibility. Use `includeComments` option instead.
   * TODO: We have a plan to remove this in a future major version.
   * @param node The AST node or token.
   * @param skip A number of tokens to skip.
   * @returns An object representing the token.
   * @deprecated
   */
  getTokenOrCommentBefore(node: HasLocation, skip?: number): Token$1 | null;
  /**
   * Gets the token that follows a given node or token in the token stream.
   * This is defined for backward compatibility. Use `includeComments` option instead.
   * TODO: We have a plan to remove this in a future major version.
   * @param node The AST node or token.
   * @param skip A number of tokens to skip.
   * @returns An object representing the token.
   * @deprecated
   */
  getTokenOrCommentAfter(node: HasLocation, skip?: number): Token$1 | null;
  /**
   * Gets the first `count` tokens of the given node.
   * @param node - The AST node.
   * @param [options=0] - The option object. If this is a number then it's `options.count`. If this is a function then it's `options.filter`.
   * @param [options.includeComments=false] - The flag to iterate comments as well.
   * @param [options.filter=null] - The predicate function to choose tokens.
   * @param [options.count=0] - The maximum count of tokens the cursor iterates.
   * @returns Tokens.
   */
  getFirstTokens(node: HasLocation, options?: CountOptions): Token$1[];
  /**
   * Gets the last `count` tokens of the given node.
   * @param node - The AST node.
   * @param [options=0] - The option object. Same options as getFirstTokens()
   * @returns Tokens.
   */
  getLastTokens(node: HasLocation, options?: CountOptions): Token$1[];
  /**
   * Gets the `count` tokens that precedes a given node or token.
   * @param node - The AST node or token.
   * @param [options=0] - The option object. Same options as getFirstTokens()
   * @returns Tokens.
   */
  getTokensBefore(node: HasLocation, options?: CountOptions): Token$1[];
  /**
   * Gets the `count` tokens that follows a given node or token.
   * @param node - The AST node or token.
   * @param [options=0] - The option object. Same options as getFirstTokens()
   * @returns Tokens.
   */
  getTokensAfter(node: HasLocation, options?: CountOptions): Token$1[];
  /**
   * Gets the first `count` tokens between two non-overlapping nodes.
   * @param left - Node before the desired token range.
   * @param right - Node after the desired token range.
   * @param [options=0] - The option object. Same options as getFirstTokens()
   * @returns Tokens between left and right.
   */
  getFirstTokensBetween(left: HasLocation, right: HasLocation, options?: CountOptions): Token$1[];
  /**
   * Gets the last `count` tokens between two non-overlapping nodes.
   * @param left Node before the desired token range.
   * @param right Node after the desired token range.
   * @param [options=0] - The option object. Same options as getFirstTokens()
   * @returns Tokens between left and right.
   */
  getLastTokensBetween(left: HasLocation, right: HasLocation, options?: CountOptions): Token$1[];
  /**
   * Gets all tokens that are related to the given node.
   * @param node - The AST node.
   * @param beforeCount - The number of tokens before the node to retrieve.
   * @param afterCount - The number of tokens after the node to retrieve.
   * @returns Array of objects representing tokens.
   */
  getTokens(node: HasLocation, beforeCount?: CountOptions, afterCount?: number): Token$1[];
  /**
   * Gets all of the tokens between two non-overlapping nodes.
   * @param left Node before the desired token range.
   * @param right Node after the desired token range.
   * @param padding Number of extra tokens on either side of center.
   * @returns Tokens between left and right.
   */
  getTokensBetween(left: HasLocation, right: HasLocation, padding?: CountOptions): Token$1[];
  /**
   * Checks whether any comments exist or not between the given 2 nodes.
   *
   * @param left - The node to check.
   * @param right - The node to check.
   * @returns `true` if one or more comments exist.
   */
  commentsExistBetween(left: HasLocation, right: HasLocation): boolean;
  /**
   * Gets all comment tokens directly before the given node or token.
   * @param nodeOrToken The AST node or token to check for adjacent comment tokens.
   * @returns An array of comments in occurrence order.
   */
  getCommentsBefore(nodeOrToken: HasLocation): Token$1[];
  /**
   * Gets all comment tokens directly after the given node or token.
   * @param nodeOrToken The AST node or token to check for adjacent comment tokens.
   * @returns An array of comments in occurrence order.
   */
  getCommentsAfter(nodeOrToken: HasLocation): Token$1[];
  /**
   * Gets all comment tokens inside the given node.
   * @param node The AST node to get the comments for.
   * @returns An array of comments in occurrence order.
   */
  getCommentsInside(node: HasLocation): Token$1[];
  /**
   * Returns the location of the given node or token.
   * @param nodeOrToken The node or token to get the location of.
   * @returns The location of the node or token.
   */
  getLoc(nodeOrToken: HasLocation): LocationRange;
  /**
   * Returns the range of the given node or token.
   * @param nodeOrToken The node or token to get the range of.
   * @returns The range of the node or token.
   */
  getRange(nodeOrToken: HasLocation): OffsetRange;
}
//#endregion
//#region src/common/parser-object.d.ts
/**
 * The type of basic ESLint custom parser.
 * e.g. espree
 */
type BasicParserObject<R = ESLintProgram> = {
  parse(code: string, options: any): R;
  parseForESLint: undefined;
};
/**
 * The type of ESLint custom parser enhanced for ESLint.
 * e.g. @babel/eslint-parser, @typescript-eslint/parser
 */
type EnhancedParserObject<R = ESLintExtendedProgram> = {
  parseForESLint(code: string, options: any): R;
  parse: undefined;
};
/**
 * The type of ESLint (custom) parsers.
 */
type ParserObject<R1 = ESLintExtendedProgram, R2 = ESLintProgram> = EnhancedParserObject<R1> | BasicParserObject<R2>;
//#endregion
//#region src/sfc/custom-block/index.d.ts
type ESLintCustomBlockParser = ParserObject<any, any>;
type CustomBlockContext = {
  getSourceCode(): SourceCode;
  sourceCode: SourceCode;
  parserServices: any;
  getAncestors(): any[];
  getDeclaredVariables(node: any): any[];
  getScope(): any;
  markVariableAsUsed(name: string): boolean;
  id: string;
  options: any[];
  settings: {
    [name: string]: any;
  };
  parserPath: string;
  parserOptions: any;
  getFilename(): string;
  report(descriptor: Rule.ReportDescriptor): void;
};
//#endregion
//#region src/parser-services.d.ts
type CustomBlockVisitorFactory = (context: CustomBlockContext) => {
  [key: string]: (...args: any) => void;
} | null | undefined;
interface ParserServices {
  /**
   * Define handlers to traverse the template body.
   * @param templateBodyVisitor The template body handlers.
   * @param scriptVisitor The script handlers. This is optional.
   * @param options The options. This is optional.
   */
  defineTemplateBodyVisitor(templateBodyVisitor: {
    [key: string]: (...args: any) => void;
  }, scriptVisitor?: {
    [key: string]: (...args: any) => void;
  }, options?: {
    templateBodyTriggerSelector: "Program" | "Program:exit";
  }): object;
  /**
   * Define handlers to traverse the document.
   * @param documentVisitor The document handlers.
   * @param options The options. This is optional.
   */
  defineDocumentVisitor(documentVisitor: {
    [key: string]: (...args: any) => void;
  }, options?: {
    triggerSelector: "Program" | "Program:exit";
  }): object;
  /**
   * Define handlers to traverse custom blocks.
   * @param context The rule context.
   * @param parser The custom parser.
   * @param rule The custom block rule definition
   * @param scriptVisitor The script handlers. This is optional.
   */
  defineCustomBlocksVisitor(context: Rule.RuleContext, parser: ESLintCustomBlockParser, rule: {
    target: string | string[] | ((lang: string | null, customBlock: VElement) => boolean);
    create: CustomBlockVisitorFactory;
  }, scriptVisitor?: {
    [key: string]: (...args: any) => void;
  }): {
    [key: string]: (...args: any) => void;
  };
  /**
   * Get the token store of the template body.
   * @returns The token store of template body.
   */
  getTemplateBodyTokenStore(): TokenStore;
  /**
   * Get the root document fragment.
   * @returns The root document fragment.
   */
  getDocumentFragment(): VDocumentFragment | null;
}
//#endregion
//#region src/ast/nodes.d.ts
/**
 * Objects which have their parent.
 */
interface HasParent {
  parent?: Node | null;
}
/**
 * The union type for all nodes.
 */
type Node = ESLintNode | VNode | VForExpression | VOnExpression | VSlotScopeExpression | VGenericExpression | VFilterSequenceExpression | VFilter;
/**
 * The union type for ESLint nodes.
 */
type ESLintNode = ESLintIdentifier | ESLintLiteral | ESLintProgram | ESLintSwitchCase | ESLintCatchClause | ESLintVariableDeclarator | ESLintStatement | ESLintExpression | ESLintProperty | ESLintAssignmentProperty | ESLintSuper | ESLintTemplateElement | ESLintSpreadElement | ESLintPattern | ESLintClassBody | ESLintMethodDefinition | ESLintPropertyDefinition | ESLintStaticBlock | ESLintPrivateIdentifier | ESLintModuleDeclaration | ESLintModuleSpecifier | ESLintImportExpression | ESLintLegacyRestProperty;
/**
 * The parsing result of ESLint custom parsers.
 */
interface ESLintExtendedProgram {
  ast: ESLintProgram;
  services?: ParserServices;
  visitorKeys?: {
    [type: string]: string[];
  };
  scopeManager?: ScopeManager;
}
interface ESLintProgram extends HasLocation, HasParent {
  type: "Program";
  sourceType: "script" | "module";
  body: (ESLintStatement | ESLintModuleDeclaration)[];
  templateBody?: VElement & HasConcreteInfo;
  tokens?: Token$1[];
  comments?: Token$1[];
  errors?: ParseError[];
}
type ESLintStatement = ESLintExpressionStatement | ESLintBlockStatement | ESLintEmptyStatement | ESLintDebuggerStatement | ESLintWithStatement | ESLintReturnStatement | ESLintLabeledStatement | ESLintBreakStatement | ESLintContinueStatement | ESLintIfStatement | ESLintSwitchStatement | ESLintThrowStatement | ESLintTryStatement | ESLintWhileStatement | ESLintDoWhileStatement | ESLintForStatement | ESLintForInStatement | ESLintForOfStatement | ESLintDeclaration;
interface ESLintEmptyStatement extends HasLocation, HasParent {
  type: "EmptyStatement";
}
interface ESLintBlockStatement extends HasLocation, HasParent {
  type: "BlockStatement";
  body: ESLintStatement[];
}
interface ESLintExpressionStatement extends HasLocation, HasParent {
  type: "ExpressionStatement";
  expression: ESLintExpression;
}
interface ESLintIfStatement extends HasLocation, HasParent {
  type: "IfStatement";
  test: ESLintExpression;
  consequent: ESLintStatement;
  alternate: ESLintStatement | null;
}
interface ESLintSwitchStatement extends HasLocation, HasParent {
  type: "SwitchStatement";
  discriminant: ESLintExpression;
  cases: ESLintSwitchCase[];
}
interface ESLintSwitchCase extends HasLocation, HasParent {
  type: "SwitchCase";
  test: ESLintExpression | null;
  consequent: ESLintStatement[];
}
interface ESLintWhileStatement extends HasLocation, HasParent {
  type: "WhileStatement";
  test: ESLintExpression;
  body: ESLintStatement;
}
interface ESLintDoWhileStatement extends HasLocation, HasParent {
  type: "DoWhileStatement";
  body: ESLintStatement;
  test: ESLintExpression;
}
interface ESLintForStatement extends HasLocation, HasParent {
  type: "ForStatement";
  init: ESLintVariableDeclaration | ESLintExpression | null;
  test: ESLintExpression | null;
  update: ESLintExpression | null;
  body: ESLintStatement;
}
interface ESLintForInStatement extends HasLocation, HasParent {
  type: "ForInStatement";
  left: ESLintVariableDeclaration | ESLintPattern;
  right: ESLintExpression;
  body: ESLintStatement;
}
interface ESLintForOfStatement extends HasLocation, HasParent {
  type: "ForOfStatement";
  left: ESLintVariableDeclaration | ESLintPattern;
  right: ESLintExpression;
  body: ESLintStatement;
  await: boolean;
}
interface ESLintLabeledStatement extends HasLocation, HasParent {
  type: "LabeledStatement";
  label: ESLintIdentifier;
  body: ESLintStatement;
}
interface ESLintBreakStatement extends HasLocation, HasParent {
  type: "BreakStatement";
  label: ESLintIdentifier | null;
}
interface ESLintContinueStatement extends HasLocation, HasParent {
  type: "ContinueStatement";
  label: ESLintIdentifier | null;
}
interface ESLintReturnStatement extends HasLocation, HasParent {
  type: "ReturnStatement";
  argument: ESLintExpression | null;
}
interface ESLintThrowStatement extends HasLocation, HasParent {
  type: "ThrowStatement";
  argument: ESLintExpression;
}
interface ESLintTryStatement extends HasLocation, HasParent {
  type: "TryStatement";
  block: ESLintBlockStatement;
  handler: ESLintCatchClause | null;
  finalizer: ESLintBlockStatement | null;
}
interface ESLintCatchClause extends HasLocation, HasParent {
  type: "CatchClause";
  param: ESLintPattern | null;
  body: ESLintBlockStatement;
}
interface ESLintWithStatement extends HasLocation, HasParent {
  type: "WithStatement";
  object: ESLintExpression;
  body: ESLintStatement;
}
interface ESLintDebuggerStatement extends HasLocation, HasParent {
  type: "DebuggerStatement";
}
type ESLintDeclaration = ESLintFunctionDeclaration | ESLintVariableDeclaration | ESLintClassDeclaration;
interface ESLintFunctionDeclaration extends HasLocation, HasParent {
  type: "FunctionDeclaration";
  async: boolean;
  generator: boolean;
  id: ESLintIdentifier | null;
  params: ESLintPattern[];
  body: ESLintBlockStatement;
}
interface ESLintVariableDeclaration extends HasLocation, HasParent {
  type: "VariableDeclaration";
  kind: "var" | "let" | "const";
  declarations: ESLintVariableDeclarator[];
}
interface ESLintVariableDeclarator extends HasLocation, HasParent {
  type: "VariableDeclarator";
  id: ESLintPattern;
  init: ESLintExpression | null;
}
interface ESLintClassDeclaration extends HasLocation, HasParent {
  type: "ClassDeclaration";
  id: ESLintIdentifier | null;
  superClass: ESLintExpression | null;
  body: ESLintClassBody;
}
interface ESLintClassBody extends HasLocation, HasParent {
  type: "ClassBody";
  body: (ESLintMethodDefinition | ESLintPropertyDefinition | ESLintStaticBlock)[];
}
interface ESLintMethodDefinition extends HasLocation, HasParent {
  type: "MethodDefinition";
  kind: "constructor" | "method" | "get" | "set";
  computed: boolean;
  static: boolean;
  key: ESLintExpression | ESLintPrivateIdentifier;
  value: ESLintFunctionExpression;
}
interface ESLintPropertyDefinition extends HasLocation, HasParent {
  type: "PropertyDefinition";
  computed: boolean;
  static: boolean;
  key: ESLintExpression | ESLintPrivateIdentifier;
  value: ESLintExpression | null;
}
interface ESLintStaticBlock extends HasLocation, HasParent, Omit<ESLintBlockStatement, "type"> {
  type: "StaticBlock";
  body: ESLintStatement[];
}
interface ESLintPrivateIdentifier extends HasLocation, HasParent {
  type: "PrivateIdentifier";
  name: string;
}
type ESLintModuleDeclaration = ESLintImportDeclaration | ESLintExportNamedDeclaration | ESLintExportDefaultDeclaration | ESLintExportAllDeclaration;
type ESLintModuleSpecifier = ESLintImportSpecifier | ESLintImportDefaultSpecifier | ESLintImportNamespaceSpecifier | ESLintExportSpecifier;
interface ESLintImportDeclaration extends HasLocation, HasParent {
  type: "ImportDeclaration";
  specifiers: (ESLintImportSpecifier | ESLintImportDefaultSpecifier | ESLintImportNamespaceSpecifier)[];
  source: ESLintLiteral;
}
interface ESLintImportSpecifier extends HasLocation, HasParent {
  type: "ImportSpecifier";
  imported: ESLintIdentifier | ESLintStringLiteral;
  local: ESLintIdentifier;
}
interface ESLintImportDefaultSpecifier extends HasLocation, HasParent {
  type: "ImportDefaultSpecifier";
  local: ESLintIdentifier;
}
interface ESLintImportNamespaceSpecifier extends HasLocation, HasParent {
  type: "ImportNamespaceSpecifier";
  local: ESLintIdentifier;
}
interface ESLintImportExpression extends HasLocation, HasParent {
  type: "ImportExpression";
  source: ESLintExpression;
}
interface ESLintExportNamedDeclaration extends HasLocation, HasParent {
  type: "ExportNamedDeclaration";
  declaration?: ESLintDeclaration | null;
  specifiers: ESLintExportSpecifier[];
  source?: ESLintLiteral | null;
}
interface ESLintExportSpecifier extends HasLocation, HasParent {
  type: "ExportSpecifier";
  local: ESLintIdentifier | ESLintStringLiteral;
  exported: ESLintIdentifier | ESLintStringLiteral;
}
interface ESLintExportDefaultDeclaration extends HasLocation, HasParent {
  type: "ExportDefaultDeclaration";
  declaration: ESLintDeclaration | ESLintExpression;
}
interface ESLintExportAllDeclaration extends HasLocation, HasParent {
  type: "ExportAllDeclaration";
  exported: ESLintIdentifier | ESLintStringLiteral | null;
  source: ESLintLiteral;
}
type ESLintExpression = ESLintThisExpression | ESLintArrayExpression | ESLintObjectExpression | ESLintFunctionExpression | ESLintArrowFunctionExpression | ESLintYieldExpression | ESLintLiteral | ESLintUnaryExpression | ESLintUpdateExpression | ESLintBinaryExpression | ESLintAssignmentExpression | ESLintLogicalExpression | ESLintMemberExpression | ESLintConditionalExpression | ESLintCallExpression | ESLintNewExpression | ESLintSequenceExpression | ESLintTemplateLiteral | ESLintTaggedTemplateExpression | ESLintClassExpression | ESLintMetaProperty | ESLintIdentifier | ESLintAwaitExpression | ESLintChainExpression;
interface ESLintIdentifier extends HasLocation, HasParent {
  type: "Identifier";
  name: string;
}
interface ESLintLiteralBase extends HasLocation, HasParent {
  type: "Literal";
  value: string | boolean | null | number | RegExp | bigint;
  raw: string;
  regex?: {
    pattern: string;
    flags: string;
  };
  bigint?: string;
}
interface ESLintStringLiteral extends ESLintLiteralBase {
  value: string;
  regex?: undefined;
  bigint?: undefined;
}
interface ESLintBooleanLiteral extends ESLintLiteralBase {
  value: boolean;
  regex?: undefined;
  bigint?: undefined;
}
interface ESLintNullLiteral extends ESLintLiteralBase {
  value: null;
  regex?: undefined;
  bigint?: undefined;
}
interface ESLintNumberLiteral extends ESLintLiteralBase {
  value: number;
  regex?: undefined;
  bigint?: undefined;
}
interface ESLintRegExpLiteral extends ESLintLiteralBase {
  value: null | RegExp;
  regex: {
    pattern: string;
    flags: string;
  };
  bigint?: undefined;
}
interface ESLintBigIntLiteral extends ESLintLiteralBase {
  value: null | bigint;
  regex?: undefined;
  bigint: string;
}
type ESLintLiteral = ESLintStringLiteral | ESLintBooleanLiteral | ESLintNullLiteral | ESLintNumberLiteral | ESLintRegExpLiteral | ESLintBigIntLiteral;
interface ESLintThisExpression extends HasLocation, HasParent {
  type: "ThisExpression";
}
interface ESLintArrayExpression extends HasLocation, HasParent {
  type: "ArrayExpression";
  elements: (ESLintExpression | ESLintSpreadElement)[];
}
interface ESLintObjectExpression extends HasLocation, HasParent {
  type: "ObjectExpression";
  properties: (ESLintProperty | ESLintSpreadElement | ESLintLegacySpreadProperty)[];
}
interface ESLintProperty extends HasLocation, HasParent {
  type: "Property";
  kind: "init" | "get" | "set";
  method: boolean;
  shorthand: boolean;
  computed: boolean;
  key: ESLintExpression;
  value: ESLintExpression | ESLintPattern;
}
interface ESLintFunctionExpression extends HasLocation, HasParent {
  type: "FunctionExpression";
  async: boolean;
  generator: boolean;
  id: ESLintIdentifier | null;
  params: ESLintPattern[];
  body: ESLintBlockStatement;
}
interface ESLintArrowFunctionExpression extends HasLocation, HasParent {
  type: "ArrowFunctionExpression";
  async: boolean;
  generator: boolean;
  id: ESLintIdentifier | null;
  params: ESLintPattern[];
  body: ESLintBlockStatement | ESLintExpression;
}
interface ESLintSequenceExpression extends HasLocation, HasParent {
  type: "SequenceExpression";
  expressions: ESLintExpression[];
}
interface ESLintUnaryExpression extends HasLocation, HasParent {
  type: "UnaryExpression";
  operator: "-" | "+" | "!" | "~" | "typeof" | "void" | "delete";
  prefix: boolean;
  argument: ESLintExpression;
}
interface ESLintBinaryExpression extends HasLocation, HasParent {
  type: "BinaryExpression";
  operator: "==" | "!=" | "===" | "!==" | "<" | "<=" | ">" | ">=" | "<<" | ">>" | ">>>" | "+" | "-" | "*" | "/" | "%" | "**" | "|" | "^" | "&" | "in" | "instanceof";
  left: ESLintExpression | ESLintPrivateIdentifier;
  right: ESLintExpression;
}
interface ESLintAssignmentExpression extends HasLocation, HasParent {
  type: "AssignmentExpression";
  operator: "=" | "+=" | "-=" | "*=" | "/=" | "%=" | "**=" | "<<=" | ">>=" | ">>>=" | "|=" | "^=" | "&=" | "||=" | "&&=" | "??=";
  left: ESLintPattern;
  right: ESLintExpression;
}
interface ESLintUpdateExpression extends HasLocation, HasParent {
  type: "UpdateExpression";
  operator: "++" | "--";
  argument: ESLintExpression;
  prefix: boolean;
}
interface ESLintLogicalExpression extends HasLocation, HasParent {
  type: "LogicalExpression";
  operator: "||" | "&&" | "??";
  left: ESLintExpression;
  right: ESLintExpression;
}
interface ESLintConditionalExpression extends HasLocation, HasParent {
  type: "ConditionalExpression";
  test: ESLintExpression;
  alternate: ESLintExpression;
  consequent: ESLintExpression;
}
interface ESLintCallExpression extends HasLocation, HasParent {
  type: "CallExpression";
  optional: boolean;
  callee: ESLintExpression | ESLintSuper;
  arguments: (ESLintExpression | ESLintSpreadElement)[];
}
interface ESLintSuper extends HasLocation, HasParent {
  type: "Super";
}
interface ESLintNewExpression extends HasLocation, HasParent {
  type: "NewExpression";
  callee: ESLintExpression;
  arguments: (ESLintExpression | ESLintSpreadElement)[];
}
interface ESLintMemberExpression extends HasLocation, HasParent {
  type: "MemberExpression";
  optional: boolean;
  computed: boolean;
  object: ESLintExpression | ESLintSuper;
  property: ESLintExpression | ESLintPrivateIdentifier;
}
interface ESLintYieldExpression extends HasLocation, HasParent {
  type: "YieldExpression";
  delegate: boolean;
  argument: ESLintExpression | null;
}
interface ESLintAwaitExpression extends HasLocation, HasParent {
  type: "AwaitExpression";
  argument: ESLintExpression;
}
interface ESLintTemplateLiteral extends HasLocation, HasParent {
  type: "TemplateLiteral";
  quasis: ESLintTemplateElement[];
  expressions: ESLintExpression[];
}
interface ESLintTaggedTemplateExpression extends HasLocation, HasParent {
  type: "TaggedTemplateExpression";
  tag: ESLintExpression;
  quasi: ESLintTemplateLiteral;
}
interface ESLintTemplateElement extends HasLocation, HasParent {
  type: "TemplateElement";
  tail: boolean;
  value: {
    cooked: string | null;
    raw: string;
  };
}
interface ESLintClassExpression extends HasLocation, HasParent {
  type: "ClassExpression";
  id: ESLintIdentifier | null;
  superClass: ESLintExpression | null;
  body: ESLintClassBody;
}
interface ESLintMetaProperty extends HasLocation, HasParent {
  type: "MetaProperty";
  meta: ESLintIdentifier;
  property: ESLintIdentifier;
}
type ESLintPattern = ESLintIdentifier | ESLintObjectPattern | ESLintArrayPattern | ESLintRestElement | ESLintAssignmentPattern | ESLintMemberExpression | ESLintLegacyRestProperty;
interface ESLintObjectPattern extends HasLocation, HasParent {
  type: "ObjectPattern";
  properties: (ESLintAssignmentProperty | ESLintRestElement | ESLintLegacyRestProperty)[];
}
interface ESLintAssignmentProperty extends ESLintProperty {
  value: ESLintPattern;
  kind: "init";
  method: false;
}
interface ESLintArrayPattern extends HasLocation, HasParent {
  type: "ArrayPattern";
  elements: ESLintPattern[];
}
interface ESLintRestElement extends HasLocation, HasParent {
  type: "RestElement";
  argument: ESLintPattern;
}
interface ESLintSpreadElement extends HasLocation, HasParent {
  type: "SpreadElement";
  argument: ESLintExpression;
}
interface ESLintAssignmentPattern extends HasLocation, HasParent {
  type: "AssignmentPattern";
  left: ESLintPattern;
  right: ESLintExpression;
}
type ESLintChainElement = ESLintCallExpression | ESLintMemberExpression;
interface ESLintChainExpression extends HasLocation, HasParent {
  type: "ChainExpression";
  expression: ESLintChainElement;
}
/**
 * Legacy for babel-eslint and espree.
 */
interface ESLintLegacyRestProperty extends HasLocation, HasParent {
  type: "RestProperty" | "ExperimentalRestProperty";
  argument: ESLintPattern;
}
/**
 * Legacy for babel-eslint and espree.
 */
interface ESLintLegacySpreadProperty extends HasLocation, HasParent {
  type: "SpreadProperty" | "ExperimentalSpreadProperty";
  argument: ESLintExpression;
}
/**
 * Constants of namespaces.
 * @see https://infra.spec.whatwg.org/#namespaces
 */
declare const NS: Readonly<{
  HTML: "http://www.w3.org/1999/xhtml";
  MathML: "http://www.w3.org/1998/Math/MathML";
  SVG: "http://www.w3.org/2000/svg";
  XLink: "http://www.w3.org/1999/xlink";
  XML: "http://www.w3.org/XML/1998/namespace";
  XMLNS: "http://www.w3.org/2000/xmlns/";
}>;
/**
 * Type of namespaces.
 */
type Namespace = typeof NS.HTML | typeof NS.MathML | typeof NS.SVG | typeof NS.XLink | typeof NS.XML | typeof NS.XMLNS;
/**
 * Type of variable definitions.
 */
interface Variable {
  id: ESLintIdentifier;
  kind: "v-for" | "scope" | "generic";
  references: Reference[];
}
/**
 * Type of variable references.
 */
interface Reference {
  id: ESLintIdentifier;
  mode: "rw" | "r" | "w";
  variable: Variable | null;
  isValueReference?: boolean;
  isTypeReference?: boolean;
}
/**
 * The node of `v-for` directives.
 */
interface VForExpression extends HasLocation, HasParent {
  type: "VForExpression";
  parent: VExpressionContainer;
  left: ESLintPattern[];
  right: ESLintExpression;
}
/**
 * The node of `v-on` directives.
 */
interface VOnExpression extends HasLocation, HasParent {
  type: "VOnExpression";
  parent: VExpressionContainer;
  body: ESLintStatement[];
}
/**
 * The node of `slot-scope` directives.
 */
interface VSlotScopeExpression extends HasLocation, HasParent {
  type: "VSlotScopeExpression";
  parent: VExpressionContainer;
  params: ESLintPattern[];
}
/**
 * The node of `generic` directives.
 */
interface VGenericExpression extends HasLocation, HasParent {
  type: "VGenericExpression";
  parent: VExpressionContainer;
  params: TSTypeParameterDeclaration["params"];
  rawParams: string[];
}
/**
 * The node of a filter sequence which is separated by `|`.
 */
interface VFilterSequenceExpression extends HasLocation, HasParent {
  type: "VFilterSequenceExpression";
  parent: VExpressionContainer;
  expression: ESLintExpression;
  filters: VFilter[];
}
/**
 * The node of a filter sequence which is separated by `|`.
 */
interface VFilter extends HasLocation, HasParent {
  type: "VFilter";
  parent: VFilterSequenceExpression;
  callee: ESLintIdentifier;
  arguments: (ESLintExpression | ESLintSpreadElement)[];
}
/**
 * The union type of any nodes.
 */
type VNode = VAttribute | VDirective | VDirectiveKey | VDocumentFragment | VElement | VEndTag | VExpressionContainer | VIdentifier | VLiteral | VStartTag | VText;
/**
 * Text nodes.
 */
interface VText extends HasLocation, HasParent {
  type: "VText";
  parent: VDocumentFragment | VElement;
  value: string;
}
/**
 * The node of JavaScript expression in text.
 * e.g. `{{ name }}`
 */
interface VExpressionContainer extends HasLocation, HasParent {
  type: "VExpressionContainer";
  parent: VDocumentFragment | VElement | VDirective | VDirectiveKey;
  expression: ESLintExpression | VFilterSequenceExpression | VForExpression | VOnExpression | VSlotScopeExpression | VGenericExpression | null;
  references: Reference[];
}
/**
 * Attribute name nodes.
 */
interface VIdentifier extends HasLocation, HasParent {
  type: "VIdentifier";
  parent: VAttribute | VDirectiveKey;
  name: string;
  rawName: string;
}
/**
 * Attribute name nodes.
 */
interface VDirectiveKey extends HasLocation, HasParent {
  type: "VDirectiveKey";
  parent: VDirective;
  name: VIdentifier;
  argument: VExpressionContainer | VIdentifier | null;
  modifiers: VIdentifier[];
}
/**
 * Attribute value nodes.
 */
interface VLiteral extends HasLocation, HasParent {
  type: "VLiteral";
  parent: VAttribute;
  value: string;
}
/**
 * Static attribute nodes.
 */
interface VAttribute extends HasLocation, HasParent {
  type: "VAttribute";
  parent: VStartTag;
  directive: false;
  key: VIdentifier;
  value: VLiteral | null;
}
/**
 * Directive nodes.
 */
interface VDirective extends HasLocation, HasParent {
  type: "VAttribute";
  parent: VStartTag;
  directive: true;
  key: VDirectiveKey;
  value: VExpressionContainer | null;
}
/**
 * Start tag nodes.
 */
interface VStartTag extends HasLocation, HasParent {
  type: "VStartTag";
  parent: VElement;
  selfClosing: boolean;
  attributes: (VAttribute | VDirective)[];
}
/**
 * End tag nodes.
 */
interface VEndTag extends HasLocation, HasParent {
  type: "VEndTag";
  parent: VElement;
}
/**
 * The property which has concrete information.
 */
interface HasConcreteInfo {
  tokens: Token$1[];
  comments: Token$1[];
  errors: ParseError[];
}
/**
 * Element nodes.
 */
interface VElement extends HasLocation, HasParent {
  type: "VElement";
  parent: VDocumentFragment | VElement;
  namespace: Namespace;
  name: string;
  rawName: string;
  startTag: VStartTag;
  children: (VElement | VText | VExpressionContainer)[];
  endTag: VEndTag | null;
  variables: Variable[];
}
/**
 * Root nodes.
 */
interface VDocumentFragment extends HasLocation, HasParent, HasConcreteInfo {
  type: "VDocumentFragment";
  parent: null;
  children: (VElement | VText | VExpressionContainer | VStyleElement)[];
}
/**
 * Style element nodes.
 */
interface VStyleElement extends VElement {
  type: "VElement";
  name: "style";
  style: true;
  children: (VText | VExpressionContainer)[];
}
//#endregion
//#region src/ast/traverse.d.ts
declare const KEYS: Readonly<{
  [type: string]: readonly string[] | undefined;
}>;
/**
 * Get the keys of the given node to traverse it.
 * @param node The node to get.
 * @returns The keys to traverse.
 */
declare function getFallbackKeys(node: Node): string[];
interface Visitor {
  visitorKeys?: VisitorKeys$1;
  enterNode(node: Node, parent: Node | null): void;
  leaveNode(node: Node, parent: Node | null): void;
}
/**
 * Traverse the given AST tree.
 * @param node Root node to traverse.
 * @param visitor Visitor.
 */
declare function traverseNodes(node: Node, visitor: Visitor): void;
declare namespace index_d_exports {
  export { ESLintArrayExpression, ESLintArrayPattern, ESLintArrowFunctionExpression, ESLintAssignmentExpression, ESLintAssignmentPattern, ESLintAssignmentProperty, ESLintAwaitExpression, ESLintBigIntLiteral, ESLintBinaryExpression, ESLintBlockStatement, ESLintBooleanLiteral, ESLintBreakStatement, ESLintCallExpression, ESLintCatchClause, ESLintChainElement, ESLintChainExpression, ESLintClassBody, ESLintClassDeclaration, ESLintClassExpression, ESLintConditionalExpression, ESLintContinueStatement, ESLintDebuggerStatement, ESLintDeclaration, ESLintDoWhileStatement, ESLintEmptyStatement, ESLintExportAllDeclaration, ESLintExportDefaultDeclaration, ESLintExportNamedDeclaration, ESLintExportSpecifier, ESLintExpression, ESLintExpressionStatement, ESLintExtendedProgram, ESLintForInStatement, ESLintForOfStatement, ESLintForStatement, ESLintFunctionDeclaration, ESLintFunctionExpression, ESLintIdentifier, ESLintIfStatement, ESLintImportDeclaration, ESLintImportDefaultSpecifier, ESLintImportExpression, ESLintImportNamespaceSpecifier, ESLintImportSpecifier, ESLintLabeledStatement, ESLintLegacyRestProperty, ESLintLegacySpreadProperty, ESLintLiteral, ESLintLogicalExpression, ESLintMemberExpression, ESLintMetaProperty, ESLintMethodDefinition, ESLintModuleDeclaration, ESLintModuleSpecifier, ESLintNewExpression, ESLintNode, ESLintNullLiteral, ESLintNumberLiteral, ESLintObjectExpression, ESLintObjectPattern, ESLintPattern, ESLintPrivateIdentifier, ESLintProgram, ESLintProperty, ESLintPropertyDefinition, ESLintRegExpLiteral, ESLintRestElement, ESLintReturnStatement, ESLintSequenceExpression, ESLintSpreadElement, ESLintStatement, ESLintStaticBlock, ESLintStringLiteral, ESLintSuper, ESLintSwitchCase, ESLintSwitchStatement, ESLintTaggedTemplateExpression, ESLintTemplateElement, ESLintTemplateLiteral, ESLintThisExpression, ESLintThrowStatement, ESLintTryStatement, ESLintUnaryExpression, ESLintUpdateExpression, ESLintVariableDeclaration, ESLintVariableDeclarator, ESLintWhileStatement, ESLintWithStatement, ESLintYieldExpression, ErrorCode, HasConcreteInfo, HasLocation, HasParent, KEYS, Location, LocationRange, NS, Namespace, Node, Offset, OffsetRange, ParseError, Reference, Token$1 as Token, VAttribute, VDirective, VDirectiveKey, VDocumentFragment, VElement, VEndTag, VExpressionContainer, VFilter, VFilterSequenceExpression, VForExpression, VGenericExpression, VIdentifier, VLiteral, VNode, VOnExpression, VSlotScopeExpression, VStartTag, VStyleElement, VText, Variable, Visitor, getFallbackKeys, traverseNodes };
}
//#endregion
//#region src/index.d.ts
/**
 * Parse the given source code.
 * @param code The source code to parse.
 * @param parserOptions The parser options.
 * @returns The parsing result.
 */
declare function parseForESLint(code: string, parserOptions: any): ESLintExtendedProgram;
/**
 * Parse the given source code.
 * @param code The source code to parse.
 * @param options The parser options.
 * @returns The parsing result.
 */
declare function parse(code: string, options?: any): ESLintProgram;
declare const meta$1: {
  name: string;
  version: string;
};
//#endregion
export { type index_d_exports as AST, meta$1 as meta, parse, parseForESLint };
//# sourceMappingURL=index.d.cts.mapi6x	#{
  "name": "vue-eslint-parser",
  "version": "10.4.1",
  "description": "The ESLint custom parser for `.vue` files.",
  "main": "./dist/index.cjs",
  "types": "./dist/index.d.cts",
  "exports": {
    ".": "./dist/index.cjs",
    "./package.json": "./package.json"
  },
  "files": [
    "dist"
  ],
  "engines": {
    "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
  },
  "peerDependencies": {
    "eslint": "^8.57.0 || ^9.0.0 || ^10.0.0"
  },
  "dependencies": {
    "debug": "^4.4.0",
    "eslint-scope": "^8.2.0 || ^9.0.0",
    "eslint-visitor-keys": "^4.2.0 || ^5.0.0",
    "espree": "^10.3.0 || ^11.0.0",
    "esquery": "^1.6.0",
    "semver": "^7.6.3"
  },
  "devDependencies": {
    "@babel/core": "^7.26.7",
    "@babel/eslint-parser": "^7.28.6",
    "@babel/eslint-parser-8": "npm:@babel/eslint-parser@^8.0.0-rc.6",
    "@babel/plugin-syntax-decorators": "^7.25.9",
    "@babel/plugin-syntax-pipeline-operator": "^7.26.7",
    "@babel/plugin-syntax-typescript": "^7.25.9",
    "@eslint-community/eslint-plugin-eslint-comments": "^4.6.0",
    "@eslint/eslintrc": "^3.2.0",
    "@eslint/js": "^9.19.0",
    "@types/debug": "^4.1.7",
    "@types/estree": "^1.0.0",
    "@types/node": "^18.8.4",
    "@types/semver": "^7.3.12",
    "@typescript-eslint/eslint-plugin": "^8.55.0",
    "@typescript-eslint/parser": "^8.55.0",
    "@vitest/coverage-v8": "^3.2.4",
    "@vitest/ui": "^3.2.4",
    "eslint": "^10.0.0",
    "eslint-plugin-jsonc": "^2.19.1",
    "eslint-plugin-n": "^17.15.1",
    "eslint-plugin-node-dependencies": "^1.3.0",
    "eslint-plugin-prettier": "^5.2.3",
    "eslint-plugin-unicorn": "^57.0.0",
    "jsonc-eslint-parser": "^2.0.3",
    "prettier": "^3.4.2",
    "ts-node": "^10.9.2",
    "tsdown": "^0.20.3",
    "typescript": "~5.7.3",
    "vite": "^6.3.5",
    "vitest": "^3.2.4"
  },
  "scripts": {
    "dev": "tsdown --watch",
    "build": "tsdown",
    "coverage": "vitest --coverage --ui",
    "lint": "eslint src test package.json",
    "test": "vitest",
    "test:cover": "vitest --coverage",
    "preversion": "npm test -- run",
    "version": "npm run -s build",
    "postversion": "git push && git push --tags"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/vuejs/vue-eslint-parser.git"
  },
  "keywords": [],
  "author": "Toru Nagashima",
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/vuejs/vue-eslint-parser/issues"
  },
  "homepage": "https://github.com/vuejs/vue-eslint-parser#readme",
  "funding": "https://github.com/sponsors/mysticatea"
}
:Gx %100644 CHANGELOG.md <]zȞ~𾗜&100644 LICENSE 1_哖Z/PS.100644 README.md ̓5	q.Mݚ&լϸ40000 bin yLNR0Ӝ*/i100644 package.json RKLP#l:ׂ100644 which.js 7I~,H{Wxk
# Changes


## 2.0.2

* Rename bin to `node-which`

## 2.0.1

* generate changelog and publish on version bump
* enforce 100% test coverage
* Promise interface

## 2.0.0

* Parallel tests, modern JavaScript, and drop support for node < 8

## 1.3.1

* update deps
* update travis

## v1.3.0

* Add nothrow option to which.sync
* update tap

## v1.2.14

* appveyor: drop node 5 and 0.x
* travis-ci: add node 6, drop 0.x

## v1.2.13

* test: Pass missing option to pass on windows
* update tap
* update isexe to 2.0.0
* neveragain.tech pledge request

## v1.2.12

* Removed unused require

## v1.2.11

* Prevent changelog script from being included in package

## v1.2.10

* Use env.PATH only, not env.Path

## v1.2.9

* fix for paths starting with ../
* Remove unused `is-absolute` module

## v1.2.8

* bullet items in changelog that contain (but don't start with) #

## v1.2.7

* strip 'update changelog' changelog entries out of changelog

## v1.2.6

* make the changelog bulleted

## v1.2.5

* make a changelog, and keep it up to date
* don't include tests in package
* Properly handle relative-path executables
* appveyor
* Attach error code to Not Found error
* Make tests pass on Windows

## v1.2.4

* Fix typo

## v1.2.3

* update isexe, fix regression in pathExt handling

## v1.2.2

* update deps, use isexe module, test windows

## v1.2.1

* Sometimes windows PATH entries are quoted
* Fixed a bug in the check for group and user mode bits. This bug was introduced during refactoring for supporting strict mode.
* doc cli

## v1.2.0

* Add support for opt.all and -as cli flags
* test the bin
* update travis
* Allow checking for multiple programs in bin/which
* tap 2

## v1.1.2

* travis
* Refactored and fixed undefined error on Windows
* Support strict mode

## v1.1.1

* test +g exes against secondary groups, if available
* Use windows exe semantics on cygwin & msys
* cwd should be first in path on win32, not last
* Handle lower-case 'env.Path' on Windows
* Update docs
* use single-quotes

## v1.1.0

* Add tests, depend on is-absolute

## v1.0.9

* which.js: root is allowed to execute files owned by anyone

## v1.0.8

* don't use graceful-fs

## v1.0.7

* add license to package.json

## v1.0.6

* isc license

## 1.0.5

* Awful typo

## 1.0.4

* Test for path absoluteness properly
* win: Allow '' as a pathext if cmd has a . in it

## 1.0.3

* Remove references to execPath
* Make `which.sync()` work on Windows by honoring the PATHEXT variable.
* Make `isExe()` always return true on Windows.
* MIT

## 1.0.2

* Only files can be exes

## 1.0.1

* Respect the PATHEXT env for win32 support
* should 0755 the bin
* binary
* guts
* package
* 1st
L=TxH# which

Like the unix `which` utility.

Finds the first instance of a specified executable in the PATH
environment variable.  Does not cache the results, so `hash -r` is not
needed when the PATH changes.

## USAGE

```javascript
var which = require('which')

// async usage
which('node', function (er, resolvedPath) {
  // er is returned if no "node" is found on the PATH
  // if it is found, then the absolute path to the exec is returned
})

// or promise
which('node').then(resolvedPath => { ... }).catch(er => { ... not found ... })

// sync usage
// throws if not found
var resolved = which.sync('node')

// if nothrow option is used, returns null if not found
resolved = which.sync('node', {nothrow: true})

// Pass options to override the PATH and PATHEXT environment vars.
which('node', { path: someOtherPath }, function (er, resolved) {
  if (er)
    throw er
  console.log('found at %j', resolved)
})
```

## CLI USAGE

Same as the BSD `which(1)` binary.

```
usage: which [-as] program ...
```

## OPTIONS

You may pass an options object as the second argument.

- `path`: Use instead of the `PATH` environment variable.
- `pathExt`: Use instead of the `PATHEXT` environment variable.
- `all`: Return all matches, instead of just the first one.  Note that
  this means the function returns an array of strings instead of a
  single string.
lզx& 100644 node-which |7)О9tJuzA=x&#!/usr/bin/env node
var which = require("../")
if (process.argv.length < 3)
  usage()

function usage () {
  console.error('usage: which [-as] program ...')
  process.exit(1)
}

var all = false
var silent = false
var dashdash = false
var args = process.argv.slice(2).filter(function (arg) {
  if (dashdash || !/^-/.test(arg))
    return true

  if (arg === '--') {
    dashdash = true
    return false
  }

  var flags = arg.substr(1).split('')
  for (var f = 0; f < flags.length; f++) {
    var flag = flags[f]
    switch (flag) {
      case 's':
        silent = true
        break
      case 'a':
        all = true
        break
      default:
        console.error('which: illegal option -- ' + flag)
        usage()
    }
  }
  return false
})

process.exit(args.reduce(function (pv, current) {
  try {
    var f = which.sync(current, { all: all })
    if (all)
      f = f.join('\n')
    if (!silent)
      console.log(f)
    return pv;
  } catch (e) {
    return 1;
  }
}, 0))
 γAx{
  "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)",
  "name": "which",
  "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.",
  "version": "2.0.2",
  "repository": {
    "type": "git",
    "url": "git://github.com/isaacs/node-which.git"
  },
  "main": "which.js",
  "bin": {
    "node-which": "./bin/node-which"
  },
  "license": "ISC",
  "dependencies": {
    "isexe": "^2.0.0"
  },
  "devDependencies": {
    "mkdirp": "^0.5.0",
    "rimraf": "^2.6.2",
    "tap": "^14.6.9"
  },
  "scripts": {
    "test": "tap",
    "preversion": "npm test",
    "postversion": "npm publish",
    "prepublish": "npm run changelog",
    "prechangelog": "bash gen-changelog.sh",
    "changelog": "git add CHANGELOG.md",
    "postchangelog": "git commit -m 'update changelog - '${npm_package_version}",
    "postpublish": "git push origin --follow-tags"
  },
  "files": [
    "which.js",
    "bin/node-which"
  ],
  "tap": {
    "check-coverage": true
  },
  "engines": {
    "node": ">= 8"
  }
}
/x[const isWindows = process.platform === 'win32' ||
    process.env.OSTYPE === 'cygwin' ||
    process.env.OSTYPE === 'msys'

const path = require('path')
const COLON = isWindows ? ';' : ':'
const isexe = require('isexe')

const getNotFoundError = (cmd) =>
  Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })

const getPathInfo = (cmd, opt) => {
  const colon = opt.colon || COLON

  // If it has a slash, then we don't bother searching the pathenv.
  // just check the file itself, and that's it.
  const pathEnv = cmd.match(/\//) || isWindows && cmd.match(/\\/) ? ['']
    : (
      [
        // windows always checks the cwd first
        ...(isWindows ? [process.cwd()] : []),
        ...(opt.path || process.env.PATH ||
          /* istanbul ignore next: very unusual */ '').split(colon),
      ]
    )
  const pathExtExe = isWindows
    ? opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM'
    : ''
  const pathExt = isWindows ? pathExtExe.split(colon) : ['']

  if (isWindows) {
    if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
      pathExt.unshift('')
  }

  return {
    pathEnv,
    pathExt,
    pathExtExe,
  }
}

const which = (cmd, opt, cb) => {
  if (typeof opt === 'function') {
    cb = opt
    opt = {}
  }
  if (!opt)
    opt = {}

  const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)
  const found = []

  const step = i => new Promise((resolve, reject) => {
    if (i === pathEnv.length)
      return opt.all && found.length ? resolve(found)
        : reject(getNotFoundError(cmd))

    const ppRaw = pathEnv[i]
    const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw

    const pCmd = path.join(pathPart, cmd)
    const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd
      : pCmd

    resolve(subStep(p, i, 0))
  })

  const subStep = (p, i, ii) => new Promise((resolve, reject) => {
    if (ii === pathExt.length)
      return resolve(step(i + 1))
    const ext = pathExt[ii]
    isexe(p + ext, { pathExt: pathExtExe }, (er, is) => {
      if (!er && is) {
        if (opt.all)
          found.push(p + ext)
        else
          return resolve(p + ext)
      }
      return resolve(subStep(p, i, ii + 1))
    })
  })

  return cb ? step(0).then(res => cb(null, res), cb) : step(0)
}

const whichSync = (cmd, opt) => {
  opt = opt || {}

  const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)
  const found = []

  for (let i = 0; i < pathEnv.length; i ++) {
    const ppRaw = pathEnv[i]
    const pathPart = /^".*"$/.test(ppRaw) ? ppRaw.slice(1, -1) : ppRaw

    const pCmd = path.join(pathPart, cmd)
    const p = !pathPart && /^\.[\\\/]/.test(cmd) ? cmd.slice(0, 2) + pCmd
      : pCmd

    for (let j = 0; j < pathExt.length; j ++) {
      const cur = p + pathExt[j]
      try {
        const is = isexe.sync(cur, { pathExt: pathExtExe })
        if (is) {
          if (opt.all)
            found.push(cur)
          else
            return cur
        }
      } catch (ex) {}
    }
  }

  if (opt.all && found.length)
    return found

  if (opt.nothrow)
    return null

  throw getNotFoundError(cmd)
}

module.exports = which
which.sync = whichSync
x E100644 LICENSE "	&0^!t7R100644 README.md 382@Kev5Z	100644 index.d.ts og,M
q֚EQ100644 index.js wlsj=100644 package.json EFDzt]ݾm)2}}Q?ϰx?# word-wrap [![NPM version](https://img.shields.io/npm/v/word-wrap.svg?style=flat)](https://www.npmjs.com/package/word-wrap) [![NPM monthly downloads](https://img.shields.io/npm/dm/word-wrap.svg?style=flat)](https://npmjs.org/package/word-wrap) [![NPM total downloads](https://img.shields.io/npm/dt/word-wrap.svg?style=flat)](https://npmjs.org/package/word-wrap) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/word-wrap.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/word-wrap)

> Wrap words to a specified length.

Please consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.

## Install

Install with [npm](https://www.npmjs.com/):

```sh
$ npm install --save word-wrap
```

## Usage

```js
var wrap = require('word-wrap');

wrap('Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.');
```

Results in:

```
  Lorem ipsum dolor sit amet, consectetur adipiscing
  elit, sed do eiusmod tempor incididunt ut labore
  et dolore magna aliqua. Ut enim ad minim veniam,
  quis nostrud exercitation ullamco laboris nisi ut
  aliquip ex ea commodo consequat.
```

## Options

![image](https://cloud.githubusercontent.com/assets/383994/6543728/7a381c08-c4f6-11e4-8b7d-b6ba197569c9.png)

### options.width

Type: `Number`

Default: `50`

The width of the text before wrapping to a new line.

**Example:**

```js
wrap(str, {width: 60});
```

### options.indent

Type: `String`

Default: `` (two spaces)

The string to use at the beginning of each line.

**Example:**

```js
wrap(str, {indent: '      '});
```

### options.newline

Type: `String`

Default: `\n`

The string to use at the end of each line.

**Example:**

```js
wrap(str, {newline: '\n\n'});
```

### options.escape

Type: `function`

Default: `function(str){return str;}`

An escape function to run on each line after splitting them.

**Example:**

```js
var xmlescape = require('xml-escape');
wrap(str, {
  escape: function(string){
    return xmlescape(string);
  }
});
```

### options.trim

Type: `Boolean`

Default: `false`

Trim trailing whitespace from the returned string. This option is included since `.trim()` would also strip the leading indentation from the first line.

**Example:**

```js
wrap(str, {trim: true});
```

### options.cut

Type: `Boolean`

Default: `false`

Break a word between any two letters when the word is longer than the specified width.

**Example:**

```js
wrap(str, {cut: true});
```

## About

<details>
<summary><strong>Contributing</strong></summary>

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).

</details>

<details>
<summary><strong>Running Tests</strong></summary>

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

```sh
$ npm install && npm test
```

</details>

<details>
<summary><strong>Building docs</strong></summary>

_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_

To generate the readme, run the following command:

```sh
$ npm install -g verbose/verb#dev verb-generate-readme && verb
```

</details>

### Related projects

You might also be interested in these projects:

* [common-words](https://www.npmjs.com/package/common-words): Updated list (JSON) of the 100 most common words in the English language. Useful for… [more](https://github.com/jonschlinkert/common-words) | [homepage](https://github.com/jonschlinkert/common-words "Updated list (JSON) of the 100 most common words in the English language. Useful for excluding these words from arrays.")
* [shuffle-words](https://www.npmjs.com/package/shuffle-words): Shuffle the words in a string and optionally the letters in each word using the… [more](https://github.com/jonschlinkert/shuffle-words) | [homepage](https://github.com/jonschlinkert/shuffle-words "Shuffle the words in a string and optionally the letters in each word using the Fisher-Yates algorithm. Useful for creating test fixtures, benchmarking samples, etc.")
* [unique-words](https://www.npmjs.com/package/unique-words): Returns an array of unique words, or the number of occurrences of each word in… [more](https://github.com/jonschlinkert/unique-words) | [homepage](https://github.com/jonschlinkert/unique-words "Returns an array of unique words, or the number of occurrences of each word in a string or list.")
* [wordcount](https://www.npmjs.com/package/wordcount): Count the words in a string. Support for english, CJK and Cyrillic. | [homepage](https://github.com/jonschlinkert/wordcount "Count the words in a string. Support for english, CJK and Cyrillic.")

### Contributors

| **Commits** | **Contributor** |  
| --- | --- |  
| 47 | [jonschlinkert](https://github.com/jonschlinkert) |  
| 7  | [OlafConijn](https://github.com/OlafConijn) |  
| 3  | [doowb](https://github.com/doowb) |  
| 2  | [aashutoshrathi](https://github.com/aashutoshrathi) |  
| 2  | [lordvlad](https://github.com/lordvlad) |  
| 2  | [hildjj](https://github.com/hildjj) |  
| 1  | [danilosampaio](https://github.com/danilosampaio) |  
| 1  | [2fd](https://github.com/2fd) |  
| 1  | [leonard-thieu](https://github.com/leonard-thieu) |  
| 1  | [mohd-akram](https://github.com/mohd-akram) |  
| 1  | [toddself](https://github.com/toddself) |  
| 1  | [wolfgang42](https://github.com/wolfgang42) |  
| 1  | [zachhale](https://github.com/zachhale) |  

### Author

**Jon Schlinkert**

* [GitHub Profile](https://github.com/jonschlinkert)
* [Twitter Profile](https://twitter.com/jonschlinkert)
* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)

### License

Copyright © 2023, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).

***

_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on July 22, 2023._GjMx$/**
 * Wrap words to a specified length.
 */
export = wrap;

declare function wrap(str: string, options?: wrap.IOptions): string;

declare namespace wrap {
    export interface IOptions {

        /**
         * The width of the text before wrapping to a new line.
         * @default ´50´
         */
        width?: number;

        /**
         * The string to use at the beginning of each line.
         * @default ´  ´ (two spaces)
         */
        indent?: string;

        /**
         * The string to use at the end of each line.
         * @default ´\n´
         */
        newline?: string;

        /**
         * An escape function to run on each line after splitting them.
         * @default (str: string) => string;
         */
        escape?: (str: string) => string;

        /**
         * Trim trailing whitespace from the returned string.
         * This option is included since .trim() would also strip
         * the leading indentation from the first line.
         * @default true
         */
        trim?: boolean;

        /**
         * Break a word between any two letters when the word is longer
         * than the specified width.
         * @default false
         */
        cut?: boolean;
    }
}
^d)ZxP/*!
 * word-wrap <https://github.com/jonschlinkert/word-wrap>
 *
 * Copyright (c) 2014-2023, Jon Schlinkert.
 * Released under the MIT License.
 */

function trimEnd(str) {
  let lastCharPos = str.length - 1;
  let lastChar = str[lastCharPos];
  while(lastChar === ' ' || lastChar === '\t') {
    lastChar = str[--lastCharPos];
  }
  return str.substring(0, lastCharPos + 1);
}

function trimTabAndSpaces(str) {
  const lines = str.split('\n');
  const trimmedLines = lines.map((line) => trimEnd(line));
  return trimmedLines.join('\n');
}

module.exports = function(str, options) {
  options = options || {};
  if (str == null) {
    return str;
  }

  var width = options.width || 50;
  var indent = (typeof options.indent === 'string')
    ? options.indent
    : '  ';

  var newline = options.newline || '\n' + indent;
  var escape = typeof options.escape === 'function'
    ? options.escape
    : identity;

  var regexString = '.{1,' + width + '}';
  if (options.cut !== true) {
    regexString += '([\\s\u200B]+|$)|[^\\s\u200B]+?([\\s\u200B]+|$)';
  }

  var re = new RegExp(regexString, 'g');
  var lines = str.match(re) || [];
  var result = indent + lines.map(function(line) {
    if (line.slice(-1) === '\n') {
      line = line.slice(0, line.length - 1);
    }
    return escape(line);
  }).join(newline);

  if (options.trim === true) {
    result = trimTabAndSpaces(result);
  }
  return result;
};

function identity(str) {
  return str;
}
S,kxC{
  "name": "word-wrap",
  "description": "Wrap words to a specified length.",
  "version": "1.2.5",
  "homepage": "https://github.com/jonschlinkert/word-wrap",
  "author": "Jon Schlinkert (https://github.com/jonschlinkert)",
  "contributors": [
    "Danilo Sampaio <danilo.sampaio@gmail.com> (localhost:8080)",
    "Fede Ramirez <i@2fd.me> (https://2fd.github.io)",
    "Joe Hildebrand <joe-github@cursive.net> (https://twitter.com/hildjj)",
    "Jon Schlinkert <jon.schlinkert@sellside.com> (http://twitter.com/jonschlinkert)",
    "Todd Kennedy (https://tck.io)",
    "Waldemar Reusch (https://github.com/lordvlad)",
    "Wolfgang Faust (http://www.linestarve.com)",
    "Zach Hale <zachhale@gmail.com> (http://zachhale.com)"
  ],
  "repository": "jonschlinkert/word-wrap",
  "bugs": {
    "url": "https://github.com/jonschlinkert/word-wrap/issues"
  },
  "license": "MIT",
  "files": [
    "index.js",
    "index.d.ts"
  ],
  "main": "index.js",
  "engines": {
    "node": ">=0.10.0"
  },
  "scripts": {
    "test": "mocha"
  },
  "devDependencies": {
    "gulp-format-md": "^0.1.11",
    "mocha": "^3.2.0"
  },
  "keywords": [
    "break",
    "carriage",
    "line",
    "new-line",
    "newline",
    "return",
    "soft",
    "text",
    "word",
    "word-wrap",
    "words",
    "wrap"
  ],
  "typings": "index.d.ts",
  "verb": {
    "toc": false,
    "layout": "default",
    "tasks": [
      "readme"
    ],
    "plugins": [
      "gulp-format-md"
    ],
    "lint": {
      "reflinks": true
    },
    "related": {
      "list": [
        "common-words",
        "shuffle-words",
        "unique-words",
        "wordcount"
      ]
    },
    "reflinks": [
      "verb",
      "verb-generate-readme"
    ]
  }
}
	x m100644 LICENSE.txt ١ܕ4K100644 README.md _A2\WWa,Ƨ940000 lib ȝ	K="0P100644 package.json :=%m.";GL«9x'B                                 Apache License
                           Version 2.0, January 2004
                        http://www.apache.org/licenses/

   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION

   1. Definitions.

      "License" shall mean the terms and conditions for use, reproduction,
      and distribution as defined by Sections 1 through 9 of this document.

      "Licensor" shall mean the copyright owner or entity authorized by
      the copyright owner that is granting the License.

      "Legal Entity" shall mean the union of the acting entity and all
      other entities that control, are controlled by, or are under common
      control with that entity. For the purposes of this definition,
      "control" means (i) the power, direct or indirect, to cause the
      direction or management of such entity, whether by contract or
      otherwise, or (ii) ownership of fifty percent (50%) or more of the
      outstanding shares, or (iii) beneficial ownership of such entity.

      "You" (or "Your") shall mean an individual or Legal Entity
      exercising permissions granted by this License.

      "Source" form shall mean the preferred form for making modifications,
      including but not limited to software source code, documentation
      source, and configuration files.

      "Object" form shall mean any form resulting from mechanical
      transformation or translation of a Source form, including but
      not limited to compiled object code, generated documentation,
      and conversions to other media types.

      "Work" shall mean the work of authorship, whether in Source or
      Object form, made available under the License, as indicated by a
      copyright notice that is included in or attached to the work
      (an example is provided in the Appendix below).

      "Derivative Works" shall mean any work, whether in Source or Object
      form, that is based on (or derived from) the Work and for which the
      editorial revisions, annotations, elaborations, or other modifications
      represent, as a whole, an original work of authorship. For the purposes
      of this License, Derivative Works shall not include works that remain
      separable from, or merely link (or bind by name) to the interfaces of,
      the Work and Derivative Works thereof.

      "Contribution" shall mean any work of authorship, including
      the original version of the Work and any modifications or additions
      to that Work or Derivative Works thereof, that is intentionally
      submitted to Licensor for inclusion in the Work by the copyright owner
      or by an individual or Legal Entity authorized to submit on behalf of
      the copyright owner. For the purposes of this definition, "submitted"
      means any form of electronic, verbal, or written communication sent
      to the Licensor or its representatives, including but not limited to
      communication on electronic mailing lists, source code control systems,
      and issue tracking systems that are managed by, or on behalf of, the
      Licensor for the purpose of discussing and improving the Work, but
      excluding communication that is conspicuously marked or otherwise
      designated in writing by the copyright owner as "Not a Contribution."

      "Contributor" shall mean Licensor and any individual or Legal Entity
      on behalf of whom a Contribution has been received by Licensor and
      subsequently incorporated within the Work.

   2. Grant of Copyright License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      copyright license to reproduce, prepare Derivative Works of,
      publicly display, publicly perform, sublicense, and distribute the
      Work and such Derivative Works in Source or Object form.

   3. Grant of Patent License. Subject to the terms and conditions of
      this License, each Contributor hereby grants to You a perpetual,
      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
      (except as stated in this section) patent license to make, have made,
      use, offer to sell, sell, import, and otherwise transfer the Work,
      where such license applies only to those patent claims licensable
      by such Contributor that are necessarily infringed by their
      Contribution(s) alone or by combination of their Contribution(s)
      with the Work to which such Contribution(s) was submitted. If You
      institute patent litigation against any entity (including a
      cross-claim or counterclaim in a lawsuit) alleging that the Work
      or a Contribution incorporated within the Work constitutes direct
      or contributory patent infringement, then any patent licenses
      granted to You under this License for that Work shall terminate
      as of the date such litigation is filed.

   4. Redistribution. You may reproduce and distribute copies of the
      Work or Derivative Works thereof in any medium, with or without
      modifications, and in Source or Object form, provided that You
      meet the following conditions:

      (a) You must give any other recipients of the Work or
          Derivative Works a copy of this License; and

      (b) You must cause any modified files to carry prominent notices
          stating that You changed the files; and

      (c) You must retain, in the Source form of any Derivative Works
          that You distribute, all copyright, patent, trademark, and
          attribution notices from the Source form of the Work,
          excluding those notices that do not pertain to any part of
          the Derivative Works; and

      (d) If the Work includes a "NOTICE" text file as part of its
          distribution, then any Derivative Works that You distribute must
          include a readable copy of the attribution notices contained
          within such NOTICE file, excluding those notices that do not
          pertain to any part of the Derivative Works, in at least one
          of the following places: within a NOTICE text file distributed
          as part of the Derivative Works; within the Source form or
          documentation, if provided along with the Derivative Works; or,
          within a display generated by the Derivative Works, if and
          wherever such third-party notices normally appear. The contents
          of the NOTICE file are for informational purposes only and
          do not modify the License. You may add Your own attribution
          notices within Derivative Works that You distribute, alongside
          or as an addendum to the NOTICE text from the Work, provided
          that such additional attribution notices cannot be construed
          as modifying the License.

      You may add Your own copyright statement to Your modifications and
      may provide additional or different license terms and conditions
      for use, reproduction, or distribution of Your modifications, or
      for any such Derivative Works as a whole, provided Your use,
      reproduction, and distribution of the Work otherwise complies with
      the conditions stated in this License.

   5. Submission of Contributions. Unless You explicitly state otherwise,
      any Contribution intentionally submitted for inclusion in the Work
      by You to the Licensor shall be under the terms and conditions of
      this License, without any additional terms or conditions.
      Notwithstanding the above, nothing herein shall supersede or modify
      the terms of any separate license agreement you may have executed
      with Licensor regarding such Contributions.

   6. Trademarks. This License does not grant permission to use the trade
      names, trademarks, service marks, or product names of the Licensor,
      except as required for reasonable and customary use in describing the
      origin of the Work and reproducing the content of the NOTICE file.

   7. Disclaimer of Warranty. Unless required by applicable law or
      agreed to in writing, Licensor provides the Work (and each
      Contributor provides its Contributions) on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
      implied, including, without limitation, any warranties or conditions
      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
      PARTICULAR PURPOSE. You are solely responsible for determining the
      appropriateness of using or redistributing the Work and assume any
      risks associated with Your exercise of permissions under this License.

   8. Limitation of Liability. In no event and under no legal theory,
      whether in tort (including negligence), contract, or otherwise,
      unless required by applicable law (such as deliberate and grossly
      negligent acts) or agreed to in writing, shall any Contributor be
      liable to You for damages, including any direct, indirect, special,
      incidental, or consequential damages of any character arising as a
      result of this License or out of the use or inability to use the
      Work (including but not limited to damages for loss of goodwill,
      work stoppage, computer failure or malfunction, or any and all
      other commercial damages or losses), even if such Contributor
      has been advised of the possibility of such damages.

   9. Accepting Warranty or Additional Liability. While redistributing
      the Work or Derivative Works thereof, You may choose to offer,
      and charge a fee for, acceptance of support, warranty, indemnity,
      or other liability obligations and/or rights consistent with this
      License. However, in accepting such obligations, You may act only
      on Your own behalf and on Your sole responsibility, not on behalf
      of any other Contributor, and only if You agree to indemnify,
      defend, and hold each Contributor harmless for any liability
      incurred by, or claims asserted against, such Contributor by reason
      of your accepting any such warranty or additional liability.

   END OF TERMS AND CONDITIONS
xK_B>x# Validate XML Names and Qualified Names

This package simply tells you whether or not a string matches the [`Name`](http://www.w3.org/TR/xml/#NT-Name) or [`QName`](http://www.w3.org/TR/xml-names/#NT-QName) productions in the XML Namespaces specification. We use it for implementing the [validate](https://dom.spec.whatwg.org/#validate) algorithm in jsdom, but you can use it for whatever you want.

## Usage

This package's main module exports two functions, `name()` and `qname()`. Both take a string and return a boolean indicating whether or not the string matches the relevant production.

```js
"use strict":
const xnv = require("xml-name-validator");

// Will return true
xnv.name("x");
xnv.name(":");
xnv.name("a:0");
xnv.name("a:b:c");

// Will return false
xnv.name("\\");
xnv.name("'");
xnv.name("0");
xnv.name("a!");

// Will return true
xnv.qname("x");
xnv.qname("a0");
xnv.qname("a:b");

// Will return false
xnv.qname(":a");
xnv.qname(":b");
xnv.qname("a:b:c");
xnv.qname("a:0");
```
Mסx1 100644 xml-name-validator.js 2HAL+N뙽mjxX"use strict";

exports.name = potentialName => {
  return /^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/u.test(potentialName);
};

exports.qname = potentialQname => {
  return /(?:^[A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}][A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*:[A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}][A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$)|(?:^[A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}][A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\u{10000}-\u{EFFFF}\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$)/u.test(potentialQname);
};
x粻+xD{
  "name": "xml-name-validator",
  "description": "Validates whether a string matches the production for an XML name or qualified name",
  "keywords": [
    "xml",
    "name",
    "qname"
  ],
  "version": "5.0.0",
  "author": "Domenic Denicola <d@domenic.me> (https://domenic.me/)",
  "license": "Apache-2.0",
  "repository": "jsdom/xml-name-validator",
  "main": "lib/xml-name-validator.js",
  "files": [
    "lib/"
  ],
  "scripts": {
    "test": "node --test",
    "benchmark": "node scripts/benchmark.js",
    "lint": "eslint ."
  },
  "devDependencies": {
    "@domenic/eslint-config": "^3.0.0",
    "benchmark": "^2.1.4",
    "eslint": "^8.53.0"
  },
  "engines": {
    "node": ">=18"
  }
}
Ox E100644 index.d.ts AkDvOXp100644 index.js />mrXBjoA100644 license |JW?z100644 package.json qw0uI1<100644 readme.md /ĆԕQ£E}PĴGxtdeclare class Queue<ValueType> implements Iterable<ValueType> {
	/**
	The size of the queue.
	*/
	readonly size: number;

	/**
	Tiny queue data structure.

	The instance is an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols), which means you can iterate over the queue front to back with a “for…of” loop, or use spreading to convert the queue to an array. Don't do this unless you really need to though, since it's slow.

	@example
	```
	import Queue = require('yocto-queue');

	const queue = new Queue();

	queue.enqueue('🦄');
	queue.enqueue('🌈');

	console.log(queue.size);
	//=> 2

	console.log(...queue);
	//=> '🦄 🌈'

	console.log(queue.dequeue());
	//=> '🦄'

	console.log(queue.dequeue());
	//=> '🌈'
	```
	*/
	constructor();

	[Symbol.iterator](): IterableIterator<ValueType>;

	/**
	Add a value to the queue.
	*/
	enqueue(value: ValueType): void;

	/**
	Remove the next value in the queue.

	@returns The removed value or `undefined` if the queue is empty.
	*/
	dequeue(): ValueType | undefined;

	/**
	Clear the queue.
	*/
	clear(): void;
}

export = Queue;
`;xJclass Node {
	/// value;
	/// next;

	constructor(value) {
		this.value = value;

		// TODO: Remove this when targeting Node.js 12.
		this.next = undefined;
	}
}

class Queue {
	// TODO: Use private class fields when targeting Node.js 12.
	// #_head;
	// #_tail;
	// #_size;

	constructor() {
		this.clear();
	}

	enqueue(value) {
		const node = new Node(value);

		if (this._head) {
			this._tail.next = node;
			this._tail = node;
		} else {
			this._head = node;
			this._tail = node;
		}

		this._size++;
	}

	dequeue() {
		const current = this._head;
		if (!current) {
			return;
		}

		this._head = this._head.next;
		this._size--;
		return current.value;
	}

	clear() {
		this._head = undefined;
		this._tail = undefined;
		this._size = 0;
	}

	get size() {
		return this._size;
	}

	* [Symbol.iterator]() {
		let current = this._head;

		while (current) {
			yield current.value;
			current = current.next;
		}
	}
}

module.exports = Queue;
 -x*{
	"name": "yocto-queue",
	"version": "0.1.0",
	"description": "Tiny queue data structure",
	"license": "MIT",
	"repository": "sindresorhus/yocto-queue",
	"funding": "https://github.com/sponsors/sindresorhus",
	"author": {
		"name": "Sindre Sorhus",
		"email": "sindresorhus@gmail.com",
		"url": "https://sindresorhus.com"
	},
	"engines": {
		"node": ">=10"
	},
	"scripts": {
		"test": "xo && ava && tsd"
	},
	"files": [
		"index.js",
		"index.d.ts"
	],
	"keywords": [
		"queue",
		"data",
		"structure",
		"algorithm",
		"queues",
		"queuing",
		"list",
		"array",
		"linkedlist",
		"fifo",
		"enqueue",
		"dequeue",
		"data-structure"
	],
	"devDependencies": {
		"ava": "^2.4.0",
		"tsd": "^0.13.1",
		"xo": "^0.35.0"
	}
}
sQx0# yocto-queue [![](https://badgen.net/bundlephobia/minzip/yocto-queue)](https://bundlephobia.com/result?p=yocto-queue)

> Tiny queue data structure

You should use this package instead of an array if you do a lot of `Array#push()` and `Array#shift()` on large arrays, since `Array#shift()` has [linear time complexity](https://medium.com/@ariel.salem1989/an-easy-to-use-guide-to-big-o-time-complexity-5dcf4be8a444#:~:text=O(N)%E2%80%94Linear%20Time) *O(n)* while `Queue#dequeue()` has [constant time complexity](https://medium.com/@ariel.salem1989/an-easy-to-use-guide-to-big-o-time-complexity-5dcf4be8a444#:~:text=O(1)%20%E2%80%94%20Constant%20Time) *O(1)*. That makes a huge difference for large arrays.

> A [queue](https://en.wikipedia.org/wiki/Queue_(abstract_data_type)) is an ordered list of elements where an element is inserted at the end of the queue and is removed from the front of the queue. A queue works based on the first-in, first-out ([FIFO](https://en.wikipedia.org/wiki/FIFO_(computing_and_electronics))) principle.

## Install

```
$ npm install yocto-queue
```

## Usage

```js
const Queue = require('yocto-queue');

const queue = new Queue();

queue.enqueue('🦄');
queue.enqueue('🌈');

console.log(queue.size);
//=> 2

console.log(...queue);
//=> '🦄 🌈'

console.log(queue.dequeue());
//=> '🦄'

console.log(queue.dequeue());
//=> '🌈'
```

## API

### `queue = new Queue()`

The instance is an [`Iterable`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols), which means you can iterate over the queue front to back with a “for…of” loop, or use spreading to convert the queue to an array. Don't do this unless you really need to though, since it's slow.

#### `.enqueue(value)`

Add a value to the queue.

#### `.dequeue()`

Remove the next value in the queue.

Returns the removed value or `undefined` if the queue is empty.

#### `.clear()`

Clear the queue.

#### `.size`

The size of the queue.

## Related

- [quick-lru](https://github.com/sindresorhus/quick-lru) - Simple “Least Recently Used” (LRU) cache
~Ҫx E100644 index.d.ts FZ1
%100644 index.js ƿ=O&KdŰ#̢100644 license `nΑz)asL100644 package.json HU<'#V100644 readme.md =a8eiIRKĹxy/**
 * Handle values based on a field.
 *
 * @template {InvalidHandler} [Invalid=InvalidHandler]
 * @template {UnknownHandler} [Unknown=UnknownHandler]
 * @template {Record<string, Handler>} [Handlers=Record<string, Handler>]
 * @param {string} key
 *   Field to switch on.
 * @param {Options<Invalid, Unknown, Handlers>} [options]
 *   Configuration (required).
 * @returns {{unknown: Unknown, invalid: Invalid, handlers: Handlers, (...parameters: Parameters<Handlers[keyof Handlers]>): ReturnType<Handlers[keyof Handlers]>, (...parameters: Parameters<Unknown>): ReturnType<Unknown>}}
 */
export function zwitch<
  Invalid extends InvalidHandler = InvalidHandler,
  Unknown extends UnknownHandler = UnknownHandler,
  Handlers extends Record<string, Handler> = Record<string, Handler>
>(
  key: string,
  options?: Options<Invalid, Unknown, Handlers> | undefined
): {
  (...parameters: Parameters<Handlers[keyof Handlers]>): ReturnType<
    Handlers[keyof Handlers]
  >
  (...parameters: Parameters<Unknown>): ReturnType<Unknown>
  unknown: Unknown
  invalid: Invalid
  handlers: Handlers
}
/**
 * Handle a value, with a certain ID field set to a certain value.
 * The ID field is passed to `zwitch`, and it’s value is this function’s
 * place on the `handlers` record.
 */
export type Handler = (...parameters: any[]) => any
/**
 * Handle values that do have a certain ID field, but it’s set to a value
 * that is not listed in the `handlers` record.
 */
export type UnknownHandler = (value: unknown, ...rest: any[]) => any
/**
 * Handle values that do not have a certain ID field.
 */
export type InvalidHandler = (
  value: unknown,
  ...rest: any[]
) => void | null | undefined | never
/**
 * Configuration (required).
 */
export type Options<
  Invalid extends InvalidHandler = InvalidHandler,
  Unknown extends UnknownHandler = UnknownHandler,
  Handlers extends Record<string, Handler> = Record<string, Handler>
> = {
  /**
   * Handler to use for invalid values.
   */
  invalid?: Invalid | undefined
  /**
   * Handler to use for unknown values.
   */
  unknown?: Unknown | undefined
  /**
   * Handlers to use.
   */
  handlers?: Handlers | undefined
}
/Jx4/**
 * @callback Handler
 *   Handle a value, with a certain ID field set to a certain value.
 *   The ID field is passed to `zwitch`, and it’s value is this function’s
 *   place on the `handlers` record.
 * @param {...any} parameters
 *   Arbitrary parameters passed to the zwitch.
 *   The first will be an object with a certain ID field set to a certain value.
 * @returns {any}
 *   Anything!
 */

/**
 * @callback UnknownHandler
 *   Handle values that do have a certain ID field, but it’s set to a value
 *   that is not listed in the `handlers` record.
 * @param {unknown} value
 *   An object with a certain ID field set to an unknown value.
 * @param {...any} rest
 *   Arbitrary parameters passed to the zwitch.
 * @returns {any}
 *   Anything!
 */

/**
 * @callback InvalidHandler
 *   Handle values that do not have a certain ID field.
 * @param {unknown} value
 *   Any unknown value.
 * @param {...any} rest
 *   Arbitrary parameters passed to the zwitch.
 * @returns {void|null|undefined|never}
 *   This should crash or return nothing.
 */

/**
 * @template {InvalidHandler} [Invalid=InvalidHandler]
 * @template {UnknownHandler} [Unknown=UnknownHandler]
 * @template {Record<string, Handler>} [Handlers=Record<string, Handler>]
 * @typedef Options
 *   Configuration (required).
 * @property {Invalid} [invalid]
 *   Handler to use for invalid values.
 * @property {Unknown} [unknown]
 *   Handler to use for unknown values.
 * @property {Handlers} [handlers]
 *   Handlers to use.
 */

const own = {}.hasOwnProperty

/**
 * Handle values based on a field.
 *
 * @template {InvalidHandler} [Invalid=InvalidHandler]
 * @template {UnknownHandler} [Unknown=UnknownHandler]
 * @template {Record<string, Handler>} [Handlers=Record<string, Handler>]
 * @param {string} key
 *   Field to switch on.
 * @param {Options<Invalid, Unknown, Handlers>} [options]
 *   Configuration (required).
 * @returns {{unknown: Unknown, invalid: Invalid, handlers: Handlers, (...parameters: Parameters<Handlers[keyof Handlers]>): ReturnType<Handlers[keyof Handlers]>, (...parameters: Parameters<Unknown>): ReturnType<Unknown>}}
 */
export function zwitch(key, options) {
  const settings = options || {}

  /**
   * Handle one value.
   *
   * Based on the bound `key`, a respective handler will be called.
   * If `value` is not an object, or doesn’t have a `key` property, the special
   * “invalid” handler will be called.
   * If `value` has an unknown `key`, the special “unknown” handler will be
   * called.
   *
   * All arguments, and the context object, are passed through to the handler,
   * and it’s result is returned.
   *
   * @this {unknown}
   *   Any context object.
   * @param {unknown} [value]
   *   Any value.
   * @param {...unknown} parameters
   *   Arbitrary parameters passed to the zwitch.
   * @property {Handler} invalid
   *   Handle for values that do not have a certain ID field.
   * @property {Handler} unknown
   *   Handle values that do have a certain ID field, but it’s set to a value
   *   that is not listed in the `handlers` record.
   * @property {Handlers} handlers
   *   Record of handlers.
   * @returns {unknown}
   *   Anything.
   */
  function one(value, ...parameters) {
    /** @type {Handler|undefined} */
    let fn = one.invalid
    const handlers = one.handlers

    if (value && own.call(value, key)) {
      // @ts-expect-error Indexable.
      const id = String(value[key])
      // @ts-expect-error Indexable.
      fn = own.call(handlers, id) ? handlers[id] : one.unknown
    }

    if (fn) {
      return fn.call(this, value, ...parameters)
    }
  }

  one.handlers = settings.handlers || {}
  one.invalid = settings.invalid
  one.unknown = settings.unknown

  // @ts-expect-error: matches!
  return one
}
nx{
  "name": "zwitch",
  "version": "2.0.4",
  "description": "Handle values based on a property",
  "license": "MIT",
  "keywords": [
    "handle",
    "switch",
    "property"
  ],
  "repository": "wooorm/zwitch",
  "bugs": "https://github.com/wooorm/zwitch/issues",
  "funding": {
    "type": "github",
    "url": "https://github.com/sponsors/wooorm"
  },
  "author": "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)",
  "contributors": [
    "Titus Wormer <tituswormer@gmail.com> (https://wooorm.com)"
  ],
  "sideEffects": false,
  "type": "module",
  "main": "index.js",
  "types": "index.d.ts",
  "files": [
    "index.d.ts",
    "index.js"
  ],
  "devDependencies": {
    "@types/node": "^18.0.0",
    "c8": "^7.0.0",
    "prettier": "^2.0.0",
    "remark-cli": "^11.0.0",
    "remark-preset-wooorm": "^9.0.0",
    "tsd": "^0.24.0",
    "type-coverage": "^2.0.0",
    "typescript": "^4.0.0",
    "xo": "^0.52.0"
  },
  "scripts": {
    "prepack": "npm run build && npm run format",
    "build": "tsc --build --clean && tsc --build && tsd && type-coverage",
    "format": "remark . -qfo && prettier . -w --loglevel warn && xo --fix",
    "test-api": "node --conditions development test.js",
    "test-coverage": "c8 --check-coverage --100 --reporter lcov npm run test-api",
    "test": "npm run build && npm run format && npm run test-coverage"
  },
  "prettier": {
    "tabWidth": 2,
    "useTabs": false,
    "singleQuote": true,
    "bracketSpacing": false,
    "semi": false,
    "trailingComma": "none"
  },
  "xo": {
    "prettier": true
  },
  "remarkConfig": {
    "plugins": [
      "preset-wooorm"
    ]
  },
  "typeCoverage": {
    "atLeast": 100,
    "detail": true,
    "strict": true,
    "ignoreFiles": [
      "index.d.ts"
    ]
  }
}
H xB# zwitch

[![Build][build-badge]][build]
[![Coverage][coverage-badge]][coverage]
[![Downloads][downloads-badge]][downloads]
[![Size][size-badge]][size]

Handle values based on a field.

## Contents

*   [What is this?](#what-is-this)
*   [When should I use this?](#when-should-i-use-this)
*   [Install](#install)
*   [Use](#use)
*   [API](#api)
    *   [`zwitch(key[, options])`](#zwitchkey-options)
    *   [`one(value[, rest…])`](#onevalue-rest)
    *   [`function handler(value[, rest…])`](#function-handlervalue-rest)
*   [Types](#types)
*   [Compatibility](#compatibility)
*   [Related](#related)
*   [Contribute](#contribute)
*   [Security](#security)
*   [License](#license)

## What is this?

This is a tiny package that lets you `switch` between some field on objects.

## When should I use this?

This package is very useful when mapping one AST to another.
It’s a lot like a `switch` statement on one field, but it’s extensible.

## Install

This package is [ESM only][esm].
In Node.js (version 14.14+, 16.0+), install with [npm][]:

```sh
npm install zwitch
```

In Deno with [`esm.sh`][esmsh]:

```js
import {zwitch} from 'https://esm.sh/zwitch@2'
```

In browsers with [`esm.sh`][esmsh]:

```html
<script type="module">
  import {zwitch} from 'https://esm.sh/zwitch@2?bundle'
</script>
```

## Use

```js
import {zwitch} from 'zwitch'

const handle = zwitch('type', {invalid, unknown, handlers: {alpha: handleAlpha}})

handle({type: 'alpha'})

function handleAlpha() { /* … */ }
```

Or, with a `switch` statement:

```js
const field = 'type'

function handle(value) {
  let fn = invalid

  if (value && typeof value === 'object' && field in value) {
    switch (value[field]) {
      case 'alpha':
        fn = handleAlpha
        break
      default:
        fn = unknown
        break
    }
  }

  return fn.apply(this, arguments)
}

handle({type: 'alpha'})

function handleAlpha() { /* … */ }
function unknown() { /* … */ }
function invalid() { /* … */ }
```

## API

This package exports the identifier `zwitch`.
There is no default export.

### `zwitch(key[, options])`

Create a switch, based on a `key` (`string`).

##### `options`

Options can be omitted and added later to `one`.

###### `options.handlers`

Handlers to use, stored on `one.handlers` (`Record<string, Function>`,
optional).

###### `options.unknown`

Handler to use for unknown values, stored on `one.unknown` (`Function`,
optional).

###### `options.invalid`

Handler to use for invalid values, stored on `one.invalid` (`Function`,
optional).

###### Returns

See [`one`][one] (`Function`).

### `one(value[, rest…])`

Handle one value.
Based on the bound `key`, a respective handler will be called.
If `value` is not an object, or doesn’t have a `key` property, the special
“invalid” handler will be called.
If `value` has an unknown `key`, the special “unknown” handler will be called.

All arguments, and the context object (`this`), are passed through to the
[handler][], and it’s result is returned.

###### `one.handlers`

Map of [handler][]s (`Record<string, Function>`).

###### `one.invalid`

Special [`handler`][handler] called if a value doesn’t have a `key` property.
If not set, `undefined` is returned for invalid values.

###### `one.unknown`

Special [`handler`][handler] called if a value does not have a matching
handler.
If not set, `undefined` is returned for unknown values.

### `function handler(value[, rest…])`

Handle one value.

## Types

This package is fully typed with [TypeScript][].
It exports the types `Handler`, `UnknownHandler`, `InvalidHandler`, and
`Options`.

## Compatibility

This package is at least compatible with all maintained versions of Node.js.
As of now, that is Node.js 14.14+ and 16.0+.
It also works in Deno and modern browsers.

## Related

*   [`mapz`](https://github.com/wooorm/mapz)
    — functional map

## Contribute

Yes please!
See [How to Contribute to Open Source][contribute].

## Security

This package is safe.

## License

[MIT][license] © [Titus Wormer][author]

<!-- Definitions -->

[build-badge]: https://github.com/wooorm/zwitch/workflows/main/badge.svg

[build]: https://github.com/wooorm/zwitch/actions

[coverage-badge]: https://img.shields.io/codecov/c/github/wooorm/zwitch.svg

[coverage]: https://codecov.io/github/wooorm/zwitch

[downloads-badge]: https://img.shields.io/npm/dm/zwitch.svg

[downloads]: https://www.npmjs.com/package/zwitch

[size-badge]: https://img.shields.io/bundlephobia/minzip/zwitch.svg

[size]: https://bundlephobia.com/result?p=zwitch

[npm]: https://docs.npmjs.com/cli/install

[esm]: https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c

[esmsh]: https://esm.sh

[typescript]: https://www.typescriptlang.org

[contribute]: https://opensource.guide/how-to-contribute/

[license]: license

[author]: https://wooorm.com

[one]: #onevalue-rest

[handler]: #function-handlervalue-rest
p50}]ץ>#